diff --git a/contrib/gcc/BASE-VER b/contrib/gcc/BASE-VER new file mode 100644 index 00000000000..6aba2b245a8 --- /dev/null +++ b/contrib/gcc/BASE-VER @@ -0,0 +1 @@ +4.2.0 diff --git a/contrib/gcc/COPYING b/contrib/gcc/COPYING index d60c31a97a5..623b6258a13 100644 --- a/contrib/gcc/COPYING +++ b/contrib/gcc/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. diff --git a/contrib/gcc/COPYING.LIB b/contrib/gcc/COPYING.LIB index b1e3f5a2638..ae23fcfda2d 100644 --- a/contrib/gcc/COPYING.LIB +++ b/contrib/gcc/COPYING.LIB @@ -2,7 +2,7 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. diff --git a/contrib/gcc/ChangeLog b/contrib/gcc/ChangeLog index d17872fec44..eee0de5eaa0 100644 --- a/contrib/gcc/ChangeLog +++ b/contrib/gcc/ChangeLog @@ -1,9072 +1,1477 @@ -2006-04-25 Nick Clifton +2007-05-13 Release Manager - * config/m32r/m32r.c (gen_compare): Fix reg/smallconst equal code, - the patch for which was accidentally omitted from the previous - commit. + * GCC 4.2.0 released. -2006-04-04 Kazuhiro Inaoka +2007-05-12 Richard Guenther - PR target/26775 - PR target/26776 - * config/m32r/m32r.c (m32r_output_function_epilogue): Case for - a large stack frame at epilogue. Use fp to recover a stack - pointer for alloca function at epilogue. + PR tree-optimization/31797 + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not + propagate into a stmt that has volatile ops. - PR target/36276 - * config/m32r/m32r.c (gen_compare): Removed a rule addsi3 codes - to avoid a miss optimizing at simplify_relational_operation(). - * config/m32r/m32r.md (seq): Ditto. Changed reg_or_eq_int16_operand - to reg_or_uint16_operand because seq_insn has not used addsi3 already. - (seq_insn): Ditto. Removed operand check mode "P". Changed - reg_or_eq_int16_operand to reg_or_uint16_operand. +2007-05-01 Ian Lance Taylor -2006-03-05 Release Manager + PR tree-optimization/31739 + * tree-vrp.c (vrp_val_is_max): New static function. + (vrp_val_is_min): New static function. + (set_value_range_to_value): Use TYPE_{MAX,MIN}_VALUE rather than + copying the node. + (set_value_range): Use vrp_val_is_{max,min}. + (extract_range_from_assert): Likewise. + (extract_range_from_binary_expr): Likewise. + (extract_range_from_unary_expr): Likewise. + (dump_value_range, vrp_meet): Likewise. + (vrp_visit_phi_node): Likewise. + * tree.c (build_distinct_type_copy): Revert change of 2007-04-27. - * GCC 3.4.6 released. +2007-05-01 Joseph Myers -2006-03-01 Gabriel Dos Reis + * config/rs6000/libgcc-ppc-glibc.ver (__gcc_qgt): Fix typo. - Backport - 2005-11-03 James E Wilson +2007-04-27 Anatoly Sokolov - PR preprocessor/24202 - * cppfiles.c (_cpp_pop_file_buffer): Set buffer_valid to false. + * config/avr/avr.c (avr_mcu_types): Add support for ATmega8HVA and + ATmega16HVA devices. Move AT90USB82 device to 'avr5' architecture. + * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.). + * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.). -2006-03-01 Alan Modra +2007-04-27 Ian Lance Taylor - PR target/21616 - Revert most of 2004-03-10 changes, apply mainline 2005-01-07. - * config/rs6000/rs6000.c (invalid_gpr_mem): Delete. - (base_reg_operand): Delete. - (legitimate_offset_address_p): Revert 2004-03-10 changes. - (secondary_reload_class): Likewise. - (rs6000_legitimize_reload_address): Convert non-word aligned - offset address using ld/std into indirect address. - * config/rs6000/rs6000.h (SECONDARY_RELOAD_CLASS): Define. - (SECONDARY_INPUT_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS): Delete. - (PREDICATE_CODES): Delete invalid_gpr_mem and base_reg_operand. - * config/rs6000/rs6000-protos.h (secondary_reload_class): Update. - * config/rs6000/rs6000.md (movdf_hardfloat64): Remove m->b - alternative and split. - (movdi_internal64): Likewise. - (reload_outdf, reload_indf, reload_outdi, reload_indi): Delete. + PR middle-end/31710 + * tree.c (build_distinct_type_copy): If TYPE_MIN_VALUE or + TYPE_MAX_VALUE exist, convert them to the new type. -2006-02-28 Gabriel Dos Reis +2007-04-26 Ian Lance Taylor - Backport - 2004-04-28 Serge Belyshev <1319@bot.ru> - - PR 14944 - * coverage.c (read_counts_file): Fix usage of warning () call. - * pretty-print.c (pp_base_format_text): Fix typo in the comment. + PR target/28675 + * reload.c (find_reloads_subreg_address): If the address was valid + in the original mode but not in the new mode, reload the whole + address. -2006-02-18 Olivier Hainque +2007-04-26 Ulrich Weigand - PR ada/13408 - * pa.h (WIDEST_HARDWARE_FP_SIZE): Define. + PR middle-end/30761 + * reload1.c (eliminate_regs_in_insn): In the single_set special + case, attempt to re-recognize the insn before falling back to + having reload fix it up. -2006-02-13 Kaveh R. Ghazi +2007-04-26 Richard Guenther + Daniel Berlin - Backport: - 2006-02-01 Steve Ellcey + PR tree-optimization/30567 + * tree-ssa-structalias.c (update_alias_info): Record dereference + also if ESCAPE_STORED_IN_GLOBAL. - PR middle-end/24901 - * fold-const.c (fold_checksum_tree): Change type of buf. +2007-04-26 Jakub Jelinek -2006-02-11 Kaveh R. Ghazi + PR c++/31598 + * tree-inline.c (copy_body_r): Don't touch TREE_TYPE of OMP_CLAUSE. - * doc/contrib.texi: Update my entry. + PR tree-optimization/30558 + * tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW + clear this_state.prev_try. -2006-02-09 Eric Botcazou +2007-04-25 Anatoly Sokolov - * config/sparc/sparc.c (tls_call_delay): Fix oversight. + PR target/18989 + * config/avr/avr.h (ASM_OUTPUT_ALIGN): Redefine. -2006-02-07 John David Anglin +2007-04-24 Andrew Pinski + Roger Sayle - PR target/26109 - * pa.c (attr_length_indirect_call): Don't return length 8 for distances - >= 240000 when generating code for SOM runtime. - (output_indirect_call): Don't use "b,l" instruction for indirect calls - to $$dyncall when generating code for SOM runtime.. + PR middle-end/30222 + * expmed.c (make_tree): Use the correct type, i.e. the inner + type, when constructing the individual elements of a CONST_VECTOR. -2006-02-02 Nick Clifton +2007-04-24 Ian Lance Taylor - PR 24376 - * sched-rgn.c (add_branch_dependences): For cc0 targets extend - the dependencies inside a block back to the very first cc0 setter - in the block. + PR tree-optimization/31605 + * tree-vrp.c (set_value_range): Check that min and max are not + both overflow infinities. + (set_value_range_to_value): New static function. + (extract_range_from_binary_expr): Call set_value_range_to_value. + (extract_range_from_expr): Likewise. + (extract_range_from_unary_expr): Likewise. Don't create a range + which overflows on both sides. + (vrp_meet): Check for a useless range. + (vrp_visit_phi_node): If we see a constant which looks like an + overflow infinity, turn off the TREE_OVERFLOW flag. -2006-01-21 Joseph S. Myers +2007-04-24 Ian Lance Taylor - * gcc.c (process_command), gcov.c (print_version), gcov-dump.c - (print_version), mips-tdump.c (main), mips-tfile.c (main): Update - copyright notice dates. + PR tree-optimization/31602 + * tree-ssa-loop-ch.c (copy_loop_headers): Set TREE_NO_WARNING for + conditionals in the copied loop header. + * tree-cfg.c (fold_cond_expr_cond): Don't issue undefined overflow + warnings if TREE_NO_WARNING is set. + * doc/invoke.texi (Warning Options): Clarify that + -Wstrict-overflow does not warn about loops. -2006-01-12 Kaz Kojima +2007-04-24 Andreas Krebbel - PR target/25613 - * config/sh/sh.h (CONSTRAINT_LEN): Use unchecking version. + PR target/31641 + * config/s390/s390.c (s390_expand_setmem): Don't ICE for constant length + argument of 0 for memset. + (s390_expand_movmem, s390_expand_setmem, s390_expand_cmpmem): Use + unsigned shift instead of the signed variant. -2005-12-30 Roger Sayle +2007-04-24 Daniel Franke - PR target/25213 - Backport from mainline - 2005-09-06 Jakub Jelinek + * doc/invoke.texi: Removed leading '-' from option index entries. - PR rtl-optimization/23098 - * cse.c (fold_rtx_mem): Call delegitimize_address target hook. - * simplify-rtx.c (constant_pool_reference_p): New function. - * rtl.h (constant_pool_reference_p): New prototype. - * config/i386/i386.md (pushf split, mov[sdx]f split): Use - constant_pool_reference_p in condition and - avoid_constant_pool_reference in preparation statements. +2007-04-22 Andrew Pinski -2005-12-30 John David Anglin + PR middle-end/31448 + * expr.c (reduce_to_bit_field_precision): Handle + CONST_INT rtx's. - PR fortran/25586 - * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point - store patterns. +2007-04-20 Richard Henderson -2005-12-29 Alan Modra + PR target/28623 + * config/alpha/alpha.c (get_unaligned_address): Remove extra_offset + argument; update all callers. + (get_unaligned_offset): New. + * config/alpha/alpha.md (extendqidi2, extendhidi2): Don't use + get_unaligned_address, just pass on the address directly. + (unaligned_extendqidi): Use gen_lowpart instead of open-coding + the subreg in the helper patterns. + (unaligned_extendqidi_le): Use get_unaligned_offset. + (unaligned_extendqidi_be, unaligned_extendhidi_le): Likewise. + (unaligned_extendhidi_be): Likewise. + (unaligned_extendhidi): Tidy. + * config/alpha/alpha-protos.h: Update. - PR target/25572 - * config/rs6000/rs6000.c (create_TOC_reference): Set regs_ever_live. +2007-04-21 Richard Guenther -2005-12-17 Steven Bosscher + PR middle-end/31136 + * fold-const.c (fold_unary): Call fold_convert_const on the + original tree. - PR rtl-optimization/23837 - * optabs.c (expand_binop): For a multi-word rotate, never emit - a REG_NO_CONFLICT block. +2007-04-20 Richard Henderson -2005-12-16 John David Anglin + * config/alpha/linux.h (CPP_SPEC): Undef before redefine. - Backport from mainline: - 2004-11-01 Mike Stump +2007-04-20 Bernd Schmidt - * inclhack.def (stdio_va_list): Break out clients from here... - (stdio_va_list_clients): ...to here. Also, don't fix if stdarg.h is - included or ifdef va_start. - * fixincl.x: Regenerate. - -2005-12-13 Alan Modra + * reload.c (combine_reloads): When trying to use a dying register, + check whether it's uninitialized and don't use if so. - * config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define. +2007-04-20 Jakub Jelinek -2005-12-10 John David Anglin + * config/i386/i386.c (bdesc_2arg): Use ORDERED rather than UNORDERED + for __builtin_ia32_cmpordss. - PR target/25258 - * pa.c (som_text_section_asm_op): Use .NSUBSPA directive when changing - to the text subspace to output debugging information. + PR tree-optimization/31632 + * fold-const.c (fold_binary): Use op0 and op1 instead of arg0 + and arg1 for optimizations of comparison against min/max values. + Fold arg0 to arg1's type for optimizations of comparison against + min+1 and max-1 values. -2005-12-06 Alan Modra +2007-04-19 Eric Botcazou - PR other/13873 - * longlong.h: Merge PPC tests from upstream. + PR rtl-optimization/29841 + * cfgbuild.c (control_flow_insn_p): Return TRUE for unconditional + trap instructions. + * sched-deps.c (sched_analyze_insn): Prevent all non-jump instructions + that may cause control flow transfer from being moved. -2005-12-03 Kaveh R. Ghazi +2007-04-18 Anatoly Sokolov - PR middle-end/25022 - * builtins.c (expand_builtin_fputs, expand_builtin_printf, - expand_builtin_fprintf): Lookup the explicit replacement functions - for any unlocked stdio builtin transformations. + * config/avr/avr.c (ptrreg_to_str): Replace error() with + output_operand_lossage(). - * builtins.c (expand_builtin_fputs): Defer check for missing - replacement functions. +2007-04-17 Anatoly Sokolov -2005-12-02 Volker Reichelt + PR target/30483 + * config/avr/avr.c (ptrreg_to_str): Replace gcc_unreachable() with + error(). - PR c++/24103 - Backport: - 2002-08-22 Diego Novillo +2007-04-17 Jan Hubicka - * tree.c (simple_cst_equal): Call simple_cst_list_equal to compare - CONSTRUCTOR_ELTS pointers. + PR middle-end/30700 + * dwarf2out.c (reference_to_unused): Ask cgraph for functions + availablility; add more sanity checking; ask varpool only about + VAR_DECL. -2005-12-01 Gabriel Dos Reis - - * version.c: Bump version number. - * doc/include/gcc-common.texi: Likewise. - -2005-11-30 Release Manager - - * GCC 3.4.5 released. - -2005-11-23 Alan Modra - - PR middle-end/24950 - * expmed.c (store_bit_field): Don't attempt to insv a field - larger than the reg. - - Merge from trunk - 2005-11-14 Dale Johannesen - * expmed.c (store_bit_field): Add offset unconditionally for - memory targets. - (extract_bit_field): Don't force extzv or extv operand into - a register if field is too big. - 2004-12-01 Richard Henderson - * expmed.c (store_bit_field): Use simplify_gen_subreg instead - of gen_rtx_SUBREG directly. - -2005-11-16 Steve Ellcey - - PR target/24718 - * mklibgcc.in: Create dummy object for libgcc_eh.a - * config/ia64/hpux.h (LIBGCC_SPEC): Remove. - -2005-11-13 Andreas Jaeger - - * fixinc/check.tpl: Handle CVS additionally. - -2005-11-10 Uros Bizjak - - PR target/24315 - * config/i386/i386.md (*pushdi2_rex64 splitter) - (*movdi_1_rex64 splitter): Delay splitting after - flow2 pass only when (optimize > 0 && flag_peephole2). - -2005-11-10 Uros Bizjak - - PR target/19340 - * reg-stack.c (reg_to_stack): Update register liveness also - for flag_sched2_use_traces. - -2005-11-09 Per Bothner - Uros Bizjak - - PR c/24101 - * toplev.c (process_options): Initialize debug_hooks early - in case lang_hooks.post_options ends up calling a debug_hook. - * cppinit.c (read_original_filename): Temporarily set - state.in_directive before calling _cpp_lex_direct for - CPP_HASH tokens. - -2005-11-07 Steve Ellcey - - PR bootstrap/24688 - * fixinc/inclhack.def (sco_math): Add bypass. - * fixinc/fixincl.x: Regenerate. - -2005-11-07 James E Wilson - - PR preprocessor/15220 - * cppfiles.c (_cpp_find_file): New parameter angle_brackets. Fix all - callers. Pass to open_file_failed. - (open_file_failed): New parameter angle_brackets. Fix - all callers. use in print_dep assignment. - * cpphash.h (_cpp_find_file): Add new parm to declaration. - * cppinit.c (cpp_read_main_file): Pass another arg to _cpp_find_file. - -2005-11-05 Andreas Jaeger - - * fixinc/check.tpl: Adopt for move to subversion. - -2005-11-03 Richard Guenther - - PR middle-end/24470 - * fold-const.c (fold): Avoid running in circles if we - got some un-folded subtree. - -2005-10-30 Alan Modra - - PR target/23070 - * config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to - stdarg functions, set/clear the fp marker even when no variable - args are passed. - * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Describe - -mprototype and -mno-prototype. - -2005-10-21 Alan Modra - - PR target/24465 - * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Always - use r2 for 64-bit tls .got access. - -2005-10-19 Paolo Bonzini - - * dojump.c (do_jump): Revert the last patch as it breaks Ada. - -2005-10-19 Paolo Bonzini - - PR #19672 - * dojump.c (do_jump): Handle TRUTH_AND_EXPR and TRUTH_OR_EXPR - like TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR, if the branch cost - is low enough. - -2005-10-09 Eric Botcazou - - * config/sparc/gmon-sol2.c (internal_mcount): Mark as used. - -2005-10-08 Janis Johnson - - PR debug/24267 - Partial backport from mainline - 2004-05-04 Paolo Bonzini - Richard Henderson - * tree.c (make_or_reuse_type): New. - (build_common_tree_nodes): Use it. - - PR target/18583 - Partial backport from mainline - 2004-05-04 Paolo Bonzini - Richard Henderson - * c-common.c (vector_types_convertible_p): New function. - * c-common.h: Declare it. - * c-typeck.c (digest_init): Use it. - -2005-10-07 James E Wilson - - PR target/23644 - * doc/invoke.texi (IA-64 Options, item -mtune): Renamed from - -mtune-arch. - -2005-10-01 Richard Earnshaw - - PR target/23985 - Back-port 2004-08-19 Richard Henderson - * config/arm/arm.c (arm_gen_load_multiple): Use - adjust_automodify_address. Take base memory and offset instead - of unchanging/struct/scalar bits. - (arm_gen_store_multiple): Likewise. - (arm_gen_movstrqi): Use adjust_automodify_address. - * config/arm/arm-protos.h: Update decls. - * config/arm/arm.md (load_multiple): Update arm_gen_load_multiple call. - (store_multiple): Similarly. - -2005-09-29 Alan Modra - - PR target/24102 - * config/rs6000/rs6000.md (floatdisf2_internal2): Correct range - check for numbers that need no bit twiddle. - -2005-09-09 Richard Guenther - - PR c/20239 - * cppinit.c (cpp_read_main_file): Avoid segfaulting on - NULL pfile->map. - -2005-09-09 Richard Guenther - - PR c++/23624 - * fold-const.c (fold): Check truth_value_p before calling - invert_truthvalue. - -2005-09-08 Craig Rodrigues - - Backport from mainline - 2005-09-01 Craig Rodrigues - - * c-decl.c (diagnose_mismatched_decls): With -Wredundant-decls, - do not issue warning for a variable definition following - a declaration. - -2005-09-02 Richard Sandiford - - PR c/22061 - * c-decl.c (push_parm_decl): Push and pop x_dont_save_pending_sizes_p - around the call to grokdeclarator. Call grokdeclarator with the - field set to 0. - (store_parm_decls): Always store the pending_sizes in cfun. - (c_expand_body_1): Call put_pending_sizes. - * c-objc-common.c (c_cannot_inline_tree_fn): Always check - pending_sizes. - -2005-09-01 Jakub Jelinek - - PR rtl-optimization/23478 - * regs.h (reg_info): Add throw_calls_crossed. - (REG_N_THROWING_CALLS_CROSSED): Define. - * flow.c (allocate_reg_life_data): Initialize - REG_N_THROWING_CALLS_CROSSED. - (propagate_one_insn, attempt_auto_inc): Update - REG_N_THROWING_CALLS_CROSSED. - * local-alloc.c (struct qty): Add n_throwing_calls_crossed field. - (alloc_qty): Initialize it. - (update_equiv_regs): Clear REG_N_THROWING_CALLS_CROSSED. - (combine_regs): Combine also n_throwing_calls_crossed fields. - (find_free_reg): Don't attempt to caller-save pseudos crossing - calls that might throw. - * global.c (struct allocno): Add throwing_calls_crossed field. - (global_alloc): Initialize throwing_calls_crossed. - (find_reg): Don't attempt to caller-save pseudos crossing calls that - might throw. - -2005-09-01 Richard Earnshaw - - PR rtl-optimization/17810 target/15342 - * regrename.c: Fix polluted patch in previous change. - -2005-09-01 Richard Earnshaw - - PR rtl-optimization/17810 - Backport - 2004-11-04 Richard Sandiford - PR target/15342 - * regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs - as OP_INOUT if the instruction is predicated. - -2005-08-31 David Edelsohn - - PR target/23539 - Backport from mainline: - - 2005-08-27 David Edelsohn - * config/rs6000/rs6000.c (expand_block_move): Use HImode when - bytes >= 2 not bytes == 2. - -2005-08-21 Jakub Jelinek - - * simplify-rtx.c (simplify_immed_subreg) : Only - clear up to elem_bitsize bits, not max_bitsize. - -2005-07-20 Steve Ellcey - - PR target/21841 - * doc/invoke.texi (-mgnu-ld): Update description. - (-mhp-ld): Ditto. - -2005-08-09 Paolo Bonzini - - PR rtl-optimization/17860 - * loop.c (check_dbra_loop): Do not try to use an end condition - like "i != 0" in the reversed loop. - -2005-08-08 Josh Conner - - PR rtl-optimization/23241 - * combine.c (simplify_comparison): Fix error in determining - whether to lift a subreg from comparison. - -2005-08-08 Richard Sandiford - - PR middle-end/21964 - * stmt.c (tail_recursion_args): Insert a call to emit_queue. - -2005-08-08 Richard Sandiford - - PR c/22458 - * c-decl.c (c_begin_compound_stmt): Set the initial body to - error_mark_node, not NULL. - -2005-08-07 John David Anglin - - * pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Fix loop upper bound. - -2005-08-06 John David Anglin - - PR pch/14940 - Backport from mainline: - - * config.host (hppa*-*-hpux*, hppa*-*-linux): Define out_host_hook_obj - and host_xmake_file using new host configuration files. - * config/pa/pa-host.c, config/pa/x-hpux, config/pa/x-linux: New files. - -2005-08-06 Christian Joensson - - PR target/20673 - Backport from mainline: - - 2005-04-15 David S. Miller - - * config/sparc/sparc.h (sparc_hard_reg_printed): Mark as GTY(()). - -2005-08-05 John David Anglin - - * pa.c (function_arg): Fix typo in last change. - - * pa.c (function_value): Handle small aggregates on 32-bit targets. - (function_arg): Pass small aggregates in general registers on 32-bit - targets. - * som.h (MEMBER_TYPE_FORCES_BLK): Delete define. - -2005-08-04 Gerald Pfeifer - - * doc/install.texi (Specific): Adjust link to openavr.org. - (Specific): Remove broken reference to GCC 2.8.1 for OS/2. - (Binaries): Adjust HP-UX Porting Center link. - (Binaries): Adjust Free Software Foundation ordering link. - (Binaries): Remove broken link to Sinix/Reliant Unix binaries. - -2005-08-04 Eric Botcazou - - * doc/invoke.texi (Optimize Options): Document that -funswitch-loops - is enabled at -O3. - -2005-08-03 John David Anglin - - PR target/21723 - * pa.md: Remove fcpy alternative from movhi and movqi patterns. - * pa32-regs.h (HARD_REGNO_NREGS): Return two floating point registers - for complex modes when generating code for PA 1.0. - (VALID_FP_MODE_P): New macro. - (HARD_REGNO_MODE_OK): Use VALID_FP_MODE_P. Use non-overlapping register - sets for all general and floating point modes. Align wide floating - point modes to even register boundaries to comply with architectural - requirements. - (CLASS_MAX_NREGS): Update to align with change to HARD_REGNO_NREGS. - * pa64-regs.h (HARD_REGNO_NREGS): Update comment and formatting. - (VALID_FP_MODE_P): New macro. - (HARD_REGNO_MODE_OK): Use VALID_FP_MODE_P. Use non-overlapping register - sets for all general and floating point modes. Align wide floating - point modes to even register boundaries to comply with architectural - requirements. - -2005-08-03 Richard Sandiford - - PR target/18582 - * config/i386/i386.c (ix86_expand_unop_builtin): Force the target - to be a register if do_load is true. - -2005-08-02 Ian Lance Taylor - - PR pch/14400 - Backport from mainline: - - 2005-08-01 Ian Lance Taylor - - * config/host-linux.c (linux_gt_pch_get_address): Add new name - randomize_va_space for virtual address randomization control. - - 2005-02-15 James A. Morrison - - PR pch/14940 - PR target/19300 - * config/host-linux.c (linux_gt_pch_use_address): Copy from - config/pa/pa-host.c:pa_gt_pch_use_address. - - 2004-11-09 James A. Morrison - - PR pch/14940 - * config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __sparc__ - definitions. - - 2004-10-15 Jon Grimm - - * config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __powerpc__ - definition. - - 2004-04-24 Ulrich Weigand - - * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __s390__ - and __s390x__ hosts. - - 2004-04-08 Ian Lance Taylor - - * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): - Return 1 if file was successfully mapped. - - 2004-03-15 Ian Lance Taylor - - * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): - Fix the check for abort and only do the mmap if we can. - - 2004-03-12 Andrew Pinski - - * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): - Use ret instead of result. Use addr instead of base. - - 2004-03-10 Richard Henderson - - * c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address - extra arguments. - * config.host (*-*-solaris2*, *-*-linux*): Add out_host_hook_obj - and host_xmake_file fragments. - * ggc-common.c (gt_pch_save): Update for gt_pch_get_address change. - (gt_pch_restore): Similarly for gt_pch_use_address. - (default_gt_pch_get_address): New. - (mmap_gt_pch_get_address): Split out of gt_pch_save. - (default_gt_pch_use_address): Split out of gt_pch_restore. - (mmap_gt_pch_use_address): Likewise. - * hooks.c (hook_voidp_size_t_null): Remove. - (hook_bool_voidp_size_t_false): Remove. - * hooks.h: Likewise. - * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): Use one of the - default_ or mmap_ definitions. - (HOST_HOOKS_GT_PCH_USE_ADDRESS): Likewise. - * hosthooks.h (struct host_hooks): Update gt_pch_get_address - and gt_pch_use_address. - * config/host-linux.c, config/host-solaris.c: New files. - * config/x-linux, config/x-solaris: New files. - * config/rs6000/host-darwin.c darwin_rs6000_gt_pch_get_address): - Update for changed definition. - (darwin_rs6000_gt_pch_use_address): Likewise. - * doc/hostconfig.texi: Update docs. - -2005-07-31 Richard Sandiford - - PR target/20621 - Backport from mainline: - - 2004-08-01 Richard Sandiford - * config/mips/mips.md (cprestore): Provide two alternatives, one for - an in-range offset and one for an out-of-range offset. Wrap the latter - in .set macro/.set nomacro if it's inside a .set nomacro block. - - 2004-08-01 Richard Sandiford - * config/mips/mips-protos.h (mips_gp_save_slot): Remove. - (mips_restore_gp): Declare. - * config/mips/mips.c (mips_add_offset): Add a scratch register - argument. Reimplement in rtl only, reusing MIPS16 logic from - mips_output_mi_thunk. - (mips_legitimize_address, mips_legitimize_const_move): Adjust calls - to mips_add_offset. - (mips_gp_save_slot): Delete. - (mips_restore_gp): New function. - (mips_set_return_address, mips_output_mi_thunk): Use mips_add_offset. - * config/mips/mips.md (exception_receiver): Turn into a - define_insn_and_split. Use mips_restore_gp to do the split. - (call_internal, call_value_internal, call_value_multiple_internal): Use - mips_restore_gp to restore $gp. - -2005-07-29 Alan Modra - - * config/rs6000/sysv4.h (TARGET_ASM_EXCEPTION_SECTION): Delete. - -2005-07-28 Richard Henderson - - PR rtl-opt/22619 - * cfgcleanup.c (try_forward_edges): Watch out for end of - insn chain. - -2005-07-28 Joseph S. Myers - - PR c/17188 - PR c/21899 - * c-decl.c (diagnose_mismatched_decls): Check for duplicate - declarations of enumerators. - (start_struct): Check TYPE_SIZE rather than TYPE_FIELDS to check - for redefinition. Check for nested redefinition. - (finish_struct): Don't check for nested redefinition. - (start_enum): Check for nested redefinition. - -2005-07-28 Joseph S. Myers - - PR c/21873 - * c-typeck.c (push_init_level): Don't pop levels without braces if - implicit == 1. - -2005-07-28 Gerald Pfeifer - - * doc/install.texi (Configuration): Update Valgrind homepage. - -2005-07-28 Richard Sandiford - - PR c/20187 - * fold-const.c (fold): When shortening comparisons of widened operands, - check whether the tree returned by get_unwidened really is wider. - -2005-07-28 Richard Sandiford - - PR c/22589 - Backport from mainline: - - 2004-06-16 Alexandre Oliva - * tree.c (get_narrower): Don't narrow integral types into - non-integral types. - -2005-07-26 Bernardo Innocenti - - Backport from mainline: - 2005-07-12 Peter Barada - PR middle-end/16719 - PR middle-end/18421 - * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes - in address registers. - * config/m68k/m68k.c (hard_regno_mode_ok): Likewise. - * config/m68k/m68k.md: Replace 's' with 'i' in 4th - alternative of addsi3_5200. - -2005-07-21 Janis Johnson - - PR target/20191 - Backport from mainline: - - 2004-04-23 Dale Johannesen - - * config/rs6000.md (movsf_hardfloat): Add POWER form of nop. - (movdf_hardfloat64): Ditto. - (movdf_softfloat64): Ditto. - - * config/rs6000.md (movsf_hardfloat): Accept CTR-to-CTR copy. - (movdf_hardfloat64): Ditto. - -2005-07-21 Richard Sandiford - - PR rtl-optimization/22167 - * gcse.c (hoist_code): Fix hoist_exprs[] check. - -2005-07-19 Gerald Pfeifer - - * config.gcc: Add support for *-*-freebsd7, *-*-freebsd8, - and *-*-freebsd9. - * config/freebsd-spec.h (FBSD_TARGET_OS_CPP_BUILTINS): Ditto. - -2005-07-09 Jakub Jelinek - - * config/i386/i386.c (output_set_got): Don't omit OFFSET FLAT: - in Intel syntax add %reg, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_+(.-.Lx). - -2005-07-08 David Edelsohn - - Backport from mainline: - 2005-06-18 Roger Sayle - PR target/22083 - * config/rs6000/aix51.h (TARGET_C99_FUNCTIONS): Remove definition. - -2005-07-05 Joseph S. Myers - - PR c/22308 - * c-decl.c (finish_struct): Also copy C_TYPE_FIELDS_READONLY, - C_TYPE_FIELDS_VOLATILE and C_TYPE_VARIABLE_SIZE to type variants. - -2005-06-14 Eric Botcazou - - PR target/20301 - * config/sparc/sol2.h (ASM_GENERATE_INTERNAL_LABEL): Emit - unsigned index numbers. - -2005-06-08 Eric Botcazou - - PR target/21889 - * config/sparc/sol2.h (ASM_OUTPUT_DWARF_DTPREL): Undefine. - * config/sparc/sol2-gas.h (ASM_OUTPUT_DWARF_DTPREL): Redefine. - -2005-06-04 Richard Henderson - - PR target/21888 - * config/alpha/alpha.c (alpha_align_insns): Don't insert nops - until we've passed initial ldgp. - -2005-06-01 Richard Henderson - - * configure.ac (HAVE_AS_JSRDIRECT_RELOCS): New. - * config.in, configure: Rebuild. - * config/alpha/alpha.c (print_operand): Add 'j'. - * alpha.md (divmodsi_internal_er_1): Use it. - (divmoddi_internal_er_1): Likewise. - -2005-05-31 Eric Botcazou - - * doc/install.texi (sparc-sun-solaris2*): Update note - about Sun bug 4910101. - -2005-05-29 Eric Botcazou - - PR target/19933 - * fixinc/inclhack.def (solaris_math_6_1): New fix. - (solaris_math_9): Rewrite and guard with #ifdef __sparc__. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/iso/math_c99.h: Adjust for above changes. - - Backport from mainline: - 2005-05-19 Eric Botcazou - Joseph S. Myers - - * fixinc/inclhack.def: New fixes solaris_math_[1-9]. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/iso/math_c99.h: New. - - Backport from mainline: - 2005-05-10 Joseph S. Myers - - * fixinc/inclhack.def (stdio_stdarg_h, stdio_va_list): Bypass on - *-*-solaris2.1[0-9]*, not just *-*-solaris2.1[0-9]. - * fixinc/fixincl.x: Regenerate. - - Backport from mainline: - 2004-11-26 Mark Mitchell - - * fixinc/inclhack.def (gnu_types): Do not use on Solaris 2.1x. - (stdio_va_list): Likewise. - (stdio_stdarg.h): Likewise. - (solaris_stdio_tag): Add bypass. - * fixinc/fixincl.x: Regenerated. - -2005-05-26 Jakub Jelinek - - PR target/21716 - * reg-stack.c (swap_rtx_condition): Don't crash if %ax user was not - found in the basic block and last insn in the basic block is not - INSN_P. Remove explicit unspec numbers that are no longer valid - from comments. - -2005-05-25 Roger Sayle - - PR middle-end/21709 - * fold-const.c (const_binop): Check for division by zero during - complex division. - -2005-05-24 Kazuhiro Inaoka - - * config/m32r/m32r.c (m32r_expand_block_move): Return 0 if - nothing was done. - * config/m32r/m32r.md (movmemsi): If m32r_expand_block_move did - nothing then FAIL. - * config/m32r/m32r/m32r-protos.h (m32r_expand_block_move): Update - prototype. - -2005-05-23 Ulrich Weigand - - * unroll.c (loop_iterations): Remove common term from initial - and final value only if it is loop invariant. - -2005-05-20 Mark Mitchell - - * version.c (version_string): Mark as 3.4.5. - -2005-05-19 Mark Mitchell - - * version.c (version_string): Restore pre-release marker. - -2005-05-19 Release Manager - - * GCC 3.4.4 released. - -2005-05-11 Mark Mitchell - - Revert: - 2005-05-10 H.J. Lu - Backport from mainline - 2004-02-12 Richard Kenner - * function.c (fixup_var_refs): Save volatile_ok and set to 1. - * expr.c (emit_block_move_via_movstr): Save and restore - volatile_ok. - 2005-05-09 Grigory Tolstolytkin - Backport from mainline - 2004-02-12 Richard Kenner - * emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill previous - MEM_VOLATILE in REF. - -2005-05-11 Ben Elliston - - * dwarf2out.c: Revert my 2005-05-10 patch. - -2005-05-10 H.J. Lu - - Backport from mainline - 2004-02-12 Richard Kenner - * function.c (fixup_var_refs): Save volatile_ok and set to 1. - * expr.c (emit_block_move_via_movstr): Save and restore - volatile_ok. - -2005-05-10 Jakub Jelinek - - * config/i386/i386.md (sse_mov?fcc* splitters): Add mode to - IF_THEN_ELSE, remove mode from MATCH_OPERATOR. Fix a typo. - -2005-05-09 Grigory Tolstolytkin - - Backport from mainline - 2004-02-12 Richard Kenner - * emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill previous - MEM_VOLATILE in REF. - -2005-05-10 Ben Elliston - - PR debug/16676 - * dwarf2out.c (dwarf2out_decl): Always set context_die to NULL, - even when debug_info_level is DINFO_LEVEL_TERSE. - -2005-05-08 Stephane Carrez - - * config/m68hc11/m68hc11.c (m68hc11_z_replacement): Use emit_insn_after - when adding the save Z instruction so that it is part of the good BB. - (reg_or_some_mem_operand): Do not allow the 68HC12 address indirect - addressing mode as it is not supported by bset and bclr. - (m68hc11_gen_movhi): Fix invalid generation of indexed indirect - addressing with movw. - (m68hc11_gen_movqi): Use pula and pulb instead of lda and ldb for - 68HC12. - * config/m68hc11/m68hc11.md ("movhi_const0"): Use this pattern only - for 68HC11. - ("*movhi_68hc12"): Handle movhi_const0. - ("*subhi3", "subqi3"): Use general_operand for operand 1. - ("*subhi3_zext"): Likewise. - -2005-05-08 Stephane Carrez - - PR target/19051 - * config/m68hc11/m68hc11.md ("mulqi3"): Use general_operand for operand - 1 and fix constraints. - ("mulqihi3"): Use general_operand for operand 2. - -2005-05-08 Richard Sandiford - - PR target/21416 - * config/mips/mips.c (mips_emit_compare): Don't reverse UNGE and UNGT - comparisons. - * config/mips/mips.md (sungt_df, sunge_df, sungt_sf, sunge_sf): New - patterns. - -2005-05-08 Stephane Carrez - - PR target/16925 - * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Handle split of - 64-bit constants on 64-bit hosts. - (m68hc11_split_logical): Simplify. - (m68hc11_split_move): Likewise. - -2005-05-06 Bruce Korb - Joseph S. Myers - - * fixinc/inclhack.def: Correct backslashes - * fixinc/fixincl.x: regen - -2005-05-02 Janis Johnson - - PR 19985 - * gcov-io.h: Declare gcov external functions hidden. - -2005-05-01 Gerald Pfeifer - - * config/freebsd-spec.h (FBSD_CPP_SPEC): Revert last change. - -2005-05-01 Gerald Pfeifer - - Backport from mainline - * doc/install.texi (Specific): Avoid using asterisks in @anchor - names related to target triplets. - Remove i?86-*-esix from platform directory. - Remove powerpc-*-eabiaix from platform directory. - -2005-05-01 Eric Botcazou - - PR bootstrap/20633 - * config/freebsd-spec.h (FBSD_CPP_SPEC): Add %(cpp_arch). - -2005-05-01 Gerald Pfeifer - - * doc/install.texi (Specific): Omit dots in the @anchors names - for i?86-*-sco3.2v5* and sparc-sun-solaris2.7. - Omit underscores for x86_64-*-* and the "all ELF targets" entry. - -2005-05-01 Joseph S. Myers - - PR c/21213 - * c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of - transparent union. - -2005-05-01 Joseph S. Myers - - PR c/20740 - * c-format.c (init_dynamic_asm_fprintf_info): Give errors, not - aborts, if __gcc_host_wide_int__ is not properly defined. - (init_dynamic_diag_info): Give errors, not aborts, if location_t, - tree or __gcc_host_wide_int__ are not properly defined. - -2005-05-01 Joseph S. Myers - - PR c/11459 - PR c/18502 - * gcc.c (cpp_unique_options): Remove %{trigraphs}. - (cpp_options, cc1_options): Change %{std*} %{ansi} to - %{std*&ansi&trigraphs}. - -2005-04-29 Alan Modra - - PR target/21098 - * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. - * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. - -2005-04-25 Ralf Corsepius - - * config.gcc (avr-*-*): Remove redundant "case". - -2005-04-25 Ralf Corsepius - - PR target/17822 - * config/avr/t-avr (AR_FOR_TARGET,RANLIB_FOR_TARGET): Remove. - -2005-04-25 Ralf Corsepius - - PR target/17824 - * config/c4x/c4x.h (ASM_PROG, LD_PROG): Remove. - -2005-04-22 David Edelsohn - - Backport from mainline. - * config/rs6000/rs6000.c (rs6000_init_libfuncs): Set TFmode - optabs to xlq names if TARGET_XL_COMPAT. - -2005-04-22 Eric Botcazou - - * doc/invoke.texi (SPARC options): Document that -mapp-regs - is turned off by default on Solaris. - -2005-04-15 Dave Korn - - * gcc.c (default_compilers): Clarify obscure error message when - reading from standard input. - -2005-04-15 Eric Botcazou - - * config/sparc/sparc.c (legitimate_address_p): Use TARGET_ARCH32. - -2005-04-11 David Edelsohn - - Backport from mainline: - * config/rs6000/aix52.h (atoll): Declare. - -2005-04-08 Ulrich Weigand - - Backport from mainline: - * config/s390/tpf.h (ASM_SPEC): Define. - -2005-04-06 Dale Johannesen - - PR middle-end/19225 - * calls.c (expand_call): Flush pending deferrals before - throwing call. - -2005-04-06 Eric Botcazou - - PR target/17245 - * config/sparc/sparc.c (legitimate_address_p): Remove 'imm2'. - Revert 2004-10-08 patch. Reject TFmode LO_SUM in 32-bit mode. - -2005-04-05 James E. Wilson - - PR target/20670 - * unwind-ia64.c (uw_intall_context): Add missing load of r27. - -2005-04-04 Eric Botcazou - - * doc/invoke.texi (SPARC options): Document that - -mlittle-endian is not supported on Linux either. - -2005-03-25 Gabriel Dos Reis - - PR c++/18644 - * doc/invoke.texi (-Wsynth): Don't document, as it now is void of - semantics. - -2005-03-31 Alan Modra - - PR target/20611 - * config/rs6000/rs6000.md (load_toc_v4_PIC_1b): Remove inline - label operand. Remove (use (unspec..)). Don't emit a label on - the offset word. - * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Don't - generate inline label for load_toc_v4_PIC_1b. - (rs6000_emit_load_toc_table): Likewise. - -2005-03-31 Alan Modra - - * config.gcc (cpu_is_64bit): Set for 64-bit powerpc cpus. - (powerpc64-*-linux*): Use it. Rearrange tm_file assignment. - (powerpc-*-linux*): Build a biarch compiler when --enable-targets - is given with "powerpc64*" or "all", or when --with-cpu chooses - a 64-bit cpu. - -2005-03-30 Alan Modra - - * doc/install.texi: Update binutils requirement for powerpc*-linux. - -2005-03-25 John David Anglin - - PR target/15491 - * vax.c (vax_rtx_costs_1): Merge with vax_rtx_costs. - (vax_rtx_costs): Return false when passed unsupported rtx's. Handle - FLOAT_EXTEND, FLOAT_TRUNCATE and TRUNCATE. Fix costs for POST_INC, - PRE_DEC, NEG and NOT. - -2005-03-23 Uros Bizjak - - * simplify-rtx.c (simplify_unary_operation) : Add missing break - in code that deals with logicals on floats. - -2005-03-22 Uros Bizjak - - PR target/14981 - Backport from mainline - 2004-02-18 Jan Hubicka - * simplify-rtx.c (simplify_unary_operation): Deal with logicals on - floats. - (simplify_binary_operation): Deal with logicals on floats. - * i386.md (SSE fabs splitters): Emit new patterns. - (SSE cmov splitters): Likewise. - (sse_andv4sf3, sse_nandv4sf3, sse_iorv4sf3, sse_xorv4sf3 - (sse_andv2df3, sse_nandv2df3, sse_iorv2df3, sse_xorv2df3): Do not use - subregs. - (sse_andsf3, sse_nandsf3, sse_xorsf3): Kill. - (sse_anddf3, sse_nanddf3, sse_xordf3): Kill. - -2005-03-20 Marek Michalkiewicz - - PR target/18551 - * config/avr/avr.c (avr_output_function_prologue): Do not use - current_function_name() in a label, use a local label instead. - -2005-03-19 Joseph S. Myers - - * c.opt (ansi, std=iso9899:1990, std=iso9899:1999, - std=iso9899:199x): Correct descriptions. - -2005-03-19 Andy Hutchinson - - PR target/18251 - * config/avr/avr.md (movstrhi): Rewrite as RTL loop. - (*movstrqi_insn): Delete. - (*movstrhi): Delete. - -2005-03-17 Richard Sandiford - - PR rtl-optimization/19683 - * reload1.c (choose_reload_regs): Pass the number of bits, not the - number of bytes, to smallest_int_for_mode. Fix arguments to - REG_CANNOT_CHANGE_MODE_P. - -2005-03-17 Alan Modra - - * config/rs6000/linux-unwind.h: New file backported from gcc-4.0. - * config/rs6000/linux.h: #include linux-unwind.h in place of all - unwind support in this file. - * config/rs6000/linux64.h: Likewise. - -2005-03-16 Roger Sayle - - PR rtl-optimization/17825 - Backport from mainline - 2004-11-27 Jakub Jelinek - * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) - or not. - -2005-03-16 Roger Sayle - - PR target/18371 - Backport from mainline - 2004-12-19 Steven Bosscher - * config/i386/i386.c (ix86_split_to_parts): Use an array with - four elements for decoding a CONST_DOUBLE on 64 bits targets. - -2005-03-14 Alan Modra - - * config.gcc: Remove excess indentation. - (powerpc*-*-*, rs6000-*-*): Accept --with-cpu/tune power5. - -2005-03-13 Marek Michalkiewicz - - PR target/20288 - * config/avr/avr.c (print_operand): Add 'p' and 'r'. - (out_movhi_r_mr): Read low byte of volatile MEM first. - (out_movhi_mr_r): Write high byte of volatile MEM first. - -2005-03-10 Aldy Hernandez - - * doc/invoke.texi: Add 8540 to list of cpus in rs6000 cpu section. - -2005-03-08 James E Wilson - - Backport from mainline - 2004-04-13 James E Wilson - PR middle-end/20364 - * c-opt.c (c_common_post_options): If this_input_filename is NULL, - increment errorcount and return false instead of true. - - Backport from mainline - 2005-02-21 James E Wilson - * toplev.c (backend_init): Don't call init_adjust_machine_modes here. - (do_compile): Do call it here. - -2005-03-07 David Billinghurst - - * config/i386/cygwin1.c(mingw_scan): Use xstrdup in calls to putenv. - -2005-03-03 Alan Modra - - PR target/20277 - * config/rs6000/rs6000.c (rs6000_override_options): Don't allow - -mcpu to override any other explicitly given flags. - -2005-03-02 Mark Mitchell - - PR c++/19916 - * varasm.c (initializer_constant_valid_p): Allow conversions - between OFFSET_TYPEs. Tidy. - -2005-02-28 John David Anglin - - PR target/19819 - * pa.h (GO_IF_LEGITIMATE_ADDRESS): Allow allow hard registers during - and after reload in REG+REG indexed addresses without REG_POINTER - set in the base and not set in the index. - -2005-02-27 John David Anglin - - PR rtl-optimization/17728 - * pa.md (mulsi3, divsi3, udivsi3, modsi3): Change predicate for - operand 0 from general_operand to move_dest_operand. - -2005-02-26 Paolo Carlini - - * doc/extend.texi (Declaring Attributes of Functions): - Clarify that the alternative way doesn't work in GNU C++. - -2005-02-25 David Edelsohn - - Backport from mainline: - 2005-02-24 David Edelsohn - PR target/19019 - * reload.c (operands_match_p): Only increment register number for - SCALAR_INT_MODE_P modes in multiple hard registers. - * config/rs6000/rs6000.md (trunctfdf2): Remove register constraints. - Fix formatting. - -2005-02-24 Jakub Jelinek - - PR target/19019 - * Makefile.in (LIB2FUNCS_SHARED_EXTRA, LIB2ADD_SH): New. - (libgcc.mk): Depend on $(LIB2ADD_SH), pass LIB2ADD_SH to mklibgcc. - (LIBGCC_DEPS): Add $(LIB2ADD_SH). - * mklibgcc.in: Handle LIB2ADD_SH. - * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Remove darwin-ldouble.c. - (LIB2FUNCS_STATIC_EXTRA, LIB2FUNCS_SHARED_EXTRA): Set. - * config/rs6000/darwin-ldouble.c: Protect .symver asm also with - defined IN_LIBGCC2_S. - * config/rs6000/darwin-ldouble-shared.c: New file. - -2005-02-23 Michael Beach - - PR target/20159 - * config/sparc/t-elf (startup files): Assemble with CPP. - -2005-02-17 Gerald Pfeifer - - * doc/install.texi (Specific): Update link for Darwin-specific - tool binary site. - -2005-02-16 David Edelsohn - - PR target/19019 - Backport from mainline: - 2005-02-16 David Edelsohn - * config/rs6000/t-aix43 (SHLIB_MAPFILES): Add libgcc-ppc64.ver. - * config/rs6000/t-aix52 (SHLIB_MAPFILES): Same. - 2005-02-15 David Edelsohn - Alan Modra - * config/rs6000/darwin-ldouble.c (_xlqadd): Rename to __gcc_qadd. - (_xlqsub): Rename to __gcc_qsub. - (_xlqmul): Rename to __gcc_qmul. - (_xlqdiv): Rename to __gcc_qdiv. - Provide versioned symbol aliases with old names. - * config/rs6000/libgcc-ppc64.ver: Rename symbols. - * config/rs6000/rs6000.c (rs6000_init_libfuncs): Rename symbols. - * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): New. - * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): New. - * config/rs6000/t-newas (LIB2FUNCS_EXTRA): New. - 2005-02-14 David Edelsohn - * config/rs6000/rs6000.md (trunctfdf2): Change to define_expand. - (trunctfdf2_internal1): New. - (trunctfdf2_internal2): Renamed from trunctfdf2. - 2005-02-13 David Edelsohn - * config/rs6000/aix.h ({TARGET,MASK}_XL_CALL): Rename to - {TARGET,MASK}_XL_COMPAT. - (SUBTARGET_SWITCHES): Rename xl-call to xl-compat. Use - MASK_XL_COMPAT. - * config/rs6000/beos.h ({TARGET,MASK}_XL_CALL): Remove. - * config/rs6000/rs6000.c (function_arg): Change TARGET_XL_CALL to - TARGET_XL_COMPAT. - (rs6000_arg_partial_bytes): Same. - (rs6000_generate_compare): Generate PARALLEL for compare if TFmode - and XL compatibility enabled. - * config/rs6000/rs6000.h (TARGET_XL_CALL): Rename to TARGET_XL_COMPAT. - * config/rs6000/rs6000.md (cmptf_internal1): Add !TARGET_XL_COMPAT - test to final condition. - (cmptf_internal2): New. - * doc/invoke.texi (RS/6000 Subtarget Options): Change xl-call to - xl-compat. Add TFmode information to description. - -2005-02-16 Eric Christopher - - PR preprocessor/19077 - * cppmacro.c (cpp_macro_definition): Move handling of whitespace - to PREV_WHITE conditional. Remove overloading of len - variable. - -2005-02-16 Eric Botcazou - - PR target/19715 - * config.gcc (sparc-*-elf*): Include sparc/sol2-gld.h. - (sparc-*-rtems*): Likewise. - (sparclite-*-elf*): Likewise. - (sparc86x-*-elf*): Likewise. - (sparc64-*-elf*): Likewise. - -2005-02-11 John David Anglin - - PR middle-end/19697 - 2005-01-30 Roger Sayle - * config/pa/pa.md (anddi3, iordi3): On HPPA64, disallow an integer - constant as the second operand and a register as the third. - -2005-02-11 Jakub Jelinek - - PR c++/19666 - 2004-06-08 Andrew Pinski - * fold-const.c (fold_convert): Treat OFFSET_TYPE like - POINTER_TYPE and INTEGER_TYPE. - - * config/rs6000/sysv4.h (ENDFILE_LINUX_SPEC): Use crtendS.o instead of - crtend.o if -pie. Use %{x:a;:b} spec syntax. - -2005-02-10 Jakub Jelinek - - PR rtl-optimization/19579 - * ifcvt.c (noce_try_cmove_arith): If emitting instructions to set up - both A and B, see if they don't clobber registers the other expr uses. - -2005-02-08 Alan Modra - - PR target/19803 - * predict.c (PROB_VERY_UNLIKELY): Use 1% instead of 10%. - -2005-02-07 Ralf Corsepius - - * config/m68k/t-rtems (MULTILIB_MATCHES): Let m528x match m5200. - -2005-02-03 Richard Guenther - - PR middle-end/19775 - * builtins.c (fold_builtin_sqrt): Transform - sqrt(pow(x,y)) to pow(fabs(x),y*0.5), not - pow(x,y*0.5). - -2005-02-01 Richard Earnshaw - - PR target/16201 - * arm.c (arm_eliminable_register): New function. - (adjacent_mem_locations): Don't allow eliminable registers. Use - HOST_WIDE_INT for address offsets. - * arm-protos.h (arm_eliminable_register): Add prototype. - -2005-01-31 Daniel Jacobowitz - - 2004-09-22 Mark Mitchell - * gcc/dwarf2out.c (scope_die_for): If the containing scope is a - TRANSLATION_UNIT_DECL, consider it to be a global. - -2005-01-29 Alan Modra - - * unwind-dw2.c (execute_stack_op): Add missing cases for - DW_OP_shl, DW_OP_shr, DW_OP_shra, DW_OP_xor. - -2005-01-28 Stephane Carrez - - PR target/15384 - * config/m68hc11/t-m68hc11-gas (dp-bit.c): Fix typo causing a - configuration part of dp-bit.c to be lost. - -2005-01-27 Ulrich Weigand - - PR target/17771 - Backport from mainline: - * config/s390/s390.md ("reload_outti"): Remove predicate for - output operand. Abort if operand is not a MEM. - ("reload_outdi", "reload_outdf"): Likewise. - -2005-01-27 Marek Michalkiewicz - - PR target/19293 - PR target/19329 - * config/avr/avr.c (notice_update_cc): Only set condition code for - ashrqi3 if shift count > 0. - (out_shift_with_cnt): Handle shift count <= 0 as a no-op. - (ashlqi3_out, ashlhi3_out, ashlsi3_out, ashrqi3_out, ashrhi3_out, - ashrsi3_out, lshrqi3_out, lshrhi3_out, lshrsi3_out): Handle shift - count <= 0 as a no-op, and shift count >= width by copying zero - or sign bit to all bits of the result. - * config/avr/avr.md (all shifts): Add alternatives for zero shift - count, with attribute "length" set to 0 and "cc" set to "none". - -2005-01-27 J"orn Rennecke - - * real.c (do_add): Initialize signalling and canonical members. - - * real.c (real_from_integer): Zero out destination. - -2005-01-26 Ulrich Weigand - - Backport from mainline: - * dbxout.c (dbxout_symbol_location): Resolve constant pool references - even for variables with NULL DECL_INITIAL. - -2005-01-25 Richard Earnshaw - - PR target/19393 - Backport: - 2004-03-30 Nick Clifton - * config/arm/arm.md (thumb_jump): Reduce the backward branch - range, and increase the forward branch range, to allow for - the fact that the PC will be off by 4. - -2005-01-24 Richard Henderson - Aldy Hernandez - - * regrename.c (note_sets): Handle subregs. - -2005-01-24 Jakub Jelinek - - * flow.c (propagate_one_insn): Formatting. - - PR middle-end/19551 - * flow.c (libcall_dead_p): Be more conservative if unsure. - If there are any instructions between insn and call, see if they are - all dead before saying the libcall is dead. - -2005-01-22 Ralf Corsepius - - PR target/19548 - * config/rs6000/rtems.h: Resurrect cpp_os_rtems_spec from gcc < 3.4. - (CPP_OS_RTEMS_SPEC): New (From gcc-3.3's config/rs6000/sys4.h). - (SUBSUBTARGET_EXTRA_SPECS): Use CPP_OS_RTEMS_SPEC. - -2005-01-19 Jakub Jelinek - - PR rtl-optimization/15139 - * combine.c: Include params.h. - (count_rtxs): New function. - (record_value_for_reg): If replace_rtx would replace at least - 2 occurrences of REG in VALUE and TEM is really large, replace REG with - (clobber (const_int 0)) instead of TEM. - * params.def (PARAM_MAX_LAST_VALUE_RTL): New. - * params.h (MAX_LAST_VALUE_RTL): New. - * Makefile.in (combine.o): Depend on $(PARAMS_H). - * doc/invoke.texi (--param max-last-value-rtl=N): Document. - - PR c/17297 - * c-typeck.c (digest_init): Only call build_vector if all constructor - elements are *_CST nodes. - - PR middle-end/19164 - * c-typeck.c (digest_init): Only call build_vector if inside_init - is a CONSTRUCTOR. - -2005-01-18 Eric Botcazou - - PR debug/16261 - Backport from mainline: - 2004-01-27 Devang Patel - - * dwarf2out.c: (remove_child_TAG): New function. - (gen_subprogram_die): Do not remove all children dies while reusing - declaration die for definition. Instead, selectively remove only - formal parameters. - -2005-01-18 Eric Botcazou - - PR rtl-optimization/19296 - * combine.c (simplify_comparison): Rewrite the condition under - which a non-paradoxical SUBREG of a PLUS can be lifted when - compared against a constant. - -2005-01-17 John David Anglin - - * varasm.c (process_pending_assemble_output_defs): Fix previous change. - -2005-01-16 John David Anglin - - PR target/16304 - * defaults.h (TARGET_DEFERRED_OUTPUT_DEFS): Provide default. - * toplev.c (compile_file): Call process_pending_assemble_output_defs - just before targetm.asm_out.file_end. - * tree.h (process_pending_assemble_output_defs): Declare. - * varasm.c (assemble_output_def, process_pending_assemble_output_defs): - New functions. - (assemble_alias): Defer generation of assembly code for defines when - TARGET_DEFERRED_OUTPUT_DEFS is true. - * config/rs6000/aix41.h (TARGET_DEFERRED_OUTPUT_DEFS): Define. - * config/rs6000/aix43.h (TARGET_DEFERRED_OUTPUT_DEFS): Define. - * doc/tm.texi (TARGET_DEFERRED_OUTPUT_DEFS): document. - -2005-01-15 Ralf Corsepius - - * config/mips/rtems.h (MIPS_DEFAULT_GVALUE): Set to 0. - * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS): - Remove little endian multilib variants. - Add mips32 multilib variant. - -2005-01-14 David Edelsohn - - * config/rs6000/aix52.h (CPLUSPLUS_CPP_SPEC): Revert last change. - -2005-01-13 David O'Brien - - Backport from mainline: - * config/freebsd-spec.h: Make KSE pthread lib logic the default. - -2005-01-13 David Edelsohn - - * config/rs6000/aix52.h (CPLUSPLUS_CPP_SPEC): Change _XOPEN_SOURCE - definition to 600. - -2005-01-13 Ralf Corsepius - - * config/i386/t-rtems-i386: Multilib on -mtune instead of -mcpu. - -2004-01-12 David Mosberger - James E Wilson - - PR target/18987 - * config/ia64/ia64.c (process_set): For alloc insn, only call - process_epilogue is !frame_pointer_needed. - - PR target/13158 - * config/ia64/ia64.c (ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on - sibcall alloc instruction. - (process_set): Handle sibcall alloc instruction. - -2005-01-10 David Edelsohn - - PR target/18720 - Backport from mainline - * collect2.c (main): Set aixrtl_flag for -brtl option. - (resolve_lib_name): Search for .so file extension before .a - if aixrtl_flag set. - -2005-01-08 Jakub Jelinek - - PR rtl-optimization/19012 - * config/i386/i386.md (addqi_1_slp): Set memory attribute. - -2005-01-07 Eric Botcazou - - * configure.ac (HAVE_AS_OFFSETABLE_LO10): Fix typo. - * configure: Regenerate. - -2005-01-07 Jakub Jelinek - - * c-common.c (handle_mode_attribute): For ENUMERAL_TYPE, also copy - TYPE_MODE. - -2005-01-06 Richard Sandiford - - PR rtl-opt/13299 - * loop.c (get_monotonic_increment, biased_biv_fits_mode_p, - biv_fits_mode_p, extension_within_bounds_p): New functions. - (check_ext_dependent_givs): Use them. - -2005-01-05 Richard Henderson - - PR rtl-opt/10692 - * reload1.c (do_input_reload): Restrict the optimization deleteing - a previous output reload to RELOAD_FOR_INPUT. - -2005-01-06 Jakub Jelinek - - Backport from mainline: - 2004-03-22 Diego Novillo - - * c-typeck.c (same_translation_unit_p): Fix pasto. - -2005-01-02 Roger Sayle - Andrew Pinski - James E. Wilson - - PR rtl-optimization/12092 - * loop.c (emit_prefetch_instructions): Do nothing if PREFETCH_BLOCK - is zero. - -2004-12-30 Roger Sayle - - PR middle-end/19175 - * loop-unroll.c (expand_bct): Pass the code_label to the function - do_compare_rtx_and_jump, not the label ref. Clean-up style issues. - -2004-12-27 John David Anglin - - * vax.c (vax_address_cost, vax_rtx_cost): Correct casts. - (vax_rtx_cost): Handle small offsets for both PLUS and MINUS. - -2004-12-27 Steven Bosscher - John David Anglin - - rtl-optimization/12863 - * config/vax/vax.h (CASE_DROPS_THROUGH): Don't define. - * config/vax/vax.md (casesi): Emit a test-and-branch to make sure - that the case is in range, to make sure the casesi insn is always - in range and never falls through. - (casesi1): Add comment to explain why casesi never falls through. - Remove the unnamed special case casesi pattern. - -2004-12-27 John David Anglin - - PR c++/14607. - Backported from main. - * configure.ac (HAVE_GAS_NSUBSPA_COMDAT): Add check for .NSUBSPA - COMDAT support. - * configure. config.in: Rebuilt. - * config/pa/pa-protos.h (som_text_section_asm_op, - som_readonly_data_section, som_one_only_readonly_data_section, - som_one_only_data_section, forget_section): Declare. - * pa.c (override_options): Set init_machine_status to - pa_init_machine_status. - (pa_init_machine_status): New function. - (pa_output_function_epilogue): Call forget_section if TARGET_SOM and - TARGET_GAS. - (pa_asm_output_mi_thunk): Likewise. - (som_text_section_asm_op): New function. - (pa_select_section): Call som_one_only_readonly_data_section and - som_one_only_data_section when appropriate. - * pa.h (struct machine_function): Define. - (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, - SOM_READONLY_DATA_SECTION_FUNCTION, - SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION - SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): New - macros. - * som.h (ASM_OUTPUT_FUNCTION_PREFIX): Delete. - (TEXT_SECTION_ASM_OP): Call som_text_section_asm_op. - (READONLY_DATA_ASM_OP, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. - (READONLY_DATA_SECTION): Call som_readonly_data_section when not PIC. - (SUPPORTS_SOM_COMDAT): New define. - (SUPPORTS_ONE_ONLY): True if SUPPORTS_WEAK or SUPPORTS_SOM_COMDAT. - (MAKE_DECL_ONE_ONLY): Rework common support. - -2004-12-26 John David Anglin - - PR target/17643 - * pa.c (pa_function_ok_for_sibcall): Sibcalls are not ok when - generating code for the portable runtime. - -2004-12-25 Alan Modra - - PR target/19147 - * config/rs6000/rs6000.md (andsi3_internal7, andsi3_internal8): Delete. - -2004-12-23 Richard Henderson - - PR c/18282 - * c-decl.c (finish_enum): Retain precision acquired from an attribute. - -2004-12-23 Alexandre Oliva - - PR target/16819 - * calls.c (load_register_parameters): Don't call use_regs when - nregs is zero. - -2004-12-22 Richard Henderson - - PR target/19102 - * config/i386/i386.c (x86_inter_unit_moves): Disable. - (ix86_hard_regno_mode_ok): Disallow SSE2 and MMX scalar modes - in SSE registers when only SSE1 enabled. - -2004-12-21 David O'Brien - - Backport from mainline: - * config/freebsd-spec.h: Use KSE pthread lib for -pthread. - -2004-12-19 Richard Henderson - - * config/i386/i386.c (ix86_hard_regno_mode_ok): Always accept all SSE, - MMX, 3DNOW modes in SSE registers; always accept all MMX, 3DNOW modes - in MMX registers. - * config/i386/i386.h (VALID_SSE2_REG_MODE): Don't include - VALID_MMX_REG_MODE. - * config/i386/i386.md (movv4sf_internal, movv4si_internal, - movv2di_internal, movv2si_internal, movv4hi_internal, - movv2sf_internal, movv2df_internal, movv8hi_internal, - movv16qi_internal, movti_internal): Add leading '*' to name. - (movv2di_internal, movv2df_internal, movv8hi_internal, - movv16qi_internal, movv2df, movv8hi, movv16qi, movv2di, - pushv2di, pushv8hi, pushv16qi): Enable for SSE1. - (movv2si_internal, movv4hi_internal): Add SSE alternatives. - (movv8qi_internal, movv2sf_internal): Likewise. - (movtf): Simplify conditional. - (movv2sf, pushv2sf): Enable for MMX. - -2004-12-19 Roger Sayle - - PR middle-end/19068 - * expr.c (expand_expr_real_1) : Ensure that target, op0 - and op1 are all registers (or constants) before expanding the RTL - comparison sequence [to avoid reg_overlap_mentioned (target, op1)]. - -2004-12-18 Eric Botcazou - - PR rtl-optimization/16968 - * loop.c (scan_loop): Stop scanning the loop for movable - insns as soon as an optimization barrier is encountered. - -2004-12-16 H.J. Lu - - PR other/18508 - * config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix - to back up the existing shared library. - * config/arm/t-netbsd (SHLIB_LINK): Likewise. - * config/mips/t-iris5-6 (SHLIB_LINK): Likewise. - * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise. - * config/sh/t-linux (SHLIB_LINK): Likewise. - * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise. - * config/t-slibgcc-darwin (SHLIB_LINK): Likewise. - * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise. - * config/t-slibgcc-sld (SHLIB_LINK): Likewise. - -2004-12-16 Roger Sayle - - PR middle-end/18493 - * c-typeck.c (c_finish_case): Rechain statements if we didn't - encounter any case labels or a default. - -2004-12-16 Eric Botcazou - - PR middle-end/18882 - * function.c (assign_stack_local_1): Use BITS_PER_UNIT alignment - when passed -2 as 'align'. - (put_var_into_stack): Use 'bool' as the type for the three local - predicates. Adjust calls to put_reg_into_stack. - When passed a CONCAT, instruct put_reg_into_stack to use - a consecutive stack slot for the second part. - (put_reg_into_stack): Remove 'promoted_mode' parameter, add - 'consecutive_p' parameter. Turn the three predicates into 'bool' - parameters. Retrieve the register mode from 'reg'. - When consecutive_p is true, instruct assign_stack_local_1 to use - BITS_PER_UNIT alignment. - (put_addressof_into_stack): Use 'bool' as the type for the two - local predicates. Adjust call to put_reg_into_stack. - -2004-12-16 Eric Botcazou - - PR middle-end/18590 - * function.c (fixup_var_refs_insns_with_hash): Do not invoke - fixup_var_refs_insn on insns marked as deleted. - -2004-12-15 Richard Henderson - - PR target/19028 - * config/i386/i386.md (sse compare splitter): Test for SF and DFmode - explicitly instead of using VALID_SSE_REG_MODE. - -2004-12-15 Richard Henderson - - PR target/19005 - * config/i386/i386.md (swaphi_1): Swap with swaphi_2, allow with - optimize_size. - (swapqi_1): Rename from swapqi. Enable only for no partial reg - stall and optimize_size. - (swapqi_2): New. - (swaphi_1, swaphi_2, swapqi_1): Add athlon_decode. - (swapsi, swaphi_1, swaphi_2, swapqi_1, swapdi): Remove modrm override. - -2004-12-15 H.J. Lu - - PR target/18153 - * configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports - -Bstatic/-Bdynamic option. - * config.in: Regenerated. - * configure: Likewise. - - * gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static - -lunwind if possible. - -2004-12-15 Richard Henderson - - PR target/19010 - * config/i386/i386.c (gen_reg_or_parallel): New. - (function_arg): Use it. - (ix86_hard_regno_mode_ok): Test SSE1 and SSE2 separately, - MMX and 3DNOW separately. - (ix86_rtx_costs): Simplify FLOAT_EXTEND case. - * config/i386/i386.h (VALID_SSE2_REG_MODE): Move SSE2 cases from ... - (VALID_SSE_REG_MODE): ... here. - * config/i386/i386.md (movv4sf_internal): Validate one MEM. - (movv4si_internal): Likewise. - (movv2di_internal): Likewise. Enable for SSE2 only. - (movv2di): Enable for SSE2 only. - (pushv4si): Enable for SSE1. - -2004-12-15 Eric Botcazou - - PR c++/17972 - * tree-inline.c (expand_call_inline): Set TREE_SIDE_EFFECTS - on the STMT_EXPR wrapping up the inlined body. - -2004-12-15 Eric Botcazou - - PR preprocessor/15167 - * cppfiles.c (destroy_cpp_file): New function. - (should_stack_file): Make a new file if the - compared file is still stacked. - -2004-12-15 Eric Botcazou - - PR other/18665 - * libgcc-std.ver (GCC_3.4.4): Inherit from GCC_3.4.2. - Export __absvti2, __addvti3, __mulvti3, __negvti2 and __subvti3. - * libgcc-darwin.ver (GCC_3.4.4): Inherit from GCC_3.4. - Export __absvti2, __addvti3, __mulvti3, __negvti2 and __subvti3. - * libgcc2.c (__addvsi3): Rename to __addvSI3. - New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (__addvdi3): Rename to __addvDI3. - (__subvsi3): Rename to __subvSI3. Use word type for the result. - New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (__subvdi3): Rename to __subvDI3. - (_mulvsi3): Rename to _mulvSI3. - New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (_mulvdi3): Rename to _mulvDI3. - (__negvsi2): Rename to __negvSI2. - New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (__negvdi2): Rename to __negvDI2. - (__absvsi2): Rename to __absvSI2. - New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (__absvdi2): Rename to __absvDI2. - * libgcc2.h (64-bit targets): Define COMPAT_SIMODE_TRAPPING_ARITHMETIC. - (__absvSI2, __addvSI3, __subvSI3, __mulvSI3, __negvSI2, __absvDI2, - __addvDI3, __subvDI3, __mulvDI3, __negvDI2): Define to the appropriate - symbol and declare. - (__absvsi2, __addvsi3, __subvsi3, __mulvsi3, __negvsi2): Declare if - COMPAT_SIMODE_TRAPPING_ARITHMETIC. - -2004-12-14 Steve Ellcey - - * doc/invoke.texi (IA-64 options): Add existing options that - weren't already listed. - -2004-12-14 Jakub Jelinek - - PR middle-end/18951 - * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid - using arguments passed to save_expr after that call. - -2004-12-13 John David Anglin - - PR middle-end/18730 - * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When - the first/last insn is a sequence, return the first/last insn of the - sequence. - -2004-12-13 Roger Sayle - - PR target/18002 - PR middle-end/18424 - Backport from mainline - - 2004-03-20 Richard Sandiford - * Makefile.in (dojump.o): Depend on $(GGC_H) and dojump.h. - (GTFILES): Add $(srcdir)/dojump.h. - (gt-dojump.h): New dependency. - * dojump.c (and_reg, and_test, shift_test): New static variables. - (prefer_and_bit_test): New function. - (do_jump): Use it to choose between (X & (1 << C)) and (X >> C) & 1. - - 2004-03-21 Andrew Pinski - * dojump.c (prefer_and_bit_test): Fix which part of - the and_test is replaced. - - 2004-12-10 Roger Sayle - * dojump.c (do_jump): When attempting to reverse the effects of - fold_single_bit_test, we need to STRIP_NOPS and narrowing type - conversions, and handle BIT_XOR_EXPR that's used to invert the - sense of the single bit test. - -2004-12-13 Richard Henderson - - PR target/17990 - * config/i386/i386.md (negsf2): Fix condition for using sse. - (negdf2, abssf2, absdf2): Likewise. - (negsf2_if, abssf2_if): Don't disable if sse enabled. - (movv4sf_internal splitter): Postpone til after reload. - (movv2di_internal splitter): Likewise. - -2004-12-13 Richard Henderson - - PR middle-end/17930 - * toplev.c (rest_of_compilation): Fix computation of - preferred_incoming_stack_boundary. - -2004-12-12 Richard Henderson - - PR rtl-opt/17186 - * reg-stack.c (move_for_stack_reg): Handle source register not - live with a nan. - -2004-12-12 Richard Henderson - - PR target/18932 - * config/i386/i386.md (all splits and peepholes): Use flags_reg_operand - and compare_operator to propagate the input CC mode to the output. - * config/i386/i386.c (compare_operator): New. - * config/i386/i386.h (PREDICATE_CODES): Add it. - * config/i386/i386-protos.h: Update. - -2004-12-09 Richard Henderson - - PR c/18282 - * attribs.c (decl_attributes): Clear DECL_ALIGN when relaying out decl. - * c-common.c (handle_mode_attribute): Handle enumeral types. - -2004-12-09 Richard Henderson - - PR target/17025 - * config/i386/i386.md (testqi_1_maybe_si, andqi_2_maybe_si): New. - (test_qi_1, andqi_2): Do not promote to simode. - -2004-12-07 David Mosberger - - PR target/18443 - * config/ia64/ia64.c (ia64_assemble_integer): Add support for - emitting unaligned pointer-sized integers. - -2004-12-07 Eric Botcazou - - PR middle-end/17827 - * c-semantics.c (expand_unreachable_if_stmt): Invoke - expand_cond on the condition. - -2004-12-06 Aldy Hernandez - - * config/rs6000/sysv4.h: Define RELOCATABLE_NEEDS_FIXUP to 1. - -2004-12-05 Richard Henderson - - PR target/18841 - * config/alpha/alpha.md (UNSPECV_SETJMPR_ER): New. - (builtin_setjmp_receiver_er_sl_1): Use it. - (builtin_setjmp_receiver_er_1): Likewise. - (builtin_setjmp_receiver_er, exception_receiver_er): Remove. - (builtin_setjmp_receiver): Don't split for explicit relocs until - after reload. - (exception_receiver): Likewise. - -2004-12-05 Alan Modra - - * config/rs6000/rs6000.c (rs6000_assemble_integer): Fix typo. - -2004-12-04 Richard Henderson - - * emit-rtl.c, expr.c, function.c, integrate.c, optabs.c, rtl.h: - Revert the patches for PR rtl-opt/15289. - -2004-12-03 Eric Botcazou - - * integrate.c (expand_inline_function): Accept non-CONCAT arguments - for CONCAT parameters and invoke read_complex_part on them. - -2004-12-02 Richard Henderson - - * expr.c (write_complex_part): Use simplify_gen_subreg when the - submode is at least as large as a word. - (read_complex_part): Likewise. - -2004-12-02 Roger Sayle - - PR target/9908 - * config/i386/i386.md (*call_value_1, *sibcall_value_1): Correct - Intel assembler syntax by using %A1 instead of %*%1. - -2004-12-02 Richard Henderson - - PR rtl-opt/15289 - * emit-rtl.c (gen_complex_constant_part): Remove. - (gen_realpart, gen_imagpart, subreg_realpart_p): Remove. - * expr.c (write_complex_part, read_complex_part): New. - (emit_move_via_alt_mode, emit_move_via_integer, emit_move_resolve_push, - emit_move_complex_push, emit_move_complex, emit_move_ccmode, - emit_move_multi_word): Split out from ... - (emit_move_insn_1): ... here. - (expand_expr_real) : Use write_complex_part. - : Use read_complex_part. - : Likewise. - * function.c (assign_parms): Hard-code transformations - instead of using gen_realpart/gen_imagpart. - * integrate.c (initialize_for_inline): Likewise. - * optabs.c (expand_unop): Use read_complex_part/write_complex_part. - (expand_complex_abs): Likewise. - (expand_binop): Likewise. Rearrange to build a CONCAT at the end, - rather than creating a complex target at the beginning. - * rtl.h (gen_realpart, gen_imagpart, subreg_realpart_p): Remove. - (read_complex_part, write_complex_part): Declare. - -2004-12-02 Alan Modra - - * config/rs6000/rs6000.c (rs6000_assemble_integer): Put back the - #ifdef RELOCATABLE_NEEDS_FIXUP. - -2004-12-01 Nathanael Nerode - - PR preprocessor/17651 - * c-opts.c (sanitize_cpp_opts): Make flag_no_output imply - flag_no_line_commands. - * c-ppoutput.c (pp_file_change): Remove now-redundant check of - flag_no_output. - - PR preprocessor/17610 - * directives.c (do_include_common): Error out if an empty filename - is given for #include (or #include_next or #import). - PR preprocessor/17610 - * testsuite/gcc.dg/cpp/empty-include.c: New testcase. - -2004-12-02 Alan Modra - - PR target/16952 - * config/rs6000/rs6000.c (rs6000_assemble_integer): Replace - #ifdef RELOCATABLE_NEEDS_FIXUP with if. - * config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Define in terms - of target_flags_explicit. - * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Ditto for biarch - case. Define as 0 for non-biarch. - -2004-12-01 Richard Henderson - - * expr.c (optimize_bitfield_assignment_op): Split out from ... - (expand_assignment): ... here. Use handled_component_p to gate - get_inner_reference code. Simplify MEM handling. Special case - CONCAT destinations. - (get_inner_reference): Handle REAL/IMAGPART_EXPR. - (handled_component_p): Likewise. - -2004-12-01 Alan Modra - - PR target/12817 - * config/rs6000/rs6000.c (rs6000_emit_prologue): Use r0 for vrsave. - -2004-11-30 Jakub Jelinek - - * fold-const.c (extract_muldiv_1) : If ctype is - unsigned and type signed, build ABS_EXPR with signed_type (ctype) - and only afterwards convert to ctype. - -2004-11-29 Richard Henderson - - PR target/17224 - * config/ia64/ia64.c (sdata_symbolic_operand): Deny offsets - outside the referenced object. - -2004-11-28 Andreas Fischer - Alan Modra - - PR target/16343 - * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow - functions, strings and thread-local vars. - -2004-11-27 Alan Modra - - PR target/12769 - * config/rs6000/rs6000.c (init_cumulative_args): Set call_cookie - from rs6000_default_long_calls for libcalls. - - PR target/18686 - * config/rs6000/rs6000-c.c (rs6000_pragma_longcall): Use - integer_zerop and integer_onep instead of comparing against - canonical trees. - -2004-11-25 Richard Henderson - - PR c++/6764 - * reload1.c (set_initial_eh_label_offset): New. - (set_initial_label_offsets): Use it. - -2004-11-26 Alan Modra - - PR rtl-optimization/16356 - * config/rs6000/rs6000.md (floatdisf2_internal2): Rewrite with - separate output register and one less jump. Enable for powerpc64. - (floatdisf2): Adjust for above. - -2004-11-25 Ralf Corsepius - - * config.gcc (avr-*-rtems*): Fix typo. - -2004-11-24 Uros Bizjak - - PR rtl-optimization/18614 - * simplify-rtx.c (simplify_binary_operation): Do not - simplify inner elements of constant arguments of - VEC_CONCAT insn. - -2004-11-23 Eric Botcazou - - Backport from mainline: - 2004-10-18 Eric Botcazou - Roger Sayle - - PR middle-end/17813 - * dojump.c (discard_pending_stack_adjust): New function. - (clear_pending_stack_adjust): Call it. - * expr.h (discard_pending_stack_adjust): Declare it. - * explow.c (emit_stack_save): Emit pending stack adjustments - before saving the stack pointer. - (emit_stack_restore): Discard pending stack adjustments before - restoring the stack pointer. - -2004-11-23 Ralf Corsepius - - * config/c4x/t-rtems: New. - * config.gcc: Reflect having added c4x/t-rtems. - -2004-11-23 Ralf Corsepius - - * config/arm/t-rtems: New. - * config.gcc: Reflect having added arm/t-rtems. - -2004-11-23 Ralf Corsepius - - * config.gcc: Add avr-*-rtems*. - * config/avr/t-rtems: New. - * config/avr/rtems.h: New. - -2004-11-22 John David Anglin - - PR rtl-optimization/14838 - * emit-rtl.c (get_first_nonnote_insn): Don't assume first insn is a - note. - (get_last_nonnote_insn): Don't assume last insn is a note. - -2004-11-21 Roger Sayle - - * fixinc/inclhack.def (alpha_pthread_init): Fix technical problems - with the last check-in caused by CVS variable substitution. - * fixinc/fixincl.x: Likewise. - * fixinc/tests/base/pthread.h: Likewise. - -2004-11-21 Roger Sayle - Bruce Korb - - Synchronize with mainline - * fixinc/inclhack.def (alpha_pthread_init): New fix. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/pthread.h: Update for new test. - -2004-11-17 Ramana Radhakrishnan - - PR target/18263 - * config/arc/lib1funcs.asm (___umulsidi3): Change use of cmp to the - equivalent on the A4. - -2004-11-16 Joseph S. Myers - - PR c/18498 - * c-decl.c (grokdeclarator): Call check_bitfield_type_and_width - after processing the declarator. - -2004-11-14 Andrew Pinski - - PR objc/18406 - * objc/obj-act.c (encode_type): 96bits doubles are encoded the - same way as 64bit and 128bit doubles are. - -2004-11-14 Hans-Peter Nilsson - - PR target/18347 - * config/mmix/mmix.c (mmix_function_outgoing_value): Handle - TImode. Sorry for other non-complex larger-than-64-bit modes. - * config/mmix/mmix.h (MIN_UNITS_PER_WORD): Do not define. - (INIT_CUMULATIVE_ARGS): Correct unused macro name FNDECL. - -2004-11-13 Eric Botcazou - - * doc/md.texi (constraints) <% modifier>: Mention that it is - useless when the two alternatives are strictly identical. - -2004-11-12 Richard Henderson - - PR 17778 - * config/i386/i386.h (TARGET_96_ROUND_53_LONG_DOUBLE): New. - * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Remove. - (TARGET_96_ROUND_53_LONG_DOUBLE): New. - * config/i386/i386-modes.def (XF): Use it. - -2004-11-12 Ralf Corsepius - - * config/rs6000/t-rtems (MULTILIB_NEW_EXCEPTIONS_ONLY): - Remove m505/roe multilib variant. - -2004-11-12 Eric Botcazou - - Backport from mainline: - 2004-02-25 Richard Henderson - - * config/alpha/alpha.c (alpha_emit_conditional_branch): Don't - use (op0-op1) == 0 if op0 is a pointer. - -2004-11-10 Joseph S. Myers - - PR c/18322 - * c-common.c (fname_decl): Don't use line number of decl in - diagnostic. - -2004-11-10 Eric Botcazou - - * config/sparc/sparc.c (function_arg_union_value): New 'slotno' - argument. Return naked register for unions with zero length. - When the union is passed in the 6th slot, build a PARALLEL with - only one element. - (function_arg): Adjust call to function_arg_union_value. - (function_value): Likewise. - -2004-11-09 H.J. Lu - - PR target/18380 - * config/ia64/unwind-ia64.h (_Unwind_FindTableEntry): Mark it - hidden. - - * unwind-dw2.c (_Unwind_FindTableEntry): Removed. - -2004-11-10 Alan Modra - - PR target/16480 - 2004-08-26 Alan Modra - * config/rs6000/rs6000.c (rs6000_split_multireg_move): Don't abort - on "(mem (symbol_ref ..))" rtl. Look at LO_SUM base regs as well - as PLUS base regs. - 2004-08-01 Geoffrey Keating - * config/rs6000/rs6000.c (rs6000_split_multireg_move): Just abort - if trying to *store* to a non-offsettable address. - 2004-07-30 Geoffrey Keating - * config/rs6000/rs6000.c (rs6000_split_multireg_move): Cope with - non-offsettable addresses being moved into multiple GPRs. - -2004-11-07 Richard Sandiford - - * config/mips/t-iris6 (tp-bit.c): Fix target filename. - -2004-11-07 Mark Mitchell - - * version.c (version_string): Set to 3.4.4. - * doc/include/gcc-common.texi (version): Likewise. - -2004-11-04 Release Manager - - * GCC 3.4.3 released. - -2004-10-31 Jakub Jelinek - - PR middle-end/18129 - * varasm.c (copy_constant): Don't copy STRING_CSTs if - flag_writable_strings. - (build_constant_desc): Call copy_constant unconditionally. - -2004-10-30 Roger Sayle - - PR rtl-optimization/17581 - * cselib.c (cselib_process_insn): The last instruction of a libcall - block, with the REG_RETVAL note, should be considered in the libcall. - * gcse.c (do_local_cprop): Allow constants to be propagated outside - of libcall blocks. - (adjust_libcall_notes): Use simplify_replace_rtx instead of - replace_rtx to avoid creating invalid RTL in REG_RETVAL notes. - -2004-10-27 Andrew Pinski - - PR other/18186 - * common.opt (--param): Fix spelling of parameter. - -2004-10-27 Andreas Krebbel - - * config/s390/s390.md ("*subdf3_cc"): Replaced plus by minus. - -2004-10-26 Richard Sandiford - - PR bootstrap/15747 - * doc/install.texi (mips-sgi-irix5): Document that /bin/sh has been - reported to hang during bootstrap and that CONFIG_SHELL=/bin/ksh - can be used to work around this. - -2004-10-26 Roger Sayle - John David Anglin - - Backport 3.4 regression fix from mainline - * cse.c: Change encoding of quantity numbers to avoid undefined - pointer arithmetic on qty_table. - (REGNO_QTY_VALID_P): A quantity is now valid if it isn't negative. - (get_cse_reg_info): Initialize reg_qty to a unique negative value. - (new_basic_block): Assign "real" quantity numbers from zero. - (delete_reg_equiv): Do nothing if quantity is invalid. Reset the - REG_QTY to its unique negative value. - (merge_equiv_classes): Calculate need_rehash if quantity is valid. - (cse_main): Don't include max_reg when determining max_qty. - (cse_basic_block): Avoid subtracting a large offset from qty_table, - which causes undefined C99 behaviour. Only allocate needed memory. - -2004-10-25 Jakub Jelinek - - * dwarf2out.c (rtl_for_decl_location): Avoid segfault if - DECL_INCOMING_RTL is NULL. - -2004-10-21 Eric Christopher - - * config/rs6000/rs6000.c (setup_incoming_varargs): Align DFmode - saves. - -2004-10-22 Bernardo Innocenti - - Backport from the mainline: - 2004-10-22 Peter Barada - * config/m68k/m68k.h (HARD_REGNO_RENAME_OK): New macro. - * config/m68k/m68k.c (m68k_hard regno_rename_ok): Disallow - renaming of non-live registers in interrupt functions. - * config/m68k/m68k-protos.h (m68k_hard_regno_rename_ok): Add prototype. - -2004-10-21 Giovanni Bajo - - * config/arc/lib1funcs.asm (___umulsidi3): Fix typo. - -2004-10-21 Aldy Hernandez - - PR 18004. - * expmed.c (store_bit_field): Pass original 'value' before - recursing. - -2004-10-21 Ramana Radhakrishnan - - * config/arc/lib1funcs.asm (___umulsidi3): Correct usage of flags. - - PR target/17317 - * config/arc/arc.h (REGNO_OK_FOR_BASE_P,REGNO_OK_FOR_INDEX_P, - REG_OK_FOR_BASE, REG_OK_FOR_INDEX): Consider blink(r31) as a valid - base and index register for loads. - - * config/arc/t-arc: Fix multilib handling. - -2004-10-18 H.J. Lu - - PR bootstrap/17684 - * Makefile.in (clean): Remove libgcc_s$(SHLIB_EXT).1.stage?. - (stage1-start): Remove and copy libunwind.a and - libunwind*$(SHLIB_EXT) instead of libunwind*. - (stage2-start): Likewise. - (stage3-start): Likewise. - (stage4-start): Likewise. - (stageprofile-start): Likewise. - (stagefeedback-start): Likewise. - - * config/alpha/t-osf4 (SHLIB_LINK): Use a temporary file for - the shared library to be created and don't remove the existing - shared library. - * config/arm/t-netbsd (SHLIB_LINK): Likewise. - * config/mips/t-iris5-6 (SHLIB_LINK): Likewise. - * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise. - * config/sh/t-linux (SHLIB_LINK): Likewise. - * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise. - * config/t-slibgcc-darwin (SHLIB_LINK): Likewise. - * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise. - * config/t-slibgcc-sld (SHLIB_LINK): Likewise. - - * mklibgcc.in (libgcc-stage-start): Also move "*${objext}s" - files. - -2004-10-18 Jakub Jelinek - - * config/i386/i386.md (addqi_1_slp): Test for incdec_operand - operand 1 instead of 2 - -2004-10-17 David O'Brien - - * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Sync '-p' handling with - other FreeBSD platforms. - -2004-10-14 Richard Henderson - - PR debug/14492 - * dwarf2out.c (loc_descriptor_from_tree): Handle FIX_*_EXPR. - -2004-10-14 Richard Henderson - - PR c/17023 - * c-parse.in (compstmt_primary_start): Check last_tree non-null, - not current_function_decl non-null. - -2004-10-14 Roger Sayle - - PR other/17361 - * c-opts.c (c_common_init_options): Scan command line options for - "-lang-asm" and if found allow any of the C-family front-end options. - Likewise, scan all command line options for g77's -traditional-cpp. - -2004-10-14 Kaveh R. Ghazi - - * doc/install.texi (*-*-solaris2*): Update with info about kernel - patches to solve spurious testsuite failures. - -2004-10-13 Andrew Pinski - - * dwarf2out.c (rtl_for_decl_location): Do not use MEM_P but use - GET_CODE == MEM. - -2004-10-13 Richard Henderson - - PR debug/15860 - * dwarf2out.c (rtl_for_decl_location): Apply big-endian correction - for DECL_INCOMING_RTL. - -2004-10-13 Richard Henderson - - PR c/17384 - * c-common.c (handle_mode_attribute): Disallow mode changes that - alter the CODE of the top-level type. - - * crtstuff.c (__FRAME_END__): Remove mode attribute. Find 32-bit - integer from internal limits macros. - * config/i386/emmintrin.h (__v2df): Fix base type. - * config/i386/xmmintrin.h (__m128, __v4sf): Likewise. - -2004-10-13 Richard Henderson - - PR debug/13841 - * function.c (instantiate_decl): Recurse for CONCAT. - -2004-10-13 Eric Botcazou - - PR target/14454 - * config/sparc/sparc.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Set to - sparc_can_output_mi_thunk. - (sparc_output_mi_thunk): Simplify handling of delta offset. Add - handling of vcall offset. - (sparc_can_output_mi_thunk): New predicate. - * doc/tm.texi (TARGET_ASM_OUTPUT_MI_THUNK): Document VCALL_OFFSET. - (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Delete. - (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New target hook. - - * config/sparc/sparc.md (movdi): Remove redundant test. - -2004-10-12 Richard Henderson - - PR rtl-opt/17503 - * regclass.c (subregs_of_mode): Turn into an htab. Make static. - (som_hash, som_eq): New. - (init_subregs_of_mode, record_subregs_of_mode): New. - (cannot_change_mode_set_regs): Rewrite for htab implementation. - (invalid_mode_change_p): Likewise. - * combine.c (gen_lowpart_for_combine): Use record_subregs_of_mode. - * flow.c (mark_used_regs): Likewise. - (life_analysis): Use init_subregs_of_mode. - * regs.h (subregs_of_mode): Remove. - * rtl.h (init_subregs_of_mode, record_subregs_of_mode): Declare. - -2004-10-10 Roger Sayle - - PR rtl-optimization/17853 - * combine.c (combine_simplify_rtx): Don't attempt any simplifications - of vector mode comparison operators. - * cse.c (fold_rtx): Likewise. - * simplify-rtx.c (simplify_gen_relational): Avoid calling - simplify_relational_operation with vector mode comparison operators. - (simplify_rtx): Likewise. - -2004-10-09 Joseph S. Myers - - * config/rs6000/spe.h (atosfix16, atosfix32, atosfix64, atoufix16, - atoufix32, atoufix64, strtosfix16, strtosfix32, strtosfix64, - strtoufix16, strtoufix32, strtoufix64): Declare. - -2004-10-08 Andrew Pinski - - PR c/16999 - * c-ppoutput.c (cb_ident): Don't quote string as it is already - quoted. - -2004-10-08 Eric Botcazou - - PR target/17245 - * config/sparc/sparc.c (input_operand): Remove redundant code - for handling LO_SUM. - (legitimate_address_p) : Do not recheck TARGET_V9. - : If LO_SUM is offsettable, accept it for TFmode on V9. - Otherwise only accept it for TFmode if quad move insns are available. - -2004-10-07 Giovanni Bajo - - PR c++/17115 - * tree-inline.c (expand_call_inline): Do not warn for functions - marked with attribute noinline. - -2004-10-07 Eric Botcazou - - * doc/install.texi (*-*-solaris2*): Fix marker for URL. - -2004-10-07 Richard Sandiford - - PR target/17770 - * config/mips/mips.md (mov_lwl): Remove hazard=none attribute. - -2004-10-07 Eric Botcazou - - PR rtl-optimization/17027 - Backport from mainline: - * cfglayout.c (fixup_fallthru_exit_predecessor): If the first block - falls through to exit, split it. - * cfgrtl.c (rtl_split_block): If no insn is specified, split on the - first insn in the basic block. - -2004-10-06 H.J. Lu - - * doc/invoke.text (freorder-functions): Add a leading `.' to - "text.hot" and "text.unlikely" sections. - -2004-10-06 Eric Botcazou - - PR target/16007 - * doc/install.texi (*-*-solaris2*): Mention potential problem - with Sun assembler + GNU linker and C++ programs. - Document status of binutils 2.15 release. - -2004-10-06 Alan Modra - - PR 16406 - * doc/tm.texi (LIBGCC_SPEC): Mention modifications. - (USE_LD_AS_NEEDED, LINK_EH_SPEC): Document. - -2004-10-03 Alan Modra - - * config/rs6000/linux.h (TARGET_C99_FUNCTIONS): Define. - (OS_MISSING_POWERPC64): Move, and comment. - * config/rs6000/linux64.h (TARGET_C99_FUNCTIONS): Define. - (OS_MISSING_POWERPC64): Move, and comment. - -2004-10-01 Nick Clifton - - * config/stormy16/stormy16.c (TARGET_BUILD_BUILTIN_VA_LIST_TYPE): - Fix typo in macro name, it should be: TARGET_BUILD_BUILTIN_VA_LIST. - -2004-09-30 Richard Henderson - - * config/alpha/qrnnd.asm: Mark for noexecstack. - -2004-09-30 Richard Henderson - - * unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG. - * doc/tm.texi (DWARF_ZERO_REG): New. - - * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, - alpha_expand_epilogue): Revert 2003-09-30 change to store zero. - * config/alpha/alpha.h (DWARF_ZERO_REG): New. - -2004-09-29 David Edelsohn - - PR target/17493 - Backport from mainline - 2004-07-16 Segher Boessenkool - * config/rs6000/eabi.asm (__eabi_convert): Fix typo (cmpi vs. cmpwi). - -2004-09-28 Giovanni Bajo - - PR target/14064 - Backport from mainline - 2004-09-01 James E Wilson - * config/avr/avr.c (avr_unique_section): Delete prototype and - definition. - (TARGET_ASM_UNIQUE_SECTION): Delete. - -2004-09-26 Roger Sayle - - PR other/15526 - Backport from mainline - 2004-05-20 Falk Hueffner - * libgcc2.c (__mulvsi3): Fix overflow test. - -2004-09-24 Roger Sayle - - PR rtl-optimization/9771 - * regclass.c (CALL_REALLY_USED_REGNO_P): New macro to eliminate - conditional compilation in init_reg_sets_1. - (init_reg_sets_1): Let global_regs[i] take priority over the frame - (but not stack) pointer exceptions to regs_invalidated_by_call. - (globalize_reg): Globalizing a fixed register may need to update - regs_invalidated_by_call. - -2004-09-23 Denis Chertykov - - PR target/16884 - * config/avr/avr.md ("movmemhi"): Substitute match_dup to - match_scratch. - (*movmemqi_insn): Likewise. - (*movmemhi): Likewise. - (clrmemhi): Likewise. - (*clrmemqi): Likewise. - (*clrmemhi): Likewise. - -2004-09-23 H.J. Lu - - PR bootstrap/17369 - * Makefile.in (@set_gcc_lib_path@): Added. - - * configure.ac: Include ../config/gcc-lib-path.m4. Use - TL_AC_GNU_MAKE_GCC_LIB_PATH. - * configure: Regenerated. - -2004-09-23 Joseph S. Myers - - PR c/16566 - * c-typeck.c (build_component_ref): Don't special-case - COMPOUND_EXPR. - -2004-09-22 Ralf Corsepius - - PR target/15583 - * config/rs6000/rtems.h (TARGET_OS_CPP_BUILTINS): Add - builtin_define ("__USE_INIT_FINI__"). - -2004-09-20 Richard Sandiford - - PR target/17565 - * config/mips/mips.md (define_asm_attributes): Set can_delay to no. - -2004-09-15 James E Wilson - - PR target/17455 - * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Return false - if current_function_decl is a sibcall. - -2004-09-15 Alan Modra - - * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Save - location of CR. - * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Ditto. - -2004-09-15 Eric Botcazou - - * doc/install.texi (sparc-sun-solaris2*): Properly format warning. - -2004-09-14 Richard Henderson - - PR rtl-opt/17186 - * function.c (expand_function_end): Revert last change. - - * sibcall.c (call_ends_block_p): Fix thinko finding the - last real insn in a block. - -2004-09-14 Joseph S. Myers - - PR c/15498 - * doc/invoke.texi (Environment Variables): Correct example locale. - -2004-09-14 Daniel Jacobowitz - - * reload.c (find_reloads): Swap operand_loc pointers for - find_dummy_reload if we have swapped two operands. - -2004-09-13 Richard Henderson - - PR inline-asm/6806 - * cselib.c (cselib_invalidate_rtx): Export. Remove unused args. - (cselib_invalidate_rtx_note_stores): New. - (cselib_record_sets, cselib_process_insn): Update to match. - * cselib.h (cselib_invalidate_rtx): Declare. - * postreload.c (reload_cse_simplify): Invalidate asm clobbers. - -2004-09-11 Ramana Radhakrishnan - - PR target/11476 - * gcc/config/arc/arc.c (arc_va_args): Call build1 instead - of build for unary tree operators. - -2004-09-11 Andrew Pinski - - PR target/17167 - backport from the mainline: - 2004-02-28 Andrew Pinski - * config/darwin.h (machopic_finish): Output stub even if - the symbol is already defined. - 2004-02-27 Dale Johannesen - * config/darwin.c (machopic_output_possible_stub_label): - Remove. - config/darwin-protos.h: Ditto. - config/darwin.h: Remove call to it. - -2004-09-11 David Edelsohn - - PR target/17277 - * config/rs6000/aix.h (MD_FROB_UPDATE_CONTEXT): Use __64BIT__ to - choose 64-bit version. - -2004-09-09 Kaz Kojima - - PR 15886 - Backport from mainline: - 2004-06-11 J"orn Rennecke - - * sh.h (ALLOCATE_INITIAL_VALUE): Use return_address_pointer_rtx. - -2004-09-09 Alan Modra - - * config/rs6000/rs6000.c (rs6000_stack_info): Correct alignment of - save_size. - -2004-09-08 H.J. Lu - - * configure: Regenerated. - -2004-09-08 Richard Henderson - - PR rtl-opt/17186 - * function.c (expand_function_end): Have fall-off-the-end - return path jump around return register setup. - -2004-09-08 H.J. Lu - - PR target/14925: - Makefile.in (LIB2ADDEHSTATIC): New. - (LIB2ADDEHSHARED): New. - (LIBUNWIND): New. - (LIBUNWINDDEP): New. - (SHLIBUNWIND_LINK): New. - (SHLIBUNWIND_INSTALL): New. - (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND, - LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL. - (clean): Remove libunwind* - (stage1-start): Remove and copy stage1/libunwind*. - (stage2-start): Remove and copy stage2/libunwind*. - (stage3-start): Remove and copy stage3/libunwind*. - (stage4-start): Remove and copy stage4/libunwind*. - (stageprofile-start): Remove and copy stageprofile/libunwind*. - (stagefeedback-start): Remove and copy stagefeedback/libunwind*. - - * config.gcc (ia64*-*-linux*): Always add t-libunwind to - tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to - tmake_file if --with-system-libunwind isn't used. - - * config/ia64/t-glibc-libunwind: New file. - * config/t-libunwind-elf: Likewise. - * unwind-compat.c: Likewise. - * unwind-compat.h: Likewise. - * unwind-dw2-fde-compat.c: Likewise. - - * config/ia64/t-glibc (LIB2ADDEH): Updated. - * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. - - * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define - aliases if needed. - * unwind-dw2-fde-glibc.c: Likewise. - * unwind-dw2.c: Likewise. - - * config/t-libunwind (LIB2ADDEH): Updated. - (LIB2ADDEHSTATIC): New. - (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. - (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER. - - * configure.ac: Change --enable-libunwind-exceptions to - --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS. - * configure: Regenerated. - * config.in: Updated. - - * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or - above and mention --with-system-libunwind. - (ia64-*-hpux*): Mention --enable-libunwind-exceptions is - removed in gcc 3.4.3 and later. - - * gcc.c (init_spec): Add -lunwind to -lgcc_s if - USE_LIBUNWIND_EXCEPTIONS is defined. - - * mklibgcc.in: Support libunwind. - -2004-09-07 Mark Mitchell - - * version.c (version_string): Restore pre-release marker. - * doc/include/gcc-common.texi: Set version to 3.4.3. - -2004-09-06 Release Manager - - * GCC 3.4.2 released. - -2004-09-05 Mark Mitchell - - PR bootstrap/17325 - Backport from mainline - 2004-06-23 Wu Yongwei - * gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. - (__gthr_i486_lock_cmp_xchg): New inline assembly function. - (__GTHR_W32_InterlockedCompareExchange): New macro to choose a - suitable function for interlocked compare-and-exchange. - (__gthread_mutex_trylock): Use - __GTHR_W32_InterlockedCompareExchange. - (__gthread_mutex_init_function, __gthread_mutex_lock, - __gthread_mutex_trylock, __gthread_mutex_unlock): Adjust the - initial counter value to work correctly under Windows 95. - * config/i386/gthr-win32.c: Adjust include order. - Define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES before including - gthr-win32.h. - (__gthr_win32_mutex_init_function, __gthr_win32_mutex_lock, - __gthr_win32_mutex_trylock, __gthr_win32_mutex_unlock): Adjust - to match inline versions in gthr-win32.h. - - 2004-04-27 Wu Yongwei - * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure. - (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. - (__gthread_mutex_init_function): Replace CreateMutex with - initialization of custom mutex using CreateSemaphore. - (__gthread_mutex_lock): Use InterlockedIncrement. - (__gthread_mutex_trylock): Use InterlockedCompareExchange. - (__gthread_mutex_unlock): Use InterlockedDecrement and - ReleaseSemaphore to unlock - * config/i386/gthr-win32.c (__gthread_mutex_init_function, - __gthread_mutex_lock, __gthread_mutex_trylock, - __gthread_mutex_unlock): Adjust to match inline versions in - gthr-win32.h. - -2004-09-03 Kaz Kojima - - PR target/17303 - Backport from mainline: - 2004-08-31 Kaz Kojima - - * config/sh/sh.c (output_branch): Check the insn length possibly - in the delayed slot. - -2004-09-01 Zdenek Dvorak - - PR rtl-optimization/16408 - * gcse.c (replace_store_insn): Fix LIBCALL/RETVAL notes. - -2004-09-01 Richard Henderson - - * config/ns32k/ns32k.h (TRANSFER_FROM_TRAMPOLINE): Remove. - (TRAMPOLINE_TEMPLATE): Merge code from __trampoline inline. - -2004-09-01 Jakub Jelinek - - * libgcc-std.ver (GCC_3.4.2): Export also __trampoline_setup. - -2004-09-01 Jakub Jelinek - - * fold-const.c (operand_equal_p): Require equal sign also for - FIX_{CEIL,TRUNC,FLOOR,ROUND}_EXPR. - -2004-08-31 Jeff Law - - * gcse.c (remove_reachable_equiv_notes): Scan loops where - the store expression is killed for REG_EQUAL/REG_EQUIV notes - that need to be removed. - -2004-08-30 Mark Mitchell - - Revert: - 2004-08-29 Mark Mitchell - PR rtl-optimization/16590 - * gcse.c (pre_delete): Do not create invalid REG_EQUAL notes. - -2004-08-29 Mark Mitchell - - PR rtl-optimization/16590 - * gcse.c (pre_delete): Do not create invalid REG_EQUAL notes. - -2004-08-26 Richard Henderson - - * config/alpha/alpha.h (HARD_REGNO_MODE_OK): Allow complex float - modes. - -2004-08-26 Kazuhiro Inaoka - - PR target/17119. - * config/m32r.c (gen_compare): Use reg_or_int16_operand when - checking for a valid constant, regardless of sign. - -2004-08-25 Richard Henderson - - PR target/16974 - * config/alpha/alpha.md (adddi_fp_hack): Don't rely on splitting - if the constant satisfies add_operand. - -2004-08-25 Richard Henderson - - PR debug/10695 - * config/alpha/alpha.c (emit_frame_store_1, emit_frame_store): New. - (alpha_expand_prologue): Handle >32-bit frames. Generate proper - unwind info for >16-bit frames. - -2004-08-25 Richard Henderson - - * config/alpha/alpha.c (alpha_cannot_force_const_mem): New. - (TARGET_CANNOT_FORCE_CONST_MEM): New. - -2004-08-25 Richard Earnshaw - - PR target/15927 - * arm.h (THUMB_SECONDARY_OUTPUT_RELOAD_CLASS): Don't need a secondary - reload if CLASS is BASE_REGS. - -2004-08-25 Richard Earnshaw - - * PR target/15948 - * arm.md (bicsi3_cbranch): Add alternative to handle tying operands - one and two. - -2004-08-24 Richard Henderson - - PR target/16298 - * config/i386/i386.c (legitimate_constant_p): Rework to not accept - random codes within CONST. - -2004-08-24 Paolo Bonzini - - PR target/17113 - * config/i386/i386.md (movv16qi_internal): Fix typo. - -2004-08-24 Kazuhiro Inaoka - - PR target/17093 - * config/m32r/m32r.md (movsi_sda): Add SI mode specification to - UNSPEC. - -2004-08-24 Jonathan Wakely - - * doc/trouble.texi (C++ misunderstandings): Fix example code. - -2004-08-23 Roger Sayle - - PR rtl-optimization/17078 - * c-semantics.c (expand_unreachable_if_stmt): If the end of the - specified statement list is reachable, always return a non-NULL - pointer. If necessary, return error_mark_node. - -2004-08-23 Mark Mitchell - - PR c/14492 - * dwarf2out.c (loc_descriptor_from_tree): Robustify. - - PR c/16180 - * jump.c (duplicate_loop_exit_test): If the location reached by - the unconditional jump at the top of the loop is outside the loop, - then do not treat it as the exit test. - -2004-08-23 Janis Johnson - - Backports from mainline: - - 2004-02-11 Ziemowit Laski - 2004-02-21 Ziemowit Laski - 2004-02-27 Ziemowit Laski - 2004-03-04 Ziemowit Laski - 2004-03-20 Ziemowit Laski - 2004-03-24 Ziemowit Laski - 2004-05-11 Fariborz Jahanian - 2004-07-23 Janis Johnson - 2004-08-12 Janis Johnson - 2004-08-12 Ben Elliston - 2004-08-16 Janis Johnson - - * c-common.c (vector_size_helper): Remove; call - reconstruct_complex_type() instead. - * hooks.c (hook_constcharptr_tree_null): New hook. - * hooks.h (hook_constcharptr_tree_null): New prototype. - * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): New target hook. - * target.h (mangle_fundamental_type): New target hook. - * tree.c (reconstruct_complex_type): New function - (formerly vector_size_helper() in c-common.c). - (make_vector): Make externally visible. - * tree.h (reconstruct_complex_type, make_vector): Add prototypes. - * doc/extend.texi (AltiVec builtins): Document additional differences - from the Motorola AltiVec PIM. - * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Document. - * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Refer to - SUBTARGET_OPTION_TRANSLATE_TABLE for architecture-specific options. - * config/i386/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): Define it. - * config/rs6000/altivec.h: #error out if '-maltivec' not specified. - (vector, pixel, bool): #define to __vector, __pixel and __bool. - Change vector to __vector (except for the `vector' macro itself). - (__un_args_eq, __bin_args_eq, __tern_args_eq): Move to C-specific - portion of header. - (__altivec_link_error_invalid_argument): Remove prototype; will use - __builtin_altivec_compiletime_error("vec_*") instead. - (vec_*): Fix/complete set of available operation overloads given the - existence of distinct 'vector bool ...' and 'vector pixel' types; - tighten cv-correctness of pointer arguments; in C, always check for - correct argument types before macro expansion. - (vec_splat_s8, vec_splat_s16, vec_splat_s32, vec_splat_u8, - vec_splat_u16, vec_splat_u32): Change C++ definitions to accept a - 'const int' argument; the prototypes already do. - (vec_dst, vec_dstst, vec_dststt, vec_dstt, vec_sld, vec_splat): Add - prototypes, marked with always_inline attribute. - * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): New macro - defining Darwin/PowerPC-specific '-f[no-]altivec' and - '-W[no-]altivec-long-deprecated' switches. - * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Pre-define - '__vector', '__pixel' and '__bool' macros using - '__attribute__((altivec(...)))' types. - * config/rs6000/rs6000.c (bool_char_type_node, bool_short_type_node, - bool_int_type_node, pixel_type_node, bool_V16QI_type_node, - bool_V8HI_type_node, bool_V4SI_type_node, pixel_V8HI_type_node): - New type nodes. - (rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch): New, for - handling '-W[no-]altivec-long-deprecated'. - (rs6000_override_options): Handle '-W[no-]altivec-long-deprecated'. - (rs6000_expand_binop_builtin, rs6000_expand_ternop_builtin, - altivec_expand_dst_builtin): Remove casts from integer literals. - (altivec_expand_builtin): Likewise; handle expansion of new - '__builtin_altivec_compiletime_error' function. - (rs6000_init_builtins): Initialize 'vector bool ...' and 'vector pixel' - types, and make them distinct from other vector types; register - '__builtin_altivec_compiletime_error' function. - (print_operand): For 'P', print a full target register name instead of - merely its number. - (rs6000_attribute_table): Add "altivec" attribute. - (rs6000_handle_altivec_attribute): New function. - (rs6000_common_init_builtins): Rename v4si_ftype_char, v8hi_ftype_char, - v16qi_ftype_char, v4sf_ftype_v4si_char, v4si_ftype_v4sf_char, - v4si_ftype_v4si_char, v8hi_ftype_v8hi_char, v16qi_ftype_v16qi_char, - v16qi_ftype_v16qi_v16qi_char, v8hi_ftype_v8hi_v8hi_char, - v4si_ftype_v4si_v4si_char and v4sf_ftype_v4sf_v4sf_char to - end in ..._int; change them to accept an int instead of a char - as the last parameter. - (altivec_expand_dst_builtin): Treat expansion as completed even if - literal argument is invalid (so that other expansions are not tried - in vain). - (TARGET_MANGLE_FUNDAMENTAL_TYPE): Point target hook at - rs6000_mangle_fundamental_type. - (rs6000_mangle_fundamental_type): New function. - * config/rs6000/rs6000.h (TARGET_OPTIONS): Describe - '-m[no-]-warn-altivec-long' (which '-W[no-]altivec-long-deprecated' - maps to). - (rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch): Forward - declare. - (ALTIVEC_BUILTIN_COMPILETIME_ERROR): New built-in enumeration. - -2004-08-20 Jakub Jelinek - - PR target/16195 - * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Make r30 - fixed if TARGET_TOC && TARGET_MINIMAL_TOC. - * config/rs6000/rs6000.c (first_reg_to_save): Pretend - call_used_regs[30] is 0 if TARGET_TOC && TARGET_MINIMAL_TOC. - (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise. - -2004-08-17 Joseph S. Myers - - * c-decl.c (grokdeclarator): Allow for function definition where - innermost declarator has attributes. - -2004-08-17 Daniel Bornstein - - PR target/17019 - * arm.md (addsi3_cbranch_scratch): Correct case labels. - -2004-08-14 Roger Sayle - David Billinghurst - - PR libgfortran/15930 - * fixinc/inclhack.def (irix___generic1, irix___generic2): New. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/internal/math_core.h: New file - -2004-08-14 Roger Sayle - Bruce Korb - - * fixinc/inclhack.def (aix_syswait_2): New fix. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/sys/wait.h: Update for new test. - -2004-08-14 Gerald Pfeifer - Dimitri Papadopoulos-Orfanos - Dave Korn - - * doc/install.texi (Building): Avoid duplicate reference to GNU - make requirement. - (*-*-solaris2*): Do not recommend GNU make any longer. Simplify. - -2004-08-13 J"orn Rennecke - - * sh.md (cbranch define_delay) Use cond_delay_slot for - non-anulled condition too. - -2004-08-11 Mark Mitchell - - PR c++/16618 - * ginclude/stddef.h (offsetof): Refine C++ definition. - -2004-08-12 Alan Modra - - Merge from mainline. - 2004-07-01 Alan Modra - * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Rewrite. - (function_arg): Use rs6000_arg_size rather than CLASS_MAX_NREGS in - calculating gpr size for altivec. Simplify and correct - rs6000_mixed_function_arg calls. Call rs6000_mixed_function_arg - for ABI_V4 gpr case too. Fix off-by-one error in long double - reg test. Generate the correct PARALLEL to handle long double - for ABI_AIX 32-bit. Use this for -m32 -mpowerpc64 fpr case too. - (function_arg_partial_nregs): Align before calculating regs left. - Don't return info on partial fprs when we need info on gprs. - Correct long double fpr off-by-one error. - -2004-08-11 James E Wilson - - PR rtl-optimization/16490 - * cfgrtl.c (cfg_layout_split_edge): Set global_live_at_start and - global_live_at_end for new basic block if already set for other blocks. - -2004-08-07 Roger Sayle - - PR middle-end/16790 - * fold-const.c (expand_muldiv_1) : Disallow local - truncations, not just global truncations. - -2004-08-07 Alan Modra - - * config/rs6000/rs6000.c (function_arg_padding): Revert 2004-07-28. - -2004-08-04 Zack Weinberg - - PR 13956 - * dbxout.c (dbx_output_lbrac, dbx_output_rbrac): New - functions, broken out of dbxout_block. - (dbxout_block): The block at depth 0 should get LBRAC/RBRAC - stabs too, if it contains symbols. Use the begin_label and - the Lscope label (emitted by dbxout_function_end) for the - range of this block. - (dbxout_function_decl): Always call dbxout_function_end. - (dbxout_function_end): Return after emitting the "Lscope" symbol - under the same conditions that this function formerly wasn't called. - Add explanatory comments. - -2004-08-03 Yossi Markovich - Mostafa Hagog - - * config/rs6000/altivec.md (altivec_vnmsubfp): Fix wrong pattern. - -2004-07-31 Andrew Pinski - - PR other/16842 - * mkheaders.in (libsubdir): s/gcc-lib/gcc/. - -2004-07-28 Aldy Hernandez - - * config/rs6000/rs6000.md ("move_from_CR_gt_bit"): Rename to - move_from_CR_eq_bit. - Rename UNSPEC_MV_CR_GT to UNSPEC_MV_CR_EQ. - - - * config/rs6000/spe.md ("e500_flip_gt_bit"): Rename to - e500_flip_eq_bit. - - * config/rs6000/rs6000-protos.h: Rename output_e500_flip_gt_bit to - output_e500_flip_eq_bit. - - * config/rs6000/rs6000.c (output_e500_flip_gt_bit): Rename to - output_e500_flip_eq_bit. - (rs6000_emit_sCOND): Rename call to output_e500_flip_gt_bit to - output_e500_flip_eq_bit. - Rename gen_move_from_CR_gt_bit to gen_move_from_CR_eq_bit. - (print_operand): case D. Get to EQ bit. - -2004-07-28 Alan Modra - - * config/rs6000/rs6000.c (function_arg_padding): Pad SFmode upwards. - -2004-07-24 Alexander Kabaev - - * config/ia64/ia64.h (SUBTARGET_EXTRA_SPECS): Default to nothing. - (EXTRA_SPECS): Use SUBTARGET_EXTRA_SPECS. - -2004-07-26 David Edelsohn - - PR target/16239 - * config/rs6000/rs6000.md (movdi_internal64): Further disparage - f->f. - -2004-07-26 Richard Sandiford - - PR rtl-optimization/16643 - * cfglayout.h (cfg_layout_initialize): Add a flags parameter. - * cfglayout.c (cfg_layout_initialize): Pass it to cleanup_cfg. - * basic-block.h (reorder_basic_blocks): Add a flags parameter. - * cfglayout.c (reorder_basic_blocks): Pass it to cfg_layout_initialize. - * loop-init.c (loop_optimizer_init): Pass 0 to cfg_layout_initialize. - * rtl.h (tracer): Add a flags parameter. - * tracer.c (tracer): Pass it to cfg_layout_initialise. - * toplev.c (rest_of_handle_stack_regs): Pass 0 to reorder_basic_blocks. - (rest_of_handle_reorder_blocks): Update calls to tracer and - reorder_basic_blocks, passing CLEANUP_UPDATE_LIFE if appropriate. - (rest_of_handle_tracer): Pass 0 to tracer. - -2004-07-24 Zack Weinberg - - * config/ia64/hpux.h: Do not disable TLS. - -2004-07-24 Alexander Kabaev - Zack Weinberg - Jan Hubicka - - PR middle-end/15345 - PR c/16450 - * toplev.c (rest_of_handle_inlining): Set DECL_DEFER_OUTPUT on C - nested functions as well. - * tree-optimize.c (tree_rest_of_compilation): Don't clear decl rtls - for deferred nested inlines. - -2004-07-17 Eric Botcazou - - * libgcc2.c (__enable_execute_stack): New symbol. - * libgcc-std.ver (GCC_3.4.2): New version. Inherit from GCC_3.4 - and declare __enable_execute_stack. - * mklibgcc.in (lib2funcs): Add _enable_execute_stack. - * config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): ANSIfy. - * config/sol2.h (TRANSFER_FROM_TRAMPOLINE): Rename into - ENABLE_EXECUTE_STACK and ANSIfy. - * config/alpha/alpha.c (alpha_initialize_trampoline): Conditionalize - on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. - * config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Rename into - ENABLE_EXECUTE_STACK. - * config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. - * config/i386/i386.c (x86_initialize_trampoline): Conditionalize - on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. - * config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Rename into - ENABLE_EXECUTE_STACK. - * config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. - * config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Likewise. - * config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. - * config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. - * config/sparc/sparc.c (sparc_initialize_trampoline): Conditionalize - on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. - (sparc64_initialize_trampoline): Likewise. - * doc/tm.texi (trampolines): Add ENABLE_EXECUTE_STACK macro. - -2004-07-16 Andris Pavenis - - PR preprocessor/16366 - * internal.h (struct cpp_reader): New field dir_hash. - * files.c (make_cpp_dir): Use dir_hash, not file_hash. - (_cpp_init_files, _cpp_cleanup_files): Update for new field. - -2004-07-15 James E Wilson - - Backport from mainline: - 2004-02-19 Steve Ellcey - * config/ia64/ia64.h (HARD_REGNO_CALLER_SAVE_MODE): New macro. - * testsuite/gcc.dg/20040219-1.c: New test. - -2004-07-15 Aldy Hernandez - - * config/rs6000/rs6000.md ("*cceq_ior_compare"): Allow - unconditionally. - * config/rs6000/spe.md ("e500_cceq_ior_compare"): Remove. - -2004-07-14 James E Wilson - - PR target/16325 - * config/mips/mips.h (STARTING_FRAME_OFFSET): When flag_profile_value - and ! TARGET_64BIT, include REG_PARM_STACK_SPACE. - -2004-07-14 Eric Botcazou - - Backport from mainline: - 2004-07-13 Eric Botcazou - - PR target/13926 - * config/sparc/sparc-protos.h (output_ubranch): New prototype. - * config/sparc/sparc.c (output_ubranch): New function. - * config/sparc/sparc.md (jump pattern): Use it. - -2004-07-13 Richard Sandiford - - PR rtl-optimization/16380 - * loop.c (check_dbra_loop): Sink comparison instructions if they - do something other than set cc0. - -2004-07-13 Eric Botcazou - - PR target/16494 - * config/sparc/sparc.c (output_cbranch): Properly guard - the code handling far branches with TARGET_V9. - * config/sparc/sparc.md (length attribute): Document the - side-effect of having a length greater or equal to 3. - -2004-07-13 Eric Botcazou - Lloyd Parkes - - PR target/15186 - * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC_BASE): Pass - /usr/ucblib/sparcv9 as -R path when -compat-bsd is specified. - -2004-07-13 Eric Botcazou - Martin Sebor - - PR target/12602 - * doc/invoke.texi (SPARC options): Document -threads - and -pthreads on Solaris. - -2004-07-13 Anthony Heading - - * configure.ac (gcc_cv_as_offsetable_lo10): Fix a typo. - * configure: Rebuilt. - -2004-07-12 Vladimir Makarov - - PR target/16445 - * config/ia64/ia64.c (bundling): Don't count ignored insns. - -2004-07-10 John David Anglin - - * pa.c (output_indirect_call): Only use %r2 as the link register in - indirect calls with the long PA 2.0 pc-relative branch. - -2004-07-10 James E Wilson - - * config/gofast.h (gofast_maybe_init_libfuncs): Use SImode for litodp. - -2004-07-10 Jakub Jelinek +2007-04-17 H.J. Lu * Backport from mainline: - 2004-07-08 Paolo Bonzini - Jakub Jelinek + 2007-04-17 H.J. Lu - * config/i386/i386.c (override_options): Enable - SSE prefetches with -mtune, as long as we are - compiling for i686 or higher. All i686 processors - accept SSE prefetches as NOPS, some i586's don't. + * config/i386/sse.md (sse_vmaddv4sf3): Use register_operand + on "0". + (sse_vmmulv4sf3): Likewise. + (sse2_vmaddv2df3): Likewise. + (sse2_vmmulv2df3): Likewise. - 2004-07-07 Jakub Jelinek +2007-04-16 Matthias Klose - * config/i386/i386.c (override_options): Don't set x86_prefetch_sse - from -mtune= option. + * config/alpha/linux.h (CPP_SPEC): Define. + * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Extend. -2004-07-10 Jakub Jelinek +2007-04-16 Anatoly Sokolov - PR tree-optimization/16372 - * fold-const.c (build_range_check): Use TYPE_MODE's precision for - enumerals. - -2004-07-09 John David Anglin - - PR target/16459 - * pa.c (output_indirect_call): Use %r2 as the link register when - calling $$dyncall with a pc-relative branch. - -2004-07-08 Gerald Pfeifer - - * doc/install.texi (Binaries): Mention OpenPKG. - -2004-07-09 Eric Botcazou - - PR target/16416 - * config/sparc/sol2-bi.h (OPTION_DEFAULT_SPECS): New macro. - Override default settings to account for -m32 and -m64. - -2004-07-08 Vladimir Makarov - - PR target/16414 - * config/ia64/ia64.c (ia64_dfa_new_cycle): Fix typo in comparison - of asm_noperands result. - -2004-07-08 Eric Botcazou - - PR target/16430 - * config/sparc/sparc.c (function_value): In 64-bit mode, - return the aggregates larger than 16 bytes like unions. - -2004-07-08 Eric Botcazou - - PR target/16199 - * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): When - 'temp' is zero, generate new pseudos as needed and emit the - sequence of insns in single-assignment form. Resync comments - with code. - (sparc_emit_set_const64): Pass zero as 'temp' argument to above - function before reload. - -2004-07-07 Richard Sandiford - - PR target/16407 - * config/mips/mips-protos.h (mips_declare_common_object): Declare. - * config/mips/mips.c (mips_declare_common_object): New function, - mostly split out from... - (mips_output_aligned_decl_common): ...here. - * config/mips/mips.h (ASM_OUTPUT_LOCAL): Remove in favor of... - (ASM_OUTPUT_ALIGNED_LOCAL): ...this new definition. - * config/mips/iris6.h (ASM_OUTPUT_ALIGNED_LOCAL): Undefine this - rather than ASM_OUTPUT_LOCAL. Call mips_declare_common_object. - -2004-07-07 Jason Merrill - - PR c++/15815 - * doc/extend.texi (C++ Interface): Correct information and - discourage use. - -2004-07-07 Andreas Schwab - - * config/ia64/ia64.md: Define new attribute "empty". - (prologue_use, nop_x, insn_group_barrier): Set it. - - * config/ia64/ia64.c (ia64_reorg): When looking for trailing call - skip over "empty" insns. - -2004-07-07 Vladimir Makarov - - PR target/16130 - PR target/16142 - PR target/16143 - * config/ia64/ia64.c (ia64_dfa_new_cycle): Reset DFA state for asm - insn. - -2004-07-06 Kazuhiro Inaoka - - PR target/1679. - * config/m32r/m32r.c (m32r_function_symbol): New function: - Generate a symbol name RTX with the correct m32r specific flags - set. - (block_move_call): Use new function to generate correct symbol. - * config/m32r/m32r-protos.h: Add prototype for new funcion. - * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Use the new - function. - -2004-07-07 Richard Sandiford - - PR target/16357 - * config/mips/mips.c (mips_block_move_straight): Pass BLKmode memrefs - to mips_expand_unaligned_load, mips_expand_unaligned_store, and - move_by_pieces. - -2004-07-07 Richard Sandiford - - PR target/15869 - * config/mips/mips.c (mips_avoid_hazards): Call split_all_insns_noflow. - -2004-07-06 Mark Mitchell - - * doc/include/gcc-common.texi: Increment version number. - * version.c (version_string): Likewise. - -2004-07-06 Joseph S. Myers - - * doc/sourcebuild.texi: Use semicolons instead of commas in - section title. - -2004-07-06 Joseph S. Myers - - * doc/bugreport.texi, doc/configterms.texi, doc/contrib.texi, - doc/contribute.texi, doc/cpp.texi, doc/cppinternals.texi, - doc/extend.texi, doc/install.texi, doc/invoke.texi, doc/md.texi, - doc/portability.texi, doc/trouble.texi: Avoid some first-person - references and patronizing comments. Based on printed manual. - * doc/invoke.texi: Don't reference fortran@gnu.org. - * doc/trouble.texi (Warning when a non-void function value is - ignored): Rewrite. From Russ Allbery and Chris Devers. - -2004-07-06 Joseph S. Myers - - * doc/cppinternals.texi, doc/install.texi, doc/invoke.texi, - doc/md.texi, doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: - Use terminology "testsuite" and "enumerated". - -2004-07-06 Eric Christopher - - PR rtl-optimization/14700 - Backport from mainline: - 2004-06-30 Zack Weinberg - * combine.c (distribute_notes): Don't look at global_regs for - pseudos. - - 2004-06-24 Eric Christopher - * combine.c (distribute_notes): Don't delete sets to - global register variables. - -2004-07-04 Gerald Pfeifer - - * doc/contrib.texi (Contributors): Adjust link for GNU Classpath. - -2004-07-01 Release Manager - - * GCC 3.4.1 released. - -2004-06-28 Neil Booth - - PR preprocessor/16192 - PR preprocessor/15913 - PR preprocessor/15572 - * cppexp.c (_cpp_parse_expr): Handle remaining cases where an - expression is missing. - * cppinit.c (post_options): Traditional cpp doesn't do // comments. - * doc/cpp.texi: Don't document what we do for ill-formed expressions. - * doc/cppopts.texi: Clarify processing of command-line defines. - -2004-06-28 Richard Sandiford - - PR target/16176 - * config/mips/mips.c (mips_expand_unaligned_load): Use a temporary - register for the destination of the lwl or ldl. - -2004-06-25 Philip Blundell - - PR wrong-code/15089 - * loop.c (scan_loop): Do not move user-specified register - assignments. - -2004-06-25 Mark Mitchell - - PR wrong-code/16129 - * alias.c (get_alias_set): Adjust setting of - DECL_POINTER_ALIAS_SET for pointers to aggregates. - -2004-06-25 Richard Sandiford - - PR target/16144 - * config/mips/mips.md (divsf, divdf): Don't FAIL if the first operand - is 1.0; force it into a register instead. - -2004-06-24 Alan Modra - - * calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and - pass raw n_named_args to it. - -2004-06-22 Richard Henderson - - PR middle-end/16026 - * function.c (assign_parms): Don't abort for overaligned PARALLEL. - -2004-06-21 Kelley Cook - - PR target/15551 - * config/i386/i386.md: Change UNSPEC_STACK_PROBE to UNSPECV_STACK_PROBE. - (allocate_stack_worker): Make unspec_volatile. - (allocate_stack_worker_rex64): Likewise. - (allocate_stack_worker_postreload): Likewise. - (allocate_stack_worker_rex64_postreload): Likewise. - -2004-06-21 John David Anglin - - PR rtl-optimization/14782 - * pa.c (emit_move_sequence): Use SFmode for 4-byte modes when doing - the address checks for secondary reloads for loads from and stores - to floating-point registers. - * pa.h (EXTRA_CONSTRAINT, case T): Use SFmode for 4-byte modes - in the address check. Move work around for ELF32 targets to - GO_IF_LEGITIMATE_ADDRESS. - (GO_IF_LEGITIMATE_ADDRESS): Require constant offsets to be - correctly aligned for DImode loads and stores. Don't allow long - SFmode displacements on ELF32. - -2004-06-21 Richard Henderson - - PR rtl-opt/16114 - * cse.c (merge_equiv_classes): Also rehash in response to - delete_reg_equiv changes. - (rehash_using_reg): Don't exclude REGs from rehashing. - -2004-06-21 Richard Sandiford - - PR rtl-optimization/15159 - * tree.c (unsafe_for_reeval): Return 2 for TRY_CATCH_EXPRs. - -2004-06-19 Richard Henderson - - PR target/15941 - * function.c (assign_parms): If not padding upward or intentionally - forcing upward padding, take offset_rtx into account when determining - the alignment for stack_parm. - -2004-06-19 Richard Henderson - - PR target/15550 - * ifcvt.c (noce_try_move): Recognize all generated instructions. - -2004-06-19 Andrew Pinski - - PR target/10129 - * config/darwin.c (darwin_encode_section_info): When the decl has - a DECL_INITIAL, it is only defined also when it is not a common. - -2004-06-17 Zack Weinberg - - Bug 14610 - * Makefile.in (min-insn-modes.o): Correct dependencies. - * real.c (encode_ieee_extended, decode_ieee_extended): Always - produce/consume 12-byte little-endian Intel format. - (encode_ieee_extended_128, decode_ieee_extended_128): Delete. - (encode_ieee_extended_motorola, decode_ieee_extended_motorola) - (encode_ieee_extended_intel_96, decode_ieee_extended_intel_96) - (encode_ieee_extended_intel_128, decode_ieee_extended_intel_128): - New functions which convert between 12-byte little-endian Intel - format and the desired format. - (ieee_extended_motorola_format, ieee_extended_intel_96_round_53_format) - (ieee_extended_intel_96_format, ieee_extended_intel_128_format): - Update. - -2004-06-16 James E Wilson - - PR c++/14808 - * config/i386/cygwin.h (TARGET_IS_PE_COFF): Delete duplicate macro. - -2004-06-16 Bernardo Innocenti - - Backport from mainline: - 2004-06-16 Bernardo Innocenti - - PR target/13292 - * config/m68k/m68k.h (TARGET_SWITCHES): Don't remove MASK_68040_ONLY - on -msoft-float. - (TARGET_FLT_EVAL_METHOD): Don't advertise extended precision for - 68040 and soft-float. - * config/m68k/m68k.md (truncdfsf2): Explicitly require TARGET_68881 - in the TARGET_68040_ONLY case. - -2004-06-16 Vladimir Makarov - - PR target/15653 - * config/ia64/ia64.c (ia64_dfa_new_cycle): Do not insert nops - after shifts before asm. - -2004-06-15 Chris Demetriou - - * config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove - definition. - * config/mips/linux64.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove - #undef and #if 0'd definition. - -2004-06-15 Kazuhiro Inaoka - - * config/m32r/m32r.h (RETURN_ADDR_RTX): Define. - (INCOMING_RETURN_ADDR_RTX): Define. - * config/m32r/m32r-protos.h (m32r_return_addr): Added. - * config/m32r/m32r.c (m32r_exppand_prologue): Changed for - __builtin_return_address(0). - (m32r_return_addr): Added for __builtin_return_address(0). - (m32r_reload_lr): Ditto. - - * longlong.h: Fix macros for m32r add_ssaaaa and sub_ddmmss. - -2004-06-15 Giovanni Bajo - - * gccbug.in: Update optimization -> tree-optimization/rtl-optimization. - -2004-06-14 Eric Botcazou - - * real.c: Fix bit count in head comment. - -2004-06-14 Jakub Jelinek - - PR middle-end/15945 - * simplify-rtx.c (simplify_binary_operation): Don't optimize out - Inf + -Inf, Inf - Inf, Inf / Inf and 0 * Inf if flag_trapping_math. - -2004-06-14 Jakub Jelinek - - PR target/15178 - * config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. - -2004-06-14 Alan Modra - - * config/rs6000/rs6000.h (ASM_CPU_SPEC): Handle -mpowerpc64 and -mcpu - for power5 and rs64a. Correct condition for default. Correct power3, - 620, 630, 7400, 7450, G4, 970 and G5 -mcpu entries. Add -many. - -2004-06-13 Alan Modra - - Apply mainline 2004-01-27 Alan Modra - * config/rs6000/rs6000.h: Correct target_flags free bits comment. - (PREDICATE_CODES): Remove duplicate. - * config/rs6000/linux64.h (CPP_SYSV_SPEC): Don't define. - (SUBSUBTARGET_OVERRIDE_OPTIONS): Disallow 32 bit TARGET_PROFILE_KERNEL. - (MASK_PROFILE_KERNEL): Adjust define. - -2004-06-13 Hans-Peter Nilsson - - PR rtl-optimization/15296 - * reorg.c (fill_simple_delay_slots): Use next_real_insn when - getting last consecutive label at a branch. - (relax_delay_slots): Similar, near top of loop. - -2004-06-12 Andreas Jaeger - - * libgcc-std.ver: Add __unorddf2 and __unordsf2 with version 3.3.4. - * libgcc-darwin.ver: Likewise. - -2004-06-11 Bernardo Innocenti - - PR target/8309 - PR target/13312 - Backport from mainline: - - 2004-05-27 Peter Jakubek - - * reload.c (find_reloads): Force reload for pseudo registers on big - endian machines. - -2004-06-11 J"orn Rennecke - - * sh.c (dump_table): New argument start. Changed caller. - (fixup_mova): New function. - (find_barrier): Use it. - (sh_reorg): Likewise. Check for CODE_FOR_casesi_worker_2. - If the label a mova refers to is above the mova itself, change - the mova into a load. - * sh.md (*casesi_worker): Rename to: - (casesi_worker_1). - (casesi_worker_2): New insn. - -2004-06-11 Hartmut Penner - - Backport from mainline: - - * config/rs6000/rs6000.c (output_vec_const_move): - Find all cases of EASY_VECTOR_15_ADD_SELF. - (easy_vector_constant_add_self): Accept - all vector constant loadable by vsplt* and vadd*. - (easy_vector_same): Use easy_vector_splat_const. - (easy_vector_const): Use easy_vector_splat_const. - (easy_vector_splat_const): New function. - (gen_easy_vector_constant_add_self): New function. - - * config/rs6000/rs6000-protos.c (gen_easy_vector_constant_add_self): - New prototype. - - * config/rs6000/altivec.md (movv4si splitter): Change to - emit move insn with halfed vector constant. - (*movv8hi splitter): Likewise. - (*movv16qi splitter): Likewise. - -2004-06-10 Joseph S. Myers - - * doc/sourcebuild.texi (Front End): Add details of more - installation documentation required. - -2004-06-10 Vladimir Makarov - - PR target/15653 - * haifa-sched.c (schedule_block): Finish cycle after issuing asm - insn. - -2004-06-10 Volker Reichelt - - PR web/15263 - * doc/install.texi: Remove superfluous linebreak. - -2004-06-10 Bernardo Innocenti - - PR target/13803 - Backport from mainline: - - 2004-05-05 Peter Barada - - * config/m68k/m68k.h(EXTRA_CONSTRAINT): Add 'U' for register offset - addressing. - * config/m68k/m68k.md: Add 'U,U' alternative to ColdFire variants of - movsi, movhi, movqi insn patterns. - -2004-06-10 Alan Modra - - Apply from mainline: - 2004-03-12 Jakub Jelinek - * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Add - prototype. - * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): New. - * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Define. - -2004-06-10 Jakub Jelinek - - * config/ia64/unwind-ia64.c (uw_frame_state_for): Don't assume a - leaf function without unwind info at RP 0. - -2004-06-10 Alan Modra - - PR target/15191 - 2004-05-15 Alan Modra - * config/rs6000/rs6000.c (rs6000_va_arg ): Don't use - UNITS_PER_WORD to calculate gpr size. Re-instate code to set reg - count to 8 to handle n_reg > 2. - 2004-05-10 Alan Modra - * config/rs6000/rs6000.c (function_arg_boundary): Always align - AltiVec vectors. - (function_arg_advance): Pass TARGET_32BIT -mabi=no-altivec AltiVec - vectors by refererence. Align the same for TARGET_64BIT to a 16 - byte boundary. Remove useless code. Add function comment. - (function_arg): Similarly. Move gpr rs6000_mixed_function_arg - call to where it belongs. - (function_arg_partial_nregs): Return true for all TARGET_32BIT - -mabi=no-altivec AltiVec vectors. Fix debug output. - (rs6000_va_arg): Adjust for AltiVec change. - 2004-05-10 Alan Modra - * config/rs6000/rs6000.c (function_arg_boundary): Align for ABI_V4 - when size is 8 bytes. - (function_arg_advance): Account for stack space used by AltiVec - args when -mabi=altivec. Simplify alignment calculations. For - ABI_V4, pass AltiVec vectors by reference when -mabi=no-altivec. - (function_arg): Similarly. - (function_arg_pass_by_reference): True for ABI_V4 AltiVec when - not AltiVec ABI. - (rs6000_va_arg): Correct fp arg test. Adjust for AltiVec change. - Correct alignment, and align before testing reg count. Remove - TREE_THIS_VOLATILE from reg. Don't emit unused labels. - (rs6000_complex_function_value): Check TARGET_HARD_FLOAT and - TARGET_FPRS here.. - (rs6000_function_value): .. not here before call. - 2004-05-07 Alan Modra - * config/rs6000/rs6000.h (STACK_BOUNDARY): Use 128 bit for either - TARGET_ALTIVEC or TARGET_ALTIVEC_ABI. - * config/rs6000/sysv4.h (ABI_STACK_BOUNDARY): Likewise. - (STACK_BOUNDARY): Delete. - -2004-06-10 Alan Modra - - PR target/14960 - 2004-04-24 Alan Modra - * config/rs6000/rs6000.c (rs6000_stack_info): Rename total_raw_size - to non_fixed_size, and leave out fixed_size from the sum. - (generate_set_vrsave): Correct clobbers. - (rs6000_emit_epilogue): Test TARGET_ALTIVEC with TARGET_ALTIVEC_SAVE. - (rs6000_function_value): Test TARGET_ALTIVEC and TARGET_ALTIVEC_ABI. - (rs6000_libcall_value): Likewise. - * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise. - (FUNCTION_ARG_REGNO_P): Likewise. - -2004-06-10 Alan Modra - - PR target/14567 - 2004-03-13 Alan Modra - * config/rs6000/rs6000.h (UNITS_PER_ARG, RS6000_ARG_SIZE): Delete. - (HARD_REGNO_MODE_OK): Disallow TFmode for fp31. - * config/rs6000/rs6000.c (rs6000_arg_size): New function. - Update all users of RS6000_ARG_SIZE. - (function_arg_advance): Count fregno using mode size. - (function_arg): Handle long double split over regs and memory. - (function_arg_partial_nregs): Likewise. - (rs6000_va_arg): Repackage complex args. - 2004-02-23 Fariborz Jahanian - * config/rs6000/rs6000.c (function_arg): call to - rs6000_mixed_function_arg for DFmode moved to allow - normal DFmode incoming register assignment. - -2004-06-09 Mark Mitchell - - Revert: - PR c++/15815 - 2004-06-07 Mark Mitchell - * doc/extend.texi: Deprecate #pragma interface and #pragma - implementation. - -2004-06-08 Zdenek Dvorak - - PR rtl-optimization/15761 - * cfgloopanal.c (count_strange_loop_iterations, - count_loop_iterations): Use gen_int_mode instead - of GEN_INT. - -2004-06-08 Roger Sayle - - PR c/14649 - * c-typeck.c (require_constant_value, require_constant_elements): - Move declarations to the top of the file. - (build_function_call): If we require a constant value, fold with - fold_initializer. If the result is a constant, and the function - wasn't called using __builtin_foo, issue a pedantic warning. - (build_unary_op): If we require a constant value, fold tree with - fold_initializer. - (build_binary_op): Use require_constant_value to determine whether - to call fold or fold_initializer. - -2004-06-08 Richard Henderson - - PR middle-end/15228 - * function.c (assign_parms): Always set_mem_align with the computed - FUNCTION_ARG_BOUNDARY. Don't clear stack_parm if !STRICT_ALIGNMENT. - -2004-06-08 Vladimir Makarov - - PR target/15598 - * config/ia64/ia64.c (bundling): Add missed TYPE_A. - -2004-06-08 Zdenek Dvorak - - PR rtl-optimization/15717 - * config/i386/i386.c (legitimate_constant_p): Do not allow - x - symbol_ref. - -2004-06-07 James E Wilson - - PR target/15569 - * config/ia64/ia64.md (call_value_nogp): Add constraints for op0. - (vall_value_gp): Likewise. - -2004-06-07 Dan Kegel - - PR c++/14808 - * config/i386/cygwin.h (TARGET_IS_PE_COFF): New. - * config/i386/cygming.h (TARGET_IS_PE_COFF): New. - -2004-06-07 Eric Botcazou - - PR target/15783 - * config/sparc/sparc.c (function_arg_union_value): Add 'mode' - parameter. Enumerate the registers inside the PARALLEL. - (function_arg): Adjust call to function_arg_union_value. - (function_value): Likewise. - -2004-06-07 John David Anglin - - * pa.c (emit_move_sequence): Fix loading of non 14-bit CONST operands - when generating PIC code. - - * pa.md: Disable the peephole2 patterns that generate indexed - floating-point stores when indexing is disabled. - -2004-06-07 Joseph S. Myers - - PR c/14765 - * c-parse.in (compstmt_primary_start): Set last_expr_type to - NULL_TREE. - -2004-06-07 Mark Mitchell - - PR c++/15815 - * doc/extend.texi: Deprecate #pragma interface and #pragma - implementation. - -2004-06-07 Richard Henderson - - PR rtl-opt/15193 - * expmed.c (extract_bit_field): Fix vector_extract return. - -2004-06-07 Mark Mitchell - - PR c++/15337 - * c-common.c (c_sizeof_or_alignof_type): Use more detailed error - message. - -2004-06-06 Stephane Carrez - - PR target/14542 - * config/m68hc11/m68hc11.md (move peephole2): Emit a use note to avoid - a live change of a register after peephole replacement. - -2004-06-06 Stephane Carrez - - PR target/14457 - * config/m68hc11/m68hc11.c (splitable_operand): New predicate. - * config/m68hc11/m68hc11-protos.h (splitable_operand): Declare. - * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register it. - (inhibit_libc): Must define. - * config/m68hc11/m68hc11.md ("movhi_const0"): Use splitable_operand. - ("*andhi3_gen", "iorhi3", "*iorhi3_gen"): Likewise. - ("xorhi3"): Likewise. - -2004-06-05 David S. Miller - - * config/sparc/linux.h (TARGET_C99_FUNCTIONS): Set. - * config/sparc/linux64.h (TARGET_C99_FUNCTIONS): Likewise. - -2004-06-04 Eric Christopher - - Backport from mainline: - 2004-06-02 Eric Christopher - - * c-typeck.c (common_type): Don't lose type qualifiers - when creating new variants. - -2004-06-03 Bernardo Innocenti - - PR target/15782 - Backport from mainline: - - 2004-06-01 Peter Barada - Peter Jakubek - - * config/m68k/m68k.c(m68k_output_mi_thunk): For ColdFire, use %d0 as - a scratch to perform an add to memory. - -2004-06-01 Paul Eggert - - PR target/15626 - * doc/install.texi (sparc-sun-solaris2*): Document messages issued - by the Sun linker in conjunction with the Sun assembler. - (sparc-sun-solaris2.7): Update revision info for Sun patch 106950. - -2004-06-01 Nicola Pero - - PR objc/7993 - * objc-act.c (is_private): Do not emit the 'instance variable %s - is declared private' error. - (is_public): Emit the error after calling is_private. - (lookup_objc_ivar): If the instance variable is private, return 0 - - the instance variable is invisible here. - -2004-06-01 Eric Botcazou - - * doc/invoke.texi (-static-libgcc): Explicitly mention - non-GNU linkers. - -2004-05-31 Kaz Kojima - - PR target/13250 - Backport from mainline: - - 2004-05-28 Kaz Kojima - * config/sh/sh.md (rotlsi3): Use emit_move_insn. - -2004-05-31 H.J. Lu - - PR middle-end/15666 - * cgraph.c (cgraph_remove_node): Don't call htab_clear_slot if - we can't find the slot. Abort if we can't find slot and the - node isn't for a builtin function. - -2004-05-31 Roger Sayle - - PR middle-end/15069 - * fold-const.c (fold_single_bit_test): Only perform "(X & C) != 0" - into "X < 0" (where C is the signbit) if X's type is a full mode. - -2004-05-31 Joseph S. Myers - - PR c/15749 - * c-decl.c (grokdeclarator, finish_struct): Don't pedwarn for - misuses of structures with flexible array members if - in_system_header. - -2004-05-31 Eric Botcazou - - PR target/15693 - * config/sparc/sparc.c (compare_operand): New predicate. - * config/sparc/sparc.h (PREDICATE_CODES): Add it. - * config/sparc/sparc.md (cmpsi expander): Use it. If the first - operand is a ZERO_EXTRACT and the second operand is not zero, - force the former to a register. - (cmpdi expander): Likewise. - -2004-05-31 Danny Smith - - * c-incpath.c (add_path): Canonicalize paths to use '/' if - HAVE_DOS_BASED_FILESYSTEM. - -2004-05-28 John David Anglin - - PR bootstrap/14671 - * alias.c (init_alias_analysis): Allocate alias_invariant array with - ggc_calloc instead of xrealloc. - (end_alias_analysis): Don't free alias_invariant. - -2004-05-28 DJ Delorie - - * stor-layout.c (place_field): Revert erroneous commit. - -2004-05-28 Nick Clifton - - Bug 14093 - * config/sh/sh-protos.h (sh_promote_prototypes): Declare. - * config/sh/sh.c (sh_promote_prototypes): Remove declaration. - Delete static from definition. - * config/sh/sh.h (FUNCTION_VALUE): Add sh_promote_prototypes call. - -2004-05-27 Kaz Kojima - - Backport from mainline: - - * config/sh/t-linux (SHLIB_MAPFILES): Use sh specific - libgcc-std.ver. - * config/sh/libgcc-std.ver: New file. - -2004-05-27 Olivier Hainque - - * expr.c (store_constructor): Restore sanity check on - the size of the type before clearing. - -2004-05-27 Alan Modra - - PR target/14478 - * config/rs6000/rs6000.c (reg_or_neg_short_operand): Don't allow zero. - -2004-05-26 Aldy Hernandez - - PR/14924 - * config/rs6000/rs6000.c (spe_expand_stv_builtin): New. - -2004-05-23 Joseph S. Myers - - * doc/gcc.texi, doc/gccint.texi, doc/include/gcc-common.texi: - Update based on printed manual. Enable setting of offsets for - FSFPRINT and move it to gcc-common.texi. - * doc/gcc.texi: Update FSF printing details. - * doc/gccint.texi: Remove FSF printing details. - -2004-05-21 Jakub Jelinek - - * config/sparc/linux64.h (OPTION_DEFAULT_SPECS): If SPARC_BI_ARCH, - override sparc.h definition. - -2004-05-20 Jakub Jelinek - - * config/sparc/linux64.h (TARGET_DEFAULT): Make 64-bit by default - also for TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3. - -2004-05-18 John David Anglin - - PR target/15202 - * pa.md (movdi, movsi, movhi, movqi): Support move from shift amount - register to general register for DI, SI, HI and QI modes. Remove - move to shift amount register in DF mode. - -2004-05-18 Ulrich Weigand - - PR middle-end/15054 - * expr.c (expand_expr_real): Do not call preserve_temp_slots - on a TARGET_EXPR temp. - * function.c (assign_stack_temp_for_type): Set 'keep' flag for - TARGET_EXPR temp slots. - -2004-05-18 Kaz Kojima - - PR optimization/15100 - Backport from mainline: - - 2004-05-11 Kaz Kojima - * combine.c (distribute_notes): Don't create a dangling - REG_LIBCALL/REG_RETVAL note. - -2004-05-17 H.J. Lu - - Backport from mainline - - PR target/15301 - PR target/15302 - 2004-05-17 Jan Hubicka - - * i386.c (construct_container): Do not produce BLKmode registers. - (classify_argument): Properly compute alignment of complex types. - -2004-05-15 Joseph S. Myers - - * doc/extend.texi: Update WG14 URL. - -2004-05-11 Aldy Hernandez - - * config/rs6000/spe.md (spe_evneg): Rename to negv2si2. - - * config/rs6000/rs6000.c (bdesc_1arg): Change spe_evneg to - negv2si2. - -2004-05-10 Kaz Kojima - - PR target/15130 - Backport from mainline: - - * config/sh/sh-protos.h (sh_expand_epilogue): Change prototype. - * config/sh/sh.c (output_stack_adjust): Take the sibcall epilogue - into account. Compute the correct number of general registers - for the return value. Generate a special push/pop sequence when - failing to get a temporary register for non SHmedia epilogue. - (sh_expand_epilogue): Add an argument to show whether it's for - sibcall or not. Set the 3rd argument of output_stack_adjust to - -1 if needed. - (sh_need_epilogue): Call sh_expand_epilogue with 0. - * config/sh/sh.md (sibcall_epilogue): Call sh_expand_epilogue - with 1. - (epilogue): Call sh_expand_epilogue with 0. - -2004-05-09 Aldy Hernandez - - * config/rs6000/spe.md ("tstsflt_gpr"): Fix typo in unspec. - -2004-05-08 Eric Botcazou - - * doc/install.texi (sparc-sun-solaris2*): Document bootstrap - problems with earlier versions of the GNU compiler. - -2004-05-07 Eric Botcazou - - PR c++/14962 - * c-pragma.c (handle_pragma_redefine_extname): Only change - the assembler name of FUNCTION_DECLs and VAR_DECLs. - -2004-05-07 Loren James Rittle - - * config/alpha/freebsd.h (SUBTARGET_EXTRA_SPECS): Proper redefinition. - * config/arm/freebsd.h: Likewise. - * config/ia64/freebsd.h: Likewise. - * config/sparc/freebsd.h: Likewise. - -2004-05-06 Richard Henderson - - * stmt.c (parse_output_constraint): Don't warn for read-write - memory operand. - -2004-05-06 Jan Hubicka - - PR c/15004 - * function.c (do_warn_unused_parameter): Break out form ... - (expand_function_end): ... here; warn only when not using cgraphunit. - * function.h (do_warn_unused_parameter): Declare. - * cgraphunit.c: Include function.h. - (cgraph_finalize_function): Do unused parameter warning. - * Makefile.in (cgraphunit.o): Depend on function.h - -2004-05-05 H.J. Lu - - PR target/15290 - * config/i386/i386.c (ix86_split_to_parts): Use real_to_target - instead of REAL_VALUE_TO_TARGET_LONG_DOUBLE. - -2004-05-03 Rainer Orth - - * fixinc/inclhack.def (svr4_profil): Don't apply on IRIX 5/6. - * fixinc/fixincl.x: Regenerate. - -2004-05-02 Josef Zlomek - - * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Print the debug - message before redirecting the edge. - -2004-05-02 Eric Botcazou - - PR optimization/15112 - * reload1.c (reload): Don't record unchanging memory locations. - -2004-04-30 Rainer Orth - - PR other/1963 - * config/alpha/osf.h (SWITCHES_NEED_SPACES): Define. - -2004-04-30 David Edelsohn - - Backport from mainline: - - 2004-04-19 David Edelsohn - - * doc/install.texi (*-ibm-aix*): Add AIX 5.1 assembler and archiver - fix information. - - 2004-04-17 Alan Modra - - PR target/14715 - * config/rs6000/rs6000.c (rs6000_stack_info): Make parm_size agree - with STARTING_FRAME_OFFSET. - - 2004-04-07 David Edelsohn - - * config/rs6000/rs6000.c (processor_target_table): Add MASK_MFCRF - to power4 and power5 entries. - - 2004-04-05 David Edelsohn - - * config/rs6000/rs6000.c (VTABLE_NAME_P): Add _ZTI to special - symbol handling. - - 2004-03-30 Hartmut Penner - - PR 11591 - * config/rs6000/rs6000.c (rs6000_legitimate_address): - Allow any offset to argument pointer in no-strict case. - - 2004-03-25 David Edelsohn - - * config/rs6000/rs6000.c (rs6000_always_hint): New variable. - (rs6000_sched_groups): New variable. - (processor_target_table): Add power5. - (rs6000_override_options): Set rs6000_sched_insert_nops, - rs6000_sched_costly_dep and rs6000_sched_restricted_insns_priority - from rs6000_sched_groups. - (output_cbranch): Use rs6000_always_hint. - (rs6000_variable_issue): Use rs6000_sched_groups. - (rs6000_adjust_cost): Add CPU_POWER5. - (is_microcoded_insn): Use rs6000_sched_groups. - (is_dispatch_slot_restricted): Use rs6000_sched_groups. - Return 2 for POWER5 cracked instructions. - (is_cracked_insn): Use rs6000_sched_groups. - (is_branch_slot_insn): Use rs6000_sched_groups. - (rs6000_issue_rate): Add CPU_POWER5. - (rs6000_sched_finish): Use rs6000_sched_groups. - (rs6000_rtx_costs): Add PROCESSOR_POWER5. - * config/rs6000/rs6000.h (processor_type): Add PROCESSOR_POWER5. - (DEFAULT_SCHED_COSTLY_DEP): Delete. - (DEFAULT_RESTRICTED_INSNS_PRIORITY): Delete. - (DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME): Delete. - * config/rs6000/rs6000.md (define_attr "cpu"): Add power5. - * config/rs6000/power5.md: New file. - * doc/invoke.texi: Add power5 option. - - 2004-03-17 Fariborz Jahanian - - * config/rs6000/rs6000.c (rs6000_stack_info): correct reg_size - for mixed mode. - (rs6000_emit_prologue): Ditto. - (rs6000_emit_epilogue): Ditto. - * config/rs6000/rs6000.h: Definition of DWARF_CIE_DATA_ALIGNMENT - macro for mixed mode. - - 2004-03-04 David Edelsohn - GP - - * config/rs6000/rs6000.c (output_function_profiler): Append @plt - when compiling PIC. - -2004-04-30 Paolo Bonzini - - * config/altivec/altivec.h [__cplusplus] (vec_subsubs): Rename - to vec_sububs. - [__cplusplus] (vec_subsuhs): Rename to vec_subuhs, - eliminating duplicates. - -2004-04-29 Richard Sandiford - - PR target/15189 - * config/mips/mips.md (load_df_low): Use default length. - (load_df_high, store_df_high): Likewise. - -2004-04-29 Philip Blundell - - * Merge from trunk: - 2004-04-20 Paul Brook - - * config/arm/arm.c (arm_legitimate_address_p): Use rtx_equal_p. - -2004-04-29 Aldy Hernandez - - PR/12028 - * config/rs6000/rs6000.c (rs6000_emit_cmove): Disable comparisons - of floats on the E500. - (branch_positive_comparison_operator): Do not allow NE even on the - E500. - (ccr_bit): Remove E500 specific code. - Remove miscompilation warning for e500. - (print_operand): Add 'c' and 'D'. - (rs6000_generate_compare): Rewrite to generate correct rtl. - (rs6000_emit_sCOND): Handle E500. - (output_cbranch): Adjust for changes in rs6000_generate_compare. - (output_e500_flip_gt_bit): New. - (rs6000_override_options): Error when user wants altivec and e500 - instructions. - - * config/rs6000/rs6000.md (UNSPEC_MV_CR_GT): New constant. - (move_from_CR_gt_bit): New. - (cceq_ior_compare): Name previously unnamed pattern. Disable for - E500. - (cceq_rev_compare): Name previously unnamed pattern. Allow for - E500. - - * config/rs6000/spe.md (cmpsfeq_gpr): Rewrite as unspec. - (tstsfeq_gpr): Same. - (cmpsfgt_gpr): Same. - (tstsfgt_gpr): Same. - (cmpsflt_gpr): Same. - (tstsflt_gpr): Same. - (e500_cceq_ior_compare): New. - (e500_flip_gt_bit): New. - - * config/rs6000/rs6000-protos.h (output_e500_flip_gt_bit): - Protoize. - -2004-04-28 Ben Elliston - - * doc/invoke.texi (Objective-C Dialect Options): Don't prefix - options with "-" in the option index. - (SPARC Options): Likewise. - (M32R/D Options): Likewise. - -2004-04-28 Joseph S. Myers - - * Makefile.in ($(DESTDIR)$(infodir)/%.info): Don't condition - calling install-info on $(DESTDIR)$(infodir)/dir already being - present. - -2004-04-28 H.J. Lu - - PR target/15084 - * config/i386/i386.md (*movsi_insv_1_rex64): Changed to DImode - and renamed to movdi_insv_1_rex64. - (insv): Support SImode for 32bit and DImode for 64bit. - -2004-04-27 John David Anglin - - PR debug/14829 - * dwarf2out.c (reg_number): Rename to dbx_reg_number. Adjust all - callers. - (multiple_reg_loc_descriptor, reg_loc_descriptor): Use gcc register - number for indexing hard_regno_nregs array. - -2004-04-27 Bob Wilson - - * config/xtensa/xtensa.c (call_insn_operand): Check - SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_LOCAL_P. - * config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND): Likewise. - * config/xtensa/xtensa.md (call, call_value): Likewise. - -2004-04-26 Zack Weinberg - - * config/ia64/hpux.h: Predefine __STDCPP__ when compiling C++. - * config/pa/pa-hpux10.h: Likewise. - * config/pa/pa-hpux11.h: Likewise. - -2004-04-23 Eric Botcazou - - PR optimization/13985 - * cfgloopmanip.c (fix_loop_placements): New prototype. - Call fix_bb_placements on the preheader of loops that have - been reparented. - (remove_path): Adjust call to fix_loop_placements. - -2004-04-23 Nick Clifton - - * Import this patch from mainline: - 2004-04-16 Kazuhiro Inaoka - - * config/m32r/m32r.h (BIG_ENDIAN_BIT): Deleted to fix endian - bug. - (TARGET_LITTLE_ENDIAN, TARGET_BIG_ENDIAN, - TARGET_DEFAULT): Changed. Ditto. - (LITTLE_ENDIAN_BIT, TARGET_CPU_DEFAULT, - TARGET_ENDIAN_DEFAULT): Added. Ditto. - * config/m32r/little.h (TARGET_LITTLE_ENDIAN): Deleted. - (TARGET_ENDIAN_DEFAULT): Added. - -2004-04-22 Per Bothner - - * cppinit.c (cpp_read_main_file): Return NULL rather than false. - Fixes PR preprocessor/15067. - -2004-04-22 Ulrich Weigand - - * function.c (thread_prologue_and_epilogue): Move - NOTE_INSN_FUNCTION_END and NOTE_INSN_FUNCTION_BEG notes - before the epilogue. - -2004-04-22 Ulrich Weigand - - * dbxout.c (dbxout_symbol_location): Do not output references - to optimized-out constant pool symbols. - -2004-04-22 Ulrich Weigand - - * expr.c (store_constructor): Use gen_int_mode to correctly - sign-extend CONST_INT value. - -2004-04-22 Ulrich Weigand - - * combine.c (if_then_else_cond): Check for NULL return value of - simplify_gen_subreg. - -2004-04-22 Ulrich Weigand - - * reload1.c (emit_reload_insns): Set reg_has_output_reload to one - after setting reg_last_reload_reg for optional output reloads. - -2004-04-22 John David Anglin - - * pa64-regs.h (DBX_REGISTER_NUMBER): Simplify and correct mapping of - SAR register. Fix comment. - (ADDITIONAL_REGISTER_NAMES): Correct register number of SAR register - (%cr11). - -2004-04-21 Kaz Kojima - - Backport from mainline: - - 2004-04-05 Kaz Kojima - * config/sh/sh.c (prepare_move_operands): Use emit_call_insn - when the TLS address is generated by a function call. - * config/sh/sh.md (tls_global_dynamic): Use a call expression. - (tls_local_dynamic): Likewise. - -2004-04-21 H.J. Lu - - PR target/14813 - Backport from mainline: - - * config/ia64/crtend.asm: Move pointer to __do_global_ctors_aux - in .init_array section to ... - * config/ia64/crtbegin.asm: Here. - - * config/ia64/crtend.asm: Mark __do_global_ctors_aux global - and hidden if HAVE_INITFINI_ARRAY is defined. - -2004-04-21 Richard Henderson - - PR bootstrap/14671 - * alias.c (alias_invariant, alias_invariant_size): Mark GTY. - (reg_known_value, reg_known_value_size): Likewise; make static. - (reg_known_equiv_p): Make static. - (clear_reg_alias_info): Update for new indexing. - (get_reg_known_value, set_reg_known_value): New. - (get_reg_known_equiv_p, set_reg_known_equiv_p): New. - (canon_rtx): Use them. - (init_alias_analysis): Likewise. Allocate reg_known_value with gc. - Don't play queer offsetting games with reg_known_value and - reg_known_equiv_p. - (end_alias_analysis): Don't free reg_known_value. - * rtl.h (get_reg_known_value, get_reg_known_equiv_p): Declare. - * sched-deps.c (reg_known_equiv_p, reg_known_value): Remove. - (deps_may_trap_p, sched_analyze_1, sched_analyze_2): Use the new - functions instead. - -2004-04-21 John David Anglin - - * pa64-hpux.h (LIB_SPEC): Fix library specification used with GNU ld. - -2004-04-21 Rainer Orth - - * doc/install.texi (Specific, mips-sgi-irix5): Fix IRIX 5.3 IDO - download URL. - -2004-04-21 H.J. Lu - - PR target/14857 - Backport from mainline: - - * config/ia64/ia64.c (ia64_encode_section_info): Don't prod - global register variables. - -2004-04-21 H.J. Lu - - * PR target/14723 - Backport from mainline: - 2004-02-14 Jan Hubicka - - * config.gcc: Add support for nocona/prescott/pentium-m/pentium3m - /pentium4m. - * i386.c (override_options): Add support for new CPUs. - * i386.h (TARGET_CPU_DEFAULT_NAMES): New names. - (TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_pentium4e): New - constants. - * invoke.texi: Extend documentation of -mtune/-march for new CPUs. - -2004-04-20 Mark Mitchell - - * version.c (version_string): Mark as prerelease. - * doc/include/gcc-common.texi: Bump version number. - -2004-04-18 Release Manager - - * GCC 3.4.0 released. - -2004-04-18 Alan Modra - - PR bootstrap/14992 - * configure.ac: Define HAVE_LD_AS_NEEDED only for linux. - * configure: Regenerate. - * gcc.c (init_gcc_specs): Revert earlier change. - -2004-04-18 Mark Mitchell - - PR other/14918 - * doc/invoke.texi (-fprofile-generate): Document requirement to - use -fprofile-generate when linking. - - PR bootstrap/14992 - * gcc.c (init_gcc_specs): Only honor HAVE_LD_AS_NEEDED on - GNU/Linux. - - * doc/extend.texi (Strong Using): Warn users against using this - feature. - -2004-04-17 Richard Sandiford - - * configure.ac (gcc_cv_ld_as_needed): Use AC_CACHE_CHECK. - * configure: Regenerate. - -2004-04-17 Rainer Orth - - * config.gcc (i[34567]86-*-solaris2*): Default to DWARF-2 - debugging on Solaris 7 and up. - -2004-04-16 Rainer Orth - - * doc/install.texi (Specific, mips-sgi-irix5): Reflect working - IRIX 5 port. - Remove -save-temps workaround, handled automatically. - Require GNU binutils 2.15 for debugging. - Remove SGI make warnings since GNU make is now required. - (Specific, mips-sgi-irix6): Some markup fixes. - Describe MIPSpro C problems and workarounds. - Mention working O32 ABI support. - Recommend GNU as 2.15 for O32 with debugging. - Remove description of fixed structure pass/return bug. - -2004-04-16 Rainer Orth - - * aclocal.m4 (gcc_AC_PROG_GNAT): Check if ${CC} produces object - file for Ada compilation. - Fix gcc_cv_cc_supports_ada spelling. - * configure: Regenerate. - -2004-04-14 Zack Weinberg - - PR 14936 - Backport from mainline: - 2004-03-12 Matt Austern - - * varasm.c (make_decl_one_only): Don't use DECL_COMMON if - we're compiling for a SUPPORTS_ONE_ONLY target. - -2004-04-09 Zack Weinberg - - * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Look only at - mode argument. - * config/ia64/ia64.c (ia64_hpux_file_end): Check - TREE_SYMBOL_REFERENCED on DECL_ASSEMBLER_NAME, not DECL_NAME. - -2004-04-08 Mark Mitchell - - * doc/invoke.texi (Precompiled Headers): Warn about known - problems. - -2004-04-08 Joel Sherrill - - PR ada/14538 - * ada/5rosinte.adb: Remove fake mprotect() body. - * ada/5rosinte.ads: Add SA_SIGINFO. Make pthread_key_t a type - which can be set since Finalize_TCB in 7staprop.adb does not - go through the Set_Specific interface. - * ada/5rtpopsp.adb: Rewrite to use new interface. - * ada/init.c: Reorder so the simple single OS conditional __rtems__ - is tested before more complex ones which mix UNIX and embedded - systems in the conditional. - -2004-04-08 Joel Sherrill - - PR ada/14665 - * ada/osint.adb (Find_Program_Name): Rework to properly handle - filenames which end in .exe or have versioning suffixes like VMS. - -2004-04-08 Joseph S. Myers - - * fixinc/inclhack.def (rpc_xdr_lvalue_cast_a, - rpc_xdr_lvalue_cast_b): New fixes. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/rpc/xdr.h: Add new tests. - -2004-04-06 Mark Mitchell - - * config/darwin.h (LINK_COMMAND_SPEC): Change c++filt3 to c++filt. - -2004-04-05 John David Anglin - - * doc/install.texi: Update HP-UX 11 installation procedure. - -2004-04-05 Jakub Jelinek - John David Anglin - - PR optimization/13424 (hppa), bootstrap/14462, c/14828 - * pa.md: Use replace_equiv_address to retain the attributes of the - memory operands used in the split and peephole2 patterns for optimizing - the pre-reload movstrsi, movstrdi, clrstrsi and clrstrdi patterns. - -2004-04-05 Alexandre Oliva - - * cppinit.c (cpp_read_main_file): Return file name obtained by - read_original_filename. Missed in 2004-02-04's check in to 3.4 - branch by Per Bothner. - -2004-04-05 Eric Botcazou - - * config/sparc/sol2-bi.h (PREFERRED_DEBUGGING_TYPE): Set - to DWARF2_DEBUG unconditionally. - (ASM_DEBUG_SPEC): Set the default to --gdwarf2 unconditionally. - -2004-04-04 Mark Mitchell - - PR c++/14804 - * varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to - RECORD_TYPEs. - -2004-04-02 Jakub Jelinek - Eric Botcazou - - PR optimization/13424, optimization/12419 - * explow.c (maybe_set_unchanging): Revert 2003-04-07 patch. - Set RTX_UNCHANGING_P even for read-only DECL_EXTERNAL decls. - * expr.c (store_constructor): When clearing aggregate because - of an incomplete or mostly zero constructor, do the clearing - without /u flag and then emit a blockage. - -2004-04-01 Alan Modra - Jakub Jelinek - - * gcc.c (init_gcc_specs): If HAVE_LD_AS_NEEDED, link with - -lgcc --as-needed -lgcc_s --no-as-needed by default. - * configure.ac (HAVE_LD_AS_NEEDED): Check for ld --as-needed. - * configure: Rebuilt. - * config.in: Rebuilt. - * Makefile.in (stage1-start): Copy also libgcc_s*$(SHLIB_EXT). - (stage2-start, stage3-start, stage4-start): Likewise. - (stageprofile-start, stagefeedback-start): Likewise. - -2004-04-01 Jakub Jelinek - - * config/sparc/sparc.h (DITF_CONVERSION_LIBFUNCS): Define to 0. - * config/sparc/linux.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. - * config/sparc/linux64.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. - * config/sparc/sol2.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. - (SOLARIS_CONVERSION_LIBFUNCS): Rename to SUN_CONVERSION_LIBFUNCS. - * config/sparc/sparc.c (sparc_init_libfuncs): Initialize optabs - with _Q_qtoll, _Q_qtoull and _Q_lltoq if DITF_CONVERSION_LIBFUNCS. - * config.gcc (sparc-*-linux*): Revert 2004-03-23 change. - * config/sparc/t-linux64 (TARGET_LIBGCC2_CFLAGS): Likewise. - * config/sparc/t-linux: Removed. - -2004-04-01 Jakub Jelinek - - PR c++/14755 - * fold-const.c (fold) : Properly compute newconst in - "bitfld++ == const" to "++bitfld == const + incr" transformations. - -2004-03-30 Aldy Hernandez - - PR 14219 - * c-typeck.c (build_binary_op): Do not allow comparisons of - vectors. - -2004-03-26 Ian Lance Taylor - - PR target/14206 - * doc/install.texi (Specific): Document that exec-shield-randomize - interferes with precompiled headers. - -2004-03-26 Richard Henderson - - PR 11527 - * c-typeck.c (pop_init_level): Emit pending init elements earlier - rather than later. - -2004-03-25 Jakub Jelinek - - * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file. - * config/sparc/t-linux64 (TARGET_LIBGCC2_CFLAGS): Set. - * config/sparc/t-linux: New file. - -2004-03-25 Jan Hubicka - - PR debug/13974 - * cfgrtl.c (try_redirect_by_replacing_jump, - force_nonfallthru_and_redirect, commit_one_edge_insertion, - cfg_layout_merge_blocks): Do not attach any line number information - to newly inserted instructions. - * emit-rtl.c (emit_insn*_before, emit_insn*_after): Rename to - emit_insn_*_noloc. - (emit_*insn_before, emit_insn*_after): New. - (emit_*insn_before_setloc, emit_*insn_after_setloc): Do not overwrite - existing locators. - * rtl.h (emit_*insn_before_noloc, emit_*insn_after_noloc): Declare. - (emit_*insn_before_sameloc, emit_*insn_after_sameloc): Kill. - -2004-03-24 Steven Bosscher - - PR pch/14137 - * c-pch.c (struct c_pch_validity): New flags_info field. - (FLAG_UNIT_AT_A_TIME_SET): New definition. - (pch_init): Write out the flags_info field to the PCH. Set the - FLAG_UNIT_AT_A_TIME_SET bit of the field if flag_unit_at_a_time - is set. - (c_common_valid_pch): Make sure the flag settings used for compiling - the PCH are the same as those used in the current compilation. - -2004-03-24 Alexandre Oliva - - PR preprocessor/14438 - * cpplib.c (do_pragma): Remove line_change call after pragma - handler. - -2004-03-23 Ian Lance Taylor - - * doc/extend.texi (ARM Built-in Functions): Replace with correct - declarations. - -2004-03-23 Kazu Hirata - - PR optimization/14669 - * fold-const.c (fold): Only unwiden integer comparisons for equality - and inequality operators, or when the signedness doesn't change. - -2004-03-23 Jason Merrill - - PR c++/14587 - * config/i386/winnt.c (associated_type): Look for attributes on - the TYPE_MAIN_VARIANT of *this. - -2004-03-21 Mark Mitchell - - PR c/13129 - * c-decl.c (warn_if_shadowing): Don't warn about a new declaration - of a file-scope entity. - -2004-03-22 Jakub Jelinek - - PR c/14069 - * c-decl.c (finish_struct): Change type of incorrect flexible array - field into error_mark_node. - -2004-03-22 Ralf Corsepius - - PR target/14260 - * config/rtems.h: Add STD_LIB_SPEC and LIB_SPEC. - -2004-03-22 Eric Botcazou - - PR middle-end/14470 - * expr.c (mark_queue): New function. - (emit_insns_enqueued_after_mark): New function replacing - emit_queue. Clear the body of emitted queued insns. - (emit_queue): Call emit_insns_enqueued_after_mark. - (store_expr): Mark the increment queue on entry. Emit - only the incrementations queued when expanding the source. - -2004-03-22 Danny Smith - - * gcov-io.h: Update copyright year. - -2004-03-22 Danny Smith - - PR target/14291 - * gcov-io.h (gcov_truncate): Define ftruncate as _chsize for - __MINGW32__. - -2004-03-21 Roger Sayle - - PR target/13889 - * cse.c (fold_rtx): Avoid substituting constants into unary - conversion operations. - -2004-03-21 Joseph S. Myers - - * frontends.texi: Add missing line. - -2004-03-21 Zack Weinberg - Chris Devers - Joseph S. Myers - - * doc/frontends.texi: Rewrite. - * doc/gcc.texi: Update last modification date. - -2004-03-20 Ian Lance Taylor - - PR c/12373 - * c-typeck.c (tagged_types_tu_compatible_p): Don't use - DECL_ORIGINAL_TYPE if there isn't one. - -2004-03-20 Joseph S. Myers - - PR other/14630 - * doc/install.texi: Add info directory category and entry. - -2004-03-20 Joseph S. Myers - - PR c/14635 - * builtins.def (nan, nanf, nanl, nans, nansf, nansl): Change to - DEF_GCC_BUILTIN. - -2004-03-18 Mark Mitchell - - * c-common.c (pointer_int_sum): Do not complain about using - pointers to pointers-to-members. - - * c-decl.c (grokdeclarator): Do not complain about redeclaring - visible "static" identifiers "extern" in a local scope. - * dwarf2out.c (loc_descriptor_from_tree): Handle pre- and - post-increments/decrements. - -2004-03-17 Jakub Jelinek - - * config/rs6000/t-linux64 (bispecs): Don't add -mlong-double-128 for - 32-bit builds when defaulting to 32-bit. - -2004-03-17 Richard Sandiford - - PR target/14599 - * config/mips/mips.md (UNSPEC_GP): New constant. - * config/mips/mips.c (CONST_GP_P): Expect the CONST to contain - an UNSPEC instead of (reg $gp). - (mips16_gp_pseudo_reg): Change accordingly. - (print_operand): Print $gp directly when handling CONST_GP_P. - -2004-03-16 Mark Mitchell - - PR c++/14481 - * fold-const.c (fold): Set TREE_NO_UNUSED_WARNING on implicitly - generated COMPOUND_EXPRs. - -2004-03-16 Nathanael Nerode - - PR bootstrap/12974 - * Makefile.in: Pass $(INCLUDES) down to libgcc.mk explicitly. - -2004-03-16 Richard Henderson - - PR middle-end/14535 - * except.c (collect_one_action_chain): Create action record for - cleanup outer of exception spec. - -2004-03-16 Ralf Corsepius - - PR target/14577 - * config.gcc: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff. - -2004-03-15 Richard Henderson - - PR target/14547 - * target.h (struct gcc_target): Move calls substructure before - booleans. Add split_complex_arg. - * function.c (assign_parms, split_complex_args): Use it. - * calls.c (expand_call): Likewise. - (split_complex_values): Likewise. Check for splittable types - before allocating memory. - (split_complex_types): Likewise. - * system.h (SPLIT_COMPLEX_ARGS): Poison. - * expr.h (SPLIT_COMPLEX_ARGS): Remove. - * target-def.h (TARGET_SPLIT_COMPLEX_ARG): New. - * config/alpha/alpha.c (alpha_split_complex_arg): New. - (TARGET_SPLIT_COMPLEX_ARG): New. - * config/alpha/alpha.h (SPLIT_COMPLEX_ARGS): Remove. - * config/rs6000/rs6000.c (TARGET_SPLIT_COMPLEX_ARG): New. - (rs6000_override_options): Zap it for non-AIX. - (rs6000_function_value): Use targetm.calls.split_complex_arg. - * config/rs6000/rs6000.h (SPLIT_COMPLEX_ARGS): Remove. - * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): New. - * config/xtensa/xtensa.h (SPLIT_COMPLEX_ARGS): Remove. - * doc/tm.texi (TARGET_SPLIT_COMPLEX_ARG): Modify from old - SPLIT_COMPLEX_ARGS entry. - -2004-03-15 Eric Botcazou - - * config/sparc/sparc.h: Rework comments about the code model - in 64-bit environment and the mode 'Pmode'. - * doc/invoke.texi (SPARC options): Rework description of the - different code models supported in 64-bit environment. - -2004-03-14 Joseph S. Myers - - * doc/contrib.texi, doc/extend.texi, doc/gcov.texi, - doc/install.texi, doc/invoke.texi, doc/makefile.texi, - doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: Capitalize - "gcc", "g++" and "g77" or mark up with appropriate markup. Adjust - wording and grammar. - -2004-03-13 Eric Botcazou - - PR c/14114 - * c-decl.c (merge_decls): Do not copy the C_DECL_INVISIBLE flag - from the new decl to the old decl. - (pushdecl): Use lookup_name to search for a previous decl with the - same identifier. - -2004-03-13 Dara Hazeghi - - * doc/install.texi: Note status of -fnew-ra. - -2004-03-13 Eric Botcazou - - PR middle-end/14470 - * expr.c (store_expr): Call emit_queue before generating the move - from the temporary to the original target. Protect the temporary - from emit_queue. - -2004-03-13 Jakub Jelinek - - PR target/14533 - * config/s390/s390.c (legitimize_pic_address): Don't abort on UNSPEC - other than UNSPEC_GOTOFF. - -2004-03-13 Dean Ferreyra - - PR target/14047 - * config/avr/avr.c (avr_progmem_p): Add "attributes" parameter. - (avr_insert_attributes): Pass "attributes" to avr_progmem_p. - * config/avr/avr-protos.h (avr_progmem_p): Change prototype. - -2004-03-12 David Edelsohn - - * doc/install.texi (*-ibm-aix*): Document assembler and achiver - fixes required by libstdc++ and update installation instructions - for libstdc++.a. Document use of Bash to speed up configuration. - -2004-03-12 Eric Botcazou - - * doc/tm.texi (registers) : Add - entry for REGMODE_NATURAL_SIZE. - -2004-03-11 Richard Henderson - - PR target/14539 - * config/alpha/alpha.h (STACK_BOUNDARY): Set to 128. - -2004-03-12 Alan Modra - - * real.c (encode_ibm_extended): Do round low word. - -2004-03-11 Richard Henderson - - PR middle-end/14477 - * except.c (remove_unreachable_regions): Look thru CALL_PLACEHOLDER. - -2004-03-11 Richard Sandiford - - PR target/14496 - * config/mips/mips.h (UNITS_PER_FPVALUE): Fix value for - TARGET_SINGLE_FLOAT. - -2004-03-11 Kelley Cook - - PR other/14536 - * configure: Regenerated with autoconf 2.57. - * config.in: Regenerated with autoheader 2.57. - -2004-03-11 Alan Modra - - * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Don't - bump retaddr here. - -2004-03-11 Alan Modra - - * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Add darwin-ldouble.c. - (SHLIB_MAPFILES): Add libgcc-ppc64.ver. - (SHLIB_MKMAP_OPTS): Delete. - (TARGET_LIBGCC2_CFLAGS): Add -specs. - (bispecs): Add rule. - * config/rs6000/libgcc-ppc64.ver: New file. - * config/rs6000/ppc64-fp.c (__fixtfdi, __floatditf): New functions. - (__floatdidf, __floatdisf): Optimize multiply. - (__fixunstfdi): New function. - * config/rs6000/rs6000.c (rs6000_complex_function_value): Allow for - real and imag parts larger than one register. - (function_arg): Correct type of reg used when fp arg split partially - to stack. - * config/rs6000/darwin-ldouble.c: Protect with #if !_SOFT_FLOAT - and __MACH__ or __powerpc64__. - -2004-03-10 Richard Henderson - - PR c/14517 - * c-decl.c (grokdeclarator): Don't warn for duplicate qualifiers - except for pedantic c90 mode. - -2004-03-10 Andrew Haley - - PR optimization/14381 - * function.c (expand_function_end): Emit a blockage insn before - the epilogue when -fnon-call-exceptions is used. - -2004-03-10 Joel Sherrill - - PR target/14480 - * config.gcc (powerpc*-*-rtems*): Use rs6000/t-rtems. - -2004-03-10 Roman Zippel - - PR bootstrap/12371 - * config/m68k/m68k.h (FIXED_REGISTERS): Add arg pointer. - (CALL_USED_REGISTERS): Likewise. - (REG_CLASS_CONTENTS): Likewise. - (REG_ALLOC_ORDER): New. - (REGNO_REG_CLASS): Use regno_reg_class. - * config/m68k/m68k.c: Add regno_reg_class array. - -2004-03-10 Alan Modra - Hartmut Penner - - * config/rs6000/rs6000.c (invalid_gpr_mem): New function. - (base_reg_operand): New function. - (legitimate_offset_address_p): Don't test modes in an attempt to - distinguish gpr vs fpr mem loads/stores. Don't prohibit offsets - invalid for 64-bit gpr loads/stores here. - (secondary_reload_class): Add "inp" parameter. Generate a reload - for 64-bit gpr loads/stores. - * config/rs6000/rs6000.h (SECONDARY_RELOAD_CLASS): Delete. - (SECONDARY_INPUT_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS): Define. - (PREDICATE_CODES): Add invalid_gpr_mem and base_reg_operand. - (DISPARAGE_RELOAD_CLASS): Define. - * config/rs6000/rs6000-protos.h (secondary_reload_class): Update. - * config/rs6000/rs6000.md (movdf_hardfloat64): Correct attrs. - Add m->b alternative and split. - (movdi_internal64): Replace r->m and m->r with r->Y and Y->r. - Add m->b alternative and split. - * reload.c (find_reloads): Invoke DISPARAGE_RELOAD_CLASS. - -2004-03-10 Hans-Peter Nilsson - - PR other/14474 - * doc/md.texi (Pattern Ordering, Dependent Patterns) - (Jump Patterns, Looping Patterns): Wrap in separate "@ifset - INTERNALS". - -2004-03-09 Zack Weinberg - - * config/ia64/hpux.h (MULTILIB_DEFAULTS): Define. - (LIBGCC_SPEC): Update to match. - -2004-03-09 Ralf Corsepius - - * config/h8300/t-rtems (h8300-*-rtems*): New. - * config.gcc: Use config/h8300/t-rtems. - -2004-03-09 Roger Sayle - - PR middle-end/14289 - * c-typeck.c (c_mark_addressable): A register variable should - be considered global if its not automatic, i.e. TREE_PUBLIC, - TREE_STATIC or DECL_EXTERNAL. - * function.c (put_var_into_stack): Call abort when placing a - hard register into the stack, if x_parm_reg_stack_loc is NULL. - -2004-03-08 David Edelsohn - - * collect2.c (main): Only export initfunc and finifunc if - LD_INIT_SWITCH not defined. - (scan_prog_file): Only export constructors and destructors if - LD_INIT_SWITCH not defined. Only export symbols not found in - shared objects. - -2004-03-09 Alan Modra - - * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. - * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. - (emit_library_call_value_1): Likewise pass nargs. - * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. - * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. - * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args - parameter instead of scanning TYPE_ARGS_TYPES to count args. - * config/rs6000/rs6000-protos.h (init_cumulative_args): Update - prototype. - * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. - (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. - (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. - * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to - INIT_CUMULATIVE_ARGS. - * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. - * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, - config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, - config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, - config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, - config/i370/i370.h, config/i386/i386.h, config/i860/i860.h, - config/i960/i960.h, config/ia64/ia64.h, config/ip2k/ip2k.h, - config/iq2000/iq2000.c, config/iq2000/iq2000.h, config/m32r/m32r.h, - config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/mcore/mcore.h, - config/mips/mips.h, config/mmix/mmix.h, config/mn10300/mn10300.h, - config/ns32k/ns32k.h, config/pa/pa.h, config/pdp11/pdp11.h, - config/s390/s390.h, config/sh/sh.h, config/sparc/sparc.h, - config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, - config/xtensa/xtensa.h: Likewise. - -2004-03-09 Alan Modra - - PR debug/11983 - * dwarf2out.c (enum dw_val_class): Rename dw_val_class_float to - dw_val_class_vec. Replace use throughout file. - (dw_float_const): Delete. - (dw_vec_const): New. - (dw_val_struct_union): Rename val_float to val_vec. Replace use - throughout file. - (add_AT_vec): Rename from add_AT_float. Add elt_size param. - (same_dw_val_p): Adjust vec comparison. Use memcmp. - (size_of_die): Adjust dw_val_class_vec sizing. - (output_die): Output dw_val_class_vec. - (insert_int, extract_int, insert_float): New functions. - (add_const_value_attribute): Use insert_float for CONST_DOUBLE. - Handle CONST_VECTOR. - (add_location_or_const_value_attribute): Handle CONST_VECTOR. - -2004-03-08 Joel Sherrill - - PR target/14480 - * config/rs6000/t-rtems: Add missing file on branch. - -2004-03-08 Roger Sayle - - * fold-const.c (fold) : Rewrite optimization to transform - "foo++ == const" into "++foo == const+incr". - -2004-03-08 Ulrich Weigand - - * config/s390/s390.md ("*extendqidi2_short_displ"): Add CC clobber. - ("*extendqisi2_short_displ"): Likewise. - -2004-03-08 Eric Botcazou - - * expr.c (highest_pow2_factor_for_type): Rename into - highest_pow2_factor_for_target. Use DECL_ALIGN instead of - TYPE_ALIGN when the target is a COMPONENT_REF. - (expand_assignment): Ajust call to highest_pow2_factor_for_type. - -2004-03-08 Alan Modra - - * config/rs6000/rs6000.c: Formatting fix. - (legitimate_offset_address_p): Correct offset range check. - - * config/rs6000/rs6000.c (rs6000_override_options): Don't override - -msoft-float by -mcpu. Consolidate similar code for MASK_MULTIPLE - and MASK_STRING. - -2004-03-07 Aldy Hernandez - - * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power - for little endian. - ("ashrdi3_no_power"): Disable for little endian. - (ashrdi3): Same. - -2004-03-07 Aldy Hernandez - - * config/rs6000/rs6000.c (rs6000_parse_abi_options): SPE and - AltiVec abi cannot co-exist. - - * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Same. - -2004-03-07 Hans-Peter Nilsson - - PR target/14471 - * configure.ac (Target-specific assembler checks) : New - case, checking for -no-mul-bug-abort option. - * configure, config.in: Regenerate. - * doc/invoke.texi (CRIS Options): Document -mmul-bug-workaround - and -mno-mul-bug-workaround. - * config/cris/cris.md ("smulsi3_highpart", "umulsi3_highpart") - ("mulsidi3", "umulsidi3"): Prefix output template with "%!". - ("umulhisi3", "umulqihi3", "mulsi3", "mulqihi3", "mulhisi3"): - Ditto. Make attribute "slottable" dependent on TARGET_MUL_BUG. - * config/cris/mulsi3.asm (__Mul) [__CRIS_arch_version >= 10]: Make - sure mulu.d is not last on cache-line. - * config/cris/cris.h (ASM_SPEC): Translate -mno-mul-bug-workaround - into -no-mul-bug-abort depending on HAVE_AS_MUL_BUG_ABORT_OPTION. - (TARGET_MASK_MUL_BUG, TARGET_MUL_BUG): New macros. - (TARGET_SWITCHES): New options -mmul-bug-workaround and - -mno-mul-bug-workaround. - (TARGET_DEFAULT): Include TARGET_MASK_MUL_BUG. - (PRINT_OPERAND_PUNCT_VALID_P): Include '!'. - * config/cris/cris.c (cris_operand_extend_operator): Clarify - relation to MULT in head comment. - (cris_op_str): Abort for MULT. - (cris_print_operand) : New case. - -2004-03-07 Stephane Carrez - - * config/m68hc11/m68hc11.md ("*lshrsi3_const"): Disable for 68HC12. - ("*lshrsi3"): Also accept an immediate for 68HC12. - ("*ashrsi3_const"): Likewise. - ("*ashrsi3"): Likewise. - ("*ashlsi3_const"): Likewise. - ("*ashlsi3"): Likewise. - ("cmphi_1_hc12"): Compare two hard register by pushing them and - comparing with a pop; don't use a split for that. - ("cmphi split"): Disable compare split for 68HC12. - - * config/m68hc11/m68hc11.c (m68hc11_notice_update_cc): Invalidate - the status operands if they have side effects. - -2004-03-07 Richard Sandiford - - * config/mips/mips.c (mips_in_small_data_p): Return false if - TARGET_ABICALLS. - -2004-03-06 Stephane Carrez - - * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Use 2,-sp to push - the stack register. - (expand_prologue): Don't make an interrupt or a trap handler a far - symbol. - (m68hc11_initial_elimination_offset): Likewise. - -2004-03-06 Richard Henderson - - * config/alpha/alpha.c (alpha_in_small_data_p): False for functions. - -2004-03-06 Richard Henderson - - * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. - (TARGET_LONG_DOUBLE_128): New. - (TARGET_SWITCHES): Add long-double-{128,64}. - (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. - (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. - (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. - (WIDEST_HARDWARE_FP_SIZE): New. - (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. - * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 - if TARGET_VAX_FLOAT. - * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. - (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. - -2004-03-06 Ulrich Weigand - - * config/s390/s390.md ("load_multiple", "*load_multiple_di", - "*load_multiple_si"): Allow only if reload_completed. - ("store_multiple", "*store_multiple_di", "*store_multiple_si"): - Likewise. - -2004-03-06 Eric Botcazou - - PR c/14465 - PR c/14114 - * c-decl (pushdecl): Revert previous change. - -2004-03-06 John David Anglin - - * pa.md (icacheflush): Reorder operands to make match_scratch operand - last. - * pa.h (INITIALIZE_TRAMPOLINE): Remove unnecessary scratch argument - from calls to gen_icacheflush. - -2004-03-06 Eric Botcazou - - PR target/14343 - * config/i386/i386.md (movv2di_internal): Conditionalize on - TARGET_SSE, not TARGET_SSE2. - -2004-03-06 Eric Botcazou - - PR c/14114 - * c-decl (pushdecl): Do not record a previous, not-in-scope, - external decl for restoration. - -2004-03-05 Waldek Hebisch - - PR middle-end/14203 - * function.c (uninitialized_vars_warning): Use DECL_RTL_SET_P - instead of testing whether DECL_RTL is not NULL. - -2004-03-05 Andreas Krebbel - - * rtl.h (mem_expr_equal_p): Function prototype added. - * cfgcleanup.c (merge_memattrs): New function. - (flow_find_cross_jump): Call merge_memattrs for matching insns. - * emit-rtl.c (mem_expr_equal_p): New function. - -2004-03-05 Bob Wilson - - * config/xtensa/xtensa.c (function_arg): Handle 16-byte aligned args. - (xtensa_va_start): Initialize __va_stk to ($arg_ptr - 32). Adjust - __va_ndx by 2 words when referencing an argument on the stack. - (xtensa_va_arg): Handle 16-byte aligned args. Adjust __va_ndx by 2 - words when an arg on the stack is first seen. - -2004-03-05 Nathan Sidwell - - PR driver/13577 - * gcc.c (cc1_options): Robustify -auxbase-strip from multiple -o - options. - -2004-03-04 Bob Wilson - - * config/xtensa/xtensa.c (xtensa_return_in_msb): New function. - (TARGET_RETURN_IN_MSB): Define to xtensa_return_in_msb. - -2004-03-04 Alan Modra - - * real.c (encode_ibm_extended): Don't bother rounding low double. - * c-cppbuiltin.c (builtin_define_float_constants): Tweak MAX - when fmt->pnan < fmt->p. - -2004-03-04 Alan Modra - - PR target/14406 - * config/rs6000/rs6000.md (abstf2, abstf2+1): Delete define_insn. - (abstf2, abstf2_internal): New define_expand. - -2004-03-04 Eric Botcazou - - PR optimization/14235 - * expr.c (convert_move): Copy the source to a new pseudo - when converting from a sub-word source to a larger-than-word - register which conflicts with the source. - -2004-03-03 Zack Weinberg - - PR 13728 - * c-decl.c (diagnose_mismatched_decls): Issue an error for two - parameters with the same name, unless one is a forward decl. - Do not issue a redundant-redeclaration warning for forward - decls of parameters. - -2004-03-03 Stephane Carrez - - * config/m68hc11/m68hc11.c (m68hc11_override_options): Disable -fweb - because it breaks the 32-bit shift patterns that rely on a match_dup. - (print_operand): Don't print a * before the base address. - -2003-03-03 Richard Henderson - - PR opt/13862 - * cselib.c (cselib_record_sets): Don't record multiple sets in - asm insns. - -2004-03-03 Nicolas Pitre - - * config/arm/ieee754-df.S (muldf3, divdf3): Fix denormalization of - small negative values. - -2004-03-02 Kazu Hirata - - * config/h8300/lib1funcs.asm (___fixunssfsi): Change the - threshold to 0x4f. - - Revert: - 2004-02-27 Kazu Hirata - * config/h8300/fixunssfsi.c (__fixunssfsi): Enable on H8/300 - as well. - * config/h8300/lib1funcs.asm (___fixunssfsi): Remove. - * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _fixunssfsi_asm. - -2004-03-02 Richard Henderson - - PR middle-end/11767 - * coverage.c (coverage_counter_ref): Set MEM_NOTRAP_P. - * optabs.c (prepare_cmp_insn): Force trapping memories to registers - before the compare, if flag_non_call_exceptions. - -2004-03-02 Richard Henderson - - PR middle-end/14327 - * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before - emitting the label, not after. - -2004-03-02 David O'Brien - - * config/freebsd-spec.h (FBSD_DYNAMIC_LINKER): Add. - * config/alpha/freebsd.h (SUBTARGET_EXTRA_SPECS): Define - %(fbsd_dynamic_linker), - (LINK_SPEC): Use %(fbsd_dynamic_linker), and sync style with - config/i386/freebsd.h - * config/arm/freebsd.h: Ditto. - * config/i386/freebsd.h: Ditto. - * config/i386/freebsd64.h: Ditto. - * config/ia64/freebsd.h: Ditto. - * config/rs6000/sysv4.h: Ditto. - * config/sparc/freebsd.h: Ditto. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.c (m68hc11_addr_mode): New variable. - (m68hc11_mov_addr_mode): Likewise. - (m68hc11_override_options): Initialize them based on target. - (register_indirect_p): Allow a MEM for indirect addressing modes and - use flags to control what is allowed. - (m68hc11_small_indexed_indirect_p): Use m68hc11_mov_addr_mode for - supported addressing modes. - (m68hc11_register_indirect_p): Use m68hc11_addr_mode. - (go_if_legitimate_address_internal): Likewise. - (m68hc11_indirect_p): Likewise and check the mode. - (print_operand): Allow a (MEM (MEM)) and generate indirect addressing. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.md (move peephole2): New peepholes to optimize - sequences of moves. - (add peepholes): New peepholes to optimize sequences adding small - constants. - (bset peepholes): New peepholes to transform an OR in a bset form - (bclr peepholes): Likewise for bclr form. - (cmp peepholes): New peepholes to avoid register copies when comparing. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.md ("*pushdi_internal"): New insn and split - to separate push from moves. - ("*pushdf_internal"): Likewise. - ("*pushsf_internal"): Likewise. - ("*pushsi_internal"): Likewise. - ("movdi_internal"): Use define_insn_and_split; non push operand. - ("movdf_internal"): Likewise. - ("movsf_internal"): Likewise. - ("movsi_internal"): Likewise. - ("*movhi_68hc12", "*addhi3_68hc12"): Fix and tune constraints - ("*addhi3", "*subhi3", "*andhi3_mem", "*iorhi3_mem"): Likewise. - ("*ashlsi3_const1", "*lshrsi3_const1"): Likewise. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.md ("tstqi_z_used"): Use define_insn_and_split. - ("cmphi_z_used", "cmpqi_z_used"): Likewise. - ("movstrictsi", "movstricthi", "movstrictqi"): Likewise. - ("anddi3", "andsi3", "iordi3", "iorsi3"): Likewise. - ("xordi3", "xorsi3", "*logicalsi3_zexthi"): Likewise. - ("*logicalsi3_zextqi", "*logicalhi3_zexthi_ashift8"): Likewise. - ("logicalhi3_zexthi", "*logicalsi3_silshr16"): Likewise. - ("*logicalsi3_silshl16", "*logicalsi3_silshl16_zext"): Likewise. - ("*ashldi3_const32", "*ashldi3_const1", "addsi_silshr16"): Likewise. - ("addsi_andshr16", "*ashlsi3_const16_zexthi"): Likewise. - ("*lshrdi3_const32", "*lshrdi_const1"): Likewise. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.md (SOFT_TMP_REGNUM): Define. - (SOFT_XY_REGNUM): Define. - (cmp split): Use the above instead of hard coded numbers. - (8-bit op split): No need to check the mode; allow Q_REG. - (ashift split): Adjust the first operand if it uses the SP and we - are pushing the shifted value. - (plus shift split): Fix when a source is in register D+X. - ("doloop_end"): Pass dummy arguments to gen_rtx_NE. - -2004-03-02 Stephane Carrez - - * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix when - comparing with Z register. - -2004-03-02 Loren James Rittle - - * gcc/doc/install.texi (*-*-freebsd*): Update target information. - -2004-03-01 Mark Mitchell - - PR bootstrap/14356 - * gcc.c (process_command): Remove const-qualification from argv. - (main): Likewise. - -2004-03-01 Mircea Namolaru - - * cfgloop.h (get_var_set_from_bct, is_bct_cond): Declaration of - new functions. - * cfgloopanal.c: Include loop.h. - (get_var_set_from_bct): New function. - (is_bct_cond): New function. - (blocks_single_set_registers): Handle branch and count jumps. - (count_loop_iterations): Likewise. - (simple_increment): Likewise - * doloop.c (doloop_condition_get): Export. - * loop-init.c (fixup_loop_exit_succesor): New function. - (loop_optimizer_finalize): Handle loops ending with branch and - count jumps. - * loop-unroll.c: Include toplev.h - (discard_increment): New function. - (expand_bct): New function. - (peel_loop_completely): Handle the removal of branch and count jumps. - (unroll_loop_constant_iterations): Likewise. - (unroll_loop_runtime_iterations): Likewise - * loop.h (doloop_condition_get): Declare. - -2004-02-29 Mark Mitchell - - PR debug/14328 - * dwarf2out.c (gen_enumeration_type_die): Output all enumeration - constants as signed values. - -2004-02-29 Mark Mitchell - - PR middle-end/13448 - * c-tree.h (readonly_warning): Rename to ... - (readonly_error): ... this. - * c-typeck.c (build_unary_op): Adjust accordingly. - (readonly_warning): Rename to ... - (readonly_error): ... this and issue errors, not warnings. - (build_modify_expr): Call readonly_error, not readonly_warning. - (c_expand_asm_operands): Likewise. - * tree-inline.c (optimize_inline_calls): Do not inline functions - after errors have occurred. - -2004-02-29 Kazu Hirata - - * doc/cppopts.texi: Fix a typo. - -2004-02-28 John David Anglin - - * pa64-hpux.h (LIB_SPEC): Fix linking under HP-UX 11.00 with -p and -pg. - -2004-02-27 Ian Lance Taylor - - PR optimization/7871 - * flow.c (mark_set_1): Don't add LOG_LINKS for global registers - from or to call insns. - -2004-02-27 Eric Botcazou - - PR optimization/7871 - * flow.c (propagate_one_insn): Interpret calls as setting global - registers, not merely clobbering them. - -2004-02-27 Kazu Hirata - - * config/h8300/fixunssfsi.c (__fixunssfsi): Enable on H8/300 - as well. - * config/h8300/lib1funcs.asm (___fixunssfsi): Remove. - * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _fixunssfsi_asm. - -2004-02-27 Daniel Jacobowitz - - * config/arm/arm.c (arm_legitimate_address_p): Don't check the mode - size for minipool references. - -2004-02-27 Eric Botcazou - Roger Sayle - - * fold-const.c (fold): Revert 2004-02-25 change. Use the original - operands to build a tree with swapped operands. - * expr.c (expand_expr_real) : Consistently use the - 'unsignedp' predicate to specify the signedness. - -2004-02-26 Aldy Hernandez - - * config/rs6000/rs6000.md: Add fixuns_truncsfsi2 and - fix_truncsfsi2. - - * config/rs6000/spe.md: Delete spe_efsctuiz. - Add spe_fixuns_truncsfsi2. - Add spe_fix_truncsfsi2. - -2004-02-26 Bob Wilson - - * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define __xtensa__. - -2004-02-25 James E Wilson - - * gcc-simple.c (rtl_zone, tree_zone, garbage_zone, ggc_alloc_typed, - ggc_alloc_zone): New. - (ggc_pch_count_object, gcc_pch_alloc_object, ggc_pch_write_object): - Add bool is_string parameter. - -2004-02-26 Alan Modra - - * gcse.c (delete_null_pointer_checks_1): Set stop_insn to end, not - beginning of block. Do not delete CC setter unless HAVE_cc0. - -2004-02-25 Kelley Cook - - * doc/contrib.texi: Add an entry for myself. - -2004-02-25 Kelley Cook - - * config.gcc: Add comment describing extra_gcc_objs. - i[34567]86-*-cygwin*): Replace host_extra_gcc_objs with extra_gcc_objs. - * configure.ac (extra_gcc_objs): New substitution variable. - (host_extra_gcc_objs): Don't substitute. - * configure: Regenerate. - * Makefile.in: Use extra_gcc_objs. - -2004-02-25 Eric Botcazou - - * fold-const.c (fold): Treat MAX_EXPR and MIN_EXPR like - comparisons with regard to signedness. - -2004-02-25 Jakub Jelinek - - * gcov-io.c (gcov_open) [GCOV_LOCKED]: Use open + fdopen instead of - fopen. - * libgcov.c: Include sys/stat.h. - * config/rs6000/linux.h (TARGET_HAS_F_SETLKW): Define. - * config/rs6000/linux64.h (TARGET_HAS_F_SETLKW): Define. - * config/sparc/linux.h (TARGET_HAS_F_SETLKW): Define. - * config/sparc/linux64.h (TARGET_HAS_F_SETLKW): Define. - -2004-02-25 Richard Earnshaw - - * arm.c (arm_legitimate_index_p): For QImode the range of an offset - is -4095...+4095 inclusive. - -2004-02-25 Eric Botcazou - - * doc/install.texi (sparc-sun-solaris2* specific notes): Document - the bootstrap failure with Sun CC 5.4 and 5.5. - -2004-02-24 Kazu Hirata - - * cse.c (cse_change_cc_mode_insns): Stop at any instruction - which modifies NEWREG. - (cse_condition_code_reg): Update the mode of CC_REG in - CC_SRC_INSN on our own. - -2004-02-24 Michael Matz - - * config/i386/i386.c (ix86_comp_type_attributes): Check for - regparm attributes. - -2004-02-24 Aldy Hernandez - - * config/rs6000/spe.md (spe_fix_truncsfsi2): Delete. - (spe_fixuns_truncsfsi2): Delete. - - * config/rs6000/rs6000.md (fix_truncsfsi2): Delete. - (fixuns_truncsfsi2): Delete. - -2004-02-24 Josef Zlomek - - PR/14240 - * rtlanal.c (replace_label): Fix replacing labels in constant pool. - -2004-02-24 Bob Wilson - - * config/xtensa/xtensa-protos.h (xtensa_copy_incoming_a7): Update. - (init_cumulative_args): Likewise. - (a7_overlap_mentioned_p): Delete prototype. - * config/xtensa/xtensa.c (struct machine_function): Replace - incoming_a7_copied field with need_a7_copy and vararg_a7 flags. - Add set_frame_ptr_insn field. - (xtensa_emit_move_sequence): Update call to xtensa_copy_incoming_a7. - (xtensa_copy_incoming_a7): Rewrite to check need_a7_copy flag and check - if the operand is an argument in a7. If so, copy a7 to a new pseudo - at the function entry and replace the operand with the pseudo. - (init_cumulative_args): Remove unused arguments. Add new "incoming" - argument and record this flag in CUMULATIVE_ARGS. - (function_arg): Remove result_mode and special-case code to handle - arguments in a7. Instead, set need_a7_copy flag when there is an - incoming argument in a7. - (xtensa_expand_prologue): Remove code to search for set_frame_ptr insn - and use the value recorded in cfun->machine->set_frame_ptr_insn. - (xtensa_builtin_saveregs): Check for negative gp_left value. Set - need_a7_copy and vararg_a7 flags. Use move_block_from_reg instead of - special-case code. - (a7_overlap_mentioned_p): Delete. - * config/xtensa/xtensa.h (CUMULATIVE_ARGS): Add "incoming" flag. - (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Remove useless - arguments to init_cumulative_args and pass "incoming" flag instead. - (BLOCK_REG_PADDING): Delete. - * config/xtensa/xtensa.md (movdi, movsf, movdf): Remove unnecessary - checks for reload_in_progress and reload_completed. Update calls to - xtensa_copy_incoming_a7. - (ashlsi3): Rename existing insn to ashlsi3_internal. Add expander - to call xtensa_copy_incoming_a7. - -2004-02-24 Richard Earnshaw - - * invoke.texi (ARM Options): Mark -mapcs-26 and -mno-alignment-traps - as deprecated. Remove already deprecated synonyms. - * arm.c (arm_override_options): Generate an inform message if the - user tries to invoke the compiler in apcs-26 mode. - * arm.h (TARGET_SWITCHES): Remove help comments from deprecated - switches. Delete deprecated synonyms for -malignment-traps. - (TARGET_DEFAULT): Default to alignment traps. - * arm/coff.h (TARGET_DEFAULT): Default to alignment traps. - * arm/elf.h arm/netbsd.h arm/pe.h arm/semi.h arm/semiaof.h: Likewise. - * arm/unknown-elf.h arm/wince-pe.h: Likewise. - -2004-02-23 H.J. Lu - - * config/i386/i386.h: Deprecate -mpni/-mno-pni. - -2004-02-23 Kelley Cook - - * config/i386/i386.c: Rename pni to sse3. - * config/i386/i386.h: Likewise. - * config/i386/i386.md: Likewise. - * config/i386/pmmintrin.h: Likewise. - * doc/extend.texi: Likewise. - * doc/invoke.texi: Likewise. - -2004-02-23 Andrew Pinski - - * config/rs6000/linux.h (OS_MISSING_POWERPC64): Define. - * config/rs6000/linux64.h (OS_MISSING_POWERPC64): Define. - -2004-02-23 Eric Botcazou - Falk Hueffner - - PR c/14188 - * builtins.c (expand_builtin_va_arg): Emit an informative message - if a trap is generated. - * c-typeck.c (build_function_call): Likewise. - -2004-02-22 Christopher Faylor - - * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): *Really* specify - extra host object file when targetting cygwin rather than generic - object files. - -2004-02-22 Matthias Klose - - Taken from mainline: - - 2004-02-12 Geoffrey Keating - - * Makefile.in (install-man): Use $(CPP_INSTALL_NAME) and - $(GCOV_INSTALL_NAME) to install manpages. Remove generic rule - for installing .1 manpages. Add rules for installing cpp - and gcov manpages under their installed names. - -2004-02-22 Hans-Peter Nilsson - - PR target/14209 - * config/cris/cris.md ("*andsi_movu", "*andhi_movu"): Tweak - constraints to not match postincrement. Adjust the predicate to - exclude a volatile memory reference. - ("*andsi_clear"): Tweak constraints to not match postincrement. - Adjust the predicate to exclude a volatile memory reference. - ("*andhi_clear"): Ditto. Rename from "*andhi_clear_signed". - ("*andhi_clear_unsigned"): Remove, non-matching pattern. - -2004-02-21 Christopher Faylor - - * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): Specify extra host - object file when targetting cygwin. - * config/i386/t-cygwin (EXTRA_GCC_OBJS): Remove definition since it is - overridden by top-level Makefile. - -2004-02-21 Alan Modra - - * combine.c (can_combine_p): Don't ignore SETs marked with - REG_EH_REGION notes. - -2004-02-21 Jan Hubicka - - * params.def (max-peeled-insns, max-completely-peeled-insns, - max-once-peeled-insns): Set to 400. - -2004-02-20 Falk Hueffner - - PR target/14201 - * config/alpha/alpha.md (*fix_truncsfsi_ieee): Fix typoed operand + * config/avr/avr.c (avr_arch_types): Rearranging array. + (enum avr_arch): Add. + (avr_mcu_types): Use avr_arch enumeration constants instead of numbers. + * config/avr/avr.h (LINK_SPEC): Simplify. -2004-02-20 Mohan Embar - Tom Tromey +2007-04-16 Jan Hubicka - * doc/install.texi: Moved --disable-libgcj and - --with-system-zlib documentation to new section for - Java-specific options. - Added explicit Cross-Compiler-Specific Options subheading. - Added section for Java-specific options. + PR target/27869 + * config/i386/sse.md + (sse_vmaddv4sf3, sse_vmmulv4sf3): Remove '%' modifier. + (sse_vmsmaxv4sf3_finite, sse_vmsminv4sf3_finite): Remove. + (sse2_vmaddv2df3, sse2_vmmulv2df3): Remove '%' modifier. + (sse2_vmsmaxv2df3_finite, sse2_vmsminv2df3_finite): Remove. -2004-02-20 James E Wilson +2007-04-16 H.J. Lu - * toplev.c (dump_file_index, dump_file): Put ce3 before rnreg. + * Backport from mainline: + 2007-04-16 H.J. Lu -2004-02-20 Josef Zlomek + PR target/31582 + * config/i386/i386.c (ix86_expand_vec_set_builtin): Make a + copy of source, pass it to ix86_expand_vector_set and return + it as target. - * tree-inline.c (copy_body_r): Do not replace ret_label. +2007-04-14 Andrew Pinski -2004-02-20 Kazu Hirata + PR c/31520 + * c-decl.c (finish_decl): Grab the type of the decl after the call + to store_init_value. - * gcc.c (process_command): Allow translation of the copyright - symbol but not the rest of the copyright message. - * gcov.c (print_version): Likewise. Allow translation of the - message about warranty. +2007-04-14 Jakub Jelinek -2004-02-19 Aldy Hernandez + PR c++/25874 + * omp-low.c (expand_omp_parallel): If child_cfun->cfg, free dominators, + post dominators and cleanup cfg before returning. - * config/rs6000/spe.md (spe_fixunssfsi2): Rename to - spe_fixuns_truncsfsi2. +2007-04-11 John David Anglin - * config/rs6000/rs6000.md (fixunssfsi2): Rename to - fixuns_truncsfsi2. + * pa.c (pa_som_asm_init_sections): Ensure that cfun->machine is not + null before emitting a .nsubspa directive. -2004-02-19 Richard Sandiford - Maciej W. Rozycki +2007-04-08 Anatoly Sokolov - * config/mips/mips.c (mips_address_insns): Treat BLKmode specially. - * config/mips/mips.md: Expand comment above unaligned loads and stores. + PR target/29932 + * config/avr/predicates.md (io_address_operand): Delete predicate. + (low_io_address_operand): Don't use 'mode' argument. + (higth_io_address_operand): Rename ... + (high_io_address_operand): ... to this. Don't use 'mode' argument. + * config/avr/avr.md (*sbix_branch_tmp, *sbix_branch_tmp_bit7): Adjust + for above change. -2004-02-20 Alan Modra +2007-04-07 Anatoly Sokolov - * function.c (assign_parms): Correct leakage of mainline code - in last commit. Also leakage from INIT_CUMULATIVE_ARGS patch. + PR target/30289 + * config/avr/avr.md (*clrmemqi, *clrmemhi): Mark operand 4 as + earlyclobber. -2004-02-19 Zack Weinberg +2007-04-05 Anatoly Sokolov - * config/ia64/ia64.c (ia64_function_arg): In big-endian mode, - when passing single SFmode quantities in general registers, - put them in the high half. - (struct extern_func_list, extern_func_head): Mark with GTY(()). - (ia64_hpux_add_extern_decl): Save the decl, not the name string. - Allocate memory with ggc_alloc. No need to copy anything. - (ia64_hpux_file_end): Update to match. + PR target/25448 + * config/avr/avr.c (avr_handle_fndecl_attribute): Use the + DECL_ASSEMBLER_NAME, not the DECL_NAME. -2004-02-19 David Daney +2007-04-04 Richard Henderson - PR preprocessor/14198 - * config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Add - builtin_assert ("machine=mips") + PR target/31361 + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Remove + v8hi_ftype_v8hi_v2di, v4si_ftype_v4si_v2di. Use like-types for + the variable shift builtins. + (ix86_expand_builtin): Properly expand the variable shift builtins. + * config/i386/sse.md (ashr3, lshr3, ashl3): Make + operand 2 be TImode. + * config/i386/emmintrin.h (_mm_slli_epi16, _mm_slli_epi32, + _mm_slli_epi64, _mm_srai_epi16, _mm_srai_epi32, _mm_srli_epi16, + _mm_srli_epi32, _mm_srli_epi64): Turn into macros. + (_mm_srli_si128, _mm_srli_si128): Fix disabled inline versions. + (_mm_sll_epi16, _mm_sll_epi32, _mm_sll_epi64, _mm_sra_epi16, + _mm_sra_epi32, _mm_srl_epi16, _mm_srl_epi32, _mm_srl_epi64): Use + two-vector shift builtins. -2004-02-19 Ulrich Weigand +2007-04-04 Chen liqin - * config/s390/s390.md ("*subdf3_cc", "*subdf3_cconly", "*subsf3_cc", - "*subsf3_cconly"): Subtraction is not commutative. - -2004-02-19 Alan Modra - - * function.c (assign_parms): When building decl_rtl for - SPLIT_COMPLEX_ARGS, ensure inner modes of concat match outer. - -2004-02-19 Olivier Hainque - - * expr.c (is_aligning_offset): Check if we are aligning the - expressions's address over BIGGEST_ALIGNMENT in bytes, not - in bits. - -2004-02-19 Jan Hubicka - - * genextract.c (main): Do not output the memset when not checking. - -2004-02-18 Jakub Jelinek - - * config/i386/i386.c (override_options): Don't imply 3DNow! for -m64 - by default. - -2004-02-18 Ulrich Weigand - - * config/s390/s390.md ("divmoddisi3"): Fix incorrect mode. - -2004-02-18 John David Anglin - - * pa.h (PIC_OFFSET_TABLE_REGNUM): Define to INVALID_REGNUM when not - generating PIC code. - -2004-02-18 Ulrich Weigand - - * config/s390/s390.c (s390_mainpool_start): Delete the main pool - placeholder insn when chunkifying the pool. - -2004-02-18 Per Bothner - - * cpphash.h (struct cpp_buffer): Restore return_at_eof field. This - partly reverts my 2003-10-01 change, because we're back to logically - including inside the main line. - * cpplex.c (_cpp_get_fresh_line): Check return_at_eof field. - * cppmacro.c (cpp_scan_nooutput): Set return_at_eof of current buffer. - Fixes PR preprocessor/14103. - -2004-02-18 Richard Earnshaw - - PR target/13866 - * arm.c (load_multiple_operation): Don't insist that the source reg - of a post-increment component is the same as the destination. - (store_multiple_operation): Likewise. - -2004-02-18 Paul Brook - - * rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX - -2004-02-18 Mark Mitchell - - PR c++/11326 - * config/ia64/ia64.c (ia64_struct_value_rtx): Cope with NULL - fntype. - -2004-02-18 Paul Brook - - PR debug/12934 - * dwarf2out.c (loc_descriptor_from_tree): Handle - EXPR_WITH_FILE_LOCATION. - -2004-02-17 Mark Mitchell - - PR c++/11326 - * c-common.c (flag_abi_version): Remove. - * c-common.h (flag_abi_version): Likewise. - * c-opts.c (c_common_handle_option): Remove OPT_fabi_version case. - * c.opt (fabi-version): Remove. - * calls.c (expand_call): Always pass a function type to - struct_value_rtx. Use convert_memory_address. - * common.opt (fabi-version): Add it. - * flags.h (flag_abi_version): Likewise. - (abi_version_at_least): New macro. - * opts.c (common_handle_option): Add OPT_fabi_version. - * toplev.c (flag_abi_version): Define it. - * config/ia64/ia64.h (STRUCT_VALUE_REGNUM): Remove. - * config/ia64/ia64.c (TARGET_STRUCT_VALUE_RTX): Define it. - (ia64_struct_retval_addr_is_first_parm_p): - New function. - (ia64_output_mi_thunk): Use it. - (ia64_struct_value_rtx): New function. - -2004-02-18 Alan Modra - - PR optimization/14119 - * combine.c (try_combine): When attemting to fix unrecognized insns, - don't delete SETs marked with REG_EH_REGION notes. - -2004-02-17 Jan Hubicka - - PR bootstrap/14180 - * cselib.c (remove_useless_values): Do not access released - memory. - -2004-02-17 Ulrich Weigand - - * combine.c (simplify_if_then_else): Do not replace - (if_then_else (ne reg 0) (0) (const_int)) by (reg) if the - modes differ. - -2004-02-17 Rainer Orth - - * config/mips/t-iris6gld: Renamed to ... - * config/mips/t-irix-gld: ... this. - * config.gcc (mips-sgi-irix6*): Reflect this - (mips-sgi-irix5*): Use it with GNU ld. - - * config/mips/irix6-crti.asm, config/mips/irix6-crtn.asm: Renamed - to ... - * config/mips/irix-crti.asm, config/mips/irix-crtn.asm: ... this. - * config/mips/t-irix-gld: Reflect this. - * config/mips/iris6gld.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. - - * config/mips/iris5gld.h: New file. - * config.gcc (mips-sgi-irix5*): Use it with GNU ld. - Only use collect2 without gas. - - * config/mips/iris6.h (IRIX6_STARTFILE_SPEC, IRIX6_ENDFILE_SPEC): - Renamed to IRIX_STARTFILE_SPEC, IRIX_ENDFILE_SPEC. - (STARTFILE_SPEC, ENDFILE_SPEC, SUBTARGET_EXTRA_SPECS): Reflect this. - * config/mips/iris6gld.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. - - * config/mips/iris6.h (SUBTARGET_EXTRA_SPECS): Moved ... - * config/mips/iris5.h: ... here. - - * config/mips/iris5.h (STARTFILE_SPEC, ENDFILE_SPEC): Renamed to - IRIX_STARTFILE_SPEC, IRIX_ENDFILE_SPEC. - (STARTFILE_SPEC, ENDFILE_SPEC): Define. - - * config/mips/iris5gas.h (STARTFILE_SPEC, ENDFILE_SPEC): Simplify - using irix_startfile_spec, irix_endfile_spec. - * patches.summary (http): - -2004-02-17 Andrew Pinski - - PR c++/14178 - * doc/invoke.texi (fabi-version): The default is 2 now. - -2004-02-17 Jonathan Wakely - - * doc/install.texi: Update description of --gxx-include-dir to - give correct default value. (merged from mainline) - -2004-02-16 Matthias Klose - - * config/t-slibgcc-elf-ver: Define SHLIB_NAME and SHLIB_SONAME - in terms of SHLIB_SOVERSION. - * config/m68k/t-slibgcc-elf-ver: New file. - * config/pa/t-slibgcc-elf-ver: New file. - * config.gcc (m68k-linux, parisc-linux): Use them when not - sjlj exceptions are not configured. - -2004-02-16 Eric Botcazou - - * config/sparc/sparc.c (get_pc_symbol_name): Mark with GTY(()). - -2004-02-16 Joseph S. Myers - - * doc/sourcebuild.texi: Mention backends.html. - -2004-02-15 Roger Sayle - - Backport from mainline: - - 2004-02-07 Roger Sayle - PR middle-end/13696 - * fold-const.c (fold_convert): New function to provide type - conversion to the middle-end without using convert. - (negate_expr, associate_trees, size_diffop, omit_one_operand, - operand_equal_for_comparison_p, pedantic_omit_one_operand, - invert_truthvalue, optimize_bit_field_compare, range_binop, - decode_field_reference, make_range, build_range_check, unextend, - fold_truthop, extract_muldiv_1, fold_mathfn_compare, - fold_binary_op_with_conditional_arg, fold_inf_compare, - fold_single_bit_test, fold, multiple_of_p): Replace all calls to - convert with calls to fold_convert. - - 2004-02-09 Roger Sayle - * fold-const.c (fold) : Use the original type conversion - tree code rather than call fold_convert, which doesn't specify a - default floating point to integer conversion. - - 2004-02-10 Paolo Bonzini - PR c/14092 - * fold-const.c (fold) : Convert result of - negate_expr back to the original type. - -2004-02-15 SUGIOKA Toshinobu - - Backport from mainline: - - 2004-02-05 SUGIOKA Toshinobu - * config/sh/t-linux (SHLIB_INSTALL): Prepend $$(DESTDIR) - to $$(slibdir) in the installation commands. - -2004-02-15 Roger Sayle - - Backport from mainline: - - 2004-01-20 Roger Sayle - * fold-const.c (fold_convert): Rename to fold_convert_const. - (fold_convert_const): Change arguments to take a tree_code, - a type and the operand/expression to be converted. Return - NULL_TREE if no simplification is possible. - (fold): Adjust call to fold_convert to match new fold_convert_const. - Avoid modifying the tree passed to fold in-place. - -2004-02-15 Jan Hubicka - - * cselib.c (value_pool): New. - (new_cselib_val): Use pool. - (cselib_init): Initialize value_pool - (cselib_finish): Free pool. - - * cselib.c: Include alloc-pool.h - (empty_vals, empty_elt_lists, empty_elt_loc_lists): Kill. - (elt_loc_list_pool, elt_list_pool, cselib_val_pool): Declare. - (new_elt_list, new_elt_loc_list, unchain_one_elt_list, - unchain_one_elt_loc_list_pool, unchain_one_value, - new_cselib_val): Simplify using allocpool. - (cselib_init): Initialize allocpools. - (cselib_finish): Finish allocpools. - -2004-02-14 Richard Sandiford - - Backport from mainline: - - 2002-04-08 Richard Sandiford - * real.c (encode_ibm_extended): Normalize the input value before - converting it to a double. Handle the case where a normal value - rounds to infinity. - -2004-02-14 Olivier Hainque - - * loop.c (check_dbra_loop): Use gen_int_mode instead of GEN_INT - for start_value when it is directly moved into reg, and factorize - the retrieval of GET_MODE (reg). - -2004-02-13 Rainer Orth - - * configure.ac: Search for as, ld below libexec/gcc. - * configure: Regenerate. - -2004-02-13 Jan Hubicka - - * combine.c (recog_for_combine): Avoid allocating unnecesary RTX. - - * genrecog.c (find_operand): add extra argument stop. - (validate_pattern): Verify that mach_dup is duplicating operand - defined lexically earlier. - -2004-02-13 Ian Lance Taylor - - PR other/10584 - * c-opts.c (c_common_post_options): Disable function inlining when - using -finstrument-functions. - * doc/invoke.texi (Code Gen Options): Document this restriction. - -2004-02-12 Chris Demetriou - - * config/mips/mips.md (casesi_internal, casesi_internal_di): - Use ".set macro" to avoid warnings about multi-instruction - macros, since they're intentional. - -2004-02-13 Jan Hubicka - - * alias.c (find_base_term, get_addr): Do not dereference NULL - pointer when all VALUE's locations has been invalidated. - (rtx_equal_for_memref_p): Simplify checking of VALUEs. - - * cselib.c (discard_useless_values): Clear out value pointer pointing - to datastructure to be recycled. - - * gcse.c (bypass_block): Prevent edges to be unified when we are - about to emit compenstation code. - - * gcse.c (bypass_block): Fix a typo in the previous check-in - to the file. - - * alloc-pool.c (align_four): Kill. - (create_alloc_pool): Align size to eight. - (free_alloc_pool, free_pool): Invalidate deallocated data. - -2004-02-12 Richard Sandiford - - PR bootstrap/13617 - * config/mips/mips-protos.h (mips_output_aligned_decl_common): Declare. - (mips_declare_object): Make variadic. - * config/mips/mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use - mips_output_aligned_decl_common. - * config/mips/mips.c (mips_output_aligned_decl_common): New function. - (mips_declare_object): Make variadic. - -2004-02-12 Jan Hubicka - - * tree-optimize.c (tree_rest_of_compilation): Do not release DECL_ARGUMENTS - -2004-02-12 Ian Lance Taylor - - PR inline-asm/6162 - * reload.c (find_reloads): Only support one pair of commutative - operands. - -2004-02-12 Ian Lance Taylor - - PR target/1532 - Backport from mainline: - - 2004-02-11 Richard Henderson - - * flow.c (insn_dead_p): A clobber of a dead hard register is a - dead insn after reload. - - 2004-01-24 Ian Lance Taylor - - * cse.c (cse_cc_succs): Change the mode of the source expression - as soon as decide we need a new mode. Don't permit changing modes - if we found a match in a successor block. - (cse_condition_code_reg): Save original mode of source expression - so that we know whether we have to change the mode in other - insns. - - 2004-01-24 Andreas Tobler - - * cse.c: (cse_cc_succs) Fix comparison warning. - - 2004-01-23 Ian Lance Taylor - - * cse.c (cse_change_cc_mode): New static function. - (cse_change_cc_mode_insns, cse_cc_succs): Likewise. - (cse_condition_code_reg): New function. - * rtl.h (cse_condition_code_reg): Declare. - * toplev.c (rest_of_handle_cse2): Call cse_condition_code_reg. - * target.h (struct gcc_target): Add fixed_condition_code_regs and - cc_modes_compatible. - * target-def.h (TARGET_FIXED_CONDITION_CODE_REGS): Define. - (TARGET_CC_MODES_COMPATIBLE): Define. - (TARGET_INITIALIZER): Add new initializers. - * targhooks.c (default_cc_modes_compatible): New function. - * targhooks.c (default_cc_modes_compatible): Declare. - * hooks.c (hook_bool_intp_intp_false): New function. - * hooks.h (hook_bool_intp_intp_false): Declare. - * config/i386/i386.c (TARGET_FIXED_CONDITION_CODE_REGS): Define. - (TARGET_CC_MODES_COMPATIBLE): Define. - (ix86_fixed_condition_code_regs): New static function. - (ix86_cc_modes_compatible): Likewise. - * doc/tm.texi (Condition Code): Document new hooks. - -2004-02-12 Hartmut Penner - - * config/rs6000/altivec.md (*movv4si_internal): At least one - operand must be register_operand. - (*movv8hi_internal1): Likewise. - (*movv16qi_internal1): Likewise. - (*movv4sf_internal1): Likewise. - -2004-02-12 Eric Botcazou - - PR target/14113 - Backport from mainline: - - 2004-02-03 Eric Botcazou - - * config/sparc/sparc.md (call followed by jump define_peephole's): - Delete. - -2004-02-12 Hartmut Penner - - * gcc/config/rs6000/rs6000.c (rs6000_override_options) - Set AltiVec ABI and vrsave as default for ppc64 linux. - (init_cumulative_args): Post error, if try to return - value in AltiVec register without enable AltiVec. - (function_arg_advance): Ditto for passing arguments. - -2004-02-11 Joseph S. Myers - - PR c/456 - * cppexp.c (num_binary_op): Don't allow comma operators in #if - constant expressions at all outside C99 mode if pedantic. - -2004-02-10 Aldy Hernandez - - * config/rs6000/spe.md ("*movv2si_internal"): Check for register - operand. - (movv4hi_internal): Same. - (movv2sf_internal): Same. - (movv1di_internal): Same. - -2004-02-11 Richard Sandiford - - * emit-rtl.c (mark_label_nuses): Check that a LABEL_REF refers to - a label before updating its usage count. - -2004-02-10 Danny Smith - - PR c/14088 - real.c (real_from_string): Look for 'X' as well as 'x' in - hexfloat strings. - -2004-02-10 Per Bothner - - * c-opts.c (c_common_post_options): Don't emit working directory - in cpp output if -P was specified. - -2004-02-10 Jakub Jelinek - - PR optimization/13424 - Backport from mainline: - - 2004-01-29 Jakub Jelinek - * emit-rtl.c (change_address): Use XEXP (memref, 0) instead - of addr when creating MEM copy. - - 2004-01-28 Jakub Jelinek - * expr.c (store_constructor): Revert 2003-12-03 change. - - * emit-rtl.c (change_address): Check also if MEM_ATTRS is set as - expected before returning early. Avoid sharing RTL if they - need to be changed. - - * config/i386/i386.c (ix86_expand_movstr): Rework rep_mov and strmov - handling so that memory attributes are preserved. Don't call - ix86_set_move_mem_attrs. - (ix86_set_move_mem_attrs_1, ix86_set_move_mem_attrs): Removed. - (ix86_expand_clrstr): Rename src argument to - dst. Rework rep_stos and strset handling so that memory attributes - are preserved. - (ix86_expand_strlen): Pass src argument to - ix86_expand_strlensi_unroll_1. Rework strlenqi_1 handling so that - memory attributes are preserved. - (ix86_expand_strlensi_unroll_1): Add src argument. Use - change_address instead of gen_rtx_MEM. - * config/i386/i386.md (strmov, strmov_singleop, rep_mov): New - expanders. - (strmovdi_rex64, strmovsi, strmovsi_rex64, strmovhi, strmovhi_rex64, - strmovqi, strmovqi_rex64): Remove. - (rep_mov*, strmov*): Prefix insn names with *. - (strset, strset_singleop, rep_stos): New expanders. - (strsetdi_rex64, strsetsi, strsetsi_rex64, strsethi, strsethi_rex64, - strsetqi, strsetqi_rex64): Remove. - (rep_stos*, strset*): Prefix insn names with *. - (rep_stosqi_rex64): Likewise. Fix mode of dirflag reg from DImode - to SImode. - (cmpstrsi): Rework cmpstrqi_1 handling so that memory attributes - are preserved. - (cmpstrqi_nz_1, cmpstrqi_nz_rex_1, cmpstrqi_1, cmpstrqi_rex_1): - Prefix insn names with *. - (cmpstrqi_nz_1, cmpstrqi_1): New expanders. - (strlenqi_1, strlenqi_rex_1): Prefix insn names with *. - (strlenqi_1): New expander. - * config/i386/i386.h (ix86_set_move_mem_attrs): Remove prototype. - - 2004-01-24 Jan Hubicka - * emit-rtl.c (change_address, adjust_address_1, offset_address, - widen_memory_access): Return early when there is nothing to change. - -2004-02-10 David Edelsohn - - * configure.ac (gcc_cv_as_powerpc_mfcrf): Correct test for mfcr. - * configure: Regenerate. - -2004-02-10 Ulrich Weigand - - * cfganal.c (flow_call_edges_add): Never split a libcall block. - -2004-02-10 Richard Sandiford - - * config/mips/mips.h (TARGET_GPWORD): Return false for TARGET_NEWABI - && TARGET_IRIX. - -2004-02-09 Geoffrey Keating - - PR 12028 - * config/rs6000/rs6000.c (ccr_bit): Don't let consistency check - failure stop compilation, just print helpful message. - -2004-02-09 Fariborz Jahanian - - * expr.c (emit_group_load): split constant - correctly into register components of PARALLEL insn. - -2004-02-09 DJ Delorie - - * config/i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): No - longer modify standard_exec_prefix, standard_bindir_prefix, or - standard_startfile_prefix. - -2004-02-09 James E Wilson - - PR c++/11295 - * c-common.c (c_expand_expr, case STMT_EXPR): Change expand_expr call - to expand_expr_real call, and pass in alt_rtl as last argument. - - PR libstdc++/5625 - * builtin-types.def (BT_WORD, BT_FN_WORD_PTR): New. - * builtins.c (expand_builtin): Handle BUILT_IN_EXTEND_POINTER. - * builtins.def (BUILT_IN_EXTEND_POINTER): New. - * except.c (expand_builtin_extend_pointer): New. - * except.h (expand_builtin_extend_pointer): Declare. - -2004-02-09 Rainer Orth - - * config/mips/iris5.h (BSS_SECTION_ASM_OP): Define. - * config/mips/iris6.h (BSS_SECTION_ASM_OP): Undef. - - * config/mips/iris6.h (TARGET_ASM_NAMED_SECTION): Moved ... - * config/mips/iris5.h: ... here. - * config/mips/iris5gas.h (TARGET_ASM_NAMED_SECTION): Remove. - - * config/mips/iris6.h (EXTRA_SECTION_FUNCTIONS): Move ... - * config/mips/iris5.h: ... here. - -2004-02-09 Rainer Orth - - * configure.ac: Remove default executable files before AC_PROG_CC. - * configure: Regenerate. - -2004-02-09 Kazu Hirata - - PR target/13721 - * config/h8300/h8300.c (byte_reg): Call abort() if asked to - print a operand other than a register. - -2004-02-09 Nick Clifton - - * Import these patches from mainline sources: - - 2004-01-21 Inaoka Kazuhiro - - * config/m32r/m32r.h (CPP_SPEC): Define. - - 2004-01-20 Kazuhiro Inaoka - - * config/m32r/m32r.h (TARGET_M32R2). Test for TARGET_M32R2_MASK - not TARGET_M32RX_MASK. - -2004-02-09 Eric Botcazou - - * cpplib.h (cpp_get_line_maps): Un-constify the structure - pointed to by the pointer returned by the function. - * cpplib.c (cpp_get_line_maps): Likewise. - -2004-02-08 Kazu Hirata - - * c-objc-common.c (c_cannot_inline_tree_fn): Fix a typo in a - warning. - -2004-02-08 Joseph S. Myers - - * README.Portability: Change "ISO C89" to "ISO C90". - * c-parse.in (primary, initelt): Likewise. - -2004-02-07 Zack Weinberg - - Bug 13856 - * c-decl.c (diagnose_mismatched_decls): Only give special - treatment when olddecl is DECL_BUILT_IN, if C_DECL_INVISIBLE - is also true. - (merge_decls): Don't clear DECL_BUILT_IN_CLASS and - DECL_FUNCTION_CODE when defining a built-in function. - Don't update DECL_ESTIMATED_INSNS. - * dwarf2out.c (dwarf2out_decl): Don't ignore built-in - FUNCTION_DECLs. - * tree.h: Delete DECL_ESTIMATED_INSNS. - * tree-inline.c (struct inline_data): Delete inlined_insns field. - (expand_call_inline, optimize_inline_calls): Don't update - DECL_ESTIMATED_INSNS nor inlined_insns. - * cgraphunit.c (cgraph_analyze_function): Don't update - DECL_ESTIMATED_INSNS. - -2004-02-07 Zack Weinberg - - * c-common.c (shadow_warning): Delete. - * c-common.h (free_parser_stacks, shadow_warning, sw_kind): Delete. - * c-decl.c (warn_if_shadowing): Issue shadow warnings directly. - * c-opts.c (c_common_parse_file): Don't call free_parser_stacks. - * c-parse.in (free_parser_stacks): Delete. - -2004-02-07 Kazu Hirata - - * c-opts.c, c-ppoutput.c, cppfiles.c, cpphash.h, cppinit.c, - cpplib.h, diagnostic.h, fix-header.c, config/fp-bit.c, - config/mips/iris5.h, doc/makefile.texi: Update copyright. - -2004-02-06 James E Wilson - - * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Only define for - glibc 2.3 or better. - -2004-02-06 Ulrich Weigand - - * loop.c (force_movables): Transitively increase the priorities of - all insns forces by an insn, not just the first one. - -2004-02-06 Falk Hueffner - - PR target/12898 - * config/alpha/alpha.c (alpha_emit_set_const_1): If - no_new_pseudos, use gen_rtx_SET directly for SImode constants - which need multiple instructions to emit. - -2004-02-06 H.J. Lu - - * doc/invoke.texi: Remove the pni option from -mfpmath=. - -2004-02-05 Kelley Cook - - * doc/install.texi: Update automake and autoconf version - requirements. Note where to find gcj automake version. - -2004-02-05 Kelley Cook - - * Makefile.in (generate-manpages): Move dependencies to ... - (man): here. - * doc/makefile.texi: Document new targets. - * doc/sourcebuild.texi (Make-lang.in): Document new langhooks. - -2004-02-05 Kelley Cook - - PR/13485 - Makefile.in (srcextra): Add a level of indirection to ... - (gcc.srcextra): ... here. - (po-generated): Delete. - (po/$(PACKAGE).pot: Use srcextra instead of po-generated. Depend on - options.c. - (start.encap): Remove superfluous lang.srcextra dependency. - objc/Make-lang.in (po-generated): Delete. - -2004-02-05 Rainer Orth - - * config/mips/iris5gas.h (PREFERRED_DEBUGGING_TYPE): Define. - -2004-02-05 Andreas Krebbel - - * config/s390/s390.md ("*tmqidi_ext"): New insn. - ("*extendqidi2_short_displ", "*extendsiqi2_short_displ"): Old - pre-reload splitters are transformed to post-reload - define_insn_and_split patterns. - ("*tmqisi_ext"): Renamed old "*tmqi_ext". - -2004-02-05 Rainer Orth - - PR middle-end/13750 - Revert: - 2004-01-15 Geoffrey Keating - PR pch/13361 - * c-typeck.c (constructor_asmspec): Delete. - (struct initializer_stack): Delete field 'asmspec'. - (start_init): Delete saving of asmspec. - (finish_init): Don't update constructor_asmspec. - * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. - * stmt.c (expand_asm): Duplicate strings from tree. - (expand_asm_operands): Likewise. - * tree.c (tree_size): Update computation of size of STRING_CST. - (make_node): Don't make STRING_CST nodes. - (build_string): Allocate string with tree node. - * tree.def (STRING_CST): Update comment. - * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. - (tree_string): Place contents of string in tree node. - * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string - from tree. - -2004-02-05 Joseph S. Myers - - * diagnostic.h (DEFINE_DIAGNOSTIC_KIND): Change parameter M to - msgid. - -2004-02-05 Paul Brook - - Backport from mainline. - - 2003-11-22 Phil Edwards - - PR target/12476 - * config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use - 'bx' instead of 'b' to avoid branch range restrictions. Output - the thunk immediately before the thunked-to function. - * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit - .thumb_func if a thunk is being generated. Emit .code 16 along - with .thumb_func if a thunk is not being generated. - - 2003-11-05 Mark Mitchell - - * calls.c (initialize_argument_information): Add CALL_FROM_THUNK_P - parameter. Use it instead of current_function_is_thunk. - * function.h (struct function): Update documentation for is_thunk. - * tree.h (CALL_FROM_THUNK_P): New macro. - * config/alpha/alpha.c (alpha_sa_mask): Do not check - no_new_pseudos when testing current_function_is_thunk. - * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likeiwse. - -2004-02-05 Joseph S. Myers - - * sourcebuild.texi (Test Idioms): Update testcase naming - conventions. - -2004-02-04 Per Bothner - - Partially revert/redo 2003-10-01 change; fix -fworking-directory. - * c-ppoutput.c (pp_dir_change): New function. - * c-common.h (pp_dir_change): New declaration. - * cpplib.h (struct cpp_options): Remove working_directory field. - * cppinit.c (cpp_find_main_file, cpp_push_main_file): Merge back to - (cpp_read_main_file): as before 10-01. Call _cpp_stack_file. - Don't handle -fworking_directory here, but in c_common_post_options. - (read_original_directory): Don't back up when done. - Don't clear no-longer used working_directory flag. - * cpplib.h: Update declarations to match. - * c-lex.c (cb_dir_change): Move to c-opts.c. - (init_c_lex): Don't set dir_change callback here, since we want - to set it even if flag_preprocess_only. - * c-opts.c (cb_dir_change): Function moved from c-lex.c. - (c_common_post_options): Set dir_change callback. - Call pp_dir_change if approporiate. - (finish_options): Don't call cpp_find_main_file here. Hence remove - unneeded parameter and result. Do LC_RENAME for . - (c_common_post_options): Call cpp_read_main_file here instead. - (c_common_init): Update accordingly. - (push_command_line_include): Don't cpp_push_main_file. - Do LC_RENAME rather than LC_LEASE to get back to main file. - Compared to pre-10-01 version, inline cpp_rename_to_main_file. - (c_common_parse_file): Call cpp_read_main_file for subsequent main - files, but call finish_options for all files. - * c-opts.c (sanitize_cpp_opts): Don't set cpp_opts->working_directory. - * fix-header.c (read_scan_file): Call cpp_read_main_file instead of - cpp_find_main_file + cpp_push_main_file. - * c-lex.c (fe_file_change): Don't set main_input_filename here. - * opts.c (handle_options): Only set main_input_filename first time. - -2004-02-04 Rainer Orth - - * Makefile.in: Move target, host overrides after per-language - fragments. - - * config/mips/t-iris5-as (FORCE_DEBUG_ADAFLAGS): Clear. - (GNATLIBCFLAGS): Remove -g. - -2004-02-04 Eric Botcazou - - * config/sparc/sparc.c (function_arg_pass_by_reference): Return 1 - for all modes whose size is greater than 8 bytes if ARCH32. - (sparc_va_arg): Handle all modes whose size is greater than 8 bytes - by reference if ARCH32. - -2004-02-04 Ulrich Weigand - - * config/s390/s390.md ("*la_64" + peepholes, "reload_indi"): Move - to before adddi3 insn patterns. - ("*la_31" + peepholes, "*la_31_and", "*la_31_and_cc", "force_la_31", - "reload_insi"): Move to before addsi3 insn patterns. - -2004-02-04 Kazu Hirata - - * doc/interface.texi, doc/tm.texi, doc/trouble.texi: Don't - mention deprecated target macros. - -2004-02-03 Wolfgang Bangerth - - * doc/invoke.texi (x86 options): Fix spelling/wording. - -2004-02-03 Richard Sandiford - - * config/mips/iris5.h (ASM_OUTPUT_ASCII): Use mips_output_ascii to - put the original string in a comment. - * config/mips/mips-protos.h (mips_output_ascii): Add prefix argument. - * config/mips/mips.c (mips_output_ascii): Likewise. - * config/mips/mips.h (ASM_OUTPUT_ASCII): Adjust accordingly. - -2004-02-03 Mark Mitchell - - PR c++/13975 - * tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and - TI_PRIVATE. - (access_public_node): Redefine. - (access_protected_node): Likewise. - (access_private_node): Likewise. - * tree.c (build_common_tree_nodes): Create access_public_node, - access_protected_node, and access_private_node. - -2004-02-03 Alan Modra - - PR target/13914 - * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Use ap - for retaddr_column. - -2004-02-03 Kelley Cook - - * opts.c (OPT_fwritable_strings): Deprecate -fwritable-strings. - -2004-02-03 Steven Bosscher - - * toplev.c: Fix broken checkin of 2003-12-30, again. - -2004-02-02 Eric Christopher - Zack Weinberg - - * c-opts.c (c_common_handle_option): Add -finput-charset. - * c.opt: Ditto. - * cppcharset.c (_cpp_convert_input): New function. - (_cpp_default_encoding): Ditto. - * cpphash.h: Add prototypes for above. - * cppfiles.c (read_file_guts): Use _cpp_convert_input. - * cppinit.c (cpp_create_reader): Use _cpp_default_encoding - for narrow execution and input character sets. - * doc/cppopts.texi: Document -finput-charset. - -2004-02-02 Eric Botcazou - - * doc/invoke.texi (SPARC options): Further improve. - -2004-02-02 Eric Botcazou - - * config/sparc/sparc.c (function_arg_slotno): Align TImode - arguments on a 16-byte boundary in the parameter array if ARCH64. - Split handling of TFmode. - -2004-02-02 Eric Botcazou - - * doc/invoke.texi (SPARC options): Document that -mflat is deprecated. - -2004-02-01 Eric Botcazou - - * config/sparc/sol2-bi.h: Handle TARGET_CPU_ultrasparc3. - (CPP_CPU_SPEC): Handle -mcpu=ultrasparc3. - (ASM_CPU_SPEC): Likewise - * config/sparc/sol2.h: Handle TARGET_CPU_ultrasparc3. - (ASM_CPU_SPEC): Remove -mcpu=v8plus. Handle -mcpu=ultrasparc3. - -2004-02-01 Jan Hubicka - - PR c++/12850 - * cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and - initial pointers. - * cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS - for functions that will be only inlined. - (cgraph_mark_function_to_output): Likewise. - (cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear; - do not clear function body. - * tree-optimize.c (clear_decl_rtl): Use decl_function_context. - (tree_rest_of_compilation): Reorganize the logic releasing function - body to use callgraph datastructure. - -2004-02-01 Richard Sandiford - - * config/mips/mips.md (adddi3_internal_2): Remove superfluous %s. - -2004-01-31 Eric Botcazou - - * doc/invoke.texi (SPARC options): Restructure and update. - -2004-01-31 Kazu Hirata - - * doc/invoke.texi: Follow spelling conventions. - * doc/tm.texi: Likewise. - -2004-01-31 Kazu Hirata - - * doc/install.texi: Fix typos. + * config/score/crti.asm: Change _bss_start to __bss_start. + * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Added. + (OUTGOING_REG_PARM_STACK_SPACE) update. + * config/score/score.opt: add options to make backend support + score5, score5u, score7 and score7d. + * config/score/score.md: Likewise. + * config/score/misc.md: Likewise. + * config/score/mac.md: Likewise. * doc/invoke.texi: Likewise. + * doc/md.texi: update constraints define. -2004-01-31 Ulrich Weigand - - * config/s390/s390.c (s390_decompose_address): Do not treat virtual - registers as pointers. - * config/s390/s390.md ("*la_31" second peephole2): Fix incorrect mode. - -2004-01-31 Jan Hubicka - - Revert the following patch until after AIX linker bug is fixed: - PR c++/12850 - * cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and - initial pointers. - * cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS - for functions that will be only inlined. - (cgraph_mark_function_to_output): Likewise. - (cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear; - do not clear function body. - * tree-optimize.c (clear_decl_rtl): Use decl_function_context. - (tree_rest_of_compilation): Reorganize the logic releasing function - body to use callgraph datastructure. - -2004-01-31 Kazu Hirata - - alloc-pool.c, alloc-pool.h, c-lex.c, c-pragma.h, - tree-optimize.c, config/alpha/alpha.c, config/alpha/alpha.h, - config/alpha/alpha.md, config/alpha/vms.h, config/arm/arm.h, - config/arm/linux-elf.h, config/avr/avr.c, config/c4x/c4x.c, - config/c4x/c4x.md, config/d30v/d30v.h, - config/frv/frv-protos.h, config/frv/frv.c, config/frv/frv.h, - config/frv/frv.md, config/frv/frvbegin.c, config/frv/frvend.c, - config/i386/cygming.h, config/i386/djgpp.h, - config/i386/emmintrin.h, config/i386/gthr-win32.c, - config/i386/i386-interix.h, config/i386/i386-protos.h, - config/i386/i386.c, config/i386/i386.h, config/i386/openbsd.h, - config/i386/winnt.c, config/i386/xm-mingw32.h, - config/i386/xmmintrin.h, config/ia64/ia64-protos.h, - config/ia64/ia64.c, config/ia64/ia64.md, config/ip2k/ip2k.c, - config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, - config/iq2000/iq2000.md, config/m32r/m32r-protos.h, - config/m32r/m32r.c, config/m32r/m32r.md, config/m68k/m68k.md, - config/m68k/netbsd-elf.h, config/mcore/mcore-elf.h, - config/mcore/mcore.c, config/mcore/mcore.h, - config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h, - config/mips/iris5gas.h, config/mips/iris6.h, - config/mips/iris6gas.h, config/mips/linux.h, - config/mips/mips.md, config/mips/netbsd.h, - config/mips/openbsd.h, config/mips/windiss.h, - config/mn10300/mn10300.c, config/mn10300/mn10300.h, - config/pdp11/pdp11.c, config/rs6000/aix.h, - config/rs6000/altivec.h, config/rs6000/darwin.h, - config/rs6000/xcoff.h, config/s390/s390-protos.h, - config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, - config/sh/netbsd-elf.h, config/sh/sh.h, config/sh/vxworks.h, - config/sparc/sol2.h, config/stormy16/stormy16.h: Update - copyright. - -2004-01-30 Dara Hazeghi - - PR bootstrap/9249 - * doc/install.texi: document --enable-__cxa_atexit option. - * configure.ac: Disable __cxa_atexit if not supported. - * configure: Regenerate. - -2004-01-30 Herman A.J. ten Brugge - - PR target/12978 - * c4x.md: (movstrqi*) Use match_scratch instead of match_dup. - Remove movstrqi_small because it conflicts with movstrqi_large. - -2004-01-30 Kelley Cook - - * Makefile.in (abs_docdir, abs_srcdir): Define. - (doc/%.dvi, doc/gccinstall.dvi): Use $(abs_docdir). - -2004-01-30 Ulrich Weigand - - PR optimization/12147 - * reload1.c (reload_reg_free_p): RELOAD_OTHER conflicts with - RELOAD_FOR_OPADDR_ADDR. - (reload_reg_reaches_end_p): RELOAD_FOR_OTHER_ADDRESS register - might be reused as RELOAD_FOR_OPADDR_ADDR register. - -2004-01-30 Jan Hubicka - - * reload.c (get_secondary_mem): Fix updating of - secondary_memlocs_elim_used. - -2004-01-30 Andrew Pinski - - * toplev.c: Include alloc-pool.h. - * Makefile.in (toplev.c): Update dependencies. - -2004-01-30 Eric Botcazou - - * config/sparc/sparc.h: Update copyright. - -2004-01-30 Eric Botcazou - - PR c/12818 - * varasm.c (const_hash_1) : Use the - address to compute the hash value if flag_writable_strings. - (compare_constant) : Compare the addresses - if flag_writable_strings. - (build_constant_desc): Do not copy the expression for a - STRING_CST if flag_writable_strings. - -2004-01-30 Jan Hubicka - - PR c++/12850 - * cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and - initial pointers. - * cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS - for functions that will be only inlined. - (cgraph_mark_function_to_output): Likewise. - (cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear; - do not clear function body. - * tree-optimize.c (clear_decl_rtl): Use decl_function_context. - (tree_rest_of_compilation): Reorganize the logic releasing function - body to use callgraph datastructure. - - * reload.c (secondary_memlocs_elim_used): New static variable. - (get_secondary_mem): Update it. - (find_reloads): Use it. - - * alias.c (reg_base_value): Turn into varray. - (reg_base_value_size): Kill. - (old_reg_base_value): New deletable varray. - (alias_invariant_size): New variable. - (REG_BASE_VALUE): Update to use varray. - (find_base_value): Likewise. - (record_set): Likewise. - (record_base_value): Likewise. - (memrefs_conflict_p): Likewise. - (record_set): Likewise - (record_base_value): Likewise. - (memrefs_conflict_p): Use alias_invariant_size. - (init_alias_analysis): Use varray; set alias_invariant_size; - rescale other arrays to be sized by maxreg. - (end_alias_analysis): Save reg_base_value; clear alias_invariant_size. - - * basic-block.h (PROP_POSTRELOAD): New macro. - (CLEANUP_LOG_LINKS): New. - * cfgcleanup.c (cleanup_cfg): Only PROP_LOG_LINKS when asked to. - * toplev.c (rest_of_handle_life): Preserve LOG_LINKS trought cleanup_cfg. - - * alloc-pool.c: Include hashtab.h - (alloc_pool_descriptor): New structure - (alloc_pool_hash): New global variable. - (hash_descriptor, eq_descriptor, alloc_pool_descriptor): New. - (create_alloc_pool): Update statistics. - (free_alloc_pool): Likewise. - (pool_alloc): Likewise. - (output_info): New structure - (print_statistics, dump_alloc_pool_statistics): New function. - * alloc-pool.h (alloc_pool_def): Turn name to be constant. - (dump_alloc_pool_statistics): Declare. - * toplev.c (finalize): Dump statistics. +2007-04-03 Stuart Hastings - * varray.c: Include hashtab.h - (varray_descriptor): New structure. - (hash_descriptor, eq_descriptor, varray_descriptor, - print_statistics): New static functions - (varray_init, varray_grow): Update statistics - (dump_varray_statistics): New function. - * varray.h (dump_varray_statistics): Declare. - * toplev.c (finalize): Call it. - -2004-01-30 Ulrich Weigand + PR 31281 + * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile from rethrow decl. + * cse.c (record_jump_equiv): Bail out on CCmode comparisons. - * configure.ac (gcc_cv_as_dwarf2_debug_line): Enable test for - s390*-*-* targets by specifying a 'nop' insn. - * configure: Regenerate. - -2004-01-30 Eric Botcazou - - PR target/11475 - * config/sparc/sparc.md (movhi_lo_sum): Tighten predicates. - -2004-01-29 Bruce Korb - - * fixinc/inclhack.def(math_exception): bypass only for glibc. - (matherr_decl): rename & relocate as exception_structure. - This fix must precede the math_exception fix. - * fixinc/fixincl.x: regen - -2004-01-29 Richard Henderson - - * c-parse.in (extension): Use itype. - (SAVE_EXT_FLAGS): Don't allocate a tree. - (RESTORE_EXT_FLAGS): Don't read a tree. - -2004-01-29 Giovanni Bajo - - * c-lex.c (c_lex): Rename to... - (c_lex_with_flags): Add new parameter to get CPP flags. - (c_lex): Thunk to c_lex_with_flags while keeping the old interface. - * c-pragma.h (c_lex_with_flags): Declare. - -2004-01-29 Roger Sayle - - PR java/13824 - * tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially - as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded - recursion. - -2004-01-28 John David Anglin - - * pa.md: Change predicate of a peephole2 pattern from reg_or_0_operand - to register_operand. - -2004-01-28 Zack Weinberg - - * config/ia64/ia64.md (fetchadd_acq_si, fetchadd_acq_di) - (cmpxchg_acq_si, cmpxchg_acq_di): Exchange match_dup and - match_operand expressions so that all match_dups appear - lexically after their corresponding match_operands. - -2004-01-28 Zack Weinberg - Jim Wilson +2007-04-03 Jakub Jelinek - * config/ia64/ia64.c (ia64_split_tmode, ia64_split_tmode_move): - Rewrite to use POST_INC/POST_DEC/POST_MODIFY instead of a - scratch pointer. - (ia64_secondary_reload_class): Delete case GR_REGS. - * config/ia64/ia64.md (movti, *movti_internal, movtf, *movtf_internal): - Do not allocate a scratch register. - (reload_inti, reload_outti, reload_intf, reload_outtf): Delete. + PR middle-end/30704 + * fold-const.c (native_encode_real): Encode real.c provided longs + as a series of 32-bit native integers. + (native_interpret_real): Interpret buffer as a series of 32-bit + native integers. -2004-01-27 Zack Weinberg +2007-04-02 Eric Christopher - * ia64.c (ia64_function_arg): When placing HFAs in integer - registers, do not special case the mode used for complex - types. Do not advance int_regs until the current register - is full. + * doc/invoke.texi (i386 and x86-64 Options): Document -m64 + limitations on darwin. -2004-01-28 Jan Hubicka +2007-04-02 Anatoly Sokolov - * function.c (allocate_struct_function): Do not initialize expr, emit - and varasm. - (prepare_function_start): Do it here. - * c-parse.in (maybe_type_qual): Do not produce line number notes. + PR target/31137 + * config/avr/avr.c (avr_rtx_costs): Add missing 'break' statements. -2004-01-28 Richard Sandiford +2007-04-02 H.J. Lu - * config/fp-bit.c (pack_d): When using paired doubles to implement - a long double, round the high part separately. - (unpack_d): Fix the case in which the high part is a power of two - and the low part is a nonzero value of the opposite sign. + * Backport from mainline: + 2007-03-28 Grigory Zagorodnev -2004-01-27 Roger Sayle + PR target/31380 + * config/i386/sse.md (uminv16qi3): Use UMIN instead of UMAX. - * config/pa/pa.c (emit_move_sequence): Check that operand1 is a - CONST_INT before using INTVAL. +2007-03-30 Anatoly Sokolov -2004-01-27 Ulrich Weigand + * config/avr/avr.c (avr_override_options): Clear + 'flag_delete_null_pointer_checks'. - * config/s390/s390.h (TARGET_DEFAULT): Default to !TARGET_BACKCHAIN. - * config/s390/s390.c (s390_return_addr_rtx): Fail for all but current - frame if !TARGET_BACKCHAIN. - * config/s390/s390.md ("allocate_stack"): Use pattern only if - TARGET_BACKCHAIN. - * doc/invoke.texi (-mbackchain/-mno-backchain): Document new default. +2007-03-29 Michael Matz -2004-01-27 Richard Sandiford + * builtins.c (expand_builtin_sync_operation, + expand_builtin_compare_and_swap, + expand_builtin_lock_test_and_set): Care for extending CONST_INTs + correctly. - PR target/7297 - * except.c (init_eh): Use a 5-word __jbuf for __builtin_setjmp(). + * config/i386/sync.md (sync_double_compare_and_swapdi_pic, + sync_double_compare_and_swap_ccdi_pic): Use "SD" as constraint + for operand 3. -2004-01-27 Bob Wilson +2007-03-28 Mike Stump - * config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Remove SUBREG - on CQImode and CHImode incoming arguments in register a7. - (function_arg): Wrap BLKmode argument in register a7 in a PARALLEL. - * config/xtensa/xtensa.h (BLOCK_REG_PADDING): Define. - * config/xtensa/xtensa.md (movdi, movdf): Only call force_reg or - xtensa_copy_incoming_a7 before reload. + * config/darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Add. + * config/darwin.h (MAX_OFILE_ALIGNMENT): Fix. + * config/rs6000/darwin.h (ASM_OUTPUT_ALIGNED_COMMON): Removed #undef. -2004-01-27 Ian Lance Taylor +2007-03-27 Anatoly Sokolov - * config/arm/arm.c (output_return_instruction): Only restore IP - into SP if frame_pointer_needed. + * config/avr/avr.c (avr_mcu_types): Move at90usb82 device to 'avr4' + architecture. -2004-01-27 Eric Botcazou +2007-03-26 Ian Lance Taylor - * config/sparc/sparc.c (function_arg_pass_by_reference): Return 1 - for SCmode and DCmode if ARCH32. - (sparc_va_arg): Handle SCmode and DCmode by reference if ARCH32. - * config/sparc/sparc.h (RETURN_IN_MEMORY): Return 0 for TCmode - if ARCH32. - (BASE_RETURN_VALUE_REG): Return 32 for all FP modes except TFmode - if ARCH32. - (BASE_OUTGOING_VALUE_REG): Likewise. + PR tree-optimization/31345 + * tree-vrp.c (extract_range_from_binary_expr): Turn ranges like + [+INF, +INF(OVF)] into VARYING. -2004-01-27 Eric Botcazou +2007-03-23 Martin Michlmayr - PR target/10904 - PR target/13058 - * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New. - Forbid mode changes from SImode for lower FP regs if ARCH64. + * doc/invoke.texi (-fforce-mem): Update documentation to reflect + that this option will be removed in 4.3 rather than 4.2. + * opts.c (common_handle_option): Likewise. -2004-01-27 Jakub Jelinek +2007-03-21 Mike Stump - * config/i386/i386.c (ix86_constant_alignment): Decrease alignment - of long string literals from 32 bytes to sizeof (void *) when !-Os - and to 1 with -Os. + * c.opt: Fixup for Objective-C/C++. -2004-01-27 Kaz Kojima +2007-03-21 Richard Henderson - PR optimization/13567 - * cse.c (cse_basic_block): Call cse_insn with a non-null - libcall_insn for the last SET insn of a no-confilict block. + PR target/31245 + * config/i386/emmintrin.h (__m128i, __m128d): Mark may_alias. + * config/i386/mmintrin.h (__m64): Likewise. + * config/i386/xmmintrin.h (__m128): Likewise. -2004-01-26 Kaveh R. Ghazi +2007-03-20 Jakub Jelinek - * system.h (CHAR_BITFIELD): Delete. - (BOOL_BITFIELD): New. - * c-decl.c (c_scope): Use BOOL_BITFIELD. - * gengtype-lex.l: Recognize BOOL_BITFIELD instead of CHAR_BITFIELD. + PR c/30762 + * c-typeck.c (convert_for_assignment): Call comptypes for + RECORD_TYPE or UNION_TYPE. -2004-01-26 J"orn Rennecke + PR inline-asm/30505 + * reload1.c (reload): Do invalid ASM checking after + cleanup_subreg_operands. - * doc/tm.texi: Insert some weasel words when LOAD_EXTEND_OP - may or may not return non-NIL. - * postreload.c (reload_cse_simplify_operands): In LOAD_EXTEND_OP code, - check CANNOT_CHANGE_MODE_CLASS +2007-03-19 Jeff Law -2004-01-26 Jeff Law + * tree-cfg.c (find_taken_edge): Tighten conditions for + optimizing computed gotos. - * doc/contrib.texi: Minor cleanup for Paolo Carlini's entry. Add - acute accents for Petur Runolfsson's entry. +2007-03-16 John David Anglin + * pa.c (attr_length_call): Partially revert change of 2007-03-09. + (output_call): Likewise. -2004-01-26 Eric Botcazou +2007-03-16 Alexandre Oliva + + PR debug/29906 + * dwarf2out.c (force_type_die): Adjust comment. + (dwarf2out_imported_module_or_decl): Handle base AT_import types. + +2007-03-15 Seongbae Park + + PR tree-optimization/30590 + * tree-nrv.c (tree_nrv): Check for the partial update + of the return value. + +2007-03-14 Ian Lance Taylor + + * tree-vrp.c (value_inside_range): Ignore fold warnings. + +2007-03-13 John David Anglin + + PR target/31123 + * pa.md (vdepi_ior): Don't allow zero length deposit. Likewise for + two unamed patterns. + +2007-03-12 Brooks Moses + + * doc/extend.texi: Edit "gnu_inline" documentation. + * doc/invoke.texi: Edit "-fgnu89-inline" documentation. + +2007-03-12 Brooks Moses + + * doc/extend.texi: Fix cpp.info cross-reference. + * doc/invoke.texi: Fix cpp.info cross-reference. + * doc/passes.texi: Fix gcc.info cross-reference. + +2007-03-12 Daniel Berlin + + Fix PR tree-optimization/28544 + * tree-ssa-operands.c (add_virtual_operand): + Move assert triggering on aliasing violations into + debugging define + +2007-03-12 Ian Lance Taylor + + * c.opt (fgnu89-inline): New option. + * c-opts.c (c_common_post_options): Warn about -fno-gnu89-inline. + * c-common.c (c_common_attributes): Add gnu_inline attribyte. + (handle_gnu_inline_attribute): New static function. + * c-decl.c (start_function): Warn if we see a non-static inline + function in C99 mode. + * c-cppbuiltin.c (c_cpp_builtins): Define __GNUC_GNU_INLINE__. + * doc/invoke.texi (Option Summary): Mention -fgnu89-inline. + (C Dialect Options): Document -fgnu89-inline. + * doc/extend.texi (Function Attributes): Document gnu_inline. + (Inline): Mention that C99 inline will be implemented in 4.3. + Refer to ways to get the old handling. + * doc/cpp.texi (Common Predefined Macros): Document + __GNUC_GNU_INLINE__ and __GNUC_STDC_INLINE__. + +2007-03-12 Richard Henderson + + * config/alpha/alpha.c (alpha_elf_section_type_flags): New. + (TARGET_SECTION_TYPE_FLAGS): New. + +2007-03-12 Richard Henderson + + * config/darwin.c (machopic_reloc_rw_mask): New. + (machopic_select_section): Use decl_readonly_section. + * config/darwin-protos.h (machopic_reloc_rw_mask): Declare. + * config/darwin.h (TARGET_ASM_RELOC_RW_MASK): New. + +2007-02-14 Richard Guenther Backport from mainline: - - 2004-01-23 Eric Botcazou - Olivier Hainque - - * fold-const.c (fold_binary_op_with_conditional_arg): Only - build a COMPOUND_EXPR if 'arg' is really a SAVE_EXPR. - -2004-01-26 Eric Botcazou - - PR target/13666 - * config/sparc/sparc.c (function_arg_union_value): New function. - (function_arg): Use it to deal with unions. - (function_value): Likewise. Define 'regbase' only for ARCH64. - Replace a conditional statement by a simpler one. - -2004-01-26 Richard Sandiford - - * config/mips/mips.c (mips16_optimize_gp): Delete. - (mips_reorg): Don't call it. - -2004-01-25 Richard Sandiford - - * config/mips/mips.c (mips_offset_within_object_p): New function. - (mips_symbolic_constant_p): Use it in the SYMBOL_SMALL_DATA and - SYMBOL_CONSTANT_POOL cases. Also use it for SYMBOL_GENERAL if the - ABI has 64-bit pointers and the object file only allows 32-bit symbols. - -2004-01-25 Eric Botcazou - - PR bootstrap/13853 - * cfgcleanup.c (try_optimize_cfg): Explicitly test against 0. - -2004-01-25 Richard Sandiford - - * config/mips/mips-protos.h (mips_reg_mode_ok_for_base_p): Delete. - (mips_regno_mode_ok_for_base_p): Declare. - * config/mips/mips.h (ARG_POINTER_REGNUM): Renumber to 77. - (FRAME_POINTER_REGNUM): Renumber to 78. - (FIRST_PSEUDO_REGISTER): Update comment accordingly. - (BASE_REG_P, GP_REG_OR_PSEUDO_STRICT_P): Delete. - (GP_REG_OR_PSEUDO_NONSTRICT_P): Delete. - (REGNO_MODE_OK_FOR_BASE_P): Use mips_regno_mode_ok_for_base_p. - (REG_MODE_OK_FOR_BASE_P): Likewise. - * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Change - entry for 77 to "$arg" and entry for 78 to "$frame". - (mips_regno_to_class): Map 77 and 78 to ALL_REGS. - (mips_reg_mode_ok_for_base_p): Remove. - (mips_regno_mode_ok_for_base_p): New function, derived from old - BASE_REG_P macro. Don't enforce the mips16 stack pointer - restrictions unless we're being strict. - (mips_valid_base_register_p): Use mips_regno_mode_ok_for_base_p. - -2004-01-24 Kazu Hirata - - * doc/frontends.texi: Update copyright. - * doc/gcov.texi: Likewise. - * doc/gty.texi: Likewise. - * doc/sourcebuild.texi: Likewise. - -2004-01-24 Kazu Hirata - - * config/h8300/coff.h: Update copyright. - * config/h8300/elf.h: Likewise. - * config/h8300/h8300-protos.h: Likewise. - * config/h8300/h8300.c: Likewise. - * config/h8300/h8300.h: Likewise. - * config/h8300/h8300.md: Likewise. - -2004-01-24 Hartmut Penner - - PR target/13674 - * config/rs6000/rs6000.md (movdf_hardfloat64): Do not disparage - loading into GPR. - -2004-01-24 Zdenek Dvorak - - PR optimization/12440 - * loop.c: Include ggc.h. - (loop_optimize): Run garbage collector between optimization of loops. - * Makefile.in (loop.o): Add GGC_H dependency. - -2004-01-24 Jakub Jelinek - - * simplify-rtx.c (simplify_relational_operation): Don't - simplify address == constant into address + -constant == 0. - -2004-01-24 Kazu Hirata - - * gcc.c (process_command): Don't internationalize the - Copyright message. - * mips-tfile.c (main): Likewise. - -2004-01-23 Kazu Hirata - - * recog.c: Fix a typo in copyright. - -2004-01-23 Kazu Hirata - - * alias.c, basic-block.h, c-common.c, c-common.h, - c-cppbuiltin.c, c-pragma.c, c-pretty-print.c, c-semantics.c, - calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c, - combine.c, cppcharset.c, cpptrad.c, cse.c, cselib.c, cselib.h, - defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c, - expr.h, fold-const.c, function.h, gcc.c, gcse.c, genattrtab.c, - genautomata.c, genconditions.c, genflags.c, gengtype.c, - genopinit.c, genrecog.c, gensupport.c, ggc-zone.c, graph.c, - haifa-sched.c, integrate.c, langhooks-def.h, langhooks.c, - langhooks.h, local-alloc.c, optabs.c, optabs.h, postreload.c, - ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c, - rtlanal.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h, - target.h, targhooks.c, toplev.h, tree-inline.c, - unwind-dw2-fde.h, unwind-pe.h, unwind.h, varray.c, varray.h: - Update copyright. - -2004-01-23 Bob Wilson - - * config/xtensa/xtensa.c (xtensa_va_arg): Handle complex values as - separate real and imaginary parts. - * config/xtensa/xtensa.h (SPLIT_COMPLEX_ARGS): Define. - -2004-01-23 Richard Henderson - - PR opt/12941 - * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value. - (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0) - if SHIFT_COUNT_TRUNCATED is set. - -2004-01-23 Rainer Orth - - * fixinc/inclhack.def (alpha___extern_prefix): Renamed to ... - (alpha___extern_prefix_sys_stat): ... this. - Apply to , too. - Tweak to match more variations. - * fixinc/tests/base/sys/stat.h: Adapt for new hackname. - - * fixinc/inclhack.def (alpha___extern_prefix, - alpha___extern_prefix_standards): New hacks to obey - __PRAGMA_EXTERN_PREFIX. - * fixinc/tests/base/testing.h [ALPHA___EXTERN_PREFIX_CHECK]: New - test. - * fixinc/tests/base/standards.h: Likewise. - - * fixincl/inclhack.def (alpha_pthread): Tweak to match more - variations. - New testcase. - * fixinc/tests/base/pthread.h: Handle it. - - * fixinc/fixincl.x: Regenerate. - -2004-01-23 Rainer Orth - - * fixinc/inclhack.def (bad_lval): Renamed to ... - (alpha_bad_lval): ... this. - Removed file list. - Restrict to alpha*-dec-osf*. - * fixinc/fixincl.x: Regenerate. - * fixinc/tests/base/libgen.h: Remove, moving test ... - * fixinc/tests/base/testing.h: ... here, reflecting new name. - -2004-01-23 Ian Lance Taylor - - * doc/invoke.texi (Optimize Options): Note that --param arguments - are subject to change without notice. - -2004-01-23 Zack Weinberg - - PR c/13814 - * c-decl.c (diagnose_mismatched_decls): Also discard a - built-in if we encounter an old-style definition with the - same name. - -2004-01-23 Jakub Jelinek - - * config.gcc (powerpc*-*): Clear $with_cpu or $with_tune if it was - set to default{32,64}. - -2004-01-21 Jakub Jelinek - - * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR) - [!__powerpc64__]: Corrected to handle kernels with changed ucontext. - -2003-11-30 Jan Hubicka - - * i386.c (ix86_emit_restore_regs_using_mov): Deal with large offsets. - -2004-01-23 Eric Botcazou - - * config/sparc/sparc.c (scan_record_type): New function. - (function_arg_slotno): Use it to determine which kinds of - registers the record can be passed in. - -2004-01-22 Rainer Orth - - * configure.ac (enable_werror): Fixed typo. - * configure: Regenerate. - -2004-01-22 Rainer Orth - - * config.gcc (mips-sgi-irix6*o32): Removed. - * config/mips/iris6-o32-as.h: Likewise. - * config/mips/iris6-o32-gas.h: Likewise. - * config/mips/iris6-o32.h: Likewise. - -2004-01-22 Bob Wilson - - * config/xtensa/xtensa.c (function_arg): Generalize logic so that it - handles complex and vector modes. - -2004-01-22 Daniel Jacobowitz - - * c-semantics.c (genrtl_while_stmt, genrtl_do_stmt_1) - (genrtl_for_stmt): Remove emit_nop calls. - -2004-01-22 John David Anglin - - PR target/13713 - PR target/13324 - * pa.md (movstrsi_prereload, movstrsi_postreload, movstrdi_prereload, - movstrdi_postreload, clrstrsi_prereload, clrstrsi_postreload, - clrstrdi_prereload, clrstrdi_postreload): Fix constraints. - -2004-01-22 Daniel Jacobowitz - - * config/arm/arm.c: Include "debug.h". - (thumb_pushpop): Take two new arguments. Add some commentary. - Output frame information when pushing. - (thumb_exit, thumb_unexpanded_epilogue): Update calls to - thumb_pushpop. - (thumb_output_function_prologue): Likewise. Accumulate a CFA - offset, and pass it to thumb_pushpop. Output CFI information. - (thumb_expand_prologue): Add some frame-related markers and notes. - -2004-01-22 Ulrich Weigand - - * config/s390/s390.c (s390_frame_info): Allow large frame sizes - for TARGET_64BIT. - (s390_arg_frame_offset): Change return type to HOST_WIDE_INT. - * config/s390/s390-protos.h (s390_arg_frame_offset): Likewise. - -2004-01-22 Kazu Hirata - - * doc/tm.texi (CASE_VECTOR_PC_RELATIVE): Mention that the - macro need not be defined if jump-tables should contain - relative addresses only when -fPIC or -fPIC is in effect. - -2004-01-22 Eric Botcazou - - * config/sparc/sparc.c (function_arg_slotno): Use - FLOAT_TYPE_P to detect FP fields in structures. - (function_arg_record_value_1): Likewise. - (function_arg_record_value_2): Likewise. - -2004-01-22 Eric Botcazou - - PR target/13559 - * config/sparc/sparc.c (function_arg_record_value_3): Revert - to 'word_mode' once the first slot has been filled. - -2004-01-22 Olivier Hainque - - * config/sparc/sparc.c (function_arg_record_value_1): Fix - computation of the number of integer registers required. - -2004-01-22 Hartmut Penner - - * gcc/config/rs6000/rs6000.c (function_arg) Handle - vector register special in function without prototype. - (function_arg_advance): Vector parameters get always - GPRs allocated for the linux64 target. - -2004-01-21 Andrew Pinski - - PR target/13785 - * config/rs6000/rs6000.md (call_value): Force operand - 1 not operand 0 into a register. - -2004-01-21 John David Anglin - - * pa-protos.h: Update copyright. - * pa.h: Likewise. - * pa.md: Likewise. - - * fixinc/inclhack.def (hpux10_stdio_declarations, ultrix_const3, - ultrix_locale, ultrix_stdlib, ultrix_strings, ultrix_sys_time, - ultrix_unistd): New hacks. - * fixinc/tests/base/stdio.h (HPUX10_STDIO_DECLARATIONS_CHECK, - ULTRIX_CONST2_CHECK): Add checks. - * fixinc/tests/base/stdlib.h (ULTRIX_STDLIB_CHECK): Likewise. - * fixinc/tests/base/strings.h (ULTRIX_STRINGS2_CHECK): Likewise. - * fixinc/tests/base/unistd.h (ULTRIX_UNISTD_CHECK): Likewise. - * fixinc/tests/base/sys/time.h (ULTRIX_SYS_TIME_CHECK): Likewise. - * fixinc/tests/base/locale.h: New file. - * fixincl.x: Rebuilt. - -2004-01-21 Andreas Jaeger - Michael Matz - - * doc/extend.texi (Extended Asm): Clarify memory clobber. - -2004-01-21 Zack Weinberg - - * c-decl.c (merge_decls): Kill different_binding_level and - different_tu arguments; simplify throughout. - (duplicate_decls): Likewise. - (pushdecl, merge_translation_unit_decls): Update calls to - duplicate_decls. - -2004-01-20 Kelley Cook - - PR bootstrap/12730 - * configure.ac: Delete definition and subsitution of docdir. - Add info, man, srcman and srcinfo to target hooks. Create doc/ - directory. - * configure: Regenerate. - * Makefile.in: Don't substitute docdir and delete all references - throughout. - (MAKEINFOFLAGS): Define. - (stmp-docobjdir): Delete. - (INFOFILES, MANFILES): Define. - (info): Call lang.info, srcinfo and lang.srcinfo. - (generated-manpages): Call lang.man, srcman and lang.srcman. - (srcinfo, srcman): New rules to copy back files to source directory. - (doc/%.info, doc/%.dvi, doc/%.1, doc/%.7): New implict rule. - (install-man): Revamp rule. - (clean): Update dvi directory. - (distclean): Delete TAGS from front end directorys. - (maintainer-clean): Delete all document files in source directory. - - objc/Make-lang.in (objc.man, objc.info): Dummy entries. - (objc.srcman, objc.srcinfo): Likewise. - -2004-01-20 Kaveh R. Ghazi - - * Makefile.in (pretty-print.o): Depend on $(CONFIG_H) and - $(SYSTEM_H). - (print-rtl1.o): Depend on $(SYSTEM_H). - -2004-01-20 John David Anglin - - * pa-protos.h (compute_frame_size): Use HOST_WIDE_INT for frame sizes. - * pa.c (store_reg, store_reg_modify, load_reg, set_reg_plus_d): - Likewise. Handle frames larger than 0x7fffffff on 64-bit ports. - (emit_move_sequence): Check scratch_reg first in various if statements. - Extend source simplification to handle all 64-bit CONST_INTs. - (pa_output_function_prologue): Use HOST_WIDE_INT_PRINT_DEC for printing - frame size. - (hppa_expand_prologue, hppa_expand_epilogue): Use HOST_WIDE_INT for - frame offset calculations. - * pa.h (NEW_HP_ASSEMBLER): Add comment. - (MAX_LEGIT_64BIT_CONST_INT, MIN_LEGIT_64BIT_CONST_INT, - LEGITIMATE_64BIT_CONST_INT_P): Define. - (LEGITIMATE_CONSTANT_P): Use LEGITIMATE_64BIT_CONST_INT_P. Treat - any CONST_INT as legitimate during and after reload. - (VAL_32_BITS_P, INT_32_BITS): Define. - (LEGITIMIZE_RELOAD_ADDRESS): Handle large frame offsets. - -2004-01-21 Alan Modra - - * config/rs6000/sysv4.h (DWARF2_FRAME_REG_OUT): Define. - * dwarf2out.c (output_cfi): Map regs using DWARF2_FRAME_REG_OUT. - * doc/tm.texi (DWARF_FRAME_REGNUM, DWARF2_FRAME_REG_OUT): Document. - -2004-01-20 Geoffrey Keating - - * alias.c (new_alias_set): Mark last_alias_set for PCH. - (get_varargs_alias_set): Rename 'set' to 'varargs_set' and mark it - for PCH. - (get_frame_alias_set): Likewise, except rename it to 'frame_set'. - * config/rs6000/rs6000.c (rs6000_sr_alias_set): Mark for PCH. - (get_TOC_alias_set): Mark 'set' for PCH. - -2004-01-20 Richard Sandiford - - * config/mips/mips.c (mips_load_call_address): Make the call insn - use $gp if it could be calling a lazy binding stub. - -2004-01-20 Denis Chertykov - - PR bootstrap/13735 - * config/avr/avr.h (BASE_REG_CLASS): Don't permit to use X - register as pointer after reload. - -2004-01-20 Eric Botcazou - - PR target/13557 - * config/sparc/sparc.c (function_arg): Reorder the cases. - -2004-01-19 Kelley Cook - - * Makefile.in (target_noncanonical, program_transform_name): Use - immediate define instead of deferred. - (GCC_INSTALL_NAME, GCC_TARGET_INSTALL_NAME, CPP_INSTALL_NAME, - PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, GCOV_INSTALL_NAME, - GCCBUG_INSTALL_NAME): Define via a immediate $(shell) instead of - deferred backquote. - -2004-01-19 Richard Henderson - - * config/alpha/alpha.c (aligned_memory_operand): Check MEM_ALIGN, - don't check memory mode. - (unaligned_memory_operand): Likewise. - (reload_inqi, reload_inhi, reload_outqi, reload_outhi): Don't - abort for op0 not MEM. - - * config/alpha/alpha.c (alpha_expand_mov_nobwx): If the destination - is not a reg, copy to a scratch first. - (aligned_loadqi, aligned_loadhi, unaligned_loadqi, unaligned_loadhi, - unaligned_loadqi_le, unaligned_loadqi_be, unaligned_loadhi_le, - unaligned_loadhi_be): Expect op0 in DImode; don't SUBREG. - (reload_inqi, reload_inhi): Fix mode of op0. - (reload_inqi_help, reload_inhi_help, reload_outqi_help, - reload_outhi_help): Likewise. Use define_insn_and_split. - - * config/alpha/alpha.md (call peepholes): Check for REG_NORETURN - as well as $29 dead. - -2004-01-19 Eric Botcazou - - * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): New. Emit - "tls_object" for thread-local objects. - * config/sparc/sparc.c (sparc_elf_asm_named_section): Emit - "#tls" for thread-local sections. - * configure.ac (thread-local checks): Specify --fatal-warnings in - every binutils-specific checks. For sparc*-*-*, test whether the - OS is Solaris and the tools are native and act accordingly. - * configure: Rebuild. - -2004-01-19 Jeff Law - - * contrib.texi: Update Paolo Carlini's entry. New entries for - Jerry Quinn and Petur Runolfsson. - -2004-01-19 Richard Henderson - - * alpha.h (HARD_REGNO_MODE_OK): Disallow SImode in FP regs. - * alpha.md (UNSPEC_NT_LDA): Remove. - (UNSPEC_CVTLQ, cvtlq): New. - (extendsidi2_1): Rename from extendsidi2_nofix; remove f/f. - (extendsidi2_fix): Remove. - (extendsidi2 splitter): Use cvtlq. - (extendsidi2 fp peepholes): Remove. - (cvtql): Use SFmode instead of SImode. - (fix_trunc?fsi): Update to match. - (floatsisf2_ieee, floatsisf2, floatsidf2_ieee, floatsidf2): New. - (movsi): Rename from movsi_nofix, remove f alternatives. - (movsi_nt_vms): Similarly. - (movsi_fix, movsi_nt_vms_fix): Remove. - (nt_lda): Remove. - * alpha.c (alpha_expand_prologue): Use adddi3, not nt_lda. - -2004-01-19 Jan Hubicka - - * cgraph.c (cgraph_remove_node): Fix removal from linked list. - * cgraphunit.c (cgraph_finalize_compilation_unit): Clear next_needed - list. - (cgraph_remove_unreachable_nodes): New function - (cgraph_decide_inlining_of_small_function): Fix pasto. - (cgraph_decide_inlining_incrementally): Fix pasto. - (cgrpah_decide_inlining): Likewise; remove unreachable nodes. - -2004-01-18 Roger Sayle - - * builtins.c (expand_builtin_expect_jump): Fix thinko of reusing - live "next" variable, which can lead to an infinite loop. - -2004-01-18 Daniel Jacobowitz - - * final.c (final_scan_insn): Make non-static again. - * output.h (final_scan_insn): Re-add prototype. - * config/arc/arc.c (arc_output_function_epilogue): Add NULL - to final_scan_insn call. - * config/cris/cris.c (cris_target_asm_function_epilogue): Likewise. - * config/mips/mips.c (mips_output_conditional_branch): Likewise. - * config/pa/pa.c (output_lbranch, output_call): Likewise. - * config/sh/sh.c (print_slot): Likewise. - * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Likewise. - (output_sibcall, sparc_flat_function_epilogue): Likewise. - -2004-01-18 Jan Hubicka - - * basic-block.h (try_redirect_by_replacing_jump): Declare. - * cfgcleanup.c (try_optimize_cfg): Use it. - * cfgrtl.c (try_redirect_by_replacing_jump): Export. - (rtl_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch): - Kill hack. - (cfg_layout_merge_blocks): Use try_redirect_by_replacing_jump. - -2004-01-18 Andrew Pinski - - * config/rs6000/altivec.h: Wrap C++ functions in extern "C++" - block. - - * config/rs6000/rs6000.c (rs6000_special_round_type_align): - Check for NULL in the chain and remove repeated code. - -2004-01-18 Jan Hubicka - - * coverage.c (checksum_string): Rename to ... - (coverage_checksum_string): ... this one, Use crc32_string; recognize - names containing random number and zero the number out in order to get - match. - -2004-01-18 Richard Sandiford - - * config/mips/mips.c (mips_got_alias_set): Mark for PCH. - -2004-01-18 Joseph S. Myers - - * doc/c-tree.texi, doc/cpp.texi, doc/extend.texi, - doc/frontends.texi, doc/gcov.texi, doc/gty.texi, doc/install.texi, - doc/invoke.texi, doc/libgcc.texi, doc/md.texi, doc/rtl.texi, - doc/sourcebuild.texi, doc/standards.texi, doc/tm.texi, - doc/trouble.texi: Remove trailing whitespace. - -2004-01-18 Richard Sandiford - - PR target/7618 - * config/mips/mips.c: Include cfglayout.h. - (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Define. - (mips_unspec_offset_high): Add temporary register argument. - (mips_load_call_address): New function, split out from... - (mips_expand_call): ...here. - (mips_output_cplocal): New function. - (mips_output_function_prologue, mips_output_function_epilogue): Use it. - (mips_emit_loadgp): New function, split out from... - (mips_expand_prologue): ...here. - (mips_output_mi_thunk): New function. - -2004-01-17 Roger Sayle - - * builtins.c (expand_builtin_expect_jump): Fix mistake in my - last patch. Use XEXP (x, 0) to get a LABEL_REF's CODE_LABEL. - -2004-01-17 Andrew Pinski - - * config/rs6000/rs6000.c (rs6000_special_round_type_align): - Return type is unsigned int not int. - * config/rs6000/rs6000-protos.h (rs6000_special_round_type_align): + * flags.h (issue_strict_overflow_warning): Convert to a macro. + +2007-03-11 Ian Lance Taylor + + Backport -fstrict-overflow/-Wstrict-overflow from mainline: + 2007-03-11 Ian Lance Taylor + + * tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and + the *_DIV_EXPR codes correctly with overflow infinities. + + 2007-03-09 Ian Lance Taylor + + * opts.c (common_handle_option): Treat -Wstrict-overflow (with no + argument) like -Wstrict-overflow=2. + * doc/invoke.texi (Warning Options): Update documentation. + + 2007-03-08 Ian Lance Taylor + + * tree-vrp.c: Include "toplev.h" and "intl.h". + (usable_range_p): New static function. + (compare_values_warnv): Don't test TYPE_OVERFLOW_UNDEFINED for + overflowed values, juts set *strict_overflow_p. + (compare_values): Only return -2 if one of the operands is not a + constant. + (compare_ranges): Call usable_range_p. + (compare_range_with_value): Likewise. + (vrp_evaluate_conditional_warnv): Rename from + vrp_evaluate_conditional. Make static. Change all callers. + (vrp_evaluate_conditional): New function. + (simplify_div_or_mod_using_ranges): Issue warning about reliance + on signed overflow. + (simplify_abs_using_ranges): Likewise. + (simplify_stmt_for_jump_threading): Add within_stmt parameter. + * tree-ssa-dom.c (simplify_stmt_for_jump_threading): Add + within_stmt parameter. + * tree-ssa-propagate.c (fold_predicate_in): Update call to + vrp_evaluate_conditional. + * tree-ssa-threadedge.c + (record_temporary_equivalences_from_stmts_at_dest): Change + simplify parameter to take a second tree parameter. + (simplify_control_stmt_condition): Likewise. + (thread_across_edge): Likewise. + * tree-flow.h (vrp_evaluate_conditional): Update declaration. + (thread_across_edge): Likewise. + * Makefile.in (tree-vrp.o): Depend upon toplev.h and intl.h. + + 2007-03-05 Ian Lance Taylor + + * tree-vrp.c (extract_range_from_assert): Don't try to handle a + half-range if the other side is an overflow infinity. + + 2007-03-02 Ian Lance Taylor + + Used signed infinities in VRP. + * tree-vrp.c (uses_overflow_infinity): New static function. + (supports_overflow_infinity): New static function. + (make_overflow_infinity): New static function. + (negative_overflow_infinity): New static function. + (positive_overflow_infinity): New static function. + (is_negative_overflow_infinity): New static function. + (is_positive_overflow_infinity): New static function. + (is_overflow_infinity): New static function. + (overflow_infinity_range_p): New static function. + (compare_values_warnv): New function split out of compare_values. + (compare_value): Call it. + (set_value_range_to_nonnegative): Add overflow_infinity + parameter. Change caller. + (vrp_expr_computes_nonnegative): Add strict_overflow_p parameter. + Change callers. + (vrp_expr_computes_nonzero): Likewise. + (compare_ranges, compare_range_with_value): Likewise. + (compare_name_with_value, compare_names): Likewise. + (vrp_evaluate_conditional): Likewise. + (set_value_range): Handle infinity + (vrp_operand_equal_p, operand_less_p): Likewise. + (extract_range_from_assert): Likewise. + (vrp_int_const_binop): Likewise. + (extract_range_from_binary_expr): Likewise. + (extract_range_from_unary_expr): Likewise. + (extract_range_from_comparison): Likewise. + (extract_range_from_expr): Likewise. + (dump_value_range): Likewise. + (vrp_visit_cond_stmt, vrp_visit_phi_node): Likewise. + (test_for_singularity): Likewise. + (vrp_int_const_binop): Remove inline qualifier. + (adjust_range_with_scev): Add comment. + * tree-flow.h (vrp_evaluate_conditional): Update declaration. + + 2007-02-13 Ian Lance Taylor + + * common.opt: Add Wstrict-overflow and Wstrict-overflow=. + * flags.h (warn_strict_overflow): Declare. + (enum warn_strict_overflow_code): Define. + (issue_strict_overflow_warning): New static inline function. + * opts.c (warn_strict_overflow): New variable. + (common_handle_option): Handle OPT_Wstrict_overflow and + OPT_Wstrict_overflow_. + * c-opts.c (c_common_handle_option): Set warn_strict_overflow for + OPT_Wall. + * fold-const.c: Include intl.h. + (fold_deferring_overflow_warnings): New static variable. + (fold_deferred_overflow_warning): New static variable. + (fold_deferred_overflow_code): New static variable. + (fold_defer_overflow_warnings): New function. + (fold_undefer_overflow_warnings): New function. + (fold_undefer_and_ignore_overflow_warnings): New function. + (fold_deferring_overflow_warnings_p): New function. + (fold_overflow_warning): New static function. + (make_range): Add strict_overflow_p parameter. Change all + callers. + (extract_muldiv, extract_muldiv_1): Likewise. + (fold_unary) [ABS_EXPR]: Check ABS_EXPR before calling + tree_expr_nonnegative_p. + (fold_negate_expr): Call fold_overflow_warning. + (fold_range_test): Likewise. + (fold_comparison): Likewise. + (fold_binary): Likewise. Call tree_expr_nonnegative_warnv_p + instead of tree_expr_nonnegative_p. + (tree_expr_nonnegative_warnv_p): Rename from + tree_expr_nonnegative_p, add strict_overflow_p parameter. + (tree_expr_nonnegative_p): New function. + (tree_expr_nonzero_warnv_p): Rename from tree_expr_nonzero_p, add + strict_overflow_p parameter. + (tree_expr_nonzero_p): New function. + * passes.c (verify_interpass_invariants): New static function. + (execute_one_pass): Call it. + * tree-ssa-loop-niter.c (expand_simple_operations): Ignore fold + warnings. + (number_of_iterations_exit, loop_niter_by_eval): Likewise. + (estimate_numbers_of_iterations): Likewise. + (scev_probably_wraps_p): Likewise. + * tree-ssa-ccp.c: Include "toplev.h". + (evaluate_stmt): Defer fold overflow warnings until we know we are + going to optimize. + (struct fold_stmt_r_data): Add stmt field. + (fold_stmt_r): Defer fold overflow warnings until we know we + optimized. + (fold_stmt): Initialize stmt field of fold_stmt_r_data. + (fold_stmt_inplace): Likewise. + * tree-cfgcleanup.c: Include "toplev.h" rather than "errors.h". + (cleanup_control_expr_graph): Defer fold overflow warnings until + we know we are going to optimize. + * tree-cfg.c (fold_cond_expr_cond): Likewise. + * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. + * tree-vrp.c (vrp_expr_computes_nonnegative): Call + tree_expr_nonnegative_warnv_p instead of tree_expr_nonnegative_p. + * tree-ssa-loop-manip.c (create_iv): Likewise. + * c-typeck.c (build_conditional_expr): Likewise. + (build_binary_op): Likewise. + * tree-vrp.c (vrp_expr_computes_nonzero): Call + tree_expr_nonzero_warnv_p instead of tree_expr_nonzero_p. + (extract_range_from_unary_expr): Likewise. + * simplify-rtx.c (simplify_const_relational_operation): Warn when + assuming that signed overflow does not occur. + * c-common.c (pointer_int_sum): Ignore fold overflow warnings. + * tree.h (tree_expr_nonnegative_warnv_p): Declare. + (fold_defer_overflow_warnings): Declare. + (fold_undefer_overflow_warnings): Declare. + (fold_undefer_and_ignore_overflow_warnings): Declare. + (fold_deferring_overflow_warnings_p): Declare. + (tree_expr_nonzero_warnv_p): Declare. + * doc/invoke.texi (Option Summary): Add -Wstrict-overflow to list + of warning options. + (Warning Options): Document -Wstrict-overflow. + * Makefile.in (tree-ssa-threadedge.o): Depend on toplev.h. + (tree-ssa-ccp.o): Likewise. + (tree-cfgcleanup.o): Change errors.h dependency to toplev.h. + (fold-const.o): Depend on intl.h. + + 2007-01-27 Ian Lance Taylor + + * common.opt: Add fstrict-overflow. + * opts.c (decode_options): Set flag_strict_overflow if -O2. + * flags.h (TYPE_OVERFLOW_WRAPS): Define. + (TYPE_OVERFLOW_UNDEFINED): Define. + (TYPE_OVERFLOW_TRAPS): Define. This replaces TYPE_TRAP_SIGNED. + Replace all uses. + * tree.h (TYPE_TRAP_SIGNED): Don't define. + * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_UNDEFINED. + (fold_negate_expr): Likewise. + (make_range): Likewise. + (extract_muldiv_1): Likewise. + (fold_comparison): Likewise. + (fold_binary): Likewise. + (tree_expr_nonnegative_p): Likewise. + (tree_expr_nonzero_p): Likewise. + * tree-vrp.c (compare_values): Likewise. + (extract_range_from_binary_expr): Likewise. + (extract_range_from_unary_expr): Likewise. + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): + Likewise. + (nowrap_type_p): Likewise. + * tree-scalar-evolution.c (simple_iv): Likewise. + * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_WRAPS. + (build_range_check): Likewise. + (extract_muldiv_1): Likewise. + (fold_comparison): Likewise. + * tree-vrp.c (vrp_int_const_binop): Likewise. + (extract_range_from_unary_expr): Likewise. + * convert.c (convert_to_integer): Likewise. + * fold-const.c (fold_negate_expr): Use TYPE_OVERFLOW_TRAPS. + (fold_comparison): Likewise. + (fold_binary): Likewise. + * optabs.c (optab_for_tree_code): Likewise. + * tree-vectorizer.c (vect_is_simple_reduction): Likewise. + * simplify-rtx.c (simplify_const_relational_operation): Check + flag_strict_overflow and flag_trapv. + (simplify_const_relational_operation): Likewise. + * doc/invoke.texi (Option Summary): Mention -fstrict-overflow. + (Optimize Options): Add -fstrict-overflow to -O2 list. Document + -fstrict-overflow. + + 2007-01-17 Ian Lance Taylor + + * vec.h (VEC_reserve_exact): Define. + (vec_gc_p_reserve_exact): Declare. + (vec_gc_o_reserve_exact): Declare. + (vec_heap_p_reserve_exact): Declare. + (vec_heap_o_reserve_exact): Declare. + (VEC_OP (T,A,reserve_exact)): New static inline function, three + versions. + (VEC_OP (T,A,reserve)) [all versions]: Remove handling of + negative parameter. + (VEC_OP (T,A,alloc)) [all versions]: Call ...reserve_exact. + (VEC_OP (T,A,copy)) [all versions]: Likewise. + (VEC_OP (T,a,safe_grow)) [all versions]: Likewise. + * vec.c (calculate_allocation): Add exact parameter. Change all + callers. + (vec_gc_o_reserve_1): New static function, from vec_gc_o_reserve. + (vec_gc_p_reserve, vec_gc_o_reserve): Call vec_gc_o_reserve_1. + (vec_gc_p_reserve_exact, vec_gc_o_reserve_exact): New functions. + (vec_heap_o_reserve_1): New static function, from vec_heap_o_reserve. + (vec_heap_p_reserve, vec_heap_o_reserve): Call vec_heap_o_reserve_1. + (vec_heap_p_reserve_exact): New function. + (vec_heap_o_reserve_exact): New function. + +2007-03-11 Roger Sayle + Andrew Pinski + + PR middle-end/30433 + * fold-const.c (fold_relational_const): Add back compile-time + evaluation of complex constant equality/inequality comparisons. + +2007-03-11 Ira Rosen + + PR tree-optimization/29925 + * tree-data-ref.c (analyze_offset): Add a return value (bool) to + indicate success/failure of the analysis. Add negation to subtrahend + in case of subtraction. Fail if both operands contain constants. + (create_data_ref): Fail if analyze_offset fails. + +2007-03-10 Mark Mitchell + + PR c++/30924 + * tree.c (walk_type_fields): Recurse into the element type of + ARRAY_TYPEs if there is a pointer set. + +2007-03-09 John David Anglin + + * pa.c (attr_length_call): Revise condition for long pc-relative branch. + (output_call): Use "LONG_PIC_SDIFF" instruction sequence for long local + calls on the SOM target. Don't use "LONG_PIC_PCREL" call sequence on + SOM target. + +2007-03-09 Richard Henderson + + PR target/26090 + * target.h (targetm.asm.out.reloc_rw_mask): New. + * target-def.h (TARGET_ASM_RELOC_RW_MASK): New. + (TARGET_ASM_OUT): Use it. + * targhooks.c, targhooks.h (default_reloc_rw_mask): New. + * varasm.c (categorize_decl_for_section): Remove shlib argument; + use the new reloc_rw_mask target hook instead. + (default_section_type_flags_1): Merge into... + (default_section_type_flags): ... here. + (decl_readonly_section_1): Merge into... + (decl_readonly_section): ... here. + (default_elf_select_section_1): Merge into... + (default_elf_select_section): ... here. + (default_unique_section_1): Merge into... + (default_unique_section): ... here. + (compute_reloc_for_rtx_1, compute_reloc_for_rtx): New. + (default_select_rtx_section): Use it. + (default_elf_select_rtx_section): Likewise. + * output.h: Update to match. + * doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New. + * config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New. + (TARGET_ASM_RELOC_RW_MASK): New. + * config/i386/i386.c (x86_64_elf_select_section): Adjust call + to categorize_decl_for_section. + (x86_64_elf_unique_section): Likewise. + * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, + TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove. + (TARGET_ASM_RELOC_RW_MASK): New. + * config/ia64/ia64.c (ia64_rwreloc_select_section, + ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove. + (ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New. + (TARGET_RWRELOC): Remove. + (ia64_section_type_flags): Adjust call to default_section_type_flags. + * config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. + * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove. + (rs6000_elf_select_section, rs6000_elf_unique_section): Remove. + (rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New. + (rs6000_xcoff_select_section): Use decl_readonly_section. + (rs6000_xcoff_section_type_flags): Use default_section_type_flags. + * config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. + (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove. + (TARGET_SECTION_TYPE_FLAGS): Remove. + * config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New. + +2007-03-08 Geoffrey Keating + + PR 31013 + * gccspec.c (lang_specific_driver): Do nothing when NEXT_OBJC_RUNTIME + is declared. + * config/darwin.h (REAL_LIBGCC_SPEC): When -fgnu-runtime is + passed, use shared libgcc. + +2007-03-09 Alexandre Oliva + + PR rtl-optimization/30643 + * cse.c (cse_insn): Recompute dest_hash after insert_regs for + dest_addr_elt. + +2007-03-09 Andrew Pinski + + PR tree-opt/30045 + * tree-vrp.c (nonnull_arg_p): Treat the static decl as always + non null. + +2007-03-09 Andrew Pinski + + PR middle-end/30729 + * stmt.c (warn_if_unused_value): VA_ARG_EXPR has side + effects unknown to this function, return early. + +2007-03-09 Andrew Pinski + + PR tree-opt/28624 + * tree-ssa-dom.c (eliminate_degenerate_phis): Use a temporary + bitmap for EXECUTE_IF_SET_IN_BITMAP. + +2006-03-09 Mark Shinwell + Andrew MacLeod + PR tree-optimization/29877 + * tree-outof-ssa.c (check_replaceable): Don't allow TER to replace + an expression if the RHS is a register variable. + +2007-03-08 Andrew Pinski + + PR C/31072 + * c-decl.c (merge_decls): Don't call make_var_volatile. + * varasm.c (make_var_volatile): Remove. + * output.h (make_var_volatile): Remove. + +2007-03-08 Kaveh R. Ghazi + + * builtins.def (lceil, lceilf, lceill, lfloor, lfloorf, lfloorl, + llceil, llceilf, llceill, llfloor, llfloorf, llfloorl): Mark with + ATTR_CONST_NOTHROW_LIST. + + * fold-const.c (tree_expr_nonnegative_p): Handle FIX_TRUNC_EXPR. + +2007-03-08 Andrew Pinski + + PR target/30406 + * config/rs6000/rs6000.c (rs6000_function_value): Look at bit size + instead of precision. + +2007-03-08 Volker Reichelt + + PR c++/30852 + * c-common.c (fold_offsetof_1): Handle COMPOUND_EXPR. + +2007-03-07 Manuel Lopez-Ibanez + + * c.opt (Waddress): New. + * common.opt (Walways-true): Delete. + (Wstring-literal-comparison): Delete. + * doc/invoke.texi (Warning Options): Delete -Walways-true and + -Wstring-literal-comparison. Add -Waddress. + (Waddress): New. + (Walways-true): Delete. + (Wstring-literal-comparison): Delete. + * doc/extend.texi (#pragma GCC diagnostic): Use -Wformat + consistently instead of -Walways-true in example. + * c-opts.c (c_common_handle_option): -Waddress is enabled by -Wall. + * c-typeck.c (parser_build_binary_op): Replace + -Wstring-literal-comparison and -Walways-true with -Waddress. + (build_binary_op): Likewise. + * c-common.c (c_common_truthvalue_conversion): Likewise. + +2007-03-07 Richard Henderson + + PR target/30848 + * reg-stack.c (emit_swap_insn): If a malformed asm was seen, + silently fix up the stack in the case of a missing register. -2004-01-18 Joseph S. Myers +2007-03-06 David Daney - * doc/contrib.texi, doc/cppenv.texi, doc/extend.texi, - doc/install.texi, doc/invoke.texi, doc/tm.texi: Consistently use - "GNU/Linux" and "Microsoft Windows" terminology. + * doc/install.texi (mips-*-*): Change recommended binutils + version. -2004-01-18 Joseph S. Myers +2007-03-06 Manuel Lopez-Ibanez - * doc/c-tree.texi, doc/compat.texi, doc/cpp.texi, - doc/cppopts.texi, doc/extend.texi, doc/install.texi, - doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi, - doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use - @smallexample instead of @example. + * doc/invoke.texi (Warning Options): Replace -Werror- with + -Werror=. + * opts.c (common_handle_option): Likewise. -2004-01-17 Ziemowit Laski +2007-03-06 Anatoly Sokolov - * objc/objc-act.c (build_objc_method_call): Use target - hooks instead of macros to determine if ..._stret - dispatchers should be used (NeXT runtime only). + * config/avr/avr.c (avr_mcu_types): Add support for ATmega325P, + ATmega3250P, ATmega329P, ATmega3290P, AT90USB82 and AT90USB162 + devices. + * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.). + * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.). -2004-01-17 Daniel Jacobowitz +2007-03-06 Roger Sayle - * rtl.h (emit_insn_before_sameloc, emit_jump_insn_before_sameloc) - (emit_call_insn_before_sameloc, emit_insn_after_sameloc) - (emit_jump_insn_after_sameloc, emit_call_insn_after_sameloc): New - macros. - * reload1.c (emit_reload_insns): Use them. - * emit-rtl.c (emit_insn_before_sameloc, emit_insn_after_sameloc) - (emit_jump_insn_after_sameloc, emit_call_insn_after_sameloc): Check - for NULL PATTERN. + PR middle-end/30744 + * fold-const.c (fold_binary) : Enforce type consistency + when transforming ~X op C to X op' ~C. -2004-01-17 Daniel Jacobowitz +2007-03-05 John David Anglin - * final.c (SEEN_BB, SEEN_NOTE, SEEN_EMITTED): Define. - (final_scan_insn): Update to take an additional SEEN argument. Emit - a line note after the prologue. Make static. - (line_note_exists): Remove. - (final): Don't initialize line_note_exists. Update call to - final_scan_insn. - * output.h (final_scan_insn): Remove prologue. - * function.c (set_insn_locators): Update comment. - (thread_prologue_and_epilogue_insns): Add a comment. - -2004-01-17 Joseph S. Myers - - * doc/invoke.texi, doc/standards.texi: Point to 3.4 version of - c99status.html. - -2004-01-17 Andrew Pinski - - PR target/10781 - * config/rs6000/rs6000-protos.h (rs6000_special_round_type_align): - Prototype. - * config/rs6000/rs6000.c (rs6000_special_round_type_align): - New function. - * config/rs6000/linux64.h (ROUND_TYPE_ALIGN): Use it. - * config/rs6000/aix.h (ROUND_TYPE_ALIGN): Likewise. - * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Likewise. - -2004-01-17 Jan Hubicka - - * toplev.c (rest_of_handle_reorder_blocks): Fix pasto in previous - commit. - - * toplev.c (HAVE_conditional_execution): Provide default. - (rest_of_handle_reorder_blocks): For conditional_execution target - update liveness once after all transformations - (rest_of_compilation): Do crossjumping before ce3. - -2004-01-17 J. Brobecker - - * dwarf2out.c (is_subrange_type): Renamed from is_ada_subrange_type(). - Remove checks for is_ada() and TREE_UNSIGNED. - (subrange_type_die): Emit a byte_size attribute if the subrange - type size is different from the base type size. - (modified_type_die): Replace call to is_ada_subrange_type() by - call to is_subrange_type(). - -2004-01-16 Mark Mitchell - - * configure.ac: Do not do internal checking or -Werror by default. - * configure: Regenerated. - - * doc/include/gcc-common.texi (DEVELOPMENT): @clear it. - * version.c (version_string): Mark as prerelease. - -2004-01-16 Andrew Pinski - - * config/sh/sh.c: Include ggc.h. - -2004-01-17 Jan Hubicka - - * c-common.c (c_estimate_num_insns_1): Handle builtin_constant_p and - builtin_expect specially. - * params.def (PARAM_MAX_INLINE_INSNS_AUTO): Set to 100. - (PARAM_LARGE_FUNCTION_INSNS): Set to 3000. - * invoke.texi (max-inline-insns-single): Set to 100. - (large-function-insns): Set to 3000. - -2004-01-16 Jan Hubicka - - * i386.md (load_tp_di): Fix pasto. - - PR opt/13608 - * i386.c (ix86_compute_frame_layout): Fix for alloca on leaf function. - - * c-pretty-print.c (pp_c_type_cast, pp_c_abstract_declarator, - pp_c_character_constant, pp_c_floating_constant, - pp_c_additive_expression, pp_c_shift_expression, - pp_c_equality_expression, pp_c_and_expression, - pp_c_exclusive_or_expression, pp_c_inclusive_or_expression, - pp_c_logical_and_expression): Remove inline modifier. - * dwarf2out.c (get_AT): Likewise. - * et-forest.c (et_splay): Likewise. - * ra.h (ra_alloc, ra_calloc): Likewise - -2004-01-16 Kazu Hirata - - * config/frv/frv-protos.h: Fix comment formatting. - * config/frv/frv.c: Likewise. - * config/frv/frv.h: Likewise. - * config/frv/frv.md: Likewise. - * config/frv/frvbegin.c: Likewise. - * config/frv/frvend.c: Likewise. - -2004-01-16 Kazu Hirata - - * system.h (LINKER_DOES_NOT_WORK_WITH_DWARF2): Poison. - * doc/tm.texi (PREFERRED_DEBUGGING_TYPE): Don't mention - LINKER_DOES_NOT_WORK_WITH_DWARF2. - (LINKER_DOES_NOT_WORK_WITH_DWARF2): Remove. - -2004-01-16 J"orn Rennecke - - PR 11864 - * postreload.c (reload_cse_simplify_operands): Don't remove - implicit extension from LOAD_EXTEND_OP. - -2004-01-16 Jan Hubicka - - PR opt/11350 - * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal - after reload. - * cfgrtl.c (rtl_can_merge_blocks, cfglayout_can_merge_blocks, - rtl_try_redirect_by_replacing_branch): Likewise. - -2004-01-15 Geoffrey Keating - - PR pch/13689 - * alias.c (struct alias_set_entry): Mark for GC. - (alias_sets): Make static, mark for GC. - (record_alias_subset): Use GC to allocate alias structures. - * varray.c (element): Make generic varrays GCed. - - PR pch/13361 - * c-typeck.c (constructor_asmspec): Delete. - (struct initializer_stack): Delete field 'asmspec'. - (start_init): Delete saving of asmspec. - (finish_init): Don't update constructor_asmspec. - * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. - * stmt.c (expand_asm): Duplicate strings from tree. - (expand_asm_operands): Likewise. - * tree.c (tree_size): Update computation of size of STRING_CST. - (make_node): Don't make STRING_CST nodes. - (build_string): Allocate string with tree node. - * tree.def (STRING_CST): Update comment. - * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. - (tree_string): Place contents of string in tree node. - * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string - from tree. - - * config/rs6000/rs6000.c (rs6000_va_arg): No need to special-case - altivec operands. - -2004-01-15 Kazu Hirata - - * c-common.h: Fix comment formatting. - * c-cppbuiltin.c: Likewise. - * c-pragma.c: Likewise. - * calls.c: Likewise. - * collect2.c: Likewise. - * cppcharset.c: Likewise. - * cpptrad.c: Likewise. - * dbxout.c: Likewise. - * defaults.h: Likewise. - * dwarf2out.c: Likewise. - * fold-const.c: Likewise. - * genautomata.c: Likewise. - * genconditions.c: Likewise. - * genflags.c: Likewise. - * gengtype.c: Likewise. - * integrate.c: Likewise. - * loop.c: Likewise. - * predict.c: Likewise. - * sdbout.c: Likewise. - -2004-01-15 Zack Weinberg - - * config/ia64/ia64.md (*movti_internal): C output template - extracted to ia64.c. - (*movti_internal_reg): Delete. - (reload_inti, reload_outti): Use the correct mode on operand 2 - in the first place, don't fix it up in the output template. - (movtf, reload_ointf, reload_outtf): New expanders. - (*movtf_internal): New define_insn_and_split. - * config/ia64/ia64.c (ia64_split_timode): Rename to ia64_split_tmode; - make static; do not hand TFmode CONST_DOUBLEs to split_double. - (ia64_split_tmode_move): New function, body mostly pulled - from ia64.md:*movti_internal. - (ia64_function_arg_words): New function, extracted common - logic from ia64_function_arg et seq. - (ia64_function_arg_offset): Likewise. Handle correctly the - case of a scalar quantity 16 bytes wide with only 8-byte alignment. - (ia64_function_arg, ia64_function_arg_partial_nregs) - (ia64_function_arg_advance): Use ia64_function_arg_words and - ia64_function_arg_offset. - (ia64_function_value): TCmode does not go in float regs. - (ia64_secondary_reload_class): Also handle TFmode. - * config/ia64/ia64-protos.h: Remove prototype for - ia64_split_timode; add prototype for ia64_split_tmode_move. - -2004-01-15 Kelley Cook - - * Makefile.in (MAINT): Make it an immediate assignment. - -2004-01-15 Kazu Hirata - - * config/m32r/m32r.md: Remove useless calls to gen_lowpart. - -2004-01-15 Kazu Hirata - - * config/h8300/coff.h: Replace Hitachi with Renesas. - * config/h8300/elf.h: Likewise. - * config/h8300/h8300-protos.h: Likewise. - * config/h8300/h8300.c: Likewise. - * config/h8300/h8300.h: Likewise. - * config/h8300/h8300.md: Likewise. - * config/h8300/lib1funcs.asm: Likewise. - -2004-01-15 Andrew Pinski - - * config/rs6000/rs6000.c (uses_TOC): Wrap #if TARGET_ELF - around it. - -2004-01-15 Kazu Hirata - - * config/h8300/h8300.c (h8300_return_in_memory): New. - (TARGET_STRUCT_VALUE_RTX): Likewise. - (TARGET_RETURN_IN_MEMORY): Likewise. - * config/h8300/h8300.h (STRUCT_VALUE): Remove. - (RETURN_IN_MEMORY): Likewise. - -2004-01-15 Richard Earnshaw - - PR optimization/13375 - * gcse.c (handle_avail_expr): Just return if the source is not a - single set. - -2004-01-15 Richard Earnshaw - Daniel Jacobowitz - - * arm/lib1funcs.asm (ARM_FUNC_START): Correct interworking case. - (EQUIV): Define. - (ARM_FUNC_ALIAS): New macro. - * arm/ieee754-df.S (gedf2, ledf2, nedf2, eqdf2): Use it. - * arm/ieee754-sf.S (gesf2, lesf2, nesf2, eqsf2): Use it. - -2004-01-15 John David Anglin - - PR optimization/12372 - * calls.c (expand_call): Add call_fusage data for stack arguments in - constant calls. - -2004-01-15 Alan Modra - - * config/rs6000/rs6000.c (uses_TOC): Correct comment. Make static. - (rs6000_elf_declare_function_name): Formatting. - * config/rs6000/rs6000-protos.h (uses_TOC): Remove declaration. - -2004-01-15 Jan Hubicka - - PR bootstrap/13692 - * sched-deps.c (sched_analyze_1, sched_analyze_2): Fix thinko in - previous patch. - -2004-01-15 Richard Henderson - - * config/alpha/alpha.h (REG_ALLOC_ORDER): Reorder fp regs after - integer regs of the same call-savedness. - -2004-01-15 Andreas Schwab - - PR bootstrap/13562 - * config/m68k/m68k.c (output_move_const_into_data_reg): Clear cc - status for NOTB/NOTW/NEGW methods. - -2004-01-15 Kazu Hirata - - * doc/invoke.texi: Update dump file names. Fix a typo. - -2004-01-15 Kazu Hirata - - * builtins.c (expand_builtin_va_end): Don't use - EXPAND_BUILTIN_VA_END. - * system.h (EXPAND_BUILTIN_VA_END): Poison. - * config/d30v/d30v.h: Remove a commented-out definition of - EXPAND_BUILTIN_VA_END. - * config/stormy16/stormy16.h: Likewise. - -2004-01-15 Kazu Hirata - - * system.h (STRUCT_VALUE_INCOMING_REGNUM): Poison. - * targhooks.c (default_struct_value_rtx): Don't use - STRUCT_VALUE_INCOMING_REGNUM. - -2004-01-15 Kelley Cook - - PR bootstrap/12744 - * configure.in: Revamp enable-generated-files-in-srcdir rule to define - GENINSRC and not parsedir. Define srcextra as a langhook. - * configure: Regenerate. - * Makefile.in: Suppress default .l.c rule. Don't substitute - parsedir and delete all references throughout. Conditionally define - rule for srcextra dependent on GENINSRC. - (stmp-docobjdir): Delete. - (c-parse.o, gengtype-lex.o, gengtype-yacc.o): Use implicit build rule. - (srcextra): Copy c-parse.y, c-parse.c, gengtype-lex.c, gengtype-yacc.c, - and gengtype-yacc.h back to source directory. - (maintainer-clean): Delete all parse files in source directory. - (distclean): Delete generated files. - - * objc/Make-lang.in (objc-parse.o): Use implicit build rule. - (objc-parse.c, objc-parse.y): Don't use parsedir. - (objc.srcextra): Copy objc-parse.y and objc-parse.c back to source - directory if requested. - (po-generated): Don't use parsedir. - (objc.maintainer-clean): Delete above files from source directory. - -2004-01-14 Kazu Hirata - - * doc/tm.texi (FUNCTION_VALUE): Fix a typo. - -2004-01-14 Kazu Hirata - - * doc/tm.texi: Replace RETURN_IN_MEMORY with - TARGET_RETURN_IN_MEMORY. - -2004-01-15 Jan Hubicka - - * builtins.c (std_expand_builtin_va_arg): Align operand when needed. - * i386.c (init_cumulative_args): Set warn_sse; fix handling of variadic - functions accepting SSE arguments - (function_arg): Warn only when asked to warn. - * i386.h (ix86_args): Add warn_sse/warn_mmx fiels. - -2004-01-14 Joseph S. Myers - - * c-parse.in (stmts_and_decls): Make label at end of compound - statement a hard error. - -2004-01-14 Jan Hubicka - - * cgraph.c (create_edge): Use local.redefined_extern_inline. - * cgraph.h (cgraph_local_info): Sort fields by size; add - redefined_extern_inline - (cgraph_global_info): Sort fields by size. - (cgraph_node): Likewise. - * cgraphunit.c (cgraph_finalize_function): Se - local.redefined_extern_inline on redefinition. - (cgraph_analyze_function): Use it; fix formating. - -2004-01-14 Jan Hubicka - - PR c++/10776 - * sched-deps.c (trye_dependency_cache, anti_dependency_cache, - outptu_dependency_cache, forward_dependency_cahe): Trun to vectors of - bitmaps - (cache_size): New variable - (add_dependence): Update use; canonize early memory locations - (sched_analyze_1): Likewise. - (sched_analyze_2): Likewise. - (init_dependency_caches): Initialize bitmaps. - (free_dependency_caches): Free bitmaps - -2004-01-14 Kazu Hirata - - * calls.c: Replace STRICT_ARGUMENT_NAMING in comments with - targetm.calls.strict_argument_naming(). - * target.h: Likewise. - -2004-01-14 Richard Henderson - - PR debug/13231 - * dwarf2out.c (dwarf2out_stack_adjust): Skip prologue and epilogue - instructions. - -2004-01-14 Richard Henderson - - PR c++/12491 - * except.c (struct eh_region): Add u.fixup.resolved. - (resolve_one_fixup_region): Split out from ... - (resolve_fixup_regions): ... here. - -2004-01-14 Kazu Hirata - - * config/mn10300/mn10300.h (STRUCT_VALUE): Change to 0. - -2004-01-14 Kazu Hirata - - * config/alpha/alpha.h (STRUCT_VALUE): Remove. - * config/alpha/vms.h (STRUCT_VALUE_REGNUM): Remove #undef. - (STRUCT_VALUE): Remove. - -2003-01-14 Steven Bosscher - - * system.h: Poison PROMOTED_MODE - * integrate.c (expand_inline_function): Don't mention the - PROMOTED_MODE. - * loop.c (update_giv_derive): Same. - * tree.h (DECL_RTL): Same. - -2004-01-14 J"orn Rennecke - - PR target/9365 - * sh.c (gen_block_redirect): Add special handling of RETURN. - (gen_far_branch) Don't call gen_stuff_delay_slot if there is no - far branch target (i.e. it's a return). - -2004-01-14 Kazu Hirata - - * regrename.c (find_oldest_value_reg): Fix a warning. - -2004-01-14 Richard Earnshaw - - PR bootstrap/12527 - * config.gcc (arm*-*-linux*): Don't include unknown-elf.h in tm_file. - Move linux-gas.h and linux-elf.h before aout.h. - * arm/arm.h (INITIALIZE_TRAMPOLINE): Only define if not already. - * arm/linux-elf.h (SUBTARGET_CPU_DEFAULT): Define. - -2004-01-14 Kazu Hirata - - * config/m32r/m32r.md: Use GEN_INT instead of gen_rtx - (CONST_INT, VOIDmode, ...). - -2004-01-14 Richard Earnshaw - - * regrename.c (find_oldest_value_reg): If the replacement uses - multiple hard registers, check that all of them are in CLASS. - -2004-01-14 Jan Hubicka - - * alias.c (get_alias_set): Initialize alias set to 0 when subset is - impossible. - -2004-01-14 Kelley Cook - - * Makefile.in: Define MAINT from --enable-maintainer-mode. - -2004-01-14 Hartmut Penner - - * gcc/config/rs6000/rs6000.c (rs6000_stack_info) - Calculate always vrsave_mask if TARGET_ALTIVEC. - (rs6000_emit_prologue): Emit code for vrsave - only if TARGET_ALTIVEC_VRSAVE. - (rs6000_emit_epilogue): Likewise. - -2004-01-14 Eric Botcazou - - * config/sparc/sparc.md (tie_add32): Fix pasto. - (tie_add64): Likewise. - -2004-01-14 Zdenek Dvorak - - * config/i386/i386.md (*addqi_1_slp): Do not access operands[2]. - -2004-01-13 Kazu Hirata - - * config/iq2000/iq2000-protos.h: Fix comment formatting. - * config/iq2000/iq2000.c: Likewise. - * config/iq2000/iq2000.md: Likewise. - -2004-01-14 J. Brobecker - - * dwarf2out.c (is_ada_subrange_type): No longer check the TYPE_NAME. - (subrange_type_die): Add handle for nameless subrange types. - -2004-01-13 Kazu Hirata - - * config/h8300/h8300-protos.h: Replace do_movsi with - h8300_expand_movsi. - * config/h8300/h8300.c (do_movsi): Change to - h8300_expand_movsi. - * config/h8300/h8300.md (movsi): Replace do_movsi with - h8300_expand_movsi. + * pa.md: In unamed move patterns, disparge copies between general + and floating point registers using '?' modifier. Don't include 'f' + constraint for register preferences in DImode, SImode, HImode and + QImode patterns. Likewise for 'r' in DFmode and SFmode patterns. + Remove constraints for copies between general and floating registers + in soft-float DFmode pattern. + (movdf): Fail if operand1 is a CONST_DOUBLE and operand0 is a hard + floating register. (movsf): Likewise. -2004-01-13 Kazu Hirata +2007-03-05 Kaveh R. Ghazi - * config/h8300/h8300.c (dosize): Change to - h8300_emit_stack_adjustment. Update callers. + * convert.c (convert_to_integer): Fix nearbyint/rint -> *lrint + conversion. -2004-01-13 Kazu Hirata +2007-03-05 Steve Ellcey - * config/h8300/h8300.md (movstrictqi): Add an alternative with - the source being post_inc. Tighten the predicate for the - destination to register_operand. - (movstricthi): Likewise. + Backported from mainline + PR debug/29614 + * cgraph.h (cgraph_varpool_last_needed_node): Make global. + * cgraph.c (cgraph_varpool_last_needed_node): Ditto. + * cgraphunit.c (cgraph_varpool_assemble_pending_decls): + Set cgraph_varpool_last_needed_node to NULL. -2004-01-13 Kazu Hirata +2007/03/05 David Taylor - * system.h (SHARED_BSS_SECTION_ASM_OP): Poison. - * varasm.c (bss_section): Don't use SHARED_BSS_SECTION_ASM_OP. - * doc/tm.texi (SHARED_BSS_SECTION_ASM_OP): Remove. + PR 31050 + * gcc.c: Correct copyright date in --version output. -2004-01-14 Jan Hubicka +2007-03-05 Brooks Moses - Partial fix PR c++/12850 - * cgraphunit.c (cgraph_finalize_function): Always ggc_collect when - at zero nest level. + * c.opt: Remove -ffixed-form, -ffixed-line-length-none, and + -ffixed-line-length-* options. -2004-01-13 Bernardo Innocenti +2007-03-05 David Edelsohn - * config/m68k/netbsd-elf.h (REGISTER_NAMES): Add missing "argptr" - pseudo-register. + * config/rs6000/t-ppccomm: Always build libgcc2 for GNU/Linux + with -mlong-double-128, except SPE. -2004-01-13 Devang Patel -2004-01-13 Andrew Pinski + * config/rs6000/darwin-ldouble.c: Build file for SOFT_FLOAT. + (strong_alias): Define. + (__gcc_qmul): Provide non-FMA for soft-float. + (__gcc_qdiv): Same. + (__gcc_qneg): New. + (__gcc_qeq): New. + (__gcc_qle): New. + (__gcc_qge): New. + (__gcc_qunord): New. + (__gcc_stoq): New. + (__gcc_dtoq): New. + (__gcc_qtos): New. + (__gcc_qtod): New. + (__gcc_qtoi): New. + (__gcc_qtou): New. + (__gcc_itoq): New. + (__gcc_utoq): New. + (fmsub): New. + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Initialize + soft-float functions. + * config/rs6000/libgcc-ppc-glibc.ver: Version soft-float symbols. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Do not warn + about long double soft float. - PR c++/12709 - * c-common.c (finish_fname_decls): Use the chain only if the - tree is an expr_stmt. +2007-03-05 Richard Guenther -2004-01-13 Vladimir Makarov + Backport from mainline: + 2007-02-28 Richard Guenther - * rtl.def: Add comment about new option in automata_option. + PR middle-end/30364 + * fold-const.c (fold_binary): Do not associate expressions + with more than one variable for integer types that do not wrap. - * genautomata.c (PROGRESS_OPTION): New macro. - (progress_flag): New global variable. - (gen_automata_option): Process `progress'. - (transform_insn_regexps, check_unit_distributions_to_automata, - make_automaton, NDFA_to_DFA, build_automaton, create_automata, - expand_automata, write_automata): Print about the progress only if - progress_flag. Remove fflush. - (initiate_automaton_gen): Process command line flag `-progress'. +2007-03-04 Eric Botcazou - * doc/md.texi: Describe the new option. + PR ada/26797 + * doc/invoke.texi (-O2): Document that Tree-VRP is not turned on + for the Ada compiler. -2004-01-13 Zdenek Dvorak +2007-03-02 Zdenek Dvorak - * cfg.c (dump_bb): Dump entry edges. + PR tree-optimization/29902 + * tree-ssa-loop-manip.c (can_unroll_loop_p): Return false if + any involved ssa name appears in abnormal phi node. -2004-01-13 Richard Earnshaw +2007-03-02 Eric Botcazou - * arm.c (thumb_legitimate_address_p): Only allow constant pool - references from SImode. - * arm.md (thumb_movhi_insn): Don't allow minipool references. + * tree-sra.c (sra_walk_fns) : Document new restriction. + (sra_walk_modify_expr) : Treat the reference as a use + if the lhs has side-effects. + : Treat the reference as a use if the rhs has side-effects. -2004-01-13 Kazu Hirata +2007-03-02 Paul Brook - * system.h (TEXT_SECTION): Poison. - * varasm.c (text_section): Don't use TEXT_SECTION. - * config/sh/sh.c (sh_file_start): Fix a comment typo. - * doc/tm.texi (TEXT_SECTION): Remove. + * config/arm/arm.c (arm_legitimate_index_p): Limit iWMMXt addressing + modes to LDRD for DImode. + (output_move_double): Fixup out of range ldrd/strd. + (vfp_secondary_reload_class): Rename... + (coproc_secondary_reload_class): ... to this. Add wb argument. + * config/arm/arm.h (SECONDARY_OUTPUT_RELOAD_CLASS): Use + coproc_secondary_reload_class for CLASS_IWMMXT. + (SECONDARY_INPUT_RELOAD_CLASS): Ditto. + * arm-protos.h (coproc_secondary_reload_class): Update prototype. -2004-01-13 Ben Elliston +2007-03-02 Eric Botcazou - * doc/rtl.texi (Vector Operations): Remove defunct vec_const item. + * config/alpha/alpha.c (alpha_gp_save_rtx): Insert the insns at the + entry by means of emit_insn_at_entry. -2004-01-12 James E Wilson +2007-03-01 Manuel Lopez-Ibanez - * unwind-libunwind.c: Delete. + * doc/invoke.texi (Wextra): Delete outdated paragraph. -2004-01-12 Zack Weinberg +2007-02-27 John David Anglin - PR 13656 - * c-decl.c (diagnose_mismatched_decls): Whenever newtype or - oldtype is set, set *newtypep or *oldtypep too. Do not set - them at the very end. - (validate_proto_after_old_defn): Restructure for comprehensibility; - make error messages clearer. + * pa/predicates.md (move_src_operand): Allow zero for mode. + * pa/pa.md: Fix constraints for zero CONST_DOUBLE in 64-bit DFmode + move pattern. -2004-01-12 Zack Weinberg +2007-02-27 Mike Stump - * varray.h (VARRAY_POP): Add checking variant, aborts on underflow. - (VARRAY_TOP): Use VARRAY_CHECK so the access is bounds-checked. - * varray.c: No need to prototype error. - (varray_check_failed): Wrap long string onto two lines. - (varray_underflow): New function. + * config/darwin-crt3.c: Avoid compilation when compiling for a + kext multilib. -2004-01-13 Steven Bosscher +2007-02-27 Andreas Schwab - PR c++/13376 - * function.h (struct function): Kill `name' field. - (current_function_name): Make it an extern function. - * function.c (current_function_name): New function. - * graph.c: Update all uses of current_function_name. - * gcse.c: Likewise. - * config/alpha/alpha.c, config/avr/avr.c, config/c4x/c4x.c, - config/mips/mips.c, config/pdp11/pdp11.c: Likewise. - * config/ip2k/ip2k.c (function_prologue): Use MAIN_NAME_P - instead of a strcmp with "main". + * Makefile.in (TEXI_GCCINSTALL_FILES): Add gcc-common.texi. -2004-01-13 Jan Hubicka +2007-02-26 Brooks Moses - * c-decl.c (diagnose_mismatched_decls): Fix warning calls. + * Makefile.in (TEXI_GCCINSTALL_FILES): Add gcc-vers.texi dependency. - * cgraphunit.c (cgraph_optimize_function): Always do - optimize_inline_calls when there is always_inline callee. - (cgraph_decide_inlining): Fix formating. - * tree-inline.c (inlinable_function_p): Do sorry for alwaysinline - functions. - (expand_call_inline): Likewise. - * toplev.h (sorry): Fix prototype. +2007-02-26 Brooks Moses -2004-01-12 Roger Sayle + * doc/include/gcc-common.texi (versionsubtitle): New macro. + * doc/cpp.texi: Standardize title page. + * doc/cppinternals.texi: Likewise. + * doc/gcc.texi: Standardize title page, remove version number + from copyright page. + * doc/gccint.texi: Likewise. + * doc/install.texi: Standardize title page, add table of + contents. - * builtins.c (expand_builtin_expect_jump): Simplify logic. Handle - conditional jumps that drop through to unconditional jumps or the - end of the sequence. +2007-02-24 Mike Stump -2004-01-13 Jan Hubicka + * config/i386/i386.c (output_pic_addr_const): Stubify optimized + symbols. - * alias.c (new_alias_set): Construct the alias_set varray. - (init_alias_once): Don't do it here. +2007-02-24 John David Anglin -2004-01-12 Marc Espie + * pa.md (muldi3): Force subregs to registers in 64-bit expander. - * system.h: handle YYBYACC like YYBISON. +2007-02-23 Mike Stump -2004-01-12 Jonathan Merriman + * tlink.c (scan_linker_output): Parse linker messages from + darwin9's linker better. - PR target/10847 - * config.gcc: No longer includes conflicting header sparc/sol2.h when - building on sparc64-*-openbsd*. +2007-02-21 Ira Rosen -2004-01-12 Andrew Pinski + * tree-ssa-alias.c: Include pointer-set.h + * Makefile.in (tree-ssa-alias.o): Depend on pointer-set.h. - PR debug/13539 - * dbxout.c (dbxout_type): Protected inheritance is not - private but protected. +2007-02-21 Jakub Jelinek -2004-01-12 Richard Sandiford + Backported from mainline + 2006-12-20 Andrew Pinski + PR middle-end/30143 + * omp-low.c (init_tmp_var): New function. + (save_tmp_var): New function. + (lower_omp_1): Use them for VAR_DECL. - * config/mips/mips.c (mips_symbolic_constant_p): Revert last patch. +2007-02-20 Alan Modra -2004-01-12 Kazu Hirata + PR target/29943 + * varasm.c (use_blocks_for_decl_p): Return false for decls with + alias attribute. - PR optimization/12508. - * combine.c (try_combine): Remove a dead set in a parallel - even if its destination is a subreg. +2007-02-19 Eric Botcazou + + * gimplify.c (gimplify_init_ctor_preeval_1): Detect potential overlap + due to calls to functions taking pointers as parameters. + +2007-02-19 Richard Henderson + + PR debug/29558 + * var-tracking.c (track_expr_p): Disallow AGGREGATE_TYPE_P + in memory. + +2007-02-18 Eric Botcazou + + * tree-eh.c (tree_could_trap_p): Handle VIEW_CONVERT_EXPR. + +2007-02-18 Eric Botcazou + + * calls.c (mem_overlaps_already_clobbered_arg_p): Return true + for arg pointer based indexed addressing. + +2007-02-18 Ira Rosen + + * tree-ssa-alias.c (may_aliases_intersect): New function. + * tree-data-ref.c (ptr_ptr_may_alias_p): Call may_aliases_intersect + for different tags. + * tree-flow.h (may_aliases_intersect): Add function declaration. + +2007-02-17 Alexandre Oliva + + PR tree-optimization/30823 + * tree-sra.c (sra_build_assignment): Drop type-checking assert. + +2007-02-16 Ralf Wildenhues + + PR other/27843 + * Makefile.in (SYSTEM_HEADER_DIR): Use single quotes to avoid + nested double- and backquotes. + +2007-02-15 Alexandre Oliva + + * tree-sra.c (instantiate_missing_elements): Canonicalize + bit-field types. + (sra_build_assignment): New. + (generate_copy_inout, generate_element_copy, + generate_element_zero, generate_one_element_init): Use it. + +2007-02-15 Kaz Kojima + + PR rtl-optimization/29599 + Backport from mainline. + * reload1.c (eliminate_regs_in_insn): Take the destination + mode into account when computing the offset. + +2007-02-13 Joseph S. Myers + + * doc/invoke.texi, doc/standards.texi: Refer to + gcc-4.2/c99status.html. + +2007-02-10 John David Anglin + + PR target/30634 + * pa.md (movdf): For 64-bit target, fail if operand 1 is a non-zero + CONST_DOUBLE and operand 0 is a hard register. + (movdi): For 64-bit target, remove code to force CONST_DOUBLE to + memory. Fail if operand 1 is a non-zero CONST_INT and operand 0 + is a hard floating-point register. + +2007-02-06 Mark Mitchell + + PR target/29487 + * tree.h (DECL_REPLACEABLE_P): New macro. + * except.c (set_nothrow_function_flags): Likewise. + +2007-02-07 Jakub Jelinek + + PR c++/30703 + * gimplify.c (gimplify_scan_omp_clauses): Remove special casing + of INDIRECT_REF . + +2007-02-06 Rask Ingemann Lamberisen + + PR 30370 + * config/rs6000/t-ppccomm: Correct Makefile typo. + +2007-02-06 Roger Sayle + + PR libgomp/28296 + Backport from mainline. + * config/darwin.h (CPP_SPEC): Handle -pthread, transforming + it into -D_REENTRANT. + +2007-02-05 Alexandre Oliva + + PR debug/30189 + * dwarf2out.c (modified_type_die): Follow DECL_ORIGINAL_TYPE + even if cv-qualification is the same. + +2007-02-05 Geoffrey Keating + + * config/rs6000/darwin-tramp.asm (__trampoline_setup): Call + __enable_execute_stack on completion. + +2007-02-05 Bob Wilson + + * config/xtensa/xtensa.c (constantpool_mem_p): Skip over SUBREGs. + +2007-02-02 Maxim Kuvyrkov + + PR target/29682 + * config/ia64/ia64.c (ia64_speculate_insn): Restrict to memory loads to + general or fp registers. Add comments. + * config/ia64/ia64.md (reg_pred_prefix): Add comment. + +2007-02-04 Richard Guenther + + Backport from mainline: + 2007-01-30 Richard Guenther + + PR middle-end/27657 + * dwarf2out.c (reference_to_unused): Query varpool if the + variable was output. + +2007-02-02 Mike Stump + + * config.gcc (*-*-darwin*): Backport darwin9.h bits. + * config/darwin9.h: Add. + * config/rs6000/rs6000.c (DARWIN_GENERATE_ISLANDS): Add. + (output_call): Use DARWIN_GENERATE_ISLANDS to decide when to + generate a branch island. + +2007-02-02 Hui-May Chang + + Revert for x86 darwin: + 2005-06-19 Uros Bizjak + + * config/i386/i386.c (ix86_function_arg_regno_p): Put back the + code before the following patch under TARGET_MACHO. + (ix86_function_value_regno_p): Likewise. + +2007-02-02 Simon Martin + + PR c++/28266 + * gimplify.c (gimplify_target_expr): Make sure that the TARGET_EXPR is + expanded only once even if an error occurs. + +2007-02-02 Jakub Jelinek + + PR middle-end/30473 + * builtins.c (fold_builtin_sprintf): Do not attempt to optimize + sprintf (str, "%s"). Do not optimize sprintf (str, "nopercent", p++). + +2007-02-01 Guy Martin + + * pa.md (tp_load): Correct mfctl instruction syntax. + +2007-02-01 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_stack_info): Correct + altivec_padding_size calculation on AIX. Improve comment, add + assert to verify that it's right. + +2007-01-31 Anatoly Sokolov + + PR target/19087 + * config/avr/avr.c (DWARF2_ADDR_SIZE): Define. + +2007-01-30 Richard Guenther + + PR middle-end/30313 + * passes.c (execute_one_pass): Reset in_gimple_form to not + confuse non-unit-at-a-time mode. + +2007-01-27 Anatoly Sokolov + + * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define __AVR_HAVE_MUL__. + +2007-01-29 Mike Stump + + * doc/gccint.texi (Top): Rename Loop Representation to Loop + Analysis and Representation to resolve case insensitive conflict. + * doc/loop.texi (Loop Analysis and Representation): Likewise. + +2007-01-29 Josh Conner + + PR middle-end/29683 + * calls.c (compute_argument_addresses): Set stack and stack_slot + for partial args, too. + (store_one_arg): Use locate.size.constant for the size when + generating a save_area. + +2007-01-28 Ralf Wildenhues + + * doc/sourcebuild.texi: Add comma for clarity. + * doc/extend.texi: Fix some typos. + * doc/passes.texi: Likewise. + * doc/cppinternals.texi: Likewise. + * doc/c-tree.texi: Likewise. + * doc/tree-ssa.texi: Likewise. + * doc/install.texi: Likewise. + +2007-01-26 Zdenek Dvorak + + PR tree-optimization/29516 + * tree-ssa-address.c (tree_mem_ref_addr, add_to_parts, + most_expensive_mult_to_index, addr_to_parts, + create_mem_ref, maybe_fold_tmr): Make the type of + fields of TARGET_MEM_REF sizetype. + (move_fixed_address_to_symbol, move_pointer_to_base, + aff_combination_remove_elt): New functions. + * tree.def (TARGET_MEM_REF): Add comment on types of + the operands. + * gcc.dg/tree-ssa/loop-20.c: New test. + +2007-01-25 Geoffrey Keating + + PR 25127 + * config/rs6000/rs6000.c (first_altivec_reg_to_save): On Darwin, + save Altivec registers in an eh_return function. + (compute_vrsave_mask): Likewise. + (rs6000_stack_info): Correct AIX/Darwin stack alignment computation + for saving Altivec registers. + (rs6000_emit_prologue): Don't allocate stack twice in + eh_return function. Correct expected value of altivec_save_offset + when using save_world. Describe save of R0 to stack when using + save_world. Describe stack pointer adjustment when using + save_world. Remove duplicated eh_return parameter register saving. + Update sp_offset variable after save_world. + * config/rs6000/t-darwin (LIB2FUNCS_STATIC_EXTRA): Remove + darwin-world.asm. + (LIB2FUNCS_EXTRA): Add darwin-world.asm. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): -m64 + implies Altivec. + +2007-01-24 Geoffrey Keating + + * unwind-dw2.c (execute_stack_op): Handle DW_OP_swap. + +2007-01-24 Jakub Jelinek + + PR middle-end/27416 + * gimplify.c (omp_check_private): New function. + (gimplify_scan_omp_clauses): Use it for + firstprivate/lastprivate/reduction. + + PR middle-end/30494 + * gimplify.c (omp_add_variable): Don't call omp_notice_variable + on TYPE_SIZE_UNIT for GOVD_LOCAL VLAs. + + PR middle-end/30421 + * omp-low.c (lower_omp_for_lastprivate): Add dlist argument. + If lower_lastprivate_clauses emits some statements, append them + to dlist rather than body_p and to body_p append an initializer. + (lower_omp_for): Adjust caller. + +2007-01-21 Eric Botcazou + + PR rtl-optimization/29329 + * combine.c (replaced_rhs_insn): Rename to i2mod. + (replaced_rhs_value): Rename to i2mod_new_rhs. + (i2mod_old_rhs): New global variable. + (combine_instructions): Adjust for above change. Save a copy of + the old RHS into i2mod_old_rhs when the contents of a REG_EQUAL + note are substituted in the second instruction. + (distribute_notes) : Adjust for above change. Do not + ditch the note if it pertains to the second eliminated register + and this register is mentioned in i2mod_old_rhs. Revert: - 2003-06-03 Kazu Hirata - * combine.c (simplify_set): Don't move a subreg in SET_SRC to - SET_DEST if WORD_REGISTER_OPERATIONS is not defined. + 2006-09-12 Eric Botcazou -2004-01-12 Geoffrey Keating + * combine.c (distribute_notes) : Do not consider SETs past + the insn to which the note was originally attached. - * real.c: Update copyright date. - * emit-rtl.c: Likewise. - * rtl.h: Likewise. - * dwarf2out.c: Likewise. - * config/rs6000/darwin-ldouble.c: Likewise. - * config/rs6000/rs6000.md: Likewise. +2007-01-20 John David Anglin -2004-01-12 David Edelsohn + * pa.c (output_move_double): Change array size of xoperands to 4. - * config/rs6000/rs6000.c (rs6000_init_libfuncs): Add AIX - TFmode to SImode libfuncs. +2007-01-17 Eric Christopher -2004-01-12 Roger Sayle + Backport from mainline: + 2006-12-18 Roger Sayle + Eric Christopher - PR middle-end/11397 - * varasm.c (assemble_alias): Remove weak aliases from weak_decls. + PR target/29302 + * real.c (real_maxval): Correctly handle IBM extended double format. -2004-01-12 Jan Hubicka +2007-01-17 Tom Tromey - PR opt/12826 - * loop.c (insert_loop_mem): Preffer VOLATILE memory references to be - stored. + * doc/sourcebuild.texi (libgcj Tests): Use sourceware.org. + * doc/install.texi (Testing): Use sourceware.org. + (Binaries): Likewise. + (Specific): Likewise. + * doc/contrib.texi (Contributors): Use sourceware.org. - PR opt/12863 - * cfgcleanup.c (label_is_jump_target_p): Move to... - * rtlanal.c (label_is_jump_target_p): ... here. - * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Fix redirecting of fallthru - edges unified with branch edges. +2007-01-15 Joseph S. Myers -2004-01-12 Richard Earnshaw + * config/soft-fp/op-common.h, config/soft-fp/op-4.h: Update from + glibc CVS. - * simplify-rtx.c (simplify_immed_subreg): Correctly extract the - high word of an integral CONST_DOUBLE. +2007-01-11 John David Anglin -2004-01-12 Paul Brook + * pa-linux.h (ASM_OUTPUT_INTERNAL_LABEL): Undefine. + * pa.h (ASM_OUTPUT_LABEL): Output colon when using GAS. + (ASM_OUTPUT_INTERNAL_LABEL): Define. - * simplify-rtx.c (simplify_plus_minus): Always generate canonical form. +2007-01-10 Ralf Corsépius -2004-01-12 J"orn Rennecke + * config/bfin/t-bfin, config/bfin/t-bfin-elf: Remove GCC_CFLAGS. - PR target/13585 - * sh-protos.h (check_use_sfunc_addr): Declare. - * sh.c (extract_sfunc_addr, check_use_sfunc_addr): New functions. - * sh.md (use_sfunc_addr): Use check_use_sfunc_addr in insn predicate. +2007-01-09 Nicolas Pitre -2004-01-12 Jan Hubicka + PR target/30173 + * arm/ieee754-df.S (Lad_s): Also test the low word of X for zero. - * alias.c: Invlude varray.h - (alias_sets): Turn into varray. - (get_alias_set_entry): Use VARRAY; mark inline. - (mems_in_disjoint_alias_sets_p): Mark inline. - (record_alias_subset): Use varray. - (init_alias_once): Initialize varray. - (new_alias_set): Grow array. - * varray.c: Make VARRAY_GENERIC_PTR non GTYized. +2007-01-08 Nick Clifton -2004-01-12 Jan Hubicka + * config/frv/predicates.md (reg_or_0_operand): Accept + CONST_DOUBLEs. - Partial fix for PR opt/10776 II - * cselib.c: Include params.h - (cselib_invalidate_mem): Limit amount of nonconflicting memory - locations. - * params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New. - * Makefile.in (cselib.o): Depend on params.h +2007-01-08 Ralf Corsépius -2004-01-12 Richard Sandiford + * config/bfin/rtems.h, config/bfin/t-rtems: New. + * config.gcc: Add bfin*-rtems*. - * combine.c (combine_simplify_rtx): Don't pass VOIDmode to - simplify_unary_operation if the operand has a known mode. +2007-01-08 Chen liqin + * config/score/t-score-elf (MULTILIB_OPTIONS): Change. + * config/score/predicates.md (const_uimm5, sr0_operand, const_simm12, + const_simm15, const_pow2, const_npow2): Added. + * config/score/misc.md (insv, extv, extzv, movmemsi, + move_lbu_a/b, mov_lhu_a/b etc): Added and fix some bug. + * config/score/score.c (score_address_cost, score_select_cc_mode): + Added. + Change CONST_OK_FOR_LETTER_P/EXTRA_CONSTRAINT define. + Update score_rtx_costs for MACRO TARGET_RTX_COSTS. + Update score_print_operand. + * config/score/score.h (DATA_ALIGNMENT, SELECT_CC_MODE): Added. + Adjust register allocate order and update some macro define. + * config/score/score-mdaux.c (mdx_unaligned_load, mdx_unsigned_store, + mdx_block_move_straight, mdx_block_move_loop_head, + mdx_block_move_loop_body, mdx_block_move_loop_foot, mdx_block_move_loop, + mdx_block_move): Added. + (mdx_movsicc, mdp_select_add_imm, mdp_select, mds_zero_extract_andi, + mdp_limm): Updated and fix some bug and typo. + * config/score/score.md (movqi/hi/si, add/sub/zero/ext): Updated. + (movsf, movdf, doloop_end): Added. -2004-01-12 Hartmut Penner +2007-01-05 Richard Guenther - PR target/13534 - * gcc/config/rs6000/rs6000.c (word_offset_memref_operand): New - predicate to handle 'ld' conform addresses. - * gcc/config/rs6000/rs6000.h (EXTRA_CONSTRAINT): New 'Y' - contraint. - (EXTRA_MEMORY_CONSTRAINT): Tell reload which constraint - are memory contraints. - * gcc/config/rs6000/rs6000-protos.h (word_offset_memref_operand): - New prototype. - * gcc/config/rs6000/rs6000.md (*movdf_hardfloat64): - Change 'o' to 'Y' constraint. - (*movdf_softfloat64): Ditto. + PR middle-end/27826 + * tree.c (get_narrower): Do not construct COMPONENT_REFs + with mismatched types. Instead explicitly build a + conversion NOP_EXPR. -2004-01-12 Bernardo Innocenti +2007-01-05 Jakub Jelinek - * gcc/config/m68k/m68k.md: Switch from the "*..." syntax to the - brace-enclosed syntax in all C output statements. + PR c/30360 + * libgcc2.c (__divdc3): Compare c and d against 0.0 instead of + denom against 0.0. -2004-01-12 David Edelsohn +2007-01-03 Jakub Jelinek - PR target/13401 - * config/rs6000/rs6000.c (rs6000_output_function_epilogue): - Objective-C language type value is 14. + * unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define. + (struct _Unwind_Context): Rename args_size to flags, remove + signal_frame field, add a new args_size field and version field. + (_Unwind_IsSignalFrame, _Unwind_SetSignalFrame, + _Unwind_IsExtendedContext): New inline functions. + (_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr): + Assume by_value array is only present if _Unwind_IsExtendedContext. + (_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use + _Unwind_IsSignalFrame. + (__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT. + (uw_update_context_1): Use _Unwind_SetSignalFrame. + (uw_init_context_1): Initialize context->flags to + EXTENDED_CONTEXT_BIT. + * config/rs6000/linux-unwind.h (frob_update_context): Use + _Unwind_SetSignalFrame. -2004-01-12 Markus F.X.J. Oberhumer +2007-01-01 Mike Stump - PR c/12148 - * config/m68k/fpgnulib.c: Fix `-mshort' bugs: Use `long' instead of - `int' in a number of places to make sure we always have a SImode - and not a HImode. Add a 'L' suffix to a number of constants. + * configure.ac: Remove support for building with Apple's gcc-3.1. + +2007-01-01 Andreas Schwab -2004-01-11 John David Anglin - - * pa.c: Don't include obstack.h. - - * pa.md: Correct constraint in pattern for loading PIC label address. - -2004-01-11 Kaz Kojima - - * config/sh/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Undefine - before defining. - -2004-01-11 Steven Bosscher - - PR fortran/9972 - * toplev.c (rest_of_handle_inline): Also consider functions - for deferral if the language is GNU F77. - -2004-01-11 Zack Weinberg - - * c-decl.c (diagnose_arglist_conflict): Add missing space to - diagnostic messages. - -2004-01-11 Jakub Jelinek - - PR middle-end/13392 - * builtins.c (expand_builtin_expect_jump): Handle conditional jumps - to drop through label. Don't fall back to SCC even when conditional - jump has not been found. - -2004-01-11 Jan Hubicka - - * invoke.texi: Fix syntax error in previous patch. - - Partial fix for PR opt/10776 - * Makefile.in (reload.o): Include param.h - * params.def (PARAM_MAX_RELOAD_SEARCH_INSNS): New parameter. - * reload.c: Include params.h. - (find_equiv_reg): Work limiting check. - * invoke.texi: Document. - -2004-01-11 Richard Sandiford - - * config/mips/mips.c (mips_symbolic_constant_p): Don't allow - out-of-bounds accesses to string constants. Simplify mips16 - case accordingly. - -2004-01-11 Richard Sandiford - - PR optimization/13469 - * toplev.c (rest_of_compilation): Call purge_all_dead_edges after - reload_cse_regs (-fnon-call-exceptions only). - -2004-01-11 Kazu Hirata - - * config/mcore/lib1.asm: Fix comment formatting. - * config/mcore/mcore-elf.h: Likewise. - * config/mcore/mcore.c: Likewise. - * config/mcore/mcore.h: Likewise. - * config/mcore/mcore.md: Likewise. - -2004-01-10 Zack Weinberg - - * c-decl.c (duplicate_decls): Break apart into... - (diagnose_arglist_conflict, validate_proto_after_old_defn) - (locate_old_defn, diagnose_mismatched_decls, merge_decls): - ... these new functions. Restructure for comprehensibility. - Remove various archaic special cases. Always report the - location of the previous declaration when a diagnostic is issued. - (redeclaration_error_message): Fold into diagnose_mismatched_decls. - (match_builtin_function_types): Delete unnecessary forward declaration. - -2004-01-10 Zack Weinberg - - * genautomata.c (make_automaton, NDFA_to_DFA): - Print progress bars with '.' characters instead of '*'. - (build_automaton): Change notes to match. - -2004-01-10 Kazu Hirata - - * config/m32r/m32r.md: Use define_constants for unspec and - unspec_volatile. - -2004-01-10 Jan Hubicka - - PR opt/11635 - * expr.c (expand_expr_real): More curefully expand union casts. - -2004-01-10 Kazu Hirata - - * config/m32r/m32r.md (flush_icache): Use 1 for - unspec_volatile. - -2004-01-10 David Edelsohn - James E Wilson - - PR debug/12860 - * dbxout.c (dbxout_symbol): Remove initialization of - current_sym_code, current_sym_value, and current_sym_addr. - (dbxout_symbol_location): Same. - (dbxout_prepare_symbol): Zero current_sym_code, - current_sym_value, and current_sym_addr. - -2004-01-10 Richard Sandiford - - * tree.c (get_unwidened): Reorder conditions so that the null pointer - check is done first. - -2004-01-09 Eric Christopher - - * toplev.c (rest_of_handle_cfg): Add reg_scan pass - if we're running mark_constant_function. - -2004-01-09 Jeff Bailey - - PR target/12561 - * config/t-gnu: Rename SYSTEM_HEADER_DIR to NATIVE_SYSTEM_HEADER_DIR. - -2004-01-09 Andrew Pinski - - PR debug/11231 - * dbxout.c (dbxout_type_fields): Return if any item is - error_mark_node or the type is error_mark_node. - -2004-01-09 Geoffrey Keating - - * config/rs6000/darwin-ldouble.c: Add big comment explaining - exactly what is expected as a 'long double'. - (_xlqadd): When a value to be returned is representable as a - 'double', just return it directly, do not construct it using a union. - Also, correct final fixup. - (_xlqmul): Likewise. - (_xlqdiv): Likewise. - * real.c (encode_ibm_extended): Make consistent with darwin-ldouble.c. - - * config/rs6000/rs6000.md (fix_trunctfdi2): Delete. - -2004-01-09 Richard Henderson - - * recog.c (constrain_operands): Validate mem operands. - -2004-01-09 James E Wilson - - * gcc.c (init_spec): Remove -lunwind from shared case. - * conifg/ia64/t-hpux (SHLIB_LINK): Add -lunwind. - -2004-01-09 Steve Ellcey - - * configure.ac: (gcc_cv_ld_hidden) Set to true for ia64*-*-hpux*. - * configure: Regenerate - -2004-01-09 Joseph S. Myers - - PR c/11234 - * c-typeck.c (build_c_cast): If pedantic, warn for conversions - between function and object pointers. - (digest_init): When comparing a pointer to function type to the - target type, only apply TREE_TYPE once to the pointer to function - type. - * except.c (for_each_eh_label_1): Treat data as a pointer to a - function pointer rather than casting it to a function pointer. - (for_each_eh_label): Update caller. - * recog.h (struct insn_data): Use a struct or union for output. - * genoutput.c (output_insn_data): Update. - * final.c (get_insn_template): Update. - -2004-01-09 Mark Mitchell - - * expr.h (expand_expr): Make it a macro, not a function. - (expand_expr_real): New function. - * expr.c (store_expr): Adjust logic for deciding whether or not to - copy the value returned by expand_expr. - (expand_expr): Rename to ... - (expand_expr_real): ... this. Add alt_rtl parameter. Adjust - calls to language hooks. - * c-common.h (c_expand_expr): Adjust prototype. - * c-common.c (c_expand_expr): Add alt_rtl parameter. - * langhooks-def.h (lhd_expand_expr): Change prototype. - * langhooks.c (lhd_expand_expr): Add all_rtl parameter. - * langhooks.h (lang_hooks): Change type of expand_expr. - * stmt.c (stmt_status): Add x_last_expr_alt_rtl. - (last_expr_alt_rtl): Likewise. - (expand_expr_stmt_value): Set last_expr_alt_rtl. - (clear_last_expr): Clear it. - (expand_end_stmt_expr): Set RTL_EXPR_ATL_RTL. - (expand_end_bindings): Save and restor last_expr_alt_rtl. - * tree.def (RTL_EXPR): Give it an additional operand. - * tree.h (RTL_EXPR_ALT_RTL): New macro. - -2004-01-09 Kazuhiro Inaoka - - * config/m32r/m32r.h (TARGET_CPU_CPP_BUILTINS): Add __m32r__. - * config/m32r/m32r.c (call26_operand): Allow in PIC mode. - -2004-01-09 Kazu Hirata - - PR target/13380. - * config/m32r/m32r.md: Replace (reg:SI 17) with (reg:CC 17) - or (ne:SI (reg:CC 17) (const_int 0)). - Be specific about modes wherever possible. - -2004-01-09 Kazu Hirata - - * config/m32r/m32r.c (m32r_expand_block_move): Call - gen_movestrsi_internal with two more arguments. - (m32r_output_block_move): Adjust operand numbers. - Properly update the source and destination pointers. - * config/m32r/m32r.md (movstrsi_internal): Use 'r' instead of - 'r+'. Change the set detinations to match_operand. - -2004-01-09 Kazu Hirata - - * final.c (FIRST_INSN_ADDRESS): Remove. - (shorten_branches): Don't use FIRST_INSN_ADDRESS. - * system.h (FIRST_INSN_ADDRESS): Poison. - * config/avr/avr.h: Remove a comment about FIRST_INSN_ADDRESS. - * config/m32r/m32r-protos.h: Remove the prototype for - m32r_first_insn_address. - * config/m32r/m32r.c (m32r_first_insn_address): Remove. - * config/m32r/m32r.h (FIRST_INSN_ADDRESS): Likewise. - * doc/md.texi (FIRST_INSN_ADDRESS): Likewise. - -2004-01-09 J. Brobecker - - * dwarf2out.c (gen_enumeration_type_die): Return the DIE that - we just created. - (is_ada_subrange_type): DIEs for enumeration subtypes should be - emitted as subrange types too. - (subrange_type_die): Add handling of enumeration subtypes. - -2004-01-08 Richard Henderson - - PR opt/12441 - Revert: Sat Mar 30 14:08:55 CET 2002 Jan Hubicka - * i386.c (aligned_operand): Be prepared for SUBREGed registers. - (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG. - (ix86_address_cost): Be prepared for SUBREGed registers. - (legitimate_address_p): Accept SUBREGed registers. - -2004-01-08 Kelley Cook - - * Makefile.in: Rename configure.in to configure.ac - * doc/sourcebuild.texi: Likewise. - * configure: Regenerate. - * config.in: Regenerate. - -2004-01-08 Stuart Hastings - - * config/i386/i386.md: Typos in MMX/SSE immediate shifts. - -2004-01-08 Jan Hubicka - - * cgraphunit.c (cgraph_decide_inlining): Fix typo. - -2004-01-08 Geoffrey Keating - - * config/rs6000/rs6000.md (cmptf_internal1): Correct branch offset. - (UNSPEC_FIX_TRUNC_TF): New constant. - (movtf_internal): Make splitter active only when insn is active. - (extenddftf2): Rewrite to properly load zero into low part. - (extenddftf2_internal): New. - (extendsftf2): Rewrite. - (truncdftf2): Correct length. - (floatditf2): Delete. - (fix_trunc_helper): New. - (fix_trunctfdi2): Use fix_trunc_helper. - (fix_trunctfsi2): Likewise.fix_trunc - (fix_trunctfsi2_internal): New. - - * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): lo_sum - addresses are legitimate on Darwin even when flag_pic. - (rs6000_legitimize_reload_address) [TARGET_MACHO]: Don't create - non-offsettable addresses for loads of TFmode constants. - -2004-01-08 Kazuhiro Inaoka - - * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Actually emit - variables in the appropriate bss section. - -2004-01-09 Alan Modra - - * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Ensure - target_flags has MASK_POWERPC64 when -m64. - * config/rs6000/rs6000.c (processor_target_table): Add MASK_POWERPC64 - to 620, 630, power3, power4 and rs64a entries. - * config/rs6000/rs6000.h (MASK_64BIT): Expand comment. - -2004-01-08 Richard Sandiford - - * simplify-rtx.c (simplify_immed_subreg): Fix construction of - floating-point constants. - -2004-01-08 J. Brobecker - - * dwarf2out.c (subrange_type_die): Add context_die parameter. - Create the subrange_type DIE using the given context DIE. - (modified_type_die): Update call to subrange_type_die. - -2004-01-08 Zack Weinberg - - * dwarf2.h, unwind-dw2-fde.h, unwind-pe.h, unwind.h: - Add multiple-include guard. - -2004-01-08 Hartmut Penner - - * gcc/config/rs6000/rs6000.c (easy_vector_constant): Accept - all vector constant loadable by vsplt*. - (output_vec_const_move): Likewise. - -2004-01-07 Joseph S. Myers - - PR c/6024 - * c-typeck.c (comptypes): Only treat enumerated types in the same - translation unit as compatible with each other when they are the - same type. - * doc/extend.texi: Update. - -2004-01-07 Joseph S. Myers - - PR c/12165 - * c-decl.c (grokdeclarator): Take type qualifiers of typedefed - array type from the array element type. - -2004-01-07 Alan Modra - - * config/rs6000/rs6000.c (rs6000_dbx_register_number): New function. - * config/rs6000/rs6000-protos.h (rs6000_dbx_register_number): Declare. - * config/rs6000/rs6000.h (DWARF_FRAME_REGNUM): Define. - (DWARF_REG_TO_UNWIND_COLUMN): Correct column adjustment and comment. - * config/rs6000/sysv4.h (DBX_REGISTER_NUMBER): Define. - -2004-01-06 Eric Christopher - - * config/mips/mips.h (MDEBUG_ASM_SPEC): Change for dwarf2 default. - (DWARF2_DEBUGGING_INFO): Define. - (PREFERRED_DEBUGGING_TYPE): Set to dwarf2. - * config/mips/openbsd.h (PREFERRED_DEBUGGING_TYPE): Remove. - * config/mips/iris6.h (SUBTARGET_ASM_DEBUGGING_SPEC): Only pass -g0 - for irix as. - (SUBTARGET_ASM_OPTIMIZING_SPEC): Only pass O0 for irix as. - * config/mips/iris6gas.h (MDEBUG_ASM_SPEC): Remove. - * config/mips/iris5gas.h: Ditto. - (DBX_DEBUGGING_INFO): Remove. - (DWARF2_DEBUGGING_INFO): Ditto. - (MIPS_DEBUGGING_INFO): Ditto. - (PREFERRED_DEBUGGING_TYPE): Ditto. - * config/mips/elf.h (DWARF2_DEBUGGING_INFO): Remove. - (PREFERRED_DEBUGGING_TYPE): Ditto. - (SUBTARGET_ASM_DEBUGGING_SPEC): Ditto. - * config/mips/elf64.h: Ditto. - -2004-01-06 Jan Hubicka - - * Makefile.in (STAGEPROFILE_FLAGS_TO_PASS): Use -fprofile-generate. - (STAGEFEEDBACK_FLAGS_TO_PASS): Use -fprofile-use. - -2004-01-06 Geoffrey Keating - - * config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Compile darwin-ldouble.c. - (TARGET_LIBGCC2_CFLAGS): Use -mlong-double-128. - * config/rs6000/darwin-ldouble.c: New. - - * emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg - for constants. - (constant_subword): Delete. - * rtl.h (constant_subword): Delete prototype. - (immed_double_const): Is not in varasm.c. - * simplify-rtx.c (simplify_immed_subreg): New. - (simplify_subreg): Use simplify_immed_subreg. - - * config/rs6000/rs6000.md (floatsitf2): Use expand_float rather - than trying to generate RTL directly. - (fix_trunctfsi2): Use expand_fix rather than trying to generate - RTL directly. - - * dwarf2out.c (add_const_value_attribute): Remove incorrect comment. - -2004-01-06 David Edelsohn - - * config/rs6000/xcoff.h (EXTRA_SECTION_FUNCTIONS): Split each - function into a separate macro. - (read_only_data_section): Add void argument. - (private_data_section): Same. - (read_only_private_data_section): Same. - (toc_section): Same. - -2004-01-06 Jan Hubicka - - * invoke.texi: Remove typo in last change. - - PR target/10301 - * config.gcc: Accept opteron and athlon-64 as variants - of k8. - * i386.c (override_options): Likewise. - * invoke.texi (i386 -mtune): Expand documentation. - -2004-01-06 Kazu Hirata - - * alias.c: Fix comment typos. - * builtins.c: Likewise. - * cfg.c: Likewise. - * df.c: Likewise. - * dominance.c: Likewise. - * dwarf2out.c: Likewise. - * emit-rtl.c: Likewise. - * expr.c: Likewise. - * final.c: Likewise. - * fold-const.c: Likewise. - * gcse.c: Likewise. - * genattrtab.c: Likewise. - * genrecog.c: Likewise. - * gensupport.c: Likewise. - * ggc-zone.c: Likewise. - * integrate.c: Likewise. - * local-alloc.c: Likewise. - * loop.c: Likewise. - * recog.c: Likewise. - * regmove.c: Likewise. - * reg-stack.c: Likewise. - * reorg.c: Likewise. - * rtlanal.c: Likewise. - * rtl.h: Likewise. - * sched-ebb.c: Likewise. - * simplify-rtx.c: Likewise. - * toplev.c: Likewise. - * varasm.c: Likewise. - -2004-01-06 Kazu Hirata - - * doc/install.texi: Fix typos. - * doc/invoke.texi: Likewise. - * doc/md.texi: Likewise. - -2004-01-06 Kazuhiro Inaoka - - * config/m32r/m32r.h (TRAMPOLINE_LINE_SIZE): Changed - -2004-01-06 Jan Hubicka - - * i386.c (init_cumulative_args): Add handling of MMX_REGPARM. - (function_arg_advance): Do not pass aggregates in SSE; deal handling - of MMX_REGPARM. - (function_arg): Add new warnings about ABI changes; fix SSE_REGPARM; - add MMX_REGPARM. - * i386.h (ix86_args): Add mmx_words/mmx_regs/mmx_regno fields. - (SSE_REGPARM_MAX): Default to 3 on i386 -msse ABI. - (MMX_REGPARM_MAX): Similarly for -mmmx. - -2004-01-05 Kazu Hirata - - * config/sh/linux.h: Fix comment formatting. - * config/sh/netbsd-elf.h: Likewise. - * config/sh/sh.c: Likewise. - * config/sh/sh.h: Likewise. - * config/sh/vxworks.h: Likewise. - -2004-01-05 Kazu Hirata - - * system.h (ASM_OUTPUT_MAIN_SOURCE_FILENAME): Poison. - * toplev.c (output_file_directive): Don't use - ASM_OUTPUT_MAIN_SOURCE_FILENAME. - -2004-01-05 Steven Bosscher - - * toplev.c: Fix broken checkin of 2003-12-30. - -2004-01-05 Daniel Berlin - - * ggc-zone.c: Remove everything in #ifdef USING_MALLOC_PAGE_GROUPS - (USING_MMAP): We don't support non-mmap. - (struct alloc_chunk): Steal 1 bit from typecode, use it to mark - large objects. - (struct page_entry): Remove bytes_free. - (struct page_table_chain): Remove. - (struct globals): Remove page_table member. - (loookup_page_table_entry): Function deleted. - (set_page_table_entry): Ditto. - (ggc_allocated_p): No longer need page table lookups. - (ggc_marked_p): Ditto. - (alloc_small_page): Don't care about bytes_free anymore. - (alloc_large_page): Round up size. - (ggc_alloc_zone_1): Mark large objects as such, and calculate - their size the new way. - Remove page table lookups and setting. - (ggc_get_size): Calculate large object size the new way. - (sweep_pages): Redo to account for fact that we no longer have - bytes_free. - (ggc_collect): No longer need to reincrement bytes_free. - (ggc_pch_alloc_object): Handle new large objects properly. - (ggc_pch_read): Put PCH stuff into it's own uncollected zone. - -2004-01-05 Kazu Hirata - - * doc/invoke.texi: Remove a page break. - -2004-01-05 Kazu Hirata - - * config/avr/avr.c (avr_output_function_prologue): Remove an - extra pair of curly braces. - -2004-01-05 Kazu Hirata - - * config/mn10300/mn10300.c: Fix comment formatting. - * config/mn10300/mn10300.h: Likewise. - -2004-01-05 Richard Kenner - - * tree.h: Update documentation on nothrow_flag. - * print-tree.c (print_node): Print TREE_NOTHROW as "align-ok" for - types. - -2004-01-05 Kazu Hirata - - * doc/invoke.texi: Remove traces of dead ports. - -2004-01-05 Richard Sandiford - - * doc/invoke.texi: Add documentation for the MIPS -mexplicit-relocs - option. - -2004-01-05 Richard Sandiford - - PR target/12945 - * coverage.c (coverage_counter_alloc): Set SYMBOL_FLAG_LOCAL for - counter labels. - * config/mips/mips.c (INTERNAL_SYMBOL_P): Delete. - (mips_classify_symbol): Always treat SYMBOL_REF_FLAG as indicating - string constants if TARGET_MIPS16. Use SYMBOL_REF_DECL to check - the binding of decl symbols, otherwise check SYMBOL_REF_LOCAL_P. - (mips_symbol_insns): Don't trust the local/global classification. - (m16_usym8_4, m16_usym5_4): Same mips16 change as mips_classify_symbol. - (override_options): Make -mabicalls -fno-unit-at-a-time imply - -mno-explicit-relocs. - (mips_encode_section_info): Don't use SYMBOL_REF_FLAG to distinguish - between local and global symbols. - -2004-01-05 Richard Sandiford - - * config/mips/mips-protos.h (mips_dangerous_for_la25_p): Declare. - (mips_preferred_reload_class): Declare. - * config/mips/mips.h (DANGEROUS_FOR_LA25_P): Replace with function. - (EXTRA_CONSTRAINT): Update accordingly. - (PREFERRED_RELOAD_CLASS): Use mips_preferred_reload_class. - * config/mips/mips.c (mips_dangerous_for_la25_p): New function. - (mips_preferred_reload_class): New function. Prefer LEA_REGS if - mips_dangerous_for_la25_p. - (mips_secondary_reload_class): Use LEA_REGS rather than GR_REGS - if mips_dangerous_for_la25_p. - -2004-01-05 Bernardo Innocenti - - * config/m68k/m68k.c (output_andsi3): Fix signed/unsigned comparison - warning. - -2004-01-04 Nathanael Nerode - - * configure.ac: Use AC_PROG_CPP_WERROR. - * configure: Regenerate. - -2004-01-04 Zack Weinberg - - * .cvsignore: Add autom4te.cache. - -2004-01-04 Richard Sandiford - - * doc/invoke.texi: Revamp documentation of MIPS options. Remove - -mabi=meabi, -mabi-fake-default, -mmips-as, -mgas, -mmips-tfile, - -m4650, -mfix7000 and -(m)no-crt0. Put endianness options first, - then architecture options, then ABI options. General rewording. - -2004-01-04 Joseph S. Myers - - PR c/3414 - * doc/extend.texi: Clarify definition of malloc attribute. - -2004-01-04 Jan Hubicka - - * Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency. - * cgraph.c (create_edge, dump_cgraph): Update to use inline_failed - * cgraph.h (cgraph_edge): Replace inline_call by inline_failed - (cgraph_inline_p): Add extra argument reason. - * cgraphunit.c: Minor formating fixes. - cgraph_first_inlined_callee): New functions. - (record_call_1): Record builtins too. - (cgraph_analyze_function): Update inline_failed messages. - (cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into, - cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed. - (cgraph_check_inline_limits): Likewise; Add argument reason. - (cgraph_set_inline_failed): New static function. - (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set - reasons. - (cgraph_inline_p): Add new argument reason. - * tree-inline.c (expand_call_inline): Update warning. - -2004-01-03 Nathanael Nerode - - * configure.ac: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM - with modern equivalents. - * configure: Regenerate. - - * configure.ac: Replace gcc_AC_CHECK_TYPE with AC_CHECK_TYPE. - * aclocal.m4 (gcc_AC_CHECK_TYPE): Remove. - * configure: Regenerate. - - * doc/install.texi: Note that 'gcc' is now a 2.57 directory. - - * configure.in: Rename to configure.ac. - * configure.ac: Renamed from configure.in; make minimum necessary - changes for autoconf 2.5x. - * aclocal.m4: Make minimum necessary changes for autoconf 2.5x. - * configure: Regenerate with autoconf 2.57. - -2004-01-03 Kazu Hirata - - * config/mips/linux.h: Fix comment formatting. - * config/mips/mips.c: Likewise. - * config/mips/mips.h: Likewise. - * config/mips/mips.md: Likewise. - * config/mips/netbsd.h: Likewise. - * config/mips/windiss.h: Likewise. - -2004-01-02 Richard Henderson - - * config/i386/i386.md (fp constant pool splitter): Reorg suppression - for sse and 387; add suppression for mmx. - -2004-01-02 Andrew Pinski - - * loop.c (loop_optimize): Free all loops_info's mems. - - * c-typeck.c (finish_init): Free spelling_base before - setting it again. - - * cfgloop.c (flow_loops_find): Always free the sbitmap - headers. - - * predict.c (estimate_probability): Free bbs after being - done with it. - -2004-01-02 Kazu Hirata - - * config/mn10300/mn10300.h (PREDICATE_CODES): Add - const_8bit_operand and call_address_operand. - -2004-01-02 Jan Hubicka - - * cgraphunit.c (cgraph_optimize_function): Call optimize_inline_calls - when there is nothing to inline but warnings are requested. - (cgraph_decide_inlining): Fix memory leak. - -2004-01-02 Jan Hubicka - - * expr.c (store_constructor): Fix pasto in previous patch. - -2004-01-02 Kazu Hirata - - * config/i386/cygming.h: Fix comment formatting. - * config/i386/djgpp.h: Likewise. - * config/i386/gthr-win32.c: Likewise. - * config/i386/i386-interix.h: Likewise. - * config/i386/i386.c: Likewise. - * config/i386/i386.h: Likewise. - * config/i386/openbsd.h: Likewise. - * config/i386/winnt.c: Likewise. - * config/i386/xm-mingw32.h: Likewise. - -2004-01-02 Joseph S. Myers - - * doc/gcc.texi, doc/invoke.texi, doc/install.texi: Update - copyright and last modification dates. - -2004-01-02 Andreas Jaeger , Gerald Pfeifer - - * doc/install.texi (Specific): Mention x86_64. - -2004-01-01 Hans-Peter Nilsson - - * builtins.c (expand_builtin_apply_args_1) [STACK_GROWS_DOWNWARD]: - Call force_operand on plus_constant result. - -2004-01-01 Jan Hubicka - - * expmed.c (store_bit_field, extract_bit_field): Use new named patterns - * expr.c (store_constructor): Use vec_init pattern. - * genopinit.c (optabs): Initailize vec_set/vec_extract/vec_init. - * optabs.h (optab_index): ADD OTI_vec_set/OTI_vec_extract/OTI_vec_init - (vec_set_optab, vec_extract_optab, vec_init_optab): New. - * i386.md (vec_setv2df, vec_extractv2df, vec_setv4sf, vec_extractv4sf): - New patterns. - (sse2_unpc?pd): Fix pattern. - (sse2_movlpd): Kill. - (sse2_movsd): Deal with movlpd too. - * i386.c (ix86_expand_builtin): Use sse2_movsd instead of sse2_movlpd. - (ix86_expand_vector_init): New. - * emmintrin.h (__mm_set_pd, __mm_set_ps): Use vector extensions. - * md.texi (vec_set, vec_extract): Document - -2003-12-31 Jan Hubicka - - PR opt/13473 - * recog.c (validate_replace_rtx_1): Take care for RTL sharing inside - ASM input operands - - PR opt/12617 - * toplev.c (dump_file_index): Reorder ce3 and bbro. - (dump_file): Likewise. - (rest_of_compilation): Likewise. - - PR debug/13367 - * cgraph.c (cgraph_function_possibly_inlined): Even with - flag_really_no_inline we inline always_inline functions. - * cgraphunit.c (cgraph_analyze_function): Clear inlinable flag - for non-always_inline functions when there is flag_really_no_inline. - (cgraph_decide_inlining): Limit work done when not inlining. - (cgraph_decide_inlining_incrementally): Likewise. - (cgraph_optimize_function): Check whether something got inlined. - * c-objc-common.c (c_disregard_inline_limits): Do not always inline - extern inline functions when not inlining. - - * opts.c (decode_options): Disable crossjumping at -O1 - * invoke.texi (-O1): Document change. - -See ChangeLog.10 for earlier changes. + PR target/29166 + * config/ia64/ia64.c (ia64_compute_frame_size): Account space for + save of BR0 in extra_spill_size instead of spill_size. + (ia64_expand_prologue): Save BR0 outside of the gr/br/fr spill + area. + (ia64_expand_epilogue): Restore BR0 from its new location. diff --git a/contrib/gcc/ChangeLog-1997 b/contrib/gcc/ChangeLog-1997 new file mode 100644 index 00000000000..ea16ac7e81d --- /dev/null +++ b/contrib/gcc/ChangeLog-1997 @@ -0,0 +1,3969 @@ +Wed Dec 31 14:42:18 1997 Ian Lance Taylor + + * configure.in: Set and substitute host_exeext. Use it when creating + the assembler and linker symlinks. + * configure: Rebuild. + * Makefile.in (exeext): Set to @host_exeext@. + (build_exeext): New variable, set to @build_exeext@. + (FLAGS_TO_PASS): Pass down build_exeext. + (STAGESTUFF): Use build_exeext, not exeext, for gen* and bi* + programs. + +Wed Dec 31 10:05:44 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (addsi3, subsi3): Fix thinkos. + +Tue Dec 30 00:04:49 1997 Richard Henderson + + * sparc.h (ASM_OUTPUT_MI_THUNK): Move %o7 through %g1 instead of + save+restore. Fix pic+big_offset delay slot. Use "pic" case for + unix always, since we want to be able to thunk to functions in a + shared library from an application. + +Mon Dec 29 14:37:31 1997 Ian Lance Taylor + + * mips/t-ecoff (CROSS_LIBGCC1): Define to libgcc1-asm.a. + (LIB1ASMSRC, LIB1ASMFUNCS): Define. + +Mon Dec 29 14:03:38 1997 Jeffrey A Law (law@cygnus.com) + + * expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the + offset's mode is not ptr_mode, convert it. + +Mon Dec 29 15:58:18 1997 Michael Meissner + + * libgcc2.c (inhibit_libc): Don't define inhibit_libc when cross + compiling if it was already defined. + +Sun Dec 28 00:32:16 1997 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks): Don't create a new basic block + for calls in a LIBCALL block. + +Sun Dec 28 00:30:24 1997 David Edelsohn + + * config/fp-bit.c (L_df_to_sf): Fix typo in last change. + +Sat Dec 27 22:43:12 1997 Jeffrey A Law (law@cygnus.com) + + * cse.c (rtx_cost): Remove conflicting default case. + +Sat Dec 27 21:20:02 1997 Richard Henderson + + * configure.in: Move default enabling of Haifa out of for loop. + * configure: Rebuild. + +Thu Dec 25 01:02:54 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +1997-12-25 Teemu Torma + + * Makefile.in (GTHREAD_FLAGS): New var. + (LIBGCC2_CFLAGS): Added $(GTHREAD_FLAGS). + (distclean): Remove gthr-default.h. + + * configure.in: Accept dce as a thread package. + Check for thread.h and pthread.h. + Link gthr-default.h to appropriate thread file and set + gthread_flags. + (hppa1.1-*-hpux10*): If --enable-threads, use dce threads and + include multilib definitions from pa/t-dce-thr. + (sparc-*-solaris2*): Enable threads by default, if thread.h or + pthread.h is found, preferring posix threads over solaris ones. + + * config/pa/t-dce-thr: New file. + * config/pa/t-pa: Removed multilibs. + * config/sparc/t-sol2: Likewise. + + * gthr.h: New file. + * gthr-single.h: New file. + * gthr-posix.h: New file. + * gthr-solaris.h: New file. + * gthr-dce.h: New file. + * libgcc-thr.h: Removed. + * objc/thr-dce.c: New file copied from thr-decosf1.c. + + * frame.c: Include gthr.h instead of libgcc-thr.h. + * libgcc2.c: Include gthr.h instead of libgcc-thr.h. + (eh_context_initialize): If __gthread_once fails, use static eh + context. + (eh_context_free): Call __gthread_key_dtor. + +Wed Dec 24 23:33:17 1997 Jeffrey A Law (law@cygnus.com) + + * expr.h (MUST_PASS_IN_STACK): Allow target port to override. + +Wed Dec 24 23:12:14 1997 Jim Wilson + + * cse.c (max_insn_uid): New variable. + (cse_around_loop): Use max_insn_uid. + (cse_main): Set max_insn_uid. + + * abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT, + and define __LONG_MAX__ appropriately. Add support for -mabi=X, + -mlong64, and -mgp{32,64} options. + * mips.c (mips_abi): Change type to int. + * mips.h (enum mips_abi_type): Delete. + (ABI_32, ABI_N32, ABI_64, ABI_EABI): Define as constants. + (mips_abi): Change type to int. + +Wed Dec 24 22:38:34 1997 John Carr + + * flags.h, toplev.c, calls.c, alias.c: Remove flag_alias_check; + optimization is now always enabled. + + * calls.c (expand_call): Recognize C++ operator new as malloc-like + function. + + * alias.c (memrefs_conflict_p): Eliminate tests now done by + base_alias_check. + (*_dependence): Call canon_rtx before base_alias_check. + (init_alias_once): New function to precompute set of registers which + can hold Pmode function arguments. + + * rtl.h: Declare init_alias_once. + + * toplev.c (compile_file): Call init_alias_once. + +Wed Dec 24 22:34:55 1997 Jeffrey A Law (law@cygnus.com) + + * tree.c (restore_tree_status): Do not dereference a null pointer. + +Tue Dec 23 12:56:46 1997 Paul Eggert + + * genattrtab.c (main): Check HAVE_{G,S}ETRLIMIT in addition to + RLIMIT_STACK. This maintains consistency with the recent, similar + patch to cccp.c and toplev.c. + +Tue Dec 23 05:17:28 1997 Richard Henderson + + * genattrtab.c (expand_units): For large nr opclasses, expand + function_units_used with ORX to prevent blowups. Tag with FFS. + (num_unit_opclasses): New variable. + (gen_unit): Update it. + (enum operator): Add ORX_OP. + (operate_exp): Treat ORX as or, except don't expand across an if. + Reuse number rtx's after operating on them. + (check_attr_value): Accept IOR, AND, & FFS. + (write_test_expr): Transmute `in_comparison' to `flags'. Allow + for attribute value caching. Handle CONST_STRING, IF_THEN_ELSE. + (write_expr_attr_cache, write_toplevel_expr): New functions. + (write_attr_get): Handle FFS-tagged expressions. + (make_canonical): Don't expand const attributes. + (convert_const_symbol_ref): Dike out. + (evaluate_eq_attr): Handle SYMBOL_REF. + (main): Don't emit get_attr_foo for const attributes. + + * alpha.c (override_options): Reinstate PROCESSOR_EV6. + (alpha_adjust_cost): Add EV6 tuning; streamline EV5 tests. + * alpha.h (REGISTER_MOVE_COST): Increase ftoi/itof cost slightly. + * alpha.md: Redo all of the scheduling, adding EV6 support, and + combining function units where possible. + (attr "type"): Split loads, stores, cmov into int/fp. Combine + multiplies and divides. Add EV6 sqrt, ftoi, itof. + (attr "opsize"): New attribute. + (sqrtsf2-1, sqrtdf2-1): Provide proper TP_INSN patterns. + (movsf2-[12], movdf2-[12]): Provide CIX varients; don't allow CIX + to control register allocation. + (movsi2-1, movdi2-1): Likewise. + +Tue Dec 23 03:53:21 1997 Richard Henderson + + * alpha.h (CPP_PREDEFINES, LIB_SPEC, LINK_SPEC, STARTFILE_SPEC, + MD_STARTFILE_PREFIX, ASM_FILE_START, ASM_SPEC, ASM_FINAL_SPEC): + Move OSF/1 specific defines out. + * alpha/elf.h (TARGET_VERSION, CPP_PREDEFINES, DEFAULT_VTABLE_THUNKS): + Move Linux specific defines out. + (LINK_SPEC): Genericize. + (ASM_FILE_START): Emit .arch if using more than the base insn set. + (ASM_OUTPUT_SOURCE_LINE): Remove; identical to alpha.h version. + (SDB_DEBUGGING_INFO): Remove; gas can't handle it. + (HANDLE_SYSV_PRAGMA): Define. + * alpha/osf.h: New file. + * alpha/linux.h: Split. Retain file-format independent defines. + Import Linux bits from elf.h. + (CPP_PREDEFINES): Take a file-format specific SUB_CPP_PREDEFINES. + (FUNCTION_PROFILER): _mcount takes its address in $28. + (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX): Remove undef. + * alpha/linux-ecoff.h: New file. + * alpha/linux-elf.h: New file. + * alpha/vms.h (LIB_SPEC, LINK_SPEC): Copy from osf.h. + * alpha/win-nt.h (TARGET_DEFAULT): Define. + * configure.in (alpha*-*-osf*, alpha*-*-linux*) [tm_file]: + Add new headers as appropriate. + + * configure.in (alpha*): Enable Haifa by default. + (*-*-winnt3*): Change to winnt*, since we're not v3 specific. + * configure: Rebuild. + +Tue Dec 23 03:14:54 1997 Richard Henderson + + * Makefile.in (clean): Remove the stages with their objects here ... + (distclean): ... instead of here. + +Mon Dec 22 11:24:01 1997 Kaveh R. Ghazi + + * cse.c (rtx_cost): Add default case in enumeration switch. + * fix-header.c (recognized_macro): Likewise. + (recognized_extern): Likewise. + (write_rbrac): Likewise. + * objc/objc-act.c (encode_aggregate): Likewise. + (gen_declarator): Likewise. + (gen_declspecs): Likewise. + +Mon Dec 22 09:58:51 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (create_reg_dead_note): Detect and handle another + case where we kill more regs after sched than were killed before + sched. + * sched.c (create_reg_dead_note): Similarly. + +Mon Dec 22 09:18:37 1997 Jeffrey A Law (law@cygnus.com) + + * c-pragma.c: Include flags.h. + +Sun Dec 21 22:10:59 1997 Mumit Khan + + * i386/cygwin32.h (NO_IMPLICIT_EXTERN_C): Don't assume anything + about system headers. + (LIB_SPEC): Add -ladvapi32 -lshell32 to be consistent with mingw32 + and also to resolve symbols in prefix.c. + + * i386/xm-cygwin32.h (HAVE_BCOPY): Define. This avoids a conflict + between gansidecl.h and newlib's _ansi.h when building libgcc2.a, + when the definitions in auto-config.h is not visible. + (HAVE_BZERO): Likewise. + (HAVE_BCMP): Likewise. + (HAVE_RINDEX): Likewise. + (HAVE_INDEX): Likewise. + +Sun Dec 21 21:54:22 1997 Jeffrey A Law (law@cygnus.com) + + * pa.c (emit_move_sequence): Handle a function label source + operand. + +Sun Dec 21 16:13:55 1997 Nick Clifton + + * c-pragma.c (handle_pragma_token): Generate warning messages + about unknown pragmas if warn_unknown_pragmas is set. + + * c-decl.c (c_decode_option): Parse -Wunknown-pragmas command + line option to set variable: warn_unknown_pragmas. + +Sun Dec 21 15:51:10 1997 Manfred Hollstein + + * m68k/mot3300.h (ASM_BYTE_OP): Don't include '\t' in the + definition. + (ASM_OUTPUT_ASCII): Prefix ASM_BYTE_OP by one single '\t'. + +Sun Dec 21 13:58:39 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (FPBIT_FUNCS, DPBIT_FUNCS): Define. + (libgcc2.a): Depend on $(DPBIT) and $(FPBIT). Add rules to + generate more fine grained floating point emulation libraries. + * config/fp-bit.c: Add protecting #ifdef to all functions so + that they can be compiled separately. If !FINE_GRAINED_LIBRARIES, + then compile all suitable functions. + (pack_d, unpack_d, fpcmp_parts): Add declarations, define with two + underscores to avoid namespace pollution. + * t-mn10200 (LIB2FUNCS_EXTRA): Remove fp-bit.c. + (FPBIT): Define. + * t-mn10300 (LIB2FUNCS_EXTRA): Remove fp-bit.c and dp-bit.c. + (FPBIT): Define. + (DPBIT): Define. + +Sat Dec 20 11:26:47 1997 Kaveh R. Ghazi + Jeff Law + + * bitmap.c (bitmap_clear): Ensure `inline' is at the beginning + of the declaration. + * c-decl.c (finish_decl): Use parentheses around && within ||. + * rtl.c: Include stdlib.h. + (read_skip_spaces): Add parentheses around assignments used as + truth values. + (read_rtx): Initialize list_rtx. + * cppexp.c (parse_number): Use || when operands are truth values. + * alias.c (find_base_value): Add default case. + (memrefs_conflict): Likewise. + * combine.c (sets_function_arg_p): Likewise. + * genemit.c (gen_exp): Likewise. + * local-alloc.c (contains_replace_regs): Likewise. + * rtlanal.c (jmp_uses_reg_or_mem): Likewise. + * fold-const.c (fold_convert): Use "&&" for truth values. + (fold): Add default case. + * sdbout.c (sdbout_field_types): Fix typo in declaration. + (sdbout_one_type): Add default case. + * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS. + (some_operand): Add default case. + (input_operand): Likewise. + (signed_comparison_operator): Likewise. + (divmod_operator): Likewise. + (alpha_set_memflags_1): Likewise. + * reload1.c (reload_cse_simplify_operands): Ensure function + always returns a value. + * scan-decls.c (scan_decls): Likewise. + * c-lex.c (skip_white_space): Fix typo in declaration. + * c-typeck.c (comp_target_types): Add parentheses around assignment + used as truth value. + (print_spelling): Likewise. + (constructor_implicit, constructor_result): Remove unused variables. + * collect2.c (scan_library): Protect prototype with + #ifdef SCAN_LIBRARIES. + * emit-rtl.c (find_line_note): Fix typo in declaration. + * final.c (asm_insn_count): Protect prototype with + #ifdef HAVE_ATTR_length. + * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC. + (try_pre_increment_1, try_pre_increment): Likewise. + * regclass.c (auto_inc_dec_reg_p): Protect prototype with + #ifdef FORBIDDEN_INC_DEC_CLASSES. Make return type explicit. + * gcov-io.h (__store_long, __write_long, __read_long): Fix + unsigned/signed comparisons. + * gcov.c (read_files): Remove unused "first_type" variable. + (scan _for_source_files): Initialize s_ptr. + (function_summary): Eliminate "%lf" formatting, use %ld for + longs. + (output_data): Initialize branch_probs and last_line_num. + Eliminate "%lf" formatting, use "%ld" for longs. + +Fri Dec 19 17:31:11 1997 Ian Lance Taylor + + * mips16.S: New file. + + * libgcc2.c (varargs): Handle mips16. + + * expr.c (do_tablejump): Let CASE_VECTOR_PC_RELATIVE be an + expression. + * stmt.c (expand_end_case): Likewise. + * alpha.h (CASE_VECTOR_PC_RELATIVE): Update. + * fx80.h, gmicro.h, m68k.h, m88k.h, ns32k.h: Likewise. + * rs6000.h, sh.h, tahoe.h, v850.h, vax.h: Likewise. + +Tue Dec 16 15:14:09 1997 Andreas Schwab + + * objc/Make-lang.in: Create runtime-info.h and libobjc_entry.o in + the build directory. + (libobjc.a): Update dependency list. + (libobjc.dll): Likewise. Use libobjc_entry.o from the build + directory. + (objc/sendmsg.o): Add -Iobjc to find runtime-info.h. + (objc.mostlyclean): Remove runtime-info.h. + +Fri Dec 19 00:19:42 1997 Richard Henderson + + * tree.c (build_range_type): Allow creation of ranges with no maximum. + * dbxout.c (dbxout_range_type): Handle missing TYPE_MAX_VALUE. + * dwarf2out.c (add_subscript_info): Likewise. + * dwarfout.c (subscript_data_attribute, byte_size_attribute): Likewise. + * sdbout.c (plain_type_1): Likewise. + * stmt.c (pushcase_range, all_cases_count, node_has_high_bound): + Likewise. + * fold-const.c (int_const_binop, fold_convert, make_range, fold): + Likewise. + +Thu Dec 18 17:05:10 1997 Kaveh R. Ghazi + + * mips.c (fatal): Remove declaration. + +1997-12-18 Mark Mitchell + + * integrate.c (get_label_from_map): New function. + (expand_inline_function): Use it. Initialize the label_map to + NULL_RTX instead of gen_label_rtx. + (copy_rtx_and_substitute): Use get_label_from_map. + * integrate.h (get_label_from_map): New function. + (set_label_from_map): New macro. + * unroll.c (unroll_loop): Use them. + (copy_loop_body): Likewise. + +Thu Dec 18 19:19:57 1997 Ian Lance Taylor + + * mips/mips.h (INIT_SUBTARGET_OPTABS): Define if not defined. + (INIT_TARGET_OPTABS): Define. + * mips/ecoff.h: Include gofast.h before mips.h. + (INIT_SUBTARGET_OPTABS): Define instead of INIT_TARGET_OPTABS. + * mips/elf64.h: Likewise. + * mips/elf.h (ASM_OUTPUT_SECTION_NAME): Define. + +Thu Dec 18 14:51:12 1997 Jason Merrill + + * except.c: Remove register_exception_table{,_p}. + +Thu Dec 18 14:57:29 1997 Gavin Koch + + * unroll.c (calculate_giv_inc): Handle constant increment found in + a MEM with an appropriate REG_EQUAL note. + + * calls.c (expand_call): Implement LOAD_ARGS_REVERSED. + + * dwarf2out.c (dwarf2out_frame_debug): Handle adjustments of the + frame pointer in the prologue. + +Thu Dec 18 00:19:38 1997 Robert Lipe + + * i386/x-sco5 (CLIB): Deleted. + (ALLOCA): Added. + * i386/xm-sco5.h (USE_C_ALLOCA): Added. + +Tue Dec 16 18:51:00 1997 Bill Moyer + + * config/m68k/m68k.c (output_function_prologue): Typecast + dwarf2out_cfi_label to (char *). + * config/m68k/m68kemb.h (STARTFILE_SPEC): Redefined to "". + +Wed Dec 17 15:06:04 1997 Richard Henderson + + * sparc.md (jump): Don't use the annul bit around an empty loop. + Patch from Kevin.Kelly@East.Sun.COM. + +Wed Dec 17 00:51:36 1997 Stan Cox (scox@cygnus.com) + + * jump.c (jump_optimize): Don't use the return register as a + source1 of a conditional move. + +Tue Dec 16 23:45:40 1997 Richard Henderson + + * sparc.c (DF_MODES): Or the mask not the bit number. + (function_arg) [ARCH64]: Send unprototyped arg to fp reg first. + +Wed Dec 17 00:13:48 1997 Christian Iseli + + * combine.c (force_to_mode): Return immediately if operand is a + CLOBBER. + +Tue Dec 16 23:44:54 1997 Manfred Hollstein + + * fixincludes (size_t): Add support for Motorola's stdlib.h + which fails to provide a definition for size_t. + (fabs/hypot): Provide a prototype for fabs on m88k-motorola-sysv3. + (strlen,strspn,strcspn return value): Handle different layout on sysV88. + (hypot): Provide a fake for hypot for m88k-motorola-sysv3. + + * m68k/xm-mot3300.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Define to + prevent unresolved externals in libio. + * m88k/xm-sysv3.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Likewise. + +Tue Dec 16 23:25:45 1997 H.J. Lu (hjl@gnu.org) + + * config/sparc/linux64.h (LIBGCC_SPEC): Removed. + (CPP_SUBTARGET_SPEC): Add %{pthread:-D_REENTRANT}. + (LIB_SPEC): Updated for glibc 2. + +Tue Dec 16 20:11:36 1997 Jeffrey A Law (law@cygnus.com) + + * ginclude/stdarg.h: Undo BeOS changes, they break hpux. + * ginclude/varargs.h: Likewise. + +Tue Dec 16 00:32:01 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Dec 16 00:14:29 1997 H.J. Lu (hjl@gnu.org) + + * frame.h (__register_frame, __register_frame_table, + __deregister_frame): New. + * frame.c (__register_frame, __register_frame_table, + __deregister_frame): New. + * frame.c (__deregister_frame_info): Return void *. + * frame.h (__deregister_frame_info): Likewise. + * collect2.c (__deregister_frame_info): Likewise. + +Mon Dec 15 18:40:08 1997 Richard Henderson + + * expmed.c (expand_shift): If SHIFT_COUNT_TRUNCATED, drop a SUBREG. + +Mon Dec 15 18:31:43 1997 Richard Henderson + + * alpha.c (alpha_cpu_name): New variable. + (alpha_mlat_string): Likewise. + (alpha_memory_latency): Likewise. + (override_options): Handle -mmemory-latency. + (alpha_adjust_cost): Adjust load cost for latency. + * alpha.h (TARGET_OPTIONS): Add memory-latency. + (REGISTER_MOVE_COST): Define in terms of memory_latency. Take + TARGET_CIX into account. + (MEMORY_MOVE_COST): Define in terms of memory_latency. + * invoke.texi (DEC Alpha Options): Document -mmemory-latency. + + * alpha.h (ASM_COMMENT_START): New macro. + +Mon Dec 15 17:48:05 1997 Richard Henderson + + * reload.h, reload1.c (eliminate_regs), caller-save.c, dbxout.c, + dwarfout.c, dwarf2out.c, reload.c, sdbout.c: Revert March 15 change. + + * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the + SUBREG_REG if the word count is unchanged. + * reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve + subregs of identical word size for push_reload. + +Mon Dec 15 11:41:32 1997 Mark Mitchell + + * toplev.c (rest_of_compilation): Don't call save_for_inline_copy + if all we're doing is dealing with -Wreturn-type. + +Mon Dec 15 09:44:39 1997 Richard Henderson + + * alpha.md (zero_extendqihi2, zero_extendqisi2, zero_extendqidi2): + Use and 255 instead of zapnot 1, since it schedules better. + +Mon Dec 15 08:48:24 1997 Jeffrey A Law (law@cygnus.com) + + * stmt.c (expand_asm_operands): If an ASM has no outputs, then treat + it as volatile. + +Mon Dec 15 00:04:48 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (remove_dependencies): Set RTX_INTEGRATED_P on + dependency we delete. Properly update prev for multiple consecutive + deletions. + (priority): Skip deleted dependence. + +Fri Dec 12 18:54:23 1997 Per Bothner + + * expr.c (expand_builtin): Support BUILT_IN_FMOD - just call fmod. + +Fri Dec 12 01:19:48 1997 Jason Merrill + + * flow.c (flow_analysis): Be consistent with find_basic_blocks in + determining when a new basic block starts. + + * alpha/osf2or3.h (LIB_SPEC): Restore missing defn. + + * pa.h (TEXT_SPACE_P): Use TREE_CODE_CLASS. + * pa.md (iorsi3): Add missing args to *_operand calls. + + * except.c (call_get_eh_context): Don't mess with sequences. + (emit_eh_context): Include the call in the sequence here. + +1997-12-11 Paul Eggert + + * collect2.c (write_c_file_glob): Allocate initial frame object + in static storage and pass its address. + +Thu Dec 11 23:33:48 1997 Jason Merrill + + * except.c (call_get_eh_context): Don't take a parm. + Put the call at the top of the function. + (emit_eh_context): Adjust. + (get_eh_context): Replace with former use_eh_context. + (get_eh_context_once, get_saved_pc_ref): Remove. + (start_eh_unwinder, end_eh_unwinder, emit_unwinder): Remove. + * except.h: Adjust. + * integrate.c (expand_inline_function): Adjust. + * toplev.c (rest_of_compilation): Don't call emit_unwinder. + +Fri Oct 10 17:58:31 1997 Marc Lehmann + + * i386/xm-go32.h (EXECUTABLE_SUFFIX): Define. + (DIR_SEPARATOR, NO_SYS_SIGLIST): Likewise. + +Thu Dec 11 23:55:17 1997 Manfred Hollstein + + * fixincludes (strlen,strspn,strcspn return value): Handle different + layout on sysV88. + (hypot): Provide a fake for hypot which is broken on + m88k-motorola-sysv3. + +Thu Dec 11 23:50:17 1997 John F. Carr + + * tree.c, tree.h: Change tree_code_type, tree_code_length, and + tree_code_name from pointers to arrays. + * tree.c: Remove standard_tree_code_* variables, no longer used. + * print-tree.c: Remove declaration of tree_code_name. + + * cp/lex.c (init_lex): Update for tree_code_* changes. + * objc/objc-act.c (init_objc): Likewise. + + * tree.def, cp/cp-tree.def, objc/objc-tree.def: Update for tree_code + changes. + +Thu Dec 11 23:34:54 1997 Fred Fish + + * config.sub: Add support for BeOS target. + * configure.in: Likewise. + * ginclude/stdarg.h: Likewise. + * ginclude/stddef.h: Likewise. + * ginclude/varargs.h: Likewise. + * rs6000/beos.h: New file for BeOS. + * rs6000/t-beos: Likewise. + * rs6000/x-beos: Likewise. + * rs6000/xm-beos.h: Likewise. + * toplev.c (get_run_time): Just return 0 on BeOS. + +Thu Dec 11 23:25:23 1997 Jeffrey A Law (law@cygnus.com) + Toon Moene (toon@moene.indiv.nluug.nl) + + * m68k.h (GO_IF_LEGITIMATE_ADDRESS): No longer cater to horribly + old and broken Sun3 assemblers. Newer versions handle large + offsets correctly as does the GNU assembler. + +Thu Dec 11 23:06:48 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * objc/objc-act.c (lang_report_error_function): Disable. + * objc/objc-parse.y: Include "output.h". + (yyerror): Remove redundant decl. + (yyprint): Fix prototype. + (apply_args_register_offset): Remove redundant decl. + (get_file_function_name): Likewise. + +Thu Dec 11 22:02:10 1997 Jason Merrill + + * flow.c (find_basic_blocks): A CALL_INSN that can throw starts + a new basic block. + (find_basic_blocks_1): Likewise. + +Thu Dec 11 21:08:48 1997 Jason Merrill + + * except.c (use_eh_context): Don't copy_rtx a REG. + (emit_throw): Lose old unwinder support. + (expand_internal_throw): Likewise. + * libgcc2.c (struct eh_context): Likewise. + (new_eh_context): Likewise. + (__get_eh_info): Lose redundant cast. + (__get_dynamic_handler_chain): Likewise. + (__get_saved_pc): Lose. + Lose all old unwinder support code. + +Thu Dec 11 20:42:18 1997 Teemu Torma + + Thread-safe EH support for pthreads, DCE threads and Solaris threads. + + * integrate.c (expand_inline_function): If the inline fn uses eh + context, make sure that the current fn has one. + * toplev.c (rest_of_compilation): Call emit_eh_context. + * except.c (use_eh_context): New fn. + (get_eh_context_once): New fn. + (call_get_eh_context): New fn. + (emit_eh_context): New fn. + (get_eh_context): Call either get_eh_context_once or + call_get_eh_context, depending on what we have. + (get_dynamic_handler_chain): Call get_eh_context_once. + * except.h: Prototypes for fns above. + * optabs.c (get_eh_context_libfunc): Removed. + (init_optabs): Don't initialize it. + * expr.h (get_eh_context_libfunc): Removed. + * rtl.h, rtl.c: New reg_note REG_EH_CONTEXT. + * config/pa/pa.h (CPP_SPEC): Support for -threads. + * config/pa/pa-hpux10.h (LIB_SPEC): Likewise. + * config/pa/t-pa (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): + New multilib for -threads. + * config/sparc/t-sol2: Added multilibs for -threads and + made -pthreads alias to it. + * config/sparc/sol2.h (CPP_SPEC, LIB_SPEC): + Added -threads and -pthreads options. + * libgcc-thr.h: New file. + * libgcc2.c (__get_cpp_eh_context): Removed. + (struct cpp_eh_context): Removed. + (struct eh_context): Replaced cpp_eh_context with generic language + specific pointer. + (__get_eh_info): New function. + (__throw): Check eh_context::info. + (__sjthrow): Likewise. + * libgcc2.c: Include libgcc-thr.h. + (new_eh_context, __get_eh_context, + eh_pthread_initialize, eh_context_initialize, eh_context_static, + eh_context_specific, eh_context_free): New functions. + (get_eh_context, eh_context_key): New variables. + (__sjthrow, __sjpopnthrow, __eh_pcnthrow, __throw): Use + get_eh_context to get the context. + (longjmp): Move the declaration inside + #ifdef DONT_USE_BUILTIN_SETJMP. + * frame.c: Include libgcc-thr.h. + (object_mutex): Mutex to protect the object list. + (find_fde, __register_frame, __register_frame_table, + __deregister_frame): Hold the lock while accessing objects. + * except.h (get_eh_context): Declare. + * except.c (current_function_ehc): Define. + (current_function_dhc, current_function_dcc): Removed. + (get_eh_context): New function. + (get_dynamic_handler_chain): Use get_eh_context. + (get_saved_pc_ref): Likewise. + (get_dynamic_cleanup_chain): Removed references to + current_function_dcc. + (save_eh_status, restore_eh_status): Save and restore + current_function_ehc instead. + * optabs.c (get_eh_context_libfunc): New variable. + (init_optabs): Initialize it. + * expr.h: Declare get_eh_context_libfunc. + * function.h (struct function): Replaced dhc and dcc with ehc. + * except.c (get_saved_pc_ref): New functions. + (eh_saved_pc_rtx, eh_saved_pc): Deleted. + (expand_internal_throw_indirect): Use get_saved_pc_ref() instead + of eh_saved_pc. + (end_eh_unwinder): Likewise. + (init_eh): Remove initialization of eh_saved_pc. + * optabs.c (get_saved_pc_libfunc): New variable. + (init_optabs): Initialize it. + * expr.h: Declare get_saved_pc_libfunc. + * except.h (eh_saved_pc_rtx): Deleted. + (get_saved_pc_ref): Declared. + + From Scott Snyder : + * libgcc2.c (__get_saved_pc): New. + (__eh_type, __eh_pc): Deleted. + (__eh_pcnthrow): Use __get_saved_pc() instead of __eh_pc. + (__get_dynamic_handler_chain): Move __dynamic_handler_chain inside + this fcn. + +Thu Dec 11 17:23:48 1997 John F. Carr + + * sparc/sol2.h: Use 64 bit multiply and divide functions in + Solaris libc. Define TARGET_LIVE_G0 and TARGET_BROKEN_SAVERESTORE + as 0. + + * rtl.h (global_rtl): New variable, replacing separate variables for + commonly used rtl. + (const_int_rtx): Now array of rtx_def, not rtx. + * emit-rtl.c: Update for new rtl data structures. + * genattrtab.c: Define global_rtl. + +Thu Dec 11 15:50:29 1997 David Edelsohn + + * configure.in ({rs6000,powerpc}-*-*): Enable Haifa scheduler by + default. + +Wed Dec 10 12:30:18 1997 Anthony Green + + * crtstuff.c (__do_global_ctors): Fix typo. + +Tue Dec 9 09:43:59 1997 Manfred Hollstein + + * toplev.c (main): Check HAVE_GETRLIMIT and HAVE_SETRLIMIT in addition + to RLIMIT_STACK to see if we can call getrlimit and setrlimit. + +Tue Dec 9 09:38:58 1997 David Edelsohn + + * rs6000.h (FUNCTION_ARG_PADDING): Define. + * rs6000.c (function_arg_padding): New function. + +Tue Dec 9 10:34:21 1997 Manfred Hollstein + + * m68k.c: Include tree.h only once. + +Tue Dec 9 09:32:33 1997 Richard Kenner + + * integrate.c (save_for_inline_copying): Make a new reg_parm_stack_loc. + +Tue Dec 9 01:16:06 1997 Jeffrey A Law (law@cygnus.com) + + * Partially cleaned up prototyping code from HJ. + * tree.h: Add many prototypes. + * haifa-sched.c (haifa_classify_insn): Renamed from classify_insn. + All references changed. + * rtl.h: Protect from multiple inclusions. Add many prototypes. + +Tue Dec 9 01:15:15 1997 Fred Fish + + * libgcc2.c (string.h): Hoist inclusion to occur before first use of + string functions like strlen. + +Tue Dec 9 00:57:38 1997 Manfred Hollstein + + * configure.in: Check for functions getrlimit and setrlimit. + * cccp.c (main): Check HAVE_GETRLIMIT and HAVE_SETRLIMIT in addition + to RLIMIT_STACK to see if we can call getrlimit and setrlimit. + +Mon Dec 8 23:53:26 1997 Jay Sachs + + * Makefile.in (compare*): Handle losing behavior from 4.4bsd make. + +Mon Dec 8 21:03:28 1997 Richard Henderson + + * alpha.c (REG_RA, alpha_return_addr, output_epilog): + Fix merge problems. + + * alpha.c (override_options): Don't know about scheduling for EV6. + * alpha.md (ev5 function units): Don't overload as ev6. + + * alpha.c (alpha_adjust_cost): Simplify. Fix typo in ev5 mult case. + * alpha.md (define_attr type): Add mvi. + (ev5_e0): Define sceduling parameters for it. + (TARGET_MAX insns): Type is mvi not shift. + +Mon Dec 8 18:15:00 1997 Richard Henderson + + * alpha/win-nt.h (TRAMPOLINE_TEMPLATE): Fix backported gcc-2.8 bug. + +Mon Dec 8 21:17:28 1997 J"orn Rennecke + + * cstamp-h, auto-config.h: Delete. + +Sun Dec 7 19:19:03 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Dec 6 22:22:22 1997 Jeffrey A Law (law@cygnus.com) + + * cccp.c: Fix typo brought over in merge. + + * Merge in changes from gcc-2.8. + +Mon Nov 3 05:45:32 1997 Philippe De Muyter + + * m68k.c: Include tree.h for dwarf2out_cfi_label. + + * gcc.c (process_command): Do not take address of function fatal when + calling lang_specific_driver. + +Sat Dec 6 01:02:38 1997 Mumit Khan + + * config/i386/cygwin32.h (DWARF2_UNWIND): Exception handling + doesn't work with it yet, so set it to 0. + * config/i386/xm-cygwin32.h (NO_SYS_SIGLIST): Define. + +Sat Dec 6 01:01:02 1997 Christian Iseli + + * cse.c (cse_insn): Check for invalid entries when taking references. + +Fri Dec 5 18:26:25 1997 J"orn Rennecke + + * loop.c (invariant_p): Don't test flag_rerun_loop_opt. + (loop_optimize, scan_loop, strength_reduce): New argument unroll_p. + * toplev.c (rest_of_compilation): Pass it. Remove code to + save / clear / restore flag_unroll_{,all_}loops. + +Fri Dec 5 16:26:03 1997 Bernd Schmidt + + * i386.c (notice_update_cc): Remove bogus pentium GCC code. + +Fri Dec 5 16:25:14 1997 Jeffrey A Law (law@cygnus.com) + + * stmt.c (warn_if_unused_value): Don't warn for TRY_CATCH_EXPR. + +Thu Dec 4 11:51:00 1997 Jason Merrill + + * except.c (get_dynamic_handler_chain): Only make the call once per + function. + + * except.c (expand_end_all_catch): Fix for sjlj exceptions. + +Thu Dec 4 12:30:40 1997 J"orn Rennecke + + * sh.c (final_prescan_insn): Use local label prefix + when emitting .uses pseudo-ops. + +Wed Dec 3 12:01:56 1997 Jason Merrill + + * libgcc2.c (__throw): Use __builtin_return_addr instead of __eh_pc. + * except.c: Lose outer_context_label_stack. + (expand_eh_region_end): Rethrow from outer_context here. + (expand_fixup_region_end): Let expand_eh_region_end do the rethrow. + (expand_internal_throw): Take no args. + (expand_internal_throw_indirect): Lose. + (expand_leftover_cleanups, expand_start_all_catch): Use expand_rethrow. + (expand_start_all_catch): Start a rethrow region. + (expand_end_all_catch): End it. + (expand_rethrow): New fn. + * except.h: Reflect above changes. + * flow.c: Revert change of Nov 27. + +Thu Dec 4 00:24:09 1997 Jeffrey A Law (law@cygnus.com) + + * i386/t-sol2 (CRTSTUFF_T_CFLAGS): Turn on the optimizer. + +Wed Dec 3 12:01:56 1997 Jason Merrill + + * except.c (expand_fixup_region_end): New fn. + (expand_fixup_region_start): Likewise. + (expand_eh_region_start_tree): Store cleanup into finalization here. + * stmt.c (expand_cleanups): Use them to protect fixups. + +Wed Dec 3 11:41:13 1997 Gavin Koch + + * mips/mips.md (muldi3_r4000): Broaden the output template + and attribute assignments to handle three operand dmult; + rename to muldi3_internal2. + (muldi3): Call the new muldi3_internal2 for R4000, and + any GENERATE_MULT3 chip. + +Tue Dec 2 19:40:43 1997 Jason Merrill + + * stmt.c (expand_decl_cleanup): Update thisblock after eh_region_start. + +Tue Dec 2 12:54:33 1997 Jim Wilson + + * unroll.c (find_splittable_givs): Remove last change. Handle givs + with a dest_reg that was created by loop. + +Sat Nov 29 12:44:57 1997 David Edelsohn + + * rs6000.c (function_arg_partial_nregs): Undo Nov. 26 patch. + + * rs6000/aix41.h (ASM_CPU_SPEC): Define. + +Fri Nov 28 10:00:27 1997 Jeffrey A Law (law@cygnus.com) + + * configure.in: Fix NCR entries. + +Thu Nov 27 12:20:19 1997 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks): Handle cfg issues for rethrows and + nested exceptions correctly. + + * unroll.c (find_splittable_givs): Don't split givs with a dest_reg + that was created by loop. + +Thu Nov 27 09:34:58 1997 Jason Merrill + + * expr.c (preexpand_calls): Don't look past a TRY_CATCH_EXPR. + + * except.c (expand_start_all_catch): One more do_pending_stack_adjust. + +Wed Nov 26 15:47:30 1997 Michael Meissner + + * rs6000.c (SMALL_DATA_REG): Register to use for small data relocs. + (print_operand): Use SMALL_DATA_REG for the register involved in + small data relocations. + (print_operand_address): Likewise. + + * rs6000/linux.h (LINK_SPEC): Pass -dynamic-linker /lib/ld.so.1 if + -dynamic linker is not used. + + * rs6000.md (call insns): For local calls, use @local suffix under + System V. Don't use @plt under Solaris. + + * rs6000.c (output_function_profiler): Put label address in r0, and + store LR in 4(sp) for System V/eabi. + + * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Keep stack aligned to 16 + byte boundary, and maintain stack backchain. + +Tue Nov 25 14:08:12 1997 Jim Wilson + + * mips.md (fix_truncdfsi2, fix_truncsfsi2, fix_truncdfdi2, + fix_truncsfdi2): Change *. + +Wed Nov 26 11:12:26 1997 Jason Merrill + + * toplev.c (main): Complain about -gdwarfn. + +Tue Nov 25 22:43:30 1997 Jason Merrill + + * dwarfout.c (output_type): If finalizing, write out nested types + of types we've already written. + +Tue Nov 25 20:32:24 1997 Michael Meissner + + (patches originally from Geoffrey Keating) + * rs6000.c (function_arg): Excess floating point arguments don't + go into GPR registers after exhausting FP registers under the + System V.4 ABI. + (function_arg_partial_nregs): Likewise. + + * rs6000.md (call insns): If -fPIC or -mrelocatable, add @plt + suffix to calls. + +Tue Nov 25 23:37:27 1997 Jason Merrill + + * integrate.c (output_inline_function): Just unset DECL_INLINE. + +Tue Nov 25 23:33:29 1997 scott snyder + + * dwarf2out.c (outout_call_frame_info): Ensure that the info has + proper alignment. + + * libgcc2.c (__throw): Initialize HANDLER. + +Tue Nov 25 14:08:12 1997 Jim Wilson + + * mips.md (fix_truncdfsi2, fix_truncsfsi2, fix_truncdfdi2, + fix_truncsfdi2): Change *X to ?*X. + +Tue Nov 25 10:00:42 1997 Richard Henderson (rth@cygnus.com) + + * alpha.h (CONST_OK_FOR_LETTER): Fix 'L' handling. + +Tue Nov 25 10:00:42 1997 Jeffrey A Law (law@cygnus.com) + + * crtstuff.c (do_global_dtors_aux): Handle multiple calls better. + +Tue Nov 25 01:26:55 1997 Bruno Haible + + * dwarf2out.c (ASM_OUTPUT_DWARF_DELTA1): Implement. + +Mon Nov 24 22:41:55 1997 Jason Merrill + + * except.c (get_dynamic_handler_chain): Build up a FUNCTION_DECL. + * optabs.c (init_optabs): Lose get_dynamic_handler_chain_libfunc. + * expr.h: Likewise. + +Sat Nov 22 18:58:20 1997 Jeffrey A Law (law@cygnus.com) + + * pa-hpux10.h (NEW_HP_ASSEMBLER): Define. + * pa.h (LEGITIMATE_CONSTANT_P): Reject LABEL_REFs if not using + gas and not using the new HP assembler. + +Fri Nov 21 15:20:05 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (program_transform_cross_name): Clean up "-e" confusion. + (GCC_INSTALL_NAME, GCC_CROSS_NAME): Likewise. + +Fri Nov 21 19:37:40 1997 Andrew Cagney + + * config/mips/elf64.h (MULTILIB_DEFAULTS): Test for + TARGET_ENDIAN_DEFAULT == zero instead of testing for macro + definition. + +Fri Nov 21 12:49:56 1997 Bruno Haible + + * stmt.c (expand_end_bindings): Allow jump into block with cleanups. + +Fri Nov 21 12:18:51 1997 Jason Merrill + + * except.h: Add outer_context_label_stack. + * except.c: Likewise. + (expand_start_all_catch): Push the outer_context for the try block + onto outer_context_label_stack. + (expand_end_all_catch): Use it and pop it. + +Fri Nov 21 10:13:11 1997 Robert Lipe (robertl@dgii.com) + + * i386/sco5.h (HAVE_ATEXIT): Revert last change. + +Thu Nov 20 16:11:50 1997 Richard Henderson + + * alpha.c (alpha_emit_set_const_1): Handle narrow hosts better. + +Thu Nov 20 16:11:50 1997 Klaus Kaempf + + * alpha/vms.h (ASM_OUTPUT_ADDR_VEC_ELT): Add an L for the local label + to correspond with the change to ASM_GENERATE_INTERNAL_LABEL. + +Thu Nov 20 14:42:15 1997 Jason Merrill + + * Makefile.in (LIB2FUNCS): Remove C++ memory management support. + * libgcc2.c: Remove __builtin_new, __builtin_vec_new, set_new_handler, + __builtin_delete, and __builtin_vec_delete. + + * except.c (output_exception_table): Don't bother with + __EXCEPTION_END__. + +Thu Nov 20 16:11:50 1997 Jeffrey A Law (law@cygnus.com) + + * pa.md (pre_stwm, post_stwm, pre_ldwm, post_ldwm): Base register + is an in/out operand. + (zero extended variants of stwm/stwm patterns): Similarly. + + * mips/x-iris (FIXPROTO_DEFINES): Add -D_SGI_SOURCE. + +Thu Nov 20 13:19:32 1997 Jason Merrill + + * dwarf2out.c (ASM_OUTPUT_DWARF_OFFSET4): Rename from VALUE4. + Use assemble_name. + (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Use assemble_name. + (output_call_frame_info): Emit a \n after using it. + +Thu Nov 20 00:38:46 1997 Dave Love + + * configure.in: Add AC_ARG_ENABLE for Haifa as documentation. + +Wed Nov 19 12:03:04 1997 Philippe De Muyter + + * dwarf2out.c (CIE_LENGTH_LABEL, FDE_LENGTH_LABEL): New macros. + (ASM_OUTPUT_DWARF_VALUE4): New macro. + (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Define if SET_ASM_OP is + defined. + (output_call_frame_info): Do not output forward label differences + if ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL is defined. + * m68k/mot3300.h (SET_ASM_OP): Define when not using gas. + +Tue Nov 18 23:03:30 1997 J"orn Rennecke + + * sh.md (attribute "type"): Add nil. + (movsi_ie): y/y alternative is type nil. + (movsf_ie): Replace ry/yr/X alternative by r/y/X , y/r/X and y/y/X + alternatives. + (movsf_ie+1): Delete. + +Tue Nov 18 15:39:59 1997 Jim Wilson + + * mips/mips.c (save_restore_insns): If gp_offset or fp_offset are + large_int, emit two insns instead of one splitable insn. + * dwarf2out.c (dwarf2out_frame_debug): When set cfa_store_offset + from cfa_temp_value, use cfa_offset. Add assert checking that + cfa_reg is SP. + +Mon Nov 17 15:35:38 1997 Tom Tromey + + * cccp.c (deps_output): Properly quote file names for make. + +Mon Nov 17 13:21:40 1997 Jeffrey A Law (law@cygnus.com) + + * t-h8300 (MULTILIB_EXCEPTIONS): Define. + +Fri Nov 7 15:33:11 1997 Robert Lipe (robertl@dgii.com) + + * i386/sco5.h (HAVE_ATEXIT): Delete definition. + +Sun Nov 16 23:52:48 1997 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Don't look at JUMP_LABEL field of a conditional + return. + (cse_end_of_basic_block): Similarly. + +Sun Nov 16 23:01:40 1997 J. Kean Johnston + + * i386/sco5.h (ASM_OUTPUT_ALIGNED_BSS): Define. + (SELECT_RTX_SECTION): Define. + (LIBGCC_SPEC, LIB_SPEC): Do the right thing for PIC. + +Sun Nov 16 22:47:03 1997 Manfred Hollstein + + * Makefile.in (compare, compare-lean): Define $stage for each + shell command. + (gnucompare, gnucompare-lean): Likewise. + +Sun Nov 16 22:02:16 1997 Richard Henderson (rth@cygnus.com) + + * alpha/win-nt.h (TRAMPOLINE_TEMPLATE): Fix offsets. + + * alpha.h (ASM_OUTPUT_ADDR_DIFF_ELT): Add an L for the local label + to correspond with the change to ASM_GENERATE_INTERNAL_LABEL. + +Fri Nov 14 09:09:20 1997 Fred Fish (fnf@cygnus.com) + + * dwarfout.c (byte_size_attribute): Add local var upper_bound + and add case to handle STRING_TYPE. + * dwarfout.c (output_string_type_die): Fix code to generate + correct string length attribute for fixed length strings. + Still needs support for varying length strings. + +Fri Nov 14 08:46:56 1997 Jeffrey A Law (law@cygnus.com) + + * toplev.c (get_run_time): Do something sensible for cygwin32. + +Fri Nov 14 07:24:20 1997 Richard Henderson + + * expr.c (expand_builtin_setjmp): Set + current_function_has_nonlocal_label. + * stupid.c (stupid_life_analysis): If has_nonlocal_label, kill + call-saved registers across calls. + + * alpha.md (exception_receiver): Remove. + (nonlocal_goto_receiver_osf): New. + (nonlocal_goto_receiver_vms): Renamed from nonlocal_goto_receiver. + (nonlocal_goto_receiver): New, select _osf or _vms. + + * alpha.c (output_prolog [*]): Prefix entry labels with '$' to + keep them from being propagated to the object file. + (alpha_write_linkage): Likewise. + * alpha.md (call_vms): Likewise. + (call_value_vms): Likewise. + (unnamed osf call insns): Likewise. + + * alpha.h (ASM_OUTPUT_INTERNAL_LABEL): Don't omit L from local label. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + + * alpha.c (call_operand): Any reg is valid for WinNT. + * alpha.md (call_nt, call_value_nt): Don't force address into $27. + (anon nt calls): Add 'R' alternative. + * alpha/win-nt.h (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE, + INITIALIZE_TRAMPOLINE): Handle lack of original $27 and 32-bit ptrs. + +Fri Nov 14 06:59:33 1997 Jeffrey A Law (law@cygnus.com) + + * calls.c (expand_call): Handle pcc_struct_value correctly for C++. + + * i386/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Delete defines. + * i386/xm-mingw32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise. + * rs6000/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise. + +Thu Nov 13 20:37:33 1997 Michael Meissner + + * reload1.c (new_spill_reg): Improve fixed or forbidden register + spill error message. + +Thu Nov 13 20:29:08 1997 Kaveh R. Ghazi + + * prefix.c: Use stdarg.h only ifdef __STDC__. Otherwise, + use varargs.h. Wrap header with <>, not "". + +Thu Nov 13 20:21:17 1997 Jeffrey A Law (law@cygnus.com) + + * integrate.c (save_for_inline_copying): Add return value from + savealloc. + +Thu Nov 13 19:12:33 1997 Brendan Kehoe + + * fixincludes: Be a little more restrictive on what we will + substitute to replace definitions of MAXINT for HPUX. + +Thu Nov 13 18:41:02 1997 Michael Meissner + + * dbxout.c (dbxout_symbol_location): Don't assume that variables + whose address is the stack or argument pointers are indirect + pointers. + +1997-11-13 Paul Eggert + + * cccp.c, cpplib.c (compare_defs): + Don't complain about arg name respellings unless pedantic. + * cpplib.c (compare_defs): Accept pfile as new arg. + All callers changed. + +Thu Nov 13 23:33:50 1997 J"orn Rennecke + + * fold-const.c (fold_truthop): Fix bug in last change. + +1997-11-13 Paul Eggert + + Fix some confusion with IEEE minus zero. + + * real.h (REAL_VALUES_IDENTICAL): New macro. + + * expr.c (is_zeros_p): Don't consider -0.0 to be all zeros. + * fold-const.c (operand_equal_p): Don't consider -0.0 to be + identical to 0.0. + * tree.c (simple_cst_equal): Don't consider -0.0 to have the + same tree structure as 0.0. + + * varasm.c (immed_real_const_1): Use new REAL_VALUES_IDENTICAL + macro instead of doing it by hand. + +Thu Nov 13 16:56:14 1997 Jeffrey A Law (law@cygnus.com) + + * v850/lib1funcs.asm: Minor whitespace changes. + * v850.c: Fix minor formatting problems in many places. + (construct_restore_jr, construct_save_jarl): Remove unwanted aborts. + +Thu Nov 13 12:53:44 1997 Jim Wilson + + * mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete code swapping xplus0 and + xplus1 when xplus0 is not a register. + +Thu Nov 13 11:41:42 1997 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks): During marking phase, if we encounter + an insn with a REG_LABEL note, make the target block live and + create an edge from the insn to the target block. Do not make + edges from all blocks to the target block. + + * m68k/x-next (OTHER_FIXINCLUDES_DIRS): Include /NextDeveloper/Headers. + + * confiugre.in: Tweak NCR entries. + * configure: Rebuilt. + +Thu Nov 13 11:07:41 1997 Michael Meissner + + * rs6000.c (num_insns_constant): Use REAL_VALUE_FROM_CONST_DOUBLE to + pick apart floating point values, instead of using CONST_DOUBLE_LOW + and CONST_DOUBLE_HIGH. + + * rs6000.md (define_splits for DF constants): Use the appropriate + REAL_VALUE_* interface to pick apart DF floating point constants in + a machine independent fashion. + +Thu Nov 13 00:06:58 1997 J"orn Rennecke + + * fold-const.c (fold_truthop): When changing a one-bit comparison + against zero into a comparison against mask, do a proper sign + extension. + +Wed Nov 12 09:37:01 1997 Jeffrey A Law (law@cygnus.com) + + * except.c: Do not include "assert.h". + (save_eh_status): Turn asserts into conditional aborts. + (restore_eh_status, scan_region): Likewise. + * dwarfout.c: Do not include "assert.h". + (bit_offset_attribute): Turn asserts into conditional aborts. + (bit_size_attribute, output_inlined_enumeration_type_die): Likewise. + (output_inlined_structure_type_die): Likewise. + (output_inlined_union_type_die): Likewise. + (output_tagged_type_instantiation): Likewise. + (dwarfout_file_scope_decl): Likewise. + * dwarf2out.c: Do not include "assert.h" + (expand_builtin_dwarf_reg_size): Turn asserts into conditional aborts. + (reg_save, initial_return_save, dwarf2out_frame_debug): Likewise. + (add_child_die, modified_type_die, add_bit_offset_attribute): Likewise. + (add_bit_size_attribute, scope_die_for): Likewise. + (output_pending_types_for_scope): Likewise. + (get_inlined_enumeration_type_die): Likewise. + (get_inlined_structure_type_die): Likewise. + (get_inlined_union_type_die, gen_subprogram_die): Likewise. + (gen_tagged_type_instantiation_die): Likewise. + + * flow.c (find_basic_blocks): Refine further to get a more correct + cfg, especially in the presense of exception handling, computed + gotos, and other non-trivial cases. Call abort if an inaccuracy + is detected in the cfg. + +Tue Nov 11 21:47:27 1997 J"orn Rennecke + + * glimits.h (SHRT_MIN): Define in a way suitable for 16 bit hosts. + + * c-lex.c (whitespace_cr, skip_white_space_on_line): New functions. + (skip_white_space): Use whitespace_cr. + (check_newline): Handle whitespace more consistently. + +Tue Nov 11 16:25:49 1997 Jim Wilson + + * i386/cygwin32.h (CPP_PREDEFINES): Delete -DPOSIX. + * i386/xm-cygwin32.h (POSIX): Define. + +Mon Nov 10 20:53:11 1997 Gavin Koch + + * config/mips/mips.h (MASK_DEBUG_H): Set to zero, so this bit + is available elsewhere. + +Mon Nov 10 16:21:58 1997 Doug Evans + + * sparc/sparc.md (mov[sdt]f_const_insn): Fix condition to match + what the instruction can handle. + +Mon Nov 10 03:02:19 1997 Jason Merrill + + * stmt.c (expand_decl_cleanup_no_eh): New fn. + + * except.c (expand_leftover_cleanups): do_pending_stack_adjust. + +Mon Nov 10 00:05:56 1997 Jeffrey A Law (law@cygnus.com) + + * alias.c (MAX_ALIAS_LOOP_PASSES): Define. + (init_alias_analysis): Break out of loops after MAX_ALIAS_LOOP_PASSES. + +Sun Nov 9 14:34:47 1997 David Edelsohn + + * rs6000.md (lshrdi3_power): Delete '&' from first alternative and + swap instruction order. + +Sun Nov 9 02:07:16 1997 Jeffrey A Law (law@cygnus.com) + + * fixinc.svr4 (__STDC__): Add another case. + +Sun Nov 9 02:00:29 1997 J"orn Rennecke + + * a29k.h (ELIGIBLE_FOR_EPILOGUE_DELAY): Avoid loads from varying + addresses in the epilogue delay slot. + +Sun Nov 9 01:40:40 1997 Manfred Hollstein (manfred@s-direktnet.de) + + * m88k/dgux.h (ASM_CPU_SPEC): Reformatted to suppress wrong whitespace + in generated `specs' file. + +Sun Nov 9 01:37:11 1997 Jim Wilson (wilson@cygnus.com) + + * flags.h (flag_rerun_loop_opt): Declare. + * loop.c (invariant_p, case LABEL_REF): Check flag_rerun_loop_opt. + * toplev.c (flag_rerum_loop_opt): Delete static. + +Sat Nov 8 18:20:21 1997 J"orn Rennecke + + Bring over from FSF: + + Thu Oct 30 12:21:06 1997 J"orn Rennecke + + * va-sh.h (__va_arg_sh1): Define. + (va_arg): Use it. + SH3E doesn't use any integer registers for subsequent arguments + once a non-float value was passed in the stack. + * sh.c (machine_dependent_reorg): If optimizing, put explicit + alignment in front label for ADDR_DIFF_VEC. + * sh.h (PASS_IN_REG_P): Fix SH3E case. + (ADJUST_INSN_LENGTH): If not optimizing, add two extra bytes length. + + Tue Oct 28 15:06:44 1997 J"orn Rennecke + + * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Undefine before including + svr4.h. + + Mon Oct 27 16:11:52 1997 J"orn Rennecke + + * sh.c (machine_dependent_reorg): When -flag_delayed_branches, + put an use_sfunc_addr before each sfunc. + * sh.md (use_sfunc_addr, dummy_jump): New insns. + (casesi): For TARGET_SH2, emit a dummy_jump after LAB. + + Tue Oct 21 07:12:28 1997 J"orn Rennecke + + * sh/elf.h (PREFERRED_DEBUGGING_TYPE): Don't redefine. + +Fri Nov 7 10:22:24 1997 Jason Merrill + + * frame.c (add_fdes, count_fdes): Go back to checking pc_begin for + linked once FDEs. + +Wed Nov 5 14:26:05 1997 Jeffrey A Law (law@cygnus.com) + + * alias.c (find_base_value): Only return the known base value for + pseudo registers. + +Wed Nov 5 11:27:14 1997 Jim Wilson + + * i386.c (load_pic_register): Call prologue_get_pc_and_set_got. + * i386.md (prologue_set_got, prologue_get_pc): Add UNSPEC_VOLATILE + to pattern. + (prologue_get_pc_and_set_got): New pattern. + +Tue Nov 4 20:36:50 1997 Richard Henderson (rth@cygnus.com) + + * alpha.c (summarize_insn): Handle ASM_OPERANDS. Don't recurse + for SUBREG, just fall through. + + * alpha.c (alpha_handle_trap_shadows): Init sum.defd to zero. + + * alpha.md (attr trap): Make TRAP_YES nonzero for sanity's sake. + +Tue Nov 4 18:49:42 1997 Jeffrey A Law (law@cygnus.com) + + * fixincludes: Fix "hypot" prototype in NeXT math.h. + + * Makefile.in (USE_ALLOCA): Always include alloca.o. + (USE_HOST_ALLOCA): Likewise. + + * rtl.def (CODE_LABEL): Use separate fields for LABEL_NUSES + and LABEL_REFS fields. + * rtl.h (LABEL_REFS): Update. + +Tue Nov 4 16:55:11 1997 Jim Wilson + + * combine.c (try_combine): When setting elim_i2, check whether newi2pat + sets i2dest. When calling distribute_notes for i3dest_killed, pass + elim_i2 and elim_i1. When setting elim_i1, check if newi2pat + sets i1dest. + + * mips.md (insv, extzv, extv): Add change_address call. + (movsi_ulw, movsi_usw): Change QImode to BLKmode in pattern. + + * integrate.c (save_for_inline_copying): Copy parm_reg_stack_loc. + + * reload.c (find_reloads, case 'm' and 'o'): Reject HIGH constants. + + * mips.c (mips_expand_epilogue): Emit blockage insn before call to + save_restore_insns if no FP and GP will be restored. + + * dwarf2out.c (expand_builtin_dwarf_reg_size): New variable mode. + Convert CCmode to word_mode before calling GET_MODE_SIZE. + + * acconfig.h (HAVE_INTTYPES_H): Undef. + * configure.in (inttypes.h): Check for conflicts between sys/types.h + and inttypes.h, and verify that intmax_t is defined. + * config/mips/x-iris (CC, OPT, OLDCC): Comment out. + * config/mips/x-iris3: Likewise. + +Tue Nov 4 16:07:15 1997 Jeffrey A Law (law@cygnus.com) + + * alias.c (find_base_value): When copying arguments, return the + tentative value for a hard register. + +Tue Nov 4 13:40:35 1997 Doug Evans + + * c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling. + (yylex): Record wide strings using target endianness, not host. + +Tue Nov 4 13:13:12 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200.h (ASM_OUTPUT_BSS): Delete. + (ASM_OUTPUT_ALIGNED_BSS): New macro. + * mn10300.h (ASM_OUTPUT_BSS): Delete. + (ASM_OUTPUT_ALIGNED_BSS): New macro. + * v850.h (ASM_OUTPUT_BSS): Delete. + (ASM_OUTPUT_ALIGNED_BSS): New macro. + +Tue Nov 4 00:55:48 1997 J"orn Rennecke + + * profile.c (branch_prob): Insert an insn after a NOTE_INSN_SETJMP. + +Mon Nov 3 14:36:50 1997 Jeffrey A Law (law@cygnus.com) + + * configure.in (sco5): Use cpio to install header files. + +Sun Nov 2 23:31:43 1997 Manfred Hollstein + + * aclocal.m4 (conftestdata_from, conftestdata_to): Names shortened to + 14 char length. + * configure: Rebuild. + +Sun Nov 2 19:44:00 1997 Robert Lipe (robertl@dgii.com) + + * i386/sco5.h: Enable -gstabs once again. + +Sun Nov 2 19:27:21 1997 Jeffrey A Law (law@cygnus.com) + + * arm.c (output_move_double): Allocate 3 entries in otherops array. + +Sat Nov 1 21:43:00 1997 Mike Stump + + * except.c (expand_eh_region_start_for_decl): Emit EH_REGION_BEG + notes for sjlj exceptions too. + (expand_eh_region_end): Similarly for EH_REGION_END notes. + (exception_optimize): Optimize EH regions for sjlj exceptions too. + * final.c (final_scan_insn): Don't output labels for EH REGION + notes if doing sjlj exceptions. + +Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com) + + * alias.c (init_alias_analysis): Handle -fno-alias-check when + optimizing correctly. + + * expr.c (expand_builtin_setjmp): Don't emit a SETJMP note + or set current_function_calls_setjmp anymore. + + * flow.c (find_basic_blocks): If we delete the label for an + exception handler, remove it from the EH label list and remove + the EH_BEGIN/EH_END notes for that EH region. + +Sat Nov 1 16:44:49 1997 Jason Merrill (jason@cygnus.com) + + * flow.c (find_basic_blocks): Generate correct flow control + information when exception handling notes are present. + +Sat Nov 1 13:42:19 1997 Jeffrey A Law (law@cygnus.com) + + * dwarf2out.c (output_call_frame_info): Fix length argument + to ASM_OUTPUT_ASCII. + (output_die, output_pubnames, output_line_info): Likewise. + +Fri Oct 31 07:10:09 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + + * dwarf2out.c (output_call_frame_info): Use ASM_OUTPUT_ASCII to + output ASCII by default. Only use ASM_OUTPUT_DWARF_STRING if + flag_debug_asm is on. + (output_die, output_pubnames, output_line_info): Likewise. + + * alias.c (init_alias_analysis): Add struct_value_incoming_rtx + and static_chain_rtx into the potential base values array if + they are registers. + + * alias.c (new_reg_base_value): New array of potential base values. + (unique_id): Now file scoped static. + (find_base_value, case REG): Return the value in reg_base_value + array for the REG if it exists. Else, return the value from + new_reg_base_value if copying args and REG is a hard register. + (find_base_value, case PLUS): If either operand of the PLUS is + a REG, try to get its base value. Handle base + index and + index + base. + (record_set): Use new_reg_base_value instead of reg_base_value. + (init_alias_analysis): Allocate space for new_reg_base_value too. + Rework code to iterate over the insns propagating base value + information until nothing changes. + + * global.c (global_alloc): Free the conflict matrix after + reload has finished. + +Fri Oct 31 01:45:31 1997 Jason Merrill + + * libgcc2.c (L_eh): Define __eh_pc. + Replace __eh_type with generic pointer __eh_info. + +Fri Oct 31 00:34:55 1996 J"orn Rennecke + + * expr.c (expand_increment): When enqueing a postincrement for a MEM, + use copy_to_reg if address is not a general_operand. + +Fri Oct 31 00:16:55 1997 J"orn Rennecke + + * profile.c (output_func_start_profiler): Clear flag_inline_functions + for the duration of the call to rest_of_compilation. + +Thu Oct 30 14:40:10 1997 Doug Evans + + * configure.in (sparc-*-elf*): Use sparc/elf.h, sparc/t-elf. + Set extra_parts. + (sparc*-*-*): Recognize --with-cpu=v9. + * sparc/elf.h: New file. + * sparc/t-elf: New file. + +Thu Oct 30 13:26:12 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300.c (const_8bit_operand): New function. + (mask_ok_for_mem_btst): New function. + * mn10300.md (btst patterns with mem operands): Use new functions + to avoid creating btst instructions with invalid operands. + +Wed Oct 29 16:57:19 1997 Michael Meissner + + * rs6000/xm-sysv4.h: Include xm-linux.h instead of xm-svr4.h if we + are running on PowerPC Linux. + +Wed Oct 29 13:10:11 1997 Gavin Koch + + * config/mips/elf64.h (PREFERRED_DEBUGGING_TYPE): Only define + if not previously defined. + +Tue Oct 28 23:55:27 1997 Doug Evans (devans@cygnus.com) + + * function.c (assign_parms): Correct mode of stack_parm if + entry_parm underwent a mode conversion. + +1997-10-28 Brendan Kehoe + + * global.c (global_alloc): Use xmalloc instead of alloca for + CONFLICTS, since max_allocno * allocno_row_words alone can be more + than 2.5Mb sometimes. + +Tue Oct 28 15:29:15 1997 Richard Henderson + + * reload1.c (eliminate_regs [SET]): If [SUBREG] widened the mode of + DEST for the spill, adjust mode of SRC to compensate. + +Tue Oct 28 14:36:45 1997 Richard Henderson + + * alpha.md (reload_inqi): Check for MEM before strict_memory_address_p, + since any_memory_operand() allows pseudos during reload. + (reload_inhi, reload_outqi, reload_outhi): Likewise. + +Tue Oct 28 11:53:14 1997 Jim Wilson + + * m68k.md (btst patterns): Add 5200 support. + +Tue Oct 28 11:58:40 1997 Toon Moene + + * fold-const.c (fold): For ((a * C1) / C3) or (((a * C1) + C2) / C3) + optimizations, look inside dividend to determine if the expression + can be simplified by using EXACT_DIV_EXPR. + +Tue Oct 28 10:19:01 1997 Jason Merrill + + From Brendan: + * dwarf2out.c (output_call_frame_info): Use l1 instead of ".". + +Tue Oct 28 00:32:14 1997 Richard Henderson + + * alpha.c (summarize_insn [SUBREG]): Propagate SET. + +Mon Oct 27 23:59:26 1997 Richard Henderson + + * alpha.c (alpha_handle_trap_shadows): Don't call get_attr_trap + on a CLOBBER. + +Mon Oct 27 21:25:20 1997 Richard Henderson + + * alpha.md (movqi, movhi): Make sure new insns created during reload + won't need reloading themselves. + (reload_inqi, reload_inhi, reload_outqi, reload_outhi): Likewise. + +Mon Oct 27 16:11:10 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Disable reg+reg. + +Sun Oct 26 13:50:44 1997 Richard Henderson + + * alpha.c (alpha_sa_mask [VMS]): Don't include $26 in the mask. + Patch from Klaus Kaempf . + +Sun Oct 26 13:31:47 1997 Jim Wilson (wilson@cygnus.com) + + * expr.c (expand_expr, case INDIRECT_REF): Optimize a reference + to an element in a constant string. + +Sun Oct 26 11:41:49 1997 Jason Merrill + + * dwarf2out.c (output_call_frame_info): The CIE pointer is now a 32 + bit PC-relative offset. The exception range table pointer is now in + the CIE. + * frame.c (dwarf_cie, dwarf_fde): Rename CIE_pointer to CIE_delta. + (count_fdes, add_fdes, get_cie): Adjust. + (cie_info, extract_cie_info, __frame_state_for): Adjust eh_ptr uses. + + From H.J. Lu: + * frame.c (count_fdes, add_fdes): Skip linked once FDE entries. + +Sun Oct 26 11:52:01 1997 Richard Henderson + + * alias.c (memrefs_conflict_p): Treat arg_pointer_rtx just + like stack_pointer_rtx. + +Sun Oct 26 11:32:16 1997 Manfred Hollstein + + * Makefile.in (bootstrap-lean): Combined with `normal' bootstrap + targets using "$@" to provide support for similar but not identical + targets without having to duplicate code. + (bootstrap4): New goal. + + * Makefile.in (compare, compare-lean, compare3): Combined to one + ruleset determining actions to be performed via $@. + (compare4, compare4-lean): New targets. + (gnucompare, gnucompare3): Combined to one ruleset determining + actions to be performed via $@. Also, note which files failed + the comparison test in .bad_compare. + (gnucompare-lean, gnucompare3-lean, gnucompare4-lean): New targets. + +Sun Oct 26 10:06:11 1997 Toon Moene + + * fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPR + if the dividend is a multiple of the divisor. + +Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (LIBGCC2_CFLAGS): Add -fexceptions. + + * alias.c (find_base_term): Handle PRE_INC, PRE_DEC, POST_INC, + and POS_DEC. + + * alias.c (true_dependence): Fix typo. + + * toplev.c (flag_rerun_loop_opt): New variable. + (f_options): Handle -frerun-loop-opt. + (rest_of_compilation): If -frerun-loop-opt, then run the loop + optimizer twice. + (main): Enable -frerun-loop-opt by default for -O2 or greater. + + * loop.c (simplify_giv_expr): Adding two invariants results + in an invariant. + +Sun Oct 26 09:15:15 1997 Richard Henderson + + * expr.c (get_inner_reference): Remove the array bias after + converting the index to Pmode. + +Sat Oct 25 12:20:58 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300.h (TARGET_SWITCHES): Add -mmult-bug and -mno-mult-bug. + (TARGET_MULT_BUG): Define. + (TARGET_DEFAULT): Default to TARGET_MULT_BUG. + * mn10300.md (mulsi3): Handle TARGET_MULT_BUG. + +Fri Oct 24 17:40:34 1997 Jeffrey A Law (law@cygnus.com) + + * mn10200.c (indirect_memory_operand): Delete unused function. + * mn10200.h (EXTRA_CONSTRAINT): Handle 'R'. + * mn10200.md (bset, bclr insns): Handle output in a reg too. + +Fri Oct 24 15:54:57 1997 Richard Henderson + + * alpha.md (call patterns): Revert Oct 16 change; if we are to elide + the callee's ldgp, we must do it ourselves, and we use the jsr tag + for more than scheduling. + +Fri Oct 24 13:23:04 1997 Doug Evans + + * sparc/sparc.h (ASM_SPEC): Delete asm_arch. + +Fri Oct 24 13:19:40 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300.c (symbolic_operand, legitimize_address): New functions. + * mn10300.h (LEGITIMIZE_ADDRESS): Call legitimize_address. + (GO_IF_LEGITIMATE_ADDRESS): Don't allow base + symbolic. + +Thu Oct 23 09:35:12 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Oct 23 08:03:59 1997 J"orn Rennecke + + * dbxout.c (dbxout_start_new_source_file): Use output_quoted_string + for FILENAME. + +Wed Oct 22 00:34:12 1997 Jeffrey A Law (law@cygnus.com) + + * toplev.c (flag_exceptions): Default value is 2. + (compile_file): If flag_exceptions still has the value 2, then + set it to 0. + + * rs6000.c (struct machine_function): Add pic_offset_table_rtx. + (rs6000_save_machine_status): Save pic_offset_table_rtx. + (rs6000_restore_machine_status: Restore pic_offset_table_rtx. + + * local-alloc.c (block_alloc): Don't lose if two SCRATCH expressions + are shared. + + * rs6000.md (*movsi_got_internal_mem): New pattern. + (*movsi_got_internal_mem splitter): New define_split. + +Tue Oct 21 18:14:03 1997 Jim Wilson + + * obstack.h (obstack_empty_p): Fix spurious space after backslash. + +Tue Oct 21 18:34:01 1997 Geoffrey KEATING + + * rs6000.c: Avoid creating a stack frame under SYSV ABI if we + only need to save LR. + +Tue Oct 21 10:06:40 1997 Jeffrey A Law (law@cygnus.com) + + * mn10300.md (movqi, movhi): Avoid using address registers as + destinations unless absolutely necessary. + + * mn10200.c (expand_prologue): Fix typo. + + * mn10200.h (GO_IF_LEGITIMATE_ADDRESS): Do not allow indexed + addresses. + * mn10200.md (neghi2): Provide an alternative which works if + the input and output register are the same. + + * mn10300.c (print_operand): Handle 'S'. + * mn10300.md (ashlsi3, lshrsi3, ashrsi3): Use %S for + shift amount in last alternative. + + * mn10300.c (expand_epilogue): Rework to handle register restores + in "ret" and "retf" instructions correctly. + +Mon Oct 20 16:47:08 1997 Jim Wilson + + * expmed.c (extract_bit_field): Don't make flag_force_mem disable + extzv for memory operands. + + * cse.c (simplify_ternary_operation, case IF_THEN_ELSE): Collapse + redundant conditional moves to single operand. + +Mon Oct 20 15:30:26 1997 Nick Clifton + + * v850.h: Move define of __v850__ from CPP_PREDEFINES + to CPP_SPEC. + + * xm-v850.h: Use __v850 rather than __v850__ to + identify v850 port. + +Mon Oct 20 14:15:02 1997 Jim Wilson + + * mips/mips.c (compute_frame_size): Not a leaf function if + profile_flag set. + +Mon Oct 20 14:16:38 1997 Geoffrey KEATING + + * rs6000/t-ppccomm: Use -msdata=none for crtstuff. + +Mon Oct 20 12:28:17 1997 Doug Evans + + * sparc/sparc.h (SPARC_V9,SPARC_ARCH64): Delete. + (DEFAULT_ARCH32_P): New macro. + (TARGET_ARCH{32,64}): Allow compile time or runtime selection. + (enum cmodel): Declare. + (sparc_cmodel_string,sparc_cmodel): Declare. + (SPARC_DEFAULT_CMODEL): Provide default. + (TARGET_{MEDLOW,MEDANY}): Renamed to TARGET_CM_{MEDLOW,MEDANY}. + (TARGET_FULLANY): Deleted. + (TARGET_CM_MEDMID): New macro. + (CPP_CPU_DEFAULT_SPEC): Renamed from CPP_DEFAULT_SPEC. + (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. + (CPP_PREDEFINES): Take out stuff now handled by %(cpp_arch). + (CPP_SPEC): Rewrite. + (CPP_ARCH{,32,64,_DEFAULT}_SPEC): New macros. + (CPP_{ENDIAN,SUBTARGET}_SPEC): New macros. + (ASM_ARCH{,32,64,_DEFAULT}_SPEC): New macros. + (ASM_SPEC): Add %(asm_arch). + (EXTRA_SPECS): Rename cpp_default to cpp_cpu_default. + Rename asm_default to asm_cpu_default. + Add cpp_arch32, cpp_arch64, cpp_arch_default, cpp_arch, cpp_endian, + cpp_subtarget, asm_arch32, asm_arch64, asm_arch_default, asm_arch. + (NO_BUILTIN_{PTRDIFF,SIZE}_TYPE): Define ifdef SPARC_BI_ARCH. + ({PTRDIFF,SIZE}_TYPE): Provide 32 and 64 bit values. + (MASK_INT64,MASK_LONG64): Delete. + (MASK_ARCH64): Renamed to MASK_64BIT. + (MASK_{MEDLOW,MEDANY,FULLANY,CODE_MODEL}): Delete. + (EMBMEDANY_BASE_REG): Renamed from MEDANY_BASE_REG. + (TARGET_SWITCHES): Always provide 64 bit options. + (ARCH64_SWITCHES): Delete. + (TARGET_OPTIONS): New option -mcmodel=. + (INT_TYPE_SIZE): Always 32. + (MAX_LONG_TYPE_SIZE): Define ifdef SPARC_BI_ARCH. + (INIT_EXPANDERS): sparc64_init_expanders renamed to sparc_init_.... + (FUNCTION_{,BLOCK_}PROFILER): Delete TARGET_EMBMEDANY support. + (PRINT_OPERAND_PUNCT_VALID_P): Add '_'. + * sparc/linux-aout.h (CPP_PREDEFINES): Take out stuff handled by + CPP_SPEC. + (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. + * sparc/linux.h: Likewise. + * sparc/linux64.h (SPARC_V9,SPARC_ARCH64): Delete. + (ASM_CPU_DEFAULT_SPEC): Renamed from ASM_DEFAULT_SPEC. + (TARGET_DEFAULT): Delete MASK_LONG64, MASK_MEDANY, add MASK_64BIT. + (SPARC_DEFAULT_CMODEL): Define. + (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. + (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. + (LONG_DOUBLE_TYPE_SIZE): Define. + (ASM_SPEC): Add %(asm_arch). + * sparc/sol2.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. + (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. + (TARGET_CPU_DEFAULT): Add ultrasparc case. + * sparc/sp64-aout.h (SPARC_V9,SPARC_ARCH64): Delete. + (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. + (SPARC_DEFAULT_CMODEL): Define. + * sparc/sp64-elf.h (SPARC_V9,SPARC_ARCH64): Delete. + (TARGET_DEFAULT): MASK_ARCH64 renamed to MASK_64BIT. Delete + MASK_LONG64, MASK_MEDANY. + (SPARC_DEFAULT_CMODEL): Define. + (CPP_PREDEFINES): Delete. + (CPP_SUBTARGET_SPEC): Renamed from CPP_SPEC. + (ASM_SPEC): Add %(asm_arch). + (LONG_DOUBLE_TYPE_SIZE): Define. + (DWARF2_DEBUGGING_INFO): Define. + * sparc/splet.h (CPP_SPEC): Delete. + * sparc/sysv4.h (CPP_PREDEFINES): Take out stuff handled by CPP_SPEC. + (FUNCTION_BLOCK_PROFILER): Delete TARGET_EMBMEDANY support. + (BLOCK_PROFILER): Likewise. + * sparc/sparc.c (sparc_cmodel_string,sparc_cmodel): New globals. + (sparc_override_options): Handle code model selection. + (sparc_init_expanders): Renamed from sparc64_init_expanders. + * sparc/sparc.md: TARGET_ renamed to TARGET_CM_.... + TARGET_MEDANY renamed to TARGET_CM_EMBMEDANY. + (sethi_di_embmedany_{data,text}): Renamed from sethi_di_medany_.... + (sethi_di_fullany): Delete. + +Mon Oct 20 02:00:18 1997 Klaus Kaempf + Jeff Law + Richard Kenner + + * alpha/vms.h (DIVSI3_LIBCALL): OTS$ functions are upper case. + (DIVDI3_LIBCALL, UDIVSI3_LIBCALL, UDIVDI3_LIBVALL): Likewise. + (MODSI3_LIBCALL, MODDI3_LIBCALL): Likewise. + (UMODSI3_LIBCALL, UMODDI3_LIBCALL): Likewise. + * alpha/alpha.md (arg_home): Likewise. + + * alpha/alpha.c (vmskrunch): Delete. + * alpha/vms.h (ENCODE_SECTION_INFO, ASM_DECLARE_FUNCTION_NAME): Delete. + * alpha.c (output_prolog, VMS): Use alloca for entry_label and don't + truncate to 64 characters. + + * make-l2.com: Support openVMS/Alpha. + + * vmsconfig.com: Fix to work on openVMS/Alpha and openVMS/VAX. + +Sun Oct 19 19:00:35 1997 J"orn Rennecke + + * longlong.h (count_leading_zeros): Add missing casts to USItype. + +Sun Oct 19 18:44:06 1997 Jeffrey A Law (law@cygnus.com) + + * i386/bsd386.h (ASM_COMMENT_START): Define. + +Sat Oct 18 13:47:15 1997 Jason Merrill + + * tree.c (restore_tree_status): Also free up temporary storage + when we finish a toplevel function. + (dump_tree_statistics): Print stats for backend obstacks. + +Sat Oct 18 12:47:31 1997 Doug Evans + + * expr.c (use_group_regs): Don't call use_reg for MEMs. + +Sat Oct 18 09:49:46 1997 Jason Merrill + + * libgcc2.c (__throw): Don't copy the return address. + * dwarf2out.c (expand_builtin_dwarf_reg_size): Ignore return address. + + * except.c (exceptions_via_longjmp): Initialize to 2 (uninitialized). + * toplev.c (main): Initialize exceptions_via_longjmp. + + * tree.c: Add extra_inline_obstacks. + (save_tree_status): Use it. + (restore_tree_status): If this is a toplevel inline obstack and we + didn't want to save anything on it, recycle it. + (print_inline_obstack_statistics): New fn. + * function.c (pop_function_context_from): Pass context to + restore_tree_status. + * obstack.h (obstack_empty_p): New macro. + +Sat Oct 18 00:43:59 1997 Jeffrey A Law (law@cygnus.com) + + * i386/freebsd.h (ASM_COMMENT_START): Fix. + +Fri Oct 17 23:48:52 1997 Jim Wilson (wilson@cygnus.com) + + * v850.c (ep_memory_offset): New function. + (ep_memory_operand, substitute_ep_register, v850_reorg): Call it. + + * v850.h (CONST_OK_FOR_*): Add and correct comments. + (CONSTANT_ADDRESS_P): Add comment. + (EXTRA_CONSTRAINT): Define 'U'. + * v850.md: Add comments on bit field instructions. + (addsi3): Delete &r/r/r alternative. Add r/r/U alternative. + (lshrsi3): Use N not J constraint. + + * v850.md (v850_tst1+1): New define_split for tst1 instruction. + + * v850.c (reg_or_0_operand): Call register_operand. + (reg_or_int5_operand): Likewise. + * v850.h (MASK_BIG_SWITCH, TARGET_BIG_SWITCH): New macros. + (TARGET_SWITCHES): Add "big-switch". + (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT, CASE_VECTOR_MODE, + ASM_OUTPUT_BEFORE_BASE_LABEL): Add support for TARGET_BIG_SWITCH. + (CASE_DROPS_THROUGH): Comment out. + (CASE_VECTOR_PC_RELATIVE, JUMP_TABLES_IN_TEXT_SECTION): Define. + * v850.md (cmpsi): Delete compare mode. + (casesi): New pattern. + + * v850.h (CONST_OK_FOR_N): Delete redundant compare against zero. + * v850.md (ashlsi3): Use SImode not QImode for shift count. + (lshrsi3): Likewise. + + * v850.c (print_operand): Add 'c', 'C', and 'z' support. Delete + unreachable switch statement after 'b' support. Remove "b" from + strings for 'b' support. + * v850.md (branch_normal, branch_invert): Change %b to b%b. + +Fri Oct 17 23:33:20 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (LIBGCC2_CFLAGS): Avoid a backslash then an + empty line if @inhibit_libc@ is empty. + +Fri Oct 17 23:24:40 1997 Robert Lipe (robertl@dgii.com) + + * i386/sco5.h: Let ELF use dwarf2 unwinding. COFF uses sjlj. + (EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF): Defined. + (EH_FRAME_SECTION_ASM_OP_COFF): Likewise. + (DWARF2_UNWIND_INFO): Let this track object file format. + (EXTRA_SECTIONS): Add in_eh. + (EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF): Define. + (EH_FRAME_SECTION_ASM_OP_COFF): Likewise. + +Fri Oct 17 17:13:42 1997 David S. Miller + + * sparc/linux64.h (LINK_SPEC): Dynamic linker is ld-linux64.so.2. + * sparc/sparc.h (FUNCTION_PROFILER): Fix format string when + TARGET_MEDANY. + * sparc/sparc.c (dwarf2out_cfi_label): Extern no longer needed. + (output_double_int): Output DI mode values correctly when + HOST_BITS_PER_WIDE_INT is 64. + (output_fp_move_quad): If TARGET_V9 and not TARGET_HARD_QUAD, use + fmovd so it works if a quad float ends up in one of the upper 32 + float regs. + * sparc/sparc.md (pic_{lo_sum,sethi}_di): New patterns + necessary for PIC support on sparc64. + +Fri Oct 17 13:39:56 1997 Doug Evans + + * sparc/sp64-elf.h (TARGET_DEFAULT): Delete MASK_STACK_BIAS. + * sparc/sparc.h (PROMOTE_MODE): Promote small ints if arch64. + (PROMOTE_FUNCTION_ARGS,PROMOTE_FUNCTION_RETURN): Define. + (SPARC_FIRST_FP_REG, SPARC_FP_REG_P): New macros. + (SPARC_{OUTGOING,INCOMING}_INT_ARG_FIRST): New macros. + (SPARC_FP_ARG_FIRST): New macro. + (CONDITIONAL_REGISTER_USAGE): All v9 fp regs are volatile now. + (REG_ALLOC_ORDER,REG_LEAF_ALLOC_ORDER): Reorganize fp regs. + (NPARM_REGS): There are 32 fp argument registers now. + (FUNCTION_ARG_REGNO_P): Likewise. + (FIRST_PARM_OFFSET): Update to new v9 abi. + (REG_PARM_STACK_SPACE): Define for arch64. + (enum sparc_arg_class): Delete. + (sparc_arg_count,sparc_n_named_args): Delete. + (struct sparc_args): Redefine and use for arch32 as well as arch64. + (GET_SPARC_ARG_CLASS,ROUND_REG,ROUND_ADVANCE): Delete. + (FUNCTION_ARG_ADVANCE): Rewrite. + (FUNCTION_ARG,FUNCTION_INCOMING_ARG): Rewrite. + (FUNCTION_ARG_{PARTIAL_NREGS,PASS_BY_REFERENCE}): Rewrite. + (FUNCTION_ARG_CALLEE_COPIES): Delete. + (FUNCTION_ARG_{PADDING,BOUNDARY}): Define. + (STRICT_ARGUMENT_NAMING): Define. + (doublemove_string): Declare. + * sparc/sparc.c (sparc_arg_count,sparc_n_named_args): Delete. + (single_move_string): Use GEN_INT, and HOST_WIDE_INT. + (doublemove_string): New function. + (output_move_quad): Clean up some of the arch64 support. + (compute_frame_size): Add REG_PARM_STACK_SPACE if arch64. + Don't add 8 bytes of reserved space if arch64. + (sparc_builtin_saveregs): Combine arch32/arch64 versions. + (init_cumulative_args): New function. + (function_arg_slotno): New static function. + (function_arg,function_arg_partial_nregs): New functions. + (function_arg_{pass_by_reference,advance}): New functions. + (function_arg_padding): New function. + * ginclude/va-sparc.h: Rewrite v9 support. + +Fri Oct 17 12:29:48 1997 Christian Iseli + + * regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P + for hard regs to determine base and index registers. + + * reload.c (debug_reload_to_stream): New function. Specify stream + into which to write debug info. + (debug_reload): Modify to call debug_reload_to_stream with stderr. + +Thu Oct 16 15:07:51 1997 Richard Henderson + + * combine.c (can_combine_p): Don't combine with an asm whose + output is a hard register. + +Thu Oct 16 15:43:26 1997 Mike Stump + + * c-decl.c (start_struct): Ensure that structs with forward + declarations are in fact packed when -fpack-struct is given. + + * stor-layout.c (layout_record): Ignore STRUCTURE_SIZE_BOUNDARY if + we are packing a structure. This allows a structure with only + bytes to be aligned on a byte boundary and have no padding on a + m68k. + +Thu Oct 16 15:17:54 1997 Richard Kenner + + * rs6000.h (ROUND_TYPE_ALIGN): Don't blow up if no fields in record. + +Thu Oct 16 11:20:30 1997 Richard Henderson + + * alpha.c (alpha_return_addr_rtx): New variable. + (alpha_save_machine_status): New; save it. + (alpha_restore_machine_status): New; restore it. + (alpha_init_expanders): New; clear it. + (alpha_return_addr): New; set it. + (alpha_ra_ever_killed): New; if alpha_return_addr_rtx, regs_ever_live + is overly conservative, so search the insns explicitly. + (alpha_sa_mask [VMS]): Check alpha_ra_ever_killed. + (alpha_sa_size [VMS && !VMS]): Likewise. + * alpha.h (RETURN_ADDR_RTX): Call alpha_return_addr. + (INIT_EXPANDERS): New definition. + + * alpha.c: Move REG_PV, REG_RA somewhere more visible in the file. + (output_prolog [!VMS]): Use them. + + * alpha.c (output_prolog [!VMS]): Move gp detection to ... + (alpha_does_function_need_gp): ... a new function. Refine the + CALL_INSN test to just TYPE_JSR. + * alpha.md (most call insns): Fix some jsr/ibr type transpositions. + +Thu Oct 16 09:36:47 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Wed Oct 15 21:38:18 1997 Richard Kenner + + * pa.c (move_operand): Respect -mdisable-indexing. + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Likewise. + +Wed Oct 15 21:34:45 1997 David Edelsohn + + * rs6000.md (udivsi3, divsi3): Split into MQ and non-MQ cases for + PPC601. + (umulsidi3,umulsi3_highpart): Likewise. + (smulsi3_highpart_no_mq): Add !TARGET_POWER. + +Wed Oct 15 18:21:46 1997 Richard Henderson + + * alpha.c (final_prescan_insn): Gut, remove and transform to ... + (alpha_handle_trap_shadows): ... a new function. Handle the entire + function in one go. Emit RTL for trapb, instead of printf directly. + (alpha_reorg): New function. Call alpha_handle_trap_shadows. + (trap_pending): Kill global variable. + (output_epilog): Don't call final_prescan_insn. + (struct shadow_summary): Elide $31 and $f31; now it fits in a word. + * alpha.h (FINAL_PRESCAN_INSN): Remove. + (MACHINE_DEPENDENT_REORG): Define. + * alpha.md (jsr patterns with trapb): Stupid and useless. Kill. + (trapb): New insn. + +Wed Oct 15 18:16:05 1997 Richard Henderson + + Tune Haifa scheduler for Alpha: + * alpha.h (ISSUE_RATE): Define. + * alpha.c (alpha_adjust_cost): Handle EV5 mult delay; don't apply + EV4 adjustments to EV5. + * alpha.md: Remove all scaling from function unit delays. Rework + EV5 function units to match the CPU. + (umuldi3_highpart): EV5 added the IMULH insn class. + +Wed Oct 15 17:42:41 1997 Jeffrey A Law (law@cygnus.com) + + * pa.c (following_call): Fail if the CALL_INSN is an indirect + call. + +Tue Oct 14 12:01:00 1997 Mark Mitchell + + * cplus-dem.c (demangle_signature): Don't look for return types on + constructors. Handle member template constructors. + +Tue Oct 14 11:30:29 1997 Jason Merrill + + * tree.c (expr_tree_cons, build_expr_list, expralloc): New fns. + * tree.h: Declare them. + +Fri Oct 10 13:46:56 1997 Doug Evans + + * configure.in: Handle --with-newlib. + * Makefile.in (LIBGCC2_CFLAGS): Add @inhibit_libc@. + + * sparc/t-sp64 (LIBGCC2_CFLAGS): Delete. + +Wed Oct 8 14:37:44 1997 Jeffrey A Law (law@cygnus.com) + + * config/ptx4.h: Fix typo. + +Wed Oct 8 08:57:20 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Oct 7 16:27:34 1997 Manfred Hollstein + + * aclocal.m4: Substitute INSTALL. + * configure: Re-built. + +Tue Oct 7 15:37:35 1997 Jeffrey A Law (law@cygnus.com) + + * integrate.c (save_for_inline_copying): Avoid undefined pointer + operations. + (expand_inline_function): Likewise. + + * dwarf2out.c (output_call_frame_info): Reinstate last change + using flag_debug_asm check instead of flag_verbose_asm. + +Tue Oct 7 12:57:26 1997 Jim Wilson + + * dwarf2out.c (output_call_frame_info): Remove last change. + +1997-10-04 Andreas Schwab + + * frame.c (__frame_state_for): Execute the FDE insns until the + current pc value is strictly bigger than the target pc value. + +Tue Oct 7 11:00:42 1997 Jason Merrill + + * regclass.c (init_reg_modes): If we can't find a mode for the + register, use the previous one. + +Tue Oct 7 10:55:34 1997 Richard Henderson + + * haifa-sched.c (print_block_visualization): Call fprintf directly, + don't sprintf through an alloca'ed buffer. + +Tue Oct 7 10:52:29 1997 Thomas Koenig (ig25@rz.uni-karlsruhe.de) + + * reload.c (decompose): Always initialize val.base. + +Tue Oct 7 10:19:26 1997 Manfred Hollstein (manfred@lts.sel.alcatel.de) + + * m68k/mot3300.h (ASM_OUTPUT_ALIGN): Accept any alignment + instead of aborting. + * dwarf2out.c (output_call_frame_info): Call app_enable and + app_disable to let GNU as accept the generated comments. + +Tue Oct 7 11:41:21 1997 Michael Meissner + + * tree.h (get_file_function_name): Add declaration. + * dwarf2out.c (output_call_frame_info): No need to cast + get_file_function_name call anymore. + * profile.c (toplevel): Remove get_file_function_name + declaration. + * c-lang.c (finish_file): Likewise. + +Tue Oct 7 10:01:45 1997 Chip Salzenberg + + * Makefile.in (program_transform_name): Let autoconf substitute + the correct value. + +Tue Oct 7 09:54:35 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (schedule_block): If the first real insn in a + block has any special notes attached to it, remove them. + +Tue Oct 7 09:48:51 1997 Richard Henderson + + * alpha.h (FLOAT_STORE_FLAG_VALUE): It's 2.0 not 0.5. + +Mon Oct 6 12:47:32 1997 Manfred Hollstein (manfred@lts.sel.alcatel.de) + + * m88k.c (m88k_begin_prologue): Remove superfluous backslash. + +Mon Oct 6 12:04:24 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (check-g77): New test target. + (CHECK-TARGETS): Add check-g77. + +Fri Oct 3 11:56:36 1997 Jason Merrill + + * toplev.c (rest_of_compilation): Defer all non-nested inlines. + +Fri Oct 3 15:49:27 1997 Michael Meissner + + * flow.c (print_rtl_with_bb): Cast alloca return value for + in_bb_p. + +Thu Oct 2 21:15:03 1997 Richard Henderson + + * i386.h (RETURN_ADDR_RTX): New definition that works for + __builtin_return_address(0) and -fomit-frame-pointer. + +Wed Oct 1 13:43:53 1997 Jim Wilson + + Bring over from FSF. + Tue Aug 5 16:10:45 1997 Jason Merrill + + * mips.c (function_arg): Handle passing a struct + containing a double in a DFmode register without the PARALLEL. + +Wed Oct 1 11:13:25 1997 Ian Lance Taylor + + * pexecute.c: Use spawn if __CYGWIN32__. + + * pexecute.c: Include "config.h" first, as per autoconf manual + (from Paul Eggert ). + +Wed Oct 1 01:44:36 1997 Philippe De Muyter + + * m68k/x-mot3300 (XCFLAGS): Disable as's long/short jump + optimization for f/expr.o and f/stb.o. + +Tue Sep 30 23:48:57 1997 Jeffrey A Law (law@cygnus.com) + + * cse.c (this_insn_cc0_mode): Initialize. + +Tue Sep 30 23:09:40 1997 Thomas Koenig + + * cccp.c (expand_to_temp_buffer): Initialize all members of obuf. + + * haifa-sched.c (get_block_head_tail): Remove unneeded initialization. + +Tue Sep 30 23:06:43 1997 Richard Henderson + + * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since + that pair will dual-issue on the 21164 and plus+beq won't. + (bne): Likewise for cmpeq+beq. + +Tue Sep 30 16:07:58 1997 Jim Wilson + + * except.c (find_exception_handler_labels): Correct argument to free. + +Tue Sep 30 11:00:00 1997 Brendan Kehoe + + * except.c (find_exception_handler_labels): Free LABELS when we're + done. + +Mon Sep 29 14:04:35 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 29 10:51:53 1997 Jason Merrill + + * flow.c (find_basic_blocks): Mark calls as potentially jumping + to the EH labels. + +Mon Sep 29 09:58:06 1997 Jeffrey A Law (law@cygnus.com) + + * configure.in: Substitute for "install" too. + * configure: Rebuilt. + +Mon Sep 29 00:38:42 1997 Aaron Jackson + + * Makefile.in (bootstrap-lean, compare-lean): New targets. + +Mon Sep 29 00:18:16 1997 Richard Henderson (rth@cygnus.com) + + * alias.c (base_alias_check): Two symbols can conflict if they + are accessed via AND. + (memrefs_conflict_p): Likewise. + + * alpha.h (SETUP_INCOMING_VARARGS): Emit a blockage insn + after flushing argument registers to the stack. + + * Makefile.in (mostlyclean): Remove .regmove files. + +Sun Sep 28 18:59:58 1997 Jason Merrill + + * libgcc2.c (__throw): Fix thinko. + +Sun Sep 28 12:00:52 1997 Mark Mitchell + + * cplus-dem.c (demangle_template): Add new parameter. Handle new + template-function mangling. + (consume_count_with_underscores): New function. + (demangle_signature): Handle new name-mangling scheme. + +Sun Sep 28 01:55:04 1997 Philippe De Muyter + + * flow.c (print_rtl_with_bb): Cast alloca return values for variables + start and end. + +Sun Sep 28 01:05:16 1997 Jeffrey A Law (law@cygnus.com) + + * frame.c: Remove last change. + * dwarf2.h: Remove last change. + * tree.h: Add declarations of DWARF2 unwind info support + functions. + +Sat Sep 27 11:02:38 1997 Jason Merrill + + * c-decl.c (init_decl_processing): Add __builtin_dwarf_reg_size. + * tree.h (built_in_function): Likewise. + * expr.c (expand_builtin): Likewise. + * except.h: Likewise. + * dwarf2out.c (expand_builtin_dwarf_reg_size): New fn. + * libgcc2.c (copy_reg): New fn. + (__throw): Use it. + +Fri Sep 26 08:54:59 1997 Paul Eggert + + * c-typeck.c (build_binary_op): Warn about comparing signed vs + unsigned if -W is specified and -Wno-sign-compare is not. + * c-decl.c (warn_sign_compare): Initialize to -1. + (c_decode_option): -Wall no longer implies -Wsign-compare. + +Fri Sep 26 09:00:13 1997 Andreas Schwab + + * frame.c: Include gansidecl.h for PROTO. + * dwarf2out.c: Move inclusion of dwarf2.h down so that PROTO is + defined. Don't declare dwarf2out_cfi_label here. + * dwarf2.h: Add declarations of DWARF2 unwind info support + functions. + * m68k.c: Include dwarf2.h. + (output_function_prologue): Add dwarf2 support. + * m68k.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_REGNUM): New macros. + (INCOMING_FRAME_SP_OFFSET): Likewise. + + * integrate.c (expand_inline_function): Make sure there is at + least one insn that can be used as an insertion point. + +Wed Sep 24 21:34:06 1997 Jason Merrill + + * dwarf2out.c: s/flag_verbose_asm/flag_debug_asm/ + +Wed Sep 24 22:05:30 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Wed Sep 24 17:36:23 1997 Doug Evans + + Bring over from FSF. + + Wed Sep 24 19:17:08 1997 Doug Evans + + * sparc/sparc.md (get_pc_via_call): Renamed from get_pc_sp32. + (get_pc_via_rdpc): Renamed from get_pc_sp64. + * sparc/sparc.c (finalize_pic): Update call to gen_get_pc_via_call. + + Wed Sep 24 18:38:22 1997 David S. Miller + + * sparc/sparc.h (ASM_CPU_SPEC): Pass -Av9a for v8plus, ultrasparc. + (TARGET_OPTIONS): Add -malign-loops=, -malign-jumps=, + -malign-functions=. + (sparc_align_{loops,jumps,funcs}_string): Declare. + (sparc_align_{loops,jumps,funcs}): Declare. + (DEFAULT_SPARC_ALIGN_FUNCS): New macro. + (FUNCTION_BOUNDARY): Use sparc_align_funcs. + (STACK_BIAS): Define. + (SPARC_SIMM*_P): Cast to unsigned HOST_WIDE_INT first, then perform + test. + (SPARC_SETHI_P): New macro. + (CONST_OK_FOR_LETTER_P): Use it. + (ASM_OUTPUT_ALIGN_CODE): Define. + (ASM_OUTPUT_LOOP_ALIGN): Define. + * sparc/sparc.c (sparc_align_{loops,jumps,funcs}_string): New globals. + (sparc_align_{loops,jumps,funcs}): New globals. + (sparc_override_options): Handle -malign-loops=, -malign-jumps=, + -malign-functions=. + (move_operand): Use SPARC_SETHI_P. + (arith_double_operand): Cast to unsigned HOST_WIDE_INT first, then + perform test. + (arith11_double_operand): Likewise. + (arith10_double_operand): Likewise. + (finalize_pic): Finish sparc64 support. + (emit_move_sequence): Use SPARC_SETHI_P. Simplify low part of + 64 bit constants if able. + (output_fp_move_quad): Don't use fmovq unless TARGET_HARD_QUAD. + (sparc_builtin_saveregs, sparc64 case): Don't save fp regs if + ! TARGET_FPU. + * sparc/sparc.md (*): Use GEN_INT instead of gen_rtx. + (get_pc_sp32): Use for sparc64 as well. + (lo_sum_di_sp{32,64}): Fix handling on 64 bit hosts. + (sethi_di_sp64_const): Likewise. + (movtf_cc_sp64): Check TARGET_HARD_QUAD. + (cmp_zero_extract_sp64): Use unsigned HOST_WIDE_INT in cast. + (ashlsi3, ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise. + + Tue Sep 23 19:02:46 1997 Doug Evans + + * sparc/linux-aout.h (COMMENT_BEGIN): Delete. + * sparc/linux.h (COMMENT_BEGIN): Likewise. + * sparc/linux64.h (COMMENT_BEGIN): Likewise. + + Tue Sep 23 14:48:18 1997 David S. Miller + + Add sparc64 linux support. + * configure.in (sparc64-*-linux*): Recognize. Add sparc/xm-sparc.h + to xm_file list on 32-bit sparc-linux. + * sparc/xm-sp64.h: New file. + * sparc/linux64.h: New file. + * sparc/xm-linux.h: Include some standard headers if not inhibit_libc. + Don't include xm-sparc.h. + * config/xm-linux.h (HAVE_PUTENV, HAVE_ATEXIT): Define. + * glimits.h (LONG_MAX): Handle sparc64. + + Sat Sep 20 03:07:54 1997 Doug Evans + + * sparc/sysv4.h (ASM_COMMENT_START): Delete. + * sparc.h (ASM_COMMENT_START): Define. + * sparc.c (output_function_prologue): Use it. + (sparc_flat_output_function_{epi,pro}logue): Likewise. + + Wed Sep 17 15:04:19 1997 Doug Evans + + * sparc/sysv4.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Delete, + use sparc.h's copies. + * sparc/sparc.h (ASM_OUTPUT_{FLOAT,DOUBLE,LONG_DOUBLE}): Print + ascii form as well. + + Mon Sep 8 08:45:19 1997 Richard Kenner + + * sparc.c (dwarf2out_cfi_label): Add declaration. + (save_regs, output_function_prologue): Remove cast for it. + (sparc_flat_{save_restore,output_function_prologue): Likewise. + ({save,restore}_regs): No longer inline. + +Tue Sep 23 12:34:51 1997 Richard Kenner + + * fold-const.c (make_range): Correctly handle cases of converting + from unsigned to signed type. + +Tue Sep 23 12:34:51 1997 Bernd Schmidt + + * fold-const.c (merge_ranges): Make sure that if one range is subset + of another, it will always be the second range. Correct (+,-) case to + account for this. + +Tue Sep 23 08:32:51 1997 Jason Merrill + + * final.c (final_end_function): Also do dwarf2 thing if + DWARF2_DEBUGGING_INFO. + (final_start_function): Likewise. + +Tue Sep 23 01:15:50 1997 David S. Miller + + * expmed.c (expand_divmod): If compute_mode is not the same as + mode, handle the case where convert_modes() causes op1 to no + longer be a CONST_INT. + + * reorg.c (dbr_schedule): At end of this pass, add REG_BR_PRED + note holding get_jump_flags() calculation to all JUMP_INSNs. + * rtl.h (enum reg_note): New note types REG_BR_PRED and REG_SAVE_AREA. + * rtl.c (reg_note_name): Add new note types. + +Tue Sep 23 00:59:54 1997 Jeffrey A Law (law@cygnus.com) + + * rtlanal.c (computed_jump_p): Fix typo in last change. + +Tue Sep 23 00:42:44 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * loop.c (indirect_jump_in_function_p): Return 0 + by default. + +Tue Sep 23 00:33:55 1997 Jeffrey A Law (law@cygnus.com) + + * rs6000/xm-rs6000.h: Fix thinko in last change. + * rs6000/xm-sysv4.h: Likewise. + +Mon Sep 22 19:33:53 1997 Jim Wilson + + * mips.c (save_restore_insns): Only set RTX_FRAME_RELATED_P if store_p. + +Mon Sep 22 14:41:00 1997 Jeffrey A Law (law@cygnus.com) + + * reg-stack.c (find_blocks): Fix thinko in last change. + +1997-09-21 Andreas Schwab + + * m68k.c (output_function_prologue): Add dwarf2 support. + + * m68k.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_REGNUM, + INCOMING_FRAME_SP_OFFSET): New definitions. + +Mon Sep 22 11:36:42 1997 David S. Miller + + * combine.c (try_combine): Use NULL_RTX instead of '0' where + appropriate in calls to gen_rtx(). + * cse.c (cse_main): Likewise. + * emit-rtl.c (gen_label_rtx): Likewise. + * expr.c (init_expr_once): Likewise. + * haifa-sched.c (flush_pending_lists, sched_analyze_insn, + sched_analyze, init_rgn_data_dependences, + compute_block_backward_dependences): Likewise. + * sched.c (schedule_insns): Likewise. + * varasm.c (immed_double_const): Likewise. + + * sparc.h (INCOMING_FRAME_SP_OFFSET): Define to + SPARC_STACK_BIAS for sake of dwarf2 on sparc64. + +Mon Sep 22 11:21:33 1997 J. Kean Johnston + + * i386/sco5.h: Make ELF default file format and add -mcoff/-melf.. + (MULTILIB_DEFAULTS): Define. + (ASM_SPEC, CPP_SPEC): Handle -mcoff. + (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise. + (LIBGCC_SPEC): Likewise. + (MASK_COFF, TARGET_COFF, TARGET_ELF): Define. + (SUBTARGET_SWITCHES): Add -mcoff and -melf. + * i386/t-sco5 (CRTSTUFF_T_CFLAGS): Add -fPIC. + (CRTSTUFF_T_CFLAGS_S): Tweak for COFF. + (EXTRA_PARTS, TAROUTOPTS): Delete. + (libgcc1-elf, libgcc2-elf, libgcc-elf targets): Delete. + (MULTILIB_OPTIONS): Define. + (MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): Likewise. + (MULTILIB_MATCHE, MULTILIB_EXTRA_OPTS): Likewise. + +Mon Sep 22 02:10:43 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Sep 21 17:45:45 1997 Jeffrey A Law (law@cygnus.com) + + * loop.c (loop_number): Delete function. Change all references + to use uid_loop_num array. + * loop.h (loop_number): Delete declaration. + * unroll.c (unroll_loop): Change "loop_number" references to + use uid_loop_num instead. + + * loop.c (loop_unroll_factor): Move outside #ifdef HAIFA + conditional. + (loop_unroll_iter): Remove unused variable and all references. + (loop_optimize): Always allocate and clear space for loop_unroll_factor. + (insert_bct): Fix minor formatting problems. + * loop.h (loop_unroll_factor): Move decl outside #ifdef HAIFA. + (loop_unroll_iter): Removed unused decl. + * unroll.c (unroll_loop): Remove code to set loop_unroll_iter. + Always record the unrolling factor. + + * cse.c (simplify_relational_operation): Set h0u just like h0s. + Similarly for h1u and h1s. + + * flow.c (jmp_uses_reg_or_mem): Deleted unused function. + (find_basic_blocks): Use computed_jump_p to determine if a + particular JUMP_INSN is a computed jump. + * reg-stack.c (find_blocks): Use computed_jump_p to determine + if a particular JUMP_INSN is a computed jump. + * rtlanal.c (jmp_uses_reg_or_mem): New function. + (computed_jump_p): Likewise. + * rtl.h (computed_jump_p): Declare. + * genattrtab.c (pc_rtx): Define and initialize. + * loop.c (loop_optimize): Always determine if the current + function has a computed jump. + (indirect_jump_in_function_p): Use computed_jump_p to determine + if a particular JUMP_INSN is a computed jump. + + * loop.c (fix_bct_param): Delete unused function. + (check_bct_param): Likewise. + +Sat Sep 20 16:22:06 1997 Jason Merrill + + * frame.c (__deregister_frame): Check properly for initialized object. + +Fri Sep 19 20:51:03 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * alpha/linux.h (HANDLE_SYSV_PRAGMA): Defined. + +Fri Sep 19 18:53:50 1997 J"orn Rennecke + + * jump.c (thread_jumps): Check can_reverse_comparison_p before + threading a reversed-condition jump. + + * sched.c (update_flow_info): Don't pass SCRATCH to dead_or_set_p. + * haifa-sched.c (update_flow_info): Likewise. + +Thu Sep 18 21:13:40 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (BOOT_CFLAGS): Use -O2. + + * configure.in (strtoul, bsearch): Have autoconf check for these + functions. + * configure, config.in: Rebuilt. + + * m68k/xm-mot3300.h (alloca): Properly declare if __STDC__. + * mips/mips.h (alloca): Likewise. + * rs6000/xm-rs6000.h (alloca): Likewise. + * rs6000/xm-sysv4.h: Likewise. + +Thu Sep 18 14:22:22 1997 Jason Merrill + + * final.c (final_scan_insn): Hand BARRIERs off to the dwarf2 code. + * dwarf2out.c (dwarf2out_frame_debug): Pass the whole insn along. + (dwarf2out_stack_adjust): A BARRIER resets the args space to 0. + + * except.c (end_eh_unwinder): Subtract 1 from return address. + * libgcc2.c (__throw): Likewise. + (find_exception_handler): Don't change PC here. Compare end with >. + +Thu Sep 18 10:43:07 1997 Nick Clifton + + * v850.c (compute_register_save_size): Correct register + number. + * v850.md (save_interrupt, return_interrupt): Correct + register number. + * v850/lib1funcs.asm (save_interrupt): Correct register number. + (return_interrupt): Use stack pointer, not element pointer. + +1997-09-18 Brendan Kehoe + + * configure.in, configure: Make sure to create the stage* and include + symbolic links in each subdirectory. + +Thu Sep 18 01:47:06 1997 Jeffrey A Law (law@cygnus.com) + + * pa.md (reload_peepholes): Don't allow addresses with side + effects for the memory operand. + +Wed Sep 17 18:19:53 1997 Jason Merrill + + * libgcc2.c (find_exception_handler): Subtract one from our PC when + looking for a handler, to avoid hitting the beginning of the next + region. + + * except.c (expand_builtin_set_return_addr_reg): Use force_operand. + +Wed Sep 17 18:33:59 1997 Jeffrey A Law (law@cygnus.com) + + * mips/abi64.h (LONG_MAX_SPEC): Define. + * mips.h (LONG_MAX_SPEC): Define. + (CPP_SPEC): Include long_max_spec. + (EXTRA_SPECS): Include long_max_spec. + +Wed Sep 17 14:11:38 1997 Jeffrey A Law (law@cygnus.com) + + * v850.c (construct_save_jarl): Fix thinko in last change. + +Wed Sep 17 09:53:07 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Sep 16 14:22:36 1997 Jason Merrill + + * libgcc2.c (find_exception_handler): Not found is -1. + + * integrate.c (expand_inline_function): Move expand_start_bindings + after expanding the arguments. + +Tue Sep 16 11:13:46 1997 Jim Wilson + + * expr.c (expand_expr): Remove previous incorrect change. + If target and slot has no DECL_RTL, then call mark_addressable + again for the slot after we give it RTL. + +Tue Sep 16 09:18:52 1997 Jason Merrill (jason@cygnus.com) + + * expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable + again for the slot after we give it RTL. + +Tue Sep 16 00:13:20 1997 Nick Clifton + + * v850.c (register_is_ok_for_epilogue, + pattern_is_ok_for_epilogue, construct_restore_jr, + pattern_is_ok_for_prologue, construct_save_jarl): New functions. + + * v850.h (pattern_is_ok_for_prologue, + pattern_is_ok_for_epilogue, register_is_ok_for_epilogue): New + predicates. + + * v850.md: Replace prologue and epilogue patterns with a + match_parallel pattern. + +Mon Sep 15 22:53:01 1997 Jeffrey A Law (law@cygnus.com) + + * aclocal.m4: Add replacement for AC_PROG_INSTALL. + * configure.in: Use EGCS_PROG_INSTALL. + +Mon Sep 15 22:40:55 1997 Jim Wilson (wilson@cygnus.com) + + * dwarf2out.c (gen_subprogram_die): Handle redefinition of an + extern inline function. + +Mon Sep 15 22:40:55 1997 Richard Henderson (rth@cygnus.com) + + * dwarf2out.c (reg_loc_descriptor): Fix prototype. + (concat_loc_descriptor): New function. + (loc_descriptor): Call it. + (add_AT_location_description): Also elide the descriptor if both + halves of a CONCAT are pseudos. + (add_location_or_const_value_attribute): Recognize CONCAT too. + +Mon Sep 15 15:24:00 1997 Richard Henderson + + * alpha.md (movdi): Handle CONST_DOUBLE for TARGET_BUILD_CONSTANTS. + + * alpha/alpha.c (output_prolog): New variable sa_reg. Use it for + out-or-range reg_offset. + (output_epilog): Likewise. + +Mon Sep 15 15:39:26 1997 Jeffrey A Law (law@cygnus.com) + + * cse.c (simplify_relational_operation): If MODE specifies a + mode wider than HOST_WIDE_INT, then the high word of a CONST_INT + is derived from the sign bit of the low word. + +Mon Sep 15 11:43:38 1997 Jason Merrill + + Support dwarf2 unwinding on PUSH_ROUNDING targets like the x86. + + * dwarf2.h: Add DW_CFA_GNU_args_size. + * frame.c (execute_cfa_insn): Likewise. + * dwarf2out.c (dwarf_cfi_name, output_cfi): Likewise. + (dwarf2out_args_size, dwarf2out_stack_adjust): New fns. + (dwarf2out_frame_debug): If this isn't a prologue or epilogue + insn, hand it off to dwarf2out_stack_adjust. + (dwarf2out_begin_prologue): Initialize args_size. + * frame.h (struct frame_state): Add args_size. + * libgcc2.c (__throw): Use args_size. + * final.c (final_scan_insn): If we push args, hand off all insns + to dwarf2out_frame_debug. + * defaults.h (DWARF2_UNWIND_INFO): OK for !ACCUMULATE_OUTGOING_ARGS. + + * dwarf2out.c dwarf2out_frame_debug): Fix typo. + Handle epilogue restore of SP from FP. + * emit-rtl.c (gen_sequence): Still generate a sequence if the + lone insn has RTX_FRAME_RELATED_P set. + + * frame.c (extract_cie_info): Handle "e" augmentation. + * dwarf2out.c (ASM_OUTPUT_DWARF_*): Provide definitions in the + absence of UNALIGNED_*_ASM_OP. + (UNALIGNED_*_ASM_OP): Only provide defaults if OBJECT_FORMAT_ELF. + (output_call_frame_info): Use "e" instead of "z" for augmentation. + Don't emit augmentation fields length. + (dwarf2out_do_frame): Move outside of #ifdefs. + * defaults.h (DWARF2_UNWIND_INFO): Don't require unaligned data + opcodes. + + * sparc.h (UNALIGNED_INT_ASM_OP et al): Don't define here after all. + * sparc/sysv4.h (UNALIGNED_INT_ASM_OP): Define here. + * sparc/sunos4.h (DWARF2_UNWIND_INFO): Define to 0. + * sparc/sun4gas.h: New file. + * configure.in: Use sun4gas.h if SunOS 4 --with-gnu-as. + + * collect2.c (write_c_file_stat, write_c_file_glob): Declare + __register_frame_table and __deregister_frame. + +1997-09-15 Brendan Kehoe + + * except.c (find_exception_handler_labels): Use xmalloc instead of + alloca, since MAX_LABELNO - MIN_LABELNO can be more than 1 million + in some cases. + +Sun Sep 14 21:01:23 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in: Various changes to build info files + in the object tree rather than the source tree. + +Sun Sep 14 12:24:30 1997 Jeffrey A Law (law@cygnus.com) + + * fixinc.math: New file to fix math.h on some systems. + * configure.in (freebsd, netbsd): Use fixinc.math on these + systems. + * configure: Rebuilt. + +Sun Sep 14 11:11:05 1997 Jeffrey A Law (law@cygnus.com) + + * regmove.c (regmove_optimize): If we end up moving the + original insn due to lifetime overlaps, make sure to move + REG_NOTES too. + +Sat Sep 13 15:51:11 1997 Manfred Hollstein + + * Makefile.in (INSTALL_{PROGRAM,DATA}): Use value found by configure. + +Sat Sep 13 12:57:26 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (add_branch_dependences): Make each insn in + a SCHED_GROUP_P block explicitly depend on the previous insn. + +Fri Sep 12 13:49:58 1997 Jason Merrill + + * except.h: Prototype dwarf2 hooks. + * expr.c: Adjust. + +Thu Sep 11 17:43:55 1997 Jim Wilson + + * configure.in (native_prefix): Delete. + (mips-dec-netbsd): Don't set prefix. + (*linux*): Don't set prefix. + +Thu Sep 11 15:48:32 1997 Fred Fish + + * protoize.c: Include only if HAVE_VARARGS_H is + defined. If not defined, include if + HAVE_SYS_VARARGS_H is defined. + * configure.in: Test for varargs.h and sys/varargs.h. + * configure: Regenerate with autoconf. + * config.in: Regenerate with autoheader. + + * cpplib.c (quote_string): Cast first arg of sprintf call + from "unsigned char *" to "char *". + (output_line_command): Likewise. + (macroexpand): Likewise. + (do_line): Cast atoi arg from "unsigned char *" to "char *". + +Wed Sep 10 21:37:30 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + + * Makefile.in (compare): Exit with nonzero status if there + are comparison failures. Note which files failed the + comparison test in .bad_compare. + +Wed Sep 10 17:05:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * config/alpha/elf.h (CPP_PREDEFINES): Remove -D__PIC__ -D__pic__. + +Wed Sep 10 16:37:28 1997 Fred Fish + + * Makefile.in (LN, LN_S): New macros, use where appropriate. + * aclocal.m4 (GCC_PROG_LN_S, GCC_PROG_LN): New tests. + * configure.in: Use GCC_PROG_LN_S and GCC_PROG_LN. + * configure: Regenerated. + +Thu Sep 11 11:09:43 1997 Jeffrey A Law (law@cygnus.com) + + * loop.c (strength_reduce): Fix typo. + +Wed Sep 10 16:01:15 1997 Jim Wilson + + * m88k/m88k.c (struct option): Rename to struct options. + * m88k/dolph.h (INITIALIZE_TRAMPOLINE): Delete here. + * m88k/sysv3.h (INITIALIZE_TRAMPOLINE): Delete ifdef and comments. + * libgcc2.c (__enable_execute_stack): Check for __sysV88__ not + __DOLPHIN__ or sysV88. + +Wed Sep 10 14:58:40 1997 Jim Wilson + + * emit-rtl.c (gen_lowpart_common): For a SUBREG, add in word when + create new subreg. + +Wed Sep 10 15:19:22 1997 Jeffrey A Law (law@cygnus.com) + + * config.sub: Accept 'amigados' for backward compatibility. + +Wed Sep 10 14:05:08 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * Makefile.in (testsuite/site.exp): New target. + (check-gcc, check-g++): Depend on testsuite/site.exp. + Don't stop for failure. + +Wed Sep 10 12:59:57 1997 Jason Merrill + + * expr.c (expand_builtin): Only support __builtin_dwarf_fp_regnum() + if DWARF2_UNWIND_INFO. + +Wed Sep 10 11:49:20 1997 Jason Merrill + + Add support for exception handling using DWARF 2 frame unwind info. + Currently works on SPARC and MIPS, and almost on x86. + + * libgcc2.c (get_reg, put_reg, get_return_addr, put_return_addr, + next_stack_level, in_reg_window): Helper fns. + (__throw): Implement for DWARF2_UNWIND_INFO. + + * expr.c (expand_builtin): Handle builtins used by __throw. + * tree.h (enum built_in_function): Add builtins used by __throw. + * c-decl.c (init_decl_processing): Declare builtins used by __throw. + * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Used by __throw. + * except.c (expand_builtin_unwind_init): Hook for dwarf2 __throw. + (expand_builtin_extract_return_addr): Likewise. + (expand_builtin_frob_return_addr): Likewise. + (expand_builtin_set_return_addr_reg): Likewise. + (expand_builtin_eh_stub): Likewise. + (expand_builtin_set_eh_regs): Likewise. + (eh_regs): Choose two call-clobbered registers for passing back values. + + * frame.c, frame.h: New files for parsing dwarf 2 frame info. + * Makefile.in (LIB2ADD): New variable. Add $(srcdir)/frame.c. + (libgcc2.a): Use it instead of $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS) + (stmp-multilib): Likewise. + ($(T)crtbegin.o, $(T)crtend.o): Add -fno-exceptions. + + * except.c: #include "defaults.h". + (exceptions_via_longjmp): Default depends on DWARF2_UNWIND_INFO. + (emit_throw): Don't defeat assemble_external if DWARF2_UNWIND_INFO. + (register_exception_table_p): New fn. + (start_eh_unwinder): Don't do anything if DWARF2_UNWIND_INFO. + (end_eh_unwinder): Likewise. + + * crtstuff.c: Wrap .eh_frame section, use EH_FRAME_SECTION_ASM_OP, + call __register_frame and __deregister_frame as needed. + * varasm.c (eh_frame_section): New fn if EH_FRAME_SECTION_ASM_OP. + * dwarf2out.c (EH_FRAME_SECTION): Now a function-like macro. Check + EH_FRAME_SECTION_ASM_OP. + * sparc/sysv4.h (EH_FRAME_SECTION_ASM_OP): Define. + * mips/iris6.h (EH_FRAME_SECTION_ASM_OP): Define. + (LINK_SPEC): Add __EH_FRAME_BEGIN__ to hidden symbols. + + * dwarf2out.c (output_call_frame_info): If no support for + EXCEPTION_SECTION, mark the start of the frame info with a + collectible tag. + * collect2.c (frame_tables): New list. + (is_ctor_dtor): Recognize frame entries. + (scan_prog_file): Likewise. + (main): Pass -fno-exceptions to sub-compile. Also do collection + if there are any frame entries. + (write_c_file_stat): Call __register_frame_table and + __deregister_frame as needed. + (write_c_file_glob): Likewise. + + * defaults.h (DWARF2_UNWIND_INFO): Default to 1 if supported. + Also require unaligned reloc support. + * sparc.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Define here. + * sparc/sysv4.h: Not here. + + * toplev.c (compile_file): Call dwarf2out_frame_{init,finish}. + * dwarf2out.c (dwarf2out_init): Don't call dwarf2out_frame_init. + (dwarf2out_finish): Don't call dwarf2out_frame_finish. + + * libgcc2.c (L_eh): Reorganize, moving code shared by different + EH implementations to the top. + (find_exception_handler): Split out. Start from 0. Compare against + end with >=. + (__find_first_exception_table_match): Use it. + * except.c (output_exception_table): Don't do anything if there's + no table. Don't output a first entry of zeroes. + (eh_outer_context): Adjust properly. + (add_eh_table_entry): Use xrealloc. + * toplev.c (compile_file): Just call output_exception_table. + +Wed Sep 10 11:30:36 1997 Jason Merrill + + * i386.c (ix86_prologue): Add dwarf2 support for !do_rtl case. + +Wed Sep 10 08:17:10 1997 Torbjorn Granlund + + * except.c (eh_outer_context): Do masking using expand_and. + +Wed Sep 10 01:38:30 1997 Doug Evans + + Add port done awhile ago for the ARC cpu. + * arc/arc.h: New file. + * arc/arc.c: New file. + * arc/arc.md: New file. + * arc/initfini.c: New file. + * arc/lib1funcs.asm: New file. + * arc/t-arc: New file. + * arc/xm-arc.h: New file. + * ginclude/va-arc.h: New file. + * ginclude/stdarg.h: Include va-arc.h ifdef __arc__. + * ginclude/varargs.h: Likewise. + * Makefile.in (USER_H): Add va-arc.h. + * configure.in (arc-*-elf*): Recognize. + * longlong.h: Add ARC support. + +Wed Sep 10 01:32:54 1997 Jeffrey A Law (law@cygnus.com) + + * expr.c (clear_storage): Use CONST0_RTX instead of const0_rtx. + when clearing non-BLKmode data. + +Wed Sep 10 00:29:29 1997 Manfred Hollstein + + * m88k/sysv3.h (INITIALIZE_TRAMPOLINE): Define. + * libgcc2.c (__enable_execute_stack): Provide for sysV88 too. + + * xm-m88k.h (USG): Only define if it hasn't already been defined. + + * Makefile.in (risky-stage1): Delete gratuitous whitespace. + + * Makefile.in (clean): Delete libgcc1-test. + + * Makefile.in (INSTALL): cd to $(srcdir) before running texinfo. + +Tue Sep 9 17:07:36 1997 Stan Cox + + * m88k.c (m88k_expand_prologue): Set MEM_IN_STRUCT_P of va_list + template. + +Tue Sep 9 09:50:02 1997 Richard Kenner + + * dwarf2out.c (output_call_frame_info): Call named_section. + +Tue Sep 9 09:12:17 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (print_value): Fix last change. + +Tue Sep 9 01:30:37 1997 Jason Merrill + + * mips.h (DWARF_FRAME_REGNUM): Use the same numbering regardless of + write_symbols. + +Mon Sep 8 16:32:43 1997 Jason Merrill + + * mips.c (function_prologue): Set up the CFA when ABI_32. + + * sparc.c (save_regs): Check dwarf2out_do_frame instead of DWARF2_DEBUG + for dwarf2 unwind info. + (output_function_prologue, sparc_flat_output_function_prologue): Same. + + * final.c (final_end_function): Check dwarf2out_do_frame instead + of DWARF2_DEBUG for dwarf2 unwind info. + (final_scan_insn): Likewise. + (final_start_function): Likewise. Initialize dwarf2 frame debug here. + (final): Not here. + + * expr.c (expand_builtin_return_addr): Only SETUP_FRAME_ADDRESSES if + count > 0. + + * varasm.c (exception_section): Check EXCEPTION_SECTION first. + +Mon Sep 8 15:15:11 1997 Nick Clifton + + * v850.h (ASM_SPEC): Pass on target processor. + (CPP_PREDEFINES): Only define if not already specified. + (TARGET_VERSION): Only define if not already specified. + (MASK_CPU, MASK_V850, MASK_DEFAULT): Bits to specify target + processor. + (EXTRA_SWITCHES): Extra entries in the switches array. + (TARGET_DEFAULT): Set default target processor. + +Mon Sep 8 18:26:35 1997 Jim Wilson + + * m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): In MOTOROLA + cases, add %# and %/, and add : to make them into extended asms. + +Sun Sep 7 23:57:50 1997 Weiwen Liu + + * alias.c (init_alias_analysis): Clean up incompatible pointer + type warning in bzero. + * regmove.c (regmove_optimize): Likewise. + * haifa-sched.c (find_rgns): Likewise. + + * haifa-sched.c (print_value): Clean up ptr->int cast + warnings. + +Sun Sep 7 23:18:32 1997 Fred Fish + + * INSTALL: Change 'amigados' to 'amigaos' to match current usage. + * install.texi (Configurations): Likewise. + * config.sub: Likewise. + +Sun Sep 7 22:56:56 1997 Weiwen Liu (liu@hepvms.physics.yale.edu) + + * Makefile.in (sdbout.o): Depend on insn-config.h. + +Sun Sep 7 18:44:50 1997 Jim Wilson + + * m68k/m68k.h (TARGET_SWITCHES): For 68000, 68302, subtract MASK_68881. + For 68303, 68332, cpu32, subtract MASK_68040_ONLY. + +Sun Sep 7 18:30:46 1997 Jason Merrill + + * dwarf2out.c (dwarf2out_frame_debug): Assume that in a PARALLEL + prologue insn, only the first elt is significant. + (output_call_frame_info): For exception handling, always use 4-byte + fields as specified by the dwarf2 spec. + Don't skip trivial FDEs. + +Sun Sep 7 14:19:39 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Sep 7 14:17:36 1997 Torbjorn Granlund (tege@pdc.kth.se) + + * expmed.c (expand_divmod): Make op1_is_pow2 depend on unsignedp + for negative constants. Promote EXACT_DIV_EXPR to TRUNC_DIV_EXPR + when op1_is_pow2. + +Sun Sep 7 13:46:46 1997 Jeffrey A Law (law@cygnus.com) + + * final.c (shorten_branches): During first pass, assume worst + possible alignment for ADDR_VEC and ADDR_VEC_DIFF insns. + + * Makefile.in (distclean): Remove various things left around + by running the testsuite. + +Sun Sep 7 13:16:06 1997 Manfred Hollstein + + * configure.in (out_file): Emit definition to config.status in order + to have a defined value for configure.lang. + * configure: Re-built. + +Sun Sep 7 09:59:08 1997 Jan-Jaap van der Heijden (J.J.vanderHeijden@student.utwente.nl) + + * configure.in: Make symlink to as-new rather than as.new. Similarly + for ld-new. + * configure: Rebuilt. + +Fri Sep 5 16:54:55 1997 Jim Wilson + + * profile.c (output_func_start_profiler): Set DECL_EXTERNAL to zero. + +Fri Sep 5 16:16:44 1997 Christian Kuehnke + + * sparc/sparc.md: Add ultrasparc scheduling support. + * sparc/sparc.h (RTX_COSTS): For MULT give v9 a cost of 25 insns. + +Fri Sep 5 14:04:59 1997 Philippe De Muyter + + * integrate.c (save_for_inline_copying): Use 0, not NULL_PTR, + as initial value for real_label_map. + (copy_for_inline): Likewise. + +Fri Sep 5 13:36:44 1997 J"orn Rennecke + + * sched.c (update_flow_info): When looking if to set found_split_dest + or found_orig_dest, look at all parts of a PARALLEL. + * haifa-sched.c (update_flow_info): Likewise. + +Fri Sep 5 10:08:44 1997 Jeffrey A Law (law@cygnus.com) + + * v850: New directory for v850 port. + * v850/lib1funcs.asm: New file. + * t-v850, v850.c, v850.h, v850.md, xm-v850.h: New files. + * ginclude/va-v850.h: New file. + * ginclude/varargs.h, ginclude/stdarg.h: Include va-mn10200.h. + * configure.in (mn10200-*-*): New target. + * configure: Rebuilt. + * config.sub: Handle v850-elf. + * Makefile.in (USER_H): Add va-mn10200.h. + * invoke.texi: Document v850 stuff. + +Fri Sep 5 09:37:50 1997 Jim Wilson (wilson@cygnus.com) + + * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN + has integer TYPE_{MAX,MIN}_VALUE before using them. + + * m68k/m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Add + __HPUX_ASM__ versions. + +Fri Sep 5 09:08:44 1997 Jeffrey A Law (law@cygnus.com) + + * install.sh: Delete duplicate install script. + +Thu Sep 4 23:14:27 1997 Stan Cox (coxs@dg-rtp.dg.com) + + * reg-stack.c (subst_stack_regs): Pop the stack register for a + computed goto which sets the same stack register. + + * reg-stack.c (compare_for_stack_reg): Swap only if the source and + destination are both on the regstack. + (subst_stack_regs_pat): Put the destination at the top of the regstack. + +Thu Sep 4 15:02:27 1997 Jim Wilson + + * mips.md (nonlocal_goto_receiver): Define. + + * profile.c (output_arc_profiler): Check next_insert_after for non + NULL before deferencing it. + + * i386/t-sol2 (TARGET_LIBGCC2_CFLAGS): Define to -fPIC. + +Thu Sep 4 14:51:57 1997 Jeffrey A Law (law@cygnus.com) + + * i386.h (CPP_CPU_DEFAULT): Avoid using #elif. + +Thu Sep 4 15:01:49 1997 Michael Meissner + + * toplev.c (rest_of_compilation): For passes starting with + flow_analysis, use print_rtl_with_bb instead of print_rtl. + + * print-rtl.c (print_rtl_single): Print a single rtl value to a + file. + + * flow.c (print_rtl_with_bb): Print which insns start and end + basic blocks. For the start of a basic block, also print the live + information. + +Thu Sep 4 11:51:43 1997 Jim Wilson + + * toplev.c (main): Change #elif to #else/#ifdef. + + * tlink.c: Include ctype.h. + * ginclude/va-mips.h: Add _VA_MIPS_H_ENUM ifdef/define/endif. + +Thu Sep 4 11:17:16 1997 Mikeael Meissner (meissner@cygnus.com) + + * bitmap.c: Conditionally include stdlib.h. + (free): Provide a declaration if NEED_DECLARATION_FREE. + +Thu Sep 4 09:58:53 1997 Joel Sherrill (joel@OARcorp.com) + + * i960/i960.h: Added default for SUBTARGET_SWITCHES macro. + +Thu Sep 4 09:53:20 1997 Jim Wilson (wilson@cygnus.com) + + * profile.c (output_arc_profiler): Verify next_insert_after is an + INSN before and after skipping a stack pop. + +Thu Sep 4 07:39:19 1997 J"orn Rennecke + + * final.c (shorten_branches): Don't count the lengths of deleted + instructions. + +Thu Sep 4 09:43:01 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Sep 4 11:04:21 1997 Michael Meissner + + * bitmap.h (EXECUTE_IF_AND_IN_BITMAP): New macro, to iterate over + two bitmaps ANDed together. + (bitmap_print): Declare. + + * bitmap.c (function_obstack): Don't declare any more. + (bitmap_obstack): Obstack for allocating links from. + (bitmap_obstack_init): New static to say whether to initialize + bitmap_obstack. + (bitmap_element_allocate): Use bitmap_obstack to allocate from. + (bitmap_release_memory): Free all memory allocated from + bitmap_obstack. + + * basic-block.h (EXECUTE_IF_AND_IN_REG_SET): New macro, invoke + EXECUTE_IF_AND_IN_BITMAP. + +Wed Sep 3 10:39:42 1997 Jim Wilson + + * alias.c (true_dependence): Address with AND can alias scalars. + (anti_dependence, output_dependence): Likewise. + + * alias.c (true_dependence): Test x for BLKmode, in addition to mem. + +Wed Sep 3 09:28:50 1997 Joel Sherrill (joel@OARcorp.com) + + * i386/go32-rtems.h, i386/rtems.h, i960/rtems.h, m68k/rtems.h, + mips/rtems64.h, pa/rtems.h, rs6000/rtems.h, sh/rtems.h, + sparc/rtems.h (subtarget_switches): Removed SUBTARGET_SWITCHES + definitions. Use -qrtems instead of -mrtems. + +Wed Sep 3 09:05:41 1997 Robert Lipe (robert@dgii.com) + + * xm-sco5.h (sys_siglist): Define. + (SYS_SIGLIST_DECLARED): Likewise. + +Tue Sep 2 23:33:33 1997 Jeffrey A Law (law@cygnus.com) + + * expr.c (convert_move): Handle truncation from TQFmode to QFmode. + +Wed Sep 3 02:09:30 1997 Torbjorn Granlund + + * except.c (eh_outer_context): Expand masking operation using + expand_binop. + +Tue Sep 2 18:09:39 1997 Jim Wilson + + * alpha.md (floatdisf2-1): New pattern. + +Tue Sep 2 18:41:55 1997 Jeffrey A Law (law@cygnus.com) + + * xm-svr4.h (SYS_SIGLIST_DECLARED): Define. + * xm-news.h (SYS_SIGLIST_DECLARED): Likewise. + * xm-sysv4.h (SYS_SIGLIST_DECLARED): Likewise. + * gcc.texi: Note that if you define sys_siglist that you should + also define SYS_SIGLIST_DECLARED. + + * mn10200.h (INITIALIZE_TRAMPOLINE): PC relative instructions + are relative to the next instruction, not the current instruction. + +Tue Sep 2 14:22:43 1997 Jim Wilson + + * local-alloc.c (contains_replace_regs): New function. + (update_equiv_regs): When adding a REG_EQUIV note for a set of a MEM, + verify that there is no existing REG_EQUIV note, and add a call to + contains_place_regs. + +Tue Sep 2 12:48:11 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * config/alpha/elf.h (CPP_PREDEFINES): Add -D__PIC__ -D__pic__. + (STARTFILE_SPEC): Always use crtbegin.o%s. + (ENDFILE_SPEC): Always use crtend.o%s. + +Tue Sep 2 12:00:36 1997 Jim Wilson + + * alpha/alpha.h (PREFERRED_RELOAD_CLASS): Return NO_REGS if NO_REGS + is passed in. + * emit-rtl.c (gen_lowpart_common): Add code to convert CONST_INT to + SFmode for 64 bit hosts. + +Tue Sep 2 13:42:38 1997 Paul N. Hilfinger + + * fixincludes: Permits spaces between # and define. Discard C++ + comments in sys/pci.h on HP/UX 10.20. + +Mon Sep 1 22:13:18 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + + * pa.c (restore_unscaled_index_insn_codes): New function. + (record_unscaled_index_insn_codes): Likewise. + (output_function_prologue): Call restore_unscaled_index_insn_codes. + (output_function_epilogue): Free memory for unscaled_index_insn_codes. + (pa_reorg): Call record_unscaled_index_insn_codes. + + * haifa-sched.c (move_insn): Handle notes correctly for insns + with SCHED_GROUP_P set. + +Mon Sep 1 16:58:57 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * alpha/xm-linux.h (USE_BFD): Undef before define. + +Mon Sep 1 16:25:34 1997 Jim Wilson + + * cse.c (cse_insn): Don't record BLKmode values. + +Mon Sep 1 11:25:47 1997 Stephen Williams (steve@icarus.icarus.com) + + * i960.h (LINK_SPEC): Handle "-mjX" and "-mrp" switches. + +Mon Sep 1 08:29:46 1997 Jeffrey A Law (law@cygnus.com) + + * cccp.c (sys_errlist): Remove special 4.4bsd declaration. + * collect2.c (sys_errlist): Likewise. + * cpplib.c (sys_errlist): Likewise. + * gcc.c (sys_errlist): Likewise. + * protoize (sys_errlist): Likewise. + * configure.in: Check for strerror. + * xm-freebsd.h (HAVE_STRERROR): Remove definition. + * xm-gnu.h (HAVE_STRERROR): Likewise. + * xm-linux.h (HAVE_STRERROR): Likewise. + * xm-netbsd.h (HAVE_STRERROR): Likewise. + * xm-bsd386.h (HAVE_STRERROR): Likewise. + * xm-cygwin32.h (HAVE_STRERROR): Likewise. + * xm-dos.h (HAVE_STRERROR): Likewise. + * xm-mingw32.h (HAVE_STRERROR): Likewise. + * xm-pa.h (HAVE_STRERROR): Likewise. + * xm-papro.h (HAVE_STRERROR): Likewise. + * xm-sysv4.h (HAVE_STRERROR): Likewise. + * configure, config.in: Rebuilt. + + * Makefile.in: Add several missing "else true" clauses. + + * collect2.c: Change DONT_DECLARE_SYS_SIGLIST to SYS_SIGLIST_DECLARED. + * mips-tfile.c: Likewise. + * gcc.texi: DONT_DECLARE_SYS_SIGLIST: Remove docs. + * xm-linux.h (DONT_DECLARE_SYS_SIGLIST): Delete definition. + * xm-freebsd.h, xm-bsd386.h, xm-sysv4.h, xm-sol2.h: Likewise. + * configure.in: Check for sys_siglist declaration. + * configure, config.in: Rebuilt. + +Mon Sep 1 08:04:07 1997 Joel Sherrill (joel@OARcorp.com) + + * i386/go32-rtems.h, i386/rtems.h, i960/rtems.h, + m68k/rtems.h, mips/rtems64.h, pa/rtems.h, rs6000/rtems.h, + sparc/rtems.h (subtarget_switches): Added -mrtems as a switch. + * i960/i960.h: Added SUBTARGET_SWITCHES macro. + * rs6000/sysv4.h (extra_subtarget_switches): Added new + macro EXTRA_SUBTARGET_SWITCHES. + * configure.in (sh*-*-rtems*): New target. + * sh/rtems.h: New file. + * sh/sh.h: Added SUBTARGET_SWITCHES macro. + * configure: Rebuilt. + +Sat Aug 30 22:54:26 1997 Jim Wilson + + * unroll.c (calculate_giv_inc): Handle increment with code PLUS. + +Sat Aug 30 10:49:46 1997 David Edelsohn + + * rs6000.md: Make DF fused-add operations pay attention to + -mno-fused-add. + +Fri Aug 29 19:19:54 1997 Jim Wilson + + * i386/xm-sysv4.h (DONT_DECLARE_SYS_SIGLIST): Define. + +Fri Aug 29 16:13:51 1997 Jeffrey A Law (law@cygnus.com) + + * pa.md (reload_peepholes): Make sure operand is a REG before + examining REGNO. Allow general registers too. + +Fri Aug 29 11:42:04 1997 Jim Wilson + + * varasm.c (mark_constants): Don't look inside CONST_DOUBLEs. + +Fri Aug 29 09:33:20 1997 Philipp Thomas (kthomas@lxi165.gwdg.de) + + * dwarf2out.c (build_abbrev_table): Use xrealloc, not xmalloc + to reallocate abbrev_die_table. + +Thu Aug 28 15:14:46 1997 Jim Wilson + + * m68k/m68k.md (iorsi_zexthi_ashl16): Disable. + +1997-08-27 Andreas Schwab + + * Makefile.in (config.status): Depend on version.c. + + * expr.h (insn_gen_function): Reenable prototype. + + * expr.c (move_by_pieces_1, clear_by_pieces_1): Fix prototype of + first parameter. + +Thu Aug 28 13:01:43 1997 Jim Wilson + + * i386.c (ix86_expand_epilogue): Emit blockage instruction when pic. + +Thu Aug 28 07:03:15 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for latest snapshot. + + * bc-optab.c: Conditionally include stdlib.h. + (free): Provide a declaration if NEED_DECLARATION_FREE. + * tree.c (free): Provide a declaration if NEED_DECLARATION_FREE. + * rtl.h (free): Remove declaration. + * tree.h (free): Remvoe declaration. + + * configure: Rebuilt. + +Wed Aug 27 21:32:20 1997 Jeffrey A Law (law@cygnus.com) + + * flags.h (flag_move_all_movables): Declare. + (flag_reduce_all_givs): Likewise. + * loop.c (move_movables): Handle flag_move_all_movables. + (strength_reduce): Handle flag_reduce_all_givs. + * toplev.c (flag_move_all_movables): Define. + (flag_reduce_all_givs): Likewise. + (f_options): Add -fmove-all-movables and -freduce-all-givs. + * invoke.texi: Document new options, including alias stuff that + wasn't included last time. + +Wed Aug 27 18:08:51 1997 Bob Manson (manson@cygnus.com) + + * t-h8300: Use TARGET_LIBGCC2_CFLAGS instead of LIBGCC2_CFLAGS. + * t-mn10200: Likewise. + * t-vxsparc: Likewise. + * t-vxworks68: Likewise. + * t-vxworks960: Likewise. + * t-vx29k: Likewise. + +Wed Aug 27 16:35:29 1997 Richard Henderson + + * alpha/xm-alpha.h (alloca): Define alloca to builtin_alloca for GNUC + if not already defined, and USE_C_ALLOCA not defined. + +Wed Aug 27 16:08:43 1997 Jim Wilson + + * config.guess: Replace with script that uses ../config.guess. + + * config/alpha/elf.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1 + if USE_GNULIBC_1 is not defined. + +Wed Aug 27 15:49:12 1997 Richard Henderson + + * alpha/elf.h (LINK_SPEC): Conditionalize on USE_GNULIBC_1. + * config.guess: Recognize alpha-linux-gnulibc1. + * configure.in (alpha-*-linux-gnulibc1): New target. + (alpha-*-linux-gnu*): Don't build crtbegin/end. + +Wed Aug 27 11:52:58 1997 Jim Wilson + + * m68k.md (iorsi3_internal): Readd ! TARGET_5200 check lost in + last change. + +Wed Aug 27 01:56:18 1997 Doug Evans + + * loop.c (combine_movables): Earlier insns don't match later ones. + +Wed Aug 27 01:24:25 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * config/linux.h (CC1_SPEC): Define it only if not defined. + + * config/m68k/linux.h (CC1_SPEC): Undefine it before include + + + * config/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1 if + USE_GNULIBC_1 is not defined. + + * config/rs6000/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1. + + * config/sparc/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined + as 1 if USE_GNULIBC_1 is not defined. + +Wed Aug 27 00:49:14 1997 Jeffrey A Law (law@cygnus.com) + + * reorg.c (dbr_schedule): Allow current_function_return_rtx + to be something other than a REG. + * function.c (expand_function_end): Fix current_function_return_rtx + if it was a pseudo. + + * t-freebsd (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS. + * x-netbsd: Likewise. + * x-dgux (USER_H): Include EXTRA_HEADERS and LANG_EXTRA_HEADERS. + (INSTALL_HEADERS): Delete. + * x-dguxbcs: Likewise. + * x-hp3bsd44: Likewise. + * x-pa: Likewise. + +Wed Aug 27 00:30:00 1997 Bernd Schmidt + + * i386.md (pop): pop increments the stack pointer. + (prologue_set_stack_ptr): New pattern. + * i386.c (ix86_expand_prologue): Use prologue_set_stack_ptr + instead of subsi3. + +Tue Aug 26 18:50:32 1997 Jim Wilson + + * reload.c (find_reloads, case '0'): Reject matching a non-offsettable + address where an offsettable address is required. + +Tue Aug 26 17:54:56 1997 Michael P. Hayes (michaelh@ongaonga.chch.cri.nz> + + * loop.c (check_final_value): Don't miss a biv increment in a + parallel. + +Tue Aug 26 12:03:49 1997 Jim Wilson (wilson@cygnus.com) + + * dwarfout.c (dwarfout_file_scope_decl, case TYPE_DECL): Check + TYPE_DECL_IS_STUB instead of DECL_NAME. + +Mon Aug 25 23:27:10 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * objc/Make-lang.in ($(OBJC_O)): Also depend on cc1obj. + +Mon Aug 25 23:27:10 1997 Jim Meyering + + * objc/Make-lang.in ($(OBJC_O)): Also depend on $(GCC_PASSES). + +Mon Aug 25 13:12:24 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (find_pre_sched_live): Remove #if 0 code. + (find_post_sched_live): Likewise. + + * haifa-sched.c (schedule_block): Remove old code to get arguments + from hard regs into pseudos early. + +Mon Aug 25 08:55:00 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for new snapshot. + + * local-alloc.c (update_equiv_regs): All the target to reject + promotion of some REG_EQUAL to REG_EQUIV notes. + * pa.h (DONT_RECORD_EQUIVALENCE): Define. + + * pa.c (secondary_reload_class): (mem (mem ... )) does not need + secondary reloads. + + * pa.c (hppa_builtin_saveregs): Emit a blockage insn after the + store of the argument registers. + +Mon Aug 25 08:39:02 1997 Craig Burley (burley@gnu.ai.mit.edu) + + * fold-const.c (multiple_of_p): New function. + (fold): Turn some cases of *_DIV_EXPR into EXACT_DIV_EXPR. + +Mon Aug 25 01:47:41 1997 Jeffrey A Law (law@cygnus.com) + + * expr.h (insn_gen_function): Temporarily remove prototype. + +Sun Aug 24 17:22:21 1997 Jim Wilson + + * Makefile.in (install-info): Don't cd into srcdir. Add srcdir to + filenames. Use sed to extract base filename for install. + +Sat Aug 23 18:19:40 1997 John F. Carr + + * unroll.c (find_splittable_givs): Only share if two givs have the + same add and multiply values. + +Sat Aug 23 14:36:27 1997 Jim Wilson + + * m68k/next.h (GO_IF_INDEXABLE_BASE): Fix typo in undef. + * m68k/m68kemb.h (LIB_SPEC): Add missing comment end before it. + +Sat Aug 23 00:18:22 1997 Jeffrey A Law (law@cygnus.com) + + * pa.c (pa_reorg): Always put begin_brtab and end_brtab insns + around branch tables. + * pa.md (begin_brtab, end_brtab): Only emit the .begin_brtab + and .end_brtab directives if TARGET_GAS. + +Fri Aug 22 14:05:55 1997 Jim Wilson + + * alias.c (true_dependence): Pass x_addr not x to varies. + + * acconfig.h (NEED_DECLARATION_CALLOC): Add. + * configure.in: Add GCC_NEED_DECLARATION call for calloc. + * rs6000/xm-rs6000.h (malloc, realloc, calloc, free): Delete + declarations. + * config.in, configure: Regenerate. + +Thu Aug 21 23:52:16 1997 John F. Carr + + * alias.c (find_base_value): Improve handling of PLUS, MINUS, and + LO_SUM. + (record_set): Handle LO_SUM like PLUS. + (init_alias_analysis): When following chains of base addresses, + do not stop on reaching a hard register. + +Thu Aug 21 20:17:37 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for new snapshot. + +Thu Aug 21 17:28:00 1997 Jim Wilson + + * alpha.h (ARCH_ASM_FILE_START): Define. + (ASM_FILE_START): Use ARCH_ASM_FILE_START. + * osf12.h, osf2or3.h (ARCH_ASM_FILE_START): Redefine to null string. + +Thu Aug 21 10:22:19 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (install-common): Put gcov comment at start of line. + +Wed Aug 20 22:47:33 1997 Jeffrey A Law (law@cygnus.com) + + * alias.c (init_alias_analysis): When simplifying the reg_base_value + array, simplify entries for hard registers too. + +Wed Aug 20 12:35:47 1997 Dave Love + + * dwarf2.h (enum dwarf_call_frame_info): Remove trailing comma from + list. + +Wed Aug 20 11:58:33 1997 Jim Wilson + + * stmt.c (start_cleanup_deferral, end_cleanup_deferral): Test + block_stack before dereferencing it. + +Wed Aug 20 11:57:11 1997 Michael Meissner + + * rs6000.h (ISSUE_RATE): Define instead of MACHINE_issue_rate. + +Tue Aug 19 17:10:56 1997 Jason Merrill + + * cplus-dem.c: Add 'extern' to prepends_underscore. + +Tue Aug 19 09:34:57 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (ISSUE_RATE): Renamed from MACHINE_issue_rate. + (get_issue_rate): Delete. + * pa.h (ISSUE_RATE): Define. + + * configure.in: Turn on haifa by default for the PA. + * configure: Rebuilt. + * pa.c (override_options): Accept -mschedule=7200 option. + (pa_adjust_cost): No longer need to scale costs for newer + processors. + * pa.h (enum processor_type): Add PROCESSOR_7200. + * pa.md: Revamp scheduling parameters to work better with + haifa. Add scheduling parameters for the 7200. + + * haifa-sched.c (move_insn): Reemit notes for SCHED_GROUP_P + insns too. + (schedule_block): When adjusting basic_block_{head,end}, account + for movement of SCHED_GROUP_P insns too. + + * haifa-sched.c (debug_dependencies): Fix thinko. + + * Makefile.in (EXPECT, RUNTEST, RUNTESTFLAGS): Define. + (site.exp, check, check-g++, check-gcc): New targets. + + * haifa-sched.c: Make lots of variables static. + +Tue Aug 19 07:18:34 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * expr.h, real.h: Finish prototyping. + +Mon Aug 18 21:49:02 1997 Jim Wilson + + * reload.c (find_reloads): Add code to convert RELOAD_FOR_OPADDR_ADDR + reloads to RELOAD_FOR_OPERAND_ADDRESS reloads. + * reload1.c: Undo bugfix from Aug 11. + +Mon Aug 18 17:39:02 1997 Mike Meissner + + * configure.in ({powerpc,rs6000}*-*-*, --with-cpu): Remove single + quotes around the name. + * configure: Regenerate. + +Mon Aug 18 13:46:47 1997 Jim Wilson + + * Makefile.in (stmp-multilib-sub): Fix typo in last change. + +Thu Aug 7 10:33:13 1997 Manfred Hollstein + + * Makefile.in (sub-makes): Pass the current value of LANGUAGES down + to sub-makes to avoid building more passes than the user might have + requested on the command line. + +Sun Aug 17 15:42:17 1997 Dave Love (d.love@dl.ac.uk) + + * configure.in: Expurgate `broken_install' (install is + autoconfed). + + * configure.lang: Substitute autoconfed ${INSTALL} (not currently + relevant). + +Sat Aug 16 01:08:12 1997 Jeffrey A Law (law@cygnus.com) + + * loop.c (is_power_of_2, is_conditional_branch): Delete unused + functions and declarations. + (analyze_loop_iterations): Use condjump_p. + (insert_bct): Likewise. Use exact_log2. + +Fri Aug 15 23:48:32 1997 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (find_post_sched_live): Call FREE_REG_SET as needed. + (schedule_region): Likewise. + (schedule_insns): Likewise. + + * PROJECTS: Update with Haifa stuff. + +Fri Aug 15 12:49:56 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Change the version string to look like: + egcs-2.90.00 970814 (gcc2-970802 experimental). + + * loop.c (is_conditional_branch): Make definition match declaration. + + * gcc.c: Take out experimental snapshot warning message. + +Fri Aug 15 13:43:39 1997 Michael Meissner + + * haifa-sched.c (debug_dependencies): Use GET_NOTE_INSN_NAME to + print out the names of the notes. Print out the name of the insn + that is not a note, and not an {,CALL_,JUMP_}INSN. + +Wed Aug 13 17:32:38 1997 Jason Merrill + + * expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable + again for the slot after we give it RTL. + +Wed Aug 13 01:03:37 1997 Doug Evans + + * configure.in (haifa configury): Fix typo. + * configure: Regenerate. + +Tue Aug 12 10:20:36 1997 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump version to "gcc-3.0.0 970802 experimental". + + * gcc.info*: Rebuilt. + + * COPYING.g77, README.g77: New files. + * real.c (ereal_unto_float, ereal_unto_double): New functions. + * real.h (ereal_unto_float, ereal_unto_double): Declare them. + (REAL_VALUE_UNTO_TARGET_DOUBLE, REAL_VALUE_UNTO_TARGET_SINGLE): Define. + +Mon Aug 11 14:50:55 1997 Jeffrey A Law (law@cygnus.com) + + * Integrate Haifa instruction scheduler. + * Makefile.in (ALL_CFLAGS): Add SCHED_CFLAGS. Prefix all references + to sched with $(SCHED_CFLAGS. + * configure.in: Handle --enable-haifa. + * configure: Rebuilt. + * flags.h: Add new flags for haifa instruction scheduler. + * genattrtab.c (expand_units): For haifa, don't subtract one + when computing blockage. + * toplev.h (flag_schedule_interblock): Haifa scheduler flag. + (flag_schedule_speculative): Likewise. + (flag_schedule_speculative_load): Likewise. + (flag_schedule_speculative_load_dangerous): Likewise. + (flag_schedule_reverse_before_reload): Likewise. + (flag_schedule_reverse_after_reload): Likewise. + (flag_branch_on_count_reg): Likewise. + (f_options): Add Haifa switches. + (main): Turn off some Haifa options if appropriate macro is + defined. Process Haifa switches. + * unroll.c (iteration_info): No longer static, since Haifa + scheduler uses it. + (unroll_loop): Inform HAIFA scheduler about loop unrolling factor. + * unroll.c (unroll_loop): Set loop_unroll_iter, loop_start_value. + * loop.h (loop_unroll_factor, loop_number): Add HAIFA decls. + * loop.h (loop_initial_value,loop_unroll_iter): New globals. + * loop.c (loop_optimize): If HAIFA is defined, allocate additional + storage for the Haifa scheduler. + (mark_loop_jump): If HAIFA defined, set LABEL_OUTSIDE_LOOP_P and + LABEL_NEXTREF. + (strength_reduce): If HAIFA and HAVE_decrement_and_branch_on_count + are defined, call analyze_loop_iterations and insert_bct to use + countdown loops. + (record_giv): Refine test for jumps out of loops if HAIFA is + defined. + (analyze_loop_iterations): New function to identify if we can use + a countdown loop. + (insert_bct): Insert countdown loop. + (instrument_loop_bct): Low level code to insert countdown loop. + (loop_number): Calculate UID of loop. + (indirect_jump_in_function_p): Return true if an indirect jump is + in the function. + (is_power_of_2): Return true if value is a power of 2. + (is_conditional_branch): Return true if insn is a conditional + jump. + (fix_bct_param): Process -fbct-{min,max}-N switches. + (check_bct_param): Return true if loop should be instrumented. + * loop.c (loop_initial_value,loop_unroll_iter): New globals. + (loop_optimize): Initialize. + (get_condition_for_loop): Likewise. + * loop.c (strength_reduce): Inside of code that uses #ifdef + HAVE_decrement_and_branch_on_count code, test it to make sure the + condition is true. + (instrument_loop_bct): Likewise. + * haifa-sched.c: New file. + + * Integrate regmove pass. + * Makefile.in (OBJS): Add regmove.o. + (regmove.o): Add dependencies. + * flow.c (find_use_as_address): No longer static. + * rtl.h (find_use_as_address): Declare. + * toplev.c (regmove_dump, flag_regmove): Define. + (f_options): Add -fregmove. + (regmove_dump_file, regmove_time): Define. + (fatal_insn): Close the regmove dump file. + (compile_file): Initialize regmove_time; open/close the regmove dump + file as needed. Print regmove time as needed. + (rest_of_compilation): Run regmove pass if requested, dump + RTL after regmove if requested. + (main): If -O2 or more, turn on regmove. Handle dump switches. + * regmove.c: New file. + +Mon Aug 11 14:15:02 1997 Jeffrey A Law (law@cygnus.com) + + * Integrate tlink patch from jason@cygnus.com + * gcc.c (SWITCH_TAKES_ARG): Add 'V', 'B' and 'b'. + (process_command): Increment n_switches for them. Don't discard + their args. Validate them. + (main): Escape " marks when creating COLLECT_GCC_OPTIONS. + From Rohan Lenard. + (process_command): Set include_prefixes from COMPILER_PATH. + (main): Set COLLECT_GCC_OPTIONS sooner. + * confiugre.in: Link ../ld/ld.new to collect-ld rather than real-ld. + * tlink.c, hash.c, hash.h: New files. + * Makefile.in (USE_COLLECT2): Always use collect2. + (collect2): Depend on and link in hash.o and tlink.o. + (tlink.o, hash.o): Add dependencies. + +Mon Aug 11 10:04:49 1997 Jeffrey A Law (law@cygnus.com) + + * Integrate alias analysis changes from jfc@mit.edu + * Makefile.in (OBJS): Add alias.o. + (alias.o): Add dependencies. + * alias.c: New file. + * sched.c: Remove alias analysis code. It lives in alias.c now. + (sched_analyze_2): Add new arguments to true_dependence. + (schedule_insns): Always call init_alias_analysis. + * calls.c (expand_call): Note calls to malloc, calloc, and realloc; + mark return value from such functions as a pointer and keep track of + them for alias analysis. If a return value from a function is a + pointer, mark it as such. + * combine.c (distribute_notes): Handle REG_NOALIAS. + * cse.c (struct write_data): Delete. No longer needed. + (invalidate): Don't call set_nonvarying_address_components anymore. + Use true_dependence to decide if an entry should be removed from + the hash table. + (invalidate_memory): Remove WRITES argument, simplify appropriately. + Fix all callers. + (note_mem_written): Similarly for WRITE_PTR argument. + (invalidate_from_clobbers): Similarly for W argument. + (invalidate_for_call): Remove memory elements from the hash table. + (refers_to_mem_p, cse_rtx_addr_varies_p): Deleted. + (cse_rtx_varies_p): New function. Derived from old + cse_rtx_addr_varies_p. + (cse_insn): Remove WRITES_MEMORY and INIT variables and all references. + Don't call note_mem_written anymore. Stack pushes invalidate the stack + pointer if PUSH_ROUNDING is defined. No longer need to call + cse_rtx_addr_varies_p to decide if a MEM should be invalidated. + (skipped_writes_memory): Remove variable. + (invalidate_skipped_set): Simplify and wewrite to use invalidate_memory. + (invalidate_skipped_block): Simplify for new alias analysis code. + (cse_set_around_loop): Likewise. + (cse_main): Call init_alias_analysis. + * flags.h (flag_alias_check, flag_argument_noalias): Declare. + * toplev.c (flag_alias_check, flag_argument_noalias): Define. + (f_options): Add new alias checking arguments. + (main): Set flag_alias_check when optimizing. + * local_alloc (validate_equiv_mem_from_store): Add new arguments + to true_dependence. + (memref_referenced_p): Likewise. + * loop.c (NUM_STORES): Increase to 30. + (prescan_loop): Only non-constant calls set unknown_address_altered. + (invariant_p): Add new arguments to true_dependence. + (record_giv): Initialize unrolled and shared fields. + (emit_iv_add_mult): Call record_base_value as needed. + * loop.h (struct induction): Add unrolled and shared fields. + * unroll.c (unroll_loop): Call record_base_value as needed. + (copy_loop_body): Likewise. + (final_biv_value): Likewise. + (final_giv_value): Likewise. + (find_splittable_regs): Likewise. Only create one new pseudo + if we have multiple address GIVs that were combined with the same + dst_reg GIV. Note when a new register is created due to unrolling. + * rtl.c (reg_note_name): Add REG_NOALIAS. + * rtl.h (enum reg_note): Similarly. + (rtx_varies_p, may_trap_p, side_effects_p): Declare. + (volatile_refs_p, volatile_insn_p, remove_note): Likewise. + (note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise. + (true_dependence, read_dependence, anti_dependence): Likewise. + (output_dependence, init_alias_analysis, end_alias_analysis): Likewise. + (mark_user_reg, mark_reg_pointer): Likewise. + + * Integrate reload bugfix from Wilon which enables the PA port + to bootstrap again. + * reload1.c (reload): Sum needs for both OPADDR_ADDR and + OPERAND_ADDRESS when computing how many registers an insn needs. + (reload_reg_free_p): OPADDR_ADDR and OPERAND_ADDRESS reloads do + conflict. + (reload_reg_free_before_p): Treat OPERAND_ADDRESS reloads just like + OPADDR_ADDR reload. + (reload_reg_reaches_end_p): For RELOAD_FOR_OPADDR_ADDR insns, registers + in reload_reg_use_in_op_addr do not reach the end. + do not reach the end. + (reloads_conflict): RELOAD_FOR_OPADDR_ADDR conflicts with + RELOAD_FOR_OPERAND_ADDRESS. + +Sun Aug 10 12:00:20 1997 Jeffrey A Law (law@cygnus.com) + + * egcs project officially starts. diff --git a/contrib/gcc/ChangeLog-1998 b/contrib/gcc/ChangeLog-1998 new file mode 100644 index 00000000000..bd2f722d1b0 --- /dev/null +++ b/contrib/gcc/ChangeLog-1998 @@ -0,0 +1,17616 @@ +Wed Dec 30 23:38:55 1998 Jeffrey A Law (law@cygnus.com) + + * m68k.md (adddi_dilshr32): Allow all operands to be registers too. + (adddi_dishl32): Similarly. + + * cse.c (invalidate_skipped_block): Call invalidate_from_clobbers + for each insn in the skipped block. + + * reload1.c (reload_as_needed): Verify that the insn satisfies its + constraints after replacing a register address with an autoincrement + address for reload inheritance purposes. + + * i386.md (doubleword shifts): Avoid namespace pollution. + +Wed Dec 30 23:00:28 1998 David O'Brien + + * configure.in (FreeBSD ELF): Needs special crt files. + +Wed Dec 30 22:50:13 1998 Geoffrey Noer + + * i386/xm-cygwin.h: Change DIR_SEPARATOR to forward slash. + +1998-12-30 Andreas Schwab + + * loop.c (check_dbra_loop): While reversing the loop, if the + comparison value has a VOID mode use the mode of the other operand + to compute the mask. + +Wed Dec 30 22:24:00 1998 Michael Meissner + + * rs6000.md ({save,restore}_stack_function): Take 2 operands to + avoid warnings in compiling explow.c. + + (patch from Ken Raeburn, raeburn@cygnus.com) + * rs6000.c (rs6000_stack_info): Force 8-byte alignment of + fpmem_offset. Compute total size after that, and then + rs6000_fpmem_offset using both values. + +Mon Dec 28 19:26:32 1998 Gerald Pfeifer + + * gcc.texi (Non-bugs): ``Empty'' loops will be optimized away in + the future; indeed that already happens in some cases. + +Tue Dec 29 11:58:53 1998 Richard Henderson + + * sparc.c (input_operand): Recognize (const (constant_p_rtx)). + (arith_operand): Remove constant_p_rtx handling. + (const64_operand, const64_high_operand): Likewise. + (arith11_operand, arith10_operand, arith_double_operand): Likewise. + (arith11_double_operand, arith10_double_operand, small_int): Likewise. + (small_int_or_double, uns_small_int, zero_operand): Likewise. + * sparc.h (PREDICATE_CODES): Likewise. + + * rtl.h (CONSTANT_P): Remove CONSTANT_P_RTX. + +Tue Dec 29 11:32:54 1998 Richard Kenner + + * rtl.def (CONSTANT_P_RTX): Clarify commentary. + * expr.c (expand_builtin, case BUILT_IN_CONSTANT_P): Rework to + consider constant CONSTRUCTOR constant and to defer some cases + to cse. + * cse.c (fold_rtx, case CONST): Add handling for CONSTANT_P_RTX. + * regclass.c (reg_scan_mark_refs, case CONST): Likewise. + +Tue Dec 29 11:30:10 1998 Richard Henderson + + * expr.c (init_expr_once): Kill can_handle_constant_p recognition. + * cse.c (fold_rtx, case 'x'): Remove standalone CONSTANT_P_RTX code. + + * alpha.c (reg_or_6bit_operand): Remove CONSTANT_P_RTX handling. + (reg_or_8bit_operand, cint8_operand, add_operand): Likewise. + (sext_add_operand, and_operand, or_operand): Likewise. + (reg_or_cint_operand, some_operand, input_operand): Likewise. + * alpha.h (PREDICATE_CODES): Likewise. + +Sat Dec 26 23:26:26 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Dec 26 09:17:04 1998 Jeffrey A Law (law@cygnus.com) + + * gengenrtl.c (gencode): Always use bzero to clear memory instead + of dangerous casts and stores. + + * Makefile.in (compare, gnucompare): Add missing else true clauses. + +Fri Dec 25 23:00:56 1998 Jeffrey A Law (law@cygnus.com) + + * alpha.md (builtin_longjmp): Add missing "DONE". + +Thu Dec 24 10:39:57 1998 Stan Cox + + * gcc.c (execute): Enable -pipe with win32. + +Wed Dec 23 10:27:44 1998 Nick Clifton + + * config/arm/t-arm-elf: Add multiplib option for leading + underscores. + + * config/arm/thumb.h (ASM_OUTPUT_LABELREF): Use variable + 'user_label_prefix' rather than macro USER_LABEL_PREFIX. + + (thumb_shiftable_const): Use macro 'BASE_REG_CLASS' rather + than variable 'reload_address_base_reg_class'. [Note this + change is unrelated to the others in this patch]. + + * config/arm/unknown-elf.h (USER_LABEL_PREFIX): Default to no + leading underscore. + +Wed Dec 23 09:51:32 1998 Kaveh R. Ghazi + + * alias.c (record_alias_subset): Remove ignored `&'. + (init_alias_once): Likewise. + + * c-lex.c (UNGETC): Cast first argument of comma expression to void. + + * config/mips/mips.c (mips_asm_file_end): Cast the result of + fwrite to `int' when comparing against one. + + * config/mips/mips.h (CAN_ELIMINATE): Add parens around && within ||. + (INITIAL_ELIMINATION_OFFSET): Add braces to avoid ambiguous `else'. + + * cse.c (rehash_using_reg): Change type of variable `i' to + unsigned int. + + * dwarf2out.c (initial_return_save): Cast -1 to unsigned before + assigning it to one. + + * except.c (duplicate_eh_handlers): Remove unused variable `tmp'. + + * final.c (final_scan_insn): Likewise for variable `i'. + (output_asm_insn): Cast a char to unsigned char when used as an + array index. + + * gcse.c (compute_pre_ppinout): Cast -1 to SBITMAP_ELT_TYPE when + assigning it to one. + + * loop.c (strength_reduce): Remove unused variables `count' and `temp'. + + * recog.c (preprocess_constraints): Cast a char to unsigned char + when used as an array index. + + * regmove.c (find_matches): Likewise. + + * reload1.c (calculate_needs): Add default case in switch. + (eliminate_regs_in_insn): Initialize variable `offset'. + (set_offsets_for_label): Change type of variable `i' to unsigned. + (reload_as_needed): Wrap variable `i' in macro check on + AUTO_INC_DEC || INSN_CLOBBERS_REGNO_P. + + * scan-decls.c (scan_decls): Mark parameters `argc' and `argv' + with ATTRIBUTE_UNUSED. Cast variable `start_written' to size_t + when comparing against one. + + * stor-layout.c (layout_decl): Cast maximum_field_alignment to + unsigned when comparing against one. Likewise for + GET_MODE_ALIGNMENT(). + (layout_record): Cast record_align to int when comparing against a + signed value. + (layout_type): Cast TYPE_ALIGN() to int when comparing against a + signed value. + + * tree.c (get_identifier): Cast variable `len' to unsigned when + comparing against one. + (maybe_get_identifier): Likewise + +Wed Dec 23 00:10:01 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (rest_of_compilation): Do not set reload_completed. + * reload1.c (reload): Set reload_completed before calling + cleanup_subreg_operands. + +Tue Dec 22 23:58:31 1998 Richard Henderson + + * reload1.c (emit_reload_insns): Check `set' not null before use. + +Tue Dec 22 15:15:45 1998 Nick Clifton + + * rtlanal.c (multiple_sets): Change type of 'found' from 'rtx' to + 'int'. + +Tue Dec 22 13:55:44 1998 Theodore Papadopoulo + + * halfpic.c (half_pic_encode): Delete redundant code. + +Tue Dec 22 13:02:22 1998 Michael Meissner + + * toplev.c (main): Delete handling of -dM as a preprocessor + option. + +Mon Dec 21 17:39:38 1998 Michael Meissner + + * toplev.c (main): Don't emit any warnings when using -dD, -dM, or + -dI, which are handled by the preprocessor. + +Sun Dec 20 16:13:44 1998 John F. Carr + + * configure.in: Handle Digital UNIX 5.x the same as 4.x. + * i386/sol2.h: Define LOCAL_LABEL_PREFIX as ".". + +Sun Dec 20 07:39:52 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Dec 19 22:24:22 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Dec 19 21:41:32 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Dec 19 09:52:27 1998 Kaveh R. Ghazi + + * genattr.c (fatal): Qualify a char* with the `const' keyword. + + * genattrtab.c (fatal, attr_printf, attr_string, write_attr_set, + write_unit_name, write_eligible_delay, expand_units, + make_length_attrs, write_attr_case, find_attr, + make_internal_attr): Likewise. + * gencheck.c (tree_codes): Likewise. + * gencodes.c (fatal): Likewise. + * genconfig.c (fatal): Likewise. + * genemit.c (fatal): Likewise. + * genextract.c (fatal, walk_rtx, copystr): Likewise. + * genflags.c (fatal): Likewise. + * genopinit.c (fatal, optabs, gen_insn): Likewise. + * genoutput.c (fatal, error, predicates): Likewise. + * genpeep.c (fatal): Likewise. + * genrecog.c (fatal, decision, pred_table, add_to_sequence, + write_tree_1, write_tree, change_state, copystr, indents): Likewise. + +Thu Dec 17 18:21:49 1998 Rainer Orth + + * configure.in (with-fast-fixincludes): Fix whitespace. + * configure: Rebuilt. + + * fixincludes (c_asm.h): Wrap Digital UNIX V4.0B DEC C specific + asm() etc. function declarations in __DECC. + +Thu Dec 17 13:57:23 1998 Nick Clifton + + * expr.c (emit_move_insn_1): Only emit a clobber if the target + is a pseudo register. + +Thu Dec 17 13:50:29 1998 Nick Clifton + + * gcse.c: Include expr.h in order to get the prototype for + get_condition() which is used in delete_null_pointer_checks(). + +Thu Dec 17 15:58:26 1998 Kaveh R. Ghazi + + * hwint.h: New file to consolidate HOST_WIDE_INT (etc) macros. + +Thu Dec 17 12:31:12 1998 Jim Wilson + + * Makefile.in (INTERNAL_CFLAGS): Add SCHED_CFLAGS. + (ALL_CFLAGS): Delete SCHED_CFLAGS. + +1998-12-17 Vladimir N. Makarov + + * config/i60/i960.md (extendqihi2): Fix typo (usage ',' instead of + ';'). + +1998-12-17 Michael Tiemann + + * i960.md (extend*, zero_extend*): Don't generate rtl that looks + like (subreg:SI (reg:SI N) 0), because it's wrong, and it hides + optimizations from the combiner. + +Thu Dec 17 08:27:03 1998 J"orn Rennecke + + * loop.c (combine_givs_used_by_other): Don't depend on n_times_set. + +Wed Dec 16 17:30:35 1998 Nick Clifton + + * toplev.c (main): Disable optimize_size if a specific + optimization level is requested. Always set optimization + level to 2 if -Os is specified. + +Wed Dec 16 16:33:04 1998 Dave Brolley + + * objc/lang-specs.h: Pass -MD, -MMD and -MG to cc1obj if configured with + cpplib. + * cpplib.c (cpp_start_read): If in_fname is not initialized, try to + initialize it using fname. + +1998-12-16 Zack Weinberg + + * cpplib.c (do_include): Treat #include_next in the + primary source file as #include plus warning. Treat + #include_next in a file included by absolute path as an + error. fp == CPP_NULL_BUFFER is a fatal inconsistency. + +Wed Dec 16 12:28:54 1998 Kaveh R. Ghazi + + * cccp.c: Don't define MIN/MAX anymore. + * cpplib.c: Likewise. + * machmode.h: Likewise. + * system.h: Provide definitions for MIN/MAX. + +Tue Dec 15 23:47:42 1998 Zack Weinberg + + * fix-header.c: Don't define xstrdup here. + +Wed Dec 16 05:11:04 1998 J"orn Rennecke + + * loop.c (consec_sets_giv): New argument last_consec_insn. + (strength_reduce): Provide / use it. + +Wed Dec 16 17:24:07 1998 Michael Hayes + + * loop.h (loop_info): New field 'vtop'. + * loop.c (check_dbra_loop): Use loop_info->vtop rather than + scanning loop for vtop. + * unroll.c (subtract_reg_term, find_common_reg_term): New functions. + (loop_iterations): Use them to determine if loop has a constant + number of iterations. Set loop_info->vtop. Don't subtract + common reg term from initial_value and final_value if have a + do-while loop. + +Tue Dec 15 13:49:55 1998 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (addsi3 expander): Use "nonmemory_operand" for operand 2. + + * mn10300.md (bset, bclr): Operand 0 is a read/write operand. + + * mn10200.md (abssf2, negsf2): New expanders. + + * mn10300.md (absdf2, abssf2, negdf2, negsf2): New expanders. + +Tue Dec 15 11:55:30 1998 Nick Clifton + + * integrate.c (copy_rtx_and_substitute): If a SUBREG is + replaced by a CONCAT whose components do not have the same + mode as the original SUBREG, use a new SUBREG to restore the + mode. + + * emit-rtl.c (subreg_realpart_p): Cope with subregs containing + multiword complex values. + +1998-12-15 Zack Weinberg + + * cppalloc.c: Add xstrdup here. + * cpplib.h: Remove savestring prototype. + * cpplib.c: Remove savestring function. s/savestring/xstrdup/ + throughout. + * cppfiles.c: s/savestring/xstrdup/ throughout. + +1998-12-15 Zack Weinberg + + * cpplib.c: Make all directive handlers read their own + arguments. + (struct directive): Remove last two arguments from FUNC + member prototype. Remove `command_reads_line' member + entirely. + (directive_table): Remove initializations of + command_reads_line flag. Pretty-print. + (eval_if_expression, do_define, do_line, do_include, + do_undef, do_error, do_pragma, do_ident, do_if, do_xifdef, + do_else, do_elif, do_sccs, do_assert, do_unassert, + do_warning): Take only two args. + + (cpp_define): Call do_define with two args and the text to + define stuffed into a buffer. + (make_assertion): Call do_assert with two args. + (handle_directive): Call do_line with two args. Call + kt->func with two args. Remove command_reads_line + processing. + (do_define, do_undef, do_error, do_warning, do_pragma, + do_sccs): Read the rest of the line here. + (do_ident): Gobble rest of line, as cccp does. + (cpp_undef): New function. + (cpp_start_read): Call cpp_undef instead of do_undef. + +1998-12-15 Zack Weinberg + + * cpphash.h (union hash_value): Remove `keydef' member, add a + `struct hashnode *aschain' member for #assert. + + * cpplib.c (struct tokenlist_list, struct + assertion_hashnode): Delete structure definitions. + (assertion_install, assertion_lookup, delete_assertion, + check_assertion, compare_token_lists, reverse_token_list, + read_token_list, free_token_list): Delete functions. + (parse_assertion): New function. + (cpp_cleanup): Don't destroy the assertion_hashtable. + + (do_assert): Gut and rewrite. #assert foo (bar) places + entries for `#foo' and `#foo(bar)' in the macro hash table, + type T_ASSERT. The value union's `aschain' member is used + to chain all answers for a given predicate together. + (do_unassert): Also rewritten. Take an un-asserted + answer off the chain from its predicate and call + delete_macro on the hashnode, or walk a predicate chain + calling delete_macro on all the entries. + (cpp_read_check_assertion): Simply call parse_assertion to + get the canonical assertion name, and look that up in the + hash table. + + * cpplib.h (ASSERTION_HASHNODE,ASSERTION_HASHSIZE,assertion_hashtab): + Removed. + + * cpphash.c (install): Use bcopy instead of an explicit loop + to copy the macro name. + + * cppexp.c (cpp_lex): Convert the result of + cpp_read_check_assertion to a `struct operation' directly; + don't go through parse_number. + +Tue Dec 15 18:27:39 1998 J"orn Rennecke + + * loop.h (struct induction): Delete times_used member. + * loop.c (n_times_set): Rename to set_in_loop. Changed all users. + (n_times_used): Rename to n_times_set. Changed all users. + (scan_loop): Free reg_single_usage before strength reduction. + (record_giv, combine_givs): Remove handling of times_used member. + (combine_givs_used_once): Rename to: + (combine_givs_used_by_other) . Changed all callers. + +Tue Dec 15 01:45:26 1998 Jason Merrill + + * dwarf2out.c (gen_struct_or_union_type_die): Check AGGREGATE_TYPE_P + instead of TREE_CODE_CLASS == 't'. + (gen_type_die): Likewise. + (scope_die_for): Ignore FUNCTION_TYPE "scopes". + +Mon Dec 14 16:23:27 1998 Jim Wilson + + * real.c (endian): Disable last change unless + HOST_BITS_PER_WIDE_INT is greater than 32. + +Mon Dec 14 17:13:36 1998 Andrew MacLeod + + * output.h (force_data_section): New prototype. + * varasm.c (force_data_section): New function to force the + data section, regardless of what in_section thinks. + * dwarf2out.c (output_call_frame_info): Call force_data_section + since varasm may not realize we've changes sections. + +Mon Dec 14 14:09:34 1998 Nick Clifton + + * reload1.c (reload): Delete REG_RETVAL and REG_LIBCALL notes + after completing reload. + + * rtl.texi: Document that REG_RETVAL and REG_LIBCALL are + deleted after reload. + +Mon Dec 14 01:39:28 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.h (multiple_sets): Fix prototype. + * rtlanal.c (multiple_sets): Fix return type. + +Sun Dec 13 12:43:58 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Dec 13 01:05:22 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +1998-12-13 Manfred Hollstein + + * protoize.c (fputs): Wrap extern declaration in #ifndef fputs. + +Sun Dec 13 00:24:14 1998 J"orn Rennecke + + * rtl.h (recompute_reg_usage): Add second argument. + * flow.c (recompute_reg_usage): Likewise. + * toplev.c (rest_of_compilation): Supply second argument to + recompute_reg_usage. + + * reload1.c (compute_use_by_pseudos): Allow reg_renumber[regno] < 0 + after reload. + +Sat Dec 12 23:39:10 1998 Jeffrey A Law (law@cygnus.com) + + * m68k/t-m68kelf (MULTILIB_OPTIONS): Add mcpu32. + (MULTILIB_MATCHES): -m68332 now uses mcpu32 libraries, not m68000. + (MULTILIB_EXCEPTIONS): Don't build 68881 libraries for m68000, + mcpu32 or m5200. + + * i386/next.h (ASM_OUTPUT_ALIGN): Use 0x90 for fill character. + + * rtlanal.c (multiple_sets): New function. + * rtl.h (multiple_sets): Declare it. + * local-alloc.c (wipe_dead_reg): Use it. + * global.c (global_conflicts): Likewise. + +Sat Dec 12 22:13:02 1998 Mark Mitchell + + * global.c (record_conflicts): Don't use an array of shorts to + store an array of ints. + (global_conflicts): Likewise. + +Sat Dec 12 16:49:24 1998 Richard Henderson + + * alpha.c (alpha_expand_block_move): mode_for_size expects + bits, not bytes. Infer extra alignment from addressof. + +1998-12-11 Michael Meissner + + * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Put small data in the + .sbss section, not .sdata. + +1998-12-11 Manfred Hollstein + + * cccp.c: Do not #include here; this is already done + by "system.h". + * collect2.c: Likewise. + * cpplib.h: Likewise. + * gcc.c: Likewise. + * gcov.c: Likewise. + * getpwd.c: Likewise. + * protoize.c: Likewise. + * toplev.c: Likewise. + + * cpplib.h (HOST_WIDE_INT): Get definition from "machmode.h" + and don't try to define it here. + * Makefile.in (cppmain.o): Depend on machmode.h. + (cpplib.o): Likewise. + (cpperror.o): Likewise. + (cppexp.o): Likewise. + (cppfiles.o): Likewise. + (cpphash.o): Likewise. + (cppalloc.o): Likewise. + (fix-header.o): Likewise. + (scan-decls.o): Likewise. + +Fri Dec 11 11:02:49 1998 Stan Cox + + * sh.c (print_operand): Lookup interrupt_handler attribute instead + of relying on static variable. + * (calc_live_regs): Likewise. + * (sh_pragma_insert_attributes): Create interrupt_handler + attribute if a pragma was specified. + * (sh_valid_machine_decl_attribute): Don't set static flag. + * sh.h (PRAGMA_INSERT_ATTRIBUTES): New. + +Fri Dec 11 12:56:07 1998 J"orn Rennecke + + * reload1.c (reload_combine): Use BASIC_BLOCK_LIVE_AT_START + to determine if a register is live at a jump destination. + Everything is dead at a BARRIER. + +Thu Dec 10 16:02:06 1998 Jim Wilson + + * cse.c (simplify_unary_operation): Sign-extend constants when + they have the most significant bit set for the target. + * real.c (endian): Sign-extend 32 bit output values on a 64 bit + host. + * m32r/m32r.c (m32r_expand_prologue): Store pretend_size in + HOST_WIDE_INT temporary before negating it. + * m32r/m32r.md (movsi_insn+1): Use ~0xffff instead of 0xffff0000. + +Thu Dec 10 15:05:59 1998 Dave Brolley + + * objc/objc-act.c (lang_init_options): Enclose cpplib related code in + #if USE_CPPLIB. + +Thu Dec 10 13:39:46 1998 Kaveh R. Ghazi + + * collect2.h: New header file for prototypes. + + * Makefile.in (collect2.o, tlink.o): Depend on collect2.h. + + * collect2.c: Include collect2.h. + * tlink.c: Likewise. + +Wed Dec 9 23:55:11 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c: Update some comments. + +Wed Dec 9 15:29:26 1998 Dave Brolley + + * objc/objc-act.c (cpp_initialized): Removed. + (lang_init_options): Initialize cpplib. + (lang_decode_option): Move initialization of cpplib to + lang_init_options. + * c-lang.c (parse_options,parse_in): Added. + (lang_init_options): Initialized cpplib here. + * c-decl.c (parse_options,cpp_initialized): Removed. + (c_decode_option): Move initialization of cpplib to + lang_init_options. + +Wed Dec 9 19:36:57 1998 J"orn Rennecke + + * reload1.c (reload_combine, reload_combine_note_store): + Make STORE_RUID always valid. + (reload_combine): Check if BASE is clobbered too early. + +Wed Dec 9 09:53:58 1998 Nick Clifton + + * reload.c (find_reloads): Display the insn that cannot be + reloaded. + +Wed Dec 9 12:15:26 1998 Dave Brolley + + * cccp.c (create_definition): Fix end of buffer logic. + +Wed Dec 9 10:15:45 1998 Kaveh R. Ghazi + + * except.c (duplicate_eh_handlers, rethrow_symbol_map): Function + pointer parameters changed to use the PARAMS() macro. + +Wed Dec 9 09:12:40 1998 Andrew MacLeod + + * except.h (struct handler_info): Add handler_number field. + * except.c (gen_exception_label): EH labels no longer need to be + on the permanent obstack. + (get_new_handler): Set the label number field. + (output_exception_table_entry): Regenerate handler label reference + from the label number field. + (init_eh): Remove a blank line. + * integrate.c (get_label_from_map): Labels no longer need to be + on the permanent obstack. + +Tue Dec 8 22:04:33 1998 Jim Wilson + + * i960/i960.h (CONST_COSTS, case CONST_INT): Accept power2_operand + only when OUTER_CODE is SET. + +Tue Dec 8 22:47:15 1998 J"orn Rennecke + + * loop.c (strength_reduce): If scan_start points to the loop exit + test, be wary of subversive use of gotos inside expression statements. + Don't set maybe_multiple for a backward jump that does not + include the label under consideration into its range. + * unroll.c (biv_total_increment): Make use of maybe_multiple field. + +Tue Dec 8 22:33:18 1998 J"orn Rennecke + + * explow.c (plus_constant_wide): Don't immediately return with + result of recursive call. + +Tue Dec 8 15:32:56 1998 Andrew MacLeod + + * eh-common.h (struct eh_context): Add table_index for rethrows. + + * rtl.h (enum reg_note): Add REG_EH_REGION and REG_EH_RETHROW reg notes. + (SYMBOL_REF_NEED_ADJUST): New flag indicating symbol needs to be + processed when inlined or unrolled (ie duplicated in some way). + + * rtl.c (reg_note_name): Add strings for new reg_note enums. + + * expr.h (rethrow_libfunc): New library decl. + + * optabs.c (rethrow_libfunc): Initialize. + + * except.h (struct eh_entry): Add new field 'rethrow_label'. + (new_eh_region_entry): No longer exported from except.c. + (duplicate_handlers): Renamed to duplicate_eh_handlers and + different prototype. + (rethrow_symbol_map, rethrow_used): New exported functions. + (eh_region_from_symbol): New exported function. + + * except.c (create_rethrow_ref): New function to create a single + SYMBOL_REF for a rethrow region. + (push_eh_entry): Initialize a rethrow ref. + (func_eh_entry): Add a rethrow_label field. + (new_eh_region_entry): Make static, and initialize the rethrow entry. + (duplicate_eh_handlers): Create a new region, and remap labels/symbols. + (eh_region_from_symbol): Find an EH region based on its rethrow symbol. + (rethrow_symbol_map): Given a label map, maps a rethrow symbol for + a region into an appropriate new symbol. + (rethrow_used): Indicate whether a rethrow symbol has been referenced. + (expand_eh_region_end): Don't issue jump around code for new-exceptions. + (end_catch_handler): Emit a barrier for new-exceptions since + control can never drop through the end of a catch block. + (expand_end_all_catch): new-exceptions never fall through a catch + block. + (expand_rethrow): Use __rethrow routine for new exceptions. + (output_exception_table_entry): Generate rethrow labels, if needed. + (output_exception_table): Generate start and end rethrow labels. + (init_eh): Create rethrow symbols for beginning and end of table. + (scan_region): Don't eliminate EH regions which are the targets of + rethrows. + + * flow.c (make_edges): Add different edges for rethrow calls, + identified by having the REG_EH_RETHROW reg label. + (delete_unreachable_blocks): Don't delete regions markers which are + the target of a rethrow. + + * integrate.c (save_for_inline_eh_labelmap): New callback routine to + allow save_for_inline_copying to call duplicate_eh_handlers. + (save_for_inline_copying): Call duplicate_eh_handlers instead of + exposing internal details of exception regions. + (copy_for_inline): Check if SYMBOL_REFs need adjustment. + (expand_inline_function_eh_labelmap): New callback routine to + allow expand_inline_function to call duplicate_eh_handlers. + (expand_inline_function): Call duplicate_eh_handlers instead of + exposing internal details of exception regions. + (copy_rtx_and_substitute): Adjust SYMBOL_REFS if SYMBOL_REF_NEED_ADJUST + flag is set. + + * libgcc2.c (find_exception_handler): Generalize to enable it to + pick up processing where it left off last time for a rethrow. + (__unwinding_cleanup): New function. debug hook which is called before + unwinding when __throw finds there is nothing but cleanups left. + (throw_helper): Common parts of __throw extracted out for reuse. + (__throw): Common parts moved to throw_helper. + (__rethrow): New function for performing rethrows. + +Tue Dec 8 13:11:04 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (current_function_decl): Tweak declaration. + +Tue Dec 8 10:23:52 1998 Richard Henderson + + * c-decl.c (flag_isoc9x): Default off. + (c_decode_option): Kill -std=gnu, add -std=gnu89 and -std=gnu9x. + * cccp.c (print_help, main): Likewise. + * gcc.c (default_compilers): Update for -std=gnu*. + +Tue Dec 8 01:14:46 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (DEMANGLE_H): Change location to shared demangle.h. + * demangle.h: Deleted. + + * reload1.c (current_function_decl): Declare. + +Tue Dec 8 11:58:51 1998 Kaveh R. Ghazi + + * cpplib.c (convert_string): Use `0x00ff', not `0x00ffU'. + +Tue Dec 8 09:28:36 1998 Kaveh R. Ghazi + + * dbxout.c: If USG is defined use gstab.h, even if HAVE_STAB_H is set. + +1998-12-08 Ulrich Drepper + + * configure.in: Test for availability of putc_unlocked, fputc_unlocked, + and fputs_unlocked. + * configure: Rebuilt. + * system.h: If the *_unlocked functions are available use them + instead of the locked counterparts by defining macros. + * config.in: Regenerated. + +Tue Dec 8 00:34:05 1998 Mike Stump + + * i386/bsd.h (ASM_FILE_START): Don't use dump_base_name, it is + wrong and should only be used for dump related things, not + debugging information, instead main_input_filename should be used. + Also, reuse output_file_directive if possible. + * i386/aix386ng.h (ASM_FILE_START): Likewise. + * i386/isc.h (ASM_FILE_START): Likewise. + * i386/win-nt.h (ASM_FILE_START): Likewise. + * i386/sun386.h (ASM_FILE_START): Likewise. + +Mon Dec 7 23:56:28 1998 Robert Lipe + + * configure.in (mips*-*-linux*): Handle big and little endian + systems. + * configure: Rebuilt. + +Mon Dec 7 23:14:51 1998 Mike Stump + + * emit-rtl.c: Fix typo. + +Mon Dec 7 23:07:38 1998 Nathan Sidwell + + * reload1.c (eliminate_regs): Don't do anything, if we're not + generating code. + +Mon Dec 7 15:27:09 1998 DJ Delorie + + * mips/mips.h (ENCODE_SECTION_INFO): Handle TARGET_EMBEDDED_DATA. + Add comment. + * mips/mips.c (mips_select_section): Add comment. + +Mon Dec 7 17:55:06 1998 Mike Stump + + * cccp.c (ignore_escape_flag): Add support for \ as `natural' + characters in file names in #line to be consistent with #include + handling. We support escape processing in the # 1 "..." version of + the command. See also support in cp/lex.c. + (handle_directive): Likewise. + (do_line): Likewise. + +1998-12-07 Zack Weinberg + + * cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM + so it'll work on non-ASCII platforms. Always consider $ an + identifier character. Take no arguments. + (cpp_reader_init): Call initialize_char_syntax with no + arguments. + (cpp_start_read): Don't call initialize_char_syntax again. + Clear is_idchar['$'] and is_idstart['$'] if not + opts->dollars_in_ident. + + * cpplib.h (struct cpp_reader): Replace void *data element by + cpp_options *opts. Rearrange elements to make gdb printout + less annoying (put buffer stack at end). + (CPP_OPTIONS): Get rid of now-unnecessary cast. + + * cppmain.c: s/data/opts/ when initializing cpp_reader + structure. + * c-decl.c: Likewise. + * objc/objc-act.c: Likewise. + * fix-header.c: Likewise. + +1998-12-07 Zack Weinberg + + * cpplib.h (struct cpp_buffer): Replace dir and dlen members + with a struct file_name_list pointer. + (struct cpp_reader): Add pointer to chain of `actual + directory' include searchpath entries. + (struct file_name_list): Add *alloc pointer for the sake of + the actual-directory chain. + + Move definition of HOST_WIDE_INT here. + (cpp_parse_escape): Change prototype to match changes in + cppexp.c. + + * cppfiles.c (actual_directory): New function. + (finclude): Use it to initialize the buffer's actual_dir + entry. + (find_include_file): We don't need to fix up max_include_len + here. + + * cpplib.c (do_include): Don't allocate a file_name_list on + the fly for current directory "" includes, use the one that's + been preallocated in pfile->buffer->actual_dir. Hoist out + duplicate code from the search_start selection logic. + (cpp_reader_init): Initialize pfile->actual_dirs. + + Remove definition of HOST_WIDE_INT. Change calls + to cpp_parse_escape to match changes in cppexp.c (note + hardcoded MASK, which is safe since this is the source + character set). + + * cppexp.c: Bring over changes to cpp_parse_escape from cccp.c + to handle wide character constants in #if directives. The + function now returns a HOST_WIDE_INT, and takes a third + argument which is a binary mask for all legal values (0x00ff + for 8-bit `char', 0xffff for 16-bit `wchar_t', etc.) Define + MAX_CHAR_TYPE_MASK and MAX_WCHAR_TYPE_MASK. Change callers of + cpp_parse_escape to match. [Fixes c-torture/execute/widechar-1.c] + +Mon Dec 7 15:38:25 1998 Dave Brolley + + * gcc.c (default_compilers): Fix typo in USE_CPPLIB spec for cc1. + +Mon Dec 7 15:38:25 1998 Kaveh R. Ghazi + + * c-aux-info.c (concat): Wrap function definition in !USE_CPPLIB. + * cppalloc.c: Move function `xcalloc' from cpplib.c to here. + * cpplib.c: Move function `xcalloc' from here to cppalloc.c. + +Mon Dec 7 11:30:49 1998 Nick Clifton + + * final.c (output_asm_name): Use tabs to separate comments from + assembly text. + + Include instruction lengths (if defined) in output. + +Mon Dec 7 10:53:38 1998 Michael Hayes + + * loop.c (check_dbra_loop): Fix initial_value and initial_equiv_value + in the loop_info structure. + +Mon Dec 7 11:04:40 1998 Catherine Moore + + * configure.in (arm*-*-ecos-elf): New target. + * configure: Regenerated. + * config/arm/elf.h (ASM_WEAKEN_LABEL): Define. + * config/arm/ecos-elf.h: New file. + * config/arm/unknown-elf.h (TARGET_VERSION): Check + for redefinition. + +Mon Dec 7 16:15:51 1998 J"orn Rennecke + + * sh.c (output_far_jump): Emit braf only for TARGET_SH2. + +Sun Dec 6 04:19:45 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Dec 6 05:16:16 1998 Michael Hayes + + * loop.c (check_dbra_loop): New argument loop_info. Update fields + as needed. + +Sun Dec 6 03:40:13 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Dec 6 07:49:29 1998 Alexandre Oliva + + * gcc.texi (Bug Reporting): 40Kb is a soft limit, larger + compressed reports are ok and preferred over URLs. + +Sun Dec 6 07:45:33 1998 Alexandre Oliva + + * invoke.texi (Warning Options): Soften the tone of -pedantic. + +Sun Dec 6 00:20:44 1998 H.J. Lu (hjl@gnu.org) + + * print-rtl.c (print_rtx): Add prototype. + + * unroll.c (iteration_info): Make it static. + +Sun Dec 6 01:19:46 1998 Richard Henderson + + * alias.c (memrefs_conflict_p): A second ANDed address + disables the aligned address optimization. + +Sat Dec 5 18:48:25 1998 Richard Henderson + + * alpha.c (alpha_emit_set_const_1): Fix parenthesis error + in -c << n case. + +Sat Dec 5 15:14:52 1998 Jason Merrill + + * i960.h (BOOL_TYPE_SIZE): Define. + +Sun Dec 6 00:28:16 1998 Michael Hayes + + * config/c4x/c4x.c (valid_parallel_load_store): Flog functionality + from old valid_parallel_operands_4. + (valid_parallel_operands_4): Check that operands for 4 operand + parallel insns are valid, excluding load/store insns. + * config/c4x/c4x.h (valid_parallel_load_store): Add prototype. + * config/c4x/c4x.md (*movqf_parallel, *movqi_parallel): Use + valid_parallel_load_store instead of valid_parallel_operands_4. + (*absqf2_movqf_clobber, *floatqiqf2_movqf_clobber, + *negqf2_movqf_clobber, *absqi2_movqi_clobber, + *fixqfqi2_movqi_clobber, *negqi2_movqi_clobber, + *notqi_movqi_clobber): Use valid_parallel_operands_4. + (*subqf3_movqf_clobber, *ashlqi3_movqi_clobber, + *ashrqi3_movqi_clobber, *lshrqi3_movqi_clobber, + *subqi3_movqi_clobber): Use valid_parallel_operands_5. + +Sat Dec 5 23:52:01 1998 Michael Hayes + + * config/c4x/c4x.c (iteration_info): Delete extern. + +Fri Dec 4 20:15:57 1998 Bernd Schmidt + + * tm.texi (SMALL_REGISTER_CLASSES): Make description match reality. + + * final.c (cleanup_subreg_operands): Delete some unused code. + + * recog.h (MAX_RECOG_ALTERNATIVES): New macro. + (struct insn_alternative): New structure definition. + (recog_op_alt): Declare variable. + (preprocess_constraints): Declare function. + * recog.c (recog_op_alt): New variable. + (extract_insn): Verify number of alternatives is in range. + (preprocess_constraints): New function. + * reg-stack.c: Include recog.h. + (constrain_asm_operands): Delete. + (get_asm_operand_lengths): Delete. + (get_asm_operand_n_inputs): New function. + (record_asm_reg_life): Delete OPERANDS, CONSTRAINTS, N_INPUTS and + N_OUTPUTS args. All callers changed. + Compute number of inputs and outputs here by calling + get_asm_operand_n_inputs. + Instead of constrain_asm_operands, call extract_insn, + constrain_operands and preprocess_constraints. Use information + computed by these functions throughout. + (record_reg_life): Delete code that is unused due to changes in + record_asm_reg_life. + (subst_asm_stack_regs): Delete OPERANDS, OPERAND_LOC, CONSTRAINTS, + N_INPUTS and N_OUTPUTS args. All callers changed. + Similar changes as in record_asm_reg_life. + (subst_stack_regs): Move n_operands declaration into the if statement + where it's used. + Delete code that is unused due to changes in subst_asm_stack_regs. + * stmt.c (expand_asm_operands): Verify number of alternatives is in + range. + * Makefile.in (reg-stack.o): Depend on recog.h. + +Fri Dec 4 02:23:24 1998 Jeffrey A Law (law@cygnus.com) + + * except.c (set_exception_version_code): Argument is an "int". + +Fri Dec 4 01:29:28 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa2*-*-*): Handle like hppa1.1-*-* for now. + * configure: Rebuilt. + +Fri Dec 4 01:29:28 1998 Robert Lipe + + * configure.in (mipsel-*-linux*): New target. + * mips/linux.h: New file, based on other Linux targets. + +Thu Dec 3 11:19:50 1998 Mike Stump + + * gthr-vxworks.h (__ehdtor): Fix memory leak. The delete hook + runs in the context of the deleter, not the deletee, so we must + use taskVarGet to find the correct memory to free. + (__gthread_key_create): Initialize the task + variable subsystem so that the task variable is still active when + the delete hook is run. + +1998-12-03 Joseph S. Myers + + * pdp11.h: Use optimize_size for space optimizations. + * pdp11.c: Likewise. + * pdp11.md: Likewise. + + * pdp11.h (TARGET_40_PLUS): Fix typo. + +Thu Dec 3 11:48:32 1998 Jeffrey A Law (law@cygnus.com) + + * local-alloc.c (block_alloc): Slightly retune heuristic to widen + qty lifetimes. + +Thu Dec 3 22:30:18 1998 Michael Hayes + + * alias.c (addr_side_effect_eval): New function. + (memrefs_conflict_p): Use it. + * rtl.h (addr_side_effect_eval): Prototype it. + +1998-12-02 Joseph S. Myers + + * pdp11.md (extendsfdf2): Fix mode mismatch in SET. + +Wed Dec 2 11:23:07 1998 Jim Wilson + + * reload.c (find_reloads): When force const to memory, put result + in substed_operand not *recog_operand_loc. + +1998-12-02 Ulrich Drepper + + * c-lex.c: Fix indentation from last patch. + Remove trailing whitespace. + * real.c: Likewise. + +Wed Dec 2 10:11:12 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (delete_block): Call set_last_insn after we have reset + NEXT_INSN (kept_tail). + +Wed Dec 2 00:47:31 1998 Jeffrey A Law (law@cygnus.com) + + * mips.md (trap_if): Use "$0" for the value zero. + +Tue Dec 1 20:49:49 1998 Ulrich Drepper + Stephen L Moshier + Richard Henderson + + * c-common.c (declare_function_name): Declare predefined variable + `__func__'. + + * c-decl.c (flag_isoc9x): Set to 1 by default. + (c_decode_option): Handle -std= option. Remove -flang-isoc9x. + (grokdeclarator): Always emit warning about implicit int for ISO C 9x. + + * c-parse.in: Allow constructors in ISO C 9x. + Rewrite designator list handling. + Allow [*] parameters. + Don't warn about comma at end of enum definition for ISO C 9x. + + * cccp.c (c9x): New variable. + (rest_extension): New variable. + (print_help): Document new -std= option. + (main): Recognize -std= option. Set c9x appropriately. + (create_definition): Recognize ISO C 9x vararg macros. + + * gcc.c (default_compilers): Adjust specs for -std options. + (option_map): Add --std. + (display_help): Document -std. + + * toplev.c (documented_lang_options): Add -std and remove + -flang-isoc9x. + + * c-lex.c (yylex): Recognize hex FP constants and call REAL_VALUE_ATOF + or REAL_VALUE_HTOF based on base of the constants. + * fold-const.c (real_hex_to_f): New function. Replacement function + for hex FP conversion if REAL_ARITHMETIC is not defined. + * real.c (asctoeg): Add handling of hex FP constants. + * real.h: Define REAL_VALUE_HTOF if necessary using ereal_atof or + real_hex_to_f. + +Tue Dec 1 16:45:49 1998 Stan Cox + + * mips.md (divmodsi4*, divmoddi4*, udivmodsi4*, udivmoddi4): Add + -mcheck-range-division/-mcheck-zero-division checking. Avoid as macro + expansion. Use hi/lo as destination register. + (div_trap): New. + (divsi3*, divdi3*, modsi3*, moddi3*, udivsi3*, udivdi3*, umodsi3*, + umoddi3*): Add -mcheck-range-division/-mcheck-zero-division checking. + Avoid as macro expansion. Use hi/lo as destination register. + + * mips.h (MASK_CHECK_RANGE_DIV): New. + (MASK_NO_CHECK_ZERO_DIV): New. + (ELIMINABLE_REGS): Added GP_REG_FIRST + 31. + (CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET): Allow for getting + return address for leaf functions out of r31 to support + builtin_return_address. + +Tue Dec 1 15:03:30 1998 Herman A.J. ten Brugge + + * jump.c (jump_optimize): Call regs_set_between_p with PREV_INSN(x), + NEXT_INSN(x) to check insn x. + +Tue Dec 1 15:20:44 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (delete_block): Call set_last_insn if we end up deleting the + last insn in the rtl chain. + + * reload1.c (reload): Do not set reload_completed or split insns + here. Instead... + * toplev.c (rest_of_compilation): Set reload_completed after + reload returns. Split insns after reload_cse has run. + +Tue Dec 1 11:55:04 1998 Richard Henderson + + * final.c (final_scan_insn): Abort if block_depth falls below 0. + +Tue Dec 1 10:23:16 1998 Nick Clifton + + * config/arm/t-arm-elf (LIBGCC2_CFLAGS): Define inhibit_libc. + +Tue Dec 1 10:22:18 1998 Nick Clifton + + * config/arm/unknown-elf.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Remove + use of user-label_prefix. + +Tue Dec 1 17:58:26 1998 J"orn Rennecke + + * reload1.c (emit_reload_insns): Clear spill_reg_store + when doing a new non-inherited reload from the same pseudo. + + * local-alloc.c (function_invariant_p): New function. + (update_equiv_regs): Use function_invariant_p instead of CONSTANT_P + to decide if an equivalence should be recorded. + * reload1.c (num_eliminable_invariants): New static variable. + (reload): Set it. Use function_invariant_p instead of CONSTANT_P + to decide if an equivalence should be recorded. + Unshare PLUS. + (calculate_needs_all_insns): Skip insns that only set an equivalence. + Take num_eliminable_invariants into account when deciding + if register elimination should be done. + (reload_as_needed): Take num_eliminable_invariants into account + when deciding if register elimination should be done. + (eliminate_regs): Handle non-constant reg_equiv_constant. + * rtl.h (function_invariant_p): Declare. + +Mon Nov 30 02:00:08 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Nov 30 00:42:59 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Nov 29 22:59:40 1998 Jason Merrill + + * except.c (add_new_handler): Complain about additional handlers + after one that catches everything. + +Sat Nov 28 10:56:32 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (alpha*-*-netbsd): Fix typo. + * configure: Rebuilt. + +Fri Nov 27 12:28:56 1998 Kaveh R. Ghazi + + * system.h: Include libiberty.h. + + * c-aux-info.c: Remove prototypes for concat/concat3. Change + function `concat' from fixed parameters to variable parameters, + as is done in libiberty. All callers of concat/concat3 + changed to use the new `concat' with variable args. + + * cccp.c: Remove things made redundant by libiberty.h and/or + conform to libiberty standards. + * cexp.y: Likewise. + * collect2.c: Likewise. + * config/1750a/1750a.h: Likewise. + * cppalloc.c: Likewise. + * cppexp.c: Likewise. + * cppfiles.c: Likewise. + * cpphash.c: Likewise. + * cpplib.c: Likewise. + * dyn-string.c: Likewise. + * fix-header.c: Likewise. + * gcc.c: Likewise. + * gcov.c: Likewise. + * genattr.c: Likewise. + * genattrtab.c: Likewise. + * gencheck.c: Likewise. + * gencodes.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * gengenrtl.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + * getpwd.c: Likewise. + * halfpic.c: Likewise. + * hash.c: Likewise. + * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes + in NEED_DECLARATION_* macros. + + * mips-tfile.c: Remove things made redundant by libiberty.h and/or + conform to libiberty standards. + (fatal): Fix const-ification of variable `format' in + !ANSI_PROTOTYPES case. + + * prefix.c: Remove things made redundant by libiberty.h and/or + conform to libiberty standards. + + * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid + conflicting with function `spaces' from libiberty. + + * profile.c: Remove things made redundant by libiberty.h and/or + conform to libiberty standards. + * protoize.c: Likewise. + * rtl.h: Likewise. + * scan.h: Likewise. + * tlink.c: Likewise. + * toplev.c: Likewise. + * toplev.h: Likewise. + * tree.h: Likewise. + +Thu Nov 26 08:38:06 1998 Kaveh R. Ghazi + + * cppfiles.c (simplify_pathname): Un-ANSI-fy function definition. + +Thu Nov 26 23:45:37 1998 Michael Hayes + + * README.C4X: Updated URLs. + * config/c4x/c4x.c (c4x_address_conflict): Fix typo. + (valid_parallel_operands_5): Remove unused variable. + +Thu Nov 26 23:40:03 1998 Michael Hayes + + * config/c4x/c4x.h (TARGET_DEFAULT): Fix typo. + +1998-11-26 Manfred Hollstein + + * Makefile.in (CONFIG_LANGUAGES): New macro taking all languages + which can be configured. + (LANGUAGES): Use $(CONFIG_LANGUAGES) instead of @all_languages@ + (Makefile): Pass actual LANGUAGES through the environment when + re-configuring. + (cstamp-h): Likewise. + (config.status): Likewise. + + * configure.in (enable_languages): Add new configuration parameter + "--enable-languages=lang1,lang2,...". + (${srcdir}/*/config-lang.in): Change handling to configure only + those directories, that the user might have enabled; default to + "all" existing languages. + * configure: Regenerate. + +Thu Nov 26 00:19:19 1998 Richard Henderson + + * rtlanal.c (regs_set_between_p): New function. + * rtl.h (regs_set_between_p): Prototype it. + * jump.c (jump_optimize): Use it instead of modified_between_p + in the Sep 2 change. + +Wed Nov 25 23:32:02 1998 Ian Dall + Matthias Pfaller + + * invoke.texi (Option Summary, NS32K Options): Add description + of NS32K specific options. + + * ns32k.md (tstdf, cmpdf, movdf, truncdfsf2, fixdfqi2, fixdfhi2, + fixdfsi2, fixunsdfqi2, fixunsdfhi2, fixunsdfsi2, fix_truncdfqi2, + fix_truncdfhi2, fix_truncdfsi2, adddf3, subdf3, muldf3, divdf3, + negdf2, absdf2): Use l instead of f since the double class and + float class are no longer the same. + (cmpsi, truncsiqi2, truncsihi2, addsi3, subsi3, mulsi3, umulsidi3, + divsi3, modsi3, andsi3, iorsi3, xorsi3, negsi2, one_cmplsi2, + ashlsi3, ashlhi3, ashlqi3, rotlsi3, rotlhi3, rotlqi3, abssi2,...): + Use "g" instead of "rmn" since LEGITIMATE_PIC_OPERAND has been + fixed. + (cmpsi, cmphi, cmpqi): Use general_operand instead of + non_immediate_operand. Removes erroneous assumption that can't + compare constants. + (movsf, movsi, movhi, movqi,...): New register numbering scheme. + (movsi, addsi3): Use NS32K_DISPLACEMENT_P instead of hard coded + constants. + (movstrsi, movstrsi1, movstrsi2): Completely new block move + scheme. + (...): Patterns to exploit multiply-add instructions. + (udivmodsi4, udivmodsi_internal4, udivmodhi4, + udivmoddihi4_internal, udivmodqi4, udivmoddiqi4_internal): New + patterns to exploit extended divide insns. + (udivsi3, udivhi3, udivqi3): Remove since superseded by udivmodsi + etc patterns. + + * ns32k.h (FUNCTION_VALUE, LIBCALL_VALUE): Use f0 for complex + float return values as well as simple scalar floats. + (TARGET_32381, TARGET_MULT_ADD, TARGET_SWITCHES): + Support new flag to denote 32381 fpu. + (OVERRIDE_OPTIONS): 32381 is a strict superset of 32081. + (CONDITIONAL_REGISTER_USAGE): Disable extra 32381 registers if not + compiling for 32381. + (FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, + REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES, OUTPUT_REGISTER_NAMES, + REG_ALLOC_ORDER, DBX_REGISTER_NUMBER, R0_REGNUM, F0_REGNUM, + L1_REGNUM, STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM, + LONG_FP_REGS_P, ARG_POINTER_REGNUM, reg_class, REG_CLASS_NAMES, + REG_CLASS_CONTENTS, SUBSET_P,REGNO_REG_CLASS, + REG_CLASS_FROM_LETTER, FUNCTION_PROLOGUE, FUNCTION_EPILOGUE, + REGNO_OK_FOR_INDEX_P, FP_REG_P, REG_OK_FOR_INDEX_P, + REG_OK_FOR_BASE_P, MEM_REG): New register scheme to include 32381 + fpu registers and special register classes for new 32381 + instructions dotf and polyf. + (MODES_TIEABLE_P): Allow all integer modes, notably DI and SI, to + be tieable. + (INCOMING_RETURN_ADDR_RTX, RETURN_ADDR_RTX, + INCOMING_FRAME_SP_OFFSET): New macros in case DWARF support is + required. + (SMALL_REGISTER_CLASSES): Make dependent on -mmult-add option. + (MOVE_RATIO): Set to zero because of smart movstrsi implementation. + (REGISTER_MOVE_COST): Move code to register_move_cost function for + ease of coding and debugging. + (CLASS_LIKELY_SPILLED_P): Under new register scheme class + LONG_FLOAT_REGO is likely spilled but not caught by default + definition. + (CONSTANT_ADDRESS_P, CONSTANT_ADDRESS_NO_LABEL_P): Use macro + instead of hard coded numbers in range check. + (ASM_OUTPUT_LABELREF_AS_INT): Delete since unused. + (...): Add prototypes for functions in ns32k.c but disable because + of problems when ns32k.h is included in machine independent files. + + * ns32k.c: Include "system.h", "tree.h", "expr.h", "flags.h". + (ns32k_reg_class_contents, regcass_map, ns32k_out_reg_names, + hard_regno_mode_ok, secondary_reload_class, + print_operand, print_operand_address): New register scheme to + include 32381 fpu registers and special register classes for new + 32381 instructions dotf and polyf. + (gen_indexed_expr): Make static to keep namespace clean. + (check_reg): Remove since never called. + (move_tail, expand_block_move): Helper functions for "movstrsi" + block move insn. + (register_move_cost): Helper function for REGISTER_MOVE_COST macro. + Increase cost of moves which go via memory. + * netbsd.h (TARGET_DEFAULT): Set (new) 32381 fpu flag. + (CPP_PREDEFINES): No longer predefine "unix". + + * ns32k.md (movsi, movsi, adddi3, subdi3, subsi3, subhi3, subqi3,...): + Remove erroneous %$. print_operand() can work out from the rtx is + an immediate prefix is required. + + * ns32k.h (RETURN_POPS_ARGS, VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE, COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Support for -mrtd calling + convention. + (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST): Correct handling of + pic operands. + + * ns32k.c (symbolic_reference_mentioned_p, print_operand): + Correct handling of pic operands. + (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p, + ns32k_comp_type_attributes, ns32k_return_pops_args): Support for + -mrtd calling convention. + +Wed Nov 25 23:42:20 1998 Tom Tromey + + * gcc.c (option_map): Recognize --output-class-directory. + +Thu Nov 26 18:26:21 1998 Michael Hayes + + * loop.h (precondition_loop_p): Added new mode argument. + * unroll.c (precondition_loop_p): Likewise. + (approx_final_value): Function deleted and subsumed + into loop_iterations. + (loop_find_equiv_value): New function. + (loop_iterations): Use loop_find_equiv_value to find increments + too large to be immediate constants. Also use it to find terms + common to initial and final iteration values that can be removed. + +Thu Nov 26 18:05:04 1998 Michael Hayes + + * loop.h (struct loop_info): Define new structure. + (precondition_loop_p): Added prototype. + (unroll_loop): Added new argument loop_info to prototype. + (final_biv_value, final_giv_value): Added new argument n_iterations + to prototype. + * loop.c (strength_reduce): Declare new structure loop_iteration_info + and new pointer loop_info. + (loop_n_iterations): Replace global variable by element in + loop_info structure. + (check_final_value): New argument n_iterations. + (insert_bct): New argument loop_info. + (loop_unroll_factor): Replace global array by element in + loop_info structure. + (loop_optimize): Remove code to allocate and initialize + loop_unroll_factor_array. + * unroll.c (precondition_loop_p): No longer static since + used by branch on count optimization. + (precondition_loop_p, unroll_loop): New argument loop_info. + (final_biv_value, final_giv_value, find_splittable_regs): New + argument n_iterations. + (loop_iteration_var, loop_initial_value, loop_increment, + loop_final_value, loop_comparison_code, loop_unroll_factor): + Replaced global variables by loop_info structure. + (loop_unroll_factor): Replace global array by element in + loop_info structure. + +Thu Nov 26 17:49:29 1998 Michael Hayes + + * loop.c (check_dbra_loop): Update JUMP_LABEL field of jump insn + when loop reversed. + + * unroll.c (precondition_loop_p): Return loop_initial_value + for initial_value instead of loop_iteration_var. + +Thu Nov 26 17:15:38 1998 Michael Hayes + + * config/c4x/c4x.md: Fix minor formatting problems. Update docs. + (*b, *b_rev, *b_noov, *b_noov_rev, *db, + decrement_and_branch_until_zero, rptb_end): Use c4x_output_cbranch + to output the instruction sequences. + (rpts): Delete. + (rptb_top): Provide alternatives to use any register or memory + for loop counter. + (rptb_end): Emit use of operands rather than assigning them + explicitly to the RS and RE registers. + +Thu Nov 26 16:37:59 1998 Michael Hayes + + * config/c4x/c4x.c (c4x_modified_between_p, c4x_mem_set_p, + c4x_mem_set_p, c4x_mem_modified_between_p, c4x_insn_moveable_p, + c4x_parallel_pack, c4x_parallel_find, c4x_update_info_reg, + c4x_update_info_regs, c4x_copy_insn_after, c4x_copy_insns_after, + c4x_merge_notes, c4x_parallel_process, + c4x_combine_parallel_independent, c4x_combine_parallel_dependent, + c4x_combine_parallel): Delete. + +Thu Nov 26 15:16:05 1998 Michael Hayes + + * config/c4x/c4x.c (c4x_override_options): For compatibility + with old target options clear flag_branch_on_count_reg if + -mno-rptb specified and set flag_argument_alias is -mno-aliases + specified. + (c4x_output_cbranch): Handle a sequence of insns rather than a + single insn. + (c4x_rptb_insert): Do not emit a RPTB insn if the RC register + has not been allocated as the loop counter. + (c4x_address_conflict): Do not allow two volatile memory references. + (valid_parallel_operands_4, valid_parallel_operands_5, + valid_parallel_operands_6): Reject pattern if the register destination + of the first set is used as part of an address in the second set. + +Thu Nov 26 14:56:32 1998 Michael Hayes + + * config/c4x/c4x.h (TARGET_DEFAULT): Add PARALEL_MPY_FLAG. + (TARGET_SMALL_REG_CLASS): Set to 0 so that SMALL_REGISTER_CLASSES + is no longer enabled if PARALLEL_MPY_FLAG set. + (HARD_REGNO_CALL_CLOBBERED): Add parentheses to remove ambiguity. + (REG_CLASS_CONTENTS): Add braces around initializers. + (HAVE_MULTIPLE_PACK): Define. + (ASM_OUTPUT_BYTE_FLOAT): Use %lf format specifier with + REAL_VALUE_TO_DECIMAL. + (ASM_OUTPUT_SHORT_FLOAT): Use %lf format specifier with + REAL_VALUE_TO_DECIMAL. + (ar0_reg_operand): Add prototype. + (ar0_mem_operand): Likewise. + (ar1_reg_operand): Likewise. + (ar1_mem_operand): Likewise. + (ar2_reg_operand): Likewise. + (ar2_mem_operand): Likewise. + (ar3_reg_operand): Likewise. + (ar3_mem_operand): Likewise. + (ar4_reg_operand): Likewise. + (ar4_mem_operand): Likewise. + (ar5_reg_operand): Likewise. + (ar5_mem_operand): Likewise. + (ar6_reg_operand): Likewise. + (ar6_mem_operand): Likewise. + (ar7_reg_operand): Likewise. + (ar7_mem_operand): Likewise. + (ir0_reg_operand): Likewise. + (ir0_mem_operand): Likewise. + (ir1_reg_operand): Likewise. + (ir1_mem_operand): Likewise. + (group1_reg_operand): Likewise. + (group1_mem_operand): Likewise. + (ir1_reg_operand): Likewise. + (arx_reg_operand): Likewise. + (not_rc_reg): Likewise. + (not_modify_reg): Likewise. + (c4x_group1_reg_operand): Remove prototype. + (c4x_group1_mem_operand): Likewise. + (c4x_arx_reg_operand): Likewise. + +Wed Nov 25 19:02:55 1998 (Stephen L Moshier) + + * emit-rtl.c (gen_lowpart_common): Remove earlier change. + * real.c (make_nan): Make SIGN arg actually specify the sign bit. + +Thu Nov 26 14:12:05 1998 Michael Hayes + + * config/c4x/c4x.md (addqi3): Emit addqi3_noclobber pattern + during reload. + +Wed Nov 25 22:05:28 1998 J"orn Rennecke + + * config/sh/lib1funcs.asm (___udivsi3_i4): Don't switch to sz == 1 + unless FMOVD_WORKS is defined. + +Wed Nov 25 20:11:04 1998 J"orn Rennecke + + * regclass.c (init_reg_sets): Move code that calculates tables + dependent on reg_class_contents from here... + (init_reg_sets_1): To here. + +Wed Nov 25 14:54:46 1998 Zack Weinberg + + * cpplib.h: Delete struct import_file. Add ihash element to + struct cpp_buffer. Delete dont_repeat_files and + import_hash_table elements from cpp_reader; change + all_include_files to a hash table. Delete all foobar_include + / last_foobar_include elements from struct cpp_options; put + back four such: quote_include, bracket_include, + system_include, after_include. Redo struct file_name_list + completely. Add new structure type include_hash. Add + prototypes for merge_include_chains and include_hash. Change + prototypes for finclude, find_include_file, and + append_include_chain to match changes below. + + * cppfiles.c (simplify_pathname, include_hash, + remap_filename, merge_include_chains): New functions. + (add_import, lookup_import, open_include_file): Removed. + (INO_T_EQ): Define this (copied from cccp.c). + (hack_vms_include_specification): Remove all calls and #if 0 + out the definition. It was being called incorrectly and at + the wrong times. Until a VMSie can look at this, it's better + to not pretend to support it. + (append_include_chain): Change calling convention; now takes + only one directory at a time, and sets up the data structure + itself. + (redundant_include_p): Rewritten - this is now used for all + include redundancy, whether by #ifndef, #import, or #pragma + once. Looks up things in the include hash table. + (file_cleanup): Decrement pfile->system_include_depth here if + it's >0. + (find_include_file): Calling convention changed; now passes + around a struct include_hash instead of 3 separate parameters. + Guts ripped out and replaced with new include_hash mechanism. + (finclude): Calling convention changed as for + find_include_file. Error exits pulled out-of-line. Reformat. + (safe_read): Return a long, not an int. + (deps_output): Don't recurse. + + * cpplib.c (is_system_include): Deleted. + (path_include): Fix up call to append_include_chain. + (do_include): Fix up calls to find_include_file and finclude. + Clean up dependency output a bit. Shorten obnoxiously lengthy + #import warning message. Don't decrement + pfile->system_include_depth here. + (do_pragma): Understand the include_hash structure. Reformat. + (do_endif): Correct handling of control macros. Understand + the include_hash. + (cpp_start_read): Fix up calls to finclude. Call + merge_include_chains. + (cpp_handle_option): Fix up calls to append_include_chain. + Understand the four partial include chains. + (cpp_finish): Add debugging code (#if 0-ed out) for the + include_hash. + (cpp_cleanup): Free the include_hash, not the import hash and + the all_include and dont_repeat lists which no longer exist. + +Wed Nov 25 11:26:19 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (no_new_pseudos): Define. + (rest_of_compilation): Set no_new_pseudos as needed. + * emit-rtl.c (gen_reg_rtx): Abort if we try to create a new pseudo + if no_new_pseudos is set. + * rtl.h (no_new_pseudos): Declare it. + * reload1.c (reload): Update comments. + * md.texi: Corresponding changes. + +Wed Nov 25 11:26:17 1998 Bernd Schmidt + + * reload1.c (reg_used_in_insn): Renamed from reg_used_by_pseudo. + (choose_reload_regs): Rename it here as well. When computing it, + also merge in used hardregs. + +1998-11-25 Zack Weinberg + + * gcc.c: Split out Objective-C specs to... + * objc/lang-specs.h: here. (New file.) Make the specs cpplib + aware. + + * c-lex.c (init_parse): Always initialize the filename global. + * objc/objc-act.c (lang_init): Always call check_newline at + beginning of file. + +Wed Nov 25 00:48:29 1998 Graham + + * reload1.c (reload): Remove unused variable. + (reload_reg_free_for_value_p): Add missing parameter definition. + + * jump.c (jump_optimize): Remove unused variable. + +Wed Nov 25 00:07:11 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (graph.o): Depend on $(RTL_H), not rtl.h. + + * cse.c (fold_rtx): Make autoincrement addressing mode tests be + runtime selectable. + * expr.c (move_by_pieces): Similarly. + (move_by_pieces_1, clear_by_pieces, clear_by_pieces_1): Similarly. + * flow.c (find_auto_inc): Similarly. + (try_pre_increment): Similarly. + * loop.c (strength_reduce): Similarly. + * regclass.c (auto_inc_dec_reg_p): Similarly. + * regmove.c (try_auto_increment): Similarly. + (fixup_match_1): Similarly. + * rtl.h (HAVE_PRE_INCREMENT): Define if not already defined. + (HAVE_PRE_DECREMENT): Similarly. + (HAVE_POST_INCREMENT, HAVE_POST_DECREMENT): Similarly. + * Corresponding changes to all target header files. + * tm.texi: Update docs for autoinc addressing modes. + +Tue Nov 24 20:24:59 1998 Jim Wilson + + * configure.in (m68020-*-elf*, m68k-*-elf*): New targets. + * configure: Rebuild. + * config/elfos.h: New file. + * config/m68k/m68020-elf.h, config/m68k/m68kelf.h, + config/m68k/t-m68kelf: New file. + +Tue Nov 24 13:40:06 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (HOST_AR): Define. + (HOST_AR_FLAGS, HOST_RANLIB, HOST_RANLIB_TEST): Similarly. + (libcpp.a): Use the host tools explicitly. + (STAGESTUFF): Add libcpp.a. + +Tue Nov 24 09:33:49 1998 Nick Clifton + + * config/m32r/m32r.md (movstrsi_internal): Describe changes made + to source and destination registers. + +Mon Nov 23 20:28:02 1998 Mike Stump + + * libgcc2.c (top_elt): Remove top_elt, it isn't thread safe. + The strategy we now use is to pre allocate the top_elt along + with the EH context so that each thread has its own top_elt. + This is necessary as the dynamic cleanup chain is used on the + top element of the stack and each thread MUST have its own. + (eh_context_static): Likewise. + (new_eh_context): Likewise. + (__sjthrow): Likewise. + +Mon Nov 23 20:25:03 1998 Jason Merrill + + * i386/linux.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Wrap in do...while. + * i386.md (prologue_get_pc): Remove unused variable. + +Mon Nov 23 17:05:40 1998 Geoffrey Noer + + * i386/xm-cygwin.h: Rename cygwin_ path funcs back to cygwin32_. + +Mon Nov 23 16:40:00 1998 Ulrich Drepper + + * Makefile.in (OBJS): Add graph.o. + (graph.o): New dependency list. + * flags.h: Declare dump_for_graph and define graph_dump_types type. + * print-rtl.c (dump_for_graph): Define new variable. + (print_rtx): Rewrite to allow use in graph dumping functions. + * toplev.c: Declare print_rtl_graph_with_bb, clean_graph_dump_file, + finish_graph_dump_file. + Define graph_dump_format. + (compile_file): If graph dumping is enabled also clear these files. + Finish graph dump files. + (rest_of_compilation): Also dump graph information if enabled. + (main): Recognize -dv to enabled VCG based graph dumping. + * graph.c: New file. Graph dumping functions. + +Mon Nov 23 16:39:04 1998 Richard Henderson + + * configure.in: Look for . + * system.h: Include it before substitute S_ISREG definitions. + +Mon Nov 23 17:40:37 1998 Gavin Romig-Koch + + * config/mips/abi.h: Use ABI_O64, duplicating ABI_32 usage. + * config/mips/iris6.h: Same. + * config/mips/mips.md: Same. + * config/mips/mips.c: Same; also add "-mabi=o64" option. + * config/mips/mips.h: Same; also define ABI_O64. + +Mon Nov 23 17:02:27 1998 Kaveh R. Ghazi + + * configure.in: Use AC_PREREQ(2.12.1). + +Mon Nov 23 10:16:38 1998 Melissa O'Neill + + * cccp.c (S_ISREG, S_ISDIR): Delete defines. + * cpplib.c, gcc.c: Likewise. + * system.h (S_ISREG, S_ISDIR): Define if not already defined. + +Mon Nov 23 09:53:44 1998 Richard Henderson + + * local-alloc.c (local_alloc): Use malloc not alloca for + reg_qty, reg_offset, ref_next_in_qty. + +Mon Nov 23 16:46:46 1998 J"orn Rennecke + + * caller-save.c (insert_one_insn): Initialize the live_before and + live_after register sets. + + Add SH4 support: + + * config/sh/lib1funcs.asm (___movstr_i4_even, ___movstr_i4_odd): Define. + (___movstrSI12_i4, ___sdivsi3_i4, ___udivsi3_i4): Define. + * sh.c (reg_class_from_letter, regno_reg_class): Add DF_REGS. + (fp_reg_names, assembler_dialect): New variables. + (print_operand_address): Handle SUBREGs. + (print_operand): Added 'o' case. + Don't use adj_offsettable_operand on PRE_DEC / POST_INC. + Name of FP registers depends on mode. + (expand_block_move): Emit different code for SH4 hardware. + (prepare_scc_operands): Use emit_sf_insn / emit_df_insn as appropriate. + (from_compare): Likewise. + (add_constant): New argument last_value. Changed all callers. + (find_barrier): Don't try HImode load for FPUL_REG. + (machine_dependent_reorg): Likewise. + (sfunc_uses_reg): A CLOBBER cannot be the address register use. + (gen_far_branch): Emit a barrier after the new jump. + (barrier_align): Don't trust instruction lengths before + fixing up pcloads. + (machine_dependent_reorg): Add support for FIRST_XD_REG .. LAST_XD_REG. + Use auto-inc addressing for fp registers if doubles need to + be loaded in two steps. + Set sh_flag_remove_dead_before_cse. + (push): Support for TARGET_FMOVD. Use gen_push_fpul for fpul. + (pop): Support for TARGET_FMOVD. Use gen_pop_fpul for fpul. + (calc_live_regs): Support for TARGET_FMOVD. Don't save FPSCR. + Support for FIRST_XD_REG .. LAST_XD_REG. + (sh_expand_prologue): Support for FIRST_XD_REG .. LAST_XD_REG. + (sh_expand_epilogue): Likewise. + (sh_builtin_saveregs): Use DFmode moves for fp regs on SH4. + (initial_elimination_offset): Take TARGET_ALIGN_DOUBLE into account. + (arith_reg_operand): FPUL_REG is OK for SH4. + (fp_arith_reg_operand, fp_extended_operand): New functions. + (tertiary_reload_operand, fpscr_operand): Likewise. + (commutative_float_operator, noncommutative_float_operator): Likewise. + (binary_float_operator, get_fpscr_rtx, emit_sf_insn): Likewise. + (emit_df_insn, expand_sf_unop, expand_sf_binop): Likewise. + (expand_df_unop, expand_df_binop, expand_fp_branch): Likewise. + (emit_fpscr_use, mark_use, remove_dead_before_cse): Likewise. + * sh.h (CPP_SPEC): Add support for -m4, m4-single, m4-single-only. + (CONDITIONAL_REGISTER_USAGE): Likewise. + (HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, FMOVD_BIT): Define. + (TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARWARD): Define. + (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH4, TARGET_FMOVD): Define. + (target_flag): Add -m4, m4-single, m4-single-only, -mfmovd. + (OPTIMIZATION_OPTIONS): If optimizing, set flag_omit_frame_pointer + to -1 and sh_flag_remove_dead_before_cse to 1. + (ASSEMBLER_DIALECT): Define to assembler_dialect. + (assembler_dialect, fp_reg_names): Declare. + (OVERRIDE_OPTIONS): Add code for TARGET_SH4. + Hide names of registers that are not accessible. + (CACHE_LOG): Take TARGET_CACHE32 into account. + (LOOP_ALIGN): Take TARGET_HARWARD into account. + (FIRST_XD_REG, LAST_XD_REG, FPSCR_REG): Define. + (FIRST_PSEUDO_REGISTER: Now 49. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Include values for registers. + (HARD_REGNO_NREGS): Special treatment of FIRST_XD_REG .. LAST_XD_REG. + (HARD_REGNO_MODE_OK): Update. + (enum reg_class): Add DF_REGS and FPSCR_REGS. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REG_ALLOC_ORDER): Likewise. + (SECONDARY_OUTPUT_RELOAD_CLASS, SECONDARY_INPUT_RELOAD_CLASS): Update. + (CLASS_CANNOT_CHANGE_SIZE, DEBUG_REGISTER_NAMES): Define. + (NPARM_REGS): Eight floating point parameter registers on SH4. + (BASE_RETURN_VALUE_REG): SH4 also passes double values + in floating point registers. + (GET_SH_ARG_CLASS): Likewise. + Complex float types are also returned in float registers. + (BASE_ARG_REG): Complex float types are also passes in float registers. + (FUNCTION_VALUE): Change mode like PROMOTE_MODE does. + (LIBCALL_VALUE): Remove trailing semicolon. + (ROUND_REG): Round when double precision value is passed in floating + point register(s). + (FUNCTION_ARG_ADVANCE): No change wanted for SH4 when things are + passed on the stack. + (FUNCTION_ARG): Little endian adjustment for SH4 SFmode. + (FUNCTION_ARG_PARTIAL_NREGS): Zero for SH4. + (TRAMPOLINE_ALIGNMENT): Take TARGET_HARWARD into account. + (INITIALIZE_TRAMPOLINE): Emit ic_invalidate_line for TARGET_HARWARD. + (MODE_DISP_OK_8): Not for SH4 DFmode. + (GO_IF_LEGITIMATE_ADDRESS): No base reg + index reg for SH4 DFmode. + Allow indexed addressing for PSImode after reload. + (LEGITIMIZE_ADDRESS): Not for SH4 DFmode. + (LEGITIMIZE_RELOAD_ADDRESS): Handle SH3E SFmode. + Don't change SH4 DFmode nor PSImode RELOAD_FOR_INPUT_ADDRESS. + (DOUBLE_TYPE_SIZE): 64 for SH4. + (RTX_COSTS): Add PLUS case. + Increase cost of ASHIFT, ASHIFTRT, LSHIFTRT case. + (REGISTER_MOVE_COST): Add handling of R0_REGS, FPUL_REGS, T_REGS, + MAC_REGS, PR_REGS, DF_REGS. + (REGISTER_NAMES): Use fp_reg_names. + (enum processor_type): Add PROCESSOR_SH4. + (sh_flag_remove_dead_before_cse): Declare. + (rtx_equal_function_value_matters, fpscr_rtx, get_fpscr_rtx): Declare. + (PREDICATE_CODES): Add binary_float_operator, + commutative_float_operator, fp_arith_reg_operand, fp_extended_operand, + fpscr_operand, noncommutative_float_operator. + (ADJUST_COST): Use different scale for TARGET_SUPERSCALAR. + (SH_DYNAMIC_SHIFT_COST): Cheaper for SH4. + * sh.md (attribute cpu): Add value sh4. + (attrbutes fmovd, issues): Define. + (attribute type): Add values dfp_arith, dfp_cmp, dfp_conv, dfdiv. + (function units memory, int, mpy, fp): Make dependent on issue rate. + (function units issue, single_issue, load_si, load): Define. + (function units load_store, fdiv, gp_fpul): Define. + (attribute hit_stack): Provide proper default. + (use_sfunc_addr+1, udivsi3): Predicated on ! TARGET_SH4. + (udivsi3_i4, udivsi3_i4_single, divsi3_i4, divsi3_i4_single): New insns. + (udivsi3, divsi3): Emit special patterns for SH4 hardware, + (mulsi3_call): Now uses match_operand for function address. + (mulsi3): Also emit code for SH1 case. Wrap result in REG_LIBCALL / + REG_RETVAL notes. + (push, pop, push_e, pop_e): Now define_expands. + (push_fpul, push_4, pop_fpul, pop_4, ic_invalidate_line): New expanders. + (movsi_ie): Added y/i alternative. + (ic_invalidate_line_i, movdf_i4): New insns. + (movdf_i4+[123], reload_outdf+[12345], movsi_y+[12]): New splitters. + (reload_indf, reload_outdf, reload_outsf, reload_insi): New expanders. + (movdf): Add special code for SH4. + (movsf_ie, movsf_ie+1, reload_insf, calli): Make use of fpscr visible. + (call_valuei, calli, call_value): Likewise. + (movsf): Emit no-op move. + (mov_nop, movsi_y): New insns. + (blt, sge): Generalize to handle DFmode. + (return predicate): Call emit_fpscr_use and remove_dead_before_cse. + (block_move_real, block_lump_real): Predicate on ! TARGET_HARD_SH4. + (block_move_real_i4, block_lump_real_i4, fpu_switch): New insns. + (fpu_switch0, fpu_switch1, movpsi): New expanders. + (fpu_switch+[12], fix_truncsfsi2_i4_2+1): New splitters. + (toggle_sz): New insn. + (addsf3, subsf3, mulsf3, divsf3): Now define_expands. + (addsf3_i, subsf3_i, mulsf3_i4, mulsf3_ie, divsf3_i): New insns. + (macsf3): Make use of fpscr visible. Disable for SH4. + (floatsisf2): Make use of fpscr visible. + (floatsisf2_i4): New insn. + (floatsisf2_ie, fixsfsi, cmpgtsf_t, cmpeqsf_t): Disable for SH4. + (ieee_ccmpeqsf_t): Likewise. + (fix_truncsfsi2): Emit different code for SH4. + (fix_truncsfsi2_i4, fix_truncsfsi2_i4_2, cmpgtsf_t_i4): New insns. + (cmpeqsf_t_i4, ieee_ccmpeqsf_t_4): New insns. + (negsf2, sqrtsf2, abssf2): Now expanders. + (adddf3, subdf3i, muldf2, divdf3, floatsidf2): New expanders. + (negsf2_i, sqrtsf2_i, abssf2_i, adddf3_i, subdf3_i): New insns. + (muldf3_i, divdf3_i, floatsidf2_i, fix_truncdfsi2_i): New insns. + (fix_truncdfsi2, cmpdf, negdf2, sqrtdf2, absdf2): New expanders. + (fix_truncdfsi2_i4, cmpgtdf_t, cmpeqdf_t, ieee_ccmpeqdf_t): New insns. + (fix_truncdfsi2_i4_2+1): New splitters. + (negdf2_i, sqrtdf2_i, absdf2_i, extendsfdf2_i4): New insns. + (extendsfdf2, truncdfsf2): New expanders. + (truncdfsf2_i4): New insn. + * t-sh (LIB1ASMFUNCS): Add _movstr_i4, _sdivsi3_i4, _udivsi3_i4. + (MULTILIB_OPTIONS): Add m4-single-only/m4-single/m4. + * float-sh.h: When testing for __SH3E__, also test for + __SH4_SINGLE_ONLY__ . + * va-sh.h (__va_freg): Define to float. + (__va_greg, __fa_freg, __gnuc_va_list, va_start): + Define for __SH4_SINGLE_ONLY__ like for __SH3E__ . + (__PASS_AS_FLOAT, __TARGET_SH4_P): Likewise. + (__PASS_AS_FLOAT): Use different definition for __SH4__ and + __SH4_SINGLE__. + (TARGET_SH4_P): Define. + (va_arg): Use it. + + * sh.md (movdf_k, movsf_i): Tweak the condition so that + init_expr_once is satisfied about the existence of load / store insns. + + * sh.md (movsi_i, movsi_ie, movsi_i_lowpart, movsf_i, movsf_ie): + Change m constraint in source operand to mr / mf. + + * va-sh.h (__va_arg_sh1): Use __asm instead of asm. + + * (__VA_REEF): Define. + (__va_arg_sh1): Use it. + + * va-sh.h (va_start, va_arg, va_copy): Add parentheses. + +Sun Nov 22 21:34:02 1998 Jeffrey A Law (law@cygnus.com) + + * i386/dgux.c (struct option): Add new "description field". + * m88k/m88k.c (struct option): Likewise. + +Sun Nov 22 16:07:57 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Nov 22 13:40:02 1998 Bernd Schmidt + + * regmove.c (regmove_profitable_p): Use return value of find_matches + properly. + +Sun Nov 22 02:47:37 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Nov 21 22:12:09 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (eliminate_regs): Do not lose if eliminate_regs is called + without reload having been called earlier. + + * v850.c (ep_memory_operand): Offsets < 0 are not valid for EP + addressing modes. + (v850_reorg): Similarly. + + * loop.c (check_dbra_loop): Avoid using gen_add2_insn. + +Sat Nov 21 02:18:38 1998 J"orn Rennecke + + * loop.c (move_movables): Start of libcall might be new loop start. + +Fri Nov 20 12:14:16 1998 Kaveh R. Ghazi + + * hash.c (hash_table_init_n): Wrap prototype arguments in PARAMS(). + +Fri Nov 20 08:34:00 1998 Bernd Schmidt + + * function.c (nonlocal_goto_handler_slots): Renamed from + nonlocal_goto_handler_slot; now an EXPR_LIST chain. + (push_function_context_to): Adjust for this change. + (pop_function_context_from): Likewise. + (init_function_start): Likewise. + (expand_function_end): Likewise. + * function.h (struct function): Likewise. + * calls.c (expand_call): Likewise. + * explow.c (allocate_dynamic_stack_space): Likewise. + * expr.h (nonlocal_goto_handler_slots): Rename its declaration. + * stmt.c (declare_nonlocal_label): Make a new handler slot for each + label. + (expand_goto): When doing a nonlocal goto, find corresponding handler + slot for it. Don't put the label address in the static chain register. + (expand_end_bindings): Break out nonlocal goto handling code into + three new functions. + (expand_nl_handler_label, expand_nl_goto_receiver, + expand_nl_goto_receivers): New static functions, broken out of + expand_end_bindings and adapted to create one handler per nonlocal + label. + * function.c (delete_handlers): Delete insn if it references any of + the nonlocal goto handler slots. + * i960.md (nonlocal_goto): Comment out code that modifies + static_chain_rtx. + * sparc.md (nonlocal_goto): Likewise. + (goto_handler_and_restore_v9): Comment out. + (goto_handler_and_restore_v9_sp64): Comment out. + +Thu Nov 19 23:44:38 1998 Bernd Schmidt + + * expr.c (STACK_BYTES): Delete unused macro. + * calls.c: Provide default for PREFERRED_STACK_BOUNDARY. + (STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY. + (expand_call): Likewise. + (emit_library_call): Likewise. + (emit_library_call_value): Likewise. + * function.c: Provide default for PREFERRED_STACK_BOUNDARY. + (STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY. + * explow.c: Provide default for PREFERRED_STACK_BOUNDARY. + (round_push): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY. + (allocate_dynamic_stack_space): Likewise. + * tm.texi (PREFERRED_STACK_BOUNDARY): Document new macro. + (STACK_BOUNDARY): Update description to reflect the new situation. + +Thu Nov 19 22:20:51 1998 Jeffrey A Law (law@cygnus.com) + + * reorg.c (relax_delay_slots): When optimizing for code size, if a + return with a filled delay slot is followed by a return with an + unfilled delay slot, delete the first return and reemit the insn + that was previously in its delay slot. + + * i860.c (single_insn_src_p): Add missing parens. + * ginclude/math-3300.h: Likewise. + +Thu Nov 19 20:55:59 1998 H.J. Lu (hjl@gnu.org) + + * regclass.c (init_reg_sets_1): Add prototype. + (init_reg_modes): Likewise. + +1998-11-19 Zack Weinberg + + * c-common.c: Change warning messages to say `comparison is + always true' or `comparison is always false' instead of the + confusing `is always 0', `is always 1'. + +Thu Nov 19 19:05:49 1998 Per Bothner + + * print-tree.c (print_node): After printing BLOCK or BIND_EXPR, + break instead of return (which loses closing '>'). + +Thu Nov 19 19:34:13 1998 Jeffrey A Law (law@cygnus.com) + + * i386.h (LEGITIMATE_CONSTANT_P): Reject CONST_DOUBLEs that are not + standard 387 constants. + + * i386.md (jump): Explicitly set "memory" attribute. + (indirect_jump, prologue_set_stack_ptr): Likewise. + (prologue_get_pc_and_set_got, pop): Likewise. + (allocate_stack_worder, blockage, return_internal): Likewise. + (return_pop_internal, nop): Likewise. + (epilogue_set_stack_ptr, leave): Likewise. + +Thu Nov 19 15:42:54 1998 Nick Clifton + + * config/arm/coff.h: Set USER_LABEL_PREFIX to "_". + +Thu Nov 19 23:20:59 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): + Early auto_inc reloads don't conflict with outputs. + +Thu Nov 19 12:58:55 1998 Kaveh R. Ghazi + + * configure.in: Don't do AC_CHECK_HEADERS(wait.h sys/wait.h). + Instead call AC_HEADER_SYS_WAIT. + + * collect2.c: Don't provide defaults for sys/wait.h macros. + * gcc.c: Likewise. + * protoize.c: Likewise. Also, don't include sys/wait.h. + + * system.h: Include sys/wait.h and provide macro defaults. + +1998-11-19 Andreas Schwab + + * Makefile.in (mandir): Set to @mandir@. + (man1dir): New variable to hold the former value of $(mandir). + Replace all uses of $(mandir) by $(man1dir). + +Wed Nov 18 16:31:28 1998 Jim Wilson + + * reload.c (find_reloads_address_part): If have a CONST_INT, create + a new one before passing it to force_const_mem. + + * reload.c (find_reloads_toplev): Pass &x instead of NULL_PTR in + find_reloads_address call. + +Wed Nov 18 22:13:00 1998 J"orn Rennecke + + * expr.c (store_expr): Don't generate load-store pair + if TEMP is identical (according to ==) with TARGET. + +Tue Nov 17 22:25:16 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): When considered reload + has an output, matching inputs are not sufficient to avoid conflict. + +Tue Nov 17 11:51:16 1998 Mark Mitchell + + * hash.h (hash_table_key): New type. + (hash_entry): Change `string' field to generic `key'. + (hash_table): Add `comp' and `hash' functions. + (hash_table_init): Take them as input. + (hash_table_init_n): Likewise. + (hash_lookup): Modify for generic keys. + (hash_newfunc): Likewise. + (hash_traverse): Likewise. + (string_hash): New function. + (string_compare): Likewise. + (string_copy): Likewise. + * hash.c (hash_table_init_n): Modify for generic keys. + (hash_table_init): Likewise. + (hash_lookup): Likewise. + (hash_newfunc): Likewise. + (hash_traverse): Likewise. + (string_hash): Split out from hash_lookup. + (string_compare): New function. + (string_copy): Split out from hash_lookup. + * tlink.c (symbol_hash_newfunc): Modify for new interfaces to hash + tables. + (symbol_hash_lookup): Likewise. + (file_hash_newfunc): Likewise. + (file_hash_lookup): Likewise. + (demangled_hash_newfunc): Likewise. + (demangled_hash_lookup): Likewise. + (tlink_int): Likewise. + (read_repo_file): Likewise. + (recompile_files): Likewise. + (demangle_new_symbols): Likewise. + (scan_linker_output): Likewise. + +Tue Nov 17 17:13:53 1998 J"orn Rennecke + + * flow.c (insn_dead_p): New argument NOTES. Changed all callers. + +Mon Nov 16 17:56:07 1998 David Edelsohn + + * rs6000.c (output_mi_thunk): Improve test for local branch. + +Mon Nov 16 17:56:07 1998 Franz Sirl + + * rs6000.c (output_mi_thunk): Correct test for aggregate values. + +Mon Nov 16 21:02:52 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_before_p): Delete. + Changed all callers to use reload_reg_free_for_value_p instead. + (reload_reg_free_for_value_p): Handle more reload types. + A RELOAD_FOR_INPUT doesn't conflict with its + RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS. + Add special case for OUT == const0_rtx. + Added ignore_address_reloads argument. Changed all callers. + +Mon Nov 16 02:22:29 1998 Jason Merrill + + * toplev.c (compile_file): Don't pedwarn about undefined static + functions just because we passed -Wunused. + +Mon Nov 16 04:41:41 1998 J"orn Rennecke + + * function.c (purge_addressof_1): Unshare rtl created by + store_bit_field. + +Mon Nov 16 04:23:06 1998 J"orn Rennecke + + * regmove.c (regmove_optimize): Don't do anything but + optimize_reg_copy[123] when flag_regmove is not set. + +Sat Nov 14 15:05:07 1998 Richard Henderson + + * alpha.md (addsi3, subsi3): Revise 5 Nov change to store DImode + value in paradoxical SImode result, rather than truncating midpoint. + +Fri Nov 13 22:19:23 1998 Richard Henderson + + * alpha.c (reg_not_elim_operand): New. + * alpha.h (PREDICATE_CODES): Add it. + * alpha.md (s48addq, s48subq patterns): Use it as the predicate + for the multiplicand. + +Fri Nov 13 22:50:37 1998 David Edelsohn + + * rs6000.md (movsf): Remove explicit secondary-reload-like + functionality. Only truncate SFmode store if in FPR. + (movsf splitters): Combine const_double splitters. + (movsf_hardfloat): Add GPR support. + +Fri Nov 13 11:02:11 1998 Stan Cox + + * splet.h (SUBTARGET_OVERRIDE_OPTIONS): New to + deprecate -mlive-g0 and -mbroken-saverestore. + * t-splet (MULTILIB_OPTIONS): Likewise. + + * sparc.c (sparc_flat_compute_frame_size): Correctly calc args_size + in a leaf function. Clarify total_size/extra_size relationship. + +Thu Nov 12 19:20:57 1998 Geoffrey Noer + + * i386/cygwin32.asm: Delete. + * i386/cygwin.asm: New file, renamed from cygwin32.asm. + * i386/cygwin32.h: Delete. + * i386/cygwin.h: New file, renamed from cygwin32.h. + * i386/t-cygwin32: Delete. + * i386/t-cygwin: New file, renamed from t-cygwin32. Include + cygwin.asm instead of cygwin32.asm. Remove "32" from comment. + * i386/x-cygwin32: Delete. + * i386/x-cygwin: New file, renamed from x-cygwin32. + * i386/xm-cygwin32: Delete. + * i386/xm-cygwin: New file, renamed from xm-cygwin32. Use newly + renamed cygwin_ funcs for path translations. + * i386/win32.h: Define __CYGWIN__ when -mcygwin given. + * i386/winnt.c: Remove "32" from comment about cygwin. + * i386/mingw32.h: Fix references to cygwin32.h in light of above. + * rs6000/cygwin32.h: Delete. + * rs6000/cygwin.h: New file, renamed from cygwin32.h. Add + -D__CYGWIN__ to CPP_PREDEFINES. + * rs6000/x-cygwin32: Delete. + * rs6000/x-cygwin: New file, renamed from x-cygwin32. + * rs6000/xm-cygwin32: Delete. + * rs6000/xm-cygwin: New file, renamed from xm-cygwin32. + + * configure.in: Check for cygwin* instead of cygwin32. Account + for the rename of cygwin-related config files to lose the "32"s. + * configure: Regenerate. + + * cccp.c, collect2.c, gcc.c, getpwd.c, libgcc2.c, protoize.c, + toplev.c: Change all refs to __CYGWIN32__ to __CYGWIN__. + +Wed Nov 11 12:25:19 1998 Tom Tromey + + * Makefile.in (JAVAGC): New macro. + * configure: Rebuilt. + * configure.in: Recognize --enable-java-gc argument. Subst + `JAVAGC' variable. + +Thu Nov 12 03:32:16 1998 J"orn Rennecke + + Handle equivalences that have been obscured by gcse: + + * reload1.c (reload): Handle equivalences set up in multiple places. + * local-alloc.c (reg_equiv_init_insns): New variable. + (no_equiv): New function. + (update_equiv_regs): Handle equivalences set up in multiple places. + Don't ignore an insn just because its destination is likely to be + spilled. + +Wed Nov 11 13:46:13 1998 Jim Wilson + + * except.c (expand_eh_return): Readd force_operand call lost in + Sept 15 change. + +Tue Nov 10 17:04:11 1998 David Edelsohn + + * rs6000.h (LEGITIMIZE_ADDRESS): Add missing goto on last case. + +1998-11-09 Andreas Schwab + + * dbxout.c: Check HAVE_STAB_H instead of HAVE_STABS_H. + +Mon Nov 9 20:15:19 1998 Bernd Schmidt + + * regmove.c (regmove_optimize): Fix error in last change. + +Mon Nov 9 16:37:52 1998 Andrew Cagney + + * mips.c (function_prologue): When TARGET_MIPS16, adjust the register + offset in the .mask pseudo to compensate for frame pointer adjustments. + (mips16_fp_args, build_mips16_call_stub): For little endian, do not + word swap arguments moved to/from FP registers. + * mips16.S (DFREVCMP): Reverse arguments to OPCODE. + +Mon Nov 9 09:47:06 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Nov 9 02:14:14 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Nov 9 03:06:24 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (delete_output_reload_insn): If a pseudo is set multiple + times, then it can not be completely replaced. + +Mon Nov 9 00:39:02 1998 Richard Henderson + + * alpha.md (call, call_value) [OSF]: Correct alt 3 insn length. + +Sun Nov 8 17:50:30 1998 Kaveh R. Ghazi + + * gansidecl.h: Prepend a "G" to the macro wrapping this file + (to distinguish it from the macro wrapping ansidecl.h.) + Include libiberty's ansidecl.h. Remove all redundant definitions. + Define the PROTO() style macros in terms of the PARAMS() ones. + + + * calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not + __STDC__, when deciding whether to use ANSI variable args. + (emit_library_call_value): Likewise. + + * cccp.c (error): Likewise. + (warning): Likewise. + (error_with_line): Likewise. + (warning_with_line): Likewise. + (pedwarn): Likewise. + (pedwarn_with_line): Likewise. + (pedwarn_with_file_and_line): Likewise. + (fatal): Likewise. + + * cexp.y (error): Likewise. + (pedwarn): Likewise. + (warning): Likewise. + + * collect2.c (fatal_perror): Likewise. + (fatal): Likewise. + (error): Likewise. + + * combine.c (gen_rtx_combine): Likewise. + + * cpperror.c (cpp_message): Likewise. + (cpp_fatal): Likewise. + + * cpplib.c (cpp_error): Likewise. + (cpp_warning): Likewise. + (cpp_pedwarn): Likewise. + (cpp_error_with_line): Likewise. + (cpp_warning_with_line): Likewise. + (cpp_pedwarn_with_line): Likewise. + (cpp_pedwarn_with_file_and_line): Likewise. + + * cpplib.h: Don't define PARAMS() macro. + + * demangle.h: Likewise. + + * doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__, + when deciding whether to use ANSI variable args. + + * emit-rtl.c (gen_rtx): Likewise. + (gen_rtvec): Likewise. + + * final.c (asm_fprintf): Likewise. + + * fix-header.c (cpp_message): Likewise. + (fatal): Likewise. + (cpp_fatal): Likewise. + + * gcc.c (concat): Likewise. + (fatal): Likewise. + (error): Likewise. + + * genattr.c (fatal): Likewise. + + * genattrtab.c (attr_rtx): Likewise. + (attr_printf): Likewise. + (fatal): Likewise. + + * gencodes.c (fatal): Likewise. + + * genconfig.c (fatal): Likewise. + + * genemit.c (fatal): Likewise. + + * genextract.c (fatal): Likewise. + + * genflags.c (fatal): Likewise. + + * genopinit.c (fatal): Likewise. + + * genoutput.c (fatal): Likewise. + (error): Likewise. + + * genpeep.c (fatal): Likewise. + + * genrecog.c (fatal): Likewise. + + * halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when + deciding whether to declare `tree_node' and `rtx_def'. + + * hash.h: Don't define stuff we get from gansidecl.h. + + * mips-tfile.c: Likewise. Define __proto() in terms of PARAMS(). + (fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding + whether to use ANSI variable args. + (error): Likewise. + + * prefix.c (concat): Likewise. + + * scan.h: Likewise. + + * system.h: Likewise. + + * toplev.c (error_with_file_and_line): Likewise. + (error_with_decl): Likewise. + (error_for_asm): Likewise. + (error): Likewise. + (fatal): Likewise. + (warning_with_file_and_line): Likewise. + (warning_with_decl): Likewise. + (warning_for_asm): Likewise. + (warning): Likewise. + (pedwarn): Likewise. + (pedwarn_with_decl): Likewise. + (pedwarn_with_file_and_line): Likewise. + (sorry): Likewise. + (really_sorry): Likewise. + + * toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding + whether to declare `tree_node' and `rtx_def'. + + * tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when + deciding whether to use ANSI variable args. + (build_nt): Likewise. + (build_parse_node): Likewise. + +Sun Nov 8 13:10:55 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Nov 7 23:34:01 1998 Kaveh R. Ghazi + + * Makefile.in (libcpp.a): Check RANLIB_TEST before runing RANLIB. + +Sat Nov 7 22:26:19 1998 David Edelsohn + + * collect2.c (main, case 'b'): Use else if. + +Sat Nov 7 15:35:25 1998 Kaveh R. Ghazi + + * configure.in (host_xm_file, build_xm_file, xm_file, tm_file): + Arrange to include gansidecl.h in {ht}config.h & tm.h just + before the config/ directory headers. + (tm_file_list, host_xm_file_list, build_xm_file_list): Handle + gansidecl.h in the list of dependencies. + + * Makefile.in (RTL_BASE_H): Don't depend on gansidecl.h. + (TREE_H, DEMANGLE_H, RECOG_H, REGS_H, libgcc2.a, stmp-multilib, + mbchar.o, collect2.o, pexecute.o, vfprintf.o, splay-tree.o, gcc.o, + gencheck.o, choose-temp.o, mkstemp.o, mkstemp.o, prefix.o, + dyn-string.o, cexp.o, cccp.o, cppmain.o, cpplib.o, cpperror.o, + cppexp.o, cppfiles.o, cpphash.o, cppalloc.o, scan-decls.o): + Likewise. + + * cccp.c: Don't include gansidecl.h. + * cexp.y: Likewise. + * collect2.c: Likewise. + * config/c4x/c4x.c: Likewise. + * config/v850/v850.h: Likewise. + * cppalloc.c: Likewise. + * cpperror.c: Likewise. + * cppexp.c: Likewise. + * cppfiles.c: Likewise. + * cpphash.c: Likewise. + * cpplib.c: Likewise. + * cppmain.c: Likewise. + * cppulp.c: Likewise. + * demangle.h: Likewise. + * doprint.c: Likewise. + * dyn-string.c: Likewise. + * eh-common.h: Likewise. + * fix-header.c: Likewise. + * frame.c: Likewise. + * gcc.c: Likewise. + * gcov.c: Likewise. + * gen-protos.c: Likewise. + * gencheck.c: Likewise. + * halfpic.h: Likewise. + * hash.c: Likewise. + * machmode.h: Likewise. + * mbchar.c: Likewise. + * prefix.c: Likewise. + * protoize.c: Likewise. + * recog.h: Likewise. + * rtl.h: Likewise. + * scan-decls.c: Likewise. + * tree.h: Likewise. + * varray.h: Likewise. + +Sat Nov 7 11:37:53 1998 Richard Henderson + + * i386.md (call_value_pop): If we're not popping anything, + defer to call_value. + (call_pop): Likewise defer to call. + +Sat Nov 7 02:49:56 1998 Richard Henderson + + * function.c (purge_addressof): Clear purge_addressof_replacements + only after processing the whole function. + +Sat Nov 7 00:54:55 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload): If we can not perform a particular elimination + when we thought we could earlier, then we must always iterate through + the loop at least one more time. + +Fri Nov 6 19:37:33 1998 Richard Henderson + + * alpha.c (add_operand): Simplify the CONST_INT match. + (sext_add_operand): Correct typo in comparison by using + CONST_OK_FOR_LETTER_P. + * alpha.md (s?addq): Use sext_add_operand to allow the negative + constant alternatives to be generated. + (mulsi3, muldi3, umuldi3_highpart): Loosen constraints to allow + small constants, since the hw instructions do. + +Fri Nov 6 20:15:19 1998 Bernd Schmidt + + * reload1.c (emit_reload_insns): When rewriting the SET_DEST of a + previous insn to store directly into our reload register, make sure + that if the source of the previous insn is a reload register, its + spill_reg_store and spill_reg_stored_to values are cleared. + +Fri Nov 6 16:35:10 1998 David Edelsohn + + * rs6000.md (floatunssidf2_internal splitter): Use base register + operand, not hard-coded SP. + +Fri Nov 6 04:07:53 1998 David S. Miller + + * jump.c (calculate_can_reach_end): Fix thinko. + +Fri Nov 6 00:16:04 1998 Jeffrey A Law (law@cygnus.com) + + * reorg.c (fill_simple_delay_slots): Fix typo. + + * romp.h (LEGITIMIZE_ADDRESS): Fix typo. + +Fri Nov 6 00:10:00 1998 Jan Hubicka (hubicka@freesoft.cz) + + * i386.md (extendsidi2): Use # in the output template. + (extendsidi splitters): New splitters. + +Thu Nov 5 11:13:27 1998 Nick Clifton + + * configure.in: Use unknown-elf.h as tm_file for arm-elf + configurations. + * configure: Regenerate. + +Thu Nov 5 07:59:05 1998 David S. Miller + + * jump.c (init_label_info, delete_barrier_successors, + mark_all_labels, delete_unreferenced_labels, + delete_noop_moves, calculate_can_reach_end): New functions broken + out of jump_optimize. + (jump_optimize): Use them. + +Thu Nov 5 07:57:45 1998 Andrew MacLeod + + * except.c (expand_fixup_region_end): Make sure outer context labels + are not issued in an inner context during cleanups. + +Thu Nov 5 04:03:06 1998 Richard Henderson + + * alpha.md (addsi3, subsi3): No new temporaries once cse is + no longer expected. + +Thu Nov 5 03:29:19 1998 Richard Henderson + + * alpha.md (addsi3, subsi3): Expand to a DImode temporary so as + to expose this midpoint to CSE. + +Thu Nov 5 03:42:54 1998 David S. Miller + + * config/sparc/sparc.md (movdf_const_intreg_sp64): Enable again. + +Thu Nov 5 10:53:01 1998 Andreas Schwab + + * configure.in: Bring over gcc2 change of Nov 19 1997. + +Wed Nov 4 23:43:08 1998 Graham + + * toplev.c (output_lang_identify): Make definition dependent on + ASM_IDENTIFY_LANGUAGE. + + * print-rtl.c (spaces): Make static. + +Wed Nov 4 22:16:36 1998 Hans-Peter Nilsson + + * extend.texi: Clarify proper uses for register clobbers in asms. + +Wed Nov 4 22:16:36 1998 Bernd Schmidt + + * recog.h (enum op_type): Define. + (constrain_operands): Adjust prototype. + (recog_op_type): Declare new variable. + * recog.c (recog_op_type): New variable. + (insn_invalid_p): Allow modifying an asm statement after reload. + (extract_insn): Set up recog_op_type. + (constrain_operands): Lose INSN_CODE_NUM arg. All callers changed. + Don't compute operand types, use recog_op_type. + Use the information computed by extract_insn instead of the previous + method of finding it by insn code number. + * caller-save.c (init_caller_save): Use extract_insn, not insn_extract. + * reorg.c (fill_slots_from_thread): Likewise. + * reload1.c (reload_as_needed): Likewise. + (gen_reload): Likewise. + (inc_for_reload): Likewise. + (reload_cse_simplify_operands): Likewise. + Use the information computed by extract_insn instead of the previous + method of finding it by insn code number. + * genattrtab.c (write_attr_case): Generate call to extract_insn, not + insn_extract. + * final.c (final_scan_insn): Use extract_insn, not insn_extract. + (cleanup_operand_subregs): Use extract_insn, not insn_extract. + Use the information computed by extract_insn instead of the previous + method of finding it by insn code number. + * regmove.c (find_matches): Likewise. Change meaning of the return + value to be nonzero if the optimization can be performed, zero if + not. All callers changed. + Shorten some variable names to fix formatting problems. + (regmove_optimize): Shorten some variable names to fix formatting + problems. + Use the information computed by extract_insn instead of the previous + method of finding it by insn code number. + * regclass.c (scan_one_insn): Likewise. + (record_reg_classes): Don't compute operand types, use recog_op_type. + * reload.c (find_reloads): Lose CONSTRAINTS1 variable; use + recog_constraints instead. + +Wed Nov 4 21:37:46 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.h (flow2_completed): Declare. + * flow.c (flow2_completed): Definition. + * toplev.c (rest_of_compilation): Set and clear flow2_completed + as necessary. + +Wed Nov 4 19:15:37 1998 Melissa O'Neill + + * Makefile.in (libcpp.a): Ranlib libcpp.a. + + * cppulp.c (user_label_prefix): Initialize. + +Wed Nov 4 19:07:08 1998 John Wehle (john@feith.com) + + * flow.c (mark_regs_live_at_end): Mark the stack pointer as live + at a RETURN if current_function_sp_is_unchanging is set. + +Wed Nov 4 18:16:29 1998 Herman A.J. ten Brugge + + * emit-rtl.c (try_split): Fixed error in Oct 10 patch. + +Wed Nov 4 15:11:15 1998 Geoffrey Noer + + * i386/cygwin32.h (MASK_WIN32, MASK_CYGWIN, MASK_WINDOWS, MASK_DLL, + TARGET_WIN32, TARGET_CYGWIN, TARGET_WINDOWS, TARGET_DLL): New. + (SUBTARGET_SWITCHES): Add -mno-cygwin, -mcygwin, and -mdll options. + (CPP_PREDEFINES): Don't define __CYGWIN32__ here. + (STARTFILE_SPEC): Handle -mdll, -mno-cygwin options. + (CPP_SPEC): Handle -mno-cygwin option. Define __CYWIN__ in addition + to __CYGWIN32__. + (LIB_SPEC): Handle -mno-cygwin option. + (LINK_SPEC): Handle -mdll. + +Wed Nov 4 22:56:14 1998 J"orn Rennecke + + * reload.c (find_reloads): Fix test for usage by other reload + to handle secondary reloads properly. + +Wed Nov 4 17:25:10 1998 Kaveh R. Ghazi + + * reload1.c (ELIMINABLE_REGS, NUM_ELIMINABLE_REGS): Introduce an + intermediate structure which has exactly the members provided by + ELIMINABLE_REGS. Define NUM_ELIMINABLE_REGS in terms of the + static intermediate structure. + + (init_elim_table): Xmalloc() `reg_eliminate', and initialize it + from the intermediate structure. Do the same analogous fix in + the case where ELIMINABLE_REGS is not defined. + +Tue Nov 3 20:50:03 1998 Jeffrey A Law (law@cygnus.com) + + * pa.h (SELECT_SECTION): Fix thinko. + +Tue Nov 3 17:51:36 1998 Jim Wilson + + * dwarf2out.c (output_call_frame_info): Comments on last change. + +Tue Nov 3 07:51:43 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (add_constant): When taking the address of an item in the + pool, get the mode of the item addressed. + + * arm.c (final_prescan_insn case INSN): If an insn doesn't + contain a SET or a PARALLEL, don't consider it for conditional + execution. + + Restore ABI compatibility for NetBSD. + * arm/netbsd.h (DEFAULT_PCC_STRUCT_RETURN): Override setting in + arm.h. + (RETURN_IN_MEMORY): Likewise. + +Mon Nov 2 11:46:17 1998 Doug Evans + + * m32r/m32r.c (m32r_expand_block_move): Fix byte count computations. + (m32r_output_block_move): Rewrite bytes < 4 handling. + +Mon Nov 2 10:10:35 1998 Kaveh R. Ghazi + + * configure.in: Call AC_FUNC_VFORK. + + * collect2.c: Define VFORK_STRING as a printable string for + error messages (either "vfork" or "fork".) If HAVE_VFORK_H is + defined, include vfork.h. If VMS is defined, define vfork() + appropriately. Remove vfork check on USG, we're using autoconf. + (collect_execute): Pass VFORK_STRING to fatal_perror instead of + checking locally what string to pass. + (scan_prog_file): Likewise. + (scan_libraries): Likewise. + + * gcc.c: Remove vfork check on USG, we're using autoconf. + Besides, no calls to vfork/fork occur in this file. + + * protoize.c: Likewise. + +Mon Nov 2 07:52:28 1998 Alexandre Oliva + + * configure.in (DEFAULT_LINKER): Renamed from LD. + (DEFAULT_ASSEMBLER): Renamed from AS; reverted Schwab's patch. + (gcc_cv_as): Try $DEFAULT_ASSEMBLER before $AS. + * configure: Rebuilt. + +Mon Nov 2 01:48:10 1998 Alexandre Oliva + + * BUGS: Fix the regexp for `more' to find the appropriate node. + Reported by Joerg Pietschmann + + * BUGS: Added link to the WWW FAQ. + +Sun Nov 1 18:27:15 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Nov 1 11:04:32 1998 Jeffrey A Law (law@cygnus.com) + + * From Christian Gafton: + * i386/linux.h (CPP_PREDEFINES): Add -D__i386__. + * sparc/linux.h (CPP_PREDEFINES): Add -D__sparc__. + * sparc/linux64.h (CPP_PREDEFINES): Add -D__sparc__. + +Sat Oct 31 21:42:39 1998 Mark Mitchell + + * c-common.c (c_get_alias_set): Allow all type-punning through + unions. Don't get confused about the type of a bit-field, despite + the antics of build_modify_expr. + +Sat Oct 31 22:35:29 1998 Jean-Pierre Radley + + * fixinc.sco: Parameterize #include_next values. + * fixinc/fixinc.sco: Likewise. + +Sat Oct 31 20:39:35 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (rest_of_compilation): No longer set reload_completed. + * reload1.c (reload): Set it here. Perform instruction splitting + after reload has completed if we will be running the scheduler + again. + +Sat Oct 31 12:30:02 1998 Jeffrey A Law (law@cygnus.com) + + * jump.c (jump_optimize): Initialize mappings from INSN_UID to + EH region if exceptions are enabled and we're performing cross + jump optimizations. + (find_cross_jump): Exit loop if the insns are in different EH regions. + +Sat Oct 31 10:02:48 1998 Mark Mitchell + + * dwarf2out.c (output_call_frame_info): Use + ASM_OUTPUT_DWARF_DELTA4 for the CIE offset to match frame.c. + +Sat Oct 31 10:23:14 1998 Kaveh R. Ghazi + + Reinstall Apr 24th fix, lost during May 6th gcc2 merge: + * c-common.c (check_format_info): Don't check for the 'x' + format character twice, instead check for 'x' and 'X' + +Fri Oct 30 14:50:25 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (assembler features): Also make gas is configured if + we find it in the source tree. + +Fri Oct 30 13:23:20 1998 Richard Henderson + + * i386.c (i386_comp_type_attributes): Compare whether the + attributes are defined, not their tree nodes. + +Fri Oct 30 11:39:47 1998 Alexandre Oliva + + * configure.in (gxx_include_dir): Bitten by autoconf quoting + characters. :-( + * configure: Rebuilt. + +Fri Oct 30 10:43:29 1998 Andreas Schwab + + * configure.in: Ignore non-absolute value in $AS. + +Fri Oct 30 00:54:25 1998 Peter Jakubek + + * m68k.h (INDIRECTABLE_1_ADDRESS_P): Fix thinko. + +Fri Oct 30 00:42:34 1998 Mark Elbrecht + + * configure.in (msdosdjgpp): Set exeext and target_alias. + +Thu Oct 29 23:55:43 1998 Bernd Schmidt + + * flow.c (XNMALLOC): New macro. + (flow_int_list_blocks, basic_block_succ, basic_block_pred): New + static variables. + (add_edge, add_edge_to_label): New static functions. + (free_bb_memory): New function. + (flow_delete_insn): Delete function. + (basic_block_drops_in): Delete variable. + (find_basic_blocks): Allocate and initialize basic_block_head, + basic_block_succ. Don't allocate basic_block_drops_in. + Call free_bb_memory at the beginning. + (find_basic_blocks_1): Don't do multiple passes. + Delete code to compute basic_block_drops_in. + After calling make_edges, mark blocks reached by current block live. + Update test for unreachable live blocks. + (mark_label_ref): Delete args X, CHECKDUP. Add PRED arg. All callers + changed. + Simplify to call add_edge_to_label when a LABEL_REF is found. + (make_edges): Simplify to call add_edge_to_label instead of + mark_label_ref most of the time. + Compute here whether control drops into the next block. + (delete_unreachable_blocks): Return void. All callers changed. + Delete unreachable blocks in reverse order. + After deleting all unreachable blocks, renumber the remaining ones + and update n_basic_blocks. + (delete_block): Speed up deletion a bit. + Don't set basic_block_drops_in for deleted blocks. + (free_basic_block_vars): Don't free basic_block_drops_in. + (life_analysis_1): Update to use new edge representation. + (dump_flow_info): Delete code to print basic block info; call + dump_bb_data instead. + (compute_preds_succs): Delete code to recompute basic_block_drops_in + and uid_block_number. + Simply copy the previously computed cfg. + (dump_bb_data): New arg LIVE_INFO. All callers changed. + Print register lifetime information if LIVE_INFO is nonzero. + * basic-block.h (dump_bb_data): Adjust prototype. + * gcse.c (gcse_main): Update call to dump_bb_data. + * rtl.h (free_bb_memory): Declare. + * toplev.c (rest_of_compilation): Call free_bb_memory. + + * reload1.c (struct elim_table): Delete MAX_OFFSET member. + (update_eliminable_offsets): Don't compute it. + (set_initial_elim_offsets): Don't initialize it. + Break out some code into set_initial_label_offsets so the rest of + this function can be called from reload_as_needed. + Assume that INITIAL_FRAME_POINTER_OFFSET is defined when + ELIMINABLE_REGS isn't. + (set_initial_label_offsets): New function, broken out of + set_initial_elim_offsets. + (set_offsets_for_label): New function, broken out of set_label_offsets + and reload_as_needed. + (reload): Call the two new functions. + (reload_as_needed): Call set_initial_elim_offsets instead of + duplicating the code. Likewise for set_offsets_for_label. + + * reload1.c (choose_reload_regs): Fix typo in Oct 17 change. + (emit_reload_insns): Ensure that when we set reg_reloaded_valid for + any hard reg, reg_reloaded_dead contains valid data. + +Thu Oct 29 22:30:54 1998 Marcus Meissner + + * i386.c (i386_comp_type_attributes): Return nonzero for mismatched + "stdcall" and "cdecl" attributes. + +Thu Oct 29 19:05:17 1998 Jim Wilson + + * sched.c (update_flow_info): Add code to ! found_orig_dest case to + handle deleted no-op moves of hard registers. + * haifa-sched.c (update_flow_info): Likewise. + +Thu Oct 29 18:07:47 1998 Jeffrey A Law (law@cygnus.com) + + * mips.md (reload_{in,out}{si,di}): Emit a USE of HILO at the end + of the sequences to reload the HILO register which do not actually + reference HILO. + +Thu Oct 29 12:39:35 1998 Jim Wilson + + * c-common.c (c_get_alias_set): Handle ARRAY_REF of union field. + +Thu Oct 29 14:10:22 1998 Andrew MacLeod + + * except.c (emit_eh_context): Make the EH context register stay alive + at -O0 so stupid.c doesn't get confused. + +1998-10-29 Herman A.J. ten Brugge + + * emit-rtl.c (try_split): Do not try to split a BARRIER. + +Thu Oct 29 01:33:54 1998 Jan Hubicka + Jeffrey A Law (law@cygnus.com) + + * i386.md: Change ix86_cpu == PROCESSOR_PENTIUM to TARGET_PENTIUM. + (zero_extendsidi2): Use # in output template and handle completely by + splits. + (zero_extend splitters): New define_splits. + (ashiftrt_32): New pattern. + +Wed Oct 28 22:58:35 1998 Jason Merrill + + * tree.c (append_random_chars): New fn. + (get_file_function_name_long): Use it. + +Wed Oct 28 22:27:05 1998 Richard Henderson + + * Makefile.in (cc1): Put C_OBJS, and thence @extra_c_objs@ last. + (LIBCPP_OBJS): New. Add cppulp.o. + (cppmain, fix-header): Depend on and use libcpp.a. + * configure.in (extra_c_objs, extra_cxx_objs): Use libcpp.a instead + of the individual object files. + * objc/Make-lang.in (cc1obj): Put OBJC_OBJS, and thence @extra_c_objs@, + last. + + * cccp.c (user_label_prefix): New. + (main): Set it off -f*leading-underscore. + (special_symbol): Use it. + * cpplib.c (special_symbol): Likewise. + (cpp_handle_option): Handle -f*leading-underscore. + * cppulp.c: New file. + + * output.h (user_label_prefix): Declare it. + * dwarf2out.c (ASM_NAME_TO_STRING): Prepend user_label_prefix. + * toplev.c (f_options, main): Handle -f*leading-underscore. + + * defaults.h (ASM_OUTPUT_LABELREF): Use asm_fprintf instead of + referencing USER_LABEL_PREFIX directly. + * config/nextstep.h (ASM_OUTPUT_LABELREF): Likewise. + * m32r/m32r.h (ASM_OUTPUT_LABELREF): Likewise. + * final.c (asm_fprintf): Use user_label_prefix instead. + * arm/thumb.c (thumb_print_operand): Likewise. + + * gcc.c (default_compilers): Pass -f*leading-underscore on to + cpp wherever appropriate. + +Wed Oct 28 23:09:25 1998 Robert Lipe + + * sco5.h (SUBTARGET_SWITCHES): Add documentation for OpenServer- + specific compiler switches. + +Wed Oct 28 21:05:53 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (c-common.o): Depend on c-pragma.h. Use $(RTL_H) instead + of rtl.h. + +Wed Oct 28 20:52:47 1998 Kaveh R. Ghazi + + * gcc.c (EXTRA_SPECS, extra_specs): Introduce an intermediate + structure which has exactly the members provided by EXTRA_SPECS. + Xmalloc() the real `extra_specs', and initialize it from this + intermediate structure. + + * alpha.h (EXTRA_SPECS): Revert change for missing initializers. + + * mips.h (EXTRA_SPECS): Likewise. + + * sparc.h (EXTRA_SPECS): Likewise. + +Wed Oct 28 16:46:07 1998 Andreas Schwab + + * function.c (purge_addressof_1): Instead of aborting when a + bitfield insertion as a replacement for (MEM (ADDRESSOF)) does not + work just put the ADDRESSOF on stack. Otherwise remember all such + successful replacements, so that exactly the same replacements + can be made on the REG_NOTEs. Remove the special case for CALL + insns again. + (purge_addressof_replacements): New variable. + (purge_addressof): Clear it at end. + +1998-10-28 Zack Weinberg + + * c-lang.c: Declare extern char *yy_cur if USE_CPPLIB. + (lang_init): Call check_newline always. + * c-lex.c (init_parse) [USE_CPPLIB=1]: After calling + cpp_start_read, set yy_cur and yy_lim to read from + parse_in.token_buffer, so that we'll see the first #line + directive. + * cpplib.c (cpp_start_read): finclude the main input file + before processing -include/-imacros. Process -imacros and + -include separately, and handle -include by stacking a + buffer for the file in question as if it'd been #included. + * toplev.c (documented_lang_options): Recognize -H when + USE_CPPLIB is on. + +1998-10-28 Zack Weinberg + + * cpplib.c: Merge do_once into do_pragma. Break file handling + code out of do_include. + Move append_include_chain, deps_output, + file_cleanup, redundant_include_p, import_hash, + lookup_import, add_import, read_filename_string, read_name_map, + open_include_file, finclude, safe_read to cppfiles.c. + Move prototypes for deps_output, append_include_chain, + finclude to cpplib.h. Move definition of struct + file_name_list there also. + + * cppfiles.c: New file. Contains all the above functions + broken out of cpplib.c; also hack_vms_include_specification + from cccp.c and find_include_file, a new function broken out of + do_include. + + * Makefile.in (cppmain): Depend on cppfiles.o. + (fix-header): Likewise. + (cppfiles.o): New target. + * configure.in (--enable-c-cpplib): Add cppfiles.o to + extra_c_objs. Add ../cppfiles.o to extra_cxx_objs. + +Wed Oct 28 14:06:49 1998 Jim Wilson + + * dwarfout.c (dwarfout_file_scope_decl): If DECL_CONTEXT, don't abort + if pending_types is nonzero. + (dwarfout_finish): Verify pending_types is zero before finishing. + +Wed Oct 28 10:29:09 1998 Nick Clifton + + * expr.c (convert_move): Use shifts to perform the move if a + suitable extend pattern cannot be found. Code written by + Richard Henderson . + +Wed Oct 28 03:59:29 1998 Bernd Schmidt + + * regclass.c (renumber, regno_allocated): New static variables, moved + out of allocate_reg_info. + (allocate_reg_info): Move these two variables outside the function. + Move code to free memory into new function free_reg_info. + (free_reg_info): New function, broken out of allocate_reg_info. + * toplev.c (compile_file): Call free_reg_info, not allocate_reg_info. + * rtl.h (allocate_reg_info): Don't declare. + (free_reg_info): Declare. + + * final.c (cleanup_subreg_operands): ASM_INPUTs need no treatment. + +Wed Oct 28 02:38:12 1998 Jason Merrill + + * toplev.c (compile_file): Temporarily revert last change. + +Wed Oct 28 00:00:35 1998 Jason Merrill + + * c-typeck.c (convert_for_assignment): Parenthesize. + +1998-10-28 Andreas Schwab + + * reload1.c (delete_output_reload): Avoid ambigous else. + +Wed Oct 28 00:10:35 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (compile_file): Call allocate_reg_info to free register + table memory. + * rtl.h (allocate_reg_info): Declare. + + * PROJECTS: Remove entry for local spilling. + + * final.c (cleanup_subreg_operands): New function. + (final_scan_insn): Use it. + (alter_subreg): Clear the "used" field when we turn a SUBREG into + a REG. + * reload1.c (reload): Delete CLOBBER insns and also cleanup SUBREG + operands when reload has finished. + * reload.h (cleanup_subreg_operands): Declare.. + * flow.c (life_analysis_1): No longer delete CLOBBER insns after + reload. Handled in reload itself. + +Tue Oct 27 23:32:34 1998 Bernd Schmidt + + * reload1.c (verify_initial_offsets): New function. + (reload): Call it after reload_as_needed. Also verify that the frame + size stays constant during reload_as_needed. + * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Undo Jul 26 change. + + * reload.h (struct insn_chain): Add need_operand_change element. + * reload1.c (new_insn_chain): Clear it. + (calculate_needs_all_insns): Set it; don't overload need_reload. + (reload_as_needed): Use it. + + * reload.c (find_reloads_address): Use BASE_REG_CLASS instead of + reload_address_base_reg_class throughout. Similar for INDEX_REG_CLASS + and reload_address_index_reg_class. + (find_reloads_address_1): Likewise. + * reload.h (reload_address_base_reg_class, + reload_address_index_reg_class): Don't declare. + * reload1.c (reg_old_renumber, pseudo_previous_regs, + pseudo_forbidden_regs, bad_spill_regs_global): New static variables. + (used_spill_regs): Now static. + (reload_address_base_reg_class, reload_address_index_reg_class, + regs_explicitly_used, counted_for_groups, counted_for_nongroups, + basic_block_needs, max_needs, group_size, group_mode, max_groups, + max_nongroups, max_needs_insn, max_groups_insn, max_nongroups_insn, + forbidden_regs): + Deleted variables. + (init_reload): Delete code to compute base/index reg classes. + (reload): Delete variable J. + Delete code to manage basic_block_needs. + Don't compute regs_explicitly_used. + Allocate, initialize and free reg_old_renumber, pseudo_forbidden_regs, + pseudo_previous_regs. + Initialize bad_spill_regs_global. + Don't call order_regs_for_reload here. + Don't initialize spill_reg_order and n_spills. + Don't forbid explicitly used regs to be used for spill regs. + Change main loop to infinite loop, with explicit break statements. + Make SOMETHING_CHANGED variable local to that loop. + Don't initialize max_needs, max_groups, max_nongroups, max_needs_insn, + max_groups_insn, max_nongroups_insn, group_size, group_mode. + Make sure spilled_pseudos is cleared before calling spill_hard_reg or + new_spill_reg. + Don't call dump_needs. + Delete code to reset potential_reload_regs. + Delete code to terminate loop conditional on the global needs variables + showing no further needs. + (calculate_needs_all_insns): Return void. All callers changed. + Initialize something_needs_elimination here, not in reload. + Delete avoid_return_reg kludge. + (calculate_needs): Lose AVOID_RETURN_REG and GLOBAL args, return void. + All callers changed. + Initialize the group_mode and group_size elements of the arg CHAIN. + Delete code to manage basic_block_needs. + Operate on elements of CHAIN instead of global variables. + Delete avoid_return_reg kludge. + (find_tworeg_group): Lose GLOBAL arg, take CHAIN arg, return void. + All callers changed. + Operate on elements of CHAIN instead of global variables. + Delete special SMALL_REGISTER_CLASSES code. + Delete spill_failure code; now in new_spill_reg. + (find_group): Lose GLOBAL arg, take CHAIN arg, return void. + All callers changed. + Operate on elements of CHAIN instead of global variables. + (maybe_mark_pseudo_spilled): New static function. + (find_reload_regs): Lose GLOBAL arg, take CHAIN arg, return void. + All callers changed. + Operate on elements of CHAIN instead of global variables. + Call order_regs_for_reload here, not in reload. + Initialize spill_reg_order and n_spills. + Simplify test whether an asm insn is involved. + Delete spill_failure code; now in new_spill_reg. + Call maybe_mark_pseudo_spilled for everything marked as live in + CHAIN. Merge CHAIN's used_spill_regs into the global variable + used_spill_regs. + (dump_needs): Take CHAIN arg. No longer static, to prevent the + compiler from optimizing this function (now unused) away. + Operate on elements of CHAIN instead of global variables. + (possible_group_p): Lose MAX_GROUPS arg, take CHAIN arg. All callers + changed. + Operate on elements of CHAIN instead of global variables. + (count_possible_groups): Lose GROUP_SIZE, GROUP_MODE, MAX_GROUPS args, + take CHAIN arg. All callers changed. + Operate on elements of CHAIN instead of global variables. + (new_spill_reg): Lose MAX_NEEDS, MAX_NONGROUPS, GLOBAL args, take + CHAIN, NONGROUP args. Return void. All callers changed. + Verify caller isn't trying to spill a pseudo. + Simplify test for illegal reg, just use bad_spill_regs. + Generate better error messages. + Operate on elements of CHAIN instead of global variables. + Mark spilled register in CHAIN's used_spill_regs element. + Don't call spill_hard_reg. + (spill_hard_reg): Lose GLOBAL arg, return void. All callers changed. + Mark spilled hard regs in bad_spill_regs_global. + Mark affected pseudos in spilled_pseudos, but don't spill them. + (ior_hard_reg_set): New static function. + (finish_spills): Return int. All callers changed. + Compute spill_reg_order, n_spills and spill_regs here. Also update + regs_ever_live for regs used as spills. + For every pseudo in spilled_pseudos, spill it and mark the previous + hard reg it had in pseudo_previous_regs. Compute which hard regs + are used as spills in insns during which it is live, and retry global + register allocation. Update all life information in the + reload_insn_chain not to include pseudos without hard regs. + Call alter_reg for all affected speudos. + + (scan_paradoxical_subregs): Disable SMALL_REGISTER_CLASSES special + case, it's not clear what it's supposed to do. + + (hard_reg_use_compare): Take bad_spill_regs into account. + (pseudos_counted): New static variable. + (count_pseudo): New static function. + (order_regs_for_reload): Take CHAIN arg. All callers changed. + Initialize bad_spill_regs from bad_spill_regs_global, then merge any + hard registers explicitly used across the current insn into the set. + Compute hard_reg_n_uses taking only pseudos live across this insn + into account. + Tweak sorting of potential_reload_regs. + (compare_spill_regs): Delete function. + (reload_as_needed): Don't sort the spill_regs array, it's computed + in proper order in finish_spills. + Delete avoid_return_reg kludge. + Delete code to manage basic_block_needs. + (allocate_reload_reg): Minor speed/readability tweaks. + Operate on elements of CHAIN instead of global variables. + (choose_reload_regs): Lose AVOID_RETURN_REG arg. All callers changed. + Delete avoid_return_reg kludge. + Initialize reload_reg_used from CHAIN's used_spill_regs element. + Delete unused label FAIL. + (reload_combine): Replace reload_address_index_reg_class with + INDEX_REGS. + Don't use used_spill_regs to determine information about lifetime of + hard regs. + +Tue Oct 27 13:15:02 1998 Nick Clifton + + * toplev.c (display_help): Ignore empty target specific + options, and if -W is also specified on the command line then + display undocumented options. + + * config/arm/arm.c: Updated with changes in devo sources. + * config/arm/arm.h: Updated with changes in devo sources. + * config/arm/lib1funcs.asm: Updated with changes in devo sources. + * config/arm/lib1thumb.asm: Add ELF support. + +Tue Oct 27 16:11:43 1998 David Edelsohn + + * collect2.c (aix64_flag): New variable. + (main, case 'b'): Parse it. + (GCC_CHECK_HDR): Object magic number must match mode. + (scan_prog_file): Only check for shared object if valid header. + Print debugging if header/mode mismatch. + +Tue Oct 27 10:15:02 1998 Nick Clifton + + Added support for arm-elf-linux configuration, submitted by Philip + Blundell , and integrated this with the arm-elf + code developed by Catherine Moore . The following + files are affected: + + * configure.in: Add arm-*-linux-gnu, armv2-*-linux and arm-*-elf + targets. + + * configure: Regenerated. + + * config/arm/aout.h: Add default definitions of REGISTER_PREFIX, + USER_LABEL_PREFIX and LOCAL_LABEL_PREFIX. Make other macro + definitions conditional on their not having been already defined. + + * config/arm/lin1funcs.asm: Add ELF only macros to generate .size + and .type directives, and add "(PLT)" qualification to function + calls. + + * config/arm/linux.h: Deleted. This file is now superseded by + either linux-elf.h or linux-aout.h. + + * config/arm/linux-gas.h: Define `inhibit_libc' if cross-compiling. + (CLEAR_INSN_CACHE): New macro, currently disabled (awaiting kernel + support). + Move definitions from old linux.h file here. + + * config/arm/elf.h: New file. Generic ARM/ELF support. + + * config/arm/linux-aout.h: New file. Support for Linux with a.out. + + * config/arm/linux-elf.h: New file. Support for Linux with ELF. + + * config/arm/linux-elf26.h: New file. Support for Linux with ELF + using the 26bit APCS. + + * config/arm/unknown-elf.h: New file. Support for OS'es other + than Linux with ELF. + + * config/arm/t-arm-elf: New file. makefile fragment for arm-elf + builds. + + * config/arm/coff.h: Include aout.h for basic assembler macros. + Add support for -mstructure_size_boundary= command line option. + + * config/arm/arm.h: Add support for -mstructure_size_boundary= + command line option. Make macro definitions conditional on their + not having been already defined. + + * config/arm/arm.c: Add support for -mstructure_size_boundary= + command line option. + + +Tue Oct 27 08:56:46 1998 Andrew MacLeod + + * dwarfout.c (ASM_OUTPUT_DWARF_STRING_NEWLINE): ASM_OUTPUT_DWARF_STRING + has been changed to not include a newline. Use this macro instead. + (output_enumeral_list, const_value_attribute, name_attribute, + comp_dir_attribute, prototyped_attribute, producer_attribute, + inline_attribute, pure_or_virtual_attribute, output_inheritance_die, + dwarfout_file_scope_decl, generate_new_sfname_entry, + generate_macinfo_entry, dwarfout_init, dwarfout_finish): Use + ASM_OUTPUT_DWARF_STRING_NEWLINE macro. + +Mon Oct 26 13:35:02 1998 Richard Henderson + + * combine.c (subst): Process the inputs to a parallel asm_operands + only once. + +Mon Oct 26 13:32:31 1998 Richard Henderson + + * stmt.c (expand_asm_operands): Accept `=' or `+' at any position. + +Mon Oct 26 12:53:14 1998 Jeffrey A Law (law@cygnus.com) + + * tm.texi (ASM_OUTPUT_MAX_SKIP_ALIGN): Document. + +Mon Oct 26 00:36:58 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Oct 25 23:36:52 1998 Jason Merrill + + * stmt.c (expand_fixup): Set fixup->before_jump to a + NOTE_INSN_DELETED instead of a NOTE_INSN_BLOCK_BEG. + +Sun Oct 25 15:49:57 1998 Kaveh R. Ghazi + + * Makefile.in (recog.o): Depend on toplev.h. + (insn-emit.o): Depend on recog.h. + (insn-peep.o): Depend on recog.h and insn-config.h. + + * combine.c (simplify_set): Remove unused variable `scratches'. + + * final.c (final_scan_insn): Wrap declaration of variables `vlen' + and `idx' in macro conditional controlling their use. + + * genemit.c (main): Make the generated output file include + recog.h. Don't have it declare `insn_operand_constraint', since + we get it from recog.h. + + * genpeep.c (main): Make the generated output file include + insn-config.h and recog.h. + + * recog.c: Include toplev.h. + (extract_insn): Remove unused variable `p'. + + * regclass.c (fix_register): Add missing braces around initializer + for `what_option'. + (allocate_reg_info): Move variable `i' into the scope where it is + used. Change its type to `size_t'. + +Sun Oct 25 13:10:15 1998 Bernd Schmidt + + * reload.c (push_reload): When merging reloads, make sure + that reload_in_reg and reload_in are from the same reload in + all cases. + +Sun Oct 25 12:07:00 1998 Mumit Khan + + * i386/crtdll.h (CPP_PREDEFINES): Fix typo. + * i386/mingw32.h (CPP_PREDEFINES): Likewise. + +Fri Oct 23 23:42:03 1998 David Edelsohn + + * loop.c (loop_has_tablejump): New variable. + (prescan_loop): Scan for it. + (insert_bct): Replace explicit scan with use of it. + * regclass.c (regclass): Restore loop variable j. + (record_reg_classes): Deterine op_types modifiers and initialize + classes[i] before matching constraints. Handle matching + constraints 5-9. + +Fri Oct 23 13:55:48 1998 Jim Wilson + + * m32r/m32r.c (gen_split_move_double): Call alter_subreg. Delete + subreg support. + +Fri Oct 23 16:19:24 1998 Kaveh R. Ghazi + + * mips.h (EXTRA_SPECS): Add missing initializers. + +Fri Oct 23 16:08:39 1998 Kaveh R. Ghazi + + * sparc.h (EXTRA_SPECS): Add missing initializers. + (sparc_defer_case_vector): Provide a prototype. + + * svr4.h (ASM_OUTPUT_ASCII): Cast STRING_LIMIT to (long) when + comparing it to the result of a pointer subtraction. + +Fri Oct 23 15:34:14 1998 Kaveh R. Ghazi + + * alpha.c (override_options): Use ISDIGIT(), not isdigit(). Cast + the argument to (unsigned char). + + * alpha.h (EXTRA_SPECS): Add missing initializers. + (ASM_GENERATE_INTERNAL_LABEL): Ensure the argument matches the + format specifier. + +Fri Oct 23 13:12:35 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (life_analysis_1): Enable "rescan" code after reload. + (propagate_block): Delete dead code after reload. + + * sched.c (update_flow_info): Revert Oct 19, 1998 change. Brings + back Oct 15, 1998 change. + * haifa-sched.c (update_flow_info): Likewise. + * flow.c (life_analysis_1): Delete CLOBBER insns after reload. + + * mn10200.md (truncated shift): Accept constant inputs too. + +Fri Oct 23 04:06:57 1998 Richard Earnshaw (rearnsha@arm.com) + + * machmode.h (mode_mask_array): No longer const. + * rtl.c (init_rtl): Fully initialize it if EXTRA_CC_MODES defined. + +Fri Oct 23 11:19:06 1998 Martin v. Löwis + + * frame.c: Somewhat explain `FDE'. + Suggested by Brendan Kehoe + +Fri Oct 23 00:56:11 1998 Jason Merrill + + * expr.c (pending_chain): Move up. + (save_expr_status): Do save pending_chain. + (restore_expr_status): And restore it. + * function.h (struct function): Add pending_chain. + +1998-10-23 Herman A.J. ten Brugge + + * reorg.c (relax_delay_slots): Fixed test for mostly_true_jump. The + did not match the code. + +Fri Oct 23 00:07:01 1998 Bernd Schmidt + + * regclass.c (regclass): Break out some code into new function + scan_one_insn, and into regclass_init. + (init_cost): New static variable, moved out of regclass. + (regclass_init): Initialize it here, not in . + (scan_one_insn): New static function, broken out of regclass. + * recog.c (apply_change_group): Break out some code into new + function insn_invalid_p. + (insn_invalid_p): New static fn, broken out of apply_change_group. + +Thu Oct 22 22:34:42 1998 Jim Wilson + + * reload1.c (reload_as_needed): When rewrite POST_INC, verify + reg_reloaded_contents matches incremented pseudo. + + * v850/v850.c (v850_reorg): Call alter_subreg. Delete subreg support. + +Fri Oct 23 11:11:56 1998 Michael Hayes + + * rtl.def (POST_MODIFY, PRE_MODIFY): New generalized operators for + addressing modes with side effects. These are currently + placeholders for the C4x target. + +Thu Oct 22 16:46:35 1998 Bernd Schmidt + + * loop.c (express_from): Make sure that when generating a PLUS of + a PLUS, any constant expression appears on the outermost PLUS. + +Thu Oct 22 15:46:23 1998 Per Bothner (bothner@cygnus.com) + + * Makefile.in (distdir-cvs, distdir-start): Clean up so it + works if "$(srcdir)" != ".". + +Wed Oct 21 19:23:59 1998 Jim Wilson + + * expmed.c (store_bit_field): If need to add a SUBREG, then remove + existing SUBREG if we can, otherwise abort. + +Wed Oct 21 09:58:51 1998 Mark Mitchell + + * c-common.c (c_apply_type_quals_to_decl): Don't crash when + `restrict' is applied to a non-pointer variable. + +Wed Oct 21 09:18:58 1998 Mark Mitchell + + * invoke.texi: Document -flang-isoc9x. + + * Makefile.in (OBJS): Add splay-tree.o. + (c-common.o): Depend on rtl.h. + (splay-tree.o): List dependencies and provide build rule. + + * rtl.h (record_alias_subset): New function. + * alias.c: Include splay-tree.h. + (alias_set_entry): New type. + (CHECK_ALIAS_SETS_FOR_CONSISTENCY): Remove. + (DIFFERENT_ALIAS_SETS_P): Use mem_in_disjoint_alias_sets_p. + (mems_in_disjoin_alias_sets_p): New function. + (alias_set_compare): Likewise. + (insert_subset_children): Likewise. + (get_alias_set_entry): Likewise. + + * tree.h (TYPE_RESTRICT): New macro. + (TYPE_UNQUALIFIED): New manifest constant. + (TYPE_QUAL_CONST): Likewise. + (TYPE_QUAL_VOLATILE): Likewise. + (TYPE_QUAL_RESTRICT): Likewise. + (tree_type): Add restrict_flag. Reduce count of free bits. + (DECL_POINTER_ALIAS_SET): New macro. + (DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise. + (tree_decl): Add pointer_alias_set. + (build_qualified_type): New function. + (build_type_variant): Define in terms of build_qualified_type. + * tree.c (set_type_quals): New function. + (make_node): Initialize DECL_POINTER_ALIAS_SET. + (build_type_attribute_variant): Use build_qualified_type and + set_type_quals. + (build_type_variant): Rename, and modify, to become... + (build_qualified_type): New function. + (build_complex_type): Use set_type_quals. + + * c-tree.h (C_TYPE_OBJECT_P): New macro. + (C_TYPE_FUNCTION_P): Likewise. + (C_TYPE_INCOMPLETE_P): Likewise. + (C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise. + (c_apply_type_quals_to_decl): New function. + (c_build_qualified_type): New function. + (c_build_type_variant): Define in terms of c_build_qualified_type. + (flag_isoc9x): Declare. + * c-typeck.c (qualify_type): Use c_build_qualified_type. + (common_type): Change to use TYPE_QUALS. + (comptypes): Likewise. + (convert_for_assignment): Likewise. + * c-aux-info.c (gen_type): Likewise. Deal with `restrict'. + * c-decl.c (flag_isoc9x): Define. + (c_decode_option): Handle -flang-isoc9x. + (grokdeclarator): Update to handle restrict. Use TYPE_QUALS, + c_build_qualified_type, etc. Use c_apply_type_quals_to_decl. + * c-lex.c (init_lex): Deal with restrict. + (init_lex): Don't treat restrict as a reserved word in + -traditional mode, or without -flang-isoc9x. + * c-lex.h (rid): Add RID_RESTRICT. + * c-parse.gperf (restrict, __restrict, __restrict__): Make + equivalent to RID_RESTRICT. + * c-parse.in (TYPE_QUAL): Update comment. + * c-common.c: Include rtl.h. + (c_find_base_decl): New function. + (c_build_type_variant): Rename, and modify, to become ... + (c_build_qualified_type): New function. + (c_apply_type_quals_to_decl): Likewise. + (c_get_alias_set): For INDIRECT_REFs, check to see if we can find + a particular alias set for the reference. + * toplev.c (documented_lang_options): Add -flang-isoc9x. + +Wed Oct 21 09:15:06 1998 Nick Clifton + + * config/arm/arm.h (TARGET_SWITCHES): Document arm specific + command line switches. + +Tue Oct 20 10:04:51 1998 Graham + + * reload.c (loc_mentioned_in_p): Add missing braces to bind + else to correct if. + +Mon Oct 19 16:34:05 1998 Tom Tromey + + * gcc.c (option_map): Added --classpath and --CLASSPATH. + +Tue Oct 20 10:59:02 1998 Gavin Romig-Koch + + * regclass.c (fix_register): Add error message. + * invoke.texi (-fcall-used-REG,-fcall-saved-REG): Note the + new error message. + +Tue Oct 20 10:12:17 1998 Kaveh R. Ghazi + + * c-decl.c (warn_missing_noreturn): New global variable. + (c_decode_option): Check for new flags -W{no-}missing-noreturn. + (finish_function): Implement missing noreturn warning. + + * c-tree.h (warn_missing_noreturn): Declare extern. + + * invoke.texi: Document new flags. + + * toplev.c (documented_lang_options): Add description. + +Tue Oct 20 22:16:11 1998 Michael Hayes + + * config/c4x/c4x.c (c4x_parallel_process): Disable until BCT + loop optimization stable for the C4x. + (c4x_rptb_info_t, c4x_dump, c4x_rptb_in_range, c4x_rptb_unjumped_loop, + c4x_rptb_find_comp_and_jump, c4x_rptb_loop_info_get, + c4x_rptb_emit_init, c4x_rptb_process): Deleted (superseded by BCT + loop optimization). + (c4x_address_conflict): Be more paranoid when packing a volatile + memref in a parallel load/store. + +Tue Oct 20 21:56:05 1998 Michael Hayes + + * config/c4x/c4x.md (repeat_block_top, repeat_block_end, + repeat_block_filler): Deleted. + (*ashlqi3_set, *ashrqi3_const_set, *ashrqi3_nonconst_clobber): + Condition code not set if destination register from 'c' class. + (*subbqi3_carry_clobber): Fix typo. + +1998-10-18 Herman A.J. ten Brugge + + * reorg.c (steal_delay_list_from_target): Check for insns that + modify the condition codes and effect the direction of the jump + in the sequence. + +Sat Oct 17 13:09:09 1998 Graham + + * function.c (purge_addressof_1): Replace call to + emit_insns_before() with emit_insn_before(). + +Mon Oct 19 19:34:03 1998 Mike Stump + + * libgcc2.c (__pure_virtual): Call __terminate instead of _exit. + +Mon Oct 19 13:26:24 1998 Bernd Schmidt + + * jump.c (sets_cc0_p): Compile only if HAVE_cc0. + +Mon Oct 19 11:40:56 1998 Jeffrey A Law (law@cygnus.com) + + * gcse.c (compute_hash_table): Correctly identify hard regs which are + clobbered across calls. + + * loop.c (scan_loop): Be more selective about what invariants are + moved out of a loop. + +Mon Oct 19 10:46:58 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Oct 19 11:40:56 1998 Jeffrey A Law (law@cygnus.com) + + * libgcc2.c (eh_context_static): Do not call malloc to allocate the + static eh_context structure. + +Mon Oct 19 10:45:40 1998 Bernd Schmidt + + * combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg. All + callers changed. + (try_combine): Don't update max_scratch. + * flow.c (max_scratch, num_scratch): Delete variables. + (life_analysis_1): Don't initialize max_scratch. + (propagate_block): Don't update max_scratch. + (mark_set_1): Don't increment num_scratch. + * regs.h (max_scratch): Delete declaration. + +Mon Oct 19 10:28:15 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_reg_free_before_p): Hack. Return 0 if EQUIV + is nonzero. This is temporary! + + * sched.c (update_flow_info): Handle death notes made invalid by + instruction splitting. Partially reverts Oct 15, 1998 patch. + * haifa-sched.c (update_flow_info): Likewise. + +Sun Oct 18 17:31:26 1998 Jeffrey A Law (law@cygnus.com) + + * function.c (uninitialized_vars_warning): Do not warn for a VAR_DECL + if it has a nonzero DECL_INITIAL. + +Sat Oct 17 23:18:08 1998 Kaveh R. Ghazi + + * Makefile.in (flow.o): Depend on recog.h. + + * cpplib.h (directive_table): Add missing initializiers. + (finclude): Change type of variable `bsize' to size_t. + + * cse.c (rtx_cost): Mark parameter `outer_code' with ATTRIBUTE_UNUSED. + + * dwarfout.h (dwarfout_label): Wrap prototype in macro RTX_CODE. + + * fix-header.c (lookup_std_proto): Cast the result of `strlen' to + `int' when comparing against one. + (cpp_file_line_for_message): Mark parameter `pfile' with + ATTRIBUTE_UNUSED. + (cpp_fatal): Mark parameter `pfile' with ATTRIBUTE_UNUSED. + + * flow.c: Include recog.h. + (sbitmap_copy): Cast arguments 1 & 2 of `bcopy' to (PTR). + + * function.c (thread_prologue_and_epilogue_insns): Mark parameter + `f' with ATTRIBUTE_UNUSED. + (reposition_prologue_and_epilogue_notes): Likewise. + + * genopinit.c (gen_insn): Cast argument of ctype functions to + `unsigned char'. + + * haifa-sched.c: Include recog.h. + (blockage_range): Cast result of UNIT_BLOCKED macro to (int) when + comparing against one. + + * libgcc2.a (__throw): Revert ATTRIBUTE_UNUSED change for now. + + * mips-tfile.c (parse_end): Cast the argument of ctype function to + `unsigned char'. + (parse_ent): Likewise. + (parse_input): Likewise. + + * optabs.c (init_libfuncs): Likewise. + + * protoize.c (find_rightmost_formals_list): Likewise. + + * recog.h (const_double_operand): Fix typo in prototype. + + * tlink.c (scan_linker_output): Cast the argument of ctype + function to `unsigned char'. + + * toplev.c (check_lang_option): Cast the result of `strlen' to + `int' when comparing against one. + +Sat Oct 17 13:09:09 1998 Graham + + * gcse.c (dump_cuid_table): Correct typo. + +Sat Oct 17 11:02:47 1998 Nick Clifton + + * toplev.c (display_help): Prepend '-m' to target specific + options. + (check_lang_option): Ignore text after end of first word of a + language specific option. + +Sat Oct 17 02:26:03 1998 Bernd Schmidt + + * reload1.c (reg_used_by_pseudo): New static variable. + (choose_reload_regs): Initialize it. + Use it instead of testing spill_reg_order to determine whether a + pseudo is live in a hard register across the current insn. + Fix a typo in a reference to reload_reg_rtx. + + * flow.c (propagate_block): Replace code that computes and uses + regs_sometimes_live with simpler code that just walks the set of + currently live registers. + + * Makefile.in (insn-extract.o): Fix dependencies. + * genextract.c (main): Generate includes for insn-config.h and + recog.h. + Delete generation of declarations which are now in recog.h. + * genrecog.c (main): Delete generation of definitions which are + now in recog.c. + * local-alloc.c (block_alloc): Use extract_insn and the variables + it sets up instead of looking up values by insn_code. + * recog.c (recog_operand, recog_operand_loc, recog_dup_loc, + recog_dup_num): Define here instead of generating the definition in + genrecog.c. + (recog_n_operands, recog_n_dups, recog_n_alternatives, + recog_operand_mode, recog_constraints, recog_operand_address_p): + New variables. + (extract_insn): New function. + * recog.h (extract_insn): Declare function. + (which_alternative, recog_n_operands, recog_n_dups, + recog_n_alternatives, recog_operand_mode, recog_constraints, + recog_operand_address_p): Declare variables. + * regclass.c (n_occurrences): New static function. + * reload.c (n_occurrences): Delete function. + (find_reloads): Use extract_insn. + * reload.h (n_occurrences): Delete declaration. + +Sat Oct 17 01:17:51 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_as_needed): Fix test for when to call + update_eliminable_offsets. + +Fri Oct 16 20:40:50 1998 J"orn Rennecke + + Fix consistency problems with reg_equiv_{mem,address}; + Improve reload inheritance; + + * reload.c (reload_out_reg): New variable. + (loc_mentioned_in_p, remove_address_replacements): New functions. + (remove_replacements): Deleted. + (push_reload): Set reload_out_reg[i]. + When merging, also set reload_{in,out}_reg[i], and remove + duplicate address reloads. + (combine_reloads): Copy reload_out_reg[i]. + (find_reloads): Do make_memloc substitution also when + reg_equiv_memory_loc[regno] and num_not_at_initial_offset + are both nonzero. + Include *recog_operand_loc in commutativity operand changes. + Generate optional output reloads. + Delete reference to n_memlocs. Don't set *recog_operand_loc before + processing operands. Call make_memloc in reg_equiv_address code. + Set *recog_operand_loc only after processing operands, and only + if replace is true. Return a value. + When changing address reload types for operands that didn't get + reloaded, use RELOAD_FOR_OPADDR_ADDRESS for + RELOAD_FOR_INPADDR_ADDRESS / RELOAD_FOR_OUTADDR_ADDRESS reloads. + Don't emit USEs for pseudo SUBREGs when not replacing. + (find_reloads_address): Do make_memloc substitution also when + reg_equiv_memory_loc[regno] and num_not_at_initial_offset + are both nonzero. + (find_reloads_toplev): Likewise. + Call make_memloc in reg_equiv_address code. + (debug_reload_to_stream): Add code to output reload_out_reg. + (make_memloc): Delete local variable i, ifdefed out code, and + references to memlocs and n_memlocs. + (memlocs, n_memlocs): Delete. + (push_secondary_reload): Clear reload_out_reg. + (find_reloads_address_1): Provide memrefloc argument to all calls + to find_reloads_address. + In AUTO_INC code, handle non-directly addressable equivalences properly. + * reload.h (reload_out_reg, num_not_at_initial_offset): Declare. + (find_reloads): Add return type. + (remove_address_replacements, deallocate_reload_reg): Declare. + * reload1.c (num_not_at_initial_offset): No longer static. + (delete_address_reloads, delete_address_reloads_1): Likewise. + (deallocate_reload_reg): New function. + (spill_reg_stored_to): New array. + (eliminate_regs): Don't substitute from reg_equiv_memory_loc. + (eliminate_regs_in_insn): Move assignments of previous_offset and + max_offset fields, and recalculation of num_not_at_initial_offset + into new static function: + (update_eliminable_offsets) . + (reload_as_needed): Call update_eliminable_offsets after calling + find_reloads. + Call forget_old_reloads_1 with contents of reloaded auto_inc + expressions if the actual addressing can't be changed to match the + auto_inc. + (choose_reload_regs): For inheritance, replace + reload_reg_free_before_p test with reload_reg_used_at_all test, and + remove stand-alone reload_reg_used_at_all test. + Use reload_out_reg to determine which reload regs have output reloads. + Treat reload_override_in more similar to inherited reloads. + Handle (subreg (reg... for inheritance. + For flag_expensive_optimizations, add an extra pass to remove + unnecessary reloads from known working inheritance. + Delete obsolete code for pseudos replaced with MEMs. + Handle inheritance from auto_inc expressions. + (emit_reload_insns): If reload_in is a MEM, set OLD to + reload_in_reg[j]. + Don't reload directly from oldequiv; if it's a pseudo with a + stack slot, use reload_in[j]. + Check that reload_in_reg[j] is a MEM before replacing reload_in + from reg_reloaded_contents. + Include non-spill registers in reload inheritance processing. + Also try to use reload_out_reg to set spill_reg_store / + reg_last_reload_reg. + In code to set new_spill_reg_store, use single_set to find out if + there is a single set. + Add code that allows to delete optional output reloads. + Add code to allow deletion of output reloads that use no spill reg. + At the end, set reload_override_in to oldequiv. + Also call delete_output_reload if reload_out_reg is equal to old + in oldequiv code. + Add code to call delete_output_reload for stores with no matching load. + Set / use spill_reg_stored_to. + Handle case where secondary output reload uses a temporary, but + actual store isn't found. + When looking for a store of a value not loaded in order to call + delete_output_reload, count_occurrences should return 0 for no + loads; but discount inherited input reloadill_reg_stored_to. + Do checks for extra uses of REG. Changed all + callers. + Use delete_address_reloads. + (reload): Take return value of find_reloads into account. + If a no-op set needs more than one reload, delete it. + (reload_reg_free_before_p): RELOAD_FOR_INPUT + can ignore RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS + for the same operand. + (clear_reload_reg_in_use): Check for other reloads that keep a + register in use. + (reload_reg_free_for_value_p): Handle RELOAD_FOR_OPERAND_ADDRESS / + RELOAD_FOR_OPADDR_ADDR. + Take into account when an address address reload is only needed + for the address reload we are considering. + (count_occurrences): Use rtx_equal_p for MEMs. + (inc_for_reload): Return instruction that stores into RELOADREG. + New argument two, IN, and rtx. Changed all callers. + (calculate_needs_all_insns, reload_as_needed): + Don't clear after_call for a CLOBBER. + Keep track of how many hard registers need to be copied from + after_call, and don't clear after_call before we have seen + that much copies, or we see a different instruction. + +Fri Oct 16 10:58:23 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks_1): Do not delete unreachable blocks + after reload has completed. + +Fri Oct 16 17:26:10 1998 Dave Brolley + + * cpplib.c (cpp_get_token): Replace whitespace that occurs between + a macro name and the next token with a single blank if that whitespace + is in a macro buffer and the next token is not '('. + +Fri Oct 16 15:44:02 1998 Dave Brolley + + * cccp.c (rescan): Handle multibyte characters ending in backslash. + (rescan): Likewise. + (skip_if_group): Likewise. + (skip_to_end_of_comment): Likewise. + (macarg1): Likewise. + (discard_comments): Likewise. + (change_newlines): Likewise. + +Fri Oct 16 15:26:24 1998 Dave Brolley + + * c-lex.c (yylex): Fix unaligned access of wchar_t. + +Fri Oct 16 10:47:53 1998 Nick Clifton + + * config/arm/arm.h (TARGET_SWITCHES): Add --help documentation. + (TARGET_OPTIONS): Add --help documentation. + +Fri Oct 16 11:49:01 1998 Kaveh R. Ghazi + + * rtl.h (sets_cc0_p): Revert Oct 14 ATTRIBUTE_NORETURN change. + +Fri Oct 16 07:08:46 1998 Bruce Korb + + * fixinc/* Moved in from ../contrib directory in preparation + for integrating it into the normal build process. In particular, + fixinc/Makefile.in must be config-ed into the build directory + as fixinc/Makefile. Proposed patches to ./Makefile.in and + ./configure.in will be "in the mail" momentarily. + +Fri Oct 16 08:13:46 1998 David S. Miller + + * cse.c (cse_basic_block): Fixup hash flushing loop so we do not + accidently walk into the free list. Comment how that can happen. + (invalidate): Fix indentation. + +Thu Oct 15 23:53:29 1998 Bernd Schmidt + Jeffrey A Law (law@cygnus.com) + + * flow.c (life_analysis_1): Do not clobber regs_ever_live after + reload. Never perform rescans of the insn chain after reload. + (propagate_block): Do not delete insn or create new autoinc addressing + modes after reload. + + * jump.c (jump_optimize): Unconditionally use the code that was + previously conditional on PRESERVE_DEATH_INFO_REGNO_P. + * reload1.c (reload): When reloading is finished, delete all + REG_DEAD and REG_UNUSED notes. + (emit_reload_insns): Delete all code that was conditional on + PRESERVE_DEATH_INFO_REGNO_P. + (no_longer_dead_regs): Delete variable. + (reload_cse_delete_death_notes): Delete function. + (reload_cse_no_longer_dead): Delete function. + (reload_cse_regs_1): Delete all code to handle deletion of death + notes. + (reload_cse_noop_set_p): Likewise. + (reload_cse_simplify_set): Likewise. + (reload_cse_simplify_operands): Likewise. + (reload_cse_move2add): Likewise. + * reorg.c (used_spill_regs): Delete declaration. + (max_label_num_after_reload): Delete declaration. + (find_dead_or_set_registers): Don't assume that spill regs are + dead at a CODE_LABEL. + * rtlanal.c (dead_or_set_regno_p): Death notes are always accurate, + even after reload. + * sched.c (sched_analyze_insn): Likewise. + (update_flow_info): Likewise. + * haifa-sched.c (sched_analyze_insn): Likewise. + (update_flow_info): Likewise. + * tm.texi (PRESERVE_DEATH_INFO_REGNO_P): Delete documentation. + * toplev.c (max_label_num_after_reload): Delete variable. + (rest_of_compilation): Don't set max_label_num_after_reload. + Call life_analysis after reload_cse_regs if optimizing. + * config/gmicro/gmicro.h: Delete comment referring to + PRESERVE_DEATH_INFO_REGNO_P. + * config/i386/i386.h: Likewise. + * config/m88k/m88k.h: Likewise. + * config/m32r/m32r.h (PRESERVE_DEATH_INFO_REGNO_P): Delete definition. + * config/sh/sh.h: Likewise. + +Thu Oct 15 19:48:41 1998 David Edelsohn + + * loop.c (strength_reduce): Restore marking bct_p as + ATTRIBUTE_UNUSED. + * rs6000.c (optimization_options): Change #ifdef HAIFA to + HAVE_decrement_and_branch_on_count. + (small_data_operand): Remove TARGET_ELF condition for marking + parameters ATTRIBUTE_UNUSED. + +Thu Oct 15 11:45:51 1998 Robert Lipe + + * config/i386/sco5.h (MAX_OFILE_ALIGNMENT): Define. + (SELECT_SECTION): Resync with svr4.h. + +Thu Oct 15 12:42:13 1998 David Edelsohn + + * loop.c (strength_reduce): Undo Oct 14 change marking bct_p + ATTRIBUTE_UNUSED. + +Thu Oct 15 00:57:55 1998 Robert Lipe + + * c-pragma.c (handle_pragma_token): Test for null tree before + dereferencing TREE_CODE. + +Thu Oct 15 17:36:48 1998 Michael Hayes + + * config/c4x/c4x.c: Convert to use GEN_INT. + (c4x_parallel_process): Rework to handle new repeat loop structure. + + * config/c4x/c4x.md: Convert to use GEN_INT. + (rptb_end): Convert to use GE test. Replace uses with clobbers. + (decrement_and_branch_on_count): Likewise. + + * config/c4x/c4x.h (REPEAT_BLOCK_PROCESS): Deleted hook now that + loop.c has the desired functionality. + (rc_reg_operand): New prototype. + + * config/c4x/t-c4x: Can now build all front ends. + +Wed Oct 14 23:27:08 1998 Didier FORT (didier.fort@fedex.com) + + * fixincludes: Fix up rpc/{clnt,svr,xdr}.h for SunOS. + +Wed Oct 14 22:13:28 1998 Joel Sherrill (joel@OARcorp.com) + + * Makefile.in (stmp-fixinc): Do not install assert.h if not desired. + * config/t-rtems: Do not install assert.h -- use newlib's. + +Wed Oct 14 21:57:08 1998 J"orn Rennecke + + * combine.c (combine_instructions): When finished, call init_recog. + * regmove.c (optimize_reg_copy_3): Reject volatile MEMs. + +Wed Oct 14 16:10:22 1998 Per Bothner + + * toplev.c: If flag_syntax_only, don't open or write assembler file. + +Wed Oct 14 13:26:05 1998 Kaveh R. Ghazi + + * cppalloc.c (memory_full): Mark function prototype with + ATTRIBUTE_NORETURN. + + * demangle.h (collect_exit): Likewise. + + * fix-header.c (v_fatal, fatal): Likewise. + + * gcc.c (pfatal_with_name, pfatal_pexecute, fatal, fancy_abort): + Likewise. + + * gcov.c (print_usage): Likewise. + + * genattr.c (fatal, fancy_abort): Likewise. + + * genattrtab.c (fatal, fancy_abort): Likewise. + + * gencodes.c (fatal, fancy_abort): Likewise. + + * genconfig.c (fatal, fancy_abort): Likewise. + + * genemit.c (fatal, fancy_abort): Likewise. + + * genextract.c (fatal, fancy_abort): Likewise. + + * genflags.c (fatal, fancy_abort): Likewise. + + * genopinit.c (fatal, fancy_abort): Likewise. + + * genoutput.c (fatal, fancy_abort): Likewise. + + * genpeep.c (fatal, fancy_abort): Likewise. + + * genrecog.c (fatal, fancy_abort): Likewise. + + * libgcc2.c (__eprintf, __default_terminate, __sjthrow, + __sjpopnthrow, __throw): Likewise. + + * objc/objc-act.c (objc_fatal): Likewise. + + * protoize.c (usage, aux_info_corrupted, + declare_source_confusing): Likewise. + + * rtl.c (dump_and_abort): Likewise. + + * rtl.h (sets_cc0_p): Likewise. + + * toplev.c (float_signal, pipe_closed): Likewise. + +1998-10-14 Andreas Schwab + + * dwarf2out.c (expand_builtin_dwarf_reg_size): Look at all ranges + when generating the decision tree for the general case. + + * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Don't accept modes + wider that 12 bytes in fpu regs or wider than 8 byte in fpa regs. + +Wed Oct 14 11:14:02 1998 Kaveh R. Ghazi + + * Makefile.in (sched.o): Depend on recog.h. + + * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to + (unsigned) when comparing against one. + (find_base_value): Likewise. + (record_base_value): Cast variable `regno' to (unsigned) when + comparing against one. Cast the result of REGNO() macro to + (unsigned) when comparing against one. + (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to + unsigned. + (init_alias_analysis): Add unsigned variable `ui'. Use it as loop + variable where an unsigned index is needed. + + * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) + before comparing against one. + + * collect2.c: Add prototypes for functions `error', `fatal' and + `fatal_perror'. Make these functions take variable arguments + instead of faking it with a fixed number of args. + (write_c_file_stat): Cast the argument of ctype macro to (unsigned + char). + + * combine.c (can_combine_p): Mark parameter `pred' with + ATTRIBUTE_UNUSED. + (find_split_point): Cast variable `src' to (unsigned + HOST_WIDE_INT) when comparing against one. + (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. + (simplify_logical): Likewise. + (force_to_mode): Cast result of INTVAL() macro to (unsigned + HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned + HOST_WIDE_INT) in shift. + (simplify_and_const_int): Cast result of INTVAL() macro to + `unsigned HOST_WIDE_INT' when comparing against one. + (merge_outer_ops): Cast variable const0 to `unsigned + HOST_WIDE_INT' when comparing against the result of + GET_MODE_MASK() macro. + (simplify_comparison): Likewise for variable `c0'. Cast variable + `const_op' to `unsigned HOST_WIDE_INT' when comparing against + one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the + result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing + against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast + result of INTVAL() macro to `unsigned HOST_WIDE_INT' when + comparing against one. + (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. + + config/mips/mips.c (gen_int_relational): Cast result of INTVAL() + macro to `unsigned HOST_WIDE_INT' when comparing against one. + (output_block_move): Cast `sizeof' expression to (int) when + comparing against one. + (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing + against one. + (save_restore_insns): Cast `base_offset' to `long' to match format + specifier in fprintf. + + * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro + to `enum machine_mode'. + + * flow.c (life_analysis_1): Remove unused variable `insn'. + + * gcc.c (translate_options): Move variables `j' and `k' into the + scope in which they are used. Change their types to `size_t'. + (set_spec): Cast the argument of ctype macro to `unsigned char'. + (read_specs): Likewise. + (process_command): Cast `sizeof' to (int) when comparing against one. + (do_spec_1): Cast the argument of ctype macro to `unsigned char'. + (handle_braces): Cast both sides of `==' expression to `long' to + ensure sign matching. + (main): Cast variable `i' to `int' when comparing against one. + + * gcov-io.h (__fetch_long): Change type of parameter `bytes' from + int to size_t. Cast variable `i' to size_t when comparing against + one. + + * genattrtab.c (convert_set_attr_alternative): Remove unused + parameter `insn_code'. All callers changed. + (convert_set_attr): Likewise. + + * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to + size_t when comparing against one. Likewise for variable `len'. + + * global.c (global_alloc): Cast variable `max_regno' to size_t + when comparing against one. Likewise for variable `max_allocno'. + + * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. + + * local-alloc.c (validate_equiv_mem_from_store): Mark parameter + `set' with ATTRIBUTE_UNUSED. + (find_free_reg): Cast `sizeof' expression to (int) when comparing + against one. + + * loop.c (count_loop_regs_set): Remove unused variable `dest'. + (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. + (get_condition): Cast variable `const_val' to `unsigned + HOST_WIDE_INT' when comparing against one. Cast unsigned + expression to HOST_WIDE_INT when comparing against one. + (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. + (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to + `unsigned' when comparing against one. + + * protoize.c (is_id_char): Change type of parameter `ch' to + unsigned char. + (munge_compile_params): Cast argument of ctype macro to (const + unsigned char). + (process_aux_info_file): Cast variable `aux_info_size' to int when + comparing against one. + (forward_to_next_token_char): Cast argument of ctype macro to + `const unsigned char'. + (edit_formals_lists): Likewise. + (find_rightmost_formals_list): Likewise. + (add_local_decl): Likewise. + (add_global_decls): Likewise. + (edit_fn_definition): Likewise. + (do_cleaning): Likewise. + (scan_for_missed_items): Likewise. + (edit_file): Cast variable `orig_size' to (int) when comparing + against one. + (main): Cast argument of ctype macro to `const unsigned char'. + + * recog.c (const_int_operand): Mark parameter `mode' with + ATTRIBUTE_UNUSED. + + * regclass.c (record_reg_classes): Change type of variable `c' to + `unsigned char'. Cast `char' array index to `unsigned char'. + + * reload.c (push_secondary_reload): Cast argument to + REG_CLASS_FROM_LETTER() macro to `unsigned char'. + + * reload1.c (calculate_needs): Cast `char' array index to + `unsigned char'. + (set_label_offsets): Change type of variable `i' to unsigned int. + Cast result of XVECLEN() macro to unsigned when comparing against + one. + (mark_not_eliminable): Change type of variable `i' to unsigned. + (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned + when comparing against one. + (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when + comparing against one. + (choose_reload_regs): Hide unused label `fail'. + (reload_cse_simplify_operands): Cast `char' array index to + `unsigned char'. + (reload_combine_note_store): Mark parameter `set' with + ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing + against one. + (reload_cse_move2add): Remove unused variable `src2'. + + * sched.c: Include recog.h. + (sched_note_set): Remove unused parameter `b'. All callers + changed. + (split_hard_reg_notes): Likewise for parameter `orig_insn'. + (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) + when comparing against one. + + * stupid.c (stupid_find_reg): Mark parameter `changes_size' with + ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when + comparing against one. + + * unroll.c (precondition_loop_p): Remove unused parameter + `loop_end'. All callers changed. + +Tue Oct 13 22:12:11 1998 Bernd Schmidt + + * reload1.c (maybe_fix_stack_asms): New static function. + (reload): Call it. + + * reload.h (compute_use_by_pseudos): Declare. + + * reload1.c (spilled_pseudos, insns_need_reload): New variables. + (something_needs_reloads): Delete variable. + (finish_spills): New function. + (compute_use_by_pseudos): New function. + + (delete_caller_save_insns): Lose argument FIRST. All callers changed. + Use the reload_insn_chain instead of walking the rtl directly. + + (reload): Allocate and free spilled_pseudos. + Ensure that all calls of spill_hard_reg are followed by a call to + finish_spills. + Use the insns_need_reload list instead of something_needs_reloads + to find out if reload_as_needed must be called. + Clear unused_insn_chains at the end. + + (calculate_needs_all_insns): Lose FIRST parameter. All callers + changed. + Delete code to keep track of current basic block. + Walk reload_insn_chain instead of the rtl structure. Build the + insns_need_reload chain. + Remember which insns need reloading/elimination by setting the + appropriate fields in struct insn_chain, not by putting modes on the + insn. + + (calculate_needs): Lose THIS_BLOCK arg. Accept arg CHAIN instead of + arg INSN. All callers changed. + Delete declaration of struct needs. + Don't set something_needs_reloads. + Record insn needs in the CHAIN argument. + + (spill_hard_reg): Record the affected pseudos in spilled_pseudos. + + (reload_as_needed): Lose FIRST arg. All callers changed. + Walk the reload_insn_chain instead of the rtx structure. + Delete code to keep track of current basic block. + Rename one of the NEXT variables to OLD_NEXT. + + (allocate_reload_reg): Accept arg CHAIN instead of arg INSN. All + callers changed. + (choose_reload_regs): Likewise. + + (emit_reload_insns): Replace INSN and BB args with arg CHAIN. All + callers changed. + + * caller-save.c (MOVE_MAX_WORDS): New macro. Use it throughout + instead of (MOVE_MAX / UNITS_PER_WORD) computation. + (hard_regs_live, hard_regs_need_restore): Delete variables. + (n_regs_saved): Now static. + (referenced_regs, this_insn_sets): New variables. + + (setup_save_areas): Restructure the code a bit. + + (restore_referenced_regs): Delete function. + (mark_referenced_regs): New function, similar to the old + restore_referenced_regs, but mark registers in referenced_regs. + + (clear_reg_live): Delete function. + (mark_set_regs): Renamed from set_reg_live. All callers changed. + Only mark registers in this_insn_sets. + + (save_call_clobbered_regs): Rework this function to walk the + reload_insn_chain instead of using the list of instructions directly. + Delete code to keep track of register lives, compute live regs on the + fly from information in the chain. + Instead of calling restore_referenced_regs, use mark_referenced_regs, + then walk the set it computes and call insert_restore as appropriate. + + (insert_restore): Lose INSN and BLOCK args. Add CHAIN arg. All + callers changed. + Restructure the code a bit. Test hard_regs_saved instead of + hard_regs_need_restore. + (insert_save): Lose INSN and BLOCK args. Add CHAIN and TO_SAVE + args. All callers changed. + Restructure the code a bit. Use TO_SAVE to determine which regs to + save instead of more complicated test. + (insert_one_arg): Lose INSN and BLOCK args. Add CHAIN arg. All + callers changed. + Create a new insn_chain structure for the new insn and place it + into the chain. + + * rtl.texi: Update documentation to reflect that reload no longer + puts modes on the insns. + +1998-10-14 Andreas Schwab + + * function.c (purge_addressof_1): Force the first argument of a + CALL insn to memory. + +Wed Oct 14 00:38:40 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.h: Delete duplicate prototypes. Add some missing + prototypes. + * rtlanal.c (for_each_rtx): Formatting tweak. + +1998-10-13 Herman A.J. ten Brugge + + * real.c (emdnorm and etoasc): Disable round to even for c4x target + to be compatible with TI compiler. + + * Makefile.in (USER_H): Add va-c4x.h to definition. + +Tue Oct 13 23:03:37 1998 Richard Henderson + + * function.c (purge_addressof_1): Fix typo in inequality: do + bitfield optimization for equal mode sizes. + * expmed.c (store_bit_field): Don't take subregs of subregs in + the movstrict case. Tidy a potential problem in the multi-word case. + (extract_bit_field): Likewise. + +Tue Oct 13 22:12:11 1998 Bernd Schmidt + + * flow.c (find_basic_blocks): Emit NOPs after normal calls in this + function. + Compute max_uid_for_flow by calling get_max_uid after the scan. + (find_basic_blocks_1): Don't emit NOPs here. + +Tue Oct 13 22:05:49 1998 Richard Henderson + + * alias.c (base_alias_check): Accept new args for the modes of the + two references. Use them to determine if an AND can overlap. Update + all callers. + (memrefs_conflict_p): Assume sizes are aligned, and uses them + to determine if an AND can overlap. + +Tue Oct 13 17:51:04 1998 Jim Wilson + + * config/m68k/m68k.h (HARD_REGNO_MODE_OK): For FP regs, add REGNO >= 16 + check. Add comment to document problems with TARGET_SUN_FPA version + of this macro. + * config/m68k/m68k.md (movxf+1): Support 'r'/'r' moves. + +Tue Oct 13 17:46:18 1998 Kaveh R. Ghazi + + * Makefile.in (gencheck.o): Depend on gansidecl.h. + + * c-common.c (print_char_table): Add missing initializers. + (scan_char_table): Likewise. + (time_char_table): Likewise. + + * c-decl.c (c_decode_option): Mark parameter `argc' with + ATTRIBUTE_UNUSED. + (declare_parm_level): Mark parameter `definition_flag' with + ATTRIBUTE_UNUSED. + + * c-lex.c (readescape): Use `(unsigned)1' in shift. + (yylex): Likewise. Cast `sizeof' to an (int) when comparing + against one. + + * calls.c (store_one_arg): Remove unused parameter `fndecl'. All + callers changed. + (emit_call_1): Mark parameters `fndecl' and `funtype' with + ATTRIBUTE_UNUSED. + (expand_call): Cast result of MIN() to (unsigned int) when + comparing against an unsigned value. + + * cccp.c (pcfinclude): Remove unused parameter `limit'. All + callers changed. + (make_definition): Remove unused parameter `op'. All callers + changed. + (create_definition): Cast REST_EXTENSION_LENGTH to (long) when + comparing against the result of pointer arithmetic. + + * config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Cast to (unsigned) + when comparing against one. + + * dwarf2out.c (dwarf2out_frame_debug): Cast REGNO() and + HARD_FRAME_POINTER_REGNUM to (unsigned) when comparing against + one. + (output_die): Move variable `i' into the scope in which it is + used. Change its type to `unsigned'. + (output_die): Cast the result of `strlen' to (int) when passing it + to ASM_OUTPUT_ASCII(). + (output_pubnames): Likewise. + (output_line_info): Likewise. + + * emit-rtl.c (global_rtl): Add missing initializers. + + * explow.c (promote_mode): Mark parameter `for_call' with + ATTRIBUTE_UNUSED. + + * expmed.c (expand_shift): Cast the result of GET_MODE_BITSIZE to + `unsigned HOST_WIDE_INT' when comparing against one. + (synth_mult): Change type of variable `cost' to int. + (emit_store_flag): Use `(unsigned HOST_WIDE_INT) 1' in shift. + + * expr.c (copy_blkmode_from_reg): Cast BITS_PER_WORD to (unsigned) + when comparing against one. + (get_inner_reference): Change variable `alignment' to unsigned. + (expand_expr): Cast the result of GET_MODE_ALIGNMENT to (unsigned + int) when comparing against one. + (expand_builtin_setjmp): Change type of variable `i' to size_t. + + * fold-const.c (div_and_round_double): Cast BASE to + (HOST_WIDE_INT) when comparing against one. + + * gencheck.c: Include gansidecl.h. + (main): Mark parameter `argv' with ATTRIBUTE_UNUSED. + + * optabs.c (gen_cond_trap): Mark parameters `code', `op2' and + `tcode' with ATTRIBUTE_UNUSED. + + * real.c (edivm): Cast constant value to (unsigned long) in + expression compared against an unsigned value. + + * stmt.c (expand_return): Cast BITS_PER_WORD to (unsigned) when + comparing against one. + (expand_end_case): Cast CASE_VALUES_THRESHOLD to (unsigned int) + when comparing against one. + + * stor-layout.c (mode_for_size): Cast MAX_FIXED_MODE_SIZE to + (unsigned int) when comparing against one. Likewise for + GET_MODE_BITSIZE. + (smallest_mode_for_size): Likewise. + (save_storage_status): Mark parameter `p' with ATTRIBUTE_UNUSED. + (restore_storage_status): Likewise. + + * toplev.c (debug_args): Add missing initializer. + (f_options): Spelling correction. Add missing initializers. + (documented_lang_options): Likewise. + (debug_end_source_file): Mark parameter `lineno' with + ATTRIBUTE_UNUSED. + + * tree.c (valid_machine_attribute): Mark parameters `attr_args', + `decl' and `type' with ATTRIBUTE_UNUSED. + + * varasm.c (decode_reg_name): Cast `sizeof' expression to (int) + when comparing against one. + (assemble_variable): Mark parameter `top_level' with + ATTRIBUTE_UNUSED. + (assemble_external_libcall): Mark parameter `fun' with + ATTRIBUTE_UNUSED. + (output_constant_pool): Mark parameters `fnname' and `fndecl' with + ATTRIBUTE_UNUSED. + +Tue Oct 13 12:51:04 1998 Nick Clifton + + * config/v850/lib1funcs.asm (_udivsi3): Add .type declaration. + Replace use of r5 with use of r19. + + * config/v850/v850.h (LINK_POINTER_REGNUM): Define. + + * config/v850/v850.c (compute_register_save_size): Allow for the + fact that helper functions save all registers, not just those used + by the function. + + Replace constant 31 with macro LINK_POINTER_REGNUM. + + * config/v850/v850.md: Use 'indirect_operand' rather than + 'memory_operand' for bit test/set/clear patterns. + +Tue Oct 13 11:49:14 1998 Jason Merrill + + * mips/iris6.h (ASM_OUTPUT_WEAK_ALIAS): Call ASM_GLOBALIZE_LABEL. + * varasm.c (assemble_start_function et al): Don't call + ASM_GLOBALIZE_LABEL for weak symbols. + +Tue Oct 13 11:37:45 1998 Nick Clifton + + * cse.c (equiv_constant): Check for NULL return from + gen_lowpart_if_possible(). + +Tue Oct 13 11:24:51 1998 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (addsi3, subsi3, negsi2): Only allow register operands. + + * collect2.c (main): Pass -EL/-EB through to the compiler. + +1998-10-12 Herman A.J. ten Brugge + + * expr.c (push_block): Handle targets where the stack grows + to higher addresses, but args grow to lower addresses and + ACCUMULATE_OUTGOING_ARGS is not defined. + +Tue Oct 13 08:00:52 1998 Catherine Moore + + * config/v850/v850.c (print_operand): Extend meaning + of 'c' operands to support .vtinherit. + +Tue Oct 13 21:38:35 1998 Michael Hayes + + * config/c4x/c4x.c: Convert to gen_rtx_FOO. + Added ATTRIBUTE_UNUSED to unused function arguments. + (rc_reg_operand): New predicate. + (c4x_rptb_insert): New function. + (c4x_rptb_nop_p): Recognize modified rptb_top pattern. + (c4x_optimization_options): New function. + + * config/c4x/c4x.md: Convert to gen_rtx_FOO. + (decrement_and_branch_on_count): New pattern. + (rptb_top): Modified pattern to work with BCT optimization. + + * config/c4x/c4x.h (RC_REG): New register class. + (rc_reg_operand): Define prototype. + (IS_RC_REG): New macro. + (IS_RC_OR_PSEUDO_REG): New macro. + (IS_RC_OR_PSEUDO_REGNO): New macro. + (OPTIMIZATION_OPTIONS): Define. + +Mon Oct 12 19:57:34 1998 Jason Merrill + + * collect2.c (extract_init_priority): No priority is 65535. + +Mon Oct 12 12:10:37 1998 Alexandre Oliva + + * Makefile.in (build_tooldir): New variable, same as old + $(tooldir), but without depending on $(libdir)/$(unlibsubdir). + (GCC_FOR_TARGET): Add -B$(build_tooldir)/bin/. + (bootstrap, bootstrap2, bootstrap3, bootstrap4): Likewise. + + * configure.in (gxx_include_dir): Set default based on unlibsubdir. + * Makefile.in (tooldir): Likewise. + (cccp.o, cpplib.o): Use unlibsubdir implicitly through + gxx_include_dir, includedir and tooldir. + (protoize.o, unprotoize.o): Likewise. + +Mon Oct 12 10:50:44 1998 Nick Clifton + + * config/arm/arm.md: Replace (reg 24) with (reg:CC 24). + + * config/arm/thumb.c (thumb_override_options): Add warning about + PIC code not being supported just yet. + +Sun Oct 11 16:49:15 1998 John Wehle (john@feith.com) + + * flow.c: Update comment. + (notice_stack_pointer_modification): New static function. + (record_volatile_insns): Use it. + (mark_regs_live_at_end): Mark the stack pointer as alive + at the end of the function if current_function_sp_is_unchanging + is set. + (life_analysis_1): Set current_function_sp_is_unchanging. + * function.c: Define it. + (init_function_start): Initialize it. + * output.h: Declare it. + * reorg.c (fill_simple_delay_slots, dbr_schedule): Mark + the stack pointer as alive at the end of the function if + current_function_sp_is_unchanging is set. + * i386.c (ix86_epilogue): Optimize the restoring + of the stack pointer. + +Mon Oct 12 01:22:53 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Oct 11 23:04:30 1998 Robert Lipe + + * c-pragma.c (handle_pragma_token): If passed a token instead + of a tree, use that as the pack value. + +Sun Oct 11 14:21:14 1998 Mark Mitchell + + * flow.c (find_basic_blocks_1): Fix prototype. + +Sun Oct 11 05:03:41 1998 Ken Raeburn + + * tree.h (DECL_NO_CHECK_MEMORY_USAGE): New macros. + (struct tree_decl): New fields no_check_memory_usage. + * c-common.c (enum attrs): Add A_NO_CHECK_MEMORY_USAGE. + (init_attributes): Register it as a new attribute. + (decl_attributes): Set flags on functions given that attribute. + * c-decl.c (duplicate_decls): Merge new attribute. + * expr.h (current_function_check_memory_usage): Declare new var. + * calls.c, expr.c, function.c, stmt.c, alpha.c, clipper.c, m88k.c, + pa.c, sparc.c: Replace uses of flag_check_memory_usage with + current_function_check_memory_usage. + * function.h: Add field to struct function. + * function.c (current_function_check_memory_usage): Define it. + (push_function_context_to, pop_function_context_from): Save and + restore it. + (expand_function_start): Set it, based on global flag and function + attribute. + + * expr.c (expand_expr, case VAR_DECL): In memory-checking code, do + check non-automatic variables, to permit detection of writes to + read-only locations in embedded systems without memory management. + * calls.c (store_one_arg): Use ARGS_SIZE_RTX to get size of argument + when emitting chkr_set_right_libfunc call, even if the argument is + BLKmode or variable-sized; don't abort. + + * optabs.c (init_optabs): Create Checker and __cyg_profile_* + symbols in Pmode, not VOIDmode. + +Sun Oct 11 01:03:05 1998 Zack Weinberg + + * cppexp.c: When forcing unsigned comparisons, cast both sides + of the operation. + + * cpphash.h: Move static declaration of hashtab[]... + * cpphash.c: ...here. + + * cpplib.c: Cast difference of two pointers to size_t before + comparing it to size_t. Cast signed to unsigned + before comparing to size_t. (FIXME: struct argdata should use + unsigned buffer sizes.) + * cpplib.h (struct cpp_reader): Declare token_buffer_size as + unsigned int. (CPP_WRITTEN): Cast return value to size_t. + (CPP_RESERVE): Parenthesize N for evaluation order, cast to + size_t before comparison. + +Sun Oct 11 00:15:29 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks): Delete "live_reachable_p" argument. + (find_basic_blocks_1): Similarly. + * output.h (find_basic_blocks): Fix prototype. + * gcse.c, toplev.c: Don't pass "live_reachable_p" argument to + find_basic_blocks anymore. + +Sat Oct 10 22:00:34 1998 Richard Henderson + + * basic-block.h (EXECUTE_IF_SET_IN_SBITMAP): New macro. + (sbitmap_free, sbitmap_vector_free): New macros. + * output.h (rtl_dump_file): Declare. + +Sat Oct 10 17:01:42 1998 Jeffrey A Law (law@cygnus.com) + + * regmove.c (optimize_reg_copy_3): Honor TRULY_NOOP_TRUNCATION. + +Fri Oct 9 22:08:05 1998 Kaveh R. Ghazi + + * fp-bit.c (SFtype): Don't implicitly use int in declaration. + (DFtype): Likewise. + (_fpdiv_parts): Remove unused parameter `tmp', all callers changed. + (divide): Remove unused variable `tmp'. + (si_to_float): Cast numeric constant to (SItype) before comparing + it against one. + +Fri Oct 9 16:03:19 1998 Graham + + * flow.c (print_rtl_with_bb): Changed type of in_bb_p to match use. + * gcc.c (add_preprocessor_option): Correct typo when allocating + memory, sizeof() argument had one too many `*'. + (add_assembler_option): Likewise. + (add_linker_option): Likewise. + * gcov.c (output_data): Likewise. + * local-alloc.c (memref_used_between_p): Likewise. + (update_equiv_regs): Likewise. + * loop.c (strength_reduce): Likewise. + * reg-stack.c (record_asm_reg_life): Likewise. + (subst_asm_stack_reg): Likewise. + * reorg.c (dbr_schedule): Likewise. + +Fri Oct 9 15:57:51 1998 Bernd Schmidt + + * flow.c (life_analysis_1): Break out some functions. + (find_basic_blocks_1): Likewise. Also move some variables out and + make them static. + Rename NONLOCAL_LABEL_LIST arg to NONLOCAL_LABELS and initialize + new static var nonlocal_label_list with it. + (active_eh_region, nested_eh_region, label_value_list, + nonlocal_label_list): New static variables. + (make_edges, delete_unreachable_blocks, delete_block): New static + functions, broken out of find_basic_blocks_1. + (record_volatile_insns, mark_regs_live_at_end, set_noop_p, + noop_move_p): New static functions, broken out of life_analysis_1. + +Fri Oct 9 15:49:29 1998 Richard Henderson + + * expmed.c (store_bit_field): Pun non-integral str_rtx modes. + Take extra care for op0 now possibly being a subreg. + (extract_bit_field): Likewise. + * function.c (purge_addressof_1): Revert Oct 4 change. Drop + the reg to memory if there is no equal sized integral mode. + * stor-layout.c (int_mode_for_mode): New function. + * machmode.h: Prototype it. + +Fri Oct 9 14:26:44 1998 Jeffrey A Law (law@cygnus.com) + + * global.c (build_insn_chain): Verify no real insns exist past the + end of the last basic block, then exit the loop. + +Fri Oct 9 11:44:47 1998 David Edelsohn + + * loop.c (insert_bct): Ensure loop_iteration_var nonzero before use. + +Thu Oct 8 21:59:47 1998 Dave Brolley + + * emit-rtl.c (init_emit_once): Call INIT_EXPANDERS. + +Thu Oct 8 22:03:45 1998 David Edelsohn + + * rs6000.h (RTX_COSTS): Add PROCESSOR_PPC604e cases. + +Thu Oct 8 17:00:18 1998 Richard Henderson + + * flow.c (find_basic_blocks): Correctly determine when a call + is within an exception region. + +Thu Oct 8 17:15:04 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (output_file_directive): Use DIR_SEPARATOR, not '/'. + + * cpplib.h: Protect from multiple inclusions. + * cpplib.c: Fix minor formatting problems. + + * i386/xm-cygwin32.h: Only define POSIX if it is not already defined. + + * jump.c (jump_optimize): Revert accidental patch. + + * Makefile.in (cpplib.o): Use unlibsubdir. + +Thu Oct 8 12:50:47 1998 Jim Wilson + + * loop.c (get_condition): Allow combine when either compare is + VOIDmode. + +Thu Oct 8 11:31:01 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Oct 8 12:21:14 1998 Richard Frith-Macdonald + + * c-lex.c (remember_protocol_qualifiers): Handle RID_BYREF. + (init_lex): Initialize ridpointers[RID_BYREF]. + * c-lex.h (enum rid): Add RID_BYREF. + * c-parse.gperf: Add RID_BYREF as a type qualifier. + * objc/objc-act.c (is_objc_type_qualifiers): Handle RID_BYREF. + (encode_type_qualifiers): Similarly. + * c-gperf.h: Rebuilt. + +Thu Oct 8 05:56:00 1998 Jeffrey A Law (law@cygnus.com) + + * c-common.c (type_for_mode): Only return TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + * c-decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + (init_decl_processing): Only create TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + * c-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + +Thu Oct 8 05:05:34 1998 Bernd Schmidt + + * stmt.c (n_occurrences): New static function. + (expand_asm_operands): Verify that all constrains match in the + number of alternatives. + Verify that '+' or '=' are at the beginning of an output constraint. + Don't allow '&' for input operands. + Verify that '%' isn't written for the last operand. + * reload.c (find_reloads): Abort if an asm is found with invalid + constraints; all possible problems ought to be checked for earlier. + +Thu Oct 8 04:26:20 1998 Michael Hayes + + * flags.h (flag_branch_on_count_reg): Always declare. + * toplev.c (flag_branch_on_count_reg): Likewise. + * toplev.c: Fix typos. + + * real.c (c4xtoe): Remove unused variables. Add some missing parens. + (toc4x): Similarly. + +Thu Oct 8 01:25:22 1998 Richard Henderson + + * flow.c (find_basic_blocks): Calc upper bound for extra nops in + max_uids_for_flow. + (find_basic_blocks_1): Add a nop to the end of a basic block when + a trailing call insn does not have abnormal control flow. + * gcse.c (pre_transpout): New variable. + (alloc_pre_mem, free_pre_mem, dump_pre_data): Bookkeeping for it. + (compute_pre_transpout): Calculate it. + (compute_pre_ppinout): Use it to eliminate impossible placements + due to abnormal control flow through calls. + (compute_pre_data): Call compute_pre_transpout. + +Wed Oct 7 21:40:24 1998 David S. Miller + + * config/sparc/sol2-sld-64.h (ASM_CPU_SPEC): Fix typo. + +Wed Oct 7 21:19:46 1998 Ken Raeburn + + * config/mips/mips.md (tablejump_internal3, tablejump_internal4 + and matching define_insns): Tack on a `use' of the table label, so + flow analysis will recognize a tablejump. + +Wed Oct 7 17:33:39 1998 Richard Henderson + + * gcse.c (pre_insert_insn): Tweek to notice that calls do not + always end basic blocks for abnormal edge reasons. + +Wed Oct 7 14:40:43 1998 Nick Clifton + + * config/i386/i386.h: Remove definition of + HANDLE_PRAGMA_PACK_PUSH_POP. + + * config/i386/go32.h: Add definition of + HANDLE_PRAGMA_PACK_PUSH_POP. + + * config/i386/win32.h: Add definition of + HANDLE_PRAGMA_PACK_PUSH_POP. + + * config/i386/cygwin32.h: Add definition of + HANDLE_PRAGMA_PACK_PUSH_POP. + + * c-pragma.c (insert_pack_attributes): Do not insert + attributes unless #pragma pack(push,) is in effect. + +Wed Oct 7 12:10:46 1998 Jim Wilson + + * expr.c (emit_group_store): Handle a PARALLEL destination. + +Wed Oct 7 10:07:29 1998 Richard Henderson + + * gcse.c (pre_insert_insn): When a call ends a bb, insert + the new insns before the argument regs are loaded. + +Wed Oct 7 12:55:26 1998 Kaveh R. Ghazi + + * Makefile.in (c-gperf.h): Add -L KR-C -F ', 0, 0' flags to gperf. + (c-parse.gperf): Update comments describing invocation flags. + (c-gperf.h): Regenerate using gperf 2.7.1 (19981006 egcs). + +1998-10-07 Manfred Hollstein + + * reload1.c (reload): Call free before clobbering the memory + locations or constants pointers. + +Wed Oct 7 02:05:20 1998 David S. Miller + + * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Rework + for efficiency by checking whether we need to modify the current + stack permission at all. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define. + * config/sparc/sparc.c (sparc_initialize_trampoline): Emit + __enable_execute_stack libcall here too if + TRANSFER_FROM_TRAMPOLINE is defined. + * config/sparc/sparc.h: Set TARGET_ARCH32 to a constant if + IN_LIBGCC2. + +Wed Oct 7 02:27:52 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (DRIVER_DEFINES): Remove last change. + +Wed Oct 7 01:08:43 1998 Bernd Schmidt + + * jump.c (duplicate_loop_exit_test): Strip REG_WAS_0 notes off all + insns we're going to copy. + * regclass.c (reg_scan_mark_refs): Don't test X for NULL_RTX. + + * loop.c (count_one_set): Add prototype. + + * caller-save.c (restore_referenced_regs): Lose mode argument. + (insert_save): Lose mode argument. + (insert_restore): Lose mode argument. + (insert_one_insn): Lose mode argument. + (save_call_clobbered_regs): Lose mode argument. + (setup_save_areas): Take no argument and return void. All callers + changed. + Don't verify validity of memory addresses. + * reload.h (setup_save_ares): Adjust prototype. + (save_call_clobbered_regs): Likewise. + * reload1.c (delete_caller_save_insns): New function. + (caller_save_spill_class): Delete variable. + (caller_save_group_size): Delete variable. + (reload): Call setup_save_areas and save_call_clobbered_regs + in the main loop, before calling calculate_needs_all_insns. + Don't call save_call_clobbered_regs after the loop. + Call delete_caller_save_insns at the end of an iteration if + something changed. + Delete code to manage caller_save_spill_class. + Emit the final note before setting reload_first_uid. + Simplify test that determines whether reload_as_needed gets run. + (calculate_needs): Delete code to manage caller_save_spill_class. + +Tue Oct 6 15:42:27 1998 Richard Henderson + + * collect2.c (main): Initialize ld_file_name. + +Tue Oct 6 15:45:15 1998 Catherine Moore + + * config/sparc/sysv4.h (ASM_OUTPUT_SECTION_NAME): Don't + check for flag_function_sections. + +Tue Oct 6 20:02:31 1998 J"orn Rennecke + + * cse.c (insert_regs): Fix bug in Sep 24 change. + +Tue Oct 6 17:00:42 1998 J"orn Rennecke + + * flags.h (flag_dump_unnumbered): Declare. + * toplev.c (flag_dump_unnumbered): Don't declare. + * print-rtl.c (flags.h): Include. + (print_rtl_single): Add return value. + * rtl.h (print_rtl_single): Update declaration. + * flow.c (flag_dump_unnumbered): Don't declare. + (print_rtl_with_bb): Use return value of print_rtl_single. + +Tue Oct 6 01:36:00 1998 Bernd Schmidt + + * loop.c (count_one_set): New static function, broken out of + count_loop_regs_set. + (count_loop_regs_set): Call it. + * global.c (mark_reg_store): Handle clobbers here by not calling + set_preference. + (mark_reg_clobber): Just call mark_reg_store after ensuring SETTER + is in fact a clobber. + * integrate.c (process_reg_param): New function, broken out of + expand_inline_function. + (expand_inline_function): Call it. + + * i386.md (addsidi3_1): Delete unused variable temp. + (addsidi3_2): Likewise. + (clstrstrsi): Delete unused variable addr1. + + * rtl.h: Don't declare any functions also declared in recog.h. + + * Makefile.in (stupid.o): Update dependencies. + (global.o): Likewise. + + * global.c: Include reload.h. + (reg_becomes_live): New function. + (reg_dies): New function. + (build_insn_chain): New function. + (global_alloc): Call build_insn_chain before calling reload. + + * reload.h (struct needs): New structure definition. + (struct insn_chain): Likewise. + (reload_insn_chain): Declare variable. + (new_insn_chain): Declare function. + + * reload1.c (reload_startobj): New variable. + (reload_insn_chain): New variable. + (unused_insn_chains): New variable. + (new_insn_chain): New function. + (init_reload): Initialize reload_startobj, not reload_firstobj. + (reload): Initialize reload_firstobj. + Before returning, free everything on the reload_obstack. + + * stupid.c: Include insn-config.h, reload.h and basic-block.h. + (reg_where_dead_chain, reg_where_born_exact, reg_where_born_clobber, + current_chain): New variables. + (reg_where_born): Delete variable. + (REG_WHERE_BORN): New macro. + (find_clobbered_regs): New function. + (stupid_life_analysis): Don't allocate/free reg_where_born. + Allocate and free reg_where_born_exact, reg_where_born_clobber, + reg_where_dead_chain. + Use REG_WHERE_BORN instead of reg_where_born. + While processing the insns, build the reload_insn_chain with + information about register lifetimes. + (stupid_reg_compare): Use REG_WHERE_BORN instead of reg_where_born. + (stupid_mark_refs): Replace arg INSN with arg CHAIN. All callers + changed. + Compute and information about birth and death of pseudo registers in + reg_where_dead_chain, reg_where_born_exact and reg_where_born_clobber. + Delete code to set elements of reg_where_born. + +Mon Oct 5 22:34:30 1998 Alexandre Petit-Bianco + + * tree.def (GOTO_EXPR): Modified documentation. + * expr.c (expand_expr): Expand GOTO_EXPR into a goto or a computed + goto. + +Mon Oct 5 22:43:36 1998 David Edelsohn + + * unroll.c (loop_iteration_var, loop_initial_value, loop_increment + loop_final_value, loop_comparison_code): No longer static. + (unroll_loop): Delete loop_start_value update. + * loop.h (loop_iteration_var, loop_initial_value, loop_increment, + loop_final_value, loop_comparison_code): Extern. + (loop_start_value): Delete extern. + * loop.c (loop_can_insert_bct, loop_increment, loop_start_value, + loop_comparison_value, loop_comparison_code): Delete. + (loop_optimize): Remove initialization for deleted variables. + (strength_reduce): Delete analyze_loop_iterations call. Only call + insert_bct if flag_branch_count_on_reg set. + (analyze_loop_iterations): Delete. + (insert_bct): Remove iteration count calculation. Move checks for + viable BCT optimization to here. Obtain iteration count from + loop_iterations and correct for unrolling. Check for enough + iteration to be beneficial. Comment out runtime iteration count + case. + (insert_bct): Print iteration count in dump file. Remove + loop_var_mode and use word_mode directly. + + * rs6000.h (processor_type): Add PROCESSOR_PPC604e. + * rs6000.c (rs6000_override_options): Use it. + (optimization_options): Enable use of flag_branch_on_count_reg. + * rs6000.md (define_function_unit): Describe 604e. + +1998-10-05 Herman A.J. ten Brugge + + * loop.c (move_movables): Corrected threshold calculation for + moved_once registers. + +Mon Oct 5 21:18:45 1998 Bernd Schmidt + + * loop.c (combine_givs_p): Fix test for identical givs. + +Mon Oct 5 10:11:28 1998 Nick Clifton + + * dwarf2out.c (gen_subprogram_die): If errorcount nonzero, don't + call abort if the function is already defined. + +Mon Oct 5 10:02:36 1998 Jeffrey A Law (law@cygnus.com) + + * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if + truncation is not a no-op. + +Mon Oct 5 09:02:04 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Oct 5 08:19:55 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Oct 5 01:07:23 1998 Torbjorn Granlund + + * expmed.c (expand_divmod): Don't widen for computing remainder + if we seem to have a divmod pattern for needed mode. + +Mon Oct 5 01:01:42 1998 Zack Weinberg + + * cpplib.c (macroexpand): Correct off-by-one error in handling + of escapes. + +Sun Oct 4 23:58:30 1998 Richard Henderson + + * combine.c (expand_field_assignment): Don't do bitwise operations + on MODE_FLOAT; pun to MODE_INT if possible. + +Sun Oct 4 18:33:24 1998 Jason Merrill + scott snyder + + * tlink.c (scan_linker_output): Recognize errors from irix 6.2 + linker. Recognize mangled names in quotes. + +Sun Oct 4 02:58:20 1998 Jakub Jelinek + + * config/sparc/sparc.md (ashldi3+1): Name it ashldi3_sp64. + (ashlsi3_const1, ashldi3_const1): New combiner patterns. + (ashrsi3_extend, ashrsi3_extend2): New combiner patterns. + (lshrsi3_extend, lshrsi3_extend2): Likewise. + +Sun Oct 4 00:23:00 1998 David S. Miller + + * function.c (purge_addressof_1): If trying to take a sub-word + integral piece of a floating point mode, put it on the stack. + +Sat Oct 3 19:01:03 1998 Richard Henderson + + * alpha/linux.h (CPP_PREDEFINES): Define __alpha__ for imake. + +Sat Oct 3 14:42:19 1998 Jason Merrill + + * PROJECTS: Remove template friends. + + * collect2.c (sort_ids): Remove unused variable. + + * tm.texi (MATH_LIBRARY): Document. + (NEED_MATH_LIBRARY): Remove. + + * varasm.c (assemble_start_function, assemble_variable, weak_finish, + assemble_alias): Do ASM_GLOBALIZE_LABEL for weak symbols, too. + +Sat Oct 3 16:14:44 1998 John Carr + + * dwarf2out.c (expand_builtin_dwarf_reg_size): Initialize + last_end to 0x7fffffff. + +Fri Oct 2 19:14:20 1998 David S. Miller + + * function.c (purge_addressof_1): Do not perform endianness + corrections on bitpos, who we call will do it for us. + +Fri Oct 2 11:52:35 1998 Jeffrey A Law (law@cygnus.com) + + * h8300.c (WORD_REG_USED): Fix typo. + (initial_offset): Use WORD_REG_USED. + + * h8300.c (handle_pragma): Fix typo. + +Fri Oct 2 10:51:35 1998 Bernd Schmidt + + * caller-save.c (insert_save_restore): Break this function up + into new functions insert_restore, insert_save and insert_one_insn. + All callers changed. + (insert_restore): New function, mostly broken out of + insert_save_restore. + (insert_save): Likewise. + (insert_one_insn): Likewise. + (restore_referenced_regs): New argument BLOCK. All callers changed. + (save_call_clobbered_regs): Don't keep track of basic block boundaries + in this function, do it in insert_one_insn instead. + + * reload1.c (reload): Break out some more pieces into separate + functions. + (dump_needs): New function, broken out of reload. + (set_initial_elim_offsets): Likewise. + (init_elim_table): Likewise. + (update_eliminables): Likewise. + + * global.c (global_alloc): Delete code to manage the scratch_list. + * local-alloc.c (qty_scratch_rtx): Delete. + (scratch_block): Delete. + (scratch_list): Delete. + (scratch_list_length): Delete. + (scratch_index): Delete. + (alloc_qty_for_scratch): Delete. + (local-alloc): Update initialization of max_qty. + Delete code to manage the scratch list. + Delete code to allocate/initialize qty_scratch_rtx. + (block_alloc): Don't allocate quantities for scratches. + Delete code to manage the scratch list. + * regs.h (scratch_list): Delete declaration. + (scratch_block): Delete declaration. + (scratch_list_length): Delete declaration. + * reload1.c (reload): Delete code to manage the scratch list. + (spill_hard_reg): Likewise. + (mark_scratch_live): Delete. + + * recog.c (alter_subreg): Delete declaration. + +1998-10-02 Andreas Jaeger + + * Makefile.in (cccp.o): Fix typo in last patch. + +Fri Oct 2 16:13:12 1998 J"orn Rennecke + + * t-sh (LIB1ASMFUNCS): Add _set_fpscr . + * config/sh/lib1funcs.asm (___set_fpscr): Add. + +Fri Oct 2 02:01:59 1998 Jeffrey A Law (law@cygnus.com) + + * regclass.c (reg_scan_mark_refs): Return immediately if passed a + NULL_RTX as an argument. + + * Makefile.in (unlibsubdir): Define. + (DRIVER_DEFINES): Use unlibsubdir. + (cccp.o, cpplib.o, protoize.o, unprotoize.o): Similarly. + (stmp-fixinc): Similarly. + +Thu Oct 1 19:58:30 1998 Bernd Schmidt + + * regmove.c (regmove_optimize): Add variable old_max_uid. + At the end of the function, update basic_block_end. + +Thu Oct 1 17:58:25 1998 David S. Miller + + * dwarf2out.c (expand_builtin_dwarf_reg_size): Use + FIRST_PSEUDO_REGISTER as upper bound for last_end, not an + arbitrary constant. + +Thu Oct 1 17:57:14 1998 Nick Clifton + + * config/arm/arm.c: Improve interworking support. + +Thu Oct 1 18:43:35 1998 J"orn Rennecke + + * reload1.c (choose_reload_regs): Fix test if reload_reg_rtx[r] was + copied from reload_out[r] . + +Thu Oct 1 19:20:09 1998 John Carr + + * dwarf2out.c (expand_builtin_dwarf_reg_size): Fix to work + with more than three size ranges. + + * flow.c (sbitmap_copy): Use bcopy to copy bitmap. + + * rtl.c (mode_name): Add a null string at the end of the array. + (mode_wider_mode): Change type to unsigned char. + (mode_mask_array): New variable. + (init_rtl): Update for mode_wider_mode type change. + + * rtl.h (mode_wider_mode): Change type to unsigned char. + (mode_mask_array): Declare. + (GET_MODE_MASK): Use mode_mask_array. + +Thu Oct 1 15:56:01 1998 Gavin Romig-Koch + + * calls.c (expand_call) : Encapsulate code into + copy_blkmode_from_reg. + * expr.c (copy_blkmode_from_reg): New function. + * expr.h (copy_blkmode_from_reg): New function. + * integrate.c (function_cannot_inline_p): We can inline + these now. + (expand_inline_function): Use copy_blkmode_from_reg + if needed. Avoid creating BLKmode REGs. + (copy_rtx_and_substitute): Don't try to SUBREG a BLKmode + object. + +Thu Oct 1 10:42:27 1998 Nick Clifton + + * config/v850/v850.c: Add function prototypes. + Add support for v850 special data areas. + + * config/v850/v850.h: Add support for v850 special data areas. + + * c-pragma.c: Add support for HANDLE_PRAGMA_PACK and + HANDLE_PRAGMA_PACK_PUSH_POP. + (push_alignment): New function: Cache an alignment requested + by a #pragma pack(push,). + (pop_alignment): New function: Pop an alignment from the + alignment stack. + (insert_pack_attributes): New function: Generate __packed__ + and __aligned__ attributes for new decls whilst a #pragma pack + is in effect. + (add_weak): New function: Cache a #pragma weak directive. + (handle_pragma_token): Document calling conventions. Add + support for #pragma pack(push,) and #pragma pack (pop). + + * c-pragma.h: If HANDLE_SYSV_PRAGMA or HANDLE_PRAGMA_PACK_PUSH_POP + are defined enable HANDLE_PRAGMA_PACK. + Move 'struct weak_syms' here (from varasm.c). + Add pragma states for push and pop pragmas. + + * c-common.c (decl_attributes): Call PRAGMA_INSERT_ATTRIBUTES + if it is defined. + + * c-lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with + HANDLE_GENERIC_PRAGMAS. + + * varasm.c: Move definition of 'struct weak_syms' into + c-pragma.h. + (handle_pragma_weak): Deleted. + + * config/i386/i386.h: Define HANDLE_PRAGMA_PACK_PUSH_POP. + + * config/winnt/win-nt.h: Define HANDLE_PRAGMA_PACK_PUSH_POP. + + * c-decl.c (start_function): Add invocation of + SET_DEFAULT_DECL_ATTRIBUTES, if defined. + + * tm.texi: Remove description of non-existent macro + SET_DEFAULT_SECTION_NAME. + + (HANDLE_SYSV_PRAGMA): Document. + (HANDLE_PRAGMA_PACK_PUSH_POP): Document. + +Wed Sep 30 22:27:53 1998 Robert Lipe + + * config.sub: Recognize i[34567]86-pc-udk as new target. + * configure.in: Likewise. + * config/i386/t-udk: New file. + * config/i386/udk.h: New file. + +Wed Sep 30 19:33:07 1998 Jeffrey A Law (law@cygnus.com) + + * reorg.c (check_annul_list_true_false): Remove unused variables. + (steal_delay_list_from_target): Add missing "used_annul" variable. + (try_merge_delay_insns): Close out half formed comment. + +Wed Sep 30 19:13:20 1998 Zack Weinberg + + * cpplib.c (macroexpand): If arg->raw_before or + arg->raw_after, remove any no-reexpansion escape at the + beginning of the pasted token. Correct handling of whitespace + markers and no-reexpand markers at the end if arg->raw_after. + + * toplev.c (documented_lang_options): Recognize -include, + -imacros, -iwithprefix, -iwithprefixbefore. + * cpplib.c (cpp_start_read): Process -imacros and -include + switches at the same time and in command-line order, after + initializing the dependency-output code. Emit properly nested + #line directives for them. Emit a #line for the main file + before processing these switches, and don't do it again + afterward. + +Wed Sep 30 18:03:22 1998 Richard Henderson + + * function.c (purge_addressof_1): Use bitfield manipulation + routines to handle mem mode < reg mode. + +Wed Sep 30 18:43:32 1998 Herman ten Brugge + + * reorg.c (try_merge_delay_insns): Account for resources referenced + in each instruction in INSN's delay list before trying to eliminate + useless instructions. Similarly when looking at a trial insn's delay + slots. + + * reorg.c (check_annul_list_true_false): New function. + (steal_delay_list_from_{target,fallthrough}): Call it and also + refine tests for when we may annul if already filled a slot. + (fill_slots_from_thread): Likewise. + (delete_from_delay_slot): Return newly-created thread. + (try_merge_delay_isns): Use its new return value. + +Wed Sep 30 18:29:26 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is + used to compute a giv or as some other non-counting use. + +Wed Sep 30 18:19:27 1998 Michael Hayes + + * regs.h (HARD_REGNO_CALL_PART_CLOBBERED): New macro. + * local-alloc.c (find_free_reg): Use it. + * global.c (find_reg): Likewise. + * tm.texi: Document HARD_REGNO_CALL_PART_CLOBBERED. + + * regs.h (HARD_REGNO_CALLER_SAVE_MODE): New macro. + * caller-save.c (init_caller_save): Use it. + * tm.texi: Document HARD_REGNO_CALLER_SAVE_MODE. + +Wed Sep 30 12:57:30 1998 Zack Weinberg + + * configure.in: Add --enable-cpplib option which uses cpplib + for cpp, but doesn't link cpplib into cc1. Make help text + capitalization consistent. + * configure: Rebuilt. + +Wed Sep 30 10:09:39 1998 Mark Mitchell + + * function.c (gen_mem_addressof): If the address REG is + REG_USERVAR_P make the new REG be so also. + * loop.c (scan_loop): Apply DeMorgan's laws and add documentation + in an attempt to clarify slightly. + +Wed Sep 30 09:57:40 1998 Jeffrey A Law (law@cygnus.com) + + * expr.c (expand_expr): Handle COMPONENT_REF, BIT_FIELD_REF ARRAY_REF + and INDIRECT_REF in code to check MAX_INTEGER_COMPUTATION_MODE. + +Wed Sep 30 10:13:39 1998 Catherine Moore + + * toplev.c: Fix last patch. + +Tue Sep 29 20:03:18 1998 Jim Wilson + + * loop.c (get_condition): Fix typo in May 9 change. + +Tue Sep 29 11:11:38 1998 Andrew MacLeod + + * invoke.texi (-fexceptions): Merge 2 different descriptions. + +Mon Sep 28 22:08:52 1998 Kaveh R. Ghazi + + * toplev.c (documented_lang_options): Spelling corrections. + +Mon Sep 28 19:41:24 1998 Alexandre Oliva + + * configure.in: New flags --with-ld and --with-as, equivalent + to setting LD and AS environment variables. Test whether + specified arguments are GNU commands, and report them with + checking messages. Use the specified AS for configure + tests too. + * configure: Likewise. + * acconfig.h: Add DEFAULT_ASSEMBLER and DEFAULT_LINKER. + * config.in: Likewise. + * gcc.c (find_a_file): When looking for `as' and `ld', return + the DEFAULT program if it exists. + * collect2.c (main): Use DEFAULT_LINKER if it exists. + + * gcc.c (find_a_file): The test for existence of a full + pathname was reversed. + +Mon Sep 28 17:34:35 1998 Michael Meissner + + * rs6000.h (ASM_OUTPUT_MI_THUNK): Only define on ELF systems. + * rs6000.c (output_mi_thunk): Always use a raw jump for now. + +Mon Sep 28 14:24:03 1998 Mark Mitchell + + * tree.h (TYPE_BINFO): Document. + +Mon Sep 28 12:55:49 1998 Stan Cox + + * i386-coff.h (dbxcoff.h): Added. + +Mon Sep 28 12:51:00 1998 Catherine Moore + + * toplev.c: Fix bad patch around flag_data_sections. + +Mon Sep 28 10:32:28 1998 Nick Clifton + + * reload1.c (reload): Use reload_address_index_reg_class and + reload_address_base_reg_class when setting + caller_save_spill_class. (Patch generated by Jim Wilson: + wilson@cygnus.com). + +Mon Sep 28 07:43:34 1998 Mark Mitchell + + * c-common.c (c_get_alias_set): Tighten slightly for FUNCTION_TYPEs + and ARRAY_TYPEs. Tidy up. Improve support for type-punning. + * expr.c (store_field): Add alias_set parameter. Set the + MEM_ALIAS_SET accordingly, if the target is a MEM. + (expand_assignment): Use it. + (store_constructor_field): Pass 0. + (expand_expr): Likewise. + +Mon Sep 28 07:54:03 1998 Catherine Moore + + * flags.h: Add flag_data_sections. + * toplev.c: Add option -fdata-sections. Add flag_data_sections. + (compile_file): Error if flag_data_sections not supported. + * varasm.c (assemble_variable): Handle flag_data_sections. + * config/svr4.h: Modify prefixes for UNIQUE_SECTION_NAME. + * config/mips/elf.h: Likewise. + * config/mips/elf64.h: Likewise. + * invoke.texi: Describe -fdata-sections. + +Mon Sep 28 04:15:44 1998 Craig Burley + + * invoke.texi (-ffloat-store): Clarify that this option + does not affect intermediate results -- only variables. + +Mon Sep 28 04:11:35 1998 Jeffrey A Law (law@cygnus.com) + + * cpp.texi: Update for Fortran usage from Craig. + +Fri Sep 25 22:09:47 1998 David Edelsohn + + * rs6000.c (function_arg_boundary): Revert accidental change on + September 18. + +Fri Sep 25 20:30:00 1998 Michael Meissner + + * rs6000.h (ASM_OUTPUT_MI_THUNK): Declare, call output_mi_thunk. + (output_mi_thunk): Declare. + + * rs6000.c (output_mi_thunk): Function to create thunks for MI. + (output_function_profiler): Use r12 for temp, instead of r11 so + that we preserve the static chain register. + +Fri Sep 25 14:18:33 1998 Jim Wilson + + * sdbout.c (sdbout_one_type): Don't look at TYPE_BINFO field of enums. + +Fri Sep 25 19:30:19 1998 J"orn Rennecke + + * sh.c (gen_shl_sext): Fix case 5. + +Fri Sep 25 17:35:23 1998 J"orn Rennecke + + * reload1.c (reload_combine): Re-add line that got accidentally lost. + +Fri Sep 25 10:43:47 1998 Kaveh R. Ghazi + + * cccp.c (pedwarn_with_file_and_line): For !__STDC__ case, avoid + accessing variables until they are initialized via va_arg(). + +Thu Sep 24 22:12:16 1998 David S. Miller + + * reload1.c (reload_combine): Initialize set before using. + +Thu Sep 24 18:53:20 1998 Jason Merrill + + * sdbout.c (sdbout_field_types): Don't emit the types of fields we + won't be emitting. + +Thu Sep 24 17:05:30 1998 Nick Clifton + + * config/arm/arm.md (insv): Add comment. In CONST_INT case, and + operand3 with mask before using it. Patch provided by Jim Wilson. + +Thu Sep 24 15:08:08 1998 Jakub Jelinek + + * config/sparc/sparc.c (function_value): Perform the equivalent of + PROMOTE_MODE for ARCH64. + (eligible_for_epilogue_delay): Allow DImode operations in delay + slot of a return for ARCH64. + +Thu Sep 24 22:17:54 1998 J"orn Rennecke + + * sh.md (sqrtsf2): Fix mode of sqrt. + +Thu Sep 24 21:48:51 1998 J"orn Rennecke + + * reload1.c (choose_reload_regs): Also try inheritance when + reload_in is a stack slot of a pseudo, even if we already got a + reload reg. + +Thu Sep 24 21:22:39 1998 J"orn Rennecke + + * reload1.c (reload_cse_regs_1): Renamed from reload_cse_regs. + (reload_cse_regs): New function body: call reload_cse_regs_1, + reload_combine, reload_cse_move2add. + When doing expensive_optimizations, call reload_cse_regs_1 a + second time after reload_cse_move2add. + (reload_combine, reload_combine_note_store): New functions. + (reload_combine_note_use): New function. + (reload_cse_move2add, move2add_note_store): New functions. + +Thu Sep 24 18:48:43 1998 J"orn Rennecke + + * reload.c (find_reloads): In code to promote RELOAD_FOR_X_ADDR_ADDR + reloads to RELOAD_FOR_X_ADDRESS reloads, test for reload sharing. + + Properly keep track of first RELOAD_FOR_X_ADDRESS also for + more than 3 such reloads. + + If there is not more than one RELOAD_FOR_X_ADDRESS, don't change + RELOAD_FOR_X_ADDR_ADDR reload. + +Thu Sep 24 17:45:55 1998 J"orn Rennecke + + * expr.c (store_constructor): When initializing a field that is smaller + than a word, at the start of a word, try to widen it to a full word. + + * cse.c (cse_insn): When we are about to change a register, + remove any invalid references to it. + + (remove_invalid_subreg_refs): New function. + (mention_regs): Special treatment for SUBREGs. + (insert_regs): Don't strip SUBREG for call to mention_regs. + Check if reg_tick needs to be bumped up before that call. + (lookup_as_function): Try to match known word_mode constants when + looking for a norrower constant. + (canon_hash): Special treatment for SUBREGs. + +Thu Sep 24 01:35:34 1998 David S. Miller + + * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Define. + * config/sparc/sparc.c (sparc64_initialize_trampoline): If that is + defined, emit libcall to __enable_execute_stack. Also fix opcodes + and offsets in actual stack trampoline code so they match the + commentary and actually work. + +Thu Sep 24 01:19:02 1998 Jakub Jelinek + + * configure.in (sparcv9-*-solaris): Use t-sol2 and t-sol2-64 for + tmake_file. + (sparc64-*-linux): Use t-linux and sparc/t-linux64 for + tmake_file. Set extra_parts to needed crt objects. + * configure: Rebuilt. + * config/sparc/linux64.h (SPARC_BI_ARCH): Define. + (TARGET_DEFAULT): Set if default is v9 or ultra. + (STARTFILE_SPEC32, STARTFILE_SPEC64): New macros. + (STARTFILE_SPEC): Set to those upon SPARC_BI_ARCH. + (ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_SPEC): Likewise. + (SUBTARGET_EXTRA_SPECS, LINK_ARCH32_SPEC, LINK_ARCH64_SPEC, + LINK_SPEC, LINK_ARCH_SPEC): Likewise. + (TARGET_VERSION): Define. + (MULTILIB_DEFAULT): Define. + * config/sparc/sparc.h (CPP_CPU_DEFAULT_SPEC): Rearrange so that + mixed 32/64 bit compilers based upon SPARC_BI_ARCH work. + (CPP_CPU64_DEFAULT_SPEC, CPP_CPU32_DEFAULT_SEC): Define + appropriately. + (TARGET_SWITCHES): Allow ptr32/ptr64 options once more. + * config/sparc/sparc.c (sparc_override_options): If arch and + pointer size disagree, emit diagnostic and fix it up. If + SPARC_BI_ARCH and TARGET_ARCH32, set cmodel to CM_32. Turn off + V8PLUS in 64-bit mode. + * config/sparc/t-linux64: New file. + * config/sparc/t-sol2-64: New file. + * config/sparc/t-sol2: Adjust build rules to use MULTILIB_CFLAGS. + * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Define. + (ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC, + CPP_CPU32_DEFAULT_SPEC, CPP_CPU64_DEFAULT_SPEC): Define. + (ASM_SPEC, CPP_CPU_SPEC): Set appropriately based upon those. + (STARTFILE_SPEC32, STARTFILE_SPEC32, STARTFILE_ARCH_SPEC): + Define. + (STARTFILE_SPEC): Set appropriately based upon those. + (CPP_CPU_DEFAULT_SPEC, ASM_CPU_DEFAULT_SPEC): Set based upon + disposition of DEFAULT_ARCH32_P. + (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC): Define. + (LINK_ARCH_SPEC, LINK_ARCH_DEFAULT_SPEC): Set based upon those. + (CC1_SPEC, MULTILIB_DEFAULTS): Set based upon DEFAULT_ARCH32_P. + (MD_STARTFILE_PREFIX): Set correctly based upon SPARC_BI_ARCH. + * config/sparc/xm-sysv4-64.h (HOST_BITS_PER_LONG): Only set on + arch64/v9. + * config/sparc/xm-sp64.h (HOST_BITS_PER_LONG): Likewise. + +Wed Sep 23 22:32:31 1998 Mark Mitchell + + * rtl.h (init_virtual_regs): New function. + * emit-rtl.c (init_virtual_regs): Define. + (insn_emit): Use it. + * integrate.c (save_for_inline_copying): Likewise. + +Wed Sep 23 16:22:01 1998 Nick Clifton + + * config/arm/thumb.h: The following patches were made by Jim Wilson: + (enum reg_class): Add NONARG_LO_REGS support. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, + PREFERRED_RELOAD_CLASS, SECONDARY_RELOAD_CLASS): Likewise. + (GO_IF_LEGITIMATE_ADDRESS): Disable REG+REG addresses before reload + completes. Re-enable HImode REG+OFFSET addresses. + (LEGITIMIZE_RELOAD_ADDRESS): Define. + + * expmed.c (extract_bit_field): Add comment from Jim Wilson. + +Wed Sep 23 13:26:02 1998 Richard Henderson + + * alpha.c (get_aligned_mem): Revert Sep 20 change. + (alpha_set_memflags, alpha_set_memflags_1): Likewise. + (alpha_align_insns): Properly calculate initial offset wrt max_align. + +Wed Sep 23 10:45:44 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (find_barrier): Revert change of Apr 23. Handle table + jumps as a single entity, taking into account the size of the + table. + +Tue Sep 22 15:13:34 1998 Alexandre Petit-Bianco + + * tree.def (SWITCH_EXPR): New tree node definition. + +Mon Sep 21 23:40:38 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 21 22:31:14 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 21 22:48:09 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Recognize i[34567]86-*-openbsd* and handle it like + NetBSD. + +Mon Sep 21 22:05:28 1998 Jeffrey A Law (law@cygnus.com) + + * Revert this patch. + * reload.c (find_reloads): Do not replace a pseudo with + (MEM (reg_equiv_addr)) in the initializing insn for the + pseudo. + +Mon Sep 21 20:19:41 1998 John Carr + + * final.c (final_scan_insn): Disable tracking CC across branches. + +Mon Sep 21 17:15:26 1998 Andrew MacLeod + + * expr.h (eh_rtime_match_libfunc): New extern declaration. + * optabs.c (init_optabs): Set eh_rtime_match_libfunc. + * except.c (start_catch_handler): Use eh_rtime_match_libfunc. + * libgcc2.c (__eh_rtime_match): Always return 0 if the matcher is + NULL. Only include if inhibit_libc is not defined. + +Mon Sep 21 14:10:51 1998 Jason Merrill + + * toplev.c (rest_of_compilation): Skip compiling anything with + DECL_EXTERNAL set, not just if it has DECL_INLINE as well. + +Mon Sep 21 13:51:05 1998 Jim Wilson + + * flow.c (find_basic_blocks): Delete check for in_libcall_block when + prev_code is a CALL_INSN. Change check for REG_RETVAL note to + use in_libcall_block. + (find_basic_blocks_1): Delete check for in_libcall_block when prev_code + is a CALL_INSN. If CALL_INSN and in_libcall_block, then change code + to INSN. + +Mon Sep 21 14:02:23 1998 Robert Lipe + + * i386.h (TARGET_SWITCHES): Improve doc for align-double. Fix + typo in no-fancy-math-387 description. + +Mon Sep 21 09:27:18 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 21 09:24:49 1998 Stan Cox + + * i386-coff.h (DBX_DEBUGGING_INFO): Added. + +Mon Sep 21 09:14:49 1998 Robert Lipe + + * i386.h (TARGET_SWITCHES): Add description fields for flags + documented in install.texi. + (TARGET_OPTIONS): Likewise. + +Mon Sep 21 01:39:03 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 21 01:53:05 1998 Felix Lee + + * c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT (). + * cccp.c (main): Likewise. + + * cccp.c, collect2.c, cpplib.c, gcc.c, config/i386/xm-cygwin32.h: + Rename GET_ENVIRONMENT to GET_ENV_PATH_LIST, and fix some + macro-use bugs. + +Mon Sep 21 00:52:12 1998 Per Bothner + + * Makefile.in (LIBS): Link in libiberty.a. + * c-common.c, gcc.c, toplev.c: Replace (some) bcopy calls by memcpy. + +Sun Sep 20 23:28:11 1998 Richard Henderson + + * reload1.c (emit_reload_insns): Accept a new arg for the bb. Use + it to update bb boundaries. Update caller. + * function.c (reposition_prologue_and_epilogue_notes): Update + bb boundaries wrt the moved note. + +Sun Sep 20 20:57:02 1998 Robert Lipe + + * configure.in (i*86-*-sysv5*): Use fixinc.svr4 to patch byteorder + problems. + * configure: Regenerate. + +Sun Sep 20 19:01:51 1998 Richard Henderson + + * alpha.c (alpha_sr_alias_set): New variable. + (override_options): Set it. + (alpha_expand_prologue, alpha_expand_epilogue): Use it. + (mode_mask_operand): Fix signed-unsigned comparison warning. + (alpha_expand_block_move): Likewise. + (print_operand): Likewise. + (get_aligned_mem): Use change_address. + (alpha_set_memflags, alpha_set_memflags_1): Set the alias set. + (alphaev4_insn_pipe, alphaev4_next_group): New functions. + (alphaev4_next_nop, alphaev5_next_nop): New functions. + (alpha_align_insns): Remade from old alphaev5_align_insns + to handle multiple processors. + (alpha_reorg): Call alpha_align_insns for both ev4 and ev5. + * output.h (label_to_alignment): Prototype. + + * tree.c (new_alias_set): New function. + * tree.h (new_alias_set): Declare it. + * c-common.c (c_get_alias_set): Use it. + +Sun Sep 20 12:35:55 1998 Richard Henderson + + * fold-const.c (fold): Yet another COND_EXPR bug: when folding + to an ABS expr, convert an unsigned input to signed. + +Sun Sep 20 12:14:45 1998 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (fold): Fix another type in COND_EXPR handling code. + +1998-09-20 Michael Hayes + + * configure.in: Add support for c4x targets. + * configure: Rebuilt. + +Sun Sep 20 00:00:51 1998 Richard Henderson + + * combine.c (distribute_notes): If an insn is a cc0 user, only + delete it if we can also delete the cc0 setter. + +Sun Sep 20 00:22:23 1998 Michael Tiemann + + * fold-const.c (fold): Fix typo in COND_EXPR handling code. + (invert_truthvalue): Enable truthvalue inversion for + floating-point operands if -ffast-math. + +Sat Sep 19 23:58:07 1998 Melissa O'Neill + + * configure.in: Disable collect2 for nextstep. Instead use + crtbegin/crtend. + * configure: Rebuilt. + * config/nextstep.h (STARTFILE_SPEC): Add crtbegin. + (ENDFILE_SPEC): Define. + (OBJECT_FORMAT_MACHO): Define. + (EH_FRAME_SECTION_ASM_OP): Define. + * crtstuff.c: Handle MACHO. + +Sun Sep 20 00:24:24 1998 Robert Lipe + + * config/i386/sco5.h (TARGET_MEM_FUNCTIONS): Define. + +1998-09-19 Torbjorn Granlund + + * fp-bit.c (pack_d): Do not clear SIGN when fraction is 0. + (_fpadd_parts): Get sign right for 0. + +1998-09-19 Michael Hayes + + * ginclude/varargs.h: Add support for C4x target. + * ginclude/stdargs.h: Likewise. + +Sat Sep 19 12:05:09 1998 Richard Henderson + + * alpha.c (alpha_return_addr): SET should be VOIDmode. + (alpha_emit_set_long_const): Rewrite to be callable from reload + and 32-bit hosts. + (alpha_expand_epilogue): Update for alpha_emit_set_long_const. + * alpha.md (movdi): Likewise. + +Sat Sep 19 07:33:36 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (add_constant): New parameter address_only, change caller. + Set it nonzero if taking the address of an item in the pool. + (arm_reorg): Handle cases where we need the address of an item in + the pool. + + * arm.c (bad_signed_byte_operand): Check both arms of a sum in + a memory address. + * arm.md (splits for *extendqihi_insn and *extendqisi_insn): Handle + memory addresses that are not in standard canonical form. + +Sat Sep 19 01:00:32 1998 Michael Hayes (mph@elec.canterbury.ac.nz) + + * README.C4X: New file with information about the c4x ports. + * ginclude/va-c4x.h: New file for c4x varargs support. + * config/c4x: New directory with c4x port files. + +Fri Sep 18 22:52:05 1998 Jeffrey A Law (law@cygnus.com) + + * reload.c (find_reloads): Do not replace a pseudo with + (MEM (reg_equiv_addr)) in the initializing insn for the + pseudo. + +Fri Sep 18 23:50:56 1998 David Edelsohn + + * toplev.c (rest_of_compilation): Set bct_p on second call to + loop_optimize. + * loop.c (loop_optimize, scan_loop, strength_reduce): New argument + bct_p. + (strength_reduce): Only call analyze_loop_iterations and + insert_bct if bct_p set. + (check_dbra_loop): Fix typo. + (insert_bct): Use word_mode instead of SImode. + (instrument_loop_bct): Likewise. Do not delete iteration count + condition code generation insn. Initialize iteration count before + loop start. + * rtl.h (loop_optimize): Update prototype. + + * ginclude/va-ppc.h (va_arg): longlong types in overflow area are + not doubleword aligned. + + * rs6000.c (optimization_options): New function. + (secondary_reload_class): Only call true_regnum for PSEUDO_REGs. + * rs6000.h (OPTIMIZATION_OPTIONS): Define. + (REG_ALLOC_ORDER): Allocate highest numbered condition regsiters + first; cr1 can be used for FP record condition insns. + +Fri Sep 18 09:44:55 1998 Nick Clifton + + * config/m32r/m32r.h (m32r_block_immediate_operand): Add to + PREDICATE_CODES. + + * config/m32r/m32r.md: Add "movstrsi" and "movstrsi_internal" + patterns. + + * config/m32r/m32r.c (m32r_print_operand): Add 's' and 'p' + operators. + (block_move_call): New function: Call a library routine to copy a + block of memory. + (m32r_expand_block_move): New function: Expand a "movstrsi" + pattern into a sequence of insns. + (m32r_output_block_move): New function: Expand a + "movstrsi_internal" pattern into a sequence of assembler opcodes. + (m32r_block_immediate_operand): New function: Return true if the + RTL is an integer constant, less than or equal to MAX_MOVE_BYTES. + +Thu Sep 17 16:42:16 1998 Andrew MacLeod + + * except.c (start_catch_handler): Issue 'fatal' instead of 'error' and + re-align some code. + * libgcc2.c (__eh_rtime_match): fprintf a runtime error. Use . + +Thu Sep 17 12:24:33 1998 J"orn Rennecke + + * regmove.c (copy_src_to_dest): Check that modes match. + +Wed Sep 16 22:10:42 1998 Robert Lipe + + * config/i386/sco5.h (SUPPORTS_WEAK): True only if targeting ELF. + +Wed Sep 16 15:24:54 1998 Richard Henderson + + * i386.h (PREFERRED_RELOAD_CLASS): Respect an existing class + narrower than FLOAT_REGS. + +Wed Sep 16 17:51:00 1998 Alexandre Oliva + + * cpplib.c: Removed OLD_GPLUSPLUS_INCLUDE_DIR. + * cccp.c: Likewise. + * Makefile.in (old_gxx_include_dir): Removed. + +Wed Sep 16 12:29:22 1998 Nick Clifton + + * config/sh/sh.h: Update definition of HANDLE_PRAGMA to match + new specification. + + * config/sh/sh.c (handle_pragma): Rename to sh_handle_pragma(). + (sh_handle_pragma): Change function arguments to match new + specification for HANDLE_PRAGMA. + +Wed Sep 16 12:43:19 1998 Kaveh R. Ghazi + + * gen-protos.c (parse_fn_proto): Cast argument of ISALNUM to + `unsigned char'. + (main): Mark parameter `argc' with ATTRIBUTE_UNUSED. + When generating output, initialize missing struct member to zero. + +Wed Sep 16 14:47:43 1998 J"orn Rennecke + + * regmove.c (copy_src_to_dest): Don't copy if that requires + (a) new register(s). + +Wed Sep 16 01:29:12 1998 Bernd Schmidt + + * global.c (reg_allocno): Now static. + * reload1.c (reg_allocno): Delete declaration. + (order_regs_for_reload): Take no arguments. Don't treat regs + allocated by global differently than those allocated by local-alloc. + +Wed Sep 16 01:09:01 1998 Kamil Iskra + + * m68k/m68k.c (output_function_prologue): Reverse NO_ADDSUB_Q + condition, fix format strings. + (output_function_epilogue): Likewise. + + * m68k/m68k.c: Don't include directly. + +Wed Sep 16 00:30:56 1998 Geoff Keating + + * gcse.c: New definition NEVER_SET for reg_first_set, reg_last_set, + mem_first_set, mem_last_set; because 0 can be a CUID. + (oprs_unchanged_p): Use new definition. + (record_last_reg_set_info): Likewise. + (record_last_mem_set_info): Likewise. + (compute_hash_table): Likewise. + +Tue Sep 15 22:59:52 1998 Jeffrey A Law (law@cygnus.com) + + * rs6000.c (output_epilogue): Handle Chill. + + * mn10200.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define. + * mn10300.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define. + + * combine.c (make_extraction): If no mode is specified for + an operand of insv, extv, or extzv, default it to word_mode. + (simplify_comparison): Similarly. + * expmed.c (store_bit_field): Similarly. + (extract_bit_field): Similarly. + * function.c (fixup_var_regs_1): Similarly. + * recog.c (validate_replace_rtx_1): Similarly. + * mips.md (extv, extzv, insv expanders): Default modes for most + operands. Handle TARGET_64BIT. + (movdi_uld, movdi_usd): New patterns. + + * pa.c (emit_move_sequence): Do not replace a pseudo with its + equivalent memory location unless we have been provided a scratch + register. Similarly do not call find_replacement unless a + scratch register has been provided. + +Tue Sep 15 19:23:01 1998 Bernd Schmidt + + * i386.h (PREFERRED_RELOAD_CLASS): For standard 387 constants, + return FLOAT_REGS. + +Tue Sep 15 19:09:06 1998 Richard Henderson + + * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. + (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. + (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. + (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. + * c-decl.c (init_decl_processing): Update accordingly. + * expr.c (expand_builtin): Likewise. + + * rtl.h (global_rtl): Add cfa entry. + (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. + (LAST_VIRTUAL_REGISTER): Update. + * emit-rtl.c (global_rtl): Add cfa entry. + (init_emit): Initialize it. + * function.c (cfa_offset): New. + (instantiate_virtual_regs): Initialize it. + (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. + (expand_function_end): Call expand_eh_return. + * tm.texi (ARG_POINTER_CFA_OFFSET): New. + + * except.c (current_function_eh_stub_label): Kill. + (current_function_eh_old_stub_label): Likwise; update all references. + (expand_builtin_set_return_addr_reg): Kill. + (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. + (expand_builtin_set_eh_regs): Kill. + (eh_regs): Produce a third reg for the actual handler address. + (eh_return_context, eh_return_stack_adjust): New. + (eh_return_handler, eh_return_stub_label): New. + (init_eh_for_function): Initialize them. + (expand_builtin_eh_return, expand_eh_return): New. + * except.h: Update prototypes. + * flow.c (find_basic_blocks_1): Update references to the stub label. + * function.h (struct function): Kill stub label elements. + + * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the + register number is one that would be in the previous window. + Provide a dummy definition for non-windowed targets. + (get_reg_addr): New function. + (get_reg, put_reg, copy_reg): Use it. + (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub + generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. + + * alpha.c (alpha_eh_epilogue_sp_ofs): New. + (alpha_init_expanders): Initialize it. + (alpha_expand_epilogue): Use it. + * alpha.h: Declare it. + * alpha.md (eh_epilogue): New. + + * m68h.h (ARG_POINTER_CFA_OFFSET): New. + * sparc.h (ARG_POINTER_CFA_OFFSET): New. + +Tue Sep 15 19:31:58 1998 Michael Meissner + + * i960.h (CONST_COSTS): Fix thinko. Test flag, not the constant + flag bit mask. + +Tue Sep 15 14:10:54 1998 Andrew MacLeod + + * except.h (struct eh_entry): Add false_label field. + (end_catch_handler): Add prototype. + * except.c (push_eh_entry): Set false_label field to NULL_RTX. + (start_catch_handler): When using old style exceptions, issue + runtime typematch code before continuing with the handler. + (end_catch_handler): New function, generates label after handler + if needed by older style exceptions. + (expand_start_all_catch): No need to check for new style exceptions. + (output_exception_table_entry): Only output the first handler label + for old style exceptions. + * libgcc2.c (__eh_rtime_match): New routine to lump runtime matching + mechanism into one function, if a runtime matcher is provided. + +Tue Sep 15 13:53:59 1998 Andrew MacLeod + + * config/i960/i960.h (SLOW_BYTE_ACCESS): Change definition to 1. + +Tue Sep 15 09:59:01 1998 Mark Mitchell + + * integrate.c (copy_decl_list): Fix typo. + +Tue Sep 15 04:18:52 1998 David S. Miller + + * config/sparc/sparc.md (movdf_const_intreg_sp32): Fix length + attribute. + +Mon Sep 14 14:02:53 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 14 10:33:56 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Sep 14 09:51:05 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Sep 13 22:10:18 1998 David S. Miller + + * invoke.texi (C Dialect Options): Put back missing @end itemize. + +Mon Sep 14 02:33:46 1998 Alexandre Oliva + + * configure.in: Remove usage of `!' to negate the result of a + command; some common shells do not support it. + +Sun Sep 13 19:17:35 1998 David S. Miller + + * configure.in: In sparc9-sol2 config, use 'if test' not + brackets. + * configure: Rebuilt. + + * config/sparc/sol2-sld-64.h (SPARC_DEFAULT_CMODEL): Change to + CM_MEDANY. + (CPP_CPU_SPEC): Do not define _LP64, header files do this. + (CPP_CPU_DEFAULT_SPEC): Likewise. + * config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Get the names right + for arch64 libfuncs. + + * config/sparc/sparc.md (goto_handler_and_restore): Allow any mode + for operand zero. + +Sun Sep 13 09:11:59 1998 Kaveh R. Ghazi + + * acconfig.h (NEED_DECLARATION_STRSIGNAL): Provide a stub. + + * collect2.c: Don't declare `sys_siglist' here. + (my_strsignal): Prototype and define new function. Use it in + place of `sys_siglist' hacks. + + * mips_tfile.c: Likewise. + + * configure.in (AC_CHECK_FUNCS): Check for strsignal. + (GCC_NEED_DECLARATIONS): Likewise. + + * system.h (strsignal): Prototype it, if necessary. + (sys_siglist): Declare it, if necessary. + +Sun Sep 13 04:37:28 1998 David S. Miller + + * loop.c (move_movables): While removing insn sequences, preserve + the next pointer of the most recently deleted insn when we skip + over a NOTE. + +Sun Sep 13 08:13:39 1998 Ben Elliston + + * objc/config-lang.in: Do not output the name of the selected + thread file when building the front-end. The Makefile for the + runtime library will do this. + + * objc/Make-lang.in: Do not build the runtime library or install + the Objective-C header files. The Makefile for the runtime + library will do this. + + * objc/Makefile.in (all.indirect): Only build the front-end. + (compiler): Rename to `frontend'. + (obj-runtime): Remove target. + (copy-headers): Likewise. + (clean): No need to remove `libobjc.a' any longer. + +Sat Sep 12 11:37:19 1998 Michael Meissner + + * rs6000.h ({ASM,CPP}_CPU_SPEC): Add support for all machines + supported with -mcpu=xxx. + +Fri Sep 11 23:55:54 1998 David S. Miller + + * flow.c (mark_set_1): Recognize multi-register structure return + values in CALL insns. + (mark_used_regs): Likewise. + (count_reg_sets_1): Likewise. + (count_reg_references): Likewise. + * rtlanal.c (note_stores): Likewise. + (reg_overlap_mentioned_p): Likewise. + * haifa-sched.c (check_live_1): Likewise. + (update_live_1): Likewise. + (sched_analyze_1): Likewise. + (sched_note_set): Likewise. + (birthing_insn_p): Likewise. + (attach_deaths): Likewise. + + * config/sparc/sparc.md (movdf_const_intreg_sp64): Disable. + +Fri Sep 11 22:57:55 1998 Eric Dumazet + + * config/i386/sco5.h (ASM_WEAKEN_LABEL): Defined as in svr4.h. + +Thu Sep 10 22:02:04 1998 David S. Miller + + * glimits.h (__LONG_MAX__): Recognize __sparcv9 too. + +Thu Sep 10 21:19:10 1998 Jakub Jelinek + + * configure.in: Add check for GAS subsection -1 support. + * acconfig.h (HAVE_GAS_SUBSECTION_ORDERING): Add. + * configure config.in: Rebuilt. + * config/sparc/sparc.h (CASE_VECTOR_MODE): For V9 flag_pic, use + SImode is subsection -1 works, else use DImode. + (ASM_OUTPUT_ADDR_VEC_START, ASM_OUTPUT_ADDR_VEC_END): Define if + subsection -1 works. + * config/sparc/sparc.c (sparc_output_addr_vec, + sparc_output_addr_diff_vec): Use them if defined. + +Thu Sep 10 10:46:01 1998 Mark Mitchell + + * tree.h (DECL_ORIGIN): New macro. + * integrate.c (copy_and_set_decl_abstract_origin): New function. + (copy_decl_list): Use it. + (integrate_parm_decls): Likewise. + (integrate_decl_tree): Likewise. + * dwarf2out.c (decl_ultimate_origin): Simplify. + * dwarfout.c (decl_ultimate_origin): Likewise. + * c-decl.c (duplicate_decls): Use DECL_ORIGIN. + (pushdecl): Likewise. + +Thu Sep 10 08:01:31 1998 Anthony Green + + * config/rs6000/rs6000.c (output_epilog): Add Java support. + +Thu Sep 10 14:48:59 1998 Martin von Löwis + + * invoke.texi (C++ Dialect Options): Document -fhonor-std. + +Thu Sep 10 01:38:05 1998 Jeffrey A Law (law@cygnus.com) + + * reg-stack.c (straighten_stack): Do nothing if the virtual stack is + empty or has a single entry. + + * toplev.c (rest_of_compilation): Open up the dump file for reg-stack + before calling reg_to_stack. + +Thu Sep 10 00:03:34 1998 Richard Henderson + + * alpha.c (alphaev5_insn_pipe): Abort on default case. + (alphaev5_next_group): Swallow CLOBBERs and USEs. + + * c-tree.h (warn_long_long): Declare it. + +Wed Sep 9 23:31:36 1998 (Stephen L Moshier) + + * emit-rtl.c (gen_lowpart_common): Disable optimization of + initialized float-int union if the value is a NaN. + +Wed Sep 9 23:00:48 1998 Nathan Sidwell + + * c-lex.c (real_yylex): Don't warn about long long constants if + we're allowing long long + +Wed Sep 9 21:58:41 1998 Bernd Schmidt + + * except.h (current_function_eh_stub_label): Declare. + (current_function_eh_old_stub_label): Declare. + * function.h (struct function): New members eh_stub_label and + eh_old_stub_label. + * except.c (current_function_eh_stub_label): New variable. + (current_function_eh_old_stub_label): New variable. + (init_eh_for_function): Clear them. + (save_eh_status): Save them. + (restore_eh_status): Restore them. + (expand_builtin_eh_stub): Set current_function_eh_stub_label. + (expand_builtin_eh_stub_old): Set current_function_eh_old_stub_label. + * flow.c (find_basic_blocks_1): When handling a REG_LABEL note, don't + make an edge from the block that contains it to the block starting + with the label if this label is one of the eh stub labels. + If eh stub labels exist, show they are reachable from the last block + in the function. + + * reload1.c (reload): Break out several subroutines and make some + variables global. + (calculate_needs_all_insns): New function, broken out of reload. + (calculate_needs): Likewise. + (find_reload_regs): Likewise. + (find_group): Likewise. + (find_tworeg_group): Likewise. + (something_needs_reloads): New global variable, formerly in reload. + (something_needs_elimination): Likewise. + (caller_save_spill_class): Likewise. + (caller_save_group_size): Likewise. + (max_needs): Likewise. + (group_size): Likewise. + (max_groups): Likewise. + (max_nongroups): Likewise. + (group_mode): Likewise. + (max_needs_insn): Likewise. + (max_groups_insn): Likewise. + (max_nongroups_insn): Likewise. + (failure): Likewise. + + * print-rtl.c (print_rtx): For MEMs, print MEM_ALIAS_SET. + +Wed Sep 9 13:14:41 1998 Richard Henderson + + * loop.c (load_mems): Copy rtx for output mem. + +Wed Sep 9 15:16:58 1998 Gavin Romig-Koch + + * mips/abi64.h (LONG_MAX_SPEC): Don't set LONG_MAX for + mips1 or mips2 either. + +Wed Sep 9 12:31:35 1998 Jeffrey A Law (law@cygnus.com) + + * pa.c (pa_reorg): New marking scheme for jumps inside switch + tables. + (pa_adjust_insn_length): Update to work with new marking scheme + for jumps inside switch tables. + * pa.md (switch_jump): Remove pattern. + (jump): Handle jumps inside jump tables. + + * Makefile.in (profile.o): Depend on insn-config.h + +Wed Sep 9 09:36:51 1998 Jim Wilson + + * iris6.h (DWARF2_UNWIND_INFO): Undef. + +Wed Sep 9 01:32:01 1998 David S. Miller + + Add preliminary native sparcv9 Solaris support. + * configure.in: Recognize sparv9-*-solaris2* + * configure: Rebuilt. + * config.sub: Recognize sparcv9 just like sparc64. + * config/sparc/sol2-c1.asm config/sparc/sol2-ci.asm + config/sparc/sol2-cn.asm: Macroize so it can be shared between + 32-bit and 64-bit Solaris systems. + * config/sparc/t-sol2: Assemble those with cpp. + * config/sparc/sparc.h (TARGET_CPU_sparcv9): New alias for v9. + (*TF*_LIBCALL): If ARCH64 use V9 names. + * config/sparc/{xm-sysv4-64,sol2-sld-64}.h: New files. + +Wed Sep 9 01:07:30 1998 Jakub Jelinek + + * config/sparc/sparc.h (TARGET_CM_MEDMID): Fix documentation. + (CASE_VECTOR_MODE): Set to SImode even if PTR64, when MEDLOW and + not doing pic. + (ASM_OUTPUT_ADDR_{VEC,DIFF}_ELT): Check CASE_VECTOR_MODE not + Pmode. + * config/sparc/sparc.md (tablejump): Likewise, and sign extend op0 + to Pmode if CASE_VECTOR_MODE is something else. + +Wed Sep 9 00:10:31 1998 Jeffrey A Law (law@cygnus.com) + + * prefix.c (update_path): Correctly handle cases where PATH is + a substring of the builtin prefix, but specifies a different + directory location. + +Tue Sep 8 23:46:04 1998 Hans-Peter Nilsson + + * expr.c: Corrected comment about what MOVE_RATIO does. + * config/alpha/alpha.h: Likewise. + * config/1750a/1750a.h: Likewise. + * config/clipper/clipper.h: Likewise. + * config/i386/i386.h: Likewise. + +Tue Sep 8 22:56:12 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (m68k-next-nextstep3*): Use collect2. + Similarly for x86 NeXT configurations. + * configure: Rebuilt. + +Tue Sep 8 01:38:57 1998 Nathan Sidwell + + * configure.in: Don't assume srcdir is .../gcc. + * configure: Rebuilt. + +Sat Sep 5 16:34:34 1998 John Wehle (john@feith.com) + + * global.c: Update comments. + (global_alloc): Assign allocation-numbers + even for registers allocated by local_alloc in case + they are later spilled and retry_global_alloc is called. + (mark_reg_store, mark_reg_clobber, + mark_reg_conflicts, mark_reg_death): Always record a + conflict with a pseudo register even if it has been + assigned to a hard register. + (dump_conflicts): Don't list pseudo registers already assigned to + a hard register as needing to be allocated, but do list their + conflicts. + * local-alloc.c: Update comment. + +Mon Sep 7 23:38:01 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Check for bogus GCC_EXEC_PREFIX and LIBRARY_PATH. + * configure: Rebuilt. + +Mon Sep 7 22:41:46 1998 Michael Meissner + + * rs6000.c (rs6000_override_options): Fix name for ec603e, to add + missing 'c'. + * t-ppccomm (MULTILIB_MATCHES_FLOAT): Add support for -mcpu=xxx + for all targets that set -msoft-float. + +Mon Sep 7 23:30:07 1998 Kaveh R. Ghazi + + * toplev.c (print_switch_values): Make static to match prototype. + +Mon Sep 7 19:13:59 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: If we are unable to find the "gnatbind" program, + then do not configure the ada subdir. + * configure: Rebuilt. + +Sun Sep 6 14:03:58 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Sep 6 13:28:07 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Sep 6 08:54:14 1998 Kaveh R. Ghazi + + * Makefile.in (toplev.o): Depend on $(EXPR_H). + (insn-extract.o, insn-attrtab.o): Depend on toplev.h. + + * gansidecl.h: Define ATTRIBUTE_NORETURN. + + * genattrtab.c: Have insn-attrtab.c include toplev.h. + + * genextract.c: Have insn-extract.c include toplev.h. + + * rtl.h: Don't prototype `fatal_insn_not_found' and `fatal_insn'. + + * toplev.c: Include expr.h. + (really_sorry, fancy_abort): Remove prototypes. + (set_target_switch): Add argument in prototype. + (vfatal): Mark prototype with ATTRIBUTE_NORETURN. + (v_really_sorry): Likewise. + (print_version, print_single_switch, print_switch_values): Make + static and add prototype arguments. + (decl_printable_name): Add prototype arguments. + (lang_expand_expr_t): New typedef. + (lang_expand_expr): Declare as a lang_expand_expr_t. + (incomplete_decl_finalize_hook): Add prototype argument. + (decl_name): Mark variable `verbosity' with ATTRIBUTE_UNUSED. + (botch): Likewise for variable `s'. + (rest_of_type_compilation): Mark variables `type' and `toplev' + with ATTRIBUTE_UNUSED if none of DBX_DEBUGGING_INFO, + XCOFF_DEBUGGING_INFO or SDB_DEBUGGING_INFO are defined. + (display_help): Make variable `i' an `unsigned long'. + (main): Remove unused parameter `envp'. + Cast assignment to `lang_expand_expr' to a `lang_expand_expr_t'. + Cast -1 when comparing it with a `size_t'. + + * toplev.h (fatal, fatal_io_error, pfatal_with_name): Mark + prototype with ATTRIBUTE_NORETURN. + (fatal_insn_not_found, fatal_insn, really_sorry, + push_float_handler, pop_float_handler): Add prototypes. + (fancy_abort): Mark prototype with ATTRIBUTE_NORETURN. + (do_abort, botch): Add prototypes. + +Sat Sep 6 12:05:18 1998 John Carr + + * final.c (final): If a label is reached only from a single jump, + call NOTICE_UPDATE_CC on the jump and its predecessor before + emitting the insn after the label. + + * i386.h: Add AMD K6 support. + Change TARGET_* macros to use table lookup. + (INITIALIZE_TRAMPOLINE): Improve trampoline code. + (ADJUST_COST): Change definition to call function in i386.c. + (ISSUE_RATE): Define as 2 for anything newer than an 80486. + * i386.c: Add AMD K6 support. + Add constants for feature tests used by TARGET_* macros. + (split_di): If before reload, call gen_lowpart and gen_highpart. + (x86_adjust_cost): New function. + (put_jump_code): New function. + (print_operand): New codes 'D' and 'd'. + * i386.md: New insn types. New insn attribute "memory". + Redefine scheduling parameters to use new types and add AMD K6 + support. Explicitly set type of most insns. + (move insns): K6 prefers movl $0,reg to xorl reg,reg. Pentium + Pro and K6 prefer movl $1,reg to incl reg. + (adddi3, subdi3): Set cc_status. + (DImode shift patterns): Change label counters from HOST_WIDE_INT + to int; x86 can't have more than 2^31 DImode shifts per file. + (setcc): Combine all setcc patterns. Allow writing memory. + Combine all jump patterns using match_operator. + (*bzero): Name pattern. Emit multiple stos instructions when that + is faster than rep stos. + (xordi3, anddi3, iordi3): Simplify DImode logical patterns and + add define_split. + +Sun Sep 6 11:17:20 1998 Dave Love + + * config/m68k/x-next (BOOT_LDFLAGS): Define suitably for f771 + linking. + +Sat Sep 5 22:05:25 1998 Richard Henderson + + * alpha.c (alpha_ra_ever_killed): Inspect the topmost sequence, + not whatever we're generating now. + + * alpha.c (set_frame_related_p, FRP): New. + (alpha_expand_prologue): Mark frame related insns. + (alpha_expand_epilogue): Likewise, but with a null FRP. + * alpha.h (INCOMING_RETURN_ADDR_RTX): New. + * alpha.md (exception_receiver): New. + * alpha/crtbegin.asm (.eh_frame): New beginning. + (__do_frame_setup, __do_frame_takedown): New. + * alpha/crtend.asm (.eh_frame): New ending. + * alpha/elf.h (DWARF2_DEBUGGING_INFO): Define. + (ASM_SPEC): Don't emit both dwarf2 and mdebug. + (ASM_FILE_START): Don't emit .file for dwarf2. + + * rtl.h (enum reg_note): Add REG_FRAME_RELATED_EXPR. + * rtl.c (reg_note_name): Likewise. + * rtl.texi (REG_NOTES): Likewise. + * dwarf2out.c (dwarf2out_frame_debug): Use it. Recognize a store + without an offset. + +Sat Sep 5 14:47:17 1998 Richard Henderson + + * i386.h (PREFERRED_RELOAD_CLASS): Standard fp constants load to TOS. + * i386.md (movsf, movdf, movxf): Validate memory address returned + from force_const_mem. Kill useless REG_EQUAL setting code. + +Sat Sep 5 14:23:31 1998 Torbjorn Granlund + + * m68k.md (zero_extendsidi2): Fix typo. + +Sat Sep 5 13:40:24 1998 Krister Walfridsson + + * configure.in: Removed references to the removed file. + * config/xm-netbsd.h: Use ${cpu_type}/xm-netbsd.h for + arm*-*-netbsd* and ns32k-*-netbsd*. + * config/i386/xm-netbsd.h: Removed unnecessary file. + * config/m68k/xm-netbsd.h: Likewise. + * config/sparc/xm-netbsd.h: Likewise. + * config/mips/xm-netbsd.h: Likewise. + +Sat Aug 29 13:32:58 1998 Mumit Khan + + * i386/cygwin32.h (BIGGEST_ALIGNMENT): Define. + (PCC_BITFIELD_TYPE_MATTERS): Define to be 0. + + * i386/cygwin32.h (ASM_OUTPUT_SECTION_NAME): Don't check for + for exact section attributions. + + * i386/mingw32.h (CPP_PREDEFINES): Add __MSVCRT__ for msvc + runtime. + * i386/crtdll.h (CPP_PREDEFINES): Define. + +Sat Sep 5 03:23:05 1998 Jeffrey A Law (law@cygnus.com) + + * m68k.md (5200 movqi): Do not allow byte sized memory references + using address regs. + * m68k.c (output_move_qimode): Do not use byte sized operations on + address registers. + + * Makefile.in (pexecute.o): Use pexecute.c from libiberty. Provide + explicit rules for building. Similarly for alloca, vfprintf, + choose-temp and mkstemp, getopt, getopt1, and obstack. + (INCLUDES): Add $(srcdir)/../include. + * pexecute.c, alloca.c, vfprintf.c, choose-temp.c, mkstemp.c: Delete. + * getopt.h, getopt.c getopt1.c, obstack.c, obstack.h: Likewise. + +Fri Sep 4 11:57:50 1998 Tom Tromey + + * gcc.c (do_spec_1): [case 'o'] Account for + lang_specific_extra_outfiles. + (main): Correctly clear all slots in outfiles for + lang_specific_extra_outfiles. Set input_file_number before + calling lang_specific_pre_link. + +Fri Sep 4 10:37:07 1998 Jim Wilson + + * loop.c (load_mems): Fix JUMP_LABEL field after for_each_rtx call. + +Fri Sep 4 02:01:05 1998 David S. Miller + + * config/sparc/sparc.c (output_double_int): In all V9 symbolic + cases, use xword. + (sparc_output_deferred_case_vectors): If no work to do, return. + Fix thinko in Sept 1 change. + +1998-09-03 SL Baur + + * Makefile.in: Add semicolon in BISON definition for portability. + +Thu Sep 3 13:34:41 1998 Toon Moene + + * config/nextstep.c (handle_pragma): Correct name of third + argument. + +Tue Sep 1 11:30:33 1998 Nick Clifton + + * config/m32r/m32r.md: Change (reg:CC 17) to (reg:SI 17). + * config/m32r/m32r.h: Make register 17 be fixed. + * config/m32r/m32r.c: Use SImode for cc operations. + +Thu Sep 3 18:17:34 1998 Benjamin Kosnik + + * invoke.texi (Warning Options): Add -Wnon-template-friend + documentation. + +Thu Sep 3 18:16:16 1998 Michael Meissner + + * rs6000.c (rs6000_override_options): Add -mcpu={401,e603e}. + +Thu Sep 3 18:05:16 1998 David Edelsohn + + * rs6000.md (movsf): Disable explicit secondary-reload-like + functionality if TARGET_POWERPC64. + (movdf): Remove TARGET_POWERPC64 explicit secondary-reload-like + functionality. + +Thu Sep 3 11:41:40 1998 Robert Lipe + + * fixinc.sco: Borrow code to wrap 'bool' typedefs from tinfo.h + and term.h from fixinc.wrap. + +Thu Sep 3 09:47:31 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_HEADER_STRING): New macro to detect if it is + safe to include both string.h and strings.h together. + (GCC_NEED_DECLARATION): Test STRING_WITH_STRINGS when deciding + which headers to search for function declarations. Continue to + prefer string.h over strings.h when both are not acceptable. + + * acconfig.h (STRING_WITH_STRINGS): Add stub. + + * configure.in: Call GCC_HEADER_STRING. + + * system.h: Test STRING_WITH_STRINGS when deciding which headers + to include. Continue to prefer string.h over strings.h when both + are not acceptable. + +Wed Sep 2 23:56:29 1998 David S. Miller + + * config/sparc/sparc.c (output_double_int): If V9 and MEDLOW, do + not assume top 32-bits of symbolic addresses are zero if + flag_pic. + +Thu Sep 3 00:23:21 1998 Richard Henderson + + * ginclude/va-alpha.h: Protect entire second portion of the + file against double inclusion. + +Thu Sep 3 00:37:55 1998 Ovidiu Predescu + + Added support for the Boehm's garbage collector. + * configure.in: Handle --enable-objc-gc. + * configure: Rebuilt. + * Makefile.in (CHECK_TARGETS): Add check-objc. + (check-objc): New rule. + * objc/Make-lang.in: Build a different Objective-C library that + runs with the Boehm's collector. + * objc/encoding.c (objc_round_acc_size_for_types): New function. + * objc/encoding.c: Correctly compute the size of compound types in + the presence of bitfields. Skip the variable name of the type if + any. Added support for long long. + * objc/encoding.h (_C_GCINVISIBLE): New specifier. + (_F_GCINVISIBLE): New mask. + * objc/gc.c: New file. Compute the type memory mask associated with + a class based on the runtime information. + * objc/misc.c: Added the hooks that use the Boehm's collector + allocation functions. + * objc/objc-act.c (build_class_template): Generate a new class + member (gc_object_type) to hold the class' type memory mask. + (build_shared_structure_initializer): Initialize the new member to + NULL. + (encode_complete_bitfield): New function. Generate the new + encoding. + (encode_field_decl): Generate the new encoding only for the GNU + runtime. + * objc/objc-api.h (_C_LNG_LNG, _C_ULNG_LNG): New specifiers for the + long long types. + (class_get_gc_object_type): New function to mark a pointer instance + variable as a weak pointer. + * objc/objc-features.texi: New file. + * objc/objc.h (gc_object_type): New class member. + * objc/objects.c (class_create_instance): Create a typed memory + object when compiled with Boehm's collector support. + * objc/sendmsg.c (__objc_init_install_dtable): Call + __objc_send_initialize instead of setting the initialize flag. + (__objc_send_initialize): Call __objc_generate_gc_type_description + to generate the class type memory mask. Rewrite the code that + sends the +initialize so that it is called only once (bug report + and fix from Ronald Pijnacker ). + * testsuite/objc: New testsuite for Objective-C type encoding. + * testsuite/lib/objc-torture.exp: New file. + * testsuite/lib/objc.exp: New file. + +Wed Sep 2 14:47:36 1998 Jim Wilson + + * jump.c (jump_optimize): In if/then/else transformations, add + another call to modified_between_p for the jump insn. + +Wed Sep 2 14:16:49 1998 Jeffrey A Law (law@cygnus.com) + + * fix-header.c (symlink): Treat like readlink. + +Wed Sep 2 19:30:06 1998 J"orn Rennecke + + * dwarfout.c (fundamental_type_code): Encode 32 bit floats/doubles + as FT_float. + +Wed Sep 2 10:06:07 1998 Nick Clifton + + * config/nextstep.h: Update HANDLE_PRAGMA macro. + * config/h8300/h8300.h: Update HANDLE_PRAGMA macro. + * config/i960/i960.h: Update HANDLE_PRAGMA macro. + + * config/nextstep.c (handle_pragma): Take three arguments, as per + the new HANDLE_PRAGMA macro specification. + * config/h8300/h8300.c (handle_pragma): Take three arguments, as + per the new HANDLE_PRAGMA macro specification. + * config/i960/i960.c (process_pragma): Take three arguments, as + per the new HANDLE_PRAGMA macro specification. + +Wed Sep 2 09:25:29 1998 Nick Clifton + + * c-lex.c (check_newline): Call HANDLE_PRAGMA before + HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages + if unknown pragmas are encountered. + (handle_sysv_pragma): Interpret return code from + handle_pragma_token (). Return success/failure indication rather + than next unprocessed character. + (pragma_getc): New function: retrieves characters from the + input stream. Defined when HANDLE_PRAGMA is enabled. + (pragma_ungetc): New function: replaces characters back into the + input stream. Defined when HANDLE_PRAGMA is enabled. + + * c-pragma.c (handle_pragma_token): Return success/failure status + of the parse. + + * c-pragma.h: Change prototype of handle_pragma_token(). + + * varasm.c (handle_pragma_weak): Only create this function if + HANDLE_PRAGMA_WEAK is defined. + + * c-common,c (decl_attributes): If defined call the expression + contained within the INSERT_ATTRIBUTES macro before adding + attributes to a decl. + + * tm.texi (HANDLE_PRAGMA): Document the new version of + HANDLE_PRAGMA, which takes three arguments. + (INSERT_ATTRIBUTES): Document this new macro. + + * LANGUAGES: Document the new version of HANDLE_PRAGMA and the + new INSERT_ATTRIBUTES macro. + +Wed Sep 2 02:03:23 1998 David S. Miller + + * config/sparc/sparc.md (movdf): Only generate special RTL for + LABEL_REFs when PIC. + (move_label_di): Remove. + (movdi_pic_label_ref, movdi_high_pic_label_ref, + movdi_lo_sum_pic_label_ref): New patterns for 64-bit label + references when PIC. + * config/sparc/sparc.h (ASM_OUTPUT_ADDR_VEC_ELT, + ASM_OUTPUT_ADDR_DIFF_ELT): Don't do anything special for MEDLOW, + output an .xword for all 64-bit cases. + +Tue Sep 1 15:55:17 1998 David S. Miller + + * config/sparc/sparc.c (finalize_pic): Don't output arbitrary + alignment, use FUNCTION_BOUNDARY instead. + (sparc_output_deferred_case_vectors): Likewise. + +Mon Aug 31 17:25:41 1998 David S. Miller + + * config/sparc/sparc.md (movsf_const_intreg): Kill warning. + (movtf_insn_sp64, movtf_no_e_insn_sp64): Reorder alternatives. + +Mon Aug 31 13:57:55 1998 Richard Henderson + + * alpha/va_list.h: New file. + * alpha/x-alpha (EXTRA_HEADERS): New. Add va_list.h. + +Mon Aug 31 14:55:02 1998 Jeffrey A Law (law@cygnus.com) + + * NEWS: Add SCO Openserver and Unixware 7 notes. + + * NEWS: Fix typos. + +Mon Aug 31 15:42:18 1998 Dave Brolley + + * varasm.c (compare_constant_1): Handle RANGE_EXPR. + (record_constant_1): Handle RANGE_EXPR. + +Mon Aug 31 10:54:03 1998 Richard Henderson + + * print-rtl.c (print_rtx): NOTE_INSN_LIVE has an rtx not a bitmap. + * haifa-sched.c (sched_analyze): Handle NOTE_INSN_RANGE_START + and NOTE_INSN_RANGE_END specially. + (reemit_notes): Likewise. + +Mon Aug 31 10:18:52 1998 Kaveh R. Ghazi + + * sparc.c (TMASK, UMASK): Use `(unsigned)1' not `1U'. + (ultrasparc_sched_init): Remove unneeded &. + +Mon Aug 31 10:47:16 1998 Andreas Schwab + + * config/m68k/m68k.h (TARGET_SWITCHES): Don't remove MASK_68040 + for m68020-60, to prevent the use of fintrz. + +Sun Aug 30 22:17:20 1998 Mark Mitchell + + * configure.in: If the native compiler is GCC use $(WARN_CFLAGS) + even in stage1. + * Makefile.in: Likewise. + * configure: Regenerated. + +Sun Aug 30 22:15:41 1998 H.J. Lu (hjl@gnu.org) + + * configure.in (gxx_include_dir): Changed to + '${prefix}/include/g++'-${libstdcxx_interface}. + * configure: Rebuilt. + +Sun Aug 30 20:19:43 1998 Hans-Peter Nilsson + + * expr.c (expand_expr): Change ">" to ">=" making MOVE_RATIO use + consistent. + * tm.texi (Costs): Say MOVE_RATIO is number of mem-mem move + *sequences* *below* which scalar moves will be used. + +Sun Aug 30 17:18:43 1998 Jeffrey A Law (law@cygnus.com) + + * collect2.c (mktemp): Delete unused declaration. + + * config/xm-netbsd.h: Remove unnecessary file. + * config/*/xm-netbsd.h: Do not include the generic xm-netbsd.h + file anymore, it is not needed. + +Sun Aug 30 16:05:45 1998 Mark Mitchell + + * convert.c (convert_to_integer): Issue an error on conversions to + incomplete types. + +Sun Aug 30 16:47:20 1998 Martin von Lvwis + + * Makefile.in: Add lang_tree_files and gencheck.h. + * configure.in: Generate them. + * gencheck.c: Include gencheck.h. + +Sat Aug 29 21:38:24 1998 David S. Miller + + * config/sparc/sparc.md (pic_lo_sum_di, pic_sethi_di): Rename to + movdi_lo_sum_pic and movdi_high_pic and make visible. + * config/sparc/sparc.c (legitimize_pic_address): For -fPIC, + emit these when Pmode is not SImode. + * config/sparc/linux64.h (SPARC_DEFAULT_CMODEL): Make CM_MEDLOW. + +Sat Aug 29 14:59:32 1998 Mumit Khan + + * i386/cygwin32.h (ASM_OUTPUT_SECTION_NAME): Don't emit + .linkonce directive after the first time. + +Sat Aug 29 12:39:56 1998 Jeffrey A Law (law@cygnus.com) + + * m68k.md (beq0_di): Generate correct (and more efficient) code when + the clobbered operand overlaps with an input. + (bne0_di): Similarly. + + * Makefile.in (INSTALL): Remove "--no-header" argument. + + * NEWS: Various updates. + +Fri Aug 28 19:00:44 1998 David S. Miller + + * config/sparc/sparc.c (arith_operand, const64_operand, + const64_high_operand, arith_double_4096_operand): Mark mode as + unused. + (create_simple_focus_bits): Remove unused arg highest_bit_set, all + callers changed. + (sparc_emit_set_const64): Remove unused variable i. + (sparc_splitdi_legitimate): Likewise for addr_part. + (ultra_code_from_mask): Likewise for mask. + (ultra_cmove_results_ready_p): Fixup entry modulo calc. and + reverse return values so it matches usage and comments. + (ultra_flush_pipeline): Likewise. + (ultra_fpmode_conflict_exists): Likewise, remove unused variable + this_type, and allow loads and stores of differing FP modes as + they do not create a conflict. + (ultra_find_type): Initialize fpmode to SFmode, fix + parenthesization thinkos in large conditional. + (ultrasparc_sched_init): Mark dump and sched_verbose as unused. + Init free_slot_mask after ultra_cur_hist is reset, not before. + (ultrasparc_rescan_pipeline_state): Remove unused variable ucode. + (ultrasparc_sched_reorder): Don't bzero current pipeline state, + use ultra_flush_pipeline instead, then re-init group pointer. + Fix statement with no effect. If no progress made in, and no + instructions scheduled at all, advance to new pipeline cycle else + we get into an endless loop. + (ultrasparc_adjust_cost): Remove previous arg. + * config/sparc/sparc.h (ADJUST_COST): Update to reflect that. + +Fri Aug 28 13:52:35 1998 Jim Wilson + + * sparc.md (DImode, DFmode, TFmode splits): Delete self_reference + code. Use reg_overlap_mentioned_p to detect when source and + destination overlap. + (negtf2_notv9+1): Use DFmode instead of SFmode in last two operands. + +1998-08-28 Brendan Kehoe + + * loop.c (check_dbra_loop): Pass COMPARISON_VALUE, not + COMPARISON_VAL, into invariant_p. + +Fri Aug 28 15:13:25 1998 J"orn Rennecke + + * regmove.c (regclass_compatible_p): New function. + (regmove_optimize): Use it. + + Use NREGS parameter instead of calling max_reg_num. + + (fixup_match_1): Don't use code = MINUS when later tieing with + a hard register is likely. + +Fri Aug 28 14:54:07 1998 J"orn Rennecke + + * loop.c (check_dbra_loop): Fix calculation of FINAL_VALUE when + COMPARISON_VAL was normalized. + +Thu Aug 27 20:10:46 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (check_dbra_loop): The loop ending comparison value + must be an invariant or we can not reverse the loop. + + * loop.c (scan_loop): Count down from max_reg_num - 1 to + FIRST_PSEUDO_REGISTER to avoid calling max_reg_num each iteration + of the loop. + (load_mems_and_recount_loop_regs_set): Likewise. + + * i386.c (print_operand): Remove obsolete 'c' docs. + +Wed Aug 26 17:13:37 1998 Tom Tromey + + * gthr.h: Document __GTHREAD_MUTEX_INIT_FUNCTION. + * frame.c (init_object_mutex): New function. + (init_object_mutex_once): Likewise. + (find_fde): Call it. + (__register_frame_info): Likewise. + (__register_frame_info_table): Likewise. + (__deregister_frame_info): Likewise. + +Thu Aug 27 15:14:18 1998 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (sched_analyze_insn): Fix thinko in last change. + +Thu Aug 27 16:34:51 1998 J"orn Rennecke + + * loop.c (check_dbra_loop): Enable code for reversal + of some loops without a known constant loop end. + +Wed Aug 26 18:38:15 1998 Richard Henderson + + * haifa-sched.c (last_clock_var): New. + (schedule_block): Initialize it. + (schedule_insn): Use it to fill insn modes with issue information. + + * alpha.c (alpha_handle_trap_shadows): Remove do-nothing exit. + Tag trapb and next insn with TImode. + (alphaev5_insn_pipe, alphaev5_next_group, alphaev5_align_insns): New. + (alpha_reorg): Add conditional for alpha_handle_trap_shadows. + Invoke alphaev5_align_insns as appropriate. + * alpha.h (LABEL_ALIGN_AFTER_BARRIER): Was ALIGN_LABEL_AFTER_BARRIER. + (MD_SCHED_VARIABLE_ISSUE): New. + * alpha.md (attr type): Add multi. + (define_asm_attributes): New. + (prologue_stack_probe_loop, builtin_setjmp_receiver): Set type multi. + (arg_home): Likewise. + (fnop, unop, realign): New. + +Wed Aug 26 15:55:41 1998 Jim Wilson + + * iris5.h (PREFERRED_DEBUGGING_TYPE): Undef. + * iris5gas.h (PREFERRED_DEBUGGING_TYPE): Define. + + * configure.in (powerpc-ibm-aix4.[12]*): Change from 4.[12].*. + (rs6000-ibm-aix4.[12]*): Likewise. + * configure: Regenerate. + +Wed Aug 26 09:30:59 1998 Nick Clifton + + * config/arm/thumb.c (thumb_exit): Do not move a4 into lr if it + already contains the return address. + +Wed Aug 26 12:57:09 1998 Jeffrey A Law (law@cygnus.com) + + * calls.c (expand_call): Use bitfield instructions to extract/deposit + word sized hunks when loading unaligned args into registers. + + * haifa-sched.c (sched_analyze_insn): Only create scheduling + barriers for LOOP, EH and SETJMP notes on the loop_notes list. + + * mn10300.h (RTX_COSTS): Handle UDIV and UMOD too. + +Wed Aug 26 16:35:37 1998 J"orn Rennecke + + * loop.c (check_dbra_loop): Add some code that would allow reversal + of some loops without a known constant loop end if it were enabled. + +Wed Aug 26 11:08:44 1998 Gavin Romig-Koch + + * mips.md (lshrsi3_internal2+2): Fix type-o. + +Wed Aug 26 10:53:03 1998 Kaveh R. Ghazi + + * system.h: Include stdarg.h/varargs.h, make sure they are ordered + correctly with regards to stdio.h. + + * calls.c: Remove stdarg.h/varargs.h. + * cccp.c: Likewise. + * cexp.y: Likewise. + * combine.c: Likewise. + * cpperror.c: Likewise. + * cpplib.c: Likewise. + * cpplib.h: Likewise. + * doprint.c: Likewise. + * emit-rtl.c: Likewise. + * final.c: Likewise. + * fix-header.c: Likewise. + * gcc.c: Likewise. + * genattr.c: Likewise. + * genattrtab.c: Likewise. + * gencodes.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + * mips-tfile.c: Likewise. + * prefix.c: Likewise. + * protoize.c: Likewise. + * regmove.c: Likewise. + * toplev.c: Likewise. + * tree.c: Likewise. + +Wed Aug 26 05:09:27 1998 Jakub Jelinek + + * config/sparc/sparc.c (sparc_override_options): If not + TARGET_FPU, turn off TARGET_VIS. + * config/sparc/sparc.h (TARGET_SWITCHES): Add no-vis. + (LEGITIMATE_CONSTANT_P): Allow SF/DF mode zero when TARGET_VIS. + * config/sparc/sparc.md (movsi_insn): Use fzeros not fzero. + (movdi_insn_sp64): Add VIS fzero alternative. + (clear_sf, clear_df): New VIS patterns. + (movsf, movdf expanders): Allow fp_zero_operand flat out when + TARGET_VIS. + (one_cmpldi2_sp64): Provide new fnot1 VIS alternative. + +Tue Aug 25 10:57:41 1998 Mark Mitchell + + * loop.c (n_times_set, n_times_used, may_not_optimize, + reg_single_usage): Convert to varrays. All uses changed. + (insert_loop_mem): Return a value. + (scan_loop): Tweak AVOID_CC_MODE_COPIES code. + (load_mems_and_recount_loop_regs_set): Likewise. Grow the arrays, if + necessary. + +Tue Aug 25 23:57:12 1998 Jeffrey A Law (law@cygnus.com) + + * From Alexandre: + * configure.in: Do not set thread_file to "irix" since no such + support exists yet. + + * sparc.md (float abs/neg splits): Check reload_completed before + calling alter_subreg. + +Tue Aug 25 19:17:59 1998 David S. Miller + + * config/sparc/sparc.c (sparc_absnegfloat_split_legitimate): New + function. + * config/sparc/sparc.h: Declare it. + * config/sparc/sparc.md (float abs/neg splits): Use it. + (all other splits): Handle SUBREGs properly where necessary. + (unnamed (1< + + * config/v850/v850.c (movsi_source_operand): Treat CONSTANT_P_RTX + as an ordinary operand. + +Tue Aug 25 12:54:57 1998 Jason Merrill + + * tree.c (valid_machine_attribute): Don't apply attributes to both + decl and type. + +Tue Aug 25 12:23:20 1998 Richard Henderson + + * reload.c (operands_match_p): Handle rtvecs. + + * i386.c (legitimate_pic_address_disp_p): New. + (legitimate_address_p): Use it. + (legitimize_pic_address): Use unspecs to represent @GOT and @GOTOFF. + Handle constant pool symbols just like statics. + (emit_pic_move): Use Pmode not SImode for clarity. + (output_pic_addr_const) [SYMBOL_REF]: Remove @GOT and @GOTOFF hacks. + [UNSPEC]: New, handling what we killed above. + [PLUS]: Detect and abort on invalid symbol arithmetic. + * i386.h (CONSTANT_ADDRESS_P): Remove HIGH. + +Tue Aug 25 12:02:23 1998 Mark Mitchell + + * alias.c: Include output.h. + (DIFFERENT_ALIAS_SETS_P): Don't treat alias sets as + different if we're in a varargs function. + * Makefile.in (alias.o): Depend on output.h + +Tue Aug 25 19:20:12 1998 J"orn Rennecke + + * sh.h (GIV_SORT_CRITERION): Delete. + +Tue Aug 25 13:19:46 1998 Dave Brolley + + * regclass.c (regclass): Use xmalloc/free instead of alloca. + * stupid.c (stupid_life_analysis): Likewise. + * reload1.c (reload): Likewise. + +Tue Aug 25 05:48:18 1998 Jakub Jelinek + + * config/sparc/sparc.c (arith_4096_operand, arith_add_operand, + arith_double_4096_operand, arith_double_add_operand): New + predicates. + * config/sparc/sparc.h (PREDICATE_CODES): Add them, declare them. + * config/sparc/sparc.md (adddi3, addsi3, subdi3, subsi3): Use + them to transform add/sub 4096 into add/sub -4096. + +Mon Aug 24 23:31:03 1998 David S. Miller + + * loop.c (scan_loop): Allocate some slop to handle pseudos + generated by move_movables. + (load_mems_and_recount_loop_regs_set): Honor AVOID_CC_MODE_COPIES + here too. + +Mon Aug 24 19:45:40 1998 Jim Wilson + + * tree.def (DECL_RESULT): Correct documentation. + +Tue Aug 25 01:15:27 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_before_p): New argument EQUIV; Changed + all callers. Abort for RELOAD_FOR_INSN. RELOAD_FOR_OUTADDR_ADDR: + conflicts will all RELOAD_FOR_OUTPUT reloads. + + * reload1.c (reload_cse_regs_1): When deleting a no-op move that + loads the function result, substitute with a USE. + +Mon Aug 24 15:20:19 1998 David Edelsohn + + * rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Use TARGET_POWERPC64 + when testing LEGITIMATE_INDEXED_ADDRESS_P DFmode and DImode. + (LEGITIMIZE_ADDRESS): Use TARGET_POWERPC64 for INDEXED fixup. + * rs6000.c (print_operand, case 'L'): Add UNITS_PER_WORD, not 4. + (print_operand, cases 'O' and 'T'): Fix typos in lossage strings. + * rs6000.md (fix_truncdfsi2_store): Remove %w from non-CONST_INT + operand. + (movdf_softfloat32, movdf_hardfloat64, movdf_softfloat64): Change + 'o' to 'm' for GPR variant constraints. + +Mon Aug 24 10:25:46 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (scan_loop): Honor AVOID_CC_MODE_COPIES. + + * h8300.h (STRIP_NAME_ENCODING): Fix typo. + + * sparc.md (TFmode splits): Use reg_overlap_mentioned_p to detect + when the source and destination overlap. + + * stmt.c (emit_case_nodes): Change rtx_function to rtx_fn to avoid + clash with global type. + +Mon Aug 24 00:53:53 1998 Jason Merrill + + * fixinc.irix: Add curses.h handling from fixinc.wrap. + + * c-common.c (combine_strings): Also set TREE_READONLY. + Change warn_write_strings to flag_const_strings. + * c-decl.c, c-tree.h: Likewise. + +Sun Aug 23 18:39:11 1998 David S. Miller + + * config/sparc/sparc.c (sparc_emit_set_const32): If outputting a + CONST_INT, not a symbolic reference, don't use a HIGH/LO_SUM + sequence, use SET/IOR instead so CSE can see it. + * config/sparc/sparc.md (movhi_const64_special, + movsi_const64_special): New patterns necessitated by that change. + (movhi_high): Remove. + (movhi_lo_sum): Change to match an IOR. + (movdf_insn_sp32): Test TARGET_V9 not TARGET_ARCH64. + (movdf_insn_v9only): New pattern for when V9 but not ARCH64. + (movdf_insn_sp64): Test both TARGET_V9 and TARGET_ARCH64. + (movdf splits): Allow when not V9 or when not ARCH64 and integer + registers are involved. + (snesi_zero_extend split): Remove reload_completed test. + (unnamed plus and minus zero_extend sidi splits): Add it. + +Sun Aug 23 11:56:08 1998 Mark Mitchell + + * extend.texi: Remove description of extension to explicit + instantiation that is now endorsed by standard C++. + +Sun Aug 23 09:39:09 1998 David S. Miller + + * config/arc/arc.c (arc_initialize_pic): Remove. + * config/arc/arc.h (INITIALIZE_PIC): Similarly, this routine does + nothing on any platform and is invoked by no-one, it does not even + appear in the documentation. + * config/sparc/sparc.h (INITIALIZE_PIC): Likewise. + * config/sparc/sparc.c (initialize_pic): Likewise. + (find_addr_reg): Remove this as well, no longer referenced after + my rewrite. + +Sun Aug 23 00:17:14 1998 Jeffrey A Law (law@cygnus.com) + + * recog.c (validate_replace_rtx_group): New function. + * recog.h (validate_replace_rtx_group): Declare it. + * regmove.c (optimize_reg_copy_3): If any substitution fails, then undo + the entire group of substitutions. + +Sat Aug 22 23:31:00 1998 Klaus-Georg Adams (Klaus-Georg.Adams@chemie.uni-karlsruhe.de) + + * loop.c (load_mems): Fix initializers. + +Fri Aug 21 23:07:46 1998 David S. Miller + + * config/sparc/sparc.md (TFmode splits): Handle destination + registers being referenced in the address correctly. + + * expmed.c (make_tree) [CONST_INT]: Sign extend even if + TREE_UNSIGNED, when bitsize of type's mode is larger than + HOST_BITS_PER_WIDE_INT. + +Fri Aug 21 19:31:31 1998 Alexandre Petit-Bianco + + * tree.def (LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR): New tree nodes. + * tree.h (LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY, + EXIT_BLOCK_LABELED_BLOCK, EXIT_BLOCK_RETURN, LOOP_EXPR_BODY): New + macros. + * expr.c (expand_expr): Handle LABELED_BLOCK_EXPR and + EXIT_BLOCK_EXPR. + +Thu Aug 20 19:43:44 1998 Jeffrey A Law (law@cygnus.com) + + * h8300.c (h8300_encode_label): Use '&' for tiny data items. + * h8300.h (TINY_DATA_NAME_P): Likewise. + (STRIP_NAME_ENCODING): Handle '&'. + + * mn10200.h (REG_OK_FOR_INDEX_P): Do not check the mode of the + register (it could be accessed via an outer SUBREG). + (REG_OK_FOR_BASE_P): Likewise. + (GO_IF_LEGITIMATE_ADDRESS): Consistently use REGNO_OK_FOR_BASE_P. + + * remove.c (optimize_reg_copy_3): Abort instead of silently generating + bogus rtl. + + * jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative. + +Thu Aug 20 17:35:20 1998 David S. Miller + + * config/sparc/sparc.md (movtf_insn_sp32): All memory operands + must be offsettable so the splits can be made. + +Thu Aug 20 13:56:53 1998 Michael Meissner + + * config/i386/winnt.c: Include system.h, not stdio.h to get + sys/param.h pulled in before rtl.h in case the system defines MIN + and MAX. + +Thu Aug 20 13:44:20 1998 David Edelsohn + + * rs6000.md (movqi, movhi): Add CONSTANT_P_RTX. + +Thu Aug 20 13:15:11 1998 Dave Brolley + + * stor-layout.c (layout_type): Compute TYPE_SIZE_UNIT correctly for + arrays of bits. + * cpplib.c (cpp_define): Handle macros with parameters. + +Wed Aug 19 21:33:19 1998 David Edelsohn + + * rs6000.c (rs6000_output_load_toc_table): Use ld for 64-bit. + (output_toc): Use single TOC slot or llong minimal-toc for DFmode + and DImode 64-bit. Use llong for minimal-toc SFmode and + SYMBOL_REF / LABEL_REF 64-bit. + (output_function_profiler): Use llong for profiler label and ld to + load 64-bit label address. + +Wed Aug 19 17:52:27 1998 Nick Clifton (nickc@cygnus.com) + + * config/arm/thumb.md (extendqisi2_insn): Cope with REG + + OFFSET addressing. + +Wed Aug 19 14:13:31 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Wed Aug 19 13:10:30 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Wed Aug 19 13:06:47 1998 Jason Merrill + + * collect2.c (extract_init_priority): Use atoi instead of strtoul. + +Wed Aug 19 13:51:35 1998 Hans-Peter Nilsson + + * tm.texi (Misc): Fix typo "teh". + + * tm.texi (PIC): Fix typo "PPIC". + + * tm.texi (Caller Saves): Say that DEFAULT_CALLER_SAVES has no + effect when -O2 and higher. + * invoke.texi (Optimize Options): Likewise for -fcaller-saves. + +1998-08-19 Michael Hayes + + * regclass.c: Changed register set documentation to be consistent + with GCC behavior. + + * final.c (final_start_function): Removed redundant test for + call_fixed_regs. + +Wed Aug 19 13:28:41 1998 Mark Mitchell + + * rtl.h (rtx_function): New type. + (for_each_rtx): New function. + * rtlanal.c (for_each_rtx): Define it. + + * recog.c (change_t): New type. + (change_objects, change_old_codes, change_locs, change_olds): + Replace with ... + (changes): New variable. + (validate_change): Dynamically allocate room for more changes, if + necessary. Uses changes array instead of change_objects, etc. + (apply_change_group): Use changes array instead of + change_objects, etc. + + * loop.c (loop_mem_info): New type. + (loop_mems): New variable. + (loop_mems_idx): Likewise. + (looop_mems_allocated): Likewise. + (scan_loop): Remove nregs parameter. + (next_insn_in_loop): New function. + (load_mems_and_recount_loop_regs_set): Likewise. + (load_mems): Likewise. + (insert_loop_mem): Likewise. + (replace_loop_mem): Likewise. + (replace_label): Likewise. + (INSN_IN_RANGE_P): New macro. + (loop_optimize): Don't pass max_reg_num() to scan_loop. + (scan_loop): Remove nregs parameter, compute it after any new + registers are created by load_mems. Use INSN_IN_RANGE_P and + next_insn_in_loop rather than expanding them inline. Call + load_mems to load memory into pseudos, if appropriate. + (prescan_loop): Figure out whether or not there are jumps from the + loop to targets other than the label immediately following the + loop. Call insert_loop_mem to notice all the MEMs used in the + loop, if it could be safe to pull MEMs into REGs for the duration + of the loop. + (strength_reduce): Use next_insn_in_loop. Tweak comments. + +Wed Aug 19 08:29:44 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_override_options): Remove lie about ignoring PIC flag. + +Wed Aug 19 07:08:15 1998 David S. Miller + + * config/sparc/sparc.c (finalize_pic): Check for the correct + nonlocal_goto_receiver UNSPEC number. + * config/sparc/sparc.md (nonlocal_goto_receiver): Add comment + making note of this dependency existing in sparc.c. + (negtf2_notv9 split): Give NEG SFmode. + (negsf2): Fix insn output string. + +Tue Aug 18 12:40:27 1998 Richard Henderson + + * c-common.c (decl_attributes): Issue an error if the argument + to alias is not a string. + +Tue Aug 18 10:33:30 1998 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (sched_analyze): Put all JUMP_INSNs on the last + pending memory flush list. + + * combine.c (can_combine_p): Allow combining insns with REG_RETVAL + notes. + (try_combine): Allow combining insns with REG_LIBCALL notes. + + * expr.c (emit_block_move): Do not call memcpy as a libcall + instead build up a CALL_EXPR and call it like any other + function. + (clear_storage): Similarly for memset. + + * regmove.c (fixup_match_2): Do not call reg_overlap_mentioned_p + on notes. + + * Makefile.in (cplus-dem.o): Provide explicit rules for building + cplus-dem.o. + + * regmove.c (optimize_reg_copy_1): Update REG_N_CALLS_CROSSED + and REG_LIVE_LENGTH as successful substitutions are made. + +Tue Aug 18 07:15:27 1998 Kaveh R. Ghazi + + * config/sparc/sparc.c (ultra_find_type): Add empty semicolon + statement after end of loop label. + +Tue Aug 18 07:13:27 1998 David S. Miller + + * config/sparc/sparc.c (ultra_types_avail): New variable. + (ultra_build_types_avail): New function to record mask of insn + types in ready list at this cycle. + (ultrasparc_sched_reorder): Call it. + (ultra_find_type): Use it to quicken the search. Also simplif + dependency check, don't use rtx_equal_p because we know exactly + what we are looking for. + +Tue Aug 18 03:20:53 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (SECONDARY_INPUT_RELOAD_CLASS): Return NO_REGS if compiling + for architecture v4. + +Mon Aug 17 21:26:38 1998 David S. Miller + + * config/sparc/sparc.md (sltu, sgeu): Don't FAIL, call + gen_compare_reg. + (movsf_const_intreg, movsf_const_high, movsf_const_lo, + movdf_const_intreg and helper splits): New patterns to move float + constants into integer registers. + (negtf2, negdf2, abstf2, absdf2): Rework using new patterns and + splits. + +Mon Aug 17 11:46:19 1998 Jeffrey A Law (law@cygnus.com) + + * From Graham + * tree.c (build_index_type): Copy TYPE_SIZE_UNIT from sizetype + to itype. + * c-decl.c (finish_enum): Copy TYPE_SIZ_UNIT from enumtype to tem. + + * rs6000.c (secondary_reload_class): For TARGET_ELF, indicate that + a BASE_REGS register is needed as an intermediate when copying + a symbolic value into any register class other than BASE_REGS. + + * expr.c (move_by_pieces): No longer static. Remove prototype. + * rtl.h (move_by_pieces): Add extern prototype. + * mips.c (expand_block_move): Handle aligned straight line copy by + calling move_by_pieces. + + * expr.c (expand_expr): Allow assignments from TImode PARM_DECLs + and VAR_DECLs. + +Mon Aug 17 10:28:52 1998 Mark Mitchell + + * stmt.c (expand_end_loop): Tidy. Allow unconditional + jumps out of the loop to be treated as part of the exit test. + +Mon Aug 17 10:06:11 1998 Kaveh R. Ghazi + Jeff Law + + * Makefile.in (cplus-dep.o): Use cplus-dem.c from libiberty. + * cplus-dem.c: Delete. + + * Makefile.in (fold-const.o): Depend on $(RTL_H). + + * fold-const.c: Include rtl.h to get the prototype for + `set_identifier_local_value'. + + * loop.c (express_from_1): Remove unused variable `tmp'. + (combine_givs): Cast the first argument of bzero to char *. + + * toplev.c (display_help): Remove unused variable `looking_for_start'. + + * c-decl.c (init_decl_processing): Remove unneeded &. + + * alpha.h (alpha_initialize_trampoline): Provide prototype. + + * except.c (set_exception_lang_code, set_exception_version_code): + Change parameter from `short' to `int' to avoid using a gcc + extension. + + * except.h (set_exception_lang_code, set_exception_version_code): + Likewise for prototypes. + + * flow.c (count_reg_references): Remove unused variables `regno' + and `i'. + + * gcse.c (hash_scan_insn): Declare parameter `in_libcall_block'. + + * prefix.c (translate_name): Cast the result of `alloca'. + + * varray.h (VARRAY_FREE): Reimplement as a `do-while(0)' statement. + +Mon Aug 17 09:23:42 1998 Andreas Schwab + + * config/m68k/m68k.c: Include "system.h" instead of . + Include "toplev.h". + (valid_dbcc_comparison_p): Mark mode argument as unused. + (symbolic_operand): Likewise. + (legitimize_pic_address): Likewise. + (const_uint32_operand): Likewise. + (const_sint32_operand): Likewise. + * sched.c [!INSN_SCHEDULING]: Define only dummy function + schedule_insns and comment out rest of file. + + * m68k.c (output_move_simode_const): Use subl to move a zero into an + address register. + (output_move_[hq]imode): Likewise. + +Mon Aug 17 09:15:47 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (main): Enable -fstrict-aliasing for -O2 and above. + * invoke.texi: Corresponding changes. + +Mon Aug 17 02:03:55 1998 Richard Henderson + + * regclass.c (allocate_reg_info): Respect MIN when clearing data. + +Sun Aug 16 17:37:06 1998 David S. Miller + + * config/sparc/sparc.c (ultra_code_from_mask, + ultra_cmove_results_ready_p, ultra_fpmode_conflict_exists, + ultra_find_type, ultra_schedule_insn, ultra_flush_pipeline, + ultrasparc_sched_init, ultrasparc_variable_issue, + ultra_rescan_pipeline_state, ultrasparc_sched_reorder): New + functions to describe UltraSPARC pipeline exactly to Haifa. + (ultrasparc_adjust_cost): Indicate IMUL type insns have zero cost, + as there is nothing the scheduler can do about it. Indicate that + REG_DEP_OUTPUT's collide. Fixup formatting. + * config/sparc/sparc.h (RTX_COSTS): Fixup integer multiply and + divide costs on Ultra for DImode. + (MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_VARIABLE_ISSUE): + Define. + * config/sparc/sparc.md (ieu_unnamed function unit): Rename to + ieuN and add call_no_delay_slot to type list. + (cti function unit): New unit for branches on UltraSPARC. + (subx/addx insns): Set type to misc. + (sidi zero/sign extension insns on arch64): Set type to shift. + (sign_extendhidi2_insn): Set type to sload. + +Sun Aug 16 13:52:00 1998 David Edelsohn + + * rs6000.c (rs6000_stack_info): Use if == 0 for sizes. + (output_epilog): Use if != 0 for offset. + (rs6000_fatal_bad_address): Prepare for Intl. + * rs6000.h (rs6000_fatal_bad_address): Declare. + * rs6000.md (movsfcc, movdfcc): Use else if. + (elf_high): Use {liu|lis}. + (elf_low): Use {cal|la}. Remove %a template from old mnemonics. + (movsi): Use rs6000_fatal_bad_address. + +Sun Aug 16 01:53:21 1998 Richard Henderson + + * reload.c (find_equiv_reg): Reject equivalences separated + by a volatile instruction. + +Sun Aug 16 00:21:44 1998 Franz Sirl + + * rs6000/linux.h (CPP_OS_DEFAULT_SPEC): Define. + +Sat Aug 15 20:51:35 1998 Richard Henderson + + * alpha.md (movsicc): Fix mode mismatch. + +Sat Aug 15 20:22:33 1998 H.J. Lu (hjl@gnu.org) + + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Handle aggregated + return type. + * config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): Likewise. + +Sat Aug 15 08:39:49 1998 David S. Miller + + * config/sparc/sparc.md (movsi_lo_sum_pic_label_reg): Remove + write-only modifier from operand 1 constraint. + +Sat Aug 15 06:28:19 1998 David S. Miller + + * config/sparc/sparc.c (sparc_emit_set_const64_quick1): If + emitting a XOR of -1 at the end, emit a NOT instead for combine's + sake. + (sparc_emit_set_const64): Likewise, also when computing trailing + bits do not negate low_bits and make fast_int an int. + +Fri Aug 14 21:07:03 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (add_label_notes): Do not ignore references to labels + before dispatch tables. Mirrors Apr 8 change to mark_jump_label. + * gcse.c (add_label_notes): Similarly. + + * pa.h (ASM_OUTPUT_MI_THUNK): Strip name encoding. + + * m68k.md (adddi_dilshr32): One of the operands must be a register. + (adddi_dishl32): Similarly. + +Fri Aug 14 14:12:59 1998 Jason Merrill + + * i386.h (MODES_TIEABLE_P): Reorganize to shut up warnings. + * alias.c (memrefs_conflict_p): Add braces to shut up warnings. + * cse.c (cse_basic_block): Add parens to shut up warnings. + +Fri Aug 14 12:58:21 1998 David S. Miller + + * config/sparc/sparc.c (sparc_emit_set_const64_quick2, + sparc_emit_set_const64_longway, const64_is_2insns, + create_simple_focus_bits, sparc_emit_set_const64): Fix more bugs + in 64-bit constant formation. + * config/sparc/sparc.md (snesi_zero_extend split): Generate + rtl for addx not subx. + (define_insn movdi_const64_special): Make available even when + HOST_BITS_PER_WIDE_INT is not 64. + (movdi_lo_sum_sp64_cint, movdi_high_sp64_cint): Remove. + (losum_di_medlow, sethm, setlo): Make op2 symbolic_operand. + (cmp_siqi_trunc_set, cmp_diqi_trunc_set): Encapsulate both + instances of operand 1 inside a QI subreg. + (xordi3_sp64_dbl): Remove '%' constraint for op1. + (one_cmpldi2_sp64): Fix output string. + (one_cmplsi2_not_liveg0): Rewrite to remove unneeded extra + alternative case. + (unnamed arch64 ashift DI): Truncate shift count if greater than + 63, not 31. + +Fri Aug 14 21:52:53 1998 J"orn Rennecke + + * expr.c (store_expr): Don't optimize away load-store pair + when either source or destination have a side effect. + +Fri Aug 14 16:50:10 1998 John Carr + + * genrecog.c (add_to_sequence): Fatal error if the modes of the + operands of SET are incompatible. + + * alpha.md: Fix max and min patterns so modes of SET operands match. + +Fri Aug 14 12:22:55 1998 Ian Lance Taylor + + * configure.in: Avoid [[ by using test and changequote. + * configure: Rebuild. + +Fri Aug 14 01:22:31 1998 David S. Miller + + * rtl.def (CONSTANT_P_RTX): Fix typo in string name. + + * config/sparc/sparc.md (seqdi_special_trunc, snedi_special_trunc, + seqsi_special_extend, snesi_special_extend, snesi_zero_extend and + split, snedi_zero_trunc and split, seqsi_zero_extend and split, + seqdi_zero_trunc and split, pic_lo_sum_di, pic_sethi_di, + movdi_cc_sp64_trunc, movdi_cc_reg_sp64_trunc, addx_extend_sp32 and + split, addx_extend_sp64, subx_extend_sp64, subx_extend and split): + Fix mismatching modes in SET operands. + (conditional move patterns): Fix formatting. + (unnamed subx arch64 pattern): Remove duplicate insn. + +Fri Aug 14 00:34:34 1998 David S. Miller + + * config/sparc/sparc.c (const64_operand, const64_high_operand): + Get it right when HOST_BITS_PER_WIDE_INT is not 64. + (input_operand): Fixup test for what we accept for constant + integers. + (sparc_emit_set_const32, sparc_emit_set_symbolic_const64): Give + set VOIDmode. + (safe_constDI): Remove. + (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, + gen_safe_XOR64): New functions. + (sparc_emit_set_const64_quick1, sparc_emit_set_const64_quick2, + sparc_emit_set_const64_longway, sparc_emit_set_const64): Use + them. + * config/sparc/sparc.md (define_insn xordi3_sp64_dbl): Only make + available when HOST_BITS_PER_WIDE_INT is not 64. + (define_insn movdi_sp64_dbl, movdi_const64_special): Likewise and + move before movdi_insn_sp64 pattern. + (define_insn movdi_lo_sum_sp64_dbl, movdi_high_sp64_dbl): Remove. + (define_insn sethi_di_medlow, seth44, setm44, sethh): Use + symbolic_operand as predicate for second operand. + (DImode minus split on arch32, negsi2 expander, one_cmplsi2 + expander): Give set VOIDmode. + +Fri Aug 14 01:45:06 1998 Mumit Khan + + * i386/cygwin32 (DEFAULT_PCC_STRUCT_RETURN): Define. + +Fri Aug 14 01:40:21 1998 Geoffrey Keating + + * rs6000/linux.h (LINK_SPEC): Pass -G args to the linker. + +Fri Aug 14 01:23:23 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm/netbsd.h (TARGET_DEFAULT): Default includes software floating + point. + (CPP_FLOAT_DEFAULT_SPEC): Re-define accordingly. + +Fri Aug 14 01:19:08 1998 Robert Lipe + + * install.texi: Various SCO OpenServer tweaks. + +Thu Aug 13 20:14:40 1998 Jim Wilson + + * reload1.c (eliminate_regs_in_insn): Handle another case when + eliminating the frame pointer to the hard frame pointer. Add + missing ep->to_rtx check to one existing case. + + * mips/mips.md (movhi_internal2+2): Fix typo mem:SI -> mem:HI. + +Thu Aug 13 17:08:11 1998 Jason Merrill + + * tree.h: De-conditionalize init_priority code. + + * mips.h (NM_FLAGS): Change from -Bp to -Bn. + * collect2.c (NM_FLAGS): Change from -p to -n. + + * configure.in: Turn on collect2 for mipstx39-elf. + Handle use_collect2=no properly. + + * c-common.c: De-conditionalize init_priority code. + * collect2.c (extract_init_priority, sort_ids): New fns. + (main): Call sort_ids. + Move sequence_number to file scope. + + * configure.in: Handle --enable-init-priority. + * c-common.c (attrs): Add A_INIT_PRIORITY. + (init_attributes, decl_attributes): Likewise. + * tree.h (DEFAULT_INIT_PRIORITY, MAX_INIT_PRIORITY): New macros. + * tree.c (get_file_function_name_long): Split out... + (get_file_function_name): ...from here. + +Thu Aug 13 16:09:53 1998 Martin von Loewis + + * expr.c (safe_from_p): Change code to ERROR_MARK only when not + accessing nodes. + +Thu Aug 13 15:24:48 1998 Jason Merrill + + * toplev.c (display_help): Add braces to shut up warnings. + * tree.c (simple_cst_equal): Likewise. + + * fold-const.c (non_lvalue): Don't deal with null pointer + constants here. + (fold, case COMPOUND_EXPR): Wrap a constant 0 in a NOP_EXPR. + + * c-typeck.c (initializer_constant_valid_p): Allow conversion of 0 + of any size to a pointer. + +Thu Aug 13 12:53:13 1998 Jim Wilson + + * i386/winnt.c (i386_pe_asm_file_end): Check TREE_SYMBOL_REFERENCED. + +Wed Aug 12 17:25:18 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.c (REG_SAVE_BYTES): Only reserve space for registers + which will be saved. + * mn10300.md (prologue insn): Only save registers which need saving. + (epilogue insn): Similarly. + + * mn10300.c, mn10300.h, mn10300.md: Remove "global zero register" + optimizations. + +Wed Aug 12 12:39:16 1998 Gavin Romig-Koch + + * mips/mips.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG for + VAR_DECL's in gp addressable sections. + +Tue Aug 11 23:02:31 1998 John Carr + + * sparc.c: Change return to ; return; in functions + returning void. + * sparc.md: Add empty semicolon statement after final label in + move expanders. + +Tue Aug 11 22:42:01 1998 David S. Miller + + * config/sparc/sparc.md (define_insn addx_extend): Rename to + addx_extend_sp64, only allow when TARGET_ARCH64. + (define_insn addx_extend_sp32 and split): Version that works when + not TARGET_ARCH64. + (define_insn subx_extend): Likewise. + (define_split adddi3 and subdi3 with zero extension): Fixup and + correct bugs when not TARGET_ARCH64. + +Tue Aug 11 16:04:34 1998 John Carr + + * except.c (set_exception_lang_code, set_exception_version_code): + Use prototype-style definition if __STDC__, to match declaration + in except.h. + + * genemit.c: Change FAIL and DONE macros not to use loops. + +Tue Aug 11 12:27:03 1998 Jim Wilson + + * dwarf2out.c (ASM_OUTPUT_DWARF_ADDR_CONST): Use + ASM_OUTPUT_DWARF2_ADDR_CONST if defined. + + * mips/mips.md (reload_outsi): Use M16_REG_P when TARGET_MIPS16. + +Tue Aug 11 18:12:53 1998 Dave Love + + * README.g77: Update from Craig. + +Tue Aug 11 04:46:01 1998 David S. Miller + + * config/sparc/sparc.c (sparc_emit_set_const32): INTVAL is of + type HOST_WIDE_INT. + (safe_constDI sparc_emit_set_const64_quick1, + sparc_emit_set_const64_quick2, sparc_emit_set_const64_longway, + analyze_64bit_constant, const64_is_2insns, + create_simple_focus_bits): Fix some bugs when compiled on real + 64-bit hosts. + (function_arg_record_value_3, function_arg_record_value_2, + function_arg_record_value): Add fully prototyped forward decls. + * config/sparc/sparc.md (define_insn cmpsi_insn_sp32): Rename back + to cmpsi_insn and use on both 64 and 32 bit targets. + (define_insn cmpsi_insn_sp64): Remove. + (define_expand zero_extendsidi2): Allow for 32-bit target too. + (define_insn zero_extendsidi2_insn): Rename to + zero_extendsidi2_insn_sp64. + (define_insn zero_extendsidi2_insn_sp32): New pattern and + associated forced split for it. + + * config/sparc/sparc.c (const64_operand, const64_high_operand): + New predicates. + * config/sparc/sparc.h: Declare them. + (PREDICATE_CODES): Add them. + * config/sparc/sparc.md (movdi_lo_sum_sp64_dbl, + movdi_high_sp64_dbl, xordi3_sp64_dbl): Use them. + +Mon Aug 10 22:57:24 1998 John Carr + + * config/sparc/sparc.md (define_insn jump): Output ba,pt not b,pt + in v9 case as the latter makes the Solaris assembler crash. + +Mon Aug 10 22:39:09 1998 David S. Miller + + * config/sparc/sparc.c (input_operand): Do not accept a LO_SUM MEM + for TFmode when !v9. We require offsettable memory addresses. + * config/sparc/sparc.h (ALTER_HARD_SUBREG): Handle TFmode to + DFmode register number conversions. + * config/sparc/sparc.md (define_split DFmode moves): If register + is a SUBREG do alter_subreg on it before using. + (define_expand movtf): Fixup comment about alignment on v9. + (define_split TFmode moves): Don't use gen_{high,low}part, create + explicit SUBREGs instead. + +Mon Aug 10 19:02:55 1998 John Carr + + * Makefile.in (mbchar.o): Depend on mbchar.c. + +Mon Aug 10 04:28:13 1998 David S. Miller + Richard Henderson + + Rewrite SPARC backend for better code generation and + improved sparc64 support. + * config/sparc/sp64-elf.h: Set JUMP_TABLES_IN_TEXT_SECTION to + zero. + * config/sparc/sysv4.h: Likewise. + * config/sparc/sparc.c (v8plus_regcmp_p, sparc_operand, + move_operand, v8plus_regcmp_op, emit_move_sequence, + singlemove_string, doublemove_string, mem_aligned_8, + output_move_double, output_move_quad, output_fp_move_double, + move_quad_direction, output_fp_move_quad, output_scc_insn): + Remove. + (small_int_or_double): New predicate. + (gen_compare_reg): Remove TARGET_V8PLUS cmpdi_v8plus emission. + (legitimize_pic_address): Emit movsi_{high,lo_sum}_pic instead of + old pic_{sethi,lo_sum}_si patterns. + (mem_min_alignment): New generic function to replace + mem_aligned_8, which uses REGNO_POINTER_ALIGN information when + available and can test for arbitrary alignments. All callers + changed. + (save_regs, restore_regs, build_big_number, + output_function_prologue, output_cbranch, output_return, + sparc_flat_save_restore, sparc_flat_output_function_prologue, + sparc_flat_output_function_epilogue): Prettify + insn output. + (output_function_epilogue): Likewise and add code to output + deferred case vectors. + (output_v9branch): Likewise, add new arg INSN and use it to tack + on branch prediction settings. All callers changed. + (print_operand): Likewise and output %l44 for LO_SUMs when + TARGET_CM_MEDMID. + (sparc_splitdi_legitimate): New function to make sure DImode + splits can be run properly when !arch64. + (sparc_initialize_trampoline, sparc64_initialize_trampoline): + Reformat example code in comments. + (set_extends): Remove UNSPEC/v8plus_clear_high case. + (sparc_addr_diff_list, sparc_addr_list): New statics to keep track + of deferred case vectors we need to output. + (sparc_defer_case_vector): Record a case vector. + (sparc_output_addr_vec, sparc_output_addr_diff_vec, + sparc_output_deferred_case_vectors): New functions to output them. + (sparc_emit_set_const32): New function to form 32-bit constants in + registers when that requires more than one instruction. + (safe_constDI, sparc_emit_set_const64_quick1, + sparc_emit_set_const64_quick2, sparc_emit_set_const64_longway, + analyze_64bit_constant, const64_is_2insns, + create_simple_focus_bits, sparc_emit_set_const64): New functions + which do the same for 64-bit constants when arch64. + (sparc_emit_set_symbolic_const64): New function to emit address + loading for all code models on v9. + * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Do not make + %g1 fixed when arch64, unfix %g0 when TARGET_LIVE_G0. + (ALTER_HARD_SUBREG): Fix thinko, return REGNO + 1 not 1. + (SECONDARY_INPUT_RELOAD_CLASS, SECONDARY_OUTPUT_RELOAD_CLASS): Fix + inaccuracies in comments, add symbolic and text_segment operands + when TARGET_CM_MEDANY and TARGET_CM_EMBMEDANY respectively. Use + GENERAL_REGS in these cases as a temp REG is needed to load these + addresses into a register properly. + (EXTRA_CONSTRAINT): Document more accurately, remove Q case as it + is no longer used. + (GO_IF_LEGITIMATE_ADDRESS): Allow TFmode for LO_SUM on v9 since fp + quads are guaranteed to have 16-byte alignment. + (LEGITIMIZE_ADDRESS): For SYMBOL_REF, CONST, and LABEL_REF use + copy_to_suggested_reg instead of explicit LO_SUM and HIGH. + (ASM_OUTPUT_ADDR_VEC, ASM_OUTPUT_ADDR_DIFF_VEC): New macros for + deferred case vector implementation. + (ASM_OUTPUT_ADDR_VEC_ELT): Use fputc to output newline. + (ASM_OUTPUT_ADDR_DIFF_ELT): Parenthesize LABEL in macro calls. + Generate "internal label - label" instead of "label - 1b". + (PRINT_OPERAND_ADDRESS): For LO_SUM use %l44 on TARGET_CM_MEDMID. + (PREDICATE_CODES): Remove sparc_operand, move_operand, + v8plus_regcmp_op. Add small_int_or_double, input_operand, and + zero_operand. + (doublemove_string, output_block_move, output_fp_move_double, + output_fp_move_quad, output_move_double, output_move_quad, + output_scc_insn, singlemove_string, mem_aligned_8, move_operand, + sparc_operand, v8plus_regcmp_op, v8plus_regcmp_p): Remove externs. + (sparc_emit_set_const32, sparc_emit_set_const64, + sparc_emit_set_symbolic_const64, input_operand, zero_operand, + mem_min_alignment, small_int_or_double): Add externs. + * config/sparc/sparc.md: Document the many uses of UNSPEC and + UNSPEC_VOLATILE in this backend. + (define_function_unit ieu): Rename to ieu_unnamed. Add move and + unary to types which execute in it. + (define_function_unit ieu_shift): Rename to ieu0. + (define_function_unit ieu1): New, executes compare, call, and + uncond_branch type insns. + (define_function_units for type fdivs, fdivd, fsqrt): These + execute in the fpu multiply unit not the adder on UltraSPARC. + (define_expand cmpdi): Disallow TARGET_V8PLUS. + (define_insn cmpsi_insn): Rename to cmpsi_insn_sp32. + (define_insn cmpsi_insn_sp64): New, same as sp32 variant except it + allows the arith_double_operand predicate and rHI constraint when + TARGET_ARCH64. + (define_insn cmpdi_sp64, cmpsf_fpe, cmpdf_fpe, cmptf_fpe, + cmpsf_fp, cmpdf_fp, cmptf_fp, sltu_insn, neg_sltu_insn, + neg_sltu_minux_x, neg_sltu_plus_x, sgeu_insn, neg_sgeu_insn, + sltu_plus_x, sltu_plus_x, sltu_plus_x_plus_y, x_minus_sltu, + sgeu_plus_x, x_minus_sgeu, movqi_cc_sp64, movhi_cc_sp64, + movsi_cc_sp64, movdi_cc_sp64, movsf_cc_sp64, movdf_cc_sp64, + movtf_cc_sp64, movqi_cc_reg_sp64, movhi_cc_reg_sp64, + movsi_cc_reg_sp64, movdi_cc_reg_sp64, movsf_cc_reg_sp64, + movdf_cc_reg_sp64, movtf_cc_reg_sp64, zero_extendhisi2_insn, + cmp_siqi_trunc, cmp_siqi_trunc_set, sign_extendhisi2_insn, + sign_extendqihi2_insn, sign_extendqisi2_insn, + sign_extendqidi2_insn, sign_extendhidi2_insn, + extendsfdf2, extendsftf2, extenddftf2, truncdfsf2, trunctfsf2, + trunctfdf2, floatsisf2, floatsidf2, floatsitf2, floatdisf2, + floatdidf2, floatditf2, fix_truncsfsi2, fix_truncdfsi2, + fix_trunctfsi2, fix_truncsfdi2, fix_truncdfdi2, fix_trunctfdi2, + adddi3_sp64, addsi3, cmp_ccx_plus, cmp_cc_plus_set, subdi_sp64, + subsi3, cmp_minus_ccx, cmp_minus_ccx_set, mulsi3, muldi3, + muldi3_v8plus, cmp_mul_set, mulsidi3, mulsidi3_v8plus, + const_mulsidi3_v8plus, mulsidi3_sp32, const_mulsidi3, + smulsi3_highpart_v8plus, unnamed subreg mult, + const_smulsi3_highpart_v8plus, smulsi3_highpart_sp32, + const_smulsi3_highpart, umulsidi3_v8plus, umulsidi3_sp32, + const_umulsidi3, const_umulsidi3_v8plus, umulsi3_highpart_v8plus, + const_umulsi3_highpart_v8plus, umulsi3_highpart_sp32, + const_umulsi3_highpart, divsi3, divdi3, cmp_sdiv_cc_set, udivsi3, + udivdi3, cmp_udiv_cc_set, smacsi, smacdi, umacdi, anddi3_sp64, + andsi3, and_not_di_sp64, and_not_si, iordi3_sp64, iorsi3, + or_not_di_sp64, or_not_si, xordi3_sp64, xorsi3, xor_not_di_sp64, + xor_not_si, cmp_cc_arith_op, cmp_ccx_arith_op, + cmp_cc_arith_op_set, cmp_ccx_arith_op_set, cmp_ccx_xor_not, + cmp_cc_xor_not_set, cmp_ccx_xor_not_set, cmp_cc_arith_op_not, + cmp_ccx_arith_op_not, cmp_cc_arith_op_not_set, + cmp_ccx_arith_op_not_set, negdi2_sp64, cmp_cc_neg, cmp_ccx_neg, + cmp_cc_set_neg, cmp_ccx_set_neg, one_cmpldi2_sp64, cmp_cc_not, + cmp_ccx_not, cmp_cc_set_not, cmp_ccx_set_not, addtf3, adddf3, + addsf3, subtf3, subdf3, subsf3, multf3, muldf3, mulsf3, + muldf3_extend, multf3_extend, divtf3, divdf3, divsf3, negtf2, + negdf2, negsf2, abstf2, absdf2, abssf2, sqrttf2, sqrtdf2, sqrtsf2, + ashlsi3, ashldi3, unnamed DI ashift, cmp_cc_ashift_1, + cmp_cc_set_ashift_1, ashrsi3, ashrdi3, unnamed DI ashiftrt, + ashrdi3_v8plus, lshrsi3, lshrdi3, unnamed DI lshiftrt, + lshrdi3_v8plus, tablejump_sp32, tablejump_sp64, call_address_sp32, + call_symbolic_sp32, call_address_sp64, call_symbolic_sp64, + call_address_struct_value_sp32, call_symbolic_struct_value_sp32, + call_address_untyped_struct_value_sp32, + call_symbolic_untyped_struct_value_sp32, call_value_address_sp32, + call_value_symbolic_sp32, call_value_address_sp64, + call_value_symbolic_sp64, branch_sp32, branch_sp64, + flush_register_windows, goto_handler_and_restore, + goto_handler_and_restore_v9, goto_handler_and_restore_v9_sp64, + flush, all ldd/std peepholes, return_qi, return_hi, return_si, + return_addsi, return_di, return_adddi, return_sf, all call+jump + peepholes, trap, unnamed trap insns): Prettify output strings. + (define_insn anddi3_sp32, and_not_di_sp32, iordi3_sp32, + or_not_di_sp32, xordi3_sp32, xor_not_di_sp32, one_cmpldi2): + Likewise and force + implement splits for integer cases. + (define_insn return_sf_no_fpu): Likewise and allow to match when + no-fpu because of our subreg SFmode splits. + (define_insn zero_extendqihi2, zero_extendqisi2_insn, + zero_extendqidi2_insn, zero_extendhidi2_insn, + zero_extendsidi2_insn, sign_extendsidi2_insn): Likewise and use + input_operand for second operand. + (cmp_minus_cc, cmp_minus_cc_set): Likewise and use + reg_or_0_operand for operand 2 so new splits can use it. + (cmp_zero_extendqisi2, cmp_zero_extendqisi2_set, cmp_cc_plus, + cmp_cc_xor_not): Likewise and don't forget to check TARGET_LIVE_G0 + too. + (cmp_zero_extract, cmp_zero_extract_sp64): Likewise and allow + CONST_DOUBLEs for operand 2. + (define_insn move_label_di): Likewise and label distance + optimization because it no longer works with new deferred case + vector scheme. To be revisited. + (define_insn x_minus_y_minus_sltu, x_minus_sltu_plus_y): Likewise + and allow reg_or_0_operand and J constraint for second operand. + (define_insn jump): Set branch predict taken on V9. + (define_insn tablejump): Emit LABEL_REF + PLUS memory address for + new deferred case vector scheme. + (define_insn pic_tablejump_32, pic_tablejump_64): Remove. + (define_insn negdi2_sp32): Force + implement splits. + (define_insn negsi2, one_cmplsi2): Rename to negsi2_not_liveg0 and + one_cmplsi2_not_liveg0 respectively, and create expander of original + names which emit special rtl for TARGET_LIVE_G0. + (define_insn cmpdi_v8plus, scc_si, scc_di): Remove. + (define_insn seq, sne, slt, sge, sle, sltu, sgeu): Don't do + gen_compare_reg, FAIL instead. + (define_insn sgtu, sleu): Likewise and check gen_s*() return + values when trying to reverse condition codes, if they FAIL then + do likewise. + (define_insn snesi_zero, neg_snesi_zero, snesi_zero_extend, + snedi_zero, neg_snedi_zero, snedi_zero_trunc, seqsi_zero, + neg_seqsi_zero, seqsi_zero_extend, seqdi_zero, neg_seqdi_zero, + seqdi_zero_trunc, x_plus_i_ne_0, x_minus_i_ne_0, x_plus_i_eq_0, + x_minus_i_eq_0): Add new splits to perform these multi-insn cases, + set output string to # to indicate they are mandatory splits. + (define_insn pic_lo_sum_si, pic_sethi_si, pic_lo_sum_di, + pic_sethi_di, move_pic_label_si): Remove. + (define_insn movsi_low_sum, movsi_high, movsi_lo_sum_pic, + movsi_high_pic, movsi_pic_label_reg): New patterns to take their + place. + (define_expand movsi_pic_label_ref, define_insn + movsi_high_pic_label_ref, movsi_lo_sum_pic_label_ref): New + expander and insns to handle PIC label references and deferred + case vectors. + (define_insn get_pc_via_rdpc): Comment out as it is no longer + used. + (define_expand movqi, movhi, movsi, movdi, movsf, movdf, movtf): + Rewrite to not use emit_move_sequence, make use of new constant + formation code, and new splits for all multi-insn cases. + (define_insn movqi_insn): Remove sethi case, it can never happen. + Use reg_or_zero_operand instead of const0_rtx explicit test, + use input_operand instead of move_operand for source, and use + general_operand now for dest. + (define_insn movhi_insn): Similar but leave sethi case. + (define_insn lo_sum_qi, store_qi, store_hi): Remove. + (define_insn sethi_hi lo_sum_hi): Rename to movhi_high and + movhi_lo_sum respectively, prettify output string. + (define_insn movsi_zero_liveg0): New pattern to put zero into a + register when needed on TARGET_LIVE_G0. + (define_insn movsi_insn): Use general_operand and input_operand + for dest and src respectively. Simplify applicability test. + Prettify output strings, and add clr alternative for J + constraint. + (define_insn movdi_sp32_v9, movdi_sp32, define_splits for + deprecated std and reg-reg DI moves): Remove and... + (define_insn movdi_insn_sp32, movdi_insn_sp64): Replace with new + implementation which uses forced splits for all non-single insn + cases. + (define_split DI move cases on !arch64): New splits to handle all + situations of 64-bit double register DImode on 32bit, and + unaligned registers and memory addresses for all subtargets. + (define_insn movsf_const_insn, movdf_const_insn, store_sf): + Remove. + (define_insn movsf_insn, movsf_no_f_insn): Use general_operand and + input_operand for dest and src respectively, prettify output + strings. + (define_insn movdf_insn, movdf_no_e_insn, store_df, + movtf_const_insn, movtf_insn, movtf_no_e_insn, store_tf): Remove + and... + (define_insn movdf_insn_sp32, movdf_no_e_insn_sp32, + movdf_insn_sp64, movdf_no_e_insn_sp64, movtf_insn, + movtf_no_e_insn_sp32, movtf_insn_hq_sp64, movtf_insn_sp64, + movtf_no_e_insn_sp64): Replace with new + implementation which uses forced splits for all non-single insn + cases. + (define_split DF move cases): New splits in similar vein to DI + move counterparts. + (define_insn sethi_di_medlow, sethi_di_medium_pic, + sethi_di_embmedany_data, sethi_di_embmedany_text, sethi_di_sp64, + movdi_sp64_insn): Remove old v9 code model and constant loading + support insns and.. + (define_insn pic_lo_sum_di, pic_sethi_di, + sethi_di_medlow_embmedany_pic, sethi_di_medlow, losum_di_medlow, + seth44, setm44, setl44, sethh, setlm, sethm, setlo, + embmedany_sethi, embmedany_losum, embmedany_brsum, + embmedany_textuhi, embmedany_texthi, embmedany_textulo, + embmedany_textlo, movdi_lo_sum_sp64_cint, movdi_lo_sum_sp64_dbl, + movdi_high_sp64_cint, movdi_high_sp64_dbl): Replace with new + scheme, using unspecs, secondary reloads, and one to one sparc + insn to rtl insn mapping for better scheduling and code gen. + (define_expand reload_indi, reload_outdi): Reload helpers for + MEDANY and EMBMEDANY symbol address loading cases which require a + temporary register. + (define_expand movsicc): Remove v8plus_regcmp cases. + (define_insn movdi_cc_sp64_trunc, movdi_cc_reg_sp64_trunc, + cmp_zero_extendqidi2, cmp_zero_extendqidi2_set, cmp_qidi_trunc, + cmp_diqi_trunc_set): New patterns used by some of the new scc + splits on arch64. + (define_insn xordi3_sp64_dbl): New pattern used for constant + formation when crossing from 32-bit targets. + (define_insn movsi_cc_reg_v8plus, v8plus_clear_high, and helper + split): Remove. + (define_insn addx, subx): Make visible and prettify. + (define_insn adddi3_insn_sp32): Likewise and force split. + (define_insn addx_extend, subx_extend, unnamed): New patterns for + 64bit scc split usage. + (define_insn unnamed plusDI zero_extend, unnamed minusDI + zero_extend, subdi3): Force and implement splits. + + * final.c (final_scan_insn): Don't output labels if target + specifies ASM_OUTPUT_ADDR_{DIFF}_VEC. Do these macro operations + instead. + + * reorg.c (dbr_schedule): When taking on BR_PRED notes at the end, + don't forget to walk inside SEQUENCESs too as these are what the + delay slot scheduler will create. + +Mon Aug 10 01:21:01 1998 Richard Henderson + + * alpha.md (extxl+1,+2): New patterns to work around + combine lossage. + +Sat Aug 8 19:20:22 1998 Gary Thomas (gdt@linuxppc.org) + + * rs6000.c (rs6000_allocate_stack_space): Fix typo which + caused bad assembly code to be generated. + +Sat Aug 8 18:53:28 1998 Jeffrey A Law (law@cygnus.com) + + * netbsd.h: Fix typo. + +Mon Aug 3 00:06:42 1998 Robert Lipe + + * config.sub: Fix typo. + +Sun Aug 2 22:39:08 1998 Hans-Peter Nilsson + + * invoke.texi (Environment Variables): Typo: Change "ascpects" + into "aspects". + (Running Protoize): Typo: Change "ther" into "other". + +Sun Aug 2 00:42:50 1998 Jeffrey A Law (law@cygnus.com) + + * i386/netbsd.h: Undo previous change to DWARF2_UNWIND_INFO. + * m68k/netbsd.h: Likewise. + * ns32k/netbsd.h: Likewise. + * sparc/netbsd.h: Likewise. + +Sat Aug 1 17:59:30 1998 Richard Henderson + + * ginclude/va-alpha.h (va_list): Use a typedef, not a define. + * ginclude/va-clipper.h (va_list): Likewise. + +Fri Jul 31 20:22:02 1998 Michael Meissner + + * rs6000.c (rs6000_override_options): If big endian and -Os, use + load/store multiple instructions unless user overrides. + +Fri Jul 31 17:08:59 1998 Jeffrey A Law (law@cygnus.com) + + * ns32k/netbsd.h: Fix typo. + +Fri Jul 31 10:23:55 1998 Doug Evans + + * m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Always output line number + labels with .debugsym if no parallel insns. + +Thu Jul 30 19:15:53 1998 Richard Henderson + + * alpha.md (fp cmp): Replicate patterns for ALPHA_TP_INSN. + (fcmov): Remove ALPHA_TP_INSN patterns -- fcmov doesn't trap. + +Thu Jul 30 19:50:15 1998 David Edelsohn + + * rs6000/x-aix43 (AR_FOR_TARGET_FLAGS): Delete. + (AR_FOR_TARGET): Define. + +Thu Jul 30 12:29:12 1998 Mark Mitchell + + * dyn-string.h: New file. + * dyn-string.c: Likewise. + * Makefile.in (OBJS): Add dyn-string.o. + (dwarf2out.o): Add dyn-string.h dependency. + (dyn-string.o): List dependencies. + * dwarf2out.c: Include dyn-string.h. + (ASM_NAME_TO_STRING): Use dyn_string_append, rather than strcpy. + (addr_const_to_string): Take a dyn_string_t, not a char* as a + prototype. Use dyn_string_append rather than strcat, throughout. + (addr_to_string): Use dyn_string_t. + +Thu Jul 30 13:08:07 1998 Ken Raeburn + + Function entry/exit profiling instrumentation: + * expr.h (profile_function_entry_libfunc, + profile_function_exit_libfunc): Declare new variables. + * optabs.c: Define them here. + (init_optabs): Initialize them. + * tree.h (struct tree_decl): New flag + no_instrument_function_entry_exit. + (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT): New accessor macro. + * c-decl.c (duplicate_decls): Merge it. + * c-common.c (enum attrs): New value A_NO_INSTRUMENT_FUNCTION. + (init_attributes): Use it for "no_instrument_function". + (decl_attributes): Handle it, for functions that have not yet been + compiled. Set decl flag. + * flags.h (flag_instrument_function_entry_exit): Declare new + variable. + * toplev.c (flag_instrument_function_entry_exit): Define it here. + (f_options): New option "instrument-functions". + * function.h (struct function): New field instrument_entry_exit. + * function.c (current_function_instrument_entry_exit): New + variable. + (push_function_context_to, pop_function_context_from): Save and + restore. + (expand_function_start): Set current_ variable, maybe emit return + label and entry profile call. + (expand_function_end): Maybe emit exit profile call. + +Thu Jul 30 00:58:34 1998 Jeffrey A Law (law@cygnus.com) + + * i386.md (movqi): When optimizing a load of (const_int 1) into a + NON_QI_REG_P, pretend the register is SImode. + +Wed Jul 29 23:49:23 1998 Todd Vierling + + * configure.in: Use xm-netbsd.h as the NetBSD xm file (not xm-siglist). + Accept arm32 as arm, m68k4k as m68k, mipsle as mips-dec, and any + manufacturer id for ns32k. + * configure: Regenerated. + * config/netbsd.h: When using ASM_WEAKEN_LABEL, make it global too. + * config/t-netbsd: Don't compile libgcc1-test as the fns are in libc. + * config/i386/netbsd.h: Undefine DWARF2_UNWIND_INFO, not define as 0. + * config/m68k/netbsd.h: Same. + * config/ns32k/netbsd.h: Same. + * config/sparc/netbsd.h: Same. + +Wed Jul 29 22:39:21 1998 Jeffrey A Law (law@cygnus.com) + + * unroll.c (unroll_loop): Do not abort for an UNROLL_MODULO + or UNROLL_COMPLETELY loop that starts with a jump to its + exit code. + +Wed Jul 29 22:18:14 1998 David Edelsohn + + * rs6000/rs6000.md (absdi2 define_split): Swap operands of MINUS. + * rs6000/rs6000.c (mask64_operand): Use HOST_BITS_PER_WIDE_INT. + (print_operand, case 'B'): Don't fall through. + (print_operand, case 'S'): Correct mask begin/end computation. + Use HOST_BITS_PER_WIDE_INT. + * rs6000/rs6000.h (CPP_PREDEFINES): Define _LONG_LONG. + (CONDITIONAL_REGISTER_USAGE): GPR13 fixed if TARGET_64BIT. + * rs6000/aix41.h (CPP_PREDEFINES): Same. + * rs6000/aix43.h (CPP_PREDEFINES): Same. + +Wed Jul 29 11:47:10 1998 Nick Clifton + + * config/arm/thumb.md (extendqisi2_insn): Remove earlyclobber + constraint from second alternative. + +Tue Jul 28 23:29:04 1998 Jason Merrill + + * configure.in: Fix --without/--disable cases for local-prefix, + gxx-include-dir and checking. + +Tue Jul 28 22:01:23 1998 David S. Miller + + * configure.in (enable_haifa): Set by default for sparc64 too. + configure: Rebuilt. + +Tue Jul 28 23:29:04 1998 Jason Merrill + + * i386/cygwin32.h (VALID_MACHINE_TYPE_ATTRIBUTE): New macro. + * i386/winnt.c (associated_type): New fn. + (i386_pe_valid_type_attribute_p): New fn. + (i386_pe_check_vtable_importexport): Remove. + (i386_pe_dllexport_p): Use associated_type. + (i386_pe_dllimport_p): Likewise. + + From Antonio M. O. Neto : + * i386.c (i386_valid_type_attribute_p): Also accept + attributes for METHOD_TYPEs. + +Tue Jul 28 23:17:39 1998 Peter Gerwinski + + * tree.c (build_range_type): Copy TYPE_SIZE_UNIT. + +Tue Jul 28 22:31:12 1998 Craig Burley + + * gcc.c: Fix commentary describing %g, %u, %U, and %O. + + * gcc.c (do_spec_1): Fix handling of %g%O and %U%O to prevent + them from generating a new base name for each occurrence of + a specific suffix. + +1998-07-28 Vladimir N. Makarov + + * cse.c (cse_insn): Enable substitution inside libcall only for REG, + SUBREG, MEM. + * rtlanal.c (replace_rtx): Prohibit replaces in CONST_DOUBLE. + + * cplus-dem.c (type_kind_t): New type. + (demangle_template_value_parm): Add type_kind_t parameter. Rely + on this parameter, rather than demangling the type again. + (demangle_integral_value): Pass tk_integral. + (demangle_template_: Pass the value returned from do_type. + (do_type): Return a type_kind_t. Pass tk_integral to + demangle_template_value_parm for array bounds. + (demangle_fund_type): Likewise. + +Mon Jul 27 00:54:41 1998 Jason Merrill + + * tree.c (simple_cst_equal, case CONSTRUCTOR): OK if the elts are + identical. + +Mon Jul 27 22:18:36 1998 Jeffrey A Law (law@cygnus.com) + + * pa.c (move_operand): Accept CONSTANT_P_RTX. + +Mon Jul 27 17:18:52 1998 Dave Brolley + + * stor-layout.c (layout_type): Handle arrays of bits, for Chill. + + * expr.c (get_inner_reference): Handle zero-based, unsigned, array + index conversion. + +Mon Jul 27 14:51:33 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.h (DEBUGGER_AUTO_OFFSET): Define. + (DEBUGGER_ARG_OFFSET): Likewise. + + * mn10300.md (movsf): Remove last change. Not needed. + +Mon Jul 27 14:22:36 1998 Dave Brolley + + * c-lex.c (yylex): Fix boundary conditions in character literal and + string literal loops. + +Mon Jul 27 11:43:54 1998 Stan Cox + + * longlong.h (count_leading_zeros): SPARClite scan instruction was + being invoked incorrectly. + + * i386.c (ix86_prologue): Added SUBTARGET_PROLOGUE invocation. + * i386/cygwin32.h (STARTFILE_SPEC, LIB_SPEC, SUBTARGET_PROLOGUE): + Add -pg support. + * i386/win32.h: New file. Hybrid mingw32.h/cygwin32.h configuration. + * configure.in: Added i[34567]86-*-win32. + * config.sub: Likewise. + * configure: Rebuilt. + +Sun Jul 26 01:11:12 1998 H.J. Lu (hjl@gnu.org) + + * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating + the frame pointer and compiling PIC code and reload has not completed. + + * i386.c (output_to_reg): Add code to emulate non-popping DImode + case. + +Sun Jul 26 01:01:32 1998 Jeffrey A Law (law@cygnus.com) + + * regmove.c (regmove_optimize): Fix typo initializing regmove_bb_head. + +Sat Jul 25 23:29:23 1998 Gerald Pfeifer + + * Makefile.in (install-info): Only try to update the info + directory file if it exists in the first place. + +Fri Jul 24 18:58:37 1998 Klaus Espenlaub + + * rs6000.h (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Delete. + +Fri Jul 24 14:20:26 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.md (movqi, movhi, movsi, movsf): Correctly handle + CONST_DOUBLE source. + +Fri Jul 24 11:17:04 1998 Nick Clifton + + * config/arm/thumb.c (thumb_print_operand): Decode %_ in asm + strings as the insertion of USER_LABEL_PREFIX. + * config/arm/thumb.h (PRINT_OPERAND_PUNCT_VALID_P): Accept _ as a + valid code. + * config/arm/thumb.md: Use %_ as a prefix to gcc library function + calls. + +Thu Jul 23 18:53:20 1998 Jim Wilson + + * dbxout.c (dbxout_range_type): Only call dbxout_type_index for + already defined type. + +Thu Jul 23 13:49:41 1998 Jeffrey A Law (law@cygnus.com) + + * expr.c (check_max_integer_computation_mode): Allow conversions + of constant integers to MAX_INTEGER_COMPUTATION_MODE. + (expand_expr): Likewise. + +Thu Jul 23 11:12:06 1998 Alexandre Petit-Bianco + + * expr.c (expand_expr): Expand RETURN_EXPR. + +Thu Jul 23 11:00:29 1998 Jim Wilson + + * dwarf2out.c (dwarf2out_finish): Call stripattributes on TEXT_SECTION. + +Wed Jul 22 19:10:00 1998 Catherine Moore + + * dwarf2out.c (output_aranges): Call stripattributes + for TEXT_SECTION references. + (output_line_info): Likewise. + +Wed Jul 22 14:08:54 1998 David S. Miller + + * profile.c (branch_prob): Call allocate_reg_info after outputting + profile rtl in instrument_arcs. + +Wed Jul 22 12:47:49 1998 Jim Wilson + + * fixinc.irix (math.h): Install wrapper instead of copying. + +Wed Jul 22 12:37:14 1998 Alexandre Petit-Bianco + + * tree.def (EXPR_WITH_FILE_LOCATION): Defined as an 'e' expression + so WFL are expanded correctly when contained in a COMPOUND_EXPR. + * tree.h (EXPR_WFL_EMIT_LINE_NOTE): Change macro not to use + lang_flag_0. Added documentation in the flag table. + +Tue Jul 21 23:28:35 1998 Klaus Kaempf + + * cccp.c (do_include): Fix vax c style include handling. + +Tue Jul 21 13:28:19 1998 Jason Merrill + + * cplus-dem.c (do_type): Use demangle_template_value_parm for arrays. + +Sun Jul 12 01:27:05 1998 Jason Merrill + + * fold-const.c (non_lvalue): Don't deal with null pointer + constants here. + (fold, case COMPOUND_EXPR): Wrap a constant 0 in a NOP_EXPR. + +Tue Jul 21 15:49:31 1998 David Edelsohn + + * rs6000.h (PREDICATE_CODES): Add CONSTANT_P_RTX. + * rs6000.md (movsi, movdi): Add CONSTANT_P_RTX. + * rs6000.c (short_cint_operand): Add CONSTANT_P_RTX. + (u_short_cint_operand): Same. + (reg_or_cint_operand): Same. + (logical_operand): Same. + (input_operand): Same. + (reg_or_short_operand): Use u_short_cint_operand. + +Tue Jul 21 08:56:42 1998 Richard Henderson + + * alpha.md (fix_truncdfsi2, fix_truncsfsi2): Remove the define_expands, + but keep the insns and splits. Adjust so when the ultimate destination + is memory, use cvtql. + +Tue Jul 21 08:55:09 1998 Richard Henderson + + * flow.c (regno_uninitialized): Fixed regs are never uninitialized. + +Tue Jul 21 00:31:01 1998 Jeffrey A Law (law@cygnus.com) + + * gcc.c (do_spec): Call "error" not "warning". + + * configure.in: Fix minor problems with gas feature detection code. + * configure: Rebuilt. + + * gcc.c (do_spec): Issue a warning for '%[]' usage. + + * Undo this change. + * gcc.c: Delete %[spec] support. + (do_spec_1, case '('): Likewise. + (do_spec_1, case '['): Call error. + +Mon Jul 20 22:34:17 1998 Richard Henderson + + * alpha.h (CPP_SPEC): Tidy. Hook to cpp_cpu and cpp_subtarget. + (CPP_SUBTARGET_SPEC): Default to empty string. + (CPP_AM_*, CPP_IM_*, CPP_CPU_*, CPP_CPU_SPEC): New. + (EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): New. + * alpha/elf.h (LD_SPEC): Use %(elf_dynamic_linker). + * alpha/linux-elf.h (SUBTARGET_EXTRA_SPECS): New. + (LIB_SPEC): Tidy. + * alpha/linux.h (CPP_PREDEFINES): Tidy. + * alpha/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): New. + * alpha/netbsd.h (CPP_PREDEFINES): Tidy. + * alpha/osf.h (CPP_PREDEFINES): Remove bits subsumed by CPP_CPU_SPEC. + * alpha/win-nt.h (CPP_PREDEFINES): Likewise. + * alpha/vsf.h (CPP_PREDEFINES): Likewise. + (CPP_SUBTARGET_SPEC): New. Do this instead of overriding CPP_SPEC. + * alpha/vxworks.h: Likewise. + +Mon Jul 20 22:51:57 1998 Ken Raeburn + + * mips.md (reload_outsi): Added missing REGNO call. + (smulsi3_highpart, umulsi3_highpart): Provide prototype for + function pointer. + (mul_acc_di, mul_acc_64bit_di): Don't use match_op_dup, use + another match_operator and compare the codes. + + * mips.h (MASK_DEBUG_E, MASK_DEBUG_I): Set to zero. + + * MIPS multiply pattern fixes: + * mips.h (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): + Add union classes for HI, LO, or HILO plus general registers. + (GENERATE_MADD): Deleted. + * mips.md (mulsi3_mult3): Don't disparage output-LO alternative. + Add TARGET_MAD to condition. + (mulsi3): Test HAVE_mulsi3_mult3, not specific flags. + (mul_acc_si): Expand GENERATE_MADD here; it's the only use. Use + "*d" for accumulator, to give preference to LO initially but not + during reload. + +Mon Jul 20 16:16:38 1998 Dave Brolley + + * configure.in (enable_c_mbchar): New configure option. + (extra_cpp_objs): Always available now. + + * cexp.y (mbchar.h): #include it. + (yylex): Handle Multibyte characters in character literals. + + * cccp.c (mbchar.h): #include it. + (main): Set character set based on LANG environment variable. + (rescan): Handle multibyte characters in comments. + (skip_if_group): See above. + (validate_else): See above. + (skip_to_end_of_comment): See above. + (macarg1): See above. + (discard_comments): See above. + (rescan): Handle multibyte characters in string and character literals. + (collect_expansion): See above. + (skip_quoted_string): See above. + (macroexpand): See above. + (macarg1): See above. + (discard_comments): See above. + (change_newlines): See above. + + * c-lex.c (mbchar.h): #include it. + (GET_ENVIRONMENT): New macro. + (init_lex): Set character set based on LANG environment variable. + (yylex): Handle multibyte characters in character literals. + (yylex): Handle multibyte characters in string literals. + + * Makefile.in (mbchar.o): New target. + (cccp$(exeext)): @extra_cpp_objs@ is always available. + (cppmain$(exeext)): @extra_cpp_objs@ is always available. + + * mbchar.[ch]: New files for multibyte character handling. + +Mon Jul 20 01:11:11 1998 David S. Miller + + * jump.c (jump_optimize): When simplifying noop moves and + PUSH_ROUNDING, fix thinko so we use same criterion for identifying + the PUSHes to rewrite in second loop as we did in the first. + +Sun Jul 19 08:23:53 1998 Kaveh R. Ghazi + + * cplus-dem.c (demangle_nested_args): Make function definition + static to match the prototype. + +Fri Jul 17 14:58:44 1998 Richard Henderson + + * alloca.c: Respect USE_C_ALLOCA. + * gencheck.c (xmalloc): Ignore __GNUC__ for definition. + * gengenrtl.c (xmalloc): Likewise. + +Fri Jul 17 14:18:14 1998 Richard Henderson + + * loop.h (struct induction): Add no_const_addval. + * loop.c (the_movables, reg_address_cost): New variables. + (init_loop): Init reg_address_cost. + (loop_optimize): Call end_alias_analysis. + (scan_loop): Init the_movables. + (record_giv): Init induction->no_const_addval. + (basic_induction_var) [PLUS]: Use rtx_equal_p instead of ==. + [REG]: Rearrange loop search test to catch more cases. + (general_induction_var): Return success not benefit; take an extra + argument for that. Change all callers. + (simplify_giv_expr) [PLUS]: Always combine invariants. Use sge_plus. + [MULT]: Use rtx_equal_p instead of ==. Combine simple invariants. + [default]: Search the_movables for additional combinations. + (sge_plus_constant, sge_plus): New functions. + (express_from_1): New function. + (express_from): Always define. Rewrite using express_from_1. + (combine_givs_p): Handle more cases. Ignore address cost. + (cmp_combine_givs_stats): New function. + (combine_givs_used_once, combine_givs_benefit_from): New functions. + (combine_givs): Rewrite to do best-fit combination. + + * fold-const.c (operand_equal_p): Handle RTL_EXPR. + (fold): Do a complete (A*C)+(B*C) association check. + +Fri Jul 17 11:21:55 1998 Jim Wilson + + * function.c (fixup_var_refs_insns): Handle CLOBBER of a CONCAT. + +Fri Jul 17 11:48:55 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.c (MODES_TIEABLE_P): Fix typo. + +Fri Jul 17 03:26:12 1998 Rihcard Earnshaw (rearnsha@arm.com) + + * tree.c (valid_machine_attribute): Only create a new type variant if + there is a decl to use it. + +Thu Jul 16 14:48:04 1998 Nick Clifton + + * gcc.c (do_spec_1): Cope with %g/%u/%U options which do not have + a suffix. + +Fri Jul 17 03:24:40 1998 Hans-Peter Nilsson + + * extend.texi (Explicit Reg Vars): Typo: change "may deleted" into "may + be deleted" + +Thu Jul 16 14:48:47 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.c (count_tst_insns): New arg oreg_countp. Callers changed. + Simplify tests for clearing an address register. + (expand_prologue): Corresponding changes. + + * mn10300.md (movXX patterns): Make sure the destination is an + ADDRESS_REG when substituting "zero_areg" for (const_int 0). + (logical patterns): Split into expanders + patterns. + (zero and sign extension patterns): Similarly. + (shift patterns): Similarly. + +Thu Jul 16 01:17:44 1998 Richard Henderson + + * loop.c (emit_iv_add_mult): Scan the entire insn list generated + for the sequence, recording base values. + +Wed Jul 15 10:49:55 1998 Richard Henderson + + * i386.h (CPP_CPU_SPEC): Remove -Asystem(unix). + +Tue Jul 14 14:15:30 1998 Nick Clifton + + * gcc.c: Remove ANSI-C ism from --help code. + + * toplev.c: Support --help with USE_CPPLIB. + +Tue Jul 14 14:46:08 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Rework gas feature code to work with symlink based + source trees. + + * extend.texi: Clarify some issues related to local variables + assigned to explicit registers. + + * mn10300.md (mulsi): Turn into expander + pattern. + + * mn10300.md (movsi, movsf, movdi, movdf): Remove "x" from I -> a + alternative. + +Tue Jul 14 07:41:59 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm/tcoff.h (USER_LABEL_PREFIX): Make it empty to match coff.h. + +Tue Jul 14 03:02:44 1998 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump again to distinguish mainline tree from the + egcs-1.1 branch. + +Tue Jul 14 02:20:38 1998 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump to avoid problems with old spec files during + bootstrap. + +Mon Jul 13 23:11:44 1998 David S. Miller + + * config/sparc/sparc.c (output_scc_insn): Enclose || conditions in + parens while walking over notes. + * config/sparc/sparc.md (reg movdi split): Clean up matching + conditions. + (all DI arithop splits on 32-bit): Handle immediate arguments + correctly when they are CONST_INTs. + +Mon Jul 13 23:57:21 1998 Kamil Iskra + + * m68k/m68k.h (TARGET_SWITCHES): Clear MASK_68040_ONLY for + -m68020-40, -m68020-60 and -m5200. + +Mon Jul 13 23:52:05 1998 Weiwen Liu + + * gcc.c (do_spec_1): Fix %O handling for secure temporary file + creation. + +Mon Jul 13 23:42:36 1998 Ralf Corsepius + + * sh/elf.h (MAX_OFILE_ALIGNMENT): Undefine before including svr4.h. + +Mon Jul 13 23:36:08 1998 Jim Wilson + + * i386/i386.h (CPP_486_SPEC, CPP_586_SPEC, CPP_686_SPEC): New specs. + (CPP_CPU_DEFAULT_SPEC, CPP_CPU_SPEC): Use them. + (EXTRA_SPECS): Support them. + * gcc.c: Delete %[spec] support. + (do_spec_1, case '('): Likewise. + (do_spec_1, case '['): Call error. + * i386/aix386ng.h, cygwin32.h, freebsd-elf.h, gas.h, isc.h, + linux-aout.h, linux-oldld.h, linux.h, osfelf.h, osfrose.h, sco.h, + sco4.h, sco4dbx.h, sco5.h, sol2.h, sysv3.h (CPP_SPEC): Delete + %[cpp_cpu]. + +Mon Jul 13 23:31:04 1998 Andreas Schwab + + * m68k.c (output_scc_di): Use cmpw #0 only for address registers. + +Mon Jul 13 23:26:43 1998 Jeffrey A Law (law@cygnus.com) + + * tree.h (tree_common): Note front-end dependencies on layout of + this structure. + +Mon Jul 13 23:18:39 1998 Craig Burley + + * stmt.c (expand_expr_stmt): If not assigning fresh + value to last_expr_value, zero it, so old garbage + doesn't get dereferenced. + +Mon Jul 13 23:06:55 1998 Henning.Petersen@t-online.de (Henning Petersen) + + * gcse.c (hash_scan_insn): Add missing argument declaration. + +Mon Jul 13 18:59:13 1998 Jim Wilson + + * configure.in (mips-sgi-irix5cross64, mips-sgi-irix5*): Remove + HAVE_INTTYPES_H from xm_defines. Define xm_file to mips/xm-iris5.h. + * mips/xm-iris5.h (USG): Delete. + +Mon Jul 13 17:18:47 1998 Nick Clifton + + * cccp.c (main): Add support for parsing --help. + (display_help): New function: display command line switches. + + * cpplib.c (cpp_handle_option): Add support for parsing --help. + (display_help): New function: display command line switches. + + * gcc.c (main): Add support for parsing --help, and passing it on + to the sub-processes invoked by gcc. + (display_help): New function: display command line switches. + + * tm.texi (TARGET_SWITCHES and TARGET_OPTIONS): Document + 'description' field added to structure. + + * toplev.c: Add support for parsing --help. + Add documentation strings to command line option tables. + (display_help): New function: display comman line switches. + +Mon Jul 13 16:15:10 1998 John Carr + + * sparc.c, sparc.h, sparc.md: New trampoline code. + Allow integer operand 1 to V8+ DImode shift instructions. + Fix bugs in V8+ wide multiply patterns. + In 32 bit mode, split DImode register moves and logical instructions. + Write V9 branch prediction flag. + Use V9 conditional move more often for scc. + +Mon Jul 13 15:10:09 1998 Philippe De Muyter + + * invoke.texi(-fno-builtin): Explain that the names of built-in + functions begin with `__builtin_', not `__'. + +Mon Jul 13 19:01:52 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_before_p): Abort for RELOAD_FOR_OUTPUT. + +Mon Jul 13 10:50:17 1998 Mark Mitchell + + * cplus-dem.c (SCOPE_STRING): Remove DMGL_JAVA stuff. + (cplus_demangle_opname): Initialize work. + (demangle_template): Remove is_java_array. + (do_type): Remove DMGL_JAVA stuff. + (long_options): Remove "java". + (main): Remove 'j' option. + +Mon Jul 13 10:19:00 1998 Jeffrey A Law (law@cygnus.com) + + * mn10300.h (REG_CLASS_FROM_LETTER): Map 'y' to SP_REGS. + Handle 'x' as NO_REGS for this cpu. + (REGNO_OK_FOR_BIT_BASE_P): Define. + (REG_OK_FOR_BIT_BASE_P): Define. + (GO_IF_LEGITIMATE_ADDRESS): Use them. + (REG_OK_FOR_INDEX_P): Tweak. + * mn13000.c (REG_SAVE_BYTES): Define. + (expand_epilogue, initial_offset): Use it. + (secondary_reload_class): Slightly reformat. + (output_tst): Tweak comments. + * mn10300.md: Change 'x' to 'y' for SP_REGS. Then add 'x' to many + patterns. + (addsi3): Turn into a define_expand/define_insn pair. Rework code for + three operand addition case to be more efficient. + (subsi3): Turn into a define_expand/define_insn pair. + + * expr.c (expand_expr): Only set MEM_IN_STRUCT_P if the memory address + is not varying for REFERENCE_TYPE or when we think we might have found + an optimized access to the first element in an array. + +Mon Jul 13 02:24:08 1998 David S. Miller + + * regclass.c (reg_scan_mark_refs): New arg min_regno. Only update + regscan information for REGs with numbers greater than or equal to + this. All callers changed. + (reg_scan_update): New function to efficiently update regscan + information on the fly. + * rtl.h: Add prototype. + * jump.c (jump_optimize): Call it when we make a transformation + which generates new pseudo-REGs. + +Sun Jul 12 13:08:14 1998 Jeffrey A Law (law@cygnus.com) + + * collect2.c (main): Use "-x c" instead of "-lang-c" for force the + compiler into C mode. + +Sun Jul 12 01:27:05 1998 Jason Merrill + + * cplus-dem.c (demangle_nested_args): Return a value. + + * tree.h (TYPE_P): New macro. + +Sat Jul 11 16:19:48 1998 Mark Mitchell + + * cplus-dem.c (string): Move definition before work_stuff. + (work_stuff): Add volatile_type, forgetting_types, + previous_argument, and nrepeats fields. + (SCOPE_STRING): New macro. + (demangle_template): Add `remember' parameter. Add comment. + Register the `B' code type here, if remembering. Tidy. Fix crash + on NULL tmpl_argvec. Be consistent with use of tname/trawname. + (demangle_nested_args): New function. + (internal_cplus_demangle): Handle volatile-qualified member + functions. + (mop_up): Delete the previous_argument string if present. + (demangle_signature): Tidy. Handle volatile-qualified member + functions. Handle back-references using the `B' code. Use extra + parameter to demangle_template and SCOPE_STRING where appropriate. + (demangle_template_value_parm): Fix thinko; 'B' is not an integral + code. + (demangle_class): Use SCOPE_STRING. + (gnu_special): Pass additional argument to demangle_template. + Use SCOPE_STRING. + (demangle_qualified): Save qualified types for later + back-references. Handle constructors and destructors for template + types correctly. + (do_type): Tidy. Use SCOPE_STRING. Pass extra argument to + demangle_template. Use demangled_nested_args. Don't remember + qualified types here; that's now done in demangle_qualified. + Similarly for templates. + (do_arg): Improve comment. Handle 'n' repeat code. + (remember_type): Check forgetting_types. + (demangle_args): Deal with 'n' repeat codes. Tidy. + +Sat Jul 11 02:59:08 1998 Richard Earnshaw + + * arm.md (extendhisi2_mem, movhi, movhi_bytes): Propagate the volatile + and structure attribute flags to MEMs generated. + (splits for sign-extended HI & QI mode from memory): Also propagate + the volatile flag. + + * configure.in (thumb-*-coff*): Don't cause fixincludes to be run. + +Fri Jul 10 19:06:59 1998 Michael Meissner + + * varray.h: Include system.h if it hasn't already been included + before to get size_t declared. + +Fri Jul 10 12:53:58 1998 David S. Miller + + * jump.c (jump_optimize): If after_regscan and our transformations + generate new REGs, rerun reg_scan. + +Fri Jul 10 11:50:43 1998 Andrew MacLeod + + * config/i960/i960.c (i960_address_cost): MEMA operands with + positive offsets < 4096 are free. + +Fri Jul 10 12:34:37 1998 Andreas Schwab + + * config/m68k/m68k.c (const_uint32_operand): Recognize + CONSTANT_P_RTX. + (const_sint32_operand): Likewise. + +Thu Jul 9 22:58:59 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (alias.o): Depend on $(EXPR_H). + +Thu Jul 9 18:24:56 1998 J"orn Rennecke + + * reload1.c (choose_reload_regs): If using an equivalence from + find_equiv_reg and reg_reloaded_valid is not set for this register, + clear the associated spill_reg_store. + +Thu Jul 9 18:12:49 1998 J"orn Rennecke + + * reload1.c (emit_reload_insns): If an output reload copies only + to a secondary reload register, indicate that the secondary reload + does the actual store. + +Thu Jul 9 18:01:05 1998 J"orn Rennecke + + * reload.c (find_equiv_reg): If need_stable_sp is set, + check if stack pointer is changed directly in a PARALLEL. + +Thu Jul 9 10:38:14 1998 Jeffrey A Law (law@cygnus.com) + + * jump.c (duplicate_loop_exit_test): Fix thinko. + +Thu Jul 9 01:30:37 1998 Joel Sherrill + Ralf Corsepius + + * config/i386/rtemself.h: Updated to keep in sync with + config/i386/linux.h. + + * configure.in: Added sh-rtemself. + * configure: Rebuilt. + * config/sh/rtems.h: Removed -D__ELF__ since it is now COFF. + * config/sh/rtemself.h: New file. + + * config/rs6000/rtems.h: Defined STARTFILE_DEFAULT_SPEC. + +Wed Jul 8 21:43:14 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Check if the assembler supports ".balign" and + ".p2align" and define HAVE_GAS_BALIGN_AND_P2ALIGN appropriately. + * acconfig.h (HAVE_GAS_BALIGN_AND_P2ALIGN): New tag. + * i386/gas.h (ASM_OUTPUT_ALIGN): If the assembler has support for + ".balign" then use it. + + * print-rtl.c (print_rtx): Revert previous patch. + + * jump.c (duplicate_loop_exit_test): Do not duplicate the loop exit + test if the exit code has an insn with ASM_OPERANDS. + + * i386/cygwin32.h (STDIO_PROTO): Fix typo. + * m32r.h (STDIO_PROTO): Fix typo. + + * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Handle addresses created by + LEGITIMIZE_RELOAD_ADDRESS. + * tm.texi (LEGITIMIZE_RELOAD_ADDRESS): Note that this macro must be + able to handle addresses created by previous invocations of the macro. + + * flow.c (find_auto_inc): Remove most recent change. Real bug was + elsewhere. + + * cse.c (count_reg_usage): Count registers used in addresses of + CLOBBERs. + +Wed Jul 8 15:08:29 1998 Jim Wilson + + * Makefile.in (STAGESTUFF): Readd line lost during June 9 FSF merge. + + * configure.in (mips64orion-*-rtems*): Use elf64.h not elfl64.h. + +1998-07-08 Vladimir N. Makarov + + * config/fp-bit.c (__gexf2, __fixxfsi, __floatsixf): Add function + stubs. + + * toplev.c (lang_options): Add -Wlong-long, -Wno-long-long + options. + * c-decl.c (warn_long_long): Define. + (c_decode_option): Parse -Wlong-long, -Wno-long-long options. + (grokdeclarator): Add flag `warn_long_long' as guard for + warning "ANSI C does not support `long long'". + * invoke.texi: Add description of options -Wlong-long, + -Wno-long-long. + * gcc.1: The same as above. + +Wed Jul 8 02:43:34 1998 Jeffrey A Law (law@cygnus.com) + + * rtlanal.c (reg_overlap_mentioned_p): Handle STRICT_LOW_PART. If + either argument is CONSTANT_P, then return zero. + * reload.c (reg_overlap_mentioned_for_reload_p): Similarly. + + * configure.in: Also look at $srcdir/gas/configure to find a + gas version #. + +Wed Jul 8 00:28:22 1998 Carlo Wood + + * dsp16xx.h : Clean up of macro OPTIMIZATION_OPTIONS + +Tue Jul 7 21:18:14 1998 Mumit Khan + + * i386/cygwin32.h (ASM_DECLARE_FUNCTION_NAME): Merge duplicate + definitions from last two patches. + +Tue Jul 7 23:03:34 1998 J"orn Rennecke + + * reload1.c (choose_reload_regs): Don't set reload_override_in + if EQUIV is clobbered in INSN and the reload is done after INSN. + +Tue Jul 7 21:23:36 1998 J"orn Rennecke + + * expr.c (emit_queue): If emitting a SEQUENCE, set QUEUED_INSN + to the first insn of the sequence. + +Tue Jul 7 21:05:25 1998 J"orn Rennecke + + * cse.c (cse_insn): Don't make change without validation. + +Tue Jul 7 11:40:05 1998 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (various zero/sign extension patterns): Zero and sign + extensions which use "sub" clobber cc0. + +Tue Jul 7 09:12:08 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Jul 7 10:07:20 1998 Jeffrey A Law (law@cygnus.com) + + * print-rtl.c (print_rtx): Use REAL_VALUE_TYPE instead of "double". + +Tue Jul 7 08:41:27 1998 Richard Henderson (rth@cygnus.com) + + * print-rtl.c (print_rtx): Only print fp values when REAL_VALUE_TYPE + is a double. + +Tue Jul 7 00:31:58 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Jul 7 01:03:03 1998 Mumit Khan + + Support for dllimport and dllexport attributes for i386-pe. + + * tree.h (DECL_NON_ADDR_CONST_P): New accessor macro. + (struct tree_decl): Add non_addr_const_p field. + * tree.c (staticp): Use. + + * i386/cygwin32.h (CPP_PREDEFINES): Map __declspec(x) to GCC + attributes. + (SUBTARGET_SWITCHES): Switches to turn on/off dllimport|export + attributes. Also accept -mwindows option. + (VALID_MACHINE_DECL_ATTRIBUTE): New macro. + (MERGE_MACHINE_DECL_ATTRIBUTE): New macro. + (REDO_SECTION_INFO_P): New macro. + (DRECTVE_SECTION_FUNCTION): New macro. + (drectve_section): Cover function to implement above. + (SWITCH_TO_SECTION_FUNCTION): New macro. + (switch_to_section): Covert function to implement above. + (EXTRA_SECTIONS): Add in_drectve. + (EXTRA_SECTION_FUNCTIONS): Add in_drectve and switch_to_section. + (ENCODE_SECTION_INFO): Delete old macro and redefine as a function. + (STRIP_NAME_ENCODING): Handle new attributes. + (ASM_OUTPUT_LABELREF): New macro. + (ASM_OUTPUT_FUNCTION_NAME): New macro. + (ASM_OUTPUT_COMMON): New macro. + (ASM_OUTPUT_DECLARE_OBJECT_NAME): New macro. + + * i386/mingw32.h (CPP_PREDEFINES): Map __declspec(x) to GCC + attributes. + + * i386/winnt.c (i386_pe_valid_decl_attribute_p): New function. + (i386_pe_merge_decl_attributes): New function. + (i386_pe_check_vtable_importexport): New function. + (i386_pe_dllexport_p): New function. + (i386_pe_dllimport_p): New function. + (i386_pe_dllexport_name_p): New function. + (i386_pe_dllimport_name_p): New function. + (i386_pe_mark_dllexport): New function. + (i386_pe_mark_dllimport): New function. + (i386_pe_encode_section_info): New function. + (i386_pe_unique_section): Strip encoding from name first. + +Tue Jul 7 00:50:17 1998 Manfred Hollstein (manfred@s-direktnet.de) + + * libgcc2.c (L_exit): Provide a fake for atexit on systems which + define ON_EXIT but not HAVE_ATEXIT. + +Tue Jul 7 00:44:35 1998 Franz Sirl + + * m68k.md (zero_extend QI to HI): Correctly handle TARGET_5200. + +Tue Jul 7 00:36:41 1998 Ulrich Drepper + + * i386.c: Remove random whitespace at end of lines. + + * i386.c (ix86_epilogue): For pentium processors, try to deallocate + 4 or 8 byte stacks with pop instructions instead of an add instruction. + +Tue Jul 7 00:30:08 1998 Klaus Kaempf + + * alpha.c: Include tree.h before expr.h. + +Mon Jul 6 22:50:48 1998 Jason Merrill + + * c-parse.in (struct_head, union_head, enum_head): New nonterminals. + (structsp): Use them. Update files generated from c-parse.in. + * extend.texi (Type Attributes): Document it. + + * c-decl.c: Add warn_multichar. + (c_decode_option): Handle -Wno-multichar. + * c-lex.c (yylex): Check it. + * c-tree.h: Declare it. + * toplev.c (lang_options): Add it. + * invoke.texi: Document it. + +Mon Jul 6 22:47:55 1998 J"orn Rennecke + + * reload.c (find_equiv_reg): When looking for stack pointer + const, + make sure we don't use a stack adjust. + + * reload.c (find_equiv_reg): If need_stable_sp is set, + check if stack pointer is changed directly. + + * reload1.c (delete_dead_insn): Don't delete feeding insn + if that insn has side effects. + + * flow.c (find_auto_inc): Clear UNCHANGING bit of register that is + changed. + + * reload1.c (reload_reg_free_before_p): RELOAD_FOR_OPADDR_ADDR + precedes RELOAD_FOR_OUTADDR_ADDRESS. + + * gcse.c (hash_scan_insn): New argument IN_LIBCALL_BLOCK. Changed + caller. + +Mon Jul 6 22:21:56 1998 Kamil Iskra + + * m68k.c (output_scc_di): Use cmpw #0 instead of tstl when + testing address registers on the 68000. + +Mon Jul 6 22:17:19 1998 Alasdair Baird + + * i386.c (is_fp_test): Fix thinko. + + * jump.c (jump_optimize): Check for CONST_INT before using INTVAL. + +Mon Jul 6 22:14:31 1998 Richard Henderson (rth@cygnus.com) + + * print-rtl.c (print_rtx): Display the real-value equivalent of + a const_double when easy. + + * real.h (REAL_VALUE_TO_TARGET_SINGLE): Use a union to pun types. + Zero memory first for predictability. + (REAL_VALUE_TO_TARGET_DOUBLE): Likewise. + * varasm.c (immed_real_const_1): Notice width of H_W_I == double. + + * regclass.c (allocate_reg_info): Initialize the entire reg_data + virtual array. + +Mon Jul 6 22:09:32 1998 Ian Lance Taylor + Jeff Law + + * i386/cygwin32.h: Add some declaration of external functions. + (ASM_DECLARE_FUNCTION_NAME): Define. + (ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL): Define. + (ASM_FILE_END): Define. + * i386/winnt.c (i386_pe_declare_function_type): New function. + (struct extern_list, extern_head): Define. + (i386_pe_record_external_function): New function. + (i386_pe_asm_file_end): New function. + + * cpplib.c (cpp_options_init): Initialize cplusplus_comments to 1, + matching July 18, 1995 change to cccp.c. If -traditional then + disable cplusplus_comments. + +Mon Jul 6 21:28:14 1998 Jeffrey A Law (law@cygnus.com) + + * combine.c (expand_compound_operation): Fix thinko in code to optimize + (zero_extend:DI (subreg:SI (foo:DI) 0)) to foo:DI. + + * Disable the following change from gcc2. Not appropriate for egcs: + + Sun Jun 7 09:30:31 1998 Richard Kenner + * reload.c (find_reloads): Give preference to pseudo that was the + reloaded output of previous insn. + +Mon Jul 6 21:07:14 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_FUNC_PRINTF_PTR): Don't define HOST_PTR_PRINTF. + Instead, define a new macro HAVE_PRINTF_PTR which only signifies + whether we have the %p format specifier or not. + + * acconfig.h: Delete stub for HOST_PTR_PRINTF, add HAVE_PRINTF_PTR. + + * machmode.h (HOST_PTR_PRINTF): When determining the definition, + check HAVE_PRINTF_PTR to see whether "%p" is okay. + + * mips-tfile.c: Include machmode.h to get HOST_PTR_PRINTF. + + * Makefile.in (mips-tfile.o): Depend on machmode.h. + +Mon Jul 6 10:42:05 1998 Mark Mitchell + + * jump.c (duplicate_loop_exit_test): Don't refuse to copy a + section of code just because it contains + NOTE_INSN_BLOCK_{BEG,END}. + * stmt.c (expand_end_loop): Likewise. Also, don't refuse to + move CALL_INSNs or CODE_LABELs. When moving code, don't move + NOTE_INSN_BLOCK_{BEG,END}. + +Mon Jul 6 09:38:15 1998 Mark Mitchell + + * cse.c (CSE_ADDRESS_COST): New macro, based on ADDRESS_COST, but + dealing with ADDRESSOF. + (find_best_addr): Use it. + +Mon Jul 6 09:27:08 1998 Richard Henderson + + * alpha/vms.h (TRAMPOLINE_TEMPLATE): Revert last change. + +Mon Jul 6 09:25:06 1998 Dave Love + + * libgcc2.c (__eprintf): Make args consistent with prototype in + assert.h. + +Mon Jul 6 00:28:43 1998 Mark Mitchell + + * cse.c (cse_insn): When SETting (MEM (ADDRESSOF (X))) to Y, + don't claim that the former is equivalent to the latter. + +Sun Jul 5 23:58:19 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Second arg is an RTX now. Update all callers. + (cse_basic_block): Keep track of the current RETVAL insn for a + libcall instead of just noting that we're in a libcall. + + * combine.c (simplify_comparison): Do not commute a AND into + a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS. + + * i386/freebsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Protect with + HAVE_GAS_MAX_SKIP_P2ALIGN. + * i386/linux.h: Likewise. + +Fri Jul 3 02:33:35 1998 David S. Miller + + * sparc.c (sparc_operand, move_operand, arith_operand, + arith11_operand, arith10_operand, arith_double_operand, + arith11_double_operand, arith10_double_operand, small_int, + uns_small_int): Recognize CONSTANT_P_RTX. + (output_sized_memop, output_move_with_extension, + output_load_address, output_size_for_block_move, + output_block_move, delay_operand): Remove, has not been + enabled or referenced for years. + * sparc.md (movstrsi, block_move_insn): Likewise. + * sparc.h (PREDICATE_CODES): Define. + * linux-aout.h (MACHINE_STATE_{SAVE,RESTORE}): Override with + version which uses getcc/setcc traps to save/restore condition + codes. + * linux64.h: Likewise. + * sunos4.h: Likewise. + * linux.h: Likewise. + * sol2.h: Likewise. + * sun4o3.h: Likewise. + +Fri Jul 3 02:28:05 1998 Richard Henderson + + * alpha.c (alpha_initialize_trampoline): Hack around Pmode/ptr_mode + lossage on VMS. Reported by kkaempf@rmi.de. + * alpha/vms.h (TRAMPOLINE_TEMPLATE): Add missing 0. + +Thu Jul 2 17:41:14 1998 Nick Clifton + + * config/m32r/m32r.h (MUST_PASS_IN_STACK): Override default + version. + +Thu Jul 2 14:34:48 1998 David Edelsohn + + * expr.h (STACK_SIZE_MODE): New macro. + * explow.c (allocate_dynamic_stack_space): Use it for + mode of allocate_stack pattern increment operand. + * tm.texi (STACK_SAVEAREA_MODE, STACK_SIZE_MODE): Document. + * md.texi (stack_save_block, ...): Reflect use of macro. + + * rs6000.h (PROMOTE_MODE): Always promote to word_mode. + (PROMOTE_FUNCTION_ARGS): Define. + (PROMOTE_FUNCTION_RETURN): Define. + (FUNCTION_VALUE): Promote to word_mode if smaller. + Convert to gen_rtx_FOO. + * rs6000.md (call_indirect): Store doubleword in 64-bit mode. + Convert to gen_rtx_FOO. + * rs6000.c: Convert to gen_rtx_FOO. + +Thu Jul 2 14:16:11 1998 Michael Meissner + + * varray.{c,h}: New files to provide virtual array support. + + * Makefile.in (OBJS): Add varray.o. + (varray.o): Add new file. + (REGS_H): New variable for dependencies for files including + regs.h. Add varray.h and files it includes. Change all regs.h + dependencies to $(REGS_H). + + * toplev.c (x{m,re}alloc): If size is 0, allocate 1 byte. + (xcalloc): Provide frontend for calloc. + * {tree,rtl}.h (xcalloc): Add declaration. + + * basic-block.h (REG_BASIC_BLOCK): Convert reg_n_info to be a + varray. + + * regs.h (toplevel): Include varray.h. + (reg_n_info): Switch to use a varray. + (REG_*): Likewise. + (allocate_reg_info): Change num_regs argument to be size_t. + + * regclass.c (reg_info_data): New structure to remember groups of + reg_info structures allocated that are to be zeroed. + ({pref,alt}class_buffer): New statics to hold buffers + allocate_reg_info allocates for {pref,alt}class_buffer. + (regclass): Use {pref,alt}class_buffer to initialize + {pref,alt}class. + (allocate_reg_info): Switch to make reg_n_info use varrays. + Allocate buffers for the preferred and alter register class + information. Change num_regs argument to be size_t, not int. + + * flow.c (reg_n_info): Switch to use varrays. + +Thu Jul 2 10:11:47 1998 Robert Lipe + + * install.texi (sco3.2v5): Document new --with-gnu-as flag. + * config/i386/sco5.h (JUMP_TABLES_IN_TEXT_SECTION): Defined as + in other targets. + (USE_GAS): Conditionalize away native assembler usage. + * config/i386/sco5gas.h: New file. + * config/i386/t-sco5gas: New file. + * configure.in (ix86-sco3.2v5*): Use new files if --with-gnu-as + +Thu Jul 2 08:20:00 1998 Catherine Moore + + * haifa-sched.c (alloc_EXPR_LIST): Change to use + unused_expr_list. + +Thu Jul 2 14:13:28 1998 Dave Love + + * Makefile.in (install-info): Don't use $realfile. Ignore + possible errors from the install-info program. + +Thu Jul 2 01:53:32 1998 Alasdair Baird + + * combine.c (simplify_comparison): Apply SUBREG_REG to SUBREGs. + +Wed Jul 1 23:06:03 1998 Richard Henderson + + * i386.h (HARD_REGNO_MODE_OK): Kill spurious test. + (MODES_TIEABLE_P): Tie SImode and HImode. + +1998-07-01 Andreas Jaeger + + * invoke.texi (Optimize Options): Fix typo. + +Wed Jul 1 22:25:43 1998 Jim Wilson + + * xcoffout.c (xcoffout_begin_function): Call xcoffout_block for + the zero'th block. + +Wed Jul 1 23:12:58 1998 Ken Raeburn + + * h8300.c (print_operand): Delete %L support. + * h8300.md (branch_true, branch_false): Use %= with a prefix + instead of %L for local branch labels. + +Wed Jul 1 21:27:13 1998 J"orn Rennecke + + * reload1.c (emit_reload_insns): Use proper register classes for + SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_MEMORY_NEEDED code. + +Wed Jul 1 21:17:36 1998 J"orn Rennecke + + * reload.c (find_reloads): If there are multiple + RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_OUTPUT_ADDRESS reloads for + one operand, change RELOAD_FOR_INPADDR_ADDRESS / + RELOAD_FOR_OUTADDR_ADDRESS for all but the first + RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_OUTPUT_ADDRESS reloads. + +Wed Jul 1 17:23:23 1998 J"orn Rennecke + + * regmove.c (fixup_match_2): Check that P has RTX_CLASS 'i' before + using its PATTERN. + +Wed Jul 1 05:04:41 1998 Richard Henderson + + * expr.c (emit_group_load, emit_group_store): Rewrite considering + the size and alignment of the structure being manipulated. + * expr.c, calls.c, function.c: Update all callers. + * expr.h: Update prototypes. + * cse.c (invalidate): Cope with parallels. + +Wed Jul 1 04:22:23 1998 Richard Henderson + + * sparc.c (function_arg_record_value): Take a MODE arg with which to + create the PARALLEL. Update all callers. + +Wed Jul 1 04:10:35 1998 Richard Henderson + + * expr.c (expand_assignment, store_constructor, expand_expr): Use + convert_memory_address instead of convert_to_mode when possible. + +Wed Jul 1 03:48:00 1998 Richard Henderson + + * alpha.c (alpha_initialize_trampoline): Take arguments describing + the layout. Use ptr_mode. Disable hint generation. Use gen_imb. + * alpha.h (INITIALIZE_TRAMPOLINE): Pass extra args to the init func. + (TRANSFER_FROM_TRAMPOLINE): Move ... + * alpha/osf.h: ... here. + * alpha/vms.h (INITIALIZE_TRAMPOLINE): Use alpha_initialize_trampoline. + (TRANSFER_FROM_TRAMPOLINE): Remove undef. + * alpha/win-nt.h: Likewise. + * alpha/vxworks.h: Likewise. + + * alpha/linux.h: Revert gcc2 merge lossage. + +Wed Jul 1 10:56:55 1998 Andreas Schwab + + * c-decl.c (grokdeclarator): Don't warn about implicit int in + `typedef foo = bar'. + +Wed Jul 1 02:12:33 1998 Robert Lipe + + * i386.c (asm_output_function_prefix): Make 686 function + prologues not issue .types for non-global labels. + +Tue Jun 30 23:46:53 1998 Dmitrij Tejblum + + * i386/freebsd.h (WCHAR_TYPE): Chagne to an "int". + (WCHAR_TYPE_SIZE): Update appropriately. + +Tue Jun 30 23:16:39 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (recompute_reg_usage): Does not return a value. + * rtl.h (recompute_reg_usage): Update prototype. + + * jump.c (jump_optimize): Show that the jump chain is not + valid when not optimizing. + +Tue Jun 30 16:01:01 1998 Richard Henderson + + * rtl.def (CONSTANT_P_RTX): New. + * rtl.h (CONSTANT_P): Recognize it. + * cse.c (fold_rtx): Eliminate it. + * expr.c (can_handle_constant_p): New variable. + (init_expr_once): Initialize it. + (expand_builtin): Generate CONSTANT_P_RTX if the expression is not + immediately recognizable as a constant. + + * alpha.c (reg_or_6bit_operand): Recognize CONSTANT_P_RTX. + (reg_or_8bit_operand, cint8_operand, add_operand): Likewise. + (sext_add_operand, and_operand, or_operand): Likewise. + (reg_or_cint_operand, some_operand, input_operand): Likewise. + * alpha.h (PREDICATE_CODES): Add CONSTANT_P_RTX where needed. + +1998-06-30 Benjamin Kosnik + + * dbxout.c (dbxout_type_methods): Remove warn_template_debugging. + +Tue Jun 30 14:03:34 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_NEED_DECLARATION): Accept an optional second + argument, which is typically preprocessor code used to draw in + additional header files when looking for a function declaration. + (GCC_NEED_DECLARATIONS): Likewise. + + * configure.in (GCC_NEED_DECLARATIONS): Add checks for getrlimit + and setrlimit, search for them in sys/resource.h. + + * acconfig.h: Add stubs for NEED_DECLARATION_GETRLIMIT and + NEED_DECLARATION_SETRLIMIT. + + * system.h: Prototype getrlimit/setrlimit if necessary. + +Tue Jun 30 10:54:48 1998 Mark Mitchell + + * rtl.texi: Don't say that RTX_INTEGRATED_P is not depended + upon. + +Tue Jun 30 13:11:42 1998 Franz Sirl + + * rs6000/sysv4.h (asm output): Add tabs for asm directives. + +Tue Jun 30 13:11:42 1998 David Edelsohn + + * Makefile.in (FLAGS_TO_PASS): Set AR_FLAGS to AR_FOR_TARGET_FLAGS. + +Tue Jun 30 08:59:15 1998 Kaveh R. Ghazi + + * gansidecl.h (ATTRIBUTE_UNUSED): Use __unused__ not `unused'. + Don't define NULL here. Also, remove all vestiges of autoconf + based checks for bcmp/bcopy/bzero/index/rindex. + + * system.h: Immediately after including stdio.h, check for and if + necessary provide a default definition of NULL. + +Tue Jun 30 08:22:05 1998 Michael Meissner + + * reload1.c (reload_cse_simplify_operands): Call + fatal_insn_not_found, not abort. + +Tue Jun 30 02:34:02 1998 Jeffrey A Law (law@cygnus.com) + + * choose-temp.c (make_temp_file): Accept new argument for the + file suffix to use. Allocate space for it and add it to the + template. + * mkstemp.c (mkstemps): Renamed from mkstemp. Accept new argument + for the length of the suffix. Update template structure checks + to handle optional suffix. + * collect2.c (make_temp_file): Update prototype. + (main): Put proper suffixes on temporary files. + * gcc.c (make_temp_file): Update prototype. + (do_spec_1): Put proper suffixes on temporary files. + +Tue Jun 30 00:56:19 1998 Bruno Haible + + * invoke.texi: Document new implicit structure initialization + warning. + +Mon Jun 29 21:40:15 1998 J"orn Rennecke + + * toplev.c (flag_dump_unnumbered): Declare. + (f_options): Add dump-unnumbered. + * print-rtl.c (flag_dump_unnumbered): Define. + (print_rtx): Print only '#' for insn numbers if flag_dump_unnumbered + is nonzero. + (print_rtl): Don't output line number notes if flag_dump_unnumbered + is nonzero. + * flow.c (print_rtl_with_bb): Don't output newline after line + numbers note if flag_dump_unnumbered is nonzero. + +Mon Jun 29 22:12:06 1998 Jeffrey A Law (law@cygnus.com) + + * Merge from gcc2 June 9, 1998 snapshot. See ChangeLog.13 for + details. + + * pa.c, pa.h, pa.md: Convert to gen_rtx_FOO. + +Mon Jun 29 20:12:41 1998 Kaveh R. Ghazi + + * Makefile.in (fix-header): Don't needlessly depend on cpperror.o. + + * alias.c (CHECK_ALIAS_SETS_FOR_CONSISTENCY): Cast expansion to + void since it is evaluated in a comma list. + + * mips.h (ASM_GENERATE_INTERNAL_LABEL): Always sprintf `NUM' + argument as a long and cast `NUM' to long to ensure it is of the + proper width. Wrap macro arguments in parens when they appear in + the expansion. + + * sol2.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + + * sparc.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_DECLARE_RESULT): Fix fprintf format specifier to match + function argument return type. + (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, REGNO_OK_FOR_FP_P, + REGNO_OK_FOR_CCFP_P): Use `(unsigned)' not `U'. + + * cpplib.c (cpp_message_from_errno): Remove unneeded argument to + cpp_message. + + * dbxout.c: Fix the comments after an #endif to reflect the actual + condition tested in the preceding #if. + + * except.c (find_all_handler_type_matches): Switch to old-style + function definition. + + * expr.c (expand_builtin): Remove unused variable `type' twice. + + * gbl-ctors.h (DO_GLOBAL_CTORS_BODY): Cast -1 before comparing it + to an unsigned long. + + * haifa-sched.c (print_insn_chain): Remove unused function. + + * objc/objc-act.c (build_msg_pool_reference): Hide prototype and + definition. + + * toplev.c: When testing whether to include dbxout.h, also include + it when XCOFF_DEBUGGING_INFO is defined. + + * unroll.c (unroll_loop): Add parentheses around assignment used + as truth value. + +Mon Jun 29 12:18:00 1998 Catherine Moore + + * config/lb1spc.asm (.div, .udiv): Replace routines. + +Mon Jun 29 09:44:24 1998 Mark Mitchell + + * rtl.h: Update comment about special gen_rtx variants. + * emit-rtl.c (gen_rtx): Handle MEMs using gen_rtx_MEM. + +Sun Jun 28 20:58:51 1998 Jeffrey A Law (law@cygnus.com) + + * choose-temp.c (choose_temp_base): Restore original variant of + this function for compatibility. + (make_temp_file): This is the new, preferred interface to create + temporary files. + * collect2.c (choose_temp_base): Delete declaration. + (make_temp_file): Declare. + (temp_filename_length, temp_filename): Delete. + (main): Use make_temp_file to get temporary files. Use --lang-c + to force the resulting ctort/dtor file to be compiled with the C + compiler. Make sure to remove temporary files on all exit paths. + * gcc.c (make_temp_file): Provide prototype if MKTEMP_EACH_FILE is + defined. + (choose_temp_base): Only provide prototype if MKTEMP_EACH_FILE is + not defined. + (do_spec): Use make_temp_file if MKTEMP_EACH_FILE is defined. + +Sun Jun 28 08:57:09 1998 Kaveh R. Ghazi + + * configure.in (GCC_NEED_DECLARATIONS): Add strerror, getcwd and + getwd. + + * acconfig.m4: Add stubs for NEED_DECLARATION_STRERROR, + NEED_DECLARATION_GETCWD and NEED_DECLARATION_GETWD. + + * cccp.c: Remove strerror()/sys_nerr/sys_errlist decls. + (my_strerror): Add prototype and make it static. + + * collect2.c: Likewise. + + * cpplib.c: Likewise. + + * gcc.c: Likewise, but keep `my_strerror' extern. + + * protoize.c: Likewise. + + * pexecute.c (my_strerror): Add argument to prototype. + + * system.h: Add prototypes for getcwd, getwd and strerror. Add + extern decls for sys_nerr and sys_errlist. Make abort decl + explicitly extern. + + * getpwd.c: Remove decls for getwd and getcwd. + +Sun Jun 28 02:11:16 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Jun 27 23:32:25 1998 Richard Henderson + + * jump.c (jump_optimize): Use side_effects_p & may_trap_p instead + of rtx_unsafe_p. Use modified_between_p instead of reg_set_between_p. + Allow FP moves to be optimized. + (rtx_unsafe_p): Delete. + +Sat Jun 27 23:02:04 1998 Richard Henderson + + * objc/archive.c: Remove prototypes. + +Sat Jun 27 22:37:05 1998 Jeffrey A Law (law@cygnus.com) + + * tm.texi (NEED_MATH_LIBRARY): Document new target macro. + + * Makefile.in (gencheck): Remove $(TREE_H) dependency. + +Sat Jun 27 20:20:00 1998 John Carr + + * dsp16xx.h (FIRST_PSEUDO_REGISTER): Add parentheses to definition. + * dsp16xx.c (next_cc_user_unsigned): New function. + Remove save_next_cc_user_code. + (print_operand): Use HOST_WIDE_INT_PRINT_* macros. + * dsp16xx.md: Call next_cc_user_unsigned instead of using + save_next_cc_user_code. + Use gen_rtx_* functions instead of gen_rtx. + +Sat Jun 27 20:18:34 1998 Franz Sirl + + * rs6000.h: Add trap_comparison_operator to PREDICATE_CODES. + +Sat Jun 27 16:45:42 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (count_reg_sets): New function. + (count_reg_sets_1, count_ref_references): Likewise. + (recompute_reg_usage): Likewise. + * rtl.h (recompute_reg_usage): Add prototype. + * toplev.c (rest_of_compilation): Call recompute_reg_usage just + before local register allocation. + +Sat Jun 27 13:15:30 1998 Richard Henderson + + * alpha.md (negsf, negdf): Revert Jan 22 change. + +Sat Jun 27 07:35:21 1998 Kaveh R. Ghazi + + * mkstemp.c: Include gansidecl.h. Rename uint64_t to gcc_uint64_t. + (mkstemp): Remove size specifier for variable `letters'. Call + gettimeofday, not __gettimeofday. + + * Makefile.in (EXPR_H): New dependency variable. + (c-typeck.o): Depend on $(EXPR_H) instead of expr.h. + (c-iterate.o): Likewise. + (gencheck): Depend on $(TREE_H) instead of tree.h, etc. + (stor-layout.o): Depend on $(EXPR_H) instead of expr.h. + (toplev.o): Likewise. Also depend on $(RECOG_H) instead of recog.h. + (varasm.o): Depend on $(EXPR_H) instead of expr.h. + (function.o): Likewise. + (stmt.o): Likewise. + (except.o): Likewise. + (expr.o): Likewise. + (calls.o): Likewise. + (expmed.o): Likewise. + (explow.o): Likewise. + (optabs.o): Likewise. + (sdbout.o): Likewise. + (dwarf2out.o): Likewise. + (emit-rtl.o): Likewise. + (integrate.o): Likewise. + (jump.o): Likewise. + (cse.o): Likewise. + (gcse.o): Likewise. Also depend on $(BASIC_BLOCK_H) instead of + basic-block.h. + (loop.o): Depend on $(EXPR_H) instead of expr.h. + (unroll.o): Likewise. + (combine.o): Likewise. + (reload.o): Likewise. + (reload1.o): Likewise. + (caller-save.o): Likewise. + (reorg.o): Likewise. + (alias.o): Don't depend on insn-codes.h. + (regmove.o): Depend on $(RECOG_H)/$(EXPR_H) instead of recog.h/expr.h. + (insn-emit.o): Depend on $(EXPR_H) instead of expr.h. + (insn-opinit.o): Likewise. + +Sat Jun 27 01:35:14 1998 Jeffrey A Law (law@cygnus.com) + + * choose-temp.c (choose_temp_base): Remove MPW bits. Use mkstemp + instead of mktemp. + * gcc.c (MKTEMP_EACH_FILE): Define. + (main): No need to call choose_temp_base if we are going to + use choose_temp_base to create each file later. + * mkstemp.c: New file. Adapted from glibc. + * Makefile.in (xgcc, colect2, protoize, unprotoize): Link in mkstemp.o. + (mkstemp.o): Add dependencies. + + * configure.in (gettimeofday): Check for its existence. + * config.in (HAVE_GETTIMEOFDAY): Define. + * configure: Rebuilt. + +1998-06-26 Michael Meissner + + * rs6000.md (ne 0, non power case): Add missing & constraint. + Name pattern ne0. + (negative abs insns): Add pattern names. + +Fri Jun 26 17:36:42 1998 Dave Love + + * Makefile.in (install-info): Run install-info program in separate + loop. + +Fri Jun 26 16:03:15 1998 Michael Meissner + + * haifa-sched.c (schedule_block): Add hooks for the machine + description to reorder the ready list, and update how many more + instructions can be issued this cycle. + * tm.texi (MD_SCHED_{INIT,REORDER,VARIABLE_ISSUE}): Document. + +Fri Jun 26 11:54:11 1998 David S. Miller + + * config/sparc/sparc.h (REGNO_OK_FOR_{INDEX,BASE,FP,CCFP}_P): + Explicitly mark the constant being compared against as unsigned. + * config/sparc/sparc.c (sparc_select, cpu_default, cpu_table): + Fully initialize final members. + (mem_aligned_8): Explicit init of offset to zero. + (output_function_prologue): Explicit init of n_regs to zero. + (output_function_epilogue): Likewise, and mark arg size as + unused. + (init_cumulative_args): Mark libname and indirect as unused. + (function_arg_pass_by_reference): Likewise for cum and named. + (sparc_builtin_saveregs): Likewise for arglist. + (sparc_flat_eligible_for_epilogue_delay): Likewise for slot. + +Fri Jun 26 06:58:54 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (SECONDARY_INPUT_RELOAD_CLASS): Only need a secondary reload + if reloading a MEM. + + * arm.h (arm_adjust_cost): Renamed bogus prototype from + arm_adjust_code. + (bad_signed_byte_operand): Add prototype. + * arm.c (arm_override_options): Make I unsigned. + (const_ok_for_arm): Add casts to the constants. + (load_multiple_operation): Don't redeclare elt in sub-block. + (arm_gen_movstrqi): Delete external declaration of optimize. + (gen_compare_reg): Declare parameter fp. + + * arm.c (final_prescan_insn): Only initialize scanbody if the insn + has a pattern. + +Fri Jun 26 09:31:24 1998 Kaveh R. Ghazi + + * alpha.c: Include system.h and toplev.h. + (cint8_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. + (const48_operand): Likewise. + (mode_width_operand): Likewise. + (mode_mask_operand): Likewise. + (mul8_operand): Likewise. + (current_file_function_operand): Likewise. + (signed_comparison_operator): Likewise. + (divmod_operator): Likewise. + (any_memory_operand): Likewise. + (alpha_return_addr): Likewise for parameter `frame'. + (alpha_builtin_saveregs): Likewise for parameter `arglist'. + (vms_valid_decl_attribute_p): Likewise for parameters `decl' and + `attributes'. + (alpha_start_function): Likewise for parameter `decl'. Use + HOST_WIDE_INT_PRINT_DEC in call to fprintf. Fix various format + specifiers. Remove unused variables `lab' and `name'. + (alpha_end_function): Mark parameter `decl' with ATTRIBUTE_UNUSED. + (check_float_value): Likewise for parameter `overflow'. + (alpha_need_linkage): Likewise for parameters `name' and `is_local'. + + * alpha.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Define as + taking an argument. + (ASM_OUTPUT_SHORT): Cast argument to `int' in call to fprintf. + (ASM_OUTPUT_CHAR): Likewise. + (ASM_OUTPUT_BYTE): Likewise. + (PRINT_OPERAND_ADDRESS): Use HOST_WIDE_INT_PRINT_DEC in call to + fprintf. + (PUT_SDB_EPILOGUE_END): Mention argument `NAME' in definition. + Add prototypes for functions in alpha.c. + + * alpha.md (ashldi3): Add default case in switch. + +1998-06-26 Manfred Hollstein + + * Makefile.in (gcc_version, gcc_version_trigger): New macros. + (version): Initialize from $(gcc_version). + + * configure.in (version): Rename to gcc_version. + (gcc_version_trigger): New variable; call AC_SUBST for it and + emit it into the generated config.status. + * configure: Regenerate. + +Thu Jun 25 12:47:41 1998 Mark Mitchell + + * fold-const.c (make_range): Don't go looking at TREE_OPERANDs of + nodes that are not expressions. + +Thu Jun 25 15:08:16 1998 Mark Mitchell + + * invoke.texi (-fstrict-aliasing): Document. + * rtl.texi (MEM_ALIAS_SET): Document. + + * flags.h (flag_strict_aliasing): Declare. + * toplev.c (flag_strict_aliasing): Define. + (f_options): Add -strict-aliasing. + (main): Set flag_strict_aliasing if -O2 or higher. + + * tree.h (tree_type): Add alias_set field. + (TYPE_ALIAS_SET): New macro. + (TYPE_ALIAS_SET_KNOWN_P): Likewise. + (get_alias_set): Declare. + * tree.c (lang_get_alias_set): Define. + (make_node): Initialize TYPE_ALIAS_SET. + (get_alias_set): New function. + * print-tree.c (print_node): Dump the alias set for a type. + + * c-tree.h (c_get_alias_set): Declare. + * c-common.c (c_get_alias_set): New function. + * c-decl.c (init_decl_processing): Set lang_get_alias_set. + + * expr.c (protect_from_queue): Propagate alias sets. + (expand_assignment): Calculate alias set for new MEMs. + (expand_expr): Likewise. + * function.c (put_var_into_stack): Likewise. + (put_reg_into_stack): Likewise. + (gen_mem_addressof): Likewise. + (assign_parms): Likewise. + * stmt.c (expand_decl): Likewise. + * varasm.c (make_decl_rtl): Eliminate redundant clearing of + DECL_RTL. Calculate alias set for new MEMs. + + * rtl.def (REG): Add dummy operand. + (MEM): Add extra operand to store the MEM_ALIAS_SET. + * rtl.h (MEM_ALIAS_SET): New macro. + (gen_rtx_MEM): Declare. + * emit-rtl.c (gen_rtx_MEM): New function. + * gengenrtl.c (sepcial_rtx): Make MEMs special. + + * alias.c (CHECK_ALIAS_SETS_FOR_CONSISTENCY): New macro. + (DIFFERENT_ALIAS_SETS_P): Likewise. + (canon_rtx): Propagate the alias set to the new MEM. + (true_dependence): Check the alias sets. + (anti_dependence): Likewise. + (output_dependence): Likewise. + * explow.c (stabilize): Progoate alias sets. + * integrate.c (copy_rtx_and_substitute): Likewise. + * final.c (alter_subreg): Make sure not to leave MEM_IN_STRUCT_P + in an unpredictable state. Propagate alias sets. + * reload1.c (reload): Clear MEM_ALIAS_SET for new MEMs about which + we have no alias information. + +Thu Jun 25 16:59:18 1998 Andrew MacLeod + + * except.h (CATCH_ALL_TYPE): Definition moved to eh-common.h. + (find_all_handler_type_matches): Add function prototype. + * eh-common.h (CATCH_ALL_TYPE): Definition added. + * except.c (find_all_handler_type_matches): Add function to find all + runtime type info in the exception table. + (output_exception_table_entry): Special case for CATCH_ALL_TYPE. + +Thu Jun 25 15:47:55 1998 Kaveh R. Ghazi + + * Makefile.in (xcoffout.o): Depend on toplev.h, output.h and dbxout.h. + + * config/fp-bit.c (_fpmul_parts): Move variables `x', `ylow', + `yhigh' and `bit' into the scope in which they are used. + (_fpdiv_parts): Remove unused variables `low', `high', `r0', `r1', + `y0', `y1', `q', `remainder', `carry', `d0' and `d1'. + + * rs6000.c: Move include of output.h below tree.h. Include toplev.h. + (any_operand): Mark unused parameters `op' and `mode' with + ATTRIBUTE_UNUSED. + (count_register_operand): Likewise for parameter `mode'. + (fpmem_operand): Likewise. + (short_cint_operand): Likewise. + (u_short_cint_operand): Likewise. + (non_short_cint_operand): Likewise. + (got_operand): Likewise. + (got_no_const_operand): Likewise. + (non_add_cint_operand): Likewise. + (non_logical_cint_operand): Likewise. + (mask_operand): Likewise. + (current_file_function_operand): Likewise. + (small_data_operand): Likewise for parameters `op' and `mode' but + only when !TARGET_ELF. + (init_cumulative_args): Mark parameters `libname' with + ATTRIBUTE_UNUSED. + (function_arg_pass_by_reference): Likewise for parameters `cum', + `mode' and `named'. + (expand_builtin_saveregs): Likewise for parameter `args'. + (load_multiple_operation): Likewise for parameter `mode'. + (store_multiple_operation): Likewise. + (branch_comparison_operator): Likewise. + (secondary_reload_class): Likewise. + (print_operand): Add parentheses around & operation. + (output_prolog): Mark parameter `size' with ATTRIBUTE_UNUSED. + (output_epilog): Likewise. Cast argument to fprintf to int. + (rs6000_adjust_cost): Mark parameter `dep_insn' with ATTRIBUTE_UNUSED. + (rs6000_valid_decl_attribute_p): Likewise for parameters `decl', + `attributes', `identifier' and `args'. + (rs6000_valid_type_attribute_p): Likewise for parameter `attributes'. + (rs6000_comp_type_attributes): Likewise for parameters `type1' and + `type2'. + (rs6000_set_default_type_attributes): Likewise for parameter `type'. + + * rs6000.h (RTX_COSTS): Add parentheses around & operation. + (toc_section, private_data_section, trap_comparison_operator): Add + prototypes. + + * dbxout.h (dbxout_parms, dbxout_reg_parms, dbxout_syms): Add + prototypes. + + * xcoffout.c: Include toplev.h, outout.h and dbxout.h. + + * xcoffout.h (stab_to_sclass, xcoffout_begin_function, + xcoffout_begin_block, xcoffout_end_epilogue, + xcoffout_end_function, xcoffout_end_block, + xcoff_output_standard_types, xcoffout_declare_function, + xcoffout_source_line): Add prototypes. + +Thu Jun 25 09:54:55 1998 Nick Clifton + + * config/arm/arm.h (REG_ALLOC_ORDER): Add ARG_POINTER_REGNUM, + noticed by grahams@rcp.co.uk. + +Thu Jun 25 11:12:29 1998 Dave Brolley + + * gcc.c (default_compilers): Use new | syntax to eliminate + string concatenation. + +Thu Jun 25 01:00:48 1998 Richard Henderson + + * alpha.c (alpha_function_name): Delete. + (alpha_ra_ever_killed): Notice current_function_is_thunk. + (alpha_sa_mask, alpha_sa_size, alpha_does_function_need_gp): Likewise. + (alpha_start_function): Reorg from output_prologue. + (alpha_end_function): Reorg from output_epilogue. + * alpha.h (ASM_DECLARE_FUNCTION_NAME): Call alpha_start_function. + (ASM_DECLARE_FUNCTION_SIZE): New. + (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Delete. + (PROFILE_BEFORE_PROLOGUE): Set. + (ASM_OUTPUT_MI_THUNK): Remove bits now output by start/end_function. + * alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): Likewise. + +Thu Jun 25 01:18:47 1998 John Wehle (john@feith.com) + + * i386/freebsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define. + +1998-06-25 Herman A.J. ten Brugge + + * expr.c (expand_assignment): Rework address calculation for structure + field members to expose more invariant computations to the loop + optimizer. + (expand_expr): Likewise. + +Wed Jun 24 22:44:22 1998 Jeffrey A Law (law@cygnus.com) + + * local-alloc.c (block_alloc): Do not try to avoid false dependencies + when SMALL_REGISTER_CLASSES is nonzero. + +Wed Jun 24 17:55:15 1998 Klaus Kaempf + + * alpha.md (call_vms, call_value_vms): Strip leading * from symbol. + +Wed Jun 24 16:27:23 1998 John Carr + + * expr.c (get_memory_rtx): New function. + (expand_builtin): Call get_memory_rtx for MEM arguments to builtin + string functions. + + * expmed.c (init_expmed): Initialize all elements of *_cost arrays. + + * optabs.c: Use gen_rtx_FOO (...) instead of gen_rtx (FOO, ...). + * expr.c: Likewise. + * explow.c: Likewise. + * combine.c: Likewise. + * reload1.c: Likewise. + * gcse.c: Likewise. + +Wed Jun 24 15:13:01 1998 Dave Brolley + + * README.gnat: Add patch for new lang_decode_options interface. + +Wed Jun 24 09:14:04 1998 Andrew MacLeod + + * except.c (start_catch_handler): Do nothing if EH is not on. + +1998-06-24 Manfred Hollstein + + * configure.in (gxx_include_dir): Initialize default value depending on + new flag --enable-version-specific-runtime-libs; remove superfluous + default initialization afterwards. + * configure: Regenerate. + +Wed Jun 24 01:32:12 1998 David S. Miller + + * toplev.c (rest_of_compilation): Revert May 15 change. + +Tue Jun 23 21:27:27 1998 Ken Raeburn + + * reload.c (find_reloads): Fix check for failure to match any + alternative, to account for Mar 26 change in initial "best" cost. + +Tue Jun 23 16:44:21 1998 Dave Brolley + + * cpplib.c (do_line): Typo broke #line directive. + (cpp_message_from_errno): New function. + (cpp_error_from_errno): Call cpp_message_from_errno. + * cpplib.h (cpp_message_from_errno): New function. + +Tue Jun 23 13:38:18 1998 Andrew MacLeod + + * libgcc2.c (__get_eh_table_version, __get_eh_table_language): New + functions to return exception descriptor information. + (find_exception_handler): Pass match_info field to runtime matcher, + not a descriptor table entry. + +Tue Jun 23 09:30:58 1998 Dave Love + + * cpp.texi, gcc.texi: Add @dircategory, @direntry meant to + accompany previous Makefile.in (install-info) change. + +Tue Jun 23 10:06:07 1998 Andrew MacLeod + + * eh-common.h (struct __eh_info): Remove coerced value field. + * libgcc2.c (find_exception_handler): Don't set coerced_value field. + * except.c (get_dynamic_handler_chain, get_dynamic_cleanup_chain): Use + POINTER_SIZE instead of Pmode. + (expand_start_all_catch): Call start_catch_handler() if we are not + using new style exceptions. + +Tue Jun 23 06:45:00 1998 Catherine Moore + + * varasm.c (assemble_variable): Remove reference to warn_bss_align. + +Mon Jun 22 23:57:31 1998 David S. Miller + + * config/sparc/sparc.md (zero_extendhidi2, extendhisi2, + extendqihi2, extendqisi2, extendqidi2, extendhidi2, adddi3, + subdi3, negdi2, call, call_value, untyped_return, nonlocal_goto, + splits and peepholes): Change remaining generic gen_rtx calls to + specific genrtl ones. + * config/sparc/sparc.c: Likewise. + +Mon Jun 22 22:21:46 1998 Richard Henderson + + * gcc.c (handle_braces): Recognize | between options as an or. + +Mon Jun 22 23:13:47 1998 John Wehle (john@feith.com) + + * i386/freebsd-elf.h (JUMP_TABLES_IN_TEXT_SECTION): Define as flag_pic. + * i386/sysv4.h (JUMP_TABLES_IN_TEXT_SECTION): Define as flag_pic. + + * i386.md (exception_receiver): Define. + +Mon Jun 22 12:01:48 1998 Jim Wilson + + * Makefile.in (PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, + PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): New variables. + (install-common): Use them. + + * gcse.c (add_label_notes): New function. + (pre_insert_insn): Call it. + * unroll.c (unroll_loop): Look for insns with a REG_LABEL note, and + pass the label to set_label_in_map. + +Mon Jun 22 19:01:14 1998 Dave Love + + * Makefile.in (install-info): Fix typpo in previous change. + +Mon Jun 22 11:10:00 1998 Catherine Moore + + * varasm.c (assemble_variable): Emit alignment warning. + +Mon Jun 22 08:18:46 1998 Kaveh R. Ghazi + + * Makefile.in (varasm.o): Depend on sdbout.h. + (sdbout.o): Depend on toplev.h. + + * collect2.c (scan_prog_file): Cast fprintf argument to `long' and + use %ld specifier. + + * final.c (shorten_branches): Cast first arg of `bzero' to char *. + + * genextract.c (main): When creating insn-extract.c, mark variable + `i' with ATTRIBUTE_UNUSED. + + * genpeep.c (main): When creating insn-peep.c, mark variables + `insn', `x' and `pat' with ATTRIBUTE_UNUSED. + + * objc/init.c (__objc_tree_print): Wrap function definition in + macro `DEBUG'. + + * objc/objc-act.c (encode_array): Cast sprintf argument to `long' + and use %ld specifier. + (adorn_decl): Likewise, twice. + + * reload1.c (reload_cse_regs): Cast first arg of `bzero' to char *. + + * sdbout.c: Include output.h and toplev.h. + (PUT_SDB_INT_VAL): Use HOST_WIDE_INT_PRINT_DEV to print argument + `a'. Cast `a' to HOST_WIDE_INT to force it to always be so. + (PUT_SDB_SIZE): Likewise. + + * sdbout.h (sdbout_mark_begin_function): Add prototype. + + * stmt.c (check_for_full_enumeration_handling): Cast argument of + `warning' to long and use %ld specifier. + + * toplev.c (main): Likewise for `fprintf'. + + * toplev.h (output_file_directive): Add prototype. + + * unroll.c (unroll_loop): Use HOST_WIDE_INT_PRINT_DEC specifier in + call to `fprintf'. + (precondition_loop_p): Likewise. + + * varasm.c Include sdbout.h. + (assemble_static_space): Move sometimes-unused variable `rounded' + into the scope in which it is used. + + * mips.c (gpr_mode): Don't say `static' twice. + + * cpplib.c (cpp_handle_option): Don't pass unneeded NULL to cpp_fatal. + + * objc/objc-act.c (init_selector): Hide prototype and definition. + + * optabs.c (gen_cond_trap): Remove unused variable `icode'. + + * regmove.c (copy_src_to_dest): Likewise for `i'. + + * mips-tfile.c (add_local_symbol): Cast width format specifier to int. + (add_ext_symbol): Likewise. + (add_file): Likewise. + (parse_def): Likewise. + (write_varray): Use HOST_PTR_PRINTF to print a pointer. Fix + remaining format specifiers and arguments. + (write_object): Likewise, several times. + (read_seek): Likewise. + (out_of_bounds): Likewise. + (allocate_cluster): Likewise. + (xmalloc): Likewise. + (xcalloc): Likewise. + (xrealloc): Likewise. + (xfree): Likewise. + + * mips-tdump.c (print_symbol): Likewise. + +Sun Jun 21 17:05:34 1998 Dave Love + + * Makefile.in (install-info): Use install-info program if + available, per GNU standard. + +Sun Jun 21 18:56:44 1998 Jeffrey A Law (law@cygnus.com) + + * invoke.texi: Document -mrelax for the mn10300 and mn10200. + + * basic-block.h (init_regset_vector): Delete declaration. + * flow.c (init_regset_vector): Make it static and add a prototype. + + * bitmap.h (debug_bitmap): Declare. + + * haifa-sched.c (debug_ready_list): Make static. + + * toplev.h (fancy_abort): Declare. + +Sun Jun 21 18:30:13 1998 H.J. Lu (hjl@gnu.org) + + * basic-block.h (init_regset_vector): New declaration. + + * Makefile.in (sdbout.o): Add insn-codes.h to dependency. + + * global.c: Include machmode.h amd move hard-reg-set.h before + rtl.h. + + * haifa-sched.c (insn_issue_delay, birthing_insn_p, + adjust_priority, print_insn_chaino): New declaration. + (schedule_insns): Remove declaration. + (init_target_units, get_visual_tbl_length, + init_block_visualization): Add prototype. + + * integrate.c (pushdecl, poplevel): Remove declaration. + + * rtl.h (expand_expr): Remove declaration. + + * loop.c (oballoc): Remove declaration. + (replace_call_address): Add prototype. + +Sun Jun 21 01:08:17 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Jun 21 01:16:38 1998 John Wehle (john@feith.com) + + * i386.c (output_fp_conditional_move): Don't bother handling + (cc_prev_status.flags && CC_NO_OVERFLOW) since the INSN patterns + prevent this from happening. + + * i386.md (nonlocal_goto_receiver): Delete. + +Sun Jun 21 00:42:20 1998 H.J. Lu (hjl@gnu.org) + + * Makefile.in (crtbeginS.o, crtendS.o): Add -fno-exceptions and + -DCRTSTUFFS_O. + (INSTALL): cd $(srcdir) before make. + + * flow.c (allocate_for_life_analysis, init_regset_vector): + Remove declaration. + + * function.h (get_first_block_beg): New declaration. + + * gbl-ctors.h (__do_global_dtors): Add prototype. + + * gcov-io.h (__fetch_long): New declaration. + (__store_long): Likewise. + (__read_long): Likewise. + (__write_long): Likewise. + + * gcov.c (print_usage): New declaration. + + * Makefile.in (c-iterate.o): Depend on insn-codes.h too. + +Sat Jun 20 00:36:16 1998 Jeffrey A Law (law@cygnus.com) + + * calls.c (expand_call): Initialize "src" and "dest". + * stmt.c (expand_return): Likewise. + * expmed.c (extract_split_bit_field): Similarly for "result" + * gcse.c (compute_hash_table): Mark first arg as unused. + * jump.c (jump_optimize): Initialize reversep. + * tree.c (make_node): Initialize length. + + * c-common.c (check_format_info): Initialize length_char and + fci to keep -Wall quiet. + + * except.c (jumpif_rtx): Put declaration and definition + inside a suitable #ifdef. + (jumpifnot_rtx): Delete dead function. + + * i386.h (output_int_conditional_move): Declare. + (output_fp_conditional_move): Likewise. + (ix86_can_use_return_insn_p): Likewise. + + * optabs.c (init_traps): Put prototype inside a suitable #ifdef. + +Sat Jun 20 00:27:40 1998 Graham + + * alias.c: Include toplev.h. + * caller-save.c: Include toplev.h. + * combine.c: Include toplev.h. + * flow.c Include toplev.h. + * global.c: Include toplev.h. + * jump.c: Include toplev.h. + * local-alloc.c: Include toplev.h. + * loop.c: Include toplev.h. + * regmove.c: Include toplev.h. + * stupid.c: Include toplev.h. + * unroll.c: Include toplev.h. + * Makefile.in: Add toplev.h dependencies. + +Fri Jun 19 22:40:25 1998 Jason Merrill + + * regmove.c (copy_src_to_dest): Add decl for loop_depth. + + * svr4.h (ASM_GENERATE_INTERNAL_LABEL): Cast arg to unsigned. + * dwarf2out.c (ASM_OUTPUT_DWARF_DATA1): Likewise. + Add parens to various macros. + +Fri Jun 19 23:22:42 1998 Bruno Haible + + * c-typeck.c (pop_init_level): Warn about implicit zero initialization + of struct members. + +Fri Jun 19 23:06:33 1998 Jason Merrill + + * varasm.c (assemble_start_function): Add weak_global_object_name. + * tree.c (get_file_function_name): Use it. + +Fri Jun 19 22:55:14 1998 Jeffrey A Law (law@cygnus.com) + + * except.c (jumpif_rtx): Make static and add prototype. + (jumpifnot_rtx): Likewise. + + * README.gnat: Add a build patch from Fred Fish. + + * c-lang.c (GNU_xref_begin, GNU_xref_end): Deleted. + + * Makefile.in (c-iterate.o): Depend on expr.h. + +Fri Jun 19 20:38:34 1998 H.J. Lu (hjl@gnu.org) + + * except.h (emit_unwinder, end_eh_unwinder): Removed. + + * dwarfout.c (getpwd): Add prototype. + (is_pseudo_reg, type_main_variant, is_tagged_type, + is_redundant_typedef): New declaration. + (output_decl): Add prototype for FUNC. + (type_main_variant): Make it static. + (is_tagged_type): Likewise. + (is_redundant_typedef): Likewise. + + * expr.c (do_jump_by_parts_greater_rtx): Removed. + (truthvalue_conversion): Likewise. + + * c-iterate.c: Include "expr.h". + (expand_expr): Use proper values when calling the function. + + * explow.c (emit_stack_save): Add prototype for FCN. + (emit_stack_restore): Likewise. + + * dwarf2out.c (getpwd): Add prototype. + + * dwarf2out.h (debug_dwarf, debug_dwarf_die): New declarations. + + * c-typeck.c (c_expand_asm_operands): Use proper values when calling + expand_expr. + + * c-lex.c (yyprint): Add prototype. + (check_newline, build_objc_string): Remove declaration. + + * c-tree.h (comptypes_record_hook): Removed. + (finish_incomplete_decl): New prototype. + + * alias.c (find_base_value): Add prototype. + (true_dependence): Add prototype for function argument. + + * c-aux-info.c (xmalloc): Remove declaration. + +Fri Jun 19 20:23:05 1998 Robert Lipe + + * i386.c: Include system.h. Remove redundant includes. + (optimization_options): Mark param 'size' with ATTRIBUTE_UNUSED. + (i386_cc_probably_useless_p): Likewise for 'decl', 'attributes', + 'identifier', 'args'. + (i386_valid_type_attribute_p): Likewise for 'attributes'. + (i386_comp_type_attribute_p): Likewise for 'type1', 'type2'. + (function_arg_partial_nregs): Likewise for 'cum', 'mode', 'type', + and 'named'. + (symbolic_operand): Likewise for 'mode'. + (call_insn_operand): Likewise. + (expander_call_insn_operand): Likewise. + (ix86_logical_operator): Likewise. + (ix86_binary_operator_ok): Likewise. + (emit_pic_move): Likewise. + (VOIDmode_compare_op): Likewise. + (is_mul): Likewise. + (str_immediate_operand): Likewise. + (ix86_uary_operator_ok): Likewise for 'code', 'mode', and 'operands'.yy + (asm_output_function_prefix): Likewise for 'name'. + (function_prologue): Likewise for 'file', and 'size'. + (function_epilogue): Likewise. + +1998-06-19 Jim Wilson + + * loop.h (struct induction): Clarify comment for unrolled field. + * unroll.c (find_splittable_givs): Move set of unrolled field + after address validity check. + +Fri Jun 19 18:38:04 1998 Michael Meissner + + * config/fp-bit.c (INLINE): Only define if not already defined. + +1998-06-19 Manfred Hollstein + + * Makefile.in (installdirs): Loop over directories in $(libsubdir) + creating probably missing ones, instead of single if statements. + +Fri Jun 19 10:43:52 1998 Andreas Schwab + + * c-common.c (truthvalue_conversion): Protect side effects in the + expression when splitting a complex value. + * fold-const.c (fold): Likewise. + +Fri Jun 19 02:31:16 1998 Klaus Kaempf (kkaempf@progis.de) + + * cccp.c (hack_vms_include_specification): Rewrite to handle + '#include ' correctly. + +Fri Jun 19 02:24:11 1998 H.J. Lu (hjl@gnu.org) + + * config/i386/linux.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Defined. + +Fri Jun 19 02:10:10 1998 John Wehle (john@feith.com) + + * i386.c (notice_update_cc): Integer conditional moves don't + affect cc0. + + * i386.md (movsfcc, movdfcc, movxfcc): Use emit_store_flag + to support LT, LE, GE, and GT signed integer comparisons. + (movsfcc+1, movsfcc+2, movdfcc+1, movdfcc+2, + movxfcc+1, movxfcc+2): Pattern doesn't match if the comparison + is LT, LE, GE, or GT. + (movdicc): Remove code resulting from an earlier patch which + didn't apply correctly. + +Fri Jun 19 02:00:19 1998 Richard Kenner + + * reload1.c (reload_cse_regno_equal_p): If -ffloat-store, don't + consider a MEM in FP mode as equal. + +Fri Jun 19 01:02:17 1998 Jeffrey A Law (law@cygnus.com) + + * c-decl.c (duplicate_decls): Avoid setting TREE_ASM_WRITTEN for + duplicate declarations of a function. + +Fri Jun 19 00:33:33 1998 H.J. Lu (hjl@gnu.org) + + * config/float-i386.h: New. + + * configure.in (i[34567]86-*-linux-*): Set float_format to i386. + +Thu Jun 18 20:11:00 1998 Jim Wilson + + * sched.c (schedule_insns): Use xmalloc not alloca for max_uid + indexed arrays. Call free at the end of the function for them. + * haifa-sched.c (schedule_insns): Likewise. + +Thu Jun 18 18:16:01 1998 Jim Wilson + + * dwarf2out.c (size_of_string): Do count backslashes. + +Thu Jun 18 11:43:54 1998 Nick Clifton + + * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Disallow REG+REG + addressing when one register is the frame pointer or stack + pointer. Disallow REG+CONST addressing in HI mode. + +Thu Jun 18 17:30:39 1998 J"orn Rennecke + + * reload.c (find_reloads): Don't narrow scope of RELOAD_OTHER to + RELOAD_FOR_INSN. + +Thu Jun 18 09:36:50 1998 Kaveh R. Ghazi + + * Makefile.in (c-lang.o): Depend on output.h. + + * c-lang.c: Include output.h. + + * sparc.c (sparc_builtin_saveregs): Remove unused variable `fntype'. + + * except.c (expand_builtin_eh_stub): Likewise for variable `jump_to'. + + * genrecog.c (write_subroutine): When writing insn-recog.c, mark + variables `insn', `pnum_clobbers', `x[0 .. max_depth]' and `tem' + with ATTRIBUTE_UNUSED. + + * regmove.c (copy_src_to_dest): Make function static to match its + prototype. + + * reload1.c Include hard-reg-set.h before rtl.h to get macro + HARD_CONST. Include machmode.h before hard-reg-set.h. + + * rtl.h: Prototype `retry_global_alloc' and wrap with macro + HARD_CONST to protect usage of typedef HARD_REG_SET. + + * tree.c: Prototype `_obstack_allocated_p'. + + * varasm.c: Wrap prototype of `asm_output_aligned_bss' in macro + BSS_SECTION_ASM_OP. + +Thu Jun 18 09:20:47 1998 Kaveh R. Ghazi + + * pa.c: Include system.h and toplev.h. Remove redundant code. + (call_operand_address): Mark parameter `mode' with ATTRIBUTE_UNUSED. + (symbolic_operand): Likewise. + (symbolic_memory_operand): Likewise. + (pic_label_operand): Likewise. + (fp_reg_operand): Likewise. + (pre_cint_operand): Likewise. + (post_cint_operand): Likewise. + (ireg_or_int5_operand): Likewise. + (int5_operand): Likewise. + (uint5_operand): Likewise. + (int11_operand): Likewise. + (uint32_operand): Likewise. + (ior_operand): Likewise. + (lhs_lshift_cint_operand): Likewise. + (pc_or_label_operand): Likewise. + (legitimize_pic_address): Likewise. + (hppa_legitimize_address): Likewise for parameter `old'. + (output_block_move): Likewise for parameter `size_is_constant'. + (output_function_prologue): Likewise for parameter `size'. + (output_function_epilogue): Likewise. + (return_addr_rtx): Likewise for parameter `count'. + (output_mul_insn): Likewise for parameter `unsignedp'. + (hppa_builtin_saveregs): Likewise for parameter `arglist'. + (output_bb): Likewise for parameter `operands'. + (output_bvb): Likewise. + (function_label_operand): Likewise for parameter `mode'. + (plus_xor_ior_operator): Likewise. + (shadd_operand): Likewise. + (non_hard_reg_operand): Likewise. + (eq_neq_comparison_operator): Likewise. + (movb_comparison_operator): Likewise. + (pa_combine_instructions): Likewise for parameter `insns'. + + * pa.h: Add prototypes for functions `output_deferred_plabels', + `override_options', `output_ascii', `output_function_prologue', + `output_function_epilogue', `print_operand', + `symbolic_expression_p', `reloc_needed', `compute_frame_size', + `hppa_address_cost', `and_mask_p', `symbolic_memory_operand', + `pa_adjust_cost', `pa_adjust_insn_length' and + `secondary_reload_class'. + +Wed Jun 17 22:28:48 1998 Jason Merrill + + * configure.in: Don't turn on collect2 unconditionally. + +Wed Jun 17 20:20:48 1998 Mark Mitchell + + * cse.c (cse_basic_block): Don't include NOTE insns in the count + that is used to decide whether or not it is time to erase the + equivalence table. + +Wed Jun 17 18:30:43 1998 Franz Sirl + + * rs6000/linux.h (JUMP_TABLES_IN_TEXT_SECTION): Define to zero. + +Wed Jun 17 19:05:03 1998 John Carr + + * haifa-sched.c (haifa_classify_insn): TRAP_IF is risky. + (sched_analyze_2): Allow scheduling TRAP_IF. + + * reorg.c (mark_referenced_resources): Examine operands of TRAP_IF. + + * rtl.h (TRAP_CODE): New macro. + + * rtl.def (TRAP_IF): Change second operand type to rtx. + + * optabs.c (gen_cond_trap): New function. + (init_traps): New function. + (init_optabs): Call init_traps. + * expr.h: Declare gen_cond_trap. + + * jump.c (jump_optimize): Optimize jumps to and around traps. + + * sparc.md: Define trap instructions. + + * rs6000.md: Define trap instructions. + * rs6000.c (print_operand): New code 'V' for trap condition. + (trap_comparison_operator): New function. + + * m88k.md: Update use of TRAP_IF. + + * tree.h (enum built_in_function): New function code BUILT_IN_TRAP. + * c-decl.c (init_decl_processing): New builtin __builtin_trap. + * expr.c (expand_builtin): Handle BUILT_IN_TRAP. + + * expr.c (expand_builtin): Error if __builtin_longjmp second argument + is not 1. + +Wed Jun 17 15:20:00 1998 Catherine Moore + + * reload1.c (spill_hard_reg): Check mode of register when + spilling from scratch_list. + +Wed Jun 17 16:25:38 1998 Andrew MacLeod (amacleod@cygnus.com) + + * except.c (add_new_handler): Fix bug in finding last region handler. + * libgcc2.c (find_exception_handler): Pass exception table pointer + to runtime type matcher, not the match info field. + +Wed Jun 17 15:57:48 1998 Andrew MacLeod (amacleod@cygnus.com) + + * eh-common.h (struct eh_context): Add comment for hidden use of + field dynamic_handler_chain. + * except.c (get_dynamic_handler_chain): Comment on, and use the + correct offset of the dynamic_handler_chain field. + +1998-06-17 Jim Wilson + + * mips/iris6.h (LINK_SPEC): Add -woff 131. + +1998-06-17 Jason Merrill + + * dwarf2out.c: Disable EH_FRAME_SECTION if we don't have .init. + + * configure.in: Don't disable collect2 when we have GNU ld. + +Wed Jun 17 08:38:13 1998 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (make_range): Do not widen the type of the expression. + + * expr.c (check_max_integer_computation_mode): New function. + (expand_expr): Avoid integer computations in modes wider than + MAX_INTEGER_COMPUTATION_MODE. + * fold-const.c (fold): Likewise. + * tree.h (check_max_integer_computation_mode): Declare. + * tm.texi (MAX_INTEGER_COMPUTATION_MODE): Document it. + + * configure.in (nm): Make a link to "nm" in the build tree too. + + * mn10300.md (andsi3): Fix typo. + +Tue Jun 16 22:58:40 1998 Richard Henderson + + * reload1.c (reload_cse_regs): Call bzero instead of looping. + +Tue Jun 16 18:30:35 1998 Jim Wilson + + * dwarf2out.c (stripattributes): Prepend '*' to the section name. + +Tue Jun 16 16:49:26 1998 Richard Henderson + + * alpha.c (alpha_expand_prologue, alpha_expand_epilogue): New fns. + (output_prologue, output_epilogue): Merge VMS and OSF versions; + Remove anything related to the actual code generation. + (output_end_prologue): New function. + (alpha_sa_mask, alpha_sa_size): Merge VMS and OSF versions. + (alpha_does_function_need_gp): Return false for VMS. + (alpha_function_needs_gp): Make static. + (add_long_const): Delete. + (summarize_insn): Don't assume a SUBREG is of a REG. + Prototype all static functions. Rename VMS-specific global + variables vms_*. + * alpha.h (TARGET_CAN_FAULT_IN_PROLOGUE): Default to 0. + (FUNCTION_BOUNDARY): Align to cache line. + (LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER): Align to octaword. + (FUNCTION_END_PROLOGUE): New macro. + * alpha.md (attribute length): New. Mark all insns. + (return_internal, prologue_stack_probe_loop): New patterns. + (prologue, init_fp, epilogue): New patterns. + Disable peepholes. + * linux.h (TARGET_CAN_FAULT_IN_PROLOGUE): Define. + +Tue Jun 16 17:36:35 1998 Dave Brolley + + * toplev.c (lang_options): Add -trigraphs option for cpplib. + +Tue Jun 16 23:33:24 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_before_p): RELOAD_FOR_OUTADDR_ADDRESS + is earlier than RELOAD_FOR_OUTPUT_ADDRESS; RELOAD_FOR_INPADDR_ADDRESS + is earlier than RELOAD_FOR_INPUT_ADDRESS. + +Tue Jun 16 13:15:16 1998 Jim Wilson + + * libgcc1-test.c (memcpy): Define. + +Tue Jun 16 13:44:02 1998 Michael Meissner + + * genattrtab.c (struct attr_desc): Change int flags to bit + fields. Add bit fields for this being function_units_used + or *_blockage_range attributes. + (write_unit_name): New function to print a function unit name + given unit #. + (expand_units): Indicate whether this is function_units_used or + *_blockage_range attributes. + (write_toplevel_expr): Print function_units_used and + *_blockage_range attributes in a more friendly fashion. + (make_internal_attr): Indicate whether this attribute is either + function_units_used or *_blockage_range. + +Mon Jun 15 17:06:43 1998 Michael Meissner + Jim Wilson + + * regmove.c (copy_src_to_dest): Do not copy src to dest if either + the source or destination is special. + +Mon Jun 15 13:20:33 1998 Jim Wilson + + * c-decl.c (shadow_tag_warned): Use specs not declspecs in for loop. + +Mon Jun 15 07:16:29 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Jun 13 13:10:40 1998 Krister Walfridsson + + * config/sparc/netbsd.h (DEFAULT_PCC_STRUCT_RETURN): Undefine before + redefining it. + +Fri Jun 12 18:06:45 1998 Doug Evans + + * m32r/m32r.h (STARTFILE_SPEC): Delete crtsysc.o. + (ENDFILE_SPEC): Add -lgloss. + +Fri Jun 12 14:57:59 1998 Kaveh R. Ghazi + + * mips.c (small_int): Mark parameter `mode' with ATTRIBUTE_UNUSED. + (large_int): Likewise. + (pc_or_label_operand): Likewise. + (call_insn_operand): Likewise. + (consttable_operand): Likewise. + (m16_uimm3_b): Likewise. + (m16_simm4_1): Likewise. + (m16_nsimm4_1): Likewise. + (m16_simm5_1): Likewise. + (m16_nsimm5_1): Likewise. + (m16_uimm5_4): Likewise. + (m16_nuimm5_4): Likewise. + (m16_simm8_1): Likewise. + (m16_nsimm8_1): Likewise. + (m16_uimm8_1): Likewise. + (m16_nuimm8_1): Likewise. + (m16_uimm8_m1_1): Likewise. + (m16_uimm8_4): Likewise. + (m16_nuimm8_4): Likewise. + (m16_simm8_8): Likewise. + (m16_nsimm8_8): Likewise. + (m16_usym8_4): Likewise. + (m16_usym5_4): Likewise. + (mips_move_1word): Change type of variable `i' from int to size_t. + (mips_move_2words): Likewise. + (output_block_move): Mark parameter `libname' with ATTRIBUTE_UNUSED. + (function_arg_advance): Use HOST_PTR_PRINTF to print an address. + (function_arg): Likewise. + (function_arg_partial_nregs): Mark parameter `named' with + ATTRIBUTE_UNUSED. + (override_options): Use ISDIGIT instead of isdigit. + (mips_output_external): Mark parameter `file' with ATTRIBUTE_UNUSED. + (final_prescan_insn): Likewise for parameters `opvec' and `noperands'. + (save_restore_insns): Cast HOST_WIDE_INT arguments passed to + function `fatal' to long before printing. Use + HOST_WIDE_INT_PRINT_DEC in fprintf. Both changes done several + times in this function. + (function_prologue): Mark parameter `size' with ATTRIBUTE_UNUSED. + (function_epilogue): Likewise for parameters `file' and `size'. + Print an int with "%d" not "%ld". + (mips_select_rtx_section): Mark parameter `x' with ATTRIBUTE_UNUSED. + (mips_function_value): Likewise for parameter `func'. + (function_arg_pass_by_reference): Likewise for parameters `cum' + and `named'. + (extend_operator): Likewise for parameter `mode' + (highpart_shift_operator): Likewise. + + * mips.md (mul_acc_si): Remove unused variable `macc'. + +Fri Jun 12 09:33:44 1998 Richard Henderson + + * fold-const.c (fold): Revert last change. It breaks constant + expressions somehow. + +Fri Jun 12 10:23:36 1998 Andreas Schwab + + * expr.c (do_jump, case EQ_EXPR, NE_EXPR): When comparing complex + prevent operands from being evaluated twice. + +Fri Jun 12 00:50:27 1998 Sergey Okhapkin + + * toplev.c (lang_options): Add -remap as a preprocessor option. + +Fri Jun 12 00:30:32 1998 John Wehle (john@feith.com) + + * i386.md (cmpsi_1, cmphi_1, cmpqi_1): Remove code + which set CC_REVERSED since reload should ensure that + the operands are already the correct type. + +Thu Jun 11 17:14:15 1998 Jim Wilson + + * except.c (expand_builtin_eh_stub): Call emit_move_insn rather than + calling gen_rtx_SET. + +Thu Jun 11 18:45:49 1998 David Edelsohn + + * config/rs6000/x-aix43 (AR): Delete. + (AR_FOR_TARGET_FLAGS): Add -X32_64 here. + +Thu Jun 11 16:19:17 1998 David W. Schuler + + * config/i386/aix386ng.h (CPP_SPEC): Remove extraneous quote. + +Thu Jun 11 12:40:27 1998 Jim Wilson + + * mips.c (override_options): Replace word_mode with explicit + TARGET_64BIT check. + +Thu Jun 11 14:50:02 1998 Michael Meissner + + * regmove.c (regmove_optimize): If we can't replace the + destination in an insn that sets the source, generate an explicit + move of the source to the destination. + (copy_src_to_dest): New function. + (toplevel): Include basic-block.h. + + * Makefile.in (regmove.o): Add basic-block.h dependencies. + +Thu Jun 11 10:30:09 1998 Dave Brolley + + * toplev.c (lang_options): Add missing options (nostdinc, idirafter). + +Wed Jun 10 23:39:32 1998 Mark Mitchell + + * rtl.h (rtx_def): Improve documentation. + (MEM_IN_STRUCT_P): Likewise. + +Wed Jun 10 23:23:17 1998 Graham + + * c-decl.c (start_decl): Correct test for -Wmain. + + * c-decl.c (grokdeclarator): Remove unused variable "last". + +Wed Jun 10 14:52:27 1998 Jim Wilson + + * expr.c (expand_builtin_setjmp): Store const1_rtx in target. + (expand_builtin_longjmp): Abort if value isn't const1_rtx. + Delete code storing value in static_chain_rtx. + (expand_builtin, case BUILT_IN_LONGJMP): Pass NULL_RTX for target + to second expand_expr call. + +Wed Jun 10 13:08:41 1998 Mark Mitchell + + * mips/mips.c: Remove -mabi=o32 and -mabi=n64. + +Wed Jun 10 13:41:23 1998 Dave Brolley + + * cppmain.c (fatal): New function. + * configure.in (cpp_main): New configuration variable. + * configure: Regenerated. + * Makefile.in (CCCP): Use a configuration variable to select basex + for cccp. + (cppmain$(exeext)): Add @extra_cpp_objs@. + +Wed Jun 10 13:07:02 1998 Dave Brolley + + * objc/objc-act.c: Add cpplib declarations. + (lang_decode_option): Initialize cpplib if necessary. + (lang_decode_option): New argc/argv interface. + * tree.h (lang_decode_option): New argc/argv interface. + * toplev.c (lang_options): Add cpp options. + (main): New interface for lang_decode_option. + * gcc.c (default_compilers): Don't call cpp for a cpplib-enabled C compiler + unless -E, -M or -MM is specified. + * cpplib.h (cpp_handle_option): New function. + * cpplib.c (cpp_handle_option): New function. + (cpp_handle_options): Now calls cpp_handle_option. + * c-tree.h (c_decode_option): New argc/argv interface. + * c-lex.c (init_parse): cpplib now initialized in c_decode_option. + * c-lang.c (lang_decode_option): New argc/argv interface. + * c-decl.c: Add cpplib declarations. + (c_decode_option): New argc/argv interface. + (c_decode_option): Call cpp_handle_option. + (c_decode_option): Now returns number of strings processed. + +Wed Jun 10 09:47:13 1998 Richard Earnshaw (rearnsha@arm.com) + + * unroll.c (verify_addresses): Use validate_replace_rtx to undo the + changes. Abort if the undo fails. + +1998-06-10 Vladimir N. Makarov + + * config/rs6000/rs6000.c (output_prolog): Change locations and + directions of saving and restoring arguments of main on the stack. + +Wed Jun 10 08:56:27 1998 John Carr + + * reload1.c (reload_cse_simplify_operands): Do not call gen_rtx_REG + for each alternative. Do not replace a CONST_INT with a REG unless + the reg is cheaper. + +Wed Jun 10 02:11:55 1998 Jeffrey A Law (law@cygnus.com) + + * decl.c (init_decl_processing): Fix typo. + + * mips.c (gpr_mode): New variable. + (override_options): Initialize gpr_mode. + (compute_frame_size): Use "gpr_mode" instead of "word_mode" to + determine size and offset of general purpose registers save slots. + (save_restore_insns, mips_expand_prologue): Similarly. + + * reload.c (find_reloads_toplev): Use gen_lowpart common to convert + between constant representations when we have (SUBREG (REG)) with + REG equivalent to a constant. + +Wed Jun 10 01:39:00 1998 Juha Sarlin + + * h8300.c (get_shift_alg): Add special cases for shifts of 8 and 24. + +Tue Jun 9 22:05:34 1998 Richard Henderson + + * fold-const.c (fold): Even with otherwise constant trees, look for + opportunities to combine integer constants. + +Wed Jun 3 23:41:24 1998 John Wehle (john@feith.com) + + * i386.c (notice_update_cc): Clear cc_status.value2 in the + case of UNSPEC 5 (bsf). + + * i386.md (movsfcc, movdfcc, movxfcc): The floating point + conditional move instructions don't support signed integer + comparisons. + +Tue Jun 9 14:31:19 1998 Nick Clifton + + * config/v850/t-v850 (TCFLAGS): Add assembler options to warn of + overflows. + + * config/v850/lib1funcs.asm (__return_interrupt): Use 'addi + 16,sp,sp' ratehr than 'add 16,sp'. Patch courtesy of Biomedin + . + +Tue Jun 9 16:23:13 1998 Andrew MacLeod + + * except.c (expand_start_catch): Rename to start_catch_handler. + (expand_end_catch): Delete function. + (expand_end_all_catch): Remove catch status that expand_end_catch + use to do. + * except.h (expand_start_catch): Rename prototype. + (expand_end_catch): Delete prototype. + +Tue Jun 9 12:57:32 1998 Mark Mitchell + + * invoke.texi: Add documentation for -mips4 and -mabi=*. + +Tue Jun 9 12:12:34 1998 Klaus Kaempf (kkaempf@progis.de) + + * alpha/vms.h (EXTRA_SECTIONS): Add in_ctors and in_dtors. + (EXTRA_SECTION_FUNCTIONS): Add ctors_section and dtors_section. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define. + +Tue Jun 9 12:10:27 1998 John Carr + + * haifa-sched.c (update_flow_info): Use UNITS_PER_WORD, not MOVE_MAX, + as the threshold to permit splitting memory operations. + +Tue Jun 9 12:36:16 1998 Jeffrey A Law (law@cygnus.com) + + * mips.c (gpr_mode): New variable. + (override_options): Initialize gpr_mode. + (compute_frame_size): Use "gpr_mode" instead of "word_mode" to + determine size and offset of general purpose registers save slots. + (save_restore_insns, mips_expand_prologue): Similarly. + + * Makefile.in (LIB2FUNCS_EH): Define. Just "_eh" for now. + (LIBGCC2_CFLAGS): Remove -fexceptions. + (LIB2FUNCS): Remove "_eh". + (libgcc2.a): Iterate over LIB2FUNCS_EH and build everything in + it with -fexceptions. + + * Makefile.in (local-alloc.o): Depend on insn-attr.h. + * local-alloc.c (block_alloc): Avoid creating false + dependencies for targets which use instruction scheduling. + +Tue Jun 9 02:40:49 1998 Richard Henderson + + * mips/elf.h (ASM_DECLARE_OBJECT_NAME): Define. + (ASM_FINISH_DECLARE_OBJECT): Define; + * mips/elf64.h: Likewise. + +Tue Jun 9 01:08:47 1998 Richard Henderson + + * toplev.c (flag_new_exceptions): Remove extraneous `extern'. + +Mon Jun 8 23:24:48 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Jun 8 23:24:58 1998 David Edelsohn + + * rs6000.md (mulsidi3): Add !TARGET_POWERPC64 constraint. + (mulsidi3_ppc64): Delete. + +Mon Jun 8 20:57:40 1998 Kaveh R. Ghazi + + * Makefile.in (varasm.o): Depend on dbxout.h. + (cse.o): Depend on toplev.h and output.h. + (gcse.o): Depend on output.h. + + * mips.c: Include system.h and toplev.h and remove redundant code. + Include output.h after tree.h so all its prototypes get activated. + * mips.md (table_jump): Remove unused variable `dest'. + + * sparc.h: Add prototype for `v8plus_regcmp_op'. + + * crtstuff.c (fini_dummy, init_dummy): Mark function definitions + with __attribute__ ((__unused__)). + (__frame_dummy): Provide prototype before use, wrap it with + EH_FRAME_SECTION_ASM_OP. + + * cse.c: Move inclusion of above local headers. + Include toplev.h and output.h. + + * dbxout.h: Add prototype for `dbxout_begin_function'. + + * final.c (final_scan_insn): Wrap variable `max_skip' in macro + ASM_OUTPUT_MAX_SKIP_ALIGN. + + * gcse.c: Include system.h and output.h. + (dump_cuid_table, dump_rd_table, dump_cprop_data, dump_pre_data): + Make extern instead of static. + (compute_can_copy): Only declare variables `reg' and `insn' when + AVOID_CCMODE_COPIES is not defined. + (record_set_info): Mark parameter `setter' with ATTRIBUTE_UNUSED. + (hash_scan_clobber): Likewise for `x' and `insn'. + (hash_scan_call): Likewise. + (record_last_set_info): Likewise for `setter'. + (mark_call): Likewise for `pat'. + (pre_insert_insn): Wrap variable `note' in macro HAVE_cc0. + + * libgcc2.c (__bb_init_prg): Replace bzero with memset and fix the + length parameter so that it multiplies the number of elements by + the sizeof(element). + + * output.h: Add prototype for `weak_finish'. + + * recog.h: Likewise for `validate_replace_src'. + + * rtl.h: Likewise for `optimize_save_area_alloca', + `fix_sched_param', `purge_addressof', `gcse_main', + `regmove_optimize', `dbr_schedule', `branch_prob' and + `end_branch_prob'. + + * toplev.h: Likewise for `set_float_handler' and + `output_quoted_string'. + + * varasm.c: Include dbxout.h. + +Mon Jun 8 18:12:06 1998 Jim Wilson + + * mips.c (mips_secondary_reload_class): Use gp_reg_p instead of + GP_REG_P. Use gr_regs instead of GR_REGS. + +Mon Jun 8 16:54:12 1998 Ken Raeburn + Jeff Law + + * Revamped multiply support for MIPS chips. + * mips.c (extend_operator): New function. + (highpart_shift_operator): Likewise. + * mips.h: Declare new functions. + (PREDICATE_CODES): Add support for new predicates. + * mips.md (mulsi3 expander): Simplify. + (mulsi_mult3): Add another constraint alternative. Support + 3 operand multiply instructions as found on various mips + parts. + (mulsi3_r4650): Delete pattern, now handled by mulsi_mult3. + (mul_acc_si): New pattern and associated splitters. + (mulsidi3 expander): Rework to use mulsidi3_64bit and + mulsidi3_internal. + (umulsidi3): New expander. + (mulsidi3_internal): Accept either sign or zero extended + operands and generate code as appropriate appropriately. + (mulsidi3_64bit): Similarly. + (smulsi3_highpart): Turn into an expander and generate code + to match new patterns. + (umulsi3_highpart): Likewise. + (xmulsi3_highpart_internal): New pattern. + (maddi patterns): Delete. Replace with: + (mul_acc_di, mul-acc_64bit_di): New patterns. + +Mon Jun 8 14:16:15 1998 Andrew MacLeod + + * eh-common.h: Remove NEW_EH_MODEL compile time flag, and replace with + flag_new_exceptions runtime flag. + (struct old_exception_table): New struct which represents what + the exception table looks like without the new model. + (NEW_EH_RUNTIME): New value used as a tag in the exception table to + flag that this is a new style table. + * except.h: Remove compile time flag NEW_EH_MODEL. + (expand_builtin_eh_stub_old): New prototype. + * tree.h (enum built_in_function): Add BUILT_IN_EH_STUB_OLD. + * expr.c (expand_builtin): New builtin func BUILT_IN_EH_STUB_OLD. + * c-decl.c (init_decl_processing): Add new builtin function + __builtin_eh_stub_old. + * final.c (final_scan_insn): Replace compile time flag NEW_EH_MODEL. + * flags.h (flag_new_exceptions): New runtime flag. + * toplev.c (flag_new_exceptions): Initialize default to 0, + -fnew-exceptions sets to 1. + * except.c (output_exception_table_entry): Output New style exception + identifier into table, and replace compile time flag NEW_EH_MODEL + with runtime flag flag_new_exceptions. + (output_exception_table): Replace compile time flag NEW_EH_MODEL. + (expand_builtin_eh_stub_old): Duplicates original functionality of + expand_builtin_eh_stub. + (expand_builtin_eh_stub): Replace compile time flag NEW_EH_MODEL. + * libgcc2.c (find_exception_handler): Remove NEW_EH_MODEL #ifdefs. + (old_find_exception_handler): New func, same as find_exception_handler + except it works on the old style exception table. + (__throw): Replace NEW_EH_MODEL. Detect new model based on presence + of identifier in the exception table, and call appropriate routines. + +Mon Jun 8 01:21:13 1998 Jason Merrill + + * function.c: Define current_function_cannot_inline. + (push_function_context_to): Save it. + (pop_function_context_from): Restore it. + * function.h (struct function): Provide it a home. + * output.h: Declare it. + * integrate.c (function_cannot_inline_p): Check it. + +Mon Jun 8 10:43:15 1998 Richard Henderson + + * expr.c (force_operand): Detect PIC address loads before + splitting arithmetic. + +Mon Jun 8 09:22:38 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Jun 8 02:55:56 1998 Graham + + * tree.c (tree_class_check): Add braces to eliminate ambiguous + else warning. + (tree_check): Likewise. + +Mon Jun 8 02:49:23 1998 H.J. Lu (hjl@gnu.org) + + * reg-stack.c (subst_stack_regs_pat): Make sure the top of + stack is the destination for conditional move insn. + +Mon Jun 8 01:21:13 1998 Jason Merrill + + * tree.h (TREE_VEC_END): Cast unused value to void. + + * i386.c (print_operand): Use %lx for long operand. + +Mon Jun 8 00:04:07 1998 Richard Henderson + + * alpha.c (summarize_insn): Ignore rtl slot format 'i'. + +Sun Jun 7 14:15:45 1998 John Carr + + * sol2.h (INIT_SUBTARGET_OPTABS): Use Solaris libc float/long long + conversion functions. + +Sun Jun 7 14:02:58 1998 Richard Henderson + + * toplev.c (flag_exceptions): Default to 0. + (compile_file): Remove flag_exceptions == 2 hack. + (main): Call lang_init_options. + * tree.h: Declare it. + * c-lang.c: Implement it. + * objc/objc-act.c: Likewise. + +Sun Jun 7 12:27:30 1998 David Edelsohn + + * rs6000.md (restore_stack_block): Generate MEM and specify mode. + * rs6000.h (STACK_SAVEAREA_MODE): SAVE_FUNCTION is VOIDmode. + * rs6000.c (rs6000_output_load_toc_table): Use fputs. + (output_function_profiler): Use asm_fprintf and fputs. + +Sat Jun 6 12:17:12 1998 Kaveh R. Ghazi + + * gencheck.c: Remove redundant stdio.h include. Add a definition + of xmalloc for when we are forced to link with alloca.o. + + * reload1.c (reload_reg_free_for_value_p): Use `(unsigned)1' + instead of `1U'. + + * fold-const.c (constant_boolean_node): Make definition static to + match the prototype. + +Fri Jun 5 15:53:17 1998 Per Bothner + + * gcc.c (lang_specific_pre_link): New LANG_SPECIFIC_DRIVER function. + (lang_specific_extra_outfiles): New LANG_SPECIFIC_DRIVER variable. + (do_spec, input_filename, input_filename_length): Make public. + (main): Adjust outfiles allocation by lang_specific_extra_outfiles. + Call lang_specific_pre_link befor elinking. + +Fri Jun 5 12:29:28 1998 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (rank_for_schedule): For "equally good insns", prefer + the insn which has the most insns dependent on it. + +Fri Jun 5 09:03:22 1998 John Carr + + * alias.c (find_base_value): Avoid reading past end of reg_base_value. + +Fri Jun 5 03:05:34 1998 Richard Henderson + + * alpha.md (insxh-1): New insxl pattern for combine. + +Fri Jun 5 01:12:15 1998 H.J. Lu (hjl@gnu.org) + + * i386/i386.c (output_fp_conditional_move): New function + to output floating point conditional move. + (output_int_conditional_move): New function to output integer + conditional move. + + * i386/i386.md (movsicci+5, movhicc+5, movdicc+5): Call + output_int_conditional_move () to output int conditional move. + (movsfcc+5, movdfcc+5, movxfcc+5): Call + output_fp_conditional_move () to output floating point + conditional move. + + * i386/i386.c (put_condition_code): In INT mode, check + cc_prev_status.flags & CC_NO_OVERFLOW for GE and LT. + +Thu Jun 4 16:09:51 1998 Dave Brolley + + * dbxout.c (dbxout_type): Output arrays of bits as if + they were bitstrings for Chill + +Thu Jun 4 14:35:27 1998 David Edelsohn + + * tree.c (get_inner_array_type): New function. + * tree.h (get_inner_array_type): Prototype. + * expr.h (STACK_SAVEAREA_MODE): New macro. + * expr.c (expand_builtin_setjmp): Initialize sa_mode using + STACK_SAVEAREA_MODE. + (expand_builtin_longjmp): Likewise. + * explow.c (emit_stack_save): Likewise. + (allocate_dynamic_stack_space): Use Pmode not insn_operand_mode. + + * rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC. + (CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC. + * rs6000/aix43.h: New file. + * rs6000/t-aix43: New file. + * rs6000/x-aix41: New file. + * rs6000/x-aix43: New file. + * configure.in (rs6000-ibm-aix*): Use them. + * rs6000/powerpc.h: Delete. + * rs6000/sysv4.h: Move necessary powerpc.h definitions to here, + * rs6000/netware.h: and here, + * rs6000/win-nt.h: and here. + + * rs6000/rs6000.c (processor_target_table, 620): Do not affect + MASK_POWERPC64. + (rs6000_override_options): Ignore flag_pic for AIX. + (rs6000_immed_double_const): Delete. + (u_short_cint_operand): Don't assume 32-bit CONST_INT. + (reg_or_u_short_operand): Don't assume 32-bit CONST_INT. + (num_insns_constant): mask64_operand() is 2 insns. + (logical_operand): Don't assume 32-bit CONST_INT. + (non_logical_cint_operand): Don't assume 32-bit CONST_INT. + (easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit. + (mask_constant): HOST_WIDE_INT parameter. + (non_and_cint_operand): Delete. + (mask64_operand): New function. + (and64_operand): New function. + (function_arg_advance): DImode arguments do not need special + alignment when 64-bit. + (function_arg): Likewise. + (setup_incoming_varargs): Reverse reg_size assignment. + (print_operand): HOST_WIDE_INT second parameter. + (print_operand, 'B'): New case. + (print_operand, 'M'): Fix typo in lossage string. + (print_operandm 'S'): New case. + (rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size + to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset. + (rs6000_output_load_toc_table): Reverse init_ptr assignment. Use + TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs. + Load GOT highpart, don't add it. Add lowpart with {cal|la}. + (rs6000_allocate_stack_space): Use {cal|la}. + (output_epilog): Use {cal|la} + (output_function_profiler): Add call glue to mcount call. + Load GOT highpart, don't add it. Add lowpart with {cal|la}. + + * rs6000/rs6000.h (TARGET_SWITCHES): Add powerpc64. + (STACK_BOUNDARY): Depend on TARGET_32BIT. + (ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type. + (CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT. + (EXTRA_CONSTRAINTS): Remove NT 'S' and 'T'. Replace 'S' with + 64-bit mask operand. + (RS6000_SAVE_TOC): Depend on TARGET_32BIT. + (STACK_SAVEAREA_MODE): New macro. + (LEGITIMATE_CONSTANT_P): DImode okay for 64bit. + (LEGITIMIZE_RELOAD_ADDRESS): New macro. + (RTX_COSTS, AND/IOR/XOR): Reflect current machine description. + (ASM_FILE_START): Emit 64-bit ABI directive. + (ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit. + (PREDICATE_CODES): Add "and64_operand" and "mask64_operand". + Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE. + + * rs6000/rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask. + Restore define_splits. + (floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint. + (floatsidf2_internal, floatunssidf2_internal2): Likewise. + Do not specify base register operand mode. + (floatsidf2_loadaddr): Do not specify base register operand mode. + (floatsidf2_store1, floatsidf2_store2): Operand 1 must be base + register; do not specify mode. Remove !TARGET_POWERPC64 final + constraint. + (floatsidf2_load): Do not specify base register operand mode. Remove + !TARGET_POWERPC64 final constraint. + (fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Do not specify + base register operand mode. + (adddi3): Split large constants early. + (absdi3): Shift by 63, not 31. + (*mulsidi3_ppc64): New pattern. + (rotldi3): Add masking combiner patterns. + (anddi3): Add rldic{r,l} masking. Remove split of large constants + because PPC insns zero-extend. + (iordi3, xordi3): Split large constants early. + (movsi matcher): Remove S and T constraints. + (movsf const_double): Create SImode constant from TARGET_DOUBLE. + (movdf_hardfloat32): Add default abort() case. + (movdf easy_fp_const): Create DImode constant from TARGET_DOUBLE. + (movdi): Remove 64-bit constant generator. Try to convert + CONST_DOUBLE to CONST_INT. Handle TOC memory constants. + (movdi_32): Add default abort() case. + (movdi_64): Add numerous ways to split 64-bit constants. + Make catch-all define_split more optimal and never FAIL. + (movti_ppc64): Add default abort() case. + (allocate_stack): Remove operand modes. Use Pmode. + (restore_stack_block): Remove operand modes. Generate Pmode + temporary. + (save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode + temporary. Save area is double Pmode. + (call_indirect_aix64, call_value_indirect_aix64): New patterns. + (call, call_value): Do not specify address operand mode. Choose + appropriate AIX ABI. + (*call_local64, *ret_call_local64): New patterns. + (*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns. + (*ret_call_nonlocal_aix32): Use call_value_indirect for REG. + (compare): Materialize DImode truthvalues. + +Thu Jun 4 01:26:57 1998 Craig Burley + + * expr.c (safe_from_p): Avoid combinatorial explosion + over duplicate SAVE_EXPRs by ensuring we never recurse + on one that has already been visited. + +Thu Jun 4 00:54:21 1998 Graham + + * loop.c (check_dbra_loop): Initialize final_value before + normalizing the loop. + +Wed Jun 3 20:00:04 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): New arguments out and + reloadnum. Changed all callers. + +1998-06-03 Ulrich Drepper + + * system.h: Add _() and N_() macros in preparation for gettext. + +Wed Jun 3 11:02:24 1998 Andreas Schwab + + * c-common.c (check_format_info): Put back check for C9x `hh' + length modifier. Warn about %n format writing into const. Remove + obsolete comment. + (format_char_info): Fix comments. + + * configure.in: Set float_format to m68k for all m68k targets that + do not override LONG_DOUBLE_TYPE_SIZE. + * config/float-m68k.h: New file. + +Tue Jun 2 23:14:01 1998 Richard Henderson + + * jump.c (jump_optimize): Remove debug messages accidentally left in + with the previous change. + +Tue Jun 2 22:46:08 1998 Richard Henderson + + * expr.c (store_expr): Revert stray patch associated with + 1998-05-23 commit. + +Tue Jun 2 21:59:01 1998 Richard Henderson + + * jump.c (rtx_unsafe_p): New function. + (jump_optimize): Use it on if/then/else transformations and + conditional move transformations. + +Tue Jun 2 22:50:10 1998 Andreas Schwab + + * fold-const.c (fold, case EQ_EXPR): When folding VAR++ == CONST + or VAR-- == CONST construct a proper mask if VAR is a bitfield. + Cope with CONST being out of range for the bitfield. + +Tue Jun 2 22:28:31 1998 Bernd Schmidt + + * expr.c (emit_move_insn_1): When moving complex values in several + steps, emit a CLOBBER to show the destination dies. + +Tue Jun 2 22:17:26 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (site.exp): Use the object testsuite directory as + the temporary directory. + + * expr.c (expand_expr, case ADDR_EXPR): Handle taking the + address of an ADDRESSOF rtx. + +1998-06-02 Mike Stump + + * expr.c (expand_builtin_setjmp): Handle BUILTIN_SETJMP_FRAME_VALUE. + * i960.h (SETUP_FRAME_ADDRESSES, BUILTIN_SETJMP_FRAME_VALUE): Define. + * i960.md (ret, flush_register_windows): Define. + (nonlocal_goto): Likewise. Nested function nonlocal gotos don't + work yet. + * tm.texi (BUILTIN_SETJMP_FRAME_VALUE): Document new macro. + +Tue Jun 2 14:02:38 1998 Richard Henderson + + * alpha.md (divsi3, udivsi3, modsi3, umodsi3): Enable, and work + around an OSF/1 library bug wrt sign-extension of inputs. + +Tue Jun 2 13:02:44 1998 Richard Henderson + + * vax/netbsd.h (DWARF2_UNWIND_INFO): Must be undef, not defined 0. + +Mon Jun 1 03:44:03 1998 Catherine Moore + + * config/sh/sh.h (MAX_OFILE_ALIGNMENT): Define. + + * varasm.c (assemble_variable): Augment alignment warning. + +Mon Jun 1 12:14:28 1998 Michael Meissner + + * config/fp-bit.c (_fp{add,div}_parts): Return correct IEEE result + in the presence of IEEE negative 0's. + +Sun May 31 16:11:41 1998 John Wehle (john@feith.com) + + * reload.c (find_reloads): Record the existing mode if + operand_mode == VOIDmode before replacing a register with + a constant. + * i386.md (tstsi, tsthi, tstqi, tstsf, tstdf, tstxf): Set + i386_compare_op1 to const0_rtx for the benefit of the + conditional move patterns. + (movsicc, movhicc, movsfcc, movdfcc, movxfcc, movdicc): Rewrite + based on suggestions from Jim Wilson. + +Sun May 31 00:44:02 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun May 31 00:34:17 1998 Bruce Korb + + * Makefile.in (fixinc.sh): Update rules again. + +Sun May 31 00:27:47 1998 Jeffrey A Law (law@cygnus.com) + + * extend.texi: Bring back reference to trampoline paper. + +Sun May 31 00:22:34 1998 Ulrich Drepper + + * Makefile.in (USER_H): Add stdbool.h. + * ginclude/stdbool.h: New file. + +Fri May 29 01:48:25 1998 Jeffrey A Law (law@cygnus.com) + + * jump.c (thread_jumps): Do not look at the NOTE_LINE_NUMBER + of a non-note insn. + + * gcse.c (pre_delete): Fix code to determine the mode of + the reaching pseudo register. + +Fri May 29 01:07:28 1998 Bernd Schmidt + + * Makefile.in (GEN): Add gencheck. + (STAGESTUFF): Add tree-check.h and gencheck. + +Fri May 29 00:57:37 1998 Bruce Korb + + * Makefile.in (cstamp-h.in): Remove before trying to recreate. + (fixinc.sh): Set some additional environment variables before + calling mkfixinc.sh. + +Thu May 28 12:57:05 1998 Jeffrey A Law (law@cygnus.com) + + * reload.c (find_reloads): Do not force a reloads of match_operators. + +Thu May 28 10:22:22 1998 Andrew MacLeod + + * except.h (remove_handler): Add new prototype. + * except.c (remove_handler): New function to remove handlers + from an exception region. + * flow.c (find_basic_blocks_1): Remove handlers from regions when + handler label is deleted; remove exception regions with no handlers. + +Thu May 28 09:36:39 1998 Michael Meissner + + * except.h (rtx): Define rtx type correctly if needed. + * function.h (rtx): Likewise. + (tree): Define tree type correctly if needed. + + * c-pragma.c (toplevel): Include rtl.h. + + * stor-layout.c (toplevel): Move include of rtl.h before + except.h. + + * Makefile.in (c-pragma.o): Add except.h, rtl.h dependencies. + (tree.o): Add except.h dependency. + +Wed May 27 22:02:40 1998 Jeffrey A Law (law@cygnus.com) + + * reload1.c: Revert accidental checkin. + + * configure.lang: Fix thinko when adding a definition for + target_alias to the Makefile. + +Wed May 27 02:50:00 1998 Catherine Moore (clm@cygnus.com) + + * config/sparc/lb1spc.asm (.rem and .urem): Replace + routines. + +Wed May 27 02:48:31 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_gen_constant): Rework to eliminate uninitialized + variable warnings. Don't generate scratch registers if only + counting insns. + (find_barrier): Eliminate unused variable SRC. + +1998-05-27 Manfred Hollstein + + * toplev.h (rtx_def): Provide global declaration to avoid + `limited scope' warnings. + +Tue May 26 23:47:52 1998 Mumit Khan + + * Makefile.in (gencheck.o): Use HOST_CC. + * i386/t-mingw32: New file. + * configure.in (i386-*-mingw32*): Use. + +Tue May 26 07:31:04 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (bad_signed_byte_operand): New predicate function. + * arm.h (PREDICATE_CODES): Add it to the list. + * arm.md (*extendqi[sh]i_insn): Split any addresses that ldrsb + can't handle. + (define_split): Two new splits for above insns. + + * arm.c: Include toplev.h. + (arm_override_options): Add parentheses around use of tune_flags. + (arm_split_constant): Remove unused variable. + (arm_gen_constant, arm_gen_movstrqi, add_constant): Likewise. + (output_func_prologue, arm_expand_prologue): Likewise. + (arm_canonicalize_comparison): Make I unsigned; rework constants + accordingly. Add missing parentheses around << operation. + (arm_rtx_costs): Correctly parenthesize MULT costs. Add a DEFAULT + clause. + ({load,store}_multiple_sequence): Initialize BASE_REG. + (select_dominance_cc_mode): Add DEFAULT clauses. + (broken_move): Return zero if the destination is not a register. + (arm_reorg): Move unused REGNO declaration into the dead code. + * arm.h (CANONICALIZE_COMPARISON): Ensure OP1 is updated. + +Mon May 25 22:49:56 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon May 25 11:56:24 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon May 25 14:00:13 1998 Dave Brolley + + * cpperror.c (v_cpp_message): Remove static prototype. + * cpplib.c (v_cpp_message): Move prototype to cpplib.h. + * cpplib.h (v_cpp_message): Add protoptype. + (stdarg.h,varargs.h): Needed for v_cpp_message prototype. + +Sun May 24 20:36:15 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun May 24 02:08:57 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +1998-05-24 Andreas Schwab + + * m68k.h: Declare more functions used in macros. + (REG_CLASS_CONTENTS): Completely embrace initializer. + * m68k.md (adddi3, subdi3): Add abort call to avoid warning + about returning no value. + * cse.c (find_best_addr): Declare p and found_better only if + needed. + * dbxout.c (dbxout_continue): Define only if DBX_CONTIN_LENGTH > 0. + * dwarfout.c (string_length_attribute): #if 0 away. + * function.c (expand_function_end): Define varible blktramp only + if needed. + * jump.c (find_insert_position): Define only if !HAVE_cc0. + * loop.c (combine_givs_p): Define variable tem only if needed. + * real.c: Comment out unused functions eabs, eround, + e{24,53,64,113}toasc and eiinfin. + +Sat May 23 23:44:53 1998 Alexandre Oliva + + * Makefile.in (boostrap2-lean, bootstrap3-lean, + bootstrap4-lean): New targets. + +Sat May 23 23:35:14 1998 Jeffrey A Law (law@cygnus.com) + + * warn_summary, test_summary: Moved into the contrib directory. + +1998-05-23 Manfred Hollstein + + * Makefile.in (ENQUIRE_CFLAGS, ENQUIRE_LDFLAGS): Move down to the end + of the Makefile. + (FLOAT_H_TEST): Likewise. + (ENQUIRE): Likewise. + (float.h-nat): Likewise. + (float.h-cross): Likewise. + (enquire): Likewise. + (enquire.o): Likewise. + (stmp-int-hdrs): Fix comment about enquire; depend upon gfloat.h. + (stmp-headers): Move actions to stmp-int-hdrs, retaining only a + no-op. + (FLOAT_H): Remove old float.h-nat version; move current definition + to CROSS_FLOAT_H location. + (all.cross): Remove comments about enquire stuff. + + * Makefile.in (all.cross): Swap $(LIBGCC) and $(STMP_FIXPROTO). + (rest.encap): Likewise. + (libgcc2.ready): Depend upon $(STMP_FIXPROTO) + + * toplev.h (tree_node): Provide global declaration to avoid + `limited scope' warnings. + +Sat May 23 23:23:35 1998 Robert Lipe + + * test_summary: Display section breaks for each entry + in a multilibbed target's output. + +1998-05-23 Richard Henderson + + * expr.c (expand_expr): For {BITFIELD,COMPONENT,ARRAY}_REF, if the + offset's mode is not ptr_mode, convert it. + +1998-05-22 Jason Merrill + + * fold-const.c (ssize_binop): New fn. + * tree.h: Declare it. + +Fri May 22 03:42:05 1998 Richard Earnshaw (rearnsha@arm.com) + + * genextract.c (print_path): Handle zero-length path as a special + case. + +Fri May 22 01:38:07 1998 Hans-Peter Nilsson + + * cplus-dem.c (MBUF_SIZE): Bumped from 512 to 32767. + +Fri May 22 00:57:00 1998 Bernd Schmidt (crux@pool.informatik.rwth-aachen.de> + + * final.c (JUMP_TABLES_IN_TEXT_SECTION): Provide a default value. + (shorten_branches, final_scan_insn): Test value of + JUMP_TABLES_IN_TEXT_SECTION instead of just testing whether it + is defined. + * tm.texi (JUMP_TABLES_IN_TEXT_SECTION): Corresponding changes. + * arm/coff.h: Define JUMP_TABLES_IN_TEXT_SECTION to 1. + * arm/tcoff.h: Likewise. + * i386/386bsd.h: Likewise. + * i386/freebsd-elf.h: Likewise. + * i386/freebsd.h: Likewise. + * i386/netbsd.h: Likewise. + * i386/ptx4-i.h: Likewise. + * i386/sysv4.h: Likewise. + * pa/pa.h: Likewise. + * rs6000/linux.h: Likewise. + * rs6000/rs6000.h: Likewise. + * sh/sh.h: Likewise. + * sparc/sp64-elf.h: Likewise. + * v850/v850.h: Likewise. + * rs6000/sysv4.h: Define JUMP_TABLES_IN_TEXT_SECTION to 0. + * i386/linux.h: Define JUMP_TABLES_IN_TEXT_SECTION to (flag_pic). + +Thu May 21 19:50:13 1998 J"orn Rennecke + + * regmove.c (gen_add3_insn): New function. + (fixup_match_2): Use it instead of calling gen_addsi3. + +Thu May 21 23:09:50 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (gencheck): Depend on HOST_LIBDEPS. + + * alias.c (rtx_equal_for_memref_p): Handle SCRATCH as a memory + address. + +Thu May 21 20:18:13 1998 Martin von Loewis + + * Makefile.in (TREE_H): Add tree-check.h. + (tree-check.h, gencheck): New targets. + * gencheck.c: New file. + * tree.c (tree_check, tree_class_check): New functions. + * tree.h (TREE_CHECK, TREE_CLASS_CHECK): Define. + (TYPE_CHECK, DECL_CHECK): Define. + Modify all access macros to use generated checking macros. + +Wed May 20 23:44:28 1998 John Wehle (john@feith.com) + + * acconfig.h (HAVE_GAS_MAX_SKIP_P2ALIGN): New tag. + * configure.in: Check for it. + * i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Use it. + * final.c (uid_align, uid_shuid, label_align): Make static. + (label_align): Change type to struct label_alignment pointer. + (LABEL_TO_ALIGNMENT, shorten_branches): Update due to type change. + (LABEL_TO_MAX_SKIP): Define. + (LABEL_ALIGN_MAX_SKIP, LOOP_ALIGN_MAX_SKIP, + LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Provide defaults. + (shorten_branches): Record the maximum bytes to skip when + aligning a label. + (final_scan_insn): Use the maximum bytes to skip when aligning a label + if ASM_OUTPUT_MAX_SKIP_ALIGN is available. + * i386.h (LOOP_ALIGN_MAX_SKIP, + LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Define. + * i386.c (override_options): i386_align_jumps and i386_align_loops + default to 4 if ASM_OUTPUT_MAX_SKIP_ALIGN is available. + * invoke.texi: Document new i386 align-loops and align-jumps behavior. + +1998-05-21 Mark Mitchell + + * cplus-dem.c (do_type): Handle volatile qualification. + +Thu May 21 12:23:17 1998 Per Bothner + + * function.c (init_function_start): Don't call emit_line_note if + lineno is 0. (Can happen when compiling Java .class files.) + +Thu May 21 19:50:13 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT + end of lifetime and RELOAD_FOR_OUTPUT start of lifetime. + +Thu May 21 19:32:27 1998 J"orn Rennecke + + * combine.c (nonzero_bits): For paradoxical subregs, take + LOAD_EXTENDED_OP into account. + +Thu May 21 11:51:15 1998 Dave Brolley + + * configure.in (extra_c_objs): Add prefix.o. + (extra_cxx_objs): Extra objects for C++ with cpplib. + * configure: Regenerate. + + * c-tree.h (get_directive_line): Different prototype for cpplib. + (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line. + + * c-lex.h (get_directive_line): Not needed here for cpplib. + + * c-lex.c (yy_cur,yy_lim,yy_get_token): Move to c-common.c. + (GET_DIRECTIVE_LINE): Move to c-common.c and rename to get_directive_line. + + * c-common.c (parse_in,parse_options,cpp_token): Declare for cpplib. + (yy_cur,yy_lim,yy_get_token,get_directive,line): Moved here from c-lex.c + +Thu May 21 09:04:42 1998 Kaveh R. Ghazi + + * gengenrtl.c (type_from_format, accessor_from_format): Change + type of parameter `c' from `char' to `int'. + +Wed May 20 22:28:34 1998 Jeffrey A Law (law@cygnus.com) + + * warn_summary, test_summary: New scripts from + Kaveh Ghazi and Alexandre Oliva respectively. + + * gcse.c (current_function_calls_longjmp): Declare. + +1998-05-20 Jason Merrill + + * dwarf2out.c (base_type_die): Use int_size_in_bytes. + +Wed May 20 01:11:02 1998 Doug Evans (devans@cygnus.com) + Jeff Law (law@cygnus.com) + + * Global CSE and constant/copy propagation. + * Makefile.in (OBJS): Add gcse.o. + (STAGESTUFF): Add *.gcse. + (gcse.o): Add dependencies. + (mostlyclean): Remove *.gcse and */*.gcse. + * gcse.c: New file. + * loop.c (loop_optimize): Move call to init_alias_analysis. + * recog.c (validate_replace_src): New function. + * toplev.c (gcse_dump): New global variable. + (flag_gcse, gcse_time): Likewise. + (compile_file): Initialize gcse_time and clean out the gcse dump + file if necessary. + (rest_of_compilation): Call gcse_main as requested. Dump RTL + after gcse if requested. + (main): Enable gcse for -O2 and above. Handle -dG. Enable gcse + dumps for -da. + * gcc.texi: Add gcse related internal documentation. + * invoke.texi: Note new command line options for gcse. + * tm.texi: Document AVOID_CCMODE_COPIES. + * mips.h (AVOID_CCMODE_COPIES): Define. + +Tue May 19 22:31:20 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (deduced.h): Only run scan-types if $(SYSTEM_HEADER_DIR) + exists. + (stmp-fixproto): Simlarly for running fixproto. + * cross-make (SYSTEM_HEADER_DIR): Now $(tooldir)/sys-include. + +Tue May 19 19:08:52 1998 Jim Wilson + + * config/mips/mips.c (double_memory_operand): Accept any MEM during + reload when TARGET_64BIT. + +Tue May 19 18:21:25 1998 Jim Wilson + + Finish incomplete change started by Kenner. + * configure.in (*-*-linux-gnu*): Delete NO_STAB_H from xm_defines. + (powerpcle-*-cygwin32): Delete xm_defines. + * final.c, mips-tfile.c, xcoffout.c, config/mips/mips.c: Use + HAVE_STAB_H instead of NO_STAB_H. + * config/xm-linux.h (NO_STAB_H): Delete. + (HAVE_STAB_H): Undefine. + * config/i386/xm-go32.h (NO_STAB_H): Delete. + +1998-05-19 Jim Wilson + + * dwarfout.c (dwarfout_file_scope_decl, case TYPE_DECL): Ignore + LANG_TYPE trees with DECL_SOURCE_LINE of 0. + +Tue May 19 15:07:54 1998 Todd Vierling + + * arm/netbsd.h: Ensure DWARF2_UNWIND_INFO is undefined. + +Tue May 19 17:19:16 1998 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): New function. + (allocate_reload_reg, choose_reload_regs): Use it. + +Tue May 19 11:51:00 1998 Andrew MacLeod (amacleod@cygnus.com) + + * except.c (expand_start_catch): Correct logic for when to + generate a new handler label, and when to use the old one. + +Tue May 19 11:08:52 1998 Kaveh R. Ghazi + + * Makefile.in (print-rtl.o): Depend on bitmap.h. + (dbxout.o): Depend on toplev.h. + ($(SCHED_PREFIX)sched.o): Likewise. + ($(out_object_file)): Likewise for system.h and toplev.h. + (cppmain.o): Depend on gansidecl.h. + (cpplib.o): Likewise. + (cpperror.o): Likewise. + (cppexp.o): Likewise. + (cpphash.o): Likewise. + (cppalloc.o): Likewise. + (fix-header.o): Depend on cpplib.h and cpphash.h. + (scan-decls.o): Depend on gansidecl.h. + + * basic-block.h (free_regset_vector): Add prototype. + + * cccp.c (check_precompiled): Mark parameter `fname' with + ATTRIBUTE_UNUSED. + (do_assert): Likewise for `op' and `keyword'. + (do_unassert): Likewise. + (do_line): Likewise for `keyword'. + (do_error): Likewise for `op' and `keyword'. + (do_warning): Likewise. + (do_ident): Likewise for `keyword'. + (do_pragma): Likewise for `limit', `op' and `keyword'. + (do_sccs): Likewise. + (do_if): Likewise for `keyword'. + (do_elif): Likewise. + (do_else): Likewise. + (do_endif): Likewise. + + * collect2.c (getenv): Remove redundant prototype. + (collect_exit, collect_execute, dump_file): Likewise. + (dump_list): Wrap prototype and definition in COLLECT_EXPORT_LIST. + (dump_prefix_list): Hide prototype and definition. + + * sparc.c: Include toplev.h. + (intreg_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. + (symbolic_memory_operand): Likewise. + (sp64_medium_pic_operand): Likewise. + (data_segment_operand): Likewise. + (text_segment_operand): Likewise. + (splittable_symbolic_memory_operand): Likewise. + (splittable_immediate_memory_operand): Likewise. + (eq_or_neq): Likewise. + (normal_comp_operator): Likewise. + (noov_compare_op): Likewise. + (v9_regcmp_op): Likewise. + (v8plus_regcmp_op): Likewise. + (extend_op): Likewise. + (cc_arithop): Likewise. + (cc_arithopn): Likewise. + (small_int): Likewise. + (uns_small_int): Likewise. + (clobbered_register): Likewise. + (legitimize_pic_address): Likewise. + (delay_operand): Likewise. + (sparc_builtin_saveregs): Remove unused variable `stdarg'. + + * sparc.h (order_regs_for_local_alloc, eligible_for_return_delay, + sparc_issue_rate, v8plus_regcmp_p): Add prototypes. + + * sparc.md (cmpdi_v8plus): Add abort for default case in switch. + + * cppalloc.c: Include gansidecl.h. + + * cpperror.c: Include stdarg.h/varargs.h and gansidecl.h. + (cpp_file_line_for_message): Mark parameter `pfile' with + ATTRIBUTE_UNUSED. + (v_cpp_message): New function. + (cpp_message): Use it. Also convert to variable arguments. + (cpp_fatal): Likewise. + (cpp_pfatal_with_name): Constify parameter `name'. + + * cppexp.c: Move gansidecl.h before cpplib.h. + * cpphash.c: Likewise. + * cpphash.h (hashf, delete_macro): Add prototypes. + + * cpplib.c: Include stdarg.h/varargs.h and move gansidecl.h before + cpplib.h. Don't include errno.h. + (update_path): Add arguments to prototype. + (cpp_fatal, cpp_file_line_for_message, cpp_message, delete_macro, + cpp_print_containing_files): Remove redundant prototypes. + (cpp_hash_cleanup, add_import, append_include_chain, + make_assertion, path_include, initialize_builtins, + initialize_char_syntax, finclude, validate_else, comp_def_part, + lookup_import, redundant_include_p, is_system_include, + read_name_map, read_filename_string, open_include_file, + check_macro_name, compare_defs, compare_token_lists, + eval_if_expression, change_newlines): Add prototype arguments. + (hashf): Remove redundant prototype. + (read_token_list, free_token_list, safe_read, xcalloc, savestring, + conditional_skip, skip_if_group): Add prototype arguments. + (fdopen): Remove redundant prototype. + (do_define, do_line, do_include, do_undef, do_error, do_pragma, + do_ident, do_if, do_xifdef, do_else, do_elif, do_endif, do_sccs, + do_once, do_assert, do_unassert, do_warning): Add prototype arguments. + (struct directive): Add prototype arguments to function pointer + member `func'. + (handle_directive): Add missing arguments to call to `do_line'. + (do_include): Mark parameters `unused1' and `unused2' with + ATTRIBUTE_UNUSED. + (do_line): Likewise for `keyword' and new parameters `unused1' and + `unused2'. + (do_error): Likewise for `keyword'. + (do_warning): Likewise. Also add missing argument `pfile' in call + to cpp_pedwarn. + (do_once): Mark parameter `keyword', `unused1' and `unused2' with + ATTRIBUTE_UNUSED. + (do_ident): Likewise for `keyword', `buf' and `limit'. + (do_pragma): Likewise. Also add missing arguments in call to do_once. + (do_sccs): Mark parameter `keyword', `buf' and `limit' with + ATTRIBUTE_UNUSED. + (do_if): Likewise for `keyword'. + (do_elif): Likewise. + (eval_if_expression): Likewise for `buf' and `length'. + (do_xifdef): Likewise for `unused1' and `unused2'. + (do_else): Likewise for `keyword', `buf' and `limit'. + (do_endif): Likewise. + (parse_name): Add missing argument `pfile' in call to cpp_pedwarn. + (cpp_handle_options): Remove superfluous NULL argument in call to + cpp_fatal. + (cpp_handle_options): Likewise. + (do_assert): Mark parameter `keyword', `buf' and `limit' with + ATTRIBUTE_UNUSED. + (do_unassert): Likewise. + (cpp_print_file_and_line): Add missing argument `pfile' in call to + cpp_file_line_for_message. + (v_cpp_error): New function. + (cpp_error): Use it. Also accept variable arguments. + (v_cpp_warning): New function. + (cpp_warning): Use it. Also accept variable arguments. + (cpp_pedwarn): Accept variable arguments. + (v_cpp_error_with_line): New function. + (cpp_error_with_line): Use it. Accept variable arguments. + (v_cpp_warning_with_line): New function. + (cpp_warning_with_line): Use it. Accept variable arguments. Hide + definition. + (cpp_pedwarn_with_line): Accept variable arguments. + (cpp_pedwarn_with_file_and_line): Likewise. + (cpp_error_from_errno): Constify parameter `name'. Add missing + argument `pfile' in call to cpp_file_line_for_message. + (cpp_perror_with_name): Constify parameter `name'. + + * cpplib.h: Define PARAMS() in terms of PROTO(). + (fatal): Remove redundant prototype. + (cpp_error, cpp_warning, cpp_pedwarn, cpp_error_with_line, + cpp_pedwarn_with_line, cpp_pedwarn_with_file_and_line, + cpp_error_from_errno, cpp_perror_with_name, cpp_pfatal_with_name, + cpp_fatal, cpp_message, cpp_pfatal_with_name, + cpp_file_line_for_message, cpp_print_containing_files): Add + arguments to prototypes. + (scan_decls, cpp_finish): Add prototypes. + + * cppmain.c: Include gansidecl.h. + (main): Remove unused variable `i'. + + * dbxout.c: Include toplev.h. + + * demangle.h (do_tlink, collect_execute, collect_exit, + collect_wait, dump_file, file_exists): Add prototype. + + * dwarf2out.c (dwarf_type_encoding_name, decl_start_label): Hide + prototype and definition. + (gen_unspecified_parameters_die): Don't assign results of call to + function new_die() to unused variable `parm_die'. + (dwarf2out_line): Mark parameter `filename' with ATTRIBUTE_UNUSED. + (dwarf2out_define): Likewise for `lineno' and `buffer'. + + * dwarfout.c (output_unsigned_leb128, output_signed_leb128): Hide + prototype and definition. + (output_die): Add prototype arguments to function pointer arg. + (output_unspecified_parameters_die): Mark parameter `arg' with + ATTRIBUTE_UNUSED. + + * except.c (output_exception_table_entry): Remove unused variable + `eh_entry'. + + * except.h (expand_fixup_region_start, expand_fixup_region_end): + Add prototypes. + + * expr.c (do_jump_by_parts_equality_rtx): Remove prototype. + + * expr.h (do_jump_by_parts_equality_rtx): Add prototype. + + * fix-header.c: Include stdarg.h/varargs.h, move gansidecl.h + before cpplib.h, include cpphash.h, remove redundant prototype of + cpp_fatal, don't define `const', add a prototype for `fatal'. + (cpp_file_line_for_message): Add missing arguments `pfile'. + (v_cpp_message): New function. + (cpp_message): Use it. + (v_fatal): New function. + (fatal, cpp_fatal): Use it. + (cpp_pfatal_with_name): Constify parameter `name'. + + * flow.c (free_regset_vector): Remove redundant prototype. + + * function.c (round_down): Wrap prototype and definition with + macro ARGS_GROW_DOWNWARD. + (record_insns): Wrap prototype and definition with + defined (HAVE_prologue) || defined (HAVE_epilogue). + + * gansidecl.h (ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5): New macros. + + * gen-protos.c: Include gansidecl.h. + (hashf): Don't make it static, constify parameter `name'. + + * genattrtab.c (check_attr_test): Change XEXP() to XSTR() to match + specifier %s in calls to function `fatal'. + + * haifa-sched.c: Include toplev.h. + (find_rgns): Remove unused variable `j'. + + * integrate.c (note_modified_parmregs): Mark parameter `x' with + ATTRIBUTE_UNUSED. + (mark_stores): Likewise. + + * jump.c (mark_modified_reg): Likewise. + + * output.h (insn_current_reference_address): Add prototype. + (eh_frame_section): Likewise. + + * print-rtl.c: Include bitmap.h. + + * reload1.c (reload): Wrap variables `note' and `next' in macro + PRESERVE_DEATH_INFO_REGNO_P. + (forget_old_reloads_1): Mark parameter `ignored' with + ATTRIBUTE_UNUSED. + (choose_reload_regs): Remove unused variable `in'. + (reload_cse_invalidate_mem): Mark parameter `ignore' with + ATTRIBUTE_UNUSED. + (reload_cse_check_clobber): Likewise. + + * rtl.h (expand_null_return, reg_classes_intersect_p): Add prototype. + (mark_elimination): Fix typo in prototype. + + * scan-decls.c: Include gansidecl.h. + + * tree.h (using_eh_for_cleanups, supports_one_only): Add prototype. + +Mon May 18 22:37:33 1998 Jeffrey A Law (law@cygnus.com) + + * function.c (identify_blocks): Fix thinko when setting the + block number for NOTE_INSN_BLOCK_END. + +Mon May 18 15:30:42 1998 Nick Clifton + + * config/v850/lib1funcs.asm: Add .text pseudo op to start of + ___udivsi3. + + * config/v850/lib1funcs.asm: Fix .size pseudo ops to use three + underscores for the prefixes to the names of the maths functions. + + * dbxout.c (dbxout_parms): Revert to using DECL_ARG_TYPE. Add + comment explaining why. + +Mon May 18 13:20:23 1998 Richard Henderson + + * tree.h (TYPE_SIZE_UNIT): New. + (struct tree_type): Add size_unit member. + * stor-layout.c (layout_type): Initialize it. + * expr.c (get_inner_reference) [ARRAY_REF]: Use it. + * tree.c (size_in_bytes, int_size_in_bytes): Likewise. + +Mon May 18 12:07:37 1998 Richard Earnshaw (rearnsha@arm.com) + + * stor-layout.c (layout_record): Fix off-by-one error when checking + length of the TYPE_BINFO vector. + +Mon May 18 10:59:23 1998 Nick Clifton + + * dbxout.c (dbxout_parms): Use TREE_ARG to compute the type of a + function parameter passed in memory. + +Mon May 18 09:02:09 1998 Robert Lipe + + * dwarfout.h, dwarf2out.h, dbxout.h, sdbout.h: New files. + Prototypes for externally used functions in respective C files. + * dwarfout.c, dbxout.c, dwarf2out.c, sdbout.c, toplev,c, + final.c: Include above files. + * Makefile.in (toplev.o): Add dependency for above four headers. + (final.o): Likewise. + (dwarfout.o, dbxout.o, dwarf2out.o, sdbout.o): Depend on four + respective header files. + +Mon May 18 01:23:33 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (TARGET_TOOLPREFIX): No longer define. + (AR_FOR_TARGET, RANLIB_FOR_TARGET): Define to use versions in + the build tree if they exist. + (AR, AR_FLAGS, OLDAR, OLDAR_FLAGS, RANLIB, RANLIB_TEST): Update + appropriately. + (objdir): Let configure substitute value. + (FLOAT_H): Let configure select a pre-built version from the + config subdir. + * build-make (INSTALL_TARGET, ALL): Disable, no longer needed. + * configure.in: Substitute for objdir. + + * Makefile.in (build_canonical, host_canonical): Let configure + substitute values for these variables. + * configure.in: Substitute for build_canonical, host_canonical + and target_subdir in generated Makefile. + + * output.h (find_basic_blocks): Declare. + (free_basic_block_vars, set_block_num, life_analysis): Likewise. + + * Makefile.in (BISON): Use bison from the build tree if it exists. + (FLEX): Similarly. + +Mon May 18 00:08:19 1998 Nick Clifton + + * gcc.c (SWITCH_CURTAILS_COMPILATION): Definition. + (DEFAULT_SWITCH_CURTAILS_COMPILATION): True for options -S and -c. + (process_command): If HAVE_EXECUTABLE_SUFFIX is defined then scan + command line arguments to see if an executable is not being + created, and if so - do not append the suffix. + + * tm.texi (SWITCH_CURTAILS_COMPILATION): Add description of new + driver macro. + +Sun May 17 23:59:45 1998 John Wehle (john@feith.com) + + * i386.h (ALIGN_DFmode): Delete. + (CONSTANT_ALIGNMENT): Define. + * varasm.c (force_const_mem): Use it. + +Sun May 17 19:31:05 1998 Richard Henderson + + * alpha.c (alpha_emit_conditional_branch): Clear cmp_code after + using it with swap_condition, not before. + +Sun May 17 13:44:32 1998 Jim Wilson + + * alias.c (mode_alias_check): Delete. + (true_dependence, anti_dependence, output_dependence): Revert April 21 + change. + +Sun May 17 08:45:21 1998 Krister Walfridsson + + * toplev.c (output_lang_identify): Enable prototype and definition. + +Sun May 17 01:12:27 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat May 16 23:20:32 1998 Richard Henderson + + * alpha/osf.h (HAVE_STAMP_H): Define. + * alpha.c: Use it. + * alpha/netbsd.h, alpha/netbsd-elf.h: New files. + * configure.in (alpha*-*-netbsd*): New. + Based on patches from Paul H. Anderson . + + * configure.in (alpha*-*-linux-*): Kill xm_defines. + (alpha*-*-linux-gnulibc1*) [fixincludes]: Define. + * alpha/xm-linux.h: Remove file. + +Sat May 16 18:32:45 1998 Doug Evans + + * dbxout.c (dbxout_parms): If mode of type of parameter living + in memory doesn't match mode of DECL_RTL, make big endian correction. + +Fri May 15 21:40:06 1998 John Wehle (john@feith.com) + + * i386.md (movdi-1, movdi): Rewrite based on SI move patterns. + +Fri May 15 18:55:22 1998 Jason Merrill + + * tree.h (BINFO_SIZE, TYPE_BINFO_SIZE): New macros. + * stor-layout.c (layout_record): Set it. + +Fri May 15 18:49:30 1998 Mark Mitchell + + * toplev.c (rest_of_compilation): Don't defer nested functions. + +Fri May 15 17:42:52 1998 Bob Manson + + * config/rs6000/rs6000.c (rs6000_stack_info): Align the stack bottom + to an 8-byte boundary if info_ptr->fpmem_p. + +Fri May 15 17:36:11 1998 Bill Moyer + + * loop.c (basic_induction_var): Added test preventing + CCmode parameter passed to convert_modes(). + +Fri May 15 17:26:18 1998 Alexandre Petit-Bianco + + * expr.c (expand_expr, case EXPR_WITH_FILE_LOCATION): Save/restore + input_filename and lineno around expand_expr call. Set them to values + in WFL before expand_expr call. + +Fri May 15 12:44:57 1998 Benjamin Kosnik + + * stor-layout.c (set_sizetype): Set TYPE_NAME on bitsizetype. + +Fri May 15 07:20:03 1998 Mark Mitchell + + * fold-const.c (constant_boolean_node): New function. + (fold): Use it. + +Fri May 15 11:21:16 1998 J"orn Rennecke + + * sh.c (gen_shl_and): Don't sign extend constant for kind two. + Abort if trying to split kind 3 or 4 outside of combine. + +Fri May 15 01:47:37 1998 Jeffrey A Law (law@cygnus.com) + + * mips.c (print_operand, case 'x'): Use HOST_WIDE_INT_PRINT_HEX. + +Fri May 15 01:42:45 1998 Mumit Khan + + * objc/Make-lang.in (OBJC_O): Add missing exeext. + (libobjc.a, runtime-info.h): Likewise. + +Fri May 15 01:29:39 1998 John Wehle (john@feith.com) + + * i386.h (DATA_ALIGNMENT): Define. + +Fri May 15 05:35:37 1998 J"orn Rennecke + + * reload1.c (delete_output_reload): Ignore single USE that + was emitted for the pseudo use of this INSN. + If the no reference to REG between OUTPUT_RELOAD_INSN and INSN + remains, we can always delete OUTPUT_RELOAD_INSN. + +Thu May 14 18:38:50 1998 Jim Wilson + + * reload.c (find_reloads): Don't penalize SCRATCH output reload. + +Thu May 14 15:10:30 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (expr.o): Remove dependency on deleted modemap.def file. + +Thu May 14 16:30:47 1998 Andrew MacLeod + + * eh-common.h: New file for basic EH data structures. + * except.h: Various prototypes and structures for NEW_EH_MODEL. + * function.h (struct function): Add a struct eh_stack for the catch + clause stack. + * except.c (gen_exception_label): New function to generate an + exception label. + (push_eh_entry): Use gen_exception_label() and init 'label_used' field. + (push_entry): New function to push an existing entry onto a stack. + (receive_exception_label): New function to emit the code required + at the start of all catch blocks. + (struct func_eh_entry): New structure for maintaining handlers + associated with EH regions. + (new_eh_region_entry): New function to register an EH region. + (add_new_handler): New function to register a handler with a region. + (get_new_handler): Creates anew handler entry for registering. + (find_func_region): New function to convert a NOTE eh region number + to an Eh region index. + (get_first_handler): New function to get the first handler in a region. + (clear_function_eh_region): New function to release memory. + (duplicate_handlers): New function to duplicate a list of handlers. + (expand_eh_region_end): Create a new region entry node as well. + (expand_leftover_cleanups): Call receive_exception_label() and + register the cleanup as a handler to the current region. + (expand_start_catch): New function to start a catch clause. + (expand_end_catch): New function to end a catch clause. + (expand_start_all_catch): Restructure to not do the equivalent of + what expand_start_catch() does now. Push the exception region being + handled onto the catch stack. + (output_exception_table_entry): Issue an entry for each handler + associated with a region. + (set_exception_lang_code): New function for setting the language code. + (set_exception_version_code): New function to set the version number. + (output_exception_table): Output version and language codes. + (find_exception_handler_labels): Find handler labels using new scheme. + (is_exception_handler_label): New function, returns 1 if label is + present as a handler in some exception region. + (check_exception_handler_labels): Use the new scheme. + (init_eh_for_function): Initialize the catch stack. + (save_eh_status): Save the catch stack. + (restore_eh_status): Restore the catch stack. + (scan_region): Don't remove unreferenced handler label. Flow does it. + (get_reg_for_handler): New function to get the eh_context pointer + passed by __throw. + (expand_builtin_eh_stub): Changes required for NEW_EH_MODEL only. + * final.c (final_scan_insn): With NEW_EH_MODEL, add EH table + entry when processing END region rather that START region. + * flow.c (find_basic_blocks_1): Find all potential handler regions + now that we don't automatically know what the labels might be. + Let scan_region() remove unreferenced EH BEGIN/END labels. + * integrate.c (get_label_from_map): Put inlined labels onto the + permanent obstack since we don't know which ones might be exception + labels. + (save_for_inline_copying): Make new copies of all the handlers. + (expand_inline_function): Make new copies of all the handlers. + * libgcc2.c: Remove local struct decls, and include eh-common.h. + (find_exception_handler): With NEW_EH_MODEL the first matching + region we find is the right one. Add eh_info as a new parameter. + (__throw): Pass eh_info to find_exception_handler. Set handler + and pass use different regs under NEW_EH_MODEL. + +Thu May 14 12:58:21 1998 Jim Wilson + + * i960.h (hard_regno_mode_ok): Changed to function from array of + unsigned. + (HARD_REGNO_MODE_OK): Call function instead of testing bit. + * i960.c (hard_regno_mode_ok): Changed to function from array of + unsigned. + +Thu May 14 08:41:46 1998 J"orn Rennecke + + * reload.c (remove_replacements): New function. + * reload.h (remove_replacements): Declare. + * reload1.c (choose_reload_regs): Disable some reloads that + belong to inherited reloads. + +Thu May 14 02:17:17 1998 J"orn Rennecke + + * loop.c (scan_loop): Don't call move_movables for optimize_size. + + * reload1.c (merge_assigned_reloads): When merging, reset + reload_spill_index for the eliminated reload. + +Wed May 13 17:51:13 1998 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (schedule_insns): Fix merge goof. + +1998-05-13 Jim Wilson + + * varasm.c (make_decl_rtl): Revert April 1 change. + * alpha/alpha.h, alpha/win-nt.h, arm/arm.h, i386/unix.h, i960/i960.h, + m68k/linux.h, pa/pa.h, sparc/sparc.h, vax/vax.h (ASM_OUTPUT_MI_THUNK): + Get function name from the SYMBOL_REF in the DECL_RTL, not from + DECL_ASSEMBLER_NAME. + * i386/winnt.c (gen_stdcall_suffix): Comment for questionable use of + DECL_ASSEMBLER_NAME. + +Wed May 13 13:09:19 1998 Jim Wilson + + * i386.c (notice_update_cc, output_float_compare): Disable + TARGET_CMOVE support. + +Wed May 13 15:28:59 1998 Michael Meissner + Jeff Law + + * rtlanal.c (find_reg_note): Ignore notes that are not on on + insns of class 'i'. + (find_regno_note): Likewise. + + * Makefile.in (stor-layout.o): Depend on except.h. + (varasm.o, function.o): Likewise. + (expr.o): Depend on except.h, modemap.def and hard-reg-set.h. + + * Makefile.in (HOST_RTL): Add $(HOST_PREFIX)bitmap.o. + (rtl.o, emit-rtl.o): Add dependency on bitmap.h. + ($(HOST_PREFIX_1)rtl.o): Likewise. + ($(HOST_PREFIX_1)bitmap.o): New host object. + * emit-rtl.c (toplevel): Include bitmap.h. + (gen_rtx): Handle 't' and 'b' nodes. + * print-rtl.c (print_rtx): Handle printing NOTE_INSN_LIVE notes. + Print block number for block begin/end notes. Print 't' type + nodes as a pointer. Know that the 3rd argument of live range + start/stop notes is really a range_info rtx. If type is 'b', print + out argument as a bitmap. + * rtl.c: Include bitmap.c. + (copy_rtx): Copy tree nodes as is. Copy bitmaps if type is 'b'. + (note_insn_name): Add NOTE_INSN_RANGE_{START,END}, NOTE_INSN_LIVE. + * rtl.def (RANGE_LIVE): New node to hold live information while we + recalculate the basic blocks. + (RANGE_REG, RANGE_INFO): New rtl types for live range splitting. + (RANGE_VAR): New node, to hold information saved in symbol node for New + communicating live range information to the debug output functions. + * rtl.h (rtunion_def): Add rttree and rtbit fields. + (XBITMAP, XTREE): New accessor macros. + (NOTE_LIVE_INFO): Overload NOTE_SOURCE_FILE for NOTE_INSN_LIVE notes. + (NOTE_RANGE_INFO): Similarly for NOTE_INSN_RANGE_{START,END} notes. + (NOTE_BLOCK_LIVE_RANGE_BLOCK): Define. + (NOTE_INSN_RANGE_START, NOTE_INSN_RANGE_END, NOTE_INSN_LIVE): New notes. + (RANGE_LIVE_{BITMAP,ORIG_BLOCK}): New accessor macros. + (RANGE_REG_{SYMBOL,BLOCK}_NODE, RANGE_VAR_*): New accessor macros. + (RANGE_INFO_*): Likewise. + * sched.c (sched_analyze): Keep live range start/stop notes. + (unlink_other_notes): Likewise. + * haifa-sched.c (sched_analyze): Keep live range start/stop notes. + (unlink_other_notes): Likewise. + * tree.h (BLOCK_LIVE_RANGE_{START,END,VAR_FLAG}): New accessor macros. + (BLOCK_LIVE_RANGE_FLAG): Likewise. + (DECL_LIVE_RANGE_RTL): Likewise. + (struct tree_block): Add live_range_flag, live_range_var_flag, + live_range_start and live_range_end. + (struct tree_decl): Add live_range_rtl field. + * gengenrtl.c (type_from_format): Handle 'b' and 't'. + (accessor_from_format): Likewise. + + * haifa-sched.c (schedule_block): Make verbose output line up. + Also add a blank line in printing the individual ready lists. + +Wed May 13 15:43:44 1998 Kaveh R. Ghazi + + * Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h. + (c-lex.o): Depend on output.h. + (c-common.o): Likewise. + (stmt.o): Likewise. + (calls.o): Likewise. + (integrate.o): Depend on toplev.h. + (regclass.o): Depend on output.h. + (final.o): Depend on reload.h. + + * c-common.c: Include output.h. + (check_format_info): Remove unused variable `integral_format'. + + * c-decl.c (print_lang_decl): Mark parameters `file', `node' and + `indent' with ATTRIBUTE_UNUSED. + (print_lang_type): Likewise. + (maybe_build_cleanup): Likewise for parameter `decl'. + (copy_lang_decl): Likewise for parameter `node'. + + * c-lang.c: Include c-tree.h, c-lex.h and toplev.h. + (lang_print_xnode): Mark parameters `file', `node' and `indent' + with ATTRIBUTE_UNUSED. + (lookup_interface): Likewise for parameter `arg'. + (is_class_name): Likewise. + (maybe_objc_check_decl): Likewise for parameter `decl'. + (maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and + `reflexive'. + (maybe_objc_method_name): Likewise for parameter `decl'. + (build_objc_string): Likewise for parameters `len' and `str'. + + * c-lex.c: Include output.h. + + * c-lex.h (position_after_white_space): Correct typo in prototype. + + * c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else, + c_expand_end_cond, init_iterators): Add prototypes. + + * caller-save.c (set_reg_live): Mark parameters `reg' and `setter' + with ATTRIBUTE_UNUSED. + + * calls.c: Include output.h. + + * cccp.c (pipe_closed): Mark parameter `signo' with + ATTRIBUTE_UNUSED. + + * combine.c: Move inclusion of expr.h to after insn-config.h. + + * iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define + as empty, rather define as ((void)0). + + * sparc.c (sparc_check_64): Add braces around ambiguous `else'. + Add parentheses around assignment used as truth value. + + * cplus-dem.c (squangle_mop_up): Change return type to void. + (internal_cplus_demangle): Remove unused parameter `options'. + All callers changed. + (cplus_demangle_opname): Remove function wide variable `int i' and + replace with `size_t i' at each location where it is used. + (cplus_demangle_opname): Change type of `i' from int to size_t. + + * cppexp.c (right_shift): Mark parameter `pfile' with + ATTRIBUTE_UNUSED. + + * cpphash.c (cpp_lookup): Likewise. + (cpp_hash_cleanup): Likewise. + + * cpplib.c (parse_name): Add a prototype and make it static. + (null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED. + (null_cleanup): Likewise for parameters `pbuf' and `pfile'. + (macro_cleanup): Likewise for parameter `pfile'. + (file_cleanup): Likewise. + + * cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read, + cpp_read_check_assertion, skip_rest_of_line): Add prototypes. + + * crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data, + __DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED. + + * cse.c (cse_check_loop_start): Mark parameter `set' with + ATTRIBUTE_UNUSED. + + * dbxout.c (flag_minimal_debug, have_used_extensions, + source_label_number): Move inside macro wrapper check against + defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO). + + * dwarf2out.c (gen_entry_point_die): Hide prototype and definition. + + * except.h (doing_eh): Provide prototype. + + * expr.c: Move inclusion of expr.h to after insn-config.h. + + * final.c: Include reload.h. + (shorten_branches): Cast the first argument of bzero to char *. + + * fix-header.c (cpp_print_containing_files): Mark parameter + `pfile' with ATTRIBUTE_UNUSED. + (cpp_fatal): Likewise. + + * flow.c (find_basic_blocks_1): Cast the first argument of bzero + to char *. + + * genattrtab.c (make_length_attrs): Change the type of variable + `i' from int to size_t. + (zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED. + (one_fn): Likewise. + + * genextract.c (main): When generating insn-extract.c, mark + variable `junk' with ATTRIBUTE_UNUSED. + + * gengenrtl.c (gencode): When generating genrtl.c, cast the first + argument of bzero to char*. + + * integrate.c: Include toplev.h. + + * libgcc2.c: Wrap `struct exception_table' and + `find_exception_handler' in macro DWARF2_UNWIND_INFO. + + * objc/Make-lang.in (objc-act.o): Depend on toplev.h. + + * objc/objc-act.c: Include toplev.h. + (lang_print_xnode): Mark parameters `file', `node' and `indent' + with ATTRIBUTE_UNUSED. + (finish_protocol): Likewise for parameter `protocol'. + + * output.h (declare_weak): Add prototype. + (decode_reg_name): Don't wrap with TREE_CODE macro. + (assemble_alias): Add prototype. + + * regclass.c: Include output.h. + + * reload.h (reloads_conflict): Add prototype. + + * rtl.h (print_rtl_single, mark_elimination, reg_class_subset_p, + output_func_start_profiler): Add prototypes. + + * rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with + ATTRIBUTE_UNUSED. + + * scan-decls.c: Include scan.h. + + * scan.h (recognized_function, recognized_extern): Add prototypes. + + * stmt.c: Include output.h. + + * toplev.c (error_for_asm, warning_for_asm): Remove prototypes. + (output_lang_identify): Hide prototype and definition. + (float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED. + (pipe_closed): Likewise. + + * toplev.h (count_error, strip_off_ending, error_for_asm, + warning_for_asm): Add prototypes. + +Wed May 13 12:54:19 1998 Michael Meissner + + * toplev.c (rest_of_compilation): "Charge" final for any time + doing various cleanup operations after finishing compilation + of a function. + + * flow.c (dump_flow_info): Also print number of sets and + whether or not the pseudo is a user variable. + + * flow.c (reg_n_max): New global variable. + * regclass.c (allocate_reg_info): Keep reg_n_max up to date. + Delete regno_max variable. + * regs.h (REG_N_CHECK): Define. + (REG_N_REFS, REG_N_SETS, REG_N_DEATHS): Use REG_N_CHECK. + (REG_N_CHANGES_SIZE, REG_N_CALLS_CROSSED, REG_LIVE_LENGTH): Likewise. + (REGNO_FIRST_UID, REGNO_LAST_UID, REGNO_LAST_NOTE_UID): Likewise. + +Wed May 13 12:54:19 1998 Martin von Loewis + + * acconfig.h (ENABLE_CHECKING): Undefine. + * configure.in (--enable-checking): New option. + +Wed May 13 08:52:08 1998 J"orn Rennecke + + * reload1.c (merge_assigned_reloads): Can merge + RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_OTHER_ADDRESS even + if RELOAD_FOR_INPUT with the same reload_reg_rtx is present. + +Tue May 12 20:05:57 1998 Jim Wilson + + * collect2.c (main): Ignore do_collecting when COLLECT_EXPORT_LIST. + +Wed May 13 03:23:45 1998 J"orn Rennecke + + * reload1.c (gen_reload): Create REG_EQUIV notes. + +Tue May 12 22:21:07 1998 J"orn Rennecke + + * reload1.c (reload): Fix check for USEs to use code of pattern. + (choose_reload_regs): Remove dead variable use_insn. + +Tue May 12 14:04:49 1998 Jeffrey A Law (law@cygnus.com) + + * pa.h (DBX_CONTIN_LENGTH): Reduce to 3000 bytes. + +Tue May 12 15:16:02 1998 Michael Meissner + + * haifa-sched.c (HAIFA_INLINE): Define to be __inline unless + already defined. + (find_insn_{,mem_}list): Use HAIFA_INLINE, not __inline. + (insn_{unit,issue_delay}): Likewise. + (blockage_range): Likewise. + (actual_hazard{,_this_instance}): Likewise. + (schedule_unit): Likewise. + (potential_hazard): Likewise. + (insn_cost): Likewise. + (swap_sort): Likewise. + (queue_insn): Likewise. + (birthing_insn_p): Likewise. + (adjust_priority): Likewise. + (get_block_head_tail): Likewise. + (init_rgn_data_dependences): Likewise. + +Tue May 12 10:27:54 1998 Klaus Kaempf + + * alpha/vms.h (COMMON_ASM_OP, ASM_OUTPUT_ALIGNED_COMMON): Define. + +Tue May 12 11:44:14 1998 Gavin Koch + + * config/mips/mips.h (ASM_OUTPUT_ALIGN): Remove trailing semi-colon. + +Tue May 12 11:38:31 1998 Gavin Koch + + * config/mips/mips.md (dslot): Move after definition of "cpu" + attribute. Handle r3900 case. + +Tue May 12 10:21:36 1998 Kaveh R. Ghazi + + * system.h: Define the STRINGIFY macro here. + * protoize.c: Not here. + * gengenrtl.c (DEF_RTL_EXPR): Use the STRINGIFY macro. + +Tue May 12 00:47:33 1998 John Wehle (john@feith.com) + + * varasm.c (assemble_variable): Compute the alignment of the data + earlier so that both initialized and uninitialized variables are + effected by DATA_ALIGNMENT. + * tm.texi (DATA_ALIGNMENT): Updated appropriately. + +Mon May 11 19:57:58 1998 Jeffrey A Law (law@cygnus.com) + + * mips.c: Prototype static functions. + +Mon May 11 17:43:03 1998 Jim Wilson + + * regmove.c (fixup_match_2, find_matches, regmove_profitable): + Add explanatory comments. + + * sparc.h (SPARC_INCOMING_INT_ARG_FIRST): Support TARGET_FLAT. + +Mon May 11 17:24:27 1998 Richard Henderson + + * sparc.md (ffsdi2): Disable. Simplify the expression as well. + +Mon May 11 13:30:44 1998 Jim Wilson + + * varasm.c (make_decl_rtl): Disable April 1 change. + +Mon May 11 09:14:41 1998 Richard Henderson + + * configure.in (alpha-*-linux-gnu): Undo lossage from gcc2 merge. + +Mon May 11 08:24:18 1998 Richard Henderson + + * alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '`'. + * alpha.c (print_operand): Handle it. + * alpha.md (fix_truncdfsi2, fix_truncsfsi2): New patterns and + related define_splits. Also add peepholes for SImode reload + plus sign_extend lossage. + +Mon May 11 09:33:10 1998 Kaveh R. Ghazi + + * genattr.c: Include stdarg.h/varargs.h. Change function + `fatal' to use variable arguments instead of faking it with + integer parameters. Provide a prototype which also + checks the format specifiers using ATTRIBUTE_PRINTF_1. + + * genattrtab.c: Likewise. + * gencodes.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * genopinit.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + * genoutput.c: Likewise. Similarly for function `error'. + +Sun May 10 02:27:03 1998 Kaveh R. Ghazi + + * acconfig.h (HAVE_VOLATILE): Insert stub for autoconf. + * alocal.m4 (GCC_C_VOLATILE): New autoconf test. + * configure.in: Use GCC_C_VOLATILE. + * system.h (volatile): Define as empty if no volatile support is + available. + +Sun May 10 01:21:43 1998 Jeffrey A Law (law@cygnus.com) + + * genemit.c (output_add_clobbers): Removed unused variable 'i' from + generated function. + +Sat May 9 02:02:15 1998 Richard Henderson + + * loop.c (get_condition): Don't combine when either compare is MODE_CC. + * alpha.c (alpha_emit_conditional_branch): New function. Taken from + the body of beq; additionally set the mode of the branch to CCmode for + FP compares and not fast_math. + (alpha_emit_conditional_move): Always use a compare insn for FP + when not fast_math, as well as setting CCmode on the cmov. + * alpha.md (beq, bne, blt, et al): Call alpha_emit_conditional_branch. + + * machmode.h (COMPLEX_MODE_P): New macro. + +Sat May 9 01:53:23 1998 Richard Henderson + + * haifa-sched.c (print_exp): Fix typo. + +Fri May 8 21:48:50 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Fri May 8 18:23:08 1998 Michael Meissner + + * final.c (final_scan_insn): Call fatal_insn instead of abort if + we could not split an insn when required to. + + * m32r.md ({add,sub}di3): Add define_splits and appropriate low + level insns. + (peepholes): Disable peepholes that call dead_or_set_p. + (movsi): Rewrite to handle addresses better after last change. + Add define_split to split load of addresses in large/medium modes. + (prologue): Call m32r_expand_prologue. + (movsi_{push,pop}): Generators for push/pop. + (movsi): Support PRE_{INC,DEC}, POST_INC. + (mov{di,df}): Rewrite. Always split the insns. + (movsf): Add define_split to get register load in correct mode. + (cmp_ne_small_const_insn): Use 'N' instead of 'S' constraint. + (attributes): Rewrite attributes so that type indicates both the + type and the length of the insn directly. + (all insns): Change to use new type attributes. + (debug): New attribute to convey whether -mdebug was used. + (opt_space): New attribute to convey whether -Os was used. + (function units): Loads are 3 cycles, not 2. Better classify all + insns into short/long. + (load/store/extend insns): Add separate case for load/store + indirect operations without an offset. + (divsi3): Division is a long operation, not short. + + * m32r.h (LEGITIMATE_LO_SUM_ADDRESS_P): Do not allow LO_SUM for + modes > 1 word. + (GO_IF_MODE_DEPENDENT_ADDRESS): LO_SUM is now mode dependent. + (CONST_OK_FOR_LETTER_P): Make 'N' handle reverse 8 bit compares. + (EXTRA_CONSTRAINT): Remove 'S' special support. Add 'U' for + operands with PRE_{INC,DEC}, POST_INC. + (FUNCTION_PROFILER): Call abort instead of doing nothing. + (GO_IF_LEGITIMATE_ADDRESS): Allow PRE_{INC,DEC}, POST_INC of + SImode variables. + (gen_split_move_double): Declare. + (EXTRA_CONSTRAINT): Add 'T' for memory reference with no offset. + + * m32r.c (gen_split_move_double): Fix typo. Also, don't call + emit_move_insn, build up SET's directly. + (toplevel): Include system.h, not stdio.h. + (move_double_src_operand): Allow any DF or DI mode constant. + (gen_split_move_double): Split moves of DI or DF values into the + appropriate moves, loads, or stores. Don't handle use of auto + inc/dec if using dead index. Do handle overlapping moves, etc. + (m32r_frame_info): Remove prologue_size field. + (m32r_compute_frame_size): Don't calculate prologue size. + (m32r_output_function_prologue): Change to pretty much a NOP. + (m32r_expand_prologue): Expand prologue as a series of INSNs. + (m32r_print_operand): Add support for PRE_{INC,DEC}, POST_INC. + (m32r_print_operand_address): Likewise. + +Fri May 8 14:13:21 1998 H.J. Lu (hjl@gnu.org) + + * reload1.c (emit_reload_insns): When performing expensive + optimizations, do not output the last reload insn if OLD is + not the dest of NSN and is in the src and is clobbered by INSN. + +Fri May 8 09:47:29 1998 Kaveh R. Ghazi + + * Makefile.in (genrtl.o): Depend on system.h. + * gengenrtl.c (gencode): When creating genrtl.c, have it + include system.h. + +Fri May 8 10:57:33 1998 Andreas Schwab + + * config/m68k/t-linux: Remove extra stuff already included in + config/t-linux. + +Fri May 8 09:53:24 1998 Paul Eggert + + * fixinc.wrap: Renamed from fixinc.math. Put wrapper around + curses.h if it contains `typedef char bool;', as suggested by + Manfred Hollstein . + + * configure.in: Rename fixinc.math to fixinc.wrap. + +Thu May 7 19:26:34 1998 Jim Wilson + + * gcc.c (read_specs): Handle missing blank line at end of specs file. + + * i386.md (movsicc, movhicc, movsicc_1, movhicc_1, movsfcc_1, + movdfcc_1): Disable. + +Thu May 7 15:39:14 1998 Jim Wilson + + * configure.in (enable_threads): Rename to enable_threads_flag before + main loop. Set enable_threads to enable_threads_flag inside main + loop. + +Thu May 7 17:38:03 1998 Michael Meissner + + * r6000/eabi.asm (__eabi): Restore LR in case __eabi is called + multiple times. + +Thu May 7 14:26:05 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_FUNC_VFPRINTF_DOPRNT): New macro. + + * configure.in: Add a call to GCC_FUNC_VFPRINTF_DOPRNT. + (AC_CHECK_HEADERS): Remove unused check for varargs.h,sys/varargs.h. + (AC_CHECK_FUNCS): Remove unused check for vprintf. + + * Makefile.in: Add support for linking in vfprintf.c and doprint.c. + (cccp.o): Depend on gansidecl.h. + (cexp.o): Likewise. + + * cccp.c: Convert from using PRINTF_ALIST/PRINTF_DCL to VPROTO as + per the rest of gcc source. + * cexp.y: Likewise. Include gansidecl.h and remove all code made + redundant. + + * cccp.c: Remove checks for HAVE_VPRINTF and the associated code + used when vfprintf is missing. + * cexp.y: Likewise. + * gcc.c: Likewise. + * genattrtab.c: Likewise. + * mips-tfile.c: Likewise. + * toplev.c: Likewise. + + * vfprintf.c: New file. + * doprint.c: New file. + +Thu May 7 10:18:41 1998 Jeffrey A Law (law@cygnus.com) + + * config/linux.h (ASM_COMMENT_START): Remove from here, + * config/linux-aout.h (ASM_COMMENT_START): and here, + * config/i386/linux.h (ASM_COMMENT_START): to here, + * config/i386/linux-aout.h (ASM_COMMENT_START): and here. + * config/i386/linux-oldld.h (ASM_COMMENT_START): Define + here as '#' too. + +Thu May 7 10:55:59 1998 Andreas Schwab + + * config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode + constant. + +Wed May 6 22:32:37 1998 Robert Lipe + + * Makefile.in (dwarfout.o): Add toplev.h dependency. + * dwarfout.c, i386.c: Include toplev.h. + * toplev.h (pfatal_with_name): Add prototype. + +Wed May 6 19:02:29 1998 Jason Merrill + + * Makefile.in: Fix .SUFFIXES. + +Wed May 6 19:31:32 1998 Alan Modra + + * config/linux.h (ASM_COMMENT_START): Define as "#". + * config/linux-aout.h (ASM_COMMENT_START): Likewise. + +Wed May 6 15:51:39 1998 Jim Wilson + + * objc/Make-lang.h (objc-parse.o): Add toplev.h dependency. + * objc/objc-parse.y, objc/objc-parse.c: Regenerate. + + * toplev.c: Include toplev.h. + * Makefile.in (c-common.o, c-convert.o, c-decl.o, c-iterate.o, + c-lex.o, c-parse.o, c-pragma.o, c-typeck.o, calls.o, convert.o, + dwarf2out.o, except.o, expr.o, final.o, fold-const.o, function.o, + hash.o, profile.o, real.o, reg-stack.o, regclass.o, reload.o, + reload1.o, stmt.o, stor-layout.o, tlink.o, tree.o, varasm.o): Add + toplev.h dependency. + + * mips/mips.c (save_restore_insns): Change FRAME_POINTER_REGNUM to + HARD_FRAME_POINTER_REGNUM. + + * expr.c (target_temp_slot_level): Delete duplicate definition. + +Wed May 6 16:46:01 1998 Jeffrey A Law (law@cygnus.com) + + * stmt.c (mark_seen_cases): Make it have external linkage again. + * expr.h (mark_seen_cases): Add declaration, but only when tree.h + has been included. + + * haifa-sched.c (print_value, case SUBREG): Fix typo. + + * i386.c (output_387_binary_op): Add some braces to avoid warnings. + * i386.h (REG_CLASS_CONTENTS): Similarly. + + * toplev.c (-fsched-max): Delete flag. + (-fsched-interblock-max-blocks,-fsched-interblock-max-insns): Likewise. + * haifa-sched.c: Remove -fsched-max-N, -fsched-interblock-max-blocks-N + and -fsched-interblock-max-insns-N support. Remove INTERBLOCK_DEBUG + conditionals. + + * haifa-sched.c (find_rgns): Correctly handle reducible loops with + inner loops which are not reducible. + + * loop.c (regs_match_p): Fix typo in prototype. + + * regmove.c (try_auto_increment): Wrap declaration inside an + #ifdef AUTO_INC_DEC. + +Wed May 6 17:07:47 1998 Michael Meissner + + * final.c (output_operand_lossage): Call fatal with the operand + lossage message instead of calling abort. + +Wed May 6 15:37:27 1998 Kaveh R. Ghazi + + * c-common.c: Convert to using ctype macros defined in system.h. + * c-lex.c: Likewise. + * cccp.c: Likewise. + * collect2.c: Likewise. + * rs6000.c: Likewise. + * cpplib.c: Likewise. + * fix-header.c: Likewise. + * gcc.c: Likewise. + * gen-protos.c: Likewise. + * pexecute.c: Likewise. + * protoize.c: Likewise. + * rtl.c: Likewise. + * scan.c: Likewise. + * stmt.c: Likewise. + * tlink.c: Likewise. + * toplev.c: Likewise. + +Wed May 6 14:44:14 1998 Gavin Koch + + * config/mips/r3900.h (SUBTARGET_ASM_DEBUGGING_SPEC) : + Replace -gdwarf-2 with -g0. + +Wed May 6 11:43:18 1998 Kaveh R. Ghazi + + * Makefile.in (mips-tfile.o, mips-tdump.o): Depend on system.h. + * mips-tdump.c: Include system.h, remove redundant headers. + * mips-tfile.c: Likewise. Also, convert all ctype function calls + to calls of the macro versions defined in system.h. + + * objc/Make-lang.in (objc-act.o): Depend on system.h. + * objc/objc-act.c: Include system.h, remove redundant headers. + +Wed May 6 11:21:06 1998 Kaveh R. Ghazi + + * configure.in (AC_CHECK_FUNCS): Add isascii. + (GCC_NEED_DECLARATIONS): Add atof. + + * system.h: Provide prototypes for abort, atof, atol and sbrk here. + * rtl.c, rtl.h, toplev.c, tree.h: Not here. + +Wed May 6 10:52:49 1998 Kaveh R. Ghazi + + * system.h: Wrap time.h and sys/file.h in autoconf checks. + Provide default definitions for O_RDONLY and O_WRONLY here. + + * cccp.c, cpplib.c, fix-header.c, gcc.c, protoize.c: Not here. + +1998-05-06 Mark Mitchell + + * tree.h (IS_EXPR_CODE_CLASS): Remove bogus '3'. + +Wed May 6 06:35:38 1998 Robert Lipe + + * toplev.h: New file. Protypes for functions in toplev.c. + * tree.h, rtl.h: Deleted protos for functions in toplev.c. + * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c, + c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c, + convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c, + function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c, + reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c, + varasm.c: Include it. + +Wed May 6 01:09:01 1998 Jeffrey A Law (law@cygnus.com) + Jim Wilson (wilson@cygnus.com) + + * haifa-sched.c (find_rgns): In no_loops case, fix test for leaf + blocks. Check for 1 successor which is the EXIT_BLOCK. + + * haifa-sched.c (find_rgns): Detect unreachable blocks, including + unreachable loops with more than one block. + +Wed May 6 08:22:24 1998 Manfred Hollstein + + * fix-header.c (write_rbrac): Add "abort" to functions which need to + be protected. + +Wed May 6 00:09:36 1998 Jeffrey A Law (law@cygnus.com) + + * Check in merge from gcc2. See ChangeLog.12 for details. + +Tue May 5 14:33:49 1998 Jim Wilson + + * c-common.c (scan_char_table): Separate 's' and 'c'. 'c' does not + accept 'a' flag. 'S' does accept 'a' flag. + (check_format_info): When pedantic, warn for m/C/S/a/A formats, + and `a' flag. + + * elf64.h (MULTILIB_DEFAULTS): Move definition after mips.h include. + +Tue May 5 10:50:39 1998 Andreas Schwab + + * config/m68k/m68k.h: Declare functions from m68k.c used in + macros and machine description. + (ASM_OUTPUT_LONG_DOUBLE): Always use `l' flag in print format for + long values. + (ASM_OUTPUT_FLOAT): Likewise. + (ASM_OUTPUT_FLOAT_OPERAND): Likewise. + +Tue May 5 01:28:12 1998 Jason Merrill + + * tree.def: Add NAMESPACE_DECL. + * dwarfout.c (type_ok_for_scope): Ignore NAMESPACE_DECLs for now. + * dwarf2out.c (push_decl_scope): Likewise. + (scope_die_for): Likewise. + * tree.c (decl_function_context): Use TREE_CODE_CLASS to determine + how to get next context level. + +Tue May 5 01:43:16 1998 Jim Wilson + + * i386.c (output_fix_trunc): Add code to emulate non-popping DImode + case. + +Tue May 5 01:15:06 1998 Jeffrey A Law (law@cygnus.com) + + * h8300.h (ADDITIONAL_REGISTER_NAMES): Add "er" registers. + + * reorg.c (fill_slots_from_thread): Update REG_DEAD/REG_UNUSED notes + for any insns skipped at the start of a block because they were + redundant. + +Mon May 4 20:23:51 1998 Jim Wilson + + * alpha.h (DBX_CONTIN_LENGTH): Decrease to 3000. + +1998-05-04 Ulrich Drepper + + * c-common.c (format_char_info): Add new field hhlen. + (print_char_table, scan_char_table, time_char_table): Initialize + hhlen field appropriately. + (char_format_info): Recognize hh modifier and lookup correct char + table entry. + +Mon May 4 19:15:29 1998 Jim Wilson + + * expr.c (expand_expr, case INDIRECT_REF): Don't optimize string + reference if this is a store. + +Mon May 4 17:25:17 1998 Richard Henderson + + * sparc.c (output_move_quad): Fix typo in mov_by_64 argument. + +Sun May 3 23:57:25 1998 Robert Lipe + + Make UnixWare 7 bootstrap support work with final shipping product. + * configure.in (i[34567]86-*-sysv5): Append, not overwrite, xm_file. + Pick up xm-siglist and xm-alloca. + (xm_defines): Add USG so dbxout will build. + * configure: Regenerate. + +Sun May 3 13:51:34 1998 Richard Henderson + + Support for official SPARC V9 ABI: + * sparc.c (sparc_override_options): Force stack bias off for !arch64. + Care for flag_pcc_struct_return default. + (output_move_quad): Rewrite to move by halves on v9 and in the + proper direction. + (move_quad_direction): New function. + (output_fp_move_quad): Use it to determine the direction of copy. + (function_arg_slotno): Return -1 for FP reg overflow as well. + (function_arg_record_value*): New functions. + (function_arg): Use them. Streamline unprototyped parameter passing. + (function_arg_pass_by_reference): Pass TCmode by reference. + (function_value): New function. + * sparc.h (PTRDIFF_TYPE, SIZE_TYPE): For -pedantic's sake, don't use + long long in 64-bit mode. + (RETURN_IN_MEMORY): v9 returns structs < 32-bytes in regs. + (DEFAULT_PCC_STRUCT_RETURN): Make the default detectable. + (BASE_RETURN_VALUE_REG): Consider complex float types for arch64. + (BASE_OUTGOING_VALUE_REG, BASE_PASSING_ARG_REG): Likewise. + (BASE_INCOMING_ARG_REG): Likewise. + (FUNCTION_VALUE): Call function_value. + (FUNCTION_OUTGOING_VALUE, LIBCALL_VALUE): Likewise. + * sparc.md (movdi_sp32_v9): Disable for arch64. + (movsf, movdf, movtf): Sort all alternatives using fp regs first. + (call_value_address_sp64): Remove register class constraints. + (call_value_symbolic_sp64): Likewise. + (nonlocal_goto): Pass label reg directly to goto_handlers. Constrain + v9 case to 32-bit constants. + (goto_handler_and_restore_v9): Provide a version for arch64. + * sparc/linux64.h (SIZE_TYPE, PTRDIFF_TYPE): Remove private definition. + * sparc/sp64-aout.h (TARGET_DEFAULT): Turn on stack bias. + (CPP_PREDEFINES): New. + * sparc/sp64-elf.h: Likewise. + (PREFERRED_DEBUGGING_TYPE): Dwarf2. + (ASM_OUTPUT_DWARF2_ADDR_CONST): New. + * sparc/sysv4.h (SIZE_TYPE, PTRDIFF_TYPE): Undo svr4.h's changes. + +Sat May 2 17:47:17 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat May 2 01:37:29 1998 J"orn Rennecke + + * reload.c (find_reloads): Emit USEs to mark where a pseudo + is reloaded with the MEM of its stack slot. + * reload1.c (cannot_omit_stores): Delete. + (reload): Don't initialize it. + Don't apply avoid_return_reg logic to USEs. + When done, remove USEs that have a REG_EQUAL note on them. + (emit_reload_insns): Handle case where we have inherited a MEM. + (choose_reload_regs): Likewise. + (delete_output_reload): Don't use cannot_omit_stores. + +Thu Apr 30 18:59:03 1998 Jim Wilson + + * Makefile.in (cpp.info, gcc.info): Put -o option before input file. + +Thu Apr 30 16:57:34 1998 Michael Meissner + + * haifa-sched.c (print_{exp,value}): Various changes to make the + debug output easier to read. Also, use only one buffer, and make + sure the buffer we are passed in doesn't overflow. + (safe_concat): Concatenate to a buffer without overflow. + +Thu Apr 30 16:57:34 1998 Kaveh R. Ghazi + + * haifa-sched.c (alloc_{INSN,EXPR}_LIST): Make static to agree + with the prototype. + +Wed Apr 29 21:45:16 1998 J"orn Rennecke + + * sched.c (new_insn_dead_notes): Check if the register was + used in the original instruction. + * haifa-sched.c (new_insn_dead_notes): Likewise. + +Wed Apr 29 13:46:03 1998 Jim Wilson + + * dwarf2out.c (scope_die_for): If could not find proper scope, + check for and handle tagged type with incorrect TYPE_CONTEXT. + +Wed Apr 29 15:34:40 1998 John Carr + + * calls.c (expand_call): Fix recognition of C++ operator new. + + * alias.c (mode_alias_check): Disable type based alias detection. + +Wed Apr 29 15:06:42 1998 Gavin Koch + + * config/mips/elf.h (ASM_OUTPUT_DEF,ASM_WEAKEN_LABEL, + ASM_OUTPUT_WEAK_ALIAS): Define. + * config/mips/elf64.h: Same. + * config/mips/r3900.h (ASM_OUTPUT_DEF,SUPPORTS_WEAK, + ASM_WEAKEN_LABEL): Removed. + +Wed Apr 29 10:53:29 1998 Andreas Schwab + + * calls.c (expand_call): Bump the length limit on the specially + recognized function names to 17. + +Tue Apr 28 17:53:33 1998 Jim Wilson + + * ginclude/stddef.h: Add check for _MACHINE_ANSI_H_ for BSD/OS + when undefining macros at the end. + + * expr.c (expand_builtin, case BUILT_IN_MEMSET): Break if either + val or len has TREE_SIDE_EFFECTS set. + + * sparc.md (mulsidi3): Call const v8plus and v8plus routines. + (mulsidi3_v8plus, const_mulsidi3_v8plus): Delete asterisk from name. + (smuldi3_highpart): Call const v8plus routine. + (smulsi3_highpart_v8plus): Renamed from smulsidi3_highpart_v8plus. + (const_smulsi3_highpart_v8plus): New pattern. + (smulsi3_highpart_sp32): Renamed from smulsidi3_highpart_sp32. + (umulsidi3): Call const v8plus routine. + (umulsi3_highpart): Handle const before v8plus. Call const v8plus + routine. + (umulsi3_highpart_v8plus): Renamed from umulsidi3_highpart_v8plus. + (umulsi3_highpart_sp32): Renamed from umulsidi3_highpart_sp32. + +Tue Apr 28 08:55:26 1998 Michael Meissner + + * m32r.c (*_oper{and|ator}): Change enum arguments and return + values to int, so they can be prototyped even in files that don't + include rtl.h. + ({small,large}_insn_p): Likewise. + (m32r_select_cc_mode): Likewise. + (gen_compare): Likewise. + (function_arg_partial_nregs): Likewise. + (m32r_setup_incoming_varargs): Likewise. + (init_reg_tables): Add prototype. + (m32r_frame_info): Add prolog_size field. + (m32r_compute_frame_size): Calculate the size of the prologue. + (m32r_first_insn_address): Return prologue size. + (m32r_output_function_prologue): Calculate frame size before + printing out information. Print out the prologue size. + + * m32r.h: Prototype all functions in m32r.c. + (FIRST_INSN_ADDRESS): Declare, returning prologue size. + + * m32r.md (bcc functions): Cast enum's to int. + + * m32r.c (conditional_move_operand): Silence a debug message. + ({small,long}_insn): New predicates. + + * m32r.h (TARGET_M32R): New macro. + (PREDICATE_CODES): Rearrange somewhat, add small_insn/long_insn. + (HAIFA_P): Define as 1/0 depending on whether the Haifa scheduler + was selected. + (ISSUE_RATE): Define as 2. + + * m32r.md (insn_size): New attribute. + ({,rev_}branch_insn): Add .s qualifier to branches believed to be + short. + (m32r): New attribute. + + * configure.in (enable_haifa): Switch m32r to Haifa by default. + * configure: Regenerate. + + (Changes from Nick Clifton ) + * m32r.h (EXTRA_CONSTRAINT): Implement 'S' constraint to perfoirm + the equivalent of a negated 'I' constraint. + (PRESERVE_DEATH_INFO_REGNO_P): Define in order to allow peephole + optimization to work. + + * m32r.md (cmp_ne_small_const_insn): Use 'S' constraint rather + than 'I' since the value is negated. + (peephole): Add peephole optimization to cope with optimization of + divide and subtracts of the same operands. + + * m32r.c zero_and_one, emit_cond_move): Add support for MVFC. + * m32r.h: Likewise. + * m32r.md: Likewise. + + * m32r.h (PREDICATE_CODES): Add declaration of machine specific + predicates. + +Tue Apr 28 07:25:53 1998 Manfred Hollstein + + * Makefile.in (libgcc2.ready): Revert last patch (Apr 24). + +Mon Apr 27 18:39:47 1998 Nick Clifton + + * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Check against + frame_pointer_rtx not FRAME_POINTER_REGNUM. + +Mon Apr 27 18:36:28 1998 Jim Wilson + + * reg-stack.c: Revert last patch (Apr 20). + (convert_regs): Set insn to PREV_INSN (next) after do while loop. + + * m68k/lb1sf68.asm (Laddsf$3): Fix typos in mcf5200 exg code. + + * loop.c (check_dbra_loop): New locals jump, first_compare, and + compare_and_branch. Call get_condition to set first_compare. + Set compare_and_branch to number of compare/branch instructions. + Replace PREV_INSN (PREV_INSN (loop_end)) with first_compare. + Replace '2' with compare_and_branch. + +Mon Apr 27 15:53:30 1998 Andrew MacLeod + + * cplus-dem.c (demangle_qualified): Replace missing else. + +Mon Apr 27 20:22:08 1998 J"orn Rennecke + + * sh.c (gen_ashift_hi): Don't make SUBREG of a SUBREG. + +Mon Apr 27 18:23:51 1998 J"orn Rennecke + + * sh.c (sh_expand_prologue, sh_expand_epilogue): + If TARGET_DOUBLE_ALIGN, preserve 64 bit stack alignment. + * sh.h (STACK_BOUNDARY): Likewise. + +Mon Apr 27 17:22:48 1998 J"orn Rennecke + + * sh.h (LEGITIMIZE_RELOAD_ADDRESS): Define. + +Mon Apr 27 08:55:23 1998 Michael Meissner + + * system.h (abort): If abort is not defined, and neither is + USE_SYSTEM_ABORT, redefine abort to call fprintf and exit, + reporting the line and filename of the error. + + * .gdbinit: Add breakpoints on exit and fancy_abort. + + * final.c (split_double): Avoid a compiler warning if + BITS_PER_WORD is less than or equal to HOST_BIT_PER_WIDE_INT. + + * rtl.h (JUMP_{CROSS_JUMP,NOOP_MOVES,AFTER_REGSCAN}): New macros + for calling jump_optimize. + + * toplev.c (rest_of_compilation): Call jump_optimize using JUMP_* + macros, rather than 0/1's. + +Sun Apr 26 23:19:10 1998 Richard Henderson + + * alpha.h (CONST_COSTS): Zero is always free. + (RTX_COSTS): Add EV6 costs. Abort if alpha_cpu is unknown. + +Sun Apr 26 15:38:50 1998 Andreas Schwab + + * cplus-dem.c (gnu_special): Fix off-by-one bug when checking the + length in the name of a virtual table. + +Sun Apr 26 01:21:06 1998 Richard Henderson + + * alpha.c (print_operand): Don't add 'v' suffix for ALPHA_FPTM_N. + +Sat Apr 25 22:11:38 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Apr 25 17:17:15 1998 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (fold_convert): Fix typo. + +Sat Apr 25 17:55:54 1998 John Carr + + * alias.c (alias_invariant): New variable. + (record_base_value): New argument INVARIANT. + (memrefs_conflict_p): If a register has an entry in the alias_invariant + array, try substituting that value for the register. + + * rtl.h: Declare record_base_value. + + * loop.c, unroll.c: Update callers of record_base_value. + + * alias.c (find_base_value, find_base_term): SIGN_EXTEND and + ZERO_EXTEND do not affect base values. + +Fri Apr 24 15:57:02 1998 Jeffrey A Law (law@cygnus.com) + + * dbxout.c (dbxout_type): Fix typo. + (dbxout_range_type): Another HOST_WIDE_INT_PRINT_DEC fix. + + * configure.in: Use CC_FOR_BUILD, not BUILD_CC. + +Fri Apr 24 16:11:47 1998 John Carr + + * expr.c (expand_builtin, case MEMSET): Set MEM_IN_STRUCT_P + if the argument is the address of a structure or array. + + * configure.in: Enable Haifa scheduler by default for SPARC. + +Fri Apr 24 20:55:47 1998 J"orn Rennecke + + * cse.c (cse_set_around_loop): Don't do optimization when + new pseudos are created. + +Fri Apr 24 11:00:18 1998 Jeffrey A Law (law@cygnus.com) + + * dbxout.c (dbxout_type_fields): Use HOST_WIDE_INT_PRINT_DEC + appropriately. + (dbxout_type_method_1, dbxout_type): Likewise. + (print_int_cst_octal, print_octal, dbxout_symbol): Likewise. + (dbxout_type): Fix check for when to print a type range in + octal vs decimal. + +Fri Apr 24 16:45:03 1998 J"orn Rennecke + + * (gen_shl_and, in case 1): Fix comparison with mask. + +Fri Apr 24 06:46:40 1998 Nick Clifton + + * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Disallow frame + pointer as second register in REG+REG pair. + +Fri Apr 24 09:22:23 1998 Kaveh R. Ghazi + + * c-common.c (check_format_info): Don't check for the 'x' format + character twice, instead check for 'x' and 'X' + +Fri Apr 24 08:02:30 1998 Manfred Hollstein + + * Makefile.in (libgcc2.ready): Add explicit dependency from + $(STMP_FIXPROTO) to ensure all necessary include files have + been created and to guarantee proper parallel builds. + +Fri Apr 24 04:42:35 1998 J"orn Rennecke + + * sh.c (sh_expand_prologue, in !SH3E code): Don't push an extra + register for stdarg functions. + * sh.h (current_function_varargs): Declare. + (FUNCTION_ARG): Ignore NAMED for stdarg functions. + +1998-04-23 Jim Wilson + + * frame.c, libgcc2.c (stdlib.h, unistd.h): Don't include when + inhibit_libc is defined. + + * c-aux-info.c (gen_type): Use DECL_NAME only for TYPE_DECL. + +Thu Apr 23 19:09:33 1998 Jim Wilson + + * profile.c (tablejump_entry_p): New function. + (branch_prob): Add code to recognize MIPS tablejump entry branch. + Use tablejump_entry_p in MIPS and HPPA tablejump checking code. + +Thu Apr 23 15:01:13 1998 Nick Clifton + + * config/arm/arm.c (find_barrier): Return as soon as a barrier is + found, rather than at end of the loop, after the insn has been + changed. + +Thu Apr 23 20:21:06 1998 J"orn Rennecke + + * sh.c (gen_ashift_hi): Implement right shifts via gen_ashift. + * sh.md (ashrhi3_k, lshrhi3_k, lshrhi3_m, lshrhi3, lshrhi3+1): Delete. + +Wed Apr 22 17:07:35 1998 Michael Meissner + + * loop.c (note_addr_stored): Correct function to take 2 arguments, + instead of 1. + + * rtl.def (MATCH_INSN2): Add new matching pattern. + * genrecog.c (add_to_sequence): Support MATCH_INSN2. + +Wed Apr 22 15:52:22 1998 John Carr + + * emit-rtl.c (gen_highpart): The high part of a CONST_INT is not zero + if HOST_BITS_PER_WIDE_INT is larger than BITS_PER_WORD. + + * final.c (split_double): Sign extend both halves of a split CONST_INT. + +Wed Apr 22 10:42:45 1998 Jeffrey A Law (law@cygnus.com) + + * mips.c (compute_frame_size): Change only argument to a HOST_WIDE_INT. + +Wed Apr 22 10:53:49 1998 Andrew MacLeod + + * cplus-dem.c (struct work stuff): Add field for B and K mangle codes. + (cplus_demangle_opname): Call mop_up_squangle. + (cplus_demangle): Initialize squangle info, then call + internal_cplus_demangle. (Most code moved there as well) + (internal_cplus_demangle): New function, performs most of what use + to be done in cplus_demangle, but is only called with this file. + (squangle_mop_up): New function to clean up B and K code data. + (mop_up): Set pointers to NULL after freeing. + (demangle_signature, demangle_template, demangle_class): Add + switch elements to handle K and B codes. + (demangle_prefix, gnu_special, demangle_qualified): Add + code to handle K and B codes. + (do_type, demangle_fund_type): Handle B and K codes. + (remember_Ktype): New function to store K info. + (register_Btype, remember_Btype): New functions for B codes. + (forget_B_and_K_types): New function to destroy B and K info. + +1998-04-21 Jim Wilson + + * stmt.c (check_seenlabel): When search for line number note for + warning, handle case where there is no such note. + +Tue Apr 21 20:48:37 1998 John Carr + + * genemit.c (gen_exp): Allow machine description to set mode of + MATCH_OP_DUP. + +Tue Apr 21 16:36:01 1998 John Carr + + * alias.c (mode_alias_check): New function. + (true_dependence, anti_dependence, output_dependence): Call + mode_alias_check. + +Tue Apr 21 12:05:32 1998 Jeffrey A Law (law@cygnus.com) + + * mips.h (STACK_BOUNDARY): Allow specific targets to override. + (MIPS_STACK_ALIGN): Similarly. + + * c-common.c (type_for_mode): Handle TI types. + * c-decl.c (intTI_type_node, unsigned_int_TI_type_node): Define. + (init_decl_processing): Handle TI types. + * c-tree.h (intTI_type_node, unsigned_int_TI_type_node): Declare. + + * mips.c (block_move_loop): Test Pmode == DImode instead of + TARGET_MIPS64. + (expand_block_move, save_restore_insns): Likewise. + (function_prologue, mips_expand_prologue): Likewise. + (mips_expand_epilogue): Likewise. + * mips.h (POINTER_SIZE): Allow specific targets to override. + (Pmode): Allow specific targets to override. + (FUNCTION_PROFILER): Test Pmode == DImode instead of TARGET_MIPS64. + (POINTER_BOUNDARY, FUNCTION_MODE): Likewise. + (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE): Likewise. + (TRAMPOLINE_ALIGNMENT, INITIALIZE_TRAMPOLINE): Likewise. + (CASE_VECTOR_MODE, ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + (ASM_OUTPUT_ADDR_DIFF_ELT, SIZE_TYPE, PTRDIFF_TYPE): Likewise. + * mips.md (indirect, tablejump & casesi support): Test for + Pmode == DImode instead of TARGET_MIPS64. + (call patterns): Likewise. + +Tue Apr 21 09:43:55 1998 Kaveh R. Ghazi + + * objc/sendmsg.c: Define gen_rtx_MEM() to 1, as is already done + for gen_rtx(MEM, ...). + +Tue Apr 21 02:15:36 1998 Richard Henderson + + * sparc.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Rewrite + to not be so gross, and to properly function with PIC. + +Mon Apr 20 20:44:25 1998 Jim Wilson + + * frame.c (heapsort): Rename to frame_heapsort. + + * gcc.c (do_spec_1, case '['): Move flag out of loop and initialize it. + +Mon Apr 20 12:43:09 1998 Doug Evans + + * flow.c (sbitmap_vector_alloc): Ensure sbitmaps properly aligned. + +Mon Apr 20 15:04:14 1998 John Wehle (john@feith.com) + + * i386.md (movsf_push, movdf_push, movxf_push): Allow memory + operands during and after reload. + +Mon Apr 20 22:37:50 1998 J"orn Rennecke + + * final.c (shorten_branches, init_insn_lengths): Move code + to free label_align, uid_shuid, insn_lengths, insn_addresses + and uid_align from the former function into the latter one; + Add code to clear these variables. + * sh.h (label_align): Remove declaration. + +Mon Apr 20 14:48:29 1998 Michael Meissner + + * gcc.c (lang_specific_driver): Declare prototype properly so + fatal can be passed to it without error. + + * configure.in (AC_CHECK_FUNCS): Check for strchr and strrchr. + * configure: Regenerate. + * config.in: Add #undef's for strchr and strrchr. + + * protoize.c (toplevel): If we have rindex, but not strrchr, map + rindex to strrchr. + (file_could_be_converted): Use strrchr, not rindex since rindex is + not defined on Linux systems when _POSIX_SOURCE is defined. + (file_normally_convertible): Likewise. + (process_aux_info_file): Likewise. + (main): Likewise. + + * rs6000.md (mov{sf,df} define_splits): When splitting a move of + a constant to an integer register, don't split the insns that do + the simple AND and OR operations, rather just split each word, and + let the normal movsi define split handle it further. + +Mon Apr 20 18:19:40 1998 J"orn Rennecke + + * sh.c (find_barrier): Fix bug in ADDR_DIFF_VEC handling. + (split_branches): Call init_insn_lengths. + +Mon Apr 20 07:37:49 1998 Michael Meissner + + * i386.c: Include expr.h to get the change_address prototype + declared. + +Mon Apr 20 01:00:05 1998 H.J. Lu (hjl@gnu.org) + + * reg-stack.c (subst_asm_stack_regs): Change to return the last + new insn generated by this function. + (subst_stack_regs): Likewise. + (convert_regs): Record the last newly generated insn and use + it for change_stack () instead of INSN. + +Sun Apr 19 15:41:24 1998 Manfred Hollstein + + * fix-header.c (enum special_file): Undefine enumerators if they + are already defined by include files. + * fixproto (rel_source_file in unistd.h stdlib.h): Prefix file protection + macro with '__' to not pollute user namespace. + +Sun Apr 19 02:42:06 1998 Richard Henderson + + * haifa-sched.c (queue_to_ready): Fix typo in prototype. + +Sat Apr 18 23:52:35 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Apr 18 18:30:22 1998 Jim Wilson + + * i386.md (fix_truncsfdi2+[123]): Add + to operand 1 constraints. + + * i386.h (CPP_CPU_DEFAULT): Renamed to CPP_CPU_DEFAULT_SPEC. + Add missing -Dpentium* options. + (CPP_CPU_SPEC): Delete redundant definition. Include cpp_cpu_default + instead of CPP_CPU_DEFAULT. + (EXTRA_SPECS): Add entry for cpp_cpu_default. + +Sat Apr 18 19:06:59 1998 David Edelsohn + + * rs6000.md (floatsidf2_loadaddr): rs6000_fpmem_offset will be + negative in a stackless frame. + * rs6000.c (rs6000_stack_info): Don't include fixed-size link area + in stackless frame size. Support 64-bit stackless frame size. + Combine fpmem offset calculations and don't add total_size to + offset if not pushing a stack frame. + +Sat Apr 18 15:41:16 1998 Jim Wilson + + * regmove.c (fixup_match_1): In three places, in flag_exceptions + check, change p to q. + +Sat Apr 18 15:30:49 1998 Jim Wilson + + * gcc.c (lang_specific_driver): Add new parm type to prototype. + (added_libraries): New file scope static variable. + (process_command): Initialize added_libraries. Pass it to + lang_specific_driver. + (main): Use added_libraries in check for no input files. + +Sat Apr 18 01:23:11 1998 John Carr + + * sparc.c, sparc.h, sparc.md, sol2.h: Many changes related to V9 + code generation. Use 64 bit instructions in 32 bit mode when + possible. Use V9 return instruction. UltraSPARC optimizations. + + * sparc.h: Change gen_rtx (CODE to gen_rtx_CODE (. + +Fri Apr 17 22:38:17 1998 Jeffrey A Law (law@cygnus.com) + + * global.c (global_alloc): Don't pass HARD_CONST (0) to find_reg, + just pass zero. That will work regardless of the size of HARD_REG_SET. + + * libgcc2.c (__floatdisf): Fix a couple typos. + +Fri Apr 17 17:28:26 1998 Jim Wilson + + * Makefile.in (mostlyclean): Delete *.mach and *.bp files. + +Fri Apr 17 16:35:35 1998 Greg McGary + + * emit-rtl.c (gen_highpart): Initialize `word' properly for pseudo. + +Fri Apr 17 14:30:37 1998 John Carr + + * emit-rtl.c (operand_subword_force): If a register can not be + accessed by words, copy it to a pseudo register. + +Fri Apr 17 14:30:37 1998 Jim Wilson + + * rs6000/vxppc.h (CPP_SPEC): Add support for mrelocatable*. + +Fri Apr 17 17:01:25 1998 Michael Meissner + + * tree.h (mark_seen_cases): Delete declaration. + +Fri Apr 17 13:32:20 1998 Jeffrey A Law (law@cygnus.com) + + * stmt.c (mark_seen_cases): Make static and add prototype. + +Fri Apr 17 11:21:43 1998 Kaveh R. Ghazi + + * frame.c: Include stdlib.h and unistd.h to possibly get various + function prototypes. The fixproto script guarantees these header + files exist on the target system. + * libgcc2.c: Likewise. + + * gthr-single.h (__gthread_mutex_lock, __gthread_mutex_trylock, + __gthread_mutex_unlock): Add __attribute__ ((__unused__)) to the + function parameters. + * libgcc2.c (__udiv_w_sdiv): Likewise. + +Thu Apr 16 22:41:02 1998 Jeffrey A Law (law@cygnus.com) + + * varasm.c (asm_output_bss): Add prototype. + (asm_output_aligned_bss): Likewise. + + * unroll.c (verify_addresses): Add prototype. + + * toplev.c: Add many prototypes. Too many to mention here. + + * stmt.c (check_seenlabel): Add prototype. + + * rtlanal.c (reg_set_p_1): Add prototype. + (reg_set_last_1): Likewise. + + * reorg.c (find_dead_or_set_registers): Add prototype. + + * regmove (try_auto_increment): Add prototype. + + * reg-stack.c (pop_stack): Add prototype. + + * recog.c (validate_replace_rtx_1): Add prototype. + (find_constant_term_loc): Likewise. + + * loop.c (regs_patch_p): Add prototype. + (add_label_notes, count_nonfixed_reads): Likewise. + (find_single_use_in_loop): Likewise. + (express_from): Surround prototype with #ifdef. + (giv_sort): Similarly. + + * jump.c (mark_modified_reg): Add prototype. + + * haifa-sched.c (is_prisky): Add prototype. + (queue_to_ready): Likewise. + + * genextract.c (gen_insn): Add prototype. + + * genemit.c (max_operand_1): Add prototype. + (max_operand_vec, print_code, gen_exp, gen_insn): Likewise. + (gen_expand, gen_explit, output_add_clobbers): Likewise. + (output_init_mov_optab): Likewise. + + * genattrtab.c (attr_hash_add_rtx): Add prototype. + (attr_hash_add_string, write_length_unit_log): Likewise. + + * genattr.c (init_range): Add prototype. + + * combine.c (sets_function_arg_p): Add prototype. + + * expr.c (store_constructor_field): Add prototype. + (get_memory_usage_from_modifier): Likewise. + + * expmed.c (synth_mult): Add prototype. + (choose_multiplier, invert_mod2n): Likewise. + + * except.c (push_eh_entry): Add prototype. + (pop_eh_entry, enqueue_eh_entry, dequeu_eh_entry): Likewise. + (call_get_eh_context, start_dynamic_cleanup): Likewise. + (start_dynamic_handler, can_throw): Likewise. + (output_exception_table_entry, scan_region): Likewise. + (eh_regs, set_insn_eh_region): Likewise. + + * dwarfout.c (decl_class_context): Add prototype. + (output_inheritance_die, type_ok_for_scope): Likewise. + + * c-lex.c (skip_white_space_on_line): Add prototype. + + * alias.c (record_set): Add prototype. + (find_base_term, base_alias_check): Likewise. + + * function.c (assign_outer_stack_local): Make static and add prototype. + + * haifa-sched.c (build_control_flow): Accept raw data as inputs + instead of computing it locally. Callers changed. + (find_rgns): Several new arguments. Callers changed. + Generally clean up and comment better. Use dominators to + identify reducible loops. Convert some flag arrays to bitmaps. + Convert most of the code to work on pred/succ lists instead of + an edge table. Add comments for future improvements. + (schedule_insns): Allocate temporary tables for flow data, call + routines to compute flow data and pass it along to children as + arguments. + (debug_control_flow): Delete. Use dump_bb_data instead. + + * basic-block.h (compute_dominators): Declare. + + * flow.c (dump_sbitmap, dump_sbitmap_vector): New debugging + functions. + * basic-block.h: Declare them. + +Thu Apr 16 13:45:51 1998 Jim Wilson + + * reg-stack.c (constrain_asm_operands): Set n_alternatives to zero if + no operands. + +Wed Apr 15 11:33:09 1998 Alexandre Petit-Bianco + + * tree.c (build_expr_wfl): Use NULL_TREE if the file name is NULL. + Propagate TREE_SIDE_EFFECTS and TREE_TYPE iff the encapsulated + node is non NULL. Cache last file name and file name identifier node. + +1998-04-15 Mark Mitchell + + * c-common.c (declare_hidden_char_array): Use TYPE_DOMAIN to get + the length of an array, not TREE_TYPE. + +Wed Apr 15 15:31:34 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (sbitmap_union_of_successors): New function. + * basic-block.h (sbitmap_union_of_successors): Declare it. + +Wed Apr 15 12:38:03 1998 Jim Wilson + + * configure.in (gnu_ld): Rename to gnu_ld_flag before main loop. + Set gnu_ld to gnu_ld_flag inside main loop. + (gas): Likewise. + +Wed Apr 15 14:50:05 1998 Dave Brolley + + * toplev.c (compile_file): Call init_parse using new interface. + (init_lex): Remove declaration. + + * c-lex.c (init_parse): Now returns char* containing filename. + +Wed Apr 15 12:37:10 1998 Jeffrey A Law (law@cygnus.com) + + * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing if not optimizing. + +Wed Apr 15 12:10:18 1998 Michael Meissner + + * Makefile.in (gen{config,flags,codes,emit}): Link in host print-rtl.o. + (gen{extract,peep,opinit,output}): Likewise. + + * gen{attr,codes,config,emit,output}.c (insn_attr_name): Provide a + global definition so print-rtl.o can be linked in. + * gen{peep,recog}.c (insn_attr_name): Likewise. + +Tue Apr 14 07:30:57 1998 K. Richard Pixley + + * fixincludes: Discard empty C++ comments, as found in sys/time.h + on hpux-11.0. + +Wed Apr 15 10:47:21 1998 Andreas Schwab + + * config/m68k/m68k.md (adddi3, subdi3): Optimize for constant + operand. + +Wed Apr 15 01:21:21 1998 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (operand_subword): Rework slightly to avoid + bogus warning from previous change. + +Tue Apr 14 23:39:13 1998 Richard Henderson + + * alpha.md: Revert Oct 27 change, as it is superseded by Kenner's + Nov 8 find_replacement change. Move decls of get_unaligned_address + * alpha.h: ... here. + +Tue Apr 14 22:00:39 1998 John Carr + + * function.c (assign_parms): Initialize unsignedp before passing + its pointer to promote_mode. + + * genattrtab.c (check_attr_test): Handle MATCH_INSN like MATCH_OPERAND. + (write_test_expr): Allow MATCH_INSN. + +Tue Apr 14 21:57:57 1998 Paul Eggert + + * install.texi: Update section on warnings that can be safely ignored. + +Tue Apr 14 14:55:16 1998 Jim Wilson + + * mips.md (reload_outdi): Change the scratch mode from DImode to + TImode. New variable scratch, used instead of operand[2] in template. + Add code for MIPS16 HILO_REGNUM case where output reg is not M16_REG_P. + +Tue Apr 14 16:19:03 1998 Michael Meissner + + * expr.c (MOVE_RATIO): Set to 3 if optimizing for space. + +Tue Apr 14 11:31:28 1998 Krister Walfridsson + + * i386/bsd386.h (ASM_OUTPUT_ALIGN): Redefine. + +Tue Apr 14 09:02:32 1998 Jeffrey A Law (law@cygnus.com) + + * svr4.h (ASM_DECLARE_OBJECT_NAME): Use HOST_WIDE_INT_PRINT_DEC. + (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * Idea and part of the patch from HJ. + * Makefile.in: auto-host.h renamed from auto-config.h. All references + changed. + (distclean): Remove auto-build.h too. + * configure.in: Rename host autoconf generated file to auto-host.h. + If host != build, then run autoconf to generate auto-build.h for + the build machine and include it in build_xm_files. + Check for wait.h and sys/wait.h. + + * combine.c (simplify_rtx, case TRUNCATE): Respect value of + TRULY_NOOP_TRUNCATION. + +Mon Apr 13 11:31:49 1998 Jason Merrill + + * tree.h (BINFO_OFFSET_ZEROP): Use integer_zerop. + +Sun Apr 12 20:55:32 1998 Catherine Moore + + * invoke.texi (ld options): Include memset requirements + for options -nodstdlib and -nodefaultlibs. + +1998-04-12 Paul Eggert + + This change is from an idea suggested by Arthur David Olson. + + * c-common.c (decl_attributes, record_function_format, + check_format_info, init_function_format_info): + Add support for strftime format checking. + (enum format_type): New type. + (record_function_format): Now static, and takes value of type + enum format_type instead of int. + (time_char_table): New constant. + (struct function_format_info): format_type member renamed from is_scan. + (check_format_info): Use `warning' rather than sprintf followed by + `warning', to avoid mishandling `%' in warnings. + Change `pedwarn' to `warning', since these warnings do not necessarily + mean the program does not conform to the C Standard, as the code + need not be executed. + + * c-tree.h (record_function_format): Remove decl; no longer extern. + + * extend.texi: Add documentation for strftime format checking. + +Sun Apr 12 20:23:03 1998 Jeffrey A Law (law@cygnus.com) + + * mips/ecoffl.h: Do not include mips.h. + * mips/elf.h: Likewise. + + * configure.in (mips-*-ecoff): Do not mention mips/mips.h in tm_files. + * mips/ecoff.h: Include "mips/mips.h". + +Sat Apr 11 22:42:54 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Apr 11 01:24:28 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (count_reg_usage): Correctly handle REG_NONNEG notes. + (delete_trivially_dead_insns): Renamed from delete_dead_from_cse. + * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns instead of delete_dead_from_cse. Also call delete_trivially_dead_insns + between loop optimization passes. + * rtl.h: Updated appropriately. + +Fri Apr 10 22:28:32 1998 Jeffrey A Law (law@cygnus.com) + + Reinstall this patch from Jason. + * function.c (push_function_context_to): Don't call init_emit. + +Fri Apr 10 13:40:20 1998 Nick Clifton + + * rtl.c (read_skip_spaces): Prevent infinite loops upon + encountering unterminated comments. + +Fri Apr 10 10:43:41 1998 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (operand_subword): Properly handle CONST_INTs for + 64x32 cross builds. + + * configure.in: Handle --with-fast-fixincludes. + (fixincludes): If --with-fast-fixincludes, then use a different + fixincludes program by default. + * Makefile.in (fixinc.sh): New rule. + +Fri Apr 10 00:36:31 1998 H.J. Lu (hjl@gnu.org) + + * i386.md (movqi+1): Handle invalid QI register. + (movsf_push-1): Likewise. + +Thu Apr 9 16:53:59 1998 Nick Clifton + + * config/m32r/m32r.c: call_address_operand(): Only accept symbolic + addresses. + symbolic_memort_operand(), call32_operand(), int8_operand(), + int16_operand(), uint24_operand(), reg_or_int8_operand(): Removed. + Not used. + uint16_operand(): Made static. + +Thu Apr 9 01:43:04 1998 Jeffrey A Law (law@cygnus.com) + + * calls.c (expand_call): Fix typo. + +Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com) + + * c-lex.c (finput): New global. + (init_parse): Always included. Handle !USE_CPPLIB using + code originally in compile_file. + (finish_parse): Update for CPPLIB. + * toplev.c (init_parse, finish_parse): Declare. + (finput): Delete variable. Now in front-ends. + (compile_file): Remove code which is now handled by init_parse + which is unconditionally called. Similarly for finish_parse. + +Wed Apr 8 23:13:50 1998 Gavin Koch + + * config/mips/r3900.h (ASM_OUTPUT_DEF,SUPPORTS_WEAK, + ASM_WEAKEN_LABEL): Add. + +Wed Apr 8 18:21:30 1998 Richard Henderson + + * alpha/crtbegin.asm, alpha/crtend.asm, alpha/t-crtb: New files. + * configure.in (alpha-*-linux*): Use them. + +Fri Apr 3 17:02:13 1998 Alexandre Petit-Bianco + + * tree.def (EXPR_WITH_FILE_LOCATION): New tree node definition. + * tree.h (EXPR_WFL_{NODE,FILENAME,FILENAME_NODE,LINENO, + COLNO,LINECOL,SET_LINECOL,EMIT_LINE_NOTE}): New macros. + (build_expr_wfl): New prototype declaration. + * tree.c (build_expr_wfl): New function, to build + EXPR_WITH_FILE_LOCATION nodes. + (copy_node): Don't zero TREE_CHAIN if copying a + EXPR_WITH_FILE_LOCATION node. + * print-tree.c (print_node): Handle EXPR_WITH_FILE_LOCATION. + * expr.c (expand_expr): Handle EXPR_WITH_FILE_LOCATION. + +Wed Apr 8 12:51:19 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (v850): Use t-v850. + (ix86-wrs-vxworks): Recognize 786 just like other x86 configurations. + + * protoize.c (creat, read, write): Do not declare. + + * jump.c (mark_jump_label): Record REG_LABEL notes for insns which + refer to the CODE_LABEL before a dispatch table. + + * invoke.texi: Add ARC options. + + * gcc.c (process_command): Improve error message for -o with + either -c or -S. + + * i386/x-cygwin32 (CLIB): Link in advapi32. + + * alpha.h (ASM_IDENTIFY_GCC): Define to nothing. + (ASM_IDENTIFY_LANGUAGE): Likewise. + + * i386.md (movqi recognizer): Don't perfom byte increment into + a NON_QI_REG_P. + + * configure.in (x86-dg-dgux): Run fixinc.dgux. + + * i370.h: Fix typo in GEN_INT changes. + + * bitmap.c (bitmap_element_allocate): Use "void" for arglist instead + of an empty arglist in prototype. + + * Makefile.in: Remove bytecode crud that crept back in after the + gcc2 merge. + +1998-04-08 Brendan Kehoe + + * c-lex.h (is_class_name): Fix arg type to be tree, not void. + (make_pointer_declarator, reinit_parse_for_function): Fix typo. + +Wed Apr 8 06:16:45 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (LEGITIMIZE_RELOAD_ADDRESS): Define. + +Wed Apr 8 00:44:18 1998 Bernd Schmidt (crux@pool.informatik.rwth-aachen.de> + + * c-lex.c (is_class_name): Delete declaration. + (whitespace_cr): Make static and add prototype. + * c-lex.h (make_pointer_declarator, reinit_parse_for_function, + yylex, get_directive_line): Turn declarations into prototypes. + (position_after_whitespace, check_newline, yyerror,, is_class_name, + forget_protocol_qualifiers, remember_protocol_qualifiers): Add + prototypes. + * genattr.c (extend_range, write_upcase, gen_attr, write_units): Add + prototypes. + * gencodes.c (gen_insn): Add prototype. + * genconfig.c (walk_insn, gen_insn, gen_expand, gen_split, + gen_peephole): Add prototypes. + * genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add + prototypes. + * gengenrtl.c (type_from_format, accessor_from_format, special_rtx, + special_format, find_formats, gendecl, genmacro, gendef, genlegend, + genheader, gencode): Add prototypes. + * genopinit.c (gen_insn): Add prototype. + * genoutput.c (output_prologue, output_epilogue, scan_operands, + process_template, validate_insn_alternatives, gen_insn, gen_peephole, + gen_expand, gen_split, n_occurrences): Add prototypes. + * genpeep.c (gen_peephole): Add prototype. + * loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop, + reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg, + labels_in_range_p, count_loop_regs_set, note_addr_stored, + loop_reg_used_before_p, scan_loop, replace_call_address, + skip_consec_insns, libcall_benefit, ignore_some_movables, + force_movables, combine_movables, rtx_equal_for_loop_p, move_movables, + strength_reduce, valid_initial_value_p, find_mem_givs, record_biv, + check_final_value, record_giv, update_giv_derive, basic_induction_var, + simplify_giv_expr, general_induction_var, consec_sets_giv, + check_dbra_loop, express_from, combine_givs_p, combine_givs, + product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1, + last_use_this_basic_block, record_initial, update_reg_last_use, + iteration_info, analyze_loop_iterations, insert_bct, + instrument_loop_bct, indirect_jump_in_function_p): Turn declarations + into prototypes. + +Tue Apr 7 21:48:52 1998 Jeffrey A Law (law@cygnus.com) + + * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Define. + +1998-04-07 Ken Raeburn + + * config/mips/mips.c (siginfo): Deleted. + (override_options): Don't install SIGINFO signal handler. + +Tue Apr 7 11:58:04 1998 Jim Wilson + + * loop.c (check_dbra_loop): When normalize comparison_val, add check + to verify it is non-negative. + +Tue Apr 7 02:01:47 1998 Richard Henderson + + * alpha.c (alpha_expand_block_move): Correctly collect block offsets. + (alpha_expand_block_clear): Likewise. + +Mon Apr 6 23:36:01 1998 Richard Henderson + + * tree.h (sizetype_tab): Fix previous change for K&R. + +Mon Apr 6 22:23:29 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Apr 6 23:16:10 1998 Richard Earnshaw (rearnsha@arm.com) + + * configure.in (sparc-*-solaris2*): Add xm-siglist.h to xm_file. + Add USG and POSIX to xm_defines. + +Mon Apr 6 21:49:57 1998 Bob Manson + + * gcc.c: Add linker spec. + (link_command_spec): Use %(linker) instead of ld. + (main): If collect2 is requested as the linker, see if it exists; + if not, use ld instead. + + * Makefile.in (USE_COLLECT2): It's named collect2 now, not ld. + (ld): Deleted. + (install-collect2): Install as collect2, not ld. + + * configure.in(will_use_collect2): It's named collect2 now. + + * collect2: Remove checks to see if we were invoked recursively. + (collect_execute): Use _spawnvp under cygwin32. + +Mon Apr 6 17:23:41 1998 Jim Wilson + + * haifa-sched.c (build_control_flow): Set unreachable for block whose + only predecessor is itself. + +Mon Apr 6 16:08:04 1998 Kaveh R. Ghazi + + * c-parse.in: Include system.h, and remove stuff now made redundant. + * cccp.c: Likewise. + * cexp.y: Likewise. + * protoize.c: Likewise. Properly check for cpp stringification. + + * Makefile.in (c-parse.o, cccp.o, cexp.o, protoize.o, unprotoize.o): + Depend on system.h. + + * objc/Make-lang.in (objc-parse.o): Likewise. + +Mon Apr 6 14:59:58 1998 Kaveh R. Ghazi + + * gansidecl.h: Check if compiler supports __attribute__. Provide + definitions for ATTRIBUTE_UNUSED and ATTRIBUTE_PRINTF using + __attribute__ when its available. Also provide definitions for + ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2 and ATTRIBUTE_PRINTF_3 in + terms of ATTRIBUTE_PRINTF. + + * genoutput.c (process_template): Use ATTRIBUTE_UNUSED in place + of __attribute__. + +Mon Apr 6 07:17:52 1998 Catherine Moore + + * combine.c (can_combine_p): Include successor in volatile test. + +Mon Apr 6 14:16:33 1998 J"orn Rennecke + + * sh.h (CASE_VECTOR_SHORTEN_MODE): Fix logic when to set + offset_unsigned. + +Mon Apr 6 02:03:29 1998 Jeffrey A Law (law@cygnus.com) + + * objc/objc-act.c (encode_aggregate_within): Avoid GNU extensions + in prototype and definition. + +Mon Apr 6 00:48:56 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Apr 6 00:08:50 1998 Richard Henderson + + * alpha.c (alpha_expand_block_clear): Add missing offset arg to + alpha_expand_unaligned_store_words. + +Sun Apr 5 21:31:24 1998 John Wehle (john@feith.com) + + * i386.md (movsf_push, movsf_mem): Remove. + (movsf_push): Rename from movsf_push_nomove and move in front of + movsf. Use nonmemory_operand predicate and don't bother checking + TARGET_MOVE. + (movsf_push_memory): New pattern. + (movsf): Don't bother checking for push_operand. If TARGET_MOVE and + both operands refer to memory then force operand[1] into a register. + (movsf_normal): Change to unnamed pattern. + Likewise for movdf, movxf, and friends. + +Sun Apr 5 18:45:51 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Apr 5 16:31:10 1998 Richard Henderson + + * configure.in (alpha-dec-osf*): Match osf1.3 correctly. + +Sun Apr 5 16:53:37 1998 Don Bowman + + * configure.in (mips-wrs-vxworks): New target. + +Sat Apr 4 23:34:32 1998 Jeff Law (law@cygnus.com) + + * expmed.c (synth_mult): The value -1, has no zeros, so it can + never have the form ...011. + + * version.c: Bump for snapshot. + +Sat Apr 4 20:16:46 1998 Richard Henderson + + * i386.c (asm_output_function_prefix, load_pic_register): + Use ASM_GENERATE_INTERNAL_LABEL properly. + (output_pic_addr_const): Recognize %X to suppress any PIC sym suffix. + (print_operand): Ignore it. + (load_pic_register): Use it for the got load call. + * i386.md (prologue_set_got, prologue_get_pc): Likewise. + (prologue_get_pc_and_set_got): Likewise. + * i386.h: Update print_operand docs. + +Sat Apr 4 19:08:37 1998 Richard Henderson + + * i386.md (ffssi, ffshi): Rewrite as define_expands. + (ffssi_1, ffshi_1): New (unspec [] 5) support patterns. + * i386.c (notice_update_cc): Recognize unspec 5. + +Sat Apr 4 18:07:16 1998 David Mosberger-Tang (davidm@mostang.com) + + * alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Accept '(' for s/sv/svi. + * alpha.c (print_operand): Handle it. + * alpha.md (fix_truncsfdi2): Use it. Add earlyclobber pattern + for ALPHA_TP_INSN. + (fix_truncdfdi2): Likewise. + +Sat Apr 4 17:42:05 1998 Richard Henderson + + * tree.h (sizetype_tab[2], sbitsizetype, ubitsizetype): Merge all + of these into a single struct, with additional [us]sizetype entries. + * stor-layout.c (set_sizetype): Initialize [us]sizetype. + * fold-const.c (size_int_wide): Don't rely on sizetype_tab being + an array. + +Sat Apr 4 17:04:41 1998 Richard Henderson + + * configure.in (alpha-*-linux-*): Undo tm_file changes from gcc2 merge. + +Sat Apr 4 13:50:01 1998 Richard Henderson + + * haifa-sched.c (split_block_insns): Don't suppress insn splitting + on subsequent passes. + + * alpha.c (hard_fp_register_operand): New function. + * alpha.h (PREDICATE_CODES): Add it. + * alpha.md (extendsidi2): Kill bogus f<-f cvtql+cvtlq case. Add an + f<-m case and accompanying define_split. + (trapb): Use a unique unspec_volatile number. + +Sat Apr 4 13:32:08 1998 Richard Henderson + + * configure.in (alpha-*-linux-gnu*): Undo Feb 3 change brought in + from gcc2 merge. + +Sat Apr 4 10:23:41 1998 Jeffrey A Law (law@cygnus.com) + + * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12 + for details. + + * haifa-sched.c: Mirror recent changes from gcc2. + +Fri Apr 3 00:17:01 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (insn*.o): Depend on system.h. + + * pa.c (output_global_address): Initialize base. + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Initialize index. + +1998-04-03 Mike Stump + + * gthr.h: Support systems that don't have weak, but have threads. + * configure.in (*wrs-vxworks*): Use VxWorks threads by default. + * gthr-vxworks.h: New file. + * objc/thr-vxworks.h: Dummy file from thr-single.c for now. + +Thu Apr 2 18:00:52 1998 Jim Wilson + + * i386.md (movqi+1): Change alternative 1 from *r/r to *r/*rn. + +1998-04-02 Vladimir N. Makarov + + * ginclude/va-i960.h (va_end): Change void * to void. + +Thu Apr 2 13:51:10 1998 Kaveh R. Ghazi + + * Makefile.in (choose-temp.o): Depend on system.h. + + * choose-temp.c: Include system.h when IN_GCC. + +Thu Apr 2 02:37:07 1998 Joern Rennecke (amylaar@cygnus.co.uk) + Richard Henderson + + * reload.c (find_reloads_address): Try LEGITIMIZE_RELOAD_ADDRESS. + (move_replacements): New function. + * reload.h: Prototype it. + + * alpha.h (LEGITIMIZE_RELOAD_ADDRESS): New definition. + +Thu Apr 2 01:01:34 1998 Richard Henderson + + * configure (alpha-*-linuxecoff, alpha-*-linux-gnulibc1): + Run fixincludes. + + * emit-rtl.c (gen_lowpart_common): Skip count by HARD_REGNO_NREGS. + (gen_highpart): Likewise. + * final.c (alter_subreg): Allow the target to hook by-mode subreg + hard register number changes. + +Wed Apr 1 22:26:22 1998 Jeffrey A Law (law@cygnus.com) + + * fold-const.c optimze_bit_field_compare): Initialize rnbitpos, + rnbitsize, rnmode and rinner. + (make_range): Initialize type. + (fold): Initialize arg0, arg1 and varop. + + * function.c (instantiate_virtual_regs_1): Initialize offset, regnoi + and regnor. + (expand_function_start): Initialize last_ptr. + + * stor-layout.c (layout_record): Initialize desired_align. + (get_best_mode): Initialize unit. + + * tree.c (copy_node): Initialize length. + + * c-lex.c (yylex): Initialize traditional_type, ansi_type and type. + + * caller-save.c (insert_save_restore): Initialize pat, code and + numregs. + + * emit-rtl.c (push_to_sequence): Initialize top. + (push_topmost_sequence): Likewise. + + * genattrtab.c (simplify_by_exploding): Initialize defval. + + * profile.c (branch_prob): Initialize dest. + + * rtl.h (note_stores): Remove duplicate prototype. + (GEN_INT): Reinstate cast of second arg to HOST_WIDE_INT. + + * cplus-dem.c (gnu_special): Don't get confused by . + strings that are not actually lengths. + + * genattrtab.c: Make generated file use system.h, instead of + including stdio.h, etc directly. + * genextract.c, genopinit.c, genoutput.c: Likewise. + * genpeep.c, genrecog.c: Likewise. + + * genoutput.c (process_template): Mark operands in the generated + function as potentially unused if compiling with GNU CC. + + * i386/freebsd-elf.h (CPP_PREDEFINES): Update from FreeBSD folks. + + * pa.md (reload peepholes): Remove unused variable "mode". + +Wed Apr 1 17:06:19 1998 Nick Clifton + + * config/arm/thumb.h: Add super interworking support. + * config/arm/thumb.c: Add super interworking support. + * config/arm/thumb.md: Add super interworking support. + * config/arm/lib1funcs.asm: Add interworking support. + * config/arm/lib1thumb.asm: Add super interworking support. + * config/arm/t-semi: Add interworking support. + * config/arm/t-thumb: Add interworking support. + * config/arm/README-interworking: New file. + +Wed Apr 1 14:38:10 1998 Jim Wilson + + * config/mips/iris6.h (MD_EXEC_PREFIX): Set to /usr/bin/. + (MD_STARTFILE_PREFIX): Unset. + +1998-04-01 Mark Mitchell + + * varasm.c (make_decl_rtl): Update the DECL_ASSEMBLER_NAME for a + entity in a local scope. + + * fold-const.c (fold): Call truthvalue_conversion for values which + are folded to boolean type. + +Wed Apr 1 06:09:53 1998 Jeffrey A Law (law@cygnus.com) + + * 1750a.md, arm.c, clipper.c, clipper.md: Use GEN_INT consistently. + * convex.h, dsp16xx.c, fx80.md, gmicro.c, gmicro.md: Likewise. + * i370.h, i370.md, i860.c, i860.h, i860.md, i960.c: Likewise. + * i960.h, i960.md, m32r.md, m68k.md, m68kv4.h, m88k.c: Likewise. + * m88k.md, ns32k.c, ns32k.md, pdp11.c, pdp11.h, pdp11.md: Likewise. + * pyr.c, pyr.h, pyr.md, romp.c, romp.h, romp.md: Likewise. + * rs6000.md, sparc.c, sparc.h, sparc.md, spur.c, spur.md: Likewise. + * tahoe.md, vax.h, vax.md, we32k.c, we32k.h, we32k.md: Likewise. + * md.texi: Likewise. + +Wed Apr 1 08:33:44 1998 Manfred Hollstein + + * fixincludes (limits.h): Fix nested comments in Motorola's + limits.h and sys/limits.h. + +Tue Mar 31 16:57:33 1998 Jim Wilson + + * alpha.c (alpha_expand_unaligned_load): Use tgt instead of addr + as dest of expand_binop call. + + * alpha.md (extzv): Correct check for valid operand[2] values. + + * profile.c (branch_prob): Add code to recognize HPPA tablejump entry + branch. + + * toplev.c (rest_of__compilation): Call init_recog_no_volatile at end. + +Mon Mar 30 13:11:05 1998 Stan Cox + + * libgcc2.c (__main, __do_global_dtors, __do_global_ctors): + For __CYGWIN32__ use the versions in winsup/dcrt0.cc. + + * gcc.c, cccp.c, cpplib.c, collect2.c (GET_ENVIRONMENT): Added. + cygwin32 can override this to allow both unix and win32 style PATHs. + + * i386/xm-cygwin32.h (GET_ENVIRONMENT): Defined to allow win32 + style environment paths. + +Mon Mar 30 14:43:20 1998 Kaveh R. Ghazi + + * Makefile.in (cppalloc.o, cpperror.o, cppexp.o, cpphash.o, + cpplib.o, cppmain.o, fix-header.o, gcov.o, gen-protos.o, + gengenrtl.o, halfpic.o, hash.o, scan-decls.o, scan.o): Depend on + system.h. + + * cpphash.c: Include config.h. + * cppalloc.c: Include system.h. Add parameters to various + function prototypes. + * cpperror.c: Likewise. + * cppexp.c: Likewise. + * cpphash.c: Likewise. + * cpplib.c: Likewise. + * cppmain.c: Likewise. + * fix-header.c: Likewise. + * gcov.c: Likewise. + * gen-protos.c: Likewise. + * gengenrtl.c: Likewise. + * halfpic.c: Likewise. + * hash.c: Likewise. + * scan-decls.c: Likewise. + * scan.c: Likewise. + +Mon Mar 30 11:06:45 1998 Jim Wilson + + * README.gnat: Add lang_print_xnode definition. + +Mon Mar 30 11:12:24 1998 Andreas Schwab + + * config/m68k/m68k.c (standard_68881_constant_p): Don't use + fmovecr on the 68060. + +Mon Mar 30 00:21:03 1998 Jeffrey A Law (law@cygnus.com) + + * genemit.c (DONE): Rework so that it works in the true arm if + an if-else conditional. + (FAIL): Likewise. + +Sun Mar 29 12:45:23 1998 Jeffrey A Law (law@cygnus.com) + + * rs6000.c: Do not include stdioh or ctype.h anymore. + + * Makefile.in (c-typeck.o): Delete on expr.h, insn-codes.h and + $(RTL_H). + (stor-layout.o): Likewise. + * c-typeck.c: Include rtl.h and expr.h. + * stor-layout.c: Likewise. + + * cpplib.c (cpp_file_line_for_message): Delete unused parameter. + All callers changed. + (do_sccs): Wrap in an SCCS_DIRECTIVE ifdef. + * fix-header.c (cpp_file_line_for_message): Delete unused parameter. + All callers changed. + + * collect2.c (is_in_list): Wrap inside COLLECT_EXPORT_LIST ifdef. + + * local-alloc.c (reg_classes_overlap_p): Delete dead function. + + * tree.h (lang_print_xnode): Provide prototype. + +Sat Mar 28 23:50:44 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Mar 29 00:42:21 1998 Jeffrey A Law (law@cygnus.com) + + * objc/sendmsg.c (__objc_block_forward): Add braces for return + value if INVISIBLE_STRUCT_RETURN. + + * pa.c (arith_double_operand): Fix parens. + + * haifa-sched.c (print_pattern): Correct arg to sprintf. + + * Makefile.in (libgcc1.null): Make return type for __foo void. + +Sat Mar 28 14:37:20 1998 Jeffrey A Law (law@cygnus.com) + + * pa.h: Add declarations for many functions defined in pa.c. + + * genpeep.c (main): Remove unused variable 'i' from the generated + file. + + * genemit.c (gen_expand): Do not emit "_done" or "_fail" labels. + (gen_split): Likewise. + (main): Rework generated definitions of DONE and FAIL so that they + no longer use gotos. Avoids warnings about unused labels. + + * integrate.c (copy_rtx_and_substitute): Rework to avoid need for + unused "junk" variable. + + * genattrtab.c (write_complex_function): Add a default case in + generated switch statement to keep -W -Wall quiet. + +Sat Mar 28 10:47:21 1998 Nick Clifton + + * invoke.texi: Document more ARM and Thumb command line options. + + * config/arm/xm-thumb.h: New file. + +Sat Mar 28 01:37:33 1998 Craig Burley + + * stmt.c (expand_expr_stmt): Must generate code for + statements within an expression (gcc's `({ ... )}') + even if -fsyntax-only. + +Sat Mar 28 01:06:12 1998 Bernd Schmidt + Jeffrey A Law (law@cygnus.com) + + * basic-block.h (basic_block_computed_jump_target): Declare. + * flags.h (current_function_has_computed_jump): Declare. + * flow.c (basic_block_computed_jump_target): Define. + (flow_analysis): Allocate it. Set current_function_has_computed_jump + to 0. + (find_basic_blocks): Set current_function_has_computed_jump and + elements of basic_block_computed_jump_target to 1 as appropriate. + * function.c (current_function_has_computed_jump): Define. + * global.c (global_conflicts): Don't allocate pseudos into stack regs + at the start of a block that is reachable by a computed jump. + * reg-stack.c (stack_reg_life_analysis): If must restart, do so + immediately. + (subst_stack_regs): Undo change from Sep 4 1997. + (uses_reg_or_mem): Now unused, deleted. + * stupid.c (stupid_life_analysis): Compute + current_function_has_computed_jump. + (stupid_find_reg): Don't allocate stack regs if the function has a + computed goto. + * haifa-sched.c (is_cfg_nonregular): Delete code to determine if + the current function has a computed jump. Use the global value + instead. + +Sat Mar 28 00:21:37 1998 Jeffrey A Law (law@cygnus.com) + + * i386/freebsd.h (CPP_PREDEFINES): Remove __386BSD__. + (DWARF2_UNWIND_INFO): Define to zero. + +Fri Mar 27 16:04:49 1998 Michael Meissner + + * gcc.c (set_std_prefix): Add declaration. + (process_command): If GCC_EXEC_PREFIX is set, remove /lib/gcc-lib/ + suffix, and update the standard prefix prefix.c uses. + + * prefix.c (std_prefix): New global to hold default prefix value. + (get_key_value): Change to use std_prefix instead of PREFIX. + (translate_name): Likewise. + (update_path): Likewise. + (get_key_value): Release allocated scratch storage. + (set_std_prefix): New function to reset the standard prefix. + +Fri Mar 27 18:08:21 1998 J"orn Rennecke + + * sh.c (find_barrier): Fix calculations for alignment increase. + +Fri Mar 27 08:56:52 1998 Manfred Hollstein + + * Makefile.in (stmp-fixinc): If we're actually fixing include + files, copy gcc's assert.h into the fixed include dir. + * fixincludes (assert.h): Avoid any attempts to fix a probably + broken system specific assert.h file. + * fixproto (stdlib.h): Make sure, it'll contain a definition of + size_t. + +Fri Mar 27 00:49:46 1998 Jeffrey A Law (law@cygnus.com) + + * regclass.c (reg_scan_mark_refs): Be more selective about + when we mark a register with REGNO_POINTER_FLAG. + +Thu Mar 26 23:00:11 1998 J"orn Rennecke + + reload inheritance improvement: + * reload1.c (reg_reloaded_contents, reg_reloaded_insn): + Change meaning: index is now hard reg number. + (reg_reloaded_valid, reg_reloaded_dead): New variables. + (reload_spill_index): Content is now a hard reg number. + (reload_as_needed): Change to fit new variable meaning. + (forget_old_reloads_1, allocate_reload_reg): Likewise. + (choose_reload_regs, emit_reload_insns): Likewise. + +Thu Mar 26 18:34:13 1998 J"orn Rennecke + + * regclass.c (record_reg_classes): '?' increases cost by two. + + * reload.c (find_reloads): Double previous costs. Output + reloads cost one unit extra. + + * reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that + boiled down to && ! 0. + + * reload.c (find_equiv_reg): Also consider a goal offset from the + frame pointer to be constant. + +Thu Mar 26 17:34:46 1998 J"orn Rennecke + + * sh.h (OPTIMIZATION_OPTIONS): Define. + +Thu Mar 26 00:19:47 1998 Richard Henderson + + * combine.c (make_compound_operation): Simplify (subreg (*_extend) 0). + +Wed Mar 25 23:53:11 1998 Jeffrey A Law (law@cygnus.com) + + * pa.c (pa_adjust_cost): Avoid redundant calls to get_attr_type. + +Wed Mar 25 13:40:48 1998 Jim Wilson + + * c-common.c (check_format_info): Initialize type, is_type. New local + integral_format. Don't warn for 'L' when pedantic. Do warn for 'L' + when pedantic if used with integral format specifier. + +Wed Mar 25 16:09:01 1998 Michael Meissner + + * rs6000.h (FUNCTION_ARG_PADDING): Cast result to be enum + direction. + (function_arg_padding): Declare. + + * rs6000.c: Include system.h. + (function_arg_padding): Change return type to int, cast enum's to + int. + + (From Kaveh R. Ghazi ) + * collect2.c (scan_prog_file): Add explicit braces to avoid + ambiguous `else'. + + * dbxout.c (dbxout_type_fields): Add braces around empty body in + an if-statement. + (dbxout_type): Likewise. + + * rs6000.c (rs6000_override_options): Change type of `i', `j' and + `ptt_size' from int to size_t. + (rs6000_file_start): Likewise for `i'. + (rs6000_replace_regno): Add default case in enumeration switch. + (output_epilog): Remove unused variable `i'. + (rs6000_longcall_ref): Remove unused variables `len', `p', `reg1' + and `reg2'. + + * rs6000.h (ADDITIONAL_REGISTER_NAMES): Add missing braces around + initializer. + (get_issue_rate, non_logical_cint_operand): Add prototype. + (rs6000_output_load_toc_table): Likewise. + + * rs6000.md (udivmodsi4): Add explicit braces to avoid ambiguous + `else'. + +Wed Mar 25 10:05:19 1998 Nick Clifton + + * config/arm/thumb.c: New File. Support for ARM's Thumb + instruction set. + * config/arm/thumb.h: New File. Thumb definitions. + * config/arm/thumb.md: New File. Thumb machine description. + * config/arm/tcoff.h: New File. Thumb COFF support. + * config/arm/t-thumb: New File. Thumb makefile fragment. + * config/arm/lib1thumb.asm: New File. Thumb libgcc support functions. + + * configure.in: Add Thumb-coff target. + * configure: Add Thumb-coff target. + * config.sub: Add Thumb-coff target. + +Wed Mar 25 10:30:32 1998 Jim Wilson + + * loop.c (scan_loop): Initialize move_insn_first to zero. + +Wed Mar 25 01:06:49 1998 Joel Sherrill (joel@OARcorp.com) + + * config/i386/go32-rtems.h: Defined TARGET_MEM_FUNCTIONS. + * config/i386/rtems.h: Likewise. + * config/i960/rtems.h: Likewise. + * config/m68k/rtems.h: Likewise. + * config/mips/rtems64.h: Likewise. + * config/pa/rtems.h: Likewise. + * config/rs6000/rtems.h: Likewise. + * config/sh/rtems.h: Likewise. + * config/sparc/rtems.h: Likewise. + +Wed Mar 25 00:57:26 1998 Richard Kenner + + * pa.c (emit_move_sequence): If in reload, call find_replacement. + +Tue Mar 24 10:44:11 1998 Nick Clifton + + * Makefile.in (gcov$(exeext)): Support .exe extension to gcov. + + * collect2.c (find_a_file): Add debugging. + (find_a_file): Test for win32 style absolute paths if + DIR_SERPARATOR is defined. + (prefix_from_string): Add debugging. + (main): Test for debug command line switch at start of program + execution. + (main): Use GET_ENVIRONMENT rather than getenv(). + (prefix_from_env): Use GET_ENVIRONMENT. + +1998-03-24 Mark Mitchell + + * cplus-dem.c (optable): Add sizeof. + (demangle_template_value_parm): New function containing code + previously found in demangle_template. + (demangle_integral_value): New function which handles complicated + integral expressions. + (demangle_template): Use them. + +Tue Mar 24 12:13:18 1998 Kaveh R. Ghazi + + * Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o, + genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o, + genattrtab.o, genoutput.o): Depend on system.h. + + * genattr.c: Include system.h. Add arguments to various function + prototypes. Remove redundant prototype of read_rtx(). + * genattrtab.c: Likewise. + * gencodes.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + +1998-03-24 Martin von Loewis + + * c-lang.c (lang_print_xnode): New function. + * objc/objc-act.c (lang_print_xnode): Likewise. + * print-tree.c (print_node): Call it + +Mon Mar 23 23:59:11 1998 H.J. Lu (hjl@gnu.org) + + * c-parse.in: Recognize protocol qualifiers in class + definitions for objc. + Include "output.h". + (yyerror): Remove redundant decl. + (yyprint): Fix prototype. + +Mon Mar 23 23:49:47 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (rtx_cost): Only call CONST_COSTS if it is defined. + + * stmt.c (unroll_block_trees): Free block_vector if needed. + +Mon Mar 23 23:26:42 1998 Philippe De Muyter + + * m68k/m68k.md (zero_extendqidi2, zero_extendhidi2): New patterns. + (zero_extendsidi2): Avoid useless copy. + (iordi_zext): New pattern. + (iorsi_zexthi_ashl16): Pattern reworked to avoid "0" constraint for + operand 2. + (iorsi_zext): New name for old unnamed pattern; indentation fixes. + + * m68k/m68k.md (ashldi_const): Allow shift count in range ]32,63]. + (ashldi3): Allow constant shift count in range ]32,63]. + (ashrdi_const, ashrid3, lshrdi_const, lshrdi3): Likewise. + +1998-03-22 Mark Mitchell + + * tree.h (IS_EXPR_CODE_CLASS): New macro. + +Mon Mar 23 23:18:48 1998 Jeffrey A Law (law@cygnus.com) + + * h8300.h (CONST_COSTS): Remove definition. + (DEFAULT_RTX_COSTS): Define. + +Mon Mar 23 22:58:22 1998 Joel Sherrill (joel@OARcorp.com) + + * config/sh/rtems.h: Switched from ELF to COFF. + +Mon Mar 23 14:14:20 1998 J"orn Rennecke + + * freebsd.h (ASM_OUTPUT_ALIGN): Redefine. + +Sat Mar 21 23:52:56 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Mar 22 00:50:42 1998 Nick Clifton + Geoff Noer + + * Makefile.in: Various fixes for building cygwin32 native toolchains. + + * objc/Makefile.in: Various fixes for building cygwin32 native toolchains. + * objc/Make-lang.in: Likewise. + + * config/i386/xm-cygwin32.h (PATH_SEPARATOR): Set to a semi-colon. + +Sun Mar 22 00:21:46 1998 R. Ganesan + + * configure.in: Handle with-PACKAGE=no correctly + +Fri Mar 20 17:36:23 1998 Kaveh R. Ghazi + + * Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o, + c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o, + caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o, + dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o, + expr.o, final.o, flow.o, function.o, getpwd.o, global.o, + integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o, + prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o, + reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o, + rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o, + tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend + on system.h. + + * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c, + c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c, + caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c, + dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c, + expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c, + integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c, + prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c, + reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c, + rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c, + stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c, + xcoffout.c: Include system.h. Organize include ordering so + that stdarg/varargs comes before other system headers. Remove + spurious casts of functions assured of a prototype in system.h. + +Fri Mar 20 11:19:40 1998 Stan Cox + + * reg-stack.c (pop_stack): Define. Pops any register on the + regstack and adjusts regstack. + (compare_for_stack_reg): Use pop_stack. + +Thu Mar 19 23:51:01 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa1.0-hp-hpux10): Handle threads for this + config too. + +Thu Mar 19 20:30:31 1998 Philippe De Muyter + + * libgcc2.c (exit): Do not call __bb_exit_func if HAVE_ATEXIT. + + * fold-const.c (fold): Replace sign-extension of a zero extended + value by a single zero extension. + +Thu Mar 19 00:58:07 1998 Jason Merrill + + * except.c (init_eh): Do nothing. + (save_eh_status): Call init_eh_for_function, not init_eh. + * function.c (push_function_context_to): Don't call init_emit. + +Thu Mar 19 13:39:52 1998 Michael Meissner + + * rs6000/sysv4.h (RELATIVE_PREFIX_NOT_LINKDIR): Undef for System V + and EABI. + +Thu Mar 19 10:10:36 1998 Kaveh R. Ghazi + + * final.c (shorten_branches): Add parentheses around +/- in + operand of &. + + * flow.c (life_analysis): Wrap variable `i' in macro ELIMINABLE_REGS. + +Thu Mar 19 09:15:17 1998 Manfred Hollstein + + * regclass.c (memory_move_secondary_cost): Wrap uses of + SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS + with #ifdef tests. + +Thu Mar 19 09:06:35 1998 Manfred Hollstein + + * config/m68k/m68k.md (addqi3): Fix typo gen_INT vs. GEN_INT. + + * flow.c (life_analysis): #include to make sure + size_t is defined. + * cplus-dem.c (demangle_function_name): Likewise. + +Thu Mar 19 09:00:01 1998 Manfred Hollstein + + * final.c (insn_noperands): Change type to unsigned int. + (final_scan_insn): Likewise for noperands; + properly check operand number boundaries. + +Wed Mar 18 16:20:30 1998 Richard Henderson + + * alpha.md (extzv): Don't reject register operands. Fix + mode of operand 1. + +Wed Mar 18 16:14:23 1998 Richard Henderson + + * dbxout.c (dbxout_function_end): Fix last change. The correct + predicate is ASM_OUTPUT_SECTION_NAME. + +Wed Mar 18 12:43:20 1998 Jim Wilson + + * sh.md (ashlsi_c-1): Delete 3rd argument to gen_ashlsi_c. + (ashlsi): Use match_dup 1 instead of match_operand 2. + +Wed Mar 18 13:46:07 1998 Richard Kenner + + * fold-const.c (operand_equal_for_comparison_p): See if equal + when nop conversions are removed. + +Wed Mar 18 13:42:01 1998 Richard Kenner + + * expr.c (expand_expr, case COND_EXPR): If have conditional move, + don't use ORIGINAL_TARGET unless REG. + +Wed Mar 18 16:53:19 1998 J"orn Rennecke + + * netbsd.h (ASM_OUTPUT_ALIGN): Redefine. + +Wed Mar 18 12:43:20 1998 Jim Wilson + + * loop.c (struct movable): New field move_insn_first. + (scan_loop): In consec sets code, set it. Clear it otherwise. + (move_movables): In consec sets code, use it. Copy REG_NOTES from + p to i1 only if i1 does not have REG_NOTES. Delete obsolete ifdefed + out code. + +Wed Mar 18 09:52:56 1998 Richard Henderson + + * rtl.c (read_rtx): Fall back on homebrew atoll if HOST_WIDE_INT + is large, and the system doesn't provide atoll or atoq. + (atoll): New. + + * alpha/xm-vms.h (HAVE_ATOLL): Define. + Reported by Klaus Kaempf . + +Wed Mar 18 09:56:26 1998 Kaveh R. Ghazi + + * c-lang.c (finish_file): Wrap variable `void_list_node' with macro + test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR. + + * calls.c (emit_call_1): Wrap variable `already_popped' with macro + test !ACCUMULATE_OUTGOING_ARGS. + + * collect2.c (write_c_file_glob): Wrap function definition in + macro test !LD_INIT_SWITCH. + + * combine.c (try_combine): Wrap variables `cc_use' and + `compare_mode' in macro test EXTRA_CC_MODES. + + * cpplib.c (do_ident): Remove unused variable `len'. + (skip_if_group): Remove unused variables `at_beg_of_line' and + `after_ident'. + (cpp_get_token): Remove unused variable `dummy'. + + * dbxout.c (scope_labelno): Move static variable definition inside + the one function scope where it is used. + (dbxout_function_end): Wrap prototype and definition in + macro test !NO_DBX_FUNCTION_END. + + * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number' + in macro test !MIPS_DEBUGGING_INFO. + + * expr.c (expand_builtin_setjmp): Move declaration of variable `i' + into the scope where it is used. Wrap empty else-statement body + in braces. + + * fix-header.c: Fix typo in comment. + (inf_skip_spaces): Cast results of INF_UNGET to (void). + (check_protection, main): Likewise. + + * flow.c (find_basic_blocks_1): Remove dangling comment text. + + * function.c (contains): Wrap prototype and definition in macro + test HAVE_prologue || HAVE_epilogue. + (fixup_var_refs_1): Remove unused variable `width'. + + * gen-protos.c (main): Remove unused variable `optr'. + + * haifa-sched.c (debug_control_flow): Remove unused variable `j'. + + * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0. + (__sjpopnthrow): Remove unused variable `jmpbuf'. + (__throw): Remove unused variable `val'. + + * protoize.c: Check for a previously existing definition before + defining *_OK macros. + + * scan-decls.c (scan_decls): Remove unused variable `old_written'. + +Tue Mar 17 00:45:48 1998 J"orn Rennecke + + * vax.h (ADDR_VEC_ALIGN): Define. + +Mon Mar 16 15:57:17 1998 Michael Meissner + + * gcc.c (default_arg): Don't wander off the end of allocated + memory. + + (From Geoffrey Keating ) + * rs6000.c (small_data_operand): Ensure that any address + referenced relative to the small data area is inside the SDA. + +Mon Mar 16 12:55:15 1998 Jim Wilson + + * config/m68k/netbsd.h (ASM_SPEC): Add %{m68060}. + +Mon Mar 16 15:50:20 1998 Andrew MacLeod + + * except.h (in_same_eh_region): New prototype. + (free_insn_eh_region, init_insn_eh_region): New prototypes. + * except.c (insn_eh_region, maximum_uid): New static variables. + (set_insn_eh_region): New static function to set region numbers. + (free_insn_eh_region): New function to free EH region table. + (init_insn_eh_region): New function to initialize EH region table. + (in_same_eh_region): New function used to determine if two rtl + instructions are in the same exception region or not. + * final.c (final): Initialize the table indicating which instructions + belong in which exception region. + * genpeep.c (main): Add "except.h" to include file list in generated + file insn-peep.c. + * config/sparc/sparc.md: Add calls to 'in_same_eh_region' in 4 + peepholes involving calls and unconditional branches. + +Mon Mar 16 11:16:50 1998 Jim Wilson + + * README.gnat: New file. + +Mon Mar 16 11:14:20 1998 Andreas Schwab + + * config/m68k/m68k.c: Include for atoi. Include + "recog.h" for offsettable_memref_p. + (legitimize_pic_address): Remove unused variable `offset'. + (notice_update_cc): Change return type to void. Add default label + to switch. + (standard_68881_constant_p): Remove unused variable mode. + (print_operand): Define local variable i only if SUPPORT_SUN_FPA. + (const_int_cost): Explicitly declare as returning int. + (output_dbcc_and_branch): Change return type to void. + + * config/m68k/linux.h, config/m68k/m68k.md, config/m68k/m68k.c, + config/m68k/m68k.h: Replace gen_rtx (XXX, ...) with gen_rtx_XXX + (...). Use GEN_INT instead of gen_rtx_CONST_INT. + +Sun Mar 15 22:30:44 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Fri Mar 13 11:30:12 1998 Andreas Schwab + + * config/m68k/m68k.h (CONST_OK_FOR_LETTER_P): Fix logic in range + check for 'M' constraint. + +Thu Mar 12 14:47:14 1998 Jim Wilson + + * cccp.c (create_definition): If pedantic, call pedwarn for macro + varargs feature. + +Thu Mar 12 13:43:25 1998 Bernd Schmidt + + * i386.c (ix86_logical_operator): New function. + (split_di): Ensure that when a MEM is split, the resulting MEMs have + SImode. + * i386.md (anddi3, xordi3, iordi3): New patterns. Add a define_split + to implement them. + +Thu Mar 12 15:13:16 1998 Kaveh R. Ghazi + Richard Earnshaw + Nick Clifton + + * tm.texi (DEFAULT_RTX_COSTS): Document new macro. + + * arm.h (DEFAULT_RTX_COSTS): Define instead of RTX_COSTS. + + * cse.c (rtx_cost): Provide a default case in an enumeration + switch, and call DEFAULT_RTX_COSTS if it's defined. + +Thu Mar 12 10:02:38 1998 Manfred Hollstein + + * basic-block.h (compute_preds_succs): Change return type in + prototype to void. + * flow.c (compute_preds_succs): Likewise in function definition. + + * regmove.c (find_matches): Cast char used as array index to unsigned char + to suppress warning. + +Thu Mar 12 09:39:40 1998 Manfred Hollstein + + * i386.h (RTX_COSTS): Insert braces around nested if. + (ADDITIONAL_REGISTER_NAMES): Insert braces around structured + elements. + + * gcc.c (default_compilers): Properly put brackets around array elements in + initializer. + + * getopt.c (_getopt_internal): Add explicit braces around nested if; + reformatted. + + * reg-stack.c (record_asm_reg_life): Add explicit braces around nested if's. + (record_reg_life_pat): Add explicit parens around && and || in expression. + (stack_reg_life_analysis): Add parens around assignment used as expression. + (convert_regs): Likewise. + +Thu Mar 12 09:25:29 1998 Manfred Hollstein + + * bitmap.c (bitmap_element_allocate): Remove unused parameter; + change callers accordingly. + + * cplus-dem.c (arm_special): Remove unused parameter work in prototype + and definition; change all callers accordingly. + + * except.c (init_eh): Avoid assignment of unused return value of + build_pointer_type; cast it to void, instead, and remove unused + variable type. + + * gcc.c (lang_specific_driver): Define prototype only #ifdef + LANG_SPECIFIC_DRIVER. + (temp_names): Define only #ifdef MKTEMP_EACH_FILE. + + * genoutput.c (output_epilogue): Initialize next_name to 0. + + * real.c (efrexp): #if 0 prototype and function definition. + (eremain): Likewise. + (uditoe): Likewise. + (ditoe): Likewise. + (etoudi): Likewise. + (etodi): Likewise. + (esqrt): Likewise. + + * reload.c (push_secondary_reload): Define prototype only + #ifdef HAVE_SECONDARY_RELOADS. + + * varasm.c (assemble_static_space): Define rounded only + #ifndef ASM_OUTPUT_ALIGNED_LOCAL. + +Thu Mar 12 09:11:35 1998 Manfred Hollstein + + * i386.md (andsi): Add default case in enumeration switch. + (iorsi3): Likewise. + (iorhi3): Likewise. + (xorsi3): Likewise. + +Thu Mar 12 08:37:02 1998 Manfred Hollstein + + * c-decl (finish_struct): Change type of min_align to unsigned. + + * cplus-dem.c (demangle_function_name): Change type of variable i to size_t; + remove unused variable len. + + * dwarf2out.c (reg_save): Add explicit cast of -1 to unsigned and a + comment indicating this is proper behavior. + (reg_loc_descriptor): Remove redundant comparison of unsigned variable + reg >= 0. + (based_loc_descr): Likewise. + + * enquire.c (bitpattern): Change type of variable i to unsigned. + + * final.c (output_asm_insn): Don't cast insn_noperands to unsigned. + + * flow.c (life_analysis): Change type of variable i to size_t; + remove unused variable insn. + + * gcc.c (translate_options): Change type of variables optlen, arglen and + complen to size_t. + (input_filename_length): Change type to size_t. + (do_spec_1): Change type of variable bufsize to size_t. + (main): Change type of variables i and j to size_t; + remove subblock local definition of variable i. + (lookup_compiler): Change type of second argument to size_t; + change type of variable i to size_t. + + * genemit.c (output_init_mov_optab): Change type of variable i to size_t. + + * genopinit.c (get_insn): Change type of variable pindex to size_t. + + * genrecog.c (add_to_sequence): Change type of variable i to size_t. + + * global.c (global_alloc): Change type of variable i to size_t. + + * regclass.c (init_reg_sets): Change type of variables i and j to unsigned. + + * stmt.c (expand_end_bindings): Change type of variable i to size_t. + (expand_end_case): Change type of variable count to size_t. + + * toplev.c (main): Change type of variable j to size_t. + (set_target_switch): Change type of variable j to size_t. + (print_switch_values): Change type of variable j to size_t; + remove unused variable flags. + + * varasm.c (assemble_variable): Change type of variable align to size_t. + (const_hash_rtx): Change type of variable i to size_t. + +1998-03-11 Mark Mitchell + + * dbxout.c (dbxout_type_methods): Only treat TYPE_METHODS as a + TREE_VEC if that's what it really is. + +Wed Mar 11 15:16:01 1998 Michael Meissner + + * {haifa-,}sched.c (rank_for_schedule): Only take void * arguments + as per ISO C spec. + +Wed Mar 11 12:05:20 1998 Teemu Torma + + * gthr.h: Changed the comment about return values. + * gthr-solaris.h (__gthread_once): Do not use errno; return the + error number instead of -1. + (__gthread_key_create): Any nonzero return value is an error. + * libgcc2.c (eh_context_initialize): Check for nonzero return + value from __gthread_once. + Check that the value of get_eh_context was really changed. + +Wed Mar 11 18:26:25 1998 J"orn Rennecke + + * sh.h (LOOP_ALIGN): Only align when optimizing. + * sh.c (find_barrier): Clear inc for CODE_LABELs. + When not optimizing, calculate alignment for BARRIERs directly. + +Wed Mar 11 15:07:18 1998 J"orn Rennecke + + * final.c (shorten_branches): Remove conditionalizing on + SHORTEN_WITH_ADJUST_INSN_LENGTH. + * sh.h, pa.h (SHORTEN_WITH_ADJUST_INSN_LENGTH): Remove. + +Wed Mar 11 02:37:41 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_basic_blocks_1): Keep the cfg accurate when removing + an unconditional jump around deleted blocks. + +Mon Mar 9 12:02:23 1998 Jim Wilson + + * profile.c (branch_prob): If see computed goto, call fatal instead of + abort. + + * config/mips/sni-svr4.h (CPP_PREDEFINE): Add -DSNI and -Dsinix. + + * configure.in (alpha-dec-osf): Add default case for osf* to switch. + Patch from Bruno Haible. + + * function.c (put_reg_into_stack): Copy MEM_IN_STRUCT_P from new. + (assign_parms): Set aggregate if hide_last_arg and last_named. + +Mon Mar 9 19:57:56 1998 J"orn Rennecke + + * final.c (shorten_branches): Initialize insn_addresses. + +Mon Mar 9 14:10:23 1998 J"orn Rennecke + + * sh.h (MUST_PASS_IN_STACK): Define. + +Sun Mar 8 13:01:56 1998 Jeffrey A Law (law@cygnus.com) + + * final.c (shorten_branches): Fix minor logic error in + ADDR_DIFF_VEC shortening support. + +Sun Mar 8 02:17:42 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Mar 7 00:54:15 1998 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (is_cfg_nonregular): Change return type to + an int. No longer compute "estimated" number of edges. Use + computed_jump_p instead of duplicating the code. Fixup/add + some comments. + (build_control_flow): Returns a value indicating an irregularity + in the cfg was detected. Count the number of edges in the cfg. + allocate various edge tables. + (find_rgns): No longer look for unreachable blocks. + (schedule_insns): Do not allocate memory for edge tables here. + Free memory for edge tables before returning. Do not perform + cross block scheduling if build_control_flow returns nonzero. + * flow.c (compute_preds_succs): More accurately determine when + a block drops in. + + * basic-block.h (free_basic_block_vargs): Provide prototype. + + * cccp.c (main): Fix dumb mistakes in last change. + +Fri Mar 6 21:28:45 1998 J"orn Rennecke + + * rtl.h (addr_diff_vec_flags): New typedef. + (union rtunion_def): New member rt_addr_diff_vec_flags. + (ADDR_DIFF_VEC_FLAGS): New macro. + + * sh.c (output_branch): Fix offset overflow problems. + + * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. + (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. + * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). + * stmt.c (expand_end_case): Supply new arguments to + gen_rtx_ADDR_DIFF_VEC. + * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. + * alpha.h, arc.h, clipper.h, convex.h : Likewise. + * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. + * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. + * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. + * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. + * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. + * i386/386bsd.h, i386/freebsd-elf.h : Likewise. + * i386/freebsd.h, i386/linux.h : Likewise. + * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. + * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. + * m68k/mot3300.h, m68k/sgs.h : Likewise. + * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. + * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. + (CASE_VECTOR_SHORTEN_MODE): Define. + (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. + (med_branch_p, braf_branch_p): Don't declare. + (mdep_reorg_phase, barrier_align): Declare. + (ADJUST_INSN_LENGTH): Remove alignment handling. + * sh.c (uid_align, uid_align_max): Deleted. + (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. + (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. + (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. + (output_far_jump): Don't use braf_branch_p. + (output_branchy_insn): Don't use branch_offset. + (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. + Remove paired barrier stuff. + Don't use cache_align_p. + Take alignment insns into account. + (fixup_addr_diff_vecs): Reduce to only fixing up the base label of + the addr_diff_vec. + (barrier_align, branch_dest): New function. + (machine_dependent_reorg, split_branches): Remove infrastructure + for branch shortening that is now provided in the backend. + * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. + (braf_branch_p, braf_cbranch_p): Likewise. + (attribute length): Use new attributes. + (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. + (addr_diff_vec_adjust): Delete. + (align_2): Now a define_expand. + (align_log): Now length 0. + +Fri Mar 6 14:41:33 1998 Michael Meissner + + * m32r.md (right): Correctly check for length == 2, not 1. + +Fri Mar 6 14:00:04 1998 Kaveh R. Ghazi + + * mips/mips.h: Prototype `machine_dependent_reorg'. + (ASM_OUTPUT_ALIGN): Remove unused variable `mask'. + +Fri Mar 6 11:43:35 1998 Joern Rennecke (amylaar@cygnus.co.uk) + + * final.c (shorten_branches): Restore accidentally removed code. + +Fri Mar 6 11:00:49 1998 Andreas Schwab + + * configure.in: Remove duplicate uses of AC_PROG_CC and + AC_PROG_MAKE_SET. + +Fri Mar 6 00:59:30 1998 Richard Henderson + + * configure.in (target_cpu_default2): Correct typo for alphapca56. + +Thu Mar 5 23:24:50 1998 Jeffrey A Law (law@cygnus.com) + Doug Evans (devans@cygnus.com) + + * haifa-sched.c (build_jmp_edges): Delete dead function. + (build_control_flow): Use cfg routines from flow.c. + (schedule_insns): Remove debugging code accidentally checked + in earlier today. + + * basic-block.h: Add external integer list structures, typdefs, + accessor macros and function declarations. Similarly for + basic block pred/succ support and simple bitmap stuff. + * flow.c: Add functions for integer list, basic block pred/succ + support and simple bitmap support. + (compute_dominators): New function to compute dominators and + post dominators. + (find_basic_blocks): Split into two functions. + (life_analysis): Likewise. + (flow_analysis): Removed. Now handled by calling find_basic_blocks, + the life_analysis from toplev.c. + * toplev.c (rest_of_compilation): Call find_basic_blocks, then + life_analysis instead of flow_analysis. + +Thu Mar 5 23:06:26 1998 J"orn Rennecke + + * jump.c (jump_optimize): Call mark_jump_label also for deleted + insns. + (mark_jump_label): Don't increment ref counts for deleted insns. + +Thu Mar 5 09:55:15 1998 Kaveh R. Ghazi + + * mips/iris6.h (TARGET_DEFAULT): Parenthesize macro definition. + + * mips/mips.c: Include stdlib.h and unistd.h. + (mips_asm_file_end): Add braces around empty body in an if-statement. + (function_prologue): Wrap variable `fnname' in + !FUNCTION_NAME_ALREADY_DECLARED. Correct format specifier in fprintf. + (mips_select_rtx_section, mips_select_section): Declare as void. + + * mips/mips.h: Add prototypes for extern functions in mips.c. + (FUNCTION_ARG_REGNO_P): Add parentheses around && within ||. + (ENCODE_SECTION_INFO): Add braces around empty body in an + if-statement. + + * mips/mips.md (movdi): Add parentheses around && within ||. + (movsf, movdf): Likewise. + (branch_zero, branch_zero_di): Add default case in + enumeration switch. + +Thu Mar 5 02:45:48 1998 Richard Henderson + + * alpha/alpha.h (TARGET_WINDOWS_NT, TARGET_OPEN_VMS): Just make them + real constants, since they can't be changed. + (TARGET_AS_CAN_SUBTRACT_LABELS): New. + * alpha/alpha.md (builtin_setjmp_receiver): Use it. + * alpha/osf.h (TARGET_AS_CAN_SUBTRACT_LABELS): New. + * alpha/osf2or3.h (TARGET_AS_CAN_SUBTRACT_LABELS): New. + * alpha/vms.h (TARGET_OPEN_VMS): New. + * alpha/win-nt.h (TARGET_WINDOWS_NT): New. + +Thu Mar 5 02:41:27 1998 Richard Henderson + + * reload.c (find_reloads): Always force (subreg (mem)) to be + reloaded if WORD_REGISTER_OPERATIONS. + +Thu Mar 5 02:14:44 1998 Richard Henderson + + * haifa-sched.c (free_list): Rename from free_pnd_lst. + (free_pending_lists): Rename free_pnd_lst uses. + (remove_dependence): Place expunged element on unused_insn_list. + (alloc_INSN_LIST, alloc_EXPR_LIST): New. Change all callers of + gen_rtx_*_LIST and alloc_rtx to use them. + (compute_block_backward_dependences): Free the reg_last_* lists. + +Thu Mar 5 00:05:40 1998 Jeffrey A Law (law@cygnus.com) + + * cccp.c (main): Avoid undefined behavior when setting pend_includes + and pend_files. + +Wed Mar 4 21:58:25 1998 Franz Sirl + + * rs6000/linux.h: Don't define DEFAULT_VTABLE_THUNKS to 1 if + USE_GNULIBC_1 is defined. + * configure.in: Add a new case powerpc-*-linux-gnulibc1 which + includes the t-linux-gnulibc1 fragment. + +Wed Mar 4 12:11:36 1998 Jim Wilson + + * mips.md (movdf_internal1a): Fix misplaced parenthesis in condition. + +Wed Mar 4 18:47:48 1998 J"orn Rennecke + + * final.c (final_scan_insn, case CODE_LABEL: Cleanup. + +Wed Mar 4 15:51:19 1998 J"orn Rennecke + + * final.c (shorten_branches): Tag the loop alignment onto the + first label after NOTE_INSN_LOOP_BEG even if there is an + intervening insn. + +Tue Mar 3 21:48:35 1998 J"orn Rennecke + + * final.c (insn_current_reference_address): + Use SEQ instead of BRANCH as argument to align_fuzz, to get a + proper alignment chain. + + * final.c (max_labelno): New static variable. + (final_scan_insn): Check max_labelno before outputting an + alignment for a label. + (shorten_branches): Remove unused variable length_align. + +Tue Mar 3 14:27:23 1998 Kaveh R. Ghazi + + * sparc.c (ultrasparc_adjust_cost): Add default case in + enumeration switch. + + * sparc.h: Add prototypes for extern functions defined in + sparc.c. + +Tue Mar 3 10:00:11 1998 Nick Clifton + + * toplev.c: Only generate .dbr file when dumping RTL if + DEALY_SLOTS is defined. + +Tue Mar 3 07:36:37 1998 Manfred Hollstein + + * reorg.c (fill_eager_delay_slots): Add new argument delay_list + in call to fill_slots_from_thread. + +Mon Mar 2 13:45:03 1998 Richard Henderson + + * alpha/linux.h (CPP_PREDEFINES): Correct connecting whitespace + to SUB_CPP_PREDEFINES. Reported by asun@saul4.u.washington.edu. + +Mon Mar 2 22:59:28 1998 J"orn Rennecke + + * final.c (insn_last_address, insn_current_align, uid_align): + New variables. + (in_align_chain, align_fuzz, align_shrink_fuzz): New functions. + (insn_current_reference_address): Likewise. + (shorten_branches, final_scan_insn): Implement LABEL_ALIGN, + LABEL_ALIGN_AFTER_BARRIER and LOOP_ALIGN target macros. + (label_to_alignment): New function. + * genattrtab.c (write_test_expr): If one of LABEL_ALIGN, + LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN is defined, call + insn_current_reference_address instead of insn_current_address. + (or_attr_value, write_length_unit_log): New functions. + (main): Call write_length_unit_log. + (write_const_num_delay_slots): Output extra '\n'. + * alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): + Replace with: + (LOOP_ALIGN, ALIGN_LABEL_AFTER_BARRIER). + * i386.h, i386/osfrose.h, i386/svr3dbx.h, m68k.h, sparc.h: Likewise. + * arc.h, m32r.h (ASM_OUTPUT_LOOP_ALIGN): Replace with: + (LOOP_ALIGN). + * i960.h, m88k.h (ASM_OUTPUT_ALIGN_CODE): Replace with: + (LABEL_ALIGN_AFTER_BARRIER). + * ns32k/encore.h, ns32k/merlin.h, ns32k.h, ns32k/sequent.h: Likewise. + * ns32k/tek6000.h: Likewise. + * i386/gas.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Delete. + * i386.md (casesi+1): Use ASM_OUTPUT_ALIGN instead of + ASM_OUTPUT_ALIGN_CODE. + +Mon Mar 2 01:05:50 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Mar 2 00:52:18 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Mar 1 18:25:49 1998 Michael P. Hayes + + * reorg.c (fill_slots_from_thread): Don't steal delay list from target + if condition code of jump conflicts with opposite_needed. + + * reorg.c (fill_slots_from_thread): Mark resources referenced in + opposite_needed thread. Return delay_list even when cannot get + any more delay insns from end of subroutine. + +Sun Mar 1 18:26:21 1998 Ken Rose (rose@acm.org) + + * reorg.c (fill_slots_from_thread): New parameter, delay_list. + All callers changed. + +Sun Mar 1 18:25:37 1998 Bruno Haible + + * frame.c (start_fde_sort, fde_split, heapsort, fde_merge, + end_fde_sort): New functions for fast sorting of an FDE array. + (fde_insert): Simplified. + (add_fdes): Change argument list. + (frame_init): Use the new functions. + +Sun Mar 1 18:06:21 1998 Jeffrey A Law (law@cygnus.com) + + * ginclude/va-ppc.h (va_arg): Fix typo in long long support. + + * i386.c (reg_mentioned_in_mem): Fix dangling else statement. + + * fold-const.c (fold_range_test): Always return a value. + +Sun Mar 1 17:57:34 1998 Mumit Khan + + * config/i386/winnt.c (i386_pe_unique_section): Put read-only + data in the text section unless READONLY_DATA_SECTION is defined. + +Sun Mar 1 17:48:46 1998 Jeffrey A Law (law@cygnus.com) + + * c-parse.in (undeclared variable error): Tweak error message to + be clearer. + +Sun Mar 1 10:22:36 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +1998-02-28 Mark Mitchell + + * final.c (final_scan_insn): Undo overzealous removal of `set'. + +Sat Feb 28 07:54:03 1998 Kaveh R. Ghazi + + * pa.h (CONST_COSTS): When checking the CONST_DOUBLE enumerated + case, add parentheses to specify the proper order of precedence in + the if-statement. + + * c-aux-info.c: Include string.h/strings.h. + + * pa.c: Include stdlib.h. + (pa_combine_instructions): Prototype the function. + (pa_can_combine_p, forward_branch_p, shadd_constant_p): Likewise. + (reloc_needed): Add default case for enumeration switch. + (remove_useless_addtr_insns): Remove unused variable `all'. + (hppa_expand_prologue): Add explicit braces to avoid + ambiguous `else'. + (output_function_epilogue): Remove unused variable `i'. + (output_millicode_call): Remove unused variable `link'. + (shadd_constant_p, forward_branch_p): Make the function static. + (following_call): Explicitly declare to return int. + (pa_reorg): Declare as void. + (pa_combine_instructions): Declare as static void. Add + parentheses around && within ||. + + * pa.h: Add prototypes for pa_reorg, symbolic_operand, + following_call, function_label_operand, lhs_lshift_cint_operand + and zdepi_cint_p. + + * pa.md: Add parentheses around && within ||. + + * cppalloc.c: Include stdlib.h. + + * cpperror.c (cpp_print_containing_files): Remove unused variable + `i'. Fix format specifier in fprintf. + + * cse.c (cse_around_loop): Add explicit braces to avoid + ambiguous `else'. + (delete_dead_from_cse): Wrap variable `tem' in macro HAVE_cc0. + + * expr.c (expand_expr): Add parentheses around && within ||. + + * final.c (app_enable): Replace fprintf with fputs where there are + no format specifiers and no trailing argument after the string. + Eg, when printing ASM_APP_ON/ASM_APP_OFF. + (app_disable): Likewise. + (final_end_function): Likewise. + (final_scan_insn): Likewise. Remove unused variable `set'. + (profile_function): Wrap empty if-statement body in {} brackets. + + * function.c: Include stdlib.h. + (pad_below): Wrap prototype and definition in ARGS_GROW_DOWNWARD. + (reposition_prologue_and_epilogue_notes): Add parentheses + around assignment used as truth value. + + * integrate.c (expand_inline_function): Wrap variable + `cc0_insn' in macro HAVE_cc0. + + * jump.c (jump_optimize): Wrap variable `q' in macro + HAVE_cc0. Remove unused variable `prev1'. + + * libgcc2.c (__bb_exit_trace_func): Add parentheses around && + within ||. Fix format specifier in fprintf. + (__bb_init_prg): Add parentheses around assignment used as + truth value. + + * local-alloc.c: Include stdlib.h. + (requires_inout): Add parentheses around assignment used + as truth value. + + * loop.c (analyze_loop_iterations): Wrap prototype and definition + in macro HAVE_decrement_and_branch_on_count. + (insert_bct, instrument_loop_bct): Likewise. + (move_movables): Add parentheses around assignment used as + truth value. + (consec_sets_invariant_p): Likewise. + (maybe_eliminate_biv_1): Wrap variable `new' in macro HAVE_cc0. + + * objc/objc-act.c: Include stdlib.h. + (lookup_method_in_protocol_list): Wrap empty else-statement body + in braces. + (lookup_protocol_in_reflist): Likewise. + (objc_add_static_instance): Remove unused variables `decl_expr' + and `decl_spec'. + (get_objc_string_decl): Remove unused variable `decl'. + (generate_static_references): Remove unused variables `idecl' and + `instance'. + (check_protocols): Wrap empty else-statement body in braces. + + * protoize.c: Include stdlib.h. + (substr): Add parentheses around assignment used as truth value. + (abspath): Likewise. + (shortpath): Likewise. + + * regmove.c (fixup_match_1): Add parentheses around assignment + used as truth value. + + * reload.c (push_secondary_reload): Remove unused variable `i'. + (find_reloads): Add parentheses around assignment used as truth + value. + + * reload1.c: Include stdlib.h. + + * rtl.h: Correct typo in prototype of offsettable_memref_p. + + * stmt.c (add_case_node): Add parentheses around assignment used + as truth value. + (case_tree2list): Likewise. + + * tree.c (valid_machine_attribute): Wrap variable `decl_attr_list' + in macro VALID_MACHINE_DECL_ATTRIBUTE. Wrap variable + `type_attr_list' in macro VALID_MACHINE_TYPE_ATTRIBUTE. + (merge_attributes): Add explicit braces to avoid ambiguous + `else'. + + * unroll.c (copy_loop_body): Wrap variable `cc0_insn' in + macro HAVE_cc0. + + * varasm.c: Include stdlib.h. + + * system.h: Remove sys/stat.h. + * gcc.c: Add sys/stat.h. + + * genattr.c: Wrap prototype of `free' in NEED_DECLARATION_FREE. + * genattrtab.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + * tlink.c: Likewise. Also wrap `getenv' in NEED_DECLARATION_GETENV. + +Fri Feb 27 11:02:47 1998 Andreas Schwab + + * invoke.texi: Use @itemx for a secondary item in a @table. + + * config/m68k/m68k.md (movsf+1): Optimize moving a CONST_DOUBLE + zero. + +Thu Feb 26 00:13:21 1998 Ian Lance Taylor + + * choose-temp.c: Fix handling of sys/file.h to work in libiberty. + +Wed Feb 25 23:40:54 1998 Jeffrey A Law (law@cygnus.com) + + * i386.c (struct machine_function): Add new fields for PIC stuff. + (save_386_machine_status): Fix argument to xmalloc. Save pic_label_rtx + and pic_label_name. + (restore_386_machine_status): Corresponding changes. + (clear_386_stack_locals): Also clear pic_label_rtx and pic_label_name. + +Wed Feb 25 01:31:40 1998 Jeffrey A Law (law@cygnus.com) + + * c-parse.y (undeclared variable error): Tweak error message + to be clearer. + +Tue Feb 24 23:54:07 1998 Richard Henderson + + * flags.h (g_switch_value, g_switch_set): Declare. + * alpha.c (override_options): Set g_switch_value=8 if not set. + * alpha/elf.h (CC1_SPEC): New. + (ASM_SPEC): New. + (LINK_SPEC): Pass along the -G value we were given. + (LOCAL_ASM_OP): Remove. + (ASM_OUTPUT_ALIGNED_LOCAL): Output to .bss or .sbss by size. + (MAX_OFILE_ALIGNMENT): New. + (BSS_SECTION_ASM_OP, SBSS_SECTION_ASM_OP, SDATA_SECTION_ASM_OP): New. + (EXTRA_SECTIONS): Add sbss and sdata. + (SECTION_FUNCTION_TEMPLATE): New. + (EXTRA_SECTION_FUNCTIONS): Use it. + (CTORS_SECTION_FUNCTION, DTORS_SECTION_FUNCTION): Remove. + (SELECT_SECTION): Use sdata when small enough. + * alpha/linux.h (ASM_SPEC): Remove. + +Mon Feb 23 15:09:18 1998 Bruno Haible + * config.sub (sco5): Fix typo. + +Mon Feb 23 18:19:31 1998 Manfred Hollstein + + * config/t-linux (LIBGCC1, CROSS_LIBGCC1, LIBGCC1_TEST): Add macros and + set to empty. + * config/t-linux-aout (LIBGCC1, CROSS_LIBGCC1, LIBGCC1_TEST): Likewise. + * config/alpha/t-linux: Remove file. + * config/sparc/t-linux: Remove file. + * config/m68k/t-linux (LIBGCC1, CROSS_LIBGCC1): Remove. + * config/m68k/t-linux-aout (LIBGCC1, CROSS_LIBGCC1): Likewise. + * configure.in (alpha*-*-linux-gnulibc1*): Use t-linux instead of alpha/t-linux + for tmake_file. + (alpha*-*-linux-gnu*): Likewise. + (sparc-*-linux-gnulibc1*): Use t-linux instead of sparc/t-linux for tmake_file. + (sparc-*-linux-gnu*): Likewise. + +Mon Feb 23 10:47:39 1998 Robert Lipe + * collect2.c (ldd_file_name): Bracket declaration with same + manifests as use. + (full_real_ld_suffix): Deleted. Variable was calloced and + written into, but never read. + +1998-02-23 Mike Stump + + * configure.in: Add support for i386-wrs-vxworks configuration. + * i386/vxi386.h: New file. + +Sun Feb 22 21:16:51 1998 Bruno Haible + + * tree.c (contains_placeholder_p): Ensure function always returns + a value. + * sparc.md (movdi_sp64_insn): Add default case in enumeration switch. + (movsf_const_insn, movdf_const_insn, movtf_const_insn): Likewise. + +Sun Feb 22 20:58:19 1998 Jeffrey A Law (law@cygnus.com) + + * vms.h (SELECT_SECTION): Use TREE_CODE_CLASS correctly. + +1998-02-22 Paul Eggert + + * config/sparc/sol2-sld.h (LINKER_DOES_NOT_WORK_WITH_DWARF2): + Define this new symbol. + (DWARF2_DEBUGGING_INFO, DWARF_DEBUGGING_INFO): Do not #undef. + * toplev.c (main): Do not default to DWARF2_DEBUG with -ggdb if + LINKER_DOES_NOT_WORK_WITH_DWARF2 is defined. + +Sun Feb 22 20:07:32 1998 Jim Wilson + + * iris5.h (DWARF2_UNWIND_INFO): Define to 0. + * iris5gas.h (DWARF2_UNWIND_INFO): Define to 1. + +Sun Feb 22 15:29:48 1998 Richard Henderson + + * objc/Object.m (-error): Call objc_verror with our va_list. + +Sun Feb 22 09:45:39 1998 Kaveh R. Ghazi + + * collect2.c (scan_prog_file): Completely cover uses of variable + `exports' with macro COLLECT_EXPORT_LIST. + +Sat Feb 21 20:36:23 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Fri Feb 20 16:22:13 1998 Michael Meissner + + * sched.c (schedule_block): Remove code to get arguments from hard + regs into pseudos early. Same as Aug 25, 1997 change to + haifa-sched.c. + +1998-02-20 Jason Merrill + + * collect2.c (main): Still handle !do_collecting for non-AIX targets. + +1998-02-16 Mark Mitchell + + * toplev.c (rest_of_compilation): Do not defer the output of a + nested function. + +Fri Feb 20 10:39:47 1998 Michael Tiemann + + * ginclude/va-mips.h (va_arg): Remove trailing space after '\' + continuation character (line 243). + +Fri Feb 20 12:10:26 1998 Andreas Schwab + + * genrecog.c (main): Remove duplicated sentence in emitted comment. + +Thu Feb 19 22:36:53 1998 Andrey Slepuhin + David Edelsohn + + * collect2.c (XCOFF_SCAN_LIBS): Remove. + (export_flag): New variable. + (export_file): #ifdef COLLECT_EXPORT_LIST. + (import_file, exports, imports, undefined): New variables. + (libs, cmdline_lib_dirs, libpath_lib_dirs, libpath, libexts): Same. + (dump_list, dump_prefix_list, is_in_list): New functions. + (write_export_file): $ifdef COLLECT_EXPORT_LIST. + (write_import_file, resolve_lib_name): New functions. + (use_import_list, ignore_library): Same. + (collect_exit): maybe_unlink import_file and #ifdef. + (handler): Same. + (main): New variable importf, #ifdef exportf. Move parsing of + -shared before general argument parsing. Resolve AIX library + paths and import libgcc.a symbols. Treat .so shared libraries the + same as objects and .a libraries. Create alias for object_lst and + increment it instead of original pointer. Scan AIX libraries as + objects earlier instead of using scan_libraries. Perform AIX + tlink later to resolve templates instead of forking ld. + (GCC_OK_SYMBOL): Ensure symbol not in undef section. + (GCC_UNDEF_SYMBOL): New macro. + (scan_prog_file): Loop for members of AIX libraries. Handle + export/import of ctors/dtors. + (aix_std_libs): New variable. + (scan_libraries, XCOFF): Delete. + +Thu Feb 19 22:36:52 1998 Robert Lipe + + * collect2.c (full_real_ld_suffix): #ifdef CROSS_COMPILE. + +1998-02-19 Mike Stump + + * Makefile.in: Use $tooldir for sys-include to match toplevel + configure. + +Thu Feb 19 01:32:37 1998 Jeffrey A Law (law@cygnus.com) + Richard Kenner + + * emit-rtl.c (gen_lowpart_common): Suppress last change if __complex__. + + * emit-rtl.c (hard-reg-set.h): Include. + (get_lowpart_common): Don't make new REG for hard reg in a + class that cannot change size. + * Makefile.in (emit-rtl.o): Depend on hard-reg-set.h. + + * combine.c: Revert previous patch. + +1998-02-19 Paul Eggert + + * config/sparc/sol2-sld.h: New file. + * configure.in (sparc-*-solaris2*): Use it when using the + system linker. + +Thu Feb 19 00:46:59 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (force_movables): Fix typo. + +Thu Feb 19 08:26:30 1998 Manfred Hollstein + + * m88k.h: Change file pattern to match reality. + +Wed Feb 18 23:19:52 1998 Jeffrey A Law (law@cygnus.com) + + * varasm.c (output_constant_pool): Fix dumb thinko in last + change. + + * pa.h (ASM_OUTPUT_FUNCTION_PREFIX): Correctly translate from + a function name to a section name. + +1998-02-18 Doug Evans + + * tree.h (merge_machine_{type,decl}_attributes): Declare. + (split_specs_attrs, strip_attrs): Add prototypes. + * tree.c (merge_machine_{type,decl}_attributes): New functions. + * c-decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + * c-common.c (strip_attrs): New function. + * c-typeck.c (common_type): Call merge_machine_type_attributes. + * varasm.c (make_function_rtl): New target macro REDO_SECTION_INFO_P. + (make_decl_rtl): Likewise. + +1998-02-18 Jim Wilson + + * c-decl.c (shadow_tag_warned): Call split_specs_attrs. + +Wed Feb 18 09:09:50 1998 Jeffrey A Law (law@cygnus.com) + + Remove this change until we can fix it correctly. + * collect2.c: Bracket declaration of 'exportf' and + 'full_real_ld_suffix'. + +Wed Feb 18 08:44:25 1998 Bernd Schmidt + + * Makefile.in (STAGESTUFF): Add genrtl.c, genrtl.h and gengenrtl. + +Tue Feb 17 23:30:20 1998 Bernd Schmidt + + * c-common.c (c_expand_start_cond, c_expand_end_cond, + c_expand_start_else): Don't warn about non-ambiguous else even if + braces are missing. + +Tue Feb 17 23:56:50 1998 Robert Lipe + + * sco5.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, + ASM_OUTPUT_LONG_DOUBLE): Delete. Use the ones from i386.h + instead. + +Tue Feb 17 22:56:14 1998 Richard Henderson + + * combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when + simplifying a subreg of a hard reg. + (expand_compound_operation): Likewise. + (force_to_mode): Likewise. + +Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi + + * fold-const.c: Include "system.h" to get stdlib.h and stdio.h. + (lshift_double): Add parentheses around + or - inside shift. + (rshift_double): Likewise. + (size_int_wide): Explicitly set type of `bit_p' to `int'. + + * Makefile.in (fold-const.o): Depend on system.h. + + * Makefile.in (gcc.o): Depend on system.h, in accordance with last + change to gcc.c. + + * haifa-sched.c: Include "system.h" to get and . + (BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |. + (sched_note_set): Remove unused parameter `b', all callers changed. + (schedule_block): Likewise for `rgn'. + (split_hard_reg_notes): Likewise for `orig_insn'. + (check_live): Likewise for `trg'. + (update_live): Likewise. + (check_live_1): Explicitly declare variable `i' as int. + (update_live_1): Likewise. + (insn_issue_delay): Remove unused variable `link'. + (sched_analyze_2): Add default case in enumeration switch. + (schedule_insns): Remove unused variable `i'. + + * Makefile.in ($(SCHED_PREFIX)sched.o): Depend on system.h. + +Tue Feb 17 22:31:04 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (rtx_equal_for_loop_p): Add some braces to disambiguate + a dangling else clause. + +Tue Feb 17 21:28:12 1998 Gavin Koch + + * mips/mips.h (CAN_ELIMINATE): Don't eliminate the frame + pointer for the stack pointer in MIPS16 and 64BIT. + +Tue Feb 17 21:17:30 1998 J"orn Rennecke + + * rtl.h (force_line_numbers, restore_line_number_status): Declare. + * emit-rtl.c (force_line_numbers, restore_line_number_status): + New functions. + * stmt.c (struct nesting): Replace seenlabel with line_number_status. + (expand_start_case): Adjust to this change. + (check_seenlabel): New function. + (pushcase, pushcase_range, expand_endcase): Use it. + +Tue Feb 17 10:14:32 1998 J"orn Rennecke + + * i386.md (adddi3): Add =!r,0,0,X alternative. + +Mon Feb 16 16:13:43 1998 David Edelsohn + + * rs6000.h (MY_ISCOFF): Add numeric value of U803XTOCMAGIC. + * x-aix31 (INSTALL): Delete. + +Mon Feb 16 09:24:32 1998 Gavin Koch + + * mips/mips.c (mips_expand_epilogue): Update tsize_rtx if + tsize changes to something other than zero. + +Mon Feb 16 09:11:48 1998 Gavin Koch + + * ginclude/va-mips.h: Replace casts of pointers to int with + casts of pointers to __PTRDIFF_TYPE__. + +Mon Feb 16 08:17:14 1998 John Carr + + * loop.c (strength_reduce, record_biv, record_giv): Use + HOST_WIDE_INT_PRINT_DEC to print CONST_INT values. + +1998-02-16 Jason Merrill + + * tree.c (first_rtl_op): New fn. + (unsave_expr_now): Use it. + * print-tree.c (print_node): Likewise. + * tree.c (has_cleanups): New fn. + * fold-const.c (fold, case CLEANUP_POINT_EXPR): Use it. Be more + conservative about pushing the cleanup point down. + * tree.h: Declare them. + +Sun Feb 15 23:28:44 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (flag_schedule_reverse_before_reload): Delete variable. + (flag_schedule_reverse_after_reload): Likewise. + (f_options): Remove reverse scheduling support. + * flags.h (flag_schedule_reverse_before_reload): Delete declaration. + (flag_schedule_reverse_after_reload): Likewise. + * haifa-sched.c (rank_for_schedule): Remove support for reverse + scheduling. + +Sun Feb 15 21:33:55 1998 Kaveh R. Ghazi + + * gcc.c: Get system includes, prototypes and macros via "system.h" + instead of doing it manually. Change all calls of the ctype + macros to custom versions defined in "system.h". + + * system.h: Fix return type of bcmp prototype from `void' to `int'. + Make bcopy, bcmp and bzero prototypes explicitly `extern'. + Add a prototype for getenv. + +Sun Feb 15 17:05:41 1998 Jim Wilson + + * mips/mips.h (INITIAL_ELIMINATION_OFFSET): Readd Jun 6 change. + +Sun Feb 15 15:23:15 1998 John Carr + + * alias.c: Include and . + (init_alias_analysis): Pass NULL_RTX instead of 0 to record_set. + +Sat Feb 14 11:23:09 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Feb 14 05:08:21 1998 Richard Earnshaw (rearnsha@arm.com) + + * arm.md (movsfcc): Also validate operands[3] when compiling hard + float. + (movdfcc): Only accept fpu_add_operand for operands[3]. + + * arm/t-semi (STMP_FIXPROTO): Define to nothing. + * arm/t-semiaof (STMP_FIXPROTO): Likewise. + +Sat Feb 14 02:02:41 1998 Jeffrey A Law (law@cygnus.com) + + * varasm.c (output_constant_pool): Bring back 'done' label inside + an appropriate #ifdef. + + * bitmap.c (bitmap_element_allocate): Wrap variable 'i' in an + appropriate #ifdef. + (bitmap_copy, bitmap_operation): Likewise. + * combine.c (combinable_i3pat): Similarly for 'src'. + * function.c (fixup_var_refs_1): Similarly for 'outerdest'. + (locate_and_pad_parm): Similarly for 'reg_parm_stack_space'. + * regclass.c (copy_cost): Similarly for 'secondary_class'. + * reload.c (make_memloc): Similarly for 'i'. + (find_reloads_address_1): Similarly for 'link'. + * reload1.c (reload): Similarly for 'previous_frame_pointer_needed'. + (emit_reload_insns): Similarly for 'second_reloadreg'. + * unroll.c (iteration_info): Similarly for 'v'. + + * caller-save.c (insert_save_restore): Remove unused variable 'i'. + * calls.c (expand_call): Similarly for 'i'. + (emit_library_call, emit_library_call_value): Similarly for 'mode'. + * fold-const.c (strip_compound_expr): Similarly for 'type'. + * function.c (fixup_var_refs_1): Similarly for 'width'. + (fixup_memory_subreg): Similarly for 'saved'. + (locate_and_pad_parm): Similarly for 'boundary_in_bytes.' + (setjmp_protect): Similarly for 'sub'. + (thread_prologue_and_epilogue_insns): Similarly for 'insn'. + * loop.c (record_giv): Similarly for 'p'. + (combine_givs): Similarly for 'temp_iv'. + (indirect_jump_in_function_p): Similarly for 'is_indirect_jump'. + * recog.c (validate_replace_rtx_1): Similarly for 'width'. + * tree.c (get_set_constructor_bytes): Similarly for 'vals'. + * unroll.c (unroll_loop): Similarly for 'copy'. + (iteration_info): Similarly for 'b'. + * varasm.c (assemble_string): Similarly for 'i'. + * i386.h (LEGITIMIZE_ADDRESS): Similarly for 'orig_x'. + +1998-02-13 Martin von Loewis + + * c-lang.c (lang_print_xnode): New function. + * objc/objc-act.c (lang_print_xnode): Likewise. + * print-tree.c (print_node): Call it + +Fri Feb 13 14:38:34 1998 Jim Wilson + + * dwarf2out.c (decl_scope_node): New type. + (decl_scope_table): Change type to use it. + (decl_scope_table_allocated, decl_scope_depth): Change type to int. + (push_decl_scope): Use new type. New locals containing_scope, i. + Add code to handle setting previous field. + (scope_die_for): Change type of local i to int. Add code to use + previous field. + (dwarf2out_init): Use new type. + +1998-02-13 Jason Merrill + + * except.c (emit_throw): Lose throw_used. + +Fri Feb 13 20:36:05 1998 J"orn Rennecke + + * sched.c (update_flow_info, REG_WAS_0): Ignore if setting insn + was deleted. + * haifa-sched.c (update_flow_info, REG_WAS_0): Likewise. + +Fri Feb 13 12:18:40 1998 Jeffrey A Law (law@cygnus.com) + + * genextract.c (main): Fix typo. + +Fri Feb 13 08:41:49 1998 Robert Lipe + + * c-lang.c (finish_file): Bracket declaration of static_ctors, + static_dtors. + + * calls.c (expand_call): Bracket declaration of 'rtx_before_call', + 'old_stack_arg_under_construction' + (emit_library_call): Bracket declaration of 'upper_bound', + 'lower_bound', 'i', 'reg_parm_stack_space' + (emit_library_call_value): Likewise. + (store_one_arg): + + * collect2.c: Include when appropriate. + Bracket declaration of 'exportf' and 'full_real_ld_suffix'. + + * emit-rtl.c (prev_cc0_setter): Remove unused variable 'link'. + + * explow.c (plus_constant_for_output_wide): Remove unused variable + 'code'. + (memory_address): Remove unused variable 'orig_x'. + + * genattrtab.c (make_canonical): Remove unreferenced label 'cond:'. + (write_const_num_delay_slots): Remove unused variable 'i'. + + * genopinit.c (main): Remove unused variables 'dummy', 'insn_ptr'. + (gen_insn): Remove unused variable 'obstack_ptr'. + + * libgcc2.c (__bb_exit_func): Remove unused variables 'ret', + 'j', 'tmp', 'i'. + (__bb_exit_trace_func): Remove unused variable 'e'. + + * optabs.c (expand_binop): Remove unused variables 'lhs', 'rhs', + 'funexp'. + (expand_unop): Remove unused variable 'funexp'. + (expand_complex_abs): Remove unused variable 'funexp'. + (init_optabs): Bracket declaration of 'j'. + (init_complex_libfuncs): Deleted. Dead static function. + + * profile.c (branch_prob): Remove unused variables 'insn', 'dest'. + + * reg-stack.c: Fix typo in proto for 'get_asm_operand_lengths' + (reg_to_stack): 'initialized', 'before_function_beg' + explicitly type as ints instead of defaulting. + (emit_swap_insn): Remove unused variable 'i2'. + (compare_for_stack_reg): Remove unused variable 'src_note'. + + * rtlanal.c (computed_jump_p): Remove unused variable 'computed_jump'. + + * sched.c (actual_hazard): Bracket declaration of 'this_cost'. + + * stmt.c (add_case_node): Add parens for assignment used as truth. + (all_cases_count): Remove unused variable 'count_high'. + (mark_seen_cases): Remove unused variable 'i'. + (check_for_full_enumeration_handling): Remove unused variable 't'. + Bracket declaration of 'all_values', 'l'. + + * tlink.c: Include , , /. + + * varasm.c (assemble_string): Remove unused variable 'i'. + (immed_double_const): Remove unused variable 'in_current_obstack'. + (immed_real_const_1): Likewise. + (output_constant_pool): Remove unreferenced label 'done'. + (output_constant): Remove unused variable 'x'. + + * i386/i386.h (ENCODE_SECTION_INFO): TREE_PUBLIC is an int, not + a string. + + * i386/sco5.h (ASM_OUTPUT_ASCII): Add parens for assignment used + as truth. + +Fri Feb 13 10:21:41 1998 J"orn Rennecke + + * combine.c (can_combine_p): Handle USEs in PARALLELs. + +Fri Feb 13 01:34:14 1998 H.J. Lu (hjl@gnu.org) + + * config/linux.h (LIB_SPEC): Add -lc for -shared if + USE_GNULIBC_1 is not defined. + * config/sparc/linux.h; Likewise. + + * config/sparc/linux64.h (LIB_SPEC): Add -lc for -shared. + + * config/alpha/linux-elf.h (LIB_SPEC): New. Defined if + USE_GNULIBC_1 is not defined. + +Fri Feb 13 01:29:29 1998 Franz Sirl + + * rs6000/sysv4.h (ENDFILE_SPEC): Add missing %(endfile_linux) + for -mcall-linux. + +Fri Feb 13 01:23:46 1998 Kaveh R. Ghazi + + * system.h: New file to get common systems includes and various + definitions and declarations based on autoconf macros. + +Fri Feb 13 00:46:19 1998 Jeffrey A Law (law@cygnus.com) + + * cccp.c (new_include_prefix): Correctly handle -I./. + +Thu Feb 12 20:16:35 1998 Michael Meissner + + * rs6000.md: Replace gen_rtx (CONST_INT,...) with GEN_INT. + +Thu Feb 12 16:45:17 1998 Robert Lipe + + * expr.c (expand_assignment): Correct typo exposed by -Wall. + offset should have been a truth value, not an assignment. + +Thu Feb 12 15:26:50 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (delete_dead_from_cse): If a libcall produces a constant + result and that result can be substituted into SET_SRC of the + insn with the REG_RETVAL note, then perform the substitution + and delete the libcall. + +Thu Feb 12 14:04:09 1998 Gavin Koch + + * mips.md (trucndihi2,truncdiqi2): Change these to support + mips16. + +Thu Feb 12 11:34:55 1998 Gavin Koch + + * mips/mips.c (movdi_operand): Direct references to symbols + that arn't mips16 consts in mips16 mode arn't valid operands. + + * mips/mips.c (mips_move_2words): Add gprel handling. + +Thu Feb 12 11:18:37 1998 Gavin Koch + + * mips.md (extendsidi2): Allow extension to/from a non-mips16 + register. + +Thu Feb 12 00:04:16 1998 Marc Lehmann + + * i386.c: Conditionally include , , and + . + +Wed Feb 11 11:43:34 1998 Kaveh R. Ghazi + + * Makefile.in (WARN_CFLAGS): New variable. + (bootstrap, bootstrap2, bootstrap3, bootstrap4): Use it. + +1998-02-11 Mark Mitchell + + * config/i386/i386.c (reg_mentioned_in_mem): Don't abort when + falling through default case in switch. + (i386_aligned_p): Likewise. + +Wed Feb 11 12:59:56 1998 Lee Iverson + + * mips/mips.h (mips_abi_string): Correct typo in comment. + +Wed Feb 11 08:29:56 1998 Gavin Koch + + * mips/mips.md (movdi): These PLUS's need to be Pmode. + +Wed Feb 11 01:47:54 1998 Kaveh R. Ghazi + + * Makefile.in (dwarf2out.o, emit-rtl.o, jump.o, cse.o, unroll.o, + reorg.o, regmove.o): Depend on insn-codes.h, it gets included + indirectly via expr.h. + +Wed Feb 11 01:44:13 1998 Richard Henderson + + * stor-layout.c (layout_type): Do upper - lower in the native type, + so as to properly handle negative indices. + +Wed Feb 11 01:35:55 1998 Robert Lipe + + * except.c (start_dynamic_cleanup): Remove unused variable 'dhc'. + (expand_eh_region_start_tree): Remove unused variable 'note'. + (exception_optimize): Remove unused variable 'regions'. + (expand_builtin_eh_stub): Remove unused variable 'temp'. + (copy_eh_entry): Deleted. Dead function. + + * expr.c (move_block_to_reg): Bracket declaration of 'pat' and + 'last' with same #if HAVE_load_multiple as use of it. + (move_block_from_reg): Likewise. + (emit_move_insn_1): Remove unused variable 'insns'. + (store_constructor): Bracket declaration of startb, endb with + #if TARGET_MEMFUNCTIONS. Remove unused variables 'set_word_size' + 'target', and 'xtarget'. + (expand_builtin_setjmp): Remove unused variables 'op0', + 'next_arg_reg', 'old_inhibit_defer_pop'. + (expand_builtin): Remove unused variable 'offset'. + (do_store_flag): Remove unused variables 'pattern', 'jump_pat'. + (emit_queue): Add parens for assignment used as conditional. + (expand_expr): Case TARGET_EXPR: Remove unused variable 'temp'. + +Wed Feb 11 01:30:49 1998 Marc Lehmann + + * i386.c: Added include for recog.h. + (override_options): Removed unused variable p. Initialized regno to + avoid warning. + (order_regs_for_local_alloc): Initialized regno to avoid warning. + (legitimize_address): Likewise for 'other'. + (i386_aligned_reg_p): Added default case with abort (). + (print_operand): Likewise. + (reg_mentioned_in_mem): Likewise. + (ix86_expand_binary_operator): Removed unused variables i & insn. + (ix86_expand_unary_operator): Removed unused variable insn. + (output_fp_cc0_set): Removed unused variable unordered_label. + +Wed Feb 11 01:23:03 1998 John F. Carr + + * i386.c, i386.h, i386.md: Change gen_rtx (X, ...) to gen_rtx_X (...). + Use GEN_INT instead of gen_rtx (CONST_INT). Make printf arguments + and format string match. + +Wed Feb 11 01:17:39 1998 Jeffrey A Law (law@cygnus.com) + + * flow.c (life_analysis): Do not consider the stack pointer live at + the end of a function if the function calls alloca. + (mark_used_regs): Similarly. + +1998-02-10 John F Carr + + * config/sparc/sparc.md (movdi_v8plus): Output stx on alternative + 1, fzero on alternative 8. + +Tue Feb 10 09:02:19 1998 Richard Kenner + + * rs6000.c (setup_incoming_varargs): Always set rs6000_sysv_varargs_p. + +Tue Feb 10 03:35:43 1998 J"orn Rennecke + + * reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical + SUBREGs of CONST_INTs. + +Mon Feb 9 17:52:36 1998 John Carr + + * mips.c (print_operand, function_prologue): Make printf format + match argument type. + +Mon Feb 9 02:37:25 1998 Kaveh R. Ghazi + + * alpha.c (alpha_return_addr): Remove unused variable `first'. + (alpha_ra_ever_killed): Remove unused variables `ra' and `i'. + (output_epilog): Remove unused variable `frame_size_from_reg_save'. + +Sun Feb 8 14:56:03 1998 Richard Kenner + + * loop.c (strength_reduce): When placing increment for auto-inc + case, do comparison in loop order. + +Sun Feb 8 13:21:38 1998 John Carr + + * bitmap.c (bitmap_debug_file): HOST_PTR_PRINTF converts a pointer, + not a HOST_WIDE_INT. + + * calls.c (expand_call): Change test of expand_inline_function + return value to stop compiler warning. + + * genattrtab.c (RTL_HASH): Cast pointer to long, not HOST_WIDE_INT. + +Sun Feb 8 12:04:24 1998 Jim Wilson (wilson@cygnus.com) + Jeff Law (law@cygnus.com) + + * regmove.c: Fix various minor formatting problems. + (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions + is true. Make end of basic block tests consistent through regmove.c. + (optimize_reg_copy_2, optimize_reg_copy_3): Likewise. + (fixup_match_2, fixup_match_1, regmove_optimize): Likewise. + +Sun Feb 8 01:49:18 1998 Kaveh R. Ghazi + + * gansidecl.h: Check for a conflicting macro definition before + attempting to prototype bcopy, bcmp or bzero. + +Sun Feb 8 00:09:59 1998 Jeffrey A Law (law@cygnus.com) + + * expr.c (clear_pending_stack_adjust): Handle case where a function + calls alloca, but the user has specified -fomit-fframe-pointer. + + * function.c (assign_parms): Fix typo in last change. + +Sat Feb 7 23:54:29 1998 Robert Lipe + + * gcc.c: Include /, , , + . + (free_path_suffix): Remove unreferenced static function. + (process_command): Remove unused variable temp. + (default_arg): Remove unused variable i. + (do_spec_1): Add parens for assignment used as truth value. + (main): Likewise. + (validate_all_switches): Likewise. + (main): Remove unused variables i, first_time> + + * c-common.c: Include and /. + + * calls.c (expand_call): Remove unused variables funtree, + n_regs, and tmpmode. + + * dbxout.c, except.c: Include /. + + * explow.c (plus_constant_for_output_wide): Removed unused + variable all_constant. + + * c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c + genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c, + genrecog.c, global.c, integrate.c , stupid.c : Include + . + + * genextract.c (walk_rtx): Remove unused variable link. + + * genrecog.c (concat): Remove unreferenced static function. + + * prefix.c: Include /, + + * stmt.c: Include . + (expand_asm_operands): Remove unused variable val1. + (expand_return): Remove unused variable block. + (pushcase): Remove unused variables l and n. + (pushcaserange): Likewise. + + * unroll.c (unroll_loop): Remove unused variable temp. + +Sat Feb 7 23:46:09 1998 Greg McGary + + * c-decl.c (pushdecl): Set DECL_ORIGINAL_TYPE once only. + +Sat Feb 7 15:11:28 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_FUNC_PRINTF_PTR): New macro to test the printf + functions for whether they support the %p format specifier. + * acconfig.h (HOST_PTR_PRINTF): Insert stub for autoconf. + * configure.in (GCC_FUNC_PRINTF_PTR): Use it. + * configure, config.in: Rebuild. + +Fri Feb 6 14:20:16 1998 Jim Wilson + + * function.c (assign_parms): New variable named_arg, with value + depending on STRICT_ARGUMENT_NAMING. Use instead of ! last_named. + +Fri Feb 6 14:34:28 1998 Gavin Koch + + * mips/t-r3900: New - same as t-ecoff but eliminate + multilibs: mips1 and mips3. + * configure.in (tx39*): Use new mips/t-r3900. + * configure: Rebuild. + * mips/r3900.h (MULTILIB_DEFAULTS): Eliminate mips1. + +1998-02-06 Jason Merrill + + * dwarf2out.c: Add old_args_size. + (dwarf2out_args_size): Use it. + (dwarf2out_begin_prologue): Initialize it. + (dwarf2out_stack_adjust): If !asynchronous_exceptions, save up + pushed args until we see a call. + * final.c (final_scan_insn): Hand CALL_INSNs off to the dwarf2 code + before outputting them. + +1998-02-06 Kriang Lerdsuwanakij + + * cplus-dem.c (demangle_template_template_parm): New function. + (demangle_template): Handle template template parameters. + +1998-02-02 Mark Mitchell + + * calls.c (expand_call): Don't confuse member functions named + realloc, setjmp, and so forth with the standard library + functions of the same names. + +Thu Feb 5 21:59:49 1998 Jeffrey A Law (law@cygnus.com) + + * stmt.c (expand_asm_operands): Correctly identify asm statements + no output operands. + +Thu Feb 5 21:56:06 1998 Mumit Khan + + * c-common.c (decl_attributes): Flag unrecognized attribute + functions as warnings instead of as errors. + +1998-02-05 Marc Lehmann + + * integrate.c (INTEGRATE_THRESHOLD): Inline only small functions + when -Os is specified. + * toplev.c (main): Don't disable flag_inline_functions anymore when + -Os is in effect. + +Fri Feb 6 00:27:36 1998 J"orn Rennecke + + * regmove.c: Update. + * flags.h (flag_regmove): Declare. + * rtl.h (optimize_reg_copy_1, optimize_reg_copy_2): Don't declare. + * local-alloc.c (optimize_reg_copy_1, optimize_reg_copy_2): + Moved into regmove; changed caller. + * toplev.c (rest_of_compilation): Call regmove_optimize also for + expensive_optimizations. + +Thu Feb 5 13:38:42 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Feb 5 01:45:19 1998 J"orn Rennecke + Undo this change (the problem was actually in reload): + Fri Jan 23 23:28:59 1998 J"orn Rennecke + + * sh.md (movqi_i+1): New peephole. + +Tue Feb 3 01:11:12 1998 Jeffrey A Law (law@cygnus.com) + + * jump.c (jump_optimize): Lose calls to modified_in_p they are + not needed anymore due to changes elsewhere in jump.c. + + * jump.c (jump_optimize): Fix first arg to modified_in_p in + previous change. + +Mon Feb 2 19:18:14 1998 Richard Henderson + + * expr.c (expand_builtin_setjmp): Accept two new arguments for + the labels to branch to on first and subsequent executions. Don't + play with __dummy. Rename `setjmp' insn to `builtin_setjmp_setup', + and provide it with the jmp_buf. Use only one of + `builtin_setjmp_receiver' or `nonlocal_goto_receiver', + and provide the former with the target label. + (expand_builtin) [BUILTIN_SETJMP]: Generate a label for use by setjmp. + (expand_builtin) [BUILTIN_LONGJMP]: Split out to ... + (expand_builtin_longjmp): ... here. Recognize a `builtin_longjmp' + insn to replace all of the normal nonlocal_goto code. Don't play + with __dummy. Correct arguments to nonlocal_goto. + * expr.h (expand_builtin_setjmp): Update prototype. + * except.c (start_dynamic_handler): When using builtin_setjmp, + generate more accurate flow information. + + * alpha.md (nonlocal_goto_receiver_osf): Delete. + (nonlocal_goto_receiver_vms): Rename to nonlocal_goto_receiver. + (builtin_longjmp, builtin_setjmp_receiver): New. + * sparc.md (update_return): Disambiguate unspec number. + (nonlocal_goto): Rearrange arguments to match caller in except.c. + (builtin_setjmp_setup): Rename from setjmp. Match and ignore the + jmp_buf operand. + * mips.md (nonlocal_goto_receiver, builtin_setjmp_receiver): Remove. + (builtin_setjmp_setup*, builtin_longjmp): New. + +Mon Feb 2 16:43:10 1998 John Carr + + * mips.md: Change gen_rtx (CONST_INT) to GEN_INT. + +Mon Feb 2 13:06:47 1998 Jim Wilson + + * vmsconfig.com: Remove bytecode references. + +1998-01-30 Andreas Schwab + + * dwarf2out.c (dwarf2out_frame_init): Undo last change, so that + -fno-sjlj-exceptions works for a target that defines + DWARF2_UNWIND_INFO as zero. + + * regmove.c (fixup_match_1): Undo last change which removed some + "useless" code, and add a comment explaining this. + +Mon Feb 2 10:47:14 1998 Gavin Koch (gavin@cygnus.com) + + * mips.c (mips_expand_prologue): Change uses of TARGET_64BIT + to TARGET_LONG64. + +Mon Feb 2 10:38:41 1998 Klaus Kaempf + + * makefile.vms: Remove bytecode references. + Create genrtl files. + +Mon Feb 2 02:08:04 1998 Michael P. Hayes + + * jump.c (jump_optimize): Allow conditional loading of floating point + constants and constants from memory. Reinstalled modified_in_p tests. + +Mon Feb 2 01:38:39 1998 J"orn Rennecke + + * loop.c (get_condition): Handle sign-extended constants. + +Mon Feb 2 01:22:46 1998 Hans-Peter Nilsson + + * expr.c (emit_push_insn): Add code to use movstrti if present. + + * expr.c (emit_push_insn): Use same max-move-amount for movstrhi + and movstrqi as in emit_block_move (). + +Mon Feb 2 00:09:52 1998 Toon Moene + + * config/m68k/x-next: Remove /NextDeveloper/Headers from + the directories to fixinclude - /usr/include is a link + to it and hence its contents are fixed by default. + +Sun Feb 1 14:15:33 1998 Franz Sirl + + * rs6000/linux.h: Define JUMP_TABLES_IN_TEXT_SECTION. + +Sun Feb 1 13:01:15 1998 Klaus Kaempf + + * cccp.c (main): Predefine __VMS_VER on VMS. + +Sun Feb 1 12:39:53 1998 J"orn Rennecke + + * expr.c (get_inner_reference): Use sbitsizetype for type sizes. + * fold-const.c (size_int): Replace with + (size_int_wide). + (make_bit_field_ref): Use bitsize_int for bit position. + * stor-layout.c (sizetype): Delete. + (sizetype_tab, sbitsizetype, ubitsizetype): Declare. + (layout_record, layout_union, layout_type): + Use bitsize_int for bit size. + (set_sizetype): New function. + (make_signed_type, make_unsigned_type): Use it. + * c-decl.c (init_decl_processing): Likewise. + * tree.h (size_int): Don't delcare, #define. + (size_int_wide, sizetype_tab, sbitsize, ubitsize): Declare. + (set_sizetype): Declare. + (bitsize_int, size_int_2, BITS_PER_UNIT_LOG, sizetype, bitsizetype): + Define. + * c-typeck.c (c_sizeof, c_sizeof_nowarn, c_size_in_bytes): + Convert result to sizetype. + (really_start_incremental_init, push_init_level): + Set type of constructor_bit_index to sbitsizetype. + (push_init_level): Use unsigned arithmetic to determine padding. + (output_init_element): Likewise. + +Sun Feb 1 03:32:07 1998 Jeffrey A Law (law@cygnus.com) + + * combine.c (simplify_shift_const): Fix typo in last change. + +Sun Feb 1 02:50:46 1998 John Carr + + * combine.c (simplify_shift_const): (lshiftrt (truncate (lshiftrt))) + is (truncate (lshiftrt)). + +Sun Feb 1 01:06:53 1998 Richard Henderson + + * alpha.c (alpha_expand_unaligned_load): Use expand_binop properly. + Make sure result winds up in TGT. + (alpha_expand_unaligned_store): Use expand_binop properly. Allow + src to be other than DImode. + (alpha_expand_unaligned_load_words): Tidy. Take an offset argument. + (alpha_expand_unaligned_store_words): Likewise. + (alpha_expand_block_move): Use REGNO_POINTER_ALIGN. Restructure so + that source and destination are separately optimized for alignment. + (alpha_expand_block_clear): Use REGNO_POINTER_ALIGN. + +Sun Feb 1 01:55:09 1998 Jeffrey A Law (law@cygnus.com) + + * mips.md (adddi3_internal_2): Be consistent with adddi3 expander + with handling of -32768. + +Sun Feb 1 01:48:18 1998 Kaveh R. Ghazi + + * aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a + shell variable argument instead of only hard coded functions. + (GCC_NEED_DECLARATIONS): New macro to accept multiple functions. + + * configure.in: Collapse multiple calls to AC_CHECK_FUNCS into one + call. Collapse multiple calls to GCC_NEED_DECLARATION into one + call to GCC_NEED_DECLARATIONS (new macro.) Check if we need + declarations for bcopy, bcmp and bzero. + + * acconfig.h: Add stubs for bcopy, bcmp and bzero declarations. + + * gansidecl.h: If we have bcopy but don't declare it, then do so. + Likewise for bcmp and bzero. Only define macros for bcopy, bcmp, + bzero, index and rindex if they aren't already present. + +Sat Jan 31 11:26:58 1998 Jeffrey A Law (law@cygnus.com) + + * toplev.c (close_dump_file): Wrap function prototype for + argument "func" in PROTO. + (dump_rtl): Likewise. + +Fri Jan 30 22:30:39 1998 John Carr + + * sparc.c (sparc_override_options): Make v8plus and ultrasparc set + MASK_V8PLUS. + (output_function_epilogue): Omit epilogue if nothing drops through. + (output_move_double): Suppress int ldd usage on ultrasparc and v9. + (registers_ok_for_ldd_peep): Likewise. + (print_operand): Suppress b,a on ultrasparc. Let Y accept a constant. + (ultrasparc_adjust_cost): New function. + (sparc_issue_rate): New function. + * sparc.h (MASK_VIS, TARGET_VIS): New. + (MASK_V8PLUS, TARGET_V8PLUS): New. + (TARGET_HARD_MUL32, TARGET_HARD_MUL): New. + (TARGET_SWITCHES): Add vis and v8plus. + (REG_CLASS_FROM_LETTER): Accept d and b for VIS. + (REGISTER_MOVE_COST): FP<->INT move cost 12 for ultrasparc. + (RTX_COSTS): Use TARGET_HARD_MUL. + (ADJUST_COST): Call ultrasparc_adjust_cost. + (ISSUE_RATE): New. + * sparc.md (attr type): Add sload, fpmove, fpcmove. Adjust users + of load & fp appropriately. + (supersparc function units): Adjust for Haifa. + (ultrasparc function units): Likewise. + (get_pc_via_rdpc): All v9, not just arch64. + (movdi_v8plus, movdi_v8plus+1): New. + (adddi3_sp32+1): New. + (subdi3_sp32+1): New. + (movsi_insn, movsf_const_insn, movdf_const_insn): Know VIS. + (addsi3, subsi3, anddi3_sp32, andsi3, and_not_di_sp32): Likewise. + (and_not_si, iordi3_sp32, iorsi3, or_not_di_sp32, or_not_si): Likewise. + (xorsi3_sp32, xorsi3, xor_not_di_sp32, xor_not_si): Likewise. + (one_cmpldi2_sp32, one_cmplsi2): Likewise. + (ldd peepholes): Suppress for v9. + (return_adddi): Kill redundant test. Arg1 may be arith_operand. + (return_subsi): Revmove. + +Fri Jan 30 18:30:03 1998 John F Carr + + * mips.c (save_restore_insns): Set RTX_UNCHANGING_P in register + save/restore MEM rtl. + +Fri Jan 30 09:08:16 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Check for declaration of abort. + * acconfig.h: Corresponding changes. + * toplev.c: Use NEED_DECLARATION_ABORT to determine if abort should + be declared. + +Thu Jan 29 20:26:12 1998 Jeffrey A Law (law@cygnus.com) + + * genattrtab.c (optimize): Define in case PRESERVE_DEATH_INFO_REGNO_P + uses it. + +Thu Jan 29 09:27:56 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Jan 29 10:12:27 1998 Jeffrey A Law (law@cygnus.com) + + * configure.in: Check for atoq and atoll. + * rtl.c (read_rtx): Use HAVE_ATOLL and HAVE_ATOQ to select the + proper routine for converting ascii into long long values. + +Thu Jan 29 01:28:14 1998 Klaus Kaempf + + * cccp.c (SYS$SEARCH, SYS$PARSE): Write as upper-case. + + * vmsconfig.com: Remove bytecode references. + + * alpha/vms.h (PREFIX): Define. + + * alpha/vms.h (ASM_OUTPUT_ALIGNED_COMMON): Remove. + + * am-alpha.h: Don't include alloca for OPEN_VMS. + + * alpha/xm-vms.h (HAVE_CPP_STRINGIFY): Define. + + * alpha/xm-vms.h (INCLUDE_DEFAULTS): Define. + (GCC_INCLUDE_DIR): Define. + + * make-cc.com, make-cccp.com, make-cc1.com: Removed. + * makefile.vms: New file. + + * alpha/vms.h (CPP_PREDEFINES): Remove -Dalpha. + + * alpha.c (output_prolog): Output '.name' directive + for minimal traceback information. + + * alpha.c (output_prolog): Don't prepend entry point symbols + with '$' on OPEN_VMS. + +Thu Jan 29 00:25:35 1998 David S. Miller + Jeffrey A Law (law@cygnus.com) + + * rtl.c (read_rtx): Use atol/atoq based upon disposition of + HOST_WIDE_INT. + + * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC + as needed. + * genemit.c (gen_exp): Likewise. + * genpeep.c (match_rtx): Likewise. + * genrecog.c (write_tree_1): Likewise. + + * c-lex.c (yyprint): Use proper format string based upon + disposition of HOST_BITS_PER_WIDE_INT. + (yylex): Put casts in right place for args to build_int_2. + +Thu Jan 29 00:24:29 1998 Jeffrey A Law (law@cygnus.com) + + * combine.c: Fix typos in Jan27 changes. + +Thu Jan 29 00:07:49 1998 Ollivier Robert + + * i386/freebsd.h (LIB_SPEC): Correctly handle -shared, -p and friends. + (LINK_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + +1998-01-28 Mike Stump + + * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after + reload completes. + * genattrtab.c (reload_completed): Define. + + * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Remove obsolete + comments. + +Wed Jan 28 20:11:06 1998 J"orn Rennecke + + * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the + SUBREG_REG if the word count is unchanged, also in the input reload + case. Disable non-applicable sanity checks. + +Wed Jan 28 20:08:26 1998 Jeffrey A Law (law@cygnus.com) + + * config/t-svr4 (TARGET_LIBGCC2_CFLAGS): Add -fPIC. + +Wed Jan 28 20:04:43 1998 Ian Lance Taylor + + * i386/t-cygwin32 (LIMITS_H_TEST, LIBGCC2_INCLUDES): Define. + +Wed Jan 28 11:45:27 1998 Per Bothner + + * dbxout.c (dbxout_type): For a RECORD_TYPE, check that TYPE_BINFO + is a TREE_VEC before trying to use it for baseclasses. + (Chill uses the same field for a different purpose.) + + * toplev.c (strip_off_ending): Generalize to endings up to 5 chars. + +Tue Jan 27 23:15:55 1998 Lassi A. Tuura + + * config.sub: More accurate determination of HP processor types. + +Tue Jan 27 23:11:11 1998 Kaveh R. Ghazi + + * c-lex.c: Include and /. Add + prototype for `handle_sysv_pragma', and make it static. Add + parentheses around assignment used as truth value. + + * combine.c (combine_instructions): Protect variable `prev' with + macro HAVE_cc0. + (can_combine_p): Protect variable `link' with AUTO_INC_DEC. + (extract_left_shift): Add parentheses around operand of &. + (merge_outer_ops): Avoid an empty body in an else-statement. + (gen_rtx_combine): Remove unused variable `i'. + + * sparc/gmon-sol2.c: Include . Make return type of + function monstartup `void'. Likewise for internal_mcount. Add + `static void' prototype for moncontrol. Reconcile sprintf format + vs. args. + + * sparc/sparc.c: Include and /. + Make return type of function_arg_slotno explicitly `int'. + (reg_unused_after): Add parentheses around assignment used as + truth value. + (save_regs): Add explicit braces to avoid ambiguous `else'. + (function_arg_slotno): Add parentheses around && within ||. + (function_arg_pass_by_reference): Likewise. + (sparc_flat_output_function_prologue): Reconcile fprintf format + vs. args. + + * svr4.h (ASM_OUTPUT_LIMITED_STRING): Add parentheses around + assignment used as truth value. + + * cplus-dem.c: Include . + (demangle_signature): Avoid an empty body in an else-statement. + (do_type): Remove unused variable `lvl'. + + * cppexp.c: Don't have depend on MULTIBYTE_CHARS. + Include /. + (cpp_lex): Remove unused variable `namelen'. + (cpp_lex): Explicitly declare `num_chars' as an int. + + * cpplib.c: Avoid duplicate inclusion of , include + instead. Explicitly declare is_system_include + returning int. + (make_assertion): Remove unused variable `kt'. + (cpp_expand_to_buffer): Hide variable `obuf'. + (output_line_command): Remove unused variables, `line_end', + `line_cmd_buf' and `len'. + (macarg): Remove unused variable `arg_start'. + (special_symbol): Remove unused variable `i'. Add parentheses + around assignment used as truth value. + (do_include): Remove unused variables `pcfname' and `retried', + hide `pcf' and `pcfbuflimit'. + (do_line): Remove unused variable `i'. + (finclude): Hide variable `missing_newline'. + (cpp_handle_options): Remove unused variable `j'. + (read_token_list): Remove unused variable `eofp'. + (cpp_error_with_line): Remove unused variable `i'. + (cpp_warning_with_line): Likewise. + (cpp_pedwarn_with_line): Explicitly declare `column' as int. + (cpp_error_from_errno): Remove unused variable `i'. + + * cse.c (invalidate): Add parentheses around assignment used as + truth value. + (find_best_addr): Move declaration of variable `our_cost' inside + the conditional macro where its used. + (fold_rtx): Avoid an empty body in an if-statement. + (cse_insn): Wrap variables `this_insn_cc0_mode' and + `this_insn_cc0' in macro HAVE_cc0. + + * dwarf2out.c: Include and /. + (ASM_OUTPUT_DWARF_DATA8): Reconcile format vs. args in fprintf's. + (output_uleb128): Likewise. + (output_sleb128): Likewise. + (output_cfi): Likewise. + (output_call_frame_info): Remove unused variables `j', `fde_size' + and `fde_pad'. + (comp_unit_has_inlines): Hide declaration as per rest of file. + (size_of_line_prolog): Correct typo in prototype. + (add_arange): Likewise. + (output_aranges): Likewise. + (add_name_and_src_coords_attributes): Likewise. + (gen_array_type_die): Likewise. + (gen_inlined_subroutine_die): Likewise. + (equate_decl_number_to_die): Remove unused variable `i'. + (print_die): Reconcile format vs. args in fprintf's. + (print_dwarf_line_table): Likewise. + (output_die): Likewise. + (output_line_info): Likewise. + (add_subscript_info): Avoid an empty body in an else-statement. + (gen_subprogram_die): Remove unused variable `fp_loc'. + + * dwarfout.c: Explicitly declare `next_pubname_number' as int. + Protect `ordering_attribute' prototype with USE_ORDERING_ATTRIBUTE + macro. Protect `src_coords_attribute' prototype with + DWARF_DECL_COORDINATES macro. Hide `output_entry_point_die' + prototype as in the rest of the file. Likewise for + `output_pointer_type_die' and `output_reference_type_die'. Remove + prototype for `type_of_for_scope'. + (output_unsigned_leb128): Reconcile format vs. args in fprintf. + (type_attribute): Add explicit braces to avoid ambiguous `else'. + + * final.c: Include and /. + (shorten_branches): Protect declaration of tmp_length with + SHORTEN_WITH_ADJUST_INSN_LENGTH and ADJUST_INSN_LENGTH macros. + (profile_function): Protect declaration of `sval' and `cxt' + variables with appropriate macros. + (final_scan_insn): Likewise for `note' variable. Add explicit + braces to avoid empty body in an if-statement. + (output_asm_insn): Move variable `i' inside macro conditional + where it is used. Add parentheses around assignment used as truth + value. + (asm_fprintf): Likewise, likewise. + + * fix-header.c (main): Remove unused variable `done'. Protect + declaration of `i' with FIXPROTO_IGNORE_LIST. + + * pexecute.c: Include . Prototype `my_strerror'. + + * print-rtl.c (print_inline_rtx): Explicitly declare the parameter + `ind'. + + * profile.c: Include /. + (instrument_arcs): Remove unused variables `note', `inverted', + `zero' and `neg_one'. + (branch_prob): Avoid empty body in an if-statement. + + * regclass.c: Include . + (reg_alternate_class): Explicitly declare parameter `regno'. + + * regmove.c (regmove_optimize): Remove unused variable `p'. Add + parentheses around assignment used as truth value. + (find_matches): Remove unused variables `output_operand' and + `matching_operand'. + (fixup_match_1): Remove statement with no effect: "if (0) ;". + + * scan.c (sstring_append): Explicitly declare `count' as int. + (scan_string): Explicitly declare parameter `init' as int. + + * sched.c: Include . + (BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |. + (rank_for_schedule): Add parentheses around assignment used as + truth value. + (schedule_block): Likewise. + (regno_use_in): Likewise. + (schedule_insns): Remove unused variable `i'. + + * toplev.c: Include and /. + (v_message_with_decl): Remove unused variable `n'. + (botch): Explicitly declare parameter `s' as char *. + (main): Add parentheses around assignment used as truth value. + + * tree.c (make_node): Protect the variable `kind' with the + GATHER_STATISTICS macro. + (real_value_from_int_cst): Move variable `e' inside conditional + macro area where it is used. + (tree_last): Add parentheses around assignment used as truth value. + (build1): Protect the variable `kind' with the GATHER_STATISTICS + macro. + (print_obstack_statistics): Reconcile format vs. args in fprintf. + Protect variables `i', `total_nodes', and `total_bytes' with the + GATHER_STATISTICS macro. + +Tue Jan 27 23:01:55 1998 Mike Stump + + * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Add + some comments regarding use of dead_or_set_p. + +Tue Jan 27 22:14:48 1998 Todd Vierling + + * fixincludes: Tweak fix for struct exception in math.h + +Tue Jan 27 17:21:09 1998 Gavin Koch (gavin@cygnus.com) + + * mips/mips.c (mips_expand_prologue,mips_expand_epilogue): + Change mode of registers used to add/sub from + hard_frame_pointer_rtx from word_mode to Pmode. + +Tue Jan 27 11:02:04 1998 Nick Clifton + + * v850.h (ASM_OUTPUT_ALIGNED_BSS): Use + asm_output_aligned_bss() instead of asm_output_bss(). + + * toplev.c (rest_of_compilation): Replace references to + stack_reg_dump_file and dbr_sched_dump_file with references to + rtl_dump_file. + +Tue Jan 27 10:22:13 1998 Kamil Iskra + + * tlink.c (scan_linker_output): Call fclose() for opened files. + +Tue Jan 27 05:05:26 1998 Richard Henderson + + * alpha.c (output_epilog [!VMS]): Don't tag global functions if + compiling with -fpic -- we want to be able to override symbols + properly. + (alpha_expand_block_move): Fix thinko in last change. + + * alpha.h (ASM_OUTPUT_MI_THUNK): New define. + * config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): New define. + * config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): New undef. + +Tue Jan 27 03:21:23 1998 Richard Henderson + + * alpha.md (abssf, absdf): Revert last change. + +Tue Jan 27 00:26:50 1998 John Carr + + * dwarf2out.c (dwarf2out_frame_init): Test value of DWARF2_UNWIND_INFO. + * mips/sni-svr4.h: Define DWARF2_UNWIND_INFO as 0. + +Tue Jan 27 00:07:02 1998 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (gen_lowpart_common): Handle more case where converting + a CONST_INT into SFmode. + +Tue Jan 20 16:01:03 1998 Anthony Green + + * flags.h: New flag (optimize_size). + * toplev.c (main): Parse -Os option and set optimize_space + accordingly. + * gcc.c (default_compilers), cp/lang-specs.h, f/lang-specs.h: Define + __OPTIMIZE_SIZE__ when compiling with -Os. + * config/dsp16xx/dsp16xx.h, config/i386/i386.h, + config/i386/dgux.h, config/i960/i960.h, config/pdp11/pdp11.h, + config/v850/v850.h (OPTIMIZATION_OPTIONS): New SIZE argument + to macro. + * config/i386/i386.c (optimization_options): Accept new SIZE argument. + +Mon Jan 26 23:57:39 1998 Manfred Hollstein + + * libgcc2.c (__clear_insn_cache): On sysV68 enable the memctl + stuff only if MCT_TEXT is #define'd. + +Mon Jan 26 23:52:51 1998 Markus F.X.J. Oberhumer + + * configure.in (i*86-pc-msdosdjgpp): Treat like msdos & go32 + configurations. + +Fri Jan 23 09:39:36 1998 Nick Clifton + + * toplev.c: Add -dM command line option to dump RTL after the + machine dependent reorganization pass, if there is one. + Reorganize RTL dump code, so that only one file handle is + needed. + +Mon Jan 26 12:09:42 1998 Benjamin Kosnik + + * except.c (check_exception_handler_labels): Disable warning when + flag_syntax_only. + +Mon Jan 26 18:17:32 1998 Jim Wilson + + * sparc.c (pic_setup_code): Don't set LABEL_PRESERVE_P. + +Mon Jan 26 18:11:30 1998 J"orn Rennecke + + * c-decl.c (grokdeclarator): Get parameter tags from + last_function_parm_tags. + * dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before + traversing the parameter types. + (output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context. + +Mon Jan 26 01:44:12 1998 Jeffrey A Law (law@cygnus.com) + + * h8300.c (print_operand): Handle CONST_DOUBLE for 'e', 'f', and + the default case. + (get_shift_alg): Fix typo. + +Sun Jan 25 22:22:04 1998 Richard Henderson + + * alpha.c (alpha_expand_block_move): Copy ADDRESSOF to reg. + +Sun Jan 25 22:14:28 1998 Richard Henderson + + * toplev.c (get_run_time): Make sure each case gets its variables. + +Sun Jan 25 22:10:21 1998 Richard Henderson + + * configure.in (build_xm_file): Add auto-config.h if host=build. + (host_xm_file_list): Don't add $(srcdir) to auto-config.h. + (build_xm_file_list): Likewise. + * configure: Rebuild. + +Sun Jan 25 22:00:25 1998 Alasdair Baird + + * recog.c (validate_replace_rtx_1): Only perform substitutions + of arguments to commutative and comparison operators once. + +Sun Jan 25 12:30:18 1998 Kaveh R. Ghazi + + * sparc.c (output_cbranch): Add default case in + enumeration switch. + + * reorg.c (insn_sets_resource_p): Correct typo in prototype. + (emit_delay_sequence): Eliminate unused parameter, all callers + changed. + (fill_simple_delay_slots): Likewise. + (fill_slots_from_thread): Likewise. + (fill_eager_delay_slots): Likewise. + (mark_referenced_resources): Add default case in enumeration switch. + (mark_set_resources): Likewise. + (rare_destination): Likewise. + (mostly_true_jump): Likewise. + (find_dead_or_set_registers): Likewise. + (redirect_with_delay_slots_safe_p): Remove unused variable `slots'. + (update_reg_unused_notes): Remove unused variable `p'. + (mark_target_live_regs): Remove unused variables `next' and + `jump_count'. + (fill_simple_delay_slots): Remove unused variable `j'. + (fill_slots_from_thread): Add parentheses around assignment used + as truth value. + (dbr_schedule): Likewise. + + * objc/Make-lang.in (objc.stage1): Depend on stage1-start. + (objc.stage2, objc.stage3, objc.stage4): Likewise. + +Sun Jan 25 12:13:47 1998 Michael Tiemann + + * cse.c (simplify_ternary_operation): Don't try to simplify + IF_THEN_ELSE expressions (created by combine) that don't use + relational operators. + +Fri Jan 23 22:48:24 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (simplify_ternary_operation): Handle more IF_THEN_ELSE + simplifications. + + * crtstuff.c (init_dummy): Keep the epilogue in the init + section for non-ELF systems. + +Fri Jan 23 23:28:59 1998 J"orn Rennecke + + * sh.md (movqi_i+1): New peephole. + +Fri Jan 23 15:39:42 1998 Jim Wilson + + * Makefile.in: Remove remaining bytecode stuff. + * emit-rtl.c, expr.c: Likewise. + +Fri Jan 23 12:41:10 1998 Nick Clifton (nickc@cygnus.com) + + * toplev.c (lang_options): Add unknown-pragma options. + +Thu Jan 22 23:43:38 1998 Per Bothner + + * dwarfout.c (byte_size_attribute): Simplify and fix - don't need + special (and incomplete) handling for Chill arrays. + +Fri Jan 23 00:27:23 1998 John Carr + + * toplev.c (get_run_time): Call sysconf(_SC_CLK_TCK), when available, + to get clock rate. + +Fri Jan 23 00:19:36 1998 Gavin Koch (gavin@cygnus.com) + + * mips.md (muldi3_internal2): Reverse test for TARGET_MIPS16. + +1998-01-22 scott snyder + + * mips.c (function_prologue): Use HARD_FRAME_POINTER_REGNUM in + .frame directive instead of FRAME_POINTER_REGNUM. + +Fri Jan 23 00:08:55 1998 Robin Kirkham + + * m68k.h (TARGET_SWITCHES): -mcpu32 now clears MASK_68881. + (MACHINE_STATE_m68010_up): Replaced __mc68332__ with __mcpu32__. + * m68k/m68k-none.h(CPP_FPU_SPEC): Update relative to TARGET_SWITCHES. + (CPP_SPEC, ASM_SPEC, CC1_SPEC): Likewise. + (CPP_SPEC): -m68332 defines both __mc68332 and __mcpu32__. + * m68k/t-m68kbare (MULTILIB_OPTIONS): Add mcpu32. + (MULTILIB_MATCHES): -m68332 now uses mcpu32 libraries, not m68000. + (MULTILIB_EXCEPTIONS): Don't build 68881 libraries for m68000, + mcpu32 or m5200. + * longlong.h: Replace __mc68332__ with __mcpu32__. + +Thu Jan 22 19:55:40 1998 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Thu Jan 22 14:47:31 1998 Jim Wilson + + * reload.c (push_reload): In WORD_REGISTER_OPERATIONS code, add test + to require the SUBREG mode to be smaller than the SUBREG_REG mode. + * reload1.c (eliminate_regs): Likewise. + +Thu Jan 22 14:49:14 1998 Jeffrey A Law (law@cygnus.com) + + * regmove.c (find_matches): Initialize matches->earlyclobber too. + +Thu Jan 22 01:40:52 1998 Richard Henderson + + * alpha.md (abssf2, absdf2): Disable in IEEE mode. + (negsf2, negdf2): Use proper subtract in IEEE mode. + +Tue Jan 20 09:29:09 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in: Remove more bytecode stuff. + * expr.c, stmt.c, config/msdos/top.sed: Likewise. + * vax/xm-vms.h, winnt/config-nt.sed: Likewise. + * f/install.texi, objc/Make-lang.in: Likewise. + + * Makefile.in: Remove all bytecode support. + (OBJS): Make sure last entry is a real object file, not EXTRA_OBJS. + * emit-rtl.c: Remove all bytecode support. + * expr.c, expr.h function.c, integrate.c: Likewise. + * output.h, regclass.c, rtl.h, stmt.c, toplev.c: Likewise. + * tree.h, varasm.c: Likewise. + * config/m68k/m68k.h: Likewise. + * bi-*, bc-*, bytecode*: Delete bytecode related files. + * modemap.def: Likewise. + +Tue Jan 20 09:02:31 1998 Gavin Koch (gavin@cygnus.com) + + * mips/mips.md (divsi3,divdi3,modsi3,moddi3,udivsi3,udivdi3, + umodsi3,umoddi3): Handle mips16 div/mod by a constant. + +Mon Jan 19 21:57:00 1998 Richard Henderson + + * i386.md (push): Prohibit symbolic constants if flag_pic. + (movsi+1): Likewise for move to non-register. + +Mon Jan 19 11:15:38 1998 Jim Wilson + + * alpha.c (mode_mask_operand): Accept 0xffffffff on 32 bit host. + (print_operand): Handle 0xffffffff on 32 bit host. + + * configure.in (thread_file): Rename uses before main loop to + target_thread_file. Initialize to empty in main loop. Set thread_file + to target_thread_file after main loop if not set. + * configure: Rebuild. + + * genattrtab.c (find_and_mark_used_attributes): Handle CONST_INT. + (add_values_to_cover): Revert last change (which had no ChangeLog + entry). + (simplify_with_current_value_aux): Handle CONST_INT. + +Mon Jan 19 10:14:55 1998 Andreas Schwab + + * unprotoize.c: Define UNPROTOIZE first, to actually take effect. + +Mon Jan 19 10:11:52 1998 Richard Henderson + + * configure.in: Add cpp stringify test. + * acconfig.h (HAVE_CPP_STRINGIFY): New tag. + * gengenrtl.c: Use it. + * configure, config.in: Rebuild. + +Mon Jan 19 09:43:15 1998 Andreas Schwab + + * Makefile.in (genrtl.c genrtl.h): Add dummy command for GNU make. + +Mon Jan 19 09:38:18 1998 Richard Henderson + + * configure.in: Find declaration for sbrk. + * acconfig.h (NEED_DECLARATION_SBRK): New tag. + * config.in, configure: Rebuild. + * mips-tfile.c: Properly protect declaration of sbrk and free. + * toplev.c: Properly protect declaration of sbrk. + +Sun Jan 18 20:18:01 1998 Richard Henderson + + * alpha.c (alpha_handle_trap_shadows): Ignore CLOBBERs. + +Sun Jan 18 01:54:27 1998 Jeffrey A Law (law@cygnus.com) + + * alpha/xm-winnt.h (HAS_INIT_SECTION): Undefine. + +Sun Jan 18 00:57:35 1998 Mike Stump + + * configure.in (i960-wrs-vxworks): Default to latest vxworks release. + +Sat Jan 17 23:41:36 1998 David S. Miller + + * combine.c (force_to_mode, nonzero_bits): Correctly optimize + constant offset computations from objects with known alignment in + the presence of STACK_BIAS. + + * varasm.c (immed_double_const): Add casts to HOST_WIDE_INT where + necessary. + (const_hash): Hash val is unsigned long. + (SYMHASH): Likewise. + + * tree.c (TYPE_HASH): Type of hash val is unsigned long. + + * print-tree.c (print_node_brief): HOST_PTR_PRINTF format wants a + char pointer, not HOST_WIDE_INT. + (print_node): Likewise. Also hash is unsigned long not + HOST_WIDE_INT. + + * cse.c (canon_hash): Hash is unsigned long not HOST_WIDE_INT. + + * explow.c (optimize_save_area_alloca): New function for targets + where SETJMP_VIA_SAVE_AREA is true. + (allocate_dynamic_stack_space): On SETJMP_VIA_SAVE_AREA targets, + compute the amount of stack space needed should we find later that + setjmp is never called by this function, stuff rtl for this inside + a REG_NOTE of the final SET of stack_pointer_rtx. + * toplev.c (rest_of_compilation): If SETJMP_VIA_SAVE_AREA and + current_function_calls_alloca, call optimize_save_area_alloca. + +Sat Jan 17 23:22:59 1998 John Wehle (john@feith.com) + + * i386.md: Remove redundant integer push patterns. + Don't bother checking for TARGET_PUSH_MEMORY when + pushing constants or registers. + +Sat Jan 17 22:35:39 1998 Mumit Khan + J.J VanderHeijden + + * pexecute.c (pexecute): New function for mingw32. Supports pipes. + (pwait): New function for mingw32. + + * gcc.c (execute): Mingw32 pexecute() supports pipes, but cygwin32 + pipe support is broken for now. + +1998-01-17 Lee Iverson + + * emit_rtl.c (init_emit_once): Ensure that potential aliasing + between frame_pointer_rtx, hard_frame_pointer_rtx, and + arg_pointer_rtx is respected in initialization. + (init_emit_once): Use gen_rtx_raw_REG() to create + return_address_pointer_rtx. + + * reorg.c: #include "expr.h" for rtx prototypes. + * Makefile.in (reorg.o): Depend on expr.h + +Sat Jan 17 21:28:08 1998 Pieter Nagel + + * Makefile.in (FLAGS_TO_PASS): Pass down gcc_include_dir and + local_prefix to sub-make invocations. + +Sat Jan 17 21:24:16 1998 David T. McWherter + + * objc-parse.c: Recognize protocol qualifiers in class definitions. + +Sat Jan 17 21:16:19 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.h: Fix typos. + + * acconfig.h (NEED_DECLARATION_ATOL): New declaration to check for. + * configure.in: Check for atol. + * rtl.c (atol): Only provide the declaration if NEED_DECLARATION_ATOL. + + * rtl.c (read_rtx): Initialize list_rtx to NULL, not NULL_RTX. + + * loop.c (find_and_verify_loops): When attempting to move insns from + inside the loop outside the loop, create a BARRIER if no suitable + one was found. + + * jump.c (jump_optimize): Remove Dec 17, 1997 chance in + favor of an equivalent change from gcc-2.8. + + * i386/x-sco5 (CC): Remove trailing whitespace. + +Sat Jan 17 21:09:46 1998 Kaveh R. Ghazi + + * gengenrtl.c (type_from_format): De-ANSIfy function signature. + (accessor_from_format): Likewise. + (xmalloc): New function for use when linking with alloca.o. + +Mon Jan 5 02:53:01 1998 Bruno Haible + + * frame.c (find_fde): Correct FDE's upper bound. + +Fri Jan 16 16:23:52 1998 Richard Henderson + + * gengenrtl.c (DEF_RTL_EXPR): Provide a K&R compliant version. + +Fri Jan 16 10:16:10 1998 Jeffrey A Law (law@cygnus.com) + + * calls.c (expand_call): Move #ifdef code out of macro argument + lists. + (emit_library_call, emit_library_call_value): Likewise. + +Fri Jan 16 00:46:40 1998 Jeffrey A Law (law@cygnus.com) + + * rtl.def (INLINE_HEADER): Fix bug exposed by gen_rtx_FOO changes. + +Thu Jan 15 01:02:30 1998 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Wed Jan 14 22:49:17 1998 Richard Henderson + + * alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO; + change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...). + * caller-save.c, calls.c, combine.c, cse.c: Likewise. + * dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise. + * final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise. + * halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise. + * profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise. + * reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise. + * unroll.c, varasm.c: Likewise. + * config/alpha/alpha.c, config/alpha/alpha.md: Likewise. + +Wed Jan 14 19:36:08 1998 Gavin Koch (gavin@cygnus.com) + + * mips.h: Fix some type-o's from a previous change. + +Wed Jan 14 01:26:05 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (check_dbra_loop): Make sure initial value is a + CONST_INT before trying to normalize it. + +Tue Jan 13 23:27:54 1998 Robert Lipe (robertl@dgii.com) + + * sco5.h (ASM_OUTPUT_SECTION_NAME): Refresh from ../svr4.h. + +Tue Jan 13 22:47:02 1998 Herman ten Brugge + + * cppexp.c: Include gansidecl.h + +Tue Jan 13 22:43:35 1998 Ian Lance Taylor + + * svr4.h (LINK_SPEC): Never specify -h. + * ptx4.h (LINK_SPEC): Likewise. + * rs6000/sysv4.h (LINK_SPEC): Likewise. + * sparc/sol2.h (LINK_SPEC): Likewise. + +Tue Jan 13 22:39:40 1998 Richard Henderson (rth@cygnus.com) + + * c-typeck.c (comptypes): Exit early on NULL input. + + * haifa-sched.c (schedule_insns): Correctly remove inter-block + dependencies after reload. + +Tue Jan 13 22:22:31 1998 Franz Sirl + + * rs6000/linux.h (CPP_PREDEFINES): Add -D__ELF__. + +Tue Jan 13 22:14:57 1998 Klaus Kaempf + + * alpha/vms.h (DIR_SEPARATOR): Define. + +Tue Jan 13 22:13:04 1998 Bruno Haible + + * Makefile.in (stamp-proto): Remove. + (protoize.o, unprotoize.o): Straightforward compile. + * unprotoize.c: Define UNPROTOIZE here, not in the Makefile. + +Tue Jan 13 21:59:39 1998 Mumit Khan + + * i386/cygwin32.h (STRIP_NAME_ENCODING): Define for Win32 to strip + off the trailing @[NUM] added by ENCODE_SECTION_INFO. + +Tue Jan 13 21:55:06 1998 Jeffrey A Law (law@cygnus.com) + + * arm/netbsd.h (DWARF2_UNWIND_INFO): Define as zero for now. + * i386/netbsd.h, m68k/netbsd.h, ns32k/netbsd.h: Likewise. + * sparc/netbsd.h, vax/netbsd.h: Likewise. + +Tue Jan 13 21:37:07 1998 Shigeya Suzuki + + * i386/bsd386.h (DWARF2_UNWIND_INFO): Define as zero for now. + +Tue Jan 13 17:50:55 1998 Jim Wilson + + * configure.in (target_cpu_default, target_cpu_default2): Use double + quotes around them when testing their value. + * configure: Rebuilt. + +Tue Jan 13 09:07:44 1998 John Carr + + * gengenrtl.c (gencode): Emit new function obstack_alloc_rtx + to allocate rtx. + (gendef): Call obstack_alloc_rtx. + +Tue Jan 13 01:16:36 1998 Robert Lipe (robertl@dgii.com) + + * configure.in (i[3456]86-UnixWare7-sysv5): Treat much like SVR4 + for now. + +Thu Dec 18 18:40:17 1997 Mumit Khan + + * i386/mingw32.h (INCOMING_RETURN_ADDR_RTX): Delete. Use the value + of DWARF2_UNWIND_INFO, if any, from i386/cygwin32.h instead. + (STANDARD_INCLUDE_DIR): Change to /usr/local/i386-mingw32/include. + +Tue Jan 13 00:44:02 1998 Jim Wilson + + * mips.md (return_internal): Change mode from SImode to VOIDmode. + +Sat Jan 10 22:11:39 1998 J. Kean Johnston + + * i386/sco5.h (STARTFILE_SPEC, ENDFILE_SPEC): Correctly handle + "-static". + +Sat Jan 10 22:04:15 1998 Stan Cox + + * i386.md (movsicc_1, movhicc_1): For alternate 3 set the opcode + suffix from operand 3. + +Sat Jan 10 21:50:16 1998 J"orn Rennecke + Jeffrey A Law (law@cygnus.com) + + * regmove.c: New implementation of regmove pass. + * local-alloc.c (optimize_reg_copy_1, optimize_reg_copy_2): Remove + decls, make them have external linkage. Return a value from + optimize_reg_copy_1. + * reload.h (count_occurrences): Add decl. + * reload1.c (count_occurrences): Delete decl, make it have external + linkage. + * rtl.h (optimize_reg_copy_1, optimize_reg_copy_2): Declare. + +Sat Jan 10 20:30:12 1998 Jeffrey A Law (law@cygnus.com) + + * regclass.c (record_address_regs): Don't use REG_OK_FOR_BASE_P + if it is not defined. + +Thu Jan 8 21:06:54 1998 Richard Henderson + + * Makefile.in (OBJ, GEN, RTL_H): Add genrtl.[oh] bits. + * emit-rtl.c (gen_rtx): Move special code to ... + (gen_rtx_CONST_INT): New function. + (gen_rtx_REG): New function. + (*): Update all calls to gen_rtx. + * genemit.c (gen_exp): Emit calls to gen_rtx_FOO for constant FOO. + * rtl.h: Include genrtl.h; prototype CONST_INT & REG generators. + (GEN_INT): Call gen_rtx_CONST_INT. + * gengenrtl.c: New file. + +Mon Jan 5 13:00:18 1998 John F. Carr + + * alias.c (*_dependence): Call base_alias_check before canon_rtx. + (base_alias_check): If no base found for address call canon_rtx and + try again. + +Mon Jan 5 11:39:49 1998 Jeffrey A Law (law@cygnus.com) + + * mips.c (mips_expand_prologue): Handle large frame with no outgoing + arguments for mips16. + (mips_expand_epilogue): Pass "orig_tsize" to save_restore_insns. + Don't lose if tsize is zero after handling large stack for mips16. + * mips.md (return): For trivial return, return address is in $31. + +Sun Jan 4 20:24:00 1998 Nigel Stephens + + * mips/mips16.S: Various changes to make it work with -msingle-float + and -EL. + +Sun Jan 4 14:25:18 1998 Gavin Koch + Ian Lance Taylor + Jeff Law + + * mips.c, mips.h, mips.md: First cut at merging in mips16 + support. Major modifications throughout all three files. + +Sun Jan 4 01:01:50 1998 scott snyder + + * configure.in: Make gthr-default.h a forwarding header instead of + a symlink. + +Sat Jan 3 12:08:06 1998 Kaveh R. Ghazi + + * gcov-io.h: Include sys/types.h to ensure we get size_t. + + * pa.h (ASM_OUTPUT_MI_THUNK): Add missing % in fprintf. + +Fri Jan 2 23:40:09 1998 Jim Wilson (wilson@cygnus.com) + Jeffrey A Law (law@cygnus.com) + + * crtstuff.c (__frame_dummy): New function for irix6. + (__do_global_ctors): Call __frame_dummy for irix6. + * iris6.h (LINK_SPEC): Hide __frame_dummy too. + +Fri Jan 2 04:57:57 1998 Weiwen Liu + + * alpha.c (vms_valid_decl_attribute_p): Move within #if OPEN_VMS. + +Fri Jan 2 04:34:14 1998 Richard Henderson + + * c-decl.c (init_decl_processing): Provide proper fallback symbol + for __builtin_memset. + * expr.c (expand_builtin) [MEMSET]: Arg 3 type code is INTEGER_TYPE + not INTEGER_CST. Assert arg 3 is a constant. + + * alpha.c (mode_width_operand): Accept 64-bit modes. + (mode_mask_operand): Likewise. + (print_operand): Likewise for 'M' and 'U' codes. + (alpha_expand_unaligned_load): New function. + (alpha_expand_unaligned_store): Likewise. + (alpha_expand_unaligned_load_words): Likewise. + (alpha_expand_unaligned_store_words): Likewise. + (alpha_expand_block_move): Likewise. + (alpha_expand_block_clear): Likewise. + * alpha.h (MOVE_RATIO): New define. + * alpha.md (extxl, ext*h, ins*l, mskxl): Name them. + (insql, insxh, mskxh, extv, extzv, insv, movstrqi, clrstrqi): New. + + * alpha.h (ASM_OUTPUT_LOOP_ALIGN, ASM_OUTPUT_ALIGN_CODE): Set to 3. + (CONSTANT_ALIGNMENT, DATA_ALIGNMENT): Disable. + +Thu Jan 1 15:40:15 1998 Richard Henderson + + * configure.in: Put parenthesis around TARGET_CPU_DEFAULT's value. + * configure: Update. + +Thu Jan 1 10:49:12 1998 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (operand_subword): Correctly handle extracting a word + from a CONST_DOUBLE for 16bit targets with !WORDS_BIG_ENDIAN. + + * mn10200.md (tstxx, cmpxx): Use "nonimmediate_operand" as predicate + for first argument. diff --git a/contrib/gcc/ChangeLog-1999 b/contrib/gcc/ChangeLog-1999 new file mode 100644 index 00000000000..add129de3d1 --- /dev/null +++ b/contrib/gcc/ChangeLog-1999 @@ -0,0 +1,21786 @@ +Fri Dec 31 19:10:31 1999 Richard Kenner + + * function.c (update_temp_slot_address): Handle case where sum of + temporary address plus offset in register is a valid address. + +1999-12-30 Herman A.J. ten Brugge + + * genrecog.c (change_state) Corrected typo. + +1999-12-30 Kaveh R. Ghazi + + * system.h (bcopy, bcmp, bzero, index, rindex, atof, atol, free, + getcwd, getenv, getwd, sbrk, strstr, malloc, calloc, realloc, + strerror, getrlimit, setrlimit, abort): Add prototype arguments. + +1999-12-30 Bernd Schmidt + + * i386.c (ix86_expand_fp_compare): In non-sahf non-TARGET_IEEE + case, expand GT comparisons correctly. Fix a comment before this + part of the code. + +1999-12-30 Gabriel Dos Reis + + * dwarfout.c: Include "frame.h" + * dwarf2out.c: Likewise. + * Makefile.in (dwarfout.o): Depend on frame.h + (dwarf2out.o): Likewise. + +1999-12-29 "Martin v. Loewis" + + Restore i386 binary compatibility in Dwarf EH info. + * config/i386/i386.h (DWARF_FRAME_REGISTERS): Define as 17, the old + value of FIRST_PSEUDO_REGISTER. + * frame.h (DWARF_FRAME_REGISTERS): Default to FIRST_PSEUDO_REGISTER. + (struct frame_state): Use DWARF_FRAME_REGISTERS. + * dwarfout.c (output_reg_number): Ditto. + * dwarf2out.c (reg_number, expand_builtin_init_dwarf_reg_sizes): Ditto. + (DWARF_FRAME_RETURN_COLUMN): Default to DWARF_FRAME_REGISTERS. + +1999-12-29 Bruce Korb + + * fixinc/fixincl.c(wait_for_pid): sometimes a WSTOPSIG of zero is OK + * fixinc/fixincl.tpl(TEST_CT): Just do the existence test once + (_RE_CT): not needed + * fixinc/fixlib.c(is_cxx_header): moved from fixtests.c + rewritten to scan the file text once only + "template<..." test added + * fixinc/fixlib.h(apply_fix_p_t): moved from fixtests.c + (is_cxx_header): declaration added + * fixinc/fixtests.c(is_cxx_header): removed + (apply_fix_p_t): removed + (double_slash_test): is_cxx_header is only called once now + * fixinc/hackshell.tpl: indexing the fixes is now done under DEBUG + * fixinc/inclhack.def(FIXINC_DEBUG): added for testing DEBUG state + within the templates. + The borken spelling of "broken" was fixed. + * fixinc/inclhack.tpl: The $VERBOSE level is used on various messages + The default level depends on FIXINC_DEBUG. + +1999-12-29 Kaveh R. Ghazi + + * crtstuff.c: If !inhibit_libc, include stdlib.h/unistd.h. + Otherwise provide a declaration for atexit. + (init_dummy): Make sure dummy call to atexit is nevertheless + called with correct number of args. + + * frame.c: Update comments referring to other files. + + * libgcc2.c: Likewise. + +1999-12-29 Kaveh R. Ghazi + + * cse.c (free_element, get_element): Remove unused prototypes. + + * fold-const.c (extract_muldiv): Initialize variables `op0' and + `op1'. + + * jump.c (invert_exp): Add explicit braces to avoid ambiguous + `else' clauses. + +Wed Dec 29 12:44:54 1999 Donald Lindsay + + * configure.in,configure: case arm for mn10200-*-* now sets + float_format=i32 so that float.h will correctly claim "double" + to be 32 bits. Ran autoconf to generate configure from .in file. + +Wed Dec 29 10:53:21 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (conditional zero): If op1 is a register, force it into + the same register as op0. + +1999-12-28 Mark Mitchell + + * tree.h (BINFO_BASETYPES): Improve documentation. + +1999-12-28 Kaveh R. Ghazi + + * configure.in (--enable-checking): Use a more portable `for' + loop syntax. + +1999-12-28 Kaveh R. Ghazi + + * configure.in (AC_DECL_SYS_SIGLIST, xm-siglist.h, + arm/xm-netbsd.h, NO_SYS_SIGLIST): Don't use. + + * xm-siglist.h, arm/xm-netbsd.h, mips/xm-news.h, mips/xm-sysv4.h: + Delete files. + + * gcc.texi (NO_SYS_SIGLIST, sys_siglist, SYS_SIGLIST_DECLARED): + Delete descriptions. + + * i386/osf1elf.h, i386/xm-cygwin.h, i386/xm-mingw32.h, m68k/3b1.h, + m68k/a-ux.h, m68k/dpx2.h, m68k/plexus.h, m68k/xm-hp320.h, + m88k/xm-m88k.h, mips/x-sni-svr4, pa/xm-pa.h, pa/xm-pahpux.h, + pa/xm-papro.h, we32k/xm-we32k.h, winnt/xm-winnt.h, xm-interix.h, + xm-svr4.h: Remove all instances of sys_siglist handling. + +1999-12-27 Jakub Jelinek + + * config/sparc/sparc.md (cmp_zero_qi, + cmp_zero_extendqisi2_andcc_set, cmp_zero_qi_sp64, + cmp_zero_extendqidi2_andcc_set): New patterns. + +1999-12-28 Manfred Hollstein + + * m68k/t-mot3300-gald (CROSS_LIBGCC1): Define to libgcc1-asm.a. + (LIB1ASMSRC, LIB1ASMFUNCS, LIB2FUNCS_EXTRA): Define. + (fpgnulib.c, xfgnulib.c): Add rules. + * m68k/t-mot3300-gas: Likewise. + +1999-12-27 Ian Lance Taylor + + * configure.in: Avoid [[ by using test and changequote. Add + changequote required by 1999-12-14 change. + * configure: Rebuild. + +1999-12-27 Clinton Popetz + + * config/mips/mips.h: Fix typo from 12/17/99 libgcc2 fix. + +1999-12-27 Christophe Jaillet + + * alias.c (nonlocal_reference_p): Add else for disjoint ifs. + * flow.c (find_use_as_address): Likewise. + * function.c (fixup_var_refs_1): Likewise. + (walk_fixup_memory_subreg, fixup_stack_1): Likewise. + * jump.c (invert_exp, redirect_exp): Likewise. + * loop.c (replace_call_address): Likewise. + (count_nonfixed_reads): Likewise. + * rtlanal.c (modified_between_p): Likewise. + (modified_in_p, volatile_insn_p, volatile_refs_p): Likewise. + (side_effects_p, replace_regs, jmp_uses_reg_or_mem): Likewise. + * unroll.c (remap_split_bivs): Likewise. + +1999-12-27 Kaveh R. Ghazi + + * diagnostic.c (v_message_with_decl): Use .* format specifier + instead of building the format specifier width manually. + + * system.h (strsignal): Don't check HAVE_STRSIGNAL when + determining whether to provide a prototype. Remove the + sys_siglist clause in the conditional. + +1999-12-23 Martin v. Löwis + + * fold-const.c (operand_equal_p): Use memcmp to compare string + constants. + Suggested by D. J. Bernstein + +1999-12-17 Jakub Jelinek + + * config/h8300/h8300.h (TARGET_H8300H, TARGET_H8300S): Make sure + UNITS_PER_WORD and BITS_PER_WORD are compile time constants when + compiling libgcc2. + * config/mips/mips.h (TARGET_64BIT): Likewise. + * config/rs6000/rs6000.h (TARGET_POWERPC64): Likewise. + * libgcc2.c: Use {,U}{HW,W,DW}type and DWunion everywhere instead + of {SI,DI}type and DIunion. Define these types to QI/HI modes on + dsps. Give routines proper names if SI/DI modes are not used. + * longlong.h: Use DWunion instead of DIunion. + +1999-12-26 Zack Weinberg + + * acconfig.h: New ENABLE flags: TREE_CHECKING, RTL_CHECKING, + GC_CHECKING, GC_ALWAYS_COLLECT. + * configure.in: Allow --enable-checking with an argument + listing check modes to enable. + * config.in, configure: Rebuilt. + * ggc-page.c, ggc-simple.c: Define GGC_POISON (and + GGC_ALWAYS_VERIFY for ggc-simple.c) only if + ENABLE_GC_CHECKING. Define GGC_ALWAYS_COLLECT only if + ENABLE_GC_ALWAYS_COLLECT. + * rtl.h, rtl.c: Change ENABLE_CHECKING to ENABLE_RTL_CHECKING + throughout. + * tree.h, tree.c: Change ENABLE_CHECKING to + ENABLE_TREE_CHECKING throughout. + +Sun Dec 26 07:48:20 1999 Richard Kenner + + * fold-const.c (fold_truthop): Properly check for FP RHS. + +1999-12-24 Mark Mitchell + + * toplev.h (note_deferall_of_defined_inline_function): Declare. + * toplev.c (note_deferral_of_defined_inline_function): New + function, split out from ... + (rest_of_compilation): ... here. Use it. + +Fri Dec 24 12:34:26 1999 Richard Kenner + + * expr.c (store_constructor): Don't call clear_storage if size is + variable. + +1999-12-24 Kaveh R. Ghazi + + * Makefile.in (toplev.o): Depend on loop.h. + + * dwarfout.c: Include tm_p.h. + + * emit-rtl.c (restore_emit_status): Mark parameter with + ATTRIBUTE_UNUSED. + + * final.c (final_scan_insn): Likewise. + + * flow.c (flow_nodes_print, flow_exits_print, flow_loops_cfg_dump, + flow_loop_nested_p, flow_loop_exits_find, flow_loop_nodes_find, + flow_depth_first_order_compute, flow_loop_pre_header_find, + flow_loop_tree_node_add, flow_loops_tree_build, + flow_loop_level_compute, flow_loops_level_compute, + flow_loop_outside_edge_p): Add prototypes. + (recompute_reg_usage): Mark parameters with ATTRIBUTE_UNUSED. + + * ggc-callbacks.c (lang_mark_tree, lang_mark_false_label_stack): + Mark with ATTRIBUTE_NORETURN. + + * hash.c (hash_newfunc): Mark parameter with ATTRIBUTE_UNUSED. + + * local-alloc.c (no_conflict_p): Likewise. + + * loop.c (insert_bct): Hide definitions of variables with hidden + usage. + (note_reg_stored): Mark parameter with ATTRIBUTE_UNUSED. + + * regclass.c (memory_move_secondary_cost): Mark variable `mem' + with ATTRIBUTE_UNUSED. + (record_reg_classes): Mark parameter with ATTRIBUTE_UNUSED. + (reg_scan): Likewise. + + * reload.c (find_reloads): Remove unused variables `changed'. + + * reload1.c (reload_reg_class_lower): Don't unnecessarily cast + away const-ness. + (allocate_reload_reg): Mark parameter with ATTRIBUTE_UNUSED. + Remove unused variable `insn'. + + * toplev.c: Include loop.h. + (report_file_and_line): Remove unnecessary prototype. + + * tree.c (build_block): Mark parameter with ATTRIBUTE_UNUSED. + + * unroll.c (biv_total_increment): Likewise. + +Thu Dec 23 23:15:22 1999 J"orn Rennecke + + * reload1.c (emit_input_reload_insns): Restore old behavior + wrt. 'special' reloads. + +1999-12-23 Zack Weinberg + + * Makefile.in (ggc-simple.c, ggc-page.c): Don't depend on + hash.h. (cse.c): Don't depend on hashtab.h. + + * cse.c: Don't include hashtab.h. + (hash_cse_reg_info, cse_reg_info_equal_p): Delete prototypes + of dead functions. + * ggc-simple.c: Don't include hash.h. + +1999-12-22 Jason Merrill + + * dwarf2out.c (add_abstract_origin_attribute): Call + gen_abstract_function on our function context. + +Thu Dec 23 03:57:10 1999 Hans-Peter Nilsson + + * Makefile.in (INTEGRATE_H): Fix typo: INTEGRATE_H, not INTREGRATE_H. + +1999-12-23 Michael Hayes + + * config/c4x/c4x.c (c4x_address_cost): Add statement to default + case in switch. + +1999-12-22 Michael Hayes + + * config/c4x/c4x.md (*addqi3_noclobber_reload): Change operand 0 + constraints to "a!r". + +1999-12-21 Mark Mitchell + + * Makefile.in (calls.o): Depend on function.h. + (alias.o): Likewise. + +1999-12-21 Bernd Schmidt + + * reload1.c (emit_reload_insns): Break out code and variables into... + (input_reload_insns, other_input_address_reload_insns, + other_input_reload_insns, input_address_reload_insns, + inpaddr_address_reload_insns, output_reload_insns, + output_address_reload_insns, outaddr_address_reload_insns, + operand_reload_insns, other_operand_reload_insns, + other_output_reload_insns): ... new static variables, and... + (emit_input_reload_insns, emit_output_reload_insns, do_input_reload, + do_output_reload): ... new functions. + +Tue Dec 21 07:06:36 1999 Richard Kenner + + * pa.h (FUNCTION_ARG_BOUNDARY): Never return 0. + +1999-12-21 Michael Hayes + + * md.texi: Add c4x constraints documentation. + +1999-12-21 Martin v. Löwis + + * config/i386/dgux.c (struct option): Rename to + lang_independent_option. + (struct m_options): Add description field. + (output_options): Rename option type, add sep declaration, output + ix86_cpu_string and ix86_arch_string only if set. + (output_file_start): Rename option type. + +Mon Dec 20 23:15:36 1999 Mike Stump + + * Makefile.in (crtbegin.o, crtend.o, s-crtS): Depend on + stmp-int-hdrs. + (libgcc2.a): Similarly. + +Mon Dec 20 23:06:47 1999 David Edelsohn + + * longlong.h (_ARCH_PPC): Only protect add_ssaaaa and sub_ddmmss + with W_TYPE_SIZE == 32. Do not fall through to POWER architecture + for umul_ppmm and smul_ppmm if !_ARCH_PPC and !_ARCH_POWER. + +Mon Dec 20 23:02:03 1999 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (real_hex_to_f): Remove unused "isldouble" variable. + Remove redundant initialization of "frexpon" and "expon". + +Mon Dec 20 15:00:04 1999 Richard Kenner + + * tree.c (real_value_from_int_cst): Clear REAL_VALUE_TYPE object first. + + * expr.c (store_constructor): New argument SIZE; pass to clear_storage. + (store_constructor_field, expand_expr): Pass new arg. + +1999-12-20 Mark Mitchell + + * Makefile.in (explow.o): Depend on function.h. + + * stor-layout.c (set_sizetype): Fix typo. + +1999-12-20 Bernd Schmidt + + * function.c (cfun): Renamed from current_function. All users + changed. + * function.h (cfun): Rename declaration as well. + + * reload.h (struct insn_chain): Change live_throughout and dead_or_set + to be of type regset_head, not regset. All users changed by adding + address operator. + * reload1.c (new_insn_chain): Don't allocate regsets, just clear them. + +1999-12-20 Michael Hayes + + * config/c4x/rtems.h: New file. + +1999-12-19 Bernd Schmidt + + * reload1.c (spill_failure): Take class of failed reload as argument + and print it. Caller changed. + +Sun Dec 19 07:50:42 1999 Richard Kenner + + * rs6000.h (SUBTARGET_DEFAULT): New macro. + (TARGET_SWITCHES): Allow subtargets to default switches. + * rs6000/vxppc.h (SUBTARGET_DEFAULT): New macro. + +1999-12-18 Mark Mitchell + + * crtstuff.c (__do_global_ctors_aux): Do not call __cxa_finalize + in a main program. + +Sat Dec 18 20:42:43 1999 Richard Henderson + + * cccp.c (main): Define __STDC_VERSION__ as necessary. + * cppinit.c (cpp_handle_option): Likewise. + + * ginclude/stdarg.h (va_copy): Use __STDC_VERSION__ to + determine when to define. + +Sat Dec 18 20:34:00 1999 Richard Henderson + + * alpha.c (alpha_emit_conditional_move): If TARGET_FIX, handle + cmove with mismatched test and data modes. + +Sat Dec 18 20:30:15 1999 Richard Henderson + + * c-typeck.c (c_expand_start_case): Don't warn for long switch + in system headers. + +Sat Dec 18 16:28:43 1999 Richard Kenner + + * alias.c: Minor reformatting. + * flow.c: Likewise. + * regs.h: Likewise. + * stor-layout.c: Likewise. + * fold-const.c: Likewise. + (OVERFLOW_SUM_SIGN): Renamed from overflow_sum_sign. + (struct cb_args, const_binop_1, const_binop): Pass type of arg, + not arg itself. + (size_int_wide): Cache nodes even if garbage collecting. + (twoval_comparison_p): Reenable SAVE_EXPR case if operand + of SAVE_EXPR has no side effects. + * cse.c: Move a comment. + * tree.c: Minor reformatting. + (int_size_in_bytes): Return -1 if constant overflows. + +Sat Dec 18 18:30:20 1999 J"orn Rennecke + + * unroll.c (copy_loop_body): Don't treat a REG like a PLUS. + +1999-12-18 10:42 -0800 Zack Weinberg + + * objc/objc-parse.c: Regenerate. This file must be rebuilt + after any change to c-parse.in, even if objc-parse.y didn't + change. Oops. + +1999-12-18 David S. Miller + + * toplev.c (rest_of_compilation): Restore BLOCK tree + reconstruction and branch shortening changes lost in + December 18th change. + +Sat Dec 18 05:29:29 1999 Scott Bambrough + + * config/arm/linux-elf.h: Change all instances of + ARM_FLAG_SHORT_BYTES to ARM_FLAG_MMU_TRAPS. + * config/arm/uclinux-elf.h: Likewise. + +1999-12-18 Gabriel Dos Reis + + * toplev.c (notice, vmessage, v_message_with_file_and_line, + v_message_with_decl, file_and_line_for_asm, + v_error_with_file_and_line, v_error_with_decl, v_error_for_asm, + verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl, + v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl, + v_pedwarn_with_file_and_line, vsorry, vnotice, count_error, + pfatal_with_name, fatal_io_error, need_error_newline, + last_error_function, last_error_tick, announce_function, + default_print_error_function, print_error_function, + report_error_function, fnotice, error_with_file_and_line, + error_with_decl, error_for_asm, error, set_fatal_function, fatal, + _fatal_insn, _fatal_insn_not_found, warning_with_file_and_line, + warning_with_decl, warning_for_asm, warning, pedwarn, + pedwarn_with_decl, pedwarn_with_file_and_line, sorry): Move to + diagnostic.c + (compile_file): Use fnotice instead of notice. Adjust call. + + * diagnostic.c: New file. + + * Makefile.in (OBJS): Include diagnostic.o + (diagnostic.o): Define dependence. + +1999-12-18 Michael Hayes + + * config/c4x/c4x.h (ASM_OUTPUT_XXX): Wrap in do-while(0). + Tweak formatting. + +1999-12-18 Michael Hayes + + * config/c4x/c4x.md (rpts_top, rptb_top): Add clobbers for rs and re. + +1999-12-17 13:21 -0800 Zack Weinberg + + * fixtests.c (is_cxx_header): New fn, split out of + double_slash_test. + (else_endif_label): Allow "#endif // comment" in C++ headers, + as determined by is_cxx_header. + * fixfixes.c (else_endif_label_fix): Update comment. + * fixincl.c: Don't output VERB_PROGRESS lines if stdout is not + a tty. + * genfixes: Correct double thinko in commandline parsing. + * hackshell.tpl: Generate correct sh syntax for bypass + entries. + + * inclhack.def (all): Whenever an inserted preprocessor + conditional is split over multiple lines, use double + backslashes in this file so the fixed header will be readable. + + (AAB_fd_zero_glibc_1_0): Rename to AAB_fd_zero_asm_posix_types_h + and add bypass entry for correct version of this header. + (AAB_fd_zero_glibc_1_x): Rename to AAB_fd_zero_gnu_types_h. + (AAB_fd_zero_glibc_2_0): Rename to AAB_fd_zero_selectbits_h. + + (hpux8_bogus_inlines): New fix, split from... + (ultrix_atof_param) ... here. + (math_expression): Add bypass entry keyed to glibc comment + indicating the problem has been dealt with; disable + unnecessary sed operations; update commentary. + (math_gcc_ifndefs): Rename to math_huge_val_from_dbl_max, + add select and bypass entries, simplify shell operation. + (math_huge_val_ifndef): Split from math_gcc_ifndefs. + + (ip_missing_semi, rs6000_param, tinfo_cplusplus, + ultrix_atof_param): Add select entry. + (stdio_va_list, sunos_mather_decl): Add bypass entry. + (systypes_for_aix, sysv86_string, tinfo_cplusplus): Put the + comments with the fixes they describe. + + * c-parse.in (string action): Do not warn about ANSI string + concatenation in system headers. Affects C parser only. + * c-parse.y, c-parse.c, c-parse.h: Rebuild. + +1999-12-16 Jakub Jelinek + + * config/sparc/sparc.h (TARGET_ARCH32): Exchange ifdefs so that if + compiling libgcc2 the macro depends always on arch cpp defines. + +Fri Dec 17 10:34:16 1999 Richard Earnshaw + + * loop.c (insert_loop_mem): Don't record MEMs from inside + EXPR_LISTs. + +Fri Dec 17 12:08:11 MET 1999 Jan Hubicka + + * regclass.c (regclass): Do not use flowgraph when not optimizing. + + * gcse.c (try_replace_reg): Do replacements in REG_EQUAL/REG_EQUIV + notes too, create one when replacement failed, attempt to simplify + resulting notes. + (cprop_insn): Propagate even to registers mentioned only in REG_EQUAL + or REG_EQUIV notes. + +1999-12-16 Mark Mitchell + + * crtstuff.c (__dso_handle): Declare. + (__cxa_finalize): Likewise. + (do_global_dtors_aux): Call __cxa_finalize if __dso_handle is + non-NULL. + + * invoke.texi: Document -fuse-cxa-atexit. + + * tree.h (ptr_type_node): Document. + (const_ptr_type_node): Likewise. + +Fri Dec 17 01:32:38 MET 1999 Jan Hubicka + + * regmove.c (optimize_reg_copy_1): Ignore LOOP notes. + (optimize_reg_copy_2): Likewise. + (optimize_reg_copy_3): Likewise. + (fixup_match_2): Likewise. + (regmove_optimize): Likewise. + (fixup_match_1): Liekwise. + + * i386.md (HI to SImode promoting splitters): Rewrite. + (pushsf mem peep2): New. + (testhi to andhi peep2): Remove. + * i386.h (x86_promote_QImode): New. + (TARGET_PROMOTE_QImode): New. + (PREDICATE_CODES): Add promotable_binary_operator. + * i386.c (x86_promote_QImode0: New. + (promotable_binary_operator): New. + * i386-protos.h (promotable_binary_operator): New. + + * i386.md (test?i_1): Use "nonmemory_operand" predicate, simplify + condition. + (one_cmpl?i*): Pass "NOT" to unary_operator_ok. + +1999-12-16 Mark Mitchell + + * Makefile.in (INTREGRATE_H): Rename to INTEGRATE_H. + * function.c (insert_block_after_note): Remove. + (retrofit_block): Likewise. + (identify_blocks): Fix indentation. + (reorder_blocks): Don't NULL out NOTE_SOURCE_FILE for a + NOTE_INSN_BLOCK_BEG or NOTE_INSN_BLOCK_END. + * function.h (insert_block_after_note): Remove prototype. + (retrofit_block): Likewise. + * integrate.c (expand_inline_function): Don't call + find_loop_tree_blocks. Use expand_start_bindings_and_block, not + just expand_start_bindings. Use the block_map to remap old + NOTE_BLOCKs to new ones. + (integrate_decl_tree): Keep track of remapped blocks. + * integrate.h (struct inline_remap): Add block_map. + * stmt.c (expand_fixup): Don't try to retrofit_blocks. Just set + NOTE_BLOCK on the notes. + (expand_start_bindings): Rename to ... + (expand_start_bindings_and_block): Add parameter. Set NOTE_BLOCK. + (expand_end_bindings): Set NOTE_BLOCK. + * toplev.c (rest_of_compilation): In function-at-a-time-mode, + reconstruct the BLOCK tree. + * tree.h (expand_start_bindings): Macroize. Call ... + (expand_start_bindings_and_block): New function. + +1999-12-16 Jakub Jelinek + + * config/sparc/sparc.c (print_operand): Cast fprintf arguments + to match the format. + +1999-12-16 David S. Miller + + * expr.c (emit_move_insn_1): Only emit clobbers if one of + the outputs is a SUBREG. + * rtlanal.c (reg_overlap_mentioned_p): Revert December 15th + change. + + * config/sparc/sparc.c (epilogue_renumber): Add default case + to switch stmt. + +Thu Dec 16 11:33:57 MET 1999 Jan Hubicka + + * toplev.c (rest_of_compilation): Run branch shortening after + reg-stack. + + * regclass.c (loop_depth): Remove + (scan_one_insn): Do not handle LOOP_NOTE insns. + (regclass): Go through basic blocks and set loop_cost + +Thu Dec 16 02:56:25 1999 Zack Weinberg + + * tree.h (DECL_FROM_INLINE): Check DECL_ABSTRACT_ORIGIN too. + +Thu Dec 16 10:43:35 MET 1999 Jan Hubicka + + * i386.md (movqi): Use "nonimmediate_operand" for output operand. + (movstrictqi, movdi, movsf, movdf, movxf): Likewise. + (adddi, addqi, addhi, subdi, subqi, subhi, ffs): Likewise. + +Thu Dec 16 02:41:26 1999 Richard Henderson (rth@cygnus.com) + + * loop.c (insert_loop_mem): Ignore memory clobbers. + + * combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) + to (OP A B). + +Thu Dec 16 02:26:11 1999 Jeffrey A Law (law@cygnus.com) + + * profile.c: Remove redundant #include "output.h". + + * h8300.md (HImode preinc peephole): Fix typo. + +1999-12-15 Jason Merrill + + * function.c (retrofit_block): Abort if we don't find a suitable insn. + (insert_block_after_note): Abort if we don't have a previous block. + Remove FN parameter. + * function.h: Adjust. + +1999-12-15 Mark Mitchell + + * builtins.c (expand_builtin_mathfn): Make sure not to expand the + argument more than once. + +1999-12-15 Jason Merrill + + * stmt.c (expand_decl): Expand upper bound of a dynamic array. + +1999-12-15 Jakub Jelinek + + * expr.c (emit_group_load): Use dst mode if src is VOIDmode. + +Wed Dec 15 16:11:55 MET 1999 Jan Hubicka + + * function.c (PREFERRED_STACK_BOUDNARY): Provide default value. + (assign_stack_local_1): Limit alignment to PREFERRED_STACK_BOUNDARY, + update stack_alignment_needed. + (prepare_function_start): Initialize stack_alignment_needed + * function.h (struct function): Add field stack_alignment_needed. + +Wed Dec 15 14:55:24 1999 J"orn Rennecke + + * caller-save.c (insert_one_insn): Returns struct insn_chain *. + Handle live_throughout / dead_or_set instead of live_before / + live_after. + (save_call_clobbered_regs): Get register livenessinformation from + chain->live_throughout. + (add_stored_regs): New function. + (insert_restore, insert_save): Add restored / saved registers to + dead_or_set. + * global.c (reg_dies): New parameter chain. + (reg_becomes_live): Third parameter is regs_set now. + Changed all callers. + (reg_dies): New parameter chain. Changed all callers. + (build_insn_chain): Set live_throughout instead of + live_before / live_after. + * reload.h (struct insn_chain): Replace members live_before / + live_after with live_throughout / dead_or_set. + * reload1.c (new_insn_chain): Handle live_throughout / dead_or_set + instead of live_before / live_after. + (maybe_fix_stack_asms, find_reload_regs, finish_spills): Likewise. + (order_regs_for_reload, find_reg, finish_spills): Likewise. + (choose_reload_regs_init): Likewise. + * stupid.c (current_chain, find_clobbered_regs): Delete. + (stupid_life_analysis): Set chain->live_throughout chain->dead_or_set + instead of chain->live_before / chain->live_after. + (mark_hard_ref): New function. + (stupid_mark_refs): Call mark_hard_ref. Clear chain->live_throughout. + +1999-12-15 David S. Miller + + * rtlanal.c (reg_overlap_mentioned_p): Handle CONCAT. + +Wed Dec 15 15:05:30 MET 1999 Jan Hubicka + + * flow.c (calculate_loop_depth): Make global, remove prototype, + rewrite to use new loop infrastructure. + (find_basic_block): Remove calculate_loop_depth call. + * toplev.c (rest_of_compilation): Call find_basic_block. + * output.h (calculate_loop_depth): Declare. + + * flow.c (dump_flow_info): Dump loop_depth. + (flow_loops_nodes_find): Increase loop_depth for basic block in the + body. + (flow_loops_find): Initialize the loop_depth for each basic block. + +1999-12-15 Jason Merrill + + * tree.c (decl_function_context): Handle virtual functions. + + * tlink.c (scan_linker_output): Don't look in demangled name when + looking for linker output keywords. + + * dwarfout.c (output_type): We can defer namespace-scope classes. + +Wed Dec 15 01:23:29 1999 Jeffrey A Law (law@cygnus.com) + + * regclass.c (record_reg_classes): Update comment for merging + register class preferences in reg->reg copies. Tighten conditions + for merging register class preferences in reg->reg copies. + +Wed Dec 15 02:19:32 1999 David Edelsohn + + * rs6000.md (tablejumpdi): Generate DImode LABEL_REF. + +1999-12-14 Geoff Keating + + * config/m68k/m68020-elf.h (ENDFILE_SPEC): Delete. + (INIT_SECTION_ASM_OP): Delete. + (FINI_SECTION_ASM_OP): Delete. + (STARTFILE_SPEC): Define to hold just crtbegin.o. + +1999-12-14 Jason Merrill + + * dwarf2out.c (add_abstract_origin_attribute): Do call abort if + the abstract origin wasn't emitted. + + * dwarf2out.c (class_scope_p): New fn. + (gen_subprogram_die): Use it. + (gen_variable_die): Use it. Tweak logic. + (gen_struct_or_union_type_die): Check context_die to determine + if we're function-local. + (dwarf2out_decl): Check DECL_BUILT_IN, not DECL_FUNCTION_CODE. + +1999-12-14 Bernd Schmidt + + * loop.c (check_dbra_loop): Can't reverse a biv that has + maybe_multiple set. + +1999-12-14 Nick Clifton + + * config/arm/arm.c: Add support for -mcpu=arm720 command line + switch. + +Tue Dec 14 18:13:32 1999 J"orn Rennecke + + * loop.c (strength_reduce): Fix sign of giv lifetime calculation + for givs made from biv increments. + +Tue Dec 14 08:11:27 1999 Richard Henderson + + * configure.in (alpha-osf, alpha-linux): Handle ev6[78]. + * alpha.c (override_options): Recognize -mcpu=ev67. + * alpha.h (CPP_CPU_EV67_SPEC): New. + (CPP_CPU_DEFAULT_SPEC): Examine TARGET_CPU_DEFAULT to use it. + (EXTRA_SPECS): Update. + +Tue Dec 14 08:04:28 1999 Richard Henderson + + * cppp.c (main): Set trigraphs and __STRICT_ANSI__ as + appropriate for -lang-c89 and -std=*. + * cppinit.c (cpp_handle_option): Likewise. + (new_pending_define): New, split out from cpp_handle_option. + * gcc.c (default_compilers): Don't define __STRICT_ANSI__ + or enable trigraphs for -ansi/-std=*. + + * ginclude/stdarg.h (__va_copy): New. + (va_copy): Don't define for C89. + +Tue Dec 14 08:37:27 CST 1999 Clinton Popetz + + * config/arm/arm.md (mulsidi3adddi, umulsidi3adddi): New patterns + for long long multiply-accumulate. + +Tue Dec 14 13:51:38 MET 1999 Jan Hubicka + + * regclass.c (scan_one_insn): Set loop_cost to 1 when + optimizing for size. + +1999-12-14 Bernd Schmidt + + * reload1.c (reload): Can't avoid select_reload_regs/finish_spills + if something changed. Back out that part of yesterday's changes. + + * loop.c (loop_max_reg): New static variable. + (loop_optimize): Initialize it. Eliminate one unnecessary call to + max_reg_num. + (scan_loop): Call reg_scan_update whenever we may have added new + registers, and update loop_max_reg. + +Tue Dec 14 12:07:29 MET 1999 Jan Hubicka + + * regclass.c (record_reg_classes): Do not do the copying preferrencing + when source does not die. + + * regclass.c (record_reg_classes): Handle INOUT operands properly. + +1999-12-14 Jakub Jelinek + + * config/sparc/linux64.h (TARGET_LIVE_G0, + TARGET_BROKEN_SAVERESTORE): Don't support weird SPARC + variants on Linux. + * config/sparc/linux.h (TARGET_LIVE_G0, + TARGET_BROKEN_SAVERESTORE): Likewise. + * config/sparc/linux-aout.h (TARGET_LIVE_G0, + TARGET_BROKEN_SAVERESTORE): Likewise. + + * config/sparc/sparc.h (SPARC_DEFAULT_CMODEL): Default to CM_32. + (CONDITIONAL_REGISTER_USAGE): For block profiling fix %g4 on sparc64, + not %g2. + (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Use %g4 instead of %g2 + as sparc64 block profiling register. + * config/sparc/sparc.c (sparc_override_options): Allow block + profiling with -m32. + (sparc_block_profiler): Use %g4 instead of %g2 as sparc64 block + profiling register. + * config/sparc/linux64.h (MACHINE_STATE_*): Only provide these + macros on TARGET_ARCH32. sparc.h has macros good enough for sparc64. + * config/sparc/sol2.h (MACHINE_STATE_*): Likewise. + + * config/sparc/xm-sp64.h: Avoid using __sparc_v9__ when testing + for sparc64. + * config/sparc/sparc.h: Likewise. + * config/sparc/xm-sysv4-64.h: Likewise. + * config/float-sparc.h: Likewise. + * glimits.h: Likewise. + * longlong.h: Likewise. + + * config/sparc/linux64.h (DEFAULT_VTABLE_THUNKS): Define to 1. + (ASM_IDENTIFY_GCC): Remove. + +1999-12-14 Bernd Schmidt + + * combine.c (combine_simplify_rtx): Don't make shared rtl. + (simplify_logical): Likewise. + +1999-12-14 Mumit Khan + + * cccp.c (INO_T_EQ): Disable inode-based optimization for Cygwin. + * cppfiles.c (INO_T_EQ): Likewise. + +1999-12-14 Mumit Khan + + * i386/crtdll.h (STARTFILE_SPEC): Add -pg profiling support. + * i386/mingw32.h (LIB_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + * i386/uwin.h (LIB_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + + * i386/mingw32.h (SUBTARGET_PROLOGUE): Override Cygwin definition. + * i386/uwin.h (SUBTARGET_PROLOGUE): Likewise. + +Mon Dec 13 20:25:29 1999 Jeffrey A Law (law@cygnus.com) + + * combine.c (combine_simplify_rtx): Fix order of checks for + (ashiftrt foo C) -> (lt foo (const_int 0)) simplification. + +1999-12-13 Clinton Popetz + + * config/arm/arm.md (*mulsidi3adddi, *umulsidi3adddi) Backed out + 12/10/99 change, reapplied to merged-arm-thumb-backend-branch. + +1999-12-10 Bernd Schmidt + + * hard-reg-set.h (inv_reg_alloc_order): Declare if REG_ALLOC_ORDER is + defined. + * regclass.c (inv_reg_alloc_order): New array. + (regclass_init): If REG_ALLOC_ORDER is defined, initialize it. + + * reload.h (struct insn_chain): Delete fields group_size, group_mode, + counted_for_groups, counted_for_nongroups. Add fields rld and + n_reloads. + * reload.c (push_secondary_reload): Don't set nongroup field of + new reloads. + (push_reload): Likewise. + (find_reloads): Delete code to compute nongroup fields. + * reload1.c (reload_insn_firstobj): New static variable. + (pseudos_counted, spilled_pseudos): Now of type regset_head. All + users changed. + (calculate_needs, find_tworeg_group, find_group, possible_group_p, + count_possible_groups, modes_equiv_for_class_p, new_spill_reg, + dump_needs, maybe_mark_pseudo_spilled, hard_reg_use_compare): Delete + functions. + (count_pseudo, select_reload_regs, copy_reloads, find_reg): New + functions. + (struct hard_reg_n_uses): Deleted. + (potential_reload_regs): Deleted. + (init_reload): Initialize spilled_pseudos and pseudos_counted. + (reload): Don't try to allocate reload registers if we already know + we have to make another pass. Call select_reload_regs. Free memory + starting with reload_firstobj when starting another pass. + Don't allocate spilled_pseudos. + (calculate_needs_all_insns): Call copy_reloads for an insn that + needs reloads; don't call calculate_needs. + (spill_cost): New static array. + (used_spill_regs_local): New static variable. + (order_regs_for_reload): Rewrite to lose hard_reg_n_uses and the code + to compute potential_reload_regs. + (find_reload_regs): Completely rewritten to use find_reg. + (allocate_reload_reg): Don't test counted_for_groups or + counted_for_nongroups. Lose NOERROR arg and code to give an error; + all cllers changed. + (choose_reload_regs): Add fallback code that uses the existing + register allocation from find_reload_regs. + +Mon Dec 13 00:54:14 1999 Philippe De Muyter + + * flow.c (create_edge_list): Cast xmalloc return value. + +Mon Dec 13 00:47:58 1999 Jeffrey A Law (law@cygnus.com) + + * doprnt.c: Remove incorrect comment closure. + + * cse.c: Fix a few minor whitespace goofs. + +1999-12-13 Don Bowman + + * mips/vxworks.h: Fix problem with comment termination. + (EXTRA_SECTIONS): Add in_sbss. + (EXTRA_SECTION_FUNCTIONS): Corresponding changes. + +1999-12-12 David S. Miller + + * cse.c (struct cse_reg_info): Add hash_next member, + reorder rest of struct for better packing on 64-bit + hosts. + (cse_reg_info_tree): Kill. + (REGHASH_SHIFT, REGHASH_SIZE, REGHASH_MASK, reg_hash, + REGHASH_FN): New custom pow2 hash mechanism. + (NBUCKETS): Kill. + (HASH_SHIFT, HASH_SIZE, HASH_MASK, HASH, table): Rework to + use a pow2 hash table. + (get_cse_reg_info): Rework to use new REGHASH. + (new_basic_block): Likewise, use HASH_SIZE, and inline + free_element call. + (remove_from_table): Rework to use HASH_SIZE/HASH_MASK, + and inline free_element call. + (lookup_as_function, insert, flush_hash_table, invalidate, + remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, + invalidate_for_call, use_related_value, find_comparison_args, + fold_rtx, equiv_constant, cse_insn, invalidate_memory): Likewise. + (hash_cse_reg_info, cse_reg_info_equal_p, free_element, + get_element): Kill. + +Sun Dec 12 21:31:44 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_basic_block): Free qty_table consistently. + +1999-12-12 David S. Miller + Jakub Jelinek + + * config/sparc/sparc.md (movtf reg/reg split): Don't generate + SUBREGs by hand, gen the appropriate hard reg directly. + (movtf reg/mem split): Likewise and alter_subreg on destination + if necessary. + (movtf mem/reg split): Similarly. + (movdf_cc_sp64): Rename from hidden pattern. + (movtf_cc_hq_sp64): Renamed from movtf_cc_sp64. + (movtf_cc_sp64, following split): New pattern and splitter. + (movdf_cc_reg_sp64): Rename from hidden pattern. + (movtf_cc_reg_hq_sp64): Renamed from movtf_cc_reg_sp64, require + TARGET_HARD_QUAD. + (movtf_cc_reg_sp64, following split): New pattern and splitter. + +1999-12-12 Stephen L Moshier + + * loop.c (load_mems): Don't hoist written floating point mem + if -ffloat-store. + +1999-12-12 Mark Mitchell + + * except.h (struct eh_queue): Add `next' pointer. + (struct eh_status): Make x_ehqueue a pointer. + (push_ehqueue): Declare. + (pop_ehqueue): Likewise. + * except.c (expand_eh_region_end): Adjust now that ehqueue is a + pointer. + (expand_fixup_region_end): Likewise. + (expand_leftover_cleanups): Likewise. + (push_ehqueue): Define. + (pop_ehqueue): Likewise. + (emit_cleanup_handler): Use push_ehqueue and pop_ehqueue rather + than doing it inline. + (expand_start_all_catch): Adjust now that ehqueue is a + pointer. + (mark_eh_queue): Mark all level of the queue. + (mark_eh_status): Adjust now that ehqueue is a + pointer. + (init_eh_for_function): Allocate ehqueue. + (free_eh_status): Free it. + * stmt.c (expand_cleanups): Save the ehqueue around the cleanup + expansion for a fixup. + +1999-12-12 Kaveh R. Ghazi + + * gthr-single.h (__gthread_active_p): Add prototype arguments. + + * libgcc2.c (__udivmoddi4): Remove unnecessary decls. + (__dummy, __builtin_saveregs, __bb_exit_trace_func, __bb_init_prg, + __bb_trace_func, __bb_trace_func_ret, __bb_trace_ret, + function_ptr, getpagesize, __enable_execute_stack, + __enable_execute_stack, __clear_insn_cache, + __enable_execute_stack, __do_global_dtors, __do_global_ctors, + _cleanup, _exit, __default_terminate, __terminate_func, + __terminate, __empty, __throw, new_eh_context, + eh_context_initialize, eh_context_static, eh_context_specific, + get_eh_context, __get_eh_context, __get_eh_info, + init_reg_size_table, eh_threads_initialize, + __get_dynamic_handler_chain, __sjthrow, __sjpopnthrow, + __unwinding_cleanup, throw_helper, __throw, __rethrow, + __pure_virtual): Add prototype arguments. + (__bb_exit_func): Cast a sizeof to long when comparing against one. + Cast a signed value to unsigned long when comparing against one. + (new_eh_context): Wrap in _GTHREADS macro. + (__sjthrow, __sjpopnthrow): Initialize variable `cleanup' at + declaration. + (in_reg_window): Mark parameters with __attribute__ ((__unused__)). + (throw_helper): Initialize variables `handler_p' and `pc_p'. + +1999-12-11 Kaveh R. Ghazi + + * combine.c (record_promoted_value): Remove unused variable + `links2'. + + * emit-rtl.c (renumber_insns): Likewise for `old_max_uid'. + + * global.c (record_conflicts): Likewise for `j'. + + * genoutput.c (output_insn_data): Don't unnecessarily cast away + const-ness. + +1999-12-11 Kaveh R. Ghazi + + * i386-protos.h (output_387_binary_op, output_fix_trunc, + output_fp_compare): Constify a char*. + + * i386.c (ix86_split_to_parts, ix86_safe_length_prefix): Add + static prototypes. + (override_options, ix86_comp_type_attributes, print_operand, + output_387_binary_op, output_fix_trunc, output_fp_compare): + Constify a char*. + (ix86_sched_reorder): Mark parameter `clock_var' with + ATTRIBUTE_UNUSED. + + * i386.h (DEBUG_PRINT_REG): Constify a char*. + +Fri Dec 10 16:12:13 1999 Alexandre Petit-Bianco + + * tree.def (EXPR_WITH_FILE_LOCATION): Temporarily add a third + operand, for use in the Java front-end. + +1999-12-10 Ben Collins + + * configure.in: Fix typo for "-64" in 64bit as check. + * configure: Rebuilt. + +1999-12-10 Jakub Jelinek + + * longlong.h (__sparc_v9__): Use %rDIGIT instead of %DIGIT where + appropriate. + +1999-12-10 Kaveh R. Ghazi + + * c-parse.in (string): With -Wtraditional, warn if ANSI string + concatenation is utilized. + + * invoke.texi (-Wtraditional): Document it. + +1999-12-10 Kaveh R. Ghazi + + * flow.c (flow_loops_dump): Avoid ANSI string concatenation. + Cast a ptrdiff_t to long and pass it to printf with %ld. + +1999-12-10 Geoff Keating + + * config/m68k/m68k.h (CONDITIONAL_REGISTER_USAGE): If we have no + 68881, we have no 68881 registers at all. + (HARD_REGNO_MODE_OK): It is always OK to put a MODE_FLOAT + value in a 68881 register if it is available. + +1999-12-10 Clinton Popetz + + * config/arm/arm.md (*mulsidi3adddi, *umulsidi3adddi): New patterns + for long long multiply-accumulate. + +1999-12-10 Bernd Schmidt + + * loop.c (insert_loop_mem): Undo last change. + +1999-12-10 David S. Miller + + * config/sparc/sparc.c (fp_sethi_p, fp_mov_p, fp_high_losum_p): + New functions. + * config/sparc/sparc-protos.h: Add them. + * config/sparc/sparc.h: Add them to PREDICATE_CODES. + (EXTRA_CONSTRAINT_BASE): New macro, handling Q, R, and S + constraints which use those helpers. + (EXTRA_CONSTRAINT): Use this new macro. + * md.texi: Update sparc target constraints documentation. + * config/sparc/sparc.md (clear_sf, clear_sfp, movsf_const_intreg, + movsf_const_high, movsf_const_lo, movsf_insn): Delete. + (movsf_insn_novis_liveg0, movsf_insn_novis_noliveg0, + movsf_insn_vis, movsf_lo_sum, movsf_high): New patterns. + (movsf high/lo_sum split): Rework for new patterns. + (movsf expander): Allow storing fp_zero to memory if ! live_g0. + +1999-12-09 Gavin Romig-Koch + + * c-common.c (c_common_nodes_and_builtins): + Create __builtin_ptrdiff_t and __builtin_size_t. + +Thu Dec 9 18:05:48 1999 Jeffrey A Law (law@cygnus.com) + + * pa/elf.h (MAX_OFILE_ALIGNMENT): Define. + +Fri Dec 10 00:53:10 1999 J"orn Rennecke + + * regclass.c (globalize_reg): Re-instate test that allows + fixed registers to be declared as a variable even after functions + are defined. + +Fri Dec 10 00:52:13 MET 1999 Jan Hubicka + + * i386.md (cpu attribute): Add "athlon". + (athlon_decode): New attribute. + (Athlon scheduling units definitions): New. + (fcmp and shld patterns): Set athlon_decode to "vector". + * i386.c (athlon_cost): New. + (m_ATHLON): New. + (x86_use_leave, x86_push_memory, x86_movx, x86_cmove, x86_deep_branch, + x86_use_sahf): Set for Athlon. + (x86_use_fiop): Unset for Athlon. + (override_options): Define Athlon alignments and "athlon" name. + (x86_adjust_cost): Penalize AGI and delayed latencies for Athlon. + * i386.h (TARGET_ATHLON): New. + (enum processor_type): Add PROCESSOR_ATHLON. + (TARGET_CPU_DEFAULT_SPEC): Set to "-D__tune_athlon__" + for CPU_DEFAULT==5 + (TARGET_CPP_CPU_SPECS): Set -D__tune_athlon__ for Athlon. + +1999-12-09 Andreas Jaeger + + * loop.c (record_biv): Declare parameter as int. + + * config/i386/i386-protos.h: Declare long_memory_operand. + +1999-12-09 Mark Mitchell + + * tree.c (copy_node): Do zero the TREE_CHAIN, even for an + EXPR_WITH_FILE_LOCATION. + +Thu Dec 9 11:36:24 MET 1999 Jan Hubicka + + * i386.md (neg??, abs?f, one_cmpl?i): Use nonimmediate_operand + in expander. + + * flow.c (recompute_reg_usage): Use basic block info to get loop_depth. + + * combine.c (try_combine, distribute_notes): Remove REG_N_REFS + updating code. + +1999-12-09 Jakub Jelinek + + * config/sparc/linux64.h (TARGET_DEFAULT): Make -mapp-regs + default on linux64 again. + * config/sparc/t-linux64: Add mno-app-regs and non-medlow code + models for multilibing. + * genmultilib: Accept | as alternative separator within a set in + MULTILIB_OPTIONS. + + * config/sparc/sparc.h (PROMOTE_FOR_CALL_ONLY): Define. + + * calls.c (precompute_arguments): Make sure initial_value contains + value pseudo which CSE expects. + * cse.c (struct set): New entry orig_src. + (cse_insn): Set it early on entry, use it for libcall EQUIV note + replacement. + +Wed Dec 8 22:24:15 1999 Richard Henderson + + * flow.c (count_basic_blocks): Don't add (use (const_int 0)) insns. + +1999-12-08 Bernd Schmidt + + * loop.c (insert_loop_mem): Don't hoist volatile mems out of loops. + +1999-12-08 Jakub Jelinek + + * config/sparc/sparc.c (ultra_cmove_results_ready_p, + ultra_fpmode_conflict_exists, ultra_flush_pipeline): Typo fix. + + * config/sparc/sparc.h (SPARC_SETHI_P): Don't look at topmost 32 bits + if TARGET_ARCH32. + + * longlong.h: Merge in changes from glibc. + Also don't clobber %g2 register in 32bit SPARC assembly, so that + -mno-app-regs libgcc can be compiled. + * libgcc2.c: Add defines so that the updated longlong.h + can be used in libgcc2.a. Also, make sure on most architectures + (at least on all which have optimized code in longlong.h defined + for) {SI,W}_TYPE_SIZE is suitable for preprocessor tests. + +1999-12-08 Alexandre Oliva + + * config/sparc/sol2-64.h: Same as sol2-sld-64.h, except that + `-m EMULATION' is added to non-default LINK_ARCH_SPECs. + * configure.in: Use sol2-64.h instead of sol2-sld-64.h if linker + is GNU ld. + * configure: Rebuilt. + +Wed Dec 8 03:45:40 1999 Richard Henderson + + * alpha.c (secondary_reload_class): For !BWX, sub-simode + outputs require a register. + +1999-12-08 Brendan Kehoe + + * Makefile.in (FPBIT_FUNCS, DPBIT_FUNCS): Add _sf_to_usi + _df_to_usi. Required by some targets, so US_SOFTWARE_GOFAST calls to + functions like dptoul will be resolved. + (libgcc2.a): Make sure that the object files from DPBIT are named + differently (prefix `_dp') from those that would be coming from + FPBIT. + +1999-12-08 Alexandre Oliva , Jakub Jelinek + + * configure.in: When target is sparc* and tm_file contains 64, + test for 64bit support in assembler. If not supported, remove + sparc/t-sol2-64 from target-dependent Makefile fragments. + (AS_SPARC64_FLAG): Define to the assembler flag for 64bit. + (HAVE_AS_OFFSETABLE_LO10): Rework test to use these flags. + (HAVE_AS_REGISTER_PSEUDO_OP): Use config.cache. + * acconfig.h (AS_SPARC64_FLAG): Added. + * configure, config.in: Rebuilt. + * config/sparc/sol2-sld-64.h: Same as sol2.h, if without 64bit + support. Use AS_SPARC64_FLAG. + +1999-12-07 Jakub Jelinek + + * config/sparc/sparc.c (hard_32bit_mode_classes): Mark registers + suitable for holding OFmode values so that gcc works with complex + quad long doubles. + (hard_64bit_mode_classes): Likewise. + + * config/sparc/sparc.md (sethi_di_medlow_embmedany_pic): Fix pattern + so that it is actually matched. + (sethi_di_medlow): Likewise. + + * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Consider TFmode 0.0L + as legitimate constant if -mvis. + * config/sparc/sparc.md (movtf): Likewise. + (clear_sf): Use const_double_operand. + (clear_sfp, clear_dfp, clear_tf, clear_tfp): New patterns. + + * config/sparc/sparc.c (sparc_emit_float_lib_cmp): New function. + * config/sparc/sparc-protos.h (sparc_emit_float_lib_cmp): Prototype. + * config/sparc/sparc.h (*_LIBCALL): Only use for _Q_* + routines, _Qp_* cannot be handled like that now. + (INIT_TARGET_OPTABS): Likewise. + * config/sparc/sparc.md (cmptf): Accept soft float ARCH64. + (seq, sne, sgt, sge, slt, sle, beq, bne, bgt, bge, blt, ble): Call + sparc_emit_float_lib_cmp if ARCH64 and soft float. + (extendsftf2, extenddftf2, trunctfsf2, trunctfdf2, floatsitf2, + floatditf2, fix_trunctfsi2, fix_trunctfdi2, addtf3, subtf3, multf3, + divtf3, sqrttf3): New expanders. + (extendsftf2_hq, extenddftf2_hq, trunctfsf2_hq, trunctfdf2_hq, + floatsitf2_hq, floatditf2_hq, fix_trunctfsi2_hq, fix_trunctfdi2_hq, + addtf3_hq, subtf3_hq, multf3_hq, divtf3_hq, sqrttf3_hq): Rename from + non-_hq patterns. + + * configure.in (sparc64-*-linux*): Use posix threads if enabled. + * configure: Rebuilt. + * config/sparc/linux64.h: Default to -mcpu=ultrasparc if no + -mcpu is given and we're doing 64bit compiles. + +Tue Dec 7 19:22:06 1999 Richard Henderson + + * loop.h (struct induction): Add multi_insn_incr. + * loop.c (basic_induction_var): New multi_insn_incr argument. + Set it if we search back through previous insns for the biv. + (record_biv): New multi_insn_incr argument; fill in struct induction. + (strength_reduce): Discard an iv with multiple bivs, any of + which require multiple insns to increment. + +1999-12-07 Martin v. Löwis + + * invoke.texi (C Dialect Options): Remove -flang-c9x, add -std + documentation. + +1999-12-06 David S. Miller + + * combine.c (check_promoted_subreg): Do not conditionalize this upon + PROMOTE_FUNCTION_RETURN. + +Mon Dec 6 15:12:14 1999 Jim Wilson + + * regmove.c (optimize_reg_copy_1): If no REG_DEAD note, check for + and handle REG_UNUSED note on insn. + + * combine.c (force_to_mode, case LSHIFTRT): New local inner_mask. Set + inner_mask instead of mask. + +1999-12-06 Brendan Kehoe + + * dwarf2out.c (field_byte_offset): As with dwarfout.c, size can be + zero if there was an error. + +1999-12-06 Jakub Jelinek + + * config/sparc/sparc.md (return_losum_di): Fix typo in asm + output string. + + * longlong.h: Fix clobbers in SPARC asm statements. + + * config/sparc/sparc.c (input_operand): Allow HImode and QImode + valid sethi operations when TARGET_ARCH64. + + * calls.c (save_fixed_argument_area): If save_mode is BLKmode, + always use move_by_pieces to avoid infinite recursion. + (restore_fixed_argument_area): Likewise. + + * combine.c (check_promoted_subreg, record_promoted_value): New + functions. + (combine_instructions): Use them to retain nonzero and sign bit + information after SUBREGs are eliminated by optimizations in + this pass if PROMOTE_FUNCTION_RETURN. + + * config/sparc/sparc.h (ASM_DECLARE_REGISTER_GLOBAL): Document + .register declaration. Don't use variables with __ prefixes. + +Mon Dec 6 12:24:52 1999 Richard Kenner + + * fold-const.c (optimize_bit_field_compare): Only use one mode + for both RHS and LHS in non-constant case. + +1999-12-06 Nathan Sidwell + + * frame.c (start_fde_sort): Only allocate erratic array, if + linear one was allocated. Return allocated flag. + (fde_insert): Only insert, if there's a valid array. + (fde_end_sort): Split, sort and merge if linear and erratic + arrays exist, else just sort linear one. + (search_fdes): New function. Linear search through original fde + structure. + (frame_init): Permit multiple initializations. Cope with + memory shortages. + (find_fde): Fallback on linear search, if failed to sort array. + (__deregister_frame_info): Only free sorted array, if we + allocated it. + +1999-12-06 Jakub Jelinek + + * config/sparc/sparc.h (MUST_PASS_IN_STACK): New macro. + +1999-12-05 Jakub Jelinek + + * config/sparc/sparc.c (sparc64_initialize_trampoline): Use gen_flushdi. + +1999-12-05 Mark Mitchell + + * tree.h (special_function_p): Declare. + * calls.c (special_function_p): Make it global. Don't take `name' + as a parameter. Fix typo in 1999-11-28 change. + (expand_cal): Adjust. + +1999-12-04 Mark Mitchell + + * tree.def (EXPR_WITH_FILE_LOCATION): Fix comment formatting. + * tree.h (EXPR_WFL_FILENAME): Define in terms of + EXPR_WFL_FILENAME_NODE. + (EXPR_WFL_FILENAME_NODE): Use the second operand slot rather than + the TREE_CHAIN. + * print-tree.c (print_note): Print TREE_PRIVATE and + TREE_PROTECTED. + + * dwarf2out.c (add_abstract_origin_attribute): Don't abort when + the original die cannot be found. + + * varray.h (varray_head_tag): Add elements_used. + (VARRAY_PUSH): New macro. + (VARRAY_POP): Likewise. + (VARRAY_TOP): Likewise. + Add variants of VARRAY_PUSH and VARRAY_POP for all varray element + types. + * varray.c (varray_init): Initialize elements_used. + * Makefile.in (BASIC_BLOCK_H): Add varray.h. + (INTEGRATE_H): New variable. + (integrate.o): Depend on INTEGRATE_H. + (unroll.o): Likewise. + + * function.h (insert_block_after_note): Declare. + * function.c (insert_block_after_note): Split out from ... + (retrofit_block): ... here. + + * stmt.c (expand_fixup): Fix typo in comment. + +Sat Dec 4 14:13:38 MET 1999 Jan Hubicka + + * regmove.c (copy_src_to_dest): Remove loop_depth parameter. + (optimize_reg_copy_1): Remove REG_N_REFS updating code. + (optimize_reg_copy_2, copy_src_to_dest, fixup_match_2): Likewise. + (regmove_optimize, fixup_match_1): Likewise. + +1999-12-05 Michael Hayes + + * flow.c (flow_loops_dump): Add missing argument when calling + flow_loop_nested_p. + +1999-12-04 Geoffrey Keating + Greg McGary + + * c-common.c (enum attrs): Add A_NO_LIMIT_STACK. + (init_attributes): Add A_NO_LIMIT_STACK. + (decl_attributes): Handle A_NO_LIMIT_STACK. + * c-decl.c (duplicate_decls): Handle DECL_NO_LIMIT_STACK. + * explow.c (allocate_dynamic_stack_space) [!HAVE_allocate_stack]: + Handle stack bounds checking. + * flags.h (flag_stack_check): Use the word 'probe' rather than + 'check', because the flag doesn't actually cause any checking to + be done. + * function.c (expand_function_start): Set + current_function_limit_stack. + * function.h (struct function): Add limit_stack. + (current_function_limit_stack): Define. + * invoke.texi (Code Gen Options): Document new options. + * rtl.h: Declare stack_limit_rtx. + * toplev.c (stack_limit_rtx): New variable. + (decode_f_option): Handle new options -fstack-limit-register=REG, + -fstack-limit-symbol=IDENT, -fno-stack-limit. + (main): Add stack_limit_rtx as GC root. + * tree.h (DECL_NO_LIMIT_STACK): New macro. + (struct tree_decl): New member no_limit_stack. + + * config/rs6000/rs6000.c (rs6000_allocate_stack_space): Handle + stack_limit_rtx. + * config/rs6000/rs6000.md (allocate_stack): Handle stack_limit_rtx. + (conditional_trap+1): Get new mnemonic correct. + (conditional_trap+2): New pattern for DImode traps. + + * config/m68k/m68k.c (output_function_prologue): Handle + stack_limit_rtx. + * config/m68k/m68k.md (trap): New insn. + (conditional_trap): New insn. + * md.texi (Standard Names): Document `trap' and + `conditional_trap'. + * optabs.c (gen_cond_trap): Use start_sequence()/end_sequence() + so a cc0 setter doesn't get emitted at some random place in the + function. + + * config/i960/i960.md (trap): New insn. + (conditional_trap): New expander. + (conditional_trap+1, conditional_trap+2): New insns for signed + and unsigned cases. + * config/i960/i960.c (i960_function_prologue): Use + STARTING_FRAME_OFFSET. Handle stack_limit_rtx. + +Thu Dec 2 21:22:45 1999 Greg McGary + Geoffrey Keating + + * flags.h (warn_padded, warn_packed): Add global var decls. + * toplev.c (warn_padded, warn_packed): Add global var defns. + (W_options): Add warnings `-Wpacked' and `-Wpadded'. + * stor-layout.c (layout_record): Add local variable `type' + to hold often-used TREE_TYPE (field). Add local variable + `unpacked_align' to hold alignment that would be in force + if no `packed' attribute were present. Warn if `packed' attribute + is unnecessary, or even harmful. Warn when gcc inserts padding + to satisfy alignment requirements of members. Use NULL_TREE + when checking whether var_size is set. + * invoke.texi: Document new flags. + +1999-12-03 Nathan Sidwell + + * frame.c (fde_split): Reimplement to avoid variable sized array. + +Thu Dec 2 18:59:48 1999 J"orn Rennecke + + * combine.c (try_combine): Before fixing up LOG_LINKS for the + i3_subst_into_i2 case, check that GET_CODE (PATTERN (i2)) == PARALLEL. + +1999-12-02 Gavin Romig-Koch + + * invoke.texi: Document the mips option -mno-crt0 + +1999-12-02 Mike Karr + + * cccp.c (argdata): Added free_ptr member. + (macroexpand): Initialize free_ptr of each argument. When an + argument's buffers are freed, if the argument's free_ptr corresponds + to a buffer on the input stack, then return the free_ptr to that stack + frame, otherwise, free it. + (macarg): If an argument begins and ends on the same input stack level, + then transfer the free_ptr of that buffer to the argument in case + the stack is popped during the processing of a subsequent argument. + +1999-12-02 Bernd Schmidt + + * loop.c (note_reg_stored): New function. + (struct note_reg_stored_arg): New structure. + (try_copy_prop): Change to be more conservative; only replace within + one extended basic block and stop replacing if a store to the + replacement reg is seen. + +1999-12-02 Nick Clifton + + * config/fp-bit.c: Initialize all fields of the NAN + constants. + + * c-lex.c (check_newline): Pass pragma_getc and pragma_ungetc + to HANDLE_PRAGMA. + +Wed Dec 1 18:16:38 1999 Jan Hubicka + + * i386.md (extend?f?f2): Force the input into a register, not + the output. + +1999-12-01 Jakub Jelinek + + * config/sparc/sparc.md (movsf_const_intreg): Add constraints for + regclass' sake. + (movdf_const_intreg_sp32): Likewise. Prefer the memory load + alternative because setting up 64bit constant is usually costly, + especially when reload is in progress or completed. + (movdf_const_intreg_sp64): Likewise. + (movdf_const_intreg split): Fix building up constants when + HOST_BITS_PER_WIDE_INT is 64 yet long is 32bit. + +Wed Dec 1 16:51:22 1999 Jeffrey A Law (law@cygnus.com) + + * combine.c (if_then_else_cond): Use const_true_rtx instead of + const1_rtx for return values in EQ/NE comparison against (const_int 0) + case. + + * mn10300.c (REG_SAVE_BYTES): Allocate space for AM33 registers. + (asm_file_start): Emit .am33 into assembly file when compiling for + the AM33. + (print_operand_address): Handle POST_INC addresses. + (can_use_return_insn, initial_offset): Check AM33 registers too. + (expand_prologue): Check & save AM33 registers too. + (expand_epilogue): Similarly. + (secondary_reload_class): Handle AM33 specific secondary reloads. + (output_tst): Emit efficient code for the AM33 too. + * mn10300.h (CPP_SPEC, TARGET_AM33): Define. + (TARGET_SWITCHES): Add -mam33 switch. + (FIRST_PSEUDO_REGISTER): Handle new AM33 registers. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Likewise. + (REG_ALLOC_ORDER, CONDITIONAL_REGISTER_USAGE): Likewise. + (HARD_REGNO_MODE_OK, MODES_TIEABLE_P): Likewise. + (enum reg_class, REG_CLASS_NAMES): Likewise. + (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Likewise. + (INDEX_REG_CLASS, REG_CLASS_FROM_LETTER): Likewise. + (REGNO_OK_FOR_INDEX_P, PREFERRED_RELOAD_CLASS): Likewise. + (PREFERRED_OUTPUT_RELOAD_CLASS, LIMIT_RELOAD_CLASS): Likewise. + (REGISTER_MOVE_COST, REGISTER_NAMES): Likewise. + (HAVE_POST_INCREMENT): Define. + (GO_IF_LEGITIMATE_ADDRESS): Allow POST_INC addresses for the AM33. + (GO_IF_MODE_DEPENDENT_ADDRESS): POST_INC is a mode dependent address. + * mn10300.md (movqi, movhi, addsi, subsi): Add AM33 variants. + (mulsi, andsi, iorsi, xorsi, notsi): Likewise. + (ashiftsi, lshiftrtsi, ashiftrtsi): Likewise. + (zero_extend to SI from QI/HI): Likewise. + (sign_extend to SI from QI/HI): Likewise. + (mulsidi3, umulsidi3): New patterns for the AM33. + (tstsi with zero extension from QI/HI): Add AM33 variants. + (movsi, movsf, movdi, movdf): Generate efficient code for the AM33 too. + (return_internal_regs, store_movm): Handle new AM33 registers. + * t-mn10300 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Define. + (LIBGCC, INSTALL_LIBGCC): Likewise. + * invoke.texi: Document new flags. + +Fri Nov 26 10:59:12 CET 1999 Jan Hubicka + + * i386.md (addsi3_cc): Add "binary_operator_ok" to the condition. + (addsi3_carry): Likewise. + (sbbsi3_cc): Add "binary_operator_ok" to the condition. + (sbbsi3_carry): Likewise. + (mulsi3): Rewrite to expander, ensure that only one operand is memory. + (mulhi3): Likewise. + (test?i_1): Ensure that only one operand is memory. + (conditional move patterns): likewise. + (shift and rotate patterns): Rewrite to expander, add + "binary_operator_ok" to the condition. + + * i386.md (QImode patterns): Remove '*' before the 'r' constraints. + * i386.h (procesor_costs): Add movzbl_load field. + (HARD_REGNO_MODE_OK): Accept QImode on non PARTIAL_REGISTER_STALL in + non-Q registers, accept DImode registers anywhere. + (Q_CLASS_P): New. + (MEMORY_MOVE_COST): Calculate QImode moves correctly. + * i386.c (*_cost): Set value for movxbl_load field. + + * (addsi): New add to lea splitter. + (ashlsi): Likewise. + (lea to add/shift peep2): New. + +1999-12-01 Mark Salter + + * config/mips/elf.h (STARTFILE_SPEC): Add no-crt0. + * config/mips/elf64.h (STARTFILE_SPEC): Add no-crt0. + * config/mips/mips.h (TARGET_SWITCHES): Add no-crt0. + +Tue Nov 30 15:20:52 MET 1999 Jan Hubicka + + * i386.c (ix86_expand_move): Never add clobbers to move patterns. + * i386.md (movsi_xor): New. + (movsi_or): New. + (movsi_1, movhi_1, movqi_1): Remove. + (movsi_2): Rename to movsi_1. + (movhi_2): Rename to movhi_1. + (movqi_2): Rename to movqi_1. + (movdi_1): Remove; remove splitter. + (movdi_2): Rename to movdi_1. + (divmodsi4 splitter): Do not emit clobbers for move patterns. + (long move peep2): Do not create QI or HI mode mov0s + (mov -1,reg -> or peep2s): Enable again, rewrite to single peephole. + + * i386.md (zero_extend?i?i2): Rewrite to expanders; new patterns, + rewrite splitters. + + * i386.md (neg?f2_if): Split "r" and "f" to separate alternatives. + (abs?f2_if): Likewise. + +1999-11-30 Alex Samuel + + * ggc.h (ggc_test_and_set_mark): New macro. + (ggc_mark_rtx): Use ggc_test_and_set_mark. + (ggc_mark_tree): Likewise. + (ggc_mark_rtvec): Likewise. + * ggc-common.c (ggc_mark_rtx_children): Reduce recursion. + +1999-11-30 Jason Merrill + + * dwarf2out.c (scope_die_for): Only handle types. Only search for + containing types. + (decl_scope_table): Just an array of trees now. + (push_decl_scope): Simplify. + (dwarf2out_init): Adjust. + (local_scope_p): New fn. + (gen_inlined_enumeration_type_die): Don't call scope_die_for. + (gen_inlined_union_type_die, gen_inlined_structure_type_die): Likewise. + (gen_typedef_die): Likewise. + (gen_lexical_block_die): Don't call push/pop_decl_scope. + (gen_inlined_subroutine_die): Likewise. + (gen_abstract_function): Set current_function_decl temporarily. + (gen_subprogram_die): Don't check DECL_ABSTRACT to set declaration. + Handle block extern declarations. Don't call push/pop_decl_scope. + (gen_decl_die): Fix logic for block externs. + +1999-11-30 Kaveh R. Ghazi + + * calls.c (special_function_p): Remove `realloc' and add `strdup' + to the list of functions which have attribute malloc by default. + +1999-11-30 Kaveh R. Ghazi + + * c-lex.c (yylex): With -Wtraditional, when the ANSI type of an + integer constant does not match the traditional type, limit the + warnings to cases where the base of the type is ten. + + * invoke.texi (-Wtraditional): Document it. + +Tue Nov 30 15:18:35 1999 Franz Sirl + + * combine.c (try_combine): Only pass SET or CLOBBER to SET_DEST + * rs6000.md: Only access a CONST_INT with INTVAL + +Tue Nov 30 14:21:00 1999 Richard Henderson + + * lcm.c (compute_laterin): Cast bb->aux to size_t not int. + (compute_nearerout): Likewise. + * ggc-page.c (ggc_page_print_statistics): Explicitly cast + size_t to unsigned long for formatting. + +1999-11-30 Jakub Jelinek + + * config/sparc/sparc.h (FIXED_REGISTERS, CONDITIONAL_REGISTER_USAGE): + Allow the user to override call-used/fixed state of %g2-5 + registers from the command line (with the exception of %g4 for + embedded model). + (REG_LEAF_ALLOC_ORDER): Move %g1 and %g4-7 registers to front, so that + there is a higher chance of having a leaf function. + (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Provide separate macros + for ARCH64 which has %ccr register. + * config/sparc/sparc.md (return_losum_si, return_losum_di): New + patterns. + * config/sparc/sparc.c (eligible_for_epilogue_delay): For the return + insn accept into delay slot any insn which does not use %[ol] + registers. Accept some LO_SUM and shift left by 1 for the normal + restore case. + (output_function_epilogue): Likewise. + (epilogue_renumber): Added argument which inhibits any renumbering + and just tests if the rtx does not use any %[ol] registers. + (output_return): Reflect above change. + +1999-11-30 Jakub Jelinek + + * config/sparc/sparc.c (sparc_va_arg): Fix sparc64 va_arg + aggregate passing for sizes <= 16 bytes. + +1999-11-30 Bernd Schmidt + + * cse.c (FIXED_REGNO_P): Delete tests for OVERLAPPING_REGNO_P. + * global.c (global_alloc): Delete [OVERLAPPING_REGNO_P] code. + * reload.c (find_dummy_reload): Likewise. + (find_equiv_reg): Likewise; also for INSN_CLOBBERS_REGNO_P. + * reload1.c (reload_as_needed): Likewise. + * stupid.c (stupid_find_reg): Likewise. + * tm.texi (Obsolete Register Macros): Delete section. + * gmicro.h: Remove all traces of the two macros. + * i386.h: Likewise. + * m88k.h: Likewise. + * mips.h: Likewise. + +1999-11-30 Brendan Kehoe + + * sparc.h (MASK_FASTER_STRUCTS, TARGET_FASTER_STRUCTS): Define. + (TARGET_SWITCHES): Add -mfaster-structs/-mno-faster-structs flags. + (ROUND_TYPE_ALIGN): Use better value if -mfaster-structs. + * sparc.md (sparclite86x_branch, sparclite86x_shift): New function + units for the sparclite86x chip. + (flush): Revert October 14th change; add SImode specifically. + (flushdi): Copy of flush, but DImode, to avoid genrecog warnings. + * invoke.texi: Document it. + +Tue Nov 30 14:58:14 1999 Nick Clifton + + * config/mn10200/mn10200.h (PREDICATE_CODES): Add + psimode_truncation_operand. + + * config/mn10200/mn10200.c (psimode_truncation_operand): New + function. Return true if the operand is either a MEM valid + for a PSImode address or not a MEM at all. + + * config/mn10200/mn10200.md (truncsipsi2): Use + psimode_truncation_operand. + +1999-11-30 Michael Hayes + + * flow.c (flow_nodes_print, flow_loops_cfg_dump): New functions. + (flow_loop_nested_p, flow_loops_dump, flow_loops_free): Likewise. + (flow_loop_exits_find, flow_loop_nodes_find): Likewise. + (flow_depth_first_order_compute, flow_loop_pre_header_find): Likewise. + (flow_loop_tree_node_add, flow_loops_tree_build): Likewise. + (flow_loop_level_compute, low_loops_level_compute): Likewise. + (flow_loops_find, flow_loop_outside_edge_p): Likewise. + * basic-block.h: Protect from multiple inclusion. + (flow_loops_find, flow_loops_free, flow_loop_dump): Add protoypes. + (struct loops, struct loop): Define structures. + * sbitmap.c (sbitmap_a_subset_b_p): New function. + * sbitmap.h: Protect from multiple inclusion. + (sbitmap_a_subset_b_p): Add prototype. + * Makefile.in (LOOP_H): New macro. + (stmt.o, integrate.o, loop.o, unroll.o): Replace loop.h with LOOP_H. + +Tue Nov 30 01:34:47 1999 Philippe De Muyter + + * cppinit.c (CAT): The argument list of this macro may not contain + spaces ! + +1999-11-29 David S. Miller + + Move quantity tables and register equivalence chains into + per-qty and per-register structure arrays respectively. + * cse.c (qty_first_reg, qty_last_reg, qty_mode, qty_const, + qty_const_insn, qty_comparison_code, qty_comparison_const, + qty_comparison_qty): Delete, replace with... + (qty_table): this structure table. + (reg_next_eqv, reg_prev_eqv): Delete, replace with... + (reg_eqv_table): this structure table. + (make_new_qty): Add argument MODE. Caller updated. + Update to use qty_table and reg_eqv_table. + (make_regs_eqv, delete_reg_equiv, insert_regs, + insert, exp_equiv_p, cse_rtx_varies_p, canon_reg, + fold_rtx, equiv_constant, record_jump_cond, cse_insn, + cse_process_notes, cse_main, cse_basic_block): Likewise. + +Mon Nov 29 16:56:42 1999 Richard Kenner + + * fold-const.c (extract_muldiv, case {MIN,MAX}_EXPR): Reverse + operation if C is negative. + (extract_muldiv, case SAVE_EXPR): Supresss if arg has side effects. + (extract_muldiv, case {PLUS,MINUS}_EXPR): Don't apply distributive + law for some divisions if constant is negative and change other + divisions to the opposite rounding. + + * expr.c (store_constructor_field): If bit position is not multiple + of alignment of TARGET's mode, use BLKmode. + + * expr.c (expand_expr_unaligned): Add more code from full case + that is needed when OP0 is in a register. + +Mon Nov 29 18:09:39 1999 J"orn Rennecke + + * dwarfout.c (field_byte_offset): Size can be zero if there was + an error. + +1999-11-29 Bernd Schmidt + + * fold-const.c (split_tree): Delete unused vars ORIG_IN and TYPE. + (associate_trees): Delete unused var TEM. + (extract_muldiv): Delete unused var CANCEL_P. + + * fold-const.c [TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT] + (target_isinf, target_isnan, target_negative): Add return types to + function definitions. + +1999-11-29 Bruce Korb + + * fixinc/fixincl.c(process): don't skip GLIBC files any more. + * fixinc/hackshell.tpl: ditto + * fixinc/fixtests.c(double_slash_test): more C++ header testing + * fixinc/inclhack.def(AAB_fd_zero_glibc*): corrected spelling of mach + +1999-11-29 Bernd Schmidt + + * reload.c (push_reload): When looking for a register to put into + reg_rtx, make sure all hard regs in a multi-reg register are in the + right class and nonfixed. + + * haifa-sched.c (reg_last_uses, reg_last_sets, reg_last_clobbers, + pending_read_insns, pending_write_insns, pending_read_mems, + pending_write_mems, pending_list_length, last_pending_memory_flush, + last_function_call, sched_before_next_call): Move static variables + into a structure. + (bb_ prefixed versions): Replace with single array bb_deps. + (struct deps): New structure. + (add_insn_mem_dependence, flush_pending_lists, sched_analyze_1, + sched_analyze_2, sched_analyze_insn, sched_analyze): Accept new + argument of type "struct deps *"; use that instead of global + variables. All callers changed. + (init_rgn_data_dependencies): Delete function. + (init_rtx_vector): Delete function. + (init_deps): New function. + + (free_pending_lists): Simplify, we always use the bb_deps array even + if only one basic block. + (compute_block_backward_dependences): Likewise. + (schedule_region): Likewise. + + (propagate_deps): New function, broken out of + compute_block_backward_dependences. + (compute_block_backward_dependences): Use it. + + * alpha.md: Delete useless patterns that tried to work around + register elimination problems. + + * unroll.c (loop_iterations): Don't abort if iteration variable + was made by loop. + + From Joern Rennecke: + * reload1.c (reloads_conflict): Reverse test comparing operand + numbers when testing for conflict between output/outaddr reloads. + +1999-11-29 David S. Miller + + * config/sparc/sparc.c (init_cumulative_args): Fix type of third + arg. + * config/sparc/sparc-protos.h: Update proto, move into RTX_CODE. + +1999-11-28 Robert Lipe + + * i386/sco5.h (FINI_SECTION_ASM_OP_COFF): Move destructor fn + table from .fini into .dtor. + +1999-11-28 Anthony Green + + * tree.h (struct tree_decl): Add malloc_flag. + (DECL_IS_MALLOC): Define. + * c-common.c (attrs): Add A_MALLOC attribute. + (init_attributes): Add this attribute to the table. + (decl_attributes): Handle malloc attribute. + * calls.c (special_function_p): Check for the malloc attribute. + * extend.texi (Function Attributes): Document malloc attribute. + +Sun Nov 28 13:21:00 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (reload shift-add patterns): Remove. + +1999-11-28 Herman A.J. ten Brugge + + * reorg.c (dbr_schedule) Print more statistics. Corrected + problem when printing info when 3 delay slots are filled. + +1999-11-28 Jakub Jelinek + + * combine.c (setup_incoming_promotions): Pass an outgoing + regno to FUNCTION_ARG_REGNO_P which it expects. + +1999-11-28 Andreas Jaeger + + * mips/linux.h (CPP_PREDEFINES): Undefine before redefining. + +Sun Nov 28 00:48:15 1999 Philippe De Muyter + + * cccp.c (do_include): Avoid initialization of automatic variable. + + * integrate.c (mark_stores): Function definition made void, to match + previous declaration. + * regclass.c (dump_regclass): Ditto. + * Makefile.in (WARN_CFLAGS): Macro augmented by `-Wtraditional'. + +Sat Nov 27 08:38:26 1999 Richard Kenner + + * expr.c (store_constructor): Use EXACT_DIV_EXPR when dividend is + known to be multiple of divisor. + + * expr.c (store_constructor): Don't clobber TARGET if CLEARED. + + * combine.c (try_combine): Add code to try to merge a set of a + two-word pseudo to a constant with a setting of one of those words + to a constant. + + * fold-const.c (negate_expr, associate_trees, extract_muldiv): New. + (split_tree): Completely rework to make more general. + (make_range, fold): Call negate_expr. + (fold, case NEGATE_EXPR): Simplify -(a-b) is -ffast-math. + (fold, associate): Call new split_tree and associate_trees. + (fold, case MULT_EXPR, case *_{DIV,MOD}_EXPR): Call extract_muldiv. + +1999-11-26 Bernd Schmidt + + * loop.c (try_copy_prop): Avoid GNU C extension. + +1999-11-25 Mark Mitchell + + * except.c (init_eh_for_function): Still zero eh_return_context, + eh_return_stack_adjust, and eh_return_handler. + + * except.h (eh_status): Adjust documentation for x_protect_list. + (begin_protect_partials): New function. + * except.c (enqueue_eh_entry): Fix formatting. + (get_first_handler): Add consistency check. + (add_partial_entry): Adjust usage of protect_list. + (emit_cleanup_handler): Save and restore ehqueue. + (expand_start_all_catch): Add comment. + (begin_protect_partials): New function. + (end_protect_partials): Adjust usage of protect_list. + (init_eh_for_function): Use xcalloc. + +1999-11-25 Kaveh R. Ghazi + + * c-common.c (check_format_info): Don't call a variadic function + with a non-literal format string. + + * c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise. + + * c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else, + pedantic_lvalue_warning, error_init, pedwarn_init, warning_init): + Likewise. + + * cccp.c (check_macro_name, do_xifdef, vwarning_with_line): + Likewise. + + * collect2.c (collect_wait): Likewise. + + * dbxout.c (dbxout_type): Likewise. + + * gcc.c (do_spec_1): Likewise. + + * genemit.c (gen_insn, gen_expand): Likewise. + + * genrecog.c (write_switch, write_subroutine): Likewise. + + * mips-tfile.c (catch_signal, botch): Likewise. + + * print-rtl.c (print_rtx): Likewise. + + * toplev.c (default_print_error_function, report_error_function, + _fatal_insn): Likewise. + +1999-11-25 Mark Mitchell + + * tree.c (unsave_expr_now): Handle NULL_TREE as input. + +Wed Nov 24 17:08:09 MET 1999 Jan Hubicka + + * reg-stack.c (subst_stack_regs_pat): Swap operands in commutative + operations when needed. + * i386.md (fop_?f_comm): New. + (fop_?f_1): Do not accept commutative operands. + +1999-11-25 Andreas Jaeger + + * config/mips/mips.md (casesi_internal): Add missing brace. + +1999-11-25 Jason Merrill + + * dwarf2out.c (pend_type, output_pending_types_for_scope): Lose. + (splice_child_die): Handle moving a child DIE from the declaration + DIE of a class to its specification. + (gen_struct_or_union_type_die): Use 'complete' consistently. + (gen_decl_die): Generate the virtual context DIE first. + Use decl_ultimate_origin instead of DECL_ABSTRACT_ORIGIN. + +1999-11-24 Gavin Romig-Koch + + * config/mips/mips.md (call_value_multiple_interanal1): New. + +1999-11-24 Jason Merrill + + * dwarf2out.c (free_AT, free_die): New fns. + (remove_children): Call them. + (output_line_info): Disable removal of duplicate notes. + + Generate minimal debug info for types with TYPE_DECL_SUPPRESS_INFO set. + * dwarf2out.c (gen_struct_or_union_type_die): TYPE_DECL_SUPPRESS_INFO + means pretend the type isn't defined. + Don't defer emitting types. + (gen_type_die_for_member): New fn. + (gen_decl_die): Call it. + (splice_child_die): New fn. + (gen_member_die): Call it rather than generate duplicate dies. + + Defer emitting information for the abstract instance of an inline + until we either inline it or emit an out-of-line copy. + * dwarf2out.c (decl_ultimate_origin): Ignore DECL_ABSTRACT_ORIGIN + from output_inline_function if DECL_ABSTRACT is also set. + (block_ultimate_origin): Likewise. + (gen_abstract_function): New fn. + (gen_decl_die, gen_inlined_subroutine_die): Call it. + (gen_subprogram_die): An abstract instance is not a declaration + just because it doesn't match current_function_decl. Don't abort + because DECL_DEFER_OUTPUT isn't set. Do abort if a declaration + has an abstract origin. + * toplev.c (rest_of_compilation): Don't emit dwarf2 info for the + abstract instance here. + +Wed Nov 24 18:39:18 1999 Andrew Haley + + * config/sh/sh.h (SECONDARY_OUTPUT_RELOAD_CLASS): Add the case + where we need to reload fpul from a system register. + +1999-11-24 Andreas Jaeger + + * config/mips/linux.h (CPP_PREDEFINES): Added. + (LINK_SPEC): Remove -Y since this is only needed on sparc. + +1999-11-24 Andreas Jaeger + + * config/mips/linux.h (TARGET_VERSION): Added. + (HANDLE_SYSV_PRAGMA): Added. + (DEFAULT_VTABLE_THUNKS): Added. + +Wed Nov 24 14:12:15 MET 1999 Jan Hubicka + + * local-alloc.c (qty): New structure and static variable. + (qty_phys_reg): Remove, all references changed to qty. + (qty_n_refs): Likewise. + (qty_min_class): Likewise. + (qty_birth): Likewise. + (qty_death): Likewise. + (qty_size): Likewise. + (qty_mode): Likewise. + (qty_n_calls_crossed): Likewise. + (qty_alternate_class): Likewise. + (qty_changes_size): Likewise. + (qty_first_reg): Likewise. + (alloc_qty): Rename variable QTY to QTYNO. + (finf_free_reg): Likewise. + (local_alloc): Allocate qty, do not allocate the removed variables. + +Wed Nov 24 17:26:05 1999 Geoffrey Keating + + * config/mips/mips.h (ASM_SPEC): Don't pass -G to the assembler + when -membedded-pic is passed. + + * config/mips/mips.md (casesi): Handle 64-bit case too. + (casesi_internal_di): New insn. + + * config/mips/mips.c (embedded_pic_offset): Always make the + embedded-pic subtractions relative to the name of the current + function by use of the magic string "..CURRENT_FUNCTION". + * config/mips/mips.h (ASM_OUTPUT_LABELREF): Make the magic happen. + +1999-11-24 Geoffrey Keating + + * config/mips/mips.md (div_trap_normal): Don't ask for the REGNO + of (const_int 0), when what we really care about is + whether it's a zero constant anyway. + (div_trap_mips16): Likewise. + +1999-11-23 Mark Mitchell + + * loop.c (loop_optimize): Always find_loop_tree_blocks and + unroll_block_trees when generating debuggable code. + + * tree.h (unsave_expr_1): New function. + (lang_unsave): New variable. + (get_callee_fndecl): New function. + * tree.c (unsave_expr_now_r): New function. + (lang_unsave): Define. + (unsave_expr_1): Likewise. + (unsave_expr_now_r): Split out from unsave_expr_now. + (unsave_expr_now): Call lang_unsave if it is non-NULL. Otherwise, + call unsave_expr_now_r. + (get_callee_fndecl): Define. + + * Makefile.in (gencheck): Don't depend on lang_tree_files. + (gencheck.o): Do depend on lang_tree_files. + + * integrate.h (copy_decl_for_inlining): New declaration. + * integrate.c (copy_and_set_decl_abstract_origin): Remove. + (copy_decl_for_inlining): New function. + (integrate_parm_decls): Use it. + (integrate_decl_tree): Likewise. + +1999-11-23 Gavin Romig-Koch + + * config/mips/mips.h (ISA_HAS_FP4,ISA_HAS_CONDMOVE,ISA_HAS_8CC): Split + the second two from the first. + (CONDITIONAL_REGISTER_USAGE): Use ISA_HAS_8CC rather than ISA_HAS_FP4. + * config/mips/mips.md (movcc,reload_incc,reload_outcc, + conditional move): Use ISA_HAS_CONDMOVE or ISA_HAS_8CC rather than + ISA_HAS_FP4. + * config/mips/mips.c (mips_move_1word,gen_conditional_branch, + override_options): Use ISA_HAS_CONDMOVE or ISA_HAS_8CC rather than + ISA_HAS_FP4. + +Tue Nov 23 11:15:04 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (call_internal_symref, call_value_internal_symref): No mode + needed on the address operand. + * pa.c (call_operand_address): Check for the correct mode. + +1999-11-23 Bernd Schmidt + + * loop.c: Include "basic-block.h". + (try_copy_prop, replace_loop_reg): New functions. + (load_mems): Detect registers that just hold copies of the hoisted + mem, and call try_copy_prop to eliminate them. + * Makefile.in (loop.o): Update dependencies. + +Tue Nov 23 01:03:29 1999 Hans-Peter Nilsson + + * Makefile.in (gencheck.o): Depend on gencheck.h. + (insn-emit.o): Depend on flags.h, hard-reg-set.h and resource.h. + (insn-peep.o): Depend on except.h and function.h. + (insn-attrtab.o): Depend on RECOG_H. + (insn-output.o): Depend on toplev.h and flags.h. + (gengenrtl.o): Depend on real.h. + (gen-protos.o): Depend on cpplib.h and cpphash.h. + Unify all dependencies to be on RECOG_H rather than recog.h. + +Tue Nov 23 00:57:10 1999 Rainer Orth + + From Casper H.S. Dik on comp.unix.solaris, 23 Oct 1998: + * configure.in: Try building a bi-arch 32/64-bit compiler on + sparc-*-solaris2.7 and higher. + * configure: Rebuild. + +Mon Nov 22 23:09:44 1999 David O'Brien + + * config/freebsd.h: New, FreeBSD architecture independent file. + * config/i386/freebsd-elf.h: removed FreeBSD architecturally + independent pieces. + * config/i386/freebsd.h: include i386/perform.h via tm.h rather than + directly by i386/freebsd.h. + * configure.in (*-*-freebsdelf): Include new FreeBSD architecturally + independent configuration file. + (*-*-freebsdelf): Include i386/perform.h via tm.h rather than + directly by i386/freebsd.h. + * configure: Rebuilt. + + * xm-i386.h: Define `__i386__' if not defined, rather than `i386' + which is in the user's namespace. + * libgcc2.c: Look for the ANSI-C approved `__i386__' symbol, vs. + `i386' which is not in our namespace. + +Mon Nov 22 22:58:01 1999 "R. Kelley Cook" + + * invoke.texi (ARM Options): Add in -mno-alignment-traps + +1999-11-22 Jason Merrill + + * dwarf2out.c (die_struct): Remove die_attr_last and die_child_last. + (add_dwarf_attr, add_child_die): Just push onto the front. + (reverse_die_lists): New fn. + (add_sibling_attributes): Use it. + (push_decl_scope): Reorganize. + (add_name_and_src_coords_attributes): Don't set file and line for + an artificial decl. + (gen_subprogram_die): An artificial function doesn't need to match + file and line. + (gen_compile_unit_die): Return the generated die. Only add + AT_comp_dir if the filename is relative. + (remove_AT): Simplify loop. Also free string values. + (output_die): A DIE ref can't be null. + (output_value_format, value_format): Take a dw_attr_ref. + (dwarf_last_decl, is_extern_subr_die, sibling_offset): Remove. + (AT_class, AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, AT_loc, + AT_addr, AT_lbl): New fns. + (various): Use them. + (various): Constify. + +Mon Nov 22 23:53:50 1999 J"orn Rennecke + + * combine.c (combine_simplify_rtx): When handling a SUBREG, + take SUBREG_WORD into account. + (if_then_else_cond): Likewise. + +1999-11-22 Jason Merrill + + * gmon.c, i386/gmon-sol2.c, sparc/gmon-sol2.c: Remove advertising + clause from BSD license, pursuant with + + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + +1999-11-22 Bernd Schmidt + + * loop.c (load_mems): Reformat slightly. + * basic-block.h (regset_head): New typedef. + (INIT_REG_SET): New macro. + +1999-11-22 Bruce Korb + + * emit-rtl.c (gen_sequence): Only return the pattern of an insn if + its code is INSN and it has no notes. + +1999-11-22 Andrew Haley + + * varasm.c (function_defined): Remove. + (make_function_rtl): Don't set function_defined. + (make_decl_rtl): Remove global register warning. + * regclass.c (no_global_reg_vars): New variable. + (globalize_reg): Warn if function has already been defined. + (regclass_init): Set no_global_reg_vars. + +Mon Nov 22 14:42:22 MET 1999 Jan Hubicka + + * regclass.c (reg_pref): New structure and static variable + (prefclass): Delete. + (altclass): Delete. + (all uses of prefclass and altclass): Use reg_pref instead. + +1999-11-21 Nick Clifton + + * invoke.texi (ARM Options): Replace -mshort-load-bytes with + -malignment-traps. + (arm.h): Replace -mshort-load-bytes with -malignment-traps. + (arm.c): Replace TARGET_SHORT_BY_BYTES with TARGET_MMU_TRAPS. + (arm.md): Replace TARGET_SHORT_BY_BYTES with TARGET_MMU_TRAPS. + +Sun Nov 21 17:11:13 1999 Geoffrey Keating + + * varasm.c (output_constructor): Solve problem with long long + bitfields, even on BYTES_BIG_ENDIAN machines (testcase 991118-1). + +Fri Nov 19 05:48:45 CET 1999 Jan Hubicka + + * global.c (allocno): New structure and static variable. + (allocno_reg): Remove, all references replaced by allocno. + (allocno_size): Likewise. + (hard_reg_conflicts): Likewise. + (hard_reg_preferences): Likewise. + (hard_reg_copy_preferences): Likewise. + (hard_reg_full_preferences): Likewise. + (regs_someone_prefers): Likewise. + (allocno_calls_crossed): Likewise. + (allocno_n_refs): Likewise. + (allocno_live_length): Likewise. + (find_reg): Rename ALLOCNO to NUM. + + * regclass.c (may_move_in_cost): Rename from may_move_cost, all + references updated. + (may_move_out_cost): New variable. + (init_reg_sets_1): Initialize may_move_out_cost. + (record_reg_classes): Use may_move_out_cost. + + * regclass.c (dump_regclass): New function. + (regclass): New parameter DUMP, call DUMP_REGCLASS. + * toplev.c (rest_of_compilation): Open lreg dump file before regclass, + pass rtl_dump_file to regclass. + * rtl.h (regclass): Update prototype. + +Fri Nov 19 06:32:19 CET 1999 Jan Hubicka + + * i386.md (neg, not and abs patterns): Revmap to use + ix86_expand_unary_operator and ix86_unary_operator_ok. + (add?f and sub?f expanders): Force operand 1 to register. + * i386.c (ix86_expand_unary_operator): Rewrite. + (ix86_unary_operator_ok): Ensure that memory operands + match real opcode. + (ix86_binary_operator_ok): Do not allow operand 1 to + come into memory and operand 0 not. + (ix86_expand_binary_operator): Ensure that + src1 is not non-matching memory. + + * i386.md (negs?2): Rewrite to expanders, new patterns and splitters + to support integer registers and memory. + (abss?2_integer): Likewise. + + * i386.h (enum reg_class): Add FLOAT_INT_REGS. + (REG_CLASS_NAMES): Likewise. + (REG_CLASS_CONTENTS): Define FLOAT_INT_REGS as union of FLOAT_REGS + and GENERAL_REGS. + * i386.md (pushsf): Do not preferre FLOAT_REGS over GENERAL_REGS. + (movsf): Likewise; unify 4th and 5th alternative. + (pushdf): Likewise. + (movdf_1): Likewise; rename to movdf_integer. + (pushxf): Likewise; rename to pushxf_integer; fix output template; + remove redundant splitter. + (movxf_1): Likewise; rename to movxf_integer; fix splitter's condition. + (movdf_nointeger): New. + (movxf_nointeger): New. + (pushxf_nointeger): New. + + * i386.md (extend?f?f): Split to expander and pattern, refuse two + memory operands in patterns. + (fop*): Refuse two memory operands. + + * i386.md (ashrsi3_31): Allow cltd when optimizing for size even + on !TARGET_USE_CLTD CPUs. + +Fri Nov 19 10:41:15 GMT 1999 Nathan Sidwell + + * extend.texi: Document C++ restricted pointers and references. + +1999-11-19 Bernd Schmidt + + * cse.c (addr_affects_sp): No longer conditional on AUTO_INC_DEC. + (invalidate_skipped_set): Call it unconditionally. + (cse_set_around_loop): Likewise. + +Thu Nov 18 17:29:34 MST 1999 Diego Novillo + + * rtl.texi (mem): Add documentation for alias-set argument + to RTX `mem'. + +Fri Nov 18 13:39:22 CET 1999 Jan Hubicka + + * i386.h (struct_processor_costs): New fields int_load, int_store, + fp_move, fp_load and fp_store + (REGISTER_MOVE_COST): Fix comment, calculate exactly the cost of + fp->int moves + (MEMORY_MOVE_COST): New macro. + * i386.c (386_cost): Define new fields. + (i486_cost): Likewise. + (pentium_cost): Likewise. + (pentiumpro_cost): Likewise. + (k6_cost): Likewise. + +Fri Nov 19 11:11:55 1999 Greg McGary + Geoffrey Keating + + * config/m68k/m68kelf.h: Suppress '/* within comment' warning. + + * config/m68k/m68k.h (MASK_PCREL): Don't use same value as + MASK_ALIGN_INT. + + * config/m68k/m68k.h (MASK_NO_STRICT_ALIGNMENT): New macro. + (TARGET_STRICT_ALIGNMENT): New macro. + (TARGET_SWITCHES): Add "strict-align" and "no-strict-align". + (STRICT_ALIGNMENT): Depend on TARGET_STRICT_ALIGNMENT. + * invoke.texi (M680x0 Options): Document -mstrict-align. + +Thu Nov 18 11:10:03 1999 Jan Hubicka + Richard Henderson + + * i386-protos.h (split_xf, ix86_split_movdi): Remove. + (ix86_split_long_move): Declare. + * i386.c (split_xf, ix86_split_movdi): Remove. + (ix86_split_to_parts, ix86_split_long_move): New. + * i386.md (dimode move splitters): Use ix86_split_long_move. + (dfmode move splitters): Likewise. + (xfmode move splitters): Likewise. + (movsf_1): Allow F->r. + (movdf_1, movxf_1): Allow F->ro. + +1999-11-17 Mark Mitchell + + * except.h (struct eh_entry): Add goto_entry_p. + (eh_region_from_symbol): Remove prototype. + * except.c (find_func_region_from_symbol): New function. + (emit_cleanup_handler): Likewise. + (eh_region_from_symbol): Make it static. + (add_new_handler): Verify the argument. + (find_func_region): Update comment. + (expand_eh_region_end): Expand handlers here, rater than waiting + until expand_leftover_cleanups or start_all_catch. + (expand_leftover_cleanups): Don't expand here. + (expand_start_all_catch): Or here. + (expand_rethrow): Check the return value from find_func_region. + * function.c (expand_function_end): Emit the catch_clauses. + +1999-11-18 Gavin Romig-Koch + + * integrate.c (expand_inline_function): Add necessary check for NULL. + +1999-11-18 Nick Clifton + + * toplev.c (main): Correctly detect an unrecognized option. + + * cppinit.c (cpp_handle_option): Do not claim to have consumed + a -f option if it has not been recognized. + +Thu Nov 18 00:59:11 1999 Michael Gschwind + + * basic-block.h (update_life_extent): Remove trailing comma on + enumeration type list. + +1999-11-18 Herman A.J. ten Brugge + + * varasm.c (output_constructor) Solved problem with long long + bitfields. Corrected calculating this_time and shift. Also + corrected calculating mask when BITS_PER_UNIT == 32 (c4x). + +Wed Nov 17 23:46:14 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (split_edge): Take looping structure into account when + determining where to put the new block note. + +Wed Nov 17 20:42:43 1999 Jeff Holcomb + + * Makefile.in (ggc-none.o): Provide host specific version if + needed. + +Wed Nov 17 16:51:23 1999 Richard Henderson + + * cse.c (delete_trivially_dead_insns): Identify no-op insns + containing subregs too. + +Wed Nov 17 17:39:48 MST 1999 Diego Novillo + + * invoke.texi: Add documentation for -muninit-const-in-rodata. + * config/mips/mips.h (MASK_UNINIT_CONST_IN_RODATA): Define. + (TARGET_UNINIT_CONST_IN_RODATA): Define. + (text_section): Add switches -munint-const-in-rodata and + -mno-uninit-const-in-rodata. + (ASM_OUTPUT_COMMON): Remove. + (ASM_OUTPUT_ALIGNED_DECL_COMMON): Define. Check if uninitialized + const objects should be placed in read-only data. Otherwise declare + them in common. + +Wed Nov 17 16:38:32 1999 Richard Henderson + + * jump.c (jump_optimize_1): Revert last change. + +Wed Nov 17 15:18:30 1999 Richard Henderson + + * jump.c (jump_optimize_1): Don't try to duplicate the loop exit + test if optimizing for size. + +1999-11-17 Mark Mitchell + + * Makefile.in (toplev.o): Depend on except.h. + (dwarf2out.o,loop.o,flow.o,haifa-sched.o): Likewise. + +Mon Nov 15 22:45:39 CET 1999 Jan Hubicka + + * i386.md (divmodsi4): Rewrite to expander. + (*divmodsi4_nocltd): New. + (*divmodsi4_cltd): New. + (divmodsi4 splitter): Handle the case when input comes in edx. + (udivmodhi4): Do not use constraints in exander. + (ashrsi3_31): Conditionize by TARGET_USE_CLTD. + +1999-11-17 Jason Merrill + + * dwarf2out.c (push_decl_scope): Still use decl_scope_depth - 1 + for the common case. + +1999-11-16 Jakub Jelinek + + * explow.c (hard_function_value): Add outgoing argument. + * expr.h (hard_function_value): Declare it. + * calls.c (expand_call, emit_library_call_value): Update callers. + * function.c (aggregate_value_p): Ditto. + (diddle_return_value): Must look at the outgoing registers + on archs with register windows. + +Mon Nov 15 20:46:45 1999 Richard Henderson + + * alpha.c (alpha_build_va_list): Use make_lang_type and + initialize TYPE_NAME for the va_list record. + + * flow.c (calculate_global_regs_live): Zero bb->aux to begin. + + * ggc-common.c (ggc_print_statistics): Cast size_t to unsigned long + for printing. + * ggc.h (struct ggc_statistics): Rearrange elements for better + packing on 64-bit hosts. + * lcm.c (compute_laterin): Store a size_t not an int in bb->aux. + (compute_nearerout): Likewise. + +Tue Nov 16 14:37:52 1999 Geoffrey Keating + + * config/rs6000/rs6000.c (first_reg_to_save): Save + PIC_OFFSET_TABLE_REGNUM when -fpic even though it is fixed. + +1999-11-15 Jason Merrill + + * dwarf2out.c (scope_die_for): Don't rely on the decl_scope_table + notion of nesting to find the DIE for a type or function. + DIEs can go in limbo even if we got a context_die. + (push_decl_scope): Our context doesn't need to be in decl_scope_table. + (gen_struct_or_union_type_die): Don't use TREE_PERMANENT to test + for local type. + (gen_decl_die): Ignore NAMESPACE_DECLs for now. + (gen_type_die): Writing out the context doesn't cause member class + template instantiations to be written out as well. + +Mon Nov 15 15:33:18 1999 Richard Henderson + + * rs6000.h (ASM_OUTPUT_DEF): New. + Based on proposed addition from David Edelsohn. + +1999-11-15 Robert Lipe + Bruce Korb + + * fixinc/inclhack.def + (AAB_svr4_replace_byteorder): added. Takes advantage of GCC features + (unixware7_byteorder_fix): added. Removes conflicts for new defs + in net/inet.h. + (svr5_mach_defines): added. Like svr4_mach_defines, with new syntax + (svr4_endian): enabled with SVR5 + (svr4_mkdev): simplified syntax and enabled with SVR5 + +Sun Nov 14 18:49:37 1999 David O'Brien + + * configure.in: Handle libgcc2 threads support on FreeBSD platforms. + * configure: Rebuilt. + * config/t-freebsd-thread: New file. + +Sun Nov 14 23:11:05 1999 Jeffrey A Law (law@cygnus.com) + + * i386.c (ix86_decompose_address): Verify the base is a REG + before trying to examine its register number. + + * basic-block.h: Remove all #defines and prototypes related to + integer lists. + (free_bb_mem, compute_preds_succs): Remove prototype. + * rtl.h (free_bb_mem): Remove prototype. + * flow.c (alloc_int_list_node); Remove function. + (add_inst_list_node, free_int_list, add_pred_succ): Likewise. + (compute_preds_succs, free_bb_mem): Likewise. + * gcse.c (gcse_main): Do not call free_bb_mem anymore. + * toplev.c (rest_of_compilation): Likewise. + * haifa-sched.c (build_control_flow): Use flow generated edge + list to build the haifa specific edge list. + (find_rgns): Use new CFG data structures instead of pred/succ lists. + (schedule_insns): Do not build pred/succ lists anymore. Instead + build the edge table. + + * basic-block.h (dump_bb_data): Remove declaration. + * flow.c (dump_bb_data): Remove function. + * sbitmap.c (sbitmap_intersect_of_predsucc): Delete function. + (sbitmap_union_of_predsucc): Likewise. + + * gcse.c (delete_null_pointer_checks_1): Kill unused s_preds + argument. All callers changed. + (delete_null_pointer_checks_1): No longer need to compute the + pred/succ lists. + + * gcse.c (pre_expr_reaches_here_p): Kill CHECK_PRE_COM argument. + All callers changed. + (pre_expr_reaches_here_p_work): Likewise. + (pre_edge_insert): No longer call pre_expr_reaches_here_p. + * lcm.c (compute_laterin): Fix initialization of LATER. + (compute_nearerout): Similarly for NEARER. + +Sun Nov 14 12:41:57 1999 Bernd Schmidt + + * cse.c (set_nonvarying_address_components): Delete unused function. + (refers_to_p): Likewise. + +Fri Nov 12 20:53:22 1999 Jeffrey A Law (law@cygnus.com) + + * function.c (diddle_return_value): Set REG_FUNCTION_VALUE_P as + needed. + +Sat Nov 13 16:20:09 1999 Michael Hayes + + * defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Wrap macro + definition in do while (0). + +Fri Nov 12 16:26:25 1999 Jim Wilson + + * stmt.c (pushcase, pushcase_range): Partially revert Oct 28 change. + +Fri Nov 12 12:43:49 1999 Richard Henderson + + * unroll.c (unroll_loop): Make temp an unsigned HOST_WIDE_INT. + +Fri Nov 12 15:14:19 1999 Vladimir Makarov + + * i960.h (CAN_DEBUG_WITHOUT_FP): Don't define it. + (FRAME_POINTER_REQUIRED): Don't worry about nonlocal goto. + (ELIMINABLE_REGS, CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET): New. + (INITIAL_FRAME_POINTER_OFFSET): Remove it. + + * i960.c (i960_function_prologue): Don't allocate space for g8-g11 + saved on the stack. Output more accurate stack frame statistics + into assembler file. + +1999-11-12 11:47 -0800 Zack Weinberg + + * genextract.c (record_insn_name): New function. + (get_insn_name): No longer a stub. + (main): Call record_insn_name for each insn. After each label + written, print the insn name in a comment. + +Fri Nov 12 13:45:02 1999 Kaveh R. Ghazi + + * output.h (const_section, init_section, fini_section): Add + prototypes. + + * alpha/elf.h (const_section): Delete declaration. + + * svr4.h (const_section): Likewise. + +Fri Nov 12 08:54:22 1999 Mark Mitchell + + * tree.h (SAVE_EXPR_PERSISTENT_P): New macro. + * tree.c (array_type_nelts): Don't handle SAVE_EXPRs specially. + (unsave_expr_now): Don't unsave SAVE_EXPR_PERSISTENT_P + expressions. + * stor-layout.c (variable_size): Set SAVE_EXPR_PERSISTENT_P on + variable-sized array bounds. + +Fri Nov 12 08:04:45 1999 Catherine Moore + + * defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Use + ASM_OUTPUT_LABEL. + +Fri Nov 12 13:31:54 1999 Bernd Schmidt + + * config/arm/arm.h (LEGITIMIZE_RELOAD_ADDRESS): Treat QImode + addresses the same way GO_IF_LEGITIMATE_INDEX does. + +Fri Nov 12 12:36:04 1999 Bernd Schmidt + + * cse.c (hash_arg_in_struct): Delete. + (struct table_elt): Delete elt in_struct. + (struct set): Delete elt src_in_struct. + (merge_equiv_classes): Don't set either hash_arg_in_struct or + the corresponding in_struct elts. + (canon_hash): Likewise. + (safe_hash): Likewise. + (find_best_addr): Likewise. + (record_jump_cond): Likewise. + (cse_insn): Likewise. + +Thu Nov 11 19:45:24 1999 Jim Wilson + + * loop.c (invariant_p, case MEM): Put MEM_VOLATILE_P check back. + + * dbxout.c (dbxout_type, case INTEGER_TYPE): Handle too large + unsigned types. + +Thu Nov 11 18:54:24 1999 Jeffrey A Law (law@cygnus.com) + + * function.c (diddle_return_value): Put back check that the DECL_RTL + for the function is a register. + + * function.c (diddle_return_value): Use hard_function_value to + get an rtx suitable for use in the USE/CLOBBER insn. + + * global.c (global_conflicts): Update comments. + (record_conflicts): No need to record conflicts between pseudos here. + +1999-11-11 Bruce Korb + + * fixinc/fixincl.c: Added verbose levels for status messages + +Thu Nov 11 13:23:04 1999 Bernd Schmidt + + * jump.c (jump_optimize_1): Avoid passing an rtx that is not an + operand as argument to expand_and or expand_binop. + +Thu Nov 11 02:21:16 1999 Rodney Brown + + * xcoffout.c (xcoffout_source_file): Change ggc_add_root to + gcc_add_string_root. + +Wed Nov 10 21:24:19 1999 Jason Eckhardt + + * config/pa/pa.h (MASK_RETURN_ADDR): Change 0xfffffffc to -4. + +Wed Nov 10 15:56:16 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (compute_flow_dominators): Initially put all blocks on + the worklist. + * lcm.c (compute_antinout_edge, compute_available): Similarly. + * gcse.c (compute_cprop_avinout): Remove. + (compute_cprop_data): Use compute_available. + (delete_null_pointer_checks_1): Use compute_available. + + * basic-block.h (compute_available): Returns a void now. + * gcse.c (one_classic_gcse_pass): Do not expect compute_available + to return a value anymore. + * lcm.c (compute_available, compute_antinout_edge): Revamp to use + worklists. Fix boundary cases. Compute maximal solutions. + (compute_laterin, compute_nearerout): Similarly. + + * dwarf2out.c (add_AT_location_description): Allow + (mem (plus (pseudo) (...)) too. + +Wed Nov 10 10:52:42 1999 Tom Tromey + + * gcc.c (do_spec_1): Support text between `%u' and `%O'. + +Wed Nov 10 12:43:21 1999 Philippe De Muyter + Kaveh R. Ghazi + + * cppinit.c: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. + + * gansidecl.h: Likewise. + + * rtl.c: Likewise. + + * rtl.h: Likewise. + + * toplev.h: Likewise. + + * tree.c: Likewise. + + * tree.h: Likewise. + + * varray.c: Likewise. + + * varray.h: Likewise. + +Wed Nov 10 10:57:22 1999 Clinton Popetz + + * gcov.c (struct arcdata): Add hits and total, remove prob. + (output_branch_counts): New. + (process_args): Set output_branch_counts if -c. + (calculate_branch_probs): Store hits and total instead of + percentage. + (output_data): Emit counts if output_branch_counts is true. + * gcov.texi (Invoking Gcov): Document -c switch.. + +Wed Nov 10 01:10:41 1999 Philippe De Muyter + + * genoutput.c (output_insn_data): Cast `INSN_OUTPUT_FORMAT_MULTI' and + `INSN_OUTPUT_FORMAT_FUNCTION' to `PTR'-type. + +Wed Nov 10 00:51:41 1999 Hans-Peter Nilsson + + * invoke.texi (C Dialect Options): Add missing builtins from + c-common.c to list. + * extend.texi (Other Builtins): Copy to this list. + +Wed Nov 10 04:58:09 1999 Alexandre Oliva + + * Makefile.in (recog.o): Use BASIC_BLOCK_H macro. + (print-rtl.o, $(HOST_PREFIX_1)print-rtl.o): Likewise. Remove + redundant bitmap.h. + +Wed Nov 10 00:02:53 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (compute_flow_dominators): No longer treat basic block 0 + or (n_basic_blocks - 1) specially. Clear the AUX field before + starting computation of doms/pdoms. Fix initial state for pdoms. + +Wed Nov 10 03:58:08 1999 Alexandre Oliva + + * Makefile.in ($(HOST_PREFIX_1)rtl.o): Update dependencies to + match rtl.o's: added ggc.h and toplev.h + ($(HOST_PREFIX_1)print-rtl.o): Likewise: added system.h. + ($(HOST_PREFIX_1)rtlanal.o): Likewise: added system.h. + ($(HOST_PREFIX_1)obstack.o): Likewise: added $(CONFIG_H). + +Tue Nov 9 10:30:08 1999 Tom Tromey + + * config/i386/xm-djgpp.h (HAVE_DOS_BASED_FILE_SYSTEM): Renamed + from HAVE_DOS_BASED_FILESYSTEM. + * gcc.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM, not + HAVE_DOS_BASED_FILESYSTEM. + (main): Likewise. + (split_directories): Only special-case DOS file names if + HAVE_DOS_BASED_FILE_SYSTEM is defined. Use IS_DIR_SEPARATOR + instead of explicit tests. Conditionalize on !VMS. + (make_relative_prefix): Use IS_DIR_SEPARATOR instead of explicit + tests. Conditionalize on !VMS. + (process_command): Only use make_relative_prefix if !VMS. + (free_split_directories): Conditionalize on !VMS. + (DIR_UP): Conditionalize on !VMS. + +Wed Jun 9 16:57:11 1999 Mumit Khan + + * gcc.c (STANDARD_BINDIR_PREFIX): Provide default. + +Fri Feb 5 14:22:01 1999 Mumit Khan + + * gcc.c (make_relative_prefix): Handle the HAVE_EXECUTABLE_SUFFIX + case. + +Mon Nov 8 14:16:57 1999 Michael Meissner + + * invoke.texi (Environment Variables): Document relative path + lookup. + * gcc.c (DIR_UP): If not defined, define as "..". + (standard_bindir_prefix): New static, holds target location to + install binaries. + (split_directories): New function to split a filename into + component directories. + (free_split_directories): New function, release memory allocated + by split_directories. + (make_relative_prefix): New function, make a relative pathname if + the compiler is not in the expected location. + (process_command): If GCC_EXEC_PREFIX was not specified, see if we + can figure out an appropriate prefix from argv[0]. + * Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of + STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX. Define + STANDARD_BINDIR_PREFIX. + +Wed Nov 10 11:47:54 1999 Michael Hayes + + * config/c4x/c4x-protos.h: New file. Prototypes for functions defined + in c4x.c. + * config/c4x/c4x.h: Moved prototypes to c4x.h. + * config/c4x/c4x.c (c4x_preferred_reload_class, c4x_limit_reload_class, + c4x_secondary_memory_needed) Delete. + (fp_zero_operand): Add mode argument. + +Thu Nov 4 15:52:35 1999 Andrew Haley + + * reload1.c (reload_reg_free_for_value_p): Don't use a register + that is in reload_reg_used. + +Tue Nov 9 16:43:00 1999 Nick Clifton + + * config/arm/arm-protos.h: New file: Prototypes for functions + defined in arm.c and pe.c. + * config/arm/arm.h: Fix compile time warnings. + * config/arm/arm.c: Fix compile time warnings. + * config/arm/pe.h: Fix compile time warnings. + * config/arm/aout.h: Fix compile time warnings. + +Tue Nov 9 14:55:44 1999 Nick Clifton + + * config/m32r/m32r-protos.h: New file: Prototypes for functions + defined in m32r.c + + * config/m32r/m32r.h: Move prototypes to m32r-protos.h + Add support for subtargets. + Add prototypes for new predicates. + Add scheduling macros. + + * config/m32r/m32r.c: Fix compile time warnings. + (int8_operand): New predicate function. + (reg_or_cmp_int16_operand): New predicate function. + (extend_operand): New predicate function. + (m32r_adjust_code): New scheduling function. + (m32r_adjust_priority): New scheduling function. + (m32r_sched_init): New scheduling function. + (m32r_sched_reorder): New scheduling function. + (m32r_sched_variable_issue): New scheduling function. + (direct_return): New codegen function. + (m32r_not_same_reg): New rtl testsing function. + + * config/m32r/m32r.md: Fix compile time warnings. + Add support for pre decrement and post increment memory + references. + Add S patterns. + Add fabs patterns. + +Mon Nov 8 22:20:13 1999 J"orn Rennecke + + * global.c (EXECUTE_IF_CONFLICT): Don't define. + (prune_preferences): Use EXECUTE_IF_SET_IN_ALLOCNO_SET instead. + (find_reg): Likewise. + +Mon Nov 8 13:16:46 1999 Jason Eckhardt + + * config/pa/pa.md (fmpynfadd,{sgl,dbl} insns): Use %fr0 rather than 0 + to avoid assembler errors. + +Mon Nov 8 15:38:41 1999 Nick Clifton + + * config/v850/v850-protos.h: New file: Prototypes for functions + defined in v850.c + * config/v850/v850.h: Move prototypes to v850-protos.h + * config/v850/v850.c: Move prototypes to v850-protos.h + * config/v850/v850.md: Fix compile time warnings. + + * config/fr30/fr30-protos.h: New file: Prototypes for functions + defined in fr30.c + * config/fr30/fr30.h: Move prototypes to fr30-protos.h + * config/fr30/fr30.c: Fix compile time warnings. + * config/fr30/fr30.md: Fix compile time warnings. + +Mon Nov 8 07:25:37 1999 Mark Mitchell + + * tree.h (get_containing_scope): Declare it. + * tree.c (get_containing_scope): New fucntion. + (decl_function_context): Use it. + * toplev.c (rest_of_compilation): Use get_containing_scope. + +aMon Nov 8 03:03:07 1999 Alexandre Oliva + + * Makefile.in (rtl.o): Depend on toplev.h. + +Sun Nov 7 20:55:14 1999 Mark Mitchell + + * cse.c (delete_trivially_dead_insns): Replace alloca with + xmalloc/xcalloc. + * except.c (update_rethrow_references): Likewise. + (init_eh_nesting_info): Likewise. + * function.c (identify_blocks): Likewise. + * gcse.c (dump_hash_table): Likewise. + * graph.c (print_rtl_graph_with_bb): Likewise. + * loop.c (combine_movables): Likewise. + (move_movables): Likewise. + (count_loop_regs_set): Likewise. + (strength_reduce): Likewise. + * profile.c (compute_branch_probabilities): New function, split + out from ... + (branch_prob): Here. Replace alloca with xmalloc/xcalloc. + * regclass.c (regclass): Likewise. + * regmove.c (regmove_optimize): Likewise. + * toplev.c (compile_file): Likewise. + (main): Don't mess with the stack rlimit. + +Sun Nov 7 19:41:17 1999 Catherine Moore + + * config/elfos.h (ASM_DECLARE_FUNCTION_NAME): Conditionally define. + (ASM_DECLARE_FUNCTION_SIZE): Conditionally define. + +Sun Nov 7 10:23:28 1999 Mark P. Mitchell + + * integrate.c (save_for_inline_nocopy): Clear in_nonparm_insns. + +Sun Nov 7 02:58:48 1999 Jeffrey A Law (law@cygnus.com) + + * global.c (EXECUTE_IF_CONFLICT): Undo Robert's change. + (EXECUTE_IF_SET_IN_ALLOCNO_SET): Put curleys around CODE in + macro expansion. + +Sat Nov 6 23:48:30 1999 Robert Lipe (robertlipe@usa.net) + + * global.c (EXECUTE_IF_CONFLICT): Correct quoting typo. + +Sat Nov 6 17:34:39 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (post_dominators): Kill. + (alloc_code_hoist_mem, free_code_hoist_mem); Kill post_dominators. + (compute_code_hoist_data): Use compute_flow_dominators. Do not + pass in a pdom array since we do not need pdoms. + * haifa-sched.c (schedule_insns): Similarly. + * flow.c (compute_dominators): Remove dead function. + (compute_flow_dominators): Do not compute doms or pdoms if the + caller does not request them. Split up loop to build doms and + pdoms. Use a worklist to compute doms and pdoms. + * basic-block.h (compute_dominators): Remove prototype. + +Sat Nov 6 11:38:39 1999 Richard Henderson + + * haifa-sched.c (struct haifa_insn_data, h_i_d): New. + (insn_luid, insn_priority, insn_costs, insn_units): Remove. + (insn_reg_weight, insn_depend, insn_dep_count): Remove. + (insn_blockage, insn_ref_count, line_note, insn_tick): Remove. + (cant_move, fed_by_spec_load, is_load_insn): Remove. + (schedule_region): Remove unused variable. + (schedule_insns): Allocate h_i_d, and not all the separate arrays. + +Sat Nov 6 10:00:34 1999 Mark Mitchell + + * local-alloc.c (local_alloc): Use xmalloc/xcalloc, not alloca. + (update_equiv_regs): Likewise. + (block_alloc): Likewise. + * reg-stack.c (reg_to_stack): Likewise. + (convert_regs_2): Likewise. + * reload1.c (reload_as_needed): Likewise. + +Sat Nov 6 09:57:59 1999 Mark Mitchell + + * Makefile.in (dbxout.o): Depend on ggc.h. + (dwarf2out.o): Likewise. + (xcoffout.o): Likewise. + * dbxout.c: Include ggc.h. + (dbxout_init): Register lastfile as a root. + * dwarf2out.c: Include ggc.h. + (dwarf2out_line): Register lastfile as a root. + * xcoffout.c: Include ggc.h. + (xcoffout_source_line): Register xcoff_lastfile as a root. + +Sat Nov 6 09:52:09 1999 Richard Henderson + + * i386.md (movdf_1, movxf_1): Earlyclobber general regs destination. + +Sat Nov 6 07:48:59 1999 Catherine Moore + + * config/svr4.h (ASM_DECLARE_FUNCTION): Check if already + defined. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. + +Fri Nov 5 18:33:39 1999 J"orn Rennecke + + * global.c (EXECUTE_IF_SET_IN_ALLOCNO_SET): New macro. + (EXECUTE_IF_CONFLICT): Likewise. + (ALLOCNO_LIVE_P): Avoid signed division. + (SET_ALLOCNO_LIVE, CLEAR_ALLOCNO_LIVE): Likewise. + (prune_preferences, find_reg): Use EXECUTE_IF_CONFLICT. + (record_one_conflict): Use EXECUTE_IF_SET_IN_ALLOCNO_SET. + +Fri Nov 5 12:04:02 1999 Richard Henderson + + * haifa-sched.c (schedule_block): Don't crash if there's no + next insn for an interblock movement. + (add_branch_dependences): Don't allow clobber insns to move either. + +Fri Nov 5 10:18:11 1999 Richard Henderson + + * i386.c (split_xf): New. + * i386-protos.h: Declare it. + * i386.md (movxf_1): Add general regs alternatives. + (movxf_1+1): New splitter for same. + +Fri Nov 5 12:05:52 1999 Nick Clifton + + * function.c (purge_addressof_1): Add missing return values. + +Fri Nov 5 10:07:25 1999 Nick Clifton + + * function.c (is_addressof): New function. Returns true if + the given piece of RTL is an ADDRESSOF. + (purge_addressof_1): Make boolean. Return false if the + ADDRESSOFs could not be purged. + (purge_addressof): If ADDRESSOFs could not be purged from the + notes attached to an insn, remove the offending note(s), + unless they are attached to a libcall. + +1999-11-05 Andreas Jaeger + + * genoutput.c (null_operand =): Initialize all fields. + + * errors.h: Add extern to prototypes. + +Fri Nov 5 01:44:09 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (m68k-next-nextstep4): Handle Openstep 4.2. + * configure: Rebuilt. + +Fri Nov 5 01:24:37 1999 J"orn Rennecke + + * global.c (CONFLICTP, SET_CONFLICT): Avoid signed division. + (mirror_conflicts): New function. + (global_alloc): Call it. + (expand_preferences): Remove redundant CONFLICTP test. + (find_reg, dump_conflicts): Likewise. + (prune_preferences): Process conflicts one word at a time. + +Fri Nov 5 01:05:21 1999 Richard Henderson + + * global.c (build_insn_chain): Use EXECUTE_IF_SET_IN_BITMAP + instead of an explicit loop. + +Thu Nov 4 23:07:14 1999 Jim Wilson + + * cse.c (cse_insn): Revert Oct 31 change. When computing src_elt, + if REG_RETVAL check succeeds, then put classp in src_elt. + +Thu Nov 4 23:48:14 1999 Jeffrey A Law (law@cygnus.com) + + * function.c (pad_to_arg_alignment): Only update argument_pad + if the argument's alignment is greater than STACK_BOUNDARY. + +Thu Nov 4 16:44:53 1999 Richard Henderson + + * bitmap.h (BITMAP_XFREE): New. + * flow.c (life_analysis): Use it. + (life_analysis_1): Free blocks. + + * combine.c (undo_commit): New. + (try_combine): Use it. Don't zap undobuf.undos. + (combine_instructions): Don't zap undobuf.undos; free the + undobuf.frees list. + + * local-alloc.c (local_alloc): Free qty_phys_num_sugg. + + * stmt.c (cost_table_): New. + (estimate_case_costs): Use it instead of xmalloc. + + * toplev.c (compile_file): Reuse dumpname memory instead + of strdup'ing it. + +Thu Nov 4 16:36:44 1999 Richard Henderson + + * reg-stack.c (convert_regs_1): Initialize target_stack->top + after verifying an EH edge. + + * haifa-sched.c (init_rgn_data_dependences): Correctly + size bb_pending_lists_length when zeroing. + +Thu Nov 4 16:36:36 1999 Richard Henderson + + * function.c (diddle_return_value): New. + (expand_function_end): Use it. + * stmt.c (expand_null_return): Likewise. + (expand_value_return): Likewise. + + * reg-stack.c (subst_stack_regs_pat): Handle clobbers at top-level. + + * reload1.c (reload): Don't remove return value clobbers. + +Thu Nov 4 13:33:46 1999 Richard Henderson + + * rtl.c (read_rtx): Use fatal_with_file_and_line not fatal. + +Thu Nov 4 12:49:52 1999 Richard Henderson + + * cse.c (cse_main): Use xmalloc, not alloca. + (cse_basic_block): Likewise. + * local-alloc.c (local_alloc): Likewise. + +Thu Nov 4 14:22:12 1999 David Billinghurst + Alexandre Oliva + + * rtl.c: Include toplev.h. + (fatal): Remove declaration. + +Thu Nov 4 06:39:47 1999 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (schedule_block): Fix thinko. + +1999-11-03 James McKelvey + + * fixinc/fixincl.c(create_file): Allow for systems that do not have + S_IR* defined values + +1999-11-03 Philippe De Muyter + + * fixlib.c (load_file_data): Do not call `realloc' with a NULL pointer; + call `malloc' instead. + +Wed Nov 3 23:05:14 1999 Mark Mitchell + + * flags.h (flag_renumber_insns): Declare. + * emit-rtl.c (renumber_insns): Check flag_renumber_insns. Print + renumbering table. + * rtl.h (renumber_insns): Change prototype. + * toplev.c (flag_renumber_insns): Define. + (rest_of_compilation): Pass rtl_dump_file to flag_renumber_insns. + +Wed Nov 3 15:11:27 1999 David S. Miller + + * config/sparc/sparc.md: Remove insn type fpsqrt, add fpsqrts + and fpsqrtd. Use them and create fdiv function unit to more + accurately represent fpu sqrt pipeline semantics on UltraSPARC. + * config/sparc/sparc.c: Account for fpsqrt{s,d} changes. + +Wed Nov 3 15:11:27 1999 Matteo Frigo + + * config/sparc/sparc.md: Adjust FADD/FMUL result latencies to + 3 on UltraSPARC. + * config/sparc/sparc.c (ultra_schedule_insn): Insert launched + insn into ready list, do not use just a raw swap. + +Wed Nov 3 14:51:59 1999 Mark P. Mitchell + + * rtl.h (renumber_insns): New function. + (remove_unnecessary_notes): Likewise. + * emit-rtl.c (renumber_insns): Define. + (remove_unnecessary_notes): Likewise. + * toplev.c (rest_of_compilation): Remove dead code. + Use renumber_insns and remove_unnecessary_notes. + + * gcse.c (struct null_pointer_info): New type. + (get_bitmap_width): New function. + (current_block): Remove. + (nonnull_local): Likewise. + (nonnull_killed): Likewise. + (invalidate_nonnull_info): Take a null_pointer_info as input. + (delete_null_pointer_checks_1): New function. + (delete_null_pointer_checks): Use it. + + * haifa-sched.c (find_rgns): Replace uses of alloca with xmalloc. + (split_edges): Likewise. + (schedule_block): Likewise. + (compute_block_backward_dependencies): Likewise. + (schedule_region): Likewise. + (schedule_insns): Likewise. + +Wed Nov 3 15:40:23 1999 Catherine Moore + + * defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Provide default. + * emit-rtl.c (gen_label_rtx): Support LABEL_ALTERNATE_NAME. + * final.c (final_scan_insn): Emit LABEL_ALTERNATE_NAME. + * ggc-common.c (ggc_mark_rtx_children): Mark LABEL_ALTERNATE_NAME. + * jump.c (delete_unreferenced_labels): Don't delete if + LABEL_ALTERNATE_NAME is set. + * print-rtl.c (print_rtx): Dump alternate name. + * rtl.def (CODE_LABEL): Change format to "iuuis00s". + * rtl.h (LABEL_ALTERNATE_NAME): Define. + * rtl.texi (LABEL_ALTERNATE_NAME): Document. + * tm.texi (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Document. + +Wed Nov 3 15:39:19 1999 Kaveh R. Ghazi + + * fix-header.c (recognized_extern, recognized_function): Constify + a char*. + + * lcm.c (compute_laterin): Remove unused variable `temp_bitmap'. + (pre_edge_lcm): Mark parameter `file' with ATTRIBUTE_UNUSED. + (compute_available): Remove unused variable `last'. + (compute_nearerout): Remove unused variable `temp_bitmap'. + (pre_edge_rev_lcm): Mark parameter `file' with ATTRIBUTE_UNUSED. + Remove unused variable `x'. + + * scan.h (recognized_function, recognized_extern): Constify a + char*. + + * simplify-rtx.c (simplify_rtx): Remove unused variable `new'. + +Wed Nov 3 10:40:53 1999 Franz Sirl + + * varasm.c (decode_rtx_const): Use XSTR to access the string + of a SYMBOL_REF. + +Wed Nov 3 10:10:58 1999 Richard Henderson + + * c-decl.c (duplicate_decls): Copy DECL_MODE too. + +Wed Nov 3 12:12:59 1999 Bernd Schmidt + + * reload1.c (eliminate_regs_in_insn): If copying insn, also copy notes. + +Wed Nov 3 03:26:28 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (ireg_operand): New function. + * pa.h (PREDICATE_CODES): Handle ireg_operand. + * pa.md (parallel_addb, parallel_movb): Use ireg_operand. + Fix out of date comment. + + * pa.md (negdi2): Turn into expander + anonymous pattern. + + * reload.c (find_reloads): Fix typos in recent change. + + * dwarf2out.c: Do not include ctype.h. + +Tue Nov 2 21:53:44 1999 Richard Kenner + + * regclass.c (record_reg_classes): Always use may_move_cost when + seeing how operand fits with various register classes. + +Tue Nov 2 15:38:17 1999 Richard Henderson + + * resource.c: Revert Oct 26 20:42 and Oct 27 00:56 changes. + * toplev.c: Revert Nov 1 13:22 change. + +Tue Nov 2 14:21:37 1999 Jason Eckhardt + + * config/pa/pa.md (height reduction patterns): Add checks for + overlapping operands to avoid semantic-destroying splits for + height reduction patterns. + +Tue Nov 2 15:27:31 1999 Alexandre Oliva + + * configure.in (m68k-hp-hpux*, xm_alloca.h): The underscore should + have been an hyphen, fixed. + * configure: Rebuilt. + +Tue Nov 2 17:04:36 1999 Nick Clifton + + * config/arm/tpe.h: Add prototypes for exported functions. + * config/arm/pe.c: Fix compile time warnings. + * config/arm/semi.h: Fix compile time warnings. + * config/arm/arm.c: Fix compile time warnings. + * config/arm/arm.h: Fix compile time warnings. + * config/arm/arm.md: Fix compile time warnings. + * config/arm/thumb.c: Fix compile time warnings. + * config/arm/thumb.h: Fix compile time warnings. + * config/arm/thumb.md: Fix compile time warnings. + +Tue Nov 2 04:10:24 1999 Jan Hubicka + + * jump.c (jump_optimize_1): Swap the incscc and the conditional mode + detection code + + * unroll.c (unroll_loop): Remove LOOP notes when loop is + completely unrolled. + +Tue Nov 2 16:57:22 1999 Bernd Schmidt + + * cse.c (simplify_plus_minus, check_fold_const): Delete declarations. + +Tue Nov 2 09:43:00 1999 Catherine Moore + + * Makefile.in (genattrtab): Don't use (HOST_RTLANAL). + * rtl.h (rtx_equal_p): Move prototype. + * rtl.c (rtx_equal_function_value_matters): Move from + rtlanal.c + (rtx_equal_p): Likewise. + * rtlanal.c (rtx_equal_function_value_matters): Delete. + (rtx_equal_p): Likewise. + +Mon Nov 1 23:21:17 1999 Jason Merrill + + * libgcc2.c (__do_global_dtors): Only do EH frame stuff if + ! HAS_INIT_SECTION. + +Mon Nov 1 23:37:38 1999 Jeffrey A Law (law@cygnus.com) + + * gcc.1 (PA options): Remove obsolete -mshared-libs options. + + * pa.h (ADDR_VEC_ALIGN): Define. + + * jump.c (jump_optimize_1): Also move LOOP_VTOP and LOOP_CONT + notes when presented with "if (foo) break; end_of_loop" and + the break sequence gets moved out of the loop. + + * unroll.c (unroll_loop): Allocate memory for MAP using xcalloc. + Remove explicit zero initializations of entries within MAP. + +Mon Nov 1 18:09:14 1999 Richard Henderson + + * reg-stack.c (convert_regs_1): Handle EH edges specially. + +Mon Nov 1 15:41:01 1999 Mark P. Mitchell + + * bitmap.h (BITMAP_XMALLOC): New macro. + * flow.c (CLEAN_ALLOCA): Remove. + (delete_unreachable_blocks): Use xmalloc/xcalloc instead of alloca. + (life_analysis): Likewise. + (update_life_info): Don't use CLEAN_ALLOCA. + (life_analysis_1): Use xmalloc/xcalloc instead of alloca. + (calculate_global_regs_live): Likewise. + (print_rtl_with_bb): Likewise. + (verify_flow_info): Likewise. + * global.c (global_alloc): Likewise. + (global_conflicts): Likewise. + * integrate.c (save_for_inline_nocopy): Likewise. + (expand_inline_function): Likewise. + * jump.c (jump_optimize_1): Likewise. + (duplicate_loop_exit_test): Likewise. + (thread_jumps): Likewise. + * loop.c (loop_optimize): Likewise. + (combine_givs): Likewise. + (recombine_givs): Likewise. + * reorg.c (dbr_schedule): Likewise. + * unroll.c (unroll_loop): Likewise. + + * combine.c (combine_instructions): Use xmalloc instead of alloca. + +Mon Nov 1 13:22:30 1999 Richard Henderson + + * toplev.c (rest_of_compilation): Don't optimize the CFG + when rebuilding, just before dbr. + +Mon Nov 1 14:35:50 1999 Kaveh R. Ghazi + + * output.h (assemble_end_function, assemble_destructor, + assemble_constructor, assemble_gc_entry, assemble_global, + assemble_label, output_constant_pool) Constify a char*. + + * varasm.c (assemble_destructor, assemble_constructor, + assemble_gc_entry, assemble_end_function, assemble_global, + assemble_label, output_constant_pool): Likewise. + +Mon Nov 1 14:22:51 1999 Nick Clifton + + * config/arm/thumb.c (thumb_expand_prologue): Add comments + explaining what is goin on in this function. + +Mon Nov 1 08:03:15 1999 Richard Kenner + + * regclass.c (record_reg_classes): In matching case, recompute + costs since the direction of movement is different. + +Sun Oct 31 21:59:34 MST 1999 Diego Novillo + + * resource.c (mark_target_live_regs): For unconditional branches, + the resources found at the branch target should be added to the + resources found so far, not intersected. + +Sun Oct 31 15:48:49 1999 Philippe De Muyter + + * fixinc/fixtests.c, fixinc/fixfixes.c : Keep `#' in first column for + old cpp's. + * fixinc/fixincl.c (fcntl.h) : Do not include this file twice. + (sys/mman.h): Include this file only if #HAVE_MMAP. + (run_compiles): Initialize `esac_fmt' with one old KR string, not + with automatically concatenated ANSI strings. + +Sun Oct 31 23:57:07 1999 Mark Mitchell + + * ggc-page.c (struct page_entry): Remove save_num_free_objects. + (DIV_ROUND_UP): Robustify. + (ggc_recalculate_in_use_p): New function. + (release_pages): Don't inline it. + (ggc_alloc_obj): Don't refuse to allocate objects on pages for + outer contexts. + (ggc_pop_context): Use ggc_recalculate_in_use_p. + (clear_marks): Always save in_use_p. + (sweep_pages): Use ggc_recalculate_in_use_p. + (ggc_page_print_statistics): Avoid signed/unsigned comparisons. + Release pages before counting statistics. + +Sun Oct 31 23:42:37 1999 Mark Mitchell + + * toplev.c (rest_of_compilation): Fix thinko in this change: + + Fri Oct 29 15:25:07 1999 Arnaud Charlet + + (rest_of_compilation): If inside an inlined external function, + pretend we are just being declared. + +Sun Oct 31 23:03:25 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (calculate_global_regs_live): Fix thinko. + + * integrate.c (expand_inline_function): Fix bugs in previous + change from Oct 28, 1999. + +Sun Oct 31 20:27:45 1999 Mark Mitchell + + * stmt.c (expand_value_return): Fix typo in this change: + + Thu Oct 28 18:06:50 1999 Richard Kenner + (expand_value_return): Correctly convert VAL when promoting function + return; support RETURN_REG being a PARALLEL. + +Sun Oct 31 20:25:42 1999 Mark P. Mitchell + + * expr.c (readonly_fields_p): Ignore everything except FIELD_DECLs. + +Sun Oct 31 20:42:17 1999 Kaveh R. Ghazi + + * hard-reg-set.h (reg_names): Constify a char*. + + * regclass.c (reg_names): Likewise. + + * regs.h (reg_names): Likewise + + * a29k/a29k.c (reg_names): Delete declaration. + + * a29k/a29k.h (CONDITIONAL_REGISTER_USAGE): Constify a char*. + + * arc/arc.c (arc_save_restore, arc_output_function_prologue, + arc_output_function_epilogue): Likewise. + + * elxsi/elxsi.c (reg_names): Likewise. + + * gmicro/gmicro.h (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Likewise. + + * m32r/m32r.c (m32r_output_function_epilogue, emit_cond_move): + Likewise. + + * m88k/m88k.c (output_function_profiler): Likewise. + + * sparc/sparc.c (sparc_flat_output_function_prologue, + sparc_flat_output_function_epilogue): Likewise. + +Sun Oct 31 13:32:15 CET 1999 Marc Lehmann + + * toplev.c (rest_of_compilation): Separate the setjmp/vfork clobber + warning from -Wuninitialized and put it under -W. + * function.c (uninitialized_vars_warning): Warn only when the + corresponding flag is set. + +Sun Oct 31 01:53:30 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): If an insn has only a single set, SRC_EQV + is nonzero and the single set does not have an elt, then assign + it an elt. + + * simplify-rtx.c: New file. + * Makefile.in (OBJS): Add simplify-rtx.o + (simplify-rtx.o): Add dependencies. + * rtl.h (simplify_gen_binary, simplify_rtx): Add prototypes. + * cse.c: Use simplify_gen_binary intead of cse_gen_binary. + (cse_gen_binary, simplify_unary_operation): Delete. + (simplify_binary_operation, simplify_plus_minus): Likewise. + (check_fold_consts, simplify_relation_operation): Likewise. + (simplify_ternary_operation): Likewise. + (delete_trivially_dead_insns): Simplify the contents of the + REG_EQUAL note before trying to substitute it into the source + of the reg-reg copy at the end of a libcall sequence. + + * combine.c (combine_simplify_rtx): Renamed from simplify_rtx. All + references/callers changed. + + * mn10200.c (mn10200_va_arg): Force the return value into a + register. + + * fr30.h (EXTRA_CC_NAMES): Remove obsolete macro. + + * cccp.c (macroexpand): Avoid out of range accesses for omitted + arguments. + +Sat Oct 30 22:42:50 1999 Stephen L Moshier + + * c-lex.c (yylex): Accept 'f' in mantissa of hex float constant. + +Sat Oct 30 22:19:26 1999 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (fold): Fix thinko when optimizing comparisons + against -0.0. + +Sat Oct 30 21:32:17 1999 David Starner + + * gcc.texi (Passes): Update front-end files to their current + location. + +Sat Oct 30 14:41:40 1999 Richard Henderson + + * alpha.h (SECONDARY_INPUT_RELOAD_CLASS): Call secondary_reload_class. + (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. + (PREDICATE_CODES): Add addition_operation. + * alpha-protos.h (addition_operation): Declare. + (secondary_reload_class): Likewise. + * alpha.c (addition_operation): New. + (secondary_reload_class): New, from old SECONDARY_INPUT_RELOAD_CLASS. + * alpha.md (adddi3): Turn into expander. + (*lda, *adddi_2): New. + (movsf, movdf patterns): Don't preference integer regs. + (movsi, movdi patterns): Don't preference fp regs. + +Sat Oct 30 14:38:22 1999 Richard Henderson + + * genrecog.c (write_switch): Check for duplicate CODE cases. + +Sat Oct 30 14:31:48 1999 Richard Henderson + + * ggc-common.c: Update pre-function commentary. + * ggc-page.c: Likewise. + (poison): Remove. + (poison_pages): Use memset directly. + (ggc_alloc_obj): Likewise. Use a different pattern than poison_pages. + (ggc_collect): Poison before sweeping. + * ggc-simple.c: Update pre-function commentary. + (ggc_alloc_obj): Poison nonzeroed memory. + +Sat Oct 30 14:28:52 1999 Mark Mitchell + + * ggc-common.c (ggc_print_statistics): Make arguments to fprintf + match format string, even on 64-bit hosts. + * gcc-page.c (ggc_page_print_statistics): Likewise. + +Sat Oct 30 14:38:04 1999 Catherine Moore + + * config/i386/i386.c (ix86_cpu): Revert last patch. + * config/i386/i386.h (ix86_cpu): Ditto. + +Fri Oct 29 17:00:42 1999 Jim Wilson + + * stor-layout.c (layout_type): When compute TYPE_SIZE_UNIT from + TYPE_SIZE, convert type of result to sizetype. + +Fri Oct 29 14:34:17 1999 Richard Henderson + + * flow.c (count_or_remove_death_notes): Equate NULL with the + universal set. + + * jump.c, reg-stack.c, toplev.c: Revert Oct 27 change. + * toplev.c (rest_of_compilation): Rebuild CFG immediately before + dbr_schedule. + + * i386.c (pic_label_no): Delete. + (ix86_attr_length_default): Don't use single_set to peek + inside a parallel. + + * recog.c (peephole2_optimize): Allow recog_next_insn to index + the first insn after bb->end. + * i386.md (push mem peeps): Scratch is live after evaluation + of the memory. + (cmp mem peep): Similarly. + +Fri Oct 29 11:50:11 1999 Catherine Moore + + * calls.c (emit_library_call_value): Fix declaration of alignment_pad. + * function.c (pad_to_arg_alignment): Add missing braces. + +Fri Oct 29 13:53:48 1999 Kaveh R. Ghazi + + * alpha/alpha-protos.h (literal_section): Add prototype. + (alpha_need_linkage, alpha_start_function,alpha_end_function): + Constify a char*. + + * alpha/alpha.c (alpha_ra_ever_killed, set_frame_related_p): Add + prototype. + (alpha_start_function, alpha_end_function, float_strings, + alpha_need_linkage): Constify a char* + + * alpha/alpha.h (ASM_OUTPUT_ASCII, ASM_OUTPUT_MI_THUNK): Likewise. + + * alpha/alpha32.h (ASM_OUTPUT_MI_THUNK): Likewise. + + * alpha/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * alpha/vms.h (ASM_OUTPUT_SECTION_NAME): Likewise. + +Fri Oct 29 13:49:39 1999 Kaveh R. Ghazi + + * flow.c (debug_flow_info): Add prototype. + + * gcc.c (main): Likewise. + + * gcse.c (expr_reaches_here_p_work, pre_expr_reaches_here_p_work): + Likewise. + + * reload1.c (failed_reload, set_reload_reg): Likewise. + + * mips-tfile.c (main): Likewise. + (pfatal_with_name, fancy_abort, botch, fatal, catch_signal): Mark + with ATTRIBUTE_NORETURN. + +Fri Oct 29 18:16:03 1999 Andrew Haley + + * config/i386/i386.h (ENCODE_SECTION_INFO): Don't do anything if + DECL is not a memory ref. + +Fri Oct 29 09:05:34 1999 Catherine Moore + + * config/i386/i386.h (ix86_cpu): Remove extern attribute. + * config/i386/i386.c (ix86_cpu): Add extern attribute. + +Fri Oct 29 16:30:04 1999 Andrew Haley + + * config/mips/elf.h: remove NAME__MAIN and SYMBOL__MAIN. + * config/mips/elf64.h: ditto. + +Fri Oct 29 08:03:57 1999 Catherine Moore + + * expr.c (emit_push_insn): New argument alignment_pad. + Update all callers. Adjust stack pointer based on alignment pad. + * function.c (pad_to_arg_alignment): New argument alignment_pad. + Update all callers. Track alignment_pad if boundary > PARM_BOUNDARY. + (locate_and_pad_parm): New argument alignment_pad. Update all + callers. + * expr.h (emit_push_insn): Update prototype. + (locate_and_pad_parm): Update prototype. + * calls.c (arg_data): Add new field alignment_pad. + (initialize_argument_information): Initialize alignment_pad. + +Fri Oct 29 02:51:35 1999 Mark Mitchell + + * except.c (free_eh_nesting_info): Free the info itself. + * function.c (free_after_compilation): Don't free NULL. + * gcse.c (alloc_pre_mem): Free the temp_bitmap, too. + (pre_edge_insert): Free inserted. + * stmt.c (free_stmt_status): Don't free NULL. + +Fri Oct 29 15:25:07 1999 Arnaud Charlet + + * gcov.c (DIR_SEPARATOR): Provide default. + (output_data): Add test for MS-DOS format absolute filename. + (fancy_abort): Correct program name. + (open_files): Open all files in binary mode. + * libgcc2.c (__bb_exit_func): Likewise. + + * profile.c (init_branch_prob): Specify binary when opening files. + + * flags.h (flag_unwind_tables): New decl. + * toplev.c (flag_unwind_table): New definition. + (f_options): Add -funwind-tables. + (decode_g_option): Clarify warning when unknown -g option is given. + (rest_of_compilation): If inside an inlined external function, + pretend we are just being declared. + + * dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables. + (dwarf2out_frame_finish): Likewise. + +Fri Oct 29 07:44:26 1999 Vasco Pedro + + * fold-const.c (merge_ranges): If not in0, but in1, handle + upper bounds equal like subset case. + +Thu Oct 28 19:22:24 1999 Douglas Rupp + + * dbxout.c (dbxout_parms): Generate a second stabs line for parameters + passed in a register but moved to the stack. + +Thu Oct 28 19:12:57 1999 Sam Tardieu + + * gcc.c (pass_exit_codes, greatest_status): New variables. + (struct option_map): Add entry for "--pass-exit-codes". + (execute): Update greatest_status if error. + (display_help): Add documentation for -pass-exit-codes. + (process_command): Handle -pass-exit-codes. + (main): Look at pass_exit_codes and greatest_status on call to exit. + +Thu Oct 28 18:06:50 1999 Richard Kenner + + * reload.c (find_reloads): Refine test for no input reload + case to not includes reloads emitted after insn. + + * function.c (find_temp_slots_from_address): Handle sum involving + a register that points to a temp slot. + (update_temp_slot_address): Make recursive call if both old and + new are PLUS with a common operand. + * calls.c (expand_call): Mark temp slot for result as having + address taken. + + * rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case. + + * gcc.c (process_command): Add standard_exec_prefix with "GCC" + component as well as "BINUTILS". + + * integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS. + * integrate.c (copy_rtx_and_substitute): Likewise. + (expand_inline_function, integrate_parm_decls, integrate_decl_tree): + All callers changed. + * unroll.c (inital_reg_note_copy, copy_loop_body): Likewise. + + * dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use + gdb extensions, write size of type; also be more consistent + in using references when this is a subtype. + + * pa.md (extv, extzv, insv): Use define_expand to reject constant + that is out of range. + + * loop.c (unknown_constant_address_altered): New variable. + (prescan_loop): Initialize it. + (note_addr_stored): Set it for RTX_UNCHANGING_P MEM. + (invariant_p, case MEM): Remove handling for volatile and readonly; + check new variable if readonly. + (check_dbra_loop): Chdeck unknown_constant_address_altered. + + * cse.c (canon_hash, case MEM): Do not record if BLKmode. + (addr_affects_sp_p): Removed from note_mem_written and only + define #ifdef AUTO_INC_DEC. + + * alpha.c (input_operand, case ADDRESSOF): Treat as REG. + + * regclass.c (record_reg_classes): Properly handle register move + directions. + + * varasm.c (initializer_constant_valid_p, case MINUS_EXPR): + Don't think valid if both operands are invalid. + (struct constant_descriptor): New field RTL. + (mark_const_hash_entry): Mark it. + (record_constant{,_rtx}): Initialize it. + (output_constant_def): Allocate RTL in permanent obstack and + save in table. + ({record,compare}_constant_1): Modes must match for + CONSTRUCTOR of ARRAY_TYPE. + + * c-common.h (initializer_constant_valid_p): Delete decl from here. + * output.h (initializer_constant_valid_p): Move decl to here. + * c-common.c (initializer_constant_valid_p): Delete function from here. + * varasm.c (initializer_constant_valid_p): Move function to here. + + * tree.h (STRIP_SIGN_NOPS): New macro. + * fold-const.c (optimize_minmax_comparison): New function. + (invert_truthvalue, case WITH_RECORD_EXPR): New case. + (fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS. + (fold, case EQ_EXPR): Call optimize_minmax_comparison and add + cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and + widening conversions. + (fold, case LE_EXPR): Rework changing unsigned to signed comparisons + to look at size of mode, not precision of type; also add missing cases. + (optimize_bit_field_compare, decode_field_reference): Don't try to + optimize COMPONENT_REF of a PLACEHOLDER_EXPR. + + * dwarf2out.c (ctype.h): Include. + (dwarf2out_set_demangle_name_func): New function. + (size_of_line_info): Deleted. + (output_line_info): Compute size of line info table from difference + of labels. + (base_type_die, add_name_attribute): Call demangle function, if any. + (field_byte_offset): Use bits per word for variable length fields. + (gen_array_type_die): Add array name. + (gen_subprogram_die): Ignore DECL_INLINE if -fno-inline. + (dwarf2out_add_library_unit_info): New function. + + * explow.c (set_stack_check_libfunc): New function. + (stack_check_libfunc): New static variable. + (probe_stack_range): Allow front-end to set up a libfunc to call. + + * combine.c (simplify_comparison): When making comparison in wider + mode, check for having commuted an AND and a SUBREG. + (contains_muldiv): New function. + (try_combine): Call it when dividing a PARALLEL. + (simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart. + (simplify_comparison, case ASHIFTRT): Recognize sign-extension of + a PLUS. + (record_value_for_reg): If TEM is a binary operation with two CLOBBERs, + use one of the CLOBBERs instead. + (if_then_else_cond): If comparing against zero, just return thing + being compared. + + * optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x). + Don't generate shifts and subtract if have conditional arithmetic. + + * rtl.h (delete_barrier): New declaration. + * jump.c (jump_optimize): Set up to handle conditional call. + In conditional arithmetic case, handle CALL_INSN followed by a BARRIER. + (delete_barrier): New function. + + * rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode. + + * recog.c (nonmemory_operand): Accept ADDRESSOF. + + * tree.c (build_type_attribute_variant): Push to obstack of + ttype around type_hash_canon call. + + * expr.c (placeholder_list): Move decl to file scope. + (expand_expr): Don't force access to volatile just because its + address is taken. + If ignoring reference operations, just expand the operands. + (expand_expr, case COMPONENT_REF): Propagate + EXPAND_CONST_ADDRESS to recursive call when expanding inner. + Refine test for using bitfield operations vs pointer punning. + (expand_expr, case CONVERT_EXPR): If converting to + BLKmode UNION_TYPE from BLKmode, just return inner object. + Use proper mode in store_field call. + Properly set sizes of object to store and total size in store_field + call for convert to union. + (expand_expr, case ARRAY_REF): If OP0 is in a register, put it in + memory (like for ADDR_EXPR). Also, don't put constant in register if + we'll want it in memory. + (readonly_fields_p): New function. + (expand_expr, case INDIRECT_REF): Call it if LHS. + (expand_assignment): Handle a RESULT_DECL where + DECL_RTL is a PARALLEL. + (do_jump, case WITH_RECORD_EXPR): New case. + (get_inner_reference): Always go inside a CONVERT_EXPR + and NOP_EXPR if both modes are the same. + (store_field): Use bitfield operations if size of bitsize is not same + as size of RHS's type. + Check for bitpos not a multiple of alignment in BLKmode case. + Do block move in largest possible alignment. + (store_constructor): Set BITSIZE to -1 for variable size and properly + in case of array of BLKmode. + (expand_expr_unaligned): New function. + (do_compare_and_jump): Call it. + + * mips/iris5.h (SWITCHES_NEED_SPACES): New macro. + * collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES + does not include 'o'. + + * function.c (instantiate_virtual_regs_1, case SET): Handle case where + both SET_DEST and SET_SRC reference a virtual register. + (gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG. + + * integrate.c (expand_inline_function): Handle case of setting + virtual stack vars register (from built in setjmp); when parameter + lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early. + (subst_constant): Add new parm, MEMONLY. + (expand_inline_function, integrate_parm_decls): Pass new parm. + (integrate_decl_tree): Likewise. + (copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P. + (try_constants): Call subst_constants twice, with MEMONLY 0 and 1. + (copy_rtx_and_substitute, case SET): Add explicit calls to + copy_rtx_and_substitute for both sides. + + * stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for + constraints. + (pushcase{,_range}): Convert to NOMINAL_TYPE after checking for + within INDEX_TYPE, instead of before. + (fixup_gotos): Use f->target_rtl, not the next insn, + since latter may be from a later fixup. + (expand_value_return): Correctly convert VAL when promoting function + return; support RETURN_REG being a PARALLEL. + (expand_return): When checking for result in regs and having + cleanup, consider PARALLEL in DECL_RTL as being in regs. + +1999-10-28 21:27 -0700 Zack Weinberg + + * cpplib.h (struct cpp_buffer: fname, nominal_fname, + last_nominal_fname): Mark const. + (struct include_hash: name, nshort, control_macro): Mark + const. + (struct macrodef: symnam): Mark const. + (struct if_stack: fname): Mark const. + (is_idchar, is_idstart, is_hor_space, trigraph_table): Delete. + (IStable): New character-syntax array which encompasses all + the old is_foo arrays. + (is_idchar, is_numchar, is_idstart, is_numstart, is_hspace, + is_space): New macros for interrogating IStable. + (check_macro_name): Kill last argument. All callers changed. + + * cppinit.c (initialize_char_syntax): Delete. + (is_idchar, is_idstart, is_hor_space, is_space, + trigraph_table): Delete. + (IStable): New. Initialize with clever macros to avoid + information duplication. + (builtin_array): Table of builtins to get rid of explicit list + in initialize_builtins. + (initialize_builtins): Use builtins_array. + (cpp_start_read): Call init_IStable, and set IStable['$'] if + opts->dollars_in_ident. + + * cppexp.c: Change all refs to is_xyz[] arrays to use new + is_xyz() macros. + (cpp_parse_expr): Avoid 'format string is not constant' + warning. Use ISGRAPH to identify printable chars. + * cppfiles.c: Change all refs to is_xyz[] arrays to use new + is_xyz() macros. + (read_and_prescan): Map trigraphs to chars with open-coded + if-else-if-... sequence, not a lookup table. + * cpphash.c: Change all refs to is_xyz[] arrays to use new + is_xyz() macros. + * cpplib.c: Change all refs to is_xyz[] arrays to use new + is_xyz() macros. Kill SKIP_ALL_WHITE_SPACE (unused). + (check_macro_name): Remove ability to report an invalid + assertion name, which is never used. + (do_line): Constify a couple of char *'s. + * cppmain.c (main): Call cpp_cleanup before returning. + +Thu Oct 28 21:16:35 1999 Mark Mitchell + + * ggc.h (struct ggc_statistics): New type. + (ggc_get_size): New function. + (ggc_print_statistics): Likewise. + * ggc-common.c (ggc_stats): New variable. + (ggc_mark_rtx_children): Keep statistics. + (ggc_mark_tree_children): Likewise. + (ggc_print_statistics): New function. + * ggc-page.c (struct globals): Add bytes_mapped field. + (alloc_anon): Update it. + (release_pages): Likewise. + (ggc_get_size): New function. + (ggc_page_print_statistics): New function. + * ggc-simple.c (ggc_get_size): New function. + +Fri Oct 29 06:32:44 1999 Geoffrey Keating + + * flow.c (propagate_block): When the last reference to a label + before an ADDR_VEC is deleted because the reference is a dead + store, delete the ADDR_VEC. + +Thu Oct 28 12:28:50 1999 Richard Henderson + + * resource.c (find_free_register): Don't use the frame pointer + if frame_pointer_needed. + +Thu Oct 28 10:02:00 1999 Jim Wilson + + * config/mips/mips.c (mips_va_arg): Delete gen_jump as emit_jump arg. + (function_arg_pass_by_reference): Check for a NULL pointer in cum. + + * config/i960/i960.c (i960_va_start): New locals base, num. + Use INDIRECT_REF instead of ARRAY_REF on valist. + (i960_va_arg): Use INDIRECT_REF instead of ARRAY_REF on valist. + +Thu Oct 28 09:45:48 1999 Mark Mitchell + + * gcse.c (delete_null_pointer_checks): Fix typo in previous change. + +Thu Oct 28 03:37:50 1999 Peter Gerwinski + + * tree.def (PLACEHOLDER_EXPR): Update comments. + +Thu Oct 28 06:47:32 1999 Kaveh R. Ghazi + + * c-common.c (check_format_info): Avoid non-literal format string + warnings when `first_arg_num' is zero. + +Thu Oct 28 12:28:48 1999 Bernd Schmidt + + * rtl.texi: Delete explicit Prev, Up and Next entries in "@node"s. + +Thu Oct 28 11:05:13 1999 Richard Earnshaw + + * arm.md (casesi_insn): Add a clobber of the condition code + register. + +Mon Oct 18 21:16:06 1999 Fred Fish + + * tm.texi (CC1PLUS_SPEC): Make it clear in the docs that CC1_SPEC is + used by both cc1 and cc1plus. + +Thu Oct 28 10:00:48 1999 Nick Clifton + + * config/arm/arm.c: Initialize arm_structure_size_boundary to + DEFAULT_STRUCTURE_SIZE_BOUNDARY. + * config/arm/arm.h (DEFAULT_STRUCTURE_SIZE_BOUNDARY): Define + to the value 32 if it has not already been defined. + * config/arm/netbsd.h (DEFAULT_STRUCTURE_SIZE_BOUNDARY): + Override definition in arm.h with a value of 8. + +Thu Oct 28 03:12:02 1999 David Starner + + * c-pragma.c (push_alignment): Don't check the return value + of xmalloc. + +Thu Oct 28 03:08:38 1999 Matteo Frigo + + * sparc.h (ADJUST_COST): Fix thinko. + +Thu Oct 28 02:44:03 1999 Glen Nakamura + + * cccp.c (rescan): Fixed obp pointer handling around call to + check_expand subroutine. + +Thu Oct 28 02:15:22 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (delete_null_pointer_checks): Only record non-null info + for pseudos when examining stores. + + * arm.md (adddi3, adddi_sesidi_di, adddi_sesidi_di): Add + splitters for these patterns. Use "#" for output templates. + (addsi3_carryin_shift): New pattern. + +Thu Oct 28 10:20:02 1999 Geoffrey Keating + + * config/rs6000/rs6000.md (movsf): Don't convert a SUBREG + of the function return register into a plain REG until + after function inlining is done. + +Wed Oct 27 15:21:46 1999 Richard Henderson + + * jump.c (jump_optimize_1): If we did cross-jumping, and + the data will matter, rebuild the CFG. + * reg-stack.c (reg_to_stack): Only (re)build the CFG if + not optimizing. Don't run shorten_branches. + * toplev.c (rest_of_compilation): Run shorten_branches after + reg_to_stack. + +Wed Oct 27 12:33:40 1999 Mark Mitchell + + * rtl.h (note_stores): Add additional parameter. + * rtlanal.c (reg_set_p_1): Take additional parameter. + (reg_set_last_1): Likewise. + (reg_set_p): Adjust call to note_stores. + (reg_set_last): Likewise. + (note_stores): Pass data parameter to worker function. + * alias.c (record_set): Take additional parameter. + (init_alias_analysis): Pass it. + * caller-save.c (mark_set_regs): Take additional parameter. + (save_call_clobbered_regs): Pass NULL to note_stores. + * combine.c (set_nonzero_bits_and_sign_copies): Take additional + parameter. + (record_dead_and_set_regs_1): Likewise. + (reg_dead_at_p_1): Likewise. + (combine_instructions): Adjust calls to note_stores. + (try_combine): Likewise. + (record_dead_insn): Remove. + (record_dead_and_set_regs): Adjust calls to note_stores. + (reg_dead_at_p): Likewise. + * cse.c (invalidate_skipped_set): Take additional parameter. + (cse_check_loop_start): Likewise. + (cse_check_loop_start_value): Remove. + (cse_set_around_loop): Adjust calls to note_stores. + * flow.c (notice_stack_pointer_modification): Take additional + parameter. Remove duplicate declaration. + (record_volatile_insns): Adjust calls to note_stores. + * gcse.c (record_set_info): Take additional parameter. + (record_last_set_info): Likewise. + (invalidate_nonnull_info): Likewise. + (record_set_insn): Remove. + (compute_sets): Adjust calls to note_stores. + (last_set_insn): Remove. + (compute_hash_table): Adjust calls to note_stores. + (insert_insn_end_bb): Likewise. + (delete_null_pointer_checks): Likewise. + * global.c (mark_reg_store): Take additional parameter. + (mark_reg_clobber): Likewise. + (reg_becomes_live): Likewise. + (global_conflicts): Adjust calls to note_stores. + (build_insn_chain): Likewise. + * integrate.c (note_modified_parmregs): Take additional parameter. + (mark_stores): Likewise. Make it static. + (save_for_inline_nocopy): Adjust calls to note_stores. + (try_constants): Likewise. + * integrate.h (mark_stores): Remove declaration. + * jump.c (mark_modified_reg): Take additional parameter. + (thread_jumps): Adjust calls to note_stores. + * local-alloc.c (validate_equiv_mem_from_store): Take additional + parameter. + (no_equiv): Likewise. + (reg_is_set): Likewise. + (validate_equiv_mem): Adjust calls to note_stores. + (update_equiv_regs): Likewise. + (block_alloc): Likewise. + * loop.c (note_set_pseudo_multiple_uses_retval): Remove. + (note_addr_stored): Take additional parameter. + (note_set_pseudo_multiple_uses): Likewise. + (record_initial): Likewise. + (prescan_loop): Adjust calls to note_stores. + (strength_reduce): Likewise. + (check_dbra_loop): Likewise. + * regmove.c (flags_set_1): Take additional parameter. + (mark_flags_life_zones): Adjust calls to note_stores. + * reload1.c (mark_not_eliminable): Take additional parameter. + (forget_old_reloads_1): Likewise. + (reload_cse_invalidate_rtx): Likewise. + (reload_cse_check_clobber): Likewise. + (reload_combine_note_store): Likewise. + (move2add_note_store): Likewise. + (reload): Adjust calls to note_stores. + (reload_as_needed): Likewise. + (emit_reload_insns): Likewise. + (reload_cse_regs_1): Likewise. + (reload_cse_record_set): Adjust calls to reload_cse_invalidate_rtx. + (reload_combine): Adjust calls to note_stores. + * resource.c (update_live_status): Take additional parameter. + (mark_target_live_regs): Adjust calls to note_stores. + * stupid.c (find_clobbered_regs): Take additional parameter. + (stupid_life_analysis): Adjust calls to note_stores. + +Wed Oct 27 19:26:12 1999 Nick Clifton + + * config/arm/coff.h (STRUCTURE_SIZE_BOUNDARY): Delete + definition. + + * config/arm/elf.h (STRUCTURE_SIZE_BOUNDARY): Delete + definition. + + * config/arm/arm.h (STRUCTURE_SIZE_BOUNDARY): Define in terms + of the variable arm_structure_size_boundary. + +Wed Oct 27 02:05:58 1999 Mark P. Mitchell + + * alias.c (init_alias_analysis): Allocate reg_known_value and + reg_known_equiv_p on the heap. Likewise for new_reg_base_value + and reg_seen. + (end_alias_analysis): Free reg_known_value and reg_known_equiv_p. + * cse.c (cse_main): Call end_alias_analysis. + * haifa-sched.c (schedule_insns): Likewise. + * local-alloc. (update_equiv_regs): Likewise. + * reload1.c (reload_cse_regs): Likewise. + +Wed Oct 27 01:49:17 1999 Rainer Orth + + * sparc/sparc.c (sparc_override_options): Clear MASK_FPU_SET. + * sparc/sparc.h (TARGET_SWITCHES): Add "fpu" entry for reverse + mapping from MASK_FPU. + +Wed Oct 27 01:42:26 1999 Scott Christley + + * sparc.md (call): Don't bound structure return size to 0xfff. + +Wed Oct 27 00:56:59 1999 Richard Henderson + + * resource.c (mark_target_live_regs): Check that the target + insn wasn't created after compute_bb_for_insn. + +Tue Oct 26 23:15:03 1999 Mark Mitchell + + * ggc-page.c (poison_pages): Don't be overzealous. + +Tue Oct 26 23:29:18 1999 Jeffrey A Law (law@cygnus.com) + + * alias.c: Update comments for ADDRESS. + (nonlocal_reference_p): Look inside the ADDRESS to determine if + it is a local memory reference. + + * c-typeck.c (build_function_call): Check that the built-in + function is of class BUILT_IN_NORMAL before trying to recongize + it as BUILT_IN_ABS. + * calls.c (calls_function_1): Similarly for BUILT_IN_ALLOCA. + * stmt.c (expand_end_cae): Similarly for BUILT_IN_CLASSIFY_TYPE. + +Wed Oct 27 00:14:13 1999 Robert Lipe + + * gcse.c (expr_reaches_here_p): Use xcalloc and explit free instead + of alloca. + (pre_gcse): Likewise. + (hoist_expr_reaches_here_p): Likewise. + (hoist_code): Likewise. + (pre_expr_reaches_here_p): Replace alloca with xcalloc. Move core + code to ... + (pre_expr_reaches_here_p_work): ... here. + (expr_reaches_here_p): Replace alloca with xcalloc. Move core + code to ... + (expr_reaches_here_p_work): ... here. + +Tue Oct 26 20:42:45 1999 Richard Henderson + + * resource.c (find_basic_block): Delete. + (mark_target_live_regs, incr_ticks_for_insn): Use BLOCK_NUM instead. + (init_resource_info): Call compute_bb_for_insn. + +Tue Oct 26 20:21:02 1999 Richard Henderson + + * flow.c (merge_blocks_move_predecessor_nojumps): Cope + with already adjacent blocks, but no fallthru. + (merge_blocks_move_successor_nojumps): Simplify. + (debug_flow_info): New. + + * toplev.c (rest_of_compilation): Open jump1 dump file before + jump and close after, as opposed to just using dump_rtl. + +Wed Oct 27 03:09:23 1999 J"orn Rennecke + + * reload.h (earlyclobber_operand_p): Declare. + * reload.c (earlyclobber_operand_p): Don't declare. No longer static. + * reload1.c (reload_reg_free_for_value_p): RELOAD_OTHER reloads with + an earlyclobbered output conflict with RELOAD_INPUT reloads - handle + case where the RELOAD_OTHER reload is new. Use earlyclobber_operand_p. + +Tue Oct 26 18:23:38 1999 Jan Hubicka + Richard Henderson + + * emit-rtl.c (emit_block_insn_before): New. + (emit_block_insn_after): New. + * basic-block.h: Declare them. + + * bitmap.h: Protect from multiple inclusion. + + * recog.c (scratch_operand): Handle VOIDmode correctly. + + * rtl.h (JUMP_CROSS_JUMP_DEATH_MATTERS): New. + + * builtins.c (expand_builtin_apply_args_1): Remove STACK_REGS hack. + * function.c (assign_parms): Likewise. + * global.c (global_conflicts): Clarify STACK_REGS commentary. + + * reg-stack.c (max_uid): Remove. + (blocks, block_begin, block_end, block_drops_in): Remove. + (block_stack_in, block_out_reg_set, block_number): Remove. + (struct block_info_def, BLOCK_INFO): New. + (enum emit_where): New. + (current_block): New. + (BLOCK_NUM): Remove. + (mark_regs_pat, record_label_references): Remove. + (record_reg_life_pat, record_reg_life, find_blocks): Remove. + (nan): New. + (goto_block_pat, print_blocks, dump_stack_info): Remove. + (reg_to_stack): Simplified test for existence of fp code. Use + flow.c code. Call shorten_branches after cross-jump opt. + (check_asm_stack_operands): Renamed from record_asm_reg_life. + Return false if the asm doesn't use stack regs. Don't do life + analysis on the asm. + (emit_pop_insn): Replace function pointer arg `when' with + enum `where'. Update all callers. + (change_stack): Likewise. Update basic block end. + (emit_swap_insn): Use current_block->head to limit reverse search + for start of block. Use emit_block_insn_after. + (subst_stack_regs_pat): Handle USE and CLOBBER patterns. + (subst_asm_stack_regs): Use check_asm_stack_operands. Use direct + structure assignment instead of bcopy. + (print_stack): New. + (convert_regs_entry, convert_regs_exit): New. + (convert_regs_1, convert_regs_2): Split out from convert_regs. + Work on basic blocks and the CFG. + (convert_regs): Use them. + + * i386.c (output_fix_trunc): Remove code for DImode input operand + not at top-of-stack. + * i386.c (fix_truncdfdi2, fix_truncsfdi2): Use scratch with + appropriate mode. + (fix_truncdi_1): Allow any mode scratch. + +Tue Oct 26 13:30:35 1999 Richard Henderson + + * alpha.h (TARGET_MEM_FUNCTIONS): Define here. + * linux.h, netbsd.h, vms.h: Not here. + +1999-10-26 Gavin Romig-Koch + + * config/mips/mips.h (ISA_HAS_64BIT_REGS,ISA_HAS_BRANCHLIKELY, + ISA_HAS_FP4,ISA_HAS_CONDMOVE): New. + (GENERATE_BRANCHLIKELY,HAVE_SQRT_P, + CONDITIONAL_REGISTER_USEAGE): Use them. + * config/mips/mips.c (mips_move_1word,mips_move_2words, + gen_conditional_branch,override_options) : Use them. + * config/mips/mips.md : Use them. + +Tue Oct 26 13:09:23 1999 Richard Henderson + + * i386.md (zero_extendqihi2): Use SImode register name with andl. + +Tue Oct 26 12:35:38 1999 Richard Henderson + + * integrate.c (function_cannot_inline_p): Don't allow inlining + if setjmp is used. + +Tue Oct 26 14:10:23 1999 Kaveh R. Ghazi + + * c-parse.in (cast_expr): Constify. + + * cccp.c (special_symbol): Likewise. + + * cse.c (hash_cse_reg_info, cse_reg_info_equal_p): Likewise. + + * dwarf2out.c (base_type_die): Likewise. + + * global.c (allocno_compare): Likewise. + + * local-alloc.c (qty_compare_1, qty_sugg_compare_1): Likewise. + + * regclass.c (fix_register): Likewise. + + * rtl.h (fix_register): Likewise. + + * stupid.c (stupid_reg_compare): Likewise. + + * toplev.c (decode_f_option): Likewise. + + * tree.c (build_complex_type): Likewise. + +Tue Oct 26 18:35:25 1999 Richard Earnshaw + + * output.h: Don't unnecessarily conditionalize prototypes on TREE_CODE. + +Tue Oct 26 15:42:56 1999 Bernd Schmidt + + * reload.c (find_reloads): Compute mode and nregs fields of all + reloads. + * reload1.c (calculate_needs_all_insns): Simplify a bit. + (calculate_needs): Use precomputed mode/nregs values. + (allocate_reload_reg): Likewise. + Break out two... + (failed_reload, set_reload_reg): ... new functions. + (choose_reload_regs_init): New function, mostly broken out from... + (choose_reload_regs): ... here. Lose all the save_xxx nonsense. + Also lose one #if 0 block. + +Tue Oct 26 02:48:32 1999 Marc Espie + + * Makefile.in (AR_FOR_TARGET, RANLIB_FOR_TARGET): Fix target name + substitution. + +Tue Oct 26 01:27:32 1999 Mark Mitchell + + * tree.h (BLOCK_TYPE_TAGS): Remove. + (BLOCK_END_NOTE): Likewise. + (BLOCK_LIVE_RANGE_FLAG): Likewise. + (BLOCK_LIVE_RANGE_START): Likewise. + (BLOCK_LIVE_RANGE_END): Likewise. + (tree_block): Remove live_range_flag, live_range_var_flag, and + type_tags. Remove end_note, live_range_start, and live_range_end. + (remember_end_note): Remove prototype. + * tree.c (build_block): Don't set BLOCK_TYPE_TAGS. + * c-decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call + remember_end_note. + * ggc-common.c (ggc_mark_tree_children): Don't mark + BLOCK_TYPE_TAGS or BLOCK_END_NOTE. + * integrate.c (adjust_copied_decl_tree): Remove. + * print-tree.c (print_node): Don't print BLOCK_TYPE_TAGS. + * stmt.c (last_block_end_note): Remove. + (init_stmt): Don't add a GC root for it. + (expand_fixup): Don't set it. + (remember_end_note): Remove. + (expand_end_bindings): Don't set last_block_end_note. + +Tue Oct 26 00:41:54 1999 Bernd Schmidt + + * reload1.c (reload_reg_free_for_value_p): Show + RELOAD_FOR_OTHER_ADDRESS reloads can conflict with RELOAD_OTHER + reloads. + +Mon Oct 25 23:54:45 1999 Geoff Keating + + * expmed.c (extract_bit_field): Allow for the case of non-integer + objects that are smaller than a word (like SFmode on a 64-bit + machine). + + * loop.c (basic_induction_var): A non-integer variable which is + being set by a paradoxical subreg is probably not a biv. + +1999-10-25 Herman A.J. ten Brugge + + * prefix.c (translate_name) Check for empty prefix string. + +Mon Oct 25 23:10:45 1999 Andreas Schwab + + * Makefile.in (CPP_CROSS_NAME): New variable. + (install-cpp): Use it instead of CPP_INSTALL_NAME for the cross + xcpp. + (uninstall-cpp): Use CPP_INSTALL_NAME and CPP_CROSS_NAME for the + names of the files to be uninstalled. + +Mon Oct 25 23:03:09 1999 Jeffrey A Law (law@cygnus.com) + + * collect2.c (IS_DIR_SEPARATOR): Define. + (prefix_from_string): Use IS_DIR_SEPARATOR and DIR_SEPARATOR. + + * som.h (ASM_DECLARE_FUNCTION_NAME): Set PRIV_LEV for static + functions too. + + * haifa-sched.c (add_dependence): Update the true dependency + cache the first time we add a true dependence to the LOG_LINKS chain. + +Mon Oct 25 22:27:40 1999 Jim Kingdon + + * fold-const.c (fold): Fix comment. + +Mon Oct 25 22:49:34 1999 Kaveh R. Ghazi + + * dbxout.c (lastfile, cwd, dbxout_type_method_1, + dbxout_symbol_location, dbxout_symbol_name, dbxout_init, + dbxout_start_new_source_file, dbxout_source_file, + dbxout_source_line, dbxout_finish, dbxout_type_fields, + dbxout_type_methods, dbxout_symbol, dbxout_prepare_symbol): + Constify a char*. + (dbxout_types, dbxout_args, dbxout_symbol): Delete prototypes. + (dbxout_symbol): Mark parameter `local' with ATTRIBUTE_UNUSED. + (dbxout_block): Initialize variable `blocknum'. + + * dbxout.h (dbxout_init, dbxout_finish, + dbxout_start_new_source_file, dbxout_source_file, dbxout_types, + dbxout_args, dbxout_source_line): Constify a char*. + + * dwarfout.c (dwarf_tag_name, dwarf_attr_name, + dwarf_stack_op_name, dwarf_typemod_name, dwarf_fmt_byte_name, + dwarf_fund_type_name, name_attribute, stmt_list_attribute, + low_pc_attribute, high_pc_attribute, body_begin_attribute, + body_end_attribute, comp_dir_attribute, sf_names_attribute, + src_info_attribute, mac_info_attribute, producer_attribute, + lookup_filename, generate_macinfo_entry, fundamental_type_code, + dwarfout_line, dwarfout_start_new_source_file, dwarfout_define, + dwarfout_undef): Constify a char*. + (add_incomplete_type, retry_incomplete_types): Add prototypes. + + * dwarfout.h (dwarfout_define, dwarfout_undef, + dwarfout_start_new_source_file, dwarfout_line): Constify a char*. + +1999-10-25 Gavin Romig-Koch + + * config/mips/mips.h (MIPS_ISA_DEFAULT): Insure it's defined. + (MULTILIB_ISA_DEFAULT): New. + (MULTILIB_DEFAULTS): Use it. + * config/mips/mips.c (): Remove the now unnecessary definition + of MIPS_ISA_DEFAULT. + * config/mips/elf64.h (MULTILIB_DEFAULTS): Remove the now + unnecessary definition. + +Mon Oct 25 22:08:35 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.md (pic_load_addr): Add constraints to operand 1. + +1999-10-25 Bruce Korb + + * fixinc/genfixes: Provide a means for specifying -D options to + AutoGen + +Mon Oct 25 00:42:35 1999 Jeffrey A Law (law@cygnus.com) + + * arm.c (arm_override_options): Correct initialization of + arm_fast_multiply, arm_arch4, arm_arch5, arm_ld_sched, + arm_is_strong, and arm_is_6_or_7. + + * loop.c (note_set_pseudo_multiple_uses_retval): New variable. + (note_set_pseudo_multiple_uses): New function. + (check_dbra_loop): Use not_set_pseudo_multiple_uses to determine + if a pseudo set in the loop exit is used elsewhere. + +Sun Oct 24 20:52:40 1999 Mark Mitchell + + * i386.md (mulsi3): Tweak to work with SCO OSR5 COFF assembler. + +Sun Oct 24 21:02:46 1999 Richard Henderson + + * i386.md (*lea_0): Collapse addsi_0, addsi_lea_[123] into + a single load-address pattern. + +Sun Oct 24 19:33:24 1999 Mark P. Mitchell + + * haifa-sched.c (schedule_insns): Don't assign LUIDs differently + depending on whether or not line-number notes are present. + +Sun Oct 24 20:29:59 1999 Kaveh R. Ghazi + + * cccp.c (progname, file_buf, default_include, include_file, + macrodef, definition, hashval, wchar_type, user_label_prefix, + directive, out_fname, if_stack, safe_write, index0, get_lintcmd, + expand_to_temp_buffer, is_system_include, base_name, + absolute_filename, read_name_map, open_include_file, + record_control_macro, check_precompiled, check_preconditions, + pcfinclude, pass_thru_directive, create_definition, + check_macro_name, comp_def_part, collect_expansion, + check_assertion, read_token_list, assertion_install, + assertion_lookup, eval_if_expression, conditional_skip, + validate_else, skip_quoted_string, quote_string, macarg1, + error_from_errno, install, lookup, hashf, dump_defn_1, + perror_with_name, pfatal_with_name, main, trigraph_pcp, + check_white_space, rescan, handle_directive, monthnames, + special_symbol, do_include, remap_include_file, write_output, + arglist, do_assert, do_unassert, do_line, do_error, do_once, + do_ident, do_sccs, do_xifdef, skip_if_group, + output_line_directive, macroexpand, macarg, change_newlines, + initialize_builtins, make_definition): Constify a char*. + + * pcp.h (stringdef): Likewise. + +Sun Oct 24 13:29:28 1999 Richard Henderson + + * unroll.c (copy_loop_body): Examine SET_DEST of single_set + not of pattern. + +Sun Oct 24 13:14:20 1999 Graham + Richard Henderson + + * alias.c: Include ggc.h. + (reg_base_value, new_reg_base_value, reg_base_value_size): Make static. + (record_set): Verify enough room in reg_base_value. + (init_alias_analysis): Allocate reg_base_value with xcalloc. + Register it as a GC root. + (end_alias_analysis): Free reg_base_value. Remove it as a GC root. + * Makefile.in (alias.o): Depend on ggc.h. + + * unroll.c (unroll_loop): Verify the insn before a barrier + is a JUMP_INSN before checking JUMP_LABEL. + +Sun Oct 24 15:46:44 1999 Kaveh R. Ghazi + + * mips/bsd-5.h (ASM_OUTPUT_ASCII): Constify a char*. + * mips/iris4.h (ASM_OUTPUT_ASCII): Likewise. + * mips/mips-5.h (ASM_OUTPUT_ASCII): Likewise. + * mips/mips.h (ASM_OUTPUT_ASCII): Likewise. + * mips/svr3-5.h (ASM_OUTPUT_ASCII): Likewise. + * mips/svr4-5.h (ASM_OUTPUT_ASCII): Likewise. + +Sun Oct 24 15:35:43 1999 Kaveh R. Ghazi + + * output.h (ctors_section, dtors_section, bss_section): Prototype. + + * alpha/alpha-interix.h (text_section): Delete prototype. + * alpha/elf.h (text_section): Likewise. + * arm/linux-elf.h (text_section): Likewise. + * arm/linux-telf.h (text_section): Likewise. + * c4x/c4x.h (text_section): Likewise. + * dsp16xx/dsp16xx.h (bss_section): Likewise. + * elfos.h (text_section): Likewise. + * i386/aix386ng.h (text_section): Likewise. + * i386/i386-interix.h (text_section): Likewise. + * i386/sco5.h (text_section): Likewise. + * i386/svr3gas.h (text_section): Likewise. + * nextstep.h (text_section): Likewise. + * psos.h (text_section): Likewise. + * ptx4.h (text_section): Likewise. + * svr3.h (text_section): Likewise. + * svr4.h (text_section, ctors_section, dtors_section): Likewise. + +Sun Oct 24 15:20:59 1999 Kaveh R. Ghazi + + * final.c (peephole): Delete prototype. + + * gcse.c (process_insert_insn, pre_edge_insert): Add prototypes. + (pre_insert_copies): Remove unused variable `bb'. + + * genrecog.c (debug_decision_0, debug_decision_list, main): Add + prototypes. + + * output.h (peephole): Add prototype. + +Sun Oct 24 11:35:30 1999 Mark P. Mitchell + + * config/mips/iris6.h (SUBTARGET_ASM_OPTIMIZING_SPEC): Define to + -O0. + +Sat Oct 23 21:13:00 1999 Mark Mitchell + + * integrate.c (integrate_decl_tree): Tweak setting of DECL_CONTEXT + for inlined declarations. + +Fri Oct 22 18:05:43 1999 Jeffrey A Law (law@cygnus.com) + + * arm.c (logical_binary_operator): New fucntion. + * arm.h (logical_binary_operator): Declare it. + (PREDICATE_CODES): Handle logical_binary_operator. + * arm.md (anddi3, anddi_zesidi_di, anddi_sesdi_di): Use "#" for + output constraints. Add appropriate splitters. + (anddi_notdi_di, anddi_notzesidi_di, anddi_notsesidi_di): Likewise. + (iordi3, iordi_zesidi_di, iordi_sesidi_di): Likewise. + (xordi3, xordi_zesidi_di, xordi_sesidi_di): Likewise. + +Fri Oct 22 23:46:50 1999 Bernd Schmidt + + * genoutput.c (struct operand_data): New elt eliminable. + (output_operand_data): Write it. + (scan_operands): Set it for MATCH_OPERAND, clear for other matchers. + (compare_operands): Take it into account. + * recog.h (struct insn_operand_data): New elt eliminable. + * reload1.c (check_eliminable_occurrences, elimination_effects): New + functions. + (old_asm_operands_vec, new_asm_operands_vec): Delete. + (eliminate_regs): Move code that detects changes to elimination + target regs into new function elimination_effects. + Delete one #if 0 block. + Abort for USE, CLOBBER, ASM_OPERANDS and SET. + (eliminate_regs_in_insn): Return immediately for USEs, CLOBBERs, + ADDR_VECs, ADDR_DIFF_VECs and ASM_INPUTs. + Only call eliminate_regs for real operands of the insn, not for parts + of its structure or parts matched by things like match_operator. + Use elimination_effects and check_eliminable_occurrences. Use + copy_insn to duplicate the pattern when not in the final pass. + +Fri Oct 22 09:03:44 1999 Mark Mitchell + + * i386.md: Add missing `y' modifiers to uses of fst, fstp, fld, + and fld. + +1999-10-22 Bruce Korb + + * fixinc/README: document the "mach" machine matching test + * fixinc/fixfixes.c: Implement the #else/#endif label fix + * fixinc/fixtests.c: Implement the #else/#endif label test + * fixinc/inclhack.def: utilize these tests and fixes + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + * fixinc/fixincl.sh: regen + +Thu Oct 21 20:37:19 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (cse.o): Depend on hashtab.h, not splay-tree.h. Also + depend on ggc.h. + +Thu Oct 21 20:30:19 1999 Matthias Klose + + * gcc.1: Document exit codes. + +Thu Oct 21 12:49:05 1999 Kaveh R. Ghazi + + * calls.c: Include tm_p.h later, so everything we need is defined. + * expr.c: Likewise. + * function.c: Likewise. + + * except.c: Include tm_p.h. + + * sparc.c: Likewise. + (dwarf2out_cfi_label): Don't prototype. + (check_return_regs, epilogue_renumber, + ultra_cmove_results_ready_p, ultra_fpmode_conflict_exists, + ultra_find_type, ultra_build_types_avail, ultra_flush_pipeline, + ultra_rescan_pipeline_state, set_extends, ultra_code_from_mask, + ultra_schedule_insn): Add static prototype. + (data_segment_operand, text_segment_operand): Call itself with the + proper number of arguments. + (sparc_flat_save_restore, sparc_v8plus_shift): Constify a char*. + + * sparc.h: Move all declarations to sparc-protos.h. + (SELECT_RTX_SECTION): Pass a missing MODE argument to + symbolic_operand. + + * sparc/sysv4.h (SELECT_RTX_SECTION): Likewise. + + * config/svr4.h (text_section, ctors_section, dtors_section): Add + Prototypes. + (ASM_OUTPUT_SECTION_NAME, UNIQUE_SECTION, + ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING, + ASM_OUTPUT_ASCII): Constify a char*. + + * sparc-protos.h: New file for sparc prototypes. + +Thu Oct 21 12:23:40 1999 Kaveh R. Ghazi + + * function.c (record_insns, contains): Always declare and define. + (record_insns): Mark with ATTRIBUTE_UNUSED. + +Thu Oct 21 13:03:49 1999 Jonathan Larmour + + * config/arm/telf.h (ASM_OUTPUT_SECTION_NAME): Add %nobits option + to .section when outputting a .bss section to deal with multiple + .bss input sections (as happens with -fdata-sections) + Also output %progbits, not @progbits so the assembler doesn't treat as + a comment. + * config/arm/unknown-elf.h (ASM_OUTPUT_SECTION_NAME): Likewise + + * config/arm/lib1funcs.asm (_call_via_rX): Allow compilation of + thumb parts even when building with non-thumb CPUs, by forcing + thumb mode. + +Wed Oct 20 22:57:58 1999 Jeffrey A Law (law@cygnus.com) + + * sparc.md (movsf_const_intreg): If splitting, length must be > 1. + (movdf_const_intreg_sp64): Similarly. + + * local-alloc.c (update_equiv_regs): Check the correct insn + for pre-existing REG_EQUIV notes. + +Wed Oct 20 20:41:46 1999 Mark Mitchell + + * cse.c (cse_end_of_basic_block): Don't return the end of a basic + block reached by a branch if we're not going to actually process + this block. + +Wed Oct 20 15:18:42 1999 Jim Wilson + + * integrate.c (integrate_decl_tree): Set DECL_CONTEXT to 0 if this is + a local extern function declaration. + +Wed Oct 20 13:56:01 1999 Richard Henderson + + * i386.c (ix86_expand_prologue): Properly wrap USE around + reg for CALL_INSN_FUNCTION_USAGE. + +Thu Oct 14 18:51:37 1999 Andrew Haley + + * config/mips/mips.md (movdf_internal1a): Allow floating-point + move between GP_REGs. + +Wed Oct 20 15:36:11 1999 Andrew Haley + + * config/arm/thumb.h (GO_IF_LEGITIMATE_ADDRESS): Take account of + the mode size when finding out if an offset is legal. + +Wed Oct 20 06:26:58 1999 Richard Henderson + + * basic-block.h (PROP_*): Move constants from ... + * flow.c: ... here. + (compute_bb_for_insn): Free the array before reallocating. + (update_life_info): New arg PROP_FLAGS; pass on to propagate_block. + (allocate_reg_life_data): Reset all reg variables collected by + propagate_block. + (get_block_head_tail): Don't convert from bb to block. + (get_bb_head_tail): New. Update all callers of get_block_head_tail. + (find_insn_reg_weight): Take block not bb. + (schedule_block): Don't set block num for moved insns. + (schedule_region): Don't update_life_info or find_insn_reg_weight. + (schedule_insns): Do it here instead. + * combine.c (combine_instructions): Invoke compute_bb_for_insn + before update_life_info. + * recog.c (split_all_insns, peephole2_optimize): Update for + new arg to update_life_info. + * rtlanal.c (remove_note): Cope with NULL note. + * toplev.c (rest_of_compilation): Don't invoke recompute_reg_usage + if we did sched1. + +Wed Oct 20 10:46:41 1999 Richard Earnshaw (rearnsha@arm.com) + + * jump.c (jump_optimize_1): More accurately detect casesi insns. + + * flow.c (merge_blocks_move_predecessor_nojumps): Re-order the basic + block records so that merge_blocks_nomove will clean up correctly. + (split_edge): Handle casesi insns. + + * gcc-page.c: Try MAP_ANON if we don't have MAP_ANONYMOUS. + +Tue Oct 19 23:43:50 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (call, call_value): Do not emit a blockage after restoring + the PIC register. + +Tue Oct 19 17:22:39 1999 Mark Mitchell + + * c-typeck.c (c_expand_asm_operands): Fix typo. + +Tue Oct 19 18:42:58 1999 Bernd Schmidt + + * arm.c (fpu_rhs_operand): Verify modes. + (fpu_add_operand): Likewise. + (di_operand): Likewise. + (soft_df_operand): Likewise. + +Tue Oct 19 15:26:11 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_return_in_memory): APCS rules state that the elements + of a structure returned in a register must be 'integer-like'. + +1999-10-19 Bruce Korb + + * fixinc/Makefile.in: Change the generation rules to run `genfixes' + in the source tree when the generated targets are out of date + * fixinc/genfixes: Alter it to run individual fixes for make. + * fixinc/README: rewrite + * fixinc/inclhack.def: moved initial comments to README + +Tue Oct 19 14:01:34 1999 Nick Clifton + + * toplev.c (main): Do not generate an error message if an + unrecognized command line switch is recognizable by another + language. If extra_warnings are enabled, then generate a + warning message instead. + +Tue Oct 19 11:41:12 1999 Mumit Khan + + * c-pragma.h (PRAGMA_INSERT_ATTRIBUTES): Delete macro. + (insert_pack_attributes): Delete prototype. + + * c-pragma.c (default_alignment): New static variable. + (push_alignment): Initialize to current effective alignment. + (pop_alignment): Use to set new alignment. + (insert_pack_attributes): Delete function. + (handle_pragma_token): Set default_alignment as well each time + a #pragma pack() is encountered. + +Tue Oct 19 02:03:00 1999 Jeffrey A Law (law@cygnus.com) + + * reg-stack.c (stack_result): Aggregates are not returned in + stack registers. + +Tue Oct 19 01:26:48 1999 Alasdair Baird + + * fold-const.c (fold): Fix thinko in x+(-0) -> x transformation. + +Mon Oct 18 15:19:41 1999 Richard Henderson + + * basic-block.h (set_block_num): Declare. + * flow.c (update_life_info): Don't call compute_bb_for_insn + or free_basic_block_vars. + * haifa-sched.c (remove_dependence): Conditionalize on HAVE_cc0. + (insn_orig_block): Remove. + (INSN_BLOCK): Remove. Update all callers to use BLOCK_NUM. + (schedule_block): Keep BLOCK_NUM up-to-date. + (schedule_insns): Use compute_bb_for_insn. + * recog.c (split_all_insns): Likewise. + (peephole2_optimize): Likewise. + +Mon Oct 18 18:50:51 1999 Andreas Schwab + + * config/m68k/m68k.h (INITIAL_FRAME_POINTER_OFFSET): Add one word + if the pic register is used. + +Mon Oct 18 02:38:46 1999 Bernd Schmidt + + * c-decl.c (pushdecl): Use TYPE_CONTEXT rather than TREE_PERMANENT. + (finish_decl): Duplicate test for TREE_ASM_WRITTEN in else branch of + if that tests TREE_PERMANENT. + +Mon Oct 18 01:41:35 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (invalidate_for_call): Do not remove memory references from + the table here. It's handled elsewhere. + + * haifa-sched.c (add_dependence): Protect references to the + true dependency cache with #ifdef INSN_SCHEDULING. + (remove_dependence): Similarly. + + * mn10200.md (outline_epilogue_jump): Embed a (return) to indicate + to the cfg code that this is a return instruction. + * mn10300.md (return_internal): Similarly. + + * combine.c (get_last_value): If the last set of a register + is after subst_low_cuid, then we can not use it to determine + the register's last value. + +Sun Oct 17 11:02:52 1999 Mark Mitchell + + * Makefile.in: Back out previous change. + +Sun Oct 17 15:22:50 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (move_operand): Reject (lo_sum (reg) (unspec ...)). + + * haifa-sched.c (add_dependence): Only check/update the cache + if it exists. + (remove_dependence): Likewise. + (schedule_insns): Only create the true_dependency_cache if the + average number of instructions in a basic block is very large. + +Sun Oct 17 11:02:52 1999 Mark Mitchell + + * Makefile.in (ggc-common.o): Depend on genrtl.h. + (ggc-simple.o): Likewise. + (ggc-page.o): Likewise. + +Sun Oct 17 02:09:50 1999 Andrew MacLeod + + * basic-block.h (pre_edge_lcm, pre_edge_rev_lcm, compute_available): + Prototype for exported functions. + (pre_lcm, pre_rev_lcm): Remove prototypes. + * gcse.c (compute_ae_kill): Add ae_gen and ae_kill as parameters. + (compute_available): Move to lcm.c, and change parameter order. + (one_classic_gcse_pass): Call compute_ae_kill with parameters. + (pre_insert, s_preds, s_succs, num_preds, num_succs): Delete. + (gcse_main): No longer call compute_preds_succs. Rebuild the + set table after reach pre pass. + (pre_insert_map, pre_delete_map, edge_list): New. + (alloc_pre_mem): Allocate edge vectors. + (free_pre_mem): Delete edge vectors. + (compute_pre_data): Call new edge based lcm routines. + (process_insert_insn): New function. + (insert_insn_end_bb): Use it. + (pre_edge_insert): New function. + (pre_insert_copy_insn): Formatting fixes. Update BLOCK_END as + needed. + (pre_insert_copies): Revamp using new edge based lcm outputs. + (pre_delete): Likewise. + (one_pre_gcse_pass): Insert & remove fake edges to the exit + block. + (compute_code_hoist_vbeinout): New new edge based routines. + * lcm.c: Remove all the old LCM functions. Replace with new ones + that work with the new cfg datastructures and work with edges + instead of blocks. + +Sun Oct 17 00:44:17 1999 Bernd Schmidt + + * reload.h (struct reload): Add new fields "mode" and "nregs". + * reload1.c: Change all occurrences of reload_mode and reload_nregs + to reference the "mode" and "nregs" field within struct reload. + +Sat Oct 16 21:50:28 1999 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (true_dependency_cache): New. + (add_dependence): Use the true dependency cache to avoid expensive + walks down the LOG_LINKS dependency list. Add entries to the + cache as necessary. + (remove_dependence): Remove entries from the true dependency cache + as needed. + (schedule_insns): Allocate and initialize and free the true + dependency cache. + + * haifa-sched.c (schedule_insns): Do not remove inter-block + dependencies anymore. + +Sat Oct 16 11:19:52 1999 Richard Henderson + + * i386/t-cygwin (winnt.o): Depend on RTL_H and TREE_H. + * i386/t-winnt: Likewise. + +Sat Oct 16 11:11:54 1999 Richard Henderson + + * ggc-page.c (init_ggc): Work around SunOS unaligned mmap bug. + +1999-10-16 Manfred Hollstein + + * Makefile.in (LANGUAGES): Omit "proto". + (clean): Remove stale comment about removing unprotoize.c. + +Sat Oct 16 11:29:14 1999 Kaveh R. Ghazi + + * protoize.c (safe_read, safe_write): Avoid the gcc extension of + using arithmetic on void pointers. + +Sat Oct 16 02:48:22 1999 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (compute_block_forward_dependencies): Only check + for notes, deleted insns and duplicates if ENABLE_CHECKING is defined. + +Sat Oct 16 00:07:01 1999 Richard Henderson + + * gcse.c (hash_expr_1): Add in MEM_ALIAS_SET. + (expr_equiv_p): Reject memories with different alias sets. + +Fri Oct 15 15:17:29 1999 Greg McGary + + * flags.h (flag_bounds_check, flag_bounded_pointers): New extern decls. + * toplev.c (flag_bounds_check, flag_bounded_pointers): New flags. + (f_options): Add "bounded-pointers" and "bounds-check" entries. + * c-lang.c (lang_init_options): Set flag_bounds_check as "unspecified". + (lang_init): Set default for flag_bounds_check if still "unspecified". + +Sat Oct 16 13:42:29 1999 Michael Hayes + + * config/c4x/c4x.md (HF mode patterns): Add missing modes. + +Sat Oct 16 13:37:46 1999 Michael Hayes + + * config/c4x/c4x.md (movstrqi_small): Utilize parallel move + instructions. + +Sat Oct 16 13:26:47 1999 Michael Hayes + + * config/c4x/c4x.md (*db_noclobber, + *decrement_and_branch_until_zero_noclobber): New patterns and + associated splitters. + +Sat Oct 16 13:13:15 1999 Michael Hayes + + * config/c4x/c4x.md (parallel instruction patterns): Rework + constraints to keep reload happy. + +Sat Oct 16 13:03:16 1999 Michael Hayes + + * config/c4x/c4x.md (*absqi2_noclobber, *negqi2_noclobber, + *one_cmplqi2_noclobber, *subqi3_noclobber, *andqi3_255_noclobber, + *andqi3_65535_noclobber, *andnqi3_noclobber, *xorqi3_noclobber): + Add new patterns and associated post-reload splitters. + +Sat Oct 16 12:42:12 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_emit_libcall): Use ggc_alloc_string. + +Sat Oct 16 12:34:44 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_rptb_insert): Emit rpts_top pattern + if appropriate. + * config/c4x/c4x.md (rpts_top): New pattern and splitter. + +Sat Oct 16 12:26:30 1999 Michael Hayes + + * config/c4x/c4x.c (src_operand): Check SYMBOL_REF and LABEL_REF + memory mode. + +Fri Oct 15 17:02:09 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (move_operand): Rely on memory_address_p to determine the + validity of non-indexed memory addresses. + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Allow LO_SUM with a symbolic + operand in DFmode and SFmode when generating PA2.0 code. + +Fri Oct 15 14:25:19 1999 Richard Henderson + + * print-rtl.c (print_rtx): Limit last 'u' change to LABEL_REF. + +Fri Oct 15 13:48:45 1999 Richard Henderson + + * mips.c (function_prologue): Fix argument types. + * mips.md (casesi): Use emit_jump_insn for casesi_internal. + (casesi_internal): Write to the scratch register. + +1999-10-15 11:16 -0700 Zack Weinberg + + * cppexp.c (cpp_parse_escape): Make static. Change second arg + to U_CHAR **. + (parse_charconst): Delete unnecessary cast when calling + cpp_parse_escape. + (cpplib.h): Kill prototype of cpp_parse_escape. + +Fri Oct 15 11:02:46 1999 Richard Henderson + + Based on patch from Michael Gschwind : + * unroll.c (unroll_loop): Cast return value of alloca. + * i370/i370.c: Include function.h and toplev.h. + (i370_label_scan): Remove c++ commented abort. + * i370/i370.h (HANDLE_PRAGMA): Takes three arguments. + (ASM_OUTPUT_LABELREF): Fix TOUPPER/else broken 16 Sept. + * i370/xm-i370.h (HOST_BITS_PER_LONGLONG): Define. + * i370/xm-mvs.h, i370/xm-oe.h: Likewise. + +Fri Oct 15 03:01:01 1999 Loren Rittle + + * config/t-freebsd: Do not override USER_H. + * ginclude/stddef.h: Generalize check for _MACHINE_ANSI_H_. + +Fri Oct 15 02:37:28 1999 Alastair J. Houghton + Mumit Khan + + * c-parse.in (component_decl): Support anonymous struct/union. + (%expect): Update. + * c-parse.y: Regenerate. + * c-parse.c: Likewise. + * objc/objc-parse.y: Likewise. + * objc/objc-parse.c: Likewise. + * c-decl.c (finish_struct): Don't sort the fields. + (field_decl_cmp): Delete unused function. + +Fri Oct 15 01:20:52 1999 Richard Henderson + + * sparc.md (movsf_const_intreg): Revert last constraint change. + (movdf_const_intreg_sp32): Likewise. + +Fri Oct 15 01:47:51 1999 Vladimir Makarov + + * cse.c: Include hashtab.h instead of splay-tree.h + (struct cse_reg_info): No longer use variant union. Add new + field "regno". All references changed to avoid union. + (cse_reg_info_used_list, cse_reg_info_used_list_end): New variables. + (free_cse_reg_info): Remove. + (hash_cse_reg_info, cse_reg_info_equal_p): New functions. + (get_cse_reg_info): Revamp to use expandable hash tables instead + of splay trees. Initialize new fields in cse_reg_info structure. + (new_basic_block): Similarly. + +Thu Oct 14 23:51:56 1999 Richard Henderson + + * genrecog.c (message_with_line): Prototype. + (validate_pattern): Pass along the set for the dest, not a flag. + Fix non-lvalue message. Don't warn for VOIDmode SET_DEST of CALL. + Check for PC/CC0 as sources. + (nodes_identical): Check for children position match before + allowing the combination. + + * rtl.c (read_rtx): Track line number across \\\n. + +Thu Oct 14 23:50:25 1999 Richard Henderson + + * mips.h (SPECIAL_MODE_PREDICATES): New. + * mips.md (*) Use nonimmediate_operand not general_operand for outputs. + (movdi+1, movsi+1): Add output reload constraint. + (casesi_internal): Likewise. Fix commentary. + (return_internal): Use pmode_register_operand. + +Thu Oct 14 23:19:34 1999 Richard Henderson + + * 1750a.md (movstrqi): Add missing output reload constraint. + (call_value): Likewise. + * a29k.md (cpxxx patterns): Add missing match_operator mode. + (jmpfdec): Add missing inout reload constraint. + * elxsi.md (addsi patterns): Add missing output reload constraint. + (move from sp): Use @ alternates. + (call_value): No constraint on output. + * fr30.md (movsi_pop): Add missing output reload constraint. + (movsf_constant_store): Likewise. + (splits): Remove constraints. + (subsi3): Add missing mode. + * i370.md (cmpstrsi+1): Add missing output reload constraint. + (call_value): Likewise. + * i960.md (cmpinc/cmpdec patterns): Add inout reload constraints. + * m32r.h (PREDICATE_CODES): Add seth_add3_operand. + * m32r.md (movsicc_internal): Add output reload constraint. + (movstrsi_internal): Add inout reload constraints. + * m88k.h (reg_names): Don't declare. + (SPECIAL_MODE_PREDICATES): New. + * m88k.md (*): Use register_operand not reg_or_0_operand + on destinations. + * mn10200.h (PREDICATE_CODES): New. + * ns32k.md (ffs pattern): Add output reload constraint. + * pdp11.md (sob pattern): Add inout reload constraint. + * sh.md (splits): Remove constraints. + (indirect_jump_scratch, fpu_switch): Add output reload constraint. + * v850.md (pattern_is_ok_for_epilogue): Likewise. + * vax.md (jgequ pattern): Add inout reload constraint. + +Fri Oct 15 00:05:00 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (djgpp): Revert previous patch. + * configure: Rebuit. + * config/i386/djgpp.h: Revert previous patch. + +Fri Oct 15 00:00:24 1999 Loren J. Rittle + + * fixinc/inclhack.def: Restore patch lost during last merge of + "no_bogosity" branch. + * fixinc/inclhack.sh, fixinc/fixincl.x: Rebuilt. + +Thu Oct 14 23:57:56 1999 Gavin Romig-Koch + + * fixincludes: Add a HPUX 11 fix for inttypes.h. + * fixinc/inclhack.def: Same. + * fixinc/inclhack.sh, fixinc/fixincl.sh, fixinc/fixincl.x: Regenerate. + +Thu Oct 14 22:51:55 1999 Richard Henderson + + * alpha.h (GO_IF_LEGITIMATE_SIMPLE_ADDRESS): Accept ADDRESSOF + as the base of a PLUS. + +Fri Oct 15 18:36:07 1999 Michael Hayes + + * config/c4x/c4x.md: Define mode for remaining unspec operators. + * config/c4x/c4x.c (dst_operand): Use nonimmediate_operand. + +Thu Oct 14 22:14:23 1999 Richard Henderson + + * pa.md (post_stw+1): Use pmode_register_operand. + (dcacheflush, icacheflush): Likewise. + + * i386.md (movstricthi_1): Allow r/r. + +Thu Oct 14 19:44:08 1999 Jan Hubicka + + * fold-const.c (fold): Convert (or (not arg0) (not arg1)) + to (not (and (arg0) (arg1))). Similary for and. + + * fold-const.c (fold): Move bit_rotate code to the EXPR_PLUS case, + fallthrough to associate code. + Convert XOR to OR in code like (a&c1)^(a&c2) where c1 and c2 don't have + bits in common. + + * combine.c (simplify_logical): Convert XOR to IOR if operands have + no bits in common; remove XOR to ROTATE conversion. + +Fri Oct 15 17:40:11 1999 Michael Hayes + + * config/c4x/c4x.h (c4x_va_start, c4x_va_arg): Declare. + +Fri Oct 15 17:27:17 1999 Michael Hayes + + * config/c4x/c4x.c (dst_operand): New. + (PREDICATE_CODES): Update. + * config/c4x/c4x.h (dst_operand): Declare it. + * config/c4x/c4x.md: Define mode for each unspec usage. + (move patterns): Use dst_operand predicate instead of src_operand. + (movqi_update, movqf_update): Delete. + +Thu Oct 14 18:48:54 1999 Richard Henderson + + * recog.c (pmode_register_operand): New. + * recog.h: Declare it. + * genrecog.c (pred_codes): Likewise. + (special_mode_pred_table): Likewise. + (validate_pattern): Don't warn no mode for address_operand. + + * print-rtl.c (print_rtx) [LABEL_REF]: Only do full subexpression + if the operand is not insn-like. + +Thu Oct 14 19:38:42 1999 Jeffrey A Law (law@cygnus.com) + Sylvian Pion + + * fold-const.c (fold): Handle more simplifications allowed by IEEE. + +Thu Oct 14 17:30:14 1999 Richard Henderson + + * sparc.md (*): Use {nonimmediate,register}_operand as appropriate + instead of general_operand in a SET_DEST. Use const_double_operand + instead of an explicit test against CONST_DOUBLE. + (movsf_const_lo): Add missing register mode. + (goto_handler_and_restore): Add auxiliary test for Pmode. + (flush): Adjust to use address_operand. + (return_sf_no_fpu): Add missing output constraint. + +Thu Oct 14 17:21:26 1999 Richard Henderson + + * rs6000.md (call_value_indirect_aix32): Use wildcard match_operand + for call return value. + (call_value_indirect_aix64, call_value_indirect_nt): Likewise. + +Thu Oct 14 13:54:25 1999 Jason Merrill + + * toplev.c (main): Only warn about options for other languages. + * collect2.c (main): Pass -w to sub-gcc. + +Thu Oct 14 16:27:50 1999 Richard Henderson + + * flow.c (propagate_block): Add call-clobbered registers to + significant too. + + * flow.c (propagate_block): Use free_EXPR_LIST_list instead of + zapping mem_set_list. + (invalidate_mems_from_autoinc): Use free_EXPR_LIST_node. + (mark_set_1, mark_used_regs): Likewise. + +Thu Oct 14 10:51:49 1999 Richard Henderson + + * m68k.md (zero_extendsidi2): Add missing output reload constraint. + +Wed Oct 13 00:09:18 1999 Gerald Pfeifer + + * invoke.texi: Label -Wbad-function-cast, -Wmissing-prototypes, + -Wnested-externs, -Wstrict-prototypes, and -Wtraditional as C only + options. Also add a new item "C-only Warning Options" to the + option summary. + +1999-10-14 Gavin Romig-Koch + + * libgcc2.c (__do_global_dtors): Protect __deregister_frame_info + from multiple calls. + +Thu Oct 14 04:54:54 1999 Richard Henderson + + * i386.md (call value patterns): Move to the end of the file. + (prologue_set_got, prologue_get_pc): Use register_operand for op 0. + +1999-10-14 Mark Elbrecht + + * configure.in (djgpp configuration): Define extra_objects.. + * configure: Rebuilt. + * config/i386/djgpp.h (CTORS_SECTION_ASM_OP): Define. + (DTORS_SECTION_ASM_OP): Define. + (INIT_SECTION_ASM_OP): Define. + (FINI_SECTION_ASM_OP): Define. + (DATA_SECTION_ASM_OP): Define. + (TEXT_SECTION_ASM_OP): Define. + (EH_FRAME_SECTION_ASM_OP): Define. + (LINK_COMMAND_SPEC): Remove -Tdjgpp.djl. + (STARTFILE_SPEC): Add crtbegin.o. + (ENDFILE_SPEC): Define and add crtend.o. Move argument -Tdjgpp.djl + to here from LINK_COMMAND_SPEC. + (DO_GLOBAL_CTORS_BODY): Define. + (CRTSTUFF_USE_FINI_SECTION): Define + (HAS_INIT_SECTION): Delete. + +Thu Oct 14 05:08:14 1999 Andreas Schwab + + * Makefile.in (all.cross): Depend on xcpp$(exeext). + +Thu Oct 14 04:00:40 1999 Richard Henderson + + * pa.h (PREDICATE_CODES): New. + + * genrecog.c (validate_pattern): Condense the destination + non-lvalue message. + +Thu Oct 14 03:23:08 1999 Richard Henderson + + * alpha.md (call-1): Supply missing mode for operator. + (*): Add missing output reload constraints. Remove constraints + from define_splits. + + * i386.h (SPECIAL_MODE_PREDICATES): New. + * i386.md (movstricthi_1): Use nonimmediate_operand for op 0. + (movqi_1, movdi_1, movdi_2, some splits): Likewise. + (addsi_lea_3): Add missing mode for op 3. + (prologue_set_got, prologue_get_pc): Add missing modes. + (*) Add missing output reload constraints. + +Thu Oct 14 03:59:57 1999 Stephane Carrez + + * stor-layout.c (layout_union): Use HOST_WIDE_INT for const_size; + check for member bit-size overflow and use var_size if it occurs. + (layout_record): Use bitsize_int() to define the type size in bits. + Likewise for computation and assignment to DECL_FIELD_BITPOS. + (layout_decl): Likewise when assigning to DECL_SIZE. + +Thu Oct 14 02:57:05 1999 Richard Henderson + + * genrecog.c (validate_pattern): Typo last change. Verify + that output operands have output reloads. + +Thu Oct 14 01:49:54 1999 Richard Henderson + + * genrecog.c (special_mode_pred_table): New. + (NUM_SPECIAL_MODE_PREDS): New. + (find_operand): New. + (validate_pattern): New argument `insn'. Warn for assignment to + any predicate accepting non-lvalues. Conditionally warn for + match_operand without a mode. Try much harder to match source + and destination modes on a set. + * tm.texi (SPECIAL_MODE_PREDICATES): Document. + +Thu Oct 14 02:54:13 1999 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (fold): Detect rotates built from BIT_XOR_EXPRs. + +Thu Oct 14 02:18:19 1999 Marc Espie + + * combine.c (simplify_logical): Recognize xor pattern that encodes + rotation. + +Wed Oct 13 23:23:45 1999 Franz Sirl + + * rs6000.c (expand_block_move): Use INTVAL, not XINT to access + alignment. + +Wed Oct 13 21:47:18 1999 Richard Henderson + + * ggc-page.c (MAP_FAILED): Provide default. + +Wed Oct 13 21:41:59 1999 Richard Henderson + + * sparc.c (symbolic_operand): Verify mode; don't accept CONST_DOUBLE. + * sparc.h (PREDICATE_CODES): Update. + +Wed Oct 13 21:18:17 1999 Richard Henderson + + * alpha.c (some_ni_operand): New. + * alpha-protos.h: Declare it. + * alpha.h (PREDICATE_CODES): Update. + * alpha.md (sXaddq reload insns): Use some_ni_operand + for SET_DEST instead of some_operand. + +Wed Oct 13 21:04:45 1999 Richard Henderson + Jim Wilson + + * genrecog.c (maybe_both_true_2): Don't compare modes of + two DT_pred tests. + (process_tree): Elide peephole2_insns. Invoke simplify_tests + after find_afterward. + (debug_decision_1): Dump next and afterward codes. + +Wed Oct 13 20:35:16 1999 Richard Henderson + + * rtl.c (dump_and_abort): Remove. + (fatal_with_file_and_line): New. + (fatal_expected_char): New. + (read_rtx_lineno, read_rtx_filename): New. + (read_skip_spaces): Track line number. + (read_name): Use fatal_with_file_and_line. + (read_rtx): Use fatal_expected_char. Track line number. + * rtl.h (read_rtx_filename, read_rtx_lineno): Declare. + + * print-rtl.c (print_rtx): Don't special case LABEL_REF argument + if it isn't a CODE_LABEL. + + * genattr.c (main): Set read_rtx_filename. + * genattrtab.c (main): Likewise. + * gencodes.c (main): Likewise. + * genconfig.c (main): Likewise. + * genemit.c (main): Likewise. + * genextract.c (main): Likewise. + * genflags.c (main): Likewise. + * genopinit.c (main): Likewise. + * genoutput.c (main): Likewise. + * genpeep.c (main): Likewise. + + * genrecog.c (decision_test.u.insn): Add `lineno'. + (pattern_lineno, error_count): New variables. + (message_with_line): New. + (add_to_sequence): Break out checking code to ... + (validate_pattern): ... here. Detect SET_DEST matching CONST_INT. + (merge_insn): Use message_with_line. + (make_insn_sequence): Use validate_pattern. Record insn lineno. + (main): Set read_rtx_filename, pattern_lineno. Exit early on error. + +Wed Oct 13 22:01:35 1999 J"orn Rennecke + + * expr.c (store_constructor): Clear union if constructor is empty. + +Wed Oct 13 15:19:04 1999 Jim Wilson + + * config/rs6000/sysv4.h (CC1_SPEC): Fix errors from Jan 19 change. + Add !endian checks. Change %{...} to %(...). + +Wed Oct 13 13:30:34 1999 Richard Henderson + + * i386.md (*addsi3_cc): Renamed from addcsi3. + (*addsi3_carry): Renamed from addxsi3. + (*subsi3_cc): Renamed from subcsi3. + (*subsi3_carry): Renamed from subxsi3. + (*xorqi_cc_1): Renamed from xorcqi_1. + (xorqi_cc_ext_1): Renamed from xorcqi_ext_1. + * i386.c (ix86_expand_fp_compare): Update for xorqi_cc_ext_1. + +Wed Oct 13 13:10:46 1999 Richard Henderson + + * Makefile.in (ggc-common.o): Depend on RTL_H not RTL_BASE_H. + (ggc-simple.o, ggc-page.o, ggc-none.o, ggc-callbacks.o): Likewise. + +1999-10-13 Brendan Kehoe + + * regmove.c (optimize_reg_copy_3): Make sure P is non-nil as we + climb up the chain of insns. + +Wed Oct 13 10:20:58 1999 Richard Henderson + + * genrecog.c (write_subroutine): Careful for null trees. + (process_tree): Don't elide empty functions. + +Wed Oct 13 10:07:54 1999 Richard Henderson + + * Makefile.in (genrtl.o): Depend on ggc.h. + * configure.in (valloc): Probe for it. + (with-gc): Use ggc-page if valloc present. + * ggc-common.c (ggc_mark_rtx_children): Use ggc_mark_if_gcable. + (ggc_mark_rtvec_children): New from corpse of ggc_mark_rtvec. + (ggc_alloc_string): Moved from ggc-page.c. + * ggc-none.c (ggc_alloc_obj): New. + (ggc_alloc_rtx, ggc_alloc_rtvec): Remove. + * ggc-page.c (sys/mman.h): Only include if HAVE_MMAP. + (struct globals): Likewise for dev_zero_fd. + (init_ggc): Likewise for it's initialization. + (ggc_allocated_p): Move careful dereference from ... + (ggc_lookup_page_table): ... here. Delete. + (lookup_page_table_entry): Don't use ggc_lookup_page_table. + (alloc_anon): Use valloc if no mmap. + (release_pages): Use free if using valloc. + (ggc_alloc_obj): Renamed from alloc_obj. + (ggc_set_mark): Renamed from mark_obj. + (ggc_mark_if_gcable): Renamed from ggc_mark_string_if_gcable. + (ggc_alloc_rtx, ggc_alloc_rtvec): Delete. + (ggc_alloc_tree, ggc_alloc_string, ggc_alloc): Delete. + (ggc_set_mark_rtx, ggc_set_mark_rtvec): Delete. + (ggc_set_mark_tree, ggc_mark_string, ggc_mark): Delete. + (ggc_collect): Use fp printing instead of our own rounding. + * ggc-simple.c (IS_MARKED, IGNORE_MARK): Delete. + (GGC_STRING_MAGIC, GGC_STRING_MAGIC_MARK): Delete. + (GGC_ANY_MAGIC, GGC_ANY_MAGIC_MARK): Delete. + (struct ggc_rtx, struct ggc_rtvec, struct ggc_tree): Delete. + (struct ggc_string, struct ggc_any): Delete. + (offsetof): Provide default definition. + (GGC_BALANCE, GGC_ALWAYS_COLLECT, GGC_ALWAYS_VERIFY): New. + (PTR_KEY): New. + (struct ggc_mem): New, from corpse of ggc_any. + (struct ggc_status): Delete. + (ggc_chain, ggc_allocated_strings, ggc_strings_used): Delete. + (n_rtxs_collected, n_vecs_collected, n_trees_collected): Delete. + (n_strings_collected, n_anys_collected): Delete. + (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Delete. + (ggc_alloc_string, ggc_alloc): Delete. + (ggc_free_rtx, ggc_free_rtvec, ggc_free_tree): Delete. + (ggc_free_string, ggc_free_any): Delete. + (ggc_set_mark_rtx, ggc_set_mark_rtvec, ggc_set_mark_tree): Delete. + (ggc_compare_addresses, ggc_mark_string): Delete. + (ggc_mark_string_if_gcable, ggc_mark): Delete. + (search_data): Delete. + (struct globals): New. + (GGC_MIN_EXPAND_FOR_GC, GGC_MIN_LAST_ALLOCATED): New. + (tree_insert, tree_lookup): New. + (ggc_alloc_obj, ggc_set_mark, ggc_mark_if_gcable): New. + (clear_marks, sweep_objs): New. + (ggc_collect): Gut. Use clear_marks, sweep_objs. + (init_ggc): Set allocated_last_gc. + (ggc_push_context): Gut. Use G.context. + (ggc_pop_context): Likewise. + (ggc_pop_context_1): New. + (debug_ggc_tree): New. + (debug_ggc_balance, tally_leaves): New. + * ggc.h (ggc_mark_rtvec, ggc_mark_string, ggc_mark): Remove decl. + (ggc_mark_string_if_gcable): Remove decl. + (ggc_mark_rtx, ggc_mark_tree): Use ggc_set_mark. + (ggc_mark_rtvec_children): New. + (ggc_mark_rtvec, ggc_mark_string, ggc_mark): New. + (ggc_mark_if_gcable): New decl. + (ggc_alloc_rtx, ggc_alloc_rtvec): Remove decl. + (ggc_alloc_tree, ggc_alloc): Likewise. + (ggc_set_mark_rtx, ggc_set_mark_rtvec, ggc_set_mark_tree): Likewise. + (ggc_alloc_obj): New decl. + (ggc_alloc_rtx, ggc_alloc_rtvec): New macros. + (ggc_alloc_tree, ggc_alloc): Likewise. + (ggc_set_mark): New decl. + * rtl.h (struct rtx_def): Remove gc_mark. + (struct rtvec_def): Likewise. + * tree.h (struct tree_common): Likewise. + +Wed Oct 13 01:44:29 1999 Carol LePage + + * configure.in (sparc-hal-solaris2*): Fix xm_file, xm_defines, + float_format and thread_file definitions. + * configure: Rebuilt. + +Wed Oct 13 09:25:03 1999 Niels Möller + + * extend.texi (Function Names): Document types of function names. + +Wed Oct 13 00:45:04 1999 Bernd Schmidt + + * reload1.c (reload_reg_free_for_value_p): RELOAD_OTHER reloads with + an earlyclobbered output conflict with RELOAD_INPUT reloads. + +Tue Oct 12 23:28:28 1999 J"orn Rennecke + + * sh.h (BOOL_TYPE_SIZE): Don't use INT_TYPE_SIZE / CHAR_TYPE_SIZE. + +Tue Oct 12 23:19:32 1999 J"orn Rennecke + + * sh.h (REGISTER_MOVE_COST): Change PR_REG to PR_REGS. + +Tue Oct 12 17:09:38 1999 David Edelsohn + + * collect2.c (main): Do prelimnary link on AIX if rflag. + +Tue Oct 12 09:45:19 1999 Jonathan Larmour + + * config/rs6000/eabi-ctors.c (__do_global_ctors): Run through + __CTOR_LIST__ in opposite order, which is the correct order for sorted + constructors. + (__do_global_dtors): similarly for __DTOR_LIST__. + +Fri Oct 8 19:46:03 1999 J"orn Rennecke + Diego Novillo + + * config/sh/sh.h (REGISTER_MOVE_COST): Handle moves from T_REGS to + FPUL_REGS. + +Tue Oct 12 07:38:41 1999 Bruce Korb + + * fixincl/*: Merged "no_bogosity" branch + * fixincl/fixlib.h: protect against doubly defining t_bool + * fixincl/server.h: protect against doubly defining t_bool + +Mon Oct 11 20:18:41 1999 Jim Wilson + + * genoutput.c: Include toplev.h. + +Mon Oct 11 18:56:14 1999 Jim Wilson + + * config/sparc/liteelf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): + Undef. + * configure.in (sparclite-*-elf, sparc86x-*-elf): Don't use libgloss.h. + * configure: Regenerate. + +Mon Oct 11 16:07:49 1999 Richard Henderson + + * gcse.c (delete_null_pointer_checks): Returns void. + +Mon Oct 11 20:31:51 1999 Bernd Schmidt + + * rtl.c (copy_rtx): Don't use accessor macros to copy fields. + * emit-rtl.c (copy_insn_1): Likewise. + +Mon Oct 11 13:29:06 1999 Geoffrey Keating + + * config/mips/mips.c (mips_build_va_list): Correct + TREE_CHAIN setting when hard-float. + (mips_va_start): Use corrected setting. + (mips_va_arg): Likewise. Also pass a tree to build of + POSTINCREMENT_EXPR rather than a naked 'int'. + +Sun Oct 10 18:27:27 1999 Mark Mitchell + + * ggc.h (ggc_push_context): Fix comment. + (ggc_pop_context): Likewise. + (mark_string_if_gcable): Likewise. + * ggc-common.c (ggc_mark_rtx_children): Use + ggc_mark_string_if_gcable. + * ggc-page.c (ggc_lookup_page_table): New function. + (ggc_allocated_p): Likewise. + (mark_obj): Fix formatting. + (ggc_mark_string_if_gcable): New function. + * ggc-simple.c (ggc_allocated_strings): New variable. + (ggc_strings_used): Likewise. + (ggc_compare_addresses): New function. + (ggc_pop_context): Pop the `any' memory too. + (ggc_mark_string_if_gcable): New function. + (ggc_collect): Initialize and tear down ggc_allocated_strings. + +Sun Oct 10 20:05:21 1999 David Edelsohn + + * rs6000.md (movstrsi_?reg): Use preferred rD/rS = r5 form. + (scc patterns): Disable most SImode variants if TARGET_POWERPC64. + * rs6000.c (expand_block_move): Match movstrsi_?reg register + changes. + +Sun Oct 10 16:37:01 1999 Richard Henderson + + * haifa-sched.c (sched_reg_n_calls_crossed): Delete. + (sched_reg_live_length, sched_reg_basic_block): Delete. + (current_block_num, bb_live_regs, old_live_regs): Delete. + (dead_notes, struct sometimes): Delete. + (sched_note_set, birthing_insn_p): Delete. + (adjust_priority): Gut useless reg lifetime code. + (create_reg_dead_note, attach_deaths): Delete. + (attach_deaths_insn, new_sometimes_live): Delete. + (finish_sometimes_live): Delete. + (find_pre_sched_live, find_post_sched_live): Delete. + (update_reg_usage): Delete. + (find_insn_reg_weight): New, from corpse of find_pre_sched_live. + (schedule_insns): Delete reg lifetime code. + (sched_analyze): Use REG_SAVE_NOTE to stuff NOTE_INSN notes away. + (unlink_other_notes): Adjust REG_NOTE commentary. + (reemit_notes): Use REG_SAVE_NOTE. + (schedule_block): Likewise. + (schedule_region): Allocate bitmap of blocks in region. Use + count_or_remove_death_notes. Use update_life_info. + + * rtl.h (REG_SAVE_NOTE): New. + * rtl.c (reg_note_name): Update. + +Sun Oct 10 16:14:16 1999 Richard Henderson + + * combine.c (refresh_blocks, need_refresh): New. + (combine_instructions): Allocate refresh_blocks. Invoke + update_life_info if needed. + (distribute_notes): Mark refresh_blocks instead of installing + USE insns. + * flow.c (update_life_info): Remove notes if GLOBAL_RM_NOTES. + * basic_block.h (enum update_life_extent): Add GLOBAL_RM_NOTES. + + * Makefile.in (recog.o): Depend on basic-block.h. + +Sun Oct 10 12:03:21 1999 Richard Henderson + + * genrecog.c (add_to_sequence): Thinko last change: delete + shadowing allow_const_int variable. + +Sun Oct 10 08:40:00 1999 Kaveh R. Ghazi + + * cppinit.c: Use HAVE_GCC_VERSION instead of explicitly testing + __GNUC__ and __GNUC_MINOR__. + + * gansidecl.h: Likewise. + + * rtl.c: Likewise. + + * rtl.h: Likewise. + + * toplev.h: Likewise. + + * tree.c: Likewise. + + * tree.h: Likewise. + + * varray.c: Likewise. + + * varray.h: Likewise. + +Sun Oct 10 13:28:48 1999 Bernd Schmidt + + * loop.c (find_and_verify_loops): When looking for a BARRIER, don't + use one before a jump table. + + * rtl.def (ADDRESS): Change documentation to match reality. + * md.texi: Don't document it. + * gmicro.md (load address pattern): Use 'p' constraint, delete use + of ADDRESS rtx. + + * emit-rtl.c (copy_insn_1): Make format_ptr a const char *. + +Sun Oct 10 02:41:41 1999 Richard Henderson + + * genrecog.c (add_to_sequence): Move allow_const_int test outside + known predicate block; default allow_const_int true. + (debug_decision_list): New. + +Sun Oct 10 00:43:08 1999 Richard Henderson + + * i386.h (CC1_SPEC): Typo -- use cc1_cpu. + +Sat Oct 9 23:26:55 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (gcse_main): Avoid global optimizations if we have a + large number of basic blocks and the ratio of edges to blocks + is high. + (delete_null_pointer_checks): Likewise. + +Sat Oct 9 23:16:01 1999 Ken Raeburn + + * c-common.c (check_format_info): Warn if format string isn't a + string literal. + +Sat Oct 9 23:04:02 1999 Jonathan Larmour + + * configure.in (arm*-*-*): Don't let autoconf remove brackets + * configure: regenerate + +Sat Oct 9 13:15:53 1999 Richard Henderson + + * alpha.md (extendsidi2): Turn into a splitter. Allow f/f. + If TARGET_FIX, allow r/f. Remove cvtlq unspec pattern. + (peepholes): Re-enable. + +Sat Oct 9 12:18:16 1999 Richard Henderson + + * Makefile.in (flow.o): Depend on TREE_H. + * basic-block.h (REG_SET_EQUAL_P): New. + (XOR_REG_SET): New. + (n_edges): Declare. + (free_regset_vector): Remove declaration. + (flow_delete_insn_chain): Declare. + (enum update_life_extent): New. + (update_life_info, count_or_remove_death_notes): Declare. + * combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head. + Verify register live at bb->global_live_at_start before adding USE. + * flow.c (HAVE_epilogue, HAVE_prologue): Provide default. + (CLEAN_ALLOCA): New. + (n_edges): New. + (PROP_*): New flags. + (find_basic_blocks_1): Use alloc_EXPR_LIST. + (clear_edges): Zero n_edges. + (make_edge): Increment n_edges. + (split_edge): Don't allocate bb->local_set. Increment n_edges. + (flow_delete_insn_chain): Export. + (delete_block): Decrement n_edges. + (merge_blocks_nomove): Likewise. + (life_analysis): Give life_analysis_1 PROP flags. + (verify_wide_reg_1, verify_wide_reg): New. + (verify_local_live_at_start): New. + (update_life_info): Rewrite to call into propagate_block. + (mark_reg): New. + (mark_regs_live_at_end): After reload, if epilogue as rtl, + always mark stack pointer. Conditionally mark PIC register. + After reload, mark call-saved registers, return regsiters. + (life_analysis_1): Accept PROP flags not remove_dead_code. + Call mark_regs_live_at_end before zeroing regs_ever_live. + Use calculate_global_regs_live. Copy global_live_at_end before + calling final propagate_block. Zero reg_next_use on exit. + (calculate_global_regs_live): New. + (allocate_bb_life_data): Don't allocate bb->local_set. + (init_regset_vector, free_regset_vector): Remove. + (propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE. + Test flags before every operation. Warn if prologue/epilogue insn + would have been deleted. + (mark_set_regs, mark_set_1): Accept and use FLAGS. + Use alloc_EXPR_LIST. + (mark_used_regs): Accept and use FLAGS, not FINAL. + Remove special handling for RETURN. + (try_pre_increment): Use alloc_EXPR_LIST. + (dump_flow_info): Dump n_edges. + (unlink_insn_chain, split_hard_reg_notes): Remove. + (maybe_add_dead_note, maybe_add_dead_note_use): Remove. + (find_insn_with_note, new_insn_dead_notes): Remove. + (update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove. + (maybe_remove_dead_notes, prepend_reg_notes): Remove. + (replace_insns): Remove. + (count_or_remove_death_notes): New. + (verify_flow_info): Abort on error after all checks. + (remove_edge): Decrement n_edges. + (remove_fake_edges): Tweak format. + * haifa-sched.c (schedule_insns): Use split_all_insns. + * output.h (update_life_info): Remove declaration. + * recog.c (split_all_insns): From the corpse of split_block_insns, + do the whole function block by block. Use update_life_info. + (recog_last_allowed_insn): New. + (recog_next_insn): Mind it. + (peephole2_optimize): Set it. Walk backwards through blocks. + Use update_life_info. + * rtl.h (update_flow_info, replace_insns): Remove declarations. + (split_all_insns): Declare. + * toplev.c (rest_of_compilation): Thread prologue before flow2. + Use split_all_insns. + + * i386.md (or -1 peep2s): Disable. + +Fri Oct 8 17:49:08 1999 Richard Henderson + + * config/mips/mips.md (movstrsi+[123]) : Combine these into + a single pattern. Scrap the 'd' versions as unnecessary. + + * config/mips/mips.md (tablejump_internal3,tablejump_mips161, + tablejump_mips162,tablejump_internal4): The operands to a + label_ref must be VOIDmode. + +Fri Oct 8 16:12:42 1999 Kaveh R. Ghazi + + * configure.in (c-mbchar): Append, don't overwrite, `extra_c_flags'. + +Fri Oct 8 11:58:34 1999 Richard Henderson + + * mips.c (mips_va_arg) [EABI]: Return addr_rtx. + +Fri Oct 8 11:58:34 1999 Richard Henderson + + * lists.c (init_EXPR_INSN_LIST_cache): Don't need to zap the + cache every function if ggc_p. + +Fri Oct 8 18:46:11 1999 Bernd Schmidt + + * jump.c (duplicate_loop_exit_test): Use copy_insn/copy_insn_1 + instead of copy_rtx. Accept sequences that contain asm statements. + * emit-rtl.c (copy_insn_1, copy_insn): New functions. + (copy_insn_scratch_in, copy_insn_scratch_out, copy_insn_n_scratches, + orig_asm_operands_vector, copy_asm_operands_vector, + orig_asm_constraints_vecotr, copy_asm_constraints_vector): New static + variables. + * rtl.h (copy_insn, copy_insn_1): Declare. + +Fri Oct 8 13:08:12 1999 Kaveh R. Ghazi + + * Makefile.in (insn-recog.o): Depend on hard-reg-set.h and resource.h. + + * alpha.h (ASM_OUTPUT_MI_THUNK): Pass the correct number of + arguments to `current_file_function_operand'. + + * genrecog.c: Include hard-reg-set.h and resource.h in the + generated output file. + + * real.c: Include tm_p.h. + +Fri Oct 8 18:46:11 1999 Bernd Schmidt + + * i386.md (prologue_allocate_stack): Add '=' constraint letter on + output operand. + +Thu Oct 7 23:06:50 1999 Richard Henderson + + * rs6000.md (fix_truncdfsi2_internal+1): Emit a clobber + before the fctiwz insn. + +Thu Oct 7 22:53:00 1999 Franz Sirl + Mark Mitchell + + * tree.c (make_lang_type_fn): New function pointer. + (make_lang_type): Call it. + * tree.h (make_lang_type): Declare. + (make_lang_type_fn): Likewise. + * rs6000.c (rs6000_build_va_list): Use make_lang_type. + +Thu Oct 7 00:36:17 1999 Diego Novillo + + * config/rs6000/rs6000.c (secondary_reload_class): For TARGET_ELF + make sure that HIGH instructions are copied into BASE_REGS. + +Thu Oct 7 17:02:34 1999 Jason Merrill + + * expr.c (expand_expr, TARGET_EXPR): Set TREE_USED sooner. + +Thu Oct 7 17:01:58 1999 Greg McGary + + * c-decl.c (finish_struct): Use simpler method of + removing elements of a singly-linked list. + +Thu Oct 7 15:23:28 1999 Michael Meissner + + * alpha.md (peephole2's): Comment out peephole2's that generate + buggy code. + +Thu Oct 7 12:00:53 1999 Richard Henderson + + * genrecog.c (add_to_sequence): Disable mode check for + wildcard matches. + +Thu Oct 7 20:14:16 1999 Bernd Schmidt + + * ggc-simple.c (init_ggc): Set empty_string. + +Thu Oct 7 01:13:15 1999 Richard Henderson + + * configure.in: Detect mmap. Add --with-gc=foo to select + garbage collector; default to page if mmap available. + * Makefile.in (GGC): Substitute. + +Wed Oct 6 23:56:30 1999 Richard Henderson + + * c-decl.c (ggc_p): Enable. + +Wed Oct 6 17:17:08 1999 Kaveh R. Ghazi + + * flow.c (verify_flow_info): Make it extern & unconditionally define. + +1999-10-06 Brendan Kehoe + + * sparc/sp86x-elf.h (SUBTARGET_SWITCHES): Add missing doc + string for little-endian-data. + +Wed Oct 6 16:10:35 1999 Michael Meissner + + * varray.h (VARRAY_CHECK): Fix up appropriate revision check, in + case somebody tries to compile --enable-checking code with gcc + 1.34 or such. + +Wed Oct 6 12:22:50 1999 Richard Henderson + + * genrecog.c (add_to_sequence): Verify operand to label_ref is + VOIDmode. + +Wed Oct 6 10:21:15 1999 Richard Henderson + + * genconfig.c (main): Disable HAVE_conditional_arithmetic. + * jump.c (jump_optimize_1): Document why. + +Wed Oct 6 10:41:56 1999 Kaveh R. Ghazi + + * collect2.c (scan_prog_file, scan_libraries): Prototype function + pointers and casts for `int_handler' and `quit_handler'. + + * flow.c (verify_flow_info, split_hard_reg_notes, + find_insn_with_note, sets_reg_or_subreg_1, prepend_reg_notes, + remove_edge, remove_fake_successors): Add static prototypes. + (verify_flow_info): Wrap with macro ENABLE_CHECKING. + (mark_set_1): Initialize variable `regno'. + (unlink_insn_chain): Likewise for variable `curr'. + (remove_fake_edges): Remove unused variables `e', `tmp' and `last'. + + * loop.c (strength_reduce): Initialize variable + `unrolled_insn_copies'. + (cmp_combine_givs_stats, cmp_recombine_givs_stats): Add static + prototypes. Change these functions to take const PTR parameters + to avoid prototype conflict when used as the comparson argument + for qsort. + (check_dbra_loop): Initialize variable `comparison_val'. + + * reload.c (debug_reload_to_stream, debug_reload): Add prototypes. + (get_secondary_mem): Mark parameter `x' with ATTRIBUTE_UNUSED. + (find_valid_class): Initialize variable `best_class'. + (find_reloads): Call memcpy, not bcopy. + + * reload1.c (gen_mode_int, dump_needs): Add prototypes. + (hard_reg_use_compare): Don't needlessly cast away const. + (reload_reg_class_lower): Likewise. + (choose_reload_regs): Initialize variable `regno'. + +Tue Oct 5 16:34:12 1999 Paul Burchard + + * ggc-page.c (GGC_ALWAYS_COLLECT): Fix typo when undef'ing. + +Tue Oct 5 16:14:40 1999 Michael Meissner + + * libgcc1-test.c (toplevel): Include stddef.h to get size_t. + ({,d}discard): Add forward declarations. Declare parameter as + unused. + (main_without_main): Explicitly declare return type to be int. + (memcpy): Properly declare. + + * libgcc2.c (toplevel): If inhibit_libc is defined and not + building the trampoline support, declare malloc, free, and + atexit. + (__clear_cache): Mark arguments as potentially unused. + + * frame.c (toplevel): If inhibit_libc is defined, declare + malloc and free. + +Tue Oct 5 12:00:32 1999 Richard Henderson + + * flow.c (make_edge): Accept an optional 2D bitmap in which + to cache edge existence. Update all callers. + (make_label_edge, make_eh_edge): Pass through the edge cache. + (make_edges): Provide the cache. + +Tue Oct 5 12:16:49 1999 Kaveh R. Ghazi + + * mbchar.c (literal_codeset, local_mbtowc, local_mblen): Constify + a char*. + (local_mbtowc): Change the type of variable `i' from int to size_t. + + * mbchar.h (ISSJIS1, ISSJIS2): Use parens around && within ||. + (local_mbtowc, local_mblen, literal_codeset): Constify a char*. + +Tue Oct 5 11:34:52 1999 Michael Meissner + + * ggc-common.c (toplevel): Reorder includes, so that ggc.h comes + after other includes that define the appropriate types. Include + tm_p.h for getting user prototypes. + * ggc-callbacks.c (toplevel): Ditto. + * ggc-none.c (toplevel): Ditto. + * gcc-page.c (toplevel): Ditto. + * ggc-simple.c (toplevel): Ditto. + +Mon Oct 4 16:48:16 1999 Diego Novillo + Jonathan Larmour + + * config/mips/mips.c (mips_move_2words): Split doubles if + ISA >= 3, !TARGET_64BIT, and destination is not an FP register. + +Mon Oct 4 21:47:31 1999 Richard Henderson + + * genrecog.c (struct decision_test): New. + (struct decision): Remove test-related members, sort the rest by size. + (IS_SPLIT): Simplify. + (new_decision, new_decision_test): New. + (add_to_sequence): Use them. No special handling for args of + non-MATCH codes. + (maybe_both_true): Renamed from not_both_true; return sense changed. + (maybe_both_true_1, maybe_both_true_2): New. Broken out + of maybe_both_true and adjusted for decision_test. + (position_merit): Remove. + (nodes_identical, nodes_identical_1): New, broken out of merge_trees. + (merge_accept_insn): New, broken out of merge_trees. + (merge_trees): Use them. No special case for c_test; no node + splitting; use test type instead of position_merit. + (factor_tests): New. + (simplify_tests): New. + (break_out_subroutines): Don't write code now. + (find_afterward): New. + (write_afterward, write_switch, write_cond): New. + (write_action, is_unconditional): New. + (write_node): New. Use them. + (write_tree_1): Rewrite. Use the new functions above. + (write_tree): Remove afterward processing. + (write_subroutine): Simplify function variant emission. + (write_subroutines): New. + (same_codes, clear_codes): Remove. + (same_modes, clear_modes): Remove. + (write_header): New, broken out of main. + (make_insn_sequence): Use new_decision and new_decision_test. + (process_tree): New, broken out of main. + (main): Adjust for merge_trees interface change. + Don't #define operands in the output file. + (record_insn_name): New, broken out of make_insn_sequence. + (debug_decision_2, debug_decision_1, debug_decision_0): New. + (debug_decision): New. + +1999-10-04 21:58 -0700 Zack Weinberg + + * resource.c (find_free_register): Mark class_str argument const. + * resource.h: Update prototype to match. + + * i386.h (PREDICATE_CODES): Add entry for long_memory_operand. + * i386.md: Give all anonymous insns names. + +Mon Oct 4 21:12:02 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (merge_blocks): Avoid assing BASIC_BLOCK for non-existent + blocks. + +Mon Oct 4 21:01:39 1999 Richard Henderson + + * toplev.c (dbr_sched_time): Unconditional. + (peephole2_time): New. + (compile_file): Add pass numbers to all of the dump file suffixes. + Dump peephole2_time. Don't dump times for non-applicable passes. + (rest_of_compilation): Add pass numbers to dump file suffixes. + Conditionalize calls to the scheduler. + * invoke.texi: Update. + +Mon Oct 4 20:25:13 1999 Anthony Green + + * flow.c (make_edges): Fix insn iteration. + (find_basic_blocks): Assign NULL_RTX, not 0, to rtx. + (find_basic_blocks_1): Fix spelling mistake. + +Mon Oct 4 16:56:11 1999 Richard Henderson + + * tree.c (build1): Set TREE_SIDE_EFFECTS for expressions that + always have side-effects. Use memset not bzero. + (make_node): Likewise. + +Mon Oct 4 16:22:20 1999 Mark Mitchell + + * stmt.c (expand_anon_union_decl): When any of the elements of the + union is addressable, so is the entire union. + +Mon Oct 4 11:38:33 1999 Richard Henderson + + * sbitmap.c (sbitmap_ones): Don't set too many bits. + + * bitmap.h (enum bitmap_bits): Add BITMAP_XOR. + * bitmap.c (bitmap_operation): Return true iff TO changed. + (bitmap_equal_p): New. + (bitmap_bit_p): Tidy arithmetic. + (debug_bitmap_file): Likewise. + +Mon Oct 4 11:28:37 1999 Richard Henderson + + * toplev.c (rest_of_compilation): Turn on cse_not_expected + before cse2 instead of after. + +Mon Oct 4 09:55:17 1999 Stan Cox + + * mips.h (GO_IF_LEGITIMATE_ADDRESS): Let leasi/liadi handle large + register offsets. + +Mon Oct 4 08:54:12 1999 Alexandre Oliva + + * cppinit.c (is_idchar initializer): Loosen tests to accept + gcc 2.>6 and >2. + +Mon Oct 4 02:31:20 1999 Mark Mitchell + + * mips.md: Define conditional move patterns for floating point + operands and DI mode conditions. + +Mon Oct 4 02:12:41 1999 Mark Mitchell + + * tree.c (make_node): Set TREE_SIDE_EFFECTS for expressions that + always have side-effects. + +Sun Oct 3 14:14:16 1999 Jeffrey A Law (law@cygnus.com) + + * mn10200.c (asm_file_start): Fix typo. + + * cppinit.c (is_idchar initializer): Tighten tests for when + to put the table into initialized memory. + + * ggc-none.c (ggc_alloc_rtvec): An rtvec is an array of rtx, + not an array of rtunion. + * gcc-page.c (ggc_alloc_rtvec): Similarly. + * gcc-simple (ggc_free_rtvec): Similarly. + + * genattrtab.c (simplify_cond): Make TESTS an array of rtxs, instead + of rtunions. + + * mbchar.h: Add missing #endif. + + * t-fr30 (LIB2FUNCS_EXTRA): Remove definition. + (FPBIT, DPBIT): Define. + +Sun Oct 3 12:44:05 1999 Kaveh R. Ghazi + + * print-tree.c (print_node, indent_to): Remove redundant prototypes. + + * profile.c (instrument_arcs, output_gcov_string, + tablejump_entry_p): Add static prototypes. + (output_gcov_string): Constify a char*. + + * regmove.c (replacement_quality, fixup_match_2): Add static + prototypes. + + * resource.h (reg_dead_p): Add extern prototype. + + * rtl.c (trim_filename): Add static prototype. + + * scan-decls.c (skip_to_closing_brace): Likewise. + + * stmt.c (expand_decl_cleanup_no_eh): Hide definition. + (expand_end_case): Initialize variable `range'. + (emit_case_nodes): Remove unused prototype `rtx_fn'. + + * varasm.c (asm_emit_uninitialised): Add static prototype. + (asm_emit_uninitialised, assemble_variable): Mark parameter with + ATTRIBUTE_UNUSED. + +Sun Oct 3 12:24:52 1999 Kaveh R. Ghazi + + * cpplib.c (if_directive_nameo): Add static prototype. + + * cse.c (cse_insn): Remove unused variable `p'. + + * except.c (create_rethrow_ref, push_entry, + receive_exception_label, new_eh_region_entry, find_func_region, + clear_function_eh_region, process_nestinfo): Add static prototypes. + (get_reg_for_handler): Hide definition. + (process_nestinfo): Initialize variable `extra_handlers'. + + * expr.h (expand_builtin_longjmp): Add extern prototype. + + * final.c (final_addr_vec_align, align_fuzz): Add static prototypes. + + * function.c (prepare_function_start): Likewise. + (pop_function_context_from): Mark parameter `context' with + ATTRIBUTE_UNUSED. + (push_temp_slots_for_block, flush_addressof): Hide definition. + + * gcov.c (init_arc, reverse_arcs, create_program_flow_graph, + solve_program_flow_graph, calculate_branch_probs, + function_summary, main, fancy_abort): Add prototypes. + + * gen-protos.c (add_hash, parse_fn_proto, main): Likewise. + (add_hash): Constify a char*. + + * ggc-common.c (ggc_mark_rtx_ptr, ggc_mark_tree_ptr, + ggc_mark_tree_varray_ptr, ggc_mark_tree_hash_table_ptr, + ggc_mark_string_ptr, ggc_mark_tree_hash_table_entry): Add prototypes. + + * integrate.c (expand_inline_function_eh_labelmap): Likewise. + + * lists.c (free_list, zap_lists): Likewise. + +Sun Oct 3 12:05:28 1999 Kaveh R. Ghazi + + * alias.c (nonlocal_reference_p): Add static prototype. + + * bitmap.c (bitmap_element_allocate): Prototype args in function + pointer cast. + + * builtins.c (stabilize_va_list): Add static prototype. + (expand_builtin_va_arg): Constify a char*. + + * c-lex.c (getch, put_back, extend_token_buffer_to, + read_line_number, token_getch, token_put_back): Add static + prototypes. + + * c-parse.gperf (hash, is_reserved_word): Likewise. + + * cccp.c (is_dir_separator): Likewise. + +Sat Oct 2 16:07:56 1999 Kaveh R. Ghazi + + * graph.h: New file to prototype functions exported by graph.c. + + * Makefile.in (graph.o, toplev.o): Depend on graph.h. + + * graph.c: Include graph.h. + + * toplev.c: Likewise. Remove redundant prototypes. + +Sat Oct 2 11:28:33 1999 Krister Walfridsson + + * invoke.texi: Removed duplicated description for -Q. + +Sat Oct 2 11:16:00 1999 Jim Kingdon + + * extend.texi: Grammar fix in __extension__ text. + +Sat Oct 2 11:06:31 1999 Richard Henderson + + * md.texi (define_peephole2): New section. + +Sat Oct 2 10:57:56 1999 Jan Hubicka + + * i386.md (mov?i patterns): Fix handling of TARGET_USE_MOV0 + (mov $-1 to or peepholer): Enable for pentium when optimizing for + speed. + +Sat Oct 2 10:55:25 1999 Jan Hubicka + + * builtins.c (expand_builtin_strlen): Fix best mode searching loop. + +Sat Oct 2 10:53:22 1999 Jan Hubicka + + * i386.md (ffs expander): Emit Pentium friendly code for + TARGET_PENTIUM. + +Sat Oct 2 02:48:21 1999 Mark P. Mitchell + + * tree.c (build): Don't look at TREE_SIDE_EFFECTS or TREE_RAISES + for non-trees. + (build1): Likewise. + +Fri Oct 1 18:01:11 1999 Bernd Schmidt + + * i386elf.h (TARGET_DEFAULT): Use symbolic constants. + +Fri Oct 1 12:42:53 1999 Andreas Schwab + + * config/m68k/m68k.c (use_return_insn): Return false if the pic + register is in use. + +Fri Oct 1 10:56:06 1999 Bernd Schmidt + + * md.texi (No Constraints): Delete section. + * Makefile.in (genattrtab.o): Don't depend on "insn-config.h". + * final.c (final_scan_insn): We always have register constraints. + * genattrtab.c: Don't include "insn-config.h". + (write_attr_case): We always have register constraints. + * genconfig.c (register_constraint_flag): Delete. + (walk_insn_part): Don't check whether we have register constraints. + (main): Don't write out "#define REGISTER_CONSTRAINTS". + * genoutput.c (have_constraints): Delete. + (main): Don't set it. + (output_operand_data): We always have constraints. + (scan_operands): Likewise. + (compare_operands): Likewise. + * local-alloc.c (block_alloc): We always have constraints. + (requires_inout): Always compile this function. + * recog.c (extract_insn): We always have constraints. + (constrain_operands, reg_fits_class_p): Always compile these + functions. + * recog.h (struct recog_data): Delete non-REGISTER_CONSTRAINTS + fields. + (struct insn_operand_data): Likewise. + * regclass.c (regclass): We always have constraints. + (record_reg_classes, copy_cost, record_address_regs, + auto_inc_dec_reg_p): Always compile these functions. + * regmove.c (regmove_optimize): We always have constraints. + * reload.c (find_reloads): Likewise. + * reload1.c (reload): Likewise. + (reload_cse_simplify_operands): Likewise. + * i860.c (output_delay_insn): Likewise. + +Thu Sep 30 23:04:41 1999 Mark P. Mitchell + + * iris6.h (BUILD_VA_LIST_TYPE): Define. + +Thu Sep 30 18:44:50 1999 Franz Sirl + + * rs6000.c (rs6000_build_va_list): Create a TYPE_DECL node + for the va_list record. + +Thu Sep 30 18:34:54 1999 Jan Hubicka + + * i386.c (ix86_adjust_cost): Ignore false ebp dependencies in + prologues. + +Thu Sep 30 18:31:36 1999 Jan Hubicka + + * alias.c: Include insn-flags.h. + * Makefile.in (alias.o): Update. + +Thu Sep 30 18:21:30 1999 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Convert LEU and GTU comparisons + to LTU and GEU. Handle more cases using sbb. + +Thu Sep 30 18:18:39 1999 Jan Hubicka + + * i386.md (truncatexfdf splitters): Do not use subreg. + (fop XFmode patterns): Fix mode in operand testing. + +Thu Sep 30 18:04:13 1999 Richard Henderson + + * jump.c (jump_optimize_1): Amend last change to test only the + form of the operand, not the insn. + + * jump.c (jump_optimize_1) [conditional_move]: Use general_operand + not register_operand to determine when B may need preloading. + +Thu Sep 30 17:39:16 1999 Richard Henderson + + * alpha.md (*): Use nonimmediate not general_operand for SET_DEST. + (ffsdi2, extxl, insxh, mskxh): Add missing DImode to SET_SRC. + (call-value patterns): Move to end of file. + (*): Remove mode from label_ref in (pc) context. + (movstrqi): Use memory not general_operand for BLKmode operands. + (prologue_stack_probe_loop, builtin_longjmp): Add missing mode + to register_operand operands. + (peep2 patterns): Convert from commented-out peephole patterns. + +Thu Sep 30 14:39:17 1999 Bernd Schmidt + + * tree.h (enum built_in_function): Rename BUILT_IN_DWARF_REG_SIZE + to BUILT_IN_INIT_DWARF_REG_SIZES. + * builtins.c (expand_builtins, case BUILT_IN_INIT_DWARF_REG_SIZES): + Renamed from BUILT_IN_DWARF_REG_SIZE; call + expand_builtin_init_dwarf_reg_sizes. + * c-decl.c (init_decl_processing): Replace __builtin_dwarf_reg_size + with __builtin_init_dwarf_reg_size_table. + * dwarf2out.c (struct reg_size_range): Delete. + (expand_builtin_init_dwarf_reg_sizes): New function. + (expand_builtin_dwarf_reg_size): Delete. + * except.h (expand_builtin_init_dwarf_reg_sizes): Declare. + (expand_builtin_dwarf_reg_size): Don't declare. + * libgcc2.c (dwarf_reg_size_table_initialized): New. + (dwarf_reg_size_table): New. + (init_reg_size_table): New function. + (copy_reg): Use dwarf_reg_size_table. + (eh_context_initialize): Make sure dwarf_reg_size_table is initialized + before use. + +Thu Sep 30 05:40:34 1999 Richard Earnshaw + + * c-lang.c (finish_file case ndef ASM_OUTPUT_{CON,DE}STRUCTOR): + Correctly build argument list to constructor and destructor functions. + +Thu Sep 30 00:13:27 1999 Dirk Zoller + + * c-tree.h (warn_float_equal): Declare. + * c-decl.c (warn_float_equal): Define. + (c_decode_option): Recognize -W[no-]float-equal. + * c-typeck.c (build_binary_op): Conditionally warn + about equality tests of floating point types. + * toplev.c (documented_lan_options): Add -W[no-]float-equal. + * invoke.texi: Add docs for -Wfloat-equal warning. + +Wed Sep 29 23:43:39 1999 Jeffrey A Law (law@cygnus.com) + + * h8300.h (INIT_TARGET_OPTABS): Use init_one_optab instead of + generating RTL directly. + * mips.h (INIT_TARGET_OPTABS): Likewise. + * mn10200.h (INIT_TARGET_OPTABS): Likewise. + + * expr.h (init_mov_optab): Delete declaration + + * h8300.c (WORD_REG_USED): Update to avoid useless register + saves in interrupt functions and functions which never return. + + * cse.c (struct set): Delete inner_dest_loc field. + (cse_insn): Remove assignments to inner_dest_loc field. + +Wed Sep 29 16:06:20 1999 Richard Henderson + + * ggc-page.c: Don't include etc taken care of + by "system.h". Include afterward. + +Wed Sep 29 16:05:18 1999 Richard Henderson + + * rs6000.c (rs6000_encode_section_info): If ggc_p, use + ggc_alloc_string. + +Tue Sep 28 16:45:40 1999 David Edelsohn + + * xcoffout.c (xcoffout_declare_function): Add documentation. + * rs6000.c (num_insns_constant_wide): Use TARGET_POWERPC64 not + TARGET_64BIT. Compare constant to -1, not bit pattern. + (easy_fp_constant): Use TARGET_POWERPC64 not TARGET_64BIT. + (expand_block_move): Allow 8 DImode loads for PowerPC64. Fix + gen_movsi typos. + +Tue Sep 28 16:43:14 1999 Nick Clifton + + * dwarf2out.c (add_abstract_origin_attribute): Abort if + origin_die is NULL. + (gen_inlined_enumeration_type_die): Do not abort if the type has + not been writeen out. + (gen_inlined_structure_type_die): Do not abort if the type has + not been writeen out. + (gen_inlined_union_type_die): Do not abort if the type has + not been writeen out. + (gen_tagged_type_instantiation_die): Do not abort if the type + has not been written out. + +Tue Sep 28 14:33:47 1999 Bernd Schmidt + + * c-decl.c (init_decl_processing): If MD_INIT_BUILTINS is defined, + call it. + * reg-stack.c (straighten_stack): Copy hard reg set with + COPY_HARD_REG_SET. + +Tue Sep 28 01:11:05 1999 Richard Henderson + + * builtins.c (stabilize_va_list): Stabilize array type va_list + to a pointer type, not the base record type. + (expand_builtin_va_copy): Dereference the pointers explicitly; + use the correct size for the copy. + + * rs6000.c (rs6000_va_start): Dereference valist to get to the record. + (rs6000_va_arg): Likewise. + +Mon Sep 27 23:27:21 1999 Richard Henderson + + * rtl.h (struct rtx_def): Move gc_mark to align mode field. + +Mon Sep 27 23:20:29 1999 Mark Mitchell + + * tree.h (struct tree_decl): Use `bclass', not `class', in name of + field. + (DECL_BUILT_IN_CLASS): Adjust accordingly. + +Mon Sep 27 23:03:16 1999 Richard Henderson + + * ggc-page.c (GGC_MIN_LAST_ALLOCATED): New. + (init_ggc): Use it instead of a constant. + (ggc_collect): Bound allocated_last_gc by it. + +Mon Sep 27 19:06:04 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/fixinc.irix (stdio.h): Hack stdio.h to avoid problems + with va_list. + +Mon Sep 27 19:40:17 CEST 1999 Marc Espie + + * configure.in (mips*el-*-openbsd*): Don't duplicate default settings. + (mips*-*-openbsd*): Let big endian configuration be a fragment. + * configure: Regen. + * config/mips/openbsd.h: New, OpenBSD little endian target. + * config/mips/openbsd-be.h: New, OpenBSD big endian target fragment. + * config/mips/xm-openbsd.h: New, OpenBSD host. + +Mon Sep 27 10:28:48 1999 Andreas Schwab + + * config/m68k/m68k.c (output_function_prologue, + output_function_epilogue): Use + current_function_uses_pic_offset_table instead of regs_ever_live + to decide whether to save/restore pic register. + (legitimize_pic_address): Don't modify regs_ever_live any more. + +Sun Sep 26 10:55:36 1999 Mark Mitchell + + * function.h (struct function): Add x_dont_save_pending_sizes_p. + * stor-layout.c (variable_size): Don't add sizes to the pending + sizes list if x_dont_save_pending_sizes_p is set. + +Sun Sep 26 16:36:52 1999 Robert Lipe (robertlipe@usa.net) + + * config/i386/dgux.h (SELECT_RTX_SECTION): Provide dummy argument + for symbolic_operand(). + * config/i386/sco5.h (SELECT_RTX_SECTION): Likewise. + +Sun Sep 26 07:37:11 1999 Kaveh R. Ghazi + + * combine.c (gen_rtx_combine): Add missing call to va_end(). + + * final.c (asm_fprintf): Likewise. + + * genattrtab.c (attr_rtx): Likewise. + +Sat Sep 25 13:11:07 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c: Update comments. + (cse_insn): When converting a conditional/computed jump into + an unconditional jump, always make sure a BARRIER immediately + follows the converted jump. Do not delete unreachable code. + (cse_basic_block): Do not delete unreachable code. + * toplev.c (rest_of_compilation): Move call to + delete_trivially_dead_insns after the conditional call to + jump_optimize. + +Sat Sep 25 09:03:17 1999 Kaveh R. Ghazi + + * collect2.c (make_temp_file): Don't prototype. + + * gcc.c (make_temp_file): Likewise. + + * mips.c (mips_make_temp_file): Renamed from `make_temp_file'. + +Sat Sep 25 13:42:15 1999 Nick Clifton + + * varasm.c (asm_emit_uninitialised): New function: Generate + the assembler statements necessary to declare an uninitialized + variable. + (ASM_EMIT_LOCAL): New macro: Emit a local, uninitialized + variable. + (ASM_EMIT_BSS): New macro: Emit an entry in the bss section. + (ASM_EMIT_COMMON): New macro: Emit an entry in the common + section. + (assemble_variable): Use asm_emit_uninitialised to emit an + uninitialized variable. + +Fri Sep 24 17:10:56 1999 Nick Clifton + + * combine.c (simplify_comparison): Cope with downshifting a 32 bit + constant on a 64 bit host. Patch supplied by Geoffrey Keating + . + +Fri Sep 24 10:48:10 1999 Bernd Schmidt + + * builtins.c (expand_builtin): Use MD_EXPAND_BUILTIN if defined. + * c-common.h (builtin_function): Don't declare. + + * c-decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than + DECL_BUILT_IN. + (pushdecl): Likewise. + (finish_decl): Likewise. + (builtin_function): New arg CLASS. Arg FUNCTION_CODE now of type + int. All callers changed. + Set the builtin's DECL_BUILT_IN_CLASS. + * tree.h (enum built_in_class): New. + (enum built_in_function): Delete NOT_BUILT_IN. + (DECL_FUNCTION_CODE): The corresponding field in tree_decl is now + in a union. + (DECL_SET_FUNCTION_CODE): Likewise. + (DECL_BUILT_IN_CLASS): New macro. + (DECL_BUILT_IN): Use DECL_BUILT_IN_CLASS. + (struct tree_decl): Split builtin function code field into a + struct. + (builtin_function): Declare. + +Fri Sep 24 01:45:05 1999 Mark Mitchell + + * optabs.c (init_traps): Fix typo in last change. + +Fri Sep 24 01:10:11 1999 Mark Mitchell + + * toplev.c (rest_of_decl_compilation): Update comment. + +Fri Sep 24 11:57:06 1999 Geoffrey Keating + + * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Put the symbol + in .sbss if appropriate. + (EXTRA_SECTION_FUNCTIONS): Add sbss. + (SBSS_SECTION_ASM_OP): New macro. + * config/mips/linux.h (EXTRA_SECTION_FUNCTIONS): Add sbss. + (EXTRA_SECTIONS): Add in_sbss. + * config/mips/mips.h: Prototype sbss_section. + +Thu Sep 23 18:18:55 1999 Mark Mitchell + + * stmt.c (expand_start_bindings): Don't allow cleanup instructions + to disappear. + +Thu Sep 23 18:07:01 1999 Mark Mitchell + + * optabs.c (init_traps): Register trap_rtx as a GC root. + +Thu Sep 23 17:41:47 1999 Alexandre Oliva + + * config/mips/mips.c (function_arg_pass_by_reference): Define + unconditionally, since it's called unconditionally. + +Thu Sep 23 13:40:02 1999 Jason Merrill + + * toplev.c (documented_lang_options): Add -fshort-wchar. + * c-decl.c (c_decode_option): Likewise. + (init_decl_processing): If -fshort-wchar, use 'short unsigned int' + for wchar_t. + * c-common.c, c-lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. + * gcc.c (default_compilers): If -fshort-wchar, + override __WCHAR_TYPE__. + * tm.texi (C Dialect Options): Add -fshort-wchar. + + * dwarf2out.c (output_aranges): Use DW_AT_location to find the + symbol for a variable. + + * cpplib.h (CPP_PREPROCESSED): New macro. + * cpplib.c (handle_directive): Don't complain about `# NUMBER' if + we're seeing this input for a second time. + +Thu Sep 23 12:54:49 1999 Alex Samuel + + * emit-rtl.c (init_emit_once): Initialize modes first. + +Sun Sep 19 01:23:23 1999 Alex Samuel + + * config/i386/i386.c (pic_label_name): Change to char pointer. + (global_offset_table): New variable. + (load_pic_register): Fill global_offset_table if it hasn't + already been done. Allocate pic_label_name dynamically. + * ggc.h (empty_string): New variable. + * ggc-simple.c (empty_string): Likewise. + (init_ggc): Allocate empty_string and add as root. + * stmt.c (digit_strings): New variable. + (init_stmt): Add last_block_end_note as root. Allocate and + initialize digit_strings. + (expand_asm_operands): Use empty_string instead of string + constant. Use digit_strings instead of string constants. + * profile.c (init_arc_profiler): Allocate string with + ggc_alloc_string instead of xmalloc. + (output_func_start_profiler): Likewise. + * c-typeck.c (digest_init): Check if init is error_mark_node. + +Thu Sep 23 12:59:14 1999 Alex Samuel + Richard Henderson + + * ggc-page.c: New file. + * Makefile.in (ggc-page.o): New. + +Thu Sep 23 13:55:21 1999 Jeffrey A Law (law@cygnus.com) + + * invoke.texi: Document -fdelete-null-pointer-checks + * toplev.c (flag_delete_null_pointer_checks): New. + (f_options): Add entry for -fdelete-null-pointer-checks. + (rest_of_compilation): Conditionalize null pointer check + elimination on flag_delete_null_pointer_checks. + (main): If -O2 or greater, enable -fdelete-null-pointer-checks + +1999-09-23 10:56 -0700 Zack Weinberg + + * iso646.h, stdarg.h, stdbool.h, stddef.h, varargs.h: Add + copyright notice and special exception to GPL. + +Thu Sep 23 13:40:23 1999 Kaveh R. Ghazi + + * abi64.h (mips_function_value): Add prototype arguments. + + * mips-protos.h: New file with mips prototypes. + + * mips.c: Include "tm_p.h". + (mktemp, lookup_name): Add prototype arguments. + (extern_list, string_constant, mips_fill_delay_slot, + mips_output_external, mips_output_external_libcall, + mips_output_filename, mips_declare_object, function_prologue, + mips_expand_prologue, function_epilogue, mips16_constant, + build_mips16_function_stub, mips_output_conditional_branch): + Constify a char*. + (mips_va_start): Remove unused variable `u'. + (mips_va_arg): Cast value to unsigned when comparing against one. + (trace): Delete. + (save_restore_insns, mips_expand_prologue): Add missing arg in + call to `large_int'. + + * mips.h: Move prototypes to mips-protos.h. + (data_section, memory_address_p, rdata_section, + readonly_data_section, simple_epilogue_p, text_section): Delete + prototypes delcared elsewhere. + (mips_epilogue_delay_slots, print_options): Delete unused decls. + (trace): Delete. + (GO_PRINTF, GO_PRINTF2): Call fprintf, not trace. + + * mips.md: Delete extra args in call to `mips_move_2words'. + + * xm-iris6.h (alloca): Add prototype argument. + + * genpeep.c: Include "tm_p.h" in generated output file. + +Thu Sep 23 10:36:55 EDT 1999 Andrew MacLeod + + * basic-block.h (find_edge_index): Change parameters. + * flow.c (verify_edge_list): Pass basic_block parameters to + find_edge_index instead of integers. + +Thu Sep 23 15:54:12 1999 Nick Clifton + + * combine.c (simplify_comparison): Use an unsigned shift to adjust + the constant. + +Thu Sep 23 08:46:21 1999 Guy Harris + + * gcc.1: Fix a formatting error. + +Wed Sep 22 16:10:21 1999 Martin v. Löwis + + * install.texi (Configurations): Remove pyramid. Add fr30, i686, + i786, mn10200, mn10300, pdp11, v850. + +Thu Sep 23 07:37:13 1999 Dan Nicolaescu + + * libgcc2.c (num_digits): Add prototype with + __attribute__((const)). + (__terminate): Add prototype. + +Thu Sep 23 05:32:06 1999 Richard Henderson + + * builtins.c, dbxout.c, varasm.c: Include tm_p.h. + + * alpha/alpha.c (print_operand): Fix type of `code'. + (alpha_output_filename): Constify. + * alpha/alpha.h: Move all function declarations ... + * alpha/alpha-protos.h: ... here. New file. + * alpha/elf.h (CONST_SECTION_FUNCTION): Prototype the function. + (SECTION_FUNCTION_TEMPLATE): Likewise. + +Thu Sep 23 11:15:36 1999 Bernd Schmidt + + * expmed.c (do_cmp_and_jump): Pass ccp_jump to can_compare_p. + * expr.c (expand_expr): Likewise. + (do_jump): Likewise. + (do_store_flag): Pass ccp_store_flag to can_compare_p. + * expr.h (enum optab_index): Add cbranch, cmov, cstore optabs and + accessor macros. + (enum can_compare_purpose): New. + (can_compare_p): Adjust prototype. + (prepare_cmp_insn, prepare_operand): Declare. + * genopinit.c (optabs): Add cbranch_optab, cmov_optab, cstore_optab. + * optabs.c (cmp_available_p): Deleted. + (expand_abs): Pass ccp_jump to can_compare_p. + (can_compare_p): New arg PURPOSE. Check for combined optabs. + (prepare_cmp_insn): No longer static. Add arg PURPOSE. + Call can_compare_p rather than cmp_available_p. + (prepare_operand): No longer static. + (emit_cmp_and_jump_insn): Check for and use cbranch patterns. + (emit_cmp_and_jump_insns): Pass ccp_jump to prepare_cmp_insn. + (expand_float): Fix a slightly broken emit_cmp_insn/emit_jump_insn + sequence to use emit_cmp_and_jump_insns. + (init_optabs): Initialize cbranch_optab, cmov_optab, cstore_optab. + +Wed Sep 22 17:58:01 1999 Stan Cox + + * mips.h (GO_IF_LEGITIMATE_ADDRESS): Don't accept large + register offsets; let LEGITIMIZE_ADDRESS load it into a register. + (LEGITIMIZE_ADDRESS): Use plus_constant to avoid + (plus (reg) (const_int 0)) + * mips.md (call_internal3c): New pattern for -mips16 -mlong-calls. + +Wed Sep 22 17:55:31 1999 David Edelsohn + + * rs6000.c (expand_block_move): DImode loads and stores require + word-aligned displacements. Increment address registers with + adddi3 on 64-bit platform. Use TARGET_POWERPC64 not TARGET_64BIT. + +Wed Sep 22 17:35:55 1999 Michael Meissner + + * dwarf2out.c (base_type_die): Use the name __unknown__ if there + is no name for the base type, rather than segfault. If we are + writing out a complex integer type, use DW_ATE_lo_user. + + * expr.c (emit_move_insn_1): If we are copying a complex that fits + in one word or less (complex char, complex short, or on 64 bit + systems complex float) to/from a hard register, copy it through + memory instead of dying in gen_{real,imag}part. If we have a + short complex type, prevent inlining since it allocates stack + memory. + + * tree.c (build_complex_type): If we are writing dwarf2 output, + generate a name for complex integer types. + +Wed Sep 22 11:34:08 EDT 1999 Andrew MacLeod + + * basic-block.h (add_noreturn_fake_exit_edges): Use correct name. + * flow.c (remove_edge): Remove extra whitespace. + (remove_fake_edges): Fix comment. + (add_noreturn_fake_exit_edges): Use the correct name. + +Wed Sep 22 16:12:40 BST 1999 Nathan Sidwell + + * Makefile.in (INTL_MOSTLYCLEAN, INTL_CLEAN): New variables. + (mostlyclean): Depend on INTL_MOSTLYCLEAN. + (clean): Depend on INTL_CLEAN. + (maintainer-clean): Adjust. + +Wed Sep 22 10:18:56 1999 Kaveh R. Ghazi + + * configure.in (AC_PREREQ): Bump to 2.13. + (AC_C_STRINGIZE): Call this instead of using a custom macro. + + * gansidecl.h (HAVE_STRINGIZE): Define, if stage2 gcc && __STDC__. + + * system.h (HAVE_STRINGIZE): Test this instead of HAVE_CPP_STRINGIFY. + + * acconfig.h (HAVE_CPP_STRINGIFY): Delete. + + * alpha/xm-vms.h (HAVE_CPP_STRINGIFY): Delete. + (HAVE_STRINGIZE): Define. + +Wed Sep 22 06:25:15 1999 Jim Kingdon + + * c-parse.in: save and restore warn_pointer_arith on __extension__ + along with pedantic. + (SAVE_WARN_FLAGS, RESTORE_WARN_FLAGS): Added. + Set the type of extension to itype rather than $1 kludge. + * extend.texi (Alternate Keywords): Adjust documentation. + * c-parse.c, c-parse.y, objc-parse.c, objc-parse.y: Rebuilt. + +Wed Sep 22 06:06:57 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c, pa.h, pa.md: Support multiple assembler dialects in + most assembler templates. + + * pa.c (hppa_legitimize_address): Handle full offsets for PA2.0 + FP loads and stores. + (following_call): Always return zero for the PA8000. + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Handle full offsets for PA2.0 + FP loads and stores. + (LEGITIMIZE_RELOAD_ADDRESS): Similarly. + + * pa.h (BRANCH_COST): Define. + + * pa.md (return, return_internal): Use bve for PA2.0. + + * pa.md (fused multiply): Add variants which reduce height for the + fused multiply, but which still generate 2 insns. + (fnegabs): Similarly. + + * pa.md (subsi3): Turn into an expander. Create two anonymous + patterns. One for PA2.0 one for PA1.x. Use mtsarcm for PA2.0. + * pa.h (EXTRA_CONSTRAINT): Handle 'S'. + + * pa.md (floatunssisf2, floatunssidf2): Generate different RTL + for TARGET_PA_20. + (floatunssidf2_pa20, floatunssisf2_pa20): New patterns for PA2.0 + code generation. + (floatunsdisf2, floatunsdidf2, fixuns_truncsfsi2): Likewise. + (fixuns_truncdfsi2, fixuns_truncsfdi2, fixuns_truncdfsi2): Likewise. + + * regclass.c (init_regs): Add "top_of_stack" as a garbage + collection root. + + * flow.c (record_active_eh_regions): Terminate loop after finding + the last insn in the last basic block. + +Wed Sep 22 20:25:00 1999 Michael Hayes + + * config/c4x/c4x.md: Delete parallel instruction peepholes. + +Wed Sep 22 19:59:19 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_add_gc_roots): Add tree roots. + +Wed Sep 22 19:56:25 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_process_after_reload): Rework machdep insn + splitting to not use output template. + +Wed Sep 22 19:50:12 1999 Michael Hayes + + * config/c4x/c4x.h (EXPAND_BUILTIN_VA_START): Call c4x_va_start. + * config/c4x/c4x.c (c4x_va_start): New function. + +Tue Sep 21 18:40:01 1999 Jan Hubicka + + * genrecog.c (not_both_true): Handle correctly cases when called for + tests with different positions in the insn. + +Tue Sep 21 18:29:11 1999 Kaveh R. Ghazi + + * machmode.h (HOST_PTR_PRINTF): Move from here ... + + * system.h (HOST_PTR_PRINTF): ... to here. + + * mips-tfile.c: Don't include machmode.h. + + * Makefile.in (MACHMODE_H): New variable. Update to use it. + (mips-tfile.o): Don't depend on machmode.h. + +Tue Sep 21 18:27:34 1999 Kaveh R. Ghazi + + * haifa-sched.c (sched_analyze): Rename local variable `region' to + avoid conflicts with typedef struct `region' at the top level scope. + +Tue Sep 21 14:14:50 1999 Richard Henderson + + * basic-block.h (basic_block): Add eh_beg, eh_end. + * flow.c (entry_exit_blocks): Update. + (find_basic_blocks): Don't allocate bb_eh_end, or pass it around. + Call new functions. + (find_basic_blocks_1): Don't record eh_list at each bb. Use + lists.c functions to allocate insn lists. + (make_edges): Use eh_beg+eh_end, not the lists. Split out EH + edge creation ... + (make_eh_edge): ... here. New. + (move_stray_eh_region_notes): New. + (record_active_eh_regions): New. + (delete_unreachable_blocks): Split out block merging ... + (try_merge_blocks): ... here. New. + (merge_blocks_move_predecessor_nojumps): Remove edge arg. + Dump debugging data. + (merge_blocks_move_successor_nojumps): Likewise. + (merge_blocks): Use eh_beg+eh_end to validate block movement. + +Tue Sep 21 11:15:03 1999 Martin v. Löwis + + * extend.texi (Bound member functions): Document unbound pmf + conversion. + +Tue Sep 21 14:55:11 EDT 1999 Andrew MacLeod + + * flow.c (split_edge): Handle insertion on a fallthrough edge which + has the EXIT_BLOCK as a dest. + +Tue Sep 21 14:51:23 EDT 1999 Andrew MacLeod + + * flow.c (remove_edge): New function to remove an edge from the + flow graph. + (remove_fake_successors): New function to remove fake successor edges. + (remove_fake_edges): New function to remove all fake edges from the + flow graph. + (add_fake_exit_edges): New function to add fake edges from all blocks + with no successors to the exit block. + * basic-block.h (remove_fake_edges, add_fake_exit_edges): Add + prototypes for new functions. + +Tue Sep 21 14:49:53 EDT 1999 Andrew MacLeod + + * config/mips/elf64.h (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): + Use Pmode to determine whether to output .dword or .word. + +Tue Sep 21 11:04:34 1999 Alex Samuel + + * tree.c (built_in_filename): New variable. + (BUILT_IN_FILENAME): New macro. + (init_tree_codes): Allocate built_in_filename. + (make_node): Use built_in_filename instead of string constant. + +Tue Sep 21 14:13:27 1999 Nick Clifton + + * configure.in: Add fr30 target. + * configure: Regenerate. + * config/fr30: New directory. + * config/fr30/crti.asm: New file. + * config/fr30/fr30.c: New file. + * config/fr30/crtn.asm: New file. + * config/fr30/fr30.h: New file. + * config/fr30/fr30.md: New file. + * config/fr30/lib1funcs.asm: New file. + * config/fr30/t-fr30: New file. + * config/fr30/xm-fr30.h: New file. + +Tue Sep 21 06:45:31 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (merge_blocks_move_successor_nojumps): Delete the + BARRIER at the end of the successor, not the BARRIER before + the successor. + + * pa.c (pa_add_gc_roots): Fix thinko in last change. + +Tue Sep 21 05:29:17 1999 Richard Earnshaw (rearnsha@arm.com) + + * stmt.c (any_pending_cleanups): Don't crash when + current_function->stmt is unset. + +Tue Sep 21 00:59:49 1999 Alexandre Oliva + + * emit-rtl.c (init_emit_once): Initialize const_int_rtx before + other initializations that may use it for relative offsets. + +Mon Sep 20 21:43:25 1999 Alexandre Oliva + + * config/i386/sol2.h (PREFERRED_DEBUGGING_TYPE): Use stabs. + (ASM_SPEC): Moved from sol2dbg.h. Added work-around for gas. + * config/i386/sol2dbg.h: Removed. + * config/i386/sol2gas.h: New file, to enable gas work-around. + * configure.in: Use i386/sol2gas.h on Solaris/x86 --with-gas. + Don't use sol2dbg.h. + * configure: Rebuilt. + +Mon Sep 20 13:29:41 1999 Mark Mitchell + + * invoke.texi (-fthis-is-variable): Remove documentation. + +Mon Sep 20 12:59:16 1999 Richard Henderson + + * basic-block.h (compute_bb_for_insn): Declare. + * flow.c (compute_bb_for_insn): Export. Don't accept the varray + to use; set size of basic_block_for_insn directly. + (find_basic_blocks): Update. + +Mon Sep 20 15:11:54 1999 Kaveh R. Ghazi + + * flow.c (verify_flow_info): Fix typo, "abort;" -> "abort ();". + +Mon Sep 20 14:56:34 1999 Kaveh R. Ghazi + + * crtstuff.c (ON_EXIT): Delete empty macro definition. + (__do_global_ctors_aux): Call atexit(), not ON_EXIT(). + +Mon Sep 20 15:25:35 1999 Nick Clifton + + * c-decl.c (c_decode_option): Extend comment. + +Mon Sep 20 14:43:37 1999 Nick Clifton + + * toplev.c (progname): Make 'const char *' + (flag_print_mem): Move out of main. + (version_flag): Move out of main. + (filename): Move out of main. + (debug_args): Remove g prefix from options. + (documented_lang_options): Remove cpplib specific options. + (display_help): Add g prefix to debug options. + (check_lang_option): Delete this function. + (decode_d_option): New function: Decode -d... option. + (decode_f_option): New function: Decode -f... option. + (decode_W_option): New function: Decode -W... option. + (decode_g_option): New function: Decode -g... option. + (independent_decode_option): New function: Decode a language + independent command line option. + (main): Invoke lang_decode_option and then + independent_decode_option on each command line option in + turn. + +Mon Sep 20 05:41:36 1999 Jeffrey A Law (law@cygnus.com) + + Revert this change. Gavin's patch to operand_equal_p is a better fix. + * fold-const.c (fold_range_test): Do not try to fold the range + test if the rhs or lhs has side effects. + + * basic-block.h (compute_flow_dominators): Declare. + + * gcse.c (alloc_code_hoist_mem): New function. + (free_code_hoist_mem, compute_code_hoist_vbeinout): Likewise. + (compute_code_hoist_data, hoist_expr_reaches_here_p): Likewise. + (hoist_code, one_code_hoisting_pass): Likewise. + (gcse_main): If optimizing for size, then hoist expressions + computed in multiple dominated basic blocks. + + * gcse.c (invalid_nonnull_info): New function. + (delete_null_pointer_checks): Likewise. + * rtl.h (delete_null_pointer_checks): Declare. + * toplev.c (rest_of_compilation): Call delete_null_pointer_checks. + + * flow.c (merge_blocks_move_predecessor_nojumps): New function. + (merge-blocks_move_successor_nojumps): Likewise. + (merge_blocks): Allow merging of some blocks, even if it requires + physical movement of the blocks, but not if it requires new jumps. + + * bitmap.c (debug_bitmap_file): Renmaed from bitmap_debug_file. + Callers and prototype changed. + * bitmap.h: Fix debug_bitmap and debug_bitmap_file prototypes. + +Mon Sep 20 06:56:32 1999 Alexandre Oliva + + * config/sparc/sol2.h (LINK_SPEC): Avoid the duplication of + -YP when both -p and -pg are present. From i386/sol2.h. + +Mon Sep 20 10:49:05 1999 Bernd Schmidt + + * Makefile.in (distclean): Delete tm_p.h. + * configure.in: Create a new file, "tm_p.h", from a list in + "tm_p_file". For ix86 systems, set up "tm_p_file" to include + "i386/i386-protos.h". + + * alias.c: Include "tm_p.h". + * c-typeck.c: Likewise. + * calls.c: Likewise. + * cse.c: Likewise. + * emit-rtl.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * final.c: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * gcse.c: Likewise. + * global.c: Likewise. + * haifa-sched.c: Likewise. + * integrate.c: Likewise. + * jump.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * optabs.c: Likewise. + * recog.c: Likewise. + * reg-stack.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reload.c: Likewise. + * reload1.c: Likewise. + * reorg.c: Likewise. + * resource.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * toplev.c: Likewise. + * tree.c: Likewise. + * unroll.c: Likewise. + * genattrtab.c (main): Make generated file include "tm_p.h". + * genemit.c (main): Likewise. + * genoutput.c (main): Likewise. + * genrecog.c (main): Likewise. + + * i386.h: Delete all prototypes. + * i386.c: Include "tm_p.h". + (ix86_attr_length_default): Call constant_call_address_operand + with correct number of arguments. + * i386-protos.h: New file. + * i386.md (unnamed patterns): Call constant_call_address_operand + with correct number of arguments. + (exception_receiver): Call load_pic_register with correct number + of arguments. + +Sun Sep 19 14:18:39 1999 Richard Henderson + + * c-pragma.c (mark_align_stack): Dereference the void* properly. + +Sun Sep 19 09:03:40 1999 Mark Mitchell + + * rtl.h (insns_safe_to_move_p): New function. + * loop.c (find_and_verify_loops): Use it. + * rtlanal.c (insns_safe_to_move_p): Define it. + +Sun Sep 19 02:54:33 1999 Richard Henderson + + * c-pragma.c: Include ggc.h. + * Makefile.in (c-pragma.o): Update. + +Sat Sep 18 16:01:18 1999 Alexandre Oliva + + * config/i386/sol2.h (CPP_SPEC): Support -[p]threads + (LIB_SPEC): Likewise. + (LINK_SPEC): Do not assert -z text with -shared -mimpure-text. + Reindent -YP/-p/-pg. + Copied from config/sparc/sol2.h. + +Sat Sep 18 11:52:43 1999 Richard Henderson + + * c-pragma.c (mark_align_stack): New. + (init_pragma): New. + * c-pragma.h (init_pragma): Declare it. + * c-lex.c (init_parse): Call it. + +Sat Sep 18 15:20:38 1999 Alexandre Oliva + + * configure.in: Pick up thread library on Solaris/x86 just + like on Solaris/sparc. + * configure: Rebuilt. + +Sat Sep 18 11:15:58 1999 Alex Samuel + + * rtl.h (global_rtx_index): New enum. + (global_rtl): Change to array of rtx. + (pc_rtx, cc0_rtx): Redefine accordingly. + (cc0_rtx, stack_pointer_rtx, frame_pointer_rtx): Likewise. + (hard_frame_pointer_rtx, arg_pointer_rtx): Likewise. + (virtual_incoming_args_rtx, virtual_stack_vars_rtx): Likewise. + (virtual_outgoing_args_rtx, virtual_cfa): Likewise. + (const_int_rtx): Change to array of rtx. + (const0_rtx, const1_rtx, const2_rtx, constm1_rtx): Redefine + accordingly. + * emit-rtl.c (global_rtl): Change to array of rtx. + (const_int_rtx): Change to aray of rtx. + (gen_rtx_CONST_INT): Redefine accordingly. + (init_emit_once): Allocate and initialize global_rtl. Likewise + for const_int_rtx. Add both as GC roots. + * genattrtab.c (global_rtl): Update declaration. + +1999-09-17 Ulrich Drepper + + * Makefile (USER_H): Add iso646.h back. + +Sat Sep 18 01:07:21 1999 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (sched_analyze): Use free_INSN_LIST_list instead of + zapping the LOG_LINKS of sched_before_next_call. + + * pa.h (INSN_SETS_ARE_DELAYED): Delete. + * pa.c (insn_refs_are_delayed): Renamed from + insn_sets_and_refs_are_delayed. + +Fri Sep 17 15:19:01 1999 Mark Mitchell + + * functiion.h (struct function): Add x_whole_function_mode_p. + (retrofit_block): Declare. + * function.c (retrofit_block): New function. + (identify_blocks): Add assertions. Allow an incomplete set of + block notes if we're still generating code for the function. + * integrate.c: Include loop.h. + (expand_inline_function): Call find_loop_tree_blocks to map block + notes to blocks when in whole-function mode. Use retrofit_block + to insert new BLOCKs for the inlined function, rather than + insert_block. + * stmt.c (expand_fixup): Likewise. Don't use pushlevel/polevel. + * Makefile.in (integrate.o): Depend on loop.h. + +Fri Sep 17 15:11:20 1999 Mark Mitchell + + * tree.h (warn_about_unused_variables): Declare. + * stmt.c (warn_about_unused_variables): New function, split out + from ... + (expand_end_bindings): Here. + +Fri Sep 17 15:07:37 1999 Mark Mitchell + + * stmt.c (preserve_subexpressions_p): Don't crash when + current_function->stmt is unset. + +Fri Sep 17 15:03:16 1999 Mark Mitchell + + * stmt.c (expand_start_bindings): Allow callers to pass a flag + indicating that no NOTE_INSN_BLOCK_BEG note is required. + (expand_start_target_temps): Use it. + * except.c (expand_eh_region_start_for_decl): Likewise. + * expr.c (expand_expr): Likewise. + +Fri Sep 17 15:05:27 1999 Gavin Romig-Koch + + * fold-const.c (operand_equal_p): Pay attention to side effects. + +Fri Sep 17 11:14:17 1999 Jason Merrill + + * libgcc2.c (L_exit): Check for ON_EXIT, not HAVE_ON_EXIT. + * sparc/sunos4.h (HAVE_ON_EXIT): Remove. + + * tlink.c (scan_linker_output): Look for keywords before accepting + a mangled name in quotes. + +Thu Sep 16 16:47:08 1999 Richard Henderson + + * alpha/alpha-interix.h (DWARF2_UNWIND_INFO): Define to zero. + * alpha/osf2or3.h (DWARF2_UNWIND_INFO): Likewise. + +Thu Sep 16 16:35:41 1999 Richard Henderson + + * alpha.md: Revert Thu Nov 26 change that came in through the + last gcc2 merge: reinstate (plus (plus ...)) reload patterns. + Avoid earlyclobber when possible. + +Thu Sep 16 18:44:48 1999 Kaveh R. Ghazi + + * libgcc2.c (__do_global_ctors): Call atexit with one arg. + + * sparc/sunos4.h (on_exit): Wrap prototype parameters in PARAMS(). + Define HAVE_ON_EXIT. + +Thu Sep 16 18:06:35 1999 Kaveh R. Ghazi + + * system.h (CTYPE_CONV, TOUPPER, TOLOWER): New macros. Use + CTYPE_CONV in all ctype macros. + + * cccp.c (initialize_char_syntax): Use uppercase ctype macro + from system.h. + + * cexp.y (initialize_random_junk): Likewise. + + * c4x.c (c4x_interrupt_function_p, c4x_handle_pragma): Likewise. + + * i370.c (handle_pragma): Likewise. + + * i370.h (ASM_OUTPUT_LABELREF, ASM_OUTPUT_ASCII): Likewise. + + * v850.c (override_options): Likewise. + + * doprint.c (_doprnt): Likewise. + + * fixinc/fixincl.c (main, quoted_file_exists, extract_quoted_files): + Likewise. + + * fixinc/server.c (load_data): Likewise. + + * fold-const.c (real_hex_to_f): Likewise. + + * genattr.c (write_upcase, gen_attr): Likewise. + + * genattrtab.c (convert_const_symbol_ref, evaluate_eq_attr, + write_upcase): Likewise. + + * genemit.c (print_code): Likewise. + + * genopinit.c (gen_insn): Likewise. + + * genpeep.c (print_code): Likewise. + + * genrecog.c (print_code): Likewise. + + * optabs.c (init_libfuncs): Likewise. + +Thu Sep 16 14:03:32 1999 Mark Mitchell + + * haifa-sched.c (sched_analyze): Keep the list of notes organized + in pairs. + (reemit_notes): Likewise. + +Thu Sep 16 11:50:52 1999 Alex Samuel + + * ggc.h (ggc_root): Move to ggc-common.c. + (roots): Remove. + (ggc_mark_rtx, ggc_mark_tree): Change to macro. + (ggc_mark_rtvec, ggc_mark_tree_varray): Declare extern. + (ggc_mark_tree_hash_table, ggc_mark_string, ggc_mark): Likewise. + (ggc_mark_roots, ggc_mark_rtx_children, ggc_mark_tree_children): New. + * ggc-common.c (ggc_root): Move from ggc.h. + (roots): Declare, static. + (ggc_mark_rtx, ggc_mark_tree): Renamed to... + (ggc_mark_rtx_children, ggc_mark_tree_children): Don't check for + null or check/set mark bit. + (ggc_mark_roots): New. + * ggc-simple.c (ggc_collect): Call ggc_mark_roots. + +Thu Sep 16 11:37:32 1999 Richard Henderson + + * m32r.c: Include toplev.h. + (*): Add ATTRIBUTE_UNUSED as needed to arguments. + (gen_compare): Rename swap_p to must_swap to match uses. + Add default abort case. + (m32r_output_function_epilogue): Remove unused variables. + (m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX. + * m32r.h (PROTO, STDIO_PROTO): Rename XPROTO; unconditionally + define to empty parameter list. Update all uses. + (predicate decls): Use enum machine_mode not int. + * m32r.md (movsi): Call abort, not fatal_insn. + (zero_branch_insn, rev_zero_branch_insn): Add default abort case. + +1999-09-14 Andrew Haley + + * config/mips/mips.md (movsi_usw): if operand 1 is const_int 0, + use $0 instead of 0. + +Thu Sep 16 10:53:36 1999 Bernd Schmidt + + * reload1.c (order_regs_for_reload): Move hard_reg_n_uses + computation out of loop over hard regs. + +Wed Sep 15 21:37:06 1999 Mark Mitchell + + * function.c (identify_blocks): Don't shadow a variable in an + outer scope. + * integrate.c (integrate_decl_tree): Don't use pushlevel, + pushdecl, or poplevel to build up the new BLOCK tree. + (expand_inline_function): Likewise. + (integrate_parm_decls): Likewise. + +Wed Sep 15 21:20:38 1999 Mark Mitchell + + * c-typeck.c (qualify_type): Merge qualifiers from both types. + +1999-09-15 Brad Lucier + + * toplev.c: Allow -f[no-]math-errno to set (clear) flag_errno_math + * invoke.texi: Document this change. + +Wed Sep 15 17:56:00 1999 Richard Henderson + + * emit-rtl.c (free_emit_status): Don't check DECL_DEFER_OUTPUT. + Free the struct. + (mark_emit_status): Renamed from mark_emit_state. + * except.c (mark_eh_status): Renamed from mark_eh_state. + Check not null before marking. + (free_eh_status): New. + * expr.c (mark_expr_status, free_expr_status): New. + * function.c (free_machine_status): New. + (free_after_parsing): New. + (free_after_compilation): Move bits to free_after_parsing; call + free_eh_status, free_expr_status; zero the marked members of the + function state. + (prepare_function_start): No can_garbage_collect. + Call init_eh_for_function. + (expand_dummy_function_end): Free up current_function state. + (mark_function_status): Renamed from mark_function_state. + (mark_function_chain): No can_garbage_collect. Call mark_expr_status. + * function.h (struct function): No can_garbage_collect. + (free_machine_status, free_after_parsing): Declare. + (free_eh_status, free_expr_status): Declare. + * ggc.h (mark_expr_status): Declare. + * stmt.c (free_stmt_status): Free the struct. + (mark_stmt_status): Renamed from mark_stmt_state. + (init_stmt): Don't call init_eh. + (init_stmt_for_function): Don't call init_eh_for_function. + * toplev.c (compile_file): Call init_eh. + (rest_of_compilation): Free basic block info before ggc_collect. + Call free_after_parsing; conditionally call free_after_compilation. + * varasm.c (mark_varasm_status): Renamed from mark_varasm_state. + Check not null before marking. + (free_varasm_status): Don't check DECL_DEFER_OUTPUT. Free the struct. + +Wed Sep 15 17:53:16 1999 Richard Henderson + + * c-lex.c (yylex): Initialize warn. + +Wed Sep 15 18:35:38 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (emit_move_sequence): Properly set the mode of the scratch + register when performing secondary reloads for the SAR register. + +Wed Sep 15 15:51:52 1999 Mark Mitchell + + * rtl.h (NOTE_BLOCK_NUMBER): Replace with ... + (NOTE_BLOCK): New macro. + (NOTE_BLOCK_LIVE_RANGE_BLOCK): Remove. + * function.h (identify_blocks): Change prototype. + * function.c (identify_blocks): Simplify. + (reorder_blocks): Likewise. + * ggc-common.c (ggc_mark_rtx): Mark the BLOCK associated with a + NOTE_INSN_BLOCK_{BEG,END}. + * haifa-sched.c (sched_analyze): Don't put NOTE_BLOCK_NUMBER on + the list of saved notes if the note isn't a + NOTE_INSN_BLOCK_{BEG,END}. + (move_insn1): Use NOTE_EH_HANDLER in comment, rather than + NOTE_BLOCK_NUMBER. + (reemit_notes): Adjust recreation of notes to reflect new saved + note structure. + * print-rtl.c (print_rtx): Print the address of the BLOCK when + printing a block note. + * stmt.c (block_vector): Remove. + (find_loop_tree_blocks): Simplify. + (unroll_block_trees): Likewise. + * tree.h (reorder_block): Change prototype. + +Wed Sep 15 14:39:35 1999 Jason Merrill + + * gbl-ctors.h: Lose HAVE_ATEXIT. Don't define ON_EXIT. + * libgcc2.c: Lose obsolete defn of WEAK_ALIAS. + (__bb_init_func, __bb_init_prg): Use atexit instead of ON_EXIT. + (__do_global_dtors): Likewise. Don't mess with _exit_dummy_decl. + (atexit, exit): Simplify. + * tm.texi: Document NEED_ATEXIT and ON_EXIT. Remove HAVE_ATEXIT. + * config/lots: Remove defns of HAVE_ATEXIT. + +Wed Sep 15 10:25:12 1999 Mark Mitchell + + * calls.c (precompute_arguments): Fix typo in comment. + * expr.c (preexpand_calls): Don't preexpand the cleanup in a + TARGET_EXPR. + +Wed Sep 15 09:59:59 1999 Mark Mitchell + + * dsp16xx.c (override_options): Fix typos in GC root registration. + +Wed Sep 15 15:23:28 1999 Philip Blundell + + * config/arm/linux-elf.h (MAKE_DECL_ONE_ONLY): Copy definition + from config/svr4.h. + (UNIQUE_SECTION_P, UNIQUE_SECTION): Likewise. + (FUNCTION_PROFILER): Redefine appropriately for Linux. + (CC1_SPEC): Likewise. + +Wed Sep 15 10:09:48 1999 Kaveh R. Ghazi + + * genattr.c (main): Add extern prototype. Call return, not exit. + * genattrtab.c (main): Likewise. + * gencheck.c (main): Likewise. + * gencodes.c (main): Likewise. + * genconfig.c (main): Likewise. + * genemit.c (main): Likewise. + * genextract.c (main): Likewise. + * genflags.c (main): Likewise. + * gengenrtl.c (main): Likewise. + * genopinit.c (main): Likewise. + * genoutput.c (main): Likewise. + * genpeep.c (main): Likewise. + * genrecog.c (main): Likewise. + + * genattr.c (get_insn_name): Mark parameter with ATTRIBUTE_UNUSED. + * genattrtab.c (get_insn_name): Likewise. + * gencodes.c (get_insn_name): Likewise. + * genconfig.c (get_insn_name): Likewise. + * genemit.c (get_insn_name): Likewise. + * genextract.c (get_insn_name): Likewise. + * genflags.c (get_insn_name): Likewise. + * genopinit.c (get_insn_name): Likewise. + * genpeep.c (get_insn_name): Likewise. + + * gencheck.c (usage): Add static prototype. + * genextract.c (print_path): Constify a char*. + * genopinit.c (optabs): Likewise. + * genoutput.c (operand_data, data, output_predicate_decls, + compare_operands): Likewise. + * genrecog.c (write_tree): Add default case in switch. + +Wed Sep 15 09:59:16 1999 Kaveh R. Ghazi + + * rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes. + + * print-rtl.c (get_insn_name): Remove prototype. + + * toplev.h (progname): Declare const. + + * toplev.c (init_decl_processing, init_obstacks, init_tree_codes, + init_regs, init_optabs, init_stmt, init_reg_sets, dump_flow_info, + dump_sched_info, dump_local_alloc, regset_release_memory, + print_rtl, print_rtl_with_bb, rest_of_decl_compilation, + error_with_file_and_line, error_with_decl, error_for_asm, error, + fatal, warning_with_file_and_line, warning_with_decl, warning, + pedwarn, pedwarn_with_decl, pedwarn_with_file_and_line, sorry): + Remove redundant prototypes. + + (notice, check_lang_option, report_file_and_line, vnotice, + mark_file_stack): Add static prototype. + (set_fatal_function): Add prototype. + (vnotice, report_file_and_line, set_fatal_function, + check_lang_option): Constify a char*. + (main): Prototype. Call return, not exit. + +Wed Sep 15 09:50:18 1999 Kaveh R. Ghazi + + * aclocal.m4 (AC_GCC_C_LONG_DOUBLE): New macro. + + * configure.in (AC_GCC_C_LONG_DOUBLE): Call it. + + * gansidecl.h (HAVE_LONG_DOUBLE): Define if gcc for stage2. + + * ggc-simple.c (HAVE_LONG_DOUBLE): Test before using long double. + +Wed Sep 15 11:04:43 1999 Bernd Schmidt + + * function.c (assign_parms): Delete arg SECOND_TIME. Don't test it, + behave as if it's zero in all cases. + (expand_function_start): Adjust call to assign_parms. + * tree.h (assign_parms): Adjust prototype. + * objc/objc-act.c (hack_method_prototype): Adjust call to + assign_parms. + +Tue Sep 14 21:47:06 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (FIXED_BASE_PLUS_P): Do not consider referneces to + arg_pointer_rtx fixed if the argument pointer register is + not fixed. + (NONZERO_BASE_PLUS_P): Likewise. + +Tue Sep 14 20:26:02 1999 Richard Henderson + + * rtl.def (match_insn, match_insn2): Remove match_insn; rename + match_insn2 to match_insn. + * genrecog.c (add_to_sequence): Rename MATCH_INSN2. + +Tue Sep 14 20:10:29 1999 Richard Henderson + + * Makefile.in (USER_H): Remove va-foo.h. + + * ginclude/{va-alpha.h,va-arc.h,va-c4x.h,va-clipper.h,va-h8300.h, + va-i860.h,va-i960.h,va-m32r.h,va-m88k.h,va-mips.h,va-mn10200.h, + va-mn10300.h,va-pa.h,va-ppc.h,va-pyr.h,va-sh.h,va-sparc.h, + va-spur.h,va-v850.h}: Remove. + +Tue Sep 14 19:43:16 1999 Richard Henderson + + * sparc/sparc.md (eligible_for_return_delay): New attribute. + (in_return_delay): Use it instead of match_insn. + +Tue Sep 14 23:05:37 1999 Alexandre Oliva + + * config/alpha/va_list.h (va-alpha.h): Do not include. + (__gnuc_va_list): Typedef as in varargs.h. + +Tue Sep 14 18:14:03 1999 Richard Henderson + + * ggc-common.c (ggc_mark_tree): Mark DECL_SOURCE_FILE and + DECL_LIVE_RANGE_RTL. + +Tue Sep 14 16:47:08 1999 Mark Mitchell + + * except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER, + not NOTE_BLOCK_NUMBER. + (expand_eh_region_end): Likewise. + (find_exception_handler_labels): Likewise. + (scan_region): Likewise. + (exception_optimize): Likewise. + (update_rethrow_references): Likewise. + (set_insn_eh_region): Likewise. + * final.c (final_scan_insn): Likewise. + * flow.c (make_edges): Likewise. + * integrate.c (expand_inline_function): Likewise. + * print-rtl.c (print_rtx): Likewise. + +Tue Sep 14 16:30:16 1999 Richard Henderson + + * ginclude/stdarg.h, ginclude/varargs.h: Implement in + terms of builtin functions and types. + + * mips.c (mips_build_va_list): New. + (mips_va_start, mips_va_arg): New. + * mips.h (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START, EXPAND_BUILTIN_VA_ARG): New. + + * sh.c (sh_builtin_saveregs): Use get_varargs_alias_set. + (sh_build_va_list, sh_va_start, sh_va_arg): New. + * sh.h (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START, EXPAND_BUILTIN_VA_ARG): New. + +Tue Sep 14 16:20:24 1999 Richard Henderson + + * recog.h (struct recog_data): Make dup_num, operand_address_p, + n_operands, n_dups, n_alternatives `char' instead of `unsigned char'. + (struct insn_data): Likewise with n_operands, n_dups, + n_alternatives, output_format. + * regclass.c (scan_one_insn): Cast n_operands to int before + arithmetic inside comparison. + +Tue Sep 14 15:13:36 1999 Richard Henderson + + * toplev.c (compile_function): Unconditionally emit nop. + +Tue Sep 14 14:41:47 1999 Kaveh R. Ghazi + + * haifa-sched.c (actual_hazard): Move declaration of variable + `this_cost' into the scope where it is used. + +Tue Sep 14 14:14:28 1999 Kaveh R. Ghazi + + * c-pragma.c (handle_pragma_token): Wrap variables `name' and + `value' in HANDLE_PRAGMA_WEAK. Wrap variable `align' in + HANDLE_PRAGMA_PACK||HANDLE_PRAGMA_PACK_PUSH_POP. + + * genrecog.c (make_insn_sequence): Call memset, not bzero. + + * jump.c (find_insert_position): Don't declare or define unless + !HAVE_conditional_arithmetic. + (returnjump_p_1, delete_prior_computation): Add static prototypes. + + * mips-tdump.c (fatal, fancy_abort, main): Add extern prototypes. + + * recog.c (offsettable_address_p): Prototype function pointer. + (preprocess_constraints): Call memset, not bzero. + + * tree.c (tree_node_kind_names): Constify a char*. Make static. + (gcc_obstack_init): Don't declare. + (fix_sizetype): Add static prototype. + (gcc_obstack_init): Use prototype casts in call to _obstack_begin. + (tree_cons): Call memset, not bzero. + + * varasm.c (remove_from_pending_weak_list): Wrap declaration and + definition in macro ASM_WEAKEN_LABEL. + (mark_const_hash_entry): Add static prototype. + +Tue Sep 14 12:22:50 1999 Kaveh R. Ghazi + + * c-lex.c (handle_generic_pragma): Remove unused variable `c'. + + * unroll.c (find_common_reg_term, subtract_reg_term, + loop_find_equiv_value): Add static prototypes. + (unroll_loop): Wrap variable `prev' in macro HAVE_cc0. + (copy_loop_body): Remove unreachable break statement. + + * sparc.c (sparc_va_arg): Remove unused variable `tmp'. + + * sparc.h (sparc_va_start, sparc_va_arg): Add extern prototypes. + +Tue Sep 14 15:28:00 1999 Bernd Schmidt + + Undo some changes from the gcc2 merge: + * rtl.def (CONSTANT_P_RTX): Fix the comment for this rtx code. + * emit-rtl.c (gen_rtx_REG): Don't test special reg rtx's for null + pointers. + + Undo this change: + Sat Oct 3 07:20:28 1998 Stephen L Moshier + * emit-rtl.c (gen_lowpart_common): Disable optimization of + initialized float-int union if the value is a NaN. + +Tue Sep 14 04:03:44 1999 Mumit Khan + + * gthr-win32.h: New file. + + * i386/winnt.c (i386_pe_valid_decl_attribute_p): Recognize + shared as a valid attribute. + * i386/cygwin.h (ASM_OUTPUT_SECTION): Handle shared attribute. + * extend.texi: Document `shared' variable attribute. + +Tue Sep 14 04:01:46 1999 Loren Rittle + + * configure.in: Handle --enable-threads on FreeBSD. + * configure: Rebuit. + +Tue Sep 14 03:58:44 1999 Andreas Jaeger + + * configure.in: Add crtbeginS.o, crtendS.o for mips-linux; add + thread support. + * configure: Rebuilt. + +Tue Sep 14 03:47:23 1999 Joel Sherrill + Charles-Antoine Gauthier + Rosimildo DaSilva + + * configure.in (m68k-*-rtemscoff*): Added. + * configure.in (mips64orion-*-rtems*): Converted to ELF. + * configure.in (sparc-*-rtemsaout*): Added as alias for old + sparc-rtems configuration. + * configure.in (sparc-*-rtemself*): Added. + * configure.in (sparc-*-rtems*): Now ELF not a.out. + * config/i386/rtems.h: Added comment. + * config/sparc/rtemself.h: New file. + + * configure.in (m68k-rtemself): Added. + * config/elfos.h: Added ifndef wrapper for DWARF2_DEBUGGING_INFO + and DWARF_DEBUGGING_INFO. + * config/m68k/crti.s: New file. + * config/m68k/crtn.s: New file. + * config/m68k/t-crtstuff: New file. + * config/m68k/rtemself.h: New file. + + * configure.in (i[[34567]]86-*-rtemself*): Now uses crtstuff for + global ctor/dtor and C++ exception handling. + * config/i386/rtemself.h: Now uses crtstuff (crti.o + crtbegin.o) + for STARTFILE_SPEC and crtstuff (crtend.o + crtn.o) for + ENDFILE_SPEC. + * config/i386/t-rtems-i386: New File. + +Tue Sep 14 09:47:41 1999 Andreas Schwab + + * stmt.c (expand_end_case): Return right away if the case stack is + empty. + +Tue Sep 14 01:47:19 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (version.c): Remove rule incorrectly brought in from + the gcc2 merge. + +Tue Sep 14 01:42:27 1999 Marc Espie + + * Makefile.in: Prepend $(SHELL) to move-if-change calls. + * msdos/top.sed: Take into account a prepended $(SHELL) to + move-if-change. + * winnt/config-nt.sed: Likewise. Kill bogus substitution. + + * objc/Make-lang.in: Prepend $(SHELL) to move-if-change calls. + +Tue Sep 14 01:38:52 1999 J"orn Rennecke + + * regmove.c (fixup_match_1): Don't change an unchanging register. + (stable_but_for_p): Renamed to: + (stable_and_no_regs_but_for_p). Reject unchanging registers too. + Changed all callers. + +Tue Sep 14 01:33:15 1999 Andreas Schwab + + * loop.c (strength_reduce): Don't call reg_used_between_p if the + insn from BL2 is after the insn from BL. + +Mon Sep 13 21:06:01 1999 Richard Henderson + + * recog.h (INSN_OUTPUT_FORMAT_*): New. + (struct insn_data): Merge `template' and `outfun' into `output'. + Add `output_format'. + * genoutput.c (INSN_OUTPUT_FORMAT_*): New. + (struct data): Remove `outfun'; add `output_format'. + (name_for_index): Remove declaration. + (output_insn_data): Handle output formats. + (process_template): Emit the bare array for @. + (gen_expand, gen_split): Set output_format to NONE. + * output.h (get_insn_template): Declare. + * final.c (get_insn_template): New. + (final_scan_insn): Use it. + * toplev.c (compile_file): Likewise. + + * c4x/c4x.c (c4x_process_after_reload): Likewise. + * i860/i860.c (output_delayed_branch): Likewise. + (output_delay_insn): Likewise. + +1999-09-13 Alexandre Oliva + + * rtl.c (obstack_alloc_rtx): Removed. + +1999-09-13 17:03 -0700 Zack Weinberg + + * config/gmicro/gmicro.md: Disable move DF->DI anonymous pattern. + +Mon Sep 13 15:21:46 1999 Richard Henderson + + * i386.c (call_insn_operand): Reject const_int. + (expander_call_insn_operand): Use call_insn_operand. + +Mon Sep 13 17:44:28 1999 Kaveh R. Ghazi + + * gcc.c (getrusage): Wrap prototype arguments in PROTO(). + +1999-09-13 12:18 -0700 Zack Weinberg + + * config/i370/i370.md (mulsi, divsi, modsi anonymous insns): + Use DImode operation. + +1999-09-13 12:13 -0700 Zack Weinberg + + * gcc.c: Include sys/resource.h. + (report_times): New flag. + (execute): If report_times is set, calculate and report the + CPU time consumed by each subprocess. + + (rus, prus): New globals. + (option_map): Add --time. + (display_help): Document -time. + (process_command): Set report_times if -time is given. + Turn off -pipe if -time is given. + + * invoke.texi: Document new option -time. + + * configure.in: Check for getrusage. Check if we have to + prototype getrusage. + * acconfig.h: Add NEED_DECLARATION_GETRUSAGE. + * configure: Regenerate. + * config.in: Regenerate. + +Mon Sep 13 12:57:06 1999 Dave Brolley + + * cppinit.c (append_include_chain): Initialize 'next' and 'alloc' + fields. + +Mon Sep 13 10:01:33 1999 Nick Clifton + + * config/fp-bit.c: Define L_thenan_sf or L_thenan_df (as + appropriate) if FINE_GRAINED_LIBRARIES is not defined. + (nan): Return _thenan_sf or _thenan_df as appropriate. + (L_thenan_sf): Define _thenan_sf. + (L_thenan_df): Define _thenan_df. + + * Makefile.in (FPBIT_FUNCS): Add _thenan_sf. + (DPBIT_FUNCS): Add _thenan_df. + +Mon Sep 13 09:38:53 1999 Andreas Schwab + + * tree.c (fix_sizetype): Exchange the types for TYPE_SIZE and + TYPE_SIZE_UNIT. + +Sun Sep 12 23:28:20 1999 Kaveh R. Ghazi + + * Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h. + + * gcc.h: New file. + (lang_specific_driver): Don't take a function pointer parameter. + All callers changed. + + * gcc.c: Include gcc.h. + (do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link, + lang_specific_extra_outfiles, fatal): Don't declare. + (multilib_defaults_raw): Constify. + (read_specs): Call memset, rather than bzero. + (main): Call return, not exit. + (lookup_compiler): Call memcpy, not bcopy. + (fatal): Make extern. + + * cppspec.c: Include gcc.h. + (lang_specific_driver): Initialize variable `quote'. Constify a + char*. All calls to the function pointer parameter now + explicitly call `fatal'. + + * gccspec.c (lang_specific_driver): Include gcc.h. + +Sun Sep 12 19:52:10 1999 Richard Earnshaw + + * arm.c (note_invalid_constants): Use recog_data.operand_type + for recog_op_type. + +Sun Sep 12 15:53:20 1999 Bernd Schmidt + + * tree.h (build_common_tree_nodes, build_common_tree_nodes_2): + Declare. + + * reload.h (reload_in, reload_out, reload_in_reg, reload_out_reg, + reload_reg_class, reload_inmode, reload_outmode, reload_optional, + reload_nongroup, reload_inc, reload_opnum, reload_secondary_p, + reload_secondary_in_reload, reload_secondary_out_reload, + reload_secondary_in_icode, reload_secondary_out_icode, + reload_reg_rtx, reload_when_needed): Delete declarations. + (struct reload): New structure. + (rld): Declare new array. + * reload.c (reload_in, reload_out, reload_in_reg, reload_out_reg, + reload_reg_class, reload_inmode, reload_outmode, reload_optional, + reload_nongroup, reload_inc, reload_opnum, reload_secondary_p, + reload_secondary_in_reload, reload_secondary_out_reload, + reload_secondary_in_icode, reload_secondary_out_icode, + reload_reg_rtx, reload_when_needed): Delete definitions. + (rld): New array. + (whole file): Replace uses of the deleted arrays with uses of rld. + * reload1.c (whole file): Replace uses of the deleted arrays with + uses of rld. + (choose_reload_regs): Copy in/out of save_reload_reg_rtx with + explicit loops, not with bcopy. + +Sun Sep 12 05:00:24 1999 Richard Henderson + + * recog.h (insn_template, insn_outfun, insn_n_operands, insn_n_dups, + insn_n_alternatives, insn_operand_constraint, insn_operand_address_p, + insn_operand_mode, insn_operand_strict_low, insn_operand_predicate, + insn_name): Delete and consolidate into new structures. + (insn_operand_predicate_fn): New. + (insn_output_fn): New. + (insn_gen_fn): New. + (struct insn_operand_data): New. + (struct insn_data): New. + (insn_data): New. + (OUT_FCN): Update for insn_data change. + * builtins.c (expand_builtin_strlen): Likewise. + (expand_builtin_memcmp): Likewise. + * combine.c (make_extraction, simplify_comparison): Likewise. + * cse.c (canon_reg, cse_insn): Likewise. + * explow.c (allocate_dynamic_stack_space, probe_stack_range): Likewise. + * expmed.c (store_bit_field, extract_bit_field): Likewise. + (emit_store_flag): Likewise. + * expr.c (convert_move, emit_block_move): Likewise. + (clear_storage, emit_push_insn, expand_increment): Likewise. + (do_store_flag): Likewise. + * expr.h (GEN_FCN): Likewise. + (insn_gen_function): Die. + * final.c (final_scan_insn): Update for insn_data change. + (output_asm_name): Likewise. + * function.c (fixup_var_refs_1): Likewise. + * loop.c (check_dbra_loop): Likewise. + * optabs.c (expand_binop, expand_twoval_binop): Likewise. + (expand_unop, expand_complex_abs, emit_unop_insn): Likewise. + (prepare_cmp_insn, prepare_operand, emit_indirect_jump): Likewise. + (emit_conditional_move, gen_add2_insn, gen_sub2_insn): Likewise. + * recog.c (validate_replace_rtx_1, extract_insn): Likewise. + * regmove.c (gen_add3_insn): Likewise. + * reload.c (push_secondary_reload, combine_reloads): Likewise. + (find_reloads, find_reloads_address_1): Likewise. + (debug_reload_to_stream): Likewise. + * reload1.c (emit_reload_insns, gen_reload): Likewise. + * stmt.c (expand_end_case): Likewise. + * toplev.c (compile_file): Likewise. + + * c4x/c4x.c (c4x_process_after_reload): Likewise. + * i860/i860.c (output_delayed_branch, output_delay_insn): Likewise. + + * print-rtl.c (insn_name_ptr): Remove declaration. + (get_insn_name): Declare. + (print_rtx): Use it. + * genoutput.c (insn_name_ptr): Remove. + (next_operand_number): New. + (struct operand_data): New. + (null_operand, odata, odata_end): New. + (struct data): Use struct operand_data. + (idata, idata_end): Renamed from insn_data and end_of_insn_data. + (get_insn_name): Renamed from name_for_index. + (output_prologue): Define NO_MD_PROTOTYPES. + (output_predicate_decls): Break out from output_epilogue. + Iterate over the operands list. + (output_operand_data): Break out from output_epilogue. Emit + just the operands list. + (output_insn_data): Break out from output_epilogue. Emit just + the insn data. + (output_epilogue): Remove. + (output_get_insn_name): New. + (constraints, op_n_alternatives, predicates, address_p): Die. + (modes, strict_low, seen): Die. + (scan_operands): Take new param `d' instead of writing to + seven global variables. + (compare_operands): New. + (place_operands): New. + (validate_insn_alternatives): Update for struct data change. + (gen_insn): Don't zero or copy 7 global arrays. Update for + scan_operands; call place_operands. + (gen_peephole, gen_expand, gen_split): Likewise. + (main): Update for new output routines. + + * genattr.c (insn_name_ptr): Remove. + (get_insn_name): New function. + * genattrtab.c, gencodes.c, genconfig.c, genemit.c: Likewise. + * genextract.c, genflags.c, genopinit.c, genpeep.c: Likewise. + * genrecog.c: Likewise. + + * alpha.md (adddi3): Make `pattern' array static. + +Sun Sep 12 22:05:21 1999 Michael Hayes + + * config/c4x/c4x.h (c4x_rpts_cycles_string, + c4x_cpu_version_string): Constify char *. + * config/c4x/c4x.c (c4x_rpts_cycles_string, + c4x_cpu_version_string): Likewise. + +Sat Sep 11 23:28:33 1999 Richard Henderson + + * tree.c (save_tree_status): Revert 10 Sep change. + (restore_tree_status): Likewise. Call obstack_free with NULL + before freeing the obstack proper. + +Sat Sep 11 23:23:46 1999 Richard Henderson + + * cse.c (cse_main): If gc'ing, collect around cse_basic_block. + + * ggc-simple.c (ggc_pop_context): Fold outstanding bytes into + surrounding context. + +Sat Sep 11 19:52:43 1999 Mark Mitchell + + * tree.c (type_hash_canon): Put all types in the hash-table, when + GC'ing. + +Sat Sep 11 18:37:04 1999 Richard Henderson + + * recog.h (struct recog_data, recog_data): New. + (recog_foo variables): Kill. + * recog.c (recog_operand, recog_operand_loc): Kill. + (recog_dup_loc, recog_dup_num, recog_n_operands): Kill. + (recog_n_dups, recog_n_alternatives, recog_operand_mode): Kill. + (recog_constraints, recog_op_type, recog_operand_address_p): Kill. + (recog_data): Define. + (extract_insn): Update all recog_foo references to use recog_data. + (preprocess_constraints, constrain_operands): Likewise. + * final.c (final_scan_insn, cleanup_subreg_operands): Likewise. + * genattrtab.c (main): Likewise. + * genextract.c (main): Likewise. + * genoutput.c: Likewise. + * genrecog.c (write_subroutine, main): Likewise. + * local-alloc.c (block_alloc): Likewise. + * reg-stack.c (record_asm_reg_life, subst_asm_stack_regs): Likewise. + * regclass.c (scan_one_insn, record_reg_classes): Likewise. + * regmove.c (regmove_optimize, find_matches, fixup_match_1): Likewise. + * reload.c (find_reloads, find_reloads_toplev): Likewise. + * reload1.c (maybe_fix_stack_asms, eliminate_regs_in_insn): Likewise. + (reload_cse_simplify_operands): Likewise. + + * arc/arc.c (arc_final_prescan_insn): Likewise. + * arm/arm.c (note_invalid_constants, arm_final_prescan_insn): Likewise. + * h8300/h8300.c (notice_update_cc): Likewise. + * i386/i386.c (ix86_attr_length_default, ix86_agi_dependant): Likewise. + * i860/i860.c (output_delayed_branch, output_delay_insn): Likewise. + * mn10200/mn10200.c (notice_update_cc): Likewise. + * mn10300/mn10300.c (notice_update_cc): Likewise. + * romp/romp.c (update_cc): Likewise. + * sparc/sparc.c (check_pic): Likewise. + * v850/v850.c (notice_update_cc): Likewise. + + * genemit.c (main): Don't declare recog_operand. + +Sat Sep 11 12:41:55 1999 Alex Samuel + + * ggc.h (rtvec_def): Forward declare. + (tree_node): Likewise. + (ggc_root): Define. + (roots): Declare. + (ggc_set_mark_rtx): Add prototype. + (ggc_set_mark_rtvec): Likewise. + (ggc_set_mark_tree): Likewise. + * ggc-simple.c (ggc_root): Don't define. + (roots): Don't declare. + (ggc_mark_rtx): Remove. + (ggc_mark_rtvec): Likewise. + (ggc_mark_tree): Likewise. + (ggc_mark_varray): Likewise. + (ggc_mark_tree_hash_table_entry): Likewise. + (ggc_mark_tree_hash_table): Likewise. + (ggc_set_mart_rtx): New function. + (ggc_set_mark_rtvec): Likewise. + (ggc_set_mark_tree): Likewise. + (ggc_add_root): Remove. + (ggc_add_rtx_root): Likewise. + (ggc_remove_tree_root): Likewise. + (ggc_add_string_root): Likewise. + (ggc_add_tree_varray_root): Likewise. + (ggc_add_tree_hash_table_root): Likewise. + (ggc_del_root): Likewise. + (ggc_mark_rtx_ptr): Likewise. + (ggc_mark_tree_ptr): Likewise. + (ggc_mark_string_ptr): Likewise. + (ggc_mark_tree_varray_ptr): Likewise. + (ggc_mark_tree_hash_table_ptr): Likewise. + * ggc-common.c: New file. + * Makefile.in (OBJS): Add ggc-common.o. + (ggc-common.o): List dependencies. + +1999-09-10 22:37 -0700 Zack Weinberg + + * cppalloc.c (xstrdup): Use memcpy. + * cpperror.c (cpp_print_containing_files): Don't use + cpp_notice. + * cpplib.c (conditional_skip): Set temp->lineno. + (do_endif): Make error message less obscure. + (if_directive_name): New function. + (cpp_get_token [case EOF]): Unwind the if stack and generate + error messages for each unterminated conditional in this file. + (parse_string): Do not behave differently if -traditional. + +Fri Sep 10 14:04:07 1999 Richard Henderson + + * builtins.c (expand_builtin_va_arg): Cope with an array-type + va_list decomposing to pointer-type. + * rs6000.c (rs6000_va_start) Unwrap the ARRAY_TYPE to get at fields. + (rs6000_va_arg): Likewise. + +Fri Sep 10 13:21:21 1999 Jim Wilson + + * except.c (start_dynamic_handler): Compute size using + STACK_SAVEAREA_MODE. + +Fri Sep 10 16:01:23 1999 Kaveh R. Ghazi + + * protoize.c: Remove various __STDC__ and POSIX hacks. Don't + include directory headers. Don't define strrchr. Don't provide + my_* replacement functions. Prefer PTR over `pointer_type'. + Don't prototype system functions. Don't redefine getopt. + + (shortpath, fancy_abort, notice, savestring, dupnstr, substr, + safe_read, safe_write, save_pointers, restore_pointers, + is_id_char, in_system_include_dir, directory_specified_p, + file_excluded_p, unexpand_if_needed, abspath, check_aux_info, + find_corresponding_lparen, referenced_file_is_newer, + save_def_or_dec, munge_compile_params, gen_aux_info_file, + process_aux_info_file, identify_lineno, check_source, + seek_to_line, forward_to_next_token_char, output_bytes, + output_string, output_up_to, other_variable_style_function, + find_rightmost_formals_list, do_cleaning, careful_find_l_paren, + do_processing, is_syscalls_file, rename_c_file, find_extern_def, + find_static_definition, connect_defs_and_decs, add_local_decl, + add_global_decls, needs_to_be_converted, visit_each_hash_node, + add_symbol, lookup, free_def_dec, find_file, reverse_def_dec_list, + edit_fn_declaration, edit_formals_lists, edit_fn_definition, + scan_for_missed_items, edit_file, string_list_cons): Add static + prototypes. + (standard_exec_prefix, target_machine, target_version, + default_syscalls_dir, string_list, string_list_cons, find_file, + do_cleaning): Constify a char*. + (safe_read, safe_write): Use PTR, not a char*. + (is_id_char): Take an int, not a char. + (main): Add prototype. Call return, not exit. + +Fri Sep 10 16:48:26 1999 Andrew Haley + + * tree.c (type_hash_lookup): Check for equal TYPE_ALIGN fields + when comparing types. + +Fri Sep 10 08:43:32 1999 Richard Henderson + + * loop.c (basic_induction_var): Typo NULL_RTX -> NULL. + (strength_reduce): Release the varrays from the no-bivs early exit. + + * reload1.c (order_regs_for_reload): Init hard_reg_n_uses before + the loop over the registers. + + * tree.c (save_tree_status): Set maybepermanent_firstobj NULL + for a new obstack. + (restore_tree_status): Check that instead when freeing the obstack. + +Wed Sep 8 16:12:04 1999 Andrew Haley + + * alias.c (rtx_equal_for_memref_p): Allow CONST_DOUBLEs to be used + as pointers. + +Fri Sep 10 11:58:55 1999 Bernd Schmidt + + * i386.md (ashlqi3): For NON_QI_REG_P regs, use sall. Fix some + operand size modifiers. + +Fri Sep 10 10:32:32 1999 Bernd Schmidt + + * c-common.c (c_common_nodes_and_builtins): Don't build + va_list_type_node. + * c-common.h (enum c_tree_index and related accesor macros): Remove + everything now declared in tree.h. + * c-decl.c (CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, + LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, WCHAR_UNSIGNED, FLOAT_TYPE_SIZE, + DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't provide defaults. + (error_mark_node, void_type_node, char_type_node, integer_type_node, + unsigned_type_node, ptr_type_node, va_list_type_node, + integer_zero_node, null_pointer_node, integer_one_node): Delete. + (init_decl_processing): Call build_common_tree_nodes and + build_common_tree_nodes_2 instead of building their nodes here. + Don't add roots for these nodes. + * stor-layout.c (size_zero_node, size_one_node): Delete. + (set_sizetype): Make a new node for bitsizetype each time. + * tree.c (global_trees): New variable. + (init_obstacks): Add a gc root for it. + (CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, + LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, + DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Provide defaults. + (build_common_tree_nodes): New function. + (fix_sizetype): New function. + (build_common_tree_nodes_2): New function. + * tree.h (enum tree_index): New. + (global_trees): Declare. + Add accessor macros for all nodes now moved to global_trees. + Delete their declarations. + +Thu Sep 9 20:15:46 1999 Richard Henderson + + * c-decl.c (finish_function): When processing a nested function, + push and pop GC context around rest_of_compilation. + +Thu Sep 9 16:42:06 1999 Richard Henderson + + * i386.c (override_options): Remove ppro, pentium2, and p2 as aliases. + Default ix86_arch to PROCESSOR_I386. + * i386.h (CC1_CPU_SPEC): Don't add -march=foo. Remove -mno-foo. + (CPP_486_SPEC, CPP_586_SPEC, CPP_686_SPEC): Delete. + (CPP_CPU_DEFAULT_SPEC): Define to __tune_foo__. + (CC1_CPU_SPEC): Make -march=foo define __foo__, and provide + __tune_foo__ if no -mcpu. Make -mcpu=bar define __tune_bar__. + (EXTRA_SPECS): Remove deleted specs. + +Thu Sep 9 16:03:06 1999 Richard Henderson + + * function.c (assign_stack_local_1): Allocate from + function->x_frame_offset, not frame_offset. + +Thu Sep 9 14:36:31 1999 Mark Mitchell + + * ggc.h (lang_cleanup_tree): Remove. + * gcc-simple.c (ggc_free_tree): Don't call lang_cleanup_tree. + * ggc-callbacks.c (lang_cleanup_tree): Remove. + + * c-decl.c (finish_struct): Use ggc_alloc to allocate + TYPE_LANG_SPECIFIC when garbage collecting. + (lang_mark_tree): Mark TYPE_LANG_SPECIFIC. + (lang_cleanup_tree): Remove. + +Thu Sep 9 14:23:02 1999 Jason Merrill + + * defaults.h (EH_FRAME_SECTION, EH_FRAME_SECTION_ASM_OP): Define here. + * crtstuff.c: Not here. + * dwarf2out.c: Or here. + * libgcc2.c (__do_global_ctors, __do_global_dtors): Handle EH frame + info. + +Thu Sep 9 09:40:58 1999 Mark Mitchell + + * function.h (free_after_compilation): Remove decl parameter. + (free_varasm_status0: Likewise. + (free_emit_status): Likewise. + (free_stmt_status): Likewise. + (free_after_compilation): Likewise. + (init_lang_status): New variable. + (free_lang_status): Likewise. + * emit-rtl.c (free_emit_status): Make decl parameter implicit. + * function.c (init_lang_status): New variable. + (free_lang_status): Likewise. + (push_function_context_to): Don't set function::decl here. + (free_after_copmilation): Make decl parameter implicit. Call + free_lang_status if defined. + (prepare_function_start): Call init_lang_status if defined. + (init_function_start): Set function::decl here. + * profile.c (output_func_start_profiler): Don't call pushdecl + until we've actually started the function. + * stmt.c (free_stmt_status): Make decl parameter implicit. + * toplev.c (rest_of_compilation): Don't pass decl to + free_after_compilation. + * varasm.c (free_varasm_status): Likewise. + +Thu Sep 9 17:23:19 1999 Bernd Schmidt + + * except.c (call_get_eh_context): Add root when allocating static + tree variable. + +Thu Sep 9 15:24:59 BST 1999 Richard Earnshaw + + * arm.c: Include "ggc.h". + (arm_add_gc_roots): New function. + (arm_override_options): Call it. + (aof_pic_entry): Add a GC root for aof_pic_label when it's allocated. + + * arm.md (define_asm_attributes): Add a pool_range attribute. + +Thu Sep 9 12:32:57 BST 1999 Nathan Sidwell + + * extend.texi (Volatiles): New node. + +Thu Sep 9 03:37:31 1999 Richard Henderson + + * ggc-simple.c (IS_MARKED, IGNORE_MARK): New. + (GGC_ANY_MAGIC, GGC_ANY_MAGIC_MARK): New. + (struct ggc_any): Replace `mark' with `magic_mark'. + (ggc_alloc_string): Use memcpy, not bcopy. + (ggc_alloc_any): Set magic_mark. Update bytes_alloced_since_gc. + (ggc_free_{rtx,rtvec,tree,string}): Mark inline. + (ggc_free_any): New. + (ggc_mark_string): Use IGNORE_MARK. Calc back to struct gcc_string. + (ggc_mark): Use IGNORE_MARK. Abort if magic doesn't match. + (ggc_collect): Re-enable collection avoidance. Use GGC_ANY_MARK. + Use IS_MARKED. Use ggc_free_any. + +1999-09-09 Scott Bambrough + + * config/arm/linux-elf.h: define NO_IMPLICIT_EXTERN_C + +Thu Sep 9 01:55:21 1999 Richard Henderson + + * toplev.c (main): Always init_ggc. + +Wed Sep 8 23:53:22 1999 Richard Henderson + + * except.c (find_all_handler_type_matches): Free the list if + we found no matches. + + * combine.c (SUBST): Break out to a real function do_SUBST. + (SUBST_INT): Likewise. + * gcse.c (free_pre_mem): Free `temp_bitmap'. + (pre_insert): Free `inserted'. + * loop.c (basic_induction_var): Always set `location'. + + * function.c (expand_function_end): Add initial_trampoline as a root. + * rtl.h (init_varasm_once): Declare. + * toplev.c (compile_file): Call it. + * ggc-simple.c (ggc_mark_string_ptr): New. + (ggc_add_string_root): New. + (ggc_collect): Disable collection avoidance temporarily. + * ggc.h (ggc_add_string_root): Declare. + * except.c (create_rethrow_ref): Use ggc_alloc_string. + * optabs.c (init_libfuncs): Likewise. + * varasm.c (named_section): Use ggc_alloc_string. + (make_function_rtl): Likewise. + (make_decl_rtl): Likewise. + (assemble_static_space): Likewise. + (assemble_trampoline_template): Likewise. + (output_constant_def): Likewise. + (force_const_mem): Likewise. + (mark_const_hash_entry): New. + (mark_pool_sym_hash_table): New. + (mark_varasm_state): Use it. + (init_varasm_once): New. + + * expr.h (init_one_libfunc): Declare. + * optabs.c (init_one_libfunc): New. + (init_optabs): Use it. + * config/gofast.h: Likewise. + * config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Likewise. + * config/sparc/sparc.h (INIT_TARGET_OPTABS): Likewise. + +Thu Sep 9 13:46:06 1999 Geoffrey Keating + + * Makefile.in (cppexp.o): Depend on cpphash.h. + * cppexp.c (cpp_lex): Handle `defined (xxx)' for poisoned xxx. + Include cpphash.h. + * cpphash.c (special_symbol): Handle plain `xxx' for poisoned xxx. + * cpplib.c (do_define): Generalize to handle poisoned definitions, + redefining poisoned identifiers, etc. + (do_undef): Don't allow poisoned identifiers to be undefined. + (do_pragma): Add #pragma poison. + (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. + + * cccp.c: Add T_POISON node type. + (special_symbol): Handle `defined(xxx)' and plain `xxx' for + poisoned xxx. + (do_define): Generalize to handle poisoned definitions, + redefining poisoned identifiers, etc. + (do_undef): Don't allow poisoned identifiers to be undefined. + (do_pragma): Add #pragma poison. + (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. + + * c-pragma.c (handle_pragma_token): Ignore #pragma poison. + * c-pragma.h: Add ps_poison state. We now always have generic + pragmas. + +Wed Sep 8 20:30:42 1999 Mark Mitchell + + * ggc.h (ggc_alloc): New function. + (ggc_mark): Likewise. + * ggc-simple.c (ggc_any): New structure. + (ggc_status): Add anys. + (n_anys_collected): New variable. + (ggc_alloc): Define. + (ggc_mark): Likewise. + (ggc_collect): Collect the anys. + +Wed Sep 8 20:15:14 1999 Kaveh R. Ghazi + + * c-decl.c (mark_binding_level): Make static to match prototype. + +Wed Sep 8 16:41:27 1999 Richard Henderson + + * flow.c (new_insn_dead_notes): Don't early out for preexisting regs. + +Wed Sep 8 16:07:52 1999 Richard Henderson + + * gengenrtl.c (CONST_DOUBLE_FORMAT): Take the size REAL_ARITHMETIC + will use into account. Expand the max width to 5. + * rtl.c: Likewise. + +Wed Sep 8 16:01:14 1999 Richard Henderson + + * ggc-simple.c (ggc_free_rtx): Poison the correct amount + for the rtx length. + +Wed Sep 8 15:23:54 1999 Richard Henderson + + * alpha.md (call value patterns): Remove the result predicates. + +Wed Sep 8 13:35:38 1999 Richard Henderson + + * Makefile.in (stmp-fixinc): Remove extraneous exit 1 from + last change. + +Wed Sep 8 15:32:16 1999 Kaveh R. Ghazi + + * system.h (sbrk, malloc, calloc, realloc): Backup prototypes + changed from extern char *, to extern PTR. Also fix typo in + NEED_DECLARATION_REALLOC test. + + * mips-tdump.c (malloc, calloc, realloc): Don't prototype. + +Wed Sep 8 11:40:47 1999 Kaveh R. Ghazi + + * gansidecl.h (__attribute__, ATTRIBUTE_UNUSED_LABEL, + ATTRIBUTE_UNUSED, ATTRIBUTE_NORETURN, ATTRIBUTE_PRINTF, + ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2, ATTRIBUTE_PRINTF_3, + ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5, GENERIC_PTR): Delete. + + * c-decl.c (field_decl_cmp): Use PTR instead of GENERIC_PTR. + + * cccp.c (pcfinclude): Likewise. + + * global.c (allocno_compare): Likewise. + + * haifa-sched.c (rank_for_schedule): Likewise. + + * local-alloc.c (qty_sugg_compare_1, qty_compare_1): Likewise. + + * reload1.c (hard_reg_use_compare, reload_reg_class_lower): Likewise. + + * stupid.c (stupid_reg_compare): Likewise. + + * tree.c (_obstack_allocated_p): Likewise. + + * varray.h (varray_data_tag, VARRAY_GENERIC_PTR_INIT): Likewise. + +1999-09-08 Bruce Korb autogen@linuxbox.com + + * Makefile.in: Give the hapless gperf user a hint about + why "gperf -F" fails. + +Wed Sep 8 04:43:22 1999 Richard Henderson + + * lists.c: Include ggc.h. + (zap_lists): New. + (init_EXPR_INSN_LIST_cache): Install it. + + * ggc-simple.c (init_ggc): Absorb the old init. + (ggc_push_context): Use xcalloc. + (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Likewise. + (ggc_collect): Add [rvts] tags to the collection stats. + +Wed Sep 8 11:14:25 1999 Andreas Schwab + + * cccp.c (main): Fix handling of -include and -imacros options. + +Wed Sep 8 02:23:08 1999 Jeffrey A Law (law@cygnus.com) + + * cpplib.c (cpp_push_buffer): Fix order of arguments. + +Wed Sep 8 04:44:09 1999 Alexandre Oliva + + * rtl.h (obstack_alloc_rtx): Removed, it's now static in + genrtl.c. + +Wed Sep 8 00:33:43 1999 Alasdair Baird + + * flow.c (insn_dead_p): Use XEXP rather than SUBREG_REG. + * haifa-sched.c (sched_analyze_1): Use XEXP rather than SUBREG_REG + and SET_DEST. Update comment. + +Wed Sep 8 18:55:17 1999 Michael Hayes + + * config/c4x/c4x.c: Include ggc.h. + (c4x_add_gc_roots): New function. + (c4x_override_options): Call c4x_add_gc_roots. + +Wed Sep 8 00:00:16 1999 Richard Henderson + + * defaults.h (TARGET_ESC): Move ... + * system.h: ... here, where Linas had it in the first place. Silly me. + +Tue Sep 7 23:46:35 1999 Linas Vepstas + + * c-common.c: Use ISGRAPH, ISLOWER, toupper. + * c-lex.c, cccp.c, cexp.c, cexp.y, cppexp.c, dwarf2out.c, genattr.c, + genattrtab.c, genemit.c, genextract.c, genpeep.c, tree.c: Likewise. + * system.h (IN_CTYPE_DOMAIN): Define to 1 if HOST_EBCDIC. + * defaults.h (TARGET_ESC): Add default. + +Tue Sep 7 23:36:59 1999 Linas Vepstas + + * configure.in: add i370-*-openedition, i370-*-mvs and + i370-*-linux targets + +Tue Sep 7 23:31:53 1999 Mark Mitchell + + * dsp16xxx.c: Include ggc.h + (override_options): Mark GC roots. + * mn10200.c: Include ggc.h. + (asm_file_start): Mark GC roots. + * tahoe.c: Include ggc.h. + (extensible_operand): Mark GC roots. + +Tue Sep 7 23:23:15 1999 Linas Vepstas + + * README: Add section discussing status of ELF ABI. + * i370.c: Fix misc spelling mistakes. + (i370_label_scan): Updated notes, exception handling. + (i370_function_prolog): Simplify ELF stack handling. + * i370.h: (FIXED_REGISTERS): Free up r12 for ELF. + (STACK_GROWS_DOWNWARD): ELF stack grows down. + (ASM_DECLARE_FUNCTION_NAME): Fix crazy malloc size. + * i370.md: (movdi): Add notes. + (floatsidf2): Use stack not rtca for scratch float area. + (iorsi3): Correct operand constraints. + * x-oe: Restore TAROUTOPTS which are used by pax. + +Tue Sep 7 22:39:18 1999 Mark Mitchell + + * rs6000.c: Include ggc.h. + (rs6000_add_gc_roots): New function. + (override_options): Call it. + +Tue Sep 7 22:09:03 1999 Richard Henderson + + * alpha.h (alpha_compare): New. + (alpha_compare_op0, alpha_compare_op1, alpha_compare_fp_p): Remove. + * alpha.c: Likewise for the definitions. + (alpha_emit_conditional_branch): Update for alpha_compare. + (alpha_emit_conditional_move): Likewise. + * alpha.md (cmpdf, cmpdi): Likewise. + (setcc patterns): Likewise. Zero alpha_compare after use. + (sne): Optimize (x != 0) into (0U < x). + +Tue Sep 7 21:55:02 1999 Richard Henderson + + * alpha.h (alpha_eh_epilogue_sp_ofs): Remove. + (struct machine_function): Declare; add eh_epilogue_sp_ofs. + (INIT_EXPANDERS): Remove. + * alpha.c: Include ggc.h. + (alpha_eh_epilogue_sp_ofs, alpha_return_addr_rtx): Remove. + (alpha_init_machine_status, alpha_mark_machine_status): New. + (override_options): Install them. + (struct machine_function): Moved to alpha.h. + (alpha_save_machine_status, alpha_restore_machine_status): Remove. + (alpha_init_expanders): Remove. + (alpha_return_addr): Adjust to use current_function->machine. + (alpha_ra_ever_killed): Likewise. + (alpha_expand_epilogue): Likewise. + * alpha.md (eh_epilogue): Likewise. + +Wed Sep 8 14:34:42 1999 Ian Piumarta + Melissa O'Neill + Geoffrey Keating + + * config/rs6000/rs6000.c (first_reg_to_save): Don't save fixed or + call-used registers (call-saved registers must still be contiguous + and end with r31, of course). + +Tue Sep 7 21:41:38 1999 Richard Henderson + + * c-typeck.c (type_lists_compatible_p): Use simple_type_promotes_to. + (self_promoting_type_p): Delete. + (self_promoting_args_p): Move ... + * c-common.c: ... here. + (c_common_nodes_and_builtins): Initialize lang_type_promotes_to. + (simple_type_promotes_to): New. + * builtins.c (lang_type_promotes_to): New. + (expand_builtin_va_arg): Use it to give diagnostic for illegal types. + * c-tree.h (C_PROMOTING_INTEGER_TYPE_P): Move ... + * c-common.h: ... here. + (self_promoting_args_p, simple_type_promotes_to): Declare. + * c-decl.c (duplicate_decls): Use simple_type_promotes_to. + (grokdeclarator): Likewise. + * tree.h (lang_type_promotes_to): Declare. + +Tue Sep 7 17:15:21 1999 Mark Mitchell + + Add some machine-dependent GC roots. + * sparc.c: Include ggc.h. + (sparc_add_gc_roots): New function. + (mark_ultrasparc_pipeline_state): Likewise. + (override_options): Call sparc_add_gc_roots. + * pa.c: Include ggc.h. + (pa_add_gc_roots): New function. + (mark_deferred_plabels): Likewise. + (override_options): Call pa_add_gc_roots. + * mips.c: Include ggc.h. + (mips_add_gc_roots): New function. + (override_options): Use it. + +Tue Sep 7 11:39:41 1999 Kaveh R. Ghazi + + * cpperror.c (cpp_file_line_for_message): Constify a char*. + + * cppexp.c (parse_number, parse_charconst, cpp_lex, + cpp_parse_expr): Add static prototypes. + (parse_charconst): Don't cast away const-ness. + (token): Constify a char*. + + * cppfiles.c (file_name_list, include_hash, find_include_file, + finclude, initialize_input_buffer): Constify a char*. + (file_cleanup, find_position): Add static prototypes. + + * cpphash.c (macro_cleanup, macarg, timestamp, special_symbol, + collect_expansion): Add static prototypes. + (cpp_install, create_definition, monthnames): Constify a char*. + + * cpphash.h (cpp_install): Likewise. + + * cppinit.c (known_suffixes, default_include, + dump_special_to_buffer, NAME, cpp_start_read, cpp_finish): Likewise. + (base_name, dump_special_to_buffer, initialize_dependency_output): + Add static prototypes. + + * cpplib.c (my_strerror): Constify a char*. + (null_underflow, null_cleanup, skip_comment, copy_comment, + copy_rest_of_line, handle_directive, pass_thru_directive, + get_directive_token, read_line_number, cpp_print_file_and_line, + v_cpp_error, v_cpp_warning, v_cpp_error_with_line, + v_cpp_warning_with_line, detect_if_not_defined, + consider_directive_while_skipping): Add static prototypes. + (pass_thru_directive, check_macro_name, cpp_expand_to_buffer, + cpp_pedwarn_with_file_and_line): Constify a char*. + + * cpplib.h (cpp_options, include_hash, progname, definition, + cpp_pedwarn_with_file_and_line, cpp_expand_to_buffer, + check_macro_name, cpp_pfatal_with_name, cpp_file_line_for_message, + find_include_file, deps_output, include_hash): Constify a char*. + + * cppmain.c (progname): Constify. + (main): Add prototype. Use return, not exit. + + * fix-header.c (fatal, add_symbols, lookup_std_proto, write_lbrac, + recognized_macro, check_macro_names, read_scan_file, write_rbrac, + inf_skip_spaces, inf_read_upto, inf_scan_ident, inf_scan_ident, + check_protection): Add static prototype. + (xfree): Remove. + (progname, recognized_macrom, recognized_extern): Constify a char*. + (main): Add prototype. + + * gen-protos.c (progname): Constify a char*. + +Tue Sep 7 00:47:52 1999 Mark Mitchell + + * emit-rtl.c (free_emit_status): Take decl as a parameter. + (init_emit_once): Add more GC roots. + * except.c (mark_func_eh_entry): New function. + (mark_eh_node): Mark false_label and rethrow_label. + (init_eh): Add more GC roots. + * function.c (free_after_compilation): Take decl as a parameter. + Call free_stmt_status. + (mark_function_state): Don't assume x_parm_reg_stack_loc is + non-NULL. + * function.h (free_after_compilation): Change prototype. + (free_varasm_status): Likewise. + (free_emit_status): Likewise. + (free_stmt_status): New function. + * ggc-simple.c (rtx, vecs, trees, strings, bytes_alloced_since_gc): + Remove, replacing with ... + (ggc_status): New structure. + (ggc_chain): New variable. + (init_gcc): Define. + (ggc_push_context): New function. + (ggc_pop_context): Likewise. + (ggc_alloc_rtx): Adjust for use of ggc_chain. + (ggc_alloc_rtvec): Likewise. + (ggc_alloc_tree): Likewise. + (ggc_alloc_string): Likewise. + (ggc_mark_rtx): Mark NOTE_SOURCE_FILE and NOTE_RANGE_INFO. + (ggc_mark_tree): Give language-dependent code a chance to mark + `x' nodes. + (ggc_mark_tree_varray): Handle empty arrays. + (ggc_collect): Adjust for use of ggc_chain. Clear + bytes_alloced_since_last_gc. + * ggc.h (ggc_pop_context): New function. + (ggc_push_context): Likewise. + * print-tree.c (print_node): Don't print obstacks when GC'ing. + * stmt.c (free_stmt_status): New function. + (init_stmt_for_function): Clear last_expr_value. + * toplev.c (rest_of_compilation): Always call free_after_compilation. + Conditionalize call to ggc_collect. + (main): Call init_ggc. + * tree.c (push_obstacks): Do the push, even when GC'ing. + (push_obstacks_nochange): Likewise. + (pop_obstacks): Liekwise. + * varasm.c (free_varasm_status): Take decl as a parameter. + +Tue Sep 7 08:15:49 1999 Gavin Romig-Koch + + * config/mips/mips.h (MULTILIB_ENDIAN_DEFAULT) : New macro. + (MULTILIB_ENDIAN_DEFAULT) : Use the new macro. + * config/mips/elf64.h (MULTILIB_DEFAULTS) : Use the new macro. + * config/mips/r3900.h (MULTILIB_DEFAULTS) : Use the new macro. + +Tue Sep 7 03:42:45 1999 Mark Klein (mklein@dis.com) + + * pa/x-pa-mpeix: New file for the MPE port. + + * pa/quadlib.asm: New file for long double support. + + * configure.in: Add hppa1.0-*-mpeix for MPE port. + * configure: Rebuilt. + +Tue Sep 7 10:08:40 1999 Andreas Schwab + + * final.c (shorten_branches): Fix last change. + +Tue Sep 7 00:30:32 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (ASM_OUTPUT_DOUBLE_INT): Delete. + +Mon Sep 6 22:44:47 1999 Jeffrey A Law (law@cygnus.com) + + * Merge from gcc2 snapshot Jan 9, 1999. See FSFChangeLog for + details. + +Mon Sep 6 22:31:28 1999 Kaveh R. Ghazi + + * c-aux-info.c (concat): Don't define. + + * cccp.c (my_strerror): Likewise. All callers changed to use + xstrerror instead. + (do_include): Call xstrdup, not xmalloc/strcpy. + (grow_outbuf): Don't check if xrealloc returns NULL, it can't. + (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. + + * collect2.c (my_strsignal): Likewise. All callers changed to use + strsignal instead. + (locatelib): Call xstrdup, not xmalloc/strcpy. + + * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. + + * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. + + * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. + + * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. + + * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. + + * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... + + * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not + malloc/realloc. + (find_all_handler_type_matches): Likewise. Don't check return + value. + (get_new_handler, init_insn_eh_region, process_nestinfo): Call + xmalloc, not malloc. + (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. + + * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. + (init_spec): Call xcalloc, not xmalloc/bzero. + (set_spec): Call xstrdup, not save_string. + (record_temp_file): Call xstrdup, not xmalloc/strcpy. + (find_a_file): Call xstrdup, not xmalloc/strcpy. + (process_command): Call xstrdup, not save_string. + (main): Call xcalloc, not xmalloc/bzero. + + * gcov.c (xmalloc): Don't define. + (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. + (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. + (output_data): Call xcalloc, not xmalloc/bzero. + + * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. + + * mips-tdump.c (xmalloc): Don't define. + (print_symbol): Call xmalloc, not malloc. + (read_tfile): Call xcalloc, not calloc. + + * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): + Don't define. All callers of xfree/my_strsignal changed to use + free/strsignal instead. + (allocate_cluster): Call xcalloc, not calloc. + + * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... + Fix memory leak, free allocated memory. + + * prefix.c (translate_name): Call xstrdup, not save_string. + (update_path): Likewise. + + * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. + + * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): + Don't define. Callers of xfree/savestring2 changed to use + free/concat instead. + + * reload1.c (reload): Call xcalloc, not xmalloc/bzero. + (init_elim_table): Likewise. + + * resource.c (init_resource_info): Likewise. + + * stupid.c (stupid_life_analysis): Likewise. + + * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. + (open_dump_file): Call concat, not xmalloc/strcpy/... + (clean_dump_file): Likewise. + (compile_file): Call xstrdup, not xmalloc/strcpy. + +Mon Sep 6 15:04:55 1999 Richard Henderson + + * v850.h (EXPAND_BUILTIN_VA_ARG): New. + * v850.c (v850_va_arg): New. + +Tue Sep 7 09:36:01 1999 Michael Hayes + + * haifa-sched.c: Tidy comments. + +Mon Sep 6 14:30:13 1999 Bernd Schmidt + + * Makefile.in (C_AND_OBJC_OBJS): Remove ggc-callbacks.o. + (c-parse.o, c-decl.o, c-lang.o, c-lex.o, c-common.o, + $(out_object_file)): Depend on ggc.h. + * c-common.c: Include "ggc.h". + (combine_strings): If doing GC, use ggc_alloc_string. + * c-decl.c: Include "ggc.h". + (ggc_p): Define with value 0. + (mark_binding_level): New function. + (init_decl_processing): Add GC roots. + (mark_c_function_context): New function. + (lang_mark_false_label_stack): New function. + (lang_mark_tree): New function. + (lang_cleanup_tree): New function. + * c-lang.c: Include "ggc.h". + (lang_init): Call c_parse_init. + * c-lex.c: Include "ggc.h". + (check_linenum): If doing GC, don't copy filenames to permanent + obstack. + * c-parse.in: Include "ggc.h". + (c_parse_init): New function. + * c-tree.h (c_parse_init, mark_c_function_context): Declare. + * objc/Make-lang.in (objc-parse.o): Depend on ggc.h. + + * except.c (mark_eh_state): Mark more state. + * function.c (mark_function_state): Likewise. + * ggc-simple.c (ggc_alloc_rtvec): Bring in sync with non-gc version. + (ggc_alloc_string) [GGC_DUMP]: Fix typo. + * toplev.c (mark_file_stack): New function. + (compile_file): If doing GC, use ggc_alloc_string on input filename. + (main): Add root for input_file_stack. + + * i386.c: Include "ggc.h". + (ix86_mark_machine_status): New function. + (override_options): Set mark_machine_status. + +Mon Sep 6 15:26:23 1999 Bernd Schmidt + + * tree.c (copy_node): Copy node contents also if doing GC. + +Mon Sep 6 08:42:06 1999 Alexandre Oliva + + * collect2.c (scan_libraries): Fix double-thinko :-). + +Mon Sep 6 02:42:36 1999 Jeffrey A Law (law@cygnus.com) + + * collect2.c (scan_libraries): Fix thinko. + + * cse.c (delete_trivially_dead_insns): Do not skip the last + insn if it is a real insn. + +Sun Sep 5 18:57:42 1999 Mark Mitchell + + * Makefile.in (ggc-simple.o): Depend on hash.h. + * ggc.h (ggc_add_tree_hash_table_root): Declare. + (ggc_mark_tree_varray): Likewise. + (ggc_mark_tree_hash_table): Likewise. + * ggc-simple.c: Include hash.h. + (ggc_mark_tree_hash_table_ptr): New function. + (ggc_mark_tree_hash_table_entry): Likewise. + (ggc_mark_tree_hash_table): Likewise. + (ggc_add_tree_hash_table_root): Likewise. + * varray.h (const_equiv_data): Use struct rtx_def *, rather than + rtx, when defining fields. + +Sun Sep 5 18:57:42 1999 Bernd Schmidt + + * profile.c (output_func_start_profiler): Remove apparently + nonsensical call to start_sequence. + +Sun Sep 5 17:34:33 1999 Richard Henderson + + * clipper/clipper.c (clipper_va_start): Fix typos. + + * pyr/pyr.c (pyr_build_va_list, pyr_va_start, pyr_va_arg): New stubs. + * spur/spur.c (spur_build_va_list, spur_va_start): New stubs. + (spur_va_arg): New stub. + + * configure.in: Comment out pyramid. + +Sun Sep 5 19:11:01 1999 Michael Meissner + + * i386.h (MASK_{DEBUG_{ADDR,ARG},INTEL_SYNTAX}): Move so these + don't conflict with the bits that win32, cygwin, and dgux + defines. + +Sun Sep 5 09:31:56 1999 Richard Henderson + Bernd Schmidt + + * integrate.c (function_cannot_inline_p): Do not inline + functions with forced labels. + +Sun Sep 5 00:35:17 1999 Richard Henderson + Bernd Schmidt + Mark Mitchell + + * Makefile.in (ggc-simple.o): Depend on varray.h. + (rtl.o): Depend on ggc.h. + (genattrtab.o): Depend on ggc.h. + (print-tree.o): Likewise. + (fold-const.o): Likewise. + * emit-rtl.c (sequence_element_free_list): Remove, and all references. + (make_insn_raw): Don't cache insns when GC'ing. + (emit_insn_before): Likewise. + (emit_insn_after): Likewise. + (emit_insn): Likewise. + (start_sequence): Use xmalloc to allocate the sequence_stack. + (end_sequence): Add free to free it. + (gen_sequence): Don't cache insns when GC'ing. + (clear_emit_caches): Don't use sequence_element_free_list. + (init_emit): Use xcalloc, not xmalloc+bzero. + * fold-const.c (size_int_wide): Kill the cache, when GC'ing. + * function.c (pop_function_context_from): Use free to free the + fixup_var_refs_queue. + (put_reg_into_stack): Allocate it with xmalloc. + * genattrtab.c: Include ggc.h. + (operate_exp): Don't use obstack_free when GC'ing. + (simplify_cond): Likewise. + (simplify_text_exp): Likewise. + (optimize_attrs): Likewise. + * gengenrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when + GC'ing. + (gencode): Generate a #include for ggc.h. + * ggc-callbacks.c (ggc_p): Define it to zero. + * ggc-none.c (ggc_p): Likewise. + * ggc-simple.c: Include varray.h. + (ggc_mark_tree_varray): New function. + (ggc_add_tree_varray_root): Likewise. + (ggc_mark_tree_varray_ptr): Likewise. + * ggc.h (ggc_p): Declare. + (varray_head_tag): Likewise. + (ggc_add_tree_varray_root): Declare. + * print-tree.c (print_node): Don't check for TREE_PERMANENT + inconsistencies when GC'ing. + * rtl.c: Include ggc.h. + (rtvec_alloc): Use ggc_alloc_rtvec when GC'ing. + (rtx_alloc): Use ggc_alloc_rtx when GC'ing. + (rtx_free): Don't call obstack_free when GC'ing. + * toplev.c (rest_of_compilation): Call ggc_collect after every + pass, if GC'ing. + * tree.c (push_obstacks): Do nothing, if GC'ing. + (pop_obstacks_nochange): Likewise. + (pop_obstacks): Likewise. + (make_node): Use ggc_alloc_tree when GC'ing. + (copy_node): Likewise. + (get_identifier): Use ggc_alloc_string when GC'ing. + (build_string): Likewise. + (make_tree_vec): Use ggc_alloc_tree when GC'ing. + (tree_cons): Likewise. + (build1): Likewise. + (type_hash_canon): Don't call obstack_free when GC'ing. + +Sat Sep 4 21:52:32 1999 Richard Henderson + + * haifa-sched.c (schedule_block): Use next_nonnote_insn instead + of NEXT_INSN when examining speculative insns for SCHED_GROUP_P. + +Sat Sep 4 20:40:19 1999 Richard Henderson + Bernd Schmidt + Mark Mitchell + + * Makefile.in (stor-layout.o): Depend on ggc.h. + (expr.o): Depend on ggc.h. + (profile.o): Depend on ggc.h. + (stor-layout.o): Depend on ggc.h. + * emit-rtl.c (init_emit_once): Add gc roots. + * expr.c: Include ggc.h. + (emit_block_move): Add gc roots. + (clear_storage): Likewise. + * expr.h (init_stor_layout_once): New function. + * profile.c: Include ggc.h. + (init_arc_profiler): profiler_label is a root. + * scan.c (make_sstring_space): Trust xrealloc to function + correctly with first parameter NULL. + * stor-layout.c: Include ggc.h. + (set_sizetype): Add gc root. + (init_stor_layout_once): New function. + * toplev.c (compile_file): Call it. + +Sat Sep 4 19:26:25 1999 Richard Henderson + Bernd Schmidt + Mark Mitchell + + * Makefile.in (tree.o): Depend on ggc.h. + (varasm.o): Likewise. + (function.o): Likewise. + (stmt.o): Likewise. + (except.o): Likewise. + (optabs.o): Likewise. + (emit-rtl.o): Likewise. + * emit-rtl.c: Include ggc.h. + (sequence_element_free_list): Remove, and all references. + (mark_sequence): New functions. + (mark_emit_state): New function. + * except.c: Include ggc.h. + (mark_eh_node, mark_eh_stack, mark_eh_queue): New functions. + (mark_tree_label_node): New functions. + (mark_eh_state): New function. + * function.c: Include ggc.h. + (mark_temp_slot, mark_function_chain): New functions. + (mark_function_state): New function. + (init_function_once): New function. + * function.h (init_function_once): New function. + * ggc-callbacks.c (lang_mark_false_label_stack): New function. + * ggc.h (label_node): Declare. + (eh_status, emit_status, stmt_status, varasm_status): Likewise. + (lang_mark_false_label_stack): New function. + (mark_temp_slot): Remove declaration. + (mark_function_chain): Likewise. + (mark_eh_state): Adjust prototype. + (mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab): + Likewise. + * optabs.c: Include ggc.h. + (mark_optab): New function. + (init_optabs): Add gc roots. + * stmt.c: Include ggc.h. + (mark_cond_nesting, mark_loop_nesting): New functions. + (mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise. + (mark_stmt_state): New function. + * toplev.c (compile_file): Call init_function_once. + * tree.c: Include ggc.h. + (type_hash): Move declaration earlier in file. + (TYPE_HASH_SIZE, type_hash_table): Likewise. + (init_obstacks): Add gc roots. + (mark_type_hash): New function. + * varasm.c: Include ggc.h. + (mark_pool_constant): New function. + (mark_varasm_state): New function. + +Sat Sep 4 22:28:56 1999 Kaveh R. Ghazi + + * ggc-simple.c (ggc_root, ggc_collect): Wrap prototype with PROTO. + +Sat Sep 4 18:01:45 1999 Bernd Schmidt + + * c-decl.c (struct language_function): Renamed from struct c_function. + Delete elt NEXT. + (c_function_chain): Delete. + (push_c_function_context): New arg F. Don't warn about nested + functions here. Fill LANGUAGE elt of F. Delete code to update + c_function_chain. Don't call push_function_context. + (pop_c_function_context): New arg F. Restore from there instead of + from c_function_chain. Don't call pop_function_context. Clear out + LANGUAGE field of F when done. + * c-lang.c: Include "function.h" + (lang_init): Initialize save_lang_status and restore_lang_status. + * c-parse.in (nested_function, nested_function_notype): Warn about + nested functions. Call push_function_context/pop_function_context + instead of the _c_ variants. + * c-tree.h (push_c_function_context, pop_c_function_context): Update + prototype. + * Makefile.in (c-lang.o): Update dependencies. + + * emit-rtl.c (init_emit): Use xmalloc to allocate regno_reg_rtx, + regno_pointer_flag, regno_pointer_align. + (gen_reg_rtx): Use xrealloc to enlarge them. + (free_emit_status): New function. + * function.c (mark_machine_status, mark_lang_status): New variables. + (assign_stack_local_1): Renamed from assign_outer_stack_local. Merge + in some bits from assign_stack_local. All callers changed to use new + name. + (assign_stack_local): Just call assign_stack_local_1. + (free_after_compilation): New function. + (put_reg_into_stack): Simplify to always call assign_stack_local_1. + (trampoline_address): Likewise. + (assign_parms): Use xcalloc/xrealloc to allocate parm_reg_stack_loc. + (prepare_function_start): Explicitly clear some more variables. + * function.h (struct function): New elt can_garbage_collect. + (mark_machine_status, mark_lang_status): Declare variables. + (free_after_compilation, free_emit_status, free_varasm_status, + init_varasm_status): Declare functions. + * toplev.c (rest_of_compilation): Call free_after_compilation when + done with the current function. + * varasm.c (free_varasm_status): New function. + +Sat Sep 4 17:15:13 1999 Richard Henderson + + * sparc.h (EXPAND_BUILTIN_VA_START): Define. + (EXPAND_BUILTIN_VA_ARG): Define. + * sparc.c (sparc_va_start): New. + (sparc_va_arg): New. + +Sun Sep 5 11:11:59 1999 Michael Hayes + + * config/c4x/c4x.h (DBR_OUTPUT_SEQEND): Use XVECEXP not XEXPs. + +Sun Sep 5 10:13:19 1999 Michael Hayes + + * config/c4x/c4x.h (CALLER_SAVE_PROFITABLE): Disable. + +Sat Sep 4 13:44:01 1999 Mark Mitchell + + * Makefile.in (C_AND_C_OBJS): Add gcc-callbacks.o. + (OBJS): Add $(GGC). + (ggc-callbacks.o): New target. + * ggc-callbacks.c: New file. + +Sat Sep 4 22:53:13 1999 Bernd Schmidt + + * expr.h: Collapse individual optab and libfunc vars to arrays. + (optab_index, libfunc_index): New enumerations. + (optab_table, libfunc_table): New arrays. + Add accessor macros for both. + + * optabs.c (optab_table, libfunc_table): New. + Delete declarations for individual optab and libfunc vars. + +Sat Sep 4 12:57:17 1999 Richard Henderson + + * i386/sco5.h (RETURN_POPS_ARGS): Name change ix86_return_pops_args. + +Sat Sep 4 11:19:52 1999 Richard Henderson + + * Makefile.in (GGC, GGC_LIB): New. + (HOST_RTL): Include ggc-none.o. + (ggc-simple.o): New target. + (ggc-none.o): Likewise. + * tree.h (tree_common): Add gc_mark. + * rtl.h (struct rtx_def): Steal a bit from code to make gc_mark. + (struct rtvec_def): Add gc_mark. + * emit-rtl.c (global_rtl): Update static initializers to contain + enough initializers. + * ggc.h, ggc-none.c, ggc-simple.c: New files. + * toplev.c (gc_time): New variable. + (all_time): New variable. + (compile_file): Print gc time. + (print_time): Calculate percentage of the whole. + +Sat Sep 4 13:11:01 1999 Bernd Schmidt + + Change obstack memory management and varasm constant pool handling so + that nested functions are treated like any other functions. + * function.c (init_machine_status): New variable. + (push_function_context_to): Set contains_functions for the outer + function. Don't call save_varasm_status. + (pop_function_context_from): Don't call restore_varasm_status. Don't + set current_function_contains_functions. + (prepare_function_start): Call init_varasm_status rather than + init_const_rtx_hash_table. Call (*init_machine_status) if the pointer + is non-null. + * function.h (struct function) Add field varasm. Delete fields + inline_obstacks, inl_emit, const_rtx_hash_table, first_pool, + last_pool, const_rtx_sym_hash_table, pool_offset, const_double_chain. + (init_machine_status): Declare. + (save_varasm_status, restore_varasm_status): Delete declarations. + (save_tree_status, restore_tree_status): Delete last argument. + * integrate.c (initialize_for_inline): Lose arg COPY. Delete copying + code. All callers changed. + (copy_decl_list, copy_decl_tree, copy_decl_rtls, copy_for_inline, + save_constants_in_decl_trees, restore_constants, save_constants, + save_for_inline_eh_labelmap, save_for_inline_copying): Delete + functions. + (inlining): New variable. + (reg_map, label_map, insn_map, orig_asm_operands_vector, + copy_asm_operands_vector, copy_asm_constraints_vector): Delete + variables. + (save_for_inline_nocopy): Don't save constants. + Don't set inl_emit field in current_function. + (expand_inline_function): Use emit field, not inl_emit, of the inlined + function. Set new variable inlining before + calling copy_rtx_and_substitute. + (copy_rtx_and_substitute): In MEM and SYMBOL_REF cases, handle + constant pool references if inlining is nonzero. + Delete ADDRESS and (most of the) CONST cases. + (output_inline_function): Save and restore current_function/ + current_function_decl. Delete restore_constants code. Don't call + init_const_rtx_hash_table. + * output.h (init_const_rtx_hash_table): Don't declare. + * rtl.h (struct function): Declare. + (get_pool_constant_for_function, get_pool_mode_for_function): Declare. + * toplev.c (rest_of_compilation): Don't treat nested functions or + functions containing them specially. Delete all code to deal with + save_for_inline_copying. + * tree.c (toplev_inline_obstacks, extra_inline_obstacks, + inline_obstacks): Delete variables. + (save_tree_status): Lose arg CONTEXT. All callers changed. + Simply allocate a new function_maybepermanent_obstack for the new + function, delete all the special cases. + Don't save inline_obstacks. + (restore_tree_status): Lose arg CONTEXT. All callers changed. + Delete special handling for function_maybepermanent_obstack; simply + free it if empty. + Don't restore inline_obstacks. + (permanent_allocation): Delete code that frees inline_obstacks. + (print_inline_obstack_statistics): Delete function. + (dump_tree_statistics): Don't call it. + * varasm.c (struct varasm_status): New. + (const_rtx_hash_table, const_rtx_sym_hash_table, first_pool, + last_pool, pool_offset, const_double_chain): Delete global + variables, replace with accessor macros. + (immed_double_const): Don't walk const_double_chain outside a + function, but don't treat nested functions specially anymore. + (immed_real_const_1): Likewise. + (clear_const_double_mem): Don't treat nested functions specially. + (init_const_rtx_hash_table): Deleted, code moved to init_varasm_status. + (save_varasm_status, restore_varasm_status): Delete functions. + (init_varasm_status): New function. + (force_const_mem): Don't treat nested functions specially. + (find_pool_constant): Accept new arg F, search for constants in + that function's pool rather than the current one. All callers + changed. + (get_pool_constant_for_function, get_pool_mode_for_function): New + functions. + + * i386.c (init_386_machine_status): New function, mostly from + clear_386_stack_locals. + (struct machine_functions): Rename element names to avoid name + clashes. + (pic_label_rtx, pic_label_name, i386_stack_locals): New accessor + macros, replacing global variables. + (clear_386_stack_locals, save_386_machine_status, + restore_386_machine_status): Delete functions. + (override_options): Initialize init_machine_status. + * i386.h (INIT_EXPANDERS): Delete macro. + (save_386_machine_status, restore_386_machine_status, + clear_386_stack_locals): Delete declarations. + +Sat Sep 4 16:56:28 1999 Michael Hayes + + * config/c4x/c4x.md (rptb_init): Renamed from *rptb_init. + (doloop_begin): Simplify pattern and use emit_jump_insn. + (doloop_end): Simplify pattern, switch operand order, + and use emit_jump_insn. + +Fri Sep 3 19:02:38 1999 Bernd Schmidt + + * function.h (struct function): Add new element LANGUAGE. + (save_lang_status): Declare new variable. + (restore_lang_status): Likewise. + * function.c (save_lang_status): Define. + (restore_lang_status): Likewise. + (push_function_context_to): Call language-specific save function. + (pop_function_context_from): Call language-specific restore function. + +Fri Sep 3 01:16:18 1999 Alasdair Baird + + * i386.md (movsf_1): Check REG_P before use of REGNO. + (movdf_1): Likewise. + (movxf_1): Likewise. + (extendsfdf2): Likewise. + (extendsfxf2): Likewise. + (extenddfxf2): Likewise. + +Sat Sep 4 11:37:15 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_emit_move_sequence): Do not force large + constants into memory. + (c4x_shiftable_constant): New function. + * config/c4x/c4x.c (LEGITIMATE_CONSTANT_P): Allow any CONST_INT. + (c4x_shiftable_constant): Declare. + * config/c4x/c4x.md (loadqi_big_constant, loadhi_big_constant, + ashlqi3_noclobber): Add new patterns and associated splitters. + +Fri Sep 3 16:22:17 1999 Richard Henderson + + * dbxout.c (dbxout_init): Use xcalloc instead of xmalloc+bzero. + * dwarf2out.c (dwarf2out_frame_init): Likewise. + * final.c (shorten_branches): Likewise. + * global.c (global_alloc): Likewise. + * haifa-sched.c (build_control_flow): Likewise. + * stmt.c (check_for_full_enumeration_handling): Likewise. + (estimate_case_costs): Likewise. + +Fri Sep 3 15:49:56 1999 Mark Mitchell + + * rtl.h (RTL_CHECKC2): Fix typo in last change. + +Fri Sep 3 15:13:34 1999 Richard Henderson + + * flow.c (propagate_block): Use XEXP not SET_DEST for a USE. + (recompute_reg_usage): Likewise. + * rtlanal.c (find_regno_fusage): Likewise. + + * rtl.c (rtl_check_failed_code1): New function. + (rtl_check_failed_code2): New. + * rtl.h (RTL_CHECK1, RTL_CHECK2, RTVEC_ELT): Parenthesize args. + (RTL_CHECKC1, RTL_CHECKC2): New. + (XC*): New accessor macros. + (NOTE_*, LABEL_NAME, LABEL_NUSES, ADDRESSOF_REGNO): Use them. + (ADDRESSOF_DECL, JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF): Likewise. + (CONTAINING_INSN, REGNO, INTVAL, SUBREG_REG, SUBREG_WORD): Likewise. + (ASM_OPERANDS_*, MEM_ALIAS_SET, SET_SRC, SET_DEST): Likewise. + (TRAP_*, RANGE_INFO_*): Likewise. + +Fri Sep 3 15:10:20 1999 Kaveh R. Ghazi + + * Makefile.in (tlink.o): Don't depend on toplev.h. + + * collect2.c (c_file, o_file, export_file, import_file, ldout, + output_file, nm_file_name, ldd_file_name, strip_file_name, + c_file_name, prefix_list, libexts, is_ctor_dtor, find_a_file, + add_prefix, prefix_from_env, prefix_from_string, do_wait, + fork_execute, maybe_unlink, add_to_list, + extract_init_priority, write_list, dump_list, + dump_prefix_list, write_list_with_asm, write_c_file, + write_c_file_stat, write_c_file_glob, scan_prog_file, + scan_libraries, is_in_list, resolve_lib_name, use_import_list, + ignore_library, extract_string, notice, dump_file, target_machine, + collect_wait, collect_execute, libname, locatelib, aix_std_libs, + read_file, print_load_command): Constify a char*. + (fdopen, error, fatal, fatal_perror): Don't prototype. + (my_strerror): Remove. All callers use xstrerror instead. + (xcalloc, xmalloc, xrealloc, xstrdup, putenv): Remove definitions. + (main): Add prototype. Constify lots of char* ptrs. Change calls + to xcalloc/strcpy/strcat/... to one call to concat. + (main, scan_prog_file, scan_libraries): Use an intermediate + `const char **' to build an argv array. + (mapfile, libselect, libcompare, locatelib): Add prototypes. + + * collect2.h (collect_execute, collect_wait, dump_file, + file_exists): Constify a char*. + (ldout, c_file_name, temporary_obstack, permanent_obstack, + temporary_firstobj, vflag, debug): Add extern declarations. + (fancy_abort, error, notice, fatal, fatal_perror): Add prototypes. + + * tlink.c: Don't include toplev.h. + (vflag, debug, ldout, c_file_name, temporary_obstack, + permanent_obstack, temporary_firstobj): Don't declare. + (tlink_execute, frob_extension, symbol_hash_lookup, + file_hash_lookup, demangled_hash_lookup, tlink_init, freadsym, + recompile_files, read_repo_files, demangle_new_symbols, + scan_linker_output): Constify a char*. + (symbol_hash_newfunc, file_hash_newfunc, demangled_hash_newfunc, + do_tlink): Mark parameters with ATTRIBUTE_UNUSED. + +Fri Sep 3 18:09:24 1999 Andrew Haley + + * config/m68k/m68kelf.h: Set USE_GAS; this makes gcc generate jbsr + (relative) rather than jsr (absolute) subroutine call insns. + * config/m68k/m68k-coff.h: Ditto. + +Fri Sep 3 17:24:31 1999 Richard Earnshaw + + * arm.c (note_invalid_constants): No need to ignore ASMs, we can + now rework these too. + (arm_reorg): If an insn can't reach the end of the current pool, + ensure that we emit that pool before the insn. + +Fri Sep 3 09:14:32 1999 Marc Espie + + * tlink.c (scan_linker_output): Skip the initial underscore in + a mangled name if appropriate. + +Fri Sep 3 01:28:33 1999 Kaveh R. Ghazi + + * objc/objc-act.c (objc_tree_code_type, objc_tree_code_length, + objc_tree_code_name, synth_id_with_class_suffix, warn_with_method, + error_with_ivar, gen_declarator, create_builtin_decl, + my_build_string, generate_descriptor_table, generate_ivars_list, + generate_dispatch_table, check_protocols, TAG_GETCLASS, + TAG_GETMETACLASS, TAG_MSGSEND, TAG_MSGSENDSUPER, TAG_EXECCLASS, + dump_base_name, lang_decode_option, build_encode_expr, + start_class, finish_class, encode_pointer, really_start_method, + gen_declaration, dump_interface, handle_class_ref, handle_impent): + Constify. + (objc_demangle, objc_printable_name, generate_struct_by_value_array): + Add static prototypes. + (build_objc_string_decl, build_selector_reference_decl, + encode_bitfield, build_class_reference_decl): Remove unused + parameter, all callers changed. + (maybe_objc_method_name): Mark with ATTRIBUTE_UNUSED. + (objc_printable_name): Likewise. Change second parameter to type int. + (init_objc): Use memcpy, not bcopy, to avoid casts. + +Thu Sep 2 21:49:52 1999 Richard Henderson + + * reload1.c (eliminate_regs_in_insn): Avoid eliminating the + reg notes on a deleted insn. + * gcse.c (hash_expr_1): Use XWINT on a CONST_DOUBLE. + +Thu Sep 2 20:18:12 1999 Jeffrey A Law (law@cygnus.com) + + * i386.c (ix86_attr_length_default): Handle TYPE_FXCH. + +Thu Sep 2 22:00:08 1999 J"orn Rennecke + + * stmt.c (expand_asm_operands): Fix index into inout_mode when + reading it. + +Thu Sep 2 13:00:48 1999 Richard Henderson + + * stmt.c (expand_asm_operands): Invoke MD_ASM_CLOBBERS if present. + * tm.texi (MD_ASM_CLOBBERS): Document it. + +Thu Sep 2 10:22:40 1999 Richard Henderson + + * dwarf2out.c (dwarf2out_line): Constify `lastfile'. + * except.c (expand_rethrow): Remove unused variable. + * expr.c (do_jump_by_parts_greater_rtx): Likewise. + * flow.c (replace_insns): Likewise. + (create_edge_list, verify_edge_list): Likewise. + * gcse.c (cprop_cc0_jump): Protect declaration with HAVE_cc0. + + * genemit.c (gen_expand): Only emit `operands[N]' decl if there + is special code to run. + (main): Don't define operands to emit_operand. + * genrecog.c (main): Don't emit an empty peephole2_insn function. + + * rtl.h (NOTE_BASIC_BLOCK): Use X0BBDEF. + + * alpha/alpha.h (normal_memory_operand): Declare. + (reg_no_subreg_operand): Declare. + * alpha/elf.h (ASM_DECLARE_OBJECT_NAME): Use HOST_WIDE_INT_PRINT_DEC. + +Thu Sep 2 10:19:20 1999 Richard Henderson + + * c-parse.in (compstmt_primary_start): New, broken out of first + part of compstmt handling in primary. + (primary): Use it. Add an error clause. + (compstmt_nostart): Renamed from compstmt; remove all + initial invocations of compstmt_start. + (compstmt): New. + +Thu Sep 2 01:35:50 1999 Marc Espie + + * protoize.c (gen_aux_info_file): Let pexecute call choose_temp_base if + needed. + +Thu Sep 2 00:43:59 1999 Finn Hakansson + + * combine.c (simplify_shift_const): Remove extra semicolon. + * dwarf2out.c (remove_AT): Likewise. + * expmed.c (expand_mult): Likewise. + * gcov.c (create_program_flow_graph): Likewise. + * reorg.c (mostly_true_jump): Likewise. + +Thu Sep 2 00:06:43 1999 Jeffrey A Law (law@cygnus.com) + + * fold-const.c (fold_range_test): Do not try to fold the range + test if the rhs or lhs has side effects. + + * combine.c (simplify_rtx): Recognize another case of a synthesized + sign extension. + + * varasm.c (mark_constant_pool): When marking indirect references, + only look at SYMBOL_REFs. + + * except.c (expand_fixup_region_end): Do not peek at + INSN_UID (node->entry->outer_context) for flag_new_exceptions. + +Thu Sep 2 13:52:53 1999 Geoffrey Keating + + * flags.h: New variables align_loops, align_loops_log, + align_jumps, align_jumps_log, align_labels, align_labels_log, + align_functions, align_functions_log. + * toplev.c: Define them. + (f_options): Handle -falign-* when they have no argument. + (main): Add logic to set variables for -falign-functions, + -falign-jumps, -falign-labels, -falign-loops. + Make it -fsched-verbose= and -finline-limit=. + (display_help): Change help to match options. + * final.c (LABEL_ALIGN): Default to align_labels_log. + (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. + (LOOP_ALIGN): Default to align_loops_log. + (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. + (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. + (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. + * varasm.c (assemble_start_function): Handle align_functions. + + * config/sparc/sparc.h: Don't declare sparc_align_*. + Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. + (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into + sparc.c. + (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, + it's a promise. + * config/sparc/sparc.c: Delete sparc_align_loops, + sparc_align_jumps, sparc_align_funcs and the corresponding string + variables. + (sparc_override_options): Default align_functions on ultrasparc. + Delete -malign-* handling. + + * config/mips/mips.c (override_options): On 64-bit targets, + try to align code to 64-bit boundaries. + (print_operand): New substitution, %~, + which aligns labels to align_labels_log. + * config/mips/mips.md (div_trap_normal): Use %~. + (div_trap_mips16): Likewise. + (abssi): Likewise. + (absdi2): Likewise. + (ffssi2): Likewise. + (ffsdi2): Likewise. + (ashldi3_internal): Likewise. + (ashrdi3_internal): Likewise. + (lshrdi3_internal): Likewise. + (casesi_internal): Likewise. + +Wed Sep 1 21:13:48 1999 Richard Henderson + + Merge new ia32 backend from the branch! + + * i386.h, i386.c, i386.md, reg-stack.c, i386/unix.h: Many changes. + See ChangeLog.P2 on new_ia32_branch for details. + + * rtl.h (stack_regs_mentioned_p): Delete prototype. + * i386/cygwin.h (SUBTARGET_PROLOGUE): No more do_rtl. + * i386/win32.h (SUBTARGET_PROLOGUE): Likewise. + * i386/gas.h (ASM_FILE_START): Define. + * i386/winnt.c (i386_pe_valid_decl_attribute_p): Update + for name change of ix86_valid_decl_attribute_p. + (i386_pe_valid_type_attribute_p): Similarly. + +Wed Sep 1 18:21:23 1999 Richard Henderson + + * emit-rtl.c (init_emit_once): Don't use GET_MODE_WIDER_MODE + to step through CC modes. + +Wed Sep 1 20:18:06 1999 J"orn Rennecke + + * regmove.c (fixup_match_1): Don't move INSN in front of P if + it would end up in the shadow of a live flags regsiter. + +Wed Sep 1 11:32:00 1999 Bernd Schmidt + + * reload1.c: Fix many indentation problems. + * reload.c: Likewise. + +Tue Aug 31 22:08:03 1999 Marc Espie + + * alias.c (non_local_reference_p): Constify fmt. + +Tue Aug 31 23:19:35 1999 Michael Meissner + + * config/i386/xm-cygwin.h (HAVE_DOS_BASED_FILE_SYSTEM): Define. + +Tue Aug 31 16:44:52 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (delete_trivially_dead_insns): Do not delete stores to + the internal_arg_pointer. + +Tue Aug 31 13:35:42 1999 Richard Henderson + + Merge peephole2 from new_ia32_branch: + * Makefile.in (STAGESTUFF): Add *.peephole2. + (mostlyclean): Likewise. + (recog.o): Depend on resource.h. + + * final.c (peephole): Conditionalize decl on HAVE_peephole. + (final_scan_insn): Likewise for the invocation of peephole. + * genconfig.c (main): Look for peephole and peephole2 patterns. + Emit HAVE_peephole* accordingly. + * genpeep.c (main): Conditionalize entire output on HAVE_peephole. + * flags.h (flag_peephole2): Declare. + * toplev.c: New pass peephole2. New flag -fpeephole2. + + * genattrtab.c (main): Count DEFINE_PEEPHOLE2. + * gencodes.c (main): Likewise. + * genextract.c (main): Likewise. + * genoutput.c (main): Likewise. + * genemit.c (max_operand_1): Look for the max scratch operand. + (gen_rtx_scratch): New. + (gen_exp): Use it, and pass on new arg subroutine_type. + (gen_expand): Take max scratch into account. + (gen_split): Emit peephole2 functions. + (output_peephole2_scratch): New. + (main): Include hard-reg-set.h and resource.h. Handle peephole2. + * genrecog.c (routine_type): Add PEEPHOLE2. + (IS_SPLIT): New. + (make_insn_sequence): Match outer parallel for peep2. Discard + top level scratches and dups. + (add_to_sequence): New args insn_type and top. Update all callers. + Handle toplevel peep2 matching insns. + (write_subroutine): Handle peep2. + (write_tree_1): Likewise. + (write_tree): Likewise. + (main): Likewise. + (change_state): New arg afterward. Update all callers. + Handle matching separate insns. + * recog.c (recog_next_insn): New. + (peephole2_optimize): New. + * rtl.def (DEFINE_PEEPHOLE2): New. + * resource.c (find_free_register): New argument last_insn. Use it + to find a register available through the entire span. + * resource.h (find_free_register): Update prototype. + +Tue Aug 31 11:51:06 1999 Jim Kingdon + + * i386.c (output_strlen_unroll): Don't write xops[7] + label if it wasn't set. + +1999-08-31 12:44 -0700 Zack Weinberg + + * cpplib.c (struct directive): Const-ify name pointer and + function pointer prototype. + (validate_else, do_define, do_line, do_include, do_undef, + do_error, do_pragma, do_ident, do_if, do_xifdef, do_else, + do_elif, do_endif, do_sccs, do_assert, do_unassert, + do_warning): Const-ify second arg. + (directive_table): Mark const. Reorder entries by frequency + of usage, record statistics. + +1999-08-31 12:20 -0700 Zack Weinberg + + * rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and + bounds- check RTL accesses if --enable-checking. + (RTVEC_ELT): Bounds check if --enable-checking. + (XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE, + XBBDEF): Use RTL_CHECK1/RTL_CHECK2 as appropriate. + (XVECEXP, XVECLEN): Define in terms of XVEC, RTVEC_ELT, and + GET_NUM_ELEM. + (X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE, + X0BBDEF, X0ADVFLAGS): New macros for accessing '0' slots of RTXes. + + (ADDR_DIFF_VEC_FLAGS): Use X0ADVFLAGS. + (NOTE_SOURCE_FILE): Use X0STR. + (NOTE_BLOCK_NUMBER, NOTE_EH_HANDLER, LABEL_NUSES, + MEM_ALIAS_SET): Use X0INT. + (NOTE_RANGE_INFO, NOTE_LIVE_INFO, NOTE_BASIC_BLOCK, + JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, CONTAINING_INSN): + Use X0EXP. + * real.h (CONST_DOUBLE_CHAIN): Use X0EXP. + * rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots with X0WINT. + (rtl_check_failed_bounds, rtl_check_failed_type1, + rtl_check_failed_type2, rtvec_check_failed_bounds): New + functions. + (fancy_abort): Fix comment. + + * cse.c (canon_hash): Read CONST_DOUBLE data slots with XWINT. + (cse_insn): Decrement LABEL_NUSES for jump target before + deleting jump insn. + * emit-rtl.c (gen_rtx_CONST_DOUBLE): Use X0EXP for slot 1. + * final.c (alter_subreg): Compute regno before changing x to + REG; set REGNO(x) after changing it. + * flow.c (count_basic_blocks): Use XWINT to inspect EH_REGION + notes containing CONST_INTs. + (delete_eh_regions): Use NOTE_EH_HANDLER. + * function.c (put_reg_into_stack): Make reg a MEM before + initializing it. + (fixup_var_refs_insns): Save REG_NOTES (insn) in case we + delete insn. + (gen_mem_addressof): Make reg a MEM before initializing it. + * integrate.c (copy_rtx_and_substitute): Copy '0' slots with + X0WINT. + * local-alloc.c (update_equiv_regs): Zap REG_NOTES before + deleting an insn, not after. + (block_alloc): Only look at PATTERN(insn) if we have to, and + only if it's format class 'i'. + * loop.c (check_dbra_loop): Check bl->biv->add_val is a + CONST_INT before using its INTVAL. + * print-rtl.c (print_rtx): Use X0STR. + * regmove.c (fixup_match_1): Don't look at PATTERN of + non-class-'i' insn chain elements. + * reload.c (loc_mentioned_in_p): Take address of + in->fld[1].rtx directly. + * reload1.c (reload): Change reg to a MEM before initializing + it. + * varasm.c (mark_constant_pool): Skip CONST_DOUBLES, which + have no names. + * config/i386/i386.md (decrement_and_branch_if_zero): Fix typo. + +Fri Aug 20 13:43:41 1999 Andrew Haley + + * config/mips/mips.c (machine_dependent_reorg): Force a + barrier to output the local constant pool if a barrier hasn't + been found at a natural point in the instruction stream. + +Mon Aug 30 22:04:36 1999 Kaveh R. Ghazi + + * c-parse.in (language_string): Constify. + + * dwarf2out.c (language_string): Remove declaration. + + * dwarfout.c (language_string): Likewise. + + * toplev.c (language_string, init_parse, finish_parse): Likewise. + + * tree.h (language_string, init_parse, finish_parse): Declare. + + * i386/sun386.h (language_string): Remove declaration. + + * mips.h (language_string): Likewise. + + * nextstep.h (language_string): Likewise. + + * nextstep21.h (language_string): Likewise. + + * rs6000.c (language_string): Likewise. + +Mon Aug 30 20:56:08 1999 Kaveh R. Ghazi + + * Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o. + (getpwd.o): Remove target. + + * getpwd.c: Delete file. Its in libiberty now. + + * dbxout.c (getpwd): Don't prototype. + * dwarf2out.c (getpwd): Likewise + * dwarfout.c (getpwd): Likewise + * final.c (getpwd): Likewise. + * protoize.c (getpwd): Likewise. + +Mon Aug 30 20:21:34 1999 Kaveh R. Ghazi + + * cse.c: (fold_rtx): Cast to HOST_WIDE_INT in left shift. + +Mon Aug 30 16:07:49 1999 Richard Henderson + + * flow.c (new_insn_dead_notes): Use sets_reg_or_subreg not + mark_set_resources. + +Mon Aug 30 12:23:53 1999 Jim Wilson + + * fixinc/Makefile.in (subdir): New. + (fixincl.x, inclhack.sh, fixincl.sh): Use cp instead of $(CP). + (Makefile): New. + +Mon Aug 30 01:02:09 1999 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (copy_rtx_if_shared): A MEM which references + virtual_stack_vars_rtx or virtual_incoming_args_rtx can not + be shared. + + * invoke.texi: Fix typo. + + * dwarf2out.c (mem_loc_descriptor): New argument MODE. All callers + changed. Handle autoincrement addressing modes. + + * integrate.c (copy_rtx_and_substitute): Handle internal_arg_pointer + just like we would the virtual incoming args register when + integrating. + +Sun Aug 29 23:17:54 1999 David Edelsohn + + * rs6000.h (ASM_FILE_START): Specify complete filename, including + path, in .file directive. + +Sun Aug 29 05:06:43 1999 Russ Allbery + + * gcc.texi (External Bugs): Remove obsolete note about Perl on + SunOS. + +1999-08-29 08:38 -0700 Zack Weinberg + + * stdbool.h: Make the typedef name _Bool, with bool a #defined + alias. + +Sun Aug 29 09:36:50 1999 Kaveh R. Ghazi + + * tree.c (tree_code_name): Constify a char*. + + * tree.h (tree_code_name, decl_printable_name): Likewise. + + * function.h (struct function): Likewise. + + * toplev.c (decl_name, decl_printable_name): Likewise. + + * vax/vms.h (MAYBE_VMS_FUNCTION_PROLOGUE): Likewise. + + * objc/objc-act.c (decl_printable_name): Remove redundant prototype. + (init_objc): Remove function pointer cast. + +Sun Aug 29 05:01:17 1999 John David Anglin + + * pa.md (interspace_jump): New pattern. + (builtin_longjmp): New expander. + +1999-08-29 Bernd Schmidt + + * fp-bit.c (add, sub, multiply, divide, compare, _eq_f2, _ne_f2, + _gt_f2, _ge_f2, _lt_f2, _le_f2, float_to_si, float_to_usi, negate, + sf_to_df, df_to_sf): Fix potential problem with alias analysis. + +Sun Aug 29 04:30:52 1999 John Wehle (john@feith.com) + + * jump.c (delete_prior_computation): Also check calls + to constant functions. Don't bother checking for a + REG_UNUSED note before adding it. + (delete_computation): Handle multi-word hard registers + when synthesizing missing REG_DEAD notes for a register + which is both set and used by an insn. + +1999-08-29 Michael Hayes + + * loop.c (this_loop_info): New variable. + (loop_has_call, loop_has_volatile, loop_has_tablejump, + loop_continue, loops_enclosed): Replace with fields in this_loop_info. + All uses updated. + (prescan_loop, strength_reduce): New argument loop_info. All callers + updated. + (scan_loop): New variable loop_info, initialize to address of + this_loop_info. + (prescan_loop): Set loop_info->vtop if find NOTE_INSN_LOOP_VTOP. + Delete variable loop_has_multiple_exit targets and replace with + field in this_loop_info. + (find_and_verify_loops): Rename this_loop to this_loop_num. + (strength_reduce): Delete loop_iteration_info. Replace variable + loop_info with function argument of same name. + (insert_bct): Rework test for loop being completely unrolled. + + * loop.h (struct loop_info): New fields num, loops_enclosed, + has_call, has_volatile, has_tablejump, has_multiple_exit_targets, + has_indirect_jump, and cont. Redefine use of unroll_number. + (loop_unroll_number): Delete. + + * unroll.c (unroll_loop): Store loop unroll count in unroll_number + field of loop_info. + (loop_iterations): Delete variable vtop and instead use + loop_info->vtop computed in prescan_loop. + +Sun Aug 29 03:27:23 1999 Scott Weikart + + * fix-header.c (main): Do not pass a null pointer to strcmp. + +Sun Aug 29 03:18:48 1999 William Bader (william@nscs.fast.net) + + * configure.in (i[34567]86-*-sco3.2v4*): Target does not truncate + filenames. + * configure: Rebuilt. + +Sat Aug 28 19:36:05 1999 Jeffrey A Law (law@cygnus.com) + + * jump.c (jump_optimize_1): Do not delete assignments to + internal_arg_pointer. + * cse.c (delete_trivially_dead_insns): Always consider a set of + the internal_arg_pointer live. + +Sat Aug 28 16:24:31 1999 Richard Henderson + + * flow.c (flow_delete_insn_chain): Rename from delete_insn_chain. + (update_life_info) [REG_WAS_0]: Search the original insns rather + than the new insns for the note. Fix typos finding note_dest. + If no dest found, discard the note rather than abort. + [REG_NOALIAS]: Handle as REG_NO_CONFLICT. + (replace_insns): Remove the old insn list after update_life_info + not before. + +Sat Aug 28 16:20:12 1999 Richard Henderson + + * haifa-sched.c (sched_analyze): Clear LOG_LINKS before calling + sched_analyze_insn. + (sched_analyze_1): Let add_dependence care for not adding dups. + (sched_analyze_2): Likewise. + (add_branch_dependences): Likewise. + +Sat Aug 28 15:58:16 1999 Mumit Khan + + * i386/winnt.c (export_list): New type. + (exports_head): Rename to + (export_head): this. + (i386_pe_record_exported_symbol): Add is_data flag. + (i386_pe_asm_file_end): Emit directive for exported variables. + * i386/cygwin.h (i386_pe_record_exported_symbol): Update + prototype. + * i386/cygwin.h (ASM_OUTPUT_COMMON): Specify symbol type. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + * i386/uwin.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + +Fri Aug 27 15:35:24 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (fold_rtx): Work around bug in Sun V5.0 compilers. + + * pa.c (emit_move_sequence): Do not stop on SUBREG_WORD of an + operand. + +Fri Aug 27 14:01:19 1999 Marc Espie + + * config/openbsd.h: Define SET_ASM_OP. + * tm.texi: cross-reference SET_ASM_OP in the index. + +1999-08-27 13:27 -0700 Zack Weinberg + + * rtl.c: Define CONST_DOUBLE_FORMAT to the appropriate format + for a CONST_DOUBLE, at compile time. Initialize rtx_length + and class_narrowest_mode at compile time. Kill init_rtl. + Mark rtx_length, mode_class, mode_size, mode_unit_size, + mode_wider_mode, mode_mask_array, class_narrowest_mode, and + rtx_format as const. Kill all references to EXTRA_CC_MODES or + EXTRA_CC_NAMES. + * rtl.def (CONST_DOUBLE): Use CONST_DOUBLE_FORMAT macro for + format. + * rtl.h: Declare rtx_length and rtx_format as const. + * machmode.def: Define CC(). Use CC() to define CCmode. If + EXTRA_CC_MODES is defined, expand it here. + * machmode.h: Declare mode_class, mode_size, mode_unit_size, + mode_wider_mode, mode_mask_array, and class_narrowest_mode as + const. Kill all references to EXTRA_CC_MODES. + + * toplev.c: Don't prototype or call init_rtl. + * optabs.c: Don't call init_mov_optab. + * genemit.c: Don't generate init_mov_optab. Don't call + init_rtl. + * gengenrtl.c: Duplicate calculation of CONST_DOUBLE_FORMAT + here. + * genattr.c, genattrtab.c, gencodes.c, genconfig.c, + genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c, + genrecog.c: Don't call init_rtl. + + * arc.h, arm.h, c4x.h, i386.h, i960.h, m88k.h, pa.h, pdp11.h, + rs6000.h, sparc.h: Don't define EXTRA_CC_NAMES. Use CC() in + definition of EXTRA_CC_MODES. + + * md.texi: Kill ref to EXTRA_CC_NAMES. + * tm.texi: Document new way to define EXTRA_CC_MODES. + + * genrecog.c: Do not look up the name of a define_split. + (Unrelated bugfix.) + +Fri Aug 27 17:03:42 1999 Nick Clifton + + * config/v850/v850.md: Fix typo introduced by previous delta. + +Fri Aug 27 09:48:59 1999 Kaveh R. Ghazi + + * gcc.c (fatal): Make definition static to match prototype. + +Fri Aug 27 10:33:35 1999 Bernd Schmidt + + * combine.c (get_last_value): Don't look for earlier sets if the last + known set is somewhere in between the insns being combined. + +Fri Aug 27 10:03:12 BST 1999 Nathan Sidwell + + * configure.in: Don't use shell ! to negate exit codes + * configure: Regenerate + +Fri Aug 27 09:36:17 1999 Andreas Schwab + + * function.c (assign_stack_temp_for_type): Fix change of Mar 5 for + the fact that ALIGN is measured in bits, not bytes. + +1999-08-27 00:27 -0700 Zack Weinberg + + * errors.c: New file; defines functions error, warning, and + fatal, variables have_error and progname. + * errors.h: New file; prototypes and decls for stuff in errors.c. + + * Makefile: Add rules to build errors.o and + $(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit, + genopinit, genrecog, genextract, genpeep, genattr, and + genoutput with errors.o. Add errors.h to deps of genconfig.o, + gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o, + genpeep.o, genattr.o, and genoutput.o. + + * genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c, + genextract.c, genpeep.c, genattr.c: Include errors.h. Don't + define or prototype fatal. Set progname at beginning of main. + * genoutput.c: Likewise, and don't define or prototype error + either. + + * c-typeck.c (c_expand_start_case): Return immediately if exp + is an ERROR_MARK. + * fold-const.c (operand_equal_p): Return immediately if arg1 + or arg0 are ERROR_MARKs. + * stor-layout.c (layout_type [case RECORD_TYPE]): Ignore + fields of type ERROR_MARK when calculating if the record can + go in a register. + +Fri Aug 27 01:03:48 1999 Jim Kingdon + with much help from Jeffrey A Law and Richard Henderson + + * i386.md: In the 6 insns which call output_fix_trunc, + earlyclobber operands[0]. + +Fri Aug 27 01:01:51 1999 Philip Blundell + + * jump.c (duplicate_loop_exit_test): Call reg_scan_update after + creating new registers. + +1999-08-26 23:09 -0700 Zack Weinberg + + * i386.h: Declare ix86_cpu_string, ix86_arch_string, + i386_reg_alloc_order, i386_regparm_string, + i386_align_loops_string, i386_align_jumps_string, + i386_align_funcs_string, i386_preferred_stack_boundary_string, + and i386_branch_cost_string as type "const char *". + * i386.c: Define all above strings as type "const char *". + +Thu Aug 26 20:36:30 1999 Jim Wilson + + * dwarf2out.c (output_aranges): Check DWARF_OFFSET_SIZE not PTR_SIZE + when emitting alignment padding. Emit padding byte of 0 instead of 4. + +Thu Aug 26 18:11:20 1999 Mark Mitchell + + * tree.c (array_type_nelts): Don't create RTL_EXPRs from + SAVE_EXPRs unless the SAVE_EXPRs have already been expanded. + +Thu Aug 26 19:33:23 1999 Jim Wilson + + * dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Add default definition. + (debug_dwarf): Add DWARF2_ASM_LINE_DEBUG_INFO support. + (dwarf2out_line, dwarf2out_finish): Likewise. + * tm.texi (DWARF2_ASM_LINE_DEBUG_INFO): Add documentation. + +Thu Aug 26 16:10:56 1999 Gavin Romig-Koch + + * tree.c (lang_unsave_expr_now) : Correct return type. + * tree.h (lang_unsave_expr_now) : Same. + +Thu Aug 26 13:12:29 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (cint_ok_for_move): Use CONST_INT_OK_FOR_LETTER_P macros + instead of duplicating code. + +Thu Aug 26 18:32:32 1999 Bernd Schmidt + + * gcse.c (hash_scan_insn): Don't scan obvious no-ops. + +1999-08-26 09:42 -0700 Zack Weinberg + + * tree.h: fancy_abort always takes three args. + * resource.c: Move include of system.h before toplev.h. + +Thu Aug 26 09:46:16 1999 Nick Clifton + + * dwarf2out.c (mem_loc_descriptor): Accept LABEL_REFs as well + as SYMBOL_REFs. + +1999-08-25 22:10 -0700 Zack Weinberg + + * system.h: Don't redefine abort or trim_filename. + * rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0) + or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on + whether or not __FUNCTION__ is available. + * tree.h: Duplicate rtl.h's definition of abort, for files + that don't include rtl.h. Delete all code to perform type + checking with a compiler other than GCC. + * varray.h: Delete all code to perform type checking with a + compiler other than GCC. Make VARRAY_CHECK() always evaluate + its arguments exactly once, using a statement expression. + Adjust the VARRAY_ accessor macros to match. + * toplev.h (fatal_insn, fatal_insn_not_found): Kill. + (_fatal_insn, _fatal_insn_not_found): New fns, take info on + caller's location. Define fatal_insn and fatal_insn_not_found + as macros that use _fatal_insn and _fatal_insn_not_found. + (fancy_abort, trim_filename): Kill prototypes. + + * rtl.c (trim_filename): Move here from toplev.c. + (fancy_abort): New function. + (DIR_SEPARATOR): Provide default definition. + * tree.c (tree_check_failed, tree_class_check_failed): Go + through fancy_abort. + (tree_check, tree_class_check, cst_or_constructor_check, + expr_check): Delete. + * varray.c (varray_check_failed): New function. + * toplev.c (fatal_insn, fatal_insn_not_found): Replace with + _fatal_insn and _fatal_insn_not_found. Go through + fancy_abort. + (trim_filename, fancy_abort): Delete. + + * builtins.c (expand_builtin_args_info): Report ICE with abort. + * except.c (start_catch_handler): Report ICE with error/abort + combo. + * final.c (output_operand_lossage): Likewise. + * flow.c (verify_flow_info): Likewise. + + * gcc.c: Prototype fatal. + * gengenrtl.c: Undef abort after including rtl.h not system.h. + * genattr.c, genattrtab.c, genemit.c, genextract.c, + genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c: + Don't define fancy_abort. + +Wed Aug 25 17:56:59 1999 Richard Henderson + + * optabs.c (emit_cmp_and_jump_insns): Be more thorough in + canonization. + +Wed Aug 25 15:35:55 1999 Richard Henderson + + * m88k.h (VERSION_INFO2): Kill. + (VERSION_STRING): Kill. + (TM_RCS_ID): Kill. + (VERSION_INFO1): Tidy. + (TARGET_VERSION): Update. + * m88k/dgux.h (VERSION_INFO2): Kill. + (ASM_FIRST_LINE): Adjust for death of VERSION_STRING. + * m88k/luna.h (VERSION_INFO1): Tidy. + * m88k/sysv4.h (VERSION_INFO1): Likewise. + * m88k.c (out_rcs_id, tm_rcs_id): Kill. + (output_file_start): Adjust for death of VERSION_STRING. + +1999-08-25 13:51 -0700 Jim Meyering + + * cpplib.c (detect_if_not_defined): New function. + (do_if): Use it to detect potential once-only headers. + +Wed Aug 25 14:00:18 1999 Jason Merrill + + * c-common.c (combine_strings): Always set TREE_CONSTANT. + +Wed Aug 25 15:27:22 1999 Gavin Romig-Koch + + * combine.c (nonzero_bits) : Allow single-ly set registers to be + anywere in the function only if they are pseudos and set before + being used (not live at the start of the function). + (num_sign_bit_copies) : Same. + (get_last_value_validate) : Same. + (get_last_value) : Same. + +Wed Aug 25 11:13:29 1999 Richard Henderson + + * loop.c (express_from): Try harder to unify (* c N) and (* c M) + where N and M are constant and N is an integer multiple of M. + +Wed Aug 25 13:55:47 EDT 1999 Andrew MacLeod + + * sbitmap.h (sbitmap_intersection_of_succs): Add prototype. + (sbitmap_intersection_of_preds, sbitmap_union_of_succs, + sbitmap_union_of_preds): Add prototypes. + * sbitmap.c (sbitmap_intersection_of_succs): New function to compute + the intersection of successors with the new flow graph structures. + (sbitmap_intersection_of_preds): New function to compute the + intersection of predecessors with the new flow graph structures. + (sbitmap_union_of_succs): New function to compute the union of + successors with the new flow graph structures. + (sbitmap_union_of_preds): New function to compute the union of + predecessors with the new flow graph structures. + * gcse.c (compute_rdm, compute_available): Use new sbitmap routines. + (expr_reaches_here_p): Use edge and basic_block structures instead + of s_preds and s_succs. + (compute_cprop_avinout): Use new sbitmap routines. + (pre_expr_reaches_here_p): Use edge and basic_block structures instead + of s_preds and s_succs. + * flow.c (compute_flow_dominators): Compute dominators using + edges and basic blocks instead of s_preds and s_succs. + +Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod + + * lists.c (unused_insn_list, unused_expr_list): New file for + maintaining various types of lists. New statics for maintaining a + cache of available INSN_LIST and EXPR_LIST nodes. + (free_list): Static function for freeing a list of INSN/EXPR nodes. + (alloc_INSN_LIST): Function to get a free INSN_LIST node. + (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. + (init_EXPR_INSN_LIST_cache): Initialize the cache lists. + (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. + (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. + (free_EXPR_LIST_node): Free an individual EXPR_LIST node. + (free_INSN_LIST_node): Free an individual INSN_LIST node. + * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c + (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c + (remove_dependence, free_pending_lists): Use new global routines. + (flush_pending_lists, sched_analyze_insn): Use new global routines. + (sched_analyze, compute_block_backward_dependences): Use new routines. + (sched_analyze_1, sched_analyze_2): Use new routines. + (schedule_insns): Use new global routines. + * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function + prototypes. + (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. + (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function + prototypes. + * toplev.c (rest_of_compilation): Initialize node cache. + * Makefile.in (OBJS): Add lists.o to list of object files. + (lists.o): Add dependencies. + +Wed Aug 25 17:31:56 1999 Nick Clifton + + * config/v850/v850.md: Fix compile time warning messages. + * config/v850/v850.c: Fix compile time warning messages. + * config/v850/v850.h: Fix compile time warning messages. + +Wed Aug 25 09:44:43 1999 Kaveh R. Ghazi + + * genattr.c (gen_attr): Add prototype arguments for get_attr_*(). + Remove unused prototype for `init_lengths'. + +Wed Aug 25 09:32:31 1999 Kaveh R. Ghazi + + * calls.c (emit_call_1): Mark parameter `stack_size' with + ATTRIBUTE_UNUSED. + (expand_call): Initialize variable `insn'. + (emit_library_call): Likewise for variable `high_to_save'. + (emit_library_call_value): Likewise. + (store_one_arg): Likewise for variables `lower_bound' and + `upper_bound'. + + * combine.c (try_combine): Likewise for variables `i2_code_number' + and `other_code_number'. + (find_split_point): Likewise for variables `pos', `unsignedp' and + `inner'. + (simplify_if_then_else): Likewise for variables `op' and `c1'. + (simplify_and_const_int): Remove unused variable `width'. + (merge_outer_ops): Likewise. + + * cse.c (simplify_binary_operation): Cast an INTVAL() to `unsigned + HOST_WIDE_INT' when comparing against one. + (simplify_relational_operation): Likewise. + (cse_insn): Initialize variables `src_eqv_volatile', + `src_eqv_in_memory', `src_eqv_in_struct', `src_eqv_hash' and `sets'. + + * final.c (init_final): Constify parameter `filename'. + (final_start_function): Mark parameter `optimize' with + ATTRIBUTE_UNUSED. + (profile_function): Likewise for parameters `first' and `optimize'. + (output_source_line): Likewise for parameter `file'. + + * integrate.c (subst_constants): Cast a value to `size_t' when + comparing against one. + (mark_stores): Initialize variable `mode'. Cast a value to + `size_t' when comparing against one. + + * integrate.h (MAYBE_EXTEND_CONST_EQUIV_VARRAY): Likewise. + + * loop.c (move_movables): Initialize variable `first'. + (strength_reduce): Likewise for variable `increment'. + (check_dbra_loop): Likewise for variable `comparison_val'. Cast a + value to `size_t' when comparing against one. + (load_mems): Initialize variable `end_label'. + + * output.h (init_final): Constify parameter. + + * reload.c (decompose): Initialize variable `base'. + + * reload1.c (reload): Likewise for variable `is_scalar'. + (spill_hard_reg): Mark parameter `dumpfile' with ATTRIBUTE_UNUSED. + (choose_reload_regs): Initialize variable `mode'. + (emit_reload_insns): Likewise for variable `store_insn'. + (reload_cse_noop_set_p): Mark parameter `insn' with + ATTRIBUTE_UNUSED. + (reload_combine): Initialize variable `set'. + + * unroll.c (unroll_loop): Likewise for variable `local_label'. + (copy_loop_body): Cast a value to `size_t' when comparing against + one. + + * varasm.c (assemble_variable): Initialize variable `size_tree'. + (const_hash): Add an `else abort()' in an if-else-if-else sequence. + (remove_from_pending_weak_list): Mark parameter `name' with + ATTRIBUTE_UNUSED. + +Wed Aug 25 11:18:39 1999 Bernd Schmidt + + * toplev.c (rest_of_compilation): Use decl_printable_name when opening + gcse dump file. + +Wed Aug 25 10:57:12 1999 Nick Clifton + + * config/arm/telf.h (ASM_WEAKEN_LABEL): Define. + (ASM_DECLARE_FUNCTION_NAME): Define. + (TYPE_ASM_OP, SIZE_ASM_OP, TYPE_OPERAND_FORMAT, + ASM_DECLARE_RESULT, ASM_DECLARE_OBJECT_NAME, + ASM_FINISH_DECLARE_OBJECT, ASM_DECLARE_FUNCTION_SIZE): Define if + not already defined. + +Wed Aug 25 01:36:11 1999 John David Anglin + + * calls.c (emit_call_1): Use call_pop/call_value_pop for all values + of n_popped when call/call_value are not defined. + +Wed Aug 25 01:25:14 1999 Jeffrey A Law (law@cygnus.com) + + * tm.texi: GNU CC -> GCC conversion. + (CC1_SPEC): Indicate it is used for all language front ends. + +Tue Aug 24 23:43:03 1999 Mark Mitchell + + * flow.c (delete_block): Spell NOTE_INSN_EH_REGION_BEG and + NOTE_INSN_EH_REGION_END correctly. + +Tue Aug 24 23:26:44 1999 Michael Tiemann + Jeff Law + + * loop.c (strength_reduce): Automatically unroll loops if the + unrolled loop size is smaller than the rolled loop size. + + * loop.c (insert_bct): Replace use of sdiv_optab with asr_optab + and delete comment that code should be rewritten. + +Tue Aug 24 22:56:35 1999 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (find_rgns): Mark a block found during the DFS search + as reachable. + + * haifa-sched.c (get_visual_tbl_length): Fix off-by-one error. + +Tue Aug 24 22:41:06 1999 Mumit Khan + + * fixinc/mkfixinc.sh: Don't fix uwin headers. + * i386/uwin.h (MD_STARTFILE_PREFIX): Define. + (LINK_SPEC): Add -u _main when building executables. + (ASM_DECLARE_FUNCTION): Update from Cygwin. + (ASM_FILE_END): Use the default for ix86-pe. + * i386/xm-uwin.h (HAVE_BCOPY): Undefine. + +Tue Aug 24 20:49:47 1999 Art Haas + + * final.c (output_addr_const): Handle case where ASM_OPEN_PAREN + and ASM_CLOSE_PAREN are empty strings. + +Wed Aug 25 12:46:22 1999 Fred Fish + Geoffrey Keating + + * Makefile.in (PREPROCESSOR_DEFINES): New macro. + (protoize.o): Use PREPROCESSOR_DEFINES and DRIVER_DEFINES. + (unprotoize.o): Ditto. + (test-protoize-simple): Don't define STD_PROTO_DIR. + * protoize.c: Use PARAMS rather than PROTO. Minor whitespace + changes to make 'test-protoize-simple' pass. + (STD_PROTO_DIR): Remove define. + (STANDARD_EXEC_PREFIX): Supply default define. + (standard_exec_prefix): New variable, init to STANDARD_EXEC_PREFIX. + (target_machine): New variable, init to DEFAULT_TARGET_MACHINE. + (target_version): New variable, init to DEFAULT_TARGET_VERSION. + (GET_ENV_PATH_LIST): New macro. + (default_syscalls_dir): No longer initialized to STD_PROTO_DIR. + (do_processing): Initialize default_syscalls_dir using new + macros. Use it to initialize syscalls_absolute_filename. + +Tue Aug 24 16:58:15 1999 Richard Henderson + + * jump.c (jump_optimize_1): Do cmov opt on any single-set; force + B into a register before emit_conditional_move. + +Tue Aug 24 15:37:03 1999 Richard Henderson + + * fold-const.c (fold): Reassociate (+ (+ (* a b) c) (* d e)) + as (+ (+ (* a b) (* d e)) c). Factor a common power-of-two + multiplicand out of (+ (* a b) (* c d)). + +Tue Aug 24 11:46:10 1999 Bob Manson + Richard Henderson + + * haifa-sched.c (split_hard_reg_notes): Move to flow.c + (new_insn_dead_notes): Likewise. + (update_n_sets): Likewise. + (update_flow_info): Move to flow.c, renamed to update_life_info; + extend to handle multiple source insns. + * flow.c: Include resource.h + (unlink_insn_chain): New. + (split_hard_reg_notes): New. + (maybe_add_dead_note): New. + (maybe_add_dead_note_use): New. + (find_insn_with_note): New. + (new_insn_dead_notes): New. + (update_n_sets): New. + (sets_reg_or_subreg_1, sets_reg_or_subreg): New. + (maybe_remove_dead_notes): New. + (update_life_info): New. + (prepend_reg_notes): New. + (replace_insns): New. + * output.h (update_life_info): Declare. + * recog.c (split_block_insns): Use update_life_info. + * resource.c (find_free_register): Use reg_alloc_order, don't use + fixed regs, make sure the mode is supported, don't use new regs. + (reg_dead_p): New. + * rtl.h (replace_insns): Declare. + +Tue Aug 24 13:48:39 1999 Nathan Sidwell + + * expr.c (expand_expr): Cope with COND_EXPRs with one + non-returning branch. + +Mon Aug 23 22:28:16 1999 Mark Mitchell + + * expr.c (store_expr): Always pass down the target, even when not + doing CSE. + +1999-08-24 Nick Clifton + + * configure.in: Define target_cpu_default for v850 targets. + * configure: Regenerate + + * config/v850/v850.h (TARGET_CPU_generic): Define. + (GO_IF_LEGITIMATE_ADDRESS): Insist that SImode and larger constant + addresses are 4 byte aligned. + + * config/v850/v850.c (print_operand): Cope with 'R' format DFmode + addresses. + +Tue Aug 24 09:32:07 1999 Kaveh R. Ghazi + + * genattr.c (function_unit_desc): Constify a char*. Add prototype. + (main): Add prototypes. + + * genattrtab.c (substitute_address, write_const_num_delay_slots, + attr_eq, attr_numeral, attr_equal_p, attr_copy_rtx): Prototype. + (write_attr_get): Emit prototypes along with function definition. + (write_eligible_delay): Mark a parameter with ATTRIBUTE_UNUSED. + (write_complex_function): Emit static prototype along with + function definition. + + * genemit.c (gen_split): Emit prototypes along with function + definition. + + * genoutput.c (output_epilogue): Add prototype to `insn_outfun'. + Likewise for predicates and `insn_operand_predicate'. + (process_template): Emit static prototype along with function + definition. + + * genrecog.c (make_insn_sequence): Constify a char*. Add + prototypes for get_split_*(). + (write_subroutine): Emit prototypes along with function + definition. + +Tue Aug 24 12:35:20 1999 Bernd Schmidt + + * gcse.c (find_avail_set): Follow chains of register-register copies. + Use oprs_not_set_p to guarantee that the returned value can be + substituted. + (cprop_insn): Don't verify the return value of find_avail_set with + oprs_not_set_p. + + * gcse.c (cprop_jump): New function, broken out of cprop_insn. + (cprop_cc0_jump): New function. + (cprop_insn): Break out new function cprop_jump and use it. + Also use cprop_cc0_jump for machines with CC0. + (cprop): Don't crash if cprop_insn turned the insn into a NOTE. + + * tree.h (current_function_calls_setjmp, + current_function_calls_longjmp): Delete declarations. + * dsp16xx.c: Include "function.h". + * elxsi.c: Likewise. + * gmicro.c: Likewise. + * h8300.c: Likewise. + * i370.c: Likewise. + * m32r.c: Likewise. + * mn10200.c: Likewise. + * mn10300.c: Likewise. + * ns32k.c: Likewise. + * spur.c: Likewise. + * v850.c: Likewise. + + * rtl.h (rtx_equal_function_value_matters): Declare. + * toplev.c (rtx_equal_function_value_matters): Don't declare. + * cse.c: Likewise. + * function.c: Likewise. + * emit-rtl.c: Likewise. + +Tue Aug 24 02:47:44 1999 Jeffrey A Law (law@cygnus.com) + + * expr.c (convert_move): Fix arguments to TRULY_NOOP_TRUNCATION + call. + +1999-08-24 Herman A.J. ten Brugge + + * jump.c (delete_barrier_successors) Match (set (pc) (pc)) insn + exactly. + +Mon Aug 23 23:35:52 1999 Matthias Klose + + * cpp.texi: Add a node documenting macro varargs (copied + from extend.texi). + +1999-08-23 22:23 -0700 Zack Weinberg + + * cppspec.c: Put a null pointer at the end of the new argv. + +Mon Aug 23 21:23:24 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in: Remove code to select/de-select the haifa + scheduler. Every scheduled port gets haifa now. + * configure: Rebuilt. + * flags.h, genattrtab.c, rtl.h, toplev.c: Remove HAIFA ifdefs. + * sched.c Deleted. + * Makefile.in: Corresponding changes. + +Mon Aug 23 16:04:13 1999 Bernd Schmidt + + * optabs.c (prepare_cmp_insn): Turn COMPARISON arg into a pointer. + All callers changed. + (prepare_float_lib_cmp): Likewise. + Use FLOAT_LIB_COMPARE_RETURNS_BOOL. + * expr.h (emit_float_lib_cmp): Delete declaration. + * tm.texi (FLOAT_LIB_COMPARE_RETURNS_BOOL): Document. + * sparc.h (FLOAT_LIB_COMPARE_RETURNS_BOOL): Define. + * sparc.md (bcc and scc patterns): Don't handle TFmode comparisons + specially. + (cmptf): Now conditional on TARGET_HARD_QUAD. + +Fri Aug 20 17:52:27 1999 Jim Wilson + + * resource.c (mark_target_live_regs): Use + PIC_OFFSET_TABLE_REG_CALL_CLOBBERED. + +Fri Aug 20 19:07:55 1999 Kaveh R. Ghazi + + * rtl.c (rtx_class, note_insn_name, reg_note_name): Constify. + + * rtl.h (rtx_class, reg_note_name, note_insn_name): Likewise. + + * genopinit.c (gen_insn): Use accessor macro, not `rtx_class'. + +Fri Aug 20 18:53:43 1999 Kaveh R. Ghazi + + * rtl.h (rtx_format): Constify a char*. + + * rtl.c (rtx_format): Likewise. + (copy_rtx, copy_most_rtx, read_rtx): Likewise. + (init_rtl): Use accessor macro, not `rtx_format'. + + * alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a + char*. + + * caller-save.c (mark_referenced_regs): Likewise. + + * combine.c (subst, make_compound_operation, known_cond, + gen_rtx_combine, update_table_tick, get_last_value_validate, + use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise. + + * cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p, + refers_to_p, canon_reg, fold_rtx, cse_process_notes, + count_reg_usage): Likewise. + + * emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags): + Likewise. + + * final.c (leaf_renumber_regs_insn): Likewise. + + * flow.c (mark_used_regs, find_use_as_address, dump_flow_info, + dump_edge_info, count_reg_references): Likewise. + + * function.c (fixup_var_refs_1, walk_fixup_memory_subreg, + fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1): + Likewise. + + * gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p, + oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs, + add_label_notes): Likewise. + + * genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask, + clear_struct_flag, count_sub_rtxs, count_alternatives, + compares_alternatives_p, contained_in_p, walk_attr_value, + write_expr_attr_cache): Likewise. + + * genconfig.c (walk_insn_part): Likewise. + + * genemit.c (max_operand_1, gen_exp): Likewise. + + * genextract.c (walk_rtx): Likewise. + + * genflags.c (num_operands): Likewise. + + * genoutput.c (scan_operands): Likewise. + + * genpeep.c (match_rtx): Likewise. + + * genrecog.c (add_to_sequence): Likewise. + + * haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths): + Likewise. + + * integrate.c (save_constants, copy_for_inline, + copy_rtx_and_substitute, subst_constants, restore_constants): + Likewise. + + * jump.c (mark_jump_label, invert_exp, redirect_exp, + rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise. + + * local-alloc.c (contains_replace_regs, memref_referenced_p): + Likewise. + + * loop.c (record_excess_regs, rtx_equal_for_loop_p, + add_label_notes, replace_call_address, count_nonfixed_reads, + invariant_p, find_single_use_in_loop, find_mem_givs, + find_life_end, maybe_eliminate_biv_1, update_reg_last_use): + Likewise. + + * print-rtl.c (reg_names, print_rtx): Likewise. + + * recog.c (validate_replace_rtx_1, find_single_use_1): Likewise. + + * reg-stack.c (stack_regs_mentioned_p, record_label_references, + record_reg_life_pat, swap_rtx_condition, goto_block_pat, + print_blocks): Likewise. + + * regclass.c (fix_register, record_address_regs, + reg_scan_mark_refs): Likewise. + + * regmove.c (stable_but_for_p): Likewise. + + * reload.c (loc_mentioned_in_p, operands_match_p, + find_reloads_toplevsubst_reg_equivs, find_reloads_address_1, + copy_replacements, refers_to_regno_for_reload_p, + refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p, + reload_when_needed_name, reg_class_names, debug_reload_to_stream): + Likewise. + + * reload1.c (eliminate_regs, scan_paradoxical_subregs, + delete_address_reloads_1, count_occurrences, + reload_cse_mem_conflict_p, reload_combine_note_use, + add_auto_inc_notes): Likewise. + + * resource.c (mark_referenced_resources, mark_set_resources): + Likewise. + + * rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p, + reg_mentioned_p, regs_set_between_p, modified_between_p, + modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p, + rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p, + may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs, + jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise. + + * sched.c (sched_analyze_2, attach_deaths): Likewise. + + * stupid.c (stupid_mark_refs): Likewise. + + * unroll.c (remap_split_bivs): Likewise. + + * varasm.c (mark_constants): Likewise. + + * a29k/a29k.c (uses_local_reg_p): Likewise. + + * alpha/alpha.c (summarize_insn): Likewise. + + * arm/arm.c (symbol_mentioned_p, label_mentioned_p, + eliminate_lr2ip): Likewise. + + * arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise. + + * i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx, + reg_mentioned_in_mem): Likewise. + + * ns32k/ns32k.c (global_symbolic_reference_mentioned_p, + symbolic_reference_mentioned_p): Likewise. + + * romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise. + + * sh/sh.c (regs_used, mark_use): Likewise. + + * vax/vax.c (vax_rtx_cost): Likewise. + +Fri Aug 20 18:38:43 1999 Kaveh R. Ghazi + + * machmode.h (mode_name): Constify a char*. + + * rtl.c (mode_name): Likewise. + + * genopinit.c (gen_insn): Use accessor macro, not `mode_name'. + + * optabs.c (init_libfuncs): Constify a char*. + + * print-tree.c (mode_name): Remove redundant declaration. + (print_node): Use accessor macro, not `mode_name'. + + * reload1.c (dump_needs): Constify a char*. Use accessor macro, + not `mode_name'. + (new_spill_reg): Constify a char*. + + * tree.c (mode_name): Remove redundant declaration. + +Fri Aug 20 18:31:26 1999 Kaveh R. Ghazi + + * rtl.c (rtx_name): Constify a char*. + + * rtl.h (rtx_name, fix_sched_param): Likewise. + + * gmicro/gmicro.c (rtx_name): Remove redundant declaration. + (mypr): Use accessor macro, not `rtx_name'. + + * genemit.c (print_code): Constify a char*. + + * genopinit.c (gen_insn): Use accessor macro, not `rtx_name'. + + * genpeep.c (print_code): Constify a char*. + + * genrecog.c (print_code): Likewise. + + * graph.c (start_fct, start_bb, node_data, draw_edge, end_fct, + end_bb): Add static prototype. + (draw_edge): Constify a char*. + (end_bb): Remove unused parameter. + + * haifa-sched.c (fix_sched_param, safe_concat, print_exp + print_block_visualization): Constify a char*. + +Fri Aug 20 15:02:10 1999 Mark Mitchell + + * c-common.c (c_get_alias_set): Update comment. + +1999-08-20 Andreas Jaeger + + * linux.h (LIB_SPEC): Added. + +Fri Aug 20 22:32:17 1999 Michael Hayes + + * config/c4x/c4x.h (STARTFILE_SPEC): Don't def. + +1999-08-19 18:43 -0700 Zack Weinberg + + * tree.c (expr_check): Fix typo in last change. + +1999-08-19 14:44 -0700 Zack Weinberg + + * rtl.def (NOTE): Change format to "iuu0n". + (ADDR_DIFF_VEC): Change format to "eEee0". + (ADDRESSOF): Change format to "eit". + + * rtl.h (rtvec): Make "elem" an array of rtx, not rtunion. + (RTVEC_ELT): Change to match. + (XVECEXP): Use XVEC and RTVEC_ELT. + (INSN_UID, INSN_CODE, CODE_LABEL_NUMBER, NOTE_LINE_NUMBER, + ADDRESSOF_REGNO, REGNO, SUBREG_WORD): Use XINT. + (PREV_INSN, NEXT_INSN, PATTERN, REG_NOTES, + CALL_INSN_FUNCTION_USAGE, SUBREG_REG, SET_SRC, SET_DEST, + TRAP_CONDITION, TRAP_CODE): Use XEXP. + (INTVAL): Use XWINT. + (ADDRESSOF_DECL): Use XTREE. + (SET_ADDRESSOF_DECL): Delete. + (NOTE_DECL_NAME, NOTE_DECL_CODE, NOTE_DECL_RTL, + NOTE_DECL_IDENTIFIER, NOTE_DECL_TYPE): Kill. These have been + ifdefed out since 2.6 at least. + (gen_rtvec_vv): Delete prototype. + + * rtl.h (rtvec_alloc): rt->elem is now an array of rtx, + not rtunion. + (copy_most_rtx): Handle 't' format letter. + * emit-rtl.c (gen_rtvec_v): rt_val->elem is an array of rtx. + (gen_rtvec_vv): Delete function. All callers changed to use + gen_rtvec_v instead. + * print-rtl.c (print_rtx): Move special casing of NOTEs to + the '0' format letter. + + * function.c (gen_mem_addressof): Don't use + SET_ADDRESSOF_DECL; provide `decl' to gen_rtx_ADDRESSOF + instead. + * integrate.c (copy_rtx_and_substitute): Likewise. + Copy 't' slots with XTREE. + (subst_constants): Treat 't' slots like '[swi]' slots. + * cse.c (canon_hash, exp_equiv_p): Treat 't' slots like '0' slots. + * jump.c (rtx_equal_for_thread_p): Likewise. + * rtlanal.c (rtx_equal_p): Likewise. + * stmt.c (expand_end_case): gen_rtx_ADDR_DIFF_VEC now takes + only four arguments. + * gengenrtl.c (type_from_format): Provide correct types for + 'b' and 't' slots. + + + * tree.h [ENABLE_CHECKING] (TREE_CHECK, TREE_CLASS_CHECK): + If a recent gcc is in use (always in stage2 and beyond), use + statement expressions, so we don't make a function call unless + the check fails. Evaluate arguments exactly once. + (CHAIN_CHECK, DO_CHECK, DO_CHECK1, TREE_CHECK1, + TREE_CLASS_CHECK1, TYPE_CHECK1, DECL_CHECK1, CST_CHECK1): + Delete. + (CST_OR_CONSTRUCTOR_CHECK, EXPR_CHECK): Redefine such that + they evaluate their arguments exactly once, irrespective of + the compiler in use. + + * tree.c [ENABLE_CHECKING]: Define whichever set of functions + is used by the currently-enabled check macros. This is: + (tree_check_failed, tree_class_check_failed): For gcc. + (tree_check, tree_class_check, cst_or_constructor_check, + expr_check): For other compilers. + + * gencheck.c: Do not define any *_CHECK1 macros. + +Thu Aug 19 14:42:38 1999 Mike Stump + Mark Mitchell + + * c-common.c (c_get_alias_set): Fix support for pointers and + references. + +Thu Aug 19 11:51:22 EDT 1999 John Wehle (john@feith.com) + + * alias.c: Include tree.h. + (nonlocal_reference_p, mark_constant_function): New functions. + * flow.c (life_analysis): Call mark_constant_function. + * rtl.h (mark_constant_function): Declare it. + +Thu Aug 19 15:02:01 1999 Nick Clifton + + * config/rs6000/rs6000.c (rs6000_override_options): Fix test for + unrecognizable switches. + +Wed Aug 18 23:31:57 1999 J"orn Rennecke + + * loop.c (recombine_givs): Set ix field after sorting. + (recombine_givs): Remove bogus index / giv lockstep looping. + +Wed Aug 18 18:20:40 1999 Bernd Schmidt + + * expmed.c (emit_store_flag): If UNSIGNEDP, call unsigned_condition + on CODE. + (emit_store_flag_force): Use do_compare_rtx_and_jump. + (do_cmp_and_jump): Formatting fixes. + * expr.c (do_compare_and_jump): Renamed from compare; changed to call + do_compare_rtx_and_jump instead of compare_from_rtx. + (do_compare_rtx_and_jump): New function; mostly copied from + compare_from_rtx. + (do_jump_for_compare): Delete. + (expand_expr): Use do_compare_rtx_and_jump when handling MAX_EXPR and + MIN_EXPR. + (do_jump): Use do_compare_and_jump or do_compare_rtx_and_jump instead + of compare/do_jump_for_compare pairs. + (do_jump_by_parts_greater): Use do_jump_by_parts_greater_rtx. + (do_jump_by_parts_greater_rtx): Use do_compare_rtx_and_jump instead of + compare_from_rtx/do_jump_for_compare pairs. + (do_jump_by_parts_equality): Likewise. + (do_jump_by_parts_equality_rtx): Likewise. + * expr.h (do_compare_rtx_and_jump): Declare. + * optabs.c (prepare_cmp_insn): New function, contains most of the code + that used to be in emit_cmp_insn. + (cmp_available_p): New function. + (prepare_operand): New function. + (emit_cmp_and_jump_insn_1): New function, contains some code that used + to be in emit_cmp_insn. + (prepare_float_lib_cmp): Renamed from emit_float_lib_cmp; change some + parameters to be pointers; don't emit final compare but modify some of + the values pointed to by the args so the caller can perform the + correct comparison. + (expand_binop): Call emit_store_flag_force with signed forms of + comparison code. + (expand_abs): Use do_compare_rtx_and_jump instead of compare_from_rtx/ + emit_jump_insn pair. + (emit_cmp_and_jump_insn): Use prepare_cmp_insn and + emit_cmp_and_jump_insn_1. Call emit_queue. + (emit_cmp_insn): Just call emit_cmp_and_jump_insns with zero for LABEL + arg. + * flow.c (tidy_fallthru_edge): If HAVE_cc0, verify insn before a + jump sets cc0 before deleting it. + * integrate.c (expand_inline_function): Likewise. + * unroll.c (unroll_loop): Similar changes in several places. + (copy_loop_body): If HAVE_cc0, verify insn before a jump sets cc0 + before deleting it. + +Wed Aug 18 06:37:44 1999 Bernd Schmidt + + * Makefile.in (insn-recog.o): Update dependencies. + * genrecog.c (main): Make generated file include "function.h". + +Sat Aug 14 00:54:57 1999 Geoffrey Keating + + * cse.c (cse_insn): Call never_reached_warning when a jump is + changed to be unconditional. + * flags.h: Declare warn_notreached. + * flow.c (delete_block): Call never_reached_warning when + a block is deleted. + * jump.c (delete_barrier_successors): Call never_reached_warning + when we delete everything after a BARRIER. + (never_reached_warning): New function. + * rtl.h: Declare never_reached_warning. + * toplev.c (warn_notreached): New variable. + (lang_independent_options): Set warn_notreached + when -Wunreachable-code. + (compile_file): We need line numbers for -Wunreachable-code. + +Tue Aug 17 22:06:11 1999 Jan Hubicka + + * haifa-sched.c (insn_unit): Fix typo on out of range test. + * sched.c (insn_unit): Likewise. + +Tue Aug 17 21:57:23 1999 Andreas Schwab + + * combine.c (distribute_notes): Handle REG_EH_RETHROW. + +Tue Aug 17 17:39:43 EDT 1999 Andrew MacLeod + + * flow.c (create_edge_list): Use xmalloc, not malloc. + +Tue Aug 17 01:40:54 1999 Loren Rittle + + * fixinc/inclhack.def (no_double_slash): Do not trash single-line + C-style comments. Do not lose the character before double slash. + +Mon Aug 16 18:08:22 EDT 1999 Andrew MacLeod + + * basic-block.h (struct edge_list): Stucture to maintain a vector + of edges. + (EDGE_INDEX_NO_EDGE, EDGE_INDEX, INDEX_EDGE_PRED_BB, INDEX_EDGE_SUCC_BB, + INDEX_EDGE, NUM_EDGES): New Macros for accessing edge list. + (create_edge_list, free_edge-List, print_edge_list, verify_edge_list): + New function prototypes. + * flow.c (create_edge_list): Function to create an edge list. + (free_edge_list): Discards memory used by an edge list. + (print_edge_list): Debug output showing an edge list. + (verify_edge_list): Internal consistency check for an edge list. + (find_edge_index): Function to find an edge index for a pred and succ. + +Mon Aug 16 11:56:36 1999 Mark Mitchell + + * tree.c (type_hash_add): Use permalloc to allocate nodes in the + hashtable. + +Mon Aug 16 17:04:15 1999 Jorn Rennecke + + * mips.h (CLASS_CANNOT_CHANGE_SIZE): Define. + +Fri Aug 13 15:20:43 1999 Gerald Pfeifer + + * config/i386/freebsd.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +Fri Aug 13 10:21:28 1999 Nick Clifton + + * toplev.c (rest_of_compilation): Allow machine dependent + reorganization pass to place information into the RTL dump + file if it so wishes. + +Sun Aug 15 12:41:21 1999 Jim Wilson + + * explow.c (hard_function_value): Use VOIDmode instead of + MAX_MACHINE_MODE. + * stmt.c (expand_return): Likewise. + * stor-layout.c (get_best_mode): Likewise. + + * genemit.c (gen_expand): If next is MATCH_PAR_DUP, then output + emit call instead of emit_insn call. + +Sat Aug 14 15:04:06 1999 Mumit Khan + + * configure.in: Handle --disable/enable-win32-registry. + * install.texi: Document --disable/enable-win32-registry. + * acconfig.h (ENABLE_WIN32_REGISTRY): New macro. + (WIN32_REGISTRY_KEY): New macro. + * prefix.c: Use to enable/disable win32-specific code. + (lookup_key): Use versioned key. + * configure: Regenerate. + * config.in: Likewise. + +Fri Aug 13 17:41:55 1999 Jason Merrill + + * cpplib.c (read_line_number): New fn, split out of... + (do_line): Here. + +Fri Aug 13 14:18:27 1999 Gavin Romig-Koch + + tree.c (lang_unsave_expr_now) : New. + (unsave_expr_now): Call lang_unsave_expr_now. + tree.h (lang_unsave_expr_now) : New. + +Fri Aug 13 00:49:46 1999 Jason Merrill + + * toplev.c (flag_new_exceptions): On by default. + +1999-08-13 Michael Meissner + + * Makefile.in (GCC_FOR_TARGET): Move -B./ after the tooldir -B. + +Fri Aug 13 01:29:57 1999 Alexandre Oliva + + * dwarfout.c (fundamental_type_code): Return FT_boolean for + INTEGER_TYPE with precision==1, it's __java_boolean. + +Thu Aug 12 23:51:04 1999 J"orn Rennecke + + * global.c (prune_preferences): Move some invariants out of the + inner loop. + +Thu Aug 12 15:30:29 1999 Jesse Perry (jap@unx.dec.com) + + * configure.in (alpha*-dec-osf*): Add osf5. + +Sun Aug 1 22:24:03 1999 Philip Blundell + + * configure.in: Rework handling of ARM GNU/Linux slightly. + (arm*-*-linux-gnuoldld): New target. + * configure: Regenerate. + * install.texi (Configurations): Add arm-*-linux-gnu{oldld} and + arm-*-elf. Mention that arm-*-linux-gnuaout is obsolete. + * config/arm/linux-oldld.h: New file. + * config/arm/linux-elf26.h: Don't include linux-elf.h. + (TARGET_DEFAULT, SUBTARGET_LINK_SPEC, SUBTARGET_EXTRA_ASM_SPEC): + Don't define. + * config/arm/linux-elf.h (ASM_SPEC): Define. + (TARGET_DEFAULT, SUBTARGET_EXTRA_LINK_SPEC, + SUBTARGET_EXTRA_ASM_SPEC, CPP_APCS_PC_DEFAULT): Add definitions + for 26-bit APCS and old linker. + (CPP_PREDEFINES): Define `__arm__'; don't define `arm' or + `arm_elf'. + (FP_DEFAULT): Define to FP_SOFT3 for all machines. + * config/arm/linux-aout.h (CPP_PREDEFINES): Define `__arm__'; + don't define `arm' or `arm_elf'. + * config/arm/t-linux (EXTRA_MULTILIB_PARTS, MULTILIB_OPTIONS, + MULTILIB_DIRNAMES): Define. Fix typo in comment. + +Thu Aug 12 10:14:47 1999 Andreas Schwab + + * rtl.texi: Fix typo. + +Wed Aug 11 23:50:57 1999 Jason Merrill + + * invoke.texi (C++ Dialect Options): Add -fms-extensions. + +Wed Aug 11 12:59:37 1999 Mark Mitchell + + * extend.texi (C++ Signatures): Remove node. + * invoke.texi: Remove discussion of -fhandle-signatures, + signature, sigof, __signature__, and __sigof__. + +Wed Aug 11 03:38:25 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (JAVAGC): Removed. + +Wed Aug 11 02:13:26 1999 Mumit Khan + + * i386/cygwin.h (ASM_OUTPUT_ALIGNED_BSS): Define. + +1999-08-11 Mark Elbrecht + + * i386/djgpp.h (ASM_OUTPUT_ALIGNED_BSS): Define. + +1999-08-11 Richard Earnshaw (rearnsha@arm.com) + + * emit-rtl.c (mark_reg_pointer): Don't increase the alignment of + a register that is already known to be a pointer. + +1999-08-11 Bruce Korb + + * fixinc/inclhack.tpl: Only install assert.h conditionally. + * fixinc/inclhack.sh: Regenerated. + * fixinc/fixincl.sh: Regenerated. + +Wed Aug 11 00:34:22 1999 Joe Buck + + * invoke.texi: s/GNU CC/GCC/ for consistency with gcc.texi. + Fix documentation of -ansi flag to describe its C++ behavior. + Remove bogus reference to GCC 2.9. + +Tue Aug 10 17:19:02 1999 Jim Wilson + + * config/sh/sh.c (machine_dependent_reorg): Only call PUT_MODE on + note if it is non-NULL. + +Tue Aug 10 10:47:42 EDT 1999 Andrew MacLeod + + * except.h (eh_nesting_info): Add new structure definition. + (init_eh_nesting_info, free_eh_nesting_info): Add function prototypes. + (reachable_handlers, update_rethrow_references): Add function + prototypes. + * rtl.h (struct rtvec_def): Update comments. REG_EH_RETHROW takes + a rethrow symbol instead of an integer exception region number. + * flow.c (Make_edges): Use new exception nesting routines to determine + which handlers are reachable from a CALL or asynchronous insn. + Don't add an edge for calls with a REG_EH_REGION of -1 to non-local + goto receivers. + (delete_eh_regions): Update rethrow labels, and don't delete + regions which are the target of a rethrow. + * except.c (struct func_eh_entry): Add rethrow_ref field, now we can + avoid overloading the SYMBOL_REF_USED flag. + (rethrow_symbol_map): Use new rethrow_ref field. + (rethrow_used): Use new rethrow_ref field. + (expand_rethrow): REG_EH_RETHROW now has a SYMBOL_REF instead + of an integer. Fix formatting. + (output_exception_table_entry): Use new rethrow_ref field. + (can_throw): Check for EH_REGION_NOTE before deciding + whether a CALL can throw or not. + (scan_region): Call rethrow_used() instead of accessing data structure. + (update_rethrow_references): New function to make sure only regions + which are still targets of a rethrow are flagged as such. + (process_nestinfo): New static function to initialize a handler + list for a specific region. + (init_eh_nesting_info): New function to allocate and initialize + the list of all EH handlers reachable from all regions. + (reachable_handlers): New function to retrieve the list of handlers + reachable from a specific region and insn. + (free_eh_nesting_info): New function to dispose of a list of + reachable handlers. + +Tue Aug 10 10:39:31 EDT 1999 Andrew MacLeod + + * flow.c (split_edge): Set JUMP_LABEL field. + (commit_one_edge_insertion): Set head correctly for insert_before. + When inserting insns, update insn block numbers if allocated. + +Tue Aug 10 09:26:07 1999 Kaveh R. Ghazi + + * dwarf2out.c (dwarf2out_frame_debug_expr, add_incomplete_type, + retry_incomplete_types): Add static prototype. + (stripattributes, dwarf_cfi_name, ASM_OUTPUT_DWARF_STRING, + dwarf_tag_name, dwarf_attr_name, dwarf_form_name, + dwarf_stack_op_name, dwarf_type_encoding_name, add_AT_string, + dwarf2_name, add_name_attribute, lookup_filename, dwarf2out_line, + dwarf2out_start_source_file, dwarf2out_define, dwarf2out_undef): + Constify a char*. + + * dwarf2out.h (dwarf2out_define, dwarf2out_undef, + dwarf2out_start_source_file, dwarf2out_line): Likewise. + +Tue Aug 10 09:21:46 1999 Kaveh R. Ghazi + + * output.h (assemble_name): Constify a char*. + + * varasm.c (UNIQUE_SECTION, assemble_start_function, + assemble_variable, assemble_name): Likewise. + + * dwarf2out.c (ASM_NAME_TO_STRING): Likewise. + + * arm/pe.c (arm_pe_unique_section): Likewise. + + * i386/cygwin.h (STRIP_NAME_ENCODING): Likewise. + + * i386/i386-interix.h (STRIP_NAME_ENCODING): Likewise. + + * i386/interix.c (i386_pe_unique_section): Likewise. + + * i386/win32.h (STRIP_NAME_ENCODING): Likewise. + + * i386/winnt.c (i386_pe_unique_section): Likewise. + + * m32r/m32r.h (ASM_OUTPUT_LABELREF): Likewise. + + * mn10200/mn10200.h (ASM_OUTPUT_LABELREF): Likewise. + + * mn10300/mn10300.h (ASM_OUTPUT_LABELREF): Likewise. + + * pa/pa.c (output_call): Likewise. + + * pa/pa.h (ASM_OUTPUT_MI_THUNK): Likewise. + + * pa/som.h (ASM_OUTPUT_FUNCTION_PREFIX): Likewise. + + * rs6000/rs6000.c (rs6000_output_load_toc_table, output_toc): + Likewise. + + * rs6000/rs6000.h (RS6000_OUTPUT_BASENAME, STRIP_NAME_ENCODING): + Likewise. + + * rs6000/sol2.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + + * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_INT, + STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Likewise. + + * v850/v850.h (ASM_OUTPUT_LABELREF): Likewise. + +Mon Aug 9 19:54:05 1999 Kaveh R. Ghazi + + * real.c (GET_REAL, PUT_REAL): Use memcpy instead of bcopy. + +Mon Aug 9 19:36:00 1999 Kaveh R. Ghazi + + * tree.h (lang_identify): Constify a char*. + (print_error_function): Add extern prototype. Constify a char*. + + * c-lang.c (lang_identify): Constify a char*. + + * objc/objc-act.c (lang_identify): Constify a char*. + +Mon Aug 9 16:21:53 1999 Bernd Schmidt + + * genpeep.c (main): Make generated file include "function.h". + * arm.c (function_really_clobbers_lr): Delete INLINE_HEADER case. + +Mon Aug 9 10:08:50 1999 Bernd Schmidt + + * Makefile.in: Update dependencies. + * alias.c: Include "function.h" + * c-decl.c: Likewise. + * caller-save.c: Likewise. + * calls.c: Likewise. + * combine.c: Likewise. + * cse.c: Likewise. + * explow.c: Likewise. + * final.c: Likewise. + * global.c: Likewise. + * graph.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * optabs.c: Likewise. + * profile.c: Likewise. + * recog.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reload.c: Likewise. + * reorg.c: Likewise. + * resource.c: Likewise. + * sched.c: Likewise. + * stupid.c: Likewise. + * config/1750a/1750a.c: Likewise. + * config/a29k/a29k.c: Likewise. + * config/arc/arc.c: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/thumb.c: Likewise. + * config/c4x/c4x.c: Likewise. + * config/clipper/clipper.c: Likewise. + * config/convex/convex.c: Likewise. + * config/fx80/fx80.c: Likewise. + * config/i860/i860.c: Likewise. + * config/m68k/m68k.c: Likewise. + * config/m88k/m88k.c: Likewise. + * config/mips/mips.c: Likewise. + * config/pdp11/pdp11.c: Likewise. + * config/pyr/pyr.c: Likewise. + * config/romp/romp.c: Likewise. + * config/sh/sh.c: Likewise. + * config/tahoe/tahoe.c: Likewise. + * config/vax/vax.c: Likewise. + * config/we32k/we32k.c: Likewise. + * config/sparc/sparc.c: Include "function.h". + (mem_min_alignment): Test current_function rather than + regno_pointer_align. + * config/pa/pa.c: Likewise. + (compute_frame_size): Delete declaration of + current_function_outgoing_args_size. + * config/arc/arc.h (current_function_varargs): Delete declaration. + * config/elxsi/elxsi.h (current_function_calls_alloca): Delete + declaration. + * config/i370/i370.h (current_function_outgoing_args_size): Delete + declaration. + * config/i386/i386.h (FINALIZE_PIC): Delete declaration of + current_function_uses_pic_offset_table. + * config/m68k/a-ux.h (FUNCTION_EXTRA_EPILOGUE): Delete declaration + of current_function_returns_pointer. + * config/m68k/altos3068.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m68k/linux.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m68k/m68kv4.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m68k/mot3300.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m68k/pbb.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m68k/tower-as.h (FUNCTION_EXTRA_EPILOGUE): Likewise. + * config/m88k/m88k.c: Include "function.h" + (call_used_regs, current_function_pretend_args_size, + current_function_outgoing_args_size, frame_pointer_needed): Delete + declarations. + * config/m88k/m88k.h (current_function_pretend_args_size): Delete + declaration. + * config/mips/mips.h (current_function_calls_alloca): Delete + declaration. + * config/mn10200/mn10200.h (current_function_needs_context, + rtx_equal_function_value_matters): Delete declarations. + * config/ns32k/ns32k (current_function_uses_pic_offset_table, + flag_pic): Delete declarations. + * config/pa/pa.h (current_function_pretend_args_size, + current_function_decl): Delete declarations. + * config/pa/som.h (current_function_varargs): Delete declaration. + * config/pdp11/pdp11.h (current_function_pretend_args_size): Delete + declaration. + * config/pyr/pyr.h (current_function_pretend_args_size, + current_function_args_size, current_function_calls_alloca): Delete + declarations. + * config/sh/sh.h (current_function_varargs): Delete declaration. + * config/sparc/sparc.h (current_function_outgoing_args_size, + current_function_calls_alloca, current_function_decl): Delete + declarations. + * config/spur/spur.h (current_function_pretend_args_size, + current_function_calls_alloca): Delete declarations. + * config/v850/v850.c (current_function_outgoing_args_size): Delete + declaration. + * config/vax/vms.h (current_function_name): Delete declaration. + * gcse.c: Include "function.h". + (current_function_name, current_function_calls_setjmp): Delete + declarations. + * haifa-sched.c: Include "function.h". + (forced_labels): Delete declaration. + * jump.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * genemit.c (main): Make generated file include function.h. + * genoutput.c (output_prologue): Likewise. + + * builtins.c (saveregs_value, apply_args_value): Delete variables. + * emit-rtl.c (reg_rtx_no, first_label_num, first_insn, last_insn, + sequence_rtl_expr, cur_insn_uid, last_linenum, last_filename, + regno_pointer_flag, regno_pointer_flag_length, regno_pointer_align, + regno_reg_rtx, sequence_stack): Delete variables. Add accessor + macros for some of them. + (emit_filename, emit_lineno): Delete declarations. + (gen_reg_rtx): Use memset/memcpy instead of bzero/bcopy. Access + regno_pointer_* variables through current_function. + (gen_inline_header_rtx): Delete function. + (save_emit_status): Delete function. + (set_new_last_label_num): New function. + (clear_emit_caches): New function. + (restore_emit_status): Just clear last_labelnum and call + clear_emit_caches. + (get_last_insn_anywhere): Variable sequence_stack is now accessed + through macro seq_stack. + (add_insn_after): Likewise. + (add_insn_before): Likewise. + (remove_insn): Likewise. + (pop_topmost_sequence): Likewise. + (in_sequence_p): Likewise. + (start_sequence_for_rtl_expr): Likewise. + (start_sequence): Likewise, and likewise for + sequence_rtl_expr/seq_rtl_expr. + (push_topmost_sequence): Likewise. + (end_sequence): Likewise. + (init_virtual_regs): Now takes a "struct emit_status *" argument. + All callers changed. Store into that pointer instead of globals. + (init_emit): Allocate emit elt of current_function. + Changes for sequence_rtl_expr/sequence_stack renaming. + Call clear_emit_caches instead of doing it in-line. + Access regno_pointer_* variables through current_function. + (init_emit_once) Don't clear sequence_stack. + + * expr.c (pending_stack_adjust, inhibit_defer_pop, pending_chain): + Delete variables. + (arg_pointer_save_area): Delete declaration. + (finish_expr_for_function): Renamed from init_queue; no longer static. + (init_expr): Don't call init_queue. + (save_expr_status, restore_expr_status): Delete functions. + (expand_expr): Changes to reflect new layout of struct function. + Don't access current_function_check_memory_usage when current_function + is 0. + * expr.h (forced_labels, save_expr_regs, saveregs_value, + apply_args_value, current_function_calls_alloca, inhibit_defer_pop, + current_function_outgoing_args_size, current_function_arg_offset_rtx, + current_function_uses_const_pool, function_call_count, + current_function_uses_pic_offset_table, nonlocal_labels, + current_function_internal_arg_pointer, nonlocal_goto_stack_level, + current_function_check_memory_usage, nonlocal_goto_handler_slots, + pending_stack_adjust, target_temp_slot_level, temp_slot_level): Delete + declarations. + (finish_expr_for_function): Declare. + * flags.h (current_function_has_nonlocal_label, + current_function_has_nonlocal_goto, current_function_is_thunk, + current_function_has_computed_jump): Delete declarations. + * flow.c (forced_labels): Delete declaration. + * function.c (current_function_pops_args, + current_function_returns_struct, current_function_returns_pcc_struct, + current_function_needs_context, current_function_calls_setjmp, + current_function_calls_longjmp, current_function_has_nonlocal_label, + current_function_has_nonlocal_goto, current_function_is_thunk, + current_function_has_computed_jump, current_function_calls_alloca, + current_function_contains_functions, current_function_returns_pointer, + current_function_epilogue_delay_list, current_function_args_size, + current_function_pretend_args_size, current_function_arg_offset_rtx, + current_function_outgoing_args_size, current_function_varargs, + current_function_stdarg, current_function_args_info, cleanup_label, + current_function_name, current_function_uses_const_pool, + current_function_instrument_entry_exit, current_function_return_rtx, + current_function_uses_pic_offset_table, nonlocal_labels, + current_function_internal_arg_pointer, current_function_cannot_inline, + current_function_check_memory_usage, function_call_count, + nonlocal_goto_handler_slots, nonlocal_goto_handler_labels, + nonlocal_goto_stack_level, return_label, save_expr_regs, + stack_slot_list, rtl_expr_chain, tail_recursion_label, temp_slots, + tail_recursion_reentry, arg_pointer_save_area, frame_offset, + context_display, trampoline_list, parm_birth_insn, invalid_stack_slot, + last_parm_insn, max_parm_reg, parm_reg_stack_loc, sequence_rtl_expr, + temp_slot_level, var_temp_slot_level, target_temp_slot_level): + Delete variables. + (push_function_context_to): Don't save them. Don't call + save_storage_status, save_emit_status or save_expr_status. + (pop_function_context_from): Don't restore them. Don't call + restore_storage_status or restore_expr_status. + (get_func_frame_size): New function. + (get_frame_size): Use it. + (assign_outer_stack_local): Reflect some member name changes in struct + function. + (put_reg_into_stack): Likewise. + (assign_stack_temp_for_type): sequence_rtl_expr was renamed to + seq_rtl_expr. + (fixup_var_refs): Likewise. + (fix_lexical_addr): Likewise. + (trampoline_address): Likewise. + (prepare_function_start): Clear field inlinable of current_function. + (init_function_for_compilation): New function. + (expand_dummy_function_end): New function. + (expand_function_end): Call finish_expr_for_function. + * function.h (struct emit_status): New; fields moved here from struct + function and from global variables. Add accessor macros for some of + the fields. + (struct expr_status): Likewise. + (REGNO_POINTER_ALIGN, REGNO_POINTER_FLAG): Moved here from regs.h. + (struct function): Add fields expr and emit, inlinable, inl_emit, + original_arg_vector, original_decl_initial, inl_last_parm_insn, + inl_max_label_num. Add many comments. + Add accessor macros for all elts of struct function that no longer + have a global variable. + (cleanup_label, return_label, frame_offset, tail_recursion_label, + tail_recursion_reentry, arg_pointer_save_area, rtl_expr_chain, + stack_slot_list): Delete declarations. + (get_func_frame_size): Declare. + (save_expr_status, restore_expr_status, save_emit_status, + save_storage_status, restore_storage_status): Delete declarations. + (init_virtual_regs): Declare. + * output.h (current_function_pops_args, + current_function_returns_struct, current_function_returns_pcc_struct, + current_function_needs_context, current_function_calls_setjmp, + current_function_calls_longjmp, current_function_calls_alloca, + current_function_has_nonlocal_label, current_function_varargs, + current_function_has_computed_jump, current_function_returns_pointer, + current_function_contains_functions, current_function_args_size, + current_function_pretend_args_size, current_function_stdarg, + current_function_outgoing_args_size, current_function_args_info, + current_function_name, current_function_return_rtx, + current_function_epilogue_delay_list, + current_function_uses_const_pool, current_function_cannot_inline): + Delete declarations. + * regs.h (reg_rtx_no, regno_pointer_flag, regno_pointer_flag_length, + regno_reg_rtx): Delete declaration. + (REGNO_POINTER_FLAG): Delete macro. + * stmt.c (expand_goto): Changes to reflect that some fields in struct + function were renamed. + * stor-layout.c (save_storage_status, restore_storage_status): Delete + functions. + * toplev.c: Include "function.h". + (current_function_decl): Delete declaration. + (compile_file): Call init_dummy_function_start and + expand_dummy_function_end around some initializations that need to + emit rtl. + (rest_of_compilation): Use DECL_SAVED_INSNS properly. + Call init_function_for_compilation. + * unroll.c: Include "function.h" + (unroll_loop): Access regno_pointer_* variables through + current_function. + + * tree.h (struct tree_decl): Add elt f to saved_insns member. + (DECL_SAVED_INSNS): use it. + (expand_dummy_function_end): Declare. + (init_function_for_compilation): Declare. + * calls.c (calls_function_1): Change use of DECL_SAVED_INSNS now + that it's no longer an INLINE_HEADER. + (expand_call): Likewise. + * integrate.c (finish_inline): Delete function. + (max_parm_reg, parm_reg_stack_loc): Delete declarations. + (initialize_for_inline): Delete min_labelno, max_labelno and max_reg + args. Don't generate an INLINE_HEADER rtx, just return the arg + vector. All callers changed. + (save_for_inline_copying): Create a duplicate struct emit_status to + hold the emit state for compiling the current function. Use this and + the other new fields in struct function that are for integration + instead of an INLINE_HEADER. + Use memcpy instead of bcopy. + Store the current struct function in DECL_SAVED_INSNS of fndecl. + (save_for_inline_nocopy): Similar changes, except no new emit_status + is needed here. + (expand_inline_function): Get information from function structure, + not from an inline header rtx. + (output_inline_function): Lose code to extract the necessary + information from an inline header; simply put back the function + structure into current_function. Clear its inlinable elt. + * rtl.def (INLINE_HEADER): Delete. + * rtl.h: Delete all accessors for an INLINE_HEADER. + (gen_inline_header_rtx): Delete declaration. + (regno_reg_rtx, regno_pointer_align, nonlocal_goto_handler_labels): + Delete declarations. + (REGNO_POINTER_ALIGN): Delete. + (clear_emit_caches): Declare. + (set_new_last_label_num): Declare. + +Mon Aug 9 01:52:24 1999 Jason Merrill + + * print-tree.c (print_node): Print base for OFFSET_TYPEs. + + * except.c (expand_eh_region_start_for_decl): Always start a new block. + * stmt.c (is_eh_region): Make sure current_function is present, too. + +Mon Aug 9 01:15:24 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (HARD_REGNO_MODE_OK): Correctly handle FPregs, even when + for 64bit PA targets. + + * pa.h (SELECT_SECTION): Define. + * som.h (SELECT_SECTION): Delete. + +Sun Aug 8 15:13:20 1999 Kaveh R. Ghazi + + * alias.c (init_alias_analysis): Wrap call to + `prologue_epilogue_contains' within HAVE_prologue||HAVE_epilogue. + +1999-08-07 Bruce Korb + + * fixinc/inclhack.def(irix_asm_apostrophe): IRIX 5.2's + contains an asm comment with an apostrophe + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + +Sat Aug 7 19:37:07 1999 Richard Henderson + + * function.c (init_function_start): Clear prologue & epilogue. + (prologue_epilogue_contains): New function. + * alias.c (init_alias_analysis): Use it. + * rtl.h (prologue_epilogue_contains): Declare it. + +Sat Aug 7 19:32:16 1999 Richard Henderson + + * jump.c (onlyjump_p): New function. + * rtl.h: Declare it. + * flow.c (delete_unreachable_blocks): Use onlyjump_p instead + of condjump_p in calling tidy_fallthru_edge and merge_blocks. + +Sat Aug 7 17:09:36 1999 Richard Henderson + + * global.c (build_insn_chain): Use EXECUTE_IF_SET_IN_REG_SET + to invert loops. Simplify block scanning. + +Sat Aug 7 02:11:13 1999 Bernd Schmidt + + * gcse.c (hash_scan_set): Treat SYMBOL_REFs like CONST_INTs. + (cprop_insn): Treat SYMBOL_REFs like CONST_INTs. + +1999-08-07 Jonathan Larmour + + * config/sparc/liteelf.h: New file to support sparclite-elf target + * config/sparc/t-sp86x: New file to support sparc86x targets + * config/sparc/sp86x-aout.h: New file to support sparc86x-aout target + * config/sparc/sp86x-elf.h: New file to support sparc86x-elf target + * configure.in: Support above target triplets + * configure: Regenerated + +Sat Aug 7 01:39:27 1999 Philippe De Muyter + + * fixinc/server.c (server_setup): Do not prefix function used as + parameter with `&'. + +Sat Aug 7 00:21:20 1999 Richard Henderson + + * alpha.md (movhi and movqi patterns): Correct predicate for !BWX. + Remove fp reg alternatives. + +Sat Aug 7 00:06:54 1999 Jeffrey A Law (law@cygnus.com) + + * Makefiin (TAROUTOPTS): Kill. + (install-headers-tar): Use "xpf" for tar headerfile extraction + * i370/x-oe (TAROUTOPTS): Delete. + * m68k/x-apollo68 (TAROUTOPTS): Delete. + * m68k/x-hp320 (TAROUTOPTS): Delete. + * m68k/x-hp320g (TAROUTOPTS): Delete. + * gcc.texi: Update bug reporting text. + +1999-08-6 Herman A.J. ten Brugge + + * reg-stack.c (change_stack) Fixed problem with negative array index. + +Fri Aug 6 23:08:44 1999 Jeffrey A Law (law@cygnus.com) + + * extend.texi, install.texi: Fix spelling mistakes. + + * Makefile.in (PREMADE_ATTRTAB_MD, PREMADE_ATTRTAB): Delete. + (s-attrtab); No longer try to use pre-made insn-attrtab file. + * mips/t-bsd: Delete references to obsolete PREMADE_ATTRTAB and + PREMADE_ATTRTAB_MD. + * mips/t-ecoff: Likewise. + * mips/t-elf: Likewise. + * mips/t-mips: Likewise. + * mips/t-osfrose: Likewise. + * mips/t-r3900: Likewise. + * mips/t-svr3: Likewise. + * mips/t-svr4: Likewise. + * mips/t-ultrix: Likewise. + + * gcc.texi: Document recommend means to provide software floating + point libraries in libgcc.a + +1999-08-06 Jason Merrill + + * c-lex.c (yylex): We can have a number with no digits. + +Fri Aug 6 16:53:55 EDT 1999 John Wehle (john@feith.com) + + * jump.c (delete_prior_computation): New function, broken + out of delete_computation. Check for side effects with + side_effects_p instead of FIND_REG_INC_NOTE. Handle + multi-word hard registers. + (delete_computation): Use it. Check for side effects with + side_effects_p instead of FIND_REG_INC_NOTE. Synthesize a + missing REG_DEAD note for a register which is both set and + used by an insn. + +Fri Aug 6 11:05:29 1999 Jeffrey A Law (law@cygnus.com) + + * elf.h (TEXT_SPACE_P, FUNCTION_NAME_P): Delete. + (ASM_GLOBALIZE_LABEL, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT): Likewise. + (ASM_FILE_START): Import _mcount with the right type. + (ASM_DECLARE_FUNCTION_NAME): Define. + (ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL): Define. + * pa.c (output_function_prologue): Always emit the function's label + here. + * pa.h (TEXT_SPACE_P): Define. + (FUNCTION_NAME_P, ENCODE_SECTION_INFO, STRIP_NAME_ENCODING): Likewise. + (ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_GLOBALIZE_LABEL): Likewise. + * som.h (TEXT_SPACE_P): Delete. + (FUNCTION_NAME_P, ENCODE_SECTION_INFO, STRIP_NAME_ENCODING): Likewise. + (ASM_GLOBALIZE_LABEL, ASM_OUTPUT_INT): Likewise. + +Thu Aug 5 19:29:39 1999 Jim Wilson + + * expr.c (emit_group_load): Allow src to be a CONCAT. + +Thu Aug 5 22:27:15 1999 J"orn Rennecke + + * config/sh/lib1funcs.asm (___movstrSI0): Change or r0,r0,r0 to nop. + (___mulsi3): Use '!' comment character. + +Thu Aug 5 13:34:14 1999 Bernd Schmidt + + * reload1.c (maybe_fix_stack_asms): Also declare P as "const char *". + +Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) + + * gcc.c: Update URLs and mail addresses. + * gcc.texi: Likewise. + +Thu Aug 5 01:14:13 1999 Daniel Jacobowitz + + * rs6000.c (current_file_function_operand): Return zero for + weak functions. + (rs6000_encode_section_info): Do not set SYMBOL_REF_FLAG for + weak symbols. + * rs6000.h (ENCODE_SECTION_NIFO): Do not set SYMBOL_REF_FLAG + for weak symbols. + +Thu Aug 5 00:56:30 1999 Geoffrey Keating + + * rs6000.c (rs6000_stack_info): For ABI_V4/ABI_SOLARIS -fpic, always + allocate space in the stack frame for the PIC register. + +Thu Aug 5 00:20:47 1999 Jeffrey A Law (law@cygnus.com) + + * m68k.md (xordi3, anddi3): These patterns are not available on + the coldfire. + +Wed Aug 4 23:39:20 1999 Mark Mitchell + + * real.c (GET_REAL): Don't violate ANSI/ISO aliasing rules. + (PUT_REAL): Likewise. + +Wed Aug 4 20:45:04 1999 J"orn Rennecke + + * final.c (shorten_branches): Don't add an alignment for loops + that have no label inside. + +Wed Aug 4 16:39:24 1999 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memcmp, expand_builtin_strcmp): Wrap + prototypes in macro HAVE_cmpstrsi. + + * cpplib.c (cpp_get_token): Remove unused label `op3'. + + * emit-rtl.c (operand_subword): Remove unused variable + `bits_per_word'. + + * rtl.c (shallow_copy_rtx): Remove unused variable `format_ptr'. + + * tree.c (chainon): Wrap variable `t2' in macro ENABLE_CHECKING. + +Wed Aug 4 13:29:23 1999 Zack Weinberg + + * cpphash.c (macroexpand): Delete leading whitespace when arg + is concatenated before. + (unsafe_chars): Correct test for whether + and - can extend a + token. + + * cppinit.c (cpp_start_read): Do dependencies for + -include/-imacros files also. + + * cpplib.c (cpp_scan_buffer): In no-output mode, don't bother + tokenizing non-directive lines. + (cpp_expand_to_buffer): Temporarily disable no-output mode. + * cppmain.c: In no-output mode, just call cpp_scan_buffer for + the input file. + +Wed Aug 4 12:53:44 1999 Jason Merrill + + * expr.c (expand_expr, case PLUS_EXPR): Fix parallel case, too. + + * c-lex.c: Sync with C++ frontend. + (linemode): New variable. + (parse_float): imag, conversion_errno, and type are output only. + (yylex): Adjust. Move initial '.' case into main switch. + Use linemode. + (handle_generic_pragma): Just deal with tokens. + (readescape): Use ISXDIGIT and ISGRAPH. + * c-parse.in: Add END_OF_LINE token. + + * c-lex.c (lang_init): Generalize. + (nextchar): Remove. Replace uses with UNGETC. + (skip_white_space): Handle linemode here. Optimize for cpplib. + (skip_white_space_on_line): Remove. + (extend_token_buffer_to): New fn. + (extend_token_buffer): Use it. + (read_line_number, check_newline): Just deal with tokens. + (token_getch, token_put_back): New fns. + (yylex): Use them. More cpplib optimizations. Simplify. + +Wed Aug 4 12:53:44 1999 Michael Tiemann + Jason Merrill + + * c-lex.c (init_parse): Set cpp_token to CPP_DIRECTIVE. + (consume_string): Make this smart about USE_CPPLIB. + (check_newline): Rewrite to be intelligent about USE_CPPLIB. + (yylex): Rewrite to be intelligent about USE_CPPLIB. + Also, clean up cases where we redundantly set token_buffer[0]. + (read_line_number): New fn. + (ignore_escape_flag): New variable. + +Wed Aug 4 13:12:17 1999 Jeffrey A Law (law@cygnus.com) + + * a29k/t-a29kbare: Fix some comments. + (LIB2FUNCS_EXTRA): Remove fp-bit.c and dp-bit.c + (FPBIT, DPBIT): Define. + * a29k/t-vx29k: Likewise. + * arc/t-arc: Likewise. + * arm/t-arm-elf: Likewise. + * arm/t-bare: Likewise. + * arm/t-pe: Likewise. + * arm/t-pe-thumb: Likewise. + * arm/t-semi: Likewise. + * arm/t-thumb: Likewise. + * arm/t-thumb-elf: Likewise. + * arm/t-thumb-linux: Likewise. + * h8300/t-h8300: Likewise. + * i960/t-i960: Likewise. + * i960/t-vxworks960: Likewise. + * m32r/t-m32r: Likewise. + * mips/t-ecoff: Likewise. + * mips/t-elf: Likewise. + * mips/t-r3900: Likewise. + * pa/t-pro: Likewise. + * rs6000/t-aix43: Likewise. + * rs6000/t-beos: Likewise. + * rs6000/t-newas: Likewise. + * rs6000/t-ppccomm: Likewise. + * rs6000/t-rs6000: Likewise. + * rs6000/t-winnt: Likewise. + * rs6000/t-xnewas: Likewise. + * rs6000/t-xrs6000: Likewise. + * sh/t-sh: Likewise. + * sparc/t-elf: Likewise. + * sparc/t-sparcbare: Likewise. + * sparc/t-sparclite: Likewise. + * sparc/t-splet: Likewise. + * v850/t-v850: Likewise. + * mn10200/t-mn10200: Fix comments. + * mn10300/t-mn10300: Likewise. + + * pa.md (divsi3, udivsi3, modsi3, umodsi3 expanders): Clobber a new + dummy operand. Allocate a new pseudo for the dummy operand. + (divsi3, udivsi3, modis3, umodsi3 patterns): Corresponding changes. + + * pa.md (movqi, movhi patterns): Do not expose FP regs to regclass. + +Wed Aug 4 11:53:55 1999 Tom Tromey + + * configure: Rebuilt. + * configure.in: Removed --enable-java-gc option and JAVAGC subst. + +Wed Aug 4 09:06:14 1999 Richard Earnshaw (rearnsha@arm.com) + + * recog.c (preproces_constraints): Zero recog_op_alt before + processing the constraints. + + * arm.c (typedef minipool_node): Renamed from pool_node. + (minipool_vector, minipool_size, minipool_vector_label): Similarly. + (add_minipool_constant): New function. + (dump_minipool): New function. + (find_barrier): Remove special case for getting the insn size of + an insn that references the constant pool. + (minipool_fixup): New structure. + (push_minipool_barrier): New function. + (push_minipool_fix): New function. + (note_invalid_constants): New function. + (add_pool_constant, dump_table, fixit, broken_move): Delete. + (arm_reorg): Rewrite code to fix up the constant pool into a + series of mini-pools embedded in the insn stream. + (arm_output_epilogue): New function, made mainly from the body + of output_func_epilogue. + (output_func_epilogue): Move insn generation part of epilogue code + to arm_output_epilogue. + * arm.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Delete. + * arm.md (pool_range): New attribute. + (zero_extendqidi2): Add attribute pool_range. + (zero_extend_hisi_insn, load_extendqisi, extendhisi_insn, + extendqihi_insn, extendqisi_insn, movdi, movsi_insn, pic_load_addr, + pic_load_addr_based_insn, movhi_insn_arch4, movhi_insn_littleend, + movhi_insn_bigend, loadhi_si_bigend, movsf_hard_insn, movsf_soft_insn, + movdf_hard_insn, movdf_soft_insn, movxf_hard_insn): Likewise. + (epilogue): New expand. + (epilogue_insn): New insn. Call arm_output_epilogue. + + * arm.c (arm_poke_function_name): Undo change of July 17. Tidy up. + * arm.h (TARGET_SWITCHES): Add missing doc string for TARGET_DEFAULT. + +Mon Aug 2 19:18:44 1999 Jason Merrill + + * linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +1999-08-04 Mark Elbrecht + + * config/i386/djgpp.h (BSS_SECTION_ASM_OP): Define. + +Wed Aug 4 02:15:32 1999 Richard Henderson + + * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. + +Wed Aug 4 01:48:08 1999 Jim Kingdon + + * global.c: Fix comment. + +Wed Aug 4 01:43:01 1999 Ian Lance Taylor + + * gcc.c (access_check): New static function. + (find_a_file): Use it when searching a directory list. + * collect2.c (find_a_file): Don't accept directories found when + searching a directory list. + +Wed Aug 4 01:40:43 1999 Philippe De Muyter + + * tlink.c (symbol_hash_lookup): Do not prefix functions used as + function parameters with `&'. + (file_hash_lookup, demangled_hash_lookup, tlink_init): Ditto. + +Wed Aug 4 01:08:44 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (delete_unreachable_blocks): Do not call merge_blocks + or tidy_fallthru_edge if the last insn in the block is not + an unconditional jump or a simple conditional jump. + +Tue Aug 3 20:21:20 1999 J"orn Rennecke + + * Makefile.in (c-decl.o): Depends on defaults.h. + +Tue Aug 3 14:14:52 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (HARD_REGNO_NREGS): FP registers are always 4 bytes wide for + PA1.1 and above. + (CLASS_MAX_NREGS): Likewise. + +Tue Aug 3 03:51:20 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Fix dumb thinko in last change. + +Tue Aug 3 10:36:13 1999 Bernd Schmidt + + * reload1.c (maybe_fix_stack_asms): Declare CONSTRAINTS as + "const char *". + +Mon Aug 2 23:45:45 1999 Hans-Peter Nilsson + + * dwarf2out.c (add_location_or_const_value_attribute): Correct + test for sizes of passed and declared parameter types. + +Tue Aug 3 00:03:41 1999 Kaveh R. Ghazi + + * fixincludes: Fix the return type of bsearch, char* -> void*. + + * fixinc/inclhack.def: Likewise. + +Mon Aug 2 18:29:32 1999 Mark Mitchell + + * invoke.texi (-fdump-translation-unit): New option. + +Mon Aug 2 17:54:19 1999 Richard Henderson + + * expr.h (PROMOTE_PROTOTYPES): Move ... + * defaults.h: ... to here. + * c-decl.c: Include defaults.h instead of expr.h. + * c-typeck.c: Include defaults.h. + +Mon Aug 2 17:10:24 1999 Mark Mitchell + + * toplev.h (errorcount): Declare. + (warningcount): Likewise. + (sorrycount): Likewise. + * c-lex.c (errorcount): Don't declare. + * dwarf2out.c (errorcount): Don't declare. + +Mon Aug 2 17:02:08 1999 Jason Merrill + + * config/libgloss.h: Add a note discouraging use with ELF. + * configure.in: Don't use libgloss.h for ELF targets. + Always use_collect2 on a.out targets. + +Mon Aug 2 16:27:42 1999 Jim Wilson + + * combine.c (force_to_mode, case LSHIFTRT): Add goto shiftrt. + (force_to_mode, case ASHIFTRT): Add shiftrt label. + +Tue Aug 3 00:45:02 1999 J"orn Rennecke + + * loop.c (strength_reduce): When doing biv->giv conversion, update + reg note of NEXT->insn. + +1999-08-02 Jakub Jelinek + + * real.c (PUT_REAL): Clear unused bytes if long double is IEEE quad. + +1999-08-02 Jakub Jelinek + + * c-decl.c (get_parm_info, store_parm_decls): Change all uses of + PROMOTE_PROTOTYPES, so that it tests it as a C expression. + Ensure expr.h is included. + * c-typecheck.c (convert_arguments): Ditto. + + * expr.h: Supply default for PROMOTE_PROTOTYPES (0). + + * config/arc/arc.h: Define PROMOTE_PROTOTYPES to 1. + * config/convex/convex.h: Ditto. + * config/dsp16xx/dsp16xx.h: Ditto. + * config/fx80/fx80.h: Ditto. + * config/gmicro/gmicro.h: Ditto. + * config/i370/i370.h: Ditto. + * config/i386/i386.h: Ditto. + * config/m32r/m32r.h: Ditto. + * config/m68k/m68k.h: Ditto. + * config/m88k/m88k.h: Ditto. + * config/mips/mips.h: Ditto. + * config/pa/pa.h: Ditto. + * config/pyr/pyr.h: Ditto. + * config/tahoe/tahoe.h: Ditto. + * config/we32k/we32k.h: Ditto. + + * config/sparc/sparc.h: Define PROMOTE_PROTOTYPES + based on arch size. + + * config/i1750a/i1750a.h: Define PROMOTE_PROTOTYPES to 0. + + * config/i860/paragon.h: Remove PROMOTE_PROTOTYPES + from comment. + + * tm.texi: Document new usage of PROMOTE_PROTOTYPES. + +1999-08-02 Richard Henderson + + * m32r.c (m32r_setup_incoming_varargs): Use get_varargs_alias_set + for the register spill block. + (m32r_va_arg): New. + * m32r.h (EXPAND_BUILTIN_VA_ARG): New. + (EXPAND_BUILTIN_SAVEREGS): Delete #if 0 code. + + * m32r.h (INT8_P): Don't short-cut test with (unsigned). + (INT16_P, CMP_INT16_P, UINT16_P): Likewise. + (UPPER16_P, UINT24_P, INT32_P, UINT5_P): Likewise. + +1999-08-02 Jakub Jelinek + + * config/sparc/linux.h: Define WCHAR_TYPE as "int" and undef + MAX_WCHAR_TYPE defined in sparc.h. + * config/sparc/linuxaout.h: Likewise. + * config/sparc/linux64.h: Likewise. + Also default to -mvis if CPU is UltraSPARC. + +1999-08-02 Jakub Jelinek + + * config/sparc/sparc.h (ASM_DECLARE_REGISTER_GLOBAL): New macro. + (RTX_OK_FOR_OLO10): Likewise. + (GO_IF_LEGITIMATE_ADDRESS): If assembler supports offsetable + %lo(), allow it in addresses... + (PRINT_OPERAND_ADDRESS): ... and print it appropriately. + * config/sparc/sparc.md (sethi_di_medlow_embmedany_pic): sethi %lo() + does not make sense. + * config/sparc/sparc.c (sparc_hard_reg_printed): New array. + (sparc_output_scratch_registers): New function. + (output_function_prologue, sparc_flat_output_function_prologue): Use + it. + * varasm.c (make_decl_rtl): Use ASM_DECLARE_REGISTER_GLOBAL if + defined. + * tm.texi (ASM_DECLARE_REGISTER_GLOBAL): Document it. + * configure.in: Add check for .register pseudo-op support in as and + check for offsetable %lo(). + * acconfig.h: Add templates for the above checks. + * configure: Regenerate. + +1999-08-02 Richard Henderson + + * sparc/linux64.h (TARGET_DEFAULT): Remove MASK_APP_REGS. + * sparc/sol2-sld-64.h (TARGET_DEFAULT): Likewise. + * sparc/sol2.h (TARGET_DEFAULT): Likewise. + +Mon Aug 2 23:46:45 1999 J"orn Rennecke + + * loop.c (strength_reduce): When doing biv->giv conversion, fix up + reg_biv_class. + +1999-08-02 Jakub Jelinek + + * config/float-sparc.h: New file. + * configure.in: Use float_format=sparc for sparc-*-linux-gnulibc1, + sparc-*-linux-gnu and sparc64-*-linux*. + +1999-08-02 Franz Sirl + + * rs6000.c (rs6000_va_list): Type is an array. + (rs6000_va_start): Don't doubly adjust for varargs. + (rs6000_va_arg): Evaluate long long GPR adjustment. + +Mon Aug 2 16:15:57 1999 David Edelsohn + + * rs6000/aix43.h (SUBTARGET_SWITCHES): Use -m64 and -m32 instead of + -maix64 and -maix32. + (ASM_SPEC, ASM_CPU_SPEC, CPP_SPEC, CPP_CPU_SPEC, LIB_SPEC, + LINK_SPEC): Change appropriately. + * rs6000/rs6000.c (short_cint_operand): Use CONST_OK_FOR_LETTER_P. + (u_short_cint_operand): Likewise. + * rs6000/rs6000.md (movdi splitters): Add TARGET_POWERPC64 support + for 64-bit hosts. + * rs6000/t-aix43 (MULTILIB): Change to -m64. + + * invoke.texi (RS/6000 Submodel): Document 64-bit processor options. + +Mon Aug 2 16:15:57 1999 Geoff Keating + + * rs6000/rs6000.c (num_insns_constant_wide): Correct + for type promotion. + (add_operand): Get test correct for 64-bit HOST_WIDE_INT. + (non_add_cint_operand): Likewise. + (logical_operand): Likewise. + (non_logical_cint_operand): Likewise. + (print_operand): Correct printf()s for 64-bit HOST_WIDE_INT. + (print_operand_address): Correct printf() for 64-bit HOST_WIDE_INT. + (rs6000_select_rtx_section): Suppress warning. + (small_data_operand): Suppress warning. + (rs6000_got_register): Suppress warning. + * rs6000/rs6000.md (andsi3): HOST_WIDE_INT is a signed + type, so `J' is generally the wrong constraint for a SImode value; + use `L' instead. + (andsi3_internal2): Likewise. + (andsi3_internal3): Likewise. + (iorsi3_internal1): Likewise. + (xorsi3_internal1): Likewise. + (movsi): Likewise. + (movsf_softfloat): Likewise. + (scc insns): Likewise. + (movsi+2): Preserve sign bits of SImode constant. + (floatsidf2_internal+1): Sign-extend SImode constant correctly. + (movdf+1): Sign-extend properly. + (movdi_32+1): Sign-extend properly. + (scc insns): Sign-extend properly. + + * md.texi (RS/6000 EXTRA_CONSTRAINTS): Update documentation for J, + K, L, and T. + +1999-08-02 Richard Henderson + + * alpha.c (override_options): Move ev6 alpha_tp frobbing out of + -mcpu parsing code. + (print_operand): Notice alpha_fptm not alpha_tp for sw completion. + * alpha.md (all fp insns): Likewise. + +1999-08-02 Nick Clifton + + * config/v850/v850.h (STRICT_ALIGNMENT): Only define if not + already defined. + +Mon Aug 2 03:38:33 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (legitimize_pic_address): Clarify comments. Do not call the + pic_load_label generator directly. + * pa.md (pic_load_label): Clarify comments. Remove modes on operands. + No longer a named pattern. + +Mon Aug 2 09:38:10 1999 Nick Clifton + + * explow.c (force_reg): Call force_operand if X does not + satisfy general_operand. + +Mon Aug 2 01:34:22 1999 Jeffrey A Law (law@cygnus.com) + + * fix-header.c (main): When testing for CONTINUED, use string + equality, not pointer equality. + +Mon Aug 2 01:27:24 1999 Dan Nicolaescu + + * sparc.c (sparc_block_profiler): Use the %g2 register, not %o0. + +Sun Aug 1 22:46:42 1999 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Fix loop which deletes insns after a jump + that has become an unconditional jump. + + * m68k.c (output_function_prologue): Fix typo in CPU32 case. + (output_function_epilogue): Similarly. + +Sun Aug 1 20:14:00 1999 Bernd Schmidt + + * tree.h (init_dummy_function_start): Declare. + +Sun Aug 1 12:55:31 1999 Bernd Schmidt + + * stmt.c (emit_filename, emit_lineno, expr_stmts_for_value, + last_expr_type, last_expr_value, block_start_count, block_stack, + stack_block_stack, cond_stack, loop_stack, case_stack, nesting_stack, + nesting_depth, goto_fixup_chain): Delete global vars; now allocated + dynamically in stmt elt of struct function for each function. + (struct nesting): Rename function_call_count elt to n_function_calls, + target_temp_slot_level to block_target_temp_slot_level. All users + changed. + (struct stmt_status): New structure definition. + Add many accessor macros for stmt_status elements which previously + were global variables. + (init_stmt_for_function): Allocate stmt elt for current_function. + Reflect that block_start_count was renamed to + current_block_start_count. + (save_stmt_status, restore_stmt_status): Delete functions. + (preserve_subexpressions_p): Don't access loop_stack when outside + a function. + (expand_start_bindings): Reflect that block_start_count was renamed to + current_block_start_count. + (expand_fixup): Likewise. + (expand_decl): Don't access block_stack when outside a function. + (expand_decl_cleanup): Likewise. + (expand_dcc_cleanup): Likewise. + (expand_dhc_cleanup): Likewise. + (expand_anon_union_decl): Likewise. + (set_file_and_line_for_stmt): New function. + (in_control_zone_p): New function. + + * function.h (struct function): Add new elt stmt. + Delete elts block_stack, stack_block_stack, cond_stack, loop_stack, + case_stack, nesting_stack, nesting_depth, block_start_count, + last_expr_type, last_expr_value, expr_stmts_for_value, emit_filename, + emit_lineno, goto_fixup_chain. + (save_eh_status, restore_eh_status, save_stmt_status, + restore_stmt_status): Delete declarations. + * function.c (push_function_context_to): Don't call save_stmt_status. + (pop_function_context_to): Don't call restore_stmt_status. + * tree.h (in_control_zone_p): Declare. + * rtl.h (set_file_and_line_for_stmt): Declare. + + * emit-rtl.c (emit_line_note): Don't set emit_filename/emit_lineno; + call set_file_and_line_for_stmt. + +Thu Jul 31 12:34:45 1999 Joe Buck + + * gcc.texi: Use terms "GNU Compiler Collection" and "GCC". + Also update copyright. + +Sat Jul 31 11:10:07 1999 Bernd Schmidt + + * c-pragma.c: Don't include "except.h". + * emit-rtl.c: Likewise. + * stor-layout.c: Likewise. + * tree.c: Likewise. + * varasm.c: Likewise. + + * flow.c: Include "function.h". + * tree.h (init_dummy_function_start): Declare new function. + + * except.h (struct eh_status): New structure. + (struct label_node, struct eh_entry): Declare even if tree.h hasn't + been included. + (eh_return_stub_label, ehstack, catchstack, ehqueue, + catch_clauses, false_label_stack, caught_return_label_stack, + protect_list, current_function_ehc): Add accessor macros for the + corresponding fields in current_function->eh; delete declarations + for all items that used to be declared here. + * except.c (eh_return_stub_label, ehstack, catchstack, ehqueue, + catch_clauses, false_label_stack, caught_return_label_stack, + protect_list, current_function_ehc): Delete variables. + (init_eh_for_function): Allocate current_function->eh. + (save_eh_status, restore_eh_status): Delete functions. + + * function.h (struct function): Add fields next_global and eh. + Delete all exception handling related fields. + * function.c (current_function): New variable. + (all_functions): New variable. + (push_function_context_to): Don't allocate a struct function, + use current_function instead. Call init_dummy_function_start when + outside a function. Clear current_function before returning. + (pop_function_context_from): Restore current_function. + Don't free the restored struct function. + (prepare_function_start): New function. + (init_dummy_function_start): New function. + (init_function_start): Break out some code into prepare_function_start + and call it here. + + * stmt.c (save_stmt_status): Don't call save_eh_status. + (restore_stmt_status): Don't call restore_eh_status. + + * Makefile.in: Update dependencies. + +Sat Jul 31 04:10:01 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (compute_frame_size): Use STARTINg_FRAME_OFFSET instead + of depending on a magic constant value. Update comments. + (hppa_expand_prologue): Similarly. + + * pa.md (reload_indi, reload_outdi): Allow any register for the + original reload register. + +Fri Jul 30 19:41:35 1999 Jim Wilson + + * cccp.c (print_help): Change marcos to macros. + +1999-07-30 Richard Henderson + + * c-typeck.c (initializer_constant_valid_p): Move ... + * c-common.c (initializer_constant_valid_p): ... here. Use + FOO_TYPE_P instead of tests against TREE_CODE. Allow subtraction + of label addresses. + * c-common.h (initializer_constant_valid_p): Declare. + * c-tree.h (initializer_constant_valid_p): Remove. + +Fri Jul 30 16:33:42 1999 Mathias Froehlich + + * config/i386/sol2-c1.asm: Align the stack. + * config/i386/sol2-gc1.asm: Likewise. + +1999-07-30 Vladimir Makarov + + * config/sparc/sparc.h (ASM_CPU32_DEFAULT_SPEC): Change -Av8 onto + -Asparclite for sparc86x. + (CPP_CPU32_DEFAULT_SPEC, CPP_CPU_SPEC): Remove -D__sparc_v8__ for + sparc86x. + (ASM_CPU_SPEC): Use -Asparclite for sparc86x. + +Fri Jul 30 14:53:56 1999 Jakub Jelinek + + * config/sparc/linux64.h (CC1_SPEC): Preserve CPU specified by + the user if using the non-default arch size in BI_ARCH configuration. + * config/sparc/sol2-sld-64.h (CC1_SPEC): Ditto. + + * config/sparc/sparc.md (cmp_mul_set, cmp_udiv_cc_set): + Fix patterns so that they actually match. + (cmp_sdiv_cc_set): Ditto, also don't require g0 to be zero. + (mulsidi3_sp64, const_mulsidi3_sp64): New patterns. + (const_mulsidi3_sp32): Renamed from const_mulsidi3, only on + TARGET_HARD_MUL32. + (mulsidi3): Reflect this in the expand. + (smulsi3_highpart): Only on TARGET_ARCH32. + (umulsidi3_sp64, const_umulsidi3_sp64): New patterns. + (const_umulsidi3_sp32): Renamed from const_umulsidi3. + (umulsidi3): Reflect this in the expand. + (umulsi3_highpart): Only on TARGET_ARCH32. + (divsi3_sp32): Renamed from divsi3, only on TARGET_ARCH32, + don't require g0 to be zero. + (udivsi3_sp32): Renamed from udivsi3, only on TARGET_ARCH32. + ({,u}divsi3): New expands. + ({,u}divsi3_sp64): New patterns. + (after lshrdi3_v8plus): Four new patterns to help combiner + optimizing nested mixed mode shifts. + + * config/sparc/sparc.c (sparc_override_options): Use deprecated + v8 instructions if optimizing for UltraSPARC I, II, IIi, as it + speed things up. Don't use them by default on plain v9 in 64bit + mode, according to what SPAMv9 sais. + + * config/sparc/sparc.h: Fix comments, e.g. Linux already preserves + top 32 bits of %[og][0-7] in signal handlers. + Also, TARGET_HARD_MUL32 now is only true for TARGET_ARCH32. + +Fri Jul 30 03:00:41 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (zvdep_imm32): Renamed from zvdep_imm. + (ashlsi3): Corresponding changes. + + * pa.c (compute_zdepwi_operands): Renamed from compute_zdepi_operands. + +Thu Jul 29 18:37:13 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (FIRST_PARM_CALLER_OFFSET): Delete. + +Thu Jul 29 19:01:58 1999 Bernd Schmidt + + * arm.h (Hint): Delete macro. + Substitute HOST_WIDE_INT for Hint in some prototypes. + * arm.c: Substitute HOST_WIDE_INT for Hint in one prototype. + +Thu Jul 29 09:21:42 1999 Nick Clifton + + * builtins.c (expand_builtin_setjmp): Use force_operand to + make sure that the buffer address is in a suitable form to be + passed to force_reg. + +Wed Jul 28 12:50:48 1999 Geoff Keating + + * config/mips/mips.c: system.h handles MIN and MAX, don't undefine + them here. + +Wed Jul 28 13:18:35 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (indirect_jump): Remove mode from match_operand. Verify + proper mode in the condition string. + (icacheflush, dcacheflush): Remove modes from match_operands. + + * pa.c (emit_move_sequence): Always convert scratch_reg to the + proper mode before using it. + + * pa.md (adddi3, subdi3): Turn into a define_expand/define_insn + pair. + + * pa.c (store_reg): Do not call add_high_const generator directly. + (load_reg, set_reg_plus_d): Likewise. + * pa.md (add_high_const): No longer a named pattern. + + * pa.c (legitimize_address): Consistently use Pmode rather than + SImode. Do not call gen_pic2_highpart directly anymore. + * pa.md (pic2_highpart): No longer a named pattern. + (pic2_lo_sum): Similarly. Reformat to make more readable. + + * pa.md (call, call_value): Use "word_mode" instead of "SImode" as + needed. + + * README: Update. + +Wed Jul 28 11:28:04 1999 Franz Sirl + + * builtins.c (expand_builtin): Typo in call to expand_builtin_ffs. + +Wed Jul 28 11:23:48 1999 Richard Henderson + + * pa.c (hppa_builtin_saveregs): Use get_varargs_alias_set + and tag the spill mems. + (hppa_va_start): New. + (hppa_va_arg): New. + * pa.h (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + +Wed Jul 28 11:22:21 1999 Richard Henderson + + * mn10300.c (mn10300_builtin_saveregs): Use get_varargs_alias_set + and tag the spill mems. + (mn10300_va_start): New. + (mn10300_va_arg): New. + * mn10300.h (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + +Wed Jul 28 11:20:19 1999 Richard Henderson + + * mn10200.c (mn10200_va_arg): New. + * mn10200.h (EXPAND_BUILTIN_VA_ARG): New. + +Wed Jul 28 11:19:06 1999 Richard Henderson + + * builtins.c (std_expand_builtin_va_arg): Use int_size_in_bytes + rather than play with TREE_INT_CST_LOW. + +1999-07-27 Philip Blundell + + * config/arm/telf.h: Include dbxelf.h. + (CPP_PREDEFINES): Only define if not already defined. + (ASM_IDENTIFY_GCC): Likewise. + (SUBTARGET_EXTRA_SECTIONS): Likewise. + (SUBTARGET_EXTRA_SECTION_FUNCTIONS): Likewise. + * config/arm/thumb.h (LINK_SPEC): Only define if not already + defined. + (DBX_DEBUGGING_INFO): Don't define. + * config/arm/linux-telf.h: New file. + * config/arm/linux-tgas.h: New file. + * config/arm/t-thumb-linux: New file. + * config/arm/uclinux-elf.h: New file. + * config/arm/uclinux-telf.h: New file. + * configure.in (arm-*-uclinux, thumb-*-linux-gnu, + thumb-*-uclinux): New targets. + * configure: Regenerate. + +Tue Jul 27 23:20:21 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (post_store, pre_load): New expanders. + (post_stwm, pre_ldwm): Renamed to post_stw and pre_ldw respectively. + (post_ldwm, pre_stwm): Make these unnamed patterns since we never + need to directly generate RTL for them. + * pa.c (hppa_expand_prologue, hppa_expand_epilogue): Corresponding + changes. + +Tue Jul 27 16:05:52 1999 David Edelsohn + + * aix43.h (ASM_CPU_SPEC, CPP_CPU_SPEC): Add rs64a and PPC630. + * rs6000.c (processor_target_table): Add powerpc64, rs64a, and PPC630. + (rs6000_cpu): Choose between 32-bit and 64-bit default processors. + (secndary_reload_class): Make TARGET_ELF conditional compile. + (print_operand_address): Similar. + (output_toc): Print all values as hex. + (get_issue_rate): Rearrange and add RS64A and PPC630. + * rs6000.h (processor_type): Add RS64A and PPC630. + (PROCESSOR_POWERPC64): New. + (PROMOTE_MODE): Use word_mode. + (RTX_COSTS): Add RS64A and PPC630. + * rs6000.md (scheduling information): Add lmul and ldiv + representing 64-bit integer multiply and divide. Add rs64a and + PPC630 information. + (ashldi3): Add support for "rldic" instruction. + * sysv4.h (PROCESSOR_DEFAULT): Change to PROCESSOR_750. + +Tue Jul 27 15:31:53 1999 Vladimir Makarov + + * config/sparc/sparc.c (sparc_override_options): Enable SPARCLITE + instead of V8 for sparclite86x in cpu_table. + +Tue Jul 27 17:49:42 1999 Bernd Schmidt + + * config/arm/coff.h (ASM_FILE_START): If generating SDB output, call + output_file_directive. + +Tue Jul 27 03:15:33 1999 Jason Merrill + + * expr.c (expand_expr, case PLUS_EXPR): Get the mode from the + tree for op1, not the rtl. + +Tue Jul 27 00:18:34 1999 Richard Henderson + + * m88k.c (m88k_builtin_saveregs): Break out the constructor code + to m88k_va_start, leaving only the register spill. + (m88k_build_va_list): New. + (m88k_va_start): New. + (m88k_va_arg): New. + * m88k.h (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + +Mon Jul 26 19:07:11 1999 Geoff Keating + + * config/rs6000/rs6000.c (rs6000_expand_builtin_saveregs): + Rename from expand_builtin_saveregs. + * config/rs6000/rs6000.h (EXPAND_BUILTIN_SAVEREGS): Change caller. + +Mon Jul 26 22:52:47 1999 Richard Henderson + + * i960.c (i960_setup_incoming_varargs): Use get_varargs_alias_set + for the register spill block. + (i960_build_va_list): New. + (i960_va_start): New. + (i960_va_arg): New. + * i960.h (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + * i960.md (store_multiple): Use change_address on individual mems. + +Mon Jul 26 22:43:12 1999 Richard Henderson + + * builtins.c (stabilize_va_list): Don't INDIRECT_REF through + an ARRAY_TYPE. + (std_expand_builtin_va_start): Back out one word if !stdarg_p. + (expand_builtin_va_end): Evaluate arg for side effects. + * c-common.c (c_common_nodes_and_builtins): Construct a + va_list_arg_type_node to handle array decomposition to pointer. + +Mon Jul 26 18:51:34 1999 Richard Henderson + + * except.c (st_dynamic_cleanup): Use force_operand on the + buffer's address. + +Mon Jul 26 16:43:26 1999 Richard Henderson + + * c4x.h (EXPAND_BUILTIN_VA_ARG): New. + * c4x.c (c4x_va_arg): New. + +Mon Jul 26 12:30:09 1999 Jason Merrill + + * cpplib.c (cpp_get_token): Don't return a CPP_POP if the buffer + has manual_pop set. + +1999-07-26 Nathan Sidwell + + * eh-common.h (__eh_matcher): Prototype correctly. + +Mon Jul 26 17:24:51 1999 Philip Blundell + + * config/arm/thumb.h (THUMB_FLAG_SINGLE_PIC_BASE): Define. + (TARGET_SINGLE_PIC_BASE): Likewise. + (GOT_PCREL, NEED_GOT_RELOC, NEED_PLT_RELOC): Provide default + definitions. + (TARGET_CALLEE_INTERWORKING): Fix typo in comment. + (TARGET_SWITCHES): Add -m{no-}single-pic-base. + (TARGET_OPTIONS): Add -mpic-register=N. + (OUTPUT_INT_ADDR_CONST): New macro. + (INDEX_REGISTER_RTX_P, PIC_OFFSET_TABLE_REGNUM, FINALIZE_PIC, + LEGITIMATE_PIC_OPERAND_P): Likewise. + (LEGITIMIZE_ADDRESS, GOT_IF_LEGITIMATE_ADDRESS): Support PIC. + (ASM_OUTPUT_INT): Use OUTPUT_INT_ADDR_CONST rather than calling + output_addr_const directly. + (PRINT_OPERAND_PUNCT_VALID_P): Accept `|' for compatibility with + ARM port. + (thumb_pic_register, thumb_pic_register_string): Declare. + + * config/arm/thumb.c (symbol_mentioned_p): New function: Imported + from arm.c. + (label_mentioned_p): New function: Imported from arm.c. + (legitimize_pic_address): New function: Imported from arm.c. + (is_pic):New function: Imported from arm.c. + (thumb_finalize_pic):New function: Imported from arm.c. + (add_constant): Cope with PIC constants. + (fixit): Cope with PIC constants. + (output_return): Do not treat the PIC register as live if + TARGET_SINGLE_PIC_BASE is true. + (thumb_function_prologue): Do not treat the PIC register as live if + TARGET_SINGLE_PIC_BASE is true. + (thumb_expand_prologue): Do not treat the PIC register as live if + TARGET_SINGLE_PIC_BASE is true. + (thumb_unexpand_epilogue): Do not treat the PIC register as live if + TARGET_SINGLE_PIC_BASE is true. + (thumb_print_operand): Accept '|'. + (thumb_override_options): Process PIC options. + + * config/arm/thumb.md (movsi): Support PIC. + (call_insn): Change "i" constraint to "X". + (call_value_insn): Likewise. + (consttable_4, consttable_8, consttable_end): Set and clear + "making_const_table" as appropriate. + (pic_load_addr, pic_add_dot_plus_four): New insns. + + * invoke.texi (Thumb Options): Fix spelling. Document new + options -msingle-pic-base and -mpic-register=. + +1999-07-26 Andrew Haley + + * config/m32r/initfini.c (__init): Use a full word immediate for + __fini: this allows it to be placed in any memory region. + + * config/m32r/t-m32r: Compile crtinit.o and crtfini.o for + -mmodel=medium. This is OK for all memory models. + +Mon Jul 26 11:58:46 1999 Nick Clifton + + * config/arm/arm.c: Replace %R%s in asm_fprintf strings with %r. + * config/arm/arm.h: Replace %R%s in asm_fprintf strings with %r. + +Mon Jul 26 10:23:36 1999 Nick Clifton + + * final.c (asm_fprintf): Accept ASM_FPRINTF_EXTENSIONS, if + defined. + + * tm.texi: Document ASM_FPRINTF_EXTENSIONS. + +Sun Jul 25 23:51:59 1999 Richard Henderson + + * i860.h (EXPAND_BUILTIN_SAVEREGS): New. + (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + * i860.c (output_delayed_branch): Disable. + (output_delay_insn): Likewise. + (i860_saveregs): New. + (i860_build_va_list): New. + (i860_va_start): New. + (i860_va_arg): New. + * i860.md: Disable all peepholes using output_delayed_branch. + * i860/sysv4.h (I860_SVR4_VA_LIST): New. + +Sun Jul 25 23:44:13 1999 Richard Henderson + + * clipper.h (EXPAND_BUILTIN_SAVEREGS): Remove argument. + (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + * clipper.c (clipper_builtin_saveregs): Only dump registers. + Return the address of the save area. + (clipper_build_va_list): New. + (clipper_va_start): New. + (clipper_va_arg): New. + +Sun Jul 25 22:56:47 1999 Richard Henderson + + * arc.h (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + * arc.c (arc_setup_incoming_varargs): Set alias set of + varargs save area. + (arc_va_start): New. + (arc_va_arg): New. + +Sun Jul 25 22:45:55 1999 Richard Henderson + + * alpha.h (EXPAND_BUILTIN_SAVEREGS): Delete. + (BUILD_VA_LIST_TYPE): New. + (EXPAND_BUILTIN_VA_START): New. + (EXPAND_BUILTIN_VA_ARG): New. + * alpha.c (alpha_builtin_saveregs): Delete. + (alpha_build_va_list): New. + (alpha_va_start): New. + (alpha_va_arg): New. + +Sun Jul 25 21:40:33 1999 Jeffrey A Law (law@cygnus.com) + + * config/svr4.h (CTORS_SECTION_ASM_OP): Do not emit directives in + column zero. + (DTORS_SECTION_ASM_OP, INIT_SECTION_ASM_OP): Likewise. + (FINI_SECTION_ASM_OP, ASM_OUTPUT_SECTION_NAME): Likewise. + + * gcc.texi: More changes related to list conversion. + * invoke.texi: Likewise. + +Sun Jul 25 18:15:39 1999 Richard Henderson + + * builtins.c (expand_builtin_saveregs): Remove static, remove exp + and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS. + (expand_builtin_next_arg): Accept ARGLIST not EXP. + (stabilize_va_list): New function. + (std_expand_builtin_va_start): New function. + (expand_builtin_va_start): New function. + (get_varargs_alias_set): New function. + (std_expand_builtin_va_arg): New function. + (expand_builtin_va_arg): New function. + (expand_builtin_va_end): New function. + (expand_builtin_va_copy): New function. + (expand_builtin): Call them. + * c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list, + __builtin_{varargs_start,stdarg_start,end,copy}. + (build_va_arg): New function. + * c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete. + (build_va_arg): Declare. + * c-decl.c (ptr_type_node, va_list_type_node): New. + * c-parse.gperf (__builtin_va_arg): New. + * c-parse.in (VA_ARG): New token. + (unary_expr): Recognize it. + * expr.c (expand_expr): Expand VA_ARG_EXPR. + * expr.h (std_expand_builtin_va_start): Declare. + (std_expand_builtin_va_arg): Declare. + (expand_builtin_va_arg): Declare. + (get_varargs_alias_set): Declare. + * tree.def (VA_ARG_EXPR): New. + * tree.h (BUILT_IN_VARARGS_START): New. + (BUILT_IN_STDARG_START, BUILT_IN_VA_END): New. + (ptr_type_node, va_list_type_node): Declare. + * tm.texi (EXPAND_BUILTIN_SAVEREGS): Kill unused ARGLIST argument. + * m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise. + * m88k.h, m88k.c: Likewise. + * mn10300.h, mn10300.c: Likewise. + * pa.h, pa.c: Likewise. + * rs6000.h, rs6000.c: Likewise. + * sh.h, sh.c: Likewise. + * sparc.h, sparc.c: Likewise. + + * emit-rtl.c (operand_subword): Copy alias set. + (change_address): Likewise. + +Sun Jul 25 15:04:37 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (compute_frame_size): Scan all the used callee saved registers, + not just the first one. + +Fri Jul 23 14:09:58 1999 Philip Blundell + + * config/arm/arm.h (TARGET_SWITCHES): Add + -m{no-}single-pic-base. Correct help string for -mshort-load-words. + (TARGET_OPTIONS): Add -mpic-register=. + (ARM_FLAG_SINGLE_PIC_BASE, TARGET_SINGLE_PIC_BASE): Define. + (arm_pic_register_string): Declare. + (NEED_PLT_GOT): Delete, replace with ... + (NEED_GOT_RELOC, NEED_PLT_RELOC): ... these. New macros. + (OUTPUT_INT_ADDR_CONST): Replace NEED_PLT_GOT with NEED_GOT_RELOC. + (ASM_OUTPUT_MI_THUNK): Replace NEED_PLT_GOT with NEED_PLT_RELOC. + * config/arm/arm.c (arm_override_options): Add new option + -mpic-register=N. + (arm_pic_register_string): New variable. + (arm_finalize_pic): Respect TARGET_SINGLE_PIC_BASE. + (output_func_prologue): If TARGET_SINGLE_PIC_BASE, treat the PIC + register as never live. Use NEED_PLT_RELOC not NEED_PLT_GOT. + (output_return_instruction): Likewise. + * config/arm/elf.h (NEED_PLT_GOT): Delete, replace with ... + (NEED_GOT_RELOC, NEED_PLT_RELOC): ... these. Define to flag_pic. + * config/arm/arm.md: Use NEED_PLT_RELOC in place of NEED_PLT_GOT. + + * invoke.texi (ARM Options): Fix spelling. Remove duplicate + mention of -msched-prolog. Document new options -msingle-pic-base + and -mpic-register=. + +Thu Jul 22 18:23:56 1999 Richard Henderson + + * haifa-sched.c (reemit_notes): Tidy. + * sched.c (reemit_notes): Duplicate 1998-08-31 patch to + haifa's routine. + +Thu Jul 22 18:21:04 1999 Richard Henderson + + * explow.c (trunc_int_for_mode): New function. + (plus_constant_wide): Use it. + * combine.c (simplify_and_const_int): Likewise. + (merge_outer_ops): Likewise. + (simplify_shift_const): Likewise. + * cse.c (simplify_unary_operation): Likewise. + (simplify_binary_operation): Likewise. + * emit-rtl.c (operand_subword): Likewise. + * rtl.h: Declare it. + +Thu Jul 22 14:34:59 1999 Bernd Schmidt + + * config/arm/arm.c (arm_print_operand): Fix typo in 'M' case + (use NUM_REGS instead of NUM_INTS). + +Thu Jul 22 11:25:20 1999 Bernd Schmidt + + * builtins.c: New file. + * expr.c (saveregs_value, apply_args_value): Delete definition, + moved into builtins.c. + (string_constant): No longer static. + (get_pointer_alignment, c_strlen, get_memory_rtx, expand_builtin, + apply_args_size, apply_result_size, result_vector, + expand_builtin_apply_args, expand_builtin_apply, + expand_builtin_return): Delete functions, moved into builtins.c. + (INCOMING_REGNO, OUTGOING_REGNO): Delete unused macros. + * expr.h (saveregs_value, apply_args_value): Declare variables. + (expand_builtin, string_constant): Declare functions. + * Makefile.in: Update to build builtin.o. + +Wed Jul 21 00:46:58 1999 Mark P. Mitchell + + * defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): New macro. + * tm.texi (DWARF2_GENERATE_TEXT_SECTION_LABEL): Define it. + * dwarf2out.c (dwarf2out_init): Don't output a label to mark the + start of the text section if DWARF2_GENERATE_TEXT_SECTION_LABEL is + false. + * config/mips/iris6.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): + Define to zero. + +1999-07-21 Michael Meissner + + * print-rtl.c (print_rtx): Print the names of the virtual + registers. + +Wed Jul 21 16:00:32 1999 Nick Clifton + + * config/arm/arm.h (INITIAL_ELIMINATION_OFFSET): Fix typo + introduced in previous delta. + +Wed Jul 21 14:30:51 1999 Bernd Schmidt + + * c-lang.c (finish_file): Rename void_list_node to void_list_node_1 + to avoid name clash. + +Wed Jul 21 08:39:22 1999 Gavin Romig-Koch + + * c-lex.c (yylex) : Correct the test for overflow when lexing + integer literals. + +Tue Jul 20 18:02:42 1999 Richard Henderson + + * haifa-sched.c (insn_cost): FREE implies cost 0 and vice versa. + (adjust_priority): Always call ADJUST_PRIORITY. + (schedule_insn): Only put insns into the ready at cost 0. + (schedule_block): Remove redundant initial sort. Give clock_var + and can_issue_more to MD_SCHED_REORDER. Requeue if hazard cost + is not 0. + * tm.texi (MD_SCHED_REORDER): Update docs. + + * sparc.h (MD_SCHED_REORDER): Update. Set CAN_ISSUE_MORE. + * sparc.c (ultra_reorder_called_this_block): Delete. + (ultrasparc_sched_init): Don't set it. + (ultrasparc_sched_reorder): Don't check it. + +Tue Jul 20 17:07:54 1999 Richard Henderson + + * rs6000.h (struct rs6000_args): Add sysv_gregno. + * rs6000.c (init_cumulative_args): Init sysv_gregno. + (function_arg_boundary): Align DFmode. + (function_arg_advance): Restructure for ABI_V4; use sysv_gregno + to get fp reg and stack overflow correct. + (function_arg): Likewise. + (function_arg_pass_by_reference): True for TFmode for ABI_V4. + (setup_incoming_varargs): Restructure for ABI_V4; use + function_arg_advance to skip final named argument. + (expand_builtin_saveregs): Properly unskip the last integer arg + when doing varargs. Adjust overflow location calculation. + + * ginclude/va-ppc.h (struct __va_list_tag): Make gpr and fpr + explicitly unsigned. + (__VA_FP_REGSAVE): Use new OFS argument instead of AP->fpr directly. + (__VA_GP_REGSAVE): Similarly. + (__va_longlong_p): Delete. + (__va_arg_type_violation): New declaration. + (va_arg): Restructure. Flag promotion errors. Align double. + TFmode passed by reference. + + * rs6000.md (movdi_32+1): Use GEN_INT after arithmetic + in the HOST_BITS_PER_WIDE_INT > 32 case. + +Tue Jul 20 12:37:30 1999 Hans-Peter Nilsson + + * dwarf2out.c (output_abbrev_section): Terminate with a zero. + +Tue Jul 20 12:12:27 1999 Jason Merrill + + * gcc.c (default_compilers, cpp-output): Pass -fpreprocessed. + * toplev.c (documented_lang_options): Add -fpreprocessed. + * cpplib.h (struct cpp_buffer): Add preprocessed. + * cppinit.c (cpp_handle_option): Handle -fpreprocessed. + (cpp_start_read): Don't expand macros or emit an initial #line + directive if -fpreprocessed. + +Tue Jul 20 12:12:09 1999 Michael Tiemann + + * cpplib.h (struct cpp_buffer): Added manual_pop for + better C++ tokenization. + * cpplib.c (cpp_get_token): Return CPP_EOF if manual_pop. + Also, support C++ tokenization for ->*, .*, ? operators. + * c-common.c (cpp_token): Make non-static. + +Tue Jul 20 11:24:19 1999 Bernd Schmidt + + * c-common.h: New file. + * c-common.c (permanent_obstack): Delete unused declaration. + (c_global_trees): New array. + (c_common_nodes_and_builtins): New function; split off common code + from init_decl_processing in both c-decl.c and cp/decl.c. + * c-tree.h: Delete lots of declarations of tree nodes; replaced by + c_global_trees and accessor macros defined in c-common.h. + Include c-common.h. + * c-decl.c: Delete definitions for tree nodes that were replaced by + c_global_trees. + (init_decl_processing): Build void_list_node. + Call c_common_nodes_and_builtins; delete code to generate the common + builtins here. + * objc/objc-act.c (build_module_descriptor): Rename variable + void_list_node to avoid clash with c-common.h. + + * Makefile.in: Update dependencies. + * objc/Make-lang.in: Likewise. + +Mon Jul 19 14:22:18 1999 Mark P. Mitchell + + * config/mips/iris6gld.h (MAKE_DECL_ONE_ONLY): Define. + (UNIQUE_SECTION_P): Likewise. + (UNIQUE_SECTION): Likewise. + +1999-07-19 Linas Vepstas + + * config/i370/README: New file. + * config/i370/linux.h: New file. + * config/i370/mvs.h: New file. + * config/i370/oe.h: New file. + * config/i370/t-linux: New file. + * config/i370/t-mvs: New file. + * config/i370/t-oe: New file. + * config/i370/x-oe: New file. + * config/i370/xm-linux.h: New file. + * config/i370/xm-mvs.h: New file. + * config/i370/xm-oe.h: New file. + + * i370.c (label_node_t): Add first_ref_page, label_addr, + label_first_ref, label_last_ref members. + (mvs_need_base_reload): Renamed from mvs_label_emitted. + (MAX_MVS_LABEL_SIZE): Define. + (MAX_LONG_LABEL_SIZE): Define. + (alias_node_t, alias_anchor, alias_number): New. + (mvs_function_table): Reorder for EBCDIC. + (ascebc, ebcasc): Unconditionally define. + (i370_branch_dest, i370_branch_length): New functions. + (i370_short_branch, i370_label_scan): New functions. + (mvs_get_label): Renamed from mvs_add_label. Search for + an existing label before creating a new one. + (mvs_add_label): New function. + (mvs_get_label_page): New function. + (mvs_free_label_list): Renamed from mvs_free_label. Iterate + over the entire list. + (mvs_check_page) [TARGET_HLASM]: Use BASR not BALR. + (mvs_check_page) [TARGET_ELF_ABI]: New function. + (mvs_add_alias, mvs_need_alias): New functions. + (mvs_get_alias, mvs_check_alias): New functions. + (handle_pragma): New function. + (mvs_function_check): New function. + (unsigned_jump_follows_p): Search harder. + (i370_function_prolog) [TARGET_HLASM]: Handle LE370. Scan labels. + (i370_function_prolog) [TARGET_ELF_ABI]: New function. + * i370.h (TARGET_VERSION): Delete. + (CPP_SPEC, CPP_PREDEFINES): Delete. + (mvs_label_emitted): Delete. + (TARGET_EBCDIC): Delete. + (MAP_CHARACTER): Define only if TARGET_EBCDIC. + (HANDLE_PRAGMA): Define. + (HARD_REGNO_NREGS): Handle complex modes. + (HARD_REGNO_MODE_OK): Likewise. + (CLASS_MAX_NREGS): Likewise. + (RET_REG): Likewise. + (EXTRA_CONSTRAINT): Define. + (RETURN_IN_MEMORY): True for DImode. + (TRAMPOLINE_TEMPLATE): Use gen_rtx instead of GEN_INT. + (FUNCTION_PROFILER): Delete. + (COUNT_REGS): Fail if REG_P but not REG_OK_FOR_BASE_P. + (NOTICE_UPDATE_CC): Correct handling of MULT, DIV, logicals and shifts. + (TARGET_ESC, TARGET_BELL): Conditionally define for TARGET_EBCDIC. + (TARGET_BS, TARGET_TAB, TARGET_NEWLINE): Likewise. + (TARGET_VT, TARGET_FF, TARGET_CR): Likewise. + (ASM_FILE_START): Add "RMODE ANY". + (ASM_OUTPUT_EXTERNAL): Check for aliases. + (ASM_GLOBALIZE_LABEL): Likewise. + (ASM_OUTPUT_LABELREF): Likewise. + (ASM_OUTPUT_COMMON): Likewise. + (PRINT_OPERAND): Handle 'K', 'W', default. + (PRINT_OPERAND_ADDRESS): New. + (Lots of defines): Add support for TARGET_ELF_ABI. + * i370.md (attr length): New. Define for all patterns. + (*): Lots of tweeks to assembly output and constraints. + +Mon Jul 19 15:09:29 1999 David Edelsohn + + * rs6000.md (arithmetic, logical, and shift Rc combiner patterns): + Disable patterns performing SImode comparisons with SImode values + if TARGET_POWERPC64 and instruction does not sign-extend or does + not mask to narrower than SImode, i.e. where bit 31 and bit 63 may + differ for signed quantities. + (indirect_jump): Add expander to choose RTL based on TARGET_64BIT. + (tablejump): Patterns contingent on TARGET_64BIT not TARGET_POWERPC64. + (decrement_and_branch_on_count): Add 64-bit variant. + +Mon Jul 19 09:36:27 1999 Bernd Schmidt + + * final.c (output_asm_insn): When searching for the matching string + for a given dialect, don't run past the end of the list of + alternatives if there are fewer alternatives in the template than + dialects. + +1999-07-17 Alexandre Oliva + + * gcc.texi: Update e-mail addresses and URLs to gcc.gnu.org. + Removed paragraph about compression of files and size limitation, + duplicated in the FAQ. Use gcc-patches for posting patches. + * gcc.c (main): Updated URL with bug reporting instructions to + gcc.gnu.org. Removed e-mail address. + * system.h (abort): Likewise. + +1999-07-17 Kaveh R. Ghazi + + * Makefile.in (stmp-multilib-sub): Make the files extracted + from $(LIBGCC1) writable. + +Sat Jul 17 14:25:46 1999 Nick Clifton + + * config/arm/aout.h: Reformat for improved readability. + + * config/arm/arm.h: Reformat for improved readability. + Replace uses of fprintf with asm_fprintf where appropriate. + (ARM_DECLARE_FUNCTION_NAME): New macro: Perform any generic ARM + function declaration assembler actions. + (NUM_INTS): New macro: Convert from bytes to words. + (NUM_REGS): New macro: Compute number of registers required to + hold a quanitity of tyep MODE. + (NUM_REGS2): New macro: Like NUM_REGS but also copes with BLKmode + types. + (NUM_ARG_REGS): New macro: The number of argument registers + available. + (ARG_REGISTER): New macro: Compute the register number of the Nth + argument register. + (LAST_ARG_REGNUM): New macro: The number of the last argument + register. + (SP_REGNUM): New macro: Register number of the stack pointer. + (FP_REGNUM): New macro: Register number of the frame pointer. + (FUNCTION_ARG, FUNCTION_ARG_PARTIAL_NREGS, INIT_CUMULATIVE_AGS, + FUNCTION_ARG_ADVANCE, SETUP_INCOMING_VARARGS): Change + CUMULATIVE_ARGS so that it counts registers not bytes. + + * config/arm/arm.c: Rename TARGET_THUMB_INTERWORK to + TARGET_INTERWORK. + Replace uses of fprintf with asm_fprintf where appropriate. + (output_ascii_pseudo_op): Replace with version from thumb.c + + * config/arm/coff.h (ASM_FILE_START): Emit ASM_APP_OFF. + + * config/arm/elf.h (CPP_PREDEFINES): Replace with + SUBTARGET_CPP_SPEC. + (ASM_DECLARE_FUNCTION_NAME): Use ARM_DECLARE_FUNCTION_NAME. + (ASM_FILE_START): Emit ASM_APP_OFF. + +Fri Jul 16 13:48:09 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (compute_frame_size): Round frame according to + STACK_BOUNDARY rather than a hardwired value. + + * pa.h (POINTER_SIZE, PARM_BOUNDARY): Define in terms of BITS_PER_WORD. + + * configure.in (hppa*-*-hpux11*): Use symbolic MASK_PA_11 instead + of "1". + * configure: Rebuilt. + + * configure.in (hppa*-*-linux*): New configuration. + * configure: Rebuilt. + * pa.h (MAX_OFILE_ALIGNMENT): Delete. + * pa/som.h (MAX_OFILE_ALIGNMENT): Define. + * pa/pa-linux.h: New file. + * pa/t-linux: New file. + * pa/xm-linux.h: New file. + + * pa.c (hppa_legitimize_address): Change references from SImode to + either Pmode or word_mode as appropriate. + (emit_move_sequence, store_reg, load_reg): Likewise. + (set_reg_plus_d, hppa_expand_prologue): Likewise. + (output_mul_insn): Likewise. + * pa.h (PROMOTE_MODE): Likewise. + (INITIALZE_TRAMPOLINE): Likewise. + (Pmode): Define to word_mode. + + * pa.c (compute_frame_size): Use UNITS_PER_WORD instead of hardwired + value of 4. Allocate 8 bytes for each FP register save. + (hppa_expand_epilogue): Use UNITS_PER_WORD instead of harwarewired + value of 4. + (hppa_expand_prologue): Likewise. + * pa.h (PROMOTE_MODE): Likewise. + (HARD_REGNO_MODE_OK, FUNCTION_ARG_SIZE): Likewise. + (FUNCTION_ARG_BOUNDARY): Likewise. + + * invoke.texi (HPPA Options): Remove -mspace/-mno-space. + + * pa.c (out_of_line_prologue_epilogue): Delete. + (override_options): Remove -mspace related code. + (hppa_expand_prologue, hppa_expand_epilogue): Likewise. + (compute_frame_size): Only allocate space for register that + actually need to be saved. + * pa.h (MASK_SPACE, TARGET_SPACE): Delete. + (TARGET_SWITCHES): Remove -mspace, -mno-space + * pa/t-pa (LIB2FUNCS_EXTRA): Remove ee.asm and ee_fp.asm + * pa/t-pro (LIB2FUNCS_EXTRA): Likewise. Remove -mspace multilib. + * pa/ee.asm, pa/ee_fp.asm: Delete. + + * pa/elf.h (ASM_OUTPUT_DOUBLE_INT): Define. + + * config/svr4.h (CONST_SECTION_ASM_OP): Do not emit assembler + directive in column zero. + +Fri Jul 16 01:39:57 1999 Jeffrey A Law (law@cygnus.com) + + * m68k.c (output_function_prologue): Fix computation of save mask + when generating PIC code. + +Thu Jul 15 15:40:09 1999 Jim Wilson + + * tree.c (build_type_attribute_variant): Move current_obstack restore + after build_qualified_type call. + +1999-07-15 Mark Mitchell + + * configure.in: Use t-iris6, even with GNU LD. + * config/mips/iris6gld.h: Fix typo in linker spec. + * config/mips/t-iris6gld: Remove. + +Thu Jul 15 15:15:43 1999 David Edelsohn + + * rs6000.md (insv, extzv): Remove SImode dependence in named + patterns. Explicitly generate DImode RTL if PowerPC64 and + operand is DImode. + (insvdi): Reverse start and size in instruction template. + +1999-07-12 Joseph S. Myers + + * invoke.texi: Typo fixes. + +Wed Jul 14 23:28:06 1999 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (gen_realpart): Issue an error for cases GCC can not + handle at this time instead of silently generating incorrect code. + (gen_imagpart): Likewise. + + * reload.c (find_reloads): Emit a USE for a pseudo register without + a hard register if we could not create an optional reload for the + pseudo. + +Wed Jul 14 23:45:48 1999 J"orn Rennecke + + * c-typeck.c (output_init_element, process_init_element): + When advancing constructor_unfilled_fields for a RECORD_TYPE, + check for nameless bit fields. + +Wed Jul 14 01:57:39 1999 Richard Henderson + + * regclass.c (scan_one_insn): Notice subregs that change the + size of their operand. + (record_reg_classes): Use that to obey CLASS_CANNOT_CHANGE_SIZE. + +Wed Jul 14 01:41:42 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (alpha*-*-*): Include alpha/t-ieee. + * configure: Rebuilt. + * alpha/t-ieee: New file. + +Tue Jul 13 10:45:58 1999 Jeffrey A Law (law@cygnus.com) + + * rs6000.c (find_addr_reg): Do not select r0 as an address + register. + +Tue Jul 13 00:46:18 1999 Philippe De Muyter + + * m68k/x-mot3300 (XCFLAGS): List of big files now includes `cse.o'. + +Mon Jul 12 14:29:15 1999 Jeffrey A Law (law@cygnus.com) + + * rs6000.md (movsf): Do not force easy FP constants into memory. + + * expr.c (expand_expr, case PLUS_EXPR): Pass constants through + immed_double_const to ensure they are properly truncated then + sign extended. + +Mon Jul 12 10:40:01 1999 Vladimir Makarov + + * config/arm/thumb.c (thumb_reorg): Call replace_symbols_in_block + always unless NO_DEBUG is used. Compile this code + unconditionally. + (replace_symbols_in_block): Compile it unconditionally. + +Sun Jul 11 12:32:32 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (i?86-*-elf*): New target. + * configure: Rebuilt. + * i386/i386elf.h, i386/t-i386elf: New files. + +Fri Jul 9 22:39:44 1999 Jason Merrill + + * toplev.c (main): Don't complain about saying -gdwarf. + (rest_of_compilation): Remove redundant code. + +Fri Jul 9 19:08:55 1999 Jim Wilson + + * unroll.c (unroll_loops): Don't delete named CODE_LABELs. + +Fri Jul 9 18:54:18 1999 Felix Lee + + * config/i960/i960.c (ret_label): Change asm label from "LR:" to + "Li960R:", to avoid name clash. + +Fri Jul 9 10:48:28 1999 Bernd Schmidt + + * loop.c (check_dbra_loop): When reversing a loop, delete all + REG_EQUAL notes referencing the reversed biv except those which are + for a giv based on it. + +Fri Jul 9 03:51:52 1999 Jeffrey A Law (law@cygnus.com) + + * version.c: Drop "gcc-" prefix from version #. + +Thu Jul 8 18:06:30 1999 Jason Merrill + + * dwarf2out.c (dwarf2out_line): Emit a line number comment after + the label if we're being verbose. + +Thu Jul 8 14:18:46 1999 Richard Henderson + + * m68k.c (output_function_prologue): Add pic register to mask + if live and flag_pic. + (output_function_epilogue): Likewise. + +Thu Jul 8 12:55:12 1999 Jeffrey A Law (law@cygnus.com) + + * dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Do not put assembler + directives in column zero. + + * pa/elf.h (ASM_FILE_START): Define. + * pa/som.h (ASM_FILE_START): Include .level directives. + * pa/hpux10.h (ASM_FILE_START): Delete. + * pa/hpux11.h (ASM_FILE_START): Delete. + + * pa/elf.h (BSS_SECTION_ASM_OP): Use .section .bss. + +Thu Jul 8 18:03:19 1999 J"orn Rennecke + + * reload1.c (choose_reload_regs): Never call remove_address_replacements + when reload_out equals reload_in. + +Thu Jul 8 16:50:14 1999 Nick Clifton + + * invoke.texi (Spec Files): New node: Describe the contents of + spec files. + +Thu Jul 8 10:28:25 1999 Craig Burley + + * invoke.texi (DEC Alpha Options): Put @end table at + beginning of line, to avoid confusing texi2html. + +Thu Jul 8 09:22:06 1999 Nick Clifton + + * config/arm/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Fixed typo + introduced in previous delta. + +Wed Jul 7 02:00:04 1999 Franz Sirl + + * reload1.c (gen_reload): When synthesizing a 3 operand add + sequence, improve test for when to reload OP1 into the reload + register instead of OP0. + +Wed Jul 7 01:38:03 1999 Jim Wilson + + * unroll.c (unroll_loop): Don't delete NOTE_INSN_DELETED_LABEL notes. + +1999-07-07 Manfred Hollstein + + * m88k/dguxbcs.h (CPP_SPEC): Add missing \ in multi-line + string literal. + +Wed Jul 7 01:16:43 1999 Richard Henderson + + * ginclude/varargs.h (__builtin_va_alist_t): New typedef. + (va_dcl): Use __builtin_va_alist_t. + +Wed Jul 7 01:14:42 1999 Jason Merrill + + * dwarf2out.c (gen_struct_or_union_type_die): Only remember types + on the permanent_obstack. + * dwarfout.c (output_type): Likewise. + +Tue Jul 6 15:25:32 1999 Gavin Romig-Koch + + * c-common.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Merged from c-typeck.c and cp/typeck.c. + * c-typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Merged into c-common. + +Tue Jul 6 13:06:01 1999 Dave Brolley + + * c-lex.c (errorcount): Declare it. + (finish_parse): Update errorcount when using CPPLIB. + +1999-07-06 Bruce Korb + + * fixinc/inclhack.def(end_else_label): Double the backslash so + sed gets a chance to see it. + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + +Fri Jul 2 18:49:51 1999 Nick Clifton + + Add framework to support armv5 architecture when it becomes + available: + + * config/arm/arm.c (FL_ARCH5): New processor capability flag. + (arm_arch5): New variable. + (all_architectures): Add armv5 line. + * config/arm/arm.h (CPP_CPU_ARCH_SPEC): Define __ARM_ARCH_5__ if + -march=armv5 is specified on the command line. + (arm_arch5): Export this variable. + * invoke.texi: Document new string accepted by -march= switch for + ARM ports. + + * config/arm/arm.h: Replace use of constant 12 as a register + number with IP_REGNUM. Similarly 14 and LR_REGNUM. + * config/arm/arm.c: Replace use of constant 12 as a register + number with IP_REGNUM. Similarly 14 and LR_REGNUM. + + * config/arm/elf.h: Tidy up. + * config/arm/coff.h: Tidy up. + +Thu Jul 1 19:08:13 1999 Mark P. Mitchell + + * gcc/configure.in (mips-sgi-irix6*): Handle --with-gnu-ld. + * gcc/config/mips/t-iris6gld: New file. + * gcc/config/mips/iris6gld.h: Likewise. + +Fri Jul 2 13:23:39 1999 Gavin Romig-Koch + + * c-decl.c (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + (init_decl_processing): Handle/use the two new types. + * c-common.c (type_for_size,type_for_mode) : Same. + * c-lex.c (yylex) : Same. + * c-typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Same. + * c-tree.h (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + +Fri Jul 2 03:05:44 1999 Jeffrey A Law (law@cygnus.com) + + * dwarfout.c (field_byte_offset): Correctly compute the object's + byte offset for the first bit of a field which crosses an alignment + boundary on a !BYTES_BIG_ENDIAN target. + +Fri Jul 2 01:36:36 1999 Robert Lipe + + * fixinc.svr4: Fix by deleting protos for htons and + ntohs. + +Fri Jul 2 00:46:47 1999 Richard Henderson + Jeff Law + + * ginclude/varargs.h (va_dcl): Use word_mode for type of + __builtin_va_list. + + * except.c: Include intl.h. + (expand_eh_return): Set current_function_cannot_inline. + (save_eh_status, restore_eh_status): Twiddle eh_return_stub_label. + * function.h (struct function): Add eh_return_stub_label. + * flow.c (delete_unreachable_blocks): Don't merge across EH edges. + * Makefile.in (except.o): Depend on intl.h. + +Fri Jul 2 00:04:23 1999 David Edelsohn + + * rs6000.md (movdf_hardfloat32): Handle PRE_INC and PRE_DEC the + same as offsettable in cases 1 and 2. + +Thu Jul 1 20:54:10 1999 Richard Henderson + + * alpha.md (extqh): Define as 64-((R&7)*8) instead of 56-(((R-1)&7)*8). + (extlh, extwh): Likewise. + +Thu Jul 1 11:05:25 1999 Gavin Romig-Koch + + * c-lex.c (yylex): Improve 'integer constant out of range' messages. + +Wed Jun 30 16:51:41 1999 Nick Clifton + + * configure.in: Add arm-pe and thumb-pe targets. + * configure: Regenerate. + + * thumb.c (arm_naked_function_p): New function: Determines if + a function is naked (has no gcc generated prologue/epilogue). + (is_called_in_ARM_mode): Return true if the func has the + interfacearm attribute. + (output_return): Do not generate a return for naked functions. + (thumb_function_prologue): Do not generate a prologue for + naked functions. + (thumb_expand_prologue): Do not generate a prologue for naked + functions. + (thumb_expand_epilogue): Do not generate an epilogue for naked + functions. + (arm_valid_machine_decl_attribute): New function, copied from + arm.c: Permit naked and interfacearm attributes. + + * config/arm/pe.c: New file: Support code for arm-pe target. + * config/arm/pe.h: New file: Header file for arm-pe target. + * config/arm/tpe.h: New file: Header file for thumb-pe target. + * config/arm/t-thumb-pe: New file: Makefile fragment for + thumb-pe target. + +1999-07-01 Mark Kettenis + + * config/i386/gnu.h (CPP_SPEC): Define __PIC__ and __pic__ if + -fPIC or -fpic is specified. + +Wed Jun 30 03:31:54 1999 Jeffrey A Law (law@cygnus.com) + + * expr.c (emit_block_move): Use copy_to_mode_reg for + !TARGET_MEM_FUNCTIONS case too. + + * configure.in (hppa*-*-*): Add som.h or elf.h to tm_file as + appropriate. + * configure: Rebuilt. + (hppa1.1-*-pro*, hppa1.1-*-rtems*): Define target_cpu_default. + * pa.h: Include dbxelf.h. Delete various dbx/stabs related + definitions made redundant by dbxelf.h inclusion. Delete + lots of definitions related to assembly output that are + specific to the SOM object format. + * pa.c (output_function_prologue): Do not emit the function's + name for OBJ_ELF. + * pa-pro-end.h (STARTFILE_SPEC): Undefine before redefining. + * pa-pro.h: Deleted. + * som.h: New file with SOM specific definitions. + * elf.h: New file with ELF specific definitions. + + * elfos.h (const_section): Output a tab before assembler directives. + (ctors_section, dtors_section): Likewise. + (ASM_OUTPUT_SECTION_NAME): Likewise. + + * pa/pa1.h: Delete unused file. + +Tue Jun 29 01:37:53 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa*-hp-hpux11*): New configuration. + * configure: Rebuilt. + * pa/pa-hpux11.h: New file. + * pa.h (CPP_SPEC): Conditionally add -D__STDC_EXT__ to the cpp + command line. + + * mips.md (leasi, leadi): New patterns. + + * expr.c (emit_block_move): Properly handle case where one of the + block move arguments has a queued increment or decrement. + (clear_storage): Similarly. Fix formatting goof. + +1999-06-28 "David O'Brien" + + * fixinc/inclhack.def(stdio_va_list): This patch Removes a + semicolon from the BSD VA_LIST replacement expression. + + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + + * fixinc/mkfixinc.sh: Have `i[34567]86-*-freebsd*' machines + now use the fixincl program. + +Mon Jun 28 05:28:12 1999 Jeffrey A Law (law@cygnus.com) + + * m68k.h (CONDITIONAL_REGISTER_USAGE): Define for !SUN_FPA + case. Also make the PIC register call_used. + + * m68k.h (FINALIZE_PIC): Delete. + * m68k.c (finalize_pic): Delete. + +Mon Jun 28 05:16:35 1999 Richard Henderson + + * m68k.h (PREFERRED_RELOAD_CLASS): Don't force any FP const_doubles + to memory. + +Mon Jun 28 04:07:27 1999 David Edelsohn + + * expmed.c (expand_divmod): Ensure unsigned value fits in reg_note. + +Sun Jun 27 02:39:08 1999 Richard Henderson + + * jump.c (jump_optimize_1): Validate the cmov copy to a temporary. + +Sat Jun 26 17:18:18 1999 David Edelsohn + + * rs6000.c (print_operand, case 'L'): Use plus_constant_for_output. + +Fri Jun 25 11:33:24 1999 Richard Henderson + + * alpha.c (override_options): Add -mcpu=ev45 as an alias for ev4. + +Fri Jun 25 13:41:25 1999 David Edelsohn + + * rs6000.c (output_toc): Always use hex values for floating-point + constants. Store single-precision values in upper-half of TOC + entry in 64-bit mode. + * rs6000.md (floatsidf2, floatunssidf2): Add !TARGET_POWERPC64 + to final constraints. + (fix_truncdfsi2 splitter): Change pattern matching fctiwz. + (fctiwz): Improve accuracy of RTL for pattern. + +Fri Jun 25 11:26:38 1999 Gavin Romig-Koch + + * expr.c (expand_expr): Allow RTL_EXPR's through the + MAX_INTEGER_COMPUTATION_MODE checks. + +Fri Jun 25 06:06:37 1999 Richard Henderson + + * alpha.h (MASK_SUPPORT_ARCH, MASK_CPU_EV5, MASK_CPU_EV6): Define + such that MASK_SUPPORT_ARCH is not negative. + +Fri Jun 25 05:35:44 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (verify_dominator): Properly handle ADDR_VEC and + ADDR_DIFF_VEC insns that appear inside loops. + +Thu Jun 24 22:54:05 1999 David Edelsohn + Jeff Law + + * rs6000.md (movdf_hardfloat32): Revert previous patch. + Handle LO_SUM the same as offsettable in cases 1 and 2. + * rs6000.c (find_addr_reg): Revert previous patch. + +Thu Jun 24 22:43:12 1999 Philippe De Muyter + + * system.h (strstr): New external function declaration. + * acconfig.h (NEED_DECLARATION_STRSTR): New define slot. + * configure.in (GCC_NEED_DECLARATIONS): Check for strstr. + * config.in, configure: Rebuilt. + +1999-06-24 Tom Tromey + + * gcc.c (main): Read user-specified specs files after computing + additional startfile_prefixes. + +Thu Jun 24 15:00:47 1999 Mark Mitchell + + Revert these two patches: + + Thu Jun 17 21:34:24 1999 J"orn Rennecke + * loop.c (strength_reduce): When doing biv->giv conversion, update + reg note of NEXT->insn. + + Thu Jun 17 17:22:07 1999 J"orn Rennecke + * loop.c (strength_reduce): When doing biv->giv conversion, fix up + reg_biv_class. + (recombine_givs): Set ix field after sorting. + +Wed Jun 23 21:26:00 1999 J"orn Rennecke + + * rtlanal.c (reg_referenced_p): Use reg_overlap_mentioned_p + for the parts of an UNSPEC / UNSPEC_VOLATILE. + +1999-06-23 Bruce Korb + + *fixinc/inclhack.def: Add fix development commentary + (read_ret_type): reactivate and add selection clause + (zzz_*): tweak output file name to match what is used in hackshell.tpl + *fixinc/{fixincl.x|inclhack.sh}: regen + +Wed Jun 23 00:48:21 1999 Jason Merrill + + * expr.c (expand_expr): STRIP_NOPS before checking against + MAX_INTEGER_COMPUTATION_MODE + (check_max_integer_computation_mode): Likewise. + +Tue Jun 22 20:23:43 1999 Jim Wilson + + * md.texi (smul@var{m}3_highpart): Add missing 's' prefix. + +1999-06-22 Jim Wilson + + * expr.c (store_expr): When target is a promoted subreg, return a + promoted subreg as a result. + +Tue Jun 22 17:14:58 1999 Michael Meissner + + * dwarf2out.c (dwarf2out_frame_debug_expr): Reformat to match GNU + coding standards. + (dwarf2out_define): Mark unused parameters appropriately. + (gen_unspecified_parameters_die): Ditto. + (gen_subprogram_die): Fix signed/unsigned warnings. + (gen_variable_die): Ditto. + +1999-06-22 Bruce Korb + + * fixinc/inclhack.def(end_else_label): combined else_label + and endif_label and fixed the sed expression. + *fixinc/{fixincl.x|inclhack.sh}: regen + +Tue Jun 22 01:58:18 1999 Jeffrey A Law (law@cygnus.com) + + * rs6000.md (movdf_hardfloat32): Use %X instead of always emitting + 'x' when handling non-offsettable addresses + +Tue Jun 22 00:20:05 1999 Richard Earnshaw (rearnsha@arm.com) + + * final.c (shorten_branches): Don't try to split an insn that has + been deleted. + +Mon Jun 21 12:47:39 1999 Mark Mitchell + + * config/mips/mips.c (symbolic_expression_p): New function. + (mips_select_rtx_section): Put symbolic expressions in the + data section, not the read-only data section. + +Mon Jun 21 22:13:06 1999 Jeffrey A Law (law@cygnus.com) + + * rs6000.md (find_addr_reg): Handle LO_SUM addresses. + +Mon Jun 21 20:10:42 1999 Richard Henderson + + * collect2.c (main): Log frame table count. + (GCC_OK_SYMBOL) [ECOFF]: Accept stGlobal. + (scan_prog_file) [COFF]: Handle frame tables. + + * alpha/alpha.h (UNALIGNED_SHORT_ASM_OP): Define. + (UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Define. + * alpha/elf.h: Undef them again. + * alpha/vms.h: Remove their definitions. + +Tue Jun 22 03:17:53 1999 J"orn Rennecke + + * sh.c (machine_dependent_reorg): When fixing up fp pcloads, + remove the clobber of r0 and change the REG_UNUSED note to + REG_INC. + +1999-06-21 Jakub Jelinek + + * real.c (ereal_from_double): Fix for 64-bit big endian hosts. + * emit-rtl.c (gen_lowpart_common): Add case for hosts where double + fits in HOST_WIDE_INT and one uses union to access a long constant + as double. + +Mon Jun 21 17:18:25 1999 Richard Henderson + + * sparc.c (sparc_override_options): Don't allow profiling for + code models other than medlow. + (sparc_function_profiler): New function from old FUNCTION_PROFILER + macro. Use ASM_GENERATE_INTERNAL_LABEL and MCOUNT_FUNCTION. + (sparc_function_block_profiler): Likewise. Use user_label_prefix. + (sparc_block_profiler): Likewise. + (sparc_function_block_profiler_exit): Likewise. + * sparc.h (FUNCTION_PROFILER): Call new sparc.c function. + (FUNCTION_BLOCK_PROFILER): Likewise. + (BLOCK_PROFILER): Likewise. + (FUNCTION_BLOCK_PROFILER_EXIT): Likewise. + (MCOUNT_FUNCTION): New. + * sparc/pbd.h (FUNCTION_PROFILER): Delete. + (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): Delete. + * sparc/sun4o3.h (FUNCTION_PROFILER): Delete. + (MCOUNT_FUNCTION): New. + * sparc/sysv4.h (FUNCTION_BLOCK_PROFILER): Delete. + (BLOCK_PROFILER): Delete. + (MCOUNT_FUNCTION): New. + +Mon Jun 21 14:11:29 1999 David Edelsohn + + * rs6000.md (movdf_hardfloat32): Fix typo in case 2. + +Mon Jun 21 12:27:17 1999 Vladimir Makarov + + * config/mips/elf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): + Add the macros. + + * config/m68k/m68kelf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): + Ditto. + + * config/sh/sh.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): + Ditto. + + * config/arm/telf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): + Ditto. + +Mon Jun 21 14:58:42 1999 Nick Clifton + + * config/arm/arm.h: Add cpp support for ARM920 and ARM920T cpu + types. + +Mon Jun 21 06:22:21 1999 Mark Elbrecht + + * i386/djgpp.h (LIB_SPEC): New. + (STARTFILE_SPEC): New. + + * i386/xm-djgpp.h (NO_SYS_SIGLIST): Deleted. Now obsolete. + +Mon Jun 21 06:19:33 1999 Philippe De Muyter + + * fixinc/Makefile.in (gnu-regex.o): Do not define STDC_HEADERS in + compiler flags. + + * system.h (WSTOPSIG): New macro. + +Mon Jun 21 05:33:15 1999 Mumit Khan + + * c-pragma.c (push_alignment): Don't ignore alignments greater than + 4 bytes. + (insert_pack_attributes): Take into account member natural + alignment. + + * i386/winnt.c (exports_head): New static variable. + (i386_pe_record_exported_symbol): New function. + (i386_pe_asm_file_end): Use. + * i386/cygwin.h (ASM_OUTPUT_COMMON): Record the exported + symbols to be emitted at end of assembly. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + + * i386/uwin.h (CPP_SPEC): Use -idirafter instead -iprefix and + -iwithprefix. + +Mon Jun 21 04:44:31 1999 Jeffrey A Law (law@cygnus.com) + + * sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Fix paren error introduced + in last change. + +Sun Jun 20 17:27:20 1999 Richard Henderson + + * haifa-sched.c (sched_analyze_1): Use free_list instead of + zapping reg_last_uses directly. + (sched_analyze_2, sched_analyze_insn): Likewise. + (sched_analyze): Likewise. Don't clear reg_last_uses on calls. + +Sun Jun 20 16:57:29 1999 David Edelsohn + + * rs6000.md (movdf_hardfloat32): Use worst case insn length + attributes for cases 1 and 2. + +Sat Jun 19 22:52:55 1999 Richard Henderson + + * haifa-sched.c (sched_analyze): Mark call-user regs as clobbered + instead of set. + +Sat Jun 19 05:40:07 1999 Philip Blundell + + * arm.c (arm_reload_in_hi): Invert sense of test on BYTES_BIG_ENDIAN. + +Sat Jun 19 05:25:05 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (CONDITIONAL_REGISTER_USAGE): If flag_pic, never use + PIC_OFFSET_TABLE_REGNUM for general alloaction. + (INITIAL_ELIMINATION_OFFSET): Count the fact that the PIC register + must be stacked if it is used for PIC accesses. + * arm.c (use_return_insn): Handle PIC register specially. + (output_return_instruction): Likewise. + (output_func_{prologue,epilogue}): Likewise. + (output_expand_prologue): Likewise. + + * arm.md (*adddf_esfdf_df): Renamed from *adddf_df_esfdf. + (*strsi_predec): Renamed from *strqi_predec. + (*loadsi_shiftpreinc): Renamed from *loadqi_shiftpreinc. + (*loadsi_shiftpredec): Renamed from *loadqi_shiftpredec. + + * arm.c (arm_override_options): Remove warning about PIC code + not being supported. + +Fri Jun 18 23:47:06 1999 David Edelsohn + + * rs6000.c (find_addr_reg): New function. + * rs6000.h (find_addr_reg): Declare. + (offsettable_addr_operand): Delete. + * rs6000.md (movdf_hardfloat32): Handle non-offsettable loads + from and stores to GPRs. + +Fri Jun 18 15:44:18 1999 Richard Henderson + + * alpha.c (alpha_expand_block_move): Use get_insns rather than + gen_sequence as argument to emit_no_conflict_block. + +Fri Jun 18 07:02 1999 Bruce Korb + + * fixinc/mkfixinc.sh: enable the fixincl program for DG/UX + * fixinc/inclhack.def(dgux_int_varargs): script must end with \n + *fixinc/fixincl.x: regen + *fixinc/inclhack.sh: regen + +Thu Jun 17 15:06:10 PDT 1999 Don Lindsay + + * added support for -mpcrel (PC relative addressing for m68k) + based on code done by Michael Tiemann . + * invoke.texi (m68000 options): Add documentation for -mpcrel flag. + * m68k.c (print_operand_address): Handle 32-bit PIC case. + (comments for general_src_operand): Add some explanation + about EXTRA_CONSTRAINTS. + (OVERRIDE_OPTIONS): Enable -fPIC in combination with -mpcrel. + * m68kelf.h (OVERRIDE_OPTIONS): Ditto. + (LEGITIMATE_PIC_OPERAND_P): Fix typo. + (LEGITIMATE_PIC_OPERAND_P): Re-derive from m68k.h case. + * m68k.h (LEGITIMATE_PIC_OPERAND_P): Fix delete-o. + (INDIRECTABLE_1_ADDRESS): Delete spurious '/' at end of macro. + (OVERRIDE_OPTIONS): Change behavior so that -mpcrel implies -fpic + if not already set. + (OVERRIDE_OPTIONS): Merge in changes from m68k.h. + * m68k.h (TARGET_PCREL): New target flag. + (TARGET_SWITCHES): Add "pcrel" as a recognized switch. + (OVERRIDE_OPTIONS): Add checks for -mpcrel. + (LEGITIMATE_PIC_OPERAND_P): Don't normally accept anything that + contains a SYMBOL_REF. Relax this constraint during reload, since + we want to use the predicates, not reload's built-in concept of a + valid memory address, to control what insns need reloading. + (EXTRA_CONSTRAINT): Define constraints to accept pc-relative + operands (essentially 'g', 'm', and 's' under normal circumstances). + * m68k.c (print_operand): Cause printing of pc-relative addresses + to include pc register. + (print_operand_address): Ditto. + (general_src_operand): Accept operands that are not only + general_operands, but are also valid when used as a pc-relative + source. + (nonimmediate_src_operand): Similar, for nonimmediate_operands. + (memory_src_operand): Similar, for memory_operands. + (pcrel_address): New predicate to accept the special case of a + pc-relative address. + * m68k.md (many patterns): Rewrite common SImode, HImode, and + QImode insns to accept *_src_operand instead of *_operand where + pc-relative operands can fit. For example, a pc-relative operand + can be used as a memory source operand for addsi3, but not as a + memory destination. + * hp320.h linux.h m68kv4.h (LEGITIMATE_PIC_OPERAND_P) as in m68k.h. + +Fri Jun 18 09:11:07 1999 Nick Clifton + + * config/arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS): New Marco: USe + .thumb_set pseudo op to mark aliases of thumb functions. + +Wed Jun 16 18:19:13 1999 Nick Clifton + + * varasm.c (assemble_alias): Use ASM_OUTPUT_DEF_FROM_DECLS in + preference to ASM_OUTPUT_DEF, if it is defined. + + * tm.texi: Document new, optional target macro + ASM_OUTPUT_DEF_FROM_DECLS. + +Thu Jun 17 15:07 1999 Bruce Korb + + * fixincludes: ISCNTL patch + * fixinc/inclhack.def (ioctl_fix_ctrl): Fix the definition of [_]*ISCTRL(). + (dgux_int_varargs): new for DG/UX + * fixinc/{fixincl.x,inclhack.sh}: Regenerated. + +Thu Jun 17 21:34:24 1999 Jeff Law + + * invoke.texi (ia32 options): Fix typo. + +Thu Jun 17 21:34:24 1999 J"orn Rennecke + + * loop.c (strength_reduce): When doing biv->giv conversion, update + reg note of NEXT->insn. + +Thu Jun 17 14:25:08 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (move_movables): Note issues with replacing REGs with + SUBREGs. + * mips.h (GO_IF_LEGITIMATE_ADDRESS): Handle SUBREGs properly. + +Thu Jun 17 13:28:30 1999 David O'Brien + + * i386/freebsd-elf.h (LINK_SPEC): Fix typo. + + * i386/freebsd-elf.h (FUNCTION_PROFILER): labels are not needed and + the reference to `mcount' was not correct for the ELF on FreeBSD. + +Thu Jun 17 17:22:07 1999 J"orn Rennecke + + * loop.c (strength_reduce): When doing biv->giv conversion, fix up + reg_biv_class. + + (recombine_givs): Set ix field after sorting. + +Thu Jun 17 02:54:30 1999 Jeffrey A Law (law@cygnus.com) + + * emit-rtl.c (operand_subword): Tighten checks for when it is safe + to safe to extract a subword out of a REG. + +Thu Jun 17 01:45:24 1999 J"orn Rennecke + + * sh.md (mulsi3): Don't add a no-op move at the end. + +Wed Jun 16 20:29:00 1999 J"orn Rennecke + + * cse.c (cse_insn): Don't put hard register source into tables for + the last insn of a libcall. + +Wed Jun 16 19:44:33 1999 J"orn Rennecke + + * loop.c (strength_reduce): Insert sets of derived givs at every + biv increment, even if it's the only one. + +Wed Jun 16 10:33:02 1999 Jason Merrill + + * dwarfout.c (add_incomplete_type): New fn. + (output_type): Call it. + (retry_incomplete_types): New fn. + (dwarfout_finish): Call it. + + From Eric Raskin : + (output_type): Output types for bases. + +Tue Jun 15 12:51:23 1999 Alexandre Oliva + + * mips.c (mips_output_conditional_branch): Add `break' + between `default' label and `close braces'. + +Tue Jun 15 01:55:20 1999 David O'Brien + + * i386/freebsd-elf.h (LINK_SPEC): clean up the linking library + specifications and make it realistic. + (LIB_SPEC): Likewise. + +Mon Jun 14 15:38:43 1999 Jim Wilson + + * config/mips/mips.c (mips_secondary_reload_class): Check for + (PLUS (SP) (REG)) and return appropriate register class. + * config/mips/mips.md (reload_insi): Delete predicate for operand 1. + Handle (PLUS (SP) (REG)). + (tablejump): In mips16 code, use emit_insn instead of emit_jump_insn. + (tablejump_mips161, tablejump_mips162): Use emit_jump_insn instead + of emit_insn for tablejump. + +Mon Jun 14 17:26:40 1999 David Edelsohn + + * rs6000.c (output_prolog): RS6000_CALL_GLUE must be + asm_fprintf format string by itself. + (output_function_profiler): Likewise. + +Mon Jun 14 12:57:38 1999 David Mosberger + + * combine.c (simplify_logical, case AND): Only call + simplify_and_const_int if the mode is no wider than HOST_WIDE_INT + or the constant is positive. + +Mon Jun 14 11:43:41 1999 Nick Clifton + + * configure.in: Fix typo in rs6000-ibm-aix4 case. + * configure: Regenerate. + +Mon Jun 14 03:55:40 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (rs6000-ibm-aix4.3*, powerpc-ibm-aix4.3*): Do not + require a sub-version #. + * configure: Rebuilt. + +1999-06-14 Robert Lipe (robertlipe@usa.net) + + * svr4.h (DWARF2_DEBUGGING_INFO): Check for redefinition. + +Mon Jun 14 10:30:52 BST 1999 Nathan Sidwell + + * c-typeck.c (process_init_element): Detect excess elements in + char array initializer. + +1999-06-14 Andreas Jaeger + + * gcc.texi: Mention gcc 2.96 instead of egcs 1.00. + +Sat Jun 12 22:29:48 EDT 1999 Jerry Quinn + + * invoke.texi (Option Summary): Add -fpermissive flag. + +Sat Jun 12 03:40:42 1999 Jeffrey A Law (law@cygnus.com) + + * sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Do nothing with operands + that require PIC code sequences. + +Wed Jun 9 16:29:01 1999 Nick Clifton + + * configure.in: Add new target: thumb-elf. + * configure: Regenerate. + * config/arm/t-thumb-elf: New file: Makefile fragment for + thumb-elf build. + * config/arm/telf.h: New file: Header file for thumb-elf + build. + +Fri Jun 11 03:17:51 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (libgcc2): Pass MAYBE_USE_COLLECT2 as an argument. + * libgcc2.c (__CTOR_LIST, __DTOR_LIST); Do not provide + initializers is some circumstances. + + * fixinc/inclhack.def (endif_label): Add additional selector for + more bogus stuff after #endif statements. + * fixinc/inclhack.sh, fixinc/fixincl.x: Rebuilt. + +Thu Jun 10 20:44:36 1999 Mumit Khan + + * i386/cygwin.h (SET_ASM_OP): Define. + +Thu Jun 10 20:37:57 1999 Mumit Khan + + * reg-stack.c (stack_reg_life_analysis): Find all the RETURN insns. + +Thu Jun 10 19:23:00 1999 J"orn Rennecke + + * sh.h (TARGET_HARWARD, TARGET_HARVARD): Changed the former to the + latter. + + * sh.md (ic_invalidate_line_i): Remove second alternative. + +Thu Jun 10 06:55 1999 Bruce Korb + + *fixinc/inclhack.def(sun_auth_proto): We do not know how to + test for the presence of valid prototypes. Delete bypass expr. + (ioctl_fix_ctrl): Correct the selection expression. + (no_double_slash): Correct quoting rules + *fixinc/fixincl.x: regen + *fixinc/inclhack.sh: regen + +Thu Jun 10 15:08:15 1999 Nick Clifton + + * config/arm/arm.c (struct all_cores): Add ARM920 and ARM920t. + +Wed Jun 9 15:57:57 1999 Franz Sirl + + * rs6000.md (movsi_got_internal_mem): Delete. + * rs6000.h (CONDITIONAL_REGISTER_USAGE): Mark PIC_OFFSET_TABLE_REGNUM. + (GOT_TOC_REGNUM): Delete. + (PIC_OFFSET_TABLE_REGNUM): Define. + (FINALIZE_PIC): Disable. + * rs6000.c (rs6000_got_register): New code for fixed pic register. + (rs6000_replace_regno): Delete. + (rs6000_finalize_pic): Likewise. + (output_prolog): Handle PIC_OFFSET_TABLE_REGNUM. + +Wed Jun 9 19:44:26 1999 J"orn Rennecke + + * loop.c (loop_insn_first_p): Don't compare LUIDs when P + is a note; use <= for the compare; advance P while it is + a NOTE. + +Wed Jun 9 13:12:24 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/inclhack.def (no_double_slash): Fix quoting for test. + * fixinc/inclhack.sh, fixinc/fixincl.x, fixinc/fixincl.sh; Rebuilt. + + * varasm.c (remove_from_pending_weak_list): Verify t->name + is non-NULL before passing it to strcmp. + +Wed Jun 9 06:50 1999 Bruce Korb + + *fixinc/inclhack.def(sun_auth_proto): bypass the patch if + the typed arguments are not part of a comment + (ioctl_fix_ctrl): Added a purpose comment + *fixinc/fixincl.x: regenerate + *fixinc/inclhack.sh: regenerate + +Wed Jun 9 22:57:02 1999 Michael Hayes + + * invoke.texi: Add C4x invocation docs. + +Wed Jun 9 22:34:38 1999 Michael Hayes + + * config/c4x/c4x.h (TARGET_EXPOSE_LDP, LEGITIMIZE_RELOAD_ADDRESS): + Define new macros. + * config/c4x/c4x.c (c4x_emit_move_sequence, src_operand): Use + TARGET_EXPOSE_LDP. + (c4x_legitimize_reload_address): New function. + * config/c4x/c4x.md: Update docs. + +Wed Jun 9 04:14:48 1999 Jeffrey A Law (law@cygnus.com) + + * fixincludes: Avoid removing '.'. + * fixinc/fixinc.svr4: Likewise. + * fixinc/fixinc.winnt: Likewise. + * fixinc/inclhack.tpl: Likewise. + * fixinc/fixincl.sh, fixinc/inclhack.sh: Rebuilt. + +1999-06-09 Kaveh R. Ghazi + + * fixinc/inclhack.def (sun_catmacro): Escape parens in the select + pattern. + * fixinc/fixincl.x, fixinc/inclhack.sh: Rebuilt. + +Wed Jun 9 03:10:34 1999 Mumit Khan + + * c-pragma.c (handle_pragma_token): Handle `#pragma pack()' + correctly. + +Tue Jun 8 13:06:15 1999 Jim Wilson + + * configure.in (rs6000-ibm-aix4.[12]*): Change rx6000 to rs6000. + * configure: Regenerate. + +Tue Jun 8 05:47:48 1999 Richard Earnshaw (rearnsha@arm.com) + + * optabs.c (expand_cmplxdiv_wide): Use expand_abs to get the absolute + values. + +Mon Jun 7 22:30:37 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/inclhack.def (avoid_bool): Also catch + "typedef [unsigned] int bool". + * fixinc/inclhack.sh, fixinc/fixincl.x, fixinc/fixincl.sh: Rebuilt. + + * m68k/x-hp3bsd44: Delete obsolete and incorrect file. + * configure.in (m68k-hp-bsd4.4): No longer use x-hp3bsd44. + * configure: Rebuilt. + +Mon Jun 7 22:05:03 1999 Mark Kettenis + + * config/i386/gnu.h: Include right after , + such that we can override its definitions if necessary. + (CPP_SPEC): New define. Support processor specific predefines via + %(cpp_cpu). + (CC1_SPEC): New define. Support processor specific compiler + options via %(cc1_cpu). + (STARTFILE_SPEC): New define. Use crt0.o instead of crt1.o for + -static. + +1999-06-07 Kaveh R. Ghazi + + * fixinc/inclhack.def (math_gcc_ifndefs): Insert whitespace + between sed's -e flag, and the open-quote following it. + * fixinc/fixincl.x, fixinc/fixincl.sh: Rebuilt. + +Mon Jun 7 20:34:20 1999 Robert Lipe + Jeffrey A Law (law@cygnus.com) + + * varasm.c (assemble_start_function): Remove the function + from the pending weak decls list when we define a function. + (assemble_variable): Similarly for variables. + (weak_finish): Ignore items on the list with a NULL name. + (remove_from_ending_weak_list); New function to "remove" an item + from the pending weak declarations list. + +Mon Jun 7 19:27:07 1999 Jerry Quinn + + * pa.md (fmpyfadd, fmpynfadd, fnegabs): New patterns. + +Mon Jun 7 14:07:39 1999 Dave Brolley + + * c-lex.c (GETC): Redefine to call getch. + (UNGETC): Redefine to call put_back. + (putback_buffer): New structure type. + (putback): New static structure. + (getch): New function. + (put_back): New function. + (yylex): Replace unused bytes from bad multibyte character. + +Mon Jun 7 13:33:39 1999 Dave Brolley + + * cpplib.c (do_define): Cast `alloca' return value. + (do_include, do_undef, do_pragma): Likewise. + * cpphash.c (dump_definition): Cast `xstrdup' and `alloca' return + values. + * cppfiles.c (initialize_input_buffer): Cast `xmalloc' return values. + * gcc/cppspec.c (lang_specific_driver): Cast xmalloc return value. + +Sun Jun 6 11:58:34 1999 Jakub Jelinek + + * sparc.md (abstf2): This should be an expand. + (split after abstf2_notv9): Fix mode. + (abstf2_hq_v9): New pattern. + (abstf2_v9): Only use when no hard quad. + (absdf2_v9): Fix if target is not the same as source. + (ashrsi3_extend, ashrsi3_extend2, lshrsi3_extend, lshrsi3_extend2): + Add correct output constraints. + +Sat Jun 5 17:04:16 1999 Craig Burley + + From Dave Love to egcs-patches on 20 May 1999 17:38:38 +0100: + * invoke.texi: Clarify text vis-a-vis Intel CPUs. + +Sat Jun 5 12:11:24 1999 Mark Mitchell + + * mips.h (mips_output_conditional_branch): New function. + (mips_adjust_insn_length): Likewise. + (ASSEMBLER_SCRATCH_REGNUM): New macro. + (ADJUST_INSN_LENGTH): Likewise. + * mips.c (print_operand): Add `F' and `W' for floating-point + comparison opcodes. + (machine_dependent_reorg): Adjust MIPS16 code; instruction-lengths + are now in bytes. + (mips_adjust_insn_length): New function. + (mips_output_conditional_branch): New function. + * mips.md (length): Adjust attribute definition to handle + conditional branches. Change lengths to bytes, rather than + instructions throughout. Remove length attribute from + instructions whose length is four bytes, and rely on the default + instead. + (dslot): Fix typo in comment. + Reword conditional branch patterns to use + mips_output_conditional_branch. + +Fri Jun 4 13:30:27 1999 Rainer Orth + + * alpha/osf.h (CPP_SUBTARGET_SPEC): Handle -threads. + (LIB_SPEC): Likewise. + Link with -lprof1_r for -g/-pg. + +1999-06-04 Andreas Schwab + + * loop.c (check_dbra_loop): Fix change of Jan 19. + +Fri Jun 4 00:12:40 1999 Marc Espie + + * freebsd-elf.h (SWITCH_TAKES_ARG): Redefine, not define. + (STARTFILE_SPEC): Define, override the svr4.h version. + (ENDFILE_SPEC): Likewise. + +Thu Jun 3 23:58:55 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/inclhack.def (limits_ifndefs): Also apply to sys/limits.h + * fixinc/fixincl.x: Regenerated. + * fixinc/inclhack.sh: Regenerated. + +Fri Jun 4 05:42:23 1999 J"orn Rennecke + + * sh.c (barrier_align): Don't return early for normal branch/barrier + when optimizing for SH2. + +Thu Jun 3 22:27:50 1999 Robert Lipe + + * i386/udk.h (LINK_SPEC): Correct linker search path for + system libraries. + +Fri Jun 4 03:20:40 1999 J"orn Rennecke + + * sh.c (fixup_addr_diff_vecs): Emit braf reference label. + (braf_label_ref_operand): Delete. + * sh.h (PREDICATE_CODES): Remove braf_label_ref_operand. + * sh.md (casesi_jump_2): Operand1 is now the inside of a + label_ref, and has no predicate. + The pattern has a predicate to guard against invalid substitutions. + (dummy_jump): Delete. + (casesi): Update use of casesi_jump_2. + +Thu Jun 3 07:48 1999 Bruce Korb + + *fixinc/inclhack.def(Io_Def_Quotes): corrected sed expression + *fixinc/fixincl.x: regenerate + *fixinc/inclhack.sh: regenerate + +Thu Jun 3 02:15:07 1999 Jason Merrill + + * dwarf2out.c (add_incomplete_type): New fn. + (gen_struct_or_union_type_die): Call it. + (retry_incomplete_types): New fn. + (dwarf2out_finish): Call it. + +Thu Jun 3 01:19:03 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (insert_insn_end_bb): Correct placement of insns when the + current block starts with a CODE_LABEL and ends with a CALL and + we can not find all the argument setup instructions for the CALL. + +Wed Jun 2 15:44:15 1999 Mark Mitchell + + Revert this change: + * fold-const.c (fold): STRIP_NOPS when deciding whether or not + something is a candidate for optimize_bit_field_compare. + +Wed Jun 2 21:53:05 1999 J"orn Rennecke + + * sh.h (CONST_OK_FOR_I, CONST_OK_FOR_L): Cast VALUE to HOST_WIDE_INT. + +Wed Jun 2 12:25:55 1999 Richard Henderson + + * alpha.c (override_options): Thinko in last patch. + + * alpha/osf.h (CPP_SUBTARGET_SPEC): Define. + (LIB_SPEC): Recognize -pthread. + +Wed Jun 2 08:42:55 1999 Nick Clifton + + * config/arm/tcoff.h (USER_LABEL_PREFIX): Synchronize with + definition in config/arm/coff.h + * config/arm/coff.h: Add comment about USER_LABEL_PREFIX. + +Wed Jun 2 07:07 1999 Bruce Korb + + * fixinc/fixincl.c(global def): Add FD_SHELL_SCRIPT to mark + fixes that need "file=xxx\n" prepended before invocation + (start_fixer - new): starting the fixer process is complex enough + to warrent its own routine. It prepends the "file=xxx\n" stuff. + (process): uses the new routine; omit usage of putenv() + * fixinc/fixincl.tpl: mark shell scripts with FD_SHELL_SCRIPT + * fixinc/fixincl.x: regenerate + +Wed Jun 2 02:29:07 1999 Jeffrey A Law (law@cygnus.com) + + * README, configure.in, gcc.1, gcc.texi: Update name (egcs -> gcc) + and version #s (1.1 -> 2.96) as needed. + * README.g77: Kill way out of date file in the toplevel directory. + +Wed Jun 2 00:52:34 1999 David O'Brien + + * configure.in (i[34567]86-*-freebsdelf): Don't include linux.h, + i386/freebsd-elf.h no longer requires it. Instead include svr4.h. + * configure: Rebuilt. + * i386/freebsd-elf.h (DEFAULT_VTABLE_THUNKS): Define. + (ASM_COMMENT_START, ASM_APP_ON, ASM_APP_OFF, SET_ASM_OP): Likewise. + (PREFERRED_DEBUGGING_TYPE, WCHAR_UNSIGNED): Likewise. + (SWITCH_TAKES_ARG): Likewise. + * i386/freebsd.h: Remove FREEBSD_NATIVE support. + * config/t-freebsd: Moved from config/i386/ so it can used for all + FreeBSD targets. + +Mon May 31 02:22:55 1999 Philippe De Muyter + + * m68k/x-mot3300 (XCFLAGS): Fixed to match stb.o, not f/stb.o. + +Wed Jun 2 00:08:34 1999 Robert Lipe + + * configure.in (i[34567]86-*-udk*): Install headers with cpio. + * configure: Rebuilt. + +Tue Jun 1 19:06:22 1999 David Edelsohn + + * rs6000/aix41.h (RS6000_CALL_GLUE): Define. + * rs6000/aix43.h (RS6000_CALL_GLUE): Likewise. + * rs6000/rs6000.c (rs6000_file_start): Use putc. + (rs6000_output_load_toc_table): Same. + (output_prolog, output_mi_thunk): Same. + * rs6000/rs6000.h (SELECT_SECTION): Formatting. + (ASM_GLOBALIZE_LABEL): Use putc. + +Mon May 31 15:23:23 1999 Richard Henderson + + * alpha.md (reload_*_help): New patterns and splitters. + (reload_*): Use them. + (mov[qh]i): Likewise. + +Mon May 31 11:48:07 1999 Mark Mitchell + + * cccp.c (handle_directive): Handle backslash-newlines in quoted + strings correctly. + +Mon May 31 09:36:11 1999 Cort Dougan + + * rs6000/linux.h (LINK_SPEC): Use emulation elf32ppclinux. + +Mon May 31 11:40:20 EDT 1999 John Wehle (john@feith.com) + + * flow.c (mark_regs_live_at_end, insn_dead_p, + mark_set_1, mark_used_regs): Only give FRAME_POINTER_REGNUM + and HARD_FRAME_POINTER_REGNUM special treatment if reload + hasn't run or the frame pointer is needed. + * haifa-sched.c (attach_deaths): Likewise. + * sched.c (attach_deaths): Likewise. + +Mon May 31 00:46:17 1999 Jeffrey A Law (law@cygnus.com) + + * jump.c (jump_optimize_1): Only set CAN_REACH_END if + calculate_can_reach_end returns nonzero. + + * configure.in (native gas tests): Search for an assembler in the + same manner that the installed compiler will. + * configure: Rebuilt. + * tm.texi (MD_EXEC_PREFIX): Note need to update configure.in too. + + * alias.c (find_base_term): Improve handling of addresses + constructed from binary operations. + +Sun May 30 14:29:17 1999 Eric Raskin (ehr@listworks.com) + + * dgux.h (STARTFILE_SPEC): Fix incorrectly matched curly-braces. + +Sun May 30 14:19:13 1999 Jeffrey A Law (law@cygnus.com) + + * function.h (cleanup_label, frame_offset): Declare. + (tail_recursion_label, tail_recursion_reentry): Likewise. + (arg_pointer_save_area, rtl_expr_chain): Likewise. + * stmt.c (cleanup_label, frame_offset): Delete extern declarations. + (tail_recursion_label, tail_recursion_reentry): Likewise. + (arg_pointer_save_area, rtl_expr_chain): Likewise. + +Sat May 29 19:08:10 1999 Philip Blundell + + * config/arm/aout.h (ASM_OUTPUT_ALIGN): Only define if not already + defined. + * config/arm/elf.h (ASM_OUTPUT_ALIGN): Define. + (MAX_OFILE_ALIGNMENT): Define. + +Fri May 28 21:40 1999 Robert Lipe + + * fixincl.c: Replace local include scheme with #includes of + gansidecl.h and system.h. + * procopen.c: Likewise. + * server.c: Likewise. + +Fri May 28 03:47:03 1999 Eric Raskin (ehr@listworks.com) + + * i386/t-dgux (EXTRA_PARTS): Add crti.o + (crti.o): Add build rule and dependencies. + * fixinc/fixinc.dgux: Use modified _int_varargs.h + +Fri May 28 03:41:02 1999 Franz Sirl + + * rs6000/sysv4.h (CC1_SPEC): Add support for -profile + (LIB_LINUX_SPEC): Likewise. + (LIB_LINUX_SPEC): Add support for -pthread + (CPP_OS_LINUX_SPEC): Likewise. + (CPP_SYSV_SPEC): Avoid redefinitions if both -fpic and -fPIC are + specified. + +Thu May 27 13:04:52 1999 H.J. Lu (hjl@gnu.org) + + * i386.c (output_fp_cc0_set): Don't check the JUMP_INSN code for + conditional move. + (notice_update_cc, output_float_compare): Enable TARGET_CMOVE support. + (output_float_compare, output_fp_cc0_set): Fix the FLOAT comparison + for IEEE math and CC_FCOMI. + (put_jump_code): No IEEE if CC_FCOMI is set. + +1999-05-27 Andreas Schwab + + * fold-const.c (fold_truthop): Make the field reference unsigned + when converting a single bit compare. + +Thu May 27 02:40:48 1999 J"orn Rennecke + + * loop.c (strength_reduce): Don't do biv->giv conversion on constants. + +Thu May 27 02:09:27 1999 Jeffrey A Law (law@cygnus.com) + + * varasm.c (STRIP_NAME_ENCODING): Remove default definition. + * output.h (STRIP_NAME_ENCODING): Strip '*' like the old varasm + version did. + + * reload.c (push_reload): Do not call remove_address_replacements + when presented with identical optional reloads. + +Wed May 26 14:18:05 1999 Richard Henderson + + * alpha.h (MASK_FIX, TARGET_FIX): New. + (MASK_*): Reorganize constants. + (CPP_AM_FIX_SPEC): New. + (TARGET_SWITCHES): Add FIX. + (EXTRA_SPECS): Likewise. + (CPP_CPU_EV6_SPEC): Use FIX, not CIX. + (SECONDARY_MEMORY_NEEDED): Likewise. + (REGISTER_MOVE_COST): Likewise. + * alpha.c (override_options): Add FIX support. Always use + ALPHA_TP_PROG for ev6. + * alpha.md (sqrt and mov[sd]i patterns): Use FIX, not CIX. + * alpha/elf.h (ASM_FILE_START): Look at FIX too. + * configure.in (target_cpu_default2) [ev6]: Use FIX, not CIX. + +Wed May 26 09:53:05 1999 Mark Mitchell + + * fold-const.c (fold): STRIP_NOPS when deciding whether or not + something is a candidate for optimize_bit_field_compare. + +Wed May 26 09:40:02 1999 Mark Mitchell + + * gcc.texi (Passes): Document branch-shortening. + * invoke.texi (Debugging Options): Document the fact that `-dp' + outputs length information for instructions. + +Wed May 26 08:49:31 1999 Nick Clifton + + * flow.c: Revert previous delta. + +Wed May 26 06:05:10 1999 Nick Clifton + + * flow.c (insn_dead_p): Check against frame_pointer_rtx not + FRAME_POINTER_REGNUM. + (mark_set_1): Ditto. + (mark_used_regs): Ditto. + +Wed May 26 02:19:31 1999 Philip Blundell + + * arm.h (NEED_PLT_GOT): Fix mistake in last change. + (GOT_PCREL): New macro. Define to 1 if not already defined. + * arm/elf.h (GOT_PCREL): Define to 0. + * arm.c (arm_finalize_pic): Take into account the setting of + GOT_PCREL. + +Tue May 25 14:06:06 1999 Jeffrey A Law (law@cygnus.com) + + * output.h (STRIP_NAME_ENCODING): Provide default definition. + * dwarf2out.c (ASM_NAME_TO_STRING): Use STRIP_NAME_ENCODING. + + * flow.c (mark_set_1): Do not record BLKmode stores as dead + store elimination candidates. + +Tue May 25 08:55:57 1999 Gavin Romig-Koch + + * config/mips/mips.h (ASM_OUTPUT_DOUBLE_INT) : Use 'dword' if + TARGET_GAS. + +Mon May 24 20:30:08 1999 Jim Wilson + + * configure.in (rs6000-ibm-aix4.[12]*): Delete use of aix41-gld.h. + Add use of x-aix41-gld. + +Mon May 24 16:44:09 1999 Jakub Jelinek + + * sparc/linux64.h (ASM_OUTPUT_CONSTRUCTOR): Define. + (ASM_OUTPUT_DESTRUCTOR): Define. + +Mon May 24 14:35:24 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (strength_reduce): Do not clear NOT_EVERY_ITERATION at the + last CODE_LABEL in a loop if we have previously passed a jump + to the top of the loop. + +Mon May 24 07:56:29 1999 Nick Clifton + + * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): Fix blunder made when + applying Philip's patch. + +Mon May 24 01:02:12 1999 Mark Mitchell + + * stmt.c (expand_end_bindings): Ignore any elements of VARS that + are not VAR_DECLs. + +Sun May 23 20:31:16 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (strength_reduce): Grow reg_single_usage as needed. + +Sun May 23 10:13:20 1999 David O'Brien + + * i386/freebsd-elf.h (LINK_SPEC): Change -static to -Bstatic. + Also remove a useless comment. + +Sun May 23 10:05:23 1999 Jerry Quinn + + * pa.md (negdf2,negsf2): Use fneg instead of fsub on pa 2.0. + +Sat May 22 21:02:06 1999 David Edelsohn + + * collect2.c (main): Only generate import or export file and add + to link arguments if non-empty. Use xmalloc not alloca. + (write_{export,import}_file): Delete. + (write_aix_file): New function. + (locatelib): Use xmalloc not malloc. + (GCC_OK_SYMBOL): Do not check type if aix64. + +Sat May 22 09:35:51 1999 Philip Blundell + + Based on patch by Scott Bambrough and Pat Beirne: + * config/arm/arm.c (making_const_table): New variable. + * config/arm/arm.h (making_const_table): Declare. + (OUTPUT_INT_ADDR_CONST): Mark symbols as position independent if + appropriate. + * config/arm/arm.md (consttable_4, consttable_8, consttable_end): + Keep track of when we are building the constant table. + +Sat May 22 09:34:22 1999 Philip Blundell + + * config/arm/arm.c (arm_override_options): Fix erroneous warning + message. + +Sat May 22 09:06:33 1999 Nick Clifton + + * config/arm/arm.h (NEED_PLT_GOT): Only define if not already + defined. + +Sat May 22 07:17:05 1999 Nick Clifton + + * tm.texi (FUNCTION_ARG): Correct description of a stack element + in a PARALLEL. + +Sat May 22 01:27:49 1999 Mark Mitchell + + * expr.h (lang_expand_constant): Guard with #ifdef TREE_CODE. + +Fri May 21 21:19:02 1999 Franz Sirl + + * rs6000.c (output_mi_thunk): Enable full support again. + +Fri May 21 20:09:52 1999 J"orn Rennecke + + * sh.h (BRANCH_COST): Define. + +Thu May 20 10:00:42 1999 Stephen L Moshier + + * Makefile.in (GCC_FOR_TARGET): Add -I$(build_tooldir)/include. + +Thu May 20 09:58:57 1999 Jan Hubicka + + * function.c (assign_stack_local): Align stack slot properly. + (assign_outer_stack_local): Likewise. + +Thu May 20 10:38:43 1999 Mark Mitchell + + * expr.h (lang_expand_constant): Declare. + * toplev.c (lang_expand_constant): Define it. + * varasm.c (output_constant): Use it. + +Thu May 20 11:28:53 1999 Kaveh R. Ghazi + + * optabs.c (expand_cmplxdiv_straight, expand_cmplxdiv_wide): + Change function definitions to K&R style. + +Thu May 20 08:16:39 1999 Bruce Korb + + * fixinc/fixincl.c: We must not ignore SIGCLD now. + +Thu May 20 07:06:39 1999 Alexandre Oliva + + * fixinc/Makefile.in(gnu-regex.o): add $(INCLUDES) to compile options + * fixinc/fixincl.c(wait_for_pid): K&R-ify arguments + (several places): omit static initialization + (process): use single fd, since only the read fd is used + * fixinc/gnu-regex.c: define 'const' away, if not supported + * fixinc/procopen.c(several places): omit static initialization + * fixinc/server.c: define 'volitile' away, if not supported + +1999-05-20 Andreas Schwab + + * config/dbxcoff.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Use + asm_fprintf and %L to generate the label name. + * config/dbxelf.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Likewise. + (ASM_OUTPUT_SOURCE_LINE): Correct generation of internal labels. + +Thu May 20 01:40:55 1999 Jeffrey A Law (law@cygnus.com) + + * jump.c (can_reverse_comparison_p): Do not abort if the comparison + insn for a conditional jump can not be found. + +Wed May 19 23:58:58 1999 Jeffrey A Law (law@cygnus.com) + + * mips.h (ENCODE_SECTION_INFO): Do not perform GP optimizations + on variables in specific sections other than .sbss and .sdata. + +Wed May 19 03:56:56 1999 Mark Mitchell + + * stmt.c (expand_return): Call start_cleanup_deferral and + end_cleanup_deferral around conditional code. + +Wed May 19 08:40:08 1999 Bruce Korb + + * fixinc/fixincl.tpl: Avoid depending on ANSI C features for + filename lists. Utilizes new "krstr" AutoGen function. + * fixinc/fixincl.x: Rebuilt. + +Wed May 19 02:47:11 1999 Jan Hubicka (hubicka@freesoft.cz) + + * i386.c (output_float_compare): Avoid GNU-C extensions. + +Wed May 19 00:34:40 1999 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump to distinguish mainline tree from the + gcc-2.95 branch. + +Tue May 18 03:53:37 1999 Craig Burley + + Improve open-coding of complex divide: + * flags.h: Declare new front-end-malleable flag. + * toplev.c: Define new flag. + * optabs.c (expand_cmplxdiv_straight): New function to do original + open-coding. + (expand_cmplxdiv_wide): New function to do new open-coding, + from Toon Moene, with changes (call to emit_barrier, dropping + of spurious `ok = 1;', plus the obvious `break;' -> `return 0;'). + (expand_binop): A bit of spacing fixing, while at it. + Use new functions instead of inlining the open-coding code. + +Tue May 18 00:51:46 1999 Krister Walfridsson + + * configure.in (arm*-*-netbsd*): Use collect2. + (i[34567]86-*-netbsd*): Likewise. + (m68k*-*-netbsd*): Likewise. + (ns32k-*-netbsd*): Likewise. + (sparc-*-netbsd*): Likewise. + (vax-*-netbsd*): Likewise. + * configure: Rebuilt. + +Tue May 18 00:21:34 1999 Zack Weinberg + + * cppspec.c: Insert -no-gcc into command line unless -gcc was + given by user. + * gcc.c (default_compilers): Define __GNUC__ and + __GNUC_MINOR__ only if -no-gcc was not given. + * objc/lang-specs.h: Likewise. + * cpp.texi: Document -x and -std options; explain that -lang + is no longer supported. Minor related corrections. + +Mon May 17 23:56:39 1999 Alexandre Oliva + + * Makefile.in (stmp-fixproto): Pass location of mkinstalldirs to + fixproto. + * fixproto: Avoid unportable constructs such as `basename' and + `mkdir -p'. Use mkinstalldirs from the environment if `mkdir -p' + fails. + + * fixinc/fixincl.c: Remove #error, it is not portable. + +Mon May 17 23:50:41 1999 Marc Espie + + * collect2.c (main): Fix typo in COLLECT2_HOST_INITIALIZATION. + +Mon May 17 19:45:41 1999 Rainer Orth + + * fixinc/fixincl.c (process): Wait for children from chain_open() + to avoid creating zombies. + + * fixinc/inclhack.tpl: Removed no-op pipe. + + * fixinc/inclhack.sh fixinc/fixincl.sh: regenerate + +Mon May 17 07:23:34 1999 Mark Mitchell + + * tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match + reality. + * expr.c (init_noncopied_parts): Don't generate initializers for + parts that don't need them. + +Mon May 17 02:56:35 PDT 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Oct 31 05:08:34 CET 1998 Jan Hubicka (hubicka@freesoft.cz) + + * reg-stack.c: Do not emit pop insns after cc0 setter. + (emit_pop_insn): Do not emit insn in case WHEN is NULL. + (compare_for_stack_reg): Update REG_DEAD note and + do not emit push insn. + + * i386.c: (output_float_compare): Handle new REG_DEAD notes. + +Mon May 17 01:57:37 1999 David Daney + + * i386/sol2.h (LINK_SPEC): Do not pass "-z text" to the linker + if -mimpure-text. + +1999-05-17 Andreas Schwab + + * m68k.c (standard_68881_constant_p): Don't accept -0.0 as valid + 68881 constant. + + * fold-const.c (fold_truthop): When converting a one-bit + comparison don't sign extend the constant. + + * cse.c (cse_insn): Copy SRC_CONST before putting it in the + REG_EQUAL note. + +1999-05-17 Mike Stump + + * rs6000/vxppc.h (CPP_SPEC): Fix support for vararg functions. + +Sat May 15 14:22:40 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/hackshell.tpl: Fix mis-applied patch. + * fixinc/inclhack.sh: Regenerated. + +Thu May 13 21:05:55 1999 Mark Kettenis + + * fixinc/mkfixinc.sh: Add the Hurd (*-*-gnu*) to the list of + targets that do not need any fixes. + +Sat May 15 14:12:38 1999 Michael Hayes + + * config/c4x/c4x.md (set_lo_sum+2): New splitter to load large + const_ints. + +Sat May 15 14:09:08 1999 Michael Hayes + + * config/c4x/c4x.md (decrement_and_branch_on_count): Disabled. + (doloop_begin, doloop_end): New patterns. + (*rptb_init): Added extra operands. + +Fri May 14 21:31:36 1999 Michael Hayes + + * config/c4x/c4x.md (*umulqi3_highpart_clobber): Fix operand 2 + constraints order. + +1999-05-14 Ulrich Drepper + + * fixinc/fixinc.x86-linux-gnu (FD_ZERO): Fix operand numbers in + asm input operands. + +Thu May 13 15:34:18 1999 David Edelsohn + + * rs6000.c (mask_constant): Delete. + (mask_operand): Move mask_constant() body to here. + * rs6000.h (mask_constant): Delete declaration. + * rs6000.md (nabsdi2): Reverse subtraction in splitter. + +Thu May 13 02:25:01 1999 Jeffrey A Law (law@cygnus.com) + + * cpp.texi: Fix some typos. + +Thu May 13 01:49:55 1999 Graham Stott + + * loop.c (maybe_eliminate_biv): Check regno against + max_reg_before_loop. + + * i386.c (memory_address_info): Correct the scale + factor test. + +Thu May 13 01:31:19 1999 Nick Burrett + + * arm.md (nop): Backout Apr 27 change. Ensure REGISTER_PREFIX is + applied to each register. + * aof.h (ASM_FILE_START): Define register `r0'. + +1999-05-12 20:22 -0400 Zack Weinberg + + * configure.in: Make --enable-cpp and --with-cpp-install-dir + documented options. Enable the cpp driver by default. + * configure: Rebuilt. + +Wed May 12 18:08:48 1999 David Edelsohn + Richard Henderson + + * rs6000.c (print_operand) [w]: Calculate signed constant more clearly. + (rs6000_allocate_stack_space): Print as hexadecimal value. + * rs6000.h (CONST_OK_FOR_LETTER_P): 'L' checks for a signed, + 16-bit shifted constant. Fix typo for 'P'. + (EXTRA_CONSTARINT): 'T' checks for a 32-bit mask operand. + * rs6000.md (movsi, addsi3_internal1, movdi, adddi3_internal1): + Use 'L' for shifted constant. + (anddi3_internal3): Fix typo. + (32-bit mask patterns): Use 'T'. + +Wed May 12 07:30:31 1999 Bruce Korb + + * fixinc/fixincl.c(quoted_file_exists): new procedure to ensure that + a file exists before trying to copy it into the destination + (extract_quoted_files): use that routine. + +Wed May 12 07:27:31 1999 Craig Burley + + Allow front end (like g77's) to override maintenance of errno: + * expr.c (expand_builtin): Bother with errno only if + flag_errno_math. + * flags.h: Declare flag_errno_math. + * toplev.c: Define flag_errno_math. + +Tue May 11 23:55:49 1999 Jeffrey A Law (law@cygnus.com) + + * fixproto: Change "mkdir" calls to "mkdir -p" + + * fixinc/inclhack.def (io_def_quotes): Consistently allow multiple + whitespace characters between the "define" and the name of the macro. + * fixinc/fixincl.x, fixinc/inclhack.sh: Rebuilt. + +Tue May 11 20:46:37 1999 Richard Henderson + + * alpha.c (alpha_expand_block_move): Handle TImode registers + used with ADDRESSOF. + (alpha_expand_block_clear): Handle ADDRESSOF specially. + +1999-05-11 Ulrich Drepper + + * fixinc/fixinc.x86-linux-gnu (FD_ZERO): Remove unneccessary + memory output operand which irritates gcc. + +Tue May 11 11:45:16 1999 Dave Brolley + + * toplev.c (documented_lang_options): Add -MD, -MMD, -M and -MM for + cpplib-enabled compilers. + +Tue May 11 11:34:56 1999 Vladimir Makarov + + * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Add parentheses + around &&. + +Mon May 10 13:51:24 1999 Nick Clifton + + * tm.texi (FUNCTION_ARG): Stack element of PARALLEL must come + first. + +Tue May 11 01:32:01 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/inclhack.def (sun_auth_proto): Apply to all targets. + (sysz_stdlib_for_sun): Similarly. + * fixinc/fixincl.x, fixinc/inclhack.sh: Rebuilt. + +Mon May 10 20:34:10 1999 Jim Wilson + + * config/mips/elf.h (UNIQUE_SECTION_P): Undef. + * config/mips/elf64.h (UNIQUE_SECTION_P): Undef. + * config/mips/mips.h (UNIQUE_SECTION_P): Define to 0. + +1999-05-10 18:21 -0400 Zack Weinberg + + * cppfiles.c (initialize_input_buffer): New function. + (finclude): Call it, if pfile->input_buffer is NULL. Accept + any character device as an input file. + (read_and_prescan): Use pfile->input_buffer and + pfile->input_speccase. + * cppinit.c (cpp_cleanup): Free pfile->input_buffer and + pfile->input_speccase. + * cpplib.h (cpp_reader): Add input_buffer, input_speccase, and + input_buffer_len members. Use memcpy in CPP_PUTS_Q. + + * cppmain.c: Buffer output in the token_buffer; throttle + number of calls to fwrite; check for errors from fwrite. + +1999-05-10 18:21 -0400 Zack Weinberg + + * cppspec.c: Treat two non-option arguments as input and + output file. Three or more non-option args is an error. + Clean up. + * gcc.c (default_compilers): Pass -$ to the preprocessor. + * objc/lang-specs.h: Likewise. + +Mon May 10 12:59:20 1999 Jeffrey A Law (law@cygnus.com) + + * optabs.c (emit_cmp_and_jump_insns): Handle the case where both + operands to the comparison are constants. + +Mon May 10 07:28:10 1999 Bruce Korb + + * fixinc/inclhack.def(arm_norcroft_hint): check before fixing + (no_double_slash): portability + (math_exception): added reminder comment + +Mon May 10 01:28:10 1999 Craig Burley + + From Fri May 7 9:31:41 1999 Donn Terry (donn@interix.com): + * varasm.c (mark_constant_pool): Add some transitive closure. + +Sun May 9 22:51:04 1999 Craig Burley + + Fix gcc.dg/990506-0.c: + * c-typeck.c (require_complete_type): Handle ERROR_MARK input. + +Sun May 9 13:19:12 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (cprop_insn): Do not try to simplify a simple jump. + +Sun May 9 11:12:19 1999 Philip Blundell + + * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Add (PLT) to branch if + necessary. Reported by jim@federated.com. + +Sat May 8 23:05:35 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (PRINT_OPERAND_ADDRESS): Output "%r0", not "r0" for the + base register in an absolute memory address. + * pa.md (conditional moves): Avoid using immediate zero for + register zero. + +Sat May 8 06:23:21 1999 Philip Blundell + + Based on patch by Scott Bambrough: + * config/arm/arm.h (NEED_PLT_GOT): New macro. Set to 0 if not + already defined. + * config/arm/elf.h (NEED_PLT_GOT): Define to flag_pic. + * config/arm/arm.md (call_symbol, call_value_symbol et al.): If + NEED_PLT_GOT is true, add explicit "(PLT)" to generated branches. + * config/arm/arm.c (output_func_epilogue, + output_return_instruction): Likewise for calls to abort. + +Sat May 8 01:57:58 1999 Donn Terry (donn@interix.com) + + * calls.c (rtx_for_function_call): Extend function pointer being + passed to chkr_check_exec_libfunc, if needed. + +Sat May 8 01:51:50 1999 David Edelsohn + + * ginclude/stdarg.h (__va_rounded_size): Use long type for + rounding on AIX. + * ginclude/varargs.h: Likewise. + +Sat May 8 01:47:20 1999 Andreas Schwab + + * invoke.texi: Remove duplicates in the description of -d + letters. Fix use of @item vs. @itemx. + +Sat May 8 01:43:02 1999 Franz Sirl + + * rs6000.h (RS6000_VARARGS_OFFSET): Die die die. + (CUMULATIVE_ARGS): Remove varargs_offset; update commentary. + * rs6000.c (setup_incoming_varargs): Fix typo last change. + (init_cumulative_args): Remove varargs_offset references. + + * rs6000/linux.h (NO_IMPLICIT_EXTERN_C): Define. + (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX): Undefine. + +Sat May 8 01:34:19 1999 Andreas Schwab + + * reload1.c (gen_mode_int): New function. + (reload_cse_move2add): Use it to generate the new constants. + +Sat May 8 01:25:09 1999 Andreas Schwab + + * varasm.c (output_constant): Do nothing if -fsyntax-only. + +Fri May 7 19:10:15 1999 Vladimir Makarov + + * sparc.h (GO_IF_LEGITIMATE_ADDRESS): Prohibit REG+REG addressing + for TFmode when there are no instructions which accept REG+REG + instructions. + +Fri May 7 12:38:54 1999 Jim Wilson + + * mips/elf64.h (MAKE_DECL_ONE_ONLY, UNIQUE_SECTION_P): Define. + * mips/mips.c (mips_select_rtx_section): When TARGET_MIPS16, use + function_section instead of text_section. + * mips/mips.h (ENCODE_SECTION_INFO): Add check for UNIQUE_SECTION_P + in TARGET_MIPS16 STRING_CST handling. + +Fri May 7 09:54:11 1999 Nick Clifton + + Patch from: Nick Burrett + + * arm.c (arm_poke_function_name): New function to implement + -mpoke-function-name. + * aof.h (ASM_DECLARE_FUNCTION_NAME): Call it. + * aout.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * elf.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * arm.h: Prototype it. + (TARGET_SWITCHES): Add `no-poke-function-name'. + +Fri May 7 14:19:31 1999 Rainer Orth + + * fixinc/server.c (load_data): Cast text_size to long, adapt + format. + * fixinc/server.c (read_pipe_timeout): Declare volatile, modified + in signal handler. + (sig_handler): Add debug code. + * fixinc/server.c (run_shell): Don't \-escape cd, it breaks the + Ultrix V4.3 /bin/sh. + * fixinc/server.c (def_args): Use static instead of STATIC to + avoid redefinition error from linker iff DEBUG. + + * fixinc/hackshell.tpl: Don't strip trailing directory from + DESTDIR - that is already done + + * fixinc/fixincl.c (run_compiles): fix memory leak + +Thu May 6 20:34:00 1999 Mark Mitchell + + * resource.c (mark_referenced_resources): Make volatil + monotonically increasing. + (mark_set_resources): Likewise. + +Thu May 6 20:02:33 1999 Fred Fish + + * rs6000/xm-beos.h (HAVE_VPRINTF): Don't redefine if already defined. + (HAVE_PUTENV, HAVE_ATEXIT, HAVE_RENAME): Likewise. + +Wed May 5 20:28:32 1999 Jason Merrill + + * install.texi (Header Dirs): s/GPLUS/GPLUSPLUS/. + +Wed May 5 23:44:15 1999 J"orn Rennecke + + * unroll.c (copy_loop_body): Don't copy VTOP notes from copy_notes_from. + +Wed May 5 16:26:13 1999 Vladimir Makarov + + * function.c (purge_addressof_replacements): Rename into + purge_bitfield_addressof_replacements. + (purge_addressof_replacements): New variable. + (purge_addressof_1): Add code for changing addressof in notes for + field values which are extracted by usage MEM with narrower mode. + (purge_addressof): Initialize purge_bitfield_addressof_replacements. + +Wed May 5 07:40:02 1999 Nick Clifton + + Patch from: Nick Burrett + * config/arm/arm.h (ARM_MCOUNT_NAME): Define. + (FUNCTION_PROFILER): Remove assembler dialect dependency and use + ARM_MCOUNT_NAME. + (TRAMPOLINE_TEMPLATE): Remove assembler dialect dependency. + + * config/arm/aof.h (ARM_MCOUNT_NAME): Define. + +1999-05-05 09:58 -0400 Zack Weinberg + + * gcc.c (default_compilers): Fix brace nesting bug. + * objc/lang-specs.h: Use %i, not %g.mi, for the input file + when processing an .mi file. + +Tue May 4 13:17:55 1999 Mark Mitchell + + * resource.c (mark_set_resources): Handle UNSPEC_VOLATILE, + ASM_INPUT, TRAP_IF, and ASM_OPERANDS just like in + mark_referenced_resources. + +Mon May 3 22:38:41 1999 David Edelsohn + + * rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Change non-PowerPC + and AIX64 combination to warning. Add warning for disabling + PowerPC64 support when using 64-bit mode. + (LIB_SPEC): Do not link with libg.a in 64-bit mode. + (LINK_SPEC): Do not export libg.exp symbols in 64-bit mode. + * rs6000/rs6000.h (MY_ISCOFF): Treat import/export files as valid + XCOFF files. + (read_only_data_section, private_data_section, + read_only_private_data_section): Always align CSECTs to doubleword + boundary regardless of mode. + (TEXT_SECTION_ASM_OP): Align text CSECT on doubleword boundary in + 64-bit mode. + (DATA_SECTION_ASM_OP): Always align CSECT to doubleword boundary. + (ASM_OUTPUT_LOCAL): Use rounded size in 64-bit mode to + maintain doublword alignment. + +Mon May 3 14:45:23 1999 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (btst insns): btst does not leave cc0 in a usable + state for redundant tst eliminatino. + * mn10300.md (btst insns): Likewise. + +Mon May 3 16:14:32 1999 Kaveh R. Ghazi + + * mips.h (Pmode): Revert Oct 14th change which added a cast. + +Sun May 2 14:02:21 1999 Mark Mitchell + + * tree.h (struct tree_decl): Add comdat_flag. + (DECL_COMDAT): Define it. + * toplev.c (wrapup_global_declarations): Don't output a + DECL_COMDAT function just because it's public. + +Sun May 2 15:16:42 1999 Joseph S. Myers + + * pdp11.h (TARGET_SWITCHES): Fix error in previous change. + (ASSEMBLER_DIALECT): Define. + (CONDITIONAL_REGISTER_USAGE): Rename floating point registers if + required for the UNIX assembler. + (ASM_OUTPUT_INT): Remove. The compiler will synthesize it. + (ASM_OUTPUT_ADDR_VEC_PROLOGUE): Remove. + (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Change to "[" and "]". + (TRAMPOLINE_TEMPLATE): Use ASM_OUTPUT_SHORT. + * pdp11.c (output_addr_const_pdp11): Copy of output_addr_const + adapted to output constants in octal. + * pdp11.c, pdp11.h, pdp11.md: Use output_addr_const_pdp11 instead + of output_addr_const. Output constants in octal. Use assembler + dialect alternatives where DEC and UNIX assemblers use different + instruction names. + +Sun May 2 01:15:06 PDT 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Fri Apr 30 13:55:43 1999 Richard Henderson + + * va-ppc.h (__va_start_common): Let __builtin_saveregs do the work. + * rs6000.c (expand_builtin_saveregs): For V4, initialize a private + va_list struct, and return a pointer to it. + (setup_incoming_varargs): V4 save area based off virtual_stack_vars + instead of frame_pointer. + +Thu Apr 29 23:02:22 1999 Mark Mitchell + + * emit-rtl.c (start_sequence): Expand comments. + (start_sequence_for_rtl_expr): Likewise. + (push_to_sequence): Likewise. + (end_sequence): Likewise. + * expr.c (inhibit_defer_pop): Likewise. + * expr.h (inhibit_defer_pop): Likewise. + (NO_DEFER_POP): Likewise. + (OK_DEFER_POP): Likewise. + +Thu Apr 29 22:13:46 1999 Robert Lipe + + * configure.in (i?86-UnixWare7*-sysv): Set thread_file to 'posix' + --enable-threads[={yes,pthreads,posix}] is passed as a command + line parameter to configure. + * config/i386/sysv5.h (LIB_SPEC): Add support for '-pthread'. + (CPP_SPEC): Likewise. + +Thu Apr 29 17:23:59 1999 Richard Henderson + + * emit-rtl.c (operand_subword): Religiously mask and sign-extend + from 32-bits to HOST_WIDE_INT. + +Thu Apr 29 15:58:52 1999 Robert Lipe + + * fixinc/regex.c, fixinc/regex.h: Removed. Replace with... + * fixinc/gnu-regex.c, fixinc/gnu-regex.h: Imported from GDB 4.18. + * fixinc/Makefile.in (OBJ, HDR): Handle name changes from above. + (gnu-regex.o): Define REGEX_MALLOC to avoid memory leak. + * fixinc/fixincl.c: new regex.h header name + * Makefile.in: new regex.[ch] file names + +Thu Apr 29 12:53:33 1999 Richard Henderson + + * calls.c (emit_call_1): Pass rounded_stack_size to emit_call + instead of the unrounded size. + +1999-04-28 14:40 Bruce Korb + + * fixinc/mkfixinc.sh: Makesure the result shell script is writable + +Wed Apr 28 10:36:39 1999 Andreas Schwab + + * config/m68k/m68k.md (cmpsi+1): Use cmp.w when comparing a 16 bit + constant with an address register. + +Wed Apr 28 00:14:41 PDT 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Apr 27 19:50:25 EDT 1999 Andrew MacLeod + + * rtl.h (REG_EH_REGION): Update comment to indicate a value of -1 + indicates no throw and no nonlocal gotos. + * optabs.c (emit_libcall_block): Emit REG_EH_REGION with a value + of -1 instead of 0 to indicate a nonlocal goto won't happen either. + * flow.c (count_basic_blocks, find_basic_blocks_1): Ignore libcall + blocks, look for REG_EH_REGION note exclusively. + (make_edges): Check for REG_EH_REGION > 0 for specified handlers. + +Tue Apr 27 15:33:42 1999 David Edelsohn + + * rs6000.h (read_only_data_section, private_data_section, + read_only_private_data_section, toc_section): Align CSECT on + doubleword boundary for 64-bit target. + (DATA_SECTION_ASM_OP): Likewise. + * rs6000.c (rs6000_stack_info): Leaf procedure stack limit is 288. + +Tue Apr 27 20:19:47 1999 J"orn Rennecke + + * sh.md (insv): Use copy_addr_to_reg. + + * final.c (insn_lengths_max_uid): New variable. + (init_insn_lengths, shorten_branches): Set it. + (get_attr_lengths): Test insn uid against insn_lengths_max_uid. + +1999-04-27 08:32 -0400 Zack Weinberg + + * expr.c (emit_move_insn_1): Abort if MODE argument is invalid. + (compare): Punt if TREE_OPERAND (exp, 0) is an ERROR_MARK. + +Tue Apr 27 01:33:43 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (ORDINARY_FLAGS_TO_PASS): Renmaed from FLAGS_TO_PASS. + Remove "CC". + (FLAGS_TO_PASS): New variable. + +Tue Apr 27 00:36:44 1999 Nick Burrett + + * arm.md (nop): Output instruction using output_asm_insn to fix + assembler dialect problems. + +Mon Apr 26 23:55:50 1999 Robert Lipe + + * Makefile.in (fixinc.sh): Fix dependencies. + + * fixinc/inclhack.def (avoid_bool): Enable match if typedefs are + prepended by spaces. + (sco5_stat_wrappers): New fix. Make sys/stat.h C++ safe. + * fixinc/fixincl.sh, fixinc/fixincl.x, fixinc/inclhack.sh: Rebuilt. + +Mon Apr 26 23:28:54 1999 Mumit Khan + Donn Terry + + * function.c (put_var_into_stack): Change ptr_mode to Pmode + in setup for chkr_set_right_libfunc calls. + (assign_params): Likewise. + * expr.c (emit_push_insn): Change ptr_mode to Pmode in + setup for chkr_copy_bitmap_libfunc and chkr_set_right_libfunc calls. + (expand_assignment): Change ptr_mode to Pmode in + setup for chkr_add_libfunc and chkr_copy_bitmap_libfunc. + (store_expr): Change ptr_mode to Pmode in + setup for chkr_add_libfunc and chkr_copy_bitmap_libfunc. + (expand_expr): Change ptr_mode to Pmode in + setup for chkr_check_addr_libfunc. + (expand_builtin): Change ptr_mode to Pmode in + setup for chkr_check_str_libfunc, chkr_copy_bitmap_libfunc and + chkr_check_addr_libfunc. + * calls.c (rtx_for_function_call): Change ptr_mode to Pmode in + setup for chkr_check_exec_libfunc. + (expand_call): Change ptr_mode to Pmode in + setup for chkr_set_right_libfunc. + (expand_call): Change ptr_mode to Pmode in + setup for chkr_set_right_libfunc. + (store_one_arg): Change ptr_mode to Pmode in + setup for chkr_set_right_libfunc. + + * c-parse.in (absdcl1): Allow attributes in explicit typespecs. + (%expect): Update. + * c-parse.y: Regenerate. + * c-parse.c: Likewise. + * objc/objc-parse.c: Likewise. + * objc/objc-parse.y: Likewise. + +Mon Apr 26 21:17:41 1999 Jason Merrill + + * c-pragma.c (push_alignment): Don't ignore alignments greater than + 4 bytes. + (handle_pragma_token): Likewise. + + * c-pragma.c: Support for #pragma pack (push, , ). + (struct align_stack): Add id field. + (push_alignment, pop_alignment): Take id parameter. + (handle_pragma_token): Add necessary states. + * c-pragma.h (enum pragma_state): Add necessary states. + +Tue Apr 27 13:58:23 1999 Michael Hayes + + * config/c4x/c4x.md (*cmpqf, *cmpqf_noov, *cmpqi_test, + *cmpqi_test_noov): Remove ? modifier from constraints list. + (*smulqi3_highpart_clobber, *umulqi3_highpart_clobber): Swap + output strings to match new constraint ordering. + +1999-04-26 19:16 -0400 Zack Weinberg + + * cpphash.c (dump_definition): New function. + * cpphash.h: Prototype it. + + * cpplib.c (handle_directive): Don't output anything here. + Streamline. + (pass_thru_directive): Take a length, not a pointer to the + end. All callers changed. + (do_define): Handle -dD, -dN, -g3 entirely here. Streamline. + (do_include): Handle -dI here. + (do_ident): Correct to match cccp. + (do_pragma): Copy the pragma through here. + (do_assert, do_unassert): Tidy. + + * cppinit.c (cpp_finish): If -dM was specified, walk the macro + hash table and call dump_definition on all the entries. + * cppmain.c: cpp_finish may produce output. + +Mon Apr 26 15:27:33 1999 Mark Mitchell + + * toplev.c (compile_file): Move call to check_global_declarations + after output_exception_table to restore behavior as it was before + 1999-04-22 change. + +1999-04-26 10:50 -0700 Bruce Korb + + * fixinc/fixincl.c: Improve the handling of child process exits + * fixinc/server.[ch]: Export the interface for shutting down + the server process + * fixinc/inclhack.tpl: Remove unnecessary character quote + * fixinc/fixincl.sh, fixinc/inclhack.sh: Regenerate + +Mon Apr 26 10:41:42 EDT 1999 Andrew MacLeod + + * alpha.md (builtin_setjmp_receiver): Use a label_ref instead of + a code label. + +1999-04-26 09:47 -0400 Zack Weinberg + + * rtl.texi: Document the rtl classes and their relation to + formats. + +Mon Apr 26 01:02:38 1999 Richard Henderson + + * alpha.md (fix_trunc patterns): Use reg_no_subreg_operand on op0 + for less work in reload. + (movsf and movdf patterns): Put fp reg alternatives first. + +Mon Apr 26 01:55:56 1999 Marc Espie + + * configure.in (openbsd): Factorize xmake_file. + (ix86 openbsd): Trim obsolete comment. + (vax openbsd): Fix typo. + * configure: Rebuilt. + +Mon Apr 26 01:30:59 1999 Donn Terry + + * expr.c (expand_assignment): Improve test for pointer type. + +Mon Apr 26 00:26:18 1999 Richard Henderson + + * alpha.c (print_operand_address): Account for the subreg word. + +Mon Apr 26 01:08:36 1999 Toshiyasu Morita (tm@netcom.com) + + * fold-const.c (make_range): Always initialize arg0 and arg1. + (fold): Similarly for alt0 and alt1. + * function.c (fixup_var_refs_insns): Initialize insn_list. + (instantiate_virtual_regs_1): Initialize offset. + * optabs.c (expand_binop): Initialize carry_in, carry_out, op0_xhigh + and op1_xhigh. + * stmt.c (expand_end_case): Initialize minval and maxval. + +Mon Apr 26 01:02:34 1999 Nathan Sidwell + + * toplev.c (report_error_function): Reorder file stack and + function name printing. Ignore FILE parameter. + +Mon Apr 26 00:58:54 1999 Jerry Quinn + + * pa.h (architecture_type): New enum. + (pa_arch_string, pa_arch): Declare. + (MASK_PA_10, MASK_PA_20): New flags. + (TARGET_SWITCHES): Add pa-risc-2-0. Update docs for PA1.0 codegen. + (TARGET_OPTIONS): Add -march= option. + * pa.c (pa_arch, pa_arch_string): Define. + (override_options): Set them. + * pa/pa-hpux10.h (ASM_FILE_START): Output LEVEL 2.0 asm directive for + 2.0 architecture. + * invoke.texi (Option Summary, HPPA Options): Document new + architecture flags. + + * pa/pa-hpux.h, pa/pa-hpux10.h, pa/pa-hpux9.h, pa/pa-osf.h, pa.h, + pa.c, pa.md, configure.in, configure: Replace TARGET_SNAKE by + TARGET_PA_11 and MASK_SNAKE by MASK_PA_11. + +Mon Apr 26 00:28:25 1999 Theodore Papadopoulo + + * flags.h (inline_max_insns): Declare. + * integrate.c (inline_max_insns): New variable. + (function_cannot_inline_p): Use it. + * toplev.c (main): Add the flag -finline-limit-n. + (display_help): Document -finline-limit-n. + * invoke.texi: Document -finline-limit-n + +Sun Apr 25 23:03:32 1999 Richard Henderson + + * stmt.c (expand_asm_operands): Reload in-out reg-only memory operands. + +Sun Apr 25 13:06:13 1999 Richard Henderson + + * function.c (assign_parms/STACK_BYTES): Revert last change, + and that of 19 Nov. + +Sun Apr 25 12:30:50 1999 Richard Henderson + + * calls.c (emit_call_1): New arg rounded_stack_size; update callers. + Update pending_stack_adjust based on this value. + (compute_argument_block_size): Include pending_stack_adjust in + PREFERRED_STACK_BOUNDARY alignment. + * function.c (assign_parms): Don't round to PREFERRED_STACK_BOUNDARY. + +Sun Apr 25 14:38:10 EDT 1999 John Wehle (john@feith.com) + + * stupid.c (stupid_mark_refs): Generate a REG_UNUSED note + for a register which is clobbered even if the register + was used by an earlier instruction. + + * i386.md (fix_truncsfdi2, fix_truncdfdi2, + fix_truncxfdi2): Don't bother with the gen_reg_RTX. + (fix_truncsfsi2, fix_truncsfdi2, fix_truncdfsi2, + fix_truncdfdi2, fix_truncxfsi2, fix_truncxfdi2): Update + operand constraints and modes. + * i386.c (output_fix_trunc): Use HImode register to avoid + memory stalls. Call output_move_double instead of output_to_reg. + (output_to_reg): Remove. + * i386.h: Likewise. + + * i386.md (negsf2, negdf2, negxf2): Set the type + attribute to fpop. + +Sat Apr 24 23:15:57 1999 Donn Terry (donn@interix.com) + + * alpha.md (call_value_nt): Correct subscripts. + +Sat Apr 24 20:49:20 1999 Richard Henderson + + * alpha.h (PRINT_OPERAND_ADDRESS): Break out to ... + * alpha.c (print_operand_address): here. Handle subregs. + +Fri Apr 23 22:35:41 EDT 1999 John Wehle (john@feith.com) + + * acconfig.h (HAVE_GAS_FILDS_FISTS): Add. + * configure.in: Check assembler instructions. + * configure: Rebuild. + * config.in: Likewise. + * i386.md (floathisf2, floathidf2, floathixf2): New patterns. + * i386.c (print_operand): Use the proper suffix for a 387 HImode + operand. Abort if a 387 operand has an unsupported size. + +Fri Apr 23 16:57:40 1999 Richard Henderson + + * alpha.c (alpha_write_verstamp): Mark `file' unused. + * alpha.h (FUNCTION_VALUE): Use gen_rtx_REG not gen_rtx. + (LIBCALL_VALUE): Likewise. + (GO_IF_LEGITIMATE_SIMPLE_ADDRESS): Handle normal subregs. + +Fri Apr 23 14:57:33 1999 Donn Terry + + * alpha32.h (INITIALIZE_TRAMPOLINE): Get offsets right. + + * alpha.c (alpha_initialize_trampoline): Add covert_memory_address + calls as needed. + +Fri Apr 23 14:36:47 1999 Richard Henderson + + * alpha.c (alpha_expand_prologue): Don't negate frame size + for use with subq. + +Fri Apr 23 09:43:18 1999 Nick Clifton + + * print-rtl.c (print_rtx): Display LABEL_NUSES for labels. + +Thu Apr 22 23:08:37 1999 Mark Mitchell + + * toplev.h (wrapup_global_declarations): Declare. + (check_global_declarations): Likewise. + * toplev.c (wrapup_global_declarations): New function, split out + from ... + (check_global_declarations): Likewise... + (compile_file): Here. + +Thu Apr 22 22:34:41 1999 Richard Henderson + + * c-parse.in (expr_no_commas): Verify we've an expr before + calling C_SET_EXP_ORIGINAL_CODE. + +Thu Apr 22 22:22:15 EDT 1999 John Wehle (john@feith.com) + + * toplev.c (rest_of_compilation): Always set + current_function_uses_only_leaf_regs appropriately. + +Thu Apr 22 14:39:43 1999 Mumit Khan + + * i386/xm-cygwin.h (HAVE_BCOPY): Delete unneeded macro. + (HAVE_BZERO): Likewise. + (HAVE_BCMP): Likewise. + (HAVE_RINDEX): Likewise. + (HAVE_INDEX): Likewise. + (DIR_SEPARATOR_2): Define. + (GET_ENV_PATH_LIST): Turn path lists into POSIX. + (PATH_SEPARATOR): Use ':'. + +1999-04-22 Bruce Korb + + * configure.in: enable disabling of fast fixincludes + * configure: regenerate + +1999-04-21 14:55 -0400 Zack Weinberg + + * gen-protos.c: #undef abort after including system.h. + Delete defns of fancy_abort and fatal. + * fix-header.c: Delete defn of fancy_abort. + +Wed Apr 21 12:09:38 1999 Mumit Khan + + * cccp.c (simplify_filename): Always preserve leading double slash. + +Wed Apr 21 18:15:55 1999 Michael Hayes + + * config/c4x/c4x.md: Add new peepholes to remove redundant loads. + +Wed Apr 21 17:41:29 1999 Michael Hayes + + * config/c4x/c4x.md (binary patterns): Reorder alternatives + so that two operand instructions are chosen before three operand + instructions. + +Tue Apr 20 23:38:58 1999 Nathan Sidwell + + * objc/Make-lang.in (objc-parse.c): Put BISON parameters in correct + order. + + * Makefile.in (c-parse.c): Put BISON parameters in correct + order. + +Tue Apr 20 16:38:11 1999 Richard Henderson + + * alpha.md (nt_lda): New pattern. + * alpha.c (alpha_expand_prologue): Use it for large frames + under windows nt. + +Tue Apr 20 17:57:14 1999 Catherine Moore + + * config/arm/arm.md (movhi): Add check for odd offset. + +Tue Apr 20 13:14:58 EDT 1999 John Wehle (john@feith.com) + + * i386.c (output_move_double): Abort if a non-offsettable + memory operand is encountered. Delete unused code. + (find_addr_reg): Remove. + +Mon Apr 19 21:13:02 1999 Craig Burley + + * tree.def (BLOCK): Fix typo in comment. + +1999-04-19 14:51 -0400 Zack Weinberg + + * cpplib.c (output_line_command): Drop CONDITIONAL argument. + We can omit unnecessary line commands if file_change == + same_file and pfile->lineno != 0. All callers changed. + (cpp_get_token [case '\n']): Don't bump pfile->lineno if + CPP_OPTIONS (pfile)->no_line_commands is set. + * cpplib.h: Fix prototype of output_line_command. + +1999-04-18 17:46 -0400 Zack Weinberg + + * cppfiles.c (find_position, read_and_prescan): Use `unsigned + long' variables consistently to count line and column numbers. + +Sun Apr 18 15:50:33 EDT 1999 John Wehle (john@feith.com) + + * output.h (current_function_is_leaf, + current_function_uses_only_leaf_regs): Declare. + * function.c (current_function_is_leaf, + current_function_uses_only_leaf_regs): Define. + (init_function_start): Initialize current_function_is_leaf + and current_function_uses_only_leaf_regs. + * final.c (leaf_function): Don't define. + (final_start_function): Replace uses of leaf_function with + current_function_uses_only_leaf_regs. + * toplev.c (rest_of_compilation): Set current_function_is_leaf + prior to invoking local register allocation. + (rest_of_compilation): Replace uses of leaf_function with + current_function_uses_only_leaf_regs. + * dbxout.c (dbxout_symbol, dbxout_parms): Likewise. + * dwarf2out.c (add_location_or_const_vaule_attribute): Likewise. + * dwarfout.c (add_location_or_const_value_attribute): Likewise. + * sdbout.c (sdbout_symbol): Likewise. + * sparc.h (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Likewise. + * sparc.c (eligible_for_epilogue_delay, output_return, + sparc_return_peephole_ok): Likewise. + * sparc.md (leaf_function attribute, untyped_return): Likewise. + * i386.c (ix86_compute_frame_size): Don't align the stack + for leaf functions which don't allocate any stack slots. + * tm.texi: Update documentation. + +Sun Apr 18 02:15:09 PDT 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Apr 18 00:08:45 1999 Richard Henderson + + * alpha.h (GO_IF_LEGITIMATE_SIMPLE_ADDRESS): Correct last change -- + make sure FP_BASE_P registers are only used with an integer. + +Sat Apr 17 22:54:17 1999 Richard Henderson + + * alpha.h (REG_OK_FP_BASE_P): New macro. + (GO_IF_LEGITIMATE_SIMPLE_ADDRESS): Use it. + * alpha.md (adddi3+1): New insn to handle large constants off + the soft frame pointer. + (adddi3+2): Don't split soft frame pointer or arg pointer additions. + +Sun Apr 18 17:24:10 1999 Michael Hayes + + * config/c4x/c4x.c (legitimize_operands): Use rtx_cost + to determine if it is worthwhile forcing a constant into a register. + * config/c4x/c4x.h (CONST_COSTS): An integer value of 255 or 65535 + used with a logical and or an integer value of 16 or 24 used with + a right shift has zero cost on the C40. + +Sat Apr 17 21:30:11 1999 Bernd Schmidt + + * gcse.c (compute_local_properties): If setp is nonzero, clear + TRANSP instead of setting it to all ones. + +Sat Apr 17 21:10:10 1999 Jan Hubicka + + * i386.c (i386_preferred_stack_boundary_string): New global variable. + (i386_preferred_stack_boundary): New global variable. + (override_functions): Set it. Tidy option setting code. + * i386.h (TARGET_OPTIONS): New command line option. + (i386_preferred_stack_boundary_string): Declare it. + (i386_preferred_stack_boundary): Likewise. + (PREFERRED_STACK_BOUNDARY): Use i386_preferred_stack_boundary. + +Sat Apr 17 19:22:38 1999 Jan Hubicka + + * i386.c (k6_cost): Take into account the decoding time. + +Sat Apr 17 19:13:22 1999 Donn Terry + + * i386.h (PRINT_OPERAND_PUNCT_VALID_P): Allow _. + * i386.c (print_operand): New %_ operator. + (load_pic_register): Proper number of leading _ in GOT literal. + * i386.md (prologue_get_pc_and_set_got): Likewise. + * i386/unix.h (ASM_OUTPUT_MI_THUNK): Likewise. + +Sat Apr 17 19:13:07 1999 Richard Henderson + + * alpha.c (alpha_expand_prologue): Use gen_adddi3 instead of + emit_move_insn+plus_constant. For NT, don't use the stack probe + loop pointer to allocate stack space. + * alpha.md (adddi3): Always use lda to set the stack pointer. + +1999-04-17 20:11 -0400 Zack Weinberg + + * c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c, + haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include + toplev.h for real declaration of trim_filename. + * Makefile.in: Update dependencies. + +Sat Apr 17 14:36:19 1999 Craig Burley + + * tree.c (chainon): Check for circularity only if + ENABLE_CHECKING is defined. + +1999-04-17 10:15 -0400 Zack Weinberg + + * cccp.c: Make fatal non-static. + +Sat Apr 17 23:47:24 1999 Michael Hayes + + * config/c4x/c4x.md (*andqi3_255_clobber,*andqi3_65535_clobber): + New logical and patterns using C40 bit-field insert instructions. + (*lshrqi3_24_clobber,*ashrqi3_24_clobber,*lshrqi3_16_clobber, + *ashrqi3_16_clobber): New shift patterns using C40 bit-field insert + instructions. + +1999-04-16 22:44 -0400 Zack Weinberg + + * system.h: Always prototype abort. Prototype fatal. Define + abort to call fatal, not fprintf/exit. Define a stub macro + for trim_filename. + * toplev.c: Define DIR_SEPARATOR. (trim_filename): New + function. + * toplev.h: Prototype trim_filename, and #undef system.h's stub. + + * gcc.c, genattr.c, genattrtab.c, gencodes.c, genconfig.c, + genemit.c, genextract.c, genflags.c, genopinit.c, genoutput.c, + genpeep.c, genrecog.c: Make fatal non-static. + * gcov.c, gengenrtl.c, protoize.c: #undef abort after + including system.h. + + * config/i386/dgux.h, config/m68k/xm-amix.h: Remove stale code + relating to abort. + +Sat Apr 17 11:25:44 1999 Michael Hayes + + * config/c4x/c4x.md (mulqf3_clrqf_clobber, mulqi3_clrqi_clobber): + New patterns to support parallel multiply and load of zero. + +Fri Apr 16 01:23:47 1999 Jason Merrill + + * tree.c (valid_machine_attribute): If we're modifying the + FUNCTION_TYPE within a POINTER_TYPE and we don't get a decl, + update the POINTER_TYPE. + +Fri Apr 16 00:19:31 1999 Jan Hubicka + + * i386.c (x86_adjust_cost): Move break statement to correct place. + +Thu Apr 15 23:17:33 1999 Jerry Quinn + + * pa.h (HAVE_PRE_INCREMENT, HAVE_POST_INCREMENT, + HAVE_PRE_DECREMENT, HAVE_POST_DECREMENT): Fix pa_cpu value from + 8000 to PROCESSOR_8000. + +Thu Apr 15 20:46:57 1999 Donn Terry (donn@interix.com) + + * expr.c (expand_assignment): Force pointers to proper mode if + POINTERS_EXTEND_UNSIGNED is defined. + + * xm-alpha.h (alloca.h): Add Interix to list of special machines + that don't like alloca.h, pending using autoconf results. + + * except.c (start_catch_hadler): Be sure rtime_address is Pmode + if POINTERS_EXTEND_UNSIGNED. + + * except.c (expand_eh_return): Force pointers to proper mode if + POINTERS_EXTEND_UNSIGNED. + +Thu Apr 15 23:13:35 1999 Michael Hayes + + * config/c4x/c4x.h: Tweaked comment formatting. + * config/c4x/c4x.c: Likewise. + +Thu Apr 15 02:45:19 1999 Mumit Khan + + * aclocal.m4 (GCC_FUNC_MKDIR_TAKES_ONE_ARG): Define. + * configure.in: Use. + * configure: Rebuilt. + * acconfig.h (MKDIR_TAKES_ONE_ARG): Add. + * config.in: Rebuilt. + * system.h: Use. + +Thu Apr 15 01:03:21 1999 Jan Hubicka + Jeff Law + + * i386.md (QImode add pattern): Support lea instruction. + (HImode add pattern): Likewise. + + * i386.md (ashlsi patterns): Call output_ashl instead of output_ashlsi3. + (ashlqi): Use expander, separate LEA and SAL / ADD patterns; call + output_ashl. + (ashlhi): Likewise. + * i386.h (output_ashl): Renamed from output_ashlsi3. + * i386.c (output_ashl): Likewise; support HImode and QImode operands + as well. + + * i386.md (notsi, nothi, xorsi, xorhi, and xorqi patterns): Call + memory_address_displacement_length instead of memory_address_length. + * i386.c (memory_address_info): Renamed from memory_address_length. + Accept new argument DISP_LENGTH. All callers changed. If DISP_LENGTH, + then return the displacement length. Else return length of the + entire memory address. Handle MULT case correctly. + * i386.h (memory_address_info): Update declaration. + + * i386.md (memory_bit_test): Fix paren error. + +Wed Apr 14 21:29:18 1999 Andrew Haley + + * flow.c: (make_edges): Always make edges from a basic block + to its exception handlers, even if the block ends with a jump. + +1999-04-14 23:26 -0400 Zack Weinberg + + * graph.c (node_data): Return void. Ignore result of + print_rtl_single. Change caller to match. + * integrate.c (subst_constants): Initialize op0_mode to an + invalid mode, and abort before use if it's still invalid. + (Can only happen if the RTX_CLASS, RTX_FORMAT tables are corrupted.) + * objc/objc-act.c (get_objc_string_decl, + build_selector_translation_table, generate_protocol_list, + synth_id_with_class_suffix, build_keyword_selector, + build_selector_expr, gen_declarator): Abort when the tree + structure is corrupted. + +Wed Apr 14 19:57:49 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (alpha interix): Use symbolic names to set + target_cpu_default. + * configure: Rebuilt. + + * explow.c (allocate_dynamic_stack_space): Undo last change. Use + convert_memory_address instead. + +Wed Apr 14 19:42:02 1999 Donn Terry (donn@interix.com) + + * alpha/lib1funcs.asm: New file. + * alpha/t-interix (lib1funcs.asm): Add to build. + + * explow.c (allocate_dynamic_stack_space): Correctly convert TARGET + to Pmode. + +Wed Apr 14 14:26:36 1999 John Wehle (john@feith.com) + + * i386.md (truncxfdf): Output the template supplied + by output_move_double with the correct operands. + + * i386.md (extendsfdf, extendsfxf, extenddfxf): Use + output_float_extend instead specifying '#' as the template. + * i386.c (output_float_extend): Define. + * i386.h (output_float_extend): Declare. + +Wed Apr 14 10:48:03 1999 Catherine Moore + + * config/mips/elf.h, config/mips/elf64.h + (CTORS_SECTION_ASM_OP): Define. + (DTORS_SECTION_ASM_OP): Define. + (EXTRA_SECTIONS): Define. + (INVOKE__main): Define. + (NAME__MAIN): Define. + (SYMBOL__MAIN): Define. + (EXTRA_SECTIONS_FUNCTIONS): Define. + (SECTION_FUNCTION_TEMPLATE): Define. + (ASM_OUTPUT_CONSTRUCTOR): Define. + (ASM_OUTPUT_DESTRUCTOR): Define. + (CTOR_LIST_BEGIN): Define. + (CTOR_LIST_END): Define. + (DTOR_LIST_BEGIN): Define. + (DTOR_LIST_END): Define. + (LIB_SPEC): Define. + (STARTFILE_SPEC): Define. + (ENDFILE_SPEC): Define. + * config/mips/linux.h: Undefine all of the above. + * config/mips/rtems64.h: Likewise. + * config/mips/t-r3900: Likewise. + * config/mips/t-elf: New file. + * config/mips/vxworks.h: New file. + * configure.in (mips-wrs-vxworks): Use mips/vxworks.h. + (mips*-*-*elf*): Use t-elf instead of t-ecoff. + * configure: Regenerate. + +Wed Apr 14 09:59:38 1999 Richard Henderson + + * reload1.c (emit_reload_insns): Also find equivalent mems + for subregs of pseudos. + + * alpha.c (aligned_memory_operand): Recognize the output of + LEGITIMIZE_RELOAD_ADDRESS. Examine reg_equiv_memory_loc in + the event of a pseudo. + (unaligned_memory_operand): Likewise. Don't otherwise accept + completely illegal addresses. + (normal_memory_operand): Likewise. Handle subregs of pseudos. + (get_aligned_mem): Revert previous change. Abort if we don't have a + mem. During reload, call find_replacement on all illegal memories. + (get_unaligned_address): Likewise. + * alpha.h (SECONDARY_INPUT_RELOAD_CLASS): Use !aligned_memory_operand + instead of unaligned_memory_operand. + * alpha.md: Revert extra argument to get_aligned_mem. + (reload_inqi): Use any_memory_operand in constraints. Abort if + we're not given some sort of mem. + (reload_inhi): Likewise. + (reload_outqi, reload_outhi): Likewise. + +Wed Apr 14 09:39:20 1999 Richard Henderson + + * i386.md (neghi): Use the whole register when widening the op. + +1999-04-14 12:37 -0400 Zack Weinberg + + * cpperror.c, cppexp.c, cpplib.c: Never call abort. + * cpphash.c: Only call abort when we detect corruption of the + malloc arena. + * cppmain.c: Don't define fatal or fancy_abort. + +Wed Apr 14 09:19:39 1999 Jan Hubicka + + * i386.c (x86_adjust_cost): Agi stall takes 1 cycle on Pentium, fst + requires value to be ready one extra cycle. + +Wed Apr 14 11:28:34 1999 Dave Brolley + + * config/i386/i386.c (memory_address_length): Add missing parenthesis. + +Wed Apr 14 13:59:27 1999 Martin von Loewis + + * extend.texi (Deprecated Features): New node. + * invoke.texi (-Wdeprecated): Document. + +Wed Apr 14 00:18:22 1999 Jan Hubicka + + * i386.md (SImode logical compare): Avoid outputting non-pariable testw + and testl on Pentium. + (register and memory bit tests): Likewise. + (setcc, normal and reversed conditional branches): Use shorter + sequence for testing flags stored in EAX. + + * i386.md (xorsi3): Do not output NOT instrctions on Pentium. + (xorqi3): Likewise. + (xorhi3): Likewise. + (notsi2): Likewise. + (notqi2): Likewise. + (nothi2): Likewise; do not output prefixed opcodes when possible. + + * i386.md (neghi2): Do not output prefixed opcode when possible. + (ashlhi3): Likewise. + +Wed Apr 14 00:08:46 1999 Richard Henderson + + * i386.c (memory_address_length): New function. + * i386.h (memory_address_length): Declare it. + +Tue Apr 13 22:52:04 1999 Donn Terry (donn@interix.com) + Martin Heller (Ing.-Buero_Heller@t-online.de) + + * configure.in (interix Alpha): Add. + (winnt Alpha): Use alpha32.h + (interix i386): Parallel Alpha32. + * configure: Rebuilt. + + * config/interix.h: Move common elements from i386-interix.h. + * config/i386/i386-interix.h: Delete same. + * config/alpha/alpha-interix.h: New file. + + * config/alpha/alpha32.h: New file, part fron win-nt.h. + * config/alpha/win-nt.h: Deletions (-> alpha32.h). + * config/alpha/interix.h: New file + + * config/alpha/alpha.md (interix): Comment. + + * config/alpha/xm-alpha-interix.h: New file. + + * config/alpha/t-interix: New file. + + * fixinc/mkfixinc.sh (interix/Alpha): Add. + +1999-04-13 Mike Stump + + * i386/vxi386.h (CPP_CPU_SPEC): Define appropriately for vxworks. + (CPP_PREDEFINES, LIB_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): likewise. + +Tue Apr 13 21:01:36 1999 Jason Merrill + + * c-common.c (default_valid_lang_attribute): New fn. + (valid_lang_attribute): New callback ptr. + (decl_attributes): Call it. Move init_priority support into + C++ frontend. + +Tue Apr 13 17:47:14 1999 John Wehle (john@feith.com) + + * i386.md (movdi): Add splitter. + +Wed Apr 14 10:04:27 1999 Michael Hayes + + * config/c4x/c4x.md (storeqf_int, storeqf_int_clobber, loadqf_int, + loadqf_int_clobber): Add new patterns with corresponding splitters + to handle moves of floating point values into and out of intager + registers by using memory. + + * config/c4x/c4x.c (c4x_check_legit_addr): Disallow PRE_INC for modes + other than QFmode and QImode. + (mixed_subreg_operand): New function. + (c4x_emit_move_sequence): If moving a floating point value into or + out of an integer register, use the new patterns storeqf_int_clobber + or loadqf_int_clobber. + (reg_imm_operand, *_reg_operand): Call reg_operand instead of + register_operand. + (reg_operand, src_operand): Disallow operand if it satisifes + mixed_subreg_operand. + + * config/c4x/c4x.h (mixed_subreg_operand): Add prototype. + +Tue Apr 13 14:49:13 1999 Jan Hubicka + + * i386.c (agi_dependent): Handle push operation more correctly. + +Tue Apr 13 14:45:17 1999 Jan Hubicka + + * i386.md (anddi3): Add % constraint. + (iordi3, xordi3): Likewise. + +Tue Apr 13 14:29:58 1999 Jan Hubicka + + * i386.md (extendhisi2): Output mov instead of cw instruction for K6 + to improve decoding bandwidth. + * i386.md (extendhiqi2): Likewise. + +Tue Apr 13 14:26:31 1999 Jan Hubicka + + * i386.md (movsf_push): Handle memory to memory case too, new splitter. + (movdf_push, movxf_push): Likewise. + (movsf_push_memory, movdf_push_memory, movxf_push_memory): Remove. + +Tue Apr 13 14:14:06 1999 Jan Hubicka + + * i386.md: Do not output mov %0,reg on AMD K6. + +Tue Apr 13 12:14:07 1999 Dave Brolley + + * cppinit.c (cpp_start_read): Fix buffer overwrite. + * Makefile.in (cppinit.o): Typo in dependencies. + +Tue Apr 13 05:04:59 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (function prototypes for arm.c): Ifdef these out if + HAVE_CONFIG_H is not defined. + +Tue Apr 13 02:11:11 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c: Avoid Using immediate zero for register zero. + * pa.md: Likewise. + + * pa.c (print_operand, case 'f'): New case for FP register or 0.0. + (print_operand, case 'r'): Use %r0 for zero value. + * pa.md (move patterns, fcmp patterns): Use new %f output arg. + + * pa.c: Use a register name, not a raw immediate in branch, + compare/clear, sub, subb, uaddcm and vshd instructions. + * pa.md: Likewise. + + * pa.md, pa.h, ee.asm, ee_fp.asm, lib2funcs.asm: Likewise. + + * pa.c: Use a register name, not a raw immediate in "bv" instructions. + * pa.md, pa.h, ee.asm, ee_fp.asm, lib2funcs.asm: Likewise. + + * pa.c: Remove space register specification in memory addresses, + except where it is actually needed. + * pa.md, pa.h, ee.asm, ee_fp.asm, lib2funcs.asm: Likewise. + +Mon Apr 12 23:34:35 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Apr 12 14:58:30 1999 Jan Hubicka + + * reg-stack.c (check_stack_regs_mentioned): Remove variable SIZE. + +Mon Apr 12 19:15:17 1999 Daniel Jacobowitz + + * rs6000/sysv4.h (CPP_OS_LINUX_SPEC): Add missing backslash. + +Mon Apr 12 19:11:38 1999 Mumit Khan + + * i386/cygwin.h (SUBTARGET_SWITCHES): Add -mconsole; fix + -mno-nop-fun-dllimport and minor doc fixes. + (STARTFILE_SPEC): Cygwin DLLs don't have dllcrt0. + (LINK_SPEC): Add -mconsole support. + * i386/mingw32.h (LIB_SPEC): Make libraries consistent with + Cygwin. + (LINK_SPEC): Remove. Use Cygwin's version. + (MATH_LIBRARY): Make it null. + * i386/crtdll.h (MATH_LIBRARY): Likewise. + +Fri Apr 12 15:00:52 1999 Stan Cox + + * c-decl.c (c_decode_option, start_decl, start_function, + finish_function) : Recognize -Wno-main so we can avoid warnings. + +1999-04-12 Zack Weinberg + + * cpphash.c (collect_expansion, macroexpand, + push_macro_expansion): Make the escape character in macro + buffers '\r', not '@'. Remove code to protect literal + occurrences of the escape character; '\r' cannot appear + in a macro buffer unless we put it there. + * cpplib.c (skip_comment, copy_comment, cpp_skip_hspace, + copy_rest_of_line, cpp_get_token, parse_string, + parse_assertion): '\r' might be a backslash-newline marker, or + it might be a macro escape marker, depending on + CPP_BUFFER (pfile)->has_escapes. '@' is not a special + character. + * cpplib.h: Update commentary. + +Mon Apr 12 09:30:03 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (target_fp_name, structure_size_string, arm_cpu_select): + Const-ify. + * arm.c (target_fp_name, structure_size_string): Const-ify. + + * arm.md (reload_inhi, reload_outhi): Make the scratch DImode. + * arm.c (arm_reload_in_hi): Handle cases when the input is still + a pseudo, make use of scratch registers for reloading the address + as appropriate. + (arm_reload_outhi): Similarly for when the output is still a pseudo. + + * riscix.h (SUBTARGET_SWITCHES): Document. + +1999-04-12 Bruce Korb + + * fixincludes: + make fixincludes behave like the scripts in fixinc/ + + * Makefile.in( stmp-fixinc ): + ensure the SHELL value is that of the make + + * fixincl/inclhack.tpl: + the file name lists ought to be restricted to "*.h" anyway + C++ files may be named .../[a-z]++/... also + Adding copyright year and attribution to output + + * fixincl/inclhack.def: + fixed broken expression + Clarify a some comments + + * fixincl/fixincl.tpl: + Clarify a some comments + Remove dead template text + Correct the counting of regular expressions + +Mon Apr 12 03:07:44 1999 Richard Henderson + + * alpha.c (aligned_memory_operand): Handle out of range stack slots. + Take a new SCRATCH argument for the occasion. Update all callers. + (get_unaligned_address): Abort on out of range stack slots. + * alpha.md (adddi3 splitter): Check s_p_rtx not REGNO. + (reload_inqi): Check for aligned mems before unaligned. + (reload_inhi): Likewise. + +Mon Apr 12 03:11:30 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (flow_delete_insn): If we delete a CODE_LABEL, also remove + it from the nonlocal_goto_handler_labels list. + * jump.c (delete_insn): Likewise. + (jump_optimize_1): Also recompute LABEL_NUSES when we are just + marking labels. + * rtl.h (remove_node_from_expr_list): Declare. + * rtlanal.c (remove_node_from_expr_list): New function. + +Mon Apr 12 02:37:02 1999 Jan Hubicka + + * reg-stack.c: Update comment, include varray.h. + (stack_regs_mentioned_data): New global variable. + (check_stack_regs_mentioned): New function. + (stack_regs_mentioned): New function. + (reg_to_stack): Initialize and free stack_regs_mentioned_data, + use stack_regs_mentioned. + (record_asm_reg_life): Change insn type cache for changed insn. + (record_reg_life): Do not change the insn mode. + (emit_pop_insn): Likewise. + (emit_swap_insn): Likewise. + (move_for_stack_reg): Likewise. + (stack_reg_life_analysis): Use stack_regs_mentioned. + (emit_swap_insn): Likewise. + (subst_stack_regs): Likewise. + (convert_regs): Likewise. + * jump.c (find_cross_jump): Use stack_regs_mentioned. + * rtl.h (stack_regs_mentioned): Declare. + +Mon Apr 12 00:57:10 1999 Theodore Papadopoulo + + * integrate.c (INTEGRATE_THRESHOLD): Sync it with the comment. + +Sun Apr 11 10:24:18 1999 Mark Mitchell + + * rtl.h (rtx_def): Update documentation for jump and call. + +Sun Apr 11 07:43:44 1999 Kaveh R. Ghazi + + * jump.c (jump_optimize_1): Make the definition static to match + the prototype. + +Sat Apr 10 22:51:53 1999 Jan Hubicka + + * flow.c (life_analysis): New parameter remove_dead_code. + (life_analysis_1): Likewise. + (propagate_block): Likewise; use it. + * output.h: Update prototype. + * toplev.c: Update calls to life_analysis. + +Sat Apr 10 22:12:12 1999 Jan Hubicka + + * recog.c (constrain_operands): Ignore unary operators when + matching operands. Recognize '5'..'9' as well. + +Sat Apr 10 21:53:02 1999 Philipp Thomas (kthomas@gwdg.de) + Richard Henderson + + * configure.in: Set target_cpu_default2 for target_alias k6. + * i386.h (TARGET_SWITCHES): Remove no- entries. + (CC1_CPU_SPEC): Likewise. + (CPP_CPU_DEFAULT_SPEC): Streamline definition. Add K6 version. + (CPP_K6_SPEC): New. + (CPP_CPU_SPEC): Add K6 variant. + (EXTRA_SPECS): Likewise. + +Fri Apr 9 11:29:17 1999 Richard Henderson + + * flow.c (merge_blocks_nomove): Rewrite to properly handle two + blocks that vanish entirely during merging. + +Sat Apr 10 20:09:55 1999 John Wehle (john@feith.com) + + * i386.md (floatsisf2, floatdisf2, floatsidf2, floatdidf2, + floatsixf2, floatdixf2, movsicc, movhicc, movsfcc, movdfcc, + movxfcc, movdicc): Remove unused register constraints from + the splitters. + + * i386.md (fixuns_truncsfsi2, fixuns_truncdfsi2, + fixuns_truncxfsi2): Delete. + + * reg-stack.c (delete_insn_for_stacker): Ensure that + the only side effects of a PARALLEL are clobbers. + (subst_stack_regs): Handle subst_stack_regs_pat deleting + a PARALLEL. + * i386.md (extendsfdf2, extenddfxf2, + extendsfxf2): Rewrite using a splitter. + * i386.c (output_op_from_reg): Remove. + * i386.h: Likewise. + +Sat Apr 10 13:09:18 1999 Nick Clifton + + * config/arm/arm.c (di_operand): Allow SUBREGs as well. + (soft_df_operand): Allow SUBREGs as well. + +Sat Apr 10 06:14:31 1999 Jan Hubicka + + * extend.texi (Assembler Instructions with C Expression Operands): + Document the i386 floating point operands. + +1999-04-10 Mike Stump + + * configure.in (*-*-vxworks): Add vxWorks thread support for all + vxWorks targets. + * configure.in (thumb-wrs-xvworks): Add vxWorks support for thumb. + * configure: Rebuilt. + +Sat Apr 10 06:04:50 1999 Donn Terry (donn@interix.com) + + * i386/t-interix: Use mostly system headers unchanged. + Use system assert.h + * fixinc/fixinc.interix: Ditto (make almost no-op). + * config/x-interix.h (_ALL_SOURCE): add -D + * config/x-interix.h (crti.o): Delete dependency. + * config/xm-interix.h (ONLY_INT_FIELDS): Define only when bootstrapping. + * i386/xm-i386-interix.h: New file. + * i386/interix.h (ASM_OUTPUT_LIMITED_STRING): Fix warnings. + * i386/i386-interix.h: Renamed from interix.h. + * configure.in (interix): Use new files. + * configure: Rebuilt. + +Sat Apr 10 05:25:28 1999 Daniel Jacobowitz + + * rs6000/sysv4.h (CPP_OS_LINUX_SPEC): Fix conditions + for -Dunix and -Dlinux, and remove duplicate definition. + Change -Asystem(linux) to -Asystem(posix). + (CPP_OS_SOLARIS_SPEC): Fix conditions for -Dunix, -Dsun, + -DSVR4, -D__EXTENSIONS__. + + * rs6000/linux.h (CPP_PREDEFINES): Remove -Dunix, + -Dlinux, -Asystem(linux), and -Asystem(unix). + +Sat Apr 10 05:14:50 1999 Mark Elbrecht + + * i386/djgpp.h (SET_ASM_OP): Define. + + * cccp.c (DIR_SEPARATOR): Move to the top of the file. + (is_dir_separator): New function. + (simplify_filename): Use it. + * collect2.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM in place + of the DIR_SEPARATOR test. + Consider any file starting with a drivename to be absolute. + If the absolute filename test fails and EXECUTABLE_SUFFIX is + defined, append EXECUTABLE_SUFFIX to the file and try again. + * cppinit.c (base_name): Use HAVE_DOS_BASED_FILE_SYSTEM + in place of __MSDOS__ and _WIN32. + * cppfiles.c (simplify_pathname): Likewise. + * gcc.c (IS_DIR_SEPARATOR): Define new macro. Returns true if a + character is a directory separator. + (find_a_file): Use it. + (convert_filename): Likewise. + (process_command): Likewise. + (do_spec_1): Likewise. + (is_directory): Likewise. + (main): Likewise. + * prefix.c (IS_DIR_SEPARATOR): Define. Tests whether a character is + a directory separator. + (translate_name): Use it. + (update_path): Change DIR_SEPARATOR_2 to DIR_SEPARATOR. Fix + warning in block where '/' is changed to DIR_SEPARATOR. + * i386/xm-djgpp.h (DIR_SEPARATOR): Set to '/'. + (DIR_SEPARATOR_2): New macro. Set to '\'. + (HAVE_DOS_BASED_FILESYS): Define. + * i386/xm-mingw32.h: Updated copyright. Set + DIR_SEPARATOR_2 to '/'. Define HAVE_DOS_BASED_FILE_SYSTEM. + * i386/xm-os2.h: Likewise. + * winnt/xm-winnt.h: Likewise. + * i386/xm-dos.h: Likewise. Add copyright. + +1999-04-10 Joseph S. Myers + + * pdp11.h (TARGET_SWITCHES): Add option to vary assembler syntax. + (TARGET_DEFAULT): Possibly use UNIX syntax. + (TARGET_UNIX_ASM, TARGET_UNIX_ASM_DEFAULT): New macros. + (REGISTER_NAMES): Use "r5" instead of "fp". + (ASM_OUTPUT_ALIGN): Use ".even" directive, and abort for any + greater alignment. + * 2bsd.h (TARGET_UNIX_ASM_DEFAULT): Default to UNIX assembler + syntax for 2BSD. + * pdp11.c (output_ascii): Use working syntax for ".byte". + (print_operand_address): Use "*" instead of "@" when using UNIX + assembler syntax. + +Sat Apr 10 03:50:12 1999 Jeffrey A Law (law@cygnus.com) + + * rtl.h (rebuild_jump_labels): Declare. + * jump.c (jump_optimize_1): Renamed from jump_optimize. Make static. + Add new argument MARK_LABELS_ONLY. Quit after mark_all_labels if + requested. + (jump_optimize, rebuild_jump_labels): New wrapper functions for + jump_optimize_1. + * toplev.c (rest_of_compilation): Use rebuild_jump_labels instead of + running the entire jump optimizer. + + * rtl.h (local_alloc): Returns an integer now. + * local-alloc.c (recorded_label_ref): New file scoped variable. + (local_alloc): Initialize recorded_label_ref to zero. Return its + value when local allocation has completed. + (update_equiv_regs); If we create an equivalence for a LABEL_REF, + set recorded_label_ref. + * toplev.c (rest_of_compilation): Run the jump optimizer after + register allocation and reloading if needed. + +Fri Apr 9 21:02:57 1999 Krister Walfridsson (cato@df.lth.se) + + * i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Fix typo. + * i386/freebsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise. + +1999-04-09 Zack Weinberg + + * cpphash.c (special_symbol): When expanding __LINE__, use the + top file buffer, not the top buffer. + +Fri Apr 9 13:41:04 1999 Jim Wilson + + * Makefile.in (check-g++, check-gcc, check-g77, check-objc): Add + cd .. to TCL_LIBRARY command. + +Fri Apr 9 13:04:52 1999 Nick Clifton + + * config/arm/unknown-elf.h (SUBTARGET_CPU_DEFAULT): Only define if + not already specified. + +Fri Apr 9 11:18:55 1999 Jason Merrill + + * c-common.c (decl_attributes, A_INIT_PRIORITY): Allow arrays + of classes, too. + +Fri Apr 9 10:40:10 1999 Kaveh R. Ghazi + + * rs6000.c (rs6000_override_options, ptt, rs6000_file_start, + rs6000_float_const, rs6000_replace_regno, debug_stack_info, + rs6000_output_load_toc_table, output_prolog, output_epilog): + Const-ify a char*. + (output_mi_thunk): Likewise. Mark parameter `thunk_fndecl' with + ATTRIBUTE_UNUSED. Hide unused variables `r0', `sp', `toc', + `schain', `r12', `buf' and `labelno'. + (output_ascii): Const-ify a char*. + (rs6000_gen_section_name): Initialize variable `last_period'. + (rs6000_adjust_priority): Mark parameter `insn' with + ATTRIBUTE_UNUSED. + (rs6000_trampoline_template, rs6000_dll_import_ref, + rs6000_longcall_ref, rs6000_encode_section_info): Const-ify a char*. + + * rs6000.h (offsettable_mem_operand, optimization_options): Add + prototypes. + + * rs6000.md (movdi, define_split): Cast a value to HOST_WIDE_INT + when comparing against one. + +Thu Apr 8 19:20:18 1999 Jeffrey A Law (law@cygnus.com) + + * expr.c (expand_expr, case ARRAY_REF, COMPONENT_REF, BIT_FIELD_REF): + Do not try to optimize an aggregate address which has VOIDmode. + Mirrors March 23 change to expand_assignment. + + * flow.c (delete_unreachable_blocks): Do not require EDGE_FALLTHRU + for an edge when tidying an edge which connects consecutive basic + blocks. + + * flow.c (can_delete_label_p): Do not convert a label into a + deleted label here. + + * cse.c (flush_hash_table): New function. + (cse_insn): Flush the hash table when we encounter a volatile asm. + (cse_basic_block): Use flush_hash_table instead of doing it + inline. + + * reload1.c (reload_cse_regs_1): Flush known register values if + we encounter a volatile asm. + + * loop.c (strength_reduce): Re-enable Joern's loop improvements. + +Thu Apr 8 09:37:40 1999 Nick Clifton + + * config/arm/arm.c (arm_print_operand): Undo previous change - + always print large constants in decimal. + +Thu Apr 8 10:22:23 1999 Kaveh R. Ghazi + + * configure.in (host_xm_file, build_xm_file): Include hwint.h. + Use case statements instead of "if test -a ... -a ... -a ..." + + * machmode.h: Don't define HOST_WIDE_INT, etc. Wrap use of + HOST_WIDE_INT in #ifdef. + + * mips.h: Include hwint.h instead of providing definitions for + HOST_WIDE_INT, etc. Wrap uses of HOST_WIDE_INT in #ifdef. + +Thu Apr 8 06:16:14 1999 John Wehle (john@feith.com) + + * i386.md (truncdfsf2, truncxfsf2, + truncxfdf2): Rewrite using a splitter. + +Thu Apr 8 01:26:05 1999 Arg Haas (ahaas@neosoft.com) + Jeffrey A Law (law@cygnus.com) + + * freebsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Avoid ambiguous + else statement. + * gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise. + * linux.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise. + * openbsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise. + +Wed Apr 7 22:40:19 1999 Jim Wilson + + * i960/i960.c (i960_function_prologue): Don't save static chain + pointer. + * i960/i960.h (STACK_CHAIN_REGNUM): Change from r3 to g12. + (TRAMPOLINE_TEMPLATE): Likewise. + (FRAME_POINTER_REQUIRED): Check current_function_has_nonlocal_goto. + * i960/i960.md (nonlocal_goto): Rewrite. + +Tue Apr 6 17:49:49 1999 Philip Blundell + + * config/arm/lib1funcs.asm: Test for __ELF__ not __elf__. + +Wed Apr 7 14:07:34 1999 Jeffrey A Law (law@cygnus.com) + + * h8300.c (h8300_adjust_insn_length): Also avoid recognizing + ADDR_VEC and ADDR_DIFF_VEC insns. + + * h8300.c (h8300_adjust_insn_length): Avoid trying to recognize + USE, CLOBBER or SEQUENCE insns. + + * unroll.c (unroll_loop): For HAVE_cc0 machines, adjust copy_end_luid + to account for the uncopied insn that sets cc0 at the end of the loop. + + * unroll.c (copy_loop_body): Always ensure at least two insns + are in the copied loop. + +Wed Apr 7 14:52:18 1999 Catherine Moore + + * config/mips/elf.h (MAKE_DECL_ONE_ONLY): Define. + (UNIQUE_SECTION_P): Define. + +1999-04-07 Bruce Korb + + * fixinc/inclhack.tpl & fixincl.tpl: + Remove dynamic content from generated files + +Wed Apr 7 13:16:22 1999 John Wehle (john@feith.com) + + * i386.c (output_move_memory): Remove. + * i386.h: Likewise. + + * i386.md (movsi, movhi, movstricthi, movqi, movstrictqi, + movsf, movdf, movxf, movdi): Check no_new_pseudos instead + of (reload_in_progress | reload_completed). + +Wed Apr 7 03:16:45 1999 Richard Henderson + + * alpha.c (reg_no_subreg_operand): New function. + * alpha.h (PREDICATE_CODES): Add it. + * alpha.md (floatdi?f patterns): Use it for op1. + + * alpha.c (alpha_end_function): Don't flag weak functions. + +Wed Apr 7 02:11:55 1999 Richard Henderson + + * expr.c (expand_builtin) [BUILT_IN_RETURN_ADDRESS]: Use + copy_to_mode_reg; don't force constants into a register. + +Tue Apr 6 22:55:25 1999 Richard Henderson + + * toplev.c (compile_file): Typo flow_dump -> flow2_dump. + +1999-04-06 Joseph S. Myers + + * pdp11.c (simple_memory_operand): Add default case in switch. + * pdp11.h (TARGET_SWITCHES): Add help strings. + (NOTICE_UPDATE_CC): Don't include excess argument to format. + (ASM_OUTPUT_DOUBLE_INT): Remove. + +Tue Apr 6 22:09:40 1999 Richard Henderson + + * expr.c (expand_builtin_setjmp): Put setjmp return label on + nonlocal_goto_handler_labels for flow. + +Tue Apr 6 22:05:21 1999 Jan Hubicka + Richard Henderson + + * flow.c (verify_flow_info): New function. + (find_basic_blocks): Call it if ENABLE_CHECKING. + (merge_blocks): Don't merge if there are non-deletable labels. + * toplev.c (fatal_insn): Allow a printf-style arg list. + * toplev.h (fatal_insn): Update prototype. + +Tue Apr 6 16:18:58 1999 Jan Hubicka + + * flow.c (split_edge) update correctly flow graph, disable + EDGE_CRITICAL flag on the split edge, update NUSES for new label. + +Tue Apr 6 15:47:51 1999 Richard Henderson + + * emit-rtl.c (gen_rtx_CONST_DOUBLE): Use XWINT not XINT. + Clear third and following slots, if they exist. + +Tue Apr 6 15:45:28 1999 Richard Henderson + + * flow.c (create_basic_block): Make sure the bb note is in the block. + (can_delete_note_p): Rename from delete_note_p. + (delete_insn_chain): Preserve undeleteable labels too. + (tidy_fallthru_edge): Use next_real_insn instead of confusing + inline code. + +1999-04-06 Zack Weinberg + + * cppexp.c (parse_charconst): Initialize c. + (cpp_parse_expr): Initialize rprio. + * cppfiles.c (merge_include_chains): Initialize prev. + (finclude): Set fp->line_base to fp->buf before returning. + * cpphash.c (macroexpand): Initialize token. + * cppspec.c (lang_specific_driver): Change suff to + const char *const *. + +1999-04-06 Zack Weinberg + + * cppinit.c (install_predefs): Delete function. + (cpp_start_read): Don't call install_predefs. + (cpp_handle_option): Remove case 'u' and all refs to + opts->inhibit_predefs. + (print_help): Don't mention -undef. + (initialize_builtins): Define __HAVE_BUILTIN_SETJMP__, to + match cccp. + * cpplib.h (struct cpp_options): Remove inhibit_predefs + member. + + * cccp.c (predefs): Delete variable. + (main): Remove case 'u' in argument parse loop, + 'inhibit_predefs' variable, and the code block that would + process CPP_PREDEFINES. + (initialize_builtins): Don't define __OBJC__, the driver will + do that. + + * gcc.c (default_compilers): Remove -undef from all specs that + invoke a C preprocessor. + * ch/lang-specs.h: Likewise. + * cp/lang-specs.h: Likewise. + * f/lang-specs.h: Likewise. + * objc/lang-specs.h: Likewise. + +Mon Apr 5 11:55:31 1999 Donn Terry (donn@interix.com) + + * Makefile.in (SUBDIR_FLAGS_TO_PASS): Fix misapplied patch. + +Mon Apr 5 11:51:38 1999 Jeffrey A Law (law@cygnus.com) + + * m68k.md (movdf): Hide GPR sources & destinations from regclass. + +Mon Apr 5 09:54:42 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Apr 5 05:55:15 1999 Bruce Korb + + * fixincl.tpl: Separate "-e" from its argument, a la + the Sat Apr 3 17:05:13 1999 fix. + * genfixes: Ensure that the server shell is _NOT_ csh. + +Mon Apr 5 03:52:30 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Mon Apr 5 04:47:14 1999 Jeffrey A Law (law@cygnus.com) + + * i386.c (x86_double_with_add): Turn off for Pentium and PPro. + (small_shift_operand, output_ashlsi3): New functions. + * i386.h (small_shift_operand, output_ashlsi3): Declare. + * i386.md (ashlsi3): Simplify ahlsi3 patterns. Remove splitters + that are no longer needed. + +Sun Apr 4 04:05:04 1999 Jeffrey A Law (law@cygnus.com) + + * stmt.c (expand_loop_end): When copying the loop exit test, + do not walk into a nested loop. + +Sun Apr 4 00:14:54 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/hackshell.tpl: Skip links to directories, to avoid + removing them. + * fixinc/inclhack.tpl: Likewise. + * fixinc/fixinc.sh, fixinc/fixincl.x, fixinc/inclhack.sh: Rebuilt. + +Sat Apr 3 23:46:13 1999 David Edelsohn + + * rs6000.md (addsi3, iorsi3, xorsi3, adddi3, iordi3, xordi3, + movsi_got, movsi, movsf): Use no_new_pseudos. + * rs6000.c (rs6000_got_register): Likewise. + (offsettable_mem_opereand): Use || not |. + +Sat Apr 3 22:02:56 1999 Jeffrey A Law (law@cygnus.com) + + * acconfig.h (ENABLE_CHECKING): Remove redundant #undef. + * config.in: Rebuilt. + +Sat Apr 3 16:22:59 1999 Toshiyasu Morita (tm@netcom.com) + + * gcc.texi: Add info on regmove pass. + + * regmove.c (fixup_match_1): Consistently evaluate + HAVE_POST_INCREMENT and HAVE_POST_DECREMENT. + +Sat Apr 3 19:21:05 1999 Alexandre Oliva + + * configure.in (DEFAULT_LINKER, DEFAULT_ASSEMBLER): Use grep + instead of test and sed to check whether they're GNU programs. + * configure: Rebuilt. + +Sat Apr 3 17:57:35 1999 Alexandre Oliva + + * Makefile.in (install-headers-tar, install-headers-cpio): Avoid + problems with CDPATH. + Reported by Ralf Canis + +Sat Apr 3 13:50:16 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc.x86-linux-gnu: Deleted. + +Sat Apr 3 17:05:13 1999 Alexandre Oliva + + * inclhack.tpl: Insert spaces between `sed -e' and '...'. + Reported by Kaveh R. Ghazi + * fixinc/fixincl.sh, fixinc/fixincl.x, fixinc/inclhack.sh: Regen. + +Sat Apr 3 14:54:46 1999 Craig Burley + + * tree.def (BLOCK): Fix typo in comment. + +Sat Apr 3 00:53:29 1999 John Wehle (john@feith.com) + + * i386.md (floatsisf2, floatdisf2, floatsidf2, floatdidf2, + floatsixf2, floatdixf2): Rewrite using a splitter. + +Fri Apr 2 17:36:10 1999 Nick Clifton + + * config/arm/arm.c (arm_print_operand): Print large constants in + hex rather than decimal. + +Fri Apr 2 17:23:58 1999 Nick Clifton + + * print-rtl.c (print_rtx): Use both HOST_WIDE_INT_PRINT_DEC + and HOST_WIDE_INT_PRINT_HEX to display constants. + +1999-04-02 Zack Weinberg + + * config/i386/i386.h: Document all TARGET_SWITCHES or add + explicit null initializer. + + * config/i386/cygwin.h: Document all SUBTARGET_SWITCHES. + * config/i386/dgux.h: Likewise. + * config/i386/osf1elf.h: Likewise. + * config/i386/win32.h: Likewise. + * config/i386/osfrose.h: Likewise. Drop obsolete -mno-ident option. + +Fri Apr 2 17:49:44 1999 Toshiyasu Morita + + * regmove.c (fixup_match_1): Remove now useless if (0). + +Sat Apr 3 11:37:20 1999 Michael Hayes + + * tm.texi (USE_LOAD_POST_DECREMENT, USE_LOAD_PRE_DECREMENT, + USE_STORE_POST_DECREMENT, USE_STORE_PRE_DECREMENT): Document. + (USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_INCREMENT, + USE_STORE_POST_INCREMENT, USE_STORE_PRE_INCREMENT): Fix documentation. + + * rtl.h (USE_LOAD_POST_DECREMENT, USE_LOAD_PRE_DECREMENT, + USE_STORE_POST_DECREMENT, USE_STORE_PRE_DECREMENT, + USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_INCREMENT, + USE_STORE_POST_INCREMENT, USE_STORE_PRE_INCREMENT): Provide default + definition. + + * expr.c (USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_INCREMENT, + USE_STORE_POST_INCREMENT, USE_STORE_PRE_INCREMENT): Delete default + definition. + +Fri Apr 2 16:03:05 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc.dgux, fixinc.interix, fixinc.irix, fixinc.ptx: Deleted. + * fixinc.sco, fixinc.svr4, fixinc.winnt, fixinc.wrap: Likewise. + +Fri Apr 2 15:46:25 1999 Donn Terry (donn@interix.com) + + * configure.in: Set and substitute quoted_cc_set_by_configure. + * configure: Rebuilt. + * Makefile.in (SUBDIR_FLAGS_TO_PASS): Fix quoting problem with ``. + +Fri Apr 2 14:35:45 1999 Stan Cox + + * config/i386/cygwin.h (CPP_SPEC): Use mingw_include_path instead + of a hardcoded path for -mno-cygwin. + (mingw_include_path): New. + +1999-04-02 Joseph S. Myers + + * pdp11.c: Include "recog.h". + (output_function_prologue): Remove unused variables `nregs', `i', + `offset'. + (output_function_epilogue): Remove unused variables + `may_call_alloca', `nregs', `regno', `adjust_fp'. + (output_ascii): Mark as returning void. + (print_operand_address: Likewise. + (simple_memory_operand): Remove unused variables `plus0', `plus1', + `offset'. + * pdp11.h: Declare functions `arith_operand', + `const_immediate_operand', `expand_shift_operand', + `legitimate_address_p', `notice_update_cc_on_set', `output_ascii', + `output_function_epilogue', `output_function_prologue', + `print_operand_address', `register_move_cost', + `simple_memory_operand'. + (HARD_REGNO_MODE_OK): Parenthesize `REGNO' arg. + (REGNO_REG_CLASS): Likewise. + * pdp11.md: Add explicit `int' to `static count' (in two places). + (addhi3): Add explicit braces to avoid ambiguous else. + (addqi3): Likewise. + (ashlhi3): Likewise. + +Fri Apr 2 14:17:10 1999 Jerry James + + * gcc/invoke.texi: Add documentation for additional supported + MIPS CPU types, options -mips16 and -mentry, and ABI and ISA + defaults. + +Fri Apr 2 14:12:06 1999 John Wehle (john@feith.com) + + * i386.md: Delete floating point compare, add, subtract, + multiply, and divide patterns which allowed integer + operands. + * i386.c (output_387_binary_op): Delete unused code. + (output_float_compare): Likewise. + +Fri Apr 2 11:53:37 1999 John Wehle (john@feith.com) + + * i386.md (movsf+1, movdf+1, movxf+1): Update constraints + so that SECONDARY_MEMORY_RELOAD is used. Remove dead code. + +1999-04-02 Bruce Korb + + * fixinc/mkfixinc.sh: Added support for x86-interix. + * fixinc/fixinc.interix: Fixincludes script, slight changes + from ./fixinc.interix. Untested (needs interix box). + * fixinc/inclhack.def: + Complete the change to the 'fixinc.tmp' file. + Fixed regex for finding C++ headers. + * fixincl.x, fixincl.sh, inclhack.sh: Regenerate. + +Fri Apr 2 11:36:12 1999 Jan Hubicka (hubicka@paru.cas.cz) + + * i386.c (print_operand_address, case REG): Do not use ESI addressing + mode for the K6. + + * i386.c (print_operand_address, case MULT): Use more efficient + encoding (mult (reg) (const_int 2)). + +Thu Apr 1 17:01:50 1999 Richard Henderson + + Move over patch from Bernd Schmidt from GC branch: + * emit-rtl.c (gen_rtx_CONST_DOUBLE): New function. + (gen_rtx): Call it. Tidy cases. + * rtl.h (gen_rtx_CONST_DOUBLE): Prototype it. + * gengenrtl.c: Add commentary. + (special_rtx): Also match CONST_DOUBLE. + (gencode): Emit call to memset instead of bzero. + +Fri Apr 2 12:58:26 1999 Michael Hayes + + * config/c4x/c4x.md (ashlhi3, lshrhi3, ashrhi3): Force operand 1 + into a register if shift count not constant. + (ashlhi3_reg, lshrhi3_reg, ashrhi3_reg): Ensure that operand 1 + is a register. + +Fri Apr 2 12:19:17 1999 Michael Hayes + + * config/c4x/c4x.md (*db): Enable pattern if TARGET_LOOP_UNSIGNED + is nonzero. + (movstrqi_small, movstrqi_large, *cmpstrqi): Add + modifier to address + register constraints. + (*movhi_clobber+1): Modify splitter pattern to handle destination + register that is used in the source address. + (*xorhi3_clobber): Replace AND with XOR in call to legitimize_operands. + +Fri Apr 2 12:16:15 1999 Michael Hayes + + * config/c4x/c4x.h: Added more comments. + +Fri Apr 2 11:58:22 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_emit_move_sequence): Force invalid QImode + constants into memory if we get called directly from gen_move_insn + rather than emit_move_insn. + (c4x_legitimize_address): Fix up LABEL_REF addresses. + +Thu Apr 1 12:04:05 1999 Jim Wilson + + * expr.c (store_field): When check direct_store, assume all complex + modes can be directly stored. + +1999-04-01 Bruce Korb + + * fixinc/genfixes: New shell script that runs autogen + to create the generated files. + +1999-04-01 Manfred Hollstein + + * Makefile.in (cppmain$(exeext)): Depend on intl.o. Link in intl.o. + +Thu Apr 1 03:48:34 1999 H.J. Lu (hjl@gnu.org) + + * i386.c (output_fp_conditional_move): Abort for LT, LE, GE, and GT + signed integer comparisons. + + * i386.c (output_int_conditional_move): Use "enum rtx_code" for code + type. + + * i386.c (notice_update_cc): No need to check the INT mode for + conditional moves since FLOAT conditional moves don't affect cc0. + +Thu Apr 1 02:17:18 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/inclhack.def (zzz_ki_syscalls, zzz_time): Fix trigger + string to only match on hpux11. + * fixinc/fixincl.x, fixinc/inclhack.sh, fixinc/fixinc.sh: Rebuilt. + +Thu Apr 1 01:09:27 1999 Alexandre Oliva + + * fixinc/hackshell.tpl: Complete transition to fixinc.tmp. + * fixinc/inclhack.sh: Rebuilt. + + * fixinc/inclhack.def: Fix typos in c_asm.h fix. + * fixinc/fixincl.x, fixinc/inclhack.sh, fixinc/fixinc.sh: Rebuilt. + +Wed Mar 31 17:20:11 1999 Jeffrey A Law (law@cygnus.com) + + * toplev.c (rest_of_compilation): Allow dbr_schedule to write to + the dump file too. + +Wed Mar 31 12:32:43 1999 Richard Henderson + + * flow.c (find_basic_blocks): New argument `do_cleanup'. + Conditionally call delete_unreachable_blocks. + (free_basic_block_vars): Zero ENTRY/EXIT data. + (allocate_for_life_analysis): Kill. Split into... + (allocate_bb_life_data, allocate_reg_life_data): ... new functions. + (life_analysis_1): Update. + * gcse.c (gcse_main): Update find_basic_blocks call. + * toplev.c (rest_of_compilation): Likewise. + * stupid.c (stupid_life_analysis): Update life data calls. + * rtl.h, output.h: Update prototypes. + +Wed Mar 31 12:10:00 1999 Bruce Korb + + * inclhack.def (several): Added spaces in tests to ensure + correct shell syntax. Added c_asm.h fix from fixincludes. + Also corrected the corrected fix to C++ comments :-} + + * inclhack.tpl: Changed method of traversing symlink trees + so that file name matching will work correctly. + + * fixincl.c, hackshell.tpl: Fallout from above. + * fixincl.x, inclhack.sh, fixincl.sh: Rebuilt. + +Tue Mar 30 10:43:49 1999 Philip Blundell + + * config/arm/aout.h (DBX_DEBUGGING_INFO): Avoid redefinition if + dbxelf.h was previously included. + (CPP_APCS_PC_DEFAULT_SPEC): No need to undefine. + + * config/arm/linux-elf.h (FP_DEFAULT): Correctly override the + definition from arm.h. + +Wed Mar 31 10:33:37 1999 Kaveh R. Ghazi + + * Makefile.in (c-gperf.h): Generate using gperf language 'C', not + 'KR-C', so gperf uses the `const' keyword on strings. + + * c-parse.gperf (resword): Const-ify a char*. + +Wed Mar 31 01:49:31 1999 Ian Lance Taylor + + * t-rtems (LIMITS_H_TEST, LIBGCC2_INCLUDES): Define. + +Wed Mar 31 00:50:48 1999 Jeffrey A Law (law@cygnus.com) + + * system.h (STDERR_FILENO): Fix typo. + + * inclhack.def (bool): Also fix bogus bool in curses_colr/curses.h. + * fixincl.x, inclhack.sh, fixincl.sh: Rebuilt. + +Tue Mar 30 20:51:40 1999 Mark Mitchell + + * alias.c (alias_set_compare): Remove. + (record_alias_subset): Use splay_tree_compare_ints instead of + alias_set_compare. + (init_alias_once): Likewise. + * cse.c: Include splay-tree.h. + (reg_qty): Remove. + (reg_tick): Likewise. + (reg_table): Likewise. + (cse_reg_info): New structure. + (cse_reg_info_free_list): New variable. + (cse_reg_info_tree): Likewise. + (cached_regno): Likewise. + (cached_cse_reg_info): Likewise. + (all_minus_one): Remove. + (consec_ints): Likewise. + (GET_CSE_REG_INFO): New macro. + (REG_TICK): Likewise. Use throughout instead of reg_tick. + (REG_IN_TABLE): Likewise. Use throughout instead of reg_in_table. + (REG_QTY): Likewise. Use throughout instead of reg_qty. + (get_cse_reg_info): New function. + (free_cse_reg_info): Likewise. + (new_basic_block): Reinitialize cse_reg_info_tree instead of + reg_tick, all_minus_one, and consec_ints. + * Makefile.in (cse.o): Depend on splay-tree.h + +Tue Mar 30 13:19:36 1999 Jason Merrill + + * libgcc2.c (throw_helper): Just return the SP offset, rather than + a whole udata. Include args_size in the offset. + (__throw, __rethrow): Adjust. + +Tue Mar 30 11:39:27 1999 Craig Burley + + * extend.texi (Extended Asm): Delete spurious `b' before + `@end example', which was confusing texi2html. + +Tue Mar 30 00:26:34 1999 Jason Merrill + + * dwarf2out.c (output_line_info): Don't emit redundant info. + Do start a new row if the file changes and the line # doesn't. + +Mon Mar 29 15:48:39 1999 Jason Merrill + + * invoke.texi (Invoking G++, C++ Dialect Options): Update. + +Mon Mar 29 15:05:39 1999 Richard Henderson + + * except.c (start_dynamic_handler): Force jmp_buf address to + and operand before moving to memory. + +Mon Mar 29 15:11:10 1999 Craig Burley + + * invoke.texi (Code Gen Options): Attempt to clarify + -fcheck-memory-usage. Minor edits to -fprefix-function-name. + +Mon Mar 29 20:52:47 1999 J"orn Rennecke + + * loop.c (maybe_eliminate_biv): For libcalls that set a giv, skip to + end of libcall. + +Mon Mar 29 20:35:49 1999 J"orn Rennecke + + * sh.md (mulsi3): Tag an extra REG_EQUAL note to the middle insn. + +Mon Mar 29 11:50:34 1999 Jerry Quinn + + * pa.h (HAVE_PRE_INCREMENT): Disable when optimizing for a PA8000 + class machine. + (HAVE_PRE_DECREMENT, HAVE_POST_INCREMENT): Likewise. + (HAVE_POST_DECREMENT): Likewise. + +Mon Mar 29 08:24:43 1999 Bruce Korb + + * fixinc/mkfixinc.sh: Fix portability problems with old shells. + + * fixinc/README: Updated for release announcement + +Sun Mar 28 20:26:55 1999 Kaveh R. Ghazi + + * recog.h (insn_outfun, insn_operand_predicate): Add prototype + arguments. + + * rtl.h (note_stores): Likewise. + + * rtlanal.c (note_stores): Likewise. + +Sun Mar 28 15:34:28 1999 Richard Henderson + + * varasm.c (output_constant_pool): Always mark the constant pool. + +Sun Mar 28 16:09:01 1999 Jerry Quinn + + * pa.md (pa7100LCshiftmem, pa7100LCalu): Change simultaneity. Use + shift/mem ops in pa7100LCalu. + + * pa.c (pa_adjust_cost): Don't do cost adjustments on pa8000. + (pa_reorg): Don't call pa_combine_instructions on pa8000. + +Sun Mar 28 15:27:26 1999 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload): Remove accidental code duplication. + +Sun Mar 28 12:22:12 1999 Robert Lipe (robertlipe@usa.net) + + * i386/sysv5.h: New file to describe UnixWare7/SVR5. + * configure.in (i?86-UnixWare7*-sysv): Use it. + * i386/udk.h: Use sysv5.h. Now uses Dwarf-2. + +Sun Mar 28 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Mar 28 00:44:27 1999 Jeffrey A Law (law@cygnus.com) + + * sdbout.c (sdbout_symbol): Do not call build_pointer_type, build + one on the fly and do not cache the result. + + * gcc.cps, cpp.cps: Delete unwanted files. + +Sat Mar 27 23:37:40 1999 John Wehle (john@feith.com) + + * i386.md (movdicc+3, movdicc+4): Rewrite using split_di. + * i386.c (output_int_conditional_move): Delete unused code. + +Sat Mar 27 21:17:36 1999 David Edelsohn + + * rs6000/{aix41.h,aix43.h} (ASM_CPU_SPEC): Add 604e. + +Sat Mar 27 16:13:50 1999 Jeffrey A Law (law@cygnus.com) + + * flow.c (mark_used_regs): Improve handling of ASMs. + +1999-03-26 Zack Weinberg + + * Makefile.in (xcpp, cppspec.o): New targets. + (CPP_INSTALL_NAME): New macro. + (install-cpp): Install xcpp. Use CPP_INSTALL_NAME. + (all.build, start.encap): Build xcpp. + + * cppspec.c: New file, implements argument filtering for a + user-visible C preprocessor. + * cpp.sh: Removed. + +Fri Mar 26 20:41:46 1999 Jim Wilson + + * Makefile.in (stmp-fixinc): Use tooldir instead of gcc_tooldir. + +Fri Mar 26 16:02:37 1999 Nick Clifton + + * configure.in (arm-*-vxworks*): Just include arm/vxarm.h. + * configure: Regenerate. + * config/arm/vxarm.h: Define SUBTARGET_CPU_DEFAULT before + including arm/coff.h + +1999-02-16 Scott Bambrough + + * configure.in (arm*-*-linux-gnu*): Set thread_file to 'posix' if + --enable-threads[={yes,pthreads,posix}] is passed as a command + line parameter to configure. + + * configure: Regenerate. + + * gcc/config/arm/t-linux (TARGET_LIBGCC2_CFLAGS): Include -fPIC. + +Fri Mar 26 19:42:19 1999 J"orn Rennecke + + * loop.c (combine_givs): Fix index into can_combine when doing + benefit adjustment for remaining givs when having combined a giv. + +Fri Mar 26 11:38:01 1999 Nick Clifton + + * config/arm/t-arm-elf (EXTRA_MULTILIB_PARTS): Define. + +Fri Mar 26 10:48:27 1999 Nick Clifton + + * config/arm/linux-elf.h: Include dbxelf.h + +Fri Mar 26 10:43:47 1999 Nick Clifton + + * config/svr4.h: Include new header file dbxelf.h. + (DBX_DEBUGGING_INFO): Remove definition. + (DBX_USE_BINCL): Remove definition. + (DBX_BLOCKS_FUNCTION_RELATIVE): Remove definition. + (ASM_IDENTIFY_GCC): Remove definition. + (ASM_IDENTIFY_GCC_AFTER_SOURCE): Remove definition. + (ASM_OUTPUT_SOURCE_LINE): Remove definition. + (DBX_FUNCTION_FIRST): Remove definition. + (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Remove definition. + + * config/elfos.h: Include new header file dbxelf.h. + (DBX_DEBUGGING_INFO): Remove definition. + (DBX_BLOCKS_FUNCTION_RELATIVE): Remove definition. + (ASM_IDENTIFY_GCC): Remove definition. + (ASM_IDENTIFY_GCC_AFTER_SOURCE): Remove definition. + (ASM_OUTPUT_SOURCE_LINE): Remove definition. + (DBX_FUNCTION_FIRST): Remove definition. + + * config/dbxelf.h: New header file. + (DBX_DEBUGGING_INFO): Define. + (DBX_BLOCKS_FUNCTION_RELATIVE): Define. + (DBX_FUNCTION_FIRST): Define. + (DBX_USE_BINCL): Define. + (DBX_CONTIN_LENGTH): Define. + (ASM_IDENTIFY_GCC): Define. + (ASM_IDENTIFY_GCC_AFTER_SOURCE): Define. + (ASM_OUTPUT_SOURCE_LINE): Define. + (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Define. + +Fri Mar 26 01:59:15 1999 "Charles M. Hannum" + + * fold-const.c (fold_truthop): Optimize bitfield references with + different masks as long as their size and bit position are the same. + + * fold-const.c (fold_truthop): Build a type for both the lhs and + rhs and use it appropriately. + + * fold-const.c (fold_truthop): Mask the lhs and rhs after merging + adjacent bitfield references. + + * fold-const.c (fold_truthop): Verify that the lhs and rhs are + in the same bit position when optimizing bitfield references + which have the same mask. + +Thu Mar 25 22:53:27 1999 Martin von Löwis + + * gcc.texi (Copy Assignment): New node. + +1999-03-25 Zack Weinberg + + * gcc.c: Compile unconditionally all code formerly dependent + on #ifdef LANG_SPECIFIC_DRIVER. + * gccspec.c: New file with stub lang_specific_driver, + lang_specific_pre_link. + * Makefile.in: Link gccspec.o into xgcc. Add rule to compile + +Thu Mar 25 21:08:02 1999 Jason Merrill + + * gcc.texi (Temporaries): Update. + +Thu Mar 25 16:53:53 1999 Richard Henderson + + * combine.c (distribute_notes): Place REG_LABEL also where + REG_EQUAL indicates. + +Thu Mar 25 12:46:37 1999 Jim Wilson + + * a29k/a29k.h (TARGET_SWITCHES): Add doc strings. + * i960/i960.h (TARGET_SWITCHES): Add doc strings. + * invoke.texi (a29k): Add documentation for -mno-multm option. + +Thu Mar 25 14:04:54 1999 Andrew MacLeod + + * rtl.texi (RTX_FRAME_RELATED_P): Add documentation. + * rtl.h (struct rtx_def): Update comment for frame_related field. + (set_unique_reg_note): Declare prototype. + * dwarf2out.c (dwarf2out_frame_debug_expr): Split out from + 'dwarf2out_frame_debug' to handle only expressions, and process + component parts of a PARALLEL expression. + (dwarf2out_frame_debug): Process insns only, and call + new function 'dwarf2out_frame_debug_expr' for patterns. + * emit-rtl.c (set_unique_reg_note): New function to add a reg note, + but if there is an existing one, delete it first. + * expmed.c (expand_mult, expand_divmod): Use set_unique_reg_note. + * optabs.c (add_equal_note, expand_binop): Use set_unique_reg_note. + (emit_no_conflict_block, emit_libcall_block): Use set_unique_reg_note. + (expand_fix): Use set_unique_reg_note. + +Thu Mar 25 11:47:49 1999 Art Haas + + * tlink.c (symbol_hash_newfunc): Remove redundant call to + hash_newfunc. + (file_hash_newfunc, demangled_hash_newfunc): Likewise. + +Thu Mar 25 10:05:56 1999 Richard Henderson + + * i386.h (PREFERRED_STACK_BOUNDARY): Set to 128. + +1999-03-25 Philip Blundell + + Based on patch from Jim Studt : + * config/arm/linux-elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Copy + definitions from config/linux.h. + (DBX_BLOCKS_FUNCTION_RELATIVE): Define to 1. + +Thu Mar 25 02:12:42 1999 Finn Hakansson + + * loop.c (strength_reduce): Correct a comment. + + * rtl.h (MEM_COPY_ATTRIBUTES): Remove unnecessary ending backslash. + +Thu Mar 25 02:02:13 1999 Axel Thimm + + * Makefile.in (RANLIB_TEST): Improve test. + +Thu Mar 25 01:15:33 1999 Donn Terry + + * combine.c (force_to_mode, case PLUS): Use sign extended mask + when masking the low bits out of a constant. + +Tue Mar 23 15:45:25 1999 Richard Earnshaw (rearnsha@arm.com) + Jeff Law + + * fold-const.c (make_range): If orig_type is unset, set it as soon + as we know the type. Remove now unnecessary set of orig_type for + conversions. + +Wed Mar 24 23:27:25 1999 Mark Elbrecht + Jeff Law + + * system.h (STDIN_FILENO): Provide default definition if one is not + provided by the system header files. + (STDOUT_FILENO, STDERR_FILENO): Likewise. + + * i386/xm-djgpp.h (COLLECT2_HOST_INITIALIZATION): New macro. + * collect2.c (main): Use it. + (pexecute_pid): New variable. Holds return value from call to pexecute. + (collect2_execute): Rework to use pexecute instead of fork. + (collect2_wait): Use pwait() instead of wait(). + + * i386/djgpp.h: Fix typo. + +Wed Mar 24 23:24:30 1999 Jeffrey A Law (law@cygnus.com) + + * fixinc/mkfixinc.sh: Recognize cygwin* instead of only + cygwin32. + +Wed Mar 24 15:44:12 1999 Nick Clifton + + * config/m32r/m32r.c (init_idents): Accept both NAME and __NAME__ + versions of attribute names and values. + (m32r_valid_machine_decl_attribute): Likewise. + (m32r_encode_section_info): Likewise. + +Wed Mar 24 21:42:15 1999 J"orn Rennecke + + * reload1.c (choose_reload_regs): If output-reloading for a + simple move insn, try to inherit an equivalence for the input. + +1999-02-24 Mike Stump + + * arm/aout.h (DBX_OUTPUT_MAIN_SOURCE_FILENAME): Fix quoting. + +1999-03-24 Jim Blandy + + * libgcc2.c (__CTOR_LIST__, __DTOR_LIST__): Initialize on all + platforms. + +Wed Mar 24 01:35:01 1999 Geoff Keating + + * fold-const.c (fold): Recognize a rotate by an unsigned amount. + +Tue Mar 23 23:32:14 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (rotlsi3): New expander. Synthesize a variable rotate + left using a variable rotate right. Provide anonymous pattern for + rotate left by a constant value. + + * expr.c (expand_assignment): Do not try to optimize an aggregate + address which has VOIDmode. + +Tue Mar 23 22:51:48 1999 Mumit Khan + Donn Terry + + * protoize.c (abspath): Preserve multiple leading slashes for + _WIN32 and Interix. + +1999-01-23 Mike Stump + + * arm/vxarm.h: Split out vxWorks support into separate headerfile + and vxify. + * arm/arm.c (cpu_defaults): Allow arm710 as default. + + * configure.in: Split out vxWorks support for Arm. + * configure: Rebuilt. + +Tue Mar 23 11:20:03 1999 Per Bothner + + * tree.c (first_rtl_op, has_cleanups): Handle GOTO_SUBROUTINE_EXPR. + +Tue Mar 23 09:00:39 1999 Nick Clifton + + * config/arm/riscix1.h (SUBTARGET_SWITCHES): Add doc string. + * config/arm/riscix1-1.h (SUBTARGET_SWITCHES): Add doc string. + +Tue Mar 23 07:50:20 1999 Mark Mitchell + + * function.c: Include hash.h. + (insns_for_mem_entry): New struct. + (put_reg_into_stack): Take an optional hash-table mapping MEMs to + the INSNs that use them. + (fixup_var_refs): Likewise. + (put_addressof_into_stack): Likewise. + (purge_addressof_1): Likewise. Keep the hash-table up to date if + we add new instructions. + (fixup_var_refs_insns): Use it to avoid searching the entire + instruction chain. + (insns_for_mem_newfunc): New function. + (insns_for_mem_comp): Likewise. + (insns_for_mem_walk): Likewise. + (compute_insns_for_mem): Likewise. + (pop_function_context_from): Pass NULL for the hash-table. + (put_var_into_stack): Likewise. + (gen_mem_addressof): Likewise. + (flush_addressof): Likewise. + (purge_addressof): Call compute_insns_for_mem to pre-compute the + hash table. + * Makefile.in (OBJS): Include hash.o. + (function.o): Depend on hash.h. + +Tue Mar 23 00:39:14 1999 Jeffrey A Law (law@cygnus.com) + + * i386/openbsd.h (TARGET_DEFAULT): Use symbolic names instead of + numbers. + * i386/netbsd.h, i386/freebsd.h: Likewise. + + * crtstuff.c: Use ANSI function definitions. Fix minor whitespace + problems. + + * i386/openbsd.h (TARGET_DEFAULT): Define. + * configure.in: Do not set TARGET_CPU_DEFAULT for x86 OpenBSD + configurations. + * configure: Rebuilt. + +Tue Mar 23 00:39:10 1999 John Wehle (john@feith.com) + + * i386/freebsd.h (TARGET_DEFAULT): Define instead + of TARGET_CPU_DEFAULT. + * i386/netbsd.h (TARGET_DEFAULT): Likewise. + +Mon Mar 22 23:52:01 1999 Mumit Khan + Donn Terry + + * sdbout.c (syms.h): Don't include on Interix. + * toplev.c (main): No sbrk on Interix. + + * configure.in: Add i386-pc-interix support. + * configure: Regenerate. + * fixinc.interix: New file. + * config/interix.h: New file. + * config/x-interix: New file. + * config/xm-interix.h: New file. + * i386/interix.h: New file. + * i386/interix.c: New file. + * i386/t-interix: New file. + +Mon Mar 22 23:41:49 1999 Jeffrey A Law (law@cygnus.com) + + * i386.h (PREFERRED_STACK_BOUNDARY): Define. + +Mon Mar 22 23:41:31 1999 John Wehle (john@feith.com) + + * i386.c (ix86_compute_frame_size): New function. + (ix86_prologue, ix86_epilogue): Use it. + * i386.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * reload1.c: Provide default for PREFERRED_STACK_BOUNDARY. + +Mon Mar 22 18:06:59 1999 Jim Wilson + + * mips/mips.h (TARGET_SWITCHES, TARGET_OPTIONS): Add option doc + strings. + * mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Likewise. + +Mon Mar 22 16:18:27 1999 Nick Clifton + + * config/arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Do not bother + passing ATTRIBUTES to arm_valid_machine_decl_attribute. + + * config/arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Do not bother + passing ATTRIBUTES to arm_valid_machine_decl_attribute. + + * config/arm/arm.h (DEFAULT_RTX_COSTS): Do not bother passing + OUTER_CODE to arm_rtx_costs - it is not used. + (arm_compare_fp): Delete declaration. + (FINAL_PRESCAN_INSN): Do not bother passing OPVEC or NOPERANDS to + arm_final_prescan_insn - they are not used. + (const_ok_for_op): Remove prototype. + (arm_rtx_costs): Fix prototype. + (arm_valid_machine_decl_attribute): Fix prototype. + (final_prescan_insn): Fix prototype. + + * config/arm/arm.md: Remove references to arm_compare_fp. + + * config/arm/arm.c (arm_compare_fp): Delete. + (const_ok_for_op): Make function static. Add prototype. Remove + mode parameter - it is unused. + (arm_rtx_costs): Remove outer_code parameter. + (reload_memory_operand): Declare mode parameter unused. + (power_of_two_operand): Declare mode parameter unused. + (equality_operator): Declare mode parameter unused. + (load_multiple_operation): Declare mode parameter unused. + (store_multiple_operation): Declare mode parameter unused. + (multi_register_push): Declare mode parameter unused. + (arm_valid_machine_decl_attribute): Remove attributes parameter - + it is unused. + (select_dominance_cc_mode): Remove op parameter - it is unused. + (gen_compare_reg): Remove fp parameter - it is unused. + (final_prescan_insn): Remove opvec and noperands parameters - they + are unused. + +Mon Mar 22 14:35:28 1999 Nick Clifton + + * tm.texi (MD_SCHED_INIT): Add missing closing parenthesis. + +Mon Mar 22 22:24:30 1999 J"orn Rennecke + + * reload1.c (reload_as_needed): Set reload_is_output_reload / + reload_has_output_reload for auto_inc expressions that could be + reloaded. Call forget_old_reloads for REG_INC notes. + +Mon Mar 22 21:51:57 1999 J"orn Rennecke + + * cse.c (cse_insn): Don't change the result register of a libcall. + +Mon Mar 22 21:08:59 1999 J"orn Rennecke + + * rtl.h (shallow_copy_rtx): Declare. + * rtl.c (shallow_copy_rtx): New function. + * reload.c (find_reloads_toplev): Use shallow_copy_rtx instead of + copy_rtx. + +Mon Mar 22 10:44:33 1999 Vladimir Makarov + + * config/h8300/h8300.md (adjust_length): New attribute. + (modhi3+1, andsi3+1, iorsi3+1, extzv+1, extzv+2): Change insn + default value of attribute "adjust_length" onto "no". + + * config/h8300/h8300.c (h8300_adjust_insn_length): Adjust + length only if the attribute "adjust_length" value is "yes". + Use 0 if the shift is negative. + + * final.c (shorten_branches): Check insn length after its + adjusting. + +Sun Mar 21 17:33:48 1999 Jeffrey A Law (law@cygnus.com) + + * i860.h (TARGET_SWITCHES): Add documentation for default case. + * i860/paragon.h (TARGET_SWITCHES): Add documentation for default case. + * i370.h (TARGET_SWITCHES): Add documentation for default case. + * fx80.h (TARGET_SWITCHES): Add documentation for default case. + * elxsi.h (TARGET_SWITCHES): Add documentation for default case. + * clipper.h (TARGET_SWITCHES): Add documentation for default case. + * 1750a.h (TARGET_SWITCHES): Add documentation for default case. + * pa.h (TARGET_SWITCHES): Add documentation for default case. + (TARGET_OPTIONS): Likewise for default case. + * mn10300.h (TARGET_SWITCHES): Add documentation for default case. + * h8300.h (TARGET_SWITCHES): Add documentation for default case. + + * gcse.c (dump_hash_table): Fix whitespace in declaration. + (compute_transpout): Renamed from pre_compute_transpout. + (compute_pre_*): Deleted. + (pre_expr_reaches_here_p): New argument, CHECK_PRE_COMP. All + callers changed. + (insert_insn_end_bb): Renamed from pre_insert_insn. + (pre_*): Delete unused variables. Only leave local properties and + global redundant/optimal computation points. + (alloc_pre_mem, free_pre_mem): Corresponding changes. + (compute_pre_data): Simplify and call pre_lcm to run the lazy + code motion dataflow analysis. + (pre_insert, pre_insert_copies, pre_delete): Revamp to use LCM + based redundant and optimal computation points. + + * basic-block.h (pre_lcm, pre_rev_lcm): Declare. + + * toplev.c (main): A debug option without a level defaults to + level 2. + +Sun Mar 21 12:13:01 1999 Nick Clifton + + * flow.c (can_delete_label_p): Do not allow user specified + labels to be deleted. + * dwarf2out.c (gen_label_die): Generate addresses for deleted + (programmer specified) labels. + * dwarfout.c (output_label_die): Generate addresses for deleted + (programmer specified) labels. + +1999-03-21 Manfred Hollstein + + * Makefile.in (xgcc$(exeext)): Add intl.o to list of files to be + linked with. + +Sun Mar 21 01:15:03 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Mar 20 22:26:23 1999 Kaveh R. Ghazi + + * sparc.h (TARGET_SWITCHES): Add null description to default case. + +Sat Mar 20 21:46:06 1999 Kaveh R. Ghazi + + * c-lex.c (yylex): Remove unused variable `bytes'. + + * flow.c (print_rtl_with_bb): Cast the return value of alloca. + + * function.c (assign_parms): Wrap variable `varargs_setup' in + macro SETUP_INCOMING_VARARGS. + (thread_prologue_and_epilogue_insns): Mark parameter `f' with + ATTRIBUTE_UNUSED. + + * local-alloc.c (no_equiv): Likewise for parameter `store'. + + * sched.c (schedule_insns): Remove unused variables `insn' and `next'. + + * tlink.c (symbol_hash_newfunc, symbol_hash_lookup, + file_hash_newfunc, file_hash_lookup, demangled_hash_newfunc, + demangled_hash_lookup, symbol_push, symbol_pop, file_push, + file_pop, tlink_init, tlink_execute, frob_extension, + obstack_fgets, tfgets, pfgets, freadsym, read_repo_file, + maybe_tweak, recompile_files, read_repo_files, + demangle_new_symbols, scan_linker_output): Add static prototype. + + (symbol_hash_newfunc, file_hash_newfunc, demangled_hash_newfunc): + Make the third argument a `hash_table_key'. + + * toplev.c (debug_start_source_file): Mark parameter `filename' + with ATTRIBUTE_UNUSED. + +Sun Mar 21 02:28:21 1999 Andreas Schwab + + * tm.texi (Varargs): Don't split argument of @item across lines. + + * invoke.texi: Fix use of @item vs @itemx. + +Sun Mar 21 09:59:54 1999 Michael Hayes + + * config/c4x/c4x.h (TARGET_SWITCHES): Add null description to + default case. + +Sat Mar 20 23:33:54 1999 Michael Hayes + + * loop.c (check_dbra_loop): Fix debug message. + +Sat Mar 20 15:54:35 1999 Michael Hayes + + * config/c4x/c4x.md (decrement_and_branch_on_count): Emit rptb_end + pattern instead of decrement_and_branch_until_zero pattern. + +Sat Mar 20 11:39:58 1999 Michael Hayes + + * config/c4x/c4x.h (TARGET_SWITCHES): Add documentation. + * config/c4x/c4x.h (TARGET_OPTIONS): Add documentation. + +Fri Mar 19 23:26:29 1999 Martin von Löwis + + * expr.c (expand_expr): Handle ERROR_MARK much earlier. + +Fri Mar 19 15:28:38 1999 Kaveh R. Ghazi + + * cccp.c (create_definition): Cast to U_CHAR* when assigning to one. + + * cppfiles.c (read_and_prescan): Likewise. + Start a #define in column 0. + + * cpplib.c (cpp_define): Cast to U_CHAR* when assigning to one. + (cpp_push_buffer): Likewise for cpp_buffer*. + (do_include): Change the type of `fbeg' and `fend' to unsigned char*. + (do_endif): Cast to char* when assigning to one. + (do_assert): Likewise. + (do_unassert): Likewise. + (cpp_read_check_assertion): Change the type of `name' to U_CHAR*. + Don't do unnecessary cast to char* anymore. + + * genrecog.c (make_insn_sequence): Cast to char** when assigning + to one. Cast the first argument of bzero to PTR. + + * loop.c (strength_reduce): Remove unused variable `note'. + + * reload1.c (new_insn_chain): Cast to struct insn_chain* when + assigning to one. + + * rtl.c (copy_rtx): Use memcpy instead of bcopy. + +Fri Mar 19 11:19:31 1999 Kaveh R. Ghazi + + * calls.c (initialize_argument_information): Mark parameters + `num_actuals' and `n_named_args' with ATTRIBUTE_UNUSED. + + * dbxout.c (dbxout_start_new_source_file): Likewise for parameter + `filename'. + (dbxout_finish): Likewise for parameters `file' and `filename'. + (dbxout_prepare_symbol): Likewise for parameter `decl'. + (dbxout_begin_function): Likewise. + + * explow.c (hard_function_value): Likewise for parameter `func'. + + * function.c (locate_and_pad_parm): Likewise for parameter `fndecl'. + + * expmed.c (expand_divmod): Omit unused argument to `expand_abs'. + * expr.c (expand_expr): Likewise. + * expr.h (expand_abs): Delete unused argument from prototype. + * optabs.c (expand_abs): Remove unused parameter `unsignedp'. + + * sdbout.c (sdbout_init): Mark parameter `syms' with ATTRIBUTE_UNUSED. + (sdbout_end_block): Likewise for parameter `n'. + + * toplev.c (debug_define): Likewise for parameters `lineno' and + `buffer'. + (debug_undef): Likewise. + + * varasm.c (named_section): Likewise for parameter 'reloc'. + (assemble_external): Likewise for parameter `decl'. + (assemble_alias): Likewise for parameter `target'. + +Fri Mar 19 01:54:30 1999 Theodore Papadopoulo + + * toplev.c (read_integral_parameter): Constify. Better control of + error messages. + (main): Use read_integral_parameter to set optimize, id_clash_len, + larger_than_size, and the debugging level. + * toplev.h (read_integral_parameter): Update prototype. + +Fri Mar 19 01:42:05 1999 Zack Weinberg + + * system.h: Use putc_unlocked, fputc_unlocked, and + fputs_unlocked only if putc_unlocked has a prototype already. + Prototype fputs_unlocked if necessary. + * configure.in: Check for prototypes of putc_unlocked and + fputs_unlocked. + * acconfig.h: Updated. + * config.in, configure: Rebuilt. + +Fri Mar 19 02:45:12 1999 Alexandre Oliva + + * Makefile.in (INTL_TARGETS): New macro. + ($(INTL_TARGETS)): Depend on generated sources; drop dependencies + on cp/parse.c and objc/objc-parse.c. + ($(srcdir)/cp/parse.c): Move to cp/Make-lang.in. + * objc/Make-lang.in ($(INTL_TARGETS)): Depend on objc/objc-parse.c. + +Thu Mar 18 22:28:53 1999 Jeffrey A Law (law@cygnus.com) + + * i860.h (TARGET_SWITCHES): Add documentation. + * i860/paragon.h (TARGET_SWITCHES): Add documentation. + * i370.h (TARGET_SWITCHES): Add documentation. + * fx80.h (TARGET_SWITCHES): Add documentation. + * elxsi.h (TARGET_SWITCHES): Add documentation. + * clipper.h (TARGET_SWITCHES): Add documentation. + * 1750a.h (TARGET_SWITCHES): Add documentation. + * pa.h (TARGET_SWITCHES): Add documentation. + (TARGET_OPTIONS): Likewise. + * mn10300.h (TARGET_SWITCHES): Add documentation. + * h8300.h (TARGET_SWITCHES): Add documentation. + +Thu Mar 18 15:58:26 1999 Nick Clifton + + * loop.c (strength_reduce): Do not perform pseudo replacements + if the loop contains volatile memory references. + +Thu Mar 18 19:09:50 1999 J"orn Rennecke + + * reload.c (find_reloads_toplev): When processing X recursively, + don't alter it destructively except by filling in constants. + +Thu Mar 18 10:14:18 1999 Kaveh R. Ghazi + + * cccp.c (default_include): Initialize structure members. + (pass_thru_directive): Change the type of 'keyword_length' to int. + (main): Cast `bindtextdomain' and `textdomain' to (void). + + * collect2.c (main): Likewise. + + * cppmain.c (main): Likewise. + + * gcc.c (main): Likewise. + + * gcov.c (main): Likewise. + + * protoize.c (main): Likewise. + + * toplev.c (main): Likewise. + +1999-03-18 Gavin Romig-Koch + + * config/mips/mips.c (mips_explicit_type_size_string): Correct + its type. + +Thu Mar 18 01:24:25 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in: Use "exit 1", not "exit (1)". + * configure: Rebuilt. + +Wed Mar 17 23:17:42 1999 Mark Kettenis + + * config/t-gnu (SYSTEM_HEADER_DIR): New variable. Set to + `/include' in order to find the system's limits.h. + +Wed Mar 17 23:00:18 1999 Robert Lipe + + * fixinc/fixincl.c: Include auto-host.h instead of config.h. + * fixinc/procopen.c: Likewise. + * fixinc/regex.c: Likewise. + * fixinc/server.c: Likewise. + +Wed Mar 17 22:46:13 1999 Mark Elbrecht + Jeff Law + + * pa.md: Add real PA8000 scheduling information. + + * pa.h (processor_type): Add PROCESSOR_8000 symbol. + (ISSUE_RATE): Revamp, including PA8000 support. + * pa.c (override_options): Add 8000 as -mschedule= option. + Do not call strcmp if pa_cpu_string is null. + * pa.md (attr cpu): Add 8000. + * invoke.texi: Add documentation for PA8000 scheduling. + +Wed Mar 17 18:20:24 1999 David S. Miller + + * config/sparc/sparc.h (TARGET_SWITCHES, TARGET_OPTIONS): + Add descriptions. + * config/sparc/sp64-elf.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/splet.h (SUBTARGET_SWITCHES): Likewise. + +Wed Mar 17 14:51:19 1999 Richard Henderson + + * flow.c (compute_immediate_dominators): New function. + * basic-block.h (compute_immediate_dominators): Declare it. + + * alpha.h (HARD_REGNO_MODE_OK): Allow only 4 and 8 byte unit modes + in FP regs. + (MODES_TIEABLE_P): Define asymmetricly wrt modes illegal in FP regs. + +Wed Mar 17 14:41:41 1999 Nick Clifton + + * config/arm/aout.h (ASM_GENERATE_INTERNAL_LABEL): Fix compile + time warning. + * config/arm/arm.md: Fix various compile time warnings. + * config/arm/arm.h: Fix various compile time warnings. Add + function prototypes. + * config/arm/arm.c: Fix various compile time warnings. + (arm_override_options): Reorganize to separate tuning from + targetting. + (bit_count): New function: Return a count of the number of bits + set in a word. + +Wed Mar 17 21:29:12 1999 J"orn Rennecke + + * reload1.c (eliminate_regs): Don't keep REG_DEAD notes around for + things that were eliminated. + +Wed Mar 17 12:16:26 1999 Richard Henderson + + * function.c (fixup_var_refs_1): First try moving the expression + directly into a register. Don't separate cc0 setter and user. + +Wed Mar 17 11:20:29 1999 Dave Brolley + + * cppfiles.c (PIPE_BUF): #define PIPE_BUF if not defined already. + +Wed Mar 17 09:25:06 1999 Kaveh R. Ghazi + + * c-lex.c: Don't include setjmp.h. + (parse_float): New static function. + (pf_args): New struct. + (yylex): Use them in call to `do_float_handler'. + +1999-03-16 Andreas Schwab + + * cexp.y (yyerror): Call verror to get a useful error message. + * cexp.c: Rebuilt. + + * .gdbinit: Move command to put breakpoint at abort to end of file + so that gdb does not bail out early. + +Tue Mar 16 15:30:19 1999 Nick Clifton + + * rtl.h: Rename prototype for free_bb_memory to free_bb_mem. + +Tue Mar 16 23:40:09 1999 J"orn Rennecke + + * sh.md (movsi_i): Move t/r alternative after r/rI alternative. + +Tue Mar 16 13:44:50 1999 Jim Wilson + + * mn10200/mn10200.md (addsi3, subsi3, ashlsi3, lshrsi3, ashrsi3): + Delete emit_library_call_value declaration. + +1999-03-16 Zack Weinberg + + * cppfiles.c (read_and_prescan): Map backslash-newline to '\r' + (which cannot otherwise appear in the processed buffer) and + move it out of tokens that it appears in the middle of. + Improve performance. + (find_position): New function. + + * cpplib.c: \r (one character) indicates backslash + newline, not \\\n (two characters). It cannot appear in the + middle of a token. Call CPP_BUMP_LINE (pfile) whenever + parsing moves past \n or \r. Increment pfile->lineno whenever + a \n is placed into token_buffer. Only one mark can exist at + a time, and CPP_BUMP_LINE must not be used while it is + active. It is automatically cleared by cpp_pop_buffer and + parse_goto_mark. \r is not in is_hor_space or is_space. + + (NEWLINE_FIX, NEWLINE_FIX1, adjust_position, + update_position, count_newlines, parse_move_mark): Removed. + (parse_string, copy_comment): New functions. + (parse_name): Returns void. + (parse_set_mark, parse_clear_mark, parse_goto_mark): Take only + one argument, a cpp_reader *. Change for new marking scheme. + (skip_comment): Handle CHILL line comments too. Second + argument is now first character of comment marker; all callers + changed. Issue error for unterminated block comment here. + (cpp_skip_hspace): Recognize CHILL comments. + (copy_rest_of_line): Likewise. Call skip_comment and + parse_string directly, don't go through cpp_get_token. Emit + "/**/" for block comments if -traditional (create_definition + needs this). + (do_define): Don't play with put_out_comments. + (cpp_push_buffer): Initialize ->mark to -1. + (cpp_buf_line_and_col): Just read out the values in the buffer + structure. + (output_line_command): Use cpp_buf_line_and_col. Fix + formatting. Remove stale code. + (cpp_get_token): Break out string parsing code to + parse_string. Use skip_comment for CHILL comments too. Use + copy_comment for put_out_comments instead of dinking with + marks. Remove stale code. Don't call output_line_command + unless it's necessary. + + * cpplib.h (parse_marker): Removed. + (struct cpp_buffer): Line_base is now an unsigned char *; add + `mark' [long], remove `marks' [struct parse_marker *]. + (parse_set_mark, parse_clear_mark, parse_goto_mark): Update + prototypes. + (CPP_BUMP_LINE, CPP_BUMP_BUFFER_LINE): New macros. + * cppinit.c (is_hor_space, is_space): '\r' is not considered + whitespace. + * cppexp.c (cpp_parse_expression): Use cpp_skip_hspace, not + SKIP_WHITE_SPACE. + * cpphash.c (macarg): Disable line commands while expanding. + +Tue Mar 16 11:30:19 1999 Gavin Romig-Koch + + * c-lex.c (yylex) : Remove warning for integer literals being + larger than the largest target int. Add warning for integer + literal being larger than than its chosen type. + +Tue Mar 16 10:53:17 1999 Gavin Romig-Koch + + * invoke.texi: Add -mlong32 documentation. + * config/mips/mips.h (mips_explicit_type_size_string): New. + (TARGET_SWITCHES): Add 'long32'. + (TARGET_OPTIONS): Add 'explicit-type-size'. + (CC1_SPECS): Set -mexplicit-type-size. + (LONG_MAX_SPEC): Change a use of 'no-long64' to 'long32'. + * config/mips/abi64.h (LONG_MAX_SPEC): Same. Add 'mabi=32'. + * config/mips/mips.c (mips_explicit_type_size_string): New. + (override_options): Use it. + * config/mips/osfrose.h (CC1_SPECS): Set -mexplicit-type-size. + + * config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): + Pointer size now depends on both size longs and size of GP + registers. + +Tue Mar 16 10:22:22 1999 Gavin Romig-Koch + + * config/mips/iris.h (CTORS_SECTION_ASM_OP,DTORS_SECTION_ASM_OP, + dtors_section): Use Pmode == DImode rather than TARGET_LONG64. + * config/mips/mips.c (override_options): Allow -mlong64 and + -mint64 with -mips2 or less. + * config/mips/mips.h (MASK_LONG64): Fix comment. + (POINTER_SIZE): Use Pmode == DImode rather than TARGET_LONG64. + (Pmode): Make Pmode the smaller of longs or gp registers. + * invoke.texi: Note the new size for pointers. + +Mon Mar 15 22:45:25 1999 David Edelsohn + + * rs6000.h (ASM_OUTPUT_{DOUBLE,FLOAT}): Always generate IEEE 754 + bit-pattern directly. + (ASM_OUTPUT_REG_{PUSH,POP}): Delete. + * rs6000.c (first_reg_to_save): If profiling and context needed, + allocate a reg to save static chain for all ABIs. For AIX + profiling, calculate parameter registers to save based on need. + (output_function_profiler): Save and restore static chain around + profile call for all ABIs. + +1999-03-15 Zack Weinberg + + * cppinit.c: Instead of one pending list, keep separate lists + for each category of pending option: -D/-U, -A, -include, + -imacros. Move the four partial include-path lists into the + pending block. Use head and tail pointers so we don't ever + have to reverse the lists. + + (cpp_start_read): Break out blocks of code to their own + functions: install_predefs and initialize_dependency_output. + Use path_include for C_INCLUDE_PATH and friends as well as + CPATH. Remove include_defaults gunk. Warn about the + combination of -lang-chill and -trigraphs. Optimize string + bashing. Walk each pending list once, deallocating as we go. + + (append_include_chain): Brought over from cppfiles.c. Mark + dirs as system include dirs if and only if appending to + system include path. If opts->verbose, print a notice when a + dir is dropped from the include path because it doesn't + exist. Fix memory leak: this function is not supposed to copy + its DIR argument. + + (nreverse_pending, push_pending): Removed. + (APPEND): New macro for adding to pending lists. + (path_include): Can now add to any partial include path. + (base_name): Bring over from cccp.c. + (cpp_options_init): Allocate the pending block. + (cpp_handle_option): Add --version. Exit after --help. Fix + formatting. Order -ifoo options by frequency of usage. + (install_predefs): New function, simplified version of code + that was in cpp_start_read. + (initialize_dependency_output): Likewise. Understand OBJECT_SUFFIX. + + * cppfiles.c (simplify_pathname): Export. + (merge_include_chains): Don't nreverse the lists. If + opts->verbose, print a notice when a duplicate dir is detected + and dropped from the include path. + (finclude): Fix excessive cleverness in setting + fp->system_header_p. + (actual_directory): Set x->sysp from + CPP_BUFFER (pfile)->system_header_p so that one system header + may include another with "". + (deps_output): Fix double adjustment of deps_size which would + cause all dependencies after the first two lines to be lost. + + * cpplib.c (cpp_unassert): New function. + * cpplib.h: Lay out struct cpp_pending here. Adjust + prototypes. Add include_prefix_len to struct cpp_options. + +Mon Mar 15 16:01:52 1999 Jim Wilson + + * config/misp/mips.h (REGISTER_MOVE_COST): Make the cost of moving + from HI/LO/HILO/MD into general registers the same as for one + of moving general registers to HI/LO/HILO/MD. + +Mon Mar 15 12:39:38 1999 Nick Clifton + + * config/m32r/m32r.c (init_idents): New function. Initialize + static tree nodes for m32r specific attribute identifiers. Remove + leading and trailing double underscores from the attribute names. + (m32r_valid_machine_decl_attribute): Call init_idents. + (m32r_encode_section_info): Call init_idents. + +Mon Mar 15 10:20:20 1999 Mark Mitchell + + * reload.c (find_reloads): Add a REG_LABEL note if we substitute a + LABEL_REF for something else. + +Mon Mar 15 08:24:17 1999 Kaveh R. Ghazi + + * fold-const.c (exact_real_inverse): Move variable `float_error' + into the scope where it is used. + (const_binop_1): New static function. + (cb_args): New struct. + (const_binop): Use them in call to `do_float_handler'. + (fold_convert_1): New static function. + (fc_args): New struct. + (fold_convert): Use them in call to `do_float_handler'. + +Mon Mar 15 22:50:18 1999 Michael Hayes + + * rtlanal.c (auto_inc_p): New function. + * rtl.h (auto_inc_p): Prototype it. + * reload1.c (add_auto_inc_notes): New function. + (reload): Strip REG_INC notes and call add_auto_inc_notes + for each insn to restore them correctly. + +1999-03-15 Manfred Hollstein + + * fixinc/Makefile.in (procopen.o): List the actual + dependencies. + +Sun Mar 14 16:22:10 1999 Kaveh R. Ghazi + + * cse.c (check_fold_consts): New static function. + (cfc_args): New struct. + (simplify_relational_operation): Use them in call to + `do_float_handler'. + + * toplev.c (do_float_handler): New function to wrap calls to + setjmp/set_float_handler. + + * toplev.h (do_float_handler): Add extern prototype. + + * tree.c (build_real_from_int_cst_1): New static function. + (brfic_args): New struct. + (build_real_from_int_cst): Use them in call to + `do_float_handler'. + +Sun Mar 14 01:15:06 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Mar 13 17:37:18 1999 Richard Henderson + + * haifa-sched.c (sched_analyze_1): Only clear reg_last_uses on a SET. + +Sat Mar 13 11:36:16 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_split_constant): Don't try to force a constant to + memory after arm_reorg has run. + (after_arm_reorg): New static variable. + (arm_reorg): Set it. + (output_func_epilogue): Clear it. + +Fri Mar 12 20:26:32 1999 David Edelsohn + + * configure.in ({rs6000,powerpc}-ibm-aix*): Set float_format to none. + * configure: Rebuilt. + +Fri Mar 12 20:45:30 1999 J"orn Rennecke + + * unroll.c (loop_iterations): Don't return a final value for EQ + comparison loops. + +Fri Mar 12 12:35:01 1999 Jim Wilson + + * reload1.c (calculate_needs_all_insns): When ignore equivalence + setting insn, clear need_elim, need_reload, and need_operand_change. + +Fri Mar 12 07:54:43 1999 Bruce Korb + + * fixinc/fixinc.*: Some changes from the fixincl-branch + were not applied (??!!). Corrected. + + * fixinc/Makefile.in: Same thing. + +Fri Mar 12 00:51:43 1999 Jeffrey A Law (law@cygnus.com) + + * expr.c (expand_expr): Allow a CALL_EXPR with a mode wider than + MAX_INTEGER_COMPUTATION_MODE. + +Thu Mar 11 14:00:58 1999 Richard Henderson + + * alpha.h (HARD_REGNO_MODE_OK): Disallow QI/HImode in fp regs. + (MODES_TIEABLE_P): Update. + + * alpha.md (ev5_e0): Conflict loads and stores. + +Thu Mar 11 13:55:52 1999 Richard Henderson + + * machmode.h (smallest_mode_for_size): Prototype. + * stor-layout.c (smallest_mode_for_size): Remove static. + +Thu Mar 11 21:25:59 1999 J"orn Rennecke + + * loop.c (strength_reduce): Don't do biv increment -> DEST_REG giv + conversion if we don't know the lifetime. + +Thu Mar 11 20:37:59 1999 J"orn Rennecke + + * reload.1c (delete_address_reloads_1): Check for reloads of + CURRENT_INSN even if it sets DST. + +Thu Mar 11 10:29:50 1999 Jason Merrill + + * dwarf2out.c (add_AT_lbl_offset): Rename from add_AT_section_offset. + (print_die, size_of_die, value_format, output_die): Adjust. + +Thu Mar 11 10:27:42 1999 Robert Lipe + + * dwarf2out.c (TEXT_SECTION_LABEL, DEBUG_LINE_SECTION_LABEL, + DEBUG_INFO_SECTION_LABEL, ABBREV_SECTION_LABEL, + text_section_label, debug_line_section_label, + debug_info_section_label, abbrev_section_label): New. + (output_compilation_unit_header): Emit label associated + with section instead of section name itself. + (out_pubnames, output_aranges, output_line_info, + dwarf2out_finish): Likewise. + (dwarf2out_init): Build internal label names for sections + from static labels. + +Thu Mar 11 17:28:32 1999 J"orn Rennecke + + * sh.md (mulsi3): End mul.l sequence with a no-op move. + +Thu Mar 11 08:52:02 1999 Bruce Korb + + * Makefile.in: Activated fixinc/mkfixinc.sh. + * configure.in: Activated fixinc/mkfixinc.sh. + +Thu Mar 11 01:38:02 1999 Mumit Khan + + * cppfiles.c (INO_T_EQ): Handle UWIN. + + * c-common.c (decl_attributes): Flag unrecognized attribute + functions as warnings instead of as errors. + + Support for i386-pc-uwin. + * i386/uwin.h: New file. + * i386/xm-uwin.h: New file. + * i386/t-uwin: New file. + * i386/uwin.asm: New file. + * configure.in (i[3456]86-*-uwin*): Define. + Add Workaround for vfork bug when hosted on uwin. + * configure: Regenerate. + + * cccp.c (INO_T_EQ): Undefine. UWIN has inodes. + (absolute_filename): UWIN uses POSIX pathnames only. + * libgcc2.c (getpagesize): Do not define for UWIN. + (mprotect): Likewise. + * protoize.c (dirent.h): Conditionally include. + (fputc): Prototype only if it's not a macro. + +Wed Mar 10 02:49:04 1999 Jason Merrill + + * configure.in: Remove init_priority stuff. + +1999-03-11 Colin Smith + + * sdbout.c (plain_type_1): Make boolean types work better with sdb. + +Thu Mar 11 00:20:52 1999 Alexandre Oliva + + * gcc.texi: Update bug reporting instructions to match + current ezmlm list reality. + +Wed Mar 10 23:11:19 1999 Kaveh R. Ghazi + + * gcc.c (print_file_name, print_prog_name, spec_machine, + read_specs, set_spec, lookup_compiler, build_search_list, + putenv_from_prefixes, find_a_file, record_temp_file, + delete_if_ordinary, handle_braces, do_spec, do_spec_1, find_file, + is_directory, validate_switches, used_arg, default_arg, + pfatal_with_name, perror_with_name, pfatal_pexecute, fatal, error, + notice, add_preprocessor_option, add_assembler_option, + add_linker_option, process_command, execute, + unused_prefix_warnings, clear_args, fatal_error, + lang_specific_driver, user_specs, compiler, link_command_spec, + option_map, translate_options, make_temp_file, temp_name, + programname, path_prefix, machine_suffix, just_machine_suffix, + gcc_exec_prefix, standard_exec_prefix, standard_exec_prefix_1, + md_exec_prefix, md_startfile_prefix, md_startfile_prefix_1, + standard_startfile_prefix, standard_startfile_prefix_1, + standard_startfile_prefix_2, tooldir_base_prefix, tooldir_prefix, + multilib_dir, temp_filename, temp_file, command, switchstr, + infile, outfiles, input_filename, input_basename, input_suffix, + check_live_switch, main): Qualify a char* with the `const' keyword. + +Wed Mar 10 20:28:29 1999 Jeffrey A Law (law@cygnus.com) + + * lcm.c: New file. + * Makefile.in (OBJS): Add lcm.o. + (lcm.o): Add dependencies. + + * gcse.c (compute_pre_local_properties): Delete. + (compute_pre_data): Use compute_local_properties instead of + compute_pre_local_properties. + + * gcse.c: More comments, whitespace and similar fixes. + (dump_cuid_table, maybe_set_rd_gen, dump_cprop_data): Delete. + (dump_pre_data, compute_cprop_local_properties): Likewise. + (one_classic_gcse_pass): Lose unused argument. All callers changed. + (compute_hash_table, compute_expr_hash_table): Likewise. + (compute_set_hash_table, one_pre_gcse_pass, mark_call): Likewise. + (cprop_insn, cprop, one_cprop_pass): Add new argument ALTER_JUMPS. + All callers changed. Only alter jumps if ALTER_JUMPS is nonzero. + Lose unused argument. + (gcse_main): Always run a cprop pass after finishing global cse. + (compute_local_properties): New function. + (hash_scan_pat, hash_scan_insn): No longer call maybe_set_rd_gen. + (compute_cprop_data): Use compute_local_properties. + + * gcse.c: Update various comments. + (current_function_calls_longjmp): Delete declaration. + + * gcse.c (run_jump_opt_after_gcse): New variable. + (gcse_main): Returns an integer. + (hash_scan_set): Record initializations from CONST_DOUBLEs too. + (try_replace_reg): Update some comments. + (cprop_insn): Allow propagation into some JUMP_INSNs too. + * rtl.h (gcse_main): Update prototype. + * toplev.c (rest_of_compilation): If gcse_main returns nonzero, + then run a jump optimization pass. + * jump.c (delete_barrier_successors): Delete nop jumps too. + +Wed Mar 10 19:04:31 1999 J"orn Rennecke + + * sh.c (fp_arith_reg_operand): Actually test if reg is suitable + for FP arithmetic. Changed caller. + * sh.md (subsf3, subsf_i): Use fp_arith_reg_operand. + +Wed Mar 10 18:56:31 1999 J"orn Rennecke + + * reload1.c (choose_reload_regs): When inheriting from the frame + pointer, don't clobber it. + +Wed Mar 10 08:01:52 1999 Bruce Korb + + * fixinc/fixinc.*: Resync-ed with the files in this + directory. + + * fixinc/mkfixinc.sh: The machine case elements were + out-of-order. (the ix86-*-linux-gnu* entry needed to + be earlier). + +Wed Mar 10 00:01:24 1999 J"orn Rennecke + + * reload1.c (reload_combine_note_store): Fix calculation of number + of affected registers. + +Tue Mar 9 15:48:15 1999 Richard Henderson + + * flow.c (tidy_fallthru_edge): Be more careful finding the last + BARRIER of a list. Delete the cc0 setter as well as a cond jump. + +Tue Mar 9 15:26:02 1999 Hans-Peter Nilsson + + * i386.md (ashlsi3 splitter): Fix typo in last change. + +Tue Mar 9 11:35:20 1999 Richard Henderson + + * reg-stack.c (stack_reg_life_analysis): Use returnjump_p + instead of an explicit test for RETURN. + +Tue Mar 9 09:33:16 1999 Kaveh R. Ghazi + + * Makefile.in (toplev.o): Depend on $(BASIC_BLOCK_H). + + * toplev.c: Include basic-block.h. + +Tue Mar 9 02:08:17 1999 Jeffrey A Law (law@cygnus.com) + + * calls.c (load_register_parameters): New function. + (expand_call): Use it. + + * calls.c (expand_call): Slightly reorganize code. + + * calls.c (compute_argument_addresses): New function. + (rtx_for_function_call): New function. + (expand_call): Use them. + + * i386.md (zero_extendhisi2): Split into an expander and anonymous + pattern. Add new anonymous pattern for use when optimizing for + size or for the PPro. + (zero_extendqihi2, zero_extendqisi2): Likewise. + +Mon Mar 8 23:43:47 1999 Richard Henderson + + * haifa-sched.c (sched_analyze_1): Fix last change -- add clobber + dependencies to sets in the non-hard-reg case too. + +Mon Mar 8 18:55:21 1999 Marc Espie + + * config/openbsd.h (HANDLE_SYSV_PRAGMA): Define. + +Mon Mar 8 16:04:44 1999 Jim Wilson + + * local-alloc.c (combine_regs): Don't combine if we have a hard reg + for which CLASS_LIKELY_SPILLED_P is true. + + * unroll.c (loop_iterations): Only call loop_find_equiv_value if we + have a REG or SUBREG. + +Mon Mar 8 15:27:42 1999 Jeffrey A Law (law@cygnus.com) + + * i386.md (ashlsi3): Revise comments. Provide new anonymous + pattern for Pentium and PPro/PII. Reverse constraints in + generic ashlsi3 anonymous pattern. + + * calls.c (initialize_argument_info): Accept a pointer to + CUMULATIVE_ARGS. + (expand_call): Pass the address of CUMULATIVE_ARGS. + + * rs6000/xm-sysv4.h (HOST_BITS_PER_LONGLONG): Remove #if 0. + + * mn10300.h (CASE_DROPS_THROUGH): Delete. + * mn10200.h (CASE_DROPS_THROUGH): Delete. + * h8300.h (CASE_DROPS_THROUGH): Delete. + + * flow.c (merge_blocks_nomove): For HAVE_cc0 targets, make sure + to also delete the cc0 setter when deleting a conditional branch + to the next block. + +Mon Mar 8 18:47:11 1999 J"orn Rennecke + + * regmove.c (copy_src_to_dest): New argument max_old_uid. + +Mon Mar 8 08:23:00 1999 Bruce Korb + + * ChangeLog: Merged entries from fixincl-branch. + +Sun Mar 7 11:48:56 1999 Richard Henderson + + * haifa-sched.c (ENCODE_BLOCKAGE): Don't shift unit too far. + (print_exp): Special case addition of a constant. + (print_value) [CONST_INT]: Use HOST_WIDE_INT_PRINT_HEX. + +Sun Mar 7 11:21:02 1999 Richard Henderson + + * haifa-sched.c (reg_last_clobbers): New. + (reg_pending_clobbers, bb_reg_last_clobbers): New. + (compute_block_backward_dependences): Allocate memory for them. + (schedule_region): Likewise. + (sched_analyze_1): Clobbers don't interfere with one another. + They do interfere with sets ... + (sched_analyze_2): ... and uses. + (sched_analyze): Likewise. + (sched_analyze_insn): Update reg_last_clobbers appropriately. + +Sun Mar 7 08:30:37 1999 Kaveh R. Ghazi + + * gmon-sol2.c: Include config.h and system.h. Don't redundantly + include system header files. + (sccsid): Remove. + (moncontrol, monstartup, _mcleanup, internal_mcount): Prototype. + (_mcleanup): Add the `const' keyword to a char*. + (internal_mcount): Declare `etext' as a char[] not a function. + Cast `etext' to char* when calling `monstartup'. + + * sparc.c (frame_base_name, save_regs, restore_regs, + build_big_number, sparc_cmodel_string, sparc_align_loops_string, + sparc_align_jumps_string, sparc_align_funcs_string, code_model, + cpu_default, cpu_table, output_function_prologue, + output_function_epilogue, output_return, + sparc_flat_output_function_prologue, ultra_code_names, + sparc_flat_output_function_epilogue): Constify a char*. + (hypersparc_adjust_cost): Add a default case in a switch. + + * sparc.h (sparc_cmodel_string, OVERRIDE_OPTIONS, + sparc_cpu_select, sparc_align_loops_string, + sparc_align_jumps_string, sparc_align_funcs_string, + output_return): Constify a char*. + + * sparc.md (movdi): Change the comparison of HOST_BITS_PER_WIDE_INT + so that we check "== 32", instead of "!= 64". Cast a value to + HOST_WIDE_INT when comparing against one. Hide the declaration + for variable `chain'. + +Sun Mar 7 08:05:27 1999 Kaveh R. Ghazi + + * system.h (const, inline): Move the stage2 handling of these + keywords-as-macros from here... + + * gansidecl.h (const, inline): ...to here. + +Sun Mar 7 02:44:15 1999 Richard Henderson + + * recog.c (push_operand, pop_operand): VOIDmode needn't match modes. + +Sun Mar 7 01:58:47 1999 Richard Henderson + + * cse.c (canon_hash): Never reject hard regs in CCmode. + +Sun Mar 7 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Mar 6 17:18:44 1999 Richard Earnshaw (rearnsha@arm.com) + Richard Henderson + + * flow.c (make_edges): Handle casesi that jump to default branch. + If CASE_DROPS_THROUGH, force fallthru to block after casesi. + +Sat Mar 6 07:49:23 1999 Kaveh R. Ghazi + + * c-aux-info.c (data_type, affix_data_type, gen_decl, + gen_formal_list_for_type, gen_formal_list_for_func_def, gen_type): + Qualify a char* with the `const' keyword. + + * c-common.c (declare_hidden_char_array, add_attribute, if_elt, + declare_function_name, decl_attributes, format_char_info, + check_format_info, binary_op_error): Likewise. + + * cexp.y (yyerror, error, pedwarn, warning, token): Likewise. + + * gcse.c (dump_hash_table): Likewise. + + * integrate.c (function_cannot_inline_p): Likewise. + + * optabs.c: Include insn-config.h earlier. + (init_libfuncs, init_integral_libfuncs, init_floating_libfuncs): + Qualify a char* with the `const' keyword. + + * real.c (asctoe24, asctoe53, asctoe64, asctoe113, asctoe, + asctoeg, mtherr, ereal_atof): Likewise. + + * real.h (ereal_atof): Likewise. + + * sbitmap.c (dump_sbitmap_vector): Likewise. + + * sbitmap.h (dump_sbitmap_vector): Likewise. + + * stmt.c (nesting, n_occurrences, expand_start_case): Likewise. + + * toplev.c (rest_of_compilation): Likewise. + + * tree.h (function_cannot_inline_p, expand_start_case): Likewise. + +Fri Mar 5 23:16:42 1999 David Edelsohn + + * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Add 64-bit support and do + not overwrite AIX link register save area. + +Fri Mar 5 23:08:01 1999 J"orn Rennecke + + * reload.c (find_reloads_subreg_address): Actually create the USE + for the register, not the new memory location. + +Fri Mar 5 21:41:07 1999 J"orn Rennecke + + * reload1.c (emit_reload_insns): If pseudo that can't be replaced + with its equivalent constant, fall back to reload_in. + +Fri Mar 5 13:20:39 1999 Richard Henderson + + * Makefile.in: Delete .flow2 debugging files. + +Fri Mar 5 11:36:11 1999 Nick Clifton + + * config/arm/arm.c (arm_override_options): Change default target + cpu selection so that enabling TARGET_APCS_32 does not override + default target CPU. + +Fri Mar 5 19:26:23 1999 J"orn Rennecke + + * sh.h (SLOW_BYTE_ACCESS): Define to 1. + (BOOL_TYPE_SIZE): Define. + +Fri Mar 5 02:14:54 1999 John Wehle (john@feith.com) + + * function.c (assign_stack_temp_for_type): Abort + if mode == Blkmode and align is less than + BIGGEST_ALIGNMENT / BITS_PER_UNIT. + (assign_stack_temp_for_type): Round the size parameter + passed to assign_stack_local instead of size itself. + +Thu Mar 4 15:00:35 1999 Richard Henderson + + * flow.c (delete_unreachable_blocks): Mark blocks as they + are put on to the worklist, not as they are taken off. + +Thu Mar 4 00:05:44 1999 Jeffrey A Law (law@cygnus.com) + + * function.c (current_function_has_computed_jump): Remove duplicate + definition. + +Wed Mar 3 19:09:11 1999 Jim Wilson + + * m68k/m68020-elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Undef. + (STARTFILE_SPEC, ENDFILE_SPEC): Define to empty string. + + * sparc/elf.h (MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, + MODDI3_LIBCALL, UMODDI3_LIBCALL, STDC_0_IN_SYSTEM_HEADERS): Undef. + (INIT_SUBTARGET_OPTABS): Define to empty. + +Wed Mar 3 00:00:37 1999 J"orn Rennecke + + * sh.c (force_into): New function. + (expand_block_move): Use it. + +Tue Mar 2 10:39:43 1999 Nick Clifton + + * cccp.c (struct default_include): Add 'included' field. + (main): Set 'included' field when a default include directory + is added to the chain. If -v is specified list all default + include directories which do not get appended to the chain. + +Tue Mar 2 09:24:10 1999 Nick Clifton + + * configure.in (gxx_include_dir): Rename to + gcc_gxx_include_dir in order to prevent it being overridden by + a top level Makefile. + (gcc_tooldir): If $exec_prefix != $prefix then use the + difference between the two as the basis for gcc_tooldir. + + * configure: Rebuild. + + * Makefile.in: Rename gxx_include_dir to gcc_gxx_include_dir. + +Tue Mar 2 16:45:31 1999 J"orn Rennecke + + * unroll.c (copy_loop_body): Don't make extra copies of + NOTE_INSN_LOOP_CONT notes. + +Tue Mar 2 07:44:56 1999 Mark Mitchell + + * tree.c (save_tree_status): Don't treat functions with no context + as nested. + +Tue Mar 2 09:37:05 1999 Robert Lipe + + * Makefile.in (MAKEINFO): Use makeinfo built from sibling + tree when available. + +Tue Mar 2 10:12:48 1999 Kaveh R. Ghazi + + * alpha.c (alpha_cpu_name, alpha_cpu_string, alpha_tp_string, + alpha_fprm_string, alpha_fptm_string, alpha_mlat_string, + current_function_file): Add the `const' keyword. + (normal_memory_operand): Mark parameter `mode' with + ATTRIBUTE_UNUSED. + (alpha_expand_unaligned_load): Add a default case to a switch. + + * alpha.h (alpha_cpu_string, alpha_fprm_string, alpha_fptm_string, + alpha_tp_string, alpha_mlat_string): Add the `const' keyword. + (normal_memory_operand): Add prototype. + + * alpha.md: Cast an expression to `unsigned HOST_WIDE_INT' when + comparing against one. + +Tue Mar 2 10:00:21 1999 Kaveh R. Ghazi + + * mips.c (abort_with_insn): Make function static, add a prototype, + constify 2nd parameter and mark with ATTRIBUTE_NORETURN. + (current_function_file, mips_cpu_string, mips_isa_string, + mips_abi_string, mips_no_mips16_string, mips_entry_string, + mips_move_1word, mips_move_2words, output_block_move, load_store, + override_options, make_temp_file, mips16_fp_args): Qualify a char* + with the `const' keyword. + + * mips.h (current_function_file, mips_cpu_string, mips_isa_string, + mips_abi_string, mips_entry_string, mips_no_mips16_string, + mips_move_1word, mips_move_2words, output_block_move): Likewise. + (abort_with_insn): Remove extern prototype. + + * mips.md: Qualify a char* with the `const' keyword. + Remove many unused variables named `label'. + +Tue Mar 2 01:27:52 1999 H.J. Lu (hjl@gnu.org) + + * Makefile.in (cpp_install_dir, INSTALL_CPP, UNINSTALL_CPP): New + variables. + (install-cpp, uninstall-cpp): New targets. + (install-normal): Depend on $(INSTALL_CPP). + (uninstall): Depend on $(UNINSTALL_CPP). + * configure.in (cpp_install_dir): New, substitute. + (tmake_file): Added t-install-cpp for --enable-cpp. + * configure: Rebuilt. + * cpp.sh: New cpp script. + * config/t-install-cpp: New target fragment. + +Tue Mar 2 01:40:01 1999 Franz Sirl + Jeffrey A Law (law@cygnus.com) + + * cse.c (fold_rtx): Update comments for (const (minus (label) (label))) + case. + (cse_insn): Avoid creating a bogus REG_EQUAL note for + (const (minus (label) (label))) + (record_jump_cond): Fix mismatched paren in comment. + +Tue Mar 2 01:07:12 1999 Dan Nicolaescu + + * final.c (end_final): There are 11 words in the "main header" + structure, not 10. + +Tue Mar 2 00:09:18 1999 Marc Espie + + * extend.texi: Reference __extension__ in the index. + +Mon Mar 1 19:09:32 1999 Jim Wilson + + * Makefile.in (CROSS_FLOAT_H): Delete. + (FLOAT_H): Use float_h_file. + (rest.cross, stmp-int-hdrs): Delete gfloat.h dependency. + (gfloat.h): Delete. + (stmp-int-hdrs): Use FLOAT_H instead of gfloat.h. + (mostlyclean): Delete gloat.h reference. + (install-cross-rest, install-float-h-cross, stmp-headers): Update + comments. + * configure.in (sparcv9-*-solaris2*): Set float_format to none. + (sparc-*-solaris2*): Set float_format to none for 2.5 and higher. + (float_h_file): Set from float_format. Substitute into Makefile.in. + (float_format): No longer substitute into Makefile.in. + * cross-make (FLOAT_H): Delete. + * config/mips/t-cross64 (FLOAT_H): Delete. + * configure: Rebuilt. + +Mon Mar 1 16:36:18 1999 Jeffrey A Law (law@cygnus.com) + + * mips.md (div_trap_normal, div_trap_mips16): Require the dependent + insn to be an INSN before looking at its pattern. + +Mon Mar 1 15:03:51 1999 Jim Wilson + + * config/m68k/lb1sf68.asm (udivsi3): Change jmi to jcs. Fix comments. + * config/m68k/m68k.h (LEGITIMATE_INDEX_REG_P): Reject SIGN_EXTEND of + HImode reg when TARGET_5200. + +Mon Mar 1 21:44:30 1999 J"orn Rennecke + + From Toshiyasu Morita: + * sh.h (CACHE_LOG): SH2 has cache, too. + +Mon Mar 1 14:23:36 1999 Catherine Moore + + * toplev.c (compile_file): Disable -ffunction-sections and + debugging warning if the object format is elf. + +Mon Mar 1 11:46:25 1999 Vladimir N. Makarov + + * config/h8300/h8300.c (print_operand): Use 16 bit addressing + when the data in 8-bit area and can not be addressed by 8-bit. + +Sun Feb 28 16:40:00 1999 Richard Henderson + + * flow.c (create_basic_block): Disregard integrated bb notes. + +Sun Feb 28 15:57:06 1999 Richard Henderson + + * sparc.md (blockage, nonlocal_goto_receiver): Set length to 0. + +Sun Feb 28 14:47:53 1999 Arturo Montes + + * config/i386/t-sco5gas (crti.o): New target. + +Sun Feb 28 15:10:17 1999 David Edelsohn + + * rs6000.md (elf_high, movsi_got, *movsi_got_internal, + *movsi_got_internal_mem, GOT splitter, movdf_hardfloat32, + movdf_softfloat32, movdf_hardfloat64, movdf_softfloat64, + load_multiple, allocate_stack, call_indirect_aix32, + call_indirect_aix64, call_value_indirect_aix32, + call_value_indirect_aix64, call_indirect_nt, + call_value_indirect_nt): Use gpc_reg_operand instead of + register_operand. + +Sun Feb 28 15:10:17 1999 Michael Meissner + + * rs6000.md (one_cmplsi2, andsi3, iorsi3, xorsi3, *eqvsi3, + *andcsi3, *iorcsi3, *nandsi3, *norsi3): Add alternatives to use CR + other than cr0. + * rs6000.c (and{,64}_operand): If the user did -ffixed-cr0, don't + allow andi. or andis. which always set cr0. + +Sun Feb 28 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Feb 28 02:00:38 1999 Jeffrey A Law (law@cygnus.com) + + * invoke.texi: Update information for PA scheduling. + +Sat Feb 27 23:21:47 1999 Jerry Quinn + Mike Stump + + * pa.c (override_options): Change default to 7100LC. + + * pa.h (REG_ALLOC_ORDER): Change order to allocate left half of + float regs before right half of float regs. + +Sat Feb 27 22:48:38 1999 H.J. Lu (hjl@gnu.org) + Jeffrey A Law (law@cygnus.com) + + * frame.h: Update some comments. + * defaults.h (TARGET_ATTRIBUTE_WEAK): Define. + * crtstuff.c (__register_frame_info, __deregister_frame_info): Declare + using TARGET_WEAK_ATTRIBUTE. + (__do_global_dtors_aux): Check if __deregister_frame_info is + zero before calling it. + (__do_global_dtors): Likewise. + (frame_dummy): Check if __register_frame_info is zero before + calling it. + (__frame_dummy): Likewise. + +Sat Feb 27 19:18:24 1999 Jeffrey A Law (law@cygnus.com) + + * SERVICE: Update from the FSF. + +Sat Feb 27 14:31:22 1999 Arturo Montes + + * config/i386/t-sco5 (crti.o): New target. + * config/i386/sco5.h (STARTFILE_SPEC): Include crti.o when + linking -shared. + * configure.in (i[34567]86-*-sco3.2v5*): Add crti.o. + +Sat Feb 27 01:12:40 1999 Jeffrey A Law (law@cygnus.com) + + * md.texi (prologue,epilogue): Document named patterns. + +Fri Feb 26 19:31:25 1999 Dave Love + + * md.texi, invoke.texi: Fix unterminated @xrefs. + +Fri Feb 26 15:33:45 1999 Richard Henderson + + * genattrtab.c (simplify_knowing): Fix uninitialized read + in Feb 21 change. + + * genextract.c (main): Clear recog_operands before extracting. + +Fri Feb 26 02:24:57 1999 Jeffrey A Law (law@cygnus.com) + + * c-pragma.c (add_weak); Delete. Moved into... + * varasm.c (add_weak): New external function. + (declare_weak): If HANDLE_PRAGMA_WEAK, then add the function to + the list of weak functions. + * c-pragma (add_weak): Declare. + +Thu Feb 25 23:43:59 1999 Richard Henderson + + Flow rewrite to use basic block structures and edge lists: + + * basic-block.h (x_basic_block_head, x_basic_block_end): Kill. + (basic_block_computed_jump_target, basic_block_live_at_start): Kill. + (struct edge_def): New. + (struct basic_block_def): New. + (basic_block_info): New. + (BLOCK_HEAD, BLOCK_END): Update. + (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): New. + (uid_block_number): Kill. + (basic_block_for_insn, BLOCK_FOR_INSN): New. + (BLOCK_NUM): Update. + * flow.c (XNMALLOC): Kill. + (max_uid_for_flow): Kill. + (uid_block_number): Kill. + (uid_volatile): Turn into a bitmap. + (SET_INSN_VOLATILE): New. + (basic_block_info): New. + (entry_exit_blocks): New. + (x_basic_block_head, x_basic_block_end): Kill. + (basic_block_computed_jump_target, basic_block_live_at_start): Kill. + (flow_int_list_blocks, basic_block_succ, basic_block_pred): Kill. + (basic_block_loop_depth): Kill. + (basic_block_for_insn): New. + (find_basic_blocks): Split out initial block counting into + count_basic_blocks. Call functions split out of find_basic_blocks_1. + (count_basic_blocks): New. + (find_basic_blocks_1): Split out edge recognition, unreachable + block deletion. + (create_basic_block): New. + (compute_bb_for_insn): New. + (clear_edges): New. + (free_bb_memory): Kill. + (add_edge, add_edge_to_label): Kill. + (mark_label_ref): Kill. + (make_edges): Rewrite to use edge lists. + (make_edge, make_label_edge): New. + (mark_critical_edges): New. + (split_edge, insert_insn_on_edge): New. + (commit_one_edge_insertion, commit_edge_insertions): New. + (delete_unreachable_blocks): Rewrite to use edge lists. + Split out EH region manipulation into delete_eh_regions. + Call tidy_fallthru_edge and merge_blocks. + (delete_eh_regions): New. + (delete_note_p): New. + (delete_insn_chain): New. + (delete_block): Split out code into delete_insn_chain and + tidy_fallthru_edge. Update edge lists. + (expunge_block): New. + (flow_delete_insn): New? + (can_delete_label_p): New? + (merge_blocks_nomove, merge_blocks): New. + (tidy_fallthru_edge): New. + (calculate_loop_depth): New. + (life_analysis): Allocate and free uid_volatile. + (free_basic_block_vars): Update for new structures. + (record_volatile_insns): Use SET_INSN_VOLATILE. + (mark_regs_live_at_end): Tidy EXIT_IGNORE_STACK usage. + (mark_used_regs): Likewise. + (life_analysis_1): Use bb global_live_at_start, global_live_at_end, + local_set regsets. Use bb->aux to store new_live_at_end. Begin + life propagation from EXIT_BLOCK rather than last block. Clear + regs_ever_live after mark_regs_live_at_end. + (allocate_for_life_analysis): Update for new structures. + (propagate_block): Split out loop depth calculation to + calculate_loop_depth. + (regno_uninitialized): Use bb->global_live_at_start. + (regno_clobbered_at_setjmp): Likewise. + (dump_bb_data): Likewise. + (find_auto_inc): Use BLOCK_FOR_INSN instead of BLOCK_NUM. + (dump_flow_info): Update for new structures. + (dump_edge_info): New. + (print_rtl_with_bb): Update for new structures. + (compute_preds_succs): Do no work -- convert edge lists. + (set_block_for_insn): From corpse of old set_block_num. + (set_block_num): Call it. + + * rtl.c (note_insn_name): Add NOTE_INSN_BASIC_BLOCK. + * rtl.h (rtunion_def): Add bb entry. + (NOTE_BASIC_BLOCK): New. + (NOTE_INSN_BASIC_BLOCK): New. + + * varray.h (varray_data_tag): Add bb entry. + (VARRAY_BB_INIT, VARRAY_BB): New. + + * emit-rtl.c (emit_label_before): New. + + * except.c (expand_rethrow): Delete insns following the call to + rethrow. Put the REG_EH_RETHROW on the call. + + * jump.c (returnjump_p, returnjump_p_1): New. + + * expr.h (nonlocal_goto_handler_labels): New declaration. + * function.c (nonlocal_goto_handler_labels): Define it. + (push_function_context_to): Save it. + (pop_function_context_from): Restore it. + (init_function_start): Clear it. + (nonlocal_label_rtx_list): Kill. + * function.h (struct function): Add storage space for it. + * stmt.c (expand_nl_handler_label): Return the new label. + (expand_nl_goto_receivers): Collect a list of them in + nonlocal_goto_handler_labels. + + * Makefile.in (print-rtl.o): Depend on basic-block.h. + (flow.o): Depend on insn-flags.h. + + * function.c (thread_prologue_and_epilogue_insns): Do not + half-heartedly update bb structures. + + * toplev.c: Add flow2 dump as -dw. + (rest_of_compilation): Finish .greg before flow2. + + * graph.c (draw_edge): Handle class 3. + (print_rtl_graph_with_bb): Make abnormal edges red class 2, + change non-fall-thru but adjacent to green class 3. Update + to use new structures. + + * print-rtl.c (print_rtx): Handle NOTE_INSN_BASIC_BLOCK. + + * reg-stack.c (BLOCK_NUM): Convert to function. Abort if + block_number is -1. + (reg_to_stack): Initialize block_num to -1. + + * combine.c (set_nonzero_bits_and_sign_copies): Update reference + to basic_block_live_at_start to bb->global_live_at_start. + (try_combine): Likewise. + (reg_dead_at_p): Likewise. + * global.c (global_conflicts): Likewise. + Handle stack regs on all abnormal edges, not just computed jumps. + (mark_elimination): Update reference to basic_block_live_at_start. + (build_insn_chain): Likewise. + * haifa-sched.c (haifa_edge): Rename from edge for conflict. + (is_cfg_nonregular): Look at nonlocal_goto_handler_labels instead + of nonlocal_label_rtx_list. + (check_live_1): Update reference to basic_block_live_at_start. + (update_live_1): Likewise. + (find_pre_sched_live): Likewise. + (find_post_sched_live): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + (block_alloc): Likewise. + * reload1.c (reload, reload_combine): Likewise. + * regmove.c (mark_flags_life_zones): Likewise. + * resource.c (mark_target_live_regs): Likewise. + * sched.c (schedule_block): Likewise. + + * regclass.c (regset_release_memory): Don't free + basic_block_live_at_start. + + * unroll.c (copy_loop_body): Don't duplicate NOTE_INSN_BASIC_BLOCK. + +Thu Feb 25 21:32:34 1999 Jason Merrill + + * fixinc.wrap: Also handle struct queue in sys/stream.h. + * fixinc.svr4: Likewise. + + * dwarf2out.c (scope_die_for): Set scope_die to comp_unit_die + rather than asserting it. + +Thu Feb 25 23:33:06 1999 Kaveh R. Ghazi + + * cppexp.c (left_shift, right_shift, parse_charconst, COMPARE, + cpp_parse_expr): Replace uses of long/HOST_BITS_PER_LONG with + HOST_WIDEST_INT/HOST_BITS_PER_WIDEST_INT. + + * Makefile.in (cppmain.o, cpplib.o, cpphash.o, cppalloc.o, + cpperror.o, cppexp.o, cppfiles.o, cppinit.o, fix-header.o, + scan-decls.o): Don't depend on machmode.h. + + * cppexp.c: Don't define CHAR_BIT or HOST_BITS_PER_WIDE_INT anymore. + Replace all instances of HOST_WIDE_INT with HOST_WIDEST_INT. + + * cppfiles.c: Likewise. + + * cpplib.c: Likewise. + + * cpplib.h: Likewise. Also don't include machmode.h anymore. + +Thu Feb 25 18:46:26 1999 Richard Henderson + + * gcc.c (default_compilers): Define __FAST_MATH__ when appropriate. + * objc/lang-specs.h: Likewise. + +Thu Feb 25 16:19:43 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (call patterns): Lose unused argument to output_call. + + * print-rtl.c (print_rtl): Print /j and /c for the jump/call flags. + +1999-02-25 Zack Weinberg + + * cpphash.c (install): Rename to cpp_install, add cpp_reader* + first argument. All callers changed. + (hashtab): Removed. + (cpp_lookup, cpp_install): Change all refs to hashtab to + pfile->hashtab. + (cpp_hash_cleanup): Removed. + * cpphash.h: Adjust prototypes. + * cpplib.h (struct cpp_reader): Add hashtab pointer. + * cppinit.c (cpp_reader_init): Also allocate space for the + hashtab. + (cpp_cleanup): Delete all macros and free the hashtab. + +Thu Feb 25 21:52:54 1999 J"orn Rennecke + + * sh.h (PASS_IN_REG_P): For TARGET_HITACHI, don't pass structures + in registers. + + * expr.h (PRETEND_OUTGOING_VARARGS_NAMED): Provide default definition. + * function.c (assign_parms): Honor PRETEND_OUTGOING_VARARGS_NAMED. + * calls.c (expand_call): Likewise. + + * sh.c (sh_expand_prologue): For TARGET_HITACHI, don't push varargs / + stdarg arguments. + * sh.h (CPP_SPEC): Add -D__HITACHI__ for -mhitachi. + (FUNCTION_ARG): For TARGET_HITACHI, don't pass unnamed + arguments in registers. + (PRETEND_OUTGOING_VARARGS_NAMED): Define. + * va-sh.h (entire file): If __HITACHI__ is defined, use sh[123] + flavor varargs. + +Thu Feb 25 14:32:40 1999 Kaveh R. Ghazi + + * cse.c (dump_class): Revert last change and make the prototype + extern. + +Thu Feb 25 19:13:42 1999 J"orn Rennecke + + * rtl.h (insn_first_p): Don't declare. + * rtlanal.c (insn_first_p): Delete. + * loop.c (loop_insn_first_p): Faster implementation. + +Thu Feb 25 10:44:35 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (TARGET_SWITCHES): Delete deprecated switches -m[236]. + (TARGET_3, TARGET_6): Delete. + (ARM_FLAG_ARM[36]): Delete. + (CPP_CPU_ARCH_SPEC): No need to handle -m[236] any more. + (CC1_SPEC): Don't expand -m[236] into new equivalents. + (CPP_APCS_PC_SPEC): No need to handle -m[236] any more. + * arm.c (arm_override_options): Delete warnings about deprecated + options -m[236]. + + * arm.c (arm_finalize_pic): Build the label into the special pic + adjustment insn instead of issuing it separately. + * arm.md (pic_add_dot_plus_eight): Rework to contain the label + that is needed. + + * arm.md (*zeroextractqi_compare0_scratch): Delete. + (*ne_zeroextractsi): New pattern. + +Thu Feb 25 18:40:06 1999 J"orn Rennecke + + * stmt.c (expand_end_loop): Grok code emitted by + expand_exit_loop_if_false. + +Thu Feb 25 10:17:32 1999 Nick Clifton + + * config/arm/arm.c (return_in_memory): Float fields in unions + force a return in memory. + (load_multiple_sequence): Add comment explaining why two LDR + instructions can be better than an LDMIA instruction. + + * config/arm/arm.h (TARGET_SHORT_BY_BYTES): Add comment + describing the real meaning of this option. + (FIXED_REGISTERS): Default r10 to not-fixed. + (CALL_USED_REGISTERS): Default r10 to not-call-used. + (SUBTARGET_CONDITIONAL_REGISTER_USAGE): If not defined, define + as empty. + (CONDITIONAL_REGISTER_USAGE): Fix r10 if TARGET_APCS_STACK is + true. Invoke SUBTARGET_CONDITIONAL_REGISTER_USAGE after + performing other checks. + + * config/arm/arm.md (zero_extendhisi2): Undo previous change. + (extendhisi2): Undo previous change. + Also add comments describing why TARGET_SHORT_BY_BYTES can be + ignored for armv4(t) architectures. + + * config/arm/riscix.h (SUBTARGET_CONDITIONAL_REGISTER_USAGE): + Define to fix r10. + + * config/arm/riscix1-1.h + (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define to fix r10. + +Thu Feb 25 12:09:04 1999 Kaveh R. Ghazi + + * cse.c (dump_class): Make the function definition static to match + the prototype. + +Wed Feb 24 17:47:28 1999 Jim Wilson + + * dbxout.c (gstab.h): Use if CROSS_COMPILE. + + * dwarf2out.c (add_location_or_const_value_attribute): Add big + endian correction for parms passed in regs but living on the stack. + +Wed Feb 24 14:03:54 1999 Jeffrey A Law (law@cygnus.com) + + * calls.c (initialize_argument_information): New function extracted + from expand_call. + (expand_call): Use initialize_argument_information. Remove variables + which are no longer used due to cleanups. + + * calls.c (compute_argument_block_size): New function, extracted from + expand_calls. + (expand_calls): Use compute_argument_block_size. Delete + original_args_size, use unadjusted_args_size instead. + + * calls.c (precompute_arguments): New function, extracted from + expand_call. + (expand_call): Use precompute_arguments. + + * calls.c (finalize_must_preallocate): New function, extracted from + expand_call. + (expand_call): Use finalize_must_preallocate. + + * calls.c (store_one_arg): Mark "variable_size" as possibly unused. + + * regclass.c (record_reg_classes, case 'p'): Set classes appropriately. + An alternative always fails if it needs a pseudo and no suitable + register class can be found. + +Wed Feb 24 19:47:56 1999 J"orn Rennecke + + * loop.h (loop_insn_first_p): Declare. + * loop.c (loop_insn_first_p): No longer static. + * unroll.c (iteration_info): Fix comparison to + reg_iv_type->num_elements. + Before accessing reg_biv_class, check index against + max_reg_before_loop. + Fix and enable code for giv iterators. + (loop_iterations): Compare with reg_iv_type->num_elements instead + of with max_reg_before_loop. + +Wed Feb 24 19:17:11 1999 J"orn Rennecke + + * unroll.c (unroll_loop): Avoid out-of-bounds index for local_regno. + +Wed Feb 24 11:26:41 1999 Vladimir N. Makarov + + * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Don't use + PIC_OFFSET_TABLE_REGNUM for register allocation when -fPIC. + +Tue Feb 23 16:24:19 1999 Marc Lehmann + + * config/i386/i386.md: Fix typo. + +Mon Feb 22 19:36:33 1999 Andrew Cagney + + * config/mips/mips.c (mips_debugger_offset): When TARGET_MIPS16 && + frame_pointer_needed adjust frame size. + (function_prologue): Don't MIPS16 .mask GPOFFSET. Already adjusted + in .frame pseudo-op. + Frm Jim Wilson : + * mips.c (function_prologue): Adjust frame size in .frame pseudo-op + when TARGET_MIPS16 && frame_pointer_needed. + +1999-02-22 Nick Clifton + + * config/arm/arm.h: Add TARGET_CPU_strongarm1100. + Add -mno-sched command line switch to disable scheduling of + instructions into the function's prologue. + (enum processor_type): Remove. + (TARGET_OPTIONS): Add "fpe=" option to match documentation. + (struct arm_cpu_select): Replace 'set_tune_p' and 'set_arch_p' + fields with 'processors' field. + (CONDITIONAL_REGISTER_USAGE): Allow r10 to be used if stack + checking is not enabled. + (RETURN_IN_MEMORY): Always call arm_return_in_memory. + + * config/arm/arm.c (arm_cpu): Remove. + (tune_flags): Remove. + (arm_is_strong): New variable: true iff the target processor is a + StrongARM. + (arm_is_6_or_7): New variable: true iff the target processor is an + ARM6 or and ARM7. + (arm_select): Fields reorganized. + (struct processors): processor_type field removed. + (all_procs): Remove. + (all_cores): New array: Definitions of all known ARM cpu cores. + (all_architectures): New array: Definitions of all known ARM + architectures. + (streq): New macro. + (FL_SCHED): New processor flag: processor required load + scheduling. + (FL_STRONG): New processor flag: processor is a StrongARM. + (arm_override_options): Reorganized to make code clearer. + (use_return_insn): Test for "not (TARGET_APCS and + frame_pointer_needed)". + (arm_return_in_memory): Improve handling of structures. + + * config/arm/arm.md: Remove "cpu" attribute. Replace with + "is_strongarm" and "is_arm_6_or_7" attributes. + (zero_extendhisi2): Check for TARGET_SHORT_BY_BYTES before + arm_arch4. + (extendhisi2): Check for TARGET_SHORT_BY_BYTES before arm_arch4. + + * invoke.texi (ARM Options): Document -mtune= and -mfp= options. + +1999-02-22 Philip Blundell + + * config/arm/linux-gas.h (INITIALIZE_TRAMPOLINE): Replace default + definition with one including cache synchronization. + (CLEAR_INSN_CACHE): Correct syscall number and enable definition. + Move definition of inhibit_libc to... + * config/arm/xm-linux.h: ... here. + + * config/arm/t-linux: Disable multilib configurations since the + only effect for most people is to cause builds to fail. + + * config/arm/elf.h (ASM_FILE_START): Add .file directive. + (ASM_SPEC): Translate -mapcs-float to -mfloat for the assembler. + + * config/arm/linux-elf.h (DEFAULT_VTABLE_THUNKS): Define. + (HANDLE_SYSV_PRAGMA): Likewise. + (LIB_SPEC): Copy definition from generic Linux files. + (LIBGCC_SPEC): Include -lfloat if -msoft-float was given. + (FP_DEFAULT): Set to SOFT3 on 32-bit targets. + (DWARF2_DEBUGGING_INFO): Define. + (PREFERRED_DEBUGGING_TYPE): Define as DBX_DEBUG. + +Mon Feb 22 16:54:18 1999 Andrew MacLeod + + * loop.c (libcall_other_regs): Make extern. + * rtl.h (find_last_value): Add parameter to prototype. + (libcall_other_reg): Add extern declaration. + * rtlanal.c (find_last_value): Add another parameter to allow + a definition using a hardware register to be found as well. + +Mon Feb 22 13:33:47 1999 Mark Mitchell + + * cse.c (dump_class): New function. + (invalidate_memory): Fix typo in comment. + * function.c (temp_slot): Add an alias set field. + (assign_stack_temp): Only reuse slots if they will have the + same alias set as before. + (combine_temp_slots): Don't combine if -fstrict-aliasing; + that's unsafe. + * rtl.c (copy_rtx): Copy all the flags (in particular, + MEM_SCALAR_P). + +Mon Feb 22 14:13:23 1999 Vladimir N. Makarov + + * configure.in (i[34567]86-*-linux-gnu*, + i[34567]86-*-linux-gnulibc1, i[34567]86-*-linux-gnuaout*, + i[34567]86-*-linux-gnuoldld*): Use fixinc.x86-linux-gnu as + fixincludes. + + * configure: Rebuilt. + + * fixinc.x86-linux-gnu: New script for fixing asm-statements bug + on x86 linux. + + * fixinc/fixinc.x86-linux-gnu: Copy of the previous one. + + * fixinc/mkfixinc.sh (i[34567]86-*-linux-gnu*, + i[34567]86-*-linux-gnulibc1, i[34567]86-*-linux-gnuaout*, + i[34567]86-*-linux-gnuoldld*): Use fixinc.x86-linux-gnu as + fixincludes. + +Mon Feb 22 08:55:05 1999 Ovidiu Predescu + + * objc/objc-act.c (encode_type): Temporary revert to the old + behavior of encoding types as the new one seems to break the + encoding of bitfields. + +Mon Feb 22 11:40:44 1999 Craig Burley +Sat Feb 20 09:59:36 1999 Craig Burley + + * Makefile.in (all.internal, all.cross): Depend on `doc' + target, to ensure docs get made before installation. + + Decrease spurious warnings from -fsyntax-only: + * stmt.c (expand_expr_stmt): Expand expr even when -fsyntax-only. + +Mon Feb 22 10:55:00 1999 Gavin Romig-Koch + + * c-lex.c (yylex): Replace warning about integer constants being + larger than long-longs, with a warning about integer constants + being larger than the largest target integer. + +Mon Feb 22 08:35:38 1999 Craig Burley + + Fix -fsyntax-only ICEs: + * varasm.c (assemble_zeros, assemble_variable, + output_constant_def): Do nothing when -fsyntax-only. + +Fri Feb 19 18:18:56 1999 Don Bowman + + * configure.in (mips*-*-vxworks*): Enable gthreads vxworks support. + * configure: Rebuilt. + +Sun Feb 21 20:34:44 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Feb 21 20:35:10 1999 Jeffrey A Law (law@cygnus.com) + + * config/aoutos.h (ASM_OUTPUT_CONSTRUCTOR): Delete. + (ASM_OUTPUT_DESTRUCTOR, ASM_OUTPUT_GC_ENTRY): Likewise. + * tm.texi: Update docs for constructors and destructors. + +Sun Feb 21 17:11:18 1999 Richard Henderson + + * genattrtab.c (check_attr_value): Allow negative const_int if + negative_ok. Accept integral arithmetic operators. Accept + direct references to other attributes. Accept symbol_ref in + non-constant attributes. + (max_attr_value): Add new argument `unknownp'. Update all callers. + (or_attr_value): Likewise. + (simplify_knowing): Don't optimize if max_attr_value unknown. + (write_length_unit_log): Likewise with or_attr_value. + (find_and_mark_used_attributes): Don't fallthru case. + (write_attr_set): Pass thru all non-cond expressions. + (write_attr_value): Handle symbol_ref, attr, and arithmetic. + +Sun Feb 21 13:16:44 1999 Michael Hayes + + * regmove.c (discover_flags_reg): Use word_mode instead of SImode. + +Sun Feb 21 13:15:40 1999 Richard Henderson + + * regmove.c (discover_flags_reg): Remove cc0 code. + (mark_flags_life_zones) [HAVE_cc0]: Force use of cc0; bail if + a potential flags register was identified. + +Sat Feb 20 16:16:07 1999 Franz Sirl + + * rs6000.md (scc plus ltu): Fix typo in last change. + +Sat Feb 20 09:08:44 1999 Richard Earnshaw (rearnsha@arm.com) + + * xm-arm.h (HOST_BITS_PER_LONGLONG): Define. + +Fri Feb 19 23:02:02 1999 Richard Henderson + + * regmove.c (discover_flags_reg): New function. + (flags_set_1, mark_flags_life_zones): New functions. + (regmove_optimize): Call them. + (fixup_match_1): Use insn modes rather than sets_cc0_p. + +Fri Feb 19 22:47:01 1999 J"orn Rennecke + + * rtlanal.c (insn_first_p): Fix return value for insn == reference. + + * loop.c (strength_reduce, check_final_value, check_dbra_loop): + Use loop_insn_first_p. + +Fri Feb 19 15:49:26 1999 Michael Meissner + David Edelsohn + + * rs6000.md (scc plus eq): Fix output template. + (scc plus ltu): Fix output template and collapse variants + correcting early clobbers. + (scc plus geu): Fix output template. + (scc plus gt): Fix output template. + (scc plus gtu): Fix output template and collapse variants. + +Fri Feb 19 15:43:59 1999 Kaveh R. Ghazi + + * cppinit.c (print_help): Remove unescaped newline in string. + +Fri Feb 19 19:55:06 1999 J"orn Rennecke + + * loop.c (strength_reduce): Check for intervening jumps when + converting biv increment to giv. + +Thu Feb 18 16:36:58 1999 Per Bothner + + * tree.def (TRY_FINALLY_EXPR, GOTO_SUBROUTINE_EXPR): New tree nodes, + * expr.c (expand_expr): Support new tree nodes. + +Fri Feb 19 10:17:56 1999 Andreas Schwab + + * config/m68k/m68k.c (m68k_align_loops_string, + m68k_align_jumps_string, m68k_align_funcs_string): Add const. + * config/m68k/m68k.h (m68k_align_loops_string, + m68k_align_jumps_string, m68k_align_funcs_string): Likewise. + +Thu Feb 18 23:28:35 1999 Kaveh R. Ghazi + + * bitmap.c (bitmap_print): Qualify a char* with the `const' keyword. + + * bitmap.h (bitmap_print): Likewise. + + * c-decl.c (builtin_function, grokdeclarator, grokfield): Likewise. + + * c-lang.c (build_objc_string): Likewise. + + * c-lex.c (yyerror, extend_token_buffer): Likewise. Don't include + limits.h or ctype.h. Remove unused variable `p'. + + * c-lex.h (yyerror): Qualify a char* with the `const' keyword. + + * c-pragma.c (handle_pragma_token): Likewise. + + * c-pragma.h (handle_pragma_token): Likewise. + + * c-tree.h (build_objc_string, builtin_function, grokfield, + build_indirect_ref, lvalue_or_else, readonly_warning, error_init, + pedwarn_init): Likewise. + + * c-typeck.c (convert_for_assignment, warn_for_assignment, + push_string, warning_init, incomplete_type_error, + build_indirect_ref, lvalue_or_else, readonly_warning, + build_c_cast, spelling, push_member_name, print_spelling, + error_init, pedwarn_init, start_init): Likewise. + + * objc/objc-act.c (build_objc_string): Likewise. + + * print-tree.c (print_node_brief, print_node): Likewise. + + * tree.h (lvalue_or_else, print_node, print_node_brief): Likewise. + +Thu Feb 18 20:44:21 1999 David Edelsohn + + * regclass.c (record_reg_classes): Correctly handle 'p' constraint. + +Thu Feb 18 19:59:37 1999 Marc Espie + + * configure.in :Handle OpenBSD platforms. + * configure: Rebuilt. + * config/openbsd.h: New file. + * config/xm-openbsd.h: New file. + * config/t-openbsd: New file. + * config/t-openbsd-thread: New file. + +Thu Feb 18 18:47:09 1999 Jeffrey A Law (law@cygnus.com) + + * function.c (assign_stack_temp_for_type): Round SIZE before calling + assign_stack_local for BLKmode slots. + +Fri Feb 19 01:45:06 1999 J"orn Rennecke + + * loop.c (strength_reduce): For derived givs, replace the + giv this was derived from with its new_reg. + (recombine_givs): Don't set new_reg for derived giv. + And don't print it, print SUM instead. + +Thu Feb 18 15:52:49 1999 Jim Wilson + + * m68kelf.h (ASM_RETURN_CASE_JUMP): Add 5200 support. + +1999-02-18 Zack Weinberg + + * cpplib.c: Kill define of STDC_VALUE. Don't include output.h + or prefix.h. Change CPP_IS_MACRO_BUFFER to not refer to + macro_cleanup. + (GET_ENV_PATH_LIST, PATH_SEPARATOR, STANDARD_INCLUDE_DIR, + predefs, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, + CPP_WCHAR_TYPE, USER_LABEL_PREFIX, REGISTER_PREFIX, struct + cpp_pending, version_string, struct default_include, + include_defaults_array, path_include, cpp_options_init, + dump_special_to_buffer, initialize_builtins, cpp_start_read, + cpp_reader_init, nreverse_pending, push_pending, print_help, + cpp_handle_option, cpp_handle_options, cpp_finish, + cpp_cleanup): Move to cppinit.c. + (macro_cleanup, struct arglist, collect_expansion, + create_definition, compare_defs, comp_def_part, ARG_BASE, + struct argdata, macarg, change_newlines, timestamp, + monthnames, special_symbol, unsafe_chars, macroexpand, + push_macro_expansion): Move to cpphash.c. + (quote_string, check_macro_name, cpp_expand_to_buffer, + output_line_command, cpp_undef): Export. + (null_underflow, null_cleanup, handle_directive): Make static. + + * cpplib.h: Prototype now-exported functions. Adjust decls of + syntax tables so we can include cpplib.h in cppinit.c. + * cpphash.h: Prototype all functions exported by cpphash.c. + * cppinit.c: Make syntax tables initialized data if possible + (uses GCC designated-initializer extension). + * cppexp.c: Make cpp_lex static. + * Makefile.in: Move -D switches for the various include dirs + from cpplib.o rule to cppinit.o rule. Adjust dependencies. + +Thu Feb 18 13:15:56 1999 Marc Espie + + * alpha/openbsd.h: New file. + * alpha/xm-openbsd.h: New file. + * sparc/openbsd.h: New file. + * sparc/xm-openbsd.h: New file. + * m68k/openbsd.h: New file. + * m68k/xm-openbsd.h: New file. + * i386/openbsd.h: New file, originally from netbsd. + * i386/xm-openbsd.h: New file. + +1999-02-17 Zack Weinberg + + * Makefile.in: Correct dependencies for cpplib object files. + +Wed Feb 17 14:04:18 1999 Michael Meissner + + * rs6000.md ({add,sub}si3 `.'): Add alternatives to use CR other + than cr0. + +Wed Feb 17 16:59:28 1999 J"orn Rennecke + + * loop.c (strength_reduce): Don't move giv insn for biv turned giv + below scan_start. + +Wed Feb 17 10:56:24 1999 Kaveh R. Ghazi + + * tree.c (tree_node_kind_names, print_obstack_name, + get_identifier, maybe_get_identifier, build_string, + build_expr_wfl, is_attribute_p, lookup_attribute, + print_obstack_statistics, get_file_function_name_long, tree_check, + tree_class_check, expr_check): Qualify a char* with the `const' + keyword. + + * tree.h (get_identifier, maybe_get_identifier, build_string, + build_expr_wfl, is_attribute_p, lookup_attribute, + print_obstack_statistics, print_obstack_name, tree_check, + tree_class_check, expr_check): Likewise. + +Tue Feb 16 21:29:38 1999 Jeffrey A Law (law@cygnus.com) + + * i386/freebsd-elf.h, i386/gas.h, i386/linux.h: Fix minor spacing + errors. + + * calls.c (store_one_arg): Mark any slots used for the argument + as in-use immediately after we're done saving any slots which + will be overwritten by this argument. + +Tue Feb 16 21:02:07 1999 Anton Hartl + + * rs6000.md (call_value): Fix typo. + +Wed Feb 17 01:29:07 1999 J"orn Rennecke + + * loop.c (strength_reduce): Calculate maybe_dead before + calling recombine_givs. + +Wed Feb 17 00:43:12 1999 J"orn Rennecke + + * loop.c (strength_reduce): Dump biv increment -> giv conversions. + +Tue Feb 16 15:31:39 1999 Ovidiu Predescu + + * objc/objc-act.c (encode_type): Encode the type instead of + encoding the mode of the type (patch from Richard Frith-Macdonald + ). + +Tue Feb 16 10:53:51 1999 Richard Earnshaw (rearnsha@arm.com) + + * config/arm/arm.md (*zeroextractqi_compare0_scratch): Re-add load + instruction killed in previous change. Simplify mask generation. + (*zeroextractsi_compare0_scratch): Simplify mask generation. + +Tue Feb 16 09:52:26 1999 Nick Clifton + + * config/arm/arm.md (zeroextractqi_compare0_scratch): Ensure that + bitfield does not overflow a byte boundary. + +Tue Feb 16 01:37:33 1999 Charles G Waldman + + * c-common.c (shorten_compare): Get the min/max value from the + underlying type of an enumeration, not the enumerated type itself. + +Mon Feb 15 23:04:48 1999 Jeffrey A Law (law@cygnus.com) + + * jump.c: Include insn-attr.h. + (delete_computation): If reload has completed and insn scheduling + after reload is enabled, then do not depend on REG_DEAD notes. + * Makefile.in (jump.o): Depend on insn-attr.h. + +Mon Feb 15 16:57:38 1999 Richard Henderson + + * i386.md (addsi3): Allow lea for any constant_p. + +1999-02-15 Zack Weinberg + + * toplev.c (documented_lang_options): Remove -fident and + -fnoident, which are now handled by the language independent + option parser. + +1999-02-15 Zack Weinberg + + * c-common.c (UNGETC [USE_CPPLIB=1]): Do nothing if c is EOF. + * c-lex.c: Likewise. + * cpplib.c (cpp_push_buffer, cpp_pop_buffer): Use a linked + list in malloced memory for the buffer stack. + (cpp_get_token): Don't pop the last buffer off the stack. + Calls after CPP_EOF has been returned produce CPP_EOF with no + state change. + (cpp_finish): Pop last buffer here. + (do_line): Don't free ip->last_nominal_fname if it is equal to + ip->fname. + (special_symbol): If a T_CONST is the empty string, push a + single `@ ' escape instead. + (macroexpand): Special symbol buffers have escapes too. + * cpplib.h (struct cpp_buffer): Remove unused fields, add prev + buffer pointer. + (struct cpp_reader): Remove buffer_stack. Add + buffer_stack_depth. + (CPP_PREV_BUFFER, CPP_NULL_BUFFER): Buffer stack is now a + linked list. + +Mon Feb 15 14:44:53 1999 Kaveh R. Ghazi + + * cccp.c: Don't define HOST_WIDE_INT. Replace all occurrences of + WIDE_INT with WIDEST_INT. + + * cexp.y: Likewise. + Don't define unsigned_HOST_WIDE_INT, CHAR_BIT or + HOST_BITS_PER_WIDE_INT. Replace occurrences of PRINTF_PROTO_1() + style with PVPROTO() ATTRIBUTE_PRINTF_1 style macros. Replace + occurrences of "unsigned_HOST" with "unsigned HOST". Provide a + definition of variable `c89' when compiling a test binary and set it. + + * system.h: Don't define the PRINTF_PROTO_* macros. + +Mon Feb 15 11:33:51 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (mark_loop_jump): Handle LO_SUM. If we encounter something + we do not understand, mark the loop and containing loops as invalid. + +Mon Feb 15 00:40:45 1999 J"orn Rennecke + + * alias.c (init_alias_analysis): Avoid self-referential value + when setting reg_known_value from REG_EQUAL notes. + +Sun Feb 14 23:12:10 1999 Richard Henderson + + * i386.c (legitimate_address_p): Verify modes of base and index. + +Sun Feb 14 23:01:28 1999 Richard Henderson + + * i386.c (legitimate_pic_address_disp_p): Remove static. + * i386.h (LEGITIMATE_PIC_OPERAND_P): Use it instead of + open-coding cases. + +Sun Feb 14 21:03:28 1999 Jeffrey A Law (law@cygnus.com) + + * except.c (start_catch_handler): Use emit_cmp_and_jump_insns. + * explow.c (probe_stack_range): Likewise. + * expmed.c (do_cmp_and_jump): Likewise. + * expr.c (store_expr, expand_expr, expand_builtin): Likewise. + (do_tablejump): Likewise. + * stmt.c (expand_expr_stmt, expand_end_case): Likewise. + (do_jump_if_equal, emit_case_nodes): Likewise. + * optabs.c (emit_cmp_and_jump_insns): Clarify comments. If UNSIGNEDP, + then convert comparison to an unsigned code before emitting the jump. + (expand_float, expand_fix): Use emit_cmp_and_jump_insns. + +Sun Feb 14 02:24:15 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Feb 14 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Feb 14 00:45:50 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c: Disable recent loop changes. Temporary as Joern + continues to fix problems. + +Sat Feb 13 23:29:42 1999 Richard Henderson + + * loop.c (combine_givs_used_by_other): Delete. + (combine_givs_benefit_from): Delete. + (combine_givs): Deny combination of givs only used once. Simplify + code with the death of combine_givs_benefit_from. + +Sun Feb 14 11:24:05 1999 Michael Hayes + + * loop.c (scan_loop): Call reg_in_basic_block_p before + loop_reg_used_before_p. + +Sat Feb 13 05:32:00 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.md: Use gen_rtx_FOO instead of gen_rtx (FOO, ...). + * arm.h: Likewise. + * arm.c: Likewise. + + * arm.h (TARGET_OPTIONS): Reformat for clarity. + (GO_IF_LEGITIMATE_ADDRESS): When generating PIC, references to symbols + in the constant pool aren't valid. + (LEGITIMATE_PIC_OPERAND_P): Likewise. + + * arm.c: Include "system.h", not stdio.h and string.h. + +Fri Feb 12 13:06:28 1999 Jim Wilson + + * stmt.c (expand_return): Return if optimize_tail_recursion succeeded. + (optimize_tail_recursion): Change return type from void to int. + Add return statements. + * tree.h (optimize_tail_recursion): Change prototype to match. + +Fri Feb 12 21:09:51 1999 J"orn Rennecke + + * reload.c (find_reloads_subreg_address): New function, broken out of + find_reloads_toplev. + (find_reloads_toplev, find_reloads_address_1): Use it. + +Fri Feb 12 13:20:52 1999 Jeffrey A Law (law@cygnus.com) + + * h8300.md (zero_extendhisi2 H8/300 variant): Correctly handle + extending a CONST_INT. + + * h8300.md (peephole for combining memrefs): Delete incorrect peephole. + +Fri Feb 12 18:29:11 1999 J"orn Rennecke + + * loop.c (loop_insn_first_p, biv_elimination_giv_has_0_offset): + New functions. + (maybe_eliminate_biv_1): Use biv_elimination_giv_has_0_offset. + +Fri Feb 12 16:56:10 1999 J"orn Rennecke + + * loop.c (load_mems): Don't guess how to do a load / store, use + emit_move_insn. + +Fri Feb 12 09:24:26 1999 Kaveh R. Ghazi + + * system.h: Provide a definition for HOST_WIDEST_INT, etc. + +Fri Feb 12 23:37:26 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_address_cost): Revert 9 Feb change. + +Fri Feb 12 00:51:26 1999 Jeffrey A Law (law@cygnus.com) + + * reload.c (find_reloads_address_1): Fix handling of an autoincremented + pseudo which is homed in the stack. + + * mips.c (save_restore_insns): Fix loop to save/restore FP registers. + (compute_frame_size): Change loop over FP regs to be consistent + with the loop in save_restore_insns. + +Thu Feb 11 17:38:40 1999 Jim Wilson + + * i960/i960.h (OVERRIDE_OPTIONS): Warn if -mlong-double-64 is used. + (LONG_DOUBLE_TYPE_SIZE): Undef then unconditionally define to 96. + +Thu Feb 11 15:11:35 1999 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (bset); Re-enable. + +Thu Feb 11 15:20:49 1999 J"orn Rennecke + + * sh.md (is_sfunc): New attribute. + * sh.h (INSN_SETS_ARE_DELAYED, INSN_REFERENCES_ARE_DELAYED): Use it. + +Thu Feb 11 01:06:49 1999 Nathan Sidwell + + * fold-const.c (range_binop): Take account of the bounded nature + of fixed length arithmetic when comparing unbounded ranges. + +Thu Feb 11 00:08:17 1999 John Wehle (john@feith.com) + + * function.c (assign_stack_temp_for_type): Clear best_p + when an exact match is found. + + * i386.h (LOCAL_ALIGNMENT): Define. + * function.c (assign_stack_local, assign_outer_stack_local): Use it. + (assign_stack_temp_for_type): New function based on assign_stack_temp. + (assign_stack_temp): Call it. + (assign_temp): Use assign_stack_temp_for_type, not assign_stack_temp. + * stmt.c: Use assign_temp, not assign_stack_temp. + * tm.texi: Document LOCAL_ALIGNMENT. + +Wed Feb 10 23:28:28 1999 Jeffrey A Law (law@cygnus.com) + + * reorg.c: Finish deleting half-deleted comment. + +Wed Feb 10 17:12:21 1999 Jim Wilson + + * emit-rtl.c (operand_subword): Sign extend REAL_VALUE_TO_TARGET_SINGLE + result. + * final.c (split_double): Sign extend REAL_VALUE_TO_TARGET_DOUBLE + result. + * real.c (endian): Delete sign extension code. + * config/m32r/m32r.md (movsf_insn+1): REAL_VALUE_TO_TARGET_SINGLE call + replaced with operand_subword call. + +Wed Feb 10 15:16:39 1999 Richard Henderson + + * alpha.md (cmov compound patterns): Delete. Jump can now + create the correct constructs in the first place. + +Wed Feb 10 11:03:22 1999 Richard Henderson + + * configure.in (alphaev6*): Fix typo in target_cpu_default2. + +Wed Feb 10 13:59:18 1999 Dave Brolley + + * mbchar.c (local_mb_cur_max): Handle the case where MB_CUR_MAX is 0. + +Wed Feb 10 10:35:05 1999 Jim Wilson + + * tmp-emsgids.c: Delete. + +Wed Feb 10 09:57:08 1999 Mark Mitchell + + * rtlanal.c (for_each_rtx): Fix declaration to conform to GNU + coding standards. + +Wed Feb 10 10:09:41 1999 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (bset, bclr): Operand 0 is a read/write operand. + + * reload1.c (reload_combine_note_store): Second argument is no + longer unused/ignored. Handle multi-register hard regs. + (move2add_note_store): Simplify. + +Wed Feb 10 10:05:23 1999 Mumit Khan + + * collect2.c (collect_execute): Remove cygwin-specific code. + +Tue Feb 9 17:27:29 1999 Nathan Sidwell + + * system.h (_, N_): Remove dummy i18n macros. + * protoize.c: Move inclusion of intl.h to after system.h. + * cexp.y: Include intl.h. + * cexp.c: Rebuilt. + +Tue Feb 9 16:52:22 1999 Mumit Khan + + * i386/cygwin.h (SUBTARGET_OVERRIDE_OPTIONS): New macro to ignore + fpic/fPIC for windows32 targets. + * i386/xm-cygwin.h (GET_ENV_PATH_LIST): Replace '\\' in windows32 + paths with '/'. + * i386/mingw32.h (CPP_SPEC): Define. + (CPP_PREDEFINES): Add MINGW32 version id. + * i386/crtdll.h (CPP_PREDEFINES): Likewise. + + * Makefile.in (collect2$(exeext)): Delete redundant dependency and + add missing exeext to target. + + * gcc.c (convert_filename): Handle null filename argument. + +Wed Feb 10 15:46:10 1999 Michael Hayes + + * config/c4x/c4x.md (*movhf_noclobber, *movhi_noclobber): Use + m constraint instead of QT. + +1999-02-09 Brendan Kehoe + + * cpplib.c (special_symbol): Move IP to be declared in function + scope, rather than individual case statements. + +1999-02-09 Zack Weinberg + + * cppfiles.c (finclude): Handle pipes properly under old BSD + derivatives. + +1999-02-09 Melissa O'Neill + + * system.h: Provide fallback definitions for S_ISCHR, + S_ISSOCK, S_ISFIFO, O_NONBLOCK, and O_NOCTTY. + +1999-02-09 Zack Weinberg + + * cpplib.c (do_define): Allow redefining __STDC__ with -D. + +1999-02-09 Jim Blandy + + * configure.in: For PowerPC configurations, accept "401", "ec603e", + "740", and "750" as valid arguments to --with-cpu. + * configure: Rebuilt. + +Tue Feb 9 00:00:14 1999 Mark Kettenis + + * configure.in (i[34567]86-*gnu*): Set float_format to i386. + * configure: Rebuilt. + +Mon Feb 8 22:38:24 1999 Jeffrey A Law (law@cygnus.com) + + * rs6000.md: Revert "alternate use of crs if cr0 not available" + patches from 01-22-1999, 01-24-1999, 01-26-1999, and 02-08-1999. + +Mon Feb 8 21:36:44 1999 Richard Henderson + + * output.h (current_function_has_computed_jump): Rename from + current_function_addresses_labels. + * function.h (struct function): Likewise for addresses_labels member. + * rtl.h (FUNCTION_FLAGS_HAS_COMPUTED_JUMP): Likewise. + * function.c (current_function_has_computed_jump): Likewise. + Update all references. + * integrate.c (function_cannot_inline_p): + Test current_function_has_computed_jump instead of addresses_labels. + (initialize_for_inline): Likewise save. + (output_inline_function): Likewise restore. + + * expr.c (expand_expr): Don't reference addresses_labels variables. + * stmt.c (expand_computed_goto): Set has_computed_jump. + +1999-02-08 Michael Meissner + + This is being installed only to get it into the repository to help + with the revert, resubmit & review process for the massive rs6000.md + changes. + * rs6000.md (andsi3_internal1 splitter): Don't split if using the + rlwinm instruction. + (anddi3_internal1): Likewise. + (andsi3_internal{2,3}): Correct some insn lengths. + (anddi3*): Restore missing TARGET_POWERPC64, and don't emit old + mnemonics. + +Mon Feb 8 21:31:06 1999 Richard Henderson + + * loop.c (reg_single_usage): New file-scope variable ... + (scan_loop): ... moved out of here. Always initialize. + Test loop_has_call instead of reg_single_usage not zero. + Free reg_single_usage after strength reduction. + (count_loop_regs_set): Assume single_usage nonzero. + (combine_givs_used_by_other): Test reg_single_usage. + (load_mems_and_recount_loop_regs_set): Remove reg_single_usage + as a parameter. Assume nonzero. + +1999-02-08 Zack Weinberg + + * cpplib.c (special_symbol): Rewrite. Don't copy things + multiple times. Handle __STDC__ specially. T_CONST + indicates a constant /string/. Don't handle T_*_TYPE and + T_SPEC_DEFINED. Use cpp_buf_line_and_col instead of + adjust_position. Determine the file buffer only if needed. + (initialize_builtins): Handle __SIZE_TYPE__, + __PTRDIFF_TYPE__, __WCHAR_TYPE__, __USER_LABEL_PREFIX__, and + __REGISTER_PREFIX__ with T_CONST special hashtab entries. + Don't provide __OBJC__; the driver does that. Provide + __STDC_VERSION__, using T_CONST. Use T_STDC for + __STDC__. Give install the length of all symbols defined. + (eval_if_expression): Drop code to insert and remove the + "defined" special symbol. + + * cpplib.h: Remove SELF_DIR_DUMMY (no longer used). Remove + T_*_TYPE and T_SPEC_DEFINED from enum node_type; add T_STDC. + + * cpphash.c (install): Drop the `ivalue' parameter. Constify + the `value' parameter. All callers changed. + * cpphash.h (install): Change prototype to match. + (union hashval): Remove `ival' member. + * cppexp.c (cpp_lex): Handle `defined' here. + +Mon Feb 8 17:29:42 1999 Jeffrey A Law (law@cygnus.com) + + * pa.h (EXTRA_CONSTRAINT): Fix comment. + +Mon Feb 8 18:57:45 1999 Vladimir N. Makarov + + * c-typeck.c (check_init_type_bitfields): Use nonincremental + initialization of unions whose first member is a bitfield. + Remove unnecessary code for checking the declaration mode + after DECL_C_BIT_FIELD. + + * varasm.c (output_constructor): Additional comment about the + constructor of bitfield union initialization. + +Tue Feb 9 11:55:04 1999 Michael Hayes + + * config/c4x/c4x.md (*movhi_stik): New pattern. + (movhi): Allow some immediate constants to be directly + stored in memory. + +Tue Feb 9 11:34:15 1999 Michael Hayes + + * config/c4x/c4x.md (all call patterns): Add constraints "Ur". + (call, call_value): Force address into a register if not valid + for a call instruction. + (load_immed_address): Emit a USE of the SYMBOL_REF that is + forced into memory. + * config/c4x/c4x.c (c4x_print_operand): Fix 'C' and 'U' modifiers. + +Tue Feb 9 11:08:41 1999 Michael Hayes + + * config/c4x/c4x.c (call_address_operand, symbolic_address_operand): + Rename from call_operand and symbolic_operand respectively. All + callers changed. + * config/c4x/c4x.md (call_address_operand, symbolic_address_operand): + Likewise. + * config/c4x/c4x.h (call_address_operand, symbolic_address_operand): + Likewise. + (PREDICATE_CODES): Allow CONST, LABEL_REF for call_address_operand. + +Tue Feb 9 10:52:27 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_legitimize_address): Don't generate a + LO_SUM address for HImode or HFmode but instead force address into + a register so that it is offsettable. + (c4x_emit_move_sequence): Handle LO_SUM immediate address. + +Tue Feb 9 10:46:42 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for + REG+REG addressing if strength reduction enabled. + +Tue Feb 9 10:10:31 1999 Michael Hayes + + * config/c4x/t-c4x (LIBGCC2_CFLAGS): Delete. + (TARGET_LIBGCC2_CFLAGS): Define. + +1999-02-08 Nick Clifton + + * config/v850/v850.md: Replace \\n\\t with \\; + + * config/v850/v850.md: Enforce TARGET_LONG_CALLS option. + * config/v850/v850.c (construct_restore_jr, construct_save_jarl): + Enforce TARGET_LONG_CALLS option. + +Mon Feb 8 11:43:07 1999 Donn Terry + + * real.c (PUT_REAL) [XFmode]: Zero the balance of the structure. + +Mon Feb 8 11:37:24 1999 Marc Espie (espie@cvs.openbsd.org) + + * m88k/t-luna-gas: Remove bash dependency. + +Mon Feb 8 11:34:44 1999 Graham + + * collect2.c (xrealloc): Fix typo in last change. + +Mon Feb 8 09:13:38 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Feb 7 22:18:42 1999 Robert Lipe + + * tree.h (TYPE_CHECK): Make it clear to the preprocessor + that we do not want macro replacement within a character constant. + (TYPE_CHECK1): Likewise. + +Sun Feb 7 15:37:10 1999 Jason Merrill + + * tree.h (DECL_P): New macro. + +Sun Feb 7 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Feb 6 18:14:46 1999 Jeffrey A Law (law@cygnus.com) + + * mn10300.md (reload_insi): Do not earlyclobber the output operand. + + * README.g77, gcc.c, gcc.texi: Update email addresses. + * invoke.texi system.h: Likewise. + +Sat Feb 6 11:04:08 1999 Jim Wilson + + * unroll.c (find_splittable_givs): After express_from, call replace_rtx + to convert dest_reg to new_reg. + +Sat Feb 6 10:31:35 1999 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_combine_note_store): Be more careful with + STRICT_LOW_PART, ZERO_EXTRACT and SIGN_EXTRACT. + (move2add_note_store): Likewise. + +Sat Feb 6 10:18:01 1999 Kaveh R. Ghazi + + * cppfiles.c (read_and_prescan): Cast the result of `xrealloc' to + U_CHAR* when assigning to one. Ensure the values of a ?: operator + have the same type. + + * cppinit.c (initialize_char_syntax): Use K&R function definition. + +Sat Feb 6 11:17:03 1999 Richard Earnshaw + + Support for ARM9 + * config/arm/arm.c (all_procs): Add arm9 and arm9tdmi. + * config/arm/arm.h ((TARGET_CPU_arm9, TARGET_CPUD_arm9tdmi): Define. + (TARGET_CPU_DEFAULT): Rework to support ARM9. + (CPP_CPU_ARCH_SPEC): Likewise. + (enum processor_type): Likewise. + * config/arm/arm.md (attr cpu): Add arm9. + + General scheduling changes + * config/arm/arm.c (MAX_INSNS_SKIPPED): Delete. + (max_insns_skipped): New variable. + (arm_override_options): If generating hard floating point code for + the FPA, emit code for version 3. + When optimizing for space, don't synthesize constants. + Reword several flags based on the requested processor and optimization + level. + (use_return_insn): New argument iscond, all callers changed. Don't + use a return insn if it will be conditional and that would be + expensive; eg on StrongARM. + (arm_adjust_cost): Anti- and output- dependencies normally have no + cost. + (load_multiple_sequence): Newer ARMs don't benefit from ldm if + the sequence is short. + (final_prescan_insn): Use max_insns_skipped instead of + MAX_INSNS_SKIPPED. Note whether we will make a return instruction + conditional, and aviod this if it would be expensive. + * config/arm/arm.md (scheduling attributes and function units): + Rewrite to better describe ARM8, 9 and StrongARM. + + * config/arm/arm.md (*movhi_insn_littleend): Make op0 predicate + s_register_operand. + (*ifcompare_plus_move): Use arm_rhs_operand in place of + arm_rhsm_operand. Rework constraints. + (*if_plus_move): Likewise. + (*ifcompare_move_plus): Likewise. + (*if_move_plus): Likewise. + (*ifcompre_arith_move): Likewise. + (*if_arith_move): Likewise. + (*ifcompare_move_arith): Likewise. + (*if_move_arith): Likewise. + + * config/arm/xm-netbsd.h: Don't include arm/xm-arm.h. + +1999-02-05 Michael Meissner + + * loop.c (check_dbra_loop): A store using an address giv for which + we have no life information is not reversible. + +Fri Feb 5 17:08:01 1999 Dave Brolley + + * function.c (fixup_var_refs): Scan catch_clauses too. + +Fri Feb 5 11:49:49 1999 Benjamin Kosnik + + * c-common.c (decl_attributes): Fix reserved space for init_priority. + * tree.h (MAX_RESERVED_INIT_PRIORITY): New macro. + +Fri Feb 5 12:37:05 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (strength_reduce): Clear not_every_iteration when + passing the NOTE_INSN_LOOP_CONT note. + + * haifa-sched.c (add_dependence): Do not add a dependency on a + note. + +Fri Feb 5 10:55:43 1999 Nick Clifton + + * recog.c (split_block_insns): Only call update_flow_info if + instruction scheduling is enabled. + +1999-02-05 Zack Weinberg + + * Makefile.in (gen-protos): Use libcpp.a like everyone else. + +Fri Feb 5 07:09:29 1999 J"orn Rennecke + + * loop.c (first_loop_store_insn): New file-scope variable. + (prescan_loop): Set it. + (check_dbra_loop): Check if a store depends on a register + that is set after the store. + +Fri Feb 5 06:55:15 1999 J"orn Rennecke + + * unroll.c (entire file): Remove tabs / spaces at end of lines. + Replace spaces with tabs where appropriate. + +Thu Feb 4 15:12:41 1999 J"orn Rennecke + + * loop.c (scan_loop): New argument loop_cont. Changed caller. + (strength_reduce): New argument loop_cont. Changed caller. + Before clearing not_every_iteration after a label, check if + we are not already past LOOP_CONT. + +1999-02-04 Zack Weinberg + + * cpperror.c (cpp_print_containing_files): Fix formatting + bug induced by merge. + +1999-02-04 Zack Weinberg + + * cpplib.c (initialize_char_syntax): Move to cppinit.c. + (cpp_define): Remove redundant syntax checks. + (make_assertion): Rename cpp_assert, remove redundant syntax + checks, export. + (cpp_options_init): Don't init things to zero twice. + (cpp_expand_to_buffer): Use memcpy, not a char-by-char loop. + (do_include): Kill excessively verbose #import warning that + snuck back in in the gcc2 merge. + (convert_string): Removed. + (do_line): Rewrite with simple last-name-used cache instead of + private hashtable. + (cpp_start_read): Call initialize_char_syntax here, not... + (cpp_reader_init): ...here. + (cpp_handle_options): Support the -std switch. + * cpplib.h (cpp_buffer): Add last_nominal_fname member. + (cpp_options): Add c9x flag. + Declare all the is_* tables and trigraph table here, as const. + Prototype cpp_assert and initialize_char_syntax. + * cppinit.c: New file. + * cppfiles.c (read_and_prescan): Optimize. + * Makefile.in (LIBCPP_OBJS): Add cppinit.o. + +Thu Feb 4 10:46:30 1999 Gavin Romig-Koch + + * config/mips/mips.md ([u]divmodsi4,[u]divmoddi4,[u]divsi3,[u]divdi3, + [u]modsi3,[u]moddi3) : Don't copy the "zero" argument to a register + before calling gen_div_trap. + +Wed Feb 3 21:56:27 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa1.1-*-*, hppa2*-*): Use symbolic value rather + than numeric value for target_cpu_default.. + * configure: Rebuilt. + +Wed Feb 3 21:55:56 1999 Marc Espie + + * Makefile.in (xgcc$(exeext)): Remove choose-temp, pexecute and + mkstemp. Get them from libiberty. + (COLLECT2_OBJS): Similarly for choose-temp, cplus-dem and mkstemp. + (PROTO_OBJS): Similarly for choose-temp, getopt, getopt1 and pexecute. + (cplus-dem.o, pexecute.o, choose-temp.o): Remove build rules. + (mkstemp.o, getopt1.o, getopt.o): Likewise. + + * pa-gas.h (TARGET_DEFAULT): Use symbolic values rather than numeric + values. + * pa-hpux.h (LINK_SPEC): Likewise. + * pa-hpux10.h (LINK_SPEC): Likewise. + * pa-hpux9.h (LINK_SPEC): Likewise. + * pa-osf.h (LINK_SPEC): Likewise. + * pa-pro.h (TARGET_DEFAULT): Likewise. + * pa1.h (TARGET_DEFAULT): Likewise. + * pa.h (MASK_*): New defines. + (TARGET_*): Use symbolic values rather than numeric values. + (TARGET_SWITCHES): Likewise. + (TARGET_DEFAULT): Likewise. + (CPP_SPEC): Likewise. + +Wed Feb 3 21:07:38 1999 Bernd Schmidt + + * reload1.c (reload_cse_regs_1): Undo Jan 16 patch. + * reload.c (find_reusable_reload): New function, broken out of + push_reload. Add code to verify that none of the involved + outputs are subject to earlyclobbers. + (push_reload): Break out new function find_reusable_reload. + Delete "register" keyword for IN, OUT args. + +Wed Feb 3 15:51:04 1999 Gavin Romig-Koch + + * config/mips/mips.c (true_reg_or_0_operand) : New function. + * config/mips/mips.h (PREDICATE_CODES): Add true_reg_or_0_operand. + * config/mips/mips.md (div_trap,div_trap_normal,div_trap_mips16): + Use true_reg_or_0_operand for div_trap. + +Wed Feb 3 20:44:59 1999 J"orn Rennecke + + * loop.h (express_from): Declare. + (struct induction): Replace derived flag with derived_from pointer. + * loop.c (strength_reduce, record_giv, recombine_givs): Likewise. + (express_from): No longer static. + * unroll.c (find_splittable_givs): Replace derived with derived_from. + When processing an address giv with which another giv has been + combined that has also been derived from a third giv, handle like + having combined with the third giv. + Set splittable_regs_updates appropriately for derived givs. + +Wed Feb 3 15:26:58 1999 Gavin Romig-Koch + + * config/mips/mips.md (div_trap_mips16): Remove nop's after branches. + +Wed Feb 3 11:56:23 1999 Jeffrey A Law (law@cygnus.com) + + * pa.c (insn_sets_and_refs_are_delayed): New function. + * pa.h (INSN_SETS_ARE_DELAYED): Use it. + (INSN_REFERENCES_ARE_DELAYED): Likewise. + +Wed Feb 3 06:24:49 1999 Richard Earnshaw (rearnsha@arm.com) + + * config/arm/t-arm-elf (LIBGCC2_CFLAGS): Delete. + * config/arm/t-linux (LIBGCC2_CFLAGS): Delete. + (TARGET_LIBGCC2_CFLAGS): Define. + (LIBGCC2_DEBUG_CFLAGS): Define. + * config/arm/t-netbsd: Likewise. + * config/arm/t-semi: Likewise. + * config/arm/t-semiaof: Likewise. + * config/arm/t-riscix: Likewise. + +Wed Feb 3 10:59:07 1999 Andreas Schwab + + * config/m68k/m68k.c (print_operand_address): When printing a + SYMBOL_REF that ends in `.' put parentheses around it. + +Tue Feb 2 23:38:35 1999 David O'Brien + + * i386/freebsd*.h now allows '$' in label names and does not use the + PCC struct return method. + +Tue Feb 2 22:38:23 1999 Jim Wilson + + * Makefile.in: Change all uses of AR to AR_FOR_TARGET. Change all uses + of HOST_AR to AR. Likewise for AR_FLAGS, RANLIB, and RANLIB_TEST. + (RANLIB_TEST): Test to see if ranlib exists. Only test absolute file + names if host == target. + (HOST_AR, HOST_AR_FLAGS, HOST_RANLIB, HOST_RANLIB_TEST): Delete. + (AR_FLAGS_FOR_TARGET): Renamed from AR_FOR_TARGET_FLAGS. + (AR, AR_FLAGS, OLDAR, OLDAR_FLAGS, RANLIB, RANLIB_TEST): Delete rules + setting them to *_FOR_TARGET. + * cross-make (AR, AR_FLAGS, OLDAR, OLDAR_FLAGS, RANLIB, RANLIB_TEST): + Delete. + +Tue Feb 2 22:38:19 1999 Theodore Papadopoulo + + * toplev.h (read_integral_parameter): Declare. + * toplev.c (read_integral_parameter): New function. + +Fri Jan 29 21:00:56 1999 Bob Manson + + * resource.c, resource.h: New files. + * Makefile.in (OBJS): Add it. + + * haifa-sched.c (regno_use_in): Moved to rtlanal.c. + (split_block_insns): Moved to recog.c. + (update_flow_info): Make public. + * rtl.h: Declare them. + + * reorg.c: Moved the functions dealing with computing resource + usage to resource.c. + + * sched.c (regno_use_in): Moved to rtlanal.c. + (update_flow_info): Make public. + (schedule_insns): Use split_block_insns. + + * recog.c (split_block_insns): New function. + +Tue Feb 2 22:03:26 1999 David Edelsohn + + * rs6000/linux.h (LINK_START_DEFAULT_SPEC): Delete, unused. + (LINK_OS_DEFAULT_SPEC): Delete, unused. + +Tue Feb 2 20:29:34 1999 Catherine Moore + + * configure.in (arm-*-oabi): Support. + * configure: Regenerate. + * config/arm/unknown-elf-oabi.h: New file. + +Tue Feb 2 19:43:59 1999 Jeffrey A Law (law@cygnus.com) + + * i386.md (ashlsi3): Turn into a define_expand an anonymous pattern. + Make the anonymous pattern match when ! optimize_size. + (ashlsi3 size optimizer): New pattern. + + * intl/Makefile.in (uninstall): Add missing "; \". + +Tue Feb 2 18:21:23 1999 Stan Cox + + * sparc.h (TARGET_CPU_sparc86x): Added. TARGET_CPU_sparclite86x + synonym. + +Tue Feb 2 20:24:11 1999 J"orn Rennecke + + * loop.c (loop_optimize): Fix value max_uid_for_loop is reset + to after find_and_verify_loops call. + +Tue Feb 2 19:48:29 1999 J"orn Rennecke + + * (recombine_givs): Don't use a giv that's likely to be dead to + derive others. + + * loop.c (recombine_givs): Fix test for lifetime overlaps / loop + wrap around when deriving givs. + +Mon Feb 1 20:00:40 1999 Richard Henderson + + * recog.c (check_asm_operands): Treat indeterminate operand ok + results as success. Try harder to resolve a matching constraint. + * stmt.c (expand_asm_operands): Recognize when an output operand's + constraint does not allow memory. Treat indeterminate operand ok + results as failure. Try harder to resolve a matching constraint. + +Mon Feb 1 15:00:02 1999 Ken Raeburn + + Use varrays for constant-equivalence data: + + * varray.h (struct const_equiv_data): New type. + (union varray_data_tag): New element const_equiv. + (VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros. + (VARRAY_SIZE): New macro, returns number of elements. + * integrate.h: Include varray.h. + (struct inline_remap): Replace const_equiv_map, const_age_map and + const_equiv_map_size with a const_equiv_varray element. + (MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if + needed. + (SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields + simultaneously, growing the varray if needed. + + * integrate.c (global_const_equiv_map, + global_const_equiv_map_size): Deleted, replaced by.... + (global_const_equiv_varray): New variable. + (expand_inline_function): References changed. + * integrate.h: Update declarations. + + * integrate.c (process_reg_parm, expand_inline_function, + copy_rtx_and_substitute, try_constants, subst_constants, + mark_stores): Use varray allocation and accessor macros, new + integrate.h macros, and global_const_equiv_varray. Don't + conditionalize non-NULL stores on array size; instead, expand the + array as needed. + * unroll.c (unroll_loop): Likewise. + + * unroll.c (unroll_loop): Initialize const_equiv_varray element to + zero. After allocating varray, always exit through bottom of + function, where it can be deallocated if needed. Don't explicitly + reallocate const_equiv_map storage; instead, just ensure the + varray has been initialized, and update the global reference. + +Mon Feb 1 09:40:25 1999 Kaveh R. Ghazi + + * system.h (inline, const): Handle these for stage2 (and later) gcc. + + * dwarf2out.c (inline): Don't define. + + * dwarfout.c (inline): Likewise. + +Sun Jan 31 22:04:37 1999 Richard Henderson + + * loop.c (recombine_givs): Dump recombination and derivation data. + +Sun Jan 31 20:34:29 1999 Zack Weinberg + + * flags.h: Declare flag_no_ident. + * toplev.c: Define flag_no_ident. Process -f(no-)ident here. + * c-tree.h: Don't declare flag_no_ident. + * c-decl.c: Don't define flag_no_ident. Don't process + -f(no-)ident switches here. + + * config/elfos.h (ASM_FILE_END): Output final .ident directive + only if !flag_no_ident. + * config/ptx4.h: Likewise. + * config/svr4.h: Likewise. + * config/alpha/elf.h: Likewise. + * config/arm/linux-elf.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/i860/fx2800.h: Likewise. + * config/mips/gnu.h: Likewise. + * config/i386/osfrose.h: Likewise. + + * gcc.c (C specs): Map -Qn to -fno-ident. + * objc/lang-specs.h: Likewise. + +Mon Feb 1 10:52:07 1999 Michael Hayes + + * configure.in: Don't remove loop.o and unroll.o when + enable-haifa is selected. + * configure: Rebuilt. + +Sun Jan 31 13:22:02 1999 John Wehle (john@feith.com) + + * i386.md (movsicc, movhicc, movsfcc, movdfcc, + movxfcc, movdicc): Delete unconstrained alternatives. + * i386.c (output_fp_conditional_move, + output_int_conditional_move): Delete unused case. + +Sun Jan 31 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Jan 31 00:52:37 1999 Richard Henderson + + * alpha.md (mov patterns): Emit the assembler aliases mov and fmov + instead of bis and cpys. Combine alternatives where possible. + +Sat Jan 30 23:14:13 1999 Kaveh R. Ghazi + + * gcov.c (fnotice): Add missing FILE* parameter. + (function_summary): Fix format specifiers in calls to `fnotice'. + (output_data): Likewise. + + * toplev.c (fnotice): Constify char* parameter. + + * toplev.h (fnotice): Add prototype. + Wrap prototype with BUFSIZ to protect FILE* usage. + +Sun Jan 31 15:33:09 1999 Michael Hayes + + * config/c4x/c4x.h (RTX_COSTS): Explicitly define c4x costs. + +Sat Jan 30 08:27:23 1999 Jeffrey A Law (law@cygnus.com) + + * combine.c (distribute_notes): Handle REG_EH_REGION notes. + + * alias.c (fixed_scalar_and_varying_struct_p): Add "static" to + function definition. + (aliases_everything_p, write_dependence_p):Likewise. + + * install.texi: Fix merge lossages. + + * cccp.c (main): Only call setlocale (LC_MESSAGES, ...) if LC_MESSAGES + is defined. + * collect2.c (main): Likewise. + * cppmain.c (main): Likewise. + * gcc.c (main): Likewise. + * gcov.c (main): Likewise. + * protoize.c (main): Likewise. + * toplev.c (main): Likewise. + + * pa.md (parallel shift and shiftadd): Mark output of shift as an + earlyclobber. + + * loop.c: Disable recent loop changes. Temporary as Joern + continues to fix problems. + +Sat Jan 30 03:24:37 1999 J"orn Rennecke + + * loop.c (strength_reduce): Size reg_map according to reg_iv_type. + +Fri Jan 29 18:26:07 1999 Dave Brolley + + * emit-rtl.c (remove_insn): New function. + * rtl.h (remove_insn): Add prototype. + * function.c (reposition_prologue_and_epilogue_notes): Call remove_insn. + +Fri Jan 29 22:34:41 1999 J"orn Rennecke + + * loop.c (recombine_givs): Don't try to derive givs that have combined. + +Fri Jan 29 15:00:39 1999 Kaveh R. Ghazi + + * toplev.c (notice, fnotice): Check ANSI_PROTOTYPES, not __STDC__, + when declaring arguments and calling va_arg() to initialize them. + + * collect2.c (notice): Likewise. + + * loop.c (find_life_end): Use PROTO() macro in the prototype. + +Fri Jan 29 14:36:11 1999 Kaveh R. Ghazi + + * collect2.c (error): Fix typo in declaration. + + * cpperror.c (cpp_message): Likewise. + + * cpplib.c (cpp_warning): Likewise. + + * cpplib.h (cpp_notice): Use PVPROTO not VPROTO, also add + ATTRIBUTE_PRINTF_1. + + * toplev.c (error): Fix typo in declaration. + +Fri Jan 29 15:44:13 1999 J"orn Rennecke + + * loop.c (strength_reduce): Fix HAVE_cc0 handling when scanning + forward from cont dominator. + +Fri Jan 29 07:10:27 1999 Kaveh R. Ghazi + + * cccp.c (eprint_string): Constify a char*. + (notice): Likewise. Use PVPROTO not VPROTO, add ATTRIBUTE_PRINTF_1. + (vnotice): Constify a char*. + (error): Likewise. Use PVPROTO not VPROTO, add ATTRIBUTE_PRINTF_1. + (verror): Constify a char*. + (warning): Likewise. Use PVPROTO not VPROTO, add ATTRIBUTE_PRINTF_1. + (vwarning): Constify a char*. + (error_with_line): Likewise. Use PVPROTO not VPROTO, add + ATTRIBUTE_PRINTF_2. + (verror_with_line): Constify a char*. + (vwarning_with_line): Likewise. + (warning_with_line): Likewise. Use PVPROTO not VPROTO, add + ATTRIBUTE_PRINTF_2. + (pedwarn): Constify a char*. Use PVPROTO not VPROTO, add + ATTRIBUTE_PRINTF_1. + (pedwarn_with_line): Likewise with ATTRIBUTE_PRINTF_2. + (pedwarn_with_file_and_line): Likewise with ATTRIBUTE_PRINTF_4. + Also correct typo in parameter name declaration. + (make_assertion): Constify a char*. + (quote_string_for_make): Likewise. + (deps_output): Likewise. + (fatal): Likewise. Use PVPROTO not VPROTO, add + ATTRIBUTE_PRINTF_1. Use ATTRIBUTE_NORETURN not an explicit + "__attribute__ ((noreturn))". + (fancy_abort): Likewise for ATTRIBUTE_NORETURN. + (pfatal_with_name): Likewise. + (pipe_closed): Likewise. + (memory_full): Likewise. + +Fri Jan 29 00:14:55 1999 J"orn Rennecke + + * loop.c (strength_reduce): Grow set_in_loop / n_times_set / + may_not_optimize to proper size when converting biv increments + into givs. + If necessary, reallocate reg_iv_type / reg_iv_info before calling + recombine_givs. + +Thu Jan 28 23:24:08 1999 J"orn Rennecke + + * loop.c (recombine_givs): New parameter unroll_p. If set, don't + generate complex adds. Changed caller. + Don't generate adds that cost more than the original one. + (strength_reduce): Warning fixes. + +Thu Jan 28 09:41:11 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa1.0-hp-hpux10*): Use t-pa. + * configure: Rebuilt. + +Wed Jan 27 23:39:53 1999 J"orn Rennecke + + * rtl.h (insn_first_p, no_jumps_between_p): Declare. + * rtlanal.c (insn_first_p, no_jumps_between_p): New function. + * loop.h (varray.h): Include. + (struct induction): Change combined_with to unsigned. + New members derived, ix and last_use. + (reg_iv_type, reg_iv_info): Now varray_type. All references changed. + (REG_IV_TYPE, REG_IV_INFO): Define. + (first_increment_giv, last_increment_giv): Declare. + * loop.c (loop_number_loop_cont): New static variable. + (loop_number_cont_dominator): Likewise. + (reg_iv_type, reg_iv_info): Now varray_type. + (first_increment_giv, last_increment_giv): New variables. + (compute_luids, verify_dominator, find_life_end): New functions. + (cmp_recombine_givs_stats, recombine_givs): Likewise. + (loop_optimize): Allocate loop_number_loop_cont and + loop_number_cont_dominator. Use compute_luids. + (find_and_verify_loops): Initialize loop_number_loop_cont and + loop_number_cont_dominator. + (strength_reduce): Try to find bivs that can be expressed as givs + of another biv, and to convert biv increments into givs. + Call recombine_givs. Handle derived givs. + (record_biv): New argument location. All callers changed. + (record_giv): Initialize derived and last_use fields. + (basic_induction_var): New argument location. All callers changed. + (combine_givs): Don't combine a DEST_REG giv with a DEST_ADDR giv. + Increment combined_with instead of setting to 1. + * unroll.c (derived_regs): New static variable. + (unroll_loop): Initialize it. + Allocate local_regno according to max_reg_num. + (copy_loop_body): Cope with derived givs. + (find_splittable_givs): Check for Givs made from biv increments. + Set derived_regs for givs. + * Makefile.in (stmt.o, loop.o, unroll.o): Depend on loop.h . + +Wed Jan 27 19:31:36 1999 J"orn Rennecke + + * function.c (purge_addressof_1): Handle case when a register + has been used in a wider mode. + +1999-01-27 Bruce Korb + + * fixinc/fixincl.c, fixinc/server.[ch]: + Removed the last of the capitalized variable and proc names. + + * fixinc/server.c: Removed the process open code. + * fixinc/procopen.c: New file containing the proc open code. + * fixinc/inclhack.tpl: Added code to bypass a readability test + when a file is not present. A problem on some systems. + * fixinc/inclhack.sh, fixinc/fixincl.sh: Regenerated. + +Wed Jan 27 11:58:18 1999 Dave Brolley + + * cpplib.h (cpp_notice): Add prototype. + +Wed Jan 27 02:20:48 1999 Jeffrey A Law (law@cygnus.com) + + * Merge gcc2 snapshot 19980929. + + * cccp.c (PRINTF_PROTO): Remove. + (PRINTF_PROTO_{1,2,3,4}: Likewise. + * cexp.y: Likewise. + * system.h: Add PRINTF_PROTO and PRINTF_PROTO_{1,2,3,4}. + + * fix-header.c (cpp_file_lin_for_message): Delete. In libcpp. + (cpp_print_containing_files, v_cpp_message, cpp_message): Likewise. + (cpp_fatal, cpp-Pfatal_with_name): Likewise. + + * gen-protos.c (hashf): Delete in cpphash.o. + * gen-protos.c (hashf): Delete in cpphash.o. + + * expr.c: Do not merge SAVE_STACKAREA_MODE changes. + * expmed.c: Likewise. + * rs6000.md: Likewise. + + * rs6000.c, rs6000.md: Do not merge formatting changes yet. + +Wed Jan 27 01:13:42 1999 Richard Henderson + + * rs6000.c (input_operand): Don't expect CONST around CONSTANT_P_RTX. + * rs6000.md (movsi, movdi): Likewise. + +Tue Jan 26 13:31:38 1999 Jim Wilson + + * function.c (expand_function_end): Pass arg_pointer_save_area to + validize_mem before using it. Emit code into a sequence. + +Tue Jan 26 13:41:38 1999 David Edelsohn + + * rs6000.md (doz + set cr and or + set cr patterns): Add missing + '#' to split patterns. Correct indentation of some new patterns. + +1999-01-26 Zack Weinberg + + * cppfiles.c (safe_read): Deleted. + (read_and_prescan): New function, replaces safe_read, converts + and/or warns about trigraphs, silently converts odd line + terminators (\r, \n\r, \r\n). Warns about no newline at EOF. + (finclude): Use read_and_prescan; turn off nonblocking mode on + the input descriptor; remove file-size-examination and + no-newline-at-EOF gunk which is longer necessary; be more + careful about checking that we've been handed a legitimate + file to read (only real files, pipes, and ttys are acceptable). + * cpplib.h (cpp_options): Rename no_trigraphs flag to + `trigraphs' and invert its sense. + (trigraph_table): Declare. + (cpp_warning_with_line): Prototype. + * cpplib.c: Remove all references to trigraph_pcp. Define + trigraph_table; initialize it in initialize_char_syntax. Open + files in nonblocking mode. s/no_trigraphs/trigraphs/ + throughout, and invert sense. Put cpp_warning_with_line back + in and export it. + +Tue Jan 26 23:21:49 1999 Michael Hayes + + * config/c4x/c4x.h (COUNTER_REGS): New register class. + * config/c4x/c4x.md (*rptb_init): Change constraints. + (rptb_end): Emit alternate looping instructions if + RC register not allocated for loop counter. + (decrement_and_branch_on_count): Allow other registers + for loop counter. + +1999-01-25 Zack Weinberg + + * cppexp.c (struct arglist): Removed. + (parse_number): Use HOST_WIDE_INT for the accumulator. + Allow two `l' suffixes unless C89. Clean up. Make static. + (parse_charconst): New function broken out of cpp_lex. + Code cleaned up drastically. Don't use a token_buffer. + (token_buffer): Removed. + (cpp_lex): Don't call parse_number on a constant string. + Use parse_charconst. + (cpp_parse_expr): Properly handle an ERROR op returned by + cpp_lex. + +1999-01-25 Zack Weinberg + + * cpplib.c: Don't include signal.h, sys/times.h, or + sys/resource.h. Don't declare localtime. + (macroexpand): Handle special symbols here. + (push_macro_expansion): Chop off the trailing '@ ' if possible + here. + (cpp_get_token): Don't do either of the above two things here. + Move `string' label just after case '"' so that wide strings + don't crash the preprocessor. + +Sun Jan 24 20:13:45 1999 David Edelsohn + + * rs6000.md (left shift + set cr patterns): Add missing '#' to + split patterns. + (move register + set cr pattern): Likewise. + (movdi, !TARGET_POWERPC64 splitters): Add back in Jan. 15th patch, + inadvertently deleted. + +Sun Jan 24 08:07:59 1999 Jeffrey A Law (law@cygnus.com) + + * stmt.c (stmt_loop_nest_empty): New function. + * tree.h (stmt_loop_nest_empty): Declare it. + * rtl.def (CALL_PLACEHOLDER): New rtx code. + +Sun Jan 24 21:24:43 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_emit_move_sequence, c4x_encode_section_info): + New functions. + (c4x_check_legit_addr): Remove USE and PLUS, allow + LO_SUM, and disable SYMBOL_REF, LABEL_REF, and CONST cases. + (c4x_legitimize_address): Penalize SYMBOL_REF, LABEL_REF, and + CONST cases. Add LO_SUM. + (c4x_print_operand): Modified 'C' and 'R' cases for calls. + Added 'U' case. Remove dependence on SYMBOL_REF_FLAG. + (c4x_print_operand_address): Handle LO_SUM. + (c4x_scan_for_ldp): Delete. Hooray! + (c4x_process_after_reload): Remove call to c4x_scan_for_ldp. + Split all insns. + (c4x_immed_int_constant): Renamed from c4x_int_constant. All callers + changed. + (c4x_immed_float_constant): Renamed from c4x_float_constant. All + callers changed. + (c4x_T_constraint): Allow LO_SUM, disable SYMBOL_REF, LABEL_REF, + and CONST. + (c4x_U_constraint, symbolic_operand): New functions. + (src_operand): Allow 'I' constants in HImode. Allow LO_SUM, + disable SYMBOL_REF, LABEL_REF, and CONST. + (lsrc_operand, tsrc_operand): Call src_operand instead of + general_operand. + (c4x_operand_subword): Update comments. + + * config/c4x/c4x.c (TARGET_LOAD_ADDRESS): New macro. + (LEGITIMATE_CONSTANT_P): Allow SYMBOL_REF, LABEL_REF, CONST, + plus HIGH and LO_SUM for the C40. + (ENCODE_SECTION_INFO): Define macro. + (symbolic_operand, c4x_U_constraint, c4x_emit_move_sequence): New + prototypes. + (PREDICATE_CODES): Add symbolic_operand. + + * config/c4x/c4x.md (movqi, movgqf, movhi, movhi): Call + c4x_emit_move_sequence. + (floatunsqiqf2, fixuns_truncqfqi2): Rework emitted RTL + to avoid symbol references. + (all patterns with g constraint): Replace 'g' constraint with 'rIm'. + (set_high): Renamed from set_high_use. + (set_lo_sum): Renamed from set_ior_lo_use. + (all call patterns): Make MEM explicit in call address operands. + Modified output templates to use 'U' modifier. + +Sun Jan 24 01:15:05 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Jan 23 22:34:57 1999 Kaveh R. Ghazi + + * final.c (bb_str): Qualify a char* with the keyword `const'. + (add_bb_string, final_scan_insn, output_asm_insn): Likewise. + + * fix-header.c (read_scan_file): Likewise. + + * genoutput.c (output_epilogue, process_template): Likewise. + + * local-alloc.c (requires_inout, block_alloc): Likewise. + + * output.h (output_asm_insn, assemble_string): Likewise. + + * recog.c (recog_constraints, check_asm_operands, + decode_asm_operands, extract_insn, preprocess_constraints, + constrain_operands): Likewise. + + * recog.h (operand_alternative, recog_constraints, insn_template, + insn_outfun, insn_operand_constraint, insn_name): Likewise. + + * regclass.c (record_reg_classes, scan_one_insn): Likewise. + + * regmove.c (find_matches): Likewise. + + * reload.c (alternative_allows_memconst): Likewise. + + * reload1.c (constraint_accepts_reg_p, + reload_cse_simplify_operands): Likewise. + + * rtl.h (decode_asm_operands): Likewise. + + * scan.h (fn_decl): Likewise. + + * varasm.c (assemble_string): Likewise. + +Sat Jan 23 01:37:36 1999 Jeffrey A Law (law@cygnus.com) + + * configure.in (gcc_tooldir): Handle case where exec_prefix has + not been explicitly set. + * configure: Rebuilt. + + * fold-const.c (lshift_double): Mark 'prec' arguments as possibly + unused. + + * bitmap.h (bitmap_head_def): Make indx field unsigned. + + * configure.in (gcc_tooldir): When not making a relative gcc_tooldir, + use $exec_prefix/$target_alias for gcc_tooldir. + * configure: Rebuilt. + +Fri Jan 22 11:48:56 1999 Richard Henderson + + * cppp.c (xrealloc): Fix typo last change. + * cppalloc.c, gcc.c, genattr.c, genattrtab.c, gencodes.c: Likewise. + * genconfig.c, genemit.c, genextract.c, genflags.c: Likewise. + * genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise. + +1999-01-22 Michael Meissner + + * rs6000.h (CR0_REGNO_P): New macro to test if cr0. + (CR_REGNO_NOT_CR0_P): New macro to test if cr, but not cr0. + (PREDICATE_CODES): Add cc_reg_not_cr0_operand. + (cc_reg_not_cr0_operand): Add declaration. + + * rs6000.c (cc_reg_not_cr0_operand): Return true if register is a + pseudo register, or a control register that is not CR0. + + * rs6000.md (all combiner patterns building . instructions): For + all `.' instructions that do something and set cr0, add an + alternative that does the operation, and then sets a different + flag, in order to avoid using the costly mcrf instruction and also + allow cr0 to be clobbered in asm statements. Also fix a few + patterns that used the wrong register. + + * rs6000.h (rs6000_cpu_select): Make string, names be const char *. + (rs6000_debug_name): Make const char *, not char *. + + * sysv4.h (rs6000_{abi,sdata}_name): Make const char *. + + * rs6000.c (rs6000_{debug,abi,sdata}_name): Make const char *. + (rs6000_select): Use const char * in casts. + +Fri Jan 22 07:43:01 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (gcc_tooldir): Move before first reference. + Let autoconf substitute in a value. + * configure.in (gcc_tooldir): Only use a relative path to the + tool directory if $exec_prefix == $prefix. + * configure: Rebuilt. + + * Makefile.in (tooldir): Replace with gcc_tooldir. + +Thu Jan 21 23:21:57 1999 Jeffrey A Law (law@cygnus.com) + + * m68k.md (ashldi_const): Disable for !TARGET_5200. Fix indentation. + (ashldi3 expander): Similarly. Update comments. + (ashrdi_const, lshrdi_const): Fix indentation. + (ashrdi3, lshrdi3): Fix indentation. Update comments. + +Thu Jan 21 21:53:36 1999 Richard Henderson + + * emit-rtl.c (try_split): Don't try to split non-instructions. + +Thu Jan 21 23:47:30 1999 Andrew MacLeod + + * expr.c (emit_push_insn): Fix dumb typo. + +Thu Jan 21 20:24:02 1999 Richard Henderson + + * rs6000.h (LEGITIMIZE_RELOAD_ADDRESS): Recognize and accept + transformations that we have performed earlier. + * alpha.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise. + + * alpha.md (prologue_stack_probe_loop): Don't do our own label + handling, call gen_label_rtx instead. + +Thu Jan 21 17:45:18 1999 Richard Henderson + + * configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): Add missing `then'. + + * cccp.c (xrealloc): Call malloc given a NULL old pointer. + * collect2.c, cppalloc.c, gcc.c, genattr.c, genattrtab.c: Likewise. + * gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise. + * genflags.c, genopinit.c, genoutput.c, genpeep.c: Likewise. + * genrecog.c, mips-tfile.c, protoize.c: Likewise. + +Thu Jan 21 19:44:55 1999 Michael Meissner + + * configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): If + --with-gnu-ld, use x-aix41-gld instead of x-aix41 to suppress + adding -Wl,-bbigtoc to BOOT_LDFLAGS. + * configure: Regenerate. + + * config/rs6000/x-aix41-gld: New file, don't set BOOT_LDFLAGS. + +Thu Jan 21 15:48:03 1999 Dave Brolley + + * cppexp.c (cpp_lex): Allocate token_buffer dynamically. + +Thu Jan 21 14:18:04 1999 Andrew MacLeod + + * expr.c (MOVE_BY_PIECES_P): Define condition for deciding to use + move_by_pieces. + (MOVE_MAX_PIECES): Define maximum number of bytes to move at once. + (USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_DECREMENT): Define defaults. + (USE_STORE_POST_INCREMENT, USE_STORE_PRE_DECREMENT): Define defaults. + (move_by_pieces): Use new macros. + (emit_block_move): Use new macros. + (clear_by_pieces): Use new macros. + (clear_storage): Use new macros. + (emit_push_insn): Use new macros. + (expand_expr): Use new macros. + * config/sh/sh.h (USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_DECREMENT): + Define. + (USE_STORE_POST_INCREMENT, USE_STORE_PRE_DECREMENT): Define. + (MOVE_BY_PIECES_P): Define based on alignment and TARGET_SMALLCODE. + (MOVE_MAX_PIECES): Move 8 bytes on SH4. + * tm.texi(MOVE_BY_PIECES_P, MOVE_MAX_PIECES, USE_LOAD_POST_INCREMENT, + USE_LOAD_PRE_DECREMENT, USE_STORE_POST_INCREMENT, + USE_STORE_PRE_DECREMENT): Describe new macros. + +Thu Jan 21 14:13:31 1999 Vladimir N. Makarov + + * varasm.c (output_constant_pool): Use floor_log2 instead of + exact_log2 for ASM_OUTPUT_ALIGN. + + * stor-layout.c (layout_type): Do machine-dependent extra alignment. + + * emit-rtl.c (operand_subword): Handle case when a subword outside + the operand. + + * tm.texi (ROUND_TYPE_{SIZE,ALIGN}): More accurate descriptions of + the macros. + +Thu Jan 21 01:59:30 1999 Richard Henderson + + * cse.c (fold_rtx): Revert 29 Dec change. + (cse_insn): Revert 12 Jan change. + * expr.c (expand_builtin): Don't emit CONST around CONSTANT_P_RTX. + * regclass.c (reg_scan_mark_refs): Revert 29 Dec change. + * rtl.def: Likewise. + * rtl.h (CONSTANT_P): Likewise. + + * expr.c (emit_move_insn): Never try to flush CONSTANT_P_RTX + to memory. + * recog.c (immediate_operand): Accept CONSTANT_P_RTX. + * alpha.c (input_operand): Likewise. + * c4x.c (const_operand): Likewise. + + * explow.c (allocate_dynamic_stack_space): Use register_operand + instead of arith_operand, which does not exist. + + * 1750a.h: Fix comment closure. + * a29k.c (a29k_set_memflags): Fix typo in 19 Jan change. + * arc.md (one_cmplsi2_set_cc_insn): Fix set mode mismatch. + * arm.h (TARGET_SWITCHES): Fix typo. + * i370.md (anon mult and div patterns): Fix set mode mismatch. + * i860.c (output_delayed_branch): Fix operands to constrain_operands. + (output_delay_insn): Likewise. + * m88k.md (anon rotate insns): Fix set mode mismatch. + (anon BLKmode moves): Commonize and fix set mode mismatches. + * ns32k.md (udivmoddi[shq]i4_internal): Fix mode mismatch. + * romp.md (movdf): Fix typo. + +Thu Jan 21 00:29:35 1999 Nathan Sidwell + + * Makefile.in (install-common): Remove extraneous chmod for gcov + install. + +Wed Jan 20 18:15:08 1999 Dave Brolley + + * function.c (assign_parms): Save and restore setting of + TREE_USED (parm). + +Wed Jan 20 12:51:42 1999 Mark Mitchell + + * arm.md: Use MEM_COPY_ATTRIBUTES where appropriate throughout. + Pass MEM_SCALAR_P to arm_gen_store_multiple where appropriate. + +Tue Jan 19 21:20:52 1999 Richard Henderson + + * recog.c (pop_operand): New function. + * recog.h (pop_operand): Declare it. + * genrecog.c (preds): Define it. + + * expr.c (do_jump_for_compare): Handle conditional branch expanders + emitting multiple jump instructions. + * jump.c (condjump_label): New function. + * rtl.h (condjump_label): Declare it. + +Tue Jan 19 21:08:20 1999 Richard Henderson + + * expr.c (emit_move_insn_1): Revert 17 Dec change. Don't emit + clobber during or after reload. + +Tue Jan 19 16:56:03 1999 Richard Henderson + + * genoutput.c (name_for_index): New function. + (scan_operands, validate_insn_alternatives): Use it. + * genrecog.c (insn_name_ptr_size): New variable. + (make_insn_sequence): Fill in insn_name_ptr. + (merge_trees): Use it. + +Tue Jan 19 16:37:36 1999 Richard Henderson + + * i386/isc.h (TARGET_DEFAULT): Define symbolicly. + * i386/isccoff.h, i386/next.h, i386/sco.h, i386/sco5.h: Likewise. + * i386/scodbx.h, i386/sequent.h, i386.unix.h: Likewise. + +Tue Jan 19 15:00:10 1999 Jeffrey A Law (law@cygnus.com) + + * loop.c (NUM_STORES): Delete. + (loop_store_mems): Turn into an EXPR_LIST of MEMs. + (prescan_loop): Properly initialize loop_mems_idx. + (note_addr_stored): Simplify using list structure instead of + fixed sized array. + (invariant_p, check_dbra_loop, load_mems): Similarly. + + * flow.c (invalidate_from_autoinc): New function. + (mark_set_1, mark_used_regs): Use it. + + * Makefile.in (protoize.o, unprotoize.o): Depend on Makefile. + +1999-01-19 Vladimir N. Makarov + + * invoke.texi (-mlong-double-64): New option description. + +1999-01-19 Jim Wilson + + * libgcc2.c: Change all uses of LONG_DOUBLE_TYPE_SIZE to + LIBGCC2_LONG_DOUBLE_TYPE_SIZE. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. Set to LONG_DOUBLE_TYPE_SIZE + if not defined. + * i960/i960.h (MULTILIB_DEFAULTS): Define to mnumerics. + (CPP_SPECS): Add -mlong-double-64 support. + (TARGET_FLAG_LONG_DOUBLE_64, TARGET_LONG_DOUBLE_64): New. + (TARGET_SWITCHES): Add -mlong-double-64 support. + (LONG_DOUBLE_TYPE_SIZE): Likewise. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define. + * i960/vx960-coff.h (MULTILIB_DEFAULTS): Define to msoft-float. + (CPP_SPECS): Add -mlong-double-64 support. + * i960/t-960bare (MULTILIB_OPTIONS): Add mlong-double-64. + (MULTILIB_DIRNAMES): Add ld64. + * i960/t-vxworks960 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Likewise. + +Tue Jan 19 11:54:04 1999 Jason Merrill + + * calls.c (expand_call): Strip a TARGET_EXPR if we're passing by + invisible reference. + +Tue Jan 19 14:51:36 1999 David Edelsohn + + * rs6000.c (offsettable_addr_operand): Delete. + (offsettable_mem_operand): New function. + * rs6000.h (PREDICATE_CODES): Reflect function change. + (RS6000_SAVE_TOC): Represent address as MEM. + * win-nt.h (RS6000_SAVE_TOC): Same. + * rs6000.md (indirect calls): Change offsettable address parameter + to offsettable memory parameter. + +Tue Jan 19 10:24:53 1999 Mark Mitchell + + * rtl.h (rtx_def): Update documentation. + (MEM_IN_STRUCT_P): Likewise. + (MEM_SCALAR_P): New macro. + (MEM_COPY_ATTRIBUTES): Likewise. + (MEM_SET_IN_STRUCT_P): Likewise. + * rtl.texi (MEM_SCALAR_P): Document. + * alias.c (canon_rtx): Use MEM_COPY_ATTRIBUTES. + (fixed_scalar_and_varying_struct_p): New function. Use + MEM_SCALAR_P rather than !MEM_IN_STRUCT_P. + (aliases_everything_p): Likewise. + (true_dependence): Use them. + (write_dependence_p): New function, containing code common to + anti_dependence and output_dependence. + (anti_dependence): Use it. + (output_dependence): Likewise. + * calls.c (save_fixed_argument_area): Don't clear + MEM_IN_STRUCT_P. + (expand_call): Use MEM_SET_IN_STRUCT_P. + (emit_library_call): Don't clear MEM_IN_STRUCT_P. + (emit_library_call_value): Likewise. + (store_one_arg): Use MEM_SET_IN_STRUCT_P. + * combine.c (simplify_rtx): Use MEM_COPY_ATTRIBUTES. + (make_extraction): Likewise. + (simplify_shift_const): Likewise. + (gen_lowpart_for_combine): Likewise. + * cse.c (gen_lowpart_if_possible): Use MEM_COPY_ATTRIBUTES. + * emit-rtl.c (operand_subword): Likewise. + (change_address): Likewise. + * explow.c (stabilize): Use MEM_COPY_ATTRIBUTES. + * expr.c (protect_from_queue): Use MEM_COPY_ATTRIBUTES. + (emit_group_store): Use MEM_SET_IN_STRUCT_P. + (copy_blkmode_from_reg): Likewise. + (store_field): Likewise. + (expand_expr): Remove bogus guesswork setting MEM_IN_STRUCT_P + heuristically. Use MEM_SET_IN_STRUCT_P. + (get_memory_rtx): Likewise. + * final.c (alter_subreg): Use MEM_COPY_ATTRIBUTES. + * function.c (assign_stack_temp): Clear MEM_SCALAR_P and + MEM_ALIAS_SET on newly returned MEMs. + (assign_temp): Use MEM_SET_IN_STRUCT_P. + (put_reg_into_stack): Likewise. + (fixup_var_refs1): Use MEM_COPY_ATTRIBUTES. + (gen_mem_addressof): Use MEM_SET_IN_STRUCT_P. + (assign_parms): Likewise. + (expand_function): Likewise. + * integrate.c (expand_inline_function): Likewise. + (copy_rtx_and_substitute): Use MEM_COPY_ATTRIBUTES. + * loop.c (note_addr_stored): Remove check on MEM_IN_STRUCT_P. + * optabs.c (gen_move_insn): Use MEM_COPY_ATTRIBUTES. + * print-rtl.c (print_rtx): Print /f for frame_related. + * recog.c (validate_replace_rtx_1): Use MEM_COPY_ATTRIBUTES. + * reload1.c (reload): Copy MEM_SCALAR_P as well. + * stmt.c (expand_decl): Use MEM_SET_IN_STRUCT_P. + (expand_anon_union_decl): Use MEM_COPY_ATTRIBUTES. + * varasm.c (make_decl_rtl): Use MEM_SET_IN_STRUCT_P. + (output_constant_def): Likewise. + * a29k.c (a29k_set_memflags_1): Take scalar_p. + Set MEM_SCALAR_P. + (a29k_set_memflags): Use it. + * alpha.c (get_aligned_mem): Use MEM_COPY_ATTRIBUTES. + * c4x.c (c4x_scan_for_ld): Likewise. + * h8300.c (fix_bit_operand): Likewise. + * m88k.c (legitimize_address): Likewise. + (block_move_loop): Likewise. + (block_move_no_loop): Likewise. + (block_move_sequence): Likewise. + (m88k_builtin_saveregs): Use MEM_SET_IN_STRUCT_P. + * mips/abi64.h (SETUP_INCOMING_VARARGS): Likewise. + * rs6000.c (expand_block_move_insn): Use MEM_COPY_ATTRIBUTES. + * sh.c (sh_builtin_saveregs): Use MEM_SET_IN_STRUCT_P. + * arm.h (arm_gen_load_multiple): Take scalar_p. + (arm_store_load_multiple): Likewise. + * arm.c (arm_gen_load_multiple): Likewise. + (arm_gen_store_multiple): Likewise. + (arm_gen_movstrqi): Treat MEM_SCALAR_P like MEM_IN_STRUCT_P. + +Tue Jan 19 12:30:37 1999 Andrew MacLeod + + * optabs.c (emit_libcall_block): Add a REG_EH_REGION reg note to all + calls within a libcall block to indicate no throws are possible. + * flow.c (find_basic_blocks, find_basic_blocks_1): Don't look for + libcall blocks. Don't add edges to exception handlers if we see + a REG_EH_REGION note with a value of 0. + (make_edges): Override active_eh_region vector if the call has a note + indicating the call does not throw. + +1999-01-19 Vladimir N. Makarov + + * config/rs6000/sysv4.h (CC1_SPEC): Fix correct numbers of {}. + +Tue Jan 19 06:26:30 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (cccp.o, cpplib.o): Depend on Makefile. + +Mon Jan 18 09:56:41 1999 Jason Merrill + + * invoke.texi (C++ Dialect Options): Document -fno-rtti. + +1999-01-18 Vladimir N. Makarov + + * invoke.texi (-mcpu=740, -mcpu=750): New options. + (-m(no-)multiple, -m(no-)string): Describe cases for PPC740 & + PPC750. + +1999-01-18 Michael Meissner + + * rs6000.h ({ASM,CPP}_CPU_SPEC): Add support for all machines + supported with -mcpu=xxx. + (processor_type): Add PROCESSOR_PPC750. + (ADJUST_PRIORITY): Call rs6000_adjust_priority. + (RTX_COSTS): Supply costs for 750 multiply/divide operations. + (rs6000_adjust_priority): Add declaration. + + * rs6000.c (rs6000_override_options): -mcpu={750,740} now sets the + processor type as 750, not 603. Allow -mmultiple and -mstring on + little endian 750 systems. + (rs6000_adjust_priority): Stub for now. + (get_issue_rate): The PowerPC 750 can issue 2 instructions/cycle. + + * rs6000.md (function/cpu attributes): Add initial ppc750 support. + + * sysv4.h (STRICT_ALIGNMENT): Don't force strict alignment if + little endian. + (CC1_SPEC): Pass -mstrict-align if little endian, and not + overridden. + (CC1_ENDIAN_{LITTLE,BIG,DEFAULT}_SPEC): Endian specific configs. + (SUBTARGET_EXTRA_SPECS): Add cc1 endian specs. + + * {sysv4,eabi}le.h (CC1_ENDIAN_DEFAULT_SPEC): Override, default is + little endian. + + * t-ppcgas (MULTILIB_*): Delete obsolete Solaris multilibs. + +Mon Jan 18 12:03:08 1999 Gavin Romig-Koch + + * config/mips/mips.md (div_trap): Split div_trap_mips16 + from div_trap. + (div_trap_normal,div_trap_mips16): Correct the length attributes. + +Mon Jan 18 11:48:28 1999 Kaveh R. Ghazi + + * cpplib.c (special_symbol): Qualify a char* with the `const' keyword. + Instead of writing to const char *buf directly, use a non-const + variable `wbuf' to allocate and write a string, then set buf = wbuf. + + * cppulp.c (user_label_prefix): Qualify a char* with the `const' + keyword. + + * dyn-string.c (dyn_string_append): Likewise. + + * dyn-string.h (dyn_string_append): Likewise. + + * final.c (end_final, output_operand_lossage, asm_fprintf): Likewise. + + * output.h (end_final, output_operand_lossage, asm_fprintf, + named_section, decode_reg_name, make_decl_rtl, user_label_prefix): + Likewise. + + * profile.c (init_branch_prob): Likewise. + + * toplev.c (set_target_switch, vmessage, + v_message_with_file_and_line, v_message_with_decl, + v_error_with_file_and_line, v_error_with_decl, v_error_for_asm, + verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl, + v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl, + v_pedwarn_with_file_and_line, vsorry, v_really_sorry, + open_dump_file, dump_rtl, clean_dump_file, + print_version, print_single_switch, print_switch_values, + dump_base_name, debug_args, lang_independent_options, + user_label_prefix, documented_lang_options, target_switches, + target_options, print_time, pfatal_with_name, fatal_io_error, + fatal_insn, default_print_error_function, print_error_function, + report_error_function, error_with_file_and_line, error_with_decl, + error_for_asm, error, fatal, warning_with_file_and_line, + warning_with_decl, warning_for_asm, warning, pedwarn, + pedwarn_with_decl, pedwarn_with_file_and_line, sorry, + really_sorry, botch, output_quoted_string, output_file_directive, + open_dump_file, rest_of_decl_compilation, display_help, main): + Likewise. + + * toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name, + fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line, + warning_with_file_and_line, error_with_file_and_line, sorry, + really_sorry, default_print_error_function, report_error_function, + rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl, + error_with_decl, error_for_asm, warning_for_asm, output_quoted_string, + output_file_directive, botch): Likewise. + + * tree.h (make_decl_rtl): Likewise. + + * varasm.c (strip_reg_name, named_section, decode_reg_name, + make_decl_rtl): Likewise. + +Mon Jan 18 11:35:49 1999 Gavin Romig-Koch + + * Makefile.in (TCL_LIBRARY): Use 'cd' to find the library + directory logically rather than physically. + +Mon Jan 18 09:05:37 1999 Kaveh R. Ghazi + + * loop.c (insert_bct): Hide the definition of variables + `increment_direction', `compare_direction', `add_iteration' and + `loop_var_mode'. + + * recog.c (mode_dependent_address_p): Mark parameter `addr' with + ATTRIBUTE_UNUSED. Mark label `win' with ATTRIBUTE_UNUSED_LABEL. + (mode_independent_operand): Mark label `lose' with + ATTRIBUTE_UNUSED_LABEL. + + * regclass.c (n_occurrences): Remove prototype and definition. + + * reload.c (find_reloads_address_1): Mark variable `tem' with + ATTRIBUTE_UNUSED. + + * reload1.c (reload): Cast the first two arguments of `bcopy' to PTR. + + * sbitmap.c (sbitmap_copy): Likewise. + + * scan-decls.c (scan_decls): Hide label `handle_comma'. + + * toplev.c (output_lang_identify): Mark prototype with + ATTRIBUTE_UNUSED. + + * tree.c (make_node): Cast the first argument of `bzero' to PTR. + (make_tree_vec): Likewise. + (build1): Likewise. + + * varasm.c (assemble_static_space): Mark variable `tem' with + ATTRIBUTE_UNUSED. + +Mon Jan 18 04:28:36 1999 Nathan Sidwell + + * Makefile.in (GCOV_INSTALL_NAME): New macro. + (install-common): Use it. + (uninstall): Use it. + (uninstall): Use correct names for protoize and unprotoize. + +Mon Jan 18 03:52:56 1999 Christian Bruel + Jeffrey A Law (law@cygnus.com) + + * flow.c (last_mem_set): Delete variable. References removed. + (mem_set_list): New variable. + (life_analysis): Initialize and finalize alias analysis. + (propagate_block); Initialize mem_set_list. Clear for CALL_INSNs. + (insn_dead_p): For a store to memory, search the entire mem_set_list + for a match. + (mark_set_1): Kill entries on the mem_set_list for aliased writes or + changes to their addresses. Add new entries to the mem_set_list for + memory writes writes. + (mark_used_regs): Kill entries on the mem_set_list which may be + referenced by a load operation. + +Mon Jan 18 01:01:02 1999 Jeffrey A Law (law@cygnus.com) + + * alias.c (base_alias_check): Add missing return for differing + symbols case. + +Mon Jan 18 00:36:13 1999 Rainer Orth + + * mips-tdump.c (print_file_desc): Handle unknown filenames and + missing local symbols. + +Sun Jan 17 21:04:31 1999 Richard Henderson + + * jump.c (rtx_renumbered_equal_p): Special case CODE_LABEL. + + * system.h (bcopy): Implement with memmove not memcpy. + +Sun Jan 17 19:23:20 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (cppulp.o): Add dependencies. + + * i386.md (integer conditional moves): Add missing earlyclobbers. + + * regmove.c (optimize_reg_copy_1): Undo Aug 18 change. Update + REG_N_CALLS_CROSSED and REG_LIVE_LENGH if and only if we change + where a register is live. + +Sun Jan 17 03:20:47 1999 H.J. Lu (hjl@gnu.org) + + * reg-stack.c (subst_stack_regs_pat): Abort if the destination + of a FP conditional move is not on the FP register stack. + +Sun Jan 17 01:15:04 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sat Jan 16 23:40:33 1999 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_cse_regs_1): Do not call + reload_cse_simplify_operands for an insn with asm operands. + + * cccp.c (print_help): Fix typos. + * cpplib.c (print_help): Fix typos. + * toplev.c (f_optiosn): Fix typos. + (documented_lang_options): Fix typos. + +Sat Jan 16 21:48:17 1999 Marc Espie (Marc.Espie@openbsd.org) + + * gcc.c (do_spec_1): Fix obvious typo. + +Sat Jan 16 19:31:07 1999 Kaveh R. Ghazi + + * c-decl.c (duplicate_decls): If `warn_traditional', warn when + a non-static function declaration follows a static one. + + * invoke.texi (-Wtraditional): Document the extra check now done + by this flag. + +Sat Jan 16 15:13:46 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (shadd): Create shadd insns, even if the result of the shift is + needed without the addition. + +Sat Jan 16 10:48:16 1999 J"orn Rennecke + + * sh.md (movdf, movsf): Temporary workaround for no_new_pseudos lossage. + +Fri Jan 15 23:44:37 1999 Richard Henderson + + * sparc.c (sparc_issue): Add hypersparc/sparclite86x entries. + +Fri Jan 15 22:30:04 1999 David Edelsohn + + * rs6000.h (CONST_OK_FOR_LETTER_P): Do not assume 32-bit CONST_INT. + * rs6000.c (u_short_cint_operand, add_operand, logical_operand, + non_add_cint_operand, non_logical_cint_operand): Likewise. + (get_issue_rate): Add CPU_PPC604E case. + * rs6000.md (movdi, !TARGET_POWERPC64 splitters): Handle 64-bit hosts. + +Fri Jan 15 18:42:12 1999 Richard Henderson + + * expr.c (queued_subexp_p): Make public. + * expr.h (queued_subexp_p): Declare it. + * recog.c (asm_operand_ok): New function. + (check_asm_operands): Use it. After reload, use constrain_operands + instead. + * recog.h (asm_operand_ok): Declare it. + * stmt.c (expand_asm_operands): Use it to try harder to make + asms initially satisfy their constraints. + +Fri Jan 15 17:43:59 1999 Jeffrey A. Law + + * sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Do not create + (mem (lo_sum (...)) for TFmode unless TARGET_V9. + +Sat Jan 16 12:47:15 1999 Michael Hayes + + * config/c4x/c4x.md (not_repeat_reg): Allow ldp instruction + in delay slot of RPTBD. + +Sat Jan 16 12:26:40 1999 Michael Hayes + + * config/c4x/libgcc.S (___divhi3, ___modhi3): Fix long long + divide and modulo sign problem. + +Fri Jan 15 11:02:31 1999 Michael Hayes + + * unroll.c (loop_iterations): Return 0 if the last loop insn + is not a jump insn or if the loop has multiple back edges. + +1999-01-15 Manfred Hollstein + + * configure.in (fixinc_defs): Do not define for m[68]8k-motorola-sysv{,3}; + it's working properly now. Remove comment saying "see m68k-motorola-sysv + as an example". + * configure: Regenerate using autoconf. + + * fixinc/fixincl.c (main): Do not ignore SIGCHLD. + +Thu Jan 14 22:38:41 1999 Jeffrey A Law (law@cygnus.com) + + * unroll.c (find_splittable_givs): For a DEST_ADDR giv, do not share + a register with another DEST_ADDR giv if the address is not valid. + + * pa.c (hppa_expand_epilogue): Save and restore the static chain + around the call to mcount. + + * h8300.h (ASM_OUTPUT_LABELREF): Use asm_fprintf, not fprintf. + + * stmt.c (expand_end_case): Use emit_cmp_and_jump_insns to avoid + generating non-canonical rtl. + +1999-01-14 Vladimir N. Makarov + + * config/i960/i960.c (i960_output_move_double_zero, + i960_output_move_quad_zero): New functions for moving zeros. + (i960_output_move_double, i960_output_move_quad): Additional code + for situation when moving unaligned register group. + + * config/i960/i960.h (i960_output_move_double_zero, + i960_output_move_quad_zero): The function definitions. + + * config/i960/i960.md (movdi+1, movti+1): Usage of the functions. + +1999-01-13 Vladimir N. Makarov + + * config/i960/i960.c (i960_function_prologue): New code (optimal + solution) for saving global registers in local registers. + (form_reg_groups, reg_group_compare, split_reg_group): New + functions used by the code. + (reg_group): New structure definition for the new code. + +1999-01-13 Manfred Hollstein + + * fixinc/fixincl.c (create_file): Pass file creation mask as + third parameter to "open". Use O_TRUNC flag to open instead of + explicitly unlink'ing the file. + (process): and forget about the "chmod" stuff. + +Wed Jan 13 20:12:37 1999 Richard Henderson + + * integrate.c (expand_inline_function): Recognize (mem (addressof)) + and substitute. Copy the return value from there into a new pseudo. + +Wed Jan 13 16:47:00 1999 Catherine Moore + + * config/arm.c (output_func_epilogue): Check TARGET_ABORT_NORETURN + before generating a call to abort for volatile functions. + * config/arm.h (ARM_FLAG_ABORT_NORETURN): Define. + (TARGET_ABORT_NORETURN): Define. + (abort-on-noreturn): New option. + +Thu Jan 14 13:52:42 1999 Michael Hayes + + * config/c4x/c4x.md (in_annul_slot_3): Correctly allow unarycc + and binarycc operations in 3rd annulled delay slot! + +Wed Jan 13 16:16:44 1999 Catherine Moore + + * config/arm.c (output_func_epilogue): Check TARGET_ABORT_NORETURN + before generating a call to abort for volatile functions. + * config/arm.h (ARM_FLAG_ABORT_NORETURN): Define. + (TARGET_ABORT_NORETURN): Define. + (abort-on-noreturn): New option. + +Wed Jan 13 13:30:08 1999 Kaveh R. Ghazi + + * cccp.c (xstrdup): Renamed from `savestring'. All callers changed. + Remove prototype which we get from libiberty.h. + + * collect2.c (xstrdup): Likewise. + + * genextract.c (xstrdup): Likewise for `copystr'. + (mybzero): Remove it and use `memset' instead. + + * genoutput.c (mybcopy, mybzero): Remove these. All callers changed + to use `memcpy' and `memset' instead. + + * genrecog.c (xstrdup): Renamed from `copystr'. All callers + changed. Remove prototype. + (mybcopy, mybzero): Remove these and use memcpy/memset. + +Wed Jan 13 00:59:04 1999 Jeffrey A Law (law@cygnus.com) + + * mips.h (LOAD_EXTEND_OP): Correct for SImode and CCmode moves when + generating code for TARGET_64BIT. + +Tue Jan 12 14:05:37 1999 David Edelsohn + + * rs6000.c (print_operand, cases 'm' and 'M'): Do not depend on + HOST_WIDE_INT word-size. + (rs6000_stack_info): Remove redundant alignment of fpmem. + +Tue Jan 12 14:05:37 1999 Richard Henderson + + * rs6000.c (short_cint_operand): Remove CONSTANT_P_RTX handling. + (u_short_cint_operand, reg_or_cint_operand, logical_operand): Likewise. + (input_operand): Adjust CONSTANT_P_RTX handling. + * rs6000.h (PREDICATE_CODES): Remove CONSTANT_P_RTX references. + * rs6000.md (movsi): Adjust CONSTANT_P_RTX handling. + (movhi, movqi): Remove CONSTANT_P_RTX handling. + (movdi): Adjust CONSTANT_P_RTX handling. + +1999-01-12 Manfred Hollstein + + * configure: Regenerate using autoconf. + + * fixinc/Makefile.in (INCLUDES): Add -I$(srcdir)/../../include. + * fixinc/fixincl.c (SIGCHLD): Use SIGCLD on (very) old systems. + (process): "fchmod" isn't available on all systems, use "chmod" + instead. + * fixinc/server.c: Add #include . + (STDIN_FILENO): Add default definition if no include file defines + it already. + (STDOUT_FILENO): Likewise. + +Tue Jan 12 10:23:24 1999 Stan Cox + + * mips.md (call_value_internal3c): New pattern for -mips16 -mlong-calls. + +1999-01-12 Manfred Hollstein + + * m68k/mot3300.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Define to + ensure all prototypes necessary for building libio will be available. + * m68k/xm-mot3300.h (ADD_MISSING_POSIX, ADD_MISSING_XOPEN): Remove + definitions here as they are not host specific. + * m88k/sysv3.h, m88k/xm-sysv3.h: Likewise. + +Tue Jan 12 02:53:46 1999 Richard Henderson + + * cse.c (cse_insn): Never prefer (const (constant_p_rtx)). + +Tue Jan 12 02:36:10 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Tue Jan 12 01:30:19 1999 Richard Henderson + + * rtl.c (rtx_alloc): Use memset instead of inline loop. + + * recog.h (recog_op_alt): Declare extern. + +Tue Jan 12 00:23:31 1999 Richard Henderson + + * function.c (purge_addressof_1): If the note accesses a mem+addressof + in a wider mode than any replacement, adjust the cached replacement. + Cache trivial substitutions as well. + +Tue Jan 12 00:06:00 1999 Richard Henderson + + * Makefile.in (OBJECTS): Add sbitmap.o. + (BASIC_BLOCK_H): Add sbitmap.h. + * basic-block.h: Move simple bitmap code to sbitmap.h. + * flow.c: Move simple bitmap code to sbitmap.c. + * sbitmap.h, sbitmap.c: New files. + +Mon Jan 11 23:51:50 1999 Richard Henderson + + * alpha.h (TARGET_SWITCHES): Document switches. + (TARGET_OPTIONS): Likewise. + + * alpha/elf.h (ASM_FINISH_DECLARE_OBJECT): Use HOST_WIDE_INT_PRINT_DEC. + +Mon Jan 11 22:54:14 1999 Richard Henderson + + * tree.c (new_alias_set): Return zero if !flag_strict_aliasing. + +Mon Jan 11 22:36:01 1999 Richard Henderson + + * basic-block.h (basic_block_head): Rename to x_basic_block_head. + (basic_block_end): Rename to x_basic_block_end. + (BLOCK_HEAD, BLOCK_END): Update. + + * caller-save.c: Change basic_block_head/end references to + BLOCK_HEAD/END. + * combine.c, flow.c, function.c, gcse.c, global.c: Likewise. + * graph.c, haifa-sched.c, local-alloc.c, regclass.c: Likewise. + * regmove.c, reload1.c, reorg.c, sched.c: Likewise. + +Sat Jan 9 23:54:09 1999 Kaveh R. Ghazi + + * gcc.c (xstrerror): Renamed from my_strerror. All callers + changed. Remove prototype since we get that from libiberty.h. + + * protoize.c (xstrerror): Likewise. + +Sat Jan 9 23:22:04 1999 Kaveh R. Ghazi + + * gcc.c (read_specs): Ensure format specifiers match their arguments. + +Sat Jan 9 20:04:24 1999 Richard Henderson + + * tree.c (copy_node): Oops. That would be copy not zero + in that last change. + +Sun Jan 10 15:35:41 1999 Michael Hayes + + * config/c4x/c4x.c: Include system.h. + (c4x_caller_save_map): Disable caller save for RC. + (c4x_optimization_options): Disable scheduling before reload. + (valid_parallel_load_store) : Define return type as int. + Remove unused variable regs. + * config/c4x/c4x.h (REGISTER_MOVE_COST): Make independent of register + class. + * config/c4x/c4x.md (rotlqi3, rotrqi3): Fix up emitted RTL to + handle rotations. + (*db, decrement_and_branch_until_zero): Fix up constraints + to keep reload happy. + +Sat Jan 9 18:35:29 1999 Richard Henderson + + * tree.c (make_node): Call bzero instead of inline clear. + (copy_node, make_tree_vec, build1): Likewise. + (get_identifier): Call strlen instead of inline count. + (maybe_get_identifier): Likewise. + +Sun Jan 10 14:04:51 1999 Michael Hayes + + * config/c4x/c4x.md (in_annul_slot_3): Allow unarycc and binarycc + operations in 3rd annulled delay slot. + (*lshrqi3_const_set): Disallow c constraint for operand0. + (modhi3+1, modhi3+2): Set attribute type to multi. + * config/c4x/c4x.c (c4x_S_constraint): Removed space in middle of + != operator. + +Sat Jan 9 11:44:55 1999 Kaveh R. Ghazi + + * gansidecl.h: Allow attribute unused on labels only when we are + version 2.93 or higher. Not all versions of 2.92 have this feature. + + * version.c: Bump minor number to 93. + +Fri Jan 8 10:51:13 1999 Andreas Schwab + + * config/m68k/m68k.h: Declare output_function_epilogue. + * recog.h: Declare next_insn_tests_no_inequality. + +Fri Jan 8 01:43:53 1999 Jeffrey A Law (law@cygnus.com) + + * stmt.c (optimize_tail_recursion): New function, extracted from ... + (expand_return): Use optimize_tail_recursion. + * tree.h (optimize_tail_recursion): Declare. + + * toplev.c (compile_file): Move call to output_func_start_profiler + to after the loop to emit deferred functions. + +Thu Jan 7 19:52:53 1999 Gerald Pfeifer + + * system.h (abort): Supply more detailed information on how to + report an Internal Compiler Error. + +Thu Jan 7 09:25:58 1999 Bruce Korb (korb@datadesign.com) + + * fixinc/fixincl.c (*): More decapitalization of variables + plus some explanatory comments. + + * fixinc/Makefile.in fixinc/mkfixinc.sh: + When the fixincl program does not work for a certain system, + we substitute a shell script. Added user commentary when + this happens. + +Thu Jan 7 11:26:17 1999 Mark Mitchell + + * calls.c (store_unaligned_arguments_into_pseudos): Use xmalloc to + allocate memory that will live beyond this function. + (expand_call): Free it here. + +Thu Jan 7 03:08:17 1999 Richard Henderson + + * sparc.h (PREFERRED_RELOAD_CLASS): Select GENERAL_REGS for + integer data not destined for fp regs. + (LEGITIMIZE_RELOAD_ADDRESS): New. + +Thu Jan 7 03:03:42 1999 Stan Cox + Richard Henderson + + Support for HyperSPARC and SPARClite86x: + * sparc.h (TARGET_CPU_hypersparc, TARGET_CPU_sparclite86x): New. + (CPP_CPU32_DEFAULT_SPEC): Fix up for the new targets. + (ASM_CPU32_DEFAULT_SPEC): Likewise. + (TARGET_CPU_DEFAULT): Likewise. + (enum processor_type): Likewise. + (CPP_ENDIAN_SPEC): Handle little endian data. + (LIBGCC2_WORDS_BIG_ENDIAN): Likewise. + (ADJUST_COST): Call sparc_adjust_cost. + * sparc.c (sparc_override_options): Fix up for the new targets. + (supersparc_adjust_cost): Make static. + (hypersparc_adjust_cost): New. + (ultrasparc_adjust_cost): Make static. + (sparc_adjust_cost): New. + * sparc.md (attr cpu): Add hypersparc and sparclite86x. + (function_unit): Add hypersparc scheduling rules. + + * configure.in (with_cpu handler): Recognize hypersparc. + +Thu Jan 7 23:54:05 1999 Michael Hayes + + * config/c4x/c4x.c: Added space after negation operator. + * config/c4x/c4x.h: Likewise. + * config/c4x/c4x.md: Likewise. + +Thu Jan 7 23:39:27 1999 Michael Hayes + + * config/c4x/c4x.c (c4x_preferred_reload_class): Always return class. + +Thu Jan 7 00:29:25 1999 Bernd Schmidt + + * combine.c (num_sign_bit_copies): In NEG, MULT, DIV and MOD cases, + when a test can't be performed due to limited width of + HOST_BITS_PER_WIDE_INT, use the more conservative approximation. + Fix UDIV case for cases where the first operand has the highest bit + set. + +Thu Jan 7 00:01:38 1999 Lutz Vieweg + + * pa.h (reg_class): Add FPUPPER_REGS. + (REG_CLASS_NAMES): Similarly. + (REG_CLASS_CONTENTS): Similarly. + (REGNO_REG_CLASS): Handle FPUPPER_REGS. + (FP_REG_CLASS_P): Likewise. + (REG_CLASS_FROM_LETTER): Similarly. + (CLASS_MAX_NREGS): Similarly. + +1999-01-06 Brendan Kehoe + + * fixincludes: For HP/UX 10.20, also look in curses_colr/curses.h + for a typedef of bool. Make sure to have a copy of the file is + in place before we look to fix it. Fix typo in variable name to + FILE. + +Wed Jan 6 07:51:05 1999 Richard Henderson + + * expr.c (expand_builtin) [case BUILT_IN_CONSTANT_P]: Use + value_mode for the return mode. + +Wed Jan 6 17:55:19 1999 Robert Lipe + + * configure.in: New flag --with-dwarf2. If set, enables DWARF-2 + debugging as default. + + * config/tm-dwarf2.h: New file. + +Wed Jan 6 16:08:54 1999 Jeffrey A Law (law@cygnus.com) + + * h8300.h (ASM_OUTPUT_LABELREF): Define. + + * pa.h (DONT_RECORD_EQUIVALENCE): Kill. + * local-alloc.c (update_equiv_regs): Corresponding changes. + * tm.texi (DONT_RECORD_EQUIVALENCE): Kill. + + * calls.c (special_function_p): Push alloca test inside the large + conditional which excludes functions not at file scope or not + extern. + + * calls.c (special_function_p): New function broken out of + expand_call. + (precompute_register_parameters): Likewise. + (store_one_arg): Likewise. + (store_unaligned_argumetns_into_pseudos): Likewise. + (save_fixed_argument_area): Likewise. + (restore_fixed_argument_area): Likewise. + (expand_call): Corresponding changes. + +Thu Jan 7 00:12:24 1999 Michael Hayes + + * config/c4x/c4x.md (addqi3): If the destination operand is + a hard register other than an extended precision register, + emit addqi3_noclobber. + (*addqi3_noclobber_reload): New pattern added so that reload + will recognize a store of a pseudo, equivalent to the sum + of the frame pointer and a constant, as an add insn. + +1999-01-06 Manfred Hollstein + + * fixinc/fixincl.c: Re-indent according to the GNU standards. + fixinc/server.c: Likewise. + fixinc/server.h: Likewise. + +Wed Jan 6 10:43:29 1999 Andreas Schwab + + * config/m68k/m68k.c (const_uint32_operand): Remove CONSTANT_P_RTX + handling. + (const_sint32_operand): Likewise. + +Wed Jan 6 09:44:51 1999 Kaveh R. Ghazi + + * toplev.h: In addition to checking _JBLEN, also check if `setjmp' + is a macro when deciding if we can use `jmp_buf' in prototypes. + +Wed Jan 6 03:18:53 1999 Mark Elbrecht + + * configure.in (pc-msdosdjgpp): Set x_make to x-go32. + * configure: Rebuilt. + * i386/xm-go32.h: Define LIBSTDCXX. + * i386/x-go32: New. + * i386/go32.h (MD_EXEC_PREFIX): Define. + (FILE_NAME_ABSOLUTE_P): Define. + (LINK_COMMAND_SPEC): Define. + +Wed Jan 6 02:23:36 1999 "Charles M. Hannum" + + * expr.c (store_expr): If the lhs is a memory location pointed + to be a postincremented (or postdecremented) pointer, always + force the rhs to be evaluated into a pseudo. + +Wed Jan 6 00:54:21 1999 Geoff Keating + + * real.c (mtherr): Print more reasonable warning messages. + +Tue Jan 5 21:57:42 1999 Kaveh R. Ghazi + + * Makefile.in (gcc.o, prefix.o, cccp.o, cpplib.o): Depend on prefix.h. + + * cccp.c: Include prefix.h, don't prototype prefix.c functions. + (new_include_prefix): Constify char* parameters. + + * cppfiles.c (read_name_map): Likewise. + (append_include_chain): Likewise. Also, use a writable char* copy + of parameter `dir' which we then modify, rather than using the + parameter itself to store the new writable string. + (remap_filename): Constify some variables. Also, use a writable + char* to store an allocated string which we will be modifying. + + * cpplib.c: Include prefix.h, don't prototype prefix.c functions. + (cpp_start_read): Constify variable `str'. + + * cpplib.h (append_include_chain): Constify a char* parameter. + + * gcc.c Include prefix.h, don't prototype prefix.c functions. + (add_prefix, save_string): Constify char* parameters. + (fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes. + + * prefix.c: Include prefix.h. + (get_key_value, translate_name, save_string, update_path, + set_std_prefix): Constify various char* parameters and variables. + (save_string): Use xmalloc, not malloc. + (translate_name): Use a writable temporary variable to create and + modify a string before setting it to a const char*. + + * prefix.h: New file to prototype functions exported from prefix.c. + +Tue Jan 5 08:52:18 1999 Bruce Korb (korb@datadesign.com) + + * fixinc/fixincl.c (various): Added debug code so + Manfred can trace the processing. + + * fixinc/inclhack.def (sys/utsname.h): Provide forward declaration of + struct utsname on Ultrix V4.[35]. + + * fixinc/{fixincl.x|fixincl.sh|inclhack.sh} : Regenerated. + +Mon Jan 4 15:37:30 1999 Zack Weinberg + + * cpplib.c (skip_if_group): Split out the logic that handles + directive recognition to its own function. Don't use + parse markers; use a bare pointer into the buffer. Use + copy/skip_rest_of_line instead of doing it by hand. Remove + `return on any directive' mode which was never used, and take + only one argument. + (consider_directive_while_skipping): New function, subroutine + of skip_if_group. Logic streamlined a bit. + (conditional_skip, do_elif, do_else): Call skip_if_group with + only one argument. + +Mon Jan 4 15:27:30 1999 Zack Weinberg + + * cpplib.c (do_undef): EOF immediately after '#undef FOO' is not an + error. + +Mon Jan 4 11:55:51 1999 Jason Merrill + + * extend.texi (Bound member functions): Document. + +Mon Jan 4 11:01:48 1999 Kaveh R. Ghazi + + * mips-tdump.c (st_to_string, sc_to_string, glevel_to_string, + lang_to_string, type_to_string): Make return type const char*. + (print_symbol): Apply `const' keyword to a char*. + (print_file_desc): Cast structure member `crfd' to ulong when + comparing against one. + + * mips-tfile.c (pfatal_with_name): Apply `const' keyword to char*. + (fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes. + (progname, input_name): Apply `const' keyword to a char*. + Don't redundantly include sys/stat.h. + (alloc_info): Apply `const' keyword to a char*. + (st_to_string, sc_to_string): Likewise. + (hash_string): Cast variable `hash_string' to a symint_t when + comparing against one. + (add_string): Cast PAGE_USIZE to Ptrdiff_t when comparing against one. + Likewise cast it to long when comparing against one. + (add_local_symbol): Apply `const' keyword to a char*. + (add_ext_symbol): Likewise. + (add_unknown_tag): Likewise. + (add_procedure): Cast a printf-style field width to an int. + (add_file): Cast PAGE_USIZE to long when comparing against one. + (parse_begin): Cast a printf-style field width to an int. + (parse_bend): Likewise. + (parse_def): Likewise. + (parse_end): Likewise. + (mark_stabs): Mark parameter `start' with ATTRIBUTE_UNUSED. + (parse_stabs_common): Fix format specifier. + (parse_input): Change type of variable `i' to Size_t. + (write_object): Fix arguments to match format specifiers. + Cast variable `num_write' to long when comparing against one. + (read_seek): Cast variable `sys_read' to symint_t when comparing + against one. Fix arguments to match format specifiers. Cast + variable `size' to long when comparing against one. + (copy_object): Cast result of `sizeof' to int when comparing + against one. Fix arguments to match format specifiers. Cast + variable `ifd' to long when comparing against a signed value. + Likewise, likewise. + +Mon Jan 4 10:30:33 1999 Kaveh R. Ghazi + + * c-common.c (decl_attributes): Allow applying attribute `unused' + on a LABEL_DECL. + + * c-parse.in (label): Parse attributes after a label, and call + `decl_attributes' to handle them. + + * gansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define. + + * genrecog.c (OUTPUT_LABEL, write_tree_1, write_tree): When + generating labels, mark them with ATTRIBUTE_UNUSED_LABEL. + + * invoke.texi: Note that labels can be marked `unused'. + +Sun Jan 3 23:32:18 1999 Jeff Law (law@cygnus.com) + + * version.c: Bump for snapshot. + +Sun Jan 3 23:00:42 1999 Jeffrey A Law (law@cygnus.com) + + * optabs.c (emit_cmp_and_jump_insns): Use CONSTANT_P canonicalizing + RTL for a compare/jump sequence. + +Sun Jan 3 22:58:15 1999 Michael Hayes + + * optabs.c (emit_cmp_insn): Abort if asked to emit non-canonical RTL + for a target with HAVE_cc0 defined. + (emit_cmp_and_jump_insns): New function. + * expr.h (emit_cmp_and_jump_insns): Prototype it. + * loop.c (check_dbra_loop): Use it to replace calls + to emit_cmp_insn and emit_jump_insn and to canonicalize + the comparison if necessary. + * unroll.c (unroll_loop): Likewise. + +Sun Jan 3 21:01:04 1999 Rainer Orth + + * fixincludes (sys/utsname.h): Provide forward declaration of + struct utsname on Ultrix V4.[35]. + + * mips.md (div_trap): Use local labels instead of dot-relative + branches. + +Sun Jan 3 20:40:34 1999 Jeffrey A Law (law@cygnus.com) + + * pa.md (branch, negated branch): Handle (const_int 0) as first + source operand. + * pa.c (output_cbranch): Likewise. + +Sun Jan 3 03:20:38 1999 David Edelsohn + + * rs6000.c (rs6000_stack_info): Undo spurious part of last + change. + +1999-01-01 Manfred Hollstein + + * extend.texi (__builtin_constant_p): Add missing @smallexample. + +Fri Jan 1 11:48:20 1999 Jeffrey A Law (law@cygnus.com) + + * i386.md (doubleword shifts): Fix dumb mistakes in previous change. diff --git a/contrib/gcc/ChangeLog-2000 b/contrib/gcc/ChangeLog-2000 new file mode 100644 index 00000000000..536137bb657 --- /dev/null +++ b/contrib/gcc/ChangeLog-2000 @@ -0,0 +1,32124 @@ +2000-12-31 Alexandre Oliva + + * resource.c (mark_referenced_resources): Abort() before + attempting to mark a pseudo register. + (mark_set_resources): Likewise. + +2000-12-31 Philip Blundell + + * config/arm/linux-gas.h (CLEAR_INSN_CACHE): Add missing asm + operands. + +2000-12-30 Richard Henderson + + * dbxout.c (dbxout_block): Invert logic on eliding LBRAC/RBRAC. + Initialize variables properly for DBX_LBRAC_FIRST. + +2000-12-30 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): Fix typo in last change. + +2000-12-30 Kaveh R. Ghazi + + * builtins.c (validate_arglist): New function, use it. + +2000-12-30 Philip Blundell + + * config/arm/arm.c (arm_expand_prologue): Fix typos in error + message and comment. Note location of testcase for an unhandled + situation. + +2000-12-30 Jeffrey Oldham + + * defaults.h (BUILD_VA_LIST_TYPE): New definition. + * tree.c (build_common_tree_nodes_2): Ensure the va_list_type_node + is a copy, not an alias. + +2000-12-30 Richard Kenner + + * calls.c (calls_function_1, case CONSTRUCTOR): New case. + + * alias.c (alias_sets_conflict_p): New function. + (mems_in_disjoint_alias_sets_p): Use it. + (readonly_fields_p): Moved from expr.c; check for record type. + (objects_must_conflict_p): New function. + * calls.c (expand_call): Use assign_temp as much as possible, use + readonly variant if assigned once, and don't set memory attributes. + (emit_library_call_value_1, store_one_arg): Likewise. + * integrate.c (expand_inline_function): Likewise. + * stmt.c (expand_asm_operands, expand_return): Likewise. + * expr.c (copy_blkmode_from_reg, store_constructor): Likewise. + (store_field, save_noncopied_parts, expand_expr): Likewise. + (expand_expr_unaligned): Likewise. + (readonly_fields_p): Moved to alias.c. + (safe_from_p): Rework handling of SAVE_EXPR. + MEMs ony conflict if alias sets conflict; likewise for INDIRECT_REF. + * function.c (struct temp_slot): Delete field ALIAS_SET; add TYPE. + (assign_stack_for_temp): Use objects_must_confict_p. + Set all memory attributes from type, if specified. + (mark_temp_slot): Mark TYPE field. + * tree.h (alias_sets_conflict_p, readonly_fields_p): New decls. + (objects_must_conflict_p): Likewise. + + * stmt.c (expand_decl): Don't use assign_stack_temp in error case. + (add_case_node): No need to copy nodes anymore. + +2000-12-30 Alexandre Oliva + + * config/sh/sh.c (split_branches): Don't dereference re-computed + `beyond' before checking it's non-NULL. + +2000-12-29 Robert Lipe + + Remove COFF support from i?86-pc-sco3.2v5. + * i386/sco5.h (PREFERRED_DEBUGGING_TYPE): Change to Dwarf II. + (TARGET_ELF): Now always true. + (SUBTARGET_SWTICHES: )Remove -mcoff. + + * i386/t-sco5 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES, + MULTILIB_EXCEPTION): Nuke coff. + (CRTSTUFF_T_CFLAGS_S): Deleted. + (TARGET_LIBGCC2_CFLAGS): Added. + +2000-12-29 Alexandre Oliva + + * varasm.c (output_constant_def): Don't ENCODE_SECTION_INFO + twice. Update desc->rtl and ->label, in case ENCODE_SECTION_INFO + modifies them. + +2000-12-29 Bernd Schmidt + + * ia64.c (ia64_expand_load_address): Accept additional scratch + register argument. All callers & prototype changed. + Use scratch register when generating load_symptr insns. + * ia64.md (movdi_symbolic): Clobber a scratch register. Use it + when calling ia64_expand_load_address. + (movdi): Generate movdi_symbolic with additional operand. + (load_gprel64): Use pic_offset_table_rtx instead of (reg:DI 1). + (load_symptr): Likewise. Use additional operand as a scratch + register instead of generating it here. + + * basic-block.h: Add a comment. + * flow.c (PROP_POSTRELOAD): New macro. + (update_life_info): Add it to prop_flags. + (mark_set_1): If it is set, compute REG_N_SETS for the original + register number of a hard reg. + + * emit-rtl.c (gen_raw_REG): New function. + (gen_rtx_REG, gen_reg_rtx, init_emit_once): Use it instead of + gen_rtx_raw_REG. + * print-rtl.c (print_rtx): Print ORIGINAL_REGNO. + * final.c (alter_subreg): Update it. + * regrename.c (do_replace): Likewise. Use gen_raw_REG. + * rtl.def (REG): Update comment. + * rtl.h (X0UINT, ORIGINAL_REGNO): New macros. + (gen_raw_REG): Declare. + +2000-12-29 Richard Kenner + + * tree.c (get_set_constructor_bits): Use host_integerp and + tree_low_cst. + + * local-alloc.c (update_equiv_regs): Don't use copy_rtx on PATTERN. + + * toplev.c (main): Call xmalloc_set_program_name. + * gcc.c (main): Likewise. + +2000-12-29 Philip Blundell + + * config/arm/arm.c (arm_override_options): Fix typo in warning + message. + +2000-12-29 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_block_move): Initialize + src_align and dst_align in bits. Do unaligned quadword loads + if possible for BWX too. + (alpha_expand_block_clear): Initialize align in bits. Track + small leading offsets into a larger alignment. Play games with + stq_u for large 4-byte aligned blocks. Use load/mask/store + for appropreately aligned heads and tails. + +2000-12-29 Alexandre Oliva + + * function.c (assign_parms): Convert arguments passed by + reference to the right mode. + +2000-12-28 Geoffrey Keating + + * c-parse.in (select_or_iter_stmt): Use truthvalue_conversion + on the condition of a FOR statement, so that it gets typechecked + and optimized. + +2000-12-29 Alexandre Oliva + + * c-decl.c (grokdeclarator): Prevent crash in case of overflow in + array size. + + * calls.c (emit_library_call_value_1): Add to call_fusage the + stack slot assigned to argument passed by reference. + +2000-12-28 Jeffrey Oldham + + * toplev.h (extern really_sorry): Remove extern declaration for + nonexistent function. + +2000-12-28 Jeffrey Oldham + + * varasm.c (initializer_constant_valid_p): Indicate subtraction of + pointers to the same string constant is absolute. + +2000-12-28 Joseph S. Myers + + * c-common.c (enum format_type): Add strfmon_format_type. + (decl_attributes): Handle format attributes strfmon and + __strfmon__. + (FMT_FLAG_USE_DOLLAR, FMT_FLAG_ZERO_WIDTH_BAD, + FMT_FLAG_EMPTY_PREC_OK): Define. + (format_char_info): Update comment for flag_chars. + (format_flag_spec): Add skip_next_char. + (format_kind_info): Add left_precision_char. + (printf_flag_specs, scanf_flag_specs, strftime_flag_specs, + format_types): Update for these new structure members and flags. + (time_char_table): Make const. + (strfmon_length_specs, strfmon_flag_specs, strfmon_flag_pairs, + monetary_char_table): New. + (format_types): Add details of strfmon formats. + (init_function_format_info): Create default attribute for strfmon. + (check_format_info_main): Check the new flags. Handle + skip_next_char and left precision. + * toplev.c (documented_lang_options): Update description of + -Wformat. + * extend.texi: Document strfmon format attributes. Document + attribute forms such as __printf__. Clarify format_arg attribute + documentation. + * invoke.texi (-Wformat): Update for strfmon formats. + +2000-12-28 Andreas Jaeger + + * expmed.c (store_bit_field): Fix last patch. + +2000-12-28 Alexandre Oliva + + * config/sh/crt1.asm (start_l): `__SH4_SINGLE_ONLY__' was missing + the trailing `__'. + +2000-12-28 Alan Lehotsky + + * expmed.c (store_bit_field): Correctly compute smallest mode that + is sufficient to contain all bits we are storing. + +2000-12-27 Kaveh R. Ghazi + + * builtins.c (build_function_call_expr): New function. Use it + everywhere in lieu of manually constructing a CALL_EXPR. + +2000-12-27 Chandrakala Chavva + + * calls.c (store_one_arg): If parm is passed both in stack and in + register and offset is greater than reg_parm_stack_space, split + the offset and call emit_push_insn(). + +2000-12-27 Nick Clifton + + * ifcvt.c (noce_emit_store_flag): Handle jump insns that are + PARALLEL. + +2000-12-27 Alexandre Oliva + + * rtl.c (copy_most_rtx, shallow_copy_rtx): Copy frame_related + flag. + +2000-12-27 Bruce Korb + + * fixinc/Makefile.in: fix for ancient Bourne shell + * fixinc/Makefile.BEOS: obsolete + * fixinc/Makefile.DOS: obsolete + * fixinc/fixincl.sh(LINKS): use `test -d' rather than `ls' for testing + +2000-12-27 Bernd Schmidt + + * sched-deps.c (get_condition, conditions_mutex_p): New functions. + (add_dependence): Use them to avoid adding unnecessary dependencies + between conditionally executed insns. + (sched_analyze_1, sched_analyze_2, sched_analyze_insn): Don't free + dependency lists if current insn is a COND_EXEC. + +2000-12-27 Geoffrey Keating + + * config/rs6000/rs6000.md (define_attr "length"): Correct + calculation. + +2000-12-26 Kazu Hirata + + * config/h8300/h8300.c: Fix a comment typo. + (get_shift_alg): Fix a typo in the assembly code for 12-bit + ASHIFTRT in HImode. Do not output extra whitespace after one line + of assembly code. Output a tab after an opcode instead of a + space. + (emit_a_shift): Output a tab after an opcode instead of a space. + +2000-12-23 Marek Michalkiewicz + + * config/avr/avr.c (out_movqi_r_mr, out_movhi_r_mr, out_movsi_r_mr, + out_movsi_mr_r, out_movqi_mr_r, out_movhi_mr_r): Use %o instead of + %4 in output templates, do not modify operands passed by the caller. + +2000-12-23 Joseph S. Myers + + * builtins.def (BUILT_IN_LABS, BUILT_IN_LLABS, BUILT_IN_IMAXABS): + Don't define. + * builtins.c (expand_builtin): Don't handle BUILT_IN_LABS, + BUILT_IN_LLABS and BUILT_IN_IMAXABS. + * c-common.c (c_common_nodes_and_builtins): Use BUILT_IN_ABS for + builtin labs, llabs and imaxabs. + (expand_tree_builtin): Don't handle BUILT_IN_LABS, BUILT_IN_LLABS + and BUILT_IN_IMAXABS. + +2000-12-23 Joseph S. Myers + + * c-common.c (builtin_function_2): New function. + (c_common_nodes_and_builtins): Use it to define each pair (foo, + __builtin_foo) of builtins in one place. + +2000-12-22 Joseph S. Myers + + * gccbug.in: Add libgcj and preprocessor categories. + +2000-12-22 Bernd Schmidt + + * config/ia64/ia64.c (itanium_reorder): Only schedule stops in + the final scheduling pass. + +2000-12-22 Nick Clifton + + * config/arm/arm.h (struct machine_function): Add new field + 'lr_save_eliminated'. + * config/arm/arm.c (arm_compute_save_reg_mask): Do not include the + link register if its save has been eliminated. + (output_arm_prologue): Mention if the save of the link register + has been eliminated. + (output_arm_epilogue): Rename 'live_regs_mask' to + 'saved_regs_mask'. + Test 'saved_regs_mask' for the link register, not regs_ever_live. + (arm_expand_prologue): If the link register has not been saved set + lr_save_eliminated and emit a USE to prevent later passes from + scavenging it. + + * dwarf2out_frame_debug_expr: Allow the (scratch) frame + pointer to be initialized from the stack pointer plus a + constant. + +2000-12-22 Bernd Schmidt + + * regrename.c (struct du_chain): New field "earlyclobber". + (enum scan_actions): Remove unused entry "note_reference". + (enum scan_actions_name): Likewise. + (note_sets, clear_dead_regs, merge_overlapping_regs): New static + functions. + (regrename_optimize): Use them to compute unavailable regs; get + rid of the more simpleminded code we used to have here. + Use a tick array to ensure registers are allocated in a more + round-robin way. Disable code that only optimizes registers + that were seen more than once. + (referenced_regs): Remove variable. + (scan_rtx_reg): New arg "earlyclobber". All callers changed. + Store its value in newly generated du_chain structures. + Add new du_chains at the end, not the start, of the list. + Don't handle the "note_reference" action. + (scan_rtx): New arg "earlyclobber". All callers changed. + (build_def_use): Lose code to keep track of referenced regs. + +2000-12-22 Kaveh R. Ghazi + + * Makefile.in (sched-deps.o, sched-rgn.o): Fix dependency typo. + + * fp-bit.h (usi_to_float): Add prototype. + + * i386.c (ix86_expand_builtin): Delete unused label. + + * dwarf2out.c (file_info_cmp): Prototype. + (dwarf2out_line): Hide variable `old_in_use'. + + * objc-act.c (objc_fatal): Delete. + + * sched-vis.c (visualize_stall_cycles): Remove unused variable. + + * system.h (getopt): Fix error in last change. + + * varasm.c (assemble_trampoline_template): Constify. + +2000-12-22 Jason Merrill + + * collect2.c (main): Use auto_demangling. + +2000-12-22 Alexandre Oliva + + * function.c (assign_parms): Update parm's DECL_INCOMING_RTL + when optimizing PARALLEL to REG. + +2000-12-22 Graham Stott + + * reload.c (update_auto_inc_notes): New, broken out from ... + (find_reloads_address_1): ... use here, also correct possible + use of uninitialized reloadnum. + +2000-12-21 David O'Brien + + * config/freebsd.h (LIB_SPEC): remove -kthread option. + +2000-12-22 Michael Hayes + + * resource.c (mark_set_resources): Use MARK_SRC_DEST for + PRE_MODIFY and POST_MODIFY cases. + + * rtlanal.c (side_effects_p): Handle PRE_MODIFY and POST_MODIFY. + +2000-12-22 Michael Hayes + + * md.texi (Looping Patterns): New node. + +2000-12-21 Joseph S. Myers + + * gcc.texi, cpp.texi: Update last-updated dates. + +2000-12-21 Chandrakala Chavva + + * varasm.c (output_addressed_constants): Use language specific + expander on unknown nodes. + +2000-12-21 Graham Stott + + * combine.c (distribute_notes): Handle REG_NON_LOCAL_GOTO notes. + +2000-12-21 Bernd Schmidt + + * Makefile.in (out_object_file): Depend on sched-int.h. + * rtl.h (single_set_1): New macro. + (single_set_2): Renamed from single_set_1 and extra argument added. + * rtlanal.c (single_set_2): Likewise. + + * config/ia64/ia64-protos.h (get_bundle_name, ia64_issue_rate, + ia64_adjust_cost, ia64_sched_init, ia64_sched_finish, + ia64_sched_reorder, ia64_sched_reorder2, ia64_variable_issue): + Declare. + * config/ia64/ia64.c: Include "sched-int.h". + (hard_regno_rename_ok): Also disallow renaming from the various + reg_save_* regs. + (ia64_safe_itanium_requiers_unit0, ia64_safe_itanium_class, + ia64_safe_type, init_insn_group_barriers, group_barrier_needed_p, + safe_group_barrier_needed_p, fixup_errata): New static functions. + (rtx_needs_barrier): Handle bundle selector and cycle display + insns. + (emit_insn_group_barriers): Accept additional FILE * arg. All + callers changed. Rework to only generate stop bits between + basic blocks that haven't been inserted by scheduling. + (struct bundle, struct ia64_packet): New structures. + (NR_BUNDLES, NR_PACKETS): New macros. + (bundle, packets, type_names): New static arrays. + (ia64_final_schedule): New variable. + (ia64_single_set, insn_matches_slot, ia64_emit_insn_before, + gen_nop_type, finish_last_head, rotate_one_bundle, rotate_two_bundles, + cycle_end_fill_slots, packet_matches_p, get_split, find_best_insn, + find_best_packet, itanium_reorder, dump_current_packet, schedule_stop): + New static functions. + (ia64_issue_rate, ia64_sched_init, ia64_sched_reorder, + ia64_sched_finish, ia64_sched_reorder2, ia64_variable_issue): New + functions. + (ia64_reorg): Perform a final scheduling pass. + * config/ia64/ia64.h (CONST_COSTS): Slightly increase SYMBOL_REF costs. + (MAX_CONDITIONAL_EXECUTE, ADJUST_COST, ISSUE_RATE, MD_SCHED_INIT, + MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_FINISH, + MD_SCHED_VARIABLE_ISSUE): Define macros. + (ia64_final_schedule): Declare variable. + * config/ia64/ia64.md (attr itanium_class): Add some more classes. + (attr type): Account for them. + (itanium_requires_unit0): New attribute. + (function units): Rewrite. + (some splitters): Don't create scheduling barriers here. + (gr_spill_internal, gr_restore_internal): Don't predicate the + pseudo-op. + (nop_m, nop_i, nop_f, nop_b, nop_x, cycle_display, cycle_display_1, + bundle_selector): New patterns. + (insn_group_barrier): Now has an operand. + +2000-12-21 DJ Delorie + + * dwarf2out.c (simple_decl_align_in_bits): new + (field_byte_offset): Try both the type align and the + decl align, use whichever works, preferring the type align. + +2000-12-21 Joseph S. Myers + + * gccbug.in: Fix typo. + +2000-12-20 Benjamin Kosnik + + * Makefile.in (gcc_gxx_target_include_dir): Use instead of + build_tooldir and libstdcxx_incdir. + +2000-12-20 Robert Lipe + + * haifa-sched.c (schedule_block): Provide empty source statement + if not MD_SCHED_REORDER2. + +2000-12-20 Richard Henderson + + * rtl.h (REG_NON_LOCAL_GOTO): New. + * rtl.c (reg_note_name): Update. + * stmt.c (expand_goto): Emit a REG_NON_LOCAL_GOTO note. + * builtins.c (expand_builtin_longjmp): Likewise. + * flow.c (make_edges): Check for REG_NON_LOCAL_GOTO and do + not emit an edge. + +2000-12-20 Marek Michalkiewicz + + * config/avr/avr.c (out_movsi_r_mr, out_movsi_mr_r, out_movhi_mr_r): + Do not output undefined opcodes where source or destination register + overlaps with modified pointer register. Handle (X + d) addresses. + * config/avr/avr.md (*movhi, *movsi, *movsf): Correct insn length + in alternatives with memory operand. + +2000-12-20 Richard Henderson + + * c-typeck.c (build_asm_stmt): New, broken out from ... + (c_expand_asm_operands): ... here. Just do rtl expansion. + (c_expand_return): Return the new stmt node. + (c_start_case, do_case): Likewise. + * c-common.c (c_expand_expr_stmt): Likewise. + * c-common.h: Update declarations. + * c-tree.h: Likewise. + * c-semantics.c (build_stmt): Use STMT_LINENO not TREE_COMPLEXITY. + * c-parse.in (fndef): Set DECL_SOURCE_LINE to the open brace. + (nested_function, notype_nested_function): Likewise. + (compstmt): Return the compound statement not the binding level. + (lineno_labeled_stmt): Simplify. + (lineno_stmt, lineno_label): Set STMT_LINENO. + (stmt, label): Return the new stmt node. + +2000-12-20 Bernd Schmidt + + * Makefile.in (OBJS): Add sched-ebb.o. + (sched-ebb.o): New rule. + (sched-vis.o): Depend on hard-reg-set.h and $(BASIC_BLOCK_H). + (haifa-sched.o): Depend on insn-flags.h. + * haifa-sched.c: Include "insn-flags.h". + (priority): Don't access BLOCK_NUM, use the new contributes_to_priority + callback. + * rtl.h (schedule_ebbs): Declare. + * sched-int.h (struct sched_info): Add new members + contributes_to_priority and compute_jump_reg_dependencies. + * sched-rgn.c (contributes_to_priority, compute_jump_reg_dependencies): + New functions. + (region_sched_info): Add them. + * sched-vis.c: Include "hard-reg-set.h" and "basic-block.h". + * sched-ebb.c: New file. + * sched-deps.c (sched_analyze_insn): Add code to handle JUMP_INSNs. + + * flow.c (ior_reg_cond, and_reg_cond, elim_reg_cond): Properly + handle all relational operators. + +2000-12-20 Alexandre Oliva + + * final.c (output_addr_const): Use ASM_OUTPUT_SYMBOL_REF. + * tm.texi: Document it. + +2000-12-19 Benjamin Kosnik + + * Makefile.in (-DGPLUSPLUS_TOOL_INCLUDE_DIR): Use build_tooldir + instead of gcc_tooldir. + +2000-12-19 John David Anglin + + * system.h (getopt): Update prototype to match include/getopt.h. + +2000-12-19 John David Anglin + + From Jeff Law. + * pa.c (basereg_operand): Simplify. + +2000-12-19 Bernd Schmidt + + * haifa-sched.c (rm_line_notes): Arguments are now head and tail, + not block number. All callers and prototype changed. + (set_priorities): Likewise. + (save_line_notes): Add head and tail arguments; all callers and + prototype changed. + (restore_line_notes): Likewise. Don't crash on insns generated + during scheduling. + (schedule_block): Don't use BLOCK_HEAD/BLOCK_END macros. + Call MD_SCHED_INIT with additional argument. + When starting a new cycle, emit cycle_display insns if available. + Don't stop scheduling when encountering a JUMP_INSN, but add another + call to schedule_more_p in the inner loop. + Call MD_SCHED_REORDER2 after scheduling an insn. + Call MD_SCHED_FINISH once all insns are scheduled. + (sched_init): Compensate for the fact that get_block_head_tail + doesn't include leading notes. + * sched-deps.c (free_deps): Free vectors here. + * sched-rgn.c (compute_block_backward_dependencies): Not here. + (last_was_jump): New static variable. + (schedule_more_p): Test it. + (init_ready_list): Initialize it. + (can_schedule_ready_p): Set it if we have a JUMP_INSN. + + * config/i386/i386.h (MD_SCHED_INIT): Add new arg. + * config/m32r/m32r.h (MD_SCHED_INIT): Add new arg. + * config/sparc/sparc.h (MD_SCHED_INIT): Add new arg. + + * md.texi (cycle_display): Document. + * tm.texi (MD_SCHED_INIT): Document new arg. + (MD_SCHED_FINISH, MD_SCHED_REORDER2): Document. + + * flow.c (ior_reg_cond, nand_reg_cond, not_reg_cond): Rewrite + to use different representation. All callers changed. + (and_reg_cond): Renamed from nand_reg_cond; caller changed. + (init_propagate_block_info): Don't test flags to determine + whether to compute conditional lifetimes. + Adjust code for new representation of conditional lifetimes. + (mark_regno_cond_dead): Similar adjustment. + (free_reg_cond_life_info): Similar adjustment. + (elim_reg_cond): New function. + (flush_reg_cond_1): Use it. + +2000-12-19 Catherine Moore + + * reload1.c (reload_combine): Take multi-hard-regs into account + when processing CALL_INSN_FUNCTION_USAGE. + +2000-12-19 Joseph S. Myers + + * invoke.texi (-print-search-dirs): Make references to cpp refer + to cpp0 instead. + +2000-12-18 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_p): Treat truth values as + non-negative. + +Tue Dec 19 00:37:08 2000 J"orn Rennecke + + * reload.c (push_reload): When using a dying register for the reload + register in an in-out reload, use outmode if wider than inmode. + +2000-12-19 Joseph S. Myers + + * config/d30v/d30v.h (EXIT_BODY): Update comment. + +2000-12-18 Joseph S. Myers + + * config.gcc (*-*-linux*): Don't define HAVE_ATEXIT or BSTRING. + * tm.texi (EXIT_BODY): Update documentation. + * config/freebsd.h, config/netware.h, config/arm/coff.h, + config/arm/conix-elf.h, config/arm/unknown-elf.h, + config/d30v/d30v.h, config/mcore/mcore.h, config/pj/pj.h, + sparc/sp86x-aout.h: Remove definitions of HAVE_ATEXIT (some + commented out) and associated comments. + +2000-12-18 Joseph S. Myers + + * c-common.c (STD_C9L, ADJ_STD): Define. + (printf_length_specs, scanf_length_specs): Mark "ll" as standard + STD_C9L. + (T99_LL): Rename to T9L_LL. + (T99_ULL): Rename to T9L_ULL. + (print_char_table, scan_char_table): Use T9L_LL and T9L_ULL + instead of T99_LL and T99_ULL. + (check_format_info_main): Use ADJ_STD on all format standard + versions being compared. + * c-common.h: Declare warn_long_long. + * c-tree.h: Don't declare warn_long_long. + +2000-12-18 Joseph S. Myers + + * COPYING: Update to current + ftp://ftp.gnu.org/pub/gnu/Licenses/COPYING-2.0 (fixes references + to 19yy as example year in copyright notice). + +2000-12-18 Neil Booth + + * c-lex.c (cb_file_change): Treat in_system_header as strictly + boolean (0 or 1). + +2000-12-18 Neil Booth + + * cppmain.c: Update print.lineno with -P. + +2000-12-18 Neil Booth + + * c-lex.c: s/change_file/file_change. + * cpplib.h: Similarly. + * cppmain.c: Similarly. + * fix-header.c: Similarly. + * cppfiles.c (stack_include_file): Pass the buffer location and + size to cpp_push_buffer. Generate the file_change callback, + so that sysp is already set. + * cpphash.h: Add _cpp_do_file_change. + * cpplib.c (do_line): Set buffer->sysp directly. Generate the + file_change callback after setting sysp. + (_cpp_do_file_change): Handle FC_ENTER and the FC_RENAME exception + here. + (cpp_push_buffer): Don't generate a callback. Clear sysp. + (cpp_pop_buffer): Clean up logic. + +2000-12-18 Benjamin Kosnik + + * configure.in (gcc_gxx_include_dir): Simplify. + (libstdcxx_incdir): Export. + * configure: Regenerate. + * Makefile.in (PREPROCESSOR_DEFINES): Add in + GPLUSPLUS_TOOL_INCLUDE_DIR bits here.. + (libstdcxx_incdir): Add. + * cppdefault.c (GPLUSPLUS_TOOL_INCLUDE_DIR): Add search path. + +2000-12-18 Neil Booth + + * c-lex.c (lex_lineno): Remove. + (init_c_lex, c_lex): Remove lex_lineno. + (cb_change_file): Update lineno correctly, both before calling + push_srcloc and before leaving the function. + (cb_def_pragma): Set lineno before outputting diagnostics. + +Sun Dec 17 18:45:41 2000 Richard Kenner + + * print-tree.c (print_node): Print DECL_USER_ALIGN and TYPE_USER_ALIGN. + Print TYPE_MIN_VALUE and TYPE_MAX_VALUE for REAL_TYPE. + Use print_node_brief to print bounds. + +2000-12-17 Neil Booth + + * cpplib.h (struct cpp_reader): Remove references to string_pool + and temp_string_pool. + * cppinit.c (cpp_create_reader, cpp_cleanup): Similarly; using + ident_pool in place. + * cpplex.c (parse_number, unescaped_terminator_p, parse_string, + save_comment, cpp_token_as_text): Similarly. + * cpplib.c (do_define, glue_header_name, parse_assertion): Similarly. + * cppmacro.c (make_number_token, builtin_macro, lock_pools, + unlock_pools, stringify_arg, paste_tokens): Similarly. + +Sun Dec 17 12:41:48 2000 Richard Kenner + + * dwarf2out.c (loc_descriptor_from_tree, case NOP_EXPR): New case. + (loc_descriptor_from_tree, case CONVERT_EXPR): Likewise. + (loc_descriptor_from_tree, case NON_LVALUE_EXPR): Likewise. + +2000-12-17 Richard Earnshaw + + * Makefile.in (check-po): Use $(MAKE). + (risky-stage1, risky-stage2, risky-stage3, risky-stage4): Likewise. + +2000-12-17 Neil Booth + + * cppmain.c (check_multiline_token): New function. + (scan_buffer): Use it. + (cb_change_file): Restructure to avoid warning. + * cpperror.c (print_location): Initialize col. + +2000-12-14 Philipp Thomas + + * protoize.c (main): Correctly set locale categories. + * gcc.c (main): Likewise. + * cppmain.c (general_init): Likewise. + * toplev.c (main): Likewise. + * gcov.c (main): Likewise. + * collect2.c (main): Likewise. + +2000-12-17 Kaveh R. Ghazi + + * c-common.c (c_common_nodes_and_builtins): Create a + cstring_endlink, use it. Rename int_ftype_string_string to + int_ftype_cstring_cstring, string_ftype_string_int to + string_ftype_cstring_int, and string_ftype_string_string to + string_ftype_cstring_cstring. Prefer sizetype_endlink and + int_endlink to manually recreating them. Fix the prototype + set for __builtin_strspn/__builtin_strcspn. + +2000-12-12 Marek Michalkiewicz + + * config/avr/avr.c (out_set_stack_ptr): Update comment. + (print_operand): Add support for %~ and %o. + +2000-12-17 Herman A.J. ten Brugge + + * c4x.h: Add ASM_OUTPUT_DEF definition for bounded pointer code. + +2000-12-17 Neil Booth + + * c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up. + * cpperror.c (print_containing_files): Get right line number. + (print_location): Output column of 1 if 0. + * cppfiles.c (stack_include_file): cpp_push_buffer handles + the callback. + * cpphash.h (_cpp_do_file_change): No longer external. + * cpplib.c (do_file_change): Now local to cpplib.c. + (do_line): Fake a buffer stack for preprocessed files. + (cpp_push_buffer): Create a file_change callback. Handle faked + buffers. + (cpp_pop_buffer): Similarly. + * cpplib.h: BUF_FAKE: New buffer type. + * cppmain.c: Update to handle correct file renaming where a + #line is the first line of the main file, and produce only + the renamed file, not the original file, as output. + +2000-12-17 Michael Hayes + + * config/c4x/c4x.md: Remove redundant @s from output patterns. + +2000-12-17 Michael Hayes + Herman A.J. ten Brugge + + * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Call c4x_init_pragma. + + * config/c4x/c4x-protos.h (c4x_init_pragma): New prototype. + + * config/c4x/c4x.c (c4x_init_pragma): New function. + (c_lex_func): New variable. + (c4x_parse_pragma): Use c_lex_func. + +2000-12-17 Michael Hayes + Herman A.J. ten Brugge + + * config/c4x/c4x.h (MD_INIT_BUILTINS): Add void_list_node argument + to c4x_init_builtins. + + * config/c4x/c4x-protos.h (c4x_init_builtins): Add tree argument. + + * config/c4x/c4x.c (c4x_init_builtins): Add tree argument. + (c4x_output_ascii): Fix. + +2000-12-17 Michael Hayes + Herman A.J. ten Brugge + + * config/c4x/c4x.h (MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): Define. + + * config/c4x/c4x-protos.h (c4x_init_builtins): New prototype. + (c4x_expand_builtin): Likewise. + + * config/c4x/c4x.c (c4x_init_builtins): New function. + (c4x_expand_builtin): Likewise. + + * config/c4x/c4x.md (floatunsqihf2): New pattern. + (*floatqihf2_set, *fixhfqi_set, fix_trunchfqi2): Likewise. + (fixuns_trunchfqi2, toieee, frieee, *ldhf_conditional): Likewise. + (*ldhf_conditional_noov, movhfcc, trap, cond_trap_cc): Likewise. + (*toieee_movqf_clobber, *frieee_movqf_clobber): Likewise. + +2000-12-17 Michael Hayes + + * libgcc2.h: Use Wtype for SItype and DWtype for DItype in prototypes. + * libgcc2.c (__absvsi2): Use Wtype and DWtype. + (__absvdi2, __addvsi3, __addvdi3, __subvsi3): Likewise. + (__subvdi3, __mulvsi3, __mulvdi3, __negvsi2, __negvdi2): Likewise. + +2000-12-16 Alexandre Oliva + + * config/sh/sh.h (INITIALIZE_TRAMPOLINE): Enclose the block + statement in do/while(0). + +Sat Dec 16 19:56:24 MET 2000 Jan Hubicka + + * i386.md (ashrsi3_cmpno, ashrhi3_cmpno, ashrqi3_cmpno, lshrsi3_cmpno, + lshrhi3_cmpno): Remove redundant '@' from the template. + + * i386.md (cmpstrsi_1): Fix type of the compare. + + * genattrtab.c (attr_rtx_cost): New function. + (simplify_test_exp): Avoid overactive inlining; use temporary + obstacks for tests. + +Sat Dec 16 10:41:11 2000 Richard Kenner + + * diagnostic.c (finish_abort): Deleted. + (fatal): Add code from finish_abort. + (error_recursion, fancy_abort): Call fatal, not finish_abort. + (trim_filename): Remove leading "../". + * diagnostic.h (finish_abort): Deleted. + * toplev.c (crash_signal): Call fatal, not finish_abort. + + * stor-layout.c (place_field): Treat overflowing DECL_SIZE_UNIT + as if size were variable. + + * expmed.c (expand_mult): Write REG_EQUAL note with proper mode. + +2000-12-16 Neil Booth + + * tradcpp.c: T_WARNING: New. + (do_warning): New function. + (finclude): Skip past the newline and increase the line number + before calling output_line_command. + (do_line): Skip the new line after output_line_command. Don't + pre-decrement the line number. + +2000-12-15 Diego Novillo + + * i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix references to + _GLOBAL_OFFSET_TABLE_ when using Intel syntax. + +2000-12-15 Jakub Jelinek + + * gcc.c (cpp_options): Pass -fno-operator-names. + * cpplib.h (struct cpp_options): Add operator_names. + * cppinit.c (cpp_create_reader): Initialize it. + (initialize_builtins): If -fno-operator-names, don't add + C++ alternate operator names. + (COMMAND_LINE_OPTIONS): Add -fno-operator-names. + (cpp_handle_option): Clear operator_names. + +2000-12-15 Jason Merrill + + * jump.c (jump_optimize_1): Don't delete the line note after the + prologue even if it seems redundant. + + * config/arm/arm.c (arm_expand_prologue): Set RTX_FRAME_RELATED_P + on all insns used to adjust the stack. + +Fri Dec 15 15:32:16 MET 2000 Jan Hubicka + + * combine.c (cant_combine_insn_p): Get around SUBREGs when determining + hardreg<->reg moves. + +Fri Dec 15 14:48:37 MET 2000 Jan Hubicka + + * genrecog.c (add_to_sequence): Remove special case for + const_int_operand. + (maybe_both_true): Return 1 when falling out of sequence when + trying to find common position in the pattern. + +Fri Dec 15 14:44:51 MET 2000 Jan Hubicka + + * integrate.c (copy_rtx_and_substitute): Copy mode too. + +Fri Dec 15 14:11:57 MET 2000 Jan Hubicka + + * flow.c (notice_stack_pointer_modification_1): Cleanup. + +2000-12-15 Alexandre Oliva + + * function.c (adjust_trampoline_addr): New function. + (trampoline_address): Call it instead of round_trampoline_addr(). + * tm.texi (TRAMPOLINE_ADJUST_ADDRESS): Document it. + +2000-12-14 Zack Weinberg + + * cppfiles.c (hack_vms_include_specification): Delete function + (not used since 1998). + +Fri Dec 15 03:37:51 2000 J"orn Rennecke + + * haifa-sched.c (sched_init): Don't put a note in front of any BARRIER. + +2000-12-14 Jim Wilson + + * alias.c (get_alias_set): Call record_component_aliases for + COMPLEX_TYPE. + (record_component_aliases): Handle COMPLEX_TYPE. + +2000-12-14 Kaveh R. Ghazi + + * fixinc/gnu-regex.c: Disable NLS. + +2000-12-14 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_conditional_move): Do not swap + comparison operands when that would create non-canonical rtl. + + * config/i386/i386.md (umulsi3_highpart): Remove * from name. + (smulsi3_highpart): Likewise. + +2000-12-14 Neil Booth + + * gcc.c (cpp_options): Add -remap. + +2000-12-14 Neil Booth + + * gcc.c (cpp_options): Update to use '&'. + (struct switchstr): Change type of validated to save space. + New member 'ordering'. + (handle_braces, validate_switches): Update to handle '&'. + +2000-12-13 Laurynas Biveinis + + * fixinc/inclhack.def: skip stdio_va_list fix if __DJ_va_list + found in a header. + * fixinc/fixincl.x: regenerated. + +2000-12-13 DJ Delorie + + * config.gcc (cygwin, win32, mingw32): Use float-i386.h. + +2000-12-13 Tom Tromey + + * gcc.c (handle_braces): Handle %{ + + * function.c (assign_parms): Optimize incoming PARALLELs into + REGs if possible. + +2000-12-13 Bruce Korb + + * fixinc/Makefile.in(*): substantial rewrite to accommodate systems + that cannot handle bi-directional pipes, viz. BeOS and DOS. + * fixinc/fixlib.h(IGNORE_ARG): new macro + (STATIC): define for all of fixinc to use + * fixinc/fixfixes.c(*): eliminate unused arg warnings + * fixinc/fixtests.c(*): ditto + * fixinc/fixincl.c(start_fixer): chain_open now uses const arg list + * fixinc/gnu-regex.c: reorder some includes to avoid _GNU_SOURCE + warning. Also, eliminate the ``#ifdef emacs'' stuff. + (re_syntax_options): make global as it is declared so. + * fixinc/mkfixinc.sh: process the argument list more consistently + (beos/msdosdjgpp): set TARGETS to twoprocess vs. oneprocess + * fixinc/procopen.c(globals): include "fixlib.h" for std defs + * fixinc/server.c(globals): ditto + * fixinc/server.h(defines): ditto + +2000-12-13 Neil Booth + + * tradcpp.c (special_symbol): Improve test for definedness, + though it is still not perfect. + (do_define): Don't define illegal macro names. + +2000-12-07 Aldy Hernandez + + * config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits + if changing into .bss section. + * config/mips/elf64.h: same. + * config/mips/iris6.h: same. + * config/mips/netbsd.h: same. + * config/mips/openbsd.h: same. + +2000-12-13 Neil Booth + + * cppfiles.c (read_name_map): Return null if open () fails. + (remap_filename): Simplify logic. Add ICE if it doesn't work + as expected. Perform secondary lookup attempt on base filename + only. + +Wed Dec 13 19:48:04 MET 2000 Jan hubicka + + * flow.c (notice_stack_pointer_modification_1): Notice midifications + using PRE_MODIFY and POST_MODIFY. + +Wed Dec 13 17:25:32 MET 2000 Jan Hubicka + + * genoutput.c (process_template): Add sanity checking for '@' templates. + +2000-12-13 Bernd Schmidt + + * simplify-rtx.c (cselib_finish): Free reg_values and used_regs + varrays. + +2000-12-12 Mike Stump + + * Makefile.in (distclean): Remove safe-ctype.c as well. + +2000-12-12 Brad Lucier + + * tradcpp.c (do_error): Cast difference of pointers to int + for error message. + +2000-12-12 Franz Sirl + + * config/rs6000/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Move from here... + * config/rs6000/sysv4.h (HANDLE_PRAGMA_PACK_PUSH_POP): ...to here. + +2000-12-12 Jim Wilson + + * rtlanal.c (may_trap_p): Check operand modes of LE, LT, GE, and GT. + +2000-12-12 Alexandre Oliva + + * configure.in: Simplify language enabling/disabling code. + * configure: Rebuilt. + * ch/config-lang.in (target_libs): Set. + (build_by_default): Set to no. + * cp/config-lang.in (target_libs): Set. + * f/config-lang.in (target_libs): Set. + * java/config-lang.in (target_libs): Set. + * objc/config-lang.in (target_libs): Set. + +2000-12-12 Neil Booth + + * tradcpp.c (enum node_type): Add T_ERROR. + (do_error): New function. + (directive_table): Add #error handler. + +2000-12-12 Franz Sirl + + * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): Enable .file/.loc check + for powerpc*-*-*. + * configure: Regenerated. + * config/rs6000/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + * config/rs6000/rs6000.c (rs6000_unique_section): Use + STRIP_NAME_ENCODING. + +Mon Dec 11 13:51:09 2000 Jeffrey A Law (law@cygnus.com) + + * pa.c (cmpib_comparison_operator): Remove GEU and LTU. + * pa.h (PREDICATE_CODES, cmpib_comparison_operator): Corresponding + changes. + +2000-12-11 Bruce Korb + + * fixinc/fixincl.tpl: initialize all fields for warnings + * fixinc/fixincl.x: regenerate + +2000-12-11 Neil Booth + + * tradcpp.h: For tradcpp, NUL is not whitespace. + +2000-12-11 Neil Booth + + * fix-header.c (read_scan_file): Macro expansion is not a file buffer. + +2000-12-05 Marek Michalkiewicz + + * config/avr/avr.c (compare_condition, compare_sign_p): New functions. + (compare_diff_p, compare_eq_p): Call compare_condition. + (out_tsthi, out_tstsi): Call compare_sign_p. + (avr_progmem_p): Check for error_mark_node. + +2000-12-11 Neil Booth + + * cpperror.c (print_location): New function. + (print_containing_files): Simplify. + (_cpp_begin_message): Simplify and use print_location. + * cppfiles.c (stack_include_file): Update. + (_cpp_pop_file_buffer): Update. + * cpphash.h (struct cpp_buffer): New members + include_stack_listed and type. + * cpplib.c (_cpp_handle_directive): Buffer->inc is not null. + (run_directive): Take buffer type. cpp_push_buffer cannot fail. + (_cpp_do__Pragma, cpp_define, _cpp_define_builtin, cpp_undef, + handle_assertion): Update. + (cpp_push_buffer): Take a buffer type and file name. + (cpp_pop_buffer): Update. Clear include_stack_listed. + * cpplib.h (input_stack_listing_current): Remove. + (enum cpp_buffer_type): New. + (cpp_push_buffer): New prototype. + * cppmacro.c (builtin_macro): Simplify; buffer cannot be null. + * fix-header.c (read_scan_file): Update. + +2000-12-10 Robert Lipe + + * install.texi (i*86-*-sco3.2v5*): Remove information duplicated + in html version. + +2000-12-10 Richard Henderson + + * genrecog.c (find_operand): Handle 'V' format code. + (find_matching_operand): New. + (validate_pattern): Accept '=' for an in-out operand if there + is another operand with a matching constraint. + + * config/i386/i386.md (andqi_ext_0_cc): Use matching constraint + for op1 to op0. + +2000-12-10 Richard Henderson + + * genrecog.c (validate_pattern) [STRICT_LOW_PART]: Fix thinko. + +2000-12-09 Richard Henderson + + * genrecog.c (validate_pattern): Verify that ZERO_EXTRACT and + STRICT_LOW_PART as SET_DEST have in-out constraints. + +2000-12-09 Joseph S. Myers + + * c-common.c (check_function_format): Don't suggest adding format + attributes to functions with no parameter to which to add them. + +2000-12-09 Nick Clifton + + * config/arm/arm.c (arm_expand_prologue): Mark the generated + insn not the set as being DWARF2_FRAME_RELATED_P. + +2000-12-09 Laurynas Biveinis + + * Makefile.in: use $(build_exeext) for all build + system executable targets. + +2000-12-09 Laurynas Biveinis + + * install.texi: remove i[345]86-*-winnt3.5 section. + * configur.bat: removed. + * config/msdos: directory removed. + +2000-12-09 Neil Booth + + * cppfiles.c (NEVER_REREAD, DO_NOT_REREAD): Move from cpphash.h. + * cpphash.h (NEVER_REREAD, DO_NOT_REREAD, ABSOLUTE_PATH): Delete. + * cpplex.c (parse_identifier): Improve diagnostic. + (_cpp_lex_token): Return unconditionally at the end of a directive. + * cpplib.c (read_flag): Verify legality of each flag. + (end_directive): Resotre pfile->skipping before skip_rest_of_line. + (do_line): Use the new read_flag. + * cppmacro.c (struct cpp_macro, parse_arg, replace_args, + check_macro_redefinition, parse_params): Rename var_args to + variadic. + +2000-12-09 Joseph S. Myers + + * .cvsignore: Add info files. + +2000-12-08 Laurynas Biveinis + + * config/winnt: Remove obsolete directory. + * install.texi (Configurations): Remove obsolete documentation for + Windows NT. + +2000-12-08 Joseph S. Myers + + * configure.in: Don't define INSTALL_INFO. + * configure: Regenerate. + * Makefile.in (INSTALL_INFO): Remove. + (info): Depend on info files in source directory. + (cpp.info, gcc.info, c-tree.info): Build info files in source + directory. + (distclean): Don't remove info files. + (maintainer-clean): Remove info files from source directory. + (install-normal): Depend on install-info. + (install-info): Install info files from source directory, if they + exist. + * texinfo.tex: Update to version 2000-11-09.08 from ftp.gnu.org. + +2000-12-08 Alexandre Oliva + + * lcm.c (optimize_mode_switching): Check whether an insn is a NOTE + before taking its NOTE_LINE_NUMBER. + +2000-12-08 Nick Clifton + + * config/arm/arm.md (load_indirect_jump): Add pool ranges. + + * extend.texi: Document ARM "interrupt" function attribute. + Mention that the ARM also support the "naked" function + attribute. + + * config/arm/arm-protos.h (arm_current_func_type): Add + prototype. + + * config/arm/arm.h (EXCEPTION_LR_REGNUM): Define. + (struct machine_function): Add 'func_type' field. + Define bit values for 'func_type' field. + (ARM_FUNC_TYPE): New macro. + (IS_INTERRUPT): New macro. + (IS_VOLATILE): New macro. + (IS_NAKED): New macro. + (IS_NESTED): New macro. + (ARM_INITIAL_ELIMINATION_OFFSET): Use IS_VOLATILE. + + * config/arm/arm.c (isr_attribute_args): New Structure. A + list of "interrupt" function attribute modifiers. + (arm_isr_value): New Function: Returns the type of the current + interrupt function. + (arm_compute_func_type): New Function: Computes the type of + the current function. + (arm_current_func_type): New Function: Returns the type of the + current function. + (use_return_insn): Use arm_current_func_type. + (arm_valid_type_attribute_p): Accept "interrupt" function + attribute. + (arm_comp_type_attributes): Check "interrupt" attributes. + (arm_valid_machine_decl): Accept "interrupt" function + attribute. + (arm_function_ok_for_sibcall): Do not allow interrupt + functions to use sibcalls. + (arm_naked_function_p): Delete. + (print_multi_reg): Remove redundant parameter 'hat'. + (arm_compute_save_reg_mask): New Function: Compute a bit mask + of registers saved during the current function's prologue. + (output_arm_return_instruction): Use arm_current_func_type. + Generate return instruction when LR is not poppsed off the + stack. + (arm_volatile_func): Delete. + (output_arm_prologue): Use arm_current_func_type and + arm_compute_save_reg_mask. + Note presernce of interrupt functions. + (arm_output_epilogue): Use arm_current_func_type and + arm_compute_save_reg_mask. + (arm_expand_prologue): Use arm_current_func_type and + arm_compute_save_reg_mask. + (arm_init_machine_status): Initialize func_type field, if + necessary. + (thumb_expand_prologue): Use arm_current_func_type. + (output_thumb_prologue): Use arm_current_func_type. + +2000-12-08 Brad Lucier + + * tradcpp.c (do_include): Make pointer differences 64-bit clean. + +Fri Dec 8 08:23:29 2000 J"orn Rennecke + + * fp-bit.c (_fpmul_parts): Use USItype variables as inputs + for multiplies. + +2000-12-07 Mike Stump + + * Makefile.in (distclean): Remove alloca.c hashtab.c. + +2000-12-07 Zack Weinberg + + * Makefile.in (HOST_RTL): Add safe-ctype.o. + (safe-ctype.o): New rule. + * system.h: Include safe-ctype.h, not ctype.h. No need to + wrap ctype macros. + + * cpphash.h: Zap IStable and related macros. Define is_* in + terms of safe-ctype.h macros. + * cppinit.c: Delete the IStable and all related code. + + * tradcpp.c: Delete is_idchar, is_idstart, is_hor_space, and + is_space arrays. Delete initialize_char_syntax. Change all + references to the above arrays to use macros instead. + * tradcpp.h: Define is_idchar, is_idstart, is_space, and + is_nvspace in terms of safe_ctype.h's macros. + * tradcif.y: is_idchar, is_idstart are macros not arrays. + + * config/i370/i370.c, config/winnt/dirent.c, + config/winnt/fixinc-nt.c, config/winnt/ld.c: + Use uppercase ctype macros. If we included ctype.h, + include safe-ctype.h instead. + + * fixinc/fixfixes.c: Use uppercase ctype macros. Don't test + ISLOWER(c) before calling TOUPPER(c). + * fixinc/fixincl.c (extract_quoted_files): Simplify out some gunk. + * fixinc/gnu-regex.c: Include safe-ctype.h, not ctype.h. No need to + wrap ctype macros. Don't test ISUPPER(x) before calling TOLOWER(x). + +2000-12-07 DJ Delorie + + * c-decl.c (grokdeclarator): preserve previous alignments when + rebuilding array types. + +2000-12-07 Neil Booth + + * cppfiles.c (struct include_file): Move from cpphash.h. + (_cpp_never_reread): New function. + (open_file, read_include_file): Use it. + (stack_include_file): Set the buffer's sysp according to the + path in which the file was found. + (find_include_file): Don't set sysp. + (cpp_make_system_header, actual_directory): Update. + (_cpp_execute_include): Do #include_next lookup handling here, + not in cpplib.c. Use _cpp_never_reread. + * cpphash.h (struct_include_file): Remove. + (struct cpp_buffer): New member sysp. + (CPP_IN_SYSTEM_HEADER, _cpp_execute_include): Update. + (_cpp_never_reread): New. + * cpplib.c (read_line_number): Rename read_flag. Rework slightly. + (end_directive): Clear line_extension flag. + (_cpp_handle_directive): Set line_extension flag for #number. + (do_include_next): Handle path lookup in _cpp_execute_include. + (do_line): Cleanup to use read_flag. Don't allow flags in #line. + (_cpp_do_file_change): Update. + (do_pragma_once): Use cpp_never_reread. Clean up. + * cpplib.h (struct lexer_state): New member line_extension. + +2000-12-07 Richard Henderson + + * flow.c (calculate_global_regs_live): Force the stack pointer live + after reload as well. + +2000-12-07 Bruce Korb + + * fixinc/Makefile.*(exeext): the variables are exeext, the + substitution expression is build_exeext. + +2000-12-07 Neil Booth + + * c-common.c (parse_in): Make a cpp_reader *. + * cppfiles.c (_cpp_fake_include): Remove. + * cpphash.h: Similarly. + * cpplib.c (do_line): Don't call _cpp_fake_include. A valid + #line always creates a callback; FC_RENAME if there are no + #line flags. + * fix-header.c (read_scan_file): cpp_push_buffer cannot fail. + The first EOF must be our get_char buffer. + +2000-12-07 Joseph S. Myers + + * c-common.c (warn_format_security): New variable. + (check_format_info): Warn about non-literal formats with no format + arguments if either -Wformat-nonliteral or -Wformat-security is + specified. + (set_Wformat): Set warn_format_security for settings other than 1. + * c-common.h (warn_format_security): Declare. + * c-decl.c (c_decode_option): Decode -Wformat-security and + -Wno-format-security. + * invoke.texi: Document -Wformat-security. + * toplev.c (documented_lang_options): Include -Wformat-security + and -Wno-format-security. + +2000-12-07 Joseph S. Myers + + * c-common.c (check_format_info): Warn for non-constant format + strings with strftime formats if -Wformat-nonliteral. Where the + format can convert arguments, if the format is not a string + literal and there are no arguments to the format, give a different + warning message from the general non-string-literal case. + +2000-12-07 Joseph S. Myers + + * c-common.c (format_wanted_type): Add reading_from_flag. + (print_char_table): Mark %s and %S formats with flag "R". + (check_format_info_main): Set up reading_from_flag appropriately. + If aflag, always set writing_in_flag rather than relying on the + format used being a scanf format and so having it set. + (check_format_types): Check for formats reading through null + pointers. + +2000-12-07 Joseph S. Myers + + * invoke.texi (-Wformat): Document what format features are + checked. + +2000-12-06 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. + +2000-12-06 Joel Sherrill + + * config.gcc (a29k*-*-rtems*, arm*-*-rtems*, c4x-*-rtems*, + h8300-*-rtems*, hppa1.1-*-rtems, *mips*-*-rtems*): New targets. + * config.gcc (*-rtems*): Add support for gthr-rtems.h. + * gthr-rtems.h, config/a29k/rtems.h, config/arm/rtems-elf.h, + config/h8300/rtems.h, config/mips/rtems.h: New files. + +2000-12-06 Mark Kettenis + + * config.gcc: Reorganize handling of *-*-gnu*, to share target + specific make details with Linux. Update comments to clarify + the distinction between GNU/Linux and GNU/Hurd. + +Wed Dec 6 19:22:02 2000 Jeffrey A Law (law@cygnus.com) + + * contrib.texi: Fix my email address. Update Per's + list of contributions. + +2000-12-06 Rodney Brown + + * c-lex.c (cb_indent): Decorate `str' argument, unused on HP-UX. + * collect2.c (scan_libraries): Remove unused `ch'. + (COFF specific stuff): Prototype ldgetname. Declare and prototype + ldbtread and ldclose. + + * config/alpha/osf.h: Standarize copyright statement. + * config/arc/arc.h: Likewise. + * config/arm/elf.h config/arm/coff.h config/arm/aout.h: Likewise. + * config/arm/arm.c config/arm/arm.h: Likewise. + * config/elxsi/elxsi.h: Likewise. + * config/i386/sco.h: Likewise. + * config/m68k/crds.h config/m68k/hp320.h config/m68k/lynx.h: Likewise. + * config/m68k/m68kv4.h config/m68k/next21.h: Likewise. + * config/m68k/sun3.h: Likewise. + * config/m88k/dgux.h config/m88k/dguxbcs.h: Likewise. + * config/pdp11/2bsd.h config/pdp11/pdp11.h: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/aix41.h: Likewise. + * config/sparc/sysv4.h: Likewise. + * config/we32k/we32k.c config/we32k/we32k.h: Likewise. + * fixinc/gnu-regex.c fixinc/gnu-regex.h: Likewise. + * cpplib.h cppexp.c cselib.h profile.c: Likewise. + * longlong.h: Likewise. + * libgcc2.c: Likewise. + +2000-12-06 Herman A.J. ten Brugge + + * machmode.def: Use correct definition for BITSIZE on targets where + BITS_PER_UNIT != 8. + +2000-12-06 Bruce Korb + + * fixinc/Makefile.*: Reduce differences to (ultimately) reduce + the number of them. + +2000-12-06 J. David Anglin + + * pa.c: Include expr.h before c-tree.h. + (remove_useless_addtr_insns): Use reverse_condition_maybe_unordered + instead of reverse_condition. + (print_operand): Correct predicates for GT, GE, LT and LE. Add + predicates for LTGT, UNLE, UNLT, UNGE, UNGT, UNEQ, UNORDERED and + ORDERED. + (cmpib_comparison_operator): Add GEU and LTU codes. + * pa.h (PREDICATE_CODES): Add codes for cmpib_comparison_operator. + * pa.md (bltgt, bunle, bunlt, bunge, bungt, buneq, bunordered, + bordered): New float conditional branch patterns. + +Wed Dec 6 21:03:41 2000 J"orn Rennecke + + * final.c (final_addr_vec_align): Fix clipping to BIGGEST_ALIGNMENT. + +2000-12-06 Sylvain Pion + + * cpplex.c (skip_escaped_newlines): Don't warn for spaces between + backslash and newline, when inside a comment. + +2000-12-06 Joseph S. Myers + + * invoke.texi: Use @table @samp instead of @itemize @minus for + table of language standards. Fix use of @pxref. From Zack + Weinberg. Also exclude specs documentation from generated + manpage, and create separate ENVIRONMENT section. + +2000-12-06 Michael Matz + + * gcse.c (compute_pre_data): Kill trapping expressions in + destination blocks of abnormal edges. + +2000-12-05 Richard Sandiford + + * config/mn10300/mn10300.c (mn10300_print_reg_list): Added. + (mn10300_get_live_callee_saved_regs): Likewise. + (mn10300_gen_multiple_store): Likewise. + (store_multiple_operation): Likewise. + (expand_prologue): Use mn10300_gen_multiple_store(). + * config/mn10300/mn10300-protos.h (mn10300_print_reg_list): Added. + (mn10300_get_live_callee_saved_regs): Likewise. + (mn10300_gen_multiple_store): Likewise. + (store_multiple_operation): Likewise. + * config/mn10300/mn10300.md (store_movm): Use a MATCH_PARALLEL + tied to store_multiple_operation(). + +Tue Dec 5 20:09:14 2000 Jeffrey A Law (law@cygnus.com) + + * builtins.c (expand_builtin_setjmp_setup): Set + current_function_has_nonlocal_label. + +2000-12-05 Neil Booth + + * cppfiles.c (stack_include_file): Push zero-length buffers + in case of failure. Return void, as we don't fail any more. + (read_include_file): Check for files we shouldn't re-read. + Don't return an error code; errors are implied by marking the + file NEVER_REREAD. + (_cpp_execute_include): Move the recursion and in-macro checks + here. Update for stack_include_file not failing. + * cpplib.c (cpp_push_buffer): Always succeed, since + _cpp_execute_include performs the recursion check. Tidy up. + * cpplib.h (cpp_push_buffer): Update prototype. + +2000-12-05 Alexandre Oliva + + * sched-vis.c (visual_tbl_line_length): New variable. + (get_visual_tbl_length): Set it. + (visualize_stall_cycles): Don't let stalls overrun + visual_tbl_line_length. + +2000-12-05 Geoffrey Keating + + * global.c (global_conflicts): Allow for a REG_UNUSED note + with a different mode to the REG set in the insn. + +2000-12-05 Kaveh R. Ghazi + + * Makefile.in (fixinc.sh): Pass $WARN_CFLAGS into fixinc dir. + + * fixinc/Makefile.in (FIXINC_DEFS): Add $(WARN_CFLAGS). + +2000-12-05 Bruce Korb + + * fixinc/mkfixinc.sh(*-gnu*): activate fixinc for GNU/Hurd and + GNU/Linux. + +2000-12-05 Richard Earnshaw + + * fixinc/mkfixinc.sh: Run fixinc on netbsd. + * fixinc/inclhack.def (machine/ansi.h): Run this rule on all files, + to cope with aliased copies. + * fixinc/fixincl.x: Regenerate. + +2000-12-05 Bernd Schmidt + + * sched-vis.c: Guard with #ifdef INSN_SCHEDULING. + * sched-rgn.c: Likewise. + (rgn_print_insn): Fix output. + +2000-12-05 Bruce Korb + + * fixinc/Makefile.*: make these more consistent + * fixinc/mkfixincl.sh: enable BeOS fixincludes + +2000-12-05 Richard Henderson + + * stmt.c (warn_if_unused_value): Move side effects test earlier. + +2000-12-05 Alan Modra + + * bb-reorder.c (reorder_basic_blocks): Do check for EH edges even + when using sjlj. + +2000-12-05 Richard Henderson + + * flow.c (calculate_global_regs_live): Only force stack pointer + live before reload. Force pic register live before reload. + (insn_dead_p): Don't protect pic references from deletion. + +2000-12-05 Joseph S. Myers + + * invoke.texi: Add support for using texi2pod.pl. Don't use + @multitable. + +2000-12-04 Nick Clifton + + * config/arm/arm.c (arm_override_options): Test 'insn_flags' not + 'tune_flags' for XScale nature. + Remove spurious test of HARD_FLOAT and XScale flags. + + * config/arm/arm.md (umulsidi3adddi): Restore "=&r" register + contraint, accidentally changed during XScale contribution. + + * config/arm/lib1funcs.asm (interwork_call_via_, call_via_): Do + not create these functions if the target architecture does not + support Thumb instructions. + +2000-12-04 Joseph S. Myers + + * ONEWS: New file with the current contents of NEWS up to EGCS + 1.1. + * NEWS: Generate automatically from online release notes from EGCS + 1.0 to GCC 2.95.2, using ../contrib/gennews. + +2000-12-04 Neil Booth + + * tradcif.y: Move lexptr to top of file. Add rule to handle + assertions in conditional expressions. + * tradcpp.c (parse_answer): Assertions do not need to go to + end of line in conditional directives. + (parse_assertion): Get first character of identifiers correct. + (test_assertion): New function. + * tradcpp.h (test_assertion): New prototype. + +2000-12-01 Rodney Brown + + * config.gcc: Fix typo for UnixWare 7. + +2000-12-03 Phil Edwards + + * invoke.texi: Replace `pedwarns' with clearer text. + +2000-12-04 Bruce Korb + + * fixinc/Makefile.*(clean): don't clean autogenerated files. + (mainainer-clean): clean autogenerated files + +2000-12-04 DJ Delorie + + * md.texi: Add overview, clarify match_dup and define_expand. + +2000-12-04 DJ Delorie + + * print-tree.c (print_node): Target-specific builtins print + numbers, not names. + +2000-12-04 Jason Merrill + + * stor-layout.c (int_mode_for_mode): Handle MODE_VECTOR_INT, + MODE_VECTOR_FLOAT. + + * diagnostic.c (report_problematic_module): s/function/module/. + + * c-lex.h: Remove decl for check_newline. + +2000-12-04 Gerald Pfeifer + + * README.APOLLO: Remove obsolete file. + +2000-12-04 Neil Booth + + * cppinternals.texi: New file. + +2000-12-04 Neil Booth + + * cppfiles.c (cpp_make_system_header): Take 2 booleans, + and operate on current buffer. + (cpp_read_file): Rename _cpp_read_file. + * cpplib.c (do_line, do_pragma_system_header): Update calls to + cpp_make_system_header. + * fix-header.c: Similarly. + * cpphash.h (_cpp_read_file): Move from... + * cpplib.h: ... here. + * cppinit.c (do_includes, cpp_start_read): Update appropriately. + +2000-12-03 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strspn, expand_builtin_strcspn): + Handle another transformation. + +2000-12-03 Nick Clifton + + * config.gcc: Add support for StrongARM targets. + * config/arm/t-strongarm-elf: New file. + * config/arm/t-strongarm-coff: New file. + * config/arm/t-strongarm-pe: New file. + * config/arm/strongarm-pe.h: New file. + +2000-12-03 Nick Clifton + + * NEWS: Mention XScale has been added. + * config.gcc: Add support for XScale targets. + * config/arm/arm.h: Add support for XScale processor. + * config/arm/arm.c: Add support for XScale processor. + * config/arm/arm.md: Add support for XScale processor. + * config/arm/t-xscale-elf: New file. + * config/arm/t-xscale-coff: New file. + * config/arm/xscale-elf.h: New file. + * config/arm/xscale-coff.h: New file. + +2000-12-03 Richard Henderson + + * bb-reorder.c (reorder_basic_blocks): Don't check for EH edges + unless exception handling is enabled, and if not using sjlj. + + * builtins.c (expand_builtin_setjmp_setup): New. + (expand_builtin_setjmp_receiver): New. + (expand_builtin_setjmp): Split out _setup and _receiver functions. + Move argument parsing in from ... + (expand_builtin): ... here. + * except.c (receive_exception_label): Branch around receiver + unless new-style exceptions. Call expand_builtin_setjmp_receiver. + (start_dynamic_handler): Call expand_builtin_setjmp_setup. + * expr.h: Update builtin setjmp decls. + +2000-12-03 Bruce Korb + + * fixinc/mkfixinc.sh(build machine): Sometimes, there is no canonical + build machine name. Default to the target. + +2000-12-03 Laurynas Biveinis + + * Makefile.in: use $(build_canonical), not $(canonical_build). + +2000-12-03 Bernd Schmidt + + * Makefile.in (OBJS): Add sched-rgn.o. + (sched-rgn.o): New rule. * haifa-sched.c (sched_verbose): No + longer static. + (INSN_PRIORITY, INSN_COST, INSN_UNIT, INSN_REG_WEIGHT, + INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, ENCODE_BLOCKAGE, + UNIT_BLOCKED, BLOCKAGE_RANGE, MIN_BLOCKAGE_COST, + MAX_BLOCKAGE_COST): Move to sched-int.h. + (MAX_RGN_BLOCKS, MAX_RGN_INSNS, INSN_REF_COUNT, FED_BY_SPEC_LOAD, + IS_LOAD_INSN, struct haifa_edge, edge_table, NEXT_IN, NEXT_OUT, + FROM_BLOCK, TO_BLOCK, nr_edges, in_edges, out_edges, IN_EDGES, + OUT_EDGES, edgelst, struct region, nr_regions, rgn_table, + rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, + RGN_BLOCKS, BLOCK_TO_BB, BB_TO_BLOCK, CONTAINING_RGN, + debug_regions, find_single_block_region, find_rgns, too_large, + init_regions, current_nr_blocks, current_blocks, bitset, bitlst, + bitlst_table_last, bitlst_table_size, bitlst_table, bitset_member, + extract_bitlst, bblst, struct candidate, candidate_table, + bblst_table, bblst_size, bblst_last, IS_VALID, IS_SPECULATIVE, + SRC_PROB, target_bb, split_edges, compute_trg_info, + debug_candidate, debug_candidates, bbset, bbset_size, dom, + IS_RGN_ENTRY, IS_DOMINATED, prob, GET_SRC_PROB, edgeset, + rgn_nr_edges, rgn_edges, edgeset_size, edgeset_bitsize, + EDGE_TO_BIT, edge_to_bit, pot_split, ancestor_edges, + compute_dom_prob_ps, ABS_VALUE, INSN_PROBABILITY, + IS_SPECULATIVE_INSN, INSN_BB, MIN_DIFF_PRIORITY, MIN_PROBABILITY, + MIN_PROB_DIFF, check_live_1, update_live_1, check_live, + update_live, set_spec_fed, is_pfree, find_conditional_protection, + is_conditionally_protected, may_trap_exp, haifa_classify_insn, + is_prisky, is_exception_free, add_branch_dependences, + propagate_deps, compute_block_backward_dependences, + debug_dependencies, is_cfg_nonregular, build_control_flow, + new_edge, bb_deps, BITSET_UNION, BITSET_INTER, BITSET_DIFFER, + BITSET_INVERT, BITSET_ADD, BITSET_REMOVE, debug_regions, + UPDATE_LOOP_RELATIONS, INSN_TRAP_CLASS, WORST_CLASS, IS_REACHABLE, + CONST_BASED_ADDRESS_P, free_pending_lists, sched_target_n_insns, + target_n_insns, sched_n_insns, init_ready_list, deaths_in_region, + can_schedule_ready_p, new_ready, schedule_more_p, rgn_print_insn, + rgn_rank, region_sched_info): Move to sched-rgn.c. + (debug_reg_vector): Delete useless function. + (get_bb_head_tail): Likewise. + (insn_issue_delay, insn_cost, ready_add, get_block_head_tail, + no_real_insns_p, rm_line_notes, save_line_notes, + restore_line_notes, rm_redundant_line_notes, sched_init): No + longer static. + (rm_line_notes, save_line_notes, restore_line_notes, + schedule_block, set_priorities): Change argument to be a real + basic block, not one of haifa's "bb"s. All callers changed + (rm_other_notes): Initialize note_list here, not in + schedule_region. + (sched_finish): New function, called from schedule_insn. * * + sched-int.h (INSN_PRIORITY, INSN_COST, INSN_UNIT, INSN_REG_WEIGHT, + INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, ENCODE_BLOCKAGE, + UNIT_BLOCKED, BLOCKAGE_RANGE, MIN_BLOCKAGE_COST, + MAX_BLOCKAGE_COST): Moved here from haifa-sched.c. + (get_block_head_tail, no_real_insns_p, rm_line_notes, + save_line_notes, restore_line_notes, rm_redundant_line_notes, + rm_other_notes, insn_issue_delay, set_priorities, schedule_block, + sched_init, sched_finish, ready_add, insn_cost): Declare. + +2000-12-03 Laurynas Biveinis + Bruce Korb + + * Makefile.in: pass $(build_canonical) to mkfixinc.sh. + * fixinc/mkfixinc.sh: accept build system name as an argument. + Use it for choosing the fix build method. Use the target for + selecting special fix rules. + +2000-12-03 Bernd Schmidt + + * Makefile.in (OBJS): Add sched-deps.o. + (sched-deps.o): New rule. + * haifa-sched.c (struct deps, struct haifa_insn_data): Moved to + sched-int.h. + (INSN_DEPEND, INSN_LUID, CANT_MOVE, INSN_DEP_COUNT): Macros moved to + sched-int.h. + (SIZE_FOR_MODE): Delete unused macro. + (reg_known_equiv_p, reg_known_value, reg_pending_clobbers, + reg_pending_sets, reg_pending_sets_all, true_dependency_cache, + anti_dependency_cache, output_dependency_cache, + forward_dependency_cache): Variables moved to sched-deps.c. + (add_dependence, remove_dependence, find_insn_list, + find_insn_mem_list, add_insn_mem_dependence, flush_pending_lists, + sched_analyze_insn, sched_analyze_1, sched_analyze_2, + sched_analyze, group_leader, compute_forward_dependences, + init_deps, free_deps, init_dependency_caches, free_dependency_caches): + Functions moved to sched-deps.c. + (schedule_region): Call init_deps_global and finish_deps_global + instead of directly manipulating dependency data structures. + * sched-deps.c: New file. + (init_deps_global, finish_deps_global): New functions. + * sched-int.h (struct haifa_insn_data, struct deps): Moved here from + haifa-sched.c. + (h_i_d): Declare. + (INSN_DEPEND, INSN_LUID, CANT_MOVE, INSN_DEP_COUNT): Macros moved here + from haifa-sched.c. + + * Makefile.in (OBJS): Add sched-vis.o. + (sched-vis.o): New rule. + * haifa-sched.c (get_unit_last_insn): New function. + (sched_dump, insn_unit, actual_hazard_this_instance): No longer + static. + (schedule_block): Call visualize_alloc and visualize_free. Delete + spurious return statement. + (init_target_units, insn_print_units, get_visual_tbl_length, + init_block_visualization, print_block_visualization, safe_concat, + visualize_scheduled_inns, visualize_no_unit, visualize_stall_cycles, + print_exp, print_value, print_pattern, print_insn, target_units, + MAX_VISUAL_LINES, INSN_LEN, n_visual_lines, visual_tbl, + n_vis_no_unit, vis_no_unit): Move scheduling visualization + functions/variables... + * sched-vis.c: ...here. New file. + (visualize_alloc, visualize_free): New functions. + (visualize_scheduled_insns, visualize_stall_cycles, + print_block_visualization): Lose basic block argument. All callers + changed. + (visualize_scheduled_insns): Use new function get_unit_last_insn. + * sched-int.h (current_sched_info, sched_dump): Declare. + (init_target_units, insn_print_units, init_block_visualization, + print_block_visualization, visualize_scheduled_inns, + visualize_no_unit, visualize_stall_cycles, visualize_alloc, + visualize_free): Declare functions. + + * sched-int.h: New file. + * Makefile.in (haifa-sched.o): Depend on it. + * haifa-sched.c: Include it. + (no_real_insns_p): New function. + (current_sched_info): New static variable. + (__inline, HAIFA_INLINE): Moved to sched-int.h. + (get_block_head_tail): Minor cleanup. + (init_ready_list, can_schedule_ready_p, new_ready, schedule_more_p, + rgn_print_insn, rgn_rank): New functions, broken out of + rank_for_schedule, schedule_insn and schedule_block, where they + are now called through function pointers in current_sched_info. + (queue_insn, schedule_insn, queue_to_ready, debug_ready_list, + print_insn): To display uid and block number, call the print_insn + function pointer in current_schedule_info. + (region_sched_info): New static variable. + (sched_target_n_insns, sched_n_insns, target_n_insns): New global + variables, moved out of schedule_block. + (schedule_block): Return void. All callers changed. + Move some of the setup code into schedule_region. Get head/tail + from current_sched_info, and update it when done. + (schedule_region): Slightly rearranged, some code moved here from + schedule_block. Call no_real_insns_p to avoid doing work for a + block that consists only of notes and labels. + (schedule_insns): Initialize current_sched_info. + +2000-12-03 Neil Booth + + * cppmacro.c (funlike_invocation_p): Re-disable macros enabled + by contexts drops AFTER argument pre-expansion, so that they + remain enabled during argument pre-expansion. + (_cpp_pop_context): Unconditionally re-enable a macro when + dropping a context level. + +2000-12-03 Manfred Hollstein + + * arm/t-linux (MULTILIB_OPTIONS): Comment. + (MULTILIB_DIRNAMES): Likewise. + (EXTRA_MULTILIB_PARTS): Likewise. + (LIBGCC): Likewise. + (INSTALL_LIBGCC): Likewise. + +2000-12-02 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strcat, expand_builtin_strncat, + expand_builtin_strspn, expand_builtin_strcspn): New functions. + (expand_builtin): Handle BUILT_IN_STRCAT, BUILT_IN_STRNCAT, + BUILT_IN_STRSPN and BUILT_IN_STRCSPN. + + * builtins.def (BUILT_IN_STRCAT, BUILT_IN_STRNCAT, + BUILT_IN_STRSPN, BUILT_IN_STRCSPN): New entries. + + * c-common.c (c_common_nodes_and_builtins): Declare builtin + strcat, strncat, strspn and strcspn. + (string_ftype_string_cstring): Renamed from `string_ftype_ptr_ptr'. + + * extend.texi (strcat, strcspn, strncat, strspn): Document new + builtins. + +2000-12-02 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strcmp): Use const*_rtx when + expanding strcmp at compile-time. Add another transformation. + (expand_builtin_strncmp): Add more transformations. Call + expand_builtin_memcmp, not expand_builtin_strcmp, under + appropriate conditions if HAVE_cmpstrsi. + +2000-12-02 David Edelsohn + + * rs6000.md (anddi3_internal[23]): Prefer rldic? over andis + instruction. + (cr logic): Really make operands sequential. + +2000-12-02 Geoffrey Keating + + * c-common.c (combine_strings): When the ISO C standard specifies + the maximum length of a string, it doesn't include the trailing + zero byte. + + * cpplib.c (do_ifdef): Add check_eol() call. + (do_ifndef): Likewise. + +2000-12-02 Daniel Berlin + Bruce Korb + + * fixinc/*: global substitute /__MSDOS__/SEPARATE_FIX_PROC/ + * fixinc/mkfixinc.sh: prepare to use Makefile.BEOS for *-*-beos* + * fixinc/Makefile.DOS: define SEPARATE_FIX_PROC for build + * fixinc/fixfix.c(wrap_fix): avoid wrapping files that + use the "__need_" hackery. It breaks them. + * fixinc/fixincl.c(process - SEPARATE_FIX_PROC): + Sometimes on DOS and BeOS the temp output file cannot be opened. + Skip the file noisily. Ought to be fixed instead. + +2000-12-02 Bruce Korb + + From: 2000-11-19 Kaveh R. Ghazi + + * fixfixes.c (emit_gnu_type, format_write): Prototype. + (format_write, char_macro_use_fix, char_macro_def_fix): Use gcc's + custom uppercase ctype macros. + * fixincl.c (do_version): Make static and add ATTRIBUTE_NORETURN. + Use gcc's custom uppercase ctype macros. + (main): Prototype. + (machine_matches): Add static prototype and constify variable. + (create_file, test_test, egrep_test): Add static prototype. + (quoted_file_exists): Likewise, and constify parameters. + (extract_quoted_files, internal_fix, start_fixer, fix_applies, + write_replacement, test_for_changes): Add static prototype. + (write_replacement, test_for_changes): Delete excess argument to + `create_file'. + * fixtests.c (test): Make static. + * server.c (load_data, sig_handler, server_setup, find_shell): Add + static prototype. + (sig_handler): Mark parameter with ATTRIBUTE_UNUSED. + +2000-12-02 Bruce Korb + + * fixnc/mkfixinc.sh(msdosdjgpp): remove from fixincludes exception list + (per Laurynas Biveinis ) + +2000-12-02 Richard Earnshaw + + * arm.h (ARM_REGNO_OK_FOR_BASE_P, THUMB_REGNO_MODE_OK_FOR_BASE_P): New + macros. + (REGNO_MODE_OK_FOR_BASE_P): Define in terms of above. + (REGNO_OK_FOR_FOR_BASE_P): Delete. + (ARM_REG_OK_FOR_BASE_P, THUMB_REG_MODE_OK_FOR_BASE_P): New macros for + both strict and non-strict uses. + (REG_MODE_OK_FOR_BASE_P): Define in terms of above. + (ARM_REG_OK_FOR_INDEX_P, THUMB_REG_OK_FOR_INDEX_P): New macros. + (REG_OK_FOR_INDEX_P): Define in terms of above. + (REG_OK_FOR_BASE_P): Delete. + (REG_OK_FOR_PRE_POST_P): Delete. + (ARM_BASE_REGISTER_RTX_P): Renamed from BASE_REGISTER_RTX_P. + (ARM_INDEX_REGISTER_RTX_P): Renamed from INDEX_REGISTER_RTX_P. + (ARM_GO_IF_LEGITIMATE_INDEX): Renamed from GO_IF_LEGITIMATE_INDEX. + (THUMB_LEGITIMATE_OFFSET): Renamed from LEGITIMATE_OFFSET. + (ARM_GO_IF_LEGITIMATE_ADDRESS): Adjust for name changes. Use ARM + specific variants rather than general ones. Use ARM_REG_OK_FOR_BASE_P + in pre/post increment cases. + (THUMB_GO_IF_LEGITIMATE_ADDRESS): Similarly for Thumb. + (ARM_LEGITIMIZE_ADDRESS): Similarly. + (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Similarly. + * arm.c (legitimate_pic_address): Similarly. + +2000-12-02 Neil Booth + + * tradcpp.c (struct answer, parse_assertion, parse_answer, + canonicalize_text, find_answer): New. + (do_assert, do_unassert): Provide appropriate function bodies. + (union hashval): New member answers. + +2000-11-23 Marek Michalkiewicz + + * config/avr/avr.md: Document UNSPEC usage. + (*tablejump_rjmp, *tablejump_lib, *tablejump_enh, *tablejump): + Make operand 0 input only, clobber it. Use UNSPEC, not a bogus + MEM for program memory word reference. Do not add the label to + the table index in each of the asm output templates, instead ... + (casesi): ... do it in RTL. Adjust to match the above change. + +2000-12-02 Bernd Schmidt + + * c-common.c (PTRDIFF_TYPE): Provide default here, ... + * c-decl.c: ... not here. + + * haifa-sched.c (sched_dump): Renamed from dump. All users changed. + (old_max_uid): New variable. + (compute_forward_dependences): Renamed from + compute_block_forward_dependences; changed to accept block head and + tail instead of block number. Caller changed. + (free_deps, init_dependency_caches, free_dependency_caches, + init_regions, sched_init): New functions, split out from + schedule_insns and compute_block_backward_dependences. + +2000-12-02 Neil Booth + + * cppexp.c (parse_number): Update diagnostic test. + +2000-12-02 Bernd Schmidt + + * reload1.c (free_for_value_p): New function, frontend to + reload_reg_free_for_value_p. All callers of the latter now call + this function with an additional mode argument. + +2000-12-02 Gerald Pfeifer + + * install.texi (Configurations): Remove obsolete documentation for + hppa*-*-*. + +2000-12-02 Gerald Pfeifer + + * install.texi (Installation): Remove obsolete description for + libstdc++ which is now an integral part of GCC. + +2000-12-01 Jim Blandy + + * dbxout.c (dbxout_parms): Correctly describe parameters passed by + invisible reference in registers, but then spilled to the stack. + Remove code to emit a second stab for such parameters; it attempts + to describe the value's location by introducing a synthetic C++ + `reference' type, and then saying the stack slot has that + reference type. This loses type information (breaking GDB's + `ptype' command, among other things) just to describe a location + which stabs can represent correctly in other ways. + +2000-12-01 Alexandre Oliva + + * final.c (output_addr_const) : Don't assume at least one + operand is a CONST_INT. + + * config/sh/sh.c (reg_class_from_letter): Assign `k' to SIBCALL_REGS. + (machine_dependent_reorg): Split all insns. + * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Compute + reg_class_contents[SIBCALL_REGS]. + (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add SIBCALL_REGS. + * config/sh/sh.md (calli_pcrel, call_pcrel, call_valuei_pcrel, + call_value_pcrel, call, call_value, sibcall): Match even when + not optimizing. + (sibcalli_pcrel, sibcall_pcrel): Likewise. Use constraint `k' + for call address. + (sibcalli): Likewise. + +2000-12-01 Joseph S. Myers + + * c-common.c (warn_format, warn_format_y2k, + warn_format_extra_args, warn_format_nonliteral): Define. + (check_format_info): Check warn_format_nonliteral and + warn_format_extra_args. + (check_format_info_main): Check warn_format_y2k. + (set_Wformat): New function. + * c-common.h (warn_format_y2k, warn_format_extra_args, + warn_format_nonliteral, set_Wformat): Declare. + * c-decl.c (warn_format): Remove definition. + (c_decode_option): Handle -Wformat-nonliteral, + -Wno-format-extra-args and -Wno-format-y2k, and negated versions. + Use set_Wformat. + * invoke.texi: Document these new options and -Wformat=2. + * toplev.c (documented_lang_options): Add these new options. + +2000-12-01 Joseph S. Myers + + * builtins.def (BUILT_IN_IMAXABS): Add. + * builtins.c (expand_builtin): Also abort on BUILT_IN_IMAXABS. + * c-common.c (c_common_nodes_and_builtins): Create builtin + functions __builtin_imaxabs, and plain imaxabs unless + flag_no_nonansi_builtin outside C99 mode. + (expand_tree_builtin): Handle BUILT_IN_IMAXABS. + * extend.texi: Document builtin imaxabs. + +2000-12-01 Joseph S. Myers + + * c-common.c: Include "defaults.h". + (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Define. + (c_common_nodes_and_builtins): Create string_type_node, + const_string_type_node, wint_type_node, intmax_type_node, + uintmax_type_node, default_function_type, ptrdiff_type_node and + unsigned_ptrdiff_type_node. + * c-common.h (identifier_global_value): Declare. + * c-decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define. + (init_decl_processing): Don't create string_type_node, + const_string_type_node, wint_type_node, intmax_type_node, + uintmax_type_node, default_function_type, ptrdiff_type_node and + unsigned_ptrdiff_type_node. + (identifier_global_value): New function. + +2000-12-01 Neil Booth + + * cppinit.c (initialize): Forgotten prototype. + * cpplex.c (_cpp_lex_token): Loop until not skipping. + Always clear PREV_WHITE upon meeting a new line. + * cpplib.c (end_directive): Set pfile->skipping after + skip_rest_of_line. + * cpplib.h (cpp_reader): Remove macro_pos. + * cppmacro.c (cpp_get_line): Don't do anything special inside + macros. + (parse_arg): Add PREV_WHITE if a token appears after new lines. + (funlike_invocation_p): Save and restore the output position + over a successful check for a '('. + (enter_macro_context): Delete uses of macro_pos. + (cpp_get_token): Don't use pfile->skipping. + +2000-12-01 Phil Edwards + + * diagnostic.c: Fix typos in comments. + * diagnostic.h: Likewise. + +2000-11-30 Phil Edwards + + * rtl.texi (Machine Modes): Document BImode and OImode. + +2000-12-01 Joseph S. Myers + + * gcc.c (default_compilers): Add suffixes .mi, .cp, .ii, .FOR and + .FPP. + +2000-12-01 Joseph S. Myers + + * c-decl.c (grokdeclarator): If pedantic, warn about arrays with + incomplete element type. + (grokparms): Before checking for incomplete parameter type, check + the type isn't error_mark_node. + +2000-12-01 Jakub Jelinek + + * builtins.c (target_char_cast): New function. + (expand_builtin_strchr): Use it. + (expand_builtin_strrchr): Use it. + (builtin_memset_read_str): New function. + (expand_builtin_memset): Use target_char_cast. + Try to optimize memset with second argument nonzero using + store_by_pieces. + +2000-11-30 Marek Michalkiewicz + + * install.texi (avr): Replace incomplete list of supported MCU + types with a link to the current one ... + * invoke.texi (AVR Options): ... here. Update -mmcu= to list + all supported MCU types. Document -minit-stack= default. + Document new options -mno-tablejump, -mtiny-stack. + * md.texi (AVR family): Fix typo in 'w' constraint letter + description. Document 'q'. Update 'O'. + +2000-12-01 Bernd Schmidt + + * combine.c (cant_combine_insn_p): Only disallow insns involving + hard regs if they are reg-reg moves. + (try_combine, can_combine_p, combinable_i3pat): Delete old + SMALL_REGISTER_CLASSES tests. + +2000-12-01 Alexandre Oliva + + * config/sh/sh.c (shiftcosts): Don't get INTVAL before testing + whether X is a CONST_INT. + (addsubcosts): Likewise. + + * config/sh/sh.h (OUTPUT_ADDR_CONST_EXTRA): Use INTVAL instead of + mis-used XINT. + (ARG_POINTER_REGNUM): Set to AP_REG. + +2000-11-30 Alexandre Oliva + + * config/sh/sh.md (fpu_switch0, fpu_switch1, movpsi, fpu_switch, + splits): Only match on TARGET_SH4. + + * combine.c (try_combine): Disregard USEs when updating LOG_LINKS + of subsequent insns. + +2000-11-30 Richard Henderson + + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Disable. + * config/alpha/alpha32.h (ASM_OUTPUT_MI_THUNK): Likewise. + +2000-11-30 Richard Henderson + + * config/alpha/elf.h (ASM_OUTPUT_SECTION_NAME): Copy elfos.h defn. + (DO_SELECT_SECTION): New. + (SELECT_SECTION): Use it. + (UNIQUE_SECTION_P): New. + (UNIQUE_SECTION): New. + +2000-11-30 Alexandre Oliva + + * c-common.c (status_warning) [! ANSI_PROTOTYPES]: Load status + from va_list before using it. + +2000-11-30 Michael Matz + + * flow.c (make_edge): Early out, if no flags to set. + (calculate_global_regs_live): Clear out garbage only when necessary. + + * simplify-rtx.c (varray_type used_regs): New. + (clear_table): Use it to only clear necessary items. + (cselib_lookup, cselib_record_set): Remember newly set items. + (cselib_update_varray_sizes, cselib_init): Initialize and grow + used_regs. + + * local-alloc.c (update_equiv_regs): New local `cleared_regs'. + Move clearing of dead regs out of insn-loop. + +2000-11-30 Richard Henderson + + * calls.c (expand_call): Emit queued insns before creating + the tail recursion sequence. + +2000-11-30 J. David Anglin + Bruce Korb + + * fixinc/inclhack.def(): prevent dual double definition protection + * fixinc/fixincl.x: regenerate + +2000-11-29 Loren J. Rittle + + * fixinc/Makefile.in (fixincl.x): Explicitly state the + location of the generated file. + +2000-11-30 Gerald Pfeifer + + * README.FRESCO: Remove obsolete file. + +2000-11-30 Mark Kettenis + + * config/t-gnu (LIBGCC1, CROSS_LIBGCC1, CRTSTUFF_T_CFLAGS, + TARGET_LIBGCC2_CFLAGS): Remove. We now use the settings from + config/t-linux for the Hurd. + +2000-11-30 Stephane Carrez + + * config/mn10200/udivmod.c, config/mn10200/divmod.c, + config/mn10200/udivmodsi4.c: Moved from here. + * config/udivmod.c, config/divmod.c, config/udivmodsi4.c: To here. + * config/mn10200/t-mn10200 (LIB2FUNCS_EXTRA): Use the generic + C division functions. + * config/m68hc11/t-m68hc11-gas (LIB2FUNCS_EXTRA): Likewise. + +Thu Nov 30 01:12:52 2000 Jeffrey A Law (law@cygnus.com) + + * pa.md (conditional moves): Avoid holes in operand list. + (mod, umod patterns): Similarly. + (variable extract/shift patterns): Similarly. + +2000-11-30 Neil Booth + + * objc/objc-act.c (lang_init, finish_file, maybe_objc_comptypes, + maybe_objc_check_decl, build_objc_string_object, + objc_declare_alias, objc_declare_class, build_message_expr, + build_protocol_expr, build_selector_expr, build_encode_expr, + get_class_ivars, start_class, start_protocol): Remove + redundant code, assuming doing_objc_thang is true. + +2000-11-29 John David Anglin + + * pa.c (restore_unscaled_index_insn_codes): Delete procedure. + (record_unscaled_index_insn_codes): Likewise. + (unscaled_index_insn_codes): Delete. + (max_unscaled_index_insn_codes_uid): Delete. + (output_function_prologue, output_function_epilogue, pa_reorg): + Don't use the unscaled index insn hack. + + * pa.md: Remove hack from all index insns to reverse the operand + order of frame and stack pointer references incorrectly created + in the reload pass. + + * function.h (emit_status): Delete member regno_pointer_flag and + rename regno_pointer_flag_length to regno_pointer_align_length. + Delete define for REGNO_POINTER_FLAG. + * integrate.h (inline_remap): Delete member regno_pointer_flag. + Add member x_regno_reg_rtx. + * rtl.h (rtx_def): Use frame_related bit to indicate register is + a pointer in REG expressions. Define REG_POINTER macro. + * alias.c (find_base_value, find_base_term): Use REG_POINTER + instead of REGNO_POINTER_FLAG. + * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. + * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead + of regno_pointer_flag_length. Remove code which refers to + regno_pointer_flag. + (mark_reg_pointer): Use REG_POINTER. + (free_emit_status): Remove code which refers to regno_pointer_flag. + (init_emit, mark_emit_status): Likewise. + * flow.c (dump_flow_info): Likewise. + * function.c (preserve_temp_slots): Likewise. + * integrate.c (expand_inline_function, copy_rtx_and_substitute): + Use x_regno_reg_rtx instead of regno_pointer_flag for function + pointer determination in map. + * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. + * predict.c (estimate_probability): Likewise. + * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. + * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of + regno_pointer_flag for function pointer determination in map. + * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use + REG_POINTER. + * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): + Use REG_POINTER. + (restore_unscaled_index_insn_codes): Revise comment. + + * expr.c (do_compare_and_jump): Add missing TYPE_MODE in statement. + +2000-11-30 Joseph S. Myers + + * extend.texi: Update documentation for attributes. + +2000-11-29 David O'Brien + + * config/alpha/elf.h (IDENT_ASM_OP): Protect the #define. + (ASM_DECLARE_OBJECT_NAME): Same. + (ASM_FILE_END): Same. + (ASM_FINISH_DECLARE_OBJECT): Same. + (ASM_IDENTIFY_GCC): Same. + (ASM_IDENTIFY_LANGUAGE): Same. + (ASM_OUTPUT_CONSTRUCTOR): Same. + (ASM_OUTPUT_DEF): Same. + (ASM_OUTPUT_DESTRUCTOR): Same. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Same. + (ASM_OUTPUT_SECTION_NAME): Same. + (ASM_WEAKEN_LABEL): Same. + (BSS_SECTION_ASM_OP): Same. + (COMMON_ASM_OP): Same. + (CONST_SECTION_ASM_OP): Same. + (CONST_SECTION_FUNCTION): Same. + (CTORS_SECTION_ASM_OP): Same. + (DTORS_SECTION_ASM_OP): Same. + (ESCAPES): Same. + (FINI_SECTION_ASM_OP): Same. + (IDENT_ASM_OP): Same. + (IDENT_ASM_OP): Same. + (INIT_SECTION_ASM_OP): Same. + (INT_ASM_OP): Same. + (MAX_OFILE_ALIGNMENT): Same. + (SBSS_SECTION_ASM_OP): Same. + (SDATA_SECTION_ASM_OP): Same. + (SECTION_FUNCTION_TEMPLATE): Same. + (SELECT_SECTION): Same. + (SE_CONST_SECTION): Same. + (SIZE_ASM_OP): Same. + (SKIP_ASM_OP): Same. + (STRING_ASM_OP): Same. + (STRING_LIMIT): Same. + (TYPE_ASM_OP): Same. + (TYPE_OPERAND_FMT): Same. + +2000-11-29 Neil Booth + + * c-decl.c (c_decode_option): Don't handle -lang-objc. + * objc/lang-options.h: Remove -lang-objc. + * objc/lang-specs.h: Don't pass -lang-objc to cc1obj. + * objc/objc-act.c (lang_init_options): Set c_language. + +2000-11-29 Jakub Jelinek + + * expr.c (can_store_by_pieces): Reinitialize max_size for reverse + tests. + +2000-11-29 Neil Booth + + * c-pragma.c (init_pragma): Update for parse_in type change. + +2000-11-29 Laurynas Biveinis + + * configure.in: recognize DOS-style absolute paths. + +2000-11-29 Jakub Jelinek + + * expr.h (store_by_pieces): Add prototype. + (can_store_by_pieces): Likewise. + * expr.c (struct store_by_pieces): Renamed from clear_by_pieces. + (can_store_by_pieces): New. + (store_by_pieces): New. + (clear_by_pieces): New. + (clear_by_pieces_1): New. + (store_by_pieces_1): Renamed from clear_by_pieces, handle storing + arbitrary compiler generated constants into memory block. + (store_by_pieces_2): Renamed from clear_by_pieces_1, likewise. + * builtins.c (c_readstr): New. + (builtin_memcpy_read_str): New. + (expand_builtin_memcpy): If src is string constant and + emit_block_move would move it by pieces, compute integer constants + from the string and store it into memory block instead. + (builtin_strncpy_read_str): New. + (expand_builtin_strncpy): If N is not constant zero and c_strlen does + not return INTEGER_CST, don't optimize. + If N is larger than strlen(src) + 1, try to copy the string + including padding with store_by_pieces. + (expand_builtin_strcmp): If both arguments have side effects, don't + optimize. + (expand_builtin_fputs): If STR has side effects, don't optimize. + +2000-11-29 Richard Earnshaw + + * arm.md (sibcall, sibcall_value, sibcall_insn, sibcall_value_insn): + Add use of link register. + +2000-11-29 Joseph S. Myers + + * extend.texi: Update documentation for default format attributes. + +Tue Nov 28 21:56:45 2000 Jeffrey A Law (law@cygnus.com) + + * pa/pa-64.h (ASM_OUTPUT_SECTION_NAME): Use a hash table, not + a list, to keep track of the sections. + +2000-11-28 Nick Clifton + + * config/arm/arm.md (pic_load_addr): Split into + pic_load_addr_arm and pic_load_addr_thumb. + + * config/arm/arm.c (legitimize_pic_address): Generate either + ARM or Thumb versions of pic_load_addr. + (arm_finalize_pic): Generate either ARM or Thumb versions of + pic_load_addr. + +2000-11-28 Richard Henderson + + * calls.c (expand_call): Defer const/pure NO_DEFER_POP until + after sibcall do_pending_stack_adjust. + +Wed Nov 29 00:08:23 2000 J"orn Rennecke + + * jump.c (delete_insn): Check that REG_LABEL note actually contains + a CODE_LABEL. + +2000-11-28 Neil Booth + + * c-common.h: Remove flag_digraphs. + * c-decl.c: Remove flag_digraphs. + (c_decode_option): Don't set it. + * c-lex.c (init_c_lex): Don't do anything for digraphs. + +2000-11-28 Richard Henderson + + * c-parse.in (finish_parse): Update for parse_in type change. + (_yylex): Likewise. + +2000-11-28 Neil Booth + + * cppmacro.c (cpp_scan_buffer_nooutput): Take a boolean + indicating whether to scan all buffers on the stack or + just one. + * cppinit.c (do_includes): Update. + * cppmain.c (main): Update. + * cpplib.h: Update prototype. + +2000-11-28 Richard Henderson + + * genoutput.c (validate_insn_operands): New. + (gen_insn): Call it. + + * config/alpha/alpha.md (divmodsi_internal): Renumber operands. + (divmoddi_internal): Likewise. + * config/arm/arm.md (andsi3_compare0_scratch): Likewise. + * config/i960/i960.md (branch patterns): Likewise. + * config/ia64/ia64.md (tbit_and_0): Likewise. + (tbit_and_1, tbit_or_0, tbit_or_1): Likewise. + * config/m68k/m68k.md (zero_extract memory patterns): Likewise. + * config/mips/mips.md (divmodsi4_internal): Likewise. + (divmoddi4_internal): Likewise. + * config/rs6000/rs6000.md (call patterns): Likewise. + * config/sh/sh.md (movsi_y): Likewise. + * config/sparc/sparc.md: Comment out if 0 v8p shift pattern. + +2000-11-28 Richard Henderson + + * config.gcc: Kill residual pyramid support. + +2000-11-28 Neil Booth + + * c-lex.h (parse_in): Change parse_in to a cpp_reader *. + * c-decl.c (c_decode_option): Update to match. + * c-lex.c (init_c_lex, yyparse): Update to match. + * c-lang.c (lang_init_options): Use cpp_create_reader. + * cppinit.c (cpp_init): Rename initialize. + (cpp_reader_init): Rename cpp_create_reader. Create the + reader. Initialize cpplib if appropriate. + * cpplib.h (cpp_create_reader) New prototype. + (cpp_init, cpp_reader_init): Delete prototypes. + * cppmain.c (general_init, setup_callbacks): New functions. + (main): Use them. + * fix-header.c (scan_in): Change type to cpp_reader *. + (read_scan_file): Update for new cpplib interface and scan_in type. + + * cp/decl.c (parse_in): Change to cpp_reader *. + (lang_decode_option): Update. + * cp/lex.c (lang_init_options): Use new cpplib interface. + (init_cp_pragma, finish_parse, handle_pragma_implementation): Update. + * cp/spew.c (read_token): Update. + * objc/objc-act.c (lang_init_options): Update new cpplib interface. + +2000-11-28 Jakub Jelinek + + * loop.c (load_mems): Avoid using next_label to find end_label. If + jumping outside of the loop (other than loop end), don't hoist MEMs + out of loop. + +2000-11-28 Jan Hubicka + + * calls.c (expand_call): Don't disable tail recursion based + on the loop nest. + +2000-11-28 Neil Booth + + * tradcpp.c (enum node_type): New hash types T_ASSERT, T_UNASSERT. + (struct directive): Drop 4th argument from handlers. + (do_define, do_line, do_include, do_undef, do_else, do_elif, + do_endif): Similarly. + (do_assert, do_unassert, do_ifdef, do_ifndef): New handlers. + (do_ifxdef): Update as common handler of do_ifdef and do_ifndef. + (make_definition, make_undef): Take a const char*. + (make_assertion): New function. + (struct directive_table): Update. + (main): Handle -A command line argument. + (handle_directive): Drop fourth handler argument. + +2000-11-28 Bernd Schmidt + + * simplify-rtx.c (cselib_record_sets): Ignore sets whose destination + is anything but REG or MEM, but look inside STRICT_LOW_PART. + +Tue Nov 28 09:53:50 2000 Richard Kenner + + * system.h (IS_DIR_SEPARATOR): Use uppercase macro name. + (IS_ABSOLUTE_PATHNAME): New macro. + * gcc.c (find_a_file, process_command, do_spec_1, main): Use it. + +2000-11-28 Jakub Jelinek + + * config/i386/i386.md (truncxfsf2_2): Fix predicate. + +2000-11-27 Jim Wilson + + * reload1.c (reload): Use HOST_WIDE_INT for old_frame_size. + +2000-11-27 Matthias Klose + + * extend.texi (Nested Functions): Update URL of Usenix paper. + +2000-11-27 Mark Mitchell + + * function.c (free_after_compilation): Clear x_clobber_return_insn. + +2000-11-27 Neil Booth + + * cppinit.c (cpp_reader_init): Remove handling of warn_paste + command line options. + (cpp_handle_option): Similarly. + * cpplib.h (struct cpp_options): Remove warn_paste. + * cppmacro.c (paste_tokens): Apart from assembler, make + unpasteable token warning mandatory. + +2000-11-27 Neil Booth + + * tradcpp.c (enum pending_dir_t, struct pending_dir): New. + (main): Allocate a pending directive set of these. Use it. + Merge handling of -D and -U. Update handling of pending + directives. Free the memory after use. + +2000-11-27 Bernd Schmidt + + * flow.c (entry_exit_blocks): Add entry for cond_local_set. + (struct propagate_block_info): Add new member cond_local_set. + (propagate_block): Accept new arg cond_local_set. All callers + changed. + (init_propagate_block_info): Likewise. + (calculate_global_regs_live): Allocate & free cond_local_set. Always + rescan if there's overlap between cond_local_set and new_live_at_end. + (mark_set_1): Set bits either in cond_local_set or local_set, as + appropriate. + * basic-block.h (struct basic_block_def): New field cond_local_set. + (propagate_block, init_propagate_block_info): Update prototypes. + +Mon Nov 27 17:29:44 2000 kaz Kojima + + * gcc/config/sh/sh.md (udivsi3_i4, udivsi3_i4_single): Clobber + T register. + +2000-11-27 Richard Earnshaw + + * arm.c (select_dominance_cc_mode): Handle new way that combine + canonicalizes conditional compares. + (arm_select_cc_mode): Likewise. + * arm.md: Garbage collect some dead code. + (cmp_and, cmp_ior): New patterns. + (splitter for conditional move with inverted false): Use cond_exec + and handle unordered comparisons. + +Mon Nov 27 17:22:56 MET 2000 Jan Hubicka + + * i386.c (ix86_force_to_memory, ix86_free_from_memory): New. + * i386-protos.h (ix86_force_to_memory, ix86_free_from_memory): Declare + * i386.md (float?i?f, int/fp operations): Rewrite spliters to use + ix86_force_to_memory and ix86_free_from_memory. + +2000-11-27 Richard Earnshaw + + * arm.md (arm_adddi3, adddi_sesidi_di, adddi_zesidi_di, arm_addsi3, + arm_subsi3_insn, anddi_zesidi_di, arm_andsi3_insn, anddi_notdi_di, + anddi_notzesidi_di, anddi_notsesidi_di, arm_iorsi3, + one_cmpldi2): Merge with splitters to create define_insn_and_split + patterns. Remove redundant splits. + (peephole2 for add:SI of invalid immediate): New. + (peephole2 for minus:SI of invalid immediate): New. + (peephole2 for ior:SI of invalid immediate): New. + (peephole for merge of move and compare): Convert ot peephole2. + (addsf3, adddf3): Mark as commutative. + + * arm.md (thumb peephole for merging stack adjustments): Convert to + peephole2. + +2000-11-27 Bernd Schmidt + + * haifa-sched.c (print_pattern): Prettier output for COND_EXEC. + + * reload1.c (reload_cse_simplify_set): Pass down mode to cselib_lookup. + (reload_cse_simplify_operands): Do nothing about operands where both + the operand and the match_operand fail to give us a mode. + * simplify-rtx.c (wrap_constant): New function. + (entry_and_rtx_equal_p): Except integer constants to come wrapped in a + CONST describing the proper mode. + (rtx_equal_for_cselib_p): Pass down modes to recursive calls of + cselib_lookup. + (cselib_lookup_mem): Call wrap_constant on the rtx that is passed to + htab_find_slot_with_hash. + (cselib_lookup): Likewise. + + Based on a patch from Geoff Keating : + * loop.c (basic_induction_var): If a REG is set from something + that is not a biv, then the REG is not a biv. Even if it is + earlier set from something that is a biv. + +2000-11-27 Alexandre Oliva + + * configure.in (extra_objs): Enclose extra_headers in quotes. + * configure: Rebuilt. + +2000-11-27 Neil Booth + + * c-lex.c (cb_enter_file, cb_leave_file, cb_rename_file): + Combine into the new function cb_change_file. + (init_c_lex): Update. + * cppfiles.c (stack_include_file): Use _cpp_do_file_change. + (cpp_syshdr_flags): Delete. + * cpphash.h (_cpp_do_file_change): New prototype. + Move struct cpp_buffer here from... + * cpplib.h (struct cpp_buffer): ... here. + (enum cpp_fc_reason, struct cpp_file_loc, + struct_cpp_file_change, change_file): New. + (enter_file, leave_file, rename_file, cpp_syshdr_flags): Delete. + * cpplib.c (do_line): Update for new cb_change_file callback. + (_cpp_do_file_change): New function. + (_cpp_pop_buffer): Update to use it. + * cppmain.c (move_printer): Delete. + (main): Set up single callback cb_change_file. + (cb_enter_file, cb_leave_file, cb_rename_file): Delete. + (cb_change_file): New. + * fix-header.c (cur_file, cb_change_file): New. + (recognized_function, read_scan_file): Update. + * scan-decls.c (scan_decls): Update. + * scan.h (recognized_function): Update prototype. + +2000-11-26 Mark Mitchell + + * tree.h (mark_tree_hashtable): New function. + * tree.c (mark_tree_hashtable_entry): New function. + (mark_tree_hashtable): Likewise. + +2000-11-27 Michael Meissner + + * d30v-protos.h (srelational_si_operator): Correctly spell + function. + (urelational_si_operator): Ditto. + (relational_si_operator): Ditto. + (d30v_expand_prologue): Add prototype. + (d30v_expand_epilogue): Ditto. + + * d30v.h (OPTIMIZATION_OPTIONS): Undo November 22nd change. + + * d30v.md (movcccc_*): Delete now unused patterns. + (64 bit comparison splitters): Rewrite to use COND_EXEC instead of + IF_THEN_ELSE. + (define_cond_exec): Use 'b' to select branch flags. + +2000-11-26 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strncmp, expand_builtin_strncpy): New + functions. + (expand_builtin): Handle BUILT_IN_STRNCPY and BUILT_IN_STRNCMP. + + * builtins.def (BUILT_IN_STRNCPY, BUILT_IN_STRNCMP): New entries. + + * c-common.c (c_common_nodes_and_builtins): Declare builtin + strncpy and strncmp. + + * extend.texi (strncmp, strncpy): Document new builtins. + +2000-11-26 Mark Mitchell + + * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Use a hash table, not + a list, to keep track of the sections. + * tm.texi (ASM_OUTPUT_SECTION_NAME): Document the fact that the + parameter provided will always be a canonical string. + +2000-11-26 Neil Booth + + * cppmacro.c (cpp_scan_buffer_nooutput): Only scan the + current buffer. + +2000-11-26 Joseph S. Myers + + * makefile.vms: Remove EGCS references. + +2000-11-26 Ulrich Drepper + + * dwarf2out.c (output_file_names): New function. Compute minimal + combination of directory and file name table and emit them. + (output_line_info): Remove code to emit directory and file name + table and call output_file_names instead. + (file_info_cmp): Helper function to sort directory names. + +2000-11-26 Neil Booth + + * cpplib.h (struct cpp_reader): Remove lang_asm. + (struct cpp_options): Remove c89. New members lang, + extended_numbers. + * cppexp.c (parse_number): Use them. + * cpphash.h (VALID_SIGN): Use them. + * cppinit.c (set_lang, cpp_start_read): Update. + * cpplex.c (parse_string, _cpp_lex_token): Update. + * cpplib.c (_cpp_handle_directive): Update. + * cppmacro.c (parse_args): Update. + * cppmain.c (scan_buffer): Update. + +Sun Nov 26 10:02:37 2000 Richard Kenner + + * fold-const.c (fold, case CONVERT_EXPR): Always return tree of + proper type. + +2000-11-26 Neil Booth + + * Makefile.in: Remove MAYBE_CPPLIB and maybe_cpplib. + * c-decl.c: Remove parse_in declaration. + * c-lang.c: Similarly. + * c-lex.c: Similarly. + * c-parse.in: Similarly. + * c-pragma.c: Similarly. + * configure.in: Similarly. + * cp/Make-lang.in: Similarly. + * cp/spew.c: Similarly. + * cp/decl2.c: Remove check for lang-c++ option. + * cp/lang-specs.h: Remove -lang-c++ from cc1plus command line. + * cp/lex.c (lang_init_options): With cpp_reader_init, default to C++. + * c-lex.h: Add declaration of parse_in. + * cppinit.c: Call set_lang after allocating pfile->pending. + * configure: Regenerate. + +2000-11-25 Zack Weinberg + + * combine.c (try_combine): Remove redundant test. + +2000-11-25 Richard Henderson + + * c-common.h (DECL_C_HARD_REGISTER): New. + * c-decl.c (finish_decl): Set it for asm register variables. + * c-semantics.c (emit_local_var): Test it when instantiating one. + +2000-11-25 Richard Henderson + + * c-decl.c (c_expand_body): Use DECL_SOURCE_LINE rather than + lineno for the start of the function. + +2000-11-25 Richard Henderson + + * dwarf2out.c (file_table, file_table_allocated): Remove. + (file_table_allocated): Remove. + (struct file_table): New. + (decl_file_table, line_file_table): New. + (print_dwarf_line_table): Use them. + (size_of_line_prolog): Likewise. + (output_line_info): Likewise. + (add_src_coords_attributes): Likewise. + (gen_subprogram_die): Likewise. + (gen_variable_die): Likewise. + (dwarf2out_add_library_unit_info): Likewise. + (dwarf2out_line): Likewise. + (lookup_filename): Take a struct file_table argument. + (init_file_table): New. + (dwarf2out_init): Use it. + +2000-11-25 Joseph S. Myers + + * invoke.texi: Update sequence points references. + +2000-11-25 Neil Booth + + * c-common.c: Remove USE_CPPLIB conditional inclusions. + * c-common.h: Similarly. + * c-decl.c: Similarly. + * c-lang.c: Similarly. + * c-lex.c: Similarly. + * c-parse.in: Similarly. + * c-pragma.c: Similarly. + * c-pragma.h: Similarly. + * gcc.c: Similarly. + * toplev.c: Similarly. + * cp/cp-tree.h: Similarly. + * cp/decl2.c: Similarly. + * cp/lang-specs.h: Similarly. + * cp/lex.c: Similarly. + * cp/lex.h: Similarly. + * cp/spew.c: Similarly. + * java/lang-options.h: Similarly. + * objc/lang-specs.h: Similarly. + * objc/objc-act.c: Similarly. + + * configure.in: Remove configure option. + * config.in: Regenerate. + * configure: Regenerate. + +2000-11-25 Richard Henderson + + * haifa-sched.c (sched_analyze_1, sched_analyze_2, sched_analyze): + Revert 2000-11-22 change. + +2000-11-25 Bernd Schmidt + + * config/i386/i386.h (FIXED_REGS): Make the three flags registers + fixed. + +2000-11-25 Philipp Thomas + * configure.in (ALL_LINGUAS): Remove en_GB and add sv. + * configure: Rebuilt. + +2000-11-25 Jakub Jelinek + + * config/sparc/sparc.md (muldi3_v8plus): Remove H constraint. + Handle CONST_INT as second argument. + * config/sparc/sparc.c (set_extends): Remove first argument. + Properly handle AND, CONST_INT and CONST_DOUBLE, handle IOR, XOR and + MOV. + (sparc_check_64): Abort if first argument is not REG. + If it is DImode REG, look at the lower register of the register + pair. + + * config/sparc/sparc.c (load_pic_register, restore_regs, + output_return, sparc_v8plus_shift, sparc_function_profiler, + sparc_function_block_profiler, sparc_block_profiler): Fix output + formatting. + +2000-11-25 Alexandre Oliva + + * config/sh/sh.h (TARGET_NONE): New. + (TARGET_SWITCHES): For all variant-selecting switch, use + TARGET_NONE to reset all other variant-selecting switch. Added + empty strings to avoid warnings. + (TARGET_DEFAULT): Set to SH1_BIT. + + * Makefile.in ($(INTL_TARGETS)): Added $(CONFIG_H) for + insn-codes.h. + + * gcc/config/sh/sh.md (sibcalli, sibcalli_pcrel): New insns. + (sibcall_pcrel): New insn_and_split. + (sibcall, sibcall_value, sibcall_epilogue): New expands. + + * config/sh/sh.md (GOTaddr2picreg, symGOT2reg, symGOTOFF2reg, + symPLT_label2reg, call, call_value): Don't set + current_function_uses_pic_offset_table. + * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Don't mark + PIC_OFFSET_TABLE_REGNUM as call_used, so that calc_live_regs + takes it into account. + (FINALIZE_PIC): Delete, useless. + (LEGITIMATE_CONSTANT_P): Delete, unused. + * config/sh/sh.c (sh_expand_prologue): Don't use + current_function_uses_pic_offset_table. Don't special-case + PIC_OFFSET_TABLE_REGNUM. Initialize it if it's ever live and + PIC is enabled. + (sh_expand_epilogue, initial_elimination_offset): Don't + special case PIC_OFFSET_TABLE_REGNUM. + +2000-11-25 Alexandre Oliva , NIIBE Yutaka + + * config/sh/sh-protos.h (symbol_ref_operand): Declare. + * config/sh/sh.md (UNSPEC_CALLER): New constant. + (calli_pcrel, call_valuei_pcrel): Use PIC_REG. + (call_pcrel, call_value_pcrel): New insn_and_splits. + (call, call_value): Use them. + (call_site): New expand. + (sym_label2reg, symPLT_label2reg): Adjust to hold call_sites. + * config/sh/sh.h (OUTPUT_ADDR_CONST_EXTRA) [UNSPEC_CALLER]: + Output call_site label. + (PREDICATE_CODES): Added symbol_ref_operand. + * config/sh/sh.c (symbol_ref_operand): Define. + * emit-rtl.c (try_split): Propagate CALL_INSN_FUNCTION_USAGE + to CALL_INSNs in the split sequence. + +2000-11-24 Nick Clifton + + * config.gcc (v850-*-*): Define c_target_objs and + cxx_target_objs. + + * config/v850/t-v850: Define how to build v850-c.o + + * config/v850/v850.h (struct data_area_stack_element): Move + definition here from v850.c. + + * config/v850v850.c: Include gcc.h to avoid compile time + warning. + (push_data_area): Move to v850-c.c. + (pop_data_area): Move to v850-c.c. + (mark_current_function_as_interrupt): Move to v850-c.c. + (GHS_default_section_names): Allow to be exported. + (GHS_current_section_names): Allow to be exported. + (data_area_stack_elements): Allow to be exported. + (ghs_pragma_section): Move to v850-c.c. + (ghs_pragma_interrupt): Move to v850-c.c. + (ghs_pragma_starttda): Move to v850-c.c. + (ghs_pragma_startsda): Move to v850-c.c. + (ghs_pragma_startzda): Move to v850-c.c. + (ghs_pragma_endtda): Move to v850-c.c. + (ghs_pragma_endsda): Move to v850-c.c. + (ghs_pragma_endzda): Move to v850-c.c. + + * config/v850/v850-c.c: New file: Contains v850 specific + pragma parsing functions. + +2000-11-24 Nick Clifton + + * config.gcc (extra_objs): Remove duplicate description. + (c_target_objs): New variable. Contains target specific + object files for the gcc C compiler only. + (cxx_target_objs): New variable. Contains target specific + object files for the gxx C++ compiler only. + + * configure.in (c_target_objs): Substitute in the makefile. + (cxx_target_objs): Substitute in the makefile. + * configure: Regenerate. + + * Makefile.in (C_TARGET_OBJS): Define and initialize from + c_target_objs. + (CXX_TARGET_OBJS): Define and initialize from + cxx_target_objs. + (C_AND_OBJC_OBJS): Include C_TARGET_OBJS. + + * cp/Make-lang.in (CXX_C_OBJS): Include CXX_TARGET_OBJS). + + * tm.texi (REGISTER_TARGET_PRAGMAS): Add paragraph explaining + about how the use of the 'c_lex' function requires the use of + the target specific, language specific object files feature of + the configuration mechanism. + +Fri Nov 24 18:50:58 2000 Richard Kenner + + * gcc.c (process_command): Use F_OK, not R_OK. + +2000-11-24 Arno J. Klaassen + + * flow.c (print_rtl_and_abort): Remove ANSIism. + +Fri Nov 24 19:54:36 2000 Alexandre Oliva + + * config/sh/sh.h (GENERAL_REGISTER_P, + GENERAL_OR_AP_REGISTER_P, FP_REGISTER_P, XD_REGISTER_P, + FP_OR_XD_REGISTER_P, FP_ANY_REGISTER_P): New macros. Use them + all over. + (SPECIAL_REG): Renamed to SPECIAL_REGISTER_P. + * config/sh/sh.c: Use new macros. + * config/sh/sh.md: Likewise. + +Fri Nov 24 19:46:16 2000 Alexandre Oliva + + * config/sh/sh.md: Clobber MACH_REG and MACL_REG in SImode, + instead of just MACH_REG in DImode. Always refer to FPSCR_REG + in PSImode. + +Fri Nov 24 22:37:41 2000 Denis Chertykov + + * config/avr/avr.c (out_tsthi,out_tstsi): Test simplification bug + fixed. + (machine_dependent_reorg): Wrong optimization based on + NOTICE_UPDATE_CC removed. + +Fri Nov 24 19:48:09 2000 J"orn Rennecke + + * jump.c (delete_computation): Re-instate deletion of feeding insn. + (delete_insn): Look for REG_LABEL notes. + (redirect_tablejump): Delete feeding insns. + +2000-11-24 Bernd Schmidt + + * config/i386/i386.md (call_pop_0, call_pop_1, call_value_pop_0, + call_value_pop_1): Make sure operand numbers are contiguous. + + * fold-const.c (fold_range_test): Avoid crash if LHS or RHS is null. + + * reload1.c (conflicts_with_override): New function. + (emit_input_reload_insns): Use it to tighten test for validity + of substituting into output of previous insn. + + * haifa-sched.c (struct ready_list): New. + (ready_lastpos, ready_add, ready_remove_first, ready_sort): New static + functions. + (schedule_insn): Replace args READY and N_READY with a pointer to a + ready_list; return void. Use the new functions to access the ready + list. All callers changed. + (queue_to_ready, debug_ready_list): Likewise. + (schedule_block): Initialize a ready_list structure. Use new + functions to access it. + (max_priority): Remove unused variable. + (schedule_insn): Don't set it. + + * c-common.c (verify_tree): Don't recurse into CONSTRUCTORs. + + * combine.c (cant_combine_insn_p): New function. + (try_combine): Use it. + + * Makefile.in (c-common.o): Depend on $(OBSTACK_H). + * c-common.c (c-obstack.c): Include "obstack.h". + (struct reverse_tree): Delete. + (reverse_list, reverse_max_depth): Delete. + (build_reverse_tree, common_ancestor, modify_ok): Delete functions. + (struct tlist, struct tlist_cache): New. + (tlist_obstack, tlist_firstobj, warned_ids, save_expr_cache): New. + (add_tlist, merge_tlist, verify_tree, warning_candidate_p, + warn_for_collisions, warn_for_collisions_1, new_tlist): New + static functions. + (verify_sequence_points): Rewritten. + * fold-const.c (fold): Don't lose possibly important sequence + points when removing one arm of TRUTH_ORIF_EXPRs or TRUTH_ANDIF_EXPRs. + +2000-11-24 Richard Sandiford + + * gcc/cse.c (cse_insn): Removed conversion of REG_EQUIV to REG_EQUAL + when reversing a register-to-register copy. Reversal now disabled + when the previous instruction has a REG_EQUIV. + +2000-11-24 Nathan Sidwell + + * c-parse.in (unary_expr): Move VA_ARG from here ... + (primary): ... to here. + +2000-11-23 Graham Stott + + * expr.c (store_constructor): If a field is non addressable and + the target is a MEM use MEM_ALIAS_SET otherwise use get_alias_set. + +2000-11-23 Bernd Schmidt + + * flow.c (print_rtl_and_abort): New function. + (verify_wide_reg, verify_local_live_at_start): Try to dump more + information before aborting. + +2000-11-23 Alexandre Oliva + + * emit-rtl.c (gen_lowpart_common): Use word 0 if register mode + is narrower than requested mode. + (gen_highpart): Abort if register mode is narrower than + requested mode. + +2000-11-23 Graham Stott + + * cse.c (cse_insn): Initialize all regcost variables. + Fix a typo add missing '='. + Only compare costs if there is a replacement insn. + +Thu Nov 23 04:33:33 2000 Alexandre Oliva + + * final.c (output_addr_const) [LABEL_REF]: Simplify. + [MINUS]: Enclose non-CONST_INTs in parentheses. + [default]: Try OUTPUT_ADDR_CONST_EXTRA. + * tm.texi (OUTPUT_ADDR_CONST_EXTRA): Document it. + * varasm.c (decode_rtx_const) [CONST]: If it's not something + PLUS or MINUS a CONST_INT, use the whole CONST with offset 0 + instead of abort()ing. + * sh.c (output_pic_addr_const): Removed. Fixed all callers. + * sh.h (OUTPUT_ADDR_CONST_EXTRA): New. Handle the UNSPECs + formerly handled in output_pic_addr_const. + * sh.md (sym_label2reg, symPLT_label2reg): Enclose UNSPEC + operands of MINUS in CONSTs so that decode_rtx_const() will + accept them. + +Thu Nov 23 04:10:30 2000 Alexandre Oliva + + * config/sh/sh.md (mova_const): New pattern. + (GOTaddr2picreg): Use it. + * config/sh/sh.c (broken_move): Match it. + (mova_p): Don't match it. + (machine_dependent_reorg): Adjust it. + +Thu Nov 23 02:09:09 2000 Alexandre Oliva + + * config/sh/sh.h (FIRST_GENERAL_REG, LAST_GENERAL_REG): New. + Moved most register-number #defines... + * config/sh/sh.md (define_constants): ... here. Use macros to + refer to registers and unspecs. + * config/sh/sh.c: Likewise. + +Thu Nov 23 01:01:32 2000 J"orn Rennecke + + * Makefile.in (HOST_CFLAGS): Add -DGENERATOR_FILE. + (rtl.o, print-rtl.o, bitmap.o, obstack.o): Build with -DGENERATOR_FILE. + (alloca.o, vfprintf.o, ggc-none.o, errors.o): Likewise. + (splay-tree.o, hash.o): Likewise. + GCONFIG_H: New. + (rtl.o, print-rtl.o): Depend on $(GCONFIG_H) instead of $(CONFIG_H). + (bitmap.o, obstack.o, vfprintf.o, ggc-none.o, errors.o): Likewise. + (hashtab.o): Likewise. + (gcov.o): Depend on $(CONFIG_H). + * configure.in: #include insn-codes.h in tm.h. + +2000-11-22 Nick Clifton + + * config/arm/arm.c (arm_encode_call_attribute): Make 'newstr' a + const char * to avoid a compile time warning. + + * config/arm/arm.md (define_constants): Define symbolic names for + the link register, last integer register and the fake CC register. + Update patterns to use these symbolic names. + +2000-11-22 Neil Booth + + * cpplex.c (trigraph_ok): Ensure we don't warn twice. + * cpplib.h (struct cpp_buffer): New member last_Wtrigraphs. + +2000-11-22 Richard Henderson + + * haifa-sched.c (sched_analyze_1): Don't special-case calls + for clobbering registers. + (sched_analyze_2): Likewise. + (sched_analyze): Zap reg_last_uses and reg_last_sets after calls. + +2000-11-22 Chris Demetriou + Neil Booth + + * gcc.c (validate_switches): Validate multiple switches named + in '|' (or) expressions in specs. + (handle_braces): If more than 1 alternative in a '|' spec + matches, call do_spec1 just once. + +2000-11-22 Michael Meissner + + * d30v.h (TARGET_SWITCHES): Add documentation strings. + (TARGET_OPTIONS): Ditto. + (OPTIMIZATION_OPTIONS): Temporarily turn off -frename-registers if + -O3. + +Wed Nov 22 06:40:56 2000 Jeffrey A Law (law@cygnus.com) + + * pa.c (hppa_encode_label): Account for addition of encoding + character when allocating persistent space for the new label + name. + +2000-11-22 Zack Weinberg + + * Makefile.in, config.gcc, configure.in: Expunge remaining + traces of facility for running MD files through C preprocessor. + +2000-11-22 Joseph S. Myers + + * gcov.texi: Add magic comments for texi2pod.pl. + * Makefile.in: Add rules to generate and install gcov.1. + * gcov.1: New (generated) file. + +2000-11-21 Richard Henderson + + * regrename.c (scan_rtx_reg): Terminate the chain rather than + abort on mark_read with NO_REGS. + +2000-11-21 Mike Stump + + * fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Fix to allow + compilation with older compilers, such as /bin/cc on SunOS. + * fixinc/fixfixes.c (FIX_PROC_HEAD): Ditto. + +2000-11-21 Richard Henderson + + * varasm.c (record_constant): Pad the constructed + constant_descriptor appropriately. + +Wed Nov 22 00:52:55 2000 J"orn Rennecke + + * rtl.h (traverse_md_constants): Declare. + (struct md_constant): Define. + * Makefile.in (HOST_RTL): Add hashtab.o . + (OBJS): Add hashtab.o . + (hashtab.o): New rule. + (rtl.o): Depends on HASHTAB_H. + * rtl.c (hashtab.h): #include. + (md_constants): New static variable. + (def_hash, def_name_eq_p, read_constants): New static functions. + (traverse_md_constants): New function. + (read_name): Do constant expansion. + (read_rtx): Recognize define_constants. + * gencodes.c (print_md_constant): New function. + (main): Emit #defines for all constant definitions encountered. + * md.texi (Constant Definitions): New node. + * gensupport.c (xcalloc): New function. + +2000-11-21 Richard Henderson + + * config/alpha/alpha.c (alpha_split_tfmode_frobsign): New. + * config/alpha/alpha-protos.h: Declare it. + * config/alpha/alpha.md (abstf_internal): Use it. + (negtf_internal): Likewise. + (andnotdi3): Unstar the name. + (movtf_internal): Add o/G alternative. + +2000-11-21 Zack Weinberg + + * stringpool.c (stringpool_statistics): Also report number and + percentage of entries which are identifiers. + +2000-11-21 Diego Novillo + + * gcse.c (hoist_expr_reaches_here_p): Do not mark expr_bb as + visited before visiting it. + +2000-11-21 Nick Clifton + + * config/arm/arm.h: Accept TARGET_CPU_arm9tdmi, + TARGET_CPU_strongarm110 and TARGET_SPU_strongarm1100. + + * config.gcc: Accept --with-cpu=arm9 and --with-cpu=arm9tdmi. + +2000-11-21 Richard Henderson + + * c-common.c (c_unsafe_for_reeval): New function. + (add_c_tree_codes): Register it. + * c-common.h: Declare it. + * tree.c (lang_unsafe_for_reeval): New hook. + (unsafe_for_reeval): Call it. + * tree.h: Declare it. + +2000-11-21 Richard Henderson + + * config/i386/i386.c (i386_simplify_dwarf_addr): Simplify @GOT + references as well. + +2000-11-21 Neil Booth + + * do_includes: Revert to using cpp_read_file. + +2000-11-21 Bernd Schmidt + + * loop.c (consec_sets_giv): If the reg we're examining is anything + but UNKNOWN_INDUCT, do nothing. + Reset the reg's type to UNKNOWN_INDUCT before returning. + + Mostly from Vladimir Makarov (vmakarov@redhat.com) + * ia64.md (attr itanium_class): Define insn types as described in + Itanium docs. + (all insn patterns): Use itanium_class, not type attributes. + Occasionally split alternatives as necessary. + (attr type): Compute from new attr itanium_class. + +2000-11-21 Kaveh R. Ghazi + + * tradcpp.c (output_line_command): Mark system headers as such in + `line' commands. + +2000-11-21 Jakub Jelinek + + * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): SPARC has .file/.loc + support in as as well. + * configure: Regenerate. + +2000-11-20 Richard Henderson + + * c-lex.c (orig_filename): New variable. + (init_c_lex): Set it. Move call to cpp_start_read ... + (yyparse): ... here. New function. + * c-parse.in (yyparse_1): Rename the parser entry point. + * c-tree.h: Declare it. + +2000-11-21 Jakub Jelinek + + * expr.c (do_compare_and_jump): If op0 was replaced by promoted + integer constant, use type of op1 for comparison. + +2000-11-20 Stan Shebs + + * config/rs6000/xm-darwin.h: New file, Darwin host definitions. + * config/rs6000/x-darwin: New file, Darwin host fragment. + * config.gcc (powerpc-*-darwin*): New host. + * system.h (HAVE_DESIGNATED_INITIALIZERS): Allow this to be + overridden by a config file. + +2000-11-20 Neil Booth + + * cppmacro.c (paste_tokens): Rename from paste_payloads. + Change token type after pasting spellings. + (paste_all_tokens): Use it. + * gcc.dg/cpp/paste2.c: Update test. + * objc/execute/paste.m: New test. + +2000-11-20 Richard Henderson + + * dwarf.h (FMT_CODE): Adjust argument order; fix mapping to + dwarf_subscr_data_formats bits. + * dwarfout.c (simple_type_size_in_bits): Handle a type with + no computed size as size zero. + (field_byte_offset): Likewise. + (subscript_data_attribute): Handle a range with no upper bound. + +2000-11-20 Kaveh R. Ghazi + + * gansidecl.h (const): Check __STDC__ before undef'ing `const'. + +2000-11-20 Joseph S. Myers + + * c-typeck.c (build_conditional_expr): When merging type + qualifiers for conditional expressions between a pointer and a + pointer to a void type, merge the qualifiers on the target types + rather than the pointer type. Remove obsolete conditioned out + code. + +2000-11-20 Neil Booth + + * c-lang.c (lang_init_options): Update call to + cpp_reader_init. + * cppmain.c (main): Similarly. + * fix-header.c (read_scan_file): Similarly. + * cp/lex.c (lang_init_options): Similarly. + * objc/objc-act.c (lang_init_options): Similarly. + * cppexp.c (parse_number): Only warn for unextended C89. + * cppinit.c (set_lang): New function. + (cpp_reader_init): Take a LANG argument and pass it to set_lang. + (COMMAND_LINE_OPTIONS): New option std=c++98. + (cpp_handle_option): Use set_lang. + * cpplex.c (_cpp_lex_token): Warn pedantically if not C99. + * cppib.h (enum_c_lang): New enumeration. Update comments. + +2000-11-20 Will Cohen + + * calls.c (expand_call): Clear target only when target is in + hard register and current_function_check_memory_usage is set. + +2000-11-20 Bernd Schmidt + + * toplev.c (rest_of_compilation): Run optimize_mode_switching even + if not optimizing. + * sh.c (emit_sf_insn, emit_df_insn): Just call emit_insn. + +2000-11-19 Richard Henderson + + * crtstuff.c (force_to_data): Use array size 1 not 0. + + * dwarf2out.c (simple_type_size_in_bits): Handle a type with + no computed size as size zero. + (field_byte_offset): Likewise. + +2000-11-20 Joseph S. Myers + + * config.gcc: Fix another typo. + +2000-11-19 Richard Henderson + + * c-decl.c (grokdeclarator): Support flexible array members. + Use open-ended ranges for these and zero-length arrays. + * c-typeck.c (push_init_level): Validate the context of + initialization of a zero-length array. + * tree.c (int_fits_type_p): Be prepared for missing bounds. + * varasm.c (array_size_for_constructor): New. + (output_constructor): Use it for arrays of unspecified length. + * extend.texi (Zero Length): Mention C99 flexible array members. + Document initialization in a top-level struct as valid. + +2000-11-19 Joseph S. Myers + + * config.gcc, invoke.texi: Fix errors in spelling of "deprecated". + + * alias.c (mems_in_disjoint_alias_sets_p): Do use alias sets in + stdarg and varargs functions. + +2000-11-19 Zack Weinberg + + * gcc.c (process_command): Define 'j' variable when + MODIFY_TARGET_NAME is defined. + +2000-11-19 Richard Henderson + + * stor-layout.c (variable_size): Only put SAVE_EXPRs on pending_sizes. + +2000-11-19 Franz Sirl + + * rs6000/rs6000.c (rs6000_encode_section_info): Fix string length + calculation and allocation. + +2000-11-19 Kaveh R. Ghazi + + * builtins.c (c_getstr): Constify variable. + * gmon-sol2.c (_mcleanup): Comment out #endif labels. + * conflict.c (const_conflict_graph_arc): New typedef. + (arc_hash, arc_eq): Avoid needlessly casting away const-ness. + * cppmacro.c (builtin_macro): Likewise. + * dwarf2out.c (output_comp_unit): Constify variable. + * fix-header.c (v_fatal): Add ATTRIBUTE_PRINTF. + * protoize.c (IS_SAME_PATH_CHAR): Use TOUPPER, not toupper. + * ssa.c (ssa_rename_from_hash_function): Avoid needlessly casting + away const-ness. + * tradcpp.c (rescan, do_line, macroexpand, macarg): Use + ISALNUM/ISDIGIT/ISPRINT, not isalnum/isdigit/isprint. + * varasm.c (const_str_htab_hash, const_str_htab_eq, + compare_constant_1, record_constant_1): Constify. + +2000-11-18 Richard Henderson + + * c-decl.c (grokdeclarator): Special case the creation of an + index for a zero-length array. + * tree.c (build_index_type): Revert Oct 20 change. + +2000-11-18 Marek Michalkiewicz + + * config/avr/avr-protos.h (avr_output_addr_vec_elt): Prototype. + * config/avr/avr.c (jump_tables_size): New variable. + (function_prologue): Initialize it as 0. + (function_epilogue): Add it to function_size. + (avr_output_addr_vec_elt): New function. Count words in jump + tables in jump_tables_size. Move code ... + * config/avr/avr.h (ASM_OUTPUT_ADDR_VEC_ELT): ... from here. + Call avr_output_addr_vec_elt instead. + * config/avr/avr.md (tablejump): Remove disabled define_expand. + +2000-11-18 Mark Mitchell + + * configure.in: Make --enable-new-gxx-abi the default. + * configure: Likewise. + +2000-11-18 Kaveh R. Ghazi + + * Makefile.in (tradcpp.o, tradcif.o): Depend on tradcpp.h. + + * tradcif.y: Include tradcpp.h. Constify. Make functions static. + Move extern function declarations to tradcpp.h. + + * tradcpp.c: Likewise. + + * tradcpp.h: New file. + +2000-11-18 Joseph S. Myers + + * c-decl.c (check_for_loop_decls): New function. + * c-parse.in (for_init_stmt): New. + (select_or_iter_stmt): Use for_init_stmt. + * c-tree.h (check_for_loop_decls): New declaration. + +2000-11-18 Neil Booth + + * cppinit.c: Update comments. + (cpp_reader_init): Make -imacro and -include use the standard + #include "" search path. + (do_includes): New function. + +2000-11-18 Ben Elliston + + * config/sh/crt1.asm (start_l): Move PC-relative move instruction + out of a branch delay slot. + +2000-11-17 Richard Henderson + + * config/alpha/elf.h (PREFERRED_DEBUGGING_TYPE): Set to DWARF2_DEBUG. + (ASM_SPEC): Disable and enable .mdebug based on -gstabs. + (ASM_FILE_START): Only write out ecoff .file directive if + emitting mdebug debugging. + +2000-11-17 Richard Henderson + + * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): New. Detect + whether as accepts .file/.loc and produces dwarf2 line info. + * dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Default on if + the assembler supports it. + * config.in, configure: Regenerate. + +2000-11-17 Richard Henderson + + * fixinc/mkfixinc.sh: Don't disable fixincludes for any linux*. + +2000-11-17 Jim Wilson + + * config/ia64/ia64.c (emit_insn_group_barriers, case CALL_INSN): + Don't clear need_barrier is next_insn is a CALL_INSN, or has + instruction type B or UNKNOWN. + +2000-11-17 Neil Booth + + * cpperror.c (print_file_and_line): Don't display line number if 0. + +2000-11-17 Zack Weinberg + + * ggc.h: Delete ggc_add_string_root and ggc_mark_string. Add + digit_vector and digit_string. + * stringpool.c (digit_vector): New. + (ggc_alloc_string): Use digit_string. + + * stmt.c (digit_strings): Delete. + (init_stmt): Do not initialize digit_strings. + (expand_asm_operands): Use ggc.h's digit_string macro. + * toplev.c (mark_file_stack): Delete. + (compile_file): Don't call init_tree_codes. + (main): No need to make the file stack a GC root. + * tree.c (init_tree_codes): Delete. + * tree.h (init_tree_codes): Delete. + + * c-lex.c: Don't include ggc.h. + (mark_splay_tree_node, mark_splay_tree): Delete. + (init_c_lex): No need to ggc_strdup string constant. Don't add + file_info_tree to GGC roots. + (cb_enter_file, cb_rename_file): No need to ggc_strdup + ip->nominal_fname. + + * Makefile.in (c-lex.o): No longer depends on $(GGC_H). + + * dbxout.c (dbxout_init), + dwarf2out.c (dwarf2out_line), + ggc-common.c (ggc_mark_rtx_children, ggc_mark_trees), + varasm.c (mark_const_hash_entry, mark_pool_constant, init_varasm_once), + xcoffout.c (xcoffout_source_file), + i386.c (load_pic_register): + Delete call(s) to ggc_add_string_root and/or ggc_mark_string. + + * except.c (create_rethrow_ref), + profile.c (init_edge_profiler), + toplev.c (compile_file), + varasm.c (named_section, assemble_static_space, + assemble_trampoline_template, output_constant_def, force_const_mem), + i386.c (load_pic_register), + ia64.c (ia64_encode_section_info), + rs6000.c (rs6000_emit_load_toc_table, create_TOC_reference, + rs6000_emit_prologue, rs6000_emit_epilogue), + rs6000.md (load_toc_aix_si, load_toc_aix_di): + Change ggc_alloc_string (var, -1) to ggc_strdup (var). + + * profile.c (output_func_start_profiler), + tree.c (make_node), + i386.c (load_pic_register): No need to ggc_strdup string constant. + +2000-11-17 Hans-Peter Nilsson + + * Makefile.in (config.status): Depend on config.gcc. + * configure.in : Move + contents of loop into config.gcc, removing autoconf quoting. + Fix changequote bug for alpha*-*-vxworks*. + * configure: Regenerate. + * config.gcc: New. + +2000-11-16 Zack Weinberg + + * c-parse.in (if_prefix): Find the filename and line number at + $-2 and $-1 respectively. + * diagnostic.c (error_recursion): Add missing newline, use + fputs, translate string. + +2000-11-16 Zack Weinberg + + * stringpool.c: New file. + * ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete. + (ggc_alloc_string): Now in stringpool.o. + * ggc-page.c, ggc-simple.c: Do not define or allocate empty_string. + * ggc.h: Delete prototype of ggc_add_string_root. #define + ggc_add_string_root and ggc_mark_string to nothing. Prototype + init_stringpool and stringpool_statistics. + (ggc_alloc_string): Returns a const char *. + * tree.c (hash_table, do_identifier_warnings): Delete. + (init_obstacks): Don't initialize the identifier hash table. + (get_identifier, maybe_get_identifier, start_identifier_warnings, + set_identifier_size): Now in stringpool.c. + * tree.h (struct tree_string): Constify pointer field. + (approx_sqrt): Prototype. + + * Makefile.in (stringpool.o): Add rule, mention in OBJS. + + * toplev.c (approx_sqrt): New function. + (compile_file): Call stringpool_statistics if mem_report is on. + (main): Call init_stringpool. + + * builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c + (process_directive), c-typeck.c (constructor_asmspec, struct + initializer_stack, start_init), except.c (create_rethrow_ref), + stmt.c (digit_strings), toplev.c (decode_f_option), tree.c + (built_in_filename), varasm,c (in_named_name, + assemble_static_space, struct constant_descriptor, struct + deferred_string, struct pool_constant, force_const_mem), + i386.c (pic_label_name, global_offset_table_name), rs6000.c + (rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *. + + * c-common.c (combine_strings): Combine strings in scratch + buffer, then pass to build_string. + * optabs.c (init_libfuncs), profile.c (init_edge_profiler, + output_func_start_profiler), stmt.c (init_stmt), alpha.c + (alpha_need_linkage), arm.c (arm_encode_call_attribute), + i386.c (load_pic_register), ia64.c (ia64_encode_section_info), + rs6000.c (rs6000_encode_section_info): Create string in + scratch buffer, then pass to ggc_alloc_string. + + * stmt.c (expand_asm_operands): If we must adjust the + constraint strings, do so by creating a new one, not by + modifying the old one in place. Constify some char *s. + * config/pa/pa.c (hppa_encode_label): Drop unnecessary second + argument. Create string in scratch buffer, then pass to + ggc_alloc_string. + * config/pa/pa-protos.h: Update prototype. + * config/pa/elf.h, config/pa/pa.h, config/pa/som.h: + hppa_encode_label takes only one argument. + +2000-11-16 Kaveh R. Ghazi + + * mcore.c (mcore_expand_prolog): Call xmalloc/xrealloc, not + malloc/realloc. + + * cpplib.c (glue_header_name): Likewise. + + * fixincl.c (run_compiles, start_fixer): Likewise. + + * fixlib.c (load_file_data): Likewise. + + * mkdeps.c (munge): Likewise. + +2000-11-17 Hans-Peter Nilsson + + * defaults.h [EH_FRAME_SECTION_ASM_OP] (EH_FRAME_SECTION): Remove + trailing ';'. Fix formatting. + +2000-11-16 Jim Wilson + + * config/ia64/ia64.h (MASK_INLINE_DIV_LAT, MASK_INLINE_DIV_THR): + Shift masks left by one to avoid conflict. + + * config/ia64/ia64.c (ia64_encode_section_info): Disallow decls with + DECL_EXTERNAL set. + +2000-11-16 Nick Clifton + + * config/arm/arm.c (output_arm_prologue): Note nested functions. + (arm_expand_prologue): For nested functions preserve the + static chain register during stack frame creation. + + * config/arm/arm.h (STATIC_CHAIN_REGNUM): Change to 12. + (ARM_INITIAL_FRAME_ELIMINATION_OFFSET): For a nested function + with a stack frame there is a 4 byte gap between the arg + pointer and the hard frame pointer (used to preserve the + static chain register during stack frame creation). + +2000-11-16 DJ Delorie + + * rtl.c (read_rtx): Provide suitable names for unnamed + define_insn and define_insn_and_split patterns, based on file + and line numbers. + +2000-11-15 Neil Booth + + * cpplib.c (start_directive, end_directive): New functions. + (_cpp_handle_directive, run_directive): Use them. + (_cpp_handle_directive): Don't -Wtraditional on indented + null directives. + (_cpp_push_buffer): Don't re-clear was_skipping. + * cpplib.h (struct cpp_reader): New member la_saved. + * cppmacro.c (cpp_get_token): Don't interpret _Pragma in + directives. + + gcc.dg/cpp/_Pragma1.c: Update. + gcc.dg/cpp/_Pragma2.c: New test. + +2000-11-15 Mark Mitchell + + * toplev.c (wrapup_global_declarations): Don't write out + artificial static variables that aren't needed. + +2000-11-15 Bernd Schmidt + + * ia64.c (struct group): New structure. + (last_group): New static array. + (group_idx): New static variable. + (emit_group_barrier_after, errata_find_address_regs, errata_emit_nops): + New static functions. + (emit_insn_group_barriers): Initialize and keep track of group_idx + and last_group. + Call errata_emit_nops if TARGET_B_STEP or TARGET_A_STEP. + Replace all calls to emit_insn_after that emit a group barrier to use + emit_group_barrier_after. + * ia64.h (MASK_B_STEP): New. + (other MASK_XXX macros): Renumbered. + (TARGET_B_STEP): New. + (TARGET_SWITCHES): Add -mb-step. + +2000-11-15 Fred Fish + + * fixinc/mkfixinc.sh (fixincludes): Add *-*-beos* to list of + machines for which fixincludes is not needed. + * config/i386/x-beos (STMP_FIXPROTO): Don't run fixproto. + +2000-11-15 Jason Merrill + + * diagnostic.c (finish_abort): New fn. + (fancy_abort, error_recursion): Use it. + * toplev.c (crash_signal): Likewise. + * diagnostic.h: Declare it. + +2000-11-13 Andrew Haley + + * tree.c (build_type_no_quals): New function. + * tree.h (build_type_no_quals): Declare. + * c-common.c (c_get_alias_set): When considering type + compatibility for pointer types, ignore cv-qualifiers anywhere in + a pointer chain. + +2000-11-15 Graham Stott + + * regrename.c (scan_rtx_rtx): Skip to the next chain on + encountering a terminated chain. + +2000-11-14 Mark Mitchell + + * configure.in: Move check for V3 above check for C++ header-file + directory. + * configure: Regenerated. + +2000-11-14 DJ Delorie + + * config/v850/v850.c: Remove obstacks. + +Tue Nov 14 21:54:31 2000 Marek Michalkiewicz & Denis Chertykov + + * config/avr/avr.c (avr_case_values_threshold): New. + (avr_override_options): Set it depending on options, make it large + when not optimizing to work around "unable to generate reloads". + + * config/avr/avr.h (TARGET_SWITCHES): Add -mno-tablejump option. + (EXTRA_SECTION_FUNCTIONS): Make the .progmem.gcc_sw_table section + executable if not AVR_MEGA. Make sure jump tables are word-aligned. + (JUMP_TABLES_IN_TEXT_SECTION): Define as 0, not 1. + (ASM_OUTPUT_ADDR_VEC_ELT): Optimize, use "rjmp" if not AVR_MEGA. + (avr_case_values_threshold): Declare as extern int. + (CASE_VALUES_THRESHOLD): Define as avr_case_values_threshold. + + * config/avr/avr.md (tablejump): Removed. + (*tablejump_rjmp): New for jump tables made from "rjmp" instructions. + (*tablejump_lib, *tablejump_enh, *tablejump): Change to expect the + index in the table, not multiplied by 2. + (casesi): Change to match the above insns. Always enable. + + * config/avr/libgcc.S (__tablejump__): Rename to __tablejump2__. + Change to expect the word address of the table, multiply it by 2 + here and not in the caller. Change "adiw" to faster "inc". + +2000-11-14 Neil Booth + + * cppexp.c (parse_defined): Call cpp_get_token not + _cpp_get_token. + (lex): Similarly. + * cpplex.c (cpp_output_line): Similarly. + * cpplib.c (glue_header_name, do_line, do_ident, + parse_answer, parse_assertion): Similarly. + (_cpp_handle_diretive): Don't save to lookaheads + when processing directives. + * cppmacro.c (parse_arg, expand_arg): Call cpp_get_token not + _cpp_get_token. + (funlike_invocation_p): Don't save to lookaheads + when pre-expanding arguments. + (_cpp_get_token): Delete. + (cpp_get_token): Merge contents of _cpp_get_token. + +2000-11-14 Jakub Jelinek + + * builtins.c (expand_builtin_setjmp): Set + current_function_calls_setjmp. + (expand_builtin_longjmp): Set current_function_calls_longjmp. + + * config/sparc/sparc.md (builtin_setjmp_setup): New expand. + (do_builtin_setjmp_setup): New insn. + +Tue Nov 14 12:34:56 2000 Richard Kenner + + * tree.c (get_unwidened): Use host_integerp and tree_low_cst. + (int_fits_type_p): For variable bounds, call force_fit_type. + +2000-11-14 Jakub Jelinek + + * varasm.c (struct deferred_string): New structure. + (const_str_htab): New variable. + (STRHASH): New macro. + (mark_const_str_htab_1, mark_const_str_htab, const_str_htab_hash, + constr_str_htab_eq, const_str_htab_del): New functions. + (output_constant_def): Add DEFER argument, defer string + constants until mark_constant_pool time if requested. + (mark_constant_pool): Walk the insn chain even if const_str_htab is + not empty. + (mark_constants): If a SYMBOL_REF for deferred string is found, + output it and remove from hash table. + (output_addressed_constants): Set DEFER to 0 in call to + output_constant_def. + * rtl.h (STRING_POOL_ADDRESS_P): Define. + (output_constant_def): Adjust prototype. + * expr.c (expand_expr): Set DEFER to 1 in call to output_constant_def. + +2000-11-14 Chandrakala Chavva + + * optabs.c (expand_complex_ab):: Use overflow-trapping optabs for + signed types if flag_trapv. + +2000-11-14 Zack Weinberg + + * tradcpp.c, tradcif.y: Update FSF mailing address, delete + reference to GPLv1. + +2000-11-14 Joseph S. Myers + + * c-common.h (CTI_C_SIZE_TYPE): Update comment. + +2000-11-14 Jakub Jelinek + + * varasm.c (struct varasm_status): Change x_const_rtx_sym_hash_table + to array of pool_constnat pointers. + (struct pool_constant): Add next_sym and label members. + (struct pool_sym): Remove. + (init_varasm_status): Change pool_sym into pool_constant. + (mark_pool_constant): Mark pc->label string as well. + (mark_pool_sym_hash_table): Remove. + (mark_varasm_status): Remove it from caller as well. + (free_varasm_status): Don't free pool_sym structures. + (force_const_mem): Don't allocate pool_sym structure, instead + fill pool->label and chain it into rtx_sym hash table. + (find_pool_constant, mark_constant_pool): Use pool_constant instead + of pool_sym. + +2000-11-14 Jakub Jelinek + + * reload1.c (emit_input_reload_insns): Honor forcing of constants + into memory by PREFERRED_RELOAD_CLASS NO_REGS. + +2000-11-14 Michael Matz + + * dominance.c: New file. + * Makefile.in (OBJS): Add dominance.o. + + * flow.c (compute_flow_dominators): Remove. + (compute_immediate_dominators): Remove. + (compute_immediate_postdominators): Remove. + * basic-block.h: Remove their prototypes. + (calculate_dominance_info): Add prototype. + + * dce.c (eliminate_dead_code): Change calls to above functions. + Don't compute dominators but only immediate dominators. + * flow.c (flow_loops_find): Change callers. + * gcse.c (compute_code_hoist_data): Likewise. + * haifa-sched.c (schedule_insns): Likewise. + * ifcvt.c (if_convert): Likewise. + * ssa.c (convert_to_ssa): Likewise, and only compute immediate + dominators. + +2000-11-14 Richard Henderson + + * stmt.c (warn_if_unused_value): Don't warn if the expression + has side effects. + + * c-typeck.c (c_sizeof): Fold result to c_size_type_node. + (c_sizeof_nowarn, c_alignof, c_alignof_expr): Likewise. + +2000-11-13 Franz Sirl + + * loop.c (basic_induction_var): Revert accidental checkin. + +2000-11-13 Hans-Peter Nilsson + + * c-lex.c (cb_leave_file): Harmonize conditions and order of + statements to those of process_directive for (action == act_pop). + + * collect2.c (main): Pass on -B options from COLLECT_GCC_OPTIONS. + + * local-alloc.c (equiv_init_movable_p): References to CC0 are not + movable. + +2000-11-13 Joseph S. Myers + + * c-parse.in (stmts_and_decls): Deprecate use of label at end of + compound statement. + +2000-11-13 Neil Booth + + * cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF + cases return without MI check. + * cpplib.c (do_diagnostic): Take boolean of whether to + print the directive name. + (do_error, do_warning): Update. + (do_pragma_dependency): Use it. + * cpplib.h (VARARGS_FIRST): Delete. + (struct cpp_token): Delete integer. + * cppmacro.c (enter_macro_context): Move disabled check + to _cpp_get_token. + (_cpp_get_token): Simplify into a single loop. + +2000-11-13 Richard Earnshaw + + * configure.in: Use 'test -f' not '[ -e'. + * configure: Regenerated. + +2000-11-13 DJ Delorie + + * config/mn10300/mn10300.md (store_movm): Note which registers are + really used or clobbered. + +2000-11-13 Joseph S. Myers + + * c-parse.in (ends_in_label): Remove from %union and %type. + (decls, stmts, lineno_stmt_or_labels, xstmts, + lineno_stmt_or_label, stmt_or_label): Remove. + (stmts_and_decls, lineno_stmt_decl_or_labels_ending_stmt, + lineno_stmt_decl_or_labels_ending_decl, + lineno_stmt_decl_or_labels_ending_label, + lineno_stmt_decl_or_labels_ending_error, + lineno_stmt_decl_or_labels, compstmt_contents_nonempty, + lineno_stmt, lineno_label): New. + (compstmt_nostart): Use compstmt_contents_nonempty. + +2000-11-13 Joseph S. Myers + + * c-common.c (boolean_increment): New function. + * c-common.h (enum c_tree_index): Add CTI_C_BOOL_TYPE, + CTI_C_BOOL_TRUE and CTI_C_BOOL_FALSE. + (c_bool_type_node, c_bool_true_node, c_bool_false_node): Define. + (boolean_increment): Declare. + * c-convert.c (convert): Allow for BOOLEAN_TYPE. + * c-decl.c (init_decl_processing): Create boolean nodes. + (finish_struct): Allow for _Bool bitfields. + * c-parse.in (reswords): Add _Bool. + (rid_to_yy): Allow for RID_BOOL. + * c-typeck.c (default_conversion): Make booleans promote to int. + (convert_arguments, build_unary_op, build_modify_expr, + convert_for_assignment): Allow for booleans. + * ginclude/stdbool.h: Make conforming to C99. + +2000-11-13 Joseph S. Myers + + * c-parse.in (c99_block_start, c99_block_end, + c99_block_lineno_labeled_stmt): New. + (simple_if, do_stmt_start): Use c99_block_lineno_labeled_stmt. + (stmt): Split off selection and iteration statements into... + (select_or_iter_stmt): New. Use c99_block_lineno_labeled_stmt. + +2000-11-13 Joseph S. Myers + + * invoke.texi (-Wtrigraphs, -fdump-translation-unit, -save-temps, + -time): Update. + +2000-11-13 Richard Earnshaw + + * arm.md (mulsidi3adddi, umulsidi3adddi): Revert previous change. + Rewrite to avoid use of match_dup. Don't try to tie registers that + are not in the same mode. + +2000-11-13 Joseph S. Myers + + * invoke.texi: Update lists of languages and suffixes supported. + +2000-11-13 Joseph S. Myers + + * configure.in: Take toplevel configure arguments from the + environment to create configargs.h and substitute + gcc_config_arguments, taking account of any existing configargs.h + if reconfiguring. + * configure: Regenerate. + * gccbug.in: Include toplevel configure arguments in gccbug. + +2000-11-13 Richard Earnshaw + + * varasm.c (struct constant_descriptor): Put CONTENTS inside a + union to make it well-aligned. Update all uses. + +2000-11-13 Joseph S. Myers + + * c-parse.in (initelt): Give appropriate pedantic warnings, + depending on flag_isoc99, for non-ISO syntax and for C99 syntax + outside C99 mode. + (designator): If pedantic, pedwarn for a designator specifying a + range of elements. + * c-typeck.c (set_init_index, set_init_label): Don't pedwarn for + these cases. + * extend.texi: Document the C99 syntax as the preferred syntax, + and the pre-2.5 syntax as obsolete. Mention use of designator + lists for nested subobjects. + +2000-11-13 Joseph S. Myers + + * diagnostic.c (vbuild_message_string, output_do_printf, vnotice): + Add ATTRIBUTE_PRINTF. + * tradcpp.c (v_message, warning, error, fatal, error_with_line): + Add ATTRIBUTE_PRINTF*. + +2000-11-12 Mark Mitchell + + * function.c (assign_parms): When calling put_var_into_stack, make + sure that there are no hidden pending sequences. + +2000-11-12 Kaveh R. Ghazi + + * builtins.c (expand_builtin): Handle BUILT_IN_INDEX and + BUILT_IN_RINDEX. Add missing checks for BUILT_IN_STRCHR and + BUILT_IN_STRRCHR. + + * builtins.def (BUILT_IN_INDEX, BUILT_IN_RINDEX): New entries. + + * c-common.c (c_common_nodes_and_builtins): Declare index and + rindex when nonansi builtins are allowed. + + * extend.texi (index, rindex): Document new builtins. + +2000-11-12 Mark Mitchell + + * configure.in: Turn on libstdc++ V3 by default. + * configure: Regenerated. + + * fixinc/mkfixinc.sh: Use the ordinary fixincludes on Solaris. + +2000-11-12 Jakub Jelinek + + * reload1.c (set_label_offsets): Go inside of PARALLELs. + +2000-11-12 Joseph S. Myers + + * invoke.texi: Clean up option summary. + +2000-11-12 Nick Clifton + + * config/mcore/mcore.c: Fix comment formating, and adjust sequence + of #include headers. + +2000-11-12 Marc Espie + + * configure.in: Fix filds test. + * configure: Regen. + +2000-11-12 Mark Mitchell + + * jump.c (delete_computation): Don't assume that just because an + instruction sets a register, that register is dead. + +2000-11-12 Neil Booth + + * cppexp.c: Don't worry about pfile->skipping. + * cpplib.c (struct if_stack): Make was_skipping unsigned char. + (cpp_handle_directive): Save pfile->skipping in struct cpp_buffer + for handled directives. + (skip_rest_of_line): Use _cpp_lex_token after popping contexts + and releasing lookaheads. + (do_ifdef, do_ifndef, do_if): Use buffer->was_skipping. + (do_else, do_elif, push_conditional): Update logic. + (do_endif): Set buffer->was_skipping rather than pfile->skipping. + (unwind_if_stack): Inline into cpp_pop_buffer. + (cpp_push_buffer): Clear ifs->was_skipping for cpp_handle_directive. + * cpplex.c (_cpp_lex_token): Clear skipping on EOF. Handle + multiple-include optimisation. + * cpplib.h (struct cpp_buffer): New member was_skipping. + * cppmacro.c (_cpp_get_token): Loop whilst pfile->skipping. This + works because skipping == 0 in directives. + (_cpp_release_lookahead): Renamed from release_lookahead. + (cpp_get_token): No need to check skipping as _cpp_get_token does + this for us. No need to handle MI optimisation. + +Sat Nov 11 21:14:02 2000 Mark P Mitchell + + * fixinc/inclhack.def (sunos_matherr_decl): Bypass matherr + declarations that use `__MATH_EXCEPTION' in their prototypes, too. + * fixinc/fixincl.x: Regenerated. + +2000-11-11 Bruce Korb + + * fixinc/inclhack.def (avoid_bool_type): avoid commenting out #endif + (avoid_wchar_t_type): ditto + * fixinc/fixinc.irix: obsoleted + +2000-11-11 Zack Weinberg + + * configure.in: Don't add $outputs to all_lang_makefiles. Add + $srcdir/$s/Makefile.in if it exists. + * configure: Regenerate. + +Sat Nov 11 18:41:20 2000 Mark P Mitchell + + * fixinc/mkfixinc.sh: Use the ordinary fixincludes on IRIX. + +2000-11-11 Jason Merrill + + * function.c (assign_parms): If TREE_ADDRESSABLE is set, try to + give the parm a register and then call put_var_into_stack. + * stmt.c (expand_decl): Likewise. + +2000-11-11 Joseph S. Myers + + * gcc.texi: Adjust wording. + +2000-11-11 Mark Mitchell + + * fixinc/inclhack.def (avoid_wchar_t_type): New fix. + * fininc/fixincl.x: Regenerated. + +2000-11-11 Joseph S. Myers + + * invoke.texi: Correct spelling of -foptimize-register-move. + +2000-11-11 Neil Booth + + Remove CPP_PLACEMARKERs. + + * cppexp.c (lex): Don't handle CPP_PLACEMARKER. + * cpplex.c (_cpp_lex_token): Rename skip_newlines to next_bol + * cpplib.c (skip_rest_of_line, check_eol, cpp_push_buffer): + Similarly. + * cpplib.h: Remove CPP_PLACEMARKER. + (struct lexer_state): Rename skip_newlines to next_bol. + * cppmacro.c (stringify_arg): Don't handle CPP_PLACEMARKER. + Simplify prev_white handling as a result. + (paste_all_tokens): Don't worry about CPP_PLACEMARKERs. + (parse_arg): Empty arguments are now empty, not CPP_PLACEMARKERs. + (parse_args): Similarly. Update argument count tests. + (enter_macro_context): Return 2 to indicate an empty macro. + (replace_args): Don't bother pre-expanding an empty argument. + Handle placemarkers and ## extension during pre-expansion. + (cpp_get_token): Handle empty macro expansions. Don't worry + about CPP_PLACEMARKERs. + (_cpp_create_definition): Empty macros are now empty. + (cpp_macro_definition): Don't special case empty macros. + * scan-decls.c: Don't bother with CPP_PLACEMARKERs. + * c-lex.c: Similarly. + +2000-11-11 Joseph S. Myers + + * gcc.texi, invoke.texi: Add new section discussing language + standards; link to it where appropriate; refer to ISO C instead of + ANSI C. + +2000-11-11 Alexandre Oliva + + * builtins.c (std_expand_builtin_va_start): Take PARM_BOUNDARY + into account. + + * config/sh/sh.h (MODES_TIEABLE_P): Don't tie SFmode to other FP + modes. + +2000-11-10 Joseph S. Myers + + * gcc.texi, gcov.texi: Update dates and version numbers. + +2000-11-10 Zack Weinberg + + * configure.in: Remove AC_PROG_LEX and AC_PROG_YACC. Look for + flex and bison, specifically, first in a unified build and + then installed on the system. + * Makefile.in: Set BISON to @BISON@, FLEX to @FLEX@. Rename + LEXFLAGS to FLEXFLAGS. Adjust ORDINARY_FLAGS_TO_PASS to + match. + + (collect2.o, gcc.o, prefix.o, toplev.o, alloca.o, intl.o, + cppdefault.o): Remove pointless sed munging of source file + name. + +2000-11-10 Bernd Schmidt + + * reload.c (find_reloads_address_1, case POST_MODIFY): Use RELOAD_OTHER + for address reloads. Push replacements for REG_INC notes. + (regno_clobbered_p): New arg SETS. Examine SETs if it's nonzero. All + callers changed. + * reload1.c (choose_reload_regs): Registers set in the insn can't be + used for RELOAD_OTHER reloads. + +2000-11-10 Mark Mitchell + + * c-dump.h: New file. + +2000-11-10 Kaveh R. Ghazi + + * alpha.c (check_float_value): Use memcpy, not bcopy. + * arm.c (output_move_double): Likewise. + * arm.md: Likewise. + * m88k.c (legitimize_operand): Likewise. + * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. + * m88k.md: Likewise. + * mips.c (override_options): Likewise. + * mips.md: Likewise. + * romp.c (output_fpops): Likewise. + * rs6000.c (rs6000_override_options): Likewise. + * sh.md: Likewise. + * vax.c (check_float_value): Likewise. + + * emit-rtl.c (copy_rtx_if_shared, init_emit_once): Likewise. + * expmed.c (synth_mult): Likewise. + * final.c (add_bb_string): Likewise. + * genattr.c (main): Likewise. + * genattrtab.c (attr_string, simplify_cond, copy_rtx_unchanging): + Likewise. + * jump.c (thread_jumps): Likewise. + * prefix.c (save_string): Likewise. + * real.h (REAL_VALUE_FROM_CONST_DOUBLE): Likewise. + * regclass.c (init_reg_sets, init_reg_sets_1): Likewise. + * reload1.c (reload, eliminate_regs): Likewise. + +2000-11-10 Joseph S. Myers + + * gcc.texi (Service): Update to reflect current practice and + location of the GNU service directory. + +2000-11-09 Bernd Schmidt + + * regrename.c (build_def_use): Mark contents of REG_INC notes as + needing replacement. + + * config/ia64/ia64.md (extendsfdf2, extendsftf2, extenddftf2): Emit + a no-op move if regs are equal. + * toplev.c (rest_of_compilation): Do the noop moves elimination pass + when calling jump after post-reload splitting. + +2000-11-09 Jan van Male + + * c-tree.texi: Fix typos. + * extend.texi: Likewise + * gcov.texi: Likewise + * rtl.texi: Likewise + * tm.texi: Likewise + +2000-11-09 Hans-Peter Nilsson + + * c-lex.c [! NO_IMPLICIT_EXTERN_C] (cb_enter_file): Check + in_system_header and flags[1] before dereferencing flags[2]. + +2000-11-09 Matthew Hiller + + * reload1.c (reload_combine): Fixed calculation of + first_index_reg, last_index_reg. + +2000-11-09 Mark Mitchell + + * c-dump.c (dequeue_and_dump): Dump function bodies. + + * Makefile.in (C_AND_OBJC_OBJS): Add c-dump.o. + (c-dump.o): New target. + * c-common.h (flag_dump_translation_unit): New variable. + (C_TYPE_QUALS): New macro. + (strip_array_types): New function. + (DECL_C_BIT_FIELD): New macro. + (SET_DECL_C_BIT_FIELD): Likewise. + (CLEAR_DECL_C_BIT_FIELD): Likewise. + (dump_info_p): New typedef. + (dump_tree_fn): Likewise. + (lang_dump_tree): New variable. + (dump_node_to_file): New function. + * c-common.c (flag_dump_translation_unit): Define it. + (strip_array_types): New function. + * c-decl.c (c_decode_option): Handle -fdump-translation-unit. + * c-lang.c (finish_file): Call dump_node_to_file if + flag_dump_translation_unit. + * c-semantics.c (mark_rtl_for_local_static): Fix typo in comment. + * c-tree.h (DECL_C_BIT_FIELD): Remove declaration. + * c-dump.c: New file. + +2000-11-09 Christopher Faylor + + * config/i386/cygwin.h: Add mingw startfile prefix. + +2000-11-09 Richard Henderson + + * flow.c (invalidate_mems_from_set): Split out from ... + (mark_set_1): ... here. + (try_pre_increment_1): Use it. Use propagate_block_delete_insn + instead of turning insn into a NOTE_INSN_DELETED. + +2000-11-10 Joseph S. Myers + + * extend.texi, invoke.texi: Move documentation of builtin versions + of C library functions to one place and update. + +2000-11-09 Richard Henderson + + * fold-const.c (fold): Compare TYPE_MAIN_VARIANT rather than + the types themselves to discover type equivalence. + +2000-11-09 Mike Stump + + * Makefile.in (distclean): Remove a few extra leftovers. + +2000-11-09 Richard Henderson + + * recog.c (validate_replace_rtx_1): Consider subregs when + replacing a register with a constant inside a sign/zero_extend. + + * config/alpha/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +2000-11-09 Geoffrey Keating + + * c-decl.c (finish_struct): When a structure is completed, + check all its variant types for completeness. + +2000-11-09 Neil Booth + + * cpphash.c: Move cpp_defined here from cpplib.c. + * cpplib.c: Update comments, move cpp_defined to cpphash.c. + * cpplex.c (_cpp_lex_token): Don't leave the lexer at EOL. + * cppmacro.c (cpp_get_token): Update comments, no need now + to catch the CPP_EOF meaning EOL case. + +2000-11-08 Geoffrey Keating + + * config/sparc/sparc.c (sparc_va_arg): When the required alignment + is more than that provided, copy to a temporary. + +2000-11-09 Alexandre Oliva + + * mklibgcc.in (EXTRA_MULTILIB_PARTS): Prevent `make' from + interpreting $out as a macro assignment. + * Makefile.in (T_TARGET): New auxiliary macro and target. + (all): Add a target right in the beginning, so that we don't build + T_TARGET by default. + +2000-11-09 Graham Stott + + * config/i386/i386.md (mmx_pinsrw): Output operands in correct + order for -mintel-syntax. Remove comment now that the operand + order has been checked. + (mmx_pextrw): Likewise. + (mmx_pshufw): Likewise. + +2000-11-09 Jakub Jelinek + + * builtins.c (c_strlen): Use TREE_STRING_LENGTH - 1 for max. + (c_getstr): New function. + (expand_builtin_strstr): Do nothing if -fcheck-memory-usage. + If both arguments are constant string, optimize out. + (expand_builtin_strchr, expand_builtin_strrchr): New functions. + (expand_builtin_strpbrk): Use c_getstr, do nothing if + -fcheck-memory-usage. + (expand_builtin_fputs): Likewise. + (expand_builtin_strcmp): Add MODE argument. + Use even if !HAVE_cmpstrsi. + Optimize the case when both arguments are constant strings. + (expand_builtin): Adjust expand_builtin_strcmp caller. + Call expand_builtin_strchr and expand_builtin_strrchr. + * c-common.c (c_common_nodes_and_builtins): Add strchr and strrchr + builtins. + * builtins.def (BUILT_IN_STRRCHR): Add. + +2000-11-08 Gerald Pfeifer + + * fixinc/gnu-regex.c: Rename EGCS LOCAL markers to GCC LOCAL. + +2000-11-09 Joseph S. Myers + + * calls.c (expand_call, emit_library_call_value_1), collect2.c + (scan_prog_file), config/a29k/a29k.c (print_operand), + config/sparc/sparc.c (order_regs_for_local_alloc): Use memcpy () + instead of bcopy (). + * real.h: Use memcmp () instead of bcmp (). + * config/m88k/m88k.c (m88k_layout_frame), config/sh/sh.c + (split_branches), config/sparc/sparc.c (ultra_flush_pipeline, + ultrasparc_sched_init, ultrasparc_sched_reorder), + config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Use memset () + instead of bzero (). + * config/vax/xm-xms.h (FILE_NAME_NONDIRECTORY): Use strrchr () + instead of rindex (). + * configure.in: Don't check for bzero, bcmp, index or rindex. + * configure, config.in: Regenerate. + * system.h: Don't include declarations for bzero, bcmp, index or + rindex. + * config/i386/xm-beos.h, config/rs6000/xm-beos.h: Don't define + bzero, bcmp, index or rindex. + +Wed Nov 8 21:58:20 2000 Christopher Faylor + + * config/i386/cygwin.h: Add -no-win32 switch. Separate -mno-cygwin + include and library paths from -mcygwin case. Parameterize some + declarations to avoid warnings. Use standard locations for include and + lib dirs. + +2000-11-08 Nick Clifton + + * config/arm/arm.md (mulsidi3adddi): Change output operand + constraint from "=&" to "+&". + (umulsidi3adddi): Change output operand constraint from "=&" to + "+&". + +2000-11-08 Richard Henderson + + * flow.c (init_propagate_block_info): Protect the rtx stored in + mem_set_list from modification by find_auto_inc. + (mark_set_1): Likewise. + +2000-11-08 Neil Booth + + Move directive handling into the lexer itself. + + * cpplex.c (_cpp_lex_token): Handle directives directly. + In the case of a directive interrupting a function-like + macro invocation, use extra_char since read_ahead is + used to store the '#'. Return a CPP_EOF in this case. + * cppmacro.c (parse_arg): No need to handle CPP_DHASH any more. + (cpp_get_token): Don't handle directives here. + * cpplib.h: Remove CPP_DHASH token type. + +Wed Nov 8 21:53:41 MET 2000 Jan Hubicka + + * regmove.c (combine_stack_adjustments_for_blocks): Recognize pushes + formed using PRE_MODIFY too. + +2000-11-08 Mark Mitchell + + * c-tree.texi (VAR_DECL): Describe representation of GCC's + extension for placing variables in particular registers. + + * c-tree.texi (FUNCTION_TYPE): Clarify TYPE_ARG_TYPES for + unprototyped C functions with no parameters. + +2000-11-08 Jakub Jelinek + + * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Cast DELTA to int + before passing to fprintf. + +2000-11-08 Jakub Jelinek + + * function.c (expand_function_start): Cast GET_MODE_SIZE to + HOST_WIDE_INT before negating it. + +2000-11-08 Jakub Jelinek + + * expr.c (expand_expr) [ADDR_EXPR]: Handle when op0 is RETURN_DECL + passed in multiple non-contiguous locations. + +2000-11-08 Gerald Pfeifer + + * README.gnat: Remove file. + +2000-11-08 Alexandre Oliva + + * mklibgcc.in (EXTRA_MULTILIB_PARTS): Generate multilib parts + in-place. + +2000-11-07 Richard Henderson + + * dwarfout.c (INSN_LABEL_FMT): Remove. + (output_label_die): Use ASM_GENERATE_INTERNAL_LABEL. + (dwarfout_label): Remove. + * dwarfout.h: Remove it's prototype. + * dwarf2out.c (INSN_LABEL_FMT): Remove. + (gen_label_die): Use ASM_GENERATE_INTERNAL_LABEL. + (dwarf2out_label): Remove. + * dwarf2out.h: Remove it's prototype. + * final.c (final_scan_insn): Don't call dwarf[2]out_label. + +2000-11-07 Richard Henderson + + * config/ia64/fde-glibc.c (find_fde_for_dso): Do a binary + search on the unwind region section. + + * config/ia64/ia64.md (movbi): Add r/r alternative. + (cmovdi_internal_astep): Describe all combinations of register + classes for sources & destinations; remove matching constraints. + (cmovdi_internal): Likewise. + + * gcc.c (default_compilers) [@cpp-output]: Add -fpreprocessed. + +2000-11-07 Richard Henderson + + * c-lang.c (start_cdtor, finish_cdtor): New functions. + (finish_file): Use them in building constructor/destructor functions. + + * config/alpha/alpha.h (HAS_INIT_SECTION, LD_INIT_SWITCH, + LD_FINI_SWITCH): Move ... + * config/alpha/osf.h: ... here. + * config/alpha/alpha-interix.h: Don't undef them. + +2000-11-07 Jeffrey Oldham + + * config/mips/t-iris6 (FPBIT): New. Added so that __unorddf2 is + included in libgcc.a. + (DPBIT): Likewise. + (dp-bit.c): Likewise. + (fp-bit.c): Likewise. + +2000-11-07 Nick Clifton + + * config/m88k/m88k.h (GLOBAL_ASM_OP): Add missing tab. + (INTERNAL_ASM_OP): Add missing tab. + +2000-11-07 Joseph S. Myers + + * alias.c (init_alias_analysis), calls.c (expand_call, + emit_library_call_value_1), combine.c (init_reg_last_arrays), + cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c + (init_output_buffer, set_diagnostic_context), dwarf2out.c + (equate_decl_number_to_die, build_abbrev_table), emit-rtl.c + (init_emit_once), fold-const.c (mul_double, div_and_round_double), + function.c (assign_parms), gcse.c (compute_can_copy, + alloc_gcse_mem, alloc_reg_set_mem, record_one_set, + compute_hash_table, compute_set_hash_table, + compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c + (global_alloc, global_conflicts), haifa-sched.c (compute_trg_info, + clear_units, schedule_block), integrate.c (initialize_for_inline, + expand_inline_function), jump.c (thread_jumps), local-alloc.c + (local_alloc), loop.c (combine_movables, count_loop_regs_set, + load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree), + regclass.c (init_reg_sets, init_reg_sets_1, regclass, + record_reg_classes, allocate_reg_info), reload.c + (get_secondary_mem, remove_address_replacements, find_reloads), + reload1.c (reload, set_initial_label_offsets, finish_spills, + reload_as_needed, choose_reload_regs_init, + reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c + (sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c + (rename_registers), stmt.c (expand_end_case), unroll.c + (unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset + () instead of bzero (). + +2000-11-07 Neil Booth + + * cp/lang-specs.h: Fix -save-temps specs under USE_CPPLIB. + +2000-11-07 Kaveh R. Ghazi + + * c-common.c (combine_strings): Only warn about long strings for C. + +Tue Nov 7 19:44:30 2000 J"orn Rennecke + + * combine.c (distribute_notes): Fix typo in last change. + +2000-11-07 Geoff Keating + + * config/rs6000/rs6000.md (movdi_internal32+1): Use + operand_subreg_force rather than gen_rtx_SUBREG. + (movdi_internal32+2): Likewise. + +2000-11-07 Philip Blundell + + * configure.in (arm*-*-linuxaout*): Obsolete, deleted. + * config/arm/linux-aout.h: Likewise. + * configure: Regenerate. + +2000-11-07 Philipp Thomas + + * ABOUT-GCC-NLS: Remove the patch for gettext as it has been + accepted my the gettext maintainer. + +2000-11-07 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strpbrk): New function. + (expand_builtin): Handle BUILT_IN_STRPBRK. + + * builtins.def (BUILT_IN_STRPBRK): New entry. + + * c-common.c (c_common_nodes_and_builtins): Declare builtin + strpbrk. + +2000-11-07 David O'Brien + + * config/alpha/freebsd.h: New file -- FreeBSD/alpha architecture file. + * POTFILES.in: Add config/alpha/freebsd.h + * configure.in: Add alpha*-freebsd support. + * configure: Regenerate. + +2000-11-07 Joseph S. Myers + + * tree.c (build_common_tree_nodes_2): Make va_list_type_node be a + copy of ptr_type_node rather than ptr_type_node itself. + +Tue Nov 7 06:29:24 2000 J"orn Rennecke + + * combine.c (recog_for_combine): Allocate uninitialized vector with + rtvec_alloc. + * recog.c (apply_change_group): Likewise. + +Tue Nov 7 06:24:02 2000 J"orn Rennecke + + * flow.c (verify_local_live_at_start): Back out last change. + * combine.c (distribute_notes): When parts of a hard reg are + neither set nor referenced in PLACE, search backwards for a + place to put a REG_UNUSED note; if none found, ask for flow + info refresh. + +Mon Nov 6 20:08:13 2000 J"orn Rennecke + + * reload1.c (eliminate_regs_in_insn): Allow a set to be a PARALLEL + with (clobber (match_scratch...)). + +2000-11-06 Neil Booth + + * c-lex.c (init_c_lex): If cpp_start_read fails, exit with + error status. + +2000-11-06 Neil Booth + + * tradcpp.c (special_symbol): Assign an null string rather + than writing to an unallocated buffer. + +2000-11-06 Neil Booth + + * cpplex.c (_cpp_equiv_tokens): Check arg_no in the + CPP_MACRO_ARG case. + +2000-11-06 Neil Booth + + * c-lex.c (c_lex): Replace tok.val.aux with tok.val.c or + tok.val.arg_no as appropriate. + * cppexp.c (lex): Similarly. + * cpplex.c (_cpp_lex_token, cpp_spell_token, cpp_output_token, + cpp_equiv_tokens, cpp_can_paste, cpp_avoid_paste): Similarly. + * cppmacro.c (stringify_arg, replace_args, lex_expansion_token, + cpp_macro_definition): Similarly. + * cpplib.h (struct cpp_token): Replace aux with c and arg_no. + +2000-11-06 Jakub Jelinek + + * config/sparc/sparc.md (adddi3): If operands[2] is 4096 and + operands[1] is constant, calculate the sum and generate movdi. + (addsi3): Similarly. Use SImode in call to arith_4096_operand. + (subsi3): Use SImode in call to arith_4096_operand. + +2000-11-06 Jakub Jelinek + + * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): On sparc64 we need to + adjust %o1, not %o0 if the return type is large structure. + +2000-11-06 Jakub Jelinek + + * config/sparc/sparc.md (smulsi3_highpart_v8plus, ashldi3_v8plus+1, + update_return, flush, flushdi, ffssi2, ffsdi2): Fix output formatting. + +Sat Sep 23 19:10:20 2000 Denis Chertykov & Marek Michalkiewicz + + * expmed.c (expand_divmod): For signed divide by 2, prefer + a branch and fewer shifts if branches are very cheap. + +2000-11-05 Joseph S. Myers + + * Makefile.in: Remove all targets related to building + distributions and diffs, or INSTALL. + * INSTALL, install1.texi: Remove. + * configure.in: Remove mention of distdir. + * configure: Regenerate. + * objc/Make-lang.in: Remove mention of distdir. + +2000-11-04 Neil Booth + + * cpp.texi: Update for _Pragma. + +2000-11-04 Joseph S. Myers + + * gcc.texi (Contributing): Update URL for projects web page. + +2000-11-04 Neil Booth + + * cpplex.c (parse_string): Don't allow multiline strings in + #include family directives. + +2000-11-04 Neil Booth + + * cpplib.c (do_line): Only warn pedantically if not reading + preprocessed input. + +2000-11-04 Alexandre Oliva + + * calls.c (emit_call_1) [sibcall_pop]: Use n_popped instead of + RETURN_POPS_ARGS(). + +2000-11-03 Zack Weinberg + + * builtins.c (expand_builtin_strlen): Remove unused mode + argument. + * gcc.c (process_command): Remove unused variable. + * fold-const.c: Include expr.h. + * recog.c: Include reload.h. + * Makefile.in (recog.o, fold-const.o): Update deps. + +2000-11-02 Geoffrey Keating + + * fixinc/gnu-regex.c: Change 'CYGNUS LOCAL' to 'EGCS LOCAL'. + +Fri Nov 3 13:41:04 2000 Mark P Mitchell + + * config/mips/iris6.h (SUBTARGET_CC1_SPEC): Remove -static + handling. + (STARTFILE_SPEC): Likewise. + (LINK_SPEC): Likewise. + +2000-11-03 Kaveh R. Ghazi + + * Makefile.in (fold-const.o): Depend on $(GGC_H), not ggc.h. + (toplev.o): Likewise for $(LOOP_H)/loop.h and $(REGS_H)/regs.h. + (simplify-rtx.o): Likewise for $(GGC_H)/ggc.h. + +2000-11-03 Joseph S. Myers + + * c-decl.c (duplicate_decls, copy_lang_decl), dwarfout.c + (dwarfout_line), gcc.c (main, save_string), tree.c (init_obstacks, + perm_calloc, get_identifier, maybe_get_identifier, + real_value_from_int_cst, simple_cst_equal), varasm.c + (assemble_name, assemble_real, immed_real_const_1, + compare_constant_1, decode_rtx_const, output_constant_pool): Use + strrchr () instead of rindex (). Use memcmp () instead of bcmp + (). Use memcpy () instead of bcopy (). Use memset () instead of + bzero (). + +2000-11-03 Nathan Sidwell + + * cppfiles.c (open_file): If already read, then don't reopen. + Immediately close an empty file. + +2000-11-01 Bernd Schmidt + + * expr.h (fold_builtin): Move declaration... + * tree.h (fold_builtin): ... here. + +Fri Nov 3 05:41:07 2000 J"orn Rennecke + + * flow.c (verify_local_live_at_start): Allow hard regs to die. + +2000-11-02 Neil Booth + +config: + * a29k/a29k.h, a29k/unix.h, a29k/vx29k.h, + alpha/alpha-interix.h, alpha/alpha.h, alpha/linux.h, + alpha/openbsd.h, alpha/osf.h, alpha/vms.h, alpha/vxworks.h, + alpha/win-nt.h, arc/arc.h, arm/arm.h, arm/conix-elf.h, + arm/linux-aout.h, arm/linux-elf.h, arm/netbsd.h, arm/riscix.h, + arm/riscix1-1.h, arm/semiaof.h, arm/unknown-elf-oabi.h, arm/vxarm.h, + c4x/rtems.h, clipper/clix.h, convex/convex.h, d30v/d30v.h, + elxsi/elxsi.h, fr30/fr30.h, h8300/h8300.h, i370/linux.h, i370/mvs.h, + i370/oe.h, i386/386bsd.h, i386/aix386ng.h, i386/beos-elf.h, + i386/bsd386.h, i386/crtdll.h, i386/cygwin.h, i386/dgux.h, + i386/djgpp-rtems.h, i386/djgpp.h, i386/freebsd-aout.h, i386/freebsd.h, + i386/gnu.h, i386/i386-interix.h, i386/i386.h, i386/linux-aout.h, + i386/linux-oldld.h, i386/linux.h, i386/lynx-ng.h, i386/lynx.h, + i386/mach.h, i386/mingw32.h, i386/moss.h, i386/netbsd.h, + i386/netware.h, i386/next.h, i386/openbsd.h, i386/osf1elf.h, + i386/osfelf.h, i386/osfrose.h, i386/ptx4-i.h, i386/rtems.h, + i386/rtemself.h, i386/sco.h, i386/sco4.h, i386/sco4dbx.h, i386/sco5.h, + i386/scodbx.h, i386/sequent.h, i386/sol2.h, i386/sun.h, i386/sysv3.h, + i386/sysv4.h, i386/uwin.h, i386/vsta.h, i386/vxi386.h, i386/win-nt.h, + i386/win32.h, i860/fx2800.h, i860/i860.h, i860/mach.h, i860/sysv3.h, + i860/sysv4.h, i960/i960.h, i960/rtems.h, i960/vx960-coff.h, + ia64/ia64.h, ia64/linux.h, m32r/m32r.h, m68k/3b1.h, m68k/3b1g.h, + m68k/a-ux.h, m68k/altos3068.h, m68k/amix.h, m68k/apollo68.h, + m68k/crds.h, m68k/ctix.h, m68k/dpx2.h, m68k/hp2bsd.h, m68k/hp320.h, + m68k/hp3bsd.h, m68k/hp3bsd44.h, m68k/isi.h, m68k/linux-aout.h, + m68k/linux.h, m68k/lynx-ng.h, m68k/lynx.h, m68k/m68kemb.h, + m68k/m68kv4.h, m68k/mot3300.h, m68k/netbsd.h, m68k/news.h, + m68k/next.h, m68k/openbsd.h, m68k/pbb.h, m68k/plexus.h, m68k/rtems.h, + m68k/rtemself.h, m68k/sun2.h, m68k/sun3.h, m68k/sun3mach.h, + m68k/tower-as.h, m68k/tower.h, m68k/vxm68k.h, m88k/dgux.h, + m88k/dolph.h, m88k/luna.h, m88k/m88k-aout.h, m88k/m88k-coff.h, + m88k/openbsd.h, m88k/sysv3.h, m88k/sysv4.h, mips/bsd-4.h, + mips/bsd-5.h, mips/dec-bsd.h, mips/dec-osf1.h, mips/gnu.h, + mips/iris3.h, mips/iris5.h, mips/iris6.h, mips/linux.h, mips/mips.h, + mips/netbsd.h, mips/news4.h, mips/news5.h, mips/nws3250v4.h, + mips/openbsd.h, mips/osfrose.h, mips/rtems64.h, mips/sni-svr4.h, + mips/svr3-4.h, mips/svr3-5.h, mips/svr4-4.h, mips/svr4-5.h, + mips/ultrix.h, ns32k/encore.h, ns32k/merlin.h, ns32k/netbsd.h, + ns32k/ns32k.h, ns32k/pc532-mach.h, ns32k/pc532.h, ns32k/sequent.h, + ns32k/tek6000.h, ns32k/tek6100.h, ns32k/tek6200.h, pa/pa-hiux.h, + pa/pa-hpux.h, pa/pa-hpux7.h, pa/pa-linux.h, pa/pa-osf.h, + pa/pa-pro-end.h, pa/pa.h, pa/rtems.h, pj/linux.h, pj/pj.h, + romp/romp.h, rs6000/aix.h, rs6000/aix31.h, rs6000/aix41.h, + rs6000/aix43.h, rs6000/beos.h, rs6000/eabi.h, rs6000/eabisim.h, + rs6000/linux.h, rs6000/lynx.h, rs6000/mach.h, rs6000/rtems.h, + rs6000/sysv4.h, rs6000/vxppc.h, sh/elf.h, sh/linux.h, sh/rtems.h, + sh/rtemself.h, sh/sh.h, sparc/aout.h, sparc/elf.h, sparc/linux-aout.h, + sparc/linux.h, sparc/linux64.h, sparc/lite.h, sparc/litecoff.h, + sparc/liteelf.h, sparc/lynx-ng.h, sparc/lynx.h, sparc/netbsd.h, + sparc/openbsd.h, sparc/pbd.h, sparc/rtems.h, sparc/rtemself.h, + sparc/sol2-sld-64.h, sparc/sol2.h, sparc/sp64-aout.h, + sparc/sp64-elf.h, sparc/sp86x-aout.h, sparc/sp86x-elf.h, + sparc/sparc.h, sparc/sysv4.h, sparc/vxsim.h, sparc/vxsparc.h, + v850/rtems.h, vax/netbsd.h, vax/openbsd.h, vax/ultrix.h, vax/vax.h, + vax/vaxv.h, vax/vms.h, we32k/we32k.h + + Replace -A() with -A=, the new assertion syntax. + +Thu Nov 2 21:52:35 2000 J"orn Rennecke + + * combine.c (distribute_notes): Use rtx_equal_p to check elim_i2 / + elim_i1. + In REG_DEAD handling: When handling parts of multi-hard-reg hard + registers, increment the loop counter by the size of the parts; + use recursion to handle individual parts. + +2000-11-02 Neil Booth + + * configure.in: Make integrated CPP the default. + * configure: Regenerate. + +Thu Nov 2 19:20:12 2000 J"orn Rennecke + + * reload.c (find_equiv_reg): Test all hard registers for membership + in the requested class. + +2000-11-02 Joseph S. Myers + + * collect2.c (main, write_c_file_stat), gcc.c (translate_options, + process_command, main), gcov.c (open_files, output_data), tlink.c + (frob_extension, scan_linker_output), toplev.c + (file_name_nondirectory): Use strchr () and strrchr () instead of + index () and rindex (). + +2000-11-02 Joseph S. Myers + + * c-common.c (get_flag_spec, check_format_info_main, + check_format_types): Use strchr () instead of index (). Compare + against error_mark_node instead of comparing the TREE_CODE against + ERROR_MARK. + +2000-11-02 Zack Weinberg + + Integrated CPP. + + * c-lex.c (init_c_lex): Update cpp_start_read call. + (cb_ident): Update for new callback prototype. + (cb_def_pragma): Update for new cpp_get_token prototype. + (c_lex): Similarly. Use cpp_get_line. + + * c-parse.in (finish_parse): Update for new cpp_finish + prototype. + + * cp/lex.c (finish_parse): Similarly. + +2000-11-01 Geoff Keating + + * machmode.def: Add V16QImode. + +2000-11-01 Richard Henderson + + * dwarf2out.c (loc_descriptor_from_tree): Check for null result + from rtl_for_decl_location. + (add_location_or_const_value_attribute): Likewise. + +2000-11-01 Neil Booth + + * cpplib.c (run_directive): Use correct line number for output + of _Pragma. Remember any in-progress directive. + + * gcc.dg/cpp/vararg2.c, gcc.dg/cpp/_Pragm1.c: New tests. + +2000-11-01 Richard Henderson + + * stmt.c (expand_start_null_loop): Set continue_label. + +2000-11-01 Bernd Schmidt + + * builtins.c (fold_builtin_constant_p, fold_builtin): New functions. + (expand_builtin_constant_p): Move parts of the code into + fold_builtin_constant_p. + (expand_builtin_strlen): Move parts of the code into fold_builtin. + * expr.h (fold_builtin): Declare. + * fold-const.c (fold): Handle builtin calls. + + * c-typeck.c (build_function_call): Call fold on the CALL_EXPR. + +2000-11-01 Richard Henderson + + * stmt.c (expand_start_null_loop): New. + (expand_end_null_loop): New. + * c-semantics.c (genrtl_do_stmt): Use them. + * tree.h: Declare them. + +2000-11-01 Richard Henderson + + * cppmain.c (scan_buffer): Don't avoid paste for assembly. + +2000-11-01 Neil Booth + + * c-parse.in (_yylex): Remove CPP_BACKSLASH case. + * cp/spew.c: Similarly. + * cpplex.c (_cpp_lex_token): Backslashes are now CPP_OTHER. + * cppmacro.c (stringify_arg): Similarly. + * cpplib.h (CPP_BACKSLASH): Delete. + +2000-10-31 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strstr): New function. + (expand_builtin): Handle BUILT_IN_STRSTR and BUILT_IN_STRCHR. + + * builtins.def (BUILT_IN_STRSTR, BUILT_IN_STRCHR): New entries. + + * c-common.c (c_common_nodes_and_builtins): Declare builtin strstr + and builtin strchr. + +2000-10-31 Richard Henderson + + * config/i386/i386.c (fcmov_comparison_operator): Check for + CCFPmode or CCFPUmode instead of CCmode. + (ix86_expand_fp_movcc): Call ix86_expand_setcc for most + unordered operations as well. + +2000-10-31 Richard Henderson + + * c-semantics.c (genrtl_do_stmt): Use integer_zerop instead + of integer_zero_node. + +2000-10-31 Richard Henderson + + * c-semantics.c (genrtl_do_stmt): Special case do/while(0). + +2000-10-31 Nick Clifton + + * config/arm/unknown-elf.h (UNIQUE_SECTION_P): Do not allow + -fdata-sections to override the section attribute of a DECL. + +2000-10-31 Chris Demetriou + + * libgcc2.c (__shtab): Remove __shtab variable. + * libgcc-std.ver (GCC_3.0): Remove __shtab from symbol list. + * Makefile.in (LIB2FUNCS): Remove _shtab from list of library + members. + +2000-10-31 Jim Wilson + + * defaults.h (ASM_OUTPUT_DEBUG_LABEL): New. + * tm.texi (ASM_OUTPUT_DEBUG_LABEL): Document. + * dwarf2out.c (dwarf2out_begin_block): Use ASM_OUTPUT_DEBUG_LABEL + instead of ASM_OUTPUT_INTERNAL_LABEL. + (dwarf2out_end_block, dwarf2out_label): Likewise. + * final.c (final_scan_insn, case NOTE_INSN_DELETED_LABEL): Likewise + * config/ia64/ia64.h (ASM_OUTPUT_DEBUG_LABEL): Define. + +2000-10-31 Richard Henderson + + * dwarf2out.c (struct dw_loc_descr_struct): Add dw_loc_addr. + (size_of_locs): Set it. + (output_loc_operands): Use it to compute branch displacement. + (int_loc_descriptor): New. + (mem_loc_descriptor): Dereference memory in the proper size. + Use DW_OP_plus_uconst when possible. Use int_loc_descriptor. + (loc_descriptor_from_tree): New. + (rtl_for_decl_location): Break out from ... + (add_location_or_const_value_attribute): ... here. + (add_bound_info): Use loc_descriptor_from_tree. + +2000-10-31 Neil Booth + + * cpp.texi: Update for new command line assertion syntax. + * cpplib.c (cpp_define): Simplify a bit. + (cpp_assert, cpp_unassert): Use handle_assertion. + (handle_assertion): New function; accept new command line + syntax with '='. + * testsuite/gcc.dg/cpp/assert3.c: New tests. + +2000-10-31 Neil Booth + + * cppmacro.c (STDC_0_IN_SYSTEM_HEADERS): Define to 0 if + undefined. Remove #ifdef check. + * config/i386/sol2.h, config/rs6000/sol2.h, config/sparc/sol2.h: + Define STDC_0_IN_SYSTEM_HEADERS to 1. + +2000-10-31 Jan Hubicka + Jakub Jelinek + + * config/i386/i386.h: Clarify CCNOmode description in comment. + (EXTRA_CC_MODES): Remove CCRCmode. + * config/i386/i386.c (ix86_comparison_operator): Remove CCRCmode. + (put_condition_code, ix86_match_ccmode): Likewise. + (ix86_cc_mode): Likewise. Fix comment. + (ix86_expand_strlensi_unroll_1): *rc patterns are gone. + * config/i386/i386.md: Add unspec 12 description. + (adddi3 split): Use unspec 12 instead of CCRCmode. + (addsi3_carry_rc): Remove. + (addsi3_cc, addqi3_cc): New patterns. + (addsi_3): Swap operands, match CCZmode. + (addsi_4): Rewritten. + (addsi_5): Renamed from addsi_6. + (addsi_6): Removed. + (addhi_3): Swap operands, match CCZmode. + (addhi_4): Rewritten. + (addhi_5): Renamed from addhi_6. + (addhi_6): Removed. + (addqi_3): Swap operands, match CCZmode. + (addqi_4): Rewritten. + (addqi_5): Renamed from addqi_6. Use =q constraint for clobber. + (subsi3_carry_rc): Removed. + (iorqi_3): Use =q constraint for clobber. + (xorqi_cc_2): Likewise. + (negdi2_1 split): Don't use CCRCmode, use ltu instead of gtu. + (x86_movsicc_0_m1_rc): Removed. + (cmp?i peepholes): Remove neg. Use CCGCmode instead of CCRCmode. + +2000-10-31 Joseph S. Myers + + * c-typeck.c (build_unary_op): If pedantic, pedwarn for increment + and decrement of complex types. + +2000-10-31 Kaveh R. Ghazi + + * builtins.c (expand_builtin_fputs): When deleting NOP calls to + builtin fputs, ensure we still evaluate the stream in case it + has side-effects. + +2000-10-31 Jakub Jelinek + + * expr.c (do_store_flag): Pass operand_mode instead of GET_MODE (op0) + to expand_shift. + +Tue Oct 31 15:33:27 2000 J"orn Rennecke + + * sh-protos.h (reg_no_subreg_operand, emit_fpscr_use): Don't declare. + (fp_extended_operand, emit_fpscr_use): Likewise. + * sh.c (reg_no_subreg_operand, fp_extended_operand): Delete functions. + (fpul_operand): New function. + * sh.h (PREDICATE_CODES): Remove reg_no_subreg_operand and + fp_extended_operand. Add fpul_operand. + * sh.md (mulsf3, mulsf3_i4): Use fp_arith_reg_operand for "f" operands. + (mulsf3_ie, macsf3, cmpgtsf_t, cmpeqsf_t, ieee_ccmpeqsf_t): Likewise. + (cmpgtsf_t_i4, cmpeqsf_t_i4, ieee_ccmpeqsf_t_4, negsf2): Likewise. + (negsf2_i, sqrtsf2, sqrtsf2_i, abssf2, abssf2_i, adddf3): Likewise. + (adddf3_i, subdf3, subdf3_i, muldf3, muldf3_i, divdf3): Likewise. + (divdf3_i): Likewise. + (floatsisf2): Likewise. Use fpul_operand for 'y' operand. + (floatsisf2_i4, floatsisf2_ie, fix_truncsfsi2): Likewise. + (fix_truncsfsi2_i4, fixsfsi, floatsidf2, floatsidf2_i): Likewise. + (fix_truncdfsi2, fix_truncdfsi2_i, extendsfdf2): Likewise. + (extendsfdf2_i4, truncdfsf2, truncdfsf2_i4): Likewise. + +2000-10-31 Bernd Schmidt + + * config/i386/i386.c (ix86_init_builtins): Correct return type + building v4hi_ftype_v4hi_int_int tree node. + (ix86_expand_builtin): Use correct operand numbers 0 and 1. + Copy operand 0 into a Pmode register, don't generate a MEM rtx. + + * config/i386/i386.md (sse_movntdi): Use mmx register constraint + for operand 1. + (mmx__uavgv8qi3): Correct insn mnemonic. + (mmx_psadbw): Correct insn mnemonic. Use V8QI mode for operands 1 and 2. + (mmx_punpckhwd): Correct insn mnemonic. + (mmx_punpckhdq): Likewise. + (mmx_punpcklwd): Likewise. + (mmx_punpckldq): Likewise. + (prefetch): Use immediare_operand and 'n' constraint for operand 1. + Renumber case labels to match the _mm_prefetch constants defined in + xmmintrin.h. + + * recog.c (split_all_insns): Don't try to call cleanup_subreg_operands + if the splitter didn't emit new insns. + Make sure we call cleanup_subreg_operands even when splitting the last + insn in a basic block. + + * invoke.texi (Debugging Options): Describe -do. + * toplev.c (enum_dump_file_index): New entry DFI_postreload. + (dump_file): Likewise. + (rest_of_compilation): Split .greg dump into .greg and .postreload. + +2000-10-30 Neil Booth + + * cppfiles.c (stack_include_file): Check for stacked contexts + here. + * cpphash.h (_cpp_do__Pragma): New prototype. + * cppinit.c (cpp_reader_init): Add _Pragma keyword to hash table. + + * cpplex.c (skip_escaped_newlines): Only process trigraphs and + escaped newlines if !(buffer->from_stage3). + (_cpp_lex_token): Warn about missing newlines iff + !buffer->from_stage3. + + * cpplib.c (get__Pragma_string, destringize, + _cpp_do__Pragma): New functions. + (run_directive): Set output_line for _Pragma to avoid line + markers in output. Set from_stage3 and prevent macro expansion + for _Pragma and command-line options. Check buffer exhaustion. + (cpp_push_buffer): Don't check for stacked macro contexts, as + this is perfectly legitimate for _Pragma. Move the check to + stack_include_file instead. Set from_stage3 iff buffer is + preprocessed input. + + * cpplib.h (struct cpp_buffer): Make warned_cplusplus_comments + unsigned. New boolean from_stage3. + (struct spec_nodes): Add n__Pragma. + + * cppmacro.c (enter_macro_context): Flip sense of return value. + (_cpp_get_token): Handle _Pragma operator. + +2000-10-30 Phil Edwards + + * gcc.texi: The C++ standard isn't "draft" anymore. + +2000-10-30 Mark Mitchell + + * cppmacro.c (builtin_macro): Use NT_VOID, not T_VOID. + +2000-10-29 Neil Booth + + * cpplib.c (skip_rest_of_line): Use _cpp_get_token. + +2000-10-29 Joseph S. Myers + + * toplev.c, flags.h, fold-const.c, real.c, rtl.c, + fixinc/inclhack.def: Change comments mentioning C9X to refer to + C99 instead. + + * invoke.texi: Document that -V will only work for very similar + versions of driver and compiler. + +2000-10-29 Neil Booth + + * cppmacro.c (_cpp_create_definition): Optimize the case of + a macro defined to itself. + +2000-10-29 Neil Booth + + * cpplex.c (save_comment): Don't store new lines in C++ comments. + +2000-10-29 Michael Hayes + + * integrate.c (copy_insn_list): Copy the unchanging flag for calls. + +2000-10-28 Geoffrey Keating + + * cpphash.c (cpp_forall_identifiers): Add context variable + for callback routine. + * cppmain.c (dump_macro): Update to match cpp_forall_identifiers + change. + (main): Call cpp_forall_identifiers with null context. + * cpplib.h (cpp_forall_identifiers): Update prototype. + + * cppmain.c: Make `parse_in' and `print' static. + +2000-10-28 Alan Modra + + * c-decl.c (finish_function): Clear c_function_name_declared_p. + +2000-10-28 Richard Henderson + + * regrename.c (scan_rtx_address): Frob action, not class, + when trying to disable optimization. + +2000-10-28 Mark Mitchell + + * c-semantics.c (make_rtl_for_local_static): Don't clobber + DECL_ASSEMBLER_NAME. + +2000-10-28 Joseph S. Myers + + * configure.in: Determine and substitute gcc_version_full. + * configure: Regenerate. + * gccbug.in: Use it to give full version. Don't allow + confidential PRs. + +2000-10-28 Richard Henderson + + * recog.c (split_all_insns): Run cleanup_subreg_operands + after reload. + + * regrename.c (regrename_optimize): Verify that all registers of + a multiple register mode are available. + (scan_rtx_address): Accept the mode of the address; all callers + changed. + + * cpplib.c (run_directive): Fix prototype. + +2000-10-28 Bernd Schmidt + + * reload.c (find_reloads): Distinguish "wins" so that we know whether + a given operand won because of a matching constraint or not; then use + that information to compute goal_alternative_matched properly. + * reload1.c (choose_reload_regs): Never set reload_override_in for an + optional reload. + + * config/ia64/ia64.h (RTX_COSTS): A few more entries, and a more + accurate value for MULT. + * config/ia64/ia64.c (ia64_print_operand): Require probability to be + 2% or > 98% before using static branch prediction bits. + +2000-10-28 Neil Booth + + New macro expander. + + * cpplib.c (struct answer): New. + (struct if_stack): Use cpp_lexer_pos rather than line and col. + Rename cmacro mi_cmacro. + (struct directive, KANDR, STDC89, EXTENSION, COND, IF_COND, INCL, + IN_I): New directive and flags. + (skip_rest_of_line, check_eol, run_directive, glue_header_name, + parse_answer, parse_assertion, find_answer): New functions. + (parse_ifdef, detect_if_not_defined, validate_else): Remove. + (lex_macro_node): New function to replace parse_ifdef and + get_define_node. + + (_cpp_handle_directive): New function, combines _cpp_check_directive + and _cpp_check_linemarker. + + (do_define, do_undef, parse_include, do_include, do_import, + do_include_next, read_line_number, do_line, do_ident, do_pragma, + do_pragma_once, do_pragma_poison, do_pragma_dependency): + Update for new token getting interface. + + (do_ifdef, do_ifndef, do_if, do_else, do_endif, push_conditional) + : Update for new multiple-include optimisation technique. + (do_elif): Don't forget to invalidate controlling macros. + + (unwind_if_stack, cpp_defined, cpp_push_buffer, cpp_pop_buffer): Update. + (parse_assertion, parse_answer, find_answer, _cpp_test_assertion): + Functions to handle assertions with the new token interface. + (do_assert, do_unassert): Use them. + + (cpp_define, _cpp_define_builtin, cpp_undef, cpp_assert, cpp_unassert): + Use run_directive. + + (_cpp_init_stacks): Register directive names. Don't register special + nodes. + + * cpperror.c (print_containing_files, _cpp_begin_message): Update to + new position recording regime. + (cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning, + cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, + cpp_pedwarn_with_file_and_line): Update for _cpp_begin_message changes. + (cpp_type2name): Move to cpplex.c. + + * cppexp.c (parse_charconst): spec_nodes is no longer a pointer. + (parse_defined): Update to handle new multiple include optimisation + method. Remove poisoned identifier warning. + (parse_assertion, TYPE_NAME): Delete. + (lex): Update for multiple include optimisation, removal of + CPP_DEFINED, to use _cpp_test_assertion for assertions and + cpp_token_as_text. + (_cpp_parse_expr): Update for MI optimisation, and to use op_as_text. + (op_as_text): New function, to wrap cpp_token_as_text. + + * cppfiles.c (stack_include_file, _cpp_pop_file_buffer): + Update for MI optimisation. + (_cpp_execute_include): Take a token rather than 3 arguments. Fix + segfault on diagnostic. + (_cpp_compare_file_date): Take a token rather than 3 args. + (cpp_read_file): Work correctly for zero-length files. + + * cpphash.c (_cpp_init_macros, _cpp_cleanup_macros): Rename + _cpp_init_hashtable and _cpp_cleanup_hashtable. + (cpp_lookup): Place identifiers at front of identifier pool + for _cpp_lookup_with_hash. + (_cpp_lookup_with_hash): Require identifiers to be at the front of + the identifier pool. Commit the memory if not already in the + hash table. + + * cppinit.c (cpp_reader_init): Move cpp_init_completed test to top. + Initialize various members of cpp_reader, memory pools, and the + special nodes. + (cpp_printer_init): Delete. + (cpp_cleanup): Update. + (struct builtin, builtin_array, initialize_builtins): Update for new + hashnode definition and builtin handling. + (cpp_start_read, cpp_finish): Don't take or initialize a + printer. Update. + + * cpplib.h (cpp_printer, cpp_toklist, CPP_DEFINED, BOL, + PASTED, VAR_ARGS, BEG_OF_FILE, IN_DIRECTIVE, KNOWN_DIRECTIVE, + T_VOID, T_SPECLINE, T_DATE, T_FILE, T_BASE_FILE, T_INCLUDE_LEVEL, + T_TIME, T_STDC, T_OPERATOR, T_POISON, T_MACRO, T_ASSERTION): Delete. + (struct cpp_pool, struct cpp_macro, struct cpp_lexer_pos, + struct cpp_lookahead, CPP_DHASH, enum mi_state, enum mi_ind, + NO_EXPAND, VARARGS_FIRST, struct cpp_token_with_pos, + struct toklist, struct cpp_context, struct specnodes, + TOKEN_LOOKAHEAD, TOKEN_BUFFSIZE, NODE_OPERATOR, NODE_POISONED, + NODE_BUILTIN, NODE_DIAGNOSTIC, NT_VOID, NT_MACRO, NT_ASSERTION, + enum builtin_type, cpp_can_paste): New. + (struct cpp_token): Delete line and col members. + (struct cpp_buffer): New member output_lineno. + (struct lexer_state): Delete indented, in_lex_line, seen_dot. + Add va_args_ok, poisoned_ok, prevent_expansion, parsing_args. + (struct cpp_reader): New members lexer_pos, macro_pos, directive_pos, + ident_pool, temp_string_pool, macro_pool, argument_pool, string_pool, + base_context, context, directive, mi_state, mi_if_not_defined, + mi_lexed, mi_cmacro, mi_ind_cmacro, la_read, la_write, la_unused, + mlstring_pos, macro_buffer, macro_buffer_len. + Delete members mls_line, mls_column, token_list, potential_control_macro, + temp_tokens, temp_cap, temp_alloced, temp_used, first_directive_token, + context_cap, cur_context, no_expand_level, paste_level, contexts, args, + save_parameter_spellings, need_newline, . + Change type of date, time and spec_nodes members. + Change prototypes for include and ident callbacks. + (struct cpp_hashnode): Change type of name. Remove union members + expansion and code. Add members macro, operator and builtin. + + (cpp_token_len, cpp_token_as_text, cpp_spell_token, cpp_start_read, + cpp_finish, cpp_avoid_paste, cpp_get_token, cpp_get_line, + cpp_get_output_line, cpp_macro_definition, cpp_start_lookahead, + cpp_stop_lookahead): New prototypes. + (cpp_printer_init, cpp_dump_definition): Delete prototypes. + + (U_CHAR, U, ustrcmp, ustrncmp, ustrlen, uxstrdup, ustrchr, ufputs): + Move from cpphash.h. + + * cpphash.h (U_CHAR, U, ustrcmp, ustrncmp, ustrlen, uxstrdup, ustrchr, + ufputs): Move to cpplib.h. + (enum spell_type, struct token_spelling, _cpp_token_spellings, TOKEN_SPELL, + TOKEN_NAME, struct answer, FREE_ANSWER, KANDR, STDC89, EXTENSION, + COND, EXPAND, INCL, COMMENTS, IN_I, struct directive, directive_handler, + struct spec_nodes, _cpp_digraph_spellings, _cpp_free_temp_tokens, + _cpp_init_input_buffer, _cpp_grow_token_buffer, _cpp_init_toklist, + _cpp_clear_toklist, _cpp_expand_token_space, _cpp_expand_name_space, + _cpp_equiv_tokens, _cpp_equiv_toklists, _cpp_process_directive, + _cpp_run_directive, _cpp_get_line, _cpp_get_raw_token, _cpp_glue_header_name, + _cpp_can_paste, _cpp_check_directive, _cpp_check_linemarker, + _cpp_parse_assertion, _cpp_find_answer): Delete. + (VALID_SIGN, ALIGN, POOL_FRONT, POOL_LIMIT, POOL_BASE, POOL_SIZE, + POOL_USED, POOL_COMMIT, struct cpp_chunk, _cpp_lex_token, _cpp_init_pool, + _cpp_free_pool, _cpp_pool_reserve, _cpp_pool_alloc, _cpp_next_chunk, + _cpp_lock_pool, _cpp_unlock_pool, _cpp_test_assertion, + _cpp_handle_directive, DSC): New. + (struct include_file): New member defined. + + (DO_NOT_REREAD, _cpp_begin_message, _cpp_execute_include, + _cpp_compare_file_date): Update. + (_cpp_pop_context, _cpp_get_token, _cpp_free_lookaheads, _cpp_push_token): New. + (_cpp_init_macros, _cpp_cleanup_macros): Rename to _cpp_init_hashtable, + _cpp_cleanup_hashtable. + + * Makefile.in: Remove cppoutput.c. + + * cppoutput.c: Delete + + * fixheader.c (read_scan_file): Update for new cpp_get_token + prototype. + (recognized_function): New argument LINE. + + * scan-decls.c (skip_to_closing_brace, scan_decls): Update for + new cpp_get_token prototype. + + * scan.h (recognized_function): Update prototype. + + * po/POTFILES.in: Remove cppoutput.c. + +2000-10-27 Mark Mitchell + + * c-typeck.c (check_init_type_bitfields): Remove. + (constructor_incremental): Likewise. + (struct constructor_stack): Remove incremental bit. + (struct initializer_stack): Likewise. + (start_init): Don't play with constructor_incremental. + (finish_init): Likewise. + (really_start_incremental_init): Likewise. + (push_init_level): Likewise. + (pop_init_level): Likewise. + (output_init_level): Likewise. + (output_pending_init_elements): Likewise. + +2000-10-21 Mike Coleman + + * c-pragma.c (handle_pragma_pack): Initialize align to -1. + Improve error messages. Correct parsing of + #pragma pack(pop [,id]). Do not check the user-supplied + alignment if we're popping. + + * gcc.dg/pack-test-1.c: New test case. + * gcc.dg/pack-test-2.c: New test case. + * gcc.dg/pack-test-1.h: New file. + +2000-10-27 Neil Booth + + * cpp.texi: Update. + +2000-10-27 Kelley Cook + + * invoke.texi: Document -mintel-syntax + +2000-10-27 Richard Henderson + + * invoke.texi: Document -frename-registers. Add it to -O3. + * toplev.c (rest_of_compilation): Run regrename before ifcvt2. + (enum dump_file_index, dump_file): Update order. + (main): Set flag_rename_registers at -O3. + +2000-10-27 Richard Henderson + + * config/alpha/alpha.h (enum reg_class): Add PV_REG. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS): Update. + (REG_CLASS_FROM_LETTER): Assign it to 'c'. + * config/alpha/alpha.md (call_osf_1): Use it. + (call_value_osf_1): Likewise. + + * config/ia64/ia64.c: Revert 10-23 patch. + (ia64_hard_regno_rename_ok): New. + * config/ia64/ia64-protos.h: Declare it. + * config/ia64/ia64.h (HARD_REGNO_RENAME_OK): Use it. + +2000-10-27 Bernd Schmidt + Richard Henderson + + * regrename.c: Rewrite to handle multi-register modes and + cond_exec instructions. + * Makefile.in (regrename.o): Update dependencies. + * recog.h (struct operand_alternative): Add is_address. + * recog.c (preprocess_constraints) [case 'p']: Set it. + +2000-10-27 Zack Weinberg + + * configure.in: If not NO_MINUS_C_MINUS_O, substitute + OUTPUT_OPTION with '-o $@'. Make zlibdir, zlibinc relative to + top level. Kill oldstyle_subdirs. Do not include + $srcdir/$s/Makefile.in in all_lang_makefiles, but do include + $outputs. Do not run configure.lang from config.status. + Rearrange warning-flag logic to correspond to what the + makefile wants. Put special vax stage1 options in + @stage1_flags@ not @stage1_warn_cflags@. Don't do anything + with extra_c_objs, extra_cxx_objs, or extra_cpp_objs. + (--enable-c-cpplib): AC_SUBST(maybe_cpplib) with "libcpp.a" if + switch is given, nothing otherwise. + * configure.lang: Delete. + + * Makefile.in: Expunge all traces of extra_c_objs, + extra_cxx_objs, and extra_cpp_objs. Set MAYBE_CPPLIB from + @maybe_cpplib@. Add $(MAYBE_CPPLIB) to C_AND_OBJC_OBJS. Set + warning options via a three level scheme so that -pedantic and + -Wtraditional are not used for non-C front ends: LOOSE_WARN, + STRICT1_WARN, STRICT2_WARN -> $(@D)-warn, GCC_WARN_CFLAGS -> + WARN_CFLAGS. Distinguish STAGE1_CFLAGS from BOOT_CFLAGS. + Add -I$(@D) and -I$(srcdir)/$(@D) to INCLUDES. + Set OUTPUT_OPTION, ZLIB, ZLIBINC. Do not set P, + LANG_FLAGS_TO_PASS. Add OUTPUT_OPTION to all object-file + generation rules. Wrap all rules that change the current + directory in parentheses; pmake doesn't spawn a new shell for + each command. Expunge all references to $(P). When one + command depends on another and they're run all at once, use && + to separate them, not ;. Add libgcc_s$(SHLIB_EXT) to files + deleted on make clean. Force OUTPUT_OPTION='-o $@' in stage2 + and beyond. + + * objc/Make-lang.in: Wrap all rules that change the current + directory in parentheses. Expunge all references to $(P). + When one command depends on another and they're run all at + once, use && to separate them, not ;. Add OUTPUT_OPTION to + all object-file generation rules. Delete obsolete variables. + * objc/Makefile.in: Delete. + +2000-10-27 Jakub Jelinek + + * calls.c (expand_call): If sibcall_failure is set during pass 1, + clear tail_call_insns as well. + +2000-10-27 Nick Clifton + + * config/arm/arm-protos.h (arm_function_ok_for_sibcall): Add + prototype. + +2000-10-26 Richard Henderson + + * calls.c (expand_call): Supress sibcall if we have a + BLKmode return in registers. + +2000-10-26 Bernd Schmidt + + * ia64.h (PREFERRED_RELOAD_CLASS): Force floating point constants + into memory. + +2000-10-26 Nathan Sidwell + + * tree.c (make_node, case 't'): Set alignment to that of + char_type_node. + * expr.c (move_by_pieces_ninsns): Abort if some length remains. + +2000-10-25 Mark Mitchell + + * Makefile.in (site.exp): Define HAVE_LIBSTDCXX_V3. + * configure.in (enable-libstdcxx-v3): Arrange to have + HAVE_LIBSTDCXX_V3 substituted into the output files. + +2000-10-25 Richard Henderson + + * recog.c (constrain_operands): Initialize which_alternative + before no alternatives early exit. + + * cse.c (find_comparison_args): Check that we can reverse a + comparison if needed before accepting the substitution. + + * reload.c (find_reloads_address_part): Kill rtx obstack hackery. + + * simplify-rtx.c (simplify_relational_operation): Sign extend + low words before sign extending to high words. + +2000-10-25 Nick Clifton + + * config/mcore/mcore.c: Include config.h before system.h. + +2000-10-25 Ray Essick + + * config/mcore/mcore.md (return): Force function epilogue to + always be generated to work around epilogue suppression bug in + M*Core backend. + +2000-10-25 Joseph S. Myers + + * c-decl.c (grokdeclarator): Move warning for qualified void + return types with -pedantic to when the function type is + constructed. At -W, warn in general for qualified function return + types, except for volatile void. + * invoke.texi: Document this new warning at -W. + +2000-10-25 Neil Booth + + * cpp.texi: Update with implementation-defined behavior and + internal limits. + +2000-10-25 Jakub Jelinek + + * stor-layout.c (layout_type): If TYPE_ALIAS_SET was already set on the + incomplete type force it into alias set 0. + +Wed Oct 25 01:02:44 EDT 2000 John Wehle (john@feith.com) + + * alias.c: Include basic-block.h. + (loop_p): New function. + (mark_constant_function): Use it. + * Makefile.in (alias.o): Update dependencies. + +2000-10-24 Aldy Hernandez + + * config/mn10300/mn10300.c (secondary_reload_class): Treat pseudos + like memory. + +2000-10-24 Jim Wilson + + * expmed.c (store_bit_field): Move integer pun code down after + code that calls emit_move_insn for entire register move. + * stor-layout.c (compute_record_mode): Revert Mar 25, Aug 18, and + Oct 20 changes. Only store mode in TYPE_MODE if RECORD_TYPE. + +2000-10-24 Richard Henderson + + * rtlanal.c (rtx_unstable_p, rtx_varies_p): Don't consider pic + register stable if PIC_OFFSET_TABLE_REG_CALL_CLOBBERED. + +2000-10-24 Aldy Hernandez + + * gcse.c (cprop_insn): do not propagate constants into jump_insn + for machines with CC0 more than once. + +2000-10-24 Richard Henderson , Aldy + + * config/mn10300/mn10300.h (PREFERRED_RELOAD_CLASS): Treat + pseudos just like memory. + +2000-10-24 Alexandre Oliva + + * combine.c (distribute_notes): Discard REG_LIBCALL and REG_RETVAL + when deleting libcall sequence collapsed to a single instruction. + +2000-10-24 Andrew Haley + + * expr.c (do_store_flag): Don't crash if either side of a + comparison is error_mark_node. + +2000-10-24 Jakub Jelinek + + * sibcall.c (purge_mem_unchanging_flag): New function. + (optimize_sibling_and_tail_recursive_calls): Call it. + +2000-10-24 Philipp Thomas + + * Makefile.in (check-po): New target for doing checks in the po + subdir if all languages configured. + (CHECK_TARGETS): Add @CHECK_PO@, replaced with check-po via + configure if NLS is enabled. + * configure.in: If NLS is enabled, substitute CHECK_PO by check-po, + otherwise leave empty. + * configure: Regenerate. + +2000-10-23 Diego Novillo + + * i386.c (print_operand): Handle new 'A' formatting code. + 387 opcodes need suffixes even with -mintel-syntax. + Check for explicit size override (codes 'b', 'w' and 'k'). + (print_operand_address): Check if register prefix is needed when + emitting `ds' segment override. + * i386.h: Add comment about new 'A' formatting code. + * i386.md (jump and call patterns): Emit absolute references using %A. + +2000-10-23 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_prologue): Mark extra + output registers as fixed. + (ia64_function_epilogue): Undo output fixation. + +2000-10-23 Richard Henderson + + * config/alpha/alpha.md: Add names for all unnamed insns; use + define_insn_and_split in some obvious places. + (lda): Remove. + (zero_extendqihi2): Use an expander w/ nonimmediate_operand for BWX. + (zero_extendqisi2, zero_extendqidi2): Likewise. + (zero_extendhisi2, zero_extendhidi2): Likewise. + (abs splitters): Fix match_scratch operand number. + (bcc_reverse): Swap pc & label instead of non-canonical compare. + +2000-10-23 Jim Wilson + + * ia64.c (ia64_print_operand, case 'r'): Correct comment. Handle + CONST_INT. + * ia64.md (cmpsi_adjusted): Use %r3. + (cmpdi_adjusted): Likewise. + +2000-10-23 Diego Novillo + + * config/i386/att.h (ASM_FILE_START): Define. + +2000-10-23 Diego Novillo + + * config/i386/linux.h (ASM_FILE_START): Define. + +Wed Oct 18 11:16:40 2000 Donald Lindsay + + * gcc/configure.in: m68k-coff tm_file should not have libgloss.h, + since this (only) drags in a crt0.o reference that the .ld files + also introduce. + +2000-10-23 Geoff Keating + + * reload1.c (reload_reg_reaches_end_p): A RELOAD_OTHER can + overwrite the value in a RELOAD_FOR_INPUT and other kinds of + reloads just like an RELOAD_FOR_OUTPUT would. + + * local-alloc.c (update_equiv_regs): Add an abort(). When + deleting or moving insns, update reg_equiv[regno].init_insns. + +2000-10-23 Mark Mitchell + + * c-tree.texi: Improve documentation for IF_STMTs and related + conditional statements. + +2000-10-22 Mark Mitchell + + * expr.c (do_preexpand_calls): Remove. + (same_from_p): Don't use CALL_EXPR_RTL. + (expand_expr): Don't call preexpand_calls, or use CALL_EXPR_RTL. + (preexpand_calls): Remove. + * tree.c (first_rtl_op): Remove CALL_EXPR case. + (unsave_expr_1): Likewise. + * tree.def (CALL_EXPR): Give it only two slots. + * tree.h (CALL_EXPR_RTL): Remove. + +2000-10-21 Chandrakala Chavva + + * libgcc-std.ver (__addvsi3, __addvdi3, __subvsi3, __subvdi3, + __mulvsi3, __negvsi2, __negvdi2, __absvsi2, __absvdi2, __mulvdi3): + New functions. + +2000-10-22 Alexandre Oliva + + * calls.c (combine_pending_stack_adjustment_and_call): Don't + adjust stack when unadjusted_alignment ends up as zero. + +2000-10-22 Joseph S. Myers + + * fixinc/genfixes: Remove EGCS reference. + * install.texi: Remove EGCS reference. + * INSTALL: Regenerate. + +2000-10-22 Mark Mitchell + + * tree.h (TYPE_IS_SIZETYPE): Add more documentation. + +2000-10-21 Joseph S. Myers + + * diagnostic.c: Remove EGCS reference in comment. + +Sat Oct 21 08:24:25 2000 Richard Kenner + + * loop.c (strength_reduce): Fix error in last change. + +2000-10-20 David Edelsohn + + * Makefile.in (SHLIB_NM_FLAGS): New. + (libgcc.mk): Pass it. + * mklibgcc.in (libgcc.map): Use it. + + * rs6000/t-aix43 (SHLIB_EXT, SHLIB_LINK, SHLIB_LIBS, + SHLIB_MKMAP, SHLIB_MAPFILES, SHLIB_NM_FLAGS): New. + +2000-10-20 Kaveh R. Ghazi + + * mips.h (REG_CLASS_FROM_LETTER): Cast array arg to unsigned char. + + * sparc.c (load_pic_register): Delete unused varaible. + + * libgcc2.c (__addvsi3): Delete unused variable. + + * libgcc2.h (__absvsi2, __absvdi2, __addvsi3, __addvdi3, + __subvsi3, __subvdi3, __mulvsi3, __mulvdi3, __negvsi2, + __negvdi2): Prototype. + + * ssa.c (apply_delayed_renames): Avoid undefined operation. + + * toplev.c (display_target_options): Make static to match + prototype. Delete empty declaration. + +2000-10-20 Tom Tromey + + * cppspec.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Added -MF and -MT. + * gcc.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Added -MF and -MT. + +Fri Oct 20 17:05:49 2000 Richard Kenner + + * expr.c (expand_expr, case SAVE_EXPR): Set RTX_UNCHANGING_P on + returned MEM. + (expand_expr_unaligned, case ARRAY_REF): Check that index is + a constant before comparing it; use tree_low_cst. + * tree.c (save_expr): Set TREE_READONLY. + (substitute_expr): Return inside of NON_LVALUE_EXPR. + (build, build1): Set TREE_READONLY if all operands are. + (build_index_type): If upper bound is a negative number, lower + bound is zero and sizetype is unsigned, use upper bound of one and + lower of zero. + +2000-10-20 David Edelsohn + + * gcc.c (process_command, main): Use "because" instead of + "since" in error messages. + +Fri Oct 20 13:33:16 2000 Richard Kenner + + * stor-layout.c (compute_record_mode): Use tree_low_cst. + Don't use mode of field for record unless sizes are the same. + (layout_type, case ARRAY_TYPE): Remove special bounds handling + previously added for Ada; also change to using host_integerp + and tree_low_cst. + + * loop.c (strength_reduce): Show when new register made for + giv is known to be a pointer and its aligment if so and known. + (loop_dump_aux): Show VERBOSE parameter unused. + + * gcse.c (set_hash_table_size): Now unsigned. + * sdbout.c (template_name_p): Add "const" to avoid warnings. + (sdbout_record_type_name, plain_type_1, sdbout_symbol): Likewise. + (sdbout_one_type, sdbout_parms, sdbout_reg_parms): Likewise. + (sdbout_end_epilogue): Remove variable NAME. + * system.h (getopt): Add default definition. + * config/alpha/alpha.c (print_operand): Don't continue processing + after issuing error. + (summarize_insn): Avoid use of UL in constant. + + * function.c (locate_and_pad_parm): Use host_integerp and tree_low_cst. + + * fold-const.c (force_fit_type): Unsigned values can overflow + if they are sizetype. + (int_const_binop): Don't use cache if overflows. + +2000-10-20 Richard Henderson + + * function.c (locate_and_pad_parm): Zero alignment_pad. + + * regrename.c (rr_replace_reg): Rewrite to use recog_data to + perform substitutions, and apply_change_group to see if it worked. + +Fri Oct 20 13:33:16 2000 Richard Kenner + + * dwarf2out.c (add_bound_info): Also ignore COND_EXPR. + + * combine.c (struct undo): Change int to unsigned int. + (do_SUBST_INT): Args are unsigned int. + (make_extraction, force_to_mode): Use proper type when forming mask. + (make_field_assignment): Likewise. + +2000-10-20 Joseph S. Myers + + * c-common.c (check_format_info_recurse): Extract string constant + initializers from non-volatile constant arrays and check them as + formats. + * c-typeck.c (decl_constant_value): Don't check pedantic or check + for DECL_MODE (decl) != BLKmode. + (decl_constant_value_for_broken_optimization): New function which + includes these checks. + (default_conversion, convert_for_assignment, digest_init): Use + decl_constant_value_for_broken_optimization instead of + decl_constant_value. + +2000-10-20 Mark Mitchell + + * tree.h (DECL_ALIGN_UNIT): New macro. + +2000-10-14 Marek Michalkiewicz + + * config/avr/avr-protos.h (avr_output_bld): New. + (out_shift_with_cnt): Add t_len argument. + * config/avr/avr.c (avr_num_arg_regs): Remove -mpack-args. + (output_movqi, output_movhi, output_movsisf): Optimize loading + any constant with exactly one bit set to NO_LD_REGS. + (out_shift_with_cnt): Optimize output code for size or speed, + depending on optimize_size. Handle small shift counts as well + (if not hand-optimized in ?sh??i3_out). Shifts can be done + with or without a scratch register, with help of __tmp_reg__ + or __zero_reg__ if necessary. Add T_LEN argument to pass the + length of TEMPLATE in words, return total insn length in *LEN. + (ashlqi3_out, ashrqi3_out, lshrqi3_out): Change all calls to + out_shift_with_cnt to work with the above change. + (ashlhi3_out, ashlsi3_out, ashrhi3_out, ashrsi3_out, lshrhi3_out, + lshrsi3_out): Likewise. Optimize more known shift count cases. + Remove cases already well optimized in out_shift_with_cnt. + (avr_output_bld): New function. + * config/avr/avr.h (MASK_PACK_ARGS, TARGET_PACK_ARGS): Remove. + (TARGET_SWITCHES): Remove -mpack-args backward compatibility. + * config/avr/avr.md (*reload_inqi, *reload_inhi, *reload_insi): + Add reload_completed to insn condition - only for peepholes. + (ashlqi3, ashrqi3, lshrqi3): Correct insn length for shift counts + in a register or memory. + (ashlhi3, ashlsi3, ashrhi3, ashrsi3, lshrhi3, lshrsi3): Likewise. + Do not require a scratch register. + (*ashlhi3_const, *ashlsi3_const, *ashrhi3_const, *ashrsi3_const, + *lshrhi3_const, *lshrsi3_const): New insns and matching peepholes. + Optimize shifts by known count using a scratch register, but only + if one is still available after register allocation. + +2000-10-20 J. David Anglin + + * t-vax: New file. Don't build modules from libgcc1.c. + +Fri Oct 20 00:57:00 EDT 2000 John Wehle (john@feith.com) + + * alias.c: (mark_constant_function): Don't check pure functions. + Initialize and end alias analysis. + (nonlocal_mentioned_p): Rename from nonlocal_reference_p. + Don't make a special exception for recursion. Handle + UNSPEC_VOLATILE. Don't assume ASM_OPERANDS is non-local + unless it's volatile. + + * local-alloc.c (equivalence): New structure. + (reg_equiv): Define. + (contains_replace_regs): Remove array and use + field in reg_equiv. + (memref_referenced_p): Likewise. + (no_equiv): Likewise. + (update_equiv_regs): Likewise. + + (equiv_init_varies_p, + equiv_init_movable_p): New functions. + (update_equiv_regs): Use them. Use rtx_varies_p + instead of function_invariant_p. Process insns + from end to beginning. Allow a REG_EQUIV insn + within the same loop as a use to be moved, also + allow it to be moved out of a loop. Update + REG_DEAD notes when substituting into an insn. + +2000-10-19 Jim Wilson + + * c-decl.c (start_decl): Check for error_mark_node type before using + COMPLETE_TYPE_P. + (finish_decl): Likewise. Don't give an error if decl type is + already error_mark_node. + + * haifa-sched.c (compute_trg_info): Add explanatory comments. + New local update_blocks. Use update_blocks to remove duplicates + when computing update blocks. Check for bblst_table overflow. + (schedule_block): Add explanatory comment. Reduce bblst_size by + factor of 2. + * config/ia64/ia64.md (movdi_symbolic): Document loss of REG_LABEL + notes. + +2000-10-19 Chandrakala Chavva + + * libgcc2.c (_mulvsi3): Change variables u and v to a and b. + +2000-10-19 Chandrakala Chavva + + * expmed.c: Minor corrections in comments. + * invoke.texi: Added desciption for the new option -ftrapv. + +2000-10-19 Chandrakala Chavva + + * libgcc2.c: Added the missing #endif. + +Thu Oct 19 14:25:11 MET DST 2000 Jan Hubicka + + * i386.h (CONST_OK_FOR_LETTER): Re-add 'N'; document. + +2000-10-18 Chandrakala Chavva + + * expmed.c (expand_mult): Don't do synth_mult optimization for -ftrapv. + Use smulv_optab for -ftrapv. + (expand_mult_highpart): Use unsigned multiply. + (expand_divmod): Special-case division by -1. + For EXACT_DIV_EXPR, do right shift first, then the multiply. + For complex divide, use abs with unsigned result. + * expr.c (force_operand): Use unsigned multiply. + (expand_expr): Use overflow-trapping optabs for signed types if + flag_trapv. + If flag_trapv, don't generate a recursive call with EXPAND_SUM + if the type is signed and the original call wasn't EXPAND_SUM or + EXPAND_INITIALIZER. + * expr.h (addv_optab, subv_optab, smulv_optab, sdivv_optab): Declare. + (negv_optab, absv_optab): Declare. + * flags.h (flag_trapv): Declare. + * genopinit.c (optabs): Add entries for addv_optab, subv_optab, + smulv_optab, sdivv_optab, negv_optab and absv_optab. + (gen_insn): Interpret '$P' as requiring an integer mode, + including partial integer modes. + * loop.c (emit_iv_add_mult): Use unsigned expand_mult_add. + (product_cheap_p): Use unsigned expand_mult. + * optabs.c (addv_optab, subv_optab, smulv_optab, sdivv_optab): Define. + (negv_optab, absv_optab): Define. + (expand_binop): Use overflow-trapping optabs for signed types if + flag_trapv. + Handle negv_optab libe neg_optab. + (expand_abs): Take result_unsignedp argument instead of unsignedp one. + Use overflow-trapping optabs for signed result if flag_trapv. + (expand_complex_abs): Use overflow-trapping optabs for signed types if + flag_trapv. + Don't open-code complex absolute-value operation for flag_trapv. + (init_optabs): Initialize addv_optab, subv_optab, smulv_optab, + sdivv_optab, negv_optab and absv_optab. + * toplev.c (flag_trapv): Define. + (lang_independent_options f_options): Include flag_trapv. + * tree.h (TYPE_TRAP_SIGNED): Define. + * libgcc2.c (__addvsi3, __addvdi3, __subvsi3,__subvsi3, __subvdi3, + __mulvsi3, __negvsi2, __negvdi2, __absvsi2, __absvdi2, __mulvdi3): + New functions. + * Makefile.in: add _absvsi2 _absvdi2 _addvsi3 _addvdi3 _subvsi3 + _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2. + +2000-10-18 Geoffrey Keating + David V. Henkel-Wallace + + * config/i386/t-netware: Bring in from the Red Hat tree. + * config/i386/netware.h: Likewise. + * config/netware.h: Likewise. + * config/rs6000/netware.h: Delete. + * configure.in: Add i[34567]86-*-netware. + * configure: Hand-edit to match configure.in change. + +2000-10-18 Mark Mitchell + + * c-common.h (flag_no_builtin): Declare. + (flag_no_nonansi_builtin): Likewise. + (c_common_nodes_and_builtins): Change prototype. + * c-common.c (flag_no_builtin): New variable. + (flag_no_nonansi_builtin): Likewise. + (c_common_nodes_and_builtins): Remove parameters. Adjust + accordingly. + * c-decl.c (flag_no_builtin): Remove. + (flag_no_nonansi_builtin): Likewise. + (init_decl_processing): Adjust call to + c_common_nodes_and_builtins. + +2000-10-18 Marc Espie + + * tm.texi (LIBGCC_SPEC): Synch with reality. + +2000-10-18 Joseph S. Myers + + * c-common.c (check_format_types): Check for writing through a + NULL pointer argument. + +2000-10-18 Hans-Peter Nilsson + + * tm.texi (Exception Region Output): Document + DWARF_CIE_DATA_ALIGNMENT. + * dwarf2out.c (DWARF_CIE_DATA_ALIGNMENT): Wrap definition in + #ifndef. + [ENABLE_CHECKING] (reg_save): Abort if offset is not a multiple of + DWARF_CIE_DATA_ALIGNMENT. + +2000-10-18 Michael Hayes + + * basic-block.h (struct loop): Delete fields pre_header_root + and pre_header_trace and replace with pre_header_edges + and num_pre_header_edges. + * flow.c (flow_loop_dump): Dump pre_header_edges. + (flow_loops_free): Free pre_header_edges. + (flow_loop_pre_header_scan): Calculate pre_header_edges. + +2000-10-18 Gerald Pfeifer + + * contrib.texi: Update references to steering committee members + and Jeff Law's entry. + +2000-10-18 Joseph S. Myers + + * c-common.c (CPLUSPLUS_STD_VER, C_STD_VER, C_STD_NAME): Define. + (maybe_read_dollar_number, check_format_info_main): Use them for + pedantic warning messages. + +2000-10-18 Joseph S. Myers + + * c-common.c (check_format_info_main): Minor cleanup: move + variables into inner scopes; initialize declarations where + appropriate; don't hardcode "scanf" name on warning for zero + width. + +2000-10-17 Mark Mitchell + + * c-common.c (back_end_hook): New variable. + * c-common.h (back_end_hook): Declare it. + * c-lang.c (finish_file): Use it. + + * emit-rtl.c (init_emit_once): Initialize the const_int_htab + earlier. + +2000-10-18 Jan Hubicka + + * i386.c (ix86_comparison_operator, put_condition_code, + ix86_match_ccmode, ix86_cc_mode): Handle CCRCmode. + (ix86_expand_strlensi_unroll_1): Use CCRCmode. + * i386.h (EXTRA_CC_MODES): Add CCRCmode. + * i386.md (adddi and negdi splitter): Use CCRCmode. + (add?i_3, add?i_4, add?i_5): Use CCRCmode; swap operands + (subsi3_carry): add '*' + (addsi3_carry_rc, subsi3_carry_rc, x86_movsicc_0_m1_rc): New. + (cmp to add peep2): Use CCRCmode; swap operands. + +2000-10-18 Kazu Hirata + + * h8300.c: Fix a comment typo. + (round_frame_size): New. + (compute_saved_regs): Likewise. + (push): Likewise. + (pop): Likewise. + (push_order): Remove. + (pop_order): Likewise. + (function_prologue): Rearrange code for readability. + (function_epilogue): Likewise. + + * config/h8300/h8300.md: Remove an unnecessary sign_extend + expander that is used when not optimizing. Output a tab after + each assembly insns. + + * reorg.c: Fix formatting. + +2000-10-17 Joern Rennecke + + * reload1.c (move2add_note_store): Check for simple + auto-inc in destination. + +2000-10-17 Michael Chastain + + * config/i386/i386-aout.h: define INT_ASM_OP. + +Tue Oct 17 20:11:08 2000 Alan Modra + + * pa.c (print_operand): Handle case 'c' for .vtable_inherit + +Tue Oct 17 20:05:51 2000 Martin Buchholz + + * i370.md: Fix spelling typo. + +2000-10-17 Franz Sirl + + * function.c (locate_and_pad_parm): Don't align stack unconditionally. + Fixes execute/20001017-1.c on powerpc-linux-gnu. + + * expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only. + * rs6000/rs6000.c (rs6000_hash_constant): Use X0INT to access a + LABEL_REF. + + * rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS, + ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from + here... + * rs6000/aix.h: ...to here. + * rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style. + +2000-10-17 Jakub Jelinek + + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Reload gp if needed. + + * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Always use call, make + sure linker can relax even the delay slot mov %g1,%o7, fix output + formating. + +2000-10-17 Kazu Hirata + + * config/h8300/h8300.md: Remove an unnecessary zero_extend + expander that is used when not optimizing. Output a tab after + each assembly insns. + +2000-10-17 Chandrakala Chavva + + * gcc.c: New options --target-help. + (process_command): Added code to parse this new option. + * toplev.c (display_target_options): New function to support the + above new option. + * cppinit.c (new_pending_directive) : New option OPT_target__help. + (cpp_handle_option): Support this new option. + * invoke.texi: Added notes about --target-help option. + +2000-10-17 Graham Stott + + * config/i386/i386.md (testqi_1): Add missing operand prefix + for operand 0. + * config/i386/i386-protos.h: Add missing prototype. + +2000-10-17 Diego Novillo + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Symbol + _GLOBAL_OFFSET_TABLE should not have a $ prefix when + using -mintel-syntax. + +2000-10-17 Joseph S. Myers + + * c-common.c (FMT_FLAG_DOLLAR_MULTIPLE): Define. + (format_types): Use it for printf. + (maybe_read_dollar_number): Add parameter for the kind of format + involved. Warn for multiple use for arguments if this is + inappropriate for the kind of format involved. + (check_format_info_main): Update calls to maybe_read_dollar_number. + +2000-10-17 J. David Anglin + + * inclhack.def (hpux_maxint): Also apply fix to values.h. + * fixincl.x: Rebuilt. + +2000-10-17 Alexandre Oliva + + * genrecog.c (write_switch): Return the first condition that needs a + label. + +2000-10-17 Bernd Schmidt + + * c-tree.h (warn_sequence_point): Move declaration to... + * c-common.h (warn_sequence_point): ... here. + * c-decl.c (warn_sequence_point): Move definition to... + * c-common.c (warn_sequence_point): ... here. + (struct reverse_tree): New. + (reverse_list, reverse_max_depth): New static variables. + (build_reverse_tree, common_ancestor, modify_ok + verify_sequence_points): New functions. + (c_expand_expr_stmt): Call verify_sequence_points if -Wsequence-point. + * c-typeck.c (check_modify_expr): Delete. + (build_modify_expr): Don't call it. + +2000-10-17 Joseph S. Myers + + * c-common.h (warn_missing_format_attribute): New variable. + * c-decl.c (warn_missing_format_attribute): New variable. + (c_decode_option): Decode -Wmissing-format-attribute and + -Wno-missing-format-attribute. + * c-common.c (check_function_format): If + -Wmissing-format-attribute, give a warning where a vprintf or + vscanf function is called by a function without its own printf or + scanf attribute. + * toplev.c (documented_lang_options): Add + -Wmissing-format-attribute. + * invoke.texi: Document -Wmissing-format-attribute. + +2000-10-17 Marc Espie + + * invoke.texi (-shared): Insist on requiring code generation flags + to be used along with -shared, and document the subtle failure that + may occur otherwise. + +2000-10-16 J. David Anglin + + * pa.md (return_internal): Move `use' after `return'. + +2000-10-16 Theodore Papadopoulo + + * machmode.def: Correct comment. + +2000-10-16 Rodney Brown + + * print-rtl.c (print_rtx_head): Constify. + * rtl.h (print_rtx_head): Similarly. + + * config/pa/pa/pa-protos.h (output_64bit_and, output_64bit_ior): + Constify char * return value. + * config/pa/pa/pa.c + (output_64bit_and, output_64bit_ior): Constify char * return value. + (pa_can_combine_p): Make static. + (function_arg): Decorate unused `named' argument. Fix comment typo. + (function_arg_partial_nregs): Decorate unused `named' argument. + +2000-10-16 Joseph S. Myers + + * c-common.c (format_check_results): New structure. + (finish_dollar_format_checking): Adjust to take a + format_check_results * parameter. + (check_format_info, check_format_info_recurse, + check_format_info_main): Split check_format_info into three + functions, the main checking going in check_format_info_main. + Recurse when any reduction of the format string argument towards a + string literal is done; go down both branches of a conditional + expression. Don't warn for extra format arguments or empty format + strings if they only occur in some branches of a conditional + expression. + +2000-10-16 Kazu Hirata + + * config/h8300/h8300.c: Remove obstack. Include ggc.h. + +2000-10-16 Jakub Jelinek + + * rtlanal.c (may_trap_p): Check operand modes of COMPARE. + +2000-10-15 Diego Novillo + + * i386.md (*movsi_or): Switch operand order for intel syntax. + +2000-10-14 Joseph S. Myers + + * PROBLEMS: Remove. + + * gcc.texi (Contributing): Update. + +2000-10-13 Diego Novillo + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Output final jump using + appropriate assembler dialect. + +2000-10-13 Alexandre Oliva + + * c-common.c (c_expand_builtin): PARAMS-ize prototype. + +2000-10-12 Marek Michalkiewicz + + * config/avr/avr.c (output_movhi, output_movsisf): Fix loading + constants 1 and 2 to NO_LD_REGS. + +2000-10-13 Kaveh R. Ghazi + + * Makefile.in (c-parse.c, tradcif.c): Create atomically. + + * objc/Make-lang.in (objc-parse.c): Likewise. + +2000-10-13 Richard Earnshaw + + * arm.c: Include obstack.h + (minipool_obstack, minipool_startobj): Define. + (arm_add_gc_roots): Initialize them. + (create_fix_barrier): Use our new obstack. + (push_minipool_barrier, push_minipool_fix): Likewise. + (arm_reorg): Release obstack memory. + +2000-10-13 Jakub Jelinek + + * config/sparc/sparc.md (nonlocal_goto_receiver): Remove. + (prologue, exception_receiver, builtin_setjmp_receiver): New + patterns. + * config/sparc/sparc.h (FINALIZE_PIC): Remove. + * config/sparc/sparc-protos.h (finalize_pic): Remove. + (load_pic_register): New prototype. + * config/sparc/sparc.c (pic_setup_code): Remove. + (finalize_pic): Rename to... + (load_pic_register): ...this function. + Don't look for nonlocal_goto_receivers and emit pic setup code + directly. Don't check current_function_uses_pic_offset_table. + +2000-10-13 Richard Earnshaw + + * tree.h (struct obstack): Declare. + +2000-10-12 Mark Mitchell + + Remove obstacks. + * Makefile.in (ggc-callbacks.o): Remove target. + (flow.o): Depend on GGC_H. + * alias.c (init_alias_analysis): + Remove ggc_p conditionals. + (end_alias_analysis): Likewise. + * basic-block.h (init_flow): New function. + (allocate_reg_life_data): Declare. + * bb-reorder.c (function_obstack): Replace with ... + (flow_obstack): ... new variable. + (fixup_reorder_chain): Use it. + * c-decl.c (ggc_p): Remove. + (caller-save.c): Don't call oballoc/obfree. + * combine.c (struct + undobuf): Remove storage. + (try_combine): Don't call oballoc. + (undo_all): Don't call obfree. + * cse.c (insert): Use xmalloc, not + oballoc. + (cse_main): Adjust accordingly. + * dwarf2out.c (save_rtx): Remove + obstack code. + (dwarf2out_init): Remove ggc_p conditionals. + * emit-rtl.c (rtl_obstack): Remove. + (gen_rtx_CONST_INT): Remove ggc_p conditionals. + (make_insn_raw): Likewise. + (emit_insn_before): Likewise. + (emit_insn_after): Likewise. + (emit_insn): Likewise. + (gen_sequence): Likewise. + (copy_insn_1): Remove handling of `b' RTL components. + (init_emit_once): Remove ggc_p conditionals. + * except.c (create_rethrow_ref): Don't fool with obstacks. + (add_partial_entry): Likewise. + (call_get_eh_context): Likewise. + (begin_protect_partials): Likewise. + (protect_with_terminate): Likewise. + * explow.c + (plus_constant_wide): Likewise. + * expr.c (init_expr_once): + Likewise. + (emit_block_move): Likewise. + (clear_storage): Likewise. + (expand_expr): Likewise. + * flow.c (function_obstack): Remove. + (flow_obstack): New variable. + (flow_firstobj): Likewise. + (create_base_block): Use the flow_obstack. + (split_block): Likewise. + (split_edge): Likewise. + (calculate_global_regs_live): Likewise. + (allocate_bb_life_data): Make it static. Likewiwse. + (init_flow): New function. + (size_int_type_wide): Remove ggc_p conditionals. + * function.c + (push_function_context_to): Don't call save_tree_status. + (pop_function_context_from): Or restore_tree_status. + (assign_stack_local_1): Don't call push_obstacks. + (find_fixup_replacement): Use xmalloc. + (fixup_var_refs_insns): Free the storage. + (insns_for_mem_walk): Don't mess with obstacks. + (instantiate_decls): Likewise. + (trampoline_address): Likewise. + (expand_function_end): Likewise. + * function.h (sturct function): + Remove obstack-related variables. + (save_tree_status): Don't declare. + (restore_tree_status): Likewise. + * gcse.c (compute_can_copy): + Don't call oballoc/obfree. + * genattrtab.c (operate_exp): Remove + ggc_p conditionals. + (simplify_cond): Likewise. + (simplify_test_exp): Don't mess with obstacks. + (optimize_attrs): Likewise. + * gengenrtl.c (gendef): Don't include + ggc_p conditionals. + * ggc-callbacks.c (ggc_p): Remove. + * ggc-none.c (ggc_p): Remove. + * ggc.h (ggc_p): Don't declare. + * integrate.c (save_for_inline): Don't mess with obstacks. + (integrate_decl_tree): Likewise. + (output_inline_function): Likewise. + * lists.c + (init_EXPR_INSN_LIST_cache): Likewise. + * loop.c (temp_obstack): + Remove. + (rtl_obstack): Likewise. + (init_loop): Don't mess with obstacks. + (reg_address_cost): Free BIVs and GIVs. + (check_insns_for_bivs): Use xmalloc, not oballoc. + (find_mem_givs): Likewise. + (record_biv): Likewise. + (general_induction_var): Likewise. + (product_cheap_p): Likewse. + * optabs.c (init_one_libfunc): Remove + ggc_p conditional. + * print-tree.c (debug_tree): Don't use + oballoc/obfree. + (print_node): Likewise. + * profile.c (output_func_start_profiler): + Remove call to temporary_allocation. + * reload1.c + (eliminate_regs_in_insn): Don't mess with obstacks. + * resource.c + (mark_target_live_regs): Use xmalloc. + (free_resource_info): Free the memory. + * rtl.c (rtl_obstack): + Remove. + (rtvec_alloc): Don't mess with obstacks. + (rtx_alloc): Likewise. + (rtx_free): Remove. + (copy_rtx): Don't handle `b' cases. + (read_rtx): Use a local rtl_obstack. + * rtl.h (oballoc): Remove. + (obfree): Likewise. + (pop_obstacks): Likewise. + (push_obstacks): Likewise. + (allocate_bb_life_data): Likewise. + (allocate_reg_life_data): Likewise. + (rtx_free): Likewise. + * sdbout.c (sdbout_queue_anonymous_type): + Use tree_cons, not saveable_tree_cons. + * simplify-rtx.c + (cselib_init): Don't mess with obstacks. + * stmt.c + (mark_block_nesting): Mark the label_chain. + (epxand_label): Use ggc_alloc, not oballoc. + (clear_last_expr): Don't mess with obstacks. + (expand_decl_cleanup): Likewise. + (expand_dcc_cleanup): Likewise. + (expand_dhc_cleanup): Likewise. + (expand_anon_union_decl): Likewise. + (add_case_node): Use xmalloc, not oballoc. + (free_case_nodes): New function. + (expand_end_case): Call it. + * stor-layout.c (layout_type): Don't + mess with obstacks. + (layout_type): Likewise. + * toplev.c (wrapup_global_declarations): + Likewise. + (compile_file): Remove ggc_p conditionals. + (rest_of_compilation): Call init_flow. Remove ggc_p conditionals. + (decode_f_option): Remove ggc_p conditionals. + * tree.c + (function_maybepermanent_obstack): Remove. + (maybepermanent_obstack): Likewise. + (function_obstack): Likewise. + (tmeporary_obstack): Likewise. + (momentary_obstack): Likewise. + (temp_decl_obstack): Likewise. + (saveable_obstack): Likewise. + (rtl_obstack): Likewise. + (current_obstack): Likewise. + (expression_obstack): Likewise. + (struct obstack_stack): Likewise. + (obstack_stack): Likewise. + (obstack_stack_obstack): Likewise. + (maybepermanent_firstobj): Likewise. + (temporary_firstobj): Likewise. + (momentary_firstobj): Likewise. + (temp_decl_firstobj): Likewise. + (momentary_function_firstobj): Likewise. + (all_types_permanent): Likewise. + (struct momentary_level): Likewise. + (momentary_stack): Likewise. + (init_obstacks): Remove initialization of removed obstacks. + (save_tree_status): Remove. + (restore_tree_status): Likewise. + (temporary_allocation): Liekwise. + (end_temporary_allocation): Liekwise. + (resume_temporary_allocation): Likewise. + (saveable_allocation): Likewise. + (push_obstacks): Likewise. + (push_obstacks_nochange): Likewise. + (pop_obstacks): Likewise. + (allocation_temporary_p): Likewise. + (permanent_allocation): Likewise. + (preserve_data): Likewise. + (preserve_initializer): Likewise. + (rtl_in_current_obstack): Likewise. + (rtl_in_saveable_obstack): Likewise. + (oballoc): Likewise. + (obfree): Likewise. + (savealloc): Likewise. + (expralloc): Likewise. + (print_obstack_name): Likewise. + (debug_obstack): Likewise. + (object_permanent_p): Likewise. + (push_momentary): Likewise. + (perserve_momentary): Likewise. + (clear_momentary): Likewise. + (pop_momentary): Likewise. + (pop_momentary_nofree): Likewise. + (suspend_momentary): Likewise. + (resume_momentary): Likewise. + (make_node): Don't set TREE_PERMANENT. + (copy_node): Remove ggc_p conditionals. Don't set TYPE_OBSTACK. + Don't set TREE_PERMANENT. + (get_identifier): Remove ggc_p conditionals. + (build_string): Likewise. + (make_tree_vec): Likewise. + (build_decl_list): Remove. + (build_expr_list): Likewise. + (tree_cons): Remove ggc_p conditionals. + (decl_tree_cons): Remove. + (expr_tree_cons): Likewise. + (perm_tree_cons): Likewise. + (temp_tree_cons): Likewise. + (saveable_tree_cons): Likewise. + (build1): Remove ggc_p conditionals. + (build_parse_node): Likewise. + (build_type_attribute_variant): Don't mess with obstacks. + (build_type_copy): Likewise. + (type_hash_canon): Likewise. + (build_pointer_type): Likewise. + (build_reference_type): Likewise. + (build_index_type): Likewise. + (build_range_type): Likewise. + (dump_tree_statistics): Don't print obstack information. + * tree.h + (struct tree_common): Remove permanent_flag. + (TREE_PERMANENT): Remove. + (TREE_SET_PERMANENT): Likewise. + (TYPE_OBSTACK): Likewise. + (struct tree_type): Remove obstack. + (oballoc): Remove. + (savealloc): Likewise. + (build_decl_list): Likewise. + (build_expr_list): Likewise. + (perm_tree_cons): Likewise. + (temp_tree_cons): Likewise. + (saveable_tree_cons): Likewise. + (decl_tree_cons): Likewise. + (expr_tree_cons): Likewise. + (suspend_momentary): Likewise. + (allocation_temporary_p): Likewise. + (resume_momentary): Likewise. + (push_obstacks_nochange): Likewise. + (permanent_allocation): Likewise. + (push_momentary): Likewise. + (clear_momentary): Likewise. + (pop_momentary): Likewise. + (end_temporary_allocation): Likewise. + (pop_obstacks): Likewise. + (push_obstacks): Likewise. + (pop_momentary_nofree): LIkewise. + (preserve_momentary): Likewise. + (saveable_allocation): Likewise. + (temporary_allocation): Likewise. + (resume_temporary_allocation): Likewise. + (perserve_initializer): Likewise. + (debug_obstack): Likewise. + (rtl_in_current_obstack): Likewise. + (rtl_in_saveable_obstack): Likewise. + (obfree): Likewise. + * varasm.c (current_obstack): Remove. + (saveable_obstack): Remove. + (rtl_obstack): Remove. + (immed_double_const): Don't mess with obstacks. + (immed_real_cons): Likewise. + (output_constant_def): Likewise. + (init_varasm_status): Use xcalloc. + (mark_pool_constant): Mark the pool constant itself. + (free_varasm_status): Free memory. + (decode_rtx_const): Call bzero directly, rather than expanding it + inline. + (record_rtx_const): Don't mess with obstacks. + (force_const_mem): Likewise. + * config/arm/arm.c (arm_encode_call_attribute): Remove ggc_p + conditionals. + (aof_pic_entry): Likewise. + * config/ia64/ia64.c (ia64_encode_section_info): Likewise. + * config/m32r/m32r.c (m32r_encode_section_info): Likewise. + * config/pa/pa.c (saveable_obstack): Remove. + (rtl_obstack): Likewise. + (current_obstack): Likewise. + (output_call): Don't mess with obstacks. + (hppa_encode_label): Remove ggc_p conditionals. + * config/romp/romp.c (get_symref): Don't mess with obstacks. + * config/rs6000/rs6000.c (output_toc): Remove ggc_p conditional. + (rs6000_encode_section_info): Likewise. + * config/sh/sh.c (get_fpscr_rtx): Likewise. + +Thu Oct 12 16:02:31 MET DST 2000 Jan Hubicka + + * i386.md (adddi3, subdi3 splitters): Update for new pattern. + (addsi3_cc, addqi3_cc, subsi3_cc): Remove + (addsi3_carry): Canonicalize. + (addqi_5): Remove '*'. + (sbb pattern): Canonicalize. + + * i386.md (cmp to inc/add peep2): New. + +2000-10-12 Richard Earnshaw + + * bb-reorder.c (reorder_basic_blocks): Allocate an aux block for + the exit block. + +2000-10-12 Joseph S. Myers + + * gcc.texi: Merge in contents of README.TRAD and TESTS.FLUNK. + * README.TRAD, TESTS.FLUNK: Remove. + +2000-10-12 Joseph S. Myers + + * c-common.c (decl_attributes): Don't allow strftime formats with + first_arg_num nonzero. + (check_format_info): Set wanted_type and wanted_type_name to zero + before they are possibly assigned and used. + +2000-10-12 Joseph S. Myers + + * c-common.c (scanf_flag_specs): Add flags ' and I. + (strftime_flag_pairs): Disallow any pair of the _, - and 0 flags, + or the ^ and # flags together. + (scan_char_table): Handle the ' and I flags. + (format_types): Add ' and I flags for scanf. + +2000-10-12 Joseph S. Myers + + * c-common.c (print_char_table): Use the unpromoted type for + lengths "h" and "hh" with conversions dioxXu. + (check_format_types): Apply the default argument promotions where + the wanted type is not a pointer target. + +2000-10-11 Michael Meeks + Joseph S. Myers + + * c-typeck.c (check_modify_expr): New function. + (build_modify_expr): Call it if warn_sequence_point. + * c-decl.c (warn_sequence_point): New variable. + (c_decode_option): Handle -Wsequence-point and + -Wno-sequence-point. Enable -Wsequence-point as part of -Wall. + * c-tree.h (warn_sequence_point): Declare. + * invoke.texi (-Wsequence-point): Document. + * toplev.c (documented_lang_options): Add -Wsequence-point and + -Wno-sequence-point. + Original work by Michael Meeks, 16 Jun 1998. + +Wed Oct 11 06:15:41 2000 Richard Kenner + + * tree.c (get_narrower): Don't look at precision of field if + not laid out yet. + +Tue Oct 10 23:14:33 2000 Denis Chertykov + + * config/avr/avr.c (valid_machine_decl_attribute): Allow `extern' + declaration for data with "progmem" attribute. + +2000-10-09 Marek Michalkiewicz + + * config/avr/avr.c (out_shift_with_cnt): Use AS2 macro. + Correct insn length if shift count is a memory operand. + * config/avr/avr.md: New define_peephole2 to use *reload_inqi. + (*iorhi3_clobber): Change lo8 to hi8. + (zero_extendhisi2): Change %B0 to %A1. + (ashlhi3, ashrhi3): Correct insn length. + (andhi3, abssf2, extendqisi2, extendhisi2): Change "cc" + from "clobber" to "set_n" in some alternatives. + +2000-10-10 Jakub Jelinek + + * reload1.c (calculate_needs_all_insns): If deleting an instruction, + remove its insn_chain structure as well. + +2000-10-09 J. David Anglin + + * dbxout.c (dbxout_source_line): Remove extra tab. + +2000-10-09 Hans-Peter Nilsson + + * config/elfos.h (UNIQUE_SECTION): Apply STRIP_NAME_ENCODING on name. + +2000-10-09 Richard Henderson + + * Makefile.in (LANG_LIB2FUNCS): Remove. + (LIB2FUNCS): Remove _pure. + (LIB2ADD): Remove LANG_LIB2FUNCS. + (stage_a): Don't set LANG_LIB2FUNCS. + * libgcc2.c (__terminate): Mark noreturn. + (__pure_virtual): Remove. + * mklibgcc.in: Remove LIB2ADD .txt processing. + +2000-10-09 Richard Earnshaw + + * arm.md (push_multi): Revert unintended change. + +2000-10-09 Richard Earnshaw + + * arm.c: Miscellaneous white space and comment clean-ups. No + functional change. + * arm.md: Likewise. + +2000-10-09 Kaveh R. Ghazi + + * c-common.c (c_expand_builtin_printf): Set the TREE_TYPE of a new + STRING_CST by calling combine_strings. + +2000-10-09 Richard Earnshaw + + * arm.c (thumb_expand_movstrqi): Rewrite to support SSA form. + (thumb_output_move_mem_multiple): Support new insn format. + * arm.md (movmem12b): Use SSA compatible format. + (movmem8b): Likewise. + +2000-10-09 Richard Earnshaw + + * arm.md (predicable): New attribute, default to "no". + (all patterns): Mark as predicable if appropriate. + (conditional execution splits): Split using predication format. + (define_cond_exec): Define. + * arm.c (arm_print_operand): handle insn predicate. + +2000-10-09 Gerald Pfeifer + + * README.NS32K: Remove file. + +2000-10-09 Gerald Pfeifer + + * README-bugs: Remove file. + +2000-10-08 Philipp Thomas + * aclocal.m4 (AM_GNU_GETTEXT): Fix non portable use of == operator + for test. + * configure: Rebuilt. + +2000-10-08 Philipp Thomas + * aclocal.m4 (AM_WITH_NLS): When not using included gettext, + disable catalog building if no suitable program was found. + Move warning message from here + (AM_GNU_GETTEXT): To here. + * configure: Rebuilt. + +2000-10-08 Philipp Thomas + * aclocal.m4 (GCC_PATH_PROG): New. Like AC_PATH_PROG but uses + different cache variables. + (GCC_PATH_PROG_WITH_TEST): New. Like AM_PATH_PROG_WITH_TEST but + uses different cache variables. + (AM_WITH_NLS): Use GCC_PATH_PROG and GCC_PATH_PROG_WITH_TEST. + * configure: Regenerated. + +2000-10-08 Richard Henderson + + * Makefile.in (libgcc.mk): Pass SHLIB_EXT, not SHLIB_LIBS. + * configure.in (sparc*-*-solaris*): Use t-slibgcc{,-sld}. + * mklibgcc.in: Consider SHLIB_LINK the entire shlib build command. + Use SHLIB_EXT. + + * config/t-linux (SHLIB_EXT): New. + (SHLIB_LINK): Use the entire build command, with substitutions. + (SHLIB_LIBS): Remove. + * config/alpha/t-osf4: Likewise. + * config/mips/t-iris6: Likewise. + * config/sparc/t-sol2: Likewise, but move shlib stuff... + * config/sparc/t-slibgcc-sld: ...here. + * config/sparc/t-slibgcc: New file. + +2000-10-08 Joseph S. Myers + + * tm.texi (INTMAX_TYPE, UINTMAX_TYPE): Define. + * c-common.h (enum c_tree_index): Add CTI_INTMAX_TYPE and + CTI_UINTMAX_TYPE. + (intmax_type_node, uintmax_type_node): Define. + * c-common.c (decl_attributes): If pedantic, warn if `mode' + attributes create a type wider than intmax_t. + (T_IM, T_UIM): Define properly. + * c-decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already + defined. + (init_decl_processing): Initialize intmax_type_node and + uintmax_type_node. + * c-lex.c (lex_number): When pedantic and warning for integer + constants that are too large, in C99 mode warn for those that have + a type wider than long long. + +2000-10-08 Joseph S. Myers + + * c-common.c (FMT_FLAG_ARG_CONVERT, FMT_FLAG_SCANF_A_KLUDGE, + FMT_FLAG_FANCY_PERCENT_OK): Define. + (format_char_info): Add flag "4" to comment. + (format_flag_spec, format_flag_pair): New structures. + (format_kind_info): Add additional fields to control format + checking. + (printf_flag_specs, printf_flag_pairs, scanf_flag_specs, + scanf_flag_pairs, strftime_flag_specs, strftime_flag_pairs): New + arrays. + (time_char_table): Use "4" flag to handle %Ey. + (format_types): Add entries for new fields. + (get_flag_spec): New function. + (check_format_info): Increase size of flag_chars[] to 256. + Control format checking using the new fields of a format_kind_info + and the new tables; remove all conditionals on printf_format_type, + scanf_format_type or strftime_format_type. Handle all details of + bad combinations of flags (including width, precision and strftime + modifiers) through data rather than ad hoc code. Handle all + details of standard versions in which flags appeared through + data. Use the "4" flag. + +2000-10-07 Will Cohen , Kazu Hirata + + * config/h8300/h8300.md: Remove the memory alternative and correct + the insn lengths in the templates for sign extension and zero + extension. + +2000-10-07 Richard Henderson + + * calls.c (expand_call): Disallow sibcalls to noreturn functions. + * flow.c (make_edges): Revert last change. + + * config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Don't test + TREE_THIS_VOLATILE. + * config/pa/pa.h (FUNCTION_OK_FOR_SIBCALL): Likewise. + +2000-10-06 David O'Brien + + * config/alpha/elf.h: Standardize the formatting. + +2000-10-06 David O'Brien + + * config/alpha/elf.h: Protect the ASM_OUTPUT_IDENT definition with an + #undef. + +2000-10-06 Richard Henderson + + * function.c (diddle_return_value): Examine + current_function_return_rtx instead of the DECL_RESULT. + (expand_function_end): Handle reloading DECL_RESULT from memory + into a hard register. Query promote_mode for sign of mismatched + modes. + +2000-10-06 Vladimir Makarov + + * haifa-sched.c (schedule_insns): Fix typo in freeing + forward_dependency_cache. + +2000-10-06 Alexandre Oliva + + * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): Add + `TARGET_SH2' as a condition. + +2000-10-06 Vladimir Makarov + + * haifa-sched.c (anti_dependency_cache, output_dependency_cache, + forward_dependency_cache): New variables. + (add_dependence, remove_dependence): Use anti_dependency_cache and + output_dependency_cache. + (compute_block_forward_dependences): Use forward_dependency_cache. + (schedule_insns): Allocate and free memory for anti/output/forward + dependencies caches. + +2000-10-06 Alexandre Oliva + + * config/sh/sh.md (call, call_value): Use `TARGET_SH2' instead of + `! TARGET_SH1'. Reindent. + +2000-10-06 Kaveh R. Ghazi + + * builtins.c (is_valid_printf_arglist, expand_builtin_printf): + Move functions from here ... + + * c-common.c (is_valid_printf_arglist, c_expand_builtin_printf): + ... to here. + (c_expand_builtin): New function. + (init_function_format_info): Don't set `check_function_format_ptr'. + (c_common_nodes_and_builtins): Set built_in_class type for + printf/__builtin_printf to BUILT_IN_FRONTEND. + (c_expand_expr): Handle CALL_EXPRs that are front-end builtins. + + * c-common.h (build_function_call): Declare. + + * expr.c (expand_expr): Pass builtins with class BUILT_IN_FRONTEND + to `lang_expand_expr' rather than `expand_builtin'. + + * tree.c (check_function_format_ptr): Delete. + + * tree.h (check_function_format_ptr): Likewise. + +2000-10-06 Hans-Peter Nilsson + + * dwarf2out.c (build_cfa_loc): Correct to use DW_OP_regx or + DW_OP_bregx when cfa->reg > 31. + + * frame-dwarf2.c (decode_stack_op) [case DW_OP_regx]: Add missing + break. + +2000-10-05 Richard Henderson + + * c-decl.c (warn_missing_noreturn): Remove. + (c_expand_body): Don't set or check can_reach_end. + * c-tree.h (warn_missing_noreturn): Move ... + * flags.h: ... here. + (can_reach_end): Remove. + * flow.c (check_function_return_warnings): New. + (make_edges): No edge to exit for noreturn sibcalls. + * function.c (expand_function_end): Save the return value + clobber instruction. + (mark_function_status): Mark it. + * function.h (struct function): Add x_clobber_return_insn. + * jump.c (can_reach_end): Remove. + (calculate_can_reach_end): Remove. + (jump_optimize_1): Don't call it. + * output.h (check_function_return_warnings): Declare. + * toplev.c (warn_missing_noreturn): Move from c-decl.c + (rest_of_compilation): Call check_function_return_warnings. + +2000-10-05 Richard Henderson + + * Makefile.in (NM_FOR_TARGET): New. + (libgcc.mk): Pass SHLIB_MKMAP, SHLIB_MAPFILES. + (libgcc.a, stmp-multilib): Pass NM_FOR_TARGET. + * mklibgcc.in: If SHLIB_MKMAP, build libgcc.map. Depend the + shared library build on that and EXTRA_MULTILIB_PARTS. + * mkmap-flat.awk: New file. + * mkmap-symver.awk: New file. + * libgcc-std.ver: New file. + * config/libgcc-glibc.ver: New file. + * config/ia64/libgcc-ia64.ver: New file. + * config/t-linux (SHLIB_MKMAP, SHLIB_MAPFILES): New. + (SHLIB_LINK): Add --version-script. + * config/ia64/t-ia64 (SHLIB_MAPFILES): Add libgcc-ia64.ver. + * config/mips/t-iris6 (SHLIB_MKMAP, SHLIB_MAPFILES): New. + * config/sparc/t-sol2 (SHLIB_MKMAP, SHLIB_MAPFILES): New. + (SHLIB_LINK): Add -M. + +2000-10-05 Richard Henderson + + * Makefile.in (LIB2FUNCS): Add _clz. + * libgcc2.c (__ffsdi2): Use count_trailing_zeros. + (__clz_tab): Put in its own unit, non-static. + * libgcc2.h: Always include longlong.h. + + * longlong.h [alpha] (count_leading_zeros): Use cmpbge with + a zero instead of -1. + (count_trailing_zeros): Likewise. + +2000-10-05 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_setcc): Don't swap GT tests + when second op1 is const0_rtx. Validate op0 as a register. + * config/alpha/alpha.md (setcc_internal): Don't allow constants + in the first argument of the compare. + (setcc_swapped_internal): Likewise. + (setne_internal): Likewise. + +2000-10-05 Geoff Keating + + * tree.c (tree_size): New function split out of copy_node. + (make_node): Remove obstack handling. Use tree_size. + (copy_node): Use tree_size. + * tree.h: Prototype tree_size. + +2000-10-05 Richard Henderson + + * diagnostic.c (output_format): Add missing break. + +2000-10-05 Jim Wilson + + * function.c (fixup_var_refs_1, case SET): When gen_move_insn returns a + SEQUENCE, call emit_insn_before, copy PATTERN and REG_NOTES of last + sequence insn to INSN, and delete last sequence insn. + +2000-10-05 Phil Edwards + + * gcc.c (main): Include generated configargs.h header + and use arguments in '-v' output. + +Thu Oct 5 16:16:57 2000 Richard Kenner + + * gcc.c: Move data on prefixes forward in file and reorganize. + (md_exec_prefix, md_startfile_prefix, md_startfile_prefix_1): + Always define, but make null if no value. + (static_specs): Add "md_exec_prefix", "md_startfile_prefix", + and "md_startfile_prefix_1". + (main): Check whether md_exec_prefix and the others are the + null string rather than whether the macro is defined. + +Thu Oct 5 19:04:18 2000 J"orn Rennecke + + * (convert_move): Use zero_extendpsisi2 to do an unsigned extension + from PSImode to SImode. + +2000-10-05 Jakub Jelinek + + * emit-rtl.c (gen_lowpart_common) [REAL_ARITHMETICS]: Fix conversion + from float to integral mode with HOST_BITS_PER_WIDE_INT 64. + * dwarf2out.c (add_const_value_attribute): Divide by 4, not + sizeof(long). + +Thu Oct 5 09:31:31 2000 Richard Kenner + + * fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform + negation in proper type.a + +2000-10-04 Richard Henderson + + * configure.in (enable-shared): New. + * Makefile.in (LIBGCC_DEPS): Depend on EXTRA_PARTS as well. + (libgcc.mk): Pass SHLIB_LINK, SHLIB_LIBS, SHLIB_MULTILIB to mklibgcc. + * mklibgcc.in: Use them to link shared a libgcc. + * config/t-linux (SHLIB_LINK, SHLIB_LIBS): New. + * config/alpha/t-ieee (SHLIB_MULTILIB): New. + * config/mips/t-iris6 (SHLIB_LINK, SHLIB_LIBS): New. + * config/sparc/t-sol2 (SHLIB_LINK, SHLIB_LIBS): New. + + * configure.in (alpha-osf*): Use t-osf and x-osf. + * config/alpha/t-osf: New file. + * config/alpha/t-osf4: New file. + * config/alpha/x-osf: New file. + * config/alpha/x-alpha: Remove file. + +2000-10-04 Will Cohen + + * c-typeck.c (process_init_element): Added warning for zero-length + array. + + * extend.texi (Zero Length): State that static initializers for + zero-length arrays are not allowed. + +Mon Oct 2 14:50:14 MET DST 2000 Jan Hubicka + + * rtlanal.c (single_set_1): Do not require USE and CLOBBERs + to come last. + +2000-10-03 Michael Hayes + + * config/float-c4x.h: New. + * configure.in (c4x-*): Set float_format to c4x. + * configure: Regenerate. + +2000-10-02 Kaveh R. Ghazi + + * configure.in (sparc-*-solaris2*): Disable 32-to-64 cross + compilation for solaris versions 2.7 and greater. + +2000-10-02 Marc Espie + + * config/alpha.h (WORD_SWITCH_TAKES_ARG): add -rpath to default, + instead of redefining from scratch. + +2000-10-02 David O'Brien + + * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Define. + +2000-10-01 Mark Mitchell + + * config/ns32k/genix.h: Remove. + * config/ns32k/x-genix: Likewise. + * config/ns32k/xm-genix.h: Likewise. + * config/fx80: Remove all filee in directory. + * config/pyr: Likewise. + * config/tahoe: Likewise. + * config/gmicro: Likewise. + * config/spur: Likewise. + * configure.in: Remove configury bits for above targets. + * configure: Regenerated. + + * configure.in: Don't configure chill by default. + * configure: Regenerated. + + * c-decl.c (c_expand_body): Don't generate RTL if flag_syntax_only. + (lang_mark_false_label_stack): Remove. + * c-lex.c (init_c_lex): Add file_info_tree as GC root. Allocate + string in GC area. + (mark_splay_tree_node): New function. + (mark_splay_tree): Likewise. + * except.c (mark_eh_status): Only call lang_mark_false_label_stack + if it exists. + * ggc-callbacks.c (lang_mark_false_label_stack): Remove. + * ggc-common.c (lang_mark_false_label_stack): Change type. + * ggc.h (ggc_alloc_string): Add comment. + (ggc_strdup): New function. + +Sat Sep 23 19:10:20 2000 Denis Chertykov + + * config/avr/avr.h (BRANCH_COST): Define as 0. + + * config/pdp11/pdp11.c: #include "tree.h" added. + +2000-09-30 Marek Michalkiewicz + + * config/avr/avr.c (ashlhi3_out, ashlsi3_out, ashrhi3_out, + ashrsi3_out, lshrhi3_out, lshrsi3_out): Optimize more cases + with known shift count. + * config/avr/avr.md (ashlsi3, ashrsi3, lshrsi3): + New alternative for shift count 2 with no scratch register. + (ashlhi3, ashlsi3): Change "cc" attribute from "clobber" to + "set_n" for shift counts 1 and 2. + +2000-09-30 Geoff Keating + + * config/rs6000/rs6000.md (movsi_to_cr): Remove the USE. Calculate + the mask value from the individual SET operations. + (return_internal_si): Move the USE after the RETURN. + (return_internal_di): Likewise. + (return_and_restore_fpregs_si): Likewise. + (return_and_restore_fpregs_di): Likewise. + (return_eh_si): Likewise. + (return_eh_di): Likewise. + * config/rs6000/rs6000.c (mtcrf_operation): Don't look for, + or check, the USE. + (rs6000_emit_prologue): Don't emit the USE for movsi_to_cr. + Don't generate a PARALLEL around a single operation movsi_to_cr. + Generate the RETURN first in any PARALLELs. + + * rtlanal.c (single_set_1): Use fatal_insn to display the + invalid insn. Check for more cases when a USE or CLOBBER occurs + before a SET. + * Makefile.in: Update dependencies for rtlanal.o. + +2000-09-30 Joseph S. Myers + + * i386.c: Move include of "config.h" to before that of . + +2000-09-30 Joseph S. Myers + + * c-tree.texi, contrib.texi, gcc.texi, install.texi, invoke.texi: + Consistently use @email for formatting email addresses. + +2000-09-29 Richard Henderson + + * cse.c (notreg_cost): New argument outer. + (COST): Pass in SET to notreg_cost + (COST_IN): New. + (fold_rtx): Use COST_IN. Prefer constants when costs + are the same. + +2000-09-29 David Edelsohn + + * fixinc/inclhack.def (broken_cabs): Generalize regex. + * fixinc/fixincl.x: Regenerate. + +2000-09-29 Franz Sirl + + * loop.c (check_final_value): A GIV is not replaceable if used + before set. + +Fri Sep 29 10:04:12 2000 Jeffrey A Law (law@cygnus.com) + + * version.c: Bump to gcc-2.97. + +Frs Sep 29 13:37:59 MET DST 2000 Jan Hubicka + + * final.c (final_scan_insn): Remove extra extract_insn call; + Use caching for constrain_operands. + (cleanup_subreg_operands): Use caching for extract_insn. + * recog.c (constrain_operands_cached): New. + * recog.h (constrain_operands_cached): Declare. + * i386.c (ix86_attr_length_immediate_default, + ix86_attr_length_address_default, ix86_agi_dependant): Cache + extract_insn call. + + * recog.c (asm_noperands): Tweak. + (extract_insn): Do not call asm_noperads for non-asm instructions. + +Fri Sep 29 13:20:42 MET DST 2000 Jan Hubicka + + * recog.c (recog_memoized): Rename to recog_memoized_1. + * recog.h (recog_memoized): Rename to recog_memoized_1. + (recog_memoized): New macro. + * rtl.h (single_set): Rename to single_set_1 + (single_set): New macro. + * rtlanal.c (single_set): Rename to single_set_1; expect clobbers + to be last. + + * i386.md (strmovsi_1, strmovhi_1 strmovqi_1): + Do not use match_dup of input operands at outputs. + Use register_operand for memory expression. + (rep_movsi): Put use last, canonicalize. + Use register_operand for memory expression. + (rep_movqi): Put use last. + Use register_operand for memory expression. + (strsetsi_1, strset_hi_1, strsetqi_1): Do not use match_dup + of input operands at outputs. Use register_operand for memory + expression. + (rep_stossi): Put use last; canonicalize; fix match_dup in + the address expression + (rep_stosqi): Likewise. + (memcmp expander): Update calls. + (cmpstrsi_nz_1, cmpstrsi_1, strlensi_1): Avoid match_dups in + the clobbers. + + * i386.md (fp_jcc_3, fp_jcc_4, jp_fcc_5): if_then_else operand is + VOIDmode. + (fp_jcc_4, fp_jcc_3): Refuse unordered comparisons. + +2000-09-28 David O'Brien + + * config/i386/freebsd-aout.h: New, FreeBSD a.out config file. + Contains the old contents of config/i386/freebsd.h + * config/i386/freebsd.h: Now the ELF rather than a.out config file. + Contains the old contents of config/i386/freebsd-elf.h + * config/i386/freebsd-elf.h: Retire this file -- contents moved to + config/i386/freebsd.h. + * configure.in: Adjust for above changes. + * po/POTFILES.in: Likewise. + * po/en_GB.po: Likewise. + * po/gcc.pot: Likewise. + * configure: Rebuilt. + +2000-09-28 Franz Sirl + + * doloop.c (doloop_modify): Prevent delete_insn() from + deleting too much. Prefer loop->top over loop->start as + target for the new JUMP insn. + (doloop_valid_p): Ignore loop with exit_count != 0. + +2000-09-28 Philipp Thomas + + * invoke.texi (i386 Options): Add athlon to table of possible + choices for -mcpu=. + +2000-09-28 Gabriel Dos Reis + + * diagnostic.h (output_clear_message_text): New function. + (output_message_text): New macro. + + * diagnostic.c (clear_text_info): Rename to + output_clear_message_text. + (output_clear): Adjust. + (output_finish): Rename to output_finalize_message. Tweek. + (output_to_stream): Adjust. + +2000-09-28 Neil Booth + + * cpperror.c (_cpp_begin_message): Do the test for suppression + of warnings and pedantic warnings before the "is a warning an + error" tests. + * cppinit.c (cpp_handle_option): Remove surplus \n. + * cpplex.c (ON_REST_ARG): Delete. + (skip_block_comment): Initialize prevc. + (parse_args): Improve error messages. + (maybe_paste_with_next): Use CONTEXT_VARARGS rather + than ON_REST_ARG. + * cpplib.c (cpp_push_buffer): Fix grammar in message. + * cppmain.c (main): Set callbacks for #ident and #pragma + only if no_output option is false. + (do_pragma_implementation): Only call the #pragma handler + if it is set in the cpp_reader structure. + +Wed Sep 27 14:00:07 2000 Donald Lindsay + + * integrate.c (copy_insn_list): if an ignored return value + is being clobbered, skip cloning that into the inline copy. + +2000-09-27 Joseph S. Myers + + * extend.texi, invoke.texi, gcc.texi, install.texi: Consistently + use @uref for formatting URLs. + +2000-09-27 Mark Elbrecht + + * config/i386/djgpp.h (UNIQUE_SECTION): Constify the variables + name and prefix. + +Tue 26-Sep-2000 18:25:38 BST Neil Booth + + * gcc.c (cpp_options): Add spec for -ftabstop=. + (invoke_as): New spec that handles invoking as. + Update specs to handle -save-temps and -traditional. + * ch/lang-specs.h, f/lang-specs.h, java/lang-specs.h: + Use invoke_as. + * cp/lang-specs.h, objc/lang-specs.h: Update to use + invoke_as, and handle -save-temps and -traditional (if + appropriate). + +2000-09-26 Jakub Jelinek + + * config/sparc/sparc.c (sparc_emit_set_const64): Don't abort when + op0 is a SUBREG. + (function_arg_slotno): Accept TImode/CTImode. + * config/sparc/sparc.h (MIN_UNITS_PER_WORD): If IN_LIBGCC2 define + to UNITS_PER_WORD. + +2000-09-26 Michael Hayes + + * flow.c (flow_loop_pre_header_scan): Punt if loop enters + from entry block. + +2000-09-25 Jim Wilson + + * config/ia64/ia64.h (INDEX_REG_CLASS): Define to GENERAL_REGS. + (REGNO_OK_FOR_INDEX_P): Define to REGNO_OK_FOR_BASE_P. + (LEGITIMATE_ADDRESS_DISP): Use LEGITIMATE_ADDRESS_REG. + (REG_OK_FOR_INDEX): Define to REG_OK_FOR_BASE_P. + +Tue 26-Sep-2000 00:16:22 BST Neil Booth + + * cpplex.c (parse_args): Don't set VOID_REST flag. + (CONTEXT_VARARGS): New flag. + (maybe_paste_with_next): Set context earlier in loop. Use + it. Do varargs test with CONTEXT_VARARGS flag. + (push_arg_context): Set CONTEXT_VARARGS flag if we're + pushing an argument context for a varargs argument. + * cpplib.h (VOID_REST): Delete. + * gcc.dg/cpp/vararg1.c: Add test case. + +2000-09-25 Branko Cibej + + * flags.h: Declare warning flag warn_system_headers. + * toplev.c: Define it. + (W_options): Add option -Wsystem-headers. + * diagnostic.c (count_error): Test warn_system_headers. + * invoke.texi: Add description for -Wsystem-headers. + * cpplib.h (cpp_options): New member warn_system_headers. + * cpphash.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Don't test + CPP_IN_SYSTEM_HEADER. + * cpplib.c (do_import, do_pragma_once): Likewise. + * cpperror.c (_cpp_begin_message): Test warn_system_headers + and CPP_IN_SYSTEM_HEADER. + * cppinit.c (handle_option): Recognize -Wsystem_headers. + (print_help): Describe -Wsystem_headers. + * cpplex.c (lex_line): Reorganize condition so that warnings + about C++ comments in system headers can be enabled. Remove + label do_line_comment. + +Mon 25-Sep-2000 23:38:27 BST Neil Booth + + * cpplex.c (save_comment): Only store the initial '/' + now. + (lex_token): Combine handling of the two comment types. + Pass everything but the initial '/' to save_comment. + +Mon 25-Sep-2000 23:31:45 BST Neil Booth + + * cpphash.h (_cpp_digraph_spellings, _cpp_process_directive, + _cpp_can_paste): New library-internal prototypes. + * cpplex.c (dump_param_spelling, output_line_command, + output_token, cpp_scan_buffer, cpp_scan_buffer_nooutput, + cpp_printf, cpp_output_list): Move to cppoutput.c. + (process_directive, can_paste, digraph_spellings): Add _cpp_ prefix. + * cppmacro.c (dump_macro_args, cpp_dump_definition) Move to + cppoutput.c. + * cppoutput.c (dump_macro_args, cpp_dump_definition, output_token, + dump_param_spelling, output_line_command, cpp_scan_buffer, + cpp_scan_buffer_nooutput, cpp_printf, cpp_output_list): Moved + from elsewhere. + * Makefile.in: Add cppoutput.c. + * po/POTFILES.in: Add cppoutput.c. + +2000-09-25 Richard Henderson + + * config/ia64/ia64.c (ia64_print_operand): Define 'e' as 64-n. + * config/ia64/ia64.md (rotrsi3): Allow variable rotates; don't + split until after reload. + (rotlsi3, rotldi3): New. + +2000-09-25 Gabriel Dos Reis + + * diagnostic.c (output_last_position): Define. + (set_real_maximum_length): Tweek. + * diagnostic.h (output_last_position): Declare. + +2000-09-25 Kazu Hirata + + * config/i386/i386.c: Fix formatting. + +2000-09-24 Alan Lehotsky + + * emit-rtl-c (gen_lowpart_common): Accept non-paradoxical SUBREG when + UNITS_PER_WORD is small. + +2000-09-25 Joseph S. Myers + + * c-common.c (format_char_info): Add flags2; update comments. + (print_char_table, scan_char_table, time_char_table): Split some + flags out into flags2. + (check_format_info): Use flags2 for those flags, for identifying + the initial character of a scanf scanset, and for identifying + printf formats where the '0' flag is ignored with precision. + +2000-09-25 Hans-Peter Nilsson + + Changes below marked "here" add TABs on either or both sides, + covering start of line, up to any operand for all noted .*ASM.*_OP + definitions. All callers changed. + * tm.texi: Make documented *_ASM.*_OP:s include spacing + (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, SHARED_SECTION_ASM_OP, + BSS_SECTION_ASM_OP, SHARED_BSS_SECTION_ASM_OP, INIT_SECTION_ASM_OP, + ASM_BYTE_OP, FINI_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP, + ASM_STABS_OP, ASM_STABD_OP, ASM_STABN_OP). + Fix typos in description for LONG_LONG_TYPE_SIZE and + FINI_SECTION_ASM_OP. + * crtstuff.c (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Explain + why these defaults don't have leading spacing. + * dbxout.c (ASM_STABS_OP, ASM_STABN_OP): Here. + * dwarf2out.c (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP, SECTION_ASM_OP, ASM_BYTE_OP): Here. + * dwarfout.c (FILE_ASM_OP, VERSION_ASM_OP, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, ASM_BYTE_OP, + PUSHSECTION_ASM_OP, POPSECTION_ASM_OP): Here. + * defaults.h (ASM_STABD_OP, EH_FRAME_SECTION_ASM_OP): Here. + * varasm.c (ASM_STABS_OP): Here. + * xcoffout.h (ASM_STABS_OP): Here. + * config/elfos.h (IDENT_ASM_OP, ASM_BYTE_OP, SET_ASM_OP, + SKIP_ASM_OP, ALIGN_ASM_OP, COMMON_ASM_OP, LOCAL_ASM_OP, + INT_ASM_OP, ASCII_DATA_ASM_OP, TYPE_ASM_OP, SIZE_ASM_OP, + STRING_ASM_OP): Here. + * config/freebsd.h (IDENT_ASM_OP): Here. + * config/linux-aout.h (SET_ASM_OP): Here. + * config/linux.h (SET_ASM_OP): Here. + * config/lynx.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + INT_ASM_OP): Here. + * config/netbsd.h (TYPE_ASM_OP, SIZE_ASM_OP, SET_ASM_OP): Here. + * config/nextstep.h (EH_FRAME_SECTION_ASM_OP, ALIGN_ASM_OP): Here. + * config/openbsd.h (TYPE_ASM_OP, SIZE_ASM_OP, SET_ASM_OP): Here. + * config/psos.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + INT_ASM_OP): Here. + * config/ptx4.h (IDENT_ASM_OP, ASM_BYTE_OP, SET_ASM_OP, + SKIP_ASM_OP, ALIGN_ASM_OP, COMMON_ASM_OP, LOCAL_ASM_OP, + INT_ASM_OP, ASCII_DATA_ASM_OP, CONST_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, TYPE_ASM_OP, SIZE_ASM_OP STRING_ASM_OP): Here. + * config/svr3.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + CONST_SECTION_ASM_OP, ASM_BYTE_OP): Here. + * config/a29k/udi.h (INT_ASM_OP): Here. + * config/alpha/alpha-interix.h (CONST_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, INT_ASM_OP, + SET_ASM_OP): Here. + * config/alpha/alpha.h (TEXT_SECTION_ASM_OP, + READONLY_DATA_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP, ASM_STABS_OP, ASM_STABN_OP, + ASM_STABD_OP): Here. + * config/alpha/elf.h (IDENT_ASM_OP, SKIP_ASM_OP, ALIGN_ASM_OP, + COMMON_ASM_OP, INT_ASM_OP, ASCII_DATA_ASM_OP, + CONST_SECTION_ASM_OP, CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + BSS_SECTION_ASM_OP, SBSS_SECTION_ASM_OP, SDATA_SECTION_ASM_OP, + INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, TYPE_ASM_OP, + SIZE_ASM_OP, STRING_ASM_OP): Here. + * config/alpha/vms.h (LINK_SECTION_ASM_OP, + READONLY_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, COMMON_ASM_OP): Here. + * config/arc/arc.h (ASM_BYTE_OP, SET_ASM_OP): Here. + (PUSHSECTION_ASM_OP): Define this, not PUSHSECTION_FORMAT. + * config/arm/aof.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): + Here. + * config/arm/aout.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP, SET_ASM_OP): Here. + * config/arm/coff.h (INT_ASM_OP): Here. + * config/arm/conix-elf.h (UNALIGNED_WORD_ASM_OP): Here. + * config/arm/elf.h (TYPE_ASM_OP, SIZE_ASM_OP, INT_ASM_OP): Here. + * config/arm/linux-elf.h (IDENT_ASM_OP, CONST_SECTION_ASM_OP, + INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Here. + * config/arm/unknown-elf.h (UNALIGNED_WORD_ASM_OP): Here. + * config/avr/avr.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + ASM_BYTE_OP, TYPE_ASM_OP, SIZE_ASM_OP, WEAK_ASM_OP, + STRING_ASM_OP): Here. Update documentation copy in comments. + * config/c4x/c4x.h (ASM_STABS_OP, BSS_SECTION_ASM_OP): Here. + * config/clipper/clipper.h (TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP): Here. + * config/clipper/clix.h (BSS_SECTION_ASM_OP, INIT_SECTION_ASM_OP): + Here. + * config/convex/convex.h (TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP): Here. + * config/d30v/d30v.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/fr30/fr30.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/fx80/fx80.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/gmicro/gmicro.h (TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP): Here. + * config/h8300/h8300.h (ASM_WORD_OP): Here. + * config/i370/i370.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/i386/aix386.h (INIT_SECTION_ASM_OP): Here. + * config/i386/bsd.h (ASM_BYTE_OP): Here. + * config/i386/cygwin.h (SET_ASM_OP, INT_ASM_OP): Here. + * config/i386/dgux.h (CONST_SECTION_ASM_OP): Here. + * config/i386/djgpp.h (IDENT_ASM_OP, INT_ASM_OP, SET_ASM_OP): + Here. + * config/i386/freebsd-elf.h (SET_ASM_OP): Here. + * config/i386/freebsd.h (TYPE_ASM_OP, SIZE_ASM_OP, INT_ASM_OP): + Here. + * config/i386/i386-coff.h (CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INT_ASM_OP): Here. + * config/i386/i386-interix.h (STRING_ASM_OP, CONST_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, INT_ASM_OP, + SET_ASM_OP): Here. + * config/i386/i386elf.h (BSS_SECTION_ASM_OP): Here. + * config/i386/netbsd.h (INT_ASM_OP): Here. + * config/i386/openbsd.h (INT_ASM_OP): Here. + * config/i386/osfrose.h (TYPE_ASM_OP, SIZE_ASM_OP, SET_ASM_OP, + IDENT_ASM_OP): Here. + * config/i386/sco5.h (ALIGN_ASM_OP, ASCII_DATA_ASM_OP, + ASM_BYTE_OP, IDENT_ASM_OP, COMMON_ASM_OP, SET_ASM_OP, + LOCAL_ASM_OP, INT_ASM_OP, TYPE_ASM_OP, SIZE_ASM_OP, STRING_ASM_OP, + SKIP_ASM_OP, GLOBAL_ASM_OP): Here. + * config/i386/seq-sysv3.h (SHARED_SECTION_ASM_OP, + SHARED_BSS_SECTION_ASM_OP): Here. + * config/i386/sequent.h (SHARED_SECTION_ASM_OP): Here. + * config/i386/sun386.h (ASM_BYTE_OP, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP): Here. + * config/i386/svr3gas.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + CONST_SECTION_ASM_OP): Here. + * config/i386/sysv3.h (INIT_SECTION_ASM_OP): Here. + * config/i386/unix.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/i860/bsd-gas.h (ASCII_DATA_ASM_OP): Here. + * config/i860/bsd.h (ASCII_DATA_ASM_OP): Here. + * config/i860/fx2800.h (ASM_STABS_OP, ASM_STABN_OP, ASM_STABD_OP, + BSS_ASM_OP): Here, but use trailing spaces. + * config/i860/i860.h (ASM_BYTE_OP, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP): Here. + * config/i860/paragon.h (ASCII_DATA_ASM_OP, BSS_SECTION_ASM_OP): + Here. + * config/i860/sysv3.h (ASCII_DATA_ASM_OP, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, TDESC_SECTION_ASM_OP): Here. + * config/i860/sysv4.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + TDESC_SECTION_ASM_OP): Here. + * config/i960/i960-coff.h (CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INT_ASM_OP): Here. + * config/i960/i960.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/ia64/ia64.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Here. + * config/ia64/sysv4.h (ASM_BYTE_OP, STRING_ASM_OP, SKIP_ASM_OP, + COMMON_ASM_OP, ASCII_DATA_ASM_OP, INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + SDATA_SECTION_ASM_OP, SBSS_SECTION_ASM_OP): Here. + * config/m32r/m32r.h (SCOMMON_ASM_OP): Here. + * config/m68hc11/m68hc11.h (GLOBAL_ASM_OP): Here. + * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP, + SPACE_ASM_OP, ALIGN_ASM_OP, GLOBAL_ASM_OP, SWBEG_ASM_OP, + SET_ASM_OP): Here. + * config/m68k/coff.h (BSS_SECTION_ASM_OP, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INT_ASM_OP): Here. + * config/m68k/crds.h (BSS_SECTION_ASM_OP): Here. + * config/m68k/dpx2.h (ASM_BYTE_OP, GLOBAL_ASM_OP): Here. + * config/m68k/hp320.h (ASCII_DATA_ASM_OP, GLOBAL_ASM_OP): Here. + * config/m68k/linux.h (BSS_SECTION_ASM_OP): Here. + * config/m68k/lynx.h (BSS_SECTION_ASM_OP): Here. + * config/m68k/m68k.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + GLOBAL_ASM_OP): Here. + * config/m68k/m68kelf.h (SWBEG_ASM_OP, BSS_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/m68k/m68kv4.h (BSS_ASM_OP): Here. + * config/m68k/mot3300.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + ASCII_DATA_ASM_OP, SET_ASM_OP, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, GLOBAL_ASM_OP, ASM_BYTE_OP, ALIGN_ASM_OP, + SKIP_ASM_OP): Here. + * config/m68k/newsgas.h (SET_ASM_OP): Here. + * config/m68k/rtemself.h (INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP): Here. + * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP, + SPACE_ASM_OP, ALIGN_ASM_OP, GLOBAL_ASM_OP, SWBEG_ASM_OP, + SET_ASM_OP, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP): Here, + but use trailing spaces. + * config/m68k/tower-as.h (TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, GLOBAL_ASM_OP, INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, CONST_SECTION_ASM_OP, BSS_SECTION_ASM_OP): + Here. + * config/m88k/dgux.h (FINI_SECTION_ASM_OP, INIT_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Here. + * config/m88k/m88k.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + CONST_SECTION_ASM_OP, TDESC_SECTION_ASM_OP, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + IDENT_ASM_OP, FILE_ASM_OP, SECTION_ASM_OP, SET_ASM_OP, + GLOBAL_ASM_OP, ALIGN_ASM_OP, SKIP_ASM_OP, COMMON_ASM_OP, + BSS_ASM_OP, FLOAT_ASM_OP, DOUBLE_ASM_OP, INT_ASM_OP, SHORT_ASM_OP, + CHAR_ASM_OP, ASCII_DATA_ASM_OP, SBSS_ASM_OP, SCOMM_ASM_OP, + SDATA_SECTION_ASM_OP, TYPE_ASM_OP, SIZE_ASM_OP, INTERNAL_ASM_OP, + VERSION_ASM_OP, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + PUSHSECTION_ASM_OP, POPSECTION_ASM_OP, REQUIRES_88110_ASM_OP, + ASM_BYTE_OP): Here. + * config/m88k/openbsd.h (SET_ASM_OP): Here. + * config/m88k/sysv4.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Here. + * config/mcore/mcore-elf.h (UNALIGNED_INT_ASM_OP, + UNALIGNED_SHORT_ASM_OP, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP): Here. + * config/mcore/mcore-pe.h (CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INT_ASM_OP): Here. + * config/mips/elf.h (TYPE_ASM_OP, SIZE_ASM_OP, + BSS_SECTION_ASM_OP): Here. + * config/mips/elf64.h (TYPE_ASM_OP, SIZE_ASM_OP): Here. + * config/mips/iris5.h (ABICALLS_ASM_OP): Here. + * config/mips/iris6.h (TYPE_ASM_OP, SIZE_ASM_OP, + POPSECTION_ASM_OP, BSS_SECTION_ASM_OP, CONST_SECTION_ASM_OP_32, + CONST_SECTION_ASM_OP_64, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP): Here. + * config/mips/mips.c (ABICALLS_ASM_OP): Here. + * config/mips/mips.h (ASM_STABS_OP, ASM_STABN_OP, ASM_STABD_OP): + Here. + * config/mips/netbsd.h (TYPE_ASM_OP, SIZE_ASM_OP, WEAK_ASM_OP): + Here. + * config/mips/osfrose.h (SET_ASM_OP): Here. + * config/mips/sni-svr4.h (ABICALLS_ASM_OP): Here. + * config/ns32k/encore.h (SHARED_SECTION_ASM_OP): Here. + * config/ns32k/merlin.h (SHARED_SECTION_ASM_OP): Here. + * config/ns32k/ns32k.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/ns32k/sequent.h (SHARED_SECTION_ASM_OP): Here. + * config/ns32k/tek6000.h (SHARED_SECTION_ASM_OP): Here. + * config/pa/pa-64.h (INT_ASM_OP, TYPE_ASM_OP, SIZE_ASM_OP): Here. + * config/pa/pa.h (ASM_STABS_OP, ASM_STABN_OP): Here. + * config/pj/pj.h (SET_ASM_OP, BSS_SECTION_ASM_OP): Here. + * config/pyr/pyr.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/romp/romp.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/rs6000/rs6000.h (SET_ASM_OP): Here. + * config/rs6000/sol2.h (ASM_STABN_OP): Here. + * config/rs6000/sysv4.h (SKIP_ASM_OP, LOCAL_ASM_OP, LCOMM_ASM_OP): + Here. + * config/sh/sh.h (SET_ASM_OP, BSS_SECTION_ASM_OP, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP): Here. + * config/sparc/linux.h (COMMON_ASM_OP): Here. + * config/sparc/linux64.h (COMMON_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Here. + * config/sparc/litecoff.h (BSS_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, INT_ASM_OP): Here. + * config/sparc/lynx.h (BSS_SECTION_ASM_OP): Here. + * config/sparc/pbd.h (ASM_INT_OP): Here. + * config/sparc/sp64-elf.h (UNALIGNED_LONGLONG_ASM_OP): Here. + * config/sparc/sparc.h (ASM_BYTE_OP, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, IDENT_ASM_OP): Here. + * config/sparc/sun4gas.h (UNALIGNED_DOUBLE_INT_ASM_OP, + UNALIGNED_INT_ASM_OP, UNALIGNED_SHORT_ASM_OP): Here. + * config/sparc/sysv4.h (STRING_ASM_OP, COMMON_ASM_OP, SKIP_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_SHORT_ASM_OP, PUSHSECTION_ASM_OP, POPSECTION_ASM_OP, + TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP, + CONST_SECTION_ASM_OP, INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, + EH_FRAME_SECTION_ASM_OP): Here. + * config/sparc/vxsim.h (COMMON_ASM_OP): Here. + * config/spur/spur.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/tahoe/tahoe.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/v850/v850.h (SCOMMON_ASM_OP, ZCOMMON_ASM_OP, + TCOMMON_ASM_OP): Here. + * config/vax/vax.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): + Here. + * config/we32k/we32k.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + ASM_BYTE_OP): Here. + +2000-09-25 Richard Henderson + + * expmed.c (store_bit_field): Adjust last change to not consider + any word-sized field naturally aligned. + +2000-09-24 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle + TFmode unordered compares properly. Revalidate integer compare + operands. + (alpha_emit_setcc): New. + (alpha_emit_conditional_move): Revalidate integer compare operands. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (cmpdi): Allow general operands. + (sne): Use alpha_emit_setcc. + (seq, slt, sle, sgt, sge, sltu, sleu, sgtu, sgeu): Likewise. + (sunordered, sordered): New. + +2000-09-24 Richard Henderson + + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.c (call_multiple_values_operation): Remove. + (ia64_expand_call): New. + (ia64_expand_prologue): Emit an alloc if we need extra input + registers. + (ia64_expand_epilogue): New arg sibcall_p; don't emit the return + instruction if true. + (struct reg_flags): Add is_sibcall. + (rtx_needs_barrier): A sibcall does not use CFM et al. Ignore USEs. + (emit_insn_group_barriers): Set flags.is_sibcall. Remove hacks + for CODE_FOR_gr_spill_internal/CODE_FOR_gr_restore_internal. + * config/ia64/ia64.h (PREDICATE_CODES): Update. + * config/ia64/ia64.md (call): Use ia64_expand_call. + (call_value): Likewise. + (sibcall, sibcall_value): New. + (call patterns): Remove extra expanders; tidy. + (sibcall_epilogue): New. + (set_bsp): Remove the extra USE. Put the operand inside the UNSPEC. + +2000-09-24 Richard Henderson + + * emit-rtl.c (gen_lowpart_common): Use trunc_int_for_mode. + + * sibcall.c (skip_pic_restore): New. + (identify_call_return_value): Use it. + +2000-09-24 Mark Mitchell + + * c-tree.texi: Moved here from cp/ir.texi. Documented nested + functions. Generalize to handle both C and C++. + * Makefile.in (c-tree.info): New target. + (info): Add c-tree.info. + +Sun Sep 24 09:15:48 2000 Richard Kenner + + * expr.c (store_field): If BITSIZE is negative, use size of type. + (expand_expr, case COMPONENT_EXPR): Likewise. + +Sun 24-Sep-2000 11:40:23 BST Neil Booth + + * cpplex.c: Update TODO comment. + * cpplib.c (do_error, do_warning): Merge common code of + do_error and do_warning into do_diagnostic. Use it. + (do_diagnostic): New function. + * cpplib.h: Fix comment typo. + +2000-09-24 Joseph S. Myers + + * c-common.c (check_format_info): Warn for a wide character string + used as a non-wide format argument. + +2000-09-24 Joseph S. Myers + + * builtins.def (BUILT_IN_LLABS): Add. + * builtins.c (expand_builtin): Also abort on BUILT_IN_LLABS. + * c-common.c (c_common_nodes_builtins): Create builtin functions + __builtin_llabs, and plain llabs unless no_nonansi_builtins + outside of C99 mode. + (expand_tree_builtin): Handle BUILT_IN_LLABS. + +Sat 23-Sep-2000 22:39:18 BST Neil Booth + + * cpphash.h (CPP_RESERVE, CPP_PUTS_Q, CPP_PUTS, CPP_PUTC_Q, + CPP_PUTC, DUMMY_TOKEN, NO_DUMMY_TOKEN): Delete. + * cpplex.c (_cpp_expand_token_space, _cpp_init_toklist, + _cpp_free_toklist): No need to worry about extra dummy token + at the start of token lists any more. + (trigraph_ok): Only warn outside comments. + (skip_block_comment): Set and clear lexing_comment. + (skip_line_comment): Take a cpp_reader not cpp_buffer. + Set and clear lexing_comment. + (parse_number): Handle leading '.' indicated by pfile->seen_dot. + (check_long_token): Delete. + (lex_percent, lex_dot): New subroutines of lex_token to + handle lexing of '.' and '%' without lookback. + (lex_token): Use lex_dot and lex_percent. + (lex_line): Don't check for LIST_OFFSET. + (_cpp_init_input_buffer): Update for new _cpp_init_toklist. + * cpplib.c (_cpp_parse_assertion): Similarly. + (cpp_push_buffer): Initialize extra_char. + * cpplib.h (LIST_OFFSET): Delete. + (struct cpp_buffer): New member extra_char. + (struct lexer_state): New members lexing_comment and seen_dot. + +2000-09-23 Jason Merrill + + * config/rs6000/x-aix41 (CLIB): Define here. + * config/rs6000/t-aix43: Not here. + * config/rs6000/t-aix41: Or here. Remove. + * configure.in: Don't use it. + +2000-09-22 Jason Merrill + + * configure.in: Add test for HAVE_LD_DWARF_LINKONCE. + * toplev.c: Use it to initialize flag_eliminate_dwarf2dups. + * config.in: Regenerate. + + * configure.in: Fix checks for assembler features when using a + one-tree assembler that has not yet been built. + Fix --disable-threads. + +2000-09-19 Geoff Keating + + * stmt.c (expand_asm_operands): Allow # in constraints. + +2000-09-22 Jason Merrill + + * c-lex.c (skip_white_space): Just treat CRs as horizontal whitespace. + + * dbxout.c (dbxout_symbol_name): Just use DECL_NAME for + function-local names. + +2000-09-22 Brad Lucier + Mark Mitchell + + * toplev.c (warn_disabled_optimization): Declare new warning flag. + * flags.h (warn_disabled_optimization): Add it here. + * gcse.c (gcse_main): Add warning when disabled. + * invoke.texi: Document -Wdisabled-optimization. + +2000-09-21 Jason Merrill + + * dwarf2out.c (add_const_value_attribute): Multiply by length, not 4. + + * dwarf2out.c (tree_add_const_value_attribute): New fn. + (gen_variable_die): Call it for non-definitions. + + * dwarf2out.c (die_struct): Add die_mark field. + (mark_dies, unmark_dies): New fns. + (clear_die_sizes): Remove. + (print_die): Check die_symbol rather than die_offset. + (build_abbrev_table, output_pubnames, output_aranges): Check + die_mark rather than die_offset. + (output_comp_unit): Move calc_die_sizes after build_abbrev_table. + Call mark_dies. + +Thu 21-Sep-2000 18:19:05 BST Neil Booth + + * cppfiles.c (lookup_include_file): Rename to open_file. + Always create a splay tree value, even on syscall failures. + Negative entries indicated by fd == -2. + Re-open files closed in the meantime. + (_cpp_fake_include): Create a negative splay tree entry. + (find_include_file, cpp_read_file): Update for function name + change. + * gcc.gd/cpp/mi4.c: Testcase. + +2000-09-21 Nick Clifton + + * config/arm/t-arm-elf (MULTILIB_DIRNAMES): Enable multilibs for + ARM and THUMB modes. + + * config/mcore/mcore.c: Fix compile time warnings. + * config/mcore/mcore-protos.h: Fix compile time warnings. + +2000-09-20 J. David Anglin + + * configure.in: Correct test of gcc_cv_glibc. + * configure: Rebuilt. + * config.in: Rebuilt. + +2000-09-20 Kaveh R. Ghazi + + * builtins.c (expand_builtin_fputs): Also expand when length!=1. + (expand_builtin): Handle BUILT_IN_FWRITE. + + * builtins.def (BUILT_IN_FWRITE): New entry. + + * c-common.c (c_common_nodes_and_builtins): Declare __builtin_fwrite. + +Wed Sep 20 15:39:14 2000 Richard Kenner + + * gcc.c (modify_target): New variable and struct. + (process_command): Handle MODIFY_TARGET_NAME. + * tm.texi (MODIFY_TARGET_NAME): Add documentation for new macro. + * config/pa/pa.h (MODIFY_TARGET_NAME): New macro. + + * c-decl.c (finish_decl): Add else's to avoid referencing + TYPE_DOMAIN of an ERROR_MARK. + +Wed Sep 20 21:44:31 2000 Denis Chertykov + + * config/avr/avr.c (adjust_insn_length): Adjust lengths of + `reload_in*' insns. + +2000-09-19 Marek Michalkiewicz + + * config/avr/avr.md (neghi2): Add alternative for input and output + operands in different registers, as in negsi2. + (*negsi2): Remove '*' from the name. Use "movw" if available. + +2000-09-19 Jim Wilson + + * config/ia64/crtbegin.asm (__dso_handle): Delete use of + HAVE_GAS_HIDDEN macro. + +Tue 19-Sep-2000 22:38:57 BST Neil Booth + + * cpplex.c (lex_line): Drop the EOF token for unknown + directives in assembler. + +2000-09-19 David Edelsohn + + * configure.in: Allow enable_threads_flag value of "aix". Define + thread_file as "aix" for AIX 4.3 and above. + * configure: Regenerated. + + * gthr-aix.h: New file. + + * rs6000/t-aix43: Replace soft-float multilib with pthread. + Remove 403 processor multilib match. Fix rios2 processor multilib + match. + + * rs6000/aix.h (ASM_DECLARE_FUNCTION_NAME): Use function_section + to return to appropriate csect. + +2000-09-19 Kaveh R. Ghazi + + * builtins.c (is_valid_printf_arglist, expand_builtin_printf): New + functions. + (expand_builtin_fputs): Set `target' parameter for `expand_expr'. + (expand_builtin): Handle BUILT_IN_PUTCHAR, BUILT_IN_PUTS and + BUILT_IN_PRINTF. + + * builtins.def (BUILT_IN_PUTCHAR, BUILT_IN_PUTS, BUILT_IN_PRINTF): + New entries. + + * c-common.c (init_function_format_info): Handle __builtin_printf. + Set `check_function_format_ptr'. + (c_common_nodes_and_builtins): Set `puts_ftype' and + `printf_ftype'. Declare __builtin_putchar, __builtin_puts, + __builtin_printf and printf. + + * tree.c, tree.h (check_function_format_ptr): Declare. + +Tue 19-Sep-2000 18:26:57 BST Neil Booth + + * cppfiles.c (read_include_file): Take no special action for + zero-length files. + +2000-09-19 Bernd Schmidt + + * final.c (insn_current_reference_address): Use INSN_SHUID of seq + rather than that of branch. + (shorten_branches): Don't increment insn_current_address twice. + + Undo most of the Wed Jan 27 23:39:53 1999 patch: + * loop.h (struct induction): Delete members derived, ix and last_use. + (struct loop_ivs): Delete members first_increment_giv and + last_increment_giv. + * loop.c (verify_dominator, find_life_end, cmp_recombine_givs_stats, + recombine_givs): Delete functions. + (find_and_verify_loops): Don't initialize cont_dominator. + (strength_reduce): Lose code to try to find bivs that can be + expressed as givs of another biv, and to convert biv increments + into givs. + Lose loop_scan_start variable, always use loop->scan_start. + Don't call recombine_givs. Don't handle derived givs. + (record_giv): Don't initialize derived and last_use fields. + (biv_eliminiation_giv_has_0_offset): Lose code to handle derived + givs. + * unroll.c (derived_regs): Delete static variable. + (unroll_loop): Don't initialize it. + (copy_loop_body): Lose code to handle derived givs. + (find_splittable_givs): Don't check for givs made from biv + increments. + Don't set derived_regs. + + Fix misapplied earlier patch: + * config/sh/sh.md (floatsisf_ie): Reenable. Remove explicit reference + to fpul. + (floatsisf2): Generate floatsisf_ie by default. + (floatsisf_i4): Conditional on TARGET_SH4. + + (floatsisf2, floatsidf2, extendsfdf2): Also use reg_no_subreg_operand + predicate for the expanders. + +2000-09-19 Richard Henderson + + * config/i386/i386.h (CPP_CPU_SPEC): Define i586 and i686 symbols + in addition to pentium and pentiumpro symbols. + (CPP_CPU_DEFAULT_SPEC): Likewise. + + * c-typeck.c (c_expand_asm_operands): Restore the output tree + after expanding. + + * stmt.c (expand_expr_stmt): Only call warn_if_unused_value + if the tree has side effects. + (warn_if_unused_value): Do not warn about void constructs. + + * c-decl.c (poplevel): Invoke warn_about_unused_variables. + + * unroll.c (copy_loop_body): Update LABEL_NUSES before + calling invert_jump. + +2000-09-18 Geoff Keating + + * combine.c (can_combine_p): Don't substitute an ASM_OPERANDS + into anything. + +2000-09-18 Kaveh R. Ghazi + + * Makefile.in (c-common.o): Depend on diagnostic.h. + + * c-common.c: Include diagnostic.h. + (tfaff): Delete. + (status_warning): New function. + (check_format_info, maybe_read_dollar_number, check_format_types, + finish_dollar_format_checking, check_function_format): Accept a + `status' parameter. All callers changed. + + * c-common.h (check_function_format): Accept a `status' parameter. + + * c-typeck.c: Update call to `check_function_format'. + +2000-09-18 Richard Henderson + + * c-decl.c (c_expand_body): Call mark_varargs before + expand_function_start. + +2000-09-18 Geoff Keating + + * config/rs6000/eabi-cn.asm: Use /**/ to delimit comments, not #. + * config/rs6000/eabi-ci.asm: Likewise. + +2000-09-18 Richard Henderson + + * emit-rtl.c (init_emit_once): Initialize const_tiny_rtx + for BImode. + +2000-09-18 Jim Wilson + + * unroll.c (loop_iterations): Pass increment to extend_for_giv_value + before passing it to fold_rtx_mult_add. + + * unroll.c (final_giv_value): Pass increment through + extend_value_for_giv before passing it to emit_iv_add_mult. + + * function.c (fixup_var_refs_1, case ZERO_EXTRACT): If we have a + paradoxical subreg, then directly substitute the replacement and + return. + +Mon 18-Sep-2000 22:12:44 BST Neil Booth + + * cpp.texi: Update documentation, including some clarifications, + the treatment of various newline combinations, and space between + backslash and newline. + +Mon Sep 18 21:00:47 2000 J"orn Rennecke + + * sdbout.c (PUT_SDB_DEF, PUT_SDB_TAG, PUT_SDB_EPILOGUE_END): + Replace ASM_OUTPUT_LABELREF with assemble_name. + +Mon Sep 18 20:26:50 2000 J"orn Rennecke + + * sh.c (addsubcosts): CONST is not cheap. + (find_barrier): For Sh1, take alignment after jumps into account. + +2000-09-15 Andrew Haley + + * toplev.c (rest_of_compilation): Call purge_hard_subreg_sets to + remove all SETs of SUBREGs of hard registers. + * function.c (purge_hard_subreg_sets): New function. + (purge_single_hard_subreg_set): New function. + * rtl.h: (purge_hard_subreg_sets): New function. + +2000-09-18 Richard Henderson + + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.c (signed_inequality_operator): New. + (ia64_expand_compare): New. + (ia64_register_move_cost): Handle PR_REGS moves. + (ia64_secondary_reload_class): Require a GR when moving to a PR. + (struct reg_write_state): Add written_by_and/or. + (struct reg_flags): Add is_and/or. + (rws_update): Set them. + (rws_access_regno): Test them to allow parallel comparisons. + (rtx_needs_barrier): Recognize parallel comparisons. + (emit_insn_group_barriers): Set prev_insn after a call stop bit. + Call recog_memoized; ignore pred_rel_mutex. + (emit_predicate_relation_info): Don't call find_basic_blocks here. + (ia64_reorg): Do it here instead. + * config/ia64/ia64.h: s/CCmode/BImode/g + (MODES_TIEABLE_P): Don't tie BImode. + (PREFERRED_RELOAD_CLASS): Do not reload operations into AR regs. + (CONST_COSTS): Pick sensible values for CONST_INT based on context. + (RTX_COSTS): Make multiply 4 insns. + (MEMORY_MOVE_COST): New. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md: s/CCmode/BImode/g + (movcci, movbi): New. + (andbi3, andcmbi3, iorbi3, iorcmbi3, one_cmplbi2): New. + (cmpsi_and_0, cmpsi_and_1, cmpsi_andnot_0, cmpsi_andnot_1): New. + (cmpdi_and_0, cmpdi_and_1, cmpdi_andnot_0, cmpdi_andnot_1): New. + (tbit_and_0, tbit_and_1, tbit_and_2, tbit_and_3): New. + (cmpsi_or_0, cmpsi_or_1, cmpsi_orcm_0, cmpsi_orcm_1): New. + (cmpdi_or_0, cmpdi_or_1, cmpdi_orcm_0, cmpdi_orcm_1): New. + (tbit_or_0, tbit_or_1, tbit_or_2, tbit_or_3): New. + (mulsi, muldi): Use xmpy not xma. + (cmpbi): New. + (movcc, movcc_internal): Remove. + (branch expanders): Use ia64_expand_compare. + (setcc expanders): Likewise. + (cmov insns): Use move_operand and ia64_move_ok. + (pred_rel_mutex): Use unspec not unspec_volatile. Prevent the + scheduler from moving it past a use. + * config/ia64/build.hacks: Remove. + +Mon 18-Sep-2000 19:21:35 BST Neil Booth + + * cpphash.h (HASHSTEP): Take character rather than pointer + to character. + (_cpp_check_directive, _cpp_check_linemarker): Update prototypes. + + * cpphash.c (cpp_loookup): Update for new HASHSTEP. + + * cpplex.c (auto_expand_name_space, trigraph_replace, + backslash_start, handle_newline, parse_name, INIT_TOKEN_STR, + IMMED_TOKEN, PREV_TOKEN_TYPE, PUSH_TOKEN, REVISE_TOKEN, + BACKUP_TOKEN, BACKUP_TRIGRAPH, MIGHT_BE_DIRECTIVE, + KNOWN_DIRECTIVE): Delete. + + (handle_newline, check_long_token, skip_escaped_newlines, + unterminated): New functions. + (ACCEPT_CHAR, SAVE_STATE, RESTORE_STATE): New macros. + + (parse_identifier): Was parse_name, new implementation. + (skip_line_comment, skip_block_comment, skip_whitespace, + parse_number, parse_string, trigraph_ok, save_comment, + adjust_column, _cpp_get_line): New implementations. + + (lex_token): New function. Lexes a token at a time, looking + forwards. Contains most of the guts of the old lex_line. + (lex_line): New implementation, using lex_token to obtain + individual tokens. + (cpp_scan_buffer): Use the token's line, not the list's line. + + * cpplib.c (_cpp_check_directive, _cpp_check_linemarker): + New implementations. + (do_assert): Don't bother setting the answer's list's line. + (cpp_push_buffer): Initialize new pfile and read_ahead members + of struct cpp_buffer. + + * cpplib.h (cppchar_t): New typedef. + (struct cpp_buffer): read_ahead, pfile and col_adjust are + new members. + (struct lexer_state): New structure that determines the state + and behavior of the lexer. + (IN_DIRECTIVE, KNOWN_DIRECTIVE): New macros. + (struct cpp_reader): New member "state". Rename + multiline_string_line and multiline_string_column. Delete + col_adjust, in_lex_line members. + (CPP_BUF_COLUMN): Update. + +2000-09-18 Richard Henderson + + * combine.c (simplify_comparison): Shift a NOT out of a single + bit test. + + * combine.c (if_then_else_cond): Canonicalize BImode true to + STORE_FLAG_VALUE. + * explow.c (trunc_int_for_mode): Likewise. + + * combine.c (combine_simplify_rtx): Use gen_unary to distribute + the NOT for De Morgan's rule. + * simplify-rtx.c (simplify_unary_operation): Simplify a BImode NOT + of a comparison to the reverse comparison. + + * combine.c (try_combine): Allow split to create a single insn. + + * machmode.def: Add BImode. Add a column for bitsize. + * machmode.h (DEF_MACHMODE): Adjust for extra column. + (GET_MODE_BITSIZE): Use it. + * rtl.c (DEF_MACHMODE): Adjust for extra column. + (mode_bitsize): New. + (mode_mask_array): Use bitsize. + * combine.c (combine_simplify_rtx): Require inner and outer + modes to match on nonzero_bits optimizations. + +2000-09-18 Bernd Schmidt + + * reload1.c (forget_old_reloads_1): If a hard reg is stored, clear + its entry in spill_reg_store. + * config/sh/lib1funcs.ams (movstr_i4 functions): Always compile in. + * sh.c (reg_no_subreg_operand): New function. + * sh-protos.h (reg_no_subreg_operand): Declare it. + * sh.h (PREDICATE_CODES): Add it. + * sh.md (floatsisf2_i4, floatsidf2_i, extendsfdf2_i4): Use it for + input operand that needs to be in fpul. + (fix_truncsfsi2, fix_truncsfsi2_i4): Use register_operand for output. + * sh.c (find_barrier): Take into account that machine_dependent_reorg + might add new insns. + +2000-09-18 Alexandre Oliva + + * config/sh/sh.c (sh_expand_prologue): Mark GOTaddr2picreg as + MAYBE_DEAD. + (sh_expand_epilogue): Take the PIC register into account when + computing the frame size. + + * config/sh/sh.c (nonpic_symbol_mentioned_p): Check LABEL_REFs. + * config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect + LABEL_REFs with a PIC-safe unspec. + +2000-09-18 Joseph S. Myers + + * c-common.c (check_format_info): Properly save the argument + number and parameter for $ operand number formats in case width + and precision arguments are also used. Allow printf width and + precision arguments to have operand numbers even if none was + specified for the main format, since this is OK for %*.*m. Only + object to missing $ operand number if the format used requires an + argument. + +2000-09-18 Joseph S. Myers + + * c-common.c (format_char_info): Add 'W' flag to comment. + (print_char_table, scan_char_table): Use it. + (check_format_info): Use the 'W' flag to determine whether a + format argument is written into. + +2000-09-18 Joseph S. Myers + + * c-common.c (check_format_types): Reorganize and clean up, + checking earlier for ERROR_MARKs and making cur_type into its + TYPE_MAIN_VARIANT where convenient. + +2000-09-18 Joseph S. Myers + + * gcc.c (cpp_options): Add specs for __STDC_HOSTED__. + +2000-09-18 Bernd Schmidt + + * optabs.c (emit_libcall_block): Set CONST_CALL_P for the call. + + * i386-protos.h (ix86_init_builtins, ix86_expand_builtin): Declare. + * i386.c (struct builtin_description): New. + (bdesc_comi, bdesc_2arg, bdesc_1arg): New arrays. + (mmx_reg_operand): Declare MODE arg as unused. + (ix86_expand_sse_comi, ix86_expand_sse_compare, safe_vector_operand, + ix86_expand_unop1_builtin, ix86_expand_unop_builtin, + ix86_expand_binop_builtin, ix86_expand_store_builtin, + ix86_init_builtins, ix86_expand_builtin): New functions. + * i386.h (ix86_builtins): New enumeration. + (MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): New macros. + * i386.md (attr length_immediate): 0 for mmx/sse types. + (attr prefix_0f): 1 for mmx/sse types. + (setcc_2): Remove "*" so we get gen_setcc_2. + (emms): Account for changed register numbering. Set "memory" attr + to unknown. + (sfence): Set "memory" attr to unknown. + +2000-09-18 Andreas Jaeger + + * configure.in: Define _GNU_SOURCE only when using the GNU C + Library. + * configure: Regenerated. + * config.in: Regenerated. + +2000-09-17 Mark Mitchell + + * cppinit.c (cpp_init): Don't use ANSI prototypes. + * flow.c (flow_dump_loop): Likewise. + (flow_loops_dump): Likewise. + + * c-typeck.c (c_start_case): Fix typo. + +2000-09-17 Joseph S. Myers + + * c-decl.c (grokdeclarator): Don't give a warning about defaulting + to int for plain complex which defaults to complex double. Do + warn about defaulting to complex double if pedantic. Warn about + complex integer types if pedantic. Warn about complex types if + pedantic and not in C99 mode. + * c-typeck.c (build_unary_op): If pedantic, warn about use of ~ + for complex conjugation. + +2000-09-17 Joseph S. Myers + + * contrib.texi: Update my entry. + +Sun Sep 17 18:48:32 2000 Denis Chertykov + + * config/avr/avr.md (mcu_enhanced): New attribute. + (mcu_mega): Likewise. + (extendhisi2): Use mcu_enhanced. + (zero_extendhisi2): Likewise. + (call_insn): Use mcu_enhanced and mcu_mega. + (call_value_insn): Likewise. + (*sbrx_branch): Use mcu_mega. + (*sbrx_and_branchsi): Likewise. + (*sbrx_and_branchhi): Likewise. + (*tablejump_lib): Likewise. + +Sun Sep 17 10:46:17 2000 Richard Kenner + + * alias.c (true_dependence): Allow non-unchanging read to conflict + with unchanging write. + + * expr.c (store_constructor_field): Accept ALIAS_SET arg. + (store_constructor): Pass alias_set to it. + + * c-decl.c (grokdeclarator): Reorder tests to avoid looking at + TYPE_MAIN_VARIANT of ERROR_MARK. + * c-lex.c (readescape): Avoid using printf syntax we don't recognize. + + * simplify-rtx.c (simplify_unary_operation): Add cases + FLOAT_EXTEND and FLOAT_TRUNCATE to ones that return 0. + +2000-09-17 Bernd Schmidt + + * expr.h (emit_library_call, emit_library_call_value): Delete + declarations. + * rtl.h (enum libcall_type): New. + (emit_library_call, emit_library_call_value): Change fn_type arg to + be of type enum libcall_type. + * calls.c: Likewise for the function definitions. Several callers + throughout changed to use the new enumeration appropriately. + (emit_library_call_value_1): Likewise. Put back code to make libcall + blocks of equal form, but only use it for the two new higher + enumeration values. + +2000-09-16 Mark Mitchell + + Convert the C front-end to use function-at-a-time mode. + * c-common.h: Include splay-tree.h. + (C_DECLARED_LABEL_FLAG): New macro. + (struct language_function): Add x_scope_stmt_stack and + x_function_name_declared_p. + (RECHAIN_STMTS): Move definition. + (lang_statement_code_p): Likewise. + (lang_expand_stmt): Likewise. + (lang_expand_decl_stmt): New variable. + (lang_expand_function_end): Likewise. + (current_scope_stmt_stack): New function. + (add_decl_stmt): Likewise. + (add_scope_stmt): Likewise. + (mark_stmt_tree): Likewise. + (struct c_lang_decl): New structure. + (DECL_SAVED_TREE): Define. + (c_mark_lang_decl): New function. + (c_expand_start_cond): Change prototype. + (c_finish_then): New function. + (c_finish_else): Likewise. + (current_function_name_declared): Remove. + (set_current_function_name_declared): Likewise. + (mark_c_language_function): Declare. + (case_compare): Likewise. + (c_add_case_label): Likewise. + (c_expand_expr): Likewise. + (c_safe_from_p): Likewise. + * c-common.c (lang_expand_function_end): New variable. + (struct if_elt): Add if_stmt. + (c_expand_start_cond): Add the if-statement to the statement-tree, + rather than generating RTL. + (c_finish_then): New function. + (c_expand_start_else): Don't generate RTL. + (c_finish_else): New function. + (c_expand_expr_stmt): Don't generate RTL. + (statement_code_p): Add SCOPE_STMT. + (case_compare): New function. + (c_add_case_label): Likewise. + (mark_stmt_tree): Likewise. + (c_mark_lang_decl): Likewise. + (mark_c_language_function): Likewise. + (c_expand_expr): Likewise. + (c_safe_from_p): Likewise. + * c-decl.c (c_stmt_tree): New variable + (c_scope_stmt_stack): Likewise. + (c_function_name_declared_p): Likewise. + (lang_expand_expr_stmt): Remove. + (poplevel): Don't call output_inline_function for nested + functions. + (pushdecl): Don't set DECL_CONTEXT for a local declaration of an + `extern' function. + (redeclaration_error_message): Change means of computing whether + or not a function is nested. + (lookup_label): Don't call label_rtx. + (init_decl_processing): Add more GC roots. + (start_decl): Add DECL_STMTs to the statement-tree, rather than + calling rest_of_decl_compilation. + (finish_decl): Don't call expand_decl. + (store_parm_decls): Begin the statement-tree, but don't generate + RTL. + (finish_function): Tie off the statement-tree. Call c_expand_body + if appropriate. + (c_expand_body): New function. + (push_c_function_context): Save more information. + (pop_c_function_contxt): Likewise. + (copy_lang_decl): Now that we use DECL_LANG_SPECIFIC, copy it. + (lang_mark_tree): Mark it. + (current_stmt_tree): Adjust. + (current_scope_stmt_stack): New function. + (do_case): Remove. + (set_current_name_declared): Likewise. + (c_begin_compound_stmt): Define. + (c_expand_decl_stmt): Likewise. + * c-lang.c: Include rtl.h and expr.h. + (lang_init): Set more language-specific hooks. + * c-lex.c: Include expr.h. + * c-parse.in: Changes throughout to add statements to the + statement-tree, rather than generating RTL after every statement. + * c-semantics.c (lang_expand_decl_stmt): Define. + (add_decl_stmt): New function. + (add_scope_stmt): Likewise. + (finish_stmt_tree): Tweak. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Handle local labels, and call + lang_expand_decl_stmt if required. + (genrtl_for_stmt): Fix line-number handling. + (genrtl_case_label): Handle cleanups. + (genrtl_asm_stmt): Don't call combine_strings. + (genrtl_compound_stmt): Simplify. + (expand_stmt): Handle SCOPE_STMTs. + * c-tree.h (struct lang_decl): New structure. + (C_DECLARED_LABEL_FLAG): Remove. + (c_begin_compound_stmt): Declare. + (c_expand_decl_stmt): Likewise. + (c_expand_start_case): Rename to c_start_case. + (c_finish_case): New function. + * c-typeck.c (start_init): Tweak setting of + constructor_incremental. + (c_expand_asm_operands): Tweak error-handling. Add to the + statement-tree. + (c_expand_return): Add to the statement-tree. + (c_expand_start_case): Rename to ... + (c_start_case): ... this. + (struct c_switch): New type. + (switch_stack): New variable. + (do_case): Simplify. + (c_finish_case): New function. + * dependence.c: Include expr.h. + (enum dependence_type): Change spelling of enumerals. + (check_node_dependence): Adjust. + * expr.h (lang_safe_from_p): Declare. + (safe_from_p): Likewise. + * expr.c (lang_safe_from_p): New variable. + (safe_from_p): Give it external linkage. Use lang_safe_from_p. + * stmt.c (expand_expr_stmt): Avoid clobberring of last_expr_type. + * toplev.c (rest_of_decl_compilation): Robustify. + * tree.c (contains_placeholder_p): Likewise. + * Makefile.in: Update dependencies. + * objc/objc-act.h: Adjust calculation of value for dummy_tree_code. + * objc/objc-act.c: Include rtl.h, expr.h, and c-common.h. + (objc_expand_function_end): New function. + (finish_method_def): Use it. + (init_objc): Initialize more language-specific hooks. + * objc/Make-lang.in: Update dependencies. + +2000-09-16 Geoffrey Keating + + * configure.in: Define macros that affect features before + testing for features. Don't define _XOPEN_SOURCE. + * configure: Regenerated. + * config.in: Regenerated. + +Sat Sep 16 19:42:50 EDT 2000 John Wehle (john@feith.com) + + * rtlanal.c (rtx_varies_p): Volatile asms vary. + (rtx_unstable_p): Restructure code. Volatile asms + are unstable. + +Sat Sep 16 14:35:55 2000 Richard Kenner + + * function.h (no_debugging_symbols): New field. + * integrate.c (save_for_inline): Renamed from save_for_inline_nocopy. + Initialize no_debugging_symbols. + (output_inline_function): Save and restore write_symbols and set from + no_debugging_symbols. + * toplev.c (rest_of_compilation): Call save_for_inline. + * tree.h: Update comment. + + * stor-layout.c (place_field): Don't do anything if field or + its type are ERROR_MARK. + +Sat Sep 16 19:14:00 2000 Laurynas Biveinis + + * cppfiles.c (purge_cache): Use munmap only if MMAP_THRESHOLD defined. + (read_include_file): Ensure inc->mmaped is initialized. + +2000-09-16 Richard Henderson + + * cppiles.c (purge_cache): Use PTR not caddr_t. + +2000-09-16 Hans-Peter Nilsson + + * gcc.c: In description for %{ + + * configure.in: Always define _GNU_SOURCE to make interfaces + visible that were hidden by only defining _GNU_SOURCE. + * configure: Regenerated. + +Sat 16-Sep-2000 08:13:45 BST Neil Booth + + * cpplex.c (push_macro_context): Set an argument's level after + calling parse_args. We could loop infinitely otherwise. + +2000-09-15 Tom Tromey + + * configure, config.in: Rebuilt. + * configure.in: Check for iconv.h. Define _XOPEN_SOURCE. + +2000-09-15 Greg McGary + + * cppmacro.c (check_trad_stringification): Check token + text pointers against limit before dereferencing. + +2000-09-15 Joseph S. Myers + + * c-common.c (format_wanted_type): New structure. + (check_format_types): New function. + (check_format_info): Pass all checking of types of format + arguments, including width and precision arguments, to this new + function. + +2000-09-15 Gerald Pfeifer + + * BUGS: Remove file. + +2000-09-15 Jakub Jelinek + + * config/alpha/alpha.c (override_options): ev6 cache latencies + from Richard Henderson. Don't allow -mmemory-latency=L0. + + * config/alpha/alpha.h (TARGET_CPU_EV5, TARGET_CPU_EV6): Define. + (TARGET_OPTIONS): Add tune=. + (alpha_tune_string): Declare. + * config/alpha/alpha.c (override_options): Add cpu_table. + Use alpha_cpu_string first to set both alpha_cpu and target_flags + and then alpha_tune_string to set alpha_cpu only. + Replace tests for PROCESSOR_EV* with TARGET_CPU_EV* tests. + * config/alpha/elf.h (ASM_FILE_START): Likewise. + * config/alpha/osf.h (ASM_FILE_START): Likewise. + * config/alpha/openbsd.h (ASM_FILE_START): Likewise. + +Fri Sep 15 19:45:55 MET DST 2000 Jan Hubicka + + * i386-protos.h (no_comparison_operator, uno_comparison_operator): + Remove. + (ix86_comparison_operator, ix86_cc_mode): Declare + * i386.h (CCGC, CCGCO): New modes. + (SELECT_CC_MODE): Move offline to .... + * i386.c (ix86_cc_mode): .... here; use new modes. + (ix86_comparison_operator): New. + (fcmov_comparison_operator): Ensure proper mode. + (put_condition_mode): More sanity checking. + (ix86_match_ccmode): Handle new modes. + (ix86_expand_fp_compare): GEU requires CCmode. + (ix86_expand_strlensi_unroll_1): Use emit_cmp_and_jump_insn instead of + doing it by hand. + * i386.md (cmp?i_ccz_1): Remove + (cmp?i_ccno_1): Use ix86_match_ccmode. + (cmp?i_minus_1): New. + (cmpsi_1): New expander. + (cmpqi_ext_1): Use match_ccmode + (cmpqi_ext_3): New expander. + (cmpqi_ext_3_insn): Rename from cmpqi_ext_3. + (cmpqi_ext_4): Use match_ccmode. + (add?i_?): Use match_ccmode. + (add?i_6): New. + (test?i_ccz_1): Remove + (test?i_1): New. + (testsi_ccno_1, testqi_ccz_1, testqi_ext_ccno_0): New expander. + (testqi_ext_0): Use ix86_match_ccmode. + (*xorqi_cc_ext_1): Use ix86_match_ccmode. + (xorqi_cc_ext_1): New expander. + (shift patterns): Use CCGOCmode for all shifts except for sar. + (setcc_?, jcc_?, miv?icc_nic): Use ix86_comparison_operator. + (setcc_3, jcc_3, miv?icc_c): Remove. + +2000-09-15 Will Cohen + + * dwarf2out.c (add_const_value_attribute): Changed array into a + xmalloced object, so it exists after function exit. + (free_AT): Added case for dw_val_class_float to free allocated + memory. + +2000-09-15 Kazu Hirata + + * config/i386/i386.md: Fix a comment typo. + * gcc.c: Fix formatting. + +2000-09-15 Bernd Schmidt + + * optabs.c (emit_libcall_block): If target is a user variable, + copy to a temporary first. + * expr.c (convert_move): When generating a libcall, make a libcall + block. + * calls.c (emit_library_call_value_1): Don't create a libcall + sequence here; our caller will in most cases do it. + + * sh.h (SECONDARY_INPUT_RELOAD_CLASS): Handle moving T, MACL or + MACH into FPUL. + (SECONDARY_OUTPUT_RELOAD_CLASS): Similar case. + * sh.md (reload_outsf): Generate recognizable patterns for + TARGET_SH3E. + (floatsisf2, floatsisf2_ie, floatsisf2_i4, fix_truncsfsi2, + fix_truncsfsi2_i4, fixsfsi, floatsidf2, floatsidf2_i, fix_truncdfsi2, + fix_truncdfsi2_i, extendsfdf2, extendsfdf2_i4, truncdfsf2, + truncdfsf2_i4): Change not to use explicit references to fpul. + (floatsisf2_ie): Remove USE of fpscr. + (floatsisf2): Change default expansion to match this. + (fix_truncsfsi2_i4_2, fix_truncdfsi2_i4 & splitters): Comment out + unused patterns. + +2000-09-15 Richard Henderson + + * expmed.c (store_bit_field): Consider naturally aligned + memory for direct reference. + +2000-09-15 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_unaligned_load): Force all + AND addresses into alias set 0. + (alpha_expand_unaligned_store): Likewise. + (alpha_expand_unaligned_load_words): Likewise. + (alpha_expand_unaligned_store_words): Likewise. + +2000-09-15 Bernd Schmidt + + * config/sh/sh.h (CPP_SPEC): For -m4-nofpu, define __SH4_NOFPU__. + * config/sh/lib1funcs.asm (movstr_i4): Also compile if __SH4_NOFPU__ + is defined. + * config/mips/mips.c (mips_va_arg): Args passed by reference have a + rsize of UNITS_PER_WORD. + +Fri 15-Sep-2000 06:49:07 BST Neil Booth + + * cpplex.c (ON_REST_ARG): Correct the test. + (maybe_paste_with_next): Duplicate a token that fail pasting, + and clear its PASTE_LEFT flag, so that nested pasting attempts + do not occur. + +2000-09-14 Richard Henderson + + * calls.c (precompute_register_parameters): Use COSTS_N_INSNS, not 2. + * cse.c (rtx_cost): Likewise. + * optabls.c (expand_binop): Likewise. + (expand_twoval_binop, prepare_cmp_insn): Likewise. + * regclass.c (copy_cost): Likewise. + * reload1.c (reload_cse_move2add): Likewise. + +2000-09-14 Joseph S. Myers + + * c-parse.in (reswords): Add _Complex. + +2000-09-14 J. David Anglin + + * gcc.1: Delete documentation for -undef preprocessor option. + +2000-09-14 Alexandre Oliva + + * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + STARTFILE_SPEC, ENDFILE_SPEC): Remove define. + * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): + Remove undefine before config/elfos.h. + * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Comment out. + +2000-09-14 Kazu Hirata + + * invoke.texi (H8/300 Options): Add -ms2600. + * config/h8300.c (h8300_init_once): Output an error when -ms2600 + is used without -ms. + * config/h8300.h (TARGET_MAC): New. + (TARGET_SWITCHES): Add -ms2600 and -mno-s2600. + (CONDITIONA_REGISTER_USAGE): Disable the mac register on any + machine other than H8S/2600. + * config/h8300.md: Accept mac instructions on the H8S/2600 instead + of the H8S/2000. + +2000-09-14 Alexandre Oliva , Bernd Schmidt + + * reload.c (find_reloads_address_1): Generate reloads for auto_inc + pseudos that refer to the original pseudos, not only to their + equivalent memory locations. + +Thu Sep 14 12:10:16 2000 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_EXPR): Copy memory attributes + when making new MEM. + + * Makefile.in (LN): Remove duplicate definition. + +2000-09-12 Bernd Schmidt + + From Joern Rennecke: + * local-alloc.c (update_equiv_regs): If there is no REG_EQUAL note + on an insn and function_invariant_p returns nonzero for the source, + add a REG_EQUAL note. + +Thu Sep 14 00:51:57 EDT 2000 John Wehle (john@feith.com) + + * alias.c (memrefs_conflict_p): An ADDRESSOF doesn't + conflict with frame_pointer_rtx. + +2000-09-13 Kazu Hirata + + * loop.c: Fix formatting. + * loop.h: Likewise. + +2000-09-13 Richard Henderson + + * config/ia64/ia64.md (divsf3): New. + (divsf3_internal_lat, divsf3_internal_thr): New. + (divdf3, divdf3_internal_lat, divdf3_internal_thr): New. + (divtf3, divtf3_internal_lat, divtf3_internal_thr): New. + (adddf3_trunc, subdf3_trunc, muldf3_trunc): New. + (madddf4_trunc, msubdf4_trunc, nmuldf3_trunc): New. + (nmadddf4_alts, nmadddf4_trunc): New. + (addtf3_truncsf, addtf3_truncdf, subtf3_truncsf): New. + (subtf3_truncdf, multf3_truncsf, multf3_truncdf): New. + (multf3_truncsf_alts, multf3_truncdf_alts): New. + (maddtf4_truncsf, maddtf4_truncdf, maddtf4_alts_truncdf): New. + (msubtf4_truncsf, msubtf4_truncdf, nmultf3_truncsf): New. + (nmultf3_truncdf, nmaddtf4_truncsf, nmaddtf4_truncdf): New. + (nmaddtf4_truncdf_alts): New. + (recip_approx): Don't predicate. + +2000-09-13 Richard Henderson + + * config/ia64/lib1funcs.asm (__divsf3): Protect fnorm.s with p6. + +2000-09-13 Stephane Carrez + + * flags.h (flag_dump_rtl_in_asm): Declare. + * toplev.c (flag_dump_rtl_in_asm): Define. + (decode_d_option): Set flag_dump_rtl_in_asm and flag_print_asm_name + if -dP is specified. + * rtl.h (print_rtx_head): Declare. + * print-rtl.c (print_rtx_head): Define. + (print_rtx): Print the string pointed to by print_rtx_head + at beginning of each dump line. + (print_rtl): Likewise. + (print_rtl_single): Likewise. + * final.c (final_scan_insn): Dump the insn in the assembly + file for debugging. + * gcc.1: Document -dP option. + * invoke.texi (Debugging Options): Likewise. + +2000-09-13 Stephane Carrez + + * md.texi (Machine Constraints): Document the 68HC11 constraints. + * install.texi (Configurations): Document the 68HC11&68HC12 port. + * invoke.texi (Option Summary, M68hc1x Options): Document the options. + +Tue Sep 12 13:51:13 2000 Denis Chertykov + + * config/avr/avr.h (ASSEMBLER_DIALECT): New macro declared. + * config/avr/avr.md (*movstrqi_insn): Cleanup output template. + (*clrstrqi): Likewise. + (xorhi3,xorsi3,absqi2): Likewise. + (one_cmplhi2,one_cmplsi2): Likewise. + (addsi3): Two stupid constraint alternatives removed. + (extendhisi2): Use `movw' for enhanced avr cores. + (zero_extendhisi2): Likewise. + +Wed Sep 13 02:31:23 EDT 2000 John Wehle (john@feith.com) + + * alias.c (find_base_term): Use frame_pointer_rtx + when handling an ADDRESSOF. + + * cse.c (canon_hash): Handle USE of BLKmode memory. + (cse_insn): Outgoing arguments for a libcall don't + affect any recorded expressions. + +2000-09-12 Tom Tromey + + * configure, config.in: Rebuilt. + * configure.in: Check for iconv, nl_langinfo, langinfo.h. + +2000-09-12 Jakub Jelinek + + * c-lex.c (lex_string): Use charwidth to compute bytemask. + * expr.c (expand_expr): Don't optimize constant array references + initialized with wide string constants. + +2000-09-13 Michael Hayes + + * loop.c (note_set_pseudo_multiple_uses): Correct. + +2000-09-12 Jim Wilson + + * ifcvt.c (noce_process_if_block): If A and B are the same, and no + else block, and X has side-effects, then fail. + +2000-09-12 Greg McGary + + * config/mips/mips-protos.h + (trap_cmp_op, mips_gen_conditional_trap): New func decls. + * config/mips/mips.h (ISA_HAS_COND_TRAP): New macro. + (PREDICATE_CODES): Add "trap_cmp_op". + * config/mips/mips.c + (trap_cmp_op, mips_gen_conditional_trap): New functions. + * config/mips/mips.md (trap, conditional_trap): New patterns. + +2000-09-12 Bernd Schmidt + + * flow.c (try_pre_increment_1): Don't do anything to sets of the stack + pointer. + +2000-09-12 Kaveh R. Ghazi + + * builtins.c (built_in_decls): New array. + (expand_builtin_fputs): New function. + (expand_builtin): Handle BUILT_IN_FPUTC and BUILT_IN_FPUTS. + + * builtins.def (BUILT_IN_FPUTC, BUILT_IN_FPUTS): New members. + + * c-common.c (c_common_nodes_and_builtins): Handle fputc/fputs. + + * tree.h (built_in_decls): New array. + +Tue Sep 12 08:53:57 2000 Jeffrey A Law (law@cygnus.com) + + * convex.md: Use "+" instead of "=" for outputs wrapped in a + STRICT_LOW_PART. + * i370.md, i386.md, ns32k.md, sh.md, vax.md: Likewise. + +2000-09-12 Kazu Hirata + + * haifa-sched.c: Fix formatting. + + * genattrtab.c: Fix formatting. + + * unroll.c: Fix formatting. + +2000-09-12 Bruce Korb + + * fixinc/fixfixes.c: make a type for the fix procedure & use it, + remove obsolete code + * fixinc/fixincl.c: Use PARAMS, not _P_. Add no-op default to switch. + * fixinc/fixincl.tpl: make non-exported arrays static scope + * fixinc/fixincl.x: regenerate + * fixinc/fixlib.h: Use PARAMS, not _P_ + * fixinc/fixtests.c: make a type for the test proc & use it + * fixinc/server.h: Use PARAMS, not _P_ + +2000-09-12 Kaveh R. Ghazi + + * c-typeck.c (process_init_element): Avoid union init warnings on + floating point zero. Don't crash on unions containing structs. + +2000-09-12 Alexandre Oliva + + * config/sh/sh.h (PREDICATE_CODES): Add CONST_DOUBLE to + general_movsrc_operand, and remove CONST_INT from + general_movdst_operand. + +2000-09-12 Bernd Schmidt + + * cse.c (approx_reg_cost): If SMALL_REGISTER_CLASSES, return INT_MAX + if a reference to non-fixed hardreg is seen. Otherwise, count hard + regs with a higher cost. + (preferrable): Deal with cases where either cost or regcost is + MAX_COST. + (cse_insn): Use MAX_COST rather than 10000. Always initialize + regcost values. + (COSTS_N_INSNS): Move definition... + * rtl.h: ...here. + (MAX_COST): New macro. + * loop.c (init_loop): Use COSTS_N_INSNS macro instead of hardcoded + constant. + +2000-09-11 Mark Mitchell + + * c-common.h (genrtl_clear_out_block): Remove. + * c-semantics.c (genrtl_clear_out_block): Remove. + (genrtl_while_stmt): Don't call it. + (genrtl_for_stmt): Likewise. + +2000-09-11 Zack Weinberg + + * cppfiles.c: Move all default-#defines to top of file. + (open_include_file): Replace by lookup_include_file. + (read_with_read, read_file): Merged into read_include_file. + (stack_include_file, purge_cache): New functions. + (close_cached_fd): Delete. + (lookup_include_file, read_include_file, _cpp_pop_file_buffer): + Cache the in-memory buffer, not the file descriptor. + + * cpphash.h (struct include_file): Add buffer, st, refcnt, + mapped fields. + (xcnew): New utility macro. + (DO_NOT_REREAD, NEVER_REREAD): Move up by struct include_file. + * cpplib.h (struct cpp_buffer): Remove mapped field. + +2000-09-11 Zack Weinberg + + * cpplex.c (parse_string): Accept backslash space newline as a + line continuation. + (lex_line): Likewise. + (_cpp_get_token): Remove hard limit on macro nesting. + +2000-09-12 Philipp Thomas + + * aclocal.m4 (AM_WITH_NLS): Don't force use of included gettext. + * configure: Rebuilt. + +2000-09-13 Michael Hayes + + * flow.c (split_block): Fix update of registers live at + end of split block. + +Tue Sep 12 01:51:38 MET DST 2000 Jan Hubicka + + * i386.md (add?i_3, add?i_5): New. + (add?i_4): Rename from add?i_3; Fix compare pattern. + (sub?i_3, xor?i_3, ior?i_3): New. + + * genrecog.c (write_tree): Output code to clear insn_extract cache. + * genattrtab.c (write_attr_case): Gen call to extract_insn_cache + instead of extract_insn and extract_constrain_insn_cache instead of + extract_insn and constrain_operands. + * recog.c (extract_insn_cached, extract_constrain_insn_cached): + New functions. + (extract_insn): Clear which_alternative. + (constrain_operands): Set which_alternative to -1 when failed. + * recog.h (extract_constrain_insn_cached, extract_insn_cached): + Declare. + +2000-09-11 Matthew Hiller + + * config/h8300/h8300.md (movstrictqi): Changed constraint modifier + on operand 0 to '+'. + (movstricthi): Likewise. + +2000-09-12 Michael Hayes + + * loop.h (LOOP_IVS): New macro. + (REG_IV_TYPE, REG_IV_INFO): Add ivs argument. + (struct loop_ivs): New. + (struct loop_info): Add ivs field. + (reg_iv_type, reg_iv_info): Delete prototype. + (reg_biv_class, loop_iv_list): Likewise. + * loop.c (record_biv, find_life_end): Pass loop argument. + (reg_iv_type): Remove global array and use + field in loop_regs structure within loop_ivs structure. + (reg_iv_info, reg_biv_class, loop_iv_list): Likewise. + (first_increment_giv, last_increment_giv): Use entry in + loop_ivs structure. + (record_initial): Pass ivs pointer. + * unroll.c (copy_loop_body, remap_split_bivs): Add loop argument. + +2000-09-12 Michael Hayes + + * loop.h (LOOP_REGS): New macro. + (struct loop_regs): New. + (struct loop_info): Add regs field. + * loop.c (set_in_loop): Remove global array and store + in loop_regs structure as part of loop_info structure. + (n_times_set, may_not_optimize): Likewise. + (reg_single_usage, moved_once): Likewise. + (count_one_set): Add regs argument. + (combine_movables, rtx_equal_for_loop_p, combine_givs): Likewise. + (set_pseudo_multiple_uses): Pass regs pointer. + +2000-09-12 Michael Hayes + + * unroll.c (iteration_info): Subsume into loop_iterations. + * loop.h (loop_info): New field iv. + +2000-09-12 Michael Hayes + + * basic-block.h (LOOP_TREE, LOOP_PRE_HEADER, LOOP_EDGES): New. + (LOOP_EXITS_DOMS, LOOP_ALL): Likewise. + (flow_loops_update): New prototype. + (flow_loops_find): Add flags to prototype. + (struct loop): Add `pre_header_root' and `pre_header_trace' fields. + * flow.c (flow_loop_pre_header_scan): New. + (flow_loop_dump): Dump pre-header root and trace and exit dominators. + (flow_loop_free): Free pre-header root and trace and exit dominators. + (flow_loops_find): New argument flags. + (flow_loops_update): New function. + * toplev.c (rest_of_compilation): Add flag argument to flow_loops_find. + +2000-09-12 Michael Hayes + + * basic-block.h (split_block, update_bb_for_insn): New prototypes. + * flow.c (split_block, update_bb_for_insn): New functions. + +2000-09-11 Richard Henderson + + * cse.c (fold_rtx): Honor NO_FUNCTION_CSE. + +2000-09-11 Richard Henderson + + * config/ia64/ia64-protos.h (fr_nonimmediate_operand): Declare. + * config/ia64/ia64.c (fr_nonimmediate_operand): New. + (ia64_override_options): Prevent optimizing division for both + latency and throughput. + (rtx_needs_barrier): Handle frcpa. + * config/ia64/ia64.h (MASK_INLINE_DIV_LAT): New. + (MASK_INLINE_DIV_THR, TARGET_INLINE_DIV_LAT): New. + (TARGET_INLINE_DIV_THR, TARGET_INLINE_DIV): New. + (TARGET_SWITCHES): Add -minline-divide-min-latency and + -minline-divide-max-throughput. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md (extendsidi2): Remove * from f case. + (zero_extendsidi2): Likewise. Fix typo in f case insn. + (extendsfdf2): Add cases for gr<->fr and fr<->mem. + (extendsftf2): Likewise. + (extenddftf2): Likewise. + (fix_trunctfdi2_alts): New. + (fixuns_trunctfdi2_alts): New. + (madd*4): Rename from madd*3. + (divsi3, modsi3, udivsi3, umodsi3): New. + (divsi3_internal): New. + (divdi3, moddi3, udivdi3, umoddi3): New. + (divdi3_internal_lat, divdi3_internal_thr): New. + (multf3_alts, maddtf4_alts, nmaddtf4_alts): New. + (recip_approx): New. + +2000-09-11 Alexandre Oliva + + * print-rtl.c (debug_call_placeholder_verbose): New variable. + (print_rtx) [CALL_PLACEHOLDER]: Dump all call sequences if it is + set. + * integrate.c (copy_rtx_and_substitute): Don't share + LEAF_REG_REMAPpable registers with the inlined function. Don't + share the function value with calling sequences. + +2000-09-11 Jakub Jelinek + + * c-decl.c (do_case): Fix a typo. + + * combine.c (simplify_if_then_else): Don't convert a == b ? b : a + to a if the comparison is floating mode and not -ffast-math. + * simplify-rtx.c (simplify_ternary_operation): Likewise. + +Mon Sep 11 20:07:48 2000 J"orn Rennecke + + * sh.h (INITIALIZE_TRAMPOLINE): Remove stray call to + gen_ic_invalidate_line. + +2000-09-11 Philip Blundell + + * config/arm/elf.h (SUBTARGET_CPP_SPEC): Don't define `arm_elf'. + +Mon Sep 11 10:48:41 2000 Ulrich Drepper + + * install.texi (LANGUAGES): Update to include new languages. + * INSTALL: Rebuilt. + +2000-09-11 DJ Delorie + + * gcc.c (main): Don't warn about unused -B prefixes + (unused_prefix_warnings): remove + +2000-09-11 Kazu Hirata + + * final.c: Fix formatting. + + * integrate.c: Fix formatting. + +2000-09-11 Geoff Keating + + * alias.c (memrefs_conflict_p): An ADDRESSOF does conflict, sorry. + +2000-09-11 Bernd Schmidt + + * reload.c (regno_clobbered_p): Fix thinko in previous change. + +2000-09-10 Stephane Carrez + + * gcc.1: Document 68hc11 specific options. + +2000-09-10 Geoff Keating + + * config/rs6000/sysv4.h (MASK_LONG_DOUBLE_128): Define. + (TARGET_LONG_DOUBLE_128): Define. + (SUBTARGET_SWITCHES): Add -mlong-double-64 and -mlong-double-128. + (LONG_DOUBLE_TYPE_SIZE): Redefine. + (MAX_LONG_DOUBLE_TYPE_SIZE): Define. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define depending on definition + of __LONG_DOUBLE_128__. + (CPP_SYSV_SPEC): Define __LONG_DOUBLE_128__ if -mlong-double-128 + passed. + (CPP_LONGDOUBLE_DEFAULT_SPEC): Define. + (CPP_SYSV_DEFAULT_SPEC): Define. + (SUBTARGET_EXTRA_SPECS): Add cpp_longdouble_default. + (INIT_TARGET_OPTABS): Define. + + * config/rs6000/aix.h (RS6000_ITRUNC): Moved from rs6000.h. + (RS6000_UITRUNC): Likewise. + (INIT_TARGET_OPTABS): New macro. + * config/rs6000/rs6000.c (rs6000_trunc_used): Delete. + (trunc_defined): Delete. + (output_prolog): Don't output .extern definitions for fp->int + conversion routines, ASM_OUTPUT_EXTERNAL_LIBCALL will do it. + * config/rs6000/rs6000.h (rs6000_trunc_used): Delete. + (trunc_defined): Delete. + (RS6000_ITRUNC): Moved to aix.h. + (RS6000_UITRUNC): Likewise. + * config/rs6000/rs6000.md (fix_truncdfsi2): Fail if it would + only emit a libcall. + (fixuns_truncdfsi2): Delete. + (trunc_call): Delete. + (trunc_call_rtl): Delete. + +2000-09-10 Zack Weinberg + + * varasm.c (make_decl_rtl): Restore leading star on + DECL_ASSEMBLER_NAME set for decls with an asmspec. + +2000-09-10 Zack Weinberg + + * c-pragma.c (handle_pragma_pack): Correct parsing logic so it + won't give a spurious error for '#pragma pack()'. Simplify + control flow for readability. 'reset' action is not necessary. + +2000-09-10 Zack Weinberg + + * defaults.h: Provide default definitions for: CHAR_TYPE_SIZE, + SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, + LONG_LONG_TYPE_SIZE, WCHAR_TYPE_SIZE, FLOAT_TYPE_SIZE, + DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE, and WCHAR_UNSIGNED. + + * cppexp.c, dwarfout.c, dwarf2out.c, emit-rtl.c, final.c, optabs.c, + profile.c, sdbout.c, tradcif.y, tree.c: + Include defaults.h if not already included. + Don't define the above macros. + + * Makefile.in: Update dependencies. + +2000-09-10 Mark Mitchell + + * c-common.h (add_stmt): Change prototype. + (RECHAIN_STMTS): New macro. + (CASE_LABEL_DECL): Likewise. + (genrtl_case_label): Change prototype. + (c_expand_start_case): Remove prototype. + (build_case_label): Change prototype. + (decl_constant_value): Declare. + * c-common.c (check_case_value): Handle C++'s extensions to C + semantics. + * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL + field. + * c-parse.in (stmt): Adjust handling of return statements and case + laels. + * c-semantics.c (add_stmt): Return the new statement. + (genrtl_return_stmt): Take the RETURN_STMT as input, not the + returned expression. Directly generate RTL, rather than calling + c_expand_return. + (genrtl_switch_stmt): Don't call c_expand_start_case. + (build_case_label): Take the LABEL_DECL as input, too. + (genrtl_case_label): Just call add_case_node. + (expand_stmt): Adjust calls to genrtl_return_stmt and + genrtl_case_label. + * c-tree.h (c_expand_start_case): Declare. + * c-typeck.c (decl_constant_value): Give it external linkage. + (c_expand_return): Don't call expand_return or expand_null_return; + use genrtl_return_stmt instead. + * stmt.c (struct nesting): Remove num_ranges field. + (add_case_node): Give it external linkage. + (expand_start_case): Don't set num_ranges. + (expand_start_case_dummy): Don't clear it. + (pushcase): Rely on add_case_node to handle `default' labels. + (add_case_node): Handle `default' labels. + * tree.c (tree_int_cst_compare): New function. + * tree.h (tree_int_cst_compare): Declare. + (add_case_node): Likewise. + +2000-09-10 Richard Henderson + + * c-parse.in: Revert last change. + (init_reswords): Do not enter disabled keywords into the ridpointers + table, modulo objc weirdness. + (_yylex): Return the canonical spelling for a keyword. + +2000-09-10 Philip Blundell + + * config/arm/arm.h (CPP_ISA_SPEC): Don't define `arm' or `thumb'. + * config/arm/linux-elf.h (CPP_PREDEFINES): Don't define `__arm__'. + +Sun Sep 10 14:30:28 EDT 2000 John Wehle (john@feith.com) + + * alias.c (find_base_term): Handle ADDRESSOF. + (memrefs_conflict_p): An ADDRESSOF doesn't conflict. + +2000-09-10 Denis Chertykov + + * genoutput.c (output_insn_data): Translate to \n\ while + outputting templates with many lines. + +2000-09-10 Stephane Carrez + + * libgcc2.h: Use LONG_LONG_TYPE_SIZE instead of MIN_UNITS_PER_WORD + to decide whether 64-bit support must be generated. + +2000-09-10 Richard Henderson + + * c-parse.in (asm patterns): Fix volatile check. + +2000-09-09 Kaveh R. Ghazi + + * cppmacro.c (check_trad_stringification): New function. + (save_expansion): If -Wtraditional, warn about stringification of + macro arguments. + +2000-09-11 Michael Hayes + + * loop.h (struct loop_mem_info): Move from loop.c + (struct loop_info): Add fields store_mems, mems, mems_idx, + mems_allocated, unknown_address_altered, + unknown_constant_address_altered, num_mem_sets, and + first_loop_store_insn. + + * loop.c (loop_store_mems): Replace with field in loop_info struct. + (loop_mems, loop_mems_idx, loop_mems_allocated): Likewise. + (unknown_address_altered, unknown_constant_address_altered): Likewise. + (num_mem_sets): Likewise. + (replace_loop_mems, replace_loop_regs): New. + (struct loop_replace_args): New. + (load_mems): Use replace_loop_mems. + (try_copy_prop): Use replace_loop_regs. + (replace_loop_reg, replace_loop_mem): Use loop_replace_args structure. + +2000-09-09 Stephane Carrez + + * configure.in: Recognize m6811-elf and m6812-elf. + * configure: Regenerate. + +2000-09-09 Geoff Keating + + * recog.c (validate_replace_rtx_1): Correct MODE parameter in call + to operand_subword. + +2000-09-10 Michael Hayes + + * loop.c (struct movables): New. + (num_movables): Move into struct movables. + (the_movables): Change type to struct movables. + (ignore_some_movables): Change struct movable arg to struct movables. + (force_movables, combine_movables, regs_match_p): Likewise. + (rtx_equal_for_loop_p, move_movables): Likewise. + (scan_loop): Change movables to be of type struct movables. + Replace last_movable with field in movables structure. + +2000-09-08 Zack Weinberg + + * c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS. + (init_pragma): Avoid warning if pfile happens to be unused. + * c-pragma.h: Never define HANDLE_GENERIC_PRAGMAS. Never + define init_pragma to nothing. Always prototype + init_pragma. Prototype dispatch_pragma if !USE_CPPLIB. + + * c-lex.c (process_directive): Always call dispatch_pragma. + Initialize entering_c_header to 0. + +2000-09-08 Stephane Carrez + + * config/m68hc11/m68hc11.md: New file, machine description for + 68HC11 & 68HC12. + * config/m68hc11/m68hc11.h: New file, definitions for 68HC11 & 68HC12. + * config/m68hc11/m68hc11.c: New file, functions for 68HC11 & 68HC12. + * config/m68hc11/m68hc12.h: New file, definitions for 68HC12. + * config/m68hc11/m68hc11-protos.h: New file. + * config/m68hc11/m68hc11-crt0.S: New file, startup code. + * config/m68hc11/t-m68hc11-gas: New file, makefile fragment. + * config/m68hc11/xm-m68hc11.h: New file, target defs. + * config/m68hc11/larith.asm: New file, libgcc routines. + +2000-09-08 Stephane Carrez + + * Makefile.in (DPBIT_FUNCS): Add _usi_to_df. + (FPBIT_FUNCS): Add _usi_to_sf. + * config/fp-bit.c (usi_to_float): New function. + * config/fp-bit.h (L_usi_to_sf, L_usi_to_df): Define. + (usi_to_float): Add appropriate #define. + +2000-09-08 Bernd Schmidt + + * i386-protos.h (sse_comparison_operator, mmx_reg_operand): Declare + new functions. + * i386.c (sse_comparison_operator, mmx_reg_operand): New functions. + * i386.md (attr "type"): Add sse and mmx types. + (attr "memory"): Handle them without a crash. + (movsi_1, movdi_2): Allow MMX regs. + (movdi splits): Don't split moves involving MMX regs. + (setcc_4): Remove '*' from pattern name so we get a gen_setcc4. + (movv4sf_internal, movv4si_internal, movv8qi_internal, + movv4hi_internal, movv2si_internal, movv8qi, movv4hi, movv2si, + movv4sf, movv4si, pushv4sf, pushv4si, pushv8qi, pushv4hi, pushv2si, + sse_movaps, sse_movups, sse_movmskps, mmx_pmovmskb, mmx_maskmovq, + sse_movntv4sf, sse_movntdi, sse_movhlps, sse_movlhps, sse_movhps, + sse_movlps, sse_loadss, sse_movss, sse_storess, sse_shufps, + addv4sf3, vmaddv4sf3, subv4sf3, vmsubv4sf3, mulv4sf3, vmmulv4sf3, + divv4sf3, vmdivv4sf3, rcpv4sf2, vmrcpv4sf2, rsqrtv4sf2, vmrsqrtv4sf2, + sqrtv4sf2, vmsqrtv4sf2, sse_andti3, sse_nandti3, sse_iorti3, + sse_xorti3, maskcmpv4sf3, maskncmpv4sf3, vmmaskcmpv4sf3, + vmmaskncmpv4sf3, sse_comi, sse_ucomi, sse_unpckhps, sse_unpcklps, + smaxv4sf3, vmsmaxv4sf3, sminv4sf3, vmsminv4sf3, cvtpi2ps, cvtps2pi, + cvttps2pi, cvtsi2ss, cvtss2si, cvttss2si, addv8qi3, addv4hi3, + addv2si3, ssaddv8qi3, ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, + subv4hi3, subv2si3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3, + mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd, + mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3, mmx_uavgv8qi3, + mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pextrw, mmx_pshufw, + eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3, gtv2si3, umaxv8qi3, + smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3, ashrv2si3, lshrv4hi3, + lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3, mmx_ashldi3, + mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw, + mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd, + mmx_punpckldq, emms, sfence, ldmxcsr, prefetch, stmxcsr, sse_clrti, + mmx_clrdi): New patterns. + +2000-09-08 Richard Earnshaw + + * arm.c: Don't include tm.h directly. + +Fri Sep 8 14:34:56 MET DST 2000 Jan Hubicka + + * recog.c (validate_replace_rtx_1): Fix confusion about equality + testing; simplify subregs of constants and nested subregs. + +2000-09-08 Alexandre Oliva + + * config/sh/sh.md (symPLT_label2reg): Use operand3 for PIC reg. + +2000-09-08 Bernd Schmidt + + * combine.c (combine_simplify_rtx): Try to simplify VEC_SELECT of a + VEC_CONCAT. + * rtl.texi (description of USE): Add note about possible pitfalls + with this rtx. + From Richard Henderson: + * reload1.c (choose_reload_regs): Compute need_mode properly. + +2000-09-07 Richard Henderson + + * config/ia64/lib1funcs.asm (__divsi3): Use .s1 for frcpa. + (__modsi3, __umodsi3): Likewise. + (__udivsi3): Likewise. Normalize the TFmode values. + +2000-09-07 Geoff Keating + + * config/rs6000/sol-c0.c (_start): Declare `termfunc' parameter + with a prototype. + * config/rs6000/rs6000.h (RS6000_ARG_SIZE): Use cast to suppress + warning. + +Fri Sep 8 03:26:38 2000 J"orn Rennecke + + * sh.md (cmpeqsi_ior_t, cmpeqsi_and_t): Remove. + (cmpeqdi_t): Add output pattern. + (cmpeqdi_t+1): Don't split when not optimizing. + Restore proper splitting operation. + +2000-09-07 Richard Henderson + + * c-lex.c (process_directive): If not HANDLE_GENERIC_PRAGMAS, + do not call dispatch_pragma. + +2000-09-07 Jim Wilson + + * reload.c (push_reload): Use CLASS_CANNOT_CHANGE_MODE_P in addition + to CLASS_CANNOT_CHANGE_MODE. + * config/ia64/ia64.h (CLASS_CANNOT_CHANGE_MODE_P): True only if the + mode classes are different. + +2000-09-07 Zack Weinberg + + * cpplib.h (struct cpp_options): Add user_label_prefix member, + left out of commit which removed cppulp.c. + +2000-09-07 Richard Henderson + + * bb-reorder.c (fixup_reorder_chain): Add jump in new block + after switch for CASE_DROPS_THROUGH. + +2000-09-07 Richard Henderson + + * loop.c (strength_reduce): Call check_ext_dependant_givs. + Properly extend the biv initial value for the giv. + (record_biv): Zero ext_dependant. + (record_giv): New argument ext_val. Update all callers. + (general_induction_var): Likewise. + (consec_sets_giv): Likewise. + (simplify_giv_expr): Likewise. Fill in ext_val if we find + a sign-extend, zero-extend, or truncate. + (combine_givs_p): Make sure modes are compatible. + (check_ext_dependant_givs): New. + (extend_value_for_giv): New. + * loop.h (struct induction): Add ext_dependant. + * unroll.c (iteration_info): Extend the biv initial value for the giv. + (find_splittable_givs): Likewise. + (final_giv_value): Likewise. + +2000-09-07 Zack Weinberg + + * c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if + REGISTER_TARGET_PRAGMAS is defined. Duplicate some + definitions from cpplib.h. + * cpplib.h: Don't typedef struct cpp_reader if c-pragma.h has + already done it. + * tm.texi: Document HANDLE_PRAGMA as no longer supported. Add + documentation for REGISTER_TARGET_PRAGMAS. + + * c-lex.c: Include cpplib.h before c-pragma.h. Define a + default-pragma callback to implement -Wunknown-pragmas if + USE_CPPLIB. + * c-parse.in: Move all includes to top of file. + * c-pragma.c: Include cpplib.h before c-pragma.h. Include + tm_p.h. + (dispatch_pragma): Put the namespace in the -Wunknown-pragmas + warning. + (init_pragma): If REGISTER_TARGET_PRAGMAS is defined, call it. + + * arm.h, arm-protos.h, arm.c, + c4x.h, c4x-protos.h, c4x.c, + h8300.h, h8300-protos.h, h8300.c, + i370.h, i370-protos.h, i370.c, + i960.h, i960-protos.h, i960.c, + sh.h, sh-protos.h, sh.c, + v850.h, v850-protos.h, v850.c: Convert HANDLE_PRAGMA-based + pragmata scheme to use REGISTER_TARGET_PRAGMAS instead. + + * d30v.h: Don't mention HANDLE_PRAGMA in comment. Add + multiple include guard. + * i370.md (untyped_call): Use GEN_CALL. + (umodsi3): Remove unused variable. + * sh/elf.h: Don't undef HANDLE_SYSV_PRAGMA. + * v850.c (output_move_single, output_move_double): Constify + return value. + (print_operand): Constify a char *. + * v850.h (struct small_memory_info): Constify name member. + +2000-09-07 Kazu Hirata + + * config/h8300.h: Fix comment typos. + * config/h8300/h8300.md: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + +Thu 07-Sep-2000 21:29:00 BST Neil Booth + + * Makefile.in: Remove references to cppulp.{c,o}. + * cppinit.c (initialize_builtins, cpp_start_read, + cpp_handle_option): Update to use cpp_options structure. + * cppulp.c: Remove. + +2000-09-07 Joseph S. Myers + + * c-common.c (time_char_table): Allow %#b and %#h. + +2000-09-07 Herman A.J. ten Brugge + + * reorg.c (find_end_label): If the basic block reorder pass moves the + return insn to some other place try to locate it again and put our + end_of_function_label there. + * reorg.c (relax_delay_slots): Check if find_end_label created a + new label that invalidates the current optimazation. + +2000-09-07 Catherine Moore + + * unroll.c (unroll_loop): Check for unconditional jumps + to loop continuation. Delete if n_iterations is 1. + (ujump_to_loop_cont): New routine. + +2000-09-07 Bernd Schmidt + + * rtl.c (class_narrowest_mode): Add entries for MODE_VECTOR_INT and + MODE_VECTOR_FLOAT. + * reload.c (regno_clobbered_p): Accept new arg, MODE, and use it + to handle multiword modes correctly. All callers and the declaration + changed. + +2000-09-06 Mark Mitchell + + * c-common.h (prep_stmt): Declare. + (lang_expand_stmt): Likewise. + * c-decl.c (lang_expand_stmt): Remove. + * c-semantics.c (lang_expand_stmt): Define. + (prep_stmt): New function. + (expand_stmt): Handle common statement types here. + +2000-09-07 Niibe Yutaka , Kaz Kojima , Alexandre Oliva + + * configure.in (sh-*-linux*): Added. + * configure: Rebuilt. + * config/sh/t-linux: New file. + * config/sh/sh.h (USERMODE_BIT): Define. + (TARGET_USERMODE): Likewise. + (TARGET_SWITCHES): New switches for the bits above. + (INITIALIZE_TRAMPOLINE): Call __ic_invalidate in USERMODE. + * config/sh/linux.h: New file. + * config/sh/lib1funcs.asm (GLOBAL): Don't prefix symbols with + underscore on linux. + (L_sdivsi3, L_udivsi3): Define for linux. + (L_ic_invalidate): Define. + * invoke.texi (SH Options): Document -musermode. + +2000-09-07 Alexandre Oliva + + * config/sh/sh.h (OVERRIDE_OPTIONS): Don't disable function + CSE unless generating PIC. + + * config/sh/sh.md (symPLT_label2reg): Force the initialization of + the PIC register. + +2000-09-06 H.J. Lu (hjl@gnu.org) + + * Makefile.in (clean_s1): Depend on stage_b. + (clean_s2): Depend on stage_d. Don't remove $(VOL_FILES) in + stage2. They are used for "make compare". + +2000-09-06 Mark Mitchell + + Move statement-tree facilities from C++ to C front-end. + * c-common.h (c_tree_index): Add CTI_VOID_ZERO. + (void_zero_node): New macro. + (struct stmt_tree_s): New type. + (stmt_tree): New typedef. + (struct language_function): New type. + (last_tree): New macro. + (last_expr_type): Likewise. + (walk_tree_fn): New typedef. + (current_stmt_tree): New function. + (begin_stmt_tree): Likewise. + (add_stmt): Likewise. + (finish_stmt_tree): Likewise. + (statement_code_p): Likewise. + (lang_statement_code_p): New variable. + (walk_stmt_tree): New function. + (STMT_IS_FULL_EXPR_P): New macro. + * c-common.c (lang_statement_code_p): New variable. + (c_common_nodes_and_builtins): Initialize void_zero_node. + (statement_code_p): New function. + (walk_stmt_tree): Likewise. + * c-decl.c (language_function): Rename to ... + (c_language_function): ... this. Include language_function. + (push_c_function_context): Adjust accordingly. + (pop_c_function_context): Likewise. + (mark_c_function_context): Likewise. + (current_stmt_tree): Define. + * c-semantics.c (begin_stmt_tree): New function. + (add_stmt): Likewise. + (prune_unused_decls): Likewise. + (finish_stmt_tree): Likewise. + +2000-09-06 Herman A.J. ten Brugge + + * flow.c (insn_dead_p): Detect dead memory stores with auto increments. + +2000-09-06 Kazu Hirata + + * calls.c: Fix formatting. + +2000-09-06 Graham Stott + + * config/i386/i386.h (ADDRESS_COST): Fix typo. + +2000-09-06 Zack Weinberg + + Integrated preprocessor. + + * Makefile.in: Remove all references to c-parse.gperf, + c-gperf.h, and c-parse.h. Remove -d from yacc command line + generating c-parse.c. Update dependencies. + * c-parse.gperf, c-gperf.h: Delete. + + * c-common.c: Don't define parse_options, cpp_token, yy_cur, + yy_lim, or yy_get_token. Don't define get_directive_line if + USE_CPPLIB. + * c-common.h: Add multiple include guard. Define RID values + for every keyword in C, C++, and Objective-C. Put all the + modifiers first. + (struct c_fileinfo, get_fileinfo, dump_time_statistics): New. + * c-decl.c (c_decode_option): Handle -lang-objc here. + (print_lang_identifier): Handle C_IS_RESERVED_WORD case. + (grokdeclarator): Adjust for new RID scheme. + (extract_interface_info): New stub. + * c-lang.c: Don't declare yy_cur or parse_options. + (lang_init_options): Call cpp_init. Don't call + cpp_options_init. + (lang_init): Don't call check_newline if USE_CPPLIB. + + * c-lex.c: Don't include c-parse.h. Do include timevar.h. + Elide lots of unnecessary code if USE_CPPLIB. Delete code + rendered unnecessary by new architecture. Move routines not + shared with C++ to c-parse.in. Maintain a local idea of the + line number. Handle C++ as well as C. + [USE_CPPLIB]: Declare and register callbacks for #ident and + for entering/leaving files. + (init_c_lex, c_lex): Are now the entry points to this file. + (check_newline): Break out directive handling to + process_directive. + (read_ucs, is_extended_char, utf8_extend_token): Moved here + from C++ front end. + (readescape, parse_float): Overhaul. + (lex_number, lex_string, lex_charconst): Break out of c_lex + (n'ee yylex). + (get_fileinfo, update_header_times, dump_one_header, + dump_time_statistics): New and/or moved here from C++. + Support per-file data needed by C++ and per-header timing + statistics (C++ only, at the moment). + * c-lex.h: Update prototypes. Add multiple include guard. + * c-tree.h (struct lang_identifier): Add rid_code field. + (C_IS_RESERVED_WORD, C_RID_CODE): New. + + * c-parse.in: Include c-pragma.h. Remove unnecesary calls to + reinit_parse_for_function and/or position_after_white_space. + (save_filename, save_lineno): Look ahead before saving. + (label -> identifier ':'): Save file and line before shifting ':'. + (reservedwords): No need to call get_identifier. + (init_parse, finish_parse, yyerror, yylex, yyprint, + make_pointer_declarator): Are now here for C/ObjC. + (rid_to_yy): Conversion table from RID constants to Yacc codes. + + * c-pragma.c: Rewrite parsing logic to fit with cpplib's + #pragma registry. Provide dummy implementation of that + interface if !USE_CPPLIB. + * c-pragma.h: Update to match. + + * flags.h: Add multiple include guard. + (flag_detailed_statistics): Moved here from C++. + * toplev.c: Define flag_detailed_statistics. + + * gcc.c (C specs): Use %(trad_capable_cpp) for -E|-M|-MM case + #if USE_CPPLIB. + * timevar.def (TV_CPP, TV_LEX): New. + * timevar.h: Add multiple include guard. + + * objc/lang-specs.h: Use %(trad_capable_cpp) for -E|-M|-MM case + #if USE_CPPLIB. + * objc/objc-act.c: Don't mention yy_cur or parse_options. + Initialize cpplib properly. Force lineno to 0 after first + call to check_newline. Don't handle -lang-objc here. + Move forget_protocol_qualifiers and remember_protocol_qualifiers here. + +2000-09-06 David Edelsohn + + * rs6000.md: Correct function unit definitions for cr_logical and + mtjmpr. + (sCOND): Additionally fail for sgt, slt, sge, sle if !TARGET_POWER + and use portable method for >=0 and floating point >=. Remove + associated matchers. + +2000-09-06 Mark Mitchell + + * extend.texi: Mark named return value extension as deprecated. + +2000-09-06 Geoff Keating + + * config/rs6000/rs6000.c (rs6000_reverse_condition): Return + the result. + +2000-09-06 Gabriel Dos Reis + + * toplev.c (display_help): Fix thinko in documentation. + + * diagnostic.h (output_buffer::indent_skip): New fields. + (output_indentation): New macro. + + * diagnostic.c (output_indent): New function. + (output_set_prefix, clear_diagnostic_info): Use. + (output_emit_prefix): Predict future indentation. + +2000-09-06 DJ Delorie + + * Makefile.in (stage_*): add more dependencies to ensure parallel + builds build correctly + +2000-09-06 Manfred Hollstein + + * Makefile.in (bootstrap-lean): Depend on bootstrap-lean_g, + not bootstrap-lean_f. + +2000-09-06 Andreas Schwab + + * mklibgcc.in: Emit rule for libgcc-stage-start. + * Makefile.in (stage1-start, stage2-start, stage3-start, + stage4-start): Don't handle libgcc here, use libgcc.mk instead. + +2000-09-06 Bernd Schmidt + + * local-alloc.c (local_alloc): Ignore CLASS_LIKELY_SPILLED. + (update_equiv_regs): Likewise, except for the mn10200 kludge. + (combine_regs): Likewise. + + * Makefile.in (cse.o): Depend on $(BASIC_BLOCK_H). + * cse.c: Include "basic-block.h". + (struct table_elt): New field REGCOST. + (CHEAP_REG): Delete macro. + (COST): Return 0 for REGs. + (approx_reg_cost_1, approx_reg_cost, preferrable): New functions. + (notreg_cost): Return 0 for appropriate SUBREGs. + (COSTS_N_INSNS): Return N * 2. + (rtx_cost): Return 0 for REGs, and use cost of nested rtx for cheap + SUBREGs. + (CHEAPER): Use new function preferrable. + (insert): Initialize REGCOST member. + (find_best_addr): Use approx_reg_cost for estimation of register + usage. + (cse_insn): Likewise. + * loop.c (iv_add_mult_cost): New function. + (add_cost, shift_cost, mult_cost): Delete variables. + (init_loop): Don't initialize add_cost; reduce copy_cost by half. + (strength_reduce): Use iv_add_mult_cost instead of fixed add_cost. + Make code that detects autoinc opportunities slightly less optimistic. + (simplify_giv_expr): If expression contains other reg that is also a + giv, only increment benefit if this is the only use of that reg. + (consec_sets_giv): Take that change into account. + (combine_givs): Slightly more verbose output. + + * i386.h (RTX_COSTS): For MULT, return true cost of multiplication, + not the cost of an equivalent shift. + * sh-protos.h (addsubcosts): Declare. + * sh.c (addsubcosts): New function. + * sh.h (CONST_COSTS): If CONST_OK_FOR_I, then return 0. + (RTX_COSTS): Tweak. Use addsubcosts. + (ADDRESS_COST): Return higher cost for reg+reg addressing. + +2000-09-06 Geoff Keating + + * config/rs6000/rs6000.c (validate_condition_mode): New function. + (branch_comparison_operator): Call validate_condition_mode to + abort rather than returning 0. + (branch_positive_comparison_operator): New function. + (scc_comparison_operator): Call validate_condition_mode to abort + rather than returning 0. + (ccr_bit): Call validate_condition_mode. Update for + new branch scheme. + (print_operand): Delete %C modifier. Update %E case + to use EQ bit not SO bit. + (rs6000_reverse_condition): New function. + (rs6000_generate_compare): New function. + (rs6000_emit_sCOND): New function. + (rs6000_emit_cbranch): New function. + (output_cbranch): The length of a long branch insn is + now only 8 bytes. Add validate_condition_mode. Use + rs6000_reverse_condition. Remove cror generation. + + * config/rs6000/rs6000.h: Update comments. + (PREDICATE_CODES): Add new predicate. Update codes used + by branch_comparison_operator and scc_comparison_operator. + * config/rs6000/rs6000-protos.h: Add prototypes for + new external functions. + * config/rs6000/rs6000.md: Add new scheduling parameters + for cr_logical instructions. Change length of branch + instructions. + (bCOND patterns): Call rs6000_emit_cbranch. + (sCOND patterns): Call rs6000_emit_sCOND. + (branch patterns): Change lengths to 4. + (cr logical patterns): New. + +2000-09-06 Richard Henderson + + * config/i386/i386.md (call_pop): Fix test for setting + current_function_uses_pic_offset_table. + (call, call_value_pop, call_value): Likewise. + +2000-09-06 Zack Weinberg + + * timevar.c (timevar_add): Delete. + (timevar_get): Also count time since the selected timer was + last updated. Do not examine the timevar stack if the + selected timer is standalone. + +2000-09-05 J. David Anglin + + * gthr-dce.h (__gthread_objc_mutex_deallocate): Free mutex->backend. + +2000-09-05 Jason Merrill + + * c-decl.c (finish_incomplete_decl): Don't call complete_array_type + for 'extern' arrays. + +2000-09-05 Richard Henderson + + * config/ia64/lib1func.asm (__divtf3): Rebundle for Itanium. + Eliminate final copy from non-trapping case. + (__divdf3, __divsf3): Likewise. + +2000-09-05 Richard Henderson + + * config/ia64/ia64.md (mulhi3): Fix typo last change. + * config/ia64/lib1func.asm (__divdi3, __udivdi3, __umodsi3): Likewise. + +2000-09-03 Donn Terry , Laurynas Biveinis + + * Makefile.in: Restructure bootstrap stages to allow clean + restart after failure. + +2000-09-05 Richard Henderson + + * config/ia64.md (movsi and movdi patterns): Allow moves from + 8-bit constants to AR registers. + +2000-09-05 Richard Henderson + + * config/ia64/ia64.md (mulhi3): New. + +2000-09-05 Richard Henderson + + * config/ia64/ia64.h (INIT_TARGET_OPTABS): Remove. + * config/ia64/lib1funcs.asm (__divdi3): Update from Intel IA-64 + Optimization Guide, minimum latency alternative. + (__moddi3, __udivdi3, __umoddi3): Likewise. + (__divsi3, __modsi3, __udivsi3, __umodsi3): Likewise. + +2000-09-05 Bruce Korb + + * fixinc/fixincl.c (load_file): always read header files + with sizes that are a multiple of the page size. + & use libiberty's getpagesize for determining that. + +2000-09-05 Alexandre Oliva + + * gcse.c (hash_string_1): Add prototype. + * cse.c (canon_hash_string): Likewise. + +2000-09-04 Craig Newell + + * gcc.c: Undefine "__WCHAR_TYPE__" before redefining it. + +2000-09-04 Andreas Schwab + + * Makefile.in (STAGESTUFF): Remove libgcc. + (stage1-start, stage2-start, stage3-start): Copy the contents of + the libgcc directory explicitly. + (mostlyclean): Clean libgcc. + +2000-09-04 Andrew Haley + + * dwarf2out.c: (stack_adjust_offset): New prototype. + +Wed Jan 1 00:23:59 MET 1997 Jan Hubicka + + * combine.c (make_extraction): Fix rtx_cost comparison to + match the comment. + +Wed Jan 1 00:17:32 MET 1997 Jan Hubicka + + * i386.md (pushsi2, pushhi2, pophi2, swapsf, swapdf, + umulsi3_highpart, smulsi3_highpart, testqi_ccno_1, xorqi_ext_1): + Add '*' to insn pattern name. + +2000-09-04 Jakub Jelinek + + * cpplex.c (ON_REST_ARG): Check VAR_ARGS flag of current context, + use posn - 1 to index into tokens array. + (maybe_paste_with_next): Adjust caller. + +2000-09-03 Geoff Keating + + * invoke.texi: Document the -mvxworks option for rs6000 ELF. + + * config/rs6000/rs6000.h: Update various comments about XER_REGNO. + (REGNO_REG_CLASS): Use symbolic register + names. + +2000-09-03 Richard Earnshaw + + * arm.c (final_prescan_insn): If the form of a jump insn isn't + recognized, don't try to conditionally execute it. + +Sun Sep 3 13:10:56 2000 Denis Chertykov + + * config/avr/avr.md ("*tablejump_lib"): New pattern. + (call_value_insn): Right length claculation. + (call_insn): Likewise. + +2000-09-02 Marek Michalkiewicz + + * config/avr/avr-protos.h, config/avr/avr.c (unique_section, + gas_output_limited_string, gas_output_ascii, output_movqi, + output_movhi, out_movqi_r_mr, out_movqi_mr_r, out_movhi_r_mr, + out_movhi_mr_r, out_movsi_r_mr, out_movsi_mr_r, output_movsisf, + out_tstsi, out_tsthi, ret_cond_branch, ashlqi3_out, ashlhi3_out, + ashlsi3_out, ashrqi3_out, ashrhi3_out, ashrsi3_out, lshrqi3_out, + lshrhi3_out, lshrsi3_out, output_reload_inhi, output_reload_insisf, + out_shift_with_cnt, ptrreg_to_str, cond_string, encode_section_info): + Add "const" as needed to remove warnings. + + * config/avr/avr.c (avr_override_options, avr_init_once, + function_prologue, function_epilogue, frame_pointer_required_p, + class_likely_spilled_p, order_regs_for_local_alloc, + avr_address_cost, avr_ret_register): Use K&R style arguments. + (initial_elimination_offset, gas_output_limited_string): + Remove ATTRIBUTE_UNUSED from the used arguments. + (output_mov*, out_mov*_r_mr, out_mov*_mr_r, output_reload_insisf): + Use local variables src, dest, base to access operands[]. + Rename reg_dest to reg_src if that's what it is. + (output_movhi, output_movsisf): Optimize loading 8-bit immediate + constants to LD_REGS if reg_was_0. + (output_reload_insisf): Change arg 3 to insn length and set it. + (out_movhi_r_mr, out_movhi_mr_r): Use in/out for more efficient + access to 16-bit I/O register pairs. + (avr_address_cost): Lower cost for the above case. + (out_tsthi): Use "or" (faster) instead of "sbiw" if the operand + may be clobbered, also for LD_REGS. + (adjust_insn_length): Correct insn length for iorhi3 and iorsi3 + with a CONST_INT. + + * config/avr/avr.h (PTRDIFF_TYPE): Make signed. + + * config/avr/avr.md: Change all uses of the TEST_HARD_REG_CLASS + macro to test_hard_reg_class function. + (*movsi, *movsf): Change "cc" attribute from "clobber" to "none" + for loading immediate constants to LD_REGS. + (andsi3, cmphi, cmpsi): Add return statements to avoid warnings. + + +Sat Sep 2 13:58:23 2000 Marek Michalkiewicz + + * config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__ + * config/avr/libgcc.S: Lost part of the previous patch. + +2000-08-31 J. David Anglin + + * gthr-dce.h (__gthread_objc_mutex_allocate): Create a pthread_mutex_t + object before calling pthread_mutex_init. + +2000-09-02 Alexandre Oliva + + * config/sh/t-elf, config/sh/crt1.asm, config/sh/crti.asm, + config/sh/crtn.asm: New files. + * config/sh/t-sh (EXTRA_MULTILIB_PARTS): Set. + (crt1.o, crti.o, crtn.o): New targets. + * configure.in [sh-*-elf*, sh-*-rtemself*] (tmake_file): Added + sh/t-elf. + * configure: Rebuilt. + * config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, + STARTFILE_SPEC, ENDFILE_SPEC, CRT_CALL_STATIC_FUNCTION): Define. + * config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): + Undefine for config/elfos.h to redefine. + (STARTFILE_SPEC, ENDFILE_SPEC): Redefine after config/elfos.h. + +2000-09-02 Alexandre Oliva , Niibe Yutaka , Kaz Kojima + + * config/sh/sh-protos.h (nonpic_symbol_mentioned_p, + legitimize_pic_address, output_pic_addr_const): Declare. + * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Fix PIC register. + (PREFERGOT_BIT, TARGET_PREFERGOT): Likewise. + (TARGET_SWITCHES): New switch -mprefergot. + (OVERRIDE_OPTIONS): Set flag_no_function_cse unless -mprefergot. + (PIC_OFFSET_TABLE_REGNUM): Define. + (GOT_SYMBOL_TABLE): Likewise. + (LEGITIMIZE_ADDRESS): Use legitimize_pic_address. + (ENCODE_SECTION_INFO): Define. + (FINALIZE_PIC): New macros. + (LEGITIMATE_PIC_OPERAND_P, SYMBOLIC_CONST_P): New macro. + (ASM_OUTPUT_INT, ASM_OUTPUT_SHORT): Use output_pic_addr_const. + * config/sh/sh.c (print_operand_address): Use output_pic_addr_const. + (prepare_move_operands): Call emit_pic_move or + emit_pic_const_move if appropriate. + (output_far_jump): For PIC, use braf and output long offset. + (machine_dependent_reorg): + (sh_expand_prologue): Save and initialize the PIC register. + (sh_expand_epilogue): Restore it. + (initial_elimination_offset): Account for it. + (nonpic_symbol_mentioned_p): New function. + (legitimize_pic_address): Likewise. + (output_pic_addr_const): Likewise. + * config/sh/sh.md (calli_pcrel, call_valuei_pcrel): New insns. + (call, call_value): Use them. + (GOTaddr2picreg, sym_label2reg, symGOT2reg, symGOTOFF2reg, + symPLT_label2reg): New expands. + * invoke.texi (SH Options): Document -mprefergot. + +2000-09-01 Alexandre Oliva + + * rtl.h (ASM_OPERANDS_INPUT_CONSTRAINT_EXP): New macro. + * gcse.c (hash_string_1): New function. + (hash_expr_1) : Disregard filename and line number. + (expr_equiv_p) : Likewise. + * cse.c (rtx_cost): Don't increase the cost of ASM_OPERANDS. + (canon_hash_string): New function. + (canon_hash) : Disregard filename and line number. + (exp_equiv_p) : Likewise. + (fold_rtx): Use ASM_OPERANDS accessor macros. + * emit-rtl.c (copy_insn_1): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * stmt.c (expand_asm_operands): Likewise. Give an + ASM_OPERANDS rtx the mode of the output reg being set from it. + +2000-09-01 Fred Fish + + * fix-header.c (write_rbrac): Add putc and getc to list of + functions to protect against prior definition as a macro. + +2000-09-01 Joseph S. Myers + + * c-common.h (enum c_tree_index): Add CTI_C_SIZE_TYPE. + (c_size_type_node): Define. + * c-decl.c (init_decl_processing): Initialize c_size_type_node. + * c-common.c (enum format_lengths, enum format_std_version, + format_length_info, format_type_detail, BADLEN, NOLENGTHS, + format_kind_info, printf_length_specs, scanf_length_specs, T89_I, + T99_I, T89_L, T99_LL, TEX_LL, T89_S, T89_UI, T99_UI, T89_UL, + T99_ULL, TEX_ULL, T89_US, T89_F, T99_F, T89_D, T99_D, T89_LD, + T99_LD, T89_C, T99_SC, T99_UC, T89_V, T94_W, TEX_W, T94_WI, + TEX_WI, T99_ST, T99_SST, T99_PD, T99_UPD, T99_IM, T99_UIM, + format_types): Define. + (format_char_info, print_char_table, scan_char_table, + time_char_table): Rearrange for new organization of information + about format length modifiers and standard versions. + (T_ST): Redefine to use c_size_type_node. + (check_format_info): Obtain information about length modifiers and + standard versions from tables. Adjust warning message wordings. + Use the name from the user's program for `ll' and `hh' length + modifiers in warning messages. Use more informative names for + wanted types where available (for wchar_t, wint_t, size_t, signed + size_t, ptrdiff_t, unsigned ptrdiff_t, intmax_t and uintmax_t). + +2000-09-01 Jim Wilson + + * calls.c (emit_call_1): Add REG_NORETURN note to call if ECF_NORETURN. + * combine.c (distribute_notes): Handle REG_NORETURN. + * rtl.c (reg_note_name): Add REG_NORETURN. + * rtl.h (enum reg_note): Likewise. + + * config/ia64/ia64-protos.h (emit_safe_across_calls): Renamed from + ia64_file_start. + * config/ia64/ia64.c (emit_safe_across_calls): Likewise. + (rtx_needs_barrier): Handle unspec_volatile 8 and 9. + (emit_predicate_relation_info): Handle conditional calls with + REG_NORETURN. + * config/ia64/ia64.h (ASM_FILE_START): Call emit_safe_across_calls + instead of ia64_file_start. + * config/ia64/sysv4.h (ASM_FILE_START): Likewise. + * config/ia64/ia64.md (safe_across_calls_all, + save_across_calls_normal): New patterns. + + * loop.c (check_final_value): Check for biv use before checking for + giv use. Check for both biv and giv uses. Always set last_giv_use + if there is a giv use. + +2000-09-01 Richard Henderson + + * config/ia64/ia64.md (mulsi3): Use grfr_register_operand. + (madddi3): Likewise. + (maddsi3): New. + +Fri Sep 1 10:59:47 2000 Richard Kenner + + * expr.c (clear_storage): Don't use emit_move_insn unless + either BLKmode or proper size. + (store_constructor): Don't call clear_storage if REG of wrong size. + + * flow.c (init_propagate_block_info): Don't mark frame dead at end + of function if returns wiht stack pointer depressed. + +2000-09-01 Andrew Haley + + * dwarf2out.c (stack_adjust_offset): New function. + (dwarf2out_stack_adjust): Break out stack adjust logic into + new stack_adjust_offset function. Look inside parallels and + sequences for stack adjustments. + +2000-08-31 Jeff Law + + * arm.md: Use no_new_pseudos to determine when it is safe + to create new pseudo registers. + + * arm.c (legitimize_pic_address): Use no_new_pseudos to determine + when we can safely allocate new registers. + +2000-08-31 Geoffrey Keating + + * stmt.c (expand_asm_operands): Twiddle generating_concat_p + so that CONCATs are not generated for ASMs. + * emit-rtl.c (gen_reg_rtx): Don't generate CONCATs when + not generating_concat_p. + * function.c (pop_function_context_from): Reset + generating_concat_p. + (prepare_function_start): Likewise. + * rtl.c (generating_concat_p): Define. + * rtl.h (generating_concat_p): Declare. + * toplev.c (rest_of_compilation): No CONCATs after RTL generation. + +2000-08-22 Philipp Thomas + Masanobu Yuhara + + * gmicro.h (TARGET_SWITCHES): Add descriptions and mark them + for translation. + +2000-08-30 Greg McGary + + * Makefile.in (fixinc.sh): Pass CC, CFLAGS and LDFLAGS to mkfixinc.sh + * fixinc/Makefile.in (fixincl): Pass $(LDFLAGS) to $(CC). + * fixinc/mkfixinc.sh: Pass $CC, $CFLAGS and $LDFLAGS to $MAKE. + +2000-08-30 Greg McGary + + * tree.h (struct tree_int_cst): Wrap low and high in a sub-struct. + (TREE_INT_CST_LOW, TREE_INT_CST_HIGH): Access through sub-struct. + (TREE_INT_CST): New macro. + * varasm.c (const_hash, compare_constant_1, record_constant_1): + Use new macro TREE_INT_CST. + +Wed 30-Aug-2000 23:18:59 BST Neil Booth + + * contrib.texi: Add self. + +2000-08-30 Alexandre Oliva + + * config/sh/sh.md (cmpeqsi_ior_t, cmpeqsi_and_t): New insns. + (cmpeqdi_t splitter): Use cmpeqsi_and_t instead of emitting jumps + and labels. + +2000-08-30 J. David Anglin + + * fixinc/gnu-regex.c: Don't define `const'. + +Tue Aug 29 22:09:59 2000 Richard Kenner + + * expr.c (store_constructor): Allow variable bounds of array type. + (expand_expr): Don't blow up if type is ERROR_MARK. + * varasm.c (output_constructor): Don't access lower bound of array + type unless need it if index is supplied (so it can be a variable + if no index is supplied). + Use tree_low_cst; use HOST_WIDE_INT for sizes; change BITPOS to POS. + Other minor cleanups. + +2000-08-29 J. David Anglin + + * Makefile.in: Revamp handling of cflags to allow different WARN_CFLAGS + for compilations in stage 1 and subsequent stages, respectively. + * configure.in (vax): Add compiler-dependent CFLAGS for stage 1. + * configure: Rebuilt. + * x-vax, x-vax-gcc: Deleted. + +2000-08-29 Zack Weinberg + + * c-common.c (declare_function_name): Use func_id_node, + function_id_node, and pretty_function_id_node. Do not make + __func__ visible at file scope. + * c-common.h (c_tree_index): Add CTI_FUNCTION_ID, + CTI_PRETTY_FUNCTION_ID, and CTI_FUNC_ID. + (function_id_node, pretty_function_id_node, func_id_node): New + macros. + * c-decl.c (init_decl_processing): Initialize function_id_node, + pretty_function_id_node, and func_id_node. + (c_make_fname_decl): Correct comment. + + * tree.h (struct tree_identifier): Constify pointer member. + + * c-decl.c (pushdecl, implicit_decl_warning): Constify a char *. + * c-pragma.h (struct weak_syms): Constify name and value members. + (add_weak): Constify arguments. + + * calls.c (special_function_p): Constify a char *. + (expand_call): Remove variable which is initialized and then + never used. + * dependence.c (struct def_use, struct induction, struct subscript): + Constify 'variable' member. + (get_low_bound, have_induction_variable): Constify char * argument. + (find_induction_variable): Add braces to avoid dangling else. + (classify_dependence): Constify char * arrays. + * profile.c (output_func_start_profiler): Constify a char *. + * stor-layout.c (finalize_record_size): Constify a char *. + * tree.c (is_attribute_p): Constify a char *. + * varasm.c (add_weak, remove_from_pending_weak_list): Constify argument. + + * varasm.c (make_function_rtl, make_decl_rtl): Rearrange code + for comprehensibility. Do not call get_identifier if we did + not change the DECL_ASSEMBLER_NAME of the decl. Use alloca to + create temporary string constants, not ggc_alloc_string. No + need to copy result of ASM_FORMAT_PRIVATE_NAME. Use const + char * to hold IDENTIFIER_POINTERs. + +2000-08-29 Richard Henderson + + * config/ia64/ia64.md (muldi3): Use grfr_register_operand + for the inputs. + +2000-08-29 Richard Henderson + + * reload.c (push_secondary_reload): Allow class == reload_class + if we're using a reload_in/out pattern. + + * config/ia64/ia64.md (reload_inti): Use a TImode scratch. Use + the half that does not conflict with the reload register. + (reload_outti): Likewise. + +2000-08-29 Kazu Hirata + + * reload.c: Fix formatting. + + * stmt.c: Fix formatting. + + * gcc.c: Fix formatting. + +2000-08-29 Zack Weinberg + + * flags.h (time_report, mem_report): New global flags. + * toplev.c: Define time_report and mem_report. + (f_options): Add -ftime-report and -fmem-report. + (compile_file): Turn on time_report if quiet_flag is off. + Call ggc_print_statistics at very end if mem_report is on. + * timevar.c (TIMEVAR_ENABLE): Examine time_report, not quiet_flag. + + * ggc-common.c (ggc_print_statistics): Rename to + ggc_print_common_statistics; all callers changed. Scale + quantities above 10K to kilobytes and above 10M to megabytes. + * ggc-page.c (ggc_page_print_statistics): Rename to + ggc_print_statistics. Report memory consumed by internal data + structures for each allocation bucket. Scale quantities above + 10K to kilobytes and above 10M to megabytes. + * ggc-simple.c: Prototype debug_ggc_tree to avoid warning. + Cast PTR_KEY(p) to unsigned long in fprintf call to avoid warning. + Define tally_leaves always. + (ggc_print_statistics): New function. + * ggc.h: Adjust for renamed functions. + +Wed Aug 30 00:11:42 2000 Denis Chertykov + + * config/avr/avr.md ("*movsf","*movsi"): Pass NULL to + output_movsisf instead of which_alternative. + + * config/avr/avr.c (output_reload_inhi): Check for NULL ponter. + +Tue Aug 29 22:29:58 2000 Denis Chertykov & Marek Michalkiewicz + + * config/avr/avr-protos.h: (avr_output_ascii) Removed. + (avr_progmem_p): New prototype. + (output_movsisf): Prototype declaration changed. + (output_movqi): New prototype. + (output_movhi): New prototype. + (call_insn_operand): Likewise. + (final_prescan_insn): Likewise. + (avr_simplify_comparision_p): Likewise. + (avr_normalize_condition): Likewise. + (compare_eq_p): Likewise. + (out_shift_with_cnt): Likewise. + (const_int_pow2_p): Likewise. + (output_reload_inhi): Prototype declaration changed. + + * config/avr/avr.c: (debug_hard_reg_set): Prototype declared. + (ldi_reg_rtx): New. rtx for r31. + (avr_init_stack): Initialize as "__stack". + (function_prologue): Use it. + Replace all TARGET_ENHANCED with AVR_ENHANCED. + (avr_mcu_name): Initialize as "avr2". + (avr_enhanced_p, avr_mega_p): New variables. + (mcu_types, avr_override_options): Handle all known MCU types. + Also handle avr1 (only preprocess, assemble and link). + (print_operand): Using of `%K' in output template removed. + (out_movqi_r_mr): Optimized. + (out_movhi_r_mr): Likewise. + (output_movqi): New function. + (output_movhi): Likewise. + (out_movsi_r_mr): Optimized. + (output_movsisf): Compute insn length for `adjust_insn_length' + (out_movqi_mr_r): Optimized. + (out_movhi_mr_r): Optimized. + (adjust_insn_length): Use output_movsisf, output_movqi, + output_movhi for insn length adjusting. + (reg_unused_after): Use dead_or_set_p. + (preferred_reload_class): Now haven't any restriction. + (reg_was_0): New function. + (io_address_p): Likewise. + (const_int_pow2_p): Likewise. + (output_reload_inhi): Likewise. + (output_reload_insisf): Likewise. + + * config/avr/avr.h (MULTILIB_DEFAULTS): Define. + (LIB_SPEC): Use -lc for all supported devices. + (LIBGCC_SPEC): Use -lgcc for all supported devices. + (AVR_MEGA): Define as avr_mega_p. + (AVR_ENHANCED): New, define as avr_enhanced_p. + (TARGET_SWITCHES): Remove -menhanced, now handled by -mmcu=... + (CPP_SPEC, LINK_SPEC): Handle all known MCU types. + (CRT_BINUTILS_SPECS): Handle all known MCU types. + Rename gcrt1-*.o to make file names unique on 8.3 filesystems. + (EXTRA_SPECS): Add CPP_AVR[1-5]_SPEC. + (ASM_SPEC): Pass -mmcu=... to the assembler. + Change all -DAVR_* to -D__AVR_*__. + (INIT_TARGET_OPTABS), config/avr/libgcc.S: + Rename library functions to start with two underscores. + (ASM_OUTPUT_COMMON): Outputs `.comm VAR,VAR-SIZE,1' to avoid + alignment. + (ASM_WEAKEN_LABEL): Declared for __attribute__((weak)). + (SUPPORTS_WEAK): Likewise. + (LDI_REG_REGNO): New. Register r31 will be used as temporary + register for loading constants to r0-r14. + + * config/avr/avr.md: Replace all TARGET_ENHANCED with + AVR_ENHANCED. + (*mov_r_sp): Removed. Handled by output_movhi. + (*mov_sp_r): Likewise. + (*mov_sp_r_no_interrupts): Likewise + (*mov_sp_r_tiny): Likewise. + (*movqi): Use output_movqi. + (*reload_inqi): New. + (*movhi): Use output_movhi. + (*reload_inhi): New. + (*negsi2): Optimized. + (*negsf2): Likewise. + Added peepholes (define_peephole2) for loading constants to r0-r14 + and for using `cpse' command. + + * config/avr/libgcc.S: Rename library functions to start with two + underscores. + Add support for enhanced core. + (_moqhi3): Fix typo, now _modqi3. + (__divsi_raw): Use __zero_reg__ as loop counter, smaller by 1 word. + (__prologue_saves__): Remove test for stack adjust by 0. + (__tablejump__): New. + + * config/avr/t-avr: Build libgcc2 with -mcall-prologues. + Add multilib support. + +Tue Aug 29 15:17:54 EDT 2000 John Wehle (john@feith.com) + + * loop.c (prescan_loop): Don't check unknown_address_altered + when deciding if insert_loop_mem is safe. Add BLKmode MEMs + to loop_store_mems as necessary. + (loop_invariant_p): Don't check unknown_address_altered + or unknown_constant_address_altered. + +2000-08-29 J. David Anglin + + * vax.md (sltu, sgeu): Delete sltu and sgeu insn patterns. + +2000-08-29 Zack Weinberg + + * cpperror.c (print_file_and_line): If line is (unsigned int)-1, + print just the filename. + * cpplex.c (_cpp_run_directive): Add additional argument, the + name to give the synthetic buffer. This defaults to + translated "". + * cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert): + Adjust to match. + (_cpp_define_builtin): New function. + * cppinit.c (initialize_builtins): Use _cpp_define_builtin. + * cpphash.h: Update prototypes. + + * tradcpp.c (main): Process -D and -U simultaneously, in the + order they appeared on the command line. + +2000-08-29 Kaveh R. Ghazi + + * c-decl.c (define_label): Call warning_with_file_and_line and + error_with_file_and_line instead of plain warning or error. + + * c-parse.in (label): Use save_filename/save_lineno to ensure + correct values for calls to define_label. + +2000-08-29 Mark Mitchell + + * calls.c (expand_call): Don't create a VAR_DECL just to throw it + away. + * expr.c (expand_expr, case TARGET_EXPR): Don't call + mark_addressable. + * tree.h (get_file_function_name): Remove two duplicate + declarations. + +2000-08-28 Kazu Hirata + + * tree.c: Fix formatting. + + * xcoffout.c: Fix formatting. + +2000-08-28 Jason Merrill + + * dwarf2out.c (attr_checksum): Also ignore DW_AT_producer. + +2000-08-28 Daniel Berlin + + * dwarf2out.c (dwarf2out_finish): Don't bother calling + break_out_includes if it won't do anything. + +2000-08-28 Richard Henderson + + * reload.c (push_secondary_reload): Revert 2000-08-16 change. + (find_reloads): Likewise. + * config/alpha/alpha.md (reload_inqi): Revert 2000-08-11 change. + (reload_inhi): Likewise. + +2000-08-28 Richard Henderson + + * config/i386/i386.c: Don't error on EXTRA_CONSTRAINT defined. + (call_insn_operand): Don't expect a surrounding mem. + (constant_call_address_operand): Likewise. + * config/i386/i386.h (PREDICATE_CODES): Update. + * config/i386/i386.md (call patterns): Move the match_operand + for the call destination inside the mem. + +2000-08-28 Richard Henderson + + * local-alloc.c (requires_inout): Don't use reserved range for + EXTRA_CONSTRAINTS; use anything not matched by REG_CLASS_FROM_LETTER. + * recog.c (asm_operand_ok): Likewise. + (preprocess_constraints, constrain_operands): Likewise. + * regclass.c (record_reg_classes): Likewise. + * reload.c (find_reloads): Likewise. + * reload1.c (maybe_fix_stack_asms): Likewise. + (reload_cse_simplify_operands): Likewise. + * stmt.c (expand_asm_operands): Likewise. + + * md.texi: Update constraints documentation. + * tm.texi (EXTRA_CONSTRAINT): Update. + +2000-08-28 Daniel Berlin + + * dwarf2out.c (DIE_LABEL_PREFIX): Remove leading "__". + (print_die): If we don't know the offset of the + target die, try the symbol. Add a trailing newline. + (reverse_all_dies): New fn. + (dwarf2out_finish): Call it. + (break_out_includes): Reorganize for clarity. + (add_sibling_attributes): Don't call reverse_die_lists. + (output_comp_unit): Rename from output_comdat_comp_unit. Use for + primary CU, too. + * flags.h: Add flag_eliminate_dwarf2_dups. + * toplev.c (f_options): Support -feliminate-dwarf2-dups. + +2000-08-28 Jason Merrill + + * dwarf2.h (DW_TAG_GNU_BINCL, DW_TAG_GNU_EINCL): New tags. + * dwarf2out.c: #include "md5.h". + (DIE_LABEL_PREFIX): New macro. + (dw_val_struct): Add 'external' flag to val_die_ref. + (add_AT_die_ref, AT_ref): Adjust. + (AT_ref_external, set_AT_ref_external): New fns. + (build_abbrev_table): Call set_AT_ref_external. + (value_format): Call AT_ref_external. + (die_struct): Add die_symbol field. + (new_die): Clear it. + (dwarf_tag_name): Handle BINCL/EINCL. + (dwarf2out_start_source_file): Add BINCL DIE. + (dwarf2out_end_source_file): Add EINCL DIE. + (push_new_compile_unit, pop_compile_unit, clear_die_sizes): New fns. + (loc_checksum, attr_checksum, die_checksum): New fns. + (is_type_die, is_comdat_die, is_symbol_die): New fns. + (compute_section_prefix, assign_symbol_names): New fns. + (gen_internal_sym, output_die_symbol, output_symbolic_ref): New fns. + (output_die): Call output_die_symbol and AT_ref_external. + (output_comdat_comp_unit): New fn, split out from... + (dwarf2out_finish): ...here. Also call add_sibling_attributes for + secondary CUs. + (output_pubnames, output_aranges): Abort if we see entries from + secondary CUs. + * toplev.h: Declare file_name_nondirectory. + * toplev.c (file_name_nondirectory): New fn, moved from C++ frontend. + (rest_of_type_compilation): Call dwarf2out_decl if at toplevel. + (debug_start_source_file): Call dwarf2out_start_source_file + regardless of debug verbosity. + (debug_end_source_file): Similarly. + * tree.h: Declare clean_symbol_name. + * tree.c (clean_symbol_name): Split out from... + (get_file_function_name_long): ...here. + + * dwarf2out.c (new_loc_descr): Use calloc. + (splice_child_die): Remove the die from the right parent. + (gen_struct_or_union_die): Don't add AT_name to a specification DIE. + +Mon Aug 28 19:02:13 2000 Richard Kenner + + * toplev.c (decode_g_option): Don't give warning for unknown -g + option; return 0 instead. + (main): If -g option is not recognized by front end or + language-independent code, give warning. + +2000-08-28 Greg McGary + + * config/i386/i386-protos.h (ix86_expand_compare): Add extern decl. + * config/i386/i386.c (ix86_expand_compare): Remove `static'. + * config/i386/i386.md (trap, conditional_trap): New insn & expand. + +2000-08-27 Greg McGary + + * cpplex.c (parse_string): Don't look for backslash + before first char in `namebuf'. + * loop.c (strength_reduce): Skip NOTEs. + +2000-08-27 Jason Merrill + + * c-decl.c (duplicate_decls): Don't set TREE_STATIC or clear + DECL_EXTERNAL on a local extern. Don't set DECL_IGNORED_P or + TREE_ASM_WRITTEN, either. + (finish_decl): Adjust. + +2000-08-28 Philipp Thomas + + * ABOUT-GCC-NLS: Remove gettext patches from Paul Eggert as + they have been incorporated into the gettext CVS. Change the text to + reflect the current status of NLS. Add instructions for accessing + the gettext CVS and add the patch from Martin v. Loewis. + +2000-08-27 Geoff Keating + + * config/rs6000/rs6000.md (movdi_internal64+5): Make SUBREG-safe + by using gen_lowpart_common. + (movdi_internal64+6): Likewise. + +2000-08-26 Alexandre Oliva + + * tm.texi (FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): + Document. + + * config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Remap register + numbers to the ranges used by GDB. + +2000-08-25 Richard Henderson + + * config/ia64/ia64.h (struct machine_function): Add n_varargs. + * config/ia64/ia64.c (ia64_compute_frame_size): Use it. + (ia64_expand_prologue): Likewise. + (ia64_setup_incoming_varargs): Set it. Properly skip the current + argument for stdargs. + +2000-08-25 Jason Merrill + + * integrate.c (expand_inline_function): Pull out the original decl. + +2000-08-25 Jim Wilson + + * cse.c (cse_insn): Don't pass label subtraction to force_const_mem. + + * function.c (gen_mem_addressof): Clear MEM_ALIAS_SET if no decl. + +2000-08-25 Greg McGary + + * flow.c (dump_edge_info): Use ARRAY_SIZE. + * config/alpha/alpha.c (alpha_expand_block_move): Likewise. + +2000-08-25 Richard Earnshaw + + * arm.h (STRUCT_VALUE): Define to 0, not NULL. + +Fri Aug 25 12:52:49 EDT 2000 John Wehle (john@feith.com) + + * i386.c (ix86_find_base_term): New. + * i386-protos.h (ix86_find_base_term): Prototype. + * i386.h (FIND_BASE_TERM): Define. + * alias.c (find_base_term): Use it. + * tm.texi (FIND_BASE_TERM): Document it. + + * alias.c (true_dependence, write_dependence_p): Unchanging + memory can't conflict with non-unchanging memory. + + * alias.c (memrefs_conflict_p): A BLKmode reference + to a symbol (or CONST_INT address) always conflicts + with a reference to another symbol. + +2000-08-25 Joseph S. Myers + + * c-common.c (time_char_table): Don't allow width and flags with + "z" format. + +2000-08-25 Jakub Jelinek + + * config/i386/i386.c (ix86_expand_branch): Treat GE and GEU the same + way as LT and LTU when the second operand has 0 in low word. + +2000-08-26 Michael Hayes + + * basic-block.h (struct loop): Rename `exits' field to + `exit_edges'. Add `entry_edges' and `num_entries' fields. + + * flow.c (flow_loop_exit_edges_find): Rename from flow_loop_exits_find. + (flow_loop_entry_edges_find): Add. + (flow_edge_list_print): Rename from flow_exits_print. + (flow_loops_find): Call flow_loop_entry_edges_find. + (flow_loop_dump): Dump entry_edges list. + (flow_loops_free): Free entry_edges. + +2000-08-26 Michael Hayes + + * loop.c (loop_dump_aux, debug_loop): New functions. + (LOOP_BLOCK_NUM_1, LOOP_BLOCK_NUM, LOOP_INSN_UID): New macros. + + * flow.c (flow_loops_dump): Add callback parameter. + (flow_loop_dump): Add callback parameter and call it. Move + loop note debugging code to loop_dump_aux. + + * basic-block.h (flow_loop_dump): Add callback parameter + (flow_loops_dump): Likewise. + + * toplev.c (rest_of_compilation): Add NULL callback function pointer + to call to flow_loops_dump. + +2000-08-26 Michael Hayes + + * loop.c (count_loop_regs_set): Replace start and end arguments + with loop argument. All callers udated. + +2000-08-26 Michael Hayes + + * loop.c (constant_high_bytes): Delete. + +2000-08-26 Michael Hayes + + * loop.c (prescan_loop): Move checks for NOTE_INSN_LOOP_CONT + and NOTE_INSN_LOOP_VTOP to... + (find_and_verify_loops) ...here. + +Fri Aug 25 04:21:13 2000 Alexandre Oliva + + * crtstuff.c (CRT_CALL_STATIC_FUNCTION): Define default. + (fini_dummy, init_dummy): Use it. + +Fri 25-Aug-2000 08:03:27 BST Neil Booth + + * cpplex.c (is_macro_disabled): Caller has already checked + that we're not a preprocessed file. + +2000-08-24 Mark Mitchell + + * Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o. + (c-iterate.o): Remove target. + * gcc/c-common.h (enum rid): Remove RID_ITERATOR. + * gcc/c-decl.c (init_decl_processing): Remove call to init_iterators. + (finish_decl): Don't handle iterators. + (grokdeclarator): Likewise. + * gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords. + * gcc/c-gperf.h: Regenerated. + * gcc/c-iterate.c: Removed. + * gcc/c-lex.c (init_lex): Don't handle iterators. + * gcc/c-parse.in (primary): Remove pop_iterator_stack call. + (compstmt_primary_start): Remove push_iterator_stack call. + (stmt): Don't allow iterator statements. Replace iterator_expand + with expand_expr_stmt. + (all_iter_stmt): Remove. + (all_iter_stmt_simple): Likewise. + (all_iter_stmt_with_decl): Likewise. + * gcc/c-tree.h (ITERATOR_P): Remove. + (ITERATOR_BOUND_P): Likewise. + (init_iterators): Remove declaration. + (iterator_expand): Likewise. + (iterator_for_loop_start): Likewise. + (iterator_for_loop_end): Likewise. + (iterator_for_loop_record): Likewise. + (push_iterator_stack): Likewise. + (pop_iterator_stack): Likewise. + * gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P. + (readonly_warning): Likewise. + * gcc/tree.h (ITERATOR_BOUND_P): Don't mention it. + +2000-08-24 Jim Wilson + + * c-common.c (decl_attributes, case A_ALIGN): Revert last change. + Copy type in a TYPE_DECL, just like pushdecl does. + +2000-08-24 Richard Henderson + + * toplev.c (main): Enable flag_reorder_blocks at -O2. + +2000-08-24 Zack Weinberg + + * ggc-page.c (alloc_page): If HAVE_MMAP_ANYWHERE and we're + asked for one page, allocate GGC_QUIRE_SIZE of them and put + the extras on the free list. + (release_pages): Clean up. + (ggc_set_mark): Don't adjust G.allocated here... + (sweep_pages): ... do it here. + +2000-08-24 Zack Weinberg + + * cppfiles.c (read_include_file): Rearrange initializations. + +2000-08-24 Richard Henderson + + * stmt.c (expand_asm_operands): Treat EXTRA_CONSTRAINT like g or X. + + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.c (gr_register_operand): New. + (fr_register_operand, grfr_register_operand): New. + (gr_nonimmediate_operand, grfr_nonimmediate_operand): New. + (grfr_reg_or_8bit_operand): New. + (gr_reg_or_0_operand): Rename from reg_or_0_operand and + use gr_register_operand. + (gr_reg_or_5bit_operand, gr_reg_or_6bit_operand): Likewise. + (gr_reg_or_8bit_operand, gr_reg_or_8bit_adjusted_operand): Likewise. + (gr_reg_or_8bit_and_adjusted_operand): Likewise. + (gr_reg_or_14bit_operand, gr_reg_or_22bit_operand): Likewise. + (fr_reg_or_fp01_operand): Likewise. + (not_postinc_memory_operand): New. + (ia64_split_timode): Remove unused variables. + (rtx_needs_barrier): Check arguments to cmpxchg. + (builtin_description): Remove. + (bdesc_2argsi, bdesc_2argdi): Remove. + (ia64_init_builtins): Declare all builtins directly. + (ia64_expand_fetch_and_op): Rewrite to be called from + ia64_expand_builtin directly. Use expand_binop and co. + (ia64_expand_op_and_fetch): Likewise. + (ia64_expand_compare_and_swap): Likewise. + (ia64_expand_binop_builtin): Remove. + (ia64_expand_lock_test_and_set): New. + (ia64_expand_lock_release): New. + (ia64_expand_builtin): Use them. + * config/ia64/ia64.h (CONSTRAINT_OK_FOR_S): New. + (EXTRA_CONSTRAINT): Use it. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md (*): Use gr_register_operand and co. + (mf): Indicate that we set memory as well as use it. + (fetchadd_acq_si): Show memory being modified as well. + (fetchadd_acq_di, cmpxchg_acq_si, cmpxchg_acq_di): Likewise. + (val_compare_and_swap_si, val_compare_and_swap_di): Remove. + (lock_test_and_set_si, lock_test_and_set_di): Remove. + (fetch_and_add_si, fetch_and_sub_si, fetch_and_or_si): Remove. + (fetch_and_and_si, fetch_and_xor_si, fetch_and_nand_si): Remove. + (fetch_and_add_di, fetch_and_sub_di, fetch_and_or_di): Remove. + (fetch_and_and_di, fetch_and_xor_di, fetch_and_nand_di): Remove. + (add_and_fetch_di, sub_and_fetch_di, or_and_fetch_di): Remove. + (and_and_fetch_di, xor_and_fetch_di, nand_and_fetch_di): Remove. + (add_and_fetch_si, sub_and_fetch_si, or_and_fetch_si): Remove. + (and_and_fetch_si, xor_and_fetch_si, nand_and_fetch_si): Remove. + * config/ia64/ia64intrin.h (*): Cast result to the appropriate + return type. Pretty print definitions. + +2000-08-24 Jim Wilson + + * config/ia64/ia64.md (movdi): Don't call gen_movdi_symbolic if + we have a SYMBOL_REF with SYMBOL_REF_FLAG set. + +2000-08-24 Jason Merrill + + * dwarf2out.c (AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, + AT_loc, AT_addr, AT_lbl): Abort on unsuitable input. + (get_AT_low_pc, get_AT_hi_pc, get_AT_string, get_AT_flag, + get_AT_unsigned, get_AT_ref): Don't call them if get_AT fails. + +2000-08-24 Greg McGary + + * optabs.c (init_optabs): Initialize fixtab, fixtrunctab, floattab, + and extendtab within their proper array boundaries. + * emit-rtl.c (init_emit_once): Pass `const_tiny_rtx' with bounds + for the entire array. + + * config/arm/arm.c (arm_override_options): Use ARRAY_SIZE. + * config/alpha/alpha.c (alpha_lookup_xfloating_lib_func): Likewise. + * config/avr/avr.c (order_regs_for_local_alloc): Likewise. + * config/fr30/fr30.c (fr30_print_operand): Likewise. + * config/i386/dgux.c (output_options): Likewise. + * config/i386/dgux.h (ASM_FILE_START): Likewise. + * config/m88k/m88k.c (output_options): Likewise. + * config/m88k/m88k.h (ASM_FILE_START): Likewise. + * config/mcore/mcore.c (mcore_output_inline_const_forced, + layout_mcore_frame, handle_structs_in_regs): Likewise. + * config/mips/mips.c (output_block_move): Likewise. + * config/rs6000/rs6000.c (rs6000_override_options, + rs6000_file_start): Likewise. + * config/sparc/sparc.c (sparc_add_gc_roots): Likewise. + * fixinc/fixfixes.c (FIX_TABLE_CT): Likewise. + * fixinc/fixtests.c (TEST_TABLE_CT): Likewise. + * builtins.c (expand_builtin_setjmp): Likewise. + * expr.c (safe_from_p): Likewise. + * flow.c (life_analysis): Likewise. + * fold-const.c (size_int_type_wide): Likewise. + * gcc.c (translate_options, init_spec, set_spec, main): Likewise. + * genattrtab.c (make_length_attrs): Likewise. + * genopinit.c (gen_insn): Likewise. + * genrecog.c (NUM_KNOWN_PREDS, NUM_SPECIAL_MODE_PREDS): Likewise. + * global.c (global_alloc): Likewise. + * local-alloc.c (find_free_reg): Likewise. + * mips-tdump.c (print_symbol): Likewise. + * mips-tfile.c (parse_def, parse_input): Likewise. + * reload1.c (NUM_ELIMINABLE_REGS): Likewise. + * stmt.c (expand_nl_goto_receiver): Likewise. + * stor-layout.c (set_sizetype): Likewise. + * varasm.c (decode_reg_name): Likewise. + * toplev.c (decode_f_option, decode_W_option, + set_target_switch, print_switch_values): Likewise. + (NUM_ELEM): Remove macro. + (display_help, main): s/NUM_ELEM/ARRAY_SIZE/ + +2000-08-24 Greg McGary + + * tree.h (enum tree_index): New member `TI_MAIN_IDENTIFIER'. + (MAIN_NAME_P, main_identifier_node): New macros. + * c-common.c (c_common_nodes_and_builtins): Init main_identifier_node. + * c-decl.c (start_decl, grokdeclarator, start_function, + store_parm_decls, finish_function): Use MAIN_NAME_P. + * config/avr/avr.c (function_prologue, function_epilogue): Likewise. + * config/i386/cygwin.h (SUBTARGET_PROLOGUE): Likewise. + * config/i386/win32.h (SUBTARGET_PROLOGUE): Likewise. + * config/pdp11/pdp11.c (output_function_prologue): Likewise. + +2000-08-24 Greg McGary + + * cppfiles.c (actual_directory): Don't write beyond `dir' + when it contains "". + * real.c (asctoeg): Stay within bounds of etens[][]. + +2000-08-24 Kaveh R. Ghazi + + * dependence.c (dependence_string, direction_string, + dump_one_node, dump_node_dependence): Hide unused identifiers. + (get_low_bound, normalize_coefficients): Match definition to + static prototype. + (get_one_coefficient): Initialize variables `value0_is_idx' and + `value1_is_idx'. + (ziv_test, gcd_test): Mark parameters with ATTRIBUTE_UNUSED. + (ziv_test): Delete variable `idx', use parameter `sub' instead. + (direction_merge): Avoid automatic aggregate initialization. + (have_dependence_p): Use `src' not `dest' to set `src_idx'. + Initialize variables `dest_idx' and `src_idx'. + (end_dependence_analysis): Avoid C89 style function definition. + +2000-08-24 Joseph S. Myers + + * c-common.c (time_char_table): Don't allow width with %F. + (check_format_info): Don't allow "Z" length with scanf. + +2000-08-24 Gabriel Dos Reis + + * diagnostic.c (finish_diagnostic): Define. + (output_do_printf): Use wrap_text instead of output_add_string. + (default_print_error_function): Avoid embedded '\n'. + + * diagnostic.h (flush_diagnostic_buffer): Declare. + +2000-08-23 Alexandre Oliva + + * dependence.c: Replace `[][]' with `[][MAX_SUBSCRIPTS]'. + +2000-08-23 Hans-Peter Nilsson + + * Makefile.in (GCC_PASSES): Add specs. + +2000-08-23 Jim Wilson + + * frame.h (IA64_UNW_EHANDLER, IA64_UNW_UHANDLER): New. + * config/ia64/frame-ia64.c (__get_personality): Return zero if neither + EHANDLER nor UHANDLER bit is set. + (__get_except_table): Likewise. + +2000-08-23 Nick Clifton + + * config/arm/lib1funcs.asm: Replace upper case condition codes + with lower case versions. + + * config/arm/arm.h (STRUCT_VALUE): Define. + (STRUCT_VALUE_REGNUM): Delete. + +2000-08-23 Zack Weinberg + + * cpphash.h (IN_I): New flag for directive table. + * cpplib.c (DIRECTIVE_TABLE): Mark #define, #undef, #ident, and + #pragma with IN_I. + (_cpp_check_directive): If -fpreprocessed, execute directives + marked with IN_I. Issue no warnings in this case. + * cpplex.c (_cpp_get_token): Expand no macros if -fpreprocessed. + +2000-08-23 Joseph S. Myers + + * c-common.c (print_char_table): Allow 'I' flag with %d, %i and + %u. + (check_format_info): Support printf 'I' flag; warn about it with + -pedantic. + +2000-08-23 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (arm_expand_prologue): Ensure that the stack-adjustment + barrier can't be ignored by the alias analysis code. + +2000-08-12 Eli Zaretskii + + * fixinc/inclhack.def (sysv68_string): Fix the Sed script so it + works inside fixincl. + +Wed Aug 23 04:55:48 2000 Alexandre Oliva + + * simplify-rtx.c (simplify_rtx): Don't pass VOIDmode to + simplify_relational_operation() unless both operands are of + VOIDmode. + * cse.c (fold_rtx): Likewise. + +Tue Aug 22 23:53:27 EDT 2000 John Wehle (john@feith.com) + + * rtlanal.c (rtx_unstable_p): The pic register is stable + (within one function) and the actual rtx should be used + when checking the registers. + (rtx_addr_can_trap_p): Pic memory addresses can't trap. + + * alias.c (true_dependence, write_dependence_p): Fix + bug in previous patch. + + * i386.c (ix86_GOT_alias_set): New. + (legitimize_pic_address): Use it. + + * rtlanal.c (rtx_unstable_p): An unchanging MEM is + only stable if its address is stable. + (rtx_varies_p): An unchanging MEM can't vary if + its address doesn't vary. + +2000-08-22 Kaveh R. Ghazi + + * c-parse.in (unop +): Restrict -Wtraditional warnings to user code. + +2000-08-22 J. David Anglin + + * vax.h (ASM_SPEC): Pass `-J' to assembler. + * x-vax-gcc: New file for bootstrapping with gcc. + * x-vax: Use X_CFLAGS rather than X_CPPFLAGS to pass `-J'. + * configure.in: Use x-vax-gcc with gcc. + * configure: Rebuilt. + +Tue Aug 22 21:21:05 2000 J"orn Rennecke + + * toplev.c (rest_of_compilation): Rebuild label notes after + post-reload splitting pass if new labels have been created. + +2000-08-22 Gabriel Dos Reis + + * diagnostic.h (output_buffer_state): New macro. + * diagnostic.c (diagnostic_for_decl, sorry, + default_print_error_function, output_do_verbatim, + report_diagnostic, report_problematic_module): Use it. + (wrap_text): Tweak. + (output_format): Use wrap_text instead of maybe_wrap_text. + +2000-08-22 Nick Clifton + + * config/arm/lib1funcs.asm (ARM_DIV_MOD_BODY): New macro. + Common code for ARM divide and modulus functions. + (THUMB_DIV_MOD_BODY): New macro. Thumb equivalent of + ARM_DIV_MOD_BODY. + (FUNC_END): New macro: Common code at the end of the division and + modulo functions. + (THUMB_FUNCTION_START): New macro: Common code at the start of + Thumb functions. + (__divsi3, __udivsi3, __modsi3, __umodsi3): Use new macros. + +Tue Aug 22 20:34:52 2000 Kaz Kojima + + * config/sh/sh.md (cmpeqdi_t splitter): Fix a reverse testing. + + * config/sh/sh.c (prepare_scc_operands): Apply force_reg to + sh_compare_op1 when the mode is DImode and sh_compare_op1 isn't + const0_rtx. + +2000-08-22 Nick Clifton + + * config/arm/lib1funcs.asm (__umodsi3): Before performing any + restorative additions, test for bottom bits of IP being set, + rather than relying upon the RORs not matching. + (__modsi3): Ditto. + +2000-08-22 David Edelsohn + + * aix.h (ASM_DECLARE_FUNCTION_NAME): Call named_section() or + text_section() as appropriate instead of emitting text csect + pseudo-op directly. + (TEXT_SECTION_ASM_OP): Only require default 32-bit alignment. + (UNIQUE_SECTION): Define macro. + (ASM_OUTPUT_SECTION_NAME): Define macro. + * rs6000.c (rs6000_override_options): Disable -ffunction-sections + on AIX if debugging and -fdata-sections always. + +2000-08-22 Steven King + + * config/float-i386.h (LDBL_EPSILON): Remove __convert_long_double + machinery. + (LDBL_MAX): Same here. + +2000-08-22 Richard Henderson + + * flow.c (tidy_fallthru_edge): Update b->end properly. + +2000-08-22 Stan Cox + + * Makefile.in (OBJS): Add dependence.o. + * dependence.c: New file. + +2000-08-22 Alexandre Oliva , John David Anglin + + * calls.c (check_sibcall_argument_overlap_1): Adjust for + ARGS_GROW_DOWNWARD. + (check_sibcall_argument_overlap): Likewise. + +2000-08-22 Alexandre Oliva + + * invoke.texi (SH Options): Document -m4-nofpu, + -m4-single-only, -m4-single, -m4, -mbigtable, -mfmovd, + -mhitachi, -mnomacsave, -misize, -mpadstruct, -mspace. + +2000-08-22 Joseph S. Myers + + * c-common.c (check_format_info): Give the 'some locales' warning + for strftime %Ey rather than the unconditional 'only last 2 digits + of year' one. + +2000-08-22 Richard Henderson + + * alias.c (init_alias_analysis): Do not register + struct_value_incoming_rtx or static_chain_rtx as pointing + to stack memory. + +Tue Aug 22 01:44:43 2000 Jeffrey A Law (law@cygnus.com) + + * protoize.c (munge_compile_params): Fix typo and formatting buglets. + +2000-08-22 Gabriel Dos Reis + + * diagnostic.h (report_problematic_module): Declare. + * diagnostic.c (report_problematic_module): New function. + (report_error_function): Tweak. + +Tue Aug 22 02:31:26 2000 Richard Kenner + + * stmt.c (expand_goto_internal, fixup_gotos): Only check + TYPE_RETURNS_STACK_DEPRESSED for FUNCTION_TYPE. + +2000-08-21 Richard Henderson + + * flow.c (calculate_global_regs_live): Mark frame pointer live + everywhere before reload. + +2000-08-21 Jim Wilson + + * real.c (ereal_from_int, ereal_from_uint, significand_size): Handle + INTEL_EXTENDED_IEEE_FORMAT. + (toe64): Delete INTEL_EXTENDED_IEEE_FORMAT support. Unconditionally + clear last two bytes of output FP value. + +2000-08-21 Graham Stott + + * config/ia64/ia64.h (REDO_SECTION_INFO_P): Change decl to DECL. + +2000-08-21 Jakub Jelinek + + * unroll.c (loop_find_equiv_value): If ret is modified between + insn and loop_start, ret might not be equivalent to reg. + +2000-08-21 Joseph S. Myers + + * c-common.c (init_dollar_format_checking, + maybe_read_dollar_number, finish_dollar_format_checking): New + functions. + (dollar_arguments_used, dollar_arguments_count, + dollar_first_arg_num, dollar_max_arg_used, dollar_format_warned): + New variables. + (check_format_info): Support $ formats for scanf and printf width + and precision. Always increment format_chars to advance past the + '*' of precision, not just when the format parameters are + available to check. + +2000-08-21 Kaveh R. Ghazi + + * mips.c (block_move_loop, expand_block_move, + function_arg_partial_nregs, save_restore_insns, function_prologue, + mips_expand_prologue, RA_MASK): Avoid using the `U' integer + constant suffix. + (function_arg_advance, function_arg): Match argument to format + specifier `%p'. + +2000-08-21 Nix + + * gcc.c (do_spec_1): Implement %j spec flag. + Remove dead comment. + + * gcc.texi (The Configuration File): Document HOST_BIT_BUCKET. + * system.h (HOST_BIT_BUCKET): Default to "/dev/null". + * config/i386/xm-dos.h (HOST_BIT_BUCKET): Define as "NUL". + * config/i386/xm-os2.h, config/winnt/winnt.h: Likewise. + + * protoize.c (munge_compile_params): Use HOST_BIT_BUCKET (if + writable) instead of hardcoded value. + + * toplev.c (compile_file): Output to a file even if -fsyntax-only. + + * gcc.c, config/i386/xm-dos.h, config/i386/xm-os2.h: Kill + MKTEMP_EACH_FILE. + + * gcc.c (cc1_options): Do not process -o or run the assembler if + -fsyntax-only. + * objc/lang-spec.h: Likewise. + +2000-08-21 Eli Zaretskii + + * fixinc/fixincl.c (fix_with_system): Pipe the output of + "external" fixes through `cat', to avoid truncating the input + file by redirection. + +2000-08-21 Jakub Jelinek + + * config/i386/i386.md (lea_general_1): Copy insn condition to split + condition. + (lea_general_2, lea_general_3): Likewise. + +2000-08-21 Kaveh R. Ghazi + + * c-decl.c (duplicate_decls, define_label): Restrict -Wtraditional + warnings to user code. + + * c-lex.c (readescape, yylex): Likewise. + + * c-typeck.c (store_init_value, process_init_element): Likewise + (c_expand_start_case): Format. + +2000-08-18 Maciej W. Rozycki + + * mips/linux.h (LINK_SPEC): Use %(endian_spec). + + * mips/mips.h: Change LINKER_ENDIAN_SPEC to ENDIAN_SPEC + and linker_endian_spec to endian_spec. + (ENDIAN_SPEC): Add %{EB} and %{EL}. + (LINK_SPEC): Remove %{EB} and %{EL}. + (ASM_SPEC): Likewise. Use %(endian_spec). + +2000-08-21 Joseph S. Myers + + * c-tree.h (flag_hosted): Move declaration from here... + * c-common.h (flag_hosted): ... to here. + (flag_noniso_default_format_attributes): New declaration. + * c-decl.c (flag_noniso_default_format_attributes): New variable. + (c_decode_option): Set it appropriately for options choosing + language standard variant. + * c-common.c (init_function_format_info): Only provide default + format attributes if flag_hosted. Only provide the gettext + formats if flag_noniso_default_format_attributes. Update + comments. + (check_format_info): Disable treatment of %a as a scanf flag in + C99 mode. + +2000-08-21 Joseph S. Myers + + * c-common.c (scan_char_table): Add 'w' to flags for all formats + except 'n'. + (check_format_info): Set 'wide' for scanf format widths. Warn for + a zero scanf width. Make the check for writing into a constant + object at the first level of indirection; at later levels, warn if + any type qualifiers are encountered. + +Mon Aug 21 07:41:12 2000 Jeffrey A Law (law@cygnus.com) + + * reload.c (reload_inner_reg_of_subreg): New function broken out of + push_reload. + (push_reload): Use reload_inner_reg_of_subreg. + (combine_reloads): Do not combine reloads if the input reload + is a SUBREG in which the inner part will need reloading. + + * global.c (global_alloc): Avoid passing dumpfile argument to + reload routines. + * toplev.c (rest_of_compilation): Likewise. + * reload.h (reload): Remove dumpfile argument. Callers changed. + (debug_reload, debug_reload_to_stream): Move prototypes here. + * rtl.h (reload): Remove dumpfile argument. + * reload.c (debug_reload): Remove prototype. + (debug_reload_to_stream): Likewise. + * reload1.c: Avoid passing dumpfile around, rely on rtl_dump_file + instead. + +2000-08-21 Gabriel Dos Reis + + * diagnostic.c (context_as_prefix): Export. + (need_error_newline): Remove. + (lang_diagnostic_starter, lang_diagnostic_finalizer): New objects. + (error_module_changed, record_last_error_module, + error_function_changed, record_last_error_function): New functions. + (initialize_diagnostics): Default initialize + lang_diagnostic_starter, lang_diagnostic_finalizer. + (init_output_buffer): Tweak. + (file_name_as_prefix): New function. + (announce_function, default_print_error_function, + report_error_function, set_diagnostic_context): Tweak. + +2000-08-21 Richard Earnshaw + + * flow.c (init_propagate_block_info): Handle SUBREG in a jump + condition expression. + +2000-08-20 Richard Henderson + + * flow.c (merge_blocks_nomove): Don't seek back past the bb note. + +2000-08-20 Zack Weinberg + + * cppinit.c (cpp_init): Set global flag when called. + (cpp_reader_init): Bomb out if cpp_init hasn't been called. + +Sun Aug 20 01:41:35 2000 Dennis Chernoivanov + + * cpplex.c (cpp_scan_buffer): Move `output_line_command' just + before `process_directive' so that newlines won't be missed + for directives. + (cpp_printf): Increment `print->lineno' when newline is emitted. + + * cppmain.c (cb_ident): Likewise. + (cb_define): Likewise. + (cb_undef): Likewise. + (cb_include): Likewise. + (cb_def_pragma): Likewise. + (dump_macros_helper): Likewise. + +2000-08-20 Richard Henderson + + * config/ia64/ia64.c (emit_insn_group_barriers): Stop if ar.lc + assigned before a loop. + + * config/ia64/ia64.md (ashlsi3): Zero extend the shift count. + (ashrsi3, lshrsi3): Likewise. + +2000-08-20 Gabriel Dos Reis + + * c-lang.c: #include diagnostic.h + (c_tree_printer): New function. + (lang_init): Initialize lang_printer. + + * Makefile.in (c-lang.o): Depends on diagnostic.h + +2000-08-20 Gabriel Dos Reis + + * c-errors.c (pedwarn_c99): Adjust call to report_diagnostic. + + * diagnostic.c (default_diagnostic_starter, + default_diagnostic_finalizer): New functions. + (diagnostic_for_asm, diagnostic_for_decl): Tweak. + (pedwarn, pedwarn_with_file_and_line, error, + error_with_file_and_line, fatal, warning, + warning_with_file_and_line): Adjust call to report_diagnostic. + (report_diagnostic): Rework. + (set_diagnostic_context): New function. + + * diagnostic.h (struct diagnostic_context): New data structure. + (diagnostic_message, diagnostic_argument_list, + diagnostic_file_location, diagnostic_line_location, + diagnostic_is_warning, diagnostic_starter, diagnostic_finalizer, + diagnostic_finalizer, diagnostic_auxiliary_data): New macros. + (set_diagnostic_context): Declare. + (report_diagnostic): Change prototype. + +Sun 20-Aug-2000 09:25:45 BST Neil Booth + + * fix-header.c (main): Initialize cpplib. + +2000-08-19 Michael Meissner + + * ifcvt.c (find_if_block): Do not assume that a THEN block has any + instructions in it before checking for indirect jumps. + + * ifcvt.c (find_if_block): Do not consider a THEN block that ends + in an indirect jump as a potential for conditional execution. + + * d30v.h (d30v_init_expanders): Don't declare here. + * d30v-protos.h (d30v_init_expanders): Declare here with a valid + prototype. + +Sat 19-Aug-2000 21:11:45 BST Neil Booth + + * cpp.texi: Add @section for assertions. + +Sat Aug 19 12:37:08 EDT 2000 John Wehle (john@feith.com) + + * loop.c (scan_loop): Use CONST_CALL_P instead of + checking for REG_LIBCALL / REG_RETVAL. + +Sat Aug 19 09:18:47 2000 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_as_needed): Accept dumpfile argument, + pass it to emit_reload_insns. + (emit_reload_insns): Add new dumpfile argument. If non-null + then dump the reloads for each insn into the dumpfile. + (reload): Pass dumpfile to reload_as_needed. + + * invoke.texi: Clean up linux-gnu vs linux comments. + +2000-08-19 Richard Henderson + + * config/ia64/ia64.c (reg_or_5bit_operand): New. + (ia64_depz_field_mask): New. + * config/ia64/ia64.h (CONSTRAINT_OK_FOR_R): New. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md: Update commentary. + (depz_internal): New. + (ashlsi3): Implement directly. + (ashrsi3, lshrsi3): Simplify; rely on extv and extzv for constants. + (ashldi3): Use shladd. + * config/ia64/ia64-protos.h: Update. + +2000-08-18 Zack Weinberg + + * toplev.c (independent_decode_option): Always process -g. + Remove third argument, now unused. Adjust caller to match. + +2000-08-18 Richard Henderson + + * combine.c (make_compound_operation): Break after creating + the extraction. + +2000-08-18 Zack Weinberg + + * cpplib.c (cpp_register_pragma_space): Just return if the + namespace is already registered. + +2000-08-18 Ray Essick & Nick Clifton + + * config/mcore/mcore.md (rotlsi3): Allow allow rotations by a + constant amount. Do not generate ROTL instruction. + +Fri Aug 18 16:22:20 2000 Alexandre Oliva + + * config/sh/elf.h: Do not include sh/sh.h. + * config/sh/rtems.h: Likewise. + * config/sh/rtemself.h: Do not include sh/elf.h. + * configure.in: Get them included with `tm_file's. + * configure: Rebuilt. + + * config/sh/sh.md (fpu_switch0, fpu_switch1): Simplify. + * config/sh/sh.c (fpscr_set_from_mem): Use them. + +Fri Aug 18 14:23:18 2000 Richard Kenner + + * stor-layout.c (compute_record_type): Don't use mode of single + field as mode of record if not integer mode of same type. + + * regmove.c (perhaps_ends_bb_p): New function. + (optimize_reg_copy_1, optimize_reg_copy_2): Call it. + (optimize_reg_copy_3, fixup_match_2, regmove_optimize): Likewise. + (fixup_match_1): Likewise. + (fixup_match_1, combine_stack_adjustments_for_block): Add casts to + avoid signed/unsigned warnings. + + * function.c (fixup_var_refs_1, case MEM): Update CODE after + updating X. + +Fri 18-Aug-2000 18:33:45 BST Neil Booth + + * cpphash.h: Use HAVE_DESIGNATED_INITIALIZERS. + (_cpp_trigraph_map): Declaration moved from cpplex.c + + * cppinit.c: Define _cpp_trigraph_map. Use UCHAR_MAX + 1 + instead of 256. Use consistent test for designated initializers. + (cpp_init): Initialize trigraph_map. + (initialize_standard_includes, parse_option): Use memcmp + instead of strncmp. + + * cpplex.c (init_trigraph_map): Remove. + (trigraph_ok, trigraph_replace, lex_line): Refer to + _cpp_trigraph_map. + + * cpplib.c (str_match, WARNING, ERROR, ICE): Delete. + (do_unassert): Remove unused "next" local. + + * system.h (HAVE_DESIGNATED_INITIALIZERS): New prototype. + +2000-08-18 Emmanuel Marty + + * arm/lib1funcs.asm (_umodsi3 THUMB VARIANT): Restore deleted return + insn. + +2000-08-17 Richard Henderson + + * config/ia64/ia64.c (spill_restore_mem): Handle emitting + the first insn in a sequence. + +Thu Aug 17 22:40:05 EDT 2000 John Wehle (john@feith.com) + + * alias.c (true_dependence, write_dependence_p): A read + involving a label_ref or the constant pool doesn't create + a dependency. + + * rtl.h (unchanging): Improve documentation. + +2000-08-17 Rodney Brown + + * cse.c (insert_regs): Remove unused `regno'. + +2000-08-17 Neil Booth + + * (cppinit.c) merge_include_chains: Use remove_dup_dir, + remove_dup_dirs. If qtail == brack, remove brack not + qtail. + (remove_dup_dir, remove_dup_dirs): New functions. + +2000-08-17 Neil Booth + + * cppinit.c (cpp_cleanup): Free include dir chains. + * cpplib.c (do_undef): Let _cpp_free_definition make the node void. + (do_unassert): Free the assert with _cpp_free_definition. + * cppmacro.c (_cpp_free_definition): Free memory allocated for + assertions. Make the node a T_VOID node. + +2000-08-17 Neil Booth + + * cppinit.c (path_include, append_include_chain): + Remove 2nd parameter (struct cpp_pending *). + (path_include, initialize_standard_includes, cpp_handle_option): + Update callers appropriately. + (cpp_handle_option): Use pend. + +2000-08-17 Neil Booth + + * cppinit.c (sort_options): Remove, put functionality in + cpp_init. + (cpp_init): New. + (initialize_builtins): Free memory. + (cpp_start_read): Move init_IStable to cpp_init. + + * cpplib.h (cpp_init): New prototype. + * cppmain.c (main): Call cpp_init. + +Thu Aug 17 13:20:32 EDT 2000 John Wehle (john@feith.com) + + * rtlanal.c (rtx_unstable_p): Use CONSTANT_P. + (rtx_unstable_p, rtx_varies_p): Process vectors. + +2000-08-16 Niibe Yutaka , Kaz Kojima + + * config/sh/lib1funcs.asm (GLOBAL): Define. Use for all + references to GLOBAL symbols. Use LOCAL where appropriate. + +2000-08-16 Kaveh R. Ghazi + + * configure.in (*-ibm-aix4.[12]*): Delete test for gnu ld. Always + use t-aix41 when host == target. + +2000-08-16 Richard Henderson + + * reload.c (push_secondary_reload): Revert last change. + If we use a reload_in/out pattern, make the when the same + as the primary reload. + (find_reloads): Likewise. + +2000-08-16 Manfred Hollstein + + * configure.in (libstdcxx-v3): Fix test. + * configure: Regenerate. + +Wed Aug 16 08:10:32 2000 Richard Kenner + + * calls.c (calls_function_1, expand_call): Only test + TYPE_RETURNS_STACK_DEPRESSED for FUNCTION_TYPE. + * function.c (thread_prologue_and_epilogue_insns): Likewise. + +2000-08-16 Richard Henderson + + * combine.c (simplify_shift_const): Revert previous two + changes. If SHIFT_COUNT_TRUNCATED, crop the shift count + before the main loop. + +2000-08-15 Richard Henderson + + * combine.c (simplify_shift_const): Bound shift count when + combining shifts. + +Tue Aug 15 17:33:05 2000 Richard Kenner + + * calls.c (ECF_SP_DEPRESSED): New macro. + (calls_function_1): Treat calling sp-depressed function as alloca. + (emit_call_1): Don't adjust SP if calling sp-depressed function. + (expand_call): Set ECF_SP_DEPRESSED if TYPE_RETURNS_STACK_DEPRESSED. + If sp-depressed, ensure block saves and restores SP. + * fold-const.c (extract_muldiv): Only check TYPE_IS_SIZETYPE + for INTEGER_TYPE. + * function.c (keep_stack_depressed): New function. + (thread_prologue_and_epilogue_insns): Call it. + * print-tree.c (print_node): Use HOST_WIDE_INT_PRINT_UNSIGNED + to print DECL_OFFSET_ALIGN. + Print no-force-blk and transparent-union flags properly. + * stmt.c (expand_goto_internal): Don't restore stack if last block + and function returns with sp depressed. + (fixup_gotos): Likewise. + (save_stack_pointer): New function, from code in expand_decl. + (expand_decl): Call new function. + * tree.h (TYPE_IS_SIZETYPE): Call INTEGER_TYPE_CHECK. + (TYPE_RETURNS_STACK_DEPRESSED): New macro. + (save_stack_pointer): New declaration. + + * diagnostic.c (fatal_function): New variable. + (set_fatal_function): New function. + (fatal): Call it. + * diagnostic.h (set_fatal_function): New declaration. + +2000-08-15 William Cohen + + * config/sh/elf.h (DWARF2_DEBUGGING_INFO): Defined. + (PREFERRED_DEBUGGING_TYPE): Set to dwarf2 info. + (DWARF2_ASM_LINE_DEBUG_INFO): Defined. + +2000-08-15 Richard Henderson + + * flow.c (mark_used_reg): Set reg_cond_reg appropriately. + +2000-08-15 Richard Earnshaw + + * arm.c (arm_function_ok_for_sibcall): New function. + * arm.h (FUNCTION_OK_FOR_SIBCALL): Define. + * arm.md (call expanders): Don't check here for calls that can't + be sibling calls. + +2000-08-15 Richard Earnshaw + + * arm.md (splits generating cond_exec): Disable. + +2000-08-15 Richard Earnshaw + + * arm/linux-elf.h (text_section): Delete declaration. + +2000-08-15 Richard Earnshaw + + ARM support for unordered FP operations. + * arm-protos.h (arm_comparison_operator): Declare. + * arm.c (arm_comparison_operator): New function. + (arm_select_cc_mode): Add unordered comparison codes. + (get_arm_condition_code): Likewise. + (arm_final_prescan_insn): Can't handle unordered jumps that can't + be done in one insn. + * arm.h (PREDICATE_CODES): Add arm_comparison_operator. + * arm.md (all uses of comparison_operator): Replace with + arm_comparison_operator. + (bunordered, bordered, bugt, bunlt, bunge, bunle, buneq, bltgt): New + expands. + (arm_buneq, arm_bltgt, arm_buneq_reversed, arm_bltgt_reveresed): New + patterns. + +Tue Aug 15 00:36:36 2000 Ovidiu Predescu + + * gthr-posix.h: Conditionally include ; include + from libobjc/. + +2000-08-14 Richard Henderson + + * config/i386/i386.c (legitimize_pic_address): Use Pmode + for all CONSTs. + +2000-08-14 Richard Henderson + + * configure.in (ia64-*): Set float_format for i386 long double. + + * real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT + as we would for i386 XFmode. + (PUT_REAL): Likewise. + (endian, ereal_atof, real_value_truncate): Likewise. + (ereal_isneg, toe64, etens, make_nan): Likewise. + * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise. + + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.c (general_tfmode_operand): New. + (destination_tfmode_operand): New. + (tfreg_or_fp01_operand): New. + (ia64_split_timode): New. + (spill_tfmode_operand): New. + (ia64_expand_prologue): Use TFmode not XFmode. + (ia64_expand_epilogue): Likewise. + (ia64_function_arg): Likewise. + (ia64_function_arg_advance): Likewise. + (ia64_return_in_memory): Likewise. + (ia64_function_value): Likewise. + (ia64_print_operand): Likewise. + (ia64_register_move_cost): Set GR<->FR to 5. + (ia64_secondary_reload_class): Get GR for TImode memory op. + * config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove. + (ROUND_TYPE_ALIGN): Remove. + (LONG_DOUBLE_TYPE_SIZE): Set to 128. + (INTEL_EXTENDED_IEEE_FORMAT): Define. + (HARD_REGNO_NREGS): Use TFmode, not XFmode. + (HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs. + (MODES_TIEABLE_P): Use TFmode, not XFmode. + (CLASS_MAX_NREGS): Likewise. + (ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md (movti): New. + (movti_internal): Use a clobber for memory alternatives. + (reload_inti, reload_outti): New. + (movsfcc_astep): Predicate properly. + (movdfcc_astep): Likewise. + (movxf): Remove. + (movtf): New. + (extendsftf2, extenddftf2): New. + (trunctfsf2, trunctfdf2): New. + (floatditf2, fix_trunctfdi2): New. + (floatunsditf2, fixuns_trunctfdi2): New. + (addtf3, subtf3, multf3, abstf2): New. + (negtf2, nabstf2, mintf3, maxtf3): New. + (maddtf3, msubtf3, nmultf3, nmaddtf3): New. + (cmptf): New. + (fr_spill): Use TFmode, not XFmode. + (fr_restore): Likewise. + * config/ia64/lib1funcs.asm (__divtf3): New. + * config/ia64/t-ia64 (LIB1ASMFUNCS): Add it. + +2000-08-14 Kaveh R. Ghazi + + * cse.c (fold_rtx): Avoid empty body in an if-statement. + + * doloop.c (doloop_iterations_max, doloop_modify): Avoid using the + `U' integer constant suffix. + + * dwarf2out.c (add_subscript_info): Avoid empty body in an + else-statement. + + * sparc/sol2.h (__enable_execute_stack): Prototype. + +2000-08-14 David Edelsohn + + * collect2.c: Remove use of AIX import file. + + * longlong.h: Test ARCH_PWR not ARCH_POWER. + + * rs6000.c (print_operand, case 'E'): Add else. + +2000-08-14 Richard Henderson + + * config/ia64/ia64.md (movdi): Delay calling ia64_expand_load_address. + (movdi_symbolic): New. + +2000-08-14 Jim Wilson + + * config/ia64/ia64.h (ASM_SPEC): Pass -mconstant-gp and -mauto-pic + to GNU as. For Intel as, pass -M const_gp and -M no_plabel. + * config/ia64/linux.h (ASM_SPEC): Pass -mconstant-gp and -mauto-pic + to GNU as. + +2000-08-14 Richard Henderson + + * expr.c (emit_group_load): Don't force constants into registers. + Special case source already in the correct mode. + +2000-08-14 Zack Weinberg + + * configure.in: Accept *-*-linux* not just *-*-linux-gnu*. + * fixinc/inclhack.def: Likewise. + * fixinc/mkfixinc.sh: Likewise. + * configure: Regenerate. + * fixinc/fixincl.x: Regenerate. + * install.texi: Document equivalence of linux and linux-gnu. + +Mon Aug 14 18:51:44 2000 J"orn Rennecke + + * cse.c (insert_regs): Also in REG case: When finding an invalid + value, and we make a new quantity, make sure that it won't be + mistaken by for a valid one by mention_regs. + +2000-08-13 Ralf Gütlein + + * h8300.md: Remove obsolete peepholes. + +2000-08-13 Kazu Hirata + + * invoke.texi (H8/300 Options): Fix typos. + * config/h8300.c: Fix formatting. + * config/h8300.h: Fix comment typos. + (OVERRIDE_OPTIONS): Fix formatting. + + * function.c: Fix formatting. + + * cse.c: Fix formatting. + +2000-08-13 Geoff Keating + + * flow.c (attempt_auto_inc): Remove unused variable `bb'. + (attempt_auto_inc): Suppress parentheses warning. + * function.c (put_reg_into_stack): Remove unused variable `unsigned_p'. + * loop.c (load_mems): Remove `u' suffix in two places. + * config/rs6000/rs6000.c: Remove unnecessary `u' suffixes from + hex constants. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/sol-c0.c: Prototype some functions. Remove the + __eabi dummy routine. + * config/rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Remove unused + variable `buf_ptr'. + + * config/rs6000/rs6000.c (rs6000_select_section): Rewrite to + not put stuff in .sdata unnecessarily. + (rs6000_unique_section): New function. + * config/rs6000/rs6000-protos.h: Add rs6000_unique_section. + * config/rs6000/sysv4.h (UNIQUE_SECTION): Define. + + * c-typeck.c (build_array_ref): Don't complain about non-lvalue + arrays in C99. Don't try to look at DECL_REGISTER of a + COMPONENT_REF. Don't complain twice about the same error. + + * fixinc/inclhack.def (aix_pthread): New fix. + (aix_sysmachine): New fix. + * fixinc/fixincl.x: Regenerate. + + * expr.c (expand_expr): Call convert_modes when turning a large + multiply into a small one. + +2000-08-12 Geoff Keating + + * tree.h (DECL_OFFSET_ALIGN): Make the off_align field of + the tree structure an exponent rather than an explicit alignment + so it doesn't overflow. + (SET_DECL_OFFSET_ALIGN): New macro. + * stor-layout.c (place_union_field): Use SET_DECL_OFFSET_ALIGN + rather than DECL_OFFSET_ALIGN. + (place_field): Likewise. + * expmed.c (store_bit_field): Abort on align==0 to avoid + antisocial machine behavior. + +2000-08-12 Richard Henderson + + * sibcall.c (uses_addressof): Accept both addressof and + current_function_internal_arg_pointer inside a mem. + (optimize_sibling_and_tail_recursive_call): Fail tail recursion + if current_function_uses_addressof. + * stmt.c (expand_return): Kill tail recursion and HAVE_return + optimizations. + +2000-08-11 Richard Henderson + + * config/ia64/ia64.md (addsi3): Remove expander. + (subsi3, mulsi3, negsi2, one_cmplsi2): Likewise. + (*addsi3_shladd): New. + +2000-08-11 Richard Henderson + + * config/ia64/ia64.c (do_spill): Pass cfa offset to move expander. + (do_restore): Likewise. + (gen_movdi_x, gen_fr_spill_x, gen_fr_restore_x): New. + (ia64_expand_prologue, ia64_expand_epilogue): Use them. + (rtx_needs_barrier): Track actual bit manipulation for + ar.unat moves, gr_spill, and gr_restore. + (emit_insn_group_barriers): Special case gr_spill/gr_restore. + (process_set): Don't handle varargs spills. + * config/ia64/ia64.md (gr_spill): Accept cfa offset. Emit + .mem.offset here instead of in process_set. + (gr_restore): Likewise. + +2000-08-11 Richard Henderson + + * config/ia64/ia64.h (PROMOTE_MODE): Only extend to SImode. + +2000-08-11 Mark Elbrecht + + * gcc.texi (The Configuration File): Document + COLLECT2_HOST_INITIALIZATION, GCC_DRIVER_HOST_INITIALIZATION, and + UPDATE_PATH_HOST_CANONICALIZATION. + +2000-08-11 Kaveh R. Ghazi + + * c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for + unprototyped function pointer casts on integer constants. + +2000-08-11 Laurynas Biveinis + + * fixproto: Recognize DOS paths with drive letters as absolute paths. + +2000-08-11 Nathan Sidwell + + * extend.texi (Volatiles): Fix typos. + +2000-08-11 Kazu Hirata + + * flow.c: Fix formatting. + +2000-08-11 Richard Henderson + + * reload.c (push_secondary_reload): When invoking a reload_{in,out} + pattern, always allocate a tertiary scratch register. + + * config/alpha/alpha.md (reload_inqi): Use a DImode scratch. + (reload_inhi): Likewise. + +2000-08-11 Richard Henderson + + * function.c (put_reg_into_stack): Allow type to be NULL. + (schedule_fixup_var_refs): Likewise. + (gen_mem_addressof): Allow decl to be NULL. + (put_addressof_into_stack): Likewise. + + * flow.c (merge_blocks_nomove): Be more careful about + locating the beginning of block A. + + * combine.c (simplify_shift_const): Obey SHIFT_COUNT_TRUNCATED. + +Thu Aug 10 22:47:09 2000 Ovidiu Predescu + + * configure.in: + * configure: + * gthr-posix.h: + * config.in: Reverted the check for . + +2000-08-10 Chris Demetriou + + * mips/elf.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME): New + macros define the name of CTOR and DTOR sections. + (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN, + DTOR_LIST_END): Change to use attributes to specify + sections. + * mips/elf64.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME, + (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN, + DTOR_LIST_END): Same as in mips/elf.h. + +2000-08-10 Drew Moseley + + * config/mn10300/mn10300.h: Added no-crt0 option for explicitly + disabling just crt0.o. + +2000-08-10 Richard Earnshaw & Nick Clifton + + * arm.h (CPP_SPEC): Use sub-spec cpp_interwork. + (CPP_INTERWORK_SPEC, CPP_INTERWORK_DEFAULT_SPEC): New sub-specs. + (EXTRA_SPECS): Add them. + * arm/lib1funcs.asm: Support builds for interworking. + Use macros to eliminate duplicated pieces of code. + +2000-08-10 Kazu Hirata + + * h8300.c (expand_a_rotate): New. + (emit_a_rotate): Likewise. + (h8300_adjust_insn_length): Add support for the rotate insns. + * h8300.md (rotlqi3): New. + (*rotlqi3_1): Likewise. + (rotlhi3): Likewise. + (*rotlhi3_1): Likewise. + (rotlhi3): Likewise. + (*rotlhi3_1): Likewise. + * h8300-proto.h: Add prototypes for expand_a_rotate and + emit_a_rotate. + + * h8300.c: Fix comment typos. + (dosize): Declare the variable amount as unsigned. + (get_shift_alg): Fix a comparison between signed and unsigned. + (emit_a_shift): Likewise. + (h8300_adjust_insn_length): Simplify the code. + + * c-decl.c: Fix formatting. + +2000-08-10 Kaveh R. Ghazi + + * c-lex.c (parse_float, yylex): For -Wtraditional, issue a + warning about non-traditional numeric constant suffixes. + + * cppexp.c (parse_number): Likewise. + + * invoke.texi: (-Wtraditional): Document new behavior. + +Thu Aug 10 00:11:04 2000 Ovidiu Predescu + + * gthr-posix.h: Include auto-host.h. Conditionally include + . + * configure.in: Check for the header file. + * config.in: Added define for HAVE_SCHED_H. + +2000-08-09 Kaveh R. Ghazi + + * c-typeck.c (process_init_element): For -Wtraditional, warn about + initialization of unions. + + * invoke.texi (-Wtraditional): Document new behavior. + +2000-08-09 Zack Weinberg + + * configure.in (--enable-c-cpplib): Uncomment. Use AC_DEFINE + instead of extra_c_flags. + (--enable-c-mbchar): Use AC_DEFINE instead of extra_c_flags. + * configure: Regenerate. + * config.in: Regenerate. + + * cpperror.c (cpp_type2name): New function. + * cpplex.c (lex_line): If we issued an error for an invalid + preprocessing directive, discard that logical line. + * cpplib.c (do_line): Call a hook function if the current file + is renamed by #line. + (do_ident): Pass the contents of the string, not the entire + token, to the callback function. + * cpplib.h (CPP_LAST_PUNCTUATOR): New #define. + (cb.rename_file): New hook function. + (cb.ident): Adjust prototype. + (cpp_type2name): Prototype. + * cppmacro.c (dump_macro_args): Correct precedence lossage. + + * cppmain.c (cb_ident): Update for changed interface. + (cb_rename_file): New function. + (main): Set rename callback. + +2000-08-09 Alexandre Oliva + + * caller-save.c (mark_referenced_regs): Mark partially-overwritten + multi-word registers. + +2000-08-08 Joseph S. Myers + + * c-common.c (combine_strings, check_format_info): Refer to ISO C + or ISO C89 instead of ANSI C. + * c-decl.c (grokdeclarator, xref_tag, finish_struct, + build_enumerator, do_case): Likewise. + * c-lex.c (parse_float, yylex): Likewise. + * c-parse.in: Likewise. + * c-typeck.c (common_type, build_array_ref, build_binary_op, + build_unary_op, pedantic_lvalue_warning, build_conditional_expr, + build_c_cast, convert_for_assignment, set_init_index, + set_init_label, c_expand_start_case): Likewise. + * toplev.c (documented_lang_options, display_help): Likewise. + +2000-08-08 Kazu Hirata + + * h8300.c: Fix formatting. + * h8300.h: Likewise. + * h8300.md: Likewise. + (movsi_h8300hs): Fix formatting of the resulting assembly code. + + * reload1.c: Fix formatting. + +2000-08-08 Rodney Brown + + * alpha/alpha.c (alpha_emit_xfloating_libcall): + Use GEN_CALL_VALUE define. + * alpha/alpha.md (untyped_call): Use GEN_CALL define. + * clipper/clipper.md (untyped_call): Likewise. + * dsp16xx/dsp16xx.md (untyped_call): Likewise. + * fx80/fx80.md (untyped_call): Likewise. + * mips/mips.md (untyped_call): Likewise. + * ns32k/ns32k.md (untyped_call): Likewise. + * pa/pa.md (untyped_call): Likewise. + * romp/romp.md (untyped_call): Likewise. + * sparc/sparc.md (untyped_call): Likewise. + +2000-08-08 Jason Eckhardt + + * config/i860/i860.c (singlemove_string): Do not generate assembler + pseudo instructions that must be expanded (that is, with signed + constants larger than 16 bits). + +2000-08-08 Richard Henderson + + * flow.c (life_analysis): Only turn off PROP_LOG_LINKS and + PROP_AUTOINC at -O0. Don't collect alias info at -O0. + (init_propagate_block_info): Don't kill memory stores at -O0. + (mark_set_1, mark_used_regs): Likewise. + +2000-08-08 David Edelsohn + + * rs6000.c (optimization_options): Decorate 'level' as + ATTRIBUTE_UNUSED. + (mask64_operand): Remove sign-extend thinko. + (rldic_operand): New function. + (load_multiple_operation): regno's are unsigned ints. + (store_multiple_operation): Likewise. + (lmw_operation): Likewise. + (stmw_operation): Likewise. + (includes_lshift_p): shift_mask is unsigned int. + (includes_lshift64_p): New function. + (addrs_ok_for_quad_peep): unsigned int reg1. + (print_operand): Consistently add "else" after + output_operand_lossage(). + (print_operand, case 'b'): Fold in case 'W'. + (print_operand, case 'W'): Print rldic MB value. + (output_epilogue): Update Objective-C language string. + (output_toc): unsigned HOST_WIDE_INT low, compare unsigned. + * rs6000.h (PREDICATE_CODES): Add rldic_operand. + * rs6000.md (ashldi3): Add rldic instruction. + (iordi3, xordi3): Remove redundant "else if CONST_DOUBLE". + (cmpsi_internal2, cmpdi_interal2): Use 'b' output template + modifier. + +2000-08-08 Richard Henderson + + * config/ia64/ia64-protos.h: Remove duplicates. Update + for massive code rearrangements. + * config/ia64/ia64.c (ia64_arpfs_regno): Remove. + (ia64_rp_regno, ia64_fp_regno, ia64_input_regs): Remove. + (ia64_local_regs, ia64_need_regstk): Remove. + (ar_ccv_reg_operand): New. + (ia64_gp_save_reg): New. + (struct ia64_frame_info): Combine most of the size elements; + add new gr save elements. + (find_gr_spill): New. + (next_scratch_gr_reg): New. + (mark_reg_gr_used_mask): New. + (ia64_compute_frame_size): Rewrite. Allocate special AR regs + to GR backing store regs when possible. + (ia64_initial_elimination_offset): New. + (ia64_rap_fp_offset): Remove. + (save_restore_insns): Remove. + (setup_spill_pointers): New. + (finish_spill_pointers): New. + (spill_restore_mem): New. + (do_spill, do_restore): New. + (ia64_expand_prologue): Rewrite to use them. + (ia64_expand_epilogue): Likewise. + (ia64_direct_return): Update for current_frame_info changes. + (ia64_function_prologue): Simplify .prologue emission. Emit + .spill when needed. + (ia64_setup_incoming_varargs): Don't ever emit rtl. + (ia64_dbx_register_number): New. + (ia64_initialize_trampoline): New. + (ia64_secondary_reload_class): Request GR_REGS for integer + arithmetic destined for FR_REGS. + (ia64_init_machine_status): Don't reset return_address_pointer_rtx. + (ia64_mark_machine_status): Mark ia64_gp_save. + (rws_access_regno): Rename from rws_access_reg; don't treat + predicates specially. + (rws_access_reg): New. Update all callers. + (rtx_needs_barrier): Remove dead unspecs. + (ia64_epilogue_uses): Mark ar.pfs and ar.unat live on exit. + (ia64_encode_section_info): Silence signed/unsigned warnings. + (spill_offset, sp_offset, spill_offset_emitted): Remove. + (tmp_reg, tmp_saved): Remove. + (process_set): Rewrite to expect complicated bits via + REG_FRAME_RELATED_EXPR. + (ia64_expand_fetch_and_op): Use emit_move_insn; be explicit + in the use of ar.ccv; never set RTX_UNCHANGING_P. + (ia64_expand_op_and_fetch): Likewise. + (ia64_expand_compare_and_swap): Likewise. + (ia64_expand_builtin): Likewise. + * config/ia64/ia64.h (AR_UNAT_REGNUM): New. + (FIRST_PSEUDO_REGISTER): Update. + (AR_M_REGNO_P): Update. + (FIXED_REGS): Don't mark three local registers as used. + (EXTRA_CC_MODES): New. + (SELECT_CC_MODE): New. + (HARD_REGNO_NREGS): Allow DImode in p0; handle CCImode. + (HARD_REGNO_MODE_OK): Disallow CCImode from non-predicates. + (FRAME_GROWS_DOWNWARD): Unset. + (STARTING_FRAME_OFFSET): Zero. + (ELIMINABLE_REGS): Eliminate from the soft to hard frame pointer. + (INITIAL_ELIMINATION_OFFSET): Defer to out of line function. + (HARD_FRAME_POINTER_REGNUM): New. + (CAN_DEBUG_WITHOUT_FP): Define. + (TRAMPOLINE_TEMPLATE): Remove. + (TRAMPOLINE_SIZE): Lower to 32. + (TRAMPOLINE_ALIGNMENT): Lower to 64. + (INITIALIZE_TRAMPOLINE): Defer to out of line function. + (PREDICATE_CODES): Update. + (struct machine_function): Add ia64_gp_save. + * config/ia64/ia64.md: Purge unused unspecs. + (movsi patterns): Allow moves to/from AR_M_REGS. + (movdi patterns): Allow moves to/from p0. + (call patterns): Move most setjmp hackery to ia64_gp_save_reg. + (gr_spill, gr_restore): Indicate ar.unat read/written. + (nonlocal_goto): Don't pass old frame_pointer. + (nonlocal_goto_receiver): Remove. + (exception_receiver): New. + (builtin_setjmp_setup): New. + (builtin_setjmp_receiver): New. + * config/ia64/lib1funcs.asm (__ia64_save_stack_nonlocal): Bundle. + (__ia64_nonlocal_goto): Bundle. Don't kill r7. + (__ia64_restore_stack_nonlocal): Likewise. + (__ia64_trampoline): New. + * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Defer to out of line + function. + * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __trampoline. + +2000-08-08 Richard Henderson + + * frame.h (ia64_frame_state): Add my_psp. + * libgcc2.c (ia64_throw_helper): Add throw_sp argument. + (__throw): Pass it in. Don't clobber r7. + * config/ia64/frame-ia64.c (init_ia64_reg_loc): Mark inline. + (execute_one_ia64_descriptor) [mem_stack_v]: Sets psp.when + and nothing to do with sp. + (normalize_reg_loc): Use frame->my_psp. + (frame_translate): Handle frame-pointer-less functions. Set + spill_base correctly, in absence of being told. + (__build_ia64_frame_state): New sp argument. Fill in frame->my_sp. + (__ia64_backtrace_helper): New sp argument. Use + builtin_return_address instead of label addresses. + (print_record) [mem_stack_v]: No size member. + +2000-08-08 Richard Henderson + + * regclass.c (choose_hard_reg_mode): Iterate over all CC modes. + +2000-08-08 Richard Henderson + + * tm.texi (LOCAL_REGNO): Document. + * flow.c (LOCAL_REGNO, EPILOGUE_USES): Provide default. + (mark_regs_live_at_end): Don't mark LOCAL_REGNO registers. + * reload1.c (reload): Likewise when considering nonlocal labels. + + * config/ia64/ia64.h (LOCAL_REGNO): New. + * config/sparc/sparc.h (LOCAL_REGNO): New. + +2000-08-08 Joseph S. Myers + + * c-lex.c (yylex): Don't allow integer suffixes 'LUL', 'Ll', 'lL'. + +2000-08-07 Nick Clifton + + * config/mips/mips.c: Fix compile time warning messages. + * config/mips/mips-protos.h: Add prototype for equality_op. + + * mn10300.h (TARGET_SWITCHES): Document `-mam33'. + +2000-08-07 Graham Stott + + * mn10300.md: Use nonimmediate_operand instead of general_operand + on output operands. + + * mn10300.h (PREFERRED_RELOAD_CLASS): Limit memory reloads. + +2000-08-07 Alexandre Oliva + + * sh.h (EXTRA_CONSTRAINT_Q): Adjust to GNU Coding Standards. + * sh.c (expand_block_move): Break long lines. + (expand_ashiftrt, fpscr_set_from_mem): Likewise. + * sh.md (mulsi3): Likewise. + (movdi): Adjust spacing. + +2000-08-07 Richard Henderson + + * expmed.c (store_bit_field): Don't require MEM_IN_STRUCT_P. + * expr.c (emit_group_store): Don't set it. + +2000-08-07 Kazu Hirata + + * invoke.texi (Options for Debugging Your Program or GCC): Remove + duplicate entries for 'w' and 'z'. + + * flow.c: Fix a comment typo. + +Sun Aug 6 23:47:35 2000 Ovidiu Predescu + + * c-parse.in: Changed the language string for Objective-C to "GNU + Objective-C". + +Sun Aug 6 11:54:03 2000 Ovidiu Predescu + + * gthr-posix.h: Integrated Chris Ball's changes + to improve the Posix thread support for Objective-C. + +2000-08-06 Joseph S. Myers + + * c-common.h (enum c_tree_index): Add CTI_SIGNED_SIZE_TYPE and + CTI_UNSIGNED_PTRDIFF_TYPE. + (signed_size_type_node): Define. + (unsigned_ptrdiff_type_node): Define. + * c-decl.c (init_decl_processing): Create the + signed_size_type_node and unsigned_ptrdiff_type_node types. + * c-common.c (T_SC): Define. + (T_SST): Define. + (T_UPD): Define. + (print_char_table): Use T_SST for %zd, %zi, %zn. Use T_UPD for + %to, %tu, %tx, %tX. Allow %hhn (T_SC). Add "c" to the flags for + %s and %p. + (scan_char_table): Use T_SC for %hhd, %hhi, %hhn. Use T_SST for + %zd, %zi, %zn. Use T_UPD for %to, %tu, %tx, %tX. Add "c" to the + flags for %c, %s and %[. + (check_format_info): Only allow leniency for signedness of targets + of character pointers (when pedantic) for formats flagged with + "c", so for strings but not for %hh formats. When pedantic, don't + allow character pointers to substitute for void pointers if a + second level of indirection is present. + +2000-08-06 Kazu Hirata + + * invoke.texi (Options for Debugging Your Program or GCC): Update + the names of dump files. + + * h8300.c (dosize): Rearrange code for conciseness. + (split_adds_subs): Likewise. + + * loop.c: Fix formatting. + + * dwarf2out.c: Fix formatting. + + * tm.texi (FUNCTION_ARG_PARTIAL_NREGS): Fix a typo. + + * expr.c: Fix formatting. + +2000-08-06 Kaveh R. Ghazi + + * rs6000.c (rs6000_maybe_dead): Prototype. + +2000-08-06 Richard Henderson + + * stmt.c (expand_goto): Do virtual_stack_vars_rtx replacement for + HAVE_nonlocal_goto as well. + * config/i960/i960.md (nonlocal_goto): Don't do it here. + * config/pj/pj.md (nonlocal_goto): Likewise. + +2000-08-07 Michael Hayes + + * loop.c (try_swap_copy_prop): New function. + (load_mems): Rename copies to load_copies and add new regset + store_copies. Check for sets of shadow registers and mark + in store_copies. Call try_swap_copy_prop for registers + marked in store_copies. + +Sun Aug 6 00:54:42 2000 Ovidiu Predescu + + * objc/objc-act.c: New command line option -fconstant-string-class + to allow specifying a user defined constant string class, + different from NXConstantString. + + * toplev.c: Moved the Objective-C specific options to + objc/lang-options.h. + + * objc/lang-options.h: Moved the Objective-C specific options from + toplev.c. Added -fconstant-string-class. + +2000-08-05 Chris Demetriou + + * mips/elf.h (CTOR_LIST_BEGIN, CTOR_LIST_END, + DTOR_LIST_BEGIN, DTOR_LIST_END): change type of + __CTOR_LIST__ from func_ptr array to just func_ptr, to + avoid extra alignment imposed on arrays. + * mips/elf64.h (CTOR_LIST_BEGIN, CTOR_LIST_END, + DTOR_LIST_BEGIN, DTOR_LIST_END): Likewise. + + * mips.h: Clean up comments and spacing near MASKs. + (TARGET_UNIX_ASM): Delete. + (MASK_MIPS16, MASK_NO_CHECK_ZERO_DIV, MASK_CHECK_RANGE_DIV, + MASK_UNINIT_CONST_IN_RODATA): Change values to make mask + values contiguous. + +2000-08-05 Joseph S. Myers + + * c-common.c (print_char_table): Add entries for the X/Open ' + format flag (print decimals with locale's thousands grouping + character). Make %C expect wint_t. + (check_format_info): If pedantic, warn when the %n$ operand + number form is used. Allow for the ' flag; warn about it if + pedantic. + +2000-08-05 Zack Weinberg + + * i386.h (FUNCTION_OK_FOR_SIBCALL): Not OK if DECL's return + type is a float mode, cfun->decl's return type is not, and + TARGET_FLOAT_RETURNS_IN_80387. + +2000-08-04 Andreas Schwab + + * cppmain.c (cb_def_pragma): Skip the first two tokens from the + token list, which are always `#' and `pragma'. + +2000-08-04 Zack Weinberg + + * tree.c (tree_expr_nonnegative_p): Move to... + * fold-const.c: ... here. Also handle BIND_EXPR and RTL_EXPR. + (rtl_expr_nonnegative_p): New. + * tree.h: Add prototype for rtl_expr_nonnegative_p. + + * real.h (CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH, CONST_DOUBLE_MEM, + CONST_DOUBLE_CHAIN: Move to... + * rtl.h: ...here. Use XCINT/XCEXP. + + * Makefile.in: Remove toplev.o from OBJS. Add rule to make + libbackend.a; add libbackend.a to STAGESTUFF. Add BACKEND + variable. Use BACKEND when linking cc1, not OBJS. Add BACKEND + to VOL_FILES. + + * objc/Make-lang.in (cc1obj): Link with $(BACKEND). + +2000-08-05 Herman A.J. ten Brugge + + * config/c4x/c4x.md (return_indirect_internal): New. + * config/c4x/c4x.c (c4x_expand_epilogue): Use it. + +2000-08-04 Joseph S. Myers + + * c-common.c (time_char_table): Mark up formats added in C99 and + make other corrections. %D and %g were added in C99. %Og is an + extension. %EX is permitted. %R, %T, %n, %r, %t were added in + C99. %e was added in C99. %Oj is an extension. %G and %z are in + C99 rather than GNU extensions, but %OG and %Oz are extensions. + %h was added in C99. %C was added in C99. %OY and %OC are + extensions. Add the C99 format %F. + (check_format_info): If pedantic and not in C99 mode, warn for C99 + formats, %E and %O. + +Fri Aug 4 23:01:58 2000 J"orn Rennecke + + * function.c (schedule_fixup_var_refs): New function, broken out + of put_reg_into_stack. + (put_reg_into_stack): Use it. + (put_var_into_stack): In CONCAT case, fixup up references for + components only after fixing up references to the whole concat. + +2000-08-04 Rodney Brown + + * alias.c (mark_constant_function): Use INSN_P. + (init_alias_analysis): Likewise. + * combine.c (combine_instructions): Use INSN_P. + (can_combine_p): Likewise. + (try_combine): Likewise. + (distribute_notes): Likewise. + (distribute_links): Likewise. + * cse.c (cse_around_loop): Use INSN_P. + (invalidate_skipped_block): Likewise. + (cse_set_around_loop): Likewise. + (cse_end_of_basic_block): Likewise. + (delete_trivially_dead_insns): Likewise. + * emit-rtl.c (unshare_all_rtl_again): Use INSN_P. + (unshare_all_rtl_1): Likewise. + (next_cc0_user): Likewise. + (try_split make_insn_raw): Likewise. + (remove_unnecessary_notes): Likewise. + * final.c (shorten_branches): Use INSN_P. + (leaf_renumber_regs): Likewise. + (leaf_renumber_regs_insn): Likewise. + * flow.c (find_label_refs): Use INSN_P. + (verify_wide_reg): Likewise. + (notice_stack_pointer_modification): Likewise. + (count_or_remove_death_notes): Likewise. + (verify_flow_info): Likewise. + (clear_log_links): Likewise. + * function.c (fixup_var_refs_insns): Use INSN_P. + (compute_insns_for_mem): Likewise. + * gcse.c (alloc_gcse_mem): Use INSN_P. + (compute_sets): Likewise. + (compute_hash_table): Likewise. + (classic_gcse): Likewise. + (cprop): Likewise. + (insert_insn_end_bb): Likewise. + (delete_null_pointer_checks_1): Likewise. + * global.c (expand_preferences): Use INSN_P. + (build_insn_chain): Likewise. + * graph.c (node_data): Use INSN_P. + * haifa-sched.c (priority): Use INSN_P. + (rm_line_notes): Likewise. + (rm_other_notes): Likewise. + (find_insn_reg_weight): Likewise. + (init_target_units): Likewise. + (schedule_block): Likewise. + (compute_block_forward_dependences): Likewise. + (debug_dependencies): Likewise. + (set_priorities): Likewise. + * integrate.c (function_cannot_inline_p): Use INSN_P. + (save_parm_insns): Likewise. + (copy_insn_list): Likewise. + * jump.c (mark_all_labels): Use INSN_P. + (never_reached_warning): Likewise. + * lcm.c (optimize_mode_switching): Use INSN_P. + * local-alloc.c (validate_equiv_mem): Use INSN_P. + (memref_used_between_p): Likewise. + (update_equiv_regs): Likewise. + (block_alloc): Likewise. + (no_conflict_p): Likewise. + * loop.c (scan_loop): Use INSN_P. + (find_and_verify_loops): Likewise. + (count_loop_regs_set): Likewise. + (loop_reg_used_before_p): Likewise. + (strength_reduce): Likewise. + (recombine_givs): Likewise. + (check_dbra_loop): Likewise. + (load_mems): Likewise. + (try_copy_prop): Likewise. + * print-rtl.c (print_rtx): Use INSN_P. + * recog.c (find_single_use): Use INSN_P. + * reg-stack.c (stack_regs_mentioned): Use INSN_P. + (next_flags_user): Likewise. + (swap_rtx_condition): Likewise. + * regmove.c (mark_flags_life_zones): Use INSN_P. + (optimize_reg_copy_1): Likewise. + (optimize_reg_copy_2): Likewise. + (optimize_reg_copy_3): Likewise. + (reg_is_remote_constant_p): Likewise. + (fixup_match_2): Likewise. + (regmove_optimize): Likewise. + (fixup_match_1): Likewise. + * regrename.c (build_def_use): Use INSN_P. + (replace_reg_in_block): Likewise. + (consider_use): Likewise. + * reload.c (find_equiv_reg): Use INSN_P. + * reload1.c (reload): Use INSN_P. + (maybe_fix_stack_asms): Likewise. + (calculate_needs_all_insns): Likewise. + (reload_as_needed): Likewise. + (emit_output_reload_insns): Likewise. + (delete_address_reloads_1): Likewise. + (reload_cse_regs_1): Likewise. + (reload_combine): Likewise. + (reload_cse_move2add): Likewise. + * reorg.c (redundant_insn): Use INSN_P. + (dbr_schedule): Likewise. + * resource.c (find_dead_or_set_registers): Use INSN_P. + (mark_target_live_regs): Likewise. + * rtlanal.c (reg_used_between_p): Use INSN_P. + (reg_referenced_between_p): Likewise. + (reg_set_between_p): Likewise. + (reg_set_p): Likewise. + (single_set): Likewise. + (multiple_sets): Likewise. + (find_last_value): Likewise. + (reg_set_last): Likewise. + (find_reg_note): Likewise. + (find_regno_note): Likewise. + * sibcall.c (sequence_uses_addressof): Use INSN_P. + * simplify-rtx.c (cselib_process_insn): Use INSN_P. + * ssa.c (find_evaluations): Use INSN_P. + (rename_block): Likewise. + (rename_equivalent_regs): Likewise. + * unroll.c (loop_find_equiv_value): Use INSN_P. + (set_dominates_use): Likewise. + * varasm.c (mark_constant_pool): Use INSN_P. + (mark_constants): Likewise. + * config/alpha/alpha.c (alpha_does_function_need_gp): Use INSN_P. + (alphaev4_next_group): Likewise. + (alphaev5_next_group): Likewise. + * config/c4x/c4x.c (c4x_process_after_reload): Use INSN_P. + (c4x_rptb_rpts_p): Likewise. + * config/mips/mips.c (mips16_optimize_gp): Use INSN_P. + * config/rs6000/rs6000.c (uses_TOC): Use INSN_P. + (rs6000_adjust_priority): Likewise. + * config/sh/sh.c (sh_loop_align): Use INSN_P. + (machine_dependent_reorg): Likewise. + (split_branches): Likewise. + * config/tahoe/tahoe.c (tahoe_cmp_check): Use INSN_P. + +Fri Aug 4 11:43:49 2000 John Wehle (john@feith.com) + + * combine.c (recog_for_combine): Remove the old notes + prior to attempting to recognize the new pattern. + (distribute_notes): Ignore REG_NONNEG notes. + +2000-08-04 Chandrakala Chavva + + * varasm.c (output_constructor): Add .align 0 for packed vars. + +2000-08-04 J. David Anglin + + * configure.in: Use default thread_file even when enable_threads is + yes or dce because hpux10.20 pa port uses MULTILIB implementation. + * configure: Rebuilt. + + * gthr-dce.h (__gthread_objc_condition_allocate): Fix typo. + +2000-08-04 Donn Terry (donnte@microsoft.com) + + * prefix.c (translate_name): Don't strip trailing DIR_SEPARATOR. + +2000-08-04 Mark Elbrecht + + * i386/x-djgpp: Delete code that conditionally modifies target_alias. + Delete code that conditionally modifies 'version'. + Delete X_CPPFLAGS. Add comment for SYSTEM_HEADER_DIR. + * i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): New macro. + * gcc.c (main): Use it. + * config/i386/xm-djgpp.h (UPDATE_PATH_HOST_CANONICALIZE): New macro. + * prefix.c (update_path): Use it. + * i386/djgpp.h (STANDARD_INCLUDE_DIR): Define. + (MD_EXEC_PREFIX): Set to '/dev/env/DJDIR/bin/'. + (ASM_OUTPUT_SECTION_NAME): Add code attribute to sections containing + code. + (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY): Default to true. + (SUBTARGET_SWITCHES): Adjust. + (WCHAR_UNSIGNED, WCHAR_TYPE_SIZE, WCHAR_TYPE): Undefine before + defining. + (WINT_TYPE, SIZE_TYPE, PTRDIFF_TYPE): Define. + +2000-08-04 Joseph S. Myers + + * c-common.h (flag_isoc94): Declare. + * c-decl.c (flag_isoc94): Define. + (c_decode_option): Set flag_isoc94 as appropriate. + * c-common.c (T_PD, T_IM, T_UIM): Define. + (format_char_info): Add tlen and jlen. + (print_char_table): Add entries for %t and %j. Allow %zn. Allow + %F. Allow %lf. + (scan_char_table): Add entries for %t and %j. Allow %F. Allow + %l[. + (time_char_table): Add NULL entries for %t and %j. + (check_format_info): Allow for %t and %j. Warn for %F if pedantic + and not C99. Warn for %lc, %ls and %l[ if pedantic and not C94. + Warn for printf %lf if pedantic and not C99. Don't warn for empty + precision. Allow precision argument to be unsigned int. If + pedantic, warn for %p passed an argument not a pointer to possibly + qualified void or a possibly qualified character type, and for + pointer targets of the wrong sign, except for character pointers. + +2000-08-04 Joseph S. Myers + + * ginclude/stddef.h: Don't declare wint_t unless __need_wint_t. + * c-common.h (enum c_tree_index): Add CTI_WINT_TYPE. + (wint_type_node): Define. + * c-decl.c (WINT_TYPE): Define. + (init_decl_processing): Create the wint_type_node type. + * c-common.c (T_WI): Define. + (print_char_table): Use T_WI for %lc format. + +2000-08-04 Bruce Korb + + * fixinc/: Verified that the MSDOS patch does not break + the UNIX functionality and applied the next three patches + from July: + +2000-07-28 Eli Zaretskii + + * fixinc/fixfixes.c (main) [__MSDOS__]: Avoid overwriting the + output file with the temporary one by appending ".X" to generate + the temporary fuile's name. If the output file already has an + extension, replace it with ".X". + + * fixinc/fixincl.c (fix_with_system) [__MSDOS__]: Use $ORIGDIR, + not $DESTDIR, to find applyfix. Use sprintf instead of snprintf; + reallocate the command buffer while copying the command-line + argument. Redirect the output directly to the temporary file, + instead of going through another temporary file. + (process): Close the temporary file before unlinking it. + (machine_matches) [__MSDOS__]: If the machine doesn't match, set + the FD_SKIP_TEST flag. Pay attention to the FD_MACH_IFNOT flag. + (run_compiles): Pass p_fixd argument to machine_matches, as it + expects. + + * fixinc/fixincl.sh: Export ORIGDIR. If $DJDIR is set in the + environment, assume there are no symlinks in the include + directory. When cleaning up the DONE files, look for them + case-insensitively. Don't try to remove symlinks if they aren't + there. + + * fixinc/fixlib.c (make_raw_shell_str): Accept new argument smax; + all callers changed. Declare pz "const char *", to avoid compiler + warnings. + + * fixinc/fixlib.h (ENV_TABLE): Get ORIGDIR from the environment. + Change prototype of make_raw_shell_str. + +2000-07-27 Eli Zaretskii + + * fixinc/fixincl.c [__MSDOS__]: Don't include "server.h". + (initialize) [__MSDOS__]: Use tempnam. + (initialize): Don't use SIGPIPE if it is not defined. + + * fixinc/fixfixes.c (main) [__MSDOS__]: freopen for stdout should + return stdout. + +2000-07-25 Bruce Korb + + * fixinc/fix*.[ch]: substantially reworked to make it possible + to run this program without using fork(2) or pipe(2) (i.e. in + a DOS environment). + +2000-08-04 Joseph S. Myers + + * cppdefault.h (WINT_TYPE): Define. + * cppinit.c (builtin_array): Define __WINT_TYPE__. + * tradcpp.c (initialize_builtins): Define __WINT_TYPE__. + * tm.texi (NO_BUILTIN_WINT_TYPE, WINT_TYPE): Document. + +Fri Aug 4 06:53:46 2000 Clinton Popetz + + * (mips_legitimate_address_p): Don't allow register+offset + if the offset is large and negative, and we are compiling + for 64 bit registers. + +2000-08-04 Herman A.J. ten Brugge + + * gencodes.c (main): Define CODE_FOR_nothing as the last possible + insn_code_number + 1. + +2000-08-04 Kazu Hirata + + * h8300.c (function_prologue): Rearrange code for conciseness. + (function_epilogue): Likewise. + * h8300.h (OK_FOR_U): Fix formatting. + + * cse.c: Fix a comment typo. Fix formatting. + +2000-08-03 Richard Henderson + + * config/i386/i386.md (return_indirect_internal): New. + * config/i386/i386.c (ix86_expand_epilogue): Use it. + +2000-08-03 Zack Weinberg + + * cpplex.c (parse_name): Might have to glue a CPP_OTHER token + before the name. + (lex_line): Glue @ onto the beginning of identifiers and + string constants, in Objective-C mode. + (output_token, spell_token): Handle CPP_OSTRING. + (can_paste, maybe_paste_with_next): Handle pasting @ onto the + beginning of a NAME or a STRING, in objc mode. + + * cpplib.c (get_define_node): Do not permit identifiers that + begin with @ to be #defined. + * cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER. + * cpplib.h (TTYPE_TABLE): Add CPP_OSTRING. + + * c-lang.c, objc/objc-act.c (build_objc_string): Delete. + * c-tree.h (build_objc_string): Delete prototype. + * objc/objc-tree.def: Delete OBJC_STRING_CST. + * c-lex.c (yylex): Use build_string for all three kinds of strings. + + * c-parse.in, objc/objc-act.c: Update commentary. + +2000-08-03 Mark Mitchell + + * extend.texi: Fix typo in last change. + + * extend.texi: Add commentary on statement-expressions and their + interactions with C++. + +2000-08-03 Nick Clifton + + * dwarf2.h (DW_LANG_Java): Change value to 0x000b. + * dwarf.h (LANG_JAVA): Change value to 0x000b. + +2000-08-03 Anthony Green + + * dwarf2out.c (gen_compile_unit_die): Add java language support. + (add_bound_info): Check for java language. + (is_java): New function. + * dwarfout.c (output_compile_unit_die): Ditto. + * dwarf.h (dwarf_source_language): Add java source language type. + * dwarf2.h (dwarf_source_language): Ditto. + +Thu Aug 3 20:32:25 MET DST 2000 Jan Hubicka + + * reg-stack.c (subst_stack_regs_pat): Use replace_reg to swap + operands. + + * i386.c (ix86_expand_branch): Mode of comparison in + IF_THEN_ELSE is VOIDmode. + +Thu Aug 3 10:05:53 2000 Akiko Matsushita + + * gengenrtl.c, rtl.c: Avoid #elif. + +2000-08-03 Michael Poole + + * tm.texi (Register Classes): Clarify order of sub-initializers + in REG_CLASS_CONTENTS. + +Thu Aug 3 15:53:03 2000 J"orn Rennecke + + From SAITOH Masanobu: + * sh.h (ASM_OUTPUT_REG_PUSH): Fix syntax. + +2000-08-03 David Billinghurst + + * config/i386/cygwin.h: Remove -remap from CPP_SPEC since this option + is not supported by tradcpp and isn't actually needed for cygwin. + +2000-08-03 Kazu Hirata + + * h8300.c: Fix a comment typo. + * h8300.h (OK_FOR_U): Accept a 32-bit constant address on H8S. + + * jump.c: Fix formatting. + + * toplev.c: Fix formatting. + +Thu Aug 3 01:05:32 2000 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_auto_inc): Verify that we've got a REG before + peeking at its regno. Fail, don't abort if we can't find + the increment of the desired register. + + * pa.md (shadd height reduction patterns/splitters): Remove. + +2000-08-02 Jim Wilson + + * config/ia64/ia64-protos.h (flag_ssa): Declare. + * config/ia64/ia64.md (movti_internal, movti_internal+1): New. + +2000-08-02 Mark Mitchell + + * dce.c: Remove all uses of assert. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * ssa.c: Likewise. + +2000-08-02 Zack Weinberg + + * gcc.h (lang_specific_driver): Constify second argument. + * gcc.c (translate_options, process_command, main): Likewise. + Constify variables to match. Cast second argument to + pexecute. + + * cppspec.c, gccspec.c: Adjust type of second argument to + lang_specific_driver, and update code as necessary. + +2000-08-02 Jakub Jelinek + + * loop.c (scan_loop): Ensure update_end label does not + go away until reg_scan_update is run. + +2000-08-02 Zack Weinberg + + * c-common.h: Prototype min_precision and c_build_qualified_type here... + * c-tree.h: ... not here. + * errors.h: Prototype fancy_abort. + + * emit-rtl.c (gen_lowpart_common): Move variable 'c' into + HOST_BITS_PER_WIDE_INT == 64 ifdef block. + * regrename.c (regrename_optimize): Make control flow explicit. + (replace_reg_in_block): Initialize reg_use to 0. + + * i386.c (legitimate_address_p): Rename error label to + report_error to avoid namespace clash. + +2000-08-02 Kazu Hirata + + * fold-const.c: Fix formatting. + +Wed Aug 2 16:26:15 MET DST 2000 Jan Hubicka + + * i386.c (legitimate_address_p): Accept other bases than + pic_offset_table_rtx for GOTOFF constructs. + +Wed Aug 2 15:59:34 MET DST 2000 Jan Hubicka + + * i386.md (shift to lea splitter): Use const_int_operand. + +2000-08-02 Zack Weinberg + + * cppexp.c, cppinit.c, cpplex.c, cpplib.c, cppmacro.c, + cppspec.c: Do not use 'legal' or 'illegal' in error messages + and comments. + + * cppmain.c (cb_define, cb_undef): Don't generate any output + if not done_initializing. + * cpplex.c (maybe_paste_with_next): When the token after a ## + is an omitted rest argument, only delete the token before it + if that token is a comma. Do not warn about bogus token + pastes for , ## rest_arg. + + * cpp.texi: Update. + * cpp.1: Regenerate. + +2000-08-02 Fred Fish + + * config/i386/beos-elf.h (STARTFILE_SPEC): Add i386-mcount.o + when user gives -p option. Add init_term_dyn.o for BeOS 5.0 + and later. + + * config/i386/beos-elf.h (INCLUDE_DEFAULTS): Add additional + Be directories to search path. + + Remove support for __declspec(dllimport) and __declspec(dllexport). + This is leftover cruft from the earlier BeOS gcc port when BeOS + used Microsoft's PE object file format. + * configure.in (i*86-*-beoself): Remove extra_objs=winnt.o. + * config/i386/t-beos (winnt.o): Remove Makefile frag. + * config/i386/beos-elf.h (TARGET_NOP_FUN_DLLIMPORT): Remove. + (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + (MERGE_MACHINE_DECL_ATTRIBUTES): Remove. + (REDO_SECTION_INFO_P): Remove. + (ASM_EXPORT_DECL): Remove. + (ASM_DECLARE_FUNCTION_NAME): Remove. + (ASM_DECLARE_OBJECT_NAME): Remove. + (ASM_OUTPUT_ALIGNED_COMMON): Remove. + (ASM_OUTPUT_ALIGNED_DECL_COMMON): Remove. + (ASM_OUTPUT_ALIGNED_LOCAL): Remove. + (STRIP_NAME_ENCODING): Remove. + + Remove support for obsolete version of BeOS that is no longer + supported by Be. + * configure.in (i*86-*-beospe*): Remove. + * config/i386/beos-pe.h: Remove. + +2000-08-01 Jeffrey Oldham + Mark Mitchell + + * Makefile.in (OBJS): Added dce.o. + (ssa.o): Updated target to include ssa.h. + (flow.o): Likewise. + (toplev.o): Likewise. + (dce.o): Created target. + * basic-block.h: Added comments. + (INVALID_BLOCK): Added definition. + (connect_infinite_loops_to_exit): Added declaration. + Moved SSA declarations to ssa.h. + * flow.c: Added inclusion of ssa.h. + (struct depth_first_search_dsS, depth_first_search_ds): + Added definitions. + (compute_immediate_postdominators): Added definition. + (connect_infinite_loops_to_exit): Likewise. + (flow_dfs_compute_reverse_init): Likewise. + (flow_dfs_compute_reverse_add_bb): Likewise. + (flow_dfs_compute_reverse_execute): Likewise. + (flow_dfs_compute_reverse_finish): Likewise. + * rtl.h (rtx/in_struct): Added use to determine insn necessity. + (LABEL_P): Added definition. + (JUMP_P): Likewise. + (NOTE_P): Likewise. + (BARRIER_P): Likewise. + (JUMP_TABLE_DATA_P): Likewise. + (INSN_DEAD_CODE_P): Likewise. + * ssa.c: Replaced inclusions with ssa.h inclusion. + (CONVERT_HARD_REGISTER_TO_SSA_P): Moved to ssa.h. + (rename_registers): Removed unnecessary variables. + * ssa.h: Created by moving declarations from ssa.c and + basic-block.h. + * timevar.def: Defined TV_DEAD_CODE_ELIM. + * toplev.c: Added ssa.h inclusion. + (dump_file_index): Added DFI_dce. + (dump_file): Added "dce" entry. + Defined flag_ssa. + (f_options): Added dce entry. + * invoke.texi: Document -fdce. Emphasize experimental status of + -fssa. + * dce.c: New file. + +2000-08-01 Zack Weinberg + + * cpperror.c (v_message): Split into _cpp_begin_message and + v_message macro. All callers updated. + (_cpp_begin_message): Do inhibit_errors/inhibit_warnings + checks here. + + * cppfiles.c (cpp_syshdr_flags): New function. + (read_include_file): Don't call cpp_output_tokens. Call + enter_file hook. + * cppinit.c (dump_macros_helper): Moved to cppmain.c. + (cpp_reader_init): Don't initialize token_buffer. Call + _cpp_init_internal_pragmas. + (cpp_cleanup): Don't clear token_buffer. + (cpp_start_read): Don't worry about output from -D processing. + Don't call cpp_output_tokens. + (cpp_finish): Don't dump macros here. Don't call + cpp_output_tokens. + * cppmacro.c (_cpp_dump_definition): Rename + cpp_dump_definition. Write directly to a FILE *. + (dump_funlike_macro): Delete. + (dump_macro_args): New. + + * cpplex.c (TOKEN_LEN): Convert to inline function. + (_cpp_grow_token_buffer, safe_fwrite, cpp_output_tokens, + cpp_scan_line, _cpp_dump_list): Delete. + (cpp_printf, cpp_output_list): New. + (output_line_command): Don't worry about entering or leaving files. + (cpp_scan_buffer): Just output each token as we hit it. + (process_directive): Don't call cpp_output_tokens. + (_cpp_glue_header_name): Don't use token_buffer. + (output_token, dump_param_spelling): Write directly to a FILE *. + + * cpplib.c (pass_thru_directive, dump_macro_name, + pragma_dispatch, do_pragma_gcc): Delete. + (do_define, do_undef, parse_include, do_line, do_ident, do_pragma, + do_pragma_poison, cpp_pop_buffer): Call the appropriate hook + functions. + (do_error, do_warning, pragma_dependency): Call + _cpp_begin_message, then cpp_output_list. + (cpp_register_pragma, cpp_register_pragma_space, + _cpp_init_internal_pragmas): New. + (do_pragma): Walk the pragmas table here. + (do_pragma_once, do_pragma_poison, do_pragma_system_header, + do_pragma_dependency): Return void. + (do_pragma_implementation): Moved to cppmain.c. + + * cpplib.h: Update prototypes. + (struct cpp_reader): Remove printer, token_buffer, + token_buffer_size, and limit. Add struct cb, and pragmas. + (struct cpp_printer): Remove last_id and written. + (CPP_WRITTEN, CPP_PWRITTEN, CPP_SET_WRITTEN, + CPP_ADJUST_WRITTEN): Delete. + * cpphash.h: Update prototypes. + (ufputs): New wrapper. + + * cppmain.c (cb_define, cb_undef, cb_include, cb_ident, + cb_enter_file, cb_leave_file, cb_def_pragma): New functions. + (main): Set up callbacks. Register #pragma implementation. + Dump macros from here. + +2000-08-01 Geoff Keating + + * rtl.h (enum reg_note): Add REG_MAYBE_DEAD. + * rtl.c (reg_note_name): Add REG_MAYBE_DEAD. + * flow.c (propagate_one_insn): Allow deletion of prologue/epilogue + insns if they have a REG_MAYBE_DEAD note attached. + * config/rs6000/rs6000.c (rs6000_maybe_dead): New function. + (rs6000_emit_load_toc_table): TOC loads may go dead. + +2000-08-01 Jim Wilson + + * config/ia64/ia64.c (ia64_function_arg): Fix last change. Verify + type exists before using it. Use number of words as alignment + otherwise. + (ia64_function_arg_partial_nregs, ia64_function_arg_advance, + ia64_va_arg): Propagate ia64_function_args changes here. + +2000-08-01 Richard Henderson + + * config/elfos.h (ASM_DECLARE_OBJECT_NAME): Care for null DECL. + * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. + +2000-08-01 Bernd Schmidt + + From Joern Rennecke: + * sh.h (CPP_SPEC, TARGET_SWITCHES): Add m4-nofpu. + * sh.md (udivsi3, divsi3): Don't use libcalls that use the FPU + unless TARGET_SH3E is set. + * t-sh (MULTILIB_MATCHES): Add m2=m4-nofpu. + + * sh.md (ashlsi3_d, ashlsi3_k): Remove, replace with + (ashlsi3_std): New pattern. + (ashlsi3 expander): Use it for TARGET_SH3. + * sh.c (gen_ashift): Use it instead of ashlsi3_k. + +Tue Aug 1 12:34:21 MET DST 2000 Jan Hubicka + + * loop.c (canonicalize_condition): Use destination, not source to + determine SET's mode. + +2000-07-31 Mark Mitchell + + * flow.c (clear_log_links): Fix typo. + +Mon Jul 31 22:19:24 2000 Jeffrey A Law (law@cygnus.com) + + * loop.c (check_dbra_loop): Make change from July 17, 2000 work + on targets which need more than one insn for a compare/cbranch + operation. + +2000-07-31 Jim Wilson + + * config/ia64/ia64.c (ia64_function_arg): Use alignment not size + when computing offset. + +Mon Jul 31 20:35:50 2000 Denis Chertykov + + * genpeep.c (main): Handle DEFINE_PEEPHOLE2. + +2000-07-31 Geoff Keating + + * flow.c (clear_log_links): Nuke global_live_at_start and + global_live_at_end data, since if the log_links stuff is invalid + so is global_live_at_*. + +2000-07-31 Richard Henderson + + * tm.texi (Addressing Modes): Clarify PRE/POST_MODIFY descriptions. + +2000-07-31 Jakub Jelinek + + * cpplex.c (_cpp_get_line): If index is 0, return line 0 col 0. + (_cpp_get_token): Don't macro expand a just pasted token if it + was pasted at no_expand_level. + +2000-07-31 Zack Weinberg + + * cppmacro.c (find_param, count_params, save_expansion): + Permit 'defined' as a macro parameter name. + +2000-07-31 Zack Weinberg + + * Makefile.in: Rename cpp to cpp0, tradcpp to tradcpp0, and + xcpp to cpp throughout. + (native): Remove unnecessary dependency on cpp. + + * gcc.c (trad_capable_cpp, C specs): Rename cpp to cpp, + tradcpp to tradcpp0. + (.i spec): Add missing output-file spec to cc1 command line. + * objc/lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0. + +2000-07-31 Zack Weinberg + + * c-decl.c (mesg_implicit_function_declaration): Init to -1. + (implicit_decl_warning): New function. + (implicitly_declare): Use it. + * c-typeck.c (build_external_ref): Use implicit_decl_warning + to complain about implicit decls of builtins. + + * c-lang.c (lang_init): Set mesg_implicit_function_declaration + based on pedantic && flag_isoc99, if not already set. + * c-tree.h: Declare mesg_implicit_function_declaration. + Prototype implicit_decl_warning. + +2000-07-30 Jeffrey D. Oldham + + * Makefile.in (ssa.o): Updated header files in dependences. + * basic-block.h: Added compute_immediate_postdominators declaration. + * config/i386/i386.h (CONVERT_HARD_REGISTER_TO_SSA_P): Added + definition. + * flow.c (compute_immediate_dominators): Updated comment. + (compute_immediate_postdominators): Added definition. + * rtl.h (HARD_REGISTER_P): Added definition. + * ssa.c: Include additional header files. + (assert): Added definition. + (ssa_rename_to_lookup): Added to reimplement ssa_rename_to to + include select hard registers. + (ssa_rename_to_insert): Likewise. + (ssa_rename_from_initialize): Likewise. + (ssa_rename_from_lookup): Likewise. + (original_register): Likewise. + (ssa_rename_from_insert): Added to reimplement ssa_rename_from to + include select hard reigsters. + (ssa_rename_from_traverse): Likewise. + (ssa_rename_from_free): Likewise. + (ssa_rename_from_print): Likewise. + (ssa_rename_from_print_1): Likewise. + (ssa_rename_from_hash_function): Likewise. + (ssa_rename_from_equal): Likewise. + (ssa_rename_from_delete): Likewise. + (simplify_to_immediate_dominators): Removed in favor of + flow.c:compute_immediate_dominators. + (find_evaluations_1): Modified to work with hard registers. + (insert_phi_node): Likewise. + (insert_phi_nodes): Likewise. + (struct rename_set_data): Updated prev_reg comment. + (create_delayed_rename): Modified to work with hard registers. + (RENAME_NO_RTX): Updated comment. + (apply_delayed_renames): Modified to work with hard registers. + (rename_insn_1): Likewise and added handling of CLOBBER rtls. + (rename_block): Updated to use revised ssa_rename_to interface. + (rename_registers): Updated to use revised ssa_rename_to and + ssa_rename_from interface. + (convert_to_ssa): Revised to use compute_immediate_dominators and + deal with hard registers. + (make_regs_equivalent_over_bad_edges): Modified to work with hard + registers. Added check for illegal unification of hard register. + (make_equivalent_phi_alternatives_equivalent): Modified to work + with hard registers. + (compute_conservative_reg_partition): Likewise. + (coalesce_if_unconflicting): Modified to work with hard registers + and check for conflicting hard registers. + (mark_phi_and_copy_regs): Revised loop to work only on pseudo + registers. + (rename_equivalent_regs_in_insn): Modified to work with hard + registers. + (record_canonical_element_1): Added definition. + (check_hard_regs_in_partition): Added definition. + (convert_from_ssa): Added data structure deallocation and check + for illegal hard register unification. + (conflict_hard_regs_p): Added definition. + * toplev.c (rest_of_compilation): Added comment. + +2000-07-31 Anthony Green + + * config/ia64/crtbegin.asm (__EH_FRAME_BEGIN__): Align correctly. + +2000-07-31 Jason McMullan + + * builtins.c (expand_builtin_apply): Don't defer pop during + argument setup. + +2000-07-31 Herman A.J. ten Brugge + + * calls.c (combine_pending_stack_adjustment_and_call): Only use + preferred_unit_stack_boundary when it is > 1. + +2000-07-31 Joseph S. Myers + + * c-common.c (init_function_format_info): Add C99 format functions + in C99 mode. + + * c-decl.c (get_parm_info): Don't treat 'const void', 'volatile + void' or 'register void' as being the special case of 'void' alone + in a parameter list. + + * c-typeck.c (build_c_cast): Change -Wcast-qual pedwarn for + discarding qualifiers into a plain warning. + +2000-07-31 Kazu Hirata + + * combine.c: Fix formatting. + + * h8300.md: Fix formatting. + + * local-alloc.c: Fix formatting. + + * h8300.c (get_shift_alg): Remove the variable alg. + (emit_a_shift): Rearrange code to improve readability. + + * h8300.md (movsi_h8300hs): Rearrange code to improve readability. + + * h8300.h (MODES_TIEABLE_P): Accept a combination of QImode and + HImode on all architectures and a combination of HImode and SImode + on H8/300H and H8S. + + * h8300.c (split_adds_subs): Rearrange code for conciseness. + +Mon Jul 31 12:27:55 MET DST 2000 Jan Hubicka + + * i386.md (addsi to lea splitter, ashlqi3_1_lea): Fix bugs + in my last checkin. + +Mon Jul 31 10:41:01 MET DST 2000 Jan Hubicka + + * recog.c (extract_insn): Set operand_mode according to + operand if match_operand is VOIDmode. + +Mon Jul 31 10:36:38 MET DST 2000 Jan Hubicka + + * recog.c (validate_replace_rtx_1): Do not abort for (nil) expression. + +2000-07-31 Geoff Keating + + * c-parse.in (extdefs): Call ggc_collect between external + definitions. + +2000-07-30 Michael Hayes + Richard Henderson + + * Makefile.in (OBJS): Add doloop.o. + * doloop.c: New file. + + * final.c (insn_current_reference_address): Return 0 before final. + * flags.h (flag_branch_on_count_reg): Fix typos in commentary. + * jump.c (any_uncondjump_p): Likewise. + * loop.c (indirect_jump_in_function): Make static. + (strength_reduce): Call doloop_optimize. + (insert_bct, instrument_loop_bct): Remove. + * loop.h (doloop_optimize): Prototype. + * recog.c (split_all_insns): Split all INSN_P. + * toplev.c (flag_branch_on_count_reg): Default on. + + * config/c4x/c4x.c (c4x_optimization_options): Don't set + flag_branch_on_count_reg. + * config/i386/i386.c (override_options): Likewise. + * config/rs6000/rs6000.c (optimization_options): Likewise. + + * config/i386/i386.md (decrement_and_branch_on_count): Remove. + (doloop_end): New. + (dbra_ge): Remove, as well as all it's splitters. + + * config/rs6000/rs6000.md (decrement_and_branch_on_count): Remove. + (doloop_end): New. + + * config/ia64/ia64-protos.h (ar_lc_reg_operand): Declare. + (ia64_register_move_cost): Declare. + * config/ia64/ia64.c (ar_lc_reg_operand): New. + (struct ia64_frame_info): Add ar_size. + (ia64_compute_frame_size): Set it. + (save_restore_insns): Save and restore ar.lc. + (ia64_register_move_cost): New, moved from header file. Handle + application registers. + (REG_AR_PFS, REG_AR_EC): Remove. Replace with AR_*_REGNUM numbers. + (emit_insn_group_barriers): Special case doloop_end_internal. + (ia64_epilogue_uses): Mark ar.lc live at end. + * config/ia64/ia64.h (AR_CCV_REGNUM, AR_LC_REGNUM): New registers. + (AR_EC_REGNUM, AR_PFS_REGNUM): New registers. + (FIRST_PSEUDO_REGISTER): Make room. + (AR_M_REGNO_P, AR_I_REGNO_P, AR_REGNO_P): New. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Update. + (REG_ALLOC_ORDER): Update. + (HARD_REGNO_MODE_OK): Update. + (REGISTER_NAMES): Update. + (enum reg_class): Add AR_M_REGS and AR_I_REGS. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. + (REGNO_REG_CLASS): Update. + (LEGITIMATE_ADDRESS_DISP): Displacement range is 9 bits, not 10. + (REGISTER_MOVE_COST): Move out of line. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md (movdi patterns): Handle ar register classes. + (addsi3_plus1_alt, adddi3_plus1_alt): New. + (shladd_elim splitter): Allow constants in the predicate. + (doloop_end, doloop_end_internal): New. + +2000-07-30 Richard Henderson + + * genattrtab.c (struct insn_def): Add lineno member. + (struct insn_ent): Likewise. + (struct attr_desc): Likewise. + (struct delay_desc): Likewise. + (struct function_unit_op): Likewise. + (struct function_unit): Likewise. + (check_attr_value): Use message_with_line. + (check_defs): Likewise. + (expand_units): Likewise. + (check_attr_test): Take a lineno argument. + (gen_attr): Likewise. + (gen_insn): Likewise. + (gen_delay): Likewise. + (gen_unit): Likewise. + (main): Give it to them. + (convert_set_attr_alternative): Take an insn_def argument + instead of num_alt and insn_index. + (convert_set_attr): Likewise. + (write_test_expr): Protect INSN_ADDRESSES load + with INSN_ADDRESSES_SET_P. + +2000-07-30 Richard Henderson + + * flow.c (init_propagate_block_info): Use pc_set. + +Sun Jul 30 20:58:34 MET DST 2000 Jan Hubicka + + * i386.md (*lea_general_[123]) New insns and splits. + (addsi3 to lea splitter): Handle other modes too. + (shlsi3 to lea splitter): Likewise. + (addhi_1_lea, shlhi_1_lea): New patterns. + (addhi_1, shlhi_1): Conditionize by PARTIAL_REG_STALL. + +Sun Jul 30 20:51:25 MET DST 2000 Jan Hubicka + + * recog.c (general_operand, nonimmediate_operand): Accept + any mode for VOIDmode CONSTANT_P operands. + +Sun Jul 30 20:42:21 MET DST 2000 Jan Hubicka + + * gcse.c (try_replace_reg): Use validate_replace_rtx_subexp + instead of replace_rtx. + * recog.c (validate_replace_rtx_subexp): New function. + * recog.h (validate_replace_rtx_subexp): Declare. + +Sun Jul 30 20:38:26 MET DST 2000 Jan Hubicka + + * combine.c (simplify_set, make_extraction, make_compound_operation + make_field_assignment): Use full mask instead of GET_MODE_MASK (mode) + as force_to_mode argument. + +Sun Jul 30 20:30:41 MET DST 2000 Jan Hubicka + + * combine.c (if_then_else_cond): Be sure that mode fits in + HOST_WIDE_INT. + +Sun Jul 30 20:27:36 MET DST 2000 Jan Hubicka + + * combine.c (record_promoted_value): Allow bitsize of mode + to be equivalent to HOST_BITS_PER_WISE_INT. + +Sun Jul 30 20:25:21 MET DST 2000 Jan Hubicka + + * function.c (assign_stack_local_1, assign_stack_temp_for_type): + Do not call gen_mode_alignment when mode is BLKmode. + +Sun Jul 30 20:21:54 MET DST 2000 Jan Hubicka + + * loop.c (express_from_1): Fix call of simplify_gen_binary. + +Sun Jul 30 20:08:37 MET DST 2000 Jan Hubicka + + * simplify-rtx.c (simplify_relational_operation): Verify that mode == + VOIDmode implies both operands to be VOIDmode. + (simplify_ternary_operation): Compute properly the mode of comparison. + * combine.c (combine_simplify_rtx): Likewise. + +2000-07-25 Michael Hayes + + * basic-block.h (struct loops): New field rc_order. + * flow.c (flow_loops_cfg_dump): Dump rc_order if computed. + (flow_loops_free): Free rc_order. + (flow_depth_first_order_compute): New parameter rc_order. + (flow_loops_find): Allocate rc_order and swap usage with + dfs_order. + +2000-07-30 Herman A.J. ten Brugge + Michael Hayes + + * config/c4x/c4x.md (set_ldp_prologue): Add for RTL prologue/epilogue. + (push_st, push_dp, pop_st, pop_dp, popqi_unspec): Likewise. + (nodb_call, return_from_epilogue): Likewise. + (return_from_interrupt_epilogue, prologue, epilogue): Likewise. + * config/c4x/c4x.c (c4x_expand_prologue, c4x_expand_eplilogue): Add. + * config/c4x/c4x-protos.h (c4x_interrupt_function_p): Add. + (c4x_expand_prologue, c4x_expand_epilogue): Likewise. + (c4x_valid_type_attribute_p): Likewise. + * config/c4x/c4x.h (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Delete. + (FUNCTION_BLOCK_PROFILER_EXIT): Convert to emit RTL. + +2000-07-30 Michael Hayes + + * config/c4x/c4x.c (c4x_emit_move_sequence): Use loadqi_big_constant + and loadhi_big_constant if applicable. + * config/c4x/c4x.md (loadqi_big_constant, loadhi_big_constant): Tweak + and add new splitter.s + +2000-07-30 Michael Hayes + + * config/c4x/c4x.c (c4x_rptb_insert): Make more robust. + +2000-07-30 Michael Hayes + + * config/c4x/c4x.h (ASM_FORMAT_PRIVATE_NAME): Output $ in label. + +2000-07-30 Michael Hayes + + * config/c4x/c4x.h (IS_XXX_REGNO): Rewrite to avoid unsigned warnings. + +2000-07-30 Michael Hayes + + * config/c4x/libgcc.S (divqf3): Improve accuracy. + +2000-07-27 Mark Mitchell + + Put phi nodes after NOTE_INSN_BASIC_BLOCK. + * rtl.h (NOTE_INSN_BASIC_BLOCK_P): New macro. + * bb-reorder.c (get_next_bb_note): Use NOTE_INSN_BASIC_BLOCK_P. + (get_prev_bb_note): Likewise. + (remove_scope_notes): Likewise. + * flow.c (commit_one_edge_insertion): Likewise. + (merge_blocks_nomove): Likewise. + (verify_flow_info): Likewise. + * gcse.c (insert_insn_end_bb): Likewise. + * reg-stack.c (emit_swap_insn): Likewise. + * ssa.c (first_insn_after_basic_block_note): New function. + (insert_phi_node): Use it. + (rename_block): Likewise. + (eliminate_phi): Likewise. + (make_regs_equivalent_over_bad_edges): Likewise. + (make_equivalent_phi_alternatives_equivalent): Likewise. + (for_each_successor_phi): Likewise. + (convert_from_ssa): Modify phi-node deletion algorithm. + +2000-07-29 Andreas Jaeger + + * configure.in (mips*-*-linux*): Use mips*el to check for little + endian MIPS, add tmake_file. + + * config/mips/linux.h (TARGET_VERSION): Use GNU/Linux. + (SUBTARGET_CPP_SPEC): Default MIPS_ISA is 1. + Patches by Maciej W. Rozycki . + +2000-07-28 Richard Henderson + + * config/ia64/ia64.c (ia64_print_operand): Fix typos. + Sign extend mode size before negating. + +2000-07-28 Richard Henderson + + * emit-rtl.c (gen_lowpart_common): Add missing 'c' variable. + +2000-07-28 Bernd Schmidt + + * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. + (cse_insn): Likewise. + (addr_affects_sp_p): Likewise. + * expr.c (move_by_pieces): Likewise. + (clear_by_pieces): Likewise. + * gcse.c (oprs_unchanged_p): Likewise. + * haifa-sched.c (sched_analyze_2): Likewise. + * recog.c (offsettable_address_p): Likewise. + * regclass.c (record_address_regs): Likewise. + * reload.c (find_reusable_reload): Likewise. + (push_reload): Likewise. + (operands_match_p): Likewise. + (decompose): Likewise. + (find_reloads_address_1): Likewise. + (find_inc_amount): Likewise. + * reload1.c (elimination_effects): Likewise. + * resource.c (mark_set_resources): Likewise. + * flow.c (attempt_auto_inc): New function; mostly broken out + of find_auto_inc. + (find_auto_inc): Split into two functions and enhanced to + generate POST_MODIFY. + * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. + * rtl.h (count_all_occurrences): Declare. + (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not + defined. + * rtlanal.c (count_all_occurrences): New function. + * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, + HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. + + * config/ia64/ia64-protos.h (destination_operand): Declare. + * config/ia64/ia64.c (destination_operand): New function. + (ia64_print_operand): Handle POST_MODIFY. + (rtx_needs_barrier): Likewise. + * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. + (HAVE_POST_MODIFY_REG): Define to 1. + (MAX_REGS_PER_ADDRESS): Change to 2. + (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. + (LEGITIMATE_ADDRESS_REG): New helper macro. + (LEGITIMATE_ADDRESS_DISP): Likewise. + (PREDICATE_CODES): Add entry for destination_operand. + * config/ia64/ia64.md (all mov patterns): Use destination_operand + predicate for operand 0. + +2000-07-28 Kaveh R. Ghazi + + * dwarf2out.c: Indent #error directive. + + * gbl-ctors.h: Fix typo in comment. + (__do_global_ctors): Prototype. + + * gcse.c (record_one_set, pre_delete): Remove unused variables. + + * rs6000.c (rs6000_maybe_dead): Delete unused prototype. + (print_operand): Initialize variable `t'. + +2000-07-27 Aldy Hernandez + + * config/arm/arm.md ("call_value"): removed constraints. + Constraints are ignored in expanders. + (*call_value_reg): split =rf into various constraints. + (*call_value_mem): same + (*call_value_symbol): same + (*sibcall_value_insn): same + +2000-07-28 Philipp Thomas + + * install.texi (--enable-nls): Change the description of the NLS + related configure options to match the current state. + (--with-included-gettext): Likewise. + (--enable-maintainer-mode): New description added. + * extend.texi (-fstrict-prototype): Add missing '.'. + +2000-07-27 Jim Wilson + + * dwarf2out.c (gen_decl_die): Don't call gen_abstract_function if + DECL_INITIAL (decl) == NULL_TREE. + +2000-07-27 Alexandre Oliva + + * Makefile.in (INSN_ATTR_H): New macro. Replace all dependencies + on insn-attr.h with it. + * genattr.c: Generate `#include "insn-addr.h"' if HAVE_ATTR_length. + * insn-addr.h: New header. + (insn_addresses_): Renamed from insn_addresses. + (INSN_ADDRESSES_DEFN, INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, + INSN_ADDRESSES_FREE, INSN_ADDRESSES_SET_P, INSN_ADDRESSES_SIZE, + INSN_ADDRESSES_NEW): New macros. + * genattrtab.c (write_test_expr): Use new macros. + * final.c (insn_addresses, init_insn_lengths): Likewise. + (align_fuzz, shorten_branches): Likewise. + (final): Likewise. Do not reject new insns if their addresses + have been added to INSN_ADDRESSES. + * config/arm/arm.c, config/avr/avr.c: Use new macros. + * config/h8300/h8300.c, config/i370/i370.c: Likewise. + * config/m88k/m88k.c, config/pa/pa.c, config/pa/pa.md: Likewise. + * config/sparc/sparc.c, config/sparc/sparc.md: Likewise. + * config/sh/sh.c: Likewise. + (output_branchy_insn): Use INSN_ADDRESSES_NEW. + + * Makefile.in (bootstrap): Move -BstageN/ back to the beginning. + +2000-07-27 Andrew Cagney + + * gcc.c (struct prefix_list): Add member priority. + (enum path_prefix_priority): Declare. + (add_prefix): Replace ``first'' with ``priority''. Append new + entry but keep list in priority order. + (process_command): Update. Pass PREFIX_PRIORITY_B_OPT or + PREFIX_PRIORITY_LAST to add_prefix. + (process_command): Move include kludge - foo/stageN - to before + foo/include. + +2000-07-27 Jason Merrill + + * dwarf2out.c (gen_typedef_die): Abort if we get identical + TREE_TYPE and DECL_ORIGINAL_TYPE on a typedef. + +2000-07-27 RodneyBrown + + * expr.h (get_alias_set, lang_get_alias_set): Delete prototypes. + * tree.h (get_alias_set, lang_get_alias_set): Prototype. + +2000-07-27 Joseph S. Myers + + * c-decl.c (finish_function): Don't treat 'main' specially unless + flag_hosted. In C99 mode, return 0 from 'main' unless + DEFAULT_MAIN_RETURN is otherwise defined. + + * c-decl.c (store_parm_decls): In C99 mode, pedwarn for function + parameters defaulting to int in an old-style function definition. + +2000-07-27 Kaveh R. Ghazi + + * c-parse.in (string): For -Wtraditional, warn about string + concatenation only once per line. + +Thu Jul 27 09:25:17 2000 Akiko Matsushita + + * pa/x-pa-hpux: Add -D_HIUX_SOURCE to FIXPROTO_DEFINES + for HI-UX/WE2 systems. + +2000-07-24 Bruce Korb + + * fixincl/fixfixes.c(emit_gnu_type): rewrote to *rely* on GCC + defining the __xxx_TYPE__ macros. + * fixincl/fixincl.tpl(gnu_type_map): now obsolete + * fixincl/fixlib.h: don't need to include "tm.h" anymore + * fixincl/inclhack.def(type_map): now obsolete + +Thu Jul 27 11:54:17 2000 Andrew Cagney + + * cpp.texi: Append a trailing full-stop to xrefs where needed. + +2000-07-26 Dave Pitts + + * i370.c: Remove LONGEXTERNAL ifdef from alias_number. Added hash + routine constants. + (mvs_hash_alias): New function. + (mvs_add_alias): Change argument spacing. + (mvs_need_alias): Change aliasing criteria. Added documentation. + (mvs_get_alias): Change to use hashed name. The hashed name prevents + CSECT name collisions. + (mvs_check_alias): Likewise. + (handle_pragma): Change documentation. + * i370.md (mulsi3, divsi3, udivsi3, modsi3, umodsi3): Changed gen_rtx + mode from SImode to DImode. + (iorhi3): Changed LTORG size for insn. + +Wed Jul 26 19:44:05 2000 Hans-Peter Nilsson + + * reload.c (find_reloads_toplev): Reload a paradoxical subreg of a + mem if the address is a mode_dependent_address_p. + +2000-07-26 Kazu Hirata + + * h8300.c (print_operand): Print ":8" when the 'R' operand is + suitable for 8-bit absolute. + * h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): New. + (OK_FOR_U): Add a case for the 8-bit constant address on the + H8/300H. + +Wed Jul 26 19:26:21 2000 Hans-Peter Nilsson + + * varasm.c (assemble_variable) [! defined(ASM_OUTPUT_ALIGNED_COMMON) + && ! defined (ASM_OUTPUT_ALIGNED_BSS]): Also test + ! defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) before complaining about + lack of implemented alignment. + +2000-07-26 Geoffrey Keating + + * emit-rtl.c (gen_lowpart_common) [REAL_ARITHMETIC]: Handle + cross-compiling between 64-bit and 32-bit machines. + +2000-07-27 Richard Henderson + + * config/ia64/ia64.md (movqicc_astep, movqi_internal_astep): New. + (movhicc_astep, movhi_internal_astep): New. + (movsicc_astep, movsi_internal_astep): New. + (movdicc_astep, movdi_internal_astep): New. + (movsfcc_astep, movsf_internal_astep): New. + (movdfcc_astep, movdf_internal_astep): New. + (movxfcc_astep, movxf_internal_astep): New. + (cmovdi_internal_astep, cmovsi_internal_astep): New. + Unify the cmov[ds]i splitters. + +2000-07-27 Rodney Brown + + * real.c (asctoeg): Rename `error' label to unexpected_char_error + +2000-07-26 Nick Clifton + + * config/arm/vxarm.h (CPP_PREDEFINES): Remove definition of + __arm__. Allow it to be defined by CPP_ISA_SPEC in arm.h + + * dwarf2out.c (dwarf2out_frame_debug_expr): Accept SEQUENCE as + well as PARALLEL blocks in FRAME_RELATED_EXPR notes. + +2000-07-26 Alexandre Oliva + + * c-decl.c (finish_enum): Convert enumerations that fit in an + `int' to `int'. + (build_enumerator): In pedantic mode, cast to `int' those that + don't. + +2000-07-25 Rodney Brown + + * config/alpha/osf.h (SIZE_TYPE, PTRDIFF_TYPE): New. + +Tue Jul 25 23:08:33 2000 J"orn Rennecke + + * sh.md (cmpgtdi_t): Must be split. + (cmpgtdi_t+1): New splitter. + +2000-07-25 Zack Weinberg + + * cpplib.c (_cpp_check_directive): Issue -Wtraditional + warnings for indented directives even if we are skipping. + +2000-07-25 Nathan Sidwell + + * invoke.texi (strict-prototypes): Remove. + * extend.texi (Deprecated Features): Add strict-prototypes. + (Backwards Compatibility): New node. + +2000-07-25 Jakub Jelinek + + * config/i386/i386.md (andsi_1+1): Allow HImode. + (andsi_1+2): Require q_regs_operand. + +2000-07-25 Jakub Jelinek + + * config/i386/i386.md (call_pop): Check operands[0], + not operands[1]. Only check SYMBOL_REF_FLAG for a SYMBOL_REF. + (call): Likewise. + (call_value_pop): Only check SYMBOL_REF_FLAG for a SYMBOL_REF. + (call_value): Likewise. + +2000-07-25 Zack Weinberg + + * toplev.c (pipe_closed): Delete. + (crash_signal): New. Generate ICE for a fatal signal. + (float_signal): Call crash_signal outside a float-handler + block, not abort. + (main): Install crash_signal as handler for core-dumping signals. + +2000-07-25 David Edelsohn + + * rs6000.c (print_operand, case 'T'): New case. + + * rs6000.md (call_indirect_aix32): Convert to expander of + scheduled instructions. + (call_indirect_aix64): Likewise. + (call_value_indirect_aix{32,64}): Likewise. + (call, call_value): Invoke expanders for AIX. Fall through to + matchers for SysV. + (call_indirect_nonlocal_aix{32,64}): New patterns (ctr and lr). + (call_value_indirect_nonlocal_aix{32,64}): New patterns. + (call_nonlocal_aix32): Remove CALL_LONG alternative. Operand 1 + only "g" constraint. + (call_nonlocal_aix64): Likewise. + (call_value_nonlocal_aix{32,64}): Likewise. + (call_nonlocal_sysv): New pattern for ctr, lr, and symbolic + operands. + (call_value_nonlocal_sysv): New pattern. + (indirect_jump{si,di}): Use new 'T' modifier. + (tablejump{si,di} matchers): Likewise. + (return_internal_{si,di}): Likewise. + (return_eh_{si,di}): Likewise. + +2000-07-24 Richard Henderson + + * config/ia64/ia64.c (ia64_print_operand): Handle "%,". + * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): Likewise. + * config/ia64/ia64.md (movdi_internal): Use it. + +2000-07-24 Zack Weinberg + + * cppexp.c: Warn about unary + if -Wtraditional. + * cpplex.c (lex_line): Always set BOL on the first token of a line. + +2000-07-24 Michael Meissner + + * d30v.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Delete references to + unsupported macro. + +2000-07-24 Nick Clifton + + * config/arm/arm.c (emit_multi_reg_push): Generate a + REG_FRAME_RELEATED_NOTE that is compatible with the code in + dwarf2out_debug_frame_expr. + +2000-07-24 Jason Merrill + + * dwarf2out.c: Complain if DWARF2_DEBUGGING_INFO is defined without + UNALIGNED_INT_ASM_OP. + (def_cfa_1): Don't emit def_cfa_register or def_cfa_offset to adjust + a location expression. + (dwarf2out_frame_debug_expr): Lose cfa_old_reg stuff. Don't + assume indirect access if we're saving the CFA address exactly. + + * Makefile.in (bootstrap): Move -BstageN/ to the end. + +2000-07-24 Jakub Jelinek + + * tradcpp.c (main): Update max_include_len for cpp_include_defaults + as well. + +2000-07-24 Michael Meissner + + * invoke.texi (D30V Options): Add d30v options. + +Mon Jul 24 02:04:52 2000 Jeffrey A Law (law@cygnus.com) + + * gcse.c (alloc_pre_mem): Do not alloc TRANSPOUT, it is not + needed by our gcse pass anymore. + (free_pre_mem): Corresponding changes. + (compute_pre_data): Do not call compute_transpout anymore. + + * gcse.c (alloc_avail_expr_mem): Kill unused 'u_bitmap'. + (free_avail_expr_mem, alloc_pre_mem, free_pre_mem): Corresponding + changes. + + * gcse.c (free_pre_mem): Do not free ANTLOC and AE_KILL here. + (compute_pre_data): Do it here instead. + + * gcse.c (alloc_pre_mem, free_pre_mem): Delete unused bitmap + 'temp_bitmap'. + (pre_delete): Corresponding changes. + +2000-07-23 Mark Mitchell + + * c-semantics.c (make_rtl_for_local_static): Use TREE_ASM_WRITTEN + to figure out whether or not a variable has already been emitted. + +Sun Jul 23 14:49:12 2000 Jason Eckhardt + + * config/i860/i860.md (untyped_call expander): Use GEN_CALL + instead of gen_call. + +Sun Jul 23 11:52:03 2000 George Helffrich (george@gly.bris.ac.uk) + + * dbxout.c (dbxout_type, case COMPLEX_TYPE): Fix length field in stab. + +2000-07-23 Kazu Hirata + + * h8300.c: Fix formatting. + +2000-07-23 Joseph S. Myers + + * c-typeck.c (c_expand_start_case): Change -Wtraditional pedwarn + for `long' switch expression into a plain warning. + + * c-lex.c (init_lex): Keep the "inline" keyword in C99 mode. + (yylex): Don't pedwarn for "inline" in C99 mode. + + * bitmap.c (debug_bitmap_file): Cast pointers to PTR for printing + with %p. + * ggc-page.c (debug_print_page_list, alloc_page, free_page, + ggc_alloc): Likewise. + * bb-reorder.c (dump_scope_forest_1): Likewise. + +2000-07-22 Aldy Hernandez + + * reload.c (find_reloads_toplev): Add new parameter + "address_reloaded". + (find_reloads): Add new parameter to find_reloads_toplev calls. + +2000-07-22 Jeffrey Oldham + + * collect2.c (main): Typo fixed. + * diagnostic.c: Typo fixed. + * dwarf2out.c (dwarf2out_frame_debug_expr): Typo fixed. + * eh-common.h: Typo fixed. + * emit-rtl.c (start_sequence): Typo fixed. + * flow.c (find_label_refs): Typo fixed. + (calculate_global_regs_live): Typo fixed. + (mark_regno_cond_dead): Typo fixed. + (create_edge_list): Typos fixed. + (verify_edge_list): Typo fixed. + * ggc-common.c (ggc_mark_rtx_children): Typo fixed. + * loop.c (strength_reduce): Typo in function name fixed. + * rtl.h: Added comments. Typo in function name fixed. + * rtlanal.c: Typo in function name fixed. + (insn_dependant_p): Rename to ... + (insn_dependent_p): ... this. + (computed_jumo_p): Typo fixed. + +2000-07-22 Kaveh R. Ghazi + + * system.h (__FUNCTION__): Wrap definition in #ifndef. + +2000-07-21 David Edelsohn + + * rs6000.h (SIZE_TYPE): Define. + +2000-07-21 Mark Mitchell + + * ssa.c (rename_insn_1): Don't rename registers that are + CLOBBERed. + +2000-07-21 Zack Weinberg + + * diagnostic.c (trim_filename, fancy_abort): Moved here from + rtl.c. + (fatal_function, set_fatal_function): Removed. + (fatal): Don't prepare for or call the fatal_function. + (diagnostic_lock, error_recursion): New. + (diagnostic_for_decl, report_diagnostic): Guard against + re-entering the error reporting routines. + (fancy_abort): Assume function is not NULL. + + * errors.c (fancy_abort): New. Assume function is not NULL. + * tradcpp.c (fancy_abort): Assume function is not NULL. + + * system.h: Provide default definition of __FUNCTION__. + * rtl.h: Use __FUNCTION__ not __PRETTY_FUNCTION__ throughout. + Always use __FUNCTION__ in definition of abort. + * tree.h: Likewise. + * varray.h: Likewise. + * toplev.h: Likewise. Don't prototype set_fatal_function. + +2000-07-20 Geoff Keating + + * config/rs6000/aix43.h (CPP_SPEC): Define __LONG_MAX__ correctly + in 64-bit mode. + * glimits.h: Don't do #if defined for ARCH_PPC. + + * config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): All + constants of size no larger than a pointer should go in the TOC. + Add 'MODE' parameter. + (LEGITIMIZE_RELOAD_ADDRESS): Add MODE parameter to + ASM_OUTPUT_SPECIAL_POOL_ENTRY_P. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise. + * config/rs6000/aix.h (SELECT_RTX_SECTION): Likewise. + * config/rs6000/netware.h (SELECT_RTX_SECTION): Likewise. + * config/rs6000/rs6000.c (constant_pool_expr_1): Likewise. + (rs6000_legitimize_address): Likewise. + (rs6000_emit_move): Likewise. + (rs6000_select_rtx_section): Likewise. + (output_toc): Deal properly with outputting small constants like + HImode, and SFmode in 32-bit mode, and DFmode in 64-bit mode. + * config/rs6000/sysv4.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Add + MODE parameter. Put small constants in the TOC. + + * config/rs6000/rs6000.c (easy_fp_constant_p): All constants are + easy in SImode. + (rs6000_emit_move): When reload calls us with an illegitimate + address, exit early. Move the change_address calls to one place + at the end of the routine. Merge the SImode and DImode expanders. + When called by reload to put an integer into a FP register, force + it to memory. + + * config/rs6000/rs6000.c (struct toc_hash_struct): Add 'key_mode' + field. + (rs6000_hash_constant): Hash mode too. + (toc_hash_function): Allow for key_mode. + (toc_hash_eq): Structures are different if key_mode differs. + (output_toc): Add 'mode' parameter. Save key_mode. + * config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): + Pass 'mode' parameter. + * config/rs6000/rs6000-protos.h (output_toc): Add 'mode' param. + + * config/rs6000/rs6000.c (output_toc): Use RS6000_OUTPUT_BASENAME + for vtable references. + + * config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): If we have a + choice, don't put integer values in FP regs. + +Thu Jul 20 18:13:52 2000 Jeffrey A Law (law@cygnus.com) + + * flow.c (verify_flow_info): Revamp code to verify that the + head and end of each basic block are in the insn chain. + +Thu Jul 20 18:02:35 2000 Michael Matz + + * gcse.c (record_one_set): Prepend instead of append onto + reg_set_table, making it O(n) instead O(n^2). + * lcm.c (compute_antinout_edge,compute_laterin,compute_available): + Use a queue instead of a stack as worklist. + +2000-07-20 Kazu Hirata + + * h8300.c (two_insn_adds_subs_operand): Fix a typo. + * h8300.h (OK_FOR_T): New. + (EXTRA_CONSTRAINT): Support OK_FOR_T. + * h8300.md: Use inc/dec.[wl] for increment/decrement + by 1 and 2 in HI and SI modes. + +2000-07-20 Jim Wilson + + * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Handle DELTA values + larger than 14 bits. + +2000-07-20 Zack Weinberg + + * cppmacro.c (CAN_PASTE_AFTER): New macro. + (count_params): Don't set GNU_REST_ARGS on anything. + (save_expansion): Set PASTE_LEFT only on tokens for which + CAN_PASTE_AFTER is true, or which are named operators. + + * cpplex.c (parse_args): Distinguish between a rest argument + given one empty argument, and a rest argument given zero arguments. + (maybe_paste_with_next): Look for VOID_REST tag, and trigger + deletion of previous token based on that. + (get_raw_token): Flatten some control structure. + + * cpplib.h (CPP_LAST_EQ): Correct. + (VOID_REST): New token flag. + (GNU_REST_ARGS): Delete. + + * tradcpp.c (main): Don't munge -D options. + (make_definition): Bring -D handling in line with cpplib. + (do_define): Strip all leading whitespace from macro definitions. + +2000-07-20 David Billinghurst + + * Makefile.in (tradcpp): Depend on intl.o and version.o. + +2000-07-20 Bruce Korb + + * fixincl/check.tpl: strip the platform specific types before testing + * fixincl/fixfixes.c(gnu_type_fix): use platform specific types + * fixincl/fixincl.tpl: use platform specific types + * fixincl/fixlib.h: include the platform specific types + * fixincl/inclhack.def(gnu_types): don't supply the types + * fixincl/fixincl.x: regen + +2000-07-19 Jim Wilson + + * config/ia64/ia64.h (HARD_REGNO_MODE_OK): Don't allow XFmode in + GR_REGS. + +2000-07-19 Zack Weinberg + + * tradcpp.c (rescan): Do not recognize directives when the # + is indented. + +2000-07-19 Zack Weinberg + + Implement C++ named operators. + + * cpplib.h (TTYPE_TABLE): Move CPP_MIN and CPP_MAX into block + of operators allowed in #if and having an _EQ variant. Add + CPP_MIN_EQ, CPP_MAX_EQ, and CPP_DEFINED. + (cpp_token flags): Add NAMED_OP. + (enum node_type): Add T_OPERATOR. + (struct cpp_hashnode): Add code slot to value union. + * cpphash.h (spec_nodes): Remove n_defined. + + * cpplex.c (lex_line): Convert T_OPERATOR nodes to their proper types. + (spell_token, can_paste, maybe_paste_with_next): Handle named operators. + (is_macro_disabled): Tweak error messages. + + * cpplib.c (get_define_node): Disallow all named operators as + macro names. Tweak error messages. + (_cpp_init_stacks): Don't set up spec_nodes->n_defined. + + * cppinit.c (builtin_array): Add entries for the named operators. + * cppexp.c (lex): Check for CPP_DEFINED token. + (priority table): Add entries for CPP_MIN and CPP_MAX. + (_cpp_parse_expr): Handle CPP_MIN and CPP_MAX. + +2000-07-19 Bernd Schmidt + + * gcse.c (INSN_CUID): If ENABLE_CHECKING, abort if the uid is + larger than the array of cuids. + (alloc_gcse_mem): Use uid_cuid rather than INSN_CUID when computing + cuids. + +2000-07-19 Bruce Korb + + * fixinc/fixincl.c: Convert to using a table of environment variables + and activate the auto-edit marker on the fixed output files. + * fixinc/fixlib.h: Define the environment table + * fixinc/fixincl.sh: export the ${INPUT} dir + * fixinc/check.tpl: likewise + +2000-07-18 Zack Weinberg + + * gcc.c (.h spec): Fix typo. + +Wed Jul 19 01:22:15 CEST 2000 Marc Espie + + * Makefile.in: Fix tradcif.c path. + +2000-07-18 Zack Weinberg + + * cpplib.h (TTYPE_TABLE): Rearrange to use only two per-entry + macros, not five. + + * cpphash.h (TOKEN_NAME): New macro. + (_cpp_spell_operator): Deleted. + (token_spellings): Now _cpp_token_spellings. + + * cppexp.c: Use TOKEN_NAME or TYPE_NAME, not _cpp_spell_operator. + * cpplex.c: Use OP and TK macros when expanding the + TTYPE_TABLE. Eliminate token_names. For non-OPERATOR tokens, + store the stringification of the enumeration name (CPP_CHAR, + etc.) in the name slot of token_spellings. + Use TOKEN_NAME and/or TOKEN_SPELL, do not reference + token_spellings directly. + * cpplib.c: Use TOKEN_SPELL. + + * cpplex.c (_cpp_push_token): If the token being pushed back + is the previous token in this context, just subtract one from + context->posn. + * cppmacro.c (save_expansion): Clear aux field when storing a + placemarker. + +2000-07-18 Jakub Jelinek + + * cpplex.c (cpp_scan_buffer): Output line command even at the stop + buffer, provided it is not NULL. + +2000-07-18 Alexandre Oliva + + * c-decl.c (duplicate_decls): Do not call make_var_volatile() in + case of invalid volatile re-declaration. + +2000-07-18 Jakub Jelinek + + * calls.c (store_arg): Return nonzero if sibcall_failure is desired. + (expand_call): Adjust caller. + +2000-07-17 Gabriel Dos Reis + + * diagnostic.h (report_diagnostic): Change prototype. + + * diagnostic.c (output_do_verbatim, diagnostic_for_asm, + diagnostic_for_decl): Change prototype. + (error_with_decl, warning_with_decl, pedwarn_with_decl, warning, + error, warning, error_with_file_and_line, + warning_with_file_and_line, pedwarn_with_file_and_line, fatal): + Adjust call to report_diagnostic, diagnostic_for_decl. + (error_for_asm, warning_for_asm): Adjust call to diagnostic_for_asm. + (output_verbatim, verbatim): Adjust call to output_do_verbatim. + + * c-errors.c (pedwarn_c99): Adjust call to report_diagnostic. End + varaible argument list. + +2000-07-17 Zack Weinberg + + * cpphash.c: Don't include hashtab.h. Most macro-handling code + moved to cppmacro.c. + (hash_HASHNODE, eq_HASHNODE, _cpp_dump_macro_hash, + dump_hash_helper): Delete. + (expand_hash, higher_prime_number, _cpp_lookup_with_hash, + cpp_forall_identifiers): New. Implement specialized version of + Vlad's expandable hash table. + (cpp_lookup): Use new functions. + (_cpp_init_macros, _cpp_cleanup_macros): Adjust for new + implementation. + * cppmacro.c: New file. + * cppinit.c (dump_macros_helper): New. + (cpp_finish): Iterate over the identifier table directly. + * cpplex.c (parse_name): Calculate the hash of the identifier + while we scan it. Use _cpp_lookup_with_hash when we can. + + * cpphash.h: Update prototypes. + (xcnewvec, HASHSTEP): New helper macros. + * cpplib.h: Update prototypes. + * Makefile.in (LIBCPP_OBJS): Add cppmacro.o. + (cppmacro.o): New rule. + (cpphash.o): Update deps. + + * cppmain.c: Do not set pfile->printer if no_output is on. + +2000-07-15 Neil Booth + + * cpplib.c: Change all directive-handler functions to return + void, not int. + * cpphash.h: Update typedefs. + +2000-07-17 Geoffrey Keating + + * configure: Regenerate. + + * extend.texi (Extended Asm): Mention that a memory clobber + does not count as a side-effect. + + * unroll.c (copy_loop_body): Fix one instance of using host + arithmetic on the target; fixes loop-4 on a 32-bit -> 64-bit + cross-compile. + + * tlink.c (scan_linker_output): Tweak for output of AIX ld. + +2000-07-17 Richard Henderson + + * config/ia64/ia64.md (movdi): Split out load address code. + New post-reload splitter for symbolic operands. + (movdi_internal): Abort if we didn't split symbolic operands + when we should have. + * config/ia64/ia64.c (ia64_expand_load_address): New, from movdi bits. + (ia64_reorg): Split insns when not optimizing. + * config/ia64/ia64-protos.h (ia64_expand_load_address): Declare. + +Mon Jul 17 23:43:26 MET DST 2000 Jan Hubicka + + * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Use LONG_DOUBLE_TYPE_SIZE + instead of MAX_LONG_DOUBLE_TYPE_SIZE to decide output format. + +2000-07-17 Chandrakala Chavva + + * loop.c (check_dbra_loop) : Changed loop_continue to loop->cont. + +2000-07-17 Jason Merrill + + * Makefile.in (clean): Remove libgcc directory. + + * configure.in (-Wno-long-long check): Use higher-level macros. + +2000-07-17 Zack Weinberg + + * simplify-rtx.c (simplify_binary_operation): Recognize + (compare (gt[u] (cc) 0) (lt[u] (cc) 0)). + (simplify_ternary_operation): Do not examine MODE_BITSIZE of + a CONST_INT, it will always be zero. + +2000-07-17 Chandrakala Chavva + + * loop.c (check_dbra_loop) : Return if more than one condition is + present to control the loop. + +Mon Jul 17 08:26:35 2000 Clinton Popetz + + * mips.c (mips_expand_prologue): Don't calculate the last argument + register unless we need it. When we are calculating this, make + sure FUNCTION_ARG is giving us a REG. + +2000-07-17 Stephane Carrez + + * flow.c (libcall_dead_p): Use single_set to verify the insn + has only one set and get for analysis. + (propagate_one_insn): Don't pass the PATTERN of the insn. + +2000-07-17 Mark Klein + + * pa.c (emit_hpdiv_const): Update to match new pattern for udivsi3. + +2000-07-17 J. David Anglin + + * Makefile.in (TARGET_GETGROUPS_T): New configuration variable. + * configure.in (TARGET_GETGROUPS_T): Evaluate. + * sys-protos.h (getgroups): Use TARGET_GETGROUPS_T for array type + of second argument of getgroups. + * configure, config.in: Rebuilt. + +2000-07-17 Geoffrey Keating + + * simplify-rtx.c (simplify_relational_operation): Two signed + values with equal high words are less/greater than each other if + their low words are less/greater when considered as unsigned. + +Mon Jul 17 02:37:06 2000 Marc Espie + + * configure.in (vax-*-openbsd): Change to new style configuration, + add collect2/float_format information. + * configure: Rebuilt. + * config/vax/openbsd1.h: New. + * config/vax/openbsd.h: New. + * config/vax/t-openbsd: New. + +2000-07-17 Chip Salzenberg + + * c-common.c (shorten_compare): Quiet warnings about unsigned + comparisons with zero when they occur in a system header. + +2000-07-17 Joseph S. Myers + + * invoke.texi (-pedantic): Refer to ISO C instead of ANSI C, and + update to describe current practice. + + * glimits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define for C99. + + * contrib.texi, cpp.texi, extend.texi, invoke.texi: Update + references to C9X. Change references to -fstd and -flang-isoc9x + to refer to -std. + + * c-common.c (scan_char_table): Allow "z" length modifiers on + diouxXn formats. + (check_format_info): Use TYPE_DOMAIN on the type matched against + for "z" formats, to retrieve the language size_t rather than the + internal one. + + * c-common.c (check_format_info): Do not make a pedantic objection + to the 'L' length modifier if used with a floating point type + character. + + * c-lex.c (yylex): Don't pedwarn for hexadecimal floating point + constants in C99 mode. + +2000-07-17 Kazu Hirata + + * h8300.md: Fix the format of mac. + (movsi_h8300hs): Output a tab after stmac instead of a space. + + * h8300.c (two_insn_adds_subs_operand): Improve code for detecting + profitable adds/subs sequences. + + * fold-const.c: Fix comment typos. + +2000-07-16 Laurynas Biveinis + + * cppfiles.c (read_name_map): Set map_list_ptr->map_list_map to NULL. + +2000-07-16 Kaveh R. Ghazi + + * fixinc/fixfixes.c (emit_gnu_type): Avoid string concatenation. + +2000-07-16 Neil Booth + + * cpplex.c: Update comments. + * README.Portability: Small update. + +2000-07-16 Neil Booth + + * README.Portability: Small update. + +2000-07-15 Richard Henderson + + * config/ia64/ia64-protos.h (ia64_move_ok): Prototype. + * config/ia64/ia64.c (ia64_move_ok): New function. + * config/ia64/ia64.md (movqi, movqi_internal): Use it. + (movhi, movsi, movdi, movsf, movdf, movxf): Likewise. + +2000-07-15 Zack Weinberg + + * cpphash.c (save_expansion): Clear PREV_WHITE on tokens + immediately following a paste operator. + * cppinit.c (sort_options): New function (only for HOST_EBCDIC). + (cpp_reader_init): Call it, if HOST_EBCDIC. + (cpp_handle_options): Do not sort option list here. + (handle_option): Rename to cpp_handle_option and export. + * cpplex.c (cpp_scan_buffer_nooutput, cpp_scan_buffer): Use + _cpp_get_token directly. + (cpp_scan_line): Return 0 at EOF, 1 otherwise. + * cpplib.c (cpp_push_buffer): Don't set new->lineno to 1. + * cpplib.h: Prototype cpp_handle_option. Update prototype of + cpp_scan_line. + +2000-07-15 Richard Henderson + + * fold-const.c (extract_muldiv): Don't optimize past an unsigned + cast around an expression. Tidy other unsigned tests. + +2000-07-15 Gabriel Dos Reis + + * diagnostic.c (doing_line_wrapping, line_wrapper_printf, notice, + v_error_with_decl, v_warning_with_decl, v_pedwarn_with_decl): Remove. + (v_message_with_decl): Rename to ... + (format_with_decl): ... this. Tweak + (diagnostic_for_decl): New function. + (fatal_io_error): Use verbatim in lieu of notice. + (announce_function): Use verbatim. + (default_print_error_function): Likewise. + (error_with_decl, warning_with_decl, pedwarn_with_decl): Use new + infratructure. + +2000-07-15 Kaveh R. Ghazi + + * mips.c (function_arg_pass_by_reference): Don't do automatic + aggregate initialization. + (machine_dependent_reorg): Initialize variable `mode'. + + * mips.md (absdi2): Change variable `regno1' to unsigned int. + (reload_indi): Rename loword/hiword to lo_word/hi_word to avoid + conflicts with sys/param.h macro of the same name. + (reload_outdi): Likewise. + +2000-07-15 Michael Meissner + + * fold-const.c (fold): When optimizing FOO++ == CONST into ++FOO + == CONST + INCREMENT, don't overwrite the tree node for FOO++, + create a new node instead. + +2000-07-15 Neil Booth + + * README.Portability: Correct example about calling a function + through a pointer to function. Format wide paragraphs. + +2000-07-15 Michael Meissner + + * README.Portability: Update integer suffixes and function + prototype sections. + +2000-07-15 Neil Booth + + * README.Portability: Small update. + +2000-07-15 Neil Booth + + * README.Portability: New file. + +Fri Jul 14 18:13:53 2000 Mark P Mitchell + + * INSTALL: Give special instructions for building GCC on Irix 6. + * config/mips/x-iris6 (CC): Don't set it. + (OLDCC): Likewise. + +2000-07-14 Jason Merrill + + * dwarf2out.c (dwarf2out_frame_debug_expr): If we store the CFA + register in the stack and later in another register, use the new + register. + +Fri Jul 14 10:25:53 2000 Clinton Popetz + + * config/mips/mips.md: (absdi2): Handle sign_extend for + second operand. + +2000-07-14 Nathan Sidwell + + * cpplib.c (do_pragma_dependency): Tidy warning messages. + +2000-07-14 Zack Weinberg + + * .cvsignore: Correct typo. + +2000-07-13 Mark Mitchell + + * .cvsignore: Add generated YACC files. + * objc/.cvsignore: New file. + +2000-07-14 Neil Booth + + * cpplex.c (adjust_column): New function. + (skip_whitespace): Use it. + (skip_block_comment): Use it, and warn about /*/* with + -Wcomments. + +2000-07-14 Neil Booth + + * cpphash.c (struct macro_info): Add new members. + (_cpp_free_definition): Delete the macro directly. + (count_params): Return void, with first token of + expansion in struct macro_info on success. + (parse_define): Return int. Hoist syntax checking from + save_macro_expansion. Leave call to save_expansion to + _cpp_create_definition. + (alloc_macro): Needs just 2 arguments. + (free_macro): Delete. + (save_expansion): Don't perform syntax check. + (_cpp_create_definition): Call save_expansion. + +2000-07-13 Kaveh R. Ghazi + + * genrecog.c (write_header): Split long string. + + * cpphash.c (macro_info): Don't use the `signed' keyword. + + * system.h (alloca): Prototype if __GNUC__ && __SIZE_TYPE__. + +2000-07-13 Jakub Jelinek + + * calls.c (stored_args_map): New variable. + (check_sibcall_argument_overlap_1): New. + (check_sibcall_argument_overlap): New. + (expand_call): Initialize stored_args_map. + Call check_sibcall_argument_overlap. + +2000-07-13 Bruce Korb + + * fixinc/fixfixes.c: move EXIT_BROKEN to header, add sub-expr max count + (emit_gnu_type): utility procedure for gnu_type_fix + (gnu_type_fix): implement various pre-processor guards around + standard types so these types can be defined over and over + * fixinc/fixincl.tpl: add a "gnu_type_map" that forces the standard + types alluded to above will have GNU-compliant base types + * fixinc/fixlib.h: add EXIT_BROKEN define and the gnu_type_map struct + * fixinc/inclhack.def: add test_text entries and utilize the new + "gnu_types" fix for the ptrdiff_t, size_t and wchar_t types. + * fixinc/fixincl.x: regenerate + +2000-07-12 Gabriel Dos Reis + + * diagnostic.c (vline_wrapper_message_with_location, + v_message_with_file_and_line, v_error_with_file_and_file, + v_error_for_asm, v_warning_for_asm, vfatal, + v_warning_with_file_and_line, v_pedwarn_with_file_and_line, + vsorry, verror, vwarning, vpedwarn): Remove. + (diagnostic_for_asm): New function. + (pedwarn, error, warning, pedwarn_with_file_and_line, + error_with_file_and_line, warning_with_file_and_line, sorry, + error_for_asm, warning_for_asm, fatal): Reimplement. + (finish_diagnostic): Clear diagnostic info as well. + +2000-07-13 Neil Booth + + * c-common.h (flag_digraphs): New. + * c-decl.c (c_decode_option): Set flag_digraphs as appropriate. + * c-lex.c (yylex): Use flag_digraphs to decide whether to + honor digraphs. + +2000-07-13 Zack Weinberg + + * gcc.c (do_spec_1): Add new %B operator. + (set_input): Prepare for %B. + + (link_command_spec): Move up with the other tm.h- + overrideable specs. Factor out the portion conditional on + LINK_LIBGCC_SPECIAL into a new spec, %(link_libgcc). + (struct compiler): Just have a single spec string. All users + updated. + (default_compilers): Remove unnecessary braces. + (static_specs): Update. + + (trad_capable_cpp, cpp_options, cc1_options, asm_options): New + named specs. + (C and assembly specs): Use the new named specs, as appropriate. + + * objc/lang-specs.h: Use the new named specs. + Remove unnecessary braces. + +2000-07-12 Zack Weinberg + + * gcc.c (execute): If a subprocess gets a fatal signal, report + strsignal() of the signal number, and ask for a bug report. + Do not do this for SIGPIPE if there's already been an error. + + * tradcpp.c: Don't include signal.h. Don't catch SIGPIPE. + Delete pipe_closed. + + * tradcif.c: Remove. + +2000-07-12 Zack Weinberg + + * final.c (profile_function): Do not emit profile counters in + the data section, if NO_PROFILE_COUNTERS is defined. + * tm.texi: Document NO_PROFILE_COUNTERS. Update doc for + FUNCTION_PROFILER. + + * config/i386/linux.h (NO_PROFILE_COUNTERS): Define. + (FUNCTION_PROFILER): Just emit a call to mcount. + +2000-07-12 Zack Weinberg + + * tradcpp.c (main): Rename 'perror' label to 'sys_error'. + + * cppexp.c, cpphash.c, cpphash.h, cppinit.c, cpplex.c, + cpplib.c, cpplib.h: Eradicate all traces of code dependent on + traditional, lang_chill, or lang_fortran. + + * cppfiles.c: #undef strcmp to suppress warning about macros + used without arguments. + (_cpp_execute_include): Use f, not fname, in "No include path" + error. + (_cpp_pop_file_buffer): New function. + * cpplib.c: Don't include . + (cpp_push_buffer): Set line_base and lineno in new buffer. + (cpp_pop_buffer): Use _cpp_pop_file_buffer. + + * cpplex.c: Move all prototypes and structure declarations to the + top of the file. Properly parenthesize some macro arguments. + (cpp_scan_line): New function. + (special_symbol [case T_INCLUDE_DEPTH]): Use pfile->include_depth, + don't need to walk up the stack counting. + +2000-07-12 Kaveh R. Ghazi + + * c-common.c (combine_strings): Emit a pedantic warning when a + string length is greater than the minimum ANSI C is required + to support. + +Wed Jul 12 13:24:30 2000 Jeffrey A Law (law@cygnus.com) + + * pa/xm-pa64.h (NO_SYS_SIGLIST): Kill. + * d30v/xm-d30v.h (NO_SYS_SIGLIST): Kill. + +2000-07-12 Kaveh R. Ghazi + + * c-decl.c (define_label): Warn about identifier conflicts with + labels in traditional C. + + * c-parse.in (unop +): Warn about the unary plus operator for + traditional C. + + * c-typeck.c (store_init_value): Warn about automatic aggregate + initialization for traditional C. + + * invoke.texi (-Wtraditional): Document new warnings. + +2000-07-12 Gabriel Dos Reis + + * Makefile.in (c-errors.o): Fix thinko in dependency. + +2000-07-12 Zack Weinberg + + * gcc.c (C specs [!USE_CPPLIB]): Invoke tradcpp if any of + -traditional, -ftraditional, or -traditional-cpp was given. + Do not pass -traditional to the preprocessor. + (.S spec): Likewise. Don't bother defining __ASSEMBLER__, the + preprocessor does it automatically. + * objc/lang-specs.h: Likewise. Don't bother defining __OBJC__. + + * ch/lang-specs.h: Always use tradcpp. Do not pass + -traditional, -trigraphs, or -pedantic to the preprocessor. + * f/lang-specs.h (.F spec): Likewise. Don't bother defining + _LANGUAGE_FORTRAN. + +2000-07-12 Zack Weinberg + + * cppexp.c (LOGICAL): Delete macro. + (_cpp_parse_expr): Do not use UNARY for unary +. Implement || + and && directly. + + * cpphash.c (HASHSIZE): Increase to 4096. + (struct hashdummy): Add hash field. + (eq_HASHNODE): Compare unreduced hashes, then lengths, then + the string values using memcmp. + (cpp_lookup): Set dummy.hash. + +Wed Jul 12 13:15:16 2000 Marc Espie + + * configure.in (m88k-openbsd): Express configuration using new fragment + style. + * configure: Rebuilt. + * m88k/aout-dbx.h: New. + * m88k/openbsd.h: New. + * m88k/xm-openbsd.h: New. + +2000-07-12 Kaveh R. Ghazi + + * expr.c (expand_expr): Return const0_rtx, not error_mark_node. + +2000-07-12 Richard Henderson + + * reload.c (push_secondary_reload): Make sure to add the new + reload at the end, after acquiring secondary memory. + +2000-07-12 Kaveh R. Ghazi + + * cpplex.c (is_macro_disabled): Use CPP_WTRADITIONAL. + + * c-decl.c (set_current_function_name_declared, anon_aggr_type_p, + lang_expand_stmt): Mark parameters with ATTRIBUTE_UNUSED. + + * c-parse.in (stmt): Delete unused variables. + + * convert.c (convert_to_vector): Likewise. + + * gensupport.c (process_rtx): Declare attr as `rtvec' not `rtx'. + + * tree.c (finish_vector_type): Prototype. + +2000-07-12 Bruce Korb + + * fixinc/fixfixes.c: use xmalloc + * fixinc/fixincl.c(initialize): set program name for xmalloc + * fixinc/fixlib.c(must_malloc): obsolete + (is_cxx_header): no longer used - disabled + (skip_quote): inserted and disabled for future use + * fixinc/fixlib.h: reflects above + * fixinc/fixtests.c: removed dinkleberries + +2000-07-12 Neil Booth + + * cpphash.h: (TOKEN_SPELL) Pulled from cpplex.c. + * cpplex.c (TOKEN_SPELL) Move to cpphash.h. + + * cpphash.c: (struct macro_info, alloc_macro, free_macro, + struct toklist_dummy): New. + (cpp_free_definition): Free macros with free_macro. + (count_params): Don't save parameter spellings. Save macro + information in a struct macro_info. + (parse_define): Don't allocate a token list. + (save_expansion): Allocate the macro's token list, and + save parameter spellings if necessary. Use TOKEN_SPELL. + (cpp_create_definition): Make list const. + +2000-07-12 Gabriel Dos Reis + + * c-typeck.c (pedwarn_c99): Move to + * c-errors.c: ... Here. + * toplev.h (verror, vwarning, vpedwarn): Remove prototypes. + * diagnostic.c (verror, vwarning, vpedwarn): Make static. + * Makefile.in (C_AND_OBJC_OBJS): Include c-errors.o + (c-errors.o): List dependency. + +2000-07-12 Mark Mitchell + + * c-parse.c: Remove. + * c-parse.h: Likewise. + * c-parse.y: Likewise. + * objc/objc-parse.c: Likewise. + * objc/objc-pasre.y: Likewise. + +2000-07-11 Rodney Brown + + * gcc.texi: Fix minor typos + * extend.texi: Fix minor typos + +2000-07-11 Marc Espie + + * collect2.c (main): Recognize .lo as object files. + +2000-07-11 J. David Anglin + + * pa.c (hppa_encode_label): Store labels in gc memory when ggc_p is + true. + + * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE): Extend test to detect systems + with MAP_ANONYMOUS and MAP_ANON. + * configure, config.in: Rebuilt. + +2000-07-12 Gabriel Dos Reis + + * diagnostic.c (save_output_state): Remove. + (restore_output_state): Likewise. + (clear_text_info): New function. + (clear_diagnostic_info): Likewise. + (output_text_length, is_starting_newline, output_prefix, + line_wrap_cutoff, ideal_line_wrap_cutoff, prefix_was_emitted_for, + prefixing_policy, output_buffer_ptr_to_format_args): New macros + (set_real_maximum_length, output_set_maximum_length, + output_set_prefix, output_get_prefix, output_set_maximum_length, + output_destroy_prefix, init_output_buffer, + reshape_diagnostic_buffer, output_space_left, output_emit_prefix, + output_add_newline, output_add_character, output_add_space, + output_append_r, output_append, wrap_text, output_format, + output_do_printf, output_printf, output_do_verbatim, + output_verbatim, verbatim): Use them. + (output_clear): Split into cleat_text_info and + clear_diagnostic_info. + (struct output_state): Move to... + + * diagnostic.h: ...Here + (struct output_buffer): Adjust. + +2000-07-11 Zack Weinberg + + * cpplex.c (parse_name): No longer inline (premature optimization). + (do_pop_context): Fold into pop_context. + (pop_context): Returns int. + (lex_next): Hoist test for end of directive into pop_context. + (push_macro_context): Returns int; takes just reader and token. + Hoist test for excessive nesting to caller. + (push_arg_context): Returns void; takes just reader and token. + Do not call stringify_arg or get_raw_token. + (get_raw_token): Convert tail recursion through push_arg_context + to a loop at this level. Call stringify_arg here if appropriate. + (maybe_paste_with_next): Convert tail recursion to a while loop. + Hoist test of paste_level to caller. + + (stringify_arg): Push arg context at beginning. + (cpp_get_token): Split out core into _cpp_get_token. Call + process_directive here. Throw away CPP_PLACEMARKER tokens. + (_cpp_get_token): Convert tail recursion through + push_macro_context to a loop at this level. + (_cpp_glue_header_name, is_macro_disabled, stringify_arg, + _cpp_get_raw_token): Use _cpp_get_token. + (_cpp_skip_rest_of_line): Drop the context stack directly; do + not call pop_context. + (_cpp_run_directive): Call lex_next directly. + + * cpphash.h: Prototype _cpp_get_token. + * cppexp.c (lex): Use it. + * cpphash.c (parse_define): Use it. + * cpplib.c (get_define_node, do_undef, parse_include, + read_line_number, do_line, do_ident, do_pragma, do_pragma_gcc, + do_pragma_implementation, do_pragma_poison, do_pragma_dependency, + parse_ifdef, validate_else): Use it. + (cpp_push_buffer): Tweak error message; abort if anyone tries + to push a buffer while macro expansions are stacked. + +2000-07-11 Donn Terry + + * cpplex.c (free_macro_args, save_token): Cast arg of free + and/or xrealloc to PTR. + (_cpp_init_input_buffer): Clear all fields of the base context. + +Tue Jul 11 15:28:21 CDT 2000 Clinton Popetz + + * gensupport.c (process_rtx): Make rtl checking stop + complaining about the define_insn while it is being + converted from a define_insn_and_split. + +Tue Jul 11 16:26:17 2000 Clinton Popetz + + * config/mips/mips.c (simple_memory_operand): Access the + INTVAL of the address, not it's containing MEM. + +2000-07-11 Bruce Korb + + * fixinc/fixtests.c(double_slash): obsolete + (else_endif_label): likewise + * fixinc/inclhack.def(irix_multiline_cmnt): obsolete + (libc1_ifdefd_memx): correct initial comment + and omit the #if/#endif pair from the memxxx declarations + * fixinc/fixincl.x: regen + +2000-07-11 Kaveh R. Ghazi + + * cpplex.c (T, I, S, C, N): Avoid non-constant initializers. + +2000-07-11 Neil Booth + + * cpp.texi: Update. + +2000-07-11 Neil Booth + + * cppinit.c: (cpp_reader_init): Allow digraphs by default. + (handle_option): Set digraphs according to standard. + Merge OPT_lang_c89 handler with OPT_std_c89. + + * cpplex.c: (lex_line, can_paste): Honor digraphs in + accordance with the digraphs flag. + + * cpplib.h: (struct cpp_options): New option digraphs. + +2000-07-10 Hans-Peter Nilsson + Bruce Korb + + * fixinc/inclhack.def (libc1_ifdefd_memx): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/testing.h: Add testcase. + +2000-07-10 Richard Henderson + + * config/ia64/ia64.c (got_symbolic_operand): New. + (symbolic_operand, move_operand): Revert 0701 change. + * config/ia64/ia64.h (PREDICATE_CODES): Update. + * config/ia64/ia64-protos.h (got_symbolic_operand): Declare. + * config/ia64/ia64.md (movdi): Revert 0701 wrt symbolic_operand; + split the offset into a 14-bit low part instead of a 13-bit low part. + (load_fptr): Mark the mem as unchanging. + (load_symptr): Use got_symbolic_operand. + +2000-07-10 Nick Clifton + + * libgcc2.c (next_stack_level): Cast result of computation to + (void **) so that the assignment does not generate a warning. + +2000-07-10 Chandrakala Chavva + + * flags.h : Add new variable flag_single_precision_constant. + * toplev.c (display_help) : Add -fsingle-precision-constant option. + (flag_single_precision_constant): New. + * c-lex.c (yylex): Convert floating point constant to single + precision constant. + * invoke.texi : Add documentation for this new option. + +2000-07-10 Gabriel Dos Reis + + * diagnostic.c (output_octal): Second parameter is unsigned. + (output_long_octal): Likewise. + (output_hexadecimal): Likewise. + (output_long_hexadecimal): Likewise. + (output_format): Adjust arguments extraction. Tweak. + (output_verbatim, verbatim): End variable argument list. + (report_diagnostic): Improve documentation. + +2000-07-10 Benjamin Chelf + + * c-common.h (build_stmt): Declare. + (build_continue_stmt): Likewise. + (build_break_stmt): Likewise. + (build_return_stmt): Likewise. + + * c-decl.c (do_case): Rewrite to do what previously done in + c-parse.in. + + * c-semantics.c (build_stmt): Define. + (build_return_stmt): Likewise. + (build_break_stmt): Likewise. + (build_continue_stmt): Likewise. + (build_case_label): Likewise. + + * c-parse.in (BREAK): Change to build tree, then generate RTL. + (CONTINUE): Likewise. + (RETURN): Likewise. + (CASE): Likewise. + (DEFAULT): Likewise. + + * c-parse.y: Regenerate. + * c-pasre.c: Likewise. + +2000-07-09 Jason Merrill + + * expr.c (expand_expr): Bail earlier if we get an error_mark_node. + + * tree.h (STRIP_NOPS): Check for error_mark_node. + (STRIP_SIGN_NOPS, STRIP_TYPE_NOPS): Likewise. + (dwarf2out_*): Remove duplicate declarations. + + * c-decl.c (duplicate_decls): Copy DECL_ABSTRACT_ORIGIN from + DECL_ABSTRACT_ORIGIN, not DECL_ORIGIN. + +2000-07-10 Gabriel Dos Reis + + * diagnostic.c (wrap_text): New function. + (maybe_wrap_text): Likewise. + (output_add_string): Use it. + (output_format): Likewise. + (count_error): Use verbatim instead of notice. + (report_error_function): Likewise. Don't use plain fprintf. + (finish_diagnostic): New function. + (output_do_verbatim): Tweak. Commonalize functionalities in + output_verbatim and verbatim. + (output_verbatim): Adjust. + (verbatim): Likewise. + (report_diagnostic): Define. + + * diagnostic.h (report_diagnostic): Prototype. + +2000-07-09 Zack Weinberg + + * cppexp.c (_cpp_parse_expr): Don't use unary plus. + +2000-07-09 Neil Booth + + * cpphash.h: ISvspace, is_vspace, is_nvspace: New. + IShspace, ISspace: Update. + + * cppinit.c: ISTABLE: Update. + V: New. + + * cpplex.c (IS_HSPACE, S_NEWLINE): Remove. + (IS_DIRECTIVE): Rename KNOWN_DIRECTIVE. + (skip_block_comment, skip_line_comment, parse_string, + lex_line): Use is_vspace rather than IS_NEWLINE. + (skip_whitespace, lex_line): Clean up to use is_nvspace. + (lex_line): Use KNOWN_DIRECTIVE. Any kind of directive + gets a BOL flag. + (lex_next): Unconditionally stop if within a directive. + Treat directives within macro invocations as directives + (after parse_args emits error), not as the argument. + +2000-07-09 Gabriel Dos Reis + + * diagnostic.c (diagnostic_args): New macro. + (diagnostic_msg): Likewise. + (output_formatted_integer): Likewise. + (output_state): New data type. + (digit_buffer): Make global. + (output_add_integer): Rename to output_decimal. Squeeze + digit_buffer. + (output_long_decimal, output_unsigned_decimal, + output_long_unsigned_decimal, output_octal, output_long_octal, + output_hexadecimal, output_long_hexadecimal): New functions. + (output_append_r): New function. + (output_append): Tweak. + (output_flush_on): Rename to output_to_stream. + (output_format): Change prototype. Improve documentation. Handle + more format specifiers. + (build_location_prefix): Rename to context_as_prefix. + (output_notice): Rename to output_do_printf. + (output_printf): Tweak. + (line_wrapper_printf): Likewise. + (vline_wrapper_message_with_location): Adjust call to renamed + functions. + (v_message_with_decl): Likewise. + (default_print_error_function): Likewise. + (save_output_state): New function. + (restore_output_state): Likewise. + (output_do_verbatim): Likewise. + (output_verbatim): Define. + (verbatim): Likewise. + + * diagnostic.h (printer_fn): Change return type from void to int. + Improve documentation. + (output_add_integer): Rename to output_decimal. + (output_flush_on, output_format): Don't export. + (output_verbatim, verbatim): Declare. + +2000-07-08 Toon Moene + + * fold-const.c (extract_muldiv) case PLUS_EXPR, MINUS_EXPR: + Check whether c divides op1 exactly if operation is not + multiplication. + +2000-07-08 Richard Henderson + + * final.c (final): Do not abort when reg-stack introduces + a new insn. + +2000-07-08 Zack Weinberg + + * cpplib.h (struct cpp_name): Now struct cpp_string. + (CPP_INT, CPP_FLOAT, CPP_NUMBER, CPP_COMMENT, + CPP_HEADER_NAME): Change to type S. + (struct cpp_token): Rename 'name' field to 'str'. Add 'node' + field, a cpp_hashnode *. All references to val.name updated + to use val.str or val.node as appropriate. + (struct cpp_reader): Add spec_nodes field. + (cpp_idcmp): Now cpp_ideq; takes a token * and a char *. + + * cpphash.h (struct spec_nodes): New. + (enum spell_type): Reorder. Only SPELL_STRING tokens use + val.str. All references to 'spelling > SPELL_NONE' updated to + match. + + (CPP_IN_SYSTEM_HEADER): Check pfile->buffer and + pfile->buffer->inc are not NULL before dereferencing them. + + * cpplex.c (parse_name): Take a pointer to the current token, + plus current position and limit as args; return the new + position; don't copy the text of a name into the string + buffer, instead call cpp_lookup and store the node pointer. + If extending a token, copy out the text of the old into a + scratch buffer, append the new, look that up and store the new + node pointer. Inline. + (maybe_paste_with_next): If the result of paste is a NAME, + then look up the pasted text and store its node pointer. + (lex_line): Adjust for new parse_name interface. + Check for L"str", L'str' using spec_nodes->n_L. + (spell_token): SPELL_IDENT tokens have their spelling in + val.node->name. Handle SPELL_STRING tokens that don't have + string delimiters. + (_cpp_expand_name_space, + (can_paste): Check for L ## "str" using spec_nodes->n_L. + (cpp_get_token, special_symbol): No need to call cpp_lookup. + (cpp_idcmp): Now cpp_ideq; take a token * and a const char *; + return 1=equal 0=not, not a tristate. + + * cpphash.c (var_args_str): Delete. + (find_param): Compare node fields directly. + (is__va_args__): Use CPP_PEDANTIC. Just compare + token->val.node with spec_nodes->n__VA_ARGS__. + (dump_funlike_macro): Don't use var_args_str. + + * cpplib.c (_cpp_check_directive): Just walk through + spec_nodes->dirs comparing pointers. + (get_define_node, do_pragma_poison, detect_if_not_defined, + parse_ifdef): The identifier has already been looked up. + (do_ifdef, do_ifndef): parse_ifdef won't return a poisoned + node. + (do_if): Only call detect_if_not_defined at beginning of file. + (_cpp_parse_assertion): Only copy string pointers for + SPELL_STRING tokens. + (pragma_dispatch): Take a node pointer and examine its name + field. + (_cpp_init_stacks): Also initialize the spec_nodes structure. + + * cppinit.c (cpp_reader_init): Call _cpp_init_stacks after + _cpp_init_macros. + (cpp_cleanup): Free pfile->spec_nodes. Call _cpp_cleanup_* in + reverse order from the corresponding _cpp_init_* routines. + + * cppexp.c (parse_number, parse_charconst, parse_defined, + lex): Check val.node->type instead of calling cpp_defined. + Use spec_nodes entries where appropriate. + + * fix-header.c, scan-decls.c: Update for interface changes. + +2000-07-08 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_emit_move): Fix conditions for + emitting aux_truncdfsf2. + +2000-07-03 Donn Terry (donnte@microsoft.com) + + * cppinit.c (print_help): split overlong line into ISO C89 + maximum chunks. + +2000-07-07 Zack Weinberg + + * cppexp.c: Update all code for new lexer interface. + (op_t, operator codes, struct token, tokentab2, op_to_str): Remove. + (struct suffix, vsuf_1, vsuf_2, vsuf_3, op_to_prio): New. + * cpplex.c (token_names): Trim leading CPP_ from names; make + the strings unsigned. + (_cpp_spell_operator): New. + (is_macro_disabled): Disable all macros if rescanning + preprocessed text. + (_cpp_get_directive_token): Remove. + + * cppinit.c: Don't set no_macro_expand. + * cpplib.c (read_line_number, do_line): Check only for EOF, + not VSPACE. + * cpphash.h: Update prototypes. + * cpplib.h (CPP_VSPACE): Remove. + (struct cpp_reader): Remove no_macro_expand. + +2000-07-08 Neil Booth + + * cpphash.c (is__va_args__): New function. + (count_params): Fix line reported in error messages. Use + is__va_args__. Don't return ')' on error. Flag GNU style + rest args macro definitions. + (parse_define): Check macro name is not __VA_ARGS__. + (save_expansion): Check identifier in non-varargs-macro is + not __VA_ARGS__. Don't flag GNU_VARARGS. + * cpplex.c (parse_args): Accept no argument iff GNU_REST_ARGS. + (maybe_paste_with_next): Use per-macro GNU_REST_ARGS rather + than per-token GNU_VARARGS. + * cpplib.h (GNU_VARARGS): Remove. + (GNU_REST_ARGS): New. + +Sat Jul 8 01:38:25 MET DST 2000 Jan Hubicka + + * i386.md (call_pop, call, call_value_pop): Do not set + current_function_uses_pic_offset_table for calls to static + functions or indirect calls. + +2000-07-07 Jim Wilson + + * config/ia64/ia64.c (rws_access_reg): New local write_count. If + is_predicate_reg, then take max write_count of register pair. + +2000-07-07 Kaveh R. Ghazi + + * tradcpp.c (main): Rename label `include' to `add_include' to + avoid conflicts with variable `include' in traditional C. + +2000-07-07 Jakub Jelinek + + * integrate.c (copy_insn_list): Remove REG_LABEL notes. + +2000-07-07 Jakub Jelinek + + * sibcall.c (uses_addressof): Add INMEM argument, check for + current_function_internal_arg_pointer outside of MEM rtxs in addition + to ADDRESSOFs. + (sequence_uses_addressof): Update caller. + +2000-07-07 Zack Weinberg + + * tradcpp.c (initialize_builtins): Honor NO_BUILTIN_SIZE_TYPE + and friends. + +2000-07-07 Kaveh R. Ghazi + + * system.h (UNION_INIT_ZERO): New macro for initializing union + members in structs. + + * cpplex.c (placemarker_token, eof_token): Use UNION_INIT_ZERO. + +2000-07-07 Neil Booth + + * cpp.texi: Update. + +Fri Jul 7 07:47:35 2000 Jeffrey A Law (law@cygnus.com) + + * final.c (final): Detect out of bounds array access to + the insn_lengths array. + +2000-07-07 Kazu Hirata + + * fold-const.c (fold): Fix a comment typo. + +2000-07-07 Neil Booth + + * cpp.texi: Update to new lexer. + +2000-07-06 Zack Weinberg + + * tradcpp.c: New file. + * tradcif.y: New file. + * tradcif.c: New generated file. + + * Makefile.in: Add rules to build tradcpp.o, tradcif.o, + $(srcdir)/tradcif.c. Add tradcpp to STAGESTUFF and + dependencies of C. Install tradcpp from install-common, in + $(libsubdir). + +2000-07-06 Zack Weinberg + + * cppinit.c: Include cppdefault.h. Refer to + cpp_GCC_INCLUDE_DIR and cpp_GCC_INCLUDE_DIR_len, not directly + to GCC_INCLUDE_DIR and its length. + (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, + USER_LABEL_PREFIX, REGISTER_PREFIX, struct default_include, + STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT): Move to + cppdefault.h. + (include_defaults_array): Move to cppdefault.c. + + * cppdefault.h: New file. + * cppdefault.c: New file. + + * Makefile.in (LIBCPP_OBJS): Add cppdefault.o. + (cppinit.o): Don't apply $(PREPROCESSOR_DEFINES) to this file. + (cppdefault.o): New rule; apply $(PREPROCESSOR_DEFINES) to + this file. + +Thu Jul 6 18:30:36 2000 Richard Kenner + + * reload.c (push_reload): When seeing if can reuse a register, + check extra registers against widest of INMODE and OUTMODE. + +2000-07-06 Neil Booth + + * cpplib.c: (_cpp_parse_assertion): Perform hash lookups + based on full length of predicate. + +2000-07-06 Hans-Peter Nilsson + + * timevar.c: [HAVE_SYS_RESOURCE_H]: Include . + [NEED_DECLARATION_GETRUSAGE]: Declare getrusage. + +2000-07-05 Kazu Hirata + + * h8300-proto.h: Fix formatting. + * h8300.c: Likewise. + * h8300.h: Likewise. + +2000-07-05 Jim Wilson + + * config/ia64/ia64.h (HARD_REGNO_MODE_OK): If FR_REGNO_P, disallow + CCmode. + +2000-07-05 Rodney Brown + + * invoke.texi: Fix minor typos + * md.texi: Fix minor typos + +2000-07-05 Zack Weinberg + + * cpplib.c (_cpp_parse_assertion): Fix buffer overrun. + +2000-07-04 Zack Weinberg + + * cpplex.c: Don't include sys/mman.h. + (cpp_push_buffer, cpp_pop_buffer): Moved to cpplib.c. + + * cpplib.c: Include sys/mman.h and obstack.h. + (cpp_push_buffer): Moved from cpplex.c; allocate buffers on an + obstack. + (cpp_pop_buffer): Moved from cpplex.c; free buffers from an obstack. + (_cpp_unwind_if_stack): Now static, unwind_if_stack. Don't + bother freeing if stack entries (they will be freed with their buffer). + (do_endif): Free if stack entries from the buffer obstack. + (push_conditional): Allocate if stack entries from the buffer obstack. + + (find_answer): Rename to _cpp_find_answer. + (do_assert, do_unassert): Update. + + * cpphash.h: Update prototypes. + (xobnew): New convenience macro. + * cpplib.h (struct cpp_reader): Add hash_ob and buffer_ob fields. + Update comments. + (struct cpp_hashnode): Remove disabled field. + + * cppinit.c: Don't include hashtab.h or splay-tree.h. + (report_missing_guard): Moved to cppfiles.c. + (cpp_reader_init): Call cpp_init_stacks, cpp_init_macros, + cpp_init_includes. + (cpp_cleanup): Call cpp_cleanup_stacks, cpp_cleanup_macros, + cpp_cleanup_includes. Don't destroy hashtab or + all_include_files here. + (cpp_finish): Use _cpp_report_missing_guards. + + * cppfiles.c (report_missing_guard): Moved from cppinit.c. + (_cpp_init_include_table): Rename _cpp_init_includes. + (_cpp_cleanup_includes, _cpp_report_missing_guards): New. + + * cppexp.c (parse_assertion): Update for new name of + find_answer. + + * Makefile.in (cpplib.o, cpphash.o, cppinit.o): Update deps. + +2000-07-04 Zack Weinberg + + * cpplib.c (do_ident): s/VSPACE/EOF/ + +2000-07-05 Neil Booth + + * cpplex.c: Fix trigraph replacement within strings. + +2000-07-04 Kaveh R. Ghazi + + * rs6000/aix.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier. + + * xcoffout.c (assign_type_number): Constify. + (xcoffout_source_file): Add static prototype. Don't needlessly + cast away const-ness. + +2000-07-04 Jason Merrill + + * frame.h (frame_state): Move base_offset to end. + +Mon Jul 3 21:31:43 2000 Clinton Popetz + + * calls.c (emit_library_call_value_1): Revert previous change. + +2000-07-03 Zack Weinberg + + * fix-header.c (struct partial_proto): Remove unnecessary fields. + (recognized_extern, recognized_function, read_scan_file): + Update for new scheme. + (check_protection): It's still a multiple include guard even + if it doesn't always trigger. + * scan-decls.c (skip_to_closing_brace, scan_decls): Update for + new scheme. + * scan.h: Declare struct cpp_token. Update prototypes. + +2000-07-03 Neil Booth + Zack Weinberg + + Complete overhaul of the lexer and macro expander. + + * cpphash.c (object_defn, funct_defn, push_macro_expansion, + arg, arglist, argdata, reflist, collect_objlike_expansion, + collect_funlike_expansion, collect_params, + warn_trad_stringify, trad_stringify, duplicate_arg_p, add_pat, + unsafe_chars, macarg, compare_defs, special_symbol, + scan_arguments, stringify, funlike_macroexpand, + _cpp_quote_string, monthnames): Delete. + (cpp_lookup, _cpp_free_definition, dump_funlike_macro, + _cpp_create_definition, _cpp_dump_definition, + dump_hash_helper): Adjust. + (find_param, count_params, parse_define, var_args_str, + check_macro_redefinition, save_expansion): New. + + * cpplex.c (skip_block_comment, skip_line_comment, parse_name, + parse_string, output_line_command, trigraph_replace, + lex_line, cpp_push_buffer, cpp_pop_buffer, cpp_output_tokens, + cpp_scan_buffer_nooutput, cpp_scan_buffer, cpp_free_toklist, + cpp_idcmp, _cpp_get_directive_token, _cpp_init_input_buffer, + _cpp_skip_rest_of_line): Modify. + + (maybe_macroexpand, skip_comment, copy_comment, skip_string, + find_position, null_warning, bump_column, expand_name_space, + pedantic_whitespace, _cpp_output_list, _cpp_slice_toklist, + _cpp_squeeze_toklist, _cpp_scan_until, _cpp_skip_hspace, + _cpp_parse_name, _cpp_lex_token, cpp_get_non_space_token, + _cpp_prescan): Delete. + + (dump_param_spelling, process_directive, lex_next, + is_macro_disabled, stringify_arg, expand_context_stack, + output_token, make_string_token, alloc_number_token, + special_symbol, duplicate_token, maybe_paste_with_next, + can_paste, prevent_macro_expansion, restore_macro_expansion, + get_temp_token, release_temp_tokens, quote_string, + token_names, token_spellings, _cpp_expand_name_space, + _cpp_glue_header_name, _cpp_reserve_name_space, + digraph_spellings, trigraph_ok, skip_whitespace, save_comment, + placemarker_token, eof_token, cpp_context, macro_args, + get_raw_token, parse_arg, parse_args, save_token, + push_arg_context, push_macro_context, pop_context, + do_pop_context, free_macro_args, _cpp_get_line, + _cpp_run_directive): New. + + * cpplib.c (validate_else, parse_include, push_conditional, + pass_thru_directive, read_line_number, parse_ifdef, + detect_if_not_defined, _cpp_check_directive, do_define, + do_undef, do_include, do_import, do_include_next, do_error, + do_warning, do_ident, do_pragma, pragma_dispatch, gcc_pragmas, + top_pragmas, do_pragma_gcc, do_pragma_implementation, + do_pragma_poison, do_pragma_system_header, + do_pragma_dependency, do_sccs, do_ifdef, do_ifndef, do_else, + dl_elif, do_endif, _cpp_unwind_if_stack, do_assert, + do_unassert, cpp_define, cpp_undef, cpp_assert, cpp_unassert, + cpp_defined): Update for new scheme. + (strtoul_for_line, get_define_node, dump_macro_name, + _cpp_check_linemarker, _cpp_parse_assertion): New. + (_cpp_handle_directive, do_pragma_default): Delete. + + * cpphash.h (struct predicate): Now struct answer. + (enum spell_type, struct token_spelling, struct directive, + directive_handler): New. + Update prototypes. Remove unused macros. + * cpplib.h: Update prototypes. Remove unused macros, + structure definitions, and fields. + + * cpperror.c (print_containing_files, v_message): Adjust. + * cppexp.c (parse_assertion, lex, parse_escape, + _cpp_parse_expr): Adjust. + * cppfiles.c (open_include_file, _cpp_execute_include, + _cpp_compare_file_date, cpp_read_file, read_include_file): + Adjust. + * cppinit.c (dump_special_to_buffer): Delete. + (append_include_chain, merge_include_chains, cpp_reader_init, + cpp_cleanup, initialize_builtins, builtin_array, cpp_start_read, + cpp_finish, handle_option, print_help): Adjust. + * cppmain.c (main): Adjust. + +2000-07-03 Zack Weinberg + + * cppspec.c (lang_specific_driver): Use double quotes in error + message. + +Mon Jul 3 16:53:43 2000 Clinton Popetz + + * calls.c (emit_library_call_value_1): Use valreg instead + of hard_libcall_value. + +2000-07-03 Geoff Keating + + * config/rs6000/rs6000.c (rs6000_emit_move): New function. + * config/rs6000/rs6000-proto.h: Prototype rs6000_emit_move. + * config/rs6000/rs6000.md (movsi): Use rs6000_emit_move. + (movhi): Likewise. + (movqi): Likewise. + (movdf): Likewise. + (movsf): Likewise. + (movdi): Likewise. + (movti): Likewise. + + * expmed.c (expand_mult_highpart): Use op1 instead of wide_op1 when + mode instead of wider_mode is being used. + +2000-07-03 Jakub Jelinek + + * config/i386/i386.md (movstrictqi_xor): Use 'q' constraint instead + of 'r'. Use q_regs_operand. + (andsi_1+2): Use q_regs_operand. + +2000-07-03 Jakub Jelinek + + * builtins.c (get_memory_rtx): Always put into alias set 0. + +2000-07-03 Nick Clifton + + * config/arm/arm.md: Fix post increment and pre increment + peepholes so that they do not generate UNPREDICATBLE opcodes. + (ie ones where the increment clobbers the source/destination). + +2000-07-01 Marek Michalkiewicz + + * config/avr/avr.c (out_adj_frame_ptr): Make "frame pointer + change too big for -mtiny-stack" a warning, if larger than 63. + (out_set_stack_ptr): Change the logic so -mno-interrupts is + always safe to use on possible future devices. + (function_prologue): Write SPH before SPL, for consistency. + If interrupt_func_p true, we know we have enabled interrupts. + (avr_num_arg_regs): New function. Round up to even number of + bytes if no -mpack-args or if calling a libgcc function. + (function_arg, function_arg_advance): Use it. + (output_movsisf, ashlsi3_out, ashrsi3_out, lshrsi3_out): + Output "movw" if available. + (out_tsthi, out_tstsi, ashlqi3_out, lshrqi3_out): Change uses + of TEST_HARD_REG_CLASS macro to test_hard_reg_class function. + (asm_output_section_name): Add blanks for consistent output. + (encode_section_info): Set TREE_READONLY for progmem data to + avoid gas warnings about changed section attributes. + (avr_hard_regno_mode_ok): Force non-QImode data to start in + even numbered registers on devices with "movw". + * config/avr/avr.h (MASK_*): Define bits for target_flags. + (TARGET_SWITCHES): Mark help strings for translation. + Add new -mpack-args and -menhanced switches. + (TARGET_OPTIONS): Mark help strings for translation. + (progmem_section): Add section attributes. + * config/avr/avr.md (*movhi, call_insn, call_value_insn): + Output "movw" if available. + (mulqi3, mulqihi3, umulqihi3, mulhi3, *tablejump_enh): + New patterns. + * config/avr/libgcc.S (_mulqi3, _divqi3): Update to the new + call convention (arguments aligned on even registers). + (_cleanup, _exit): Make weak symbols libc can override. + +2000-07-03 Kaveh R. Ghazi + + * fp-bit.h: New file. + + * fp-bit.c: Move common code, prototypes, etc into fp-bit.h. + Comment #endif statements. + (__thenan_sf, __thenan_df): Add missing braces around initializer. + +Mon Jul 3 00:32:47 2000 Jeffrey A Law (law@cygnus.com) + + * gcse.c (compute_pre_data): Compute ae_kill using other local + properties instead of calling compute_ae_kill. + + * alias.c (init_alias_analysis): Do not call + prologue_epilogue_contains until after reload has completed. + +2000-07-02 Benjamin Chelf + + * c-common.h (genrtl_begin_compound_stmt): Remove declaration. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Change to return void. + + * c-semantics.c (genrtl_begin_compound_stmt): Remove function and + move code from here to ... + (genrtl_compound_stmt): ... here. + (genrtl_finish_compound_stmt): Remove. + (expand_stmt): Add comment. + +2000-07-02 Zack Weinberg + + * c-typeck.c (build_indirect_ref): Use COMPLETE_OR_VOID_TYPE_P + and VOID_TYPE_P. + +2000-07-02 Jakub Jelinek + + * cpplib.h (struct cpp_reader): New field include_depth. + (struct cpp_printer): Rename last_bsd to last_id. + * cppfiles.c (read_include_file): Bump include_depth. + * cpplex.c (cpp_pop_buffer): Decrement include_depth. + (output_line_command): Output correct #line if a header + is including itself and is not protected against multiple inclusion. + Use include_depth instead of buffer_stack_depth, last_id instead of + last_bsd. + * cppinit.c (cpp_start_read): Initialize last_id instead of + last_bsd. + +2000-07-01 Benjamin Chelf + + * Makefile.in (C_AND_OBJC_OBJS): Added c-semantics.o. + (c-semantics.o): New target. + + * c-common.h (TREE_LANG_FLAG_?): Added documentation. + (genrtl_do_pushlevel): Moved from cp/cp-tree.h. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (gerntl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (DECL_ANON_UNION_ELEMS): Likewise. + (emit_local_var): Likewise. + (make_rtl_for_local_static): Likewise. + (expand_cond): Likewise. + (expand_stmt): Likewise. + (c_expand_return): Likewise. + (c_expand_start_case): Likewise. + (do_case): Likewise. + (COMPOUND_STMT_NO_SCOPE): Likewise. + (c_expand_asm_operands): Likewise. + (NEW_FOR_SCOPE_P): New macro. + (expand_expr_stmt_fn): New type. + + (set_current_function_name_declared): Likewise. + (current_function_name_declared): Likewise. + (lang_expand_stmt): Likewise. + (stmts_are_full_exprs_p): Likewise. + (anon_aggr_type_p): Likewise. + (lang_expand_expr_stmt): Likewise. + (build_case_label): Likewise. + + * c-decl.c (lang_expand_expr_stmt): Initialize. + (stmts_are_full_exprs_p): Define. + (current_function_name_declared): Likewise. + (do_case): Likewise. + (lang_expand_stmt): Likewise. + (set_current_function_name_declared): Likewise. + (anon_aggr_type_p): Likewise. + + * c-semantics.c: New file. + (expand_cond): Moved from cp/semantics.c. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (make_rtl_for_local_static): Moved from cp/decl.c. + (emit_local_var): Likewise. + (expand_stmt): Define. + + * c-tree.h: (c_expand_asm_operands): Moved to c-common.h. + (c_expand_return): Likewise. + (c_expand_start_case): Likewise. + +2000-07-01 Richard Henderson + + * config/ia64/ia64.c (symbolic_operand): Reject CONST expressions + with the low 13 bits set. + (move_operand): Check for CONST|SYMBOL_REF|LABEL_REF directly. + * config/ia64/ia64.md (movdi): Likewise. Expand a CONST with one + of the low 13 bits into a CONST plus an adddi3. + (load_symptr): Set RTX_UNCHANGING_P. + +2000-06-30 Mark Mitchell + + * Makefile.in (c-common.o): Don't depend on c-tree.h or c-lex.h. + * c-common.c (ridpointers): Declare. + * c-common.h (enum rid): Declare. + (NORID): Likewise. + (ridpointers): Likewise. + * c-lex.c (ridpointers): Don't declare. + (init_lex): Initialize ridpointers. + * c-lex.h (enum rid): Don't declare. + (NORID): Likewise. + (RID_FIRST_MODIFIER): Likewise. + (ridpointers): Likewise. + +2000-06-30 J. David Anglin + + * pa/som.h (ASM_WEAKEN_LABEL): Export weak data symbols so that they + have global scope. + +2000-06-30 Martin von Loewis + + * invoke.texi (-Wreturn-type): In C++, a missing return type is + always an error. + +2000-06-30 Catherine Moore + + * c-common.c (decl_attributes): Differentiate between + types and type decls for alignment. + +2000-06-30 Nathan Sidwell + + * cpp.texi: Document #pragma GCC dependency + * cppfiles.c (open_include_file): Set date to unknown. + (_cpp_compare_file_date): New function. + (read_include_file): Set file date. + * cpphash.h (struct include_file): Add date member. + (_cpp_compare_file_date): Prototype. + * cpplib.c (parse_include): Add trail parameter. Adjust. + (do_include): Adjust parse_include call. + (do_import): Likewise. + (do_include_next): Likewise. + (gcc_pragmas): Add dependency pragma. + (do_pragma_dependency): New pragma. + +2000-06-29 Jason Merrill + + * dwarf2out.c (output_loc_operands): Don't abort on codes that have + no operands. + +2000-06-29 Jim Wilson + + * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS): Return NO_REGS for + a volatile mem and FR_REGS. + +2000-06-29 Mark Mitchell + + * c-common.c: Include c-common.h, not c-lex.h or c-tree.h. + * c-common.h (flag_const_strings): Declare. + (warn_format): Likewise. + (flag_traditional): Likewise. + (flag_isoc99): Likewise. + (warn_parentheses): Likewise. + (warn_conversion): Likewise. + (C_TYPE_OBJECT_P): Likewise. + (C_TYPE_INCOMPLETE_P): Likewise. + (C_TYPE_FUNCTION_P): Likewise. + (C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise. + (C_EXP_ORIGINAL_CODE): Likewise. + (build_unary_op): Likewise. + (build_binary_op): Likewise. + (lvalue_p): Likewise. + (default_conversion): Likewise. + (common_type): Likewise. + * c-tree.h (C_TYPE_OBJECT_P): Remove. + (C_TYPE_INCOMPLETE_P): Likewise. + (C_TYPE_FUNCTION_P): Likewise. + (C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise. + (C_EXP_ORIGINAL_CODE): Likewise. + (common_type): Likewise. + (default_conversion): Likewise. + (build_binary_op): Likewise. + (build_unary_op): Likewise. + (lvalue_p): Likewise. + (flag_const_strings): Likewise. + (warn_format): Likewise. + (warn_conversion): Likewise. + (flag_traditional): Likewise. + (flag_isoc99): Likewise. + (warn_parentheses): Likewise. + +2000-06-29 James E. Wilson + + * config/ia64/linux.h (LINK_SPEC): Change so.1 to so.2. + + * config/ia64/ia64.h (MODES_TIEABLE_P): Only tie if mode class is the + same. Only tie XFmode with XFmode. + +2000-06-29 Zack Weinberg + + * c-decl.c, timevar.c, tlink.c: Include intl.h. + * Makefile.in: Update deps. + +2000-06-29 Andrew Haley + + * toplev.c (main): On an IA-64, make flag_unwind_tables defauit + to true. + +2000-06-29 Andrew Haley + + * config/ia64/linux.h (JMP_BUF_SIZE): Size is in Pmode units, not + bytes: remove the multiply by 8. + +2000-06-29 Philipp Thomas + + * rtl.c : Revert NLS changes. + * gcc.c : Fix bug in display_help introced by my last changes. + +Wed Jun 28 21:09:33 2000 Raja R Harinath + + * dbxout.c (dbxout_symbol, case RESULT_DECL, VAR_DECL): Use + DECL_CONTEXT, not DECL_FIELD_CONTEXT. + +2000-06-29 Michael Hayes + + * flow.c (flow_depth_first_order_compute): Fix algorithm. + +2000-06-28 Philipp Thomas + + * c-decl.c : Mark strings for translation. + (parmlist_tags_warning): Use distinct messages instead + of conditional expressions. + * diagnostic.c (v_message_with_decl): Mark string for translation. + * gcc.c: Mark messages for translation. + (display_help): Combine messages into one string where necessary. + * mips-tfile: Add intl.h. Mark messages for translation. + * rtl.c (fatal_with_file_and_line): Modify function for NLS. Mark + messages for translation. + * timevar.c: Mark messages for translation. + * tlink.c: Likewise. + * toplev.c: Likewise. + +Wed Jun 28 15:39:26 2000 Donn Terry (donnte@microsoft.com) + + * i386-interix.h (STRIP_NAME_ENCODING): Declare _new_name properly. + + * alpha/alpha-interix.h: Delete redundant -Asystem(interix), + use -isystem instead of -idirafter. + * i386/i386-interix.h: Likewise. + +2000-06-28 Jason Merrill + + * dwarf2out.c (output_loc_operands): Don't support >1 byte output + unless DWARF2_DEBUGGING_INFO is defined. + (ASM_OUTPUT_DWARF_*): Wrap normal output defs with #ifndefs. + +2000-06-28 Richard Henderson + + * config/alpha/alpha.c (summarize_insn): Ignore SCRATCH. + +2000-06-28 Jakub Jelinek + + * cpplex.c (output_line_command): Output correct #line if a header + is including itself and is not protected against multiple inclusion. + +2000-06-28 Zack Weinberg + + * cppfiles.c (open_include_file): If open(2) returns EMFILE or + ENFILE, close all cached file descriptors and try again. + (_cpp_execute_include): Keep a count of the number of times + each header is included. + (close_cached_fd): New function. + * cpphash.h (struct include_file): Rename before to + include_count; all users updated. Make include_count and sysp + unsigned short. + * cppinit.c (cpp_finish): If -H, report headers that could use + reinclude guards. + (report_missing_guard): New function. + +Wed Jun 28 14:46:58 MET DST 2000 Jan Hubicka + + * i386.md (prologue_set_got): Set length_immediate field. + (testqi_ccno_1): Add missing '@' character. + +2000-06-27 Jason Merrill + + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Use + DWARF_FRAME_REGNUM. + +2000-06-27 Andrew Macleod + + * dwarf2out.c (ASM_OUTPUT_DWARF_DATA2): Provide default when no + unsigned macros available. + +2000-06-27 Richard Henderson + + * config/ia64/ia64.c (emit_insn_group_barriers): Special case + epilogue_deallocate_stack. + + * config/ia64/ia64.c (ia64_print_operand) [case D]: Emit + completers for UNORDERED and ORDERED as well. + * config/ia64/ia64.md (bunordered, bordered): New. + (sunordered, sordered): New. + +Tue Jun 27 12:14:12 MET DST 2000 Jan Hubicka + + * genattrtab.c (write_attr_value): Do not abort for CONST_INT operands. + * i386.c (ix86_attr_length_default): Kill. + (ix86_attr_length_immediate_default, ix86_attr_length_address_default): + New. + * i386-protos.h (ix86_attr_length_default): Kill + (ix86_attr_length_immediate_default, ix86_attr_length_address_default): + Add prototype + * i386.md (attribute type): Add "test". + (attribute length_prefix): Kill. + (attribute length_opcode): Kill. + (attribute i387, mode, length_immediate, length_address, prefix_data16, + prefix_rep, prefix_0f, modrm): New. + (attribute length): Compute using the new attributes. + (attribute pent_prefix): New. + (attribute pent_pair): Compute using pent_prefix. + (all insn patterns): Set mode,modrm and immediate_length attributes where + needed. + (cmpsi patterns): Compute sizes properly for test instruction. + (movsi, movhi patterns): Compute sizes properly for eax shortcuts. + (movstricthi_xor, movstrictqi_xor): New patterns. + (andsi/andhi): Use splitters to generate xor instructions. + (xorqi_ext_1): New pattern. + (movstricthi->movstricthi_xor peep2): New. + +Tue Jun 27 12:03:03 MET DST 2000 Jan Hubicka + + * i386.md (addqi_low_1): Remove. + +2000-06-27 Philipp Thomas + + * 1750a.h: Mark help strings for options/switches for translation. + * a29k.h: Likewise. + * alpha.h: Likewise. + * arm.h: Likewise. + * pe.h: Likewise. + * riscix.h: Likewise. + * c4x.h: Likewise. + * clipper.h: Likewise. + * convex.h: Likewise. + * elxsi.h: Likewise. + * fr30.h: Likewise. + * fx80.h: Likewise. + * h8300.h: Likewise. + * i370.h: Likewise. + * cygwin.h: Likewise. + * dgux.h: Likewise. + * djgpp.h: Likewise. + * i386.h: Likewise. + * osf1elf.h: Likewise. + * osfrose.h: Likewise. + * sco5.h: Likewise. + * win32.h: Likewise. + * i860.h: Likewise. + * paragon.h: Likewise. + * i960.h: Likewise. + * ia64.h: Likewise. + * m32r.h: Likewise. + * mcore.h: Likewise. + * mips.h: Likewise. + * mn10300.h: Likewise. + * ns32k.h: Likewise. + * pdp11.h: Likewise. + * pj.h: Likewise. + * aix.h: Likewise. + * aix41.h: Likewise. + * aix43.h: Likewise. + * beos.h: Likewise. + * rs6000.h: Likewise. + * sysv4.h: Likewise. + * linux.h: Likewise. + * linux64.h: Likewise. + * sp64-elf.h: Likewise. + * sparc.h: Likewise. + * splet.h: Likewise. + * v850.h: Likewise. + * convex.h (TARGET_SWITCHES): Provide descriptions and mark them + for translation. + * sp86x-aout.h: Remove bogus first definition of SUBTARGET_SWITCHES. + Properly document option and mark for translation. + * sp86x-elf.h: Likewise. + +2000-06-27 Bernd Schmidt + + Add MMX and SSE registers to i386 machine description. + * i386-protos.h (ix86_constant_alignment, ix86_data_alignment, + ix86_local_alignment): Declare. + + * i386.h (TARGET_MMX, TARGET_SSE): New. + (FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS, + REG_ALLOC_ORDER, HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, + REG_CLASS_NAMES, REG_CLASS_CONTENTS,REG_CLASS_FROM_LETTER, + enum reg_class, HI_REGISTER_NAMES): Added MMX/SSE registers. + (FIRST_SSE_REG, LAST_SSE_REG, SSE_REGNO_P): New. + (FIRST_MMX_REG, LAST_MMX_REG, MMX_REGNO_P, MMX_REG_P): New macros. + (RETURN_IN_MEMORY): Handle MMX/SSE. + (REG_PARM_STACK_SPACE): Added so the first three TImode parameters + also get stack space. + (MUST_PASS_IN_STACK): Added TImode to the default definition. + (CUMULATIVE_ARGS): Added sse_nregs, sse_regno and sse_words. + (MMX_REGISTER_NAMES): New. + (ALIGN_MODE_128): New macro. + (CONSTANT_ALIGNMENT): Code moved out-of-line; just call the function. + (DATA_ALIGNMENT): Likewise. + (LOCAL_ALIGNMENT): Likewise. + (CONDITIONAL_REGISTER_USAGE): Make MMX/SSE regs fixed if not + TARGET_MMX/TARGET_SSE. + (VALID_SSE_REG_MODE, VALID_MMX_REG_MODE): New macros. + (REG_CLASS_FROM_LETTER): 'y' for MMX regs. + (SECONDARY_MEMORY_NEEDED): Be conservative about copying between + SSE/MMX regs and something else. + (CLASS_MAX_NREGS): 1 for SSE and MMX regs. + (REGISTER_MOVE_COST): 10 if trying to move between MMX and SSE regs, + 3 if moving between MMX regs and something else. + + * i386.c (reg_class): Add SSE_REGS, MMX_REGS. + (regclass_map): Add MMX/SSE registers. + (print_operand): Add code to print XMMWORD as appropriate. + (ix86_split_movdi): Abort for MMX regs. + (init_cumulative_args): Also allow SSE_REGS + (function_arg_advance, function_arg): Likewise + (print_reg): Support 'm'. Add case for TImode. + (override_options): TARGET_SSE implies TARGET_MMX. + (ix86_constant_alignment, ix86_data_alignment, ix86_local_alignment): + New functions. + + * config/i386/unix.h (VALUE_REGNO): VECTOR_MODE values go to + FIRST_SSE_REG. + * config/i386/ptx4-i.h (RETURN_IN_MEMORY): Return MMX values in + memory. + * config/i386/sysv4.h (RETURN_IN_MEMORY): Likewise. + * config/i386/i386elf.h (RETURN_IN_MEMORY): Likewise. + +2000-06-26 Geoff Keating + + * ssa.c (struct rename_set_data): Change the name of field + 'set_dest' to 'old_reg'. Add comments. + (struct rename_context): Change the name of 'set_data' to + 'new_renames'. Add new field 'done_renames'. + (create_delayed_rename): New function. + (apply_delayed_renames): New function. + (rename_insn_1): Use the new functions. Handle CLOBBERS. Handle + SUBREGs and similar by emitting a move. + (new_registers_for_updates): Delete, functionality moved to + apply_delayed_renames. + (rename_block): Handle moves emitted by rename_insn_1 by putting + them into a SEQUENCE with the original insn. Add sanity checks + and comments. + (rename_equivalent_regs_in_insn): Don't handle SUBREGs specially. + (rename_equivalent_regs): Expand SEQUENCEs out to individual insns. + +2000-06-26 Andrew Macleod + Jason Merrill + + * dwarf2.h (enum dwarf_call_frame_info): Add + DW_CFA_def_cfa_expression. + * dwarf2out.c (union dw_cfi_oprnd_struct): Add a pointer to a + dw_loc_descr_struct entry. + (struct cfa_loc): New structure to track a CFA location. + (lookup_cfa): Take a cfa_loc parameter instead of a reg and an offset. + (lookup_cfa_1): Take a cfa_loc parameter instead of a reg and an + offset, plus handle DW_CFA_def_cfa_expression. + (def_cfa_1): Use to be dwarf2out_def_cfa, only now it uses a + cfa_loc record. + (dwarf2out_def_cfa): Entry point maintained for compatibility. + (dwarf_cfi_name): Add DW_CFA_def_cfa_expression. + (cfa_reg, cfa_offset): Replace with cfa_loc record 'cfa'. + (cfa_store_reg, cfa_store_offset): Replace with cfa_loc 'cfa_store'. + (initial_return_save, dwarf2out_stack_adjust): Use cfa.reg, not + cfa_reg. + (dwarf2out_frame_debug_expr): Use new cfa_loc records. Recognize rtl + sequences for the new DW_CFA_def_cfa_expression record. + (dwarf2out_frame_debug): Use new variables/fields.A + (output_cfi): Handle DW_CFA_def_cfa_expression. + (output_cfa_loc): New function to generate a CFI record for + DW_CFA_def_cfa_expression. + (get_cfa_from_loc_descr): New function to get a cfa_loc record from + a dw_loc_descr sequeunce. + (build_loc_descr): Build a dw_loc_descr from a cfa_loc record. + (dwarf_stack_op_name, new_loc_descr, add_loc_descr, size_of_loc_descr, + size_of_locs, output_loc_operands, output_loc_sequence): Move into + unwind info section. + * frame.h (frame_state): Add base_offset and indirect fields. + * frame-dwarf2.c (decode_stack_op): New function to interpret a + dw_loc_descr operation. + (execute_cfa_insn): Add support for DW_CFA_def_cfa_expression. + (struct frame_state): Add base offset and indirect fields. + * libgcc2.c (next_stack_level): Support indirect loading for CFA. + +2000-06-26 Joseph S. Myers + + * c-decl.c (grokdeclarator): Don't warn about `long long' in C99. + Make warnings about implicit int be pedwarns in C99. Don't warn + about duplicate type qualifiers in C99. + (start_function): Make warning about implict int return type be a + pedwarn in C99. + * c-lex.c (yylex): Don't warn about `long long' in C99. + * c-typeck.c (c_expand_return): In C99, always pedwarn about + `return' with no value in function returning non-void. + +2000-06-26 Richard Henderson + + * c-typeck.c (pedwarn_c99): New. + * diagnostic.c (verror, vwarning, vpedwarn): Export. + * toplev.h: Prototype them. + +2000-06-26 J. David Anglin + + * c-typeck.c (digest_init): Return error_mark_node node when + TREE_TYPE (init) == error_mark_node. + +2000-06-26 Philipp Thomas + + * aclocal.m4 (AM_WITH_NLS): Don't set MSGFMT or GMSGFMT to no, + test for msgfmt without path instead. + * configure: Rebuilt. + +2000-06-25 Theodore Papadopoulo + + * gengenrtl.c (special_rtx): Fix typo in comment. + +2000-06-26 Michael Hayes + + * mklibgcc.in (LIB2FUNCS): Add missing space. + +2000-06-24 Bernd Schmidt + + * tree.h (enum tree_index): Add vector type nodes. + Add accessor macros for them. + (TYPE_REPRESENATION_TYPE): New macro. + * tree.c (build_common_tree_nodes_2): Build these nodes. + (finish_vector_type): New function. + * c-common.c (type_for_mode): Handle vector modes. + * tm.texi (VECTOR_MODE_SUPPORTED_P): Document. + + * dbxout.c (dbxout_type): Handle VECTOR_TYPEs. + * dwarf.h (enum dwarf_fundamental_type): Add 128 bit integers. + * dwarf2out.c (lookup_type_die): Handle VECTOR_TYPEs. + (gen_type_die): Likewise. + * dwarfout.c (dwarf_fund_type_name): Handle 128 bit integers. + (fundamental_type_code): Likewise. + (type_is_fundamental): VECTOR_TYPEs aren't. + (output_type): Handle VECTOR_TYPEs. + +2000-06-25 Kazu Hirata + + * config/arm.c: Fix a comment typo. + * config/arm.h: Likewise. + +2000-06-25 Philipp Thomas + + * aclocal.m4 (AM_WITH_NLS): Set create_catalogs=no if no catalog + compiler found. + AM_GNU_GETTEXT: Don't set CATALOGS if create_catalogs=no. + * configure: Rebuilt. + +2000-06-25 John David Anglin + + * config/vax/vax.h (TARGET_SWITCHES): Provide descriptions. + +2000-06-25 Herman A.J. ten Brugge + + * mklibgcc.in: Prefer LIB1ASMFUNCS over LIB2FUNCS when generating + libgcc.a. + +2000-06-24 Marc Espie + + * collect2.c (resolve_lib_name): Move '/' check out of loop. + +2000-06-24 Dirk Duellmann + + * ginclude/stddef.h (NULL): define for non-gnu C++ parsers as 0. + +2000-06-24 Jakub Jelinek + + * stmt.c (expand_decl_cleanup): Emit a dummy insn after + last_unconditional_cleanup. + +2000-06-24 Bernd Schmidt + + * tree.def (VECTOR_TYPE): New node type. + * tree.h: Adjust some comments to reflect addition of vector types. + (TYPE_VECTOR_SUBPARTS): New macro. + * stor-layout.c (layout_type): Handle VECTOR_TYPE. + * c-convert.c (convert): Likewise. + * convert.c (convert_to_integer): Handle vector modes. + (convert_to_vector): New function. + * convert.h (convert_to_vector): Declare. + * expr.c (convert_move): Handle vector modes. + * expmed.c (extract_bit_field): Don't abort for vector modes. + +2000-06-24 Marek Michalkiewicz + + * config/avr/avr-protos.h (avr_hard_regno_mode_ok): New prototype. + * config/avr/avr.c (out_adj_frame_ptr, out_set_stack_ptr): + New functions, common code moved from function_{prologue,epilogue} + and extended to support the -mtiny-stack option. + (function_prologue, function_epilogue): Use them. + Use lo8/hi8 consistently for asm output readability. + (avr_hard_regno_mode_ok): New function. + * config/avr/avr.h (TARGET_SWITCHES): Fix typo. Add -mtiny-stack. + (UNITS_PER_WORD): Define as 4 (not 1) when compiling libgcc2.c. + (HARD_REGNO_MODE_OK): Call the avr_hard_regno_mode_ok function. + * config/avr/avr.md (*mov_sp_r): Add support for -mtiny-stack. + Write SPH before SPL. + (*movqi): No need to disable interrupts for just one "out" + in alternative 5. Change length attribute from 4 to 1. + * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__): + Write SPH before SPL. + +2000-06-24 Bernd Schmidt + + * rtl.texi (Vector Operations): New node. + (Arithmetic): Add ss_plus, us_plus, ss_minus, us_minus. + (Conversions): Add ss_truncate, us_truncate. + * rtl.def (VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_REORDER, + VEC_CONST, VEC_DUPLICATE, SS_PLUS, SS_MINUS, SS_TRUNCATE, + US_TRUNCATE): New rtx codes. + * machmode.def: Add vector modes. + * machmode.h (enum mode_class): Add MODE_VECTOR_INT and + MODE_VECTOR_FLOAT. + (INTEGER_MODE_P): Check for MODE_VECTOR_INT. + (FLOAT_MODE_P): Check for MODE_VECTOR_FLOAT. + (VECTOR_MODE_P): New. + +2000-06-24 Nathan Sidwell + + * cpp.texi: Clarify #pragma GCC namespace. + +2000-06-24 Philipp Thomas + + * aclocal.m4(AM_GNU_GETTEXT): If LINGUAS isn't set, build + all catalogs specified in ALL_LINGUAS. + * configure: Rebuilt. + +2000-06-23 Jakub Jelinek + + * config/sparc/sparc.md (reload_outdi+1): Handle + HOST_BITS_PER_WIDE_INT == 64 case correctly. + (adddi3_insn_sp32+1, adddi3_insn_sp32+2, andsi3+2): Likewise. + +2000-06-23 Geoffrey Keating + + * alias.c (fixed_scalar_and_varying_struct_p): Don't examine + struct vs. scalar-ness when -fno-strict-aliasing. + +2000-06-23 Nathan Sidwell + + * cpplib.c (struct pragma_entry): New structure. + (pragma_dispatch): Pragma dispatcher. + (top_pragmas, gcc_pragmas): New static variables. + (do_pragma): Use pragma_dispatch. + (do_pragma_gcc): New pragma handler. + * cpp.texi: Update. + +2000-06-23 Jakub Jelinek + + * calls.c (compute_argument_addresses): Force stack slots into + alias set 0. + * expr.c (emit_push_insn): Force pushes into alias set 0. + +2000-06-23 Richard Henderson + + * config/ia64/ia64.md (pred_rel_mutex): Only take one register. + * config/ia64/ia64.c (emit_predicate_relation_info): Adjust to match. + +2000-06-22 Jason Merrill + + * toplev.c (compile_file): Always call timevar_print. + * Makefile.in (calls.o): Depend on TIMEVAR_H. + +2000-06-22 Nathan Sidwell + + * varasm.c (constant_descriptor): Make contents unsigned char. + (mark_const_hash_entry): Adjust. + (const_hash): Just hash the code of unknown nodes. + (compare_constant_1): Adjust for unsigned char. + Use language specific expander on unknown nodes. + (record_constant_1): Likewise. + +2000-06-21 Zack Weinberg + + * cppfiles.c (cpp_make_system_header): New function. + * cpplib.h: Prototype it. + * cpplib.c (do_line, do_pragma_system_header): Use it. + * fix-header.c (read_scan_file): Use it. + + * fix-header.c (check_macro_names): Cast second arg of + cpp_defined to const unsigned char *. + (read_scan_file): Make getchar_call const unsigned char. + +2000-06-21 Zack Weinberg + + * cppfiles.c: Include splay-tree.h, not hashtab.h. + (redundant_include_p, make_IHASH, hash_IHASH, eq_IHASH): Delete. + (destroy_include_file_node): New. + (_cpp_init_include_hash): Rename _cpp_init_include_table. + Create a splay tree, not a hash table. + (open_include_file): Look up the path in the include table, + do the multiple include optimization here, etc. + (cpp_included): Walk the path. + (find_include_file): Just walk the path calling + open_include_file, or call it directly for an absolute path. + (_cpp_fake_ihash): Rename _cpp_fake_include and update for new + scheme. + (read_include_file): Update for new scheme. Don't close the + file unless reading fails. + (_cpp_execute_include, cpp_read_file): Tweak for new scheme. + + * cpphash.h (struct ihash, NEVER_REINCLUDE): Delete. + (struct include_file): New. + (NEVER_REREAD, DO_NOT_REREAD, CPP_IN_SYSTEM_HEADER): New + macros. + (CPP_PEDANTIC, CPP_WTRADITIONAL): Update. + Update prototypes. + + * cppinit.c: Include splay-tree.h. + (cpp_reader_init, cpp_cleanup): Update. + + * cpplib.h (struct cpp_buffer): Change ihash field to + 'struct include_file *inc'. Remove system_header_p. + (struct cpp_reader): Change all_include_files to a + struct splay_tree_s *. + + * cpplex.c: Update all references to cpp_buffer->ihash and/or + cpp_buffer->system_header_p. + (cpp_pop_buffer): Close file here, only if DO_NOT_REREAD. + + * Makefile.in (SPLAY_TREE_H): New macro. + (cppfiles.o, cppinit.o): Update dependencies. + +Wed Jun 21 11:05:48 2000 Martin Buchholz + + * invoke.texi (g++): "g++" is not a script anymore. + +2000-06-20 J. David Anglin + + * function.c (round_down): Delete obsolete prototype. + + * pa.h (CPP_SPEC): Add whitespace after -D__STDC_EXT__. + +2000-06-20 Zack Weinberg + + * configure.in: Use 'test a = b' not 'test a == b'. + * configure: Regen. + + * Makefile.in (fix-header): Link with $(LIBS) not $(HOST_LIBS). + + * Makefile.in: Remove all references to HOST_INTLLIBS. + + * cpplex.c (parse_name): Don't warn about $ in identifiers if + skipping. + +2000-06-20 Philipp Thomas + + * config/pa/pa.h(TARGET_SWITCHES): Require binutils 2.10 or later + for PA 2.0. + +Mon Jun 19 23:26:40 2000 J"orn Rennecke + + * Take REG_INC notes into account. + +2000-06-19 Zack Weinberg + + * c-parse.in (undeclared_variable_notice): Moved to c-typeck.c. + (primary: IDENTIFIER): Just call build_external_ref. + * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: + Regenerate. + * c-lex.c (lastiddecl): Remove. + (yylex): Replace all instances of lastiddecl with local + variables. + + * c-typeck.c (build_external_ref): New function. Treat decls + with C_DECL_ANTICIPATED mostly the same as nonexistent decls. + Look up the decl from the id here. Call lookup_objc_ivar. + * c-lang.c (lookup_objc_ivar): Stub. + * objc/objc-act.c (lookup_objc_ivar): New function. + + * c-tree.h: Prototype lookup_objc_ivar and build_external_ref. + * c-lex.h: Don't declare lastiddecl. + +2000-06-19 Benjamin Chelf + + * c-common.h (IF_COND): Added documentation. + (THEN_CLAUSE): Likewise. + (ELSE_CLAUSE): Likewise. + (WHILE_COND): Likewise. + (WHILE_BODY): Likewise. + (DO_COND): Likewise. + (DO_BODY): Likewise. + (RETURN_EXPR): Likewise. + (EXPR_STMT_EXPR): Likewise. + (FOR_INIT_STMT): Likewise. + (FOR_COND): Likewise. + (FOR_EXPR): Likewise. + (FOR_BODY): Likewise. + (SWITCH_COND): Likewise. + (SWITCH_BODY): Likewise. + (CASE_LOW): Likewise. + (CASE_HIGH): Likewise. + (GOTO_DESTINATION): Likewise. + (COMPOUND_BODY): Likewise. + (ASM_CV_QUAL): Likewise. + (ASM_STRING): Likewise. + (ASM_OUTPUTS): Likewise. + (ASM_INPUTS): Likewise. + (ASM_CLOBBERS): Likewise. + (DECL_STMT_DECL): Likewise. + (STMT_EXPR_STMT): Likewise. + (LABEL_STMT_LABEL): Likewise. + + * c-common.def: Added documenetion for SRCLOC, EXPR_STMT, + COMPOUND_STMT, DECL_STMT, IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT, + RETURN_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, + LABEL_STMT, ASM_STMT, SCOPE_STMT, CASE_LABEL, STMT_EXPR. + +2000-06-19 Kaveh R. Ghazi + + * configure.in (--enable-checking): Update --help doc to reflect + new defaults. Ensure $ac_save_IFS is set before $IFS is changed. + +Sun Jun 18 21:42:15 2000 Richard Kenner + + * gcse.c (insert_insn_end_bb): Always put after NOTE_INSN_BASIC_BLOCK. + + * function.c (put_var_into_stack): Don't reference DECL_ fields + if input is a SAVE_EXPR. + Use set_mem_attributes in COMPLEX case. + +2000-06-18 Richard Henderson + + * config/ia64/ia64-protos.h (process_for_unwind_directive): Declare. + (ia64_file_start): Declare. + * config/ia64/ia64.h (ADDL_REGNO_P): Don't compare unsigned against 0. + (GR_REGNO_P): Likewise. + * config/ia64/ia64.c: Many prototypes. + (ia64_reg_numbers): Constify. + (ia64_input_reg_names, ia64_local_reg_names): Likewise. + (ia64_section_threshold): Make unsigned. + (ia64_print_operand): Constify. + (fix_range): Constify. + (ia64_init_builtins): Don't compare signed vs unsigned. + (ia64_expand_builtin): Likewise. + + * config/ia64/ia64.h (EXTRA_CONSTRAINT): New. + (CONSTRAINT_OK_FOR_Q): New. + * config/ia64/ia64.md (movdi_internal): Use Q for fp<->mem. + (movsf_internal, movdf_internal): Likewise. + (cmovdi_internal): Rewrite so that constraints and predicates match; + simplify splitters. + (cmovsi_internal): Likewise. + + * config/ia64/ia64.h (ASM_SPEC): Add -x for gas. + (ASM_FILE_START): New. + * config/ia64/ia64.c (ia64_file_start): New. + (rtx_needs_barrier): Handle pred.rel.mutex. + (emit_predicate_relation_info): New. + * config/ia64/ia64.md (pred_rel_mutex): New. + * config/ia64/linux.h (ASM_SPEC): Define. + * config/ia64/sysv4.h (ASM_FILE_START): Define. + + * config/ia64/ia64.c (ia64_encode_section_info): Fix thinko + filtering global register variables. + +2000-06-18 Kaveh R. Ghazi + + * c-common.c (add_c_tree_codes): Fix definition for traditional C. + +2000-06-17 Michael Meissner + + * gcc.c (do_spec_1, '%v3' case): Do not abort if patch level is + not present and there is a field after a '-'. + +2000-06-17 Bruce Korb + + * fixinc/check.tpl: finish the implementation of multiple tests + for a single fix + * fixinc/inclhack.def(ctrl_quotes_def): add a second test + (io_quotes_def): add a second test + (various): reorder `files' so that "limits.h" is never first + * fixinc/tests/base/*: update the testing output + +Sat Jun 17 10:33:59 2000 Richard Kenner + + * gcc.texi: Remove reference to stupid.c. + +2000-06-16 Benjamin Chelf + + * c-common.c (c_tree_code_type): New array. + (c_tree_code_length): Likewise. + (c_tree_code_name): Likewise. + (add_c_tree_codes): New function. + + * c-common.h (add_c_tree_codes): Declare. + (enum c_tree_code): New enum. + + * c-lex.c (init_parse): Added call to add_c_tree_codes. + +2000-06-16 Kaveh R. Ghazi + + * fixinc/inclhack.def (ctrl_quotes_def, io_quotes_def): Modify + select pattern to also match macro defs with only one argument. + +Thu Jun 15 18:56:12 2000 Jeffrey A Law (law@cygnus.com) + + * i386.md: Create new [right,left] rotate and right shift + patterns to optimize shift by 1 bit for certain ia32 processors. + Update patterns which perform left shifts to optimize shift by + 1 bit for certain ia32 processors. + * i386.c (const_int_1_operand): New predicate. + * i386.h (PREDICATE_CODES): Handle const_int_1_operand. + * i386-protos.h (const_int_1_operand): Prototype. + +Wed Jun 14 23:46:26 2000 J"orn Rennecke + + * mips.c (machine_dependent_reorg): Fix braces for nested if. + +2000-06-14 Geoff Keating + + * rs6000.c (toc_hash_eq): Use CODE_LABEL_NUMBER to compare + LABEL_REFs. + +2000-06-14 Richard Henderson + + * conflict.c (conflict_graph_compute): Don't look for REG_INC. + + * config/ia64/ia64.c (ia64_setup_incoming_varargs): Don't emit + auto-inc code. + + * print-rtl.c (print_rtx): Emit space before mem alias set. + +2000-06-14 David Edelsohn + + * rs6000.c (expand_block_move): Fix typo in earlier change. + (print_operand): Remove unused variables neg and op. + (toc_hash_mark_entry): Fix prototype. + +2000-06-14 Benjamin Chelf + + * c-common.h (IF_COND): Moved here from cp/cp-tree.h. + (THEN_CLAUSE): Likewise. + (ELSE_CLAUSE): Likewise. + (WHILE_COND): Likewise. + (WHILE_BODY): Likewise. + (DO_COND): Likewise. + (DO_BODY): Likewise. + (RETURN_EXPR): Likewise. + (EXPR_STMT_EXPR): Likewise. + (FOR_INIT_STMT): Likewise. + (FOR_COND): Likewise. + (FOR_EXPR): Likewise. + (FOR_BODY): Likewise. + (SWITCH_COND): Likewise. + (SWITCH_BODY): Likewise. + (CASE_LOW): Likewise. + (CASE_HIGH): Likewise. + (GOTO_DESTINATION): Likewise. + (COMPOUND_BODY): Likewise. + (ASM_CV_QUAL): Likewise. + (ASM_STRING): Likewise. + (ASM_OUTPUTS): Likewise. + (ASM_INPUTS): Likewise. + (ASM_CLOBBERS): Likewise. + (DECL_STMT_DECL): Likewise. + (STMT_EXPR_STMT): Likewise. + (LABEL_STMT_LABEL): Likewise. + (SCOPE_BEGIN_P): Likewise. + (SCOPE_END_P): Likewise. + (SCOPE_STMT_BLOCK): Likewise. + (SCOPE_NULLIFIED_P): Likewise. + (SCOPE_NO_CLEANUPS_P): Likewise. + (SCOPE_PARTIAL_P): Likewise. + (ASM_VOLATILE_P): Likewise. + (STMT_LINENO): Likewise. + (STMT_LINENO_FOR_FN_P): Likewise. + + * c-common.def: New file. Added SRCLOC, SIZEOF_EXPR, ARROW_EXPR, + ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, + FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, + SCOPE_STMT, CASE_LABEL, STMT_EXPR. + + * gencheck.c (tree_codes[]): Added '#include "c-common.def"'. + +2000-06-14 David O'Brien + + * gcc.c (main): Quiet compiler warnings. argv is assumed to be + writable in parts of the GCC code. + + * config/elfos.h (ASM_GENERATE_INTERNAL_LABEL): Make printf + specification match cast. + +Wed Jun 14 09:25:57 2000 Jeffrey A Law (law@cygnus.com) + + * configure.in: Revert AC_TYPE_GETGROUPS patch from June 13. + * configure, config.in: Rebuilt. + * sys-protos.h: Similarly. + +Wed Jun 14 03:39:58 EDT 2000 John Wehle (john@feith.com) + + * ifcvt.c (EDGE_COMPLEX): Move definition ... + * basic-block.h (EDGE_COMPLEX): ... here. + + * loop.c (check_dbra_loop): Specify the register when + generating REG_NONNEG notes and don't generate duplicates. + +2000-06-13 Jakub Jelinek + + * tree.h (TYPE_USER_ALIGN, DECL_USER_ALIGN): Define. + (struct tree_type, struct tree_decl): Add user_align member. + * stor-layout.c (layout_decl): Set DECL_USER_ALIGN. + (place_union_field): If BIGGEST_FIELD_ALIGNMENT is defined + and DECL_USER_ALIGN 0, cap alignment to this value. + (place_field): Likewise. + (finalize_type_size): Set TYPE_USER_ALIGN. + (layout_type): Likewise. + (initialize_sizetypes): Likewise. + * c-common.c (decl_attributes): Set TYPE_USER_ALIGN resp. + DECL_USER_ALIGN to 1. + * c-decl.c (duplicate_decls): Set DECL_USER_ALIGN. + (xfer_tag): Set TYPE_USER_ALIGN. + (finish_struct): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. + (finish_enum): Likewise. + * stmt.c (expand_decl): Set DECL_USER_ALIGN. + (expand_anon_union_decl): Likewise. + * tree.c (make_node): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. + (build_index_type): Set TYPE_USER_ALIGN. + (build_range_type): Likewise. + (build_common_tree_nodes_2): Likewise. + * tm.texi (BIGGEST_FIELD_ALIGNMENT): Document the changed meaning. + +2000-06-13 Andreas Jaeger + + * configure.in: Use --enable-checking=misc,tree,gc by default if + no --enable-checking option is given and for + --enable-checking=yes. + * configure: Rebuilt. + +2000-06-13 Richard Henderson + + * libgcc2.c (ia64_throw_helper): Use __builtin_return_address. + (__throw): Don't pass the address of a label. + + * config/ia64/ia64.c (ia64_compute_frame_size): Use + current_function_is_leaf. + (ia64_expand_prologue): Likewise. Modify return_address_pointer_rtx + instead of reg_names[RETURN_ADDRESS_REGNUM]. + (ia64_init_machine_status): Reset return_address_pointer_rtx. + * config/ia64/ia64.h (RETURN_ADDRESS_POINTER_REGNUM): Rename + from RETURN_ADDRESS_REGNUM. Update all uses. + (RETURN_ADDR_RTX): Use return_address_pointer_rtx; return + zero instead of null on failure. + (ELIMINABLE_REGS): Add ra->b0 elimination. + (CAN_ELIMINATE): Update accordingly. + (INITIAL_ELIMINATION_OFFSET): Likewise. + (REGISTER_NAMES): Use an illegal assembler name for + RETURN_ADDRESS_POINTER_REGNUM. + +2000-06-13 Richard Henderson + + * config/ia64/ia64.h (enum reg_class): Remove FR_INT_REGS, FR_FP_REGS, + GR_AND_FR_INT_REGS, GR_AND_FR_FP_REGS. + (REG_CLASS_NAMES): Likewise. + (REG_CLASS_CONTENTS): Likewise. + (FR_FP_REGNO_P, FR_INT_REGNO_P): Remove. + (HARD_REGNO_MODE_OK): Remove references to them. + (REGNO_REG_CLASS): Likewise. + (REG_CLASS_FROM_LETTER): Likewise. + (CLASS_MAX_NREGS): Likewise. + (REGISTER_MOVE_COST): Likewise. + * config/ia64/ia64.c (ia64_secondary_reload_class): Likewise. + * config/ia64/ia64.md (*): Replace "e" constraints with "f". + (movqi_internal): Special case moves from zero. + (movhi_internal, movsi_internal): Likewise. + (movdi_internal): Likewise. Fill out "f" constraints. + (movsf_internal): Fill out "r" constraints. + (movdf_internal): Likewise. + +2000-06-13 Richard Henderson + + * flow.c (insn_dead_p): Keep sets to PIC_OFFSET_TABLE_REGNUM + alive before reload. + + * haifa-sched.c (struct deps): Add in_post_call_group_p. + (add_dependence): Handle notes between SCHED_GROUP_P insns. + (remove_dependence): Always define. + (set_sched_group_p): New. + (sched_analyze_2): Use it. + (sched_analyze_insn): Don't special-case naked uses. Look for + and extend in_post_call_group_p. + (sched_analyze): Clear stale SCHED_GROUP_P. Set in_post_call_group_p. + (init_deps): Clear in_post_call_group_p. + +2000-06-13 Richard Henderson + + * combine.c (subst): Use CLASS_CANNOT_CHANGE_MODE and + CLASS_CANNOT_CHANGE_MODE_P instead of CLASS_CANNOT_CHANGE_SIZE + and hard-coded tests. + (simplify_set): Likewise. + (gen_lowpart_for_combine): Likewise. + * emit-rtl.c (gen_lowpart_common): Likewise. + * global.c (find_reg): Likewise. + * local-alloc.c (find_free_reg): Likewise. + * recog.c (register_operand): Likewise. + * regclass.c (init_reg_sets_1): Likewise. + (record_operand_costs, regclass): Likewise. + * reload.c (push_reload): Likewise. + * reload1.c (choose_reload_regs): Likewise. + * flow.c (mark_used_regs): Conditionally set REG_CHANGES_MODE. + * local-alloc.c (struct qty): Rename changes_size to changes_mode. + Update all references. + * regs.h (struct reg_info_def): Likewise. + (REG_CHANGES_MODE): Rename from REG_CHANGES_SIZE. + * tm.texi (CLASS_CANNOT_CHANGE_MODE): Document. + (CLASS_CANNOT_CHANGE_MODE_P): Likewise. + + * config/alpha/alpha.h (CLASS_CANNOT_CHANGE_MODE): Rename. + (CLASS_CANNOT_CHANGE_MODE_P): New. + * config/mips/mips.h: Likewise. + * config/pa/pa32-regs.h: Likewise. + * config/pa/pa64-regs.h: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/sh/sh.h: Likewise. + * config/ia64/ia64.h (CLASS_CANNOT_CHANGE_MODE): New. + (CLASS_CANNOT_CHANGE_MODE_P): New. + * config/avr/avr.h (CLASS_CANNOT_CHANGE_SIZE): Remove dead code. + * config/d30v/d30v.h: Likewise. + +2000-06-13 J. David Anglin + + * configure.in: Add AC_TYPE_GETGROUPS test. + * sys-protos.h: Use GETGROUPS_T * for second arg of getgroups. + * configure: Rebuilt. + * config.in: Rebuilt. + +2000-06-13 Richard Henderson + + * explow.c (set_mem_attributes): Do nothing for NULL type. + +Tue Jun 13 14:45:10 2000 Jeffrey A Law (law@cygnus.com) + + * config/m68k/openbsd.h (ASM_SPEC): pass down options to assembler + correctly. + +2000-06-13 James E. Wilson + + * config/ia64/ia64.md (movxf_internal): Add missing "e" to ldf/stf. + +Tue Jun 13 14:05:35 2000 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (gensupport.o): Remove bogus $(HOST_PREFIX) reference. + +2000-06-13 Philipp Thomas + + * configure.in(ALL_LINGUAS): Changed en_UK to en_GB. + * configure: Rebuilt. + +2000-06-07 David O'Brien + + * configure.in: Adjust FreeBSD bits to match changes to config.guess. + We now default to ELF for the i386, and a.out is the special case. + * configure: Rebuilt. + +Tue Jun 13 10:05:30 2000 Hans-Peter Nilsson + + * final.c (final_scan_insn): Delete notes between cc0 setter and + user when restarting from setter. + +2000-06-13 J. David Anglin + + * vax.h (INDEX_TERM_P): Define evaluation order of &&'s in || and + cast to squelch signed/unsigned warnings. + +2000-06-13 Zack Weinberg + + * cpplib.c (handle_directive): Print non-NUL-terminated string + with %.*s. + +2000-06-12 Michael Meissner + + * ifcvt.c (dead_or_predicable): Don't do conditional execution + path if the machine needs extra support to do conditional + execution. + +Mon Jun 12 17:04:17 2000 Jeffrey A Law (law@cygnus.com) + + * print-rtl.c (print_rtx, case MEM): Use HOST_WIDE_INT_PRINT_DEC + to print the alias set. + * print-tree.c (print_node, DECL_* nodes and case 't'): Similarly. + +2000-06-12 J. David Anglin + + * config/float-vax.h: Add GFLOAT defines. + +Mon Jun 12 9:44:00 2000 Mark Klein + + * configure.in: Update tm dependencies for MPE. + * configure: Rebuilt. + +2000-06-12 H.J. Lu + + * gengenrtl.c (obstack_alloc_rtx): Correct the allocated size. + +2000-06-12 David Edelsohn + + * aix41.h (SUBTARGET_SWITCHES): Delete threads. + (CPP_SPEC): Change mthreads to pthread. + (LIB_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + * aix43.h (SUBTARGET_SWITCHES): Delete threads. + (CPP_SPEC): Change mthreads to pthread. + (LIB_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + * rs6000-protos.h (reg_or_arith_cint_operand): New. + * rs6000.c (reg_or_arith_cint_operand): New. + (num_insns_constant_wide): Decorate unsigned constant. + * rs6000.h (PREDICATE_CODES): Add reg_or_arith_cint_operand. + * rs6000.md (addsi3): Use new predicate. + (subsi3, adddi3, subdi3): Likewise. + +2000-06-12 Mark Mitchell + + * c-common.c (lang_get_alias_set): Fix typo. + +2000-06-12 Richard Earnshaw + + * flow.c (mark_used_regs): Revert last change. + (life_analysis): Remove PROP_AUTOINC if running after reload. + (propagate_one_insn): PROP_AUTOINC is always off after reload. + +2000-06-11 Richard Earnshaw + + * flow.c (mark_used_regs): Don't call find_auto_inc after reload + has run. + +2000-06-11 Kaveh R. Ghazi + + * bb-reorder.c (build_scope_forest): Initialize variable + `curr_scope'. + + * calls.c (expand_call): Likewise for variables + `save_pending_stack_adjust' and `save_stack_pointer_delta'. + + * i386.c (function_arg_advance, function_arg): Cast to avoid + signed/unsigned warnings. + + * i386.h (MEMORY_MOVE_COST): Likewise. + + * ifcvt.c (cond_exec_process_if_block): Initialize variables + `else_start' and `else_end'. + + * libgcc2.h (__eh_alloc, __eh_free): Prototype. + + * regrename.c (rr_replace_reg): Initialize variable `dest_subregno'. + +2000-06-10 Mark Mitchell + + * Makefile.in (libintl.a): Depend on intl.all. + +2000-06-09 H.J. Lu (hjl@gnu.org) + + * Makefile.in (c-parse.o): Also depend on output.h. + +2000-06-09 Rodney Brown + + * mcore-protos.h: discards const warning removal. + * mcore.c: discards const warning removal. + +2000-06-09 Kazu Hirata + + * config/h8300/lib1funcs.asm: Declare the machine architecture at + the beginning of the file. + +2000-06-09 J. David Anglin + + * real.h: Add prototype for ldexp. + +2000-06-09 Zack Weinberg + + * ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename + it ggc_alloc, drop second argument, never clear returned memory. + * ggc-common.c (ggc_alloc_string): Use ggc_alloc. + (ggc_alloc_cleared): New. + * ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not + ggc_alloc_obj. Remove ggc_alloc macro. + (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc. + + * rtl.c (rtvec_alloc): Clear the vector always. + (rtx_alloc): Clear the first word always. Remove dirty + obstack tricks (this routine is no longer a bottleneck). + * tree.c (make_node): Clear the new node always. + (make_tree_vec): Likewise. + (tree_cons): Clear the common structure always. + (build1): Likewise; also, clear TREE_COMPLEXITY. + * gengenrtl.c: Use puts wherever possible. Remove extra + newlines. + (gendef): Clear the first word of an RTX in the generator + function, irrespective of ggc_p. Initialize '0' slots to + NULL. + (genlegend): Don't generate obstack_alloc_rtx routine, just a + thin wrapper macro around obstack_alloc. + + * stmt.c (expand_fixup): Use ggc_alloc. + * c-typeck.c (add_pending_init): Use ggc_alloc. + * emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem). + * varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to + const0_rtx when it is created. + (immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if + we are not in a function. + + * tree.c (tree_class_check_failed): Make second arg an int. + * tree.h: Update prototype. + +2000-06-09 Geoff Keating + + * tree.h (VOID_TYPE_P): Don't look at the TYPE_MAIN_VARIANT + of an error_mark_node. + +Fri Jun 9 20:35:13 2000 Denis Chertykov + + * config/avr/avr.c (asm_output_section_name): bugfix. + +2000-06-09 Jason Merrill + + * timevar.def: Add TV_EXPAND. + * timevar.c (timevar_print): Update timing information. + * calls.c (try_to_integrate): Push to TV_INTEGRATION for inlining. + + * stmt.c (expand_return): Check for error_mark_node. + +2000-06-09 Kaveh R. Ghazi + + * configure.in: Also avoid wrapping auto-build.h with IN_GCC. + + * scan-types.sh (VALUE) Wrap use with double quotes to protect + variable against filename expansion when it contains "char *". + + * system.h (SSIZE_MAX): Delete backup definition. + + * cppfiles.c (read_include_file): Use INTTYPE_MAXIMUM(ssize_t) + instead of SSIZE_MAX. + +2000-06-09 Jakub Jelinek + + * configure.in: Check whether gas supports -relax. + * configure, config.in: Rebuilt. + * config/sparc/sparc.h (ASM_RELAX_SPEC): Define. + (EXTRA_SPECS): Add asm_relax. + (ASM_SPEC): Add %(asm_relax). + (TARGET_SWITCHES): Add -mrelax and -mno-relax. + * config/sparc/linux64.h (LINK_ARCH_SPEC): Rename to LINK_SPEC. + (LINK_SPEC): Pass -relax to linker unless -mno-relax or -r. + (ASM_SPEC): Add %(asm_relax). + * config/sparc/linux.h (LINK_SPEC, ASM_SPEC): Likewise. + * config/sparc/sparc.c (output_sibcall): If HAVE_AS_RELAX_OPTION, + never use sethi/jmpl for leaf tail calls. Use or with rs2 %g0 + instead of mov, so that gas can further optimize it. + +2000-06-08 James E. Wilson + + * dwarf2out.c (size_of_die, case dw_val_class_const): Use + size_of_sleb128. + (value_format, case dw_val_class_const): Use sdata format. + (output_die): Call output_sleb128. + +2000-06-08 James E. Wilson + + * dwarf2out.c (ASM_OUTPUT_DWARF_DATA8): Add new macro that uses + UNALIGNED_DOUBLE_INT_ASM_OP. Rename old macro to + ASM_OUTPUT_DWARF_CONST_DOUBLE. + (output_die, case dw_val_class_unsigned_const): Correct call to + ASM_OUTPUT_DWARF_DATA8. + (output_die, case dw_val_class_long_long): Use + ASM_OUTPUT_DWARF_CONST_DOUBLE. + * tree.c (host_integerp): Accept unsigned HOST_WIDE_INT values when + pos is zero. + + * config/ia64/ia64-protos.h (ia64_output_end_prologue): Add. + (output_function_prologue): Fix mispelling. + (output_function_prologue, output_function_epilogue): Reorder to + match ia64.c definition order. + * config/ia64/ia64.c (ia64_expand_prologue): Add comment. + (ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on stack restore insns. + Use r3 instead of r2 for large stack restores. + (ia64_output_end_prologue): New function. + (process_set): Emit ".restore sp" for epilogue stack restores. + * config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Define. + +2000-06-08 Jakub Jelinek + + * dbxout.c (dbxout_type_fields): Don't segfault on fields with + incomplete types. + +2000-06-08 Nathan Sidwell + + * frame.c (end_fde_sort): Remove extraneous erratic array test. + +2000-06-08 Denis Perchine + + * frame.c (start_fde_sort): Don't malloc (0). + +2000-06-07 Zack Weinberg + + * c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on + error_mark_node. + * print-tree.c (print_node): The transparent_union_flag means + different things for unions and arrays. Do not inspect it + with TYPE_TRANSPARENT_UNION. + +2000-06-06 Jakub Jelinek + + * cpplib.c (do_ifdef, do_ifndef): Don't segfault if parse_ifdef + returned NULL. + +Wed Jun 7 20:34:33 2000 Denis Chertykov + + * config/avr/avr.c (asm_output_section_name): output section + attributes. + * config/avr/libgcc.S (.text.libgcc): declare section attributes. + +2000-06-06 James E. Wilson + + * frame.h (struct unwind_info_ptr): Collapse version, flags, and length + fields into header field. + (IA64_UNW_HDR_LENGTH, IA64_UNW_HDR_FLAGS, IA64_UNW_HDR_VERSION): New + macros to access length, flags, and version info from header field. + * config/ia64/crtbegin.asm (__do_frame_setup_aux): Delete here. + * config/ia64/crtend.asm (__do_frame_setup_aux): Add here. + (__do_global_ctors_aux): Fix caller. + * config/ia64/frame-ia64.c (get_unwind_record): Change parameter + prologue_flag to header. Pass to read_P_record. + (read_P_record): New argument header. Implement P4 format. + Multiply P7_T_SIZE by 16. + (execute_one_ia64_descriptor): New static local region_header. Pass to + get_unwind_record. Copy r to region_header if r is a header record. + (print_all_records): Likewise. + (__build_ia64_frame_state): Use IA64_UNW_HDR_LENGTH. + (__get_personality, __get_except_table): Likewise. + * config/ia64/ia64.c (process_set): Do not divide offsets by 4. + +2000-06-06 Philipp Thomas + + * configure.in (AC_C_INLINE): Added. + * aclocal.m4 (AM_WITH_NLS): Enable --with-included-gettext by default. + * configure: Regenerate. + +2000-06-06 Mark Mitchell + + * c-common.h (c_language_kind): New type. + (c_language): New variab.e + * c-common.c (lang_get_alias_set): Don't put structures in + nonzero alias sets in C++. + * c-decl.c (c_language): Define it. + * c-lex.c (doing_objc_thang): Remove. + * c-tree.h (doing_objc_thang): Make it a macro. + * objc/objc-act.c (lang_decode_option): Set c_language, not + doing_objc_thang. + +2000-06-06 Gabriel Dos Reis + + * diagnostic.c (output_maximum_width): Remove. + (doing_line_wrapping): Tweak. + (diagnostic_buffer): New object. + (global_output_buffer): New object. + (output_destroy_prefix): New function. + (default_initialize_buffer): Likewise. + (reshape_diagnostic_buffer): Likewise. + (initialize_diagnostics): Likewise. + (output_clear): Tweak. + (line_wrapper_printf): Adjust call to init_output_buffer. + (vline_wrapper_message_with_location): Likewise. Use + output_destroy_prefix. + (v_message_with_decl): Likewise. + + * diagnostic.h (struct output_buffer): Constify prefix. + (init_output_buffer, output_get_prefix): Constify. + (diagnostic_message_length_per_line): Likewise. + (reshape_diagnostic_buffer): Declare. + (default_initialize_buffer): Declare. + (initialize_diagnostics): Declare. + (diagnostic_buffer): Declare new obbject. + + * toplev.c: #include diagnostic.h + (display_help): Document diagnostic formatting options. + (decode_f_option): Handle diagnostic formatting options. + (main): Setup initialization for diagnostic messages outputter. + + * toplev.h (set_message_length): Remove. + + * Makefile.in (toplev.o): Depends upon diagnostic.h + + * invoke.texi : Document diagnostics formatting options. + +Tue Jun 6 19:25:32 2000 Philippe De Muyter + + * configure.in (Make the links): Typo fix : the file that must be + included without #ifdef IN_GCC is `auto-host.h', not `auto-config.h'. + * configure: File rebuilt. + +2000-06-06 Nathan Sidwell + + * eh-common.h (EH_ALLOC_SIZE, EH_ALLOC_ALIGN): New #defines. + (eh_context): Add alloc_mask and alloc_buffer emergency fallback + space. + * libgcc2.c (__eh_alloc): Moved from cp/exception.cc. Fallback on + emergency eh_context buffer, if malloc fails. + (__eh_free): Moved from cp/exception.cc. Release to emergency + eh_context buffer, if appropriate. + +2000-06-06 Jason Merrill + + * expr.c (store_expr): Fix typo. + +2000-06-06 Kaveh R. Ghazi + + * m68k.c (legitimize_pic_address): Move prototype ... + + * m68k-protos.h (legitimize_pic_address): ... here. + + * m68k.md (legitimize_pic_address): Delete prototypes. + (untyped_call): Invoke GEN_CALL(), not gen_call(). + + * nextstep.c: Include system.h and toplev.h. + (get_directive_line): Don't prototype. + (handle_pragma): Mark parameters with ATTRIBUTE_UNUSED and constify. + + * nextstep.h (handle_pragma): Prototype. + (SECTION_FUNCTION): Prototype FUNCTION(). Move prototype of + objc_section_init ... + (EXTRA_SECTION_FUNCTIONS): ... here. + +Tue Jun 6 08:17:26 2000 Richard Kenner + + * sdbout.c (struct sdb_file): NAME now const. + (sdbout_init): input_file_name now const. + (sdbout_start_new_source_file): FILENAME now const. + * sdbout.c (sdbout_init, sdbout_start_new_source_file): Reflect above. + +2000-06-06 Gabriel Dos Reis + + * c-typeck.c (build_conditional_expr): Handle complex data types. + +2000-06-05 Jason Merrill + + * explow.c (maybe_set_unchanging): New function, broken out from... + (set_mem_attributes): Here. + * expr.h: Declare it. + * stmt.c (expand_decl): Call it. + +2000-06-05 Richard Henderson + + * reload1.c (choose_reload_regs): Mind CLASS_CANNOT_CHANGE_SIZE + while looking for a register to inherit from. + +2000-06-05 Jason Merrill + + * Makefile.in (libgcc.ready): Lose. + (libgcc.mk): Just use mv, not move-if-change. + (LIBGCC_DEPS): New macro. + (libgcc.a): Use it. + (stmp-multilib): Likewise. + * mklibgcc.in (stmp-dirs): New target. Make everything depend on + it rather than the directories themselves. + (LIB2ADD): Depend on the list file rather than 'force'. + + * fold-const.c (fold, case COND_EXPR): Elide conversion between + cv-qualified versions of types. + +Mon Jun 5 14:06:18 2000 Richard Kenner + + * config/sparc/sparc.c (short_branch): Correct error in range + computation. + +2000-06-05 J. David Anglin + + * fixinc/inclhack.def: New include hacks for ultrix. + * (nested_ultrix): Replaced by ultrix_nested_svc. + * (ultrix_atof_param): test_text string added. + * (ultrix_ifdef): Modified select string. + +2000-06-05 Zack Weinberg + + * objc/objc-act.c (generate_method_descriptors): Register + objc_method_prototype_template as a GC root. + (comp_method_with_proto): Register function_type as a GC root. + (comp_proto_with_proto): Replace function_type1 and + function_type2 with a two-element array; register it as a GC root. + + (generate_protocols, build_protocol_initializer, + generate_protocol_list, build_category_initializer, + build_shared_structure_initializer): Do not cache cast_type + and/or cast_type2. + +2000-06-05 J. David Anglin + + * function.c (assign_parms): Add missing argument to set_mem_attributes + call. + +2000-06-05 Nathan Sidwell + + * tree.h (VOID_TYPE_P): New macro. + (COMPLETE_OR_VOID_TYPE_P): Use VOID_TYPE_P. + * c-decl.c (grokdeclarator): Use VOID_TYPE_P. + (get_parm_info): Likewise. + (store_parm_decls): Likewise. + (combine_parm_decls): Likewise. + (finish_function): Likewise. + * c-typeck.c (build_function_call): Likewise. + (build_binary_op): Likewise. + (build_conditional_expr): Likewise. + (internal_build_compound_expr): Likewise. + (convert_for_assignment): Likewise. + * stmt.c (expend_expr_stmt): Likewise. + (warn_if_unused_value): Likewise. + (expand_return): Likewise. + * c-parse.in (primary): Likewise. + * c-parse.y, c-parse.c, c-parse.h: Regenerate. + * objc/objc-parse.y, objc/objc-parse.c: Regenerate. + +Mon Jun 5 06:46:28 2000 Richard Kenner + + * alias.c (get_alias_set): If compnent is addressable, use alias + set of component. + * c-decl.c (init_decl_processing): Don't call record_component_aliases. + (grokdeclarator): Likewise. + * c-typeck.c (common_type): Likewise. + +2000-06-04 Alex Samuel + + * Makefile.in (OBJS): Remove dyn_string.o + (dyn-string.o): Delete rule. + * dyn-string.c: Delete file + * dyn-string.h: Likewise. + +2000-06-04 Kaveh R. Ghazi + + * Makefile.in (intl.*): Honor nonzero exit codes in the intl + subdir. + +2000-06-03 Geoff Keating + + * alias.c (record_component_aliases): Don't inspect + DECL_NONADDRESSABLE_P of non-FIELD_DECL components of structures. + +Sat Jun 3 19:05:30 2000 Michael Meissner + + * ifcvt.c (process_insns): If IFCVT_MODIFY_INSN is defined, call + it with the pattern to do machine dependent work. + (cond_exec_process_if_block): If IFCVT_MODIFY_TESTS is defined, + use it to modify the true/false tests used in conditional + execution. If IFCVT_MODIFY_FINAL and IFCVT_MODIFY_CANCEL are + defined, invoke them if the conversion to conditional execution + was successful or not. + + * tm.texi (IFCVT_MODIFY_TESTS): Document. + (IFCVT_MODIFY_INSN): Ditto. + (IFCVT_MODIFY_FINAL): Ditto. + (IFCVT_MODIFY_CANCEL): Ditto. + +Sat Jun 3 15:26:13 2000 Matt Kraai + + * toplev.c (main): Fix misspellings of possibility and language. + +2000-06-03 Richard Henderson + + * alias.c (record_alias_subset): Initialize has_zero_child in the + superset. + +2000-06-03 Richard Earnshaw (rearnsha@arm.com) + + * arm.md (untyped_call): Use GEN_CALL macro. + +2000-06-02 Pekka Nikander + + * Makefile.in: Use $(MAKE) not "make" + +Fri Jun 2 19:31:03 2000 Richard Kenner + + * alias.c (struct alias_set_entry): New field has_zero_child. + (mem_in_disjoint_alias_sets_p): Return 0 if set in either ase. + (get_alias_set): If language-dependent routine set TYPE_ALIAS_SET, + do nothing. + Call record_component_aliases for aggregate types. + (record_alias_subset): Set has_zero_child. + (record_component_aliases, case ARRAY_TYPE): Do nothing if + TYPE_NONALIASES_COMPONENT. + (record_component_aliases, case RECORD_TYPE): Test + DECL_NONADDRESSABLE_P. + * c-decl.c (grokdeclarator): Set DECL_NONADDRESSABLE_P instead + of TREE_ADDRESSABLE. + * calls.c (initialize_argument_information): Only test + TYPE_TRANSPARENT_UNION for UNION_TYPE. + * function.c (assign_parms): Likewise. + * integrate.c (function_cannot_inline_p): Likewise. + * stor-layout.c (finish_record_layout): Don't call + record_component_aliases. + * tree.h (struct tree_int_cst): Use struct tree_common. + (struct tree_real_cst, struct tree_string): Likewise. + (struct tree_complex, struct tree_identifier): Likewise. + (struct tree_list, struct tree_vec, struct tree_exp): Likewise. + (struct tree_block, struct tree_type, struct tree_decl): Likewise. + (TYPE_TRANSPARENT_UNION): Use UNION_TYPE_CHECK. + (TYPE_NONALIASES_COMPONENT): New macro. + (TYPE_AMBIENT_BOUNDEDNESS): Use FUNCTION_TYPE_CHECK. + (DECL_NONADDRESSABLE_P): New macro. + (struct tree_decl): Reorder bits for clarity of how many left; + add non_adressable. + +2000-06-02 Jason Merrill + + * Makefile.in (libgcc.a): Also depend on $(LIB2ADD). + * mklibgcc.in (force): New target. + Make LIB2ADD stuff depend on it. + +2000-06-02 Richard Henderson + + * alias.c (lang_get_alias_set): Remove. + (get_alias_set): Call it directly, not indirectly. + * c-common.c (lang_get_alias_set): Rename from c_get_alias_set. + * c-common.h (c_get_alias_set): Don't declare. + * c-decl.c (init_decl_processing): Don't set lang_get_alias_set. + * expr.h (lang_get_alias_set): Declare as function, not pointer. + +2000-06-02 Bruce Korb + + * fixinc/server.c(sig_handler): resume closing server on SIGPIPE + (server_setup): define the server's master pid + (close_server): actually do the deed IFF we are the server's master + +2000-06-02 Jakub Jelinek + + * c-common.c (c_get_alias_set): Check whether signed_type did not + return its argument before calling get_alias_set on the result. + +2000-06-02 Andrew MacLeod + + * expr.c (emit_group_load): Fix typo, GET_MODE not GET_CODE. + +Fri Jun 2 00:22:52 2000 J"orn Rennecke + + * sh.h (CPP_SPEC): Add -D__NOMACSAVE__ for -mnomacsave. + (CONDITIONAL_REGISTER_USAGE): Mac registers are call used + for TARGET_NOMACSAVE. + (NOMACSAVE_BIT): Define. + (TARGET_NOMACSAVE): Define. + (TARGET_SWITCHES): Add "nomacsave". + +2000-06-02 Toshiyasu Morita + + * sh.md (untyped_call): Remove excess parameters + +2000-06-01 Loren J. Rittle + + * fixinc/inclhack.def (osf_namespace_a): Relax expression to + match that used before the conversion to c_fix style. + * fixinc/fixincl.x: regenerate + +2000-06-01 Stan Cox + + * varray.h (VARRAY_PUSH_GENERIC_PTR, VARRAY_PUSH_CHAR_PTR): Fix + macro argument typo. + +2000-06-01 Zack Weinberg + + * cpplex.c (maybe_macroexpand): Use CPP_WTRADITIONAL. Improve + error message. + * cpplib.c (parse_include): Remove support for VAX-C + "#include starlet" misfeature. + +2000-05-31 Laurynas Biveinis + + * cppfiles.c: conditionally define O_BINARY. + (open_include_file): pass O_BINARY to open(). + +2000-06-01 Richard Henderson + + * i960.c (i960_br_predict_opcode): Remove. + (i960_print_operand) [+]: Emit branch prediction hints. + (i960_function_arg): Return early for VOIDmode. + (i960_round_align): Return early for incomplete types. + * i960.h (PRINT_OPERAND_PUNCT_VALID_P): New. + * i960.md (all conditional branches): Add "%+". + +Thu Jun 1 12:24:21 2000 Richard Kenner + + * alias.c (get_alias_set): Don't call language-specific routine more + than is needed and clean up code a bit. + * c-common.c (c_get_alias_set): All references whose type + is char get alias set 0, but character types need not. + * varasm.c (make_function_rtl): Don't call set_mem_attributes. + (make_decl_rtl): Don't call it for FUNCTION_DECL. + +2000-06-01 Bruce Korb + + * fixinc/tests/base/...: new base result files + +Thu Jun 1 09:37:35 2000 Clinton Popetz + + * config/i386/i386.c (ix86_use_fcomi_compare): Make global. + * config/i386/i386-protos.h (ix86_use_fcomi_compare): Declare. + * config/i386/i386.md (*fp_jcc_3, *fp_jcc_4): Disable if we + will use FCOMI. + +2000-06-01 Richard Henderson + + * Makefile.in (c-decl.o): Depend on $(EXPR_H), not expr.h. + + * c-decl.c (init_decl_processing): Set lang_get_alias_set first thing. + +2000-05-31 Richard Henderson + + * config/ia64/ia64.c (sdata_symbolic_operand): Consider small + CONSTANT_POOL_ADDRESS_P addresses for .sdata. + * config/ia64/sysv4.h (SELECT_RTX_SECTION): New. + +2000-05-31 Richard Henderson + + * config/ia64/ia64-protos.h (ia64_expand_prediction): Remove. + * config/ia64/ia64.c (ia64_expand_prediction): Move code ... + (ia64_print_operand) [+]: ... here. Use current_output_insn. + * config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): New. + * config/ia64/ia64.md (all branch/call patterns): Use %+. + +2000-05-31 Richard Henderson + + * ifcvt.c (cond_exec_process_insns): Don't ever ignore clobbers. + +2000-05-31 Richard Henderson + + * ifcvt.c (merge_if_block): Be prepared for JOIN to have no + remaining edges. + (find_if_block): Allow THEN with no outgoing edges. + * flow.c (merge_blocks_nomove): Remove a barrier not following + a jump as well. + +2000-05-31 Richard Henderson + + * flow.c (propagate_block): Move initialization of mem_set_list ... + (init_propagate_block_info): ... here. Also track blocks with + no successors; don't scan insns if ! PROP_SCAN_DEAD_CODE. + +2000-05-31 Richard Henderson + + * jump.c (jump_optimize_1): Revert 05-18 change. + +2000-05-31 Mark Mitchell + + * invoke.texi: Remove documentation for -fguiding-decls. + +2000-05-31 Richard Henderson + + * configure.in: Fix typo last change. + +2000-05-31 Philipp Thomas + + * configure.in (enable-nls): Enable if build == host, i.e. when + not building a canadian cross compiler. + (enable-maintainer-mode): Added for use with i18n. + * aclocal.m4 (AM_GNU_GETTEXT): Only build catalogs that are a + cross section of ALL_LINGUAS and LINGUAS. + * configure: Rebuild. + +2000-05-31 Bruce Korb + + * fixinc/check.tpl: rework to use test result tree + * fixinc/Makefile.in: change invocation of check script + * fixinc/check.diff: No longer needed + * fixinc/fixincl.x: regenerate + * fixinc/inclhack.def: add new tests + * fixinc/tests/base/arch/i960/archI960.h: New test result + * fixinc/tests/base/curses.h: modified test result + * fixinc/tests/base/stdio.h: ditto + * fixinc/tests/base/time.h: ditto + * fixinc/tests/base/sys/asm.h: ditto + * fixinc/tests/base/sys/stat.h: ditto + * fixinc/tests/base/sys/wait.h: ditto + +Wed May 31 13:17:20 2000 Philippe De Muyter + + * except.c (clear_function_eh_region): Do not free NULL. + +Wed May 31 08:07:52 2000 Richard Kenner + + * Makefile.in (c-decl.o): Depend on rtl.h and expr.h. + * alias.c (struct alias_entry): alias_set is HOST_WIDE_INT. + (REG_BASE_VALUE): Remove unneeded cast to unsigned. + (get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT. + (find_base_decl): New function, from c_find_base_decl in c-common.c. + (new_alias_set): Moved from tree.c; return is HOST_WIDE_INT. + (get_alias_set): Likewise. + Major rework to do more things and allow language-specific code + to just handle special-cases. + (record_alias_subset): Args are HOST_WIDE_INT. + (record_component_alias): Local vars are HOST_WIDE_INT. + Don't handle COMPLEX_EXPR. + (get_varargs_alias_set): Moved from builtins.c. + (get_frame_alias_set): New function. + * builtins.c (expand_builtin_return_address): Use frame alias set. + (expand_builtin_setjmp, expand_builtin_longjmp): Use alias set + for setjmp buffer. + (get_memory_rtx): Rework to use set_mem_attributes. + (get_varargs_alias_set): Deleted from here. + * c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT. + (c_find_base_decl): Deleted from here. + (c_get_alias_set): Remove many cases and rework to just handle + C-specific cases. + * c-common.h (c_get_alias_set): Returns HOST_WIDE_INT. + * c-decl.c (rtl.h, expr.h): Now included. + (init_decl_processing): Call record_component_aliases on array types. + (grokdeclarator): Likewise. + Set TREE_ADDRESSABLE for all fields that are not bitfields. + * c-typeck.c (common_type): Call record_component_aliases for array. + * caller-save.c (setup_save_areas): Rework register loop for unsigned. + Set all save areas to the frame alias set. + * calls.c (initialie_argument_information): Call set_mem_attributes. + (compute_argument_addresses, expand_call): Likewise. + * explow.c (set_mem_attributes): New function. + (stabilize): Use MEM_COPY_ATTRIBUTES and force_reg. + * expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}. + LEN and OFFSET now HOST_WIDE_INT. + (clear_by_pieces): Similar changes. + (move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields. + (move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT. + (move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES. + (clear_by_pieces_1): Likewise. + (emit_push_insn): Call set_mem_attributes. + (expand_expr, case INDIRECT_REF): Likewise. + (expand_expr, case VAR_DECL): Call change_address. + * expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and + tree_low_cst. + (get_varargs_alias_set, get_frame_alias_set): New decls. + (record_base_value, record_alias_subset, lang_get_alias_set): Likewise. + (new_alias_set, set_mem_attributes): Likewse. + * function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT. + (assign_stack_temp_for_type): Likewise. + Can split slot even if alias set since can copy. + Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P. + (assign_temp): Use host_integerp and tree_low_cst. + (put_var_into_stack): Properly handle SAVE_EXPR. + (put_addressof_into_stack): Likewise. + (assign_parms): Call set_mem_attributes. + Delete #if 0 code. + (fix_lexical_address): Put reference to chain into frame alias set. + (expand_function_start): Call set_mem_attributes. + * integrate.c (expand_inline_function): Likewise. + * recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES. + * regmove.c (try_apply_stack_adjustment): Likewise. + * reload.c (push_reload, make_memloc): Likewise. + * reload1.c (alter_reg): Make alias sets for spilled pseudos. + * rtl.def (MEM): Update comment. + * rtl.h (MEM_ALIAS_SET): Now uses XCWINT. + (move_by_pieces): Change length to HOST_WIDE_INT. + (record_base_value, record_alias_subset): Delete from here. + * stmt.c (expand_decl): Call set_mem_attributes. + * stor-layout.c (finish_record_layout): Call record_component_aliases.i + * toplev.c (compile_file): Call init_alias_once earlier. + * tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted + from here: now in alias.c. + * tree.h (struct tree_type): alias_set is HOST_WIDE_INT. + (struct tree_decl): Likewise. + (get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here. + * varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes. + (output_constant_def, force_const_mem): Likewise. + + * flow.c (propagate_block): If block has no successors, stores to + frame are dead if not used. + +2000-05-31 Nathan Sidwell + + * stmt (expand_end_case): Reorder conversion sequence for jump + table to avoid extra truncations. + +Wed May 31 01:31:42 2000 Jeffrey A Law (law@cygnus.com) + + * ifcvt.c (cond_exec_process_if_block): Do nothing if the last insn + in the block is more than just a simple conditional branch. + (noce_process_if_block): Similarly. + +Tue May 30 22:25:57 2000 Alexandre Oliva + + * optabs.c (prepare_float_lib_cmp): Protect *px and *py from + queue. + +2000-05-30 Michael Meissner + + * dwarf2out.c (dwarf2out_frame_debug_expr): Ignore HIGH + instructions. Treat LO_SUM operations as loading the full integer + constant. + +2000-05-30 Richard Henderson + + * combine.c (get_pos_from_mask): Test exact_log2 result as signed. + +2000-05-30 Richard Henderson + + * bb-reorder.c (emit_jump_to_block_after): Protect use of HAVE_return. + +2000-05-30 Bruce Korb + + * fixinc/tests/*: Added expected result files for fixinc's make check + * fixinc/fixfixes(char_macro_*_fix): Restore original algorithm + +2000-05-30 Richard Henderson + + * config/alpha/alpha.md (*setne_internal): Use match_operator + instead of working down from insn. + +2000-05-30 Kaveh R. Ghazi + + * invoke.texi (-Wtraditional): Update WRT function macros. + +Tue May 30 09:57:32 2000 Philippe De Muyter + + * except.c (free_exception_table): Do not free NULL. + +2000-05-29 Zack Weinberg + + * cpplib.c (do_if): Don't save and restore only_seen_white here. + * cppexp.c (_cpp_parse_expr): Save and restore only_seen_white + and skipping here. + +2000-05-29 Richard Earnshaw (rearnsha@arm.com) + + * flow.c (mark_used_reg): If a register is unconditionally live, + remove any conditional death information. + +2000-05-29 Richard Henderson + + * final.c (current_output_insn): New. + (final_scan_insn): Set it. + * output.h: Declare it. + +2000-05-29 Richard Henderson + + * stor-layout.c (finalize_record_size): Fix typo. + + * jump.c (redirect_jump): Don't emit NOTE_INSN_FUNCTION_END + if nlabel is null. + +2000-05-29 Zack Weinberg + + * cpplib.h (cpp_reader): Remove if_stack. Change + potential_control_macro to a cpp_hashnode *. Add skipping flag. + * cpphash.h (struct ihash): Change control_macro to a + cpp_hashnode * and shorten name to cmacro. + Add NEVER_REINCLUDE constant. + + * cppfiles.c (redundant_include_p): Drop cpp_reader argument. + Examine the cmacro node directly, no need to call cpp_defined. + (_cpp_execute_include, read_include_file): Set cmacro to + NEVER_REINCLUDE, not U"". + * cpplex.c (cpp_push_buffer): Don't set new->if_stack. + (cpp_get_token): If pfile->skipping is true, discard text and + keep scanning until we hit a directive; don't expand macros. + + * cpplib.c (struct if_stack): Remove if_succeeded, add + was_skipping. Change control_macro to a cpp_hashnode * and + shorten name to cmacro. Remove typedef IF_STACK. + (parse_ifdef), detect_if_not_defined): Return a cpp_hashnode *. + (conditional_skip, skip_if_group, + consider_directive_while_skipping): Delete. + (push_conditional): New. + (_cpp_handle_directive): Don't process directives other than + conditionals if we are skipping. + + (do_ifdef, do_ifndef, do_if, do_else, do_elif, do_endif): + Update to new scheme. + (validate_else): Skip rest of line here, unconditionally. + (_cpp_unwind_if_stack): The stack is per-buffer. Force + pfile->skipping off. + + (all): Remove `scare quotes' from error messages. + +2000-05-29 Richard Henderson + + * function.c (emit_return_into_block): New line_note arg; emit it. + (thread_prologue_and_epilogue_insns): Attempt to locate a line note + for the close brace to accompany HAVE_return. Move all line notes + following the epilogue to before the NOTE_INSN_EPILOGUE_BEG. + +2000-05-29 Richard Henderson + + * longlong.h [__alpha] (count_leading_zeros): New. + (count_trailing_zeros): New. + (COUNT_LEADING_ZEROS_0): New. + + * config/alpha/alpha.c (alpha_zero_comparison_operator): New. + (alpha_split_conditional_move): New. + * config/alpha/alpha-protos.h: Prototype them. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + (CPP_CPU_DEFAULT_SPEC): Fix typo for EV67. + * config/alpha/alpha.md: Update ffs cix commentary. + (*ze_and_ne): New. + (*nabssf2, *nabsdf2): New. + (*mov[qhsd]icc_internal): Use add_operand. + (if_then_else constant splitters): New. + (*cmp_sadd_di, *cmp_sadd_si, *cmp_sadd_sidi): New. + (*cmp_ssub_di, *cmp_ssub_si, *cmp_ssub_sidi): New. + +2000-05-29 Richard Henderson + + * combine.c (force_to_mode) [MINUS]: Convert subtraction from + a constant to NEG or NOT when conditions allow. + + * combine.c (combine_simplify_rtx): Don't create an if_then_else + unless both args are general_operand. Don't canonicalize plus + to ior unless it helps. + + * toplev.c (rest_of_compilation): Set no_new_pseudos after flow1; + instead track register_life_up_to_date. Toggle no_new_pseudos + around if_convert. + +2000-05-28 Geoff Keating + + * config/rs6000/rs6000.c (output_cbranch): Escape '%' characters + so output_operand doesn't see them. + +Sun May 28 18:37:07 2000 Clinton Popetz + + * lcm.c (make_preds_opaque): Fix comment. + (optimize_mode_switching): Use NORMAL_MODE instead of + MODE_USES_IN_EXIT_BLOCK. Change leftover instance of + FP_MODE_NONE to no_mode. Rename MODE_AT_ENTRY to NORMAL_MODE. + Handle insertions before an existing NOTE_INSN_BASIC_BLOCK. + * tm.texi (OPTIMIZE_MODE_SWITCHING): Refer to NORMAL_MODE. + (MODE_USES_IN_EXIT_BLOCK): Delete. + (MODE_AT_ENTRY) Rename to NORMAL_MODE. + * sh.h (MODE_USES_IN_EXIT_BLOCK): Delete. + (MODE_AT_ENTRY): Rename to NORMAL_MODE. + (MODE_NEEDED): Don't look for USE. + (EPILOGUE_USES): Define. + +Sun May 28 23:26:59 2000 Philippe De Muyter + + * mklibgcc.in (all): Variable initialized to `libgcc'. + +2000-05-28 Gabriel Dos Reis + + * toplev.h (skip_leading_substring): New macro. + * toplev.c (decode_f_option): Use skip_leading_substring instead + of strncmp. + (decode_W_option): Likewise. + +2000-05-28 Nick Clifton + + * tm.texi (CONDITIONAL_REGISTER_USAGE): Document that it can + modify reg_names. + +2000-05-28 Richard Henderson + + * regclass.c (record_operand_costs): Protect reg_changes_size + with CLASS_CANNOT_CHANGE_SIZE. + + * loop.c (instrument_loop_bct): Set JUMP_LABEL on the new insn. + +2000-05-28 Richard Henderson + + * function.c (diddle_return_value): A pcc-style struct return + returns a pointer. + +2000-05-27 Zack Weinberg + + * cppfiles.c: Read files in, using mmap if possible, then + prescan them separately. + (read_file, read_with_read): New functions. + * cpplex.c: Don't define UCHAR_MAX. + (_cpp_read_and_prescan): Rename to _cpp_prescan. Don't read + the file here. + + * cppinit.c (handle_option): Automatically define __cplusplus, + __OBJC__, __ASEEMBLER__, _LANGUAGE_FORTRAN here when we see + the respective -lang switch. + + * cpphash.h (enum node_type, struct hashnode, _cpp_lookup + prototype): Move to... + * cpplib.h: ... here. Rename struct hashnode to struct + cpp_hashnode and give it a typedef. Rename _cpp_lookup to + cpp_lookup. Add 'fe_value' slot, a union tree_node *. + +2000-05-27 Geoffrey Keating + + * config/rs6000/rs6000.md (movsi): Constify 'name'. + + * regclass.c [CLASS_CANNOT_CHANGE_SIZE] + (class_can_change_size): New variable. + (reg_changes_size): New variable. + (init_reg_sets_1): Initialize class_can_change_size. + (record_operand_costs): Remove subreg_changes_size. + Don't pass it around. Instead update reg_changes_size. + (regclass): Initialize and free reg_changes_size. If a register + changes size, don't preference it to a class that contains + registers that can't change size. + (record_reg_classes): Don't look at subreg_changes_size. + +2000-05-27 Richard Henderson + + * print-rtl.c (reg_names): Remove const. + * regclass.c (reg_names): Likewise. + * regs.h (reg_names): Likewise. + * hard-reg-set.h (reg_names): Likewise. + +2000-05-27 Richard Henderson + + * config/rs6000/rs6000.md (untyped_call): Use GEN_CALL. + +2000-05-27 Richard Henderson + + * config/alpha/alpha.c (alpha_does_function_need_gp): Test + TARGET_PROFILING_NEEDS_GP in the if, instead of with an ifdef. + (alpha_expand_prologue): Emit prologue_mcount if needed. + * config/alpha/alpha.h (TARGET_PROFILING_NEEDS_GP): Default to 0. + * config/alpha/alpha.md (prologue_mcount): New. + * config/alpha/linux.h (FUNCTION_PROFILER): Remove. + (TARGET_PROFILING_NEEDS_GP): Undef before redefining. + * config/alpha/netbsd.h: Likewise. + +2000-05-27 Richard Henderson + + * config/alpha/elf.h (SELECT_SECTION): Mirror Kenner's May 19 + change to config/elfos.h. + +2000-05-27 Richard Henderson + + * Makefile.in (resource.o): Depend on except.h. + * except.h (output_exception_table_data): Prototype. + * genconfig.c (gen_peephole2): Prototype. + * genemit.c (main): Include ggc.h. + * genoutput.c: Revert parts of last change: include errors.h + (main): Set progname. + * recog.c: Include hard-reg-set.h before recog.h. + * resource.c: Include except.h. + + * config/alpha/alpha-protos.h (alpha_arg_info_reg_val): Protect + with RTX_CODE. + (alpha_write_linkage): Protect with BUFSIZ. + (alpha_need_linkage): Update prototype. + * config/alpha/alpha.c (function_arg): Move VMS code here. + (alpha_links_base): Remove. + (alpha_links): New. + (mark_alpha_links_node, mark_alpha_links): New. + (alpha_write_one_linkage): New. + (alpha_need_linkage): Use a splay tree. Build the linkage symbol. + (alpha_write_linkage): Use splay_tree_foreach. + * config/alpha/alpha.md (call_vms): Use alpha_need_linkage + to get the linkage symbol. + (call_value_vms): Likewise. + * config/alpha/elf.h (output_file_directive): Remove decl. + (ctors_section, dtors_section): Prototype. + (sbss_section, sdata_section): Prototype. + * config/alpha/vms.h (FUNCTION_ARG): Remove. + (readonly_section, link_section, literals_section): Prototype. + (ctors_section, dtors_section): Prototype. + (vms_valid_decl_attribute_p): Remove decl. + (alpha_arg_type, alpha_arg_info_reg_val): Likewise. + +2000-05-27 Geoff Keating + + * reload.c (get_secondary_mem): Don't widen floating-point modes. + + * combine.c (subst): Honor CLASS_CANNOT_CHANGE_SIZE when + substituting the REG in a (subreg:X (reg:Y ...)). + +2000-05-28 Neil Booth + + * cpplex.c (_cpp_lex_line): Merge vertical space. Flag + first token of a line BOL. Update EOF code for this. + Remove illegal directive check - it appears in the (not + yet committed) caller. + * cpplib.h (BOL): New flag. + +2000-05-28 Neil Booth + + * cpplex.c (_cpp_init_toklist): No comment space to initialize. + (_cpp_free_toklist): No comment space to free. + (expand_comment_space): Remove. + (save_comment_space): Place the comment in the current token and + not in a separate comment space. + (_cpp_lex_line): Save comments during plain code and #define + directives only. + * cpplib.h (struct _cpp_toklist): Remove comment space. + +2000-05-28 Neil Booth + + * cppexp.c (parse_assertion): Supply extra argument to + _cpp_init_toklist. + * cpplib.c (do_assert, do_unassert): Similarly. + * cpphash.h (_cpp_init_toklist) Update. + (_cpp_expand_token_space): New. + (DUMMY_TOKEN, NO_DUMMY_TOKEN): New. + * cpplex.c (_cpp_init_toklist): New argument. + (parse_string2): New argument multiline_ok. + (spell_token): Take a const cpp_token *. + (INIT_NAME): Replace with INIT_TOKEN_NAME. Update tokens_used. + (SPELL_ macros): Replace with enum. + (expand_token_space): Replace with _cpp_expand_token_space. + Take COUNT argument. + (IS_DIRECTIVE): Update. + (_cpp_lex_line): Update token structure before parsing number. + Don't assume start at beginning of token list. + (save_comment): Use INIT_TOKEN_NAME. + +2000-05-27 Zack Weinberg + + * configure.in (stage1_warn_cflags): Add -Wstrict-prototypes + -Wmissing-prototypes. + * configure: Regenerate. + * gcc.texi: Remove explanation of MD_CALL_PROTOTYPES. + + * builtins.c, calls.c: Change all instances of gen_call_* or + gen_sibcall_* to GEN_CALL_* and GEN_SIBCALL_*. + * calls.c (struct_value_size_rtx): Separate definition from + initialization to avoid unused variable warning. + + * genflags.c (gen_macro): New function. + (gen_proto): Call it for gen_call_* and gen_sibcall_*. + (gen_nonproto): Delete. + (gen_insn): Put all insns on the same obstack. + (main): Generate prototypes for everything unconditionally. + + * configure.in: Add AC_CHECK_TYPE(ssize_t). Remove commented + out check for wchar_t. + * acconfig.h: Add template for ssize_t. Remove @TOP@. + * system.h: Add infrastructure for defining missing + TYPE_MAX/TYPE_MIN macros. Use it to provide fallback + definitions of UCHAR_MAX and SSIZE_MAX. + * configure: Regenerate. + * config.in: Regenerate. + + * Makefile.in (libgcc2.ready): Rename to libgcc.ready. + Depend on $(LANGUAGES) as well as $(GCC_PATCHES) and fixed + headers. + (clean): No need to delete libgcc1.a, libgcc1-asm.a, + libgcc2.a, or libgcc1.null. + +2000-05-27 Richard Henderson + + * Makefile.in (recog.o): Don't depend on resource.h. + * recog.c: Don't include resource.h. + (recog_last_allowed_insn): Remove. + (recog_next_insn): Remove. + (struct peep2_insn_data): New. + (peep2_insn_data, peep2_current): New. + (peep2_next_insn): New. + (peep2_regno_dead_p, peep2_reg_dead_p): New. + (peep2_find_free_register): New. + (peephole2_optimize): Track life information by insn as we go. + * recog.h: Update declarations. + * resource.c (find_free_register, reg_dead_p): Remove. + * resource.h: Remove their declarations. + * toplev.c: Include hard-reg-set.h before recog.h. + + * genconfig.c (max_insns_per_peep2): New. + (gen_peephole2): New. + (main): Call it. + * genemit.c (output_peephole2_scratches): Generate calls to + peep2_find_free_register; adjust surrounding code. + (main): Have insn-emit.c include hard-reg-set.h before recog.h. + * genrecog.c (change_state): Don't track last_insn. + (write_action): Write into *_pmatch_len before accepting. + (write_tree): Adjust peephole2_insns and subroutines to match. + + * config/i386/i386.md (all peepholes): Use peep2_regno_dead_p. + + * config/alpha/alpha.c (hard_fp_register_operand): Mind the mode. + (hard_int_register_operand): New. + * config/alpha/alpha-protos.h: Declare it. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + * config/alpha/alpha.md (peep2 patterns): Use hard_int_register_operand + as needed; use peep2_reg_dead_p instead of dead_or_set_p. + +2000-05-27 Richard Henderson + + * function.c (thread_prologue_epilogue_insns): Don't move the + line note at the head of the chain. Only force a lineno note + before the end of block 0. + +2000-05-27 Richard Henderson + + * gensupport.c (collect_insn_data): Record the maximum number + of alternatives, not the last seen. + + * genoutput.c: Don't include errors.h. + (struct data): Add lineno member. + (have_error): New. + (scan_operands): Use message_with_line instead of error. + (validate_insn_alternatives): Likewise. + (gen_insn): Accept and store the pattern's line number. + (gen_peephole, gen_expand, gen_split): Likewise. + (main): Don't set progname. Pass line_no to gen_foo. + +2000-05-27 Richard Henderson + + * config/d30v/d30v.c (d30v_print_operand): Handle ':'. + * config/d30v/d30v.h (PRINT_OPERAND_PUNCT_VALID_P): Accept ':'. + * config/d30v/d30v.md (attr predicable): New. + (all insn patterns): Mark non-predicable patterns; use %: on the rest. + (andsi3*): Unify into one pattern. + (iorsi3*, xorsi3*): Likewise. + (peephole2 patterns): Use peep2_reg_dead_p; verify not a + conditional return. + (old cond_exec patterns): Remove. + (define_cond_exec): New. + +Sat May 27 11:01:27 2000 Richard Kenner + + * tree.h (TREE_CODE_LENGTH): New macro. + * c-common.c (c_find_base_decl): Use it. + * expr.c (safe_from_p): Likewise. + * print-tree.c (print_node): Likewise. + * tree.c (make_node, copy_node, get_identifier): Likewie. + (first_rtl_op, contains_placeholder_p, substitute_in_expr): Likewise. + (build, build_nt, build_parse_node, simple_cst_equal): Likewise. + * fold-const.c (make_range): Likewise. + (fold): Likewise; also use first_rtl_op. + * c-iterate.c (collect_iterators): Use first_rtl_op. + * calls.c (calls_function_1): Likewise; also rename TYPE to CLASS. + Use IS_EXPR_CODE_CLASS. + (preexpand_calls): Likewise. + * ggc-common.c (ggc_mark_trees): Rework to use first_rtl_op + and TREE_CODE_LENGTH. + * stmt.c (warn_if_unused_value): If no operands, no unused value. + +2000-05-26 Geoffrey Keating + + * config/rs6000/rs6000.md (movsi_internal1): Use '%a1' rather + than '%1(%*)'. + (movdi_internal64): Likewise. + + * config/rs6000/rs6000.md: Correct order of operands for DImode + boolean patterns. + + * config/rs6000/rs6000.c (boolean_or_operator): New function. + * config/rs6000/rs6000-protos.h (boolean_or_operator): Prototype it. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add boolean_or_operator. + * config/rs6000/rs6000.md: Use boolean_or_operator instead of + boolean_operator for the boolean patterns without NOTs. + + * config/rs6000/rs6000.c (reg_or_logical_cint_operand): Rename + from reg_or_u_cint_operand. Change comment and behavior. + (logical_operand): Clean up, add assertion. + (non_logical_cint_operand): Also check for + reg_or_logical_cint_operand. + * config/rs6000/rs6000.h (PREDICATE_CODES): Update. + * config/rs6000/rs6000.md (iorsi3): Use reg_or_logical_cint_operand + in the expander. + (xorsi3): Likewise. + (iordi3): Likewise. + (xordi3): Likewise. + +2000-05-26 Mark Mitchell + + * tree.h (struct record_layout_info): Rename to (struct + record_layout_info_s). + * stor-layout.c (start_record_layout): Replace + `record_layout_info' with `record_layout_info_s'. + +2000-05-26 Richard Earnshaw + + * flow.c (find_label_refs): New function. + (find_basic_blocks_1): Call it for each alternative of a call + placeholder. + +2000-05-26 Richard Earnshaw + + * ifcvt.c (cond_exec_get_condition): Set test_if to the SET_SRC + of get_pc. + +2000-05-25 Richard Henderson + + * config/alpha/alpha.c (alpha_comparison_operator): Don't be + so strict about DImode. + (alpha_swapped_comparison_operator): Likewise. + * config/alpha/alpha.md (*setne_internal): Name it. Allow + any integer output mode. + (*setcc_internal): Likewise. + (*setcc_swapped_internal): Likewise. + (*movdicc_internal, *movdicc_lbc, *movdicc_lbs): Name them. + (*mov[qhs]icc_internal): New. + (*mov[qhs]icc_lbc, *mov[qhs]icc_lbs): New. + +2000-05-25 J. David Anglin + + * vax.h (CPP_SPEC): Define __GFLOAT and GFLOAT when -mg is specified. + +2000-05-25 Richard Henderson + + * bb-reorder.c (reorder_block_def): Reorder elements for size. + Remove add_jump; add next; replace flags with visited. + (rbd_init): Remove. + (REORDER_BLOCK_HEAD, REORDER_BLOCK_VISITED): Remove. + (REORDER_BLOCK_FLAGS, REORDER_BLOCK_INDEX): Remove. + (REORDER_BLOCK_ADD_JUMP, REORDER_BLOCK_EFF_HEAD): Remove. + (REORDER_BLOCK_EFF_END, REORDER_BLOCK_SCOPE): Remove. + (RBI): New. + (reorder_index, reorder_last_visited): Remove. + (skip_insns_after_block): Rewrite to use a switch. + (get_common_dest): Remove. + (chain_reorder_blocks): Remove. + (record_effective_endpoints): Split out from reorder_basic_blocks. + (make_reorder_chain): Likewise. Loop until all blocks are placed. + (make_reorder_chain_1): Renamed from old make_reorder_chain. + Only construct the reorder chain, do not move insns. Try harder + to tail recurse. + (label_for_bb, emit_jump_to_block_after): New. + (fixup_reorder_chain): Use them. Do bulk block movement. Examine + and adjust the jump insns appropriately. Fixup basic_block_info. + (verify_insn_chain): Always define. + (relate_bbs_with_scopes): Call xmalloc, not xcalloc. Fix thinko + in allocation size. + (make_new_scope): Don't write zeros to calloc'd space. + (build_scope_forest): Rely on xrealloc to DTRT. + (reorder_basic_blocks): Don't build loop nest. Don't fail if + profile_arc_flag. Streamline EH test. + + * flow.c (redirect_edge_succ, redirect_edge_pred): New. + * basic-block.h: Declare them. + +2000-05-25 Alexandre Oliva + + * emit-rtl.c (reset_used_decls): New function. + (unshare_all_rtl_again): Call it. + +2000-05-25 Zack Weinberg + + * cpplex.c (maybe_macroexpand): Warn about function-like + macros used in non-function context, if -Wtraditional. + +2000-05-25 Mark Mitchell + + * recog.c (peephole2_optimize): Use INSN_P. + +2000-05-25 Richard Henderson + + * ifcvt.c (seq_contains_jump): New. + (noce_try_store_flag_constants): Use it to fail conversion. + (noce_try_store_flag_inc, noce_try_store_flag_mask): Likewise. + +2000-05-25 Mark Mitchell + + * except.h (can_throw): Declare it. + * except.c (can_throw): Give it external linkage. + * resource.c (find_dead_or_set_registers): Use can_throw. + +2000-05-25 Richard Henderson + + * flow.c (mark_set_1): Don't record conditionally dead memory. + +2000-05-25 Jan Hubicka + + * combine.c (try_combine): Use any_condjump_p, any_uncondjump_p + and pc_set at the place of simplejump_p and condjump_p. + * cse.c (record_jump_equiv): Likewise. + * emit-rtl.c (emit): Likewise. + * explow.c (find_next_ref): Likewise. + * flow.c (tidy_fallthru_edge): Likewise. + (init_propagate_block_info): Likewise. + * gcse.c (delete_null_pointer_checks): Likewise. + * ifcvt.c (cond_exec_get_condition, noce_get_condition, + dead_or_predicable): Likewise. + * integrate.c (copy_insn_list): Likewise. + * loop.c (scan_loop, verify_dominator, find_and_verify_loops, + for_each_insn_in_loop, check_dbra_loop, get_condition, + insert_bct, load_mems): Likewise. + * resource.c (find_dead_or_set_registers): Likewise. + * sibcalls.c (simplejump_p): Likewise. + * unroll.c (copy_loop_body, reg_dead_after_loop): Likewise. + +2000-05-25 David Edelsohn + + * rs6000.c (expand_block_move): Add 64-bit PowerPC doubleword move + to STRING case. Use doubleword STRING move for TARGET_POWERPC64 + when unaligned. + * rs6000.h (CONST_OK_FOR_LETTER_P, 'J'): unsigned HOST_WIDE_INT. + (RETURN_ADDR_RTX): Use COUNT and FRAME, not count and frame. + (LEGITIMIZE_RELOAD_ADDRESS): unsigned HOST_WIDE_INT high. + * rs6000.md: Name various internal patterns. + +2000-05-25 Jan Hubicka + + * jump.c (invert_exp_1): Remove first argument, use pc_set + to get the expression. + (redirect_exp): Make static; redirect only the pc_set expression, + remove first argument. + (invert_exp): Remove first argument, make static. + (jump_optimize): Use any_condjump_p, any_uncondjump_p and + any_onlyjump at most places where we originaly did condjump_p + and simplejump_p. + (jump_back_p, follow_jumps, thread_jumps): Likewise. + (delete_barrier_succesors): Use pc_set. + (invert_jump_1, invert_jump, redirect_jump_1, redirect_jump): Update + calls of invert_exp and redirect_exp. + * rtl.h (redirect_exp, invert_exp): Remove. + * unroll.c (copy_loop_body): Use invert_jump and redirect_jump. + +2000-05-25 Richard Henderson + + * stmt.c (expand_end_bindings): Fix thinko last change. + +2000-05-25 Andrew MacLeod + Andrew Haley + + * except.c (func_eh_entry): Add emitted field. + (new_eh_region_entry): Set emitted field to 0; + (output_exception_table_entry): Only emit previously un-emitted data, + and send it to the eh_data section. + (output_exception_table): Break out common parts. Output + exception table for entire compilation unit to eh_data section. + (output_exception_table_data): Common parts of output_exception_table. + Send output to eh_data section. + (output_function_exception_table): Output exception table data for + a single function to eh_data section. + (free_exception_table): New external to free the table. + * except.h (free_exception_table): Add prototype. + (output_function_exception_table): Add prototype. + * final.c (final_end_function): Output function exception table + for IA64_UNWIND_INFO. + (final_scan_insn): Emit any unwind directives for an insn. + + * frame-dwarf2.c: New file containing all DWARF 2 specific code + from frame.c. + * frame.c: Remove all DWARF 2 specific code. + * config/ia64/frame-ia64.c: New file. + (gthread_stuff): Make all gthread available with + IA64_UNWIND_INFO. + (dwarf_fde): Define an IA64 struct for dwarf_fde. + (__register_frame_info, __register_frame): Move to common area of file. + (__register_frame_info_table, __register_frame_table): Move to common i + area. + (__deregister_frame_info, __deregister_frame): Move to common area. + (__frame_init, find_fde): New versions for IA64_UNWIND_INFO. + (read_uleb128): New version for ia64. + (get_unwind_record): Read the next IA-64 unwind record. + (read_R_record): Read a region header record. + (process_a_b_reg_code): X record helper. + (read_X_record): Read an X format record. + (read_B_record): Read a B format record. + (P3_record_types): List of record types matching the P3 format. + (P7_record_types): List of record types matching the P7 format. + (P8_record_types): List of record types matching the P8 format. + (read_P_record): Read a P format record. + (init_ia64_reg_loc): Set default fields for a register. + (init_ia64_unwind_frame): Set defaults for all register records. + (execute_one_ia64_descriptor): Execute one descriptor record. + (rse_address_add): Calculate the position of a local reg in memory. + (normalize_reg_loc): Turn a location descriptor into a memory address. + (maybe_normalize_reg_loc): Only normalize a descriptor if it falls + within a specified PC offset range. + (get_real_reg_value): Given a register location, retrieve its value. + (set_real_reg_value): Change the value of a register location. + (copy_reg_value): Copy reg values, if needed. + (copy_saved_reg_state): Copy all registers that need to be copied. + (process_state_between): Normalize all frame register records that + fall within the specified PC range. + (frame_translate): Take a processed frame description, and turn + everything into addresses. + (build_ia64_frame_state ): Find and create frame state record for a PC. + (get_personality): Get the personality routine for a given frame. + (get_except_table): Get the exception table for a given frame. + (record_name): Unwind record names for debugging. + (print_record): Print and unwind record. + (print_all_records): Print an entire unwind image. + (__ia64_backtrace): Print a backtrace. + (ia64_backtrace_helper): New function. + (__register_frame_info_aux): New function. + * config/ia64/crtend.asm (__do_frame_setup_aux): New function. + + * frame.h (enum unw_record_type): New unwind record types. + (struct unw_p_record, unw_b_record, unw_x_record) : New unwind records. + (struct unw_r_record, unwind_record): New unwind record structs. + (struct unwind_info_ptr): Unwind information layout. + (IA64_UNW_LOC_TYPE_*): Macros for different types for location + descriptors. + (struct ia64_reg_loc): Register location description. + (struct ia64_frame_state): Location of all registers in a frame. + (struct object): Add pc_base and fde_end for IA64_UNWIND_INFO. + * libgcc2.c (__ia64_personality_v1): Personality routine. + (__calc_caller_bsp): Calculate the bsp register for the caller's + frame. + (ia64_throw_helper): Figure out who to return to and set up the + registers. + (__throw): Throw routine. + + * output.h (assemble_eh_align, assemble_eh_label): New functions + to generate EH info where we want it. + (assemble_eh_integer): New function. + * toplev.c (compile_file): Output module level exception table for + non-ia64 targets. + (main): Set exceptions_via_longjump and flag_new_exceptions based + on IA64_UNWIND_INFO too. + + * varasm.c (assemble_eh_label): Generate a label via + ASM_OUTPUT_EH_LABEL if it has been specified. + (assemble_eh_align): Generate an alignment directive via + ASM_OUTPUT_EH_ALIGN if it has been specified. + (assemble_eh_label): Generate an integer value via + ASM_OUTPUT_EH_type if they have been specified. + * config/ia64/ia64.c (rtx_needs_barrier): Add flushrs. + (ia64_init_builtins): Add __builtin_ia64_bsp + and __builtin_ia64_flushrs. + (ia64_expand_builtin): Add IA64_BUILTIN_BSP and + IA64_BUILTIN_FLUSHRS. + * config/ia64/ia64.h (ia64_builtins): Add IA64_BUILTIN_BSP and + IA64_BUILTIN_FLUSHRS. + + * config/ia64/ia64.md (flushrs): New insn to flush the register + stack. Add to unspec list. + + * config/ia64/crtbegin.asm (frame_object): Change size. + (__do_frame_setup_aux): New function. + * config/ia64/crtend.asm: call __do_frame_setup_aux. + * config/ia64/t-ia64 (LIB2ADDEH): Add. + * Makefile.in (LIB2ADDEH): Add. + (LIB2ADD): Use LIB2ADDEH. + +2000-05-24 Richard Henderson + + * recog.c (offsettable_address_p): If mode size is zero, assume + BIGGEST_ALIGNMENT. + +2000-05-24 J. David Anglin + + * configure.in: Check for -Wno-long-long option support and improve + handling of warning CFLAGS for stages 1 and 2. + * Makefile.in (WARN_CFLAGS): Move definition to configure.in. + * configure: Regenerate. + +Wed May 24 19:37:53 2000 Jeffrey A Law (law@cygnus.com) + + * gcc.texi: Remove contributor list. Instead include contrib.texi. + * contrib.texi: New file. + +Thu May 25 02:27:22 2000 J"orn Rennecke + + * loop.c (basic_induction_var): Avoid double recording of an increment. + +Thu May 25 02:19:27 2000 J"orn Rennecke + + * Back out this patch: + Tue Dec 7 19:22:06 1999 Richard Henderson + * loop.h (struct induction): Add multi_insn_incr. + * loop.c (basic_induction_var): New multi_insn_incr argument. + Set it if we search back through previous insns for the biv. + (record_biv): New multi_insn_incr argument; fill in struct induction. + (strength_reduce): Discard an iv with multiple bivs, any of + which require multiple insns to increment. + + * loop.c (check_insn_for_bivs): Remove bits copied from above patch. + +Thu May 25 02:09:10 2000 J"orn Rennecke + + * rtl.h (loc_mentioned_in_p): Declare. + * reload.c (loc_mentioned_in_p): Moved from here... + * rtlanal.c (loc_mentioned_in_p): to here. No longer static. + Fix loop increment for 'E' handling. + * loop.c (strength_reduce): When doing biv->giv conversion, + take multi-insn biv increments into account. + +2000-05-24 Jason Merrill + + * stmt.c (expand_end_bindings): Look through NOTEs to find a + BARRIER. + +2000-05-24 Mark Mitchell + + * calls.c (expand_call): Handle cleanups in tail-recursion + arguments analogously to cleanups in sibling calls. + +2000-05-24 Kaveh R. Ghazi + + * simplify-rtx.c: Rename macro SIGN_EXTEND to HWI_SIGN_EXTEND. + All callers changed. + +2000-05-24 Alexandre Oliva + + * expr.c (expand_assignment, store_expr, expand_expr, + expand_expr_unaligned): Set in_check_memory_usage while emitting + chkr_check_addr libcall. + +2000-05-24 Nick Clifton + + * fold-const.c (extract_muldiv): When constructing a + multiplier/divisor, do not expect const_binop to correctly + determine if overflow has occurred, so check explicitly. + +2000-05-24 Alexandre Oliva + + * c-decl.c (build_enumerator): Don't modify the value's type, + convert it. + +2000-05-24 Andreas Jaeger + + * mips.h (LINKER_ENDIAN_SPEC): Pass -EL to linker by default. + +2000-05-24 Eric Christopher + + * configure.in: Redefine inhibit_libc conditions. + * libgcc2.c: Remove inhibit_libc conditional define. + * configure: Regenerate. + +2000-05-24 Phil Edwards + + * configure.in: For --enable-languages=LIST, check for empty LIST. + * configure: Regenerate. + +2000-05-24 Lars Brinkhoff + + * pdp11.h (STACK_BOUNDARY): Define. + +2000-05-24 Jakub Jelinek + + * ifcvt.c (if_convert): Update life info globally. + +2000-05-24 Alexandre Oliva + + * emit-rtl.c (unshare_all_decls): New function. + (unshare_all_rtl): Call it. + +2000-05-23 Nick Clifton + + * configure.in: Treat 'strongarm' as if it were 'arm' when + determining cpu type. + + * configure: Regenerate. + + * config/arm/arm.c: Change 'char *' to 'const char *' for cases + where constant strings are involved. + + * config/arm/arm.h (arm_condition_codes): Change type to 'const + char *'. + + * config/arm/arm-protos.h: Change 'char *' to 'const char *' for + cases where constant strings are involved. + +Tue May 23 15:08:31 2000 Clinton Popetz + + * config/sh/sh.c (gen_far_branch, split_branches): Update + to reflect new prototypes for redirect_jump and invert_jump. + (sh_insn_length_adjustment): Get rid of const warnings. + +2000-05-23 Kazu Hirata + + * invoke.texi (Options for Debugging Your Program or GCC): Update + the names of dump files. + +Tue May 23 13:58:52 2000 Philippe De Muyter + + * configure.in (NO_MINUS_C_MINUS_O): Fix thinko in previous fix. + * configure: Regenerated. + +2000-05-23 Zack Weinberg + + * simplify-rtx.c (SIGN_EXTEND): New macro. + (simplify_unary_operation, simplify_binary_operation, + simplify_relational_operation): Use SIGN_EXTEND. Make low + halves of (low, high) pairs unsigned if they weren't already. + (simplify_ternary_operation): Cast INTVAL to unsigned before + comparing to a MODE_BITSIZE. + +2000-05-23 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_CHECK_DECL, gcc_AC_CHECK_DECLS): New macros + rewritten from the internals of gcc_AC_NEED_DECLARATION{S}. + + * configure.in (gcc_AC_CHECK_DECLS): Call this instead of + gcc_AC_NEED_DECLARATIONS. + + * dwarfout.c: Don't prototype time(). + + * gcc.c: Check HAVE_DECL_* instead of NEED_DECLARATION_*. + + * system.h: Likewise. + + * toplev.c: Likewise. + +2000-05-23 Zack Weinberg + + * c-decl.c (pushdecl): Invert sense of test for non-global types. + +Tue May 23 18:11:42 2000 J"orn Rennecke + + * reload1.c (reload_cse_move2add): Honor TRULY_NOOP_TRUNCATION. + +2000-05-23 Jonathan Larmour + + * config/mips/elf64.h (CTOR_LISTS_DEFINED_EXTERNALLY): Define + +Tue May 23 06:50:29 2000 Richard Kenner + + * config/alpha/alpha.c: Remove #ifdef HAIFA since now only scheduler. + (alpha_start_function): Never write ..ng label if VMS or NT. + (alpha_align_insns): Remove GP_IN_USE arg. + Alignment now unsigned. + (alpha_reorg): Don't pass GP_IN_USE arg to alpha_align_insns. + * config/alpha/alpha.md (prologue_ldgp): Split into one define_expand + and two define_insn's. + +2000-05-22 Richard Henderson + + * combine.c (simplify_comparison): Use trunc_int_for_mode. + +2000-05-22 Richard Henderson + + * stor-layout.c (place_field): Change rli->size to rli->offset. + +2000-05-22 Richard Henderson + + * function.c (thread_prologue_and_epilogue_insns): Make sure + existing line number notes appear after the prologue. + +Mon May 22 21:49:00 2000 Richard Kenner + + * config/alpha/alpha.c (alpha_fnname): New static variable. + (print_operand, case '~'): New case. + (alpha_expand_prologue): Emit prologue_ldgp insn if needed. + (alpha_start_function): Set alpha_fnname. + Write "ng" label if no ldgp; don't write ldgp insn. + * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): New case '~'. + * config/alpha/alpha.md (prologue_ldgp): New define_insn. + +Mon May 22 11:30:48 2000 Clinton Popetz + + * jump.c (jump_optimize_1): Don't increment LABEL_NUSES + on deleted labels. + +2000-05-22 Zack Weinberg + + * varasm.c (eh_frame_section): Revert change to argument list. + +Mon May 22 13:14:03 2000 Richard Kenner + + * optabs.c (can_extend_p): Allow unsignedp to have any nonzero value. + (gen_extend_insn, can_fix_p, can_float_p): Likewise. + + * final.c (final_scan_insn, case NOTE_INSN_FUNCTION_BEG): Remove + dangling "else" that causes "break" to be conditional. + Also remove unneeded code at start. + +Mon May 22 17:31:35 2000 Philippe De Muyter + + * m68k/m68k.h (STORE_FLAG_VALUE): Macro set to (-1), not -1. + * fx80/fx80.h, i370/i370.h, m88k/m88k.h (STORE_FLAG_VALUE): Ditto. + * gmicro/gmicro.h, we32k/we32k.h (STORE_FLAG_VALUE): Ditto. + +2000-05-22 Jakub Jelinek + + * config/sparc/sparc.md (movdf_insn_v9only_vis): fzero has + just one argument. + +Mon May 22 06:57:49 2000 Richard Kenner + + * alias.c (record_component_aliases): New function. + * tree.h: Clean up some declarations and comments. + (record_component_aliases): New declaration. + * tree.c (get_alias_set): If type and has alias set, use it. + +2000-05-22 Richard Henderson + + * simplify-rtx.c (simplify_ternary_operation): Try to simplify + IF_THEN_ELSE to a setcc form. + * jump.c (can_reverse_comparison_p): Be prepared for insn null. + +2000-05-21 Kaveh R. Ghazi + + * fixinc/inclhack.def (sun_malloc): Handle `calloc'. + (sun_malloc, sysz_stdtypes_for_sun): Add test_text. + +Sun May 21 16:42:31 2000 Richard Kenner + + * combine.c (try_combine): Handle i3_subst_into_i2 case when I2 is + not a PARALLEL. + +2000-05-20 Alexandre Oliva + + * config/mn10300/mn10300.md (movdi, movdf): 64-bit clean-up. + * config/mn10300/mn10300.c (print_operand): Likewise. + + * final.c (split_double): Right shift of negative values is not + portable. + + * ifcvt.c (if_convert): Scan and kill dead code. + + * emit-rtl.c (unshare_all_rtl): Store the copied rtx. + +2000-05-20 Zack Weinberg + + * diagnostic.c: Eliminate implicit int. + * except.c, gcc.c: Add static prototypes. + * final.c (final_end_function): Mark file arg ATTRIBUTE_UNUSED. + * gensupport.c (process_rtx): Use XVEC to initialize vector + slot of 'split'. + + * print-rtl.c: If DEBUG_REGISTER_NAMES, define static + debug_reg_names instead of static reg_names. If not, define + global reg_names. + * regclass.c: Don't define global reg_names unless + DEBUG_REGISTER_NAMES is defined. + + * reload1.c (order_regs_for_reload): Remove unused variable. + * varasm.c: Include output.h after defaults.h. Define + eh_frame_section as function of no args, not of unspecified args. + + * gcc.c: Constify argbuf; arguments to store_arg, + process_command, main; elements of struct command and struct + switchstr; local variables in execute, process_command, main. + +2000-05-20 Bruce Korb + + * fixinc/inclhack.def: many applications of c_fix=format + tests + * fixinc/check.diff: regenerated + * fixinc/fixincl.x: regenerated + +Sat May 20 09:30:55 2000 Richard Kenner + + * alias.c: Clarify some comments. + (record_base_value): REGNO is unsigned. + * rtl.h (record_base_value): Likewise. + + * alias.c (aliases_everything_p): Don't special-case QImode here. + * c-common.c (c_get_alias_set): Do it here. + Handle BIT_FIELD_REF by getting alias info for arg. + Use POINTER_TYPE_P. + +2000-05-20 Alexandre Oliva + + * mklibgcc.in: Restore rule to create ${dir}. + +Sat May 20 08:45:41 2000 H.J. Lu + + * Makefile.in (libgcc.mk): Depend on xgcc$(exeext) for + GCC_FOR_TARGET used by MULTILIBS. + * mklibgcc.in: Make sure each .o file depends on the + directory it will be in. + Make the multilib directory depends libgcc. + +Sat May 20 08:29:28 2000 H.J. Lu + + * Makefile.in (bootstrap): Unset LANG_LIB2FUNCS for stage 1. + +Sat May 20 07:27:35 2000 Alexandre Oliva + + * fold-const.c (make_range): Handle degenerated intervals. + Fixes c-torture/execute/991221-1.c + +Fri May 19 18:16:31 2000 Richard Kenner + + * cse.c (cse_basic_block): Only call find_reg_note if REG_NOTES not 0. + * reload.c (find_equiv_reg): Likewise. + * alias.c (init_alias_analysis): Likewise. + Only call prologue_epilogue_contains on insns. + * basic-block.h (REG_SET_TO_HARD_REG_SET): Call new function. + * bb-reorder.c (hard-reg-set.h): Include earlier. + * haifa-sched.c (hard-reg-set.h): Likewise. + * ifcvt.c (hard-reg-set.h): Likewise. + * local-alloc.c (hard-reg-set.h): Likewise. + * loop.c (hard-reg-set.h): Likewise. + * predict.c (hard-reg-set.h): Likewise. + * regrename.c (hard-reg-set.h): Likewise. + * flow.c (hard-reg-set.h): Likewise. + (reg_set_to_hard_reg_set): New function. + * bitmap.c (regs.h, basic-block.h): No longer include. + (bitmap.h): Now include. + * conflict.c (hard-reg-set.h): Include. + * profile.c (hard-reg-set.h): Likewise. + * print-rtl.c (hard-reg-set.h): Likewise. + * sbitmap.c (hard-reg-set.h): Likewise. + * toplev.c (hard-reg-set.h): Likewise. + * unroll.c (hard-reg-set.h, basic-block.h): Likewise. + * hard-reg-set.h (reg_names): Now constant. + * regs.h (reg_names): Likewise. + * regclass.c (reg_names): Likewise. + * loop.h (basic-block.h): No longer include. + (bitmap.h): Now include. + * reload1.c (order_regs_for_reload): Avoid loop over reg sets. + * Makefile.in (LOOP_H, sbitmap.o, profile.o): Reflect above changes. + (toplev.o, print-rtl.o, conflict.o, unroll.o, bitmap.o): Likewise. + +2000-05-19 Jan Hubicka + Richard Henderson + + * basic-block.h (struct edge_def): New field "count". + (struct basic_block_def): Likewise. + * flow.c (entry_exit_blocks): Add count fileds. + (split_edge): Keep count information up-to-date. + (dump_edge_info, dump_flow_info): Dump count fields. + + * final.c (count_instrumented_edges): Rename to edge from arc. + (end_final): Update users. + * profile.c: Include expr.h, basic-block.h. + (struct adj_list, ARC_TARGET, ARC_SOURCE, ARC_COUNT): Kill. + (struct bb_info, label_to_bb, label_to_bb_size, bb_graph): Kill. + (ignore_next_note, return_label_execution_count): Kill. + (bbg_file_name, da_file_name): Kill. + (edge_info, bb_info): New structures. + (EDGE_INFO, BB_INFO, GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): New macros. + (count_instrumented_edges, total_num_edges): Rename to edge from arc. + (total_num_edges_instrumented): Likewise. + (init_arc, expand_spanning_tree): Kill. + (fill_spanning_tree, tablejump_entry_p): Kill. + (instrument_edges): Rewrite from instrument_arcs to use + commit_edge_insertions infrastructure. + (compute_branch_probabilities): Remove arguments; rewrite for + CFG infrastructure; use rtl_dump_file directly. + (branch_prob, find_spanning_tree): Likewise. + (union_groups, find_group): New. + (init_branch_prob): Make bbg_file_name and da_file_name local. + (end_branch_prob): Use rtl_dump_file directly. + (init_edge_profiler): Rename to edge from arc. + (output_arc_profiler): Kill. + (gen_edge_profiler): New. + (output_func_start_profiler): Turn off profiling. Make the + constructor static when we can. + * rtl.h (branch_prob, end_branch_prob): Update prototypes. + + * toplev.c (DFI_flow): Remove. + (DFI_cfg, DFI_life): New. + (dump_file): Update accordingly. + (compile_file): Call end_branch_prob if profile_arc_flag too. + (rest_of_compilation): Move flow1 cfg creation to DFI_cfg. Do edge + profiling after the CFG is built. Move flow1 life analysis to + DFI_life. Always estimate remaining probabilities. + +2000-05-19 Richard Henderson + + * ifcvt.c (find_if_case_2): Don't allow THEN to be EXIT. + + * flow.c (make_edges): The sibling call edge to exit is abnormal. + +2000-05-19 Richard Henderson + + * jump.c (redirect_jump): Add delete_unused argument. Don't + remove labels and code following when LABEL_NUSES goes to zero. + (invert_jump): Likewise. + (jump_optimize_1): Fix redirect/invert arguments. + (do_cross_jump, thread_jumps): Likewise. + * flow.c (split_edge): Likewise. + * reorg.c (optimize_skip): Likewise. + (reorg_redirect_jump, relax_delay_slots, dbr_schedule): Likewise. + * profile.c (instrument_arcs): Likewise. + * loop.c (find_and_verify_loops): Likewise. Fix indentation. + * rtl.h: Update prototypes. + +Fri May 19 12:05:13 2000 Clinton Popetz + + * ssa.c (convert_from_ssa): Tell life_analysis we need death + notes. + (make_regs_equivalent_over_bad_edges): Only look at abnormal + critical edges. + +2000-05-19 Zack Weinberg + + * cpphash.c (funlike_macroexpand): Make sure not to walk p1 + past l1 when deleting whitespace and markers. + + * cpplex.c (_cpp_scan_until): Clear AUX field of tokens. + * cpplib.c (do_unassert): Put the list to compare against on + the stack. + +2000-05-19 Bruce Korb + + * fixinc/README: cleaned up old documentation + * fixinc/check.diff: regenerated & verified on OSR5 on ix86 + * fixinc/check.tpl: compute the list of needed directories + emit "#if defined(name)" because of conflict + omit machine name differences from output differences + * fixinc/inclhack.def( m88k_multi_incl ): Use `wrap' function + (machine_name): change test text to use `sed' markers + * fixinc/fixincl.x: regen + +Fri May 19 06:49:35 2000 Richard Kenner + + * config/elfos.h (SELECT_SECTION): Don't access DECL_INITIAL of + a CONSTRUCTOR. + +2000-05-18 Chris Demetriou + + * gcc.texi (MULTILIB_EXCEPTIONS): Correct example and update + it to match the current practice. + +2000-05-18 Mark Mitchell + + * Makefile.in (STAGESTUFF): Fix typo in spelling of s-under. + +2000-05-18 Richard Henderson + + * rtlanal.c (insn_dependant_p, insn_dependant_p_1): New. + * rtl.h (insn_dependant_p): Declare it. + * loop.c (strength_reduce): Use it. + +2000-05-18 Alexandre Oliva + + * config/mn10300/mn10300.c (expand_prologue, expand_epilogue): + 16-bit and 64-bit clean-up. + +2000-05-18 Mark Elbrecht + + * configure.in (*-pc-msdosdjgpp): Set float_format to none. + * configure: Rebuilt. + +2000-05-18 Zack Weinberg + + * genopinit.c: Use $ for escape sequences in optab patterns. + Remove backslashes from optab patterns. Change $A, $B, $C to + expand to (int) whatever instead of just whatever; remove + explicit (int) from all optab patterns. + + * gensupport.c (xmalloc, xrealloc, xstrdup): Provide. + * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c, + genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c, + genrecog.c: Remove private copies of xmalloc, xrealloc, and + xstrdup. + +2000-05-18 Richard Henderson + + * jump.c (jump_optimize_1): Base minimum insn count during + find_cross_jump on BRANCH_COST. + +2000-05-18 Jakub Jelinek + + * print-rtl.c (print_rtx): Only print note line number as string + if between NOTE_INSN_BIAS and NOTE_INSN_MAX. + * final.c (final_scan_insn): Do nothing for note line number 0. + +2000-05-18 Jakub Jelinek + + * gcc-common.c (ggc_mark_rtx_children): Mark NOTE_EXPECTED_VALUE + from NOTE_INSN_EXPECTED_VALUE notes and NOTE_SOURCE_FILE from + NOTE_INSN_DELETED_LABEL. + +2000-05-18 Nick Clifton + + * config/arm/unknown-elf.h (UNIQUE_SECTION): Place constant, + uninitialized data in .rodata not .bss, and do not interpret an + error in the initialisation value as meaning that the variable + should be placed in the .bss section. + +Thu May 18 12:10:18 2000 Philippe De Muyter + + * configure.in (NO_MINUS_C_MINUS_O): Test `$ac_cv_prog_cc_${ac_cc}_c_o', + not `$ac_cv_prog_cc_cc_c_o'. + * configure: Regenerated. + +2000-05-18 Chris Demetriou + Richard Henderson + + * c-common.h (enum c_tree_index): Add g77 type entries. + (g77_integer_type_node, g77_uinteger_type_node): New. + (g77_longint_type_node, g77_ulongint_type_node): New. + * c-decl.c (init_decl_processing): Initialize them. + +2000-05-18 Richard Henderson + + * config/h8300/h8300.md (subs patterns): Use %G to negate. + + * config/h8300/h8300.c (ok_for_bclr): Take a HOST_WIDE_INT. + (small_power_of_two): Likewise; use exact_log2. + (adds_subs_operand, one_insn_adds_subs_operand): Remove. + (output_adds_subs): Remove. + (two_insn_adds_subs_operand): New. + (split_adds_subs): New. + * config/h8300/h8300-protos.h: Update. + * config/h8300/h8300.h (CONST_OK_FOR_J): Cast to uns HOST_WIDE_INT. + (CONST_OK_FOR_L): Match strict adds operands. + (CONST_OK_FOR_N): Match struct subs operands. + * config/h8300/h8300.md (adds_subs insns): Remove. + (addhi patterns): Output adds/subs directly. + (addsi_h8300h): Likewise. + (addhi/addsi splitters): New. Decompose two_insn_adds_subs_operand. + +2000-05-18 Zack Weinberg + + * cppexp.c (parse_assertion): New. + (lex): Call it for CPP_HASH. Remove CPP_ASSERTION case. + (_cpp_parse_expr): Remove case '#'. Don't set + parsing_if_directive. + * cpphash.c (collect_objlike_expansion, + collect_funlike_expansion, collect_params, + _cpp_create_definition): The list no longer has a trailing + VSPACE token. + * cpphash.h (enum node_type): Add T_ASSERTION. + (struct hashnode): Remove aschain, add pred. + (struct predicate): New. + Update prototypes. + + * cpplex.c (expand_token_space): Handle both offset and + nonoffset lists. + (init_token_list, _cpp_free_token_list, _cpp_parse_assertion): Delete. + (_cpp_init_toklist, _cpp_clear_toklist, _cpp_free_toklist, + _cpp_slice_toklist, _cpp_squeeze_toklist, _cpp_equiv_tokens, + _cpp_equiv_toklists): New. + (_cpp_scan_line): Rename to _cpp_scan_until; add ability to + stop at any single-character token, not just newline. + (_cpp_lex_token): Remove special cases for #define and #if. + (cpp_get_token): Expect # as a separate token type. Remove + DIRECTIVE case. + (_cpp_get_directive_token): Remove DIRECTIVE case. + (_cpp_lex_line, _cpp_lex_file, _cpp_init_input_buffer): Update. + + * cpplib.c (_cpp_check_directive): Set dirno and + SYNTAX_INCLUDE bit of flags, not dir_handler and dir_flags. + (_cpp_handle_directive): Run # through the same logic + as normal directives. + (do_define): Don't set parsing_define_directive. Use + _cpp_scan_until. The list does not have a VSPACE at the end. + (do_if): Save, clear, and restore only_seen_white around + _cpp_parse_expr. + (skip_if_group): s/CPP_DIRECTIVE/CPP_HASH/ + (do_assert, do_unassert): Rewrite. + + * cpplib.h (TTYPE_TABLE): Remove CPP_ASSERTION. + (LIST_OFFSET): New flag. + (struct cpp_toklist): Replace dir_handler and dir_flags with + dirno and flags. + (struct cpp_reader): Remove parsing_if_directive and + parsing_define_directive. + +2000-05-18 Kaveh R. Ghazi + + * fixinc/inclhack.def (broken_cabs): Update fix to handle comments + following the cabs decl which terminate on the following line. + Add the corresponding test_text case. + +2000-05-18 Neil Booth + + * cppinit.c (cpp_reader_init): Initialize col_adjust and + default tab stop size. + (no_num, OPT_ftabstop): New. + (handle_option): Handle "ftabstop=" command-line option. + (print_help): Document it. + * cpplex.c (COLUMN): Remove. + (handle_newline): Reset col_adjust. + (skip_whitespace): Update col_adjust as tabs encountered. + (_cpp_lex_line): Update to use col_adjust. Call + skip_whitespace for all whitespace. + * cpplib.h (struct cpp_options): New member tabstop. + (struct cpp_reader): New member col_adjust. + (CPP_BUF_COL): Update. + (CPP_BUF_COLUMN): New. + * cpp.texi: Document "-ftabstop=" command line option. + +Wed May 17 18:19:41 2000 Philippe De Muyter + + * configure.in (NO_MINUS_C_MINUS_O): Macro made availabe for AC_OUTPUT + files. + * configure: Rebuilt. + +Wed May 17 18:06:12 2000 John David Anglin + + * mklibgcc.in Add missing -DL$name when compiling modules in libgcc1.c. + + * tree.c (build_common_tree_nodes): Do not build TI nodes unless + HOST_BITS_PER_WIDE_INT is >= 64. + +2000-05-17 Richard Henderson + + * jump.c (jump_optimize_1): Remove inactive but real insns + in jump-to-next-insn optimization. + +2000-05-17 Richard Henderson + + * toplev.c (rest_of_compilation): Don't call optimize_mode_switching + unless OPTIMIZE_MODE_SWITCHING. Conditionally set no_new_pseudos. + Don't call recompute_reg_usage if no_new_pseudos is true. + * lcm.c (optimize_mode_switching): Move ifdefs outside function. + Return true if we did work; update global life information. + * basic-block.h (optimize_mode_switching): Update decl. + +2000-05-17 Neil Booth + + * cpplex.c (expand_name_space): Don't use ptrdiff_t. + +2000-05-17 Zack Weinberg + + * cpplib.c: New feature, #pragma system_header. + * cpp.texi: Document special treatment of system headers, and + the various mechanisms to get a header that special treatment. + +2000-05-17 Kaveh R. Ghazi + + * system.h (offsetof): Define at the very end, to ensure we prefer + the platform's definition if available. + +2000-05-16 Bruce Korb + + * fixinc/fixincl.c: improve the debug displays, ignore SIGPIPE + * fixinc/server.c: likewise + * fixinc/fixfixes.c( char_macro_def_fix ): fix regex + + #ifdef debugging code + use #def constant for + sub-pattern count + * fixinc/inclhack.def( hpux11_fabsf ): Keep HP-UX 11 from stomping + on C++ math namespace + +2000-05-17 Kaveh R. Ghazi + + * fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix): + Don't check the return value of sprintf. Use asprintf to avoid + buffer overflows. + +Wed May 17 17:27:44 2000 Andrew Cagney + + * flags.h (warn_unused_function, warn_unused_label, + warn_unused_parameter, warn_unused_variable, warn_unused_value): + Replace ``warn_unused''. + (set_Wunused): Add declaration. + * toplev.c (set_Wunused): New function. + (warn_unused_function, warn_unused_label, warn_unused_parameter, + warn_unused_variable, warn_unused_value): New variables. + (W_options): Add -Wunused-function, -Wunused-function, + -Wunused-label, -Wunused-parameter, -Wunused-variable and + -Wunused-value. Delete -Wunused. Handled in decode_W_option. + + * toplev.c (decode_W_option): Update -Wunused flags by calling + set_Wunused. + * c-decl.c (c_decode_option): Ditto for -Wall. + + * stmt.c (expand_expr_stmt, expand_expr_stmt, + warn_about_unused_variables): Replace warn_unused with more + explicit warn_unused_value et.al. + * function.c (expand_function_end): Ditto. + * c-typeck.c (internal_build_compound_expr, + internal_build_compound_expr): Ditto. + * c-decl.c (poplevel, pop_label_level): Ditto. + * toplev.c (check_global_declarations): Replace warn_unused with + check for either warn_unused_function or warn_unused_variable. + + * gcc.1, invoke.texi (Warning Options): Document + -Wunused-function, -Wunused-function, -Wunused-label, + -Wunused-parameter, -Wunused-variable and -Wunused-value options. + +Wed May 17 10:28:12 2000 Philippe De Muyter + + * mklibgcc.in (building libgcc1) [Xlibgcc1.a]: Find libgcc1.c in + $(srcdir), not in the current directory. + +2000-05-16 Richard Henderson + + * config/ia64/crtbegin.asm (__dso_handle): Mark hidden if the + assembler supports it. + (.fini, .init): Use a gp-relative indirect call. + (__do_global_dtors_aux): Preserve the gp; rebundle. + (__do_frame_setup): Likewise. + * config/ia64/crtend.asm (.IA_64.unwind): Don't terminate with -1. + (.init): Use a gp-relative indirect call. + (__do_global_ctors_aux): Preserve the gp. + +2000-05-16 Richard Henderson + + * flow.c (commit_one_edge_insertion): Be prepared for a return + insn to be inserted on the edge with a normal jump. + * jump.c (jump_optimize_1): Don't look to create return isns. + + * flow.c (flow_delete_insn): Don't adjust reference count of notes. + * jump.c (jump_optimize_1): Likewise. + (returnjump_p): Verify the argument is a JUMP_INSN. + * rtl.def (NOTE): Add 5th element for NOTE_INSN_DELETED_LABEL. + +2000-05-16 Nick Clifton + + * config/m32r/m32r.c (small_insn_p): Use INSN_P() to replace + GET_RTX_CLASS (GET_CODE ()) == 'i'. + (large_insn_p): Ditto. + (m32r_is_insn): New function: Return true if the insn contains + an executable instruction. + (m32r_adjust_insn): Use m32r_is_insn. + (m32r_sched_reorder): Use m32r_is_insn. + (m32r_sched_variable_issue): Use m32r_is_insn. + +2000-05-16 Franz Sirl + + * rs6000/rs6000.c (rs6000_select_section): Treat CONSTRUCTOR like + VAR_DECL. + + * rs6000/sysv4.h (ASM_OUTPUT_DWARF_ADDR): Delete unused variable. + + * rs6000/sysv4.h (CPP_OS_LINUX_SPEC): Define __unix and __linux + according to given options. + +Tue May 16 12:17:31 2000 Jeffrey A Law (law@cygnus.com) + + * mn10200.h (PREFERRED_RELOAD_CLASS): Do not prefer DATA_REGS + if X has VOIDmode either. + (LIMIT_RELOAD_CLASS): Similarly. + + * mn10200.md (indirect_jump, tablejump): Use "register_operand", + not "general_operand" to match the processor's capabilities. + +2000-05-16 Bruce Korb + + * fixinc/README: corrected return address + * fixinc/check.diff: regenerate, now that test works + * fixinc/fixfixes.c(format_fix,format_write): reformatted + (char_macro_def_fix,char_macro_use_fix): corrected and + rewrote to use regex to parse the text + * fixinc/inclhack.def: more testing + * fixinc/fixincl.x: regenerated + + * fixinc/inclhack.def: added several "test_text" attributes + changed several fixes to use `c_fix = format' + re-alphabetized the fixes + + * fixinc/check.diff: regenerate + * fixinc/fixincl.x: regenerate + * fixinc/check.tpl: added `sparc' and `netinet' to the list + of created dirs + + +2000-05-16 Alexandre Oliva + + * config/mn10300/mn10300.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Remove. + +2000-05-15 Richard Henderson + + * toplev.c (rest_of_compilation): Run full jump pass before + find_basic_blocks of flow2. + +2000-05-15 Richard Henderson + + * jump.c: Fix typos and clarify commentary from last change. + (any_condjump_p): Verify SET_SRC is an IF_THEN_ELSE. + (safe_to_remove_jump_p): Remove. + (condjump_label): Use pc_set. + +2000-05-15 Richard Henderson + + * ifcvt.c (cond_exec_process_insns): Drop USE and CLOBBER insns + that get in the way after reload. + (cond_exec_process_if_block): Skip a label heading THEN block. + +2000-05-15 Richard Henderson + + * varasm.c (output_constant_pool): Abort instead of converting + (improperly) deleted labels to zero. + +2000-05-16 Neil Booth + + * cpplex.c (parse_string2): Update comment. + (cpp_lex_line): No special assertion treatment for '('. + * cpplib.c (DIRECTIVE_TABLE): Remove SYNTAX_ASSERT. + * cpplib.h (SYNTAX_ASSERT): Remove. + +Mon May 15 21:45:36 MET DST 2000 Jan Hubicka + + * jump.c (condjump_p): Mark as depreached. + (any_condump_p): New. + (any_uncondump_p): New. + (pc_set): New. + (safe_to_remove_jump_p): New. + * rtl.h (any_condump_p, any_uncondjump_p, pc_set + safe_to_remove_jump_p): Declare. + +Mon May 15 21:07:20 MET DST 2000 Jan Hubicka + + * calls.c: Re-install both patches reverted by last patch. + (struct arg_data): New field tail_call_reg. + (initialize_argument_information): Initialize tail_call_reg + (load_register_parameters): New argument flags, use + tail_call_reg when emiting tail call sequence. + (expand_call): Update call of load_register_parameters; + copy unadjusted_args_size to adjusted_args_size. + +Mon May 15 19:01:42 MET DST 2000 Jan Hubicka + + * loop.c (scan_loop, strength_reduce, loop_optimize): Change unroll_p + and bct_p parameters to flags. + * loop.h (LOOP_UNROLL, LOOP_BCT): New constants. + * rtl.h (loop_optimize): Update prototype. + * toplev.c (rest_of_compilation): Update call of loop_optimize. + +2000-05-15 Jakub Jelinek + + * calls.c (expand_call): Move expand_start_target_temps call after + start_sequence(). + +2000-05-15 Neil Booth + + * cpphash.c (trad_stringify, warn_trad_stringify, + collect_params): Make some pointers pointers to const. + * cpplex.c (auto_expand_name_space) Guaranteed to always + expand by at least one character. + (SPELL_CHAR, SPELL_NONE): Temporarily reverse order. + (struct token_spelling): Use const U_CHAR * rather than PTR. + (expand_name_space): Fix up token pointers if name space + is moved when expanding. + (INIT_NAME, cpp_scan_line, parse_name, parse_number, + parse_string2, save_comment, spell_token, cpp_output_list): + Update so the routines handle tokens with a direct pointer to + their text, rather than an offset into the token's list's namebuf. + (_cpp_lex_line): Rearrange for clarity. + + * cpplib.c (_cpp_check_directive): Similarly. + (do_define): Make SYM a pointer to const. + * cpplib.h (struct cpp_name): Replace offset with direct pointer. + (CPP_INT, CPP_FLOAT): Spelling type should be SPELL_IDENT. + (TOK_OFFSET): Delete. + (TOK_NAME): Update. + +2000-05-14 Geoffrey Keating + + * config/rs6000/rs6000.h (RETURN_ADDRESS_OFFSET): Correct for + 64-bit ABI. + + * config/rs6000/rs6000.c (logical_operand): Rewrite to take MODE + into account. + (logical_u_operand): Delete. + (non_logical_cint_operand): Rewrite to take MODE into account. + (non_logical_u_cint_operand): Delete. + (boolean_operator): New function. + (print_operand): Add new %q operand. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add boolean_operator, + remove logical_u_operand and non_logical_u_cint_operand, + update logical_operand and non_logical_cint_operand. + * config/rs6000/rs6000.md: Rewrite the patterns for performing + logical operations to use %q. + + * config/rs6000/rs6000.md (movsi): Don't modify RTL in-place. + (movdi): Make similar to movsi. + * config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): There + is no such thing as a DImode CONST_DOUBLE. + * config/rs6000/rs6000.c (output_toc): Likewise. + + * config/rs6000/rs6000.c (output_cbranch): Don't output prediction + codes when old mnemonics are in use. Print register names + for cc registers when requested. + + * optabs.c (expand_float): Don't allow mode widening that causes + double rounding. + + * invoke.texi (RS/6000 and PowerPC Options): Update -m64/-m32 + flags to their current names -maix64 and -maix32. + +2000-05-14 Bruce Korb + + * fixinc/fixfixes.c(wrap_fix): new fix - inserts text before + and/or after current text of file + * fixinc/fixlib.c(must_malloc): + * fixinc/fixlib.h(must_malloc): + reformatting + * fixinc/inclhack.def: replace the "1i" and "$a" sed commands + with usages of ``c_fix = wrap;'' + Add several tests and use the ``c_fix = format'' fixer more. + * fixinc/fixincl.x: regen + * fixinc/check.diff: regen + * fixinc/check.tpl: emit the associated header with the missing + test message + +Sun May 14 17:58:59 2000 Hans-Peter Nilsson + + * mklibgcc.in (building libgcc1) [Xlibgcc1.a]: Do not use unset + variables $src and $dst. + +2000-05-13 Gabriel Dos Reis + + * diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro. + (DIAGNOSTICS_SHOW_PREFIX_NEVER): Likewise. + (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE): Likewise. + (struct output_buffer: emitted_prefix_p, prefixing_rule): New + fields. + (set_message_prefixing_rule): Declare. + + * diagnostic.c: (current_prefixing_rule): New variable. + (set_message_prefixing_rule): Define. + (output_set_prefix): Adjust buffer->emitted_prefix_p. + (init_output_buffer): Adjust Initialization. + (output_emit_prefix): Rewrite. Take prefixing rules into account. + +Sat May 13 11:05:47 2000 Philippe De Muyter + + * ifcvt.c (if_convert): Do not free NULL. + +2000-05-12 H.J. Lu (hjl@gnu.org) + + * gthr-dce.h: Add support for libobjc. + * gthr-posix.h: Likewise. + * gthr-solaris.h: Likewise. + * gthr-vxworks.h: Likewise. + * gthr-single.h: Likewise. + * gthr-win32.h: Likewise. + +2000-05-12 Nick Clifton + + * config/fr30/fr30.c (fr30_move_double): New function: Emit code + to move a double word value. + (di_operand): New function: Return true if the operand is suitbale + for a double word move operation. + (nonimmediate_di_operand): New function: Return true if the + operand is a DImode register or MEM. + + * config/fr30/fr30.h (PREDICATE_CODES): Add di_operand and + nonimmediate_di_operand. + + * config/fr30/fr30-protos.h Add fr30_move_double, di_operand, and + nonimmediate_di_operand. + + * config/fr30/fr30.md (movdi): New pattern. Required because + other patterns generate DImode results. + (movdi_insn): New pattern. + +2000-05-12 Richard Henderson + + * config/alpha/alpha.c (struct shadow_summary): Define + bitfields as type unsigned int. + +Sat May 13 00:09:59 2000 Denis Chertykov + + * config/avr/t-avr: Added definition of FLOAT while generates + fp-bit.c + + * config/avr/avr.md: `NEXT_INSN (insn)' substituted to `insn' in + peepholes for tst+jump = sbrs/sbrc optimization. + +Fry May 12 20:03:00 CEST 2000 Jan Hubicka + + * expr.c (emit_push_insn): Do not adjust stack pointer when + preallocating. + +Fri May 12 19:03:58 2000 Philippe De Muyter + + * ggc-simple.c (offsetof): Macro fallback definition moved from here .. + * system.h (offsetof): ... to here. + +2000-05-12 Richard Henderson + + * Makefile.in (final.o): Depend on BASIC_BLOCK_H. + * final.c (final_end_function): Use app_disable. Rearrange note + handling into a switch. Emit deleted labels. + (output_asm_label): Generate label strings for deleted labels. + * flow.c (tail_recursion_label_list): New. + (find_basic_blocks_1): Set label_value_list directly. Collect list + of tail recursion labels from call_placeholders. Don't add deleted + labels to the label value list. + (cleanup_cfg): Use free_EXPR_LIST_list. + (flow_delete_insn_chain): Turn non-removable labels into notes. + (flow_delete_block): Don't disable deleting the block because of + a non-removable label. + (tail_recursion_label_p): New. + (merge_blocks_move_predecessor_nojumps): Don't disable the merge + because of a label. + (merge_blocks_move_successor_nojumps): Likewise. Also move a + jump table. + (merge_blocks): Disable a merge because of tail recursion labels. + * ifcvt.c (merge_if_block): Don't disable a merge because of a label. + Use a more accurate measure of not merging the join block. + (find_if_block): Don't disable conversion because of a label. + (find_if_case_1, find_if_case_2): Likewise. + * jump.c (duplicate_loop_exit_test): Preserve the kind of list + element when copying. + (squeeze_notes): Also leave EH notes. + (mark_jump_label): Ignore deleted labels. Use an INSN_LIST for + REG_LABEL notes. + (delete_insn): Preserve LABEL_NAME in NOTE_SOURCE_FILE when + deleting a label. + * print-rtl.c (print_rtx): Print NOTE_SOURCE_FILE for + NOTE_INSN_DELETED_LABEL. Print `[# deleted]' for a label_ref + referring to a deleted label. Convert tail handling to a switch. + * rtl.def (CODE_LABEL): Rearrange elements to be compatible with NOTE + for NOTE_INSN_DELETED_LABEL. + (NOTE): Fix commentary. + * rtl.h (REG_LABEL): Update commentary wrt INSN_LIST. + (REG_CC_SETTER, REG_CC_USER, REG_LIBCALL): Likewise. + (CODE_LABEL_NUMBER, LABEL_NAME): Update index. + (LABEL_NUSES, LABEL_REFS): Likewise. + * unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABEL. + +2000-05-12 Bruce Korb + + * fixinc/fixfixes.c(format_write): buglet & relaxed rules + * fixinc/check.diff: updated + * fixinc/inclhack.def: corrected & added some test_text-s + * fixinc/genfixes: removed unneeded options to autogen invocation + * fixinc/fixincl.tpl: Specified the output file + * fixinc/fixfixes.c: visual appearance + * fixinc/fixincl.x: regenerate + +2000-05-12 Zack Weinberg + + * fixinc/fixfixes.c (IO_use_fix, IO_defn_fix, CTRL_use_fix, + CTRL_defn_fix): Delete. + (fix_char_macro_defines, fix_char_macro_uses): Rename to + char_macro_def_fix and char_macro_use_fix, respectively. Put + them into the FIXUP_TABLE. Get the string to search for from + a c_fix_arg. + + (format_write): New function. + (format_fix): Use it. + + (FIX_PROC_HEAD): Constify text parameter. + (machine_name_fix): Constify all char *s. + * fixtests.c (skip_quote): Remove double static. + + * inclhack.def (io_def_quotes, io_use_quotes, ctrl_def_quotes, + ctrl_use_quotes): Update for new scheme. + * fixincl.x: Regenerate. + +2000-05-12 Alexandre Oliva + + * config/mn10300/mn10300.h (PREFERRED_DEBUGGING_TYPE): Redefine as + DWARF2_DEBUG. + (DWARF2_ASM_LINE_DEBUG_INFO): Define. + (ASM_OUTPUT_DWARF2_ADDR_CONST): Define. + +2000-05-11 Robert Lipe + + * fixinc/inclhack.def (hpux8_bogus_inlines): Delete bypass for SCO. + * fixincl.x: Regenerate. + +2000-05-11 Richard Henderson + + * calls.c: Revert both 05-09 patches. + +2000-05-11 Alexandre Oliva + + * config/mn10300/mn10300.c (print_operand): Print FP constants in + hexadecimal. + * config/mn10300/mn10300.md (movsf, movdf): Use the `F' constraint + for FP values. + + * mklibgcc.in (EQ): Define it to an equal sign in the Makefile, + and replace any occurrences of `=' in multilib dirs with `$(EQ)'. + +2000-05-11 Jason Merrill + + * fixinc/fixincl.c (run_compiles): Don't crash on null pz_machine. + +2000-05-11 Zack Weinberg + + * fixinc/fixfixes.c, fixinc/fixtests.c: Update commentary. + +Thu May 11 22:28:05 2000 Denis Chertykov + + * config/avr/avr-protos.c (jump_over_one_insn_p): New declaration. + * config/avr/avr.c (jump_over_one_insn_p): New function. + * config/avr/avr.md: New peepholes added. Output test and + conditional jump to "sbrc" or "sbrs" command. + +2000-05-11 Mark Elbrecht + + * cppmain.c (main): Use IS_DIR_SEPARATOR. + +2000-05-11 Jakub Jelinek + + * except.c (find_exception_handler_labels_1): New function. + (find_exception_handler_labels): Split into two functions, dive + into CALL_PLACEHOLDERs when looking for exception handler labels. + +2000-05-11 Stan Cox + + * regrename.c (replace_reg_in_block): Improve REG_DEAD handling. + * timevar.def (TV_RENAME_REGISTERS): Move before TV_SCHED2. + * toplev.c (rest_of_compilation): Call regrename_optimize before sched2. + +2000-05-11 Bruce Korb + + * fixinc/fixfixes.c (double_slash_fix): obsolete + (else_endif_label_fix): obsolete + (format_fix): new, unused as yet + (main): obsolete + * fixinc/fixlib.h: added fix description struct for use by format_fix + * fixinc/fixincl.c: removed the struct & test for SIGIOT befure using + * fixinc/Makefile.in: compile fixfixes.c and fixtests.c as separate + modules. Removed the vestiges of the script version. + Added support for "make check". + * fixinc/check.diff: base diff file (needs work!!) + * fixinc/check.tpl: quiet the fixup output + * fixinc/fixtests.c (main): obsolete + * fixinc/fixincl.sh: don't bother copying fixincl to .. + * fixinc/fixincl.tpl: provide for arguments to c_fix routines + +Thu May 11 11:57:02 MET DST 2000 Jan Hubicka + + * toplev.c (rest_of_compilation): Remove dead code after + combine. + +2000-05-11 Zack Weinberg + + * cpphash.c (collect_funlike_expansion): Make "# is not + followed by a macro argument name" a pedwarn, not an error. + Preserve the # in the output. Suppress the warning if lang_asm. + +Thu May 11 01:19:31 2000 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa*64*-*-hpux11*): New target for PA64 support. + * configure: Rebuilt. + +2000-05-10 Laurynas Biveinis + + * i386/xm-djgpp.h (XREF_FILE_NAME): Add mising brace. + +2000-05-10 Kazu Hirata + + * combine.c (try_combine): Fix a typo. + +Wed May 10 21:31:44 2000 Jim Wilson + + * config/ia64/ia64.md (insv): Add comment. + +2000-05-10 Richard Henderson + + * Makefile.in (libgcc.a, stmp-multilib): Depend on FPBIT and DPBIT. + * mklibgcc.in: Rewrite to not use functions. Don't shortcut + dependencies on FPBIT and DPBIT. + +2000-05-10 Nick Clifton + + * flow.c (find_auto_inc): Do not bias REG_N_REFS by loop_depth + when optimising for size. + (mark_used_regs:) Ditto. + (try_pre_increment_1): Ditto. + +2000-05-10 Zack Weinberg + + * cppexp.c (lex): Use %.*s to print non-NUL-terminated string. + Make error message friendlier. + + * cpphash.h (struct hashnode): Use struct hack for name + member. + * cpphash.c (struct hashdummy): New. + (eq_HASHNODE): Second argument is a hashdummy, not a HASHNODE. + (make_HASHNODE): No need to set ->name pointer. Correct + setting of p. + (cpp_lookup): Make 'dummy' a struct hashdummy. Tidy up a bit. + +2000-05-10 Richard Henderson + + * flow.c (find_basic_blocks_1): Remove any spare bb_note + after completion. + +2000-05-10 Bruce Korb + + * fixinc/gnu-regex.c: reg_syntax_t re_syntax_options must be static + +2000-05-10 Eric Schweitz + + * dwarfout.c (dwarfout_finish): Call retry_incomplete_types + after we enter .debug. + +2000-05-10 Jason Merrill + + * dwarf2out.c (gen_subprogram_die): Fixup die_parent for the + abstract instance of a nested inline function. + + * stor-layout.c (finish_record_layout): finalize_type_size + before laying out the pending_statics. + +Wed 10 May 09:36:47 2000 Neil Booth + + * cpplex.c (spell_token): New function. + (spell_string, spell_comment, spell_name): fold into + spell_token. + (I, S): Add macros. + (E, H): Remove macros. + (save_comment): Save comment opening characters too. + (_cpp_lex_file): Update to use spell_token. Tidy up comment + handling. + * cpplib.h (I, S): Add macros. + (E, H): Remove macros. + (TTYPE_TABLE): Update entries for new speller. + (SYNTAX_ASSERT): Remove. + +Wed 10 May 09:08:30 2000 Neil Booth + + * cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag + when removing escaped newlines. Reverse sense of test for + escaped newline. + +2000-05-09 Richard Henderson + + * flow.c (find_basic_blocks_1): Do not delete the first + bb_note we run across. + (create_basic_block): Use reorder_insns to move an existing + bb_note to the correct place. + +2000-05-09 Richard Henderson + + * calls.c (expand_call): Increment currently_expanding_call + before calling optimize_tail_recursion. + +Tue May 9 18:54:16 2000 Richard Kenner + + * reload1.c (reload_combine): Fix errors in last change. + +2000-05-09 Zack Weinberg + + * gcc.c (used_arg): Skip over a semicolon at the end of the + split-up loop; don't break out of it. + + * Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. + (tree.o): Depend on output.h. + + * c-decl.c (pending_invalid_xref_file, + current_function_prototype_file): Constify. + (pushdecl): Constify a local char *. + (define_label): Constify filename parameter. + * c-lex.c (init_parse): Constify parameter and return value. + * c-typeck.c (c_expand_asm_operands): Constify filename parameter. + * c-tree.h: Update prototypes. + * c-parse.in: Constify filename member of %union, and if_stmt_file. + * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, + objc/objc-parse.c: Regenerate. + + * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. + * dwarfout.h: Update prototypes. + * expr.c (expand_expr): Constify a local char *. + * flags.h: Constify main_input_filename. + * function.c (expand_function_end): Constify filename parameter. + * genrecog.c (make_insn_sequence): Use a character array for + c_test_pos. + (main): Remove unused variables. + * input.h: Constify input_filename, main_input_filename, and + file_stack.name. Update prototypes. + * output.h: Declare first_global_object_name and + weak_global_object_name here, as const char *. + * stmt.c (expand_asm_operands): Constify filename parameter. + * toplev.c (compile_file, push_srcloc, debug_start_source_file): + Constify filename parameter. + (input_filename, main_input_filename): Constify. + * toplev.h: Update prototypes. + * tree.c: Include output.h. Don't declare + first_global_object_name or weak_global_object_name. Clean up string + bashing in get_file_function_name_long. + * tree.h (struct tree_decl): Constify filename member. + (input_filename): Constify. + Update prototypes. + * varasm.c (first_global_object_name, weak_global_object_name): + Constify. + (assemble_start_function, assemble_variable): Clean up string bashing. + + * gcc.c: Constify all spec-related strings initialized, + transitively, from string constants. Constify all strings + and string variables related to multilibs. + (set_spec, read_specs): Cast argument to free to PTR. + (used_arg): Do not modify multilib_matches. Use strncmp plus + length comparison to compare multilib switches. + * genmultilib: Constify everything declared in multilib.h. + +Tue May 9 22:28:03 2000 Denis Chertykov + + * flow.c (flow_delete_insn): Use INSN_DELETED_P for marking insn + as deleted. + +Tue May 9 20:52:43 2000 Denis Chertykov + + * config/avr/avr-protos.h (extra_constraint): change a type of + second argument from char to int to avoid warnings. + (asm_output_byte): Likewise. + + * config/avr/avr.c (MAX_LD_OFFSET) New macro. + (initial_elimination_offset): Handle elimination from + FRAME_POINTER_REGNUM to STACK_POINTER_REGNUM. + (legitimate_address_p): Use MAX_LD_OFFSET. + (legitimize_address): Likewise. + (out_movqi_r_mr): Likewise. + (out_movhi_r_mr): Likewise, use `fatal_insn' instead of `fatal'. + (out_movsi_r_mr): Use MAX_LD_OFFSET. + (out_movsi_mr_r): Likewise. + (out_movqi_mr_r): Likewise. + (out_movhi_mr_r): Likewise. + (notice_update_cc): Correct CC for the ashrqi3 with the shift + count as CONST_INT != 6. + (ashlqi3_out): Coding style modifications. Run `fatal_insn' if + shift count is a CONSTANT_P, but not a CONST_INT. + (ashlhi3_out): Coding style modifications. + (ashlsi3_out): Likewise. + (ashrhi3_out): Likewise. + (ashrsi3_out): Likewise. + (lshrhi3_out): Likewise. + (lshrsi3_out): Likewise. + (ashrqi3_out): Generate shift for any known constant count without + scratch register. Run `fatal_insn' if shift count is a CONSTANT_P, + but not a CONST_INT. + (lshrqi3_out): Coding style modifications. Run `fatal_insn' if + shift count is a CONSTANT_P, but not a CONST_INT. + (extra_constraint): change a type of + second argument from char to int to avoid warnings. + (asm_output_byte): Likewise. + (asm_file_end): Output size generated commands count as a hex + number too. + + * config/avr/avr.h (RETURN_ADDR_RTX): New macro. + + * config/avr/avr.md (addhi3): Fragment commented by &&0 is + removed. + (ashlqi3): Values of "length" attribute changed. Shift count + uses constraints 'n' instead of 'i'. + (ashrqi3): Likewise. Values of "cc" attribute changed. Generate + shifts without clobber register. + (lshrqi3): Shift count uses constraints 'n' instead of 'i'. + (call_insn): Correct test for which_alternative == 1 (was 0). + (call_value_insn): Likewise. + + * config/avr/t-avr: Remove definition of FLOAT while generates + fp-bit.c + +2000-05-09 Bruce Korb + + * fixinc/check.tpl: Template for checking fixes + * fixinc/inclhack.def: Added 'test_text' for many fixes + disable hpux8_bogus_inlines on SCO + * fixinc/fixinc.sco: Oh, yes, we don't need this any more. + +Tue May 9 16:30:27 MET DST 2000 Jan Hubicka + + * calls.c (expand_call): Reorganize somewhat in order + to avoid unnecesary recalculation inside loop and make + tail call failure code cleaner. + +Tue May 9 06:30:20 2000 Richard Kenner + + * alias.c (nonlocal_reference_p): Minor reformatting. + * reload.c (find_equiv_reg): Simplify logic for + CALL_INSN_FUNCTION_USAGE since can't have SUBREG or pseudos and + some some reformatting. + * reload1.c (reload_combine): Don't assume everything in + CALL_INSN_FUNCTION_USAGE is a REG and clean up code a bit. + +2000-05-08 Richard Henderson + + * final.c (current_insn_predicate): New. + (final_scan_insn): Set it. + * output.h (current_insn_predicate): Declare. + + * ifcvt.c (cond_exec_process_insns): New argument prob_val. + Attach it to call insns. + (cond_exec_process_if_block): Track probability for true and + false branches. + (dead_or_predicable): Likewise. + + * predict.c (PROB_NEVER, PROB_VERY_UNLIKELY): New. + (PROB_UNLIKELY, PROB_EVEN, PROB_LIKELY): New. + (PROB_VERY_LIKELY, PROB_ALWAYS): New. + (estimate_probability, expected_value_to_br_prob): Use them. + + * config/ia64/ia64-protos.h (ia64_expand_prediction): Declare. + * config/ia64/ia64.c (ia64_print_operand_address): Handle 'j'. + (ia64_expand_prediction): New. + (emit_insn_group_barriers): Don't look at notes. Emit barriers + as needed after calls. + (ia64_epilogue_uses): Mark b0 used. + * config/ia64/ia64.md (beq_true, beq_false): Remove. + (bne_true, bne_false): Remove. + (eq_return, eq_not_return, ne_return, ne_not_return): Remove. + (br_true, br_false): New. Use predicate_operator and + ia64_expand_prediction. + (return_true, return_false): Likewise. + (call_internal): Use ia64_expand_prediction. Don't emit stop bit. + (call_internal1, call_value_internal): Likewise. + (call_value_internal1, call_multiple_values_internal1): Likewise. + + * config/ia64/ia64.c (ia64_direct_return): Require frame size zero. + + * config/ia64/ia64.md (extendsfdf2): Split only after reload. + +2000-05-08 Richard Henderson + + * rtlanal.c (may_trap_p): Consider old-style and volatile + asms to trap. + +Mon May 8 17:16:48 2000 Jim Wilson + + * config/ia64/ia64.h (RETURN_ADDR_RTX): Use COUNT not count. + +2000-05-08 Richard Henderson + + * config/ia64/ia64.h (predicate_operator): Declare. + + * config/ia64/ia64.md (extendsfdf2): Split the nop case out + of existence. + + * gensupport.c (process_rtx): Copy and post-process each member + of the define_insn rtvec individually. + +Mon 8 May 22:17:35 2000 Neil Booth + + * cpplex.c (spell_token): New function. + (TOKEN_LEN): Add 1 for whitespace. + (_cpp_lex_file): Update to use spell_token. + * cpplib.h (E): Remove. + (TTYPE_TABLE): Update CPP_VSPACE entry. + +2000-05-08 Richard Henderson + + * flow.c (init_propagate_block_info): Watch out for conditional + branch to next instruction, and thus one outgoing edge. + + * config/ia64/ia64.c (ia64_encode_section_info): Exit early + for global register variables; don't special case __[CD]TOR_LIST__; + mind ggc_p for string allocation. + +2000-05-08 Nick Clifton + + * config/i386/i386.h (ELIMINABLE_REGS): Fix comment. + +2000-05-08 Bruce Korb + + * fixinc/mkfixinc.sh: fixinc.sco is no longer used + i?86-*-msdosdjgpp* no longer uses fixincludes + * fixinc/genfixes: inclhack.sh and fixincl.sh are no longer generated + * fixinc/inclhack.sh: deleted + * fixinc/hackshell.tpl: deleted + * fixinc/inclhack.tpl: deleted + * fixinc/Makefile.in: Remove dependencies on above + * fixinc/fixincl.sh: "DO NOT EDIT" text modified + +2000-05-08 Andreas Jaeger + + * config/mips/linux.h: Remove undefines which disabled .ctor/.dtor + support. + +2000-05-07 Zack Weinberg + + * Makefile.in (LOOSE_CFLAGS): Add /g modifiers to both sed + substitutions. + +Sun 7 May 08:43:53 2000 Neil Booth + + * cpplex.c: Move new lexer definitions and prototypes + to top. Conditional include these and the code if + NEW_LEXER is defined. Rename functions whose names + clash if this code included. + +Sun May 7 00:54:57 EDT 2000 John Wehle (john@feith.com) + + * rtl.def (COND_EXEC): Clarify. + + * i386.md (extendsidi2): Clobber (reg:CC 17) in the + same fashion as zero_extendsidi2. + +2000-05-06 Richard Henderson + + * config/ia64/ia64.c (predicate_operator): New. + (ia64_print_operand): Handle 'J'. + (rtx_needs_barrier): Handle COND_EXEC. + * config/ia64/ia64.h (BRANCH_COST): Define. + (PREDICATE_CODES): Update. + * config/ia64/ia64.md: Document used unspec values. + (attr predicable): New. + (movxf, movxf_internal): New. + (extendsfdf2): Don't comment out nop. + (floatdidf2): Remove. + (truncxfsf2, truncxfdf2, floatdixf2): New. + (abssi2, absdi2): Put the neg in the "true" slot. + (conditional branch instructions): Mark not predicable. + (cmov*_internal): Use predicate_operator. Split to cond_exec. + (abs*_internal): Likewise. + (alloc, set_bsp): Mark not predicable. + (barrier, insn_group_barrier, flush_cache): Likewise. + (define_cond_exec): New. + +2000-05-06 Richard Henderson + + * c-decl.c: Include "tm_p.h". + + * config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness. + (fetchadd_operand, ia64_expand_fetch_and_op): Declare. + (ia64_expand_op_and_fetch): Declare. + * config/ia64/ia64.c: Include "toplev.h". Kill trailing whitespace. + (setjmp_operand): Constify variables for XSTR. + (ia64_encode_section_info): Likewise. + (ia64_print_operand): Use %d for exact_log2; cast 32-bit printed + values to int. + (ia64_asm_output_external): Constify name. + (process_set): Use HOST_WIDE_INT_PRINT_DEC for frame size. + (process_for_unwind_directive): Provide switch default. + (ia64_expand_compare_and_swap): Remove unused variables. + (ia64_expand_builtin): Likewise. + * config/ia64/ia64.h (ASM_OUTPUT_BYTE): Mask and cast value to int + for printing. + + * config/ia64/ia64.c (sdata_symbolic_operand): Mark unused args. + (symbolic_operand, function_operand, setjmp_operand): Likewise. + (shift_count_operand, shift_32bit_count_operand): Likewise. + (shladd_operand, fetchadd_operand, ia64_function_prologue): Likewise. + (ia64_function_epilogue, ia64_setup_incoming_varargs): Likewise. + (ia64_function_arg_partial_nregs, ia64_function_value): Likewise. + (ia64_print_operand_address, ia64_secondary_reload_class): Likewise. + (ia64_expand_builtin): Likewise. + (call_multiple_values_operation): Make dest_regno unsigned. + +2000-05-06 Richard Henderson + + * rtl.def (DEFINE_COND_EXEC): New. + * md.texi: Document it. + + * gensupport.c (input_file): Remove. + (struct queue_elem): Add lineno. + (rtx_ready_queue): Remove. + (errors): New. + (predicable_default): New. + (predicable_true, predicable_false): New. + (define_attr_queue, define_attr_tail): New. + (define_insn_queue, define_insn_tail): New. + (define_cond_exec_queue, define_cond_exec_tail): New. + (other_queue, other_tail): New. + (queue_pattern): New. + (process_rtx): Add patterns to the appropriate queues. + (is_predicable, identify_predicable_attribute): New. + (n_alternatives, collect_insn_data): New. + (alter_predicate_for_insn, alter_test_for_insn): New. + (shift_output_template, alter_output_for_insn): New. + (process_one_cond_exec, process_define_cond_exec): New. + (init_md_reader): Read the entire file. Process define_cond_exec. + (read_md_rtx): Return elements from the queues. + +2000-05-06 Richard Henderson + + * flow.c (mark_set_1): Don't update conditional life info + if the register is not_dead. + +2000-05-06 Zack Weinberg + + * Makefile.in (STAGESTUFF): Add genrtl.c and genrtl.h. + (mostlyclean): Also delete fixincl, fixinc.sh, and + specs.ready, and make clean in the fixinc subdir. + +2000-05-06 Richard Henderson + + * Makefile.in (gensupport.o): Compile for the host. + (host-prefix gensuuprt.o): Remove. + (genflags.o): Depend on gensupport.h and OBSTACK_H. + (genattrtab.o): Likewise. + (gencodes.o): Depend on gensupport.h. + (genemit.o, genopinit.o, genrecog.o, genextract.o): Likewise. + (genpeep.o, genattr.o, genoutput.o): Likewise. + + * gensupport.c (obstack, rtl_obstack): New. + (init_md_reader): Initialize rtl_obstack. + * gensupport.h (rtl_obstack): Declare. + (message_with_line): Declare. + + * genattr.c: Remove all traces of obstack manipulation. + * gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise. + * genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise. + + * genattrtab.c (obstack, rtl_obstack): Remove. + (main): Don't init rtl_obstack. + * genflags.c: Likewise. + + * genrecog.c (message_with_line): Move ... + * gensupport.c: ... here. + +2000-05-06 Richard Henderson + + * c-typeck.c (build_c_cast): Remove dead code. + +2000-05-06 Richard Henderson + + * flow.c (split_edge): Don't allocate global_live_at_start for + the new block unless the old blocks had them as well. + + * flow.c (mark_set_1): Respect not_dead when updating reg_live. + + * ifcvt.c (noce_process_if_block): Don't use an insn_b from + test_bb if a or b uses x. + +2000-05-06 Zack Weinberg + + * cpphash.h: Remove conditional #define of __extension__. + * rtl.h: Add __extension__ to RTL_CHECK1, RTL_CHECK2, + RTL_CHECKC1, RTL_CHECKC2, and RTVEC_ELT macros + (ENABLE_RTL_CHECKING only). + * tree.h: Add __extension__ to TREE_CHECK, TREE_CLASS_CHECK, + CST_OR_CONSTRUCTOR_CHECK, and EXPR_CHECK macros + (ENABLE_TREE_CHECKING only). + * varray.h: Add __extension__ to VARRAY_CHECK macro + (ENABLE_CHECKING only). + +2000-05-06 Richard Earnshaw (reanrsha@arm.com) + + Use new tail-calling mechanism on ARM. + * arm.md (sibcall, sibcall_value): New expands. + (sibcall_insn, sibcall_value_insn, sibcall_epilogue): New insns. + (tailcalling peepholes): Delete. + (push_multi): Simplify. + * arm.c (lr_save_eliminated): Delete definition. + (pattern_really_clobbers_lr, function_really_clobbers_lr): Delete. + (output_return_instruction): Remove checks on lr_save_eliminated. + (output_arm_prologue): Remove old tail-calling code. + (arm_output_epilogue): New parameter, really_return. All callers + changed. Handle tail-calling epilogues. + * arm.h (lr_save_eliminated): Delete declaration. + (frame_pointer_needed): Delete declaration. + * arm-protos.h (arm_output_epilogue): Adjust prototype. + + * arm.md (is_thumb): Examine symbol thumb_code, not expression + TARGET_ARM. + * arm.c (thumb_code): Define it. + (arm_override_options): Set it. + * arm.h (thumb_code): Declare it. + +2000-05-06 Richard Earnshaw (reanrsha@arm.com) + + * arm-protos.h (arm_dllexport_name_p, arm_dllimport_name_p): Constify. + +2000-05-06 Richard Earnshaw (reanrsha@arm.com) + + * arm.c (arm_gen_load_multiple, arm_gen_store_mulitple): Don't add + bogus clobber to insns. + (load_multiple_operation, store_mulitple_operation): Don't check + for it. + * arm.md (ldmsi_postinc, stmsi_postinc): Adjust accordingly. + + * arm.md (and_scc, ior_scc): Add missing mode. + + * arm.md (call_value_symbol): Remove predicate from op2. + + * arm.h (SPECIAL_MODE_PREDICATES): Define. + +Sat May 6 06:25:56 2000 Richard Kenner + + * expr.c (get_subtarget): New function. + (force_operand, expand_expr, do_store_flag): Use it. + + * toplev.c (compile_file): Don't take strlen of NAME if null. + +2000-05-06 David Edelsohn + + * xcoffout.c (xcoff_current_include_file, + xcoff_current_function_file, xcoff_lastfile): Constify char *. + (xcoffout_source_file, xcoffout_source_line): Make filename 'const + char *'. + (xcoffout_declare_function): Make name 'const char *'. + (xcoffout_end_epilogue): Make fname 'const char *' + * xcoffout.h (xcoff_current_include_file, xcoff_lastfile, + xcoffout_declare_function, xcoffout_source_line): Match above. + + * aix43.h (SUBTARGET_OVERRIDE_OPTIONS): -mpowerpc64 without + -maix64 is error. + * rs6000.c (print_operand): Fix lossage typo. + (output_cbranch): Remove "cr" decoration for now. + * rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Make alias 'const char *'. + +Sat May 6 06:55:32 2000 Denis Chertykov + + * config/avr/avr.c (out_shift_with_cnt): Bugfix for shift by + constant count. + +2000-05-05 Bruce Korb + + * fixinc/genfixes: Improve the matching for make target names + +2000-05-05 Catherine Moore + + * c-common.c (decl_attributes): For TYPE_DECLs attach the + attribute to the decl. + * c-decl.c (pushdecl): Propagate the USED attribute to the + type copy. + +2000-05-05 Richard Henderson + + * rtlanal.c (reg_overlap_mentioned_p): Treat parallels in the + same way emit_group_load does. + +2000-05-05 Mark Elbrecht + + * gcc.c (set_input) [HAVE_DOS_STYLE_FILE_SYSTEM]: Skip drive name. + + * toplev.c (output_file_directive): Use IS_DIR_SEPARATOR. + (main): Likewise. + +2000-05-05 Rodney Brown + + * pa.h (FUNCTION_ARG_ADVANCE): Warning removal. + +Fri May 5 10:29:21 2000 Marc Espie + + * config/openbsd.h (LINK_SPEC): pass correct flags to ld + to support -shared, on platforms with dynamic libraries. + +Fri May 5 10:27:06 2000 Philippe De Muyter + + * system.h (S_ISBLK): Provide fallback definition. + +2000-05-05 Geoff Berry + + * extend.texi (Extended Asm): Document inability to give asm + statements access to condition codes. + +2000-05-05 Marek Michalkiewicz + + * varasm.c (asm_emit_uninitialised): Use 0, not NULL + as arg 2 of UNIQUE_SECTION. + +Fri May 5 10:11:41 2000 Jeffrey A Law (law@cygnus.com) + + * predict.c: Remove May 4 change. + * bb-reorder.c (make_reorder_chain): Do not perform block movement + if we have predicted the branch at 50-50 probability. + +2000-05-05 Richard Henderson + + * flow.c (init_propagate_block_info): Fix merge error + in HAVE_conditional_execution code. + +Fri May 5 07:43:50 2000 Denis Chertykov + + * config/avr/avr.c (out_shift_with_cnt): Genetare a more optimal + shift cycle for unknown shift count. Also generates dec + brpl. + (ashlqi3_out): Don't generate dec + brpl which now generates by + `out_shift_with_cnt'. + (ashlhi3_out): Likewise. + (ashlsi3_out): Likewise. + (ashrqi3_out): Likewise. + (ashrhi3_out): Likewise. + (ashrsi3_out): Likewise. + (lshrqi3_out): Likewise. + (lshrhi3_out): Likewise. + (lshrsi3_out): Likewise. + +2000-05-04 Mark Elbrecht + + * gcc.c (free_split_directories): Correct typo in explanation + of make_relative_prefix. + +2000-05-04 Geoff Keating + + * config/rs6000/rs6000.h (PREDICATE_CODES): Add floating-point + comparison codes to branch_comparison_operator. + +2000-05-04 Richard Henderson + + * ifcvt.c (noce_process_if_block): Always reset X in the A == B case. + +2000-05-04 Richard Henderson + + * Makefile.in (FPBIT_FUNCS): Remove _df_to_usi. + (DPBIT_FUNCS): Remove _sf_to_usi. + (stmp-multilib): Pass LIB1ASMSRC to libgcc.mk. + + * ifcvt.c (noce_process_if_block): Fail if A or B modified + between condition and jump. + + * libgcc2.c (near eh_context_specific): Comment #endif string. + * longlong.h: Don't use strings with embedded newlines. + +2000-05-04 Geoff Keating + + * config/rs6000/rs6000-protos.h: Add output_cbranch. + * config/rs6000/rs6000.c (ccr_bit_negated_p): Delete. + (print_operand): Delete %t and %T codes. + (output_cbranch): New function. Support branch prediction. + * config/rs6000/rs6000.md: Use output_cbranch for + conditional branches and returns. + +2000-05-04 Jason Merrill + + * simplify-rtx.c (simplify_ternary_operation): Cast to unsigned. + * stor-layout.c (place_field): Likewise. + * integrate.h (struct inline_remap): Make regno_pointer_align unsigned. + * expr.c (store_expr): Make align unsigned. + * explow.c (plus_constant_wide): Make low words unsigned. + * expmed.c (choose_multiplier): Likewise. + * fold-const.c (fold): Likewise. + * tree.h (build_int_2): Likewise. + * tree.c (build_int_2_wide, tree_int_cst_msb): Likewise. + * emit-rtl.c (gen_reg_rtx): Add cast to unsigned char*. + (init_emit): Change cast to unsigned char*. + * varasm.c (compare_constant_1): Add cast to char*. + * gcse.c (delete_null_pointer_checks): Change cast to unsigned int*. + * reload1.c (reload): Likewise. + + * rtl.h (MEM_SET_IN_STRUCT_P): Use do { } while (0). + +Thu May 4 14:37:23 2000 Jeffrey A Law (law@cygnus.com) + + * predict.c (estimate_probability): If no prediction was found, then + predict the successor that is the next physical block (if such a + successor exists). + +2000-05-04 Richard Henderson + + * config/alpha/t-alpha (LIB2FUNCS_EXTRA): Use qrrnd.asm in place. + +2000-05-04 Kaveh R. Ghazi + + * system.h: Don't wrap with HAVE_SYS_TYPES_H. + +2000-05-04 Mumit Khan + + * i386/cygwin.h (CPP_PREDEFINES): Don't define __STDC__. Move + attribute macros from here ... + (CPP_SPEC): to here. + * i386/mingw32.h (CPP_PREDEFINES): Likewise. + (CPP_SPEC): Likewise. + * i386/crtdll.h (CPP_PREDEFINES): Delete attribute macros. + + * Makefile.in ($(HOST_PREFIX_1)gensupport.o): Add build rule. + (libgcc.a): Pass LIB1ASMSRC to libgcc.mk. + +2000-05-04 Kaveh R. Ghazi + + * bb-reorder.c (get_next_bb_note, get_prev_bb_note): Prototype. + + * diagnostic (vbuild_message_string, build_message_string, + build_location_prefix, output_get_prefix, init_output_buffer, + output_notice, vline_wrapper_message_with_location, + v_message_with_decl, default_print_error_function): De-constify. + (set_real_maximum_length): Prototype. + + * diagnostic.h (struct output_buffer, init_output_buffer, + output_get_prefix, output_set_prefix): De-constify. + + * function.c (init_function_start): Constify. + + * gensupport.c (remove_constraints, process_rtx): Prototype. + + * gthr-posix.h: Indent uses of #pragma. + + * objc/objc-act.c (ggc_mark_imp_list, ggc_mark_hash_table): + Prototype. + + * predict.c (find_expected_value): Delete prototype. + (expected_value_to_br_prob): Initialize variable `ev_reg'. + + * sbitmap.h (debug_sbitmap): Prototype. + + * ssa.c (compute_coalesced_reg_partition): Prototype. + + * stor-layout.c (debug_rli): Prototype. + + * tree.h (round_down): Prototype. + (init_function_start): Constify. + +2000-05-04 Zack Weinberg + + * cpphash.h: #define __extension__ away if GCC_VERSION < 2095 + (overly conservative). Change extern inline wrappers to + static inline, define them always, use PARAMS properly. + * cpplex.c (_cpp_get_directive_token): Don't issue pedantic + whitespace warnings for \f and \v at the beginning of a line. + +Thu May 4 10:03:50 2000 Jeffrey A Law (law@cygnus.com) + + * haifa-sched.c (schedule_insns): Free the flow edge list when it + is no longer needed + +2000-05-04 Bruce Korb + + * fixincl/inclhack.def: added broken_cabs - + Remove `extern double cabs' declarations from math.h + * fixincl/inclhack.sh: regen + * fixincl/fixincl.x: regen + * fixincl/fixincl.c: Remove BOGOSITY code + * fixincl/mkfixinc.sh: Remove code for installing "shell" version + +Thu May 4 09:45:12 2000 Richard Kenner + + * rtl.h (MEM_COPY_ATTRIBUTES): Also copy RTX_UNCHANGING_P and + MEM_ALIAS_SET. + * alias.c (canon_rtx): Don't copy RTX_UNCHANGING_P or MEM_ALIAS_SET + when calling MEM_COPY_ATTRIBUTES. + * emit-rtl.c (operand_subword, change_address): Likewise. + * explow.c (stabilize): Likewise. + * expr.c (protect_from_queue, emit_move_insn_1): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * combine.c (combine_simplify_rtx): Don't copy RTX_UNCHANGING_P + when calling MEM_COPY_ATTRIBUTES. + (make_extraction, simplify_shift_const, gen_lowpart_for_combine): + Likewise. + * cse.c (gen_lowpart_if_possible): Likewise. + * function.c (fixup_var_refs_1, purge_addressof_1): Likewise. + * optabs.c (gen_move_insn): Likewise. + * recog.c (validate_replace_rtx_1): Likewise. + * simplify-rtx.c (add_mem_for_addr): Likewise. + * stmt.c (expand_anon_union_decl): Likewise. + * config/arm/arm.md: Likewise. + * config/h8300/h7300.c (fix_bit_operand): Likewise. + * config/m88k/m88k.c (legitimize_address, block_move_loop): Likewise. + (block_move_no_loop, block_move_sequence): Likewise. + * config/rs6000/rs6000.c (expand_block_move_mem): Likewise. + * config/alpha/alpha.c (get_aligned_mem): Likewise. + Clear MEM_ALIAS_SET. + * final.c (alter_subreg): Don't copy MEM_ALIAS_SET when calling + MEM_COPY_ATTRIBUTES. + +2000-05-03 Robert Lipe + + * configure.in (i[34567]86-*-isc*) [tmake_file]: Add t-i386bare + to suppress libgcc1. + (i[34567]86-*-sco3.2v5*) Likewise. + (i[34567]86-*-sco3.2v4*) Likewise. + (i[34567]86-*-sco) Likewise. + (i[34567]86-*-solaris2) Likewise. + (i[34567]86-*-sysv5*) Likewise. + (i[34567]86-*-sysv4*) Likewise. + (i[34567]86-*-udk*) Likewise. + (i[34567]86-*-sysv*) Likewise. + +2000-05-03 Zack Weinberg + + * cpphash.h (U): New define, to correct type of string constants. + (ustrcmp, ustrncmp, ustrlen, uxstrdup, ustrchr): New wrapper + routines, to do casts when passing unsigned strings to libc. + * cppexp.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c: Use them. + + * cppfiles.c (_cpp_execute_include): Make filename an U_CHAR *. + * cpphash.c (_cpp_quote_string): Make string an U_CHAR *. + * cppinit.c (dump_special_to_buffer): Make macro name an U_CHAR *. + * cpplex.c (parse_ifdef, parse_include, validate_else): Make + second argument an U_CHAR *. + + * cppinit.c (builtin_array): Make name and value U_CHAR *, add + length field, clean up initializer. + (ISTABLE): Add __extension__ to designated- + initializers version. + * cpplex.c (CHARTAB): Likewise. + + * mbchar.c: Add dummy external declaration to the !MULTIBYTE_CHARS + case so the file won't be empty. + +Wed May 3 21:01:46 2000 Jason Eckhardt + + * bb-reorder.c (struct reorder_block_def): Member succ removed. + (REORDER_BLOCK_SUCC): Removed. + (enum reorder_skip_type): Removed. + (skip_insns_between_block): Renamed to skip_insns_after_block. + Removed second argument. Removed dead code and cleaned up. + (make_reorder_chain): Removed use of REORDER_BLOCK_SUCC. + (reorder_basic_blocks): Remove use of REORDER_SKIP_AFTER. Removed + second parameter to skip_insns_after_block. + +Wed May 3 13:29:54 2000 Richard Kenner + + * tree.c (staticp, case LABEL_DECL): New case. + +2000-05-03 Richard Henderson + + * Makefile.in (start.encap): Do not depend on LIBGCC1. + + * mklibgcc1.in: Fix typo last change. + +2000-05-03 Jason Merrill + + * Makefile.in (WARN_CFLAGS): Add -pedantic -Wno-long-long. + (LOOSE_CFLAGS): New: CFLAGS without -pedantic and -Wtraditional. + (GCC_CFLAGS): Use it. + (LANG_FLAGS_TO_PASS): New: SUBDIR_FLAGS_TO_PASS with LOOSE_CFLAGS. + * cp/Make-lang.in, java/Make-lang.in, f/Make-lang.in, ch/Make-lang.in, + objc/Make-lang.in: Use it. + +2000-05-03 Jason R Thorpe + + * config/i386/i386.md (lshrqi2_cmpno): Use q not r in constraint. + +2000-05-03 Richard Henderson + + * mklibgcc.in: Restrict OLDCC=GCC test to native. Equate + LIBGCC1 empty with libgcc1.null. + +Wed May 3 12:55:46 2000 Jim Wilson + + * fold-const.c (extract_muldiv, case MAX_EXPR): Don't allow signedness + change. + +2000-05-03 Greg McGary + + * tree.h (tree_common): Add bounded_flag member. Remove + inaccurate comment about number of remaining bits. + (BOUNDED_INDIRECT_TYPE_P, BOUNDED_POINTER_TYPE_P, + BOUNDED_REFERENCE_TYPE_P, MAYBE_BOUNDED_INDIRECT_TYPE_P, + MAYBE_BOUNDED_POINTER_TYPE_P, MAYBE_BOUNDED_REFERENCE_TYPE_P, + TREE_BOUNDED, TYPE_MAIN_VARIANTS_PHYSICALLY_EQUAL_P, + TYPE_MAIN_PHYSICAL_VARIANT, TYPE_BOUNDED): New macros. + (TYPE_QUAL_BOUNDED): New constant. + (TYPE_QUALS): Handle bounded qualifier. + (TREE_EXPR_QUALS, TREE_FUNC_QUALS): New macros. + (TYPE_BOUNDED_VALUE, TYPE_BOUNDED_BASE, TYPE_BOUNDED_EXTENT, + TYPE_BOUNDED_SUBTYPE, TYPE_UNBOUNDED_VARIANT, TYPE_POINTER_DEPTH, + TYPE_AMBIENT_BOUNDEDNESS): New macros. + (MAX_POINTER_DEPTH, VA_LIST_POINTER_DEPTH): New constants. + (tree_type): Add pointer_depth member. Remove + inaccurate comment about number of remaining bits. + (DECL_POINTER_DEPTH): Add macro. + (tree_decl): Add pointer_depth member. + +Wed May 3 22:52:53 2000 Denis Chertykov + + * config/avr/avr-protos.h (test_hard_reg_class): Declared. + * config/avr/avr.c (ashrhi3_out): optimized shift by 15. + (lshrhi3_out): Likewise. + (ashrsi3_out): bugfix in shift by 8. + (test_hard_reg_class): New function. + * config/avr/avr.md: Bugfix inside conditions in peepholes. + (ashlhi3): removed define_expand of this pattern. + (*ashlhi3_insn): renamed to ashlhi3. + (ashlsi3): removed define_expand of this pattern. + (*ashlsi3_insn): renamed to ashlsi3. + (ashrqi3): removed define_expand of this pattern. + (*ashrqi3_insn): renamed to ashrqi3. + (ashrhi3): removed define_expand of this pattern. + (*ashrhi3_insn): renamed to ashrhi3. + (ashrsi3): removed define_expand of this pattern. + (*ashrsi3_insn): renamed to ashrsi3. + (lshrhi3): removed define_expand of this pattern. + (*lshrhi3_insn): renamed to lshrhi3. + (lshrsi3): removed define_expand of this pattern. + (*lshrsi3_insn): renamed to lshrsi3. + +2000-05-03 Rodney Brown + + * config/mcore/mcore.c: Replacing inclusion of "stdio,h" with + inclusion of "system.h". + +Wed May 3 11:43:53 2000 Jim Wilson + + * config/ia64/ia64.c (ia64_encode_section_info): Add check for + TREE_ASM_WRITTEN. + +2000-05-03 David Mosberger + + * config/ia64/ia64.c (ia64_override_options): Force -mconstant-gp + if -mauto-pic is on. + (ia64_epilogue_uses): Mark "gp" (r1) as used by the epilogue if + -mconstant-gp is in effect and function-descriptors are being used + to make indirect calls. + * config/ia64/ia64.h (MASK_CONST_GP): New macro. + (MASK_AUTO_PIC): Ditto. + (TARGET_CONST_GP): Ditto. + (TARGET_AUTO_PIC): Ditto. + (TARGET_SWITCHES): Add -mconstant-gp and -mauto-pic options. + (ASM_OUTPUT_DOUBLE_INT): Don't generate @fptr() if -mauto-pic or + -mno-pic is in effect. + (ASM_OUTPUT_XDATA_DOUBLE_INT): Ditto. + * config/ia64/ia64.md (movdi): Use gen_load_gprel64() if + -mauto-pic is in effect. + (gprel64_offset): New pattern. + (load_gprel64): Ditto. + (call): Handle -mauto-pic like -mno-pic (don't use fptr). If + -mconstant-gp is in effect, no need to preserve gp around direct + calls. + (call_value): Ditto. + * config/ia64/linux.h (PROFILE_BEFORE_PROLOGUE): Define. + (FUNCTION_PROFILER): Define. + * config/ia64/sysv4.h (ASM_OUTPUT_CONSTRUCTOR): Don't generate + @fptr() directive when -mno-pic or -mauto-pic is in effect. + (ASM_OUTPUT_DESTRUCTOR): Ditto. + +2000-05-03 Richard Henderson + + * Makefile.in (STAGESTUFF): Add libgcc libgcc.mk. + (libgcc1.null, libgcc1.cross, libgcc1.a): Remove targets. + (libgcc1-asm.a, libgcc1.S, libgcc2.a): Remove targets. + (mklibgcc, libgcc.mk): New targets. + (libgcc.a): Use libgcc.mk. + (stmp-multilib): Likewise. + (stmp-multilib-sub): Remove. + (mostlyclean): Don't delete libgcc2 temp files. + * configure.in (AC_PROG_CC_C_O): Add. + (NO_MINUS_C_MINUS_O): Substitute it. + (all_outputs): Add mklibgcc. + * mklibgcc.in: New file. + +2000-05-03 Jason Merrill + + * cppexp.c (op_t): Make an int. + + * rtlanal.c (dead_or_set_regno_p): Remove unused variable. + + * varasm.c (initializer_constant_valid_p): Fix parenthesis. + + * gensupport.c (process_rtx): Fix macros used. + +2000-05-03 Richard Henderson + + * flow.c (propagate_one_insn): Also don't PROP_REG_INFO for + call-clobbered registers of a call. + +Wed May 3 12:40:53 2000 Clinton Popetz + + * gensupport.c: New file. + * gensupport.h: New file. + * Makefile.in (HOST_RTL): Depend on gensupport. + (gensupport.o) New rule. + * genattr.c: Use gensupport for reading .md files. + * genattrtab.c: Ditto. + * gencodes.c: Ditto. + * genconfig.c: Ditto. + * genemit.c: Ditto. + * genextract.c: Ditto. + * genflags.c: Ditto. + * genopinit.c: Ditto. + * genoutput.c: Ditto. + * genpeep.c: Ditto. + * genrecog.c: Ditto. + * rtl.def (define_insn_and_split): New DEF_RTL_EXPR. + * md.texi (Insn Splitting): Document define_insn_and_split. + +Tue May 2 00:20:30 2000 Jason Eckhardt + + * flow.c (verify_flow_info): Added two more sanity checks. The + first checks that the blocks are numbered consecutively. The second + checks that n_basic_blocks is actually equal to the number of + basic blocks in the insn chain. + +2000-05-03 Zack Weinberg + + * cpplib.h: Add accessor macros for token lists. + * cpplib.c, cpphash.c, cpplex.c: Use them. + +Wed May 3 09:29:17 2000 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): Don't check for checking + memory usage if not in a function. + * varasm.c (initializer_constant_valid_p, case ADDR_EXPR): Only + return address if static. + +Wed May 3 13:14:49 MET DST 2000 Jan Hubicka + + * ifcvt.c (noce_try_cmove_arith): Use may_trap_p to thest + whether address may trap. + +Tue May 2 23:38:37 2000 Jason Eckhardt + + * bb-reorder (chain_reorder_blocks): Changed code to test for + EDGE_FALLTHRU rather than making erroneous assumption that the + first outgoing edge is the fall-through edge. + +Tue May 2 18:20:31 2000 Donald Lindsay + + * config/mips/mips.c (mips_build_va_list,mips_va_start,mips_va_arg): new + ABI for varargs, across all MIPS. This is incompatible because the + va_list (__builtin_va_list) structure is different, so a compilation + unit passing a va_list and a compilation unit being passed one, should + both be compiled with the same ABI. (The old structure had two + pointers, now it has three.) + +Tue May 2 19:18:43 2000 Jason Eckhardt + + * bb-reorder.c (struct reorder_block_def): Remove members end, + block_begin, and block_end. + (REORDER_BLOCK_OLD_END): Delete. + (REORDER_BLOCK_BEGIN): Delete. + (REORDER_BLOCK_END): Delete. + (chain_reorder_blocks): Remove dead code. + +Tue May 2 17:06:53 2000 Jason Eckhardt + + * bb-reorder.c (remove_scope_notes): Check for both types of scope + notes as the end of a basic block before deleting. + +2000-05-02 Mumit Khan + + * final.c (final_start_function): Fix spelling of "necessary". + +2000-05-02 Jason Merrill + + * toplev.c (debug_ignore_block): Return int. + * dwarf2out.c (dwarf2out_ignore_block): Likewise. + * toplev.h, dwarf2out.h: Adjust. + * emit-rtl.c (remove_unnecessary_notes): Test return value. + + * emit-rtl.c (remove_unnecessary_notes): Fix spelling of "necessary". + * toplev.c, final.c, rtl.h: Adjust. + +2000-05-02 Zack Weinberg + + * aclocal.m4 (gcc_AC_CHECK_PROG_VER): New macro. + * configure.in: Look for makeinfo in the unified tree, then + for a system makeinfo which is sufficiently new. + * Makefile.in: If configure says makeinfo is too old, don't + build or install Info documentation. + +2000-05-02 Zack Weinberg + + * cpphash.c (collect_params): Fix off-by-one error. + (dump_hash_helper): Dump all four macro nodetypes. + +2000-05-02 Jakub Jelinek + + * cpphash.c (trad_stringify): Adjust p after stringification as + well. + +2000-05-02 Zack Weinberg + + * cpplib.h (CPP_POP, parse_cleanup_t): Delete. + (cpp_buffer): Remove cleanup, seen_eof, manual_pop members. + + * cppfiles.c (file_cleanup): Delete. + * cpphash.c (macro_cleanup): Delete. + (collect_objlike_expansion, collect_funlike_expansion, + macarg, scan_arguments): Remove CPP_POP case. + + * cpplex.c (null_cleanup): Delete. + (cpp_pop_buffer): Do the work that was done in the cleanups + here. Call _cpp_unwind_if_stack from here. + (_cpp_expand_to_buffer, cpp_scan_buffer_nooutput, + cpp_scan_buffer): Run until we see CPP_EOF and the top of + stack is the buffer _below_ the one we stacked. + (cpp_get_token): Always pop an exhausted buffer. Return + CPP_EOF unless it's a macro buffer. Don't call _cpp_handle_eof. + * cpplib.c (skip_if_group): Don't call cpp_get_token to + increment the line number. + (_cpp_handle_eof): Rename to _cpp_unwind_if_stack. + + * fix-header.c (read_scan_file) [parsing getchar()]: Run until + we see CPP_EOF and the top of stack is the buffer _below_ the + one we stacked. + * scan-decls.c: Likewise. + +2000-05-02 Andrew Haley + + * config/ia64/ia64.c (ia64_encode_section_info): Handle the case + where this function is called for the second time on a decl that + has had its section info changed in such a way as to move it out + of small data/bss. + * config/ia64/ia64.h (REDO_SECTION_INFO_P): New definition. + +2000-05-01 Richard Henderson + + * ifcvt.c (dead_or_predicable): Set merge_bb->end to the insn before + the sequence we're moving, not to merge_bb->head. + +2000-05-01 Richard Henderson + + * configure.in (alpha*-*-linux-gnulibc1*) [tmake_file]: Remove + reference to alpha/t-linux. + (alpha*-*-linux-gnu*): Likewise. + * configure: Rebuild. + + * calls.c (expand_call): Don't emit reg notes for a sibcall. + + * flow.c (calculate_global_regs_live): Skip for_each_successor_phi + if not in SSA form. + + * ifcvt.c (if_convert): Only verify_flow_info if ENABLE_CHECKING. + +2000-05-01 Jason Merrill + + * integrate.c (copy_decl_for_inlining): Copy TREE_READONLY and + TREE_THIS_VOLATILE. + +2000-05-01 Richard Henderson + + * ifcvt.c (noce_emit_cmove): Conditionally compile call to + emit_conditional_move. + +2000-05-01 Jakub Jelinek + + * config/ia64/linux.h (LINK_SPEC): Use /lib/ld-linux-ia64.so.1 + as the dynamic linker. + +2000-05-01 Zack Weinberg + + * cppfiles.c (open_include_file): Open file in blocking mode. + (read_include_file): Don't fcntl(fd, F_SETFL, 0) anymore. + Only exclude block devices and directories. + + * cpphash.c (_cpp_make_hashnode): Rename make_HASHNODE, now + static. Allocate the hashnode and its string in the same + block of memory. + (del_HASHNODE): Don't free h->name. + (_cpp_lookup): If there is no entry for this string, create + one, of type T_VOID. + (_cpp_lookup_slot): Delete. + * cpphash.h: Update prototypes. + + * cpplex.c (maybe_macroexpand): Check for hp->type == T_VOID, + not hp == NULL. + * cpplib.c (do_define, do_undef, do_pragma_poison, do_assert, + do_unassert, cpp_defined): Use _cpp_lookup. Don't create a + node here, just fill in the value field properly. "Delete" + entries by setting the value field to T_VOID. Check for + hp->type == T_VOID, not hp == NULL. + + * Makefile.in (cpplib.o): Don't depend on $(HASHTAB_H). + * cpperror.c, cppexp.c, cpplex.c, cpplib.c: Don't include + hashtab.h. + +2000-05-01 Alexandre Oliva + + * config/mn10300/mn10300.c (print_operand_address): Do not add + zero to SP. + + * config/mn10300/mn10300.c (expand_epilogue): If SP is to be + adjusted by less than 256 bytes, use ret regardless of having any + callee-saved register to restore. + +2000-05-01 Laurynas Biveinis + + * tm.texi (TARGET_HAS_F_SETFLKW): Fix typo. + +2000-05-01 Mark Elbrecht + + * config/i386/djgpp.h (INT_ASM_OP): Define. + (CPP_PREDEFINES): Rename MSDOS to __MSDOS__. + (ASM_WEAKEN_LABEL): Define. + (MASK_BNU210): Define. + (SUBTARGET_SWITCHES): Define. + (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY): Define. + (MAKE_DECL_ONE_ONLY): Define. + (UNIQUE_SECTION_P, UNIQUE_SECTION): Define. + +2000-05-01 Mumit Khan + + * i386/cygwin.h (INT_ASM_OP): Define. + +Mon May 1 18:20:06 2000 Denis Chertykov + + * config/avr/avr.c (address_cost): renamed to avr_address_cost. + * config/avr/avr.h (ADDRESS_COST): use avr_address_cost. + +Mon May 1 17:50:44 2000 Denis Chertykov + + * config/avr/avr.c (asm_file_start): output 0 as r0 and 1 as r1 in + __tmp_reg__ and __zero_reg__ initialization. + +2000-04-30 Richard Henderson + + * flow.c (propagate_one_insn): Mark sets even when the insn is dead. + + * ifcvt.c (noce_process_if_block): Fail the conversion if X is + referenced bewteen the condition and the jump. Don't delete + anything but the jump. + +Sun Apr 30 22:48:24 2000 Jason Eckhardt + + * bb-reorder.c (scope_def): New struct. + (scope_forest_info): New struct. + (struct reorder_block_def): New member "scope". + (REORDER_BLOCK_SCOPE): New macro. + (relate_bbs_with_scopes): New function and prototype. + (make_new_scope): Likewise. + (build_scope_forest): Likewise. + (remove_scope_notes): Likewise. + (insert_intra_1): Likewise. + (insert_intra_bb_scope_notes): Likewise. + (insert_inter_bb_scope_notes): Likewise. + (rebuild_scope_notes): Likewise. + (free_scope_forest_1): Likewise. + (free_scope_forest): Likewise. + (dump_scope_forest): Likewise. + (dump_scope_forest_1): Likewise. + (chain_reorder_blocks): Set REORDER_BLOCK_SCOPE for new block. + Update REORDER_BLOCK_EFF_HEAD and REORDER_BLOCK_EFF_END for new + block. + (reorder_basic_blocks): Added calls to build_scope_scope_forest + and remove_scope_notes before reordering is done. Added calls to + rebuild_scope_notes, free_scope_forest, and reorder_blocks after + after reordering is done. + +2000-40-30 Bruce Korb + + * fixinc/inclhack.def: Added definitions needed by OSR5, + removed two stale entries (defined away with OLD_CPP). + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + +2000-04-30 Richard Henderson + + * ifcvt.c (dead_or_predicable): Manually squeeze non-movable notes + from the last insn in the sequence. + +2000-04-30 Zack Weinberg + + * cpplex.c (cpp_idcmp): New function. + * cpplib.h: Prototype it. + * scan_decls.c (scan_decls): Use it to inspect token names. + * fix-header.c (read_scan_file): Likewise. Set system_header_p on + the file being run through the preprocessor. + (check_macro_names): Provide length of token to cpp_defined. + + * Makefile.in: Remove stale warning message. + + * cppfiles.c (redundant_include_p): Provide length of token to + cpp_defined. + * cpphash.c (_cpp_make_hashnode, _cpp_lookup_slot): Hash + values are unsigned int. + (_cpp_lookup, _cpp_lookup_slot): Do not calculate the length. + (_cpp_lookup_slot): Do not calculate the hash, either. + * cpphash.h: Update prototypes. + * cpplib.c (do_define, do_undef, do_pragma_poison, do_assert): + Hashes are unsigned int. Calculate hash here, pass by value + to _cpp_lookup_slot. + +2000-04-30 Bernd Schmidt + + * simplify-rtx.c (check_value_useless): Delete function. + (discard_useless_locs): Don't call it; manage N_USELES_VALUES counter + by hand. + (cselib_invalidate_regno): Likewise. + (cselib_invalidate_mem_1): Likewise. + (references_value_p): Recognize useless values by the fact that they + have no locations. + (discard_useless_values): Likewise. + (cselib_record_set): This may turn a useless value + into a useful one. + +2000-04-30 Richard Henderson + + * config/d30v: New port. + + * configure.in (d30v-*): Set fp format. + * configure: Rebuild. + +2000-04-30 Richard Henderson + + * ifcvt.c: New file. + * Makefile.in (OBJS): Add it. + (ifcvt.o): New target. + * jump.c (jump_optimize_1): Remove all code related to if-conversion, + and conditional arithmetic. + (find_insert_position): Remove. + * timevar.def (TV_IFCVT, TV_IFCVT2): New. + * toplev.c (DFI_ce, DFI_ce2): New. + (dump_file): Add ce and ce2 dumps. + (rest_of_compilation): Run if_convert a couple o times. Set + cse_not_expected after cse2. Don't set no_new_pseudos until + after sched1 or recompute_reg_usage. + +2000-04-30 Richard Henderson + + * config/alpha/t-crtbe (crtbegin.o): Add "-I.". + (crtend.o, crtbeginS.o, crtendS.o): Likewise. + +2000-04-30 Richard Henderson + + * flow.c (struct reg_cond_life_info): New. + (struct propagate_block_info): Add reg_cond_dead and reg_cond_reg. + (init_propagate_block_info): Initialize them. + (free_propagate_block_info): Destruct them. + (mark_set_1): Consider conditional life before killing a register. + (mark_regno_cond_dead): New. + (free_reg_cond_life_info): New. + (flush_reg_cond_reg_1, flush_reg_cond_reg): New. + (ior_reg_cond, not_reg_cond, nand_reg_cond): New. + (mark_used_reg): Record conditional life. + + * haifa-sched.c (schedule_insns): Disable death counting + sanity check for HAVE_conditional_execution. + +2000-04-30 Richard Henderson + + * Makefile.in (TIMEVAR_H): New. + (ggc-simple.o, ggc-page.o, toplev.o, timevar.o): Use it. + (timevar.h): Remove rule. + +2000-04-29 Richard Henderson + + * config/alpha/crtend.asm: Use C comments instead of #. + * config/alpha/crtbegin.asm: Likewise. Mark __dso_handle hidden. + + * config/alpha/elf.h (SELECT_SECTION): Treat CONSTRUCTOR like VAR_DECL. + +2000-04-29 Zack Weinberg + + * cpphash.h (enum node_type: Take out T_MCONST. + (union hashval): Move into struct hashnode. + (struct hashnode): Pack tighter. Remove file, line, col + members. + * cpphash.c: Constify most of the macro-definition structures. + (struct definition): Replace by struct object_defn + and struct funct_defn. Put file, line, column information + here. All users updated to match. + (_cpp_create_definition, _cpp_macroexpand): Remove special + case for #define WORD OTHERWORD. + * cpplib.c (do_undef): Remove T_MCONST case. + + * cpphash.h: Move struct reflist, struct definition, and the + DEFINITION typedef to cpphash.c. Use 'struct definition *' in + union hashval. _cpp_free_definition takes a HASHNODE pointer. + * cpphash.c (_cpp_free_definition): Free data pointed to by + MCONST, XCONST, MACRO, and FMACRO nodes properly. + (_cpp_create_definition, del_HASHNODE): Just call + _cpp_free_definition to clear out a hashnode. + * cpplib.c (do_pragma_poison): Likewise. + +Sat Apr 29 12:25:17 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (FIRST_DATA_REGNUM, + LAST_DATA_REGNUM, FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM, + FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM): New macros. + (REGNO_SP_P): Redefine in terms of STACK_POINTER_REGNUM. + (REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_EXTENDED_P, + REGNO_AM33_P): Redefine in terms of the new macros. + (CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise. + (FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, + STRUCT_VALUE): Likewise. + (STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM, + ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Likewise. Moved. + +Sat Apr 29 01:18:45 MET DST 2000 Jan Hubicka + + * regmove.c (struct record_stack_memrefs_data): New. + (record_stack_memrefs): New function. + (combine_stack_adjustments_for_block): Use it. + +Sat Apr 29 01:15:27 MET DST 2000 Jan Hubicka + + * calls.c (calls_function_1): Properly handle TREE_LIST expressions; + use special_function_p to detect alloca. + +Fri Apr 28 16:30:33 2000 Marc Espie + + * gcc.texi: Fixes for makeinfo 4.0 --html. + +2000-04-28 Zack Weinberg + + * pcp.h: Delete file. + +2000-04-28 Kazu Hirata + + * h8300.c (function_epilogue): Clean up flags when the last insn + in a function is a barrier. + +2000-04-28 Chris Demetriou + + * configure.in (sparc-hal-solaris2*): protect [] glob from + my expansion. + (mips*-*-ecoff*, mips*-*-elf*, mips*-*-*): use MASK_ defines + rather than hard-coded constants in target_cpu_default2. + * configure: Regenerate. + +2000-04-28 Jason Merrill + + * tree.c (get_callee_fndecl): Extract the initial value from + a readonly decl. + +2000-04-28 Richard Henderson + + * varasm.c (record_constant_1): Record the CODE_LABEL when + taking the address of a LABEL_REF. + +2000-04-28 Richard Henderson + Jan Hubicka + + * calls.c (combine_pending_stack_adjustment_and_call): Return the + adjustment; don't do the stack adjust. + (expand_call): Call compute_argument_block_size right before + allocating the block; update comment; don't do alignment sanity + checking for sibling call; use args_size instead of + unadjusted_args_size before args_size is adjusted. Use + combine_pending_stack_adjustment_and_call to compute stack adjust + for must_preallocate case. + + * expr.c (push_block): Remove shadow `temp' in inner scope. + +2000-04-28 Jason Merrill + + * toplev.c (rest_of_compilation): Call + note_deferral_of_defined_inline_function even if the function + can't be inlined. + +2000-04-28 Scott Bambrough + + * cpplex.c (_cpp_scan_line): Fix buffer overwrite. + +2000-04-28 Richard Henderson + + * toplev.c (rest_of_type_compilation): Fix sdb TIMEVAR typo. + +2000-04-28 Kaveh R. Ghazi + + * timevar.c (init_timevar): DeANSIfy function definition. + +2000-04-27 Alex Samuel + + * Makefile.in (timevar.o): Depend on flags.h. + * timevar.c (unused_stack_instances): New variable. + (timevar_push): Take a timevar_stack_def from + unused_stack_instances if available. + (timevar_pop): Push the popped timevar_stack_def onto + unused_stack_instances. + (TIMEVAR_ENABLE): New macro. + (timevar_def): Make standalone a 1-bit field. Add field used. + (get_time): Rename parameter to now. Return after clearing it if + not TIMEVAR_ENABLE. + (init_timevar): Do nothing if not TIMEVAR_ENABLE. + (timevar_pop): Likewise. + (timevar_stop): Likewise. + (timevar_push): Likewise. Mark the timing variable as used. + (timevar_start): Likewise. + (timevar_print): Do nothing if not TIMEVAR_ENABLE. Don't print + timevars that were never used. + +2000-04-27 Mark Mitchell + + * c-common.c (c_apply_type_quals_to_decl): REFERENCE_TYPES are + always TREE_READONLY. + +2000-04-27 Ulrich Drepper + + * i386.h (FUNCTION_BLOCK_PROFILER_EXIT): Generate mem reference + for call instruction with mode QImode. + +2000-04-27 Alex Samuel + + * Makefile.in (OBJS): Add timevar.o. + (toplev.o): Depend on timevar.h. + (ggc-simple.o): Likewise. + (ggc-page.o): Likewise. + (timevar.o): New rule. + (timevar.h): New rule. + + * timevar.h: New file. + * timevar.c: Likewise. + * timevar.def: Likewise. + + * toplev.h (gc_time, parse_time, varconst_time): Remove. + * toplev.c: Use timevar_push and timevar_pop instead of TIMEVAR + throughout. + (TIMEVAR): Remove macro. + (gc_time, parse_time, varconst_time, integration_time, jump_time, + cse_time, gcse_time, loop_time, cse2_time, branch_prob_time, + flow_time, combine_time, regmove_time, sched_time, + local_alloc_time, global_alloc_time, flow2_time, peephole2_time, + sched2_time, dbr_sched_time, reorder_blocks_time, + rename_registers_time, shorten_branch_time, stack_reg_time, + to_ssa_time, from_ssa_time, final_time, symout_time, dump_time, + all_time): Remove. + (compile_file): Don't initialize time variables. Call + init_timevar and start TV_TOTAL timer. Call timevar_print instead + of many calls to print_time. + (rest_of_compilation): Add timing for reload_cse_regs. + (get_run_time): Removed to timevar.c. + (print_time): Likewise. + (get_run_time): Implement using TV_TOTAL time variable. + (print_time): Get total run time from get_run_time. + * ggc-page.c (ggc_collect): Push and pop TV_GC instead of + computing elapsed time explicitly. + * ggc-simple.c (ggc_collect): Likewise. + (gc_time): Remove declaration. + +2000-04-27 Mark Mitchell + + * calls.c (combine_pending_stack_adjustment_and_call): New function. + (expand_call): Use it. + +2000-04-27 Jan Hubicka + + * flow.c (mark_set_1): Handle MEMs in ZERO_EXTRACT/SIGN_EXTRACT + fields. + +Thu Apr 27 12:47:00 2000 Alexandre Oliva + + * config/mn10300/mn10300.md (movhi): Simplify. Prefer data + registers. + +Thu Apr 27 17:33:05 MET DST 2000 Jan Hubicka + + * function.c (epilogue_done): Pass whole insn to record_insns. + +Thu Apr 27 16:55:28 MET DST 2000 Jan Hubicka + + * cse.c (CSE_ADDRESS_COST): Remove. + (find_best_addr): Add new parameter "MODE", use address_cost instead + of CSE_ADDRESS_COST + (address_cost): New. + (fold_rtx): Update call of find_best_addr. + * rtl.h (address_cost): Declare. + * loop.c (general_induction_var): Add new parameter "MODE", use + address_cost instead of ADDRESS_COST + (init_loop): Use address_cost instead of ADDRESS_COST. + (check_insn_for_givs): Update call of general_induction_var. + (find_mem_givs): Likewise. + (consec_sets_giv): Likewise. + * config/i386/i386.h (ADDRESS_COST): Call ix86_address_cost. + * i386.c (ix86_address_cost): New. + * i386-protos.h (ix86_address_cost): Declare. + +Thu Apr 27 11:45:16 2000 Alexandre Oliva + + * config/mn10300/mn10300.md (movqi): Simplify. Prefer data + registers. + +Thu Apr 27 16:11:00 MET DST 2000 Jan Hubicka + + * expr.c (store_expr): Use clear_storage instead of direct memset + libcall. + +Thu Apr 27 10:36:51 2000 Alexandre Oliva + + * config/mn10300/mn10300.c (mn10300_address_cost): Test + ASHIFT, AND and LABEL_REF. + +Thu Apr 27 15:08:46 MET DST 2000 Jan Hubicka + + * invoke.texi (-foptimize-sibling-calls): Fix. + +Thu Apr 27 14:54:22 MET DST 2000 Jan Hubicka + + * loop.c (load_mems) Don't use hard registers for the hoisting. + + * unroll.c (unroll_loop): Avoid overflow in the n_iterations + calculation; rename const_equiv array in the preconditioning code + from loop_unroll to loop_unroll_precondition + +2000-04-27 Richard Henderson + + * flow.c (struct propagate_block_info): Remove new_dead, new_live; + add new_set. + (propagate_one_insn): Clear it. Don't update reg_live here. + (init_propagate_block_info): Update for pbi member changes. + (free_propagate_block_info): Likewise. + (mark_set_1): Know that zero_extract, sign_extract, and + strict_low_part don't kill their argument. Alter hard subregs. + Update new_set for non-CLOBBER sets. Update reg_live. + (find_auto_inc): Update reg_live, not new_dead. + (mark_used_reg): Update reg_live, not new_live. Examine new_set + to determine if the reg in question was set this insn. Only update + reg info with PROP_REG_INFO. + +2000-04-26 Richard Henderson + + * flow.c (allocate_reg_life_data): Set max_regno here ... + (life_analysis): ... not here. + + * flow.c (calculate_global_regs_live): Force stack pointer + live at end. + +2000-04-26 Richard Henderson + + * jump.c (redirect_exp_1): Rework from old redirect_exp. Never + commit change group changes. + (invert_exp_1): Similarly. + (redirect_exp, invert_exp): Use them. + (redirect_jump_1): New. + (invert_jump_1): New. + (jump_optimize_1): Remove code subsumed by condexec.c. + * rtl.h (invert_jump_1, redirect_jump_1): Declare. + +2000-04-26 Richard Henderson + + * rtlanal.c (dead_or_set_regno_p): Use find_regno_note. + + * genconfig.c (main): Set all HAVE_foo to 1. + + * graph.c (node_data): Use GET_NOTE_INSN_NAME instead of local array. + +2000-04-26 Alex Samuel + + * invoke.texi: Document -fssa flag. + +2000-04-26 Richard Henderson + + * flow.c (count_reg_sets_1): Remove. + (count_reg_sets, count_reg_references): Remove. + (recompute_reg_usage): Implement with update_life_info. + Reallocate life data. + +2000-04-26 Richard Henderson + + * flow.c (update_life_info): Consider blocks null to mean the + universal set. + (calculate_global_regs_live): Likewise. + (life_analysis): Do that instead of collecting all_blocks. + +2000-04-26 Richard Henderson + + * flow.c (tidy_fallthru_edge): Don't delete the jump when it's + a still-valid conditional jump. + +2000-04-26 Richard Henderson + + * jump.c (invert_jump): Always invert REG_BR_PROB. Do it correctly. + + * bb-reorder.c (reorder_basic_blocks): Don't run estimate_probability. + * flow.c (calculate_loop_depth): Remove. + * output.h (calculate_loop_depth): Don't declare. + * toplev.c (rest_of_compilation): Expand calculate_loop_depth + inline; run estimate_probability at the same time. + +2000-04-26 Neil Booth + + * cpplib.h: "~=" is not a single pp-token. + * cpplex.c: Correct commentary. + +2000-04-26 Richard Henderson + + * flow.c (mark_set_1): New arguments code and flags; update all + callers. Track regno_first and regno_last; do HARD_REGNO_NREGS + test in one place. Tidy flags tests. Don't bias REG_N_REFS by + loop_depth when optimizing for size. Do new_dead update after + emitting REG_UNUSED notes. Merge mark_set_reg code. + (mark_set_reg): Remove. + (propagate_one_insn): Use mark_set_1 for call-clobbered registers; + arrange to not emit REG_UNUSED notes. + +2000-04-26 Richard Henderson + + * flow.c (find_auto_inc): Use pbi->bb instead of BLOCK_FOR_INSN. + * ssa.c (convert_from_ssa): Don't run compute_bb_for_insn. + +2000-04-26 Richard Henderson + + * flow.c (propagate_one_insn): Break out from propagate_block. + (init_propagate_block_info): Likewise. + (free_propagate_block_info): Likewise. + (propagate_block): Use them. Export. + * basic-block.h: Declare them all. + +2000-04-26 Richard Henderson + + * basic-block.h (life_analysis): Declare here ... + * output.h: ... not here. + * flow.c (life_analysis): Remove nregs parameter; replace + remove_dead_code with flags. Remove ssa dead code check. + Only init alias analysis if we'll use it. + * reg-stack.c (reg_to_stack): Update life_analysis arguments. + * ssa.c (convert_to_ssa): Likewise. + (convert_from_ssa): Likewise. + * toplev.c (rest_of_compilation): Likewise. + +2000-04-26 Richard Henderson + + * flow.c (flow_delete_block): Rename from delete_block. Export. + * basic-block.h (flow_delete_block): Declare. + +2000-04-26 David S. Miller + + * optabs.c (emit_libcall_block): Verify insns with INSN_P before + taking a PATTERN of it. + +2000-04-26 + + * cpplex.c (spell_other, spell_char): Remove. + (SPELL_CHAR): New. + (token_spelling, trigraph_map): Use unsigned chars. + (_cpp_lex_line): Tidy up the switch statement. + * cpplib.h: Implement spell_char with spell_string. + (C): New. + +2000-04-26 + + * pa/pa32-regs.h (HARD_REGNO_MODE_OK): Warning removal. + * pa/pa64-regs.h (HARD_REGNO_MODE_OK): Warning removal. + +2000-04-26 Kaveh R. Ghazi + + * dwarf2out.c (dw_cfi_oprnd_struct, dw_fde_struct, add_fde_cfi, + reg_save, dwarf2out_frame_debug_expr, dwarf2out_def_cfa, + dwarf2out_window_save, dwarf2out_args_size, dwarf2out_reg_save, + dwarf2out_return_save, dwarf2out_return_reg, + dwarf2out_stack_adjust, dwarf2out_frame_debug, primary_filename, + add_AT_lbl_id, add_AT_lbl_offset, type_tag, decl_start_label, + gen_compile_unit_die, dwarf2out_init): Constify a char*. + + * dwarf2out.h (dwarf2out_init): Likewise. + + * dwarfout.c (filename_entry, primary_filename, last_filename, + type_tag, output_compile_unit_die, dwarfout_init): Likewise. + + * tree.h (dwarf2out_def_cfa, dwarf2out_window_save, + dwarf2out_args_size, dwarf2out_reg_save, dwarf2out_return_save, + dwarf2out_return_reg): Likewise. + +2000-04-26 Andreas Jaeger + + * extend.texi (Function Attributes): Fix description of pure + attribute. + +2000-04-26 Jason Merrill + + * integrate.c (output_inline_function): Do clear DECL_DEFER_OUTPUT + before calling rest_of_compilation. + +2000-04-26 Andreas Jaeger + + * config/mips/linux.h: Remove erroneous commit of #if 0/#endif in + last patch. + +2000-04-25 Richard Henderson + + * cse.c (cse_insn): Emit barrier after unconditional jump. + + * calls.c (expand_call): Disable tail call generation once + rtx_equal_function_value_matters is false. + + * reg-stack.c (convert_regs_1): Treat EDGE_ABNORMAL_CALL edges + like EDGE_EH edges. + +2000-04-25 Jason Merrill + + * dwarf2out.c (add_bound_info): Don't crash on an unexpanded SAVE_EXPR. + + * dwarfout.c (output_decl): Ignore NAMESPACE_DECLs. + + * dwarf2out.c (gen_subprogram_die): The class-scope declaration DIE + is the primary DIE for a member function. + (gen_decl_die): Call set_decl_origin_self here. + * dwarfout.c (output_decl): And here. + * integrate.c (output_inline_function): Not here. + Don't clear DECL_INLINE until after calling rest_of_compilation. + (set_decl_origin_self): No longer static. + * tree.h: Add prototype. + * toplev.c (note_deferral_of_defined_inline_function): Only write + out abstract instance for actual inlines. + +2000-04-25 Alexandre Oliva + + * config/mn10300/mn10300.h (REG_CLASS_FROM_LETTER): Return + EXTENDED_REGS only if TARGET_AM33. + * config/mn10300/mn10300.md (movsi, addsi): Avoid exposing + SP_REGS to register allocation and reloading unless absolutely + necessary. + (movsi3): Remove special-case of adding non-constants to SP. + +2000-04-25 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_NEED_DECLARATION): This macro now requires + INCLUDES to search and does not provide any of its own. Also it + now accepts optional ACTION-IF-NEEDED and ACTION-IF-NOT-NEEDED + parameters. Also it does not call AC_DEFINE. + (gcc_AC_NEED_DECLARATIONS): Likewise. Also this macro now calls + AC_DEFINE and provides for automatic entries for autoheader. + (gcc_AC_FUNC_PRINTF_PTR): Cleanup C code in test. + + * configure.in (gcc_AC_NEED_DECLARATIONS): Save and restore CFLAGS + so we can pass -I flags and include gansidecl.h/system.h in this + test. + + * acconfig.h: Delete all NEED_DECLARATION_* entries. + +2000-04-25 Kaveh R. Ghazi + + * acconfig.h (ENABLE_STD_NAMESPACE, ENABLE_CHECKING, + ENABLE_TREE_CHECKING, ENABLE_RTL_CHECKING, ENABLE_GC_CHECKING, + ENABLE_GC_ALWAYS_COLLECT): Delete entries. + + * configure.in (ENABLE_STD_NAMESPACE, ENABLE_CHECKING, + ENABLE_TREE_CHECKING, ENABLE_RTL_CHECKING, ENABLE_GC_CHECKING, + ENABLE_GC_ALWAYS_COLLECT): Use three argument form of AC_DEFINE + for these macros. Clean up spacing and linewraps. + +2000-04-26 Jason Merrill + + * calls.c (expand_call): Use get_callee_fndecl. + + * print-tree.c (print_node): Print the chain of an _EXPR. + +Tue Apr 25 16:16:04 2000 Andrew MacLeod + Jim Wilson + Andrew Haley + + * config/ia64/crtbegin.asm: Add IA-64 unwind support. Correct alloc + and gp save/restore problems. + * config/ia64/crtend.asm: Add IA-64 unwind support. + * config/ia64/ia64.c (ia64_compute_frame_size): Don't include pr_size + in fr_pad_size calculation. + (save_restore_insns): Move PR save area. Correct uses of + RTX_FRAME_RELATED_P. + (ia64_expand_prologue): Mark alloc with RTX_FRAME_RELATED_P. + (ia64_expand_epilogue): Add eh_epilogue support. + (ia64_function_prologue): Emit .prologue directive. + (ia64_init_machine_status, ia64_mark_machine_status): New functions. + (ia64_override_options): Set init_machine_status and + mark_machine_status. + (rtx_needs_barrier): Handle bsp reads and writes. + (spill_offset, sp_offset, spill_offset_emitted, tmp_reg, tmp_saved): + New static variables. + (process_set, process_for_unwind_directive): New functions. + * config/ia64/ia64.h (ASM_OUTPUT_XDATA_CHAR, ASM_OUTPUT_XDATA_SHORT, + ASM_OUTPUT_XDATA_INT, ASM_OUTPUT_XDATA_DOUBLE_INT, ASM_OUTPUT_EH_CHAR, + ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT, ASM_OUTPUT_EH_DOUBLE_INT): New + macros. + (EH_FRAME_SECTION_ASM_OP): Define to IA_64.unwind section. + (IA64_UNWIND_INFO, HANDLER_SECTION, IA64_UNWIND_EMIT): Define. + (struct machine_function): Define. + * config/ia64/ia64.md (bsp_value, set_bsp, eh_epilogue): New patterns. + +2000-04-25 Bruce Korb + + * fixinc/Makefile.in: make the removal of old programs more + robust + * fixinc/mkfixinc.sh: use the two new targets in the Makefile: + install-bin and install-sh + +2000-04-25 Nick Clifton + + * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): If not + defined, define to return zero. + (function_cannot_inline_p): If a function has any target + specific attributes, then use the macro + FUNCTION_ATTRIBUTE_INLINABLE_P to allow the target to decide + whether it can be inlined. If it cannot, issue a suitable + explanation. + + * tm.texi: Add a new node 'Inlining' to document the new macro + FUNCTION_ATTRIBUTE_INLINABLE_P. + +2000-04-25 Zack Weinberg + + * cpplib.h (struct cpp_buffer): Add 'mapped' flag; fix + commentary. + +2000-04-25 Neil Booth + + Restore previous patch, plus the following fixes: + + * cpphash.c (_cpp_create_definition): Test PREV_WHITESPACE in + flags, not CPP_OPEN_PAREN. + * cpplex.c (expand_token_space, init_token_list, + cpp_free_token_list): Put the dummy token at list->tokens[-1]. + (_cpp_lex_line, _cpp_lex_file): token list is 0-based. + +Tue Apr 25 14:06:40 2000 Alexandre Oliva + + * config/i386/freebsd.h (INT_ASM_OP): Define. + +Tue Apr 25 14:51:07 MET DST 2000 Jan Hubicka + + * loop.c (strength_reduce): Fix typo in the last checkin. + +Tue Apr 25 07:33:12 2000 Richard Kenner + + * stor-layout.c (finalize_record_size): Simplify to use existing + functions. + (compute_record_mode): No longer static. + * tree.h (compute_record_mode): New declaration. + +2000-04-25 Neil Booth + + * Revert my patch below until cause of build failures + determined. + +2000-04-25 Richard Henderson + + * combine.c (combine_instructions): Add missing argument + to try_combine. + + * toplev.c (rest_of_compilation): Delay sibcall optimization + until after emit_eh_context. + +2000-04-24 Nick Clifton + + * combine.c (combine_instructions): Do not try to combine a + sequence of insns when the second insn has been replaced by a + note. + +Mon Apr 24 17:34:18 2000 Mumit Khan + + * gcc.c (load_specs): New static function. + (read_specs): Use it. + + * gcc.c (lookup_compiler): Make multiple passes for case + insensitive filesystems. + +2000-04-24 Neil Booth + + * cpphash.c: replace HSPACE_BEFORE with PREV_WHITESPACE. + * cpphash.h (_cpp_check_directive): new. + * cpplex.c (handle_newline, cpp_free_token_list, + init_trigraph_map, trigraph_ok, trigraph_replace, + backslash_start, skip_block_comment, skip_line_comment, + skip_whitespace, parse_name, parse_number, parse_string, + copy_comment, _cpp_lex_line, spell_char, spell_string, + spell_comment, spell_name, spell_other, _cpp_lex_file, + _cpp_output_list): new. + (expand_name_space): take length argument. + (init_token_list): add comment list initialisation. + (cpp_scan_line): use auto_expand_name_space. PREV_WHITESPACE + instead of HSPACE_BEFORE. + + * cpplib.c (_cpp_check_directive): new + * cpplib.h (cpp_name, PREV_WHITESPACE, PREV_COMMENT, + DIGRAPH, UNSIGNED_INT, TOK_NAME): new. + (HSPACE_BEFORE): delete. + (TTYPE_TABLE): rearrange. + (struct cpp_toklist): update. + +2000-04-24 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_HEADER_STRING, gcc_AC_FUNC_PRINTF_PTR, + gcc_AC_C_VOLATILE, gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG): Use the three + argument form of AC_DEFINE. + + * configure.in (DEFAULT_LINKER, DEFAULT_ASSEMBLER, + HAVE_INTTYPES_H, PACKAGE, VERSION, ENABLE_WIN32_REGISTRY, + WIN32_REGISTRY_KEY, HAVE_GAS_SUBSECTION_ORDERING, HAVE_GAS_WEAK, + HAVE_GAS_HIDDEN, HAVE_AS_REGISTER_PSEUDO_OP, AS_SPARC64_FLAG, + HAVE_AS_OFFSETABLE_LO10, ENABLE_NEW_GXX_ABI): Likewise. + + * acconfig.h: Delete stubs made redundant by 3-arg AC_DEFINE. + +2000-04-24 Kaveh R. Ghazi + + * Makefile.in (GCC_FOR_TARGET, GCC_CFLAGS, LIBGCC2_INCLUDES, + deduced.h): Use -isystem, not -I, for including system headers. + +2000-04-24 Nick Clifton + + * config/fr30/fr30.md (addsi3): Do not use small add instruction if + the source register is the frame pointer or arg pointer. + (addsi3_small_int): Disallow if source register is the frame + pointer or arg pointer. + +2000-04-24 Kaveh R. Ghazi + + * configure.in (ENUM_BITFIELDS_ARE_UNSIGNED): Delete redundant + call to AC_MSG_RESULT. + +2000-04-24 Martin v. Löwis + + * invoke.texi: Correct grammatical errors, document + -fno-gnu-keywords as identical to -fno-asm for C++. + +2000-04-24 Kaveh R. Ghazi + + * aclocal.m4: (GCC_HEADER_STRING, GCC_NEED_DECLARATION, + GCC_NEED_DECLARATIONS, GCC_FUNC_VFPRINTF_DOPRNT, + GCC_FUNC_PRINTF_PTR, GCC_PROG_LN_S, GCC_PROG_LN, GCC_C_VOLATILE, + AC_GCC_C_LONG_DOUBLE, GCC_FUNC_MKDIR_TAKES_ONE_ARG, + EGCS_PROG_INSTALL): Rename autoconf macros with prefix gcc_AC_. + + * configure.in (AC_GCC_C_LONG_DOUBLE, GCC_PROG_LN, GCC_PROG_LN_S, + GCC_C_VOLATILE, EGCS_PROG_INSTALL, GCC_HEADER_STRING, + GCC_FUNC_VFPRINTF_DOPRNT, GCC_FUNC_PRINTF_PTR, + GCC_NEED_DECLARATIONS, GCC_FUNC_MKDIR_TAKES_ONE_ARG): Invoke with + new macros names. + +2000-04-24 Mumit Khan + + * c-pragma.c (push_alignment): Use BITS_PER_UNIT macro. + (pop_alignment): Likewise. + (handle_pragma_token): Likewise. + +2000-04-24 Robert Lipe + + * tree.h (tree_decl): Member `mode' now ENUM_BITFIELD. + +2000-04-24 Hiroyuki Machida + + * combine.c (try_combine): Update reg_nonzero_bits of + newi2pat before newpat. + +Mon Apr 24 10:19:48 MET DST 2000 Jan Hubicka + + * loop.c (strength_reduce): Simplify test to INSN_P. + (record_giv): Attempt to simplify the add value, use CONSTANT_P + expressions instead of CONST_INT. + (express_from_1): Likewise. + +2000-04-24 Mark Mitchell + + * regs.h (reg_n_max): Don't declare. + * flow.c (reg_n_max): Don't define. + * regclass.c (renumber): Don't initialize to zero. + (regno_allocated): Likewise. + (reg_n_max): Define. + (allocate_reg_info): Don't initialize unnecessarily. + +Mon Apr 24 00:21:36 2000 Jeffrey A Law (law@cygnus.com) + + * genattrtab.c (find_attr): Initialize unsigned_p, func_units_p + and blockage_p in the newly allocated attribute. + +Sun Apr 23 20:16:49 2000 Alexandre Oliva + + * config/mn10300/mn10300.md (addsi): `inc4' on address + registers does not modify cc, but `inc' on an extended + register does. + +Sun Apr 23 16:24:35 2000 Denis Chertykov + + * reload.c (find_equiv_reg): Checks all valueno regs + as a reload_reg_p regs. + +2000-04-23 Zack Weinberg + + * cpphash.c (collect_objlike_expansion): Add sanity check. + (special_symbol): Remove case T_CONST, T_XCONST, T_MCONST. If + the buffer is the empty string, return. Mark __DATE__ and + __TIME__ as XCONST nodes, not MCONST. + (_cpp_macroexpand): Avoid pushing an empty buffer. + (funlike_macroexpand): Don't pop token_buffer here. + +Sun Apr 23 18:37:53 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (REGNO_IN_RANGE_P): New macro. + (REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_SP_P): New macros. + (REGNO_EXTENDED_P, REGNO_AM33_P): New macros. + (REGNO_OK_FOR_BASE_P): Define in terms of them. + (REGNO_OK_FOR_BIT_BASE_P, REGNO_OK_FOR_INDEX_P): Likewise. + (REG_OK_FOR_BASE_P): Define in terms of the REGNO macro. + (REG_OK_FOR_BIT_BASE_P, REG_OK_FOR_INDEX_P): Likewise. + +Sun Apr 23 22:23:08 MET DST 2000 Jan Hubicka + + * loop.c (simplify_giv_expr): Be more agressive on simplifying + constant MULT givs. + +2000-04-23 Zack Weinberg + + * cpphash.h (struct definition): Move file, line, col members... + (struct hashnode): ... here. Also add 'disabled' flag. + (enum node_type): Add T_VOID, T_XCONST, T_FMACRO, and + T_IDENTITY. Remove T_DISABLED. + Update prototypes. + + * cpphash.c (_cpp_dump_definition): Split out dump_DEFINITION. + (collect_expansion): Split into collect_objlike_expansion and + collect_funlike_expansion. + (_cpp_macroexpand): Split out scan_arguments, stringify, and + funlike_macroexpand. + (_cpp_compare_defs): Rename compare_defs, make static. + (_cpp_make_hashnode): Initialize hp->disabled. + (macro_cleanup): Adjust for new token types. Clear + m->disabled. + (_cpp_create_definition): Move code here to determine what + sort of macro it is, and code to check for redefinitions, from + do_define. Implement a few simple cases without creating a + full DEFINITION. + (_cpp_macroexpand, special_symbol, _cpp_dump_definition): + Handle the simple cases. + (push_macro_expansion): Set buf->has_escapes and hp->disabled + here. + + * cppinit.c (builtin_array): Change MCONST to XCONST + everywhere. + * cpplex.c (maybe_macroexpand): Handle IDENTITY macros here; + fix check for disabled and function-like macros. + * cpplib.c (do_define): Move most logic to + _cpp_create_definition. + (do_undef): Handle new special token types. + +Sun Apr 23 14:27:44 MET DST 2000 Jan Hubicka + + * loop.c (maybe_eliminate_biv_1): Use GET_CODE (x) == CONST_INT instead + of CONSTANT_P for mult_val; always use validate_change to update insn. + +2000-04-22 Zack Weinberg + + * cpphash.c (trad_stringify, add_pat): New functions. + (collect_expansion): Restore support for -traditional syntax. + Use trad_stringify and add_pat. + (_cpp_macroexpand): Restore support for -traditional semantics. + * cpplex.c (_cpp_scan_line): Don't change space_before if we + get a COMMENT token. + (_cpp_lex_token): Provide COMMENT tokens to caller if + traditional and parsing_define_directive. + (skip_comment): Warn about // comments if -Wtraditional. + * cpplib.c (do_define): Fix typo. Create EMPTY nodes with + proper node type. + (do_undef): Don't warn about undefining EMPTY nodes. + +Sat Apr 22 22:35:38 MET DST 2000 Jan Hubicka + + * loop.c (strength_reduce): Fix biv removal code. + +2000-04-22 Richard Henderson + + * predict.c (estimate_probability): Examine both sides of + a branch for no exits. Use 90% not 50% for predict taken. + Reorg for one copy of note generation code. + +2000-04-22 Richard Henderson + + * flow.c (mark_used_reg): Hack around rs6000 eliminable pic reg. + +2000-04-22 Richard Henderson + + * diagnostic.c (init_output_buffer): Don't initialize format_args. + (output_clear): Likewise. + (output_printf): Use va_copy. + (vline_wrapper_message_with_location): Likewise. + (v_message_with_decl): Likewise. + (line_wrapper_printf): VA_START infor buffer.format_args directly. + * system.h (va_copy): Provide default implementation. + +2000-04-22 Richard Henderson + + * predict.c (expected_value_to_br_prob): Don't bomb if op1 of + the collected condition is not a constant. + +2000-04-22 Gabriel Dos Reis + + * diagnostic.h: New file. + + * Makefile.in (diagnostic.o): Depends on diagnostic.h + + * diagnostic.c: Tweak. Rationalize the output logic. Adjust + various function prototypes. + (diagnostic.h): #include. + (struct output_buffer): Move into diagnostic.h. + (get_output_prefix): Rename to output_get_prefix. Export. + (init_output_buffer): Export. Break out. Adjust initialization. + (output_space_left, output_append): Export. + (output_newline): Rename to output_add_newline. Export. + (output_clear): Nullify additional output_buffer fields. + (output_puts): Rename to output_add_string. Export. + (dump_output): Rename to output_flush_on. Export. + (build_location_prefix): Constify return-type. + (emit_output_prefix): Rename to output_emit_prefix. Export. + (set_real_maximum_length): New function. + (output_set_maximum_length): Ditto + (output_clear): Ditto. + (output_add_character): Ditto. + (output_add_integer): Ditto. + (output_add_space): Ditto. + (output_format): Ditto. + (output_printf): Adjust buffer initialization. + (vline_wrapper_message_with_location): Ditto. + (v_message_with_decl): Ditto. Adjust call to output_puts + and get_output_prefix. + (default_print_error_function): Adjust buffer initialization. + +Sat Apr 22 06:45:04 2000 Richard Kenner + + * expr.c (preexpand_calls, case CALL_EXPR): Don't look at TYPE_SIZE + of VOID_TYPE. + +Fri Apr 21 18:33:09 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (REGNO_REG_CLASS): Use NO_REGS instead + of explicit 0. + +Fri Apr 21 18:30:00 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (REGISTER_MOVE_COST): Provide more + accurate data about SP moves. + +Fri Apr 21 18:28:28 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (ADDITIONAL_REGISTER_NAMES): Added + aliases to AM33 registers. + +Fri Apr 21 18:26:17 2000 Alexandre Oliva + + * config/mn10300/mn10300.h (REG_CLASS_CONTENTS): Added register 16 + to all EXTENDED bitmaps. + +Fri Apr 21 18:17:12 2000 Alexandre Oliva + + * config/mn10300/mn10300-protos.h (mn10300_address_cost): Declare. + * config/mn10300/mn10300.h (ADDRESS_COST): New macro. + * config/mn10300/mn10300.c (mn10300_address_cost): New function. + +Fri Apr 21 18:11:56 2000 Alexandre Oliva + + * config/mn10300/mn10300.md (movdi, movdf): Do not use `movu' when + the operand is not constant. + +Fri Apr 21 14:58:29 2000 Denis Chertykov + + * reload.c (find_equiv_reg): Checks all valueno and regno regs + as a call-clobbered regs. + +Fri Apr 21 13:30:26 2000 Richard Kenner + + * rtl.c: Use NOTE_INSN_REPEATED_LINE_NUMBER and NOTE_INSN_RANGE_BEG. + * rtl.h: Likewise. + * rtl.def: Update comment. + * function.c (expand_function): Use NOTE_INSN_REPEATED_LINE_NUMBER. + * integrate.c (expand_inline_function): Likewise. + * profile.c (branch_prob): Likewise. + * ggc-common.c (ggc_mark_rtx_children): Use NOTE_INSN_RANGE_BEG. + * print-rtl.c (print_rtx): Likewise. + * haifa-sched.c (sched_analyze, unlink_other_notes): Likewise. + (reemit_notes): Likewise; also use enum insn_note. + + * stor-layout.c (layout_decl): Only set DECL_MODE if not already set. + (place_field): Properly compute know and actual alignment. + + * gengenrtl.c (gencode): Write obstack_alloc_rtx function start + in proper format. + + * cse.c (cse_insn): In (set REG0 REG1) case, remove a REG_EQUAL + note for REG1. + +2000-04-21 Zack Weinberg + + * cpphash.c (struct arg, struct arglist): Const-ify strings. + (warn_trad_stringify, duplicate_arg_p): New helper functions. + (collect_expansion): Rewrite to scan over a token list. + Remove -traditional support. + (collect_formal_parameters): Rename to collect_params; rewrite + to scan over a token list. + (_cpp_create_definition): Adjust to scan a token list. + (_cpp_macroexpand): Remove -traditional support. + (_cpp_compare_defs): Whitespace is now canonicalized. + (comp_def_part): Delete function. + + * cpphash.h: Update prototypes. + * cpplex.c (init_token_list): Don't set lineno if there is no + buffer. + (pedantic_whitespace): New function. + (_cpp_scan_line): Mark tokens that had hspace before. Don't + consume a newline. Use pedantic_whitespace. + (_cpp_lex_token): Remove support for -traditional macros. + (_cpp_get_define_token): Delete. + (_cpp_get_directive_token): Do the real work here. Use + pedantic_whitespace. + (_cpp_init_input_buffer): Initialize pfile->directbuf. + + * cpplib.c (get_macro_name): Delete. + (do_define): Read the entire line into pfile->directbuf, then + feed the token list to _cpp_create_definition. + * cpplib.h (HSPACE_BEFORE): new define. + (struct cpp_reader): Add a toklist member, "directbuf". + + * predict.c (estimate_probability): New heuristic: if a jump + branches around a block with no successors, predict it taken. + Disentangle control flow. + +2000-04-20 Richard Henderson + + * loop.c (emit_iv_add_mult): Revert last change. + +2000-04-20 Zack Weinberg + + * cpplib.h (enum cpp_ttype): Add token types for all + punctuators. Distinguish pp-numbers from valid C numbers. + Give some tokens better names. Initialize from macro. + (struct cpp_name, cpp_token, cpp_toklist): New data + structures. + Update prototypes. + * cpplex.c (bump_column, expand_name_space, + expand_token_space, init_token_list, cpp_output_list, + _cpp_scan_line): New functions. + (output_line_command): Add third argument, new line number. + * cpphash.h: Update prototypes. + * cppexp.c, cpphash.c, cpplib.c, scan-decls.c: Update for new + token names. + +2000-04-20 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_floatuns): Emit missing barrier. + +2000-04-20 Zack Weinberg + + * c-common.c (decl_attributes) [A_ALIAS]: Set TREE_USED on the + object pointed to. + +Thu Apr 20 14:19:18 MET DST 2000 Jan Hubicka + + * loop.c (emit_iv_add_mult): Simplify it's input and emit + REG_EQUAL note explaining the calculated value. + + * calls.c (expand_call): Avoid unnecesary precalculation + and outgoing parameters space guarding for sibling calls. + (store_one_arg): Likewise. + +Thu Apr 20 08:01:07 2000 Richard Kenner + + * toplev.c (enum dump_file_index, dump_file): Add DFI_sibling. + (rest_of_compilation): Write sibling dump file and account + for time as jump time. + * invoke.texi: Update documentation on dump flags. + +2000-04-19 Marek Michalkiewicz + + * avr.c: #include "system.h" instead of and . + +2000-04-19 Zack Weinberg + + * cpphash.c (special_symbol): Represent an empty macro with + "\r \r " not just "\r ". + (_cpp_macroexpand): Correct condition for the foo ( ) special + case. + (unsafe_chars): Handle EOF as second argument. + (push_macro_expansion): Simplify test for removing escape at + end. Do not trim both escapes if there is no text in between. + +2000-04-19 Jim Blandy + + * dwarf2out.c (DWARF2_ADDR_SIZE): New macro. Use it instead + of PTR_SIZE, when appropriate. + +2000-04-19 Mark Mitchell + + * system.h (ONLY_INT_FIELDS): Make sure it is defined. + (USE_ENUM_BITFIELDS): Fix typo. + +Wed Apr 19 12:14:55 2000 Richard Kenner + + * stor-layout.c (place_field): Set rli->offset_align properly. + +2000-04-19 Kaveh R. Ghazi + + * mips.h (BITS_PER_WORD, UNITS_PER_WORD, UNITS_PER_FPREG, + INT_TYPE_SIZE, LONG_TYPE_SIZE, POINTER_SIZE, POINTER_BOUNDARY, + PARM_BOUNDARY): Remove unnecessary casts. + +Wed Apr 19 12:02:37 MET DST 2000 Jan Hubicka + + * calls.c (precompute_arguments): Remove must_preallocate and + args_size calls. + (expand_call): Update call of precompute_arguments. + + * loop.c (check_insn_for_bivs, for_every_insn_in_loop, + check_insn_for_givs): Break out from ... + (strength_reduce) ... here; use for_every_insn_in_loop to call + check_insn_for_givs. + * loop.h (for_every_insn_in_loop): Declare. + (loop_insn_callback): New type. + +2000-04-18 Zack Weinberg + + * cpplib.c (do_pragma_poison): Strings in the token buffer are + not nul-terminated. + +Tue Apr 18 16:04:12 2000 Jim Wilson + + * config/ia64/sysv4.h (SELECT_SECTION): Use data_section if + flag_pic and RELOC. + +2000-04-18 Zack Weinberg + + * cccp.c, cexp.y, cexp.c, cccp.1: Removed. + + * configure.in: Delete --disable-cpplib option and all + references to cpp_main. + * configure: Regenerate. + * Makefile.in: Remove all references to CCCP, CCCP_OBJS, + @cpp_main@, cccp.c, cexp.c, cexp.y, cexp.output, cexp.o, + cccp.o, cccp, or cppmain. Link cppmain.o straight to + cpp$(exeext). Add --no-headers to makeinfo command line when + generating INSTALL. Install and uninstall cpp.1 manpage, not + cccp.1. + * install.texi: Delete all references to cexp.y/cexp.c. + Delete ancient instructions for compiling GCC on 3b1. + * INSTALL: Regenerate. + + * cppfiles.c, cpplib.h, jump.c, protoize.c, c-lex.c, mips/t-ecoff, + mips/t-elf, mips/t-r3900: Remove references to cccp.c. + * convex.h, fx80.h, m68k.h, pdp11.h: Remove references to + cexp.c/cexp.y. + * xm-linux.h, xm-os2.h, romp.h: Remove definition of BSTRING, + which is no longer tested anywhere. + + * cppinit.c (handle_option): Don't run error message through + gettext twice. + +Tue Apr 18 14:16:47 2000 Richard Kenner + + * conflict.c (conflict_graph_add): Pass enum type to htab_find_slot. + * cpperror.c (hashtab.h): Now include. + * cppexp.c (hashtab.h): Likewise. + * cpplex.c (hashtab.h): Likewise. + * cppfiles.c (hashtab.h): Likewise. + (find_include_file, _cpp_calc_hash, cpp_read_file): Pass enum type + to htab_find_slot_with_hash. + * cpphash.c (hashtab.h): Now include. + (_cpp_lookup_slot): INSERT is now enum insert_option. + * cpphash.h (_cpp_lookup_slot): Likewise. + * cppinit.c (hashtab.h): Include earlier. + (initialize_builtins): Pass enum to htab_find_slot. + * cpplib.c (hashtab.h): Now include. + (do_define, do_undef): Pass enum type to _cpp_lookup_slot. + (do_pragma_poison, do_assert): Likewise. + * emit-rtl.c (gen_rtx_CONST_INT): Pass enum to + htab_find_slot_with_hash. + * simplify-rtx.c (cselib_lookup_mem, cselib_lookup): Likewise. + * tree.c (type_hash_add): Likewise. + (build1): Minor cleanup. + + * ggc-common.c: Add missing blanks. + * print-tree.c (print_node): Print DECL_OFFSET_ALIGN. + * tree.h (DECL_OFFSET_ALIGN): Fix typo in comment. + + * stmt.c (mark_case_node): New function. + (mark_case_nesting): Call it. + + * expmed.c (emit_store_flag): If comparing two-word integer + with zero, can optimize NE, EQ, GE, and LT. + + * c-decl.c (mark_binding_level): Use 'for' instead of `while'. + * conflict.c: Minor cleanups. + * optabs.c: Add blank line + * simplify-rtx.c: Minor cleanups. + +2000-04-18 Stan Cox + + * gengenrtl.c (genlegend): Fix misspelling. + +2000-04-18 Robert Lipe + + * configure.in (ENUM_BITFIELDS_ARE_UNSIGNED): Added. Check that + bitfields of the host compiler are not signed quantities. + * config.in: Regenerate. + * configure: Regenerate. + * system.h (USE_ENUM_BITFIELDS): Added. + (ENUM_BITFIELDS): Added. + * rtl.h (rtx_def): Members `code', `mode', now ENUM_BITFIELD. + (SHORT_ENUM_BUG): Deleted. + * tree.h (tree_common): Members `code', `mode', `built_in_class', + now ENUM_BITFIELD. + * config/i386/xm-sco.h (ONLY_INT_FIELDS): Deleted. + (CODE_FIELD_BUG): Likewise. + * config/m68k/x-apollo68 (CC): Deleted SHORT_ENUM_BUG. + (OLD_CC): Likewise. + * config/m68k/x-ccur (X_CFLAGS): Likewise. + +2000-04-18 Mark Mitchell + + * cpplex.c (_cpp_lex_token): Don't call CPP_BUMP_LINE when the + mark is active. + +2000-04-17 Zack Weinberg + + * cppexp.c (lex): Don't assume tokens are NUL terminated. + * cpplib.c (do_include, do_import, do_include_next, + read_line_number, detect_if_not_defined): Likewise. + * cpphash.c (collect_expansion): Likewise. + (special_symbol, _cpp_macroexpand): Check return from + cpp_file_buffer. + * cpphash.h (CPP_NUL_TERMINATE, CPP_NUL_TERMINATE_Q): Delete + macros. Delete all uses. + + * gcc.dg/cpp-mi.c: Add two more test cases. + * gcc.dg/cpp-mind.h, gcc.dg/cpp-mindp.h: New files. + +2000-04-17 Richard Henderson + + * bb-reorder.c (fixup_reorder_chain): Don't look up new block again. + (reorder_basic_blocks): If no epilogue in rtl, force last block last. + +2000-04-17 Mark Mitchell + + * function.c (expand_function_start): Use hard_function_value to + compute the RTL to use for DECL_RESULT. + +Mon Apr 17 23:35:29 MET DST 2000 Jan Hubicka + + * i386.c (athlon_cost): Fix lea, divide and XFmode move costs. + (x86_integer_DFmode_moves, x86_partial_reg_dependency, + x86_memory_mismatch_stall): New global variables. + (ix86_adjust_cost): Handle MEMORY_BOTH on places MEMORY_STORE was only + alloved; fix load penalties for Athlon. + * i386.h (x86_integer_DFmode_moves, x86_partial_reg_dependency, + x86_memory_mismatch_stall): Declare. + (TARGET_INTEGER_DFMODE_MOVES, TARGET_PARTIAL_REG_DEPENDENCY, + TARGET_MEMORY_MISMATCH_STALL): New. + * i386.md (athlon scheduling parameters): Fix latencies according to + Athlon Optimization Manual. + (sahf, xchg, fldcw, leave instruction patterns): Set athlon_decode to + vector. + (fsqrt instruction patterns): Set athlon_decode to direct. + (movhi_1): Promote for TARGET_PARTIAL_REG_DEPENDENCY and for + PARTIAL_REGISTER_STALL with !TARGET_HIMODE_MATH machines. + (movqi_1): Handle promoting correctly for TARGET_PARTIAL_REG_DEPENDENCY + and TARGET_PARTIAL_REGISTER_STALL machines. + (pushdf_nointeger): New pattern. + (pushdf_integer): Rename from pushdf. + (movdf_nointger): Enable for !TARGET_INTEGER_DFMODE_MOVES machines. + (movdf_intger): Disable for !TARGET_INTEGER_DFMODE_MOVES machines. + +2000-04-17 Richard Henderson + + * loop.c (canonicalize_condition): Add WANT_REG argument. + Stop the search if we match it. + * expr.h (canonicalize_condition): Update decl. + * predict.c (expected_value_to_br_prob): Use it. Track last + expected value note. + (find_expected_value): Remove. + + * reorg.c (mostly_true_jump): Always use BR_PROB if present. + +2000-04-17 Zack Weinberg + + * aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE([AC_FUNC_MMAP]). + (AC_FUNC_MMAP_FILE): New macro, tests read-only private map of + a plain file. + * configure.in: Call AC_FUNC_MMAP_FILE. + * configure: Regenerate. + * config.in: Regenerate. + + * intl/loadmsgcat.c: Test HAVE_MMAP_FILE not HAVE_MMAP. + * fixinc/fixincl.c: Likewise. + +2000-04-17 Richard Henderson + + * builtins.c (expand_builtin_expect): New. + (expand_builtin): Call it. + * builtins.def (BUILT_IN_EXPECT): New. + * c-common.c (c_common_nodes_and_builtins): Declare __builtin_expect. + * extend.texi: Document it. + + * predict.c (expected_value_to_br_prob): New. + (find_expected_value): New. + * basic-block.h (expected_value_to_br_prob): Declare. + * toplev.c (rest_of_compilation): Invoke it. + + * rtl.h (NOTE_EXPECTED_VALUE): New. + (NOTE_INSN_EXPECTED_VALUE): New. + * rtl.c (note_insn_name): Update. + * print-rtl.c (print_rtx): Reorg NOTE_LINE_NUMBER special + cases; handle NOTE_INSN_EXPECTED_VALUE. + +2000-04-17 Jakub Jelinek + + * config/sparc/sparc.c (eligible_for_sibcall_delay): Cannot use + leaf sibcall delay slot if flag_pic. + (output_sibcall): Always emit call for leaf sibcall if flag_pic. + +2000-04-17 Kaveh R. Ghazi + + * Makefile.in (stmp-fixproto): Acknowledge errors in fixproto. + + * fixproto: If fix-header fails, exit with an error. + +Mon Apr 17 14:59:36 MET DST 2000 Jan Hubicka + + * cse.c (struct check_dependence_data): New. + (check_dependence): New function. + (invalidate): Use check_depdenence. + +2000-04-16 Mark Mitchell + + * dwarf2out.c (DWARF_CIE_DATA_ALIGNMENT): Adjust, now that + UNITS_PER_WORD is unsigned. + + * tree.h (struct tree_common): Remove misleading comment. + +2000-04-16 Dave Pitts + + * Makefile.in ($(srcdir)/c-parse.y: c-parse.in): Enclose the whole + message in quotes. Otherwise, IBM's make program treats the '#' as the + start of a comment and ignores the remainder of the line. + + * c-lex.c (yylex): Change for EBCDIC, lower case characters precede + upper case. + * cccp.c (initialize_char_syntax): Allow for holes in EBCDIC. + * cexp.y (initialize_random_junk): Likewise. + * cppfiles.c (find_include_file): Cast alloca return value. + * cppinit.c (initialize_standard_includes): Likewise. + * cpplib.c (cpp_define, cpp_undef): Likewise. + * defaults.h (ASM_OUTPUT_ASCII): Use ISPRINT. + * final.c (output_asm_insn): Allow for holes in EBCDIC. + * fold-const.c (CHARMASK): New. + (real_hex_to_f): Use it. + * real.c (CHARMASK): New. + (etoasc, asctoeg): Use it. + (asctoeg): EBCDIC lower case characters precede upper case. + + * i370.c (mvs_add_label): Change spacing for coding conventions. + * i370.h (ASM_OUTPUT_CASE_LABEL): Change to the data CSECT for the + outputting case vectors. + (ASM_OUTPUT_CASE_END): New, put assembler back into code CSECT. + (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Remove page check, + since vector in in the data CSECT. + (ASM_OUTPUT_REG_POP, ASM_OUTPUT_REG_PUSH): Restore to correct operation. + * i370.md (Many patterns): Put the length in the XL directives. + (movdi): Put back STM and MVC in definition. + (floatsidf2): Correct TARGET_ELF_ABI pattern and add back the LE370 + pattern using the TCA. + * oe.h (CPP_SPEC): Added to allow trigraphs. + * xm-oe.h (HOST_BITS_PER_LONGLONG): Change to 32. IBM's compiler does + not support the "long long" type. + +2000-04-16 Mark Mitchell + + * config/mips/mips-protos.h (mips_legitimate_address_p): New + function. + (mips_reg_mode_ok_for_base_p): Likewise. + * config/mips/mips.h (REG_OK_STRICT_P): Don't define. + (REG_OK_FOR_INDEX_P): Define unconditionally. + (REG_MODE_OK_FOR_BASE_P): Use mips_reg_mode_ok_for_base_p. + (GO_IF_LEGITIMATE_ADDRESS): Use mips_legitimate_address_p. + * config/mips/mips.c (mips16_simple_memory_operand): Adjust now + that GET_MODE_SIZE is unsigned. + (mips_reg_mode_ok_for_base_p): Define. + (mips_legitimate_address_p): Likewise. Adjust now + that GET_MODE_SIZE is unsigned. + (block_move_loop): Make the number of bytes unsigned. + (expand_block_move): Likewise. + (function_arg): Make the loop counter unsigned to match the + boundary condition. + +2000-04-16 Richard Henderson + + * rtl.h (enum insn_note): New enumeration. Subsume + NOTE_INSN_DELETED and friends. + (GET_NOTE_INSN_NAME): Adjust index by NOTE_INSN_BIAS. + * rtl.c (note_insn_name): Tweak string order. + +2000-04-15 Zack Weinberg + + * cpplex.c (_cpp_read_and_prescan): Enlarge len by setting it + to offset * 2. + + * cpplex.c (output_line_command): Remove debugging prints. + (cpp_output_tokens): Don't write out a zero-length buffer or + try to see if it has a newline in it. + (_cpp_expand_to_buffer): Copy the source buffer before pushing. + (_cpp_read_and_prescan): Move shift-down of pushback bytes to + the end of the loop. Use memmove. Don't read past the end of + the buffer. Remove trailing newlines from error messages. + +2004-04-16 Neil Booth + + * cpphash.h (SYNTAX_INCLUDE, SYNTAX_ASSERT, directive_handler): new. + * cpplib.c: Add new syntax flags to directive table, and + supporting macros. + +2000-04-15 Ulrich Drepper + + * i386.c (ix86_expand_epilogue): Yes, the x86 can pop 64k at once + using ret $N. + +2000-04-15 David Edelsohn + + * toplev.c (display_help): Prefix "f" to "sched-verbose=". + * haifa-sched.c: Update -fsched-verbose comments to use "=". + +Sat Apr 15 10:59:19 2000 Richard Kenner + + * Makefile.in (ggc-page.o): Now includes toplev.h. + * ggc-page.c (toplev.h): Now included. + (gc_time): Remove declaration. + (ggc_collect): TIME now long. + * toplev.c (parse_time, varasm_time, gc_time): Still global; all + others static. + * toplev.h (gc_time, parse_time, gc_time): New declarations. + + * toplev.c: Make *_time variable long to reduce chance of overflow. + (TIMEVAR): Likewise for `otime'. + (print_time): Arg is now long; compute percentage in FP and round. + * toplev.h (print_time): Arg is long. + + * tree.c: Minor whitespace changes. + + * configure.in (alpha*-*-*): Add config/alpha/t-alpha. + * configure: Rebuilt. + * libgcc2.c (__fixunstfDI): Renamed from __fixunstfdi. + (__fixunsxfDI): Renamed from __fixunsxfdi. + (__fixunsdfDI): Renamed from __fixunsdfdi. + (__fixunssfDI): Renamed from __fixunssfdi. + (__floatdisf): Use proper type in REP_BIT macro. + (__fixunsxfSI): Renamed from __fixunsxfsi. + (__fixunsdfSI): Renamed from __fixunsdfsi. + (__fixunssfSI): Renamed from __fixunssfsi. + * libgcc2.h: Add cases for MIN_UNITS_PER_WORD > 4. + Change location of macros and upper-case some names as above. + * longlong.h ([alpha]): Use PARAMS, not __P in decl of __udiv__qrnnd. + * config/alpha/t-alpha, config/alpha/qrnnd.asm: New files. + + * varasm.c (assemble_variable): Add cast to remove warning. + (immed_real_const_1): Only use CONST[01]_RTX if not in nested function. + + * flow.c (count_basic_blocks, find_basic_blocks_1): Remove last change. + * optabs.c (emit_libcall_block): If have REG_EH_REGION, update + region number to -1. + +2000-04-15 Richard Earnshaw (rearnsah@arm.com) + + * emit-rtl.c (unshare_all_rtl_again): Unmark everything, then + call unshare_all_rtl. + + * arm.md (movhi): REGNO_POINTER_ALIGN is now bits. + +Fri Apr 14 16:58:45 2000 Jim Wilson + + * config/ia64/lib1funcs.asm (__divdi3, __moddi3, __udivdi3, __umoddi3): + Use .s1 not .s0 for all FP instructions. + +2000-04-14 Zack Weinberg + + * cpplex.c (cpp_output_tokens, cpp_scan_buffer_nooutput): New public + interfaces. + (safe_fwrite, output_line_command): New static functions. + (cpp_expand_to_buffer): Now private to cpplib. + (cpp_scan_buffer): Take a printer. + + * cpphash.h: Update prototypes. + * cpplib.h: Update prototypes. + (cpp_printer): New. + (cpp_buffer): Remove last_nominal_fname. + (cpp_reader): Remove lineno. + + * cppmain.c: Use a cpp_printer. + * fix-header.c: No need to inhibit line commands. Call + cpp_start_read with no printer. + + * cpperror.c (cpp_notice_from_errno): Provide default name. + * cppfiles.c (make_IHASH, _cpp_fake_ihash): New functions. + (find_include_file, cpp_read_file): Use make_IHASH. + (file_cleanup): Set control_macro and clear + input_stack_listing_current here. + (_cpp_execute_include): Don't output entering-file marker. + * cpphash.c (special_symbol): Look for the line number in the + buffer, not the reader. + (_cpp_macroexpand): No need to disable line commands. + (_cpp_dump_definition): No need to generate line commands. + (dump_hash_helper): Remove excess newline from output. + * cppinit.c (dump_special_to_buffer): No need to generate line + commands. + (cpp_printer_init): New. + (cpp_start_read): Take a printer, and start it up if it's not + NULL. No need to generate line commands. + (cpp_finish): Expect no buffers stacked at all. Take a + printer argument, and flush the output buffer if it's not + NULL. + * cpplex.c (_cpp_lex_token): Return EOF if there's no buffer. + Don't put two hashes at the beginning of an assertion. + (cpp_get_token): Don't increment pfile->lineno or emit line + commands here. Return EOF if there's no buffer when we get + EOF. + * cpplib.c (do_define, skip_if_group): + No need to disable line commands. + (_cpp_output_line_command): Delete function. + (do_line): Don't emit line commands here, but set things up so + they will be emitted if necessary. Use _cpp_fake_ihash to + make unique nominal_fnames if necessary. + (do_elif, do_else, _cpp_handle_eof): Call cpp_error_with_line + with 0 for column, not -1. + (_cpp_handle_eof): Don't set the control macro here. Don't + clear input_stack_listing_current here. Don't emit line + commands. + +2000-04-14 Geoff Keating + + * config/rs6000/sysv4.h (LINK_START_SOLARIS_SPEC): Define to empty + always, use the default SVR4 start address. + + * config/rs6000/linux.h (LINK_SPEC): Don't define. + (LINK_SHLIB_SPEC): Define. + (LINK_START_DEFAULT_SPEC): Define. + (LINK_OS_DEFAULT_SPEC): Define. + + * config/rs6000/sysv4.h (ENDFILE_SPEC): Use the %(endfile_*) macros. + + * config/rs6000/eabi.asm (__eabi): Call __init rather than + __do_global_ctors to handle constructors. + * config/rs6000/sysv4.h (STARTFILE_ADS_SPEC): Use crtbegin. + (STARTFILE_YELLOWKNIFE_SPEC): Likewise. + (STARTFILE_MVME_SPEC): Likewise. + (STARTFILE_SIM_SPEC): Likewise. + (ENDFILE_ADS_SPEC): Use crtend. + (ENDFILE_YELLOWKNIFE_SPEC): Likewise. + (ENDFILE_MVME_SPEC): Likewise. + (ENDFILE_SIM_SPEC): Likewise. + (STARTFILE_SOLARIS_SPEC): Use crtbegin/crtbeginS. + (ENDFILE_SOLARIS_SPEC): Use crtend/crtendS. + (STARTFILE_LINUX_SPEC): Use crtbeginS for shared objects. + (ENDFILE_LINUX_SPEC): Use crtendS for shared objects. + * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA): Don't build eabi-ctors.o. + (EXTRA_MULTILIB_PARTS): Build crtbeginS/crtendS. + (CRTSTUFF_T_CFLAGS_S): Define. + * config/rs6000/eabi-ctors.c: Delete. + + * config/rs6000/eabi-ci.asm (__init): Align stack to 16-byte + boundary. + (__fini): Likewise. + * config/rs6000/eabi-cn.asm (__init): Allow for 16-byte stack frame. + boundary. + (__fini): Likewise. + +Fri Apr 14 16:09:02 2000 Jim Wilson + + * combine.c (force_to_mode, case LSHIFTRT): Check that shift shift + plus mask size is smaller or equal to the mode size. + +Fri Apr 14 18:07:30 2000 Richard Kenner + + * print-rtl.c (print_rtx, case NOTE): Don't blow up if NOTE_BASIC_BLOCK + not yet set. + + * expr.c (reload.h): Now included. + (emit_block_move): Set volatile_ok when checking for movstr. + (emit_move_1): Check for replacements in addresses in multi-word case. + * Makefile.in (expr.o): Now includes reload.h. + + * flow.c (count_basic_blocks): Remove unused var PREV_CALL. + Never have a LIBCALL end a basic block. + (find_basic_blocks_1): Likewise. + Reorganize CALL_INSN cases. + + * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP): Revert last change. + +Fri Apr 14 10:54:22 2000 Jim Wilson + + * config/ia64/lib1funcs.asm (__ia64_nonlocal_goto): Drop obsolete + completers from mov.ret instruction. + +2000-04-14 Richard Henderson + + * fold-const.c (extract_muldiv): Don't distribute and widen + multiply across plus for non-sizetype unsigned types. + +2000-04-14 Richard Henderson + + * flow.c (find_auto_inc): Don't autoinc eliminable registers. + If the original source is dead in the incr insn, it's dead now. + +Fri Apr 14 07:40:32 2000 Richard Kenner + + * stor-layout.c (layout_decl): Properly compare KNOWN_ALIGN to + see if DECL_BIT_FIELD needs to still be set. + + * tree.h (struct tree_type): Make PRECISION 9 bits and MODE 7. + + * dbxout.c (dbxout_type, case INTEGER_TYPE): Don't call + print_int_cst_octal with something that's not an INTEGER_CST. + + * config/alpha/alpha.c (alpha_emit_floatuns): Ensure we pass a REG + and not a SUBREG to a FLOAT rtl. + +Thu Apr 13 19:39:56 2000 Clinton Popetz + + * emit-rtl.c (try_split): Avoid infinite loop if the split + results in a sequence that contains the original insn. + +2000-04-13 Andreas Jaeger + + * config/mips/mips.c (expand_block_move): Pass alignment + argument to move_by_pieces in bits, not bytes. + + * config/mips/linux.h (CPP_PREDEFINES): Also define __PIC__ and + __pic__ for little endian. + +2000-04-13 Andreas Jaeger + + * config/i386/i386-protos.h: Add prototype for + uno_comparison_operator. + +Thu Apr 13 15:55:08 MET DST 2000 Jan Hubicka + + * alias.c (nonlocal_reference_p): Take care of CALL_INSNS's fusage. + * calls.c (ECF_PURE): New flag. + (emit_call_1): Handle ECF_PURE calls. + (initialize_argument_information): Unset ECF_PURE flag too. + (precompute_arguments): Precompute for ECF_PURE too. + (expand_call): Handle ECF_PURE calls too. + (emit_library_call_value_1): Rename no_queue argument to fn_type, + accept value of 2 as pure function. + (emit_library_call_value, emit_library_call): Rename no_queue argument + to fn_type. + * optabs.c (prepare_cmp_insn): Pass fn_type 2 to memcmp call. + + * tree.h (DECL_IS_PURE): New macro. + (struct tree_decl): Add pure_flag. + * c-common.c (enum attrs): Add attribute "pure". + (init_attributes): Initialize attribute "pure" + (decl_attributes): Handle attribute "pure". + * extend.texi (Attribute "pure"): Document. + * calls.c (expand_call): Add (mem:BLK (scratch)) to "equal from" + in pure function. + (flags_from_decl_or_type): Support attribute "pure". + +2000-04-13 Jason Merrill + + * cpplex.c (_cpp_lex_token): Handle digraphs. Don't null-terminate + the token except for numbers and identifiers. + +Thu Apr 13 00:09:16 EDT 2000 John Wehle (john@feith.com) + + * i386.c (ix86_expand_binary_operator, + ix86_expand_unary_operator): Check no_new_pseudos + instead of reload_in_progress and reload_completed. + (ix86_split_ashldi, ix86_split_ashrdi, + ix86_split_lshrdi): Check no_new_pseudos instead + of reload_completed. + +2000-04-12 Jeffrey A Law (law@cygnus.com) + + * function.c (purge_addressof): Unshare any shared rtl created by + purge_addressof and its children. + +2000-04-12 Mark Mitchell + + * function.c (aggregate_value_p): VOID_TYPE nodes are never + aggregates. + +2000-04-05 Andreas Jaeger + + * config/mips/linux.h (SUBTARGET_ASM_SPEC): Use proper flags if + not compiling PIC code, add flags for mabi=64. + (SUBTARGET_CPP_SIZE_SPEC): New. + (SUBTARGET_CPP_SPEC): New. + (CPP_PREDEFINES): Define __PIC__ and __pic__. PIC code is default + for MIPS/Linux and lots of code needs these defines. + +Wed Apr 12 22:44:11 2000 Hans-Peter Nilsson + + * reorg.c (fill_slots_from_thread): Check side_effects_p when + trying the "opposite arithmetic" approach. + +Wed Apr 12 20:51:20 2000 J"orn Rennecke + + * sh.h (STRUCT_VALUE): Just 0 for TARGET_HITACHI. + (struct sh_args): Add new field force_mem. + (INIT_CUMULATIVE_ARGS): Initialize it. + (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Act on it. + +Wed Apr 12 17:20:41 MET DST 2000 Jan Hubicka + + * calls.c (expand_call): Do not reverse args in "equal from" field. + (emit_library_call_value_1): Emit_libcall_block for const and pure + function. + +Wed Apr 12 16:00:25 2000 J"orn Rennecke + + * reload1.c (reload_combine): Don't enable optimization for fixed + registers when encountering a BARRIER. + +Wed Apr 12 15:54:11 MET DST 2000 Jan Hubicka + + * builtins.c (expand_builtin_memcmp): Do expansion even with + !HAVE_cmpstrsi, do libcall when gen_strcmpsi fails. + + * calls.c (expand_call): Do NO_DEFER_POP unconditionally once + stack is properly aligned; add sanity checking for aligned + stack pointer. + (expand_library_call_value_1): Add sanity checking for aligned + stack pointer. + +Wed Apr 12 07:51:54 2000 Catherine Moore + + * calls.c (emit_library_call_value_1): Change 3rd arg to + locate_and_pad_parm to disregard the setting of partial. + +Wed Apr 12 08:47:38 2000 Richard Kenner + + * tree.c (unsave_expr_now_r, unsafe_for_reeval): Properly do TREE_LIST. + + * print-rtl.c (print_rtx): For CALL_PLACEHOLDER, output the + CALL_INSN from the normal case. + +Fri Apr 7 12:23:04 MET DST 2000 Jan Hubicka + + * i386.c (x86_sub_esp_4, x86_sub_esp_8, x86_add_esp_4, x86_add_esp_8): + New global variables. + (ix86_emit_epilogue_adjustment): Do not attempt to use pop for the + adjustment. + * i386.h (x86_sub_esp_4, x86_sub_esp_8, x86_add_esp_4, x86_add_esp_8): + Declare, + (TARGET_SUB_ESP_4, TARGET_SUB_ESP_8, TARGET_ADD_ESP_4, + TARGET_ADD_ESP_8): New macros. + * i386.md: Add peep2s to convert esp adjustments to push and pop + instructions. + (pushsi_prologue, popsi_epilogue): New patterns. + +2000-04-12 Jakub Jelinek + + * real.c (toe64): Remove stale #endif from the last change. + +2000-04-12 Stephen L Moshier + + * real.h (MAX_LONG_DOUBLE_TYPE_SIZE): Comment. + * real.c (toe64): Revert previous change. + +2000-04-12 Jakub Jelinek + + * objc/objc-act.c: Include ggc.h. + (objc_tree_index, objc_global_trees): Convert most of the + static tree variables into a static array with previous names + as defines. + (objc_ellipsis_node): New variable. + (lang_init): Call objc_act_parse_init and c_parse_init. + Create objc_ellipsis_node. + (build_selector_translation_table): Use objc_ellipsis_node instead + of (tree)1. + (hack_method_prototype): Likewise. + (get_arg_type_list): Likewise. + (start_method_def): Likewise. + (continue_method_def): Likewise. + (gen_method_decl): Likewise. + (ggc_mark_imp_list): New function. + (ggc_mark_hash_table): New function. + (objc_act_parse_init): New function. + * objc/objc-act.h (objc_ellipsis_node): Add extern variable. + * c-parse.in (c_parse_init): For objc add roots of objc specific + local tree variables. + * objc/objc-parse.y: Rebuilt. + * objc/objc-parse.c: Rebuilt. + (opt_parm_list): Use objc_ellipsis_node instead of (tree)1. + +Wed Apr 12 01:00:44 EDT 2000 John Wehle (john@feith.com) + + * cse.c (delete_trivially_dead_insns): Also delete insns + that copy a register to itself where the destination is + a strict_low_part. + +2000-04-11 Richard Henderson + + * flow.c (struct propagate_block_info): Add new_dead, new_live. + (propagate_block): Initialize them. Use them in parallel instead + of one tmp variable, ie revert much of the 0408 and 0407 functional + changes, but keep the structural changes. + (mark_set_regs): Take new_dead from propagate_block_info instead. + (mark_set_1, mark_set_reg): Likewise. + (mark_used_regs): Likewise with new_live. + (mark_used_reg): Likewise. Revert 0408 change. + +2000-04-11 Nick Clifton + + * config/arm/arm.h: (INCOMING_RETURN_ADDR_RTX): Remove Dwarf2 + restriction. + (DWARF_FRAME_RETURN_COLUMN): Remove Dwarf2 restriction. + +2000-04-11 Alexandre Oliva + + * config/elfos.h (SELECT_SECTION): Decide whether to use a data or + const section to output a CONSTRUCTOR based on the same conditions + used for VAR_DECLs. + +Tue Apr 11 09:55:59 2000 Jeffrey A Law (law@cygnus.com) + + * pa/long-double.h (FIX_TRUNCTFSI2_LIBCALL): Tweak for PA64. + * pa/pa-protos.h (output_call): Add additional argument indicating + if the call is a sibling/tail call. + (compute_zdepdi_operands, output_64bit_and): Prototype new functions. + (compute_64bit_ior, cmpib_comparison_operator): Likewise. + (function_arg, function_arg_partial_nregs): Likewise + * pa/pa.c (override_options): Always set flag_pic for TARGET_64BIT. + (emit_move_sequence): Zero extend certain constants as needed + for TARGET_64BIT. + (compute_zdepdi_operands, output_64bit_and): New functions. + (output_64bit_ior, function_arg): Likewise. + (cmpib_comparison_operator, function_arg_partial_nregs): Likewise. + (compute_frame_size, hppa_expand_prologue): Handle TARGET_64BIT. + (hppa_expand_epilogue, return_addr_rtx, hppa_va_arg): Likewise. + (hppa_builtin_saveregs, output_cbranch, output_bb): Likewise. + (output_bvb): Likewise. + (output_millicode_call): Return pointer is in %r2 for TARGET_64BIT. + (output_call): New argument 'sibcall'. Generate sibcall sequences + as needed. + (print_operand); Handle cases 'Q', 'p', and 'z' for TARGET_64BIT. For + (ouput_arg_descriptor): Do not emit argument descriptors for + TARGET_64BIT. + * pa/pa.h (TARGET_PA_11, TARGET_PA_20): Only define if not already + defined. + (TARGET_64BIT, PROMOTE_FUNCTION_RETURN): Define. + (FUNCTION_OK_FOR_SIBALL): Define. + (CPP_PA10_SPEC, CPP_PA11_SPEC, CPP_PA20_SPEC): Define. + (CPP_CPU_DEFAULT_SPEC, SUBTARGET_EXTRA_SPECS, EXTRA_SPECS): Likewise. + (CPP_SPEC): Use new spec infrastructure. + (BITS_PER_WORD, UNITS_PER_WORD): Handle TARGET_64BIT. + (STACK_BOUNDARY, FUNCTION_BOUNDARY, PIC_OFFSET_TABLE_REGNUM): Likewise. + (RETURN_IN_MEMORY, EXTRA_CONSTRAINT, FIRST_PARM_OFFSET): Likewise. + (REG_PARM_STACK_SPACE, STACK_POINTER_OFFSET): Likewise. + (STACK_DYNAMIC_OFFSET, FUNCTION_VALUE): Likewise. + (FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_CALLEE_COPIES): Likewise. + (TRAMPOLINE_TEMPLATE, TRAMPOLINE_SIZE): Likewise. + (INITIALIZE_TRAMPOLINE, LEGITIMATE_CONSTANT_P): Likewise. + (CONST_OK_FOR_LETTER_P, MOVE_RATIO): Likewise. + (FUNCTION_ARG); Call out to C code. + (FUNCTION_ARG_PARTIAL_NREGS): Likewise. + (MAX_BITS_PER_WORD, MAX_LONG_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): Define. + (MIN_UNITS_PER_WORD): Likewise. + * pa/pa.md (cmpdi): New expander. + (scc patterns, movstrsi): Not available for TARGET_64BIT. + (64bit conditional arithmetic): New patterns. + (absdi2, smindi3, umindi3, smaxdi3, umaxdi3): New patterns. + (movsicc): Not available if modes on all the operands to not match. + (movdicc): New expander and associated patterns. + (64bit branches): New patterns. + (pre_load, post_store): Generate appropriate code for TARGET_64BIT. + (pre_ldd, post_std): New patterns. + (64bit addil, load low part): New patterns. + (special movsf constant): Not available for TARGET_64BIT. + (movsf, movdf expanders): Force constants into memory. + (32bit movdf/movdi patterns): Disable for TARGET_64BIT. + (64bit movdf/movdi patterns): New patterns. + (zero_extendqidi2, zero_extendhidi2, zero_extendsidi2): New patterns + for TARGET_64BIT. + (extendqidi2, extendhidi2, extendsidi2): Similarly. + (adddi3 expander): Allow "arith_operand" for second input. + (32bit adddi3, subdi3, uaddcm): Disable for TARGET_64BIT. + (64bit adddi3, subsi3, uaddcm): New patterns for TARGET_64BIT. + (mulsi3 expander): Revamp slightly so it supports TARGET_64BIT too. + (muldi3): New expander for TARGET_64BIT. + (divsi3, udivsi3, modsi3, umodsi3): Fourth operand must be (reg:SI 2) + for TARGET_64BIT. + (32bit anddi3, iordi3, xordi3, andcm, negdi2, uaddcm): Disable + patterns for TARGET_64BIT. + (64bit anddi3, iordi3, xordi3, andcm, negdi2, uaddcm, shadd): New + patterns for TARGET_64BIT. + (64bit bit insertion/extractions): New patterns for TARGET_64BIT. + (64bit shifts/rotates): New patterns/expanders for TARGET_64BIT. + (sibcall_epilogue): New expander. + (casesi): Tweak for TARGET_64BIT. + (call expanders): Set & use the outgoing argument pointer. Use the + 64bit call patterns as needed. Add additional arg to output_call. + (call_internal_reg_64bit, call_value_internal_reg_64bit): New pattern. + (sibcall, sibcall_internal_symref): New expanders. + (sibcall_value, sibcall_value_internal_symref + (interspace_jump): Turn into an expander + matching patterns. + (canonicalize_funcptr_for_compare): Not needed for TARGET_64BIT. + * pa/pa64-regs.h: Eliminate trigraph sequences. + * pa/pa64-start.h (TARGET_PA_20): Fix typo. + +2000-04-11 Zack Weinberg + + * cppexp.c, cpphash.c, cpphash.h, cpplex.c, cpplib.c, + cpplib.h, cppmain.c, fix-header.c, scan-decls.c: Replace + cpp_token with cpp_ttype everywhere. + * cpperror.c, cpphash.c, cpplex.c, cpplib.c, scan-decls.c: + Replace cpp_buf_line_and_col with CPP_BUF_LINE and/or + CPP_BUF_COL. Line and column numbers are unsigned int, not + long. + * cpplex.c (cpp_buf_line_and_col): Delete. + * cpplib.h (struct cpp_buffer, struct cpp_reader): Change + 'long lineno' to 'unsigned int lineno'. + (CPP_BUF_LINE, CPP_BUF_COL): New macros. + +2000-04-11 Martin v. Löwis + + * extend.texi: ISO C99 is not a draft anymore. + * invoke.texi: ISO C++ is not a draft anymore. + * cpp.texi: __cplusplus is required by the ISO standard. + + * extend.texi (-fthis-is-variable): Undocument. + * flags.h (warn_template_debugging): Remove declaration. + * gcc.1 (-fall-virtual, -fenum-int-equiv, -fthis-is-variable, + -Wenum-clash, -Wtemplate-debugging): Undocument. + +2000-04-10 Nick Clifton + + * config/arm/arm.h (HOST_INT): New macro: Declare a HOST_WIDE_INT + integer. + (HOST_UINT): New macro: Declare an unsigned HOST_WIDE_INT + integer. + (ARM_SIGN_EXTEND): Use HOST_UINT. + (STRIP_NAME_ENCODING): Prevent warnings about redefinitions. + (ASM_OUTPUT_LABELREF): Prevent warnings about redefinitions. + (INCOMING_RETURN_ADDR_RTX): Only define if Dwarf2 is supported. + (DWARF_FRAME_RETURN_COLUMN): Only define if Dwarf2 is supported. + + * config/arm/arm.c: (const_ok_for_arm): Use HOST_UINT. + (arm_gen_constant): Use HOST_UINT. + (arm_canonicalize_constant): Use HOST_UINT. + (arm_reload_in_hi): Use HOST_UINT. + (arm_reload_out_hi): Use HOST_UINT. + (output_multi_immediate): Use HOST_UINT. + (int_log2): Use HOST_UINT. + (arm_poke_function_name): Use HOST_UINT. + (arm_output_epilogue): Use arm_volatile_func(). + (output_thumb_prologue): Use arm_strip_name_encoding(). + +Mon Apr 10 15:40:59 2000 Richard Kenner + + * sbitmap.c (sbitmap_a_subset_b_p): Rework loop to avoid potential + of sequence point problems. + +2000-04-10 Nathan Sidwell + + * rtl.def (ASHIFT, ROTATE, ASHIFTRT, LSHIFTRT, ROTATERT): + Recomment. + * tree.def (LSHIFT_EXPR, RSHIFT_EXPR): Recomment. + +Mon Apr 10 07:21:13 2000 Richard Kenner + + * sbitmap.h: Whitespace changes and use upper-case macro args. + (struct simple_bitmap_def): All sizes now unsigned. + (EXECUTE_IF_SET_IN_SBITMAP): Internal vars now _X instead of X_. + * sbitmap.c (sbitmap_alloc): N_ELMS now unsigned; also local vars. + (sbitmap_vector_alloc): Parms and local vars now unsigned. + (sbitmap_zero): Cast bzero arg to PTR. + (sbitmap_vector_zero, sbitmap_vector_one): Parm and Local var unsigned. + (sbitmap_union_of_diffs): Change loop index to unsigned and rework + loop to make structure clearer. + (sbitmap_not, sbitmap_difference, sbitmap_a_and_b): Likewise. + (sbitmap_a_or_b, sbitmap_a_subset_b_p, sbitmap_a_or_b_and_c): Likewise. + (sbitmap_a_and_b_or_c): Likewise. + (sbitmap_intersection_of_succs): Minor cleanups. + (sbitmap_intersection_of_preds, sbitmap_union_of_succs): Likewise. + (sbitmap_union_of_preds): Likewise. + (sbitmap_first_set_bit, dump_sbitmap): Local variables now unsigned. + (debug_sbitmap): New function. + + * c-convert.c (convert): Handle REFERENCE_TYPE like POINTER_TYPE. + * c-typeck.c (convert_for_assignment): Likewise. + + * expmed.c (init_expmed): Don't free objects we make. + * emit-rtl.c (gen_rtx_CONST_INT, init_emit_once): Minor cleanups. + + * expr.c (get_inner_reference): Correct some WITH_RECORD_EXPR cases. + (expand_expr, case CONVERT_EXPR): Pass proper alignment to store_field. + + * gcse.c (expr_hash_table_size): Now unsigned. + (compute_ae_gen): Local variable `i' now unsigned. + (compute_ae_kill, pre_insert_copies, pre_delete, pre_gcse): Likewise. + (compute_transout, hoist_code): Likewise. + (compute_local_properties): Likewise, also hash_table_size. + (alloc_expr_hash_table): N_INSNS now unsigned. + (delete_null_pointer_checks): Mark arg F as unused. + + * regrename.c: Minor cleanups, including chang some variables + to unsigned int. + +2000-04-10 Neil Booth + + * cpplex.c (skip_block_comment): Use pointer arithmetic rather + than GETC (). + * cpphash.h: (CPP_BUMP_BUFFER_LINE_CUR, CPP_BUMP_LINE_CUR): New. + +2000-04-10 Martin v. Löwis + + * invoke.texi (-fno-gnu-keywords): Remove classof, headof, + __classof__, and __headof__ from the list of gnu keywords. + (-ansi): Remove -foperator-names from list of implied options. + Do not call it ANSI C++. + (-foperator-names): Document as -fno-operator-names. + +2000-04-09 Zack Weinberg + + * cpphash.c (timestamp): Delete. + (del_HASHNODE): If type is T_MCONST, free value.cpval. + (special_symbol): Remove unnecessary braces. Remove + T_VERSION. Treat T_STDC like T_CONST unless + STDC_0_IN_SYSTEM_HEADERS. Render both __DATE__ and __TIME__ + when one is encountered, then convert them into T_MCONST + nodes. + * cppinit.c (builtin_array): version_string is T_MCONST. + __STDC__ has a "1" in its cpval. Don't have a terminator + entry. Clean up which entries are dumped. + (initialize_builtins): Only __STDC__ gets the special + -traditional treatment. Count the length of builtin_array. + Render version_string here. + * cpphash.h: Remove T_VERSION. Add T_MCONST. + * cpplib.h (struct cpp_reader): Remove timebuf. + +2000-04-09 Richard Henderson + + * genrecog.c (pred): Update comparison_operator for the unordered + operators. + + * config/i386/i386.c (no_comparison_operator): Disallow unordered + operators. + (fcmov_comparison_operator): Allow UNORDERED/ORDERED. + (uno_comparison_operator): New. + (put_condition_code): Handle UNORDERED/ORDERED. + (unsigned_comparison): Likewise. + (ix86_fp_compare_mode): Broken out of ix86_expand_fp_compare. + (ix86_use_fcomi_compare, ix86_prepare_fp_compare_args): Likewise. + (ix86_expand_fp_compare): Use them. Take scratch as argument, + update all callers. Handle all 8 unordered operators. + (ix86_expand_setcc): Lose the unordered argument, update all callers. + (ix86_expand_branch): Likewise. Don't fully expand fp branches. + * config/i386/i386.h (PREDICATE_CODES): Update. + * config/i386/i386-protos.h (ix86_expand_fp_compare): Declare. + (ix86_expand_branch, ix86_expand_setcc): Update. + * config/i386/i386.md (sunordered, sordered): New. + (suneq, sunge, sungt, sunle, sunlt, sltgt): New. + (bunordered, bordered): New. + (buneq, bunge, bungt, bunle, bunlt, bltgt): New. + (*fp_jcc_1, *fp_jcc_2, *fp_jcc_3, *fp_jcc_4): New. + (*fp_jcc_5, *fp_jcc_6, and splitters): New. + +2000-04-09 Philip Blundell + + * config/arm/arm.h (ARM_NAME_ENCODING_LENGTHS): Strip `*' too. + +Sun Apr 9 15:16:14 EDT 2000 John Wehle (john@feith.com) + + * i386.md (fix_truncsfhi2, fix_truncdfhi2, + fix_truncxfhi2): New patterns. + * i386.c (output_fix_trunc): Handle converting to HImode. + +2000-04-08 Alex Samuel + + * ssa.c (convert_to_ssa): Eliminate dead code when calling + life_analysis. + (convert_from_ssa): Call compute_bb_for_insn before life_analysis. + (for_each_successor_phi): Change parameter to basic_block. + (coalesce_regs_in_successor_phi_nodes): Likewise. + (coalesce_regs_in_copies): Likewise. + (compute_coalesced_reg_partition): Use basic_block instead of index. + * rtl.h (convert_to_ssa): Delete. + (convert_from_ssa): Likewise. + (successor_phi_fn): Likewise. + (for_each_successor_phi): Likewise. + (in_ssa_form): Likewise. + * basic-block.h (convert_to_ssa): Moved from rtl.h. + (convert_from_ssa): Likewise. + (successor_phi_fn): Likewise. + (in_ssa_form): Likewise. + (for_each_successor_phi): Likewise. Change parameter to basic_block. + * flow.c (calculate_global_regs_live): Pass a basic_block to + for_each_successor_phi. + +2000-04-08 Richard Henderson + + * flow.c (mark_used_reg): Use reg_set_p to determine if a register + was modified in the current insn. + +2000-04-08 Richard Earnshaw (rearnsha@arm.com) + + * arm/thumb.md: Delete. + * arm/thumb-protos.h: Delete. + +2000-04-08 Richard Earnshaw (rearnsha@arm.com) + + Merge changes from merged-arm-thumb-backend-branch onto trunk. + + 2000-04-08 Richard Earnshaw (rearnsha@arm.com) + + * Merge trunk code from tag merged-arm-thumb-backend-merge_20000408 + into branch. + + * arm.md (nop): Use the standard RTL expression. Don't code as a + define_expand. + (*arm_nop, *thumb_nop): Delete. + + * arm.c (const_ok_for_arm): Don't use ANSI extensions for defining + constants. Use casts instead. + (arm_gen_constant, arm_rtx_costs, arm_reload_in_hi, arm_reload_out_hi, + output_multi_immediate, arm_poke_function_name): Likewise. + * arm.h (ARM_LEGITIIMIZE_RELOAD_ADDRESS, ARM_SIGN_EXTEND, + MASK_RETURN_ADDDR): Likewise. + + 2000-03-31 Richard Earnshaw (rearnsha@arm.com) + + * Merge trunk code from tag merged-arm-thumb-backend-merge_20000325 + into branch. + + * arm.md (eh_epilogue): New function. + * arm.h (struct machine_function): Move to here ... + * arm.c: ... from here. + (arm_output_epilogue): Support epilogues for __builtin_eh_return. + (thumb_exit): Extra parameter eh_ofs. All callers changed. + Handle epilogues for __builtin_eh_return. Make bit-fields unsigned. + + 2000-03-30 Nick Clifton + + * config/arm/semi.h (ASM_SPEC): Restore definition. + (SUBTARGET_EXTRA_ASM_SPEC): Define if not already defined. + + * config/arm/elf.h (ASM_SPEC): Restore definition. + (SUBTARGET_EXTRA_ASM_SPEC): Define if not already defined. + + * config/arm/arm.h (ASM_SPEC): Remove definition. + (SUBTARGET_EXTRA_ASM_SPEC): Remove definition. + + 2000-03-26 Bernd Schmidt + + * config/arm/arm.c: Disable -fschedule-insns for Thumb. + + 2000-03-24 Nick Clifton + + Various formating tidyups, elimination of compile time + warnings and synchronisation with internal sources: + + * config/arm/arm-protos.h (assemble_align): Add prototype. + (gen_rotated_half_load): Rename to arm_gen_rotated_half_load. + (gen_comapre_reg): Rename to arm_gen_compare_reg. + (arm_return_addr_rtx): Rename to arm_return_addr. + + * config/arm/arm.c: Include except.h. + Define shorter typenames for strict minipool_node and struct + minipool_fix. + (arm_return_in_memory): For WinCE return all structures <= 32 bits + in memory. + (gen_rotated_half_load): Rename to arm_gen_rotated_half_load. + (gen_comapre_reg): Rename to arm_gen_compare_reg. + + * config/arm/arm.h (SUBTARGET_EXTRA_ASM_SPEC): Define if not + already defined. + (ASM_SPEC): Define if not already defined. + (ASM_OUTPUT_DEF_FROM_DECLS): Define. + + * config/arm/arm.md: Rename references to gen_rotated_half_load to + arm_gen_rotated_half_load, and references to gen_comapre_reg to + arm_gen_compare_reg. + (indirect_jump): Only accept register operands. + (load_indirect_jump): Keep this pattern since combine can generate + it. + + * config/arm/coff.h: Include aout.h. + (MULTILIB_DEFAULTS): Only define if not already defined. + + * config/arm/elf.h (ASM_OUTPUT_DEF_FROM_DECLS): Move definition + into arm.h (so that COFF ports can support thumb based aliases). + (ASM_SPEC): Move definition into arm.h + + * config/arm/linux-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Remove + redundant apcs spec. + (ASM_SPEC): Move definition to arm.h + + * config/arm/semi.h (ASM_SPEC): Move definition to arm.h + + * config/arm/unknown-elf.h (ASM_OUTPUT_SECTION_NAME): Add support + for entries in the .bss section + + 2000-03-23 Nick Clifton + + * config/arm/arm.h (THUMB_INITIAL_ELIMINATION_OFFSET): Pass 0 + to thumb_far_jump_used_p. + + * config/arm/arm-protos.h (thumb_far_jump_used_p): Take a + single integer parameter. + + * config/arm/arm.c (struct machine_function): Add two new + fields, 'far_jump_used' and 'arg_pointer_live'. + (thumb_far_jump_used_p): Once the decision has been made that + far jumps might be used, always return true. + If being called from the initial elimination offset macro then + do not bother to perform the test if the arg pointer is not + being used. + (thumb_unexpand_epilogue): Pass 1 to thumb_far_jump_used_p(). + (output_thumb_prologue): Pass 1 to thumb_far_jump_used_p(). + + 2000-03-23 Richard Earnshaw (rearnsha@arm.com) + + * arm.c (output_return_instruction): Handle more cases where we can + return from a function with an ldr instruction. + (arm_output_epilogue): Likewise. + + * arm.c (thumb_expand_prologue): Don't clobber the frame pointer + if we need to push a large stack frame and there are no callee-saved + registers. + + * arm.c (arm_debugger_arg_offset): An offset of 0 is also valid + in ARM code if the frame pointer has been eliminated. + + * arm.md (epilogue, *epilogue_insns, consttable_*, align_4): Renumber + unspec_volatile arguments to avoid duplicates. + (consttable_1, consttable_2): Fixes for big-endian mode. + + * arm.md (all ARM-mode load insns): Add neg_pool_range attribute + as appropriate. + + Re-write constant pool code. + * arm.c (minipool_node, minipool_fix): New types. + (minifix): Delete type. + (arm_add_minipool_constant): Delete. + (arm_compute_minipool_offsets, arm_find_barrier, + arm_find_minipool_constant, fixup_compare, sort_fixups): Likewise. + (get_jump_table_size): Now returns HOST_WIDE_INT. + (move_minipool_fix_forward_ref, add_minipool_forward_ref): New + functions. + (move_minipool_fix_backward_ref, add_minipool_backward_ref): Likewise. + (assign_minipool_offsets, arm_print_value): Likewise. + (dump_minipool): Rewrite. + (arm_barrier_cost): New function. + (create_fix_barrier): New function. + (push_minipool_barrier): New function. + (push_minipool_fix): Record additional information about the fixup + required. + (note_invalid_constants): Remove push for (UNSPEC 3). Don't + check the mode of what needs fixing. + (arm_reorg): Rewrite. + + 2000-03-08 Nick Clifton + + * config/arm/arm.md (indirect_jump): Force constant addresses into + a register. + + 2000-03-01 Bernd Schmidt + + * config/arm/arm.md: Add splitter to turn SF moves into SI moves. + + 2000-02-24 Nick Clifton + + * config/arm/arm.c (thumb_expand_prologue): Make sure that stack + adjust is word aligned. + (thumb_expand_epilogue): Make sure that stack adjust is word + aligned. + + * config/arm/elf.h (ASM_FILE_START): Fix type of version string. + + 2000-02-24 Bernd Schmidt + + * config/arm/arm.h (THUMB_GO_IF_LEGITIMATE_ADDRESS): Allow frame + pointer relative addresses. + + 2000-02-10 Richard Earnshaw + + * arm.c (find_barrier): Find the last barrier within the allowed + range. + + 2000-02-09 Nick Clifton + + * config/arm/arm-protos.h: Replace PROTO with PARAMS. + + 2000-02-09 Nick Clifton + + * config/arm/linux-elf.h (FUNCTION_PROFILER): Rename to + ARM_FUNCTION_PROFILER. + + * config/arm/netbsd.h (FUNCTION_PROFILER): Rename to + ARM_FUNCTION_PROFILER. + + * config/arm/linux-oldld.h: Imported from mainline sources. + + 2000-02-07 Nick Clifton + + * config/arm/lib1funcs.asm: Merge in thumb functions from + lib1thumb.asm. + + * config/arm/lib1thumb.asm: Delete. + + 2000-02-04 Nick Clifton + + * config/arm/arm.c: Sychronised with current Red hat local + sources. + * config/arm/arm.h: Ditto. + * config/arm/arm-protos.h: Ditto. + + 2000-02-02 Bernd Schmidt + + * arm.c (soft_df_operand): Reject SUBREGs containing a constant. + + * arm.c (arm_gen_movstrqi): Generate halfword stores rather than two + byte stores. + + 2000-02-02 Nick Clifton + + * config/arm/thumb.c (thumb_exit): Additional fix for same bug. + + * config/arm/arm.md (epilogue): Fix rtl checking abort because + (return) was emited using an emit_insn() call. + + 2000-01-31 Nick Clifton + + * config/arm/arm.c (output_thumb_prologue): Fix bug generating + thumb stack frame. + (thumb_exit): Move frame pointer back into hard frame pointer + register if backtracing is being used. + + 2000-01-13 Richard Earnshaw (rearnsha@arm.com) + + * Merge trunk code from tag merged-arm-thumb-backend-merge_20000113 + into branch. + + 1999-12-15 Bernd Schmidt + + * config/arm/arm.md (neg_pool_offset): Provide default for new + attribute. + (arm_movsi_insn): Add neg_pool_offset attribute. + * config/arm/arm.c (arm_find_barrier): Replace arg FIX with an + rtx for the insn that starts the scan and an unsigned long for its + address. Add MIN_OFFSET and PINSERTED args. All callers changed. + Change scan to ignore insns before MIN_OFFSET. Store size of inserted + instructions in *PINSERTED. + (struct minipool_fixup): Add MIN_ADDRESS elt. + (sort_fixups): Compute it. + (arm_reorg): Changes to support inserting pools before the insn to be + fixed up. + + 1999-12-08 Bernd Schmidt + + * config/arm/elf.h (MULTILIB_DEFAULTS): Add "marm". + * config/arm/linux-elf.h (MULTILIB_DEFAULTS): Add "marm". + * config/arm/coff.h (MULTILIB_DEFAULTS): Add "marm". + + Wed Nov 3 10:04:07 1999 Nick Clifton + + * config/arm/semi.h (TARGET_VERSION): Do not define if already + defined. + (TARGET_DEFAULT): Do not define if already defined. + + Tue Nov 2 10:37:25 1999 Nick Clifton + + * config/arm/arm.md (anddi3): Allow disjoint source operands. + (iordi3): Allow disjoint source operands. + (xordi3): Allow disjoint source operands. + (negdi2): Permit construction for ARM and Thumb. + (arm_negdi2): Renamed version of old negdi2 pattern. + (thumb_negdi2): New pattern: Only permit non-overlapping + source and destination. + + Fri Oct 29 18:52:38 1999 Nick Clifton + + * config/arm/arm.c (thumb_expand_prologue): Emit a USE of the + scratch low register so that it will not be deleted. + + Fri Oct 29 15:23:48 1999 Nick Clifton + + * config/arm/pe.h (ARM_PE): Define. + + * config/arm/arm.c (arm_valid_machine_decl_attribute): Allow + interfacearm attribute if this is a PE toolchain. + (output_return_instruction): Do not emit anything if the function + has the naked attribute set. + (is_called_in_ARM_mode): If the function has the interfacearm + attribute then return true. + (thumb_expand_prologue): Do not generate a prologue for naked + functions. + (thumb_expand_epilogue): Do not generate an epilogie for a naked + function. + (output_thumb_prologue): Do not bother if the function is naked. + Strip PE encoding from function name before emitting. + + Thu Oct 28 11:05:13 1999 Richard Earnshaw + + * arm.md (pic_load_addr): Fix constraints. + + * arm.md (casesi_insn): Fix mis-applied patch. + + * arm.md ("core" function unit): Add rules for single- and + multi-cycle insns. + (All TARGET_THUMB patterns): Add "type" attribute information + where needed. + * arm.c (arm_adjust_cost): Reduce the cost of a data dependency if + the following insn is a CALL. + + * arm.c (thumb_expand_epilogue): Add a use of the adjusted stack + pointer. + * arm.h (CONDITIONAL_REGISTER_USAGE): Nail down the + ARM_HARD_FRAME_POINTER_REGNUM when TARGET_APCS_FRAME. + (FRAME_POINTER_REQUIRED): Only check TARGET_APCS_FRAME if TARGET_ARM. + + Wed Oct 27 14:40:48 1999 Nick Clifton + + * config/arm/linux-gas.h: oops - this file was missed out when the + branch was created... + + Tue Oct 26 17:07:38 1999 Richard Earnshaw + + * thumb.c: Deleted. Move contents to ... + * arm.c: ... here. + * t-arm-aout, t-arm-coff, t-arm-elf, t-linux, t-netbsd, t-semi: Remove + rule for thumb.o + * configure.in (arm*-*-*): Remove thumb.o from extra_objs list. + * configure: Regen. + + * arm-protos.h: Use RTX_CODE and tidy up long lines. Don't + declare a prototype for asm_output_align(); + + * arm.c (thumb_condition_code): Delete. + (arm_print_operand): Always use arm_condition_code array. + + * arm.c (thumb_return_addr_rtx): Delete. + (arm_save_machine_status, arm_restore_machine_status): Delete. + (arm_init_machine_status, arm_mark_machine_status): New functions. + (arm_init_expanders): Update accordingly. + (arm_return_addr): Renamed from arm_return_addr_rtx. Rewrite. + (thumb_expand_prologue): Delete code referencing thumb_return_addr_rtx. + * arm.h (RETURN_ADDR_RTX): Call arm_return_addr(). + + Tue Oct 26 13:24:16 1999 Nick Clifton + + * configure.in : Fix arm-*-aout target to use new t-arm-aout + script. + * config/arm/t-arm-aout: New file: Makefile script for arm-*-aout + targets. + + Tue Oct 26 11:27:12 1999 Nick Clifton + + * config/arm/thumb.c (output_thumb_prologue): Fix bug creating + stack backtrace structure. + + * config/arm/arm-protos.h: Add prototypes for functions defined in + arm/pe.h. + + * config/arm/arm.c (arm_override_options): Fix selection of + attributes of default processor. + + * config/arm/coff.h: Delete needless #include. + + * config/arm/pe.c: Delete unused code. + + * config/arm/pe.h (CPP_DEFINES): Delete + (SUBTARGET_CPP_SPEC): Define. + (ASM_DECLARE_FUNCTION_NAME): Use ARM_DECLARE_FUNCTION_NAME. + + * config/arm/t-pe: Add -DInhibit_libc to allof libgcc.a to build. + + Mon Oct 25 15:42:09 1999 Richard Earnshaw (rearnsha@arm.com) + + * arm.h (TARGET_APCS_FRAME): Renamed from TARGET_APCS -- all uses + updated. + (CAN_DEBUG_WITHOUT_FP): Define. + (FIXED_REGISTERS): Make r11 call-saved. + (CALL_USED_REGISTERS): Likewise. + (CONDITIONAL_REGISTER_USAGE): Fix r11 if TARGET_APCS_FRAME. + (FRAME_POINTER_REQUIRED): Correct logic for determining when a + frame-pointer is required. + (TARGET_DEFAULT): Make default setting include ARM_FLAG_APCS_FRAME. + * arm.c (arm_override_options): Warn about -mno-apcs-frame and -g + if the target normally needs a stack frame in non-leaf functions. + (use_return_insn): Correct logic for determining when a return + instruction can be used. + (output_return_instruction): Handle the frame-pointer register as + a normal register when not TARGET_APCS_FRAME. + (arm_output_prologue): Likewise. + (arm_output_epilogue): Likewise. + (output_func_epilogue): Likewise. + (arm_expand_prologue): Likewise. + * netbsd.h semi.h (TARGET_DEFAULT): Add ARM_FLAG_APCS_FRAME. + + * arm.c (use_return_insn): No need to check floating point regs if + TARGET_SOFT_FLOAT. + (arm_find_minipool_constant): Correct typo; use GET_CODE to get + the code of value stored in the minipool array. + (arm_add_minipool_constant): Likewise. + +2000-04-08 Kaveh R. Ghazi + + * basic-block.h (conflict_graph_enum_fn): K&R fix. + +2000-04-08 Kaveh R. Ghazi + + * tree.c (tree_expr_nonnegative_p): New function. + + * tree.h (tree_expr_nonnegative_p): Declare. + + * c-typeck.c (build_binary_op): Call `tree_expr_nonnegative_p' to + elide some sign_compare warnings. + (build_conditional_expr): Likewise. + +Sat Apr 8 00:21:51 EDT 2000 John Wehle (john@feith.com) + + * i386.md (ashrsi3, ashrhi3, ashrqi3): Fix typo. + + * i386.md (floathisf2, floathidf2, floathixf2): New patterns. + * i386.c (print_operand): Use the proper suffix for a 387 HImode + operand. Abort if a 387 operand has an unsupported size. + +2000-04-08 Neil Booth + + * cppexp.c (parse_charconst): Null does not end character + constants. + * cppinit.c (ISTABLE): Null character handled as whitespace. + * cpplex.c (null_warning): new function. + (skip_string): Emit warning if nulls encountered. + (_cpp_skip_hspace): Emit warning if nulls encountered. + (_cpp_lex_token): Emit warning if nulls encountered. Drop + them. + * cpp.texi: Update. + +2000-04-07 Richard Henderson + + * flow.c (loop_depth): Remove. + (reg_next_use, cc0_live, mem_set_list): Replace with ... + (struct propagate_block_info): New. + (life_analysis): Don't allocate reg_next_use. + (propagate_block_delete_insn): Break out of propagate_block. + Use flow_delete_insn to unlink rather than use NOTE_INSN_DELETED. + (propagate_block_delete_libcall): Likewise. + (propagate_block): Create a propagate_block_info struct to pass + to subroutines. Allocate one not two temporary regsets. Don't + clobber memory for const calls. Look for clobbers in + CALL_INSN_FUNCTION_USAGE. + (mark_set_regs): Recognize COND_EXEC. + (mark_set_reg): Break out of mark_set_1. + (mark_used_reg): Break out of mark_used_regs. + (mark_used_regs): Recognize COND_EXEC. + (insn_dead_p): Use propagate_block_info struct. + (libcall_dead_p, invalidate_mems_from_autoinc): Likewise. + (find_auto_inc, try_pre_increment_1): Likewise. + (print_rtl_with_bb): Dump regs live at end too. + (count_reg_sets_1): Pass in loop_depth. + (count_reg_sets, count_reg_references): Likewise. + (recompute_reg_usage): Provide it. + +2000-04-07 Richard Henderson + + * Makefile.in (conflict.o): Depend on $(RTL_H) and $(BASIC_BLOCK_H) + not the raw files. + +2000-04-07 Zack Weinberg + + * cpplib.c (do_elif): Skip the rest of the line if we're + not going to bother evaluating it. + (skip_if_group): Clear pfile->only_seen_white. Reorder loop + to avoid pointless calls to the lexer. + +Fri Apr 7 11:50:54 2000 Jim Wilson + + * config/ia64/ia64.c: Delete stdio.h and ctype.h includes. + +2000-04-07 Jason Merrill + + * calls.c (expand_call): emit_queue if we're trying a sibcall. + +2000-04-07 Jakub Jelinek + + * config/sparc/t-linux64 (tcrtbeginS.o, tcrtendS.o): Remove. + +2000-04-06 Geoff Keating + + * Makefile.in: Build crtbeginS and crtendS like crtbegin and + crtend so they can be multilibbed. + (STAGESTUFF): Remove s-crt and s-crtS. + +2000-04-07 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_conditional_move): Fail + if we discover we need a pseudo and no_new_pseudos is true. + * config/alpha/alpha.md (ne:DI insn): New. + (trunctfsf2, sne): Emit NE instead of non-canonical LTU. + +2000-04-07 Richard Henderson + + * rtl.def (COND_EXEC): New. + * rtl.h (COND_EXEC_TEST, COND_EXEC_CODE): New. + * tm.texi (MAX_CONDITIONAL_EXECUTE): Document. + + * genconfig.c (have_cond_arith_flag): Remove. + (have_cond_exec_flag): New. + (walk_insn_part): Detect COND_EXEC, not arithmetic in IF_THEN_ELSE. + (main): Print HAVE_conditional_execution. + + * haifa-sched.c (haifa_classify_insn): Recognize COND_EXEC. + (sched_analyze_insn, print_pattern): Likewise. + * reload.c (find_equiv_reg): Likewise. + * rtlanal.c (reg_referenced_p): Likewise. + (note_stores, dead_or_set_regno_p): Likewise. + (reg_overlap_mentioned_p): Rewrite to use a switch. + + * ggc.h (struct rtx_def): Forward declare. + + * print-rtl.c (debug_rtx_range): New. + * rtl.h (debug_rtx_range): Declare. + + * varray.h (VARRAY_ACTIVE_SIZE, VARRAY_POP_ALL): New. + + * gcse.c (gcse_main): Don't rebuild the CFG here. + (delete_null_pointer_checks): Likewise. + * ssa.c (convert_to_ssa): Likewise. + * toplev.c (rest_of_compilation): Do it here instead. Combine + sequential calls to TIMEVAR. Consistently use `insns' instead of + `get_insns()'. Always split insns after reload when optimizing. + + * basic-block.h (merge_blocks_nomove): Declare. + (tidy_fallthru_edge): Declare. + * flow.c (merge_blocks_nomove): Document as merging into previous + blocks. Remove cruft from between blocks; remove all edges out of A. + (tidy_fallthru_edge): Export. + +2000-04-06 Alex Samuel + + * ssa.c (compute_conservative_reg_partition): Declare with + void arguments. + * toplev.c (clean_dump_file): Remove previously-deleted function + inadvertantly merged back in. + * conflict.c (conflict_graph_add): Use a single call to + htab_find_slot to look up and insert. + +2000-04-06 Richard Henderson + + * genrecog.c (*): Rename _last_insn to last_insn. + (make_insn_sequence): Set the position of the peephole2 C test + to be at the last insn. + +2000-04-06 Richard Henderson + + * flow.c (compute_flow_dominators): Free worklist. + +2000-04-06 Michael Matz + + * flow.c (compute_flow_dominators): Process blocks FIFO not LIFO. + +2000-04-06 Alex Samuel + + * rtl.h (INSN_P): New macro. + (successor_phi_fn): New typedef. + (for_each_successor_phi): New prototype. + (in_ssa_form): New variable. + (PHI_NODE_P): Likewise. + * flow.c (calculate_global_regs_live): Add to new_live_at_end from + phi nodes in successors. + (mark_used_regs): Add PHI case. + (set_phi_alternative_reg): New function. + (life_analysis): Assert that dead code elimination is not selected + when in SSA form. + * toplev.c (to_ssa_time): New variable. + (from_ssa_time): Likewise. + (compile_file): Zero to_ssa_time and from_ssa_time. + Print time to convert to and from SSA. + (rest_of_compilation): Time convert_to_ssa and convert_from_ssa. + (print_time): Compute percent fraction as integer. + * ssa.c (PHI_NODE_P): Moved to rtl.h. + (convert_to_ssa): Check if we're already in SSA. + Don't eliminate dead code in life_analysis. + Rerun flow and life analysis at bottom. + (eliminate_phi): Use canonical regnos when adding nodes. + (mark_reg_in_phi): New function. + (mark_phi_and_copy_regs): Likewise. + (convert_from_ssa): Rerun life analysis at top. + Use coalesced partition. + Check for removing a phi node at the end of the block. + (compute_coalesced_reg_partition): New function. + (coalesce_regs_in_copies): Likewise. + (coalesce_reg_in_phi): Likewise. + (coalesce_regs_in_successor_phi_nodes): Likewise. + (for_each_successor_phi): Likewise. + (rename_context): New struct. + (rename_block): Use a rename_context with rename_insn_1. When + renaming sets of a subreg, emit a copy of the entire reg first. + (rename_insn_1): Treat data as a rename_context *. Save current + insn in set_data. + (rename_set_data): Add field set_insn. + * Makefile.in (HASHTAB_H): Move up in file. + (OBSTACK_H): New macro. + (collect2.o): Use OBSTACK_H in dependencies. + (sdbout.o): Likewise. + (emit-rtl.o): Likewise. + (simplify-rtx.o): Likewise. + (fix-header.o): Likewise. + (OBJS): Add conflict.o. + (conflict.o): New rule. + * basic-block.h: Include partition.h. + (conflict_graph): New typedef. + (conflict_graph_enum_fn): Likewise. + (conflict_graph_new): New prototype. + (conflict_graph_delete): Likewise. + (conflict_graph_add): Likewise. + (conflict_graph_conflict_p): Likewise. + (conflict_graph_enum): Likewise. + (conflict_graph_merge_regs): Likewise. + (conflict_graph_print): Likewise. + (conflict_graph_compute): Likewise. + * conflict.c: New file. + +2000-04-06 Jason Merrill + + * tlink.c (read_repo_files): Don't look for .rpo info for + linker flags. + +Thu Apr 6 20:39:26 2000 J"orn Rennecke + + * sh.h (STRUCT_VALUE, RETURN_IN_MEMORY): Define. + +Thu Apr 6 19:34:08 2000 J"orn Rennecke + + * config/sh/lib1funcs.asm (___udivsi3_i4): + ( __SH4_SINGLE__ / __SH4_SINGLE_ONLY__ variant): value for fpscr + only depends on FMOVD_WORKS. + +Thu Apr 6 19:11:47 2000 J"orn Rennecke + + * config/sh/lib1funcs.asm (___udivsi3_i4): When using fmovd, + make double constant 8-byte aligned. + +2000-04-06 Jakub Jelinek + + * config/sparc/sparc.md (movtf_insn_sp32, movtf_insn_vis_sp32, + movtf_no_e_insn_sp32, movtf_insn_hq_sp64, movtf_insn_hq_vis_sp64, + movtf_no_e_insn_sp64): Accept loading 0.0 into GENERAL_REGS. + (movtf_insn_sp64, movtf_insn_vis_sp64): Likewise. + Accept storing GENERAL_REGS into offsetable memory. + * config/sparc/sparc.h (PREFERRED_RELOAD_CLASS): Don't allow + building a TFmode constant other than 0.0L into GENERAL_REGS. + +2000-04-06 Clinton Popetz + + * regrename.c (regrename_optimize): Handle no REG_ALLOC_ORDER. + +2000-04-06 Zack Weinberg + + * cpphash.c (CPP_IS_MACRO_BUFFER, FORWARD, PEEKC): Delete. + (macro_cleanup): No need to cast pbuf->macro. + (collect_expansion): Use _cpp_get_define_token. Goto done if + it returns VSPACE. Remove check for trailing space after + CPP_COMMENT. + (_cpp_create_definition): Don't diddle flags here. Return + directly on error. + (unsafe_chars): Handle c1 being EOF. + (push_macro_expansion): Use unsafe_chars for both accidental-paste + checks. Don't push the buffer till after we're done with + them. + * cpplex.c (PEEKBUF, GETBUF, FORWARDBUF): New. + (PEEKN, FORWARD, GETC, PEEKC): Use them. + (cpp_push_buffer): Don't set new->alimit. Set new->mark + appropriately. + (_cpp_parse_assertion): Don't NUL terminate. + (_cpp_lex_token): Fix -traditional macro handling. Don't skip + hspace before calling _cpp_parse_assertion. Remove all sets + of only_seen_white. Treat '\f' as hspace. Don't do anything + special with '\n' here. + (maybe_macroexpand): Handle T_EMPTY hash entries without + pushing a buffer at all. + (cpp_get_token): Handle clearing only_seen_white here. Handle + incrementing the line number here. Clear + potential_control_macro as well as only_seen_white, if + appropriate. + (cpp_get_non_space_token): Don't eat CPP_POP tokens. + (_cpp_get_define_token): New function, basically like + _cpp_get_directive_token was but doesn't eat horizontal space. + Don't do anything with only_seen_white here. + (_cpp_get_directive_token): Just call _cpp_get_define_token + repeatedly till it returns non-hspace. + + * cpplib.c (PEEKN, FORWARD, GETC, PEEKC): Delete. + (conditional_skip, skip_if_group): Return int. + (DIRECTIVE_TABLE): Change origin of all conditional directives + to "COND". + (TRAD_DIRECT_P): New macro. + (_cpp_handle_directive): Use _cpp_get_directive_token. Issue + an error for a bogus directive, unless -lang-asm. Use + TRAD_DIRECT_P. Loop calling handler functions till one returns + zero. + (get_macro_name): Don't diddle flags here. + (do_define): Diddle flags here. Use _cpp_get_directive_token. + Create T_EMPTY nodes for #define macro /* nothing */. + (do_undef): Don't copy the name. Use _cpp_get_directive_token. + Use hp->name when calling pass_thru_directive. + (do_if, do_else, do_elif, do_ifdef, do_ifndef, conditional_skip): + Return the result of conditional_skip and/or skip_if_group. + Don't call _cpp_output_line_command. + (consider_directive_while_skipping): Use _cpp_get_directive_token. + Issue -Wtraditional warnings as appropriate. Don't complain + about unrecognized directives. If we are to stop skipping, + return the number of the directive that ended the skip. + (skip_if_group): Use _cpp_get_directive_token. Turn off macro + expansion and line commands while skipping. Return the result + of consider_directive_while_skipping, if nonzero. + (do_endif): Just set potential_control_macro here. + (validate_else): Use _cpp_get_directive_token. + (do_assert, do_unassert): Don't save pointers into the + token_buffer across calls to the lexer. Use + _cpp_get_directive_token. + + * cpplib.h (cpp_buffer): Remove alimit and colno. Make mark a + pointer, not an offset. Replace 'data', which was a generic + pointer, with 'macro', which points to a struct hashnode. + (cpp_reader): Add 'potential_control_macro' pointer. + * cpphash.h (T_UNUSED): Replace with T_EMPTY. + (CPP_BUF_GET, CPP_FORWARD): Delete. + (CPP_IN_COLUMN_1, ADJACENT_TO_MARK): New macros. + (CPP_IS_MACRO_BUFFER, CPP_SET_BUF_MARK, CPP_GOTO_BUF_MARK, + ACTIVE_MARK_P): Update. + (_cpp_get_define_token): New internal function. + * cppfiles.c (read_include_file): Don't set fp->alimit or fp->colno. + +2000-04-05 Benjamin Kosnik + + * configure.in: And here. + * configure: Regenerate. + * acconfig.h: Add ENABLE_STD_NAMESPACE to set flag_honor_std if + --enable-libstdcxx-v3 is passed at configure time. + * config.h.in: Regenerate. + +2000-04-05 Mark Mitchell + + * final.c (final): Use xcalloc to allocate line_note_exists. + * function.c (free_after_compilation): Free the temp_slots. + (assign_stack_temp_for_type): Use xmalloc to allocate temp_slots. + (combine_temp_slot): Free temp_slots when they get combined. + (purge_addressof): Fix typo in comment. + * stmt.c (mark_goto_fixup): Mark the fixup itself. + (expand_fixup): Allocate the fixup with ggc_alloc_obj. + + * ggc.h: Include varray.h. + (ggc_pending_trees): Declare. + (ggc_mark_tree_children): Remove declaration. + (ggc_mark_tree): Just push unmarked trees on ggc_pending_trees. + * ggc-common.c (ggc_pending_trees): New variable. + (ggc_mark_roots): Call ggc_mark_trees. + (ggc_mark_tree_children): Rename to ggc_mark_trees. Process all + the ggc_pending_trees. + * Makefile.in (GGC_H): New variable. Use it throughout in place + of ggc.h. + +Thu Apr 6 00:30:50 2000 J"orn Rennecke + + * sh.h (FUNCTION_ARG_PARTIAL_NREGS): Accommodate an unsigned + GET_MODE_SIZE. + +Wed Apr 5 23:17:10 2000 J"orn Rennecke + + * sh.c (sh_insn_length_adjustment): New function. + * sh-protos.h (sh_insn_length_adjustment): Declare. + * sh.h (ADJUST_INSN_LENGTH): Use it. + +Wed Apr 5 12:35:18 2000 Hans-Peter Nilsson + + * optabs.c (emit_libcall_block): Remove spurious REG_EQUAL notes + from the insn where REG_RETVAL is added. + (emit_no_conflict_block): Ditto. + + * md.texi (Standard Names): Clarify when movX is needed. + + * combine.c (simplify_comparison) [MINUS]: Do not replace + all (op (minus A B) 0) with (op A B). + +Wed Apr 5 18:03:31 2000 Toshiyasu Morita (toshi.morita@sega.com) + J"orn Rennecke + + * sh.md (block_lump_real_i4): Add missing clobber of T_REG + (block_lump_real): Likewise. + +2000-04-05 Chris Demetriou + + * mips.h (MASK_DEBUG_A, MASK_DEBUG_B, MASK_DEBUG_C): Zero the + remaining nonzero debugging masks. + +Wed Apr 5 09:44:07 2000 Jeffrey A Law (law@cygnus.com) + + * basic-block.h (verify_flow_info): Declare. + (flow_loop_outside_edge_p): Declare. + * flow.c (verify_flow_info): Remove declaration. + (clear_log_links, flow_loop_outside_edge_p): Likewise. + +Wed Apr 5 09:34:26 2000 Philippe De Muyter + + * m68k/m68k-protos.h (finalize_pic): Turn prototype off using `#if 0', + not C++ comments. + +2000-04-05 Jakub Jelinek + + * config/sparc/sparc.md (snedi_zero+1, neg_snedi_zero+1, + snedi_zero_trunc+1, seqdi_zero+1, neg_seqdi_zero+1, + seqdi_zero_trunc+1): Allow splits only if registers are + different. + +2000-04-04 Ulrich Drepper + + * acconfig.h: Add HAVE_GAS_HIDDEN. + * config.in: Regenerated. + * configure.in: Add test for .hidden pseudo-op in gas. + * configure: Regenerated. + * crtstuff.c: Include auto-host.h. + Emit additional .hidden pseudo-op for __dso_handle if the + assembler knows about it. + +2000-04-04 Philippe De Muyter + + * cpphash.c (_cpp_free_definition): Test argnames, not nargs >= 0, + before freeing argnames. + * cpplib.c (do_ifndef): Cast return value of xstrdup. + +2000-04-05 Michael Meissner + + * config/rs6000/rs6000.c (print_operand): Patch from Jonathan + Walton to make memory references with update + work wtih -mregnames. + +2000-04-04 Kaveh R. Ghazi + + * regrename.c (regno_first_use_in): Wrap prototype in PARAMS. + (regrename_optimize): Rename variables `def_uses' and + `ext_basic_blocks' to avoid conflicts with similarly named + typedefs in traditional C. + + * calls.c (initialize_argument_information): Fix typo in previous + change. + +2000-04-04 Richard Henderson + + * regrename.c (consider_available): Test fixed_regs not + PIC_OFFSET_TABLE_REGNUM. + +2000-04-04 Geoff Keating + + * config/rs6000/t-ppccomm (EXTRA_MULTILIB_PARTS): Add crtbegin, + crtend. + (CRTSTUFF_T_CFLAGS_S): Delete definition. + * config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Always use crtbegin. + (ENDFILE_LINUX_SPEC): Always use crtend. + * configure.in (powerpc-*-linux-gnulibc1): Don't define extra_parts. + (powerpc-*-linux-gnu): Likewise. + * configure: Regenerate. + + * config/rs6000/eabi.h: Don't include sysv4.h. + (MULTILIB_DEFAULTS): Don't define. + * config/rs6000/eabiaix.h: Don't include eabi.h. + * config/rs6000/eabile.h: Delete. + * config/rs6000/eabilesim.h: Delete. + * config/rs6000/eabisim.h: Don't include eabi.h. + * config/rs6000/linux.h: Don't include sysv4.h. + (JUMP_TABLES_IN_TEXT_SECTION): Don't redefine. + (MULTILIB_DEFAULTS): Don't redefine. + * config/rs6000/rtems.h: Don't include eabi.h. + * config/rs6000/sol2.h: Don't include sysv4le.h. + * config/rs6000/sysv4le.h: Don't include sysv4.h. + * config/rs6000/t-ppc: Delete. + * config/rs6000/t-ppcgas: Correct comment. + * config/rs6000/t-ppcos: Correct comment. Don't build + multilibs for -fPIC, rather use -fPIC -mstrict-align + as default. + * config/rs6000/t-ppc: Delete. + * config/rs6000/vxppc.h: Don't include sysv4.h. + * config/rs6000/vxppcle.h: Delete. + * configure.in: Use multiple header files for p2pc ELF targets + powerpc-eabiaix, powerpc-eabisim, powerpc-rtems, powerpcle-eabi, + powerpcle-eabisim, powerpc-elf, powerpcle-elf, powerpc-linux-gnu, + powerpc-linux-gnulibc1, powerpc-sysv, powerpcle-sysv, + powerpc-vxworks, powerpcle-vxworks. Assume GAS functionality is + always available for these platforms. + +2000-04-04 Richard Henderson + + * calls.c (try_to_integrate): Initialize reg_parm_stack_space. + +2000-04-04 Stan Cox + + * Makefile.in: Add rules for regrename.o + * regrename.c: New file. + * rtl.h (regrename_optimize): Add prototype. + * toplev.c (rename_registers_dump, flag_rename_registers): New variables + (compile_file, decode_d_option): Add support for -frename-registers. + (rest_of_compilation): Call regrename_optimize. + * config/ia64/ia64.h (HARD_REGNO_RENAME_OK, RENAME_EXTENDED_BLOCKS): + New macros. + +2000-04-04 Martin v. Löwis + + * Makefile (gccbug): New target. + (doc): Depend on it. + * gcc.texi (Bugs): Link subnodes. + (gccbug): New node. + * gccbug.in (CATEGORIES): Remove gc, host, profiling, libgcc. + Document severities, priorities, and classes in bug form. + +2000-04-04 Zack Weinberg + + * cpplex.c (trigraph_map, speccase): Combine into single + table, chartab. + (NORMAL, NONTRI): New macros. + (_cpp_read_and_prescan): Change to use unified table. Use + is_hspace to test for whitespace. + + * dbxout.c (CONTIN): If it doesn't have to do anything, give it a + definition that doesn't provoke the "empty body in an + if-statement" warning. + +2000-04-04 Clinton Popetz + + * builtins.c (expand_builtin_strlen): Force the source to + be a memory address. + +2000-04-04 Kaveh R. Ghazi + + * cpplib.c (D): Adjust to call CONCAT2 macro without whitespace. + +Tue Apr 4 19:17:20 MET DST 2000 Jan Hubicka + + * calls.c (ECF_MALLOC, ECF_MAY_BE_ALLOCA, ECF_RETURNS_TWICE, + ECF_LONGJMP, ECF_FORK_OR_EXEC): New constants. + (ECF_IS_CONST): Rename to ECF_CONST. + (special_function_p): Make static, change interface. + (flags_from_decl_or_type, try_to_integrate): Break out from ... + (expand_call) ... here; convert number of variables to flags. + (emit_library_call_vlue_1): Likewise. + (setjmp_call_p): New function. + (initialize_argument_information): Accepts flags as argument; + return flags. + (precompute_arguments): Likewise. + * tree.h (special_function_p): Remove. + (setjmp_call_p): Add prototype. + +2000-04-04 Jakub Jelinek + + * config/sparc/sparc.h (RTX_OK_FOR_OFFSET_P): Leave minor margin + so that addresses are offsetable by up to 16 bytes. + (GO_IF_LEGITIMATE_ADDRESS): Don't allow REG+REG addresses for + non-optimizing TARGET_ARCH32 in DF or DI modes because it is not + offsetable. + + * config/sparc/sparc.md (movdi_insn_sp64_novis): New pattern. + (movdi_insn_sp64_vis): Renamed from movdi_insn_sp64. + (movsf): Don't force any constant to memory if target is integer + hard register. + Move fp_zero_operand check below the const0_rtx check. + (movtf): Likewise. Also allow fp_zero_operand for stores into + memory. + (movdf): Likewise. Also allow fp_zero_operand for stores into + memory and into integer hard registers. + (clear_df, clear_dfp, movdf_const_intreg_sp32, + movdf_const_intreg_sp64): Remove. + (movdf_insn_sp32, movdf_no_e_insn_sp32): Redo constraints and + conditions. + (movdf_no_e_insn_v9_sp32): New pattern. + (movdf_insn_v9only): Remove. + (movdf_insn_v9only_novis, movdf_insn_v9only_vis): New patterns. + (movdf_insn_sp64): Remove. + (movdf_insn_sp64_novis, movdf_insn_sp64_vis): New patterns. + (movdf_no_e_insn_sp64): Allow storing 0.0 into memory. + (following splits): Rewrite conditions. Add two new splits + for storing 0.0 into memory and registers. + (clear_tf, clear_tf+1, clear_tfp, clear_tfp+1): Remove. + (movtf_insn_sp32): Redo constraints and conditions. + (movtf_insn_vis_sp32): New pattern. + (movtf_no_e_insn_sp32): Redo constraints and conditions. + (movtf_insn_hq_sp64): Likewise. + (movtf_insn_hq_vis_sp64): New pattern. + (movtf_insn_sp64): Redo constraints and conditions. + (movtf_insn_vis_sp64): New pattern. + (movtf_no_e_insn_sp64): Redo constraints and conditions. + (movtf_no_e_insn_sp64+1): New split for storing 0.0L into registers + or memory. + * config/sparc/sparc.c (sparc_override_options): Assume v9 if either + -mvis or -m64 to take down the number of various reload patterns. + +Tue Apr 4 00:41:53 2000 Jeffrey A Law (law@cygnus.com) + + * pa/pa-64.h: New file. + * pa/pa64-regs.h: New file. + * pa/pa64-start.h: New file. + * pa/t-pa64: New file. + * pa/xm-pa64hpux.h: New file. + +2000-04-03 Kaveh R. Ghazi + + * sparc.c (output_restore_regs): Prototype. + (sparc_emit_float_lib_cmp): Constification. + + * emit-rtl.c (const_int_htab_hash, const_int_htab_eq): Likewise. + + * reload1.c (reload_cse_delete_noop_set, reload_cse_simplify): + Prototype. + + * simplify-rtx.c (entry_and_rtx_equal_p): Constification. + (get_value_hash, hash_rtx): Likewise. + + * ssa.c (compute_conservative_reg_partition): Prototype. + + * tree.c (mark_hash_entry): Prototype. + +2000-04-03 Zack Weinberg + + * bb-reorder.c (verify_insn_chain): #ifdef out unless ENABLE_CHECKING. + * i386.h (FUNCTION_ARG_REGNO_P): Remove unnecessary test for N >= 0. + * i386.md (call_value, call_value_pop): Remove unused variable 'addr'. + + * gcc.c (C specs): Pass -fno-show-column to the preprocessor. + * objc/lang-specs.h: Likewise. + +2000-04-03 Neil Booth + + * cppexp.c: wrap long lines. New macros CPP_ICE, SYNTAX_ERROR + and SYNTAX_ERROR2. Replace `' in messages with ''. + (op_to_str): Make re-entrant. + (_cpp_parse_expr): Implement new error macros. Use | rather + than || to logically or 2 boolean integers. Simply expression + checking we have a left operand iff needed. + +2000-04-03 Nick Clifton + + * Makefile.in (diagnostic.o): Depend upon diagnostic.c + +2000-04-03 Philip Blundell + + * config/arm/linux-elf.h (SUBTARGET_EXTRA_LINK_SPEC): Fix typos. + +2000-04-03 Felix Lee + + * fixinc/server.c (find_shell): New function. Avoid $SHELL. + (run_shell): Use it. + +2000-04-03 Jonathan Larmour + + * Makefile.in (stmp-int-hdrs): Make include subdir here... + (stmp-fixproto): ...rather than here. + +Mon Apr 3 00:50:06 2000 Jason Eckhardt + + * pa.c (print_operand): Compute 'base' only inside the code paths + that use it. + +2000-04-03 Geoffrey Keating + + * stor-layout.c (byte_from_pos): Use TRUNC_DIV_EXPR rather than + CEIL_DIV_EXPR. + +2000-04-03 Philipp Thomas + + * i386.h (TARGET_SWITCHES): Remove bogus empty strings, fix typo. + +Mon Apr 3 00:02:59 2000 Brad Lucier + + * Makefile.in (alias.o): Depend on $(TREE_H). + +2000-04-02 Zack Weinberg + + * cppinit.c (cpp_start_read): Turn off -Wtraditional if + processing C++. + * cpplib.c (_cpp_handle_directive): Improve warnings for + traditional C and indented directives. + + * enquire.c, gsyslimits.h, limity.h, config/convex/fixinc.convex, + fixinc/fixinc.irix, fixinc/fixinc.sco, fixinc/fixinc.wrap, + fixinc/inclhack.def: Indent the # of #include_next one space. + * cp/rtti.c: Un-indent #if and #endif. + + * cppexp.c (_cpp_parse_expr): If lex returns '#', it's a + syntax error, but an error has already been printed. + * cpplex.c (_cpp_parse_assertion): Give a more specific error + message when called with nothing remaining on the line. + (_cpp_lex_token): If _cpp_parse_assertion fails, return an + OTHER token, not an ASSERTION. + * cpplib.c (do_assert): When we create a 'base' node, clear + its aschain pointer. + +2000-04-02 Neil Booth + + * cppexp.c: New typedef op_t. struct operation and struct + token updated to use it. + (op_to_str): New function. + (_cpp_parse_expr): Error messages modified to use op_to_str. + +2000-04-02 Michael Hayes + + * config/c4x/c4x.c (c4x_function_arg): Check for void_type_node + before checking MUST_PASS_IN_STACK. + +2000-04-02 Neil Booth + + * cppexp.c: New FINISHED dummy token. Combine operator initial + flags and initial priority into a single constant. New + EQUALITY macro. New operator flag SHORT_CIRCUIT. + (_parse_cpp_expr): Implement new constants. Take left operand + checks out of reduction loop. Handle SHORT_CIRCUIT. End of + parse indicated by reducing FINISHED token. Remove new lines + from cpp_error messages. + +2000-04-01 Mark Mitchell + + * emit-rtl.c (gen_rtx_CONST_INT): Create cached CONST_INTs on the + permanent obstack. + +2000-04-01 Zack Weinberg + + * cpplib.c: Include symcat.h. Add 'origin' field to struct + directive. Add origin values to DIRECTIVE_TABLE. Generate + the strings and function names on the fly. Take the #sccs + entry out of the table if SCCS_DIRECTIVE is not defined. + (_cpp_handle_directive): Decide if the # was at the beginning + of the line here. Issue -pedantic warnings for extended + directives here. Warn about K+R directives with the # + indented, and C89/extended directives with the # not indented, + here. + (do_import, do_include_next, do_warning, do_ident, do_sccs, + do_assert, do_unassert): Don't issue pedantic warning here. + + * cpphash.h: Add CPP_WTRADITIONAL macro. + * cpplib.h (struct cpp_options): Rename warn_stringify to + warn_traditional; update comments. + * cppinit.c (handle_option): Set warn_traditional not + warn_stringify. + * cpphash.c: Replace CPP_OPTION (pfile, warn_stringify) with + CPP_WTRADITIONAL (pfile). + * cpplex.c (_cpp_lex_token): Don't decide if directives should + be ignored in -traditional mode here. + + * cpplex.c: Copy ISTABLE macros from cppinit.c, and adapt them + to initialize speccase[] and trigraph_map[]. Delete all + references to pfile->input_speccase. Always treat '?' as a + special character. Remove table-initialization code from + _cpp_init_input_buffer. + + * cpplib.h (struct cpp_reader): Remove input_speccase field. + * cppinit.c (cpp_cleanup): Don't free input_speccase. + +2000-04-01 Richard Henderson + + * Makefile.in (STAGESTUFF): Wildcard all debugging dumps at once. + (mostlyclean): Likewise. + + * toplev.c (rtl_dump, jump_opt_dump, etc): Remove. + (struct dump_file_info, enum dump_file_index, dump_file): New. + (open_dump_file): Take a dump_file_index not a suffix, and a decl + not a string. Clean out file if we haven't yet done so. Do nothing + if the dump isn't enabled. + (close_dump_file): Do nothing if the dump isn't open. Dump + graph data if requested. + (dump_rtl, clean_dump_file): Remove. + (compile_file): Don't clean the dump files. Only finalize .bp dump + if flag_test_coverage or flag_branch_probabilities. Only finalize + .combine dump if optimizing. Iterate over dump_file to finalize the + graph dumps. + (rest_of_compilation): Update for open_dump_file/close_dump_file. + Convert all uses of dump_rtl. + (decode_d_option): Iterate over dump_file to implement 'a' and to + locate pass-specific dumps. + +2000-04-01 Neil Booth + + * cppexp.c: Redefine priority constants. + (_cpp_parse_expr): Replace left and right priority scheme with + single priority logic. Move LOGICAL to same place as COMPARE. + Remove bogus check for multiple unary +/- operators. + +2000-04-01 Neil Booth + + * cppexp.c: (_cpp_parse_expr): Numerical constants are pushed + within the switch statement. Binary operations break out of + the switch naturally. '(' tokens handled by forcing + immediate shift. ')' handled by forcing immediate reduce to + the previous '('. New error messages. + +2000-03-31 Geoff Keating + + * config/rs6000/rs6000.c (print_operand): Don't use %l for 'low + part', it's already in use. Use %K instead. Add a return at the + end of what is now %K. + * config/rs6000/rs6000.md (elf_low): Use %K instead of %l. + +Sat Apr 1 02:05:29 MET DST 2000 Jan Hubicka + + * builtins.c (expand_builtin_apply): Pass proper parameters to + allocate_dynamic_stack_space. + * calls.c (emit_call_1): Do not adjust stack pointer for SIB, + update stack_pointer_delta; do not update arg_size_so_far. + (compute_argument_block_size): Use stack_delta instead of + stack_pointer_pending and arg_size_so_far. + (expand_call): Add sanity checking for stack_pointer_delta; + save and restore stack_pointer_delta for SIB, use + stack_pointer_delta for alignment; do not update arg_space_so_far. + (emit_library_call_value): Use stack_pointer_delta for alignment. + (store_one_arg): Do not update arg_space_so_far. + * explow.c (adjust_stack, anti_adjust_stack): Update + stack_pointer_delta. + (allocate_dynamic_stack_space): Add sanity checking for + stack_pointer_delta. + * expr.c (init_expr, clear_pending_stack_adjust): Clear + stack_pointer_delta. + (emit_push_insn): Update stack_pointer_delta. + * function.h (struct expr_status): Add x_stack_pointer_delta; + remove x_arg_space_so_far. + (arg_space_so_far): Remove. + (stack_pointer_delta): New macro. + +2000-03-31 Zack Weinberg + + * cpplib.h: Merge struct cpp_options into struct cpp_reader. + Reorder struct cpp_options and struct cpp_reader for better + packing. Replace CPP_OPTIONS macro with CPP_OPTION which + takes two args. Change all 'char' flags to 'unsigned char'. + Move show_column flag into struct cpp_options. Don't + prototype cpp_options_init. + * cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, + cppinit.c, cpplex.c, cpplib.c: + Replace CPP_OPTIONS (pfile)->whatever with + CPP_OPTION (pfile, whatever), and likewise for + opts = CPP_OPTIONS (pfile); ... opts->whatever; + + * cppinit.c (merge_include_chains): Take a cpp_reader *. + Extract CPP_OPTION (pfile, pending) and work with that + directly. + (cpp_options_init): Delete. + (cpp_reader_init): Turn on on-by-default options here. + Allocate the pending structure here. + (cl_options, enum opt_code): Define these from the same table, + kept in a large macro. Add -fshow-column and -fno-show-column + options. + + * cpperror.c (v_message): If show_column is off, don't print + the column number. + + * cppmain.c: Update for new interface. + * fix-header.c: Likewise. + +2000-03-30 Geoff Keating + + * config/rs6000/t-aix43 (AR_FLAGS_FOR_TARGET): Adjust for new + definition. + * Makefile.in (AR_FLAGS_FOR_TARGET): Is now the flags that + are passed to any invocation of AR_FOR_TARGET. + (AR_CREATE_FOR_TARGET): New macro. + (AR_EXTRACT_FOR_TARGET): New macro. + (ORDINARY_FLAGS_TO_PASS): Add AR_CREATE_FOR_TARGET, + AR_EXTRACT_FOR_TARGET. + (many places): Use AR_CREATE_FOR_TARGET, AR_EXTRACT_FOR_TARGET + in place of `$(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET)' and + `$(AR_FOR_TARGET) x'. Pass AR_CREATE_FOR_TARGET and + AR_EXTRACT_FOR_TARGET to sub-makes. + +2000-03-31 Neil Booth + + * cppexp.c: Delete SKIP_OPERAND. Correct priority + PAREN_INNER_PRIO. + (_cpp_parse_expr): Check for multiple unary +/- operators. + Correct priorities of ':' and '?'. Treat ')' as having a + value. Ensure conditional expression is not void. + +2000-03-31 Mark Mitchell + + * alias.c (canon_rtx): Make it global. + (rtx_equal_for_memref_p): CONST_INT equality is now pointer + equality. + * cse.c (struct table_elt): Add canon_exp. + (insert): Clear it. + (invalidate): Canonicalize expressions only once. + * rtl.h (canon_rtx): Declare. + +2000-03-30 Mark Mitchell + + * Makefile.in (emit-rtl.o): Depend on HASHTAB_H. + * alias.c (reg_known_value): Add comments. + (init_alias_analysis): Likewise. + * cse.c (exp_equiv_p): CONST_INTs are equal iff they have the same + address. + (cse_basic_block): Fix typo in comment. + * emit-rtl.c: Include hashtab.h. + (const_int_htab): New variable. + (const_int_htab_hash): New function. + (const_int_htab_eq): Likewise. + (rtx_htab_mark_1): Likewise. + (rtx_htab_mark): Likewise. + (gen_rtx_CONST_INT): Cache all CONST_INTs. + (unshare_all_rtx): Fix formatting. + (init_emit_once): Initialize const_int_htab. + * rtl.c (rtx_equal_p): CONST_INTs are equal iff they have the same + address. + * rtl.texi: Document the fact that all CONST_INTs with the same + value are shared. + +2000-03-30 Richard Henderson + + * alpha.h (FUNCTION_BOUNDARY): Reduce to 128 bits. + +2000-03-30 Zack Weinberg + + * configure.in: Comment out --enable-c-cpplib stanza. + * configure: Regenerate. + +Thu Mar 30 06:32:51 2000 Richard Kenner + + * expr.c (store_constructor): Properly compute displacement and + alignment when offset is variable. + + * expmed.c (store_bit_field, store_fixed_bit_field): Fix more + cases of alignment in bytes. + +Thu Mar 30 13:30:40 2000 Jeffrey A Law (law@cygnus.com) + + * c-parse.in (cast_expr): Move change from March 21 into c-parse.in + since it is used to generate c-parse.y. + * objc-parse.c, objc-parse.y: Regenerated. + + * function.c (expand_function_end): Pass alignment argument to + emit_block_move in bits, not bytes. + +Thu Mar 30 06:32:51 2000 Richard Kenner + + * expr.c (move_by_pieces_ninsns): Fix one more missing align + correction. + + * expmed.c (store_fixed_bit_field): STRUCT_ALIGN is in bits. + + * calls.c (expand_call): Pass bit alignment to mark_reg_pointer. + * explow.c (memory_address, allocate_dynamic_stack_space): Likewise. + * function.c (assign_parms): Likewise. + * integrate.c (expand_inline_function): Likewise. + * stmt.c (expand_decl): Likewise. + (copy_rtx_and_substitute): Likewise. + * expr.c (expand_expr, expand_expr_unaligned): Likewise. + (clear_by_pieces): Fix error in last change. + * emit-rtl.c (init_emit): Set known registers alignment in bits. + * function.h (regno_pointer_align): Now unsigned. + * config/arm/arm.c (alignable_memory_operand): REGNO_POINTER_ALIGN + is in bits. + * config/i386/i386.c (aligned_operand): Likewise. + * config/sparc/sparc.c (mem_min_alignment): Likewise. + * config/alpha/alpha.c (aligned_memory_operand): Likewise. + (unaligned_memory_operand): Likewise. + (alpha_expand_block_move, alpha_expand_block_clear): Likewise. + Also make alignments and sizes unsigned and some whitespace cleanup. + (alpha_va_start): Do nothing if VALIST's type is error_mark_node. + + * builtins.c (get_pointer_alignment): Use host_integerp & tree_low_cst. + (expand_builtin_apply): Pass alignment to emit_block_move in bits. + (expand_builtin_memcpy, expand_builtin_va_copy): Likewise. + (expand_builtin_memset): Likewise, but to clear_storage. + * calls.c (save_fixed_argument_area): Likewise, to move_by_pieces. + (restore_fixed_argument_area): Likewise. + (store_unaligned_arguments_into_pseudos): Likewise, to store_bit_field. + (load_register_parameters): Likewise, to emit_group_load. + (expand_call): Likewise, to emit_group_store and emit_block_move. + (emit_library_call_value_1): Likewise, to emit_block_move. + (store_one_arg): Likewise, and to emit_push_insn. + * expmed.c (extract_bit_field): Alignment is in bits, not bytes. + (extract_fixed_bit_field, extract_split_bit_field): Likewise. + * expr.c (move_by_pieces, move_by_pieces_ninsns): Likewise. + (emit_block_move, emit_group_load, emit_group_store): Likewise. + (clear_by_pieces, clear_storage, emit_push_insn): Likewise. + (expand_assigment, store_expr, store_constructor_field): Likewise. + (expand_expr_unaligned, do_jump, do_compare_and_jump): Likewise. + (store_constructor, store_field, get_inner_reference): Likewise. + Use host_integerp and tree_low_cst; sizes and positions HOST_WIDE_INT. + (expand_expr, case COMPONENT_REF): Likewise. + (copy_blkmode_from_regs): Use UNSIGNED_HOST_WIDE_INT for sizes + and positions; reindent code. + * expr.h (emit_cmp_insn, emit_cmp_and_jump_insns): Alignment unsigned. + * function.c (purge_addressof_1): Pass bit align to store_bit_field. + (assign_parms): Likewise to emit_group_store. + * optabs.c (prepare_cmp_insn): Alignment is in bits. + (emit_cmp_and_jump_insns, emit_cmp_insn): Likewise, and also unsigned. + * stmt.c (expand_value_return): Pass align in bits to emit_group_load. + (expand_return): Likewise to {extract,store}_bit_field. + * stor-layout.c (get_mode_alignment): Minor cleanup. + * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Align is in bits. + * config/sh/sh.h (MOVE_BY_PIECES_P): Likewise. + +2000-03-29 Nick Clifton + + * config/arm/arm.h: Undo effects of previous delta: + (ASM_SPEC): Do not define. + (SUBTARGET_EXTRA_ASM_SPEC): Do not define. + + * config/arm/linux-elf.h: (SUBTARGET_EXTRA_ASM_SPEC) Fix + typo. + +2000-03-29 Zack Weinberg + + * cppinit.c (cpp_start_read): Call initialize_dependency_output + only after reading in the primary source file. + +2000-03-29 Geoff Keating + + * c-common.c (c_common_nodes_and_builtins): The first parameter to + __builtin_va_start and __builtin_va_copy is now either a 'va_list' + or a reference to a va_list. + * builtins.c (stabilize_va_list): Simplify now we don't have to + work around C array address decay. + * c-typeck.c (convert_for_assignment): Handle assignment to + a reference parameter by taking the address of the RHS. + * ginclude/stdarg.h (va_start): Don't take address of first parameter. + (va_copy): Likewise. + (__va_copy): Likewise. + * ginclude/varargs.h (va_start): Likewise. + (__va_copy): Likewise. + +Wed Mar 29 15:44:53 2000 Jeffrey A Law (law@cygnus.com) + + * i386/djgpp.h: Remove extraneous "+". + + * stmt.c (stmt_loop_nest_empty): Fix thinko in last change. + + * calls.c (expand_call): Fix typo in last change. + +2000-03-29 Jason Merrill + + * tree.c (unsave_expr_1): Don't mess with a TARGET_EXPR that hasn't + been expanded. + +Wed Mar 29 15:39:10 2000 Richard Kenner + + * stor-layout.c (bit_from_pos, byte_from_pos): New functions. + (pos_from_byte, pos_from_bit, normalize_offset): Likewise. + (normalize_rli, rli_size_so_far, rli_size_unit_so_far): Use them. + * tree.c (bit_position, byte_position): Likewise. + * tree.h: Declare new functions. + +2000-03-29 Nick Clifton + + * config/arm/arm.c: Minor formatting changes/ + * config/arm/arm.h (SUBTARGET_EXTRA_ASM_SPEC): Define if not + already defined. + (ASM_SPEC): Define if not already defined. + +2000-03-29 Zack Weinberg + + * cppfiles.c (cpp_read_file): Don't pass zero-length string to + _cpp_calc_hash. + +2000-03-29 Jakub Jelinek + + * dwarf2out.c (gen_enumeration_type_die): If enum has a negative + value, don't output it as unsigned. + +Wed Mar 29 10:53:49 2000 Jeffrey A Law (law@cygnus.com) + + * stmt.c (stmt_loop_nest_empty): Allow cfun->stmt to be NULL. + +2000-03-29 Kaveh R. Ghazi + + * c-common.c (c_common_nodes_and_builtins): Don't special case + cplus_mode when declaring builtin bzero/bcmp, always avoid + prototype arguments. + +2000-03-29 Bruce Korb + + * fixinc/mkfixinc.sh: Initially set the variable "fixincludes" + to a non-file + +Wed Mar 29 15:08:01 MET DST 2000 Jan Hubicka + + Convert ACCUMULATE_OUTGOING_ARGS to an expression. + * calls.c (PUSH_ARGS_REVERSED) Change to expression. + (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. + (struct arg_data): Remove #ifdef ACCUMULATE_OUTGOING_ARGS. + (save_fixed_argument_area, restore_fixed_argument_area): + conditionize by #ifdef REG_PARM_STACK_SPACE only. + (emit_call): Change #ifdefs on ACCUMULATE_OUTGOING_ARGS + to conditions, handle RETURN_POPS_ARGS on ACCUMULATE_OUTGOING_ARGS. + (precompute_register_parameters): Avoid #ifdefs on + ACCUMULATE_OUTGOING_ARGS and PUSH_ARGS_REVERSED. + (stire_one_args): Likewise. + (expand_call): Likewise; conditionize PUSH_ROUNDING code by PUSH_ARGS. + (emit_library_call_value_1): Likewise. + (compute_argument_block_size): Align to STACK_BOUNDARY only for + ACCUMULATE_OUTGOING_ARGS. + * combine.c (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default + value. + (nonzero_bits): Conditionize PUSH_ROUNDING code by USE_PUSH. + (use_crosses_set_p): Likewise. + * all targets (ACCUMULATE_OUTGOING_ARGS define): Change to + #define ACCUMULATE_OUTGOING_ARGS 1. + * i386.c (ix86_compute_frame_size): Handle ACCUMULATE_OUTGOING_ARGS + frames. + * i386.h (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS): New + constants. + (TARGET_PUSH_ARGS, TARGET_ACCUMULATE_OUTGOING_ARGS): New macros. + (TARGET_SWITCHES): Add push-args, no-push-args, + accumulate-outgoing-args and no-accumulate-outgoing-args. + (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): New macro. + * expr.c (ACCUMULATE_OUTGONG_ARGS, PUSH_ARGS): Provide default. + (push_block): Avoid ifdefs on ACCUMULATE_OUTGONG_ARGS + and PUSH_ROUNDING. + (emit_push_insn): Likewise. + * final.c (ACCUMULATE_OUTGOING_ARGS): Provide default. + (final_scan_insn): Avoid ifdefs on ACCUMULATE_OUTGOING_ARGS. + * function.c (ACCUMULATE_OUTGOING_ARGS): Provide default. + (STACK_DYNAMIC_OFFSET): Define correctly for both + ACCUMULATE_OUTGOING_ARGS and normal mode. + * invoke.texi (-mpush_args, -maccumulate-outgoing-args): Document. + * tm.texi (PUSH_ARGS): Document. + (ACCUMULATE_OUTGOING_ARGS, PUSH_ROUNDING): Update documentation. + +Wed Mar 29 11:51:13 MET DST 2000 Jan Hubicka + + * flags.h (flag_optimize_sibling_calls): Declare. + * calls.c (expand_call): Fail sibcall when + !flag_optimize_sibling_calls + * invoke.texi (flag_optimize_sibling_calls): Document. + * toplev.c (flag_optimize_sibling_calls): New global variable. + (f_options): Add flag_optimize_sibling_calls. + (rest_of_compilation): Conditionize + optimize_sibling_and_tail_recursive_calls by + flag_optimize_sibling_calls. + (main): Set flag_optimize_sibling_calls for -O2. + * stmt.c (expand_return): Conditionize tail recursion by + flag_optimize_sibling_calls. + +2000-03-29 Richard Henderson + + * config/i386/att.h (LOCAL_LABEL_PREFIX): Define. + (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL): Use it. + +2000-03-29 Nathan Sidwell + + * except.c (add_eh_table_entry): Mark type_info's as referenced. + +2000-03-29 Alexandre Oliva + + * config/rs6000/aix41.h (CPP_SPEC): Define _ANSI_C_SOURCE if -ansi + is given. + * config/rs6000/aix43.h (CPP_SPEC): Likewise. + * config/rs6000/rs6000.h (CPP_SPEC): Moved to... + * config/rs6000/aix.h: then modified likewise. + +2000-03-28 Richard Henderson + + * rtl.h: Redistribute enum reg_note documentation. + Kill trailing whitespace. + * rtl.c (reg_note_name): Adjust to match enum reg_note tweeks. + Kill trailing whitespace. + +2000-03-28 Zack Weinberg + + * cppfiles.c (hash_IHASH): Just return i->hash. + (cpp_included): Set dummy.hash using _cpp_calc_hash. Use + htab_find_with_hash. + (cpp_read_file): Likewise. + (find_include_file): Likewise. Properly initialize + ih->nshort. Share ih->name and ih->nshort if possible. + * cpphash.c (_cpp_calc_hash): New function. + (hash_HASHNODE): Just return h->hash. + (_cpp_lookup): Set dummy.hash using _cpp_calc_hash. Use + htab_find_with_hash. + * cpphash.h: Prototype _cpp_calc_hash. + * cppinit.c (initialize_builtins): Provide a valid hash + to _cpp_make_hashnode, using _cpp_calc_hash. + + * cpphash.c (collect_expansion): # is not a special character + in object-like macros. In -traditional mode, /**/ is not + token paste at the beginning or end of the line. + * cpplib.c (do_include, do_import, do_include_next): If + parse_include fails, return immediately. + +2000-03-28 Jason Merrill + + * config/arm/arm.md (return peepholes): Update to reflect the new + call insn patterns. + * config/arm/arm.c (arm_volatile_func): Also check + current_function_nothrow. + (output_return_instruction, output_func_prologue): Use it. + (arm_output_epilogue, arm_expand_prologue): Likewise. + +2000-03-27 Tom Tromey + + * gcc.c (handle_braces): In {x*...} case, break out of loop if + switch is found. + +Tue Mar 28 11:55:48 2000 Richard Kenner + + * expr.c (store_constructor): SIZE now signed. + For EXPR_SIZE, don't evaluate size; just needed if constant. + * fold-const.c (fold): Fix a number of cases when folded tree is + wrong type. + * function.c (flush_addressof): Reenable. + * tree.h (flush_addressof): Likewise. + * toplev.c (independent_decode_option): Look at strings_processed. + * config/alpha/alpha.h (MINIMUM_ATOMIC_ALIGNMENT): Cast to unsigned. + +Tue Mar 28 08:29:46 2000 Jan Hubicka + + * sibcall.c (identify_call_return_value): Find last call in the chain; + Allow stack adjustment after function call. + + * regmove.c (struct csa_memlist): Make mem field rtx *. + (record_one_stack_ref): Accept rtx * instead of rtx as parameter. + (try_apply_stack_adjustment): Replace whole MEM rtx. + (combine_stack_adjustments_for_block): Update calls + to record_one_stack_ref. + +2000-03-28 Neil Booth + + * cpplex.c (_cpp_read_and_prescan): Mark end of input buffer with + '\\' rather than a null character, so nulls are not special. Fix + "\\\n" handling in end-of-buffer conditions. Use trigraph map to + speed trigraph conversion. + (_cpp_init_input_buffer): Initialize trigraph map. + +2000-03-27 Alan Modra + + * config/i386/i386.c (output_387_binary_op): Correct intel + mode assembly output, and add spaces after commas in AT&T + output. Correct Unixware assembler comment. Document input + constraints. Comment fp operations. Reduce profligate buffer + size. Remove extraneous abort. Localize temp var. + (SYSV386_COMPAT): Define. Add !SYSV386_COMPAT code. + (output_fix_trunc): Add spaces after commas in assembly output. + +2000-03-27 Richard Henderson + + * i386-protos.h (ix86_match_ccmode): Declare. + * i386.c (ix86_match_ccmode): New. + (ix86_expand_fp_compare): Update for pattern renames. + (ix86_expand_strlensi_unroll_1): Likewise. + * i386.h (EXTRA_CC_MODES): Add CCZ. + (SELECT_CC_MODE): Use it for EQ/NE zero. + * i386.md (cmpsi_ccz_1): New. + (cmpqi_ccz_1): New. + (*testsi_ccz_1): New. + (testqi_ccz_1): New. + (cmpsi_ccno_1): Rename from cmpsi_0. + (testsi_ccno_1): Rename from testsi_1. + (testqi_ccno_1): Rename from testqi_1. + (*testqi_ext_ccz_0): Rename from testqi_ext_0. + (testqi_ext_ccno_0): Rename from *testqi_ext_1. + (*cmphi_0): Use ix86_match_ccmode. + (*cmpqi_ext_2, *addsi_2, *addhi_2, *addqi_2): Likewise. + (*subsi_2, *subhi_2, *subqi_2, *testhi_1): Likewise. + (*testqi_ext_1, *testqi_ext_2, *testqi_ext_3): Likewise. + (*andsi_2, *andhi_2, *andqi_2, *andqi_ext_0_cc): Likewise. + (*iorsi_2, *iorhi_2, *iorqi_2): Likewise. + (*xorsi_2, *xorhi_2, *xorqi_cc_1): Likewise. + (*one_cmplsi2_2, *one_cmplhi2_2, *one_cmplqi2_2): Likewise. + (*ashlsi3_cmpno, *ashlhi3_cmpno, *ashlqi3_cmpno): Likewise. + (*ashrsi3_cmpno, *ashrhi3_cmpno, *ashrqi3_cmpno): Likewise. + (*lshrsi3_cmpno, *lshrhi3_cmpno, *lshrqi3_cmpno): Likewise. + (appropriate peepholes): Likewise. + (*cmphi_1, *cmpqi_ccno_1, *cmpqi_1): Star out name. + (*subsi_3, *subhi_3, *subqi_3): Remove. + (*negdi2_1+1 splitter): Use CCZ for neg patterns. + (*negsi2_cmp, *neghi2_cmp, *negqi2_cmp): Remove. + (*negsi2_cmpz): Rename from *negsi2_cmpno, use CCZ. + (*neghi2_cmpz, *negqi2_cmpz): Similarly. + (x86_shift_adj_1): Use CCZ. + (*dbra_ge+1, *dbra_ge+2, ffssi2, ffssi_1): Likewise. + +2000-03-27 Stan Cox + + * resource.h (mark_resource_type): New. + * resource.c (find_dead_or_set_registers, mark_target_live_regs, + find_free_register): Use mark_resource_type. + (mark_set_resources): Change include_delayed_effects + to mark_resource_type. + * reorg.c (steal_delay_list_from_target, try_merge_delay_insns, + redundant_insn, fill_simple_delay_slots, fill_slots_from_thread): + Use mark_resource_type. + +2000-03-27 Richard Henderson + + * i386.md (call_pop_0, call_value_pop_0): New. + (call_pop_1): Remove constraint from unused arg. Support sibcalls. + (call_value_pop_1): Likewise. + (call_0, call_value_0): New. + (call_1, call_value_1): Remove constraint from unused arg. + +2000-03-27 Nick Clifton + + * invoke.texi (Spec Files): Document new spec % command created by + Tom Tromey's recent patch. + +2000-03-27 Jakub Jelinek + + * libgcc2.h (MIN_UNITS_PER_WORD): Define to UNITS_PER_WORD + if not defined. + +Mon Mar 27 06:04:22 2000 Richard Kenner + + * expr.c (expand_assignment): Fix typo in last change. + + * libgcc2.h: Use MIN_UNITS_PER_WORD, not UNITS_PER_WORD. + +Sun Mar 26 20:15:26 2000 Richard Kenner + + * c-convert.c (convert): Return if output or input type is ERROR_MARK. + * c-decl.c (duplicate_decls): Only look at DECL_BUILT_IN_NONANSI + and DECL_INLINE if FUNCTION_DECL. + (pushdecl, redeclaration_error_message): Likewise, for DECL_INLINE. + (store_parm_decls): Check for type of PARM_DECL being ERROR_MARK. + Use DECL_WEAK, not DECL_RESULT, to flag for already seen. + (combine_parm_decls): Likewise. + * ggc-common.c (gcc_mark_tree_children, case 'd'): Use DECL_RESULT_FLD. + * print-tree.c (print_node): Likewise. + Only test DECL_PACKED, DECL_INLINE, DECL_BIT_FIELD, and + DECL_TRANSPARENT_UNION on proper decl types. + Properly handly DECL_INCOMING_RTL and DECL_SAVED_INSNS. + * stor-layout.c (layout_decl): Only check DECL_PACKED and + DECL_BIT_FIELD of FIELD_DECL. + * tree.h (DECL_RESULT_FLD): New macro. + + * expr.c (expand_assignment): Add code to handle variable-sized + BLKmode case. + +2000-03-26 Richard Henderson + + * calls.c (expand_call): Pass parms not original exp to + optimize_tail_recursion. Mind return value instead of looking + for a barrier. + * stmt.c (optimize_tail_recursion): Take parameter list, not entire + call_expr. Move checks for call_expr and current_function_decl ... + (expand_return): ... here. + +2000-03-26 Tom Tromey + + * gcc.c (handle_braces): Recognize `%{ + + * jump.c (jump_optimize_1): Fix typo in elide optimizations + for minimal jump pass test. + +2000-03-26 Mark Mitchell + + * integrate.c (function_cannot_inline_p): Do inline functions that + return `void'. + +Sun Mar 26 11:37:55 2000 Richard Kenner + + * stor-layout.c (layout_type, set_sizetype): early_type_list is + now a list of TREE_LIST entries, not types. + * tree.c (build_common_tree_nodes_2): Eliminate dupliate type sets. + + * expmed.c (extract_bit_field): Ensure BITS_PER_WORD is signed in MAX. + * config/arm/pe.c (arm_pe_return_in_memory): Use host_integerp and + int_bit_position. + * config/mips/mips.c (function_arg): Likewise; also remove cast + and make variables unsigned or HOST_WIDE_INT and use tree_low_cst. + (mips_function_value): Use int_byte_position and make HOST_WIDE_INT. + * config/mips/abi64.h (SETUP_INCOMING_VARARGS): Offsets are unsigned. + * config/mips/mips.h (BITS_PER_WORD, UNITS_PER_WORD): Cast to unsigned. + (UNITS_PER_FPREG, INT_TYPE_SIZE, LONG_TYPE_SIZE): Likewise. + (POINTER_SIZE, POINTER_BOUNDARY,PARM_BOUNDARY): Likewise. + (GP_REG_P, FP_REG_P, MD_REG_P, ST_REG_P): Ensure subtraction signed. + (struct mips_arg): arg_number, arg_words, fp_arg_words, and + num_adjusts now unsigned. + (FUNCTION_ARG_BOUNDARY): Remove unneeded cast. + * config/sparc/sparc.c (struct function_arg_record_value_parms): + NREGS now unsigned. + (function_arg_record_value_1): STARTBITPOS arg now HOST_WIDE_INT + as is BITPOS variable; use host_integerp and int_bit_position. + (function_arg_record_value_2): Likewise. + (function_arg_record_value_3): Arg BITPOS now HOST_WIDE_INT. + Variable REGNO now unsigned. + (function_arg_record_value): NREGS now unsigned. + +2000-03-26 Bernd Schmidt + + * jump.c (mark_all_labels): Handle CALL_PLACEHOLDERs. + +Sat Mar 25 09:12:10 2000 Richard Kenner + + * Rework fields used to describe positions of bitfields and + modify sizes to be unsigned and use HOST_WIDE_INT. + * alias.c (reg_known_value_size): Now unsigned. + * c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position. + (really_start_incremental_init): Use bitsize_zero_node. + (push_init_level, pop_init_level, output_init_element): Likewise. + Use bitsize_unit_node and bitsize_one_node. + (output_pending_init_elements, process_init_element): Likewise. + * combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned. + (make_extraction): Position and length HOST_WIDE_INT and unsigned + HOST_WIDE_INT, respectively. + (get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT. + (num_sign_bit_copies): Returns unsigned. + BITWIDTH now unsigned; rework arithmetic. + Remove recursive call from arg to MAX. + (combine_instructions, init_reg_last_arrays): NREGS now unsigned. + (setup_incoming_promotions, can_combine_p, try_combine, simplify_set): + REGNO now unsigned. + (set_nonzero_bit_and_sign_copies): NUM now unsigned. + (find_split_point, expand_compound_operation, make_extraction): LEN + now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT. + (make_field_assignment): Likewise. + (combine_simplify_rtx): Add cast. + (expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic. + (force_to_mode): WIDTH now unsigned; add cast. + (if_then_else_cond): SIZE now unsigned. + (nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned. + (extended_count): Now returns unsigned. + (simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT. + Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned. + (simplify_comparison): MODE_WIDTH now unsigned. + (update_table_tick): REGNO and ENDREGNO now unsigned; new var R. + (mark_used_regs_combine): Likewise; rework arithmetic. + (record_value_for_reg): REGNO, ENDREGNO, and I now unsigned. + (record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise. + (record_promoted_value): REGNO now unsigned. + (get_last_value_validate): REGNO, ENDREGNO, and J now unsigned. + (get_last_value): REGNO now unsigned. + (use_crosses_set_p): REGNO and ENDREGNO now unsigned. + (reg_dead_regno, reg_dead_endregno): Now unsigned. + (remove_death): Arg REGNO now unsigned. + (move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned. + (reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO + now unsigned. + * convert.c (convert_to_integer): INPREC and OUTPREC now unsigned. + * cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned. + (struct cse_reg_info): REGNO now unsigned. + (cached_regno): Now unsigned. + (REGNO_QTY_VALID_P): Add cast. + (make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned. + (remove_invalid_regs): Likewise. + (remove_invalid_subreg_refs): Likewise; arg WORD also unsigned + as are variables END and I. + (get_cse_reg_info, insert): Likewise. + (mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned. + (canon_hash): Likewise. + (insert_regs, lookup_for_remove): REGNO now unsigned. + (invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned. + New variable RN. + * dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0. + * dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast. + * emit-rtl.c (subreg_realpart_p): Add cast. + (operand_subword): Arg I is now unsigned as is var PARTWORDS. + (operand_subword_force): Arg I is now unsigned. + * except.c (eh_regs): Variable I is now unsigned. + * explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT. + * expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT; + length is unsigned HOST_WIDE_INT; likewise for internal variables. + (store_split_bit_field, extract_fixed_bit_field): Likewise. + (extract_split_bit_field, store_bit_field, extract_bit_field): + Likewise. + * expr.c (store_constructor_fields, store_constructor, store_field): + Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT. + (expand_assignment, expand_expr, expand_expr_unaligned): Likewise. + (do_jump): Likewise. + (move_by_pieces, move_by_pieces_ninsns, clear_by_pieces): + MAX_SIZE is now unsigned. + (emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned. + (emit_group_store): Likewise. + (emit_move_insn): I now unsigned. + (store_constructor): Use host_integerp, tree_low_cst, and + bitsize_unit_node. + (get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT. + Rework all calculations to use trees and new fields. + * expr.h (promoted_input_arg): Regno now unsigned. + (store_bit_field, extract_bit_field): Adjust types of pos and size. + (mark_seen_cases): Arg is HOST_WIDE_INT. + * flow.c (verify_wide_reg_1): REGNO now unsigned. + * fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT; + precisions and alignments are unsigned. + (optimize_bit_field_compare, fold_truthop): Likewise. + (int_const_binop): Adjust threshold for size_int_type_wide call. + (fold_convert): Likewise. + (size_int_type_wide): Make table larger and fix thinko that only + had half of table used. + (all_ones_mask_p, fold): Precisions are unsigned. + * function.c (put_reg_info_stack): REGNO is unsigned. + (instantiate_decl): Size is HOST_WIDE_INT. + (instantiate_virtual_regs): I is unsigned. + (assign_parms): REGNO, REGNOI, and REGNOR are unsigned. + (promoted_input_arg): REGNO is unsigned. + * function.h (struct function): x_max_parm_reg is now unsigned. + * gcse.c (max_gcse_regno): Now unsigned. + (struct null_pointer_info): min_reg and max_reg now unsigned. + (lookup_set, next_set): REGNO arg now unsigned. + (compute_hash_table): REGNO and I now unsigned. + (handle_avail_expr): regnum_for_replacing now unsigned. + (cprop_insn): REGNO now unsigned. + (delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned. + * ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case. + * global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned. + * hard-reg-set.h (reg_class_size): Now unsigned. + * integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO. + * jump.c (mark_modified_reg): I now unsigned; add cast. + (rtx_equal_for_thread_p): Add cast. + * loop.c (max_reg_before_loop): Now unsigned. + (struct_movable): REGNO now unsigned. + (try_copy_prop): REGNO arg unsigned. + (regs_match_p): XN and YN now unsigned. + (consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned. + (strength_reduce): Likewise; NREGS also unsigned. + (first_increment_giv, last_increment_giv unsigned): Now unsigned. + * loop.h (struct iv_class): REGNO now unsigned. + (max_reg_before_loop, first_increment_giv, last_increment_giv): + Now unsigned. + * machmode.h (mode_size, mode_unit_size): Now unsigned. + (mode_for_size, smallest_mode_for_size): Pass size as unsigned. + * optabs.c (expand_binop): I and NWORDS now unsigned. + (expand_unop): I now unsigned. + * print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do + print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET. + * real.c (significand_size): Now returns unsigned. + * real.h (significand_size): Likewise. + * regclass.c (reg_class_size): Now unsigned. + (choose_hard_reg_mode): Both operands now unsigned. + (record_reg_classes): REGNO and NR now unsigned. + (reg_scan): NREGS now unsigned. + (reg_scan_update): old_max_regno now unsigned. + (reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned. + * reload.c (find_valid_class): BEST_SIZE now unsigned. + (find_dummy_reload): REGNO, NWORDS, and I now unsigned. + (hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned. + Likewise for variable R. + (refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned, + as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R. + (find_equiv_reg): Add casts. + (regno_clobbered_p): Arg REGNO now unsigned. + * reload.h (struct reload): NREGS now unsigned. + (refers_to_regno_for_reload_p): Regno args are unsigned. + (regno_clobbered_p): Likewise. + * reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned. + (compute_use_by_pseudos): REGNO now unsigned. + (find_reg): I and J now unsigned, new variable K, and change loop + variables accordingly; THIS_NREGS now unsigned. + (alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned. + (spill_hard_reg): REGNO arg now unsigned; add casts. + (forget_old_reloads_1): REGNO, NR, and I now unsigned. + (mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned. + (clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO, + END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned. + (reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned. + (choose_reload_regs): MAX_GROUP_SIZE now unsigned. + (emit_reload_insns): REGNO now unsigned. + (reload_cse_move2add): Add cast. + (move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO + and rework loop. + * resource.c (mark_referenced_resources, mark_set_resources): New + variable R; REGNO and LAST_REGNO now unsigned. + (mark_target_live_regs): J and REGNO now unsigned. + * rtl.c (mode_size, mode_unit_size): Now unsigned. + * rtl.h (union rtunion_def): New field rtuint. + (XCUINT): New macro. + (ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT. + (operand_subword, operand_subword_force): Word number is unsigned. + (choose_hard_reg_mode): Operands are unsigned. + (refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned. + (find_regno_note, find_regno_fusage, replace_regs): Likewise. + (regno_use_in, combine_instructions, remove_death): Likewise. + (reg_scan, reg_scan_update): Likewise. + (extended_count): Return is unsigned. + * rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I, + INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO. + (reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned. + (reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned. + (reg_reg_last_1): FIRS and LAST now unsigned. + (dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned. + (dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO + now unsigned. + (find_regno_note, regno_use_in): Arg REGNO now unsigned. + (find_regno_fusage): Likewise; also var REGNOTE now unsigned. + (find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned. + (replace_regs): Arg NREGS now unsigned. + * sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0. + * simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned. + (simplify_binary_operation): Likewise. + (cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and + THIS_LAST now unsigned. + (cselib_record_set): Add cast. + * ssa.c (ssa_max_reg_num): Now unsigned. + (rename_block): REGNO now unsigned. + * stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT; + sizes now unsigned. + (all_cases_count): Just return -1 not -2. + COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT. + Rework tests to use trees whenever possible. + Use host_integerp and tree_low_cst. + (mark_seen_cases): COUNT arg now HOST_WIDE_INT; + Likewise variable NEXT_NODE_OFFSET; XLO now unsigned. + (check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT. + * stor-layout.c (mode_for_size): SIZE arg now unsigned. + (smallest_mode_for_size): Likewise. + (layout_decl): Simplify handing of a specified DECL_SIZE_UNIT. + KNOWN_ALIGN is now an alignment, so simplify code. + Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type. + (start_record_layout): Renamed from new_record_layout_info. + Update to new fields. + (debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far): + New functions. + (place_union_field): Renamed from layout_union_field. + Update to use new fields in rli. + (place_field): Renamed from layout_field. + Major rewrite to use new fields in rli; pass alignment to layout_decl. + (finalize_record_size): Rework to use new fields in rli and handle + union. + (compute_record_mode): Rework to simplify and to use new DECL fields. + (finalize_type_size): Make rounding more consistent. + (finish_union_layout): Deleted. + (layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either. + (layout_type, case RECORD_TYPE): Call new function names. + (initialize_sizetypes): Set TYPE_IS_SIZETYPE. + (set_sizetype): Set TYPE_IS_SIZETYPE earlier. + (get_best_mode): UNIT is now unsigned; remove casts. + * tree.c (bit_position): Compute from new fields. + (byte_position, int_byte_position): New functions. + (print_type_hash_statistics): Cast to remove warning. + (build_range_type): Use host_integerp and tree_low_cst to try to hash. + (build_index_type): Likewise; make subtype of sizetype. + (build_index_2_type): Pass sizetype to build_range_type. + (build_common_tree_nodes): Use size_int and bitsize_int to + initialize nodes; add bitsize_{zero,one,unit}_node. + * tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK. + (DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise. + (DECL_PACKED, DECL_BIT_FIELD): Likewise. + (DECL_FIELD_BITPOS): Deleted. + (DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields. + (DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK. + (DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise. + (DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise. + (DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise. + (DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise. + (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise. + (DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK. + (DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK. + (DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise. + (DECL_ALIGN): Adjust to new field in union. + (DECL_OFFSET_ALIGN): New field. + (DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK. + (DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK. + (union tree_decl): Add struct for both aligns. + (enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}. + (bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added. + (struct record_layout_info): Rework fields to have offset + alignment and byte and bit position. + (start_record_layout, place_field): Renamed from old names. + (rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls. + (byte_position, int_byte_position): Likewise. + (get_inner_reference): Change types of position and length. + * unroll.c (unroll_loop): New variable R; use for some loops. + MAX_LOCAL_REGNUM and MAXREGNUM now unsigned. + (calculate_giv_inc): Arg REGNO now unsigned. + (copy_loop_body): REGNO and SRC_REGNO now unsigned. + * varasm.c (assemble_variable): Clean up handling of size using + host_integerp and tree_low_cst. + (decode_addr_const): Use byte, not bit, position. + (output_constructor): bitpos and offsets are HOST_WIDE_INT; + use tree_low_cst and int_bit_position. + * objc/objc-act.c (build_ivar_list_initializer): Use byte_position. + +Fri Mar 24 20:13:49 2000 Jason Eckhardt + + * bb-reorder.c (REORDER_MOVED_BLOCK_END): Removed. + (reorder_block_def): New members eff_head and eff_end. + (REORDER_BLOCK_EFF_HEAD, REORDER_BLOCK_EFF_END): New macros. + (verify_insn_chain): New function. + (skip_insns_between_block): Add code to skip deleted insns. + Check for note before using. + (chain_reorder_blocks): Replace calls to skip_insns_between_block + with references to REORDER_BLOCK_EFF_HEAD and REORDER_BLOCK_EFF_END. + Check for note before using. + (make_reorder_chain): Use INTVAL rather than XINT to get REG_BR_PROB. + (fixup_reorder_chain): Restructure, clean up, defect removal. + (reorder_basic_blocks): Remove last_insn and references to it. + Moved insn chain verification code into a new function (see above). + Delete defective code that sets last insn. + Initialize REORDER_BLOCK_EFF_HEAD and REORDER_BLOCK_EFF_END for + all blocks. + +2000-03-25 Michael Hayes + + * config/c4x/c4x.h (CPP_SPEC): Remove erroneous space. + +2000-03-24 Richard Henderson + + * tree.c (lang_safe_for_unsave): Remove. + (unsafe_for_reeval): Transmute and rename from safe_for_unsave, + allowing for two levels of unsafeness. Remove lang hook. + * tree.h: Update declarations. + * calls.c (expand_call): Rename safe_for_reeval to try_tail_call. + Create temporary VAR_DECLs to protect very unsafe_for_reeval trees. + Always fail sibcalls when there are pending cleanups. + +2000-03-24 Geoff Keating + + * flow.c (propagate_block): When we delete an ADDR_VEC, + also delete the BARRIER following it if there is one. + +2000-03-24 Richard Henderson + + * builtins.c (expand_builtin_bzero): Convert `length' argument + to sizetype. + +2000-03-24 Jakub Jelinek + + * sibcall.c (skip_copy_to_return_value): Use OUTGOING_REGNO for + comparison if regno's are equal. + * calls.c (initialize_argument_informat): Add ecf_flags argument. + Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. + (expand_call): Update caller. + Avoid making a sibling call if argument size of the callee is larger + than argument size of the caller. + Call hard_function_value with outgoing set if in sibcall pass. + Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. + + * final.c (permitted_reg_in_leaf_functions, only_leaf_regs_used): + Change LEAF_REGISTERS from an array initializer to actual array + identifier. Move static global variable into the function. + (leaf_function_p): Allow SIBLING_CALL_P calls even outside of + sequences for leaf functions. + * global.c (global_alloc): Likewise. + * tm.texi (LEAF_REGISTERS): Update documentation. + + * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Remove the ugly + TARGET_FLAT leaf disabling hack. + (LEAF_REGISTERS): Changed from an array initializer to actual array + identifier to avoid duplication and remove the above hack. + (FUNCTION_OK_FOR_SIBCALL): Define. + * config/sparc/sparc.md (sibcall): New attr type. Use it almost + always like call attribute. + (eligible_for_sibcall_delay): New attribute. + (sibcall): New delay type. + (sibcall, sibcall_value, sibcall_epilogue): New expands. + (sibcall_symbolic_sp32, sibcall_symbolic_sp64, + sibcall_value_symbolic_sp32, sibcall_value_symbolic_sp64): New insns. + * config/sparc/sparc.c (sparc_leaf_regs): New array. + (eligible_for_sibcall_delay, output_restore_regs, output_sibcall): + New functions. + (output_function_epilogue): Move part of the code into + output_restore_regs. + (ultra_code_from_mask, ultrasparc_sched_reorder): Handle + TYPE_SIBCALL. + * sparc-protos.h (output_sibcall, eligible_for_sibcall_delay): New + prototypes. + + * config/sparc/sparc.h (REVERSIBLE_CC_MODE): Revert Jan, 25 change + until infrastructure is finished. + +Fri Mar 24 13:49:45 2000 Jeffrey A Law (law@cygnus.com) + + * integrate.c (save_for_inline_nocopy): Clear in_nonparm_insns here. + (save_parm_insns): Not here. + +2000-03-24 Kaveh R. Ghazi + + * builtins.c (expand_builtin_bzero): New function. + (expand_builtin): Handle bzero. + + * builtins.def: Add BUILT_IN_BZERO. + + * c-common.c (c_common_nodes_and_builtins): Provide builtin + prototype & function for bzero. + +2000-03-23 Michael Meissner + + * config/alpha/alpha.md (TF floating point insns): Undo 2000-03-21 + change adding TARGET_FP to the TF floating point insns, except for + trunctfsf2, which generates direct calls to truncdfsf2. + +2000-03-23 Geoff Keating + + * config/rs6000/rs6000.h (ARG_POINTER_CFA_OFFSET): New definition, + try to protect against middle-end changes that break binary + compatibility. + (DWARF_FRAME_REGISTERS): New definition, likewise for backend. + +2000-03-24 Michael Hayes + + * config/c4x/c4x.md (load_immed_address): Add DP reg clobber. + +Thu Mar 23 17:10:48 2000 Richard Kenner + + * calls.c (expand_call): If TARGET is passed by reference and + is readonly, write a CLOBBER. + +2000-03-23 Kaveh R. Ghazi + + * builtins.c (expand_builtin): Handle bcmp. + + * builtins.def: Add BUILT_IN_BCMP. + + * c-common.c (c_common_nodes_and_builtins): Provide builtin + prototype & function for bcmp. + +Thu Mar 23 11:34:39 2000 Jim Wilson + + * config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC): Move case 6... + (rtx_needs_barrier, case UNSPEC_VOLATILE): to here. + * config/ia64/ia64.md (pr_restore): Change UNSPEC to UNSPEC_VOLATILE. + +Thu Mar 23 16:04:40 2000 Andrew Haley + + * config/mips/mips.md (movdf_internal1a): Delete (set 'f', 'F') + alternative when using -fp64 -gp32. + +2000-03-22 Jason Merrill + + * config/rs6000/rs6000.h (DWARF_FRAME_RETURN_COLUMN): Define. + * config/alpha/alpha.h (DWARF_FRAME_RETURN_COLUMN): Define. + * config/sparc/sparc.h (DWARF_FRAME_RETURN_COLUMN): Define. + + * frame.h (frame_state): Revert last change. + * frame.c (execute_cfa_insn): Just don't record the save of a CFA reg. + * libgcc2.c (throw_helper): Revert last change. + +2000-03-22 Richard Henderson + + * stmt.c (expand_asm_operands): Don't promote the temporary. + +2000-03-22 Theodore Papadopoulo + + * builtin.c (get_pointer_alignment): Use DECL_P and TYPE_P macros. + * c-common.c (decl_attributes,check_format_info,truthvalue_conversion, + c_get_alias_set): Likewise. + * c-decl.c (duplicate_decls): Likewise. + * c-typeck.c (default_conversion,build_unary_op): Likewise. + * calls.c (initialize_argument_information): Likewise. + * dwarf2out.c (decl_class_context,add_abstract_origin_attribute): + Likewise. + * dwarfout.c (decl_class_context,output_type): Likewise. + * expr.c (get_inner_reference): Likewise. + * fold-const.c (simple_operand_p,fold): Likewise. + * function.c (aggregate_value_p): Likewise. + * stmt.c (expand_asm_operands): Likewise. + * varasm.c (named_section): Likewise. + +2000-03-22 Jason Merrill + + Implement dwarf2 exception handling for the ARM. + * config/arm/arm.h (INCOMING_RETURN_ADDR_RTX): Define. + (DWARF_FRAME_RETURN_COLUMN): Define. + * config/arm/arm.c (emit_multi_reg_push): Return rtx. Attach + REG_FRAME_RELATED_EXPR note. + (emit_sfm): Likewise. + (arm_expand_prologue): Set RTX_FRAME_RELATED_P on everything. + * dwarf2out.c (reg_save): Handle saving a register to itself. + (dwarf2out_frame_debug_expr): Handle an intermediate cfa reg. + * except.c (eh_regs): Don't use the static chain reg if it's + callee-saved. + * frame.h (frame_state): Add cfa_saved field. + * frame.c (execute_cfa_insn): Set it. + * libgcc2.c (throw_helper): Don't adjust sp if it's restored in + the epilogue. + * function.c (ARG_POINTER_CFA_OFFSET): Default to FIRST_PARM_OFFSET. + Now takes a parm. + (instantiate_virtual_regs): Adjust. + * tm.texi: Adjust. + * config/m68k/m68k.h (ARG_POINTER_CFA_OFFSET): Don't define. + * config/ns32k/ns32k.h (ARG_POINTER_CFA_OFFSET): Don't define. + * config/sparc/sparc.h (ARG_POINTER_CFA_OFFSET): Take a parm. + + * dwarf2out.c (reg_number): Refer to FIRST_PSEUDO_REGISTER. + (initial_return_save): Use DWARF_FRAME_REGNUM, not reg_number. + +2000-03-22 Kaveh R. Ghazi + + * builtins.def: New file. + + * Makefile.in (TREE_H): Depend on builtins.def. + + * builtins.c (built_in_names): Use builtins.def. + + * tree.h (built_in_function): Likewise. + +2000-03-22 Mark Mitchell + + * tree.c (size_in_bytes): Return size_zero_node, not + integer_zero_node. + +2000-03-22 Geoff Keating + + * config/fp-bit.c (pack_d): Correct the case when a denormal + is rounded up and stops being denormal. + +2000-03-21 Richard Henderson + + * config/alpha/alpha.c (function_arg): Check for void_type_node + before using MUST_PASS_IN_STACK. + +2000-03-21 Stephane Carrez + + * regmove.c (combine_stack_adjustments_for_block): Check that + the stack pointer is a valid memory address. + +Wed Mar 22 11:44:50 MET 2000 Jan Hubicka + + * calls.c: re-install Mar 16 emit_library_call merge. + +2000-03-21 Jakub Jelinek + + * config/sparc/sparc.c (mem_min_alignment): If not optimizing, + we cannot be sure that if reload_completed base register will + be properly aligned. + +2000-03-21 Richard Henderson + + * flow.c (delete_block): Fix typo last change. + +2000-03-21 Mark Mitchell + + * c-common.c (c_expand_expr_stmt): Use COMPLETE_TYPE_OR_VOID_P, + not COMPLETE_TYPE_P, to check the type of the expression. + +2000-03-21 Michael Meissner + + * config/alpha/alpha.md (floating point insns): Add TARGET_FP to + all floating point insns that just tested the macro + TARGET_HAS_XFLOATING_LIBS. + (movsf/movdf recognizers): Add separate insns if -mno-fp-regs is + used to only use the gprs. + +2000-03-21 Nathan Sidwell + + * tree.h (COMPLETE_TYPE_P): New macro. + (COMPLETE_OR_VOID_TYPE_P): New macro. + (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro. + * stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE. + * c-aux-info.c (gen_type): Use them. + * c-common.c (c_expand_expr_stmt): Likewise. + * c-decl.c (poplevel, pushdecl, start_decl, finish_decl, + grokdeclarator, grokparms, finish_struct, start_function, + store_parm_decls, combine_parm_decls): Likewise. + * c-parse.y (cast_expr): Likewise. + * c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn, + c_size_in_bytes, c_alignof, build_component_ref, + build_indirect_ref, build_array_ref, convert_arguments, + build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise. + * calls.c (initialize_argument_information): Likewise. + * convert.c (convert_to_integer): Likewise. + * dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise. + * dwarfout.c (location_or_const_value_attribute, + output_enumeration_type_die, output_structure_type_die, + output_union_type_die, output_type): Likewise. + * expr.c (safe_from_p, expand_expr): Likewise. + * function.c (assign_parms): Likewise. + * sdbout.c (sdbout_symbol, sdbout_one_type): Likewise. + * tree.c (build_array_type, build_function_type, + build_method_type, build_offset_type, build_complex_type): Likewise. + * c-parse.c, c-parse.h: Regenerated. + +2000-03-21 Michael Hayes + + * config/c4x/rtems.h: Include config/rtems.h. + +Tue Mar 21 09:24:00 2000 Denis Chertykov + + * config/avr/avr.c (encode_section_info): sets SYMBOL_REF_FLAG if + decl is a FUNCTION_DECL + +Mon Mar 20 19:53:53 2000 Jim Wilson + + * config/ia64/ia64.c (ia64_expand_prologue): Don't abort if leaf + function uses output registers. Don't save RP for leaf functions. + Do save RP even if no epilogue. + * config/ia64/ia64.h (FIXED_REGISTERS): Unmark in/out registers. + (CALL_USED_REGISTERS): Unmark in registers. + (REG_ALLOC_ORDER): Move out regs up, to near the top. Move in regs up, + to near the middle. + +2000-03-20 Geoff Keating + + * config/rs6000/rs6000.md (bunordered): New expander. + (bordered): New expander. + (buneq): New expander. + (bunge): New expander. + (bungt): New expander. + (bunle): New expander. + (bunlt): New expander. + (bltgt): New expander. + + * config/rs6000/rs6000.c (ccr_bit): Handle unordered comparisons. + (ccr_bit_negated_p): New function. + (print_operand): For %C, generate appropriate cror for UNEQ, + UNLT, UNGT, and LTGT. For %T and %t, use ccr_bit_negated_p. + +2000-03-20 Andreas Jaeger + + * sdbout.c (sdbout_one_type): Add braces to avoid "ambigous else" + warning. + + * tree.h (safe_for_unsave): Prototype. + +2000-03-20 Richard Henderson + + * regmove.c (stack_memref_p): Fix typo, reorg for readability. + (combine_stack_adjustments_for_block): Don't allow sp references + in the side of a set we're not fixing up. + * toplev.c (rest_of_compilation): Run combine_stack_adjustments + after life_analysis. + +2000-03-20 Richard Henderson + + * calls.c (expand_call): Don't bother generating tail call + sequences if there are pending cleanups. Use + expand_start_target_temps/expand_end_target_temps to elide + cleanups created during sibcall expansion. + +2000-03-20 Geoff Keating + + * configure.in: Set $IFS to a value if it doesn't already have one + in the --enable-checking handling. + * configure: Regenerate. + +2000-03-20 Martin v. Löwis + + * c-parse.in (SAVE_WARN_FLAGS): Use size_int. + * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: + Regenerated. + +Mon Mar 20 11:43:15 MET 2000 Jan Hubicka + + * jump.c (delete_noop_moves): Remove code attempting to + combine stack adjustments. + +2000-03-19 Martin v. Löwis + + * emit-rtl.c (push_to_full_sequence, end_full_sequence): New functions. + * except.c (emit_cleanup_handler): Use them. + (expand_end_all_catch): Likewise. + * function.c (fixup_var_refs): Likewise. + (expand_function_end): Clear catch_clauses_last. + * rtl.h (push_to_full_sequence, end_full_sequence): Declare. + * except.h (struct eh_status): New field x_catch_clauses_last. + (catch_clauses_last): New define. + + * Makefile.in (tree.o): Depend on HASHTAB_H. + * tree.c: Include hashtab.h. + (struct type_hash): Remove next field. + (TYPE_HASH_SIZE): Remove. + (TYPE_HASH_INITIAL_SIZE): New define. + (type_hash_table): Change type to htab_t. + (type_hash_eq, type_hash_hash, print_type_hash_statistics, + mark_hash_entry): New functions. + (init_obstacks): Allocate type hash. + (type_hash_lookup): Use htab functions. + (type_hash_add, mark_type_hash): Likewise. + (dump_tree_statistics): Call print_type_hash_statistics. + +2000-03-19 Kaveh R. Ghazi + + * rs6000/t-aix41: New file. + + * configure.in ({rs6000,powerpc}-ibm-aix4.[12]*): Use it. + +Sun Mar 19 13:27:30 2000 Hans-Peter Nilsson + + * tm.texi (Driver): Fix typos and tweak entry for + INCLUDE_DEFAULTS. + Move misplaced STRUCT_FORCE_BLK entry ... + (Storage Layout): ... to here. + (Run-time Target): Recommend having TARGET_MASK_... helper macros. + +2000-03-19 Richard Henderson + + * flow.c (delete_block): Delete the addr_vec along with the block. + (flow_delete_insn): Decrement LABEL_NUSES when deleting insns that + reference labels. + + * fold-const.c (extract_muldiv): Apply type check for defined + overflow to multiply as well as divide. + + * stor-layout.c (layout_decl): Don't abort on any zero sized decl. + +2000-03-18 Mark Mitchell + + * emit-rtl.c (remove_unnecessary_notes): Check that all + NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes have an + associated NOTE_BLOCK. + * function.h (identify_blocks): Update comments. + (reorder_blocks): Declare. + * function.c (identify_blocks): Don't take paramters. + (reorder_blocks): Don't take parameters. + * loop.h (find_loop_tree_blocks): Remove. + (unroll_block_trees): Likewise. + * loop.c (loop_optimize): Don't call find_loop_tree_blocks. Use + reorder_blocks instead of unroll_block_trees.h + * sibcall.c (optimize_sibling_and_tail_recursive_calls): Likewise. + * stmt.c (find_loop_tree_blocks): Remove. + (unroll_block_trees): Likewise. + * toplev.c (rest_of_compilation): Don't call find_loop_tree_blocks + in whole-function mode. + * tree.h (reorder_blocks): Remove declaration. + + * expr.c: Include intl.h. + * Makefile.in (expr.o): Depend on intl.h. + +2000-03-18 Richard Henderson + + * expr.c (emit_move_insn_1): Clarify cannot_inline message. + +2000-03-18 Mark Mitchell + + * tree.h (tree_index): Remove enumerals for integer types. + (integer_type_kind): New type. + (integer_types): New variable. + (char_type_node): Adjust. + (signed_char_type_node): Likewise. + (unsigned_char_type_node): Likewise. + (short_integer_type_node): Likewise. + (short_unsigned_type_node): Likewise. + (integer_type_node): Likewise. + (unsigned_type_node): Likewise. + (long_integer_type_node): Likewise. + (long_unsigned_type_node): Likewise. + (long_long_integer_type_node): Likewise. + (long_long_unsigned_type_node): Likewise. + * tree.c (integer_types): New variable. + (init_obstacks): Register it as a root. + +Sat Mar 18 14:38:00 2000 Jason Eckhardt + + * bb-reorder.c (reorder_basic_blocks): Update PREV_INSN as well as + NEXT_INSN. Update last insn in chain. + +2000-03-17 Jason Merrill + + * dwarf2out.c (dwarf2out_decl): Don't emit anything for types + with TYPE_DECL_SUPPRESS_DEBUG set. + +2000-03-18 Richard Henderson + + * flow.c (make_edges): Use INTVAL to access REG_EH_REGION value. + +2000-03-18 Richard Henderson + + * i386.c (call_insn_operand): Always allow SYMBOL_REF, + care for HALF_PIC_P. + (expander_call_insn_operand): Remove. + (ix86_expand_epilogue): New arg `emit_return' to control return insn. + * i386.h (PREDICATE_CODES): Update. + * i386.md (all call expanders): Remove predicates, remove special + handling for half-pic. + (*call_1, *call_value_1): Handle SIBLING_CALL_P insns. + (*call_pop_pic2, *call_pic2, *call_value_pop_2, *call_value_2): Remove. + (sibcall_epilogue): New. + +2000-03-17 Richard Henderson + + * rtlanal.c (single_set): Reject if the parallel has anything + except SET or USE or CLOBBER. + +2000-03-17 Jeff Law + Richard Henderson + + * Makefile.in (OBJS): Add sibcall.o. + (sibcall.o): New. + * sibcall.c: New file. + * calls.c (FUNCTION_OK_FOR_SIBCALL): Provide default. + (ECF_IS_CONST, ECF_NOTHROW, ECF_SIBCALL): New. + (emit_call_1): Replace `is_const' and `nothrow' with `ecf_flags'. + Emit sibcall patterns when requested. Update all callers. + (expand_call): Generate CALL_PLACEHOLDER insns when tail call + elimination seems feasable. + * final.c (leaf_function_p): Sibling calls don't discount being + a leaf function. + * flow.c (HAVE_sibcall_epilogue): Provide default. + (find_basic_blocks_1): Sibling calls don't throw. + (make_edges): Make edge from sibling call to EXIT. + (propagate_block): Don't remove sibcall_epilogue insns. + * function.c (prologue, epilogue): Turn into varrays. Update all uses. + (sibcall_epilogue): New. + (fixup_var_refs): Scan CALL_PLACEHOLDER sub-sequences. + (identify_blocks_1): Likewise. Break out from ... + (identify_blocks): ... here. + (reorder_blocks_1): Scan CALL_PLACEHOLDER. Break out from ... + (reorder_blocks): ... here. + (init_function_for_compilation): Zap prologue/epilogue as varrays. + (record_insns): Extend a varray instead of mallocing new memory. + (contains): Read a varray not array of ints. + (sibcall_epilogue_contains): New. + (thread_prologue_and_epilogue_insns): Emit and record + sibcall_epilogue patterns. + (init_function_once): Allocate prologue/epilogue varrays. + * genflags.c (gen_insn): Treat sibcall patterns as calls. + * integrate.c (save_parm_insns): Recurse on CALL_PLACEHOLDER patterns. + Broken out from ... + (save_for_inline_nocopy): ... here. + (copy_insn_list): Recurse on CALL_PLACEHOLDER patterns. + Broken out from ... + (expand_inline_function): ... here. + (copy_rtx_and_substitute): Handle NOTE_INSN_DELETED_LABEL. + (subst_constants): Handle 'n' formats. + * jump.c (jump_optimize_minimal): New. + (jump_optimize_1): New arg `minimal'; update callers. Elide most + optimizations if it's set. + * rtl.c (copy_rtx): Do copy jump & call for insns. + * rtl.h (struct rtx_def): Document use of jump and call for insns. + (SIBLING_CALL_P): New. + (sibcall_use_t): New. + * toplev.c (rest_of_compilation): Do init_EXPR_INSN_LIST_cache earlier. + Invoke optimize_sibling_and_tail_recursive_calls. + * tree.c (lang_safe_for_unsave): New. + (safe_for_unsave): New. + * tree.h (lang_safe_for_unsave, safe_for_unsave): Declare. + + * alpha.h (FUNCTION_OK_FOR_SIBCALL): New. + * alpha.md (sibcall, sibcall_value, sibcall_epilogue): New. + (*sibcall_osf_1, *sibcall_value_osf_1): New. + +2000-03-17 Mark Mitchell + + * objc/objc-act.c (encode_method_prototype): Pass types, not + PARM_DECLs, to int_size_in_bytes. + +Fri Mar 17 11:51:34 2000 Jim Wilson + + * config/ia64/ia64.md (mix4right_3op): Swap %1 and %2 in template. + + * config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, + config/ia64/ia64.md, config/ia64/xm-ia64.h: Fix copyrights again. + +Fri Mar 17 08:09:14 2000 Richard Kenner + + * Clean up usages of TREE_INT_CST_LOW. + * c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. + * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: + Regenerated. + * c-tree.h (min_precision): Move declaration to here. + * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. + (build_unary_op, add_pending_init): Use bit_position. + (pending_init_member, process_init_element): Likewise. + (really_start_incremental_init, push_init_level, pop_init_level): + Don't make copies of nodes or modify them in place, use consistent + types when tracking positions, and use tree routines computations. + (set_init_index, output_init_element): Likewise. + (output_pending_init_elements, process_init_element): Likewise. + * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, + tree_low_cst and int_bit_position; also minor cleanup. + (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. + (print_cst_octal): Precision is unsigned. + (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. + * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. + (simple_type_align_in_bits): Result is unsigned int. + Use tree_int_low_cst and host_integerp. + (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. + (field_byte_offset): Result is HOST_WIDE_INT. + Change types of internal variables so alignments are unsigned int, + offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. + Use host_integerp, tree_low_cst, and int_bit_position. + (add_bit_offset_attribute): Likewise. + (add_data_member_location_attribute): Use tree_cst_low. + (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. + (add_bit_size_attribute): Use tree_low_cst. + (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. + * dwarfout.c: Similar changes to dwarf2out.c. + * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. + * genoutput.c (n_occurrences): Return -1 for null string. + (strip_whitespace): Accept null string and make into function. + (scan_operands): Reflect above changes. + * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. + (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. + * ssa.c (rename_registers): Add missing cast of arg to bzero. + * tree.c (int_size_in_bytes): Check for too big to represent. + (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. + * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): + New declarations. + (min_precision): Delete from here. + * varasm.c (decode_addr_const): Use host_integerp, bit_position, + and int_bit_position. + * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. + (encode_method_def): Likewise. + (build_ivar_list_initializer): Use int_bit_position. + (generate_shared_structures): Convert size. + (encode_type, encode_complete_bitfield): Use integer_zerop. + (encode_bitfield): Use tree_low_cst and int_bit_position. + +2000-03-17 Michael Hayes + + * config/c4x/c4x.h (CPP_SPEC): Fix typo. + +2000-03-17 Martin v. Löwis + + * call.c (special_function_p): It is only malloc if it returns + Pmode. + +2000-03-17 Michael Hayes + + * config/c4x/c4x.h (ASM_SPEC, CPP_SPEC, LINK_SPEC): Support C33. + (C33_FLAG, TARGET_C3X): Add macros. + (TARGET_SWITCHES): Add -m33 option. + * config/c4x/c4x.c (c4x_override_options): Test for TARGET_C33. + +2000-03-17 Michael Hayes + + * config/c4x/c4x.h (PARALLEL_INSN_FLAG): Add. + (PARALLEL_PACK_FLAG): Delete. + (TARGET_SWITCHES): Update. + (TARGET_PARALLEL): Use PARALLEL_INSN_FLAG. + +Thu Mar 16 18:52:32 2000 Richard Kenner + + * fold-const.c (fold): Fix a few cases when the returned result + is not of the same type as the input. + +2000-03-16 Nick Clifton + + * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Fix compile time + warning. + +2000-03-16 Kaveh R. Ghazi + + * libgcc2.h: Move prototypes above macros with the same name. + Wrap some function prototypes in the conditional which indicates + whether they are supported, i.e. "BITS_PER_UNIT == 8". + +2000-03-16 Richard Henderson + + * calls.c: Revert last two changes. + +2000-03-16 Bernd Schmidt + + * fp-bit.c (_unpack_d): If NO_DENORMALS is defined, anything that + has exponent 0 is a zero. + + * simplify-rtx.c (hash_rtx, case MEM/REG): Take into account that + HASH may already be nonzero. Add code/mode into hash value + immediately after repeat label. + (cselib_lookup): Don't leave the hash table in an inconsistent + state before a hash lookup operation. + +Thu Mar 16 17:03:10 MET 2000 Jan Hubicka + + * i386.md (all HI and QI mode non-move patterns): Conditionize + by TARGET_[HQ]IMODE_MATH. + * i386.h (x86_himode_math, x86_qimode_math, x86_promote_hi_regs, + x86_promote_qi_regs): Declare. + (TARGET_HIMODE_MATH, TARGET_QIMODE_MATH, TARGET_PROMOTE_HI_REGS, + TARGET_PROMOTE_QI_REGS): New macros. + (PROMOTE_MODE): New macro. + * i386.c (x86_himode_math, x86_qimode_math, x86_promote_hi_regs, + x86_promote_qi_regs): New global variables. + +Thu Mar 16 16:50:44 MET 2000 Jan Hubicka + + * calls.c (emit_library_call_value_1): Break out from ...; handle + VOIDmode function calls too. + (emit_library_call_value): ... here. + (emit_library_call): Implement by calling emit_library_call_value_1. + +Thu Mar 16 16:01:30 MET 2000 Jan Hubicka + + * calls.c (expand_call): Do sanity checking on arg_space_so_far. + Update arg_space_so_far on stack adjustments. + (emit_library_call, emit_library_call_value): Likewise; take into + account arg_space_so_far and pending_stack_adjust when calculcating + the boundary. + +Thu Mar 16 09:02:19 2000 Jason Eckhardt + + * flow.c: Move all basic block reordering code into its own file. + (create_basic_block): Externalize. + * bb-reorder.c: New file. Copy all basic block reordering code from + flow.c to this file. + (reorder_basic_blocks): Fix fencepost error in for-loop. + (reorder_basic_blocks): Remove braces from single statement for-loops. + * basic-block.h: Add declaration for create_basic_block. + * Makefile.in: Add rules for bb-reorder.o. + +2000-03-16 Neil Booth + + * cppinit.c (handle_option): Implement #unassert directive + as -A- command line option. + (print_help): Update. + * cpptexi.c: Update. + +Thu Mar 16 02:14:16 2000 Hans-Peter Nilsson + + * md.texi (Standard Names): Document `jump'. + +2000-03-15 Jason Merrill + + * calls.c (emit_call_1): Nothrow functions can still have nonlocal + gotos. + +2000-03-15 Geoff Keating + + Merge changes from newppc-branch onto trunk. + + 2000-03-15 Geoff Keating + + * rs6000.c (toc_hash_table): Update for new hash table functions. + (toc_hash_function): Likewise. + (toc_hash_eq): Likewise. + (toc_hash_mark_entry): Likewise. + (toc_hash_mark_table): Likewise. + (output_toc): Likewise. + (rs6000_add_gc_roots): Likewise. + + 2000-03-15 Alexandre Oliva + + * t-aix43 (AR_FOR_TARGET): Deleted. Moved `-X32_64'... + (AR_FLAGS_FOR_TARGET): here. New macro. + + 2000-03-05 Clinton Popetz + + * config/rs6000/rs6000.c (rs6000_fpmem_offset, rs6000_fpmem_size, + fpmem_operand) Delete. + (xer_operand) New. + (rs6000_reg_names, alt_reg_names): Change fpmem to xer. + (machine_function): Remove fpmem_size, fpmem_offset, save_toc_p. + (rs6000_save_machine_status, rs6000_restore_machine_status, + rs6000_init_expanders, rs6000_stack_info, debug_stack_info): Remove + references to above variables. + (gpc_reg_operand): Use XER_REGNO_P instead of FPMEM_REGNO_P. + * config/rs6000/rs6000.h (REG_ALLOC_ORDER, REGISTER_NAMES, + DEBUG_REGISTER_NAMES): Chagne fpmem to xer. + (FPMEM_REGNO_P, FPMEM_REGNUM): Delete. + (XER_REGNO_P, XER_REGNO): New. + (rs6000_stack): Remove fpmem_p, fpmem_offset, fpmem_size. + (PREDICATE_CODES): Change fpmem_operand to xer_operand. + (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK): Change FPMEM_REGNO_P to + XER_REGNO_P. + (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS, + REG_CLASS_FROM_LETTER, CLASS_MAX_NREGS): Change FPMEM_REGS to XER_REGS, and remove FLOAT_OR_FPMEM_REGS. + (CLASS_CANNOT_CHANGE_SIZE): Change to FLOAT_REGS. + + 2000-02-29 Franz Sirl + + * aix.h (FP_SAVE_INLINE, ASM_OUTPUT_INTERNAL_LABEL_PREFIX, + TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Move here... + * rs6000.h: from here. + + * rs6000-protos.h (rs6000_select_section): Provide prototype. + (rs6000_select_rtx_section): Likewise. + (rs6000_encode_section_info): Likewise. + (sdata_section): Likewise. + (sdata2_section): Likewise. + (sbss_section): Likewise. + * sysv4.h (rs6000_select_section): Delete prototype. + (rs6000_select_rtx_section): Likewise. + (rs6000_encode_section_info): Likewise. + (sdata_section): Likewise. + (sdata2_section): Likewise. + (sbss_section): Likewise. + (REG_SAVE_AREA): Delete definition duplicated in rs6000.h. + + * sysv4.h: Delete various unnecessary #undef's and put a comment + on the remaining ones. + Change various comments according to coding standard. + + 2000-02-29 Clinton Popetz + + * config/rs6000/rs6000.h (MQ_REGNO, CR0_REGNO, CR1_REGNO, CR2_REGNO, + CR3_REGNO, CR4_REGNO, MAX_CR_REGNO): Define. + (CR0_REGNO_P) Remove. + * config/rs6000/rs6000.c (gpc_reg_operand, and64_operand, and_operand, + setup_incoming_varargs, mtcrf_operation, print_operand, + rs6000_stack_info, rs6000_emit_prologue, rs6000_emit_epilogue): + Use the above macros. + + 2000-02-24 Clinton Popetz + + * config/rs6000/rs6000.md: Added a new alternative for each + pattern that had a 'x' alternative but no 'y' alternative. + Added a new split for each of the above patterns. + + 2000-02-18 Geoff Keating + + * aix41.h (ASM_CPU_SPEC): Delete. + (CPP_CPU_SPEC): Delete. + + * aix.h (RS6000_OUTPUT_BASENAME): Define. + (ASM_OUTPUT_LABEL): Define. + (ASM_GLOBALIZE_LABEL): Define. + (STRIP_NAME_ENCODING): Define. + * rs6000.h (RS6000_OUTPUT_BASENAME): Don't define. + (STRIP_NAME_ENCODING): Don't define. + (ASM_OUTPUT_LABEL): Don't define. + (ASM_GLOBALIZE_LABEL): Don't define. + * sysv4.h (ASM_DECLARE_FUNCTION_NAME): Use assemble_name to output + names, and ASM_OUTPUT_LABEL to output labels, rather than + asm_fprintf. + (ASM_OUTPUT_LABEL): Define. + (ASM_OUTPUT_INT): Use assemble_name. + (ASM_OUTPUT_DWARF_ADDR): Use assemble_name. + (STRIP_NAME_ENCODING): Don't undefine first. + (RS6000_OUTPUT_BASENAME): Make equivalent to assemble_name for + ELF. + (ASM_OUTPUT_LABELREF): Don't prepend underscores to labels + specified with 'asm' even with -fleading-underscore. + * rs6000.c (print_operand): Use assemble_name when !TARGET_AIX. + (output_epilog): Likewise. + (output_toc): Likewise. + * tramp.asm: Handle -fleading-underscore correctly. + + * rs6000.md (builtin_setjmp_receiver): Also run for -fPIC and + -mminimal-toc. + (nonlocal_goto_receiver): Delete. + * rs6000.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Delete. + + * rs6000.h (ASM_OUTPUT_DEF): Don't define. + (SET_ASM_OP): Define. + * sysv4.h (ASM_OUTPUT_DEF): Don't undefine. + + * rs6000.h (ASM_OUTPUT_ADDR_VEC_ELT): Don't define. + (ASM_LONG): Define. + + * rs6000.c (rs6000_dll_import_ref): Delete, not used. + * rs6000-protos.h (rs6000_dll_import_ref): Delete. + + * rs6000.h: Add 'u' to more constants. + + 2000-02-18 David Edelsohn + + * rs6000.md (mfcr+shift): Delete PowerPC64 version. + + 2000-02-15 David Edelsohn + + * rs6000.c (reg_or_u_cint_operand): New function. + (logical_operand): Handle 64-bit hosts. + (logical_u_operand): New function. + (non_logical_cint_operand): Handle 64-bit hosts. + (non_logical_u_cint_operand): New function. + * rs6000.h (DATA_SECTION_ASM_OP): Add tab. + (PREDICATE_CODES): Define new functions. + * rs6000-protos.h: Declare new functions. + * rs6000.md (iordi3, xordi3): Constant int must be unsigned 32-bits. + (movdi_64): Bracket code intended for 64-bit hosts. Create + CONST_DOUBLE for 32-bit values. + (scc insns): Generate DImode compares. + (mfcr insns): Create DImode versions. + (sge matchers): New patterns. + + 2000-02-15 Gabriel Paubert + + * rs6000.md: Correct instructions length attributes and + constraints on unsigned compare instructions. + (*ne0): Disable for PowerPC64. + + 2000-02-11 Geoff Keating + + * rs6000.c (output_function_profiler): Use .long for a 32-bit + quantity, fix profile1.C test failure under -fPIC. + + * rs6000.c: Add 'u' to many constants to suppress warnings. + (constant_pool_expr_1): Make static. + (rs6000_emit_eh_toc_restore): Remove unused 'r2'. + * rs6000.h: Add 'u' to many constants to suppress warnings. + + * rs6000.c (rs6000_emit_load_toc_table): Use LCTOC..1 under AIX + for the start of the TOC, instead of LCTOC..0. + * aix.h (toc_section): Use LCTOC..1 under AIX for the start + of the TOC. + * rs6000.md (load_toc_aix_si): Use LCTOC..1. + (load_toc_aix_di): Use LCTOC..1. + + * rs6000.h (LEGITIMIZE_ADDRESS): Turn into a function. + * rs6000.c (rs6000_legitimize_address): New function from + LEGITIMIZE_ADDRESS. Only use create_TOC_reference on + symbols in the constant pool that really are TOC references. + (print_operand_address): For ELF, write TOC offsets under + -fPIC as subtractions in the insn. + (output_toc): For ELF, define symbols in TOC as normal labels, + to match RTL. + (create_TOC_reference): Use gen_rtx_PLUS rather than gen_rtx. + * rs6000-protos.h (rs6000_legitimize_address): Prototype. + (create_TOC_reference): Prototype only when RTX_CODE is defined. + * rs6000.md (movsi): Only use create_TOC_reference on + symbols in the constant pool that really are TOC references. + + * rs6000.h (MACHINE_DEPENDENT_REORG): Don't define. + * rs6000.c (rs6000_reorg): Delete. + * rs6000-protos.h (rs6000_reorg): Delete. + + 2000-02-09 Geoff Keating + + * rs6000.h (INCOMING_RETURN_ADDR_RTX): New macro. + + * aix.h (SETUP_FRAME_ADDRESSES): Define. + * rs6000.c [TARGET_AIX] (insn_after_throw): New static variable. + [TARGET_AIX] (rs6000_aix_emit_builtin_unwind_init): New function. + [TARGET_AIX] (rs6000_emit_eh_toc_restore): New function. + * rs6000-protos.h: Prototype rs6000_emit_eh_toc_restore, + rs6000_aix_emit_builtin_unwind_init. + * rs6000.md (eh_epilogue) [TARGET_AIX]: Call + rs6000_emit_eh_toc_restore on AIX. + (return_eh_si): Use r2. + (return_eh_di): Use r2. + + * aix43.h: Turn on HAS_INIT_SECTION and LD_INIT_SWITCH, + since we're breaking binary compatibility anyway. + + 2000-02-09 Clinton Popetz + + * config/rs6000/rs6000-protos.h: (get_TOC_alias_set, uses_TOC, + constant_pool_expr_p): Declare them. + (constant_pool_expr_p): Declare it. + * config/rs6000/rs6000.c (toc_label_name): Define. + (rs6000_override_options): Set toc_label_name. + (input_operand): Allow any TOC_RELATIVE_EXPR_P. + (get_TOC_alias_set, constant_pool_expr_p, constant_pool_expr_1, + uses_TOC): New functions. + (print_operand): Delete old '*' case. + (print_operand_address): Use LEGITIMATE_CONSTANT_POOL_ADDRESS_P, + and strip off rtl for TOC before calling output_addr_const. + (rs6000_emit_load_toc_table): Use toc_label_name. + * config/rs6000/rs6000.h (TARGET_SWITCHES): Make msched-prolog + the default. + (LEGITIMATE_CONSTANT_POOL_BASE_P): Delete. + (CONSTANT_POOL_EXPR_P, TOC_RELATIVE_EXPR_P): New macros. + (LEGITIMATE_CONSTANT_POOL_ADDRESS_P): Use CONSTANT_POOL_EXPR_P. + (LEGITIMIZE_ADDRESS, LEGITIMIZE_RELOAD_ADDRESS): Turn symbol_refs + into explicit TOC_REGISTER offsets. + (TOC_REGISTER): New macro. + * config/rs6000/rs6000.md (movsi, movdi): Emit rtl under + TARGET_TOC to reference TOC_REGISTER. + (load_toc_v4_PIC_1b): Add 4 to offset for toc reload. + * config/rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Call + uses_TOC before emitting label references. + + 2000-02-05 Geoff Keating + + * rs6000.md (stack_tie): Fix warning. + + * eabi-ctors.c: Use 'asm' names for the start/end variables, + to handle -fleading-underscore. + * sysv4.h (ASM_DECLARE_FUNCTION_NAME): Use asm_fprintf and %U. + (USER_LABEL_PREFIX): New macro. + (ASM_OUTPUT_INTERNAL_LABEL_PREFIX): Use asm_fprintf and %L. + (ASM_OUTPUT_LABELREF): Use asm_fprintf and %U. + * t-ppccomm (MULTILIB_MATCHES_SYSV): Note that call-sysv and + call-linux can use the same multilibs. + * t-ppcgas (MULTILIB_OPTIONS): Don't need to have separate call-sysv + and call-linux multilibs. Do multilib with -fleading-underscore. + (MULTILIB_DIRNAMES): Follow MULTILIB_OPTIONS change. + (MULTILIB_EXCEPTIONS): Remove call-linux exceptions. Add restrictions + to call-aix. + + * sysv4.h (CPP_SYSV_SPEC): Define _SOFT_FLOAT for all those CPUs that + have MASK_SOFT_FLOAT set. + (CPP_FLOAT_DEFAULT_SPEC): New macro. + (SUBTARGET_EXTRA_SPECS): Set `cpp_float_default' to the value of + CPP_FLOAT_DEFAULT_SPEC. + + * rs6000.c (ccr_bit): Add some consistency checks and a variable 'reg'. + * rs6000.md: Whitespace change. + * sysv4.h (LINK_TARGET_SPEC): Whitespace change. + * sysv4le.h (LINK_TARGET_SPEC): Whitespace change. + + 2000-02-05 Geoff Keating + + * rs6000.md (eh_epilogue): New expander. + (eh_reg_restore): New expand/split/insn combination. + (return_eh_si): New insn. + (return_eh_di): New insn. + + * eabi-ci.asm: Put a label at the start of the .eh_frame section. + * eabi-cn.asm: Put a zero at the end of the .eh_frame section. + * eabi-ctors.c (__do_global_ctors): Register this object's + frame. Clean up. Call atexit() after the constructors. + (__do_global_dtors): Deregister this object's frame. Clean up. + Allow for recursive calls to exit(). + * rs6000.c (fixuplabelno): New variable. + * sysv4.h (ASM_OUTPUT_INT): Don't do .fixup if not + TARGET_RELOCATABLE, it slows down exec() under linux. + (ASM_OUTPUT_DWARF_ADDR): Do .fixup if TARGET_RELOCATABLE. + + * aix.h (ASM_OUTPUT_DWARF_ADDR_VAR): New macro. + (ASM_OUTPUT_DWARF_DELTA_VAR): New macro. + (ASM_OUTPUT_DWARF_DELTA2): New macro. + (ASM_OUTPUT_DWARF_DELTA4): New macro. + (ASM_OUTPUT_DWARF_ADDR_DELTA): New macro. + (ASM_OUTPUT_DWARF_ADDR): New macro. + (ASM_OUTPUT_DWARF_DATA4): New macro. + (ASM_OUTPUT_DWARF_DATA2): New macro. + (ASM_OUTPUT_DWARF_OFFSET4): New macro. + (ASM_OUTPUT_DWARF_OFFSET): New macro. + (UNALIGNED_INT_ASM_OP): New macro, fake definition. + + 2000-02-03 Geoff Keating + + * rs6000.c (rs6000_sr_alias_set): New variable. + (rs6000_override_options): Initialize rs6000_sr_alias_set. + (rs6000_emit_stack_tie): New function. + (rs6000_emit_allocate_stack): Specify RTX_FRAME_RELATED_P + in a way that dwarf2out can understand. + (rs6000_frame_related): New function. + (rs6000_emit_prologue): Use rs6000_sr_alias_set. Specify + RTX_FRAME_RELATED_P in a way that dwarf2out can understand. + Use rs6000_emit_stack_tie when needed. + (rs6000_emit_epilogue): Use rs6000_sr_alias_set. Don't set + RTX_FRAME_RELATED_P. Use rs6000_emit_stack_tie when needed. + * rs6000.md (stack_tie): New insn. + (return_internal_si): Allow return value to be in the count + register. + (return_internal_di): Likewise. + + * rs6000.c (output_mi_thunk): Remove unused variable `sp'. + + 2000-02-03 Geoff Keating + + * sysv4.h (LOCAL_LABEL_PREFIX): Define, for the use of dbxelf.h. + + 2000-01-31 Geoff Keating + + * rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): New macro. + + * rs6000.md (stmw): Use the right POWER opcode. + (lmw): Likewise. + + 2000-01-31 Kaveh R. Ghazi + + * rs6000-protos.h: New file. + + * rs6000.c: Include tm_p.h. Fix compile time warnings. + + * rs6000.h: Move prototypes to rs6000-protos.h. Fix compile time + warnings. + + * sysv4.h: Likewise. + + 2000-01-28 Geoff Keating + + * ../../configure.in: Delete powerpcle-*-winnt* + and powerpcle-*-pe|powerpcle-*-cygwin*. + * ../../configure: Regenerated. + * cygwin.h: Delete. + * rs6000.h (OBJECT_WINDOWS_NT): Delete. + (TARGET_WINDOWS_NT): Delete. + (ABI_NT): Delete. + (CALL_NT_DLLIMPORT): Delete. + Delete NT-specific code. + * rs6000.md, rs6000.c, sysv4.h: Delete NT-specific code. + * win-nt.h: Delete. + * t-winnt: Delete. + * nt-ci.asm: Delete. + * nt-cn.asm: Delete. + * ntstack.asm: Delete. + + 2000-01-27 Franz Sirl + + * rs6000.h (SELECT_RTX_SECTION): Move to aix.h. + (ASM_FILE_START): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (ASM_OUTPUT_LABELREF): Likewise. + (ASM_OUTPUT_SKIP): Likewise. + (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_CASE_LABEL): Likewise. + (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + (ASM_OUTPUT_ASCII): Likewise. + + 2000-01-27 Clinton Popetz + + * rs6000.c (rs6000_emit_load_toc_table): Use "LCG" and + reload_toc_labelno for non-prologue TOC reloads. Also, don't + increment rs6000_pic_labelno here. + (rs6000_emit_prologue): Pass TRUE to rs6000_emit_load_toc_table, + and increment rs6000_pic_labelno here. + + 2000-01-24 Geoffrey Keating + + * rs6000.md (fctiwz): Use (set (reg) (unspec:DI [(fix:SI ...)])) + rather than (set (subreg:SI (reg)) (fix:SI ...)) so that register + allocation knows (reg) is dead before the insn. + + 2000-01-21 Geoff Keating + + * rs6000.md (movsi_to_cr): Correct typo in output template. + + 2000-01-19 Geoffrey Keating + + * rs6000.c (rs6000_pic_labelno): Always define. + (rs6000_pic_func_labelno): Delete. + (lmw_operation): Check for a zero base register, + which doesn't mean what we want. + (stmw_operation): New function. + (print_operand): Define new 'l' modifier. + (rs6000_stack_info): We must save all 64 bits of the registers + if TARGET_POWERPC64. + (rs6000_output_load_toc_table): Delete. + (rs6000_emit_load_toc_table): New function. + (rs6000_allocate_stack_space): Delete. + (rs6000_emit_allocate_stack): New function. + (rs6000_emit_prologue): New function. + (output_prolog): Use rs6000_emit_prologue. + (rs6000_emit_epilogue): Change a few variable names to be + more accurate. Restore all 64 bits of the registers if + TARGET_POWERPC64. Only restore the FP registers which were used + if they are being saved/restored one-at-a-time. + (output_mi_thunk): Delete inefficient code generation. + (output_function_profiler): Don't use rs6000_output_load_toc_table. + * rs6000.h: Declare rs6000_emit_load_toc_table, + rs6000_allocate_stack_space, stmw_operation. Don't declare + rs6000_output_load_toc_table. + * rs6000.md (elf_high): Allow register 0, but discourage it + heavily. + (elf_low): Support loading into register 0. + (load_toc_aix_si): New pattern. + (load_toc_aix_di): New pattern. + (load_toc_v4_pic_si): New pattern. + (load_toc_v4_pic_di): New pattern. + (load_toc_v4_PIC_1): New pattern. + (load_toc_v4_PIC_1b): New pattern. + (load_toc_v4_PIC_2): New pattern. + (builtin_setjmp_receiver): Use rs6000_emit_load_toc_table. + (nonlocal_goto_receiver): Use rs6000_emit_load_toc_table. + (prologue): New expander. + (movesi_from_cr): New pattern. + (stmw): New pattern. + (save_fpregs_si): New pattern. + (save_fpregs_di): New pattern. + + 2000-01-19 Geoff Keating + + * rs6000.md (movsi): Don't use force_reg when no_new_pseudos. + (movdi): Likewise. + (movhi): Likewise. + (movqi): Likewise. + + 2000-01-19 Geoff Keating + + * rs6000.md (movsi_got): 'unspec 8' returns a SImode result, + at present. + (movsi_got_internal): Likewise. + (movsi_got_internal+1): Likewise. + (set_sp): 'unspec 7' does a SImode clobber. + + 2000-01-19 Geoff Keating + + * rs6000.md (floatsidf2): Don't use the fpmem "register", just + allocate a stack temporary. + (floatsidf2_internal): Likewise. + (floatsidf2_internal+1): Likewise. Don't do bizzare hacks + with unspec. + (floatunssidf2): Don't use the fpmem "register", just + allocate a stack temporary. + (floatunssidf2_internal): Likewise. + (floatunssidf2_internal+1): Likewise. Don't do bizzare hacks + with unspec. + (floatsidf2_loadaddr): Delete. + (floatsidf2_store1): Delete. + (floatsidf2_store2): Delete. + (floatsidf2_load): Delete. + (fix_truncdfsi2): Don't use the fpmem "register", just + allocate a stack temporary. + (fix_truncdfsi2_internal_si): Delete. + (fix_truncdfsi2_internal_di): Delete. + (fix_truncdfsi2_internal): New insn. + (fix_truncdfsi2_internal+1): Don't use the fpmem "register". + (fix_truncdfsi2_store): Delete. + (fix_truncdfsi2_load): Delete. + (fctiwz): Produce gen_fctiwz. + + 2000-01-19 Geoffrey Keating + + * eabi.h (INVOKE__main): Define. + * rs6000.c (rs6000_stack_info): Don't handle call to NAME__MAIN + specially. + (rs6000_emit_prologue): Likewise. + * rs6000.h (struct rs6000_stack): Don't keep track of whether + this is the main program. + + 2000-01-19 Geoff Keating + + * rs6000.c (rs6000_va_arg): Delete some unused variables. + + 2000-01-19 Geoff Keating + + * rs6000.c (rs6000_va_arg): On AIX, padding for small arguments + goes after the argument. + + 2000-01-12 Geoff Keating + + * rs6000.md: Document 'unspec' values used. + (epilogue): New expander. + (movesi_to_cr_one): New expander. + (movesi_to_cr and following): New pattern. + (lmw): New pattern. + (return_internal_si): New pattern. + (return_internal_di): New pattern. + (return_and_restore_fpregs_si): New pattern. + (return_and_restore_fpregs_di): New pattern. + * rs6000.h: Declare new functions. + * rs6000.c (rs6000_stack_info): Use current_function_is_leaf + rather than rs6000_calls_p. + (rs6000_makes_calls): Delete. + (lmw_operation): New function. + (mtcrf_operation): New function. + (rs6000_emit_epilogue): New function. + (output_epilog): Call rs6000_emit_epilogue and final if + !TARGET_SCHED_PROLOG, instead of writing text unconditionally. + + 2000-01-12 Geoff Keating + + * aix43.h (SUBSUBTARGET_SWITCHES): Document switches. + * aix41.h (SUBSUBTARGET_SWITCHES): Document switches. + * aix.h (SUBTARGET_SWITCHES): Document switches. + * rs6000.h: (TARGET_SWITCHES): Don't print options twice. Make + sched-prolog and sched-epilog the same. Document all the + switches. + (TARGET_OPTIONS): No longer allow -mdebug-. + + 2000-01-12 Geoff Keating + + * rs6000.h (ASM_FILE_END): Move to aix.h. + (EXTRA_SECTIONS): Move to aix.h. + (READONLY_DATA_SECTION): Move to aix.h. + (EXTRA_SECTION_FUNCTIONS): Move to aix.h. + (SELECT_SECTION): Move to aix.h. + (JUMP_TABLES_IN_TEXT_SECTION): Move to aix.h. + (INT_REGNO_P): Use symbolic name for ARG_POINTER_REGNUM. + (LINK_REGISTER_REGNUM): New definition. + (RETURN_ADDR_RTX): Use symbolic name for LINK_REGISTER_REGNUM. + (SLOW_UNALIGNED_ACCESS): Define in a way suitable for both + AIX and SVR4. + * sysv4.h: Delete the code between the inclusion of rs6000.h + and svr4.h. + (DWARF_DEBUGGING_INFO): Don't define, it's defined in elfos.h. + (FP_ARG_MAX_REG): Move generic definition to rs6000.h. + (RS6000_REG_SAVE): Move generic definition to rs6000.h. + (RS6000_SAVE_AREA): Move generic definition to rs6000.h. + * rs6000.md (floatsidf2_loadaddr): The first arg here is Pmode. + (fix_truncdfsi2_internal): Rename to fix_truncdfsi2_internal_si. + (fix_truncdfsi2_internal_di): New pattern. + (fix_truncdfsi2_store): The second arg here is Pmode too. + (fix_truncdfsi2_load): The second arg here is Pmode too. + (tablejumpdi): Now that switch tables hold only SImode values, + gcc needs to know how to add them to the pc which is DImode. + * rs6000.c (rs6000_stack_info): Use symbolic name for + LINK_REGISTER_REGNUM. + (output_mi_thunk) [!TARGET_ELF]: Don't define sp, it's not used. + (output_toc): Delete unused variables s1 and s2. + (output_ascii): Use fputs not fprintf on a variable string. + + 2000-01-07 David Edelsohn + + * rs6000.c (processor_target_table): Add power3 as alias for 630. + * aix43.h: Revert Aug 2 change. + (HAS_INIT_SECTION): Define, not visible yet. + (LD_INIT_SWITCH): Define, not visible yet. + * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change. + + 2000-01-04 Joel Sherrill (joel@OARcorp.com> + + * config/rs6000/rtems.h: Include config/rtems.h. + + 2000-01-04 David Edelsohn + + * rs6000.h (HANDLE_PRAGMA_PACK): Define. + (SLOW_UNALIGNED_ACCESS): Define. + (CASE_VECTOR_MODE): Always use 32-bit offsets. + (ASM_FILE_END): Generate 64-bit symbol in 64-bit mode. + (EXTRA_SECTOIN_FUNCTIONS): Indent .csect pseudo-op. + (toc_section): Likewise and .toc pseudo-op. + (ASM_DECLARE_FUNCTION): Likewise. Align text more strictly in + 64-bit mode. + (TEXT_SECTION_ASM_OP): Likewise. + (ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use + 32-bit offsets. + + 1999-12-17 Jakub Jelinek + + * config/rs6000/rs6000.h (TARGET_POWERPC64): Make sure + UNITS_PER_WORD and BITS_PER_WORD are compile time constants when + compiling libgcc2. + + 2000-01-06 Franz Sirl + + * rs6000.h: Move more stuff from here... + * aix.h: to here. + * sysv4.h: Cleanup accordingly. + * netware.h: Likewise + + 2000-01-05 Franz Sirl + + * rs6000.h: Continue cleanup. + * aix.h: Likewise. + * lynx.h: Likewise. + * netware.h: Likewise. + * sol2.h: Likewise. + * sysv4.h: Likewise. + * win-nt.h: Likewise. + + * rs6000.h (TARGET_SWITCHES): Add descriptions. + (TARGET_OPTIONS): Likewise. + + * sysv4.h (SUBTARGET_SWITCHES): Add descriptions. + (SUBTARGET_OPTIONS): Likewise. + + * rs6000.md: Fix compile time warnings. + + 2000-01-04 Geoff Keating + + vxworks patches from the Cygnus tree originally by + Michael Meissner and Vladimir Makarov + . + * sysv4.h (SUBTARGET_SWITCHES): Add vxworks. + (ENDFILE_SPEC): Likewise. + (LIB_VXWORKS_SPEC): New macro. + (STARTFILE_VXWORKS_SPEC): New macro. + (ENDFILE_VXWORKS_SPEC): New macro. + (LINK_START_VXWORKS_SPEC): New macro. + (LINK_OS_VXWORKS_SPEC): New macro. + (CPP_OS_VXWORKS_SPEC): New macro. + (SUBTARGET_EXTRA_SPECS): Add all the vxworks specs. + * vxppc.h: Rewrite to use proper configuration method. + * vxppcle.h: New file. + * ../../configure.in: Add powerpcle-wrs-vxworks*. + * ../../configure: Rebuilt. + + 2000-01-04 Geoff Keating + + Lots of changes to rs6000.h, sysv4.h, aix.h, + aix31.h, aix3newas.h, aix41.h, aix43.h, beos.h, + with the aim that rs6000.h is the first header + included and the others override it. + * aix.h: New file. + + * x-aix41-gld: Remove. + * x-aix43: Remove. + * x-aix41: Remove target-specific switches, and don't specify + -Wl,-bbigtoc as we don't need it any more. + * ../../configure.in: Use x-aix41 for ppc AIX 4.1 and above. + Use t-aix43 for AIX 4.3 and above. + * ../../configure: Regenerated. + + * rs6000.h (TARGET_SWITCHES): Add some initial prolog-scheduling + options, that don't do anything yet. + (MASK_SCHED_PROLOG): New macro. + (MASK_SCHED_EPILOG): New macro. + (TARGET_SCHED_PROLOG): New macro. + (TARGET_SCHED_EPILOG): New macro. + + 2000-01-04 Geoff Keating + + * rs6000.c: Correct comment, the `minimal' TOCs are actually + one per translation unit, not one per function. + (output_toc): Also do duplicate constant elimination + for per-translation-unit TOCs. + + * rs6000.md (nonlocal_goto_receiver): Put it back as before. Add + a comment explaining _exactly_ when this pattern gets used. + (builtin_setjmp_receiver): New pattern for better clarity. + (init_v4_pic): Move it into a section dealing with TOC registers. + + 1999-12-30 Geoff Keating + + * rs6000.c (toc_hash_table): New variable. + (rs6000_hash_constant): New function. + (toc_hash_function): New function. + (toc_hash_eq): New function. + (toc_hash_mark_entry): New function. + (toc_hash_mark_table): New function. + (output_toc): Don't output duplicate TOC entries in + a single file. + (rs6000_add_gc_roots): Add the hash table as a GC root. + * t-aix43: Move AR_FOR_TARGET and CLIB here from x-aix43, + where they clearly shouldn't be. This may need to be fixed + later when there is a GNU ar for AIX. + * x-aix43: Don't define CLIB or AR_FOR_TARGET. + Don't define BOOT_LDFLAGS as it is now not necessary. + + 1999-12-29 Geoff Keating + + * rs6000.c (rs6000_build_va_list): Use 'char *' rather than 'void *' + for va_list on AIX. Use unsigned_char_type_node rather than + constructing our own version on svr4. + + 1999-12-17 Geoff Keating + + * tramp.asm (__trampoline_size): Delete CYGNUS LOCAL comment, + since patently it's not. + + 1999-12-08 Geoff Keating + + * config/rs6000/rs6000.md (nonlocal_goto_receiver): Turn into + define_expand/define_insn pair, and handle restore of the + SVR4 -fpic register. + +Wed Mar 15 15:43:38 2000 Jeffrey A Law (law@cygnus.com) + + * acconfig.h (HAVE_GAS_WEAK): New define. + * configure.in (assembler weak support): Check for .weak support. + * config.in, configure: Rebuilt. + * pa/som.h (MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): Only define if + HAVE_GAS_WEAK is defined. + +2000-03-15 Nick Clifton + + * config/arm/arm.c (arm_output_epilogue): Do not pass %c to + asm_fprintf(). + +2000-03-15 Zack Weinberg + + * cppfiles.c (open_include_file): New function. + (find_include_file, cpp_read_file): Use it. + +2000-03-15 Jason Merrill + + * cpphash.c (dump_hash_helper): Take the slot, not the element. + +Wed Mar 15 14:28:54 2000 Jason Eckhardt + + * flow.c (verify_flow_info): Check for unconditional return. + +Wed Mar 15 11:34:27 2000 Jim Wilson + + * config/ia64/ia64.md (restore_stack_nonlocal): New. + * config/ia64/lib1funcs.asm (__ia64_nonlocal_goto): Delete padding nop. + (__ia64_restore_stack_nonlocal): New. + * config/ia64/t-ia64 (LIB1ASMFUNCS): Add __restore_stack_nonlocal. + +2000-03-15 Alexandre Oliva + + * cpphash.c (collect_formal_parameters): Do not complain about + parameter names that just start with `__VA_ARGS__'. + +Wed Mar 15 13:26:58 MET 2000 Jan Hubicka + + * i386.md (movhi_1): Promote movw imm, reg to movl imm, reg and + movw reg, reg to movzwl reg, reg on PARTIAL_REGISTER_STALL machines. + * i386.c (pentiumpro_cost): Set mul cost to 4. + (x86_use_movx): Set for PPro. + +Wed Mar 15 13:07:05 MET 2000 Jan Hubicka + + * i386.md (ix86_compute_frame_size): stack_alignment_needed is + STACK_BOUNDARY for empty frames now. + +2000-03-14 Mark Mitchell + + * stor-layout.c (layout_union): Remove. + (layout_union_field): New function, split out from layout_union. + (finish_union_layout): Likewise. + (layout_field): Handle unions by calling layout_union_field. + (finish_record_layout): Handle unions. + (layout_type): Combine RECORD_TYPE, UNION_TYPE, and + QUAL_UNION_TYPE handling. + +Wed Feb 23 13:00:06 CET 2000 Jan Hubicka + + * flow.c (fixup_reorder_chain): Avoid double labels in the basic block; + end of basic block is jump_insn, not barrier; use create_basic_block + instead of creating basic block by hand. + +2000-03-14 Jason Eckhardt + + * flow.c (reorder_basic_blocks): Account for barriers when writing + over NEXT_INSN (last_bb->end). + (verify_flow_info): Add check for missing barriers. + +2000-03-14 Greg McGary + + * c-lex.h (enum rid): Add RID_BOUNDED & RID_UNBOUNDED. + * c-lex.c (init_lex): Handle RID_BOUNDED & RID_UNBOUNDED. + * c-parse.gperf (__bounded, __bounded__, __ptrbase, __ptrbase__, + __ptrextent, __ptrextent__, __ptrvalue, __ptrvalue__, + __unbounded, __unbounded__): New keywords. + * c-parse.in (PTR_VALUE PTR_BASE PTR_EXTENT): New tokens. + * c-parse.y, c-parse.c, c-parse.h: Regenerate. + * objc/objc-parse.y, objc/objc-parse.c: Regenerate. + +2000-03-14 Bernd Schmidt + + * cselib.h: New file. + * alias.c: Include "cselib.h". + (fixed_scalar_and_varying_struct_p): Accept the addresses of the + MEMs as two new arguments. + (get_addr): New static function. + (find_base_term): Handle VALUEs. + (memrefs_conflict_p): Likewise. + (true_dependence): Call get_addr on the addresses. + Call fixed_scalar_and_varying_struct_p with addresses that have been + passed through get_addr and canon_rtx. + (write_dependence_p): Move DIFFERENT_ALIAS_SETS_P test for consistency + with true_dependence. + Call get_addr on the addresses; don't call canon_rtx on the MEMs. + * loop.c: Include "cselib.h". + (load_mems): Process extended basic block that enters the loop with + cselib. Use that information to change initialization of the shadow + register so that a constant equivalence is seen by later passes. + * reload1.c: Include "cselib.h". + (reload_cse_invalidate_regno): Delete function. + (reload_cse_mem_conflict_p): Likewise. + (reload_cse_invalidate_mem): Likewise. + (reload_cse_invalidate_rtx): Likewise. + (reload_cse_regno_equal_p): Likewise. + (reload_cse_check_clobber): Likewise. + (reload_cse_record_set): Likewise. + (reg_values): Delete static variable. + (invalidate_regno_rtx): Likewise. + (reload_cse_delete_noop_set): New static function. + (reload_cse_simplify): New static function, broken out of + reload_cse_regs_1. + (reload_cse_noop_set_p): Delete unused argument INSN. + Just call rtx_equal_for_cselib_p on set source and destination. + (reload_cse_regs_1): Break out some code into reload_cse_simplify and + reload_cse_delete_noop_set. Delete code to keep track of values; use + cselib functions instead. Delete code to push/pop obstacks. + (reload_cse_simplify_set): Use cselib to find equivalent values. + Delete code to push/pop obstacks. + (reload_cse_simplify_operands): Likewise. + * rtl.def (VALUE): New rtx code. + * rtl.h (union rtunion_def): New elt rt_cselib. + (X0CSELIB, CSELIB_VAL_PTR): New macros. + * simplify_rtx.c: Include "ggc.h", "obstack.h", "cselib.h". + (new_elt_list, new_elt_loc_list, unchain_one_value, clear_table, + unchain_one_elt_list, unchain_one_elt_loc_list, check_useless_values, + discard_useless_locs, discard_useless_values, entry_and_rtx_equal_p, + hash_rtx, new_cselib_val, add_mem_for_addr, get_value_hash, + cselib_lookup_mem, cselib_subst_to_values, cselib_invalidate_regno, + cselib_mem_conflict_p, cselib_invalidate_mem, cselib_invalidate_rtx, + cselib_record_set, cselib_record_sets): New static functions. + (cselib_lookup, cselib_update_varray_sizes, cselib_init, + cselib_finish, cselib_process_insn, rtx_equal_for_cselib_p, + references_value_p): New functions. + (MAX_USELESS_VALUES, REG_VALUES): New macros. + (table, cselib_current_insn, next_unknown_value, cselib_nregs, + n_useless_values, reg_values, callmem, cselib_obstack, + cselib_startobj, empty_vals, empty_elt_lists, empty_elt_loc_lists): + New static variables. + * varray.h (union varray_data_tag): New elt te. + (VARRAY_ELT_LIST_INIT, VARRAY_ELT_LIST): New macros. + * Makefile.in (reload1.o, loop.o, simplify-rtx.o, alias.o): Update + dependencies. + +2000-03-14 Nick Clifton + + * gcc.c (do_spec_1): Catch the case where %* is used in a + substitution pattern, but it has not been initialized. + Issue a meaningful error message if an unrecognized operator + is encountered in a spec string. + +2000-03-14 Richard Earnshaw + + * function.c (prepare_function_start): Correctly initialize + cfun->stack_alignment_needed. + +2000-03-14 Zack Weinberg + + * cppfiles.c (find_include_file): Don't assume nshort is a + substring of name. + +Tue Mar 14 08:42:21 2000 Jeffrey A Law (law@cygnus.com) + + * configure.in (hppa configurations): Add pa32-regs.h to the + list of tm files as appropriate. + * configure: Rebuilt. + * pa.c (compute_frame_size): Remove explicit knowledge about FP + register numbering. + (hppa_expand_prologue, hppa_expand_epilogue): Likewise. + (fmpyaddoperands, fmpysuboperands): Likewise. + * pa.h: Remove various definitions which depend on knowing + how registers are numbered. + * pa32-regs.h: New file with PA32 register numbering specific + definitions. + +2000-03-14 Richard Henderson + + * regmove.c (combine_stack_adjustments): New. + (stack_memref_p, single_set_for_csa): New. + (free_csa_memlist, record_one_stack_memref): New. + (try_apply_stack_adjustment): New. + (combine_stack_adjustments_for_block): New. + * rtl.h (combine_stack_adjustments): Declare. + * toplev.c (rest_of_compilation): Call it. + + * i386.md: Revert 2000-01-16 change. + +2000-03-14 Martin v. Löwis + + * gccbug.in: Add web category, gcc specific classes. + +2000-03-14 Nathan Sidwell + + * stor-layout.c (finalize_record_size): Fix typo. + +2000-03-14 Stan Shebs + + * c-typeck.c (c_alignof): Error on incomplete types. + * extend.texi (Alignment): Document this. + +2000-03-13 Zack Weinberg + + * cppfiles.c: Include mkdeps.h. + (find_include_file, read_include_file): Remove _cpp_ prefix + from name, make static. + (_cpp_execute_include): New function, broken out of + do_include. + + * cpplib.c: Don't include mkdeps.h. + (struct directive): Remove type field. Reorder entries. The + function takes only one argument. + (struct if_stack): Make type field an int. + (directive_table): Rename to dtable. Generate it, the + prototypes of the directive handlers, and the enum for the + directive numbers, from a template macro. + (do_ifndef, do_include_next, do_import): New functions. + (do_define, do_include, do_endif, do_ifdef, do_if, do_else, + do_undef, do_line, do_elif, do_error, do_pragma, do_warning, + do_ident, do_assert, do_unassert, do_sccs): Take only one + argument. + (do_sccs): Define always, but alter behavior based on + SCCS_DIRECTIVE. + (_cpp_handle_directive, consider_directive_while_skipping): + Restructure for new directive table layout. + + (pass_thru_directive): Take a directive number, not a pointer + to a struct directive. + (parse_include): New function, broken out of do_include. + (do_include, do_import, do_include_next): Use parse_include + and _cpp_execute_include. + (do_elif, do_else): Test for T_ELSE specifically when checking + for #elif/#else after #else. + (parse_ifdef): New function, broken out of do_ifdef. + (validate_else): Expect a name arg without a leading #. + (if_directive_name): Delete. + (cpp_define, cpp_assert, cpp_undef, cpp_unassert): Call + directive handlers with only one argument. + + * cpphash.h: Update prototypes. + (enum node_type): Remove entries for directives. + * Makefile.in: Update dependencies. + + * cpphash.c (dump_hash_helper): Only dump nodes of type + T_MACRO. Emit a newline after each definition. + +2000-03-14 Martin v. Löwis + + * gccbug.in: New file. + * configure.in (all_outputs): Add gccbug. + * Makefile.in (install-common): Install gccbug. + (GCCBUG_INSTALL_NAME): New variable. + * configure: Rebuilt. + +2000-03-13 Jason Merrill + + * function.c (put_var_into_stack): Use type_for_mode to calculate + part_type. Use MEM_SET_IN_STRUCT_P. + * expr.c (store_field): Handle CONCAT. + (store_constructor): Use fields_length. + * tree.c (fields_length): New fn. + * tree.h: Declare it. + +2000-03-13 Zack Weinberg + + * Makefile.in (LIBCPP_OBJS): Add cpplex.o. + (cpplex.o): New target. + * po/POTFILES.in: Add cpplex.c. + + * cpplex.c (_cpp_grow_token_buffer, null_cleanup, + cpp_push_buffer, cpp_pop_buffer, cpp_scan_buffer, + cpp_expand_to_buffer, cpp_buf_line_and_col, cpp_file_buffer, + skip_block_comment, skip_line_comment, skip_comment, + copy_comment, _cpp_skip_hspace, _cpp_skip_rest_of_line, + _cpp_parse_name, skip_string, parse_string, + _cpp_parse_assertion, cpp_get_token, cpp_get_non_space_token, + _cpp_get_directive_token, find_position, + _cpp_read_and_prescan, _cpp_init_input_buffer): Move here. + (maybe_macroexpand, _cpp_lex_token): New functions. + + * cpplib.c (SKIP_WHITE_SPACE, eval_if_expr, parse_set_mark, + parse_goto_mark): Delete. + (_cpp_handle_eof): New function. + (_cpp_handle_directive): Rename from handle_directive. + (_cpp_output_line_command): Rename from output_line_command. + (do_if, do_elif): Call _cpp_parse_expr directly. + * cppfiles.c (_cpp_read_include_file): Don't call + init_input_buffer here. + * cpphash.c (quote_string): Move here, rename _cpp_quote_string. + * cppexp.c (_cpp_parse_expr): Diddle parsing_if_directive + here; pop the token_buffer and skip the rest of the line here. + * cppinit.c (cpp_start_read): Call _cpp_init_input_buffer + here. + + * cpphash.h (CPP_RESERVE, CPP_IS_MACRO_BUFFER, ACTIVE_MARK_P): + Define here. + (CPP_SET_BUF_MARK, CPP_GOTO_BUF_MARK, CPP_SET_MARK, + CPP_GOTO_MARK): New macros. + (_cpp_quote_string, _cpp_parse_name, _cpp_skip_rest_of_line, + _cpp_skip_hspace, _cpp_parse_assertion, _cpp_lex_token, + _cpp_read_and_prescan, _cpp_init_input_buffer, + _cpp_grow_token_buffer, _cpp_get_directive_token, + _cpp_handle_directive, _cpp_handle_eof, + _cpp_output_line_command): Prototype them here. + * cpplib.h (enum cpp_token): Add CPP_MACRO. + (CPP_RESERVE, get_directive_token, cpp_grow_buffer, + quote_string, output_line_command): Remove. + +2000-03-13 Bernd Schmidt + + * stmt.c (expand_end_case): RANGE may be signed, and when checking + whether it is too large we must also verify that it isn't negative. + +2000-03-13 Jakub Jelinek + + * config/sparc/sparc.md: Remove all traces of TARGET_LIVE_G0. + (movsi_zero_liveg0): Remove. + (movsf_insn_novis_liveg0): Remove. + (negsi2): Remove. + (negsi2_not_liveg0): Rename to negsi2. + (one_cmplsi2): Remove. + (one_cmplsi2_not_liveg0): Rename to one_cmplsi2. + (one_cmplsi2_liveg0): Remove. + * config/sparc/sparc.h (TARGET_LIVE_G0, TARGET_BROKEN_SAVERESTORE, + MASK_LIVE_G0, MASK_BROKEN_SAVERESTORE): Remove. + (CONDITIONAL_REGISTER_USAGE): Remove TARGET_LIVE_G0 if. + (PREDICATE_CODES): Remove zero_operand. + * config/sparc/sparc.c: Remove all traces of TARGET_LIVE_G0 and + TARGET_BROKEN_SAVERESTORE. + (zero_operand): Remove. + * config/sparc/splet.h (SUBTARGET_SWITCHES): Remove -mlive-g0, + -mno-live-g0, -mbroken-saverestore and -mno-broken-saverestore + options. + (SUBTARGET_OVERRIDE_OPTIONS): Remove. + * config/sparc/linux-aout.h (TARGET_LIVE_G0, + TARGET_BROKEN_SAVERESTORE): Remove. + * config/sparc/linux.h (TARGET_LIVE_G0, TARGET_BROKEN_SAVERESTORE): + Remove. + * config/sparc/linux64.h (TARGET_LIVE_G0, TARGET_BROKEN_SAVERESTORE): + Remove. + * config/sparc/sol2.h (TARGET_LIVE_G0, TARGET_BROKEN_SAVERESTORE): + Remove. + + * config/sparc/sparc.md (return_df_no_fpu): New pattern. + +2000-03-13 Zack Weinberg + + * cpplib.c (do_pragma_implementation): Fix off-by-one error + truncating a string. Don't assume tokens are nul terminated. + Problem noted by Andreas Jaeger + +2000-03-13 Jason Merrill + + * dwarf2out.c (add_name_and_src_coords_attributes): Only add + DW_AT_MIPS_linkage_name for TREE_PUBLIC decls. + (ASM_OUTPUT_DWARF_ADDR_CONST): Don't output trailing newline. + +2000-03-13 Richard Earnshaw + + * stor-layout.c (new_record_layout_info): Fix typo inside ifdef + STRUCTURE_SIZE_BOUNDARY. + +2000-03-13 Mark Mitchell + + * tree.h (record_layout_info_s): New structure. + (record_layout_info): New type. + (new_record_layout_info): New function. + (layout_field): Likewise. + (finish_record_layout): Likewise. + * stor-layout.c (layout_record): Remove. + (new_record_layout_info): New function. + (layout_field): New function, broken out from layout_record. + (finalize_record_size): Likewise. + (compute_record_mode): Likewise. + (finalize_type_size): New function, broken out from layout_type. + (finish_record_layout): Likewise. + (layout_type): Use them. + +2000-03-12 Zack Weinberg + + * cpphash.c: Don't include version.h. + (special_symbol) [case T_VERSION]: Look for the string in + hp->value.cpval; don't use version_string. + * cppinit.c (initialize_builtins): Set hp->value.cpval for + __VERSION__ to version_string. + * Makefile.in (cpphash.o): Update deps. + +2000-03-12 Zack Weinberg + + Convert cpplib to use libiberty/hashtab.c. + + * cpplib.h (struct cpp_reader): Make hashtab and + all_include_files of type 'struct htab *'. Delete HASHSIZE + and ALL_INCLUDE_HASHSIZE macros. + + * cpphash.h: Update prototypes. + (struct hashnode): Remove next, prev, and bucket_hdr members. + Make length a size_t. Add hash member. + (struct ihash): Remove next member. Add hash member. Make + name a flexible array member. + + * cppfiles.c: Include hashtab.h. + (include_hash): Delete. + (IHASHSIZE): New macro. + (hash_IHASH, eq_IHASH, _cpp_init_include_hash): New functions. + (cpp_included): Do the hash lookup here. + (_cpp_find_include_file): Rewrite. + (cpp_read_file): Put the "fake" hash entry into the hash + table. Honor the control_macro, if it turns out we've seen + the file before. Don't push the buffer here. + (_cpp_read_include_file): Push the buffer here. + (OMODES): New macro. Use it whenever we call open(2). + + * cpphash.c: Include hashtab.h. + (hash_HASHNODE, eq_HASHNODE, del_HASHNODE, dump_hash_helper, + _cpp_init_macro_hash, _cpp_dump_macro_hash, _cpp_make_hashnode, + _cpp_lookup_slot): New functions. + (HASHSIZE): new macro. + (hashf, _cpp_install, _cpp_delete_macro): Delete. + (_cpp_lookup): Use hashtab.h routines. + + * cppinit.c: Include hashtab.h. + (cpp_reader_init): Call _cpp_init_macro_hash and + _cpp_init_include_hash. Don't allocate hashtab directly. + (cpp_cleanup): Just call htab_delete on pfile->hashtab and + pfile->all_include_files. + (initialize_builtins): Use _cpp_make_hashnode and + htab_find_slot to add hash entries. + (cpp_finish): Just call _cpp_dump_macro_hash. + * cpplib.c: Include hashtab.h. + (do_define): Use _cpp_lookup_slot and _cpp_make_hashnode to + create hash entries. + (do_pragma_poison, do_assert): Likewise. + (do_include): Don't push the buffer here. Don't increment + system_include_depth unless _cpp_read_include_file succeeds. + (do_undef, do_unassert): Use _cpp_lookup_slot and htab_clear_slot + or htab_remove_elt. + (do_pragma_implementation): Use alloca to create copy. + + * Makefile.in: Update dependencies. + +2000-03-12 Kaveh R. Ghazi + + * cppinit.c (cl_directive_handler): More K&R fixing. + +Sat Mar 11 23:54:26 2000 Jim Wilson + + * config/ia64/ia64.c (ia64_compute_frame_size): Align size to + STACK_BOUNDARY. + * config/ia64/ia64.h (REGISTER_MOVE_COST): Add missing parentheses. + +2000-03-11 Kaveh R. Ghazi + + * cppinit.c (no_arg, no_ass, no_dir, no_fil, no_mac, no_pth): + Change from char[] to macros. + +2000-03-12 Neil Booth + + * cppinit.c (cpp_start_read): Update indirect function + call to K&R C. + +Sat Mar 11 16:18:12 2000 Jim Wilson + + * config/ia64/ia64.h (ADDITIONAL_REGISTER_NAMES): Fix typo in loc79 + entry. + + * config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, + config/ia64/ia64.md, config/ia64/xm-ia64.h: Fix copyright messages. + +2000-03-11 Neil Booth + + * cppinit.c (struct pending option): Replace undef with a + pointer to a directive handling routine. + (struct cpp_pending): Replace separate assert_ and define_ + lists with one directive_ list. + (new_pending_define): Rename new_pending_directive. Extra + argument is the directive's handling routine. + (handle_option): Update to use new_pending_directive. + +2000-03-11 Neil Booth + + * cppfiles.c (file_cleanup, _cpp_find_include_file, + remap_filename, _cpp_read_include_file, actual_directory, + hack_vms_include_specification): Replace bcopy(), index() etc + calls. Add casts to some allocations. Make some variables + pointers to const [unsigned] char. + * cpphash.c (_cpp_install, macro_cleanup, collect_expansion, + collect_formal_parameters): Similarly. + * cppinit.c (struct pending_option, append_include_chain, + cpp_options_init, cpp_reader_init, initialize_standard_includes, + cpp_start_read, new_pending_define, handle_option): Similarly. + * cpplib.c (cpp_define, copy_comment, do_define, do_include, + do_undef, do_error, do_warning, do_pragma, do_pragma_once, + do_pragma_implementation, detect_if_not_defined, + do_ifdef, skip_if_group, cpp_get_token, parse_string, + do_assert, do_unassert): Similarly. + * cpplib.h (cpp_buffer, cpp_options): Update types. Update + function prototypes. + * mkdeps.c (deps_add_target, deps_add_dep): cast allocations. + +2000-03-10 Richard Henderson + + * builtins.c (expand_builtin_strlen): Revert last change. + Use emit_insn_before if we're at the beginning of a sequence. + +2000-03-10 Jason Merrill + + * builtins.c (expand_builtin_strlen): Make sure that we have something + at the beginning of the sequence. + + * toplev.c (rest_of_compilation): Also set TREE_NOTHROW for + deferred inlines. + + * invoke.texi (C++ Dialect Options): Document -fno-enforce-eh-specs. + +2000-03-10 Richard Henderson + + * except.c (can_throw): Use INTVAL on a CONST_INT. + (reachable_handlers): Likewise. + * flow.c (count_basic_blocks, find_basic_blocks_1): Likewise. + +2000-03-10 Andreas Jaeger + + * config/mips/linux.h: Undefine MD_EXEC_PREFIX and + MD_STARTFILE_PREFIX since those are not needed on linux. + (ASM_FILE_START): New, from mips/gnu.h. + +2000-03-09 Richard Henderson + Alex Samuel and others + + * Makefile.in (ssa.o): New rule. + (OBJS): Add ssa.o. + (STAGESTUFF): Add *.ssa and *.ussa. + (mostlyclean): Delete *.ssa, *.ussa, */*.ssa, */*.ussa. + * rtl.def (PHI): New RTL expression. + * rtl.h (clear_log_links): New declaration. + (convert_to_ssa): Likewise. + (convert_from_ssa): Likewise. + * flow.c (split_edge): If the entry node falls through to the + split edge's source block, split the entry edge. + (clear_log_links): New function. + * toplev.c (ssa_dump): New variable. + (flag_ssa): Likewise. + (f_options): Add "ssa". + (compile_file): Create SSA dump files. + (rest_of_compilation): Go to and from SSA if enabled. + (decide_d_option): Handle -de for SSA dump files. + * ssa.c: New file. + +Thu Mar 9 20:01:38 2000 Jim Wilson + + * expr.c (expand_assignment): For a CALL_EXPR, special case PARM_DECL + same as VAR_DECL. + +2000-03-09 Benjamin Kosnik + + * config/alpha/linux.h (WCHAR_TYPE): Make consistent. + +Thu Mar 9 18:10:02 2000 Jeffrey A Law (law@cygnus.com) + + * config/pa/pa-hpux10.h (LIB_SPEC): Correct typo in !p case. + (MD_STARTFILE_PREFIX_1): New macro. + +2000-03-09 Robert Lipe + + * config/ia64/ia64.c: Include system.h. + +2000-03-09 Jason Merrill + + * except.c (nothrow_function_p): If -fno-exceptions, just return. + (init_eh_nesting_info): Likewise. + + * tree.h (struct tree_common): Rename raises_flag to nothrow_flag. + (TREE_NOTHROW): Rename from TREE_RAISES. + * toplev.c (rest_of_compilation): Set it. + * print-tree.c (print_node): Adjust. + * tree.c (stabilize_reference, build, build1): Don't set TREE_RAISES. + (stabilize_reference_1, get_unwidened, get_narrower): Likewise. + * calls.c (emit_call_1): Add 'nothrow' parm. Add + REG_EH_REGION note as appropriate. + (libfunc_nothrow): New fn. + (emit_library_call, emit_library_call_value): Use it. + (expand_call): Check TREE_NOTHROW. + + * varasm.c (make_decl_rtl): Skip initial '*' when setting + DECL_ASSEMBLER_NAME. + +2000-03-09 Andreas Jaeger + + * mips/linux.h (NO_IMPLICIT_EXTERN_C): Define. + (TARGET_MEM_FUNCTIONS): Define. + +2000-03-09 Jason Merrill + + * i386.c (ix86_valid_type_attribute_p): Use compare_tree_int. + + * except.c (can_throw): See through a SEQUENCE. + (nothrow_function_p): New fn. + * except.h: Declare it. + * function.c (current_function_nothrow): New var. + (prepare_function_start): Initialize it. + * output.h: Declare it. + * toplev.c (rest_of_compilation): Set it. + * dwarf2out.c (dwarf2out_begin_prologue): Use it. + +2000-03-09 Zack Weinberg + + * cpphash.c (collect_formal_parameters): strncmp returns 0 for + match. (cpp_compare_defs): Count the nul separator when + advancing over argument names. + +2000-03-09 Bernd Schmidt + + * recog.c (preprocess_constraints): Matching constraints affect + same alternative/different operand, not same operand/different + alternative. + + * reload1.c (eliminate_regs_in_insn): Handle additions of eliminable + register and a constant specially. + +2000-03-08 Kaveh R. Ghazi + + * libgcc2.h: New file. + * libgcc2.c: Move macros, typedefs and prototypes to libgcc2.h. + +Wed Mar 8 16:19:42 2000 Jim Wilson + + * configure.in (ia64*-*-elf*, ia64*-*-linux*): New. + * configure: Regenerate. + * config/ia64: New. + +2000-03-08 Zack Weinberg + + * Makefile.in (LIBCPP_DEPS): New macro. + (cpplib.o, cpphash.o, cpperror.o, cppexp.o, cppfiles.o): Use + it to declare deps. + * cpperror.c: Include cpphash.h. + * cppexp.c: Include cpphash.h. Remove MULTIBYTE_CHARS + dingleberry. + (lex): Don't use CPP_WARN_UNDEF. + (_cpp_parse_expr): Return an int, the truth value. + * cppfiles.c: Include cpphash.h. + (_cpp_merge_include_chains): Move to cppinit.c and make static. + * cppinit.c (include_defaults_array): Disentangle. + (cpp_cleanup): Don't free the if stack here. + (cpp_finish): Pop off all buffers, not just one. + * cpplib.c (eval_if_expr): Return int. + (do_xifdef): Rename do_ifdef. + (handle_directive): Don't use CPP_PREPROCESSED. + (cpp_get_token): Don't use CPP_C89. + * fix-header.c: Don't use CPP_OPTIONS. + + * cpplib.h: Move U_CHAR, enum node_type, struct + file_name_list, struct ihash, is_idchar, is_idstart, + is_numchar, is_numstart, is_hspace, is_space, CPP_BUF_PEEK, + CPP_BUF_GET, CPP_FORWARD, CPP_PUTS, CPP_PUTS_Q, CPP_PUTC, + CPP_PUTC_Q, CPP_NUL_TERMINATE, CPP_NUL_TERMINATE_Q, + CPP_BUMP_BUFFER_LINE, CPP_BUMP_LINE, CPP_PREV_BUFFER, + CPP_PRINT_DEPS, CPP_TRADITIONAL, CPP_PEDANTIC, and prototypes + of _cpp_simplify_pathname, _cpp_find_include_file, + _cpp_read_include_file, and _cpp_parse_expr to cpphash.h. + Move struct if_stack to cpplib.c. Move struct cpp_pending to + cppinit.c. + Change all uses of U_CHAR to be unsigned char instead. + Delete CPP_WARN_UNDEF, CPP_C89, and CPP_PREPROCESSED. + +2000-03-08 Jason Merrill + + * dwarf2out.c (dw_fde_struct): Add 'nothrow'. + (dwarf2out_begin_prologue): Set it. + (output_call_frame_info): Don't emit EH unwind info for leaves. + + * flow.c (count_basic_blocks, find_basic_blocks_1): A rethrow + can occur outside of an EH region. + * except.c: Correct comments about rethrow behavior. + (rethrow_symbol_map): Do nothing if !flag_new_exceptions. + +2000-03-08 Andrew MacLeod + + * flow.c (make_edges): Always call make_eh_edge for calls. + +2000-03-08 Zack Weinberg + + * cpplib.h (parse_underflow_t, CPP_NULL_BUFFER): Delete. + (struct cpp_buffer): Remove fname and underflow fields. + (struct cpp_reader): Remove get_token field. + (struct include_hash): Rename to struct ihash. Add typedef to + IHASH. + (struct if_stack): Remove fname field. + (IF_STACK_FRAME): Rename to IF_STACK. + + * cpperror.c (print_containing_files): Trust that there are no + macro buffers below the top file buffer. + * cppfiles.c: Replace all references to 'struct include_hash' + with 'IHASH'. Rename initialize_input_buffer to + init_input_buffer. Don't set or reference cpp_buffer->fname, + use buffer->ihash->name instead. + * cpphash.c (special_symbol): Use cpp_file_buffer. Use NULL + not CPP_NULL_BUFFER. + * cppinit.c: Use NULL not CPP_NULL_BUFFER, IF_STACK not + IF_STACK_FRAME, IHASH not struct include_hash. + * cpplib.c: Rename eval_if_expression to eval_if_expr. Remove + null_underflow. Use IF_STACK not IF_STACK_FRAME, IHASH not + struct include_hash, NULL not CPP_NULL_BUFFER. Remove all + references to cpp_buffer->fname (delete entirely, or use + ->ihash->name instead) and IF_STACK->fname. + (cpp_push_buffer): Don't set new->underflow. + (do_include): Use cpp_file_buffer. + + * cpphash.c (collect_formal_parameters): Remove duplicate + increment of argslen. Pedwarn in C99 mode if __VA_ARGS__ is + used as a macro argument name. Don't append "..." to namebuf + for varargs macros. After we're done scanning, go through + namebuf and make it NUL separated, not comma separated. + (_cpp_compare_defs): Remove register tag from variables. + Expect defn->argnames to be NUL separated. + (_cpp_dump_definition): Expect defn->argnames to be NUL + separated and in forward order. + * cpphash.h: Update documentation of argnames field. + +2000-03-08 Richard Henderson + + * builtins.c (expand_builtin_strlen): Be prepared for strlensi + to fail. Don't pre-expand the source operand. + + * i386.md (strlensi): Initialize eoschar and align before use. + +2000-03-08 Jason Merrill + + * expr.c (expand_expr, case ARRAY_REF): Still check for missing + CONSTRUCTOR element. + +2000-03-08 Gavin Romig-Koch + + * mips.c (mips_expand_prologue): If the last + named argument is the vararg marker "va_list", treat it as + an unnamed argument. + +2000-03-08 Clinton Popetz + + * dbxout.c (dbxout_parms): When correcting for promoted + big-endian parameters, use the mode of the DECL_RTL rather + than UNITS_PER_WORD. + +2000-03-08 Nathan Sidwell + + * c-common.h (make_fname_decl): Declare. + * c-common.c (make_fname_decl): Define. + (declare_hidden_char_array): Remove. + (declare_function_name): Use make_fname_decl. + * c-decl.c (c_make_fname_decl): New function. + (init_decl_processing): Set make_fname_decl. + +Tue Mar 7 23:50:31 2000 Jeffrey A Law (law@cygnus.com) + + * cccp.c (handle_directive): Initialize backslash_newlines_p. + +2000-03-07 Philipp Thomas + + * po/POTFILES.in: Remove cppalloc.c from file list. + +2000-03-07 Steve Chamberlain + + * pj.c (pj_expand_prologue): current_function->args_info is + now current_function_args_info. + + * pj.h (STORE_FLAG_VALUE, USER_LABEL_PREFIX, + LOCAL_LABEL_PREFIX, ASM_GENERATE_INTERNAL_LABEL, + ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_SKIP): Define. + +2000-03-08 Michael Hayes + + * config/c4x/c4x.h (PUT_SDB_TYPE): Define so that the type info is + output as hexadecimal rather than the default octal. + +2000-03-07 Zack Weinberg + + * cpphash.c (special_symbol): Fix thinko in previous commit. + +2000-03-07 Neil Booth + + * cppexp.c (struct operation, left_shift, right_shift, + cpp_parse_expr): Change some "char"s to "U_CHAR"s, and some + "int"s to "unsigned int"s. + * cpplib.c (detect_if_not_defined, do_assert, do_unassert): + Similarly. + * cpplib.h: Update for above. + * mkdeps.c (deps_init, deps_calc_target): Cast pointers + returned from allocations. + + * cppinit.c (opt_comp, parse_options): New functions. + (handle_option): Use parse_option to parse a single command + line option, that possibly takes an argument. + (cpp_handle_options): Sort the array of command line options on + first invocation (non-ASCII hosts only). + (print_help): Update. + +2000-03-07 Zack Weinberg + + * mkdeps.c (munge): Fix off-by-one bug and inconsistencies in + backslash counting loops. Problem noted by Matt Kraai . + + * cppfiles.c (_cpp_find_include_file): Make sure ih->name is + initialized. + * cppinit.c (cpp_cleanup): Free imp->nshort also. + + * cpperror.c (cpp_print_containing_files, + cpp_print_file_and_line, v_cpp_message): Rename to + print_containing_files, print_file_and_line, and v_message. + * cppexp.c (cpp_parse_expr, cpp_parse_escape, cpp_lex): Rename + to _cpp_parse_expr, parse_escape, and lex. + (parse_charconst): Remove broken multibyte support. + * cppfiles.c (include_hash): Make static. + (cpp_included): New function. + (merge_include_chains, find_include_file, finclude, + simplify_pathname): Rename to _cpp_merge_include_chains, + _cpp_find_include_file, _cpp_read_include_file, and + _cpp_simplify_pathname. + * cpphash.c (cpp_lookup, free_definition, delete_macro, + cpp_install, create_definition, macroexpand, compare_defs, + dump_definition): Rename to _cpp_lookup, _cpp_free_definition, + _cpp_delete_macro, _cpp_install, _cpp_create_definition, + _cpp_macroexpand, _cpp_compare_defs, and _cpp_dump_definition. + * cppinit.c (cpp_handle_option): Rename to handle_option, make + static. + * cpplib.c: Remove extern prototype of cpp_parse_expr. + + * cpphash.h: Update prototypes. + * cpplib.h: Likewise. Prototype _cpp_parse_expr here. + +2000-03-07 Andrew Haley + + * config/mips/mips.h (PTRDIFF_TYPE): Revert broken change; + PTRDIFF_TYPE should be based solely on Pmode. + (SIZE_TYPE): ditto. + +2000-03-07 Kaveh R. Ghazi + + * rtl.h (rtunion_def): Constify member `rtstr'. + (emit_line_note_after, emit_line_note, emit_line_note_force, + emit_note, decode_asm_operands): Constify. + + * cse.c (canon_hash): Likewise. + + * dbxout.c (dbxout_block): Likewise. + + * diagnostic.c (file_and_line_for_asm, v_error_for_asm, + v_warning_for_asm): Likewise. + + * dwarfout.c (function_start_label): Likewise. + + * emit-rtl.c (emit_line_note_after, emit_line_note, emit_note, + emit_line_note_force): Likewise. + + * final.c (last_filename, asm_insn_count, final_scan_insn, + output_source_line): Likewise. + + * function.h (struct emit_status): Likewise. + + * gcse.c (hash_expr_1): Likewise. + + * genattr.c (gen_attr, main): Likewise. + + * genattrtab.c (struct function_unit, current_alternative_string, + write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq, + attr_numeral, check_attr_test, check_attr_value, + convert_set_attr_alternative, convert_set_attr, + compute_alternative_mask, simplify_by_exploding, gen_attr, + gen_unit): Likewise. + + * genflags.c (gen_insn): Likewise. + + * gengenrtl.c (type_from_format): Likewise. + + * genopinit.c (gen_insn): Likewise. + + * genoutput.c (n_occurrences, process_template, process_template): + Likewise. + + * ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size): + Likewise. + + * ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size): + Likewise. + + * ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable, + ggc_set_mark, ggc_get_size): Likewise. + + * objc/objc-act.c (build_module_descriptor, finish_objc): Likewise. + + * optabs.c (init_one_libfunc): Likewise. + + * output.h (assemble_start_function): Likewise. + + * recog.c (decode_asm_operands): Likewise. + + * toplev.c (rest_of_compilation): Likewise. + + * tree.h (emit_line_note_after, emit_line_note, + emit_line_note_force): Likewise. + + * varasm.c (asm_output_bss, asm_output_aligned_bss, + asm_emit_uninitialised, assemble_start_function, + assemble_variable, const_hash, compare_constant_1, + find_pool_constant, mark_constant_pool, assemble_alias): Likewise. + + * xcoffout.h (DBX_FINISH_SYMBOL): Likewise. + + * alpha/alpha.md (call_vms, call_value_vms): Likewise. + + * arm/aof.h (ASM_OUTPUT_ASCII): Likewise. + + * arm/aout.h (ASM_OUTPUT_ASCII): Likewise. + + * arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p, + arm_dllimport_name_p): Likewise. + + * arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op): + Likewise. + + * arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise. + + * arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p, + arm_mark_dllexport, arm_mark_dllimport, + arm_pe_encode_section_info): Likewise. + + * arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS, + ASM_FINISH_DECLARE_OBJECT): Likewise. + + * arm/thumb.c (thumb_function_prologue): Likewise. + + * arm/thumb.h (ASM_OUTPUT_ASCII): Likewise. + + * avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * clipper/clix.h (ASM_OUTPUT_ASCII): Likewise. + + * fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise. + + * i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise. + + * i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING, + ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise. + + * i386/i386-protos.h (asm_output_function_prefix): Likewise. + + * i386/i386.c (asm_output_function_prefix): Likewise. + + * i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise. + + * i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise. + + * i386/sco5.h (ASM_FINISH_DECLARE_OBJECT, + ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII, + ASM_OUTPUT_SECTION_NAME): Likewise. + + * i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise. + + * i860/paragon.h (ASM_OUTPUT_ASCII): Likewise. + + * i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. + + * m32r/m32r.c (m32r_encode_section_info): Likewise. + + * mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * mcore/mcore.c (mcore_encode_section_info): Likewise. + + * mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * mips/mips.h (ASM_OUTPUT_IDENT): Likewise. + + * mips/mips.md (movdi, movsi): Likewise. + + * mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise. + + * ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING, + ASM_OUTPUT_ASCII): Likewise. + + * rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog, + output_mi_thunk, output_toc): Likewise. + + * rs6000/rs6000.md (movsi): Likewise. + + * rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise. + + * tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise. + + * v850/v850.c (print_operand, print_operand_address, + v850_encode_data_area): Likewise. + +2000-03-07 Clinton Popetz + + * config/mips/mips.md (zero_extendsidi2): Always force operand + one to memory for mips16. + +Mon Mar 6 15:22:29 2000 Richard Kenner + + * tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts. + (struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT. + (attribute_hash_list, type_hash_canon): hashcode is now unsigned. + (type_hash_lookup, type_hash_add, type_hash_list): Likewise. + (min_precision): Result is unsigned. + (add_double, neg_double, mul_double): Low word is unsigned. + (lshift_double, rshift_double, lrotate_double): Likewise. + (rrotate_double, div_and_round_double): Likewise. + (tree_floor_log2, compare_tree_int): New functions. + (preserve_rtl_expr_temps): New declaration. + * c-common.c (declare_hidden_char_array): Use compare_tree_int. + (decl_attributes): Use tree_log2 to find alignment. + Check for TREE_INT_CST_HIGH for format args. + (min_precision): Now unsigned. + Use tree_floor_log2. + (truthvalue_conversion): Delete long-disabled code. + * c-decl.c (finish_struct): Clean up tests on field width. + (finish_function): Use compare_tree_int. + * c-pragma.c (handle_pragma_token): Use tree_log2 for alignment. + * c-typeck.c (comptypes): Use tree_int_cst_equal. + (default_conversion, digest_init): Use compare_tree_int. + (build_binary_op): Use integer_all_onesp and compare_tree_int. + Fix type errors in forming masks. + * calls.c (initialize_argument_information): Use compare_tree_int. + * dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. + * except.c (expand_eh_region_start_tree): Use compare_tree_int. + * expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop. + (store_field): Use compare_tree_int. + (expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT. + (expand_expr, case ARRAY_REF): Use compare_tree_int. + (do_jump, case BIT_AND_EXPR): Use tree_floor_log2. + (do_store_flag): Use compare_tree_int. + * fold-const.c (encode, decode): Low part is always unsigned. + (force_fit_type, add_double, neg_double, mul_double): Likewise. + (lshift_double, rshift_double, lrotate_double): Likewise. + (rrotate_double, div_and_round_double, int_const_binop): Likewise. + (fold_convert): Use compare_tree_int. + (operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal. + (invert_truthvalue, case INTEGER_CST): Likewise. + (fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW. + * mkdeps.c (deps_dummy_targets): Make I unsigned. + * rtl.h (add_double, neg_double, mul_double): Low words are unsigned. + (lshift_double, rshift_double, lrotate_double, rrotate_double): + Likewise. + * stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree. + (expand_end_case): Use compare_tree_int. + (estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. + * stor-layout.c (mode_for_size_tree): Use compare_tree_int. + (layout_decl): Likewise. + (layout_record, layout_union): Make sizes unsigned. + (layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype. + (layout_type, case QUAL_UNION_TYPE): Use compare_tree_int. + * tree.c (struct type_hash): hashcode is unsigned. + (build_type_attribute_variant, type_hash_list): Likewise. + (type_hash_lookup, type_hash_add, type_hash_canon): Likewise. + (attribute_hash_list, build_array_type, build_method_type): Likewise. + (build_complex_type): Likewise. + (real_value_from_int_cst): Remove unneeded casts. + (integer_all_onesp): Add casts. + (tree_floor_log2, compare_tree_int): New functions. + (build_index_type): Use tree_int_cst_sgn. + * varasm.c (assemble_variable): Use compare_tree_int. + +2000-03-06 Jason Merrill + + * cpphash.c (collect_expansion): Also catch ## at start of macro. + + * varasm.c (make_decl_rtl): Don't add a number to members of + local classes. + (make_function_rtl): Likewise. + +2000-03-06 Alexandre Oliva + + * gcse.c (compute_can_copy): Adjust if/else blocks from rth's + patch from 2000-01-28. + +2000-03-06 Clinton Popetz + + * config/sh/sh.c: (barrier_align): Handle a delay slot that is + filled with an insn from the jump target. + +2000-03-07 Michael Hayes + + * config/c4x/c4x-protos.h (c4x_global_name): Constify char *. + (c4x_external_ref): Likewise. + * config/c4x/c4x.c (struct name_list): Likewise. + +1999-12-16 Ben Collins + + * Makefile.in: Pass a new MULTILIB_EXCLUSIONS option as the sixth + argument to genmultilib. + * genmultilib: accept new MULTILIB_EXCLUSIONS option and output + the contents into the multilib.h header. + * gcc.c: Declare multilib_exclusions for the specs file. + (set_multilib_dir): Use it. + (print_multilib_info): Likewise. + * t-linux64: Declare arguments for new MULTILIB_EXCLUSIONS option + to pass to genmultilib. + +2000-03-06 Kaveh R. Ghazi + + * builtins.c (built_in_class_names, built_in_names): Constify a + char*. + + * gmon-sol2.c (monstartup, moncontrol): Cast ptrs to long, not + int. + (_mcleanup): Ensure value matches format specifier in sprintf. + + * cpphash.c (special_symbol): Don't needlessly cast away + const-ness. + + * cppinit.c (base_name): Delete unused prototype. + + * mkdeps.c (deps_init): Make definition K&R safe. + + * tree.h (built_in_class_names, built_in_names): Constify a + char*. + +2000-03-06 Jakub Jelinek + + * config/sparc/sparc.c (eligible_for_epilogue_delay): Accept + floating point instructions for epilogue delay. + + * config/sparc/sparc.h (ASM_ARCH64_SPEC): Pass -no-undeclared-regs + to gas if it supports .register pseudo. + + * real.h (MAX_LONG_DOUBLE_TYPE_SIZE): Define to + LONG_DOUBLE_TYPE_SIZE if not defined. + Use MAX_LONG_DOUBLE_TYPE_SIZE instead of + LONG_DOUBLE_TYPE_SIZE in preprocessor if clauses. + * real.c: Likewise. + * gengenrtl.c: Likewise. + * print-rtl.c: Likewise. + * rtl.c: Likewise. + * config/sparc/sol2-sld-64.h (TARGET_DEFAULT): Set + MASK_LONG_DOUBLE_128. + * config/sparc/sol2.h (TARGET_DEFAULT): Likewise. + * config/sparc/sp64-elf.h (TARGET_DEFAULT): Likewise. + * config/sparc/linux64 (TARGET_DEFAULT): Likewise. + (SUBTARGET_SWITCHES): Define. + (CPP_ARCH32_SPEC): Define __LONG_DOUBLE_128__ if compiling + with -mlong-double-128. + (LONG_DOUBLE_TYPE_SIZE): Define depending on target_flags. + (MAX_LONG_DOUBLE_TYPE_SIZE): Define. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define depending on CPP macros. + (CC1_SPEC): Include -mlong-double-{64,128} as needed. + * config/sparc/linux.h (SUBTARGET_SWITCHES): Define. + (CPP_SUBTARGET_SPEC): Define __LONG_DOUBLE_128__ if compiling + with -mlong-double-128. + (LONG_DOUBLE_TYPE_SIZE): Define depending on target_flags. + (MAX_LONG_DOUBLE_TYPE_SIZE): Define. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define depending on CPP macros. + * config/sparc/sparc.h (MASK_LONG_DOUBLE_128, + TARGET_LONG_DOUBLE_128): Define. + * config/sparc/linux-aout.h (LONG_DOUBLE_TYPE_SIZE): Remove. + * config/sparc/sparc.c (sparc_override_options): Disallow 64bit + long double on TARGET_ARCH64. + +2000-03-06 Mark Mitchell + + * function.c (free_temps_for_rtl_expr): Don't free slots + that have been pushed into a higher level. + + Revert this patch: + 2000-03-05 Mark Mitchell + +2000-03-05 Mark Mitchell + + * basic-block.h (ALLOCA_REG_SET): Remove. + (INITIALIZE_REG_SET): New macro. + * flow.c (update_life_info): Use it. + (calculate_global_regs_live): Likewise. + (propagate_block): Likewise. + * global.c (build_insn_chain): Likewise. + * haifa-sched.c (schedule_region): Likewise. + +2000-03-05 Stephane Carrez + + * dwarf2out.c (UNALIGNED_WORD_ASM_OP): Support 2 bytes pointer. + (ASM_OUTPUT_DWARF_ADDR_CONST): Use UNALIGNED_WORD_ASM_OP. + (DWARF_ARANGES_PAD_SIZE): New define. + (output_aranges): Use it to pad the address range header. + (DWARF_ROUND): Fix for non power of 2 rounding. + +2000-03-05 Jason Merrill + + * mkdeps.c (deps_calc_target): Remove incorrect 'const'. + +2000-03-05 Mark Mitchell + + * tree.def (RTL_EXPR): Update documentation. + * tree.h (RTL_EXPR_HAS_NO_SCOPE): New macro. + * expr.c (expand_expr): Handle RTL_EXPR_HAS_NO_SCOPE. + * function.c (preserve_rtl_expr_temp): New function. + (preserve_rtl_expr_temps): Likewise. + (preserve_rtl_expr_result): Use it. + + Revert this patch: + 2000-03-04 Mark Mitchell + +2000-03-04 Thomas Schuster + + * regmove.c (copy_src_to_dest) Do not create src->dest move + for unchanging destination. + +2000-03-04 Mark Mitchell + + * function.h (struct sequence_stack): Remove rtl_expr. + (struct emit_staus): Likewise. + (seq_rtl_expr): Remove. + * tree.h (free_temps_for_rtl_expr): Don't declare. + (start_sequence_for_rtl_expr): Likewise. + * rtl.h (preserve_rtl_expr_result): Likewise. + * emit-rtl.c (start_sequence): Don't set sequence_rtl_expr. + (start_sequence_for_rtl_expr): Remove. + (push_topmost_sequence): Don't save sequence_rtl_expr. + (pop_topmost_sequence): Remove comment about not restoring it. + (end_sequence): Don't set seq_rtl_expr. + (init_emit): Don't initialize it. + (mark_sequence_stack): Don't mark it. + (mark_emit_status): Likewise. + * except.c (protect_with_terminate): Use + start_sequence_for_rtl_expr, not start_sequence. + * expr.c (expand_expr, case RTL_EXPR): Don't call + preserve_rtl_expr_result or free_temps_for_rtl_expr. + * function.c (assign_stack_temp_for_type): Don't set rtl_expr. + (preserve_rtl_expr_result): Remove. + (free_temps_for_rtl_expr): Likewise. + (pop_temp_slots): Likewise. + (mark_temp_slot): Don't mark the rtl_expr. + * stmt.c (expand_start_stmt_expr): Use start_sequence, not + start_sequence_for_rtl_expr. + +2000-03-04 Zack Weinberg + + * mkdeps.c, mkdeps.h: New files. + * po/POTFILES.in: Add them. + * Makefile.in (LIBCPP_OBJS): Add mkdeps.o. + (cpplib.o, cppinit.o): Depend on mkdeps.h. + (mkdeps.o): New target. + + * cppfiles.c: Delete deps_output. + * cppinit.c: Include mkdeps.h. Delete known_suffixes, + OBJECT_SUFFIX, and base_name. + (cpp_cleanup): Use deps_free. Free ihash->name when clearing + the include hash. + (initialize_dependency_output): Use deps_init, + deps_add_target, deps_calc_target, and deps_add_dep. Remove + all the unnecessary string bashing. + (cpp_finish): Use deps_write. Remove an unnecessary nesting + level. + * cpplib.c (do_include): Use deps_add_dep. + * cpplib.h (struct cpp_reader): Replace deps_buffer, + deps_allocated_size, deps_size, deps_column members with + single pointer to a struct deps. Delete prototype of + deps_output. + + * cppinit.c: Fix thinko in previous patch. + +Sat Mar 4 11:32:30 2000 Richard Kenner + + * machmode.h (mode_for_size, smallest_mode_for_size): SIZE now signed. + * stor-layout.c (mode_for_size, smallest_mode_for_size): Likewise. + (mode_for_size_tree): New function. + (layout_decl, layout_type): Call it and clean up BLKmode checks. + * tree.h (mode_for_size_tree): New declaration. + + * toplev.c (debug_ignore_block): Mark arg BLOCK as possibly unused. + +2000-03-04 Jason Merrill + + * stmt.c (is_body_block): Move... + * dwarfout.c, dwarf2out.c: ...from here. + * tree.h: Declare it. + * emit-rtl.c (remove_unnecessary_notes): Don't remove the body block. + * final.c (final_start_function): Do call remove_unnecessary_notes + when scheduling. + +2000-03-03 Zack Weinberg + + * config/vax/xm-vms.h: Define OBJECT_SUFFIX and EXECUTABLE_SUFFIX. + + * cpplib.h (_dollar_ok): New macro. + (is_idchar, is_idstart): Use it. + (IStable): Rename to _cpp_IStable. Declare it const if + gcc >=2.7 or C99. Delete all references to FAKE_CONST. + (is_idchar, is_idstart, is_numchar, is_numstart, is_hspace, + is_space): Update for renamed IStable. + + * cppinit.c: Delete all references to FAKE_CONST and CAT + macros. Define init_IStable as empty macro if gcc >=2.7 or + C99. Change TABLE() to ISTABLE and hardcode name of table. + (cpp_start_read): Don't change the IStable based on + dollars_in_ident. + + * cpphash.c (unsafe_chars): Add pfile argument. All callers + changed. Handle '$' for char1 correctly. + * cpplib.c (cpp_get_token): Use is_numchar when parsing numbers. + + * cppexp.c (tokentab2): Make const. + (cpp_lex): Make toktab const. + * cppinit.c (include_defaults_array): Make const. + (initialize_standard_includes): Make default_include const. + +2000-03-03 Jason Merrill + + * dwarf2out.c (dwarf2out_frame_debug): Add cast to silence warning. + (dwarf2out_decl): Functions can now have DECL_IGNORED_P. + (gen_decl_die): Likewise. + * dwarfout.c (dwarfout_file_scope_decl): Likewise. + (output_decl): Likewise. + + * varasm.c (make_function_rtl): If we change the name used in the + rtl, update DECL_ASSEMBLER_NAME accordingly. + (make_decl_rtl): Likewise. + + * toplev.c (rest_of_compilation): Tweak formatting. + + * toplev.c (rest_of_compilation): find_loop_tree_blocks before + remove_unnecessary_notes. + (debug_ignore_block): New fn. + * toplev.h: Declare it. + * emit-rtl.c (remove_unnecessary_notes): Call it. + * dwarf2out.c (dwarf2out_ignore_block): New fn. + * dwarf2out.h: Declare it. + * final.c (final_start_function): Don't call remove_unnecessary_notes + if we did insn scheduling. + +2000-03-03 Zack Weinberg + + * cppinit.c (cpp_handle_option): Set opts->pedantic directly. + * cpplib.h: Delete SET_CPP_PEDANTIC. + +Fri Mar 3 14:56:12 2000 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): Use bitfield case if + result is a RECORD_TYPE. + +2000-03-03 Jonathan Larmour + + * mips/elf.h (CTOR_LISTS_DEFINED_EXTERNALLY): Added. + +2000-03-03 Richard Henderson + + * alpha.c (alpha_emit_set_const_1): Re-order cases to prefer + addition over compliments over shifts. + +Fri Mar 3 12:49:28 2000 J"orn Rennecke + + * reload1.c (reload_combine_note_use): Handle return register USEs. + REG case: Handle multi-hard-register hard regs. + +Fri Mar 3 07:38:34 2000 Richard Kenner + + * md.texi: Document use of '*' in insn pattern name. + +2000-03-03 Jason Merrill + + * calls.c (special_function_p): operator new may not be malloc-like. + + * gcse.c (dump_hash_table): Really fix error in last change. + +2000-03-02 Denis Chertykov + + * avr.c (print_operand): Use print_operand_address instead of + output_addr_const. + * avr/libgcc.S: Cleanup code. + +2000-03-02 Richard Henderson + + * alpha.c (alpha_emit_set_const_1): Also try c + small constant. + +2000-03-02 Mark Mitchell + + * tree.h (TYPE_ALIGN_UNIT): New macro. + +2000-03-02 Clinton Popetz + + * i386.c: (constant_call_address_operand): Reject CONST_INT. + +2000-03-02 Jason Merrill + + * cpplib.h (CPP_PEDANTIC): Only true if system_header_p is not set + for the buffer. + (SET_CPP_PEDANTIC): New macro. + * cpplib.c (do_include): Don't bother checking system_header_p. + (do_warning, do_ident, do_assert, do_unassert): Likewise. + * cppinit.c (cpp_handle_option): Use SET_CPP_PEDANTIC. + + * function.h (struct expr_status): Add x_arg_space_so_far. + (arg_space_so_far): New macro. + * expr.c (init_expr): Initialize it. + * calls.c (emit_call_1): Reset it. + (compute_argument_block_size, expand_call): Use it. + (expand_call, store_one_arg): Increment it. + +Thu Mar 2 17:27:13 2000 Richard Kenner + + * varasm.c (output_constant): Strip off a CONVERT_EXPR to + a UNION_TYPE. + +2000-03-02 Zack Weinberg + + * cppfiles.c (cpp_read_file): New function. + + * cpphash.c (collect_expansion): Make sure to reset last_token + to NORM when we hit a string. Handle trailing whitespace + properly when the expansion is empty. + (create_definition): Disable line commands while parsing the + directive line. + (dump_definition): If pfile->lineno == 0, output a line + command ahead of the dump, and add a trailing newline. + + * cppinit.c (append_include_chain): Add fifth argument, which + indicates whether or not system headers are C++ aware. + (initialize_standard_includes): New function, + broken out of read_and_prescan. Pass 'cxx_aware' value from + the include_defaults_array on to append_include_chain. + (dump_special_to_buffer): Const-ify char array. + (builtin_array): Don't dump __BASE_FILE__. + (cpp_start_read): Use cpp_read_file. Reorder code for + clarity. Don't output line commands here for -D/-A/-U + switches. Don't call deps_output for files included with + -include or -imacros. + + * cpplib.c (do_define): Don't pay any attention to the second + argument. + (cpp_expand_to_buffer): Disable line commands while scanning. + (output_line_command): Work in the file buffer. + * cpplib.h: Remove no_record_file flag from struct cpp_reader. + Fix formatting of comments. Prototype cpp_read_file. + +Thu Mar 2 13:29:46 2000 Richard Kenner + + * c-common.c (c_common_nodes_and_builtins): Make sizetype_endlink + reference the language-equivalent of sizetype. + * c-typeck.c (comptypes): Treat sizetype like its language equivalent. + * fold-const.c (size_binop, size_diffop): Put back checks. + * gcse.c (dump_hash_table): Fix minor error in last change. + * stor-layout.c (set_sizetype): Set TYPE_DOMAIN of sizetype. + Clear TYPE_{NEXT,MAIN}_VARIANT and TYPE_{POINTER,REFERENCE}_to of + all sizetypes. + +Thu Mar 2 12:48:45 MET 2000 Jan Hubicka + + * calls.c (expand_call) Do not attempt to combine stack adjustments + with inhibit_defer_pop set. + +2000-03-01 Mark Mitchell + + * stor-layout.c (layout_decl): Allow front-ends to explicitly set + the DECL_SIZE for a FIELD_DECL. + +2000-03-01 Bruce Korb + + * fixinc/inclhack.tpl: remove unused symlinks + * fixinc/README: GCC Maintainer info + * fixinc/inclhack.sh: regen + * fixinc/fixincl.sh: regen + +2000-03-01 Zack Weinberg + + * cpphash.c (collect_expansion): Trim trailing white space + from macro definitions, but don't go past the last insertion + point. + +Wed Mar 1 12:14:31 MET 2000 Jan Hubicka + + * i386.md (mulqi3): New pattern. + +2000-02-29 Zack Weinberg + + * cpplib.h (CPP_ASSERTION, CPP_STRINGIZE, CPP_TOKPASTE): New + token types. + (struct cpp_reader): Add parsing_if_directive and + parsing_define_directive flags. + (struct cpp_options): Remove output_conditionals flag. + (check_macro_name): Delete prototype. + + * cpphash.h (struct macrodef): Delete. + (struct reflist): Separate from struct definition. + (struct definition): Remove unused fields. Add column number. + (create_definition): Returns a DEFINITION *. Takes a + cpp_reader * and an int. + + * cpphash.c (SKIP_WHITE_SPACE): Delete. + (PEEKC): Copy defn from cpplib.c. + (rest_extension, REST_EXTENSION_LENGTH): Delete. + (struct arg): New. + (struct arglist): Simplify. + (collect_expansion): Rewrite. Get tokens by calling + cpp_get_token. Add more error checking. + (collect_formal_parameters): New function, broken out of + create_definition and reworked to use get_directive_token. + (create_definition): All real work is now in collect_expansion + and collect_formal_parameters. do_define handles finding the + macro name. Return a DEFINITION, not a MACRODEF. + (macroexpand): Replace bcopy with memcpy throughout. Replace + character-at-a-time copy loop with memcpy and pointer increments. + (compare-defs): d1->argnames / d2->argnames might be null. + + * cpplib.c (copy_rest_of_line): Delete function. + (skip_rest_of_line): Do all the work ourselves. + (skip_string): New function. + (parse_string): Use skip_string. + (get_macro_name): New function. + (check_macro_name): Delete. + (copy_comment): Use CPP_RESERVE and CPP_PUTC_Q. + (cpp_skip_hspace): Use CPP_BUMP_LINE. + (handle_directive): ICE if we're called on a macro buffer. + (do_define): Determine macro name and type (funlike/objlike) + here. Expunge all uses of MACRODEF. + (cpp_push_buffer): Set line_base to NULL. + (do_undef, read_line_number): Don't worry about getting a POP token. + (eval_if_expression): Set/reset parsing_if_directive around + cpp_parse_expr. Don't clear only_seen_white. + (skip_if_group): Remove output_conditionals logic. Use + skip_rest_of_line. + (cpp_get_token): Return ASSERTION, STRINGIZE, and TOKPASTE + tokens under appropriate conditions. + (cpp_unassert): Call do_unassert not do_assert. Oops. + + * cppexp.c (parse_defined): New function, break out of + cpp_lex. + (cpp_lex): We now get CPP_ASSERTION tokens and can check them + ourselves, with cpp_defined. + * cppinit.c (cpp_handle_option, print_help): Delete -ifoutput. + + * gcc.dg/20000209-2.c: Turn off -pedantic-errors. + * gcc.dg/strpaste-2.c: New. + +2000-02-29 Mark Mitchell + + * fold-const.c (size_binop): Don't asert inputs are the same and + have TYPE_IS_SIZETYPE set. + (size_diffop): Likewise. + +2000-02-29 Jason Merrill + + * dwarfout.c (output_block): Output abstract blocks even if they + don't have TREE_ASM_WRITTEN set. + + * calls.c (emit_library_call): Check for null REG. + +2000-03-01 Martin von Loewis + + * c-decl.c (current_function_decl): Move to toplev.c. + (init_decl_processing): Don't add current_function_decl as a ggc + root here. + * dbxout.c (dbxout_symbol): Change return type to int. + (dbxout_symbol_location, dbxout_syms): Likewise. + (dbxout_block): Don't emit LBRAC/RBRAC pairs for blocks without + any locals. Use current_function_func_begin_label if set. + * dbxout.h (dbxout_symbol, dbxout_syms): Change return type. + * dwarf2out.c (dwarf2out_begin_prologue): Set + current_function_func_begin_label. + * final.c (final_start_function): Reset it. + * toplev.c (current_function_decl): Define it here. + (current_function_func_begin_label): New variable. + (main): Add both as ggc roots. + * tree.h (current_function_func_begin_label): Declare. + +Tue Feb 29 14:07:04 2000 Richard Kenner + + * gcse.c: Cleanups throughout: mostly white-space, but also + some minor rearrangement of code. + +Tue Feb 29 10:45:59 2000 Jeffrey A Law (law@cygnus.com) + + * calls.c (emit_library_call): Do not abort if FUNCTION_ARG + returns a PARALLEL. Use emit_group_load and use_group_regs + as needed. + (emit_library_call_value): Similarly. + + * pa/t-pa: Use quadlib.c instead of quadlib.asm. + * pa/quadlib.asm: Remove. + * pa/quadlib.c: New file. + + * configure.in (hpux10, hpux11, PA32 mode): Use i128 float format. + * configure: Rebuilt. + +2000-02-29 Philip Blundell + + * config/arm/conix-elf.h: New file. + * configure.in (arm*-*-conix*): New configuration. + * configure: Regenerate. + +2000-02-28 Jason Merrill + + * dwarf2out.c (gen_block_die): Output abstract blocks even if they + don't have TREE_ASM_WRITTEN set. + +Mon Feb 28 21:07:59 2000 Richard Kenner + + * Eliminate DECL_FIELD_SIZE. + * builtins.c (built_in_class_names, built_in_names): New variables. + * c-decl.c (finish_struct): Set specified size in DECL_SIZE. + * expr.c (expand_expr, case COMPONENT_REF): Get field size from + DECL_SIZE, not DECL_FIELD_SIZE. + * print-tree.c (print_node): Remove code that prints extra blank + lines in some cases. + Properly handle inline and builtin function cases. + * stor-layout.c (layout_decl): Get specified size from DEC_SIZE. + * tree.h (built_in_class_named, built_in_names): New declarations. + (union tree_decl): Rename internal unions to u1 and u2 and change + some of their components. + Add new field built_in_class. + (DECL_ALIGN, DECL_INCOMING_RTL, DECL_SAVED_INSNS, DECL_FRAME_SIZE): + Reflect above changes. + (DECL_FUNCTION_CODE, DECL_BUILT_IN_CLASS): Likewise. + (DECL_SET_FUNCTION_CODE, DECL_FIELD_SIZE): Deleted. + * objc/objc-act.c (objc_copy_list): Use DECL_SIZE, not DECL_FIELD_SIZE. + (encode_field_decl): Likewise; also remove obsolete test for bitfield. + +2000-02-28 Dmitri Makarov + + * extend.texi: Document ARM's support for long/short calls. + + * invoke.texi: Document ARM's -mlong-calls command line switch. + + * config/arm/arm-protos.h (arm_is_longcall_p): Add prototype. + (arm_encode_call_attribute): Add prototype. + (arm_set_default_type_attribute): Add prototype. + (arm_strip_name_encoding): Add prototype. + + * config/arm/arm.c (arm_init_cumulative_args): replace + initialisation og 'long_calls' field with initialisation of + 'call_cookie' field. + (enum arm_pragma_enum): New enum. + (arm_pragma_long_calls): New static variable. + (arm_process_pragma): Also process "#pragma long_calls_off". + (arm_valid_type_attribute_p): Accept short_call attribute. + (arm_comp_type_attributes): Check long/short call attributes. + (arm_encode_call_attribute): New function: Encode long_call + or short_call attribute in function name. + (arm_set_default_type_attributes): New function: Assign + default attributes to newly defined type. + (current_file_function_operand): New function: Return true if + the symbol is a function which has already been compiled. + (arm_is_longcall_p): New function: Return true if the + indicated function should be called via a long call. + (arm_get_strip_length): New function. Returns number of + prefix characters to be stripped from a function's name. + (arm_strip_name_encoding): New function. Strip prefix characters + from a function's name. + + * config/arm/arm.h (CUMULATIVE_ARGS): Replace 'long_call' field + with 'call_cookie'. + (SHORT_CALL_FAG_CHAR): Define. + (LONG_CALL_FAG_CHAR): Define. + (ENCODED_SHORT_CALL_ATTR_P): Define. + (ENCODED_LONG_CALL_ATTR_P): Define. + (ARM_NAME_ENCODING_LENGTHS): Define. + (STRIP_NAME_ENCODING): Define. + (ASM_OUTPUT_LABELREF): Define, and use to strip name encoding. + (ARM_ENCODE_CALL_TYPE): Define. + (ENCODE_SECTION): Invoke ARM_ENCODE_CALL_TYPE. + (ARM_DECLARE_FUNCTION_SIZE): Define. + (SET_DEFAULT_TYPE_ATTRIBUTES): Define. + + * config/arm/arm.md (call): Call arm_is_longcall_p to decide + if a long call is needed. + (call_value): Ditto. + (call_symbol): Ditto. + + * config/arm/elf.h (ASM_DECLARE_FUNCTION_SIZE): Add invocation of + ARM_DECLARE_FUNCTION_SIZE. + + * config/arm/pe.h (ARM_PE_FLAG_CHAR): Define. + (SUBTARGET_NAME_ENCODING_LENGTHS): Define. + (ARM_STRIP_NAME_ENCODING): Undefine. + (STRIP_NAME_ENCODING): Undefine. + (ASM_OUTPUT_LABELREF): Use arm_strip_name_encoding. + (ASM_DECLARE_FUNCTION_NAME): Ditto. + (ASM_OUTPUT_COMMON): Ditto. + (ASM_DECLARE_OBJECT_NAME): Ditto. + + * config/arm/pe.c (arm_dllexport_name_p): Check for + ARM_PE_FLAG_CHAR. + (arm_dllimport_name_p): Ditto. + (arm_mark_dllexport): Use ARM_PE_FLAG_CHAR. + (arm_mark_dllimport): Ditto. + +Mon Feb 28 22:11:12 2000 J"orn Rennecke + + * sh.h (DWARF_LINE_MIN_INSTR_LENGTH): Define. + +2000-02-28 Mark Mitchell + + * xcoffout.c (xcoffout_begin_function): Fix typo in previous change. + +2000-02-28 Zack Weinberg + + * tm.texi: Document new target switch, NO_BUILTIN_WCHAR_TYPE. + * cppinit.c (builtin_array): Define __WCHAR_TYPE__ only if + NO_BUILTIN_WCHAR_TYPE is not defined. + (CPP_WCHAR_TYPE): Delete. + * cccp.c (main): Don't change wchar_type if cplusplus. + (special_symbol, initialize_builtins): Honor NO_BUILTIN_WCHAR_TYPE. + +2000-02-28 Nick Clifton + + * config/arm/arm-wince-pe.h (SIZE_TYPE): Define to "unsigned long". + +Mon Feb 28 14:21:15 2000 Catherine Moore + + * config/pa/som.h (MAKE_DECL_ONE_ONLY): Define. + (ASM_WEAKEN_LABEL): Define. + +Mon Feb 28 13:07:19 MET 2000 Jan Hubicka + + * expr.c (store_constructor): Do not emit USE. + * rtl.h (stupid_life_analysis): Remove. + +Mon Feb 28 07:03:27 2000 Richard Kenner + + * function.c (number_blocks): Reset next_block_index based on + what debugging format is used, not what is defined. + + * lcm.c: Minor reformatting throughout. + (reg_dies, reg_becomes_live): Properly handle multiple hard regs. + + * toplev.c (rest_of_compilation): Account for time in + optimize_mode_switching. + + * jump.c (jump_optimize_1): Don't call delete_barrier_successors + if only marking labels. + +Mon Feb 28 12:53:57 MET 2000 Jan Hubicka + + * calls.c (expand_call): Attempt to combine stack adjustments with + pending stack adjustments. + +Mon Feb 28 11:34:43 2000 J"orn Rennecke + + * loop.c (reg_in_basic_block_p): Don't abort when falling through + to the end of the function. + +2000-02-27 Mark Mitchell + + * emit-rtl.c (remove_unnecessary_notes): Remove notes for empty + blocks. + * final.c (next_block_index): Remove. + (max_block_depth): Likewise. + (pending_blocks): Likewise. + (init_final): Don't initialize them. + (final_start_function): Don't set next_block_index. Set up + BLOCK_NUMBER. + (final_scan_insn): Use BLOCK_NUMBER, not next_block_index. + * function.h (number_blocks): New function. + * function.c (get_block_vector): New function. + (identify_blocks): Use it. + (reorder_blocks): Set NOTE_BLOCK. + (number_blocks): New function. + * tree.def (BLOCK): Add documentation for TREE_ASM_WRITTEN flag. + * tree.h (BLOCK_NUMBER): New macro. + (tree_block): Add block_num field. + * dbxout.c (next_block_number): Remove. + (dbxout_init): Don't set it. + (dbxout_block): Only output blocks that have TREE_ASM_WRITTEN + set. Use BLOCK_NUMBER, rather than next_block_num, to determine + block numbers. + * toplev.c (rest_of_compilation): Always call + find_loop_tree_blocks. Fix indentation. + * dwarf2out.c (next_block_number): Remove. + (gen_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, + to determine block numbers. + (gen_inlined_subroutine_die): Likewise. + (gen_block_die): Only output blocks that have TREE_ASM_WRITTEN set. + (decls_for_scope): Don't increment next_block_number. + * dwarfout.c (next_block_number): Remove. + (output_lexical_block_die): Use BLOCK_NUMBER, not next_block_number, + to determine block numbers. + (output_inlined_subroutine_die): Likewise. + (output_block): Only output blocks that have TREE_ASM_WRITTEN set. + (output_decls_for_scope): Don't increment next_block_number. + * sdbout.c (next_block_number): Remove. + (sdbout_block): Use BLOCK_NUMBER. + (sdbout_begin_block): Simplify. + * xcoffout.c (next_block_number): Remove. + (xcoffout_block): Use BLOCK_NUMBER, not next_block_number. + (xcoffout_begin_block): Don't set next_block_number. + (xcoffout_begin_function): Likewise. Use BLOCK_NUMBER, not + next_block_number. + +Sun Feb 27 16:40:33 2000 Richard Kenner + + * builtins.c (c_strlen): Use size_diffop and return ssizetype value. + (expand_builtin_strcpy): Pass correct type to size_binop. + (expand_builtin_strcmp): Likewise. + Clean up conditional structure. + * c-decl.c (init_decl_processing): Don't call set_sizetype twice. + (complete_array_type): Don't use size_binop for MAXINDEX. + * c-typeck.c (c_sizeof): Use size_one_node and TYPE_SIZE_UNIT. + (c_sizeof_nowarn, c_size_in_bytes): Likewise. + (c_alignof): Use size_one_node. + (build_unary_op): Pass arg of proper type to size_binop. + (really_start_incremental_init, push_init_level): Use sizetype for + constructor{,_bit,_unfilled}_index. + (pop_init_label, output_init_element): Likewise. + (output_pending_init_elements, process_init_element): Likewise. + * calls.c (compute_argument_block_size): Field VAR is ssizetype. + * expr.c (store_expr): Use size_int. + (store_constructor): Use proper types for size_binop args. + (get_inner_reference, expand_expr, case ARRAY_REF): Likewise. + (expand_expr_unaligned): Likewise. + (string_contant): Return object of sizetype. + * expr.h (SUB_PARM_SIZE): Call size_diffop and pass proper types. + (ARGS_SIZE_RTX): Call ARGS_SIZE_TREE. + (ARGS_SIZE_TREE): Pass proper types to size_binop. + * fold-const.c (int_const_binop): Refine when size_int is called. + (fold_convert): Likewise. + (size_int_wide): Rework to take KIND as arg, only take low order + bits, handle new sizetype_tab datatype, and chain entries in + size_table. + (size_int_type_wide): New function. + (size_binop): Validate types of arguments. + (ssize_binop): Deleted. + (size_diffop): New function. + (extract_muldiv): Only fold division into multiplication for sizetypes. + * function.c (assign_parms): Use size_diffop and make sure + VAR field is of ssizetype; also pass proper type to size_binop. + (locate_and_pad_parm, pad_to_arg_alignment): Likewise. + (round_down): Deleted from here. + * store-layout.c (sizetype_tab): Now an array. + (sizetype_set, early_root_list): New variables. + (variable_size): Use size_one_node. + (round_up): Pass proper type to size_binop. + (round_down): Moved to here and corrected as above. + (layout_record): Pass proper arg types to size_binop. + (layout_type): Likewise. + If sizetype_set is zero, record the type just laid out. + (make_unsigned_type): Don't call set_sizetype; + (make_signed_type): Likewise; also, call fixup_signed_type. + (initialize_sizetypes): New function. + (set_sizetype): Make copy of types, set TYPE_IS_SIZETYPE, and + set name of bitsizetype to "bit_size_type". + Fix up type of sizes of all types made before call. + * tm.texi (ROUND_TYPE_SIZE_UNIT): New macro. + * tree.c (fix_sizetype): Deleted. + (build_common_tree_nodes): Call initialize_sizetypes. + (build_common_tree_nodes_2): Don't call fix_sizetype. + * tree.h (TYPE_IS_SIZETYPE): New macro. + (initialize_sizetype): New declaration. + (enum size_type_kind): New type. + (struct sizetype_tab): Deleted. + (sizetype_tab): Now array; adjust sizetype macros. + (size_diffop, size_int_type_wide): New functions. + (size_int_wide): Change number of args and type; access macros changed. + (ssize_int, sbitsize_int): New macros. + * config/i960/i960.h (ROUND_TYPE_SIZE): Use size_int. + (ROUND_TYPE_SIZE_UNIT): New macro. + +2000-02-27 Zack Weinberg + + * c-lex.c (putback_buffer): Make 'buffer' an unsigned char *. + +Sun Feb 27 07:44:17 2000 Richard Kenner + + * gcov-io.h (__fetch_long, __store_long, __read_long, __write_long): + Mark as possibly unused. + + * cse.c (cse_insn): Delete dead code involving tablejump. + Pass CODE_LABEL, not LABEL_REF to gen_jump and reset INSN_CODE. + + * Makefile.in (libcpp.a): Start by deleting it. + +2000-02-27 Alexandre Oliva + + * cpplib.h (enum file_change_code): Added rename_file. + * cpplib.c (do_line): If a filename is given, set file_change to + rename_file. + (output_line_command): If file_change is rename_file, always + output a # directive with the file name. + + * cpplib.c (do_pragma): Accept #pragma without consecutive token. + +2000-02-26 Mark Mitchell + + * integrate.c (copy_decl_for_inlining): Preserve TREE_ADDRESSABLE + when copying a PARM_DECL or RESULT_DECL. + +2000-02-26 Kaveh R. Ghazi + + * fix-header.c (recognized_function): Also fix prototypes for + functions taking "void". + +2000-02-26 Geoff Keating + + * reload1.c (do_output_reload): Check reg_reloaded_valid before + looking at reg_reloaded_contents. + +2000-02-26 Zack Weinberg + + * Makefile.in (STMP_FIXINC): New toggle. + (LIBGCC2_DEPS): Delete all references. + (stmp-headers): Delete target. All references either deleted + or changed to stmp-int-headers. + (all.cross): Don't depend on stmp-headers or STMP_FIXPROTO. + (LIBCPP_OBJS): Take out cppalloc.o. + (cppalloc.o): Delete target. + (stmp-int-hdrs): Depend on $(STMP_FIXINC). + (gen-protos, fix-header): Link with libiberty.a. + * build-make: Don't change FIXINCLUDES. Override STMP_FIXINC + to empty. + + * configure.in: Remove refs to strerror. + * acconfig.h: Take out NEED_DECLARATION_STRERROR. + * system.h: Take out strerror stanza. + + * cpperror.c (my_strerror): Delete function. + (cpp_error_from_errno, cpp_notice_from_errno): Use xstrerror. + * cppmain.c (main): Call xmalloc_set_program_name first thing. + * cppalloc.c: Delete file. + * gen-protos.c: Don't provide xrealloc. + + * fixinc/fixincl.c, fixinc/fixlib.c, fixinc/procopen.c: Use + xstrerror throughout. + +2000-02-26 Bruce Korb + + * fixinc/inclhack.def (undefine_null): the bypass pattern needs to + match for DOS headers, too. + * fixinc/inclhack.sh,fixincl.x: Regenerate. + +2000-02-26 Geoff Keating + + * config/elfos.h (ASM_OUTPUT_LABELREF): Don't define. The default + is right for most ELF targets. + * config/ns32k/ns32k.h (ASM_OUTPUT_LABELREF): Don't define. + Let the default file use %U properly. + * config/sh/elf.h (ASM_OUTPUT_LABELREF): Don't define. Use the + default. + + * config/fp-bit.c (pack_d): Properly handle rounding of denormal + numbers. + +Sat Feb 26 09:39:16 2000 Richard Kenner + + * toplev.c (documented_lang_options): Correct spelling error. + (decode_d_option, decode_f_option, main): Likewise. + + * toplev.c (print_time): Avoid SIGFPE when all_time is zero. + + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Use .set at + to tell assembler it is permitted to expand large constants. + +2000-02-25 Mumit Khan + + * protoize.c: (AUX_INFO_SUFFIX): New macro. + (aux_info_suffix): Use. + (SAVE_SUFFIX): New macro. + (save_suffix): Use. + (munge_compile_parms): Fix typo in NUL. DJGPP supports /dev/null. + (gen_aux_info_file): Use aux_info_suffix instead of ".X". + (edit_file): Handle 8.3 restriction for DOS/DJGPP filenames. + + * invoke.texi (Running Protoize): Update documentation. + +2000-02-25 Mark Elbrecht + + * i386/djgpp.h (CPP_PREDEFINES): Remove Unix defines. + +2000-02-25 John Wehle (john@feith.com) + + * rtlanal.c (find_last_value): Allow NULL_RTX for valid_to. + +2000-02-25 Anthony Green + + * toplev.c (rest_of_compilation): Rebuild jump labels if + combine_instructions has created a new direct jump. + * combine.c (try_combine): Add new_direct_jump_p argument. Set it + when appropriate. + (combine_instructions): Call try_combine with new argument. + Return non-null value when new direct jump instruction is created. + * rtl.h: combine_instructions returns an int. + +Fri Feb 25 19:49:08 2000 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Replace the PATTERN of the insn with an new + jump when changing a computed jump into a jump to a known + target. + +Fri Feb 25 19:22:44 2000 Graham Stott + + * resource.c (mark_referenced_resources): Changed use SET_DEST (...) + to XEXP (..., 0) on RTL nodes which are not SET or CLOBBER. + + * i386.md (define_expand "clrstrsi"): Fix typo. + +Fri Feb 25 18:49:39 2000 "K. Richard Pixley" + + * rtl.texi: Fix typo. + +Fri Feb 25 20:02:35 2000 J"orn Rennecke + + * sh.c (calc_live_regs): Multiply value assigned to *COUNT_PTR by + UNITS_PER_WORD. Change caller initial_elimination_offset. + (rounded_frame_size): Take into account that argument pushed has + changed. Fix TARGET_ALIGN_DOUBLE problem. + +2000-02-25 Geoff Keating + + * haifa-sched.c (schedule_block): Explain the real reason + we delete REG_SAVE_NOTEs on the first insn of a block. + Don't delete REG_SAVE_NOTES for NOTE_INSN_SETJMP. + +2000-02-24 Mark Mitchell + + * input.h (push_srcloc): New function. + (pop_srcloc): Likewise. + * toplev.c (push_srcloc): Define it. + (pop_srcloc): Likewise. + +2000-02-24 Richard Henderson + + * flow.c (life_analysis): When collecting reg info, clear + regs_ever_live. + +Thu Feb 24 22:06:52 2000 J"orn Rennecke + + Fix bug exposed by reload.c no longer rounding the frame + size to BIGGEST_ALIGNMENT: + * sh.c (rounded_frame_size): New function. + (sh_expand_prologue, sh_expand_epilogue): Use it. + (initial_elimination_offset): Likewise. + +Thu Feb 24 20:04:11 2000 J"orn Rennecke + + Fix breakage from 6th Feb thread_prologue_and_epilogue_insns change: + * sh-protos.h (sh_need_epilogue): Declare. + * sh.c (sh_need_epilogue_known): New static variable. + (sh_need_epilogue): New function. + (function_epilogue): Clear need_epilogue_known. + * sh.md (return): Split into expander / insn pattern. + Make the expander conditional on ! sh_need_epilogue (). + +2000-02-24 Nathan Sidwell + + * machmode.h (get_mode_alignment): Declare. + (GET_MODE_ALIGNMENT): Call it. + * stor-layout.c (get_mode_alignment): New function. Make + sure alignment is always power of 2. + +2000-02-23 Zack Weinberg + + * i386.h: Remove useless definition of "I386" and misleading + comment above it. + +2000-02-23 Zack Weinberg + + * tree.h (TREE_SET_PERMANENT): New macro. Document conditions + under which TREE_PERMANENT will be set. + * tree.c (make_node, copy_node, make_tree_vec, tree_cons, + build1): Use TREE_SET_PERMANENT. + * print-tree.c (print_node): Don't report value of + TREE_PERMANENT if ggc_p is true. + + * c-common.c (c_get_alias_set): Don't use TREE_PERMANENT to + decide whether to give a type a new alias set. + * objc/objc-act.c (build_objc_string_object): Never copy the string. + * tree.c (make_node): Set DECL_IN_SYSTEM_HEADER irrespective + of value of 'obstack'. + + +2000-02-24 Michael Hayes + + * config/c4x/c4x.c (c4x_process_after_reload): Split all insns. + +2000-02-23 Alexandre Oliva + + * cpplib.h (enum cpp_token): Added CPP_WCHAR and CPP_WSTRING. + * cpplib.c (cpp_get_token): Produce them. + * cppexp.c (cpp_lex): Handle them. + +2000-02-23 Nick Clifton + + * config/arm/arm.c (arm_comp_type_attributes): Simply and + comment tests on type attributes. + +Wed Feb 23 16:42:21 2000 J"orn Rennecke + + * final.c (shorten_branches): Make value passed to LOOP_ALIGN + conform to documentation. + * sh.h (LOOP_ALIGN): If aligning loops, call sh_loop_align + to check for special cases. + * sh-protos.h (sh_loop_align): Declare. + * sh.c (sh_loop_align): Define. + +2000-02-22 Andrew Haley + + * config/mips/mips.h (GAS_ASM_SPEC): Pass -mgp32/-mgp64 to gas. + (SIZE_TYPE): Is 32 bits when using -mgp32. + (PTRDIFF_TYPE): Ditto. + +Wed Feb 23 07:26:27 2000 Richard Kenner + + * diagnostic.c (init_output_buffer): Handle case of null PREFIX. + +2000-02-23 Zack Weinberg + + * config/i386/i386.h: If IN_TARGET_LIBS is defined, make + BIGGEST_FIELD_ALIGNMENT a constant. + +2000-02-21 Jason Merrill + + * dwarf2out.c (output_line_info): Put the marker for the end of + the line number info at the actual end. + (gen_struct_or_union_type_die): Use decl_function_context + to check for local classes. + * dwarfout.c (output_type): Likewise. + +Tue Feb 22 01:38:57 2000 Jeffrey A Law (law@cygnus.com) + + * pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Handle pass-by-reference + for arguments with a mode, but no type. + (FUNCTION_ARG_CALLEE_COPIES): Similarly. + * t-pa (LIB2FUNCS_EXTRA): Add quadlib.asm. + * pa/long_double.h: New file. + * configure.in (hpux10, hpux11 configurations): hpux10 and hpux11 + both have 128bit wide long doubles. + * configure: Rebuilt. + +2000-02-21 Kaveh R. Ghazi + + * defaults.h (ASM_OUTPUT_ASCII): Constify a char*. + + * flow.c (get_common_dest, chain_reorder_blocks, make_reorder_chain, + fixup_reorder_chain, skip_insns_between_block): Add static prototypes. + (life_analysis): Wrap variable `i' with macro ELIMINABLE_REGS. + + * haifa-sched.c (rank_for_schedule): Don't cast away const-ness. + + * integrate.c (compare_blocks, find_block): Likewise. + + * rtl.c (fatal_with_file_and_line): Add ATTRIBUTE_PRINTF_2. + + * rtl.h (set_file_and_line_for_stmt): Constify a char*. + + * stmt.c (stmt_status, set_file_and_line_for_stmt, + expand_asm_operands): Likewise. + +Mon Feb 21 17:06:27 2000 Jason Eckhardt + + * predict.c (estimate_probability): Added the pointer heuristic to + the collection of static branch predictors. + +2000-02-21 Catherine Moore + + * config/mips/mips.h (ASM_SPEC): Add -mfix700. + * invoke.texi (-mfix7000): Document. + +2000-02-21 Gabriel Dos Reis + + * diagnostic.c (init_output_buffer): Make it possible to output at + least 32 characters if we're given a too long prefix. + +2000-02-20 Mark Mitchell + + * varasm.c (initializer_constant_valid_p): Call + lang_expand_constant to simplify the constant. + +2000-02-20 Bruce Korb + + * fixinc/inclhack.def(stdio_va_list): + typedef needs to be disabled. + * fixinc/inclhack.sh: regen + * fixinc/fixincl.x: regen + +2000-02-20 Geoff Keating + + * print-rtl.c (print_rtx): Don't print addresses when + flag_dump_unnumbered. + +2000-02-20 Kaveh R. Ghazi + + * sparc.c (sparc_output_scratch_registers): Mark parameter with + ATTRIBUTE_UNUSED. + (sparc_va_arg, sparc_flat_output_function_prologue, + sparc_flat_output_function_epilogue): Cast value to unsigned in + comparison. + (sparc_emit_float_lib_cmp): Remove unused variable `cmp'. + + * sparc.md: Add default case in switch. + +2000-02-19 Richard Henderson + + * c-typeck.c (add_pending_init): Don't abort for multiple + fields at the same offset. + (pending_init_member): Test the correct member. + +2000-02-19 Herman A.J. ten Brugge + + * except.c (start_dynamic_handler) : Use TYPE_MODE (integer_type_node) + instead of SImode. + (start_catch_handler) : Same. + +2000-02-19 Brad Lucier (lucier@math.purdue.edu) + + * Makefile.in: Have flow.o depend on $(EXPR_H) + +Sat Feb 19 18:43:13 2000 Richard Kenner + + * c-common.c (decl_attributes): Set DECL_SIZE_UNIT. + * c-decl.c (duplicate_decls, finish_enum): Likewise. + (finish_decl): Remove -Wlarger-than code from here. + * flags.h (id_clash_len): Now int. + (larger_than_size): Now HOST_WIDE_INT. + * fold-const.c (size_int_wide): No more HIGH parm; NUMBER is signed. + Clean up checking to see if in table. + (make_bit_field_ref): Remove extra parm to bitsize_int. + * ggc-common.c (ggc_mark_tree_children): Mark DECL_SIZE_UNIT. + * print-tree.c (print_node): Print DECL_SIZE_UNIT and TYPE_SIZE_UNIT. + * stmt.c (expand_decl): Use DECL_SIZE_UNIT for stack checking size + and for computing size of decl. + * stor-layout.c (layout_decl): Set DECL_SIZE_UNIT. + Move -Wlarger-than code to here. + (layout_record): Remove extra arg to bitsize_int. + Set TYPE_BINFO_SIZE_UNIT. + (layout_union): Remove extra arg to bitsize_int. + Use proper type for size of QUAL_UNION. + (layout_type): Remove extra arg to bitsize_int. + * toplev.c (id_clash_len): Now int. + (larger_than_size): Now HOST_WIDE_INT. + (decode_W_option): Clean up id-clash and larger-than- cases. + * tree.c (get_identifier, maybe_get_identifier): Remove unneeded casts. + (expr_align, case FUNCTION_DECL): DECL_ALIGN is not defined. + * tree.h (BINFO_SIZE_UNIT, TYPE_BINFO_SIZE_UNIT, DECL_SIZE_UNIT): New. + (struct tree_decl): New field size_unit. + (size_int_wide): No HIGH operand; NUMBER is now signed. + (size_int_2): Deleted. + (size_int, bitsize_int): Don't use it and rework args. + * varasm.c (assemble_variable, output_constructor): Use DECL_SIZE_UNIT. + +Fri Feb 18 20:01:58 2000 Jeffrey A Law (law@cygnus.com) + + * pa/quadlib.asm (_U_QFgt, _U_Qfge): Fix flags for _U_Qfcmp call. + +2000-02-18 Geoff Keating + + * invoke.texi (Warning Options): Add an explanation of why + you might want the -Wfloat-equal flag. + +Fri Feb 18 20:08:57 2000 Richard Kenner + + * bitmap.c (bitmap_operation): Avoid using -1 for index since unsigned. + * cppinit.c (new_pending_define): Add cast to avoid warning. + * expmed.c (extract_bit_field): Likewise. + * flow.c (enum reorder_skip_type): New type. + (skip_insns_between_blcok): New it. + Rework to avoid warning about possibly undefined variable. + * function.c (assign_parms): Make thisparm_boundary unsigned. + * genrecog.c (write_switch): Cast XWINT result to int. + * lcm.c: Many static fcns and vars now #ifdef OPTIMIZE_MODE_SWITCHING. + * mips-tfile.c (init_file): Make two versions of FDR initializer: + one for MIPS and one for Alpha. + (get_tag, copy_object): Add casts to avoid warnings. + * optabs.c (init_one_libfunc): Cast NAME to (char *). + * reload.c (find_reloads): Make TYPE enum reload_type. + * sbitmap.c (dump_sbitmap): J is unsigned; don't use "1L". + * unroll.c (unroll_loop): Initialize UNROLL_NUMBER. + * varasm.c (compare_constant_1): Add cast to avoid warning. + * config/alpha/alpha.c (alpha_emit_xfloating_libcall): Cast FUNC + to (char *). + (alpha_expand_unaligned_load, alpha_expand_unaligned_store): + Cast switch operand of size to int. + (alpha_expand_epilogue): Always initialize fp_offset and sa_reg. + * config/alpha/alpha.h (INITIAL_ELIMINATION_OFFSET): Add abort + in unhandled case. + +2000-02-18 Nick Clifton + + * config/arm/elf.h (ASM_OUTPUT_ALIGN): Do not generate + anything for an alignment of zero. + + * config/arm/thumb.h (ASM_OUTPUT_ALIGN): Do not generate + anything for an alignment of zero. + +2000-02-18 Martin von Loewis + + * gcc.texi (Bug Reporting): Refer to bugs.html. + (Bug Lists): Likewise. + * system.h (GCCBUGURL): New preprocessor define. + * rtl.c (fancy_abort): Use it. + * gcc.c (main): Likewise. + +2000-02-18 Richard Henderson + + * flow.c (INSN_VOLATILE, SET_INSN_VOLATILE, uid_volatile): Remove. + (life_analysis_1): Subsume into ... + (life_analysis): ... here. Force PROP_REG_INFO off after reload. + Use update_life_info for the relaxation. + (update_life_info): Update REG_BASIC_BLOCK for registers live on + entry and regs_live_at_setjmp. + (set_noop_p): Simplify. + (notice_stack_pointer_modification_1): Renamed from s/_1//. + (record_volatile_insns): Split into ... + (delete_noop_moves): ... here, + (notice_stack_pointer_modification): ... here, + (insn_dead_p): ... and here. + (propagate_block): Don't query INSN_VOLATILE. + (mark_used_regs): Mind !PROP_REG_INFO. + * toplev.c (rest_of_compilation): Call mark_constant_function here, + not in life_analysis. + +Fri Feb 18 01:29:22 EST 2000 John Wehle (john@feith.com) + + * loop.c (canonicalize_condition): New function, + broken out of get_condition. + (get_condition): Use it. + * expr.h (canonicalize_condition): Prototype it. + + * tree.h (tree_int_cst_msb): Declare. + * tree.c (tree_int_cst_msb): New function. + +2000-02-17 Mark Mitchell + + * stmt.c (set_file_and_line_for_stmt): Don't crash if cfun->stmt + isn't set. + + * invoke.texi (-fmessage-length=n): Document. + +2000-02-17 Jason Merrill + + * bitmap.c (bitmap_operation): Don't leak bitmap elements. + +2000-02-17 Mark Mitchell + + * function.c (thread_prologue_and_epilogue_insns): Put a line note + after the prologue. + +2000-02-17 Nick Clifton + + * config/arm/thumb.c: Replace includes of system headers with + #include "system.h". + +2000-02-16 Richard Henderson + + * configure.in (alpha-linux*, alpha-netbsd) [extra_parts]: + Add crtbeginS.o and crtendS.o. + * alpha/elf.h (STARTFILE_SPEC): Use crtbeginS.o. + (ENDFILE_SPEC): Use crtendS.o. + * alpha/t-crtbe (crtbeginS.o, crtendS.o): New targets. + + * alpha/crtbegin.asm (__do_frame_takedown): Merge into ... + (__do_global_dtors_aux): ... here. Call __cxa_finalize if + shared and present. + (__dso_handle): New variable. + * alpha/crtend.asm (__do_global_ctors_aux): Remove runtime + bias to __CTOR_END__. + +2000-02-16 Richard Henderson + + * Makefile.in (s-crtS, crtbeginS, crtendS): Prefix usage with $(T). + +Wed Feb 16 21:40:04 2000 Hans-Peter Nilsson + + * longlong.h (__clz_tab): Declare as static to match definition. + +2000-02-16 Mark Elbrecht + + * i386/xm-djgpp.h (LIBSTDCXX): Delete. Moved to config/i386/djgpp.h. + (XREF_FILE_NAME): Define. + + * i386/djgpp.h (DATA_SECTION_ASM_OP): Define. + (EH_FRAME_SECTION_ASM_OP): Define. + (IDENT_ASM_OP): Define. + (TEXT_SECTION_ASM_OP): Define. + (CPP_SPEC): Define. + (CTORS_SECTION_ASM_OP): Define. + (CTOR_SECTION_FUNCTION): Use it. + (DTORS_SECTION_ASM_OP): Define. + (DTOR_SECTION_FUNCTION): Use it. + +2000-02-16 Zack Weinberg + + * reg-stack.c (emit_swap_insn): Do not put a new insn before a + NOTE_BASIC_BLOCK. + + * flow.c (dump_regset, debug_regset, dump_bb, debug_bb, + debug_bb_n): New functions. + (dump_flow_info, print_rtl_with_bb): Use dump_regset. + * basic-block.h: Prototype new functions. + +Wed Feb 16 21:07:53 2000 Denis Chertykov + + * configure.in: Add support for avr target. + * configure: Rebuilt. + + * invoke.texi: Add AVR invocation docs. + * install.texi: Add information about AVR. + * md.texi: Add AVR constraint letters description. + * extend.texi: Add description for AVR specific attributes. + +2000-02-16 Jason Merrill + + * fixinc/fixinc.svr4: Wrap byteorder.h with extern "C". + +2000-02-16 Nick Clifton + + * emit-rtl.c (emit_insn): Move RTL check into make_insn_raw. + (make_insn_raw): Move RTL check here. + +2000-02-16 Kaveh R. Ghazi + + * version.c: Include gansidecl.h and version.h. + + * version.h: Wrap entire file in macro __GCC_VERSION_H__. + + * configure.in (gcc_version): When setting, narrow search to + lines containing `version_string'. + + * Makefile.in (mainversion): Likewise. + (GCC_H): New variable. + (gcc.h): Delete target. + (gcc.o, gccspec.o, cppspec.o): Depend on $(GCC_H), not gcc.h. + (version.o): Depend on version.h. + (dbxout.o): Don't depend on gcc.h. + +Wed Feb 16 15:04:49 2000 Hans-Peter Nilsson + Michael Meissner + + * md.texi (Simple Constraints): Add item about whitespace. + * genoutput.c (strip_whitespace): New. + (scan_operands) [MATCH_OPERAND, MATCH_SCRATCH]: Call + strip_whitespace for constraints. + Test pointer using NULL, not 0. + +2000-02-16 Alexandre Oliva + + * cpplib.c (do_line): Pedwarn for #line > 32767. + + * c-lex.c (readescape): Warn about '\x', but do not reject it. + +2000-02-15 Jonathan Larmour + + * gcc.c (default_compilers): Add new __GNUC_PATCHLEVEL__ define + to default cpp spec. + (do_spec_1): Add support for %v3 spec used by __GNUC_PATCHLEVEL__. + * cpp.texi: Document __GNUC_PATCHLEVEL__. + * cpp.1: Likewise. + + * objc/lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to + default spec. + +2000-02-15 Denis Chertykov + + * configure.in: Add support for avr target. + +Wed Feb 16 03:21:43 2000 J"orn Rennecke + + * sh.h (OVERRIDE_OPTIONS): Don't set sh_addr_diff_vec_mode. + (sh_addr_diff_vec_mode): Don't declare. + * sh.c (sh_addr_diff_vec_mode): Delete. + +Wed Feb 16 01:27:52 2000 J"orn Rennecke + + * sh.md (mulsi3_highpart): Add REG_EQUAL note to last insn. + +Wed Feb 16 00:58:06 2000 J"orn Rennecke + + * sh.md (udivsi3_i1, divsi3_i1, umulhisi3_i, mulhisi3_i): Name. + (smulsi3_highpart_i): Name. + (udivsi3): Wrap emitted insns in REG_LIBCALL / REG_RETVAL notes. + (divsi3, mulhisi3, umulhisi3, mulsidi3, umulsidi3): Likewise. + (smulsi3_highpart, umulsi3_highpart): Likewise. + + (mulsidi3_i, umulsidi3_i): Make rtl describe operation + correctly independent of endianness. + (mulsidi3, umulsidi3): Now define_insn. Hide details that + confuse the optimizers. + (mulsidi3+1, umulsidi3+1): New define_split. + +Tue Feb 15 23:22:26 2000 Andrew Haley + + * config/sh/sh.md: Guard insn splits against illegal registers. + * config/sh/sh.h: Correct comment about macros. + +Tue Feb 15 22:30:36 2000 J"orn Rennecke + Andrew MacLeod + + * Makefile.in (lcm.o): Depend on insn-attr.h. + * basic-block.h (optimize_mode_switching): Declare. + * lcm.c (tm_p.h, insn-attr.h): #include. + (seginfo, bb_info): New structs. + (antic, transp, comp, delete, insert) : New file-scope static variables. + (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. + (reg_becomes_live, optimize_mode_switching): Likewise. + * tm.texi: Add description of mode switching macros. + * toplev.c (rest_of_compilation): Call optimize_mode_switching. + + * sh-protos.h (remove_dead_before_cse): Remove prototype. + (fldi_ok, fpscr_set_from_mem): New prototypes. + * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. + (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): + Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). + (sh_flag_remove_dead_before_cse): Remove declaration. + (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. + (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. + (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. + * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). + (barrier_align): Allow for JUMP_INSNS containing a parallel. + (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. + (fldi_ok): New function. + (get_fpscr_rtx): Add fpscr_rtx as GC root. + (emit_sf_insn): Only generate fpu switches when optimize < 1. + (emit_df_insn): Likewise. + (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. + (sh_flag_remove_dead_before_cse): Delete. + (get_free_reg, fpscr_set_from_mem): New functions. + * sh.md (movdf, movsf): Remove no_new_pseudos code. + (return): Remove emit_fpscr_use / remove_dead_before_cse calls. + +2000-02-15 Loren Rittle + + * ginclude/stddef.h: Correct usage of _BSD_RUNE_T_ for FreeBSD. + +2000-02-15 Kaveh R. Ghazi + + * Makefile.in (TREE_H, collect2.o, gcc.h, mips-tfile.o, cccp.o, + cpphash.o, cppinit.o, protoize.o, unprotoize.o): Depend on version.h. + + * cccp.c: Include version.h and/or don't declare `version_string'. + * collect2.c: Likewise. + * alpha.c: Likewise. + * arm/aof.h: Likewise. + * arm/coff.h: Likewise. + * arm/elf.h: Likewise. + * arm/pe.h: Likewise. + * arm/tcoff.h: Likewise. + * arm/telf.h: Likewise. + * arm/tpe.h: Likewise. + * arm/vxarm.h: Likewise. + * convex/convex.c: Likewise. + * i386/dgux.c: Likewise. + * i386/sun386.h: Likewise. + * m88k/m88k.c: Likewise. + * mcore/mcore-pe.h: Likewise. + * mips/mips.h: Likewise. + * romp/romp.h: Likewise. + * sh/sh.c: Likewise. + * cpphash.c: Likewise. + * cppinit.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * gcc.c: Likewise. + * gcc.h: Likewise. + * mips-tfile.c: Likewise. + * protoize.c: Likewise. + * toplev.c: Likewise. + * tree.h: Likewise. + + * version.c (version_string): Constify a char*. + + * version.h: New file. + +2000-02-14 Nick Clifton + + * configure.in: Add mcore-elf and mcore-pe targets. + * configure: Regenerate. + + * NEWS: Add note that MCore port has been contributed. + + * invoke.texi: Document command line switches for MCore port. + * install.texi: Add MCore to list of supported targets. + +2000-02-14 Geoff Keating + + * collect2.c (main) [COLLECT_EXPORT_LIST]: If we have frames, + then we will need to import the frame handling functions. + (scan_prog_file) [COLLECT_EXPORT_LIST]: We will also need + to import the frames themselves. + +Mon Feb 14 13:31:01 2000 Stan Cox + Jason Eckhardt + + * basic_block.h: Added prototype for reorder_basic_blocks. + * toplev.c: Changes to add -freorder-blocks and graph dump after + block reordering is done. + * flow.c (reorder_block_def): New structure for use during block + reordering. + (REORDER_BLOCK_*): New macros to access members of above structure. + (skip_insns_between_block, get_common_dest, chain_reorder_blocks, + make_reorder_chain, fixup_reorder_chain, reorder_basic_blocks): New + functions for block reordering. + +Mon Feb 14 11:24:44 2000 Hans-Peter Nilsson + + * gcc.texi (Passes): Fix typo. + * md.texi (Standard Names): Ditto. + * tm.texi (Storage Layout): Ditto. + +2000-02-13 Zack Weinberg + + * cpplib.c (do_define): Only free the old definition if it + actually had one. + +2000-02-13 Neil Booth + + * cppfiles.c (read_and_prescan): When emitting deferred + newlines, test speccase[] again instead of checking each + possible whitespace character in turn. When we encounter \r, + look behind for \n first, then ahead. + +2000-02-13 Zack Weinberg + + * cse.c (cse_altered): New internal flag. + (cse_insn): Set it if we changed an insn. + (cse_main): Clear cse_altered before each basic block. + Only garbage collect if cse_altered is true afterward. + +Sun Feb 13 14:12:28 2000 Rainer Orth + + * sparc/sol2.h (LIB_SPEC): Link -ldl if profiling. + +Sun Feb 13 13:21:55 2000 Jeffrey A Law (law@cygnus.com) + + * combine.c (simplify_comparison): Fix typo. + +Sun Feb 13 12:57:52 2000 Neil Booth + + * prefix.c (concat, lookup_key): Use xmalloc and xrealloc + consistently. + +2000-02-13 Michael Hayes + + * flow.c (flow_loop_tree_node_add): Use better algorithm by passing + previously inserted node instead of root node. Caller changed. + +2000-02-13 Michael Hayes + + * basic-block.h (FLOW_LOOP_FIRST_BLOCK, FLOW_LOOP_LAST_BLOCK): Delete. + +2000-02-12 Kaveh R. Ghazi + + * crtstuff.c (__do_global_ctors_aux, __reg_frame_ctor, + __dereg_frame_dtor): Add prototype argument. + + * gthr-dce.h (__gthread_active_p, __gthread_once): Likewise. + + * gthr-posix.h (__gthread_active_p, __gthread_once): Likewise. + + * gthr-solaris.h (__gthread_active_p, __gthread_once): Likewise. + + * gthr-vxworks.h (__gthread_once): Likewise. + + * gthr-win32.h (__gthread_active_p, __gthread_once): Likewise. + +Sat Feb 12 01:44:26 MET 2000 Jan Hubicka + + * i386.c (ix86_emit_restore_regs_using_mov): Break out from ... + (ix86_expand_epilogue): ... here. Use mov instead of add to restore + stack pointer in functions w/o saved registers, output LEAVE more often + on TARGET_USE_LEAVE machines. + +2000-02-07 Dmitri Makarov & Bernd Schmidt + + * config/arm/arm.c (arm_init_cumulative_args); New function: + Initlaise the CUMULATIE_ARGS strcuture for a function + definition. + (arm_function_arg): New function: Determine where to place a + function's argument. Also handles deciding the function's + call cookie. + (current_file_function_operand): New function: Return true if + the symbol is a function which has already been compiled. + (arm_is_long_call_p): New function: Return true if the + indicated function should be called via a long call. + (arm_valid_type_attribute_p): New function: Return true if the + attribute is a valid, arm specific, attribute. + (arm_comp_type_attribute): New function: Return true if the + two types have compatible, arm specific, attributes. + + * config/arm/arm.h (CUMULATIVE_ARGS): Redefine to be a + structure. + (FUNCTION_ARG): Redefine to call arm_function_arg. + (FUNCTION_ARG_PARTIAL_NREGS): Redefine to use correct + structure field. + (INIT_CUMULATIVE_ARGS): Redefine to call + arm_init_cumulative_args. + (FUNCTION_ARG_ADVANCE): Redefine to use correct structure + field. + (SETUP_INCOMING_VARARGS): Redefine to use correct structure + field. + (ARM_MARK_NEARBY_FUNCTION): New macro: Mark already compiled + functions. + (ENCODE_SECTION): Add call to ARM_MARK_NEARBY_FUNCTION. + (VALID_MACHINE_TYPE_ATTRIBUTE): Define. + (COMP_TYPE_ATTRIBUTES): Define. + + * config/arm/arm.md (call): Call arm_is_long_call_p to decide + if a long call is needed. + (call_value): Call arm_is_long_call_p to decide if a long call + is needed. + (call_symbol): Call arm_is_long_call_p to decide if a long call + is needed. + + * config/arm/arm-protos.h: Add prototype for arm_is_long_call_p. + +2000-02-11 Denis Chertykov + + * README.AVR: New file with information about the avr ports. + * config/avr: New directory with avr port files. + +2000-02-11 Andreas Jaeger + + * fixinc/Makefile.in (FIXINC_DEFS): Remove unneeded @fixinc_defs@. + +2000-02-11 Zack Weinberg + + * cpphash.c: Fix formatting, update commentary. + (dump_definition): Take three separate arguments instead of a + MACRODEF structure argument. + * cpphash.h: Update prototype of dump_definition. + * cppinit.c (cpp_finish): Update call of dump_definition. + + * cpplib.c (do_define): Always create new hash entry with + T_MACRO type. Remove redundant check for redefinition of + poisoned identifier. Update call of dump_definition. + (do_undef): Don't call check_macro_name. Rename sym_length to + len. + (do_error, do_warning): Don't use copy_rest_of_line or + SKIP_WHITE_SPACE. + (do_warning): Don't use pedwarn for the actual warning, + only the notice about its not being in the standard. (Fixes + bug with #warning in system headers.) + (do_ident): Stricter argument checking - accept only a single + string after #ident. Also, macro-expand the line. + (do_xifdef): Use cpp_defined. De-obfuscate. + + (do_pragma): Split out specific pragma handling to separate + functions. Use get_directive_token. Update commentary. Do + not pass on #pragma once or #pragma poison to the front end. + (do_pragma_once, do_pragma_implementation, do_pragma_poison, + do_pragma_default): New. + +Feb 11 12:30:53 2000 Jeffrey A Law (law@cygnus.com) + + * jump.c (jump_optimize_1): The first operand in a relational + can be a CONST_INT. + * optabs.c (emit_conditional_move): Handle relationals which + have a known true/false result. + +2000-02-11 Geoff Keating + + * function.c (thread_prologue_and_epilogue_insns): Don't insert + a RETURN insn into a block which already ends with a jump. + +2000-02-11 Geoff Keating + + * haifa-sched.c (BUF_LEN): Increase a lot. + +2000-02-11 Nick Clifton + + * configure.in: Add tm_p_file specification for thumb targets. + * configure: Regenerate. + + * config/arm/thumb-protos.h: New file: Prototypes for exported + functions defined in thumb.c. + +2000-02-11 Robert Lipe + + * Makefile.in (bootstrap-lean): Remove additional files. + (bootstrap2-lean): Likewise. + (VOL_FILES): List of files for above. + +2000-02-11 Nathan Sidwell + + * cpphash.c (special_symbol): Remove spurious argument to + cpp_lookup. + +2000-02-11 Joel Sherrill (joel@OARcorp.com> + + * configure.in: (i*86-*-rtems*): Swapped elf and coff + stanzas. + * configure: Rebuilt. + +2000-02-11 Rodney Brown + + * pa-protos.h: Wrap function_arg_padding in TREE_CODE #ifdef. + +Fri Feb 11 02:59:05 2000 Jeffrey A Law (law@cygnus.com) + + * pa.c, pa.h: Remove trigraph sequences within comments. + +Fri Feb 11 02:51:56 2000 Pavel Roskin + + * invoke.texi (PPC Options): -mno-new-mnenomics -> -mold-mnemonics. + +Fri Feb 11 02:48:30 2000 Brad Lucier (lucier@math.purdue.edu) + + * sbitmap.h: Make SBITMAP_ELT_BITS unsigned. + +2000-02-11 Michael Hayes + + * config/c4x/c4x.c (fp_zero_operand): Check for CONST_DOUBLE. + +2000-02-11 Michael Hayes + + * config/c4x/c4x.h (ASM_GLOBALIZE_LABEL): Use c4x_global_label. + (ASM_OUTPUT_EXTERNAL): Use c4x_external_ref. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. + (ASM_FILE_END): Use c4x_file_end. + * config/c4x/c4x.c (c4x_global_label): New function. + (c4x_external_ref, c4x_file_end): Likewise. + + * config/c4x/c4x-protos.h (c4x_global_label): Add prototype. + (c4x_external_ref, c4x_end_file): Likewise. + +2000-02-10 Zack Weinberg + + * cppexp.c: Don't include cpphash.h. + (parse_charconst, cpp_lex): Use cpp_defined. + (cpp_lex): Use get_directive_token throughout. Remove + unnecessary cases from switch. Move assertion-handling code + down to OTHER case. + (cpp_parse_expr): If we see '+' or '-', check the context to + determine if they are unary or binary operators. Streamline + the jumps a bit. Do not call skip_rest_of_line. + + * cpplib.c: Make skip_rest_of_line and cpp_skip_hspace + static. Export get_directive_token. Update commentary. + (cpp_defined): New function. + (do_define): Remove reference to T_PCSTRING. Call + free_definition to release memory for old definition, when + redefining a macro. + (eval_if_expression): Set only_seen_white to 0 before calling + cpp_parse_expr. Call skip_rest_of_line after it returns. + (cpp_read_check_assertion): Don't preserve a pointer into the + token buffer across a call to cpp_get_token. + + * Makefile.in (cppexp.o): Don't depend on cpphash.h. + * cppfiles.c (redundant_include_p): Use cpp_defined. + * cpphash.c (free_definition): New function. + (delete_macro): Use it. Update commentary. + * cpphash.h: Typedef HASHNODE here. Prototype cpp_lookup and + free_definition. + * cpplib.h: Don't typedef HASHNODE here. Delete T_PCSTRING + from enum node_type. Prototype cpp_defined and get_directive_token. + Don't prototype cpp_lookup, skip_rest_of_line, or cpp_skip_hspace. + + * fix-header.c (check_macro_names): Use cpp_defined. + (read_scan_file): Set inhibit_warnings and inhibit_errors in + the options structure. + +2000-02-10 Franz Sirl + + * c-pragma.c (maximum_field_alignment): Remove duplicate declaration. + +2000-02-10 Jason Merrill + + * dwarf2out.c (add_abstract_origin_attribute): Check TREE_CODE (origin) + rather than die->die_tag. + +Thu Feb 10 16:26:49 2000 Richard Kenner + + * combine.c (make_extraction, force_to_mode): Avoid warning on + mixed-signedness conditionals. + (make_field_assignment, nonzero_bits): Likewise. + * expmed.c (store_fixed_bit_field): ALIGN arg now unsigned. + (store_split_bit_field, extract_split_bit_field): Likewise. + (extract_fixed_bit_field, store_bit_field, + * expr.c: Change alignment to be unsigned everywhere. + (move_by_pieces, store_constructor_field, store_constructor): + Alignment parm is unsigned. + (emit_block_move, emit_group_load, emit_group_store): Likewise. + (clear_storage, emit_push_insn, compare_from_rtx): Likewise. + (do_compare_rtx_and_jump): Likewise. + (move_by_pieces_ninsns, clear_by_pieces): Likewise. + Compare align with GET_MODE_ALIGNMENT. + (expand_expr_unaligned): Pointer to alignment is pointer to unsigned. + (get_inner_reference): Likewise. + (copy_blkmode_from_reg, emit_push_insn): Remove unneeded casts. + (expand_assignment): Local vars for alignment now unsigned. + (store_constructor, store_field, expand_expr, do_jump): Likewise. + (do_compare_and_jump): Likewise. + (store_field): Call new function expr_align. + * expr.h (emit_block_move, emit_group_load, emit_group_store): + Alignment arg now unsigned. + (clear_storage, emit_push_insn, compare_from_rtx): Likewise. + (do_compare_rtx_and_jump, store_bit_field): Likewise. + (extract_bit_field): Likewise. + * fold-const.c (add_double): Add cast to eliminate signedness warning. + * machmode.h (GET_MODE_ALIGNMENT): Result is unsigned. + (get_best_mode): Alignment arg is unsigned. + * rtl.h (move_by_pieces): Likewise. + * store-layout.c (maximum_field_alignment, set_alignment): + Now unsigned. + (layout_decl): Alignment arg is now unsigned. + Remove unneeded casts. + (layout_record, layout_union, layout_type): Remove unneeded casts. + Local alignment variables now unsigned. + (get_best_mode): Alignment arg now unsigned. + * tree.c (expr_align): New function. + * tree.h (expr_align): Likewise. + (maximum_field_alignment, set_alignment): Now unsigned. + (get_inner_reference): Alignment argument is now pointer to unsigned. + * varasm.c (assemble_variable): Add cast to eliminate warning. + +Thu Feb 10 12:56:47 2000 Jim Wilson + + * expmed.c (store_bit_field): If op0 and fieldmode are the same size, + then store directly into op0. + + * calls.c (expand_call): When emitting a NOTE_INSN_SETJMP, search for + the CALL_INSN, and emit the note immediately after it. + +2000-02-10 Nick Clifton + + * config/arm/thumb.md (epilogue): Include a (return) in the + generated insn, and emit it using emit_jump_insn not + emit_insn. + +Thu Feb 10 18:28:59 MET 2000 Jan Hubicka + + * function.c (assign_temp): Change zero-sized arrays to size 1. + * integrate.c (expand_inline_function): Do not update + stack_alignment_needed + * i386.c (compute_frame_size): Remove #ifdef PREFERRED_FRAME_BOUNDARY, + add some sanity checking, remove optimization for function with + zero frame size. + +2000-02-10 Kaveh R. Ghazi + + * flow.c (mark_regs_live_at_end): Delete unused variables. + + * ggc-page.c (ggc_page_print_statistics): bzero -> memset. + + * integrate.c (copy_rtx_and_substitute): Wrap variable `alignment' + in macro FRAME_GROWS_DOWNWARD. + + * stmt.c (expand_end_bindings): Delete unused variable. + + * unroll.c (iteration_info): Mark parameter `loop' with + ATTRIBUTE_UNUSED. + +2000-02-10 Alexandre Oliva + + * fixinc/server.c (load_data): Return NULL if the marker line is + not found. + (run_shell): If load_data returns NULL, retry the command once, in + a new shell. + + * configure: Rebuilt. + +2000-02-09 Bruce Korb + + * gcc/fixincludes: ** DELETED ** + * gcc/fixcpp: ** DELETED ** + * gcc/fixinc-nt.sed: ** DELETED ** + * gcc/just-fixinc: ** DELETED ** + * gcc/Makefile.in: Removed out-dated commentary + * gcc/configure.in: Removed fast-fixincludes disablement. + * MAINTAINERS(Ian Taylor) moved to "Write after approval" group. + +2000-02-09 Clinton Popetz + * function.c (thread_prologue_and_epilogue_insns): Uncomment + last change. + +2000-02-09 Richard Henderson + + * jump.c (delete_insn): Don't delete user labels at -O0. + +2000-02-09 Robert Lipe + + * Makefile.in (gen-protos): Don't depend on HOST_LIBDEPS. + Don't link with HOST_LIBS. + +2000-02-09 Zack Weinberg + + * configure.in: Correct --help text for --with-dwarf2. + Put tm-dwarf2.h after other tm files, if it's requested. + * configure: Regenerate. + * config/tm-dwarf2.h: #undef PREFERRED_DEBUGGING_TYPE before + defining it. + +2000-02-09 Zack Weinberg + + * cpplib.h: Provide HASHNODE typedef and forward decl of + struct hashnode only. Kill cpp_hashnode typedef. MACRODEF, + DEFINITION, struct hashnode, struct macrodef, struct + definition, scan_decls prototype, default defn of + INCLUDE_LEN_FUDGE moved elsewhere. + + * cpphash.h: MACRODEF, DEFINITION, struct macrodef, struct + definition, and struct hashnode moved here. Remove the unused + 'predefined' field from struct definition. Replace the 'args' + union with its sole member. All users updated (cpphash.c). + Delete HASHSTEP and MAKE_POS macros, and hashf prototype. Add + multiple include guard. + + * cpphash.c (hashf): Make static; use better algorithm; drop + HASHSIZE parameter; return an unsigned int. + (cpp_lookup): Drop HASH parameter. PFILE parameter is + used. Calculate HASHSIZE modulus here. + (cpp_install): Drop HASH parameter. Calculate HASHSIZE modulus + here. + (create_definition): Drop PREDEFINITION parameter. + * cpplib.c (do_define): Don't calculate a hash value here. + Don't pass (keyword == NULL) to create_definition. + + * scan.h: Prototype scan_decls here. + * cppfiles.c: Move INCLUDE_LEN_FUDGE default defn here. + * cppexp.c, cppfiles.c, cppinit.c, cpplib.c, fix-header.c: All + callers of cpp_lookup and cpp_install updated. + + * cpphash.c (macarg): Hoist all the flag diddling out of the + function... + (macroexpand): ... and out of the loop that calls macarg. + Skip over the initial paren before macro arguments with + cpp_get_non_space_token; point may be some distance before + that paren. Abort if it's not there. + + * cpplib.c (parse_clear_mark): Delete function. + (parse_set_mark, parse_goto_mark): Make static. + (ACTIVE_MARK_P): New macro. + (skip_block_comment, skip_line_comment): Do not bump the line + if ACTIVE_MARK_P is true. + (cpp_pop_buffer): The buffer to be popped may not have an + active mark. + (cpp_get_token): When looking for the initial paren before + macro arguments, only set a mark in a file buffer, Always + return to that mark before proceeding to call macroexpand or + return a NAME token. + + * cpplib.h: Remove prototypes of parse_set_mark, + parse_clear_mark, parse_goto_mark. + (struct cpp_options): Rename 'put_out_comments' to + 'discard_comments' and invert its sense. + * cppinit.c, cpphash.c, cpplib.c: All users of + put_out_comments changed to use discard_comments, with + opposite sense. + +2000-02-09 Clinton Popetz + + * function.c (thread_prologue_and_epilogue_insns): Don't delete + the edge from a block that both jumps and falls through to the + fallthru block. + +2000-02-09 Scott Bambrough + + * config/arm/arm.md (movsi): In PIC mode, make sure that a + constant source address is legitimate. + +2000-02-09 Philip Blundell + + * config/arm/arm.c (legitimize_pic_address): Handle LABEL_REF + correctly. + + * config/arm/arm.h (LEGITIMATE_CONSTANT_P): Allow anything when + generating PIC. + (LEGITIMATE_PIC_OPERAND): Disallow references to labels. + +2000-02-09 Zack Weinberg + + * cpplib.c (cpp_define, cpp_undef): Make sure the stacked buffer + ends with a newline and a NUL. Don't be so clever manipulating + strings. + +Wed Feb 9 14:18:08 MET 2000 Jan Hubicka + + * reload1.c (reload) Align stack frame to cfun->stack_alignment_needed, + not to BIGGEST_ALIGNMENT. + +2000-02-08 Geoff Keating + + * dwarf2.h (DW_CFA_GNU_negative_offset_extended): New constant. + * dwarf2out.c (dwarf_cfi_name): Print name of new constant. + (reg_save): Use DW_CFA_GNU_negative_offset_extended when needed. + (output_cfi): Handle output of DW_CFA_GNU_negative_offset_extended. + * frame.c (execute_cfa_insn): Handle + DW_CFA_GNU_negative_offset_extended. + +2000-02-08 Richard Henderson + + * flow.c (tidy_fallthru_edges): Split out from ... + (delete_unreachable_blocks): ... here. + (find_basic_blocks): Use it. + +Tue Feb 8 15:51:50 2000 Richard Kenner + + * stmt.c (expand_decl): Do set RTX_UNCHANGING_P for TREE_READONLY. + +2000-02-08 Zack Weinberg + + * Makefile.in (GEN_PROTOS_OBJS): Remove libcpp.a. + (gen_protos.o): Don't depend on cpplib.h or cpphash.h. + (fix-header.o): Don't depend on cpphash.h. + + * scan.c (hashstr): New function. + * scan.h: Prototype it. + * fix-header.c: Don't include cpphash.h. Use hashstr. + * gen-protos.c: Don't include cpphash.h or cpplib.h. Use + hashstr. Report hash table statistics. Add private + definition of xrealloc. + +2000-02-08 Kaveh R. Ghazi + + * i386.h (TARGET_SWITCHES): Fix typo in option name. + +2000-02-08 Clinton Popetz + + * function.c (thread_prologue_and_epilogue_insns): Don't replace + jumps with returns unless they are jumps to the fallthru block. + +Tue Feb 8 07:53:55 2000 Jan Hubicka + + * i386.md (addqi3_cc): Fix constraints. + +Tue Feb 8 01:39:45 2000 Hans-Peter Nilsson + + * function.c (emit_return_into_block): Wrap in #ifdef HAVE_return. + +2000-02-07 Mark Mitchell + + * cpplib.c (cpp_get_token): Call CPP_BUMP_LINE after reading a + carriage return after a macro name. + +2000-02-07 Fred Fish + + * i386/beos-elf.h: (ASM_IDENTIFY_GCC): Define to nothing + so the gcc2_compiled symbol doesn't confuse BeOS debuggers. + +2000-02-07 Zack Weinberg + + * cppfiles.c (deps_output): Count spacers in deps_column. + +2000-02-07 Neil Booth + + * cppinit.c (initialize_dependency_output): If there is no + suffix, don't try to look for known suffixes. Use strrchr. + (cpp_start_read): Remove duplicate initialization. + +Mon Feb 7 18:36:41 MET 2000 Jan Hubicka + + * calls.c (compute_argument_block_size): New argument + preferred_stack_boundary. + (expand_call): update cfun->preferred_stack_boundary, update call of + compute_argument_block_size + (emit_library_call): Increate cfun->preferred_stack_boundary + to PREFERRED_STACK_BOUNDARY + (emit_library_call_value): Likewise. + * explow.c (allocate_dynamic_stack_spave): Likewise. + * function.c (prepare_function_start): Set + cfun->preferred_stack_boundary + * function.h (struct function): Add preferred_stack_boundary field. + * integrate.c (expand_inline_function): Update + cfun->preferred_stack_boundary and cfun->stack_alignment_needed. + (copy_rtx_and_substitute): Align frame to stack_alignment_needed only. + * i386.c (compute_frame_size): Use cfun->preferred_stack_boundary. + +2000-02-06 Zack Weinberg + + * cpplib.c (my_strerror, cpp_error, cpp_error_with_line, + cpp_error_from_errno, cpp_warning, cpp_warning_with_line, + cpp_pedwarn, cpp_pedwarn_with_line, + cpp_pedwarn_with_file_and_line): Move to cpperror.c. + (cpp_print_file_and_line, v_cpp_error, v_cpp_warning, + v_cpp_error_with_line, v_cpp_warning_with_line, + cpp_message_from_errno, cpp_perror_with_name): Delete. + + * cpperror.c (cpp_print_containing_files): Take starting + buffer as argument. + (cpp_file_line_for_message): Rename to cpp_print_file_and_line. + (v_cpp_message): Now called directly by all entry points. + Remove -1 case. + (cpp_pfatal_with_name, cpp_message): Delete. + (cpp_notice_from_errno, cpp_ice): New functions. + (cpp_notice): Is now for reporting error conditions, just + without an associated file. + (cpp_error, cpp_error_with_line): Don't do anything if + opts->inhibit_errors is on. + (cpp_pedwarn_with_file_and_line): Take column argument also. + + * cpplib.h: Update prototypes of exported functions. + (struct cpp_options): Add inhibit_errors. + + * cppalloc.c, cppfiles.c: Use fprintf not cpp_notice for + non-error messages. Include intl.h. + + * cppinit.c, cppmain.c: Likewise. Also, use + cpp_notice_from_errno instead of cpp_perror_with_name or + cpp_pfatal_with_name, and cpp_notice instead of cpp_message. + + * cppexp.c, cpphash.c, cppinit.c, cpplib.c: Use cpp_ice to + report internal errors. + + * cpplib.c (do_define): Switch bcopy to memcpy. + Give cpp_pedwarn_with_file_and_line a dummy column argument. + + * cpplib.c (copy_rest_of_line): Revert previous change: don't + bail out early if we hit a line comment. + +2000-02-06 Richard Henderson + + * flow.c (flow_delete_insn, make_edge, remove_edge): Export. + * basic-block.h: Declare them. + * emit-rtl.h (active_insn_p): New. + (next_active_insn, prev_active_insn): Use it. + * rtl.h: Declare it. + * function.c (emit_return_into_block): New. + (thread_prologue_and_epilogue_insns): Insert return insns instead + of epilogues when possible. + * jump.c (jump_optimize_1): Remove code to insert a return insn + on the fallthru to the exit block. + + * i386.c (ix86_can_use_return_insn_p): Fail for large poped args + and for non-empty stack frames. + * i386.md (return): Expand to return-pop as needed. + +2000-02-06 Richard Henderson + + * simplify-rtx.c (simplify_relational_operation): Canonicalize + constant to op1 for testing. + +2000-02-06 Michael Hayes + + * config/c4x/c4x.md (*ldi_on_overflow): New pattern. + (fixuns_truncqfqi2): Use it. + +2000-02-06 Richard Henderson + + * i386.c (ix86_agi_dependant): Handle pro_epilogue_adjust_stack + as a TYPE_LEA insn. + + * i386.md (widening and peepholes): Mask the constant instead of + using gen_lowpart. + +2000-02-05 Zack Weinberg + + * cppfiles.c (read_and_prescan) [case SPECCASE_QUESTION]: Bump + input pointer before possibly branching off to the backslash + code. + * cpphash.c (macroexpand): Correctly delete \r escapes when + stringifying parameters. + * cpplib.c (copy_rest_of_line): Go directly to skip_block_comment + if we can; bail out early if we hit a line comment. + (handle_directive): Treat '# 123' in an .S file just like + '# '. Discard the shifted '#' if we hit '#\n'. + Return 1 for '# not_a_directive'. + (get_directive_token): Pop macro buffers here, so that + cpp_get_token can't sneakily move past a newline. + Add sanity checks. + (cpp_get_token): goto randomchar if handle_directive returns 0. + + * cppalloc.c: Update copyright. + * cpplib.c: Merge all the static function prototypes into one + block. + * cpplib.h: Remove #if 0 block. + + * cpperror.c: Remove #ifdef EMACS block. + * cppmain.c: Likewise. + * cpphash.c: Remove #if 0 blocks. + * cppinit.c: Remove #if 0 blocks, and the -lint option. + * cpplib.c: Remove #if 0 blocks and code referencing + pcp_inside_if or for_lint. Remove duplicate error message. + Fix error messages for #else after #else or #elif. Reformat. + Remove archaic TODO list. + * cpplib.h: Remove pcp_inside_if and for_lint flags. + +2000-02-05 Zack Weinberg + + * i386/osf1elf.h: Add missing backslash to multiline string. + +2000-02-05 Kaveh R. Ghazi + + * longlong.h [sparc] (udiv_qrnnd): Avoid stringifying macro arg. + +2000-02-05 Kaveh R. Ghazi + + * Makefile.in (c-common.o): Depend on $(EXPR_H). + + * c-common.c: Include expr.h. + + * c-pragma.c (mark_align_stack): Add prototype. + + * caller-save.c (add_stored_regs): Likewise. + + * combine.c (record_promoted_value): Likewise. + + * i386.c (ix86_sched_reorder_pentium, ix86_sched_reorder_ppro): + Likewise. + + * cppinit.c (new_pending_define): Likewise. + + * cpplib.c (skip_block_comment, skip_line_comment): Likewise. + + * dwarf2out.c (save_rtx, splice_child_die, reverse_die_lists, + AT_class, AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, AT_loc, + AT_addr, AT_lbl, get_AT_ref, free_AT, free_die, local_scope_p, + class_scope_p): Likewise. + + * dwarf2out.h (dwarf2out_set_demangle_name_func, + dwarf2out_add_library_unit_info): Likewise. + + * ggc.h (ggc_page_print_statistics): Likewise. + + * haifa-sched.c (propagate_deps): Likewise. + + * reg-stack.c (next_flags_user, record_label_references): Likewise. + + * rtl.h (set_stack_check_libfunc): Likewise. + + * toplev.h (set_fatal_function): Likewise. + + * toplev.c (set_fatal_function): Delete prototype. + + * diagnostic.c: Deconstify functions returning malloc'ed ptrs. + +2000-02-05 Geoff Keating + + * ginclude/ppc-asm.h (FUNC_START): Use USER_LABEL_PREFIX. + (FUNC_END): Likewise. + +2000-02-05 Michael Hayes + + * caller-save.c: Include tm_p.h. + +2000-02-05 Michael Hayes + + * Makefile.in (libgcc.a): Add $(LIBGCC1) to libgcc.a after $(LIBGCC2). + +2000-02-04 Neil Booth + + * cccp.c (main): Check 'dir' for a NULL pointer before passing + it to strcmp. + +2000-02-04 Zack Weinberg + + * recog.h: Remove NO_MD_PROTOTYPES ifdefs. + * genflags.c: Use the max_operand_1 logic from genemit.c to + calculate how many arguments gen_insn prototypes have. Remove + NO_MD_PROTOTYPES ifdefs from the generated file. + * genoutput.c: Don't define NO_MD_PROTOTYPES in the generated + file. Cast gen_insn initializers to insn_gen_fn. + * config/alpha/vms.h: Don't define NO_MD_PROTOTYPES. + * gcc.texi: Remove documentation of NO_MD_PROTOTYPES. + +2000-02-04 Kaveh R. Ghazi + + * fixinc/Makefile.in (HDR): Add machname.h. + (clean): Likewise. + +2000-02-05 Michael Hayes + + * config/c4x/c4x.h (c4x_compare_op0, c4x_compare_op1): Move ... + (c4x_regclass_map, c4x_caller_save_map, c4x_rpts_cycles): Ditto. + (c4x_cpu_version): Ditto. + * config/c4x/c4x-protos.h: ... here. + +2000-02-04 Jason Merrill + + * dwarf2out.c (add_abstract_origin_attribute): Don't call + gen_abstract_function on our context if we're a nested function. + +2000-02-05 Michael Hayes + + * config/c4x/c4x.md (fixuns_truncqfqi2): Rewrite. + * config/c4x/libgcc.S (ufix_truncqfhi2n): Fix. + +2000-02-04 Bruce Korb + + * fixinc/genfixes(machname.h): + Move the functionality from gen-machine.h into this file. + UNdef MN_NAME_PAT if there are no names to change. + Also, be a little kinder when AutoGen is not present. + + * fixinc/Makefile.in(machname.h): + Change the generation rule to use genfixes. + + * fixinc/fixfixes.c(machine_name): + machine_name_fix's functionality now dependent upon whether + MN_NAME_PAT is defined. + + * fixinc/fixtests.c(machine_name): + ditto. + + * fixinc/fixlib.c(mn_get_regexps): conditional on definition + of MN_NAME_PAT. + + * fixinc/fixlib.h(mn_get_regexps): + ditto + + * fixinc/gen-machine.h: DELETED + +2000-02-04 Jan Hubicka + Richard Henderson + + * i386.c (SAVE_REGS_FIRST): Remove. + (ix86_initial_elimination_offset): Handle only SAVE_REGS_FIRST mode. + (ix86_compute_frame_size): Likewise. + (ix86_expand_prologue): Likewise. Use pro_epilogue_adjust_stack. + (ix86_emit_restore_regs): Remove. + (ix86_emit_epilogue_esp_adjustment): Use pro_epilogue_adjust_stack + when a frame pointer is in use. + (ix86_expand_epilogue): Handle only SAVE_REGS_FIRST mode. Use mov + instead of pop to restore a register when profitable; emit leave + when profitable. + (ix86_attr_length_default): Handle pro_epilogue_adjust_stack + as a TYPE_LEA insn. + (ix86_adjust_cost): Handle pro_epilogue_adjust_stack as TYPE_ALU. + * i386.md (prologue_allocate_stack): Remove. + (epilogue_deallocate_stack): Remove. + (pro_epilogue_adjust_stack): New. + +2000-02-04 Richard Henderson + + * function.c (diddle_return_value): Rework to use a callback function. + Use current_function_return_rtx if it's been set up. + (do_clobber_return_reg, clobber_return_register): New. + (do_use_return_reg, use_return_register): New. + (expand_function_end): Use them. + * stmt.c (expand_null_return): Likewise. + * function.h: Declare them. + * flow.c (mark_regs_live_at_end): Use diddle_return_value. + (mark_reg): Change arguments as appropriate for callback. + * integrate.c (expand_inline_function): Revert 19 Jan change. + +Fri Feb 4 20:25:42 2000 Hans-Peter Nilsson + + * tm.texi (Values in Registers): Fix typo: "fo" "for". + (Misc): Say the scheduler, not the Haifa scheduler. + +2000-02-04 Clinton Popetz + + * jump.c (mark_jump_label): Add in_mem param, check SYMBOL_REFs + when in_mem is set. Update all callers. + +2000-02-04 Richard Henderson + + * i386/openbsd.h (INT_ASM_OP): Define. + +Fri Feb 4 10:51:30 2000 Hans-Peter Nilsson + + * tm.texi: Fix various typos. + +Thu Feb 3 17:17:32 2000 Steve Ellcey + + * config/pa/pa-hpux11.h (LIB_SPEC): Correct typo in !p case. + (MD_STARTFILE_PREFIX_1): New macro. + +Thu Feb 3 15:08:13 MET 2000 Jan Hubicka + + * i386.md (movstrsi, clrstrsi): Support variable sized copies, align + destination when needed. + (strmovsi, strsetsi): New expander. + (strmovsi_1, strsetsi_1): New pattern. + * i386.h (MASK_NO_ALIGN_STROP, MASK_INLINE_ALL_STROP, + TARGET_ALIGN_STRINGOPS, TARGET_INLINE_ALL_STRINGOPS): New macros. + (TARGET_SWITCHES) Add align-stringops and inline-all-stringops. + * invoke.texi (align-stringops, inline-all-stringops): Document. + +Wed Feb 2 23:04:47 2000 Krister Walfridsson + + * i386/netbsd.h (INT_ASM_OP): Define. + +2000-02-02 Zack Weinberg + + * cpplib.h (cpp_reader): Add new flag, no_directives. + * cpphash.c (macarg): Set it. + * cpplib.c (handle_directive): If no_directives is on and we + find a directive, issue an error and discard the line. + +Wed Feb 2 13:07:10 2000 Jim Wilson + + * config/sparc/sparc.h (PREFERRED_RELOAD_CLASS): Delete 'E' check for + FP constants. Add ! TARGET_FPU check for FP constants. + +2000-02-02 Clinton Popetz + + * flow.c (find_basic_blocks): Don't kill label_value_list + here. + (cleanup_cfg): Kill it here. + +Wed Feb 2 08:12:30 2000 Richard Kenner + + * expr.c (store_field): Ensure ALIGN is no stricter than the + alignment of EXP. + +2000-02-02 Richard Henderson + + * jump.c (delete_insn): Partially revert 19 Jan change; + don't convert unused code labels to notes at -O0. + +2000-02-02 Herman A.J. ten Brugge + + * toplev.c (rest_of_compilation): Run rebuild_jump_labels after + split_all_insns to recreate REG_LABEL notes for flow2 pass. + +2000-02-01 Richard Henderson + + * i386.c (general_no_elim_operand): New. + (nonmemory_no_elim_operand): New. + (ix86_expand_move): Copy eliminable operands before a push. + * i386-protos.h: Declare new functions. + * i386.h (CAN_ELIMINATE): Simplify. + (PREDICATE_CODES): Update. + * i386.md (push insns): Don't allow eliminable register operands. + +2000-02-01 Richard Henderson + + * flow.c (mark_regs_live_at_end): Follow expand_function_end and + replace BLKmode with DECL_RTL's mode. + +2000-02-01 Zack Weinberg + + * frame.c (find_fde): Convert for loop to do-while so compiler + sees it's always executed at least once. + * libgcc2.c (BBINBUFSIZE): Kill. + (__bb_init_prg): Use fgets. + (__bb_exit_trace_func): Don't paste strings. + * unroll.c (unroll_loop): Initialize unroll_type, not + unroll_number, and tweak logic to match. + + * i386.c (ix86_expand_int_movcc): Add explicit 'return 0' in + all failure paths. + (ix86_flags_dependant): Likewise. Disentangle control flow. + (ix86_sched_reorder): Break guts out to + ix86_sched_reorder_pentium and ix86_sched_reorder_ppro. + (ix86_sched_reorder_ppro): Initialize pair2 and insnp before + any possible use. + + * i386.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Don't + use string concatenation. Don't save and restore esi. + + * fixinc/Makefile.in (fixincl.sh): Don't depend on inclhack.def. + (machname.h): Remove script to separate file. Use two-step + sequence so target is not created if script fails. + * fixinc/gen-machname.h: New file. Handle case where no non-reserved + identifiers are defined. + * fixinc/fixlib.c (mn_get_regexps): Return a flag: if MN_NAME_PAT is + an empty string, machine_name doesn't need to do anything at + all. + (is_cxx_header): Add more cases to regexp. + * fixinc/fixlib.h: Update prototype. + * fixinc/fixtests.c, fixinc/fixfixes.c: Update callers of + mn_get_regexps. + * fixinc/fixincl.c: Define NO_BOGOSITY. + + * fixinc/inclhack.def (no_double_slash, else_endif_label): Ifdef out. + (hp_sysfile): Add missing comma. + (math_exception): Put the wrapper ifdefs at the beginning and + the end of the file. + * fixinc/fixincl.x, fixinc/inclhack.sh: Regenerate. + +2000-02-01 Richard Henderson + + * sparc.c (fp_zero_operand): Turn into a normal predicate. + Use CONST0_RTX. Update all callers. + * sparc.h, sparc-protos.h: Update accordingly. + * sparc.md (fp mov insns): Use fp_zero_operand directly + where applicable. + +Wed Feb 2 02:59:45 2000 Hans-Peter Nilsson + + * tm.texi (Values in Registers): Fix typo in HARD_REGNO_NREGS + example. + +2000-02-01 Kaveh R. Ghazi + + * Makefile.in (specs.ready): New target. + (fixinc.sh): Depend on `specs.ready' instead of `specs'. + +2000-02-01 Kaveh R. Ghazi + + * fixinc.irix: Use unique filenames for writing into /tmp, + * fixinc.ptx: Likewise. + * fixinc.sco: Likewise. + * fixinc.svr4: Likewise. + * fixinc.winnt: Likewise. + +2000-02-01 Kaveh R. Ghazi + + * tsystem.h: New file. + + * Makefile.in (libgcc2.a, stmp-multilib, crtbegin.o, crtend.o, + s-crtS): Depend on tsystem.h. + + * crtstuff.c: Include tsystem.h. + * frame.c: Likewise. + * libgcc2.c: Likewise. + +Tue Feb 1 19:53:27 CET 2000 Jan Hubicka + + * builtins.c (expand_builtin_memset): Expand for variable sized + lengths too. + +2000-02-01 David Billinghurst + + * config/mips/iris6.h (SUBTARGET_ASM_SPEC) : Default ISA based + on ABI. + +Tue Feb 1 00:57:40 2000 Hans-Peter Nilsson + + * dwarfout.c (SHORT_TYPE_SIZE): Correct default. + + * tm.texi (Type Layout): Correct entry for CHAR_TYPE_SIZE. + +2000-01-31 Chandra Chavva + + * combine.c (try_combine) [HAVE_cc0]: Trying to check the missed + case 3->2 combining (combining with splitting) in which 2 is CC0 + setter/user and 3 is user. The rest of cases 2->1 and 3->2 are + checked at the begining of the function with the aid of calling + function 'can_combine_p'. + +2000-01-31 Dave Brolley + + * cccp.c (struct argdata): Redeclare 'newlines' field as 'int'. + +2000-01-31 Jason Merrill + + * jump.c (redirect_jump): Move a NOTE_INSN_FUNCTION_END to the + new label. + +2000-01-31 Kaveh R. Ghazi + + * gansidecl.h (PROTO, VPROTO, PVPROTO): Delete macros. + + * sbitmap.h (sbitmap_first_set_bit, sbitmap_last_set_bit): + PROTO -> PARAMS. + +2000-01-30 Zack Weinberg + + * i386/386bsd.h, i386/beos-pe.h, i386/bsd386.h, i386/crtdll.h, + i386/cygwin.h, i386/dgux.h, i386/djgpp-rtems.h, i386/djgpp.h, + i386/freebsd.h, i386/gnu.h, i386/i386-aout.h, i386/i386-coff.h, + i386/i386-interix.h, i386/i386elf.h, i386/linux.h, i386/lynx-ng.h, + i386/lynx.h, i386/mach.h, i386/mingw32.h, i386/moss.h, + i386/netbsd.h, i386/next.h, i386/openbsd.h, i386/osf1elf.h, + i386/ptx4-i.h, i386/rtems.h, i386/rtemself.h, i386/sco.h, + i386/sequent.h, i386/sun.h, i386/sysv4.h, i386/uwin.h, i386/vsta.h, + i386/vxi386.h, i386/win-nt.h, i386/win32.h: + Remove -Di386 -Acpu(i386) -Amachine(i386) from CPP_PREDEFINES. + + * i386/osf1elf.h, i386/scodbx.h, i386/seq-sysv3.h, i386/sysv5.h: + Add %(cpp_cpu) to CPP_SPEC. + + * i386/osf1elf.h, i386/osfelf.h, i386/osfrose.h: + Add %(cc1_cpu) to CC1_SPEC. + +2000-01-28 Ulrich Drepper + + * c-decl.c (c_decode_option): Accept optional numeric argument to + -Wformat and set warn_format. + * c-common.c: Don't emit warning about non-constant printf format + string unless warn_format > 1. + +2000-01-30 Richard Henderson + + * alpha.md (return_internal): Allow after reload only. + +2000-01-30 Richard Henderson + + * i386.c (ix86_compute_frame_size): Omit padding1 if the + local frame size is zero. + +2000-01-30 Richard Henderson + + * alpha.c (alpha_expand_epilogue): Don't emit the return insn. + * alpha.h (EPILOGUE_USES): New. Mark $26 live. + * alpha.md (return): Turn into an expander. + (return_internal): Don't use $26. + (epilogue): Emit the return insn. + +2000-01-30 Richard Henderson + + * alpha.md (negtf2, abstf2): Fix word order thinko. + (extendsftf2): New. + (trunctfsf2): Avoid intermediate rounding errors. + +2000-01-30 Zack Weinberg + + * cppfiles.c (find_position): Drop 'colp' argument, return the + new line base. + (read_and_prescan): Adjust to match. Don't ever manipulate + line or line_base except via find_position. + +2000-01-29 Zack Weinberg + + * c-parse.in: Apply Ulrich's changes from c-parse.y. + * c-parse.y, objc/objc-parse.y, c-parse.c, objc/objc-parse.c: + Regenerate. + +2000-01-29 Zack Weinberg + + * cpperror.c (cpp_file_line_for_message): If 'line' is zero, + just print "". If 'filename' is null or an + empty string, print "" for the filename. + * cpplib.c (do_define): Don't print the 'location of the + previous definition' message if we're still parsing the + command line. + (cpp_pedwarn_with_file_and_line): Always call + cpp_file_line_for_message. + +2000-01-29 Mark Mitchell + + * flow.c (mark_regs_live_at_end): Fix typo. + +2000-01-28 Ulrich Drepper + + * c-common.c: Adjust variable names, comments, help strings to c99. + * c-lex.c: Likewise. + * c-parse.y: Likewise. + * c-tree.h: Likewise. + * cccp.c: Likewise. + * cpplib.h: Likewise. + * c-decl.c: Likewise. Recognize options with names "*99" as well. + * cppinit.c: Likewise. + +2000-01-29 Herman A.J. ten Brugge + + * c4x.h (INIT_TARGET_OPTABS): Add all missing local optab entries. + * c4x.c: Define the optab rtx values. + (c4x_add_gc_roots): Add the ggc roots for these optab rtx values. + (c4x_emit_libcall): Use new optab rtx values. + (c4x_emit_libcall3): Likewise. + (c4x_emit_libcall_mulhi): Likewise. + * c4x-protos.h: Add prototypes for optab rtx values and change + prototypes for above c4x_emit_libcall functions. + +2000-01-29 Herman A.J. ten Brugge + + * c4x.c (c4x_output_ascii): Restrict line length of output when TI + syntax is used. + (c4x_function_prologue): Use regnames intead of float_reg_names when + TI syntax is used. + (c4x_function_epilogue): Likewise. + (c4x_print_operand): Likewise. + * c4x.h (HOST_WIDE_INT_PRINT_HEX): Redefine. + * c4x.md (set_high): Disable for TARGET_TI. + +2000-01-29 Herman A.J. ten Brugge + + * c4x.h (PREFERRED_RELOAD_CLASS): Change to restrict the reloading + of framepointer + constant to ADDR_REGS class. + * c4x.md (addqi3, addqi3_noclobber_reload): Update. + * c4x.c (std_or_reg_operand): New function. + * c4x-protos.h (std_or_reg_operand): Prototype it. + +2000-01-29 Herman A.J. ten Brugge + + * t-c4x: Change qi,qf,di,df into si,sf,hi,hf to generate same + object names as libgcc2.c. + * libgcc.S: Use newly defined names. + +Fri Jan 7 19:48:04 CET 2000 Jan Hubicka + * sbitmap.c (sbitmap_first_set_bit, sbitmap_last_set_bit): New + function. + * sbitmap.h (sbitmap_first_set_bit, sbitmap_last_set_bit): Declare. + * basic_block.h (FLOW_LOOP_FIRST_BLOCK): New macro. + (FLOW_LOOP_LAST_BLOCK): Likewise. + +2000-01-21 Michael Hayes + + * basic-block.h (struct loop): New fields 'first' and 'last'. + * flow.c (flow_loops_find): Compute loop->first and loop->last. + (flow_loops_dump): Use loop->first to check for NOTE_INSN_LOOP_BEG + and loop->last to check for NOTE_INSN_LOOP_END. + +Fri Jan 28 10:57:58 2000 Jason Eckhardt + + * predict.c (estimate_probability): Use the new FIRST and LAST fields + of the loop descriptor rather than HEADER and LATCH. Also added + missing break statements as well making some coding style modifications + as suggested by Michael Hayes. + +2000-01-28 Richard Henderson + + * flow.c (find_basic_blocks): Remove do_cleanup argument. + Break out that code ... + (cleanup_cfg): ... here. + (commit_one_edge_insertion): Detect a return instruction being + emitted to an edge. Emit a barrier following; clear fallthru. + (commit_edge_insertions): Verify CFG consistency. + * function.c (expand_function_start): Kill unused variable. + (expand_function_end): Likewise. + (thread_prologue_and_epilogue_insns): Use insert_insn_on_edge + to insert the epilogue. + + * gcse.c (gcse_main): Adjust for find_basic_blocks change. + (delete_null_pointer_checks): Likewise. + * output.h: Likewise. + * reg-stack.c (reg_to_stack): Likewise. + * toplev.c (rest_of_compilation): Likewise. Run + thread_prologue_and_epilogue_insns after rebuilding the CFG. + +2000-01-28 Richard Henderson + + * Makefile.in (flow.o): Revert 24 Jan change. + * flow.c (mark_regs_live_at_end): Likewise. Force BLKmode + FUNCTION_VALUE result to DECL_RESULT's mode. + + * haifa-sched.c (schedule_insns): Don't recompute reg info + after reload. + +2000-01-28 Zack Weinberg + + * configure.in: Make --enable-cpplib the default. + * configure: Regenerate. + * gcc.dg/990119-1.c: No longer expected to fail. + +2000-01-28 Bernd Schmidt + + * jump.c (jump_optimize_1): Delete an optimization that is also done + by merge_blocks in flow. + +2000-01-28 Kaveh R. Ghazi + + * diagnostic.c (build_message_string, output_printf, + line_wrapper_printf): Add ATTRIBUTE_PRINTF_*. + (build_location_prefix): Fix non-literal format string. + +2000-01-27 Richard Henderson + + * alpha.md (trunctfsf2): New. + +2000-01-27 Andrew Hobson + + * configure.in (alpha-dec-osf5): Enable MASK_SUPPORT_ARCH. + +2000-01-27 Zack Weinberg + + * cppinit.c (cpp_handle_option): Recognize C++ comments under + -std=gnu89. + * cpplib.c (skip_block_comment, skip_line_comment): Split code + out of... + (skip_comment) ... here. Permit C++ comments in system + headers always. Warn about C++ comments in user code under + -std=gnu89 -pedantic. + (copy_comment): Use skip_comment. + (cpp_skip_hspace, cpp_get_token): skip_comment can no longer + return EOF. + (consider_directive_while_skipping, do_else, do_endif): Call + validate_else unconditionally. + (validate_else): Check CPP_PEDANTIC here. Accept non-comment + text after the conditional in a system header. + * cpplib.h (struct cpp_buffer): Add flag + warned_cplusplus_comments. + +2000-01-27 Geoffrey Keating + + * emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too. + Use unshare_all_rtl_1. + (unshare_all_rtl_again): New function. + (unshare_all_rtl_1): New function split out of unshare_all_rtl. + + * function.c (purge_addressof_1): Use unshare_all_rtl_again + rather than resetting the 'used' flags ourself. + + * toplev.c (rest_of_compilation): Add current_function_decl + to the unshare_all_rtl call. + * tree.h: Prototype unshare_all_rtl. + * rtl.h: Prototype unshare_all_rtl_again here. + +2000-01-27 Geoffrey Keating + + * genoutput.c (output_prologue): Include ggc.h in generated + files. + * Makefile.in (insn-output.o): Depends on ggc.h. + +2000-01-27 Ian Dall + Hans-Peter Nilsson + + * ns32k/xm-ns32k.h (memcpy, memset, memcmp): Delete. + Remove redundant include of xm-ns32k.h. + * ns32k/xm-genix.h (memcpy, memset, memcmp): Add definitions. + Remove redundant include of xm-ns32k.h. + * ns32k/xm-netbsd.h (memcpy, memset, memcmp): No longer undefine. + Remove redundant include of xm-ns32k.h. + * ns32k/netbsd.h (TARGET_DEFAULT): Enable multiply-add instructions. + + * ns32k/ns32k.h: Update comment on multiply-add instructions. + (TARGET_SWITCHES): Add documentation strings. + (DWARF_FRAME_REGNUM): Override default definition. + (REG_CLASS_CONTENTS): Add comments. + (SUBSET_P): Format to reduce line length. + (SMALL_REGISTER_CLASSES): Make a run time option. + (GO_IF_NONINDEXED_ADDRESS): Reformat. + (GO_IF_LEGITIMATE_ADDRESS): Ensure that cfun is non NULL before + dereferencing it. Braces to avoid "ambiguous else" were misplaced. + (regclass_map): fix typo in comment. + * ns32k/ns32k.c: Add spaces before parentheses for consistant style. + Prefer gen_rtx_FOO(...) to gen_rtx(FOO,...). + (trace, reg_or_mem_operand): Delete, unused function. + (calc_address_cost): Small offsets are cheaper than large ones. + (expand_block_move): Generate more efficient code when bytes is a + known at compile time. + * ns32k/ns32k.md: Alternate constraints for multiply-add instructions. + (udivmodsi4, udivmodhi4, udivmodqi4): Use nonimmediate_operand + instead of reg_or_mem_operand. + + * ns32k/ns32k.md: Use nonimmediate_operand or stricter for outputs, + not general_operand. Similarly use "=rm" or stricter, not "=g". + For input operands, use stricter constraints than "g" if not + general_operand. Similarly use stricter predicate than + "general_operand" when stricter constraints than "g" are present, + except for matching constraints. + (movstrsi): Use "memory_operand" for operands 0 and 1. + (truncsiqi2, truncsihi2, trunchiqi2): Remove. + (udivmoddisi4_internal): Use nonimmediate_operand for operand 0, + not reg_or_mem_operand. + (udivmoddisi4): Ditto. + Use nonimmediate_operand for operand 1, not reg_or_mem_operand. + Use nonimmediate_operand for operand 3, not register_operand. + (udivmoddiqi4_internal): Use register_operand for operand 1, not + reg_or_mem_operand. + +2000-01-27 Fred Fish + + * gthr-posix.h: Fix typo; compatibily -> compatibility. + * gthr-single.h: Likewise. + * gthr-solaris.h: Likewise. + * gthr-vxworks.h: Likewise. + * gthr-win32.h: Likewise. + * gthr.h: Likewise. + +2000-01-27 Zack Weinberg + + * cppinit.c: Add " (cpplib)" to end of string printed by + -v / --version. + +2000-01-27 Richard Henderson + + * alpha.c (alpha_emit_conditional_move): Use VOIDmode when + testing for a signed comparison. + (alpha_emit_floatuns): New. + * alpha-protos.h: Declare it. + * alpha.md (floatunsdisf2, floatunsdidf2): New. + (extendsfdf2): Tidy. + +2000-01-27 Jakub Jelinek + + * config/sparc/linux64.h (CC1_SPEC): If compiling -m32 with -g but + no -g option specifying debugging format, default to -gstabs+. + +Wed Jan 26 22:19:14 1999 J"orn Rennecke + + * calls.c (special_function_p): New argument fork_or_exec. + (expand_call): When profile_arc_flag is set and the function + is in the fork_or_exec group, call __bb_fork_func first. + * libgcc2.c, _bb module (__bb_fork_func): New function. + (__bb_exit_func): If fcntl F_SETLKW is available, use it to lock + output file. + * config/svr4.h (TARGET_HAS_F_SETLKW): Define. + * tree.h (special_function_p): Update prototype. + +2000-01-26 Richard Henderson + + * alpha.c (alpha_split_tfmode_pair): New. + * alpha-protos.h: Declare it. + * alpha.md (abstf2, negtf2): New. + (movtf insn): Add input G constraint. + (movtf splitter): Use alpha_split_tfmode_pair. + +2000-01-26 Kaveh R. Ghazi + + * i386/cygwin.h: PROTO -> PARAMS. + +2000-01-26 Jakub Jelinek + + * config/sparc/sparc.c (sparc_emit_float_lib_cmp): Handle + TARGET_ARCH32 again. Handle ORDERED, UN* and LTGT comparisons + using _Qp_cmp/_Q_cmp and testing the return value. + (print_operand): Call reverse_condition_maybe_unordered if + we are handling CCFPmode or CCFPEmode. + Handle ORDERED, UN* and LTGT comparisons. + * config/sparc/sparc.md (cmptf): Use even on TARGET_ARCH32 + if not TARGET_HARD_QUAD. + (seq, sne, sgt, slt, sge, sle, beq, bne, bgt, blt, bge, ble, + bunordered, bordered, bungt, bunlt, buneq, bunge, bunle, bltgt): + Call sparc_emit_float_lib_cmp even on TARGET_ARCH32. + Adjust gen_b* calls so that they reflect return comparison of + sparc_emit_float_lib_cmp. + +2000-01-26 Alexandre Oliva + + * config/alpha/alpha.c (alpha_emit_xfloating_cvt): Do not assume + incoming operands array is large enough for one more operand. + (alpha_emit_xfloating_arith): Likewise. + +2000-01-25 Zack Weinberg + + * fixinc/Makefile.in (machname.h): SunOS 4 sed can't handle a + file with one line and no trailing newline. + Patch by Kaveh Ghazi . + * fixinc/fixtests.c (machine_name_test): Fix fencepost error + checking if the match is on the line. + * fixinc/gnu-regex.c: Provide regerror not __regerror. + +2000-01-25 Richard Henderson + + * sparc.c (output_cbranch): Fix accidental squashing of the + fp branch pre-delay nop. + +2000-01-25 Richard Henderson + + * tree.def (UNNE_EXPR): Remove. + * c-typeck.c (build_binary_op): Don't handle it. + * expr.c (expand_expr, do_jump, do_store_flag): Likewise. + + * rtl.def (UNNE): Remove. + (LTGT): Add. + * jump.c (reverse_condition): Update accordingly. + (swap_condition): Likewise. + (comparison_dominates_p): Handle unordered comparisons. + (reverse_condition_maybe_unordered): New. + * rtl.h (reverse_condition_maybe_unordered): Declare. + + * sparc.c (select_cc_mode): Update for UNNE/LTGT. + (output_cbranch): Use reverse_condition_maybe_unordered and LTGT. + * sparc.h (REVERSIBLE_CC_MODE): Always true. Update docs. + * sparc.md (bltgt): New. + +2000-01-25 Nick Clifton + + * emit-rtl.c (emit_insn): Only check machine class insns for + improper emission of a RETURN. + +2000-01-25 Richard Henderson + + * Makefile.in (flow.o): Depend on $(EXPR_H). + * flow.c (mark_regs_live_at_end): Use hard_function_value, i.e. + duplicate the structure of diddle_return_value for keeping regs live. + +2000-01-26 Michael Hayes + + * loop.c (current_loop_info): Delete. + (consec_sets_invariant_p): Add loop argument, update callers. + (get_condition_for_loop): Likewise. + (count_nonfixed_reads, update_giv_derive): Likewise. + (simplify_giv_expr, general_induction_var): Likewise. + (consec_sets_giv, recombine_givs): Likewise. + (move_movables): Delete loop_start and loop_end arguments, + add loop argument, and update callers. + (find_mem_givs, check_final_value): Likewise. + (record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise. + (loop_invariant_p): Rename from invariant_p, add loop argument, and + update callers. + (basic_induction_var): Add loop argument, delete loop_level argument, + and update callers. + * unroll.c (iteration_info): Delete loop_start and loop_end arguments, + add loop argument, and update callers. + (find_splittable_regs, find_splittable_givs): Likewise. + (reg_dead_after_loop, loop_find_equiv_value): Likewise. + (final_biv_value, final_giv_value, back_branch_in_range_p): Likewise. + (biv_total_increment): Delete loop_start and loop_end arguments; + update callers. + (precondition_loop_p): Delete loop_start and loop_info arguments; + update callers. + * loop.h (get_condition_for_loop): Add loop argument. + (biv_total_increment): Delete loop_start and loop_end arguments. + (precondition_loop_p): Delete loop_start and loop_info arguments; + add loop argument. + (final_biv_value): Delete loop_start and loop_end arguments; + add loop argument. + (final_giv_value, back_branch_in_range_p): Likewise. + +2000-01-25 Gavin Romig-Koch + + * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Fix for mips16. + +2000-01-25 Gavin Romig-Koch + + * Makefile.in (c-gperf.h) : Change the "See" pointer to + point to the new "generated_files" doc. + +2000-01-25 Clinton Popetz + + * config/fp-bit.c (_unord_f2): Fix typo. + +2000-01-25 Zack Weinberg + + * c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c, + c-typeck.c, objc/objc-act.c: Remove all references to obstack + functions obsoleted by GC, such as push_obstacks_nochange, + end_temporary_allocation, savealloc, saveable_tree_cons, etc. + and code which existed only to decide whether or not to call + them. Remove now-unused NESTED argument from start_function; + all callers changed. Do not change behavior based on ggc_p. + The use of the ixp_obstack in c-iterate.c and the util_obstack + in objc/objc-act.c remain; these are not obsoleted by garbage + collection. + * c-tree.h: Update prototype for start_function. + + * c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild. + +2000-01-25 Clinton Popetz + + * config/mips/mips.md (zero_extendsidi2_internal): Disable for + mips16. + +2000-01-25 Richard Henderson + + * sparc-protos.h (select_cc_mode): Declare. + * sparc.c (select_cc_mode): New. Handle unordered compares. + (output_cbranch): Always reverse via code change. Handle + unordered compares. Factor tests and string updates. + * sparc.h (SELECT_CC_MODE): Split out to select_cc_mode. + (REVERSIBLE_CC_MODE): Also exclude CCFPmode. + * sparc.md (bunordered, bordered): New. + (bungt, bunlt, buneq, bunge, bunle): New. + +2000-01-25 Richard Henderson + + * dwarf2out.c (dwarf2out_init): Use ggc_add_rtx_varray_root. + * ggc-common.c (ggc_add_rtx_varray_root): New. + (ggc_mark_rtx_varray): New. + (ggc_mark_rtx_varray_ptr): New. Shift all ggc_mark_foo_ptr + functions down below ggc_mark_foo. + * ggc.h (ggc_add_rtx_varray_root, ggc_mark_rtx_varray): Declare. + +2000-01-25 Richard Henderson + + * alpha.c (secondary_reload_class): Don't allocate a secondary + for integral mode memories into FLOAT_REGS. Rearrange the more + complicated memory expression inward. + +2000-01-25 Zack Weinberg + + * inclhack.def: Fixes to play nicer with FreeBSD, and + corrections to comments. + (cxx_unready): Add select expression. + (irix_sockaddr): Add bypass expression. + (machine_ansi_h_va_list): New fix. + (stdio_va_list): No need to edit _BSD_VA_LIST_. + Split out addition of "#include " to... + (stdio_stdarg_h): ... here. + (systypes_for_aix): Rename to systypes_stdlib_size_t. Apply + to stdlib.h also. Do not munge _BSD_SIZE_T_. + (sysz_stdlib_for_sun): Delete duplicate fix for unprotected + size_t. + (ultrix_ifdef): Tighten up select expression. + + * fixincl.tpl: Exorcise 'exesel'. Rewrite calculations of + re_ct and max_mach to avoid use of shell. Make printed names + match names in inclhack.def. Use static copyright date. + Don't count c_test and test expressions as requiring regex_t + slots. Add some commentary. + * inclhack.tpl: Do not include the 'This script contains N + fixup scripts' line if PROGRAM is defined. Use static + copyright date. + +2000-01-24 Jason Merrill + + * dwarf2out.c: include "varray.h", not dyn-string.h. + (ASM_OUTPUT_DWARF2_ADDR_CONST, ASM_NAME_TO_STRING): Lose. + (addr_const_to_string, addr_to_string): Lose. + (ASM_OUTPUT_DWARF_ADDR_CONST): Copy from dwarfout.c. + (struct dw_val_struct): val_addr is now an rtx. + (add_AT_addr, AT_addr, free_AT, output_aranges): Adjust. + (used_rtx_varray): New varray. + (dwarf2out_init): Initialize it. + (save_rtx): New fn. + (mem_loc_descriptor, add_const_value_attribute): Call it instead of + addr_to_string. + * arm/telf.h, arm/unknown-elf.h, mn10200.h, mn10300.h, + sparc/sp64-elf.h: Remove definition of ASM_OUTPUT_DWARF2_ADDR_CONST. + * Makefile.in (dwarf2out.o): Update dependencies. + +2000-01-24 Richard Henderson + + * i386.c (i386_dwarf_output_addr_const): New. + * i386.h (ASM_OUTPUT_DWARF_ADDR_CONST): New. + + * dwarf2out.c (mem_loc_descriptor): Call ASM_SIMPLIFY_DWARF_ADDR + if defined. + * dwarfout.c (output_mem_loc_descriptor): Likewise. + * i386.c (i386_simplify_dwarf_addr): New. + * i386.h (ASM_SIMPLIFY_DWARF_ADDR): New. + +Mon Jan 24 16:56:10 2000 Jim Wilson + + * dwarf2out.c (gen_struct_or_union_type_die): Set complete if + TYPE_STUB_DECL is NULL. + +2000-01-24 Richard Henderson + + * builtins.c (expand_tree_builtin): Move ... + * c-common.c (expand_tree_builtin): ... here. + +2000-01-25 Michael Hayes + + * loop.h (LOOP_INFO): New accessor macro. + * basic-block.h (struct loop): Rename field `info' to `aux'. + * loop.c (scan_loop): Replace loop->info with LOOP_INFO (loop). + (prescan_loop, strength_reduce, check_dbra_loop, insert_bct): Likewise. + * unroll.c (loop_iterations, unroll_loop): Likewise. + +2000-01-24 Christopher Faylor + + * config/i386/t-cygwin: Accommodate new winsup directory layout + when searching for include files. + +2000-01-24 Richard Henderson + + * rtl.def: Add unordered fp comparisons. + * tree.def: Likewise. + * tree.h: Add ISO C 9x unordered fp comparison builtins. + + * builtins.c (expand_tree_builtin): New function. + * c-typeck.c (build_function_call): Use it. + (build_binary_op): Support unordered compares. + * c-common.c (c_common_nodes_and_builtins): Add unordered compares. + + * combine.c (known_cond): Handle reverse_condition returning UNKNOWN. + (reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed. + * cse.c (fold_rtx): Check FLOAT_MODE_P before reversing. + (record_jump_equiv): Handle reverse_condition returning UNKNOWN. + * jump.c (reverse_condition): Don't abort for UNLE etc, but + return UNKNOWN. + (swap_condition): Handle unordered compares. + (thread_jumps): Check can_reverse before reversing. + * loop.c (get_condition): Likewise. Allow UNORERED/ORDERED to be + reversed for FP. + + * optabs.c (can_compare_p): New argument CODE. Verify branch or + setcc is present before acking for cmp_optab. Update all callers. + (prepare_float_lib_cmp, init_optabs): Handle UNORDERED. + * expmed.c (do_cmp_and_jump): Update for can_compare_p. + * expr.c (expand_expr): Likewise. Support unordered compares. + (do_jump, do_store_flag): Likewise. + * expr.h (enum libfunc_index): Add unordered compares. + + * Makefile.in (FPBIT_FUNCS): Add _unord_sf. + (DPBIT_FUNCS): Add _unord_df. + * config/fp-bit.c (_unord_f2): New. + * fp-test.c (main): Try unordered compare builtins. + + * alpha-protos.h (alpha_fp_comparison_operator): Declare. + * alpha.c (alpha_comparison_operator): Check mode properly. + (alpha_swapped_comparison_operator): Likewise. + (signed_comparison_operator): Likewise. + (alpha_fp_comparison_operator): New. + (alpha_emit_conditional_branch): Handle unordered compares. + * alpha.h (PREDICATE_CODES): Update. + * alpha.md (fp compares): Use alpha_fp_comparison_operator. + (bunordered, bordered): New. + +2000-01-24 Richard Henderson + + * alpha.c (alpha_emit_xfloating_cvt): Thinko in operand manipulation. + * alpha.md (movtf): New expander, insn, and splitter. + +Mon Jan 24 19:49:47 MET 2000 Jan Hubicka + + * reg-stack.c (subst_stack_regs_pat): Handle correctly USEs of + dead registers. + +Mon Jan 24 17:37:31 MET 2000 Jan Hubicka + + * i386.h (FIRST_PSEUDO_REGISTER): Set to 21. + (FIXED_REGISTERS, CALL_USED_REGISTERS, + REG_ALLOC_ORDER): Add frame pointer + (FRAME_POINTER_REGNUM): Set to 20 + (HARD_FRAME_POINTER_REGNUM): New macro. + (ELIMINABLE_REGS): Eliminate ARG_POINTER and FRAME_POINTER + to HARD_FRAME_POINTER. + (REGNO_OK_FOR_BASE_P): Accept FRAME_POINTER_REGNUM + (REG_OK_FOR_INDEX_NONSTRICT_P): Likewise. + (REG_OK_FOR_BASE_NONSTRICT_P): Likewise. + (HI_REGISTER_NAMES): Add "frame". + (CAN_ELIMINATE): Handle FRAME_POINTER_REGNUM elimination. + (debug_reg): Handle FRAME_POINTER_REGNUM. + (reg_class): Add arg pointer and frame pointer to NON_Q_REGS, + GENERAL_REGS and INDEX_REGS. + * i386.c (SAVED_REGS_FIRST): new macro. + (AT_BP): Use hard_frame_pointer_rtx instead of frame_pointer_rtx + (ix86_decompose_address, memory_address_length): Likewise. + (regclass_map): Add frame pointer. + (call_insn_operand): Handle frame_pointer_rtx. + (reg_no_sp_operand): Likewise. + (ix86_decompose_address): Handle frame_pointer_rtx as stack_pointer_rtx. + (print_operand, legitimize_pic_address): Fix formating. + (ix86_compute_frame_size): Make static, update prototype, new + parameters padding1, padding2, use ix86_nsaved_regs, use + stack_alignment_needed. + (ix86_initial_elimination_offset): Handle FRAME_POINTER_REGNUM + to HARD_FRAME_POINTER_REGNUM conversions. + (ix86_expand_prologue): Handle SAVED_REGS_FIRST prologues. + (ix86_expand_epilogue): Handle SAVED_REGS_FIRST epilogues. + (print_reg): Abort on FRAME_POINTER_REGNUM + +Mon Jan 24 16:50:08 MET 2000 Jan Hubicka + + * i386.h (PREDICATE_CODES): Add aligned_operand. + * i386.c (aligned_operand): New function. + (ix86_aligned_p): Kill. + * i386.md (movhi_1): Emit mov for aligned operands. + (promoting peep2s): Use aligned_operand. + +2000-01-23 Zack Weinberg + + * fixinc/fixfixes.c (fix_char_macro_uses): Correct regular + expression to allow underscores in macro names. + (fix_char_macro_defines): Increment scanning pointer. + +2000-01-23 Richard Henderson + + * alpha/osf.h (TARGET_HAS_XFLOATING_LIBS): Define. + * alpha/osf5.h: New file. + * configure.in (alpha-*-osf5): Add it to tm_file. + + * emit-rtl.c (operand_subword): Support TFmode on a 64-bit target. + + * alpha-protos.h (alpha_emit_xfloating_arith): Declare. + (alpha_emit_xfloating_cvt, function_arg): Declare. + * alpha.c (alpha_emit_conditional_branch): Call + alpha_emit_xfloating_compare for TFmode compares. + (alpha_lookup_xfloating_lib_func): New. + (alpha_compute_xfloating_mode_arg): New. + (alpha_emit_xfloating_libcall): New. + (alpha_emit_xfloating_arith): New. + (alpha_emit_xfloating_compare): New. + (alpha_emit_xfloating_cvt): New. + (print_operand): Add default abort case. + (function_arg): Mind FUNCTION_ARG_PASS_BY_REFERENCE. + * alpha.h (TARGET_HAS_XFLOATING_LIBS): New. + (BIGGEST_ALIGNMENT): Increase to 128 bits. + (RETURN_IN_MEMORY): True for TF/TCmode. + (ALPHA_ARG_SIZE): TF/TCmode is passed indirect. + (FUNCTION_ARG): Move to function_arg. + (FUNCTION_ARG_PASS_BY_REFERENCE): New. + (ASM_OUTPUT_LONG_DOUBLE): New. + (ASM_OUTPUT_DOUBLE): Always output bits. + * alpha.md (addtf3, divtf3, multf3, subtf3, cmptf): New. + (fix_trunctfdi2, floatditf2, floatunsditf2): New. + (extenddftf2, trunctfdf2): New. + +2000-01-23 Alexandre Oliva + + * config/sparc/sol2-sld-64.h (TRANSFER_FROM_TRAMPOLINE): Moved... + * config/sparc/sol2.h: ... here. + +2000-01-24 Michael Hayes + + * basic-block.h (struct loops): New field `levels'. + * flow.c (flow_loops_level_compute): Traverse all outer loops. + (flow_loop_level_compute): Initialize level to 1. + (flow_loops_find): Set loops->levels. + (flow_loops_dump): Print loops->levels. + +2000-01-23 Richard Henderson + + * libgcc2.c (dwarf_reg_size_table): Size with DWARF_FRAME_REGISTERS. + (throw_helper): Iterate over DWARF_FRAME_REGISTERS. + +2000-01-23 Richard Henderson + + * i386.c (dbx_register_map, svr4_dbx_register_map): New. + * i386.h (DBX_REGISTER_NUMBER): Use them. + * i386/beos-elf.h, i386/freebsd-elf.h, i386/i386elf.h: Likewise. + * i386/linux.h, i386/osfrose.h, i386/ptx4-i.h: Likewise. + * i386/rtemself.h, i386/sco5.h, i386/sysv4.h: Likewise. + * i386/sequent.h: Kill incorrect comment. + +2000-01-23 Mark Mitchell + + * ggc-page.c (struct page_entry): Make `context_depth' an + `unsigned short'. + (struct globals): Likewise. + +2000-01-23 Clinton Popetz + + * loop.c (check_dbra_loop): When checking a loop for + reversability, check the source of any stores to ensure + they don't depend on an initial value. + +2000-01-23 Michael Hayes + + * config/c4x/c4x.h (ASM_OUTPUT_BSS): Redefine. + +2000-01-22 Zack Weinberg + + * fixinc/fixincl.c: Move declarations of 'pz_fname' and + 'pz_scan' into scope of entire function. Only affects + compiles with -DDEBUG. + +2000-01-22 Alan Modra + + * config/elfos.h (UNIQUE_SECTION): Restore uninitialized data + section naming to that prior to 2000-01-07 patch. + * config/mips/elf.h (UNIQUE_SECTION): Ditto. + * config/mips/elf64.h (UNIQUE_SECTION): Ditto. + * config/mips/iris6gld.h (UNIQUE_SECTION): Ditto. + * config/i386/interix.c (UNIQUE_SECTION): Ditto. + * config/i386/winnt.c (UNIQUE_SECTION): Ditto. + +2000-01-22 Bernd Schmidt + + * config/arm/arm.c (soft_df_operand): Reject SUBREGs containing a + constant. + +2000-01-21 Jim Wilson + + * fixinc/inclhack.tpl: Test for directory before trying to cd into it. + * fixinc/fixincl.sh, fixinc/inclhack.sh: Regenerate. + +2000-01-21 Zack Weinberg + + * cpphash.c (change_newlines): Delete function. + (struct argdata): Delete 'newlines' and 'use_count' fields. + (macroexpand): Remove code referencing those fields. + +2000-01-22 Michael Hayes + + * loop.c (loops_info): New variable. + (loop_optimize): Allocate loops->array and free it on exit. + Allocate memory for loops_info and assign to each loop, + replacing alloca. + (find_and_verify_loops): Do not allocate loops->array. + +2000-01-21 Zack Weinberg + + * fixinc/fixfixes.c (machine_name_fix): Don't free 'scratch'. + +2000-01-21 Jakub Jelinek + + * config/sparc/sparc.md (movsi_pic_label_ref): Avoid creating new + pseudos if expanded after first flow. + (movdi_pic_label_ref): Likewise. + +2000-01-20 Richard Henderson + + * jump.c (jump_optimize_1): Don't do addr_vec optimizations at -O0. + +2000-01-20 Zack Weinberg + + * Makefile.in (fixinc.sh): Depend on specs. + * fixinc/Makefile.in: Add rule to create machname.h. + (fixlib.o): Depend on machname.h. + * fixinc/fixtests.c (machine_name): New test. + * fixinc/fixfixes.c (machine_name): New fix. + * fixinc/fixlib.c (mn_get_regexps): New helper function for + the machine_name test and fix. + * fixinc/fixlib.h: Prototype it. + * fixinc/inclhack.def (machine_name): Use the C test and fix. + * fixinc/fixincl.x, fixinc/inclhack.sh: Rebuild. + + * gcc.c (do_spec_1) [case P]: Take care not to create + identifiers with three leading or trailing underscores. + + * fixinc/Makefile.in (FIXINC_DEFS): Add -DIN_GCC. + (fixincl): Don't specify libraries twice on link line. + (gnu-regex.o): Remove special rule. + * fixinc/gnu-regex.c: Define REGEX_MALLOC if C_ALLOCA was + defined by config.h. Do not define _REGEX_RE_COMP. + (regcomp): Allocate and initialize a fastmap. + * fixinc/gnu-regex.h: Do not define _REGEX_RE_COMP. + +2000-01-20 Brad Lucier + + * Makefile.in (predict.o): Depend on $(EXPR_H), not expr.h. + +2000-01-19 Richard Henderson + + * flow.c (propagate_block): Replace FIRST, LAST and BNUM + arguments with BB. Update all callers. Tidy line wrapping. + +2000-01-19 Clinton Popetz + + * emit-rtl.c (try_split): Return last_insn if we split the + last_insn. + +Thu Jan 20 01:01:23 MET 2000 Jan Hubicka + + * i386-protos.h (ix86_compute_frame_size): Remove prototype. + (ix86_initial_elimination_offset): Declare. + * i386.c (ix86_nsaved_regs): Break out from ... + (ix86_can_use_return_insn_p): ... here. + (ix86_emit_save_regs): Break out from ... + (ix86_expand_prologue): ... here. + (ix86_emit_epilogue_esp_adjustment, ix86_emit_restore_regs): Break + out from ... + (ix86_expand_epilogue): ... here. + (ix86_compute_frame_size): Make static, add prototype. + (ix86_initial_elimination_offset): Break out from ... + * i386.h (INITIAL_ELIMINATION_OFFSET): ... here. + +2000-01-19 Kaveh R. Ghazi + + * recog.h (OUT_FCN): Delete. + + * vax.md: Call `get_insn_template' instead of OUT_FCN. + +2000-01-19 Kaveh R. Ghazi + + * cppalloc.c: PROTO -> PARAMS. + * cpperror.c: Likewise. + * cppfiles.c: Likewise. + * cpplib.c: Likewise. + * cpplib.h: Likewise. + + * config/arm/arm-protos.h: PROTO -> PARAMS. + * config/arm/arm.c: Likewise. + * config/c4x/c4x.c: Likewise. + * config/fr30/fr30-protos.h: Likewise. + * config/nextstep.c: Likewise. + * config/pa/pa.c: Likewise. + * config/pj/pj.c: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/v850/v850-protos.h: Likewise. + * config/v850/v850.c: Likewise. + +2000-01-19 Kaveh R. Ghazi + + * i370-protos.h: New file. + + * i370.c: Include tm_p.h. Fix compile time warnings. + + * i370.h: Move prototypes to i370-protos.h. Fix compile time + warnings. + + * i370.md: Likewise. + +2000-01-19 Kaveh R. Ghazi + + * real.c (enan, einan, eiisnan, eiisneg, make_nan): Wrap in NANS. + (target_isinf, target_isnan, eisnan): Mark parameter with + ATTRIBUTE_UNUSED. + (eiisinf): Wrap in INFINITY. + (etoe113, etoe64, etoe53, etoe24): Wrap label `nonorm' in INFINITY. + (ibmtoe): Remove unused variable `rndsav'. + +Wed Jan 19 20:23:06 2000 J"orn Rennecke + + * sh.h (PASS_IN_REG_P): Remove extraneous paranthesis. + (GO_IF_LEGITIMATE_ADDRESS): Added missing tab. + +2000-01-19 Zack Weinberg + + * fixinc/Makefile.in: Correct dependencies of fixincl and fixincl.o. + * fixinc/fixfixes.c (IO_use, CTRL_use, IO_defn, CTRL_defn): New fixes. + (fix_char_macro_defines, fix_char_macro_uses): New functions. + + * fixinc/fixlib.c (is_cxx_header): Do the text scan with a regexp. + Recognize Emacs mode markers also. + * fixinc/fixtests.c (else_endif_label): Fix bug in recognition of + C++ comments in C++ headers. Call is_cxx_header only if + necessary. + + * fixinc/inclhack.def (avoid_bool): Add select for the problem and + bypass for ncurses. + (bsd43_io_macros, io_def_quotes, ioctl_fix_ctrl): Replace with... + (io_def_quotes, io_use_quotes, ctrl_def_quotes, ctrl_use_quotes): + ... these, which use the new C fixes. + (math_exception): Escape literal '+' in bypass expression. + + * fixinc/fixincl.x, fixinc/fixincl.sh, fixinc/inclhack.sh: + Regenerate. + +2000-01-19 Geoff Keating + + * rtlanal.c (reg_referenced_p): A CLOBBER of a MEM uses any REGs + inside the MEM. + +2000-01-20 Michael Hayes + + * loop.c (loop_optimize): Allocate loop_info structure for each loop + prior to calling scan_loop. + +Wed Jan 19 19:54:38 2000 J"orn Rennecke + + * sh.c (find_barrier, gen_block_redirect): Fix indentation. + (split_branches, calc_live_regs): Likewise. + +Wed Jan 19 19:12:36 2000 J"orn Rennecke + + * sh.md (fpu_single, fp_mode): New attributes. + +2000-01-20 Michael Hayes + + * loop.c (current_loop_info): Renamed from loop_info_data + and changed to a pointer. + (loop_optimize): Allocate loop_info structure for each loop + and initialize to zero. + (scan_loop): Set current_loop_info. + + * unroll.c (loop_iterations): Don't abort if REG_USERVAR_P set + on iteration_var. + +2000-01-19 Richard Henderson + + * stupid.c: Die die die. + * Makefile.in (OBJS): Remove stupid.o. + (stupid.o): Likewise. + + * except.c (emit_eh_context): Don't emit USEs for stupid. + * explow.c (probe_stack_range): Likewise. + * flags.h (obey_regdecls): Remove. + * flow.c (find_basic_blocks): Don't run try_merge_blocks + when not optimizing. + (life_analysis): Limit data collection when not optimizing. + (mark_regs_live_at_end): Always mark the return value registers. + (mark_used_regs): Remove dummy RETURN case. + (print_rtl_with_bb): Don't consult obey_regdecls. + * function.c (use_variable, use_variable_after): Remove. + (assign_parms): Consult optimize not obey_regdecls. + (expand_function_start): Don't emit USEs for stupid. + (expand_function_end): Likewise. + * global.c (build_insn_chain): Export. + * integrate.c (expand_inline_function): Kill return-value USE + handling code. + * jump.c (jump_optimize_1): Do simple jump optimizations and + dead code elimination. + (calculate_can_reach_end): Remove check_deleted argument. + (delete_insn): Patch out insns even when not optimizing. + * local-alloc.c (block_alloc): Don't do tying when not optimizing. + * rtl.h (use_variable, use_variable_after): Remove declarations. + (build_insn_chain): Declare. + * stmt.c (expand_value_return): Don't emit USEs for stupid. + (expand_end_bindings): Likewise. + (expand_decl): Likewise. Consult optimize not obey_regdecls. + * toplev.c (obey_regdecls): Remove. + (rest_of_compilation): Don't set it. Kill stupid in favor of + flow1, local-alloc, and reload. + (main): Don't set obey_regdecls. + + * config/nextstep.c (handle_pragma): Likewise. + + * alpha/alpha.md (allocate_stack): Don't emit USEs for stupid. + + * arm/arm.h (CONDITIONAL_REGISTER_USAGE): Don't fix reg 0 for stupid. + +2000-01-18 Kaveh R. Ghazi + + * alpha-protos.h: PROTO -> PARAMS. + * alpha.c: Likewise. + * elf.h: Likewise. + * h8300.c: Likewise. + * i386-protos.h: Likewise. + * i386.c: Likewise. + * m32r-protos.h: Likewise. + * m32r.c: Likewise. + * mips.c: Likewise. + * mips.md: Likewise. + * gmon-sol2.c: Likewise. + * sparc.c: Likewise. + +2000-01-18 Kaveh R. Ghazi + + * ns32k-protos.h: New file. + + * ns32k.c: Fix compile time warnings. + + * ns32k.h: Move prototypes to ns32k-protos.h. Fix compile time + warnings. + + * ns32k.md: Likewise. + +2000-01-18 Kaveh R. Ghazi + + * vax-protos.h: New file. + + * vax.c: Fix compile time warnings. + + * vax.h: Move prototypes to vax-protos.h. Fix compile time + warnings. + + * vax.md: Likewise. + + * vaxv.md: Likewise. + +2000-01-18 Kaveh R. Ghazi + + * romp-protos.h: New file. + + * romp.c: Fix compile time warnings. + + * romp.h: Move prototypes to romp-protos.h. Fix compile time + warnings. + + * romp.md: Likewise. + +2000-01-18 Kaveh R. Ghazi + + * we32k-protos.h: New file. + + * we32k.c: Fix compile time warnings. + + * we32k.h: Move prototypes to we32k-protos.h. Fix compile time + warnings. + +2000-01-18 Kaveh R. Ghazi + + * calls.c (emit_call_1): Mark parameter with ATTRIBUTE_UNUSED. + + * except.c (eh_regs): Likewise. + + * final.c (output_operand): Likewise. + + * fold-const.c (target_isinf, target_isnan): Likewise. + +Tue Jan 18 16:19:55 MET 2000 Jan Hubicka + + * i386.h (BIGGEST_ALIGNMENT): Set to 128. + (BIGGEST_FIELD_ALIGNMENT): Set to (TARGET_ALIGN_DOUBLE ? 64 : 32) + + * i386.md (memstr): Do not use rep stosb for counts divisible by 4 + when optimize_size. + (clrstrsi): Rewrite. + (strsethi, strsetqi): New expanders. + (strsethi_1, strsetqi_1, rep_stossi, rep_stosqi): New insn patterns. + (cmpstrsi): Emit compare insn before cmpstrsi_1 + (cmpstrsi_nz): use flags, set type to str, prefix_length to 1. + (strlensi_1): Likewise. + (cmpstrsi_1): Likewise; do not output compare. + (strlen expander): Do not unroll when optimizing for size. + (*subsi3_carry): Rename to subsi3_carry + (addqi3_cc): New pattern. + * i386.h (processor_costs): Add move_ratio field. + (MOVE_RATIO): Use move_ratio field, set to 3 for OPTIMIZE_SIZE + * i386.c (*_cost): Set move_ratio. + (x86_unroll_strlen): Enable for Athlon, PPro and K6 too. + (x86_expand_strlensi_1): Rewrite the main loop. + +2000-01-17 Richard Henderson + + * combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode. + * cse.c (find_comparison_args, fold_rtx): Likewise. + * integrate.c (subst_constants): Likewise. + * loop.c (get_condition): Likewise. + + * tm.texi (FLOAT_STORE_FLAG_VALUE): Update docs. + + * alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF. + +2000-01-18 Martin v. Löwis + + * c-parse.in (SAVE_WARN_FLAGS): Create an INTEGER_CST. + (RESTORE_WARN_FLAGS): Unpack it. + Change semantic type of extension to ttype. + * c-common.c (split_specs_attrs): Expect an INTEGER_CST. + * c-parse.y, c-parse.c, objc/objc-parse.y, + objc/objc-parse.c: Regenerate. + +2000-01-17 Zack Weinberg + + * fixinc/fixlib.c: Add copyright notice. + (compile_re): New function. + * fixinc/fixlib.h: Prototype compile_re. + + * fixinc/fixfixes.c, fixinc/fixtests.c, fixinc/fixincl.c: + Use compile_re to compile regular expressions. + + * fixinc/fixincl.c (egrep_test): Don't bother asking regexec + where the pattern matched. + + * fixinc/inclhack.def (sun_memcpy): Move to AAB_sun_memcpy, + use 'replace'. + (ultrix_ansi_compat): Likewise. + (interactv_add1): Rename to 'isc_omits_with_stdc', remove shell test, + add egrep test. + (interactv_add2, interactv_add3): Delete. + (x11_sprintf): Don't use filename glob. + * fixinc/fixincl.x, fixinc/inclhack.sh, fixinc/fixincl.sh: + Regenerate. + +2000-01-17 Kaveh R. Ghazi + + * print-rtl.c: PROTO -> PARAMS. + * real.c: Likewise. + * reg-stack.c: Likewise. + * resource.c: Likewise. + * sdbout.h: Likewise. + * simplify-rtx.c: Likewise. + * stor-layout.c: Likewise. + * stupid.c: Likewise. + * xcoffout.c: Likewise. + * xcoffout.h: Likewise. + +2000-01-17 Kaveh R. Ghazi + + * toplev.c: PROTO -> PARAMS. + * toplev.h: Likewise. + * tree.c: Likewise. + * tree.h: Likewise. + * unroll.c: Likewise. + * varasm.c: Likewise. + * varray.c: Likewise. + * varray.h: Likewise. + +2000-01-17 Kaveh R. Ghazi + + * reload.c: PROTO -> PARAMS. + * reload.h: Likewise. + * reload1.c: Likewise. + * reorg.c: Likewise. + * resource.h: Likewise. + * rtl.c: Likewise. + * rtl.h: Likewise. + * rtlanal.c: Likewise. + * sbitmap.h: Likewise. + * sdbout.c: Likewise. + * stack.h: Likewise. + * stmt.c: Likewise. + * system.h: Likewise. + +2000-01-17 Kaveh R. Ghazi + + * machmode.h: PROTO -> PARAMS. + * mbchar.h: Likewise. + * mips-tdump.c: Likewise. + * mips-tfile.c: Likewise. + * optabs.c: Likewise. + * output.h: Likewise. + * prefix.c: Likewise. + * profile.c: Likewise. + * protoize.c: Likewise. + * real.h: Likewise. + * recog.c: Likewise. + * recog.h: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * regs.h: Likewise. + +2000-01-17 Kaveh R. Ghazi + + * ggc-common.c: PROTO -> PARAMS. + * ggc-page.c: Likewise. + * ggc-simple.c: Likewise. + * ggc.h: Likewise. + * global.c: Likewise. + * graph.c: Likewise. + * gthr-win32.h: Likewise. + * haifa-sched.c: Likewise. + * halfpic.h: Likewise. + * integrate.c: Likewise. + * integrate.h: Likewise. + * jump.c: Likewise. + * lcm.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * loop.h: Likewise. + +2000-01-17 Kaveh R. Ghazi + + * genattr.c: PROTO -> PARAMS. + * genattrtab.c: Likewise. + * gencheck.c: Likewise. + * gencodes.c: Likewise. + * genconfig.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * genflags.c: Likewise. + * gengenrtl.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + +2000-01-16 Mark Mitchell + + * tree.h (BINFO_VPTR_FIELD): Augment documentation. + +2000-01-16 Alexandre Oliva + + * aclocal.m4 (AC_FUNC_MMAP_ZERO): New macro. + * configure.in (AC_FUNC_MMAP_ZERO): Use instead of AC_FUNC_MMAP. + * ggc-page.c: Replace HAVE_MMAP with HAVE_MMAP_ZERO. + * configure, config.in: Rebuilt. + +2000-01-16 Zack Weinberg + + * config/i386/i386.md: Add peephole to merge successive stack + adjusts. + +Sat Jan 15 15:41:14 EST 2000 John Wehle (john@feith.com) + + * gcse.c (insert_insn_end_bb): Use emit_block_insn_before + instead of emit_insn_before. Also handle NOTE_INSN_BASIC_BLOCK + when walking backwards to find all the parameter loads when + the basic block ends in a call. + +2000-01-15 Michael Hayes + + * loop.c (this_loop_info): Delete. + (uid_loop): Add in place of uid_loop_num. All uses updated. + (loop_number_exit_count): Delete and replace with entry in loop + structure. All uses updated. + (loop_number_loop_starts, loop_number_loop_ends): Likewise. + (loop_number_loop_cont, loop_number_cont_dominator): Likewise. + (loop_outer_loop): Likewise. + (loop_invalid, loop_number_exit_labels): Likewise. + (loop_used_count_register): Delete and replace with entry in + loop_info structure. + (find_and_verify_loops): Add loops argument. + (verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start, + loop_end, etc. arguments with loop structure pointer. All callers + changed. + (loop_reg_used_before_p, scan_loop, strength_reduce): Likewise. + (check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise. + (load_mems_and_recount_loop_regs_set, load_mems): Likewise. + (insert_bct): Likewise. + (basic_induction_var): New argument level. + * loop.h (struct loop_info): Delete fields num, loops_enclosed, + vtop, and cont. Add used_count_register. + (uid_loop): Delete declaration. + (loop_number_exit_count): Likewise. + (loop_number_loop_starts, loop_number_loop_ends): Likewise. + (loop_number_loop_cont, loop_number_cont_dominator): Likewise. + (loop_outer_loop, loop_used_count_register): Likewise. + (loop_invalid, loop_number_exit_labels): Likewise. + (unroll_loop): Replace loop_start and loop_end arguments + with loop structure pointer. + (loop_precondition_p, loop_iterations): Likewise. + Include basic-block.h. + * unroll.c: (unroll_loop): Replace loop_start and loop_end arguments + with loop structure pointer. + (loop_precondition_p, loop_iterations): Likewise. + * basic-block.h (struct loop): New entries vtop, cont, + cont_dominator, start, end, top, scan_start, exit_labels, + exit_count. + * Makefile.in (LOOP_H): Add basic-block.h to dependencies. + +2000-01-15 Gerald Pfeifer + + * defaults.h (ASM_OUTPUT_ASCII): Use ISDIGIT. + +2000-01-14 Nathan Sidwell + + * config.in: Rebuilt for 2000-01-13 change to acconfig.h. + +2000-01-14 Kaveh R. Ghazi + + * pdp11-protos.h: New file. + + * pdp11.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * pdp11.h: Move prototypes to pdp11-protos.h. Fix compile time + warnings. + + * pdp11.md: Likewise. + + * 2bsd.h: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * mn10300-protos.h: New file. + + * mn10300.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * mn10300.h: Move prototypes to mn10300-protos.h. Fix compile time + warnings. + + * mn10300.md: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * mn10200-protos.h: New file. + + * mn10200.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * mn10200.h: Move prototypes to mn10200-protos.h. Fix compile time + warnings. + + * mn10200.md: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * h8300-protos.h: New file. + + * h8300.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * h8300.h: Move prototypes to h8300-protos.h. Fix compile time + warnings. + + * h8300.md: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * varasm.c (asm_output_bss): Mark parameters with ATTRIBUTE_UNUSED. + (asm_emit_uninitialised): Likewise. + +2000-01-13 Gavin Romig-Koch + + * config/mips/mips.h (ISA_HAS_INT_CONDMOVE): New. + * config/mips/mips.md: Use ISA_HAS_INT_CONDMOVE. + +2000-01-14 Clinton Popetz + + * config/mips/mips.c (override_options): Don't turn on extra + alignment for mips16. + +2000-01-14 Clinton Popetz + + * config/mips/mips.c (mips_va_arg): Fix fprv for the 32 bit + eabi, and make sure queued POSTINCREMENT rtl is emitted at + the right point. + +2000-01-14 Clinton Popetz + + * builtins.c (PAD_VARARGS_DOWN): Define. + (std_expand_builtin_va_arg): Use the above macro. + * config/mips/mips.h (PAD_VARARGS_DOWN): Define. + * tm.texi (Register Arguments): Document the above macro. + +2000-01-14 Nick Clifton + + * emit-rtl.c (emit_insn): If checking is enabled, make sure + that this function has not been used to emit a jump + instruction. + + * jump.c (return_jump_1): Cope with being passed a null rtx. + +2000-01-14 Kaveh R. Ghazi + + * eh-common.h: PROTO -> PARAMS. + * emit-rtl.c: Likewise. + * errors.c: Likewise. + * errors.h: Likewise. + * except.c: Likewise. + * except.h: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + * final.c: Likewise. + * fix-header.c: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * function.h: Likewise. + * gcc.c: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * sh-protos.h: New file. + + * sh.c: Include insn-config.h, toplev.h, recog.h and tm_p.h. + Add static prototypes. Fix compile time warnings. + + * sh.h: Move prototypes to sh-protos.h. Fix compile time warnings. + * sh.md: Likewise. + * elf.h: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * arc-protos.h: New file. + + * arc.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * arc.h: Move prototypes to arc-protos.h. Fix compile time + warnings. + + * arc.md: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * dsp16xx-protos.h: New file. + + * dsp16xx.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * dsp16xx.h: Move prototypes to dsp16xx-protos.h. Fix compile time + warnings. + + * dsp16xx.md: Likewise. + +2000-01-14 Kaveh R. Ghazi + + * convex-protos.h: New file. + + * convex.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * convex.h: Move prototypes to convex-protos.h. Fix compile time + warnings. + +2000-01-14 Kaveh R. Ghazi + + * elxsi-protos.h: New file. + + * elxsi.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * elxsi.h: Move prototypes to elxsi-protos.h. Fix compile time + warnings. + + * elxsi.md: Likewise. + +2000-01-14 Clinton Popetz + + * config/mips/mips.h (REGISTER_MOVE_COST): Remove redundant + case for moving from HI/LO/HI_LO_REG. This makes the behavior + match the comment for MIPS16. + +Fri Jan 14 00:28:06 2000 Jeffrey A Law (law@cygnus.com) + + * flow.c (split_edge): Do not call set_block_for_insn if we + do not have a basic_block_for_insn structure. + + * fr30.h (TRAMPOLINE_TEMPLATE): Use nops to ensure the static chain + and destination functions are 32bit aligned within the trampoline. + (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes. + (TRAMPOLINE_ALIGNMENT): Define. + + * cse.c (cse_insn): When changing (set (pc) (reg)) to + (set (pc) (label_ref)), verify the change creates a valid insn. + + * fr30.c (call_operand): Tighten and rework to match rules for + call RTL expressions. + * fr30.h (PREDICATE_CODES, case call_operand): Only allow MEMs. + * fr30.md (call patterns): Improve constraints. + +Thu Jan 13 23:44:03 2000 Richard Henderson + + * fr30.c (fr30_expand_epilogue): Revert last change. + Use emit_jump_insn for the return insn. + +Thu Jan 13 14:46:03 2000 Jason Eckhardt + Stan Cox + + * predict.c: New file. Preliminary infrastructure work for static + branch prediction and basic block reordering. + * basic-block.h: Add prototype for estimate_probability. + * Makefile.in: Add rules for predict.o. + +2000-01-13 Jason Merrill + + * fixincludes (va_list): Use __not_va_list__ for the dummy. + * fixinc/*: Likewise. + +2000-01-13 Kaveh R. Ghazi + + * cccp.c: PROTO -> PARAMS. + * cexp.y: Likewise. + * collect2.c: Likewise. + * combine.c: Likewise. + * convert.h: Likewise. + * cse.c: Likewise. + * dbxout.c: Likewise. + * dbxout.h: Likewise. + * diagnostic.c: Likewise. + * doprint.c: Likewise. + * dwarf2out.c: Likewise. + * dwarf2out.h: Likewise. + * dwarfout.c: Likewise. + * dwarfout.h: Likewise. + * dyn-string.h: Likewise. + +2000-01-13 Kaveh R. Ghazi + + * calls.c (emit_call_1): Wrap varaible `struct_value_size_rtx' in + macro conditionals guarding use. + + * dwarf2out.c: Include "tm_p.h". + + * function.c (locate_and_pad_parm): Mark parameter with + ATTRIBUTE_UNUSED. + (expand_function_end): Likewise for variable `context'. + + * reorg.c (make_return_insns): Wrap prototype in macro HAVE_return. + +2000-01-13 Nick Clifton + + * config/fr30/fr30.c (fr30_expand_epilogue): Emit USEs of pop'ed + register to prevent compile time warnings. + +2000-01-13 Zack Weinberg + + * longlong.h [i386] (udiv_qrnnd): Rename 'd' argument to 'dv' + to avoid -Wtraditional warning. + +2000-01-13 Kaveh R. Ghazi + + * 1750a-protos.h: New file. + + * 1750a.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * 1750a.h: Move prototypes to 1750a-protos.h. Fix compile time + warnings. + + * 1750a.md: Likewise. + +2000-01-13 Kaveh R. Ghazi + + * a29k-protos.h: New file. + + * a29k.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * a29k.h: Move prototypes to a29k-protos.h. Fix compile time + warnings. + +2000-01-13 Kaveh R. Ghazi + + * clipper-protos.h: New file. + + * clipper.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * clipper.h: Move prototypes to clipper-protos.h. Fix compile time + warnings. + +Thu Jan 13 16:03:06 2000 J"orn Rennecke + + * reload1.c (reload_combine_note_store): Use HARD_REGNO_NREGS. + +2000-01-13 Nathan Sidwell + + * configure.in (--enable-new-gxx-abi): New option. + * acconfig.h (ENABLE_NEW_GXX_ABI): New define. + * Makefile.in (GXX_ABI_FLAG): New variable. + * configure: Regenerate. + +2000-01-13 Michael Hayes + + * stor-layout.c (layout_type): Use FORCE_STRUCT_BLK. + * tm.texi (FORCE_STRUCT_BLK): Document. + * config/c4x/c4x.h (FORCE_STRUCT_BLK): New macro. + +Wed Jan 12 23:12:47 2000 Hans-Peter Nilsson + + * config/ns32k/ns32k.md: Revert Jan 9 change. + + * genrecog.c (maybe_both_true_2): Do not compare a predicate-test + to a mode-test, if the predicate is address_operand. + +Wed Jan 12 22:34:00 2000 Jeffrey A Law (law@cygnus.com) + + * combine.c (if_then_else_cond): Be careful about what kinds + of RTL expressions are passed to operand_subword. + + * flow.c (split_edge): If we have to insert a new jump, make + sure to associate it with a basic block. + + * flow.c (commit_one_edge_insertion): A block with one successor + can end in a JUMP_INSN that is not a simplejump. + +2000-01-12 Robert Lipe + + * i386/sco5.h (INIT_SECTION_ASM_OP_COFF): Rename section to "ctor". + (BUILD_VA_LIST_TYPE): Define. + (EH_FRAME_SECTION_ASM_OP): Explictly define to better interact + with crtstuff.c. + +2000-01-12 Jason Merrill + + * cccp.c (do_pragma): Add cast to (char *). + +2000-01-12 Richard Henderson + Fred Fish + Jason Merrill + + * configure.in (i?86-*-beos{pe,elf,}*): Recognize. + * i386/t-beos, i386/x-beos, i386/xm-beos.h: New files. + * i386/beos-elf.h, i386/beos-pe.h: New files. + + * Makefile.in (CROSS_SYSTEM_HEADER_DIR): New. + * cross-make (SYSTEM_HEADER_DIR): Define using + CROSS_SYSTEM_HEADER_DIR. + + * gcc.c (LIBRARY_PATH_ENV): Provide default. + (process_command): Use it. + (main): Likewise. Kill trailing = from env vars. + (build_search_list): Put it back. + * collect2.c (main): Use LIBRARY_PATH_ENV. + + * configure.in (GCC_NEED_DECLARATIONS): Add environ. + * toplev.c: Use NEED_DECLARATION_ENVIRON. + + * tm.texi (Frame Layout): Document SMALL_STACK. + * c-common.c (c_common_nodes_and_builtins): Check it. + + * system.h: Undef alloca after including glibc's , + if USE_C_ALLOCA is defined. + + * gcc.c (set_input): New fn. + (main): After all input files are compiled, reset the input file + info to the first. + + * aclocal.m4 (rindex, index): If already defined, don't attempt + to redefine. + + * ginclude/varargs.h: (__va_list__): Define ifndef. + * ginclude/stdarg.h: Likewise. + + * ginclude/stddef.h (__WCHAR_TYPE__) [BEOS]: Use int + instead of unsigned char. + + * hash.h (true, false, boolean): Undef before enum. + + * expmed.c (choose_multiplier): Cast &mhigh_lo and &mhigh_hi to be + proper type of "HOST_WIDE_INT *", rather than their natural type of + "unsigned HOST_WIDE_INT *". + +2000-01-12 Kaveh R. Ghazi + + * svr3.h (ASM_FILE_START): Wrap if-clause in squigly brackets. + + * recog.c (memory_address_p): Mark parameter with ATTRIBUTE_UNUSED. + + * regclass.c (choose_hard_reg_mode): Likewise. + + * reload.c (find_valid_class, strict_memory_address_p): Likewise. + + * reorg.c (optimize_skip): Wrap prototype in macro conditionals. + +2000-01-12 Kaveh R. Ghazi + + * c-common.c: PROTO -> PARAMS. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * c-iterate.c: Likewise. + * c-lang.c: Likewise. + * c-lex.c: Likewise. + * c-lex.h: Likewise. + * c-parse.in: Likewise. + * c-pragma.c: Likewise. + * c-pragma.h: Likewise. + * c-tree.h: Likewise. + * c-typeck.c: Likewise. + * objc/objc-act.c: Likewise. + * objc/objc-act.h: Likewise. + +2000-01-12 Kaveh R. Ghazi + + * m88k-protos.h: New file. + + * m88k.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * m88k.h: Move prototypes to m88k-protos.h. Fix compile time warnings. + + * m88k.md: Likewise. + + * tekXD88.h: Likewise. + +2000-01-12 Kaveh R. Ghazi + + * m68k-protos.h: New file. + + * m68k.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * m68k.h: Move prototypes to m68k-protos.h. Fix compile time warnings. + + * mot3300.h: Likewise. + +2000-01-12 Richard Earnshaw + + * haifa-sched.c (split_edges): Pass edgeset_size as second arg to + extract_bitlst. + (extract_bitlist): Declare bitlen. + +2000-01-12 Zack Weinberg + + * i386/sysv5.h (CPP_SPEC, LIBSPEC): Add -pthreadT. + +2000-01-12 Bernd Schmidt + + * reload1.c (reload_reg_unavailable): New static variable. + (reload_reg_free_p): Test it. + (reload_reg_free_for_value_p): Test it instead of + reload_reg_used. + (choose_reload_regs_init): Compute it. + +Wed Jan 12 03:24:41 2000 Toshiyasu Morita (toshi.morita@sega.com) + + * reorg.c (fill_slots_from_thread): Check modified_in_p + before replacing. + +Wed Jan 12 03:20:31 2000 John Marshall + + * gcc.texi (Funding, GNU/Linux, Copying, Contributors): Format + these nodes even if INTERNALS is not set. + +Wed Jan 12 09:39:22 2000 Nick Burrett + + * gcse.c (delete_null_pointer_checks_1): Cope when + get_condition cannot determine the condition. + +2000-01-12 Gabriel Dos Reis + + * toplev.h (set_message_length): Declare. + + * diagnostic.c (obstack_chunk_alloc): Define macro. + (obstack_chunk_free): Likewise. + (struct output_buffer): New data structure. + (vmessage): Remove. + (output_maximum_width): New variable. + (doing_line_wrapping, set_message_length, init_output_buffer, + get_output_prefix, output_space_left, emit_output_prefix, + output_newline, output_append, output_puts, dump_output, + vbuild_message_string, build_message_string, build_location_prefix, + voutput_notice, output_printf, line_wrapper_printf, + vline_wrapper_message_with_location): New functions. Implement + automatic line wrapping. + (v_message_with_decl): Make it handle automatic line wrapping. + (v_error_with_file_and_line): Likewise. + (v_warning_with_file_and_line): Likewise. + (announce_function): Likewise. + (default_print_error_function): Likewise. + +2000-01-11 16:24 -0800 Zack Weinberg + + * cpplib.h (struct cpp_options): Change lang_asm to char. + Add lang_fortran. + * cppinit.c (builtin_array): Take out __STDC_VERSION__, it's + done in cpp_handle_option now. + (initialize_builtins): Take out special case code used only by + __STDC_VERSION__. + (cpp_handle_option): Turn off trigraphs and trigraph warnings + if -traditional. Recognize -lang-fortran and set + lang_fortran, also turn off cplusplus_comments. + (print_help): Document -lang-fortran. + * cpplib.c (handle_directive): Ignore `# 123 "file"' if + lang_asm. Ignore all directives other than `# 123 "file"' if + CPP_PREPROCESSED. + (cpp_get_token): If -traditional, don't recognize directives + unless the # is in column 1. + (parse_string): If lang_fortran or lang_asm, silently + terminate strings ('' or "") at end of line. + Remove unnecessary braces. + +2000-01-11 Alexandre Oliva + Richard Henderson + + * resource.c (mark_referenced_resources): Mark a set strict_low_part + as used. + * config/i386/i386.c (ix86_expand_setcc): Re-enable clear + set + strict_low_part when possible. + +2000-01-11 Kaveh R. Ghazi + + * alias.c: PROTO -> PARAMS. + * basic-block.h: Likewise. + * bitmap.c: Likewise. + * bitmap.h: Likewise. + * builtins.c: Likewise. + * c-aux-info.c: Likewise. + * caller-save.c: Likewise. + * calls.c: Likewise. + +2000-01-11 Kaveh R. Ghazi + + * Makefile.in (toplev.o): Depend on regs.h. + + * output.h (tdesc_section): Prototype. + + * regclass.c (copy_cost): Mark parameters with ATTRIBUTE_UNUSED. + + * sdbout.c: Include "tm_p.h". + + * toplev.c: Include "regs.h". + +Tue Jan 11 11:37:58 2000 Mike Stump + + * unroll.c (unroll_loop): Add EH support. + +2000-01-11 Kaveh R. Ghazi + + * pa-protos.h: New file. + + * pa.c: Include recog.h and tm_p.h. + (compute_zdepwi_operands, compute_movstrsi_length, + remove_useless_addtr_insns, store_reg, load_reg, set_reg_plus_d, + find_addr_reg, import_milli): Add static prototypes. + (pa_cpu_string, pa_arch_string): Constify a char*. + (legitimize_pic_address): Pass argument `mode' to pic_label_operand. + (read_only_operand): Add argument `mode'. + (singlemove_string, output_move_double, output_fp_move_double, + output_block_move, output_and, output_ior, output_ascii, + remove_useless_addtr_insns, milli_names, output_mul_insn, + output_div_insn, output_mod_insn, output_arg_descriptor, + output_cbranch, output_bb, output_bvb, output_dbra, , + output_millicode_call, output_call, hppa_encode_label, + output_parallel_movb, output_parallel_addb): Constify a char*. + (hppa_va_start): Mark parameter `stdarg_p' with ATTRIBUTE_UNUSED. + (output_parallel_addb): Remove extra arg to `constrain_operands' + + * pa.h: Move all prototypes to pa-protos.h. + (pa_cpu_string, pa_arch_string): Constify a char*. + (LEGITIMIZE_ADDRESS): Call `symbolic_operand' with mode argument. + + * pa.md: Call `function_label_operand' with mode argument. + Likewise for `read_only_operand'. + Fix nesting of parens in call to `symbolic_operand'. + +2000-01-11 Kaveh R. Ghazi + + * i860-protos.h: New file. + + * i860.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * i860.h: Move prototypes to i860-protos.h. Fix compile time warnings. + + * i860.md: Likewise. + +Tue Jan 11 18:59:35 MET 2000 Jan Hubicka + + * i386.md (movstrsi expander): Rewrite. + (movstrsi_1 insn): Deleted. + (strmovhi, strmovqi expander): New expanders. + (movshi_1, movsqi_1, rep_movsi, rep_movqi): New patterns. + * i386.c (x86_single_stringop): New global variable. + * i386.h (x86_single_stringop): Declare. + (TARGET_SINGLE_STRINGOP): New macro. + +2000-01-11 Clinton Popetz + + * config/mips/mips.c (mips_va_arg): For EABI, emit the queued + integer vararg POSTINCREMENT before the destination of the jump + for the hard fp case. + (function_arg_pass_by_reference): Pass a copy of CUM to + FUNCTION_ARG. + + * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Move check + for CONSTANT_ADDRESS_P above while loop for subreg. + +2000-01-11 Clinton Popetz + + * flow.c (propagate_block): When a prologue/epilogue insn + is marked dead, unconditionally clear libcall_is_dead and + insn_is_dead, and only dump rtl if warnings aren't being + suppressed. + +Tue Jan 11 16:26:47 MET 2000 Jan Hubicka + + * i386.c (ix86_attr_length_default): Handle TYPE_STR and TYPE_CLD. + * i386.md (FIRST_PSEUDO_REGISTER): Set to 20. + (FIXED_REGISTERS): Set dirflag as fixed. + (CALL_USED_REGISTERS): Set dirflag as used. + (REG_ALLOC_ORDER): Set dirflag as last one. + (DIRFLAG_REG): New macro. + (MD_ASM_CLOBBERS): Asm clobber dirflag for backward compatibility. + (HI_REGISTER_NAMES): Add dirflag. + (DEBUF_PRINT_REG): Handle dirflag. + * i386.md (type attribute): New cld and str types. + (length_opcode attribute): Set cld and str to 1. + (memory attribute): Set str to unknown - it is not clear from the + patterns. + (pent_np function unit): Prefixed string operations takes 12 cycles + minimally; cld takes 2 cycles. + (ppro_uops attribute): Str is "many" and cld is "few". + (ppro_p0 unit): Handle cld here. + (k6_alux unit): Handle cld and str types. + (k6_load unit): It is ocupied by str opcodes. + (k6_store unit): It is ocupied by str opcodes. + (athlon_decode): Str is vector decoded. + (athlon_ieu): Handle str and cld. + (cld pattern): New. + (movstrsi, clrstr, cmpstr, strlen expander): Emit cld instruction + (movstrsi_1, clrstrsi_1, cmpstrsi_1, strlensi_1, + cmpstrsi_nz_1 insn): Do not output cld instruction + +Tue Jan 11 06:14:39 2000 David Starner + + * gcc.texi (G++ and GCC): Add Java and Chill. + (Bug Critera): Don't list languages. + + * gcc.texi (Incompatibilities): No longer claim most C compilers + are K&R. + + * gcc.texi (G++ and GCC): Update other front-ends list. + +Tue Jan 11 05:49:01 2000 Jeffrey A Law (law@cygnus.com) + + * i386.c (ix86_expand_setcc): Fix typo. + (ix86_expand_movcc): Similarly. + + * Band-aid until haifa's bitset implementation is nuked. + * haifa-sched.c (extract_bitlst): New parameter for size of the + bitset in bits. All callers changed. Avoid looking at undefined + bits in the bitset. + (edgeset_bitsize): New variable. + (schedule_region): Initialize edgeset_bitsize. + +2000-01-10 Kaveh R. Ghazi + + * Makefile.in (optabs.o): Depend on real.h + (resource.o): Depend on insn-attr.h + + * builtins.c (result_vector): Wrap prototype in macro conditions + governing definition and use. + + * c-common.c: Include tm_p.h. + + * c-lex.c: Likewise. + + * elfos.h: Constify a char*. + + * final.c (align_fuzz): Wrap prototype in macro HAVE_ATTR_length. + (get_attr_length, shorten_branches, profile_after_prologue): Mark + parameter with ATTRIBUTE_UNUSED. + + * fold-const.c (exact_real_inverse): Wrap variable `i' in + CHECK_FLOAT_VALUE. + + * haifa-sched.c (schedule_insns): Mark parameter with + ATTRIBUTE_UNUSED. + + * optabs.c: Include real.h. + + * real.h (ereal_atof): Add prototype arguments. + + * resource.c: Include insn-attr.h. + + * sdbout.c (sdbout_queue_anonymous_type, + sdbout_dequeue_anonymous_types): Wrap in macro + SDB_ALLOW_FORWARD_REFERENCES. + (sdbout_init, sdbout_start_new_source_file): Mark parameter with + ATTRIBUTE_UNUSED. + + * stmt.c (expand_return): Wrap variable `op0' in macro HAVE_return. + + * stupid.c: Include tm_p.h. + + * tree.c (real_value_from_int_cst): Mark parameter with + ATTRIBUTE_UNUSED. + +2000-01-10 Kaveh R. Ghazi + + * i960-protos.h: New file. + + * i960.c: Include tm_p.h. Add static prototypes. Fix compile + time warnings. + + * i960.h: Move prototypes to i960-protos.h. Fix compile time warnings. + +2000-01-10 Alexandre Oliva + + * combine.c (expand_field_assignment): Do not discard SUBREGs + while computing nonzero_bits. + +2000-01-09 Nick Clifton + + * config/arm/arm.c: Fix compile time warnings about signed vs + unsigned constants. + * config/arm/arm.h: Fix compile time warnings about signed vs + unsigned constants. + +2000-01-09 Philip Blundell + + * config/arm/arm.c (output_return_instruction): Use `ldr' rather + than `ldm' with only one register. + * config/arm/arm.md (push_multi): Use `str' rather than `stm' with + only one register. + + * config/arm/linux-gas.h (CLEAR_INSN_CACHE): Say that R0 is + clobbered. + +Sun Jan 9 17:50:23 2000 Hans-Peter Nilsson + + * config/ns32k/ns32k.md (load or push effective address): Operand 1 + must have SImode. + +2000-01-09 Kaveh R. Ghazi + + * elfos.h (ASM_OUTPUT_LIMITED_STRING): Add parentheses around + assignment used as truth value. + + * function.c (assign_temp): Mark parameter `dont_promote' with + ATTRIBUTE_UNUSED. Wrap variable `unsignedp' with macro + PROMOTE_FOR_CALL_ONLY. + + * genrecog.c (write_subroutine): Mark variable `operands' with + ATTRIBUTE_UNUSED. + + * optabs.c (prepare_cmp_insn): Mark parameter `align' with + ATTRIBUTE_UNUSED. + + * sdbout.c (sdbout_init): Likewise for parameter `asm_file'. + (sdbout_begin_block, sdbout_end_block): Likewise for `file'. + + * toplev.c (note_deferral_of_defined_inline_function): Likewise + for `decl'. + +2000-01-09 Michael Hayes + + * config/c4x.h: Tidy up comments. + * config/c4x.c: Likewise. + +Sun Jan 9 01:02:55 EST 2000 John Wehle (john@feith.com) + + * fold-const.c (lshift_double, rshift_double): Handle + shifting by 2 * HOST_BITS_PER_WIDE_INT correctly. + +2000-01-08 Alexandre Oliva + + * toplev.c (rest_of_compilation): Initialize cse_not_expected as + in prepare_function_start(). + +Sat Jan 8 12:12:46 2000 Nick Clifton + + * config/v850/v850.c (expand_epilogue): Interrupt functions no + longer allocate extra stack for function calls. + +2000-01-08 Michael Hayes + + * config/c4x/c4x.md (*subqf3_set): Fix typo. + +2000-01-08 Michael Hayes + + * config/c4x/c4x.h (CALLER_SAVE_PROFITABLE): Define as 0. + +2000-01-07 David Edelsohn + + * rs6000.c (processor_target_table): Add power3 as alias for 630. + * aix43.h: Revert Aug 2 change. + (HAS_INIT_SECTION): Define, not visible yet. + (LD_INIT_SWITCH): Define, not visible yet. + * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change. + + * glimits.h (__LONG_MAX__): Recognize 64-bit AIX too. + + * collect2.c (main): Expand ld2 size further. + (export_object_lst): Cast assignment to avoid warning. + (main, LD_INIT_SWITCH): Add AIX 4.2+ -binitfini support. + (scan_prog_file, COFF): Do not collect initialization or + finalization functions generated for entire shared object if + init/fini support present. + +2000-01-07 Nick Clifton + + * config/elfos.h: Tidy up formatting of marcos. Make sure + that .section directives are always prefixed by a tab. + + * config/svr4.h: Add #include "elfos.h" and remove duplicate + definitions. + +2000-01-07 Matt Austern + + * fold-const.c (real_hex_to_f): Remove duplicate declaration of + expon. + +Fri Jan 7 01:55:34 2000 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (crtend.o): Pass @inhibit_libc@ to compilation of + crtstuff.c. + (crtbegin.o, s-crtS): Likewise. + +2000-01-06 Richard Henderson + + * alpha.md (adddi_2+1): Limit offset such that it will be + loadable with a single ldah+lda pair. + (adddi_2+2): Explicitly fail split if we can't make it work. + +2000-01-06 Mumit Khan + + * protoize.c: Conditionally include unistd.h. + (IS_SAME_PATH_CHAR): New macro. + (IS_SAME_PATH): New macro. + (CPLUS_FILE_SUFFIX): New macro. + (cplus_suffix): New static variable. + (is_abspath): New static function. + (in_system_include_dir): Handle DOS style pathnames. + (file_could_be_converted): Likewise. + (file_normally_convertible): Likewise. + (directory_specified_p): Likewise. + (file_excluded_p): Likewise. + (abspath): Likewise. + (shortpath): Likewise. + (referenced_file_is_newer): Likewise. + (save_def_or_dec): Likewise. + (do_processing): Likewise. + (main): Likewise. + (edit_file): Likewise. Use rename instead of link. + (rename_c_file): Likewise. Don't rename syscalls file. + (munge_compile_params): Define null device for DOS based systems. + (process_aux_info_file): Use binary mode if appliable. + (edit_file): Likewise. + * invoke.texi (Running Protoize): Document C++ suffixes used. + + * cccp.c: Delete PATH_SEPARATOR, DIR_SEPARATOR and + IS_DIR_SEPARATOR macros. + * collect2.c: Likewise. + * cppinit.c: Likewise. + * dwarf2out.c: Likewise. + * gcc.c: Likewise. + * gcov.c: Likewise. + * prefix.c: Likewise. + * rtl.c: Likewise. + * toplev.c: Likewise. + * system.h: And move to here. + + * prefix.c (update_path): Fix typo in variable name. + +2000-01-06 Richard Henderson + + * flow.c (mark_set_1): Use loop_depth+1 as reference weight. + (find_auto_inc, mark_used_regs, try_pre_increment_1): Likewise. + (count_reg_sets_1, count_reg_references): Likewise. + (flow_loops_level_compute): Start counting actual loop depth at 1. + (flow_loops_find): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * regclass.c (regclass): Re-instate Jan 4 0-based loop_depth change. + +2000-01-06 Gabriel Dos Reis + + * defaults.h (DWARF_FRAME_REGISTERS): if not defined, default to + FIRST_PSEUDO_REGISTER + * dwarf2out.c: Don't include frame.h + * dwarfout.c: Likewise + * Makefile.in (dwarfout.o, dwarf2out.o): Remove dependence on + frame.h + +Thu Jan 6 13:44:59 CET 2000 Jan Hubicka + + * reg-stack.c (subst_stack_regs_pat): Handle correctly USEs of + dead registers. + + * i386.c (movsf splitter): Fix typo in my last checkin. + +2000-01-05 Nick Clifton + + * varasm.c (IN_NAMED_SECTION): Allow targets to provide their + own definition of this macro. + (asm_emit_uninitialised): Invoke UNIQUE_SECTION if either + flag_data_sections or UNIQUE_SECTION_P are true. + + * tm.texi (UNIQUE_SECTION): Document that it can be called for + uninitialized data decls. + + * config/i386/winnt.c (i386_pe_unique_section): Cope with + being called for uninitialized data. + + * config/i386/interix.c (i386_pe_unique_section): Cope with + being called for uninitialized data. + + * config/mips/elf.h (UNIQUE_SECTION): Cope with being called + for uninitialized data. + + * config/mips/elf64.h (UNIQUE_SECTION): Cope with being called + for uninitialized data. + + * config/mips/iri6gld.h (UNIQUE_SECTION): Cope with being called + for uninitialized data. + + * config/arm/unknown-elf.h (IN_NAMED_SECTION): Define. + (UNIQUE_SECTION_P): Always generate a unique section if + flag_data_sections is true. + (UNIQUE_SECTION): Also generate unique sections for + uninitialized data. + (ASM_OUTPUT_ALIGNED_BSS): Redefine to use named_section(). + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Redefine to use + named_section(). + +2000-01-06 Michael Hayes + + * config/c4x/t-c4x (TARGET_LIBGCC2_CFLAGS): Don't redefine SF, DF, + SI, or DI. + +2000-01-06 Michael Hayes + + * config/c4x/c4x.md (udivqi3, divqi3): Delete. + (umodqi3, modqi3, udivhi3, divhi3, umodhi3, modhi3, ffsqi2): Likewise. + (*smulqi3_highpart_noclobber, *umulqi3_highpart_noclobber): New. + (*lshrqi3_const_noclobber, *lshrqi3_nonconst_noclobber): Likewise. + (*ashrqi3_const_noclobber, *ashrqi3_nonconst_noclobber): Likewise. + + * c4x.h (INIT_TARGET_OPTABS): Define to init libcalls. + +2000-01-05 11:25 -0800 Zack Weinberg + + * c-decl.c (finish_enum): Simplify code to determine minimum and + maximum values of the enum, and calculate the type. Remove check + for FUNCTION_DECLs in the values list, which cannot happen. Replace + the DECL_INITIAL of each enumeration constant with a copy converted + to the enumeration type. When updating variant types, don't bother + updating the type itself. + + * c-typeck.c (build_binary_op): Simplify conditional expressions + when weeding out spurious signed-unsigned warnings. Add new + spurious warning category: if the unsigned quantity is an enum + and its maximum value fits in signed_type(result_type). Update + commentary. + (build_conditional_expr): Warn here if one alternative is signed + and the other is unsigned. + +2000-01-05 Nick Clifton + + * config/fr30/fr30.h: Remove extraneous comments. + +2000-01-05 Bernd Schmidt + + * reload1.c (choose_reload_regs): When disabling a reload, also + set reload_spill_index to -1. + +2000-01-04 Joel Sherrill (joel@OARcorp.com> + + * configure.in (m68*-*-rtemscoff*): New target, formal name for + old m68*-*-rtems*. + (m68*-*-rtemself*): New target. + (mips64orion-*-rtems*): Remove duplicate definition of tm_file. + (sparc*-*-rtemsaout*): New target, formal name for old sparc*-*-rtems*. + (sparc*-*-rtemself*): New target. + (sparc*-*-rtems*): Now elf not a.out. + * config/i386/rtems.h: Include config/rtems.h. + * config/i386/rtemself.h: Include config/rtems.h. + * config/i960/rtems.h: Include config/rtems.h. + * config/m68k/rtems.h: Include config/rtems.h. + * config/m68k/rtemself.h: Include config/rtems.h. + * config/mips/rtems64.h: Include config/rtems.h. + * config/pa/rtems.h: Include config/rtems.h. + * config/rs6000/rtems.h: Include config/rtems.h. + * config/sh/rtems.h: Include config/rtems.h. + * config/sh/rtemself.h: Include config/rtems.h. + * config/sparc/rtems.h: Include config/rtems.h. + * config/sparc/rtemself.h: Include config/rtems.h + +Tue Jan 4 23:59:26 2000 Denis Chertykov + + * final.c (shorten_branches): Correctly compute length of + asms without operands. + +Tue Jan 4 22:55:41 2000 Steve Chamberlain + + * configure.in: Add pj target. + * configure: Regenerate. + * config/pj: New directory. + * config/pj/lib1funcs.S: New file. + * config/pj/linux.h: New file. + * config/pj/pj.c: New file. + * config/pj/pj.md: New file. + * config/pj/pjl.h: New file. + * config/pj/t-pj: New file. + * config/pj/xm-pj.h: New file + +Tue Jan 4 22:30:16 2000 Jeffrey A Law (law@cygnus.com) + + * toplev.c (rest_of_compilation): Run shorten-branches before + reg-stack for now. + +2000-01-05 Michael Hayes + + * config/c4x/c4x.h (IS_XXX_REG, IS_XXX_REGNO): Swap behavior of + macros so that they're consistent with their names. + * config/c4x/c4x.c (IS_XXX_REG, IS_XXX_REGNO): Likewise. + * config/c4x/c4x.md (IS_XXX_REG, IS_XXX_REGNO): Likewise. + +2000-01-05 Michael Hayes + + * config/c4x/c4x.md (*addqi3_noclobber_reload): Ensure that CC never + modified inadvertently. + +2000-01-04 Joel Sherrill + + * configure.in (v850*-*-rtems*): New target. + * configure: Regenerate. + * config/v850/rtems.h: New file. + +2000-01-04 Mumit Khan + + * gthr-win32.h (__gthread_active_p): Support Mingw MT runtime. + (__gthread_key_create): Likewise. + (__gthread_key_dtor): Likewise. + (__gthread_once): Fix logic. + (__gthread_key_delete): Cast away constness. + + * i386/cygwin.h (SUBTARGET_SWITCHES): Add -mthreads option. + * invoke.texi: Document. + * i386/mingw32.h (CPP_SPEC): Use. + (LIBGCC_SPEC): Likewise. + * i386/crtdll.h (LIBGCC_SPEC): Likewise. + +2000-01-04 David Edelsohn + + * rs6000/sysv4.h (ASM_OUTPUT_DEF): Undefine. + (HANDLE_PRAGMA_PACK): Undefine. + (SLOW_UNALIGNED_ACCESS): Define. + +2000-01-04 David Edelsohn + + * expmed.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters + to default definition. + (store_bit_field): Call SLOW_UNALIGNED_ACCESS with mode and alignment. + (store_fixed_bit_field): Call macro with word_mode and alignment. + (extract_bit_field): Call macro with relevant mode and alignment. + * expr.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters + to default definition. + (move_by_pieces): Call SLOW_UNALIGNED_ACCESS with word_mode + and alignment. + (move_by_pieces_ninsns): Likewise. + (clear_by_pieces): Likewise. + (emit_push_insn): Likewise. + (store_field): Call macro with relevant mode and alignment. + (expand_expr): Likewise. + (expand_expr_unaligned): Likewise. + + * rs6000.h (HANDLE_PRAGMA_PACK): Define. + (SLOW_UNALIGNED_ACCESS): Define. + (CASE_VECTOR_MODE): Always use 32-bit offsets. + (ASM_FILE_END): Generate 64-bit symbol in 64-bit mode. + (EXTRA_SECTION_FUNCTIONS): Indent .csect pseudo-op. + (toc_section): Likewise and .toc pseudo-op. + (ASM_DECLARE_FUNCTION): Likewise. Align text more strictly in + 64-bit mode. + (TEXT_SECTION_ASM_OP): Likewise. + (ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use + 32-bit offsets. + + * a29k.h (SLOW_UNALIGNED_ACCESS): Add MODE and ALIGN parameters. + * alpha.h (SLOW_UNALIGNED_ACCESS): Likewise. + * arm/thumb.h (SLOW_UNALIGNED_ACCESS): Likewise. + * gmicro.h (SLOW_UNALIGNED_ACCESS): Likewise. + * fr30.h (SLOW_UNALIGNED_ACCESS): Likewise. + +Tue Jan 4 11:44:13 2000 Jeffrey A Law (law@cygnus.com) + + * regclass.c: Revert my Jan 4 change to loop cost computation. + +Tue Jan 4 19:22:39 MET 2000 Jan Hubicka + + * regclass.c (regclass): Do not obey REG_N_REFS in non-optimizing + compilation. + +2000-01-04 Stan Cox + + * haifa-sched.c (build_control_flow): Change unreachable simple + loop test to check if current block has only one predecessor. + (find_rgns): Initialize degree. Use dest as degree index, not src. + +2000-01-04 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strlen): Initialize variable `icode'. + + * calls.c (expand_call): Likewise for + `old_stack_arg_under_construction'. + + * cpphash.c (macroexpand): Likewise for `args' and `rest_zero'. + + * function.c (pad_to_arg_alignment): Likewise for `save_var' and + `save_constant'. + + * gcc.c (execute): Likewise for `ut' and `st'. + + * genattrtab.c (attr_rtx): Likewise for `rt_val'. + + * genopinit.c (gen_insn): Likewise for `m1', `m2' and `op'. + + * jump.c (jump_optimize_1): Likewise for `temp2'. + + * local-alloc.c (block_alloc): Likewise for `r1'. + + * loop.c (recombine_givs): Likewise for `life_start' and `life_end'. + + * reg-stack.c (check_asm_stack_operands): Likewise for `clobber_reg'. + (subst_asm_stack_regs): Likewise for `clobber_reg' and `clobber_loc'. + + * regmove.c (fixup_match_1): Likewise for `insn_const', `dst_node' + and `set2'. + + * reload.c (find_reloads): Likewise for `goal_alternative_number' + and `goal_earlyclobber'. + + * scan-decls.c (scan_decls): Likewise for `prev_id_end'. + + * sdbout.c (sdbout_one_type): Likewise for `member_scl'. + + * stupid.c (stupid_life_analysis): Likewise for `chain'. + + * unroll.c (copy_loop_body): Likewise for `copy'. + + * varasm.c (output_constructor): Likewise for `byte'. + +Tue Jan 4 15:34:34 MET 2000 Jan Hubicka + + * i386.c (ix86_expand_move): Allow pushes of memory, offload to memory + all FP constants for constant->reg moves. + (ix86_split_to_parts): Try to convert memory address into immediate + when available in the constant pool. + * i386.h (PREFERRED_RELOAD_CLASS): Allow CONST_DOUBLE->integer reg + moves. + (LEGITIMATE_CONSTANT_P): Return 1. + * i386.md (pushsf): New splitter to convert constant pool memory + reference to immediate. + (mov?f): Likewise; do not allow CONST_DOUBLE for reg moves before + reload. + +2000-01-04 Bernd Schmidt + + * i386.md (ashlsi3_cmpno): Don't accept variables shifts. + (ashlhi3_cmpno, ashlqi3_cmpno, ashrsi3_cmpno, ashrhi3_cmpno, + ashrqi3_cmpno, lshrsi3_cmpno, lshrhi3_cmpno, lshrqi3_cmpno): Likewise. + (rotlsi3_cmpno, rotlhi3_cmpno, rotlqi3_cmpno, rotrsi3_cmpno, + rotrhi3_cmpno, rotrqi3_cmpno): Likewise. + +2000-01-04 Martin von Löwis + + * ginclude/stdbool.h: Support compilation as C++. + +Tue Jan 4 01:35:13 2000 J"orn Rennecke + + * fold-const.c (make_range): Don't try to reverse an unbounded range. + +Tue Jan 4 00:18:46 2000 Jeffrey A Law (law@cygnus.com) + + * regclass.c (regclass): Properly compute loop_cost. Adjust + comments. + + * regclass.c: Fix minor whitespace problems. + +2000-01-03 Anthony Green + + * config/i386/i386.md (builtin_setjmp_receiver): New pattern. + Restore the pic register if required. + +2000-01-03 Ulrich Drepper + + * c-common.c (format_char_info): Update comment. + (check_format_info): Recognize 'z' modifier in the same way 'Z' + was recognized. Emit warning for formats new in ISO C99 only + if flag_isoc9x is not set. + +Mon Jan 3 12:59:54 2000 Mark P. Mitchell + + * config/mips/iris6gld.h: Fix typo in -mabi=n32 specs. + +Mon Jan 3 15:33:37 MET 2000 Jan Hubicka + + * combine.c (expand_compound_operation): Do not convert ZERO_EXTEND to + SIGN_EXTEND, convert SIGN_EXTEND to ZERO_EXTEND. + (make_compound_operation): Choose cheaper alternative between + ZERO_EXTEND and SIGN_EXTEND when sign bit is not set. + + * regclass.c (op_costs): Remove global variable. + (record_reg_classes): New parameter "op_costs" and "reg_pref". + (record_operand_costs): Break out from ... + (scan_one_insn): ... here. + (dump_regclass): Make dumps nicer. + (regclass): Dump preferrences choosed and changes done during passes. + +2000-01-03 Jakub Jelinek + + * config/sparc/sparc.c (gen_df_reg): Fix for 32bit SPARC. + +2000-01-03 Jakub Jelinek + + * config/sparc/sparc.c (gen_df_reg): New function. + * config/sparc/sparc-protos.h (gen_df_reg): Add prototype. + * config/sparc/sparc.md (movtf_no_e_insn_sp64+1, + movtf_no_e_insn_sp64+2, movtf_no_e_insn_sp64+3, movtf_cc_sp64+1, + movtf_cc_reg_sp64+1): Use it. + +2000-01-02 Mark Mitchell + + * integrate.c (copy_decl_for_inlining): Clear TREE_ADDRESSABLE on + copied LABEL_DECLs. + +Mon Jan 3 02:54:40 2000 Hans-Peter Nilsson + + * config/i386/i386.c (ix86_expand_unary_operator): Function + definition made void. + (ix86_expand_binary_operator): Update outdated preceding comment. + * config/i386/i386-protos.h (ix86_expand_unary_operator): Update + prototype. + + * config/i386/i386.c (override_options): Fix option-name typo. + +2000-01-02 Mark Mitchell + + * system.h (CEIL): Define. + * builtins.c (CEIL): Remove. + * expmed.c (CEIL): Likewise. + * expr.c (CEIL): Likewise. + * stor-layout.c (CEIL): Likewise. + +2000-01-02 Franz Sirl + + * expr.c (store_constructor_field): Fix typo introduced with last + gcc2 merge. + +2000-01-01 Mark Mitchell + + * tree.h (BINFO_N_BASETYPES): New macro. + +2000-01-01 Bernd Schmidt + + * expmed.c (emit_store_flag): Prevent losing a pending stack + adjust the same way we prevent losing queued increments. diff --git a/contrib/gcc/ChangeLog-2001 b/contrib/gcc/ChangeLog-2001 new file mode 100644 index 00000000000..222975e99b1 --- /dev/null +++ b/contrib/gcc/ChangeLog-2001 @@ -0,0 +1,33645 @@ +2001-12-31 Richard Henderson + + * config/ia64/ia64.c (mark_reg_gr_used_mask): Mind HARD_REGNO_NREGS. + +2001-12-31 Richard Henderson + + * regrename.c (build_def_use): Don't rename asm operands that + were originally hard registers. + (copyprop_hardreg_forward_1): Likewise. + (find_oldest_value_reg): Copy ORIGINAL_REGNO from source. + * varasm.c (make_decl_rtl): Use gen_rtx_raw_REG. Set ORIGINAL_REGNO. + +2001-12-31 Douglas B Rupp + + * config/alpha/vms.h (HAS_INIT_SECTION, NEED_ATEXIT): Remove. + (NAME__MAIN, SYMBOL__MAIN): Define. + +2001-12-31 Richard Henderson + + * cfgrtl.c (delete_insn): Check for not NOTE_INSN_DELETED_LABEL + before decrementing LABEL_NUSES from a jump table. + + * final.c (alter_subreg): Assign REGNO after changing the rtx code. + + * config/alpha/alpha.c (reg_no_subreg_operand): Reject all + non-registers. + +2001-12-31 Graham Stott + + * halfpic.h: Remove foward defs of tree_node and rtx_def. + + * toplev.h: Remove forward def of tree_node, rtx_def. + + * except.h: Remove forward def of tree_node, rtx_def and + define of tree, rtx. Also remove undefs. + + * basic-block.h: Remove forward def of tree_node and + define of tree. + +2001-12-30 Richard Henderson + + * cfglayout.c (scope_def, scope_forest_info, forest, + relate_bbs_with_scopes, make_new_scope, build_scope_forest, + remove_scope_notes, insert_intra_before_1, insert_intra_1, + insert_intra_bb_scope_notes, insert_inter_bb_scope_notes, + rebuild_scope_notes, free_scope_forest_1, dump_scope_forest, + dump_scope_forest_1, get_next_bb_note, get_prev_bb_note): Remove. + (fixup_reorder_chain): Don't set scope for bb. + (insn_scopes, scope_to_insns_initialize, set_block_levels, + change_scope, scope_to_insns_finalize): New. + (cfg_layout_initialize, cfg_layout_finalize): Update to match. + * cfglayout.h (scope_def, scope): Remove. + (reorder_block_def): Remove scope member. + (scope_to_insns_initialize, scope_to_insns_finalize): Declare. + * haifa-sched.c: Revert reemit_other_notes change. + * sched-ebb.c (schedule_ebbs): Don't call remove_unnecessary_notes. + Use scope_to_insns_initialize and scope_to_insns_finalize. + * sched-rgn.c (schedule_insns): Likewise. + +2001-12-31 Graham Stott + + * c-lex.c: Include tree.h before expr.h + + * c-typeck.c: Include rtl.h earlier. + + * tree.h (STRIP_NOPS): Remove extraneous semicolon. + (STRIP_SIGN_NOPS): Likewise. + (STRIP_TYPE_NOPS): Likewise. + (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): Add Parenthesis around + macro paramater. + + * final.c (struct bb_list): Delete. + (struct bb_str): Likewise. + + * cfgloop.c (flow_loop_entry_edges_find): Fix typo. + (flow_loop_exit_edges_find): Likewise. + + * gcse.c (gcse_main): Fix typos. + (alloc_gcse_mem): Likewise. + + * function.h: Remove undefs for rtx and tree. + +2001-12-30 Richard Henderson + + * loop.c (check_dbra_loop): Fix last change: examine both + has_multiple_exit_targets and exit_count. + +2001-12-30 Richard Henderson + + * integrate.c (copy_rtx_and_substitute): Fix error last change: + we need to unconditionally create a new mem. + +2001-12-30 Hans-Peter Nilsson + + * config/mmix/mmix.md ("*call_real"): Fix typo in comment. + * config/mmix/mmix.h (EXTRA_CONSTRAINT): Pass MMIX_REG_OK_STRICT + to mmix_extra_constraint. + * config/mmix/mmix.c (mmix_secondary_reload_class): Only handle + non-global register classes. Mark now unused parameters as such. + (mmix_extra_constraint, 'U'): Use new parameter strict and call + calling memory_operand_p or strict_memory_address_p, not + address_operand. + * config/mmix/mmix-protos.h (mmix_extra_constraint): Add parameter. + +2001-12-30 Kaveh R. Ghazi + + * unroll.c: Move include files above first use of `const'. + +2001-12-30 Jakub Jelinek + + * cfgrtl.c (try_redirect_by_replacing_jump): Allow redirect_jump + to fail if target is EXIT_BLOCK_PTR, die otherwise. + (redirect_edge_and_branch): Likewise. + * cfgcleanup.c (try_forward_edge): Don't force jump redirecting + if target is EXIT_BLOCK_PTR. + +2001-12-29 David Edelsohn + + * gcc.c (init_gcc_spec): Do not link with static libgcc.a if + gcc invoked with -shared. + +2001-12-29 Graham Stott + + * config/i386/i386.c (ix86_asm_dialect): Fix enum type. + + (override_options): Delete abs macro unused. + + (output_pic_addr_const): Use ASM_ATT/ASM_INTEL enumerations + when testing ASSEMBLER_DIALECT. + + (print_reg): Likewise. + (print_operand): Likewise. + (print_operand_address): Likewise. + (print_operand): abort if ASSEMBLER_DIALECT is unknown dialect. + + * config/i386/i386.h (ix86_asm_dialect): Fix enum type. + + (FIND_BASE_TERM): Fix typo. + +Sat Dec 29 15:48:54 2001 Richard Kenner + + * expr.c (store_field): Use adjust_address, not PUT_MODE. + (expand_expr, case VIEW_CONVERT_EXPR): Likewise. + * reload1.c (eliminate_regs, case SUBREG): Likewise, but use + adjust_address_nv. + * varasm.c (make_decl_rtl): Likewise. + * integrate.c (copy_rtx_and_substitute, case MEM): Likewise, but use + replace_equiv_address_nv. + + * varasm.c (decode_addr_const, case INTEGER_CST): Call + output_constant_def instead of looking at TREE_CST_RTL. + + * expr.c (convert_move): If -fforce-mem, force FROM to not be memory. + + * stor-layout.c (layout_decl): Don't misalign field of variable size + for packed record. + + * dwarf2out.c (compute_section_prefix): Avoid cast warning. + (gen_decl_die): Only check DECL_IGNORED_P on decls. + (dwarf2out_decl): Check for DECL_IGNORED_P only when needed. + +2001-12-29 Jakub Jelinek + + * cfglayout.c (insert_intra_before_1): New. + (insert_inter_bb_scope_notes): Emit sibling block notes which don't + span multiple basic blocks. + +2001-12-29 Richard Henderson + + * loop.c (prescan_loop): Set has_multiple_exit_targets for exception + edges. Rearrange jump interpretation code to use pc_set. + (check_dbra_loop): Examine has_multiple_exit_targets not exit_count. + + * sched-deps.c (sched_analyze_insn): Set scheduling barrier for + all insns that can throw, not just if flag_non_call_exceptions. + +2001-12-29 Stan Shebs + + * objc/objc-act.c (STRING_OBJECT_CLASS_NAME): Remove. + (default_constant_string_class_name): New global. + (objc_init): Set it. + (synth_module_prologue): Use it. + + * objc/objc-act.c: Apply various cosmetic and formatting changes. + +2001-12-29 Kazu Hirata + + * config/rs6000/darwin-tramp.asm: Fix comment formatting. + * config/rs6000/freebsd.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + +2001-12-28 Stan Shebs + + * objc/objc-act.c (build_module_descriptor): Make sure the init + function is not deferred. + (build_dispatch_table_initializer): Compute the method encoding if + not already done. + +2001-12-28 Kazu Hirata + + * doc/md.texi: Add @findex define_insn_and_split. + +2001-12-28 Hans Bohem + + * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New. + * config/ia64/unwind-ia64.c (uw_init_context_1): Redo sp, psp, + bsp setup. Set pri_unat_loc to something reasonable. + (uw_install_context): Add missing cast. + (unw_access_gr): Fix off-by-1 indexing error. + +2001-12-28 Kazu Hirata + + * except.c: Fix comment formatting. + * flags.h: Likewise. + * flow.c: Likewise. + * predict.c: Likewise. + * simplify-rtx.c: Likewise. + * system.h: Likewise. + * vmsdbg.h: Likewise. + * vmsdbgout.c: Likewise. + +2001-12-28 Kazu Hirata + + * config/h8300/h8300.md: Fix formatting. + +2001-12-28 Geoff Keating + + * varasm.c (record_constant_1): Correct parameter to recursive + call in default case. + +2001-12-28 Jakub Jelinek + + * config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT, + ASM_OUTPUT_DWARF_PCREL): Define. + * config/sparc/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. + * configure.in (HAVE_AS_SPARC_UA_PCREL): Check whether as supports + .uaword %r_disp32() and linker handles it correctly. + * configure, config.in: Rebuilt. + +2001-12-28 Jakub Jelinek + + * c-typeck.c (store_init_value): If initializing object with array + type of unknown size by a compound literal, set object's size from + compound literal size. + * doc/extend.texi (Compound Literals): Adjust documentation. + +2001-12-28 Richard Henderson + + * real.c (etoe113, toe113): Ifndef INTEL_EXTENDED_IEEE_FORMAT. + (endian): Clear word 3 for INTEL_EXTENDED_IEEE_FORMAT. + (etartdouble): Invoke etoe64 for INTEL_EXTENDED_IEEE_FORMAT. + * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Don't special case + INTEL_EXTENDED_IEEE_FORMAT. + +2001-12-27 Geoff Keating + + * combine.c (try_combine): Mask off sign bits when combining + stores to the low and high parts of a two-word value. + + * expr.c (expand_expr): Don't mark memory for non-constants as + constant. + +Thu Dec 27 20:39:55 2001 Richard Kenner + + * integrate.c (copy_rtx_and_substitute, case MEM): If inlining + and not for LHS, clear RTX_UNCHANGING_P. + +2001-12-28 Philipp Thomas + + * cppfiles.c (stack_include_file): Don't translate . + +2001-12-27 Roger Sayle + + * builtins.c (expand_builtin_memcmp): Optimize memcmp built-in + when all arguments are known constant. Fixes PR opt/3508. + +2001-12-27 Kazu Hirata + + * config/h8300/h8300.md (two anonymous patterns): Remove. + +2001-12-27 Richard Henderson + + * haifa-sched.c (reemit_other_notes): New. + (schedule_block): Use it. + * sched-ebb.c (schedule_ebbs): Call remove_unnecessary_notes. + * sched-rgn.c (schedule_insns): Likewise. + * cfglayout.c (remove_scope_notes): Handle removing note at + the end of the insn chain. + * function.c (debug_find_var_in_block_tree): New. + +2001-12-27 Alan Modra + David Edelsohn + + * config/rs6000/linux64.h (ASM_DECLARE_FUNCTION_NAME): Simplify. + +2001-12-27 Jakub Jelinek + + * toplev.c (independent_decode_option): Re-add -aux-info option + handling. + +Thu Dec 27 09:50:44 2001 Richard Kenner + + * integrate.c (copy_insn_notes): Don't adjust REG_EH_REGION note + if special value. + +2001-12-26 Kaveh R. Ghazi + + * collect2.c (is_ctor_dtor): Const-ify. + * m88k-protos.h (output_file_start): Likewise. + * m88k.c (m88k_lang_independent_options, output_options, + output_file_start): Likewise. + * fix-header.c (files_to_ignore, std_include_entry, include_entry, + std_include_table, main): Likewise. + * protoize.c (longopts): Likewise. + * regclass.c (int_reg_class_contents): Likewise. + * toplev.c (dump_file, f_options, W_options): Make static. + (lang_independent_options, f_options, W_options): Const-ify. + * tree-dump.c (dump_file_info): Likewise. + * unroll.c (_factor): Make static. + +Wed Dec 26 17:55:50 2001 Richard Kenner + + * config/alpha/alpha.c (alpha_align_insns): Remove warning. + + * config/sparc/sparc.md (call struct patterns): Show starting + at two words long. + +2001-12-26 David Edelsohn + + * rs6000.h (ASM_CPU_SPEC, CPP_CPU_SPEC): Add mcpu=405. + * sysv4.h (CPP_SYSV_SPEC, CPP_OS_VXWORKS_SPEC): Add mcpu=405. + +2001-12-26 DJ Delorie + + * function.c (expand_main_function): Make sure stack adjustments + happen before sjlj exception setup. + +2001-12-26 David Edelsohn + + * rs6000.md (indirect_jump): Prefer CTR over LR. + * xcoff.h (ASM_DECLARE_FUNCTION_NAME): Handle weak function. + +Tue Dec 25 12:04:47 2001 Richard Kenner + + * dwarf2out.c: Reformatting and minor code rearrangement. + +2001-12-24 Douglas B. Rupp (rupp@gnat.com) + + * configure.in (quoted_stage_prefix_set_by_configure): Generate. + * configure: Regenerated. + * Makefile.in (SUBDIR_FLAGS_TO_PASS): Use + quoted_stage_prefix_set_by_configure. + +Mon Dec 24 10:24:59 2001 Richard Kenner + + * rtl.h (in_expr_list_p): New declaration. + * rtlanal.c (in_expr_list_p): New function. + * cfgcleanup.c: Reformatting and minor code rearrangement. + * cfglayout.c, cfgloop.c, cfgrtl.c: Likewise. + +2001-12-23 Richard Henderson + + PR c/5163: + * c-decl.c (duplicate_decls): As needed, set DECL_INLINE when + we have a function body associated. Minor cleanups. + (grokdeclarator): Do not set DECL_INLINE without a function body. + +2001-12-23 Richard Henderson + + * stmt.c (resolve_operand_names): Handle operand modifiers. + +2001-12-23 Richard Henderson + + * stmt.c (parse_input_constraint): Break out from ... + (expand_asm_operands): ... here. Loop over the operands twice, + the first time only calling mark_addressable. Correct and simplify + the conditions for spilling an output operand to memory. + +2001-12-23 Richard Henderson + + * config/alpha/alpha.c (call_operand) [OSF]: Disallow virtual regs. + + * config/alpha/alpha.md (UNSPEC_SIBCALL): New. + (sibcall, sibcall_value, sibcall_osf_1_er, sibcall_osf_1): Use it. + (sibcall_value_osf_1_er, sibcall_value_osf_1): Likewise. + +2001-12-23 Joseph S. Myers + + * c-typeck.c (c_start_case): Don't strip conversions from the + controlling expression. Partially fixes PR c/2454. + +2001-12-23 Joseph S. Myers + + * Makefile.in (USER_H): Remove proto.h. + * config.gcc (c*-convex-*): Set extra_headers=proto.h. + +2001-12-23 Kaveh R. Ghazi + + * arc.c (arc_hard_regno_mode_ok): Const-ify. + * arc.h (arc_hard_regno_mode_ok): Likewise. + * i386.c (x86_64_reg_class_name): Make static. + * m68k.c (regno_reg_class): Const-ify. + * m68k.h (regno_reg_class): Likewise. + * mcore.c (reg_class_from_letter): Likewise. + * mcore.h (reg_class_from_letter): Likewise. + * sh.c (reg_class_from_letter, ashiftrt_insns, shift_insns, + ext_shift_insns, ext_shift_amounts): Likewise. + * sh.h (reg_class_from_letter): Likewise. + * sparc.c (hard_regno_mode_classes, hard_32bit_mode_classes, + hard_64bit_mode_classes): Likewise. + * sparc.h (hard_regno_mode_classes): Likewise. + + * gcc.c (modify_target): Make static. + * gengenrtl.c (defs, formats): Likewise. + * reload1.c (elim_table_1, init_elim_table): Const-ify. + * tradcpp.c (directive, directive_table, handle_directive, + skip_if_group, run_directive): Likewise. + +2001-12-23 Richard Henderson + + * calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for + an invalid result register; do end the sequence properly. + (emit_library_call_value_1): Likewise. + +2001-12-22 Aldy Hernandez + + * config/rs6000/rs6000.h (rs6000_builtins): Add vsldoi variants. + + * config/rs6000/rs6000.md ("altivec_vsldoi_*"): Same. + + * config/rs6000/rs6000.c: Clean up some spacing and indentation. + (altivec_init_builtins): Add tree types for builtins with 4 bit + literals. + (bdesc_3arg): Add vsldoi variants. + +2001-12-22 Kaveh R. Ghazi + + * 1750a.h (datalbl, jmplbl): Declare array size explicitly. + * a29k.h (a29k_debug_reg_map): Likewise. + * arc.h (arc_regno_reg_class): Likewise. + * c4x-protos.h (c4x_regclass_map, c4x_caller_save_map): Likewise. + * convex.h (regno_reg_class, reg_class_from_letter): Likewise. + * d30v.h (regno_reg_class, reg_class_from_letter): Likewise. + * i386.h (regclass_map): Likewise. + * m32r.h (m32r_hard_regno_mode_ok, m32r_punct_chars): Likewise. + * mcore.h (regno_reg_class): Likewise. + * mips.h (mips_print_operand_punct, mips_char_to_class): + Likewise. + * ns32k.h (regclass_map): Likewise. + * pj.h (pj_debugreg_renumber_vec): Likewise. + * s390.h (regclass_map): Likewise. + * sh.h (regno_reg_class): Likewise. + * sparc.h (sparc_regno_reg_class): Likewise. + + * hard-reg-set.h (reg_class_contents): Likewise. + * machmode.h (class_narrowest_mode): Likewise. + +2001-12-22 David Edelsohn + + * loop.c (scan_loop, move_movables, count_one_set): Do not + overlook hard registers when computing statistics. + +Sun Dec 23 00:49:37 CET 2001 Jan Hubicka + + * calls.c (ECF_LIBCALL_BLOCK): New constant. + (emit_call_1, initialize_argument_information, + precompute_arguments, expand_call, + emit_library_call_value_1): Use ECF_LIBCALL_BLOCK + instead of ECF_PURE | ECF_CONST. Honnor LCT_CONST/LCT_PURE. + +2001-12-22 Joseph S. Myers + + * config.gcc (extra_headers): Move settings to math-68881.h and + ppc-asm.h to common code for CPU types. Use math-68881.h on all + m68k targets. + (header_files): Remove unused setting. + +2001-12-22 Kaveh R. Ghazi + + * elxsi.c: Include "hard-reg-set.h" and/or don't declare + `call_used_regs' explicitly. + * i860.c: Likewise. + * m68k.c: Likewise. + * ns32k.c: Likewise. + * pa.c: Likewise. + * vax.c: Likewise. + * we32k.c: Likewise. + +Fri Dec 21 23:30:14 CET 2001 Jan Hubicka + + * i386.h (TARGET_CPU_DEFAULT_pentium_mmx): New. + (TARGET_CPU_DEFAULT_*): Renumber. + +Sat Dec 22 12:20:20 EST 2001 John Wehle (john@feith.com) + + * rtl.h (subreg_lsb): Declare. + * rtlanal.c (subreg_lsb): Implement. + +Sat Dec 22 08:59:50 2001 Richard Kenner + + * predict.c: Reformatting and minor cleanups. + * cfg.c, cfganal.c, cfgbuild.c: Likewise. + + * expr.c (expand_expr, case ADDR_EXPR): Handling taking address of + SAVE_EXPR. + * function.c (gen_mem_addressof): Add missing tests for SAVE_EXPR. + (put_addressof_into_stack): Clarify code in setting of used_p. + + * calls.c (flags_from_decl_or_type): Move ECF_SP_DEPRESSED here. + (expand_call): Delete from here. + Do pending stack adjustments if ECF_SP_DEPRESSED. + + * dwarf2out.c (save_rtx): Deleted. + (mem_loc_descriptor): Do equivalent operation. + (add_const_value_attribute, case CONST): Likewise. + (add_name_and_src_coords_attributes): Likewise. + +2001-12-21 Kazu Hirata + + * config/h8300/h8300.h: Fix comment formatting. + +Fri Dec 21 17:30:15 2001 Jeffrey A Law (law@redhat.com) + + * pa.h (CPP_SPEC): If not in ANSI mode, define _INCLUDE_LONGLONG. + (CPLUSPLUS_CPP_SPEC): Define _INCLUDE_LONGLONG. + +2001-12-21 Robert Lipe + + * system.h (PREFETCH): Explictly undefine. + +2001-12-21 Richard Henderson + + * c-parse.in (SAVE_WARN_FLAGS): Save warn_traditional. + (RESTORE_WARN_FLAGS): Restore it. + (extension): Zero warn_traditional. + +2001-12-21 Kazu Hirata + + * doc/passes.texi: Fix a typo. + +2001-12-21 Kazu Hirata + + * config/h8300/h8300.h: Fix a comment typo. + +2001-12-21 Jakub Jelinek + + * combine.c (nonzero_bits): If using reg_nonzero_bits, + we don't know anything about bits outside of X mode. + (num_sign_bit_copies): Likewise. + +2001-12-21 Nick Clifton + + * config/arm/arm.md (prefetch): Use 'a' operand code. + +2001-12-20 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_PROG_GNAT): Run prospective ada drivers in + subshells. + * configure.in: Likewise for perl Pod::Man. + + * configure: Regenerated. + +2001-12-20 Kaveh R. Ghazi + + * builtin-attrs.def (__builtin_printf_unlocked, + __builtin_fprintf_unlocked, printf_unlocked, fprintf_unlocked): + Mark with the __printf__ attribute. + + * builtins.c (expand_builtin_fputs): Add an `unlocked' parameter + and set the replacement function depending on it. + (expand_builtin): Skip BUILT_IN_*_UNLOCKED when not optimizing. + Handle BUILT_IN_*_UNLOCKED when optimizing. + + * builtins.def (DEF_EXT_FALLBACK_BUILTIN, + DEF_EXT_FRONT_END_LIB_BUILTIN): New macros. + Declare the "unlocked" stdio functions. + + * c-common.c (c_expand_builtin_printf, c_expand_builtin_fprintf): + Add an `unlocked' parameter and set the replacement function + depending on it. + (c_expand_builtin): Handle BUILT_IN_PRINTF_UNLOCKED and + BUILT_IN_FPRINTF_UNLOCKED. + + * doc/extend.texi (printf_unlocked, fprintf_unlocked, + fputs_unlocked): Document. + +2001-12-20 Josef Zlomek + + * cfgloop.c (flow_loops_find): Use the information of the depth + first search order of the CFG correctly when finding natural loops. + +2001-12-20 Richard Henderson + + * config/alpha/alpha.md (prologue_mcount): Update for explicit relocs. + +2001-12-20 Richard Henderson + + * config/alpha/alpha.c (call_operand) [OSF]: Accept pseudos. + * config/alpha/alpha.md (call_osf, call_value_osf): Don't force + operand into $27. + +2001-12-20 Joseph S. Myers + + * configure.in (all_headers, all_lib2funcs): Remove. + * configure: Regenerate. + * Makefile.in (LANG_EXTRA_HEADERS): Remove. + (USER_H): Don't include $(LANG_EXTRA_HEADERS). + * config/alpha/t-interix (USER_H): Don't include + $(LANG_EXTRA_HEADERS). + * config/i386/t-interix: Likewise. + * config/t-openbsd: Likewise. + +2001-12-20 Andreas Jaeger + + * libgcc2.c (__bb_exit_func): Remove unused variable. + (num_digits): Remove unused function. + +2001-12-20 Alan Shieh + + * config/arm/arm.c (arm_output_epilogue): Changed IP restore + to use ldmfd instead of ldmea. + * config/arm/arm.c (arm_compute_initial_elimination_offset): + Modified to reflect behavior of arm_expand_prologue when generating + interrupt handlers + +2001-12-20 Nick Clifton + + * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): New + function. Compute which of registers r0 through r12 should be + saved onto the stack during a function's prologue. + (arm_compute_save_reg_mask): Use + arm_compute_save_reg0_reg12_mask. + (arm_compute_initial_elimination_offset): Use + arm_compute_save_reg0_reg12_mask. + + (arm_expand_prologue): Do not mark as save of the IP register + for an interrupt handler as being part of the frame creation + code. + +2001-12-20 Richard Henderson + + * varasm.c (assemble_real): Use REAL_VALUE_TO_x and assemble_integer + to emit floating point values. + (assemble_real_1): Remove. + + * 1750a/1750a.c (real_value_to_target_single): New. + (real_value_to_target_double): New. + * 1750a/1750a.h (TARGET_FLOAT_FORMAT): New. + (REAL_VALUE_TO_TARGET_SINGLE): New. + (REAL_VALUE_TO_TARGET_DOUBLE): New. + * 1750a/1750a-protos.h: Update. + + * 1750a/1750a.h, a29k/a29k.h, alpha/alpha.h, alpha/unicosmk.h, + alpha/vms.h, arc/arc.h, arm/aof.h, arm/aout.h, avr/avr.c, + avr/avr.h, c4x/c4x.h, clipper/clix.h, convex/convex.h, cris/cris.h, + d30v/d30v.h, dsp16xx/dsp16xx.c, dsp16xx/dsp16xx.h, elxsi/elxsi.h, + fr30/fr30.h, h8300/h8300.h, i370/i370.h, i386/i386.h, i386/i386elf.h, + i386/next.h, i386/ptx4-i.h, i386/sysv4.h, i860/fx2800.h, i860/i860.h, + i860/paragon.h, i860/sysv4.h, i960/i960-protos.h, i960/i960.c, + i960/i960.h, ia64/ia64.h, m32r/m32r.h, m68hc11/m68hc11.c, + m68hc11/m68hc11.h, m68k/3b1.h, m68k/altos3068.h, m68k/crds.h, + m68k/dpx2.h, m68k/hp320.h, m68k/m68k.h, m68k/mot3300.h, m68k/news.h, + m68k/next.h, m68k/next21.h, m68k/sgs.h, m68k/sun2o4.h, m68k/sun3.h, + m68k/tower-as.h, m88k/m88k.h, mcore/mcore.h, mips/mips-protos.h, + mips/mips.c, mips/mips.h, mmix/mmix-protos.h, mmix/mmix.c, + mmix/mmix.h, mn10200/mn10200.h, mn10300/mn10300.h, ns32k/encore.h, + ns32k/ns32k.h, pa/long_double.h, pa/pa.h, pdp11/pdp11.h, pj/pj.h, + romp/romp.c, romp/romp.h, rs6000/rs6000.h, s390/linux.h, sh/sh.h, + sparc/sparc.h, stormy16/stormy16.h, v850/v850.h, vax/vax.h, + vax/vaxv.h, we32k/we32k.h, doc/tm.texi: Remove ASM_OUTPUT_FLOAT, + ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_BYTE_FLOAT, + ASM_OUTPUT_SHORT_FLOAT, ASM_OUTPUT_THREE_QUARTER_FLOAT, and all + associated support routines. + +Thu Dec 20 16:58:46 CET 2001 Jan Hubicka + + * cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns + if one of block does not contain jump. + (outgoing_edge_math): Revert last path; require edges to be noncomplex + nonfake to match single exit edge; require conditional jumps to not + have side effect. + +2001-12-20 Turly O'Connor + + * tm.texi (ASM_OUTPUT_OPERAND): Change documentation references to + "recog_operand" to "recog_data.operand". + * rtl.def: Likewise. + +2001-12-20 Jakub Jelinek + + * simplify-rtx.c (simplifi_binary_operation) [DIV]: If DIV has + narrower mode than op0, only return the bits in DIV's mode. + +2001-12-20 Jakub Jelinek + + * combine.c (distribute_notes): Avoid adding REG_LABEL notes + to JUMP_INSNs with JUMP_LABEL. + +2001-12-19 Aldy Hernandez + + * doc/install.texi: Add documentation for --enable-altivec. + + * config.gcc: Add support for --enable-altivec. + + * config/rs6000/altivec.h: New. + + * config/rs6000/linuxaltivec.h (SUBSUBTARGET_OVERRIDE_OPTIONS): + Define. Fix typo. + + * config/rs6000/rs6000.c (vrsave_operation): Change unspec to + unspec_volatile. + (generate_set_vrsave): Generate the unspec here instead of calling + an .md pattern. + (generate_set_vrsave): Use gen_rtvec. + (rs6000_emit_prologue): Replace call to gen_get_vrsave with + gen_rtx_SET. + + * config/rs6000/rs6000.md ("*movsi_internal1"): Add constraints + for setting special registers. + ("*set_vrsave_internal"): Use unspec_volatile. + ("set_vrsave"): Remove. + ("get_vrsave"): Remove. + + * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Add vrsave to + SPECIAL_REGS. + +2001-12-19 Bruce Korb + + * gcc/fixinc/inclhack.def: Remove all the fix suppression "fixes". + (strict_ansi_not_ctd): accommodate __STDC__ == 0 tests in UW 2.1.2 + * gcc/fixinc/mkfixinc.sh(i?86-*-sysv4.2uw2*): now uses fixincl program + * gcc/fixinc/base/...: adjust for changes in fixes + +2001-12-20 Joseph S. Myers + + * po/gcc.pot: Regenerate. + + * configure.in (all_diff_excludes, diff_excludes): Remove. + * configure: Regenerate. + * Makefile.in (LANG_DIFF_EXCLUDES): Remove. + * objc/config-lang.in (diff_excludes): Remove. + +2001-12-19 Dan Nicolaescu + + * config/sparc/sparc.md (ldd peephole2s): For load peepholes pass + the destination register as a parameter to mems_ok_for_ldd_peep. + For store peepholes pass NULL_RTX. Move all volatile checks ... + * config/sparc/sparc.c (mems_ok_for_ldd_peep): ... here. Add a + register parameter, check it's not the same as base for an address. + * config/sparc/sparc-protos.h (mems_ok_for_ldd_peep): Update. + +2001-12-19 Jakub Jelinek + + * config/ia64/ia64.c (ia64_single_set): Return first set for + prologue_allocate_stack and epilogue_deallocate_stack instructions. + +2001-12-19 Dale Johannesen + + * config/rs6000/rs6000.h: LEGITIMIZE_RELOAD_ADDRESS: + redefine in terms of rs6000_legitimize_reload_address(). + * config/rs6000/rs6000-protos.h: Add this function. + * config/rs6000/rs6000.c: Add this function. Includes + handling for Darwin FP constants. + +Wed Dec 19 11:01:21 2001 Jeffrey A Law (law@redhat.com) + + * config/pa/t-hpux-shlib: New file. + * config.gcc (hpux10, hpux11): Include t-hpux-shlib in tmake_file + for 32bit hpux10 & hpux11 configurations. + +2001-12-19 Nick Clifton + + * config/arm/xscale-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Pass + -mno-fpu onto gas unless -mhard-float is specified. + (MULTILIB_DEFAULTS): Include msoft-float. + + * config/arm/t-xscale-coff (EXTRA_MULTILIB_PARTS): Remove definition. + + * config/arm/coff.h (SUPPORTS_INIT_PRIORITY): Define (to false). + * config/arm/elf.h (SUPPORTS_INIT_PRIORITY): Define (to true). + +Wed Dec 19 06:12:34 2001 Douglas B. Rupp + + * dwarf2out.c (add_name_and_src_coords_attributes): Fix VMS procedure + descriptor output. + +2001-12-18 Stan Shebs + + * rs6000.h (LOCAL_ALIGNMENT): Fix parens. + +Tue Dec 18 17:02:06 2001 Richard Kenner + + * emit-rtl.c (widen_memory_access): Only call compare_tree_int + on an INTEGER_CST. + +2001-12-18 David Edelsohn + + * rs6000.c (rs6000_override_options): Only use DI ops when + TARGET_64BIT. Fix typo. + +Tue Dec 18 16:39:46 CET 2001 Jan Hubicka + + * att.h (ASM_FILE_START): Use asm_dialect. + * linux.h (ASM_FILE_START): Likewise. + * gas.h (ASM_FILE_START): Likewise. + * i386.c (ix86_debug_arg_string, ix86_debug_addr_string, + ix86_asm_string, ix86_asm_dialect): New. + (override_options): Set asm_dialect. + * i386.h (MASK_MIX_SSE_I387, MASK_INTEL_SYNTAX, MASK_DEBUG_ARG, + MASK_DEBUG_ADDR): Kill. + (MASK_64BIT, MASK_NO_RED_ZONE): renumber. + (TARGET_DEBUG_ADDR, TARGET_DEBUG_ARG): Use string. + (ASSEMBLER_DIALECT): Use asm_dialect. + (TARGET_SWITCHES): Undocument deprecated items; deprecate intel-syntax; + remove debug-addr and debug-arg. + (TARGET_OPTIONS): Add debug-arg, debug-addr, asm. + (asm_dialect): New enum. + (ix86_debug_arg_string, ix86_debug_addr_string, + ix86_asm_string, ix86_asm_dialect): Declare. + * invoke.texi (-mintel-syntax): Remove. + (-masm): Document. + +Tue Dec 18 16:37:42 CET 2001 Jan Hubicka + + * libgcc2.c (__bb_exit_func): Kill -ax dumping code. + +2001-12-18 Jason Merrill + + C++ ABI change: destroy value arguments in caller. + * calls.c (initialize_argument_information): Pass the address of + the TARGET_EXPR temporary rather than storing it into another. + +Tue Dec 18 07:09:06 2001 Douglas B. Rupp + + * config/alpha/xm-vms.h (INCLUDE_DEFAULTS): Add /gnu/include. + * config/alpha/vms.h (STACK_CHECK_BUILTIN): #define 0 for VMS. + +2001-12-18 Jakub Jelinek + + * config/linux.h (PREFERRED_DEBUGGING_TYPE): Remove. + * config/sparc/linux.h (PREFERRED_DEBUGGING_TYPE): Remove. + * config/sparc/linux64.h (PREFERRED_DEBUGGING_TYPE): Remove. + (CC1_SPEC): Don't default to -gstabs+ if -m32. + +2001-12-05 David O'Brien + + * elfos.h (PREFERRED_DEBUGGING_TYPE): Change to DWARF2_DEBUG. + +2001-12-18 Joseph S. Myers + + * po/gcc.pot: Regenerate. + +2001-12-18 Kazu Hirata + + * config/h8300/h8300.c: Fix comment typos. + * config/h8300/h8300.h: Fix comment formatting. + +2001-12-17 Kaveh R. Ghazi + + * machmode.h (mode_name, mode_class, mode_size, mode_unit_size, + mode_bitsize, mode_mask_array, mode_wider_mode): Set array size in + declaration to NUM_MACHINE_MODES. + (mode_size, mode_unit_size): Set array type to unsigned char. + (mode_bitsize): Set array type to unsigned short. + + * rtl.c (rtx_length): Set array type to unsigned char. + (rtx_length, rtx_name, rtx_format, rtx_class): Set array size to + NUM_RTX_CODE. + (mode_bitsize): Set array type to unsigned short. + (mode_size, mode_unit_size): Set array type to unsigned char. + (mode_name, mode_class, mode_bitsize, mode_size, mode_unit_size, + mode_wider_mode, mode_mask_array): Set array size to + NUM_MACHINE_MODES. + + * rtl.h (rtx_length, rtx_name, rtx_format, rtx_class): Set array + size in declaration to NUM_RTX_CODE. + +2001-12-17 Richard Henderson + + * config/alpha/alpha.md (unop): Encode RB as $sp. + +2001-12-17 Neil Booth + + * Makefile.in: Update dependencies. + * c-lang.c: Remove unnecessary includes. + (deferred_fns, start_cdtor, finish_cdtor, defer_fn): Move to + c-objc-common.c. + (finish_file): Move body to c_common_finish_file. + * c-objc-common.c: Include varray.h and ggc.h. + (deferred_fns, start_cdtor, finish_cdtor, defer_fn, + expand_deferred_fns, c_objc_common_finish_file): Moved from c-lang.c. + (c_objc_common_init): Initialize deferred function array. + * c-tree.h (c_objc_common_finish_file, + static_ctors, static_dtors): New. +objc: + * Make-lang.in: Update dependencies. + * objc/objc-act.c: Don't include varray.h. + (defer_fn, deferred_fns): Move to c-objc-common.c. + (objc_init): Similarly for initialization of it. + (finish_file): Move some to c-objc-common.c, use + c_objc_common_finish_file. + +2001-12-17 Aldy Hernandez + + * config/rs6000/rs6000.c: Remove is_gpr_return_reg prototype. + +2001-12-17 Neil Booth + + * doc/cppinternals.texi: Update. + +Mon Dec 17 14:21:21 2001 Jeffrey A Law (law@redhat.com) + + * expmed.c (emit_store_flag): Extract updated comparison code + from the return value of compare_from_rtx. + * expr.c (do_store_flag): Similarly. + +2001-12-17 Nick Clifton + + * caller-save.c (init_caller_save): Use MODE_BASE_REG_CLASS in + preference to BASE_REG_CLASS. + * recog.c (preprocess_constraints): Ditto. + * regclass.c (record_operand_costs, scan_one_insn, regclass, + record_reg_classes, record_address_regs): Ditto. + * regrename.c (scan_rtx_address, scan_rtx, + replace_oldest_value_addr, replace_oldest_value_mem): Ditto. + * reload.c (find_reloads, find_reloads_address, + find_reloads_address_1): Ditto. + * reload1.c (maybe_fix_stack_asms): Ditto. + * defaults.h (MODE_BASE_REG_CLASS): Provide default + definition. + * doc/tm.texi: Document MODE_BASE_REG_CLASS. + + * config/arm/arm.h (MODE_BASE_REG_CLASS): Define. + +2001-12-17 Joseph S. Myers + + * doc/install.texi2html: Use -I $SOURCEDIR. + + Separate user and internals manuals. + * Makefile.in (info, $(docdir)/gcc.info, dvi, gcc.dvi): Update + dependencies. + ($(docdir)/gccint.info, gccint.dvi): New targets. + (maintainer-clean, install-info, uninstall): Update. + * doc/.cvsignore: Add gccint.info*. + * doc/include/gcc-common.texi: New file. + * doc/gcc.texi: Use it. Adjust to be a user-only manual. Put + copyright notice in a macro. Don't include ISBN unless FSFPRINT + is defined. + * doc/gccint.texi: New file. + * doc/configfiles.texi, doc/extend.texi, doc/invoke.texi, + doc/md.texi, doc/passes.texi, doc/tm.texi, doc/trouble.texi: + Update for separate user and internals manuals. + +2001-12-17 Dale Johannesen + + * config/rs6000/rs6000.h: CPP_CPU_SPEC: add mcpu=7400. + ASM_CPU_SPEC: Ditto. + RTX_COSTS: Fix timing info for 7450 multiply. + * config/rs6000/rs6000.md: Fix timing info for 7450 imul. + Allow floats to be kept in int regs in movsf_low, + movsf_low_st (Darwin only) + +2001-12-17 Aldy Hernandez + + * config/rs6000/rs6000.c (vrsave_operation): Recognize SETs in + parallel. + (is_gpr_return_reg): New. + (rs6000_emit_prologue): Call generate_set_vrsave with additional + argument. Save only registers in the mask. Attach + REG_FRAME_RELATED_EXPR note to altivec offsets. Do not call + rs6000_frame_related when saving VRSAVE. + (rs6000_emit_epilogue): Call generate_set_vrsave with additional + argument. Restore only registers in the mask. Restore altivec + registers after we restore CR. + (generate_set_vrsave): New parameter epiloguep. Generate unspec + sets instead of clobbers for call saved registers. + (altivec_frame_fixup): New. + +2001-12-17 Richard Henderson + + * config/sparc/sparc.md (movdi_zero): Remove. + (movdi_insn_sp32_v9): New. + +2001-12-17 Richard Henderson + + * cfgcleanup.c (outgoing_edges_match): Check for insn match with + a single outgoing edge too. + +Mon Dec 17 18:27:52 CET 2001 Jan Hubicka + + * cfgrtl.c (redirect_edge_and_branch): Do simplify abnormal + edges resulting from computed jump + +Mon Dec 17 17:57:05 CET 2001 Jan Hubicka + + * Makefile.in (cfgcleanup.o): Add cselib.h dependency. + * basic-block.h (CLEANUP_THREADING): New constant. + * cfgcleanup.c: Include cselib.h + (thread_jump, mark_effect): New functions. + (try_forward_edges): Do jump threading when asked for. + * jump.c (mark_modified_reg, save_regs, num_same_regs, modified_regs, + modified_mem, thread_jumps, rtx_equal_for-thread_p): Kill. + * rtl.h (thread_jumps, rtx_equal_for_thread_p): Kill. + * toplev.c (rest_of_compilation): Do now call thread_jumps; use + CLEANUP_THREAD instead. + +2001-12-17 Kaveh R. Ghazi + + * sparc/linux.h (STARTFILE_SPEC): Fix typo in last change. + +2001-12-17 Tom Rix + + * config/rs6000/rs6000.c (expand_block_move): Fix limits on max size + of bytes. + +2001-12-17 Richard Sandiford + + * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, + asm_out.integer): New fields. + * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, + TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initializers. + (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect + the individual initializers together. + (TARGET_ASM_OUT): Add the new initializers. + * output.h (assemble_integer): Return bool. + (integer_asm_op): Declare. + (default_assemble_integer): Declare. + (assemble_aligned_integer): New interface to assemble_integer. + * varasm.c (integer_asm_op): New function to select pseudo-op. + (default_assemble_integer): Default implementation of asm_out.integer. + (assemble_integer): Use the new target hook. Split objects into + words or bytes if the target hook fails. Return bool. + * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, + ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. + Document new target hooks. + + * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. + * dwarf2asm.c (unaligned_integer_asm_op): Remove. + (dw2_assemble_integer): New. + (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, + dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, + dw2_asm_output_encoded_addr_rtx): Use it. + (dw2_asm_output_nstring): Use assemble_integer for the null terminator. + (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use + integer_asm_op to get the byte pseudo-op. Use assemble_integer + if it returns NULL. + * dwarf2asm.h (dw2_assemble_integer): Declare. + * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the + default implementation of most macros. + (output_unsigned_leb128): Use dw2_asm_output_data. + (output_signed_leb128, dwarfout_source_line): Likewise. + (output_reg_number): Use dw2_assemble_integer. + (generate_macinfo_entry): Separate the type and offset arguments. + Use assemble_integer to write the value. + (dwarfout_start_source_file): Update generate_macinfo_entry usage. + (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. + * final.c (output_addr_const): Don't put brackets round a subtracted + symbol value or ".". + * halfpic.c (half_pic_finish): Use assemble_aligned_integer. + + * config/1750a/1750a.c (assemble_integer_1750a): New, + * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. + * config/arc/arc.c (arc_assemble_integer): New. + * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. + * config/arm/arm.c (arm_poke_function_name): Likewise. + (arm_assemble_integer): New, extracted from... + * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. + (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. + (ARM_FUNCTION_PROFILER): Likewise. + * config/avr/avr-protos.h (asm_output_byte): Remove. + (asm_output_char, asm_output_short): Remove. + * config/avr/avr.c (avr_assemble_integer): New. + (asm_output_byte, asm_output_char, asm_output_short): Remove. + * config/clipper/clipper.h (ASM_LONG): Remove. + * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. + * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. + * config/elxsi/elxsi.c (elxsi_assemble_integer): New. + * config/i370/i370.c (i370_hlasm_assemble_integer): New. + * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. + (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. + * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use + ASM_LONG instead of UNALIGNED_INT_ASM_OP. + * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. + (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use + ASM_LONG instead of UNALIGNED_INT_ASM_OP. + * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. + * config/i860/i860.c (i860_output_function_epilogue): Likewise. + * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. + (ASM_SHORT, ASM_LONG): Undefine. + * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. + * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. + * config/ia64/ia64.c (ia64_assemble_integer): New. + * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. + (ASM_OUTPUT_DWARF_PCREL): Likewise. + * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, + ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. + (ASM_SHORT, ASM_LONG): Remove. + * config/m68k/m68k.h (INT_OP_GROUP): New macro. + (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New + macros, the allowed values for INT_OP_GROUP. + * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP + * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise + * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise + * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. + (INT_OP_GROUP): Define to INT_OP_NO_DOT. + * config/m68k/dpx2.h (ASM_LONG): Undefine. + (INT_OP_GROUP): Define to INT_OP_DC. + * config/m68k/dpx2g.h (ASM_LONG): Undefine. + * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. + * config/m68k/lynx.h (ASM_LONG): Undefine. + * config/m68k/dpx2g.h (ASM_LONG): Undefine. + * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. + (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. + * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD + for GAS and INT_OP_NO_DOT otherwise. + (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. + (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, + ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. + (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. + (INT_OP_GROUP): Define to INT_OP_STANDARD. + (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, + ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. + (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. + * config/m68k/tower-as.h (ASM_LONG): Remove. + (INT_OP_GROUP): Define to INT_OP_NO_DOT. + * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. + * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. + (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. + * config/mips/iris5.h (TARGET_IRIX5): Define. + * config/mips/mips.c (mips_assemble_integer): New. + * config/mips/sni-svr4.h (ASM_LONG): Undefine. + * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. + * config/mmix/mmix.c (mmix_assemble_integer): New. + (mmix_asm_output_double_int): Remove. + (mmix_print_operand): Call mmix_output_octa directly. + * config/mmix/mmix.h (ASM_LONG): Remove. + * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. + * config/pa/pa.c (pa_assemble_integer): New. + (pa_override_options): Only use aligned DI ops on 64-bit targets. + Only use the unaligned ops if TARGET_GAS. + * config/pdp11/pdp11.c (pdp11_assemble_integer): New. + * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. + * config/pj/pj.h (ASM_LONG): Undefine. + * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. + * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly + extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() + and in_toc_section() rather than the in_section variable. + (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. + * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). + (RELOCATABLE_NEEDS_FIXUP): Define. + * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. + * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. + (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op + to get the word directive. + (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. + * config/s390/s390.c (s390_assemble_integer): New. + * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use + integer_asm_op to get the word directive. + * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. + * config/sparc/sparc-protos.h (output_double_int): Remove. + * config/sparc/sparc.c (output_double_int): Move to... + (sparc_assemble_integer): ...this new function. + (sparc_override_options): Only use .uaxword if TARGET_ARCH64. + * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. + * config/sparc/sysv4.h (ASM_LONG): Remove. + (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid + ASM_LONG. + * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. + * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. + + * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, + config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, + config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, + config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, + config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, + config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, + config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, + config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, + config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, + config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, + config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, + config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c + (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, + TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, + TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, + TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as + appropriate. + + * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, + config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, + config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, + config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, + config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, + config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, + config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, + config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, + config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, + config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, + config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, + config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, + config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, + config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, + config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h + config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, + config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, + config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, + config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, + config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, + config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, + config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, + config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, + ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, + UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. + +2001-12-17 Stan Shebs + + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Define. + (STACK_BOUNDARY): Remove definition. + (CPP_PREDEFINES): Define __POWERPC__. + +2001-12-17 Gerald Pfeifer + + * doc/c-tree.texi (Trees): Only refer to GCC. + +2001-12-17 Andreas Jaeger + + * c-common.def: Fix typo in comment. + +2001-12-16 David O'Brien + + * config.gcc (sparc64-*-freebsd*): Add target. + * config/sparc/freebsd.h: New file. + * config/sparc/sparc.h (LIB_SPEC, LINK_SPEC): Don't define. + * config/sparc/sunos4.h (LIB_SPEC, LINK_SPEC): Define. + * config/sparc/sysv4.h (CPP_PREDEFINES): Undefine before defining. + +2001-12-16 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_legitimize_address): Force both + PLUS operands into registers for altivec mode. + +2001-12-16 Aldy Hernandez + + * builtins.c (apply_args_size): Change regno to unsigned. + +2001-12-16 Aldy Hernandez + + * config/rs6000/rs6000.h (FUNCTION_ARG_REGNO_P): Change + ALTIVEC_ARG_MAX_REG to ALTIVEC_ARG_NUM_REG. + +2001-12-16 Zack Weinberg + + * c-typeck.c (error_init, pedwarn_init, warning_init): Call + gettext on argument before printing. + + * fold-const.c (negate_expr): Always call fold on new + NEGATE_EXPR. + +2001-12-17 Joseph S. Myers + + * c-common.def (COMPOUND_LITERAL_EXPR): Contain a DECL_STMT, not + a DECL directly. + * c-common.h (COMPOUND_LITERAL_EXPR_DECL_STMT): New. + (COMPOUND_LITERAL_EXPR_DECL): Adjust definition. + * c-decl.c (build_compound_literal): Put the decl inside a + DECL_STMT. + * doc/c-tree.texi (COMPOUND_LITERAL_EXPR): Update documentation. + Fixes PR c/5105. + +2001-12-16 Aldy Hernandez + + * config.gcc: Add powerpc-*-eabisimaltivec*. + +2001-12-16 Neil Booth + + * c-common.c, c-common.h (back_end_hook): Remove. + * c-lang.c (finish_file): Remove back_end_hook. + +Sun Dec 16 13:13:01 2001 Richard Kenner + + * expr.c (highest_pow2_factor, case INTEGER_CST): Fix error in + last change. + +2001-12-16 Richard Henderson + + * toplev.c (parse_options_and_default_flags): Don't enable + flag_cprop_registers at -O1. + +2001-12-16 Kaveh R. Ghazi + + * avr.c (avr_simplify_comparision_p, adjust_insn_length, + mask_one_bit_p, output_reload_insisf): Don't use the 'U' suffix. + * avr.h (reg_class): Likewise. + * avr.md: Likewise. + * mcore.c (try_constant_tricks, mcore_byte_offset, + mcore_halfword_offset): Likewise. + * sh.c (shl_sext_kind, gen_block_redirect, split_branches): Likewise. + * v850.c (not_power_of_two_operand): Likewise. + + * clipper/clix.h (ASM_OUTPUT_ASCII): Avoid signed/unsigned + warnings. + * convex.h (ASM_OUTPUT_ASCII): Likewise. + * i370.h (ASM_OUTPUT_ASCII): Likewise. + * i386/att.h (ASM_OUTPUT_ASCII): Likewise. + * i386/i386-interix.h (ASM_OUTPUT_ASCII): Likewise. + * i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise. + * i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise. + * i386/sco5.h (ASM_OUTPUT_ASCII): Likewise. + * i386/sun386.h (ASM_OUTPUT_ASCII): Likewise. + * i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise. + * i860/bsd.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/3b1.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/amix.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/atari.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/crds.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/hp320.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/mot3300.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/sgs.h (ASM_OUTPUT_ASCII): Likewise. + * m68k/tower-as.h (ASM_OUTPUT_ASCII): Likewise. + * mips/bsd-5.h (ASM_OUTPUT_ASCII): Likewise. + * mips/mips-5.h (ASM_OUTPUT_ASCII): Likewise. + * mips/svr3-5.h (ASM_OUTPUT_ASCII): Likewise. + * mips/svr4-5.h (ASM_OUTPUT_ASCII): Likewise. + * ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise. + * vax/vaxv.h (ASM_OUTPUT_ASCII): Likewise. + * we32k/we32k.h (ASM_OUTPUT_ASCII): Likewise. + + * i386/uwin.h (MD_STARTFILE_PREFIX): Avoid redefinition warnings. + * interix.h (TARGET_MEM_FUNCTIONS): Likewise. + * psos.h (CPP_PREDEFINES): Likewise. + * rs6000/linux64.h (ROUND_TYPE_ALIGN): Likewise. + * rs6000/xcoff.h (RS6000_MCOUNT, RS6000_ITRUNC, RS6000_UITRUNC, + ASM_OUTPUT_EXTERNAL): Likewise. + * sparc/liteelf.h (DWARF_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO): + Likewise. + * sparc/sp64-elf.h (UNALIGNED_DOUBLE_INT_ASM_OP): Likewise. + * sparc/sp86x-elf.h (DWARF_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO): + Likewise. + * sparc/sunos4.h (SUNOS4_SHARED_LIBRARIES): Likewise. + + * c-lex.c (lex_number): Use ISXDIGIT/hex_value. + * vax/xm-vms.h (FILE_NAME_NONDIRECTORY): Use ISUPPER/TOLOWER. + * fold-const.c (real_hex_to_f): Use hex_value. + * real.c (asctoeg): Use hex_value & ISXDIGIT. + * toplev.c (toplev_main): Call hex_init. + * tradcpp.c (main): Call hex_init. + + * nextstep-protos.h: New file. + * nextstep.c: Include "rtl.h", "output.h" & "tm_p.h". + * nextstep.h (INCLUDE_DEFAULTS): Delete LOCAL_INCLUDE_DIR and + STANDARD_INCLUDE_DIR from the CROSS_COMPILE clause. + (nextstep_asm_out_constructor, nextstep_asm_out_destructor, + handle_pragma): Move prototypes to nextstep-protos.h. + * config.gcc (i[34567]86-next-*, m68k-next-nextstep2*, + m68k-next-nextstep[34]*): Append nextstep-protos.h to tm_p_file. + +2001-12-16 Craig Rodrigues + + PR other/3725 + * configure.in: Add AC_SUBST(target_alias). + * configure: Regenerated. + +2001-12-15 Richard Henderson + + * config/alpha/alpha.md (sibcall_osf_1_er): New. + (sibcall_value_osf_1_er): New. + +2001-12-15 Dan Nicolaescu + + * config/sparc/sparc.c (mems_ok_for_ldd_peep): Rename from + addrs_ok_for_ldd_peep_withmem; take MEMs as parameters, not + addrs; eliminate restriction of only using fp and sp as base + registers. + * config/sparc/sparc-protos.h: Update. + * config/sparc/sparc.md (movdi): Use TARGET_V9 not TARGET_ARCH64. + (*cmp_cc_set, *cmp_ccx_set64, *movdi_zero): New insns derived + from old define_peepholes. + Convert all the ldd/std peepholes to peephole2. + +2001-12-15 Ulrich Weigand + + * s390.md (prologue, epilogue, *return_si, *return_di): New. + s390.c (find_unused_clobbered_reg, s390_frame_info, + save_fpr, restore_fpr, s390_emit_prologue, s390_emit_epilogue): New. + s390-protos.h (s390_emit_prologue, s390_emit_epilogue): Declare. + s390.c (s390_arg_frame_offset): Use s390_frame_info. + (leaf_function_flag, cur_is_leaf_function, + save_fprs, restore_fprs, force_const_mem_late): Remove. + (s390_function_prologue, s390_function_epilogue): Mostly remove. + s390.md (lit): New. Uses ... + s390.c (s390_output_constant_pool): ... this, so adapt and make global. + s390-protos.h (s390_output_constant_pool): Declare. + s390.md (load_multiple, store_multiple): Allow use after reload. + s390.c (load_multiple_operation, store_multiple_operation): Likewise. + s390.h (INCOMING_FRAME_SP_OFFSET): Define. + s390.h (CALL_REALLY_USED_REGISTERS): Define. + config/s390/linux64.h (CALL_USED_REGISTERS): Remove, now handled ... + s390.h (CONDITIONAL_REGISTER_USAGE): ... here. + s390.c (s390_sr_alias_set): New global variable, initialized ... + (override_options): ... here. New. + s390-protos.h (override_options): Declare. + s390.h (OVERRIDE_OPTIONS): Call it. + s390.c (s390_function_profiler): New. + s390-protos.h (s390_function_profiler): Declare. + s390.h (FUNCTION_PROFILER): Call it. + s390.c (s390_profile): Remove. + + * s390.c (reg_used_in_mem_p): PC reload counts as memory access. + (addr_generation_dependency_p): Consider literal pool register loads. + (s390_adjust_priority): Do not schedule load_multiple. + s390.md (attribute "type"): Define some additional types. + (function_unit "integer"): Adapt. + (many insns): Adapt "type" attribute setting. + + * s390.c (general_s_operand, s_imm_operand): New. + (s_operand): Remove old definition, call general_s_operand instead. + s390-protos.h (s_imm_operand): Declare. + s390.c (base_n_index_p, r_or_s_operand, r_or_s_or_im8_operand, + r_or_x_or_im16_operand, r_or_im8_operand): Remove. + s390-protos.h (r_or_s_operand, r_or_s_or_im8_operand, + r_or_x_or_im16_operand, r_or_im8_operand): Likewise. + s390.h (PREDICATE_CODES): Add s_imm_operand, remove r_or_s*_operand. + s390.md (many insns): Rework insn predicates. + + * s390.c (legitimate_pic_operand_p, legitimate_constant_p): Accept all + non-symbolic constants. Reload will force them because of ... + (s390_preferred_reload_class): ... this. New. + s390-protos.h (s390_preferred_reload_class): Declare. + s390.h (PREFERRED_RELOAD_CLASS): Call it. + s390.md (movdi, movsi, movdf, movsf, *reload_la_64 splitters, + *reload_la_31 splitters): Handle constants after reload. + (many insns): no longer force all constants immediately. + s390.c (legitimate_reload_constant_p): New helper routine. + s390-protos.h (legitimate_reload_constant_p): Declare. + s390.c (print_operand): Clean up CONST_INT case, add CONST_DOUBLE case. + + * s390.h (FIRST_PSEUDO_REGISTER, FRAME_POINTER_REGNUM, + HARD_FRAME_POINTER_REGNUM, REGISTER_NAMES): Add virtual frame pointer. + (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Update. + (ELIMINABLE_REGS, INITIAL_ELIMINATION_OFFSET): Likewise. + (REGNO_OK_FOR_INDEX_P, REG_OK_FOR_INDEX_NONSTRICT_P): Likewise. + (DWARF_FRAME_REGISTERS): Define. + s390.c (regclass_map): Add virtual frame pointer. + (legitimate_la_operand_p): Allow use of virtual frame pointer. + s390.md (*la_ccclobber, *addaddr_ccclobber): New. + (addaddr, addsi_64): Delete. + + * s390.h (HARD_REGNO_MODE_OK): Allow SImode and DImode values in + floating point registers. + (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Define. + (ADDR_FP_REGS, GENERAL_FP_REGS): New register classes. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. + + * s390.md (movti): Replace multi-insn output with splitters. + (movdi_31, movdf_31): Likewise. + (movti_ss, movdi_ss, movsi_ss, movdf_ss, movsf_ss): New. + (movdi_lhi, movdi_lli, movdi_larl, movsi_lhi, movsi_lli): New. + (movdi_64, movdi_31, movsi, movdf_64, movdf_31): Adapt. + (movdf_soft_64, movdf_soft_31, movsf_soft): Remove. + (movsf_64, movsf_31): Remove, replace by ... + (movsf): ... this. + (movqi_64): Use lhi instead of llill. + (*movstrictqi, *movstricthi): Don't use (strict_low_part (mem)). + + * s390.md (extendsidi2, *extendsidi2, extendhidi2, *extendhidi2, + extendqidi2, extendhisi2, *extendhisi2, extendqisi2, + extendqihi2 and associated splitters): Reworked. + (zero_extendsidi2, zero_extendsidi2, *zero_extendsidi2, + zero_extendhidi2, *zero_extendhidi2, zero_extendqidi2, + zero_extendqidi2, *zero_extendqidi2, zero_extendhisi2, + *zero_extendhisi2_64, zero_extendhisi2_31, zero_extendqisi2, + *zero_extendqisi2_64, *zero_extendqisi2_mem_31, + zero_extendqisi2_reg_31, zero_extendqihi2, *zero_extendqisi2_64, + zero_extendqihi2, zero_extendqihi2_64, zero_extendqihi2_31, + and associated splitters): Likewise. + (*sethighqisi, *sethighhisi, *sethighqidi_64, *sethighqidi_31 + and associated splitters): New. + (truncdisi2, truncdihi2, truncdiqi2, truncsihi2, do_truncsihi2, + *truncsihi2_64, truncsiqi2, trunchiqi2): Remove. + (ashlhi3, ashrhi3, lshrhi3, abshi3): Remove. + s390.h (PROMOTE_PROTOTYPES): Remove. + config/s390/linux64.h (PROMOTE_PROTOTYPES): Likewise. + + * s390.md (muldi3): Delete, use instead ... + (mulsidi3): ... this. + (*muldi3_64): Rename to muldi3. + (mulsi_6432): Fix template. + (divdi3, moddi3): Delete, replace by ... + (divmoddi4): ... this. + (divmodtidi3): Fix template. + (divmodtisi3): New. + (udivdi3, umoddi3): Delete, replace by ... + (udivmoddi4): ... this. + (udivmodtidi3): Fix template. + (divsi3, modsi3): Delete, replace by ... + (divmodsi4): ... this. + (divmoddisi3): Fix template. + (udivsi3, umodsi3): Adapt. + + * s390.md (anddi3): Remove SS alternative, use instead ... + (anddi3_ss, anddi3_ss_inv): ... these. + (anddi3_ni): New. + (andsi3*, andhi3*, andqi3*): Likewise. + (iordi3): Remove SS alternative, use instead ... + (iordi3_ss, iordi3_ss_inv): ... these. + (iordi3_oi): New. + (iorsi3*, iorhi3*, iorqi3*): Likewise. + (iordi3_cc, iordi3_cconly, iorsi3_cc, iorsi3_cconly): New. + (xordi3): Remove SS alternative, use instead ... + (xordi3_ss, xordi3_ss_inv): ... these. + (xordi3_oi): New. + (xorsi3*, xorhi3*, xorqi3*): Likewise. + (xordi3_cc, xordi3_cconly, xorsi3_cc, xorsi3_cconly): New. + (one_cmpldi2, one_cmplsi2, one_cmplhi2, one_cmplqi2): + Expand to XOR with -1. + (*one_cmpldi2, *one_cmplsi2, *one_cmplhi2): Remove. + (cmpdi_tm): Delete, replace by ... + (cmpdi_tm_reg, cmpdi_tm_mem): ... these. + (cmpsi_cct): Delete, replace by ... + (cmpsi_tm_reg, cmpsi_tm_mem): ... these. + (cmpdi_tm2, cmpsi_tm2): Improve. + (cmphi_tm_sub, cmpqi_tm_sub, cmpqi_tm2, cmpqi_tm): New. + s390.c (s390_single_hi, s390_extract_hi, + s390_single_qi, s390_extract_qi): New helper routines. + s390-protos.h (s390_single_hi, s390_extract_hi, + s390_single_qi, s390_extract_qi): Declare. + s390.c (tmxx_operand, const1_operand): Remove. + s390-protos.h (tmxx_operand, const1_operand): Likewise. + s390.h (PREDICATE_CODES): Likewise. + + * s390.md (sqrtdf2, sqrtsf2): New. + + * s390.h (CRT_CALL_STATIC_FUNCTION): Define. + (check_and_change_labels): Remove section-change special case. + + * s390.h (RETURN_ADDR_RTX): Fix use of __builtin_return_address + in leaf functions. Needs ... + (DYNAMIC_CHAIN_RTX): ... this. New. + + * s390.c (emit_pic_move): Don't generate pseudos if no_new_pseudos. + + * s390.md (movstrdix_64, movstrsix_31, movstrdi_64, movstrsi_31, + clrstrsi_64, clrstrsi_31, cmpstr_64, cmpstr_31): Do not clobber + input operands using a match_dup clause. + (movstrdi, movstrsi, clrstrdi, clrstrsi, cmpstrdi, cmpstrsi): Adapt. + + * s390.md (floatdidf2, floatdisf2, floatsidf2, floatsidf2_ieee, + floatsisf2, floatsisf2_ieee): Add missing CC clobber. + + * s390.md (floatsidf2_ibm): Use correct operand. + + * s390.md (fixuns_truncdfdi2, fixuns_truncdfsi2, fix_truncdfsi2, + fixuns_truncsfdi2, fixuns_truncsfsi2, floatsidf2): Remove use of + non-portable constants. + s390.c (s390_gen_rtx_const_DI): New helper routine. + s390-protos.h (s390_gen_rtx_const_DI): Declare. + + * s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Fix alignment. + + * config/s390/linux.h (ASM_OUTPUT_SHORT, ASM_OUTPUT_CHAR, + ASM_OUTPUT_BYTE): Clean up assembly output. + (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGN): Remove duplicate definitions. + (ASM_OUTPUT_ASCII): Remove. + + * config/s390/t-linux (CRTSTUFF_T_CFLAGS_S): Define. + +2001-12-15 Zack Weinberg + + * unwind-dw2-fde-glibc.c: #define _Unwind_Find_FDE to itself + before including unwind-dw2-fde.c, if we are not using the + special code in this file. + +2001-12-15 Richard Henderson + + * config/alpha/alpha.h (TARGET_SWITCHES): Turn on + MASK_EXPLICIT_RELOCS if the assembler supports it. + * configure.in (HAVE_AS_EXPLICIT_RELOCS): New. + * configure, config.in: Rebuild. + +Sat Dec 15 17:53:03 2001 Richard Kenner + + * calls.c (emit_call_1): If ECF_SP_DEPRESSED, pretend have adjusted + for rounded_stack_size. + +2001-12-15 Joseph S. Myers + + * c-typeck.c, config/i386/i386.h, config/mcore/mcore.h, + config/ns32k/ns32k.h, config/rs6000/sysv4.h, fold-const.c, + toplev.c, cppinit.c, cppmacro.c, gcc.c: Use "built-in" and + "bit-field" spellings in messages. + * po/gcc.pot: Regenerate. + +2001-12-15 Joseph S. Myers + + * gcc.c, config/fr30/fr30.c, config/v850/v850-c.c, toplev.c: Use + American spelling in messages. + * po/gcc.pot: Regenerate. + +2001-12-15 Kazu Hirata + + * config/h8300/h8300.md: Adjust whitespacing. Remove + constraints from expanders. Replace \@ with @. + +2001-12-15 Richard Earnshaw + + * arm/unknown-elf.h (CPP_PREDEFINES): Add a suitable default. + +2001-12-15 Ulrich Weigand + + * regrename.c (copyprop_hardreg_forward): Do not keep register + value data live across abnormal call or eh egdes. + +Sat Dec 15 08:29:45 2001 Richard Kenner + + * expr.c (highest_pow2_factor, case INTEGER_CST): Return + BIGGEST_ALIGNMENT for 0. + +Sat Dec 15 14:13:03 CET 2001 Jan Hubicka + + * predict.def (PRED_NORETURN): Make probabilities match reality. + (PRED_OPCODE_POSITIVE, PRED_OPCODE_NONEQUAL, PRED_ERROR_RETURN): + Likewise. + +2001-12-15 Jakub Jelinek + + * configure.in: Check for ld. + (HAVE_LD_EH_FRAME_HDR): Define if ld supports --eh-frame-hdr option. + * configure, config.in: Rebuilt. + * config.gcc: Add crtbeginT.o to extra_parts where needed. + * config/t-linux (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde-glibc + frame unwinding on Linux. + * config/t-linux-gnulibc1 (LIB2ADDEH, LIB2ADDEHDEP): Use unwind-dw2-fde + frame unwinding. + * config/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static. + (LINK_EH_SPEC): Define. + * config/i386/gnu.h (STARTFILE_SPEC): Use crtbeginT.o for -static. + * config/ia64/linux.h (STARTFILE_SPEC, LINK_EH_SPEC): Define. + * config/ia64/fde-glibc.c (_Unwind_IteratePhdrCallback): Don't + iterate further if pc falls into current library, but fde was not + found. + * config/sparc/linux.h (STARTFILE_SPEC): Use crtbeginT.o for -static + if using glibc. + (LINK_EH_SPEC): Define. + * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64): + Use crtbeginT.o for -static. + (LINK_EH_SPEC): Define. + * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. + * Makefile.in (crtbeginT.o): Add rule. + * gcc.c (init_gcc_specs): For -static-libgcc, use -lgcc -lgcc_eh. + If neither -static-libgcc nor -shared-libgcc is passed and -shared, + use -lgcc if LINK_EH_SPEC is defined and -lgcc_s -lgcc if not. + If none of the above switches are passed, use -lgcc -lgcc_eh. + (init_spec): If LINK_EH_SPEC is defined, prepend it to link_spec. + * mklibgcc.in: Don't include LIB2ADDEH objects into libgcc.a if + creating libgcc_s.so, put them into separate libgcc_eh.a instead. + * unwind-dw2-fde.c: Don't include any headers if this file + is included from other .c file. + * unwind-dw2-fde-glibc.c: New file. + * crtstuff.c (USE_PT_GNU_EH_FRAME, USE_EH_FRAME_REGISTRY): Define. + Use it instead of EH_FRAME_SECTION_NAME where appropriate. + +2001-12-14 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memcmp): Mark parameter with + ATTRIBUTE_UNUSED. + * cfgcleanup.c (insns_match_p): Likewise. + * regrename.c (mode_change_ok): Likewise. + * gcc.c (execute): Const-ify. + +2001-12-14 Aldy Hernandez + + * c-parse.in (typename): Do not split attributes. + Remove unsupported attributes warning. + + * c-decl.c (groktypename): Apply attributes. + +2001-12-14 Richard Henderson + + * config/ia64/ia64.c (spill_restore_mem): Mark iterator + initialization as possibly dead. + +2001-12-14 Richard Henderson + + * regrename.c (mode_change_ok): New. + (find_oldest_value_reg): Use it. + +2001-12-14 Richard Henderson + + * regrename.c (struct value_data): Add max_value_regs. + (init_value_data): Initialize it. + (kill_value): Kill values that overlap the dying register. + (set_value_regno): New. + (kill_set_value, kill_autoinc_value, copy_value): Use it. + (copyprop_hardreg_forward_1): Kill earlyclobber operands + before looking at inputs. + +2001-12-14 David Edelsohn + + * config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Handle + DECL_WEAK for function descriptors. + * config/rs6000/xcoff.h (HANDLE_PRAGMA_WEAK): Define if assembler + weak support present. + (ASM_WEAKEN_LABEL): Same. + +2001-12-14 Kazu Hirata + + * config/h8300/h8300.md (anonymous pattern): Add a missing + mode. + +2001-12-14 Kazu Hirata + + * config/h8300/h8300.c (h8300_adjust_insn_length): Fix a + comment typo. + +2001-12-14 Kazu Hirata + + * config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): + Remove the initialization requierment. + (h8300_handle_tiny_data_attribute): Likewise. + +2001-12-14 Kazu Hirata + + * config/h8300/h8300.md (udivqi3): Remove. + (divqi3): Likewise. + (udivhi3): Likewise. + (divhi3): Likewise. + (umodqi3): Likewise. + (modqi3): Likewise. + (umodhi3): Likewise. + (modhi3): Likewise. + (udivmodqi3): New. + (divmodqi3): Likewise. + (udivmodhi3): Likewise. + (divmodhi3): Likewise. + +Sat Dec 15 01:39:12 CET 2001 Jan Hubicka + + * cfgcleanup.c (flow_find_cross_jump): Replace tests for note + by active_insn_p; count conditional jump as instruction. + +2001-12-14 DJ Delorie + Danny Smith + + * config/i386/cygwin.h (I386_PE_STRIP_ENCODING): Handle '*' + at SYM_NAME[0] or SYM_NAME[3]. + (STRIP_NAME_ENCODING): Don't check for leading '*'. + +2001-12-14 Ira Ruben + + Add -### option (displays driver-generated commands without + executing and quotes all arguments). + * doc/invoke.texi: Add -###. + * gcc.c (verbose_only_flag) - New flag. + * (execute): If -### write quoted arguments and return. + * (display_help): Print meaning of -###. + * (process_command): Handle -###. + +2001-12-14 Ira Ruben + + Fix to no allow -save-temps to clobber user's source file. + * gcc.c: Add static globals input_stat and input_stat_set. + (do_spec_1): For 'g', 'u', 'U' case with save_temps_flag + set, check that user's input file is not overwritten. + (set_input): Reset input_stat_set for each new file. + +Fri Dec 14 22:14:44 CET 2001 Jan Hubicka + + * predict.c (estimate_probability): Fix LOOP_EXIT heuristic. + +2001-12-14 Zack Weinberg + + * combine.c (record_dead_and_set_regs): Use + regs_invalidated_by_call. Don't note stores for CALL_INSNs. + +2001-12-14 Roger Sayle + + * builtins.def: Rename BUILT_IN_FSQRT to BUILT_IN_SQRT and + __builtin_fsqrt to __builtin_sqrt. + + * builtins.c (expand_builtin_mathfn,expand_builtin): Same. + * doc/extend.texi: Simplify documentation to match patch. + +Fri Dec 14 21:23:54 CET 2001 Jan Hubicka + + * config.gcc: Revamp target_cpu_default2 to strings; + support new x86 variants. + * i386.c (override_options): Default x86_cpu_string and x86_arch_string + properly; set prefetch_sse. + * i386.h (x86_prefetch_sse): Declare. + (TARGET_PREFETCH_SSE): New. + (CPP_CPU_DEFAULT_SPEC): Define according to the new macros. + (TARGET_CPU_DEFAULT_*): New. + +Thu Dec 13 21:57:13 CET 2001 Janis Johnson + Jan Hubicka + + * config/i386/i386.h (struct processor_costs): Add new members + prefetch_block and simultaneous_prefetches. + (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): New. + * config/i386/i386.c (processor_costs structs): Add values for + prefetch_block and simultaneous_prefetches. + * config/i386/i386.md (unspec values): Remove values for prefetch + operations, which now use the PREFETCH rtx code. + (prefetch_sse, prefetch_3dnow, prefetchw): Combine to use new + unified prefetch support. + +2001-12-14 Jason Merrill + + * diagnostic.c (sorry): Increment sorrycount before saving the + buffer state. + +Fri Dec 14 19:53:23 CET 2001 Jan Hubicka + + * i386.md (sqrt?f): Fix conditionals. + +Fri Dec 14 07:29:52 2001 Douglas B. Rupp + + * config.gcc (alpha64-dec-*vms*): New case. + * config/alpha/t-vms64, config/alpha/vms-crt0-64.c: New files. + * config/alpha/vms-psxcrt0-64.c, config/alpha/vms64.h: Likewise. + * config/alpha/xm-vms64.h: Likewise. + + * config/alpha/alpha.c (vms_attribute_table): Add new attributes. + (alpha_write_linkage): Test for null alpha_links. + (SECTION_VMS_GLOBAL, SECTION_VMS_INITIALIZE): New section attributes. + (vms_section_type_flags, vms_asm_named_section): Handle them. + +Fri Dec 14 12:05:14 CET 2001 Jan Hubicka + + * i386.c (ix86_fpmath, ix86_fpmath_string): New. + (override_option): Set ix86_fpmath. + * i386.h (MASK_MIX_SSE_I387): Remove. + (TARGET_SSE_MATH): New. + (TARGET_MIX_SSE_I387): Use ix86_fpmath. + (TARGET_SWITCHES): Remove "mix-sse-i387". + (fpmath_unit): New enum. + (ix86_fpmath, ix86_fpmath_string): Declare. + * i386.md (swapsf): Fix condition. + (add?f, sub?f, mul?f, div?f, sqrt?f, min?f): Use TARGET_SSE_MATH. + (fp_?f_*_nosse): New. + (fp_*): Use TARGET_SSE_MATH. + * invoke.texi (-mfpmath): Document. + (-msse2): Add. + +2001-12-14 Jason Merrill + + * dwarf2out.c (output_die): Print the string in the comment for + a DW_FORM_strp. + +2001-12-14 Richard Earnshaw + + * netbsd.h (COLLECT_SHARED_INIT_FUNC) + (COLLECT_SHARD_FINI_FUNC): Remove redundant semicolon. + * doc/tm.texi (COLLECT_SHARED_INIT_FUNC) + (COLLECT_SHARD_FINI_FUNC): Use @code where appropriate. + +2001-12-13 Richard Henderson + + * regrename.c (kill_value_regno): Simplify chain removal. + (kill_value): Kill all of HARD_REGNO_NREGS. + (kill_set_value): Use kill_value not kill_value_regno. + (kill_autoinc_value): Likewise. + (copyprop_hardreg_forward): Don't collect refresh_blocks. + Call delete_noop_moves. + +2001-12-13 Aldy Hernandez + + * attribs.c (c_common_attribute_table): Swap decl_req and type_req + for the mode attribute. + (handle_mode_attribute): Handle types, not decls. + +2001-12-13 Jason Merrill + + * c-common.h (COMPOUND_STMT_BODY_BLOCK): New macro. + +2001-12-13 Aldy Hernandez + + * config/rs6000/rs6000.md (eh_set_lr_di): Change scratch + constraint to base register. + (eh_set_lr_si): Same. + +2001-12-13 Hans-Peter Nilsson + + * expr.c (expand_expr, case ADDR_EXPR): Don't honor + flag_force_addr for modifier != EXPAND_CONST_ADDRESS, + modifier != EXPAND_INITIALIZER and modifier != EXPAND_SUM. + +Thu Dec 13 20:30:08 2001 Richard Kenner + + * expr.c (copy_blkmode_from_reg): Add missing braces to eliminate + warning and reformat comments. + (expand_assignment): Don't pass EXPAND_WRITE if LHS is component. + (highest_pow2_factor, case INTEGER_CST): Return BIGGEST_ALIGNMENT + if overflow. + +2001-12-12 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): Add + SUBSUBTARGET_OVERRIDE_OPTIONS. + + * config/rs6000/eabialtivec.h: New file. + + * config/rs6000/linuxaltivec.h: New file. + + * config.gcc: Add powerpc-*-eabialtivec and + powerpc-*-linux-gnualtivec. + +2001-12-13 Neil Booth + + * toplev.c (process_options, parse_options_and_default_flags): + Set flag_no_inline before the post_options hook. + +2001-12-13 Richard Henderson + + * emit-rtl.c (adjust_address_1): Don't adjust address if adjust + is false. + +2001-12-13 Richard Earnshaw + + * collect2.c (COLLECT_SHARED_INIT_FUNC) + (COLLECT_SHARD_FINI_FUNC): Define default values. + (write_c_file_stat): Use them to call construtor and destructor + functions in shared libraries. + * doc/tm.texi (COLLECT_SHARED_INIT_FUNC) + (COLLECT_SHARD_FINI_FUNC): Document them. + * config/netbsd.h (COLLECT_SHARED_INIT_FUNC) + (COLLECT_SHARD_FINI_FUNC): Define. + + * config/netbsd.h (LINK_SPEC): Don't pull in estart if creating a + shared library. Pass -shared through to the linker. + * config/arm/netbsd.h (LINK_SPEC): Likewise. + + * config/arm/t-netbsd (TARGET_LIBGCC2_CFLAGS): Add -fpic. + (SHLIB_EXT, SHLIB_NAME, SHLIB_SONAME, SHLIB_OBJS, SHLIB_LINK) + (SHLIB_INSTALL): Define. + +2001-12-13 Richard Earnshaw + + * arm.c (legitimize_pic_address): Handle LABEL_REFs in substantially + the same way as we handle SYMBOL_REFS. + +Thu Dec 13 07:47:24 2001 Richard Kenner + + * loop.c (remove_constant_addition): Fix prototype and whitespace. + (emit_prefetch_instructions): Remove warnings and whitespace + changes. + +Thu Dec 13 06:48:38 2001 Douglas B. Rupp + + * config/alpha/vms-cc.c (preprocess_args): Fix forward + declaration. + +Thu Dec 13 12:31:07 CET 2001 Jan Hubicka + + * predict.c (estimate_probability): Reorganize opcode heuristics. + * predict.def (PRED_OPCODE_POSITIVE, PRED_OPCODE_NONEQUAL, + PRED_FPOPCODE): New. + + * i386.c (override_options): Recognize various CPU variants and set + SSE/MMX/3dNOW flags accordingly. + * i386.h (MASK_MMX_SET, MASK_SSE_SET, MASK_SSE2_SET, MASK_3DNOW_SET, + MASK_3DNOW_A_SET): New. + (MASK_ACCUMULATE_OUTGOING_ARGS_SET): New. + (MASK_NO_ACCUMULATE_OUTGOING_ARGS): Delete. + (MASK_*): Renumber. + (TARGET_FLAGS): Use new masks. + (CPP_CPU_SPECS): Recognize new CPU variants. + * invoke.texi (-mcpu): Update documentation. + + * flags.h (flag_prefetch_loop_arrays): Declare. + * loop.h (LOOP_PREFETCH): Define new constant. + * loop.c (strength_reduce): Call emit_prefetch_instructions. + (MAX_PREFETCHES, PREFETCH_BLOCKS_BEFORE_LOOP_MAX, + PREFETCH_BLOCKS_BEFORE_LOOP_MIN, PREFETCH_BLOCKS_IN_LOOP_MIN): New + constants. + (check_store_data): New structure. + (check_store, emit_prefetch_instructions, rtx_equal_for_prefetch_p): + New functions. + * toplev.c: Include insn-flags.h. + (flag_prefetch_loop_arrays): New global variable. + (lang_independent_option): Add -fprefetch-loop-arrays. + (rest_of_compilation) Pass LOOP_PREFETCH when flag_prefetch_loop_arrays + is set. + * Makefile.in (toplev.c): Depend on insn-flags.h. + * invoke.texi (-fprefetch-loop-arrays): Document. + + * predict.c (estimate_probability): Distribute the loop exit + probability according to number of exit edges. + + * cfgcleanup.c (insns_match_p): Break out from ...; + (flow_find_cross_jump): ... here; + (outgoing_edges_match): Add parameter MODE; attempt to match everything + except for tablejumps. + (try_crossjump_to_edge): Accept complex edges. + (try_crossjump_bb): Likewise. + +2001-11-29 Corey Minyard + + * recog.c (validate_replace_rtx_1): Use simplify_gen_binary + instead of plus_constant. + * simplify-rtx.c (neg_const_int): New. + (simplify_gen_binary, simplify_plus_minus): Use it. + +2001-12-12 Roger Sayle + + * builtins.c (expand_builtin_memset, expand_builtin_memcpy, + expand_builtin_strcpy): Additional arguments TARGET and MODE. + (expand_builtin_bzero, expand_builtin_strcpy, + expand_builtin_strncpy, expand_builtin_bzero): Pass additional + TARGET and MODE parameters to the above functions. + (expand_builtin_memset, expand_builtin_memcpy): Optimize the + case where the LEN parameter is constant zero. + (expand_builtin_memcmp): No longer conditional on + HAVE_cmpstrsi. Take an additional mode parameter. Optimize + the cases where len is either constant zero or one. + Optimize to call to memcpy, even if the memcpy isn't inlined. + (expand_builtin_strncpy): Optimize to call memcpy, even if the + memcpy isn't inlined. + (expand_builtin_strcmp, expand_builtin_strncmp): Always attempt + to optimize to a call to memcmp. + (expand_builtin): expand_builtin_memcmp can always be called, + and pass the required parameters to expand_builtin_memcmp, + expand_builtin_memset, expand_builtin_memcpy and + expand_builtin_strcpy. + +2001-12-12 David O'Brien + + * config.gcc (arm-*-freebsd*): Add target. + * config/arm/freebsd.h: New file. + * config/arm/arm.h (CPP_PREDEFINES): Do not define. + (CPP_SPEC): #undef before defining. + (CPP_CPU_ARCH_SPEC): Add -Acpu=arm -Amachine=arm. + * config/arm/conix-elf.h (CPP_PREDEFINES): Remove -Acpu=arm + -Amachine=arm. + * config/arm/linux-elf.h: Likewise. + * config/arm/netbsd.h: Likewise. + * config/arm/riscix.h: Likewise. + * config/arm/riscix1-1.h: Likewise. + * config/arm/semiaof.h: Likewise. + +2001-12-12 Richard Henderson + + * regrename.c (copyprop_hardreg_forward): New optimization. + (kill_value_regno, kill_value, init_value_data, kill_clobbered_value, + kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg, + replace_oldest_value_reg, replace_oldest_value_addr, + replace_oldest_value_mem, copyprop_hardreg_forward_1, + debug_value_data, validate_value_data): New. + * rtl.h (copyprop_hardreg_forward): Declare. + * toplev.c (flag_cprop_registers): New. + (f_options): Add -fcprop-registers + (rest_of_compilation): Invoke it. + (parse_options_and_default_flags): Set it at -O1. + * doc/invoke.texi: Document it. + +2001-12-12 Jakub Jelinek + + * dwarf2out.c (dw_val_class): Add dw_val_class_range_list. + (DEBUG_RANGES_SECTION_LABEL): Define. + (ranges_section_label): Add. + (add_AT_range_list): New. + (print_die, sizeof_die, value_format): Handle dw_val_class_range_list. + (output_loc_list): Location expression length is always 2-byte. + (output_die): Handle dw_val_class_range_list. + (gen_lexical_block_die): Call add_AT_range_list. + (dwarf2out_init): Initialize ranges_section_label. + (dwarf2out_finish): Emit ranges_section_label. + +2001-12-12 Jakub Jelinek + + * c-typeck.c (digest_init): Allow initializing + static storage duration objects with compound literals. + * doc/extend.texi (Compound literals): Document the extension. + +2001-12-12 Richard Henderson + + * emit-rtl.c (adjust_address_1): Always copy address to avoid + shared rtl. + +Wed Dec 12 07:37:52 2001 Olivier Hainque + + * stmt.c (expand_end_case): Do subtraction of lower bound as trees + to avoid overflow. + +Wed Dec 12 07:35:24 2001 Douglas B. Rupp + + * cppfiles.c (read_include_file): Set buffer size properly when + file is shorter than expected. + +Wed Dec 12 08:35:33 2001 Nicola Pero + + * objc/objc-act.c (encode_complete_bitfield): Fixed encoding + enumeral types - encode them using 'i'. + +2001-12-12 Nathan Sidwell + + * doc/extend.texi (Deprecated Features): Deprecate implicit + typename. Document that named return and initializer lists are now + removed. + +2001-12-11 Roger Sayle + + * except.c (reachable_next_level): Handle ERT_UNKNOWN to avoid + compiler warning about enumeration values not being handled. + +2001-12-11 Momchil Velikov + + * config/fp-bit.c (pack_d): Cast to ``fractype'' for long long + shifts. + +2001-12-11 Richard Henderson + + * config/alpha/alpha.h (TARGET_FIXUP_EV5_PREFETCH): New. + * config/alpha/linux.h (TARGET_FIXUP_EV5_PREFETCH): New. + * config/alpha/alpha.md (prefetch): New. + +2001-12-11 Richard Henderson + + * combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C) + if C has only low bits set and doesn't intersect with X or Y. + +Tue Dec 11 23:58:39 EST 2001 John Wehle (john@feith.com) + + * basic-block.h (flow_preorder_transversal_compute): Declare. + * cfganal.c (flow_preorder_transversal_compute): Implement. + +Tue Dec 11 23:54:27 EST 2001 John Wehle (john@feith.com) + + * cfganal.c (flow_depth_first_order_compute): Always + increment dfsnum. + +2001-11-30 Alan Matsuoka + + * combine.c (combine_simplify_rtx) : Can't simplify + cases that use mode class MODE_CC. + +2001-12-11 Richard Henderson + + * expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in + which there is no divide expander. + +2001-12-11 Richard Henderson + + * except.c (sjlj_find_directly_reachable_regions): Don't + consider RNL_BLOCKED a directly reachable region. + (sjlj_assign_call_site_values): Trust directly_reachable. + (sjlj_emit_dispatch_table): Likewise. + +2001-12-11 Richard Henderson + + * config/alpha/alpha.md (divmodsi_internal_er): Split, so that + we represent the address load's dependency on the gp. + (divmoddi_internal_er): Likewise. + (divmodsi_internal_er_1, divmoddi_internal_er_1): New. + +2001-12-11 Richard Henderson + + * emit-rtl.c (widen_memory_access): New. + * expr.h (widen_memory_access): Declare it. + * config/alpha/alpha.c (get_aligned_mem): Use it. + +2001-12-11 Richard Henderson + + * combine.c (simplify_shift_const): Move SHIFT_COUNT_TRUNCATED + simplification above out of range check. + +2001-12-11 Dan Nicolaescu + + * config/sparc/sparc.md (prefetch): New. + +2001-12-11 Aldy Hernandez + + * output.h (regno_uninitialized): Make argument unsigned. + + * flow.c (regno_uninitialized): Make regno unsigned. + +2001-12-11 David O'Brien + + * elfos.h (ENDFILE_SPEC, STARTFILE_SPEC): Do not define. + * config/cris/cris.h (ENDFILE_SPEC): Define. + * config/i386/i386elf.h ((ENDFILE_SPEC, STARTFILE_SPEC): Define. + * config/pa/elf.h: Likewise. + +2001-12-11 Richard Henderson + + * objc/objc-act.c (build_string_class_template): New. + (build_objc_string_object): Call it. + +2001-12-11 Steve Ellcey + + * doc/tm.texi (FUNCTION_ARG_REG_LITTLE_ENDIAN): New. + * defaults.h (FUNCTION_ARG_REG_LITTLE_ENDIAN): New. + * calls.c (store_unaligned_arguments_into_pseudos): Check + FUNCTION_ARG_REG_LITTLE_ENDIAN to see how structures + are passed/returned. + * expr.c (move_block_from_reg): Ditto. + (move_block_from_reg): Ditto. + (copy_blkmode_from_reg): Ditto. + * stmt.c (expand_return): Ditto. + * stor-layout.c (compute_record_mode): If + FUNCTION_ARG_REG_LITTLE_ENDIAN is set then check + MEMBER_TYPE_FORCES_BLK even if mode == VOIDmode. + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Set to true + so that Structures of one field are still treated as structures. + (FUNCTION_ARG_REG_LITTLE_ENDIAN): New, set it to true. + (FUNCTION_ARG_PADDING): Set to ia64_hpux_function_arg_padding(). + (PAD_VARARGS_DOWN): Modify from default to not pad structures down. + * config/ia64/ia64-protos.h (ia64_hpux_function_arg_padding): New. + * config/ia64/ia64.c (ia64_hpux_function_arg_padding): New function + to special case handling of structure padding. + +2001-12-11 Daniel Berlin + + * sched-rgn.c (CONST_BASED_ADDRESS_P): CONST_INT -> CONSTANT_P. + (may_trap_exp): Stores only are risk if they trap, too, not just + if code == MEM. + +2001-12-11 Aldy Hernandez + + * flow.c (find_regno_partial): Indent properly. Add a default to + switch. + +2001-12-11 Neil Booth + + * c-common.c (combine_strings): Complain if concatenating + __FUNCTION__. + * c-parse.in (yylexname): Flag artificial strings. + * tree.h (TREE_ARTIFICIAL_STRING_P): New. +doc: + * extend.texi: Update. + +2001-12-11 Aldy Hernandez + + * c-common.c (type_for_mode): Handle unsigned vectors. + (type_for_mode): Remove redundant calls to TYPE_MODE. + + * tree.c (make_vector): New. + (build_common_tree_nodes_2): Use make_vector for vector types. + Add unsigned vector types. + + * tree.h (tree_index): Add unsigned types for vectors. + (unsigned_V16QI_type_node): New. + (unsigned_V4SI_type_node): New. + (unsigned_V8QI_type_node): New. + (unsigned_V8HI_type_node): New. + (unsigned_V4HI_type_node): New. + (unsigned_V2SI_type_node): New. + +2001-12-11 Stan Shebs + + * objc/objc-act.c (finish_message_expr): Fix misplaced parens in a + test of class names. + +2001-12-11 David O'Brien + + * config.gcc (m68020-*-elf*): Expand tm_file to include all needed + cpu configuration headers. + * config/h8300/elf.h: Include dbxelf.h. + * config/m68k/linux.h: Likewise. + * config/m68k/m68020-elf.h: Likewise. + * config/m68k/m68kv4.h: Likewise. + * config/sh/elf.h: Likewise. + * config/m68k/m68kemb.h: Add comment about the its purpose. + +2001-12-11 Richard Henderson + + * objc/objc-act.c (build_constructor): Cast initializer values + to the proper field types. + +2001-12-11 Jakub Jelinek + + * unwind-dw2.c (execute_cfa_program): Fix DW_CFA_restore handling. + +2001-12-10 Roger Sayle + + * builtins.c (expand_builtin): Use a switch statement to list + those functions not expanded without optimizations, instead of a + series of equality tests. + +Tue Dec 11 07:08:57 2001 Douglas B. Rupp + + * config/alpha/vms.h (LIB_SPEC): Define. + * config/alpha/xm-vms.h (INCLUDE_DEFAULTS): Don't set component field. + + * libgcc2.c (_bb): Remove ctime declaration. + + * Makefile.in (stage[1234]-start): $(LN_S) utilities in a manner + that works if LN_S = cp. + + * config/alpha/x-vms (version): Change "." to "_". + + * configure.in: Hardcode that vfork works on VMS host. + * configure: Regenerated. + +Mon Dec 10 18:37:31 2001 Douglas B. Rupp + + * gcc.c (convert_filename): Add do_obj parameter. Don't convert + unless do_obj true. + (process_command): Modify calls to convert_filename. + +2001-12-11 Rainer Orth + + * config/sparc/sol2-sld-64.h: Include dbxelf.h again. + +Mon Dec 10 15:54:27 2001 Jeffrey A Law (law@cygnus.com) + + * combine.c (known_cond): Check mode of each operand to determine + if COND is comparing floating point values. + +2001-12-10 David Edelsohn + + * rs6000.h (processor_type): Add PPC405. + (RTX_COSTS): Add PPC405. Correct rs64 and ppc630 multiply costs. + * rs6000.md: Add PPC405 information. Utilize imul2 and imul3 for + rios1, rs64, and ppc630 processors. + * rs6000.c (processor_target_table): Add PPC405. + +2001-12-10 Richard Henderson + + * config/alpha/alpha.md (unaligned_extendhidi): Call gen_lowpart + instead of hardcoding subregs into the _be and _le patterns. + +2001-12-10 Neil Booth + + * c-lex.c, c-parse.in, c-typeck.c: Revert concatenation changes. + +Mon Dec 10 09:19:11 2001 Richard Kenner + + * config/i386/i386.md (leave, leave_rex64): Adjust pattern to match + what insn does. + +2001-12-10 Joseph S. Myers + + * doc/cpp.texi: Don't condition menus on @ifinfo. Condition the + copyright notice formerly conditioned on @ifinfo on @ifnottex + instead. + +Mon Dec 10 06:15:44 2001 Richard Kenner + + * vmsdbgout.c (lookup_filename): Remove warning. + +Mon Dec 10 06:09:57 2001 Douglas B. Rupp + + * Makefile.in: Add $(OUTPUT_OPTION) to compilation rules. + + * config.gcc (alpha*-dec-vms*): Change to alpha*-dec-*vms* + (exeext, target_alias, prefix, local_prefix): Define. + * config/alpha/x-vms (USE_COLLECT2): Make empty. + * config/alpha/xm-vms.h (INCLUDE_DEFAULTS): Use Unix style + file specifications. Remove ".". + (GCC_INCLUDE_DIR): Remove redefinition (redundant). + * fixinc/mkfixinc.sh (alpha*-dec-vms*): Change to alpha*-dec-*vms* + +2001-12-09 Nathan Sidwell + + * Makefile.in (.po.gmo): Use POSIXLY_CORRECT argument ordering. + +Sun Dec 9 21:57:24 2001 Douglas B. Rupp + + * config/alpha/t-vms (EXTRA_PARTS): Append $(VMS_EXTRA_PARTS) + Add rules for building [vp]crt0.o + * config/alpha/vms.h (START_FILE_SPEC): Define. + * config/alpha/x-vms (VMS_EXTRA_PARTS): Define + * config/alpha/vms-crt0.c, config/alpha/vms-psxcrt0.c: New files. + * doc/invoke.texi: Document special Alpha/VMS options. + +Sun Dec 9 20:25:17 2001 Richard Kenner + + * hwint.h (HOST_BITS_PER_LONGLONG): Deal with __int64 type. + * vmsdbg.h (DST_SRC_COMMAND): Test for type of long long or __int64, + not GNUC. + +Sun Dec 9 20:19:32 2001 Richard Kenner + Douglas B. Rupp + + * tree.c (append_random_char): Conditionalize INO for VMS. + +2001-12-09 Richard Henderson + + * cfgcleanup.c (label_is_jump_target_p): New function. + (try_optimize_cfg): Use label_is_jump_target_p to check if label is + target of a JUMP_INSN from the preceding block. + +Sun Dec 9 18:40:07 2001 Douglas B. Rupp + + * vmsdbgout.c (lookup_filename): Assign null string instead + of null pointer to fnam. + +2001-12-09 Richard Henderson + + * config/alpha/alpha.c (alpha_align_insns): Suppress realignment + immediately after a call; insert nops before a call. + +2001-12-09 Richard Henderson + + * config/alpha/alpha.c (alpha_align_insns): Use align_functions, + not FUNCTION_BOUNDARY. + * config/alpha/alpha.h (TRAMPOLINE_ALIGNMENT): New. + * config/alpha/alpha32.h, config/alpha/vms.h: Likewise. + * config/alpha/unicosmk.h (FUNCTION_BOUNDARY): Remove. + +2001-12-09 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_function_block_profiler, + mmix_block_profiler, mmix_function_block_profiler_exit): Delete + unused functions. + * config/mmix/mmix-protos.h (mmix_function_block_profiler, + mmix_block_profiler, mmix_function_block_profiler_exit): Delete + prototypes. + + * config/cris/cris.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): + Delete obsoleted macros. + +2001-12-09 Joseph S. Myers + + * doc/cpp.texi, doc/cppinternals.texi, doc/invoke.texi, + doc/md.texi, doc/rtl.texi, doc/tm.texi: Use American spelling. + + * ChangeLog.2, ChangeLog.3, ChangeLog.5, ChangeLog, alias.c, + cfgbuild.c, expmed.c, expr.c, final.c, flow.c, fold-const.c, + function.c, config/alpha/alpha.md, config/alpha/vms-ld.c, + config/arm/arm.c, config/arm/arm.h, config/c4x/libgcc.S, + config/i370/i370.c, config/i386/i386.c, + config/i386/i386-interix.h, config/i386/i386.md, + config/i386/i386.h, config/i386/netbsd-elf.h, config/ia64/ia64.c, + config/m32r/m32r-protos.h, config/mcore/mcore.h, + config/rs6000/rs6000.h, config/sparc/linux64.h, + config/sparc/sparc.c, config/v850/v850-protos.h, + config/cris/cris.h, config/s390/s390.md, config/elfos.h: Fix + spelling errors. + +2001-12-09 Daniel Berlin + + * config/rs6000/rs6000.h (enum rs6000_builtins): Add remaining + altivec builtins (VCF?X, VCT?XS, VSEL, V*EFP, VRFI*). + + * config/rs6000/rs6000.c: Ditto. + + * config/rs6000/rs6000.md: Ditto. + +2001-12-09 Kaveh R. Ghazi + + * 1750a.md: Add default case in switch. + * alpha/vms.h (INITIAL_ELIMINATION_OFFSET): Add abort clause in + if-else statement. + * dsp16xx.c (print_operand_address): Likewise. + * i386/osf1elf.h (FUNCTION_PROFILER): Const-ify. + * ia64.md: Add missing braces. + * rs6000-protos.h (s8bit_cint_operand): Prototype. + * s390.h (INITIAL_ELIMINATION_OFFSET): Add abort clause in + if-else statement. + * stormy16.h (REG_CLASS_CONTENTS): Add missing braces. + * v850.h (OUTPUT_ADDR_CONST_EXTRA): Don't issue a `return'. + * dbxout.c (dbxout_source_file): Move a variable into the scope + where it is used. + * final.c (profile_function): Mark parameter with + ATTRIBUTE_UNUSED. + * genemit.c (gen_expand): Likewise for generated file. + * insn-addr.h (INSN_ADDRESSES_NEW): Avoid undefined behavior. + + * vmsdbg.h: Delete spurious close-comment. + (DST_HEADER): Fix typo in ENUM_BITFIELD parameter. + * vmsdbgout.c (write_modbeg): Define return type. + + * m68k/3b1.h (ASM_OUTPUT_ALIGN): Wrap in do-while(0). + * m68k/amix.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * m68k/atari.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * m68k/hp320.h (ASM_OUTPUT_ALIGN): Likewise. + * m68k/m68kelf.h (ASM_OUTPUT_ALIGN): Likewise. + * m68k/sgs.h (ASM_OUTPUT_ALIGN): Likewise. + * m68k/tower-as.h (ASM_OUTPUT_ALIGN): Likewise. + +2001-12-08 Tom Rix + + * config/rs6000/aix43.h (NON_POWERPC_MASKS): Delete MASK_STRING. + * config/rs6000/aix51.h (NON_POWERPC_MASKS): Same. + * config/rs6000/rs6000.md (load_multiple, store_multiple): Do not use + for powerpc64. + * config/rs6000/rs6000.md (movstrsi_8reg, movstrsi_6reg, + movstrsi_4reg, movstrsi_1_reg): Add powerpc64. + * config/rs6000/rs6000.c (expand_block_move): Do not use + gen_movstrsi_2reg and powerpc64. + +2001-10-08 Aldy Hernandez + + * c-common.h (rid): Add RID_CHOOSE_EXPR and + RID_TYPES_COMPATIBLE_P. + + * c-parse.in (reswords): Add __builtin_choose_expr. + Add __builtin_types_compatible_p. + Add CHOOSE_EXPR token. + Add TYPES_COMPATIBLE_P token. + Add production for CHOOSE_EXPR. + Add production for TYPES_COMPATIBLE_P. + + * doc/extend.texi (__builtin_choose_expr): Add documentation. + (__builtin_types_compatible_p): Likewise. + +2001-12-08 David Edelsohn + + * stor-layout.c (place_union_field): Apply ADJUST_FIELD_ALIGN + to unions. + +2001-12-08 Neil Booth + + * c-parse.in: Take string literals in assembler constructs, + not expressions. + * c-typeck.c (build_asm_stmt, simple_asm_stmt): No need to + check the strings are STRING_CSTs. + +2001-12-08 Neil Booth + + * c-lex.c (c_lex): Peek a token ahead for a string to concatenate, + using combine_strings to do the concatenation. + * c-parse.in: Replace uses of the string non-terminal with STRING. + Don't attempt string concatenation. + (OBJC_STRING): New terminal. + (string): Remove non-terminal. + (_yylex): Call combine_strings on function names. Generate + OBJC_STRING terminals; don't pass '@' on to yacc. + * c-typeck.c (simple_asm_stmt): Don't concatenate strings here. + (build_asm_stmt): Similarly. + +2001-12-08 Kaveh R. Ghazi + + * rtlanal.c (get_jump_table_offset): Delete unused variable. + +2001-12-08 Richard Earnshaw + + * arm.md (VUNSPEC_PREFETCH): Delete constant definition. + (prefetch): Rewrite using PREFETCH RTL primitive. + * arm.h (arm_builtins): Delete ARM_BUILTIN_PREFETCH). + * arm.c (arm_init_builtins): Don't initialize a builtin for + __builtin_prefetch here. + (arm_expand_builtin): Don't expand __builtin_prefetch here. + +2001-12-08 Richard Earnshaw + + * final.c (cleanup_subreg_operands): Use recog_data.operand_loc + in test for a subreg. + +2001-12-08 John David Anglin + + * rtl.c (rtx_equal_p): Check for null pointers when comparing rtx + strings. + +2001-12-07 Richard Henderson + + * doc/extend.texi: Fix typo last change. + + * c-decl.c (c_language): Remove duplicate. + +2001-12-07 Dale Johannesen + + * config/rs6000/darwin.h: Set MAX_LONG_TYPE_SIZE to 32. + * config/rs6000/rs6000.c (rs6000_emit_move): In Darwin- + specific codegen, eliminate a register copy. + (print_operand_address): Add support for Darwin's lo16(constant) + syntax. + (rs6000_machopic_legitimize_pic_address): Fix darwin-specific + generation of addresses within very large data objects. + (s8bit_cint_operand): New. + * config/rs6000/rs6000.md: Remove "iu" reference for 750/7400. + Move "mtjmpr" to correct functional unit for 750/7400/7450. + Add imul2 and imul3 insn types for multiplication by 16- and + 8-bit constants. + Change tablejump patterns to strongly discourage using LR + rather than CTR. + Add %lo16 patterns for Darwin loads and stores. + +2001-12-07 Kaveh R. Ghazi + + * alpha.md: Use (HOST_WIDE_INT)1<<63 in lieu of 0x8000000000000000. + +2001-12-07 Stephane Carrez + + * config/sparc/sparc.c (epilogue_renumber): Do not replace %fp + with %sp because it can cause the delayed instruction to load + below the stack. + +2001-12-07 Kaveh R. Ghazi + + * alpha.c (alpha_expand_unaligned_store, + alpha_expand_unaligned_store_words): Use constm1_rtx in place of + call to immed_double_const. + +2001-12-07 Aldy Hernandez + + * doc/extend.texi (Variable Attributes): Document vector_size. + + * attribs.c (c_common_attribute_table): Add vector_size. + (handle_vector_size_attribute): New. + (vector_size_helper): New. + (decl_attributes): Relayout the decl after calculating attribs. + +2001-12-07 Joseph S. Myers + + * doc/gcc.texi: Don't include install-old.texi. Adjust menu + description for Trouble section. + * doc/install-old.texi: Adjust for inclusion as chapter of new + installation manual. + * doc/install.texi, doc/include/fdl.texi, doc/install.texi2html: + Adjust to include old installation chapter as chapter of new + installation manual. + +Fri Dec 7 11:07:35 EST 2001 John Wehle (john@feith.com) + + * rtl.h (get_jump_table_offset): Declare. + * rtlanal.c (get_jump_table_offset): Implement. + +Fri Dec 7 07:06:17 2001 Richard Kenner + + * final.c (bb_head, bb_tail, bb_file_label_num, bb_func_label_num): + Deleted; were used only by BB profiler code. + (sbb_head, sbb_tail, sbb_label_num): Likewise. + (end_final): Delete now-unused vars I, PTR, and SPTR. + + * expr.c (store_field): Remove warning. + (expand_expr, case COMPONENT_REF, case VIEW_CONVERT_EXPR): Likewise. + (highest_pow2_factor, case MIN_EXPR, case MAX_EXPR): Add cases. + (highest_pow2_factor, case *_DIV_EXPR): Only can do something if + divisor constant power of 2. + (highest_pow2_factor, case COMPOUND_EXPR): Look at operand 1. + +2001-12-07 Kaveh R. Ghazi + + * alpha.c (function_arg): Cast value to HOST_WIDE_INT before + shifting. + +2001-12-06 Aldy Hernandez + + * rs6000.h (PRE_GCC3_DWARF_FRAME_REGISTERS): New. + (DWARF_FRAME_REGISTERS): Delete. + +2001-12-06 Janis Johnson + + * builtin-types.def (BT_FN_VOID_PTR_VAR): New. + * builtins.def (BUILT_IN_PREFETCH): Change arguments. + * builtins.c (expand_builtin_prefetch): Two arguments are now optional, + with defaults for read prefetch with high degree of locality. + * doc/extend.texi (__builtin_prefetch): Update documentation. + * doc/md.texi (prefetch): Add documentation. + +2001-12-06 Rainer Orth + + * fixinc/inclhack.def (stdio_va_list): Handle __VA_LIST__ in Tru64 + UNIX V5.1A stdio.h. + * fixinc/fixincl.x: Regenerate. + Fixes PR libf2c/4826. + +2001-12-06 Aldy Hernandez + Richard Henderson + + * doc/tm.texi (DWARF_FRAME_REGISTERS): Add documentation. + (PRE_GCC3_DWARF_FRAME_REGISTERS): Same. + + * unwind-dw2.c (__frame_state_for): Change DWARF_FRAME_REGISTERS + to PRE_GCC3_DWARF_FRAME_REGISTERS. + (frame_state): Same. + (PRE_GCC3_DWARF_FRAME_REGISTERS): Define if not already defined. + +2001-12-06 Kaveh R. Ghazi + + * langhooks.c (lhd_staticp): Mark parameter with + ATTRIBUTE_UNUSED. + +2001-12-06 H.J. Lu + + * Makefile.in (.po.gmo): Use "-test -d po || mkdir po" to + reduce noise. + (.po.pox): Likewise. + (o/$(PACKAGE).pot): Likewise. + +2001-12-06 Alexandre Oliva + + * tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following... + * tree-inline.c (expand_call_inline): ... here. + +2001-12-06 H.J. Lu + + * Makefile.in (.po.gmo): Use "-mkdir po" for parallel build. + (.po.pox): Likewise. + (o/$(PACKAGE).pot): Likewise. + +2001-12-06 David O'Brien + + * config.gcc: Include dbxelf.h before elfos.h. + * elfos.h: Don't include dbxelf.h, let config.gcc handle it. + +2001-12-06 Zack Weinberg + + * cppfiles.c (open_file): If we've opened a directory by + mistake, close it. + (find_include_file): Avoid turning / into // or // into ///. + +2001-12-06 Nick Clifton + + * config/arm/arm.h (STRUCT_VALUE): Suppress definition. + (STRUCT_VALUE_REGNUM): Restore definition. + +2001-12-06 Andrew MacLeod + + * flow.c (find_regno_partial): Return register, not the expression + the register is in. + +Thu Dec 6 09:24:12 2001 Richard Kenner + + * function.c (handle_epilogue_set): Check for FP setting case when + SP is set from FP in same insn. + +2001-12-06 Nick Clifton + + * config/arm/arm.c (load_multiple_sequence): Pass pointer to + RTX when calling alter_subreg(). + (store_multiple_sequence): Pass pointer to RTX when calling + alter_subreg(). + +Thu Dec 6 06:55:13 2001 Richard Kenner + + * function.c (assing_parms): Fix typo in last change. + * config/clipper.c (clipper_builtin_saveregs): Remove Checker code. + * config/m88k/m88k.c (m88k_builtin_saveregs): Likewise. + * config/pa/pa.c (hppa_builtin_saveregs): Likewise. + * config/sparc/sparc.c (sparc_builtin_saveregs): Likewise. + +2001-12-06 Alan Modra + + * config/rs6000/rs6000.c (rs6000_unique_section): Simplify and + correct code selecting section. + +Thu Dec 6 12:45:33 CET 2001 Jan Hubicka + + * final.c (count_basic_block, add_bb, add_bb_string): + Kill. + (end_final, final_start_function, final, final_scan_insn, + leaf_function_p): Kill BB profiler related code. + * flags.h (profile_block_flag): Kill. + * libgcc2.c (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE, + BB_BUCKETS, BBINBUFSIZE, bb_edge, bb_func_mode, bb_func, + __bb, bb_src, bb_dst, bb_tracefile, bb_hashbuckets, + bb_func_head, bb_callcount, bb_mode, bb_stack, bb_stacksize + reported, GOPENDECOMPRESS, GOPENCOMPRESS, gopen, gclose, + __bb_exit_trace_func, __bb_init_prg, __bb_trace_func, + __bb_trace_func_ret, __bb_init_file, __bb_trace_ret, + __bb_init_trace_func): Kill. + * toplev.c (profile_block_flag): Kill. + (indepdendent_decode_option, process_options): Kill -a related code. + * alpha.c (direct_call_operand): Likewise. + * arm.c (arm_expand_prologue, thumb_expand_prologue, + thumb_expand_epilogue): Likewise. + * c4x.c (c4x_expand_prologue, c4x_null_epilogue_p): Likewise. + * c4x.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * d30v.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * fr30.c (fr30_expand_prologue): Kill BB profiler related code. + * i386.c (ix86_can_use_return_insn_p, ix86_expand_prologue, + ix86_expand_epilogue, ix86_expand_epilogue): Kill BB profiler related + code. + (ix86_output_function_block_profiler, ix86_output_block_profiler): Kill. + * i386.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * fr30.c (fr30_expand_prologue): Kill BB profiler related code. + * i960.c (i960_output_function_prologue): Kill BB profiler related + code. + * ia64.c (ia64_compute_frame_size): Likewise. + * ia64.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * m32r.c (m32r_expand_prolofue): Kill BB profiler related code. + * m68hc11.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * m68k.c (m68k_output_function_epilogue): Kill BB profiler related code. + * m68k.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * m88k.c (output_options, m88k_layout_frame, m88k_expand_prologue): + Kill BB profiler related code. + * m88k.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * mips.c (mips_expand_prologue): Kill BB profiler related code. + * mmix.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * rs6000.c (rs6000_override_options): Kill BB profiler related code. + * s960.c (s390_function_prologue): Kill BB profiler related code. + * s960.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * linux-aout.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * linux.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * linux64.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * sol2.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * sparc.c (sparc_override_options, eligible_for_sibcall_delay, + sparc_nonflat_function_epilogue): Kill BB profiler related code. + (sparc_function_block_profiler, sparc_block_profiler, + sparc_function_block_profiler_exit): Kill. + * sparc.h (OVERRIDE_OPTIONS): Kill BB profiler related code. + (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * sun4o3.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * sunos4.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill. + * stormy16.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + * doc/invoke.texi: Kill documentation of -a and -ax. + * tm.texi (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER, + FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE, + MACHINE_STATE_RESTORE): Kill. + +2001-10-26 Steve Christiansen + + * doc/rtl.texi: Use a table to display RTL format characters. + +2001-12-06 Bo Thorsen + + * config/i386/linux64.h (LINK_SPEC): Correct name of dynamic linker. + +Wed Dec 5 19:18:53 2001 Richard Kenner + + * function.c (keep_stack_depressed): Check global_live_at_start + of EXIT_BLOCK for temp register and verify it isn't in equiv_reg_src. + +2001-12-05 David O'Brien + + * config.gcc (powerpc-*-freebsd*): Use the proper tmake_file files, + as set by the generic FreeBSD configure framework. + +2001-12-04 Jason Merrill + + * langhooks.h (struct lang_hooks_for_tree_inlining): Add + start_inlining, end_inlining. + * tree-inline.c (expand_call_inline): Call them. + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_START_INLINING): Define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Define. + (LANG_HOOKS_TREE_INLINING_INITIALIZER): Add them. + * langhooks.c (lhd_tree_inlining_start_inlining): New fn. + (lhd_tree_inlining_end_inlining): New fn. + +2001-12-05 Neil Booth + + * c-common.c (shadow_warning): New function, moved from cp/decl.c. + * c-common.h (shadow_warning): New. + * c-decl.c: Include c-common.h. + (warn_if_shadowing): New, broken out of pushdecl. + (pushdecl): Use warn_if_shadowing. + (store_parm_decls): Prevent duplicate -Wshadow warnings. + +Wed Dec 5 17:59:19 2001 Douglas B. Rupp + + * config/alpha/vms.h (SIZE_TYPE, PTRDIFF_TYPE): Remove, were disabled. + (DOLLARS_IN_IDENTIFIERS, LINK_SPEC): Remove duplicate. + (LIB_SPEC): Remove. + +Wed Dec 5 16:03:04 2001 Richard Kenner + + * doc/c-tree.texi (RECORD_TYPE, UNION_TYPE): Expand on definition. + (QUAL_UNION_TYPE): New type. + + * varasm.c (output_constant, case ERROR_MARK): New case. + + * attribs.c (handle_no_check_memory_usage_atribute): Deleted. + (c_com): Delete its reference. + * builtins.c: Delete memory checking code. + * calls.c, expr.c, function.c, stmt.c: Likewise. + * builtins.c (expand_builtin_arg_info): Remove reference to + EXPAND_MEMORY_USE_* modifiers. + * explow.c (expr_size): Likewise. + * expr.c (expand_expr, expand_increment): Likewise. + * expr.h (ARGS_SIZE_RTX): Likewise. + * function.c (assign_parms, expand_pending_sizeso): Likewise. + * c-decl.c (duplicate_decls): Don't handle DECL_NO_CHECK_MEMORY_USAGE. + * expr.c (in_check_memory_usage): Delete. + (get_push_address, get_memory_usage_from_modifier): Delete. + (expand_assigment): Use EXPAND_WRITE on destination. + (expand_expr): Delete ro_modifier. + * expr.h (expand_modifier): Delete EXPAND_MEMORY_* entries and + add EXPAND_WRITE. + (memory_use_mode): Delete. + * flags.h (flag_check_memory_usage): Deleted. + (flag_prefix_function_name): Likewise. + * function.c (expand_function_start): Don't set + current_function_check_memory_usage. + * function.h (check_memory_usage): Delete. + * libfuncs.h, optabs.c: Delete chkr_* stuff. + * stmt.c (expand_asm_opernd): Change EXPAND_MEMORY_USE_WO to + EXPAND_WRITE. + * toplev.c (flag_check_memory_usage): Deleted. + (flag_prefix_function_name): Likewise. + (f_options, process_options): Delete references to above. + * tree.h (DECL_NO_CHECK_MEMORY_USAGE): Deleted. + * varasm.c (CHKR_PREFIX): Deleted. + (make_decl_rtl): Remove flag_prefix_function_name handling. + (assemble_name): Likewise. + * doc/extend.texi: Remove no_check_memory_usage attribute. + * doc/invoke.texi: Remove -fcheck-memory-usage + and -fprefix-function-name. + +2001-12-05 Andreas Schwab + + * Makefile.in (STMP_FIXPROTO, STMP_FIXINC): Use substituted values + from autoconf. + +2001-12-05 Nick Clifton + + * config.gcc: Include arm/xscale-coff.h before arm/arm.h. + +2001-12-05 William Cohen + + * config/arm/arm.h (THUMB_FUNCTION_PROFILER): Correct typo in + instruction. + +2001-12-05 Daniel Berlin + + * config/rs6000/rs6000.h (enum rs6000_builtins): Add more altivec + builtins. + + * config/rs6000/rs6000.md: Modeling of 7450 altivec changed to + better reflect reality (change from Apple's tree). + Add more of altivec instructions. + Add ftruncv4sf2 pattern. + Remove more unspecs (vector merge instructions, etc). + + * config/rs6000/rs6000.c (bdesc_3arg): New, for 3 argument altivec + builtins. + (bdesc_1arg): New, for 1 argument altivec builtins. + (altivec_expand_builtin): Handle unary and ternary ops. + (altivec_init_builtins): Ditto. + +Wed Dec 5 09:33:39 2001 Richard Kenner + + * config/alpha/vms.h (ADA_LONG_TYPE_SIZE): New macro. + * doc/tm.texi (ADA_LONG_TYPE_SIZE): Document it. + +2001-12-05 Jakub Jelinek + + * gcse.c (store_killed_in_insn): Consider pure calls + as potential store killers in addition to normal calls. + +2001-12-05 Jakub Jelinek + + * expr.c (expand_expr): When checking promoted value, use + DECL_MODE (exp) and not mode. + +2001-12-05 Jakub Jelinek + + * c-typeck.c (output_init_element): Call digest_init + just once, not in each if branch and check its return value for + error_mark_node. + +2001-12-05 Jakub Jelinek + + * c-decl.c (pushdecl): Only increase n_incomplete if pushed decl's + type is RECORD_TYPE, UNION_TYPE or ARRAY_TYPE thereof. + (finish_struct): Break the loop if n_incomplete went to 0. + For ARRAY_TYPE, if it is not TYPE_DECL, layout the decl too. + +Wed Dec 5 07:41:13 2001 Douglas B. Rupp + + * config/alpha/alpha.c (alpha_va_start): Update VMS case. + +Wed Dec 5 07:27:42 2001 Richard Kenner + Douglas B. Rupp + + * vmsdbg.h, vmsdbgout.c: Add documentation and minor cleanups. + * doc/invoke.texi: Add -gvms. + * doc/passes.texi: Add mention of vmsdbgout.c. + * doc/tm.texi: Document VMS debugging output. + +Wed Dec 5 06:26:27 2001 Richard Kenner + + * function.h (tree, rtx): Remove no-longer-needed definitions. + + * function.c (keep_stack_depressed): Refine check for register + clobbered over call. + + * expr.c (store_expr): When copying string constant into array, + use functions that update memrefs instead of computations on + addresses to better track MEMs. Also properly handle 32/64 pointers. + (expand_expr): Use TARGET even if not reg for multi-word CONSTRUCTOR. + (expand_expr, case CONSTRUCTOR): Fix errors in parms to assign_temp. + + * emit-rtl.c (component_ref_for_mem_expr): Try harder to find decl + underneath COMPONENT_REFs. + (set_mem_attributes): Also strip VIEW_CONVERT_EXPR. + +2001-12-05 Neil Booth + + * toplev.c (display_target_options): Don't print twice. + +Wed Dec 5 00:42:16 EST 2001 John Wehle (john@feith.com) + + * emit-rtl.c (set_unique_reg_note): Don't set + a REG_EQUAL or REG_EQUIV note if multiple sets + are present. + +2001-12-04 John David Anglin + + * cfgrtl.c (verify_flow_info): Allow jump table data in fallthru if + CASE_DROPS_THROUGH. + +2001-12-04 Andrew MacLeod + + * rtl.h (initialize_uninitialized_subregs): New prototype. + * toplev.c (rest_of_compilation): Call initialize_uninitialized_subregs + when optimization is on. + * flow.c (find_regno_partial): Find subregs within an expression. + (initialize_uninitialized_subregs): Initialize live on entry registers + which are used in subreg expressions. + +2001-12-04 Phil Edwards + + * Makefile.in: Add INSTALL_SCRIPT using INSTALL definition. + +2001-12-04 DJ Delorie + + * fixinc/fixincl.c (initialize): Avoid problemsome macro + parameter names (PR 3388). + +2001-12-05 Alan Modra + + * config/rs6000/rs6000.c (rs6000_legitimize_address): Fix typo. + * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Here too. + +2001-12-04 Joseph S. Myers + + * c-common.def (COMPOUND_LITERAL_EXPR): New. + * c-common.c (c_expand_expr): Handle COMPOUND_LITERAL_EXPR. + (c_staticp): New function. + * c-common.h (COMPOUND_LITERAL_EXPR_DECL): New. + (c_staticp): Declare. + * c-typeck.c (default_function_array_conversion, build_unary_op): + Don't handle CONSTRUCTOR specially. + (lvalue_p, mark_addressable): Handle COMPOUND_LITERAL_EXPR. + * c-decl.c (build_compound_literal): New function. + * c-tree.h (build_compound_literal): Declare. + * c-parse.in (primary): Use build_compound_literal. + * c-lang.c (LANG_HOOKS_STATICP): Define. + * objc/objc-lang.c (LANG_HOOKS_STATICP): Likewise. + * doc/c-tree.texi: Document COMPOUND_LITERAL_EXPR. + * doc/extend.texi: Update documentation of compound literals. + Fixes PR c/4787. + +2001-12-04 Joseph S. Myers + + * langhooks.h (struct lang_hooks): Add staticp. + * langhooks-def.h (lhd_staticp, LANG_HOOKS_STATICP): New. + (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_STATICP. + * langhooks.c (lhd_staticp): New function. + * tree.c (staticp): Call lang_hooks.staticp for language-specific + tree codes. + +2001-12-04 Neil Booth + + * cppspec.c (lang_specific_driver): Set is_cpp_driver. + * gcc.c (process_command): Ensure the cpp driver sees + --help and --target-help, and that the help is printed + exactly once. + +2001-12-04 David Edelsohn + + * config/elfos.h (ASM_OUTPUT_INTERNAL_LABEL): Display count unsigned. + +2001-12-04 Hans-Peter Nilsson + + * config/cris/cris.h (OPTIMIZATION_OPTIONS): Don't unset + flag_strict_aliasing. Use separate assignment statements. + +2001-12-04 Zack Weinberg + + * build-make, cross-make: Delete file. + * configure.in: Set and substitute CROSS, ALL, + SYSTEM_HEADER_DIR, HOST_PREFIX, HOST_PREFIX_1, HOST_CC, + HOST_CFLAGS, STMP_FIXINC, and STMP_FIXPROTO depending on + whether build == host and host == target. Do not + AC_SUBST_FILE build_overrides or cross_overrides. Do not + AC_SUBST cross_defines or extra_c_flags. + * Makefile.in (NATIVE_SYSTEM_HEADER_DIR): New. + (SYSTEM_HEADER_DIR, HOST_PREFIX, HOST_CC, HOST_PREFIX, + HOST_PREFIX_1, HOST_CFLAGS, ALL, INTERNAL_CFLAGS): Set + partially or completely with autoconf-substituted @variable@ + notation. + (INSTALL_TARGET, @cross_defines@, @cross_overrides@, + @build_overrides@, @extra_c_flags@, all.build, install-build, + install-cross-rest, install-float-h-cross): Deleted. + (install-normal): Rename to install. Delete old "install" + indirection rule. + +2001-12-04 Andrew MacLeod + + * stmt.c (expand_return): Clear destination instead of clobbering it + when setting a return value via bitsets. + +2001-12-04 Alexandre Oliva + + * tree.c (get_callee_fndecl): Only use DECL_ABSTRACT_ORIGIN if + it has DECL_SAVED_TREE. + + * c-decl.c (duplicate_decls): Revert rth's patch. If newdecl + is in a different binding level, get its abstract origin to be + olddecl. + * tree-inline.c (expand_call_inline): Move DECL_INITIAL sanity + check earlier. + * tree.c (get_callee_fndecl): Follow DECL_ABSTRACT_ORIGIN if + DECL_INITIAL is NULL. + +2001-12-04 Jakub Jelinek + + * flow.c (ior_reg_cond): Return NULL if ! add and rtx wasn't optimized. + Return correct value if one of the subexpressions was optimized to + 0 resp. 1. Optimize (x | A) | x and (x & A) | x. + (and_reg_cond): Similarly. + +2001-12-04 Jakub Jelinek + + * function.c (assign_parms): Set last_named only for last named + argument. + +2001-12-04 Joseph S. Myers + + * doc/install.texi: Use the GFDL. Include years from old install + manual in copyright notice. Include copyright and GFDL notice on + HTML index page. Include usual footer on testing.html. + * doc/install.texi2html: Build gfdl.html. Use -I + $SOURCEDIR/include. + * doc/include/fdl.texi: Adapt for use in the install manual. + +2001-12-04 Joseph S. Myers + + * doc/install.texi: Document that installed native compiler for + building cross compilers should be GCC 2.95 or later. + +2001-12-03 Eric Christopher + + * config/mips/mips.h (CALL_REALLY_USED_REGISTERS): New macro. + * config/mips/mips.md: Check TARGET_DEBUG_D_MODE before split + patterns. + +2001-12-03 Janis Johnson + + * rtl.def (PREFETCH): New rtx code. + * doc/rtl.texi (PREFETCH): Add documentation. + * function.c (instantiate_virtual_regs_1): Handle PREFETCH rtx. + * rtlanal.c (reg_referenced_p): Ditto. + * sched-vis.c (print_exp): Ditto. + * ssa-dce.c (find_inherently_necessary): Ditto. + + * config/ia64/ia64.h (SIMULTANEOUS PREFETCHES): Define. + (PREFETCH_BLOCK): Define. + * config/ia64/ia64.md (itanium_class): Add lfetch. + (prefetch, prefetch_internal): New. + + * builtin-types.def (BT_FN_VOID_PTR_INT_INT): New. + * builtins.def (BUILT_IN_PREFETCH): New. + * builtins.c (expand_builtin_expect): New. + (expand_builtin): Call it. + * doc/extend.texi: Document __builtin_prefetch. + + * config/i386/i386.md (prefetch): Rename as prefetch_sse to avoid + conflicts with new generic prefetch functionality. + * config/i386/i386.c (ix86_expand_builtin): Use new name for + prefetch_sse. + +2001-12-02 Ziemowit Laski + + * objc/Make-lang.in: Update copyright. + (OBJC_OBJS): Add objc-lang.o. + (objc-lang.o): New rule. + * objc/config-lang.in: Fix file description and update + copyright. + * objc/objc-act.c: Do not include langhooks.h and + langhooks-def.h + (lang_hooks): Move (along with LANG_HOOKS...) to objc-lang.c. + (objc_post_options): Move to objc-lang.c. + (objc_init_options): Move to objc-lang.c. + (objc_init): Make non-static. + (objc_decode_option): Make non-static. + (HASHFUNCTION): Remove macro. + (hash_func): New function. + (hash_enter): Replace HASHFUNCTION with hash_func. + (hash_lookup): Replace HASHFUNCTION with hash_func. + (maybe_objc_tree_codes): New function. + (init_objc): Move ObjC tree code initialization to + maybe_objc_tree_codes(). + * objc/objc-act.h (GCC_OBJC_ACT_H): New include guard. + (objc_init): New public prototype. + (objc_decode_option): New public prototype. + (maybe_add_objc_tree_codes): New public prototype. + * objc/objc-lang.c: New file. + (lang_hooks): Moved from objc-act.c. + (objc_post_options): Moved from objc-act.c. + (objc_init_options): Moved from objc-act.c. + +2001-12-03 Geoff Keating + + * emit-rtl.c (gen_lowpart_common): Avoid unwanted sign-extension + of array elements. + +2001-12-03 Neil Booth + + PR c/4988 + * gcc.c (process_command): Don't add a preprocessor option for + --help and --target-help; cc1 is enough. + +2001-12-03 Neil Booth + + * c-decl.c (grokdeclarator): Use ISO word. + * cppinit.c: Remove leading capital from diagnostic messages, as + per GNU coding standards. + * emit-rtl.c: Similarly. + * final.c: Similarly. + * gcc.c: Similarly. + * tradcpp.c: Similarly. + * config/arm/arm.c: Similarly. + * config/arm/arm.h: Similarly. + * config/avr/avr.c: Similarly. + * config/avr/avr.h: Similarly. + * config/c4x/c4x.c: Similarly. + * config/cris/cris.c: Similarly. + * config/cris/cris.h: Similarly. + * config/d30v/d30v.c: Similarly. + * config/dsp16xx/dsp16xx.c: Similarly. + * config/dsp16xx/dsp16xx.h: Similarly. + * config/h8300/h8300.c: Similarly. + * config/i386/i386.c: Similarly. + * config/i386/xm-djgpp.h: Similarly. + * config/i960/i960.h: Similarly. + * config/m32r/m32r.c: Similarly. + * config/m68hc11/m68hc11.c: Similarly. + * config/m88k/m88k.c: Similarly. + * config/m88k/m88k.h: Similarly. + * config/mcore/mcore.c: Similarly. + * config/mcore/mcore.h: Similarly. + * config/mips/mips.c: Similarly. + * config/mmix/mmix.c: Similarly. + * config/pa/pa.c: Similarly. + * config/rs6000/rs6000.c: Similarly. + * config/rs6000/sysv4.h: Similarly. + * config/s390/s390.c: Similarly. + * config/sparc/sparc.c: Similarly. + * config/v850/v850-c.c: Similarly. + * config/v850/v850.c: Similarly. + +2001-12-03 Zack Weinberg + + * rs6000.h (RETURN_IN_MEMORY): Cast result of + int_size_in_bytes to unsigned HOST_WIDEST_INT so that -1 > 8. + +Mon Dec 3 09:18:34 2001 Jeffrey A Law (law@cygnus.com) + + * mn10200.md (negsf2): Use -0x8000 instead of 0x8000 for + bit twiddling constant. + +Mon Dec 3 16:16:37 CET 2001 Jan Hubicka + + * gcse.c (delete_null_pointer_checks_1): Do not use delete_list; + call purge_dead_edges after removing. + (delete_null_pointer_checks): Do not handle delete_list. + + * cfgbuild.c (inside_basic_block_p, control_flow_insn_p): Break out from ... + (count_basic_blocks): ... here. + (find_basic_blocks, find_bb_boundaries): Cleanup. + + * stor-layout.c (fixup_signed_type, fixup_unsigned_type): Avoid + overflow for types greater then 2 * HOST_WIDE_INT. + + * reload.c (find_reloads): Update the duplicates after swapingg. + +Mon Dec 3 13:52:19 CET 2001 Jan Hubicka + + * i386.md (movabsqi*): Use 'b' prefix instead of 'q'. + +2001-12-02 Zack Weinberg + + * config/rs6000/rs6000.h (MASK_ALTIVEC_ABI, + MASK_LONG_DOUBLE_128): Delete. + (MASK_AIX_STRUCT_RET, MASK_AIX_STRUCT_RET_SET, + TARGET_AIX_STRUCT_RET): New flags. + (TARGET_SWITCHES): Remove entries for -mlong-double-128 and + -mlong-double-64. Add entries for -m(no-)aix-struct-return + and -m(no-)svr4-struct-return. + (TARGET_OPTIONS): Add entry for -mlong-double-. + (rs6000_long_double_size_string, rs6000_long_double_type_size, + rs6000_altivec_abi): Declare. + (TARGET_LONG_DOUBLE_128, TARGET_ALTIVEC_ABI, + LONG_DOUBLE_TYPE_SIZE): Change definitions to match. + (RETURN_IN_MEMORY): If !TARGET_AIX_STRUCT_RET, return + structures of size <= 8 bytes in registers. + (PRINT_OPERAND_PUNCT_VALID_P): Take out '$' and '*'. + + * config/rs6000/rs6000.c (rs6000_long_double_size_string, + rs6000_long_double_type_size, rs6000_altivec_abi): New + globals. + (rs6000_override_options): Set rs6000_long_double_type_size + from rs6000_long_double_size_string, if nonzero. Set the + MASK_AIX_STRUCT_RET bit in target_flags from DEFAULT_ABI, if + not already set. + (rs6000_parse_abi_options): Set rs6000_altivec_abi, not a + target_flags bit. + (rs6000_init_builtins): This hook now takes no arguments. + + * config/rs6000/netbsd.h, config/rs6000/linux.h: Define + DRAFT_V4_STRUCT_RET to 1. + +2001-12-03 Joseph S. Myers + + * c-typeck.c (really_start_incremental_init, push_init_level): + Avoid constructor_max_index being other than an INTEGER_CST. + +2001-12-02 David Edelsohn + + * config/rs6000/xcoff.h (ASM_OUTPUT_INTERNAL_LABEL): Display count + unsigned. + (ASM_GENERATE_INTERNAL_LABEL): Same. + (UNIQUE_SECTION): Fix typo. + +2001-12-02 Richard Henderson + + * c-decl.c (duplicate_decls): Conditionalize DECL_SAVED_TREE copy. + +2001-12-02 Richard Henderson + + * rtl.h (mem_attrs): Rename decl to expr; adjust all users. + (MEM_EXPR): Rename from MEM_DECL; adjust all users. + * emit-rtl.c (set_mem_expr): Rename from set_mem_decl. + * expr.h, final.c, reload1.c: Adjust users. + + * alias.c (nonoverlapping_component_refs_p): New. + (decl_for_component_ref, adjust_offset_for_component_ref): New. + (nonoverlapping_memrefs_p): Use them. + * emit-rtl.c (component_ref_for_mem_expr): New. + (set_mem_attributes): Use it. + (set_mem_offset): New. + * expr.c (expand_assignment): Call set_mem_attributes for + inner references; adjust the memory offset as needed. + * print-rtl.c (print_mem_expr): New. + (print_rtx): Use it. + +Sun Dec 2 09:22:25 2001 Douglas B. Rupp + + * config/x-interix3 (SYSTEM_HEADER_DIR): Put back default. + + * config/alpha/vms.h (VMS_DEBUGGING_INFO): New macro. + (PREFERRED_DEBUGGING_TYPE): Define as VMS_AND_DWARF2_DEBUG. + (ASM_SPEC): Don't redefine. + (OPTIMIZATION_OPTIONS, OVERRIDE_OPTIONS, LINK_SPEC): Define. + * config/alpha/t-vms (EXTRA_PARTS): Use; add rule for vms-dwarf2.asm. + * config/alpha/vms-dwarf2.asm: New file. + + * Makefile.in (OBJS): Add vmsdbgout.c and its rule. + * c-lex.c (init_c_lex): Test for VMS_AND_DWARF2_DEBUG. + * debug.h (gcc_debug_hooks): Add vmsdbg_debug_hooks. + (vmsdbgout_after_prologue): New declaration. + * defaults.h (VMS_DEBUGGING_INFO): Add to PREFERRED_DEBUGGING_TYPE. + * dwarf2.h (dwarf_attribute): New DW_AT_VMS_rtnbeg_pd_address. + * dwarf2out.c (dwarf2out_do_frame): Test for VMS_AND_DWARF2_DEBUG. + (dwarf2out_frame_finish): Test for VMS_AND_DWARF2_DEBUG. + (dwarf_attr_name): Use DW_AT_VMS_rtnbeg_pd_address. + (add_name_and_src_coords_attributes): Test VMS_DEBUGGING_INFO + * final.c (final_start_function): Test for VMS_AND_DWARF2_DEBUG. + Test VMS_DEBUGGING_INFO. + (final_end_function): Test for VMS_AND_DWARF2_DEBUG. + (final_scan_insn): Test for VMS_AND_DWARF2_DEBUG and VMS_DEBUG. + * flags.h (debug_info_type): Add VMS_DEBUG and VMS_AND_DWARF2_DEBUG. + * toplev.c (compile_file): Test VMS_DEBUGGING_INFO, VMS_DEBUG, and + VMS_AND_DWARF2_DEBUG. + (rest_of_type_compilation): Test for VMS_AND_DWARF2_DEBUG. + (decode_g_option): Add "vms" to debug_type_names. + (process_options): Set vmsdbg_debug_hooks if -gvms. + (lang_independent_init): Emit line number for VMS unless -g0. + * tree.c: (build_complex_type): Test for VMS_AND_DWARF2_DEBUG. + * vmsdbg.h, vmsdbgout.c: New files. + +Sun Dec 2 09:03:06 2001 Richard Kenner + + * cfgbuild.c (SET_STATE): Add cast to eliminate warning.a + +2001-12-02 Kaveh R. Ghazi + + * cfgrtl.c (purge_all_dead_edges): Initialize variable. + * dwarf2out.c (is_cxx): Prototype. + * local-alloc.c (block_alloc): Avoid 'unsigned>=0 is always true' + warning. + * objc/objc-act.c (defer_fn): Avoid signed/unsigned warning. + +Sun Dec 2 07:12:30 2001 Richard Kenner + + * libgcc2.c (__bb_exit_func): Fix line wrap problems. + +2001-12-02 Geoff Keating + + * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Simplify. + * config/rs6000/rs6000.c (rs6000_emit_move): Use adjust_address + rather than simplify_subreg. Check for volatile-ness. Check that + we're not splitting one slow operation into two slow operations. + +2001-12-02 David Edelsohn + + * emit-rtl.c (gen_lowpart_common): Cast array element to HOST_WIDE_INT + before shifting. + +2001-12-02 Neil Booth + + * c-decl.c (duplicate_decls, push_parm_decl): Remove leading + capital from diagnostics. + * c-lex.c (cb_file_change): Similarly. + * c-parse.in : Similarly. + * cfgrtl.c (verify_flow_info): Similarly. + * collect2.c: Similarly. + * cppfiles.c (find_include_file): Similarly. + * cppinit.c (cpp_handle_option): Similarly. + * cpplex.c (cpp_spell_token): Similarly. + * cppmain.c (do_preprocessing): Similarly. + * gcc.c (translate_options, process_command, do_spec1, + main, pfatal_execute): Similarly. + * genattr.c (main): Similarly. + * genattrtab.c (check_attr_test, operate_exp, simplify_test_exp, + write_test_expr, main): Similarly. + * gencodes.c (main): Similarly. + * genconfig.c (main): Similarly. + * genconstants.c (main): Similarly. + * genemit.c (main): Similarly. + * genextract.c (main): Similarly. + * genflags.c (main): Similarly. + * genopinit.c (main): Similarly. + * genoutput.c (process_template, main): Similarly. + * genpeep.c (main): Similarly. + * genrecog.c (main): Similarly. + * gensupport.c (is_predicable, identify_predicable_attribute, + alter_predicate_for_insn, init_md_reader_args, main): Similarly. + * ggc-page.c (alloc_anon): Similarly. + * mips-tfile.c (add_string, add_procedure, add_file, read_line, + parse_begin, parse_bend, parse_def, parse_end, parse_file, + parse_stabs_common, parse_stabs, write_varray, write_object, + read_seek, copy_object, main, error): Similarly. + * profile.c (compute_branch_probabilities): Similarly. + * reg-stack.c (check_asm_stack_operands): Similarly. + * reload.c (find_reloads): Similarly. + * reload1.c (spill_failure, failed_reload): Similarly. + * rtl-error.c (_fatal_insn_not_found): Similarly. + * toplev.c (read_integral_parameter, crash_signal, + decode_f_option, set_target_switch, parse_options_and_default_flags) + : Similarly. + * tradcif.y (parse_number, yylex): Similarly. + * tradcpp.c (main, fancy_abort): Similarly. + * tree.c (tree_check_failed): Similarly. + * varray.c (varray_check_failed): Similarly. + * xcoffout.c (xcoff_output_standard_types): Similarly. +objc: + * objc-act.c (get_object_ref, lookup_and_install_protocols, + build_objc_string_object, objc_declare_alias, build_ivar_chain, + finish_message_expr, build_protocol_expr, is_public, + start_class): Similarly. + +2001-12-01 Neil Booth + + * c-decl.c (duplicate_decls, parmlist_tags_warning): Remove + trailing period from diagnostics. + * c-lex.c (cb_file_change): Similarly. + * cppmacro.c (check_trad_stringification): Similarly. + * gcc.c (do_spec_1): Similarly. + * genattr.c (main): Similarly. + * genattrtab.c (main, operate_exp, make_length_attrs): Similarly. + * gencodes.c (main): Similarly. + * genconfig.c (main): Similarly. + * genconstants.c (main): Similarly. + * genemit.c (main): Similarly. + * genextract.c (main): Similarly. + * genopinit.c (main): Similarly. + * genoutput.c (main): Similarly. + * genpeep.c (main): Similarly. + * genrecog.c (main): Similarly. + * mips-tfile.c (add_file, error): Similarly. + * profile.c (init_branch_prob): Similarly. + * reload1.c (spill_failure): Similarly. + * stmt.c (parse_output_constraint): Similarly. + * varasm.c (assemble_variable): Similarly. + +2001-12-01 Kaveh R. Ghazi + + * m68k.c (init_FPA_table): Provide static prototype. + * mips/abi64.h (mips_function_value): Move prototype to ... + * mips-protos.h (mips_function_value): ... here. + * mips.c: Include halfpic.h. + * output.h (rdata_section): Prototype. + + * h8300.c (h8300_asm_named_section): Wrap with !OBJECT_FORMAT_ELF. + * m88k.c (m88k_svr3_asm_out_constructor, + m88k_svr3_asm_out_destructor): Wrap with CTOR_LIST_BEGIN && + !OBJECT_FORMAT_ELF. + * mcore.c (mcore_asm_named_section): Wrap with OBJECT_FORMAT_ELF. + * sh.c (sh_asm_named_section): Wrap with !OBJECT_FORMAT_ELF. + * sparc.c (sparc_elf_asm_named_section): Wrap with OBJECT_FORMAT_ELF. + +2001-12-01 Geoff Keating + + * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Complex + LO_SUM addresses less than word size are not legitimate, + because they lead to invalid SUBREGs. + * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. + +2001-12-01 Olivier Hainque + + * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL + while scanning for multiple back edges. + +2001-12-01 Franz Sirl + + * ginclude/ppc-asm.h (JUMP_TARGET): New macro. + * config/rs6000/tramp.asm: Use it. + +2001-12-01 Zack Weinberg + + * gencheck.c, gengenrtl.c: Don't define xmalloc. + * gensupport.c: Don't define xstrdup, xcalloc, xrealloc, + xmalloc. + +2001-11-30 John David Anglin + + * pa.c (output_ascii): Cast `p' to unsigned char. + +2001-11-30 Daniel Berlin + + * config/rs6000/rs6000.c (altivec_expand_builtin): add + ALTIVEC_BUILTIN_LD_INTERNAL_4sf and ALTIVEC_BUILTIN_ST_INTERNAL_4sf, + *_16qi,_8hi, rename existing V4SI ones to *_4si. + (altivec_init_builtins): Ditto. + (bdesc_2arg): Rename CODE_FOR_* to match changes in MD file. + + * config/rs6000/rs6000.md: Add attribute types vecsimple, + veccomplex, vecfloat, and vecperm, for altivec instructions. + Modify altivec patterns to use appropriate attribute type. + Modify altivec patterns to match RTL operations where appropriate + (IE no unspec where we can avoid it). + Add vector unit scheduling for ppc7450. + Rename patterns to what they are where appropriate + (altivec_vaddfp->addv4sf3, etc) + + * config/rs6000/rs6000.h (enum rs6000_builtins): Change VRS->VSR. + Pass -mppc, and define _ARCH_PPC, if -mcpu=7450 is used. + + * config/rs6000/sysv4.h: Add -mcpu=7450. + + * testsuite/gcc.dg/altivec-1.c: Update test to take into account renamed + _builtin_altivec_ld_interal function. + +2001-11-30 Kaveh R. Ghazi + + * configure.in (AC_CHECK_FUNCS): Delete strtoul, bsearch, popen, + strchr, strrchr, isascii, gettimeofday. + * config.in, configure: Regenerate. + +2001-11-30 Zoltan Hidvegi + + * unroll.c (unroll_loop): Correct special exit cases. + +2001-11-30 Stephane Carrez + + * config/sparc/sparc.c (DF_MODES_NO_S): Fix pr/3623, define to + accept DFmode and DImode only. + +2001-11-30 Aldy Hernandez + + * config/rs6000/rs6000.h (STARTING_FRAME_OFFSET): Adjust for altivec. + (STACK_DYNAMIC_OFFSET): Same. + +2001-11-30 Richard Henderson + + * c-decl.c (duplicate_decls): Copy DECL_SAVED_TREE. + +2001-11-30 Aldy Hernandez + + * config/rs6000/rs6000.h (CALL_REALLY_USED_REGISTERS): New. + (CONDITIONAL_REGISTER_USAGE): Set call_really_used_registers to + the values in call_used_registers. + +Fri Nov 30 12:48:26 2001 Jeffrey A Law (law@cygnus.com) + + * gthr-dce.h: If _DCE_THREADS is not defined, then just include + gthr-single. + +2001-11-30 Jason Merrill + + * dwarf2out.c (is_cxx): New fn. + (add_data_member_location_attribute): Check it. + * dbxout.c (dbxout_type): Only look at BINFO_VPTR_FIELD for C++. + +Fri Nov 30 08:26:57 2001 Richard Kenner + + * dwarf2asm.c (dw2_asm_output_encoded_addr_rtx): Handle const1_rtx. + +2001-11-30 Daniel Berlin + + * genopinit.c (gen_insn): Handle MODE_VECTOR_INT and + MODE_VECTOR_FLOAT as allowed. + +2001-11-29 Zack Weinberg + + Purge cruft now we have build libiberty. + + * Makefile.in (OBSTACK, VFPRINTF, DOPRINT, STRSTR, + HOST_OBSTACK, HOST_VFPRINTF, HOST_DOPRINT, HOST_STRSTR, + USE_HOST_OBSTACK, USE_HOST_VFPRINTF, USE_HOST_DOPRINT, + USE_HOST_STRSTR): Delete variables. + (vfprintf.o, doprint.o, strstr.o, splay-tree.o, obstack.o, + hashtab.o, safe-ctype.o, $(HOST_PREFIX_1)obstack.o, + $(HOST_PREFIX_1)vfprintf.o, $(HOST_PREFIX_1)doprint.o, + $(HOST_PREFIX_1)strstr.o), $(HOST_PREFIX_1)): Delete rules. + (LIBIBERTY, BUILD_LIBIBERTY): New variables. + (LIBDEPS): Now just $(INTLDEPS) $(LIBIBERTY). + (LIBS): Now just $(INTLLIBS) @LIBS@ $(LIBIBERTY). + (HOST_LIBDEPS): Now just $(BUILD_LIBIBERTY). + (HOST_LIBS): Ditto. + (HOST_RTL): Remove hashtab.o safe-ctype.o. + (OBJS): Remove splay-tree.o. + (gen-protos): Depend on $(HOST_LIBS), not ../libiberty/libiberty.a. + (distclean): No need to delete splay-tree.c obstack.c + hashtab.c safe-ctype.c. + (mostlyclean): Delete build copies of print-rtl.c bitmap.c + errors.c ggc-none.c (all prefixed with $(HOST_PREFIX_1). + * aclocal.m4 (gcc_AC_FUNC_VFPRINTF_DOPRNT, gcc_AC_FUNC_STRSTR): + Delete. + * configure.in: Don't use them. + Set and substitute @FORBUILD@. + * config.in, configure: Regenerate. + * doprint.c: Move to libiberty/_doprnt.c. + * doc/configterms.texi: Document that libiberty is now built + up to three times. Fix typo. + +2001-11-30 Jason Merrill + + * dwarf2out.c (add_data_member_location_attribute): Do the + right thing for virtual bases. + * dbxout.c (dbxout_type): For a virtual base, print the offset + within the vtable. + +2001-11-29 Zoltan Hidvegi + + * doloop.c (doloop_valid_p): Check for LTU and GTU as well. + +2001-11-29 Aldy Hernandez + + * config/rs6000/rs6000.c (function_arg): Unnamed vector arguments + go in memory. + Remove unused attribute for named. + +2001-11-29 Kaveh R. Ghazi + + * genattrtab.c (attr_rtx_1): New function containing the + majority of `attr_rtx'. Move variable declarations into the + scope where they are used. Eliminate unnecessary gotos. + (attr_rtx): Now just a wrapper for `attr_rtx_1' using VA_OPEN, + VA_FIXEDARG, and VA_CLOSE. + +2001-11-30 Hans-Peter Nilsson + + * config/cris/cris.c (cris_notice_update_cc): Check first + destination also against overlap with cc_status.value2 and second + destination against overlap with cc_status.value1. For overlaps, + clear overlapped value, don't just CC_STATUS_INIT. + + * config/cris/cris.h (EXTRA_CONSTRAINT_T): Fix spacing and FIXME. + Fix typo in comment. + (LINK_SPEC): Remove whitespace at end of line. + +2001-11-29 Jakub Jelinek + + * c-lex.c (init_c_lex): Canonicalize "-" filename to "". + +2001-11-29 Jakub Jelinek + + * gcc.c (ASM_DEBUG_SPEC): Only check HAVE_AS_G*_DEBUG_FLAG + macros for the supported debugging types. + +2001-11-29 Craig Rodrigues + + PR other/4932 + * config/i386/i386.c (print_operand): Verify that the + argument to %c is a constant and not a conditional which + needs to be reversed. + +Thu Nov 29 11:12:59 2001 Geoffrey Keating (geoffk@redhat.com) + + * emit-rtl.c (gen_lowpart_common): Fix conversion of + REAL_VALUE_TYPEs to an array of target integers. Fix extraction + of low part of those arrays for 32bit and 64bit hosts. + +2001-11-29 Kaveh R. Ghazi + + * Makefile.in (insn-output.o): Depend on insn-codes.h. + +2001-11-29 Joseph S. Myers + + * configure.in (target_list): Add generated-manpages. + * configure: Regenerate. + * Makefile.in (generated-manpages): Depend on + lang.generated-manpages. + * objc/Make-lang.in (objc.generated-manpages): New dummy target. + +2001-11-29 Nick Clifton + + * config/arm/crti.asm (_init): Add .thumb_func if compiled + with -mthumb. + (_fini): Add .thumb_func if compiled with -mthumb. + +2001-11-28 Eric Christopher + + * config/mips/mips.c (override_options): Fix thinko in mips_tune + for mips32/mips64. Remove MASK_SOFT_FLOAT configuration bits. + +Thu Nov 29 00:24:15 EST 2001 John Wehle (john@feith.com) + + * alpha.md (tablejump): Use pic_offset_table_rtx + instead of gen_rtx_REG. + +Wed Nov 28 15:36:13 2001 Jeffrey A Law (law@cygnus.com) + + * expr.c (store_expr): When copying a string constant into an + array, reset the known alignment of the MEM for the section to + be cleared to BITS_PER_UNIT. + +2001-11-28 Hans-Peter Nilsson + + * config/cris/cris.c: Remove whitespace at end of line. + +Wed Nov 28 14:51:23 2001 Douglas B. Rupp + + * config.gcc (i[34567]86-*-interix3*): New case. + * config/x-interix3, config/interix3.h, config/i386/i386-interix3.h: + New files. + +2001-11-28 Richard Henderson + + * config/alpha/alpha.md (sibcall_osf_1, sibcall_value_osf_1): Use + symbolic_operand as the predicate. + +2001-11-28 Richard Henderson + + * doloop.c (doloop_modify_runtime): Properly select induction + variable; skip late entry test if biv initializer created by loop. + +Wed Nov 28 08:21:47 2001 Richard Kenner + + * tree.h (EXPR_WFL_LINECOL): Used by Java in node other than + EXPR_WITH_FILE_LOCATION, so change checks and documentation. + + * tree.h (TREE_VIA_PROTECTED): Update to show can be in TREE_VEC. + + * tree.h: Add missing checks on some macros; make formatting more + consistent. + + * stor-layout.c (put_pending_size): Look for SAVE_EXPR if not at top + level; only add to pending_sizes if find it. + + * langhooks.c (lhd_safe_from_p): Add ATTRIBUTE_UNUSED. + + * df.c (iterate_dataflow_sbitmap, iterate_dataflow_bitmap): + Add casts to remove warnings. + + * Makefile.in (OBJS): Sort alphabetically. + + * print-rtl.c (print_rtx): If RTX code is bad, just say so. + Also minor cleanups. + +Wed Nov 28 06:52:27 2001 Arnaud Charlet + + * Makefile.in (ORDINARY_FLAGS_TO_PASS): Remove STAGE_PREFIX. + (FLAGS_TO_PASS): Add STAGE_PREFIX. + (SUBDIR_FLAGS_TO_PASS): Apply PREPEND_DOTDOT_TO_RELATIVE_PATH + to STAGE_PREFIX. + +Wed Nov 28 10:42:19 CET 2001 Jan Hubicka + + * cse.c (true_dependence_in_rtx): New function. + (invalidate): Use it. + + * c-common.h (GOTO_FAKE_P): New macro. + * tree-inline.c (GOTO_FAKE_P): Set. + * c-tree.texi (GOTO_FAKE_P): Document. + + * varasm.c (assemble_variable): Set reloc to 3 for error_mark + containing pointers. + (output_addressed_constants): Check for local/external relocations. + * elfos.h (SELECT_SECTION): Classify data section. + * tm.texi (SELECT_SECTION): Update documentation. + + * cfganal.c (flow_dfs_compute_reverse_add_bb): set visited bit. + (flow_dfs_compute_reverse_execute): Add only unvisited blocks. + +2001-11-27 Kaveh R. Ghazi + + * defaults.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Also provide defaults when we have + OBJECT_FORMAT_ROSE. + +2001-11-28 Hans-Peter Nilsson + + * config/cris/cris.c: Tweak spacing for prototypes. + (LOSE_AND_RETURN): New macro. + (cris_operand_lossage): New function. + (cris_print_index, cris_print_base): Use cris_operand_lossage + rather than fatal_insn. + (cris_print_operand, cris_print_operand_address): Use + LOSE_AND_RETURN rather than fatal_insn and internal_error. + (cris_output_addr_const): Use LOSE_AND_RETURN and + output_operand_lossage rather than fatal_insn and internal_error + for valid but unexpected rtx expressions. + + * config/cris/cris.c (cris_split_movdx): Don't call alter_subreg + for a SUBREG in src or dest, abort instead. + +2001-11-28 Bryce McKinlay + + * doc/passes.texi: Remove reference to c-dump.c. Update tree inlining + doc. + +2001-11-27 Jakub Jelinek + + * gcc.c (ASM_DEBUG_SPEC): Use conditional expression rather than + preprocessor define. If only DBX_DEBUGGING_INFO or only + DWARF2_DEBUGGING_INFO is supported for the target, provide + appropriate definitions. + +2001-11-27 Neil Booth + + * Makefile.in: Update, and add c-objc-common.o dependencies. + * c-lang.c: Remove unnecessary includes. + (c_init): Move bulk of code to c_objc_common_init, and call it. + (c_tree_printer, c_missing_noreturn_ok_p, c_disregard_inline_limits, + inline_forbidden_p, c_cannot_inline_tree_fn): Move to + c-objc-common.c. + * c-objc-common.c: New. Mostly pulled from c-lang.c. + * c-tree.h (c_disregard_inline_limits, c_cannot_inline_fn, + c_objc_common_init, c_missing_noreturn_ok_p): New. + * toplev.c: Update comment. + * doc/passes.texi: Update. +objc: + * objc-act.c (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, + LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, + LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Override. + (objc_init): Update to use c_objc_common_init. + +2001-11-27 Neil Booth + + * cpphash.c (_cpp_init_hashtable): Update. + * cpphash.h (struct spec_nodes): Remove n_L. + * cpplex.c (_cpp_lex_direct): Check for prefix L separately. + +2001-11-17 Richard Henderson + + * unroll.c (loop_iterations): Move last change ... + * doloop.c (doloop_modify_runtime): ... here. + +2001-11-17 Corey Minyard + Richard Henderson + + * unroll.c (loop_iterations): Detect one situation in which we + overestimate the number of iterations. + +2001-11-27 Rainer Orth + + * gcc.c (set_input): Export. + Move declaration ... + gcc.h (set_input): ... here. + +2001-11-27 Rainer Orth + + * gcc.c (set_collect_gcc_options): New function, split out from + main. + Ignore elided switches. + (do_spec): Invoke before executing command. + (do_spec_1): Likewise. + Fixes PR other/3968. + +2001-11-27 Hans-Peter Nilsson + + * config/cris/cris.h (INT_ASM_OP): Remove. + +2001-11-27 Rainer Orth + + * config/i386/sol2.h (WINT_TYPE): Redefine. + (WINT_TYPE_SIZE): Likewise. + +2001-11-27 Kaveh R. Ghazi + + * collect2.c: Check HAVE_DUP2 instead of NO_DUP2. + (dup2): Make static and add prototype. + * m68k/plexus.h: Don't define NO_DUP2. + * configure.in (AC_CHECK_FUNCS): Add dup2. + * config.in, configure: Regenerate. + + * ia64/aix.h (REG_SIZE): Don't #undef. + * sparc.h (REG_SIZE): Delete. + * flow.c (mark_used_regs): Don't use REG_SIZE. + * regs.h (REG_SIZE): Delete. + +2001-11-27 Andreas Schwab + + * gcc.c: Fix typo PREFERRED_DEBUGGING_FORMAT -> + PREFERRED_DEBUGGING_TYPE. + +Tue Nov 27 08:21:47 2001 Richard Kenner + + * Makefile.in (c-lang.o): Depends on langhooks-def.h. + (expr.o, varasm.o): Depends on langhooks.h. + * c-common.c (c_safe_from_p): Always declare. + (c_expand_expr): Refine when declared. + * c-lang.c (c-common.h): Now include. + (LANG_HOOKS_SAFE_FROM_P): Define new hook. + (c_init): Don't set lang_safe_from_expr. + * expr.c (langhooks.h): Now include. + (lang_safe_from_p): No longer define. + (safe_from_p): Use lang hook. + (expand_expr): Set IGNORE if VOID_TYPE result of VIEW_CONVERT_EXPR too. + (expand_expr, case VIEW_CONVERT_EXPR): Pass ro_modifier down. + * expr.h (lang_expand_constant, lang_safe_from_p): Delete. + * langhooks-def.h (lhd_return_tree, lhd_safe_from_p): New decls. + (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. + * langhooks.c (lhd_return_tree, lhd_safe_from_p): New functions. + * langhooks.h (struct lang_hooks): New fields expand_constant + and safe_from_p. + * output.h (output_constant): Size arg is HOST_WIDE_INT. + * stmt.c (expand_decl_init): No longer need to expand constant + for CONST_DECL. + * stor-layout.c (put_pending_size): Don't check for SAVE_EXPR. + * toplev.c (lang_expand_constant): Delete var. + * tree.c (save_expr): Don't put another SAVE_EXPR around simple + operations on SAVE_EXPR. + * varasm.c (langhooks.h): Now include. + (compare_constant_1): Use lang_hooks, not lang_expand_constant. + (record_constant_1, output_addressed_constants): Likewise. + (initializer_constant_valid_p, output_constant): Likewise. + (output_constant_def): Process no-defer of string constant. + (output_addressed_constants, case ADDR_EXPR): Use handled_component_p. + (output_constant): Strip more conversions. + Track our size and pad for the rest. + (array_size_for_constructor): Remove code for non-byte STRING_CST. + (output_constructor): SIZE now HOST_WIDE_INT. + +2001-11-27 Richard Henderson + + * ifcvt.c (noce_try_store_flag_constants): Test for overflow + in computing DIFF. + +2001-11-27 Zack Weinberg + + * cppfiles.c (read_include_file): Add comment. + +2001-11-26 Richard Henderson + + * toplev.c (rest_of_compilation): Call free_bb_for_insn before exit. + +2001-11-26 Richard Henderson + + * config/ia64/sysv4.h (DBX_DEBUGGING_INFO): Undef. + * config/ia64/aix.h (PREFERRED_DEBUGGING_TYPE): Remove + commented out override. + +2001-11-26 Neil Booth + + * cppfiles.c (stack_include_file): Don't optimize zero-length + files. + (read_include_file): NUL-terminate read files. + * cpplex.c (handle_newline, skip_escaped_newlines, + get_effective_char, skip_whitespace, parse_identifier, + parse_identifier_slow, parse_number, parse_string, + _cpp_lex_direct): Optimize for the fact that buffers are guaranteed + NUL-terminated. + * cpplib.c (destringize_and_run, cpp_define, handle_assertion): + Be sure buffers are NUL terminated. + * cppmacro.c (warn_of_redefinition): Kill compile warning. + +2001-11-26 Neil Booth + + * c-common.c: Include tree-inline.h. + (c_language): Move separate definitions here. + (c_common_init_options, c_common_post_options): New. + (c_common_lang_init): Rename c_common_init. + * c-common.h (c_common_lang_init): Similarly. + (c_common_init_options, c_common_post_options): New. + * c-lang.c (c_post_options): Move body to c_common_post_options. + (c_init_options): Use c_common_init_options. + (c_init): Update. + * langhooks.def: Rearrange. + * langhooks.h: Rearrange, and improve comments. + * toplev.c (do_compile): New function. + (toplev_main): Use it. + (lang_independent_f_options, parse_options_and_default_flags, + process_options): Remove trailing periods. + * Makefile.in: Update. +objc: * objc-act.c (objc_post_options, objc_init_options): Use c-common.c + functions. + (ojbc_init): Update. + +2001-11-26 Richard Henderson + + * config/alpha/alpha.md (unop): Add 0 offset for some gas versions. + +2001-11-26 DJ Delorie + + * expr.c (store_constructor): Actually use the value computed + if WORD_REGISTER_OPERATIONS. + +2001-11-26 Richard Henderson + + * config/elfos.h (SELECT_SECTION): Don't check TREE_READONLY + for CONSTRUCTOR. + +2001-11-26 David Edelsohn + + * rs6000.c (output_mi_thunk): Handle minimal-toc and call + correct function on AIX. + +2001-11-26 Alexandre Oliva + + * toplev.c (process_options): Don't force + flag_optimize_sibling_calls to zero just because exceptions are + enabled. + +Mon Nov 26 12:37:05 2001 Jeffrey A Law (law@cygnus.com) + + * df.h (transfer_function_sbitmap): Use PARAMS around argument + list in function prototypes. + (transfer_function_bitmap): Likewise. + +2001-11-26 Loren J. Rittle + + * config/stormy16/stormy16.h: Remove DEFAULT_VTABLE_THUNKS. + * config/i386/netbsd-elf.h: Likewise. + +2001-11-26 David Edelsohn + + * doc/trouble.texi: Remove outdated RS/6000 comments. + +Mon Nov 26 13:49:41 CET 2001 Jan Hubicka + + * final.c (walk_alter_subreg): Fix return value. + +Mon Nov 26 11:36:20 CET 2001 Jan Hubicka + + * sparc.c (sparc_absnegfloat_split_legitimate): Do not call + alter_subreg. + * sparc.md (post-reload splitters): Do not call alter_subreg. + * cfgrtl.c (purge_dead_edges): Fix typo in previous fix. + +2001-11-25 Aldy Hernandez + + * regclass.c (choose_hard_reg_mode): Handle vector arguments. + +2001-11-26 Alan Modra + + * final.c: (insn_lengths): Make it an int *, so that large jump + tables don't overflow. + +2001-11-25 Joseph S. Myers + + * c-format.c (FMT_FLAG_DOLLAR_GAP_POINTER_OK): New. + (format_types): Use it for scanf. + (dollar_arguments_pointer_p): New. + (init_dollar_format_checking): Store details of which arguments + are pointers. + (maybe_read_dollar_number): Reallocate dollar_arguments_pointer_p. + (finish_dollar_format_checking): Take extra parameter + pointer_gap_ok. Treat unused arguments differently if + pointer_gap_ok and the unused arguments are pointers. + (check_format_info_main): Pass extra argument to + finish_dollar_format_checking. + * doc/invoke.texi (-Wno-format-extra-args): Document behavior when + unused arguments are present between used arguments with operand + numbers. + +2001-11-25 Daniel Berlin + + * df.c: Add prototypes for hybrid_search_bitmap and + hybrid_search_sbitmap. + (hybrid_search_bitmap): New function. + (hybrid_search_sbitmap): New function. + (iterative_dataflow_sbitmap): Change to use hybrid_search_sbitmap. + (iterative_dataflow_bitmap): Ditto. + +2001-11-25 Stephane Carrez + + * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize + address computations. + +2001-11-25 Stephane Carrez + + * config/m68hc11/m68hc11.c (d_register_operand): Must accept + register b (low part of d). + +2001-11-25 Stephane Carrez + + * config/m68hc11/m68hc11.h (FUNCTION_PROFILER): Fix label name + passed to mcount. + +Sun Nov 25 06:22:09 2001 Douglas B. Rupp + + * config/alpha/vms-ld.c, config/alpha/vms-cc.c: New files. + * config/alpha/x-vms: New file, to compile the above. + * config.gcc (alpha*-dec-vms*): Add x-vms. + +2001-11-24 Hans-Peter Nilsson + + * genextract.c (main): Set ro_loc for peepholes. + +Sat Nov 24 17:04:10 2001 Douglas B. Rupp + + * fix-header.c (main): Move inf_buffer termination and inf_limit + calculation to after read. + + * config/alpha/xm-vms.h (FILE_TYPE): Remove undef and baggage. + (__UNIX_FOPEN): Define. + +Sat Nov 24 16:11:00 2001 Richard Kenner + + * function.c (assign_stack_temp_for_type): Clear alias set before + setting new one. + +2001-11-23 David Edelsohn + + * rs6000.c (print_operand, case 'v'): Use HOST_WIDE_INT_PRINT_HEX + format. + * rs6000.md (cmptf): Fix typo. + +2001-11-23 Richard Sandiford + + * final.c (output_addr_const): Output PC as '.' even if !flag_pic. + * varasm.c (output_constructor): Use assemble_integer rather + than ASM_OUTPUT_BYTE. + +2001-11-23 Andreas Jaeger + + * cpplex.c (cpp_interpret_charconst): Use HOST_WIDE_INT for sign + extension. + +2001-11-23 Nick Clifton + + * config/arm/xscale-coff.h (SUBTARGET_CPU_DEFAULT): Override + default definition. + (SUBTARGET_EXTRA_ASM_SPEC): Remove previous definition. + (MULTILIB_DEFAULTS): Remove previous definition. + +2001-11-23 Neil Booth + + * cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic. + * gcc.dg/cpp/mi6.c, gcc.dg/cpp/redef2.c: Update. + +2001-11-22 Kaveh R. Ghazi + + * cris.h: Revert thinko in last patch. + +2001-11-23 Joseph S. Myers + + * ChangeLog.0, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog, + FSFChangeLog.10, c-decl.c, cppfiles.c, cppinit.c, cpplex.c, + cpplib.c, cppmain.c, cse.c, df.c, diagnostic.c, dominance.c, + dwarf2out.c, dwarfout.c, emit-rtl.c, errors.c, except.c, except.h, + explow.c, function.c, gcse.c, genrecog.c, predict.c, regmove.c, + sched-rgn.c, ssa-ccp.c, stmt.c, toplev.c: Fix spelling errors. + + * predict.c, reg-stack.c: Fix spelling errors. + +2001-10-09 Andrew Haley + + * calls.c (check_sibcall_argument_overlap): Use slot_offset for + start of stack slot. + +2001-11-22 Graham Stott + + * cfgrtl.c (try_redirect_by_replacing_jump): Fix typo, emit + replacement jump after original jump. + + (verify_flow_info): Remove redundent initialisation. + Handle reaching end of insn list before finding a BARRIER. + Only issue one missing barrier diagnostic. + +2001-11-22 Graham Stott + + * local-alloc.c (combine_regs): Handle SUBREG_REG being a MEM. + +Thu Nov 22 06:49:14 2001 Richard Kenner + + * config/i386/i386.md (leave, leave_rex64): Have RTL reflect what + insn actually does. + +2001-11-22 Nick Clifton + + * doc/invoke.texi (M32R/D Option Summary): Document -m32r switch. + Fix typo -mm32rx=> -m32rx. + + * config/arm/arm.c (arm_elf_asm_named_section): Only build for elf + targets. + + * config.gcc (xscale-coff): Add necessary header files to + tm_file variable. + +2001-11-20 Zack Weinberg + + * rs6000.c (output_cbranch): Use $, not %$, in output template. + +2001-11-21 Bryce McKinlay + + * tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h. + (lang_type_quals): Declare. + (dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to + retrieve language-specific qualifiers for a type node, instead of + C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of + lang_dump_tree. + * tree-dump.h: Rename from c-dump.h. + * c-common.h (C_TYPE_QUALS): Removed. + Move declarations for tree-dump.c interface to... + * tree.h: ... here. Remove lang_dump_tree. + * langhooks.h (struct lang_hooks_for_tree_dump): New. + (struct lang_hooks): Add tree_dump hooks. + * langhooks.c (lhd_tree_dump_dump_tree): New function. + (lhd_tree_dump_type_quals): New function. + * langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals): + Declare. + (LANG_HOOKS_INITIALIZER): Add tree_dump hooks. + * Makefile.in: Move tree-dump.o to language-independent back-end. + +2001-11-21 Kaveh R. Ghazi + + * 1750a.h (DBX_REGISTER_NUMBER): Don't define. + * alpha.h (DBX_REGISTER_NUMBER): Likewise. + * arc.h (DBX_REGISTER_NUMBER): Likewise. + * arm/aout.h (DBX_REGISTER_NUMBER): Likewise. + * avr.h (DBX_REGISTER_NUMBER): Likewise. + * c4x.h (DBX_REGISTER_NUMBER): Likewise. + * clipper.h (DBX_REGISTER_NUMBER): Likewise. + * convex.h (DBX_REGISTER_NUMBER): Likewise. + * cris.h (DBX_REGISTER_NUMBER): Likewise. + * dsp16xx.h (DBX_REGISTER_NUMBER): Likewise. + * elxsi.h (DBX_REGISTER_NUMBER): Likewise. + * fr30.h (DBX_REGISTER_NUMBER): Likewise. + * h8300.h (DBX_REGISTER_NUMBER): Likewise. + * i370.h (DBX_REGISTER_NUMBER): Likewise. + * i860.h (DBX_REGISTER_NUMBER): Likewise. + * i860/paragon.h (DBX_REGISTER_NUMBER): Likewise. + * i860/sysv3.h (DBX_REGISTER_NUMBER): Likewise. + * i860/sysv4.h (DBX_REGISTER_NUMBER): Likewise. + * m32r.h (DBX_REGISTER_NUMBER): Likewise. + * m68hc11.h (DBX_REGISTER_NUMBER): Likewise. + * m88k.h (DBX_REGISTER_NUMBER): Likewise. + * mcore/mcore-elf.h (DBX_REGISTER_NUMBER): Likewise. + * mcore.h (DBX_REGISTER_NUMBER): Likewise. + * mn10200.h (DBX_REGISTER_NUMBER): Likewise. + * mn10300.h (DBX_REGISTER_NUMBER): Likewise. + * pdp11.h (DBX_REGISTER_NUMBER): Likewise. + * romp.h (DBX_REGISTER_NUMBER): Likewise. + * rs6000.h (DBX_REGISTER_NUMBER): Likewise. + * rs6000/sysv4.h (DBX_REGISTER_NUMBER): Likewise. + * s390/linux.h (DBX_REGISTER_NUMBER): Likewise. + * stormy16.h (DBX_REGISTER_NUMBER): Likewise. + * v850.h (DBX_REGISTER_NUMBER): Likewise. + * vax.h (DBX_REGISTER_NUMBER): Likewise. + * we32k.h (DBX_REGISTER_NUMBER): Likewise. + + * defaults.h (DBX_REGISTER_NUMBER): Provide a default. + * doc/tm.texi (DBX_REGISTER_NUMBER): Update. + +2001-11-21 H.J. Lu + + * config/rs6000/sysv4.h (LIB_SPEC): Fix a typo. + +2001-11-21 Kaveh R. Ghazi + + * s390.c (s390_va_arg): Eliminate ALIGN parameter in call to + emit_cmp_and_jump_insns. + + * stormy16.c (xstormy16_expand_builtin_va_arg, + xstormy16_expand_casesi): Likewise. + +Wed Nov 21 17:37:16 2001 Richard Kenner + + * function.c (keep_stack_depressed): Major rework. + (handle_epilogue_set, emit_equiv_load): New functions. + (thread_prologue_and_epilogue_insns): keep_stack_depressed now + has return value. + * jump.c (returnjump_p_1): Also return 1 if SET with SET_IS_RETURN_P. + * rtl.h (SET_IS_RETURN_P): New macro. + + * expr.c (expand_expr, case VIEW_CONVERT_EXPR): Refine slightly + and also support TREE_ADDRESSABLE. + * tree.def (VIEW_CONVERT_EXPR): Document TREE_ADDRESSABLE. + +2001-11-21 David Edelsohn + + * rs6000.md (cmptf_internal1): Replace %$ with $. + +Wed Nov 21 16:44:01 2001 Douglas B. Rupp + + * cppfiles.c (STAT_SIZE_TOO_BIG): Define. + (read_include_file): Use STAT_SIZE_TOO_BIG. + + * cppinit.c (INO_T_COPY): Define. + (INO_T_EQ): Uppercase parameters. + (append_include_chain): Use INO_T_COPY. + +2001-11-21 Richard Sandiford + + * cfg.c: Fix typos and formatting in the introductory comment. + +Wed Nov 21 12:38:37 CET 2001 Jan Hubicka + + * profile.c (compute_branch_probabilites): Compute probabilities + for entry/exit edges; estimate probabilities for zero counts. + +2001-11-21 Jakub Jelinek + + * explow.c (probe_stack_range): Use LCT_NORMAL as second argument + to emit_library_call. + * function.c (expand_main_function, expand_function_start, + expand_function_end): Likewise. + * profile.c (output_func_start_profiler): Likewise. + * stmt.c (expand_nl_goto_receivers): Use LCT_NORETURN as + second argument to emit_library_call. + * optabs.c (prepare_cmp_insn): Use LCT_CONST_MAKE_BLOCK + as second argument to emit_library_call. + * calls.c (emit_library_call): Update fn_type description. + +2001-11-21 Jakub Jelinek + + * c-decl.c (c_expand_deferred_function): Only call c_expand_body + if fndecl is still DECL_INLINE and has DECL_RESULT. + +2001-11-20 Kaveh R. Ghazi + + * clipper.c (clipper_movstr): Avoid uninitialized warning. + * i960.c (is_mask, legitimize_address): Likewise. + * m88k.c (m88k_expand_prologue): Likewise. + * m88k.md: Likewise. + * mcore.c (emit_new_cond_insn): Likewise. + * stormy16.c (xstormy16_emit_cbranch): Likewise. + +2001-11-20 Zack Weinberg + + * config.gcc: Delete powerpcle-*-solaris2* stanza. + * config/rs6000/eabi.asm, config/rs6000/rs6000.c, + config/rs6000/rs6000.h, config/rs6000/rs6000.md, + config/rs6000/sol-ci.asm, config/rs6000/sol-cn.asm, + config/rs6000/sysv4.h, config/rs6000/t-ppccomm, + config/rs6000/t-ppcos: Expunge all references to Solaris. + + * config/rs6000/sol-c0.c, config/rs6000/sol2.h: Delete. + + * config/rs6000/rs6000.md: Replace '%$' with '$' in all + output templates. + * config/rs6000/rs6000.h: Define DEFAULT_PCC_STRUCT_RETURN to 0, + and change RETURN_IN_MEMORY to just check AGGREGATE_TYPE_P. + +2001-11-20 Kaveh R. Ghazi + + * sh.md: Avoid uninitialized warnings. + * vax.c (vax_rtx_cost): Likewise. + +2001-11-15 Aldy Hernandez + + * rs6000.c (direct_return): Check if we are saving altivec + registers. + (first_altivec_reg_to_save): New. + Updated stack frame layout comments. + (rs6000_stack_info): Calculate altivec register save size. + Save link register if we saved some altivec registers. + (rs6000_stack_info): Align save size to 16 if altivec abi or + abi_darwin. + (rs6000_stack_info): Calculate altivec register offsets. + (rs6000_stack_info): Add altivec info to save_size. + (debug_stack_info): Add altivec debug info. + (rs6000_emit_prologue): Save altivec registers and vrsave. + (compute_vrsave_mask): New. + (altivec_expand_builtin): Remove unused variables. + (rs6000_parse_abi_options): Add static qualifier. + (rs6000_expand_builtin): Remove unused parameters. + (altivec_expand_builtin): Cast bdesc_2arg to get rid of warning. + (altivec_init_builtins): Same. + (is_altivec_return_reg): New. + (vrsave_operation): New. + (ALTIVEC_REG_BIT): New. + (generate_set_vrsave): New. + + * rs6000.md (get_vrsave): New. + (set_vrsave): New. + (*set_vrsave_internal): New. + + * rs6000.h (rs6000_stack): Add first_altivec_reg_save, + altivec_save_offset, vrsave_save_offset, altive_size, vrsave_size, + altivec_padding_size, vrsave_mask. + (TOTAL_ALTIVEC_REGS): New. + (EPILOGUE_USES): Add VRSAVE_REGNO. + +2001-11-20 Jeff Law + + * unroll.c (copy_loop_body): Update LABEL_NUSES for the + exit label as necessary. + +2001-11-20 Brad Kaiser + + * reload1.c (elimination_effects): Use function_invariant_p + instead of CONSTANT_P when considering register equivalences. + +2001-11-20 David O'Brien + + * config.gcc: Add FreeBSD/PowerPC target. + (powerpc64-*-linux*, powerpc-*-sysv*, powerpc-*-netbsd*, + powerpc-*-chorusos*, powerpc-*-eabiaix*, powerpc-*-eabisim*, + powerpc-*-elf*, powerpc-*-eabi*, powerpc-*-rtems*, + powerpc-*-linux*libc1, powerpc-*-linux*, powerpc-wrs-vxworks*, + powerpcle-wrs-vxworks*, powerpcle-*-sysv*, powerpcle-*-elf*, + powerpcle-*-eabisim*, powerpcle-*-eabi*, powerpcle-*-solaris2*): Add + freebsd-spec.h to tm_file. + (rs6000-*-lynxos*): Add lynx.h to tm_file. + * config/freebsd.h: Tidy up. + (USING_CONFIG_FREEBSD): Define. + (FBSD_SWITCH_TAKES_ARG, FBSD_WORD_SWITCH_TAKES_ARG, + FBSD_CPP_PREDEFINES, FBSD_CPP_SPEC, FBSD_STARTFILE_SPEC, + FBSD_ENDFILE_SPEC, FBSD_LIB_SPEC): Remove (moved to freebsd-spec.h). + (TARGET_HAS_F_SETLKW): Define. + (ASM_OUTPUT_IDENT): Delete, the elfos.h definition is fine. + * config/freebsd-spec.h: New file. + * config/rs6000/freebsd.h: New file. + * config/rs6000/rs6000.h (TARGET_VERSION): Do not define. + * config/rs6000/rs6000.c: Test for USING_ELFOS_H rather than + USING_SVR4_H to know when to turn on ELF support. + * config/rs6000/sysv4.h (TARGET_VERSION, CPP_PREDEFINES): Don't undef, + define only if not already defined. + Add FreeBSD support. + * config/rs6000/aix.h (TARGET_VERSION): Define. + * config/rs6000/beos.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/mach.h: Likewise. + * config/rs6000/lynx.h (TARGET_VERSION): Likewise. + Don't include lynx.h directly. + +2001-11-20 Graham Stott + + * unwind-dw2-fde.c (__deregister_frame_info_bases): + Fix lossage in last change return OB. + +Tue Nov 20 11:56:12 2001 Douglas B. Rupp + + * config/alpha/xm-vms.h (_POSIX_EXIT): Define. + Remove unneeded exit related macros. + +2001-11-20 David Edelsohn + + * rs6000.c (rs6000_emit_eh_toc_restore): Remove ALIGN parm. + + * rs6000.c (rs6000_emit_move): Add TFmode case. + * sysv4.h (MASK_LONG_DOUBLE_128, TARGET_LONG_DOUBLE_128, + LONG_DOUBLE_TYPE_SIZE, MAX_LONG_DOUBLE_TYPE_SIZE, + LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Move from here... + * rs6000.h: ... to here. + * rs6000.md (movtf, extenddftf2, extendsftf2, trunctfdf2, + trunctfsf2, floatditf2, floatsitf2, fix_trunctfdi2, + fix_trunctfsi2, negtf2, abstf2, nabstf2, cmptf): New patterns. + +Tue Nov 20 06:41:38 2001 Richard Kenner + + * emit-rtl.c (get_mem_attrs): Fix typo. + +2001-11-20 Jakub Jelinek + + * c-lang.c (finish_file): Backout 2001-11-16 + changes, instead set DECL_DEFER_OUTPUT for static inline functions + before calling c_expand_deferred_function. + +2001-11-20 Jakub Jelinek + + * unwind-dw2-fde.c (__register_frame_info_bases, __register_frame): + Don't register empty .eh_frame sections. + (__deregister_frame_info_bases, __deregister_frame): Don't + unregister them either. + +2001-11-19 Geoffrey Keating + + * configure.in (HAVE_AS_GDWARF2_DEBUG_FLAG): Define. + (HAVE_AS_GSTABS_DEBUG_FLAG): Define. + * configure: Regenerate. + * config.in: Add dummy definitions of new flags. + * toplev.c (PREFERRED_DEBUGGING_TYPE): Move definition to... + * defaults.h (PREFERRED_DEBUGGING_TYPE): ... here. + * gcc.c (ASM_DEBUG_SPEC): New macro. + (asm_debug): New static variable. + (default_compilers): Add asm_debug when assembling from + user input. + (static_specs): Add asm_debug. + +2001-11-20 Loren J. Rittle + + * config.gcc (*-*-freebsd*): Remove configuration block. + +2001-11-19 Loren J. Rittle + + bootstrap/4422 + * configure.in: Setup ability to run ./stage[1234]/xgcc in + fixinc *as if* it were a proper lang subdirectory. + * configure: Rebuilt. + +2001-11-19 Loren J. Rittle + + * config/freebsd.h: Remove DEFAULT_VTABLE_THUNKS (again). + +2001-11-19 Kaveh R. Ghazi + + * 1750a.md: Don't use hex format for a const_int. + +2001-11-19 Geoffrey Keating + + * expmed.c (extract_bit_field): Don't create invalid SUBREGs. + +2001-11-19 Zack Weinberg + + * mkconfig.sh: Undefine ENABLE_NLS if GENERATOR_FILE is + defined (prevents link errors when gettext isn't in the system + library). + +2001-11-19 DJ Delorie + + * read-rtl.c (ISDIGIT, ISSPACE): Make sure we have these. + (validate_const_int): New. + (read_rtx): Validate constant integers. + * config/i386/i386.md (pmulhrwv4hi3): Use decimal constants. + +2001-11-19 Jakub Jelinek + + * doc/hostconfig.texi (DUMPFILE_FORMAT): Move into the table. + +Mon Nov 19 16:57:44 2001 Douglas B. Rupp + + * toplev.c (DUMPFILE_FORMAT): Define default. + (open_dump_file): Use DUMPFILE_FORMAT in sprintf. + (close_dump_file, compile_file): Likewise. + * config/alpha/xm-vms.h (DUMPFILE_FORMAT): Define. + * doc/hostconfig.texi (DUMPFILE_FORMAT): Document + +2001-11-19 Jeff Law + + * gcse.c (cprop_jump): Clear JUMP_LABEL field when we create + a nop-jump. + +2000-11-19 Neil Booth + + * cppmacro.c (_cpp_backup_tokens): Revert previous check-in. + Don't fall off the base token run. + +2001-11-19 Jason Wilkins + + * Makefile.in: Use INSTALL_SCRIPT not INSTALL_PROGRAM. + +Mon Nov 19 15:13:43 2001 Richard Kenner + + * tree.def (VIEW_CONVERT_EXPR): New tree code. + * tree.h (handled_component_p): New declaration. + * alias.c (handled_component_p): Move function from here ... + * expr.c (handled_component_p): ... to here and non longer static. + (is_zeros_p, case VIEW_CONVERT_EXPR): New case. + (store_field): Remove unneeded MEM_COPY_ATTRIBUTES call. + (get_inner_reference): Handle VIEW_CONVERT_EXPR. + (expand_expr, case VAR_DECL): Clean up handling of re-layout case. + (expand_expr, case VIEW_CONVERT_EXPR): New case. + (expand_expr, cse ADDR_EXPR): No need to copy if already + BIGGEST_ALIGNMENT. + * fold-const.c (fold, case VIEW_CONVERT_EXPR): New case. + * varasm.c (initializer_constant_value_p, case VIEW_CONVERT_EXPR): New. + (output_constant): Handle VIEW_CONVERT_EXPR. + * dwarf2out.c (loc-descriptor_from_tree, add_bound_info): + Add new case for VIEW_CONVERT_EXPR. + +2001-11-19 Kaveh R. Ghazi + + * a29k/unix.h (ASM_FILE_START): Const-ify. + * i386/beos-elf.h (INCLUDE_DEFAULTS): Remove semi-colon. + * i386/isc.h (ASM_FILE_START): Const-ify. + * i386/sun386.h (ASM_FILE_START): Likewise. + * m32r.md: Likewise. + * m68k/auxas.h (ADDITIONAL_REGISTER_NAMES): Add missing brackets. + * m68k/auxgas.h ADDITIONAL_REGISTER_NAMES): Likewise. + * m68k/tower.h (REGISTER_NAMES): Remove semi-colon. + * mn10200.md: Initialize variable. + +Mon Nov 19 18:06:21 CET 2001 Jan Hubicka + + * gcse.c (try_replace_reg): Copy RTX before creating note. + + * df.h (df_ref_flags): New uenum. + (DF_REF_FLAGS): New macro. + (struct ref): Add field "flags". + * df.c (HANDLE_SUBREG): Remove. + (df_ref_create): Likewise; set flags field of ref. + (df_def_record_1): Strip down read_write subreg; remove + commented out code; set READ_WRITE flag. + (read_modify_subreg_p): New static function. + (df_uses_record): Cleanup SET handling; set READ_WRITE flag; + new argument "flags". + (df_insn_refs_record): Update call of df_uses_record. + (df_insn_modify): Avoid #if 0 around comment. + (df_dump): Dump the read/write flag. + + * predict.c (propagate_freq): Make cyclic_probability and frequency + volatile + + * i386.c (ix86_cc_mode): Accept USE. + + * cfgrtl.c (purge_dead_edges): Cleanup EDGE_ABNORMAL flag if computed + jump is turned into simplejump. + +2001-11-19 Joseph S. Myers + + * doc/fragments.texi, doc/trouble.texi: Remove links to old + installation chapter. + * doc/gcc.texi: Don't claim that this manual documents + installation. Mark Installation menu entry as being out of date. + +Mon Nov 19 07:21:35 2001 Douglas B. Rupp + + * config/alpha/xm-vms.h: Don't define macros that autoconf handles. + (SUCCESS_EXIT_CODE, FATAL_EXIT_CODE): Define for posix compatibility. + * gcc.c (exit): Remove definition for VMS; moved to xm-vms.h. + +2001-11-19 Jason Merrill + + * cppmacro.c (_cpp_backup_tokens): Pop cur_run before decrementing + cur_token, not after. + + * config/clipper/clix.h, config/h8300/elf.h, config/mips/linux.h: + Lose ASM_OUTPUT_CONSTRUCTOR. + * system.h: Poison it and INT_ASM_OP. + * c-lang.c (finish_file): Don't check for it. + * libgcc2.c (L_ctors): Check TARGET_ASM_CONSTRUCTOR instead. + +2001-11-18 Kaveh R. Ghazi + + * mmix.c (mmix_cc1_ignored_option): Const-ify. + (mmix_init_machine_status): Make static to match declaration. + (mmix_unique_section): Const-ify. + (mmix_output_quoted_string): Avoid automatic aggregate + initialization. + (mmix_output_register_setting): Likewise. + (mmix_output_shiftvalue_op_from_str): Likewise. + + * mmix.h (mmix_cc1_ignored_option): Const-ify. + (ASM_OUTPUT_BYTE): Fix format specifier warning. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + +2001-11-18 Craig Rodrigues + + PR c/4448 + * gthr-win32.h: (__gthread_objc_thread_exit): Fix variable + name __objc_thread_exit_status so that it matches the + variable defined in objc/thr.h. + +2001-11-18 Craig Rodrigues + + PR bootstrap/4020 + * mklibgcc.in: Add missing semi-colons. + * Makefile.in: Same. + +Sun Nov 18 16:47:00 2001 Richard Kenner + + * expr.c (expand_expr, case VAR_DECL): Update alignment of DECL_RTL + after re-laying out decl in incomplete case. + (expand_expr, case ADDR_EXPR): Fix typo in copy case. + +2001-11-18 Joseph S. Myers + + * doc/install-old.texi: Move some sections out to ... + * doc/collect2.texi, doc/configfiles.texi, doc/headerdirs.texi: + ... here. New files. Make into chapters rather than sections. + * doc/gcc.texi: Include the new files and add menu entries for + them. + * Makefile.in ($(docdir)/gcc.info, gcc.dvi): Update dependencies. + +Sun Nov 18 14:13:52 2001 Richard Kenner + + * tree.h (TYPE_ALIGN_OK): New flag. + * emit-rtl.c (set_mem_attributes): Handle it. + * expr.c (emit_single_push_insn): Only set to alias set 0 if + doing sibcall optimization. + (expand_expr, case COMPONENT_REF): Call set_mem_attributes on case + when make temporary. + (expand_expr, case CONVERT_EXPR): Simplify convert-to-union case. + (expand_expr, case ADDR_EXPR): Abort if TYPE_ALIGN_OK and need copy. + + * sdbout.c (sdbout_symbol): Avoid warning due to &DECL_RTL. + +2001-11-18 Joseph S. Myers + + * c-decl.c (c_decode_option): Give deprecation warning for + -traditional. + * doc/invoke.texi (-traditional): Note that this option is + deprecated. + +Sun Nov 18 07:40:07 2001 Douglas B. Rupp + + * config/alpha/alpha.c (alpha_start_function, VMS): Cast shift + arg to HOST_WIDE_INT, not long. + + * config/alpha/vms.h (DIR_SEPARATOR, PREFIX). Don't define. + (HAS_INIT_SECTION): Define. + (REAL_ARITHMETIC): Don't undefine. + +2001-11-18 Egor Duda + + * config/i386/cygwin.h: Strip leading '*' from name, if any. + +2001-11-18 Neil Booth + + * Makefile.in (c-parse.o, c-common.o): Update dependencies. + * c-common.c: Include diagnostic.h. + (c_common_finish): New. + * c-common.h (c_common_finish): New. + * c-lang.c (LANG_HOOKS_FINISH): Override. + * c-parse.in: Don't include diagnostic.h. + (finish_parse): Remove. + * langhooks.h: Update comments. + * toplev.c (lang_dependent_init): New prototype. + (finalize): New. + (compile_file): Split cleanup code out to finalize. + (lang_dependent_init): Stop if lang_hooks.init fails. + (toplev_main): Update. + * tree.h (finish_parse): Remove. +objc: + * objc-act.c (LANG_HOOKS_FINISH): Override. + +Sat Nov 17 23:30:44 2001 Douglas B. Rupp + + * config/alpha/t-vms (LIB2FUNCS_EXTRA): Add vms_tramp.asm. + * config/alpha/vms_tramp.asm: New file. + * config/alpha/vms-tramp.asm: Removed. + +2001-11-18 Joseph S. Myers + + * c-common.c (struct disabled_builtin, disabled_builtins, + disable_builtin_function, builtin_function_disabled_p): New. + (builtin_function_2): Check for disabled built-in functions. + * c-common.h (disable_builtin_function): Declare. + * c-decl.c (c_decode_option): Handle -fno-builtin-FUNCTION. + * doc/invoke.texi: Document -fno-builtin-FUNCTION. + * doc/extend.texi: Mention -fno-builtin-FUNCTION. + +2001-11-17 Craig Rodrigues + + PR target/4606 + * config.gcc: Remove reference to va-clipper.h. + +2001-11-17 Stan Shebs + + * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Fix the + AltiVec-related bitfields. + +Sat Nov 17 12:06:31 2001 Richard Kenner + + * except.c (enum eh_region_type): Add ERT_UNKNOWN. + (mark_eh_region, case ERT_UKNONW): New case. + +2001-11-17 Christopher Faylor + Corinna Vinschen + + * config/i386/cygwin.h: Search target specific include directory for + w32api stuff, if appropriate. + +Sat Nov 17 08:20:44 2001 Douglas Rupp + + * config/alpha/vms.h (REG_ALLOC_ORDER): Redefine. + +2001-11-16 Aldy Hernandez + + * config/rs6000/rs6000.md: Change all ldvx to lvx. + +2001-11-16 Alexandre Oliva + + * gensupport.c (process_rtx): Don't assume filename is the first + argument of any rtl. + +2001-11-16 John David Anglin + + * vax-protos.h (reg_was_0_p): New prototype. + * vax.md (movsi, movhi, movqi): Use reg_was_0_p. + * vax.c (follows_p, reg_was_0_p): New functions. + +2001-11-16 John David Anglin + + * vax.md (casesi): Swap arguments in "(plus:SI (pc) (mult))". Reformat. + (casesi1): Likewise. Define new pattern which arises by simplification + when operand 1 is a constant int. Correct pattern which arises by + simplification when operand 1 is zero. + +2001-11-16 David O'Brien + + * config.gcc (arm*-*-rtems*, arm-*-coff*, armel-*-coff*, + arm-*-vxworks*, arm-*-riscix1.[01]*, arm-*-riscix*, + arm-semi-aout, armel-semi-aout, arm-semi-aof, armel-semi-aof, + arm*-*-netbsd*, arm*-*-linux*, arm*-*-uclinux*, arm*-*-aout, + arm*-*-ecos-elf, arm*-*-elf, arm*-*-conix*, arm*-*-oabi, + arm-*-pe*, strongarm-*-elf*, strongarm-*-coff*, strongarm-*-pe, + xscale-*-elf, xscale-*-coff: Include various CPU headers via tm_file. + * config/arm/aof.h: Don't include arm.h. + * config/arm/aout.h: Likewise. + * config/arm/coff.h: Don't include semi.h and aout.h. + * config/arm/elf.h: Don't include aout.h. + * config/arm/netbsd.h: Don't include netbsd.h and aout.h. + (TARGET_VERSION): Undef before defining. + (ARM_OS_NAME): Likewise + (TARGET_DEFAULT): Likewise + (TARGET_MEM_FUNCTIONS): Do not need to undefine now. + * config/arm/pe.h: Don't include arm/coff.h. + * config/arm/riscix.h (CPP_SPEC, SUBTARGET_CPP_SPEC): Use + SUBTARGET_CPP_SPEC rather than overiding the arm.h CPP_SPEC definition. + * config/arm/riscix1-1.h: Likewise. + * config/arm/rix-gas.h: Don't include riscix.h. + (DBX_CONTIN_LENGTH): Undef before defining. + * config/arm/semi.h: Don't include aout.h. + * config/arm/semiaof.h: Don't include aof.h. + * config/arm/strongarm-coff.h: Don't include coff.h. + * config/arm/strongarm-pe.h: Don't include strongarm-coff.h and pe.h. + * config/arm/vxarm.h: Don't include arm/coff.h. + * config/arm/xscale-coff.h: Don't include coff.h. + +Fri Nov 16 15:22:35 2001 Richard Kenner + + * config/pa/pa.c: Reflect changes in calling sequences of alter_reg and + emit_cmp_insn. + +2001-11-16 Andreas Jaeger + + * cfglayout.c (fixup_fallthru_exit_predecesor): Make void, rename + to .... + (fixup_fallthru_exit_predecessor): ... this. + Change callers and prototype. + +2001-11-16 Bernd Schmidt + + * config/i386/i386.c (ix86_expand_sse_comi): Generate setcc by + hand; don't use gen_setcc_2. + (ix86_expand_builtin): Fix pshufw. + * config/i386/i386.md (maskncmpv4sf3, vmmmaskncmpv4sf3): Special + case UNORDERED to emit the right assembler instruction. + (mmx_pshufw): Lose operand 2. + (cvtsi2ss): Fix representation. + From Graham Stott: + (mmx_clrdi, sse_clrti, stmxcsr, ldmxcsr): Set memory attribute. + +2001-11-16 Joseph S. Myers + + * doc/include/linux-and-gnu.texi: Remove. + * doc/gnu.texi: New. + * doc/gcc.texi: Include gnu.texi instead of linux-and-gnu.texi. + * Makefile.in ($(docdir)/gcc.info, gcc.dvi): Update dependencies. + +2001-11-16 Kazu Hirata + + * config/a29k/a29k.c: Fix comment formatting. + * config/a29k/a29k.h: Likewise. + * config/arc/arc.c: Likewise. + * config/arc/arc.h: Likewise. + * config/vax/vax.c: Likewise. + * config/vax/vax.h: Likewise. + * config/we32k/we32k.c: Likewise. + * config/we32k/we32k.h: Likewise. + +2001-11-16 Jeff Law + + * unroll.c (copy_loop_body): Initialize JUMP_LABEL field after + creating a new jump insn. + +Fri Nov 13 09:06:25 2001 Richard Kenner + + * expr.c (expand_expr, case ADDR_EXPR): Refine test for when to + copy misaligned data. + * varasm.c (assemble_variable): Set alignment into MEM when changed. + +2001-11-16 Graham Stott + + * optabs.c (prepare_cmp_insn): Correct lossage in last change fix + OPALIGN type. + +2001-11-16 Olivier Hainque + + * except.c: Support for catching a list of types with a single handler + (struct eh_region): Change type and filter to lists for catch regions. + (mark_eh_region): Mark the filter list for GC also. + (expand_start_catch): Always build a list if argument not NULL and + register each type of the list through add_type_for_runtime. + (duplicate_eh_region_1): Change type into type_list for catch regions. + (assign_filter_values): Assign a filter to each type associated with a + catch region. Assign filter for NULL types in a unique entry in the + filter list. + (build_post_landing_pads): Emit compare and jump for each filter of + the list associated with a catch region. + (reachable_next_level): When the type thrown is known, stop the search + as soon as one type within a catch list matches. Also, a handler is + potentially reachable only if at least one of the types it catches + has not been previously caught. + (collect_one_action_chain): Retrieve the filter for a NULL type list + from the first filter list entry. For non NULL type lists, add an + action record for every filter assigned. + * except.h: Reflect changes in comment before expand_start_catch. + +Fri Nov 16 07:12:51 2001 Richard Kenner + + * expr.c (expand_expr, case ADDR_EXPR): Only copy for misaligned if + BLKmode. + +Fri Nov 16 06:37:05 2001 Andreas Tobler + + * config/sparc/sparc.c: Remove ALIGN arg from emit_cmp_insn. + +2001-11-16 Jakub Jelinek + + * c-lang.c (finish_file): Don't emit static inline functions if + they weren't referenced. + +2001-11-15 Stan Shebs + + * expr.c (expand_expr, case COMPONENT_REF): Fix variable ref. + +2001-11-16 Bryce McKinlay + + * config/s390/s390.md: Remove ALIGN arg from emit_cmp_and_jump_insns + call. + * config/i386/i386.md: Likewise. + +Thu Nov 15 21:40:16 2001 Richard Kenner + + * timevar.c (rtl.h): Include so get fancy abort. + +2001-11-15 Dale Johannesen + + * config/darwin.h (SELECT_RTX_SECTION): Force address + initializers into 'const' section + * config/rs6000/rs6000.c (rs6000_emit_cmove): Fix mode of + if_then_else to match result, not operands + +Thu Nov 15 17:57:48 2001 Richard Kenner + + * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. + * emit-rtl.c (change_address): Fix typo in default alignment. + (adjust_address_1): Use mode of NEW, not MODE, when setting size. + * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. + * rtl.h (REGNO_PTR_FRAME_P): New macro. + + * expr.c (store_field): Pass tree instead of max size; callers changed. + Change handling of alignment. + Only copy to_rtx if is TARGET. + (expand_expr_unaligned): Delete; callers now use expand_expr. + (emit_cmp_insn): No longer take ALIGN parm; all callers changed. + (expand_assignment): Change handling of alignment. + Only copy to_rtx if was original. + (get_inner_reference): No longer return alginment; callers changed. + (expand_expr, case COMPONENT_REF): Change handling of alignment. + (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. + (compare_from_rtx): Delete ALIGN parm; all callers changed. + (do_compare_rtx_and_jump): Likewise. + * expr.h: Reflect above changes. + * tree.h: Likewise. + * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter + to get_inner_reference. + * builtins.c: Remove ALIGN parm in call to emit_cmp_and_jump_insns. + * doloop.c, except.c, explow.c, loop.c, stmt.c, unroll.c: Likewise. + * optabs.c: Likewise. + (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. + (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. + * expmed.c: Remove ALIGN arg from calls to compare_from_rtx, + compare_rtx_and_jump, and emit_cmp_jump_insns. + * fold-const.c: Remove PALIGN in calls to get_inner_reference. + * function.c (assign_stack_temp_for_type): No longer static. + * optabs.h (emit_cmp_insn): Remove ALIGN parm. + (prepare_cmp_insn): Delete declaration. + * rtl.h (assign_stack_temp_for_type): Add declaration. + * config/alpha/alpha.c, config/d30v/d30v.c: Reflect above changes. + * config/clipper/clipper.c, config/h8300/h8300.c: Likewise. + * config/i386/i386.c,config/mips/mips.c: Likewise. + * config/i860/i860.c, config/ia64/ia64.c: Likewise. + * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. + +2001-11-15 Stan Shebs + + * config/rs6000/rs6000.h: Fix a comment typo. + (RTX_COSTS): Sort processor versions better. + +2001-11-15 Kazu Hirata + + * config/h8300/h8300.md: Fix insn length of bit insns. + +2001-11-15 Jason Merrill + + * dwarf2out.c (dwarf2out_finish): Don't abort because of orphan + DIEs if there were errors in the source. + + * config/alpha/alpha-interix.h, config/alpha/elf.h, + config/arm/coff.h, config/i386/djgpp.h, config/i386/i386.c, + config/i386/i386.h, config/i386/sco5.h, config/i960/i960-coff.h, + config/m68k/coff.h, config/m88k/m88k.h, config/m88k/m88k.c, + config/pa/pa64-hpux.h, config/sh/sh.h, config/sparc/litecoff.h, + config/elfos.h, config/lynx.h, config/netware.h, + config/m68hc11/m68hc11.h, config/mcore/mcore-pe.h, + config/s390/linux64.h: Remove definitions of INT_ASM_OP, change + uses to use ASM_LONG. + +2001-11-15 Alan Matsuoka + + * gensupport.c process_include : Change call to alloca to + xmalloc. + +2001-11-15 Aldy Hernandez + + * config/rs6000/rs6000.md: Use spaces instead of tabs in output + templates. + +Thu Nov 15 08:36:39 2001 Richard Kenner + + * final.c (alter_subreg): If simplify_subreg can't do anything, + handle REG ourselves and abort for others. + +2001-11-15 Richard Hodson + + * config/h8300/h8300.c (dosize): Avoid corrupting R3 in interrupt + routines. + +2001-11-15 Neil Booth + + * fix-header.c (read_scan_file): Update. + +Thu Nov 15 08:36:39 2001 Richard Kenner + + * toplev.c (toplev_main): Don't start timing until after + command-line options are parsed. + +2001-11-15 Andreas Schwab + + * config.gcc: Set STMP_FIXPROTO and FIXPROTO_DEFINES in target + makefile frag, not host makefile frag. + (m88k-dg-dguxbcs*): Add m88k/t-dgux to tmake_file. + (hppa*): Add pa/t-bsd to tmake_file where no special xmake_file is + used. + (hppa*-*-openbsd*): Don't use nonexitent pa/t-openbsd. + * config/m88k/t-dguxbcs: Remove definitions already in t-dgux. + * config/m88k/t-dgux (STMP_FIXPROTO): Define. + * config/i386/t-cygwin (STMP_FIXPROTO): Define. + * config/i386/t-dgux (STMP_FIXPROTO): Define. + * config/x-interix: Don't define STMP_FIXPROTO and + FIXPROTO_DEFINES. + * config/t-interix: New file, define STMP_FIXPROTO. + * config/i386/x-beos (STMP_FIXPROTO): Don't define here. + * config/i386/t-beos (STMP_FIXPROTO): Define here instead. + * config/t-svr4 (FIXPROTO_DEFINES): Define. + * config/arm/t-riscix (FIXPROTO_DEFINES): Define. + * config/i386/t-sco5 (FIXPROTO_DEFINES): Define. + * config/i386/t-sco5gas (FIXPROTO_DEFINES): Define. + * config/m68k/t-hp3200: Renamed from x-hp3200. + * config/i370/t-oe: Renamed from x-oe. + * config/mips/t-iris: Renamed from x-iris. + * config/pa/t-bsd: Renamed from x-pa. + * config/pa/t-pa-hpux: Renamed from x-pa-hpux. + * config/x-linux, config/i386/x-cygwin, config/i386/x-dgux, + config/m88k/x-dgux, config/x-svr4, config/arm/x-riscix, + config/i386/x-sco5, config/m68k/x-hp320g, config/mips/x-iris6, + config/rs6000/x-cygwin: Remove files. + + * configure.in: Check for target objdump and use that in eh_frame + optimization test. + * configure: Regenerated. + +2001-11-15 Jakub Jelinek + + * jump.c (squeeze_notes): Return true if no real insns were found. + * rtl.h (squeeze_notes): Adjust prototype. + * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): If + squeeze_notes finds no real instructions, abort. + (merge_blocks_move_successor_nojumps): Likewise. + * loop.c (find_and_verify_loops): Likewise. + * stmt.c (expand_end_case): Likewise. + * ifcvt.c (dead_or_predicable): Return TRUE if squeeze_notes doesn't + find any real instructions. + + * config/ia64/ia64.c (ia64_adjust_cost): Handle SUBREGs. + + * cfgcleanup.c (try_optimize_cfg): If try_simplify_condjump optimized + conditional jump, request updating life into for the block + containing it. Fix a typo which prevented life info update. + Clear blocks bitmap before using it. + +2001-11-15 Neil Booth + + * c-common.c: Include c-lex.h. + (c_common_lang_init): Change prototype. Call init_c_lex and + init_pragma from here. + * c-common.h (c_common_lang_init): Change prototype. + * c-decl.c (init_decl_processing): Rename. Call c_parse_init. + * c-lang.c (c_init): Change prototype. Update. + (c_init_options): Update. + * c-lex.c (cpp_filename): Remove. + (init_c_lex): Update. Read the main file, and get the original + file name. + (yyparse): Finish the command line options. + * c-parse.in (c_parse_init): Call init_reswords here. + (init_parse): Remove. + * c-tree.h (c_init_decl_processing): New. + * cpphash.c (_cpp_init_hashtable): After initializing the hash + table, populate it. + * cppinit.c (read_original_filename, cpp_finish_options): New. + (cpp_create_reader): New prototype. Defer hash table initialization. + (cpp_start_read): Rename cpp_read_main_file. Initialize the + hash table. Get the original filename. + * cpplib.h (cpp_create_reader): Update. + (cpp_start_read): Remove. + (cpp_read_main_file, cpp_finish_options): New. + * cppmain.c (main, do_preprocessing): Update. + * langhooks.h (struct langhooks): Update init prototype. + * toplev.c (general_init, parse_options_and_default_flags, + process_options, lang_indpendent_init, lang_dependent_init, + init_asm_output): New; perform the bulk of initialization. + (compile_file): Move most of initialization to above functions. + (debug_hooks): Initialize statically. + (set_Wunused): Relocate. + (toplev_main): Move most of initialization to other init functions. + Have a clear logic flow. + * tree.h (init_parse, init_decl_processing): Remove. +objc: + * objc-act.c (objc_init): Update prototype, combine with old + init_parse. + (objc_init_options): Update. + + +2001-11-15 Andreas Jaeger + + * cfgrtl.c (purge_all_dead_edges): Use int as argument for + portability. + * basic-block.h: Adjust prototype. + +2001-11-15 Kazu Hirata + + * config/rs6000/aix31.h: Fix comment formatting. + * config/rs6000/beos.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/eabi.asm: Likewise. + * config/rs6000/linux.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/lynx.h: Likewise. + * config/rs6000/netbsd.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/rs6000/sol2.h: Likewise. + * config/rs6000/tramp.asm: Likewise. + * config/rs6000/xcoff.h: Likewise. + * config/rs6000/xm-beos.h: Likewise. + +2001-11-14 Alan Matsuoka + + * rtl.def (INCLUDE) : Define. + * gensupport.c (init_include_reader, process_include, + save_string) : New functions to implement an include facility + in .md files. + * gensupport.h : Add prototype for init_md_reader_args. + * genattr.c genattrtab.c gencodes.c genconfig.c genemit.c + genextract.c genflags.c genopinit.c genoutput.c + genpeep.c genrecog.c: Change call to init_md_reader to + init_md_reader_args. + * md.texi: Document (include "path") and -I directives for RTL + generation tools. + +2001-11-14 DJ Delorie + + * integrate.c (get_hard_reg_initial_reg): New. + * integrate.h (get_hard_reg_initial_reg): Prototype. + * local-alloc.c (block_alloc): Don't tie pseudos that + represent call-saved hard regs' initial values. + +2001-11-14 Kaveh R. Ghazi + + * m68k/linux.h: Include not "linux.h" to avoid infinite + recursion. + +2001-11-14 Roger Sayle + + * fold-const.c (fold): Optimize strlen comparisons against zero. + +2001-11-14 David O'Brien + + * config.gcc (sparc64-wrs-vxworks*, sparc-*-netbsd*, sparc-*-openbsd*, + sparc-*-chorusos*, sparc-*-elf*, sparc-*-linux*aout*, + sparc-*-linux*libc1*, sparc-*-linux*, sparc-*-lynxos*, sparc-*-rtems*, + sparc-*-rtemself*, sparc-hal-solaris2*, sparc-*-solaris2*, + sparc-*-sunos4.0*, sparc-*-sunos4*, sparc-*-sunos3*, sparc-*-sysv4*, + sparc-*-vxsim*, sparclite-*-aout*, sparclite-*-elf*, sparc86x-*-aout*, + sparc86x-*-elf*, sparc64-*-aout*, sparc64-*-elf*, sparc64-*-linux*): + Include various CPU headers via tm_file. a.out based platforms now + properly include sparc/aout.h. sol2.h usage now implies including + elfos.h, svr4.h, and sparc/sysv4.h. + * config/netbsd.h (TARGET_MEM_FUNCTIONS): Undef before defining it. + Also define to '1'. + * sparc/sparc.h (CPP_PREDEFINES, TARGET_VERSION, WORD_SWITCH_TAKES_ARG, + SELECT_SECTION, ASM_DECLARE_FUNCTION_NAME, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, DBX_REGISTER_NUMBER, ASM_OUTPUT_SOURCE_LINE): + Remove. They are a.out specific and belong in sparc/aout.h. + * sparc/aout.h (TARGET_VERSION, WORD_SWITCH_TAKES_ARG, SELECT_SECTION, + ASM_DECLARE_FUNCTION_NAME, TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + DBX_REGISTER_NUMBER, ASM_OUTPUT_SOURCE_LINE): Define. Moved here from + sparc/sparc.h. + * sparc/litecoff.h (WORD_SWITCH_TAKES_ARG, ASM_DECLARE_FUNCTION_NAME, + TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, DBX_REGISTER_NUMBER): Define. + Moved here from sparc/sparc.h. + * config/sparc/linux-aout.h (DEFAULT_PCC_STRUCT_RETURN): Undef before + defining. + * config/sparc/linux64.h (UNALIGNED_DOUBLE_INT_ASM_OP): Undef before + * config/sparc/lynx.h: Don't include lynx.h. + (SELECT_SECTION): Do not undef. + * config/sparc/openbsd.h: Don't include sparc/sparc.h. + * config/sparc/sol2-sld-64.h: Include sparc/sparc.h, elfos.h, svr4.h, + and sparc/sysv4.h. + * config/sparc/sol2.h: Don't include sparc/sparc.h and sparc/sysv4.h. + * config/sparc/sp64-aout.h (CPP_PREDEFINES): Don't define. Get from + sparc/aout.h now. + * config/sparc/sp64-elf.h (DWARF_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO): + Don't undef, there is no need. + * config/sparc/splet.h (CPP_PREDEFINES): Define. + * config/sparc/sun4o3.h (CPP_PREDEFINES): Likewise. + * config/sparc/sunos4.h (CPP_PREDEFINES): Likewise. + Don't include sparc/sparc.h. + * config/sparc/sysv4.h (WORD_SWITCH_TAKES_ARG, ASM_OUTPUT_SOURCE_LINE, + SELECT_SECTION, ASM_DECLARE_FUNCTION_NAME, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP): Don't undef, there is no need now. Don't include + elfos.h and svr4.h. + (TARGET_VERSION): Define. + * config/sparc/vxsim.h (TARGET_VERSION): Define. + +Wed Nov 14 19:46:08 CET 2001 Jan Hubicka + + * cfglayout.c (fixup_fallthru_exit_predecesor): New static function. + (cfg_layout_finalize): Use it. + * bb-reorder.c (HAVE_epilogue): Remove. + (make_reorder_chain): Do not care special placement of + last basic block. + + * predict.c (expected_value_to_br_prob): Delete the note + once transformed. + + * c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem; + measure integration time separately. + +Wed Nov 14 12:30:57 2001 Richard Kenner + + * function.c (struct temp_slot): ALIGN now unsigned. + +2001-11-14 Kazu Hirata + + * config/dsp16xx/dsp16xx.c: Fix comment formatting. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/dsp16xx/dsp16xx.md: Likewise. + +2001-11-14 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Reorganize the code + that deals with 7-bit shifts in HImode. + +Wed Nov 14 14:17:05 CET 2001 Jan Hubicka + + * dbxout.c (dbxout_symbol_location): Update call of alter_subreg. + * final.c (walk_alter_subreg): Take pointer; update call of alter_subreg. + (final_scan_insn): Update call of alter_subreg. + (cleanup_subreg_operands): Likewise. + (alter_subreg): Rewrite using simplify_subreg. + (output_address, output_operand): Update call of alter_subreg. + * output.h (alter_subreg): Update prototype. + * sdbout.c (sdbout_symbol): Update call of alter_subreg. + * simplify-rtx.c (simplify_subreg): Copy ORIGINAL_REGNO. + * Makefile.in (final.o): Add dependency on expr.h + +Wed Nov 14 06:37:54 2001 Richard Kenner + + * c-lang.c (finish_file): Make I unsigned to eliminate warning. + +2001-11-13 Jeff Sturm + + * doc/install.texi (sparc-*-linux*): Mention requirements for + binutils and glibc. + +2001-11-14 Joseph S. Myers + + * Makefile.in (POD2MAN): Don't include --section=1. + (manext): Rename to man1ext. All users changed. + (man7ext): New. + (man7dir): New. + (generated-manpages): Also depend on $(docdir)/gfdl.7, + $(docdir)/gpl.7, and $(docdir)/fsf-funding.7. + ($(docdir)/gcov.1, $(docdir)/cpp.1, $(docdir)/gcc.1): Include + --section=1 in calls to $(POD2MAN). + ($(docdir)/gfdl.7, $(docdir)/gpl.7, $(docdir)/fsf-funding.7): New. + (maintainer-clean, install, uninstall): Handle the new man pages. + ($(docdir)/cpp.info, cpp.dvi): Depend on fdl.texi. + (installdirs): Create man7dir. + * doc/cpp.texi: Include GFDL in this manual. In the man page, + refer to gfdl(7) for the GFDL. Apply Front Cover and Back Cover + texts to man page. Include gpl(7), gfdl(7) and fsf-funding(7) in + the SEE ALSO man page section. + * doc/gcov.texi: Apply GFDL to man page. Include gpl(7), gfdl(7) + and fsf-funding(7) in the SEE ALSO man page section. + * doc/invoke.texi: Apply GFDL to man page. Include gpl(7), + gfdl(7) and fsf-funding(7) in the SEE ALSO man page section. + * doc/include/fdl.texi, doc/include/funding.texi, + doc/include/gpl.texi: Adjust for conversion by texi2pod.pl. + * doc/.cvsignore: Add gfdl.7, gpl.7 and fsf-funding.7. + +2001-11-13 Richard Henderson + + * dwarf2asm.c (dw2_force_const_mem): Set PUBLIC or STATIC + as appropriate for the artificial decl. + +2001-11-13 Richard Henderson + + * loop.c (combine_movables): Turn off combination until + move_movables validation bugs are fixed. + +2001-11-13 DJ Delorie + + * config.gcc (powerpc|rs6000): Set default cpp options based + on --with-cpu settings. + * config/rs6000/softfloat.h: New. + +2001-11-13 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_si): Use special code for + 25-bit shifts on H8S. + (get_shift_alg): Generate special code for 25-bit shifts on + H8S. + +2001-11-13 Jakub Jelinek + + * emit-rtl.c (adjust_address_1): Add ADJUST argument. + (adjust_automodify_address_1): New. + * expr.h (adjust_address, adjust_address_nv): Adjust. + (adjust_automodify_address, adjust_automodify_address_nv): Define. + (adjust_address_1): Update prototype. + (adjust_automodify_address_1): Add prototype. + * expr.c (move_by_pieces_1): Use adjust_automodify_address. + (store_by_pieces_2): Likewise. + +Tue Nov 13 05:45:40 2001 Richard Kenner + + * Makefile.in (explow.o): Now depends on ggc.h. + * explow.c (ggc.h): Include. + (set_stack_check_libfunc): Mark stack_check_libfunc as ggc root. + + * Makefile.in (expr.o): Depends on insn-attr.h. + * expr.c (insn-attr.h): New include. + (force_operand): If INSN_SCHEDULING, deal with paradoxical SUBREG + of MEM. + (highest_pow2_factor, case INTEGER_CST): Handle negative values. + (expand_expr): Remove unneeded mark_temp_addr_taken calls and + clean up related usage in ADDR_EXPR. + (expand_expr_unaligned): Likewise. + + * emit-rtl.c (change_address): Fix typo in alias setting. + +2001-11-13 Kaveh R. Ghazi + + * Makefile.in (cfgcleanup.o): Depend on insn-config.h + +2001-11-12 Craig Rodrigues + + PR bootstrap/3451 + * c-pragma.c: Rename macros BAD, BAD2, BAD_ACTION to + GCC_BAD, GCC_BAD2, GCC_BAD_ACTION. + +2001-11-12 David O'Brien + + * config.gcc (sparc-tti-*, sparc64-wrs-vxworks*, sparc-wrs-vxworks*, + sparclite-wrs-vxworks*, sparc-*-aout*, sparc-*-netbsd*, + sparc-*-chorusos*, sparc-*-linux*aout*, sparc-*-linux*libc1*, + sparc-*-linux*, sparc-*-lynxos*, sparc-*-rtemsaout*, sparc-*-rtems*, + sparc-*-rtemself*, sparc-*-solaris2*, sparc-*-sunos3*, sparc-*-sysv4*, + sparc-*-vxsim*, sparclet-*-aout*, sparclite-*-coff*, sparclite-*-aout*, + sparc86x-*-aout*, sparc86x-*-elf*, sparc64-*-aout*, sparc64-*-elf*, + sparc64-*-linux*): Include various CPU headers via tm_file. + * config/svr3.h (ASM_OUTPUT_IDENT): Undef before defining it. + (SELECT_SECTION): Likewise. + (SELECT_RTX_SECTION): Likewise. + * config/sparc/sparc_bi.h: New file. + * config/sparc/aout.h: Don't include sparc/sparc.h and aoutos.h. + * config/sparc/linux-aout.h: Likewise. + * config/sparc/linux.h: Don't include sparc/sysv4.h. + * config/sparc/linux64.h: Likewise. + (SPARC_BI_ARCH): Don't define. sparc_bi.h will do it instead. + * config/sparc/lite.h: Don't include sparc/sparc.h and gofast.h. + * config/sparc/litecoff.h: Don't include sparc/lite.h, svr3.h, + and dbxcoff.h + (ASM_OUTPUT_IDENT): Do not #undef. + (SELECT_SECTION): Likewise. + (SELECT_RTX_SECTION): Likewise. + * config/sparc/liteelf.h: Don't include gofast.h. + * config/sparc/lynx-ng.h: Don't include sparc/sparc.h and lynx-ng.h. + * config/sparc/lynx.h: Don't include sparc/sparc.h. + * config/sparc/pbd.h: Likewise. + * config/sparc/netbsd.h: Don't include sparc/sparc.h and netbsd.h. + * config/sparc/rtems.h: Don't include sparc/aout.h and rtems.h. + * config/sparc/rtemself.h: Don't include rtems.h. + * config/sparc/sol2-64.h: Don't include sparc/sol2-sld-64.h. + * config/sparc/sol2-sld-64.h (SPARC_BI_ARCH): Don't define, include + sparc_bi.h instead. + * config/sparc/sol2-sld.h: Don't include sparc/sol2.h. + * config/sparc/sol2.h: Include sparc/sparc.h directly. + * config/sparc/sp64-aout.h: Don't include sparc/sparc.h and aoutos.h. + * config/sparc/sp64-elf.h: Don't include sparc/sol2.h. + * config/sparc/sp86x-aout.h: Don't include sparc/sparc.h and gofast.h. + * config/sparc/sp86x-elf.h: Don't include gofast.h. + * config/sparc/splet.h: Don't include sparc/aout.h. + * config/sparc/sun4o3.h: Don't include sparc/sparc.h. + * config/sparc/sysv4.h: Don't include sparc/sparc.h directly. + * config/sparc/vxsim.h: Don't include sparc/sysv4.h. + * config/sparc/vxsparc.h: Don't include sparc/aout.h and gofast.h. + * config/sparc/vxsparc64.h: Don't include gofast.h. + (SPARC_BI_ARCH): Don't define. sparc_bi.h will do it instead. + +2001-11-12 Joseph S. Myers + + * doc/standards.texi: Mention C99 TC1. + +2001-11-12 Kaveh R. Ghazi + + * mips-protos.h (mips_output_conditional_branch): Const-ify. + * mips.c (mips_output_conditional_branch): Likewise. + +2001-11-12 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_si): Use special code for + 15-bit logical shifts and 31-bit logical shifts. + (get_shift_alg): Generate special code for 15-bit and 31-bit + logical shifts. + +2001-11-12 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_qi): Use rotations when + doing 6-bit logical shifts on H8S. + (shift_alg_qi): Use special code for 21-bit shifts on H8S. + (get_shift_alg): Generate special code for 21-bit shifts on + H8S. + +2001-11-12 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove a redundant + label. + +Mon Nov 12 11:58:26 2001 Richard Kenner + + * alias.c (nonoverlapping_memrefs_p): Only update size from memref + if both size and offset known. + +2001-11-12 David O'Brien + + * config/ia64/freebsd.h: Fix misspelling. + +2001-11-12 Joseph S. Myers + + * doc/gcc.texi: Move several chapters out to ... + * doc/configterms.texi, doc/fragments.texi, doc/hostconfig.texi, + doc/include/linux-and-gnu.texi, doc/interface.texi, + doc/makefile.texi, doc/passes.texi, doc/portability.texi: + ... here. New files. + * doc/gcc.texi, doc/contrib.texi: Move section headings into + contrib.texi. + * Makefile.in ($(docdir)/gcc.info, gcc.dvi): Update dependencies. + +2001-11-12 Kazu Hirata + + * config/alpha/alpha-interix.h: Fix comment formatting. + * config/alpha/alpha.c: Likewise. + * config/alpha/alpha.h: Likewise. + * config/alpha/alpha32.h: Likewise. + * config/alpha/freebsd.h: Likewise. + * config/alpha/unicosmk.h: Likewise. + * config/alpha/vms.h: Likewise. + +2001-11-12 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove redundant code. + +2001-11-12 Jakub Jelinek + + * dbxout.c (dbxout_symbol_location): Avoid emitting invalid register + numbers. + +Mon Nov 12 05:18:42 2001 Richard Kenner + + * emit-rtl.c (set_mem_attributes): If making object, can set alignment + from type. + (replace_equiv_address): Call update_temp_slot_address. + + * dwarf2out.c (loc_descriptor_from_tree, case COMPOUND_EXPR): New case. + + * alias.c (nonoverlapping_memrefs_p): Handle DECL_RTL being a CONCAT. + +2001-11-12 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_qi): New. + (shift_alg_hi): Likewise. + (shift_alg_si): Likewise. + (get_shift_alg): Change the type of count to unsigned int. + Use the tables. + +2001-11-11 Alexandre Oliva + + * Makefile.in (c-lang.o): Depend on $(VARRAY_H). + * c-decl.c (c_expand_body): Take argument can_defer_p. Use it + to decide whether to defer a function. + (finish_function): Adjust. + (c_expand_deferred_function): New function. + * c-lang.c (deferred_fns): New variable. + (c_init): Initialize it, and mark it as a root. + (defer_fn): New function. + (finish_file): Expand all deferred functions. + * c-tree.h (defer_fn): Declare. + (c_expand_deferred_function): Likewise. + * objc/Make-lang.in (objc-act.o): Depend on $(VARRAY_H). + * objc-act.c (deferred_fns): New variable. + (objc_init): Initialize it, and mark it as a root. + (defer_fn): New function. + (finish_file): Expand all deferred functions. + +2001-11-11 Kaveh R. Ghazi + + * alpha.c (unicosmk_special_name): Prototype. + (unicosmk_ssib_name): Delete unused variable. + * alpha/unicosmk.h (common_section, ssib_section): Prototype. + * alpha/vms.h (PREFIX): Undef before defining. + * arm/pe.h (SUBTARGET_NAME_ENCODING_LENGTHS): Likewise. + * i370/i370.c (mvs_hash_alias): Prototype. Wrap with macro + controlling usage. Const-ify. + (alias_number): Delete unused variable. + * m32r/m32r.c (m32r_sched_init): Add missing argument. + (m32r_expand_block_move): Fix uninitialized warnings. + * mn10300/mn10300.h (REGNO_IN_RANGE_P): Fix 'unsigned >=0 is + always true' warnings. + * openbsd.h (TARGET_MEM_FUNCTIONS): Don't redefine. + * sh/sh.c: Include "integrate.h". + (output_far_jump): Fix uninitialized warning. + * final.c (shorten_branches): Avoid automatic aggregate + initialization. + * integrate.c (subst_constants): Likewise. + +2001-11-11 Kazu Hirata + + * config/h8300/h8300.c (shift_alg): Remove SHIFT_MAX. + (get_shift_alg): Remove redundant code. + +2001-11-11 Kazu Hirata + + * config/pa/milli64.S: Fix comment formatting. + * config/pa/pa-64.h: Likewise. + * config/pa/pa-linux.h: Likewise. + * config/pa/pa-protos.h: Likewise. + * config/pa/pa.c: Likewise. + * config/pa/pa.h: Likewise. + * config/pa/pa32-linux.h: Likewise. + * config/pa/pa32-regs.h: Likewise. + * config/pa/pa64-hpux.h: Likewise. + * config/pa/pa64-regs.h: Likewise. + * config/pa/som.h: Likewise. + +2001-11-11 Joseph S. Myers + + * doc/gcc.texi: Move several chapters out to ... + * doc/bugreport.texi, doc/contribute.texi, doc/frontends.texi, + doc/service.texi, doc/standards.texi, doc/trouble.texi, + doc/vms.texi: ... here. New files. + * Makefile.in ($(docdir)/gcc.info, gcc.dvi): Update dependencies. + +2001-11-11 Joseph S. Myers + + * ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog.5, ChangeLog, + cfg.c, cfganal.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgrtl.c, + collect2.c, combine.c, config.in, configure, configure.in, + conflict.c, dwarf2out.c, dwarfout.c, except.c, final.c, flow.c, + genattrtab.c, ggc-page.c, jump.c, lcm.c, predict.c, reg-stack.c, + reload1.c, rtlanal.c, sched-rgn.c, toplev.c, unwind-dw2-fde.h: Fix + spelling errors. + +Sun Nov 11 05:56:01 2001 Richard Kenner + + * config/rs6000/rs6000.c (rs6000_hash_constant, toc_hash_eq): + Adjust operand number in CONST_DOUBLE. + + * expmed.c (extract_bit_field): No longer pass in alignment. + (extract_fixed_bit_field, extract_split_bit_field): Likewise. + (store_bit_field, store_fixed_bit_field, store_split_bit_field): + Likewise. + * expr.c (store_constructor, store_constructor_field): Likewise. + (store_field, emit_group_load, emit_group_store): Likewise. + * expr.h (emit_group_load, emit_group_store): Delete ALIGN parm. + (store_bit_field, extract_bit_field): Likewise. + * calls.c, expr.c, function.c: Change calls to above functions. + * ifcvt.c, stmt.c: Likewise. + + * alias.c (nonoverlapping_memrefs_p): Not overlapping if one base is + constant and one is on frame. + If know memref offset, adjust size from decl. + +2001-11-11 Kaveh R. Ghazi + + * alpha/unicosmk.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Fix + format specifier warning. + * convex.h (ASM_OUTPUT_BYTE): Likewise. + * elfos.h (ALIGN_ASM_OP): Undef before defining. + * i386/att.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier + warning. + * i386/bsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/gas.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386-interix.h (gen_stdcall_suffix): Prototype. + * i386.h (ASM_OUTPUT_BYTE): Fix format specifier warning. + * i386elf.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_LONG_DOUBLE): Likewise. + * i386/interix.c (gen_stdcall_suffix): Const-ify. + * i386/next.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Fix format + specifier warnings. + * i386/osfrose.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/ptx4-i.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_LONG_DOUBLE): Likewise. + * i386/sco5.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/sequent.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/sun386.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/svr3dbx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * m68k/3b1.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_LONG_DOUBLE, + ASM_OUTPUT_FLOAT, ASM_GENERATE_INTERNAL_LABEL): Likewise. + * m68k/altos3068.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. + * m68k/amix.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): + Likewise. + * m68k/atari.h (ASM_OUTPUT_ASCII, ASM_GENERATE_INTERNAL_LABEL): + Likewise. + * m68k/crds.h (ASM_OUTPUT_DOUBLE, PRINT_OPERAND): Likewise. + * m68k/dpx2.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, ASM_OUTPUT_FLOAT_OPERAND): + Likewise. + * m68k/hp320.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_BYTE): + Likewise. + * m68k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): + Likewise. + * m68k/m68kv4.h (ASM_OUTPUT_ASCII): Delete unused variable. + * m68k/mot3300.h (ASM_OUTPUT_BYTE): Fix format specifier warning. + * m68k/news.h (PRINT_OPERAND): Likewise. + * m68k/next.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, + ASM_OUTPUT_FLOAT_OPERAND, ASM_OUTPUT_DOUBLE_OPERAND): Likewise. + * m68k/next21.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. + * m68k/plexus.h (ASM_SPEC): Insert space between macro name and + definition. + * m68k/sgs.h (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_FLOAT, ASM_OUTPUT_ASCII, ASM_OUTPUT_FLOAT_OPERAND, + ASM_OUTPUT_DOUBLE_OPERAND): Fix format specifier warnings. + * m68k/sun3.h (ASM_OUTPUT_FLOAT_OPERAND): Likewise. + * m68k/tower-as.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_BYTE, + PRINT_OPERAND): Likewise. + * m88k/m88k.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_BYTE): + Likewise. + * mips/elf.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. + * mips/elf64.h (PUT_SDB_SIZE, ASM_DECLARE_OBJECT_NAME): Likewise. + * mips/iris5gas.h (PUT_SDB_SIZE): Likewise. + * mips/linux.h (ASM_DECLARE_OBJECT_NAME): Likewise. + * mips.c (mips_output_external_libcall): Mark parameter with + ATTRIBUTE_UNUSED. + (mips_asm_file_start): Move variable into the scope where it's + used. + * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise. + * mips/netbsd.h (ASM_DECLARE_OBJECT_NAME): Likewise. + * mips/sni-gas.h (PUT_SDB_SIZE): Likewise. + * ns32k/encore.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * ns32k.c (print_operand): Likewise. + * pa.c (print_operand, output_div_insn): Likewise. + * pa.h (ASM_OUTPUT_MI_THUNK, ASM_GENERATE_INTERNAL_LABEL, + ASM_OUTPUT_BYTE, PRINT_OPERAND_ADDRESS): Likewise. + * pa/pa64-hpux.h (UNIQUE_SECTION): Const-ify. + * sparc/linux.h (ASM_GENERATE_INTERNAL_LABEL): Fix format + specifier warnings. + * sparc/linux64.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * sparc/pbd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_SOURCE_LINE): Don't list macro arguments in undef. + * sparc/vxsim.h (ASM_GENERATE_INTERNAL_LABEL): Fix format + specifier warnings. + * svr3.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + + * sdbout.c (sdbout_end_epilogue): Mark parameter with + ATTRIBUTE_UNUSED. + * varasm.c (assemble_global): Likewise. + +2001-11-11 H.J. Lu + + * config.gcc: Add "elfos.h svr4.h" to $tm_file for Linux/mips. + +Sun Nov 11 01:26:00 CET 2001 Jan Hubicka + + * final.c (*_MAX_SKIP): Use *_max_skip variables. + * flags.h (align_loops_max_skip, align_jumps_max_skip, + align_labels_max_skip): New global variables. + * toplev.c (align_loops_max_skip, align_jumps_max_skip, + align_labels_max_skip): New global variables. + (toplev_main): Set new variables. + * i386.c (override_options): Set max_skip values. + +2001-11-10 Geoffrey Keating + + * doc/tm.texi (Label Output): Document ASM_OUTPUT_LABEL_REF. + * final.c (output_addr_const): Use ASM_OUTPUT_LABEL_REF. + * config/stormy16/stormy16.c (xstormy16_print_operand): For '%C', + don't print an @fptr for labels either. + (xstormy16_output_addr_vec): Don't print @fptr here. + * config/stormy16/stormy16.h (ASM_OUTPUT_LABEL_REF): New macro. + +Sat Nov 10 08:50:50 2001 Jeffrey A Law (law@cygnus.com) + + * ssa-ccp.c (examine_flow_edges): Use old-style definition, not + an ANSI/ISO definitino. + (ssa_const_prop): Likewise. + +2001-11-10 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_reg_names): Remove leading "v" or + altivec registers. + +2001-11-09 Kaveh R. Ghazi + + * cppexp.c (parse_number): Use ISXDIGIT/hex_value. + * cpplex.c (hex_digit_value): Use hex_p/hex_value. + * cppmain.c (general_init): Call hex_init. + * tradcif.y (parse_number): Use TOLOWER/ISXDIGIT/hex_value/hex_p. + + * config.gcc (i[34567]86-dg-dgux*): Don't set `out_file'. + + * i386/dgux.h (ASM_FILE_START): Set to the meaningful portions + of dgux.c:output_file_start(). + + * i386/dgux.c: Delete file. + +2001-11-09 Richard Henderson + + * config/alpha/alpha.c (decl_in_text_section): New. + (current_file_function_operand): Use it. + (alpha_encode_section_info, alpha_end_function): Likewise. + +2001-11-07 David O'Brien + + * config.gcc: Add FreeBSD/IA-64 target. Expand config/i64/elf.h headers. + * config/i64/ia64.h (TARGET_VERSION,ASM_SPEC,LINK_SPEC): Remove, + they are OS specific. Use CPP_CPU_SPEC rather than CPP_PREDEFINES, + so OS specific files and use CPP_PREDEFINES for their needs. + * config/i64/elf.h (TARGET_VERSION): Add. Also, move inclusion of + target headers to tm_file. + * config/ia64/aix.h (TARGET_VERSION): Likewise. + * config/ia64/hpux.h (TARGET_VERSION): Likewise. + * config/ia64/linux.h (TARGET_VERSION): Likewise. + (FUNCTION_PROFILER): Remove. + * config/ia64/ia64.h (FUNCTION_PROFILER): Update definition using the + version in config/ia64/linux.h. + * config/ia64/freebsd.h: New file. + * config/freebsd.h: Tidy up. + (_USING_CONFIG_FREEBSD): Define. + (FBSD_CPP_PREDEFINES): Add __KPRINTF_ATTRIBUTE__. + (FBSD_CPP_SPEC): Define generic FreeBSD spec. + (FBSD_STARTFILE_SPEC): Likewise. + (FBSD_ENDFILE_SPEC): Likewise. + (FBSD_LIB_SPEC): Likewise. + (WCHAR_UNSIGNED): Undefine, FreeBSD's wchars are signed. + (USER_LABEL_PREFIX): Define to ELF compatible value as some CPU headers + set an ELF-improper one. + +2001-11-09 John David Anglin + + * pa.c (emit_move_sequence): Use cint_ok_for_move to check whether a + constant can be loaded in a single instruction to a register. When + loading immediate constants, use PLUS instead of HIGH/LO_SUM. Use + depdi for insertion of most significant 32-bits on 64-bit hosts. + * pa.h (LEGITIMATE_CONSTANT_P): Accept constants that can be built + with ldil/ldo/depdi instruction sequence on 64-bit hosts. + * pa.md: New addmove pattern for adding constant_int to HImode + register and moving result to HImode register. Remove HImode HIGH + and LO_SUM patterns. + +2001-11-09 Neil Booth + + * Makefile.in: Update. + * c-decl.c (print_lang_decl, print_lang_type): Remove. + (print_lang_identifier): Rename c_print_identifier. + * c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New. + (print_lang_statistics, lang_print_xnode): Remove. + * c-parse.in (set_yydebug): Rename c_set_yydebug. + * c-tree.h (c_set_yydebug, c_print_identifier): New. + * langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New. + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New members. + (lang_print_tree_hook): New. + * langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New. + * print-tree.c: Include langhooks.h. + (print_node): Update. + * toplev.c (decode_d_option): Update. + * tree.c: Include langhooks.h. + (dump_tree_statistics): Update. + * tree.h (print_lang_statistics, print_lang_decl, print_lang_type, + print_lang_identifier, set_yydebug, lang_print_xnode): Remove. +objc: + * objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER, + LANG_HOOKS_SET_YYDEBUG): Override. + (lang_print_xnode, print_lang_statistics): Remove. + +2001-11-09 Richard Henderson + + * dwarf2asm.c (dw2_force_const_mem): Invoke STRIP_NAME_ENCODING + on the symbol string. + +2001-11-09 Kaveh R. Ghazi + + * pa/elf.h (ASM_DECLARE_FUNCTION_NAME, + ASM_OUTPUT_EXTERNAL_LIBCALL): Undef before defining. + * config.gcc (hppa1.1-*-rtems*): Remove duplicate clause. + + * clipper.h (ASM_OUTPUT_REG_POP): Fix typo. + + * tlink.c (recompile_files): Copy strings passed to `putenv'. + +2001-11-09 Geoffrey Keating + + * tree.h (TYPE_VOLATILE): Trap use not on TYPEs. + (TYPE_READONLY): Likewise. + + * flow.c (insn_dead_p): Allow for AUTO_INC notes all the time. + + * config/stormy16/stormy16.h (ASM_SPEC): Revert last change, + don't pass --gdwarf2 to the assembler if the compiler will also + provide debug info. + + * config/stormy16/stormy16.c (xstormy16_expand_casesi): + Don't change INDEX. + +Fri Nov 9 17:51:09 2001 Richard Kenner + + * alias.c (nonoverlapping_memrefs_p): New function. + (true_dependence, canon_true_depenence, write_dependence_p): Call it. + + * emit-rtl.c (set_mem_attributes): Get alignments for constants. + +2001-11-09 Aldy Hernandez + + * rs6000.h (REG_CLASS_CONTENTS): Add VRSAVE bit to ALL_REGS. + (CONDITIONAL_REGISTER_USAGE): Disable AltiVec registers unless + generating altivec code. + (FIXED_REGISTERS): VRSAVE is fixed. + (CALL_USED_REGISTERS): VRSAVE is call used. + +2001-11-09 Jason Eckhardt + + * config/mips/mips.c (mips_output_conditional_branch): Do not hard + code the branch target as ".+16/.+12", but rather use labels. + +Fri Nov 9 11:27:42 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/milli64.S: Use %r25 and %r0 instead of arg1 and r0 + to work around limitations of certain versions of GAS. + + * pa.md (mulsi3): Remove PA64 hack to work around SUBREG issues. + (muldi3): Update due to SUBREG_BYTE changes. + (casesi): Similarly. + +2001-11-09 Zack Weinberg + + * doc/invoke.texi: Remove comment referring to -xf77-version. + +2001-11-09 Kazu Hirata + + * config/convex/convex.c: Fix comment formatting. + * config/convex/convex.h: Likewise. + +2001-11-08 Zack Weinberg + + * Makefile.in (.po.pox): Look both in srcdir and builddir + for $(PACKAGE).pot. + (po/$(PACKAGE).pot): Don't move-if-change the new potfile over + to the source directory. + +2001-11-09 Ben Elliston + Michael Meissner + Andrew MacLeod + Richard Henderson + Nick Clifton + Catherine Moore + + * m32r.c: Add support for m32rx processor. + * m32r.h: Ditto. + * m32r.md: Ditto. + * t-m32r: Ditto. + * m32r-protos.h: Add prototypes for m32rx functions. + * doc/invoke.texi: Document -m32rx option. + +2001-11-09 Jakub Jelinek + + * config/sparc/sparc.md (movdf): Avoid calling validize_mem during + or after reload. + +2001-11-09 Gerald Pfeifer + + * doc/install.texi2html: Use $MAKEINFO --no-split. + +2001-11-09 Andreas Schwab + + * Makefile.in ($(HOST_PREFIX_1)rtl.o, + $(HOST_PREFIX_1)print-rtl.o, $(HOST_PREFIX_1)bitmap.o, + $(HOST_PREFIX_1)vfprintf.o, $(HOST_PREFIX_1)doprint.o, + $(HOST_PREFIX_1)strstr.o, $(HOST_PREFIX_1)errors.o, + $(HOST_PREFIX_1)ggc-none.o): Update dependencies. + +2001-11-09 H.J. Lu + + * config/mips/mips.c (mips_output_function_prologues): Cast + `tsize' to long for output. + +2001-11-09 Neil Booth + + * c-lang.c (LANG_HOOKS_NAME): New. + (lang_hooks): Constify. + (c_init_options): Update. + (lang_identify): Remove. + * c-parse.in (language_string): Remove. + * dbxout.c: Include langhooks.h. + (dbxout_symbol_location): Update. + * dwarf2out.c: Include langhooks.h. + (gen_compile_unit_die): Update. + * dwarfout.c: Include langhooks.h. + (prototyped_attribute, output_compile_unit_die): Update. + * langhooks-def.h (LANG_HOOKS_NAME, LANG_HOOKS_IDENTIFIER_SIZE): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New members. Constify. + * stringpool.c: Don't include toplev.h. + (set_identifier_size): Remove. + * toplev.c (toplev_main): Initialize identifier size. + (print_version): Update. + * tree.h (language_string, init_lex, lang_identify, + set_identifier_size): Remove. + * Makefile.in: Update dependencies. + * config/darwin.c: Include langhooks.h. + (func_name_maybe_scoped): Update. + * config/darwin.h (ASM_END_FILE): Update. + * config/nextstep.h (ASM_END_FILE): Update. + * config/nextstep21.h (ASM_END_FILE): Update. + * config/i386/sun386.h (ASM_END_FILE): Update. + * config/rs6000/rs6000.c (ASM_END_FILE): Include langhooks.h. + (rs6000_output_function_epilogue): Update. +objc: + * objc-act.c (LANG_HOOKS_NAME): Override. + (struct lang_hooks): Constify. + (objc_init_options): Update. + (lang_identify): Remove. + +Fri Nov 9 00:25:18 EST 2001 John Wehle (john@feith.com) + + * fold-const.c (lshift_double): Honor PREC. + (rshift_double): Likewise. + +2001-11-08 Kazu Hirata + + * config/1750a/1750a.c: Fix comment formatting. + * config/1750a/1750a.h: Likewise. + +2001-11-08 Phil Edwards + + * configure.in (--enable-languages): Be more permissive about + syntax. Check for empty lists better. Warn about $LANGUAGES. + * configure: Regenerated. + +2001-11-08 Richard Henderson + + * dwarf2asm.c (dw2_force_const_mem): Fix typo. + +2001-11-08 Geoffrey Keating + + * config.gcc: Rename stormy16 to xstormy16. + * config/stormy16/stormy-abi: Likewise. + * config/stormy16/stormy16-protos.h: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/stormy16/stormy16.md: Likewise. + +2001-11-06 Geoffrey Keating + + * tree.h (TYPE_VOLATILE): Add enable-checking code. + (TYPE_READONLY): Likewise. + +Thu Nov 8 18:00:55 2001 Richard Kenner + + * reload1.c (reload): Don't delete equiv insn if can throw. + + * expr.c (emit_block_move): If X is readonly emit CLOBBER for it. + (clear_storage): Likewise, for OBJECT. + +Thu Nov 8 16:23:51 2001 Jeffrey A Law (law@cygnus.com) + + * pa.c (emit_move_sequence): Fix SUBREG expression to + use proper byte offset when extending a constant from + SImode to DImode. + +2001-11-09 Jakub Jelinek + + * cfgrtl.c (purge_dead_edges): Remove REG_EH_REGION note for insns + which cannot throw. + +Thu Nov 8 18:00:55 2001 Richard Kenner + + * explow.c (convert_memory_address, case SUBREG): Only return + inner object if SUBREG_PROMOTED_VAR_P or known to be pointer. + +2001-11-08 Richard Henderson + + * Makefile.in (GCC_FOR_TARGET): Add build_tooldir/sys-include. + (CROSS_SYSTEM_HEADER_DIR): Use build_tooldir not tooldir. + (ORDINARY_FLAGS_TO_PASS, stmp-fixinc): Likewise. + +2001-11-08 Aldy Hernandez + + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add -maltivec. + +2001-11-08 Jakub Jelinek + + * dwarf2out.c (debug_str_hash): New. + (struct indirect_string_node): New. + (struct dw_val_struct): Change type of val_str to it. + (DEBUG_STR_SECTION_FLAGS): Define. + (add_AT_string): Push string into hashtable, increment reference + counter. + (AT_string): Return string from ht_identifier. + (AT_string_form): New. + (free_AT): For dw_val_class_str, just decrement reference counter. + (size_of_string): Remove. + (size_of_die): Use AT_string_form to decide what size the string + occupies in DIE. + (size_of_pubnames): Use strlen instead of size_of_string. + (value_format): Use AT_string_form for dw_val_class_str. + (output_die): Output DW_FORM_strp strings using + dw2_asm_output_offset. + (indirect_string_alloc, output_indirect_string): New. + (dwarf2out_finish): Emit .debug_str strings if there are any. + +2001-11-08 Andreas Franck + + * configure.in: Add AC_ARG_PROGRAM to support program name + transformation with --program-prefix, --program-suffix and + --program-transform-name. + * configure: Regenerated. + * Makefile.in (GCC_INSTALL_NAME, CPP_INSTALL_NAME, + PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, GCOV_INSTALL_NAME, + GCCBUG_INSTALL_NAME, GCC_CROSS_NAME, CPP_CROSS_NAME, + PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Handle + program_transform_name the way suggested by autoconf. + (GCC_TARGET_INSTALL_NAME): Define. + (install-driver): Use the transformed target alias name. + +2001-11-08 Richard Henderson + + * config/mips/mips.c (save_restore_insns): Remove GP from the + restore registers mask early instead of special casing it inside + the loop. + +2001-11-08 Neil Booth + + * cp/decl.c (shadow_warning): New function. + (pushdecl): Improve -Wshadow warnings. Don't give both a warning + and an error when a block scope decl shadows a parameter. + +2001-11-08 Richard Henderson + + * config/fp-bit.h (usi_to_float): Define for US_SOFTWARE_GOFAST + case as well. + +2001-11-08 John David Anglin + + * pa.md (negdf2, negsf2): Use multiplication rather than subtraction + to implement floating negation on processors prior to PA 2.0. + +2001-11-08 Jakub Jelinek + + * dwarf2asm.c (mark_indirect_pool_entry, mark_indirect_pool): New. + (USE_LINKONCE_INDIRECT): Define. + (dw2_output_indirect_constant_1): Try to output indirect constants + into linkonce sections if possible. + (dw2_force_const_mem): Likewise. Register indirect_pool with GGC. + (dw2_output_indirect_constants): Likewise. + +2001-11-07 Aldy Hernandez + + * config/rs6000/rs6000.h (REG_ALLOC_ORDER): Add vrsave. + +2001-11-07 Neil Booth + + * c-decl.c (pushdecl): Remove file and line. + * c-typeck.c (pop_init_level): Remove size. + +2001-11-07 Aldy Hernandez + + * doc/invoke.texi: Add -maltivec, -mno-altivec, and -mabi=altivec + for rs6000. + + * config/rs6000/rs6000.h (MASK_ALTIVEC): New. + (TARGET_ALTIVEC): New. + (TARGET_SWITCHES): Add altivec. + (FIRST_PSEUDO_REGISTER): Change to 109. + (CALL_USED_REGISTERS): Same. + (FIRST_ALTIVEC_REGNO): New. + (LAST_ALTIVEC_REGNO): New. + (ALTIVEC_REGNO_P): New. + (UNITS_PER_ALTIVEC_WORD): New. + (ALTIVEC_VECTOR_MODE): New. + (FIXED_REGISTERS): Add altivec registers. + (REG_ALLOC_ORDER): Same. + (HARD_REGNO_NREGS): Adjust for altivec registers. + (HARD_REGNO_MODE_OK): Same. + (MODES_TIEABLE_P): Same. + (REGISTER_MOVE_COST): Same. + (REGNO_REG_CLASS): Same. + (reg_class): Add ALTIVEC_REGS. + (REG_CLASS_NAMES): Same. + (REG_CLASS_CONTENTS): Same. + (REG_CLASS_FROM_LETTER): Add 'v' constraint for ALTIVEC_REGS. + (ALTIVEC_ARG_RETURN): New. + (FUNCTION_VALUE): Handle VECTOR_TYPE. + (LIBCALL_VALUE): Handle altivec vector modes. + (VECTOR_MODE_SUPPORTED_P): New. + (ALTIVEC_ARG_MIN_REG): New. + (ALTIVEC_ARG_MAX_REG): New. + (ALTIVEC_ARG_NUM_REG): New. + (FUNCTION_VALUE_REGNO_P): Return true for altivec return register. + (FUNCTION_ARG_REGNO_P): Support passing args in altivec registers. + (REGISTER_NAMES): Add altivec regs. + (DEBUG_REGISTER_NAMES): Same. + (ADDITIONAL_REGISTER_NAMES): Same. + (rs6000_builtins): New. + (MD_EXPAND_BUILTIN): New. + (MD_INIT_BUILTINS): New. + (LEGITIMATE_OFFSET_ADDRESS_P): This addressing mode is not valid + for AltiVec instructions. + (LEGITIMATE_LO_SUM_ADDRESS_P): Same. + (HARD_REGNO_MODE_OK): Altivec modes can only go in altivec + registers. + (SECONDARY_MEMORY_NEEDED): We need memory to copy vector modes. + (TARGET_SWITCHES): Add no-altivec. + (DATA_ALIGNMENT): Align vectors to 128 bits. + (TARGET_OPTIONS): Add abi= option. + Add rs6000_abi_string extern. + (LOCAL_ALIGNMENT): New. + (CPP_CPU_SPEC): Define __ALTIVEC__ when -maltivec. + (MASK_ALTIVEC_ABI): New. + (TARGET_ALTIVEC_ABI): New. + (CONDITIONAL_REGISTER_USAGE): Set first 20 AltiVec registers to + call-saved. + (STACK_BOUNDARY): Adjust for altivec. + (BIGGEST_ALIGNMENT): Same. + (rs6000_args): Add vregno. + (USE_ALTIVEC_FOR_ARG_P): New. + (FIXED_REGISTERS): Add vrsave register. + (CALL_USED_REGISTERS): Same. + (CONDITIONAL_REGISTER_USAGE): Set VRSAVE info. + (VRSAVE_REGNO): New. + (reg_class): Add VRSAVE_REGS. + (REG_CLASS_NAMES): Same. + (REG_CLASS_CONTENTS): Same. + (REGNO_REG_CLASS): Same. + + * config/rs6000/sysv4.h (STACK_BOUNDARY): Adjust for altivec. + (ABI_STACK_BOUNDARY): Same. + (BIGGEST_ALIGNMENT): Same. + (ADJUST_FIELD_ALIGN): Remove undef. Define anew. + (ROUND_TYPE_ALIGN): Same. + + * config/rs6000/aix.h (ROUND_TYPE_ALIGN): Change BIGGEST_ALIGNMENT + to 64. + + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Change BIGGEST_ALIGNMENT + to 64. + + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Change BIGGEST_ALIGNMENT + to 64. + + * config/rs6000/rs6000.c (rs6000_expand_builtin): New. + (altivec_expand_builtin): New. + (altivec_init_builtins): New. + (TARGET_EXPAND_BUILTIN): New. + (TARGET_INIT_BUILTINS): New. + (rs6000_init_builtins): New. + (struct builtin_description): New. + (bdesc_2arg): New. + (rs6000_reg_names): Add altivec registers. + (alt_reg_names): Same. + (secondary_reload_class): Altivec regs can hold altivec regs and + memory. + (rs6000_emit_move): Force constants into memory for AltiVec moves. + (print_operand): Add 'y' case for printing altivec memory + operands. + (rs6000_legitimize_address): Legitimize vector addresses into + [REG+REG] or [REG]. + (altivec_expand_binop_builtin): New. + New string rs6000_current_abi. + (rs6000_override_options): Call rs6000_parse_abi_options. + (rs6000_parse_abi_options): New. + (function_arg_boundary): Vector arguments must be 16 + byte aligned. + (function_arg_advance): Handle vector arguments. + (function_arg_partial_nregs): Same. + (init_cumulative_args): Same. + (function_arg): Same. + + * config/rs6000/rs6000.md (altivec_lvx): New. + (type): Add altivec attribute. + (movv4si): New. + (*movv4si_internal): New. + (movv16qi): New. + (*movv16qi_internal): New. + (movv8hi): New. + (*movv8hi_internal1): New. + (movv4sf): New. + (*movv4sf_internal1): New. + (altivec_stvx): New. + (vaddubm): New. + (vadduhm): New. + (vadduwm): New. + (vaddfp): New. + (vaddcuw): New. + (vaddubs): New. + (vaddsbs): New. + (vadduhs): New. + (vaddshs): New. + (vadduws): New. + (vaddsws): New. + (vand): New. + (vandc): New. + (vavgub): New. + (vavgsb): New. + (vavguh): New. + (vavgsh): New. + (vavguw): New. + (vavgsw): New. + (vcmpbfp): New. + (vcmpequb): New. + (vcmpequh): New. + (vcmpequw): New. + (vcmpeqfp): New. + (vcmpgefp): New. + (vcmpgtub): New. + (vcmpgtsb): New. + (vcmpgtuh): New. + (vcmpgtsh): New. + (vcmpgtuw): New. + (vcmpgtsw): New. + (vcmpgtfp): New. + (vcmpgefp): New. + (vcmpgtub): New. + (vcmpgtsb): New. + (vcmpgtuh): New. + (vcmpgtsh): New. + (vcmpgtuw): New. + (vcmpgtsw): New. + (vcmpgtfp): New. + (vmaxub): New. + (vmaxsb): New. + (vmaxuh): New. + (vmaxsh): New. + (vmaxuw): New. + (vmaxsw): New. + (vmaxfp): New. + (vmrghb): New. + (vmrghh): New. + (vmrghw): New. + (vmrglb): New. + (vmrglh): New. + (vmrglw): New. + (vminub): New. + (vminsb): New. + (vminuh): New. + (vminsh): New. + (vminuw): New. + (vminsw): New. + (vminfp): New. + (vmuleub): New. + (vmulesb): New. + (vmuleuh): New. + (vmulesh): New. + (vmuloub): New. + (vmulosb): New. + (vmulouh): New. + (vmulosh): New. + (vnor): New. + (vor): New. + (vpkuhum): New. + (vpkuwum): New. + (vpkpx): New. + (vpkuhss): New. + (vpkshss): New. + (vpkuwss): New. + (vpkswss): New. + (vpkuhus): New. + (vpkshus): New. + (vpkuwus): New. + (vpkswus): New. + (vrlb): New. + (vrlh): New. + (vrlw): New. + (vslb): New. + (vslh): New. + (vslw): New. + (vsl): New. + (vslo): New. + (vsrb): New. + (vrsh): New. + (vrsw): New. + (vsrab): New. + (vsrah): New. + (vsraw): New. + (vsr): New. + (vsro): New. + (vsububm): New. + (vsubuhm): New. + (vsubuwm): New. + (vsubfp): New. + (vsubcuw): New. + (vsububs): New. + (vsubsbs): New. + (vsubuhs): New. + (vsubshs): New. + (vsubuws): New. + (vsubsws): New. + (vsum4ubs): New. + (vsum4sbs): New. + (vsum4shs): New. + (vsum2sws): New. + (vsumsws): New. + (vxor): New. + +2001-11-07 Daniel Berlin + + * Makefile.in (df.o): Add fibheap.h to dependencies. + + * df.h: Add prototypes for transfer functions, iterative_dataflow + functions. + (enum df_flow_dir): New enum. + (enum df_confluence_op): New enum. + (struct df): Add inverse_rts_map. + + * df.c: Add sbitmap.h to the list of includes. + (df_rd_global_compute): Removed. + (df_ru_global_compute): Removed. + (df_lr_global_compute): Removed. + (df_rd_transfer_function): New function. + (df_ru_transfer_function): New function. + (df_lr_transfer_function): New function. + (df_analyse_1): allocate/compute/free df->inverse_rts_map. + Use iterative_dataflow_bitmap instead of df_*_global_compute. + (iterative_dataflow_sbitmap): New function. + (iterative_dataflow_bitmap): New function. + +2001-11-07 Joseph S. Myers + + * doc/gcc.texi: Move terminology and spelling conventions to + htdocs/codingconventions.html. + +2001-11-07 Graham Stott + + * cse.c (cse_insn): Emit BARRIER after unconditional jump. + +Wed Nov 7 13:33:34 CET 2001 Jan Hubicka + + * expmed.c (expand_mult): Force operand to register before computing + cost. + * i386.c (x86_decompose_lea): New global vairable. + * i386.h (x86_decompose_lea): Declare. + (TARGET_DECOMPOSE_LEA): New macro. + (RTX_COST): Handle leas properly. + +2001-11-06 Richard Henderson + + * config/alpha/elf.h (DO_SELECT_SECTION): TREE_READONLY is not + defined for a CONSTRUCTOR; don't check it. + +2001-11-06 Danny Smith + + * gcov.c (output_data): Use IS_ABSOLUTE_PATHNAME to + test for absolute pathnames. + +2001-11-06 Olivier Hainque + + * unwind-dw2.c (execute_cfa_program): Evaluate call frame + instructions up to the target pc inclusive. + +2001-11-06 Steve Christiansen + + * loop.c (loop_regs_scan): Don't invalidate PIC register. + +2001-11-06 Eric Christopher + + * config/mips/mips.md(movdf_internal2): Add constraints for float + to general register move. + * config/mips/elf64.h: Add default ABI. + +2001-11-06 Neil Booth + + * alias.c:: Include langhooks.h. + * emit-rtl.c: Similarly. + * toplev.c: Similarly. + * tree-inline.c: Similarly. + * langhooks-def.h: New, the old langhooks.h. Give the default + hooks a common prefix. + * langhooks.h: Contents extracted from toplev.h. + * toplev.h: Move langhook stuff to langhooks.h. + * langhooks.c: Give default hooks a common prefix. + + * c-lang.c: Include langhooks-def.h. + * objc/objc-act.c: Similarly. + * Makefile.in: Update. + * objc/Make-lang.in: Update. + +2001-11-06 Joseph S. Myers + + * doc/install.texi: Document that configure options not listed in + this file are unsupported. Document --with-system-zlib. + +Tue Nov 6 09:21:34 2001 Richard Kenner + + * rtl.h (mem_for_const_double): New declaration. + * varasm.c (mem_for_const_double): New function. + * config/convex/convex.md (movdf): Use it. + * config/m68k/hp320.h (LEGITIMATE_PIC_OPERAND_P): Likewise. + * config/m68k/linux.h, config/m68k/m68k.h: Likewise. + * config/m68k/m68kv4.h: Likewise. + + * config/alpha/alpha.h (SECONDARY_MEMORY_NEEDED): Adjust for addition + of new GP reg classes. + + * expr.c (store_field): When making temp object for unaligned + component, set it to alias set 0. + +2001-11-06 Joseph S. Myers + + * c-common.c (c_expand_expr_stmt): Apply default conversions to + non-lvalue arrays if C99. + * c-typeck.c (default_conversion): Split out code handling + array-to-pointer and function-to-pointer conversions into a + separate default_function_array_conversion function. + (default_function_array_conversion): New function. Keep track of + whether any NON_LVALUE_EXPRs were stripped. Return non-lvalue + arrays unchanged outside C99 mode instead of giving an error for + them. + (build_component_ref): Use pedantic_non_lvalue when handling + COMPOUND_EXPR. Don't handle COND_EXPR specially. + (convert_arguments): Use default_function_array_conversion. + (build_unary_op): For ADDR_EXPR, take a flag indicating whether + non-lvalues are OK. + (unary_complex_lvalue): Likewise. + (internal_build_compound_expr): Use + default_function_array_conversion. Apply default conversions to + function in compound expression. + (build_c_cast, build_modify_expr, digest_init, build_asm_stmt): + Use default_function_array_conversion. + * doc/extend.texi: Update documentation of subscripting non-lvalue + arrays. + Fixes PR c/461. + +2001-11-05 Zack Weinberg + + * aclocal.m4: (AM_WITH_NLS): Don't look at ALL_LINGUAS. + (AM_GNU_GETTEXT): Set CATALOGS to a list of .gmo files + corresponding to the complete set of .po and .gmo files in + the source directory's po subdir, modified by LINGUAS. Don't + look at ALL_LINGUAS. + * configure.in: Don't set ALL_LINGUAS. + * configure: Regenerate. + + * Makefile.in (.po.gmo): Don't move into source directory. + (.po.pox): Clarify comments. + (install-po): Look for .gmo files in both srcdir and objdir; + don't fail if a file is totally missing. + (distclean): rmdir ada subdirectory too. + +2001-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_select_section): Handle + CONSTRUCTORs _correctly_. + +2001-11-05 Neil Booth + + * c-decl.c (delete_block): Remove. + * c-tree.h (delete_block): Remove. + +2001-11-05 Neil Booth + + * cppexp.c (lex, parse_defined): Update warning about defined. + +2001-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_select_section): Handle + CONSTRUCTORs too. + +2001-11-05 Nick Clifton + + * config/arm/arm.c (arm_return_in_memory): Cope with + int_size_in_bytes returning -1. + + * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Handle + DECL being NULL. + +Mon Nov 5 16:15:25 CET 2001 Jan Hubicka + + * Makefile.in (bb-reorder.o): Add dependency on cfglayout.h; + remove unneeded dependencies; + (cfglayout.o): New. + * cfglayout.c, cfglayout.h: New files; break out from ... + * bb-reorder.c: ... here; Remove unneeded includes; + +2001-11-04 Alan Modra + + * config/rs6000/rs6000.md (load_toc_aix_{si,di}): Mark r2 as used. + +2001-11-04 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_move): Handle 64-bit + mode as well. Do not explicitly create intermediate regs. + +2001-11-04 Kaveh R. Ghazi + + * arm/aof.h (aof_text_section, aof_data_section): Don't declare. + (common_section): Delete unused variable. + (ASM_OUTPUT_ASCII): Fix signed/unsigned warnings. + (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. + * arm-protos.h (arm_poke_function_name, aof_add_import, + aof_delete_import): Const-ify. + * arm.c (legitimize_pic_address): Wrap variables in the macro + controlling their usage. + (arm_finalize_pic): Mark variable with ATTRIBUTE_UNUSED. + (arm_poke_function_name, pic_chain, import, aof_add_import, + aof_delete_import): Const-ify. + * i386.c (ix86_osf_output_function_prologue): Const-ify. + * i386/sysv4.h (ASM_OUTPUT_FLOAT, ASM_OUTPUT_DOUBLE, + ASM_OUTPUT_LONG_DOUBLE): Fix format specifier warnings. + * i860/fx2800.h (DBX_OUTPUT_STANDARD_TYPES): Const-ify. + * i860/sysv3.h: Add missing comment closure. + * m68k/apollo68.h (ASM_RETURN_CASE_JUMP): Add missing semi-colon. + * m88k/dgux.h (SELECT_RTX_SECTION): Add missing argument in call + to symbolic_operand. + + * config.gcc (m680[02]0-*-*): Rename case from m68000-*-*. + (i960-*-*): Set tmake_file. + (sparc86x-*-elf*): Fix typo in header name. + + * sched-rgn.c (schedule_insns): Delete unused variable. + +2001-11-04 Neil Booth + + PR c/2820 + * c-typeck.c (lookup_field): Rework to return a chain down to + the looked-up field. + (build_component_ref): Use the new lookup_field to handle + nested anonymous entities correctly. + +Sun Nov 4 11:53:31 2001 Richard Kenner + + * config/sparc/sparc.c (sparc_emit_set_const32, GEN_HIGHINT64): + Change parameters to gen_rtx_CONST_DOUBLE. + (GEN_INT64, sparc_emit_set_const64): Likewise. + * config/sparc/sparc.md (movdf split): Likewise. + +2001-11-03 Geoffrey Keating + + * unroll.c (calculate_giv_inc): Use find_last_value rather + than just hoping the last instruction is the right SET. + [Fixes 990604-1.c on stormy16.] + + * config/stormy16/stormy16.h (LIB_SPEC): Don't supply any libgloss + library at all if -T is used. + + * config/stormy16/stormy16.c (stormy16_print_operand): Avoid + some uses of uninitialized variables in error cases. + + * config/stormy16/stormy16.c (stormy16_output_shift): Don't + look at 'temp' if we won't be using it. + + * config/stormy16/stormy16.h (CONST_COSTS): Define. + (RTX_COSTS): Define. + (ADDRESS_COST): Define. + (MEMORY_MOVE_COST): Allow for memory_move_secondary_cost. + + * config/stormy16/stormy16.h (ASM_SPEC): Pass -g to the assembler. + + * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Call + stormy16_asm_output_mi_thunk. + * config/stormy16/stormy16.c (stormy16_asm_output_mi_thunk): New + function. + * config/stormy16/stormy16-protos.h + (stormy16_asm_output_mi_thunk): New prototype. + +2001-11-04 Joseph S. Myers + + * ChangeLog.2, ChangeLog.4, ChangeLog.5, ChangeLog, + FSFChangeLog.10, FSFChangeLog.11, alias.c, attribs.c, + caller-save.c, calls.c, cfg.c, cfganal.c, cfgcleanup.c, cfgrtl.c, + cppmacro.c, fold-const.c, ifcvt.c, local-alloc.c, profile.c, + sched-int.h, toplev.c, config/alpha/alpha.c, + config/alpha/alpha.md, config/c4x/c4x.h, config/cris/cris.h, + config/cris/cris.md, config/i370/i370.md, config/i386/i386.c, + config/i386/i386.h, config/i386/i386.md, config/i386/xm-djgpp.h, + config/ia64/ia64.c, config/m68hc11/m68hc11.c, config/m68k/m68k.md, + config/mcore/mcore.h, config/mmix/mmix.c, config/ns32k/ns32k.h, + config/ns32k/ns32k.md, config/rs6000/rs6000.c, + config/rs6000/sysv4.h, config/sh/sh.md: Fix spelling errors. + +2001-11-03 Kaveh R. Ghazi + + * Makefile.in (dbxout.o): Depend on function.h. + * collect2.c (is_in_list): Hide unused function. + * dbxout.c: Include function.h. + (source_label_number, dbxout_source_line, dbxout_source_file, + dbxout_function_end, dbxout_begin_function): Wrap/move inside + macros controlling usage. + * gcc.c (TARGET_EXECUTABLE_SUFFIX): Undef before defining. + * output.h (exports_section): Prototype. + + * convex.c (convex_output_function_prologue): Fix format specifier + warning. + (asm_declare_function_name): Fix signed/unsigned warning. + (print_operand): Fix format specifier warning. + * convex.h (S_REGNO_P, A_REGNO_P): Fix signed/unsigned warning. + * dsp16xx-protos.h (uns_comparison_operator, + num_1600_core_shifts): Prototype. + * dsp16xx.c: Include tm_p.h, not dsp16xx-protos.h. + (frame_size, frame_pointer_offset): Delete. + (dsp16xx_output_function_prologue, dsp16xx_output_function_epilogue): + Make static. Fix format specifier warnings. + * dsp16xx.h (IS_ACCUM_REG): Fix unsigned>=0 warning. + (EXTRA_SECTION_FUNCTIONS): Prototype const_section. + * dsp16xx.md: Add default case in switches. + * fr30.h (IN_RANGE): Delete. + * ia64.h (ASM_OUTPUT_MI_THUNK): Fix format specifier warnings. + * mcore-protos.h (mcore_output_cmov): Const-ify. + * mcore.c (mcore_output_cmov): Likewise. + * mcore.h (switch_to_section): Make static and prototype. + * mn10200.h (REGNO_OK_FOR_INDEX_P, REG_OK_FOR_INDEX_P): Fix + unsigned>=0 warnings. + * mn10300.h (REGNO_IN_RANGE_P): Likewise. + * rs6000-protos.h (read_only_data_section, + read_only_private_data_section): Prototype. + * rs6000.h (ASM_OUTPUT_BYTE): Fix format specifier warning. + * sh.c (sh_adjust_cost): Mark parameter with ATTRIBUTE_UNUSED. + * sh.h (GENERAL_REGISTER_P): Fix unsigned>=0 warning. + +2001-11-03 Kaveh R. Ghazi + + * dwarf2asm.c (dw2_asm_output_pcrel): Mark parameters with + ATTRIBUTE_UNUSED. + * final.c (final_scan_insn): Add brackets around body of if-stmt. + * gcc.c (convert_filename): Add static prototype. Const-ify. + Wrap variable in macros controlling its use. + * output.h (sdata_section): Add prototype. + + * 1750a.h (EXTRA_SECTION_FUNCTIONS): Add prototype. + (ASM_OUTPUT_ASCII): Avoid signed/unsigned warning. + * c4x.h (INIT_SECTION_FUNCTION): Add prototype. + (ASM_FILE_START): Const-ify. + (ASM_OUTPUT_BYTE_FLOAT, ASM_OUTPUT_SHORT_FLOAT): Fix format + specifier warning. + * c4x.md: Don't use the 'U' integer suffix. + * clipper.md (clipper_movstr): Delete declaration. + * d30v-protos.h (d30v_move_2words): Const-ify. + (debug_stack_info): Add prototype. + * d30v.c: Include "integrate.h". + (d30v_function_arg_boundary, d30v_function_arg, + d30v_function_arg_partial_nregs, d30v_function_arg_advance): Avoid + signed/unsigned warnings. + (d30v_print_operand_memory_reference, d30v_move_2words): + Const-ify. + * d30v.h (REG_CLASS_FROM_LETTER): Use unsigned array subscript. + * fr30.c (fr30_pass_by_reference, fr30_pass_by_value): Prototype. + * fr30.md: Const-ify. + * h8300.h (EXTRA_SECTION_FUNCTIONS): Add prototype. + * i370.c (i370_label_scan, mvs_get_label): Make definition static. + (mvs_get_label_page): Hide unused static function. + * i860.c (current_function_original_name): Const-ify. + * i860/sysv3.h (current_function_original_name): Likewise. + * i860/sysv4.h (current_function_original_name): Likewise. + * i960.md: Add default case in switches. Remove unused variable. + * i960/vx960-coff.h (MULTILIB_DEFAULTS): Undef before defining. + * m32r.md: Const-ify. + * m68hc11-protos.h (m68hc11_asm_file_start): Const-ify. + * m68hc11.c: Include "reload.h". + (static_chain_reg, print_options, m68hc11_asm_file_start): + Const-ify. + * m68hc11.md: Delete unused variable. Const-ify. Add parens + around & in comparison. + * mcore.h (TARGET_ASM_NAMED_SECTION): Undef before defining. + * mn10200.c (shift_mode): Remove trailing comma. + * mn10300-protos.h (output_tst): Const-ify. + * mn10300.c (output_tst): Likewise. + * pa/long_double.h (ASM_OUTPUT_LONG_DOUBLE): Fix format specifier + warnings. + * pa-protos.h (output_ascii): Use regular char *, not unsigned. + * pa.c (output_ascii): Likewise. + * pa/som.h (EXTRA_SECTION_FUNCTIONS): Add prototype. + * pdp11.md (expand_unop): Delete declarations. + * pj-protos.h (pj_output_addsi3): Const-ify. + * pj.c (pj_output_push_int, pj_output_load, pj_output_inc, + pj_output_cnv_op, mode_to_char, pj_output_varidx, pj_print_cond, + unique_src_operand): Add prototypes. + (pj_output_store_into_lval): Make definition static. + (pj_function_incoming_arg): Don't use unary plus. + (pj_output_addsi3): Const-ify. + * romp.md (get_symref): Delete declarations. + * v850-c.c (mark_current_function_as_interrupt): Don't return + value from void function. + * v850.c: Include "integrate.h". + * v850.h (ASM_OUTPUT_LABELREF): Const-ify. + * vax-protos.h (const_section): Add prototype. + +2001-11-03 Aldy Hernandez + + * machmode.def: Add documentation for the seventh argument in + vector modes. + +2001-11-04 Hans-Peter Nilsson + + * doc/invoke.texi (MMIX Options) <-mno-knuthdiv>: Say remainder + consistently. + <-mno-toplevel-symbols>: Change @code{:} to @samp{:}. + <-melf>: Don't have markup for ELF acronym. + +2001-11-03 Hans-Peter Nilsson + + * config.gcc (mmix-*-*): New target. + * doc/invoke.texi: Document MMIX options. + * doc/contrib.texi: Add note about MMIX port to my entry. + * config/mmix/t-mmix: New file. + * config/mmix/mmix.h: New file. + * config/mmix/mmix-protos.h: New file. + * config/mmix/mmix.c: New file. + * config/mmix/mmix.md: New file. + * config/mmix/crti.asm: New file. + * config/mmix/crtn.asm: New file. + +2001-11-03 Kazu Hirata + + * config/sparc/linux-aout.h: Fix comment formatting. + * config/sparc/linux.h: Likewise. + * config/sparc/linux64.h: Likewise. + * config/sparc/lynx.h: Likewise. + * config/sparc/pbd.h: Likewise. + * config/sparc/sol2-sld-64.h: Likewise. + * config/sparc/sol2.h: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + * config/sparc/sunos4.h: Likewise. + * config/sparc/vxsim.h: Likewise. + * config/sparc/vxsparc.h: Likewise. + * config/sparc/vxsparc64.h: Likewise. + +Sat Nov 3 10:37:56 2001 Richard Kenner + + * cselib.c (cselib_subst_to_values, case CONST_DOUBLE): Remove + reference to CONST_DOUBLE_MEM in comment. + * emit-rtl.c (gen_rtx_CONST_DOUBLE): Remove one operand. + (gen_rtx, case CONST_DOUBLE): Call it with one less operand. + (init_emit_once): Don't clear CONST_DOUBLE_MEM. + * function.c (pop_function_context_from): Don't call + restore_varasm_status. + * function.h (restore_varasm_status): Delete declaration. + * gengenrtl.c (CONST_DOUBLE_FORMAT): Delete CONST_DOUBLE_MEM slot. + * rtl.c: Likewise. + * rtl.def (CONST_DOUBLE): Update comment. + * rtl.h (CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW): Update operand number. + (CONST_DOUBLE_CHAIN): Likewise. + (CONST_DOUBLE_MEM): Delete. + (gen_rtx_CONST_DOUBLE): Update parameters. + * varasm.c (struct varasm_status): x_pool_offset now HOST_WIDE_INT. + Remove reference to CONST_DOUBLE_MEM. + (const_alias_set): New variable. + (immed_double_const): Change call to gen_rtx_CONST_DOUBLE. + (immed_real_const_1): Adjust tests for 0, 1, and 2. + Don't set CONST_DOUBLE_MEM. + (clear_const_double_mem): Don't do anything with const_tiny_rtx. + (output_constant_def): Don't look at TREE_CST_RTL if INTEGER_CST. + Put constant in const_alias_set. + (struct pool_constant): ALIGN now unsigned. + OFFSET now HOST_WIDE_INT. + Delete LABEL. + (restore_varasm_status): Deleted. + (mark_pool_constant): Mark desc->rtl. + (force_const_mem): Rework to store rtl in hash table, + not CONST_DOUBLE_MEM. + Put constant in const_alias_set. + (find_pool_constant): Check desc->rtl. + (mark_constants, mark_constant): Don't special-case CONST_DOUBLE. + (init_varasm_once): Initialize const_alias_set. + + * expr.c (expand_expr, case ADDDR_EXPR): If at top level, don't call + force_const_mem. + + * reload.c (combine_reloads): Don't combine an output reload if there + are other reloads around for part of the output. + + * emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGINGP_P if T is a + constant expression. + (set_mem_decl): New function. + * expr.h (set_mem_decl): New declaration. + * final.c (get_decl_from_op): Don't use ORIGINAL_REGNO if not pseudo. + (output_asm_operand_names): Add tab. + * reload1.c (alter_reg): Set decl of MEM from REG_DECL. + + * builtins.c (get_memory_rtx): Properly set MEM alias set and + attributes. + +2001-11-03 Joseph S. Myers + + * doc/extend.texi, doc/gcc.texi, doc/install.texi, doc/tm.texi: + Use "invalid" instead of "illegal". Use @r in comments in + examples. + +2001-11-02 Neil Booth + + * c-decl.c (pushdecl): Move block inside if conditional to remove + possibility of a segfault. Lookup block-level extern + variables in enclosing scopes correctly. + + * testsuite/gcc.c-torture/compile/20001018-1.x: Remove XFAIL. + +2001-11-02 Aldy Hernandez + + * expmed.c (store_bit_field): Use simplify_gen_subreg to make + SUBREG so we avoid SUBREGing memory. + + * expmed.c (store_bit_field): Same. + +2001-11-02 DJ Delorie + + * config/rs6000/rs6000.c (rs6000_emit_move): Make sure that + using FP registers for DImode mem-mem moves is acceptable. + +2001-11-02 Aldy Hernandez + + * builtins.c (apply_args_size): Handle vector arguments. + (apply_result_size): Same. + + * machmode.def: Set WIDER mode field for all vector entries. + +2001-11-02 Graham Stott + + * recog.c (decode_asm_operands): Check that the SRC is ASM_OPERANDS. + +2001-11-01 Eric Christopher + + * config.gcc: Revert part of earlier patch. + * config/mips/linux.h: Ditto. + * df.c: Include tm_p.h to avoid warnings. + * config/mips/mips.h (ABI_GAS_ASM_SPEC): Add defaults. Adjust + #if/#endif. + * config/mips/mips.c: Define mips_abi regardless. + (mips_output_function_prologues): Add long casts for .frame + output. + (override_options): Allow use of ABI_32. + +2001-11-01 Kazu Hirata + + * config/m68hc11/m68hc11.c: Fix comment formatting. + * config/m68hc11/m68hc11.h: Likewise. + * config/m68hc11/m68hc11.md: Likewise. + +2001-11-01 Neil Booth + + * c-typeck.c (default_conversion): Retain the original expression + codes. + * gcc.dg/Wparentheses.c: New tests. + +2001-11-01 David S. Miller + + * doc/install.texi (Specific, sparc-sun-solaris2*): Bring + 64-bit SPARC description more in line with reality. + +2001-11-01 Joseph S. Myers + + * Makefile.in (GCOV_OBJS): Add version.o. + * gcov.c: Include "version.h" and . + (gcov_version_string): Remove. + (print_usage): Take a parameter to determine whether this is a + call from --help or an error message. Give fuller output that + follows the GNU Coding Standards for --help. + (print_version): New function. + (options): New. + (process_args): Use getopt_long. Support long options. Follow + GNU Coding Standards for --help and --version. + * doc/gcov.texi: Document long options. + Addresses part of PR other/704. + +2001-11-01 John David Anglin + + * pa.c (output_move_double): Fix typo in double load. + +2001-11-01 Kazu Hirata + + * config/h8300/h8300.c (h8300_encode_label): Compute a string + before passing it to ggc_alloc_string. + +2001-11-01 Kazu Hirata + + * config/m68k/3b1.h: Fix comment formatting. + * config/m68k/3b1g.h: Likewise. + * config/m68k/a-ux.h: Likewise. + * config/m68k/amix.h: Likewise. + * config/m68k/apollo68.h: Likewise. + * config/m68k/atari.h: Likewise. + * config/m68k/aux-exit.c: Likewise. + * config/m68k/ccur-GAS.h: Likewise. + * config/m68k/crds.h: Likewise. + * config/m68k/dpx2.h: Likewise. + * config/m68k/dpx2g.h: Likewise. + * config/m68k/hp310.h: Likewise. + * config/m68k/hp320.h: Likewise. + * config/m68k/isi.h: Likewise. + * config/m68k/linux.h: Likewise. + * config/m68k/lynx.h: Likewise. + * config/m68k/m68k-psos.h: Likewise. + * config/m68k/m68k.c: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m68k/m68k.md: Likewise. + * config/m68k/m68kelf.h: Likewise. + * config/m68k/m68kv4.h: Likewise. + * config/m68k/mot3300.h: Likewise. + * config/m68k/news.h: Likewise. + * config/m68k/next.h: Likewise. + * config/m68k/pbb.h: Likewise. + * config/m68k/plexus.h: Likewise. + * config/m68k/sgs.h: Likewise. + * config/m68k/sun3.h: Likewise. + * config/m68k/tower.h: Likewise. + * config/m68k/vxm68k.h: Likewise. + +2001-10-31 DJ Delorie + + * config/mips/mips.h (mips_cache_flush_func): Prototype. + (TARGET_OPTIONS): Support -mflush-func= and -mno-flush-func. + (INITIALIZE_TRAMPOLINE): Use mips_cache_flush_func if nonzero. + * config/mips/mips.c (mips_cache_flush_func): New. + * doc/invoke.texi: Document the new options. + +2001-10-31 Hans-Peter Nilsson + + * config.gcc (cris-*-linux*, tm_file): Rearrange order. + * config/cris/linux.h (LIB_SPEC, STARTFILE_SPEC): Don't redefine. + + * config/cris/cris.h (EH_RETURN_DATA_REGNO): Fix formatting. + + * config/cris/cris.c: Include output.h after tree.h but before + target.h. + +2001-10-31 Zack Weinberg + + * Makefile.in (INTL_TARGETS, POSUB): Delete all references. + (INTL_SUBDIRS): Just intl. + (.SUFFIXES): Add .gmo .po .pox. + (native): Also depend on build-@POSUB@. + (intl.all, intl.install): Depend on config.h and things it includes. + (po-generated): New target; depend on c-parse.c and tradcif.c. + (install-normal): Also depend on install-@POSUB@. + (XGETTEXT, GMSGFMT, MSGMERGE, PACKAGE, CATALOGS): New variables. + (build-, install-, build-po, update-po, install-po, + .po.gmo, .po.pox, $(PACKAGE).pot, po/$(PACKAGE).pot): New rules. + + * aclocal.m4: Prefix each entry in CATALOGS with "po/" + * configure.in: Don't munge XGETTEXT. Don't generate + po/Makefile.in. + * configure: Regenerate. + + * exgettext: Delete. + * config/m68k/m68k.h: Add doc strings for -msky and -mnosky. + * objc/Make-lang.in: Replace $(INTL_TARGETS) with po-generated. + +2001-10-31 Kazu Hirata + + * config/h8300/h8300.md (two anonymous patterns): New. + +2001-10-31 Aldy Hernandez + + * tree.h (tree_index): Add support for V16QI and V8HI. + (V8HI_type_node): New. + (V16QI_type_node): New. + + * tree.c (build_common_tree_nodes_2): Same. + + * c-common.c (type_for_mode): Same. + +2001-10-31 Kazu Hirata + + * config/i386/att.h: Fix comment formatting. + * config/i386/beos-elf.h: Likewise. + * config/i386/bsd.h: Likewise. + * config/i386/bsd386.h: Likewise. + * config/i386/crtdll.h: Likewise. + * config/i386/cygwin.asm: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/djgpp.h: Likewise. + * config/i386/freebsd-aout.h: Likewise. + * config/i386/freebsd.h: Likewise. + * config/i386/gas.h: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/i386/i386-protos.h: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/i386.md: Likewise. + * config/i386/i386elf.h: Likewise. + * config/i386/interix.c: Likewise. + * config/i386/isc.h: Likewise. + * config/i386/isccoff.h: Likewise. + * config/i386/iscdbx.h: Likewise. + * config/i386/linux.h: Likewise. + * config/i386/lynx.h: Likewise. + * config/i386/mingw32.h: Likewise. + * config/i386/netbsd-elf.h: Likewise. + * config/i386/next.h: Likewise. + * config/i386/osf1elf.h: Likewise. + * config/i386/osfrose.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/i386/seq-gas.h: Likewise. + * config/i386/seq-sysv3.h: Likewise. + * config/i386/sequent.h: Likewise. + * config/i386/sol2.h: Likewise. + * config/i386/sun386.h: Likewise. + * config/i386/uwin.asm: Likewise. + * config/i386/uwin.h: Likewise. + * config/i386/vxi386.h: Likewise. + * config/i386/win32.h: Likewise. + * config/i386/winnt.c: Likewise. + * config/i386/xm-cygwin.h: Likewise. + * config/i386/xm-mingw32.h: Likewise. + +2001-10-31 Kazu Hirata + + * builtins.def: Fix comment typos. + * config/alpha.c: Likewise. + * config/arm/arm.c: Likewise. + * config/avr/avr.h: Likewise. + * config/d30v/d30v.c: Likewise. + * config/d30v/d30v.h: Likewise. + * config/d30v/d30v.md: Likewise. + * config/dsp16xx/dsp16xx.c: Likewise. + * config/fr30/fr30.c: Likewise. + * config/fr30/fr30.md: Likewise. + * config/i386/i386.c: Likewise. + * config/i860/i860.c: Likewise. + * config/i960/i960.c: Likewise. + * config/ia64/ia64.c: Likewise. + * config/mips/mips.c: Likewise. + * config/pa/pa.c: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/s390/s390.c: Likewise. + * config/sparc/sparc.c: Likewise. + +2001-10-30 Kazu Hirata + + * config/mips/elf.h: Fix comment formatting. + * config/mips/elf64.h: Likewise. + * config/mips/iris5.h: Likewise. + * config/mips/iris5gas.h: Likewise. + * config/mips/iris6.h: Likewise. + * config/mips/isa3264.h: Likewise. + * config/mips/linux.h: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.h: Likewise. + * config/mips/mips.md: Likewise. + * config/mips/mips16.S: Likewise. + * config/mips/netbsd.h: Likewise. + * config/mips/osfrose.h: Likewise. + * config/mips/r3900.h: Likewise. + * config/mips/sni-svr4.h: Likewise. + * config/mips/svr4-t.h: Likewise. + * config/mips/ultrix.h: Likewise. + +2001-10-30 Daniel Berlin + + * bitmap.c (bitmap_element_free): Don't forget to update head->indx + when we update head->current. + +2001-10-30 Neil Booth + + * tree.c (id_string_size): Remove. + (dump_tree_statistics): Update. + * toplev.c (compile_file): If dumping stats, dump tree stats too. + +Tue Oct 30 19:00:43 CET 2001 Jan Hubicka + + * sched-rgn.c (schedule_insns): Fix comment. + +2001-10-30 Zack Weinberg + + * configure.in: Correct previous change: don't assume that + gas's version number _isn't_ the last thing on the line, or + isn't the only number on the line, either. + * configure: Regenerate. + +2001-10-30 Kazu Hirata + + * cfgcleanup.c: Fix a comment typo. + +2001-10-30 Kazu Hirata + + * alias.c: Fix comment formatting. + * recog.c: Likewise. + * config/cris/cris.c: Likewise. + * config/cris/cris.h: Likewise. + * config/i960/i960.c: Likewise. + * config/i960/i960.h: Likewise. + +2001-10-30 Kazu Hirata + + * config/arm/arm.c: Fix a comment typo. + * config/arm/arm.h: Likewise. + * config/ia64/ia64.c: Likewise. + +2001-10-30 Jakub Jelinek + + * emit-rtl.c (set_unique_reg_note): Don't create REG_EQUAL or + REG_EQUIV notes for ASM_OPERANDS. Return the new note (if any). + * rtl.h (set_unique_reg_note): Change return value. + * gcse.c (try_replace_reg): Use set_unique_reg_note. + * cse.c (cse_insn): Likewise. + * expr.c (emit_move_insn): Likewise. + * explow.c (force_reg): Likewise. + * local-alloc (update_equiv_regs): Likewise. + * loop.c (move_moveables, load_mems): Likewise. + * reload (find_reloads): Likewise. + +2001-10-30 Paolo Bonzini + + Localization fixes. + * c-decl.c (parmlist_tags_warning, start_struct, + check_for_loop_decls): Separate messages for struct, union and + enum cases to allow for languages in which they have different + genders. + * c-format.c (scanf_flag_specs): Separate short and long name of + the assignment suppression feature. + (check_format_types): Localize "pointer" and "different types" + strings. + * c-lex.c (lex_number): Localize "an unsigned long int" and + related strings. + (lex_string) [MULTIBYTE_CHARS]: Use initial lowercase letter on + warning message. + * c-typeck.c (build_unary_up): Separate messages for increment and + decrement cases to allow for languages in which they use different + articles. Localize the strings "increment" and "decrement" in one + case. + +Tue Oct 30 11:08:11 CET 2001 Jan Hubicka + + * lcm.c (optimize_mode_switching): Do not rebuild liveness information + when no changes has been made. + + * gcse.c (reg_set_bitmap): Turn into reg_set. + (modify_mem_list_set, canon_modify_mem_list_set) + (clear_modify_mem_tables, free_modify_mem_tables): New. + (gcse_main); Use free_modify_mem_tables. + (free_gcse_mem): Likewise; free the bitmaps. + (alloc_gcse_main): Initialize the bitmaps. + (canon_list_insert): Set canon_modify_mem_list_set. + (record_last_mem_set_info): Likewise; set modify_mem_list_set. + (compute_hash_table): Use clear_modify_mem_tables. + (reset_opr_set_tables): Likewise. + (oprs_not_set_p): reg_set_bitmap is regset. + (mark_set, mark_clobber): Likewise. + + * df.h (DF_EQUIV_NOTES): New constant. + (df_insn_refs_record): Record uses inside or REG_EQUIV/EQUAL notes + when asked for. + + * sched-rgn.c (CHECK_DEAD_NOTES): New constant. + (init_regions, schedule_insns): Conditionalize the checking + code by CHECK_DEAD_NOTES; avoid multiple calls to update_life_info. + +Tue Oct 30 11:02:31 CET 2001 Jan Hubicka + + * i386.md (movti_rex64 splitter): Fix condition. + +2001-10-29 Zack Weinberg + + * configure.in: Do not assume that gas's version number is the + last thing on the first line of as --version output. + * configure: Regenerate. + + * tradcpp.c: Include intl.h. Rename WARNING, ERROR, FATAL to + MT_WARNING, MT_ERROR, MT_FATAL. + (main): Call gcc_init_libintl. + (v_message): Call gettext on msgid and "warning: " + * tradcif.y: Include intl.h. + (yyerror): Make parameter definition consistent with + prototype. Call gettext on msgid argument. + +2001-10-29 Kaveh R. Ghazi + + * combine.c (num_sign_bit_copies): Avoid signed/unsigned + warnings. + + * sparc/sol2.h: Include when L_trampoline is defined. + +Mon Oct 29 19:22:07 2001 Richard Kenner + + * reload1.c (eliminate_regs): Test for reg_renumber being allocated + before referencing it. + +2001-10-26 DJ Delorie + + * config/rs6000/sysv4.h (LINK_SPEC): Allow -msdata=none to + override -G, and force -G0. + +2001-10-29 Joseph S. Myers + + * ChangeLog.2, ChangeLog.3, ChangeLog.4, FSFChangeLog.10, + FSFChangeLog.11, c-common.c, c-common.def, c-common.h, c-decl.c, + c-dump.c, c-typeck.c, except.c, sdbout.c, simplify-rtx.c, + timevar.h, tree.h, varasm.c: Fix spelling errors and typos. + + * loop.h (struct induction): Rename ext_dependant to + ext_dependent. + * loop.c: Change all uses. + (check_ext_dependant_givs): Rename to check_ext_dependent_givs. + All callers changed. + * timevar.c (DEFTIMEVAR): Fix spelling of identifier__ parameter. + +2001-10-29 Joseph S. Myers + + * c-parse.in (expr_no_commas, primary), c-typeck.c + (parser_build_binary_op): Use IS_EXPR_CODE_CLASS. + +2001-10-29 David Edelsohn + + Undo assemble_name change in earlier patch. + +Mon Oct 29 21:11:40 2001 Nicola Pero + + * objc/objc-act.c (finish_message_expr): For the GNU runtime: when + determining the type of the receiver, do not check that TREE_CODE + of receiver is CALL_EXPR before calling receiver_is_class_object(). + (receiver_is_class_object): For the GNU runtime: recognize + the case that the receiver is self in a class method context. + Check that TREE_CODE of receiver is CALL_EXPR when checking that + the receiver is a call to objc_get_class. + +2001-10-29 John David Anglin + + * pa.md (floatunssisf2): Set subreg 0 of operand 2 to zero. + +Mon Oct 29 07:23:33 2001 Richard Kenner + + * Makefile.in (OBJS): Put all files in alphabetical order. + + * dwarf2out.c (add_const_value_attribute): Fix error in last + change. + +Mon Oct 29 12:43:06 CET 2001 Jan Hubicka + + * basic-block.h (purge_all_dead_edges): Add update_life_p argument. + * cfgcleanup.c (merge_blocks): Update the life flag after merging; + fix warning. + * cfgrtl.c (purge_all_dead_edges): Allow updating of liveness. + (life_analysis): call purge_all_dead_edges after deleting noops. + (delete_noop_move): Do not purge CFG. + * toplev.c (rest_of_compilation): Update purge_all_dead_edges call. + +2001-10-28 David Edelsohn + + * config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use assemble_name. + * config/rs6000/darwin.h (RS6000_OUTPUT_BASENAME): Delete. + (ASM_GLOBALIZE_LABEL): Use assemble_name. + (ASM_OUTPUT_COMMON): Likewise. + * config/rs6000/rs6000.c (print_operand): Use assemble_name. + (rs6000_output_function_epilogue): Likewise. + (output_mi_thunk): Fix typo. + (rs6000_output_symbol_ref): Use assemble_name. + (output_toc): Likewise. + * config/rs6000/sysv4.h (RS6000_OUTPUT_BASENAME): Delete. + * config/rs6000/xcoff.h (RS6000_OUTPUT_BASENAME): Delete; + assemble_name calls STRIP_NAME_ENCODING. + (ASM_OUTPUT_LABEL): Use assemble_name. + (ASM_GLOBALIZE_LABEL): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (ASM_OUTPUT_ALIGNED_COMMON): Indent pseudo-op. Use assemble_name. + (ASM_OUTPUT_LOCAL): Likewise. + +Sun Oct 28 15:45:16 2001 Richard Kenner + + * builtins.c (get_memory_rtx): Handle POINTERS_EXTEND_UNSIGNED case. + (expand_builtin_apply, expand_builtin_return): Likewise. + (expand_builtin_va_arg, expand_builtin_va_copy): Likewise. + +2001-10-28 Joseph S. Myers + + * ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4, + ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11, + c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc, + configure, configure.in, except.c, except.h, flow.c, function.c, + gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def, + predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c, + sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c, + unroll.c: Fix spelling errors. + + * doc/extend.texi, doc/invoke.texi: Fix spelling. + + * doc/gcc.texi: Document use of "dependent" and American spelling. + +Sun Oct 28 17:05:36 CET 2001 Jan Hubicka + + * expr.c (emit_group_load): Support CONCATs by storing them to memory + and reloading. + +Sun Oct 28 09:59:54 2001 Richard Kenner + + * expr.c (store_constructor_field): Only call adjust_address on MEM. + +Sun Oct 28 16:48:09 CET 2001 Jan Hubicka + + * genrecog.c (write_switch): Output if before switch for + DT_elt_zero_wide_safe. + +2001-10-28 Kaveh R. Ghazi + + * Makefile.in (toplev.o, halfpic.o): Depend on halfpic.h + * i386/osfrose.h (SUBTARGET_SWITCHES): Add missing comma. + (FUNCTION_PROFILER): Const-ify. + * halfpic.c: Include "expr.h", "output.h" and "halfpic.h". + (eliminate_constant_term, assemble_name, output_addr_const): + Remove declarations. + (ptr_half_pic_address_p, half_pic_hash): Prototype. + (all_refs, half_pic_prefix, half_pic_hash, half_pic_declare, + half_pic_external, half_pic_address_p, half_pic_ptr): Const-ify. + * halfpic.h (ptr_half_pic_address_p, half_pic_finish): Prototype. + (half_pic_declare, half_pic_external): Const-ify. + * toplev.c: Include "halfpic.h". + +2001-10-28 Joseph S. Myers + + * config/alpha/alpha.md, config/arm/arm.c, config/arm/arm.h, + config/d30v/d30v.h, config/fr30/fr30.c, config/i370/x-oe, + config/i386/i386.c, config/i386/i386-interix.h, + config/i386/i386.md, config/i386/i386.h, config/i386/sco5.h, + config/i860/i860.h, config/i860/i860.md, config/m68k/aux-exit.c, + config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.md, + config/ns32k/ns32k.h, config/pa/pa.c, config/rs6000/rs6000.c, + config/sparc/sparc.c, config/m68hc11/m68hc11.c, + config/cris/cris.c, config/cris/cris.h, config/s390/s390.c, + config/s390/s390.h, config/stormy16/stormy16.h, doc/tm.texi: Fix + spelling errors. + + * ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4, + ChangeLog.5, ChangeLog, ChangeLog.lib, FSFChangeLog.10, ONEWS, + c-common.c, caller-save.c, cfg.c, cfgcleanup.c, cfgrtl.c, + collect2.c, df.h, diagnostic.h, final.c, gcse.c, gthr.h, + haifa-sched.c, jump.c, local-alloc.c, profile.c, protoize.c, + regmove.c, reload1.c, rtlanal.c, sched-vis.c, ssa.c, stmt.c, + system.h, toplev.c: Fix spelling errors. + +Sat Oct 27 17:32:04 2001 Richard Kenner + + * gcse.c (insert_insn_end_bb): Don't assume PAT is a SET. + + * dwarf2out.c (reg_number): Abort if pseudo. + (reg_loc_descriptor): Return 0 if pseudo. + (is_based_loc): Return 0 if pseudo. + (mem_loc_descriptor): Return 0 for pseudo and handle 0 return from + recursive calls. + (concat_loc_descriptor): Return 0 if either part's descriptor is 0. + (loc_descriptor): Return 0 if can't find location and handle 0 + return from recursive calls. + (loc_descriptor_from_tree): Likewise. + Fix handling of indirect. + Also return 0 for PLACEHOLDER_EXPR. + Clean up COMPONENT_REF cases. + (add_AT_location_descriptor): Simplify, but handle 0 return from + loc_descriptor. + (add_const_value_attribute): Avoid shift count warning. + (add_bound_info): Remove test for PLACEHOLDER_EXPR here. + Set comp_unit_die as context if not in function. + + * config/mips/mips-protos.h: Break up long lines. + Remove needless #ifdef/#endif blocks. + Don't declare functions declared in file made by genpreds or recog.h. + * config/mips/mips.c (mips_output_function_prologue): TSIZE + is now HOST_WIDE_INT; delete unneeded casts. + * config/mips/mips.h: Don't use #elif. + + * expr.c (stor_constructor_field): Always call adjust_address. + Copy TARGET before changing its alias set. + (store_field): Likewise, for TO_RTX. + (get_inner_reference): Stop at PLACEHOLDER_EXPR if can't find + replacement. + (safe_from_p, case ADDR_EXPR): Properly check for conflict. + (find_placeholder): Return 0 if can't find object. + (expand_expr, case PLACEHOLDER_EXPR): Abort if find_placeholder + returns 0. + +Sat Oct 27 16:31:23 CEST 2001 Jan Hubicka + + * ifcvt.c (if_convert): Call clear_aux_for_blocks. + +Sat Oct 27 12:12:09 CEST 2001 Jan Hubicka + + * cfgcleanup.c (merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successors_nojumps): Set BB_UPDATE_LIFE. + (merge_blocks): Properly udpate life after making edge nonfallthru. + * cfgrtl.c (merge_blocks_nomove): Update global_live_at_end. + +2001-10-26 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove redundant code. + +2001-10-26 Neil Booth + + * c-typeck.c (convert_arguments): When comparing for enumeral + type equality, use TYPE_MAIN_VARIANT. + * gcc.dg/Wconversion.c: New tests. + +2001-10-26 Kazu Hirata + + * s390/s390.c: Fix comment typos. + * s390/s390.h: Likewise. + * s390/s390.md: Likewise. + +2001-10-26 Alexandre Oliva + + * tree-inline.c (WALK_SUBTREE_TAIL): New macro. + (walk_tree): Use it for tail calls where appropriate. + +2001-10-26 Alexandre Oliva + + * cse.c (check_for_label_ref): Don't require REG_LABEL notes for + non-local label_refs. + +2001-10-26 Kazu Hirata + + * config/h8300/h8300.md (4 anonymous patterns): New. + +2001-10-26 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Clean up. Return the + algorithm through the shift_info structure. + (emit_a_shift): Update the use of get_shift_alg. + +2001-10-27 Daniel Berlin + + * sched-rgn.c: Remove bitset typedef. + Change bitset to sbitmap in prototypes / variable types. + Remove bbset_size. + Remove edgeset_bits. + Remove edgeset_size. + s/BITSET_ADD/SET_BIT/g + s/BITSET_INVERT/sbitmap_ones/g + s/BITSET_INTER/sbitmap_a_and_b/g + s/BITSET_UNION/sbitmap_a_or_b/g + s/BITSET_DIFFER/sbitmap_difference/g + s/bitset_member/TEST_BIT/g + (BITSET_*): Removed. + (bitset_member): Removed. + (extract_bitlst): Rewrite, now that we have sbitmaps, we can use + EXECUTE_IF_SET_IN_SBITMAP. + (split_edges): Rewrite, use sbitmap functions instead of bitset + operations. + (schedule_region): Allocate/free sbitmaps, rather than bitsets. + +2001-10-26 Andreas Schwab + + * reload1.c (emit_input_reload_insns): Fix parens in last + (undocumented) change that was supposed to change only whitespace. + +Fri Oct 26 07:18:08 2001 Richard Kenner + + * cfgcleanup.c (BB_SET_FLAG, BB_CLEAR_FLAG): Add cast to avoid warning. + + * local-alloc.c (update_equiv_regs): Don't make REG_EQUAL note for + ASM_OPERANDS. + +2001-10-26 Andreas Jaeger + + * flow.c (clear_log_links): Remove unused variable. + * cfgcleanup.c (cleanup_cfg): Likewise. + +2001-10-26 Alexandre Oliva + + * tree-inline.c (remap_decl): Don't copy size and size_unit here. + (remap_save_expr): Map a remapped SAVE_EXPR to error_mark_node. + +2001-10-26 Richard Henderson + + * config/alpha/alpha.h (enum reg_class): Add R24_REG, R25_REG; + rename PV_REG to R27_REG. + (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Update. + (REG_CLASS_FROM_LETTER): Update. + (PREFERRED_RELOAD_CLASS): Don't widen a reg class. + * config/alpha/alpha.md (divsi3): Don't hard-code r24, r25, r27. + (udivsi3, modsi3, umodsi3): Likewise. + (divdi3, udivdi3, moddi3, umoddi3): Likewise. + +2001-10-26 Richard Henderson + + * cfg.c (clear_aux_for_blocks): Split out of ... + (free_aux_for_blocks): here. + (clear_aux_for_edges): Split from ... + (free_aux_for_edges): here. + * basic-block.h: Declare them. + * lcm.c (compute_antinout_edge): Use them. + (compute_laterin, compute_available, compute_nearerout): Likewise. + (optimize_mode_switching): Likewise. + +2001-10-26 Richard Henderson + + * Makefile.in (unstage*): Remove as, ld, collect-ld before + moving everything back to the main build directory. + +2001-10-26 Christopher Faylor + + * config/i386/cygwin.h: Search target specific include directory, if + appropriate. + +2001-10-25 Kaveh R. Ghazi + + * dwarf2out.c (PTR_SIZE, default_eh_frame_section): Move outside + of macro guards. Fix #endif comment. + + * output.h (default_exception_section, default_eh_frame_section): + Move prototypes outside of macro guard. + + * crtstuff.c: Fix #endif comment. + +Thu Oct 25 12:21:58 2001 Jeffrey A Law (law@cygnus.com) + + * doc/md.texi (movMM): Clarify semantics of storing into a + non-paradoxical SUBREG. + +2001-10-25 Zack Weinberg + + * langhooks.c (lang_hook_default_clear_binding_stack): New. + (lang_hook_default_get_alias_set): Move next to other alias + hooks. + * langhooks.h: Prototype lang_hook_default_clear_binding_stack. + (LANG_HOOKS_CLEAR_BINDING_STACK): New macro. + (LANG_HOOKS_INITIALIZER): Add it. + * toplev.h (struct lang_hooks): Add clear_binding_stack. + * toplev.c (compile_file): Call lang_hooks.clear_binding_stack + instead of a loop calling poplevel. + +2001-10-25 Nick Clifton + + * config/mips/isa3264.h (SUBTARGET_CPP_SIZE_SPEC): Replace + occurrences of #elif with #if...#endif. + +2001-10-25 Kaveh R. Ghazi + + * cris.h (EH_RETURN_DATA_REGNO): Fix unsigned>=0 warning. + +Thu Oct 25 08:46:06 2001 Richard Kenner + + * alias.c (can_address_p): No longer static. + * emit-rtl.c (get_mem_attrs): New parameter, MODE; all callers changed. + Return 0 if all parameters are default values. + (set_mem_attributes): Set MEM_KEEP_ALIAS_SET_P. + (adjust_address_1): Try harder to compute a size. + * expr.c (expand_assignment, store_constructor): If can't address, + set MEM_KEEP_ALIAS_SET_P. + (store_constructor_field): Don't change set if MEM_KEEP_ALIAS_SET_P. + (store_field): Likewise. + (store_constructor): Simplify call to store_constructor_field. + * expr.h (can_address_p): New declaration. + * gensupport.c (gen_rtx_CONST_INT): New function. + * rtl.h (MEM_KEEP_ALIAS_SET_P): New macro. + (MEM_SIZE): Get size from mode, if not set and not BLKmode. + (MEM_COPY_ATTRIBUTES): Copy MEM_KEEP_ALIAS_SET_P. + + * stmt.c (expand_end_case): Remove orig_minval and use tree_low_cst. + +2001-10-24 Christopher Faylor + + * config/i386/cygwin.h: Use proper path for mingw crt files when + -mno-cygwin. + +Wed Oct 24 18:43:42 2001 Richard Kenner + + * dwarf2out.c (file_info_cmp): Always return consistent results. + +2001-10-24 Roger Sayle + + * stmt.c (expand_end_case): Index jumptables from zero for + suitably small values of minval. + +2001-10-24 Jakub Jelinek + + * stor-layout.c (place_union_field): If any field was aligned with + attribute aligned, set record type's TYPE_USER_ALIGN. + (place_field): Likewise. + (finalize_record_size): Don't clear TYPE_USER_ALIGN. + (layout_type) [ARRAY_TYPE]: Copy element's TYPE_USER_ALIGN. + +2001-10-24 Zack Weinberg + + * c-common.h (struct c_common_identifier): Remove rid_code field. + (C_RID_CODE): Use ->node.rid_code instead of ->rid_code. + + * c-typeck.c (constructor_designated): New local flag. + (struct constructor_stack): Add "designated" field to match. + (start_init): Clear it. + (really_start_incremental_init, push_init_level): Push and + clear it. + (pop_init_level): Pop it. + (set_designator): Set it. + + (pop_init_level): Suppress "missing initializer" warnings if + constructor_designated is true. + (process_init_element): Suppress warning about union + initialization under traditional C, if constructor_designated + is true. + +Wed Oct 24 15:35:38 2001 Richard Kenner + + * integrate.c (copy_rtx_and_substitute, case CALL): Fix error in last + change. + +Wed Oct 24 13:26:12 2001 Jeffrey A Law (law@cygnus.com) + + * h8300.h (RETURN_ADDR_RTX): Remove old, incorrect definition. + +2001-10-24 Dan Nicolaescu + + * ssa-ccp.c (ssa_ccp_substitute_constants): Don't do anything if + the node was already a set to a constant. + +Wed Oct 24 12:41:19 2001 Richard Kenner + + * emit-rtl.c (set_mem_attributes): Fix typo in last change. + * print-rtl.c (print_rtx, case MEM): Improve display of MEM_DECL. + +2001-10-24 Kaveh R. Ghazi + + * s390/linux.h (ASM_OUTPUT_BYTE): Fix format specifier warnings. + (ASM_OUTPUT_ASCII): Const-ify. Fix signed/unsigned warning. + (ASM_OUTPUT_MI_THUNK): Fix format specifier warnings. + * s390.c (s390_final_chunkify): Don't use string concatenation. + (s390_function_prologue, s390_function_epilogue): Const-ify. + * s390.h (FUNCTION_PROFILER): Remove unused variable. + +2001-10-24 Jakub Jelinek + + * c-decl.c (finish_decl): Don't add DECL_STMTs for nested function + prototypes. + +2001-10-23 Stan Shebs + + * config/rs6000/x-darwin: Use -no-cpp-precomp instead of + -traditional-cpp in first-stage compilation. + +Tue Oct 23 21:45:40 2001 Richard Kenner + + * gensupport.c (target_flags): Add. + +Tue Oct 23 13:05:53 2001 Richard Kenner + + * darwin-protos.h (constructor_section, destructor_section, + mod_init_section, mod_term_section): Prototype. + * darwin.c (machopic_finish, update_non_lazy_ptrs, update_stubs): + Const-ify. + * darwin.h (ASM_DECLARE_OBJECT_NAME, ASM_DECLARE_FUNCTION_NAME): + Likewise. + (SECTION_FUNCTION): Prototype `FUNCTION'. Delete + objc_section_init declaration. + (EXTRA_SECTION_FUNCTIONS): Prototype objc_section_init. + (objc_section_init, try_section_alias): Make static. + (alias_section): Make static and hide unused function. + (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. + +Tue Oct 23 13:05:53 2001 Richard Kenner + + * alias.c (can_address_p): Compnonents are not addressable if + the containing type has alias set 0. + (get_alias_set): Rework to use STRIP_NOPS. + Only call front-end routine on object, type, or object with + NOPs stripped, not inner values. + Use language hook to call front-end routine. + * builtins.c (get_memory_rtx): Always call set_mem_attributes. + (expand_builtin_apply): Call set_mem_align on MEMs we make. + Don't pass alignment to emit_block_move. + (expand_builtin_memcpy, expand_builtin_va_copy): Likewise. + (expand_builtin_memset): Likewise, but for clear_storage. + * c-common.c (lang_get_alias_set): Renamed to c_common_alias_set + and remove C++ specific parts. + * c-common.h (c_common_get_alias_set): Add declaration. + * c-lang.c (LANG_HOOKS_GET_ALIAS_SET): New macro. + * calls.c (emit_call_1): Fix typo in sibcall_pop case. + (save_fixed_argument_area): Call set_mem_align. + Remove alignment in call to emit_block_move. + (emit_library_call_value_1, store_one_arg): Likewise. + (target_for_arg): Remove; disabled long ago. + * emit-rtl.c (set_mem_attributes): Rework to only call get_mem_attrs + once and similar cleanups. + (offset_address): Use proper introductory comment. + * expr.c (emit_block_move): Use alignment from that of MEM args, not + from explicit operand; all callers changed. + (clear_storage): Likewise. + (expand_assignment): Don't call set_mem_alias_set on to_rtx. + (store_field): Remove kludge on alias set used for to_rtx. + (highest_pow2_factor, case *_DIV_EXPR): Never return 0. + (expand_expr_unaligned): Call set_mem_attributes instead of + set_mem_alias_set. + * expr.h (emit_block_move, clear_storage): Remove ALIGN argument. + * function.c (assign_stack_temp_for_type): Set MEM alignment. + (expand_function_end): Track MEM attributes of trampolines. + * ifcvt.c (noce_try_cmove_arith): Set alignment of new MEM. + * integrate.c (copy_rtx_and_substitute, case CALL): Copy memory + attributes from original. + * langhooks.c (lang_hook_default_get_alias_set): New function. + (hook_get_alias_set_0): New function. + * langhooks.h (hook_get_alias_set_0): New declaration. + (lang_hook_default_get_alias_set): Likewise. + (LANG_HOOKS_GET_ALIAS_SET): New macro; add to initializer. + * reload1.c (alter_reg): Use adjust_address_nv. + * rtl.c (get_mode_alignment): Moved to here. + * rtl.h (MEM_ALIGN): Take default from mode, if not BLKmode, and + change default if unknown from 1 to BITS_PER_UNIT. + * stor-layout.c (get_mode_alignment): Remove from here. + * toplev.h (struct lang_hoks): Add get_alias_set field. + * tree.h (lang_get_alias_set): Delete declaration. + * config/arc/arc.c (arc_setup_incoming_varags): Set MEM alignment. + * config/i386/i386.c (ix86_setup_incoming_varargs): Likewise. + (ix86_va_arg): Likewise. + * config/i960/i960.c (i960_setup_incoming_varargs): Likewise. + * config/pa/pa.c (hppa_builtin_saveregs): Likewise. + * config/sparc/sparc.c (sparc_va_arg): Likewise. + * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise. + (expand_block_move_mem): Remove dead code. + +2001-10-22 Neil Booth + + * c-common.c (warn_div_by_zero): New. + * c-common.h (warn_div_by_zero): New. + * c-decl.c (c_decode_option): Take it on the command line. + * c-typeck.c (build_binary_op): Warn about division by zero. + * doc/invoke.texi: Document the new command line option, fix + documentation of -Wmultichar. + * testsuite/gcc.dg/divbyzero.c: New tests. + * testsuite/gcc.dg/noncompile/20010524-1.c: Update. + +Tue Oct 23 15:30:23 CEST 2001 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Cleanup; use expand_simple_*op. + + * toplev.c (rest_of_compilation): Use CLEANUP_UPDATE_LIFE + to avoid update_life_info call. + * basic-block.h (CLEANUP_UPATE_LIFE): Define. + * cfgcleanup.c (bb_flags): New enum. + (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG, FORWARDER_BLOCK_P): New macros. + (notice_new_block, update_forwarder_flag): New functions. + (try_simplify_condjump): Use FORWARDER_BLOCK_P. + (try_forward_edges): Likewise; update flags. + (merge_blocks): Likewise. + (outgoing_edges_match): Likewise. + (try_crossjump_to_edge): Likewise. + (try_optimize_cfg): Likewise; initialize and clear the flags; + recompute life info if needed. + (cleanup_cfg): No need to clear aux pointers. + +2001-10-23 Alexandre Oliva + + * config/i386/i386.c (override_options): Default to minimum + stack alignment when optimizing for code size. + * doc/invoke.texi (-mpreferred-stack-boundary): Document the + change. + + * config/i386/i386.c (override_options): Set upper limit of + -mpreferred-stack-boundary to 12. + +2001-10-22 Zack Weinberg + + * recog.c (peephole2_optimize): Add default case to switch. + +2001-10-23 Joseph S. Myers + + * doc/gcc.texi (Sending Patches): Remove. + +2001-10-22 Hans-Peter Nilsson + + * unwind-dw2-fde.c (fde_unencoded_compare): Derefer pc_begin + fields when comparing. + +2001-10-22 Kaveh R. Ghazi + + * arm.h (HOST_INT, HOST_UINT): Delete. Remove all uses. + * arm.c (HOST_INT, HOST_UINT): Likewise. + +2001-10-22 Stan Shebs + + * config/darwin-protos.h (darwin_exception_section): Declare. + (darwin_eh_frame_section): Declare. + +Mon Oct 22 18:21:25 CEST 2001 Jan Hubicka + + * i386.md (movti_rex64): Fix mode. + +2001-10-22 Stan Shebs + + * target.h (struct gcc_target): Add asm_out.exception_section, + asm_out.eh_frame_section. + * target-def.h (TARGET_ASM_EXCEPTION_SECTION): New macro. + (TARGET_ASM_EH_FRAME_SECTION): New. + (TARGET_INITIALIZER): Update. + * output.h (default_exception_section): Declare. + (default_eh_frame_section): Declare. + * dwarf2out.c: Include target.h. + (output_call_frame_info): Call target hook for eh frames. + (default_eh_frame_section): New function. + * except.c: Include target.h. + (output_function_exception_table): Call target hook for exception + section. + * varasm.c (default_exception_section): Rename from + exception_section, remove EXCEPTION_SECTION macro. + + * config/darwin.h (darwin_eh_frame_section): New function. + (EXCEPTION_SECTION): Remove. + (TARGET_ASM_EXCEPTION_SECTION): Define. + * config/nextstep.h (EH_FRAME_SECTION_ASM_OP): Remove. + (nextstep_exception_section): New function. + (nextstep_eh_frame_section): New function. + (TARGET_ASM_EXCEPTION_SECTION): Define. + (TARGET_ASM_EH_FRAME_SECTION): Define. + + * config/pa/som.h (EXCEPTION_SECTION): Remove. + (TARGET_ASM_EXCEPTION_SECTION): Define. + * config/rs6000/sysv4.h, config/rs6000/xcoff.h + (EXCEPTION_SECTION): Remove. + (TARGET_ASM_EXCEPTION_SECTION): Define. + * config/stormy16/stormy16.h: Remove comments referencing + EXCEPTION_SECTION and EH_FRAME_SECTION_ASM_OP. + + * doc/tm.texi: Document TARGET_ASM_EXCEPTION_SECTION and + TARGET_ASM_EH_FRAME_SECTION. + +2001-10-22 Nick Clifton + + * config/mips/mips.md (mul_acc_si): Fix precedence of conditional + terms. + + * c-format.c: Fix spelling typo in comment. + + * sched-int.h: Fix typo in GCC preamble. + +2001-10-21 Craig Rodrigues + + PR debug/4252 + * doc/invoke.texi: Remove references to -fdump-translation-unit. + +2001-10-22 Richard Henderson + + * config/i386/i386.c (ix86_expand_clear): New. + * config/i386/i386-protos.h: Declare it. + * config/i386/i386.md (setcc peep2s): Use it. + (movsi_xor): Unexport. + +2001-10-22 Richard Henderson + + * flow.c (clear_log_links): Use free_INSN_LIST_list, not + free_EXPR_LIST_list for LOG_LINKS. + +2001-10-21 Robert Lipe + + * config/i386/i386.c (sco_asm_named_section): Delete. + (sco_asm_out_constructor): Delete. + * config/i386/sco5.h (ASM_QUAD): Undo damage from att.h. + (ASM_OUTPUT_DOUBLE_INT): Likewise. + (TARGET_ASM_CONSTRUCTOR): Delete. Use default. + (TARGET_ASM_NAMED_SECTION): Use default for ELF. + (EXCEPTION_SECTION): Delete EH scn renaming hack. + +2001-10-21 Kaveh R. Ghazi + + * c-format.c (maybe_read_dollar_number): Use safe-ctype macros + and/or fold extra calls into fewer ones. + * collect2.c (dump_file): Likewise. + * cppexp.c (parse_number): Likewise. + * cpplex.c (_cpp_lex_direct): Likewise. + * final.c (output_asm_insn, asm_fprintf): Likewise. + * fix-header.c (inf_scan_ident, main): Likewise. + * fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix): + Likewise. + * fold-const.c (real_hex_to_f): Likewise. + * gen-protos.c (parse_fn_proto): Likewise. + * genattrtab.c (check_attr_test, check_attr_value): Likewise. + * genrecog.c (change_state, write_action): Likewise. + * gensupport.c (shift_output_template): Likewise. + * local-alloc.c (requires_inout): Likewise. + * mips-tfile.c (IS_ASM_IDENT): Likewise. + * protoize.c (is_id_char, main): Likewise. + * real.c (asctoeg): Likewise. + * recog.c (asm_operand_ok): Likewise. + * reload.c (find_reloads): Likewise. + * scan.c (scan_identget_token): Likewise. + * sched-vis.c (print_value): Likewise. + * stringpool.c (ggc_alloc_string): Likewise. + * toplev.c (read_integral_parameter, decode_g_option): Likewise. + * tradcif.y (parse_number, yylex, parse_escape): Likewise. + * tradcpp.c (rescan): Likewise. + * tree.c (clean_symbol_name): Likewise. + * varasm.c (decode_reg_name): Likewise. + + * alpha.h (ASM_OUTPUT_ASCII): Likewise. + * darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise. + * dsp16xx.h (ASM_OUTPUT_ASCII): Likewise. + * m88k.c (output_ascii): Likewise. + * m88k.h (OVERRIDE_OPTIONS): Likewise. + * mcore.h (REG_CLASS_FROM_LETTER): Likewise. + * ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise. + * sh.h (REG_CLASS_FROM_LETTER): Likewise. + +2001-10-21 Neil Booth + + * langhooks.c (lang_hook_default_do_nothing, + lang_hook_default_decode_option): New defaults. + * langhooks.h: Make hooks unconditional and non-NULL. + * toplev.c (compile_file, toplev_main): Update. + * toplev.h: Update comments. + * objc/objc-act.c (lang_hooks): Update to new paradigm. + +2001-10-21 Kaveh R. Ghazi + + * arm.h (FUNCTION_ARG_REGNO_P): Use IN_RANGE. + + * system.h (IN_RANGE): New macro. + +2001-10-21 Zack Weinberg + + * aclocal.m4 (AM_WITH_NLS): Also create and substitute + INTLDEPS variable, which does not include $LIBICONV. + * Makefile.in: Use INTLDEPS in LIBDEPS. + * configure: Regenerate. + +2001-10-21 Neil Booth + + * cpphash.h (struct cpp_buffer): Delete read_ahead and extra_char. + * cpplex.c (lex_percent, lex_dot): Remove. + (get_effective_char, skip_block_comment, skip_line_comment, + parse_identifier_slow, parse_number, parse_string, save_comment, + _cpp_lex_direct): Update to do lookback freely. + (IF_NEXT_IS, BACKUP): New macros. + * cpplib.c (cpp_push_buffer): Don't set read_ahead and extra_char. + * cppmacro.c (paste_tokens): Update. + +2001-10-20 Nick Clifton + + * doc/invoke.texi (i386 and x86-64 Options): Fix typo. + +2001-10-20 Hans-Peter Nilsson + + * reload1.c (reload): Check CONSTANT_P before calling + LEGITIMATE_PIC_OPERAND_P. + * config/cris/cris.c (cris_legitimate_pic_operand): Revert + workaround of 2001-10-13. + +Sat Oct 20 15:16:10 CEST 2001 Jan Hubicka + + * i386.c (split_di): Handle splitting of DFmode. + +Sat Oct 20 07:27:14 2001 Richard Kenner + + * emit-rtl.c (set_mem_attributes): Alignment is in bits. + (adjust_address_1, offset_address): Likewise. + + * final.c (output_asm_operand_names): New fcn, from output_asm_insn. + (output_asm_insn): Call it for each line output. + Don't record an operand more than once. + + * toplev.h (struct lang_hooks): HONOR_READONLY now bool. + * main.c: Include config.h and system.h, but not ansidecl.h. + * Makefile.in (main.o): Update accordingly. + +Sat Oct 20 12:05:31 CEST 2001 Jan Hubicka + + * i386.h (SSE_REGPARM_MAX): Set to 8 for x86_64. + +Sat Oct 20 12:01:07 CEST 2001 Jan Hubicka + + * basic-block.h (find_sub_basic_blocks): Use sbitmap parameter. + * cfgbuild.c (find_bb_boundaries, compute_outgoing_frequencies): + Break out from ... + (find_sub_basic_blocks): ... here; + (find_many_sub_basic_blocks): New. + * recog.c (split_all_insns): Update find_sub_basic_blocks call. + + * i386.h (ASM_PREFERRED_EH_DATA_FORMAT): Define sdata4. + + * i386.c (ix86_va_arg): Kill indirect_p handling; fix aliasing issues.: + + * i386.c (split_di, split_ti): Revamp to use simplify_subreg. + + * timevar.def (TV_LIFE, TV_LIFE_UPDATE, TV_MODE_SWITCH): new. + * flow.c (update_life_info): Measure time. + * c-decl.c: Include timevar.h + (c_expand_body): Measure time. + * toplev.c (rest_of_compilation): Measure time of mode switching + separately. + * Makefile.in (c-decl.o, cfgcleanup.o): Add dependency. + + * toplev.c (flag_asynchronous_unwind_tables): New global variable. + (lang_independent_options): Add asynchronous-unwind-tables + (toplev_main): flag_asynchronous_unwind_tables implies + flag_unwind_tables. + * flags.h (flag_asynchronous_unwind_tables): Declare. + * dwarf2out.c (dwarf2out_stack_adjust): Take into account + flag_asynchronous_unwind_tables. + (output_call_frame_info): Likewise. + * invoke.texi (-fasynchronous-unwind-tables): Document. + * i386.c (optimization_options): Enable + flag_asynchronous_unwind_tables. + + * i386.c (ix86_expand_setcc): Always expect target to be QImode. + * i386.md (s* expanders): Destination is QImode. + + * toplev.c (rest_of_compilation): Do not call clear_log_links. + * rtl.h (clear_log_links): Kill. + * flow.c (clear_log_links): Make static; accept blocks parameter; + do no clear life info. + (update_life_info): Call clear_log_links. + + * cfganal.c (forwarder_block_p): Avoid active_insn_p calls. + +2001-10-20 Neil Booth + + * cpplex.c (handle_newline, skip_escaped_newlines, + get_effective_char, skip_block_comment, skip_line_comment, + parse_identifier_slow, parse_number, parse_string, + _cpp_lex_direct): Update to do more stepping back. + (trigraph_ok): Similarly. Rename trigraph_p. + (SAVE_STATE, RESTORE_STATE): Remove. + (BUFF_SIZE_UPPER_BOUND): Tweak. Add sanity check. + + * cpplib.c (destringize): Rename destringize_and_run, and + call run_directive directly. + (_cpp_do__Pragma): Simplify. + +2001-10-19 Kaveh R. Ghazi + + * pe.c (arm_pe_unique_section): Const-ify. + * pe.h (TARGET_ASM_NAMED_SECTION): Undef before defining. + (switch_to_section): Add static prototype. + + * output.h (drectve_section): Prototype. + +2001-10-19 Franz Sirl + + * config.gcc (i[34567]86-*-gnu*, arc-*-elf*, d30v-*, + fr30-*-elf, hppa*64*-*-linux*, parisc*64*-*-linux*, hppa*-*-linux*, + parisc*-*-linux*, i370-*-linux*, i[34567]86-*-chorusos*, + i[34567]86-*-elf*, i[34567]86-ncr-sysv4*, i[34567]86-*-netware, + i[34567]86-sequent-ptx4*, i[34567]86-sequent-sysv4*, + i[34567]86-*-beoself*, i[34567]86-*-beos*, i[34567]86-*-freebsd*, + i[34567]86-*-netbsdelf*, i[34567]86-*-linux*libc1, + i[34567]86-*-linux*, i[34567]86-moss-msdos*, i[34567]86-*-moss*, + i[34567]86-go32-rtems*, i[34567]86-*-rtems*, i[34567]86-*-rtemself*, + i[34567]86-*-solaris2*, i[34567]86-*-sysv5*, i[34567]86-*-sysv4*, + i[34567]86-*-udk*, i[34567]86-*-osf1*, i[34567]86-dg-dgux*, + i860-alliant-*, i860-*-sysv4*, ia64*-*-aix*, ia64*-*-linux*, + ia64*-*-hpux*, m32r-*-elf*, m88k-dg-dgux*, m88k-*-sysv4*, mcore-*-elf, + mips*-*-linux*, mn10200-*-*, mn10300-*-*, pj*-linux*, pjl-*, + powerpc64-*-linux*, powerpc-*-sysv*, powerpc-*-netbsd*, + powerpc-*-chorusos*, powerpc-*-eabiaix*, powerpc-*-eabisim*, + powerpc-*-elf*, powerpc-*-eabi*, powerpc-*-rtems*, + powerpc-*-linux*libc1, powerpc-*-linux*, powerpc-wrs-vxworks*, + powerpcle-wrs-vxworks*, powerpcle-*-sysv*, powerpcle-*-elf*, + powerpcle-*-eabisim*, powerpcle-*-eabi*, powerpcle-*-solaris2*, + rs6000-*-mach*, s390-*-linux*, s390x-*-linux*, sh-*-elf*, + sh-*-rtemself*, sh-*-rtems*, sh-*-linux*, stormy16-*-elf, + v850-*-rtems*, v850-*-*, x86_64-*-linux*), cris-*-aout, cris-*-elf, + cris-*-none, cris-*-linux*: Update ${tmfile} list. + (c4x-*-rtems*, c4x-*, i[34567]86-go32-rtems*, i[34567]86-*-rtemscoff*, + i[34567]86-*-rtems*, i[34567]86-*-rtemself*, i[34567]86-*-osf1*, + mn10200-*-*, mn10300-*-*, powerpc-*-beos*, powerpc-*-darwin*, + powerpc-wrs-vxworks*, powerpcle-wrs-vxworks*, v850-*-rtems*, + v850-*-*): Delete superflous ${cpu_type} setting. + * config/linux.h: Delete svr4.h include. + (SET_ASM_OP): Delete. + * config/netware.h (INT_ASM_OP): Undef before define. + * config/ptx4.h: Delete elfos.h include. + (PREFERRED_DEBUGGING_TYPE): Undef instead of wrapping. + * config/svr4.h: Delete elfos.h include. Update commentary. + * config/arc/arc.h, config/d30v/d30v.h, config/fr30/fr30.h, + config/m32r/m32r.h, config/m88k/sysv4.h, config/mn10200/mn10200.h, + config/mn10200/mn10300.h, config/stormy16/stormy16.h, + config/v850/v850.h: Delete svr4.h include. + * config/i370/linux.h, config/i386/osf1elf.h, config/m68k/linux.h, + config/m68k/m68kv4.h, config/m88k/sysv4.h, + config/sparc/sysv4.h: Update includes. + * config/i386/beos-elf.h, config/i386/netware.h, config/i386/ptx4-i.h, + config/i386/rtemself.h, config/i386/sol2.h, config/i386/sysv4.h, + config/i386/sysv5.h, config/i386/udk.h, config/ia64/linux.h, + config/m88k/dguxbcs.h: Delete includes. + * config/i386/dgux.h, config/i386/osf1elfgdb.h: Delete include. + (PREFERRED_DEBUGGING_TYPE): Undef before defining it. + * config/i860/fx2800.h (ASM_OUTPUT_SOURCE_LINE): Undef before defining + it. + * config/m88k/dgux.h: Delete include. + (SDB_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE): Undef before + defining it. + * config/pj/pj.h (ASM_GENERATE_INTERNAL_LABEL, + ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_SKIP): Undef before defining it. + * config/sh/elf.h: Update include. + (SDB_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE, + DWARF2_ASM_LINE_DEBUG_INFO): Move behind includes. + +2001-10-19 Catherine Moore + + * config/stormy16/stormy-abi: Updates to varargs descriptions. + * config/stormy16/stormy16.c (stormy16_build_va_list): Reverse + base and count fields. + (stormy16_expand_builtin_va_start): last_reg_count changed to + size_of_reg_args. Use count + size in first comparison. + +Fri Oct 19 15:24:39 2001 Richard Kenner + + * langhooks.h (LANG_HOOKS_HONOR_READONLY): New macro. + * toplev.h (struct lang_hooks): New field HONOR_READONLY. + * emit-rtl.c (set_mem_attributes): Set RTX_UNCHANGING_P from + TREE_READONLY and TYPE_READONLY if lang_hooks.honor_readonly. + Set alignment from type if INDIRECT_REF. + (adjust_address_1, offset_address): Simplify alignment compuitation. + * expr.c (expand_expr, case INDIRECT_REF): Don't set RTX_UNCHANGING_P + here; done by set_mem_attributes. + +2001-10-19 Kaveh R. Ghazi + + * Makefile.in (rtlanal.o): Depend on $(TM_P_H). + * arm-protos.h (rdata_section, zero_init_section, common_section): + Prototype. + * arm.h (ASM_OUTPUT_DEF_FROM_DECLS): Const-ify. + * avr.h (ASM_OUTPUT_SKIP): Rename macro parameter to avoid + traditional mode stringification. + * function.c (thread_prologue_and_epilogue_insns): Wrap variable + in macros controling its use. + * rtlanal.c: Include tm_p.h. + * varasm.c (asm_output_aligned_bss): Mark parameter with + ATTRIBUTE_UNUSED. + (assemble_constant_align, assemble_start_function, assemble_align, + assemble_variable, assemble_trampoline_template, + output_constant_def_contents): Wrap potentially empty if-stmt body + in brackets. + +2001-10-19 Kaveh R. Ghazi + + * a29k-protos.h (literal_section): Prototype. + * a29k.h (ASM_FILE_START): Don't discard pointer qualifier. + * a29k.md: Ensure function pointers are prototyped. + * genattrtab.c (write_eligible_delay): Mark parameter with + ATTRIBUTE_UNUSED. + +2001-10-19 Kaveh R. Ghazi + + * calls.c (emit_call_1): Mark parameter with ATTRIBUTE_UNUSED. + * 1750a.c (print_operand): Fix format specifier warning. + * 1750a.h (ASM_FILE_START): Don't discard pointer qualifier. + * 1750a.md: Likewise. + * gcc.c (init_gcc_specs): Wrap with ENABLE_SHARED_LIBGCC. + * genemit.c (output_add_clobbers): Mark parameter with + ATTRIBUTE_UNUSED. + * genrecog.c (write_subroutine): Likewise. + * integrate.c (expand_inline_function): Delete unused variable. + * varasm.c (remove_from_pending_weak_list): Wrap with + ASM_WEAKEN_LABEL. + +2001-10-19 Jakub Jelinek + + * simplify-rtx.c (simplify_plus_minus): Negate constant iff its neg + field is different to previous argument's neg field. + + * config/alpha/alpha.c (summarize_insn): Don't abort on ASM_INPUT. + +Fri Oct 19 15:24:39 2001 Richard Kenner + + * final.c (get_decl_from_op): New function. + (output_asm_insn): Call it; write "*" when item with decl is address. + +2001-10-19 Janis Johnson + + * doc/install.texi (Specific, sparc-sun-solaris2*) Copy documentation + about 64-bit support from the 3.0_branch version. + +2001-10-19 Zack Weinberg + + * aclocal.m4 (AM_WITH_NLS): AC_DEFINE HAVE_LIBINTL_H and + USE_INCLUDED_LIBINTL when appropriate. + * configure, config.in: Regenerate. + * Makefile.in (datadir): Set to @datadir@. + (intl.o): Also depend on $(CONFIG_H) and system.h. + + * intl.c: Factor out common gettext initialization sequence. + (gcc_init_libintl): New function. + * intl.h: Include intl/libgnuintl.h if USE_INCLUDED_LIBINTL; + otherwise include libintl.h if HAVE_LIBINTL_H; otherwise turn + off NLS. Add multiple include guard. No need to #ifdef-guard + an #undef. Prototype gcc_init_libintl here. + + * collect2.c (main), cppmain.c (general_init), gcc.c (main), + gcov.c (main), protoize.c (main), toplev.c (toplev_main): + Use gcc_init_libintl. + +2001-10-19 Catherine Moore + + * config/stormy16/stormy16.h (ASM_COMMENT_START): Define. + + * config/stormy16/stormy16.c (stormy16_split_move): Make + sure that REG_INC notes are present for auto_inc operands. + +2001-10-19 Andreas Jaeger + + * configure: Regenerated. + * configure.in: Add x86_64 to switch statements. + +2001-10-18 Richard Henderson + + * config/alpha/alpha.md (sibcall_osf_1): Load destination + address into $27 explicitly. + (sibcall_value_osf_1): Likewise. + +Thu Oct 18 16:07:39 2001 Richard Kenner + + * emit-rtl.c (gen_reg_rtx): Also reallocate reg_decl array. + (offset_address): New function. + (free_emit_status): Free regno_decl. + (init_emit): Pass proper number of elements to xcalloc. + Allocate regno_decl. + (mark_emit_status): Mark regno_decl values. + * expr.c (highest_pow2_factor): New function. + (expand_assigment): Use it and offset_address. + Properly handle ptr_mode vs. Pmode in offset calculation. + (store_constructor, expand_expr_unaligned): Likewise. + (expand_expr, case COMPONENT_EXPR): Likewise. + * expr.h (offset_address): New decl. + * function.h (struct emit_status): Add regno_decl. + (REGNO_DECL): New macro. + * final.c (output_asm_name): Move in file and don't conditionalize + on flag_print_asm_name. + (output_asm_insn): Only call output_asm_name if flag_print_asm_name. + Output names of operands, if known. + * function.c (assign_parms): Set REGNO_DECL. + * integrate.c (integrate_decl_tree): Likewise. + * stmt.c (expand_decl): Likewise. + * regclass.c (reg_scan_mark_refs): Propagate REGNO_DECL for copies. + +2001-10-18 Alexandre Oliva + + * attribs.c (handle_noinline_attribute): New function. + (handle_used_attribute): Likewise. + (c_common_attribute_table): Added noinline and used. + * doc/extend.texi (Function Attributes): Document them. + * c-decl.c (duplicate_decls): Propagate DECL_UNINLINABLE. + Warn when merging inline with attribute noinline. + (start_decl, start_function): Warn if inline and attribute + noinline appear in the same declaration. + +2001-10-17 Neil Booth + + * config.gcc: Update c4x and i370 for C front end-specific + dependencies. + * config/c4x/c4x-c.c: New. + * config/c4x/c4x-protos.h (c4x_handle_pragma): Remove. + (code_tree, data_tree, pure_tree, noreturn_tree, interrupt_tree): + New declarations. + * config/c4x/c4x.c: Don't include c-lex.h or c-pragma.h. + (code_tree, data_tree, pure_tree, noreturn_tree, interrupt_tree): + Make extern. + (c4x_init_pragma): Remove. + (c4x_parse_pragma, c4x_pr_CODE_SECTION, c4x_pr_DATA_SECTION, + c4x_pr_FUNC_IS_PURE, c4x_pr_FUNC_NEVER_RETURNS, c4x_pr_INTERRUPT, + c4x_pr_ignored): Move to c4x-c.c. + * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Update. + * config/c4x/t-c4x: Update. + * config/i370/i370-c.c: New. + * config/i370/i370.c: Don't include c-lex.h or c-pragma.h. + (i370_pr_map): Move to i370-c.c. + * config/i370/t-i370: New. + + * doc/tm.texi: Update. + +2001-10-17 Stan Shebs + + * config/rs6000/rs6000.c: Make assorted mechanical formatting and + typo fixes throughout. + (machopic_output_stub): Remove some dead code. + +2001-10-17 Richard Earnshaw + + * cpplex.c (_cpp_get_buff): Fix off-by-one error that caused memory + leak. + +Wed Oct 17 05:26:39 2001 Richard Kenner + + * Makefile.in (print-rtl.o): Depend on TREE_H. + * alias.c (get_alias_set): Make two passes over objects to first + see if inner object is access via restricted pointer. + Defer allocating alias set for restricted pointer until here. + Call find_placeholder with second arg nonzero. + Minor cleanups. + * c-common.c (c_apply_type_quals_to_decl): Defer getting alias + set for restricted pointer types. + * emit-rtl.c (set_mem_attributes): Set more attributes. + (set_mem_align, change_address, adjust_address_1): New functions. + (change_address_1): Now static. + (adjust_address, adjust_address_nv): Deleted. + (replace_equiv_address): Call change_address_1. + * expr.c (get_inner_reference): Handle PLACEHOLDER_EXPR. + (find_placeholder): Get starting point from PLIST arg. + (expand_expr, case PLACEHOLDER_EXPR): Initialize find_placeholder arg. + * expr.h (set_mem_align, change_address, adjust_address_1): New decls. + (adjust_address, adjust_address_nv): New macros. + * print-rtl.c (tree.h): New include. + (print_rtx, case MEM): Print all memory attributes. + +2001-10-17 Richard Henderson + + * config/alpha/alpha.c (direct_call_operand): Don't fall off end. + +2001-10-16 Matt Kraai + + * c-tree.texi: Eliminate duplicated word. + * cpp.texi: Likewise. + * install.texi: Likewise. + * invoke.texi: Likewise. + * tm.texi: Likewise. + +2001-10-17 Michael Collison + + * dsp16xx.c: Fix comment formatting to match GNU standards. + (dsp16xx_output_function_prologue): Change type of 'size' + parameter from 'int' to HOST_WIDE_INT. + (dsp16xx_output_function_epilogue): Change type of 'size' + parameter from 'int' to HOST_WIDE_INT. + +2001-10-16 Richard Henderson + + * configure.in (HAVE_AS_GOTOFF_IN_DATA): New x86 check. + * configure, config.in: Rebuild. + + * config/i386/i386.c (ix86_output_addr_vec_elt): New. + (ix86_output_addr_diff_elt): New. + * config/i386/i386.h (ASM_OUTPUT_ADDR_VEC_ELT): Use them. + (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + (JUMP_TABLES_IN_TEXT_SECTION): New. + * config/i386/i386.md (tablejump): Handle HAVE_AS_GOTOFF_IN_DATA. + * config/i386/i386-protos.h: Update. + + * config/i386/386bsd.h, config/i386/beos-elf.h, + config/i386/freebsd-aout.h, config/i386/freebsd.h, + config/i386/i386-interix.h, config/i386/i386elf.h, + config/i386/linux.h, config/i386/netbsd-elf.h, + config/i386/netbsd.h, config/i386/openbsd.h, + config/i386/ptx4-i.h, config/i386/rtemself.h, + config/i386/sco5.h, config/i386/sysv4.h, config/i386/x86-64.h + (ASM_OUTPUT_ADDR_DIFF_ELT, JUMP_TABLES_IN_TEXT_SECTION): Remove. + +2001-10-16 Florian Weimer + + * stmt.c (expand_asm_operands): Update commentary. + +2001-10-16 Stan Shebs + + * config/darwin.h (GCC_NAME): Remove, no longer used. + (NO_MATH_LIBRARY): Ditto. + (MATH_LIBRARY): Define to emptiness. + (DWARF2_DEBUGGING_INFO): Define. + (PREFERRED_DEBUGGING_TYPE): Define. + (EXTRA_SECTION_FUNCTIONS): Add darwin_exception_section. + (EXCEPTION_SECTION): Define. + (ASM_PREFERRED_EH_DATA_FORMAT): Define. + * config/darwin.c (darwin_encode_section_info): Handle case of + DECL_INITIAL being error_mark_node. + +2001-10-16 Richard Henderson + + * alpha.c (current_file_function_operand): Don't fail for profiling. + (direct_call_operand): New. + * alpha-protos.h: Declare it. + * alpha.h (EXTRA_CONSTRAINT): Use it. + (PREDICATE_CODES): Add it. + (ASM_OUTPUT_MI_THUNK): Remove. + * alpha32.h (ASM_OUTPUT_MI_THUNK): Remove. + * alpha.md (sibcall_osf_1, sibcall_value_osf_1): Add 's' alternative. + +2001-10-16 Krister Walfridsson + + * config/i386/netbsd-elf.h (ASM_OUTPUT_ADDR_DIFF_ELT): Define. + (JUMP_TABLES_IN_TEXT_SECTION): Define. + +Wed Oct 17 00:21:31 CEST 2001 Jan Hubicka + + * cfg.c (free_edge): Break out from .... + (remove_edge): ... here. + (clear_edges): Use free_edge. + + * att.h (ASM_QUAD): Add comment. + * bsd.h, sco5.h, sun386.h (ASM_QUAD): Define. + +Wed Oct 17 00:01:02 CEST 2001 Jan Hubicka + + * i386.c (split_ti): New function. + (ix86_split_to_parts): Support TImodes. + * i386.h (VALID_INT_MODE_P): Add TImode. + * i386.md (movdi splitter): Fix. + (movti): Support 64bit integer registers. + (movti_rex64): New function and splitter. + + * i386.c (*_cost): Add movsx/movzx cost. + * i386.h (struct processor_costs): Add movsx/movzx fields. + (RTX_COSTS): Handle zero/sign extend + avoid believing that + 64bit operations require split on 64bit machine. + (CONST_COST): Make large 64bit constants expensive on 64bit compilation. + + * i386.c (ix86_setup_incoming_varargs): Fix mode of PLUS. + (ix86_expand_move): Avoid pushes of memory if size does not match; + move long constants to register. + (x86_initialize_trampoline): Fix mode. + * i386.h (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): + Use ASM_QUAD on 64bit. + * i386.md (test pattern): Disallow impossible constants. + (tablejump PIC expander): Fix emitting of sum. + (movdicc_rex64): Rename to movdicc. + * linux64.h (LINK_SPEC): Add missing '%'. + +2001-10-16 Alexandre Oliva + + * tree-inline.c (inlinable_function_p): Leave it up to the + front-end to turn -finline-functions into DECL_INLINE set for all + functions. + +2001-10-16 Stan Shebs + + * config/rs6000/darwin.h (ASM_COMMENT_START): Define. + +2001-10-16 Alan Modra + + * recog.c: Formatting and comment typo fixes. + + * configure.in (gcc_cv_as_bfd_srcdir): New. Use it to find gas + version in single tree build. + * configure: Regenerate. + +2001-10-15 David Edelsohn + + * config/rs6000/rs6000.md (cr_logical): Swap order of CODE and + MODE arguments to gen_rtx and compare operand with const0_rtx. + +2001-10-15 Neil Booth + + * system.h: Poison old unused target macros. + * config/dsp16xx.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. + * config/stormy16/stormy16.c: Update references to obsolete macros. + * config/stormy16/stormy16.h: Similarly. + * config/stormy16/stormy16.md: Similarly. + * config/cris/cris.h: Similarly. + +2001-10-15 Neil Booth + + * cpplib.c (struct pragma_entry): Store the name as a hashnode. + (lookup_pragma_entry, insert_pragma_entry, do_pragma, + cpp_register_pragma): Update accordingly. + +2001-10-14 Neil Booth + + * c-pragma.h (cpp_register_pragma_space): Remove. + * cpplib.h (cpp_register_pragma_space): Remove. + * cpplib.c (lookup_pragma_entry, insert_pragma_entry): New. + (cpp_register_pragma_space): Remove. + (cpp_register_pragma): Simplify using lookup_pragma_entry, + add sanity checks. + (do_pragma): Similarly. + (_cpp_init_internal_pragmas): Don't register namespaces. + + * config/v850/v850.h (REGISTER_TARGET_PRAGMAS): + Don't register namespaces. + * cp/lex.c (init_cp_pragma): Similarly. + * doc/tm.texi: Update. + +2001-10-10 Craig Rodrigues + + PR c/4157 + * config/i386/cygwin.h: Add missing space to MINGW_INCLUDES + +2001-10-13 Michael Collison + + * config/dsp16xx/dsp16xx.md: Rewrite for more efficient code and + add scheduling support. + * config/dsp16xx/dsp16xx.h: Rewrite for more efficient code. + * config/dsp16xx/dsp16xx.c: Rewrite for more efficient code. + * config/dsp16xx/dsp16xx-protos.h: Add new function prototypes. + + +2001-10-13 Hans-Peter Nilsson + + * config/cris/cris.c (cris_legitimate_pic_operand): Kludge around + missing CONSTANT_P test in core GCC. + +2001-10-12 Neil Booth + + * cppmain.c (struct printer): New member source. + (scan_translation_unit): Fix spacing at start of lines. + (cb_line_change): Update. + + * gcc.dg/cpp/spacing2.c: New test. + +2001-10-12 Hans-Peter Nilsson + + * config/cris/arit.c: Use __builtin_labs, not abs. + + * config/cris/cris.h (SET_STRIPPABLE_EXECUTABLE): Don't define. + + * config/cris/cris.c (cris_target_asm_function_epilogue): Move + misplaced sprintf and fprintf argument. + +2001-10-12 Zack Weinberg + + * ABOUT-NLS, aclocal.m4: Update i18n framework from gettext 0.10.40. + * configure.in, Makefile.in: Take out obsolete check-po logic. + * configure, config.in: Regenerate. + +2001-10-12 Ziemowit Laski + + * objc/objc-act.c (finish_objc): Correct precondition for emitting + symtab declarations. + +2001-10-12 Stan Shebs + + * config/rs6000/rs6000.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + +2001-10-12 Christopher Faylor + + * config/i386/cygwin.h: Revert erroneous checkin of crtbegin and + ENDFILE_SPEC definition. + +2001-10-12 Kazu Hirata + + * gthr-dce.h: Fix comment formatting. + * gthr-posix.h: Likewise. + * gthr-single.h: Likewise. + * gthr-solaris.h: Likewise. + * gthr-vxworks.h: Likewise. + * gthr-win32.h: Likewise. + +2001-10-12 Jakub Jelinek + + * final.c (output_asm_insn): Make sure assembly dialects are + terminated, not nested. Output `|' and `}' characters if they + don't appear inside assembly dialect selection. + * config/i386/i386.md (rep_movdi_rex64, rep_movsi, rep_movsi_rex64, + rep_movqi, rep_movqi_rex64, rep_stosdi_rex64, rep_stossi, + rep_stossi_rex64, rep_stosqi, rep_stosqi_rex64, strsetsi_1, + strsetsi_rex_1): Add {} braces. + +2001-10-11 Zack Weinberg + + * toplev.c (compile_file): Ignore return value from yyparse. + Always pop any nested binding levels after yyparse returns. + +2001-10-11 Richard Henderson + + * doc/c-tree.texi (Expression trees): Add VTABLE_REF. + +2001-10-11 Richard Henderson + + * dwarf2out.c (add_const_value_attribute): If long < HOST_WIDE_INT, + fall back to add_AT_long_long for large CONST_INT. + +2001-10-11 Richard Henderson + + * config/i386/i386.md (setcc splitters): Add four splitters to + simplify compound compares that simplify_comparison can't handle. + +2001-10-11 Zack Weinberg + + * cpplex.c (digraph_spellings, token_spellings): Make static. + +2001-10-11 Franz Sirl + + * unroll.c (loop_iterations): Fixup last patch. + +2001-10-11 Richard Henderson + + * rtl.h (REG_VTABLE_REF): New. + * rtl.c (reg_note_name): Add it. + * combine.c (distribute_notes): Handle it. + * final.c (final_scan_insn): Handle it. + * tree.def (VTABLE_REF): New. + * expr.c (expand_expr): Handle it. + * varasm.c (assemble_vtable_entry, assemble_vtable_inherit): New. + * output.h: Declare them. + +2001-10-11 Richard Henderson + + * dwarf2out.c (rtl_for_decl_location): If no DECL_RTL, look + for a DECL_INITIAL. + +2001-10-11 David Edelsohn + + * config/rs6000/xcoff.h (UNALIGNED_DOUBLE_INT_ASM_OP): Only + available in 64-bit mode. + +2001-10-11 Hans-Peter Nilsson + + * config.gcc: Add cris-*-aout, cris-*-elf, cris-*-none, + cris-*-linux* cases. + * config/cris/cris-protos.h: New file. + * config/cris/cris.c: New file. + * config/cris/cris.h: New file. + * config/cris/cris.md: New file. + * config/cris/linux.h: New file. + * config/cris/aout.h: New file. + * config/cris/arit.c: New file. + * config/cris/cris_abi_symbol.c: New file. + * config/cris/mulsi3.asm: New file. + * config/cris/t-aout: New file. + * config/cris/t-cris: New file. + * config/cris/t-elfmulti: New file. + * config/cris/t-linux: New file. + * doc/invoke.texi: Add CRIS options. + * doc/install.texi (Specific): Add blurb for CRIS. + +2001-10-10 Hartmut Schirmer + + * config/float-i128.h: Make sure __STDC__VERSION__ is defined + before using it. + * config/float/i32.h: Likewise. + * config/float-i386.h: Likewise. + * config/float-i64.h: Likewise. + * config/float-m68k.h: Likewise. + * config/float-sh.h: Likewise. + * config/float-sparc.h: Likewise. + +2001-10-11 Hans-Peter Nilsson + + * doc/contrib.texi: Add note about CRIS port to my entry. + +2001-10-11 Kazu Hirata + + * basic-block.h: Fix formatting. + * bitmap.h: Likewise. + * cpplib.h: Likewise. + * c-tree.h: Likewise. + * diagnostic.h: Likewise. + * flags.h: Likewise. + * ggc.h: Likewise. + * longlong.h: Likewise. + * real.h: Likewise. + * reload.h: Likewise. + * rtl.h: Likewise. + * tree.h: Likewise. + +2001-10-10 Richard Henderson + + * c-parse.in (asm_operand): Allow named operands. + * genconfig.c (max_recog_operands): Set to 29. + * local-alloc.c (requires_inout): Skip multiple digits. + * recog.c (asm_operand_ok): Likewise. + (preprocess_constraints): Use strtoul for matching constraints. + (constrain_operands): Likewise. + * regmove.c (find_matches): Likewise. + * reload.c (find_reloads): Likewise. + * stmt.c (parse_output_constraint): Don't reject in-out + constraint on operands > 9. Reject '[' in constraint. + (expand_asm_operands): Handle named operands. Use strtoul + for matching constraints. + (check_operand_nalternatives): Split out from expand_asm_operands. + (check_unique_operand_names): New. + (resolve_operand_names, resolve_operand_name_1): New. + + * doc/extend.texi (Extended Asm): Document named operands. + * doc/md.texi (Simple Constraints): Document matching constraints + on operands > 9. + +2001-10-10 Richard Henderson + + * combine.c (try_combine): Handle a SEQUENCE of one insn. + + * i386.c (test splitter): Narrow tests vs paradoxical subregs. + (jcc splitters): Add two splitters to simplify compound compares + that simplify_comparison can't handle. + +2001-10-10 Richard Henderson + + * langhooks.c: Include langhooks.h. + * Makefile.in (langhooks.o): Depend on it. + +Wed Oct 10 23:49:06 EDT 2001 John Wehle (john@feith.com) + + * rtlanal.c (noop_move_p): Insns with a REG_RETVAL note + should not be considered as a no-op. + * flow.c (delete_noop_moves): Handle REG_LIBCALL notes. + +2001-10-10 Stan Shebs + + * alias.c: Remove uses of "register" specifier in declarations + of arguments and local variables. + * c-common.c: Ditto. + * c-convert.c: Ditto. + * c-decl.c: Ditto. + * c-format.c: Ditto. + * c-semantics.c: Ditto. + * c-typeck.c: Ditto. + * caller-save.c: Ditto. + * calls.c: Ditto. + * cfg.c: Ditto. + * cfgbuild.c: Ditto. + * cfgrtl.c: Ditto. + * collect2.c: Ditto. + * combine.c: Ditto. + * convert.c: Ditto. + * cppexp.c: Ditto. + * cppfiles.c: Ditto. + * cse.c: Ditto. + * dbxout.c: Ditto. + * defaults.h: Ditto. + * df.c: Ditto. + * dwarf2out.c: Ditto. + * dwarfout.c: Ditto. + * emit-rtl.c: Ditto. + * explow.c: Ditto. + * expmed.c: Ditto. + * expr.c: Ditto. + * final.c: Ditto. + * fix-header.c: Ditto. + * floatlib.c: Ditto. + * flow.c: Ditto. + * fold-const.c: Ditto. + * function.c: Ditto. + * gcc.c: Ditto. + * gcse.c: Ditto. + * gen-protos.c: Ditto. + * genattrtab.c: Ditto. + * gencheck.c: Ditto. + * genconfig.c: Ditto. + * genemit.c: Ditto. + * genextract.c: Ditto. + * genflags.c: Ditto. + * gengenrtl.c: Ditto. + * genoutput.c: Ditto. + * genpeep.c: Ditto. + * genrecog.c: Ditto. + * gensupport.c: Ditto. + * global.c: Ditto. + * gmon.c: Ditto. + * graph.c: Ditto. + * haifa-sched.c: Ditto. + * hard-reg-set.h: Ditto. + * hash.c: Ditto. + * integrate.c: Ditto. + * jump.c: Ditto. + * lists.c: Ditto. + * local-alloc.c: Ditto. + * loop.c: Ditto. + * mips-tdump.c: Ditto. + * mips-tfile.c: Ditto. + * optabs.c: Ditto. + * prefix.c: Ditto. + * print-rtl.c: Ditto. + * read-rtl.c: Ditto. + * real.c: Ditto. + * recog.c: Ditto. + * reg-stack.c: Ditto. + * regclass.c: Ditto. + * regmove.c: Ditto. + * reload.c: Ditto. + * reload1.c: Ditto. + * reorg.c: Ditto. + * resource.c: Ditto. + * rtl.c: Ditto. + * rtlanal.c: Ditto. + * scan.c: Ditto. + * sched-deps.c: Ditto. + * sched-rgn.c: Ditto. + * sdbout.c: Ditto. + * simplify-rtx.c: Ditto. + * stmt.c: Ditto. + * stor-layout.c: Ditto. + * toplev.c: Ditto. + * tradcif.y: Ditto. + * tradcpp.c: Ditto. + * tree.c: Ditto. + * unroll.c: Ditto. + * varasm.c: Ditto. + * xcoffout.c: Ditto. + +2001-10-10 Richard Henderson + + * rtl.h (can_reverse_comparison_p): Remove. + +2001-10-10 Christopher Faylor + + * config/i386/cygwin.h: Avoid adding include files if -nostdinc is + used. + +2001-10-10 Danny Smith + + * config/i386/mingw32.h (WIN32_NO_ABSOLUTE_INST_DIRS): New define. + (Thanks to Chris Faylor for suggesting macro name). + (CPP_PREDEFINES): Define __MINGW32__ but don't set value; add more + WIN32 defines. + (STANDARD_INCLUDE_DIR): Remove i386- from directory name. + (STANDARD_INCLUDE_COMPONENT): Change to MINGW. + (MATH_LIBRARY): Undef before definition. + (OUTPUT_QUOTED_STRING): Likewise. + * config/i386/cygwin.h: Use WIN32_NO_ABSOLUTE_INST_DIRS. + +2001-10-10 Richard Henderson + + * unwind-dw2-fde.c (fde_compare_t): Change return type to int. + (fde_unencoded_compare): Likewise. Don't use subtraction to get + a tristate comparison value. + (fde_single_encoding_compare, fde_mixed_encoding_compare): Likewise. + +2001-10-10 Franz Sirl + + PR c++/4512 + * unroll.c (loop_iterations): Ignore insns generated by loop + unrolling. + + * config.gcc (mips*-*-gnu*): Delete support. + * config/mips/gnu.h: Remove. + +2001-10-10 Kazu Hirata + + * calls.c: Fix formatting. + * c-decl.c: Likewise. + * cfgcleanup.c: Likewise. + * combine.c: Likewise. + * cppfiles.c: Likewise. + * cpplib.c: Likewise. + * cppmacro.c: Likewise. + * crtstuff.c: Likewise. + * cse.c: Likewise. + * dwarf2out.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * gcse.c: Likewise. + * genattrtab.c: Likewise. + * ggc-page.c: Likewise. + * integrate.c: Likewise. + * libgcc2.c: Likewise. + * loop.c: Likewise. + * optabs.c: Likewise. + * profile.c: Likewise. + * protoize.c: Likewise. + * real.c: Likewise. + * recog.c: Likewise. + * reload1.c: Likewise. + * reload.c: Likewise. + * reorg.c: Likewise. + * resource.c: Likewise. + * sched-rgn.c: Likewise. + * sdbout.c: Likewise. + * stmt.c: Likewise. + * toplev.c: Likewise. + * varasm.c: Likewise. + +2001-10-10 Janis Johnson , Alexandre Oliva + + * langhooks.c: Include rtl.h, insn-config.h and integrate.h. + * Makefile.in (langhooks.o): Add dependencies. + +Wed Oct 10 00:41:29 EDT 2001 John Wehle (john@feith.com) + + * rs6000.c (rs6000_emit_load_toc_table): Don't + strdup the toc label. + (create_TOC_reference): Likewise. + +2001-10-09 Danny Smith + + * config.gcc (i[34567]86-*-mingw32*): Make msvcrt-dependent + version default. + +2001-10-09 Danny Smith + + * config/i386/i386.c (ix86_attribute_table): Correct + min_len, max_len fields for dllimport, dllexport and shared. + +2001-10-10 Joseph S. Myers + + * doc/c-tree.texi, doc/cppinternals.texi, doc/extend.texi, + doc/install.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: + Consistently use "nonzero" instead of "non-zero". + +2001-10-09 Kazu Hirata + + * acconfig.h: Fix comment formatting. + * c-dump.h: Likewise. + * c-tree.h: Likewise. + * conditions.h: Likewise. + * expr.h: Likewise. + * function.h: Likewise. + * gthr.h: Likewise. + * hwint.h: Likewise. + * integrate.h: Likewise. + * intl.h: Likewise. + * loop.h: Likewise. + * optabs.h: Likewise. + +2001-10-09 Kazu Hirata + + * c-common.h: Fix comment formatting. + * c-dump.c: Likewise. + * cfg.c: Likewise. + * diagnostic.h: Likewise. + * except.c: Likewise. + * gcc.h: Likewise. + * gcov-io.h: Likewise. + * genattrtab.c: Likewise. + * output.h: Likewise. + * predict.h: Likewise. + * reload1.c: Likewise. + * reload.h: Likewise. + * resource.h: Likewise. + * scan.h: Likewise. + * system.h: Likewise. + * tree.h: Likewise. + * tree-inline.c: Likewise. + * tsystem.h: Likewise. + * varasm.c: Likewise. + * xcoffout.h: Likewise. + +2001-10-09 Joseph S. Myers + + * doc/gcc.texi: Document preference for "nonzero" over "non-zero". + +2001-10-09 Joseph S. Myers + + * config/alpha/freebsd.h, config/alpha/lib1funcs.asm, + config/i386/i386elf.h, config/i386/netbsd-elf.h, + config/i386/netware.h, config/mcore/gfloat.h, + config/mcore/mcore.c, config/mcore/mcore.h, config/mcore/mcore.md, + config/netware.h, gccbug.in: Update FSF address. + +2001-10-09 Kazu Hirata + + * c-common.c: Fix comment typos. + * cfgrtl.c: Likewise. + * collect2.c: Likewise. + * cpplex.c: Likewise. + * doloop.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * expr.c: Likewise. + * fold-const.c: Likewise. + * gcc.c: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * global.c: Likewise. + * ifcvt.c: Likewise. + * loop.c: Likewise. + * optabs.c: Likewise. + * protoize.c: Likewise. + * regclass.c: Likewise. + * reorg.c: Likewise. + * rtl.h: Likewise. + * stmt.c: Likewise. + * tree.h: Likewise. + * doc/cpp.texi: Likewise. + * doc/c-tree.texi: Likewise. + * doc/extend.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/objc.texi: Likewise. + * doc/tm.texi: Likewise. + +2001-10-08 Richard Henderson + + * varasm.c (set_named_section_flags): Initialize "declared". + +2001-10-08 Robert Lipe + + * varasm.c (struct in_named_entry): Add declared. + (named_section_first_declaration): New function. + (default_elf_asm_named_section): Use it. + * output.h (named_section_first_declaration): New. + +2001-10-08 Richard Henderson + + * i386.md (movsi_xor): Export. + (setcc peep2): Use it when available; add an alternative to + match zero_extendhisi2_and. + +2001-10-08 Kaveh R. Ghazi + + * romp-protos.h (romp_initialize_trampoline): New function. + * romp.c (romp_initialize_trampoline): Likewise. + * romp.h (INITIALIZE_TRAMPOLINE): Define in terms of + romp_initialize_trampoline. + +2001-10-08 Kaveh R. Ghazi + + * m68k/3b1.h (ASM_OUTPUT_SOURCE_LINE): Don't reference `last_linenum'. + * m68k/auxas.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * m68k/crds.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * m68k/mot3300.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + +2001-10-08 Franz Sirl + + * unroll.c (loop_iterations): Extend check for multiple back edges. + +2001-10-08 Alexandre Oliva + + * langhooks.h: New file. + * Makefile.in (OBJS): Added langhooks.o. + (c-lang.o): Depend on langhooks.h. + (c-common.o): Don't depend on tree-inline.h. + (tree-inline.o): Depend on toplev.h. + (langhooks.o): New rule. + * c-common.c: Don't include tree-inline.h. + (c_mark_lang_decl): Mark argument c as unused. + (c_common_lang_init): Don't initialize hooks here. + * c-lang.c: Include langhooks.h, then override some macros. + (lang_hooks): Initialize with macros in langhooks.h. + (c_init): Don't initialize hooks here. + * toplev.c (struct lang_hooks_for_tree_inlining): New struct. + (struct lang_hooks): Add tree_inlining. Refer to langhooks.h. + * tree-inline.c: Include toplev.h. Don't define hook variables. + * tree-inline.h: Don't define hook types nor declare hook + variables. Move macros to... + * langhooks.c: ... new file, as functions. Adjust all callers. + +2001-10-08 Jeffrey A Law + + * sibcall.c (optimize_sibling_and_tail_recursive_calls): Call + purge_mem_unchanging_flag on all instructions, not just on those + before NOTE_INSN_FUNCTION_BEG. + +2001-10-08 Neil Booth + + * cppmacro.c (_cpp_create_definition): Leave comments off. + + * doc/cpp.texi: Update. + +2001-10-08 DJ Delorie + + * c-decl.c (grokfield): Make sure the only unnamed fields + we're allowing are either structs or unions. + * doc/extend.texi: Add documentation for the unnamed field + extension. + +2001-10-08 Zack Weinberg + + * aclocal.m4 (gcc_AC_PROG_GNAT): New. + * configure.in: Use it. + * configure: Regenerated. + * config/pa/t-linux, config/pa/t-pa, config/pa/t-pa64, + config/pa/t-pro: Set T_ADAFLAGS, not ADA_CFLAGS. + +2001-10-08 Neil Booth + + * cppfiles.c (open_file): Don't mark zero-length files + never-reread here. Don't output diagnostics here either. + (stack_include_file): Mark them never-reread here. + (_cpp_read_file): Update. + +2001-10-08 Richard Henderson + + * config/i386/sol2.h (UNALIGNED_DOUBLE_INT_ASM_OP): New. + +2001-10-08 Richard Henderson + + * expr.c (store_expr): When converting a CONST_INT for storage + in a SUBREG, convert it to both SUBREG modes before stripping + the SUBREG. + +2001-10-08 Richard Henderson + + * varasm.c (restore_varasm_status): New. + * function.h: Declare it. + * function.c (pop_function_context_from): Call it. + +2001-10-08 Richard Henderson + + * c-common.h (struct c_lang_decl): Add declared_inline. + * c-tree.h (DECL_DECLARED_INLINE_P): New. + * c-lang.c (c_disregard_inline_limits): Use it. + * c-decl.c (duplicate_decls): Likewise. + (pushdecl, redeclaration_error_message): Likewise. + (pushdecl): Allocate DECL_LANG_SPECIFIC if needed. + (grokdeclarator): Likewise. Set DECL_DECLARED_INLINE_P. + Set DECL_INLINE if -finline-functions. + (store_parm_decls): Don't allocate DECL_LANG_SPECIFIC here. + +2001-10-08 Neil Booth + + * cppmacro.c (funlike_invocation_p): Move some logic to caller + in enter_macro_context. Create a padding token in its own context + if necessary when the search for '(' fails. + (enter_macro_context): Update. + +2001-10-07 Joseph S. Myers + + * ChangeLog.2, c-decl.c, config/i386/i386.md, doc/gcc.texi, gcc.c, + genmultilib, toplev.c: Fix spelling errors of "separate" as + "seperate", and corresponding spelling errors of related words. + +2001-10-07 Kaveh R. Ghazi + + * builtins.c (expand_builtin_setjmp_receiver): Const-ify. + * c-common.c (fname_var_t, c_tree_code_type, c_tree_code_length): + Likewise. + * c-dump.c (dump_option_value_info): Likewise. + * c-format.c (format_length_info, format_char_info, + format_flag_spec, format_flag_pair, format_kind_info): Likewise. + * collect2.c (names): Likewise. + * cppdefault.h (default_include): Likewise. + * cppexp.c (suffix, vsuf_1, vsuf_2, vsuf_3): Likewise. + * flow.c (life_analysis): Likewise. + * gcc.c (dir_separator_str, modify_target, option_map, + target_option_translations, spec_list_1, extra_specs_1, + init_spec): Likewise. + * gcov.c (gcov_version_string): Likewise. + * genattr.c (write_units): Likewise. + * genattrtab.c (make_length_attrs, write_function_unit_info): Likewise. + * gengenrtl.c (rtx_definition, defs): Likewise. + * genrecog.c (pred_table): Likewise. + * global.c (global_alloc): Likewise. + * lcm.c (optimize_mode_switching): Likewise. + * local-alloc.c (find_free_reg): Likewise. + * params.h (param_info): Likewise. + * predict.c (predictor_info): Likewise. + * protoize.c (unexpansion_struct): Likewise. + * real.c (bmask): Likewise. + * recog.h (insn_operand_data, insn_data): Likewise. + * regclass.c (initial_fixed_regs, initial_call_used_regs): Likewise. + * stmt.c (expand_nl_goto_receiver): Likewise. + * toplev.c (da, debug_args, lang_opt, documented_lang_options, + target_switches, target_options): Likewise. + * tradcif.y (token, tokentab2, yylex): Likewise. + * tree.h (attribute_spec): Likewise. + + * alpha.c (override_options, alpha_lookup_xfloating_lib_func): + Likewise. + * arc.c (arc_output_function_epilogue): Likewise. + * arm.c (processors, all_cores, all_architectures, + arm_override_options, isr_attribute_arg, isr_attribute_args, + arm_isr_value): Likewise. + * avr.c (mcu_type_s, reg_class_tab, order_regs_for_local_alloc): + Likewise. + * c4x.c (c4x_int_reglist): Likewise. + * d30v.c (override_options): Likewise. + * h8300.c (shift_insn): Likewise. + * i386.c (size_cost, i386_cost, i486_cost, pentium_cost, + pentiumpro_cost, k6_cost, athlon_cost, pentium4_cost, ix86_cost, + ix86_expand_sse_comi, ix86_expand_sse_compare, override_options, + builtin_description, bdesc_comi, bdesc_2arg, bdesc_1arg, + ix86_init_mmx_sse_builtins, ix86_expand_builtin): Likewise. + * i386.h (processor_costs, ix86_cost): Likewise. + * m68hc11.c (m68hc11_cost, m6811_cost, m6812_cost): Likewise. + * m68hc11.h (processor_costs, m68hc11_cost): Likewise. + * m68k.c (codes_68881, codes_FPA): Likewise. + * m88k.c (mode_from_align, max_from_align, all_from_align, + best_from_align, m_options): Likewise. + * m88k.h (ORDER_REGS_FOR_LOCAL_ALLOC): Likewise. + * mcore.c (mode_from_align): Likewise. + * mips/elf64.h (UNIQUE_SECTION): Likewise. + * mips/iris6gld.h (UNIQUE_SECTION): Likewise. + * mips.c (mips_sw_reg_names, mips_regno_to_class): Likewise. + * mips.h (mips_regno_to_class): Likewise. + * ns32k.c (scales): Likewise. + * pa.c (import_string, magic_milli): Likewise. + * rs6000.c (alt_reg_names, rs6000_override_options): Likewise. + * sparc.c (leaf_reg_remap, sparc_override_options, + reg_leaf_alloc_order, reg_nonleaf_alloc_order, reg_alloc_orders): + Likewise. + * sparc.h (sparc_cpu_select, leaf_reg_remap): Likewise. + +2001-10-07 Dale Johannesen + + * reload1.c (reload_reg_free_p): Teach register interference + checking that multiple output reloads are emitted in + reverse order. + reload1.c (reload_reg_reaches_end_p): Ditto. + reload1.c (reloads_conflict): Ditto. + +2001-10-07 Joseph S. Myers + + * doc/c-tree.texi, doc/tm.texi: Consistently put NULL and + NULL_TREE inside @code. + +2001-10-07 Joseph S. Myers + + * doc/gcc.texi: Document consistent style of "32-bit", + "Objective-C", and "@code{NULL}". + +2001-10-06 Zack Weinberg + + * cpplex.c (enum spell_type): Add SPELL_NUMBER. + (cpp_token_len, cpp_spell_token, cpp_output_token, + _cpp_equiv_tokens): Handle it. + * cpplib.h (TTYPE_TABLE): Use SPELL_NUMBER for CPP_NUMBER and + CPP_COMMENT, SPELL_NONE for CPP_PADDING and CPP_EOF. + * cppexp.c (_cpp_parse_expr): Use the correct operator code in + error messages. + +Sat Oct 6 07:42:39 2001 Richard Kenner + + * gcc.c (default_compilers): Remove .ada. + +2001-10-06 Neil Booth + + * doc/cppinternals.texi: Update. + +2001-10-06 Zack Weinberg + + * gcc.c (main): Set this_file_error if the appropriate + compiler for a language has not been installed. + +2001-10-06 Ulrich Weigand + + * config/s390/s390.c (s390_va_arg): Use set_mem_alias_set. + +2001-10-05 Joseph S. Myers + + * gccbug.in (CATEGORIES): Add ada. + +2001-10-05 Catherine Moore + + * config/stormy16/stormy-abi: Document abi changes. + * config/stormy16/stormy16.h (REG_ALLOC_ORDER): Redefine. + (ICALL_REGS): New register class. + (NUM_ARGUMENT_REGISTERS): Now 6. + (DEFAULT_PCC_STRUCT_RETURN): Don't try to return structs + in registers. + (REG_CLASS_FROM_LETTER): Map 'z' to ICALL_REGS. + * config/stormy16.md (call_internal, call_value_internal, + indirect_jump): Use new 'z' constraint. + +2001-10-05 Neil Booth + + * doc/cppinternals.texi: Update. + +2001-10-05 Richard Henderson + + * dwarf2out.c (FRAME_BEGIN_LABEL): New. + (output_call_frame_info): Use it instead of __FRAME_BEGIN__ and + the gas section-name-as-label feature. + +2001-10-05 Neil Booth + + * doc/cppinternals.texi: Update. + +Fri Oct 5 08:17:46 2001 Richard Kenner + + * config/i386/i386.c (ix86_split_to_parts): Use trunc_int_for_mode + to ensure valid SImode constants. + +2001-10-05 Alexandre Oliva + + * Makefile.in (c-decl.o): Depend on tree-inline.h. + (c-lang.o): Likewise, as well as insn-config.h and integrate.h. + * c-decl.c: Include tree-inline.h. + (c_expand_body): Call optimize_inline_calls. Determine whether + a function is inlinable upfront, and only clear + DECL_SAVED_TREE, DECL_INITIAL and DECL_ARGUMENTS if it isn't. + * c-lang.c: Include tree-inline.h, insn-config.h and integrate.h. + (c_disregard_inline_limits): New function. + (inline_forbidden_p, c_cannot_inline_tree_fn): Likewise. + (c_post_options): Enable tree inlining if inlining is enabled. + Don't inline trees when instrumenting functions. + (c_init): Initialize lang_disregard_inline_limits and + lang_cannot_inline_tree_fn. + * tree-inline.c (initialize_inlined_parameters): Handle calls + with fewer arguments than declared parameters, and fewer + parameters than passed arguments. Don't assume value is a + DECL. + (declare_return_variable): Convert return value back to the + original type, if it was promoted. + (tree_inlinable_function_p): New function. + (inlinable_function_p): Don't look at DECL_INLINE if we're + inlining all functions. Make it work with a NULL id. + Re-check DECL_UNINLINABLE after language-specific checks. + * tree-inline.h (tree_inlinable_function_p): Declare it. + * integrate.c (save_for_inline): Don't bother to prepare argvec + when not inlining. + * cse.c (check_for_label_ref): Don't check deleted labels. + + * Makefile.in (tree-inline.o): Depend on newly-included headers. + * tree-inline.c: Include headers needed for the functions moved in. + (struct inline_data, INSNS_PER_STMT): Moved from cp/optimize.c. + (remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise. + (copy_body, initialize_inlined_parameters): Likewise. + (declare_return_variable, inlinable_function_p): Likewise. + (expand_call_inline, expand_calls_inline): Likewise. + (optimize_inline_calls, clone_body): Likewise. + (walk_tree, walk_tree_without_duplicates): Moved from cp/tree.c. + (copy_tree_r, remap_save_expr): Likewise. + +2001-10-04 Alexandre Oliva + + * Makefile.in (OBJS): Added tree-inline.o. + (c-common.o): Depend on tree-inline.h. + (tree-inline.o): New target. + * c-common.c: Include tree-inline.h. + (c_mark_lang_decl): Don't mark saved_tree. + (c_common_lang_init): Set lang_anon_aggr_type_p. + * c-common.h (walk_tree_fn, DECL_SAVED_TREE): Moved to tree.h. + (struct c_lang_decl): Moved saved_tree to tree_decl. + * ggc-common.c: Mark saved_tree and inlined_fns of FUNCTION_DECLs. + * integrate.h (function_attribute_inlinable_p): Declare it. + * integrate.c (function_attribute_inlinable_p): Export it. + * tree-inline.c: New file. Define variables declared in... + * tree-inline.h: New file. Declare functions to be moved to + tree-inline.c. Define macros and declare types and hooks for + language-specific tree inlining. + (flag_inline_trees): Moved definition from cp/decl2.c. + * tree.h (walk_tree_fn, DECL_SAVED_TREE): Moved from c-common.h. + (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved from cp/cp-tree.h. + (struct tree_decl): Moved saved_tree from c_lang_decl and + inlined_fns from C++'s lang_decl. + +2001-10-04 Loren J. Rittle + + * Makefile.in (STAGE2_FLAGS_TO_PASS): Remove patches which + propagated HOST_CC, HOST_CFLAGS, HOST_LDFLAGS and HOST_CPPFLAGS. + +2001-10-04 Neil Booth + + * doc/cppinternals.texi: Update. + +2001-10-04 Eric Christopher + + * config/mips/mips.c (init_cumulative_args): Remember to set + cum->prototype. + * config.gcc: Redo linux configuration. Add target_cpu_default + of soft-float to all mipsisa32 combinations and tx39. + * config/mips/linux.h: Remove include of mips.h. + +2001-10-03 Loren J. Rittle + + * Makefile.in (STAGE2_FLAGS_TO_PASS): Propagate HOST_CFLAGS, + HOST_LDFLAGS and HOST_CPPFLAGS. + +2001-10-03 Ziemowit Laski + + * c-parse.in (objc_inherit_code, objc_pq_context, + objc_public_flag): Make static. + (objc_interface_context, objc_implementation_context, + objc_method_context, objc_ivar_chain, objc_ivar_context): Move to + global tree array in objc/objc-act.[ch]. + (methoddef): Remove unnecessary code. + + * objc/objc-act.c: (hashed_attribute, hashed_entry, imp_entry): + Hoist struct definitions to objc-act.h. + (nst_method_hash_list, cls_method_hash_list, imp_list, imp_count, + cat_count): Place declaration in objc-act.h. + (objc_tree_index): Move enumeration to objc-act.h. + (objc_global_trees): Place declaration and macro accessors in + objc-act.h. + (implementation_context): Remove duplicate; use + objc_implementation_context instead: + (method_context): Remove duplicate; use objc_method_context + instead. + (objc_ellipsis_node, objc_method_prototype_template, + implemented_classes, function_type): Move global vars to + objc_global_trees. + (init_objc): Use LAST_BASE_TREE_CODE instead of LAST_CODE. + (build_message_expr): Move actual construction of ObjC message + send nodes to finish_message_expr. + (finish_message_expr): New routine, contains code formerly in + build_message_expr. + * objc/objc-act.h (finish_message_expr): New prototype. + (objc_ivar_chain, objc_method_context, objc_ellipsis_node): Remove + declarations; these vars are now part of objc_global_trees. + (objc_tree_index, objc_global_trees): Move definitions from + objc-act.c. + * objc/objc-tree.def: Update copyright info. + +Wed Oct 3 12:22:11 EDT 2001 John Wehle (john@feith.com) + + * dwarf2asm.c (unaligned_integer_asm_op): Abort if + op is NULL. + * sparc/sysv4.h (UNALIGNED_DOUBLE_INT_ASM_OP): Use + only if TARGET_ARCH64. + +2001-10-02 Bernd Schmidt + + * doc/extend.texi: Fix some problems with previous checkin. + * doc/invoke.texi: Likewise. + +2001-10-02 Neil Booth + + * cpphash.h: Update comments. + (cpp_context): Update. + (spec_nodes): Remove n__Pragma. + * cppinit.c (cpp_create_reader): Update. + (builtin_array): Add _Pragma. + * cpplib.h: Update comments. + (NODE_DISABLED, BT_PRAGMA): New. + (cpp_start_lookahead, cpp_stop_lookahead): Remove prototypes. + * cppmacro.c (struct cpp_macro): Remove disabled. + (builtin_macro): Return int, handle _Pragma, push the new token + on the context stack. + (funlike_invocation_p): Unconstify, update. + (enter_macro_context): Handle builtins here. + (replace_args, push_token_context, push_ptoken_context): + Update for prototype changes. + (_cpp_pop_context): Update. + (cpp_get_token): Don't handle buitins, nor _Pragma here. + (cpp_sys_macro_p): Update. + (_cpp_free_definition): Clear disabled flag. + (_cpp_create_definition): Upate. + * cppmain.c: Update comments. + +Tue Oct 2 12:46:01 CEST 2001 Bo Thorsen , + Andreas Jaeger , + Jan Hubicka + + * doc/invoke.texi (i386 Options): Document x86-64 options. + (i386 and x86-64 Options): Rename i386 options section. + + * config/i386/i386.h (TARGET_UNWIND_INFO): New. + (TARGET_SWITCHES): Add -munwind-info. + (MASK_NO_UNWIND_INFO): New. + (NO_BUILTIN_SIZE_TYPE, NO_BUILTIN_PTRDIFF_TYPE): Define for + biarch compilation. + (ASM_OUTPUT_DOUBLE_INT): New. + + * config/i386/linux64.h: New spec file for Linux x86-64 support. + * config.gcc: Fix tm_file settings for x86-64. + * config/i386/x86-64.h: New file with OS independent x86-64 + definitions. + * config/i386/biarch64.h: New file used to configure compiler + to biarch/64bit compilation. + + * config/i386/i386.c: (override_options): Set flags default + for 64bit compilation. + +Tue Oct 2 12:46:01 CEST 2001 Jan Hubicka + + * i386.c (legitimize_pic_address): Add missing bits of 64bit support. + (ix86_expand_int_movcc): Optimize DImode conditional moves with + constants on x86_64. + (ix86_attr_length_immediate_default): Support MODE_DI. + * i386.md (fixdi splitter): Add missing "&& 1" in splitter + condition. + (indirect_jump, tablejump): Turn into expander. + +2001-10-02 Joseph S. Myers + + * c-common.c (c_format_attribute_table): Make format and + format_arg attributes apply to function types rather than to + decls. + (is_valid_printf_arglist): Construct an attribute list and pass + that to check_function_format rather than a name. + * c-common.h (check_function_format): Adjust prototype. + * c-decl.c (duplicate_decls): Preserve attributes from type of + built-in decl when allowing for harmless conflict in types. + * c-format.c (record_function_format, + record_international_format, function_format_list, + international_format_info, international_format_list): Remove. + (function_format_info): Remove next, name and assembler_name. + Make format_num and first_arg_num be unsigned HOST_WIDE_INT. + (decode_format_attr): New. + (handle_format_attribute): Handle receiving a type rather than a + decl. Call decode_format_attr. Store format information in a + function_format_info. + (handle_format_arg_attribute): Correct comment. Handle receiving + a type rather than a decl. Use unsigned HOST_WIDE_INT for + arg_num. + (check_format_info_recurse, check_format_info_main): Take argument + numbers as unsigned HOST_WIDE_INT. + (check_function_format): Take a list of attributes from the + function type rather than a name or assembler name. Check for + format attributes in that list and the attributes on the type of + the current function rather than looking through + function_format_list. + (check_format_info): Use unsigned HOST_WIDE_INT for argument + numbers. + (check_format_info_recurse): Take format_arg attributes from the + type of the function calls rather than using + international_format_list. Allow for multiple format_arg + attributes. + * c-typeck.c (build_function_call): Pass type attributes to + check_function_format rather than name or assembler name. Don't + require there to be a name or assembler name to check formats. + +2001-10-02 Joseph S. Myers + + * attribs.c (decl_attributes): Possibly call + insert_default_attributes to insert default attributes on + functions in a lazy manner. + * builtin-attrs.def: New file; define the default format and + format_arg attributes. + * c-common.c (c_format_attribute_table): Move to earlier in the + file. + (c_common_nodes_and_builtins): Initialize format_attribute_table. + (enum built_in_attribute, built_in_attributes, + c_attrs_initialized, c_init_attributes, + c_common_insert_default_attributes): New. + (c_common_lang_init): Don't initialize format_attribute_table. Do + call c_init_attributes. + * Makefile.in (c-common.o): Depend on builtin-attrs.def. + * c-common.h (init_function_format_info): Don't declare. + (c_common_insert_default_attributes): Declare. + * c-decl.c (implicitly_declare, builtin_function): Call + decl_attributes. + (init_decl_processing): Don't call init_function_format_info. + (insert_default_attributes): New. + * c-format.c (handle_format_attribute, + handle_format_arg_attribute): Be quiet about inappropriate + declaration when applying default attributes. + (init_function_format_info): Remove. + * tree.h (enum attribute_flags): Add ATTR_FLAG_BUILT_IN. + (insert_default_attributes): Declare. + +2001-10-02 Joseph S. Myers + + * c-format.c (CPLUSPLUS_STD_VER): Define to STD_C94. + +2001-10-01 Jim Wilson + + * sched-deps.c (add_dependence): When elide conditional dependence, + check that insn doesn't modify cond2. + +2001-10-01 Dale Johannesen + + * config/rs6000/rs6000.h (enum processor_type): Add support + for 7400 (G4) and 7450. + (RTX_COSTS): Ditto. + * config/rs6000/rs6000.c (rs6000_override_options): Ditto. + (rs6000_issue_rate): Ditto. + (rs6000_adjust_cost): Fix cycle counts for compares. + (debug_stack_info): Fix an obvious typo. + * config/rs6000/rs6000.md: Add functional units for 7400 and 7450. + * doc/invoke.texi: Document. + * config/rs6000/darwin.h (TARGET_DEFAULT): Set to be reasonable + for Darwin. + (PROCESSOR_DEFAULT): Ditto. + +2001-10-01 Loren J. Rittle + + * Makefile.in (STAGE2_FLAGS_TO_PASS): Propagate HOST_CC. + (fixinc.sh): Map CC, CFLAGS and LDFLAGS to HOST_* versions for + later recursive make invocation. + +2001-10-01 Hans Boehm + + * optabs.c (emit_libcall_block): When using non-call exceptions, + don't add REG_LIBCALL reg notes to trapping calls. + +2001-10-01 David Billinghurst + + * flow.c (propagate_block_delete_libcall): Remove unused first arg + (propagate_one_insn): Update for above change + +2001-10-01 David Billinghurst + + * unwind-sjlj.c (_Unwind_GetRegionStart, _Unwind_GetDataRelBase, + _Unwind_GetTextRelBase): Argument is unused. + +Mon Oct 1 19:20:57 2001 Richard Kenner + + * alias.c (get_alias_set): Try to replace PLACEHOLDER_EXPR. + Loop through NOPs, placeholders, and components. + Don't go through NOPs if change mode. + (record_alias_subset): Do nothing if SUBSET and SET are the same. + * emit-rtl.c (set_mem_alias_set): Enable check. + * expr.c (find_placeholder): New function. + (expand_expr, case PLACEHOLDER_EXPR): Use it. + (expand_expr, case COMPONENT_EXPR): Always copy OP0 when we need + to modify it and avoid unneeded copies. + * expr.h (expand_expr): Always define. + (find_placeholder): New declaration. + +2001-10-01 Stephane Carrez + + * config/m68hc11/m68hc11.md ("add-split"): Fix add split when + operand 2 is the stack pointer. + ("addr-peephole"): Fix address computation peephole when operand 2 + is the stack pointer. + +Mon Oct 1 09:26:41 2001 Richard Kenner + + * config/i386/i386.c (ix86_va_arg): Call set_mem_alias_set. + (ix86_setup_incoming_varargs): Likewise. + +2001-10-01 Jason Merrill + + * stor-layout.c (layout_type): Don't complain about too-large + array here. + +Mon Oct 1 06:43:41 2001 Richard Kenner + + * function.c (keep_stack_depressed): Don't use delete_insn. + + * expr.h (set_mem_alias_set): Move decl to here. + * rtl.h (mem_attrs): New typedef and struct. + (union rtunion_def): Add field for mem_attrs. + (X0MEMATTR, MEM_ATTRS): New macros. + (MEM_ALIAS_SET): Use MEM_ATTRS. + (MEM_DECL, MEM_OFFSET, MEM_SIZE, MEM_ALIGN): New macros. + (MEM_COPY_ATTRIBUTES): Copy MEM_ATTRS. + (set_mem_alias_set): Delete decl from here. + + * alias.c (set_mem_alias_set): Delete from here. + * emit-rtl.c (mem_attrs_htab): New variable. + (rtx_htab_mark, rtx_htab_mark_1): Deleted. + (mem_attrs_htab_hash, mem_attrs_htab_eq): New functions. + (mem_attrs_mark, get_mem_attrs): Likewise. + (gen_rtx_MEM): Clear MEM_ATTRS. + (set_mem_attributes): Move to here. + (set_mem_alias_set): Likewise, and call get_mem_attrs. + (init_emit_once): const_int_htab now deletable htab. + Initialize mem_attrs_htab. + * explow.c (set_mem_attributes): Delete from here. + * function.c (put_var_into_stack): Clear MEM_ATTRS. + (gen_mem_addressof): Likewise; rework to use set_mem_attributes. + * ggc-common.c (ggc_mark_rtx_children, case MEM): New case. + * reload1.c (reload): Rework changing REG to MEM. + +2001-09-30 H.J. Lu + + * acconfig.h (PREFIX_INCLUDE_DIR): New variable. + * config.in: Rebuild. + +2001-09-30 Stephane Carrez + + * config/m68hc11/m68hc11.md ("cmpqi_1"): Fix constraints. + ("tsthi_1"): Avoid allocation in register y. + ("*movqi_68hc12"): Reorganize and fix constraints. + ("zero_extendqisi2"): Prefer d over x and y for operand 1. + ("addqi3"): Likewise. + ("addhi3"): Fix constraints. + ("*logicalhi3_zexthi"): Disparage soft registers. + +2001-09-30 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Fix move of sp + to tmp reg. + +2001-09-30 Stephane Carrez + + * config/m68hc11/m68hc11.h(INCOMING_RETURN_ADDR_RTX): Remove so + that we use setjmp/longjmp exceptions. + +2001-09-30 Neil Booth + + * cpphash.h (POOL_ALIGN, POOL_FRONT, POOL_LIMIT, POOL_BASE, + POOL_SIZE, POOL_ROOM, POOL_COMMIT, struct cpp_chunk, + struct cpp_pool, _cpp_init_pool, _cpp_free_pool, _cpp_pool_reserve, + _cpp_pool_alloc, _cpp_next_chunk): Remove. + (_cpp_extend_buff, BUFF_ROOM): Update. + (_cpp_append_extend_buff): New. + (struct cpp_reader): Remove macro_pool, add a_buff. + * cppinit.c (cpp_create_reader): Initialize a_buff, instead of + macro_pool. + (cpp_destroy): Free a_buff instead of macro_pool. + * cpplex.c (new_chunk, chunk_suitable, _cpp_next_chunk, + new_chunk, _cpp_init_pool, _cpp_free_pool, _cpp_pool_reserve, + _cpp_pool_alloc, ): Remove. + (parse_number, parse_string): Update use of _cpp_extend_buff. + (_cpp_extend_buff): Update. + (_cpp_append_extend_buff, cpp_aligned_alloc): New. + * cpplib.c (glue_header_name, parse_answer): + Update use of _cpp_extend_buff. + (cpp_register_pragma, cpp_register_pragma_space): Use + _cpp_aligned_alloc. + (do_assert, do_unassert): Check for EOL, update. + * cppmacro.c (stringify_arg, collect_args): Update to use + _cpp_extend_buff and _cpp_append_extend_buff. + (save_parameter, parse_params, alloc_expansion_token, + _cpp_create_definition): Rework memory management. + +2001-09-29 Andris Pavenis + + * config/i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): Don't + update md_exec_prefix. + (UPDATE_PATH_HOST_CANONICALIZE): Don't free PATH as it can point + to string constant. + +2001-09-30 Ulrich Weigand + + * config/s390/s390.h (EXTRA_CC_MODES): Add CCLmode. + (SELECT_CC_MODE): Use s390_select_ccmode. + * config/s390/s390-protos.h (s390_select_ccmode): Add. + * config/s390/s390.c (s390_select_ccmode): New. + (s390_match_ccmode): Add CCLmode. + (s390_branch_condition_mask, s390_branch_condition_mnemonic): New. + (output_branch_condition, output_inverse_branch_condition): Removed. + (print_operand): Use s390_branch_condition_mnemonic. + * config/s390/s390.md (addsi3_cc, addsi3_cconly, addsi3_cconly2, + subsi3_cc, subsi3_cconly): Use logical instructions and CCLmode. + (bunordered, bordered, buneq, bungt, bunlt, bnuge, bunle, bltgt): New. + + * config/s390/s390.c (check_and_change_labels): Preserve CC mode + when converting conditional branches to far branches. + * config/s390/s390.md (cmpstr_const, cmpstr_64, cmpstr_31, cmpint_si, + cmpint_di): Use CCSmode instead of CCUmode. + + * config/s390/s390.c (legitimate_la_operand_p): New. + * config/s390/s390-protos.h (legitimate_la_operand_p): Add. + * config/s390/s390.md (movsi): Convert load address patterns to + arithmetic operations when necessary. + (addaddr_picR, addaddr_picL, addaddr_picN): Removed. + (do_la): Renamed to *do_la and use legitimate_la_operand_p. + (*do_la_reg_0): Don't use before reload. + + * config/s390/s390.c (legitimize_address): Make more efficient + use of two-register addressing mode. + + * config/s390/s390.c (s390_function_prologue): Fix incorrect prolog + with -mno-backchain in some corner cases. + + * config/s390/s390.md (cmpsi_cct): Operands 0 and 1 do not commute. + +2001-09-29 Alexandre Oliva + + * reload.c (find_reloads): Mark new USE insns with QImode. + (find_reloads_toplev, find_reloads_address, subst_reg_equivs, + find_reloads_subreg_address): Likewise. + * regrename.c (note_sets, clear_dead_regs): Abort if pseudos are + encountered. + * reload1.c (reload_combine_note_use): Likewise, inside USEs and + CLOBBERs. + (reload): Make sure there are no USEs with mode other than + VOIDmode. At the end, remove those marked with QImode. + +2001-09-29 Per Bothner + + * cppdefault.c (cpp_include_defaults): Also search PREFIX_INCLUDE_DIR. + * Makefile.in (includedir): Rename to local_includedir. + (includedir): Define as $(prefix)/include. + * config.in (PREFIX_INCLUDE_DIR): New variable. + * configure.in (PREFIX_INCLUDE_DIR): Test for new variable. + +2001-09-29 Bernd Schmidt + + * config/i386/i386.c (init_mmx_sse_builtins): Fix type of storelps and + storehps builtins. + * doc/extend.texi (Vector Extensions): New node. + * doc/invoke.texi (Machine Dependent Options): Add documentation for + i386 -mmmx, -msse, -m3dnow. + +Sat Sep 29 15:08:16 CEST 2001 Jan Hubicka + + * doc/invoke.texi (Optimize Options): Revert an accidental checkin. + +2001-09-29 Hans-Peter Nilsson + + * cse.c (cse_insn) [HAVE_cc0]: Fix typo delete-insn -> delete_insn. + + * doc/invoke.texi (Optimize Options): Delete spurious @table. + +2001-09-28 Richard Henderson + + * varasm.c (assemble_integer): Bound alignment check by + BIGGEST_ALIGNMENT. + + * cfgrtl.c (redirect_edge_and_branch): Abort if redirect_jump fails. + +2001-09-28 Rainer Orth + + * config/i386/sol2.h (CPLUSPLUS_CPP_SPEC): Define. + +2001-09-25 Bernd Schmidt + + Mostly from Graham Stott + * c-common.c (type_for_mode): Add support for V2SFmode. + * tree.c (build_common_tree_nodes_2): Likewise. + * tree.h (enum tree_index, global_trees): Likewise. + * config/i386/i386.c (x86_3dnow_a): New variable. + (override_options): Support 3Dnow extensions. + (bdesc_2arg, bdesc_1arg): Some SSE instructions are also part of + Athlon's version of 3Dnow. + (ix86_init_mmx_sse_builtins): Create 3Dnow builtins. + (ix86_expand_builtin): Handle them. + (ix86_hard_regno_mode_ok): Support V2SFmode if using 3Dnow. + * config/i386/i386.h (MASK_3DNOW, MASK_3DNOW_A, TARGET_3DNOW, + TARGET_3DNOW_A): New macros. + (TARGET_SWITCHES): Add 3Dnow switches. + (VALID_MMX_REG_MODE_3DNOW): New macro. + (VECTOR_MODE_SUPPORTED_P): Use it. + (enum ix86_builtins): Add entries for 3Dnow builtins. + * config/i386/i386.md (movv2sf_internal, movv2sf, pushv2sf, pf2id, + pf2iw, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3, eqv2sf3, + pfmaxv23sf3, pfminv2sf3, mulv2sf3, femms, prefetch_3dnow, prefetchw, + pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pavgusb, pfrcpv2sf2, + pfrcpit1v2sf3, pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, + pmulhrwvhi3, pswapdv2si2, pswapdv2sf2): New patterns. + (mmx_pmovmskb, mmx_maskmovq, sse_movntdi, umulv4hi3_highpart, + mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pextrw, + mmx_pshufw, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, sfence, + sfence_insn, prefetch): Make these available if TARGET_SSE or + TARGET_3DNOW_A. + +Fri Sep 28 19:18:40 CEST 2001 Jan Hubicka + + * i386-protos.h (ix86_setup_incoming_varargs, ix86_va_arg, + ix86_va_start, ix86_build_va_list): Declare. + * i386.c (ix86_setup_incoming_varargs, ix86_va_arg, + ix86_va_start, ix86_build_va_list): New global functions. + * i386.md (sse_prologue_save_insn): New insn. + (sse_prologue_save): New expander. + * i386.h (EXPAND_BUILTIN_VA_ARG, EXPAND_BUILTIN_VA_START, + BUILD_VA_LIST_TYPE, SETUP_INCOMING_VARARGS): New macros. + +2001-09-28 Neil Booth + + * cpplex.c (new_buff, _cpp_get_buff, _cpp_extend_buff): + Use size_t everywhere, make definitions consistent with + prototypes. + +Fri Sep 28 14:59:34 CEST 2001 Jan Hubicka + + * gcse.c (replace_store_insn): Use delete_insn. + * loop.c (move_movables): Likewise; avoid delete_insn + from clobbering notes moved elsewhere. + (check_dbra_loop): Use delete_insn. + * ssa.c (convert_from_ssa): Likewise. + * cse.c (cse_insn): Use delete_insn. + +2001-09-28 Neil Booth + + * cpphash.h (struct cpp_buff): Make unsigned. + (_cpp_get_buff): Take length of size_t. + (_cpp_unaligned_alloc): New. + (BUFF_ROOM, BUFF_FRONT, BUFF_LIMIT): New. + (struct cpp_reader): Remove ident_pool. Add u_buff. + * cppinit.c (cpp_create_reader): Initialize u_buff, not ident_pool. + (cpp_destroy): Destroy u_buff, not ident_pool. + * cpplex.c (parse_number, parse_string, save_comment, + cpp_token_as_text): Update to use the unaligned buffer. + (new_buff): Make unsigned. + (_cpp_unaligned_alloc): New. + * cpplib.c (glue_header_name): Update to use the unaligned buffer. + * cppmacro.c (new_number_token, builtin_macro, stringify_arg): + Similarly. + (collect_args): Make unsigned. + +2001-09-27 Zack Weinberg + + * cpplex.c (cpp_output_token): Use a putc loop for + SPELL_OPERATOR, and fwrite for SPELL_IDENT. + + * configure.in: Detect fwrite_unlocked and fprintf_unlocked. + * configure, config.in: Regenerate. + * system.h: Replace fwrite and fprintf with their unlocked + variants if available. + +2001-09-27 Richard Henderson + + * dwarf2out.c (dwarf2out_frame_finish): Never elide .debug_frame + in favor of .eh_frame. + +2001-09-27 Aldy Hernandez + + * config/rs6000/rs6000.h (FUNCTION_VALUE): Change hardcoded 33 and 3 + to macros. + (LIBCALL_VALUE): Likewise. + +2001-09-27 Neil Booth + + * cpphash.h: Update comment. + * cpplex.c: Update comments. + (_cpp_can_paste): Remove. + * cpplib.h (_cpp_can_paste): Remove. + * cppmacro.c (paste_tokens, paste_all_tokens): Update to use the + lexer rather than _cpp_can_paste. + +2001-09-27 Neil Booth + + * doc/cppinternals.texi: Update. + +2001-09-26 Neil Booth + + * cpphash.h (struct cpp_pool): Remove locks and locked. + (struct cpp_context): Add member buff. + (struct cpp_reader): Remove member argument_pool. + (_cpp_lock_pool, _cpp_unlock_pool): Remove. + * cppinit.c (cpp_create_reader, cpp_destroy): Argument_pool is dead. + * cpplex.c (chunk_suitable): Remove pool argument. + (MIN_BUFF_SIZE, BUFF_SIZE_UPPER_BOUND, EXTENDED_BUFF_SIZE): New. + (new_buff, _cpp_extend_buff): Update. + (_cpp_get_buff): Fix silly pointer bug. Be more selective about + which buffer is returned. + (_cpp_next_chunk, _cpp_init_pool): Pool locking removed. + (_cpp_lock_pool, _cpp_unlock_pool): Remove. + * cppmacro.c (lock_pools, unlock_pools): Remove. + (push_ptoken_context): Take a _cpp_buff. + (enter_macro_context): Pool locking removed. + (replace_args): Use a _cpp_buff for the replacement list with + arguments replaced. + (push_token_context): Clear buff. + (expand_arg): Use _cpp_pop_context. + (_cpp_pop_context): Free a context's buffer, if any. + +2001-09-26 DJ Delorie + + * c-typeck.c (digest_init): Check for sizeless arrays. + +2001-09-26 Richard Henderson + + * optabs.c (init_one_libfunc): Create a dummy function type + instead of using error_mark_node. + +2001-09-26 Neil Booth + + * cpphash.h (struct _cpp_buff, _cpp_get_buff, _cpp_release_buff, + _cpp_extend_buff, _cpp_free_buff): New. + (struct cpp_reader): New member free_buffs. + * cppinit.c (cpp_destroy): Free buffers. + * cpplex.c (new_buff, _cpp_release_buff, _cpp_get_buff, + _cpp_extend_buff, _cpp_free_buff): New. + * cpplib.h (struct cpp_options): Remove unused member. + * cppmacro.c (collect_args): New. Combines the old parse_arg + and parse_args. Use _cpp_buff for memory allocation. + (funlike_invocation_p, replace_args): Update. + +Wed Sep 26 13:20:51 CEST 2001 Jan Hubicka + + * final.c (final_scan_insn): Use delete_insn instead of delete_note. + +2001-09-25 Andrew Haley + + * except.c (sjlj_mark_call_sites): Change address inside sequence. + +2001-09-24 Andrew Haley + + * config/sh/linux.h (LINK_SPEC): Set dynamic-linker to agree with + glibc. + +2001-09-25 Janis Johnson + Jim Wilson + + * doc/install.texi (Specific, ia64-*-linux): Document. + +Tue Sep 25 17:13:56 CEST 2001 Jan Hubicka + + * Makefile.in (cfgrtl.o): Add. + * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, + free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, + free_aux_for_edge): Declare. + * cfg.c + (HAVE_return): Undefine. + * basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks, + free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges, + free_aux_for_edge): New global functions. + (first_delete_block): New static variable. + (init_flow): Clear first_delete_block. + (basic_block_for_insn, label_value_list, tail_recursion_label_list, + can_delete_note_p, can_delete_label_p, commit_one_edge_insertion, + try_redirect_by_replacing_jump, last_loop_beg_note, + back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect, + delete_insn, delete_insn_chain, create_basic_block_structure, + create_basic_block, flow_delete_block, compute_bb_for_insn, + free_bb_for_insn, update_bb_for_insn, set_block_for_insn, + set_block_for_new_insns, split_block, merge_blocks_nomove, + block_label, try_redirect_by_replacing_jump, last_loop_beg_note, + redirect_edge_and_branch, force_nonfallthru_and_redirect, + force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge, + tidy_fallthru_edges, split_edge, insert_insn_on_edge, + commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb, + debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges, + purge_all_dead_edges): Move to .... + * cfgrtl.c: New file; .... Here. + + * bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block. + (reroder_basic_block): Use alloc_aux_for_blocks. + * predict.c (estimate_bb_frequencies): Likewise; use + alloc_aux_for_edges. + * profile.c (compute_branch_probabilities): Likewise. + (branch_prob): Likewise. + * reg-stack.c (reg_to_stack): Likewise. + + * emit-rtl.c (emit_insns_after): Never return NULL. + + * basic-block.h (set_block_for_new_insns): Delete. + * cfgrtl.c (set_block_for_new_insns): Delete. + + * cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn + calls when crossjumping. + + * cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call. + * unroll.c (copy_loop_body): Use delete_insn. + + * final.c (final, final_scan_insn): Use delete_insn/delete_note. + * function.c (fixup_var_refs_insn, fixup_var_refs_1, + keep_stack_depressed): Likewise. + * gcse.c (cprop_cc0_jump): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * loop.c (scan_loop, loop_delete_insns): Likewise. + * regmove.c (try_auto_increment, fixup_match_1): Likewise. + * reload1.c (reload, calculate_needs_all_insns, reload_as_needed, + delete_output_reload, delete_address_reloads_1, + reload_cse_delete_noop_set, reload_combine, reload_cse_move2add): + Likewise. + * sibcall.c (replace_call_placeholder): Likewise. + * cse.c (cse_insn): Likewise. + +2001-09-25 Bernd Schmidt + + From Graham Stott + (def_builtin): Only define builtins appropriate for target_flags. All + callers changed. + (builtin_decsription): Add new field mask which is used to determine + when to define the builtin via the macro def_builtin. + + (bdesc_comi): Initialize new mask fields. + (bdesc_2srg): Likewise. + (bdesc_1arg): Likewise. + + * config/i386/i386.c (ix86_init_builtins): Correct return type + building v4hi_ftype_v4hi_int_int tree node. + (ix86_expand_sse_comi): Fix typo swapping operands. + Don't swap comparison condition, it is already swapped. + (ix86_expand_sse_compare): Before swapping operands + move operand 1 into new rtx and not the target rtx. + Don't swap comparison condition, it is already swapped. + Always check whether we need to create a new TARGET. + + * config/i386/i386.md: (sse_comi) Fix typos. + (sse_ucomi): Likewise. + (cvtss2si): Fix operand 0 contraint. + (cvttss2si): Likewise. + (sse_unpckhps): Fix mode for operand 2. + (sse_unpcklps): Likewise. + +2001-09-25 Graham Stott + + * sibcall.c (skip_copy_to_return_value): Tighten return value + copy check. + +2001-09-24 David Edelsohn + + * rs6000.c (lwa_operand): Address must be word aligned. + +Mon Sep 24 18:57:59 2001 Richard Kenner + + * tree.c (type_hash_marked_p): Consider as marked if debug symbol + number has been set. + (type_hash_mark): Mark type itself. + +2001-09-24 Neil Booth + + * c-lex.c (cb_def_pragma): Update. + (c_lex): Update, and skip padding. + * cppexp.c (lex, parse_defined): Update, remove unused variable. + * cpphash.h (struct toklist): Delete. + (union utoken): New. + (struct cpp_context): Update. + (struct cpp_reader): New members eof, avoid_paste. + (_cpp_temp_token): New. + * cppinit.c (cpp_create_reader): Update. + * cpplex.c (_cpp_temp_token): New. + (_cpp_lex_direct): Add PREV_WHITE when parsing args. + (cpp_output_token): Don't print leading whitespace. + (cpp_output_line): Update. + * cpplib.c (glue_header_name, parse_include, get__Pragma_string, + do_include_common, do_line, do_ident, do_pragma, + do_pragma_dependency, _cpp_do__Pragma, parse_answer, + parse_assertion): Update. + (get_token_no_padding): New. + * cpplib.h (CPP_PADDING): New. + (AVOID_LPASTE): Delete. + (struct cpp_token): New union member source. + (cpp_get_token): Update. + * cppmacro.c (macro_arg): Convert to use pointers to const tokens. + (builtin_macro, paste_all_tokens, paste_tokens, funlike_invocation_p, + replace_args, quote_string, stringify_arg, parse_arg, next_context, + enter_macro_context, expand_arg, _cpp_pop_context, cpp_scan_nooutput, + _cpp_backup_tokens, _cpp_create_definition): Update. + (push_arg_context): Delete. + (padding_token, push_token_context, push_ptoken_context): New. + (make_string_token, make_number_token): Update, rename. + (cpp_get_token): Update to handle tokens as pointers to const, + and insert padding appropriately. + * cppmain.c (struct printer): New member prev. + (check_multiline_token): Constify. + (do_preprocessing, cb_line_change): Update. + (scan_translation_unit): Update to handle spacing. + * scan-decls.c (get_a_token): New. + (skip_to_closing_brace, scan_decls): Update. + * fix-header.c (read_scan_file): Update. + + * doc/cpp.texi: Update. + +2001-09-24 Kaveh R. Ghazi + + * c-aux-info.c (affix_data_type): Use ATTRIBUTE_MALLOC. Avoid + leak by passing malloc'ed pointer to reconcat, not concat. + +2001-09-24 DJ Delorie + + * varasm.c (array_size_for_constructor): Handle STRING_CSTs also. + +2001-09-24 Ulrich Weigand : + + * flow.c (delete_dead_jumptables): Delete jumptable if the only + reference is from the literal pool. + +2001-09-24 Janis Johnson + + * doc/install.texi (Final install): Request additional information + in mail about successful builds. + +2001-09-24 John David Anglin + + * pa.c (return_addr_rtx): Return NULL_RTX if count is not zero. Use + initial value of return pointer register instead of value in frame-20. + Revise comments. + +2001-09-24 John David Anglin + + * som.h (ASM_OUTPUT_EXTERNAL): Improve formatting. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Only generate a .IMPORT statement for + the libcall if there isn't a referenced identifier for the symbol. + +2001-09-24 John David Anglin + + * pa.h (TRAMPOLINE_TEMPLATE): Add two words to the template for + non 64-bit machines. Use these as a plabel for the trampoline. + (TRAMPOLINE_SIZE): Adjust size for new words. + (INITIALIZE_TRAMPOLINE): Initialize new words. + (TRAMPOLINE_ADJUST_ADDRESS): New. Adjust address to make it a + pointer to the plabel in the trampoline. + +2001-09-24 John David Anglin + + * pa.c (function_arg): Pass floating arguments in both general and + floating registers in indirect (dynamic) calls when generating code + for the 32 bit ABI and the HP assembler. + +2001-09-24 Rainer Orth + + * doc/install.texi: Markup fixes. + Use Solaris 2, SunOS 4 as appropriate. + (Specific, *-*-solaris2*): Explain this. + Unconditionally warn against /usr/ucb tools. + Remove Sun as warning, obsolete. + Move X11 header bug workaround here, update patches. + (Specific, sparc-sun-solaris2*): Detail Sun as fix status. + (Specific, sparc-sun-solaris2.7): Update patch 106950 status. + +2001-09-23 Zack Weinberg + + * errors.h (warning, error, fatal, internal_error): Don't mark + with ATTRIBUTE_PRINTF_n. + * toplev.h (internal_error, fatal_io_error, warning, error, + pedwarn, pedwarn_with_file_and_line, warning_with_file_and_line, + error_with_file_and_line, sorry, error_for_asm, warning_for_asm): + Likewise. + +Sun Sep 23 18:19:48 2001 Richard Kenner + + * function.c (pop_function_context_from): var_refs_queue + and temp slots now in GC memory. + (mark_function_status, free_after_compilation): Likewise; + also struct function now in GC memory. + (assign_stack_temp_for_type): struct temp_slot now in GC memory. + (combine_temp_slots): Likewise. + (schedule_fixup_var_refs): var_refs_queue now in GC memory. + (prepare_function_start): Use GC memory for struct function. + (mark_temp_slot): Deleted. + (gcc_mark_struct_function): struct function now in GC memory. + + * fold-const.c (extract_muldiv, case PLUS_EXPR): Only adjust + code for division, not modulus. + + * rtl.def (MEM): Remove obsolete part of comment. + +2001-09-22 Joseph S. Myers + + * c-format.c (init_function_format_info): Check __builtin_printf + and __builtin_fprintf even if -ffreestanding. Check C99 functions + in gnu89 mode. + +Sat Sep 22 09:09:32 2001 Richard Kenner + + * c-common.c (format_attribute_table): Remove decl. + * tree.h (format_attribute_table, lang_attribute_table): New decls. + (lang_attribute_common): Likewise. + + * function.c (fix_lexical_address): Use set_mem_alias_set. + (expand_function_start): Likewise. + * config/alpha/alpha.h (SETUP_INCOMING_VARARGS): Likewise. + + * varasm.c (output_constant): Fix unused variable warning. + + * attribs.c: New file, from c-common.c. + (attribute_tables): Now four elements. + (format_attribute_table, lang_attribute_common): New variables. + (init_attributes): Reflect above changes. + (handle_mode_attribute): Delete check for wider than uintmax. + * c-common.c: Delete parts moved to attribs.c. + (enum attrs): Deleted; unused. + (c_format_attribute_table): New variable. + (c_common_lang_init): Initialize format_attribute_table with it. + * c-common.h (decl_attributes): Remove decl. + * tree.h (decl_attribute): Move it to here. + * Makefile.in (C_AND_OBJS_OBJS): Add attribs.o. + (attribs.o): New rule. + +2001-09-22 Andreas Jaeger + + * builtins.c (c_getstr): Remove unused variable. + +2001-09-21 Richard Henderson + + * reload1.c (reload): Use delete_insn instead of splatting + NOTE_INSN_DELETED. + +2001-09-21 Richard Henderson + + * reload.c (push_secondary_reload): Don't check for "=" in output + constraint after ""->ALL_REGS check. + +2001-09-21 Richard Henderson + + * predict.c (expected_value_to_br_prob): Use pc_set. + + * optabs.c (init_one_libfunc): Gen a FUNCTION_DECL for use by + ENCODE_SECTION_INFO; get SYMBOL_REF from make_decl_rtl. + +2001-09-21 Richard Henderson + + * rtl.h (LCT_RETURNS_TWICE): New. + * calls.c (emit_call_1): Set current_function_calls_setjmp for + ECF_RETURNS_TWICE. + (emit_library_call_value_1): Map LCT_RETURNS_TWICE + to ECF_RETURNS_TWICE. + * except.c (sjlj_emit_function_enter): Use LCT_RETURNS_TWICE for + call to setjmp. + + * unwind-sjlj.c: Invent the setjmp.h declarations if inhibit_libc. + + * config/stormy16/stormy16.h (DONT_USE_BUILTIN_SETJMP): New. + (JMP_BUF_SIZE): New. + +2001-09-21 Richard Henderson + + * config/stormy16/stormy16.h (REG_CLASS_FROM_LETTER): Map 'd' + to R8_REGS. + +2001-09-21 Richard Henderson + + * tree.def (FDESC_EXPR): New. + * expr.c (expand_expr): Handle it. + * varasm.c (initializer_constant_valid_p): Likewise. + (output_constant): Likewise. + * defaults.h (TARGET_VTABLE_USES_DESCRIPTORS): New. + * config/ia64/ia64.h (TARGET_VTABLE_USES_DESCRIPTORS): New. + (ASM_OUTPUT_FDESC): New. + * doc/tm.texi: Document the new macros. + +2001-09-21 Richard Earnshaw (reanrsha@arm.com) + + * cfgcleanup.c (merge_blocks_move_successor_nojumps): Don't leave + ADDR_VEC or ADDR_DIFF_VEC jump insns as part of the basic block + once merging is complete. + +Fri Sep 21 11:20:12 2001 Richard Kenner + + * integrate.c (allocate_initial_values): Eliminate unused arg warning. + +2001-09-21 Richard Earnshaw (reanrsha@arm.com) + + * cfgcleanup.c (flow_find_cross_jump): Delete any REG_EQUAL notes + that would be invalid after a merge. + +Fri Sep 21 14:24:29 CEST 2001 Jan Hubicka + + * basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill. + * cfg.c (delete_insn): Rename from ....; use remove_insn; do not + remove some labels. + (flow_delete_insn): This one. + (delete_insn_chain): Rename from ...; do not care labels. + (flow_delete_insn_chain): ... this one. + (flow_delete_block): Remove the insns one BB has been expunged. + (merge_blocks_nomove): Likewise. + (try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care + updating BB boundaries. + (tidy_fallthru_edge): Likewise. + (commit_one_edge_insertion): Likewise. + * cfgbuild.c (find_basic_block): Likewise. + (find_basic_blocks_1): Likewise. + * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise. + (try_crossjump_to_edge): Likewise. + (try_optimize_cfg): Likewise. + * cse.c (delete_trivially_dead_insns): Likewise. + * df.c (df_insn_delete): Likewise. + * doloop.c (doloop_modify): Use delete_related_insns. + * emit-rtl.c (try_split): Likewise. + (remove_insn): Update BB boundaries. + * expect.c (connect_post_landing_pads): Use delete_related_insns. + * flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care + updating BB boundaries. + (propagate_block_delete_insn): Likewise. + (propagate_block_delete_libcall): Likewise. + * function.c (delete_handlers): Use delete_related_insns. + (thread_prologue_and_epilogue_insns): Likewise. + * gcse.c (delete_null_pointer_checks): Use delete_related_insns. + * genpeep.c (gen_peephole): Use delete_related_insns. + * ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating + BB boundaries. + (find_cond_trap): Likewise. + * integrate.c (save_for_inline): Use delete_related_insns. + (copy_insn_list): Likewise. + * jump.c (pruge_linie_number_notes): Likewise. + (duplicate_loop_exit_test): Likewise. + (delete_computation): Likewise. + (delete_related_insn): Rename from ...; use delete_insn + (delete_insn): ... this one. + (redirect_jump): Use delete_related_insns. + * loop.c (scan_loop): Likewise. + (move_movables): Likewise. + (find_and_verify_loops): Likewise. + (check_dbra_loop): Likewise. + * recog.c (peephole2_optimize): Likewise. + * reg-stack.c (delete_insn_for_stacker): Remove. + (move_for_stack_reg): Use delete_insn. + * regmove.c (combine_stack_adjustments_for_block): Likewise. + * reload1.c (delete_address_reloads): Use delete_related_insns. + (fixup_abnormal_edges): Use delete_insn. + * recog.c (emit_delay_sequence): Use delete_related_insns. + (delete_from-delay_slot): Likewise. + (delete_scheduled_jump): likewise. + (optimize_skip): Likewise. + (try_merge_delay_insns): Likewise. + (full_simple_delay_slots): Likewise. + (fill_slots_from_thread): Likewise. + (relax_delay_slots): Likewise. + (make_return_insns): Likewise. + (dbr_schedule): Likewise. + * rtl.h (delete_insn): Rename to delete_related_insns. + (delete_insn, delete_insn_chain): New prototypes. + * ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done + by df_insn_delete already. + * ssa-dce.c (delete_insn_bb): Use delete_insn. + * ssa.c (convert_from_ssa): Use delete_related_insns. + * unroll.c (unroll_loop): Likewise. + (calculate_giv_inc): Likewise. + (copy_loop_body): Likewise. + + * i386-protos.h (ix86_libcall_value, ix86_function_value, + ix86_function_arg_regno_p, ix86_function_arg_boundary, + ix86_return_in_memory, ix86_function_value): Declare. + * i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers): + new static valurables. + (x86_64_reg_class): New enum + (x86_64_reg_class_name): New array. + (classify_argument, examine_argument, construct_container, + merge_classes): New static functions. + (optimization_options): Enable flag_omit_frame_pointer and disable + flag_pcc_struct_return on 64bit. + (ix86_libcall_value, ix86_function_value, + ix86_function_arg_regno_p, ix86_function_arg_boundary, + ix86_return_in_memory, ix86_function_value): New global functions. + (init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg. + (function_arg_advance): Handle x86_64 passing conventions. + (function_arg): Likewise. + * i386.h (FUNCTION_ARG_BOUNDARY): New macro. + (RETURN_IN_MEMORY): Move offline. + (FUNCTION_VALUE, LIBCALL_VALUE): Likewise. + (FUNCTION_VALUE_REGNO_P): New macro. + (FUNCTION_ARG_REGNO_P): Move offline. + (struct ix86_args): Add maybe_vaarg. + * next.h (FUNCTION_VALUE_REGNO_P): Delete. + * unix.h (FUNCTION_VALUE_REGNO_P): Delete. + +2001-09-21 Hartmut Penner + + * s390.md: Changed attributes for scheduling. + * s390.c: (s390_adjust_cost, s390_adjust_priority) + Changed scheduling + +2001-09-21 Joseph S. Myers + + Table-driven attributes. + * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, + config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, + config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, + config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, + config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, + config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, + doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, + tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. + * tree.h (struct tree_decl): Change machine_attributes to + attributes. + * doc/c-tree.texi: Document that all attributes are now attached + to decls and types. + * c-common.c (add_attribute, attrtab, attrtab_idx, + default_valid_lang_attribute, valid_lang_attribute): Remove. + (attribute_tables, attributes_initialized, + c_common_attribute_table, default_lang_attribute_table): New + variables. + (handle_packed_attribute, handle_nocommon_attribute, + handle_common_attribute, handle_noreturn_attribute, + handle_unused_attribute, handle_const_attribute, + handle_transparent_union_attribute, handle_constructor_attribute, + handle_destructor_attribute, handle_mode_attribute, + handle_section_attribute, handle_aligned_attribute, + handle_weak_attribute, handle_alias_attribute, + handle_no_instrument_function_attribute, + handle_no_check_memory_usage_attribute, handle_malloc_attribute, + handle_no_limit_stack_attribute, handle_pure_attribute): New + functions. + (init_attributes, decl_attributes): Rewrite to implement + table-driven attributes. + * c-common.h (enum attribute_flags): Move to tree.h. + * c-format.c (decl_handle_format_attribute, + decl_handle_format_arg_attribute): Rename to + handle_format_attribute and handle_format_arg_attribute. Update + for table-driven attributes. + * c-common.h (decl_handle_format_attribute, + decl_handle_format_arg_attribute): Remove prototypes. + (handle_format_attribute, handle_format_arg_attribute): Add + prototypes. + * c-decl.c (grokdeclarator): Handle attributes nested inside + declarators. + * c-parse.in (setattrs, maybe_setattrs): Remove. + (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. + Update to handle nested attributes properly. + (maybe_resetattrs, after_type_declarator, + parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, + absdcl1_ea, direct_absdcl1): Update to handle nested attributes + properly. + (make_pointer_declarator): Update to handle nested attributes + properly. + * doc/extend.texi: Update documentation of limits of attributes + syntax. Warn about problems with attribute semantics in C++. + * target.h (struct target): Remove valid_decl_attribute and + valid_type_attribute. Add attribute_table and + function_attribute_inlinable_p. + * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, + TARGET_VALID_TYPE_ATTRIBUTE): Remove. + (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): + Add. + (TARGET_INITIALIZER): Update. + * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default + definition. + (function_attribute_inlinable_p): New function. Check for the + presence of any machine attributes before using + targetm.function_attribute_inlinable_p. + (function_cannot_inline_p): Update. + * Makefile.in (integrate.o): Update dependencies. + * doc/tm.texi: Update documentation of target attributes and + example definition of TARGET_VALID_TYPE_ATTRIBUTE. + * tree.c (default_valid_attribute_p, valid_machine_attribute): + Remove. + (default_target_attribute_table, + default_function_attribute_inlinable_p): New. + (lookup_attribute): Update comment to clarify handling of multiple + attributes with the same name. + (merge_attributes, attribute_list_contained): Allow multiple + attributes with the same name but different arguments to appear in + the same attribute list. + * tree.h (default_valid_attribute_p): Remove prototype. + (struct attribute_spec): New. + (default_target_attribute_table): Declare. + (enum attribute_flags): Move from c-common.h. Add + ATTR_FLAG_TYPE_IN_PLACE. + (default_function_attribute_inlinable_p): Declare. + * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (vms_attribute_table): New. + * config/arc/arc.c (arc_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (arc_attribute_table, arc_handle_interrupt_attribute): New. + * config/arm/arm.c (arm_valid_type_attribute_p, + arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): + Remove. + (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't + define. + (TARGET_ATTRIBUTE_TABLE): Define. + (arm_attribute_table, arm_handle_fndecl_attribute, + arm_handle_isr_attribute): New. + * config/avr/avr.c (avr_valid_type_attribute, + avr_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't + define. + (TARGET_ATTRIBUTE_TABLE): Define. + (avr_attribute_table, avr_handle_progmem_attribute, + avr_handle_fndecl_attribute): New. + * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (c4x_attribute_table, c4x_handle_fntype_attribute): New. + * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (h8300_attribute_table, h8300_handle_fndecl_attribute, + h8300_handle_eightbit_data_attribute, + h8300_handle_tiny_data_attribute): New. + * config/i386/i386-protos.h (ix86_valid_type_attribute_p, + i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): + Remove prototypes. + (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New + declarations. + * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. + (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't + define. + (TARGET_ATTRIBUTE_TABLE): Define. + (ix86_attribute_table, ix86_handle_cdecl_attribute, + ix86_handle_regparm_attribute): New. + * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, + i386_pe_valid_type_attribute_p): Remove. + (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. + * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (ia64_attribute_table): New. + * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, + interrupt_ident2, model_ident1, model_ident2): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (init_idents): Update. + (m32r_attribute_table, m32r_handle_model_attribute): New. + * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): + Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. + * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (mcore_attribute_table, mcore_handle_naked_attribute): New. + * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. + * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. + * config/sh/sh.c (sh_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (sh_attribute_table, sh_handle_interrupt_handler_attribute, + sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): + New. + * config/stormy16/stormy16.c (stormy16_valid_type_attribute): + Remove. + (TARGET_VALID_TYPE_ATTRIBUTE): Don't define + (TARGET_ATTRIBUTE_TABLE): Define. + (stormy16_attribute_table, stormy16_handle_interrupt_attribute): + New. + * config/v850/v850.c (v850_valid_decl_attribute): Remove. + (TARGET_VALID_DECL_ATTRIBUTE): Don't define. + (TARGET_ATTRIBUTE_TABLE): Define. + (v850_attribute_table, v850_handle_interrupt_attribute, + v850_handle_data_area_attribute): New. + * config/v850/v850-c.c (mark_current_function_as_interrupt): + Return void. Call decl_attributes instead of + valid_machine_attribute. + +Fri Sep 21 01:49:41 2001 J"orn Rennecke + + * sh-protos.h (sh_pr_n_sets): Declare. + * sh.c (calc_live_regs): If the initial value for PR has been copied, + look at the copy to determine if PR needs to be saved. + sh_pr_n_sets: New function. + * sh.h (RETURN_ADDR_RTX): Use get_hard_reg_initial_val. + (ALLOCATE_INITIAL_VALUE): Define. + + * sh.c (initial_elimination_offset): + Fix RETURN_ADDRESS_POINTER_REGNUM case. + +Fri Sep 21 01:13:56 2001 J"orn Rennecke + + * integrate.c (allocate_initial_values): New function. + * integrate.h (allocate_initial_values): Declare. + * local-alloc.c (local_alloc): Move call to allocate_reg_info from + here... + * reload1.c (reload): And initialization of reg_equiv_memory_loc + from here... + * toplev.c (rest_of_compilation): To here. + Call allocate_initial_values. + * tm.texi: add description for ALLOCATE_INITIAL_VALUE. + +Thu Sep 20 09:00:27 2001 Richard Kenner + + * ggc-page.c (ggc_marked_p): Properly convert return to boolean. + +2001-09-20 DJ Delorie + + * c-typeck.c (really_start_incremental_init): Discriminate + between zero-length arrays and flexible arrays. + (push_init_level): Detect zero-length arrays and handle them + like fixed-sized arrays. + * expr.c (store_constructor): Handle zero-length arrays and + flexible arrays correctly. + * doc/extend.texi: Update zero-length array notes. + +2001-09-20 Jim Wilson + + * config/ia64/ia64.c (itanium_split_issue): Allow max 2 FP per cycle. + (insn_matches_slot): Handle TYPE_L and TYPE_X slots when checking + for issue port conflicts. + (cycle_end_fill_slots): TYPE_L instructions take two slots. + +2001-09-20 Andrew MacLeod + + * testsuite/gcc.c-torture/execute/990208-1.x: New. XFAIL at -O3 + on ia64. + +Thu Sep 20 09:00:27 2001 Richard Kenner + + * fold-const.c (hashtab.h): Include. + (int_const_binop): Remove FORSIZE arg and compute from type; all + callers changed. + Call size_int_type_wide for all single-word constants. + (size_htab_hash, size_htab_eq): New functions. + (size_int_type_wide): Rework to use hash table. + * ggc-common.c (hashtab.h): Include. + (struct d_htab_root): New struct. + (d_htab_roots): New variable. + (ggc_add_deletable_htab, ggc_htab_delete): New functions + (ggc_mark_roots): Handle deletable htabs. + * ggc-page.c (ggc_marked_p): New function. + * ggc-simple.c (ggc_marked_p): Likewise. + * ggc.h: Reformatting throughout. + (ggc_marked_p, ggc_add_deletable_htab): New declarations. + * tree.c (init_obstacks): Make type_hash_table a deletable root. + (type_hash_add): Allocate struct type_hash from GC memory. + (mark_hash_entry, mark_type_hash): Deleted. + (type_hash_marked_p, type_hash_mark): New functions. + * Makefile.in (ggc-common.o, fold-const.o): Include hashtab.h. + +Thu Sep 20 12:49:34 2001 J"orn Rennecke + + * sh.c (shiftcosts): Don't use shiftcosts array for modes wider + than SImode. + +Thu Sep 20 09:00:27 2001 Richard Kenner + + * stor-layout.c (layout_type, case ARRAY_TYPE): Kludge to disable + array-too-large test for signed sizetype. + +Thu Sep 20 12:19:36 CEST 2001 Jan Hubicka + + * i386.md (indirect_jump): Allow Pmode operand. + (tablejump): LIkewise; perform expansion to 64bit mode. + * i386.c (symbolic_operand): Allow 64bit PIC references. + (pic_symbolic_operand): Likewise. + (ix86_find_base_term): Strip the 64bit PIC references. + (legitimate_pic_address_disp_p): Handle 64bit PIC. + (legitimize_pic_address): Likewise. + (i386_simplify_dwarf_addr): Strip down the 64bit PIC references. + * i386.h (CASE_VECTOR_MODE): Set to SImode for 64bit PIC compilation. + +2001-09-19 Alexandre Petit-Bianco + + * stringpool.c (get_identifier_with_length): New function. + * tree.h (get_identifier_with_length): New prototype. + +2001-09-19 Alan Modra + David Edelsohn + + Revert: + * config/rs6000/rs6000.c (logical_operand): CONST_INTs are + already sign-extended. + + * config/rs6000/aix.h (INIT_TARGET_OPTABS): Define TFmode handlers. + * config/rs6000/rs6000.c (logical_operand): Always compare op as + HOST_WIDE_INT. + (rs6000_emit_set_long_const): Avoid unnecessary shift. + (output_profile_hook): Declare label_name const. + * config/rs6000/rs6000.md (boolcsi3, boolcdi3): Change predicates + to match constraints. + +2001-09-19 Stan Shebs + + * alias.c: Fix typos in comments. + * sched-rgn.c (init_ready_list): Ditto. + * unwind-dw2.c (uw_frame_state_for): Ditto. + * unwind-dw2-fde.c (_Unwind_Find_FDE): Ditto. + * unwind.inc (_Unwind_RaiseException_Phase2): Ditto. + * config/rs6000/rs6000.c (rs6000_adjust_priority): Ditto. + +2001-09-19 Richard Henderson + + * cfg.c (force_nonfallthru_and_redirect): Handle redirecting + to the exit block. + * Makefile.in (cfg.o): Depend on TM_P_H. + +2001-09-19 Richard Henderson + + * config/alpha/alpha.c (local_symbol_p): Split out from ... + (local_symbolic_operand): ... here. + (small_symbolic_operand): Check mode. + (global_symbolic_operand): New. + (input_operand): Reject symbolics if explicit relocs. + (call_operand): Tidy. + (alpha_legitimize_address): Use movdi_er_high_g. + (alpha_expand_mov): Likewise. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + * config/alpha/alpha.md (UNSPEC_LITERAL, UNSPEC_LITUSE): New. + (UNSPEC_LDGP2, UNSPECV_PLDGP2): New. + (UNSPECV_LDGP2): Remove. + (all call patterns): Use 's' not 'i' for symbolic constraint. + (call_osf call_value_osf): Use call_operand. + (all osf call patterns): Use $gp. New peepholes for explicit relocs. + (movdi_er_nofix, movdi_er_fix): Remove symbolic alternative. + (prologue_ldgp_1_er): Remove. + (ldgp_er_1, ldgp_er_2, prologue_ldgp_er_2): New. + (builtin_setjmp_receiver_er patterns): Use them. + (exception_receiver_er): Likewise. + +2001-09-19 Richard Henderson + + * cfgbuild.c (find_sub_basic_blocks): Handle insns that can throw. + + * emit-rtl.c (try_split): Copy NORETURN, SETJMP, ALWAYS_RETURN + and NON_LOCAL_GOTO notes. + * recog.c (peephole2_optimize): Likewise. Handle EH_REGION; + copy over CALL_INSN_FUNCTION_USAGE. + +2001-09-18 Catherine Moore + + * config/stormy16/stormy16.h (DEFAULT_PCC_STRUCT_RETURN): + Define as 0. + +2001-09-18 Ulrich Weigand : + + * config.gcc (s390-*-linux-*, s390x-*-linux*): Switch to + new-style tm_file specification. Specify correct tm_p_file, + md_file, and out_file for s390x. + + * config/s390/linux.h, linux64.h: Don't include other target + macro header files. Now handled via tm_file. + + * config/s390/linux.h, s390.h: (IEEE_FLOAT, TARGET_IEEE_FLOAT, + TARGET_IBM_FLOAT): Move from linux.h to s390.h to ensure they + are defined before use. + +Tue Sep 18 09:51:11 2001 Eric Christopher + + * config/mips/mips.c (mips_asm_file_start): Conditionalize Elf + code generation only for Gnu assembler. + +2001-09-18 Catherine Moore + + * config/stormy16 (LIB_SPEC): Remove -lnosys. + +2001-09-18 Richard Sandiford + + * config/mips/mips.c (mips_frame_set): New. + (mips_emit_frame_related_store): When storing two 32-bit FPRs, use + a parallel frame-related expression with a set for each register. + +2001-09-18 Philip Blundell + + * config/arm/lib1funcs.asm (L_dvmd_lnx): Don't rely on kernel + header files. + +2001-09-17 Dale Johannesen + + * config/rs6000/rs6000.h (FIXED_REGISTERS): Use FIXED_R2. + * config/rs6000/aix.h (FIXED_R2): Define. + * config/rs6000/darwin.h (FIXED_R2): Define. + * config/rs6000/sysv4.h (FIXED_R2): Define. + +2001-09-17 Jeff Sturm + + * except.c (dw2_build_landing_pads): New local + clobbers_hard_regs. Emit an ASM_INPUT as a scheduling + barrier after clobbers. Fixes c++/4012. + +2001-09-17 Kaveh R. Ghazi + + * gcc.c (find_file): Use ACONCAT in lieu of alloca/strcpy/strcat. + +2001-09-17 Joseph S. Myers + + * dostage2, dostage3, listing, make-l2.com, makefile.vms, + patch-apollo-includes, vmsconfig.com: Remove obsolete files. + +2001-09-17 Kaveh R. Ghazi + + * c-aux-info.c (affix_data_type): Use ASTRDUP in lieu of + alloca/strcpy. + +2001-09-17 Neil Booth + + * cpphash.h (_cpp_lex_direct): New. + * cpplex.c (_cpp_lex_token): Update. + (lex_token): Rename _cpp_lex_direct; lex into pfile->cur_token, + and increment that pointer. + * cppmacro.c (alloc_expansion_token): New. + (lex_expansion_token): Lex macro expansion directly into + macro storage. + +2001-09-16 Brad Lucier + + * Makefile.in: Make rtl-error.o depend on $(CONFIG_H). + +Sun Sep 16 21:59:46 CEST 2001 Jan hubicka + + * basic-block.h (free_bb_for_insn): Declare. + * bb-reorder.c (label_for_bb): Use block_label. + (emit_jump_to_block_after): Remove. + (insert_intra_1): Do not update block_for_insn. + (insert_inter_bb_scope_notes): Likewise; update bb->end + * cfg.c (free_bb_for_insn): New. + (try_rediret_by_replacing_jump): Avoid set_block_for_new_insns call. + (force_nonfallthru_and_redirect): Likewise; do not update BB boundaries. + (commit_one_edge_insertion): Likewise. + (commit_one_edge_insertion): Do not update BB boundary. + (commit_edge_insertions): Do not call compute_bb_for_insn. + * cfgbuild.c (find_basic_blocks): Do not free basic_block_for_insn. + * cfgcleanup.c (merge_blocks_move_predecessor): Use reorder_insns_nobb. + (merge_blocks_move_successor_nojumps): Likewise. + (try_crossjump_to_edge): Do not update block_for_insn. + * combine.c (combine_instructions): Remove compute_bb_for_insn call. + * df.c (df_pattern_emit_later): Do not update BB boundary. + (df_jump_pattern_emit_after): Likewise. + (df_insn_move_before): Use emit_insn_before. + * emit-rtl.c (try_split): Emit after trial to get bb boundary updated + properly. + (add_insn_after, add_insn_before, emit_insns_after): Update BB + boundaries and basic_block_for_insn. + (reorder_insns_nobb): Rename from reorder_insns. + (reorder_insns): New. + (emit_block_insn_before, emit_block_insn_after): Kill. + * flow.c (check_function_return_warnings): Do not call + compute_bb_for_insn; Do not free basic_block_for_insn. + (attempt_auto_inc): Do not update basic_block_for_insn. + * function.c (emit_return_into_block): Likewise; + do not update BB boundaries. + * gcse.c (handle_avail_expr): Do not update basic_block_for_insn. + (insert_insn_end_bb): Use emit_insn_before; Likewise. + (pre_insert_copy_insn): Likewise. + (update_ld_motion_notes): Likewise. + (insert_insn_start_bb): Likewise. + (replace_store_insn): Likewise. + * ifcvt.c (noce_process_if_block): Likewise. + (if_convert): Do not call compute_bb_for_insn. + * lcm.c (optimize_mode_switching): Do not update BB boundaries. + Use emit_insn_before and emit_insn_after. + * recog.c (split_all_insns): Do not update BB boundaries; + Do not call compute_bb_for_insn. + (peephole2_optimize): Do not update BB boundaries. + * reg-stack.c (emit_pop_insn): Use emit_insn_after and + emit_insn_before. + (emit_swap_insn): Likewise. + (convert_regs_1): Likewise. + * reload1.c (reload): Call compute_bb_for_insn. + * rtl.h (reorder_insns_nobb): Declare. + * ssa.c (rename_equivalent_regs): Use emit_insn_before. + * toplev.c (rest_of_compilation): Call free_bb_for_insn + at places CFG is invalidated; do not call compute_bb_for_insn. + + * cfg.c (expunge_block): Invalidate BB structure. + + * (merge_blocks_nomove): Update properly BLOCK_FOR_INSN + array. + + * cfg.c (verify_flow_info): Verify the basic_block_for_insn array. + +2001-09-16 Neil Booth + + * cpphash.h (_cpp_lex_token): Update prototype. + * cpplex.c (_cpp_lex_token): New prototype. + * cpplib.c (skip_rest_of_line, check_eol, _cpp_handle_directive, + lex_macro_node, read_flag, do_pragma_poison): Update. + * cppmacro.c (cpp_get_token, parse_params, + lex_expansion_token): Update. + +2001-09-16 Neil Booth + + * cppmain.c (scan_translation_unit): Don't worry about + putting a space after hashes. + * cpplib.c (directive_diagnostics): New. + (_cpp_handle_directive): Update to use directive_diagnostics. + (run_directive): Don't toggle prevent_expansion. + (do_line): Backup in case of the line extension. + * cpplib.h (cpp_lexer_pos): Remove. + * cppmacro.c (_cpp_create_definition): Precede a leading # + with whitespace. + +2001-09-15 Richard Henderson + + * c-typeck.c (comptypes): Handle zero-length arrays properly. + +2001-09-15 Roman Lechtchinsky + + * c-common.c (c_promoting_integer_type_p): Handle ?Imode types. + +2001-09-15 Neil Booth + + PR preprocessor/3571 + * tradcpp.c (handle_directive): Skip non-vertical space. + +2001-09-15 Neil Booth + + * cppmain.c (setup_callbacks): Set line callback only + if outputting preprocessed source. + +2001-09-15 Kaveh R. Ghazi + + * collect2.c (main): Const-ification. + * gcc.c (translate_options, process_command): Use xstrdup in + lieu of xmalloc/strcpy. + (main): Use concat in lieu of xmalloc/strcpy/strcat. + +2001-09-14 Roman Lechtchinsky + + * doc/install.texi (Specific, alphaev5-cray-unicosmk*): Fix + example. + +2001-09-15 Neil Booth + + * scan-decls.c (scan_decls): Fix typo. + +2001-09-15 Neil Booth + + * cpphash.h (struct cpp_reader): Remove lexer_pos, directive_pos. + Split mlstring_pos into mls_line and mls_col. + * cppinit.c (cpp_create_reader): Initialize line to 1. + (cpp_destroy): Free tokenruns. + (push_include): Don't update lexer_pos. + * cpplex.c (unterminated, parse_string): Update. + (lex_token): Don't update lexer_pos, update. + * cpplib.c (if_stack): Save line instead of line + col. + (start_directive, _cpp_do__Pragma, do_else, do_elif, + push_conditional, _cpp_pop_buffer): Update. + * cppmacro.c (funlike_invocation_p): Don't save lexer_pos. + (_cpp_create_definition): Update. + +2001-09-15 Eric Christopher + + * config/mips/abi64.h: Add support for MEABI. + +2001-09-15 Eric Christopher + + * config/mips/mips.md: Add unspec #2. + (reload_indi): Use. + (reload_outdi): Ditto. + (reload_outsi): Ditto. + (HILO_delay): New. + +2001-09-15 Eric Christopher + Jason Eckhardt + + * config.gcc: Add mipsisa32 target and mipsisa32-linux target. + * config/mips/isa32-linux.h: New file. + * config/mips/isa3264.h: Ditto. + * config/mips/mips-protos.h: Add mips_hard_regno_nregs. + * config/mips/mips.c (mips_hard_regno_nregs): Move here from mips.h. + (output_block_mode): Support MEABI. + (function_arg): Ditto. Fix floating point arg passing. + (mips_va_start): Ditto. + (override_options): Add isas 32 and 64, meabi, mips32 and mips64 + processors. + (mips_asm_file_start): Add new section to pass abi to gdb. + (function_arg_pass_by_reference): Support MEABI. + (mips_parse_cpu): Support mips32 and mips64 processors. + * config/mips/mips.h: Support ABI_MEABI, TARGET_MIPS4KC, + TARGET_MIPS5KC. Support isa32 and isa64. + (processor_type): Add r4kc, r5kc, r20kc. + (GENERATE_MULT3_SI): New. + (GENERATE_MULT3_DI): Ditto. + (GENERATE_MULT3): Remove. + (ISA_HAS_64BIT_REGS): Add isa == 64. + (ISA_HAS_8CC): Add mips_isa = 32 and 64. + (ISA_HAS_MADD_MSUB): New. + (ISA_HAS_CLZ_CLO): Ditto. + (ISA_HAS_DCLZ_DCLO): Ditto. + (ABI_GAS_ASM_SPEC): New. + (GAS_ASM_SPEC): Use. Add support for mips32, mips64. + (ASM_SPEC): Ditto. + (LINK_SPEC): Ditto. + (SUBTARGET_CC1_SPEC): Ditto. + (SUBTARGET_CPP_SIZE_SPEC): Ditto. + (PAD_VARARGS_DOWN): Support MEABI. + (HARD_REGNO_NREGS): Move to mips.c. + (ASM_OUTPUT_IDENT): Add #undef. + * config/mips/mips.md: Add r4kc, r5kc, r20kc. + (mulsi3): Use GENERATE_MULT3_SI. + (mulsi3_mult3): Ditto. Support mips32, mips64. + (mul_acc_si): Use ISA_HAS_MADD_MSUB. + (mul_sub_si): New pattern. + (unnamed splitters): New. + (muldi3): Use GENERATE_MULT3_DI. + (muldi3_internal2): Ditto. + (movdicc): Support mips32. + * config/mips/t-isa3264: New file. + +2001-09-15 Hans-Peter Nilsson + + * rtl.h (FIND_REG_INC_NOTE) [HAVE_PRE_INCREMENT + || HAVE_PRE_DECREMENT || HAVE_POST_INCREMENT + || HAVE_POST_DECREMENT]: Call find_regno_note for REGs. + + * reorg.c (fill_slots_from_thread): After call to + steal_delay_list_from_target, update own_thread as new_thread may + have branched. + +2001-09-14 Neil Booth + + * cpperror.c (print_location): Take line and column, for + default positioning use the previously lexed token. + (_cpp_begin_message): Take line and column. + (cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning, + cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update. + * cpphash.h (_cpp_begin_message): Update prototype. + * cppinit.c (push_include): Don't set output line. + * cpplex.c (_cpp_lex_token): Callback for start of new output lines. + * cpplib.c (do_diagnostic, _cpp_pop_buffer): Update. + (do_pragma): Kludge for front ends. Don't expand macros at all. + * cpplib.h (cpp_lookahead, cpp_token_with_pos, cpp_get_line): Remove. + (struct cpp_token): Remove output_line. + (struct cpp_callbacks): New member line_change. + * cppmacro.c (builtin_macro, paste_all_tokens, replace_args, + cpp_get_token): Preserve BOL flag. + (cpp_get_line): Remove. + (_cpp_backup_tokens): Remove useless abort(). + * cppmain.c (cb_line_change): New. + (scan_translation_unit): Don't worry about starting new lines here. + * scan-decls.c (scan_decls): Update. + * c-lex.c (c_lex, init_c_lex): Update. + (cb_line_change, src_lineno): New. + +Fri Sep 14 13:54:50 EDT 2001 John Wehle (john@feith.com) + + * tree.c (append_random_chars): Generate the random + characters in a reproducable fashion. + +2001-09-14 Richard Henderson + + * config/i386/i386.c (internal_label_prefix): New. + (internal_label_prefix_len): New. + (override_options): Set them. + (local_symbolic_operand): New. + (legitimate_pic_address_disp_p): Use it. + (legitimize_pic_address): Likewise. + +2001-09-14 Marc Espie + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Generate reference to GOT + correctly. + +2001-09-14 Roman Lechtchinsky + + * config/alpha/alpha.md (unaligned_extendhidi_be): Fix. + * config/alpha/unicosmk.h (INIT_TARGET_OPTABS): New. + +2001-09-14 Nick Clifton + + * rtlanal.c (subreg_regno_offset): Add semicolon to end of + invocation of SUBREG_REGNO_OFFSET. + + * haifa-sched.c: Fix typo in FSF copyright statement. + * sched-deps.c: Fix typo in FSF copyright statement. + * sched-ebb.c: Fix typo in FSF copyright statement. + * sched-rgn.c: Fix typo in FSF copyright statement. + * sched-vis.c: Fix typo in FSF copyright statement. + + * config.gcc: Move inclusion of arm elf specific header files + from the files themselves into the tm_file variable. Make + sure that elfos.h is included before target specific elf + headers. + * config/arm/aout.h (NO_DOLLAR_IN_LABEL): Only define if not + already defined. + (ASM_OUTPUT_ASCII, ASM_OUTPUT_SKIP): Protect definition. + * config/arm.arm.h (TARGET_MEM_FUNCTIONS, + ASM_OUTPUT_CASE_LABEL): Protect definition. + (CC1_SPEC, FP_DEFAULT, ARM_FUNCTION_PROFILE): Only define if + not already defined. + * config/arm/conix-elf.h: (USER_LABEL_PREFIX, + LOCAL_LABEL_PREFIX, MAKE_DECL_ONE_ONLY, UNIQUE_SECTION): + Remove duplicate definition. + (READONLY_DATA_SECTION, SUBTARGET_EXTRA_SECTION, + (SUBTARGET_EXTRA_SECTION_FUNCTION, RDATA_SECTION_ASM_OP, + (RDATA_SECTION_FUNCTION): Remove redundant definition. + (STARTFILE_SPEC, ENDFILE_SPEC): Protect definition. + Remove inclusion of arm/elf.h. + * config/arm/unknown-elf.h: as for conix-elf.h. + (STARTFILE_SPEC): Include crti.o and crtn.o. + * config/arm/linux-elf.h: as for conix-elf.h. + * config/arm/ecos-elf.h: Remove inclusion of unknown-elf.h. + * config/arm/strongarm-elf.h: Remove inclusion of + unknown-elf.h. + * config/arm/xscale-elf.h: Remove inclusion of unknown-elf.h. + * config/arm/unknown-elf-oabi.h: Remove inclusion of + unknown-elf.h and elf.h. + * config/arm/uclinux-elf.h: Remove inclusion of linux-elf.h. + * config/arm/linux-gas.h (DBX_DEBUGGING_INFO, + ASM_WEAKEN_LABEL): Remove redundant definition. + * config/arm/elf.h: Test for inclusion of elfos.h + (USER_LABEL_PREFIX, ASM_DECLARE_RESULT, ASM_DECLARE_RESULT, + ASM_DECLARE_OBJECT_NAME, ASM_FINISH_DECLARE_OBJECT_NAME, + SUBTARGET_EXTRA_SECTION, SUBTARGET_EXTRA_SECTION_FUNCTION, + EXTRA_SECTIONS, INT_ASM_OP, ASM_WEAKEN_LABEL): Remove + redundant definition. + (TYPE_OPERAND_FMT, ASM_DECLARE_FUNCTION_NAME, + ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_INTERNAL_LABEL, + ASM_OUTPUT_ALIGNED_COMMON): Protect definition. + * t-arm-elf (EXTRA_MULTILIB_PARTS): Add crti.o and crtn.o. + Add rules to build crti.o and crtn.o + * crti.asm: New file. + * crtn.asm: New file. + +2001-09-13 Neil Booth + + * c-parse.in (_yylex): Use _cpp_backup_tokens. + * cpphash.h (struct tokenrun): Add prev. + (struct lexer_state): Remove bol. + (struct cpp_reader): Remove old lookahead stuff, add lookaheads. + (_cpp_free_lookaheads, _cpp_release_lookahead, _cpp_push_token) + : Remove. + * cppinit.c (cpp_create_reader): Don't set bol. + (cpp_destroy): Don't free lookaheads. + * cpplex.c (lex_directive): Remove. + (next_tokenrun): Update. + (_cpp_lex_token): Clean up logic. + (lex_token): Update to return a pointer to lexed token, since it + can move to the start of the buffer. Simpify newline handling. + * cpplib.c (SEEN_EOL): Update. + (skip_rest_of_line): Remove lookahead stuff. + (end_directive): Line numbers are already incremented. Revert + to start of lexed token buffer if we can. + (_cpp_handle_directive, do_pragma, do_pragma_dependency, + parse_answer): Use _cpp_backup_tokens. + (run_directive, cpp_pop_buffer): Don't set bol, set saved_flags + instead. Don't check for EOL. + (do_include_common, do_line, do_pragma_system_header): Use + skip_rest_of_line. + * cpplib.h (BOL, _cpp_backup_tokens): New. + * cppmacro.c (save_lookahead_token, take_lookahead_token, + alloc_lookahead, free_lookahead, _cpp_free_lookaheads, + cpp_start_lookahead, cpp_stop_lookahead, _cpp_push_token): Remove. + (builtin_macro): Don't use cpp_get_line. + (cpp_get_line): Short term kludge. + (parse_arg): Handle directives in arguments here. Back up when + appropriate. Store EOF at end of argument list. + (funlike_invocation_p): Use _cpp_backup_tokens. + (push_arg_context): Account for EOF at end of list. + (cpp_get_token): Remove lookahead stuff. Update. + +2001-09-13 Kaveh R. Ghazi + + * c-parse.in (yyerror): Const-ification and/or static-ization. + * c-typeck.c (push_member_name): Likewise. + * collect2.c (main): Likewise. + * dbxout.c (dbxout_parms): Likewise. + * diagnostic.c (format_with_decl): Likewise. + * dwarf2out.c (output_ranges): Likewise. + * dwarfout.c (fundamental_type_code): Likewise. + * except.c (dw2_output_call_site_table): Likewise. + * gcc.c (do_spec_1): Likewise. + * genopinit.c (optabs): Likewise. + * objc/objc-act.c (synth_id_with_class_suffix, start_class, + gen_declaration_1, handle_impent): Likewise. + * protoize.c (default_include, in_system_include_dir, abspath): + Likewise. + * sched-vis.c (visualize_stall_cycles): Likewise. + * sdbout.c (plain_type_1, sdbout_end_function, + sdbout_end_epilogue): Likewise. + * varasm.c (decode_reg_name): Likewise. + + * 1750a.c (mod_regno_adjust): Likewise. + * alpha.c (alpha_write_one_linkage, + unicosmk_output_default_externs): Likewise. + * arm.c (arm_condition_codes): Likewise. + * arm.h (arm_condition_codes): Likewise. + * avr.c (output_movsisf, encode_section_info): Likewise. + * darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL): + Likewise. + * i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. + * i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. + * m88k.c (output_function_profiler): Likewise. + * mips.c (mips_output_conditional_branch): Likewise. + * ns32k.c (ns32k_out_reg_names): Likewise. + * ns32k.h (ns32k_out_reg_names): Likewise. + * pj.c (pj_output_rval): Likewise. + * rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise. + * sparc.c (sparc_flat_function_prologue, + sparc_flat_function_epilogue): Likewise. + +2001-09-13 Markus Werle + Gerald Pfeifer + + * doc/install.texi (Binaries): Add "Binaries for HP-UX 11.00 at + Aachen University of Technology". + +2001-09-13 Andreas Schwab + + * config/float-m68k.h: Define DECIMAL_DIG and FLT_EVAL_METHOD for + C99. + +2001-09-13 Richard Henderson + + * config/alpha/alpha.c (small_symbolic_operand): New. + (override_options): Set MASK_SMALL_DATA based on pic/PIC. + (some_operand, input_operand): Don't handle HIGH. + (alpha_legitimize_address): Use it. Emit HIGH with PLUS gp. + (alpha_expand_mov): Likewise. + (print_operand) [H]: Just print HIGH symbol. + (print_operand_address): Handle small data. + * config/alpha/alpha.h (MASK_SMALL_DATA, TARGET_SMALL_DATA): New. + (TARGET_SWITCHES): Add -msmall-data/large-data. + (PIC_OFFSET_TABLE_REGNUM): New. + (PREFERRED_RELOAD_CLASS): Don't handle HIGH. + (PREDICATE_COES): Update. + * config/alpha/alpha.md (adddi_er_high): New. + (adddi_er_low): Handle small data. + * config/alpha/elf.h (DO_SELECT_SECTION): If SMALL_DATA, + prefer .sdata to .rodata. + (SELECT_RTX_SECTION): Likewise. + +2001-09-12 Josh Martin + + * fixinc/inclhack.def(hpux11_size_t): Keep HP-UX headers from + defining __size_t and leaving size_t undefined. + +2001-09-12 Diego Novillo + + * basic-block.h (expunge_block): Declare. + * cfg.c (expunge_block): Remove static declaration. + +2001-09-12 Richard Henderson + + * integrate.c (copy_insn_list): Copy label name from + NOTE_INSN_DELETED_LABEL. + +2001-09-12 Kaveh R. Ghazi + + * c-common.c (c_tree_code_name): Const-ification. + * c-decl.c (c_decode_option): Likewise. + * c-typeck.c (warn_for_assignment): Likewise. + * collect2.c (libexts, is_ctor_dtor, main, ignore_library): + Likewise. + * cppinit.c (output_deps): Likewise. + * dependence.c (dependence_string, direction_string): Likewise. + * dwarf2out.c (output_ranges): Likewise. + * fixinc/fixfixes.c (emit_gnu_type): Likewise. + * fixinc/gnu-regex.c (re_error_msgid): Likewise. + * gcc.c (standard_exec_prefix, standard_exec_prefix_1, + standard_startfile_prefix, standard_startfile_prefix_1, + standard_startfile_prefix_2, tooldir_base_prefix, + standard_bindir_prefix, find_a_file): Likewise. + * genattrtab.c (make_length_attrs): Likewise. + * gencheck.c (tree_codes): Likewise. + * genemit.c (gen_split): Likewise. + * genrecog.c (special_mode_pred_table): Likewise. + * graph.c (graph_ext): Likewise. + * protoize (default_include): Likewise. + * reload.c (reload_when_needed_name): Likewise. + * sched-vis.c (visualize_stall_cycles): Likewise. + * tlink.c (recompile_files): Likewise. + * toplev.c (decode_g_option): Likewise. + * tradcpp.c (output_deps): Likewise. + * varasm.c (decode_reg_name): Likewise. + + * arm.c (arm_condition_codes, strings_fpa, thumb_condition_code): + Const-ification. + * arm.md: Likewise. + * avr.c (avr_regnames, encode_section_info): Likewise. + * c4x.c (float_reg_names): Likewise. + * darwin.h (ASM_GLOBALIZE_LABEL): Likewise. + * elfos.h (const_section): Likewise. + * i386.c (ix86_comp_type_attributes): Likewise. + * i386/win32.h (STRIP_NAME_ENCODING): Likewise. + * ia64/aix.h (UNIQUE_SECTION): Likewise. + * ia64.c (type_names): Likewise. + * m68hc11.c (reg_class_names): Likewise. + * m88k.c (m_options): Likewise. + * mips.c (mips_output_conditional_branch, mips_unique_section): + Likewise. + * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue, + ultra_code_names): Likewise. + * sparc.h (OVERRIDE_OPTIONS): Likewise. + +2001-09-12 Jakub Jelinek + + * configure.in (gcc_cv_as_shf_merge): Fix a typo. + Use --fatal-warnings option for gas. + * configure: Rebuilt. + +2001-09-12 Roman Lechtchinsky + + * doc/install.texi (Specific, alphaev5-cray-unicosmk*): Document. + +2001-09-11 Jim Wilson + + * alias.c (clear_reg_alias_info): Only handle pseudo registers. + +2001-10-11 Matt Kraai + + * builtins.c (c_strlen): Treat an offset too large for a + HOST_WIDE_INT as out of range. + +Tue Sep 11 18:57:47 CEST 2001 Jan Hubicka + + * basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. + (EDGE_CRITICAL_P): New predicate. + * cfg.c (force_nonfallthru_and_redirect, split_edge): Kill EDGE_CRITICAL + handling. + (insert_insn_on_edge): Use EDGE_CRITICAL_P. + (dump_edge_info): Remove "crit". + * cfganal.c (mark_critical_edges): Kill. + * cfgbuild.c (find_basic_blocks): Remove mark_critical_edges call. + * cfgcleanup.c (cleanup_cfg): Likewise. + * profile.c (instrument_edges): Use EDGE_CRITICAL_P. + (find_spanning_tree): Likewise. + * reg-stack.c (convert_regs_1): Likewise. + * ssa.c (mark_regs_equivalent_over_bad_edges): Likewise. + + * basic-block.h (create_basic_block_structure): New. + (create_basic_block): Update prototype. + (force_nonfallthru): New. + * bb-reorder.c (fixup_reorder_chain): Fixup use force_nonfallthru. + * cfg.c (create_basic_block_structure): Rename from create_basic_block; + handle updating of block_for_insn, creating of empty BBs and BBs at + the end of INSN chain. + (create_basic_block): New function. + (split_block): Use create_basic_block. + (force_nonfallthru_and_redirect): Break out from ...; cleanup + (redirect_edge_and_branch_force): ... here. + (force_nonfallthru): New. + (split_edge): Rewrite to use force_nonfallthru and create_block. + * cfgbuild.c (find_basic_blocks_1): Use create_basic_block_structure. + (find_basic_blocks): Free basic_block_for_insn. + * cfgcleanup.c (merge_blocks): Use force_nonfallthru. + + * cfg.c: Fix formating. + * cfgcleanup.c: Fix formating. + (merge_blocks, tail_recursion_label_p): Return bool. + (merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps): Return void. + +2001-09-11 Jakub Jelinek + + * configure.in: Check whether assembler supports section merging. + * config.in: Rebuilt. + * configure: Rebuilt. + * varasm.c (variable_section, output_constant_pool): Pass alignment + to SELECT_SECTION and SELECT_RTX_SECTION. + (mergeable_string_section): New. + (mergeable_constant_section): New. + (default_elf_asm_named_section): Output SECTION_MERGE and + SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. + * output.h (mergeable_string_section): New. + (mergeable_constant_section): New. + (SECTION_MERGE, SECTION_STRINGS, SECTION_ENTSIZE): Define. + * toplev.c (flag_merge_constants): New. + (f_options): Add -fmerge-constants and -fmerge-all-constants + options. + (toplev_main): Default to -fno-merge-constants if not optimizing. + * flags.h (flag_merge_constants): Add extern. + * invoke.texi (-fmerge-constants, -fmerge-all-constants): Document. + * tm.texi (SELECT_SECTION, SELECT_RTX_SECTION): Document added third + argument. + * config/elfos.h (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): + Define if assembler has working .subsection -1 support. + (SELECT_RTX_SECTION, SELECT_SECTION): Add third macro argument. + Put constant into special SHF_MERGE sections if the linker should + attempt to merge duplicates. + * config/ia64/sysv4.h (SELECT_RTX_SECTION, SELECT_SECTION): Add third + macro argument. + Put constant into special SHF_MERGE sections if the linker should + attempt to merge duplicates. + * config/alpha/elf.h: Likewise. + (ASM_SECTION_START_OP, ASM_OUTPUT_SECTION_START): Define if assembler + has working .subsection -1 support. + * config/nextstep.h: Add third argument to SELECT_RTX_SECTION and + SELECT_SECTION. + * config/svr3.h: Likewise. + * config/darwin.h: Likewise. + * config/arm/aof.h: Likewise. + * config/arm/linux-elf.h: Likewise. + * config/avr/avr.h: Likewise. + * config/c4x/c4x.h: Likewise. + * config/d30v/d30v.h: Likewise. + * config/i386/dgux.h: Likewise. + * config/i386/osfrose.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/i386/svr3gas.h: Likewise. + * config/ia64/aix.h: Likewise. + * config/m32r/m32r.h: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m88k/dgux.h: Likewise. + * config/m88k/m88k.h: Likewise. + * config/mcore/mcore-pe.h: Likewise. + * config/mips/mips.h: Likewise. + * config/pa/pa.h: Likewise. + * config/pa/pa-linux.h: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/rs6000/xcoff.h: Likewise. + * config/s390/linux.h: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sysv4.h: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/v850/v850.h: Likewise. + * config/vax/vms.h: Likewise. + * config/arm/arm.c (arm_elf_asm_named_section): Output SECTION_MERGE + and SECTION_STRINGS flags plus SECTION_ENTSIZE entity size. + * config/sparc/sparc.c (sparc_elf_asm_named_section): Use + default_elf_asm_named_section for SHF_MERGE sections. + +Tue Sep 11 17:55:54 CEST 2001 Jan Hubicka + + * bb-reorder.c (fixup_reorder_chain): Fallthru edge to exit block + is OK. + +2001-09-11 Joseph S. Myers + + * c-common.c (split_specs_attrs): Allow for empty attributes with + empty TREE_PURPOSE. Fixes PR c/4294. + +Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka + + * basic-block.h (cached_make_edge, make_single_succ): New. + (make_edge): Remove first parameter. + * bb-reroder.c (fixup_reorder_chain): Use make_single_succ_edge. + * cfg.c (cached_make_edge): Rename from make_edge; return newly + created edge; use obstack allocation. + (make_edge, make_single_succ_edge): New. + (first_removed_edge): New static variable. + (init_flow): Initialize first_removed_edge and n_edges. + (clear_edges): Use remove_edge. + (flow_delete_block): Likewise. + (remove_edge): Add removed edges to the removed edges list. + (split_block, redirect_edge_and_branch_force, split_edge): + Use make_edge. + * cfganal.c (flow_call_edges_add): Updaet make_edge call. + (add_noreturn_fake_exit_edges): Likewise. + (connect_infinite_loops_to_exit): Liekwise. + * cfgbuild.c (make_label_edge, make_edges, find_sub_basic_blocks): + Use cached_make_edge. + * cfgcleanup.c (try_crossjump_to_edge): Use make_single_succ_edge. + * profile.c (branch_prob): Update make_edge call. + * ssa-dce.c (ssa_eliminate_dead_code): Likewise. + +2001-09-11 Richard Henderson + + * config/alpha/alpha.c: Tidy formatting. + (local_symbolic_operand): Verify mode. + (alpha_sa_mask): Ignore unicos for eh_return. + (alpha_expand_epilogue): Handle sp_adj2 zero, not NULL. + * config/alpha/alpha.md (umk divsi patterns): Remove. + (extendsfdf2): Remove unicos check. + (tablejump): Merge vms and unicos code; always use direct set + plus label_ref use. + +2001-09-11 Roman Lechtchinsky + + * config.gcc (alpha*-*-unicosmk*): New target. + + * config/alpha/alpha-protos.h (symbolic_operand, + unicosmk_add_call_info_word, unicosmk_add_extern, + unicosmk_defer_case_vector, unicosmk_unique_section, + unicosmk_output_align, unicosmk_text_section, unicosmk_data_section, + unicosmk_asm_file_start, unicosmk_asm_file_end, + unicosmk_output_common): Declare. + + * config/alpha/alpha.c (NUM_ARGS, override_options, call_operand, + direct_return, function_arg, alpha_va_start, alpha_va_arg, + alpha_does_function_need_gp, alpha_end_function): Support Cray + Unicos/Mk. + (alpha_init_machine_status, alpha_mark_machine_status, + alpha_free_machine_status, unicosmk_output_deferred_case_vectors, + unicosmk_gen_dsib, unicosmk_output_ssib, unicosmk_need_dex, + unicosmk_asm_named_section, unicosmk_insert_attributes, + unicosmk_section_type_flags, symbolic_operand, + unicosmk_output_module_name, unicosmk_output_default_externs, + unicosmk_output_dex, unicosmk_output_externs, + unicosmk_output_addr_vec, unicosmk_ssib_name, + unicosmk_initial_elimination_offset, unicosmk_asm_file_start, + unicosmk_asm_file_end, unicosmk_output_common, + unicosmk_section_type_flags, unicosmk_unique_section, + unicosmk_add_call_info_word, unicosmk_text_section, + unicosmk_data_section, unicosmk_extern_list, unicosmk_extern_head, + unicosmk_add_extern, unicosmk_dex, unicosmk_dex_list, + unicosmk_dex_count, unicosmk_special_name): New. + (TARGET_INSERT_ATTRIBUTES, TARGET_SECTION_TYPE_FLAGS): Define for + TARGET_ABI_UNICOSMK. + (get_aligned_mem, alpha_expand_unaligned_load, + alpha_expand_unaligned_store, alpha_expand_unaligned_load_words, + alpha_expand_unaligned_store_words): Support big-endian mode. + (print_operand): Likewise. New format specifier 't'. Use + TARGET_AS_SLASH_BEFORE_SUFFIX. + (alpha_is_stack_procedure): Rename from vms_is_stack_procedure. + (alpha_pv_save_size): Update with above change. + (alpha_sa_mask, alpha_sa_size, alpha_expand_prologue, + alpha_start_function, alpha_expand_epilogue): Likewise. Support Cray + Unicos/Mk. + + * config/alpha/alpha.h (TARGET_ABI_UNICOSMK): New. + (TARGET_ABI_OSF): Exclude TARGET_ABI_UNICOSMK. + (TARGET_AS_SLASH_BEFORE_SUFFIX): New. + (EXTRA_CONSTRAINT): New constraint 'U'. + (PREDICATE_CODES): Add symbolic_operand. + + * config/alpha/alpha.md (UNSPEC_UMK_LAUM, UNSPEC_UMK_LALM, + UNSPEC_UMK_LAL, UNSPEC_UMK_LOAD_CIW): New constants. + (mulsi3, *mulsi_se, mulvsi3): Disable for TARGET_ABI_UNICOSMK. + (integer division and modulus patterns): Split in default and + Unicos/Mk versions. + (*divmodsi_internal, *divmoddi_internal): Disable for + TARGET_ABI_UNICOSMK. + (unaligned_extend?idi, unaligned_load?i, unaligned_store?i): Split in + little-endian and big-endian versions. + (ext, ins, msk): Likewise. + (extv, extzv, insv): Support big-endian mode. + (call, call_value, tablejump): Support TARGET_ABI_UNICOSMK. + (call_umk, call_value_umk, *call_umk, tablejump_umk, + *tablejump_umk_internal, *call_value_umk): New. + (*movdi_nofix): Add pattern for loading an address into a register on + TARGET_ABI_UNICOSMK. + (umk_laum, umk_lal, umk_lalm, *umk_load_ciw): New. + (umk_mismatch_args, arg_home_umk): New. + (various insns): Don't use mov, fmov, nop, fnop and unop. + (realign): Support TARGET_ABI_UNICOSMK. + + * config/alpha/unicosmk.h: New file. + * config/alpha/t-unicosmk: New file. + + * fixinc/inclhack.def (unicosmk_restrict): New. + * fixinc/fixincl.x: Regenerate. + + * ginclude/stddef.h (size_t): Check for and define __SIZE_T__. + (wchar_t): Check for and define __WCHAR_T__. + +2001-09-11 Richard Sandiford + + * combine.c (simplify_shift_const): Treat shifts by the mode + size as undefined. + +2001-09-11 Neil Booth + + * cpphash.h (struct tokenrun): New. + (struct cpp_context): New member bol. + (struct cpp_reader): New members. + (_cpp_init_tokenrun): New. + * cppinit.c (cpp_create_reader): Set up the token runs. + * cpplex.c (lex_directive, lex_token, next_tokenrun): New. + (lex_token): New internalised version of _cpp_lex_token. Don't + handle directives or the multiple include optimization here any + more. Simply lex a token. + * cpplib.c (run_directive): Clear bol. + (_cpp_pop_buffer): Set bol. + * cppmacro.c (funlike_invocation_p): Keep tokens whilst parsing + arguments. + +2001-09-11 Michael Meissner + + * config/mips/mips.h (CC1_SPEC): If -mgp32 default to -mfp32, and + give an error if the user uses -mfp32. + (CPP_FPR_SPEC): Define __mips_fpr to be 32 or 64 depending on the + default options. + (CPP_SPEC): Define __mips_fpr to be 32 or 64, depending on the + floating point register size. + (EXTRA_SPECS): Add CPP_FPR_SPEC. + + * config/mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Use + HOST_WIDE_INT_PRINT_DEC to properly print the result of + int_size_in_bytes. + * config/mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Ditto. + * config/mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Ditto. + +2001-09-11 Hans-Peter Nilsson + + * dbxout.c (dbxout_parms): Fix typo in comment. + * unroll.c (loop_find_equiv_value): Ditto. + * toplev.c (rest_of_compilation): Ditto. + * loop.c (scan_loop): Ditto. + * dwarf2out.c (struct dw_fde_struct): Ditto. + +2001-09-10 Zack Weinberg + + * cpplex.c (parse_identifier): Fast-path optimize. Avoid + copying identifier when we're just going to throw it away. + (parse_identifier_slow): New routine to handle abnormal cases. + (_cpp_lex_token): Update call site. + + * hashtable.c (ht_lookup): Don't assume that the string we've + been given is NUL-terminated. + * system.h: #define __builtin_expect(a, b) to (a) if not + GCC >=3.0. + +2001-09-10 Michael Meissner + + * config.gcc (sparc64-*-solaris2): Add alias to be compatible with + binutils, gdb. + +2001-09-10 David Edelsohn + + * config/rs6000/t-aix43 (SHLIB_INSTALL): Use mode 751 (a+x,r-o). + +Mon Sep 10 16:26:44 2001 Richard Kenner + + * builtins.c (c_getstr): Correct thinko in last change and further + cleanup. + +2001-09-10 Tim Freeman + + * dwarf2out.c (incomplete_types, decl_scope_table): Make them + into varray's and register them as roots with the garbage + collector so they are not collected too soon. + +Mon Sep 10 14:21:26 CEST 2001 Jan Hubicka + + * Makefile.in (cfg.o, cfganal.o, cfgloop.o, cfgbuild.o, cfgcleanup.o): + New. + * basic-block.h (flow_obstack, label_value_list, + tail_recursion_label_list): Declare + (tidy_fallthru_edges): Declare. + (expunge_block, last_loop_beg_note): Delete. + (can_fallthru, flow_nodes_print, flow_edge_list_print): Declare. + * cfg.c: New file + (basic_block_for_insn, label_value_list): Move from flow.c; make global. + (n_basic_blocks, n_edges, basic_block_info, entry_exit_blocks, + init_flow, clear_edges, can_delete_note_p, can_delete_label_p, + flow_delete_insn, flow_delete_insn_chain, create_basic_block, + expunge_block, flow_delete_block, compute_bb_for_insn, + update_bb_for_insn, set_block_for_insn, set_block_for_new_insns, + make_edge, remove_edge, redirect_edge_succ, redirect_edge_succ_nodup, + redirect_edge_pred, split_block, marge_blocks_nomove, block_label, + try_redirect_by_replacing_jump, last_loop_beg_note, + redirect_edge_and_branch, redirect_edge_and_branch_force, + tidy_fallthru_edge, tidy_fallthru_edges, back_edge_of_syntactic_loop_p, + split_edge, insert_insn_on_edge, commit_one_edge_insertion, + commit_edge_insertions, dump_flow_info, debug_flow_info, + dump_edge_info, dump_bb, debug_bb, debug_bb_n, print_rtl_with_bb, + verify_flow_info, purge_dead_edges, purge_all_dead_edges): + Move here from flow.c + * cfganal.c: New file. + (forwarder_block_p, can_fallthru, mark_critical_edges, + mark_dfs_back_edges, need_fake_edge_p, flow_call_edges_add, + find_unreachable_blocks, create_edge_list, free_edge_list, + print_edge_list, verify_edge_list, find_edge_index, flow_nodes_print, + flow_edge_list_print, remove_fake_successors, remove_fake_edges, + add_noreturn_fake_exit_edges, connect_infinite_loops_to_exit, + flow_reverse_top_sort_order_compute, flow_depth_first_order_compute, + flow_dfs_compute_reverse_init, flow_dfs-compute_reverse_add_bb, + flow_dfs-compute_reverse_execute, flow_dfs_compute_reverse_finish); + Move here from flow.c + * cfgbuild.c: New file + (count_basic_blocks, find_label_refs, make_label_edge, make_eh_edge, + make_edges, find_basic_blocks_1, find_basic_blocks, + find_sub_basic_blocks): Move here from flow.c + * cfgcleanup.c: New file. + (try_simplify_condjump, try_forward_edges, tail_recursion_label_p, + merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps, merge_blocks, + flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, + try_crossjump_bb, try_optimize_cfg): Move here from flow.c + (delete_unreachable_blocks, cleanup_cfg): Likewise; return true + if succeeded. + * cfgloop.c: New file + (flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_dump, + flow_loops_dump, flow_loops_free, flow_loop_entry_edges_find, + flow_loop_exit_edges_find, flow_loop_nodes_find, + flow_loop_pre_header_scan, flow_loop_pre_header_find, + flow_loop_tree_node_add, flow_loops_tree_build, + flow_loop_level_compute, flow_loops_level_compute, flow_loop_scan, + flow_loops_find, flow_loops_update, flow_loop_outside_edge_p): + Move here from flow.c + * flow.c: Remove everything moved elsewhere + * output.h (cleanup_cfg): Return bool. + + * bb-reorder.c (reorder_block_def): Remove 'index'. + (insert_intra_1): Add argument BB, set block for new note. + (make_reorder_chain): Do not depdent on BB indexes. + (make_reorder_chain_1): Do not use BB indexes. + (label_for_bb): Likewise; set BB for new insn. + (emit_jump_to_block_after): Likewise. + (fixup_reorder_chain): Sanity check that all basic blocks + are chained; verify newly created insn chain; remove + undocnitional jump simplifying; Do not use BB indexes; + properly initialize count and frequency information; + dump reordered sequence. + (insert_intra_bb_scope_notes): update call of insert_intra_1. + (insert_inter_bb_scope_notes): Set block for new insn. + (reorder_basic_blocks): Dump flow info before reoredering. + +Mon Sep 10 06:47:35 2001 Richard Kenner + + * alias.c (clear_reg_alias_info): Use K&R format definition. + Avoid unsigned warning. + * builtins.c: Use "unsigned int", not "unsigned". + (target_char_cast): Use host_integerp and tree_low_cst. + (expand_builtin_args_info, expand_builtin_frame_address): Likewise. + (c_strlen): Likewise; OFFSET now HOST_WIDE_INT. + (c_getstr): Likewise. + (std_expand_builtin_va_arg): Use int_size_in_bytes. + (builtin_memcpy_read_str): Avoid unsigned warning. + (expand_builtin_memcpy): Alignments are unsigned. + (expand_builtin_strncpy, expand_builtin_memset): Likewise. + (expand_builtin_expect_jump): Use integer_zerop and integer_onep. + * predict.c (expensive_function_p): LIMIT now unsigned. + * resource.c (mark_target_live_regs): Make some vars unsigned. + * sdbout.c: Use "unsigned int", not "unsigned". + (MAKE_LINE_SAFE): Add cast to avoid unsigned warning. + (sdbout_source_line): Likewise. + (sdbout_record_type_name): Remove "const" for NAME declaration. + * config/alpha/alpha.c (alpha_expand_block_move): Whitespace fixes. + +2001-09-10 Richard Sandiford + + * calls.c (store_one_arg): Expand comment. + +2001-09-10 Roman Lechtchinsky + + * calls.c (store_one_arg): Make sure that the entire argument is + pushed if STACK_PARMS_IN_REG_PARM_AREA is defined. + +2001-09-09 Richard Henderson + + * emit-rtl.c (adjust_address): Fix mode for LO_SUM. + +Sun Sep 9 10:43:17 CEST 2001 Jan Hubicka + + * loop.c (combine_givs): Fix computing of benefit once giv is combined. + +2001-09-09 Richard Henderson + + * config/alpha/alpha.c (alpha_next_sequence_number): New. + (alpha_this_literal_sequence_number): New. + (alpha_this_gpdisp_sequence_number): New. + (some_operand, input_operand): Add HIGH. + (local_symbolic_operand): New. + (alpha_encode_section_info): New. + (alpha_legitimate_address_p): Allow LO_SUM. + (alpha_legitimize_address): Generate HIGH+LO_SUM. + (alpha_expand_mov): Likewise. + (secondary_reload_class): Check memory_operand not general_operand + for FP_REGS test. + (alpha_expand_unaligned_load): Force LO_SUM addresses into a register. + (alpha_expand_unaligned_store): Likewise. + (alpha_expand_unaligned_load_words): Likewise. + (alpha_expand_unaligned_store_words): Likewise. + (alpha_expand_block_clear): Likewise. + (print_operand): Handle %#, %*, %H. + (print_operand_address): Handle LO_SUM. + (find_lo_sum): New. + (alpha_does_function_need_gp): Use it. + (alpha_expand_block_move): Fix signed compare warnings. + (alpha_sa_mask, alpha_align_insns): Likewise. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (TARGET_EXPLICIT_RELOCS): New. + (MASK_EXPLICIT_RELOCS): New. + (TARGET_SWITCHES): Add -mexplicit-relocs. + (EXTRA_CONSTRAINT): Add 'T'. + (PREFERRED_RELOAD_CLASS): HIGH goes in GENERAL_REGS. + (ASM_APP_ON, ASM_APP_OFF): Turn on and off asm macro expansion. + (ENCODE_SECTION_INFO): Out line. + (REDO_SECTION_INFO_P): New. + (STRIP_NAME_ENCODING): New. + (ASM_OUTPUT_LABELREF): New. + (PRINT_OPERAND_PUNCT_VALID_P): Add #, *. + (PREDICATE_CODES): Update. + * config/alpha/alpha.md (divmodsi_internal_er, divmoddi_internal_er, + call_osf_1_er_noreturn, call_osf_1_er, movdi_er_low, movdi_er_nofix, + movdi_er_fix, prologue_ldgp_1_er, builtin_setjmp_receiver_sub_label_er, + builtin_setjmp_receiver_er, exception_receiver_1_er, + call_value_osf_1_er): New patterns. + (sibcall_osf_1, sibcall_value_osf_1): Remove register alternative. + (movqi, movhi, movsi): Add explicit $31 base register to lda. + * config/alpha/elf.h (ASM_FILE_START): Set nomacro if explicit relocs. + (FINAL_PRESCAN_INSN): New. + +Sat Sep 8 22:00:55 CEST 2001 Jan Hubicka + + * reg-stack.c (subst_stack_regs_pat): Fix fcmov reversal code. + +2001-09-08 Andreas Jaeger + + * i386.h (TARGET_SWITCHES): Fix description. + +2001-09-07 David Edelsohn + + * rs6000.c (num_insns_constant): Compute number of instructions + more accurately. + + * doc/install.texi: Explain AIX exception handling work-around. + Update URL for AIX fixes. + +2001-09-07 Jim Wilson + + * alias.c (clear_reg_alias_info): New. + * flow.c (attempt_auto_inc): Call clear_reg_alias_info. + * rtl.h (clear_reg_alias_info): Declare. + +2001-09-07 Roman Lechtchinsky + + * real.c (EMUSHORT,EMUSHORT_SIZE): Use HImode if no 16-bit type is + available. + (UEMUSHORT): New. Use instead of unsigned EMUSHORT. + (m16m,edivm,emulm): Change declaration to match definition. + +2001-09-07 Roman Lechtchinsky + + * reload.c (push_reload): Check for subreg_lowpart_p instead of + SUBREG_BYTE being 0 when determining if the inner part of a subreg + can be reloaded. + +2001-09-07 Roman Lechtchinsky + + * c-common.c (signed_or_unsigned_type): Handle machine mode types + which have no corresponding C type. + * fold_const.c (target_isinf,target_isnan,target_negative): Update + the representation of 64-bit doubles to work with 64-bit ints. + +2001-09-07 Aldy Hernandez + + * config/mips/mips.c (override_options): Do not override ISA when ABI + specified if MIPS_CPU_STRING_DEFAULT was specified. + +2001-09-07 Richard Henderson + + * loop.c (record_giv): Avoid simplifying MULT to ASHIFT. + (express_from_1): Wrap lines. + * rtlanal.c (commutative_operand_precedence): Rename from + operand_preference; export. + * rtl.h: Declare it. + * simplify-rtx.c (simplify_gen_binary): Tidy +/- const_int handling. + (simplify_binary_operation): Invoke simplify_plus_minus on + (CONST (PLUS ...)) as well. + (struct simplify_plus_minus_op_data): New. + (simplify_plus_minus_op_data_cmp): New. + (simplify_plus_minus): Use them. Avoid infinite recursion with + simplify_binary_operation wrt CONST. + +Fri Sep 7 11:52:30 2001 Kazu Hirata + + * h8300-protos.h (general_operand_dst_push): Remove. + * h8300.c (general_operand_dst_push): Likewise. + * h8300.h (OK_FOR_T): Likewise. + (EXTRA_CONSTRAINTS): Do not use OK_FOR_T. + * h8300.md (pushqi_h8300): New. + (pushqi_h8300hs): Likewise. + (pushqi): Likewise. + (pushhi_h8300): Likewise. + (pushhi_h8300hs): Likewise. + (pushhi): Likewise. + +Fri Sep 7 12:56:26 2001 Richard Kenner + + * genattrtab.c (attr_printf): First arg is unsigned. + Clean up formatting of callers. + +2001-09-06 Aldy Hernandez + + * config/mips/mips.c (override_options): Allow abi32 with 64 bit + registers. + +2001-09-07 Andreas Jaeger + + * i386.h (TARGET_SWITCHES): Fix descriptions. + +2001-09-07 Matt Kraai + + * stor-layout.c (compute_record_mode): Check DECL_SIZE is set. + +2001-09-06 Ira Ruben + + Remove OP_IDENTIFIER. + * tree.def (OP_IDENTIFIER): Remove. + * tree.c (tree_node_kind enum): Remove op_id_kind. + (tree_node_kind_names): Remove "op_identifiers". + (make_node): Remove OP_IDENTIFIER test. + (build_op_identifier): Removed because it isn't being used. + * print-tree.c (print_node): Remove OP_IDENTIFIER case. + * cp/pt.c (tsubst): Remove OP_IDENTIFIER case. + +2001-09-06 Richard Henderson + + * simplify-rtx.c (simplify_binary_operation): Revert last change. + +2001-09-06 Richard Henderson + + * simplify-rtx.c (simplify_binary_operation): Simplify contents + of CONST. + +2001-09-06 Franz Sirl + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Fix DWARF2 register + number used for CR register. + +Thu Sep 6 11:16:35 2001 Jeffrey A Law (law@cygnus.com) + Joern Rennecke (amylaar@cygnus.com) + + * h8300-protos.h (h8300_return_addr_rtx): New prototype. + * h8300.c (initial_offset): Handle offset between RP and FP. + (h8300_return_addr_rtx): New function. + * h8300.h (FIRST_PSEUDO_REGISTER): Bump now that we have a + return register. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Corresponding changes. + (REG_ALLOC_ORDER, RETURN_ADDRESS_POINTER_REGNUM): Likewise. + (REG_CLASS_CONTENTS, ELIMINABLE_REGS): Likewise. + (CAN_ELIMINATE, REGISTER_NAMES): + (RETURN_ADDR_RTX): Call h8300_return_addr_rtx. + +2001-09-06 Nathan Sidwell + + Remove TYPE_NONCOPIED_PARTS. + * tree.h (TYPE_NONCOPIED_PARTS): Remove. + (struct tree_type): Remove noncopied_parts. + * c-tree.h (TYPE_ACTUAL_ARG_TYPES): Map onto TYPE_BINFO. + * expr.c (save_noncopied_parts, init_noncopied_parts): Remove. + (fixed_type_p): Remove. + (expand_expr, INIT_EXPR): Don't deal with noncopied parts. + (expand_expr, MODIFY_EXPR): Likewise. + * ggc-common.c (ggc_mark_trees): Remove TYPE_NONCOPIED_PARTS. + * doc/c-tree.texi: Remove TYPE_NONCOPIED_PARTS FIXME. + +2001-09-06 Alan Modra + + * config/rs6000/rs6000.c (mask_operand): Use signed vars to avoid + compiler warnings. + (mask64_operand): Likewise. + (includes_rldic_lshift_p): Likewise. + (includes_rldicr_lshift_p): Likewise. + +2001-09-05 Ziemowit Laski + + * objc/objc-act.c (build_message_expr): If a class method cannot + be found, do not issue a warning if a corresponding instance + method exists in the root class. + +2001-09-05 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_mov): Initialize temp. + +2001-09-05 Zack Weinberg + + * function.c (ggc_mark_struct_function): Mark f->outer. + * toplev.c (rest_of_compilation): Clear DECL_SAVED_INSNS here... + * integrate.c (output_inline_function): ... not here. + +Wed Sep 5 17:28:49 CEST 2001 Jan Hubicka + + * profile.c (branch_prob): Call add_noreturn_fake_exit_edges. + + * i386.c (size_cost): New static variable. + (override_function): Use size_cost when -Os is specified. + + * i386.c (ix86_expand_prologue): Set use_fast_prologue_epilogue + properly; Use current_function_calls_eh_return. + (ix86_expand_epilogue): Avoid dummy optimize_size tests; + use leave to avoid dependency chain. + + * local-alloc.c (update_equiv_regs): Use CFG to iterate over INSN stream; + get BB loop_depth instead of computing it from LOOP notes. + + * reg-stack.c (subst_stack_reg_pat): Handle reversal of conditional moves. + +2001-09-05 John David Anglin + + * som.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. + * pa.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP): Define + +2001-09-05 Jeffrey A Law (law@cygnus.com) + Jason Merrill (jason@redhat.com) + + * stor-layout.c (layout_type): Complain if an array's size can + not be represented in a size_t. + + * config/h8300/elf.h (ENDFILE_SPEC, STARTFILE_SPEC): Define. + +2001-09-05 David Billinghurst + + * gcc.c: (process_command) Add parentheses around assignment + used as truth value. + +2001-09-05 Richard Sandiford + + * config/mips/mips.c (save_restore_insns): Don't mark any register + save slots as unchanging if current_function_calls_eh_return. + +2001-09-05 Richard Henderson + + * config/alpha/alpha.c (alpha_legitimate_address_p): New. + * config/alpha/alpha-protos.h: Declare it. + * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Move to c file. + (NONSTRICT_REG_OK_FOR_BASE_P): Rename from non-strict macro. + (NONSTRICT_REG_OK_FP_BASE_P): Likewise. + (STRICT_REG_OK_FOR_BASE_P): Rename from strict macro. + (REG_OK_FOR_BASE_P): Select one of the above. + +2001-09-05 Richard Sandiford + + * config/mips/t-elf (EXTRA_PARTS): Use EXTRA_MULTILIB_PARTS instead. + (crti.o): Prefix name of object file with $(T). + (crtn.o): Likewise. + +2001-09-05 David S. Miller + + * config/sparc/linux.h: Set CPLUSPLUS_CPP_SPEC. + * config/sparc/linux64.h: Likewise. + +2001-09-05 Andreas Jaeger + + * doc/invoke.texi (i386 Options): -mwide-multiply is not + available anymore, remove the documentation. + (i386 Options): Fix typo, cleanup index entries. + + * prefix.c (concat): Remove, we can use the version from liberty. + +2001-09-05 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_mov, alpha_expand_mov_nobwx): + New functions split out of md file expanders. + * config/alpha/alpha-protos.h: Declare them. + * config/alpha/alpha.md (movqi, movhi, movsi, movdi): Use them. + +2001-09-05 Neil Booth + + * cppmacro.c (funlike_invocation_p): No need to restore context. + +2001-09-04 Richard Henderson + + * reload.c (push_reload): Export. + * reload.h (push_reload): Declare it. + + * config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Move out o' line. + (LEGITIMIZE_RELOAD_ADDRESS): Likewise. + * config/alpha/alpha.c (alpha_legitimize_address): New. + (alpha_legitimize_reload_address): Likewise. + * config/alpha/alpha-protos.h: Declare them. + +2001-09-04 Stan Shebs + + * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Define. + * config/darwin.c (machopic_stub_name): Account for internally + generated lib calls such as memcpy. + +2001-09-04 Richard Henderson + + * unwind.h (_UA_END_OF_STACK): New flag. + * unwind.inc (_Unwind_ForcedUnwind_Phase2): Set it. + +Tue Sep 4 11:16:35 2001 Jeffrey A Law (law@cygnus.com) + + * h8300/elf.h (LINK_SPEC): Redefine appropriately for the H8. + +2001-09-04 Richard Sandiford + + * config/mips/mips.c (save_restore_insns): Change base_offset to + fp_offset in second call to mips_emit_frame_related_store. + +2001-09-04 Hans-Peter Nilsson + + * doc/rtl.texi: Mention that besides as a CODE_LABEL, a label can + sometimes be represented as a NOTE of type + NOTE_INSN_DELETED_LABEL. + (Insns): Document NOTE_INSN_DELETED_LABEL. + +2001-09-04 Nathan Sidwell + + * c-common.h (tree_dump_index): Add more comments. + * c-dump.c (dump_files): Name flags `tree' rather than `ast'. + (dump_option_value_info): New struct. + (dump_options): New array. + (dump_switch_p): Parse switch options symbolically. + * doc/invoke.texi (-fdump-ast): Rename to ... + (-fdump-tree): ... here. Document that options are symbolic, and + not all are applicable. + +2001-09-04 David S. Miller + + * config/sparc/sparc.md (define_splits): Kill constraints. + + Cleanup redundant and unused insn attributes. + * config/sparc/sparc.md (define_attr "insn"): Kill address, unary, + binary, and move. Mark ialu as default. + (commented out define_function_unit "alu"): Kill. + (define_attr "use_clobbered"): Kill. + (whole file): Kill address insn type references. Replace + all unary/binary/move references with ialu. + * config/sparc/sparc.c (whole file): Kill TYPE_ADDRESS + references. Replace TYPE_{UNARY,BINARY,MOVE} references with + TYPE_IALU. + + Simplify length insn attribute and make more judicious use + of insn attribute defaulting. + * config/sparc/sparc.md (all insns with length > one): Mark as + insn type multi if real instructions, else use default if + it is a forced splitter. + (all insns with length == one): Use default insn length. + (all insns of type ialu): Use default insn type. + + Fix erroneous insn attribute settings. + (addx): Set insn type to misc. + (mulsidi3_sp64, const_mulsidi3_sp64, umulsidi3_sp64, + const_umulsidi3_sp64): Set insn type to imul. + + Track SFmode vs DFmode insns according to UltraSPARC + scheduling rules. + * config/sparc/sparc.md ("fptype"): New attribute, default + to "single". + (all DFmode single insns): Mark as fptype "double". + +2001-09-03 Jakub Jelinek + + * loop.c (express_from_1): Fix CONSTANT_P(a) case. + +2001-09-03 Richard Henderson + + * function.h (struct function): Add arg_pointer_save_area_init. + * function.c (expand_function_end): Init arg_pointer_save_area. + (get_arg_pointer_save_area): Do not init arg_pointer_save_area + when called from a nested function. + +2001-09-02 Angela Marie Thomas + + * fixinc/Makefile.in: Regenerate fixincl.x only if maintainer-mode + is enabled. + +Sun Sep 2 18:37:54 CEST 2001 Jan Hubicka + + * reload1.c (fixup_abnormal_edges): Allow NOTEs in the sequence. + +2001-09-01 Geoffrey Keating + + * expr.c (push_block): Make sane use of STACK_GROWS_DOWNWARD. + (emit_push_insn): Use specified padding direction when + STACK_PUSH_CODE is POST_INC. + + * config/stormy16/stormy16.h (DWARF2_UNWIND_INFO): Define to 0. + +2001-09-01 Kaveh R. Ghazi + + * mips.h (INITIAL_ELIMINATION_OFFSET): Add missing `else abort'. + +2001-09-01 Neil Booth + + * cppinit.c (cpp_start_read): Free the imacros list as we + traverse it. Don't free the chains before returning. + (_cpp_push_next_buffer): Only try pushing buffers if we've + completed -imacros handling. + +2001-08-31 Eric Christopher + + * gcc.c (handle_braces): Add explaination for abort. + +2001-08-30 Roman Zippel + + * expmed.c (store_bit_field): Update to patch from 2001-08-27: + move adjustment of bitpos instead. + +2001-08-31 Zack Weinberg + + * function.c: Remove all_functions. Make outer_function_chain + static. + (init_function_start): Don't add new function structure to + all_functions. + (find_function_data, push_function_context_to, + pop_function_context_from, put_var_into_stack, + trampoline_address): Update for changed structure element names. + (push_function_context_to): Disentangle. + (free_after_compilation): Also free F. + (expand_dummy_function_end): Don't free cfun here. + (put_var_into_stack): Comment why we can't use find_function_data here. + (fix_lexical_addr, trampoline_address, ): Use find_function_data. + (mark_function_chain): Split into maybe_mark_struct_function and + ggc_mark_struct_function. Export the latter. + (init_function_once): Mark from cfun and outer_function_chain; + not all_functions. + + * function.h (struct function): Kill next_global. Rename next + to outer. All users updated to match. + (all_functions, outer_function_chain): Don't declare. + + * ggc-common.c (ggc_mark_trees): Mark DECL_SAVED_INSNS. + * integrate.c (output_inline_function): Clear DECL_SAVED_INSNS, + don't touch f->inlinable, after calling rest_of_compilation. + + * tree.h: Forward-declare struct function. Prototype + ggc_mark_struct_function. + +2001-08-31 Kazu Hirata + + * config/h8300/h8300.md (*andorhi3): Fix typos. + +2001-08-31 Kaveh R. Ghazi + + * calls.c (emit_library_call_value): Don't use a fixed + argument after VA_CLOSE, i.e. out of scope in traditional C. + + * emit-rtl.c (gen_rtvec): Likewise. + +2001-08-31 Kaveh R. Ghazi + + * Makefile.in (c-pragma.o): Depend on output.h. + (reorg.o): Depend on except.h. + + * c-pragma.c: Include output.h. + + * reorg.c: Include except.h. + + * unwind-dw2.c: Call __builtin_alloca, not alloca. + +2001-08-31 Richard Henderson + + * sched-deps.c (add_dependence): Don't elide dependency if the + conditional used by insn is modified in elem. + +2001-08-31 Nick Clifton + + * config/v850/v850.h (OUTPUT_ADDR_CONST_EXTRA): Define. + +2001-08-31 Diego Novillo + + * c-decl.c (c_decode_option): Skip '-f' prefix before calling + dump_switch_p. + +2001-08-31 Geoffrey Keating + + * config/stormy16/stormy16.c (stormy16_asm_out_destructor): New + function. + (stormy16_asm_out_constructor): New function. + (TARGET_ASM_CONSTRUCTOR): Define. + (TARGET_ASM_DESTRUCTOR): Define. + +2001-08-31 Andreas Jaeger + + * gcse.c (add_label_notes): REG_LABEL is an INSN_LIST. + * loop.c (add_label_notes): Likewise. + * reload.c (find_reloads): Likewise. + * config/sh/sh.c (machine_dependent_reorg): Likewise. + +2001-08-31 Jason Merrill + + * unwind-pe.h (read_uleb128, read_sleb128): Move actual reading + code here. Take _Unwind_{W,Sw}ord*. + (read_encoded_value_with_base): Use them. + * unwind-dw2.c (_Unwind_FrameState): Make cfa_offset and cfa_reg + words. + (extract_cie_info): Simplify read_?leb128 handling. + (execute_stack_op, execute_cfa_program): Likewise. + * unwind-dw2-fde.c (get_cie_encoding): Likewise. + +2001-08-31 Geoffrey Keating + + * config/stormy16/stormy16.c (stormy16_expand_epilogue): Use + the frame pointer to pop the stack if convenient. + + * config/stormy16/stormy16.c (stormy16_initialize_trampoline): + Don't use post-increment before combine. + * config/stormy16/stormy16.h (STATIC_CHAIN_REGNUM): Don't use + a call-saved register. + +2001-08-31 Andreas Jaeger + + * jump.c (mark_jump_label): Revert patch from 2001-08-28, the + code was correct. + +2001-08-30 Geoffrey Keating + + * config/stormy16/stormy16.md (udivmodhi4): Express using UDIV/UMOD, + not DIV/MOD, of course. + +2001-08-30 Vladimir Makarov + + * rtl.def: Undo my patch commited 2001-08-27. + + * genattrtab.c: Ditto. + + * rtl.h: Ditto. + + * sched-int.h: Ditto. + + * target-def.h: Ditto. + + * target.h: Ditto. + + * haifa-sched.c: Ditto. + + * sched-rgn.c: Ditto. + + * sched-vis.c: Ditto. + + * Makefile.in: Ditto. + + * doc/md.texi: Ditto. + + * doc/tm.texi: Ditto. + + * doc/contrib.texi: Ditto. + + * doc/gcc.texi: Ditto. + + * genattrtab.h: Remove it. + + * genautomata.c: Remove it. + + * genattr.c: Undo my patch and Richard Henderson's patch commited + 2001-08-27. + +Thu Aug 30 19:22:15 2001 J"orn Rennecke + + * config.gcc (h8300-*-elf*): New case. + * h8300.h (CPP_SPEC): Add subtarget_cpp_spec. + (SUBTARGET_CPP_SPEC): Define. + (EXTRA_SPECS): Define. + (SUBTARGET_EXTRA_SPECS): Define. + * config/h8300/crti.asm, config/h8300/crtn.asm: New files. + * config/h8300/elf.h, config/h8300/t-elf: Likewise. + +Thu Aug 30 18:50:37 2001 J"orn Rennecke + + * t-h8300 (LIB1ASMFUNCS): Add _fixunssfdi and _fixunssfsi_asm. + (LIB2FUNCS_EXTRA): Define. + config/h8300/lib1funcs.asm: New part: L_fixunssfsi_asm . + config/h8300/fixunssfsi.c: New file. + +2001-08-30 Kazu Hirata + + * config/h8300/h8300.md (zero_extendqihi2): Changes to + define_expand to accommodate target-specific attributes. + (anonymous zero_extendqihi2 patterns): New. + +Thu Aug 30 18:10:56 2001 J"orn Rennecke + + * h8300.md (*andorhi3): New pattern. + +Thu Aug 30 16:00:31 2001 J"orn Rennecke + + * h8300.c (dosize): Fix test for "sub". + +Thu Aug 30 10:21:43 2001 J"orn Rennecke + + * c-typeck.c (pointer_diff): Try to eliminate common term before + doing conversions. + +2001-08-30 Nick Clifton + + * config/arm/arm.c (arm_compute_initial_elimination_offset): + Account for the saves of the FP registers. + + * config/arm/unknown-elf.h (TEXT_SECTION): Delete. + (TEXT_SECTION_ASM_OP): Define. + (INIT_SECTION_ASM_OP): Define. + (FINI_SECTION_ASM_OP): Define. + (SUBTARGET_EXTRA_SECTIONS): Remove trailing comma. + (RDATA_SECTION_FUNCTION): Provide prototype. + +2001-08-29 Geoffrey Keating + + * reload1.c (move2add_note_store): Correct typo checking for + argument pushes. + +2001-08-29 Andrew MacLeod + + * gcse.c (compute_hash_table): The SRC part of an insn with a RETVAL + note should not be considered outside the libcall block. + +2001-08-29 Kaveh R. Ghazi + + * genattrtab.c (attr_printf): Use VA_OPEN/VA_FIXEDARG/VA_CLOSE. + +2001-08-29 Kazu Hirata + + * config/h8300/h8300.md (movsi_h8300hs): Make it 64-bit safe. + +2001-08-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + emit_logical_op. + * config/h8300/h8300.c (emit_logical_op): New. + * config/h8300/h8300.md (andhi3): Use emit_logical_op. + (andsi3): Likewise. + (iorhi3): Likewise. + (iorsi3): Likewise. + (xorhi3): Likewise. + (xorsi3): Likewise. + +2001-08-29 John David Anglin + + * pa.c (move_operand): Cast GET_MODE_SIZE results to HOST_WIDE_INT for + comparison with rtx INTVAL. + (pa_output_function_prologue): Don't mix signed and unsigned in `?' + expression. + * pa.h (FUNCTION_ARG_SIZE): Likewise. + +2001-08-29 Kazu Hirata + + * config/h8300/lib1funcs.asm: Update the copyright. Fix + comment typos. + +2001-08-29 Kazu Hirata + + * config/h8300/h8300.md (anonymous movhi pattern): Don't move + (reg n) to (mem (pre_dec (reg n)) + (anonymous movsi pattern): Likewise. + +2001-08-29 Kazu Hirata + + * config/h8300/h8300.h (RETURN_ADDR_RTX): New. + +2001-08-29 Kazu Hirata + + * config/h8300/h8300.md (movsi_h8300hs): Optimize loading of + several special constants. + +2001-08-29 Kazu Hirata + + * config/h8300/lib1funcs.asm: Fix comment typos. + +2001-08-29 Kaveh R. Ghazi + + * iris6.h (ASM_DECLARE_OBJECT_NAME, ASM_FINISH_DECLARE_OBJECT): + Fix format specifier warnings. + + * irix6-libc-compat.c (inet_ntoa, inet_lnaof, inet_netof, + inet_makeaddr, semctl): Prototype. + + * mips.c (compute_frame_size): Fix signed/unsigned warnings. + (save_restore_insns): Use base_offset, not gp_offset. + + * mips.h (GP_REG_OR_PSEUDO_STRICT_P): Fix signed/unsigned warning. + (ASM_OUTPUT_BYTE): Fix format specifier warning. + +2001-08-29 Richard Henderson + + * bb-reorder.c (function_tail_eff_head): New. + (record_effective_endpoints): Set it. + (fixup_reorder_chain): Use it. + +2001-08-28 Kaveh R. Ghazi + + * dwarf2asm.c (dw2_asm_output_nstring): Fix typo in previous change. + +2001-08-28 Dale Johannesen + + * config/darwin.c (machopic_function_base_name): Add const + qualifier to a string. + (darwin_encode_section_info): Ditto. + +2001-08-28 Kaveh R. Ghazi + + * tree.c (default_valid_attribute_p): Don't use PARAMS on a + function definition. + +2001-08-28 Daniel Berlin + + * df.h (struct df): Add rts_order variable. + + * df.c (df_visit_next_rts): New function. + (df_visit_next): Renamed to df_visit_next_rc + (df_analyse_1): Allocate/compute/free rts_order as well. + (df_rd_global_compute): Use df_visit_next_rc instead of + df_visit_next. + (df_ru_global_compute): Use df_visit_next_rts instead of + df_visit_next. + + * flow.c (flow_reverse_top_sort_order_compute): New function. + + * basic-block.h: Add prototype. + +2001-08-28 Daniel Berlin + + * ssa-ccp.c (ssa_ccp_df_delete_unreachable_insns): For unreachable + blocks, the BB_REACHABLE is now set, rather than aux being + non-NULL. Update the test to reflect this. + +2001-08-28 Eric Christopher + + * config/mips/crtn.asm: Add comment explaining 16 byte alignment. + config/mips/crti.asm: Ditto. + +2001-08-28 Eric Christopher + Richard Henderson + + * c-pragma.h (add_weak): Move prototype from here... + * output.h (add_weak): ... to here. + * varasm.c (add_weak): Fix typo. + * config/mips/crti.asm: New file. + * config/mips/crtn.asm: Ditto. + * config/mips/elf.h (SBSS_SECTION_ASM_OP) Add #undef. + (CTOR_LISTS_DEFINED_EXTERNALLY): Remove. + (INVOKE__main): Ditto. + (INIT_SECTION_ASM_OP): New. + (FINI_SECTION_ASM_OP): Ditto. + (STARTFILE_SPEC): Add crti. + (ENDFILE_SPEC): Add crtn. + * config/mips/elf64.h: Same. + * config/mips/rtems64.h (INVOKE__main, NAME__MAIN, SYMBOL__MAIN): + Remove. + * config/mips/vxworks.h: Ditto. + * config/mips/t-elf: Support crti and crtn. + +2001-08-28 Alexandre Oliva + + * jump.c (mark_jump_label): Fix typo: REG_LABEL is EXPR_LIST, not + INSN_LIST. + +2001-08-28 Richard Henderson + + * config/ia64/ia64.md (andcmbi3, iorcmbi3): Fix typos. + (one_cmplbi2 splitter): Remove redundant test. + +2001-08-28 Dale Johannesen + + * config/rs6000/darwin.h (DEFAULT_SIGNED_CHAR): Define. + +2001-08-28 Danny Smith + + * config/i386/cygwin.h (BIGGEST_FIELD_ALIGNMENT): Set to 64. + +2001-08-28 Stan Shebs + + * config/darwin.h (ASM_OUTPUT_LABELREF): Handle '*' names. + (UNALIGNED_SHORT_ASM_OP): Define. + (UNALIGNED_INT_ASM_OP): Define. + +2001-08-28 Will Cohen + + * config/rs6000/rs6000.md (store_multiple): Correct RTL + generation for first set. + +2001-08-27 Roman Zippel + + * flow.c (redirect_edge_succ_nodup): Return new edge. + (try_simplify_condjump): Use new edge. + * basic-block.h (redirect_edge_succ_nodup): Update prototype. + + * cse.c (cse_basic_block): Skip note instructions. + +2001-08-27 Richard Henderson + + * combine.c (combine_simplify_rtx): Don't reverse condition + if there is no reverse for the condition. + (simplify_comparison): Don't simplify subregs from INT to FP. + + * config/m68k/m68k.md (sordered, sordered_1, sunordered, sunordered_1, + suneq, suneq_1, sunge, sunge_1, sungt, sungt_1, sunle, sunle_1, + sunlt, sunlt_1, sltgt, sltgt_1, fsogt_1, fsoge_1, fsolt_1, fsole_1, + bordered, bunordered, buneq, bunge, bungt, bunle, bunlt, bltgt, + bordered_rev, bunordered_rev, buneq_rev, bunge_rev, bungt_rev, + bunle_rev, bunlt_rev, bltgt_rev): New patterns. + +2001-08-27 Roman Zippel + + * config/m68k/m68k.md (subreghi1ashrdi_const32, bsetmemqi, + bsetmemqi+1, strict_low_part peephole): Fix SUBREG_BYTE offset. + (pushqi1): New. + (adddi_dilshr32, adddi_dishl32): Only data register can be + source for mem destination. + + * expmed.c (store_bit_field): Ignore adjustment to bitpos + and use bitnum to decide about register move. + +2001-08-27 Richard Henderson + + * genattr.c (main): Emit state_t even when not doing scheduling. + +2001-08-27 Roman Zippel + Richard Henderson + + * gcse.c (reg_first_set, reg_last_set): Replace with ... + (reg_avail_info, current_bb): ... these. + (oprs_unchanged_p, record_last_reg_set_info): Use them. + (compute_hash_table): Likewise. + +2001-08-27 Roman Zippel + + * flow.c (verify_flow_info): Use checksums to verify edges. + +2001-08-27 Richard Henderson + + * genautomata.c (expand_automata): Always create a description. + +2001-08-27 Geoffrey Keating + + * optabs.c (expand_binop): Correctly handle the carry in multiword + add/subtract operations. + +2001-08-27 Fred Fish + + * ginclude/stddef.h: Fix typo, __SIZE__TYPE__ should be + __SIZE_TYPE__. + +2001-08-27 Geoffrey Keating + + * reload.c (find_reloads_toplev): Back out this change: + + Wed Jul 26 19:44:05 2000 Hans-Peter Nilsson + + * reload.c (find_reloads_toplev): Reload a paradoxical subreg of a + mem if the address is a mode_dependent_address_p. + +2001-08-27 Vladimir Makarov + + * rtl.def (DEFINE_CPU_UNIT, DEFINE_QUERY_CPU_UNIT, EXCLUSION_SET, + PRESENCE_SET, ABSENCE_SET, DEFINE_BYPASS, DEFINE_AUTOMATON, + AUTOMATA_OPTION, DEFINE_RESERVATION, DEFINE_INSN_RESERVATION): New + RTL constructions. + + * genattr.c (main): New variable num_insn_reservations. Increase + it if there is DEFINE_INSN_RESERVATION. Output automaton based + pipeline hazard recognizer interface. + + * genattrtab.h: New file. + + * genattrtab.c: Include genattrtab.h. + (attr_printf, check_attr_test, make_internal_attr, + make_numeric_value): Move protypes into genattrtab.h. Define them + as external. + (num_dfa_decls): New global variable. + (main): Process DEFINE_CPU_UNIT, DEFINE_QUERY_CPU_UNIT, + DEFINE_BYPASS, EXCLUSION_SET, PRESENCE_SET, ABSENCE_SET, + DEFINE_AUTOMATON, AUTOMATA_OPTION, DEFINE_RESERVATION, + DEFINE_INSN_RESERVATION. Call expand_automata and write_automata. + + * genautomata.c: New file. + + * rtl.h (LINK_COST_ZERO, LINK_COST_FREE): Remove them. + + * sched-int.h: (curr_state): Add the external definition for + automaton pipeline interface. + (haifa_insn_data): Add comments for members blockage and units. + + * target-def.h (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN, + TARGET_SCHED_DFA_POST_CYCLE_INSN, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_INIT_DFA_BUBBLES, TARGET_SCHED_DFA_BUBBLE): New + macros. + (TARGET_SCHED): Use the new macros. + + * target.h (use_dfa_pipeline_interface, init_dfa_pre_cycle_insn, + dfa_pre_cycle_insn, init_dfa_post_cycle_insn, dfa_post_cycle_insn, + first_cycle_multipass_dfa_lookahead, init_dfa_bubbles, + dfa_bubble): New members in gcc_target.sched. + + * haifa-sched.c (insert_schedule_bubbles_p): New variable. + (MAX_INSN_QUEUE_INDEX): New macro for automaton interface. + (insn_queue): Redefine it as pointer to array. + (NEXT_Q, NEXT_Q_AFTER): Use MAX_INSN_QUEUE_INDEX instead of + INSN_QUEUE_SIZE. + (max_insn_queue_index_macro_value): New variable. + (curr_state, dfa_state_size, ready_try): New varaibles for + automaton interface. + (ready_element, ready_remove, max_issue): New function prototypes + for automaton interface. + (choose_ready): New function prototype. + (insn_unit, blockage_range): Add comments. + (unit_last_insn, unit_tick, unit_n_insns): Define them for case + FUNCTION_UNITS_SIZE == 0. + (insn_issue_delay, actual_hazard_this_instance, schedule_unit, + actual_hazard, potential_hazard): Add comments. + (insn_cost): Use cost -1 as undefined value. Remove + LINK_COST_ZERO and LINK_COST_FREE. Add new code for automaton + pipeline interface. + (ready_element, ready_remove): New functions for automaton + interface. + (schedule_insn): Add new code for automaton pipeline interface. + (queue_to_ready): Add new code for automaton pipeline interface. + Use MAX_INSN_QUEUE_INDEX instead of INSN_QUEUE_SIZE. + (debug_ready_list): Print newline when the queue is empty. + (max_issue): New function for automaton pipeline interface. + (choose_ready): New function. + (schedule_block): Add new code for automaton pipeline interface. + Print ready list before scheduling each insn. + (sched_init): Add new code for automaton pipeline interface. + Initiate insn cost by -1. + (sched_finish): Free the current automaton state and finalize + automaton pipeline interface. + + * sched-rgn.c: Include target.h. + (init_ready_list, new_ready, debug_dependencies): Add new code for + automaton pipeline interface. + + * sched-vis.c: Include target.h. + (get_visual_tbl_length): Add code for automaton interface. + (target_units, print_block_visualization): Add comments. + + * Makefile.in (GETRUNTIME, HASHTAB, HOST_GETRUNTIME, HOST_HASHTAB, + USE_HOST_GETRUNTIME, USE_HOST_HASHTAB, HOST_VARRAY): New variables. + (sched-rgn.o, sched-vis.o): Add new dependency file target.h. + (getruntime.o, genautomata.o): New entries. + (genattrtab.o): Add new dependency file genattrtab.h. + (genattrtab): Add new dependencies. Link it with `libm.a'. + (getruntime.o, hashtab.o): New entries for canadian cross. + + * doc/md.texi: Description of automaton based model. + + * doc/tm.texi (TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_ADJUST_COST): + Add comments. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_DFA_POST_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_INIT_DFA_BUBBLES, TARGET_SCHED_DFA_BUBBLE): The new + hook descriptions. + (TRADITIONAL_PIPELINE_INTERFACE, DFA_PIPELINE_INTERFACE, + MAX_DFA_ISSUE_RATE): New macro descriptions. + + * doc/contrib.texi: Add dfa based scheduler contribution. + + * doc/gcc.texi: Add more information about genattrtab. + +2001-08-27 Diego Novillo + + * flow.c (flow_loop_dump): Do not display insn UIDs if this is not + an RTL basic block. + +2001-08-27 Richard Henderson + + * function.c (expand_function_end): Don't init arg_pointer_save_area. + (get_arg_pointer_save_area): New. Create an init it here. + (fix_lexical_addr): Use it. + * function.h: Declare it. + * builtins.c (expand_builtin_setjmp_receiver): Use it. + * stmt.c (expand_nl_goto_receiver): Use it. + +2001-08-27 Richard Henderson + + * final.c (final_scan_insn): Don't enter APP_ON mode for + empty asm strings. + + * dwarf2asm.c (dw2_asm_output_encoded_addr_rtx): Use proper + alignment for assemble_integer for DW_EH_PE_aligned. + * except.c (output_function_exception_table): Likewise. + +2001-08-26 Andreas Jaeger + + * c-tree.h: Add prototyp for c_sizeof_nowarn. + +2001-08-25 Dan Nicolaescu + + * ssa-ccp.c (ssa_const_prop): Free ssa_edges. + +2001-08-27 Alan Modra + + * config/rs6000/rs6000.c (mask_operand): Rewrite without + bit-shifting loop. + (mask64_operand): Likewise. + (rldic_operand): Delete. + (includes_lshift64_p): Delete. + (includes_rldic_lshift_p): New function. + (includes_rldicr_lshift_p): New function. + (print_operand): Don't call rldic_operand in case 'W'. + * config/rs6000/rs6000-protos.h (rldic_operand): Remove. + (includes_lshift64_p): Remove. + (includes_rldic_lshift_p): Declare. + (includes_rldicr_lshift_p): Declare. + * config/rs6000/rs6000.h (PREDICATE_CODES): Remove rldic_operand. + * config/rs6000/rs6000.md : + Replace match_operand rldic_operand predicate with + const_int_operand. Replace includes_lshift64_p condition with + includes_rldic_lshift_p. + : New. + +2001-08-27 Andreas Jaeger + + * emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout. + * errors.c: Likewise. + * final.c: Likewise. + * dwarf2asm.c: Likewise. + * doprint.c (checkit): Likewise. + * diagnostic.c: Likewise. + * collect2.c: Likewise. + * calls.c: Likewise. + * c-semantics.c (build_stmt): Likewise. + * c-format.c (status_warning): Likewise. + * c-errors.c (pedwarn_c99): Likewise. + * builtins.c (validate_arglist): Likewise. + * config/pj/pj.c (pj_printf): Likewise. + * fix-header.c: Likewise. + * gcc.c: Likewise. + * gcov.c (fnotice): Likewise. + * gensupport.c (message_with_line): Likewise. + * mips-tfile.c: Likewise. + * protoize.c (notice): Likewise. + * read-rtl.c (fatal_with_file_and_line): Likewise. + * rtl-error.c: Likewise. + * tradcpp.c: Likewise. + * tree.c: Likewise. + * cp/tree.c (build_min_nt): Likewise. + (build_min): Likewise. + * cp/lex.c: Likewise. + * cp/errfn.c: Likewise. + * cp/rtti.c (create_pseudo_type_info): Likewise. + +Sun Aug 26 20:25:44 2001 Denis Chertykov + + * df.c (df_uses_record): Return after recording all uses + in ASM_OPERANDS. + +2001-08-26 Daniel Berlin + + * df.c (df_insn_modify): Realloc the INSN table here, if + necessary, here, too. + +2001-08-26 Aldy Hernandez + + * config/mips/mips.c (mips_function_value): Handle complex return + values. + +2001-08-25 Hans-Peter Nilsson + + * reload1.c (reload): Make all entries in reg_equiv_memory_loc + unshared. + * reload.c (make_memloc): Copy result if it is still + reg_equiv_memory_loc[regno] on return. + (subst_reloads) [ENABLE_CHECKING]: Check that none of + reg_equiv_constant, reg_equiv_memory_loc, reg_equiv_address and + reg_equiv_mem are modified by the substitutions. + +Sat Aug 25 23:07:35 CEST 2001 Jan Hubicka + + * predict.c (expensive_function_p): New. + * rtl.h (expensive_function_p): Declare. + * i386.c (FAST_PROLOGUE_INSN_COUNT): New constant. + (use_fast_prologue_epilogue): New static variable. + (expand_prologue): Set it; emit short prologues if unset. + (expand_epilogue): Likewise. + +2001-08-22 Geoffrey Keating + + * config.gcc: Add stormy16-*-elf case. + * config/stormy16/stormy-abi: New file. + * config/stormy16/stormy16-lib2.c: New file. + * config/stormy16/stormy16-protos.h: New file. + * config/stormy16/stormy16.c: New file. + * config/stormy16/stormy16.h: New file. + * config/stormy16/stormy16.md: New file. + * config/stormy16/t-stormy16: New file. + +Sat Aug 25 15:46:51 CEST 2001 Jan Hubicka + + * i386.h (no-accumulate-outgoing-args): Use proper mask. + +2001-08-24 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_initialize_trampoline): Function + descriptor members are pointer size, not constant 4. + * config/rs6000/rs6000.md (define_splits): Remove more unused + constraints. + +2001-08-24 Kaveh R. Ghazi + + * sparc.h (ASM_OUTPUT_BYTE): Fix format specifier warning. + +2001-08-24 Andreas Jaeger , rkl@connect.org.uk + + * cp/rtti.c (VPARAMS): Fix parameter. + +2001-08-24 Zack Weinberg + + * expmed.c: Default-#define HAVE_insv, HAVE_extv, and HAVE_extzv + to zero. + (mode_for_extraction): No need for #ifdefs. Add default-case abort + to switch. + (store_bit_field): Eliminate insv_bitsize variable. Put HAVE_insv + in if controlling use of insv. + (extract_bit_field): Likewise, for extv and extzv. + +Fri Aug 24 17:27:46 CEST 2001 Jan Hubicka + + * i386.md (movcc peep2): Fix load of 0. + +2001-08-24 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_p): Handle *_DIV_EXPR, + *_MOD_EXPR, SAVE_EXPR and NON_LVALUE_EXPR. + +2001-08-23 Jason Merrill + + * c-pragma.h: Move weak_syms and weak_decls... + * varasm.c: ...here. Now static. + (declare_weak, weak_finish, remove_from_pending_weak_list): Don't + depend on HANDLE_PRAGMA_WEAK. + + * c-common.c (c_alignof, c_alignof_expr): Move here... + * c-typeck.c: ...from here. + * c-tree.h, c-common.h: Adjust. + +2001-08-23 Bernd Schmidt + + * config/ia64/ia64.c (rws_update): If !pred, set write_count + instead of incrementing it. + + * config/ia64/ia64.c (ia64_sched_reorder): When there's more than one + asm ready, don't try to move them all into the same array element. + +Thu Aug 23 17:21:43 CEST 2001 Jan Hubicka + + * function.c (thread_prologue_and_epilogue_insns): Avoid + fallthru flag on edge to exit. + + * i386.md (trunc?fsi splitter): Conditionionize for non-sse. + + * flow.c (delete_noop_moves, propagate_block_delete_insn): Purge + dead edges. + +2001-08-23 Lars Brinkhoff + + * config/mcore/mcore.h (MACHINE_DEPENDENT_SIMPLIFY): Remove. + * config/mcore/mcore.c (mcore_dependent_simplify_rtx): Likewise. + * config/mcore/mcore-protos.h (mcore_dependent_simplify_rtx): + Remove prototype. + +2001-08-23 Lars Brinkhoff + + * genconstants.c, genpreds.c, libfuncs.h, optabs.h, rtl-error.h: + replace "GNU CC" with "GCC". + +2001-08-23 Richard Henderson + + * config/ia64/ia64.c (ia64_register_move_cost): Add mode arguemnt. + Reorganize. Handle ADDL like GR, add GR_AND_BR. Handle TFmode. + (ia64_secondary_reload_class): Need GR between AR/BR and anything. + Need GR between FR and not GR_AND_FR. + * config/ia64/ia64-protos.h (ia64_register_move_cost): Update. + * config/ia64/ia64.h (reg_class): Add GR_AND_BR_REGS, move + AR regs before GR regs. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update. + (PREFERRED_RELOAD_CLASS): Tweak for reordered classes. + (REGISTER_MOVE_COST): Update. + (MEMORY_MOVE_COST): Add GR_AND_FR_REGS. + +2001-08-23 Richard Henderson + + * regclass.c (init_reg_sets_1): Don't assume cost 2 within + a register class. + +2001-08-22 Geoffrey Keating + + * reload1.c (emit_reload_insns): Don't look for notes + on a NULL store_insn. + +2001-08-22 Kaveh R. Ghazi + + * sparc.c (uns_small_int): Don't reference a constant >32-bit. + (addrs_ok_for_ldd_peep): Fix signed/unsigned warning. + (sparc_flat_function_prologue, sparc_flat_function_epilogue): Fix + format specifier warnings. + (sparc_sched_reorder): Mark parameter with ATTRIBUTE_UNUSED. + +2001-08-22 David Billinghurst + + * config/i386/i386-protos.h: Correct declaration of + i386_pe_asm_named_section. + +2001-08-22 John David Anglin + + * pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Add declaration for + variable i. + * pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise. + +2001-08-22 Neil Booth + + * cpperror.c (print_location): Don't show _Pragma. + * cppfiles.c (_cpp_pop_file_buffer): Handle -include file pushing + and file change callback generation here. + (stack_include_file): Update use of cpp_push_buffer. + * cpphash.h (_cpp_pop_file_buffer): Update prototype. + (struct cpp_buffer): Remove type, pfile members. + * cppinit.c (cpp_handle_option): Use free_chain. + * cpplex.c (_cpp_lex_token): Don't do -include file pushing here. + (skip_escaped_newlines, get_effective_char, lex_percent): Take + a cpp_reader rather than a cpp_buffer. + (skip_escaped_newlines, get_effective_char, skip_block_comment, + skip_line_comment, parse_string, lex_percent, lex_dot, + _cpp_lex_token): Update accordingly. + * cpplib.c (_cpp_pop_buffer): Don't do file change callback + generation here. + (cpp_push_buffer): Update prototype. + (run_directive): Update use of cpp_push_buffer. + (_cpp_do__Pragma, cpp_define, cpp_define_builtin, cpp_undef, + handle_assertion): Update use of run_directive. + * cpplib.h (enum cpp_buffer_type): Remove. + (cpp_push_buffer): Update prototype. + * fix-header.c (read_scan_file): Update. + +2001-08-22 Matt Kraai + + * gcc.c (struct prefix_list): Change prefix to const char *. + +2001-08-22 Matt Kraai + + * final.c (final_scan_insn): Call ADDR_VEC_ALIGN on next insn. + +2001-08-22 Jason Merrill + + * explow.c (set_mem_attributes): Avoid returning a bogus alias set + from a new MEM. + + * jump.c (squeeze_notes): Take parms by reference. Handle END being + a squeezable note. + * rtl.h: Adjust. + * ifcvt.c (dead_or_predicable): Adjust. + * loop.c (find_and_verify_loops): Adjust. + * stmt.c (expand_end_case): Adjust. + * flow.c (merge_blocks_move_successor_nojumps): Adjust. Modify the + head and end insn pointers in the basic block, not just local copies. + (merge_blocks_move_predecessor_nojumps): Likewise. + +2001-08-22 Lars Brinkhoff + + * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, + bitmap.h, builtin-types.def, builtins.c, builtins.def, + c-aux-info.c, c-common.c, c-common.def, c-common.h, + c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, + c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, + c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, + caller-save.c, calls.c, collect2.c, collect2.h, combine.c, + conditions.h, config.gcc, configure.frag, configure.in, + conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, + cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, + dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, + doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, + dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, + emit-rtl.c, errors.c, errors.h, except.c, except.h, + exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, + fixproto, flags.h, flow.c, fold-const.c, fp-test.c, + function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, + gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, + gencheck.c, gencodes.c, genconfig.c, genemit.c, + genextract.c, genflags.c, gengenrtl.c, genmultilib, + genopinit.c, genoutput.c, genpeep.c, genrecog.c, + gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, + ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, + graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, + gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, + gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, + hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, + integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, + libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, + machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, + mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, + mkmap-symver.awk, optabs.c, output.h, params.c, params.def, + params.h, predict.c, predict.def, predict.h, prefix.c, + prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, + read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, + regclass.c, regmove.c, regrename.c, regs.h, reload.c, + reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, + rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, + sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, + sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, + ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, + stringpool.c, system.h, timevar.c, timevar.def, timevar.h, + tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, + tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, + unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, + unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, + xcoffout.h: replace "GNU CC" with "GCC". + +2001-08-21 Richard Henderson + + * final.c (LABEL_ALIGN_AFTER_BARRIER): Default to no alignment. + (final_scan_insn): Consider jump tables data even if we have no + independent text section if !JUMP_TABLES_IN_TEXT_SECTION. Use + ADDR_VEC_ALIGN. + * config/ia64/ia64.h (JUMP_TABLES_IN_TEXT_SECTION): Remove. + (ASM_OUTPUT_CASE_END): Remove. + (ASM_OUTPUT_ADDR_DIFF_ELT): Emit pc-relative references. + * config/ia64/ia64.md (tablejump): Decode pc-relative references. + * config/ia64/sysv4.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Remove. + +2001-08-21 Richard Henderson + + * config/ia64/ia64.c (emit_all_insn_group_barriers): Flush state + at barrier insns. Emit stop bits before barriers. + + * flow.c (flow_find_cross_jump): Don't consider unconditional + return insns for commoning. + + * final.c (compute_alignments): Fix typo. + + * expmed.c (CODE_FOR_insv, gen_insv): Provide defaults. + (CODE_FOR_extv, gen_extv, CODE_FOR_extzv, gen_extzv): Likewise. + (store_bit_field): Use mode_for_extraction more places. + (extract_bit_field): Likewise. + +2001-08-21 Zack Weinberg + + * caller-save.c: Don't include insn-codes.h. + (reg_save_code, reg_restore_code): Make arrays of int. + All uses updated to match. + (insert_save, insert_restore): No need to initialize "code" + variable upon declaration. + * Makefile.in: update dependencies; fix typo in clean rule. + +2001-08-21 Richard Henderson + + * ifcvt.c (find_if_block): Allow join_bb as EXIT. + (merge_if_block): Handle fallout from same. + +2001-08-21 Kaveh R. Ghazi + + * builtins.c (type_to_class): Fix typo in last change. + +2001-08-21 Richard Henderson + + * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Don't emit '#' if + ia64_asm_output_label. + + * config/ia64/crtbegin.asm (__do_global_dtors_aux): Use saved + copy of gp while the real gp register contains garbage. + +2001-08-21 Zack Weinberg + + * expmed.c (mode_for_extraction): New function. + (store_bit_field, extract_bit_field): Use it. + * expr.h: Prototype it and provide an enum for its first argument. + + * combine.c, function.c, recog.c: Don't include insn-codes.h. + Use mode_for_extraction rather than testing HAVE_insv/extv/extzv + and digging through the insn_data tables. + * Makefile.in: Update dependencies. + +2001-08-22 Neil Booth + + * cppfiles.c (stack_include_file): line-map.c now handles include + depth. + (handle_missing_handler): Similarly. + (_cpp_execute_include): Similarly. + (_cpp_pop_file_buffer): Similarly. + * cpphash.h (struct cpp_reader): Remove system_include_depth, + buffer_stack_depth and include_depth. + * cpplib.c (do_include_common): line-map.c now handles include depth. + (cpp_push_buffer): Similarly. + (_cpp_pop_buffer): Similarly. + * cppmacro.c (builtin_macro): Update. + * line-map.c (init_line_maps): Set depth. + (add_line_map): Increment "used" earlier. Update and use the + include depth. + (trace_include): Use the include depth. + * line-map.h (struct line_maps): New member depth. + +2001-08-21 Neil Booth + + * cppfiles.c (stack_include_file): Don't handle -H here. + * cppinit.c (cpp_start_read): Set include tracing after + cpp_post_options and after stacking the main file. + * line-map.c (trace_include): New. + (init_line_maps, add_line_map): Update. + * line-map.h (struct line_maps): New member trace_includes. + +2001-08-21 Neil Booth + + * cppfiles.c (stack_include_file): Harmonize system headerness tests. + * cppfiles.c (stack_include_file): Only stack a file if there + is something to do. Return a boolean indicating whether a + buffer was stacked or not. + (_cpp_execute_include): Similarly. + (_cpp_read_file): Similarly. + * cpphash.h (_cpp_read_file, _cpp_execute_include): Update prototypes. + +2001-08-21 Sam Steingold + + * tradcpp.c (rescan): define obufp_before_macroname before RECACHE + (RECACHE): keep obufp_before_macroname up to date + +2001-08-21 Zack Weinberg + + * stmt.c: Don't include insn-codes.h. + (expand_end_case): Machine specific logic moved to expr.c. + No need to worry about __builtin_classify_type. + (check_for_full_enumeration_handling, emit_case_nodes): + Kill #if 0 blocks. + + * builtins.o (expand_builtin_classify_type): Split up so code + can be shared with fold_builtin_classify_type. + (type_to_class, fold_builtin_classify_type): New functions. + (fold_builtins): Handle __builtin_classify_type. + + * expr.c (do_tablejump): Now static. + (case_values_threshold, try_casesi, try_tablejump): New; + code mostly from stmt.c (expand_end_case). + (expr.h): Update prototypes. + + * Makefile.in (stmt.o): Update dependencies. + +2001-08-21 Will Cohen + + * configure/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Added local + declaration of variable i. + * configure/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Added local + declaration of variable i. + +2001-08-21 Richard Henderson + + * crtstuff.c: Fix thinko last change. Move list tails to start + of CRT_END section. Tidy ifdefs. + (__EH_FRAME_BEGIN__): Always static for ELF. + (__do_global_ctors_1): Rename from __frame_dummy. + * config/mips/iris6.h (LINK_SPEC): Update for __do_global_ctors_1 + name change; don't hide __EH_FRAME_BEGIN__. + +2001-08-21 Richard Henderson + + * gdbinit.in: Move break on exit after break on fancy_abort. + + * config/ia64/ia64.c (ia64_return_in_memory): True for variable + sized types. + +2001-08-21 Neil Booth + + * cpphash.h (_cpp_push_next_buffer): New. + * cppinit.c (do_includes): Remove. + (push_include, free_chain, _cpp_push_next_buffer): New. + (cpp_start_read): Use them to rework command line option handling. + (cpp_handle_option): Combine handling of -include and -imacros. + * cpplex.c (_cpp_lex_token): Push a new -include buffer if + appropriate. Always insert missing \n at EOF. + * cpplib.c (start_directive): Get the directive position right. + * cppmain.c (cb_file_change): Always print the first line, unless + preprocessed. + +2001-08-20 Andreas Jaeger + + * profile.c (compute_branch_probabilities): Remove extra new-line + in error message. + * flow.c (verify_flow_info): Likewise. + +2001-08-20 Diego Novillo + + * basic-block.h (basic_block): Add new field 'flags'. + (BB_REACHABLE): Define. + (expunge_block): Declare. + * flow.c (ENTRY_BLOCK_PTR): Initialize field 'flags'. + (EXIT_BLOCK_PTR): Ditto. + (expunge_block): Remove static declaration. + (cleanup_cfg): Clear bb->aux on every basic block. + (find_unreachable_blocks): Set BB_REACHABLE bit in bb->flags when + computing reachability. + (delete_unreachable_blocks): Delete block b if b->flags has + BB_REACHABLE unset. + +2001-08-20 Diego Novillo + + * doc/invoke.texi: Replace references to -fdump-tree with -fdump-ast. + +2001-08-20 Kaveh R. Ghazi + + * sparc.c (sparc_variable_issue): Fix typo in last change. + +2001-08-20 Richard Henderson + + * varasm.c (assemble_integer): Document ppc-eabi -mrelocatable losage. + +2001-08-20 John David Anglin + + * pa.h (RETURN_IN_MEMORY): Improve comment. + +2001-08-20 Janis Johnson + + * doc/invoke.texi (Profiling options): Clarify the interactions + between -fprofile-arcs and -ftest-coverage, -fprofile-arcs. + +2001-08-20 Jeffrey Oldham + + * crtstuff.c (__do_global_ctors): Fix typo in preprocessing + command. + +2001-08-20 Matt Kraai + + * gcc.c (make_relative_prefix): Allocate a sufficiently large + buffer. + +2001-08-20 Richard Henderson + + * final.c (end_final): Fix typo last change. + +2001-08-20 Neil Booth + + * cppinit.c (init_standard_includes): The returned buffer + is already malloc-ed. + * gcc.c (add_prefix): Similarly. + * prefix.c (translate_name): Update to support clear buffer + ownership rules. + (update_path): Similarly. Be sure to free any newly allocated + key. UPDATE_PATH_HOST_CANONICALIZE takes only one argument. + (tr): New function. + * prefix.h (update_path): Update prototype and document. + * config/i386/xm-djgpp.h (UPDATE_PATH_HOST_CANONICALIZE): Clean + up and update to new buffer ownership rules. + * doc/gcc.texi (UPDATE_PATH_HOST_CANONICALIZE): Update. + +Mon Aug 20 01:44:50 CEST 2001 Jan Hubicka + + * final.c (compute_alignments): New function. + (init_insn_lengths): Do not care label_align. + (LABEL_ALIGN_AFTER_BARRIER): Default to 1. + (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to 0. + (JUMP_ALIGN, JUMP_ALIGN_MAX_SKIP): New. + (shorted_branches): Realloc label_align array; do + not call init_insn_lengths; Do not care about loop alignments. + * output.h (compute_alignments): Declare. + * toplev.c (rest_of_compilation): Call compute_alignments. + * tm.texi (JUMP_ALIGN, JUMP_ALIGN_MAX_SKIP): Document. + + * predict.c (block_info_def): Add npredecesors, remove nvisited; + change visited to tovisit. + (propagate_freq): Use faster traversing algorithm. + (estimate_loops_at_level, estimate_bb_frequencies): Change visited + to tovisit; reverse meaning. + + * predict.c (struct block_info_def): Remove nvisited. + (propagate_freq): Use EDGE_DFS_BACK to detect irreducible regions. + (estimate_bb_frequencies): Call mark_dfs_back_edges. + +2001-08-19 Geoffrey Keating + + * doc/invoke.texi (MIPS Options): Document -mfused-madd. + * config/mips/mips.h (MASK_NO_FUSED_MADD): New. + (TARGET_FUSED_MADD): New. + (TARGET_SWITCHES): Add -mfused-madd, -mno-fused-madd. + * config/mips/mips.md: Add TARGET_FUSED_MADD as condition to + the multiply-add instructions. + +2001-08-19 Richard Henderson + + * dwarf2asm.c (dw2_output_indirect_constant_1): The symbol ref + is aligned to pointer size. + +2001-08-19 Richard Henderson + + * config/ia64/ia64.c (ia64_cycle_display): Only emit cycle + display markers during final schedule. + +2001-08-19 Richard Henderson + + * function.c (gen_mem_addressof): Don't call get_alias_set if no decl. + +2001-08-19 Richard Henderson + + * config/ia64/ia64.h (STRIP_NAME_ENCODING): Handle @ and * + in the same string. + (ASM_NAME_TO_STRING): Remove. + * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Handle @ and * + in the same string. Remove support for expressions. + +2001-08-19 Richard Henderson + + * config/i386/i386.md (tablejump): Make an expander; handle + pic relative addressing here. + (tablejump_1): Rename from tablejump_pic. + (casesi): Remove. + +2001-08-19 Richard Henderson + + * regclass.c (fix_register): Fix typo. + +2001-08-18 Richard Henderson + + * config/ia64/unwind-ia64.c (UNW_REG_B0): New. + (struct _Unwind_Context): Expand br_loc to hold it. + (uw_frame_state_for): Handle leaf functions better. + (uw_update_reg_address): Update for br_loc change. + +2001-08-18 Richard Henderson + + * crtstuff.c: Move list heads before code that uses them. + (__JCR_LIST__): Remove initial null. + (frame_dummy, __frame_dummy): Do java registration here ... + (__do_global_ctors_aux): ... not here. + + * config/ia64/crtbegin.asm (dtor_ptr): Make gp-relative. + (__do_global_dtors_aux): Update to match. + (__JCR_LIST__, __do_jv_register_classes): New. + (.init): Call it. + * config/ia64/crtend.asm (__JCR_END__): New. + (__do_global_ctors_aux): Use a GPREL64I reloc to __CTOR_END__ + instead of an indirect LTOFF22 reloc. + +2001-08-18 Richard Henderson + + * flow.c (mark_regs_live_at_end): Use regs_invalidated_by_call. + * regclass.c (init_reg_sets_1): Fix typo. + * config/ia64/ia64.c (ar_pfs_reg_operand): New. + (ia64_expand_call): Pass ar.pfs to sibcall expanders. + (ia64_compute_frame_size): Make ar.unat live when in use. + (ia64_epilogue_uses): Reformat; do not check current_function_is_leaf + for ar.pfs; remove ar.unat handling. + * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): ar.unat is + call-saved. + (PREDICATE_CODES): Add ar_pfs_reg_operand. + * config/ia64/ia64-protos.h: Update decls. + * config/ia64/ia64.md (sibcall_nopic): Use ar.pfs. + (sibcall_pic): Likewise. + +2001-08-18 Richard Henderson + + * config/ia64/ia64.c (ia64_sched_reorder2): Also skip past + pred_rel_mutex when searching for insn_group_barrier. + * config/ia64/ia64.md (cycle_display): Combine the expander + and insn patterns. + + * config/ia64/ia64.c (ia64_internal_sched_reorder): Emit stop + bit before asm as needed. + +2001-08-18 Richard Henderson + + * timevar.def (TV_MACH_DEP): New. + * toplev.c (rest_of_compilation): Use it. + * config/ia64/ia64.c (ia64_reorg): Push to TV_SCHED2. + +2001-08-18 Zack Weinberg + + * unwind-dw2.c (execute_stack_op): Add default aborts to + the inner switches to prevent warnings. + +2001-08-18 Richard Henderson + + * timevar.h (struct timevar_time_def): Change element type to float. + (ticks_to_msec, clocks_to_msec): Likewise. + (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Rescale to seconds; use type float. + (get_time): Likewise. + (timevar_print): Adjust zero check and printing to match. + +2001-08-18 Zack Weinberg + + * doc/extend.texi, doc/gcc.texi, doc/install-old.texi, + doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/include/gpl.texi: + Eliminate overfull or underfull hboxes. + +2001-08-18 Zack Weinberg + + * cpperror.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout. + +2001-08-18 Zack Weinberg + + * haifa-sched.c: Convert to target hooks. Macros replaced + are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, + MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, + MD_SCHED_FINISH, and HAVE_cycle_display. + * target-def.h (TARGET_SCHED_ADJUST_COST, + TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, + TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, + TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, + TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): + New hook #defines to be overridden. + (TARGET_SCHED): Bring them all together. + (TARGET_INITIALIZER): Update. + * target.h: Don't forward declare struct rtx_def. Use 'rtx' + instead of 'struct rtx_def *' throughout. + (struct sched): New set of hooks for the scheduler. + * Makefile.in (haifa-sched.o): Depend on target.h. + * doc/tm.texi: Document the new scheduler hooks, together in + their own section, instead of scattered around. + Fix a bunch of underfull/overfull hboxes. + + * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, + ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, + sparc.h: Don't define any of the old scheduler macros. + + * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, + ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, + sparc.c: Create hook functions from code extracted from + corresponding target header, or make existing hooks static, as + appropriate. Set the appropriate entries in targetm. + + * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, + i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, + rs6000-protos.h, s390-protos.h, sparc-protos.h: + Remove prototypes for functions which are now static. + + * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and + related gunk; the Haifa scheduler is now the only choice. + +2001-08-18 Zack Weinberg + + * optabs.h (OTI_flodiv, flodiv_optab): Kill. + * genopinit.c: Put floating point divide insns in sdiv_optab. + * expr.c (expand_expr): Use sdiv_optab, not flodiv_optab. + * config/gofast.h, config/c4x/c4x.h, + config/ia64/hpux_longdouble.h, config/mips/mips.h, + config/pa/long_double.h, config/rs6000/sysv4.h, + config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab. + * optabs.c (init_optab): Break into new_optab, init_optab, init_optabv. + (init_optabs): Use init_optabv for overflow-trapping optabs. + Don't init flodiv_optab. Give mov_optab, movstrict_optab, and + cmp_optab RTX codes so have_insn_for can find them. + + * optabs.c (expand_simple_binop, expand_simple_unop, + have_insn_for, gen_sub3_insn): New interfaces. + * expr.h: Prototype new functions. + (enum optab_methods): Move here from optabs.h. + + * builtins.c, combine.c, doloop.c, function.c, ifcvt.c, + loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c: + Use new functions instead of working directly with optabs. + * doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c, + unroll.c: Don't include optabs.h. + * caller-save.c, combine.c, function.c, stmt.c: Just include + insn-codes.h, not optabs.h. + * Makefile.in: Update dependencies. + + * combine.c (make_compound_operation, simplify_comparison): + Fix typos testing for this or that instruction. + +2001-08-18 Herman A.J. ten Brugge + + * mklibgcc.in: Prefer LIB1ASMFUNCS over LIB2_DIVMOD_FUNCS when + generating libgcc.a. + +2001-08-18 Kaveh R. Ghazi + + * except.c (TYPE_HASH): Delete. + + * objc/objc-act.c (HASHFUNCTION): Cast to size_t, not + HOST_WIDE_INT. + + * tree.c (TYPE_HASH): Delete. + + * tree.h (TYPE_HASH): Define. + +2001-08-18 Graham Stott + + * config/mips/mips.md (adddi3_internal_2+1): Remove constraints from + define_split. + (adddi3_internal_2+2): Likewise. + (eh_set_lr_di+1): Likewise. + +2001-08-17 Richard Henderson + + * defaults.h (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, + UNALIGNED_DOUBLE_INT_ASM_OP, ASM_BYTE_OP): Move from ... + * dwarf2asm.c: ... here. + * dwarfout.c: Remove them. + + * varasm.c (assemble_integer): Add align parameter. + (assemble_real, output_constant, output_constructor): Likewise. + * output.h: Update decls. + * dwarf2asm.c, final.c, varasm.c, config/darwin.c, config/nextstep.c, + config/alpha/alpha.c, config/arm/arm.md, config/clipper/clipper.c, + config/m88k/m88k.c, config/mcore/mcore.md, config/mips/mips.h, + config/mips/mips.md, config/pa/pa.c, config/rs6000/rs6000.c, + config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.md: + Update all callers. + + * final.c (end_final): Abort profile block generation if we + haven't layed it out properly. + * output.h (assemble_eh_integer): Remove stale decl. + * varasm.c (assemble_zeros): Tidy; use assemble_integer. + (min_align): New. + (assemble_integer): Handle unaligned data. + (assemble_real): Abort on unaligned data. + (output_constructor): Don't assume ASM_OUTPUT_ALIGN 0 does + anything useful. + (default_dtor_section_asm_out_destructor): Use assemble_align. + (default_named_section_asm_out_constructor): Likewise. + (default_ctor_section_asm_out_constructor): Likewise. + * config/darwin.c (machopic_asm_out_constructor): Likewise. + (machopic_asm_out_destructor): Likewise. + * config/nextstep.c (nextstep_asm_out_constructor): Likewise. + (nextstep_asm_out_destructor): Likewise. + * config/alpha/alpha.c (vms_asm_out_constructor): Likewise. + (vms_asm_out_destructor): Likewise. + +2001-08-17 Richard Henderson + + * config/mips/iris6.h (TARGET_IRIX6): New. + (current_section_name, current_section_flags): New. + (ASM_OUTPUT_ALIGN, ASM_FILE_START, ASM_FILE_END): New. + (MAX_OFILE_ALIGNMENT): New. + (ASM_OUTPUT_ALIGNED_LOCAL): Use bss_section. + * config/mips/mips.c (mips_make_temp_file, temp_filename): Remove. + (copy_file_data): Split out from + (mips_asm_file_end): ... here. + (mips_asm_file_start): Remove extra .section directive. Use + tmpfile instead of mips_make_temp_file. + (mips_unique_section): Use const char * as needed for warnings. + (iris6_asm_named_section_1): Renamed from iris6_asm_named_section; + re-add align parameter. + (iris6_asm_named_section): New. + (iris_section_align_entry_eq, iris_section_align_entry_hash): New. + (iris6_asm_output_align, iris6_section_align_1): New. + (iris6_asm_file_start, iris6_asm_file_end): New. + * config/mips/mips-protos.h: Update decls. + +2001-08-17 Janis Johnson + + * doc/install.texi (Install GCC): Add links to build status pages. + (Specific): Ditto. + (Final install): Ditto; request updates for specific info + +2001-08-17 Neil Booth + + * cpperror.c (print_location): Don't take a file name; use the + line map instead. + (_cpp_begin_message): Similarly. + (cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning, + cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update. + (cpp_pedwarn_with_file_and_line): Remove. + * cppfiles.c (stack_include_file): Update; set filename to stdin + here when appropriate. + * cpphash.h (struct cpp_buffer): Remove nominal_fname. + (_cpp_begin_message): Don't take a file name. + * cppinit.c: Add comment. + * cpplex.c: Fix end-of-directive indicator. + * cpplib.c: Don't include intl.h. + (run_directive, do_diagnostic): Update. + (do_line): Update to not use nominal_fname. + (cpp_push_buffer): Don't take a filename. + * cpplib.h (struct ht): Remove. + (cpp_push_buffer): Don't take a filename. + (cpp_pedwarn_with_file_and_line): Remove. + * cppmacro.c (struct cpp_macro): Remove file. + (builtin_macro): Update. + (_cpp_create_definition): Update. + * cppmain.c: Correct comment. + * fix-header.c (read_scan_file): Update. + +2001-08-17 Kazu Hirata + + * sbitmap.c: Fix comment formatting. + * sched-deps.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * ssa.c: Likewise. + * ssa-ccp.c: Likewise. + * stor-layout.c: Likewise. + * timevar.c: Likewise. + * toplev.c: Likewise. + * unwind-dw2.c: Likewise. + * unwind-dw2-fde.c: Likewise. + * varasm.c: Likewise. + +2001-08-17 John David Anglin + + * pa.h (RETURN_IN_MEMORY): Return types with a size that is varable + or larger than an integer in memory. + +2001-08-17 Zack Weinberg + + * system.h: Forward-declare struct rtx_def, struct rtvec_def, + and union tree_node. Typedef rtx, rtvec, and tree. Fix comment. + * rtl.h: Don't forward-declare union tree_node here. Don't + typedef rtx or rtvec here. Change all uses of struct rtx_def *, + struct rtvec_def *, or union tree_node * to use rtx, rtvec, + and tree respectively. + * tree.h: Don't forward-declare struct rtx_def here. Don't + typedef tree here. Change all uses of struct rtx_def *, + struct rtvec_def *, or union tree_node * to use rtx, rtvec, + and tree respectively. + +2001-08-17 Richard Henderson + + * config/mips/elf.h, config/mips/elf64.h, config/mips/netbsd.h, + config/mips/openbsd.h: Fix typos last change. + +2001-08-17 Gerald Pfeifer + + * doc/invoke.texi (Optimize Options): The default for + -finline-limit is 600. + +2001-08-17 Richard Henderson + + * varasm.c (text_section): Allow TEXT_SECTION to override the + printing of TEXT_SECTION_ASM_OP. + * dwarf2out.c (TEXT_SECTION_NAME): Rename from TEXT_SECTION. + (DATA_SECTION, BSS_SECTION): Remove. + * dwarfout.c (TEXT_SECTION_NAME, DATA_SECTION_NAME, DATA1_SECTION_NAME, + RODATA_SECTION_NAME, RODATA1_SECTION_NAME, BSS_SECTION_NAME): + Rename from s/_NAME//. + * config/mips/mips.h (TARGET_FILE_SWITCHING): Add !TARGET_MIPS16. + (ASM_DECLARE_FUNCTION_NAME): Move file switching ... + (TEXT_SECTION): ... here. New. + * config/mips/elf.h (TEXT_SECTION): New; no file switching. + * config/mips/elf64.h, config/mips/netbsd.h: Likewise. + * config/mips/openbsd.h: Likewise. + * config/mips/mips.c (mips_asm_file_start): Tidy file switching test. + (mips_asm_file_end): Likewise test. + (mips_output_function_epilogue): Likewise. Switch back to data + section after emitting the function. + + * doc/tm.texi (Sections): Document TEXT_SECTION. + +2001-08-17 Richard Henderson + + * dwarf2out.c (dwarf2out_init): Don't emit .debug_loc label here. + (dwarf2out_finish): Do it here. Emit .debug_loc before .debug_info. + +2001-08-17 Richard Henderson + + * varasm.c (assemble_variable): Don't overalign if DECL_USER_ALIGN. + * crtstuff.c (__CTOR_LIST__, __DTOR_LIST__, __EH_FRAME_BEGIN__, + __JCR_LIST__, __CTOR_END__, __DTOR_END__, __FRAME_END__,__JCR_END__): + Add aligned attribute. + +2001-08-17 Andrew Haley + + * config/sh/sh.md: Add modes to unspecs in first insn to match + those in the second. + + * Makefile.in: Fix collect2 copy for Cygwin. + +Fri Aug 17 15:48:57 CEST 2001 Jan Hubicka + + Install the proper patch. + * function.c (put_var_into_stack): Temporarily clear DECL_RTL. + (assign_params): Avoid setting DECL_RTL to unfinished RTX. + (expand_function_start): Likewise. + * stmt.c (expand_decl): Likewise. + * varasm.c (make_decl_rtx): Likewise. + +Fri Aug 17 15:41:35 CEST 2001 Jan Hubicka + + * final.c: Undo my previous accidental checkin. + * output.h: Likewise. + * tm.texi: Likewise. + +2001-08-16 Richard Henderson + + * varasm.c (named_section_flags): Remove align parameter. + * varasm.c, dwarf2out.c: Update all callers. + * output.h: Update prototypes. + + * target.h (target.asm_out.named_section): Remove align parameter. + * varasm.c, config/a29k/a29k.c, config/alpha/alpha.c, + config/arm/arm.c, config/c4x/c4x.c, config/h8300/h8300.c, + config/i386/i386.c, config/i386/winnt.c, config/m68k/m68k.c, + config/mcore/mcore.c, config/mips/mips.c, config/rs6000/rs6000.c, + config/sh/sh.c, config/sparc/sparc.c: Update implementations to match. + + * varasm.c (in_named_entry_eq, in_named_entry_hash): New. + (get_named_section_flags, set_named_section_flags): New. + (named_section_flags): Use them. + (named_section): Do decl vs section flags check here... + (default_section_type_flags): ... not here. + (init_varasm_once): Create in_named_htab. + (resolve_unique_section): Mark reloc unused. + +2001-08-16 Richard Henderson + + * varasm.c (force_const_mem): Keep pool alignment in bits. + (output_constant_pool): Use assemble_align. + +2001-08-16 Zack Weinberg + + * doc/tm.texi: Remove extra @table command. + +2001-08-16 Zack Weinberg + + * final.c (shorten_branches): Clear the end of the label_align + array only if we made it larger. Break up messy expressions + for clarity. + + * diagnostic.c (internal_error): Check for error recursion + before doing ICE suppression. + + * timevar.c: Timing variables now count in milliseconds. + (init_timevar): Set up ticks_to_msec and clocks_to_msec here. + (get_time): Not here. + (timevar_print): Don't print any timer whose user, cpu, and + wall times are all zero as displayed. + * timevar.h: Update comment aboout units. Make timevar + counters unsigned. + +Thu Aug 16 17:39:45 CEST 2001 Jan Hubicka + + * function.c (put_var_into_stack): Temporarily clear DECL_RTL. + (assign_params): Avoid setting DECL_RTL to unfinished RTX. + (expand_function_start): Likewise. + * stmt.c (expand_decl): Likewise. + * varasm.c (make_decl_rtx): Likewise. + +2001-08-16 Jason Merrill + + * stor-layout.c (layout_decl): Don't set DECL_USER_ALIGN. + (finalize_record_size): Don't set TYPE_USER_ALIGN. + +2001-08-16 Matt Kraai + + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Remove unused + variables. + +2001-08-16 Andreas Jaeger + + * config/s390/s390.c: Include "debug.h" for dwarf2out_do_frame + prototype. + +Wed Aug 15 15:22:52 EDT 2001 John Wehle (john@feith.com) + + * rtl.h (only_sets_cc0_p): New prototype. + * jump.c (sets_cc0_p): Handle INSN. + (only_sets_cc0_p): New function. + * flow.c (merge_blocks_nomove): Use only_sets_cc0_p. + (tidy_fallthru_edge): Likewise. + * integrate.c (copy_insn_list): Likewise. + * unroll.c (unroll_loop): Likewise. + (copy_loop_body): Likewise. + +2001-08-15 Jason Eckhardt + + * config/i960/i960.md (trap): Change "faulteq.t" to "faulte.t". + +Wed Aug 15 14:24:22 CEST 2001 Jan Hubicka + + * predict.c (struct block_info_def): Remove nvisited. + (propagate_freq): Use EDGE_DFS_BACK to detect irreducible regions. + (estimate_bb_frequencies): Call mark_dfs_back_edges. + + * i386.c (ix86_agi_dependant): Lea causes AGI only on the Pentium + (ix86_adjust_cost): Teach scheduler that latency to load operand can + be masked. + +Wed Aug 15 12:41:32 CEST 2001 Jan Hubicka + + * predict.def: Update hitrates. + +2001-08-15 Richard Henderson + + * except.c (TYPE_HASH): Cast to size_t, not HOST_WIDE_INT. + +Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com) + + * flow.c (commit_one_edge_insertion): Don't separate a LOOP_BEG + note from its associated jump. + +2001-08-14 Ulrich Weigand + + * config/s390/linux64.h (CPP_PREDEFINES): Define __s390__ + also on 64-bit s390x targets. + +2001-08-14 Nick Clifton + + * config/arm/arm.c (arm_compute_initial_elimination_offset): New + function. + (arm_expand_prologue): Handled nested functions which take a + variable argument list. + * config/arm/arm.h (ARM_INITIAL_ELIMINATION_OFFSET): Replace + macro with an invocation of + arm_compute_initial_elimination_offset. + * config/arm/arm-protos.h: Prototype + arm_compute_initial_elimination_offset. + +2001-08-14 Gerald Pfeifer + + * doc/install.texi (Specific, avr): Fix markup. + (Specific, c4x): Ditto. + +2001-08-14 Matt Kraai + + * predict.c (dump_prediction): Change `bool' parameter to `int'. + +2001-08-14 Gabriel Dos Reis + + * Makefile.in (OBJS): Add rtl-error.o + (rtl-error.o): New rule. + (diagnostic.o): Adjust dependency. + diagnostic.c (file_and_line_for_asm, diagnostic_for_asm, + error_for_asm, _fatal_insn, _fatal_insn_not_found, + warning_for_asm): Move to... + rtl-error.c: ...here. New file. + +2001-08-14 Richard Henderson + + * dwarf2out.c (dwarf2out_frame_finish): Never emit .eh_frame + if USING_SJLJ_EXCEPTIONS. + +2001-08-14 Steve Ellcey + + * tlink.c (scan_linker_output): Check string for unsatisfied in + addition to undefined and unresolved. + +2001-08-14 Graham Stott + + * libgcc2.c (*): Replace EH_FRAME_SECTION with + EH_FRAME_SECTION_NAME. + +Tue Aug 14 14:57:07 CEST 2001 Jan Hubicka + + * genattrtab.c (simplify_test_exp_in_temp): New function. + (simplify_test_exp): Avoid explicit use of temporary obstack. + (simplify_cond, insert_right_side, evaluate_eq_attr, + simplify_and_tree, simplify_or_tree, eliminate_known_true): + Use simplify_test_exp_in_temp. + (optimize_attrs): Iterate until expression stabilizes. + +2001-08-13 Ulrich Weigand : + + * glimits.h: Remove the __LONG_MAX__ special case for s390x. + * config/s390/linux64.h: Define __LONG_MAX__ in CPP_PREDEFINES. + +2001-08-13 Richard Henderson + + * config/arm/unknown-elf.h (CTOR_LIST_BEGIN, CTOR_LIST_END): Remove. + (DTOR_LIST_BEGIN, DTOR_LIST_END): Remove. + * config/arm/conix-elf.h: Likewise. + +2001-08-13 Geoffrey Keating + + * config/svr4.h (LINK_SPEC): Don't do -Wl, here, it is done + in gcc.c. + * config/rs6000/sysv4.h (LINK_SPEC): Likewise. + + * gcse.c (hash_scan_set): Expressions that are set as part of + jump instructions are not available. + +2001-08-13 Ulrich Weigand + + * config/s390/s390.c (print_operand, s390_function_prologue, + s390_va_start): Fixed HOST_WIDE_INT type mismatch. + +2001-08-13 Richard Henderson + + * config/rs6000/xcoff.h (EH_FRAME_IN_DATA_SECTION): New. + * defaults.h (EH_FRAME_SECTION_NAME): Respect it. + * doc/tm.texi (Exception Region Output): Document it. + +2001-08-13 Geoffrey Keating + + * config/rs6000/sysv4.h (PREFERRED_DEBUGGING_TYPE): Use + DWARF2 instead of stabs by default. + +2001-08-13 David Edelsohn + + * config/rs6000/rs6000.c: Include optabs.h. + +2001-08-13 David Edelsohn + + * config/rs6000/eabi.asm: Define 64-bit versions of FPR + save/restore routines. + * ginclude/ppc-asm.h: Define 64-bit FUNC_* macros. + +2001-08-13 Andreas Jaeger + + * gcc.c (init_spec): Revert last patch by Theodore Papadopoulo, + the english is correct. + +2001-08-13 Zack Weinberg + + * expr.h: Split out optab- and libfunc-related code to... + * optabs.h, libfuncs.h: ... these new headers. + + * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. + (OPTABS_H): New. + (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to + dependencies. + * mkconfig.sh: Don't include insn-codes.h from config.h. + + * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether + enum insn_code is available. Move reload_in_optab and + reload_out_optab array declarations to optabs.h. + * regmove.c (gen_add3_insn): Move to optabs.c, export from + there, prototype in expr.h. + * gencodes.c: Cleanup: zap global variables, don't use + printf where puts will do, don't bother defining MAX_INSN_CODE + which nothing uses, let CODE_FOR_nothing get its value implicitly. + + * genemit.c, genopinit.c: Include optabs.h in generated file. + * genoutput.c: Include insn-codes.h in generated file. + * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, + expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, + reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, + config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, + config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, + config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: + Include optabs.h. + * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, + optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, + config/m88k/m88k.c, config/sparc/sparc.c: + Include libfuncs.h. + * reload.c: Include expr.h and optabs.h before reload.h. + * config/alpha/alpha.c: Include tree.h before reload.h. + * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, + and reload.h in that order. + * config/sparc/sparc.c: Include debug.h. + * recog.c: Include insn-codes.h. + +2001-08-13 Andreas Jaeger + + * config.gcc: Use t-slibgcc-elf to build shared libgcc_s on + s390*linux. + +2000-08-13 Theodore Papadopoulo + + * dwarf2out.c (output_cfa_loc): Fix typo in comment. + * gcc.c (init_spec): Fix typo in comment. + * varasm.c (data_section): Fix typo in comment. + +Mon Aug 13 02:27:39 CEST 2001 Jan Hubicka + + * predict.c (dump_prediction): New argument "USED". + (combine_predictions_for_insn): Determine the used heuristics, + output the case no heuristic applied. + * predict.def (PRED_DS_THEORY, PRED_NO_HEURISTIC): New. + +2001-08-13 Andreas Jaeger + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Don't capitalize + register %rip. + +2001-08-13 Kazu Hirata + + * jump.c: Fix formatting. + +2001-08-13 Kazu Hirata + + * config/h8300/h8300.md (zero_extendqihi2): Correct the insn + length. + +2001-08-12 Geoffrey Keating + + * loop.c (check_dbra_loop): Use condjump_label to compute + jump_label. + + * rtl.h: Move prototypes of rtx_alloc and rtvec_alloc around + to better document the files they're in. + +2001-08-12 Zack Weinberg + + * recog.h (struct insn_operand_data): Shrink 'mode' field + to 16 bits. + +2001-08-12 Kazu Hirata + + * gcc.c: Fix comment formatting. + * gccspec.c: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * genemit.c: Likewise. + * gengenrtl.c: Likewise. + * genrecog.c: Likewise. + * gensupport.c: Likewise. + * ggc-page.c: Likewise. + * global.c: Likewise. + * graph.c: Likewise. + * ifcvt.c: Likewise. + * integrate.c: Likewise. + * lcm.c: Likewise. + * libgcc2.c: Likewise. + * loop.c: Likewise. + * mbchar.c: Likewise. + * optabs.c: Likewise. + * predict.c: Likewise. + * prefix.c: Likewise. + * profile.c: Likewise. + * protoize.c: Likewise. + * real.c: Likewise. + * recog.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * resource.c: Likewise. + * rtlanal.c: Likewise. + * rtl.c: Likewise. + +2001-08-12 Kazu Hirata + + * doc/tm.texi (ENCODE_SECTION_INFO): Add documentation on how + a tree representing a constant is passed to the macro. + +2001-08-12 Richard Henderson + + * config/rs6000/rs6000.c (rs6000_elf_asm_out_constructor): New. + (rs6000_elf_asm_out_destructor): New. + * config/rs6000/sysv4.h (CTORS_SECTION_ASM_OP): Remove. + (DTORS_SECTION_ASM_OP): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + (ASM_OUTPUT_INT): Don't hack TARGET_RELOCATABLE for constructors. + +2001-08-12 David Edelsohn + + Revert: + 2001-08-02 Rainer Orth + * gcc.c (set_collect_gcc_options): New function, split out from + main. + Ignore elided switches. + (do_spec_1): Invoke before executing command. + (set_input): Export. + Move declaration ... + * gcc.h (set_input): ... here. + * config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input + file. + +2001-08-12 Richard Henderson + + * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Fix + thinko wrt TARGET_RELOCATABLE. + +2001-08-12 Neil Booth + + * fix-header.c (cb_file_change): Update prototype. + +2001-08-11 Zack Weinberg + + * toplev.c (set_float_handler): Make static. + * toplev.h: Don't prototype set_float_handler. + + * simplify-rtx.c: Don't include setjmp.h. + (simplify_unary_real, simplify_binary_real, simplify_binary_is2orm1): + New functions. + (simplify_unary_operation, simplify_binary_operation): Use them, + via do_float_handler. + + * fold-const.c: Don't include setjmp.h. + (exact_real_inverse_1): New function. + (exact_real_inverse): Use it, via do_float_handler. + + * varasm.c: Don't include setjmp.h. + (assemble_real_1): New function. + (assemble_real): Use it, via do_float_handler. + Call internal_error if we get a trap here. + + * c-parse.in, cse.c, cselib.c, config/i386/i386.c, + config/pj/pj.c, config/s390/s390.c: Don't include setjmp.h. + +2001-08-11 Zack Weinberg + + * defaults.h: Define PREFERRED_STACK_BOUNDARY to + STACK_BOUNDARY if not already defined. + + * calls.c, function.c, reload1.c, explow.c: Don't default + PREFERRED_STACK_BOUNDARY. Remove all #if/#ifdef on + PREFERRRED_STACK_BOUNDARY and/or STACK_BOUNDARY. + + * explow.c (allocate_dynamic_stack_space): Change unsafe #if + to run-time test. + + * doc/tm.texi: Document that STACK_BOUNDARY is required; + clarify difference between it and PREFERRED_STACK_BOUNDARY. + +2001-08-11 Neil Booth + + * cppmacro.c (enter_macro_context): Push macro expansions even + if empty. + +2001-08-11 Franz Sirl + + * config/rs6000/rs6000.c: Include integrate.h to silence warning. + (rs6000_elf_section_type_flags): Actually return a value. + +2001-08-11 Ulrich Weigand + + * s390.c, s390.h, s390.md, s390-protos.h, linux.h, t-linux: + Clean up code: add missing comments and prototypes, fix warnings, + remove obsolete code, fix spacing to conform to coding style. + +2001-08-11 Ulrich Weigand + + * config/s390/s390.c (targetm): Define TARGET_ASM_OPEN_PAREN + and TARGET_ASM_CLOSE_PAREN. + (regclass_map): CC register belongs to class NO_REGS. + (legitimize_pic_address): Don't generate unnecessary moves + (to avoid confusing loop optimization). + (check_and_change_labels): Replace jump_long by indirect_jump. + (s390_final_chunkify): Don't start a new literal pool on section + switch in 64-bit code. + (s390_va_start, s390_va_arg): Fixed incorrect sizes for 64-bit. + + * config/s390/s390.h (TARGET_SWITCHES): Renamed debug_arg to debug. + (MAX_BITS_PER_WORD, MAX_LONG_TYPE_SIZE): Set to 64 (for 64-bit). + (HARD_REGNO_MODE_OK, RETURN_IN_MEMORY): Support complex integer + modes correctly. + (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Remove CC_REGS. + (EH_RETURN_HANDLER_RTX): Fixed incorrect offset for 64-bit. + (CONST_COSTS): Fixed incorrect costs. + + * config/s390/s390.md (fixuns_trunc[sd]f[sd]i2, udivsi3, umodsi3): + Use emit_jump instead of emit_jump_insn (gen_jump). + (divsi3, modsi3): Clobber low word of divmoddisi3 before shifting + (to avoid confusing flow analysis). + (tablejump, tablejump1, tablejump2): Removed. Replaced by casesi. + (casesi, casesi_jump): New. + (jump_long): Removed. Functionality merged into indirect_jump. + (indirect_jump): Accept address_operand, not just register_operand. + (cjump_long, icjump_long): Use same logic as indirect_jump. + (builtin_setjmp_setup, builtin_setjmp_receiver, builtin_longjmp): + Fixed broken setjmp/longjmp handling. + (do_builtin_setjmp_setup): Removed. + + * config/s390/linux.h (ASM_OUTPUT_DOUBLE_INT): Work around + broken GNU as versions that don't accept .quad with large + negative values. Use hexadecimal output instead. + (ASM_OUTPUT_ADDR_DIFF_ELT): Adapt to new casesi insn. + (ASM_OPEN_PAREN, ASM_CLOSE_PAREN, FUNCTION_PROLOGUE, + FUNCTION_EPILOGUE): Removed. Now in targetm. + + * config/s390/linux64.h (CALL_USED_REGISTERS): Add CC register. + + * config/s390/fixdfdi.h: Add missing copyright statement. + Fix type conflicts on 64-bit. Add missing SFmode routines. + + * s390.c, s390.h, s390.md, linux.h, linux64.h: Fixed incorrect + email address. + +2001-08-11 Richard Henderson + + * rtl.h (REG_EH_RETHROW): Remove. + * rtl.c (reg_note_name): Update. + * combine.c (distribute_notes): Don't check for it. + +2001-08-11 Richard Henderson + + * combine.c (distribute_notes): Place REG_SETJMP. + +2001-08-11 Richard Henderson + + * doc/extend.texi (Arrays and pointers implementation): Discourage + relying on sign-extension of pointers. + +2001-08-11 H.J. Lu + + * config/mips/linux.h (EXTRA_SECTIONS): Remove in_ctors and + in_dtors. + (EXTRA_SECTION_FUNCTIONS): Remove DTORS_SECTION_ASM_OP and + RDATA_SECTION_ASM_OP. + +2001-08-11 Gerald Pfeifer + + * doc/install.texi (Specific, c4x): Fix cross-reference to the + main manual to work both for info and HTML versions. + +2001-08-11 Neil Booth + Matt Kraai + + * cpphash.c (_cpp_destroy_hashtable): Use ht_destroy. + * cpphash.h (CPP_IN_SYSTEM_HEADER): Fix. + (struct cpp_pool): New member first. + * cppinit.c (append_include_chain): Plug memory leaks. + * cpplib.c (cpp_register_pragma, cpp_register_pragma_space): + Allocate pragma structures from the (aligned) macro pool to + avoid leaking memory. + * cpplex.c (_cpp_init_pool, _cpp_free_pool): Use pool->first + so we don't leak memory. + * hashtable.c (ht_destroy): New. + * hashtable.h (ht_destroy): New. + +2001-08-11 Neil Booth + Franz Sirl + + * c-lex.c (map): Make const. + (cb_file_change): Update for callback passing a line map. + Don't assume we have a previous map. Remove sanity check + about popping too many files. + * cpperror.c (print_location): Make map const. + * cppfiles.c (stack_include_file): Update; line maps now hold sysp. + (cpp_make_system_header): Similarly. + (search_from): Similarly. + (_cpp_execute_include): Don't remember where we came from. + * cpphash.h (struct cpp_buffer): Remove return_to_line, sysp. + (struct cpp_reader): Make map const. + (CPP_IN_SYSTEM_HEADER, _cpp_do_file_change): Update. + * cpplib.c (do_line): Update; line maps now hold sysp. + (cpp_push_buffer): Similarly. + (_cpp_do_file_change): Similarly; callback with map instead. + (cpp_get_line_maps): Constify return value. + (_cpp_pop_buffer): Update. + * cpplib.h (struct cpp_file_change): Remove. + (struct cpp_callbacks): Update. + (cpp_get_line_maps): Constify return value. + * cppmacro.c (_cpp_create_definition): Update. + * cppmain.c (struct printer): Constify map. + (maybe_print_line): Similarly. + (print_line): Similarly. Deduce flags 1 and 2 here. + (cb_file_change): Update. + * line-map.c (free_line_maps): Warn regardless. + (add_line_map): Return pointer to const. When passed NULL to_file + with LC_LEAVE, use the obvious values for the return point so the + caller doesn't have to figure them out. + (lookup_line): Return pointer to const. + (print_containing_files): Take pointer to const. + * line-map.h (struct line_map): New members reason, sysp. + (add_line_map): Return pointer to const. + (lookup_line): Similarly. + (print_containing_files): Take pointer to const. + +2001-08-10 Roman Zippel + Richard Henderson + + * regmove.c (regmove_optimize): Avoid setting a register twice in + a parallel set. + +2001-08-10 Richard Henderson + + * doc/extend.texi (Arrays and pointers implementation): Document + behavior of pointer/integer conversion. + +2001-08-10 Ulrich Weigand + + * glimits.h (__LONG_MAX__): Add s390x as 64-bit architecture. + +2001-08-10 Richard Henderson + + * doc/extend.texi (C Implementation): New chapter. + * doc/gcc.texi (Top): Link it in. + +2001-08-10 Andrew Cagney + + * doc/install.texi (Specific): Fix CVS merge botch. + +2001-08-10 Richard Henderson + + * config/m68k/m68k.c (m68k_svr3_asm_out_constructor): Protect with + ifdef CTOR_LIST_BEGIN instead of INIT_SECTION_ASM_OP. + +2001-08-10 Zack Weinberg + + * calls.c, function.c: Always define PREFERRED_STACK_BOUNDARY + if not already defined. Remove all #ifdefs on STACK_BOUNDARY; + this macro is now required. + + * cselib.c (cselib_process_insn), flow.c (propagate_block), + loop.c (find_and_verify_loops), reload.c (reload): Check + for rtx code of CALL_INSN, not CALL, when deciding if we + need to check for REG_SETJMP note. + + * gcse.c (compute_hash_table, compute_store_table): Update + the #ifdef NON_SAVING_SETJMP code to the new REG_SETJMP + logic. + + * config/avr/avr.c: Fix typo. + * config/convex/convex.c (expand_movstr): Use adjust_address. + * config/dsp16xx/dsp16xx.c: Define dsp16xx_compare_gen + variable. + * config/dsp16xx/dsp16xx.md: Correct calls to replace_equiv_address. + * config/elxsi/elxsi.c: Include tree.h, expr.h, regs.h, and flags.h. + Fix typo. + * config/elxsi/elxsi.h: Don't define Rmode (typo for Pmode?) + Do define STACK_BOUNDARY. + * config/i370/i370.c: Include expr.h. + * config/i860/sysv3.h, config/i860/sysv4.h, config/m32r/m32r.h, + config/pa/som.h, config/v850/v850.h: Take in_ctors and + in_dtors out of EXTRA_SECTIONS; take CTORS_SECTION_FUNCTION + and DTORS_SECTION_FUNCTION out of EXTRA_SECTION_FUNCTIONS. + * config/m88k/m88k.c: Include c-tree.h after expr.h. + * config/pdp11/pdp11.c: Include expr.h and toplev.h. + * config/romp/romp.c: Include expr.h after tree.h. + Include toplev.h. + (output_fpop): Use xmalloc, not oballoc. + * config/we32k/we32k.c: Include expr.h. + +2001-08-10 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. + +2001-08-08 Jason Merrill + + * c-common.h (RETURN_NULLIFIED_P): Lose. + * c-semantics.c (genrtl_return_stmt): Don't check it. + +2001-08-10 Richard Sandiford + + * config/mips/mips.c (mips_add_large_offset_to_sp): New function. + (mips_annotate_frame_insn): New function. + (mips_emit_frame_related_store): New function. + (save_restore_insns): Don't mark instructions that set up the base + registers as frame-related. Add REG_FRAME_RELATED_EXPR notes to + the store instructions instead. + (mips_expand_prologue): If the stack size is moved into a temporary + register, do not mark that move as frame-related. Add a + REG_FRAME_RELATED_EXPR note to the stack adjustment instruction. + +2001-08-10 Richard Sandiford + + * config/mips/mips.c (save_restore_insns): Don't mark the RA's + stack slot as unchanging if current_function_calls_eh_return. + +2001-08-10 Richard Sandiford + + * config/mips/mips.md (reload_incc): Use HARD_REGNO_NREGS to + access the second half of the TFmode scratch operand. + +2001-08-10 Anthony Green + + * java/class.c (emit_register_classes): Conditionalize code on + JCR_SECTION_NAME. + +2001-08-10 Gerald Pfeifer + + * doc/install.texi (Specific, avr): Fix cross-reference to the + main manual to work both for info and HTML versions. + +2001-08-09 John David Anglin + + * stmt.c (expand_null_return_1): Remove code to generate simple returns + and "use_goto" argument. + (expand_null_return, expand_value_return): Update all callers. + * function.c (expand_function_end): Remove code to generate simple + return. + * config/vax/vax.md (epilogue): New expander for function return. + * doc/md.texi (epilogue): Remove "if defined". + +2001-08-09 Zack Weinberg + + * Makefile.in: Partially revert my previous change: + put -DGENERATOR_FILE back in HOST_CFLAGS, take it out + of the hashtab.o and safe-ctype.o rules. + +2001-08-09 Richard Henderson + + * Makefile.in (MAYBE_USE_COLLECT2): Remove; purge all uses. + (USE_COLLECT2): Remove duplicate definition. + * config.gcc (a29k-udi, a29k-wrs-vxworks) [tm_file]: Remove a29k/udi.h. + (use_collect2): Remove dead code. + * configure.in (use_collect2): Remove will_use_collect2 and + maybe_use_collect2; add USE_COLLECT2 to host_xm_defines and xm_defines. + * configure: Rebuild. + + * target.h (targetm.asm_out.constructor): New. + (targetm.asm_out.destructor, targetm.have_ctors_dtors): New. + * target-def.h (TARGET_ASM_CONSTRUCTOR): New. + (TARGET_ASM_DESTRUCTOR, TARGET_HAVE_CTORS_DTORS): New. + * varasm.c (in_ctors, in_dtors): New. + (assemble_constructor, assemble_destructor): Remove. + (default_stabs_asm_out_destructor): New. + (default_named_section_asm_out_destructor): New. + (dtors_section, default_dtor_section_asm_out_destructor): New. + (default_stabs_asm_out_constructor): New. + (default_named_section_asm_out_constructor): New. + (ctors_section, default_ctor_section_asm_out_constructor): New. + * output.h: Update declarations. + * c-decl.c (c_expand_body): Use target hooks instead of + assemble_constructor and assemble_destructor. + * profile.c (output_func_start_profiler): Likewise. + * objc/objc-act.c (finish_objc): Likewise. + (build_module_descriptor): Tidy. Set TREE_PUBLIC properly + for the constructor. + * objc/Make-lang.in (objc-act.o): Depend on TARGET_H. + + * crtstuff.c (CTORS_SECTION_ASM_OP): Don't define. + (DTORS_SECTION_ASM_OP): Likewise. + (__CTOR_LIST__): Use attribute section when possible. + (__DTOR_LIST__, __CTOR_END__, __DTOR_END__): Likewise. + + * defaults.h (EH_FRAME_SECTION_NAME): Don't depend on + ASM_OUTPUT_CONSTRUCTOR. + + * config/darwin.c (machopic_asm_out_constructor): New. + (machopic_asm_out_destructor): New. + * config/darwin-protos.h: Update declarations. + * config/darwin.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + * config/nextstep.c (nextstep_asm_out_constructor): New. + (nextstep_asm_out_destructor): New. + * config/nextstep.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + * config/nextstep21.h: Undef TARGET_ASM_*STRUCTOR instead of + ASM_OUTPUT_*STRUCTOR. + * config/i386/aix386ng.h: Likewise. + + * config/elfos.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Remove. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): No ctors/dtors. + (CTORS_SECTION_FUNCTION, DTORS_SECTION_FUNCTION): Remove. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Remove. + * config/lynx.h: Likewise. + * config/netware.h: Likewise. + * config/psos.h: Likewise. + * config/alpha/alpha-interix.h: Likewise. + * config/alpha/elf.h: Likewise. + * config/arc/arc.h: Likewise. + * config/arm/aof.h: Likewise. + * config/arm/coff.h: Likewise. + * config/arm/elf.h: Likewise. + * config/c4x/c4x.h: Likewise. + * config/h8300/h8300.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/djgpp.h: Likewise. + * config/i386/i386-coff.h: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/i386/vsta.h: Likewise. + * config/i386/win32.h: Likewise. + * config/i960/i960-coff.h: Likewise. + * config/ia64/sysv4.h: Likewise. + * config/m68hc11/m68hc11.h: Likewise. + * config/m68k/coff.h: Likewise. + * config/m68k/mot3300.h: Likewise. + * config/m88k/m88k.h: Likewise. + * config/mcore/mcore-pe.h: Likewise. + * config/mcore/mcore.h: Likewise. + * config/mips/elf.h: Likewise. + * config/mips/elf64.h: Likewise. + * config/mips/iris6.h: Likewise. + * config/pa/pa64-hpux.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/sh/sh.h: Likewise. + * config/sparc/litecoff.h: Likewise. + + * config/svr3.h (CTORS_SECTION_ASM_OP): Remove. + (CTORS_SECTION_FUNCTION, DTORS_SECTION_FUNCTION): Remove. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Remove. + * config/1750a/1750a.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + * config/a29k/a29k.c: Move include of tree.h. + * config/a29k/udi.h: Delete file. + * config/alpha/alpha.c (vms_asm_out_constructor): New. + (vms_asm_out_destructor): New. + * config/alpha/vms.h (EXTRA_SECTIONS): No ctors/dtors. + (EXTRA_SECTION_FUNCTIONS): Likewise. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + * config/c4x/c4x.c: Move include of tree.h. + * config/clipper/clipper.c (clix_asm_out_constructor): New. + (clix_asm_out_destructor): New. + * config/clipper/clix.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + * config/i386/aix386.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR): New. + * config/i386/i386.c (ix86_svr3_asm_out_constructor): New. + (sco_asm_out_constructor): New. + * config/i386/sco5.h (TARGET_ASM_CONSTRUCTOR): New. + * config/i386/svr3gas.h: Remove stack grows up code. + Remove code duplicated from i386/sysv3.h. + (TARGET_ASM_CONSTRUCTOR): New. + (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Remove. + (DTORS_SECTION_FUNCTION, CTORS_SECTION_FUNCTION): Remove. + * config/i386/sysv3.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR): New. + * config/m68hc11/m68hc11.c (m68hc11_asm_out_constructor): New. + (m68hc11_asm_out_destructor): New. + * config/m68hc11/m68hc11.h (TARGET_ASM_CONSTRUCTOR): New. + (TARGET_ASM_DESTRUCTOR): New. + * config/m68k/auxgas.h: Don't undef ASM_OUTPUT_*STRUCTOR. + * config/m68k/dpx2.h: Properly undef all the bits inherited from + config/svr3.h pertaining to section manipulation. + * config/m68k/dpx2g.h: Remove #if 0 code. + * config/m68k/m68k.c (m68k_svr3_asm_out_constructor): New. + * config/m68k/tower-as.h (ASM_OUTPUT_SOURCE_LINE): Fix typo. + (ASM_OUTPUT_CONSTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR): New. + * config/m88k/m88k.c (m88k_layout_frame): Don't use assign_stack_local. + (m88k_svr3_asm_out_constructor): New. + (m88k_svr3_asm_out_destructor): New. + * config/m88k/sysv3.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + * config/mips/mips.h: Remove #if 0 ASM_OUTPUT_*STRUCTOR code. + * config/rs6000/aix.h: Likewise. + * config/mips/rtems64.h: Don't undef removed constructor related bits. + * config/mips/vxworks.h: Likewise. + * config/rs6000/lynx.h: Likewise. + * config/sh/elf.h: Likewise. + * config/rs6000/sysv4.h (CTORS_SECTION_ASM_OP): New. + (DTORS_SECTION_ASM_OP): New. + * config/sparc/linux64.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + * config/sparc/sol2-sld-64.h: Likewise. + * config/vax/vax.c (vms_asm_out_constructor): New. + (vms_asm_out_destructor): New. + * config/vax/vms.h (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + + * doc/tm.texi (@node Initialization): Update. + +2001-08-09 Richard Henderson + + * config/alpha/crtbegin.asm (__JCR_LIST__): New. + (__do_global_dtors_aux): Use gp-relative static data to avoid + one dynamic relocation. + (__do_frame_setup): Register Java classes. + * config/alpha/crtend.asm (__JCR_END__): New. + +2001-08-09 Zack Weinberg + + * Makefile.in (HOST_CFLAGS): Take out -DGENERATOR_FILE. + (CONFIG_H, TCONFIG_H, TM_P_H): Update. + (GEN, STAGESTUFF): Add new files. + (insn-constants.h, s-constants, tm-preds.h, s-preds, + genconstants, genpreds, genconstants.o, genpreds.o): New rules. + (hashtab.o, safe-ctype.o): Add -DGENERATOR_FILE. + * mkconfig.sh: Include tm-preds.h in tm_p.h; insn-constants.h + as well as insn-codes.h and insn-flags.h in config.h; and no + extra headers in tconfig.h and hconfig.h. + + * gencodes.c: Eliminate code to generate predicate declarations + or #defines for md-file constants. + * genconstants.c, genpreds.c: New files. + + * i386.md: Re-order guard expressions such that TARGET_64BIT + comes first, when this permits better optimization. Add + TARGET_64BIT to more x86-64 patterns. Add comment explaining + why this is desirable. + +2001-08-09 Jakub Jelinek + + * config/ia64/fde-glibc.c: Require glibc 2.2.4+ headers. + (find_fde_for_dso): Remove. + (_Unwind_IteratePhdrCallback): New. + (_Unwind_FindTableEntry): Use dl_iterate_phdr. + * config/ia64/crtbegin.asm (__ia64_app_header): Remove. + +Thu Aug 9 11:30:20 2001 Richard Kenner + + * expr.c (emit_single_push_insn): Only exists ifdef PUSH_ROUNDING. + (move_by_pieces_1): If would call it, abort if no PUSH_ROUNDING. + +2001-08-09 Graham Stott + + * sched-vis.c (MAX_VISUAL_NO_UNIT): Define. + (vis_no_unit): Use it. + (visualize_no_unit): Add the insn only if room exists. + +2001-08-09 Graham Stott + + * predict.c (estimate_probability): Replace magic numbers with + appropriate enumeration. + +2001-08-09 Graham Stott + + * cppexp.c (EXTRACT_PRIO): Uppercase and parenthsize macro + parameter. + (EXTRACT_FLAGS): Likewise. + +2001-08-09 Aldy Hernandez + + * config/mips/mips.c (mips_legitimate_address_p): Check for + CONST_INT in last patch. + +2001-08-08 Anthony Green + + * java/class.c (emit_register_classes): Use assemble_jcr if + possible. Keep the original mechanism as a fallback. + * defaults.h (JCR_SECTION_NAME): Define if we have named section + and weak symbol support. + * crtstuff.c (__JCR_LIST__): Define. + (__JCR_END__): Define. + (_Jv_RegiserClasses): Define weak symbol if possible. + (__do_global_ctors_aux): Register classes for ELF targets with + weak symbol support. + +2001-08-08 Kazu Hirata + + * dbxout.c: Fix comment formatting. + * dependence.c: Likewise. + * df.c: Likewise. + * diagnostic.c: Likewise. + * dominance.c: Likewise. + * doprint.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * except.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + +2001-08-08 Franz Sirl + + * global.c (retry_global_alloc): Avoid shadowing allocno. + +2001-08-08 Mark Mitchell + + * except.c (remove_fixup_regions): Fix typo. + +2001-08-08 Jan van Male + + * emit-rtl.c (adjust_address, adjust_address_nv): Cast offset to + unsigned HOST_WIDE_INT to avoid warning. + * final.c (final): Cast INSN_UID to unsigned to avoid warning. + * flow.c (set_block_for_new_insns): Likewise. + +Wed Aug 8 21:08:14 CEST 2001 Jan Hubicka + + * sibcall.c (return_value_pseudo): New static variable. + (skip_copy_to_return_value): Handle return_value_pseudo. + (call_ends_block_p): Ensure that return_value_pseudo is set. + (optimize_sibling_and_tail_recursive_call): Discover the + load of pseudo return value in alternate exit block. + +Wed Aug 8 21:06:43 CEST 2001 Jan Hubicka + + * calls.c (ECF_ALWAYS_RETURN): New constant. + (emit_call_1): Add REG_ALWAYS_RETURN note if needed. + (expand_call): Use LCF_ALWAYS_RETURN for __bb_fork_func. + (emit_library_call_value_1): Handle LCT_ALWAYS_RETRUN. + * flow.c (need_fake_edge_p): Handle REG_ALWAYS_RETURN. + * rtl.c (reg_note_name): New name. + * rtl.h (enum reg_note): Add REG_ALWAYS_RETURN. + +2001-08-07 Aldy Hernandez + + * config/mips/mips.c (mips_legitimate_address_p): Limit "la" addresses. + +2001-08-08 Jason Merrill + + * alias.c (get_alias_set): Return a previously calculated + alias set for a VAR_DECL. + * function.c (gen_mem_addressof): Calculate the alias set before + touching the RTL. + +Wed Aug 8 18:44:37 CEST 2001 Jan Hubicka + + * predict.def: Set hitrates according our experimental run. + +Wed Aug 8 18:01:58 CEST 2001 Jan Hubicka + + * i386.h (HARD_REGNO_RENAME_OK): New macro. + +2001-08-08 H.J. Lu + + * config/mips/mips.c (mips_unique_section): New. Copied from + config/mips/elf.h. + + * config/mips/mips-protos.h (mips_unique_section): New + prototype. + + * config/mips/elf.h (UNIQUE_SECTION): Use mips_unique_section. + + * config/mips/little.h: New. Generic little endian mips + targets. Only mips*-*-linux* is converted to use it so far. + + * config/mips/linux.h: Include "gofast.h" and "mips/mips.h". + (WCHAR_TYPE): Defined + (WCHAR_TYPE_SIZE): Likewise. + (INIT_SUBTARGET_OPTABS): Likewise. + (BSS_SECTION_ASM_OP): Likewise. + (SBSS_SECTION_ASM_OP): Likewise. + (ASM_OUTPUT_ALIGNED_BSS): Likewise. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (UNIQUE_SECTION): Likewise. + (EXTRA_SECTIONS): Likewise. + (ASM_OUTPUT_CONSTRUCTOR): Likewise. + (ASM_OUTPUT_DESTRUCTOR): Likewise. + (ASM_OUTPUT_DEF): Likewise. + (HANDLE_SYSV_PRAGMA): Removed. + (NO_IMPLICIT_EXTERN_C): Likewise. + (TARGET_MEM_FUNCTIONS): Likewise. + (STARTFILE_SPEC): Likewise. + (ENDFILE_SPEC): Likewise. + (LIB_SPEC): Likewise. + (INVOKE__main): Likewise. + (CTOR_LIST_BEGIN): Likewise. + (CTOR_LIST_END): Likewise. + (DTOR_LIST_BEGIN): Likewise. + (DTOR_LIST_END): Likewise. + (SET_ASM_OP): Likewise. + (ASM_OUTPUT_SOURCE_LINE): Likewise. + (ASM_OUTPUT_DEF): Likewise. + (ASM_OUTPUT_IDENT): Likewise. + + * config/mips/mips.h (ASM_SPEC): Undefine before define. + (CPLUSPLUS_CPP_SPEC): Likewise. + (ASM_APP_ON) Redefine only if not defined. + (ASM_APP_OFF): Likewise. + (ASM_OUTPUT_SOURCE_LINE): Likewise. + (ASM_OUTPUT_IDENT): Likewise. + + * config.gcc: Update tm_file for Linux/mips. + +2001-08-08 Bernd Schmidt + + * cselib.c (cselib_record_sets): If insn is predicated, turn + sources into IF_THEN_ELSEs. + + * config/ia64/ia64.md (cond_opsi2_internal, cond_opsi2_internal_b): + Turn into define_insn_and_split. + + * sched-deps.c: Include "cselib.h". + (add_insn_mem_dependence, sched_analyze_1, sched_analyze_2): + Use cselib to turn memory addresses into VALUEs. + (sched_analyze): Call cselib_init/cselib_finish if necessary. + * sched-int.h (struct sched_info): New member USE_CSELIB. + * sched-ebb.c (ebb_sched_info): Initialize it. + * sched-rgn.c (rgn_sched_info): Likewise. + * Makefile.in (sched-deps.o): Update dependencies. + + * cselib.h (cselib_subst_to_values): Declare. + * cselib.c (cselib_subst_to_values): No longer static. Allow MEMs + that have no value and autoincs to be handled by generating a new + dummy value. + +2001-08-08 Graham Stott + + * final.c (shorten_branches): Update the INSN_ADDRESSES of insns + within fixed length SEQUENCE. + +2001-08-08 Graham Stott + + * diagnostic.h (diagnostic_format_decoder): Parenthesize macro parameter. + (diagnostic_prefixing_rule): Likewise. + (diagnostic_line_cutoff): Likewise. + (diagnostic_kind_count): Likewise. + +2001-08-08 Graham Stott + + * alias.c (find_base_decl): Delete redundent assignment. + +2001-08-08 Graham Stott + + * dependence.c (INDEX_LIMIT_CHECK): Uppercase macro parameter. + (abs): Uppercase and paranthesize macro parameter. + (MEM_DEPENDENCY): Add whitespace. + +2001-08-08 Graham Stott + + * config/mips/mips.c (mips_legitimate_address_p): Fix enable checking + failure check for CONST_INT + +2001-08-08 Graham Stott + + * flow.c (back_edge_of_syntactic_loop_p): Add whitespace. + (libcall_dead_p): Likewise. + + (mark_used_regs): Constify fmt. + (find_use_as_address): Likewise. + +2001-08-08 Graham Stott + + * c-typeck.c (RESTORE_SPELLING_DEPTH): Uppercase and parenthesize macro + parameter. + +2001-08-08 Graham Stott + + * combine.c (combine_simplify_rtx): Update comment and + remove erroneous test. + +2001-08-07 Neil Booth + + * cppinit.c (cpp_finish): Pop the final buffer without comment. + * cpplex.c (_cpp_lex_token): Don't pop the final buffer; and + take care to avoid multiple no-newline at EOF warnings in that + case. + +Tue Aug 7 22:18:06 CEST 2001 Jan Hubicka + + * calls.c (expand_call): Do not emit INSN_SETJMP note. + (emit_library_call_value_1): Likewise. + (emit_call_1): Emit REG_SETJMP note. + * cse.c (cse_end_of_basic_block): Use REG_SETJMP instead + of INSN_SETJMP + * cselib.c (cselib_process_insn): Likewise. + * flow.c (propagate_block): Likewise. + * loop.c (find_and_verify_loops): Likewise. + * reload.c (find_equiv_regs): Likewise. + * reload1.c (reload): Likewise. + * resource.c (mark_referenced_resources, + mark_set_resources): Likewise. + * sched-deps (sched_analyze_insn, sched_analyze): Likewise. + * final.c (final_scan_insn): Remove NOTE_INSN_SETJMP. + * haifa-sched.c (unlink_other_notes): Likewise. + (reemit_notes): Likewise. + * sched-ebb.c (sched_ebb): Likewise. + * sched-rgc.c (sched_region): Likewise. + * rtl.c (note_insn_name): Likewise. + (reg_note_name): Add REG_SETJMP + * rtl.h (reg_note): Add REG_SETJMP. + (insn_note): Remove NOTE_INSN_SETJMP. + + * profile.c (branch_prob): Add fake edges for setjmp. + +2001-08-07 Daniel Jacobowitz + + * config.gcc: Quote target_cpu_default2 correctly for + powerpc*-*-* targets. + +2001-08-07 Neil Booth + + * cpplib.h, line-map.h: Update comments. + * cppmain.c (printer_init): Move inline. + (maybe_print_line, print_line): Take a map pointer. + (cb_ident, cb_define, cb_undef, cb_include, cb_def_pragma): Update. + (cb_file_change): Don't use prior value of print.map. + +2001-08-07 David Edelsohn + + * doc/install.texi: Document fine-grained multilib configuration. + +Tue Aug 7 16:52:54 CEST 2001 Jan Hubicka + + * rtlanal.c (find_first_parameter_load): Call note_stores + only on the instructions. + +Tue Aug 7 14:56:16 CEST 2001 Jan Hubicka + + * alias.c (nonlocal_mentioned_p): + Rename CONST_CALL_P to CONST_OR_PURE_CALL_P + * calls.c (emit_call_1): Likewise. + * cse.c (cse_insn, invalidate_skipped_block): Likewise. + * cselib.c (cselib_process_insn): Likewise. + * df.c (df_insns_modify): Likewise. + * flow.c (need_fake_edge_p): Likewise. + (propagate_one_insn): Likewise. + * haifa-sched.c (reemit_notes): Likewise. + * integrate.c (copy_insn_list): Likewise. + * jump.c (delete_prior_computation): Likewise. + * local-alloc.c (validate_equiv_mem): Likewise. + * loop.c (scan_loop): Likewise. + * predict.c (estimate_probability): Likewise. + * reload.c (reload): Likewise. + * sched-deps (sched_analyze): Likewise. + * rtl.h (CONST_CALL_P): rename to CONST_OR_PURE_CALL_P. + * gcse.c (compute_hash_table): Likewise. + (mark_call): Likewise. + (store_killed_in_insn): Likewise. + +2001-08-07 Jason Merrill + + * c-semantics.c (make_rtl_for_local_static): Use DECL_RTL_SET_P. + +2001-08-06 Richard Henderson + + * varasm.c (assemble_gc_entry): Remove. + * output.h: Likewise. + +2001-08-06 Richard Henderson + + * varasm.c (assemble_constructor): Take a symbol_ref and a + priority instead of a bare string. Move priority handling + here from cp/decl2.c. + * output.h: Update decls. + + * c-decl.c (c_expand_body): Update calls to assemble_constructor + and assemble_destructor. + * profile.c (output_func_start_profiler): Likewise. + * objc/objc-act.c (finish_objc): Likewise. + (build_module_descriptor): Return the symbol not the symbol name. + +2001-08-06 David Edelsohn + + * config/rs6000/darwin.h (DOUBLE_INT_ASM_OP): Add whitespace. + * config/rs6000/linux64.h (RS6000_MCOUNT): Define. + ({SAVE,RESTORE}_FP_{PREFFIX,SUFFIX}): Define. + * config/rs6000/rs6000.h (ASM_OUTPUT_DOUBLE_INT): Remove whitespace. + * config/rs6000/sysv4.h (DOUBLE_INT_ASM_OP): Add whitespace. + * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Add whitespace. + +2001-08-06 Neil Booth + + * cpperror.c (print_containing_files): Moved to line-map.c. + (print_location): line-map.c handles re-listing or otherwise. + * cpphash.h (struct lexer_state): Remove next_bol. + (struct cpp_buffer): Remove include_stack_listed. + * cpplib.c (do_line, cpp_push_buffer, _cpp_pop_buffer): + Remove faked buffer handling. + (_cpp_do_file_change): Tweak. + * cpplib.h (enum cpp_buffer_type): Remove BUF_FAKE. + * cppmain.c (struct printer): Remove filename. + (print_line, cb_file_change): Update accordingly. + * line-map.c: Include intl.h. + (init_line_maps): Initialize last_listed. + (free_line_maps): Sanity check, warn if ENABLED_CHECKING. + (add_line_map): Sanity check inputs, warn if ENABLED_CHECKING. + (print_containing_files): New. + * line-map.h (struct line_maps): New member last_listed. + (print_containing_files, INCLUDED_FROM): New. + * Makefile.in: Update. + * po/POTFILES.in: Add line-map.c. + +2001-08-06 Richard Henderson + + * except.c (convert_from_eh_region_ranges_1): Never mark + USE or CLOBBER insns as throwing. + + * expr.c (store_constructor): Don't clobber memory targets. + +2001-08-06 Andreas Jaeger + + * profile.c (branch_prob): Remove unused variable insn. + + * Makefile.in (local-alloc.o): Add dependency on except.h. + + * local-alloc.c: Include except.h for can_throw_internal prototype. + +2001-08-06 Richard Henderson + + * config/i386/i386.h (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): New. + * function.c (expand_main_function): Implement it. + * doc/tm.texi: Document it. + +2001-08-06 Stan Shebs + + * doc/install.texi: Document powerpc-*-darwin* details. + +2001-08-06 Daniel Berlin + + * config/rs6000/aix.h (CPP_CPU_SPEC): Move back to rs6000.h + (ASM_CPU_SPEC): Move back to rs6000.h + #undef CPP_DEFAULT_SPEC and ASM_DEFAULT_SPEC before redefining them. + + * config/rs6000/darwin.h (DOUBLE_INT_ASM_OP): New macro. + + * config/rs6000/linux.h: Remove vtable thunks stuff we accidently + readded. + + * config/rs6000/linux64.h: Ditto. + + * config/rs6000/rs6000.h: Move CPP_CPU_SPEC and ASM_CPU_SPEC back + to here. Define default ASM_DEFAULT_SPEC and CPP_DEFAULT SPEC to + nothing. + + Remove accidently readded definitions of FUNCTION_PROLOGUE, + FUNCTION_EPILOGUE, ASM_OPEN_PAREN, ASM_CLOSE_PAREN + + * config/rs6000/sysv4.h: Move CPP_CPU_SPEC and ASM_CPU_SPEC back + to rs6000.h + +2001-08-05 Richard Henderson + + * local-alloc.c (update_equiv_regs): Do not move insns that + can throw. + +2001-08-05 Jan Hubicka + + * Makefile.in (reload1.o): Add dependency on except.h + * basic-block.h (purge_all_dead_edges, purge_dead_edges): Update + prototypes. + * flow.c (purge_dead_edges, purge_all_dead_edges): Return bool + indicating whether edges has been cleaned up. + * reload1.c: Include except.h. + (fixup_abnormal_edges): Accept deleted insns. + * toplev.c (rest_of_compilation): Purge dead edges unconditionally + after combine. + +2001-08-06 Neil Booth + + * cpplib.c (do_line): Correct line number after pop_buffer. + +2001-08-05 Neil Booth + + PR preprocessor/3824 + * line-map.c: Update comments. + * line-map.h: Update comments. + * tradcif.y: Don't consider large numbers unsigned. + +2001-08-05 Neil Booth + + PR preprocessor/3081 + * c-lex.c (map): New. + (cb_file_change): Update map and use it. + (cb_def_pragma, cb_define, cb_undef): Use map and line. + (c_lex): Update to use map. + * cpperror.c (print_location): Move to using logical line numbers. + * cppfiles.c (stack_include_file): Update for new _cpp_do_file_change. + (cpp_make_system_header): Similarly. + (_cpp_execute_include): Stop line numbering hacks. Store the + line we will return to. + * cpphash.h (CPP_BUF_LINE): Remove. + (struct cpp_buffer): Remove lineno and pseudo_newlines. + Add map and return_to_line. + (_cpp_do_file_change): Update. + * cppinit.c (cpp_start_read): Update line kludge. + * cpplex.c (handle_newline): Don't update lineno and pseudo_newlines. + (trigraph_ok): Use logical line numbers for diagnostics. + (skip_block_comment): Likewise. + (skip_whitespace): Likewise. + (skip_line_comment): Use pfile->line instead. + (_cpp_lex_token): Update to use logical line numbering exclusively. + Handle BOL locally. Accept new lines in directives, but keep + pfile->line decremented. Diagnostics use logical lines. Update + directive handling. + * cpplib.c (SEEN_EOL): New. + (skip_rest_of_line, check_eol): Use it. + (end_directive): Increase line number when accepting the newline + at the end of a directive. + (run_directive): Simplify. + (do_line): Bad LC_LEAVEs become LC_RENAMEs. Update. + (_cpp_do_file_change): Update to take buffer line number as an + argument, and store the current map in the cpp_reader. Remove + line number kludges. + (_cpp_do__Pragma): Restore output position after a _Pragma. + (cpp_push_buffer): Don't set output line or lineno. + (_cpp_pop_buffer): Transfer more info from a faked buffer. + Remove line kludge. Set output_line. + * cppmacro.c (builtin_macro): Update handling of __LINE__. + (parse_arg): Use logical lines. + (save_lookahead_token): Save EOFs too now. + * cppmain.c (struct printer): Fix comments. + (printer_init): Simplify, let caller do errors. + (scan_translation_unit, check_multiline_token, dump_macro): Update. + (maybe_print_line): Simplify. + (print_line): Don't print a linemarker if -P. + (cb_define, cb_undef, cb_def_pragma, cb_ident, cb_include): Update. + (cb_file_change): Simplify. + * line-map.h (LAST_SOURCE_LINE): Fix. + (CURRENT_LINE_MAP): New. + +2001-08-05 Bernd Schmidt + + * doloop.c (doloop_modify_runtime): Properly compute number of + iterations if loop was unrolled. + + * alias.c (rtx_equal_for_memref_p): VALUEs are only identical + if their CSELIB_VAL_PTRs are. + + * config/ia64/ia64.c (struct spill_fill_data): New member prev_insn. + (setup_spill_pointers): Initialize it. + (spill_restore_mem): Set it. + (do_spill, do_restore): Use it to add REG_INC note. + * config/ia64/ia64.md (movti_internal): Add REG_INC notes as needed. + + * config/ia64/ia64.c (ia64_sched_reorder): Defer scheduling of + asms if other insns are available. + + * config/ia64/ia64.c (condop_operator): New predicate. + * config/ia64/ia64.h (PREDICATE_CODES): Add it. + * config/ia64/ia64.md (cond_opsi2_internal and splitters): New + patterns. + + * expr.c (expand_expr, case COND_EXPR): Prefer working with a + temporary register than directly using a MEM. + +2001-08-04 Hans-Peter Nilsson + + * config/sh/sh.c (sh_asm_named_section): Fix typo in align + parameter in last change. + +2001-08-04 Zack Weinberg + + * sparc.md: Don't use #if inside C test expression. + +2001-08-04 Richard Henderson + + * i386.c: Revert 07-30 ix86_output_main_function_alignment_hack. + +2001-08-04 Neil Booth + + * cpphash.h (struct cpp_reader): New member directive_line. + * cpplib.h (struct cpp_callbacks): Update prototypes of callbacks. + * cpplib.c (do_define, do_undef, do_ident, do_include_common, + do_pragma): Pass line to callbacks. + (start_directive): Record line of directive. + * cppmain.c (cb_ident, cb_define, cb_undef, cb_def_pragma, + cb_include): Similarly. + * c-lex.c (cb_ident, cb_define, cb_undef, cb_def_pragma): + Similarly. + +2001-08-04 Hans-Peter Nilsson + + * config/d30v/d30v.h: Fix typo in start of UNIQUE_SECTION + comment. + +Sat Aug 4 13:51:36 CEST 2001 Jan Hubicka + + * loop.c (try_copy_prop); Kill invalidated REG_EQUAL notes. + + * reload1.c (fixup_abnormal_edges): New static function. + (reload): Use it. + + * flow.c (need_fake_edge_p): New function. + (flow_call_edges_add): Fix handling of noreturn and sibling calls; + avoid call insn to be very last insn in the insn stream. + + * profile.c (branch_prob): Call flow_call_edges_add instead of + doing that by hand; cleanup cfg to re-merge basic blocks once + we are done. + +2001-08-04 Neil Booth + + * Makefile.in (CPPLIB_H): New, so that dependencies on cpplib.h + are also on line-map.h. + * cppfiles.c (stack_include_file): Update. + * cpphash.h (struct cpp_buffer): New member return_at_eof. + (_cpp_pop_buffer): New. + * cppinit.c (cpp_destroy, cpp_finish): Update. + (do_includes): Mark each buffer to return at EOF. + * cpplex.c (_cpp_lex_token): Pop buffers at EOF. Continue or + return as requested. + * cpplib.c (run_directive, do_line, cpp_push_buffer): Update. + (cpp_pop_buffer): Rename _cpp_pop_buffer. Stop skipping. + * cpplib.h (cpp_pop_buffer): Remove. + (cpp_scan_buffer_nooutput): Rename cpp_scan_nooutput. + * cppmacro.c (cpp_scan_buffer_nooutput): Similarly. No need to pop + buffers. + * cppmain.c (scan_buffer): Rename scan_translation_unit. No need + to pop buffers. + (do_preprocessing): Update. + * fix-header.c (read_scan_file): Update. No need to pop buffers. + * c-parse.in (_yylex): Similarly. + * scan-decls.c (scan_decls): Similarly. + * line-map.h: Update comments. + + * objc/Make-lang.in (objc-act.o): Update dependencies. + +2001-08-04 Stephane Carrez + + * config/m68hc11/m68hc11.md ("cmphi_1", "cmpqi_1"): Allow memory + and soft register for operand 0. + ("cmphi_z_used", "cmpqi_z_used"): Allow memory for operand 0. + +2001-08-04 Stephane Carrez + + * config/m68hc11/m68hc11.md ("bitcmpqi"): Allow memory and soft + register for operand 0. + ("bitcmpqi_z_used"): Allow memory for operand 0. + (split "bitcmpqi"): New split to handle address reg as operand 1. + +2001-08-04 Andreas Jaeger + + * gcse.c: Revert Daniel's last patch. + +2001-08-03 Zack Weinberg + + * sparc-protos.h: Add prototypes for fp_zero_operand and + reg_or_0_operand. + * sh-protos.h: Add prototype for fpul_operand. + +2001-08-04 Hans-Peter Nilsson + + * doc/extend.texi (Other Builtins): Fix typo in last change. + +2001-08-03 Richard Henderson + + * target.h (gcc_target): Add asm_out.named_section, + section_type_flags, have_named_sections. + * target-def.h (TARGET_ASM_NAMED_SECTION): New. + (TARGET_HAVE_NAMED_SECTIONS): New. + (TARGET_SECTION_TYPE_FLAGS): New. + + * Makefile.in (toplev.o): Depend on TARGET_H. + (varasm.o, dbxout.o): Likewise. + * c-common.c (decl_attributes): Check targetm.have_named_sections + instead of ifdef ASM_OUTPUT_SECTION_NAME. + * dbxout.c (dbxout_function_decl): Likewise. + (dbxout_function_end): Likewise. + * toplev.c (compile_file): Likewise. + * varasm.c (exception_section): Likewise. + * cp/decl2.c (finish_objects): Likewise. + + * defaults.h (EH_FRAME_SECTION): Remove. + (EH_FRAME_SECTION_ASM_OP): Remove. + (EH_FRAME_SECTION_NAME): New. + (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. + (UNIQUE_SECTION_P): Remove. + * dwarf2out.c (SECTION_FORMAT): Remove. + (ASM_OUTPUT_SECTION): Remove. + (output_call_frame_info): Use named_section_flags. + (output_comp_unit, dwarf2out_start_source_file): Likewise. + (dwarf2out_end_source_file, dwarf2out_define): Likewise. + (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. + * varasm.c (in_eh_frame, eh_frame_section): Remove. + (named_section_flags): New. + (named_section): Use it and targetm.section_type_flags. + (resolve_unique_section): New. + (assemble_start_function): Use it. + (asm_emit_uninitialised, assemble_variable): Likewise. + (default_section_type_flags): New. + (default_no_named_section, default_elf_asm_named_section): New. + (default_coff_asm_named_section, default_pe_asm_named_section): New. + * output.h: Update varasm.c decls. + (SECTION_*): New flags. + + * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. + (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. + + * config/elfos.h (UNIQUE_SECTION_P): Remove. + * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. + * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. + * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. + * config/i386/i386-interix.h, config/i386/win32.h: Likewise. + * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. + * config/mips/elf.h, config/mips/elf64.h: Likewise. + * config/mips/iris6gld.h, config/mips/mips.h: Likewise. + * config/pa/pa64-hpux.h, + + * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. + (TARGET_ASM_NAMED_SECTION): New. + * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. + * config/alpha/vms.h, config/arm/coff.h: Likewise. + * config/arm/conix-elf.h, config/arm/elf.h: Likewise. + * config/arm/linux-elf.h, config/arm/pe.h: Likewise. + * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. + * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. + * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. + * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. + * config/i386/sco5.h, config/i386/win32.h: Likewise. + * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. + * config/mcore/mcore.h, config/mips/elf.h: Likewise. + * config/mips/elf64.h, config/mips/iris6.h: Likewise. + * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. + * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. + * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. + * config/sparc/sysv4.h: Likewise. + + * config/nextstep.h: Error until named sections implemented. + + * config/a29k/a29k.c (a29k_asm_named_section): New. + * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. + (vms_section_type_flags, vms_asm_named_section): New. + * config/arm/arm.c (arm_elf_asm_named_section): New. + * config/avr/avr.c (asm_output_section_name): Remove. + * config/avr/avr-protos.h: Update. + * config/c4x/c4x.c (c4x_asm_named_section): New. + * config/h8300/h8300.c (h8300_asm_named_section): New. + * config/i386/i386.c (sco_asm_named_section): New. + * config/i386/winnt.c (SECTION_PE_SHARED): New. + (i386_pe_section_type_flags): New. + (i386_pe_asm_named_section): New. + * config/i386/i386-protos.h: Update. + * config/m68k/m68k.c (m68k_coff_asm_named_section): New. + * config/mcore/mcore.c (mcore_asm_named_section): New. + * config/mips/mips.c (iris6_asm_named_section): New. + * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY + instead of UNIQUE_SECTION_P. + * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. + (xcoff_asm_named_section): New. + * config/sh/sh.c (sh_asm_named_section): New. + * config/sparc/sparc.c (sparc_elf_asm_named_section): New. + + * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. + * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. + (EH_FRAME_SECTION_NAME): New. + (EXCEPTION_SECTION): New. + * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. + (DEBUG_*_SECTION): Remove. + * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. + * config/mips/iris6.h (DEBUG_*_SECTION): Remove. + (EH_FRAME_SECTION_ASM_OP): Remove. + + * doc/tm.texi (UNIQUE_SECTION_P): Remove. + (ASM_OUTPUT_SECTION_NAME): Remove. + (TARGET_ASM_NAMED_SECTION): New. + (TARGET_HAVE_NAMED_SECTIONS): New. + (TARGET_SECTION_TYPE_FLAGS): New. + (EH_FRAME_SECTION_ASM_OP): Remove. + (EH_FRAME_SECTION_NAME): New. + +2001-08-03 Zack Weinberg + + * builtins.c (fold_builtin_constant_p): Return integer_zero_node + for complex expressions when cfun == 0. + * doc/extend.texi: Document that __builtin_constant_p can be + used in data initializers as well as functions. + +2001-08-03 Alexandre Oliva + + * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Declare + variable I locally, instead of expecting a declaration in the + calling context. + +2001-08-03 Richard Henderson + + * except.c (collect_one_action_chain): Add an explicit cleanup + action if regions surrounding a catch were encoded entirely + within the call-site entry. + +2001-08-03 Richard Henderson + + * dbxout.c (dbxout_symbol_location): Flatten subregs first; + don't take REGNO of a non-register. + +2001-08-03 John David Anglin + + * gthr-dce.h (__GTHREAD_MUTEX_INIT_FUNCTION and + __GTHREAD_MUTEX_INIT_DEFAULT): New macros for mutex initialization. + (__gthread_key_delete): Remove code for __PTHREAD_LIBRARY_VERSION_1 >= 1 + (__gthread_mutex_init_function): New function for mutex initialization. + +2001-08-03 Daniel Berlin + + * Makefile.in: Revert screwed up commit. + +2001-08-03 Stephane Carrez + + * config/m68hc11/t-m68hc11-gas (T_CPPFLAGS): Add _ctor and _dtor. + * config/m68hc11/larith.asm (_exit): Split in several sub-sections + merged by linker script to get a final _exit(). + (__do_global_dtors): New for destructor handling in specific exit + section. + (__do_global_ctors): New for constructors in specific install section. + (__map_data_section): Map data sections before running constructors. + * config/m68hc11/m68hc11.h (INT_ASM_OP): Define to use .word. + (CTORS_SECTION_ASM_OP): Define to put in readonly section. + (DTORS_SECTION_ASM_OP): Likewise. + (CTORS_SECTION_FUNCTION): Define to force a reference to + __do_global_ctors. + (DTORS_SECTION_FUNCTION): Likewise for __do_global_dtors. + +2001-08-03 Daniel Berlin + + * ChangeLog: Fix date on previous ChangeLog entry for GCSE. + + * Makefile.in: Add df.h to gcse.c dependencies. + +2001-08-03 John David Anglin + + * varasm.c (output_constant_def_contents): Use for the length of a + string constant either its TREE_STRING_LENGTH or its int_size_in_bytes + depending on which is larger. + +2001-08-03 Daniel Berlin + + * gcse.c: Include df.h for use as a dataflow analyzer. + Remove regvec. + Declaration of reg_set_info: gone. + New df_analyzer variable used by store motion. + (reg_set_info): Deleted. + (mark_mem_regs): New function, analyze regs used by a mem. + (store_ops_ok): Use dataflow analyzer results to determine if + necessary regs are changed in the block. + (find_moveable_store): Remove check for symbol ref, we can handle + much more complex expressions now. + (compute_store_table): Remove most of the code, it's unnecessary + now that the dataflow analyzer records the info for us. + (store_killed_after): Add parameter to say whether to do the + store_ops_okay test, used to speed up testing when we already know + the answer, and just want to know if the store itself was killed. + (build_store_vector): Largely rewritten to calculate the various + vectors properly, and somewhat optimized. + (store_motion): Init the df_analyzer, get REG_DEF chains. + Also handle trapping expressions (since mems almost always trap) + (simple_mem): Redefine what a simple mem is. + +2001-08-03 DJ Delorie + + * ifcvt.c (noce_get_alt_condition): Don't make an auxiliary + set from a constant part of the condition. + +2001-08-01 Andrew Cagney + + * mkdeps.c (deps_add_default_target): Make local variable + ``start'' a const char pointer. + * dwarf2out.c (compute_section_prefix): Localize use of ``p''. + +2001-08-03 Rainer Orth + + * doc/install.texi (Configuration): Fix markup. + (Specific, i?86-*-udk): Likewise. + (Specific, alpha*-dec-osf*): Warn against --with-gnu-as, + --with-gnu-ld. + Document --enable-threads and --enable-libgcj status. + (Specific, mips-sgi-irix*): Canonicalize triples. + (Specific, mips-sgi-irix5): Warn about problems with this config. + Mention required GNU as patch. + Native assembler problems are fixed. + (Specific, mips-sgi-irix6): Update O32 ABI support status. + Document --enable-threads and --enable-libgcj status. + +2001-08-02 Nick Clifton + + * Makefile.in, mklibgcc.in: Restore changes with fixed invocation + of mkinstalldirs. + +2001-08-03 Richard Henderson + + * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Don't write to + constant data. + +2001-08-03 Richard Henderson + + * rtlanal.c (find_first_parameter_load): Stop if we + reach a CODE_LABEL at BOUNDARY. + +2001-08-03 Richard Henderson + + * config/alpha/alpha.md (force_movdi): New insn. + * config/alpha/alpha.c (alpha_expand_prologue): Use it. + Tweek FRP marking of VMS prologue insns. + * config/alpha/vms.h (EPILOGUE_USES): New. + +2001-08-02 Richard Henderson + + * Makefile.in, mklibgcc.in: Revert mkinstalldirs change. + +2001-08-02 Lars Brinkhoff + + * combine.c, config.gcc, cse.c, defaults.h, real.c, reload.c, + simplify-rtx.c, config/alpha/alpha.h, config/avr/avr.h, + config/convex/convex.h, config/d30v/d30v.c, + config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, + config/elxsi/elxsi.h, config/fr30/fr30.h, config/m88k/m88k.c, + config/mips/mips.h, config/mn10200/mn10200.h, + config/mn10300/mn10300.h, config/pdp11/pdp11.md, + config/v850/v850.h, config/vax/openbsd.h, + config/vax/openbsd1.h, config/vax/ultrix.h, + config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h, + config/vax/vax.md, config/vax/vaxv.h, config/vax/xm-vms.h, + cp/decl2.c, doc/contrib.texi, doc/cpp.texi, doc/gcc.texi, + doc/install.texi, doc/invoke.texi, doc/md.texi, doc/rtl.texi, + doc/tm.texi: consistently use "VAX", "VAXen", and "MicroVAX" + in comments and documentation. + +2001-08-03 Neil Booth + + * line-map.c: New. + * line-map.h: New. + * Makefile.in (line-map.o): New. + (LIBCPP_OBJS, LIBCPP_DEPS): Update. + * c-lex.c (cb_file_change): Update for new cpp_file_change structure. + * cpperror.c (print_containing_files): Similarly. + (print_location): Update. Don't output a space before _Pragma. + * cppfiles.c (stack_include_file): Set to line 1 immediately. + (stack_include_filee, cpp_make_system_header): Update. + (_cpp_execute_include): Get logical line number right for calling + as-yet-unterminated #include. + * cpphash.h (struct cpp_reader): Add line_maps. + (_cpp_do_file_change): Update. + * cppinit.c (cpp_create_reader): Initialize line maps. + (cpp_destroy): Destroy line maps. + (cpp_start_read): Get logical line number right. + * cpplex.c (parse_string): Only warn once for multi-line strings. + Use boolean variable for null warning. + * cpplib.c (_cpp_handle_directive): End the directive if it isn't + already. + (do_include_common): End the directive early. + (do_line): Don't warn about out-of-range lines in preprocessed + source. Update. Remove unused variables. + (_cpp_do_file_change): Update for new line mapping. + (pragma_cb): New typedef. + (cpp_register_pragma): Stop looking ahead before calling the + handler. Clean up. + (do_pragma_system_header): End directive early. + (cpp_get_line_maps): New. + (cpp_pop_buffer): Fudge logical line. Update. + * cpplib.h: Include line-map.h + (enum cpp_fc_reason): Remove. + (struct cpp_file_change): Update. + (cpp_get_line_maps): New. + * cppmain.c (struct_printer): New member map. + (cb_file_change): Update for new mappings. + * fix-header.c (cb_file_change): Similarly. + +2001-08-02 Nick Clifton + + * Makefile.in (libgcc.mk): Define mkinstalldirs. + * mklibgcc.in: Use mkinstalldirs instead of mkdir. + +2001-08-02 Lars Brinkhoff + + * config/vax/vax.c: include expr.h. + +2001-08-02 Nick Clifton + + * Makefile.in ($(srcdir)/configure): Only rebuild in + maintainer mode. + ($(srcdir)/config.in): Only define in maintainer mode. + ($(srcdir)/cstamp-h.in): Only define in maintainer mode. + +2001-08-02 David Edelsohn + + * doc/install.texi (Install GCC: Binaries): Update Bull info. + +2001-08-02 Rainer Orth + + * gcc.c (set_collect_gcc_options): New function, split out from + main. + Ignore elided switches. + (do_spec_1): Invoke before executing command. + (set_input): Export. + Move declaration ... + * gcc.h (set_input): ... here. + * config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input + file. + +2001-08-02 Nathan Sidwell + + Kill -fhonor-std. + * doc/c-tree.texi (Namespaces): Remove std & -fhonor-std + interaction. + * doc/invoke.texi (C++ Dialect Options): Remove -fno-honor-std. + +2001-08-02 Richard Sandiford + + * mips.md (movdicc): Make conditional on TARGET_64BIT. Likewise + for the unnamed instructions it expands to. + +2001-08-02 Richard Henderson + + * regclass.c (call_really_used_regs): Conditionally define. + (init_reg_sets_1): Don't use it if not defined. + (fix_register): Similarly, don't set it. + +2001-08-01 Gerald Pfeifer + + * params.def (PARAM_MAX_INLINE_INSNS): Change default to 600. + Correct comment that had been missed in the previous change. + +2001-08-01 Stan Shebs + + * config/darwin.c (machopic_stub_name): Try matching by name. + (update_stubs): New function. + (darwin_encode_section_info): Call it and update_non_lazy_ptrs + unconditionally. + +2001-08-01 Richard Henderson + + * except.c (output_function_exception_table): Use assemble_align. + * varasm.c (assemble_eh_label): Remove. + (assemble_eh_align, assemble_eh_integer): Remove. + +2001-08-01 Robert Lipe + + * dwarfout.c: Remove reference to README.DWARF. + +2001-08-01 Andrew MacLeod + + * regclass.c (call_really_used_regs): New array for registers which + are actually used by a call. + (init_reg_sets_1): Initialize regs_invalidated_by_call with the + new array. + (fix_register): Set call_really_used too. + * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): Initialize. + * doc/tm.texi (CALL_REALLY_USED_REGISTERS): Document. + +2001-08-01 Richard Henderson + + * read-rtl.c (read_name): Consider \r whitespace. + +2001-07-11 Andrew Cagney + + * config.gcc: Recognize powerpc-*-netbsd*. + + * doc/install.texi (Host/target specific installation notes for + GCC): Mention powerpc-*-netbsd*. + + * config/rs6000/netbsd.h: New file. + (STANDARD_STARTFILE_PREFIX, LINK_SHLIB_SPEC): Redefine. + (LIB_DEFAULT_SPEC, STARTFILE_DEFAULT_SPEC): Redefine. + (ENDFILE_DEFAULT_SPEC, LINK_START_DEFAULT_SPEC): Redefine. + (LINK_OS_DEFAULT_SPEC, CPP_OS_DEFAULT_SPEC): Redefine. + (TARGET_VERSION): Redefine. + + * config/rs6000/t-ppccomm (MULTILIB_MATCHES_SYSV): Recognize + mcall-netbsd as a match for mcall-sysv. + (EXTRA_MULTILIB_PARTS): Add ncrti$(objext) and ncrtn$(objext). + (ncrti.S, ncrtn.S): New targets. + ($(T)ncrti$(objext), $(T)ncrtn$(objext)): New targets. + + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Recognize + "netbsd' as a V4 ABI. + (ASM_SPEC): Check for -mcall-netbsd. + (CC1_SPEC, CC1_SPEC, LINK_START_SPEC, LINK_OS_SPEC): Ditto. + (CPP_ENDIAN_SPEC, CPP_SPEC, STARTFILE_SPEC): Ditto. + (LIB_SPEC, ENDFILE_SPEC): Ditto. + (LIB_NETBSD_SPEC, STARTFILE_NETBSD_SPEC): Define. + (ENDFILE_NETBSD_SPEC, LINK_START_NETBSD_SPEC): Define. + (LINK_OS_NETBSD_SPEC, CPP_OS_NETBSD_SPEC): Define. + (SUBTARGET_EXTRA_SPECS): Add NetBSD specs. + + * doc/invoke.texi (Option Summary): Add -mcall-netbsd. + (RS/6000 and PowerPC Options): Mention -mcall-netbsd. + +2001-08-01 Mark Kettenis + + * unwind-pe.h (base_of_encoded_value, read_encoded_value): Define + only if NO_BASE_OF_ENCODED_VALUE isn't defined. + * unwind-dw2-fde.c (NO_BASE_OF_ENCODED_VALUE): Define before + including "unwind-pe.h". + +Wed Aug 1 20:01:42 CEST 2001 Jan Hubicka + + * rs6000.md (define_splits): Kill unused constraints. + +Wed Aug 1 20:02:12 CEST 2001 Graham Stott + Jan Hubicka + + * function.c (thread_prologue_and_epilogue_insns): Kill code + dealing with non-existent CFG. + +2001-08-01 Kazu Hirata + + * alias.c: Fix comment formatting. + * bitmap.c: Likewise. + * builtins.c: Likewise. + * calls.c: Likewise. + * c-common.c: Likewise. + * c-decl.c: Likewise. + * c-dump.c: Likewise. + * c-lex.c: Likewise. + * collect2.c: Likewise. + * combine.c: Likewise. + * conflict.c: Likewise. + * cppfiles.c: Likewise. + * cppinit.c: Likewise. + * cpplex.c: Likewise. + * cpplib.c: Likewise. + * cppmacro.c: Likewise. + * cppspec.c: Likewise. + * c-pragma.c: Likewise. + * crtstuff.c: Likewise. + * cse.c: Likewise. + * cselib.c: Likewise. + * c-semantics.c: Likewise. + * c-typeck.c: Likewise. + +2001-08-01 H.J. Lu + + * config/mips/linux.h (ASM_OUTPUT_IDENT): Defined. + +2001-08-01 H.J. Lu + + * gcc/config/mips/linux.h (ASM_OUTPUT_SOURCE_LINE): Defined. + +2001-08-01 Ziemowit Laski + + * c-parse.in (OBJC_NEED_RAW_IDENTIFIER): Define macro and flag for + contextualizing Objective-C class name lookup by the lexer. + (typespec_reserved_nonattr): Disable ObjC class name lookup after + seeing a TYPESPEC. + (protocoldef): Add support for forward @protocol declarations. + (yylexname): Suppress ObjC class name lookup in certain contexts; + re-enable after lookup is complete. + (_yylex): Re-enable ObjC class name lookup when certain + punctuation marks are seen. + + * objc/objc-act.c (check_protocol_recursively): New function used + for finding circular dependencies in protocols. + (objc_declare_protocols): New function for handling forward + @protocol declarations. + (receiver_is_class_object): Detect the case when 'self' is used + inside of a class method. + (build_message_expr): Issue a warning if class method is desired + but instance method is found instead. + (conforms_to_protocol): Streamline. + (objc_comptypes): Detect the fact that 'Bar foo' conforms to + protocol Foo, even if 'Bar foo' does not. + (check_protocols): Streamline. + (start_protocol): Add checks for circular and duplicate protocol + definitions. + (encode_aggregate_within): For typedefs of structs, encode the + underlying struct. + * objc/objc-act.h (PROTOCOL_DEFINED): New tree accessor. + (objc_declare_protocols): New prototype. + +2001-08-01 Neil Booth + + * cpphash.h (struct cpp_reader): New members line, pseudo_newlines. + * cpplex.c (handle_newline): Update prototype. Maintain logical + line number. + (skip_escaped_newlines, skip_block_comment, parse_string): + Update accordingly. + (_cpp_lex_token): Update, and store token position within the token. + * cpplib.h (struct cpp_token): Add line and column entries. + * cppmacro.c (replace_args): Position stringified tokens correctly. + +2001-08-01 Andreas Jaeger + + * basic-block.h: Add prototype for last_loop_beg_note. + +2001-07-31 Alexandre Petit-Bianco + + * expr.c (safe_from_p): Use WITH_CLEANUP_EXPR_RTL instead of + RTL_EXPR_RTL while handling WITH_CLEANUP_EXPR nodes. Fixed typo in + comment. + (expand_expr): Use WITH_CLEANUP_EXPR_RTL instead of RTL_EXPR_RTL + while handling WITH_CLEANUP_EXPR node. Use second operand calling + expand_decl_cleanup. + * tree.c (firt_rtl_op): The third operand of WITH_CLEANUP_EXPR is + the first RTX. + (simple_cst_equal): WITH_CLEANUP_EXPR node to use its second + operand while calling simple_cst_equal. + * tree.def (WITH_CLEANUP_EXPR): Switched operands: the second + operand is the cleanup expression, the third is the RTL_EXPR. + * tree.h (WITH_CLEANUP_EXPR_RTL): New macro. + +2001-07-31 Jeff Sturm + + * except.c (duplicate_eh_regions): Test n_array[i] for NULL. + +2001-07-31 matthew green + + * config.gcc (i386-*-netbsdelf): New description. + * config/i386/netbsd-elf.h: New file. + +2001-07-30 Geoffrey Keating + + * loop.c (check_dbra_loop): Use single_set to compute + jump_label. + +2001-07-31 Daniel Berlin + + PowerPC reorg and support for powerpc64-*-linux*. + + Also fixes emitting of constants on 32 bit and 64 bit + platforms. + + * config.gcc: powerpc64-*-linux* is a new target. + Things that needed aix.h now also include xcoff.h + + * config/rs6000/rs6000.h: Split XCOFF specific stuff into + xcoff.h. + Move AIX specific stuff into aix.h. + (TARGET_AIX): Renamed to TARGET_XCOFF, since the AIX ABI is used + with more than just XCOFF now. + (SET_ASM_OP): Remove, now defined where needed. + (FUNCTION_PROLOGUE): New macro definition. + (FUNCTION_EPILOGUE): New macro definition. + (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): New macro definition. + + * config/rs6000/xcoff.h: New file. + + * config/rs6000/linux64.h: New file. + + * config/rs6000/darwin.h: Copy needed AIX alignment definitions. + +2001-07-31 Alan Modra + + * rs6000.c (print_operand_address): Handle ELF syntax. + (output_toc): Simplify. Use DOUBLE_INT_ASM_OP. + * rs6000.md (load_toc_aix_di): Handle ELF syntax. + * rs6000.h (ASM_OUTPUT_DOUBLE_INT, ASM_LONG): Use DOUBLE_INT_ASM_OP. + +2001-07-31 David Edelsohn + + * rs6000.c (rs6000_override_options): Only disable + flag_function_sections for XCOFF. + (exact_log2_cint_operand): New predicate. + (reg_or_{add,sub}_cint64_operand): New predicates. + (add_operand): Compare CONST_INT with fewer function calls. + (rs6000_emit_set_const, rs6000_emit_set_long_const): New functions. + (print_operand, case 'p'): Ensure positive operand. + (rs6000_emit_load_toc_table): No load_toc_v4_pic_di. + * rs6000.h (CONST_OK_FOR_LETTER_P, case 'N'): Ensure positive value. + (PREDICATE_CODES): Add new predicates. + * rs6000.md (addsi3): Split 32-bit constants more correctly. + (divsi3, modsi3): Ensure positive power-of-2. + (adddi3): Use new predicate. Split 32-bit constants more + correctly. Re-arrange splitter to handle any constant. + (subdi3): Use new predicate. + (divdi3, moddi3): Ensure positive power-of-2. + (movdi): Use rs6000_emit_set_const. + (load_toc_v4_pic_di): Delete. + +2001-07-31 Graham Stott + + * function.c (pad_below): Revert 2001-07-26 patch. + +Tue Jul 31 15:37:35 CEST 2001 Jan Hubicka + + * reg-stack (convert_regs_1): Fix best edge condition. + +Tue Jul 31 15:33:27 CEST 2001 Jan Hubicka + + * jump.c (duplicate_loop_exit_test): Better test for jumps + entering the loop; create loop pre_header. + +2001-07-31 Hartmut Penner + + * doc/install.texi: Add s390 and s390x as new targets. + * doc/invoke.texi: Add documentation of S/390 and zSeries + target options. + * doc/md.texi: Add documentation of S/390 and zSeries constraints. + +2001-07-30 Roman Zippel + + * config/m68k/m68k.md: Replace all general_operand with + nonimmediate_operand for all destinations. + * config/m68k/m68k.c (not_sp_operand): Likewise. + +Mon Jul 30 23:20:34 EDT 2001 John Wehle (john@feith.com) + + * flow.c (merge_blocks): Return 1 if an extra jump is inserted. + +2001-07-30 Richard Henderson + + * config/ia64/ia64.h (DEBUG_RANGES_SECTION): New. + * config/mips/iris6.h (DEBUG_RANGES_SECTION): New. + +2001-07-30 Roman Zippel + + * config/m68k/m68k.h (TARGET_SWITCHES/TARGET_OPTIONS): + Add missing doc strings + * config/m68k/linux-aout.h (SUBTARGET_SWITCHES): Likewise + * config/m68k/linux.h (SUBTARGET_SWITCHES): Likewise + +Mon Jul 30 22:16:08 CEST 2001 Jan Hubicka + + * i386.c (ix86_output_main_function_alignment_hack): New function. + (TARGET_ASM_FUNCTION_PROLOGUE): Default to it. + + * flow.c (mark_dfs_back_edges): Move from loop_p ; mark back + edges by EDGE_DFS_BACK flag. + (dump_edge_info): Add dfs_back flag. + * basic-block.h (EDGE_DFS_BACK): New constant. + (mark_dfs_back_edges): Declare. + * alias.c (loop_p): Remove. + (mark_constant_function): Use mark_dfs_back_edges. + + * reg-stack.c (block_info_def): Add predecessors counter and stack_out. + (reg_to_stack): Call mark_dfs_back_edges; count the predecessors. + (compensate_edge): Break out from ... + (convert_regs_1): ... here; do smart choosing of stack_out to copy. + (convert_regs_2): Set block_done once block is really done; + Do updating of the predecessors counts. + + * toplev.c (rest_of_compilation): Recompute block_for_insn + before post-reload cfg_cleanup. + * function.c (thread_prologue_epilogue_insns): + Call set_block_for_new_insns when emitting prologue directly. + +2001-07-30 Andreas Jaeger + + * jump.c: Add prototype for mark_modified_reg. + + * cse.c (set_live_p): Add unused attribute. + + * gcov.c (calculate_branch_probs): Use gcov_type to avoid + overflow. + (scan_for_source_files): Use long for count to avoid overflow. + (output_data): Likewise. + (output_data): Don't use string concatatenation to silence gcc + -traditional. + + * predict.c: Fix typos and grammar. + + * gcse.c (insert_insn_end_bb): Remove unused variables. + +Mon Jul 30 21:54:53 CEST 2001 Jan Hubicka + + * flow.c (mark_set_1): Use REG_FREQ_FROM_BB. + (attempt_auto_inc): LIkewise. + (mark_used_reg): Likewise. + (try_pre_increment_1): Likewise. + * regclass.c (regclass): Likewise. + * global.c (allocno_compare): Update comment; change scaling factor. + * local-alloc.c (QTY_CMP_PRI): Likewise. + * regs.h (REG_FREQ_FROM_BB): New. + (REG_FREQ_MAX): Likewise. + +2001-07-30 H.J. Lu + + * config/mips/linux.h (CPLUSPLUS_CPP_SPEC): Add + -D_GNU_SOURCE. + +2001-07-30 H.J. Lu (hjl@gnu.org) + + * config/mips/linux.h (ASM_DECLARE_FUNCTION_NAME): Defined. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. + (FUNCTION_NAME_ALREADY_DECLARED): Likewise. + +2001-07-30 Nick Clifton + + * config/arm/t-arm-elf (MULTILIB_EXCEPTIONS): Skip -mthumb as well + as -mthumb-interwork when -mcpu=arm7 is specified. + +Mon Jul 30 17:44:43 CEST 2001 Jan Hubicka + + * predict.def (noreturn, loop branch, loop exit): Mark as first + match heuristics. + +Mon Jul 30 12:52:11 CEST 2001 Jan Hubicka + + * combine.c (try_combine): Avoid barrier after noop jumps. + +2001-07-29 Neil Booth + + * cpphash.h (struct cpp_reader): Remove import_warning. + * cpplib.c (skip_rest_of_line): Don't bother turning off + macro expansion. + (parse_include): Move include handling to... + (do_include_common): ... here. Move import warning from... + (do_import): ... here. + (do_pragma_poison): Don't do a callback for poison identifiers. + * cpplib.h (struct cpp_callbacks): Don't do poison callbacks. + * cppmain.c (setup_callbacks): Similarly. + +Sun Jul 29 23:26:50 CEST 2001 Jan Hubicka + + * rtlanal.c (parms_set, find_first_parameter_load): Break out from...; + handle multiple sets. + * except.c (sjlj_mark_call_sites): .... here. + * gcse.c (insert_insn_end_bb): Use find_first_parameter_load. + +Sun Jul 29 21:38:45 CEST 2001 Jan Hubicka + + Suggested by Richard Henderson and Richard Kenner: + * combine.c (recog_for_combine): Use the fake recog + only if instruction does not match. + * rtl.h (NOOP_MOVE_INSN_CODE): New. + * rtlanal.c (noop_move_p): Always return 1 for NOOP_MOVE_INSN_CODE. + + * combine.c (try_combine): Discover noop jump as direct jump. + +2001-07-29 Daniel Berlin + + * df.c (df_rd_global_compute): Add successors to worklist, not + current item. + (df_ru_global_compute): Ditto. + +2001-07-27 Daniel Berlin + + * regclass.c (reg_scan_mark_refs): Increment REG_N_REFS when we + increment REG_N_SETS. + +2001-07-26 Daniel Berlin + + * sbitmap.h: New prototype for sbitmap_a_xor_b. + + * sbitmap.c (sbitmap_a_xor_b): New function. + ifdef the basic block stuff on IN_GCC. + +2001-07-29 Neil Booth + + * cppexp.c (parse_defined): Always record the macro name. + (lex): Don't worry about identifiers, or special-case + CPP_NOT here. + (_cpp_parse_expr): Figure out at the end of the routine + whether we saw a valid !defined() expression. + * cppfiles.c (stack_include_file): Update for mi_valid. + (_cpp_pop_file_buffer): Similarly. + * cpplex.c (_cpp_lex_token): Similarly. + * cpphash.h (enum mi_state, enum mi_ind, mi_state, + mi_if_not_defined, mi_lexed): Remove. + (mi_valid): New. + * cpplib.c (do_if): Simplify. + (do_endif, push_conditional, _cpp_handle_directive): Update + for renaming of mi_state to mi_valid. +doc: + * cpp.texi: Add index entries for digraphs, and add comment + that C++ refers to them as alternative tokens. + +Sun Jul 29 18:59:13 CEST 2001 Jan Hubicka + + * basic-block.h (CLEANUP_PRE_LOOP): New. + * except.c (finish_eh_generation): Update call of cleanup_cfg. + * sibcall.c (optimize_sibling_calls): Likewise. + * toplev.c (rest_of_compilation): Likewise. + * flow.c (try_forward_edges): Take argument MODE; + do not forward over loop pre-headers if CLEANUP_PRE_LOOP. + (try_optimize_cfg): Update call of try_forward_edges. + +Sun Jul 29 18:59:56 CEST 2001 Roman Zippel + Jan Hubicka + + * (validate_replace_rtx_1): Fix simplification of MINUS. + +2001-07-29 Neil Booth + + PR preprocessor/3669 + * cppinit.c (init_dependency_output): Turn off dump requests + if sending dependencies to stdout. + +2001-07-28 Richard Henderson + + * flow.c (life_analysis): Elide PROP_ALLOW_CFG_CHANGES if + not optimizing. + +2001-07-28 Golubev I. N. + + * config/i386/sco5.h (DWARF2_DEBUGGING_INFO): Define. + +2001-07-28 Kazu Hirata + + * config/h8300/h8300.h (ENCODE_SECTION_INFO): Check to see if DECL + is VAR_DECL first to prevent an ICE. + +2001-07-28 Richard Henderson + + * varasm.c (immed_real_const_1): Don't elide special cases for + nested functions. + (clear_const_double_mem): Clear const_tiny_rtx too. + +2001-07-28 Richard Henderson + + * dwarf2out.c (dw_val_class_offset): New. + (struct dw_ranges_struct, dw_ranges_ref): New. + (ranges_table, ranges_table_allocated): New. + (ranges_table_in_use, RANGES_TABLE_INCREMENT): New. + (add_AT_offset, add_ranges, output_ranges): New. + (print_die, output_die): Handle dw_val_class_offset. + (attr_checksum, size_of_die, value_format): Likewise. + (gen_lexical_block_die): Handle non-contiguous blocks. + (gen_block_die): Likewise. + (dwarf2out_finish): Add a DW_AT_entry_pc to the compilation unit + if needed. Dump the ranges table. + * final.c (final_start_function): Remove unnecessary notes and + rebuild the block tree before numbering the blocks. + * function.c (reorder_blocks_0): Walk the existing block tree + to unmark all blocks. + (reorder_blocks_1): Create block fragments when duplicate block + notes are seen. + (reorder_fix_fragments): New. + (reorder_blocks): Call it. + * tree.h (BLOCK_FRAGMENT_ORIGIN, BLOCK_FRAGMENT_CHAIN): New. + +2001-07-28 Richard Henderson + + * emit-rtl.c (adjust_address): Make a copy of the memory address. + +2001-07-28 Richard Henderson + + * flow.c (add_to_mem_set_list): New function. + (init_propagate_block_info): Use it. + (mark_set_1): Likewise. + (insn_dead_p): Canonicalize memory address for dead store + comparison. Allow wider mode stores to kill narrower mode stores. + (invalidate_mems_from_autoinc): Use invalidate_mems_from_set. + (invalidate_mems_from_set): Don't handle MEMs. + +2001-07-28 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. + +Sat Jul 28 23:35:22 CEST 2001 Jan Hubicka + + * basic-block.h (EDGE_FREQUENCY): New macro. + * bb-reorder (fixup_reorder_chain): Set counts and frequencies + for new BB/edges. + * flow.c (find_sub_basic_blocks): Likewise. + (try_crossjump_to_edge): Likewise; use EDGE_FREQUENCY + (redirect_edge_and_branch): Use EDGE_FREQUENCY. + + * predict.c (DEF_PREDICTOR): New argument FLAGS. + (HITRATE): New macro. + (PRED_FLAG_FIRST_MATCH): New constant. + (predictor_info): New field flgags. + (combine_predictions_for_insn): Use DS theory to combine + probabilities; set the edge probabilities when finished. + (estimate_probability): Avoid duplicated matches + of LOOP_BRANCH heuristics for nested loops; update comment. + * predict.def: Add flags for each prediction, set probabilities + according to B&L paper. + * predict.h (DEF_PREDICTOR): New argument FLAGS. + + * profile.c (compute_branch_probabilities): Cleanup way the edge + probabilities are computed and REG_BR_PROB notes are dropped; if + values does not match, emit error. + (init_branch_prob): Do error instead of warning when profile driven + feedback is missing or corrupt. + +2001-07-27 DJ Delorie + + * ifcvt.c (noce_get_alt_condition): If the condition is a compare + against a constant, try to adjust the compare to have the desired + constant in it so that min/max optimizations happen more often. + +Fri Jul 27 17:53:00 CEST 2001 Jan Hubicka + + * flow.c (last_loop_beg_note): New function. + (redirect_edge_and_branch): Use it. + (split_edge): Likewise. + + * alias.c (loop_p): Avoid uninitialized memory access. + + * flow.c (try_forward_edges): Avoid accessing freed memory. + + * flow.c (backward_edge_of_syntactic_loop_p): Avoid uninitialized + variable access. + +2001-07-26 Andrew Haley + Joern Rennecke + + * config/sh/linux.h (CPP_DEFAULT_CPU_SPEC): New. + (SUBTARGET_CPP_ENDIAN_SPEC): New. + (SUBTARGET_CPP_SPEC): New. + (CPP_SPEC): Remove. + * config/sh/sh.h (SUBTARGET_CPP_ENDIAN_SPEC): New. + (SUBTARGET_CPP_PTR_SPEC): New. + (CPP_DEFAULT_CPU_SPEC): New. + (EXTRA_SPECS): Add SUBTARGET_CPP_ENDIAN_SPEC, + SUBTARGET_CPP_PTR_SPEC, and CPP_DEFAULT_CPU_SPEC. + (CPP_SPEC): Break out parts into SUBTARGET_CPP_ENDIAN_SPEC, + SUBTARGET_CPP_PTR_SPEC, and CPP_DEFAULT_CPU_SPEC. + (SUBTARGET_CPP_SPEC): Define as an empty string. + +2001-07-27 Gerald Pfeifer + + * doc/install.texi (Configuration): Properly link the host + specific instructions also when generating HTML. + +Fri Jul 27 00:33:35 EDT 2001 John Wehle (john@feith.com) + + * flow.c (redirect_edge_and_branch_force): Test + target->global_live_at_start. + +2001-07-26 Richard Henderson + + * simplify-rtx.c (avoid_constant_pool_reference): Export. + * rtl.h (avoid_constant_pool_reference): Declare it. + * dwarf2out.c (add_location_or_const_value_attribute): Use it. + (add_const_value_attribute): Use add_AT_unsigned for unsigned values. + +Thu Jul 26 22:30:22 CEST 2001 Jan Hubicka + + * rtl.h (cleanup_barriers): Declare. + * jump.c (cleanup_barriers): New function. + * toplev.c (rest_of_compilation): Call cleanup_barriers + before loop optimizer and after bb_reorder. + + * flow.c (back_edge_of_syntactic_loop_p): New. + (split_edge): Use it. + +2001-07-26 Rainer Orth + + * glimits.h (_MACH_MACHLIMITS_H_): Delete. + +Thu Jul 26 22:22:21 2001 Denis Chertykov + + * cse.c (cse_process_notes): Replace any registers if the address + remains valid. + +Thu Jul 26 14:04:03 EDT 2001 John Wehle (john@feith.com) + + * basic-block.h (PROP_ALLOW_CFG_CHANGES): Define. + (PROP_FINAL): Include PROP_ALLOW_CFG_CHANGES. + (propagate_block): Update prototype. + * flow.c (update_life_info): Simplify the CFG and + recalculate the global regs which are alive when + removing dead code during a global update. + (propagate_block): Return nonzero if an INSN is + deleted. + +2001-07-26 Rainer Orth + + * Makefile.in (LIBICONV): Define. + +2001-07-26 Catherine Moore + + * config/v850/v850.h (ENCODE_SECTION_INFO): Change order + of conditional to avoid tree checking errors. + +2001-07-26 Kazu Hirata + + * regmove.c (regmove_optimize): Don't replace a reg with + another reg of a different mode. + +2001-07-26 Andrew MacLeod + + * params.def (PARAM_MAX_PENDING_LIST_LENGTH): Add parameter to + limit length of dependency flush list. + * params.h (MAX_PENDING_LIST_LENGTH): Define. + * sched-int.h (struct deps): Add pending_flush_length field. + * sched-deps.c (flush_pending_lists): Last_pending_memory_flush now + has 1 element in it. + (sched_analyze_1): Use MAX_PENDING_LIST_LENGTH. + (sched_analyze): After a jump, if the pending memory flush list is too + large, flush the pending lists. + (init_deps): Initialize pending_flush_length to 0. + * doc/invoke.texi (max_pending_list_length): Document parameter. + +2001-07-26 Neil Booth + + * toplev.c, varasm.c, final.c: Include xcoffout.h if appropriate. + * dbxout.c (dbxout_global_decl): Move outside #ifdef. + * Makefile.in (varasm.o, final.o, toplev.o): Update dependencies. + +2001-07-26 Neil Booth + + * cpphash.h (struct_lexer_state): Delete was_skipping. + Move skipping here from struct cpp_reader. + * cpplex.c (parse_identifier): Update. + (_cpp_lex_token): Don't skip tokens in a directive. + * cpplib.c (struct if_stack): Update. + (start_directive, end_directive): Don't change skipping state. + (_cpp_handle_directive): Update. + (do_ifdef, do_ifndef, do_if, do_elif): Similarly. + (do_else, do_endif): Update; only check for excess tokens if not + in a skipped conditional block. + (push_conditional): Update for new struct if_stack. + +2001-07-26 Graham Stott + + * function.c (locate_and_pad_parm): Also pad initial offset + so that the total argument size also includes the padding. + +2001-07-26 Graham Stott + + * gensupport.c (alter_output_for_insn): Correct enable checking failure + change XSTR to XTMPL. + + (process_one_cond_exec): Likewise + +2001-07-25 Richard Henderson + + * varasm.c (assemble_variable): Create DECL_RTL before setting + TREE_ASM_WRITTEN. + +Thu Jul 26 00:19:30 CEST 2001 Jan Hubicka + + * predict.c (estimate_probability): Avoid duplicated predictions. + + * loop.c (find_and_verify_loops): Grok multiple barriers. + +Wed Jul 25 18:00:05 2001 Richard Kenner + + * config/alpha/alpha.c (print_operand, case '/'): Don't write '/'. + + * dbxout.c: Consistently use putc instead of fputc. + (print_wide_int): New function; call instead of direct fprintf. + (dbxout_type_index): Adjust calls of CHARS to be more accurate. + (dbxout_type_fields, dbxout_type_method_1): Likewise. + (dbxout_type_methods, dbxout_range_type, dbxout_type): Likewise. + (print_int_cst_octal): Likewise. + (print_octal): Show we wrote characters. + (dbxout_type): Set have_used_extensions in more places. + +2001-07-25 Catherine Moore + + * config/v850/v850.c (v850_va_arg): Use addr + instead of valist to build incr. + +Wed Jul 25 22:48:59 CEST 2001 Jan Hubicka + + * flow.c (delete_dead_jumptables): New function. + (life_analyzis): Call it. + * bb-reorder.c (skip_insns_after_block): Handle contradictory + sequences. + +2001-07-25 Richard Henderson + + * except.c (reachable_handlers): Handle a region being removed + out from under a RESX. + +2001-07-25 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_conditional_move): Always + swap GE/GT if it is an fp comparison. + +2001-07-25 Andrew Haley + + * alias.c (rtx_equal_for_memref_p): Allow strings as types in + operands. + +Wed Jul 25 08:25:01 2001 Jeffrey A Law (law@cygnus.com) + + * ssa.c (rename_insn_1): Do not wrap an assignment to a + paradoxical SUBREG inside a SEQUENCE. Fix minor formatting + glitch. + + * ssa-ccp.c (visit_expression): Handle CALL_INSNs that can + throw an exception. + (visit_expression): When attempting to simplify an expression, + retrieve any modes for arguments before they are simplified + to constants. + +2001-07-25 Andrew MacLeod + Janis Johnson + + * stmt.c (expand_goto): A nonlocal goto can be a call too. + * builtins.c (expand_builtin_longjmp): Reverse label and static chain + pointer parameters to match documented usage of nonlocal_goto. + * config/ia64/ia64.md (nonlocal_goto): Revert label and static chain + parameters to their correct order. + * config/sparc/sparc.md (nonlocal_goto): Revert label and static chain + parameters to their correct order. + +2001-07-25 Andrew MacLeod + + * config/ia64/ia64.h (STRIP_NAME_ENCODING): Strip out '*' as well. + +2001-07-25 Jan Hubicka + Richard Henderson + + * flow.c (find_sub_basic_blocks): Fix handling of the last BB in + the sequence. + (make_edges): New argument update_p; populate the edge cache if set. + (find_basic_blocks): Update make_edges invocation. + +2001-07-24 Joel Sherrill + + * config/i960/i960.h (CPP_SPEC): Define _SOFT_FLOAT for -msoft-float. + +2001-07-24 Joel Sherrill + + * config/sparc/rtems.h (CPP_PREDEFINES): Remove redundant + -Acpu and -Amachine.h. + * config/sparc/rtemself.h (CPP_PREDEFINES): Likewise. + Corrected header to say ELF not a.out. + * config/sparc/sparc.h (CPP_CPU_SPEC): Define _SOFT_FLOAT + when given -msoft-float. + +2001-07-24 Joel Sherrill + + * config.gcc (arm*-*-rtems*): Include crtinit.o and crtfini.o as + extra multilib parts like arm-elf. + (i960-*-coff*, i960-*-rtems): Should not use collect2. + (m68020-*-elf*, m68k-*-elf*, m68k-*-rtems*): Include crtinit.o and + crtfini.o as extra multilib parts. + +2001-07-24 Joel Sherrill + + * configure.in: Add rtems as a supported thread model. + * gthr-rtems.h: Add missing entry point __gthread_active_p. + * configure: Rebuilt. + +2001-07-24 Lars Brinkhoff + + * stor-layout.c (get_mode_alignment): make it work when + BITS_PER_UNIT is not a power of two. + * builtins.c (get_pointer_alignment): Likewise. + +2001-07-24 Richard Henderson + + * simplify-rtx.c (avoid_constant_pool_reference): Coerce + the retrieved constant into the expected mode. + +Wed Jul 25 01:41:27 CEST 2001 Jan Hubicka + + * flow.c (try_simplify_condjump): Avoid duplicated edges. + (verify_flow_info): Check for duplicated edges; clarify + error reporting. + + * flow.c (block_label): Update basic_block_for_insn. + (commit_edge_insertions): Call compute_bb_for_insn. + + * flow.c (purge_dead_edges): Handle conditional jumps and conditional + returns too. + + * flow.c (redirect_edge_and_branch, + try_optimize_cfg): Use redirect_edge_succ_nodup + (redirect_edge_succ_nodup): New. + * basic_block.h (redirect_edge_succ_nodup): Declare. + + * toplev.c (rest_of_compilation): Rebuild CFG before cfg_cleanup + after gcse. + +Wed Jul 25 00:32:49 CEST 2001 Jan Hubicka + + * flow.c (try_forward_edges): Accept fallthru edge; Update comment. + (try_crossjump_to_edge): Update commetns. + (try_crossjump_bb): Likewise. + +2001-07-24 Richard Henderson + + * combine.c (distribute_notes): Move set of need_refresh + for noop_move_p down to catch all cases. + +Tue Jul 24 20:32:44 CEST 2001 Jan Hubicka + + * recog.c (split_all_insns_noflow): New. + * rtl.h (split_all_insns_noflow): Declare. + * ia64.c (ia64_reorg): Use split_all_insns_noflow. + * m68hc11.c (m68hc11_reorg): Likewise. + * sh.c (machine_dependent_reorg): Likewise. + * toplev.c (rest_of_compilation): Likewise for last split_all_insns + call. + +2001-07-18 Andrew Haley + + * config/sh/sh.md (ashlsi3_std splitter): Split only after reload. + (ashlsi3_n splitter): Likewise. + (lshrsi3_n splitter): Likewise. + + (GOTaddr2picreg): Make const SImode. + (sym_label2reg): Likewise. + (symGOT2reg): Likewise. + (symGOTOFF2reg) Likewise. + + (casesi_worker_0): Make unspec SImode. + +2001-07-18 Andrew Haley + + * config/sh/sh.c (barrier_align): Check that an operand really is + an insn before extracting its INSN_CODE. + +2001-07-24 Andrew Haley + + * config/sh/sh.h (OVERRIDE_OPTIONS): Add braces to get rid of + dangling else. + + * config/sh/sh.h (INITIALIZE_TRAMPOLINE): Truncate operands + for SImode to prevent overflow. + +2001-07-24 Rainer Orth + + * config/mips/irix6-libc-compat.c: New file. + * config/mips/t-iris6 (LIB2FUNCS_STATIC_EXTRA): Use it. + * doc/install.texi (Specific, mips*-sgi-irix6): Mention structure + passing workaround. + +2001-07-24 lars brinkhoff + + * rtl.texi (REG_POINTER): Document. + (Machine Modes): Document BImode, OImode, PQImode, PHImode, + QFmode, HFmode, TQFmode, QCmode, and HCmode. + +Tue Jul 24 10:49:40 CEST 2001 Jan Hubicka + + * flow.c (delete_noop_moves): Do not confuse libcall regions. + +2001-07-23 Richard Henderson + + * flow.c (try_simplify_condjump): Use tidy_fallthru_edge. + +2001-07-23 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + general_operand_dst_push. + * config/h8300/h8300.c (general_operand_dst_push): New. + * config/h8300/h8300.h (OK_FOR_T): New. + (EXTRA_CONSTRAINT): Use it. + * config/h8300/h8300.md (movqi_push): Remove and integrate into + the existing movqi pattern. + (movhi_push): Likewise. + + * reload.c: Fix comment typos. + +Mon Jul 23 23:34:07 CEST 2001 Jan Hubicka + + * gcse.c (cprop_insn): Update call of cprop_cc0_jump. + +2001-07-23 H.J. Lu (hjl@gnu.org) + + * doc/extend.texi: Update __builtin_return_address and + __builtin_frame_address. + +2001-07-23 Richard Henderson + + * config/i386/i386.c (ix86_expand_setcc): Don't use method 0 + before CSE. + * config/i386/i386.md: New setcc+movzbl peephole2. + +2001-07-23 Neil Booth + + * objc/Make-lang.in (objc-act.o): Depend on debug.h. + * objc/objc-act.c: Include debug.h. + (synth_module_prologue): Save and restore debug hooks too. + +2001-07-23 lars brinkhoff + + * tm.texi (TARGET_FLOAT_FORMAT): Document IBM_FLOAT_FORMAT + and C4X_FLOAT_FORMAT. + (BOOL_TYPE_SIZE): Document. + +Mon Jul 23 11:54:23 2001 Clinton Popetz + + * unroll.c (loop_iterations): Fix miscalculation of initial + giv offset. + +2001-07-13 Andrew Haley + + * doc/tm.texi (MD_CAN_REDIRECT_BRANCH): New macro. + * config/sh/sh.h (MD_CAN_REDIRECT_BRANCH): New macro. + * config/sh/sh.c (sh_can_redirect_branch): New function. + * config/sh/sh-protos.h (sh_can_redirect_branch): Declare. + * reorg.c (steal_delay_list_from_target): Use + MD_CAN_REDIRECT_BRANCH to see if redirection is possible. + +Mon Jul 23 17:20:18 CEST 2001 Jan Hubicka + + * flow.c (try_simplify_condjump): Unlink insn chain on + fallthru edge; use can_fallthru. + +Mon Jul 23 16:03:19 CEST 2001 Jan Hubicka + + * basic-block.h (find_sub_basic_block): Declare. + * flow.c (make_edges): New arguments MIN and MAX; + (find_sub_basic_blocks): Revamp to use make_edges + and purge_dead_edges. + (find_basic_blocks): Update call of find_sub_basic_block. + + * recog.c (split_all_insns): Always expect CFG to be consistent; + call find_sub_basic_blocks in case something has changed. + * toplev.c (rest_of_compilation): Always call split_all_insns once CFG + has been built. + + * basic-block.h (delete_noop_moves): Declare. + * combine.c (combine_instructions): Call it. + (recog_for_combine): Tolerate noop moves + (distribute_notes): Force refresh when register dies at noop move. + * flow.c (delete_noop_moves): Use BB structure; delete JUMP insns + too. + (life_analysis): Update delete_noop_moves call. + (set_noop_p): Move too ... + * rtlanal.c (noop_move_p): ... here. + * rtl.h (noop_move_p): Declare. + + * basic-block.h (purge_all_dead_edges, purge_dead_edges): New functions. + * toplev.c (rest_of_compilation): Conditionally call purge_all_dead_edges + after combine. + * gcse.c (cprop_cc0_jump, cprop_insn): New argument "basic_block". + (cprop_jump): Likewise; call purge_dead_edges if substitution succeeded. + +2001-07-23 Hans-Peter Nilsson + + * reload.c (push_reload): Fix typo in comment. + (find_reloads_address): Ditto. + (reg_overlap_mentioned_for_reload_p): Ditto in head comment. + +2001-07-22 Richard Henderson + + * flow.c: Grammar check and clarify a lot of comments. + (try_simplify_condjump): Rename variables to be clearer. + (try_forward_edges): Skip complex and fallthru edges. + Rearrange tests to avoid duplicate checks. + (flow_find_cross_jump): Likewise. + (outgoing_edges_match): Allow match if neither branch has + probability data. Loosen probability match to 5%. + (try_crossjump_to_edge): Hoist repeated indirection into + local variables. + (try_crossjump_bb): Don't check complex edges. Eliminate + redundant crossjump tests. + (try_optimize_cfg): Fix use of bool. Reorganize cheaper + checks before more expensive checks. + +2001-07-22 Richard Henderson + + * fold-const.c (fold): Test vs FLOAT_TYPE_P instead of + INTEGRAL_TYPE_P when folding comparisons with operand_equal_p + arguments. + +2001-07-22 Richard Henderson + + * m68k.c (const_uint32_operand): Abort if mode is <= 32 bits. + (const_sint32_operand): Likewise. + * m68k.md (anon mulsi pattern): Use const_int_operand not + const_sint32_operand. + (umulsi3_highpart): Zero extend a constant input. + (smulsi3_highpart): Don't bother checking SImode constant. + (const_umulsi3_highpart): Give op3 DImode. + (const_smulsi3_highpart): Likewise. + +2001-07-22 Richard Henderson + + * flow.c (split_block): Make sure bb_note is included in the + new block when splitting before a label. + +Sun Jul 22 23:28:56 CEST 2001 Jan Hubicka + + * basic-block.h (redirect_edge_and_branch_force, + redirect_edge_and_branch, block_label, forwarder_block_p): Declare. + * flow.c (redirect_edge_and_branch_force, + redirect_edge_and_branch, block_label, forwarder_block_p): Make global. + (redirect_edge_and_branch_force): Fix copying of lifeness information. + (block_label): Handle EXIT_BLOCK_PTR by returning NULL. + * ifcvt.c (dead_or_predictable): Take BB as an new destination + instead of label; update CFG after transformation. + (find_if_case_1): Update call, use redirect_edge_and_branch_force + for finishing the transformation; handle even case where ELSE + does not follow THEN. + (find_if_case_2): Update call of dead_or_predictable; simplify + CFG update. + + * emit-rtl.c (split_branch_probability): New global variable. + (try_split): Take care to set split_branch_probability and + create REG_BR_PROB note for new jump insns. + * md.texi (define_split): Document new feature. + + * i386.c (ix86_split_fp_branch): Redistribute branch probability notes. + +2001-07-22 Neil Booth + + * varasm.c: Don't inlcude dbxout.h, sdbout.h or xcoffout.h. + (asm_out_file): Remove redundant declaration. + (assemble_asm): Remove old #if 0 block. + (assemble_variable): Remove end of function; debug output is + now handled with global_decl. Remove old #if 0 block. Update. + Remove saved_in_section and associated no-op code. + * Makefile.in (varasm.o): Correct dependencies. + +Sun Jul 22 17:55:11 2001 Alexandre Oliva + + * config/i386/freebsd-aout.h (ASM_PREFERRED_EH_DATA_FORMAT): Use + the definition in defaults.h. + +Sun Jul 22 21:31:04 CEST 2001 Jan Hubicka + + * jump.c: Update comments. + (delete_barrier_successors, delete_unreferenced_labels, + delete_noop_moves, tension_vector_labels, delete_from_jump_chain, + delete_labelref_insn, redirect_tablejump, jump_optimize_1, + jump_optimize, jump_optimize_minimal): Kill. + (rebuild_jump_labels): Move code from jump_optimize_1. + (purge_line_number_notes): Likewise. + (copy_loop_headers): Likewise. + * reg-stack.c: Update comment. + * stmt.c: Likewise. + * rtl.h (jump_optimize, jump_optimize_1, JUMP_NOOP_MOVES, + JUMP_AFTER_REGSCAN): Kill. + * toplev.c (rest_of_compilation): Use cleanup_cfg, call + purge_line_number_notes and copy_loop_headers. + +2001-07-22 Neil Booth + Richard Henderson + + * dbxout.c (dbxout_global_decl): New. + (xcoff_debug_hooks, dbx_debug_hooks): Use it. + * sdbout.c (sdbout_finish): New. + (sdbout_debug_hooks): Use it, add comments. + (sdbout_global_decl): Defer initialized public vars to + sdbout_finish. + * varasm.c (assemble_variable): Don't output debug information + for file-scope variables. + +2001-07-22 Richard Henderson + + * config/alpha/alpha.c (get_trap_mode_suffix): New. + (get_round_mode_suffix): New. + (print_operand): Use them for [/]. Remove support for [&'`()+]. + * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Update. + * config/alpha/alpha.md (attr round_suffix): New. + (attr trap_suffix): New. + (all insns): Set them appropriately. Use %/ instead of the + myriad punctuators. + +2001-07-22 Neil Booth + + * dbxout.c, sdbout.c, varasm.c: Revert most recent debug patch. + +2001-07-22 Richard Henderson + + * regrename.c (regrename_optimize): Compute nregs for each + potential target register. + +2001-07-21 Neil Booth + Richard Henderson + + * dbxout.c (dbxout_global_decl): New. + (xcoff_debug_hooks, dbx_debug_hooks): Use it. + * sdbout.c (sdbout_finish): New. + (sdbout_debug_hooks): Use it, add comments. + (sdbout_global_decl): Defer initialized public vars to + sdbout_finish. + * varasm.c (assemble_variable): Don't output debug information + for file-scope variables. + +2001-07-21 H.J. Lu (hjl@gnu.org) + + * config/mips/mips.c (mips_cpu): Moved into ... + (override_options): Here. + + * config/mips/mips.h (mips_cpu_attr): Replace mips_cpu with + mips_tune. + (mips_cpu): Removed. + +2001-07-21 Stephane Carrez + + * config/m68hc11/m68hc11.md ("andqi3"): Accept d as second operand. + ("iorqi3"): Likewise. + ("xorqi3"): Likewise. + ("*addhi3"): Fix constraint to avoid reloading in a soft register. + ("*subhi3_sp): Likewise. + ("*subhi3"): Likewise. + ("extendhisi2"): Accept D, X and Y as source operand to avoid + reload problems. + +2001-07-21 Nathan Sidwell + + * doc/tm.texi: Remove DEFAULT_VTABLE_THUNKS. + * config/freebsd.h: Likewise. + * config/linux.h: Likewise. + * config/openbsd.h: Likewise. + * config/alpha/linux-elf.h: Likewise. + * config/arm/linux-elf.h: Likewise. + * config/d30v/d30v.h: Likewise. + * config/fr30/fr30.h: Likewise. + * config/ia64/aix.h: Likewise. + * config/ia64/ia64.h: Likewise. + * config/mips/linux.h: Likewise. + * config/pj/pj.h: Likewise. + * config/rs6000/linux.h: Likewise. + * config/sparc/linux.h: Likewise. + * config/sparc/linux64.h: Likewise. + +2001-07-20 Bruce Korb + + * fixinc/fixincl.c(test_for_changes): force unsigned char comparisons + because getc() and char* may disagree on signedness. + +2001-07-20 Richard Henderson + + * doc/rtl.texi (REG_DEAD): Update for current semantics. + + * flow.c (try_redirect_by_replacing_jump): Correctly compute which + insns to delete in the presence of cc0 in a jump insn. + +Fri Jul 20 22:14:49 CEST 2001 Roman Zippel + Jan Hubicka + + * m68k.md (zero_extend?i?i2 expander): Use gen_lowpart instead + of doing the change by hand. + +Fri Jul 20 21:59:42 CEST 2001 Jan Hubicka + + * rtlanal.c (set_noop_p): Return true for noop jumps. + + * expr.c (emit_single_push_insn): Add call to push expander. + * expr.h (optab_index): Add OTI_push + (push_optab): New constant. + * genopinit.c (optabs): Add push_optab. + * optabs.c (init_optab): Init push optab. + * md.texi (push??1): Document + +2001-07-20 Stephane Carrez + + * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an + expand to emit the pattern; put a REG_INC note for push/pop + instructions. + ("movdf", "movdf_internal"): Likewise. + ("movsi", "movsi_internal"): Likewise. + ("movsf", "movsf_internal"): Likewise. + ("movhi", "movqi"): Emit a REG_INC note for push/pop instructions. + +2001-07-20 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Don't use + gen_highpart. + +2001-07-20 Daniel Berlin + + * params.def: Change default max inline insns to 100. + +2001-07-20 Diego Novillo + + * combine.c (combine_simplify_rtx): Generate a new shift operation + when simplifying the first operand of a (neg (ashift)) expression. + +2001-07-20 Roman Lechtchinsky + + * regclass.c (N_REG_INTS): Use only 32 bits per element. + +2001-07-20 Kelley Cook + + * doc/install.texi (sparc-sun-solaris*): Add in 4.x assembler bug + information. Move rest into ... + (*-*-solaris): ... here. Eliminate redundant information and + reword necessary packages section. Delete 4.x assembler bug info. + (sparc-sun-*): Merge into ... + (sparc-sun-sunos*): here. + +2001-07-20 Catherine Moore + + * config/v850/v850.md (casesi): Generate LABEL_REF + with Pmode. + +Fri Jul 20 14:12:57 CEST 2001 Jan Hubicka + + * i386-protos.h (ix86_zero_extend_to_Pmode): Declare. + * i386.c (ix86_zero_extend_to_Pmode): Make global. + * i386.md (strclrsi expander): Use it. + +Fri Jul 20 13:24:16 CEST 2001 Jan Hubicka + + * integrate.c (copy_insn_list): handle + NOTE_INSN_DELETED_LABEL, as if it were CODE_LABEL. + (copy_rtx_and_substitute): Likewise; behave to NOTE_INSN_DELETED_LABEL + identically as to CODE_LABEL. + + * fold-const (fold): Convert A/B/C to A/(B*C) and + A/(B/C) to (A/B)*C + + * except.c (connect_post_landing_pads): Delete the RESX insns. + +2001-07-20 Aldy Hernandez + + * config/mips/mips.h (ISA_HAS_NMADD_NMSUB): New macro. + + * config/mips/mips.md (nmadd/nmsub): Use macro. + +2001-07-20 Nathan Sidwell + + * cppinit.c (remove_dup_dir): Make static. + (remove_dup_dirs): Make static. Only warn about preempting a + system directory with a non-system directory. + +2001-07-19 Geoffrey Keating + + * ifcvt.c (noce_try_store_flag_constants): Correct order + of parameters to trunc_int_for_mode. + +2001-07-19 Mark Mitchell + + * reorg.c (fill_simple_delay_slots): If an instruction might throw + an exception that will be caught within this function, do not fill + its delay slot with any subsequent instruction. + +2001-07-19 Steve Ellcey + + * tm.texi (POINTERS_EXTEND_UNSIGNED) Modify definition. + * optabs.c (can_extend_p) Check HAVE_ptr_extend for a specialized + pointer extension instruction. + * combine.c (nonzero_bits,num_sign_bit_copies) Likewise. + * simplify-rtx.c (simplify_unary_operation) Likewise. + * explow.c (convert_memory_address) Check value of + POINTERS_EXTEND_UNSIGNED to avoid some conversions when + less than zero. + * config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, MULTILIB_OPTIONS, + MULTILIB_DIRNAMES, MULTILIB_MATCHES) Add multilib support. + * config/ia64/hpux.h (CPP_SPEC, ASM_SPEC, SUBTARGET_SWITCHES) + Add Multilib Support. + (POINTERS_EXTEND_UNSIGNED) Define for ILP32 support. + * config/ia64/ia64.h (MASK_ILP32, TARGET_ILP32, SUBTARGET_SWITCHES) + Add Multilib Support. + (POINTER_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE) Modify for ILP32 + support. + * config/ia64/ia64.c (rtx_needs_barrier) Add support for addp4. + * config/ia64/ia64.md (ptr_extend) New instruction to "swizzle" + a 32 bit HP-UX pointer into a 64 bit HP-UX pointer. + +2001-07-19 Alexandre Oliva + + * simplify-rtx.c (simplify_replace_rtx): Try to obtain mode from + old and new operands in `<', `3' and `b'. + +2001-07-19 Neil Booth + + * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h. + (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h. + (toplev.o): Don't depend on xcoffout.h. + * c-decl.c: Include debug.h + (duplicate_decls): Use debug hook. + * dbxout.c (dbxout_source_file, dbxout_args): Make static. + (dbx_debug_hooks, xcoff_debug_hooks): Update. + (dbxout_types): Remove. + * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove. + * debug.c (do_nothing_debug_hooks): Update. + (debug_true_tree, debug_nothing_rtx): New. + * debug.h (struct rtx_def): New. + (struct gcc_debug_hooks): New hooks ignore_block, + outlining_inline_function and label. + (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init, + dwarf2out_frame_finish): New. + * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function): + Make static, update prototype. + (dwarf2_debug_hooks): Update. + * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function, + dwarf2out_frame_init, dwarf2out_frame_finish): Remove. + * dwarfout.c (dwarf_debug_hooks): Update. + * emit-rtl.c: Include debug.h. + (remove_unnecessary_notes): Use debug hook. + * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h. + (final_scan_insn): Use debug hook. + * integrate.c (output_inline_function): Use debug hook. + * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static. + (sdb_debug_hooks): Update. + * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove. + * toplev.c: Don't include xcoffout.h. + (note_outlining_of_inline_function, debug_ignore_block): Remove. + * toplev.h (note_outlining_of_inline_function, debug_ignore_block): + Remove. + * tree.h (dwarf2out_do_frame): Remove. + +2001-07-19 Catherine Moore + + * config/v850/v850.h (ASM_OUTPUT_LABELREF): Restore. + +2001-07-19 Geoffrey Keating + + * reload1.c (eliminate_regs_in_insn): When updating a set + to the frame pointer to the hardware frame pointer, perform + the update always not just when REPLACE is set. + + * reload1.c (choose_reload_regs): Don't inherit a reload + that crosses multiple registers if registers past the first + don't fit in the desired class. + + * ifcvt.c (noce_try_store_flag_constants): Use trunc_int_for_mode + when negating constants. + +2001-07-19 Toon Moene + + * tree.def: Document restriction on {L|R}SHIFT_EXPR's second argument. + * doc/tree.texi: Ditto. + +2001-07-19 Mark Kettenis + Jakub Jelinek + + * unwind-dw2.c (_Unwind_FrameState): Add eh_ptr. + (extract_cie_info): Handle "eh" augmentation properly, + remember eh_ptr. + (struct frame_state, __frame_state_for): New. + +2001-07-19 Rainer Orth + + * config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL, + HANDLE_SYSV_PRAGMA): Define. + * mips-tfile.c (add_ext_symbol): Pass complete symbol ptr, inline + previous args. + (copy_object): Caller changed. + +2001-07-19 Andreas Schwab + + * configure.in (assembler dwarf2 debug_line support): Define nop + insn for m68k. + * configure: Regenerated. + +2001-07-19 Neil Booth + + * Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on + dwarfout.h. + * dbxout.c (dbxout_function): Rename dbxout_function_decl, move + to conditionally compiled block. + (dbx_debug_hooks, xcoff_debug_hooks): Update. + * dbxout.h (dbxout_function): Remove. + * debug.c (do_nothing_debug_hooks): Update. + * debug.h (struct gcc_debug_hooks): New hooks function_decl, + global_decl, deferred_inline_function. + * dwarf2out.c (dwarf2_debug_hooks): Update. + (dwarf2out_global_decl): New. + * dwarfout.c: Don't include dwarfout.h. + (dwarfout_global_decl, dwarfout_function_decl, + dwarfout_deferred_inline_function): New. + (dwarf_debug_hooks): Update. + * dwarfout.h: Remove. + * final.c: Don't include dwarfout.h. + * sdbout.c (sdbout_global_decl): New. + (sdbout_debug_hooks): Update. + * toplev.c: Don't include dwarfout.h. + (check_global_declarations, rest_of_compilation): Use new debug hooks. + (note_deferral_of_defined_inline_function): Remove. + * toplev.h (note_deferral_of_defined_inline_function): Remove. + * ch/Makefile.in (lex.o): No dependence on dwarfout.h. + * ch/lex.c: Don't include dwarfout.h. + * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. + (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. + * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. + * cp/optimize.c: Include debug.h. + (maybe_clone_body): Use debug hook. + * cp/semantics.c: Include debug.h. + (expand_body): Use debug hook. + * po/POTFILES.in: Remove dwarfout.h. + +2001-07-19 Neil Booth + + * c-lex.c (c_lex): Remove CPP_INT, CPP_FLOAT cases. + * c-parse.in (yyerror, _yylex): Similarly. + * cppexp.c (parse_number, parse_defined, lex, _cpp_parse_expr): + Don't use CPP_INT, CPP_FLOAT; CPP_NUMBER is enough. + Update comments. + * cpplib.h (CPP_INT, CPP_FLOAT): Remove. + * cp/spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases. + +2001-07-18 Jeff Sturm + + * dwarf2out.c (dwarf2out_abstract_function): Don't emit + in-class declaration at -g1. Fixes c++/2814. + +2001-07-18 Richard Henderson + + * doc/md.texi (reload_in/out): Document restrictions in predicates + and constraints for these patterns. Document empty string matching + ALL_REGS. + +2001-07-18 Rainer Orth + + * defaults.h (ASM_OUTPUT_WEAK_ALIAS): Check for ASM_WEAKEN_LABEL. + +Wed Jul 18 20:47:36 CEST 2001 Jan Hubicka + + * cse.c: Undo my previous patch. + +2001-07-18 Tom Tromey + + For PR java/2812: + * configure: Rebuilt. + * configure.in: Don't check for iconv.h or iconv(); use AM_ICONV + instead. + * aclocal.m4 (AM_ICONV): New macro from Bruno Haible. + +Wed Jul 18 18:46:30 CEST 2001 Richard Henderson + Jan Hubicka + + * flow.c (redirect_edge_and_branch): Bail out on complex edges. + (try_optimize_cfg): Do not remove tail recursive labels before sibcall. + * jump.c (mark_jump_label): Do not forward branches. + +Wed Jul 18 18:35:01 CEST 2001 Jan Hubicka + + * cse.c (delete_trivially_dead_insns): Delete the libcall block + when return value is unused. + +Wed Jul 18 18:28:16 CEST 2001 Jan Hubicka + + * gcse.c (pre_insert_copy_insn): Call update_ld_motion_stores. + +Wed Jul 18 12:05:29 2001 Nicola Pero + + * gthr-posix.h (__gthread_objc_mutex_trylock): Fixed return value + on error. We can't blindly return the result of + pthread_mutex_trylock because it returns a positive number on + error, while we must return -1 on error. + (__gthread_objc_mutex_lock, __gthread_objc_mutex_unlock): Similar + fixes. + Reported by Stephen Brandon . + +2001-07-18 Andreas Jaeger + + * integrate.c (output_inline_function): Correct type of debug_hooks. + +2001-07-18 Toon Moene + + * combine.c (combine_simplify_rtx): DIV can be treated + associatively for floats if unsafe math optimisations are enabled. + +2001-07-17 Richard Henderson + + * reload.c (push_secondary_reload): Accept empty-string for ALL_REGS. + +2001-07-17 Richard Henderson + + * calls.c (prepare_call_address): New parameter SIBCALLP. If true, + don't force the function address into a register. + (expand_call, emit_library_call_value_1): Update callers. + * builtins.c (expand_builtin_apply): Likewise. + * expr.h (prepare_call_address): Update decl. + +2001-07-17 Chandrakala Chavva + + * config.gcc: For *-*-chorusos triplet, get chorus.h file from + config directory. + * config/i386/chorus.h: Move up. + * config/sparc/chorus.h: Likewise. + * config/rs6000/chorus.h: Likewise. + * config/chorus.h: Moved here. + +2001-07-17 Andreas Schwab + + * configure.in (assembler eh_frame optimization): Handle big + endian. + * configure: Regenerated. + +Tue Jul 17 23:43:31 CEST 2001 Jan Hubicka + + * expr.c (epxand_expr): Convert divisions into multiplications by + reciprocals if -ffast-math. + +2001-07-17 Neil Booth + + * dbxout.c (dbxout_really_begin_function): Rename to + dbxout_begin_function. + (dbx_debug_hooks, xcoff_debug_hooks): Update. + (dbxout_begin_function): Remove. + (dbxout_function): Update. + (dbxout_source_line): Update prototype. + * dbxout.h (dbxout_begin_function): Remove. + * debug.c (do_nothing_debug_hooks): Update. + (debug_nothing_tree): Update. + (debug_nothing_charstar_rtx): Remove. + * debug.h (union tree_node): Declare. + (struct rtx_def): Remove. + (gcc_debug_hooks): New hooks begin_prologue, end_prologue, + begin_function. Change source_line prototype. + (debug_nothing_tree): New. + (debug_nothing_charstar_rtx): Delete. + (dwarf2out_begin_prologue): Moved from ... + * tree.h: ... here. + * dwarf2out.c (dwarf2_debug_hooks): Update. + (dwarf2out_begin_prologue): Update prototype. If genuine dwarf2 + debug info, call dwarf2out_source_line. + (dwarf2out_souce_line): Update prototype. + * dwarfout.c (dwarfout_begin_function): Rename dwarfout_end_prologue. + Change prototype, make static. + (dwarfout_source_line): Update prototype. + (dwarf_debug_hooks): Update. + * dwarfout.h (dwarfout_begin_function): Remove. + * final.c (final_start_function, final_scan_insn): Use appropriate + debug hooks, update to use notice_source_line. + (output_source_line): Rename notice_source_line. Don't call the + source_line debug hook. + * sdbout.c (sdbout_begin_function): Rename sdbout_begin_prologue, + make static, update prototype. + (sdbout_mark_begin_function): Rename sdbout_begin_function, update + prototype. + (sdbout_end_prologue): New. + (sdbout_source_line): Update prototype. + (sdbout_debug_hooks): Update. + (sdbout_symbol): Remove unused var. + * sdbout.h (sdbout_begin_function, sdbout_mark_begin_function): + Delete. + * varasm.c: Include debug.h. + (assemble_start_function): Use begin_function debug_hook. + * xcoffout.c (xcoffout_begin_prologue): Rename xcoffout_begin_function, + update with prototype. + (xcoffout_source_line): Update prototype. + * xcoffout.h (xcoffout_begin_prologue): Rename xcoffout_begin_function, + update prototype. + (xcoffout_source_line): Update prototype. + +2001-07-17 Richard Henderson + + * c-typeck.c (build_binary_op): Do not shorten unsigned + right shift after sign extension. + +Tue Jul 17 16:56:05 CEST 2001 Jan Hubicka + + * combine.c (combine_simplify_rtx): Attempt to simplify + a*(b/c) as (a*b)/c for floats in unsafe_math mode. + + * simplify-rtx.c (avoid_constatn_pool_reference): New static function. + (simplify_binary_operation, simplify_unary_operation, + simplify_relational_operation): Use it. + + * combine.c (combine_simplify_rtx): Don't do associative law + on divisions; allow associative law on floats. + +2001-07-17 H.J. Lu + Rainer Orth + + * c-pragma.h (HANDLE_PRAGMA_WEAK): Define iff ASM_WEAKEN_LABEL and + ASM_OUTPUT_WEAK_ALIAS are defined. + * defaults.h (ASM_OUTPUT_WEAK_ALIAS): Define if possible. + * config/mips/iris6.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL): + Moved ... + * config/mips/iris5.h: ... here. + (HANDLE_SYSV_PRAGMA): Defined as 1. + * varasm.c (weak_finish): Use ASM_OUTPUT_WEAK_ALIAS. + * doc/tm.texi (ASM_OUTPUT_WEAK_ALIAS): Support the undefined weak + symbol. + +2001-07-17 Joseph S. Myers + + * c-parse.in (all_prefix_attributes): New variable. + (PUSH_DECLSPEC_STACK, POP_DECLSPEC_STACK): New macros. + (maybe_resetattrs): New production. + (c_parse_init, datadef, fndef, datadecl, setspecs, setattrs, decl, + maybe_type_quals_setattrs, initdecls, notype_initdecls, initdcl, + notype_initdcl, nested_function, notype_nested_function, + component_decl, components, components_notype, + component_declarator, component_notype_declarator, + absdcl_maybe_attribute, parm, firstparm, setspecs_fp, ivar_decl, + ivars, mydecl, myparm): Update. Avoid prefix attributes just + after a comma being applied to more than one declarator. + * doc/extend.texi (Attribute Syntax): Update. Remove + documentation of bugs that are no longer present. + +2001-07-13 Eric Christopher + + * config/mips/mips.h: Change TUNE_MIPS* options to use + mips_tune. + (EXTRA_SPECS): Add cc1_cpu_spec. + * config/mips/mips.md (muldf3): Fix typo. + +2001-07-16 Richard Henderson + + * config/m68k/m68k.c: Include expr.h and reload.h. + (print_operand_address) [16 bit int]: Cast INTVAL to int for %d. + [general int]: Use HOST_WIDE_INT_PRINT_DEC. + +2001-07-16 Daniel Berlin + Richard Henderson + + * cse.c (set_live_p): Take INSN argument for cc0; update callers. + (insn_live_p): Fix fall off end of function. + (dead_libcall_p): Remove COUNTS argument; update callers. + (delete_trivially_dead_insns): Remove unused variables. + +2001-07-17 Andreas Jaeger + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix output format for + x86-64 pic support. + + * lcm.c (optimize_mode_switching): Avoid warning for unused + variable if !NORMAL_MODE. + + * flow.c (try_crossjump_to_edge): Remove unused variable. + +2001-07-16 John David Anglin + + * inclhack.def (ultrix_atexit_param): New hack to fix ultrix 4.3 + atexit declaration in stdlib.h. + +2001-07-16 Richard Begg + + * fixinc/inclhack.def(hpux_vsnprintf): brokenness in stdio.h + +Mon Jul 16 22:48:00 CEST 2001 Jan Hubicka + + * basic-block.h (CLEANUP_PRE_SIBCALL): New constant. + * except.c (finish_eh_generation): Update call of cleanup_cfg; + do rebuild_jump_labels instead of jump_optimize + * sibcall.c (optimize_sibling_and_tail_recursive_call): Likewise. + * toplev.c (rest_of_compulation): Likewise for -Wreturn_type. + * flow.c (try_optimize_cfg): Remove unneeded code_labels. + + * flow.c: Include timevar.h + (find_basic_block): Push/pop timevar; + (cleanup_cfg): Likewise. + * timevar.def (TV_CFG, TV_CLEANUP_CFG): New. + * Makefile: Add dependencies on timevar.h + + * integrate.c (save_for_inline): Kill all BASIC_BLOCK notes. + (copy_insn_list): Avoid killing of BASIC_BLOCK notes. + + * rtl.h (delete_trivially_dead_insns): Add new parameter. + * toplev.c (rest_of_compilation): Update calls. + * cse.c (set_live_p, insn_live_p, dead_libcall_p): Break out from ... + (delete_trivially_dead_insns): ... here; accept new argument + preserve_basic_blocks; preserve basic blocks if set. + + * reg-stack.c (stack_regs_mentioned): Return 0 if + stack_regs_mentioned_data is not initialized. + (reg_to_stack): Make stack_regs_mentioned survive after the + reg-stack is completted; do not call cleanup_cfg. + * toplev.c (rest_of_compilation): Do cleanup_cfg before bb-reorder; + make cleanup_cfg after bb-reorder to output to debug file. + +2001-07-16 Richard Henderson + + * regclass.c (init_reg_sets): Use only 32 bits per initializer + from int_reg_class_contents. + +2001-07-16 Richard Henderson + + * hard-reg-set.h (regs_invalidated_by_call): Declare. + * regclass.c (regs_invalidated_by_call): Move from cse.c. + (init_reg_sets_1): Move initialization from cse_main. + * cse.c (regs_invalidated_by_call): Move to regclass.c. + (cse_main): Move its initialization also. + * df.c (df_insn_refs_record): Use regs_invalidated_by_call. + * flow.c (propagate_one_insn): Likewise. + * gcse.c (compute_hash_table): Likewise. + (compute_kill_rd, compute_store_table): Likewise. + * sched-deps.c (sched_analyze_1): Likewise. + +Mon Jul 16 18:07:07 2001 J"orn Rennecke + + * gcse.c (pre_insert_copy_insn): Use gen_move_insn instead of + gen_rtx_SET. + +2001-07-16 Steve Ellcey + + * dominance.c (calc_dfs_tree_nonrec): Reverse order of tests + in if statement so we don't access undefined memory. + +2001-07-16 Daniel Berlin + + * gcse.c: Update comment at top. + Update comment on mem handling. + mem_last_set, mem_first_set, mem_set_in_block: gone. + Declaration of reg_set_info: gone. + (oprs_unchanged_p): Don't use mem_*set_* anymore. They are + pointless with load_killed_in_block_p (they are *more* + conservative then it, not less, and less accurate). + (oprs_not_set_p): Ditto. + (alloc_gcse_mem): Don't allocate mem_set_in_block + (free_gcse_mem): Don't free it, either. + (record_last_mem_set_info): Update comment in front, remove + mem_*set_* stuff. Note the reason we don't handle stores directly + here. + (compute_hash_table): Update comments to reflect reality. Remove + mem_*set_* references. + (reset_opr_set_tables): Remove mem_*set_* references. + (mark_call): Ditto. + (mark_set): Ditto. Also remove double sets of bitmaps for REG's. + (mark_clobber): Ditto (on both parts, we double set here too). + (expr_killed_p): Remove mem_set_in_block test. + (compute_transp): Remove mem_set_in_block test. + + * ssa-ccp.c: (optimize_unexecutable_edges): Add note about removal + of edge, and removal of phi alternative to dump file. + (ssa_ccp_substitute_constants): Add note about register now being + constant, and which uses were replaced in what insns to dump file. + +2001-07-16 Andreas Jaeger + + * gcov.c (output_data): Use HOST_WIDEST_INT_PRINT_DEC to output + variables of type HOST_WIDEST_INT. + + * libgcc2.c (__bb_exit_func): Handle gcov_type as long long. + (__bb_exit_func): Correct type of count_max to avoid overflow. + (num_digits): Handle long long argument. + + * combine.c (gen_lowpart_for_combine): Remove unused variable. + +2001-07-16 Neil Booth + + * output.h (sdb_begin_function_line): Restore as an extern + variable. + * sdbout.c (sdb_begin_function_line): Make extern. + +2001-07-15 Richard Henderson + + * machmode.def (Pmode): Redefine if GENERATOR_FILE. + * genrecog.c (maybe_both_true_mode): New. + (maybe_both_true_2): Use it. + (write_switch): Don't put Pmode in a switch. + * rtl.c (mode arrays): Don't explicitly size them. + +Sun Jul 15 14:07:36 CEST 2001 Jan Hubicka + + * toplev.c (rest_of_compilation): Fix register_life_up_to_date + handling; move unconditional splitting before mode switching. + + * i386.md (type): Add fistp type. + (i387, length_attr, scheduling definitions): Handle this type. + (fix_trunc?f?i2): Revamp to use mode switching. + (fix_trunct?f?i_nonmemory, fix_trunc?f?i_memory): New patterns. + * i386.h (fp_cw_mode): New enum + (OPTIMIZE_MODE_SWITCHING, NUM_MODES_FOR_MODE_SWITCHING, MODE_NEEDED, + MODE_PRIORITY_TO_MODE, ENUM_MODE_SET): New macros. + +Sun Jul 15 12:53:51 2001 Richard Kenner + + * Makefile.in (integrate.o): Add debug.h. + * integrate.c (debug.h): Add. + (output_inline_function): Save, reset, and restore debug_hooks. + +2001-07-15 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_xfloating_compare): Use CCmode + instead of COMPARE for the EQUIV expression. + +2001-07-15 Richard Henderson + + * flow.c (redirect_edge_and_branch_force): Initialize + global_live_at_start and global_live_at_end. + (allocate_bb_life_data): Export. + * basic-block.h (allocate_bb_life_data): Declare. + * toplev.c (rest_of_compilation): Call it. + +2001-07-15 Richard Henderson + + * config/alpha/alpha.c (alpha_tablejump_addr_vec): New. + (alpha_tablejump_best_label): New. + * config/alpha/alpha-protos.h: Declare them. + * config/alpha/alpha.md: Use braced strings for code blocks. + (tablejump_osf): Break out add with r29. + (tablejump_osf_internal): Remove. + (tablejump_osf_nt_internal): Rename from tablejump_nt_internal, + use alpha_tablejump_addr_vec and alpha_tablejump_best_label. + +Sun Jul 15 00:53:35 CEST 2001 Jan Hubicka + + * loop.c (scan_loop): Add USEs inside PARALLELs into dependencies + of the movable. + + * toplev.c (rest_of_compilation): Allow new pseudoes for mode switching. + + * i386-protos.h (ix86_split_fp_branch): Update prototype. + (ix86_fp_jump_nontrivial_p): New. + * i386.md (fp_jcc_?): Update call of split_fp_branch; + use ix86_fp_jump_nontrivial_p. + * i386.c (ix86_fp_jump_nontrivial_p): New. + (ix86_split_fp_branch): Accept code instead of rtx. + (ix86_expand_compare): Expand comparison early in case + doing so is resonably cheap. + +2001-07-15 Nick Clifton + + * config/rs6000/sysv4.h (CPP_ENDIAN_BIG_SPEC): Assert 'endian' + not 'machine'. + (CPP_ENDIAN_LITTLE_SPEC): Assert 'endian' not 'machine'. + (CPP_ENDIAN_SOLARIS_SPEC): Assert 'endian' not 'machine'. + +2001-07-15 Neil Booth + + * dbxout.c (dbxout_source_line): Make static, update prototype. + (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. + (dbxout_init, dbxout_finish, dbxout_source_line, + dbxout_begin_block, dbxout_end_block): Update for new prototypes. + * dbxout.h (dbxout_source_line): Delete. + * debug.c (debug_nothing_file, debug_nothing_file_int, + debug_nothing_file_charstar_rtx): New. + (do_nothing_debug_hooks): Update. + (debug_nothing_void, debug_nothing_charstar_rtx, + dwarf2out_end_epilogue): New. + (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. + * debug.h (struct rtx_def): Declare. + (gcc_debug_hooks): New hooks source_line, end_epilogue + and end_function. + (debug_nothing_void, debug_nothing_charstar_rtx, + dwarf2out_end_epilogue): New. + (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. + * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. + (dwarf2_debug_hooks): Update. + (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, + dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. + * dwarf2out.h (dwarf2out_source_line): Remove. + * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): + Make static, update prototype. + (dwarfout_init, dwarfout_finish, dwarfout_source_line, + dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. + (dwarf_debug_hooks): Update. + * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, + dwarfout_end_function): Remove. + * final.c (profile_function): Use debug hooks for ending functions + and epilogues. + (output_source_line, final_end_function): Update prototype, + use debug hooks. + (final_start_function, final_scan_insn): Update. + * output.h (sdb_begin_function_line): Remove. + (final_end_function): Update prototype. + * sdbout.c (sdb_begin_function_line): Make static. + (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. + (sdbout_source_line): New. + (sdbout_end_epilogue, sdbout_end_function): Make static, update + prototypes. + (sdb_debug_hooks): Update. + (sdbout_init, sdbout_source_line, + sdbout_begin_block, sdbout_end_block): Update for new prototypes. + * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. + * toplev.c (compile_file, rest_of_compilation): Update. + * tree.h (dwarf2out_end_epilogue): Move to debug.h. + * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, + xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): + Update for prototype changes. + * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, + xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. + +2001-07-15 Richard Henderson + + * config/alpha/alpha.h (TARGET_ABI_OSF): New. + (TARGET_ABI_WINDOWS_NT, TARGET_ABI_OPEN_VMS): Rename; update users. + * config/alpha/alpha-protos.h: Update TARGET_ABI_* users. + * config/alpha/alpha.c: Likewise. + * config/alpha/alpha.md: Likewise. + * config/alpha/alpha32.h: Likewise. + * config/alpha/vms.h: Likewise. + (OPEN_VMS): Remove. + +2001-07-14 Richard Henderson + + * config/alpha/alpha.md: Use define_constants for unspec values. + Substitute throughout. + +2001-07-14 Tim Josling + + * tree.def (EXPON_EXPR) remove. Never supported anyway. + +2001-07-14 John David Anglin + + * pa.md: Remove unused constraints from define_split's. + +2001-04-14 Richard Henderson + + * ifcvt.c (find_cond_trap): Test for exit block. + +Sun Jul 15 00:50:20 CEST 2001 Jan Hubicka + + Re-install recently reverted patch. + * emit-rtl.c (try_split): Update mark_jump_label call. + * flow.c (find_sub_basic_blocks): Likewise. + * jump.c (cross_jump_death_matters, find_cross_jump, do_cross_jump, + jump_back_p): Kill. + (mark_all_labels): Kill second parameter. + (jump_optimize, jump_optimize_1): Kill cross_jump parameter. + (rebuild_jump_labels, jump_optimize_minimal): Update call + of jump_optimize_1. + (jump_optimize_1): Kill crossjumping code. + (mark_jump_label): Kill cross_jump parameter. + * rtl.h (mark_jump_label, jump_optimize): Update prototypes. + (JUMP_CROSS_JUMP, JUMP_CROSS_JUMP_DEATH_MATTERS): Kill. + * reg-stack.c (reg_to_stack): Do not rebuild if not needed; do + splitting. + * toplev.c (enum dump_file_index): Kill DFI_jump2; put DFI_stack before + DFI_bpro. + (dump_file_info): Likewise. + (rest_of_compilation): Update calls to jump_optimize; kill jump2 pass; + reorganize passes to do reg-stack first, bb-reorder second. + * invoke.texi (-d letters doc): Remove the jump2 pass. + +2001-07-14 Richard Henderson + + * ifcvt.c (find_cond_trap): New. + (find_if_header): Call it. + (merge_if_block): Relax existing jump sanity check. + * jump.c (jump_optimize_1): Remove conditional trap handling. + +2001-07-14 Alan Modra + + * config/pa/pa.c (emit_hpdiv_const): Return reg is r2 for 64-bit + millicode. + (insn_refs_are_delayed): Correct comment. + * config/pa/pa.h (INSN_REFERENCES_ARE_DELAYED): Likewise. + * config/pa/pa.md (mulsi3): If TARGET_64BIT, clobber r2 + instead of r31. Make associated insn !TARGET_64BIT, and + provide an additional 64-bit insn that clobbers r2. + (divsi3): Likewise. + (udivsi3): Likewise. + (modsi3): Likewise. + (umodsi3): Likewise. + +Sat Jul 14 02:58:38 CEST 2001 Jan Hubicka + + * bb-reorder.c (skip_insn_after_block): Get past the line number notes. + + * flow.c (redirect_edge_and_branch_force, split_edge, + try_crossjump_to_edge): Use set_block_for_new_insns. + * bb-reorder.c (emit_jump_to_block_after): Call set_block_for_new_insns. + +2001-07-13 H.J. Lu (hjl@gnu.org) + + * config/elfos.h (UNIQUE_SECTION): Enable .bss section with + the correct patch. + +2001-07-13 Geoffrey Keating + + Revert H.J. Lu's UNIQUE_SECTION patch of 2001-07-13. + +2001-07-13 Joseph S. Myers + + * c-common.c (decl_attributes): Take a pointer to the node to + which attributes are to be attached, and a flags argument. + * c-common.h (enum attribute_flags): New. + (decl_attributes): Update prototype. + * c-decl.c (start_decl, push_parm_decl, finish_struct, + finish_enum, start_function): Update calls to decl_attributes. + * c-parse.in (component_declarator, component_notype_declarator, + label): Update calls to decl_attributes. + +Fri Jul 13 23:04:00 2001 Denis Chertykov + + * config/avr/avr.md (strlenhi): PARALLEL keyword removed. + * config/avr/avr.c (legitimate_address_p): Return value changed + from letter to register classes. For better debugging. + +2001-07-13 Kazu Hirata + + * jump.c (reversed_comparison_code_parts): Fix comment typos. + +2001-07-13 H.J. Lu (hjl@gnu.org) + + * config/elfos.h (UNIQUE_SECTION): Enable .bss section. + +2001-07-13 Marc Espie + + * config.gcc (*-*-openbsd*): Add fragment to compile libgcc + correctly for shared configurations. + * config/t-libgcc-pic: New. + * config/{i386,m68k,sparc}/t-openbsd: New. + * config/openbsd.h: Include cpu_spec in cpp_spec where needed. + Support -shared. Support debugging libraries with -g. + * config/i386/openbsd.h: Correct ASM_COMMENT_START. Ensure dwarf2 + frame information does not emit pointer diffs. + * config/sparc/openbsd.h: Ensure dwarf2 frame information does not + emit pointer diffs. + +2001-07-13 Geoffrey Keating + + Revert Jan Hubicka's patch of Fri Jul 13 14:46:21 CEST 2001. + +2001-07-13 David Edelsohn + + * combine.c (try_combine): Ensure const_int pow2 is positive. + +2001-07-13 Hartmut Penner + + * config.gcc: Add configuration for s/390. + * config/s390/s390.c: New. Subroutines for code generation. + * config/s390/s390.h: New. Definitions for s/390. + * config/s390/s390-protos.h: New. Prototypes. + * config/s390/linux.h: New. Definitions for linux for s/390. + * config/s390/linux64.h: New. Definitions for linux for zSeries. + * config/s390/t-linux: New. Makefile fragment. + * config/s390/s390.md: New. Machine description for s/390 and zSeries. + * config/s390/fixdfdi.h: New. Fix L_fix*di. + +Fri Jul 13 14:46:21 CEST 2001 Jan Hubicka + + * emit-rtl.c (try_split): Update mark_jump_label call. + * flow.c (find_sub_basic_blocks): Likewise. + * jump.c (cross_jump_death_matters, find_cross_jump, do_cross_jump, + jump_back_p): Kill. + (mark_all_labels): Kill second parameter. + (jump_optimize, jump_optimize_1): Kill cross_jump parameter. + (rebuild_jump_labels, jump_optimize_minimal): Update call + of jump_optimize_1. + (jump_optimize_1): Kill crossjumping code. + (mark_jump_label): Kill cross_jump parameter. + * rtl.h (mark_jump_label, jump_optimize): Update prototypes. + (JUMP_CROSS_JUMP, JUMP_CROSS_JUMP_DEATH_MATTERS): Kill. + * reg-stack.c (reg_to_stack): Do not rebuild if not needed; do + splitting. + * toplev.c (enum dump_file_index): Kill DFI_jump2; put DFI_stack before + DFI_bpro. + (rest_of_compilation): Update calls to jump_optimize; kill jump2 pass; + reorganize passes to do reg-stack first, bb-reorder second. + * invoke.texi (-d letters doc): Remove the jump2 pass. + +2001-07-12 Steve Ellcey + + * toplev.c (compile_file): Put call of ASM_FILE_START inside ifdef. + +Thu Jul 12 17:57:16 CEST 2001 Jan Hubicka + + * flow.c (try_optimize_cfg): Delete whole chain of trivially dead + basic blocks. + (verify_flow_info): Make diagnostics prettier. + +Thu Jul 12 16:48:54 CEST 2001 Jan Hubicka + + * flow.c (find_basic_blocks_1): Do not emit NOP after call. + + * flow.c (outgoing_edges_match): Return early if condition reversal + failed. + +2001-07-06 Richard Sandiford + + * config/mips/mips.c (print_operand): Extend '%D' to memory operands. + (mips_move_2words): When splitting a move into two instructions, + prefix the second address operand with '%D'. + +2001-07-12 Neil Booth + + * Makefile.in (final.o): Depend on debug.h. + * dbxout.c (dbxout_begin_block, dbxout_end_block): New. + (dbx_debug_hooks): Add new hooks. + (xcoff_debug_hooks): New. + * debug.c (debug_nothing_file_int_int): New. + (do_nothing_debug_hooks): Update. + * debug.h (gcc_debug_hooks): New hooks begin_block and end_block. + (debug_nothing_file_int_int): New. + * dwarf2out.c (dwarf2out_begin_block, dwarf2out_end_block): Make + static, update prototype. + (dwarf2_debug_hooks): Update. + * dwarf2out.h (dwarf2out_begin_block, dwarf2out_end_block): Remove. + * dwarfout.c (dwarfout_begin_block, dwarfout_end_block): Make + static, update prototype. + (dwarf_debug_hooks): Update. + * dwarfout.h (dwarfout_begin_block, dwarfout_end_block): Remove. + * final.c: Include debug.h. + (final_scan_insn): Use debug hooks when beginning and ending blocks. + * sdbout.c (sdbout_begin_block, sdbout_end_block): Make + static, update prototype. + (sdb_debug_hooks): Update. + * sdbout.h (sdbout_begin_block, sdbout_end_block): Remove. + * toplev.c: Distinguish between xcoff and dbx. + + * f/lex.c (ffelex_file_pop_, ffelex_file_push_, ffelex_hash_): + Call all debug hooks, not just dwarf ones. + +2001-07-11 Timothy Wall + + * config.gcc: Add configuration for AIX5/IA64. + * config/ia64/aix.h: New. AIX5/IA64-specific configuration. + * config/ia64/crt[in].asm: New. Generic static ctor/dtor + support prefix/suffix code. + * config/ia64/t-aix: New. Makefile fragment. + * config/ia64/unwind-aix.c: New. Unwind table entry lookup. + +2001-07-11 Kazu Hirata + + * recog.c (validate_change): Fix a comment typo. + +2001-07-11 Neil Booth + + * Makefile.in (c-lex.o): Wrap long lines. Depend on debug.h. + * c-lex.c (cb_file_change, cb_define, cb_undef): Use debug + hooks directly. + * dbxout.c (dbx_debug_hooks): Add new hooks. + (dbxout_start_new_source_file): Rename dbxout_start_source_file, + make static. + (dbxout_resume_previous_source_file): Rename dbxout_end_source_file, + make static. + * dbxout.h (dbxout_start_new_source_file, + dbxout_resume_previous_source_file): Delete. + * debug.c (do_nothing_debug_hooks): Add new hooks. + (debug_nothing_init_finish): Rename debug_nothing_file_charstar. + (debug_nothing_int_charstar, debug_nothing_int): New. + * debug.h (gcc_debug_hooks): New hooks define, undef, + start_source_file and end_source_file. + (debug_nothing_init_finish): Rename debug_nothing_file_charstar. + (debug_nothing_int_charstar, debug_nothing_int): New. + * dwarf2out.c (dwarf2_debug_hooks): Add new hooks. Move into + the conditionally compiled section. + (dwarf2out_start_source_file, dwarf2out_end_source_file, + dwarf2out_define, dwarf2out_undef): Make static. + * dwarf2out.h (dwarf2out_start_source_file, dwarf2out_end_source_file, + dwarf2out_define, dwarf2out_undef): Remove. + * dwarfout.c (dwarf_debug_hooks): Add new hooks. + (dwarfout_start_source_file, dwarfout_end_source_file, + dwarfout_define, dwarfout_undef): Make static. + (dwarfout_start_source_file_check, + dwarfout_end_source_file_check): New. + (dwarfout_define, dwarfout_finish): Update. + * dwarfout.h (dwarfout_start_new_source_file, + dwarfout_resume_previous_source_file, dwarfout_define, + dwarfout_undef): Remove. + * sdbout.c (sdb_debug_hooks): Add new hooks. + (sdbout_start_new_source_file): Rename sdbout_start_source_file, + make static. + (sdbout_resume_previous_source_file): Rename sdbout_end_source_file, + make static, take an arg. + * sdbout.h (sdbout_start_new_source_file, + sdbout_resume_previous_source_file): Delete. + * toplev.c (debug_start_source_file, debug_end_source_file, + debug_define, debug_undef): Delete. + * toplev.h (debug_start_source_file, debug_end_source_file, + debug_define, debug_undef): Delete. + + * java/jcf-parse.c: Include debug.h. + (parse_class_file): Update to use debug hooks directly. + * java/Make-lang.in (jcf-parse.o): Depend on debug.h. + +Wed Jul 11 10:07:18 2001 Richard Kenner + + * alias.c (set_mem_alias_set): New function. + * rtl.h (set_mem_alias_set): Declare it. + * builtins.c (expand_builtin_return_addr): Call it instead of + using MEM_ALIAS_SET accessor. + (expand_builtin_setjmp_setup, expand_builtin_longjmp): Likewise. + (get_memory_rtx, expand_builtin_va_arg): Likewise. + (expand_builtin_va_copy):Likewise. + * caller-save.c (setup_save_areas): Likewise. + * calls.c (compute_argument_addresses): Likewise. + * explow.c (set_mem_attributes): Likewise. + * expr.c (emit_single_push_insn, emit_push_insn): Likewise. + (expand_assignment, store_constructor_field, store_field): Likewise. + (expand_expr_unaligned): Likewise. + * function.c (assign_stack_temp_for_type): Likewise. + (put_reg_into_stack, gen_mem_addressof): Likewise. + * ifcvt.c (noce_try_cmove_arith): Likewise. + * reload1.c (reload, alter_reg): Likewise. + * config/alpha/alpha.c (get_aligned_mem): Likewise. + (alpha_set_memflags_1, alpha_expand_unaligned_load): Likewise. + (alpha_expand_unaligned_store): Likewise + (alpha_expand_unaligned_load_words): Likewise. + (alpha_expand_unaligned_store_words): Likewise. + (alpha_expand_block_clear, alpha_expand_prologue): Likewise. + (alpha_expand_epilogue): Likewise. + * config/arc/arc.c (arc_setup_incoming_varargs): Likewise. + * config/clipper/clipper.c (clipper_builtin_saveregs): Likewise. + * config/i386/i386.c (legitimize_pic_address): Likewise. + * config/i960/i960.c (setup_incoming_varargs): Likewise. + * config/ia64/ia64.c (spill_restore_mem): Likewise. + * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. + * config/m8k/m88k.c (m88k_builtin_saveregs): Likewise. + * config/mips/mips.c (mips_va_arg): Likewise. + * config/mn10300/mn10300.c (mn10300_builtin_saveregs): Likewise. + * config/pa/pa.c (hppa_builtin_saveregs): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. + (setup_incoming_varargs, rs6000_va_arg): Likewise. + (rs6000_emit_eh_toc_restore, rs6000_emit_prologue): Likewise. + (rs6000_emit_epilogue): Likewise. + * config/sh/sh.c (sh_builtin_saveregs): Likewise. + * config/sparc/sparc.c (sparc_va_arg): Likewise. + * config/v850/v850.c (v850_va_arg): Likewise. + +Wed Jul 11 21:27:25 CEST 2001 Jan Hubicka + + * flow.c (merge_blocks_move_successor_nojumps): Do not crash + when fallthru edge is present. + (mege_blocks): Handle case where creation of jump insn + is required. + + * basic-block.h (CLEANUP_EXPENSIVE, CLEANUP_CROSSJUMP, + CLEANUP_POST_REGSTACK): New constants. + * except.c (finish_eh_generation): Update call of cleanup_cfg, + * jump.c (rtx_renumbered_equal_p): Handle 't' fields. + * output.h (cleanup_cfg): Update prototype. + * reg-stack.c (reg_to_stack): Use cleanup_cfg instead of jump_optimize + * sibcall.c (optimize_sibling_and_tail_recursive_call): Update + cleanup_cfg call; kill missleading comment. + * toplev.c (rest_of_compilation): Update all cleanup_cfg calls. + * flow.c (merge_blocks, try_optimize_cfg, cleanup_cfg): Accept mode + parameter; control optimizations performed using it. + (flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, + try_crossjump_bb): New functions. + +2001-07-11 John David Anglin + + * pa.c (pa_output_function_prologue): Delete prototype. Make function + extern. + * pa.h (ASM_OUTPUT_MI_THUNK): Rename output_function_prologue to + pa_output_function_prologue. + * pa-protos.h (pa_output_function_prologue): New prototype. + +2001-07-11 John David Anglin + + * stmt.c (emit_case_nodes): Widen high and low instead of new_bound + and low to get correct sign extension in low+high test. + +2001-07-11 Janis Johnson + + * gcov.c (arcdata): Use gcov_type to fix branch percentage + for large hit count. + + * profile.c (branch_prob): Fix .bbg info for computed gotos + and C++ EH code. + +2001-07-11 Mark Mitchell + + * stmt.c (parse_output_constraint): New function, split out + from ... + (expand_asm_operands): ... here. Use parse_output_constraint. + * tree.h (parse_output_constraint): Declare it. + +2001-07-11 Richard Henderson + + * bitmap.c: Comment some functions; fiddle whitespace. + (bitmap_free): Don't export. + (bitmap_element_allocate): Use memset. + * bitmap.h (bitmap_free): Don't declare. + +2001-07-11 Daniel Berlin + + * gcse.c, lcm.c, sched-deps.c: + s/free on sbitmap vectors/sbitmap_vector_free on sbitmap vectors/g + + * flow.c (flow_loops_find): Free dom if we found no loops, since + we aren't going to save it. + + * lcm.c (pre_edge_rev_lcm): Free st_antin, st_antout when we are + done. + +Wed Jul 11 09:00:48 2001 Jeffrey A Law (law@cygnus.com) + + * ssa-ccp.c (ssa_fast_dce): Free worklist when completed. + +Wed Jul 11 10:07:18 2001 Richard Kenner + + * dwarf2out.c (dwarf2out_init, dwarf2out_finish): Add dummy version + #ifndef DWARF2_DEBUGGING_INFO. + +2001-07-11 Richard Sandiford + + * simplify-rtx.c (simplify_gen_subreg): Return null for QUEUED rtxes. + +2001-07-11 Richard Sandiford + + * config/mips/mips.c (gen_int_relational): Tell the caller not to + reverse a branch if a NE comparison is implemented with GTU. + +2001-07-11 Richard Sandiford + H.J. Lu + + * mips.md (call_internal1): Use CONSTANT_ADDRESS_P to check for + constant addresses. + (call_internal2): Likewise. + (call_value_internal1): Likewise. + (call_value_internal2): Likewise. + (call_value_multiple_internal1): Likewise. + (call_value_multiple_internal2): Likewise. + +2001-07-10 Kazu Hirata + + * calls.c (emit_library_call_value_1): Fix a comment typo. + * dwarf2out.c (mem_loc_descriptor): Likewise. + * config/i386/i386.c (ix86_expand_aligntest): Likewise. + +2001-07-11 David Billinghurst + + * simplify-rtx.c (simplify_subreg): Fix typo in comment + +Tue Jul 10 07:27:53 2001 Richard Kenner + + * recog.c (offsettable_address_p): Handle LO_SUM case. + * config/mips/mips.c (double_memory_operand): Use adjust_address_nv + instead of plus_constant. + +2001-07-10 Stephane Carrez + + * reload1.c (merge_assigned_reloads): After a RELOAD_OTHER merge, + fix setting of the reloads of that reload to RELOAD_FOR_OTHER_ADDRESS. + +Tue Jul 10 07:27:53 2001 Richard Kenner + + * config/rs6000/rs6000.c (print_operand, case 'L', 'Y', 'Z'): Use + adjust_address_nv instead of plus_constant. + +2001-07-10 Neil Booth + + * Makefile.in (toplev.o, sdbout.o, dbxout.o, dwarfout.o, + dwarf2out.o): Depend on debug.h, wrap long lines. + * dbxout.c: Include debug.h. + (dbx_debug_hooks): New. + (dbxout_init): Make static, take just 2 args. + (dbxout_finish): Make static. + * dbxout.h (dbxout_init, dbxout_finish): Delete. + * debug.c: New file. + * debug.h: New file. + * dwarf2out.c: Include debug.h. + (dwarf2_debug_hooks): New. + (dwarf2out_init): Make static. + (dwarf2out_finish): Make static, take 2 args. + * dwarf2out.h (dwarf2out_init, dwarf2out_finish): Delete. + * dwarfout.c: Include debug.h. + (dwarf_debug_hooks): New. + (dwarfout_init): Make static. + (dwarfout_finish): Make static, take 2 args. + * dwarfout.h (dwarfout_init, dwarfout_finish): Delete. + * sdbout.c: Include debug.h. + (sdb_debug_hooks): New. + (sdbout_init): Make static, take 2 args. + * sdbout.h (sdbout_init): Delete. + * toplev.c: Include debug.h. + (debug_hooks): New. + (compile_file): Set deubg_hooks based on command line options. + Use the hooks unconditionally rather than conditional compilation. + +Tue Jul 10 09:04:45 2001 Jeffrey A Law (law@cygnus.com) + + * ssa-ccp.c (first_phi_node): Remove. Replace uses with calls to + first_insn_after_basic_block_note instead. + + * df.c (df_bb_refs_unlink): #if 0 out for now. + +2001-07-10 David Billinghurst + + * diagnostic.c (finish_diagnostic): Rename to + diagnostic_finish. Make it take an 'output_buffer *'. Adjust + calls thourghout. + +2001-07-10 Jason Merrill + + * dwarf2out.c (dwarf2out_line): Emit -dA comment even when we have + .loc support. + + * collect2.c (main): Set COLLECT_NO_DEMANGLE for subprocesses. + (dump_file): Only pad the demangled name with spaces if the + mangled name was padded with spaces. + +2001-07-10 Bernd Schmidt + + * bb-reorder.c (make_reorder_chain_1): Correct branch/fallthru + edge detection. + +Tue Jul 10 07:27:53 2001 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): Don't force using bitfield + extraction if no direct load if either EXPAND_CONST_ADDRESS or + EXPAND_INITIALIZER. + + * emit-rtl.c (adjust_address, adjust_address_nv): Change criteria for + whether can put offset inside LO_SUM to check mode alignment, not size. + +2001-07-10 Gabriel Dos Reis + + * doc/tm.texi (Misc): Fix thinko. + +2001-07-10 Jan van Male + + * regmove.c (replace_in_call_usage): Fix warnings. + * sched-deps.c (add_dependence): Fix warnings. + * simplify-rtx.c (simplify_subreg): Likewise. + Return NULL_RTX instead of NULL. + + * reg-stack.c (emit_swap_insn): Eliminate warnings. + (subst_asm_stack_regs): Likewise. + + * combine.c (num_sign_bit_copies): Cast bitwidth to int to avoid + warnings. + + * dwarf2out.c (output_call_frame_info): Declare i as int. + (build_abbrev_table): Declare n_alloc as int. + (dwarf2out_finish): Initialize die. + * except.c: Declare sjlj_funcdef_number as unsigned. + (connect_post_landing_pads): Declare j as unsigned. + (convert_to_eh_region_ranges): Initialize call_site. + (output_function_exception_table): Initialize tt_format_size. + * expr.c (move_by_pieces_1): Initialize to1. + (store_constructor): Initialize minelt and maxelt. + * flow.c (mark_regs_live_at_end): Declare i as unsigned. + * function.c (instantiate_decls): Avoid signed/unsigned warning. + + * c-decl.c (combine_parm_decls): Unused, remove. + * c-tree.h: Remove prototype for combine_parm_decls. + + * reload.c (push_reload): Fix warning. + (regno_clobbered_p): Likewise. + * reload1.c (replace_pseudos_in_call_usage): Likewise. + (reload_combine): Likewise. + + * bitmap.c: Rename bitmap_zero to bitmap_zero_bits to fix warnings. + * bitmap.h: Rename bitmap_zero to bitmap_zero_bits to fix + warnings. + * bitmap.c (bitmap_operation): Change user. + * bitmap.h (EXECUTE_IF_AND_COMPL_IN_BITMAP): Likewise. + +2001-07-10 Eric Christopher + + * config/mips/mips.c (override_options): Fix typo. + +2001-07-09 Stan Shebs + + * target.h (struct gcc_target): New fields init_builtins and + expand_builtin. + * target-def.h (TARGET_INIT_BUILTINS): New macro. + (TARGET_EXPAND_BUILTIN): New macro. + (TARGET_INITIALIZER): Add them. + * builtins.c: Include target.h. + (expand_builtin): Use targetm.expand_builtin. + (default_init_builtins): New function. + (default_expand_builtin): New function. + * expr.h (default_init_builtins): Declare. + (default_expand_builtin): Declare. + * c-common.c (c_common_nodes_and_builtins): Use + targetm.init_builtins. + * defaults.h (MD_INIT_BUILTINS): Remove. + * Makefile.in (builtins.o): Depend on target.h. + + * config/arm/arm.c (TARGET_INIT_BUILTINS): Define. + (TARGET_EXPAND_BUILTIN): Define. + * config/arm/arm.h (MD_INIT_BUILTINS): Remove. + (MD_EXPAND_BUILTIN): Remove. + + * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define. + (TARGET_EXPAND_BUILTIN): Define. + (c4x_init_builtins): Make endlink arg a local. + (c4x_print_operand): Fix typos in adjust_address usages. + * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl. + * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove. + (MD_EXPAND_BUILTIN): Remove. + + * config/i386/i386.c (TARGET_INIT_BUILTINS): Define. + (TARGET_EXPAND_BUILTIN): Define. + (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins. + (ix86_init_builtins): Call new function only if TARGET_MMX. + * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare. + * config/i386/i386.h (MD_INIT_BUILTINS): Remove. + (MD_EXPAND_BUILTIN): Remove. + + * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define. + (TARGET_EXPAND_BUILTIN): Define. + * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove. + (MD_EXPAND_BUILTIN): Remove. + + * doc/tm.texi: Document these changes. + +2001-07-09 Diego Novillo + + * basic-block.h (tree_node): Forward declare if needed. + (struct basic_block_def): Add fields 'head_tree' and 'end_tree'. + (BLOCK_HEAD_TREE): Define. + (BLOCK_END_TREE): Define. + (struct loops): Rename field 'tree' to 'tree_root'. + * flow.c (entry_exit_blocks): Add initializers for 'head_tree' and + 'end_tree'. + (flow_loops_tree_build): Rename reference to field 'tree' to + 'tree_root'. + (flow_loops_level_compute): Ditto. + * predict.c (estimate_bb_frequencies): Ditto. + * tree.h (struct tree_common): Add field 'aux'. + +2001-07-09 Stan Shebs + + * config/darwin.c (darwin_encode_section_info): Don't mark any + DECL_EXTERNAL node as defined. + +2001-07-09 John David Anglin + + * pa.c (pa_init_machine_status, pa_mark_machine_status, + pa_free_machine_status, hppa_init_pic_save): Delete. + (hppa_pic_save_rtx): New. Use get_hard_reg_initial_val. + (hppa_profile_hook): Use hppa_pic_save_rtx. + * pa.h (struct machine_function, PIC_OFFSET_TABLE_SAVE_RTX, + hppa_init_pic_save): Delete. + (hppa_pic_save_rtx): Declare. + * pa.md (call, call_value, sibcall, sibcall_value, + builtin_setjmp_receiver): Use hppa_pic_save_rtx. + +2001-07-09 Kazu Hirata + + * config/h8300/t-h8300 (LIB1ASMFUNCS): Add _floatdisf and _fixsfdi. + * config/mn10200/t-mn10200 (LIB1ASMFUNCS): Likewise. + +2001-07-09 Andreas Jaeger + + * output.h: Add declaration of final_forward_branch_p. + + * config/i386/i386.c (output_fix_trunc): Remove unused variable. + + * varray.c: Include errors.h for internal_error and trim_filename + declarations. + + * Makefile.in (varray.o): Add errors.h. + +2001-07-09 Toon Moene + + * expr.h: Adjust prototypes for have_add2_insn, have_sub2_insn. + * optabs.c (have_add2_insn): Check whether the add insn chosen + really accepts the operands. (have_sub2_insn): Ditto for sub insn. + * reload1.c (reload_cse_move2add): Adjust calls of have_add2_insn. + +Mon Jul 9 13:26:40 2001 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (OBJS): Add ssa-ccp.o + (ssa-ccp.o): Add dependencies. + * toplev.c (DFI_ssa_ccp): New dump file enum. + (dump_file): Add entry for dumping after SSA CCP. + (flag_ssa_ccp): New flag variable. + (f_options): Add -fssa-ccp. + (rest_of_compilation): Run SSA CCP if requested. + * timevar.def (TV_SSA_CCP): New timevar. + * ssa.c (mark_phi_and_copy_regs): Handle deleted PHI nodes. + * doc/gcc.texi (Passes): Add documentation for SSA CCP pass. + Fix minor typo in SSA DCE documentation. + * doc/invoke.texi: Add documentation for new flag -fssa-ccp. + Add documentation for new dump option. Renumber dump files + appropriately. + +Mon Jul 9 21:36:00 CEST 2001 Jan Hubicka + + * emit-rtl.c (gen_highpart_mode): New. + * rtl.h (gen_highpart_mode): Declare. + * sparc.md (insn splitters): Use gen_highpart_mode, whenever the + operand can be VOIDmode constant. + +Mon Jul 9 17:23:10 CEST 2001 Jan Hubicka + + * flow.c (redirect_edge_and_branch_force): New. + (can_fallthru): Ensure that basic blocks are succeeding. + (try_optimize_cfg): Do not delete basic block if it is the last one. + + * flow.c (try_redirect_by_replacing_jump): Do not remove + jumps with side effects, unlink chain on fallthru edge; + set block for new jump instruction; avoid basic block to + over by line number note. + + * flow.c (try_simplify_condjump): Verify that the condjump + is not always falling through. + + Re-install patch: + * flow.c (try_redirect_by_replacing_jump): Remove cc0 setter. + + * flow.c (forwarder_block_p): Fix for fallthru blocks. + (try_redirect_by_replacing_jump): Update properly the count + and frequency information. + +Mon Jul 9 06:41:07 2001 Richard Kenner + + * emit-rtl.c (adjust_address, adjust_address_nv): Handle an + address that is a LO_SUM specially. + * explow.c (plus_constant_wide, case LO_SUM): Deleted. + + * c-lang.c (start_cdtor): Remove extra parameter from start_function. + + * emit-rtl.c (adjust_address_nv, replace_equiv_address_nv): New fcns. + (operand_subword): Use them. + (change_address_1): Renamed from change_address; new arg VALIDATE. + * expr.h: Reflect above changes; change_address now macro. + * alias.c (canon_rtx): Use replace_equiv_address_nv instead of + making MEM. + * cselib.c (add_mem_for_addr): Likewise. + * expr.c (protect_from_queue, emit_move_insn_1): Likewise. + * regmove.c (try_apply_stack_adjustment): Likewise. + * reload.c (push_reload, make_memloc): Likewise. + * reload1.c (eliminate_regs): Likewise. + * simplify-rtx.c (simplify_replace_rtx): Likewise. + * caller-save.c (setup_save_areas): Use adjust_address_nv instead of + adjust_addess. + * combine.c (make_extraction, simplify_shift_const): Likewise. + (gen_lowpart_for_combine): Likewise. + * cse.c (gen_lowpart_if_possible): Likewise. + * function.c (fixup_var_refs_1, purge_addressof_1): Likewise. + * expr.c (expand_expr, case COMPONENT_REF): Likewise. + * optabs.c (gen_move_insn): Likewise. + * reload1.c (alter_reg): Likewise. + * simplify-rtx.c (simplify_subreg): Likewise. + * stmt.c (expand_anon_union_decl): Likewise. + * recog.c (validate_replace_rtx_1): Likewise. + (expr.h): Include. + * Makefile.in (recog.o): Add $(EXPR_H). + * explow.c (stabilize): Call replace_equiv_address. + * expr.c (move_by_pieces_1, store_by_pieces_2): Likewise. + * final.c (alter_subreg): OFFSET is HOST_WIDE_INT. + +2001-07-03 Andrew Haley + + * expmed.c (store_fixed_bit_field): Don't use a mode bigger than + the mode of the memory location. + +2001-07-09 Bo Thorsen + + * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support. + +2001-07-09 Neil Booth + + * final.c (output_addr_const): Use target opening and + closing parentheses. + * target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN + defaults, add to TARGET_ASM_OUT. + * target.h (struct gcc_target): Add open_paren and close_paren. + * doc/md.texi: Update. + * doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE, + TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and + TARGET_ASM_CLOSE_PAREN. + * config/i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): + Override. + * config/pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): + Override. + * config/1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. + * config/a29k/a29k.h: Similarly. + * config/alpha/alpha.h: Similarly. + * config/arc/arc.h: Similarly. + * config/arm/aof.h: Similarly. + * config/arm/aout.h: Similarly. + * config/avr/avr.h: Similarly. + * config/c4x/c4x.h: Similarly. + * config/clipper/clipper.h: Similarly. + * config/convex/convex.h: Similarly. + * config/d30v/d30v.h: Similarly. + * config/dsp16xx/dsp16xx.h: Similarly. + * config/elxsi/elxsi.h: Similarly. + * config/fr30/fr30.h: Similarly. + * config/h8300/h8300.h: Similarly. + * config/i370/i370.h: Similarly. + * config/i386/i386.h: Similarly. + * config/i860/i860.h: Similarly. + * config/i960/i960.h: Similarly. + * config/ia64/ia64.h: Similarly. + * config/m32r/m32r.h: Similarly. + * config/m68hc11/m68hc11.h: Similarly. + * config/m68k/m68k.h: Similarly. + * config/m88k/m88k.h: Similarly. + * config/mcore/mcore.h: Similarly. + * config/mips/mips.h: Similarly. + * config/mn10200/mn10200.h: Similarly. + * config/mn10300/mn10300.h: Similarly. + * config/ns32k/ns32k.h: Similarly. + * config/pa/pa.h: Similarly. + * config/pdp11/pdp11.h: Similarly. + * config/pj/pj.h: Similarly. + * config/romp/romp.h: Similarly. + * config/rs6000/rs6000.h: Similarly. + * config/sh/sh.h: Similarly. + * config/sparc/sparc.h: Similarly. + * config/v850/v850.h: Similarly. + * config/vax/vax.h: Similarly. + * config/we32k/we32k.h: Similarly. + +2001-07-09 Joseph S. Myers + + * doc/c-tree.texi: Document representation of attributes. + +2001-07-08 Joseph S. Myers + + * doc/tm.texi: Update some places for the rename of target to + targetm. Fix typo. + +2001-07-08 Joseph S. Myers + + * target.h (struct gcc_target): Add insert_attributes. + * target-def.h (TARGET_INSERT_ATTRIBUTES): Define. + (TARGET_INITIALIZER): Update. + * tree.c, tree.h (default_insert_attributes): New function. + Update comments on other default functions to refer to targetm, + not target. + * doc/tm.texi (INSERT_ATTRIBUTES): Update to document + TARGET_INSERT_ATTRIBUTES. + (SET_DEFAULT_DECL_ATTRIBUTES): Remove. + * c-common.c (decl_attributes): Use targetm.insert_attributes. + Don't use PRAGMA_INSERT_ATTRIBUTES. + * Makefile.in (c-common.o): Depend on $(TARGET_H). + * c-decl.c (start_decl, start_function): Don't call + SET_DEFAULT_DECL_ATTRIBUTES. + * config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. + * config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't + declare. + * config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define. + (c4x_check_attribute): Avoid modifying attribute list itself. + (c4x_set_default_attributes): Rename to c4x_insert_attributes. + Make static. + * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define. + * config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't + declare. + * config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define. + (sh_pragma_insert_attributes): Rename to sh_insert_attributes. + Make static. + * config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. + * config/v850/v850-protos.h (v850_set_default_decl_attr): Don't + declare. + * config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define. + (v850_set_default_decl_attr): Rename to v850_insert_attributes. + Adjust parameters. Make static. + +2001-07-08 Joseph S. Myers + + * c-common.c (decl_attributes): Only take a single attributes + parameter. + * c-common.h (decl_attributes): Update prototype. + * c-decl.c (start_decl, start_function): Only take a single + attributes parameter. Update calls to decl_attributes. + (finish_struct, finish_enum): Update calls to decl_attributes. + (push_parm_decl): Expect unified list of attributes. Update call + to decl_attributes. + * c-parse.in (fndef, initdcl, notype_initdcl, nested_function, + notype_nested_function, component_declarator, + component_notype_declarator, label): Update calls to + decl_attributes. + (absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute + lists that are passed to push_parm_decl. + * c-tree.h (start_function, start_decl): Update prototypes. + * config/sh/sh-protos.h, config/sh/sh.c + (sh_pragma_insert_attributes): Only take a single attributes + parameter. + * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise. + * doc/tm.texi (INSERT_ATTRIBUTES): Update. + * objc/objc-act.c (define_decl, generate_objc_symtab_decl, + build_module_descriptor, generate_static_references, + generate_strings, build_selector_translation_table, + generate_descriptor_table, generate_protocols, + generate_ivars_list, generate_dispatch_table, + generate_protocol_list, generate_category, + generate_shared_structures, really_start_method, add_objc_decls, + generate_classref_translation_entry): Update calls to start_decl + and start_function. + (build_tmp_function_decl, start_method_def): Unify attribute lists + that are passed to push_parm_decl. + +2001-07-08 Neil Booth + + * final.c (no_asm_to_stream): New. + (final_scan_insn): Use target structures for prologue ends + and epilogue starts. + * output.h (no_asm_to_stream): New. + * target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE, + TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New. + (TARGET_ASM_OUT): Update. + * target.h (struct gcc_target): New members function_end_prologue + and function_begin_epilogue. + * config/1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused. + * config/alpha/alpha-protos.h (output_end_prologue): Delete. + * config/alpha/alpha.c (output_end_prologue): Rename to + alpha_output_function_end_prologue. Use in target struct + and make static. + * config/alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete. + * config/ia64/ia64-protos.h (ia64_output_end_prologue): Delete. + * config/ia64/ia64.c (ia64_output_end_prologue): Rename to + ia64_output_function_end_prologue. Use in target struct + and make static. + (ia64_function_prologue, ia64_function_epilogue): Rename + mistyped prototypes. + * config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete. + * config/m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue): + Delete. + * config/m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename + an use in target struct, make static. + * config/ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE): + Delete. + +2001-07-08 Richard Henderson + + * stmt.c (emit_case_nodes): Convert modes properly in low+high test. + +2001-07-08 Richard Henderson + + * config/i386/i386.md: Remove constraints strings from define_split + and define_peephole2 patterns. + (eh_return_si, eh_return_di): Split eh_return_1 for modes. + (eh_return): Use them. + +2001-07-08 Richard Henderson + + * doc/tm.texi (Exception Handling): New subnode of Stack and Calling. + Document MD_FALLBACK_FRAME_STATE_FOR. + +2001-07-07 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset): + Take into account m68hc11_sp_correction for FRAME_POINTER_REGNUM + elimination. + * config/m68hc11/m68hc11.h (STARTING_FRAME_OFFSET): Use 0. + +2001-07-07 Nick Clifton + + * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Append # to end + of the label inside NAME as opposed to just the end of NAME. + +2001-07-07 Neil Booth + + * config/alpha/alpha-protos.h (vms_valid_decl_attribute_p): Delete. + * config/alpha/alpha.c (alpha_init_machine_status, + alpha_mark_machine_status, alpha_free_machine_status): Delete. + (TARGET_VALID_DECL_ATTRIBUTE): Define for VMS. + (vms_valid_decl_attribute_p): Make static, conditionally compile. + * config/alpha/alpha.h (VALID_MACHINE_DECL_ATTRIBUTE): Delete. + +2001-07-06 Stan Shebs + + * target.h (targetm): Rename global from "target", so as not to + conflict with local variables. + * c-decl.c: Ditto. + * c-typeck.c: Ditto. + * final.c: Ditto. + * tree.c: Ditto. + * cp/decl.c: Ditto. + * cp/decl2.c: Ditto. + * cp/typeck.c: Ditto. + * 1750a/1750a.c: Ditto. + * a29k/a29k.c: Ditto. + * arc/arc.c: Ditto. + * arm/arm.c: Ditto. + * avr/avr.c: Ditto. + * clipper/clipper.c: Ditto. + * convex/convex.c: Ditto. + * d30v/d30v.c: Ditto. + * dsp16xx/dsp16xx.c: Ditto. + * elxsi/elxsi.c: Ditto. + * fr30/fr30.c: Ditto. + * h8300/h8300.c: Ditto. + * i370/i370.c: Ditto. + * i386/i386.c: Ditto. + * i860/i860.c: Ditto. + * i960/i960.c: Ditto. + * ia64/ia64.c: Ditto. + * m32r/m32r.c: Ditto. + * m68hc11/m68hc11.c: Ditto. + * m68k/m68k.c: Ditto. + * m88k/m88k.c: Ditto. + * mips/mips.c: Ditto. + * ns32k/ns32k.c: Ditto. + * pa/pa.c: Ditto. + * pdp11/pdp11.c: Ditto. + * romp/romp.c: Ditto. + * rs6000/rs6000.c: Ditto. + * sh/sh.c: Ditto. + * sparc/sparc.c: Ditto. + * vax/vax.c: Ditto. + * we32k/we32k.c: Ditto. + * doc/tm.texi: Update the manual to match. + +2001-07-06 Richard Henderson + + * except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of + DWARF2_UNWIND_INFO not just whether it is defined. + +2001-07-06 Diego Novillo + + * combine.c (combine_simplify_rtx): Also recompute 'mode' if the + call to simplify_binary_operation returns a new pattern. + +2001-07-06 Roman Lechtchinsky + + * glimits.h (__SHRT_MAX__): New. + (SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX. + (SHRT_MAX): Define in terms of __SHRT_MAX__. + +2001-07-06 Jan van Male + + * alias.c (base_alias_check): Cast GET_MODE_UNIT_SIZE to int to + avoid warnings. + +2001-07-06 Richard Henderson + + * bitmap.c (bitmap_release_memory): Move adjacent to the + allocation functions. + (bitmap_first_set_bit, bitmap_last_set_bit): Streamline knowing + the implementation. Binary search for the set bit. + (bitmap_union_of_diff): Allocate the temporary on the stack + instead of using xmalloc. + +2001-07-06 Richard Henderson + + * genrecog.c (validate_pattern): Warn for constraints in + define_{expand,split,peephole2}. Remove strict_low_part + before looking up match_dup. + +2001-07-06 DJ Delorie + + * doc/gcc.texi (Makefile): Rename to be a more general purpose + chapter about various build hints and history. Add section + talking about the various types of native and cross builds. + +2001-07-06 Neil Booth + + * Makefile.in (final.o): Depend on target.h. + * final.c: Include target.h. + (default_function_pro_epilogue): New. + (final_start_function): Use target structure for function prologues. + (final_end_function): Use target structure for function epilogues. + * fold-const.c (real_hex_to_f): Constify s and p. + * output.h (default_function_pro_epilogue): New. + * real.h (real_hex_to_f): Update prototype. + * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, + TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. + (TARGET_INITIALIZER): Update. + * target.h (gcc_target): Add struct asm_out. + * doc/tm.texi: Update. + +config: + Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and + TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions + in cpu/cpu.c, or rename old functions consistently. Take + a HOST_WIDE INT not an int as the SIZE parameter. Remove now + redundant macros and prototypes. Make new functions static. + + * 1750a/1750a.c: Similarly. + * 1750a/1750a.h: Similarly. + * a29k/a29k-protos.h: Similarly. + * a29k/a29k.c: Similarly. + * a29k/a29k.h: Similarly. + * arc/arc-protos.h: Similarly. + * arc/arc.c: Similarly. + * arc/arc.h: Similarly. + * arm/arm-protos.h: Similarly. + * arm/arm.c: Similarly. + * arm/arm.h: Similarly. + * avr/avr-protos.h: Similarly. + * avr/avr.c: Similarly. + * avr/avr.h: Similarly. + * clipper/clipper-protos.h: Similarly. + * clipper/clipper.c: Similarly. + * clipper/clipper.h: Similarly. + * convex/convex.c: Similarly. + * convex/convex.h: Similarly. + * d30v/d30v-protos.h: Similarly. + * d30v/d30v.c: Similarly. + * d30v/d30v.h: Similarly. + * d30v/d30v.md: Similarly. + * dsp16xx/dsp16xx-protos.h: Similarly. + * dsp16xx/dsp16xx.c: Similarly. + * dsp16xx/dsp16xx.h: Similarly. + * elxsi/elxsi.c: Similarly. + * elxsi/elxsi.h: Similarly. + * fr30/fr30.c: Similarly. + * fr30/fr30.md: Similarly. + * h8300/h8300-protos.h: Similarly. + * h8300/h8300.c: Similarly. + * h8300/h8300.h: Similarly. + * i370/i370-protos.h: Similarly. + * i370/i370.c: Similarly. + * i370/i370.h: Similarly. + * i386/i386.c: Similarly. + * i386/osf1elf.h: Similarly. + * i386/osfrose.h: Similarly. + * i860/i860-protos.h: Similarly. + * i860/i860.c: Similarly. + * i860/i860.h: Similarly. + * i960/i960-protos.h: Similarly. + * i960/i960.c: Similarly. + * i960/i960.h: Similarly. + * ia64/ia64-protos.h: Similarly. + * ia64/ia64.c: Similarly. + * ia64/ia64.h: Similarly. + * m32r/m32r-protos.h: Similarly. + * m32r/m32r.c: Similarly. + * m32r/m32r.h: Similarly. + * m68hc11/m68hc11-protos.h: Similarly. + * m68hc11/m68hc11.c: Similarly. + * m68hc11/m68hc11.h: Similarly. + * m68k/crds.h: Similarly. + * m68k/dpx2.h: Similarly. + * m68k/m68k-protos.h: Similarly. + * m68k/m68k.c: Similarly. + * m68k/m68k.h: Similarly. + * m68k/news.h: Similarly. + * m88k/m88k-protos.h: Similarly. + * m88k/m88k.c: Similarly. + * m88k/m88k.h: Similarly. + * mips/mips-protos.h: Similarly. + * mips/mips.c: Similarly. + * mips/mips.h: Similarly. + * ns32k/merlin.h: Similarly. + * ns32k/ns32k.c: Similarly. + * ns32k/ns32k.h: Similarly. + * ns32k/tek6000.h: Similarly. + * pa/pa-protos.h: Similarly. + * pa/pa.c: Similarly. + * pa/pa.h: Similarly. + * pdp11/2bsd.h: Similarly. + * pdp11/pdp11-protos.h: Similarly. + * pdp11/pdp11.c: Similarly. + * pdp11/pdp11.h: Similarly. + * romp/romp-protos.h: Similarly. + * romp/romp.c: Similarly. + * romp/romp.h: Similarly. + * rs6000/rs6000-protos.h: Similarly. + * rs6000/rs6000.c: Similarly. + * rs6000/rs6000.h: Similarly. + * rs6000/sysv4.h: Similarly. + * sh/sh-protos.h: Similarly. + * sh/sh.c: Similarly. + * sh/sh.h: Similarly. + * sparc/sparc-protos.h: Similarly. + * sparc/sparc.c: Similarly. + * sparc/sparc.h: Similarly. + * vax/vax.c: Similarly. + * vax/vax.h: Similarly. + * vax/vms.h: Similarly. + * we32k/we32k.c: Similarly. + * we32k/we32k.h: Similarly. + +Fri Jul 6 11:47:59 2001 Jeffrey A Law (law@cygnus.com) + + * basic-block.h (first_insn_after_basic_block_note): Declare. + * flow.c (first_insn_after_basic_block_note): Define. Moved + from... + * ssa.c (first_insn_after_basic_block_note): Remove. + * ssa-dce.c (find_inherently_necessary): Consider BARRIERs + necessary. + (ssa_eliminate_dead_code): Properly update the CFG and PHI + nodes when we find a dead conditional branch. Insert BARRIERs + after any blocks with no successors, but which do not have + any BARRIERs. + +2001-07-06 Zack Weinberg + + * varray.c (varray_check_failed): Use internal_error. + +2001-07-05 Andrew Haley + + * Makefile.in (LIB2_DIVMOD_FUNCS): New. + (LIB2FUNCS): Move divmod functions to LIB2_DIVMOD_FUNCS. + * mklibgcc.in: Compile LIB2_DIVMOD_FUNCS. + +2001-07-02 Jason Merrill + + * dwarf2out.c (mem_loc_descriptor): Only look through a constant pool + reference if the target constant is also a SYMBOL_REF. + +2001-07-05 Eric Christopher + + * config/mips/mips.h (MASK_MIPS3900): Remove. + (MASK_MIPS16,MASK_NO_CHECK_ZERO_DIV,MASK_CHECK_RANGE_DIV, + MASK_UNINIT_CONST_IN_RODATA): Change for 3900 mask removal. + (TARGET_MIPS3900): Change to use mips_arch. + (TARGET_MIPS4000): New. + (TARGET_MIPS4100): New. + (TARGET_MIPS4300): New. + (TARGET_SWITCHES): Change 3900 and 4650 options to NULL. + (SUBTARGET_TARGET_OPTIONS): Add -march. Change help text + for -mipsX. + (GENERATE_BRANCHLIKELY): Move TARGET_MIPS3900. + (ISA_HAS_BRANCHLIKELY): To here. + (CC1_CPU_SPEC): New. + (CC1_SPEC): Use here. Remove 4650 and 3900 options. + (mips_arch_string): Declare. + (mips_arch): Declare. + (TARGET_OPTIONS): Add -march and -mtune. + + * config/mips/mips.c (mips_arch_string): New. + (mips_arch): New. + (override_options): Handle -march for codegen and -mtune + for scheduling. Use mips_arch. Move tx39 target default here. + (mips_parse_cpu): Move error message to override_options. + + * config/mips/r3900.h (TARGET_DEFAULT): Remove. + + * config/mips/mips.md: Use TARGET_MIPS4000 and TARGET_MIPS4300. + + * doc/invoke.texi (Option Summary): Add -march and -mtune entries. + (MIPS Options): Ditto. Change mcpu entry to historical text. + +2001-07-05 H.J. Lu (hjl@gnu.org) + + * config/mips/mips.c (mips_parse_cpu): New function to parse + -march=*/-mcpu=*. + +2001-07-05 Jim Wilson + + * config/ia64/lib1funcs.asm: Revert 2001-07-02 change. + * config/ia64/t-ia64: Likewise. + (LIB1ASMFUNCS): Update comment. + +2001-07-05 David Edelsohn + + * doc/install.texi (Install GCC: Binaries): Fix typo. + +2001-07-04 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory + reference using the stack pointer, adjust it since we push Y + temporarily. + ("*ashrsi3"): Likewise. + ("*lshrsi3"): Likewise. + +2001-07-05 Stephane Carrez + + * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address + when -fomit-frame-pointer is used. + +2001-07-05 Jeffrey Oldham + + * flow.c: Reverse Jan Hubicka's patch of 02July2001. + (try_redirect_by_replacing_jump): Reverse updating properly the + count and frequency information. Reverse removing cc0 setter. + (forwarder_block_p): Reverse fixing for fallthru blocks. + +2001-07-05 DJ Delorie + + * gcc.c (TARGET_OPTION_TRANSLATE_TABLE): New. + (translate_options): If the above is defined, use it to map + given options to new options. + * doc/tm.texi: Document it. + +2001-07-05 Brad Lucier + Gerald Pfeifer + + * doc/invoke.texi (Optimize Options): Document that -fgcse may + cause programs using computed gotos to run more slowly. + +2001-07-05 Rainer Orth + + * doc/install.texi (Specific): Markup, spelling and typo fixes. + Fixed sorting. + Consistently require binutils 2.11.2, not prereleases. + (Specific, decstation-*): Canonicalize as mips-dec-*. + (Specific, i?86-*-sco3.2v5*): Remove make bootstrap requirement, + always necessary. + (Specific, m68k-altos): Removed reference to README.altos, deleted. + (Specific, mips-*): Reword MIPS C compiler requirements. + (Specific, powerpc*-*-*): New, mention --with-cpu once. + (Specific, sunv5): Removed, obsolete. + +2001-07-05 Nathan Sidwell + + * dwarf2out.c (output_loc_list): Use an all ones mask for + .text asm output and don't rely on long long + literals. Reformat some long lines. + +2001-07-05 Andreas Jaeger + + * doc/gcc.texi (GNU/Linux): Remove accidental re-add of GPL + section. + +2001-07-04 Daniel Berlin + + * dwarf2out.c (dwarf2out_define): Update comment. + (dwarf2out_undef): Ditto. + (dwarf2out_start_source_file): Ditto. + (dwarf2out_end_source_file): Ditto. + (dwarf2out_finish): Output DW_MACINFO_end_file for primary file, + since we never call the start/end debug hook for the primary file. + +2001-07-04 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove an extra operand + from shll. + +2001-07-04 Nathan Sidwell + + * cppinit.c (remove_dup_dirs): Inform if a system include + directory is being reordered. + * doc/invoke.texi (Directory Options): GCC warns if you hide a + system include. + * doc/cpp.texi (Search Paths): Likewise. + * doc/gcc.texi (Interoperation): Remove information about + -I/usr/include. + +2001-07-04 Nathan Sidwell + + * varray.h (VARRAY_TOP_GENERIC_PTR): Remove spurious parameter. + (VARRAY_TOP_CHAR_PTR): Likewise. + +2001-07-04 Kaveh R. Ghazi + + * gcc.c (process_command): Don't assign elements of a const char*. + +Wed Jul 4 13:40:02 2001 Richard Kenner + + * emit-rtl.c (change_address): Don't abort if invalid address while + reload is in progress. + +2001-07-04 Daniel Berlin + + * c-lex.c (cb_file_change): Pass line number to + debug_start_source_file. + (cb_undefine): Pass correct line number to debug_undef. + + * toplev.c (debug_start_source_file): Add line number to + parameters. Pass it along to dwarf2out_start_source_file. + (decode_g_option): Stop resetting debug level back to normal when + we change debug formats, unless the current level is + none. (Before, -g3 -gdwarf-2 would use debug level 2, rather than + 3). + + * toplev.h (debug_start_source_file): Add line number to + parameters. + + * dwarf2out.h (dwarf2out_start_source_file): Add line number to + parameters. + + * dwarf2out.c (dwarf2out_start_source_file): Add line number to + parameters. + Output debug_macinfo data for starting file if requested. + (dwarf2out_end_source_file): Output debug_macinfo data for ending + file if requested. + (dwarf2out_define): Output debug_macinfo data for defining a macro + if requested. + (dwarf2out_undef): Output debug_macinfo data for undefining a + macro if requested. + (DEBUG_MACINFO_SECTION): New. DWARF2 macro info section name. + (DEBUG_MACINFO_SECTION_LABEL): New. DWARF2 macro info section label. + (macinfo_section_label): New. DWARF2 macro info section label. + (dwarf2out_init): If we want macro info, output the start label + for the section. + (dwarf2out_finish): If we want macro info, add a DW_AT_macro_info + attribute to the compilation unit die pointing to the macro info. + +2001-07-04 Daniel Berlin + + * dwarf2out.c (new_loc_list): Move to inside #ifdef + DWARF2_DEBUGGING_INFO. + (add_loc_descr_to_loc_list): Ditto. + (output_loc_list): Ditto. + Also, fix thinko in curr not being initialized. + (gen_internal_sym): Ditto. + +Wed Jul 4 13:40:02 2001 Richard Kenner + + * emit-rtl.c (replace_equiv_address): New function. + * expr.h (replace_equiv_address): New declaration. + * explow.c (validize_mem): Call it instead of change_address and + also call if -fforce-addr and address is constant. + * expr.c: Replace more calls to change_address with adjust_address + and/or replace_equiv_address or to validize_mem. + * function.c, regmove.c, config/alpha/alpha.c: Likewise. + * config/arm/arm.md, config/clipper/clipper.md: Likewise. + * config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise. + * config/i370/i370.md, config/i860/i860.md: Likewise. + * config/i960/i960.md, config/mips/mips.c: Likewise. + * config/mips/mips.md, config/pa/pa.md: Likewise. + * config/pdp11/pdp11.md, config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.md, config/sh/sh.md: Likewise. + +2001-07-04 Kaveh R. Ghazi + + * bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA. + + * bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a + function. + +2001-07-04 Joseph S. Myers + + * doc/include: New directory. + * doc/fdl.texi: Move to doc/include/fdl.texi. + * doc/texinfo.tex: Move to doc/include/texinfo.tex. + * doc/include/funding.texi, doc/include/gpl.texi: New files. + * doc/gcc.texi: Use funding.texi and gpl.texi. + * Makefile.in ($(docdir)/cpp.info, $(docdir)/gcc.info, + $(docdir)/cppinternals.info, cpp.dvi. gcc.dvi. cppinternals.dvi): + Update dependencies and use -I $(docdir)/include. + +2001-07-04 Anthony Green + + * config/v850/t-v850 (v850-c.o): Add missing dependencies. + +2001-07-04 Gerald Pfeifer + + * doc/install.texi (sparc64-*-*): Remove garbage. + +Wed Jul 4 09:07:44 2001 Jan van Male + + * i386.c (ix86_expand_builtin, case IX86_BUILTIN_SETPS): + Fix typo in last change to use adjust_address. + +2001-07-04 Gerald Pfeifer + + * doc/install.texi (Specific): Update information for *-*-solaris*. + +Tue Jul 3 22:33:15 2001 Richard Kenner + + * explow.c (plus_constant_wide): Reinitialize Y for restart. + +2001-07-03 Stan Shebs + + * config/darwin.h (SECTION_FUNCTION): Remove WAS_TEXT argument, remove + case for flag_no_mach_text_sections. + (EXTRA_SECTION_FUNCTIONS): Remove arg from uses of SECTION_FUNCTION. + * config/darwin.c (flag_no_mach_text_sections): Remove. + * config/darwin-protos.h (darwin_init_pragma): Remove decl. + +Tue Jul 3 15:35:52 2001 Richard Kenner + + * explow.c (plus_constant_wide, case PLUS): Call find_constant_term + and avoid checking for constant as first operand. + * recog.c (find_constant_term_loc): No longer static. + (adj_offettable_operand): Delete. + * rtl.h (adj_offsettable_operand): Delete declaration. + (find_constant_term): Add declaration. + * caller-save.c: Replace calls to adj_offsettable_operand with calls + to adjust_address. + * config/arm/arm.c, config/c4x/c4x.c: Likewise. + * config/clipper/clipper.md, config/h8300/h8300.c: Likewise. + * config/i386/i386.c, config/i386/i386.md: Likewise. + * config/i860/i860.c, config/i960/i960.c: Likewise. + * config/i960/i960.md, config/m68hc11/m68hc11.c: Likewise. + * config/m68k/m68k.c, config/m68k/m68k.md: Likewise. + * config/m88k/m88k.md, config/mcore/mcore.c: Likewise. + * config/mips/mips.c, config/mips/mips.md: Likewise. + * config/mn10200/mn10200.c, config/mn10300/mn10300.c: Likewise. + * config/ns32k/ns32k.c, config/ns32k/ns32k.md: Likewise. + * config/pa/pa.c, config/pdp11/pdp11.c: Likewise. + * config/pdp11/pdp11.md, config/sh/sh.c, config/v850/v850.c: Likewise. + * config/vax/vax.md, config/ns32k/ns32k.c: Likewise. + * config/ns32k/ns32k.md: Likewise. + +2001-07-03 Zack Weinberg + + * rtl.c (copy_rtx): Handle 'T' format letter. + * gensupport.c (collect_insn_data): Likewise. + * print-rtl.c (print_rtx): Print 'T' slots like 's'. + +2001-07-03 Nick Clifton + + * doc/invoke.texi (Directory Options): Specifiy range for in + -B option. Use 'dir' not 'foo' as example directory name. + +2001-07-03 Rainer Orth + + * config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. + Fixes PRs bootstrap/3067, bootstrap/3249, bootstrap/3275. + +2001-07-03 Joseph S. Myers + + * doc/cppinternals.texi: Improve formatting and logical markup. + +2001-07-03 Andreas Jaeger + + * Makefile.in (insn-recog.o): Add dependency on reload.h. + + * genrecog.c (write_header): Include reload.h for prototypes in + insn-recog.c. + +2001-07-03 Neil Booth + +config: + * i386/cygwin.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * i386/i386-protos.h (i386_pe_valid_decl_attribute_p, + i386_pe_valid_type_attribute_p): Add. + * i386/i386.c (TARGET_INITIALIZER): Override for cygwin targets. + * i386/winnt.c (i386_valid_decl_attribute_p): Return directly. + +Mon Jul 2 21:52:19 2001 Richard Kenner + + * explow.c (plus_constant_wide, case LO_SUM): New case. + (plus_constant_for_output_wide): Delete. + * rtl.h (plus_constant_for_output): Delete. + * alias.c (canon_rtx, init_alias_analysis): Call plus_constant + instead of plus_constant_for_output. + * recog.c (offsettable_address_p, adj_offsettable_operand): Likewise. + * config/darwin.c, config/arm/arm.c, config/m68k/m68k.c: Likewise. + * config/m88k/m88k.c, config/mips/mips.c, config/pa/pa.c: Likewise. + * config/rs6000/rs6000.c, config/sparc/sparc.c: Likewise. + * config/sparc/sparc.md: Likewise. + Convert some change_address calls to adjust_address. + +2001-07-03 Joseph S. Myers + + * doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi, + doc/rtl.texi, doc/tm.texi: Improve formatting. Improve + documentation of -std and -Wwrite-strings. + +2001-07-02 Geoffrey Keating + + * cse.c (canon_hash): Don't register registers in very small + register classes, as extending their lifetime might cause + reload to fail. + +Mon Jul 2 23:14:00 CEST 2001 Jan Hubicka + + * flow.c (try_redirect_by_replacing_jump): Remove cc0 setter. + + * flow.c (forwarder_block_p): Fix for fallthru blocks. + (try_redirect_by_replacing_jump): Update properly the count + and frequency information. + +Mon Jul 2 14:20:13 2001 Jeffrey A Law (law@cygnus.com) + + * toplev.c (dump_file_index): Move SSA dumps just after first + jump dump. + (dump_file): Corresponding changes. + (rest_of_compilation): Move SSA path to just after the first + jump pass. + * doc/gcc.texi (Passes): Update due to movement of SSA path. + * doc/invoke.texi: Update dump file #s as they were completely + out of date with reality. + +2001-07-02 Geoffrey Keating + + * doc/tm.texi (Frame Layout): Document STACK_PUSH_CODE. + + * expr.c (emit_move_insn_1): Deal with non-default + STACK_PUSH_CODE. + + * expr.c (emit_single_push_insn): Fix warning. + +2001-07-02 Toshiyasu Morita + + * expr.c (emit_move_insn_1): Avoid modifying + cfun->expr->x_stack_pointer when PUSH_ROUNDING is defined. + +Mon Jul 2 15:33:31 2001 Richard Kenner + + * emit-rtl.c (adjust_address): New function. + * expr.h (adjust_address): Add declaration. + * builtins.c: Replace some calls to change_address with calls to it + or to validize_mem. + * caller-save.c, dwarf2out.c, except.c, expmed.c, expr.c: Likewise. + * function.c, config/a29k/a29k.md, config/alpha/alpha.c: Likewise. + * config/arm/arm.c, config/convex/convex.c: Likewise. + * config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise. + * config/i386/i386.c, config/i386/i386.md: Likewise. + * config/ia64/ia64.c, config/ia64/ia64.md: Likewise. + * config/m32r/m32r.c, config/m68k/m68k.md: Likewise. + * config/m88k/m88k.c, config/mips/mips.md: Likewise. + * config/ns32k/ns32k.c, config/rs6000/rs6000.c: Likewise. + * config/sh/sh.c, config/sparc/sparc.md: Likewise. + +2001-07-02 Jim Wilson + + * config/ia64/ia64.h: Delete obsolete lib1funcs.asm comment. + +2001-07-02 Steve Ellcey + + * config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore. + * config/ia64/lib1funcs.asm: Change macro names to match t-ia64. + +2001-07-02 Zack Weinberg + + * cppinit.c (lang_defaults): New table. + (set_lang): Just read from lang_defaults into the live options + structure. + +2001-07-02 Zack Weinberg + + * Makefile.in (doc): Depend on $(GENERATED_MANPAGES). + * doc/.cvsignore: Add gcc.1, cpp.1, gcov.1. + * doc/gcc.1, doc/cpp.1, doc/gcov.1: Removed. + +2001-07-02 Rainer Orth + + * doc/install.texi: Various spelling and markup fixes. + (Installing GCC): Component specific installation instructions are + gone. + Fix reference. + Warn about removing old install dir in the presence of shared libs. + (Configuration): Invoke with options target to match configure + --help. + Consistently refer to gas, gld pathnames. + Invert --enable-multilib documentation. + Remove references to old compiler versions. + +Mon Jul 2 12:50:51 2001 Richard Kenner + + * flow.c (try_simplify_condjump): Fix typo in updating fallthru flags. + +2001-07-02 Rainer Orth + + * doc/install.texi (Specific, mips*-sgi-irix4): Split from IRIX 5 + section. + (Specific, mips*-sgi-irix5): Note IDO download. + Reworded MIPS C hints. + Use GNU as instead of GAS. + Markup fixes. + Removed SGI Freeware reference, IRIX 6 only. + (Specific, mips*-sgi-irix6): Removed ranlib caveats, obsolete. + Note N64 library requirement/workaround. + Update O32 hints. + Complete list of structure passing bug victims. + +2001-07-02 Gerald Pfeifer + + * doc/install.texi: Remove CVS Id. + +2001-07-02 Andreas Jaeger + + * ssa-dce.c (note_inherently_necessary_set): Add unused attribute. + (find_inherently_necessary): Remove unused variable. + +2001-07-02 Nathan Sidwell + + * c-common.h (TDI_inlined): New ast dump phase. + (dump_flag_name): New function. + * c-dump.c (dump_files): Add inlined phase. + (dump_flag_name): Define. + * doc/invoke.texi (-fdump-ast-inlined): Document. + +Mon Jul 2 06:29:36 2001 Richard Kenner + + * stor-layout.c (layout_decl): Revert change to handling of alignment + in packed types. + +Sun Jul 1 11:53:52 2001 Richard Kenner + + * c-common.c (decl_attributes, case A_MODE): Don't call layout_decl + for FIELD_DECL. + +2001-07-01 Geoffrey Keating + + * doc/tm.texi (FUNCTION_ARG): Document that the last call + is special. + +2001-07-01 Nathan Sidwell + + * tlink.c (recompile_files): Remove COMPILER_PATH and + LIBRARY_PATH from the environment. + +2001-07-01 Zack Weinberg + + * c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT, + RID_LAST_PQ. Move RID_FIRST_PQ down with the other FIRST/LAST + enumerators. + (OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros. + + * c-parse.in (OBJC_STRING): Kill. + (objc_string): Decompose to [objc_string] '@' STRING. + (reswords): Take the leading '@' off all the Objective-C keywords. + (objc_rid_sans_at): Kill. + (init_reswords): Don't initialize it. + (yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD. + (_yylex): Kill reconsider label. Look ahead one token after + an '@'; if we get an identifier, check whether it's an + Objective-C @-keyword. If so, return the keyword. Otherwise, + put back the token and return the '@' as a terminal. + + * cpplib.c (lex_macro_node): Remove unnecessary check for + leading '@' on identifier. Clarify control flow and commentary. + +Sun Jul 1 11:53:52 2001 Richard Kenner + + * cse.c (new_label_ref): Variable deleted. + (insert): Remove set of new_label_ref. + (check_for_label_ref): New function. + (cse_basic_block): Don't check new_label_ref; call check_for_label_ref. + +2001-06-30 Zack Weinberg + + * rtl.def (DEFINE_INSN, DEFINE_INSN_AND_SPLIT, DEFINE_PEEPHOLE): + Change output-template slot to format 'T'. + * rtl.h (XTMPL): New. + * read-rtl.c (read_escape): New function. + (read_quoted_string, read_braced_string): Use it. + (read_rtx): Set star_if_braced from the format string. + Use XTMPL where appropriate. + * genoutput.c (gen_insn, gen_peephole): Use XTMPL to get the + template string. + + * rtl.c: Include errors.h for sake of rtl_check_failed* routines. + Document 'T' in rtx format strings. + * Makefile.in (rtl.o, $(HOST_PREFIX_1)rtl.o): Depend on errors.h. + * errors.c (internal_error): Add missing ": " at end of string. + + * i860.md: Change triple backslashes to double backslashes at + ends of lines in output templates. + * ns32k.md: Remove stray backslash-newline in output template. + +2001-06-29 Nick Clifton + + * gcc.c (process_command): Append a DIR_SEPARATOR to a path + specified by the -B switch, if doing so would create a valid + directory name. + * doc/invoke.texi: Document changed behavior of -B. + +2001-06-29 DJ Delorie + + * simplify-rtx.c (simplify_subreg): When simplifying a CONCAT, at + least get rid of the CONCAT if we can't simplify further. + +Fri Jun 29 12:27:24 2001 Jeffrey A Law (law@cygnus.com) + + * simplify-rtx.c (simplify_rtx): Use swap_commutative_operands_p. + + * doc/gcc.texi (Passes): Update due to recent -fdce -> -fssa-dce + changes. Fix documentation for SSA DCE pass. + + * ssa-dce.c (ssa_eliminate_dead_code): Renamed from + eliminate_date_code. + * ssa.h (ssa_eliminate_dead_code): Corresponding changes. + * timevar.def (TV_SSA_DCE): Renamed from TV_DEAD_CODE_ELIM. + * toplev.c (DFI_ssa_dce): Renamed from DFI_dce. + (dump_file_info): Similar changes. + (flag_ssa_dce): Similarly + (f_options): Similar changes. + (rest_of_compilation): Corresponding changes. + * doc/invoke.texi: Update as option is now -fssa-dce instead + of -fdce. Update dump file name. + + * ssa-dce.c (note_inherently_necessary_set): New function. + (find_inherently_necessary): Use it. Do not consider + NOTEs, CODE_LABELs or BARRIERS are necessary. Improve + handling of asms and unspecs. + (delete_insn_bb): Only delete INSNs, CALL_INSNs or JUMP_INSNs. + +2001-06-29 Joseph S. Myers + + * target.h (struct gcc_target): Add comp_type_attributes and + set_default_type_attributes. + * target-def.h (TARGET_COMP_TYPE_ATTRIBUTES, + TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Define. + (TARGET_INITIALIZER): Update. + * doc/tm.texi (COMP_TYPE_ATTRIBUTES, TARGET_COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): + Update documentation of old target macros to describe new target + hooks. + * tree.c (make_node): Use target.set_default_type_attributes. + (default_comp_type_attributes, + default_set_default_type_attributes): New functions. + * tree.h (default_comp_type_attributes, + default_set_default_type_attributes): Declare. + * c-typeck.c (COMP_TYPE_ATTRIBUTES): Don't define. + (comptypes): Use target.comp_type_attributes. + * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h + (arc_comp_type_attributes, arc_set_default_type_attributes, + COMP_TYPE_ATTRIBUTES, SET_DEFAULT_TYPE_ATTRIBUTES): Remove + functions and macros with default behavior. + * config/m32r/m32r-protos.h, config/m32r/m32r.c, + config/m32r/m32r.h (m32r_comp_type_attributes, + m32r_set_default_type_attributes, COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Likewise. + * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, + config/m68hc11/m68hc11.h (m68hc11_comp_type_attributes, + m68hc11_set_default_type_attributes, COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Likewise. + * config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c, + config/ns32k/ns32k.h (ns32k_comp_type_attributes, + COMP_TYPE_ATTRIBUTES): Likewise. + * config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, + config/rs6000/rs6000.h (rs6000_comp_type_attributes, + rs6000_set_default_type_attributes, COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Likewise. + * config/d30v/d30v.h (COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Remove commented out macro + definitions. + * config/i386/i386.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise. + * config/ns32k/ns32k.h (SET_DEFAULT_TYPE_ATTRIBUTES): Likewise. + * config/arm/arm.c (arm_comp_type_attributes, + arm_set_default_type_attributes): Make static. + (TARGET_COMP_TYPE_ATTRIBUTES, TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): + Define. + * config/arm/arm.h (COMP_TYPE_ATTRIBUTES, + SET_DEFAULT_TYPE_ATTRIBUTES): Don't define. + * config/arm/arm-protos.h (arm_comp_type_attributes, + arm_set_default_type_attributes): Don't declare. + * config/i386/i386.c (ix86_comp_type_attributes): Make static. + (TARGET_COMP_TYPE_ATTRIBUTES): Define. + * config/i386/i386.h (COMP_TYPE_ATTRIBUTES): Don't define. + * config/i386/i386-protos.h (ix86_comp_type_attributes): Don't + declare. + +2001-06-28 Jan van Male + + * predict.c (dump_prediction): Eliminate fprintf warning. + +2001-06-28 Diego Novillo + + * flow.c (dump_bb): Remove unused third argument to call + to fprintf when displaying the basic block header. + +2001-06-28 Michael Hayes + Jeff Law + + * Makefile.in (OBJS): Add df.o + (df.o): Add dependencies. + * basic-block.h (flow_depth_first_order_compute): Declare. + * flow.c (flow_depth_first_order_compute): No longer declare. + Make external. + * df.c, df.h: New files. + +2001-06-28 Zack Weinberg + + * config/i386/i386.md: Global update to use new string syntax + where it will improve readability. Warning fixes: + (*truncdfsf2_2): Abort if which_alternative is not 0 or 1. + (*adddi_1_rex64, *adddi_2_rex64, *adddi_3_rex64, + *adddi_4_rex64, *adddi_5_rex64): Cast 1 to unsigned int. + + * read-rtl.c: Syntactic sugar for C embedded in strings in + machine descriptions. + (read_string): Break inner loop into separate function. Takes + an int. Dispatch to read_quoted_string or read_braced_string + as appropriate. Automatically insert a leading star on braced + strings if STAR_IF_BRACED is true. + (read_quoted_string, read_braced_string): New functions. + * doc/rtl.texi, doc/md.texi: Document new syntax. Update + examples to match. + + * rtl.c: Split RTL reader (read_rtx, read_skip_spaces, + traverse_md_constants, fatal_with_file_and_line, + fatal_expected_char, read_name, read_string, def_hash, + def_name_eq_p, read_constants, and related data) to its own + file. Weed out now-unnecessary #includes. + * read-rtl.c: New file. + * Makefile.in (HOST_RTL): Add read-rtl.o. + (read-rtl.o): New rule. + (rtl.o, $(HOST_PREFIX_1)rtl.o): Update dependencies. + * doc/gcc.texi (Passes): Talk briefly about the support + library used by genfoo. + * doc/rtl.texi (Reading RTL): read_rtx is not available in the + compiler itself. + +2001-06-28 Stan Shebs + + * config/darwin.h (REGISTER_TARGET_PRAGMAS): Define. + * config/darwin-c.c: New file. + * config/darwin-protos.h: Declare new functions. + * config/rs6000/t-darwin (darwin-c.o): New rule. + * config.gcc (powerpc-*-darwin*): Define c_target_objs and + cxx_target_objs. + * doc/extend.texi (Pragmas): New section. + +Thu Jun 28 20:13:11 CEST 2001 Jan Hubicka + + * flow.c (try_merge_block): Rename to try_optimize_cfg; + do basic simplifications on the CFG. + (is_forwarder_block_p, can_fallthru, try_redirect_by_replacing_jump, + try_simplify_condjump): New. + (redirect_edge_and_branch): Try replace jump insn. + (flow_delete_insn): Handle deleting of ADDR_VEC insns. + + * basic-block.h (FALLTHRU_EDGE, BRANCH_EDGE): New macros. + +Thu Jun 28 11:19:42 2001 Jeffrey A Law (law@cygnus.com) + + * ssa-dce.c (eliminate_dead_code): Properly handle control + dependencies implied by PHI nodes. + + * ssa-dce.c (eliminate_dead_code): Remove fake edges from the + CFG after dead code elimination is complete. + +2001-06-28 Rainer Orth + + * gthr-posix.h [LIBOBJC]: Add weak definitions of + sched_get_priority_max, sched_get_priority_min. + +2001-06-28 Gabriel Dos Reis + + * diagnostic.c (default_print_error_function): Tweak. + (report_error_function): Likewise. + * toplev.h (default_print_error_function): Move to... + * diagnostic.h: ...here. Add a `diagnostic_context *' parameter. + * tree.h (print_error_function): Move to... + * diagnostic.h: ...here. Add a `diagnostic_context *' parameter. + +Thu Jun 28 06:16:45 2001 Richard Kenner + + * expr.c (expand_assignment): When have varying-length object, + make MEM a BLKmode. + (expand_expr, case ADDR_EXPR): Use SAVE_EXPR_RTL after putting + SAVE_EXPR stack in case we had a SUBREG. + +Thu Jun 28 10:31:06 CEST 2001 Jan Hubicka + + * i386.md (cmp?i): Simplify; refuse immediate operand + in alternative 0 + * i386.c (cmpsi_operand): Refuse constants. + + * i386.md (movsi_insv_1, movsi_insv_1_rex64): Allow immediate operand. + + * flow.c (block_label, redirect_edge_and_branch): Split out from .... + (split_edge) .... here; + +2001-06-28 Neil Booth + + * i386/i386.c (ix86_valid_type_attribute_p): Give external + linkage, move declaration to... + * i386/i386-protos.h: ...here. + +2001-06-27 H.J. Lu (hjl@gnu.org) + + * build-make (CC): Removed. + (HOST_CC): Set to $(CC_FOR_BUILD). + (HOST_CFLAGS): Replace $(CFLAGS) with $(CFLAGS_FOR_BUILD). + Fix a typo in comments. + + * configure.in: Set CFLAGS to $(CFLAGS_FOR_BUILD) when + generating auto-build.h for canadian cross compile. Set CC + to `"${CC_FOR_BUILD}"' instead of just `${CC_FOR_BUILD}'. + Save/restore CFLAGS. + * configure: Regenerated. + +2001-06-27 Jim Wilson + + * emit-rtl.c (gen_highpart): Call validize_mem. + +2001-06-27 Bruce Korb + + * fixinc/inclhack.def(hpux11_cpp_pow_inline): new, but real similar to + hpux10_cpp_pow_inline. Not similar enough. + (solaris_mutex_init): renamed. PTHREAD_*_INITIALIZER is a problem for + all Solaris versions. This fix patches MUTEX and COND initializers, + the RWLOCK one will wait for someone to complain. For now, anyway. + (uw7_byteorder_fix): It was looking for the byteorder.h file in the + wrong directory. + +2001-06-27 Stan Shebs + + * objc/objc-act.c (handle_impent): Rewrite to be more portable + and to use ASM_DECLARE_CLASS_REFERENCE. + * config/darwin.h (ASM_DECLARE_CLASS_REFERENCE): Rename from + undocumented DECLARE_CLASS_REFERENCE, add file argument. + * doc/tm.texi (ASM_DECLARE_CLASS_REFERENCE): Document. + +Wed Jun 27 18:01:09 2001 Jeffrey A Law (law@cygnus.com) + + * simplify-rtx.c (simplify_rtx): Canonicalize commutative expressions + by putting complex operands first and constants second. + +2001-06-27 Gabriel Dos Reis + + * diagnostic.h: Add documentation. Make macros polymorphic. + * diagnostic.c (ideal_line_wrap_cutoff): Remove + definition. Replace with diagnostic_line_cutoff. + (prefixing_policy): Remove. Replace with diagnostic_prefixing_rule. + +2001-06-27 Joseph S. Myers + + * doc/c-tree.texi, doc/contrib.texi, doc/cpp.texi, + doc/cppinternals.texi, doc/extend.texi, doc/gcc.texi, + doc/gcov.texi, doc/install-old.texi, doc/install.texi, + doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Replace + . at end of sentences preceded by a capital letter with @.. + +2001-06-26 Daniel Berlin + + * doc/invoke.texi: Add description of max-gcse-passes param. + + * gcse.c (gcse_main): Use MAX_GCSE_PASSES instead of MAX_PASSES. + (MAX_PASSES): Remove now unneeded macro. + + * params.h (MAX_GCSE_PASSES): New macro, to get parameter value of + max-gcse-passes param. + + * params.def (PARAM_MAX_GCSE_PASSES): New parameter, controlling + maximum number of GCSE passes to run. Defaults to 1 (which is what + MAX_PASSES in gcse.c used to be). + +2001-06-27 Neil Booth + + * system.h (TARGET_ESC): Move to ... + * defaults.h (TARGET_ESC): ... here. + * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, + TARGET_VALID_TYPE_ATTRIBUTE): Default to a no-op handler. + * tree.c (default_valid_attribute_p): New. + (valid_machine_attribute): Handlers can not be NULL. + * tree.h (default_valid_attribute_p): New. + * doc/tm.texi: Document TARGET_ESC. + * cp/decl2.c (import_export_class): Update. + +2001-06-26 Bruce Korb + + * gcc/fixinc/fixincl.c(initialize): In very strict ANSI, you cannot + use preprocessing directives inside a string literal. Fixed. + +2001-06-26 Jim Wilson + + * doc/tm.texi (MAX_LONG_DOUBLE_TYPE_SIZE, INTEL_EXTENDED_IEEE_FORMAT): + Document. + +2001-06-27 Joseph S. Myers + + * doc/cpp.texi, doc/cppinternals.texi, doc/extend.texi, + doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi, + doc/tm.texi: Use @: where necessary when a full stop does not end + a sentence. + +2001-06-27 Joseph S. Myers + + * doc/gcc.texi, doc/install.texi, doc/invoke.texi: Remove trailing + whitespace. + +2001-06-26 Joseph S. Myers + + * doc/c-tree.texi, doc/cpp.texi, doc/extend.texi, doc/gcc.texi, + doc/install.texi, doc/invoke.texi, doc/objc.texi, doc/rtl.texi, + doc/tm.texi: Use two spaces after ends of sentences. + +2001-06-26 Daniel Berlin + + * toplev.c (display_help): Fix param thinko. + * Makefile.in: Fix params.h dependencies. + +2001-06-26 Gabriel Dos Reis + + * toplev.c (decode_f_option): Adjust setting. + (toplev_main): Call diagnostic_initialize. Remove call to + reshape_diagnostic_buffer._ + + * diagnostic.h (struct output_buffer): Add new field format_decoder. + (diagnostic_format_decoder): New macro. + (diagnostic_prefixing_rule): Likewise. + (diagnostic_line_cutoff): Likewise. + (set_message_prefixing_rule): Remove. + + * diagnostic.c (lang_printer): Remove. + (diagnostic_message_length_per_line): Likewise. + (current_prefixing_rule): Likewise. + (initialize_diagnostics): Rename to... + (diagnostic_initialize): ...this. Tweak. + (default_initialize_buffer): Remove. + (reshape_diagnostic_buffer): Likewise. + (init_output_buffer): Adjust prefixing rule setting. + (output_format): Use format_decoder from the output_buffer. + + * c-lang.c (c_init): Adjust tree formatter setting. + +2001-06-26 Rainer Orth + + * config/i386/sol2.h (CPP_SPEC): Pass -P for .S files. + +2001-06-26 Neil Booth + + * Makefile.in (TARGET_H, TARGET_DEF_H): New. + (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. + * c-decl.c (duplicate_decls): Use function pointer. + * c-typeck.c (common_type): Similarly. + * tree.c (valid_machine_attribute): Similarly. + (merge_machine_type_attributes): Rename merge_type_attributes. + (merge_machine_decl_attributes): Rename merge_decl_attributes. + (merge_dllimport_decl_attributes): New function. + * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. + (merge_machine_decl_attributes): Rename merge_decl_attributes. + (merge_dllimport_decl_attributes): New prototype. + * target.h: New. + * target-def.h: New. + +doc: (Joseph Myers) + * doc/gcc.texi, doc/tm.texi: Update documentation. + +cp: Make-lang.in: Update dependencies. + * spew.c: Include target.h. + (duplicate_decls): Call target function. + * decl2.c: include target.h + (import_export_class): Use existence of target function pointer. + * typeck.c: Include target.h. + (qualify_type_recursive): Rename variable. Call target function. + (type_after_usual_arithmetic_conversions): Similarly. + (common_type): Similarly. + +config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, + avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, + d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, + i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, + m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, + mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, + pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, + sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) + : Include target.h and target-def.h. Define target. + + * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. + * arc/arc.c (arc_valid_machine_decl_attribute): Rename + arc_valid_decl_attribute, make static. + * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * arm/arm-protos.h (arm_valid_machine_decl_attribute, + arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, + arm_pe_merge_machine_decl_attributes): Remove. + * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename + arm_valid_decl_attribute_p, make static. + (arm_pe_valid_decl_attribute_p): Move from pe.c. + * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. + (arm_pe_merge_machine_decl_attributes): Move to tree.c. + * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. + (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * avr/avr-protos.h (valid_machine_type_attribute, + valid_machine_decl_attribute): Remove. + * avr/avr.c (valid_machine_type_attribute, + valid_machine_decl_attribute): Rename and make static. + * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, + VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. + * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. + * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * d30v/d30v.h: Remove obsolete comments. + * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. + * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make + static. + * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. + (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, + i386_pe_valid_type_attributes_p): Remove. + * i386/i386-protos.h (ix86_valid_decl_attribute_p, + ix86_valid_type_attribute_p): Remove. + * i386/i386.c (ix86_valid_decl_attribute_p): Remove. + (ix86_valid_type_attribute_p): Make static. + * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. + * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. + * ia64/ia64.c (ia64_valid_type_attribute): Make static. + * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. + * m32r/m32r.c (m32r_valid_decl_attribute): Make static. + * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, + m68hc11_valid_type_attribute_p): Remove. + * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. + (m68hc11_valid_type_attribute_p): Make static. + * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, + mcore_merge_machine_decl_attribute): Remove. + * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, + make static. + (mcore_merge_machine_decl_attributes): Move to tree.c. + * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. + * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, + ns32k_valid_type_attribute_p): Remove. + * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. + (ns32k_valid_type_attribute_p): Make static. + * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, + rs6000_valid_type_attribute_p): Remove. + * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. + (rs6000_valid_type_attribute_p): Make static. + * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, + VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. + * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. + * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. + * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. + * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + +2001-06-26 Vladimir Makarov + + * glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold + it. + +2001-06-26 Gabriel Dos Reis + + * diagnostic.h (struct diagnostic_context): Add new field. + (lang_diagnostic_starter, lang_diagnostic_finalizer): Remove + declaratons. + (global_dc): Declare. + * diagnostic.c (global_diagnostic_context): New variable. + (global_output_buffer): Remove. + (global_dc): Define. + (lang_diagnostic_starter, lang_diagnostic_finalizer): Remove + definitions. + (initialize_diagnostics): Adjust initialization. + (set_diagnostic_context): Adjust setting. + +2001-06-26 Rainer Orth + + * config/mips/iris5.h (UNALIGNED_INT_ASM_OP, + UNALIGNED_SHORT_ASM_OP): Define. + * config/mips/iris6.h (UNALIGNED_INT_ASM_OP, + UNALIGNED_SHORT_ASM_OP): Undef. + +Tue Jun 26 12:40:12 CEST 2001 Jan Hubicka + + * i386.md (float_truncate splitter, and to mov splitters): Add + reload_completed; fix operand predicate. + + * haifa-sched.c (sched_init): Do not split insns. + * toplev.c (rest_of_compilation): Call split_all_insns before + sched1 pass; simplify condition of post-reload splitter; + call split_all_insn before sched2 pass. + +2001-06-26 Gabriel Dos Reis + + * diagnostic.h (diagnostic_prefixing_rule_t): New enum type. + (set_message_prefixing_rule): Adjust prototype. + * diagnostic.c (current_prefixing_rule): Adjust type. + +2001-06-26 Neil Booth + + * defaults.h: Default escape sequences to ASCII. + * config/i370/i370.h: Adjust for ASCII default. + * config/1750a/1750a.h: Remove escape sequence definitions. + * config/a29k/a29k.h: Similarly. + * config/alpha/alpha.h: Similarly. + * config/arc/arc.h: Similarly. + * config/arm/arm.h: Similarly. + * config/avr/avr.h: Similarly. + * config/c4x/c4x.h: Similarly. + * config/clipper/clipper.h: Similarly. + * config/convex/convex.h: Similarly. + * config/d30v/d30v.h: Similarly. + * config/dsp16xx/dsp16xx.h: Similarly. + * config/elxsi/elxsi.h: Similarly. + * config/fr30/fr30.h: Similarly. + * config/h8300/h8300.h: Similarly. + * config/i386/i386.h: Similarly. + * config/i860/i860.h: Similarly. + * config/i960/i960.h: Similarly. + * config/ia64/ia64.h: Similarly. + * config/m32r/m32r.h: Similarly. + * config/m68hc11/m68hc11.h: Similarly. + * config/m68k/m68k.h: Similarly. + * config/m88k/m88k.h: Similarly. + * config/mcore/mcore.h: Similarly. + * config/mips/mips.h: Similarly. + * config/mn10200/mn10200.h: Similarly. + * config/mn10300/mn10300.h: Similarly. + * config/ns32k/ns32k.h: Similarly. + * config/pa/pa.h: Similarly. + * config/pdp11/pdp11.h: Similarly. + * config/pj/pj.h: Similarly. + * config/romp/romp.h: Similarly. + * config/rs6000/rs6000.h: Similarly. + * config/sh/sh.h: Similarly. + * config/sparc/sparc.h: Similarly. + * config/v850/v850.h: Similarly. + * config/vax/vax.h: Similarly. + * config/we32k/we32k.h: Similarly. + * doc/tm.texi: Update documentation. + +2001-06-26 Gabriel Dos Reis + + * diagnostic.c (digit_buffer): Remove as global. Move to... + * diagnostic.h (struct output_buffer): ... here. + * diagnostic.c (output_formatted_integer): Adjust use of digit_buffer. + +2001-06-25 Steve Ellcey + + * config.gcc (ia64*-*-hpux*): Add ia64/hpux_longdouble.h to tm_file. + Define tmake_file to include ia64/t-hpux. + * real.c (INTEL_EXTENDED_IEEE_FORMAT): Test for value instead of + testing to see if it is defined. + * real.h (INTEL_EXTENDED_IEEE_FORMAT): Likewise. Default to 0 if + undefined. + * config/ia64/hpux_longdouble.h: New. + * config/ia64/ia64.c (hfa_element_mode): Add comment about incorrect + handling of long doubles. + (ia64_function_arg, ia64_function_value): Add checks for TFmode + and INTEL_EXTENDED_IEEE_FORMAT. + * config/ia64/ia64.h (INTEL_EXTENDED_IEEE_FORMAT): Define to one. + (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, LIBCALL_VALUE): Add checks for + TFmode and INTEL_EXTENDED_IEEE_FORMAT. + * config/ia64/ia64.md (all TFmode patterns): Test + INTEL_EXTENDED_IEEE_FORMAT in condition. + (floatdidf2, floatdisf2): New, for !INTEL_EXTENDED_IEEE_FORMAT. + * config/ia64/quadlib.c: New. + * config/ia64/t-hpux: New. + * config/i386/i386.h (INTEL_EXTENDED_IEEE_FORMAT): Define to one. + +2001-06-25 Jim Wilson + + * config/i960/t-960bare (i960-c.o): Add missing header dependencies. + * config/i960/t-vxworks960: Likewise. + +2001-06-25 Dale Johannesen + + * bitmap.c (bitmap_last_bit_set): Fix a non-c89 usage (null actual + argument to macro). + +Mon Jun 25 11:10:51 CEST 2001 Jan Hubicka + + * i386.md (movsi_insv_1, movsi_insv_1_rex64): Fix constraints. + +2001-06-25 Joseph S. Myers + + * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi, + doc/gcc.texi, doc/gcov.texi, doc/install.texi, doc/invoke.texi, + doc/md.texi, doc/rtl.texi, doc/tm.texi: Be more consistent about + the use of "GCC" and related terms. + * doc/gcc.1, doc/gcov.1: Regenerate. + +2001-06-24 Joseph S. Myers + + * doc/extend.texi, doc/gcc.texi, doc/install-old.texi, + doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Remove + uses of @refill. + +Sun Jun 24 21:21:49 CEST 2001 Jan Hubicka + + * (movsi_insv_1, movsi_insv_1_rex64): Allow immediate operand. + +2001-06-24 Richard Henderson + + * builtins.c (expand_builtin_expect_jump): Disable if the + expression can't be re-evaluated. + +2001-06-24 Nick Clifton + + * config/arm/arm.c (arm_compute_save_reg_mask): For FIQ interrupt + handlers examine register r0-r7, for other interrupt handlers + examine r0-r12. If the interrupt handler is not a leaf function + save all call clobbered registers. + (arm_output_epilogue): If the prologue has pushed the IP register, + restore it here. + (Arm_expand_prologue): For interrupt functions that need the frame + pointer, push the IP register before it is corrupted. + + * config/arm/arm.h (ARM_SIGN_EXTEND): Fix compile time warnings + about the use of signed and unsigned quantities in a conditional. + +2001-06-23 Richard Henderson + + * config/alpha/crtfastmath.c: New file. + * config/alpha/t-crtfm: New file. + * config/alpha/elf.h (ENDFILE_SPEC): Use crtfastmath.o. + * config/alpha/osf.h (ENDFILE_SPEC): Likewise. + * config/alpha/t-crtbe (EXTRA_PARTS): Add pieces defined here. + * config.gcc (alpha-{linux,freebsd,netbsd,osf}): Use alpha/t-crtfm; + do not set extra_parts here. + +2001-06-24 Joseph S. Myers + + * doc/install-old.texi: Remove more documentation of configure + options. + * doc/install.texi: Add it here. + +Sat Jun 23 19:40:05 CEST 2001 Jan Hubicka + + * i386-protos.h (emit_i387_cw_initialization): Declare. + * i386.md (movsi_insv_1): Remove '*'. + (fix_trunc?f?i2): Revamp to use control word parameters. + (fix_trunc?i_1): Likewise; update splitters. + (fix splitter): Remove. + * i386.c (MAX_386_STACK_LOCALS): set to 3. + (emit_i387_cw_initialization): New function. + (output_fix_trunc): Do not initialize control word; + kill dead code; simplify. + +2001-06-23 Neil Booth + + * cppmacro.c (make_string_token): Avoid warning. + (cpp_macro_definition): Prepend the macro name. Update + comments. + * cppmain.c (cb_define, dump_macro): Update for changes + to cpp_macro_definition. + +Sat Jun 23 10:20:03 CEST 2001 Jan Hubicka + + * flow.c (attempt_auto_inc, try_pre_increment_1): Fix typo. + +Sat Jun 23 01:23:59 CEST 2001 Jan Hubicka + + * flow.c (mark_set_1, attempt_auto_inc, mark_used_reg, + try_pre_increment_1): compute REG_FREQ using bb->frequency. + + * regclass.c (loop_cost): Kill. + (frequency): New global variable. + (record_operand_costs): Replace loop_cost by frequency. + (scan_one_insn): Likewise. + (regclass): Likewise; set frequency according to bb->frequency. + + * flow.c (split_edge): Set frequency. + +Sat Jun 23 01:16:42 CEST 2001 Jan Hubicka + + * predict.c (block_info_def): Add nvisited. + (propagate_freq): Count nvisited; re-queue delayed blocks; handle + irreducible regions. + + * flow.c (dump_edge_info): Dump the probability of edge. + (combine_predictions_for_insn): Dump the basic block. + +2001-06-22 Joseph S. Myers + + * doc/gcc.texi: Update documentation of source files of C + compiler. + +2001-06-22 Richard Henderson + + * doc/invoke.texi (-funsafe-math-optimizations): Document its + possible effects at link time. + +2001-06-22 Diego Novillo + + * basic-block.h (dump_edge_info): Declare. + (clear_edges): Declare. + (mark_critical_edges): Declare. + * flow.c (dump_edge_info): Remove static declaration. + (clear_edges): Ditto. + (mark_critical_edges): Ditto. + (free_basic_block_vars): Only clear edges and free basic block + array if basic_block_info is not NULL. + * ssa.c (compute_dominance_frontiers): Remove static declaration. + * ssa.h (compute_dominance_frontiers): Declare. + +2001-06-22 Toshiyasu Morita (toshiyasu.morita@hsa.hitachi.com) + + * predict.c: (expected_value_to_br_prob): Check for const_true_rtx + instead of const1_rtx for true case. + +2001-06-22 David Mosberger + + * config/ia64/crtfastmath.c: New file. + * config/ia64/t-ia64 (EXTRA_PARTS): Include it. + * config/ia64/linux.h (ENDFILE_SPEC): New. + +2001-06-22 Toshiyasu Morita + + * config/h8300/h8300.c (asm_file_start): Remove reference to + "release F-1". + +2001-06-22 Joseph S. Myers + + * c-common.c (verify_tree): Check for x being NULL. + * doc/c-tree.texi: Document COMPOUND_BODY of an empty + COMPOUND_STMT. + Fixes PR c/3259. + +2001-06-22 DJ Delorie + + * config/arm/arm.h (struct machine_function): Remove ra_rtx. + * config/arm/arm.c (arm_mark_machine_status): Remove ra_rtx. + (arm_return_addr): Use get_hard_reg_initial_val et al. + * config/d30v/d30v.h (struct machine_function): Remove ra_rtx. + * config/d30v/d30v.c (d30v_mark_machine_status): Remove ra_rtx. + (d30v_return_addr): Use get_hard_reg_initial_val et al. + * config/rs6000/rs6000.h (struct machine_function): Remove ra_rtx. + * config/rs6000/rs6000.c (rs6000_override_options): Don't set + mark_machine_status. + (rs6000_mark_machine_status): Remove. + (rs6000_return_addr): Use get_hard_reg_initial_val. + (rs6000_ra_ever_killed): Use has_hard_reg_initial_val. + * config/v850/v850.h (INIT_EXPANDERS): Delete. + * config/v850/v850.c (struct machine_function): Delete. + (v850_init_machine_status): Delete. + (v850_mark_machine_status): Delete. + (v850_free_machine_status): Delete. + (v850_return_addr): Use get_hard_reg_initial_val. + (v850_init_expanders): Delete. + +Fri Jun 22 19:20:59 CEST 2001 Jan Hubicka + + * predict.c (estimate_bb_frequencies): Do not handle conditional + jumps jumping to fallthru basic block as conditional jumps. + +Fri Jun 22 19:11:28 CEST 2001 Jan Hubicka + + * regs.h (struct reg_info_def): Add freq field. + (REG_N_REFS): Update comment. + (REG_FREQ): New. + * regclass.c (scan_one_insn): Update REG_FREQ. + * flow.c (mark_set_1): Update REG_FREQ, make REG_N_SETS unweighted. + (attempt_auto_inc): Likewise. + (mark_used_reg): Likewise. + (try_pre_increment_1): Likewise. + * local-alloc.c (struct qty): Add freq field. + (alloc_qty): Set freq. + (update_equiv_regs): Set REG_FREQ. + (QTY_CMP_PRI): Use freq. + (combine_regs): Update qty->freq. + * global.c (struct allocno): Update comment for n_refs; + add freq field. + (local_reg_freq): New array. + (global_alloc): Update freq field; + allocate and initialize local_reg_freq. + (allocno_compare): Use freq field. + (find_reg): Likewise. + * reload1.c (count_pseudo): Use freq isntead of n_refs. + (count_spilled_pseudo): Likewise. + + * tm.texi (GCOV_TYPE_SIZE): Document. + * basic-block.h (gcov_type): Define. + (struct edge_def): Use gcov_type for count field. + (struct basic_block_def): Likewise. + * defaults.h (GCOV_TYPE_SIZE): Define. + * final.c (end_final): Use GCOV_TYPE_SIZE. + * flow.c (dump_edge_info, dump_flow_info, dump_bb): Print count fields + using HOST_WIDEST_INT_PRINT_DEC. + * gcov-io.h (__fetch_gcov_type, __store_gcov_type, __read_gcov_type, + __write_gcov_type): New. + (store_long): Remove. + * gcov.c (gcov_type): Set default. + (struct adj_list): Use gcov_type for arc_count. + (bb_info): Use gcov_type for succ_count, pred_count and exec_count. + (create_program_flow_graph): Read arc_count properly. + (solve_program_flow_graph): 'total' is gcov_type. + (output_data): Line_counts is gcov_type, print it properly. + * libgcc2.c (struct bb): Counts is gcov_type. + (__bb_exit_func): Use __read_gcov_type and __write_gcov_type. + * profile.c (LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE): Set default. + (GCOV_TYPE_SIZE): Define. + (struct bb_info): succ_count and pred_count is gcov_type. + (compute_branch_probabilities): Use __read_gcov_type, + print read edges to the dump file. + (total): Is gcov_type. + (gen_edge_profiler): Use GCOV_TYPE_SIZE. + +2001-06-14 Andrew Haley + + * optabs.c (emit_libcall_block): When using non-call exceptions, + don't mark libcalls never throwing. + +2001-06-21 Stan Shebs + + * objc/objc-act.c (hash_init): Use xcalloc. + +2001-06-21 Richard Henderson + + * flow.c (entry_exit_blocks): Initialize frequency. + (split_block): Copy it. + (dump_flow_info): Dump it. + +Thu Jun 21 22:15:10 2001 J"orn Rennecke + + * sh.c (barrier_align): Also recognize branch-around-a-jump-sequence + from machine-depedent_reorg for purposes of alignment supression + when no delay slot insn has been added. + +2001-06-21 Neil Booth + + * cppmacro.c (make_string_token): Null terminate. + +2001-06-21 DJ Delorie + + * config/alpha/alpha.h (struct machine_function): Remove. + * config/alpha/alpha.c (integrate.h): Include. + (override_options): Don't set up machine_status hooks. + (alpha_init_machine_status): Remove. + (alpha_mark_machine_status): Remove. + (alpha_free_machine_status): Remove. + (alpha_return_addr): Use get_hard_reg_initial_val. + (alpha_gp_save_rtx): Likewise. + (alpha_ra_ever_killed): Use has_hard_reg_initial_val. + +2001-06-20 Aldy Hernandez + + * config/sh/sh.md (interrupt_function): Use + current_function_interrupt. + (define_delay): Schedule in delay slot if TARGET_SH3, even if it is + an interrupt function. + + * config/sh/sh.h (current_function_interrupt): Define extern. + + * config/sh/sh.c (current_function_interrupt): New global. + (sh_expand_prologue): Set current_function_interrupt. + +2001-06-21 Phil Edwards + + * doc/install.texi: Add 'c' to list of --enable-languages choices. + +2001-06-21 DJ Delorie + + * integrate.c (mark_hard_reg_initial_vals): Check for NULL. + + * integrate.c (ggc.h): Include. + (initial_value_pair, initial_value_struct, + setup_initial_hard_reg_value_integration): Add prototypes. + (expand_inline_function): Call + setup_initial_hard_reg_value_integration. + (has_func_hard_reg_initial_val, get_func_hard_reg_initial_val, + get_hard_reg_initial_val, has_hard_reg_initial_val): New functions + to keep track of values present at the start of a function. + (mark_hard_reg_initial_vals): New, for gc. + (setup_initial_hard_reg_value_integration): New. Sets up pseudo + mappings for initial values. + (emit_initial_value_sets): New. Emits code to set initial value + pseudos. + * integrate.h: Add prototypes for new functions. + * function.h (struct function): Add hard_reg_initial_vals field. + * function.c (integrate.h): Include. + (mark_function_status): Call + mark_hard_reg_initial_vals. + * toplev.c (integrate.h): Include. + (rest_of_compilation): Call emit_initial_value_sets. + +2001-06-21 Stan Shebs + + * doc/contrib.texi, doc/cpp.texi, doc/cppinternals.texi, + doc/extend.texi, doc/gcc.texi, doc/install.texi, doc/invoke.texi, + doc/objc.texi, doc/tm.texi: Use the correct name "Objective-C" + everywhere instead of "Objective C". + +2001-06-21 Joseph S. Myers + + * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi, + doc/gcc.texi, doc/install-old.texi, doc/install.texi, + doc/invoke.texi, doc/rtl.texi: Consistently use "front end" and + "back end" as nouns and "front-end" and "back-end" as adjectives. + +Wed Jun 20 21:53:35 CEST 2001 Jan Hubicka + + * predict.c (estimate_probability): Fix loop bounds. + +Wed Jun 20 19:10:48 CEST 2001 Jan Hubicka + + * toplev.c (rest_of_compilation): Run mark_constant_function + before profile-arcs. + +Wed Jun 20 19:08:18 CEST 2001 Jan Hubicka + + * predict.c (estimate_loops_at_level, propagate_freq + estimate_bb_frequencies, count_to_freqs): New functions. + (estimate_probability): Call estimate_bb_frequencies. + * basic-block.h (basic_block_def): Add field "freq". + (BB_FREQ_MAX): New constant. + +Wed Jun 20 17:02:50 2001 J"orn Rennecke + + * sh.c (barrier_align): Don't ask for alignment when seeing a + branch-around-a-jump from machine_dependent_reorg. + +Wed Jun 20 08:35:02 2001 Jeffrey A Law (law@cygnus.com) + + * ssa.c (rename_block): Update parameter to remove_phi_alternative + (convert_from_ssa): Do create REG_DEAD and REG_UNUSED notes when + re-running life analysis. + +2001-06-20 Stan Shebs + + * objc/objc-act.c (hash_init): Assume xmalloc always succeeds, + also use memset to clear the hash tables. + (hash_enter): Assume xmalloc always succeeds. + (hash_add_attr): Ditto. + (continue_class): Ditto. + +2001-06-20 Michael Meissner + + * builtins.c (predict.h): Include. + (expand_builtin_expect): Update comment. + (expand_builtin_expect_jump): New function to expand + __builtin_expect inside of a conditional jump expansion. + + * expr.c (do_jump): Special case __builtin_expect (, 0) and + __builtin_expect (, 1). + + * Makefile.in (builtins.o): Depend on $(PREDICT_H). + + * rtl.h (expand_builtin_expect_jump): Add prototype. + +2001-06-19 Geoffrey Keating + + * doc/rtl.texi (Machine Modes): Correct description of + floating-point modes on machines with non-8-bit bytes. + +2001-06-19 Bernd Schmidt + + * regmove.c (optimize_reg_copy_3): Do nothing if previous insn + carries a REG_EQUIV note. If it carries REG_EQUAL, delete the + note. + +Tue Jun 19 07:53:52 2001 Jeffrey A Law (law@cygnus.com) + + * ssa.c (remove_phi_alternative): Remove declaration. No longer + static. Second argument is a pointer to a basic block structure, + not a basic block index. + (convert_to_ssa): Do not remove dead code. + (convert_from_ssa): Do not remove dead code to create death notes. + * ssa.h (remove_phi_alternative): Declare. + + * flow.c (delete_unreachable_blocks): Fix patch error in + previous change (call to find_unreachable_blocks was lost). + + * ssa.c (ssa_uses): Remove definition. + (apply_delayed_renames): Don't grow ssa_uses. + (rename_block): Remove comment related to ssa_uses. + (rename_registers): Do not initialize ssa_uses. + (convert_from_ssa): Do not free ssa_uses. + + * ssa-dce.c: Renamed from dce.c. + * Makefile.in (OBJS): Replace dce.o with ssa-dce.o + (dependencies): Replace dce.c with ssa-dce.c and dce.o with + ssa-dce.o. + +2001-06-19 Eric Christopher + + * emit-rtl.c (gen_lowpart_common): Do not assume that SFmode + and DFmode are UNITS_PER_WORD and 2*UNITS_PER_WORD. Use + GET_MODE_BITSIZE instead of GET_MODE_SIZE/UNITS_PER_WORD. + +Tue Jun 19 01:52:27 2001 J"orn Rennecke + + * sh.c (output_branch): Delete bogus code. + + * sh.c (initial_elimination_offset): + Fix FROM == RETURN_ADDRESS_POINTER_REGNUM case. + +Mon Jun 18 12:50:49 2001 Jeffrey A Law (law@cygnus.com) + + * flow.c (find_unreachable_blocks): New function. + (delete_unreachable_blocks): Use find_unreachable_blocks. + * basic-block.h (find_unreachable_blocks): Declare. + + * dce.c (eliminate_dead_code): Fix formatting glitch. + +2001-06-18 Jason Merrill + + * c-common.h (RETURN_NULLIFIED_P): New macro. + * c-semantics.c (genrtl_return_stmt): Check it. + + * expr.c (clear_storage): Set TREE_NOTHROW on the decl for memset. + (emit_block_move): Likewise. + +Mon Jun 18 17:27:24 CEST 2001 Jan Hubicka + + * unroll.c: Include predict.h. + (unroll_loop): Drop prediction notes on preconditioning. + * predict.def (PRED_LOOP_PRECONDITIONG, PRED_LOOP_CONDITION): + New; add comments on the others. + * Makefile.in: (unroll.o): Add dependency on predict.h. + * loop.c (strength_reduce): Fix branch prediction. + +Mon Jun 18 17:26:56 CEST 2001 Jan Hubicka + + * stmt.c (emit_case_nodes): Optimize test whether index is in given + interval. + +Mon Jun 18 15:43:10 CEST 2001 Jan Hubicka + + * predict.c (estimate_probability): Do not bail out early + when note is present. + (combine_predictions_for_insn): Fix note removal code. + +2001-06-18 Ben Elliston + + * except.c (resolve_fixup_regions): Initialize "cleanup". + +2001-06-17 Neil Booth + + * tm.texi: Document STDC_0_IN_SYSTEM_HEADERS. + +Sat Jun 16 20:20:39 2001 Richard Kenner + + * expr.c (expand_expr, case ADDR_EXPR): If taking address of SAVE_EXPR, + use put_var_into_stack. + +2001-06-16 Franz Sirl + + * gccspec.c (lang_specific_driver): If compiling ObjC, add + -shared-libgcc when necessary. + * Makefile.in (gccspec.o): Compile with DRIVER_DEFINES. + +2001-06-16 Daniel Berlin + + * bitmap.h: Add dump_bitmap, bitmap_zero, bitmap_union_of_diffs, + bitmap_a_or_b, bitmap_a_and_b, bitmap_first_set_bit, + bitmap_last_set_bit. All for compatibility with sbitmap's. + + *bitmap.c (bitmap_zero): New function. + (bitmap_union_of_diffs): New function. + (bitmap_first_set_bit): New function. + (bitmap_last_set_bit): New function. + +2001-06-16 Neil Booth + + * cpp.texi, invoke.texi: Update. + * cpp.1, gcc.1: Regenerate. + +Sat Jun 16 12:45:20 CEST 2001 Jan Hubicka + + * i386.md (minsf): Fix splitter. (PR fortran/3191) + +2001-06-16 Neil Booth + + * doc/cpp.texi: Update. + * doc/cpp.1: Regenerate. + +2001-06-15 Loren J. Rittle + + * doc/install.texi: Use correct markup hints. + +Fri Jun 15 18:05:22 2001 Richard Kenner + + * function.c (gen_mem_addressof): Handle case where DECL is SAVE_EXPR. + + * explow.c (expr_size): If DECL and size specified, use it. + +2001-06-15 Zack Weinberg + + * doc/cpp.texi: Formatting corrections. + Correct buggy example of use of __GNUC__ etc. + Clarify $ in identifiers. + * doc/cpp.1: Regenerate. + +Fri Jun 15 19:35:38 CEST 2001 Jan Hubicka + + * optabs.c (expand_twoval_binop): Avoid undefined behavior. + +2001-06-15 Rainer Orth + + * doc/install.texi (Specific, alpha*-*-*): Fixed Tru64 UNIX + etc. spelling. + (Specific, alpha-*-osf1): Renamed to alpha*-*-osf*. + Added Tru64 UNIX V5.1 bootstrap hints. + (Specific, alpha*-*-osf*): Removed old section, obsolete. + +2001-06-15 Andreas Jaeger + + * doc/install.texi (Specific): Mention that glibc cannot be + compiled with GCC 3.0. + +2001-06-14 Andrew Haley + + * combine.c (nonzero_bits): Don't optimize away division by + zero. + +2001-06-15 Zack Weinberg + + * doc/cpp.texi: Revised and brought up to date. + * doc/cpp.1: Regenerate. + +2001-06-15 Loren J. Rittle + + * doc/install.texi: Update --enable-threads to match reality. + +2001-06-15 Michael Hayes + + * doc/install.texi: Update for C4x. + * README.C4X: Remove. + +2001-06-14 Joseph S. Myers + + * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi, + doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi, + doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos. + Consistently use "built-in" and "bit-field". Minor logical markup + improvements. + * doc/gcc.1: Regenerate. + +2001-06-14 Richard Henderson + + * config/mips/mips.md (exception_receiver): New. + +2001-06-14 Daniel J. Berlin + + * doc/gcc.texi: Update passes documentation to be more in tune + with reality. + +Thu Jun 14 15:38:28 CEST 2001 Jan Hubicka + + * i386.c (ix86_expand_prologue): Fix merging conflict. + +2001-06-14 Joseph S. Myers + + * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi, + doc/gcc.texi, doc/gcov.texi, doc/install-old.texi, + doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Use more + logical markup. Use TeX quotes and dashes. Use @dots{} and + @minus{}. Avoid spaces inside @var. Update last modification + date in gcc.texi. + * doc/gcc.1, doc/gcov.1: Regenerate. + +Thu Jun 14 12:44:15 CEST 2001 Jan Hubicka + + * i386.c (x86_accumulate_outgoing_args, x86_prologue_using_move, + x86_epilogue_using_move): New global variables. + (override_options): Enable ACCUMULATE_OUTGOING_ARGS if preferred. + (ix86_emit_save_regs_using_mov): New static function. + (ix86_expand_prologue, ix86_expand_epilogue): Use moves if preferred. + * i386.h (MASK_MMX, MASK_SSE, MASK_SSE2, MASK_128BIT_LONG_DOUBLE, + MASK_MIX_SSE_I387): Renumber. + (MASK_NO_ACCUMULATE_OUTGOING_ARGS): New. + (x86_accumulate_outgoing_args, x86_prologue_using_move, + x86_epilogue_using_move): Declare. + (TARGET_PROLOGUE_USING_MOVE, TARGET_EPILOGUE_USING_MOVE): New. + +2001-06-13 John David Anglin + + * inclhack.def (hpux10_cpp_pow_inline): New hack. + +2001-06-13 Richard Henderson + + * ifcvt.c (dead_or_predicable): Fix return value last patch. + +2001-06-13 Mark Mitchell + + * NEWS: Remove. + +2001-06-13 Richard Henderson + + * ifcvt.c (cond_exec_get_condition): Use reversed_comparison_code. + (cond_exec_process_if_block, dead_or_predicable): Likewise. + +2001-06-13 Rainer Orth + + * mips-tfile.c (copy_object): Always pass indexNil for symbol + table index. + +2001-06-13 Kazu Hirata + + * config/h8300/h8300.h (OK_FOR_T): Remove. + (EXTRA_CONSTRAINT): Do not use OK_FOR_T. + * config/h8300/h8300.md: Remove alternatives involving inc and dec + in the helper patterns for addhi3 and addsi3. + +2001-06-13 Phil Edwards + + * doc/contrib.texi: Link to libstdc++'s thanks.html for now. + +2001-06-13 Zack Weinberg + + * Makefile.in: Move _bb and __gcc_bcmp to LIB2FUNCS_ST. + * libgcc-std.ver: Take out __bb* and __gcc_bcmp. + + * config/t-slibgcc-elf-ver, config/t-slibgcc-sld, + config/alpha/t-osf4, config/mips/t-iris6: Extract all + references to @shlib_map_file@, @shlib_objs@, or + @shlib_base_name@ to Makefile variables. + Bump soname version of libgcc to 1. + +2001-06-13 Joseph S. Myers + + * doc/install.texi: Use more logical markup. Include @node + commands in the source when generating any non-HTML. + +2001-06-13 Joseph S. Myers + + * README: Remove. Some of the contents moved to ../README. + +2001-06-13 Alexandre Oliva + + * doc/install.texi (--enable-shared): List package names + recognized by GCC. + +2001-06-13 Alexandre Oliva + + * doc/install.texi (ix86-*-solaris*): Removed, outdated. + (*-*-solaris*): Document problem in /bin/sh that affects + configuring libraries. + (sparc-*-solaris*): Recommend GNU binutils 2.11.1 or vendor tools. + (*-sun-solaris2.8): Document linker problem that explains why + libjava is disabled by default. + +2001-06-09 Mark Mitchell + + Revert this patch: + * toplev.c (rest_of_compilation): Remove dead code before + purge_addressof. + +2001-06-12 Alexandre Oliva + + Reverted: + 2001-06-07 Nathan Sidwell + * configure.in (sparc*-*-*): Check assembler R_SPARC_UA32 support. + * configure: Rebuilt. + +2001-06-12 Jim Wilson + + * loop.c (strength_reduce): Move bl->all_reduced set before + check_ext_dependant_givs call. + (check_ext_dependant_givs): Clear bl->all_reduced when ignoring givs. + +2001-06-12 Alexandre Oliva + + * doc/extend.texi (Function Attributes): Document SH's sp_switch + and trap_exit. + +2001-06-13 Joseph S. Myers + + * doc/invoke.texi: Use more logical markup. Use TeX quotes, + dashes and @dots{}. + +2001-06-12 Richard Henderson + + * config/i386/i386.c (ix86_expand_prologue): Always use + gen_pro_epilogue_adjust_stack; update arguments. + (ix86_expand_epilogue): Likewise. + (ix86_emit_epilogue_esp_adjustment): Remove. + (ix86_adjust_cost): Remove pro_epilogue_adjust_stack hack. + * config/i386/i386.md (pro_epilogue_adjust_stack): Use a BLKmode + clobber of scratch memory instead of a modification of EBP as the + barrier. Update all peepholes to match. + +2001-06-12 Joseph S. Myers + + * doc/gcc.texi: Change the font used for @def... commands to a + fixed width font. + * doc/extend.texi: Use more logical markup. Use "built-in" + instead of "builtin". Use @deftypefn to mark up built-in + functions; specify their types in the @deftypefn and not in the + descriptive text. Use TeX quotes and dashes. Add more index + entries. + +2001-06-12 lars brinkhoff + + * gcc.texi (HOST_BITS_PER_LONGLONG): Document. + (DIR_SEPARATOR_2): Likewise. + +2001-06-12 Joseph S. Myers + + * doc/install.texi (--exec-prefix, --bindir, --libdir, + --with-slibdir, --infodir, --mandir, --with-cpp-install-dir): + Document. + (--enable-cpp): Change to document --disable-cpp instead; update + to reflect current default. + (--without-fast-fixincludes): Remove documentation. + (Final install): Document installation directories in more + detail. Document use of make dvi. + +Tue Jun 12 19:01:43 CEST 2001 Jan Hubicka + + * recog.c (validate_replace_rtx_1): Fix previous patch. + +Tue Jun 12 17:25:39 CEST 2001 Jan Hubicka + + * recog.c (validate_replace_rtx_1): Do plus_constant call always. + +Tue Jun 12 17:24:07 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Allow volatile memory + to be subregged in case we don't have move instruction. + +Tue Jun 12 12:20:12 CEST 2001 Jan Hubicka + + * loop.c: Include predict.h + (strength_reduce): Drop branch prediction note in case + number of iterations is known. + * predict.def (PRED_LOOP_ITERATIONS): new. + * Makefile.in (loop.o): Add dependency on predict.h + +2001-06-12 Kaveh R. Ghazi + + * c-decl.c (grokdeclarator): Use INTEGRAL_TYPE_P. + + * c-typeck.c (c_start_case): Likewise. + +2001-06-12 Mark Mitchell + + * expr.c (store_field): Don't set MEM_ALIAS_SET for a field + in a structure at a variable address. + +2001-06-12 Joseph S. Myers + + * doc/gcov.texi: Use more logical markup. + +2001-06-11 Mark Mitchell + + * unroll.c (initial_reg_note_copy): Use PUT_REG_NOTE_KIND and + REG_NOTE_KIND, not PUT_MODE and GET_MODE. + (final_reg_note_copy): Remove REG_WAS_0 notes that are no longer + valid. + +2001-06-11 Stan Shebs + + * config/darwin.h (ASM_FILE_END): Remove decl of language_string. + +2001-06-11 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*lshrdi3_const32"): Mark the clobber + as an early clobber to make sure it is not used by reload in + one of the operands. + +2001-06-11 Mark Mitchell + + * doc/c-tree.texi: Update information about flag_honor_std. + * doc/install.texi: Note that binutils is required on HPUX 11. + * doc/invoke.texi (-fhonor-std): Note that -fno-honor-std is + now the default. + + * config/mips/abi64.h (RETURN_IN_MEMORY): Fix handling of + variable-sized types. + +2001-06-11 Joseph S. Myers + + * doc/md.texi: Use TeX dashes and quotes. + +2001-06-11 Joseph S. Myers + + * doc/rtl.texi: Reference manual chapter about trees. + +2001-06-11 Rainer Orth + + * config/mips/iris6.h (NO_BUILTIN_WINT_TYPE): Define. + (WINT_TYPE): Override. + (WINT_TYPE_SIZE): Likewise. + (SUBTARGET_CPP_SIZE_SPEC): Define __WINT_TYPE__ as appropriate. + + * config/sparc/sol2.h (WINT_TYPE): Define. + (WINT_TYPE_SIZE): Likewise. + + * config/sparc/sol2-sld-64.h (NO_BUILTIN_WINT_TYPE): Define. + (WINT_TYPE): Override. + (WINT_TYPE_SIZE): Likewise. + (CPP_ARCH32_SPEC): Add __WINT_TYPE__ definition. + (CPP_ARCH64_SPEC): Likewise. + +2001-06-11 Richard Henderson + + * unwind-dw2-fde.c (__deregister_frame_info): Don't play games + with alias attribute. + + * config/linux.h (CPLUSPLUS_CPP_SPEC): Use %(cpp) not $(cpp_cpu). + * config/alpha/linux.h (CPLUSPLUS_CPP_SPEC): Likewise. + +2001-06-11 Franz Sirl + + * config/rs6000/linux.h (CPLUSPLUS_CPP_SPEC): New. + +2001-06-11 Stan Shebs + + * config/darwin.c (darwin_encode_section_info): Rewrite to simplify + and fix coding mistakes. + +2001-06-11 Nick Clifton + + * config/m32r/m32r.md (movstrsi_internal): Do not expect a + return string from m32r_output_block_move. + * config/m32r/m32r-protos.h: Make m32r_output_block_move a + void function. + * config/m32r/m32r.h (INT32_P): Rename to UNIT32_P and remove + integer overflow. + (ROUND_ADVANCE): Remove signed/unsigned conflict. + * config/m32r/m32r.c: Declare prototypes for static functions. + (move_src_operand): Replace INT32_P with UINT32_P. + (function_arg_partial_nregs): Fixed signed/unsigned conflict + in initialisation of 'size'. + (m32r_sched_reord): Remove redundant declarations of 'code'. + (m32r_output_block_move): Change to a void function. + (m32r_encode_section_info): Cast return of + TREE_STRING_POINTER to avoid compile time warning. + +2001-06-11 Richard Henderson + + * config/alpha/osf5.h (TARGET_LD_BUGGY_LDGP): New. + * config/alpha/alpha.h (TARGET_LD_BUGGY_LDGP): Default. + (struct machine_function): Add gp_save_rtx. + * config/alpha/alpha.c (alpha_mark_machine_status): Mark it. + (alpha_gp_save_rtx): New. + * config/alpha/alpha-protos.h: Declare it. + * config/alpha/alpha.md (exception_receiver): Make an expander. + Use alpha_gp_save_rtx if TARGET_LD_BUGGY_LDGP. + +2001-06-11 Richard Henderson + + * config/alpha/osf.h (LINK_SPEC): Hide _GLOBAL_* symbols. + +2001-06-11 Rainer Orth + + * configure.in: Align --help messages. + Remove trailing full stops. + Consistently use lower case. + Fix DWARF 2 spelling. + * configure: Rebuilt. + +2001-06-11 Rainer Orth + + * config/alpha/alpha.h (CPP_SPEC): Don't define __LANGUAGE_C and + variants for .cpp/.cp/.c++ files. + Move definition of __LANGUAGE_C_PLUS_PLUS ... + (CPLUSPLUS_CPP_SPEC): ... here. + +Mon Jun 11 15:47:45 CEST 2001 Jan Hubicka + + * jump.c (duplicate_loop_exit_test): Fix loop header heuristics. + +2001-06-11 Joseph S. Myers + + * c-decl.c (store_parm_decls): When comparing types in an + old-style function declaration with those from a previous + prototype, compare the unqualified versions of parameter types. + Fixes PR c/3116. + +2001-06-11 Joseph S. Myers + + * doc/objc.texi: Use more logical markup. Use TeX dashes. + +2001-06-11 Joseph S. Myers + + * doc/c-tree.texi: Use more logical markup. + +2001-06-11 Joseph S. Myers + + * c-decl.c (xref_tag): Don't return previous tags of wrong type. + +2001-06-11 Aldy Hernandez + + * loop.c (scan_loop): Do not combine asm statements. + +2001-06-11 Michael Hayes + + * simplify-rtx.c (simplify_subreg): Fix offset calculation + for complex values within a CONCAT. + +2001-06-11 Joseph S. Myers + + * doc/install.texi: Update details of what components are included + in the GCC distribution. Update default directory for g++ + includes. Update documentation relating to old libio. Adjust + documentation on DejaGnu environment variables. Remove + documentation of --enable-cpplib. + +2001-06-11 Joseph S. Myers + + * doc/contrib.texi: Fix alphabetical order. Fix typos. Improve + markup. + +2001-06-10 Richard Henderson + + * ifcvt.c (life_data_ok): New. + (merge_if_block): Use it to determine whether to update + global_live_at_end. + (if_convert): Set it. + +2001-06-10 Richard Henderson + + * config/alpha/osf5.h (ASM_OLDAS_SPEC): Add -c. + +2001-06-10 Alexandre Oliva + + * doc/invoke.texi (MN10300 Options): Document -mno-crt0. + (SH Options): Document -mieee. + * doc/install.texi (Final install): Remove obsolete information + about installing cross compilers. + * doc/gcc.1: Rebuilt. + +2001-06-10 Richard Henderson + + * config/alpha/alpha.c (override_options): Set align_loops, + align_jumps, and align_functions. + * config/alpha/alpha.h (FUNCTION_BOUNDARY): Set to 32 bits. + (LOOP_ALIGN, LABEL_ALIGN_AFTER_BARRIER): Remove. + +2001-06-11 Michael Hayes + + * emit-rtl.c (gen_lowpart_common): Do not assume that SFmode and DFmode + are one and two words in size. + +2001-06-10 Richard Henderson + + * doc/invoke.texi (Optimization Options): Document -fpeephole2. + (Code Generation Options): Document -fnon-call-exceptions. + +2001-06-10 Mark Kettenis + + * config/i386/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Undefine. + +2001-06-10 Stephane Carrez + + * m68hc11.md (peepholes): Remove unused and wrong peepholes. + +2001-06-10 Mark Mitchell + Gabriel Dos Reis + + * Makefile.in (c-parse.o): Depend on diagnostic.h + (dwarf2out.o): Likewise. + + * dwarf2out.c: #include diagnostic.h + + * toplev.h (warningcount, errorcount, sorrycount): Remove + declarations. + + * toplev.c (warningcount, errorcount, sorrycount): Remove + definitions. + + * diagnostic.h (struct output_buffer): Reorder fields. + (diagnostic_kind_count): New macro. + (errorcount, warningcount, sorrycount): Define as macros. + (diagnostic_report_warnings_p): New macro. + (output_state): Add diagnostic_count field. + + * diagnostic.c (warningcount, errorcount, inhibit_warnings): + Remove tentative declaration. + (count_error): Use diagnostic_report_warnings_p. + + * c-parse.in: #include diagnostic.h + +2001-06-10 Stephane Carrez + + * config/m68hc11/m68hc11.md ("extendhisi2"): Fix constraints to + prefer a memory for operand 1. + ("*addsi3"): Fix constraints, the '!' was too strong. + ("*addsi3_split"): Accept soft register and split accordingly. + +2001-06-10 Stephane Carrez + + * config/m68hc11/m68hc11-protos.h (m68hc11_initialize_trampoline): + Move definition in the RTX_CODE section. + +2001-06-10 Stephane Carrez + + * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Define the return + address as relative to the argument pointer. + +Sun Jun 10 10:58:53 CEST 2001 Jan Hubicka + + * predict.def (PRED_OPCODE): Place before call and error_return. + +Sun Jun 10 10:00:17 CEST 2001 Jan Hubicka + + * predict.def (PRED_CALL, PRED_ERROR_RETURN): New. + * predict.c (estimate_probability): Calculate dominance + information; improve detection of NORETURN heuristics; + add call/error_return heuiristics; tweak comparison heuristics + to recognize -1. + +2001-06-09 Alexandre Oliva + + * doc/invoke.texi (C Dialect Options): Document -aux-info. + (Debugging Options): Document -print-multi-directory and + -print-multi-lib. + * doc/gcc.1: Rebuilt. + + * toplev.c (independent_decode_option): Require `=' between + `-aux-info' and filename in the same argument. + * gcc.c: Don't pass -aux-info=filename twice. + +2001-06-09 Mark Mitchell + + * expr.c (expand_expr, case ARRAY_REF): Do not replace + an array element with the known initializing value if it has + side-effects. + + * toplev.c (rest_of_compilation): Remove dead code before + purge_addressof. + +2001-06-09 Neil Booth + + * cppinit.c (print_help): Document -fpreprocessed. + * invoke.texi: Similarly. + +Sun Jun 10 00:35:37 CEST 2001 Jan Hubicka + + * predict.def: New file. + * predict.h: New file. + * predict.c: Include predict.h. + (predictor_info): New structure and array. + (predict_edge, predict_insn): Rewrite; make global. + (predict_edge_def, predict_insn_def): New global functions. + (dump_prediction, combine_predictions_for_insns): New + static functions. + (estimate_probability): Change calls to predict_edge + to predict_edge_def and calls to predict_insn to predict_insn_def; + combine probabilities. + (expected_value_to_br_prob): Behave as predictor. + * rtl.h (REG_BR_PRED): Update coment. + (invert_br_probabilities): New. + * jump.c: Include predict.h + (duplicate_loop_exit_test): Drop branch prediction notes. + (invert_jump): Use invert_br_probabilities. + * Makefile.in: Add dependency on predict.h for jump and predict pass. + * ifcvt.c (dead_or_predicable): Use invert_br_probabilities. + * combine.c (distribute_notes): Handle BR_PRED. + +Sat Jun 9 23:29:41 CEST 2001 Jan Hubicka + + * predict.c (predict_insn, predict_edge): New static functions. + (estimate_probability): Revamp to use new functions; + fix loop header heruistics; add loop exist heruistics + +2001-06-09 Alexandre Oliva + + * config.gcc: Re-enable bi-arch sparc on Solaris 7 and above. + +2001-06-09 Peter Jakubek + + * config/m68k/m68k.md (ashrdi_const): Fix right shift by 16. + +2001-06-09 John David Anglin + + * vax.h (NOTICE_UPDATE_CC): Set CC_NO_OVERFLOW in cc_status.flags + for integer operations that don't update C bit. + +2001-06-09 Nicola Pero + + * gthr-posix.h (__gthread_objc_init_thread_system): If + pthread_key_create fails, it's not clear what the return value is. + This obvious fix makes sure it always returns -1 if a problem + occurs. + +2001-06-09 Joseph S. Myers + + * doc/gcc.texi: Use @defcodeindex for the index of options. Add + more index entries. Use more logical markup where appropriate. + Use TeX quotes and dashes. + +2001-06-09 Benjamin Kosnik + + * unwind-pe.h: Conditionally qualify references to abort with + std::. + +2001-06-09 Julian Foad + + * doc/invoke.texi: Remove superfluous text. + +2001-06-08 Richard Henderson + + * config/alpha/linux.h (CPLUSPLUS_CPP_SPEC): New. + (LIB_SPEC): Mirror config/linux.h version. + +2001-06-08 Richard Henderson + + * except.c (get_exception_pointer, get_exception_filter): Take a + struct function. Update all callers. + * except.h (get_exception_pointer): Update declaration. + * expr.c (expand_expr): Update get_exception_pointer call. + * integrate.c (expand_inline_function): Remap the exception pointer + from callee to caller. + +2001-06-08 Mark Mitchell + + * c-decl.c (grokdeclarator): Make the TREE_TYPE for declarations + accurately reflect its cv-qualification. + * c-typeck.c (type_lists_compatible_p): Ignore the top-levl + cv-qualifiers on function types. + +2001-06-08 Mark Mitchell + + * basic-block.h: Improve comments. + * except.c (expand_eh_region_end_allowed): Remove redundant call + to do_pending_stack_adjust. + * flow.c (life_analysis): Fix typo in comment. + (calculate_global_regs_live): Add documentation. + (mark_set_1): Likewise. + (debug_regset): Likewise. + * doc/rtl.texi (cond_exec): Document it. + +Fri Jun 8 21:52:51 CEST 2001 Jan Hubicka + + * i386.h (CONST_COSTS): set cost of constants representable in + immediate fields to 0. + +Fri Jun 8 21:34:54 CEST 2001 Jan Hubicka + + * function.c (diddle_return_value): Kill code to determine + return value before expand_function_end. + (expand_function_end): Delay call to clobber_return_register + after fucntion return value is computed. + + Re-install temporary reverted patch: + * toplev.c (rest_of_compilation): Call split_all_insns + before reg-stack and shorten-branches. Do shorten-branches + after reg-stack. + * final.c (shorten_branches): Remove insn splitting code. + +2001-06-08 Joseph S. Myers + + * doc/gcc.texi, doc/invoke.texi: Add index of command line + options. Use @opindex to index them rather than other indexing + commands. Use @var{...} instead of <...>. Avoid spaces in names + inside @var. Don't use @kindex to index escape sequences in + source code. + +2001-06-08 Jason Merrill + + * stmt.c (current_nesting_level): New fn. + * tree.h: Declare it. + * c-semantics.c (genrtl_compound_stmt): Use it. + + * dbxout.c (dbxout_symbol): Use DECL_RTL_SET_P. + +2001-06-08 Jakub Jelinek + + * jump.c (mark_modified_reg): Allow jump threading if condition + codes are represented by a hard register. + +2001-06-08 Jakub Jelinek + + * config/ia64/ia64.c (ia64_function_arg): Use [SDT]Fmode as gr_mode + for complex floats passed to unprototyped functions. + +2001-06-08 Mark Mitchell + + * except.c (expand_eh_region_end_allowed): Call + do_pending_stack_adjust as necessary. + +Fri Jun 8 14:16:33 CEST 2001 Jan Hubicka + + * function.c (clobber_return_register): Clobber the pseudo return + register too. + + * sibcall.c (skip_unreturned_value): New function. + (call_ends_block_p): Use it. + + * recog.c (split_insn): Break out from ... + (split_all_insns): ... here; do not use basic block information + when it is broken. + +Thu Jun 7 18:27:53 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Fix verification of + combined subreg. + +2001-06-08 Rainer Orth + + * config/mips/mips.h (CPP_SPEC): Simplify .s/.S handling. + Don't define _LANGUAGE_C and variants for .cpp/.cp/.c++ files. + Move definition of _LANGUAGE_C_PLUS_PLUS ... + (CPLUSPLUS_CPP_SPEC): ... here. + Fixes PRs c++/3047, target/441. + +2001-06-08 Gerald Pfeifer + + * doc/install.texi2html (MAKEINFO): Keep value if set already. + +2001-06-08 Joseph S. Myers + + * doc/gcc.texi: Add trailing slash to URL. + +2001-06-07 Stan Shebs + + * config/darwin.h (ENCODE_SECTION_INFO): Define. + (REDO_SECTION_INFO_P): Ditto. + (STRIP_NAME_ENCODING): Ditto. + (ASM_DECLARE_OBJECT_NAME): Use ENCODE_SECTION_INFO. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Ditto. + (ASM_OUTPUT_LABELREF): Use STRIP_NAME_ENCODING. + (GEN_LAZY_PTR_NAME_FOR_SYMBOL): Ditto. + * config/darwin.c: No longer include c-tree.h. + (machopic_classify_ident): Rewrite to use symbol encoding. + (lookup_name_darwin): Remove. + (machopic_non_lazy_ptr_name): Handle encoded symbols. + (machopic_stub_name): Use STRIP_NAME_ENCODING. + (machopic_validate_stub_or_non_lazy_ptr): Ditto. + (machopic_finish): Ditto, remove test of decl. + (update_non_lazy_ptrs): New function. + (darwin_encode_section_info): New function. + * config/darwin-protos.h: Declare it. + * config/rs6000/rs6000.c (machopic_output_stub): Use + STRIP_NAME_ENCODING. + +2001-06-07 Mark Mitchell + + * tree.h (DECL_SOURCE_FILE): Improve documentation. + (DECL_SOURCE_LINE): Likewise. + +2001-06-07 Loren J. Rittle + + * config/alpha/elf.h (MAKE_DECL_ONE_ONLY): Copy definition + from config/elfos.h. + +2001-06-07 Phil Edwards + + * linux.h (CPLUSPLUS_CPP_SPEC): Move -D_GNU_SOURCE to here. + * pa/pa-linux.h: Allow CPLUSPLUS_CPP_SPEC to remain. + +2001-06-08 Joseph S. Myers + + * doc/contrib.texi: Add copyright notice. + +2001-06-08 Joseph S. Myers + + * doc/md.texi: Use four digit years in copyright notice. + +2001-06-08 Joseph S. Myers + + * config.gcc: For $target_alias of athlon-*, set + target_cpu_default2=5. + +Thu Jun 7 16:17:40 2001 Richard Kenner + + * global.c (build_insn_chain): Allow ADDR_VEC or ADDR_DIF_VEC after + end of last block if last real insn is a JUMP_INSN. + +2001-06-07 Joseph S. Myers + + * NEWS: Regenerate. + +2001-06-07 Rainer Orth + + * gthr-posix.h (__gthread_objc_thread_detach): Simply cast + pthread_t to objc_thread_t. + (__gthread_objc_thread_id): Likewise. + +2001-06-07 Rainer Orth + + * alpha/osf5.h (CPP_XFLOAT_SPEC): Override default definition. + (ASM_OLDAS_SPEC): Likewise. + + * alpha/osf.h (CPP_XFLOAT_SPEC): Define. + (CPP_SUBTARGET_SPEC): Use it. + (ASM_OLDAS_SPEC): Define. + (ASM_SPEC): Use it. + (SUBTARGET_EXTRA_SPECS): Define, declare the new specs above. + +2001-06-07 Rainer Orth + + * config/alpha/alpha.c (alpha_va_arg): Handle TFmode, TCmode args, + passed by reference. + +2001-06-07 Joseph S. Myers + + * doc/tm.texi (TARGET_SWITCHES, TARGET_OPTIONS): Adjust markup. + Document use of N_(...), and show it in examples. Note that + documentation should be added to invoke.texi. Avoid an overfull + hbox. + +Thu Jun 7 17:09:50 CEST 2001 Jan Hubicka + + * toplev.c (rest_of_compilation): Revert previous patch. + * final.c (shorten_branches): Likewise. + +2001-06-07 Gerald Pfeifer + + * pself.c, pself1.c, pself2.c, pself3.c, pself4.c, pself5.c: + Remove. + +2001-06-07 Joseph S. Myers + + * doc/install-old.texi: Remove more obsolete documentation. + +Thu Jun 7 13:20:14 CEST 2001 Jan Hubicka + + * expr.c (copy_blkmode_from_reg): Fix operand_subword_force call. + +Thu Jun 7 12:12:58 CEST 2001 Jan Hubicka + + * toplev.c (rest_of_compilation): Call split_all_insns + before reg-stack and shorten-branches. Do shorten-branches + after reg-stack. + * final.c (shorten_branches): Remove insn splitting code. + +2001-06-07 Nathan Sidwell + + * configure.in (sparc*-*-*): Check assembler R_SPARC_UA32 support. + * configure: Rebuilt. + +2001-06-07 Andreas Jaeger + + * emit-rtl.c (operand_subword): Remove unused variable. + +Wed Jun 6 14:51:05 CEST 2001 Jan Hubicka + + * i386.md (floatdi?f): Avoid usinf of SSE instructions + if TARGET_64BIT is false. + (floatdi?f_i386_only): New insn. + (floatdi?f_i386): Disable for !TARGET_64BIT. + + * (min?f, max?f splitters): Handle case where + operands are cross-matched. + + * i386.h (HI_REGISTER_NAMES): Remove redundant definition + (MMX_REGISTER_NAMES): Kill. + (PRINT_OPERAND): Fix comment. + (PRINT_REG): Likewise. + * i386.c (print_reg): Kill support for 'm' CODE; simplify. + (print_operand): Update comment; kill 'm'. + + * i386.c (x86_branch_hints): New global variable + (print_operand): Support outputting of branch prediction hints. + * i386.md (conditional jump patterns): Add branch prediction hints + to the template. + * i386.h (x86_branch_hints): Declare + (TARGET_BRANCH_PREDICTION_HINTS): New macro. + (PRINT_OPERAND_FUNCT_VALID_P): New. + * final.c (final_forward_branch_p): New function. + +2001-06-06 Richard Henderson + + * flow.c (mark_used_reg): Clean up looping over multiple hard + registers. Do conditional life bits across multiple hard regs. + +2001-06-05 Jeffrey D. Oldham + + * reload1.c (reload): Revert Schmidt's change so all USEs are not + deleted during reload. + +2001-06-05 Mark Mitchell + + * c-semantics.c (genrtl_scope_stmt): Write out nested inline + functions here, instead of ... + * c-decl.c (c_expand_body): ... here. + +2001-06-05 David O'Brien + + * config.gcc, config/sparc/bsd.h: Do not directly include + sparc/sparc.h. Instead do it via tm_file. + +2001-06-05 Richard Henderson + + * dwarf2.h (DW_EH_PE_aligned): New. + * dwarf2asm.c (eh_data_format_name): Name it. + (dw2_asm_output_encoded_addr_rtx): Align for it. + * dwarf2out.c (output_call_frame_info): Handle it for personality + routine and LSDA pointers. + + * unwind-pe.h (DW_EH_PE_aligned): New. + (base_of_encoded_value): Handle it. + (read_encoded_value_with_base): Likewise. + * unwind-dw2-fde.c (base_from_object): Likewise. + (get_cie_encoding): Likewise. + + * config/alpha/elf.h: Remove ecoff commentary. + * config/alpha/osf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. + +2001-06-05 David O'Brien + + * config.gcc, config/i386/bsd386.h: Do not directly include + i386/386bsd.h. Instead do it via tm_file. + +2001-06-05 David O'Brien + + * elfos.h (USING_ELFOS_H): Identify the use of elfos.h in the same + way svr4.h does. + +2001-06-05 Pascal Obry + + * configure.in: Quote $enable_win32_registry in case the value has + spaces in it. + * configure: Ditto. + +2001-06-05 Mark Mitchell + + * print-rtl.c (xspaces): Remove. + (print_rtx): Use printf field-width, rather than xpsaces, to + indent. + * toplev.c (main): Disable sibling-call optimization if we are + handling exceptions. + +2001-06-05 Bernd Schmidt + + * reload1.c (reload): Delete all USEs generated during reload. + +2001-06-05 scott snyder + + * gccbug.in: Fix typo. + +2001-06-05 Andreas Jaeger + + * builtins.def: Fix definition of __builtin_cosf, it uses float as + parameter and return value. + +2001-06-04 Anthony Green + + * config/sparc/elf.h (CPP_PREDEFINES): Don't assert cpu or + machine. This is now done in sparc.h. + +2001-06-05 Nathan Sidwell + + Correct CVS resurrection of invoke.texi. + * doc/invoke.texi: Document new tree dump flags. + +2001-06-05 Joseph S. Myers + + * c-typeck.c (build_c_cast): Use TYPE_MAIN_VARIANT when checking + for casting an aggregate to its own type. Fixes PR c/2735. + +2001-06-05 Joseph S. Myers + + * doc/texinfo.tex: Update to version 2001-05-24.08. + +2001-06-05 Nathan Sidwell + + * c-common.h (flag_dump_translation_unit): Remove. + (enum tree_dump_index): Define. + (TDF_ADDRESS, TDF_SLIM): New #defines. + (dump_node_to_file): Remove. + (dump_node): Make extern. Add flags. + (dump_flag, dump_enabled_p, dump_begin, dump_end, + dump_switch_p): Prototype. + * c-common.c (flag_dump_translation_unit): Remove. + * c-decl.c (c_decode_option): Remove -fdump-translation-unit + logic. Use dump_switch_p. + * c-dump.h (struct dump_info): Add node and user fields. + (dump_pointer): Declare. + * c-dump.c (dump_node): Make extern. Add flags. + (SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines. + (dump_new_line, dump_maybe_newline): Use them. + (dump_pointer): New function. + (dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's + chain or function's body. Dump address, if TDF_ADDRESS set. + (dump_flag): Define. + (dump_node_to_file): Remove. + (struct dump_file_info): New struct. + (dump_files): New array. + (dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define. + * c-lang.c (finish_file): Adjust dumping. + * toplev.h (dump_base_name): Make extern. + * invoke.texi: Document new flags. + +2001-06-04 Mark Mitchell + + * c-tree.h (lang_decl): Add pending_sizes fields. + * c-decl.c (store_parm_decls): Save pending_sizes away for nested + functions. + (c_expand_body): Expand them. + (lang_mark_tree): Mark lang_decl:pending_sizes. + * function.c (expand_pending_sizes): New function, broken out + from ... + (expand_function_start): ... here. + * tree.h (expand_pending_sizes): Declare it. + +2001-06-04 Loren J. Rittle + + * doc/install.texi: Update FreeBSD information. Generalize + and update information for alpha-based platforms using ELF. + +2001-06-04 John David Anglin + + * c-decl.c (get_parm_info): Use INTEGRAL_TYPE_P. + (store_parm_decls): Likewise. + * c-typeck.c (convert_arguments): Likewise. + +2001-06-04 Richard Henderson + + * sibcall.c (optimize_sibling_and_tail_recursive_call): Suppress + optimization if current_function_calls_setjmp. + +2001-06-04 Joseph S. Myers + + * doc/c-tree.texi: Fix documentation of TREE_STRING_LENGTH for + wide strings. + +Mon Jun 4 20:44:25 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Fix combining of + paradoxical subregs. + +Mon Jun 4 20:15:25 CEST 2001 Jan Hubicka + + * rtlanal.c (rtx_unsable_p): ADDRESSOF is stable. + (no_labels_between_p): Short circuit case beg==end. + +Mon Jun 4 20:03:05 CEST 2001 Jan Hubicka + + * rtlanal.c (operand_preference): Fix preference for objects. + +Mon Jun 4 20:00:40 CEST 2001 Jan Hubicka + + * gcse.c (handle_avail_expr): Be prepared to handle single_set + parallels. + +Mon Jun 4 19:59:46 CEST 2001 Jan Hubicka + + * combine.c (if_then_else_cond): Use simplify_subreg instead + of operand_subword. + * integreate.c (sub_constants): Likewise. + +Mon Jun 4 19:59:12 CEST 2001 Jan Hubicka + + * emit-rtl.c (constant_subword): Deprecate; remove most of code + and use simplify_gen_subreg. + +Mon Jun 4 19:55:23 CEST 2001 Lars Brinkhoff + + * sibcall.c (skip_copy_to_return_value): recognize the situation + when the called function's return value is copied into an + intermediate pseudo, and then into the calling functions return + value register. + +Mon Jun 4 16:50:33 CEST 2001 Jan Hubicka + + * simplify_rtx.c (simplify_subreg): Keep subregs on return values, + check CLASS_CANNOT_CHANGE_MODE before avoiding subreg on hard reg, + in case register wasn't OK previously, accept it now; allow + subregs of frame pointer if reload completed and frame pointer + is not needed. + + * combine.c (sombine_simplify_rtx): Fix comment; + use subreg_lowpart_offset instead of subreg_lowpart_p + (gen_lowpart_for_combine): Use subreg_lowpart_offset. + * rtl.h (subreg_lowpart_parts_p): Kill. + (subreg_lowpart_offset, subreg_highpart_offset): Declare. + * simplify-rtx.c (simplify_subreg): Use subreg_lowpart_offset. + * emit-rtl.c (gen_lowpart_SUBREG): Use subreg_lowpart_offset; + (gen_lowpart_common): Likewise. + (subreg_lowpart_p): Likewise. + (subreg_lowpart_parts_p): Kill. + (subreg_lowpart_offset, subreg_highpart_offset): New function. + + * emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg + to simplify SUBREG and REG. + (gen_highpart): Use simplify_gen_subreg for all simplifications. + + * emit-rtl.c (gen_realpart, gen_imagpart): Do not handle + CONCAT specially. + + * rtlanal.c (replace_regs): Use simplify_gen_subreg + +Mon Jun 4 09:21:19 2001 Richard Kenner + + * doc/c-tree.texi (ARRAY_REF): Say what type of expression must be. + (ARRAY_RANGE_REF): Added description. + + * tree.def (ARRAY_RANGE_REF): New code. + * alias.c (handled_component_p, can_address_p): Handle it. + * dwarf2out.c (loc_descriptor_from_tree): Likewise. + * explow.c (set_mem_attributes): Likewise. + * expr.c (expand_assignment, get_inner_reference): Likewise. + (expand_expr, expand_expr_unaligned, do_jump): Likewise. + * fold-const.c (operand_equal_p): Likewise. + * tree.c (staticp, stabilize_reference): Likewise. + * varasm.c (decode_addr_const): Likewise. + +Sun Jun 3 21:59:51 2001 Richard Kenner + + * reload.c (reload_inner_reg_of_subreg): Return 1 for PLUS. + (push_reload): Handle non-REG in reload_inner_reg_of_subreg case. + +2001-06-03 kaz Kojima + + * gcc/config/sh/sh.c (print_operand_address, print_operand): Call + mark_constant_pool_use before output_addr_const. + (struct pool_node): New field wend. + (add_constant): Note a sequence of constants that are referenced + by a given label. + (pool_window_label, pool_window_last): New variables. + (dump_table): Emit a unspec_volatile representing the end of a + sequence of constants. + (mark_constant_pool_use): New function. + * gcc/config/sh/sh.md (UNSPECV_WINDOW_END): New constant. + (consttable_2): Add the second operand which flags whether + this consttable entry was used or not. + (consttable_4, consttable_8, consttable_sf, consttable_df): + Likewise. + (consttable_window_end): New insn. + +2001-06-03 Alexandre Oliva + + * insn-addr.h (INSN_ADDRESSES_NEW): Make insn_uid__ unsigned. + Reformat according to coding standards. + + Warning removal. + * config/sh/sh.c (print_operand_address): Cast INTVAL to int. + (shl_and_kind): Cast wide constant. + (gen_far_branch): Define as static, as in declaration. + (barrier_align): Compute cache-line length as unsigned. Add + parentheses in initial credit computation. + (rounded_frame_size): Add parentheses. + (permanent_obstack): Remove declaration. Include ggc.h for + declaration of ggc_add_root_rtx(). + (get_free_reg): Removed declaration of unused variable reg. + (legitimize_pic_address): Mark mode argument as unused. + +2001-06-03 Igor Shevlyakov + + * config/sh/sh.c (output_branch): Support for insn with lenght + attr 12 & 16 which represents cond branches outside +-4096 range. + +2001-06-03 Alexandre Oliva + + * config/sh/lib1funcs.asm (ic_invalidate): Align the + cache-mirroring sequence. Add nops. + +2001-06-03 Joseph S. Myers + + * doc/install-old.texi: Remove more old installation + documentation. + * doc/install.texi: Add relevant parts here. + +2001-06-03 Gerald Pfeifer + + * doc/install.texi2html: New script. + +2001-06-03 David Edelsohn + + * doc/install.texi: Update AIX information again. + +2001-06-02 Joseph S. Myers + + * doc/gcc.texi, doc/install-old.texi: Remove old system-specific + installation documentation. + * doc/install.texi: Move it to here. + +2001-06-02 Joseph S. Myers + + * doc/install.texi: Clean up Texinfo markup. + +2001-06-02 Joseph S. Myers + + * doc/cpp.texi, doc/cppinternals.texi, doc/gcc.texi: Move contents + to just after title page. + +2001-06-02 Joseph S. Myers + + * doc/install-old.texi: Remove documentation of some configuration + options. + * doc/install.texi: Add relevant parts of this documentation here. + +2001-06-02 Gerald Pfeifer + + * contrib.texi: Updated entries for Mark Mitchell, Joseph S. Myers, + Gerald Pfeifer, Bernd Schmidt, and Dean Wakerley. + +Sat Jun 2 12:23:51 CEST 2001 Jan Hubicka + + * i386.md (all uses of ext_register_operand): Make sure they are + VOIDmode; replace all uses outside zero_extend. + (and?i splitters): Use ext_register_operands. + (test?i peep2): Remove ignored constraints. + * i386.c (ext_register_operand): Check that operand is + either pseudo or hard or 'Q' register. + +Sat Jun 2 06:53:50 2001 Richard Kenner + + * tree.h (struct record_layout_info_s): New field unpadded_align. + (set_lang_adjust_rli): New declaration. + * stor-layout.c (layout_decl): If DECL is packed, but at alignment + it would have if not packed, do not downgrade DECL_ALIGN. + (lang_adjust_rli, set_lang_adjust_rli): New. + (start_record_layout): Initialize new field unpadded_align. + (debug_rli): Display it. + (place_union_field, place_field): Set it. + (layout_type, case RECORD_TYPE): Call via lang_adjust_rli if set. + + * print-tree.c (print_node): Don't print "regdecl" when bit doesn't + mean that; use proper names instead. + Print DECL_NO_STATIC_CHAIN. + + * except.c (expand_builtin_frob_return_addr): Add missing call + to convert_memory_address #ifdef POINTERS_EXTEND_UNSIGNED. + (expand_builtin_eh_return): Likewise. + (expand_eh_return): Clean up ptr_mode != Pmode cases. + +2001-06-01 Jan van Male + + * doc/invoke.texi: Remove references to papers about sequence points + to readings.html, refer to that page. + +2001-06-01 Gerald Pfeifer + + * README: Update references to installation instructions. + +2001-06-01 Laurent Guerby + Gerald Pfeifer + + * doc/install.texi: Define srcdir when sources come from CVS. + Significantly improve markup. Wrap overly long lines + +2001-06-01 DJ Delorie + + * c-tree.texi, contrib.texi, cpp.texi, cppinternals.texi, + extend.texi, fdl.texi, gcov.texi, invoke.texi, md.texi, + objc.texi, rtl.texi, tm.texi, texinfo.tex, gcc.1, cpp.1, + gcov.1: Move to doc subdirectory. + * install.texi: Move to doc/install-old.texi. + * gcc.texi: Move to doc, refer to install-old.texi. + * Makefile.in: Reflect move of docs to doc/. + * f/Make-lang.in: Ditto. + * java/Make-lang.in: Ditto. + * doc/.cvsignore: New. + +2001-05-31 Jan van Male + + * invoke.texi: use two spaces between command options, eliminate + some 'overfull hboxes' + +2001-06-01 Hans-Peter Nilsson + + * Makefile.in (s-mlib): Make backtick-commands always succeed. + (DRIVER_DEFINES): Ditto. + +2001-05-31 Richard Henderson + + * gcc.c (init_gcc_specs): When linking against libgcc_s.so, + also link against libgcc.a. + +2001-05-31 Geoff Keating + + * config/mips/mips.h (ASM_OUTPUT_ASCII): Convert to function. + * config/mips/mips.c (mips_output_ascii): New function. + * config/mips/mips-protos.h (mips_output_ascii): Prototype. + + * config/mips/mips.h (DWARF_CIE_DATA_ALIGNMENT): Force to 4. + +Thu May 31 19:09:53 CEST 2001 Jan Hubicka + + * flow.c (set_block_for_new_insns): Remove bogus shortcut. + * i386.c (ix86_expand_int_movcc): Force one of operands to be register. + +2001-05-31 Rodney Brown + + * install.texi (Configuration): Add html links for --with-gnu-as & + --with-gnu-ld and refer to them from hppa & SCO triplets. + (Specific): Link back to with-gnu-ld for all ELF platfoms. + (Specific): Reword AVR binutils recommendation. + +2001-05-30 Zack Weinberg + + * ggc-page.c (size_lookup): Increase minimum allocation size + to eight bytes. + (ggc_print_statistics): Report size of each bin in bytes, not + as its order; there is no longer a direct relationship. + +2001-05-31 Jan van Male + + * extend.texi: Fix formating of examples, eliminate some + 'overfull hboxes'. + * gcc.texi: Eliminate some 'overfull hboxes'. + * invoke.texi: Use two spaces between command options, eliminate + some 'overfull hboxes'. + +2001-05-30 Richard Henderson + + * dwarf2out.c (dwarf2out_finish): Don't emit DW_AT_stmt_list at -g1. + +2001-05-30 Tom Tromey + + * gcc.c (do_spec_1): In `%O' case, if we computed saved_suffix, + use it in the new association. + +2001-05-30 Loren J. Rittle + John David Anglin + + * gthr-posix.h (__gthread_active_ptr): Cast function pointer + to target type to allow ISO C++ compiler to accept it. + * gthr-dce.h (__gthread_active_ptr): Likewise. + * gthr-solaris.h (__gthread_active_ptr): Likewise. + +2001-05-30 Neil Booth + + * cpplex.c (_cpp_lex_token): Revert patch of 16 May 2001 + so that we do accept comments in preprocessed input. + +2001-05-30 Neil Booth + + * cpphash.c (alloc_node): Cast allocated pointer. + +2001-05-30 Gordon Sadler + + * invoke.texi (Option Summary): Remove -isystem-c++ from options. + +2001-05-29 Stan Shebs + + * gcc.texi: Add links for information about Objective-C. + +2001-05-29 Nathan Sidwell + + * configure.in (gcc_version): Remove unrequired \ on ". (Solaris + /bin/sed fails on [^\"]). + (configargs.h): Likewise. + +2001-05-29 Hartmut Schirmer + + * config/sh/sh.h (IDENT_ASM_OP): End with TAB, not LF. + +2001-05-28 Stan Shebs + + * objc/objc.gperf: Remove, no longer used. + +2001-05-28 Joseph S. Myers + + * c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi, + gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi: + Remove trailing whitespace. + +2001-05-28 Gerald Pfeifer + + * doc/install.texi (Specific): http://reality.sgi.com/ariel/freeware/ + became http://freeware.sgi.com/. + +2001-05-27 Geoffrey Keating + + * local-alloc.c (update_equiv_regs): Don't eliminate constant + expressions at -O0. + +2001-05-27 Stan Shebs + + * objc/objc-act.c: Add/fix various comments. + (init_selector): Remove, no longer used. + (build_msg_pool_reference): Ditto. + (objc_debug): Ditto. + +2001-05-27 Neil Booth + + * c-decl.c (init_decl_processing): + Don't call start_identifier_warnings. + * flags.h (warn_id_clash, id_clash_len): Remove. + * stringpool.c: Don't include flags.h. + (scan_for_clashes, do_identifier_warnings, + start_identifier_warnings): Remove. + * toplev.c (warn_id_clash, id_clash_len): Remove. + (display_help): Don't document -Wid-clash. + (decode_W_option): Print warning on -Wid-clash. + * tree.h (start_identifier_warnings): Remove. + * invoke.texi: Remove documentation of -Wid-clash. + +2001-05-27 Kaveh R. Ghazi + + * fixinc/fixtests.c: Declare entries in ENV_TABLE. + +2001-05-27 Bruce Korb + + * fixinc/check.tpl(HACK) add and use a Scheme variable + (has no test text): error out if no "test_text" is defined + * fixinc/fixincl.tpl: likewise + (FIXIDX): make it an enumeration so we minimize diffs + * fixinc/inclhack.def: re-alphabetize and add sort instructions + * fixinc/fixincl.x: regenerate + * fixinc/tests/base/stdio.h: test output got moved due to + the alphabetizing + * README-fixinc: rewrite (mostly) + +2001-05-27 Neil Booth + + * cpplib.c (run_directive): Set pfile->directive. + +2001-05-23 Theodore Papadopoulo + + * c-tree.texi: Reformat the manual as a single chapter now + included by gcc.texi. + * gcc.texi: Include c-tree.texi. Merge all indexes. + * Makefile.in (dvi): Add generation for the cppinternals + documentation. Added dependencies on fdl.texi and c-tree.texi + where appropriate. Use TEXI2DVI instead of custom tex calls. + (info): Added dependencies on fdl.texi and c-tree.texi where + appropriate. Remove the target c-tree.info. + +2001-05-27 Lars Brinkhoff + + * combine.c (try_combine): Fix typo in comment. + * expr.c (expand_expr): Likewise. + * config/i370/i370.md (untyped_call): Likewise. + +2001-05-26 Bruce Korb + + * fixinc/fixtests.c(stdc_0_in_system_headers_test): Must return "FIX" + when fixincl is operating in test mode + * fixinc/inclhack.def(AAB_dgux_int_varargs) : aesthetics + (AAB_ultrix_limits): remove redundant text + (AAB_ultrix_memory): ditto + (AAB_ultrix_string): ditto + (djgpp_wchar_h): fix the test text + (irix_stdio_va_list): add test text + (irix_limits_const): add a testing output file (limits.h is overwritten) + (strict_ansi_not_ctd): put limits.h second in list for same reason + (solaris27_mutex_init): test text needed selection text, too + + * fixinc/fixtests.c(stdc_0_in_system_headers_test): Must return "FIX" + when fixincl is operating in test mode + +2001-05-26 Philip Blundell + + * config/c4x/c4x-protos.h: Use GCC_C_PRAGMA_H in place of _C_PRAGMA_H. + * config/i960/i960-protos.h: Likewise. + * config/i370/i370-protos.h: Likewise. + * config/h8300/h8300-protos.h: Likewise, + * config/sh/sh-protos.h: Likewise. + * config/v850/v850-protos.h: Likewise. + +2001-05-26 Philip Blundell + + * config/arm/arm-protos.h: Use GCC_C_PRAGMA_H in place of _C_PRAGMA_H. + +2001-05-25 Zack Weinberg + + * toplev.c (debug_args, f_options, W_options): Mark + descriptions for translation. + (display_help): Translate descriptions on output. + + * cp/lang-options.h, f/lang-options.h, java/lang-options.h, + objc/lang-options.h: Mark descriptions for translation. + + * aclocal.m4: Quote final argument of patsubst. Use + 3-argument form of AC_DEFINE. Restore quotes to [] while + using AC_FD_CC. + * configure.in: Remove unnecessary changequote calls. + * configure, config.in: Regenerate. + +2001-05-25 Sam TH + + * basic-block.h: Fix header include guards. + * bitmap.h c-dump.h c-lex.h c-pragma.h c-tree.h collect2.h + cppdefault.h cpphash.h cpplib.h defaults.h diagnostic.h errors.h + except.h flags.h gcc.h gcov-io.h graph.h gstab.h gthr-aix.h + gthr-dce.h gthr-posix.h gthr-rtems.h gthr-single.h gthr-solaris.h + gthr-vxworks.h gthr-win32.h gthr.h hard-reg-set.h hwint.h + insn-addr.h libgcc2.h mbchar.h mkdeps.h params.h prefix.h real.h + rtl.h sbitmap.h system.h timevar.h toplev.h tradcpp.h tsystem.h + varray.h version.h: Likewise. + * config/dbxelf.h config/fp-bit.h config/arm/arm-protos.h + config/arm/arm.h config/c4x/c4x-protos.h + config/h8300/h8300-protos.h config/h8300/h8300.h + config/i370/i370-protos.h config/i370/i370.h + config/i960/i960-protos.h config/mcore/mcore.h + config/mips/mips-protos.h config/sh/sh-protos.h config/sh/sh.h + config/v850/v850-protos.h config/v850/v850.h: Likewise. + * fixinc/fixlib.h fixinc/server.h: Likewise. + +2001-05-25 Stacey Sheldon + + * config/arc/initfini.c (.init): Fix typo. + +2001-05-25 Geoffrey Keating + + * config/rs6000/rs6000.md (fseldfsf4): Correct mode of operand 4. + +2001-05-25 Rainer Orth + + * i386/i386.h (CC1_CPU_SPEC): Clarify -m486 etc deprecation messages. + +2001-05-25 Richard Henderson + + * libgcc-std.ver: Export XFmode and TFmode versions of symbols. + +2001-05-25 Richard Henderson + + * config.gcc (all gnu and linux): Use t-slibgcc-elf-ver with t-linux. + (i386-*-solaris2): Use t-slibgcc-elf-ver or t-slibgcc-sld. + (sparc*-*-solaris2): Likewise. + * config/t-linux: Remove shared libgcc macros. + * config/t-slibgcc-elf-ver: Move from sparc/t-slibgcc. + * config/t-slibgcc-sld: Move from sparc/t-slibgcc-sld. + +2001-05-25 Loren J. Rittle + + * config.gcc (*-*-freebsd*): Report bad configuration. + +2001-05-25 David Edelsohn + + * xcoffout.h (DBX_OUTPUT_GCC_MARKER): Do not emit any marker. + + * config/rs6000/aix.h (USER_LABEL_PREFIX): AIX symbols do not have + any prefix. + (ASM_OUTPUT_LABELREF): Delete. + +2001-05-25 Rainer Orth + + * fixinc/inclhack.def (strict_ansi_not, strict_ansi_not_ctd, + strict_ansi_only): Don't run if stdc_0_in_system_headers. + * fixinc/fixincl.x: Regenerate. + * fixinc/fixtests.c (stdc_0_in_system_headers_test): New function. + (FIX_TEST_TABLE): Declare it. + * fixinc/fixlib.h: Include config.h. + +2001-05-25 Rainer Orth + + * fixinc/inclhack.def (alpha___assert): Change char * args to + const char * on Tru64 UNIX to avoid excessive warnings from + assert.h. + * fixinc/fixincl.x: Regenerate. + +2001-05-25 Geoff Keating + + * dbxout.c (dbxout_symbol): Invert previous patch, which was + outputting a tag only for variable-size records. + +2001-05-25 Jeff Knaggs + + * config/alpha/alpha.md (movtf_internal): Use reg_overlap_mentioned_p + instead of rtx_equal_p for early clobber test. + +2001-05-26 Mark Mitchell + + * builtins.def: Encode additional information, such as names and + types, here. + * builtin-types.def: New file. + * builtins.c (built_in_names): Adjust use of DEF_BUILTIN. + (built_in_decls): Likewise. Don't explicitly initialize global + data to NULL. + (expand_builtin_mathfn): Handle float and long double variants of + math builtins. + (expand_builtin): Likewise. + * c-common.c (c_common_nodes_and_builtins): Make it table-driven. + (expand_tree_builtin): Handle long, long long, float, and long + double variants of math functions. + * c-common.h (c_tree_index): Remove some unused nodes. + (void_ftype): Remove. + (void_type_ptr): Likewise. + (int_ftype_int): Likewise. + (ptr_ftype_sizetype): Likewise. + * c-decl.c (init_decl_processing): Remove creation of DWARF + builtins. + * defaults.h (MD_INIT_BUILTINS): Provide default definition. + * tree.h (built_in_function): Adjust definition of DEF_BUILTIN. + * Makefile.in (c-common.o): Depend on builtin-types.def. + +2001-05-25 Dale Johannesen + + * config/rs6000/t-darwin: Fix dependencies for darwin.o. + +2001-05-25 Neil Booth + + * c-parse.in (notype_initdcl): Remove redundant line. + +2001-05-25 Rainer Orth + + * aclocal.m4: Fixed typo. + (gcc_AC_HEADER_STDBOOL): Define. + (gcc_AC_C__BOOL): Define. + * configure.in: Use them. + (AC_CHECK_HEADERS): Remove stdbool.h + * configure, config.in: Regenerate. + +2001-05-25 Richard Henderson + + * function.c (expand_function_start): Don't abort on PARALLEL + returns from hard_function_value. + +2001-05-25 Richard Henderson + + * config/i386/i386.md: Revert previous change. Do not apply + the peephole if the components do not die after the sequence. + +2001-05-25 Joseph S. Myers + + * c-parse.in (array_declarator): New. Handle C99 constructs. + Don't restrict [*] declarators to C only. + (after_type_declarator, parm_declarator_starttypename, + parm_declarator_nostarttypename, notype_declarator, + direct_absdcl1): Use it. + * c-decl.c (build_array_declarator, set_array_declarator_type): + New functions. Warn that [*] isn't properly implemented; pedwarn + for [*] outside C99 mode if pedantic rather than giving a hard + error. + (grokdeclarator): Handle static and type qualifiers in parameter + array declarators. + * c-tree.h (build_array_declarator, set_array_declarator_type): + Declare. + * extend.texi (Attribute Syntax): Document attributes in parameter + array declarators. + +2001-05-25 Mark Mitchell + + * config/i386/i386.md: Make sure cmpstr peepholes do not + affect liveness information. + +2001-05-24 Mark Mitchell + + * c-typeck.c (digest_init): Issue error messages about + invalid constants, not warnings. + +2001-05-24 Mark Mitchell + + * invoke.texi (-fno-builtin): Document that this is always on + in C++. + +2001-05-24 Philip Blundell + + * doc/install.texi (arm*-*-linux-gnu): Say that binutils 2.10 is + required. + +2001-05-24 Philip Blundell + + * config/arm/arm.c (output_return_instruction): Correctly handle + interworking and interrupt functions. + +2001-05-24 Philip Blundell + + * config/arm/arm.h (TARGET_SWITCHES): Correct misleading help for + -m{no-}sched-prolog. Fix typos and improve formatting. + +2001-05-24 Philip Blundell + + * invoke.texi (ARM Options): Improve wording slightly. Add + documentation for more options, including those for Thumb mode. + Don't mention options that don't exist or are unimplemented. + (Thumb Options): Delete; merged into above section. + +2001-05-24 Geoff Keating + + * config/rs6000/linux.h (SIGNAL_FRAMESIZE): Define. + (MD_FALLBACK_FRAME_STATE_FOR): Use it. + +Thu May 24 19:47:19 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Fix CONCAT simplification; + fix hard register simplification. + +Thu May 24 00:15:17 2001 Rainer Orth + + * sparc/sol2.h (CPLUSPLUS_CPP_SPEC): Add all of CPP_SPEC instead + of just copying CPP_CPU_SPEC. + +Thu May 24 15:56:48 CEST 2001 Jan Hubicka + + * i386.c (incdec_operand): Accept only 1 and -1. + +2001-05-23 Kelley Cook + + * Makefile.in: Move many of the *_H definitions eariler in the + file, so that rules in t-* files that use them for + dependencies will work in a parallel build. + * config/i386/t-cygwin (winnt.o): Depend on $(CONFIG_H). + +2001-05-23 Richard Henderson + + * integrate.c (expand_inline_function): Handle CONCAT DECL_RESULT. + +2001-05-23 Neil Booth + + * cpp.texi: Update for handling of charconsts. + * cpplex.c (maybe_read_ucs): Don't accept D800-DFFF. Update + diagnostics. Skip to the end if the UCS is too short. + (cpp_interpret_charconst): Long charconsts issue a warning + not an error. + +2001-05-23 Richard Henderson + + * doc/install.texi (alpha-linux): Require binutils 2.11. + +2001-05-23 Neil Booth + + * c-lex.c (read_escape, read_ucs): Delete. + (lex_string): Use cpp_parse_escape. + * cpplex.c (read_ucs): Rename maybe_read_ucs. Do nothing + if not C++ or not C99. Warn if traditional. + (parse_escape): Rename cpp_parse_escape. Make the bitmask + unsigned. Warn for out-of-range escape sequences here. + Update to use maybe_read_ucs. + (cpp_interpret_charconst): Don't warn here. + * cpplib.h (cpp_parse_escape): New exported function. + +2001-05-23 Joseph S. Myers + + * extend.texi (Attribute Syntax): Clarify application of + attributes to parameters declared as functions or arrays. + +2001-05-23 Jason Merrill + + * dbxout.c (dbxout_type_methods): Do still group methods by name. + +2001-05-23 Zack Weinberg + + * diagnostic.c (vnotice): Kill. + (fnotice): Call vfprintf directly. + (diagnostic_for_decl, output_do_verbatim, output_verbatim, + verbatim, set_diagnostic_context): Rename string argument to + indicate that it is run through gettext. + (vbuild_message_string, build_message_string, output_do_printf): + Rename string argument to indicate that it is NOT run through + gettext. + (output_printf, diagnostic_for_decl, fatal_io_error, sorry, + output_do_verbatim, set_diagnostic_context, fnotice, _fatal_insn): + Run msgid argument through gettext. + (default_print_error_function): Run constant strings through + gettext when nothing else will. + (fatal_error, internal_error, error_recursion): Use fnotice. + Present complete sentences to gettext. + +2001-05-23 Mark Mitchell + + * jump.c (mark_jump_label): Fix thinko in 2001-05-19 change. + +2001-05-23 Richard Henderson + + * function.c (expand_function_start): Always use a pseudo + for the function result value. + +2001-05-22 Richard Henderson + + * config/mips/iris6.h (EH_FRAME_SECTION_ASM_OP): Give the + section pointer alignment. + + * doc/install.texi (alpha-linux): Require binutils >= 2.10. + + * unwind-dw2-fde.c (__deregister_frame_info): Stringize use + of __USER_LABEL_PREFIX__. + +2001-05-22 Richard Henderson + + * unwind-dw2-fde.c (__deregister_frame_info): Stubbify in favor of... + (__deregister_frame_info_bases): New. + * unwind-dw2-fde.h: Declare it. + * libgcc-std.ver: Export it. + * crtstuff.c (__do_global_dtors_aux): Call it if we would have + called __register_frame_info_bases. + +2001-05-22 Loren J. Rittle + + * config/freebsd.h (FBSD_CPP_PREDEFINES): Use #endif/#if pair + instead of #elif (which is OK for this case but not in general). + +2001-05-22 Andrew MacLeod + + * builtins.c (expand_builtin_longjmp): A longjmp can be a call too. + * config/ia64/ia64.md (nonlocal_goto): Reverse label and frame pointer + parameters to __ia64_nonlocal_goto. Flag as NO_RETURN. + * config/ia64/ia64.c (ia64_expand_epilogue): Make sure we are issuing + "r2" to the assembly file. Only issue allocs with nonzero parameters. + +2001-05-22 Loren J. Rittle + David O'Brien + + * config/freebsd.h (LIB_SPEC): Key the exact setting to + configure-time options and target version of FreeBSD. Set-up + to match architectural change in threading support. Correctly + report when -pthread option is not supported by configure-time + options. + (FBSD_CPP_PREDEFINES): Move from architecture-specific files + and extend to encode target version number in run-time setting + of __FreeBSD__ macro to match the system compiler. + (CPP_PREDEFINES): Likewise. + (PREFERRED_DEBUGGING_TYPE): Change to DWARF2_DEBUG. + + * config/alpha/freebsd.h (CPP_PREDEFINES): Moved to common freebsd.h. + * config/i386/freebsd.h (CPP_PREDEFINES): Likewise. + +2001-05-22 Loren J. Rittle + David O'Brien + + * config.gcc (the unlabeled system switch statement): Add + generic configuration section to handle *-*-freebsd*. Also, + to match the system compiler, default to threading support (it + may be disabled with the standard --disable-threads + configuration-time switch). + (i[34567]86-*-freebsd* in machine-specific section): Use it. + (alpha*-*-freebsd* in machine-specific section): Likewise. + + * config/freebsd3.h: New file to expose FBSD_MAJOR macro (3). + * config/freebsd4.h: New file to expose FBSD_MAJOR macro (4). + * config/freebsd5.h: New file to expose FBSD_MAJOR macro (5). + * config/freebsd6.h: New file to expose FBSD_MAJOR macro (6). + * config/freebsd-nthr.h: New file to expose FBSD_NO_THREADS macro. + +2001-05-22 Loren J. Rittle + David O'Brien + + * config/t-freebsd (TARGET_LIBGCC2_CFLAGS): Add -fPIC. + * config/t-freebsd-thread (TARGET_LIBGCC2_CFLAGS): Add + -pthread instead setting macro. + +2001-05-22 Richard Henderson + + * crtstuff.c (__register_frame_info_bases): Declare. + (frame_dummy): Use it, if CRT_GET_RFIB_TEXT or CRT_GET_RFIB_DATA. + (__do_global_dtors_aux, __do_global_dtors): Streamline. + + * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. + (CRT_GET_RFIB_DATA): New. + * config/i386/sysv4.h: Likewise. + * config/i386/sco5.h: Likewise. + (ASM_PREFERRED_EH_DATA_FORMAT): New. + +2001-05-22 Richard Henderson + + * rtl.c (read_string): Break out from ... + (read_rtx): ... here. + +2001-05-22 Gerald Pfeifer + + * doc/install.texi (Specific): Remove a bogus and duplicate part + copied from the end of the document. + +2001-05-22 Bernd Schmidt + + * Makefile.in (LIBGCC_DEPS): Correct LIB1ASMSRC dependency. + +2001-05-22 Gerald Pfeifer + + * install.texi: Remove obsolete information on SunOS as well as + i386-sun-sunos4, i860-intel-osf1, and powerpcle-*-solaris2*. + (Installing GNU CC on the Sun): Remove section. + +2001-05-22 Alexandre Oliva + + * cppfiles.c (remove_component_p): Don't assume lstat/stat will + keep errno unchanged on success. + +2001-05-22 Joseph S. Myers + + * c-lex.c (lex_number): If pedantic and not C99, pedwarn exactly + once for hexadecimal floats, whether or not they contain a decimal + point. Don't let the setting of pedantic otherwise affect the + parsing of hexadecimal floats. + +2001-05-22 Gerald Pfeifer + + * README.ACORN: Remove obsolete file. + +2001-05-22 Jan Hubicka + + * combine.c (gen_binary): Use swap_commutative_operands_p + (simplify_comparison): Likewise. + * expmed.c (emit_store_flag): Likewise. + * expr.c (compare_from_rtx): Likewise. + (do_compare_rtx_and_jump): Likewise. + * optabs.c (emit_cmp_and_jump_insn): Revert last patch; abort + if not emitting a branch and operands want swapping. + +2001-05-22 Neil Booth + + * c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one. + * stringpool.c: (IS_FE_IDENT, make_identifier): Delete. + (maybe_get_identifier): Update. + * tree.h (make_identifier): Delete. + +2001-05-21 Richard Henderson + + * combine.c (subst): Do not substitute for a register as + a destination subreg/strict_low_part/zero_extract. + + * combine.c (simplify_comparison): Update op1 after constant + extension. + * recog.c (const_int_operand): Accept only constants valid + for the given mode. + * genrecog.c: Update comments wrt const_int_operand. + + * emit-rtl.c (init_emit_once): Zero unused memory in a + CONST_DOUBLE. + +2001-05-21 Mark Mitchell + + * tree.h (type_num_arguments): Declare it. + * tree.c (type_num_arguments): New function. + +2001-05-21 Richard Henderson + + * dwarf2out.c (current_funcdef_number): Move outside dwarf2 + conditional ifdef. + +2001-05-21 Geoff Keating + + * config/rs6000/rs6000.md (maxsf3): Use rs6000_emit_minmax. + (maxsf3+1): Delete. + (minsf3): Use rs6000_emit_minmax. + (minsf3+1): Generalize to handle both SMIN and SMAX. Use + rs6000_emit_minmax. + (movsfcc): Use rs6000_emit_cmove. + (fselsfsf4): Don't compare a CONST_INT with a floating-point value. + Don't generate emit_fselsfsf4. + (fseldfsf4): Likewise. + (maxdf3): Use rs6000_emit_minmax. + (maxdf3+1): Delete. + (mindf3): Use rs6000_emit_minmax. + (mindf3+1): Generalize to handle both SMIN and SMAX. Use + rs6000_emit_minmax. + (movdfcc): Use rs6000_emit_cmove. + (fseldfdf4): Don't compare a CONST_INT with a floating-point value. + Don't generate emit_fselsfsf4. + (fselsfdf4): Likewise. + * config/rs6000/rs6000.c (zero_fp_constant): New predicate. + (min_max_operator): New predicate. + (rs6000_emit_cmove): New function. + (rs6000_emit_minmax): New function. + * config/rs6000/rs6000-protos.h: Prototype new functions. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add zero_fp_constant + and min_max_operator. + + * config/rs6000/rs6000.c (output_cbranch): Handle all + conditional types in the switch statement. + +2001-05-21 Mark Mitchell + + * c-decl.c (finish_decl): Don't set DECL_C_HARD_REGISTER for + non-register variables. + * extend.texi: Document that asm-specifications do not make sense + for non-static local variables. + +2001-05-21 Jason Merrill + + * dbxout.c (MINIMAL_DEBUG, flag_minimal_debug): Lose. + (dbxout_type_fields): Lose minimal_debug support. + (dbxout_type_methods, dbxout_type): Likewise. + +2001-05-17 Andrew Haley + + * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New. + +2001-05-21 Richard Henderson + + * dwarf2out.c (DEBUG_FRAME_SECTION): Rename from FRAME_SECTION. + Update all users. + +2001-05-20 Richard Henderson + + * dwarf2out.c (DEBUG_ABBREV_SECTION, DEBUG_ARANGES_SECTION, + DEBUG_MACINFO_SECTION, DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, + DEBUG_STR_SECTION): Rename from s/DEBUG_//. Update all users. + * dwarfout.c (DEBUG_SFNAMES_SECTION, DEBUG_SRCINFO_SECTION, + DEBUG_MACINFO_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_ARANGES_SECTION): + Likewise. + * config/mips/iris6.h (DEBUG_SFNAMES_SECTION, DEBUG_SRCINFO_SECTION, + DEBUG_MACINFO_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_ARANGES_SECTION, + DEBUG_FRAME_SECTION, DEBUG_ABBREV_SECTION): Rename as above. + (DEBUG_LOC_SECTION, DEBUG_STR_SECTION): New. + * config/ia64/ia64.h (DEBUG_ABBREV_SECTION, DEBUG_ARANGES_SECTION, + DEBUG_PUBNAMES_SECTION): Rename as above. + (DEBUG_MACINFO_SECTION, DEBUG_LOC_SECTION, DEBUG_STR_SECTION): New. + +2001-05-20 Richard Henderson + + * optabs.c (emit_cmp_and_jump_insns): Don't swap commutative + operands unless the operation is commutative. + +2001-05-20 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_p): Detect more non-negative + cases. + +2001-05-21 Joseph S. Myers + + * extend.texi: Clarify documentation of extensions included in ISO + C99. Prefer C99 terminology and syntax to old GNU terminology and + syntax. Add more index entries. Document mixed declarations and + code as an extension in C89 mode. Warn about future changes to + semantics of inline functions. Fixes PR other/930. + +Sun May 20 16:39:24 2001 Richard Kenner + + * expr.c (expand_expr, case ARRAY_REF): Don't fold constant + access if EXPAND_CONST_ADDRESS or EXPAND_INITIALIZER. + (expand_expr, case COMPONENT_REF): Do copy if misaligned even + if EXPAND_CONST_ADDRESS or EXPAND_INITIALIZER. + + * stmt.c (expand_decl): Set mode, alignment, and sizes for CONST_DECL. + +2001-05-20 Richard Henderson + + * sched-deps.c (sched_analyze_insn): Force volatile memory reads + to be output before a branch. + +2001-05-20 Richard Henderson + + * Makefile.in (dwarf2asm.o): Depend on $(TREE_H). + +2001-05-20 Richard Henderson + + * config/i386/att.h (ASM_SHORT, ASM_LONG): Add trailing \t. + (ASM_DOUBLE): Remove. + * config/i386/bsd.h, config/i386/sco5.h: Likewise. + * config/i386/sun386.h: Likewise. + + * config/i386/i386.h (UNALIGNED_SHORT_ASM_OP): New. + (UNALIGNED_INT_ASM_OP, INT_ASM_OP): New. + + * config/i386/cygwin.h (INT_ASM_OP): Remove. + * config/i386/freebsd-aout.h, config/i386/i386-aout.h: Likewise. + * config/i386/i386-coff.h, config/i386/i386-interix.h: Likewise. + * config/i386/netbsd.h, config/i386/openbsd.h: Likewise. + + * config/i386/cygwin.h: Adjust uses of ASM_LONG for trailing \t. + * config/i386/djgpp.h, config/i386/i386.h: Likewise. + * config/i386/i386elf.h, config/i386/ptx4-i.h: Likewise. + * config/i386/sco5.h, config/i386/svr3gas.h: Likewise. + * config/i386/sysv4.h, config/i386/vsta.h: Likewise. + * config/i386/win32.h: Likewise. + +2001-05-20 Joseph S. Myers + + * invoke.texi: Add more options to summary list. + +2001-05-20 Joseph S. Myers + + * invoke.texi: Document meaning of -pedantic when -std=gnu* is + used. Fixes PR c/2291. + * gcc.1: Regenerate. + +2001-05-20 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_override_options): Ignore + the -fpic and -fPIC options, clear flag_pic. + +2001-05-20 Neil Booth + + * hashtable.c (calc_hash): Fix HASHSTEP definition. + * stringpool.c (make_identifier): No statistics here anymore. + * objc-act.c (steup_string_decl): Remove redundant check. + +2001-05-20 Neil Booth + + * Makefile.in (OBJS, LIBCPP_OBJS, LIBCPP_DEPS, + cpplib.o, cpphash.o, fix-header): Update. + (hashtable.o): New target. + * c-common.h: Include cpplib.h. Define C_RID_CODE and + struct c_common_identifier here. + * c-lang.c (c_init_options): Update. Call set_identifier_size. + * c-lex.c (c_lex): Update. + * c-pragma.h: Update. + * c-tree.h (struct lang_identifier): Contain c_common_identifier. + Delete rid_code. + (C_RID_CODE): Delete. + * cpphash.c: Rewrite to use hashtable.c. + * cpphash.h: Update include guards. + (struct cpp_reader): Remove hashtab. + hash_ob and buffer_ob are no longer pointers. Add hash_table + and our_hashtable. + (HASHSTEP, _cpp_init_hashtable, _cpp_lookup_with_hash): Delete. + (_cpp_cleanup_hashtable): Rename _cpp_destroy_hashtable. + (_cpp_cleanup_stacks): Rename _cpp_init_directives. + * cppinit.c (cpp_create_reader): Update. + * cpplex.c (cpp_ideq, parse_identifier, cpp_output_token): Update. + (cpp_interpret_charconst): Eliminate warning. + * cpplib.c (do_pragma, do_endif, push_conditional, + cpp_push_buffer, cpp_pop_buffer): Update. + (_cpp_init_stacks): Rename cpp_init_directives. + (_cpp_cleanup_stacks): Remove. + * cpplib.h: Update include guards. Include tree-core.h and c-rid.h. + (cpp_hashnode, cpp_token, NODE_LEN, NODE_NAME, + cpp_forall_identifiers, cpp_create_reader): Update. + (C_RID_CODE, cpp_make_node): New. + (c_common_identifier): New identifier node for C front ends. + * cppmain.c (main): Update. + * fix-header.c (read_scan_file): Update. + * flags.h (id_clash_len): Make unsigned. + * ggc.h (ggc_mark_nonnull_tree): New. + * hashtable.c: New. + * hashtable.h: New. + * stringpool.c: Update comments and copyright. Update to use + hashtable.c. + * toplev.c (approx_sqrt): Move to hashtable.c. + (id_clash_len): Make unsigned. + * toplev.h (ident_hash): New. + * tree.c (gcc_obstack_init): Move to hashtable.c. + * tree.h: Include hashtable.h. + (IDENTIFIER_POINTER, IDENTIFIER_LENGTH): Update. + (GCC_IDENT_TO_HT_IDENT, HT_IDENT_TO_GCC_IDENT): New. + (struct tree_identifier): Update. + (make_identifier): New. +cp: + * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. + (C_RID_CODE): Remove. + * lex.c (cxx_init_options): Call set_identifier_size. Update. + (init_parse): Don't do it here. +objc: + * objc-act.c (objc_init_options): Call set_identifier_size. Update. + +Sat May 19 18:23:04 2001 Richard Henderson + + * except.c (dw2_build_landing_pads): Use word_mode, not Pmode, + as ncessary. + (expand_eh_return): Convert between word_mode and Pmode. + * unwind-dw2.c (extract_cie_info): Do not assume words and pointers + are the same size. + (execute_stack_op): Likewise. + (execute_cfa_program): Likewise. + (uw_frame_state_for): Likewise. + (uw_update_context_1): Likewise. + * unwind.inc (_Unwind_Reason_Code): Likewise. + * config/mips/mips.h (EH_RETURN_DATA_REGNO): Define. + (EH_RETURN_STACKADJ_RTX): Likewise. + * config/mips/mips.c (compute_frame_size): Make space for saving + EH return registers. + (mips_expand_epilogue): Handle EH stack adjustments. + * config/mips/mips.md (eh_return): New pattern. + (eh_set_lr_si): Likewise. + (eh_set_lr_di): Likewise. + Add splitter to perform EH return after reload. + +2001-05-19 Mark Mitchell + + * jump.c (mark_jump_label): Tidy previous change. + +2001-05-19 Bruce Korb + + * fixinc/genfixes: no need for two warnings + * fixinc/Makefile.in: open stdin for those building with a closed one. + +2001-05-19 Mark Mitchell + + * jump.c (jump_optimize_1): Tidy. + (mark_jump_label): When changing the label in a LABEL_REF, change + update any REG_EQUAL notes as well. + +2001-05-19 Joseph S. Myers + + * c-parse.in (parm_declarator): Split into + parm_declarator_starttypename and parm_declarator_nostarttypename. + (parm_declarator_starttypename, parm_declarator_nostarttypename): + New. Allow parenthesized sub-declarators which don't begin with a + TYPENAME. Fixes PR c/166. + +2001-05-19 Mark Mitchell + + * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New + macro. + * tm.texi (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): + Document it. + * toplev.c (main): If the target does not allow profiling without + a frame pointer, issue an error message. + * config/i386/linux.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): + Define it to false. + +Sat May 19 07:53:42 2001 Richard Kenner + + * recog.c (general_operand): Modify last change to allow it if reload + has completed. + +Sat May 19 10:23:54 CEST 2001 Jan Hubicka + + * recog.c (general_operand): Prohibit nonzero subreg bytes on + subregs containing mem. + +Sat May 19 09:40:45 2001 Denis Chertykov + + * regrename.c (regrename_optimize): frame pointer register can + use a few hardregs. + +2001-05-18 Jason Merrill + + * README.DWARF: Move into dwarfout.c. + +2001-05-18 Dale Johannesen + + * config/rs6000/rs6000.c (secondary_reload_class): Fix Darwin + specific misuse of r0 as a reload address. + +Fri May 18 22:42:04 CEST 2001 Jan Hubicka + + * combine.c (combine_simplify_rtx): Clear op0_mode if simplification + succeeded. + +Fri May 18 07:26:34 2001 Richard Kenner + + * genrecog.c (enum decision_type): Add DT_elt_zero-wide_safe. + (add_to_sequence): Make that decision type. + (maybe_both_true_2, nodes_identical_1, factor_tests): Use it. + (write_switch, write_cond, debug_decision_2): Likewise. + + * dbxout.c (dbxout_type): Use host_integerp and fix typo in testing + for INTEGER_TYPE. + (dbxout_symbol, case TYPE_DECL): Don't generate tag for records of + variable size. + +2001-05-18 Stan Shebs + + * configure.in (gcc_cv_as_eh_frame): Cope with old assemblers. + * configure: Regenerate. + +2001-05-18 Per Bothner + + Changes needed for java/jvspec.c + * gcc.h (n_infiles, outfiles): Add declarations. + * gcc.c (n_infiles, outfiles): Mske no longer static. + +Fri May 18 10:14:42 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/som.h (EXCEPTION_SECTION): Define. + +2001-05-18 Daniel Berlin + + * dwarf2out.c: Add dw_loc_list_ref, a reference to a location + list. + Add have_location_lists, a variable to determine whether we need a + .debug_loc section or not. + (enum dw_val_class): Add dw_val_class_loc_list. + (dw_val_struct): Add val_loc_list. + (dw_loc_list_struct): New structure, represents location lists. + (new_loc_list): New function, return a new location list, given + the range and location expression. + (add_loc_descr_to_loc_list): New function, add a location + expression to a location list, given the expression and range. + (output_loc_list): New function, output a location list. + (gen_internal_sym): Modified to take symbol prefix, so we can + reuse it for location list symbols. + (add_AT_loc_list): New function, add a location list to a DIE at + the named attribute. + (AT_loc_list): New function, return the location list reference + for a given attribute, if it's a location list. + (print_die): Handle dw_val_class_loc_list. + (size_of_die): Ditto. + (value_format): Ditto. + (output_die): Ditto. + (output_location_lists): New function, output all of the location + lists for a DIE and it's children. + (dwarf2out_finish): Call output_location_lists if we have location + lists. + + +Fri May 18 15:39:16 CEST 2001 Jan Hubicka + + * gcse.c (try_replace_reg): First try global replace, later try to + simplify the expression. + + * gcse.c (find_used_regs): Change calling convention; work via + note_uses. + (cprop_insn): Update call of find_used_regs; work for CALL_INSNs too. + +2001-05-18 Bernd Schmidt + + Revert + 2001-02-09 Nick Clifton + * config/arm/arm.md: Change output constraint on post inc + load/store multiple patterns to be a read/write constraint. + +2001-05-18 Mark Mitchell + + * basic-block.h (struct basic_block_def): Add documentation about + what a basic block is, and what the various fields are used for. + * flow.c (calculate_globlal_regs_live): Add documentation about + how the algorithm works, and how we know that it will terminate. + Check that the inductive assumption that guarantees termination + actually holds. + (mark_used_regs): Treat conditionally set registers as used. + (debug_regset): Add comment. + * rtl.texi (cond_exec): Add documentation. + + * function.c (expand_function_start): Avoid creating BLKmode + pseudos. + +2001-05-17 Mark Mitchell + + * dwarf2out.c (output_comp_unit): Always output a compilation-unit + DIE, even if it has no children. + (dwarf2out_finish): Always output the line-number table, even if + it has no content. + +2001-05-18 David Edelsohn + + * rs6000.md (movsfcc,movdfcc): Remove NE case. + +2001-05-17 Bruce Korb + + * fixinc/fixincl.tpl: rewritten as an AutoGen version 5 template + * fixinc/genfixes: emit a warning if AutoGen is out of date + +2001-05-17 Brendan Conoboy + Bruce Korb + + * fixinc/fixincl.sh(FIXINC): accept local directory if fixincl not + found in fixinc directory. Facilitates binary distributions. + +2001-05-17 Jeffrey Oldham + + * dbxout.c (dbxout_symbol_location): For CONCAT, skip types not + COMPLEX_TYPE. + +Thu May 17 19:42:39 2001 Mark Kettenis + + * dwarf2out.c (modified_type_die): Equate qualified type to die. + +Thu May 17 23:19:46 CEST 2001 Jan Hubicka + + * integrate.c (copy_rtx_and_substitute): Use simplify_gen_subreg. + (simplify_subreg): Handle complex types represented as CONCAT. + + * recog.c (validate_replace_rtx_1): Properly canonicalize expression + * rtl.h (swap_commutative_operands_p): Declare. + * rtlanal.c (swap_commutative_operands_p): New. + (operand_preference): New static function. + + * combine.c (combine_simplify_rtx): Use swap_commutative_operands_p. + (gen_binary): Likewise. + * optabs.c (emit_cmp_and_jump_insns, emit_conditional_move): Likewise. + * simplify-rtx.c (simplify_gen_binary, + simplify_gen_relational): Likewise. + +Thu May 17 20:43:36 CEST 2001 Jan Hubicka + + * cse.c (fold_rtx): Use simplify_subreg. + + * simplify-rtx.c (simplify_replace_rtx): Use simplify_gen_subreg. + (simplify_gen_subreg): New. + (simplify_rtx): Use simplify_subreg. + * rtl.h (simplify_gen_subreg): Declare. + +2001-05-17 Mark Mitchell + + * doc/install.texi: Update Solaris information. + + * except.h (protect_cleanup_actions): Remove it. + (lang_protect_cleanup_actions): Declare it. + * except.c (protect_cleanup_actions): Remove it. + (lang_protect_cleanup_actions): New variable. + (init_eh): Don't make protect_cleanup_actions a GC root. + (expand_eh_region_and_cleanup): Call + lang_protect_cleanup_actions. + (output_function_exception_table): Remove unused `align' + variable. + * varasm.c (assemble_external): Abort if we have not yet + opened the assembly output file. + +Thu May 17 11:54:50 2001 Jeffrey A Law (law@cygnus.com) + + * except.c (sjlj_emit_function_enter): Call assemble_external_libcall + for eh_personality_libfunc. + +Thu May 17 19:48:00 CEST 2001 Jan Hubicka + + * recog.c (validate_replace_rtx_1): Use "TO" mode if not VOIDmode + when calling simplify_subreg. This is needed to allow replacing + of expression of one mode by expression of different mode. + +Thu May 17 19:40:03 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Avoid creating of incorrect subregs. + +2001-05-17 Bernd Schmidt + + * expr.c (protect_from_queue): Protect against subsequent calls to + emit_queue. + (expand_expr, case ADDR_EXPR): Prevent protect_from_queue from being + too clever. + +Thu May 17 18:17:34 CEST 2001 Jan Hubicka + + * simplify_rtx.c (simplify_subreg): Fix simplification of nested subregs. + +2001-05-17 Gerald Pfeifer + + * gccbug.in (CATEGORIES): Add "bootstrap". + +Thu May 17 16:59:41 CEST 2001 Jan Hubicka + + * simplify-rtx.c (simplify_subreg): Break out from ... + * combine.c (combine_splify_rtx) ... here and ... + * recog.c (validate_replace_rtx_1): ... here; + * rtl.h (subreg_lowpart_parts_p, simplify_subreg): Declare. + * emit-rtl.c (subreg_lowpart_parts_p): Break out from ... + (subreg_lowpart_p): ... here. + +2001-05-17 Bernd Schmidt + + * stmt.c (expand_asm_operands): For inout operands, make sure + the substitution of '=' for '+' makes it into the rtl. + + * reload1.c (delete_output_reload): Call eliminate_regs on substed. + (reload_as_needed): Call update_eliminable_offsets a bit later. + +2001-05-17 Gerald Pfeifer + + * gcc.texi (gccbug): Refer to the web pages for detailed information + on GNATS. + +2001-05-16 Zack Weinberg + + * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file. + + * Makefile.in: Delete variables: OLDCC, CCLIBFLAGS, OLDAR, + OLDAR_FLAGS, LIBGCC1, LIBGCC1_TEST, CROSS_LIBGCC1, + LIB1FUNCS, and LIB1FUNCS_EXTRA. Delete rules: libgcc1-test, + libgcc1-test.o. Clarify commentary now that libgcc1 no longer exists. + * cross-make: Don't set LIBGCC1. + * mklibgcc.in: Delete all code for building from libgcc1.c. + Always honor LIB1ASMFUNCS if set. + + * crtstuff.c, floatlib.c, longlong.h, config/fp-bit.c, + config/arc/lib1funcs.asm, config/arm/lib1funcs.asm, + config/d30v/libgcc1.asm, config/fr30/lib1funcs.asm, + config/h8300/lib1funcs.asm, config/i386/cygwin.asm, + config/i386/uwin.asm, config/m68hc11/larith.asm, + config/m68k/lb1sf68.asm, config/mcore/lib1.asm, + config/mn10200/lib1funcs.asm, config/sh/lib1funcs.asm, + config/sparc/lb1spc.asm, config/sparc/lb1spl.asm, + config/v850/lib1funcs.asm, config/c4x/libgcc.S: + Delete or update references to libgcc1 in commentary. + + * config/t-libc-ok, config/t-linux, config/t-linux-aout, + config/t-netbsd, config/a29k/t-a29kbare, config/a29k/t-vx29k, + config/alpha/t-interix, config/alpha/t-osf, config/alpha/t-vms, + config/arc/t-arc, config/arm/t-arm-aout, config/arm/t-arm-coff, + config/arm/t-arm-elf, config/arm/t-linux, config/arm/t-pe, + config/arm/t-semi, config/arm/t-strongarm-coff, + config/arm/t-strongarm-elf, config/arm/t-strongarm-pe, + config/arm/t-xscale-coff, config/arm/t-xscale-elf, config/avr/t-avr, + config/c4x/t-c4x, config/d30v/t-d30v, config/fr30/t-fr30, + config/h8300/t-h8300, config/i386/t-beos, config/i386/t-cygwin, + config/i386/t-i386elf, config/i386/t-interix, config/i386/t-netware, + config/i386/t-next, config/i386/t-rtems-i386, config/i386/t-sol2, + config/i960/t-960bare, config/i960/t-vxworks960, config/ia64/t-ia64, + config/m32r/t-m32r, config/m68hc11/t-m68hc11-gas, config/m68k/t-lynx, + config/m68k/t-m68kbare, config/m68k/t-m68kelf, + config/m68k/t-mot3300-gald, config/m68k/t-mot3300-gas, + config/m68k/t-next, config/m68k/t-vxworks68, config/m88k/t-bug, + config/m88k/t-dgux, config/m88k/t-dgux-gas, config/m88k/t-dguxbcs, + config/m88k/t-luna, config/m88k/t-luna-gas, config/m88k/t-m88k, + config/m88k/t-m88k-gas, config/m88k/t-sysv4, config/mcore/t-mcore, + config/mcore/t-mcore-pe, config/mips/t-bsd, config/mips/t-bsd-gas, + config/mips/t-cross64, config/mips/t-ecoff, config/mips/t-elf, + config/mips/t-iris6, config/mips/t-r3900, config/mips/t-svr3, + config/mips/t-svr3-gas, config/mips/t-svr4, config/mips/t-svr4-gas, + config/mips/t-ultrix, config/mn10200/t-mn10200, + config/mn10300/t-mn10300, config/pa/t-linux, config/pa/t-linux64, + config/pa/t-pa, config/pa/t-pa64, config/pa/t-pro, + config/pdp11/t-pdp11, config/pj/t-pj, config/rs6000/t-aix43, + config/rs6000/t-beos, config/rs6000/t-darwin, config/rs6000/t-newas, + config/rs6000/t-ppccomm, config/rs6000/t-rs6000, config/sh/t-linux, + config/sh/t-sh, config/sparc/t-chorus-elf, config/sparc/t-elf, + config/sparc/t-sol2, config/sparc/t-sp86x, config/sparc/t-sparcbare, + config/sparc/t-sparclite, config/sparc/t-splet, + config/sparc/t-sunos41, config/sparc/t-vxsparc, + config/sparc/t-vxsparc64, config/v850/t-v850: + Don't set any of LIBGCC1, CROSS_LIBGCC1, or LIBGCC1_TEST. + + * config/alpha/alpha.h, config/i386/i386.h, config/i860/i860.h: + Don't set FLOAT_VALUE_TYPE, FLOAT_ARG_TYPE, INTIFY, or FLOATIFY. + * config/d30v/d30v.h: Don't mention LIBGCC_NEEDS_DOUBLE, + FLOAT_VALUE_TYPE, FLOAT_ARG_TYPE, FLOATIFY, INTIFY, + nongcc_SI_type, nongcc_word_type, or perform_* + * config/i860/fx2800: Don't define perform_umodsi3 or perform_modsi3. + + * config/i386/386bsd.h, config/i386/beos-elf.h, + config/i386/linux-aout.h, config/i386/linux-oldld.h, + config/i386/linux.h, config/i386/mach.h, config/i386/netbsd.h, + config/i386/openbsd.h, config/i386/osfrose.h, config/i386/rtemself.h: + Don't include i386/perform.h. + + * config/a29k/t-a29k, config/arm/t-semiaof, config/i370/t-i370, + config/i370/t-linux, config/i370/t-mvs, config/i370/t-oe, + config/i386/t-djgpp, config/i386/t-i386bare, config/i386/t-vsta, + config/ia64/t-hpux, config/mips/t-mips, config/mips/t-mips-gas, + config/mips/t-osfrose, config/sparc/t-sp64, config/sparc/t-sunos40, + config/vax/t-openbsd, config/vax/t-vax: Delete. + + * config.gcc: Remove references to deleted files. + (arm-semi-aof): Use arm/t-semi for tmake_file. + + * gcc.texi, install.texi, invoke.texi, tm.texi: + Delete or rewrite text which is no longer relevant now that + libgcc1 no longer exists. + + * config/t-openbsd, config/alpha/t-interix, config/i386/t-interix: + No need to set INSTALL_ASSERT_H. (Missed in previous sweep.) + +2001-05-16 Wolfgang Bangerth + Bruce Korb + + * fixinc/inclhack.def(solaris27_mutex_init): Fix broken mutex + initializer + +2001-05-16 Zack Weinberg + + * i386.md: Add two peepholes to clean up code generated by + cmpstr* expanders. + +2001-05-16 Richard Henderson + + * dwarf2asm.c (eh_data_format_name): Add names for "pointer size" + variants of non-absolute encodings. + + * config/i386/i386.h (ASM_PREFERRED_EH_DATA_FORMAT): New. + + * libgcc-std.ver (_Unwind_Find_FDE, __register_frame_info_bases, + __register_frame_info_table_bases): Export. + +2001-05-16 Richard Henderson + + * except.c (eh_data_format_name): Move to ... + * dwarf2asm.c: ... here. Use designated initializers if available. + (dw2_asm_output_encoded_addr_rtx): Accept varargs commentary. + * dwarf2asm.h: Update declarations. + * dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind + ASM_PREFERRED_EH_DATA_FORMAT. + (output_call_frame_info): Likewise. Use 'L' augmentation for + the LSDA encoding. + + * unwind-dw2-fde.h (struct fde_vector): New. + (struct old_object): Rename from struct object. + (struct object): New. + (__register_frame_info_bases): Declare. + (__register_frame_info_table_bases): Declare. + (struct dwarf_fde): Remove explicit pc_begin/pc_range members. + * unwind-dw2-fde.c (objects): Remove. + (unseen_objects, seen_objects): New. + (__register_frame_info_bases): New. + (__register_frame_info): Use it. + (__register_frame_info_table_bases): New. + (__register_frame_info_table): Use it. + (__deregister_frame_info): Rewrite for changed object struct. + (base_from_object, get_cie_encoding, get_fde_encoding): New. + (fde_unencoded_compare): Rename from fde_compare; uninline. + (fde_single_encoding_compare, fde_mixed_encoding_compare): New. + (start_fde_sort): Adjust for new definition of fde_vector. + (fde_insert): Likewise. + (end_fde_sort): Likewise. Select comparison function based + on properties of the object. + (fde_split): Take object and fde_compare_t arguments. + (frame_heapsort, fde_merge): Likewise. + (classify_object_over_fdes): Rename from count_fdes. Handle + encoded pointers. Collect encoding, mixed_encoding, and pc_begin + for the object. + (add_fdes): Handle encoded pointers. + (init_object): Rename from frame_init. Update for new struct object. + (linear_search_fdes): Rename from search_fdes. Handle encoded + pointers. + (binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE. + (binary_search_single_encoding_fdes): New. + (binary_search_mixed_encoding_fdes): New. + (search_object): New. + (_Unwind_Find_FDE): Update for new struct object. Fill in + the dwarf_eh_bases. + * unwind-dw2.c: Include unwind-pe.h. Constify all pointers + iterating over EH data. + (_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add + fde_encoding, lsda_encoding. + (read_uleb128, read_sleb128): Remove. + (read_encoded_pointer): Remove. All callers use read_encoded_value. + (extract_cie_info): Set lsda_encoding from 'L' augmentation. + (uw_frame_state_for): Don't set bases.func. Handle encoded fde + pointers. + * unwind-pe.h: Add "struct" to _Unwind_Context references. + +2001-05-16 Neil Booth + + * cppexp.c (lex): Use NODE_NAME and NODE_LEN. + * cpphash.c (_cpp_lookup_with_hash): Similarly. + * cpplex.c (cpp_ideq, parse_identifier, cpp_token_len, + cpp_spell_token, cpp_output_token): Similarly. + * cpplib.c (lex_macro_node, do_undef, do_pragma, + do_pragma_poison, parse_assertion, do_assert): Similarly. + * cppmacro.c (builtin_macro, parse_args, funlike_invocation_p, + save_parameter, _cpp_create_definition, check_trad_stringification, + cpp_macro_definition): Similarly. + * cppmain.c (cb_define, cb_undef, dump_macro): Similarly. + * c-lex.c (cb_undef, c_lex): Similarly. + * fix-header.c (recognized_function): Similarly. + * cpplib.h (NODE_LEN, NODE_NAME): New. + (cpp_hashnode): Rename length len. + +Wed May 16 13:41:10 2001 Jeffrey A Law (law@cygnus.com) + + * pa32-regs.h (HARD_REGNO_MODE_OK): Allow TI/TFmode values in + GPRs. + +2001-05-16 Andreas Jaeger + + * Makefile.in (toplev.o): Add dependency on dwarf2asm.h. + + * toplev.c: Include dwarf2asm.h for prototype of + dw2_output_indirect_constants. + +Wed May 16 19:53:53 CEST 2001 Jan Hubicka + + * stmt.c (expand_asm_operands): Be able to offload addressof + expression to memory. (PR optimization/185) + +Wed May 16 18:53:23 CEST 2001 Jan Hubicka + + * combine.c (combine_simplify_rtx): Set op0_mode to VOIDmode after + applying distributive law. + +2001-05-16 John David Anglin + + * pa-hpux10.h (THREAD_MODEL_SPEC): Define. + + * gthr-dce.h (UNUSED): Attribute unused macro. + (__gthread_key_dtor): Make arguments UNUSED. + (__gthread_key_delete): Revise for compatibility with DRAFT4 + implementation. + +2001-05-16 David Edelsohn + + * doc/install.texi: Update AIX information. + * README.RS6000: Remove obsolete file. + +2001-05-16 Jakub Jelinek + Nathan Sidwell + + * gcc.c (give_switch): Don't write before start of string. + Always append suffix. + +2001-05-16 Nathan Sidwell + + * cpplex.c (_cpp_lex_token, '/' case): Comments can't appear + after stage3. + +2001-05-16 Gerald Pfeifer + + * README.ALTOS: Remove obsolete file. + +2001-05-16 Neil Booth + + * c-lex.h (save_and_forget_protocol_qualifiers, + forget_protocol_qualifiers, remember_protocol_qualifiers): + Remove deleted functions' prototypes. + +2001-05-16 Neil Booth + + * c-parse.in (methodtype): New production. + (methoddef, methodproto): Collapse separate '-' and '+' + handlers into 1. + +2001-05-16 Neil Booth + + * c-common.h (RID_FIRST_PQ): New. + * c-parse.in (objc_pq_context): New. + (objc parser): Set objc_pq_context rather than calling + remember_protocol_qualifiers and forget_protocol_qualifiers. + Don't call save_and_forget_protocol_qualifiers. + (yylexname): Handle objc protocol qualifiers here. + * stringpool.c (struct str_header): Replace with sp_hashnode. + (SP_EMPTY, SP_LEN, SP_TREE, SP_STR, SP_VALID): New. + (alloc_string): Rename alloc_ident. Use the SP_ accessors. + Allocate an IDENTIFIER_NODE for each identifier. + (FORALL_STRINGS, set_identifier): Delete. + (FORALL_IDS, expand_string_table, stringpool_statistics): Update. + (ggc_alloc_string): Use an obstack. + (get_identifier, maybe_get_identifier, mark_string_hash): Update. + * tree.h: Update comments. + (set_identifier): Delete. + * objc/objc-act.c (N_PQ, saved_pq, saved_not_pq, + save_and_forget_protocol_qualifiers, forget_protocol_qualifiers, + remember_protocol_qualifiers): Delete. + +Tue May 15 22:14:09 2001 Jeffrey A Law (law@cygnus.com) + + * flow.c (life_analysis): After life analysis is complete, do + an optional scan over insns looking for REG_LABEL notes that + reference a deleted label. + (propagate_block_delete_insn): Verify INOTE is a CODE_LABEL + before peeking at LABEL_NUSES. + +2001-05-15 Richard Henderson + + * unwind-sjlj.c (_Unwind_GetDataRelBase): New. + (_Unwind_GetTextRelBase): New. + +2001-05-15 Mark Mitchell + + * config/sparc/sol2.h (CPLUSPLUS_CPP_SPEC): Define. + +2001-05-15 Geoffrey Keating + + * objc/objc-act.c (handle_class_ref): Use rest_of_decl_compilation + so that CHOOSE_SECTION gets used. + + * config/rs6000/sysv4.h (ASM_PREFERRED_EH_DATA_FORMAT): Treat + TARGET_RELOCATABLE like flag_pic for now. + +2001-05-15 David Edelsohn + + * rs6000.md (movdi splitter): Sign extend more efficiently. + * rs6000.c (reg_or_arith_cint_operand): Redefine 64-bit constant + to "long long" valid on 32-bit and 64-bit hosts. + (logical_operand): Cast trunc_int_for_mode return value. + (rs6000_emit_move): Shift macro to encapsulate variable. + (rs6000_va_start): Use HOST_WIDE_INT_PRINT_DEC. + (rs6000_emit_{prologue,epilogue}): EH regno is unsigned but + plus_constant requires signed argument. + +2001-05-15 Loren J. Rittle + + * gthr-posix.h: Make additional pthread-* functions weak. + +Tue May 15 13:51:32 CEST 2001 Jan Hubicka + + * recog.c (apply_change_group): Avoid unneeded validating. + +2001-05-14 David Edelsohn + + * rs6000.c (num_insns_constant_wide): Constants are sign-extended. + (num_insns_constant): CONST_INT can be 64-bits. + +2001-05-14 Stan Shebs + + * config/darwin.h (LIB_SPEC): Just use -lSystem. + (LIBGCC_SPEC): Don't define. + +2001-05-14 Richard Henderson + + * configure.in (gcc_cv_as_eh_frame): New test. + * config.in, configure: Rebuild. + * gcc.c (init_spec): Honor USE_AS_TRADITIONAL_FORMAT. + +2001-05-14 Andrew MacLeod + + * config/ia64/lib1funcs.asm (__divtf3): Fix incorrect bits in + extended precision divide. + +2001-05-14 Andrew MacLeod + + * config/ia64/ia64.c (rtx_needs_barrier): Call rtx_needs_barrier + for RETURNS as well. + +Mon May 14 17:34:48 CEST 2001 Jan Hubicka + + * i386.h (TARGET_64BIT): Define to constant if !TARGET_BI_ARCH + (CPP_CPU??_SIZE_TYPE): New. + (CPP_CPU??_SPEC, CPP_CPUCOMMON_SPEC): Break out from... + (CPP_CPU_SPEC): ... here; support choosing of CPU. + (EXTRA_SPECS): Add cpp_cpu??, cpp_cpu??sizet, cpp_cpucommon. + (MAX_LONG_TYPE_SIZE, MAX_BITS_PER_WORD): Define to 32 for 32bit-only + compiler. + * i386.c (override_options): Add sorry about not suported modes. + +Mon May 14 08:56:47 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/som.h (NM_FLAGS): Remove. + (ASM_OUTPUT_FUNCTION_PREFIX): No longer truncate subspace names. + (ASM_OUTPUT_SECTION_NAME): Remove. + (MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): Likewise. + +2001-05-14 Mark Mitchell + + * regrename.c (regrename_optimize): Do not rename registers to + leaf registers. + +2001-05-14 Alexandre Oliva + + * rtl.texi (CALL_INSN_FUNCTION_USAGE): Note that (and when) it may + contain MEMs. Remove useless distinction about clobbering + registers. + +2001-05-13 Geoff Keating + + * config/rs6000/rs6000.h (EXCEPTION_SECTION): Move to... + * config/rs6000/aix.h (EXCEPTION_SECTION): ... here. + * config/rs6000/sysv4.h (CONST_SECTION_ASM_OP): Delete. + (ASM_PREFERRED_EH_DATA_FORMAT): Define. + (EXCEPTION_SECTION): Define. + +2001-05-13 Zack Weinberg + + * libgcc2.c, libgcc2.h: Restore __eprintf. Label as used for + binary backward compat only. + * Makefile.in (LIB2FUNCS_ST): New. Put _eprintf here, not + in LIB2FUNCS. Pass it to mklibgcc. + * mklibgcc.in: Handle LIB2FUNCS_ST. + + * Makefile.in (installdirs): Don't create $(gcc_tooldir). + +2001-05-13 Alexandre Oliva + + * tm.texi (THREAD_MODEL_SPEC): Document it. + * gcc.c (main): Use it. + * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Define it. + * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Likewise. + +2001-05-13 Franz Sirl + + * rtl.h (SYMBOL_REF_WEAK): New macro. + * rtlanal.h (rtx_addr_can_trap): Use it, a weak SYMBOL_REF can trap. + * varasm.c (make_decl_rtl): Mark SYMBOL_REF weak if necessary. + * rtl.texi (SYMBOL_REF_WEAK): Document it. + * gcc.texi: Remove wrong description. + +2001-05-13 Mark Mitchell + + * Makefile.in (STAMP): New macro. + Replace all uses of `touch' with $(STAMP). + * fixinc/Makefile.in: Likewise. + +Sun May 13 07:26:34 2001 Richard Kenner + + * configure.in: ldopen is never in -lexc, so don't test for it. + Add test for exc_resume in -lexc for Ada. + * configure: Regenerated. + +2001-05-12 Richard Henderson + + * dwarf2asm.c (size_of_encoded_value): New function. + * dwarf2asm.h: Declare it. + * except.c (output_function_exception_table): Align the TType + array only as wide as the encoding. + +2001-05-12 Zack Weinberg + + * extend.texi: Document #pragma GCC java_exceptions. + +2001-05-12 Neil Booth + + * c-parse.in (bison parser, init_reswords): Remove uses of + doing_objc_thang. + * c-tree.h (doing_objc_thang): Remove. + +2001-05-12 Neil Booth + + * cpplex.c (_cpp_lex_token): Ensure we warn at most once + about files not ending in newlines. + +2001-05-12 Neil Booth + + * dwarfout.c (dwarfout_init): Add cast. + * sched-deps.c (sched_analyze_insn): Remove unused vars. + * unwind-dw2-fde.c (_Unwind_Find_FDE): Flag unused parameter so. +cp: + * method.c (build_mangled_C99_name): Remove unused prototype. + +2001-05-12 Alexandre Oliva + + * config/arm/arm.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Use delta. + +2001-05-12 Alexandre Oliva + + * defaults.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define. + * tm.texi (TARGET_PRTMEMFUNC_VBIT_LOCATION): Document. + +2001-05-11 Richard Henderson + + * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. + * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, + dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. + * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. + (dw2_output_indirect_constants): Prototype. + * dwarf2out.c (dwarf2out_begin_prologue): Generate + current_function_func_begin_label if we'll need it for EH. Exit + early for IA64_UNWIND_INFO. + * except.c: Get DW_EH_PE_* defines from dwarf2.h. + (eh_data_format_name): Update for indirect references. + (output_function_exception_table): Care for IA64_UNWIND_INFO. + Handle ASM_PREFERRED_EH_DATA_FORMAT. + * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't + define HAVE_eh_return etc. + * final.c (final_start_function): Always call dwarf2out_begin_prologue. + (final_end_function): Don't call output_function_exception_table. + * toplev.c (compile_file): Call dw2_output_indirect_constants. + (rest_of_compilation): Invoke output_function_exception_table + for ia64 before assemble_end_function. + * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. + + * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. + * unwind.h: Declare them. + * libgcc-std.ver: Export them. + * unwind-pe.h: New file. + + * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. + + * config/ia64/fde-glibc.c: Use "struct unw_table_entry" + instead of "fde". + (find_fde_for_dso): Extract DT_PLTGOT. + (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return + the segment and gp as well. + * config/ia64/frame-ia64.c: Remove file. + * config/ia64/frame-ia64.h: Remove file. + * config/ia64/unwind-ia64.c: New file. + * config/ia64/unwind-ia64.h: New file. + * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. + (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. + (ASM_OUTPUT_EH_DOUBLE_INT): Remove. + (ASM_PREFERRED_EH_DATA_FORMAT): New. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. + (IA64_UNWIND_INFO): Re-enable. + (HANDLER_SECTION): Remove. + (EH_RETURN_DATA_REGNO): New. + * config/ia64/ia64.md (exception_receiver): Remove. + * config/ia64/t-glibc (LIB2ADDEH): Re-enable. + * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. + +2001-05-11 Richard Henderson + + * config/ia64/ia64.c (group_barrier_needed_p): Don't allow + calls and jumps to be bundled together. + (ia64_reorg): Emit a break after a noreturn call that ends + a function. + * config/ia64/ia64.md (break_f): New. + +2001-05-12 Neil Booth + + * c-lex.c (lex_charconst): Convert into a simple wrapper + around cpp_interpret_charconst, to which most of the code + body is moved. + * cppexp.c (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE, + MAX_LONG_TYPE_SIZE, MAX_INT_TYPE_SIZE, MAX_CHAR_TYPE_MASK, + MAX_WCHAR_TYPE_MASK, parse_escape, parse_charconst): Remove. + (lex): Use cpp_interpret_charconst. + * cpplex.c (parse_escape, read_ucs, cpp_interpret_charconst, + hex_digit_value): New functions. + (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): New macros. + * cpplib.h (cpp_interpret_charconst): New prototype. + * Makefile.in: Update. + +2001-05-12 Dean Wakerley + + * doc/install.texi: New file. Converted to texinfo from the HTML + documentation in wwwdocs/htdocs/install. + +Fri May 11 15:50:13 2001 Jeffrey A Law (law@cygnus.com) + + * gcse.c (insert_insn_end_bb): Do not search for assignments to + non-argumment registers that are mentioned in CALL_INSN_FUNCTION_USAGE. + + * toplev.c (compile_file): Move comment for opening output + file to just before the code that opens the output file. + +2001-05-11 Jakub Jelinek + + * regmove.c (regmove_optimize): Suppress the optimization for + unchanging destination register. Add comment above function. + +2001-05-11 Zack Weinberg + + * Makefile.in: Exterminate all references to assert.h. + * cross-make: Likewise. + * assert.h: Delete. + * configure.in: Correct commentary. + * configure: Regenerate. + + * libgcc-std.ver, libgcc2.c, libgcc2.h, sys-protos.h: + Remove __eprintf. + + * config/t-freebsd, config/t-linux, config/t-linux-aout, + config/t-netbsd, config/t-rtems, config/x-linux, + config/i386/t-beos, config/mcore/t-mcore, config/mcore/t-mcore-pe: + No need to override INSTALL_ASSERT_H. + + * fixinc/fixinc.dgux, fixinc/fixinc.interix, fixinc/fixinc.ptx, + fixinc/fixinc.svr4, fixinc/fixinc.winnt, fixinc/fixinc.wrap, + fixinc/fixincl.sh: Don't install assert.h into objdir/include. + +2001-05-11 Graham Stott + + * combine.c (simplify_comparison): Fix typo. + +2001-05-11 Mark Mitchell + + * loop.h (struct movables): Remove `num'. + * loop.c (scan_loop): Don't set it. Use count_insns_in_loop. + Adjust call to strength_reduce. + (num_unmoved_movables): New function. + (move_movables): Don't set movables->num. + (strength_reduce): Compute the number of instructions in the loop + here, rather than in the caller. + (check_dbra_loop): Always clear reversible_mem_store if there + are any memory sets. + (loop_regs_scan): Don't count instructions here. + (count_insn_in_loop): New function. + +2001-05-11 Mark Mitchell + + * optabs.c (emit_libcall_block): Don't mark calls as CONST_CALL_P. + +2001-05-11 Neil Booth + + * c-common.c (finish_label_expr): New function, lifted from + from cp/semantics.c. + * c-common.h (finish_label_expr, lookup_label): New prototypes. + * c-parse.in: Move 3 blocks of parser code into new functions. + * c-typeck.c (simple_asm_stmt, c_cast_expr): New functions. + * c-tree.h (simple_asm_stmt, c_cast_expr): New prototypes. + (lookup_label): Remove. + +2001-05-11 Alexandre Oliva + + * config/mn10300/t-mn10300 (dp-bit.c, fp-bit.c): Don't define + FLOAT_BIT_ORDER_MISMATCH. + +2001-05-10 David Edelsohn + + * expr.c (emit_push_insn): Convert PUSH_ROUNDING argument to + bytes. Reported by Kazu Hirata . + +2001-05-10 David Edelsohn + + * expr.c (emit_group_load): extract_bit_field requires a REG or + MEM as an argument. + +Thu May 10 14:45:44 2001 Jeffrey A Law (law@cygnus.com) + + * cse.c (cse_insn): Mostly remove first hunk of code which collapsed + a computed jump into an unconditional jump. + In second hunk of code for collapsing computed and conditional jumps + into unconditional jumps, reemit the jump in additional cases. + + * jump.c (jump_optimize_1): Do not wrap the new jump target + inside a LABEL_REF; gen_jump will do that automatically. + +2001-05-10 Toon Moene + + * dwarf2out.c (mem_loc_descriptor): Do not pass constant pool + contents for a SYMBOL_REF in case of floating point constants. + +2001-05-10 DJ Delorie + + * c-common.c (combine_strings): Widen strings in a + host-endian-independent way. + +2001-05-10 Joseph S. Myers + + * c-parse.in: Remove many shift/reduce conflicts. Update + %expect values. + (declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea, + declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea, + declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea, + declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea, + declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea, + declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea, + declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea, + declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea, declspecs_ts, + declspecs_nots, declspecs_ts_nosa, declspecs_nots_nosa, + declspecs_nosc_ts, declspecs_nosc_nots, declspecs_nosc, declspecs, + maybe_type_quals_setattrs, typespec_nonattr, typespec_attr, + typespec_reserved_nonattr, typespec_reserved_attr, + typespec_nonreserved_nonattr, maybe_setattrs, structsp_attr, + structsp_nonattr, components_notype, component_notype_declarator, + absdcl1_ea, absdcl1_noea, direct_absdcl1, absdcl_maybe_attribute, + firstparm, setspecs_fp): New + (typed_declspecs, reserved_declspecs, typed_typespecs, + reserved_typespecquals, declmods, typespec, typespecqual_reserved, + typed_declspecs_no_prefix_attr reserved_declspecs_no_prefix_attr + declmods_no_prefix_attr, nonempty_type_quals, structsp, + type_quals): Remove. Users updated. + (initdecls, notype_initdecls, after_type_declarator, + parm_declarator, notype_declarator, absdcl1, components, ivars): + Don't allow attributes at the start of a declarator; include them + in the production containing the declarator instead. Always + require type specifiers before trying to redeclare a typedef name. + (typename): Allow for attributes but warn that they are ignored. + (parmlist, firstparm, setspecs_fp): Include attributes in + parmlist; suck them off the parser stack in firstparm using + setspecs_fp. + +Thu May 10 09:17:42 2001 Jeffrey A Law (law@cygnus.com) + + * ifcvt.c (merge_if_block): Use any_uncondjump_p, not simplejump_p + to determine if a block has an unconditional jump at its end. + + * jump.c (jump_optimize_1): When converting a conditional jump + to an unconditional jump, build the jump using gen_jump instead + of just modify operands in-place. + +2001-05-09 Zack Weinberg + + * cppinit.c (cpp_post_options): Shut off macro expansion if + -fpreprocessed. + * cpplib.c (_cpp_handle_directive): If -fpreprocessed, accept + IN_I directives only if the # is in column 1 and the directive + name begins in column 2. + * cppmain.c (scan_buffer): Insert a space between # and an + identifier, when that identifier is a directive name. + + * tradcpp.c (struct file_buf): Add a pointer to the next entry + in the header search path. + (enum node_type): Add T_INCLUDE_NEXT. + (directive_table): Add entry for include_next. + (do_include_next): New function. + (process_include): New routine, broken out of do_include. + (finclude): Insert 'nhd' argument, to be copied into + next_header_dir of the new buffer. + (main): Adjust to match. + * gsyslimits.h, limity.h: Un-indent #include_next. + +2001-05-09 Joseph S. Myers + + * objc.texi: Move from ../libobjc/objc-features.texi. Adjust for + inclusion as a chapter of the GCC manual. + * gcc.texi: Include objc.texi. + * fdl.texi: Use @unnumberedsec for the addendum. + * Makefile.in ($(srcdir)/gcc.info, gcc.dvi): Update dependencies. + +Wed May 9 16:01:41 CEST 2001 Jan Hubicka + + * i386.md (DImode move splitters): Use !MMX and !SSE for the condition. + +Wed May 9 10:40:25 2001 Alexandre Oliva + + * regclass.c (scan_one_insn): Update REG_N_REFS when optimizing + handling of two-address insns. + +Wed May 9 10:36:18 2001 Alexandre Oliva + + * Makefile.in (NM_FOR_TARGET): Look for ./nm, then + ../binutils/nm-new instead of ../binutils/nm. + +Wed May 9 12:15:46 CEST 2001 Jan Hubicka + + * i386.md (movdi splitter): Fix the splitting condition + (float_extenddftf splitter): Fix mode. + +Wed May 9 12:05:39 CEST 2001 Jan Hubicka + + * genrecog.c (write_switch): Avoid outputting of switch for + types wider than int. + +2001-05-03 Andrew Haley + + * reload1.c (copy_eh_notes): New function. + (emit_input_reload_insns): Call it. + (emit_output_reload_insns): Call it. + +2001-05-07 Zack Weinberg + + * config.gcc (i[34567]86-*-sco3.2v4*, i[34567]86-*-sco*): + Delete stanzas. + * config/i386/sco.h, config/i386/sco4.h, config/i386/scodbx.h, + config/i386/sco4dbx.h, config/i386/x-sco4: Delete file. + + * optabs.c: Delete #ifdef BROKEN_LDEXP block. + +2001-05-07 John David Anglin + + * pa.md (interspace_jump): Revise comment. + (builtin_longjmp): Block initial setup insns from delay slot of + interspace branch. + (builtin_setjmp_receiver): New expander to save and restore PIC + register. + + * som.h (NM_FLAGS): Remove `-n' sort option. Revise comment. + +Mon May 7 09:30:14 2001 Jeffrey A Law (law@cygnus.com) + + * toplev.c (compile_file): Set up the output file before we call + the various initializers for the compiler. + + * except.c (sjlj_mark_call_sites): Do not search for assignments to + non-argumment registers that are mentioned in CALL_INSN_FUNCTION_USAGE. + + * pa.h (MAX_LONG_TYPE_SIZE): Should be 32, not 64. + * pa-64.h (*_TYPE_SIZE): Undefine before redefining. + +2001-05-06 Zack Weinberg + + * Makefile.in (tradcpp0): Correct typo in dependency list. + +2001-05-06 Geoff Keating + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't save + the link register if we're not going to use it. + + * config/rs6000/rs6000.c (output_profile_hook): Fix a warning. + (output_function_profiler): Likewise. + +2001-05-07 Alan Modra + + * pa.c (compute_frame_size): 64-bit frame marker is 16 bytes. + +2001-05-06 Alexandre Oliva + + * unroll.c (loop_iterations): Don't sign-extend abs_diff; + zero-extend it. Make abs_inc unsigned. + + * optabs.c (expand_binop): Sign-extend xop0 and xop1 from the + widest mode in narrowing and widening operations. + + * config/mips/mips.md: Sign extend CONST_INTs. + +2001-05-06 Andreas Jaeger + + * invoke.texi (Option Summary): Add -momit-leaf-frame-pointer + (i386 Options): Document -momit-leaf-frame-pointer. + +2001-05-06 Neil Booth + + * c-typeck.c (internal_build_compound_expr): Check for + array to pointer conversion just once. + +2001-05-05 Richard Henderson + + * integrate.c (copy_insn_list): Substitute NOTE_EXPECTED_VALUE. + +2001-05-05 Richard Henderson + + * except.c (remove_fixup_regions): Adjust REG_EH_REGION notes + to the parent of the fixup region. + +2001-05-05 Jakub Jelinek + + * gcc.c (cpp_options): Define __NO_INLINE__ unless we are honoring + "inline" keyword. + * cpp.texi (__NO_INLINE): Document it. + +2001-05-05 Neil Booth + + * cppfiles.c (struct include_file): New member err_no. + (find_or_create_entry): Set it. + (open_file): Don't set fds to -2. Instead, use err_no to + remember previous errors, if any. + +2001-05-05 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Optimize moves + between X and Y by using sequences of xgdx and xgdy. + +2001-05-05 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*logicalsi3_silshr16"): Use '?' instead + of '!' for the 'D' alternative ('!' is too strong). + ("*logicalsi3_silshl16"): Likewise. + ("movstricthi"): Accept 'A' when 'd' constraint, remove spurious '+'. + ("movstrictsi"): Remove spurious '+'. + ("movstrictqi"): Don't accept 'A' and remove spurious '+'. + ("tstqi_1", "*lshrqi3_const1"): Put 'm' constraint before 'd'. + ("subqi3"): Disparage with '!' the 'x' and 'y' registers to avoid + a reload to them. + +2001-05-04 David Edelsohn + + * calls.c (store_one_arg): Don't divide align by BITS_PER_UNIT. + +2001-05-04 Lars Brinkhoff + + * simplify-rtx.c (simplify_binary_operation): Simplify ~a + 1 + into -a. + +2001-05-04 Franz Sirl + + * config/rs6000/rs6000.md (ashldi3 splits): Guard with + TARGET_POWERPC64. + +2001-05-04 Stephane Carrez + + * config/m68hc11/m68hc11.md (lshrhi3_const1): Fix shift of + soft register, use ror instead of rol. + +2001-05-04 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Take + into account pre/post increment decrement for 68HC12. + Fix other problems in replacement and fix call to reg_mentioned_p. + +2001-05-04 Stephane Carrez + + * config/m68hc11/larith.asm (L_regs_frame): New for _.frame. + Put the soft registers in bss for 68HC12. + (L_regs_d3_4): New for _.d3 and _.d4. + (L_regs_d5_6): Likewise. + (L_regs_d1_2): Likewise. + * config/m68hc11/t-m68hc11-gas (T_CPPFLAGS): Compile new parts. + +2001-05-04 Stephane Carrez + + * config/m68hc11/m68hc11.h (CPP_SPEC): Pass -D__HAVE_SHORT_DOUBLE__ + to the pre-processor when -fshort-double is specified. + * config/m68hc11/m68hc11.2 (CPP_SPEC): Likewise. + +2001-05-04 Stephane Carrez + + * config/m68hc11/larith.asm (divmodhi4): Empty for 68HC12. + (__mulsi3): Rewrite for 68HC12. + * config/m68hc11/m68hc11.md (divmodhi4): Use idivs for 68HC12. + Mark 'x' constraint with earlyclobber to prevent a + RELOAD_FOR_OTHER_ADDRESS to go in it. + (mulhi3_m68hc12): New pattern. + (mulhi3_m68hc11): Rename of mulhi3. + (mulhi3): New expand for 68HC12 optimisation. + (umulhisi3, mulhisi3): New patterns for 68HC12. + +2001-05-04 Stephane Carrez + + * config/m68hc11/m68hc11.md (*tbne, *tbeq): New patterns for 68HC12. + (extendqisi2, extendqihi2, extendhisi2): Use sex for 68HC12. + (uminqi3, umaxqi3, uminhi3, umaxhi3): New pattern for 68HC12. + +2001-05-04 Stephane Carrez + + * config/m68hc11/m68hc11.h (CONST_COSTS): Make the cost of + constants cheap after reload. + * config/m68hc11/m68hc11.c (m68hc11_shift_cost): Shift by 16 and 32 + are cheap. + (m68hc11_rtx_costs): Cost of multiplication by 65536 is expensive + so that gcc prefers a shift by 16. + (m6811_cost, m6812_cost): Make the shift cheap compared to an add. + +2001-05-04 Nick Clifton + + * config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Define. + +2001-05-04 Kaveh R. Ghazi + + * alpha.h: NULL_PTR -> NULL. + * arm.c: Likewise. + * arm.h: Likewise. + * avr.h: Likewise. + * c4x.c: Likewise. + * c4x.h: Likewise. + * i386.c: Likewise. + * i386.md: Likewise. + * i860.c: Likewise. + * ia64.c: Likewise. + * m68hc11.h: Likewise. + * rs6000.h: Likewise. + * sh.c: Likewise. + * sh.h: Likewise. + * sparc.h: Likewise. + * v850.c: Likewise. + + * expr.c: Likewise. + * final.c: Likewise. + * gcc.c: Likewise. + * recog.c: Likewise. + +2001-05-04 Kaveh R. Ghazi + + * i386.c (ix86_emit_restore_regs_using_mov, ix86_save_reg): Change + `bool' parameter to `int'. + + * hash.c (hash_lookup): Likewise. + + * hash.h (hash_lookup): Likewise. + + * tlink.c (symbol_hash_lookup, demangled_hash_lookup): Likewise. + +Fri May 4 13:10:03 CEST 2001 Jan Hubicka + + * i386.c (x86_initialize_trampoline): Fix mode of constant. + +2001-05-03 Geoff Keating + + * invoke.texi (i386 Options): Delete references to -malign-jumps, + -malign-loops, -malign-functions. + * i386.c (ix86_align_funcs): Delete. + (ix86_align_loops): Delete. + (ix86_align_jumps): Delete. + (override_options): Mark -malign-* as obsolete. Emulate their + behavior with the -falign-* options. Default -falign-* from + the processor table. + * i386.h (FUNCTION_BOUNDARY): Define to 16; revert Richard Kenner's + patch of Wed May 2 13:09:36 2001. + (LOOP_ALIGN): Delete. + (LOOP_ALIGN_MAX_SKIP): Delete. + (LABEL_ALIGN_AFTER_BARRIER): Delete. + (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Delete. + +2001-05-04 Andreas Jaeger + + * except.h: Add prototype declaration for + expand_builtin_init_dwarf_reg_sizes. + +2001-05-03 Geoffrey Keating + + * Makefile.in (site.exp): Set TESTING_IN_BUILD_TREE. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.md ("bitcmpqi"): New pattern for bitb + instruction. + ("bitcmpqi2"): New pattern for bit-extract and test. + ("bitcmphi"): New pattern for bitb/bita instructions. + +2001-05-03 Joseph S. Myers + + * gccbug.in: Use a temporary directory when the mktemp command is + not available. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.h (STATIC_CHAIN_REGNUM): Use soft z register + instead of _.d1. + (INITIALIZE_TRAMPOLINE): Call it. + (TRAMPOLINE_SIZE): Define according to 68HC11/68HC12. + (TRAMPOLINE_TEMPLATE): Remove. + * config/m68hc11/m68hc11.c (m68hc11_initialize_trampoline): New. + * config/m68hc11/m68hc11-protos.h (m68hc11_initialize_trampoline): + Declare. + +2001-05-03 David O'Brien + + * config/t-freebsd: Don't install "assert.h" in gcc. Compile crtbeginS.o + and crtendS.o with PIC. + +2001-05-03 Stephane Carrez + + * config/m68hc11/larith.asm (__mulqi3): Fix multiplication of two + negative numbers. + (___subdi3, ___adddi3): Use x instead of y as index register. + (__init_bss_section, __map_data_section): Optimize for 68HC12. + (__memset, __memcpy): Likewise. + (regs): Put the soft registers in bss for 68HC12. + (abort): Use trap to abort for 68hc12. + (__mulhi3, __mulhi32): Use emul for 68hc12. + (__mulsi3): Avoid to use the tmp soft register for 68hc12. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.h (LIMIT_RELOAD_CLASS): Don't define. + * config/m68hc11/m68hc11-protos.h (limit_reload_class): Remove. + * config/m68hc11/m68hc11.c (limit_reload_class): Remove. + (m68hc11_override_options): Remove setting of flag_no_nonansi_builtin. + Set 68HC12 min offset to -65536. + (print_operand): Put parenthesis arround the operand if it refers + to a symbol having the same name as a register. + (m68hc11_z_replacement): When z register is replaced by its + equivalent soft register, force the insn to be re-recognized. + (m68hc11_check_z_replacement): Fix the test when destination is + the index register and z dies in the insn. + (m68hc11_reorg): Remove the REG_DEAD notes beforce recomputing them. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_override_options): Initialize + costs according to processor variant. + (m68hc11_shift_cost): New function to compute shift costs. + (m68hc11_rtx_costs): Define costs according to processor variant. + (m6811_cost): Costs for 68HC11. + (m6812_cost): Costs for 68HC12. + (COSTS_N_INSNS): Remove. + + * config/m68hc11/m68hc11.h (RTX_COSTS): New. + (DEFAULT_RTX_COSTS): Remove. + (CONST_COSTS): Define costs according to OUTER_CODE. + (processor_costs): New struct to define costs. + (m68hc11_cost): Pointer to current costs. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.md (*addhi3_68hc12): Fix generation + and use m68hc11_notice_keep_cc when using leax/leay. + (addhi3 split): Reject split if the insn is handled by + leax/leay above. + * config/m68hc11/m68hc11.c (m68hc11_split_move): For 68HC12 the + push must be handled in a special way if the source operand uses + sp as index register. + (m68hc11_notice_keep_cc): New function. + (m68hc11_gen_movhi): Use it when an insn changes a register but + not the flags. + (m68hc11_gen_movqi): Fix move for 68HC12. + * config/m68hc11/m68hc11-protos.h (m68hc11_notice_keep_cc): Declare. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Use LCT_CONST + and don't pass operands[0] to emit_library_call_value. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.md (tsthi_1): Use cpd for 68HC12. + (zero_extendsi split): Simplify and use (zero_extendhi). + (*addhi3): Remove 'w' constraint since stack pointer is handled + by (addhi3_sp). + (*ashlhi3_2): Operand 2 is clobbered use '+' for its constraint. + (*ashlhi3, *ashrhi3, *lshrhi3): Likewise. + (*ashrhi3_const): Fix shift by 7. + (*lshrsi3_const16): Fix template. + (call, call_value): Fix constraint and predicate. + +2001-05-03 Stephane Carrez + + * config/m68hc11/m68hc11.md (X_REGNUM, D_REGNUM): New constant. + (Y_REGNUM, SP_REGNUM, PC_REGNUM, A_REGNUM, B_REGNUM): Likewise. + (CC_REGNUM): Likewise. + (*unnamed splits): Use above constants instead of hard coded numbers. + (*adcq, *subcq, *addsi_carry, *rotlqi3_with_carry): Likewise. + (*rotlhi3_with_carry, *rotrhi3_with_carry): Likewise. + (*return_16bit, *unnamed peepholes): Likewise. + +2001-05-03 David O'Brien + + * config.gcc(rs6000-ibm-aix|powerpc-ibm-aix): Do not include + rs6000/rs6000.h twice. + +2001-05-03 Mark Elbrecht + + * config/i386/djgpp.h (CPP_PREDEFINES): Define __GO32__. + (CPP_SPEC): Conditionally define MSDOS and GO32. + (SUBTARGET_SWITCHES): Ignore -mbnu210 and -mno-bnu210. + (SUBTARGET_OVERRIDE_OPTIONS): Warn that -mbnu210 and -mno-bnu210 are + ignored. + (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY): Remove. + +2001-05-03 Alexandre Oliva + + * config/mn10300/mn10300.md: Sign-extend GEN_INT operands. + +2001-05-03 Mark Mitchell + + * integrate.h (struct inline_remap): Add leaf_reg_map table. + * integrate.c (expand_inline_function): Use xcalloc to allocate + memory. + (copy_rtx_and_substitute): Use the leaf_reg_map for leaf + registers. + +2001-05-03 Mark Mitchell + + * c-dump.c (dequeue_and_dump): Don't look at DECL_ASSEMBLER_NAME + if it is not set. + +2001-05-03 Alexandre Oliva + + * config/mn10300/mn10300.h (LINK_SPEC): Pass --relax to the + linker if -mrelax is given. + (TARGET_SWITCHES): Document -mrelax. + + Re-installed 2001-01-09's patch: + * hwint.h (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Use long long + if it's wider than long and the target's long is wider than the + host's. + +2001-05-02 David O'Brien + + * config.gcc, config/rs6000/aix51.h, config/rs6000/mach.h: Do not + directly include rs6000/rs6000.h. Instead do it in tm.h. + +2001-05-02 Stan Shebs + + * objc/objc-act.c (STRING_OBJECT_CLASS_NAME): Default to + NSConstantString for NeXT-style runtimes. + (STRING_OBJECT_GLOBAL_NAME): New macro. + (enum objc_tree_index): Add values OCTI_CNST_STR_GLOB_ID and + OCTI_STRING_CLASS_DECL. + (constant_string_global_id): New macro. + (string_class_decl): Ditto. + (setup_string_decl): New function. + (build_objc_string_object): Use it to build a NeXT runtime + compatible string initializer. + +2001-05-02 Jakub Jelinek + + * tradcpp.c (do_define): Make sure we don't walk past limit. + +2000-05-01 Franz Sirl + + * config/rs6000/rs6000.c (rs6000_legitimate_address): Allow any stack + offsets if not REG_OK_STRICT. + + * config/rs6000/rs6000.h (REG_OK_STRICT_FLAG): New macro. + (INT_REG_OK_FOR_INDEX_P): Likewise. + (INT_REG_OK_FOR_BASE_P): Likewise. + (REG_OK_FOR_INDEX_P): Use INT_REG_OK_FOR_INDEX_P. + (REG_OK_FOR_BASE_P): Use INT_REG_OK_FOR_BASE_P. + (LEGITIMATE_OFFSET_ADDRESS_P): Use INT_REG_OK_FOR_INDEX_P and + INT_REG_OK_FOR_BASE_P instead of REG_OK_FOR_INDEX_P and + REG_OK_FOR_BASE_P. Take an additional parameter. + (LEGITIMATE_INDEXED_ADDRESS_P): Likeewise. + (LEGITIMATE_INDIRECT_ADDRESS_P): Likewise. + (LEGITIMATE_LO_SUM_ADDRESS_P): Likewise. + (GO_IF_LEGITIMATE_ADDRESS): Move code into new function + rs6000_legitimate_address() and use it. + * config/rs6000/rs6000.c: Update all callers. + (rs6000_legitimate_address): New function. + +2001-05-02 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_move): Merge + special_constant conditional blocks together. + +2001-05-02 Dale Johannesen + + * config/rs6000/rs6000.h (RS6000_ARG_SIZE): Remove unused NAMED + parameter. + (STRICT_ARGUMENT_NAMING): Define. + * config/rs6000/rs6000.c (function_arg_advance, function_arg, + function_arg_partial_nregs, setup_incoming_varargs): Remove + args logic which depends on "named" now that STRICT_ARGUMENT_NAMING + is defined. + +Wed May 2 13:09:36 2001 Richard Kenner + + * config/i386/i386.h (FUNCTION_BOUNDARY): Result is unsigned. + + * function.c (fixup_var_regs_1, case SUBREG): Use promoted mode + for replacement. + + * expr.c (store_field): Do nothing except elaborate side-effects if + zero-bit field. + +2001-05-02 Kaveh R. Ghazi + + * c-lex.c: NULL_PTR -> NULL. + * cse.c: Likewise. + * emit-rtl.c: Likewise. + * gcse.c: Likewise. + * genpeep.c: Likewise. + * jump.c: Likewise. + * mips-tdump.c: Likewise. + * reload1.c: Likewise. + * rtlanal.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * toplev.c: Likewise. + +2001-05-01 Per Bothner + + * expr.c (expand_expr): When compiling LABELED_BLOCK_EXPR, + call do_pending_stack_adjust before emiting label. + +2001-05-01 Mark Mitchell + + * extend.texi: Fix typo. + +2001-05-01 Stan Shebs + + * objc/objc-act.c (build_module_descriptor): Clear DECL_CONTEXT + of UOBJC_MODULES_decl. + (generate_strings): Clear DECL_CONTEXT of new decl nodes. + (generate_descriptor_table): Ditto. + (generate_protocols): Ditto. + (generate_protocol_list): Ditto. + (generate_classref_translation_entry): Ditto. + +2001-05-01 Jeffrey Oldham + + * invoke.texi (Optimize Options): Add documentation for `--param + max-delay-slot-insn-search' and `--param + max-delay-slot-live-search' and reorder --param section. + * params.def: Modify initial comment. + * params.h (param_info): Add `help' member. + * toplev.c (lang_independent_params): Include `help' description. + (display_help): Print --param parameters. + +2001-05-01 Zack Weinberg + + * config.gcc: Don't default xmake_file to ${cpu_type}/x-${cpu_type}. + Remove references to deleted files. + (*-*-openbsd): No need to override xmake_file. + (*-*-sysv4): Treat like *-*-sysv. + + * configure.in: Probe for ldopen in various places, and set up + collect2 to be linked with them if found. + Don't dink with Windows registry stuff unless $host_os is a + Win32 os name. Check to see if we need -ladvapi32. + * configure: Regenerate. + + * Makefile: Get rid of CLIB and HOST_CLIB. + Substitute in COLLECT2_LIBS and link collect2 against its contents. + * build-make: Get rid of HOST_CLIB. + + * config/a29k/x-unix, config/alpha/x-osf, config/i386/x-aix, + config/i386/x-osfrose, config/m68k/x-dpx2, config/mips/x-iris3, + config/mips/x-mips, config/mips/x-osfrose, config/mips/x-sony, + config/mips/x-sysv, config/rs6000/x-aix31, config/rs6000/x-aix41, + config/rs6000/x-rs6000: Delete. + + * config/i386/x-cygwin, config/m68k/t-aux, config/mips/x-iris: + Don't set CLIB. + + 24 x-host fragments remain, 0 x-cpu, 3 top level. + +2001-05-01 Zack Weinberg + + * aclocal.m4 (gcc_AC_C_CHAR_BIT): Correct test program. + * configure: Regenerate. + +2001-05-01 Angela Marie Thomas + + * Makefile.in (install-headers): Remove redundant dependency. + +2001-05-01 Nathan Sidwell + + * c-tree.texi (USING_STMT): Document. + +2001-05-01 Kaveh R. Ghazi + + * bitmap.c: Change NULL_PTR to NULL or "(rtx*)0". + * c-common.c: Likewise. + * c-decl.c: Likewise. + * combine.c: Likewise. + * rs6000.c: Likewise. + * except.c: Likewise. + * explow.c: Likewise. + * expr.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * gcc.c: Likewise. + * gcse.c: Likewise. + * integrate.c: Likewise. + * loop.c: Likewise. + * objc/objc-act.c: Likewise. + * recog.c: Likewise. + * reg-stack.c: Likewise. + * reload.c: Likewise. + * reload1.c: Likewise. + * simplify-rtx.c: Likewise. + * stmt.c: Likewise. + * varasm.c: Likewise. + +2001-05-01 Gabriel Dos Reis + + * diagnostic.def: New file. + * diagnostic.h (diagnostic_t): New enum. + * Makefile.in (diagnostic.o): Depend on diagnostic.def + +2001-04-30 Zack Weinberg + + * tsystem.h: Test only POSIX for availability of string.h + and time.h. + * config.gcc (all systems): If USG appeared in xm_defines, + change it to POSIX. If both USG and POSIX appeared, just + delete USG. Remove unnecessary quotes around xm_defines + settings. + (m68k-crds-unos*): Don't #define unos - tested nowhere. + (m68k-apple-aux*): Don't #define AUX - tested nowhere. + (alpha*-*-linux*ecoff*, powerpc-*-linux*libc1, + powerpc-*-linux*): No need to set xm_defines - handled by + global settings for *-*-linux*. + +2001-04-30 Zack Weinberg + + * dbxout.c, mips-tfile.c, config/mips/mips.c, xcoffout.c: + Always include gstab.h, not system stab.h. Don't provide + default definitions of N_CATCH or N_OPT. Always use the + gstab.h variant of STAB_CODE_TYPE. + * final.c: Don't include stab.h/gstab.h at all, or provide + defaults for N_SLINE and N_SOL. + + * xcoffout.c: Can assume N_MAIN, N_DSLINE, N_BSLINE, N_BINCL, + N_EINCL, N_EXCL, N_M2C, N_SCOPE, N_CATCH, and N_OPT are + available. + * sdbout.c: Always include gsyms.h instead of system syms.h. + + * configure.in: No need to check for stab.h. + * configure, config.in: Regenerate. + * Makefile.in (final.o): Don't depend on gstab.h. + +2001-04-30 Mark Mitchell + Richard Henderson + + * extend.texi: Improve documentation of volatile asms. + +2001-04-30 Mark Mitchell + + * c-tree.texi: Fix thinko. + * gcc.texi: Likewise. + +2001-04-30 Richard Henderson + + * c-common.c (c_promoting_integer_type_p): New function, from the + corpse of old macro. Properly promote too-small enumerations and + booleans. Adjust all callers. + * c-common.h (C_PROMOTING_INTEGER_TYPE_P): Remove. + (c_promoting_integer_type_p): Declare. + * c-decl.c: Adjust C_PROMOTING_INTEGER_TYPE_P invocations. + * c-typeck.c: Likewise. + (default_conversion): Remove now redundant boolean check. + +2001-04-30 Jan Hubicka + Richard Henderson + + * regmove.c (try_apply_stack_adjustment): Remove now redundant + sanity checks. + (combine_stack_adjustments_for_block): Don't combine stack + allocation followed by deallocations. Handle grow-up stacks. + +2001-04-30 Mark Mitchell + + * fdl.texi: New file. + * c-tree.texi: Use the GFDL. + * gcc.texi: Likewise. + +2001-04-30 Stan Shebs + + * invoke.texi: Add a section documenting Objective-C options. + +2001-04-27 Andrew Haley + + * emit-rtl.c (try_split): Copy EH notes to sequence. + +2001-04-30 Mark Mitchell + + * regmove.c (record_stack_memrefs): Catch all references to the + stack pointer. + +2001-04-29 Toomas Rosin + + * Makefile.in (stmp-fixinc): quote shell assignment values + +2001-04-29 Kaveh R. Ghazi + + * c-aux-info.c: NULL_PTR->NULL in calls to `concat'. + + * gcc.c: Likewise. + + * prefix.c: Likewise. + +2001-04-28 Stan Shebs + + * objc/objc-act.c (handle_class_ref): Rewrite to flush target + specific code and use new macro ASM_DECLARE_UNRESOLVED_REFERENCE. + * config/darwin.h (ASM_DECLARE_UNRESOLVED_REFERENCE): Define. + * tm.texi (ASM_DECLARE_UNRESOLVED_REFERENCE): Document. + + * config/darwin.h (STANDARD_EXEC_PREFIX): Don't define. + (NEXT_OBJC_RUNTIME): Define. + +Sat Apr 28 21:02:58 CEST 2001 Jan Hubicka + + * rtl.h (simplify_gen_relational): Add cmp_mode parameter. + * simplify-rtx.c (simplify_gen_relational): Likewise. + + * simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs. + + * i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2 + * i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves. + + * i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to + registers in SSE case; fix handling of the immediates. + (negsf2_ifs, abssf2_ifs): Tweak constraints; require + operands to be in regsiters before reload. + (negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit + (negdf2_ifs_rex64, absdf2_ifs_rtx64): New. + (abstf,absxf,negtf,negxf splitters): Compute + properly the regnum for x86_64. + (avsdf2_if_rex64): New. + +Sat Apr 28 10:36:23 2001 Jeffrey A Law (law@cygnus.com) + + * flow.c (propagate_block_delete_insn): Handle deletion of ADDR_VEC + and ADDR_DIFF_VEC insns when the proceeding CODE_LABEL was put + into the constant pool. + * jump.c (jump_optimize_1): Remove barrier successors after all + the LABEL_NUSES counds have been computed. + (delete_barrier_successors): When deleting a tablejump insn, also + delete the jump table it uses. + * varasm.c (force_const_mem): Set LABEL_PRESERVE_P when forcing a + label into memory. + +2001-04-28 Martin Kalen + + * pa.c (FRP): Remove erroneous white space in macro definition. + +2001-04-28 Andreas Jaeger + + * invoke.texi: Use XX-bit instead of XXbit or XX bit where + appropriate. + * extend.texi: Likewise. + * tm.texi: Likewise. + +2001-04-28 Andreas Jaeger + + * md.texi: Use XX-bit instead of XXbit or XX bit where + appropriate. + +2001-04-28 Jens Schweikhardt + + * gcc.c (process_command): Allow -l lib in addition to -llib + for POSIX compliance. This fixes PR c/2347. + + * invoke.texi: Update section on Link Options accordingly. + +2001-04-27 Zack Weinberg + + * function.c (purge_addressof_1): Remove the duplicate + if (code == SET) block. Fold the two if (code == ADDRESSOF) + blocks together. + +2001-04-28 Jason Merrill + + * except.c (expand_eh_region_start): Don't start a new block. + (expand_eh_region_end): Don't end a block. + * stmt.c (expand_end_bindings): Don't end EH blocks. + (expand_decl_cleanup): Starting an EH region won't change the block. + (mark_block_as_eh_region, mark_block_as_not_eh_region): Lose. + (is_eh_region): Lose. + * tree.h: Adjust. + +2001-04-27 Jeffrey Oldham + + * except.c (expand_eh_region_end_cleanup): word_mode, not Pmode. + + * collect2.c (main): Add `-L' case to remove duplicate entries. + (is_in_args): New function to check for a duplicate argument. + * defaults.h (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES): New macro. + * tm.texi (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES): New documentation. + * config/mips/iris6.h (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES): + Define to be nonzero. + +2001-04-27 Andreas Jaeger + Richard Henderson + + * md.texi (Machine Constraints): Document additional i386 + constraints and fix description of "A". + +Fri Apr 27 10:43:49 2001 Jeffrey A Law (law@cygnus.com) + + * tm.texi (TARGET_MEM_FUNCTIONS): Update text. + +2001-04-27 Jason Merrill + + * except.c (get_exception_filter): word_mode, not Pmode. + +2001-04-26 Geoffrey Keating + + * config/sparc/sparc.md (movsf_no_f_insn): Add more alternatives + common to other movsf patterns. Move up so that in future + people who change the other patterns will change it too. + (movsf_lo_sum): Allow even for soft-float; add appropriate + constraints. + (movsf_high): Likewise. + (movsf_high+1): Allow even for soft-float. + + * function.c (expand_function_end): Always clobber the + return registers, even if there is no return label. + +Thu Apr 26 20:28:21 CEST 2001 Jan Hubicka + + * (ix86_expand_fp_movcc): Re-enable SSE conditional move generation. + +Thu Apr 26 19:20:28 CEST 2001 Jan Hubicka + + * i386.md (abs/neg splitter): Fix calculation of sign bit for TFmodes + (pushqi2_rex64, pushhi2_rex64): Add. + +2001-04-26 Andrew Haley + + * except.c (expand_eh_region_end_cleanup): Force pending stack + adjust before emitting label that branches around cleanup code. + +2001-04-26 H.J. Lu (hjl@gnu.org) + + * config.gcc (mips*-*-linux*): Add elfos.h to tm_file. + + * config/mips/ecoff.h (STARTFILE_SPEC): Undefine before + define. + * config/mips/elf64.h (MAX_OFILE_ALIGNMENT): Likewise. + (ASM_OUTPUT_SECTION_NAME): Likewise. + (ASM_WEAKEN_LABEL): Likewise. + (UNIQUE_SECTION): Likewise. + (ASM_OUTPUT_CONSTRUCTOR): Likewise. + (ASM_OUTPUT_DESTRUCTOR): Likewise. + * config/mips/elf.h (MAX_OFILE_ALIGNMENT): Likewise. + (ASM_OUTPUT_SECTION_NAME): Likewise. + (ASM_WEAKEN_LABEL): Likewise. + (UNIQUE_SECTION): Likewise. + (ASM_OUTPUT_CONSTRUCTOR): Likewise. + (ASM_OUTPUT_DESTRUCTOR): Likewise. + * config/mips/linux.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/mips/mips.h (DBX_CONTIN_LENGTH): Likewise. + (ASM_FILE_START): Likewise. + (ASM_OUTPUT_SOURCE_LINE): Likewise. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_FILE_END): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_CASE_LABEL): Likewise. + (ASM_OUTPUT_SKIP): Likewise. + (ASM_OUTPUT_ASCII): Likewise. + (ASM_OUTPUT_IDENT): Likewise. + (READONLY_DATA_SECTION): Likewise. + (EXTRA_SECTIONS): Likewise. + (EXTRA_SECTION_FUNCTIONS): Likewise. + (SELECT_RTX_SECTION): Likewise. + (SELECT_SECTION): Likewise. + + * config/mips/linux.h (INVOKE__main): Undefine. + (CTOR_LIST_BEGIN): Likewise. + (CTOR_LIST_END): Likewise. + (DTOR_LIST_BEGIN): Likewise. + (DTOR_LIST_END): Likewise. + (SET_ASM_OP): Defined it to ".dummy". + (ASM_OUTPUT_DEF): Defined. + (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Defined. + +2001-04-26 Nick Clifton + + * config/arm/arm.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define, if the + assembler supports .p2align. + +2001-04-26 Nathan Sidwell + + * c-lex.c (c_lex): Remove # from %o diagnostic formatting. + +2001-04-26 Jakub Jelinek + + * integrate.c (expand_inline_function): Check for error_mark_node + in actual argument. + +2001-04-26 Jakub Jelinek + + * config/i386/i386.h (CC1_CPU_SPEC): Fix deprecation warnings for + -m386 and -m486. + +2001-04-26 Alexandre Oliva + + * configure.in (configargs.h): Define thread_model. + * configure: Rebuilt. + * gcc.c (main): Print it with -v. + +2001-04-25 Joseph S. Myers + + * invoke.texi: Document -Wmissing-braces, -dumpspecs, + -dumpmachine, -dumpversion, -fmem-report and -ftime-report. + * gcc.1: Regenerate. + +2001-04-25 Rainer Orth + + * dwarfout.c (is_pseudo_reg, type_main_variant, is_tagged_type, + is_redundant_typedef): Use static inline instead of inline static. + +Wed Apr 25 18:21:01 2001 Christopher Faylor + + * config/i386/cygwin.h: Move W32API search to LINK_SPEC to ensure that + this directory is always searched. + +2001-04-25 Richard Henderson + + * config/i386/i386.c (ix86_expand_epilogue): Properly compute size + of registers to restore along non eh_return path. + +2001-04-25 Jakub Jelinek + + * c-format.c (check_format_info_recurse): Handle + PLUS_EXPR for format string. + +2001-04-25 Jakub Jelinek + + * config/ia64/ia64.h (CC1_SPEC): Define. + * config/ia64/linux.h (CC1_SPEC): Define. + +Wed Apr 25 17:09:50 2001 J"orn Rennecke + + * emit-rtl.c (constant_subword): Also do sign extension in + BITS_PER_WORD == 16 case. + +2001-04-25 Jason Merrill + + * loop.c (try_swap_copy_prop): Go back to checking insn. + +2001-04-25 Jakub Jelinek + + * emit-rtl.c (subreg_hard_regno): Only do HARD_REGNO_MODE_OK check + if check_mode is nonzero. + +2001-04-25 Jakub Jelinek + + * config/i386/i386.c (ix86_expand_int_movcc): If overlap between + out and comparison sequence has been detected, put result into + proper temporary pseudo. + +2001-04-24 Zack Weinberg + + * Makefile.in (LIB2FUNCS): Remove _varargs and __dummy. + * libgcc-std.ver: Remove __builtin_saveregs, __dummy, and __empty. + * libgcc2.c: Remove __dummy and __builtin_saveregs. + * libgcc2.h: Don't prototype __builtin_saveregs or __dummy. + * config/i860/varargs.asm: New file - preserve i860 __builtin_saveregs + for future reference. + +2001-04-24 Jason Merrill + + * except.c (reachable_handlers): Step out one level from a RESX. + + * except.c (struct eh_region): Rename 'last' to 'resume'. + (mark_eh_region, duplicate_eh_region_1): Adjust. + (expand_eh_region_end_cleanup): Remember the jump, not the barrier. + (build_post_landing_pads): Likewise. + (expand_end_catch, expand_eh_region_end_allowed): Don't set it. + (expand_eh_region_end_must_not_throw): Likewise. + (connect_post_landing_pads): Thread (only) regions with non-deleted + resume insns. + + * except.c (expand_eh_region_end_cleanup): Save the EH return data + registers around the cleanup. + (get_exception_filter): New fn. + (finish_eh_generation): Use it. + +2001-04-24 Nathan Sidwell + + * c-semantics.c (add_scope_stmt): Don't call + current_scope_stmt_stack multiple times. + +2001-04-24 Zack Weinberg + Nathan Sidwell + + Lazy __FUNCTION__ generation. + * c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, + RID_C99_FUNCTION_NAME): New _RIDs. + (CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove. + (CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, + CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New + global tree slots. + (function_id_node, pretty_function_id_node, func_id_node): Remove. + (c99_function_name_decl_node, function_name_decl_node, + pretty_function_name_decl_node, saved_function_name_decls): + Declare. + (struct language_function): Remove x_function_name_declared_p. + (make_fname_decl): Remove a parameter. + (declare_function_names): Remove prototype. + (start_fname_decls, finish_fname_decls): Prototype. + (fname_as_string): Likewise. + (fname_string, fname_decl): Likewise. + * c-common.c (make_fname_decl): Adjust. + (struct fname_var_t): New struct. + (fname_vars): New static array. + (declare_function_name): Remove. + (start_fname_decls, finish_fname_decls): New functions. + (fname_as_string): New function from remnants of + declare_function_name. + (fname_string, fname_decl): New functions. + + * c-decl.c (c_function_name_declared_p): Remove. + (init_decl_processing): Don't generate __FUNCTION__ et al ids, + don't call declare_function_name. Call start_fname_decls. + (c_make_fname_decl): Adjust parameters. Generate the name. Don't + clobber the line number. Call finish_decl. + (start_function): Call start_fname_decls. + (finish_function): Call finish_fname_decls. + Remove c_function_name_declared_p. + (push_c_function_context): Don't push c_function_name_declared_p. + (pop_c_function_context): Don't pop c_function_name_declared_p. + (c_begin_compound_stmt): Don't check c_function_name_declared_p. + * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens. + (program): Call finish_fname_decls for C. + (primary): Add VAR_FUNC_NAME. + (reswords): Add slots for __FUNCTION__ et al. + (rid_to_yy): Add mappings for __FUNCTION__ et al. + (yylexname): If it's a STRING_FUNC_NAME generate the function name + now. Don't look for VAR_DECLs containing __FUNCTION__ et al. + * c-semantics.c (prune_unused_decls): Remove. + (finish_stmt_tree): Don't call prune_unused_decls. + (genrtl_decl_stmt): Don't prune unused decls here. + +2001-04-24 Nick Clifton + + * dwarf2out.c (mem_loc_descriptor): If a SYMBOL_REF is in the + constant pool, use the pool's SYMBOL_REF instead. + + * config/v850/v850.h (STRICT_ALIGNMENT): Always set, even for the + v850e. + +2001-04-23 Joseph S. Myers + + * c-convert.c (convert): When converting to a BOOLEAN_TYPE, avoid + passing nested NOP_EXPRs to fold. + +Mon Apr 23 14:32:12 CEST 2001 Jan Hubicka + + * reg-stack.c (emit_swap_insn): Do not get pass CALL_INSNs. + +2001-04-22 Mark Mitchell + + * loop.c (loop_delete_insns): Add prototype. + +2001-04-23 Phil Edwards + + * configure.in: Remove ENABLE_STD_NAMESPACE. + * config.in: Regenerated. + * configure: Regenerated. + +2001-04-22 Stan Shebs + + * config.gcc (powerpc-*-darwin*): Move the flag in xm-darwin.h + into xm_defines. + * config/rs6000/xm-darwin.h: Remove file. + +2001-04-22 Kaveh R. Ghazi + + * collect2.c (main): Use concat in lieu of xmalloc/sprintf. + (write_c_file_stat): Likewise. + + * dbxout.c (dbxout_init): Likewise. + + * profile.c (output_func_start_profiler): Likewise. + +2001-04-22 Philipp Thomas + + * ABOUT-GCC-NLS: Now that gettext 0.10.37 is out, + require it instead of the CVS version. + * cpperror.c (v_message): Put a blank before the macro + body to not confuse exgettext. + +2001-04-21 Mark Mitchell + + * flow.c (proagate_one_insn): Remove useless assignment. + * jump.c (delete_insn): Tidy. + * loop.c (try_copy_prop): When deleting an instruction with a + REG_RETVAL note, delete the entire libcall sequence. + (loop_delete_insns): New function. + * unroll.c (initial_reg_note_copy): Copy INSN_LIST notes, even if + we're not substituting into them yet. + +2001-04-21 Kazu Hirata + + * config/h8300/h8300.c (general_operand_src): Fix a comment typo. + + * config/sparc/sparc.c (sparc_flat_eligible_for_epilogue_delay): + Fix a comment typo. + * config/i960/i960.c (signed_arith_operand): Likewise. + + * calls.c (expand_call): Fix a comment typo. + +2001-04-20 Zack Weinberg + + * configure.in: Probe for times, clock, struct tms, and clock_t. + * configure, config.in: Regenerate. + * timevar.c: Replace ifdef forest in get_time with (relatively) + straightforward series of checks based on autoconf's probes. + +Fri Apr 20 12:24:50 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/som.h (NM_FLAGS): Define. + +2001-04-20 Bernd Schmidt + + * ia64.h (MD_SCHED_REORDER, MD_SCHED_REORDER2): Pass CLOCK to called + function. + * ia64-protos.h (ia64_sched_reorder): Additional arg for clock. + * ia64.c (nop_cycles_until): New function. + (prev_cycle, prev_first, last_issued): New static variables. + (ia64_sched_reorder): Additional arg for clock. + On final scheduling pass, emit extra NOPs as needed. + Set prev_first and prev_cycle. + (ia64_sched_reorder2): Pass clock arg down to ia64_sched_reorder. + (ia64_variable_issue): Set last_issued. + +2001-04-20 Alexandre Oliva + + * config/i386/i386.c (ix86_expand_int_movcc, + ix86_expand_strlensi_unroll_1): Sign-extend CONST_INTs. + +2001-04-20 Geoff Keating + + * config/rs6000/rs6000.md (ctrsi_internal1, ctrsi_internal2, + ctrsi_internal3, ctrsi_internal4, ctrsi_internal5, + ctrsi_internal6, ctrdi_internal1, ctrdi_internal2, + ctrdi_internal3, ctrdi_internal4, ctrdi_internal5, + ctrdi_internal6): In the short-branch case, this insn is only 4 + bytes long. Reported by Reza Yazdani . + +2001-04-20 Jakub Jelinek + + * reg-stack.c (check_asm_stack_operands): Issue error if "=t" resp. + "=u" is used together with "st" resp. "st(1)" clobber. + +2001-04-20 Jakub Jelinek + + * gcse.c (gcse_main): Fix comment typo. + (delete_null_pointer_check): Likewise. + (hash_scan_set): Don't consider sets with REG_EQUIV MEM notes. + * cse.c (cse_insn): Likewise. + * function.c (fixup_var_refs_insns_with_hash): The sequence is + toplevel. + +2001-04-19 Zack Weinberg + + * toplev.c: Excise all code for the undocumented -dm option. + (float_signal): Call signal just once, unconditionally. + +2001-04-19 Geoff Keating + + * fold-const.c (fold): Use first_rtl_op rather than + TREE_CODE_LENGTH when looping over parameters of a tree. + Correct strange grouping in test for evaluated SAVE_EXPR. + +Thu Apr 19 19:15:26 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/pa-linux.h (CPLUSPLUS_CPP_SPEC): Undefine. + * config/pa/pa.h (CPLUSPLuS_CPP_SPEC): Define. + + * config/pa/som.h (ASM_OUTPUT_FUNCTION_PREFIX): Truncate subspace + name at 32 total characters. + (ASM_OUTPUT_SECTION_NAME): Similarly. Also, only support placing + functions in named sections -- data items can still go into unique + sections, but they have normal names (ie $LIT$ and $DATA$). + + * config/pa/som.h (SUPPORTS_INIT_PRIORITY): SOM does not support + INIT_PRIORITY. + +2001-04-19 DJ Delorie + + * config/alpha/vms.h: Change OBJECT_SUFFIX and EXECUTABLE_SUFFIX + to TARGET_OBJECT_SUFFIX and TARGET_EXECUTABLE_SUFFIX. + * config/i386/cygwin.h: Likewise. + * config/i386/mingw32.h: Likewise. + * config/vax/vms.h: Likewise. + * config/i386/djgpp.h: Remove NO_AUTO_EXE_SUFFIX. + + * config/alpha/xm-vms.h: Change OBJECT_SUFFIX and EXECUTABLE_SUFFIX + to HOST_OBJECT_SUFFIX and HOST_EXECUTABLE_SUFFIX. + * config/i386/xm-cygwin.h: Likewise. + * config/i386/xm-djgpp.h: Likewise. + * config/i386/xm-mingw32.h: Likewise. + * config/vax/xm-vms.h: Likewise. + + * mkdeps.c (deps_add_default_target): Use TARGET_OBJECT_SUFFIX + instead of OBJECT_SUFFIX. + * collect2.c (find_a_file): Look for files matching the extension + HOST_EXECUTABLE_SUFFIX instead of EXECUTABLE_SUFFIX. + * gcc.c (DEFAULT_SWITCH_CURTAILS_COMPILATION): Depend on + TARGET_EXECUTABLE_SUFFIX. + (find_a_file): Use HOST_EXECUTABLE_SUFFIX. + (make_relative_prefix): Likewise. + (convert_filename): Use TARGET_ suffixes throughout. Remove + NO_AUTO_EXE_SUFFIX. + (process_command): Likewise. + (do_spec_1): Likewise. + * java/lang.c (init_parse): Likewise. + + * gcc.texi : Document four new options matching the pattern + (HOST|TARGET)_(OBJECT|EXECUTABLE)_SUFFIX. Remove documentation + for deleted macros OBJECT_SUFFIX and EXECUTABLE_SUFFIX. Remove + documentation for NO_AUTO_EXE_SUFFIX. + +2001-04-19 Mark Mitchell + + * toplev.h (struct lang_hooks): Allow decode_option to indicate + that language-independent processing should not be done. + * toplev.c (main): Adjust accordingly. + + * rtl.texi (jump_insn): Expand on JUMP_LABEL documentation. + * loop.c (load_mems): Handle a NULL JUMP_LABEL for a JUMP_INSN. + + * mips.md (reload_outputdi): Require that operand0 be a + general_operand. + +2001-04-19 Jakub Jelinek + + * invoke.texi (-Wshadow): Clarify. + +2001-04-18 Mark Mitchell + + * loop.c (load_mems): Examine all the instructions in the loop + before concluding that all jumps branch to the first instruction + after the loop. + +Wed Apr 18 20:32:03 2001 Christopher Faylor + + * config/i386/xm-cygwin.h (CPP_SPEC): Fix typo. + +2001-04-18 Jakub Jelinek + + * cpp.texi (-Wwhite-space): Remove. + (-Wall): -Wall does not imply -Wwhite-space. + +2001-04-17 Zack Weinberg + + * dbxout.c (dbxout_init): If DBX_OUTPUT_GCC_MARKER is defined, + use it instead of blindly generating a .stabs. + * xcoffout.h: Define DBX_OUTPUT_GCC_MARKER so we put the type + in the right place. + * xcoffout.c: Don't bother defining default for N_CATCH. + (UNKNOWN_STAB): Use internal_error. + (stab_to_sclass): Remove now-unnecessary aborts. + Remove #if 0'ed case N_BROWS. Add #ifdef N_OPT block. + +Tue Apr 17 21:41:11 2001 Jeffrey A Law (law@cygnus.com) + + * jump.c (mark_all_labels): Canonicalize the tail recursion + label attached to CALL_PLACEHOLDER insns. + +2001-04-17 Kaveh R. Ghazi + + * output.h (dump_flow_info, free_basic_block_vars, + which_alternative): Delete redundant prototypes. + + * rtl.h (bss_section): Likewise. + +2001-04-17 Loren J. Rittle + + * dbxout.c (N_OPT): Define if not available from + +2001-04-17 John David Anglin + + * vax.h (PROMOTE_PROTOTYPES): Define for compatibility with system + libraries and native K&R compilers. + +2001-04-16 Kaveh R. Ghazi + + * c-typeck.c (convert_arguments): Don't check for width changes + with -Wtraditional. + + * invoke.texi (-Wtraditional): Update documentation. + +2001-04-16 Zack Weinberg + + * toplev.c (output_lang_identify): Delete. + (compile_file): Don't call ASM_IDENTIFY_GCC or ASM_IDENTIFY_LANGUAGE. + Don't generate gcc2_compiled. label. Don't emit a nop if profiling. + If IDENT_ASM_OP is defined, emit an .ident "GCC (GNU) " + after calling ASM_FILE_END. + + * dbxout.c (dbxout_init): Don't call ASM_IDENTIFY_GCC_AFTER_SOURCE. + Instead, unconditionally emit an N_OPT stab with string equal + to STABS_GCC_MARKER, which defaults to "gcc2_compiled." + + * defaults.h: Don't provide default for ASM_IDENTIFY_LANGUAGE. + + * config/dbxelf.h, config/freebsd.h, config/nextstep.h, + config/psos.h, config/ptx4.h, config/1750a/1750a.h, + config/alpha/alpha.h, config/alpha/elf.h, config/arc/arc.h, + config/arm/aof.h, config/arm/coff.h, config/arm/elf.h, + config/arm/linux-elf.h, config/avr/avr.h, config/d30v/d30v.h, + config/dsp16xx/dsp16xx.h, config/h8300/h8300.h, + config/i370/i370.h, config/i386/beos-elf.h, + config/i386/osf1elf.h, config/i386/osfrose.h, + config/ia64/sysv4.h, config/m68k/3b1.h, config/m68k/auxgas.h, + config/m68k/crds.h, config/m68k/hp320.h, config/m68k/m68kv4.h, + config/m68k/mot3300.h, config/m68k/news.h, config/m68k/sgs.h, + config/m68k/tower-as.h, config/mcore/mcore-elf.h, + config/mips/iris6.h, config/mips/osfrose.h, + config/mips/sni-svr4.h, config/pa/som.h, config/pdp11/pdp11.h, + config/sparc/sp64-elf.h: + Delete definitions of any or all of: ASM_IDENTIFY_GCC, + ASM_IDENTIFY_GCC_AFTER_SOURCE, and ASM_IDENTIFY_LANGUAGE. + + * config/elfos.h, config/freebsd.h, config/linux.h, + config/alpha/elf.h, config/arm/linux-elf.h, config/i386/i386elf.h, + config/i386/ptx4-i.h, config/mips/gnu.h, config/mips/linux.h, + config/sparc/linux.h, config/sparc/linux64.h: Delete definitions + of ASM_FILE_START which merely emit a .version directive. Delete + definitions of ASM_FILE_END which merely emit an .ident directive. + + * config/avr/avr.h, config/vax/vax.h: Delete definition of + ASM_IDENTIFY_GCC and move part of its logic into + ASM_FILE_START. + + * config/i386/att.h, config/i386/gas.h, config/i386/linux.h, + config/sparc/linux-aout.h: Don't emit .version directive in + ASM_FILE_START. + + * config/i386/dgux.c, config/m88k/m88k.c, config/sh/sh.c + (output_file_start): Correct comment. + + * config/i386/osfrose.h: Don't emit trailing .ident directive. + * config/m68k/mot3300.h: Override STABS_GCC_MARKER to "gcc2_compiled%" + to match gdb. + * config/pa/lib2funcs.asm: Delete gcc_compiled. label. + * config/rs6000/aix.h: Correct comment. + + * config/i386/i386afe.h: Delete. + * config.gcc: Remove references to i386afe.h. + + * tm.texi: Delete documentation of ASM_IDENTIFY_GCC. The + other macros deleted by this patch were undocumented. + +Mon Apr 16 08:03:48 2001 Jeffrey A Law (law@cygnus.com) + + * pa.md (reload_outdi): Operand 0 must be a non hard register. + + * pa.c (secondary_reload_class): SAR<->FP copies require a + secondary register. + + * install.texi (mips-mips-bsd): Update list of functions + required to include memmove. + * tm.texi (TARGET_MEM_FUNCTIONS): Update list of implicitly + used functions to include memmove. + +2001-04-15 Toon Moene + + * i386.md (sqrtdf2): SFmode should be DFmode. + +2001-04-15 Alexandre Oliva + + * gcse.c (compute_ld_motion_mems): ASM outputs aren't moveable. + (find_moveable_store): Likewise. + +2001-04-15 Jim Wilson + + * function.c (expand_function_end): Handle PARALLEL real_decl_rtl. + +Sat Apr 14 16:24:19 CEST 2001 Jan Hubicka + + * i386.md (ashldi3_1_rex64): Add 'J' to the constraints + (ashrdi3_1_rex64): Change 'n' constraint to 'J'. + +2001-04-14 Alexandre Oliva + + * config/mn10300/mn10300.md (cmpsi): Tell reload to disregard the + first alternative. + +2001-04-14 Alan Modra + + * pa.c (force_mode): New function. + (emit_move_sequence): Use it instead of generating new rtx_REGs. + +2001-04-13 Jim Wilson + + * config/ia64/ia64.c (ia64_expand_epilogue): Emit alloc if sibcall_p. + (first_instruction): New static variable. + (rtx_needs_barrier): Return 1 for alloc. + (init_insn_group_barriers): Set first_instruction. + (rws_sum): Delete duplicate definition. + (group_barrier_needed_p): Return 0 when first_instruction true. + (safe_group_barrier_needed_p): Save and restore first_instruction + around group_barrier_needed_p call. + +Fri Apr 13 21:40:28 2001 Loren J. Rittle + + * expr.h (enum libfunc_index): Add LTI_memmove. + (memmove_libfunc): Define macro. + * optabs.c (init_optabs): Initialize memmove_libfunc. + * expr.c (expand_assignment): Use memmove_libfunc instead of + memcpy_libfunc. + +2001-04-13 Alan Modra + + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Disallow PIC LO_SUM + fp mode addresses. + +2001-04-13 Kaveh R. Ghazi + + * Makefile.in (reg-stack.o): Depend on reload.h. + (insn-attrtab.o): Depend on flags.h. + + * genattrtab (main): Include flags.h in insn-attrtab.c. + + * reg-stack.c: Include reload.h. + + * sparc.h (flag_pic): Delete redundant declaration. + + * output.h (flag_pic): Likewise. + + * tree.h (pedantic): Likewise. + +2001-04-13 Kaveh R. Ghazi + + * Makefile.in (toplev.o, jump.o, regmove.o): Depend on reload.h + + * jump.c, regmove.c, toplev.c: Include reload.h. + + * reload.h (reload_cse_regs): Declare. + + * rtl.h (find_equiv_reg, operands_match_p, safe_from_earlyclobber, + reload_cse_regs, init_reload, mark_home_live, reload, + init_caller_save): Delete redundant prototypes. + +2001-04-13 Kaveh R. Ghazi + + * Makefile.in (ssa.o, regclass.o): Depend on $(EXPR_H). + + * regclass.c, ssa.c: Include expr.h. + + * rtl.h (memory_address, force_reg, emit_queue, emit_move_insn, + gen_move_insn): Delete redundant declarations. + +2001-04-13 Franz Sirl + + * Makefile.in (CFLAGS, BOOT_CFLAGS): Partly revert 2000-10-27 patch. + (stage1_build): Instead pass down STAGE1_CFLAGS here. Pass down + MAKEINFO and MAKEINFOFLAGS too. + (stage4_build): Correctly order -B flags. + +2001-04-13 Alan Modra + + * pa.c (hppa_init_pic_save): Set rtx_unchanging for + PIC_OFFSET_TABLE_SAVE_RTX. + (zdepi_cint_p): Describe zdepi insn. + Formatting and white space fixes throughout file. + + * pa.c (uint32_operand): Don't use long constant >= 2^32. + (emit_move_sequence): Use HOST_WIDE_INT constants. Don't worry + about 32->64 bit sign extension if 32 bit HOST_WIDE_INTs. + (compute_movstrsi_length): Make `align' unsigned to avoid warning. + (output_64bit_and): Use plain `int's for shift counts. + (output_64bit_ior): Likewise. + (function_arg_partial_nregs): Use unsigned vars to avoid warnings. + * pa.h (CONST_OK_FOR_LETTER_P): Use HOST_WIDE_INT constants for case + `N', and simplify. + + * pa-hpux10.h (NEW_HP_ASSEMBLER): Define to 1. + * pa-hpux11.h (NEW_HP_ASSEMBLER): Likewise. + * pa.h (LEGITIMATE_CONSTANT_P) Collapse two defines depending on + NEW_HP_ASSEMBLER into one. Kill warnings. + + * pa-gas.h: Delete file. + * config.gcc: Match `parisc' as well as `hppa' for cpu_type=pa. + Add new targets hppa*64*-*-linux* and parisc*64*-*-linux*. Update + hppa*-*-linux*. For all pa targets, remove pa/gas.h from tm_file, + instead setting MASK_GAS | MASK_JUMP_IN_DELAY in target_cpu_default2. + + * config/pa/mill32.S: New file. + * config/pa/mill64.S: New file. + * config/pa/t-linux (LIBGCC1, CROSS_LIBGCC1, LIB1ASMFUNCS, + LIB1ASMSRC, CRTSTUFF_T_CFLAGS_S, TARGET_LIBGCC2_CFLAGS): Define. + * config/pa/t-linux64: New file. + * config/pa/t-pa64 (CROSS_LIBGCC1): Change to libgcc1-asm.a + (LIB1ASMFUNCS, LIB1ASMSRC): Define. + (TARGET_LIBGCC2_CFLAGS): Add -Dpa64=1 -DELF=1. + + * elfos.h (SELECT_SECTION): Undef before defining. + * pa-linux.h (LINUX_DEFAULT_ELF, PTRDIFF_TYPE, CPP_SPEC): Remove. + (LIB_SPEC): Remove -lmilli. + (DBX_REGISTER_NUMBER): Remove. + (PREFERRED_DEBUGGING_TYPE, DWARF2_ASM_LINE_DEBUG_INFO, + (DWARF2_UNWIND_INFO, ASM_SPEC, LINK_SPEC, FUNCTION_OK_FOR_SIBCALL, + NO_PROFILE_COUNTERS, SELECT_RTX_SECTION, INCOMING_RETURN_ADDR_RTX, + DWARF_FRAME_RETURN_COLUMN, STRING_ASM_OP, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP, ASM_FILE_START, + ASM_OUTPUT_DEF, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT, + ASM_OUTPUT_LABEL, ASM_GLOBALIZE_LABEL, ASM_DECLARE_FUNCTION_NAME, + TARGET_GAS): Define. + * pa.c (output_arg_descriptor): Disable for TARGET_ELF32. + (function_arg): If TARGET_ELF32, pass fp args in both general and fp + regs if we don't have a prototype. + * pa.md (canonicalize_funcptr_for_compare): Not for TARGET_ELF32. + * pa.h (TARGET_ELF32): Default to 0 if undefined. + (EH_RETURN_DATA_REGNO, EH_RETURN_STACKADJ_RTX, + EH_RETURN_HANDLER_RTX): Define. + * pa32-regs.h (DBX_REGISTER_NUMBER): Remove unnecessary test. + (DWARF_FRAME_REGNUM): Define. + * pa64-regs.h (DWARF_FRAME_REGNUM): Define. + * pa32-linux.h: New file. + * pa64-linux.h: New file. + + * pa-64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Define. + (ASM_OUTPUT_DOUBLE_INT): Format, protect macro with do..while. + (LINK_SPEC, LIB_SPEC, MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, + NEW_HP_ASSEMBLER, ASM_FILE_START, OBJECT_FORMAT_ELF, + DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_FORMAT, + DWARF2_ASM_LINE_DEBUG_INFO, USE_CONST_SECTION, CONST_SECTION_ASM_OP, + CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP, INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, + READONLY_DATA_SECTION, CONST_SECTION_FUNCTION, CTORS_SECTION_FUNCTION, + DTORS_SECTION_FUNCTION, ASM_OUTPUT_SECTION_NAME, MAKE_DECL_ONE_ONLY, + UNIQUE_SECTION_P, UNIQUE_SECTION, INT_ASM_OP, ASM_OUTPUT_CONSTRUCTOR, + ASM_OUTPUT_DESTRUCTOR, TYPE_ASM_OP, SIZE_ASM_OP, ASM_WEAKEN_LABEL, + TYPE_OPERAND_FMT, ASM_DECLARE_RESULT): Move to.. + * pa64-hpux.h: New file. + (ASM_FILE_START): Correct typo. + (PREFERRED_DEBUGGING_FORMAT): Rename to PREFERRED_DEBUGGING_TYPE. + * config.gcc: Modify for above. + +Fri Apr 13 00:09:22 EDT 2001 John Wehle (john@feith.com) + + * jump.c (jump_optimize_1): Don't delete dead stores here. + * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns + prior to running jump optimize before cse2. + +2001-04-12 Richard Henderson + + * Makefile.in (regmove.o): Depend on except.h. + * regmove.c: Include it. + +2001-04-12 Stan Shebs + + * objc/objc-act.c: Remove all code ifdefed with the never-used + macro OBJC_INT_SELECTORS. + * config/d30v/d30v.h: Remove commented-out ref to OBJC_INT_SELECTORS. + * tm.texi: Remove doc for OBJC_INT_SELECTORS. + +Thu Apr 12 18:13:37 2001 Rodney Brown + + * config/pa/quadlib.c: Add prototypes. + +2001-04-12 Kaveh R. Ghazi + + * bitmap.h (debug_bitmap): Delete redundant prototype. + + * rtl.h (get_frame_size): Likewise. + +2001-04-12 Jim Wilson + + * config/ia64/ia64.md (extendsfdf2, extendsftf2, extenddftf2): Simplify + to just emit an fnorm. + +2001-04-12 Kaveh R. Ghazi + + * c-common.h (truthvalue_conversion, type_for_mode, + type_for_size): Delete redundant declarations. + + * c-lex.h (is_class_name): Likewise. + + * c-tree.h (pedantic, convert, getdecls, gettags, + global_bindings_p, init_decl_processing, insert_block, + maybe_build_cleanup, poplevel, print_lang_decl, + print_lang_identifier, print_lang_type, pushdecl, pushlevel, + set_block, incomplete_type_error, build_function_call, + lvalue_or_else, mark_addressable): Likewise. + + * expr.h (expand_tree_builtin): Likewise. + +2001-04-12 Mark Mitchell + + * invoke.texi: Document --param max-gcse-memory. + +2001-04-12 Kaveh R. Ghazi + + * configure.in (errno): Check for declaration. + * configure, config.in: Regenerated. + + * system.h (errno): Only declare if not already done. + +2001-04-12 Alexandre Oliva + + * recog.c (general_operand, immediate_operand, + nonmemory_operand): Require CONST_INTs to be sign-extended + values for their modes. + +2001-04-12 Alexandre Oliva + + * expmed.c (store_bit_field): Truncate CONST_INTs. + (expand_mult_highpart, expand_divmod): Likewise. + * expr.c (convert_modes, store_field): Likewise. + * integrate.c (expand_inline_function): Use promote_mode() to + determine whether to convert_modes() an argument as signed + or unsigned. + * optabs.c (expand_binop): Get CONST_INT operands + sign-extended for their appropriate modes. + * stmt.c (emit_case_nodes): Convert node values to the + appropriate mode. + (expand_end_case): Convert minval and range to the appropriate + mode. + * unroll.c (loop_iterations): Truncate abs_diff to the mode of + the iteration variable. + * varasm.c (immed_double_const): Don't require words to be + narrower than host wide ints to properly sign-extend + CONST_INTs. + +2001-04-12 kaz Kojima + + * sh.md (builtin_setjmp_receiver): New expander. + +2001-04-12 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_move): Do not + special-case HOST_BITS_PER_WIDE_INT != 32. Use same criteria + for generating CONST_INT and CONST_DOUBLE. + +2001-04-12 Alexandre Oliva + + * config/rs6000/rs6000.c (logical_operand): CONST_INTs are + already sign-extended. + (rs6000_emit_prologue): Make register iterator signed. + (rs6000_emit_epilogue): Likewise. + * config/rs6000/rs6000.md (addsi3, adddi3): Sign-extend high + and low. + (movsf split, movdf split): Sign-extend CONST_INTs. + (movdi splits): Likewise. + +2001-04-12 Kelley Cook + + * config-lang.in (lang_dirs): Add in zlib. + +2001-04-11 Alexandre Oliva + + * config/i386/i386.md: Apply trunc_int_for_mode() to GEN_INT + operands that make it to RTL. + +2001-04-11 Stan Shebs + + Add Darwin (Mac OS X kernel) native support. + * config.gcc (powerpc-*-darwin*): Add native bits. + * config/darwin.c: New file, generic Darwin support functions. + * config/darwin.h: New file, generic Darwin definitions. + * config/darwin-protos.h: New file, generic Darwin prototypes. + * rs6000/darwin.h: New file, Darwin for PowerPC. + * rs6000/t-darwin: New file, Darwin makefile fragment. + * rs6000/rs6000.h (OBJECT_MACHO): New macro. + (TARGET_MACHO): Ditto. + (rs6000_abi): Add ABI_DARWIN. + (RS6000_REG_SAVE): Add ABI_DARWIN case. + (RS6000_SAVE_AREA): Ditto. + (FP_ARG_MAX_REG): Ditto. + (RETURN_ADDRESS_OFFSET): Ditto. + * rs6000/rs6000.c (rs6000_legitimize_address): Add TARGET_MACHO + cases. + (rs6000_emit_move): Add ABI_DARWIN cases. + (print_operand): Ditto. + (first_reg_to_save): Ditto. + (rs6000_stack_info): Ditto, also align stack by 16 instead of 8. + (debug_stack_info): Ditto. + (rs6000_emit_prologue): Ditto. + (rs6000_emit_epilogue): Ditto. + (output_profiler_hook): Ditto. + (output_function_profiler): Ditto. + (rs6000_add_gc_roots): Call machopic_add_gc_roots if TARGET_MACHO. + (output_mi_thunk): Add TARGET_MACHO case. + (add_compiler_stub): Ditto. + (output_compiler_stub): Ditto. + (no_previous_def): Ditto. + (output_call): Ditto. + (machopic_output_stub): Ditto. + (rs6000_machopic_legitimize_pic_address): Ditto. + (toc_section): Ditto. + * rs6000/rs6000.md (addsi3_high): New TARGET_MACHO pattern. + (macho_high): Ditto. + (macho_low): Ditto. + (movsi_low): Ditto. + (load_macho_picbase): Ditto. + (call): Add TARGET_MACHO case to modify function. + (call_value): Ditto. + (call_nonlocal_sysv): Add ABI_DARWIN case. + (call_value_nonlocal_sysv): Ditto. + * rs6000/rs6000-protos.h (rs6000_machopic_legitimize_pic_address): + Add prototype. + (machopic_output_stub): Ditto. + * ginclude/stddef.h: Test _BSD_WCHAR_T_DEFINED_. + +2001-04-11 Mark Mitchell + + * dwarf2out.c (modified_type_die): Don't create new types here. + * tree.h (get_qualified_type): New function. + (build_qualified_type): Adjust comment. + * tree.c (get_qualified_type): New function. + (build_qualified_type): Use it. + +2001-04-11 Kaveh R. Ghazi + + * cpp.texi (-Wtraditional): Update description. + + * invoke.texi (-Wtraditional): Likewise. + +2001-04-11 Jim Wilson + + * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Return 128 if argument + requires more than 64 bits of alignment. + +2001-04-11 Neil Booth + + * cpplib.c (do_line): Sanity check iff enable checking. + +2001-04-11 Richard Henderson + + * Makefile.in (insn-recog.o): Depend on toplev.h. + (insn-emit.o, doloop.o): Likewise. + * genrecog.c, genemit.c: Include toplev.h in generated file. + * doloop.c: Include toplev.h. + +2001-04-11 Mark Mitchell + + * Makefile.in (gcse.o): Depend on params.h. + * gcse.c: Include params.h. + (gcse_main): Don't do GCSE if doing so will take inordinate + amounts of memory. + * params.def (PARAM_MAX_GCSE_MEMORY): New parameter. + * params.h (MAX_GCSE_MEMORY): New macro. + +2001-04-11 Kaveh R. Ghazi + + * Makefile.in (insn-output.o): Depend on $(EXPR_H). + + * genoutput.c (output_prologue): Include expr.h in insn-output.c. + +2001-04-11 Kaveh R. Ghazi + + * output.h (assemble_real): Declare if REAL_VALUE_TYPE is defined. + + * real.h (ereal_atof, real_value_truncate, target_isnan, + target_isinf, target_negative, assemble_real, debug_real): Delete + redundant prototypes. + + * Makefile.in (ifcvt.o): Depend on toplev.h. + + * c-semantics.c: Include expr.h. + + * ifcvt.c: Include toplev.h. + + * expr.h (rtx_equal_p): Delete prototype. + + * rtl.h (exact_log2_wide, floor_log2_wide, permalloc, + protect_from_queue, gen_jump, gen_beq, gen_bge, gen_ble, + eliminate_constant_term, expand_complex_abs, find_single_use, + make_tree, init_expr_once, init_optabs, supports_one_only): + Likewise. + + * tree.h (exact_log2_wide, floor_log2_wide, expand_null_return, + rest_of_type_compilation, emit_queue, do_pending_stack_adjust, + expand_assignment, store_expr, emit_line_note_after, + emit_line_note_force, split_specs_attrs, label_rtx): Likewise. + + * toplev.h (exact_log2_wide, floor_log2_wide): Add prototype. + + * sparc-protos.h: Delete redundant prototypes. + +2001-04-11 Vladimir Makarov + + * reload.c (push_reload): Add condition missed in SUBREG byte + offset patch. + +Wed Apr 4 00:28:23 2001 Rainer Orth + + * sparc/sol2-sld-64.h (STARTFILE_SPEC): Added missing blank. + +Wed Apr 11 14:06:10 CEST 2001 Jan Hubicka + + * i386.md (floatsisf_sse): Fix output template + * i386.c (ix86_expand_fp_movcc) + + * reg-stack.c (emit_pop_insn): Handle complex modes. + (move_for_stack_reg): Emit proper move mode. + (subst_stack_regs_pat): Handle complex modes. + +2001-04-11 Jakub Jelinek + + * cpplex.c (_cpp_lex_token): Only warn if -Wcomment. + +2001-04-10 Richard Henderson + + * libgcc2.h (__terminate_func_ptr): Remove typedef. + (__pure_virtual, __terminate, __terminate_set_func, + __default_terminate, __throw_type_match, __empty, + __get_eh_context, __get_eh_info, __get_dynamic_handler_chain, + __eh_rtime_match, __unwinding_cleanup, __rethrow, + __sjthrow, __sjpopnthrow, __eh_alloc, __eh_free): + Remove prototypes of deleted functions. + +2001-04-10 Kaveh R. Ghazi + + * c-typeck.c (convert_arguments): -Wtraditional now activates + -Wconversion warnings, except for changes in signed-ness. + Detect complex<->int & int<->complex conversions as well. + + * invoke.texi (-Wtraditional): Document it. + +Tue Apr 10 17:45:50 2001 Richard Kenner + + * gcse.c (update_ld_motion_stores): Don't use variable I for an insn. + * flow.c (set_block_for_new_insns): Remove needless cast and + properly check for unset block number. + +2001-04-10 Andrew MacLeod + + * function.c (purge_single_hard_subreg_set): Only check REGNO if + the subreg was a hard register. Pseudos are left as subregs. + +2001-04-09 Franz Sirl + + * Makefile.in (LIB2FUNCS_STATIC_EXTRA): New macro. + (LIB2ADD_ST): New macro, pass it to mklibgcc. + * mklibgcc.in (libgcc2_st_objs): New variable, set it from LIB2ADD_ST. + (libgcc_st_objs): New, set from libgcc2_st_objs. Use it for libgcc.a. + * config/rs6000/t-ppccomm (LIB2FUNCS_STATIC_EXTRA): New macro. + +2001-04-09 Bo Thorsen + + * config/i386/i386.md: "TARGET_64BIT && TARGET_64BIT": Removed one. + +2001-04-09 Andrew MacLeod + + * output.h (set_block_num): Missed it earlier, remove deprecated + prototype. + +2001-04-09 Andrew MacLeod + + * gcse.c (oprs_unchanged_p): Pass basic_block to load_killed_in_block_p. + (load_killed_in_block_p): Change bb parameter from int to basic_block. + (oprs_not_set_p): Pass basic_blocks instead of ints as parameters. + (handle_rd_kill_set): Change bb parameter from int to basic_block. + (compute_kill_rd): Pass basic_blocks instead of ints as parameters. + (expr_killed_p): Change bb parameter from int to basic_block, pass + basic_blocks instead of ints as parameters. + (compute_ae_kill): Pass basic_blocks instead of ints as parameters. + (expr_reaches_here_p_work, expr_reaches_here_p): Change bb parameter + from int to basic_block, pass basic_blocks instead of ints as parms. + (pre_expr_reaches_here_p_work, pre_expr_reaches_here_p): Change bb + parameter from int to basic_block, pass basic_blocks instead of ints. + (process_insert_insn): Pass basic_blocks instead of ints as parameters. + (insert_insn_end_bb): Change bb parameter from int to basic_block, + pass basic_blocks instead of ints. + (pre_edge_insert, pre_insert_copy_insn, pre_insert_copies): Pass + basic_blocks instead of ints as parameters. + (pre_delete): Pass basic_blocks instead of ints as parameters. + (hoist_expr_reaches_here_p): Change bb parameter from int to + basic_block, pass basic_blocks instead of ints. + (hoist_code): Pass basic_blocks instead of ints as parameters. + (reg_set_info, store_ops_ok, store_killed_after, store_killed_before): + Change bb parameter from int to basic_block. + (build_store_vectors): Pass basic_blocks instead of ints as parameters. + (insert_insn_start_bb): Change bb parameter from int to basic_block, + pass basic_blocks instead of ints. + (insert_store): Pass basic_blocks instead of ints as parameters. + (replace_store_insn, delete_store): Change bb parameter from int to + basic_block, pass basic_blocks instead of ints. + (store_motion): Pass basic_blocks instead of ints as parameters. + +2001-04-09 Andrew MacLeod + + * basic-block.h (set_new_block_for_insns): New Prototype. + (set_block_num): Delete prototype. + * flow.c (set_block_num): Remove obsolete function. + (set_block_for_new_insns): Set BB for single or multiple insns. + * gcse.c (handle_avail_expr): Use set_block_for_new_insns. + (process_insn_end_bb): Use set_block_for_new_insns or + set_block_for_insn instead of set_block_num. + (pre_insert_copy_insn): Use set_block_for_new_insns. + (update_ld_motion_stores): Use set_block_for_new_insns. + (insert_insn_start_bb): Use set_block_for_new_insns. + (replace_store_insn): Use set_block_for_new_insns. + +2001-04-09 Andrew MacLeod + Jeff Law + + * alias.c (get_addr): Externalize. + (canon_true_dependence): New function. Behaves like true_dependance + except it already assumes a MEM has been canonicalized. + * flags.h (flag_gcse_lm, flag_gcse_sm): New optimization flags. + * gcse.c (struct ls_expr): Add load/store expressions structure. + (modify_mem_list, canon_modify_mem_list): New variable. + (gcse_main): Initialize & finalize alias analysis. Use enhanced + load motion and store motion if requested. + (alloc_gcse_mem): Allocate space for modify_mem_list array. + (free_gcse_mem): Free the modify_mem_list array. + (oprs_unchanged_p): Use load_killed_in_block_p. + (gcse_mems_conflict_p, gcse_mem_operand): New variables. + (mems_conflict_for_gcse_p): New function. Don't kill loads + with stores to themselves if its in the load/store expression list. + (load_killed_in_block_p): New function. + (canon_list_insert): New Function. + (record_last_mem_set_info): Keep a list of all instructions which + can modify memory for each basic block. + (compute_hash_table, reset_opr_set_tables): Clear modify_mem_list. + (oprs_not_set_p): Use load_killed_in_block_p. + (mark_call, mark_set, mark_clobber): Use record_last_mem_set_info. + (expr_killed_p): Use load_killed_in_block_p. + (compute_transp): Do not pessimize memory references. + (pre_edge_insert): Update stores for a load motion expression. + (one_pre_gcse_pass): Check loads/stores for extra load motion. + (ldst_entry): Find or create a ldst_expr structure. + (free_ldst_entry): Free memory for an individual item. + (free_ldst_mems): Free entire load/store expression list. + (print_ldst_list): Print debug info. + (find_rtx_in_ldst): Try to find an rtx expression in the ldst list. + (enumerate_ldsts): Assign integer values to each entry in list. + (first_ls_expr): First expression in the list. + (next_ls_expr): Next expression in the list. + (simple_mem): Check if expression qualifies for ld/st expression list. + (invalidate_any_buried_refs): Remove from expression list if its + used in some other way we don't understand. + (compute_ld_motion_mems): Find all potential enhanced load motion + expression. + (trim_ld_motion_mems): Remove any expressions which are invalid. + (update_ld_motion_stores): Copy store values to registers for loads + which have been moved. + (regvec, st_antloc, num_store): New global statics. + (reg_set_info): Marks registers as set. + (store_ops_ok): Verfies registers expressions are valid in a block. + (find_moveable_store): Look for moveable stores in a pattern. + (compute_store_table): Find stores in a function worth moving, maybe. + (load_kills_store): Check dependence of a load and store. + (find_loads): Find any loads in a pattern. + (store_killed_in_insn): Check if a store is killed in an insn. + (store_killed_after): Check is store killed after an insn in a block. + (store_killed_before): Check is store killed before an insn in a block. + (build_store_vectors): Generate the antic and avail vectors. + (insert_insn_start_bb): Insert at the start of a BB, update BLOCK_HEAD. + (insert_store): Add a store to an edge. + (replace_store_insn): Replace a store with a SET insn. + (delete_store): Delete a store insn. + (free_store_memory): Free memory. + (store_motion): Perform store motion. + * invoke.texi: Add documentation for -fcse-lm and -fgcse-sm. + * rtl.h (get_addr, canon_true_dependence): Add prototypes. + * toplev.c (flag_gcse_lm, flag_gcse_sm): New Variables. + (f_options): Add gcse-lm and gcse-sm. + +Mon Apr 9 16:18:03 CEST 2001 Jan Hubicka + + * i386.c (expand_fp_movcc): Fix condition reversal code. + + * i386.c (ix86_register_move_cost): Fix handling of reformating penalty + * i386.h (INTEGER_CLASS_P, MAYBE_INTEGER_CLASS_P): New. + (CLASS_MAX_NREGS): Use it. + + * i386.h (HARD_REGNO_NREGS): Handle properly TF and TCmodes on 64bit; + handle properly complex values. + (CLASS_MAX_NREGS): Likewise; update comment. + +2001-04-05 Bernd Schmidt + + * ia64.c (ia64_flag_schedule_insns2): New variable. + (ia64_override_options): Initialize it. Clear + flag_schedule_insns_after_reload. + (ia64_reorg): Only do scheduling if ia64_flag_schedule_insns2. + +Mon Apr 9 15:09:13 CEST 2001 Jan Hubicka + + * i386.md (truncdfsf2_*): Add i387->int/sse reg alternatives; + Do not require source to match destination anymore; + Add abort to the nontrivial cases that should be handled by split. + (fix_trunc?fdi): Add SSE case for x86_64. + (floatdi?f): Likewise. + (floatdi?f_sse): New. + (fix_trunc?fdi_sse): New. + +2001-04-09 Richard Sandiford + + * dwarfout.c (DEBUG_ARANGES_BEGIN_LABEL): New label. + (DEBUG_ARANGES_END_LABEL): Ditto. + (dwarfout_init): Generate length and version fields at the start + of the .debug_aranges info. Insert DEBUG_ARANGES_BEGIN_LABEL + after the length field. + (dwarfout_finish): Insert DEBUG_ARANGED_END_LABEL at the end of + the .debug_aranges info. + +Sun Apr 8 00:43:27 CEST 2001 Jan Hubicka + + * i386.c (call, call_value): Make sure that resulting call_insn + does have proper second operand. + +Sun Apr 8 22:50:49 2001 Christopher Faylor + + * config/i386/xm-cygwin.h (GET_ENV_PATH_LIST): Eliminate obsolete + function. Remove include of sys/cygwin.h. + +Sun Apr 8 22:20:27 2001 Christopher Faylor + + * config/i386/cygwin.h (STARTFILE_SPEC): search */lib/w32api by default. + (CPP_SPEC): Always search */include/w32api for header files. + (ASM_OUTPUT_SECTION_NAME): Avoid testing NULL DECL. + (LINK_SPEC): Add "cyg" to the library search prefixes. + +2001-04-08 Philip Blundell + + * config/arm/arm.h (ASM_OUTPUT_LABELREF): Use asm_fprintf. + +2001-04-08 Neil Booth + + * cpperror.c (print_location): Don't special case . + (_cpp_begin_message): Handle WARNING_SYSHDR the same as + WARNING, but we don't check if we're in system headers. + * cpplib.h (enum error_type): WARNING_SYSHDR: New. + * cpplib.c (do_warning): Warn in system headers. + +2001-04-07 Mumit Khan + + * mbchar.c: Include config.h first. + +2001-04-07 Zack Weinberg + + * config.gcc: Set default for xmake_file at top, not bottom. + Change places that set xmake_file to "none" to set to the + empty string instead, or remove them entirely if there is no + default xmake_file for this cpu_type. Remove references to + deleted files. + + * config/x-lynx, config/convex/x-convex, config/elxsi/x-elxsi, + config/i386/x-isc, config/i386/x-isc3, config/i386/x-ncr3000, + config/i386/x-next, config/i386/x-sco, config/i386/x-sysv3, + config/i386/x-vsta, config/i860/x-sysv4, config/m68k/x-amix, + config/m68k/x-apollo68, config/m68k/x-ccur, config/m68k/x-crds, + config/m68k/x-hp2bsd, config/m68k/x-mot3300, config/m68k/x-mot3300-gas, + config/m68k/x-tower, config/m88k/x-sysv4, config/mips/x-dec-osf1, + config/mips/x-sni-svr4, config/mips/x-ultrix, config/romp/x-mach, + config/romp/x-romp, config/rs6000/x-beos, config/rs6000/x-lynx, + config/rs6000/x-mach, config/rs6000/x-sysv4, config/sparc/x-sysv4: + Delete. + + * config/a29k/x-unix, config/i386/x-aix, config/i386/x-osf1elf, + config/i386/x-osfrose, config/m68k/x-dpx2, config/mips/x-iris3, + config/mips/x-mips, config/mips/x-osfrose, config/mips/x-sony, + config/mips/x-sysv, config/rs6000/x-aix31: + Just set CLIB to -lld or -lmld, as appropriate. + + * config/arm/x-riscix, config/i370/x-oe, config/i386/x-dgux, + config/i386/x-sco4, config/i386/x-sco5, config/m68k/x-hp320, + config/m68k/x-hp320g, config/m68k/x-next, config/m88k/x-dgux, + config/mips/x-iris, config/pa/x-pa: + Just set (some of) FIXPROTO_DEFINES, STMP_FIXPROTO, + OTHER_FIXINCLUDES_DIRS. + + * config/i386/x-djgpp: Don't set LN or LN_S. + * config/m88k/x-dolph: Don't define __m88k__. + * config/m88k/x-tekXD88: Don't set AR_FLAGS. + * config/pa/x-pa-mpeix: Just set up quadlib.asm. + * config/i860/fx2800.h: No need to #undef SVR4. + + 38 x-host fragments remain, 2 x-cpu. + +2001-04-07 Herman A.J. ten Brugge + + * c4x.h (HARD_REGNO_NREGS): HCmode mode uses 2 regs not 4. + +2001-04-06 Neil Booth + + * cpplib.c (cpp_push_buffer): Give stdin buffers the name . + +2001-04-06 Neil Booth + + * configure.in: Add check for lstat. + * configure, config.in: Regenerate. + * cppinit.c (append_include_chain): Make empty path ".". + * cpplib.c (do_line): Don't simplify #line paths. + * cppfiles.c (remove_component_p): New function. + (find_or_create_entry): Acknowledge stat () errors during + path simplification. + (handle_missing_header): Don't simplify paths. + (_cpp_simplify_pathname): Don't simplify VMS paths. Return + the empty path untouched. Don't leave a trailing '/'. + +2001-04-06 Benjamin Kosnik + + * cppdefault.c (GPLUSPLUS_BACKWARD_INCLUDE_DIR): Add. + * Makefile.in (-DGPLUSPLUS_BACKWARD_INCLUDE_DIR): Add. + +2001-04-06 Neil Booth + + * cppfiles.c (open_file): Fail directories silently, but + with an errno of NOENT set. + (read_include_file): Move the common exit code to the sole + caller. Return an int indicating success or failure. Let + open_file handle directories. + (stack_include_file): If read_include_file fails, + push a "null" buffer. + +2001-04-05 DJ Delorie + + * function.h (virtuals_instantiated): Declare. + * function.c: (virtuals_instantiated): Make global. + * calls.c (emit_library_call_value_1): Use + virtual_outgoing_args_rtx only if it hasn't been instantiated. + Otherwise, use the stack pointer directly. + +Thu Apr 5 19:13:33 CEST 2001 Jan Hubicka + + * i386.c (x86_initialize_trampoline): New global function. + * i386.h (TRAMPOLINE_SIZE): Size is 23 for x86_64. + (INITIALIZE_TRAMPOLINE): Move offline. + * i386-protos.h (x86_initialize_trampoline): Declare. + +Thu Apr 5 19:02:15 CEST 2001 Jan Hubicka + + * i386.md (movdi_1_rex64): Allow SSE->SSE reg move. + (lea_0): Rename to lea_1. + (lea_1_zext, lea_1_rex64, lea_2_rex64): New patterns. + (lea_general_?): Allow SImodes on TARGET_64BIT + (lea_general_?_zext): New patterns. + (call_1, call_1_rex64): Fix. + +Thu Apr 5 19:00:15 CEST 2001 Jan Hubicka + + * i386.c (ix86_split_long_move): Use PUT_MODE instead of change_address. + +Thu Apr 5 18:25:56 CEST 2001 Jan Hubicka + + * i386.c (function_arg): Return constm1_rtx for last argument. + (ix86_expand_prologue): Update gen_call calls. + * i386.h (FUNCTION_BLOCK_PROFILER_EXIT): Likewise. + * i386.md (call_pop): Likewise. + (call): Second operand is VOIDmode. + (call_0): Likewise; Support 64bits. + (call_exp): New expander. + (call_1): Get to the sync. + (call_1_exp): New pattern. + (call_value): Support 64bit. + (call_value_exp): New pattern. + (untyped_call): Update gen_call call. + (call_value_pop): Disable for 64bit. + (call_value_0_rex64): New pattern. + (call_value_1_rex64): Likewise. + +2001-04-05 Bo Thorsen + + * i386.md: Don't allow "builtin_setjmp_receiver" for TARGET_64BIT. + +Thu Apr 5 13:44:17 2001 J"orn Rennecke + + * i386.md (*andsi_1+3): If used after reload, make sure the operand + satisfies ANY_QI_REG_P. + +2001-04-05 Bernd Schmidt + + * config/ia64/ia64.c (rtx_needs_barrier): A PARALLEL can contain + ASM_OPERAND. + + * sched-deps.c (sched_analyze_insn): Revert more of the March 27 + change. + +2001-04-04 Zack Weinberg + + * config.gcc: Remove default for xm_file. Clean up local + machine type handling. Remove settings of xm_file to + something that doesn't exist. In the big switch, set xm_file, + don't append to it (the value before the big switch is always + null). Don't force build_xm_file or host_xm_file to have a value. + * configure.in: Remove default for xm_file. Do not special + case $cpu/xm-$cpu.h not existing. + * configure: Regenerate. + +2001-04-04 Diego Novillo + + * simplify-rtx.c (simplify_binary_operation): Check for overflow + when folding integer division and modulo operations. + +2001-04-04 Andrew MacLeod + + * dwarf2out.c (output_cfi): Add 'for_eh' parameter, use PTR_SIZE + instead of DWARF2_ADDR_SIZE for EH addresses. + (output_call_frame_info): Use PTR_SIZE instead of DWARF2_ADDR_SIZE for + EH addresses. + +2001-04-04 Richard Henderson + + * config/ia64/ia64.h (IA64_UNWIND_INFO): Disable. + * config/ia64/t-glibc (LIB2ADDEH): Disable. + * config/ia64/t-ia64 (LIB2ADDEH): Disable. + +2001-04-04 Richard Henderson + + * configure.in (gcc_cv_as_leb128): Escape "." in regexp. + * configure: Rebuilt. + +2001-04-04 Jakub Jelinek + + * gcse.c (delete_null_pointer_checks_1): Add delete_list argument, + push insns to delete to it instead of deleting them. + (delete_null_pointer_checks): Delete insns from delete_list after + all delete_null_pointer_checks_1 passes are done. + +2001-04-04 Richard Henderson + + * configure.in (gcc_cv_as_leb128): Tweek minor number extraction. + * configure: Rebuilt. + +2001-04-04 Zack Weinberg + + * expr.h: Remove #ifdef FUNCTION_CONVERSION_BUG logic. + * config/romp/xm-romp.h: Delete. + +2001-04-04 Bernd Schmidt + + * sched-deps.c (sched_analyze_insn): Partially revert March 27 + change. + +2001-04-04 Herman A.J. ten Brugge + + * emit-rtl.c (mark_label_nuses) Increment the label uses for + all labels present in rtx. + (try_split) Call new function for all split insns. + +2001-04-04 Jakub Jelinek + + * recog.c (validate_replace_rtx_1): Instead of aborting just make + sure the change won't be validated. + +Wed Apr 4 00:45:38 EDT 2001 John Wehle (john@feith.com) + + * rtl.h (set_noop_p): Declare. + * flow.c (set_noop_p): Move from here ... + * rtlanal.c (set_noop_p): ... to here and enhance. + * cse.c (delete_trivially_dead_insns): Use it. + * gcse.c (hash_scan_set): Likewise. + * jump.c (delete_noop_moves): Likewise. + * recog.c (split_all_insns): Likewise. + +2001-04-04 Alan Modra + + * dwarf2out.c (dwarf2out_frame_debug_expr): Support adjusting + stack pointer via a LO_SUM. Ditto for setting a temp register + used to save to the stack. Set cfa_temp when setting fp, and + allow matches to cfa_temp in addition to cfa_store when saving + regs. Handle POST_INC and LO_SUM register stores. Document the + changes and errors in rule 12 doco. + + * pa.c (set_reg_plus_d, store_reg, load_reg): Return last insn. + (actual_fsize, local_fsize, save_fregs): Move for store_reg to see. + (load_reg): Move closer to epilogue code. + (DO_FRAME_NOTES): Define to control the following.. + (FRP): Define to set RTX_FRAME_RELATED_P on insns. + (hppa_expand_prologue): Use FRP and REG_FRAME_RELATED_EXPR + notes as necessary. + (hppa_expand_epilogue): Likewise. + +2001-04-03 Richard Henderson + + * configure.in (gcc_cv_as_leb128): Reject gas before 2.11. + * configure: Rebuild. + +2001-04-03 Richard Henderson + + * rtl.h (LCT_THROW): New. + * calls.c (emit_library_call_value_1): Handle it. + * except.c (connect_post_landing_pads): Use it. + +2001-04-03 Zack Weinberg + + * gansidecl.h: Delete file. + * configure.in: Change all refs to gansidecl.h to use + ansidecl.h. Adjust *_file_list so they know where ansidecl.h + lives. + * configure: Regenerate. + + * Makefile.in (intl.o): Don't depend on gansidecl.h. + * defaults.h: s/gansidecl.h/ansidecl.h/ in comment. + * ggc.h, config/fr30/fr30.h, config/mcore/mcore.c: + Don't include gansidecl.h. + * intl.c, main.c, version.c, fixinc/fixlib.h, + fixinc/procopen.c, fixinc/server.c: Include ansidecl.h not + gansidecl.h. + +Tue Apr 3 19:41:21 CEST 2001 Jan Hubicka + + * i386.c (ix86_force_to_memory, ix86_free_from_memory): + Update for 64bit. + +2001-04-03 Zack Weinberg + + * config/i386/xm-beos.h, config/i386/xm-isc.h, + config/i386/xm-next.h, config/i386/xm-sco.h, + config/i386/xm-sco5.h, config/m68k/xm-plexus.h, + config/m88k/xm-m88k.h: Delete. + + * config/i386/xm-djgpp.h: Don't define __MSDOS__. + * config/romp/xm-romp.h: Don't define bcopy. + * config/rs6000/xm-beos.h: Don't define bcopy, HAVE_VPRINTF, + HAVE_PUTENV, HAVE_RENAME, or USE_C_ALLOCA. + + * config.gcc: Remove references to deleted files. + + 14 xm-host.h remain, 1 xm-cpu.h. + +2001-04-03 Jakub Jelinek + David S. Miller + Andrew MacLeod + + Use byte offsets in SUBREGs instead of words. + + * alias.c (nonlocal_mentioned_p): Use subreg_regno function. + * caller-save.c (mark_set_regs): Change callers of subreg_hard_regno + to pass new argument. + (add_stored_regs): Use subreg_regno_offset function. + * calls.c (expand_call): For non-paradoxical SUBREG take endianess + into account. + (precompute_arguments): Use gen_lowpart_SUBREG. + * combine.c (try_combine): Replace explicit XEXP with SUBREG_REG. + (combine_simplify_rtx): Rework to use SUBREG_BYTE. + (simplify_set): Rework to use SUBREG_BYTE. + (expand_field_assignment): Use SUBREG_BYTE. + (make_extraction): Use SUBREG_BYTE. + (if_then_else_cond): Use SUBREG_BYTE. + (apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments. + (gen_lowpart_for_combine): Compute full byte offset. + * cse.c (mention_regs): Use SUBREG_BYTE. + (remove_invalid_subreg_refs): Rework to use SUBREG_BYTE. + (canon_hash): Use SUBREG_BYTE. + (fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword. + (gen_lowpart_if_possible): Formatting. + * dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos + correctly. + * dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG + (mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG + (loc_descriptor): Fixup explicit XEXP into SUBREG_REG + * dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG + (output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG + (output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG + * emit-rtl.c (gen_rtx_SUBREG): New function, used to verify + certain invariants about SUBREGs the compiler creates. + (gen_lowpart_SUBREG): New function. + (subreg_hard_regno): New function to get the final register number. + (gen_lowpart_common): Use SUBREG_BYTE. + (gen_imagpart): Spacing nits. + (subreg_realpart_p): Use SUBREG_BYTE. + (gen_highpart): Use SUBREG_BYTE. + (subreg_lowpart_p): Always compute endian corrected goal offset, + even at the byte level, then compare against that. + (constant_subword): New function, pulled out all constant cases + from operand_subword and changed second argument name to offset. + (operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early + and call constant_subword to do the work. Return const0_rtx if + looking for a word outside of OP. + (operand_subword_force): Change second arg name to offset. + * expmed.c (store_bit_field): Use SUBREG_BYTE. + (store_split_bit_field): Use SUBREG_BYTE. + (extract_bit_field): Use SUBREG_BYTE. + (extract_split_bit_field): Use SUBREG_BYTE. + (expand_shift): Use SUBREG_BYTE. + * expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG. + * final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE. + * flow.c (set_noop_p): Use SUBREG_BYTE. + (mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead. + * function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG. + (fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian + correction code. + (optimize_bit_field): Use SUBREG_BYTE. + (purge_addressof_1): Use SUBREG_BYTE. + (purge_single_hard_subreg_set): Use subreg_regno_offset function. + (assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are + actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true. + * gengenrtl.c (special_rtx): Add SUBREG. + * global.c (mark_reg_store): Use SUBREG_BYTE. + (set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE. + * ifcvt (noce_emit_move_insn): Use SUBREG_BYTE. + * integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure + final byte offset is congruent to subreg's mode size. + (subst_constants): Use SUBREG_BYTE. + (mark_stores): Use subreg_regno_offset function. + * jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset + function and SUBREG_BYTE. + * local-alloc.c (combine_regs): Use subreg_regno_offset function. + (reg_is_born): Use subreg_hard_regno. + * recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte + endian correction code. Don't combine subregs unless resulting + offset aligns with type. Fix subreg constant extraction for DImode. + Simplify SUBREG of VOIDmode CONST_DOUBLE. + (general_operand): Remove dead mode_altering_drug code. + (indirect_operand): Use SUBREG_BYTE. + (constrain_operands): Use subreg_regno_offset function. + * reg-stack.c (get_true_reg): Use subreg_regno_offset function. + * regmove.c (regmove_optimize): Use SUBREG_BYTE. + (optimize_reg_copy_3): Use gen_lowpart_SUBREG. + * regs.h (REG_SIZE): Allow target to override. + (REGMODE_NATURAL_SIZE): New macro which target can override. + * reload.c (reload_inner_reg_of_subreg): subreg_regno should be used + on the entire subreg rtx. + (push_reload): Use SUBREG_BYTE in comments and code. + (find_dummy_reload): Use subreg_regno_offset. Only adjust offsets + for hard registers inside subregs. + (operands_match_p): Use subreg_regno_offset. + (find_reloads): Use SUBREG_BYTE and only advance offset for subregs + containing hard regs. + (find_reload_toplev): Use SUBREG_BYTE. Remove byte endian + corrections when fixing up MEM subregs. + (find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and + subreg_regno_offset where appropriate. + (find_reloads_subreg_address): Use SUBREG_BYTE. Remove + byte endian corrections when fixing up MEM subregs. + (subst_reloads): When combining two subregs, make sure final + offset is congruent to subreg's mode size. + (find_replacement): Use SUBREG_BYTE and subreg_regno_offset. + (refers_to_regno_for_reload_p): Use subreg_regno. + (reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset. + * reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian + correction code for memory subreg fixups. + (forget_old_reload_1): Use subreg_regno_offset. + (choose_reload_regs): Use subreg_regno. + (emit_input_reload_insns): Use SUBREG_BYTE. + (reload_combine_note_store): Use subreg_regno_offset. + (move2add_note_store): Use subreg_regno_offset. + * resource.c (update_live_status, mark_referenced_resources): Use + subreg_regno function. + (mark_set_resources): Use subreg_regno function. + * rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE. + (subreg_regno_offset, subreg_regno): Define prototypes. + (subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions. + (gen_lowpart_SUBREG): Add prototype. + * rtl.texi (subreg): Update to reflect new byte offset representation. + Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now. + * rtlanal.c (refers_to_regno_p): Use subreg_regno. + (reg_overlap_mentioned_p): Use subreg_regno. + (replace_regs); Make sure final offset of combined subreg is + congruent to size of subreg's mode. + (subreg_regno_offset): New function. + (subreg_regno): New function. + * sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE. + * sdbout.c (sdbout_symbol): Compute offset using alter_subreg. + * stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG. + * tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead. + (SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides. + * config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno. + (a29k_get_reloaded_address): Use SUBREG_BYTE. + (print_operand): Use SUBREG_BYTE. + * config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE. + * config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE. + (arm_reload_out_hi): Use SUBREG_BYTE. + * config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset + instead of SUBREG_WORD. + (d30v_print_operand_memory_reference): Use subreg_regno_offset. + * config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix + SUBREG creation to use byte offset. + * config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit + inverted load insns): Fix explicit rtl subregs to use byte + offsets. + * config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3, + udivsi3, umodsi3): Generate SUBREGs with byte offsets. + * config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE. + * config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl + to use byte offsets. + (unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets. + * config/i960/i960.md (extendhisi2): Generate SUBREGs with byte + offsets, also make sure it is congruent to SUBREG's mode size. + (extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2, + unnamed ldob insn): Generate SUBREGs with byte offset. + (zero_extendqihi2): SUBREG's are byte offsets. + * config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE. + (m68hc11_gen_highpart): Use SUBREG_BYTE. + * config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2, + zero-extendqisi2): Generate SUBREGs with byte offset. + (umulsidi3, mulsidi3, subreghi1ashrdi_const32, + subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit + subregs in rtl to use byte offsets. + * config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset. + * config/mips/mips.c (mips_move_1word): Use subreg_regno_offset. + (mips_move_2words): Use subreg_regno_offset. + (mips_secondary_reload_class): Use subreg_regno_offset. + * config/mips/mips.md (DImode plus, minus, move, and logical op + splits): Fixup explicit subregs in rtl to use byte offsets. + * config/mn10200/mn10200.c (print_operand): Use subreg_regno function. + * config/mn10300/mn10300.c (print_operand): Use subreg_regno function. + * config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in + rtl to use byte offsets. + * config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE. + * config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit + subregs to use byte offsets. + * config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1): + Fixup explicit subregs in rtl to use byte offsets. + * config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE + and remove byte endian correction code. + * config/sh/sh.c (output_movedouble): Use subreg_regno. + (gen_ashift_hi): Use SUBREG_BYTE. + (regs_used): Use subreg_regno_offset. + (machine_dependent_reorg): Use subreg_regno_offset. + * config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE. + * config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno. + (movdf_i4): Subregs are byte offsets now. + * config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE. + * config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed. + (REGMODE_NATURAL_SIZE): Override. + (REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode. + * config/sparc/sparc.md (TFmode move splits): Generate SUBREGs + with byte offsets. + (zero_extendhisi2, zero_extendqidi2_insn, extendhisi2, + extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn, + extendqidi2): Generate SUBREGs with byte offsets, also make sure + it is congruent to SUBREG's mode size. + (smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte + offsets. + (cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc, + cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2, + lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper + SUBREG_BYTE offset for non-paradoxical subregs in patterns. + * config/v850/v850.c (print_operand, output_move_double): Use + subreg_regno function. + +2001-04-03 Alexandre Oliva + + * configure.in (target_subdir): Use target_alias, not target. + * configure: Rebuilt. + + * config/sh/crtn.asm (init, fini): Restore r15 from r14, not the + other way round. + * config/sh/crti.asm: Fix typos in comments. + +2001-04-03 Alan Modra + + * pa.h: Revise comments for TARGET_NO_SPACE_REGS and + TARGET_FAST_INDIRECT_CALLS. + * pa.c (override_options): TARGET_NO_SPACE_REGS is now OK with + -fPIC. Don't warn. + (return_addr_rtx): Short circuit export stub matching when + TARGET_NO_SPACE_REGS. + (output_millicode_call): For out of range calls, make -fPIC + take precedence, then TARGET_PORTABLE_RUNTIME, then ble. Don't + return before delay slot checks when TARGET_PORTABLE_RUNTIME. + * pa.md: Modify length attr calculation of all millicode insns to + match above. + +2001-04-02 Geoffrey Keating + + * configure.in (gcc_cv_as_leb128): Correct name of cache variable. + Require at least 2.11 in the version test. Specifically check + for and reject GAS version 2.10.90. + * configure: regenerate. + +2001-04-03 Alan Modra + + * pa.c (override_options): Remove PIC profiling warning. + (hp_profile_labelno): Delete. + (hp_profile_label_rtx): Delete. + (hp_profile_label_name): Delete. + (pa_add_gc_roots): Remove reference to hp_profile_label_rtx. + (output_function_prologue): Remove profiling code and all tests on + profile_flag. Move store of PIC_OFFSET_TABLE_REGNUM now that + merge_sp_adjust_with_store can work for PIC and profiling. + (hppa_expand_epilogue): Remove profile_flag test. + (hppa_can_use_return_insn_p): Likewise. + (hppa_init_pic_save): Emit before tail_recursion_reentry, and + cater for PROFILE_HOOK. + (hppa_profile_hook): New function. + * pa.h (FUNCTION_PROFILER): Now does nothing. + (PROFILE_HOOK): Define. + (hppa_profile_hook): Declare. + (PROFILE_BEFORE_PROLOGUE): Delete. + (ASM_OUTPUT_REG_PUSH): Delete. + (ASM_OUTPUT_REG_POP): Delete. + * pa.md (call_profiler): Turn it into a call insn, and don't `use' + r24. Accept function name operand, and use this and a locally + generated label to calculate pc-rel offset to func start. + +2001-04-02 Kaveh R. Ghazi + + * $(HOST_PREFIX_1)errors.o, $(HOST_PREFIX_1)ggc-none.o, + ggc-common.o, ggc-simple.o, ggc-page.o, ggc-none.o: Depend on + $(SYSTEM_H). + +2001-04-03 Alan Modra + + * dwarf2out.c (dwarf2out_frame_debug_expr): Move errant HIGH and + LO_SUM cases to where they belong. + +2001-04-02 Richard Henderson + + * except.h (lang_eh_type_covers): Mark extern. + (lang_eh_runtime_type): Likewise. + +2001-04-02 Zack Weinberg + + * genattr.c, gencheck.c, gencodes.c, genconfig.c, genflags.c, + gengenrtl.c: Wrap generated header in multiple-include guard. + Improve error checking. + +2001-04-02 Kaveh R. Ghazi + + * configure.in: Don't check for putenv. + * configure: Regenerate. + * gcc.c (putenv): Don't define. + * vax/xm-vms.h: Handle putenv. + +2001-04-02 Jakub Jelinek + + * ifcvt.c (noce_emit_move_insn): New. + (noce_try_store_flag, noce_try_store_flag_constants, + noce_try_store_flag_inc, noce_try_store_flag_mask, + noce_try_cmove, noce_try_cmove_arith, noce_try_minmax, + noce_try_abs): Use it. + (noce_process_if_block): Likewise. + For STRICT_LOW_PART, take mode from its SUBREG. + +2001-04-02 Jakub Jelinek + + * fold-const.c (fold): Before optimizing unsigned comparison with + 0x7fffffffU, make sure arg0 is integral type. + +2001-04-02 Joseph S. Myers + + * c-tree.texi: Document representation of wide strings. + +2001-04-01 Richard Henderson + + * except.h (expand_builtin_dwarf_fp_regnum): Declare. + +Sun Apr 1 11:49:05 CEST 2001 Jan Hubicka + + * i386.md: remove obsoleted comments. + (adddi_?): Rename to adddi_?_rex64; disable for 32bit. + (x86_movsicc_0_m1_rex64): Rename to x86_movdicc_0_m1_rex64; + fix output template. + +2001-03-31 Marek Michalkiewicz + + * config/avr/libgcc.S (__mulhi3): Optimize previous change. + +2001-03-30 Bernd Schmidt + + * loop.c (load_mems): When generating a load from a pseudo, update + REGNO_LAST_UID. + +Fri Mar 30 17:36:43 CEST 2001 Jan Hubicka + + * i386.c (ix86_split_long_move): Use change address to compensate + stack pointer change in push instruction. + +Fri Mar 30 00:31:00 CEST 2001 Jan Hubicka + + * i386.md (sse_movdfcc_eq): Fix constraint (sse_mov?fcc splitter): Use operands_match_p + instead of rtx_equal_p; fix the output template. + +Fri Mar 30 00:21:41 CEST 2001 Jan Hubicka + + * i386.c (ix86_expand_setcc): Support 64bit. + (ix86_expand_int_movcc): Likewise. + * i386.md (movdicc_rex64, x86_movsicc_0_m1_rex64, movdicc_c_rex64): + New patterns. + + * i386.md (allocate_stack_worker): Turn to expander. + (allocate_stack_worker_1, allocate_stack_worker_rex64): New insns. + + * i386.c (print_reg): Do not print x86_64 style regs on IA-32 + +2001-03-29 Richard Henderson + + * libgcc2.c [L__main]: Include unwind-dw2-fde.h instead of frame.h. + +2001-03-28 Matthew Hiller + + * config/mn10300/mn10300.md (cmpsi): Fix first alternative's + output template. + + * MAINTAINERS: Added self. + +2001-03-28 Richard Henderson + + * Makefile.in (cs-tconfig.h): Depend on CONFIG_H, not GCONFIG_H. + Use ALL_CFLAGS not HOST_CFLAGS for sjlj detection. + +2001-03-28 Jim Wilson + + * config/ia64/ia64.md (movtf): Change DImode to TFmode in calls to + operand_subword. + +2001-03-28 Kaveh R. Ghazi + + * toplev.h (fatal_error): Add ATTRIBUTE_NORETURN. + + * tradcif.y (yyerror): Likewise. Add format specifier in call to + `error'. + + * tradcpp.c (macroexpand): Likewise for call to `error_with_line'. + +2001-03-28 DJ Delorie + + * Makefile.in (stage1_build): Revert CFLAGS patch. + +2001-03-28 Marek Michalkiewicz + + * config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop + when multiplier or multiplicand is zero. + +2001-03-28 Bernd Schmidt + + * cselib.c (hash_rtx): Don't do tail recursion elimination by hand. + + * config/ia64/ia64.c (update_set_flags): New function, broken out of + rtx_needs_barrier. + (set_src_needs_barrier): Likewise. + (rtx_needs_barrier): For SET case, use these two functions. Rework + PARALLEL case to handle all inputs before all outputs. + (emit_insn_group_barriers): Call init_insn_group_barriers only if we + saw a label and no stop bit since then. + (maybe_rotate, process_epilogue): Add prototypes. + +2001-03-28 Richard Henderson + + * config/rs6000/rs6000.h (EPILOGUE_USES): Use TARGET_AIX, + not TARGET_TOC for special toc restore handling. + * config/rs6000/rs6000.md (eh_return): Likewise. + +2001-03-28 Richard Henderson + + * config/sparc/sparc.c (eligible_for_epilogue_delay): False if + current_function_calls_eh_return. + (output_function_epilogue): Handle eh_return. + * config/sparc/sparc.h (DOESNT_NEED_UNWINDER): Remove. + (EH_RETURN_DATA_REGNO): New. + (EH_RETURN_STACKADJ_RTX): New. + (EH_RETURN_HANDLER_RTX): New. + * config/sparc/sparc.md (call/short branch peepholes): Check + can_throw_internal instead of in_same_eh_region. + + * config/rs6000/rs6000.c (rs6000_stack_info): Allocate space + for eh_return data registers. + (rs6000_emit_prologue): Save eh_return data registers. + (rs6000_emit_epilogue): Force inline restores if eh_return. + Restore eh_return data registers. Mind EH_RETURN_STACKADJ_RTX. + * config/rs6000/rs6000.h (rs6000_stack_t): Add ehrd_offset. + (EH_RETURN_DATA_REGNO, EH_RETURN_STACKADJ_RTX): New. + (EPILOGUE_USES): True for TOC_REGISTER if calls_eh_return and + the target uses one. + * config/rs6000/rs6000.md (eh_epilogue, eh_reg_restore): Remove. + (return_eh_si, return_eh_di): Remove. + (eh_return): New, from corpse of eh_epilogue. + (eh_set_lr_si, eh_set_lr_di): New. + + * config/i386/i386.c (general_no_elim_operand): Disallow virtual regs. + (ix86_save_reg): If maybe_eh_return, true for EH_RETURN_DATA_REGNOs. + True for pic register if current_function_calls_eh_return. + (ix86_expand_epilogue): Change "emit_return" argument into "style". + Handle eh_return requirements. + * config/i386/i386.h (EH_RETURN_DATA_REGNO): New. + (EH_RETURN_STACKADJ_RTX): New. + * config/i386/i386.md (exception_receiver): Remove. + (eh_return, eh_return_1): New. + * config/i386/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New. + + * config/alpha/alpha.c (alpha_sa_mask): Add EH_RETURN_DATA_REGNOs. + (alpha_mark_machine_status): No eh_epilogue_sp_ofs ... + (alpha_expand_epilogue): ... use EH_RETURN_STACKADJ_RTX instead. + * config/alpha/alpha.h (machine_function): Remove eh_epilogue_sp_ofs. + (EH_RETURN_DATA_REGNO): New. + (EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX): New. + * config/alpha/alpha.md (eh_epilogue): Remove. + (exception_receiver): Use $26 for ldgp input. + * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New. + +2001-03-28 Richard Henderson + + * except.c: Rewrite entirely for IA-64 ABI exception handling. + * except.h: Likewise. + + * Makefile.in (LIB2ADDEH): Mention unwind-dw2*.c + (LIB2ADDEHDEP): New. + (LIB2FUNCS_EH): Remove. + (LIB2ADD): Remove LIB2ADDEH. + (libgcc.mk): Pass LIB2ADDEHDEP, don't pass LIB2FUNCS_EH. + (LIBGCC_DEPS): Use LIB2ADDEHDEP. + (crt{begin,end}[S].o): Likewise. + (except.o): Update includes. + * mklibgcc.in: Remove LIB2FUNCS_EH, add LIB2ADDEH, LIB2ADDEHDEP. + (libgcc2_c_dep): Use LIB2ADDEHDEP. + + * basic-block.h (struct basic_block_def): Remove eh_beg, eh_end. + * bb-reorder.c (reorder_basic_blocks): Don't disable for EH. + * builtins.def (BUILT_IN_EH_RETURN_DATA_REGNO): New. + * builtins.c (expand_builtin): Implement it. + [BUILT_IN_EH_RETURN]: Update for nr arguments change. + * c-common.c (c_common_nodes_and_builtins): Declare it. + * c-decl.c (init_decl_processing): Update __builtin_eh_return. + * calls.c (libfunc_nothrow): Remove. + (emit_library_call_value_1): Don't call it. + * crtstuff.c: Include unwind-dw2-fde.h instead of frame.h. + * dwarf2.h (dwarf_call_frame_info): Add dwarf2.1 elements. + (DW_EH_PE_*): New defines for pointer encoding in .eh_frame. + * dwarf2out.c (struct dw_fde_struct): Add uses_eh_lsda, funcdef_number. + (current_funcdef_number): Globalize. + (output_call_frame_info): Emit frame data if an lsda is needed. + Generate augmentation for personality routine. Don't play with + difference symbols. + (dwarf2out_begin_prologue): Record funcdef_number. + * dwarf2out.h (current_funcdef_number): Declare. + * expr.c (expand_expr): Update for except.h name changes. + Remove POPDCC_EXPR, POPDHC_EXPR. Add EXC_PTR_EXPR. + * expr.h (LTI_throw, LTI_rethrow): Remove. + (LTI_sjthrow, LTI_sjpopnthrow, LTI_terminate): Remove. + (LTI_eh_rtime_match): Remove. + (LTI_unwind_resume, LTI_eh_personality): Add. + (LTI_unwind_sjlj_register, LTI_unwind_sjlj_unregister): Add. + * final.c (final): Don't call check_exception_handler_labels, + init_insn_eh_region, or free_insn_eh_region. + (final_scan_insn): Always emit debug labels for + NOTE_INSN_EH_REGION notes. + * flags.h (flag_new_exceptions): Remove. + * flow.c (entry_exit_blocks): Remove eh_beg, eh_end. + (record_active_eh_regions): Remove. + (count_basic_blocks): Check all instructions for REG_EH_REGION. + Use can_throw_internal. + (find_basic_blocks_1): Likewise. + (move_stray_eh_region_notes): Remove. + (find_label_refs): No eh_return_stub_label. + (make_edges): Likewise. No init/free_eh_nesting_info. Handle RESX. + (make_eh_edge): No eh_nest_info. Update for reachable_handlers + changes. + (delete_unreachable_blocks): Don't track deleted handlers. + (flow_delete_block): Use maybe_remove_eh_handler. + (delete_eh_regions): Remove. + (merge_blocks): Don't check for eh region match. + (mark_regs_live_at_end): Handle EH_RETURN_DATA_REGNO, + EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX. + (init_propagate_block_info): Disable dead frame store optimization + when current_function_calls_eh_return. + (dump_bb): Don't print eh_beg, eh_end. + * function.c (fixup_var_refs): No catch_clauses. + (expand_function_end): Likewise. Call expand_eh_return before + the return register use. Call sjlj_emit_function_exit_after. + (expand_function_start): Force pseudo DECL_RESULT if sjlj exceptions. + * function.h (struct function): Add calls_eh_return, uses_eh_lsda. + * ifcvt.c (dead_or_predicable): Remove eh region check. + * integrate.c (function_cannot_inline_p): Disallow __builtin_eh_return. + Don't check for EH vs parameters. + (expand_inline_function_eh_labelmap, eif_eh_map): Remove. + (expand_inline_function): Call duplicate_eh_regions. + (copy_insn_list): Don't handle NOTE_INSN_EH_REGION_BEG/END. + (copy_insn_notes): Remap REG_EH_REGION notes. + (copy_rtx_and_substitute): Remove SYMBOL_REF_NEED_ADJUST check. + * integrate.h (struct inline_remap): Add local_return_label. + * jump.c (jump_optimize_1): Don't init/free_insn_eh_region, nor + check_exception_handler_labels, nor exception_optimize. + (find_cross_jump): No EH region check. + * optabs.c (init_optabs): Update for changed eh libfuncs. + * rtl.def (RESX): New. + * rtl.h (SYMBOL_REF_NEED_ADJUST): Remove. + * stmt.c (expand_decl_cleanup): Simplify using_eh_for_cleanups_p + checks. Update for except.h name changes. + (expand_cleanups): Likewise. + (expand_dcc_cleanup, expand_dhc_cleanup): Remove. + * toplev.c (dump_file_index, dump_file): Add .02.eh dump. + (compile_file): Call init_eh before init_optabs. Don't + output_exception_table here. + (rest_of_compilation): Call convert_from_eh_region_ranges, + convert_to_eh_region_ranges, output_function_exception_table. + Don't emit_eh_context. + * tree.def (POPDHC_EXPR, POPDCC_EXPR): Remove. + (EXC_PTR_EXPR): New. + + * md.texi (eh_epilogue): Remove. + (eh_return): Document. + * tm.texi (EH_RETURN_DATA_REGNO): Document. + (EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX): Document. + + * eh-common.h: Remove file. + * frame-dwarf2.c, frame.c, frame.h: Remove files. + * libgcc2.c (L_eh): Remove. + + * unwind-dw2-fde.c: New file, largely copied from frame.c. + * unwind-dw2-fde.h: New file. + * unwind-dw2.c: New file, largely cribbed from frame-dwarf2.c. + * unwind-sjlj.c, unwind.h, unwind.inc: New files. + * libgcc-std.ver: Update for eh symbols. + +2001-03-27 Richard Henderson + + * regmove.c (perhaps_ends_bb_p): Use can_throw_internal to + reduce false positives. + (regmove_optimize): Disable if flag_non_call_exceptions. + + * stmt.c (expand_return): Remove always true predicate. + (expand_decl_cleanup_no_eh): Remove dead code. + + * sched-deps.c (sched_analyze_insn): Consolidate scheduling + barrier code. Add a scheduling barrier if a non-call insn + can throw internally. + + * rtlanal.c (rtx_addr_can_trap_p): Virtual registers cannot trap. + Auto-inc addresses trap only if their base register does. + + * except.c (can_throw_internal): Rename from can_throw. + * except.h, resource.c: Update references. + + * integrate.c (copy_insn_list): Use returnjump_p. + (copy_insn_notes): Recurse for CALL_PLACEHOLDER. + + * function.h (struct function): Move all boolean valued fields + to single bit fields at the end of the struct. + + * bb-reorder.c, dwarf2out.c, except.c, except.h, flow.c, + jump.c, toplev.c: + Rename asynchronous_exceptions to flag_non_call_exceptions. + + * gthr-single.h (UNUSED): New. Distinguish between how C + and C++ mark unused function arguments. Use throughout. + + * Makefile.in (cs-tconfig.h): Copy USING_SJLJ_EXCEPTIONS + value to target configuration header. + * configure.in (CONFIG_SJLJ_EXCEPTIONS): New. + * config.in, configure: Rebuild. + * except.h (USING_SJLJ_EXCEPTIONS): New. Define based on + configuration and target defines. + (exceptions_via_longjmp): Remove. + * dwarf2out.c, except.c, final.c, toplev.c, config/ia64/ia64.c: + Use USING_SJLJ_EXCEPTIONS instead of exceptions_via_longjmp. + + * except.h (flag_non_call_exceptions): Move ... + * flags.h: ... here. + + * combine.c (distribute_notes) [REG_EH_REGION]: If non-call + exceptions, put the note on the trapping instruction. + + * flags.h (flag_new_exceptions): Remove. + * toplev.c: Don't set it. + * final.c: Don't check it. + * except.c: Provide stub definition. + + * flow.c (tidy_fallthru_edges): Don't combine complex edges. + (calculate_global_regs_live): Kill call-clobbered registers + across exception edges. + * reg-stack.c (convert_regs_1): Kill the entire target stack + across non-call exception edges. + + * flow.c (cleanup_cfg): Take no argument. + * output.h, sibcall.c, toplev.c: Update all calls. + +2001-03-27 Kaveh R. Ghazi + + * configure.in: Don't check for bcopy. + * configure, config.in: Regenerate. + + * system.h: Don't define or prototype bcopy, instead poison it. + +2001-03-27 Richard Henderson + + * function.c (expand_function_start): Set DECL_REGISTER on + a pseudo used for DECL_RESULT. + + * rtl.h (LCT_NORETURN): New. + * calls.c (emit_library_call_value_1): Handle it. + +2001-03-27 Stan Shebs + + * objc/objc-act.c (objc_init): Use dump_base_name. + (gen_declaration): Clear the buffer arg. + (gen_declaration_1): New function, body of gen_declaration. + (adorn_decl): Call gen_declaration_1 instead of gen_declaration. + (gen_method_decl): Ditto, plus always clear buffer arg. + (error_with_ivar): Simplify. + (warn_with_method): Ditto. + (build_message_expr): Don't clear buffers. + (dump_interface): Ditto. + (objc_debug): Ditto. + (build_keyword_selector): Clear the buffer by only zeroing + the first element. + (objc_implementation_context): Declare. + (start_class): Warn about missing @end. + (finish_objc): Ditto. + +2001-03-28 John David Anglin + + * reload1.c (eliminate_regs): Don't abort on MEM USEs. + +2001-03-27 Kaveh R. Ghazi + + * Makefile.in (SYSTEM_H): Define. + Depend on $(SYSTEM_H), not system.h. + + * objc/Make-lang.in: Depend on $(SYSTEM_H), not system.h. + +2001-03-27 Jim Wilson + + * final.c (final_scan_insn, case NOTE_INSN_BASIC_BLOCK): Call + IA64_UNWIND_EMIT. + * config/ia64/ia64.c (block_num, need_copy_state): New static vars. + (process_epilogue): New static function. + (process_set): Call process_epilogue instead of emitting .restore + directly. + (process_for_unwind_directive): Handle NOTE_INSN_BASIC_BLOCK. + + * flow.c (struct reg_cond_life_info): New fields orig_condition + and stores. + (init_propagate_block_info): Set new fields. + (mark_regno_cond_dead): Set and use new fields. + (flush_reg_cond_reg_1): Likewise. + (and_reg_cond, case AND): Check for redundant AND conditions. + (mark_used_reg): Delete unnecessary clears before freeing splay trees. + Set new fields. + +2001-03-27 Neil Booth + + * cppmacro.c (stringify_arg): Null terminate strings. + +2001-03-27 Zack Weinberg + + * config.gcc (m68hc11-*-*, m68hc12-*-*): Convert to new tm.h + inclusion style. xm-m68hc11.h no longer exists. + * config/m68hc11/xm-m68hc11.h: Delete file. + * config/m68hc11/m68hc12.h: Convert to new tm.h inclusion style. + + * config/m68hc11/m68hc11.h: Convert to new tm.h inclusion style. + Don't define GCC_VERSION, N_, or PARAMS; don't include + gansidecl.h or stdio.h. Define inhibit_libc here. + Make code conditioned on #if GCC_VERSION > 2095 unconditional. + Delete code conditioned on #if GCC_VERSION == 2095. + + * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c: + Make code conditioned on #if GCC_VERSION > 2095 unconditional. + Delete code conditioned on #if GCC_VERSION == 2095. + +2001-03-27 Kaveh R. Ghazi + + * system.h: Include symcat.h. + (STRINGIFY): Don't define. + + * configure.in: Adjust comment. + + * builtins.c: Use STRINGX, not STRINGIFY. + * gencheck.c: Likewise. + * gengenrtl.c: Likewise. + * protoize.c: Likewise. + + * cpplex.c: Don't include symcat.h. + * cpplib.c: Likewise. + + * gansidecl.h (HAVE_STRINGIZE): Don't define. + +2001-03-27 Alan Modra + + * c-typeck.c (digest_init): Fold init expression. + +2001-03-26 Kaveh R. Ghazi + + * sbitmap.c (sbitmap_copy): Call memcpy, not bcopy. + +2001-03-27 Alan Modra + + * except.c (eh_regs): Save results of build_pointer_type to a temp + as FUNCTION_VALUE macro may evaluate its args multiple times. + +2001-03-26 Mark Mitchell + + * c-common.h (DECL_NUM_STMTS): New macro. + * c-decl.c (duplicate_decls): Copy DECL_NUM_STMTS, not + DECL_FRAME_SIZE. + (pushdecl): Likewise. + * c-semantics.c (add_stmt): Update DECL_NUM_STMTS. + * integrate.c (expand_inline_function): Don't check + DECL_FRAME_SIZE. + * print-tree.c (print_node): Don't print it. + * toplev.c (rest_of_compilation): Don't try to inline when + flag_no_inline is on. + * tree.h (DECL_FRAME_SIZE): Remove. + (tree_decl): Adjust accordingly. + +2001-03-26 Kaveh R. Ghazi + + * combine.c (try_combine): Use memcpy, not bcopy. + + * genattrtab.c (expand_units): Likewise. + +Mon Mar 26 15:55:08 CEST 2001 Jan Hubicka + + * i386.md (push mem DI peep2): New. + (mov 0, mov -1 peep2): Handle 64bit. + (lea to arithmetics peep2): Handle 64bit leas. + (rsp arithmetics to push/pop peep2s): New. + + * i386.md (truncdfsf2_3, trunctfsf2_2): Change predicate to memory_operand. + +Mon Mar 26 14:35:18 CEST 2001 Jan Hubicka + + * i386.c (struct machine_function): Add save_varrargs_registers. + (ix86_save_varrargs_registers): New macro. + (ix86_frame_layout): Support 64bit; support red zones and varrargs area. + (ix86_expand_prologue): Likewise. + (ix86_emit_epilogue_esp_adjustement): Likewise. + (ix86_expand_epilogue): Likewise. + * i386.md (pro_epilogue_adjust_stack): Turn to expander; support 64bit. + (pro_epilogue_adjust_stack_1): New insn. + (pro_epilogue_adjust_stack_rex64): Likewise. + * i386.h (MASK_NO_RED_ZONE): New constant. + (TARGET_RED_ZONE): New macro. + (TARGET_OPTIONS): Add "red-zone" and "no-red-zone" + (RED_ZONE_SIZE): New constant. + (RED_ZONE_RESERVE): New constant. + +2001-03-25 Kaveh R. Ghazi + + * toplev.c (set_float_handler): Use memcpy, not bcopy. + +2001-03-25 Kazu Hirata + + * config/h8300/h8300.md (umodqi3): Output a tab instead of a + space. + (modqi3): Likewise. + (umodhi3): Likewise. + (modhi3): Likewise. + +2001-03-25 Kaveh R. Ghazi + + * mkconfig.sh (DEFINES): Handle entries with '='. + + * config.gcc: Don't use i370/xm-mvs.h or ns32k/xm-pc532-min.h. + Set xm_defines to MACRO=value instead. + + * i370/xm-mvs.h: Delete. + + * ns32k/xm-pc532-min.h: Likewise. + +Sun Mar 25 15:01:40 CEST 2001 Jan Hubicka + + * i386.md (ashldi3, ashrdi3, lshrdi3): Change predicates to + shiftdi_operand; + use ix86_expand_binary_operator + (?sh??i_?): Disable for 64bit. + * i386.h (PREDICATE_CODES): Add shiftdi_operand. + * i386.c (shiftdi_operand): New predicate. + + * (ashldi3_1_rex64, ashldi3_cmp_rex64, ashlsi3_1_zext, ashlsi3_cmp_zext, + ashrdi3_63_rex64, ashrdi3_1_one_bit_rex64, ashrdi3_1_rex64, + ashrdi3_one_bit_cmp_rex64, ashrdi3_cmp_rex64, ashrsi3_31_zext, + ashrsi3_1_one_bit_zext, ashrsi3_1_zext, ashrsi3_one_bit_cmp_zext, + ashrsi3_cmp_zext, lshrdi3_1_one_bit_rex64, lshrdi3_1_rex64, + lshrdi3_cmp_one_bit_rex64, lshrdi3_cmp_rex64, lshrsi3_1_one_bit_zext, + lshrsi3_1_zext, lshrsi3_cmp_one_bit_zext, lshrsi3_cmp_zext, + rotlsi3_1_one_bit_rex64, rotldi3_1_rex64, + rotlsi3_1_one_bit_zext, rotlsi3_1_zext, rotrdi3_1_one_bit_rex64, + rotrdi3_1_rex64, rotrsi3_1_one_bit_zext, rotrsi3_1_zext): New patterns. + (rotldi3, rotrdi3): New expanders. + +Sun Mar 25 14:25:33 CEST 2001 Jan Hubicka + + * i386.md (movstrsi): Move offline. + (movstrdi): New. + (strmovdi_rex64): New. + (strmov?i): Accept 64bit. + (strmov?i_rex64): New. + (strmov?i_rex_1): New. + (strmov?i_1): Disable for 64bit. + (rep_mov?i_rex64): New. + (rep_mov?i): Disable for 64bit. + (clrstrsi): Move offline. + (strset?i_rex64): New. + (strset?i: Accept 64bit. + (rep_stos?i): Disable for 64bit. + (rep_stos?i_rex64): New. + (strset?i_rex_1): New. + (strset?i_1): Disable for 64bit. + (cmpstrsi): Accept 64bit. + (cmpstrsi_nz_1): Rename to cmpstrqi_nz_1; Disable for 64bit. + (cmpstrqi_nz_rex_1): New. + (cmpstrsi_1): Rename to cmpstrqi_1; Disable for 64bit. + (strlensi): Move offline. + (strlendi): New. + (strlenqi_1): Disable for 64bit; fix constraints. + (strlenqi_rex_1): New. + * i386.c (ix86_adjust_counter): New static function. + (ix86_zero_extend_to_Pmode): Likewise. + (ix86_expand_aligntest): Likweise. + (ix86_expand_strlensi_unroll_1): Make static; update for 64bit. + (ix86_expand_movstr): New global function. + (ix86_expand_clrstr): New global function. + (ix86_expand_strlen): New global function. + * i386-protos.h (ix86_expand_movstr, ix86_expand_clrstr, + ix86_expand_strlen): Declare. + (ix86_expand_strlensi_unroll_1): Delete. + +Sat Mar 24 23:15:19 CET 2001 Jan Hubicka + + * i386.md (cmpdi): Fix operand predicates. + (cmpdi_ccno_1_rex64, cmpdi_minus_1_rex64, cmpdi_1_rex64, + cmpdi_1_insn_rex64): New patterns. + (adddi3): Turn to expander. + (adddi3_1, adddi3_carry_rex64, adddi3_cc_rex64): New patterns. + (addsi3_carry_zext): New pattern. + (adddi_?_rex64): New patterns and splitters. + (addsi_?_zext): New patterns. + (subsi3_carry_zext): New pattern. + (subdi_?_rex64): New patterns and splitters. + (iorsi_?_zext): New patterns. + (iordi_?_rex64): New patterns and splitters. + (iorsi_?_zext): New patterns. + (iorsi_?_zext_imm): New patterns. + (xorsi_?_zext): New patterns. + (xordi_?_rex64): New patterns and splitters. + (xorsi_?_zext): New patterns. + (negdi*): New patterns. + (one_cmpldi*): Likewise. + (one_cmplsi*_zext, negsi*_zext): Likewise. + (testqi_ext_3_rex64): New pattern. + +Sat Mar 24 21:13:28 CET 2001 Jan Hubicka + + * i386-protos.h (ix86_split_long_move): Return void. + * i386.c (ix86_split_to_parts): Handle 64bit target. + (ix86_split_long_move): Likewise. + * i386.md (all calls to ix86_split_long_move): Update. + +2001-03-23 Richard Henderson + + * config/mips/iris4.h (ASM_OUTPUT_ASCII): Rename local variables + to avoid shadowing arguments. + +2001-03-23 Jakub Jelinek + + * varasm.c (make_decl_rtl): Don't append var_labelno discriminator + to variable names where DECL_NAME is different from + DECL_ASSEMBLER_NAME. + +2001-03-23 Jim Wilson + + * varasm.c (make_decl_rtl): Add TREE_PUBLIC check to abort test. + (assemble_alias): Call make_decl_rtl. + +Fri Mar 23 16:59:08 2001 J"orn Rennecke + + * stor-layout.c (layout_type): Give OFFSET_TYPE a MODE_INT type. + +2001-03-23 Bryce McKinlay + + * extend.texi: Document the "java_interface" attribute. + +2001-03-22 Zack Weinberg + + * mkconfig.sh: Use a subshell with redirected stdout, + instead of closing stdout and confusing commands that run + afterward. Throw away output of cmp. + +2001-03-22 Gordon Sadler + + * Makefile.in (stage1_build): Pass CFLAGS to stage1_build. + +Thu Mar 22 22:15:59 CET 2001 Jan Hubicka + + * i386.md (zero_extendsidi2_32): Break out from ... + (zero_extendsidi2): ... here ; turn to expander. + (zero_extendsidi2_rex64): New. + (extendsidi2_32): Break out from ... + (extendsidi2): ... here ; turn to expander. + (extendsidi2_rex64): New. + (zero_extendhidi2, zero_extendqidi2, extendhidi2, extendqidi2): New. + (trunc?f?f splitters): Add 64bit versions. + +Thu Mar 22 21:41:16 CET 2001 Jan Hubicka + + * i386.md (pushsi, pushsi2_prologue): Disable. + (pushsi2_rex64): New. + (movabs?i_1_rex64, movabs?i_2_rex64): New. + (movqi_ext_1): Disable for 64bit. + (movqi_ext_1_rex64): New. + (pushdi2_rex64): New pattern, peep2s and splitter. + (pushdi2_prologue_rex64): New pattern. + (popdi1_epilogue_rex64, popdi1, movdi_xor_rex64, movdi_or_rex64): + Likewise. + (movdi splitters): Disable for 64bit. + (movdi_1_rex64): New pattern, peep2s and splitters. + (swapdi): New pattern. + (pushsf): Disable for 64bit. + (pushsf_rex64): New pattern and splitter. + (pushdf_nointeger): Disable for 64bit. + (pushdf_integer): Handle the 64bit case. + (pushtf): Likewise; update splitters. + +2001-03-22 Richard Henderson + + * mkconfig.sh: Include insn-flags.h. + * Makefile.in (CONFIG_H): Include insn-flags.h. + (lots of objects): Remove insn-codes.h and insn-flags.h. + + * alias.c, bb-reorder.c, calls.c, do-loop.c, flow.c, haifa-sched.c, + integrate.c, jump.c, loop.c, predict.c, profile.c, reg-stack.c, + regmove.c, reorg.c, a29k/a29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, + avr/avr.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, + dsp16xx/dsp16xx.c, fr30/fr30.c, h8300/h8300.c, i370/i370.c, + i386/i386.c, i860/i860.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, + m68k/m68k.c, m88k/m88k.c, mcore/mcore.c, mn10200/mn10200.c, + mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, + pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, + v850/v850.c, vax/vax.c: + Don't include insn-flags.h. + + * diagnostic.c, expr.h, reload.c, toplev.c: + Don't include insn-codes.h. + + * builtins.c, combine.c, except.c, explow.c, expmed.c, expr.c, + final.c, function.c, optabs.c, recog.c, reload1.c, stmt.c, + c4x/c4x.c, i960/i960.c, mips/mips.c: + Don't include insn-codes.h or insn-flags.h. + + * genemit.c, genopinit.c, genoutput.c: Don't include insn-codes.h + or insn-flags.h in the generated code. + * genflags.c (gen_proto): Use "struct rtx_def *" instead of "rtx". + (main): Forward declare struct rtx_def. + +2001-03-22 Joseph S. Myers + + * invoke.texi (-ffast-math): Remove duplicate line about + __FAST_MATH__. + + * gcc.texi: Remove more obsolete documentation of bugs and + installation problems. + +2001-03-21 Kazu Hirata + + * config/h8300/h8300.md (movsi_h8300hs): Split the 2nd alternative + into two parts. + +2001-03-20 Jason Merrill + + * collect2.c (is_ctor_dtor): Always use '_' in the file fn names, + not '.' or '$'. + * tree.c (FILE_FUNCTION_FORMAT): Likewise. + * varasm.c (CHKR_PREFIX): Likewise. + +Wed Mar 21 14:27:11 2001 Richard Kenner + + * gcse.c (hash_scan_set): An expression is not anticipatible if it + is part of a multi-SET insn. + + * cse.c (find_comparison_args): Remove previous change. + * ifcvt.c (noce_process_if_block): When moving an insn, remove any + REG_EQUAL notes. + + * config/i386/i386.md (conditional_trap): Remove warning. + + * recog.c (push_operand): Fix error in last change that caused + undefined symbol on many targets. + + * sdbout.c: #include ggc.h. + (sdbout_init): Move to end of file. + Call ggc_add_tree_root for anonymous_types. + (sdbout_symbol): Use DECL_NAME for local, not DECL_ASSEMBLER_NAME. + (sdbout_one_type): Use DECL_NAME for field name. + * Makefile.in (sdbout.o): Show includes ggc.h. + +Wed Mar 21 20:33:26 CET 2001 Jan Hubicka + + * i386.c (override_options): Default ix86_regparm to REGPARM_MAX. + (override_options): Use properlimits for preferred_stack_boundary. + (ix86_valid_type_attribute_p): Disable stdcall and cdecl attributes + on x86_64. + (ext_register_operand): Accept DImode. + (load_pic_register): Abort on 64bit. + (gen_push): Use Pmode instead of SImode. + (ix86_save_reg): Pic reg is never used on 64bit. + (ix86_expand_prologue): Likewise. + (ix86_emit_save_regs): Use Pmode instead of SImode. + (legitimate_address_p): Check displacement for 64bit. + (print_operand): Avoid outputting of (%rip) on 64bit. + (print_operand_address): Output (%rip) where possible. + (split_di): Abort on 64bit registers. + (ix86_expand_branch): DImode comparison is simple for x86_64. + (memory_address_length): Recognize memory addresses formed using + PRE/POST modify. + (ix86_data_alignment, ix86_local_alignment): Align arrays to 16 bytes + for x86_64. + * i386.h (TARGET_USE_SAHF): Disable for 64bit. + +Wed Mar 21 18:51:19 CET 2001 Jan Hubicka + + * recog.c (push_operand): Recognize new format of push instructions. + +Wed Mar 21 10:53:57 CET 2001 Jan Hubicka + + * i386.md (pushqi1): New. + * i386-protos.h (x86_64_general_operand, x86_64_szext_general_operand, + x86_64_nonmemory_operand, x86_64_szext_nonmemory_operand, + x86_64_immediate_operand, x86_64_immediate_operand, + x86_64_zext_immediate_operand): Declare. + * i386.c (x86_64_general_operand, x86_64_szext_general_operand, + x86_64_nonmemory_operand, x86_64_szext_nonmemory_operand, + x86_64_immediate_operand, x86_64_immediate_operand, + x86_64_zext_immediate_operand): define. + * i386.h (PREDICATE_CODES): Add new predicates. + +Wed Mar 21 10:25:13 CET 2001 Jan Hubicka + + * i386.md (pophi1, popqi1, pushqi1): Remove. + + * expr.c (emit_single_push_insn): New function. + (move_by_pieces): Accept NULL as destination for push instructions. + (gen_push_operand): Kill. + (emit_push_insn): Pass NULL when pushing; avoid updating of + stack_pointer_delta. + * expr.h (gen_push_operand): Kill. + +Tue Mar 20 20:15:06 2001 Richard Kenner + + * rtl.texi (COMPARE): Clarify documentation and reference section + on comparisons. + +2001-03-20 Stan Shebs + + * objc/objc-act.c (get_static_reference): Use NULL_TREE. + (get_object_reference): Ditto. + (error_with_ivar): Use error_with_file_and_line. + (warn_with_method): Use warning_with_file_and_line. + +2001-03-20 Tom Tromey + + * libgcc-std.ver: Added __fixunssfsi and __fixunsdfsi. + +2001-03-20 Mark Mitchell + + * tree.c (set_decl_assembler_name): Set DECL_ASSEMBLER_NAME for + variables that are TREE_PUBLIC, even if not TREE_STATIC. + +2001-03-20 DJ Delorie + + * Makefile.in (install-libgcc): Pass complete list of variables. + (install-multilib): Ditto. + +2001-03-20 David Billinghurst + + * config/i386/cygwin.h: Declare ctor_section, dtor_section + drectve_section, switch_to_section. + + * winnt.c: Declare functions associated_type, gen_stdcall_suffix, + i386_pe_dllexport_p, i386_pe_dllimport_p, i386_pe_mark_dllexport, + i386_pe_mark_dllimport. + +2001-03-20 David Billinghurst + + * config/i386/cygwin.h: Include Declare and constify + functions i386_pe_*. + + * config/i386/winnt.c: Include "tm_p.h" and "toplev.h" Constify + i386_pe_* functions with char * arguments. + +2001-03-20 Alexandre Oliva + + * config/sh/sh.md (movsf_ie): Fix output patterns for fpul load + and store. + (movsi_ie): Introduce fpul store. + +2001-03-20 Alan Modra + + * Makefile.in (OBJS): Remove hashtab.o. + +2001-03-19 Stan Shebs + + * objc/objc-act.c (maybe_objc_method_name): Remove, never called. + * c-lang.c (maybe_objc_method_name): Ditto. + * c-tree.h (maybe_objc_method_name): Remove decl. + +2001-03-19 Tom Tromey + + * gcc.c (init_gcc_specs): Fix comment. + +2001-03-19 Mark Mitchell + + Compute DECL_ASSEMBLER_NAME lazily. + * tree.h (DECL_ASSEMBLER_NAME): Compute it lazily. + (DECL_ASSEMBLER_NAME_SET_P): New macro. + (SET_DECL_ASSEMBLER_NAME): Likewise. + (COPY_DECL_ASSEMBLER_NAME): Likewise. + (set_decl_assembler_name): Declare. + (lang_set_decl_assembler_name): Likewise. + * tree.c (lang_set_decl_assembler_name): New variab.e + (set_decl_assembler_name): New function. + (init_obstacks): Set lang_set_decl_assembler_name. + (build_decl): Don't set DECL_ASSEMBLER_NAME. + * c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (builtin_function): Likewise. + (finish_decl): Likewise. + * dbxout.c (dbxout_type_methods): Likewise. + * ggc-common.c (ggc_mark_trees): Likewise. + * profile.c (output_func_start_profiler): Likewise. + * varasm.c (make_decl_rtl): Likewise. + + * cse.c (find_comparison_args): Update documentation. Fix + mishandling of COMPARE operations. + + * tree.def (ABS_EXPR): Add documentation. + * fold-const.c (fold): Improve folding of ABS_EXPRs. + +2001-03-19 Zack Weinberg + + * Makefile.in (hash.o): Depend on $(GCONFIG_H), not $(CONFIG_H). + +2001-03-19 Jakub Jelinek + + * crtstuff.c (init_dummy): Use CRT_END_INIT_DUMMY if defined. + Remove ia32 linux PIC kludge and move it... + * config/i386/linux.h (CRT_END_INIT_DUMMY): ...here. + +Mon Mar 19 18:53:54 CET 2001 Jan Hubicka + + * i386.md (absdf2 expander): Fix 64bit case. + +2001-03-19 Brad Lucier + + * Makefile.in: Have splay-tree.o depend on $(GCONFIG_H). + +2001-03-16 Andrew Haley + + * config/ia64/libgcc-ia64.ver: Add __ia64_backtrace. + +2001-03-19 Gerald Pfeifer + + * README.X11: Remove obsolete file. + +2001-03-18 Anthony Green + + * config/pj/pj.h: Remove some trailing commas. + (ASM_SPEC): Use -EB and -EL, not -mb and -ml. + +2001-03-18 Richard Henderson + + * defaults.h (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Move from ... + * calls.c: ... here. + * combine.c, expr.c, final.c, function.c toplev.c: Don't provide + defaults for them here. + +2001-03-17 Anthony Green + + * config/pj/lib1funcs.S: Fix broken comment. + * config/pj/pj.h (LOCAL_LABEL_PREFIX): Prefix internal + labels with '.'. + +2001-03-18 Joseph S. Myers + + * gcc.texi: Remove obsolete information relating to build and + installation problems with enquire or the Pyramid C compiler. + +2001-03-17 Richard Henderson + + * dwarf2out.c (queue_reg_save): New. + (flush_queued_reg_saves, clobbers_queued_reg_save): New. + (dwarf2out_frame_debug_expr): Call queue_reg_save instead of + dwarf2out_reg_save. + (dwarf2out_frame_debug): Call flush_queued_reg_saves when needed. + (cfa, cfa_store, cfa_temp): Make static. + * final.c (final_scan_insn): Always call dwarf2out_frame_debug. + +2001-03-17 Richard Henderson + + * integrate.h (struct inline_remap): Add local_return_label. + * integrate.c (expand_inline_function): Initialize it and emit + it after copy_insn_notes. + (copy_insn_list): Don't store local_return_label here. + (copy_insn_notes): New function split out from copy_insn_list. + +2001-03-17 Richard Henderson + + * dwarf2out.c (lookup_filename): Emit .file if the assembler + is generating .debug_line. + (dwarf2out_init): Add main_input_filename to the file table first. + * configure.in (as_dwarf2_debug_line): Test with file number 1 + instead of file number 0. + +Sat Mar 17 11:52:34 2001 Richard Kenner + + * combine.c (undobuf): Remove field previous_undos; all refs deleted. + (gen_rtx_combine): Deleted; all references changed as appropriate. + (gen_unary): Deleted; all refs changed to call simplify_gen_unary. + + * print-tree.c (print_node): Print DECL_NONADDRESSABLE_P. + +2001-03-17 David Billinghurst + + * config/i386/xm-cygwin.h: Include + + * config/ia64/ia64.c (ia64_compute_frame_size): If reg_fp is zero, + then set it to LOC_REG (79) instead of aborting. + +2001-03-16 Phil Edwards + + * gccbug.in: Remove high priority. + +2001-03-16 Richard Henerson + + * aclocal.m4 (gcc_AC_EXAMINE_OBJECT): Substitute leading od + output with a space instead of deleting it. + * configure: Regenerate. + +2001-03-16 Zack Weinberg + + * aclocal.m4 (gcc_AC_EXAMINE_OBJECT): New utility macro which + handles the gory details of converting an object file into + something that's safe to grep. + (gcc_AC_C_COMPILE_BIGENDIAN): Rename to + gcc_AC_C_COMPILE_ENDIAN. Use gcc_AC_EXAMINE_OBJECT. Put + newlines at either end of the string we're looking for. + Make 'checking ...' message less stilted. + (gcc_AC_C_FLOAT_FORMAT): Use gcc_AC_EXAMINE_OBJECT. Handle + ARM in-memory layout and its hypothetical converse. Don't + define HOST_FLOAT_WORDS_BIG_ENDIAN unless it's different from + HOST_WORDS_BIG_ENDIAN. + + * configure.in: Adjust for renamed macro. Move + gcc_AC_C_FLOAT_FORMAT below gcc_AC_C_COMPILE_ENDIAN. + * configure, config.in: Regenerate. + +2001-03-16 Laurynas Biveinis + + * fixinc/Makefile.in: Set SHELL. + +2001-03-16 Laurynas Biveinis + + * fixinc/fixincl.c (fix_with_system): Quote file names before + passing them to shell. + +2001-03-16 Laurynas Biveinis + + * Makefile.in: Use fix-header$(build_exeext) instead + of fix-header. + +2001-03-16 Richard Henderson + + * dwarf2out.c: Revert most of 2000-11-25 and 2001-01-24 changes. + (LN_PROLOG_AS_LABEL, LN_PROLOG_END_LABEL): New. + (size_of_line_prolog): Remove. + (output_line_info): Compute prologue size via label difference. + (lookup_filename): Return "unspecified" for and . + + * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): Require that the + assembler error when redefining file numbers. + * config.in, configure: Rebuild. + + * dwarf2asm.c (dw2_asm_output_data): Mask data to the output size. + (dw2_asm_output_data_uleb128): Use space not tab after .uleb128. + (dw2_asm_output_delta_uleb128): Likewise. + (dw2_asm_output_delta_sleb128): Similarly. + (dw2_asm_output_data_sleb128): Similarly. Print number in decimal. + +2001-03-16 Michael Meissner + + * mips.h (BITMASK_HIGH): Replacement for 0x80000000 that avoids + warnings. + (BITMASK_UPPER16): Replacement for 0xffff0000 that avoids + warnings. + (BITMASK_LOWER16): Replacement for 0x0000ffff. + + * mips.c (save_restore_insns): Use BITMASK_UPPER16/BITMASK_LOWER16 + instead of 0xffff0000/0x0000ffff to avoid warnings about constants + being unsigned in ISO C and signed in traditional. + (expand_prologue): Ditto. + (RA_MASK): Use BITMASK_HIGH to avoid warnings. + + * mips.md (divmodsi4,divmodsi4): Use BITMASK_HIGH to avoid + warnings. + (divsi3,divdi3): Ditto. + (modsi3,moddi3): Ditto. + (fix_truncdfsi2,fix_truncdfdi2): Ditto. + (fix_truncsfsi2,fix_truncsfdi2): Ditto. + (movsi split): Use BITMASK_UPPER16/BITMASK_LOWER16 to avoid + warnings. + +Fri Mar 16 14:47:57 CET 2001 Jan Hubicka + + * i386.c (ix86_expand_fp_movcc): Do not attempt to construct + SSE based conditional moves on LTGT/UNEQ conditions; + Canonicalize EQ to NE. + * i386.md (sse_mov?fcc): Disallow EQ and NE in IEEE mode. + (sse_mov?fcc_ne): New. + + * i386-protos.h (sign_extended_value, zero_extended_value): Declare. + +2001-03-16 Alexandre Oliva + + * config/sh/sh.c (sh_expand_prologue): Insns that set up the PIC + register may be dead. + +2001-03-16 Brad Lucier + + * Makefile.in (hash.o): Depend on CONFIG_H. + +2001-03-15 Mark Mitchell + + * dwarf2out.c (rtl_for_decl_location): Use DECL_RTL_IF_SET. + +2001-03-15 Richard Henderson + + * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): New. + (ASM_OUTPUT_DWARF_PCREL): New. + * config/ia64/hpux.h (ASM_OUTPUT_DWARF_OFFSET): Remove. + +2001-03-16 Alexandre Oliva + + * cppfiles.c (stack_include_file): Use MAX of sysp. + +2001-03-15 Steve Ellcey + + * config.gcc (ia64*-*-hpux*): New case. + * config/ia64/hpux.h: New file for HP-UX support. + * config/ia64/t-hpux: New file for HP-UX support. + +2001-03-16 Bruce Korb , Alexandre Oliva + + * fixinc/inclhack.def (irix_stdio_va_list): New. + * fixinc/fixincl.x: Rebuilt. + +2001-03-15 Richard Henderson + + * dwarf2asm.c (dw2_asm_output_offset): Use ASM_OUTPUT_DWARF_OFFSET + if provided by the target. + (dw2_asm_output_pcrel): Likewise with ASM_OUTPUT_DWARF_PCREL. + (dw2_asm_output_addr): New. + * dwarf2asm.h (dw2_asm_output_addr): Declare. + * dwarf2out.c (output_cfi): Use it for program addresses. + (output_call_frame_info, output_die): Likewise. + (output_aranges, output_line_info): Likewise. + +2001-03-15 Bruce Korb + + * gcc.c(main): make more rigorous + * collect2.c(main): guard against ignoring SIGCHLD + * protoize.c(main): ditto + * gcc/fixinc/fixincl.c(initialize): ditto + +2001-03-15 Mark Mitchell + + * sdbout.c (sdbout_symbol): Use DECL_RTL_SET_P, SET_DECL_RTL. + (sdbout_parms): Likewise. + +Thu Mar 15 12:57:14 2001 Jeffrey A Law (law@cygnus.com) + + * reload1.c (reload_cse_simplify_set): For LOAD_EXTEND_OP, do not + "widen" a destination that is already wider than a word. Also do + not widen if LOAD_EXTEND_OP is NIL for the given mode. + +2001-03-15 Bernd Schmidt + + * config/ia64/ia64.c (ia64_sched_reorder): Remove debugging aids. + +Thu Mar 15 11:30:31 EST 2001 John Wehle (john@feith.com) + + * i960.h (ROUND_TYPE_SIZE_UNIT): Fix typo. + +Thu Mar 15 11:24:29 EST 2001 John Wehle (john@feith.com) + + * i960.h (i960_maxbitalignment, + i960_last_maxbitalignment): Declare. + * i960.c (i960_maxbitalignment, + i960_last_maxbitalignment): Make global. + (process_pragma): Delete. + (i960_pr_align, i960_pr_noalign): Move from here ... + * i960-c.c: ... to this new file. + * t-960bare (i960-c.o): New rule. + * t-vxworks960 (i960-c.o): Likewise. + * config.gcc (i960-*-*): Define c_target_objs and + cxx_target_objs. + +2001-03-15 Bernd Schmidt + + * cselib.c (hash_rtx): For REG and MEM, just use value of expression + without adding in rtx code and mode. + + * alias.c (init_alias_analysis): Don't use any rtx whose value + varies as a known value. + Delete a superfluous test. + + * config/ia64/ia64.c (maybe_rotate): New function, broken out of + ia64_sched_reorder. + (ia64_sched_reorder): Call maybe_rotate; also rotate after + scheduling a stop bit. + (ia64_emit_nops): Correctly handle ASMs. + +2001-03-15 Mark Mitchell + + * varasm.c (assemble_variable): Use DECL_RTL_SET_P. + +2001-03-15 Neil Booth + + * cpp.texi: Update documentation for -include and -imacros. + * cppfiles.c (struct include_file): Remove "defined" memeber. + (find_or_create_entry): Make a copy of the file name, and + simplify it. + (open_file): Update to ensure we use the simplified filename. + (stack_include_file): Don't set search_from. + (cpp_included): Don't simplify the path name here. + (find_include_file): New prototype. Call search_from to + get the start of the "" include chain. Don't simplify the + filenames here. + (_cpp_execute_include): New prototype. Move diagnostics to + do_include_common. Update. + (_cpp_pop_file_buffer): Don't set defined. + (search_from): New prototype. Use the preprocessor's cwd + for files included from the command line. + (read_name_map): Don't simplify the pathname here. + * cpphash.h (enum include_type): New. + (struct buffer): Delete search from. New search_cached. + (_cpp_execute_include): Update prototype. + * cppinit.c (do_includes): Use _cpp_execute_include. + * cpplib.c (do_include_common): New function. + (do_include, do_include_next, do_import): Use it. + +2001-03-14 Mark Mitchell + + * varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME, not the + contents of the RTL, to determine the name of the object. + +2001-03-14 Mark Mitchell + + * tree.h (DECL_RTL): Allocate RTL lazily. + (SET_DECL_RTL): New macro. + (DECL_RTL_SET_P): Likewise. + (COPY_DECL_RTL): Likewise. + (DECL_RTL_IF_SET): Likewise. + * varasm.c (make_decl_rtl): Add assertions about the kind of + declaration we are processing. + * c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. + (start_decl): Likewise. + (finish_decl): Likewise. + * c-semantics.c (emit_local_var): Likewise. + * calls.c (expand_call): Likewise. + * dbxout.c (dbxout_symbol): Likewise. + * emit-rtl.c (unshare_all_rtl): Likewise. + (unshare_all_decls): Likewise. + (reset_used_decls): Likewise. + * expr.c (store_constructor): Likewise. + (safe_from_p): Likewise. + (expand_expr): Likewise. + * function.c (put_var_into_stack): Likewise. + (instantiate_decls_1): Likewise. + (assign_parms): Likewise. + (expand_function_start): Likewise. + (expand_function_end): Likewise. + * ggc-common.c (gcc_mark_trees): Likewise. + * integrate.c (function_cannot_inline_p): Likewise. + (copy_decl_for_inlining): Likewise. + (expand_inline_function): Likewise. + (integrate_parm_decls): Likewise. + (integrate_decl_tree): Likewise. + * print-tree.c (print_node): Likewise. + * reg-stack.c (stack_result): Likewise. + * stmt.c (label_rtx): Likewise. + (expand_return): Likewise. + (expand_decl): Likewise. + (expand_decl_cleanup): Likewise. + (expand_anon_union_decl): Likewise. + * toplev.c (check_global_declarations): Likewise. + (rest_of_decl_compilation): Likewise. + * tree.c (simple_cst_equal): Likewise. + * objc/objc-act.c (generate_static_references): Likewise. + +2001-03-14 Zack Weinberg + + * aclocal.m4 (gcc_AC_C_CHARSET, gcc_AC_C_COMPILE_BIGENDIAN, + gcc_AC_C_FLOAT_FORMAT): New macros. + * configure.in: Add AC_PROG_CPP after CC tests; + gcc_AC_C_CHARSET and gcc_AC_C_FLOAT_FORMAT after the sizeof + tests; and gcc_AC_C_COMPILE_BIGENDIAN after gcc_AC_C_CHAR_BIT. + * configure, config.in: Regenerate. + + * config/a29k/xm-a29k.h, config/arc/xm-arc.h, + config/arm/xm-arm.h, config/c4x/xm-c4x.h, + config/convex/xm-convex.h, config/d30v/xm-d30v.h, + config/i370/xm-linux.h, config/i370/xm-oe.h, + config/ia64/xm-ia64.h, config/m32r/xm-m32r.h, + config/m68k/xm-m68k.h, config/mips/xm-mips.h, + config/pa/xm-linux.h, config/pa/xm-pa.h, + config/rs6000/xm-lynx.h, config/rs6000/xm-mach.h, + config/rs6000/xm-rs6000.h, config/rs6000/xm-sysv4.h, + config/sparc/xm-sparc.h, config/vax/xm-vax.h, + config/we32k/xm-we32k.h: Delete. + + * config/i370/xm-mvs.h, config/m88k/m88k.h, + config/romp/xm-romp.h, config/rs6000/xm-beos.h, + config/vax/xm-vms.h: Don't define any of: + HOST_FLOAT_FORMAT, HOST_EBCDIC, HOST_WORDS_BIG_ENDIAN + + * config/rs6000/aix.h: Define COLLECT_EXPORT_LIST here. + + * config.gcc: Remove references to deleted files. + (i370-*-opened*): Use i370/xm-mvs.h (which now defines only + FATAL_EXIT_CODE, which is the same between oe and mvs). + +2001-03-14 DJ Delorie + Vladimir Makarov + + * config/i960/i960.c (i960_function_prologue): Compute size of + frame according to number of registers actually saved there. + +2001-03-14 Richard Henderson + + * expr.c (emit_move_insn_1): Fix else if around #endif. + +Wed Mar 14 22:39:12 CET 2001 Jan Hubicka + Vojtech Pavlik + + * md.texi (machine constraints): Document 'Q', 'R', 'e' and 'Z' + constraints. + +Wed Mar 14 22:26:10 CET 2001 Jan Hubicka + + * i386.c (ix86_cmodel_string, ix86_cmodel): Define. + (override_options): Parse cmodel string. + (x86_64_sign_extended_value, x86_64_zero_extended_value): New. + * i386.h (TARGET_OPTIONS): Add "cmodel". + (EXTRA_CONSTRAINT): Recognize 'e' and 'Z'. + (enum cmodel): New. + (ix86_cmodel_string, ix86_cmodel): Declare. + +Wed Mar 14 22:26:54 CET 2001 Jan Hubicka + + Spot by Matt Kraai: + * i386.h (GENERAL_REG_P): Add missing REG_P. + +2001-03-14 Laurynas Biveinis + + * configure.in: Use $gcc_cv_as instead of $as. + * configure: Regenerated. + +2001-03-14 Neil Booth + + * cppfiles.c (stack_include_file): Only increase the include + count if we actually process the file properly, as opposed + to treating it as length zero. Only call read_include_file + if not DO_NOT_REREAD. Handle the -H include file output + here. + (read_include_file): Remove now redundant DO_NOT_REREAD check. + (cpp_included, find_include_file): Simplify pathnames after + remapping them. If remapping, don't use the remapped file + name's buffer as our scratch buffer. + (cpp_pop_file_buffer): Replace the multiple include macro + only if it isn't yet set. + (read_name_map): Simplify remapped names when reading in. + (remap_filename): Move code to code path that uses it. + (_cpp_simplify_pathname): Return the input pointer. + * cpphash.h (_cpp_simplify_pathname): Update prototype. + +2001-03-14 Mark Mitchell + + * expr.c (expand_expr): Revove bogus conditional. + +Wed Mar 14 19:29:50 CET 2001 Jan Hubicka + + * expr.c (emit_move_insn_1): Guard PUSH_ROUNDING use by ifdef. + +2001-03-14 Jakub Jelinek + + * reg-stack.c (stack_result): Unconditionally use + FUNCTION_OUTGOING_VALUE resp. FUNCTION_VALUE. + +Wed Mar 14 16:36:25 CET 2001 Jan Hubicka + + * expr.c (emit_move_insn_1): Split push of complex value when + no suitable push instruction exist. + + * i386.md (QImode move/add/shift patterns): Use ANY_QI_REG_P + instead of QI_REG_P. + +Tue Mar 13 22:22:04 2001 Richard Kenner + + * alias.c (handled_component_p, can_address_p): New functions. + (get_alias_set): Use them. + +2001-03-13 Jim Wilson + + * config/ia64/ia64.c (find_gr_spill): Subtract frame_pointer_needed + from 80 in try_locals code. + (ia64_expand_prologue): Add comment pointing to find_gr_spill change. + +2001-03-13 Zack Weinberg + + * aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, gcc_AC_C_CHAR_BIT, + gcc_AC_C_LONG_LONG): New. + * configure.in: Use them. Probe the size of short, int, long, + and long long/__int64 if we have them. Move all the AC_C_* + checks together, except gcc_AC_C_CHAR_BIT which has to go + after AC_CHECK_HEADERS(limits.h). + Take hwint.h out of host_xm_file and build_xm_file. + + * hwint.h: Unconditionally define HOST_BITS_PER_CHAR, + HOST_BITS_PER_SHORT, HOST_BITS_PER_INT, HOST_BITS_PER_LONG, + and HOST_BITS_PER_LONGLONG in terms of SIZEOF_* and CHAR_BIT. + Move the HOST_WIDEST_INT setup logic here from system.h. + Provide HOST_WIDEST_INT even if HOST_BITS_PER_LONGLONG is not + defined. + * system.h: Include hwint.h after limits.h. HOST_WIDEST_INT + is now handled by hwint.h. + + * config/alpha/xm-alpha-interix.h, config/alpha/xm-vms.h, + config/c4x/xm-c4x.h, config/i370/xm-oe.h, + config/ia64/xm-ia64.h: Don't define any of: + HOST_BITS_PER_LONG, HOST_BITS_PER_CHAR, HOST_BITS_PER_SHORT, + HOST_BITS_PER_LONGLONG. + + * config/alpha/xm-alpha.h, config/dsp16xx/xm-dsp16xx.h, + config/h8300/xm-h8300.h, config/mips/iris6.h, + config/mn10200/xm-mn10200.h, config/pa/xm-pa64hpux.h, + config/sparc/xm-sp64.h: Delete. + * config.gcc: Remove references to deleted files. + + * config/arm/xm-arm.h, config/mips/xm-mips.h: Don't define + HOST_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. + * config/i370/xm-linux.h: Clarify floating-point situation in + a comment. + +2001-03-13 Neil Booth + + * cppfiles.c (NO_INCLUDE_PATH): New macro. + (find_include_file): Decide here which part of the include + chain to start the search. Complain about an empty include + chain in all cases apart from an abolsute file name. + (_cpp_execute_include): Don't choose the search chain here. + Don't call handle_missing_include in the case of an empty + include chain. + (_cpp_compare_file_date): Don't choose the search chain here. + * cpplib.c (do_include_next): Move the in-main-file diagnostic + here from _cpp_execute_include. Behave like #include if + we're in the main file. + +2001-03-13 Kaveh R. Ghazi + + * system.h (malloc, realloc, calloc, strdup): Only poison these + tokens when IN_GCC is defined. + +Tue Mar 13 14:38:44 CET 2001 Jan Hubicka + + * i386.md (abs?f expander): Support SSE case. + (abd?f_if): Add new "USE"; add splitters. + +2001-03-13 Kaveh R. Ghazi + + * cpp.texi (poison): Explain the macro expansion exception. + +2001-03-13 Jakub Jelinek + + * expr.c (store_expr): Add dont_store_target. If temp is already in + target before copying to reg, don't store it into target again. + +2001-03-12 Neil Booth + + * cppinternals.texi: Update for file handling. + +2001-03-12 Jeffrey Oldham + + * emit-rtl.c (remove_unnecessary_notes): Reverse Richard Kenner's + 2001-02-24 which broke building the Java library. + * function.c (identify_blocks): Likewise. + (all_blocks): Likewise. + * integrate.c (integrate_decl_tree): Likewise. + * print-tree.c (print_node): Likewise. + * tree.h (BLOCK_NUMBER): Likewise. + (struct tree_block): Likewise. + +2001-03-12 David Edelsohn + + * rs6000/aix51.h (CPP_SPEC, CPLUSPLUS_CPP_SPEC): Fix typo in + __WCHAR_TYPE__ definition. + (WCHAR_TYPE_SIZE): #undef before #define. + +2001-03-12 Neil Booth + + * cppfiles.c: Update comments. + (destroy_include_file_node): Rename destroy_node. + (find_or_create_entry): New function. + (open_file, _cpp_fake_include): Use it. + (handle_missing_header): New function, broken out of + _cpp_execute include. Don't segfault if there is no + system or quoted path. + (_cpp_execute_include): Use handle_missing_header. + +2001-03-12 Jeffrey Oldham + + * jump.c (reversed_comparison_code_parts): Reverse Jan Hubricka's + 2001-02-28 patch because it breaks arm-linux and mips-sgi-irix6.5. + +Mon Mar 12 14:05:32 2001 Richard Kenner + + * flow.c (insn_dead_p): Don't consider two memrefs equivalent + unless anti_dependence says they are. + * alias.c (objects_must_conflict): If neither has a type specified, + they must conflict. + +2001-03-12 Neil Booth + David Billinghurst + + * config/mips/iris5.h: Change WCHAR_TYPE to int. + +Mon Mar 12 16:32:21 CET 2001 Jan Hubicka + + * i386.md (trunctfdf2_2): Rename missnamed pattern. + (*_one_bit): Remove type on the match_operand in attributes. + +Mon Mar 12 16:27:56 CET 2001 Jan Hubicka + + * i386.c: Commit forgotten hunk in previous patch. + (regclass_map): Add extended registers. + (dbx_register_map): Add missing frame register. + +Mon Mar 12 15:41:08 CET 2001 Jan Hubicka + + * i386.md (all XFmode patterns except swapxf): Disable for 64bit. + + * i386.md (x86_sahf_1): Disable for 64bit. + (popsi*, pophi*): Likewise. + (pushqi, pushhi): Likewise. + (movdi, pushdi): Likewise. + (zero extend DImode splitter): Likewise. + (adddi, minusdi splitter): Likewise. + (umulsidi): Likewise. + (umulsi): New. + (mulsidi): Disable for 64bit + (lshift:DI/ashift:DI): Disable for 64bit. + (loop patterns): Likewise. + (call_pop, call_value_pop expanders and patterns): Likewise. + (prologue_get_pc): Likewise. + (leave): Likewise. + (fcmovDI pattern and splitter): Likewise. + (movdfcc_1_rex64): New. + +Mon Mar 12 15:16:36 CET 2001 Jan Hubicka + + * i386.h (VALID_FP_MODE_P): XFmode is invalid on x86_64. + (MODES_TIEABLE_P): QImodes and DImodes are tiable on x86_64. + (HARD_REGNO_CALLER_SAVE_MODE): Save QImodes as QImodes for x86_64. + (STATIC_CHAIN_REGNUM): Set to r10 for x86_64. + (PIC_OFFSET_TABLE_REGNUM): Set to INVALID_REGNUM for x86_64. + (LIMIT_RELOAD_CLASS): Avoid limiting of QImodes on x86_64. + (SECONDARY_OUTPUT_RELOAD_CLASS): No need to QImodes. + (PUSH_ROUNDING): x86_64 rounds to 64bits. + (CONSTANT_ADDRESS_P): Accept CONST_DOUBLE. + (REGPARM_MAX): Set to 6 for x86_64. + (SSE_REGPARM_MAX): Set to 16 for x86_64. + * i386.c (hard_regno_mode_ok): QImodes can be in all general purpose + registers. + + * (patterns that does use upper halves): Update constraints + 'q' to 'Q' and 'r' to 'R'. + (cmpqi_ext_1): Disable for 64bit. + (cmpqi_ext_3_insn): Likewise. + (movqi_extzv_1): Likewsie. + (addqi_ext_1): Liekwsie + (testqi_ext_1): Liekwsie + (andqi_ext_1): Liekwsie + (xorqi_ext_1): Liekwsie + (cmpqi_ext_1_rex64): New. + (cmpqi_ext_3_insn_rex64): Likewise. + (movqi_extzv_1_rex64): Likewsie. + (addqi_ext_1_rex64): Liekwsie + (testqi_ext_1_rex64): Liekwsie + (andqi_ext_1_rex64): Liekwsie + (xorqi_ext_1_rex64): Liekwsie + +2001-03-11 Zack Weinberg + + * configure.in: Move check for unsigned enumerated bitfields + to macro in aclocal.m4. Disable it for now. + * configure, config.in: Regenerate. + * system.h: Don't do anything with ONLY_INT_FIELDS. Use the + unsigned-int form of ENUM_BITFIELD() unless being compiled by GCC. + * varasm.c (struct rtx_const): Use ENUM_BITFIELD(). Move enum + kind above its first use. + + * config/xm-interix.h, config/alpha/xm-alpha.h, + config/i370/xm-linux.h, config/i386/xm-beos.h, + config/i386/xm-mingw32.h, config/mips/xm-mips.h, + config/pa/xm-pa.h, config/pa/xm-pa64hpux.h, + config/rs6000/xm-beos.h, config/rs6000/xm-sysv4.h, + Don't define ONLY_INT_FIELDS under any circumstances. + + * config/pa/xm-pa.h: Don't define __BSD_NET2__. + + * config/pa/xm-pahpux.h, config/pa/xm-papro.h, + config/sparc/xm-sysv4.h: Delete - now identical with some + other xm header. + * config.gcc (hppa targets): Replace xm-pahpux.h and + xm-papro.h with implicit xm-pa.h. + (sparc targets): Replace xm-sysv4.h with implicit or explicit + xm-sparc.h. + +2001-03-12 Aldy Hernandez + + * reload1.c (reload_cse_simplify): Call reload_cse_simplify_set + before reload_cse_noop_set_p. + +2001-03-11 Zack Weinberg + + * config.gcc: Where xm-host.h used to include another + xm-host.h, list the nested header directly in xm_file. Remove + references to deleted files. Can now use sparc/xm-sp64.h for + sparcv9-*-solaris*. + + * config/xm-linux.h, config/arm/xm-linux.h, + config/i386/xm-dos.h, config/i386/xm-gnu.h, + config/i386/xm-linux.h, config/i386/xm-openbsd.h, + config/i860/xm-fx2800.h, config/m68k/xm-atari.h, + config/m68k/xm-linux.h, config/m68k/xm-sun3.h, + config/sparc/xm-linux.h, config/sparc/xm-sysv4-64.h: + Delete. + + * config/alpha/xm-alpha-interix.h: Don't include alpha/xm-alpha.h. + * config/mips/xm-iris5.h: Don't include mips/xm-mips.h. Don't + bother to wrap #undef in #ifdef. + * config/pa/xm-linux.h, config/rs6000/xm-sysv4.h: + Don't include xm-linux.h. + * config/sparc/xm-sp64.h: Don't include sparc/xm-sparc.h. + + * configure.in: Wrap regexps using [] in changequote block. + Use expr : not echo | grep. Simplify regexps. + * configure: Regenerate. + + 56 xm-files remain, 22 xm-arch. + +2001-03-11 Kaveh R. Ghazi + + * mips-tfile.c: Cast arg to PTR when specifier is HOST_PTR_PRINTF. + (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead. + (local_index, local_rindex): Delete, use strchr/strrchr instead. + (copy_object): Fix format specifier vs argument mismatch. + + * mips-tdump.c: Make local functions static. + (rindex): Don't #undef. + (__proto, PTR_T, CPTR_T): Delete, use PARAMS/PTR instead. + (fatal, fancy_abort): Delete. + (read_seek): Avoid signed/unsigned compare. + +Sun Mar 11 17:01:41 2001 Richard Kenner + + * combine.c (try_combine): Fix error in change to try original + register. + (gen_rtx_combine): Do same as gen_rtx for now. + +2001-03-11 Zack Weinberg + + * configure.in: AC_SUBST xm_defines. + * configure: Regenerate. + * Makefile.in: Set DEFINES=$(xm_defines) when building + tconfig.h. + +2001-03-11 Neil Booth + + * cppfiles.c (INCLUDE_LEN_FUDGE, ENOMEM): Delete. + (cpp_included, find_include_file): Update. + (_cpp_compare_file_date): Make else unconditional. + +2001-03-10 kaz Kojima + + * config/sh/sh.h (LEGITIMATE_PIC_OPERAND_P): Defined. + +2001-03-10 Toshiyasu Morita + + * config/sh/sh.md (umulhisi3_i, mulhisi3_i): Fix mnemonics. + * config/sh/lib1funcs.asm (mulsi3): Convert mulu to mulu.w. + +Sat Mar 10 22:42:05 2001 Alexandre Oliva + + * tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node + if it's a record type. + +Sat Mar 10 17:52:54 2001 Christopher Faylor + + * config/i386/cygwin.h: Make ../w32api a system directory. Reorganize + mingw includes slightly. + +2001-03-10 Kaveh R. Ghazi + + * system.h (malloc, realloc, calloc, strdup, bzero, bcmp, rindex): + #undef token before poisoning it. + +2001-03-10 Kaveh R. Ghazi + + * alpha.c (check_float_value): Use memcpy, not bcopy. + + * m32r.c (m32r_sched_reorder): Likewise. + + * vax.c (check_float_value): Likewise. + +2001-03-10 Neil Booth + + * toplev.c (file_name_nondirectory): Remove. + * toplev.h: Similarly. + * dwarf2out.c (compute_section_prefix): Use lbasename instead + of file_name_nondirectory. + +Sat Mar 10 10:36:45 2001 Richard Kenner + + * mips-tdump.c (read_seek): Call xmalloc, not malloc. + * mips-tfile.c: Don't #undef rindex; not used. + +Sat Mar 10 14:34:59 CET 2001 Jan Hubicka + + * i386.h (DBX_REGISTER_NUMBER): Return proper values for 64bits. + (dbx64_register_map): Declare. + (RETURN_ADDR_RTX): Fix for 64bit. + (DWARF_FRAME_RETURN_COLUMN): Set to 16 for 64bit. + (INCOMING_FRAME_SP_OFFSET): Set to 8. + * i386.c (dbx64_register_map): New global array. + * beos-elf.h, freebsd.h, i386-interix.h, i386elf.h, + linux.h (DBX_REGISTER_REGNUMBER): Use dbx64_register_map + for 64bits. + +2001-03-10 Neil Booth + + * cppfiles.c (search_from): Use lbasename. + * mkdeps.c (deps_add_default_target): Use lbasename. + +2001-03-09 Kaveh R. Ghazi + + * fixinc/server.c (load_data, run_shell): Use xmalloc, xrealloc & + xcalloc in lieu of malloc, realloc & calloc. + + * gencheck.c (xmalloc): Use really_call_malloc, not malloc. + + * gengenrtl.c (xmalloc): Likewise. + + * gensupport.c (xcalloc, xrealloc, xmalloc): Use the + really_call_* memory allocation routines. + + * stmt.c (check_for_full_enumeration_handling): Use + really_call_calloc, not calloc. + + * system.h (really_call_malloc, really_call_calloc, + really_call_realloc): Define. + (malloc, realloc, calloc, strdup, bzero, bcmp, rindex): Poison. + +Fri Mar 9 18:39:19 2001 Jeffrey A Law (law@cygnus.com) + + * pa.md (builtin_longjmp): Rework slightly to work for PA64 too. + +2001-03-09 Nicola Pero + + * configure: Rebuilt. + * configure.in: Only use `lang_requires' for languages athat are + actually enabled. + +2001-03-09 Joseph S. Myers + + * invoke.texi: Fix typo. + * gcc.1: Regenerate. + +2001-03-09 Zack Weinberg + + * configure.in: Prune nonexistent files from build_xm_file, + xm_file, and host_xm_file lists. Warn unless they're + $cpu/xm-$cpu.h. + Don't generate *config.h here. + AC_SUBST all variables needed to generate *config.h. + * configure: Regenerate. + * mkconfig.sh: New helper script, from code removed from + configure.in. + * Makefile.in: Zap all MALLOC variables - no longer used + anywhere, and malloc.c doesn't exist. + Substitute in variables needed to generate *config.h. + Stop lying about the dependencies contained in CONFIG_H and + GCONFIG_H. + (HCONFIG_H, TCONFIG_H, TM_P_H): New variables. + (config.h, hconfig.h, tconfig.h, tm_p.h, cs-config.h, + cs-hconfig.h, cs-tconfig.h, cs-tm_p.h): New rules. + (all .o): Add dependencies on $(HCONFIG_H), $(TCONFIG_H), + $(TM_P_H), etc. as appropriate. + + * config.gcc: Zap references to deleted files. + * ggc-none.c: Don't include rtl.h or tm_p.h. + + * config/i386/xm-beos.h, config/i386/xm-dgux.h, + config/i386/xm-djgpp.h, config/i386/xm-dos.h, + config/i386/xm-gnu.h, config/i386/xm-i386-interix.h, + config/i386/xm-linux.h, config/i386/xm-linux.h, + config/i386/xm-next.h, config/i386/xm-openbsd.h, + config/i386/xm-sun.h, config/i386/xm-sysv3.h: + Don't include i386/xm-i386.h. + + * config/elxsi/xm-elxsi.h, config/i386/xm-bsd386.h, + config/i386/xm-i386.h, config/i860/xm-i860.h, + config/i960/xm-i960.h, config/mcore/xm-mcore.h, + config/mn10300/xm-mn10300.h, config/ns32k/xm-ns32k.h, + config/pj/xm-pj.h, config/sh/xm-sh.h, config/v850/xm-v850.h: + Delete (empty except comments, #includes of other deleted + files, and macros used nowhere). + +Fri Mar 9 20:05:27 CET 2001 Jan Hubicka + + * i386.h (MAX_WCHAR_TYPE_SIZE): New constant to keep tradcpp + independent on TARGET_FLAGS. + +Fri Mar 9 19:52:52 CET 2001 Jan Hubicka + + * i386.h (FIRST_PSEUDO_REGISTER): Set to 53. + + (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ONES): Add + extended ones. + (CONDITIONAL_REGISTER_USAGE): Set proper values according to + TARGET_64BIT. + (FIRST_REX_INT_REG, LAST_REX_INT_REG, FIRST_REX_SSE_REG, + LAST_REX_SSE_REG): define. + (enum reg_class): Add 'LEGACY_REGS' + (REG_CLASS_CONTENTS): Likewise; add extended registers. + (SSE_REGNO_P): Recognize extended registers. + (ANY_QI_REG_P, REX_INT_REGNO_P, REX_INT_REG_P): New. + (REG_CLASS_FROM_LETTER): Add 'R' and 'Q'. + (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, + REG_OK_FOR_BASE_NONSTRICT_P): Recognize REX registers. + (REG_OK_FOR_STRREG_NONSTRICT_P, REG_OK_FOR_STRREG_STRICT_P, + REG_OK_FOR_STRREG_P): Remove. + (HI_REGISTER_NAMES): Add extended registers. + (ADDITIONAL_REGISTER_NAMES): Likewise. + (QI_REGISTER_NAMES): Add 8bit extended registers. + (DEBUG_REG): Support extended registers. + * i386.c (regclass_map): Add extended registers. + (dbx_register-map): Likewise. + (svr4_dbx_register_map): Likewise. + (print_reg): Support extended registers. + (print_operand): Support 64bit operands. + +Fri Mar 9 19:37:46 CET 2001 Jan Hubicka + + * i386.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Set to 128bit for x86_64 + (BOOL_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, + FLOAT_TYPE_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE, + DOUBLE_TYPE_SIZE, LONG_LONG_TYPE_SIZE): New constants. + (BITS_PER_WORD, UNITS_PER_WORD, POINTER_SIZE, PARM_BOUNDARY, + STACK_BOUNDARY): Set properly for 64bits. + (MAX_BITS_PER_WORD, MIN_UNITS_PER_WORD): New constants. + (EMPTY_FIELD_BOUNDARY): Define using BITS_PER_WORD. + (BIGGEST_FIELD_ALIGNMENT): Set to 128 for 64bits. + (MOVE_MAX): Set to 16. + (MOVE_MAX_PIECES): 8 for 64bit. + (Pmode): Set to SImode. + +Fri Mar 9 09:00:36 2001 Mike Stump + + * cselib.c (hash_rtx): Ensure that hash isn't zero upon return. + +Fri Mar 9 17:38:08 CET 2001 Jan Hubicka + + * i386.h (mask_64bit): New constant. + (target_64bit): New macro. + (target_options): Add '64'/'32' + (target_default): Define. + * cygwin.h freebsd-aout.h i386-interix.h i386.h i386elf.h isc.h + isccoff.h netbsd.h next.h openbsd.h p sco.h sco5.h scodbx.h sequent.h + unix.h win32.h (TARGET_DEFAULT): Rename to TARGET_SUBTARGET_DEFAULT. + +Thu Mar 8 23:36:56 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/som.h (MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): Disable. + +Thu Mar 8 23:29:37 2001 John Wehle (john@feith.com) + + * rtlanal.c (rtx_varies_p): Check operand 0 of a + LO_SUM unless for_alias is set. + +2001-03-08 Stan Shebs + + * objc/objc-act.c: Fix old typos in comments, add comments for + various functions. + (hash_init): Fix file name in error message. + (hash_enter): Ditto. + (hash_add_attr): Ditto. + (continue_class): Ditto. + +2001-03-08 Bruce Korb + + gcc.c(main): ensure SIGCHLD handling is set to SIG_DFL so that + wait4() can receive the signal. + +Thu Mar 8 21:09:10 2001 Rainer Orth + + * fixinc/inclhack.def (AAB_dgux_int_varargs): Don't use HTML + entities. + * fixinc/fixincl.x: Regenerate. + +Thu Mar 8 21:09:10 2001 Rainer Orth + + * fixinc/inclhack.def (AAA_standards): Undo breakage + on Tru64 UNIX. + * fixinc/fixincl.x: Regenerate. + +2001-03-08 Richard Henderson + + * configure.in (HAVE_AS_LEB128): New assembler check. + * configure, config.in: Rebuilt. + +Thu Mar 8 19:54:04 CET 2001 Jan Hubicka + + * reg-stack.c (move_for_stack_reg): Avoid non-poping fst for + TFmode too. + +2001-03-08 Kaveh R. Ghazi + + * config/ns32k/xm-pc532-min.h, config/we32k/xm-we32k.h: Delete + references to the MAXPATHLEN macro. + + * config/alpha/xm-alpha.h, config/arm/xm-arm.h, + config/i386/xm-cygwin.h, config/xm-linux.h: Delete references to + the POSIX macro. + + * config/i386/xm-gnu.h, config/xm-gnu.h, + config/alpha/xm-openbsd.h, config/i386/xm-openbsd.h, + config/m68k/xm-openbsd.h, config/mips/xm-openbsd.h, + config/sparc/xm-openbsd.h, config/xm-openbsd.h: Delete empty + and/or unused files. + + * config.gcc: Define POSIX in xm_defines as appropriate in lieu of + doing so in various xm-*.h files. + +Thu Mar 8 06:32:50 2001 Richard Kenner + + * config/i386/i386.md (clrstrsi): Call ix86_set_move_mem_attrs. + +2001-03-08 Alexandre Oliva + + * configure.in (enable_shared): Support per-package shared-library + enabling. + * configure: Rebuilt. + +2001-03-07 David Edelsohn + + * rs6000.md (cr logic): Add original POWER mnemonic alternative + for crnot. Set operands[5] in splitter. + +2001-03-07 Kaveh R. Ghazi + + * config/i370/xm-mvs.h, config/i370/xm-oe.h, + config/i386/xm-beos.h, config/i386/xm-mingw32.h, + config/m88k/xm-m88k.h, config/mips/xm-iris6.h, + config/mips/xm-openbsd.h, config/pa/xm-pa64hpux.h, + config/pa/xm-pahpux.h, config/rs6000/xm-beos.h, + config/rs6000/xm-darwin.h, config/rs6000/xm-mach.h, + config/rs6000/xm-rs6000.h, config/xm-interix.h: Delete references + to the USG macro. + + * config/vax/xm-vaxv.h, config/a29k/xm-unix.h, + config/i370/xm-i370.h, config/i386/xm-dgux.h, + config/i386/xm-sun.h, config/i386/xm-sysv3.h, + config/m68k/xm-tower.h, config/m68k/xm-aux.h, + config/m68k/xm-hp320.h, config/m68k/xm-amix.h, + config/m68k/xm-altos3068.h, config/m68k/xm-mot3300.h, + config/m68k/xm-m68kv.h, config/m88k/xm-openbsd.h, + config/mips/xm-nws3250v4.h, config/mips/xm-sysv.h, + config/mips/xm-iris3.h, config/mips/xm-iris4.h, config/xm-svr3.h, + config/xm-svr4.h, config/sparc/xm-pbd.h, config/clipper/xm-clix.h: + Delete unused and/or empty files. + + * config.gcc: Define USG in xm_defines as appropriate. Define + POSIX in lieu of xm-svr4.h. Delete all references to the SVR3 + macro. Remove deleted xm-* files from $xm_files variable. + +2001-03-07 Tom Tromey + + * configure: Rebuilt. + * configure.in: Allow config-lang.in to set `lang_requires' to list + of other required languages. + +2001-03-07 Andrew MacLeod + + * config/a29k/a29k.c (print_operand): Free a29k_last_prologue_insn + after its emitted. + (output_prologue): Use xmalloc not oballoc. + (output_epilog): Free a29k_first_epilogue_insn when finished. + * confif/a29k/a29k.h (PREDICATE_CODES): Remove shift_constant_operand. + +2001-03-07 Brad Lucier + + * builtins.c (expand_builtin_mathfn): Check + flag_unsafe_math_optimizations, not flag_fast_math. + (expand_builtin): Likewise + * combine.c (combine_simplify_rtx): Likewise. + (simplify_if_then_else): Likewise. + * cse.c (fold_rtx): Likewise. + * flags.h: Remove flag_fast_math. Add + flag_unsafe_math_optimizations and flag_trapping_math. + * fold-const.c (negate_expr): Check + flag_unsafe_math_optimizations, not flag_fast_math. + (invert_truthvalue): Likewise. + (fold): Likewise. Before associating operands, check that + code == MULT_EXPR, not code != MULT_EXPR. + * ifcvt.c (noce_try_minmax): Check + flag_unsafe_math_optimizations, not flag_fast_math. + (noce_operand_ok): Check flag_trapping_math, not flag_fast_math. + * invoke.texi: Document -funsafe-math-optimizations and + -fno-trapping-math. Change documentation for -ffast-math. + * jump.c (reversed_comparison_code_parts): Likewise. + (rtx_equal_for_thread_p): Likewise. + * optabs.c (emit_conditional_move): Likewise. + * simplify-rtx.c (simplify_binary_operation): Likewise. + (simplify_relational_operation): Likewise. + (simplify_ternary_operation): Likewise. + * toplev.c: Remove flag_fast_math. Add flag_trapping_math and + flag_unsafe_math_optimizations. Remove fast-math entry from f_options. + Add trapping-math and unsafe-math-optimizations entries to f_options. + (set_fast_math_flags): New, sets flags for -ffast-math. + (set_no_fast_math_flags): New, sets flags for -fno-fast-math. + (decode_f_option): Add code to handle -ffast-math and -fno-fast-math. + * toplev.h: Declare set_fast_math_flags and set_no_fast_math_flags. + + * config/alpha/alpha.c (alpha_emit_conditional_branch): Likewise. + (alpha_emit_conditional_move): Initialize local_fast_math to + flag_unsafe_math_optimizations, not flat_fast_math. + * config/c4x/c4x.c (c4x_override_options): Call set_fast_math_flags + instead of setting flag_fast_math to 1. + * config/convex/convex.md: Check flag_unsafe_math_optimizations, + not flag_fast_math. + * config/i386/i386.c (override_options): Likewise + * config/i386/i386.md: Likewise. + * config/m68k/m68k.md: Likewise. + * config/mips/mips.md: Likewise. + * config/rs6000/rs6000.c (validate_condition_mode): Likewise. + (rs6000_generate_compare): Likewise. + +2001-03-07 Laurynas Biveinis + + * Makefile.in: Set RANLIB to @RANLIB@. + Remove RANLIB_TEST. + +2001-03-07 Laurynas Biveinis + + * fixinc/inclhack.def (djgpp_wchar_h): New test. + * fixinc/fixincl.x: Regenerated. + +2001-03-07 Richard Henderson + + * config/alpha/alpha.md (call_osf_1_noreturn): New pattern. + +2001-03-07 Richard Henderson + + * emit-rtl.c (remove_unnecessary_notes): Verify proper nesting + of block notes and exception handling notes. + + * lists.c (init_EXPR_INSN_LIST_cache): Don't check initialized. + * toplev.c (rest_of_compilation): Call init_EXPR_INSN_LIST_cache ... + (compile_file): ... here. + +2001-03-06 Kaveh R. Ghazi + + * fixinc/Makefile.in (FIXINC_DEFS): Add -DHAVE_CONFIG_H. + + * fixinc/gnu-regex.c: Don't include auto-host.h since we get + config.h now. Include libiberty.h to handle alloca. + +2001-03-06 Zack Weinberg + + * c-parse.in (yylexname): New function, split out of _yylex. + (objc_rid_sans_at): New table. + (init_reswords): Initialize it. + (_yylex): Give labels clearer names. Handle CPP_ATSIGN by + retrieving the next token and checking it for significance as + an ObjC keyword or string constant. + + * cpplex.c (_cpp_lex_token): Just return CPP_ATSIGN for '@'. + * cpplib.h (TTYPE_TABLE): Add CPP_ATSIGN, drop CPP_OSTRING. + + * c-lex.c, c-parse.in, cppmacro.c, cpplex.c: Remove references + to CPP_OSTRING. + +2001-03-06 Stephen L Moshier + + * config/m68k/m68k.c (const_uint32_operand): Accept any + const_int on a 32-bit host. + +2001-03-06 Nicola Pero + + * objc/objc-act.c (init_objc): Set save_lang_status, + restore_lang_status, and mark_lang_status. + +2001-03-06 Krister Walfridsson + + * dwarf2asm.c (dw2_asm_output_delta): Fix smallest_mode_for_size call. + +2001-03-06 Neil Booth + + * cppinternals.texi: Update. + +2001-03-06 Kaveh R. Ghazi + + * config/a29k/xm-a29k.h, config/a29k/xm-unix.h, + config/alpha/xm-alpha.h, config/arc/xm-arc.h, config/arm/xm-arm.h, + config/c4x/xm-c4x.h, config/clipper/xm-clix.h, + config/convex/xm-convex.h, config/d30v/xm-d30v.h, + config/dsp16xx/xm-dsp16xx.h, config/elxsi/xm-elxsi.h, + config/h8300/xm-h8300.h, config/i370/xm-i370.h, + config/i370/xm-linux.h, config/i370/xm-mvs.h, config/i370/xm-oe.h, + config/i386/xm-i386.h, config/i860/xm-i860.h, + config/i960/xm-i960.h, config/ia64/xm-ia64.h, + config/m32r/xm-m32r.h, config/m68k/xm-m68k.h, + config/m88k/xm-m88k.h, config/mcore/xm-mcore.h, + config/mips/xm-mips.h, config/mn10200/xm-mn10200.h, + config/mn10300/xm-mn10300.h, config/ns32k/xm-ns32k.h, + config/pa/xm-linux.h, config/pa/xm-pa.h, config/pa/xm-pa64hpux.h, + config/pa/xm-pahpux.h, config/pa/xm-papro.h, config/pj/xm-pj.h, + config/romp/xm-romp.h, config/rs6000/xm-beos.h, + config/rs6000/xm-lynx.h, config/rs6000/xm-rs6000.h, + config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, + config/sparc/xm-sparc.h, config/sparc/xm-sysv4.h, + config/v850/xm-v850.h, config/vax/xm-vax.h, config/vax/xm-vms.h, + config/we32k/xm-we32k.h: Delete HOST_BITS_PER_* definitions which + match the defaults provided in hwint.h. + + * config/i386/xm-lynx.h, config/m68k/xm-lynx.h, + config/sparc/xm-lynx.h, config/xm-std32.h: Delete files. + + * config.gcc (xm_file): Don't set to files which are deleted. + + * hwint.h: Provide default values for HOST_BITS_PER_*. No longer + guard this file against these macros being undefined. + +2001-03-06 Zack Weinberg + + * objc/objc-act.c (objc_add_static_instance): Set DECL_INITIAL + and DECL_DEFER_OUTPUT on the decl we create, before calling + rest_of_decl_compilation. + +2001-03-06 Zack Weinberg + + * aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE + AC_FUNC_ALLOCA. + * configure, config.in: Regenerate. + * config.gcc: Remove references to deleted files. + + * genattr.c, genattrtab.c, genextract.c, genoutput.c, + genrecog.c, rtl.c: Do not use alloca anywhere. + + * Makefile.in, build-make, system.h, config/x-interix, + config/x-svr4, config/xm-interix.h, config/xm-openbsd.h, + config/alpha/xm-alpha.h, config/alpha/xm-vms.h, + config/arc/xm-arc.h, config/arm/xm-arm.h, + config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h, + config/h8300/xm-h8300.h, config/i370/x-oe, + config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos, + config/i386/x-ncr3000, config/i386/x-sco5, + config/i386/xm-dgux.h, config/i860/x-sysv4, + config/i960/xm-i960.h, config/m32r/xm-m32r.h, + config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320, + config/m68k/x-hp320g, config/m69k/x-mot3300, + config/m68k/x-mot3300-gas, config/m68k/xm-amix.h, + config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h, + config/m68k/xm-mot3300.h, config/m88k/x-dolph, + config/m88k/x-sysv4, config/m88k/x-tekXD88, + config/m88k/xm-m88k.h, config/mcore/xm-mcore.h, + config/mips/x-iris, config/mips/x-iris3, + config/mips/x-sni-svr4, config/mips/x-sysv, + config/mips/xm-iris6.h, config/mips/xm-mips.h, + config/mips/xm-nws3250v4.h, config/pa/x-hpux, + config/pa/x-pa-mpeix, config/pa/xm-pa.h, + config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h, + config/pa/xm-papro.h, config/romp/xm-romp.h, + config/rs6000/x-aix31, config/rs6000/x-aix41, + config/rs6000/x-beos, config/rs6000/x-lynx, + config/rs6000/x-mach, config/rs6000/x-rs6000, + config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h, + config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, + config/sparc/x-sysv4, config/sparc/xm-linux.h, + config/sparc/xm-pbd.h, config/sparc/xm-sparc.h, + config/vax/xm-vms.h: Eradicate all references to alloca and + related stuff. + + * config/xm-alloca.h, config/clipper/x-clix, + config/i386/xm-sysv4.h, config/i860/x-fx2800, + config/i860/x-sysv3, config/m88k/x-sysv3, + config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete + (contained only alloca related hacks). + + * config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define + USE_C_ALLOCA. + +2001-03-05 Brad Lucier + + * invoke.texi: Document __FAST_MATH__. + +2001-03-05 Kaveh R. Ghazi + + * crtstuff.c: Restore include of auto-host.h. + +2001-03-05 Fergus Henderson + + Put main() in a separate file, so that the language + front-end can use a different main(). + + * main.c: New. + * toplev.c: (main): Rename as toplev_main. + * toplev.h: Declare toplev_main. + * Makefile.in (OBJS): add toplev.o. + (BACKEND): remove toplev.o, add main.o. + +2001-03-04 Neil Booth + + * cppfiles.c (search_from): Special case the empty string. + +2001-03-04 Neil Booth + + * cppfiles.c (_cpp_execute_include): Don't make a null-terminated + copy of the filename. Don't use CPP_PREV_BUFFER. Don't call + strlen or strcpy; we already know the length. + (_cpp_compare_file_date): Similarly. + * cpphash.h (struct cpp_reader): Delete done_initialising. + (CPP_PREV_BUFFER): Delete. + * cppinit.c (cpp_start_read): Don't set done_initialising. + * cpplex.c (parse_string): Guarantee null-termination. + (_cpp_equiv_toklists): Remove. + * cpplib.c (glue_header_name): Null-terminate. + (do_line): Don't leak memory. + * cpplib.h (BT_WEAK): Delete. + * cppmain.c (cb_ident): Strings are now null-terminated. + +2001-03-04 Laurynas Biveinis + + * gcc.c (convert_filename): Append executable suffix + if NO_AUTO_EXE_SUFFIX is not defined. + * gcc.texi: Document NO_AUTO_EXE_SUFFIX. + * config/i386/djgpp.h: Define NO_AUTO_EXE_SUFFIX. + +2001-03-03 David O'Brien + + from 2000-09-06 Zack Weinberg + * c-parse.gperf, c-gperf.h: Delete. + (c-gperf.h was accidently re-added to the CVS repo in the rev + 1.16 commit by tromey) + +2001-03-03 Neil Booth + + * cpplex.c (_cpp_lex_token): Don't warn about directives in + macro arguments when looking for the '('. + * cppmacro.c (funlike_invocation_p): Set parsing_args to + 2 when really parsing arguments; 1 when looking for '('. + Always restore the lexer position. + +2001-03-03 Neil Booth + + * longlong.h (umul_ppmm): Don't use a multiline string. + +2001-03-03 John David Anglin + + * fixinc/fixlib.h (t_bool): Add identifier `t_bool' in typedef. + * fixinc/server.c (read_pipe_timeout): Use enum t_bool instead of + t_bool in declaration because pcc can't combine volatile with typedef + types. + +Sat Mar 3 19:47:13 CET 2001 Jan Hubicka + + * i386.c (ix86_expand_fp_compare): Delay creating of scratch register + until when it is really needed. + (ix86_expand_compare): Update call of ix86_expand_fp_compare. + * i386.h (PREDICATE_CODES): Add all codes for sse_comparison_operator + * i386.md (float?i?f splitter): Don't force source operand to memory + for SSE. + (sse_movdfcc): Fix constraint. + (sse_movdfcc splitter): Handle properly the second alternative. + +2001-03-03 Neil Booth + + * cpplex.c (parse_string): Unconditionally pedwarn. + +2001-03-03 Neil Booth + + * cpp.texi: Update. + * cppexp.c (parse_number): Update. + * cpplex.c (parse_string): Pedwarn if multiline string does not + result from a system header's macro. + * cpplib.h (sys_objmacro_p): Rename sys_macro_p. + * cppmacro.c (sys_objmacro_p): Rename sys_macro_p. Return true + for function-like macros too. + * c-lex.c (lex_number): Update. + +2001-03-03 Richard Henderson + + * dwarf2out.c (output_call_frame_info): Fix augmentation length. + +Sat Mar 3 04:17:17 2001 J"orn Rennecke + + * combine.c (try_combine): If split with mode-changed scratch + register didn't work, try the original mode. + +Sat Mar 3 03:46:47 2001 J"orn Rennecke + + * tm.texi: Change STRUCT_FORCE_BLK to MEMBER_TYPE_FORCES_BLK. + * config/c4x/c4x.h: Likewise. + * stor-layout.c (compute_record_mode): Likewise. + (layout_type, case ARRAY_TYPE): Use MEMBER_TYPE_FORCES_BLK. + +2001-03-02 Zack Weinberg + + * configure.in: Kill tm.h. Include the files in the $tm_file + list in all three of config.h, hconfig.h, tconfig.h, after the + relevant set of xm_files. Put TARGET_CPU_DEFAULT in all + three, include insn-codes.h in all three (#ifndef GENERATOR_FILE). + * configure: Regenerate. + * Makefile.in (clean): Don't delete tm.h. + + * system.h: If SUCCESS_EXIT_CODE and FATAL_EXIT_CODE are not + defined, set them from EXIT_SUCCESS and EXIT_FAILURE. If + those are not defined, set SEC and FEC to 0 and 1. + * gcc.texi: Update to match. + + * crtstuff.c: Include tconfig.h, not auto-host.h and tm.h. + * config/fp-bit.c, config/m68k/aux-crt2.asm, + config/m68k/aux-crtn.asm, config/m68k/aux-mcount.c: + Include tconfig.h, not tm.h. + + * config/xm-lynx.h, config/xm-std32.h, + config/a29k/xm-a29k.h, config/a29k/xm-unix.h, + config/alpha/xm-alpha.h, config/arc/xm-arc.h, + config/avr/xm-avr.h, config/c4x/xm-c4x.h, + config/clipper/xm-clix.h, config/convex/xm-convex.h, + config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h, + config/elxsi/xm-elxsi.h, config/fr30/xm-fr30.h, + config/h8300/xm-h8300.h, config/i370/xm-linux.h, + config/i386/xm-i386.h, config/i860/xm-i860.h, + config/i960/xm-i960.h, config/ia64/xm-ia64.h, + config/m32r/xm-m32r.h, config/m68hc11/xm-m68hc11.h, + config/m88k/xm-m88k.h, config/mcore/xm-mcore.h, + config/mips/xm-mips.h, config/mn10200/xm-mn10200.h, + config/mn10300/xm-mn10300.h, config/ns32k/xm-ns32k.h, + config/pa/xm-linux.h, config/pa/xm-pa.h, + config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h, + config/pa/xm-papro.h, config/pdp11/xm-pdp11.h, + config/pj/xm-pj.h, config/romp/xm-romp.h, + config/rs6000/xm-beos.h, config/rs6000/xm-rs6000.h, + config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, + config/sparc/xm-sparc.h, config/sparc/xm-sysv4.h, + config/v850/xm-v850.h, config/vax/xm-vax.h, + config/we32k/xm-we32k.h: + Don't include tm.h. + Don't define SUCCESS_EXIT_CODE or FATAL_EXIT_CODE. + + * config/i370/xm-i370.h, config/i370/xm-mvs.h, + config/i370/xm-oe.h: Don't include tm.h. Don't define + SUCCESS_EXIT_CODE. + * config/vax/xm-vms.h: Don't include tm.h. + + * config/xm-lynx.h, config/avr/xm-avr.h, + config/fr30/xm-fr30.h, config/pdp11/xm-pdp11.h, + Delete; made empty by above changes. + * config/i386/xm-lynx.h, config/m68k/xm-lynx.h, + config/rs6000/xm-lynx.h, config/sparc/xm-lynx.h: + Don't include config/xm-lynx.h or tm.h. + + * config/xm-gnu.h: Don't include fcntl.h. + * config/sparc/xm-lynx.h: Don't include sys/types.h and + sys/wait.h. + * config/clipper/xm-clix.h, config/vax/xm-vax.h: Don't define isinf. + +2001-03-02 Richard Henderson + + * tm.texi (File Framework): Document UNALIGNED_SHORT_ASM_OP, + UNALIGNED_INT_ASM_OP, and UNALIGNED_DOUBLE_INT_ASM_OP. + +2001-03-02 Richard Henderson + + * Makefile.in (OBJS): Add dwarf2asm.o. + * dwarf2asm.c, dwarf2asm.h: New files. + * dwarf2out.c (*): Use them. + (size_of_uleb128, size_of_sleb128): Remove. + (output_uleb128, output_sleb128): Remove. + (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP): Remove. + (UNALIGNED_DOUBLE_INT_ASM_OP, ASM_BYTE_OP): Remove. + (UNALIGNED_OFFSET_ASM_OP, UNALIGNED_WORD_ASM_OP): Remove. + (FDE_LABEL, LINE_NUMBER_BEGIN_LABEL, LINE_NUMBER_END_LABEL): New. + (ASM_OUTPUT_DWARF_DATA1, ASM_OUTPUT_DWARF_DELTA1): Remove. + (ASM_OUTPUT_DWARF_DATA2, ASM_OUTPUT_DWARF_DELTA2): Remove. + (ASM_OUTPUT_DWARF_DATA4, ASM_OUTPUT_DWARF_DELTA4): Remove. + (ASM_OUTPUT_DWARF_DATA, ASM_OUTPUT_DWARF_DELTA): Remove. + (ASM_OUTPUT_DWARF_ADDR, ASM_OUTPUT_DWARF_ADDR_DATA): Remove. + (ASM_OUTPUT_DWARF_ADDR_DELTA, ASM_OUTPUT_DWARF_ADDR_CONST): Remove. + (ASM_OUTPUT_DWARF_OFFSET4, ASM_OUTPUT_DWARF_OFFSET): Remove. + (ASM_OUTPUT_DWARF_CONST_DOUBLE): Remove. + (ASM_OUTPUT_DWARF_NSTRING, ASM_OUTPUT_DWARF_STRING): Remove. + (dwarf2out_frame_debug): Remove unused variables. + (output_loc_operands): Don't abort on 8 byte constants if + host integers are wide enough. + (output_symbolic_ref): Remove. + (size_of_die): Don't assume 4 byte host integers. + (output_line_info): Use ASM_GENERATE_INTERNAL_LABEL for begin + and end labels. + (add_const_value_attribute) [CONST_INT]: Verify we're not doing + something stupid with HOST_WIDE_INT to long truncation. + [CONST_DOUBLE]: Likewise. + + * config/arm/conix-elf.h (UNALIGNED_WORD_ASM_OP): Remove. + (ASM_OUTPUT_DWARF2_ADDR_CONST, ASM_OUTPUT_DWARF_ADDR_CONST): Remove. + * config/arm/unknown-elf.h: Likewise. + * config/rs6000/aix.h (UNALIGNED_SHORT_ASM_OP): New. + (UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): New. + (ASM_OUTPUT_DWARF_ADDR_VAR, ASM_OUTPUT_DWARF_DELTA_VAR): Remove. + (ASM_OUTPUT_DWARF_DELTA2, ASM_OUTPUT_DWARF_DELTA4): Remove. + (ASM_OUTPUT_DWARF_DELTA, ASM_OUTPUT_DWARF_ADDR_DELTA): Remove. + (ASM_OUTPUT_DWARF_ADDR, ASM_OUTPUT_DWARF_DATA4): Remove. + (ASM_OUTPUT_DWARF_DATA2, ASM_OUTPUT_DWARF_OFFSET4): Remove. + (ASM_OUTPUT_DWARF_OFFSET): Remove. + * config/rs6000/sysv4.h (ASM_OUTPUT_DWARF_ADDR): Remove. + * config/sparc/sp64-elf.h (UNALIGNED_DOUBLE_INT_ASM_OP): New. + (UNALIGNED_LONGLONG_ASM_OP, ASM_OUTPUT_DWARF_ADDR): Remove. + (ASM_OUTPUT_DWARF_ADDR_CONST, ASM_OUTPUT_DWARF_REF): Remove. + +2001-03-02 John David Anglin + + * cselib.c (hash_rtx): Cast enums to unsigned int. + +2001-03-02 John David Anglin + + * print-rtl.c (print_rtx): Cast enums to int for comparison. + * c-decl.c (grokdeclarator): Cast enums to int for comparison and + shifts. + * c-format.c (C_STD_VER): Cast to int for comparisons. + (check_function_format): Cast various enums to int for &. + (maybe_read_dollar_number): Likewise. + (check_format_info): Likewise. + (check_format_info_main): Likewise. + * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. + (safe_from_p): Likewise. + * varasm.c (const_hash): Cast enum to int for %. + * emit-rtl.c (init_emit_once): Use int loop variable to work around + pcc enum problems with < and ++ operators. + * regclass.c (init_reg_sets_1): Cast enums for comparison. + (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. + (regclass_init): Change enum class to int to iterate over reg_classes. + * genrecog.c (merge_trees): Cast enums for comparison. + * rtl.h (GET_CODE): Cast to enum rtx_code. + (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). + (GET_MODE): Cast to enum machine_mode. + (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). + (GET_NOTE_INSN_NAME): Cast enum to int. + * tree.h (TREE_CODE): Cast to enum tree_code. + (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). + * timevar.c (timevar_print): Change loop variable id from enum to + unsigned int. + * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. + * config/i386/i386.md: Use PUT_MODE for mode assignment. + * toplev.c (compile_file): Cast enum DFI to int. + (decode_d_option): Likewise. + +Fri Mar 2 12:18:13 2001 Christopher Faylor + + * cppinit.c (append_include_chain): Mark "after" include file name list + as a system directory. + * cpp.texi: Document new behavior. + +Fri Mar 2 11:59:43 CET 2001 Jan Hubicka + + * ifcvt.c (noce_operand_ok): Handle properly unarry operations. + +2001-03-02 Neil Booth + + * cppfiles.c (struct include_file): Update. + (stack_include_file): Use search_from. + (cpp_included, find_include_file): Update. + (cpp_execute_include): Update. ptr->name may not be + null terminated. Use the new search_from member variable + of cpp_buffer. + (_cpp_compare_file_date): Similarly. + (search_from): New function, similar to actual_directory. + (actual_directory): Delete. + (remap_filename): Update. loc->name may not be null terminated. + (struct file_name_list): Rename search_path. Update. + * cpphash.h (struct cpp_buffer): Delete actual_dir. New members + search_from and dir. + (struct cpp_reader): Remove actual_dirs. + * cppinit.c (struct cpp_pending): Update for renamed objects. + (append_include_chain, remove_dup_dir, remove_dup_dirs, + merge_include_chains, cpp_destroy, cpp_start_read): Similarly. + * cpplib.h (struct cpp_options): Similarly. + +2001-03-01 Zack Weinberg + + * config/xm-lynx.h, config/xm-std32.h, config/a29k/xm-a29k.h, + config/a29k/xm-unix.h, config/alpha/xm-alpha.h, + config/arc/xm-arc.h, config/arm/xm-arm.h, config/c4x/xm-c4x.h, + config/clipper/xm-clix.h, config/convex/xm-convex.h, + config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h, + config/elxsi/xm-elxsi.h, config/fr30/xm-fr30.h, + config/h8300/xm-h8300.h, config/i370/xm-i370.h, + config/i370/xm-linux.h, config/i370/xm-mvs.h, + config/i370/xm-oe.h, config/i386/xm-aix.h, + config/i386/xm-i386.h, config/i386/xm-osf.h, + config/i860/xm-i860.h, config/i960/xm-i960.h, + config/ia64/xm-ia64.h, config/m32r/xm-m32r.h, + config/m68k/xm-m68k.h, config/m88k/xm-m88k.h, + config/mcore/xm-mcore.h, config/mips/xm-mips.h, + config/mn10200/xm-mn10200.h, config/mn10300/xm-mn10300.h, + config/ns32k/xm-ns32k.h, config/pa/xm-linux.h, + config/pa/xm-pa.h, config/pa/xm-pa64hpux.h, + config/pa/xm-pahpux.h, config/pa/xm-papro.h, + config/pj/xm-pj.h, config/romp/xm-romp.h, + config/rs6000/xm-beos.h, config/rs6000/xm-rs6000.h, + config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, + config/sparc/xm-sparc.h, config/sparc/xm-sysv4.h, + config/v850/xm-v850.h, config/vax/xm-vax.h, + config/vax/xm-vms.h, config/we32k/xm-we32k.h: + Do not define TRUE or FALSE. + + * config/i386/xm-aix.h, config/i386/xm-osf.h: Delete; made + empty by above change. + * config.gcc: Remove references to these files. + + * configure.in: Detect stdbool.h. + * configure, config.in: Regenerate. + * system.h: Include stddef.h here if available. + Set HAVE__BOOL based on GCC_VERSION and __STDC_VERSION__. + Then set up a sensible boolean type at the very end. + + * combine.c, cse.c, expr.c, fold-const.c, gensupport.c, + config/mcore/mcore.c: Rename variables named 'true' and/or 'false'. + + * hash.h: Delete 'boolean' typedef and related #undefs. + + * function.c, ggc-common.c, hash.h, hash.c, tlink.c: Replace + all uses of 'boolean' with 'bool'. + +2001-03-01 John David Anglin + + * cpplib.c (_cpp_init_stacks): Cast enum for comparison. + * cppexp.c (lex): Cast enums for comparison. + * cppinit.c (parse_option): Cast enum for comparison. + * cpplex.c (cpp_spell_token): Cast enums to int for minus. + (cpp_output_token): Likewise. + (cpp_can_paste): Cast enums for comparsion and plus/minus. + (cpp_avoid_paste): Cast enums for minus and comparison. + +2001-03-01 Zack Weinberg + + * gcc.c, objc/lang-specs.h: Add zero initializer for cpp_spec + field to all array elements. + +2001-03-01 Zack Weinberg + + * cpphash.h (struct cpp_reader): Add print_version field. + * cppinit.c (cpp_handle_option): For -v, -version, and --version, + just set print_version and other flags as appropriate. + (cpp_post_options): Print version here if print_version is set. + + * toplev.c (exit_after_options): New flag. + (independent_decode_option): Don't exit here; just set + exit_after_options. + (main): Exit after calling lang_hooks.post_options if + exit_after_options is true. + + * cppinit.c (append_include_chain): Drop never-used case QUOTE. + (merge_include_chains): Adjust comment to match code. + +2001-03-01 Zack Weinberg + + * stringpool.c (set_identifier): New function. + * tree.h: Prototype it. + + * c-parse.in: Kill D_YES. If compiled for objc, call + save_and_forget_protocol_qualifiers from init_reswords. + * objc/objc-act.c (remember_protocol_qualifiers, + forget_protocol_qualifiers): Don't diddle C_IS_RESERVED_WORD. + Swap out the non-keyword IDENTIFIER_NODEs for keyword ones, or + vice versa. + (save_and_forget_protocol_qualifiers): New function. + * c-lex.h: Prototype save_and_forget_protocol_qualifiers. + +2001-03-01 Diego Novillo + + * c-semantics.c (prune_unused_decls): Return error_mark_node + instead of (tree) 1 to stop traversing the tree chain. + +2001-03-01 Bernd Schmidt + + Fix a problem introduced by Kenner's Feb 18 change. + * toplev.c (rest_of_compilation): Disable flag_cse_follow_jumps and + flag_cse_skip_blocks only temporarily, not for ever. + +Thu Mar 1 09:49:58 2001 Jeffrey A Law (law@cygnus.com) + + * config/pa/som.h (ASM_IDENTIFY_GCC): Define. + (ASM_IDENTIFY_GCC_AFTER_SOURCE): Likewise. + + * pa.c (emit_move_sequence): Verify operand0 is a hard register + before determining its register class. + +2001-03-01 Bernd Schmidt + + * config/ia64/ia64.c (ia64_hard_regno_rename_ok): Disallow renaming + from reg 4 if current_function_calls_setjmp. + (gen_nop_type): New function. + (ia64_emit_nops): New function. + (ia64_reorg): Call it. + (ia64_sched_reorder): Move code that rotates bundles up a bit. + + * reload1.c (eliminate_regs_in_insn): Restrict the special case + code not to try to optimize adds with anything but a REG destination. + + * sched-int.h (struct haifa_insn_data): Add new member priority_known. + (INSN_PRIORITY_KNOWN): New accessor macro. + * haifa-sched.c (priority): Use it instead of testing priority against + zero. + +2001-02-28 DJ Delorie + + * config/m68k/m68k.h (MOVE_BY_PIECES_P): Avoid pushing bytes, + since that doesn't work the way gcc wants on a generic m68k. + +2001-02-28 Richard Henderson + + * caller-save.c (save_call_clobbered_regs): Fix typo in + comparison last change. + +Wed Feb 28 19:31:42 CET 2001 Jan Hubicka + + * i386.c (pentium4_cost): New. + (m_PENT4): New macro. + (x86_push_memory, x86_movx,x86_cmove, x86_deep_branch, x86_use_sahf + x86_sub_esp_4, x86_sub_esp_8, x86_add_esp_4, x86_add_esp_8 + x86_integer_DFmode_moves, x86_partial_reg_dependency, + x86_memory_mismatch_stall): Add Pentium4 + (x86_use_q_reg, x86_use_any_reg): Kill. + (override_options): Add pentium4. + (incdec_operand): Return 0 for pentium4. + (ix86_issue_rate): Add PROCESSOR_PENTIUM4 and PROCESSOR_ATHLON. + * i386.h (x86_use_q_reg, x86_use_any_reg): Kill. + (TARGET_PENTIUM4): Define. + (enum processor_type): Add PROCESSOR_PENTIUM4. + (CPP_CPU_DEFAULT_SPEC): Add pentium4 support. + * i386.md (attribute "cpu"): Add pentium4. + * invoke.texi (march): Add pentium4. + +Wed Feb 28 19:28:06 CET 2001 Jan Hubicka + + * i386.md (sse_mov?fcc*): New patterns and splitters. + * i386.c (ix86_expand_movcc): Work post-reload; recognize + the SSE based conditional moves. + +Wed Feb 28 19:18:23 CET 2001 Jan Hubicka + + * i386.md (attribute mode): Add "TI". + (movsf_1): Add pxor support; remove constant propagation splitter. + (movdf_integer): Likewise. + (movdf_nointeger): Likewise. + (movxf constant prop splitter): Handle all modes; update for SSE. + * i386.h (CONST_DOUBLE_OK_FOR_LETTER): Add 'H' for SSE constants. + * i386.c (standard_80387_constant_p): Rewrite. + (standard_sse_constant_p): New. + * i386-protos.h (standard_sse_constant_p): New. + +Wed Feb 28 19:05:37 CET 2001 Jan Hubicka + + * i386.md (sse_setccsf, sse_setccdf): New. + (sse_cmp* patterns): Use '%D' instead of outputtting condition + flag directly. + * i386.c (sse_comparison_operator): Accept the supported unordered + comparses; be ready for fast_math. + (print_operand): Support 'D'. + +Wed Feb 28 18:54:51 CET 2001 Jan Hubicka + + * jump.c (reversed_comparison_code): Kill. + +Wed Feb 28 18:50:15 CET 2001 Jan Hubicka + + * toplev.c (rest_of_compilation): Do post-reload splitting unconditionally + for STACK_REGS + +Wed Feb 28 18:47:37 CET 2001 Jan Hubicka + + * i386.md (sse_andti3, sse_nandti_3, sse_xorti3): Add SSE2 versions; + add missing '%' in constraints. + +Wed Feb 28 17:24:24 CET 2001 Jan Hubicka + + * c-common.c (build_common_tree_nodes): Build intTI_type_nodes + for HOST_BITS_PER_WIDE_INT == 32 too. + +Wed Feb 28 17:22:35 CET 2001 Jan Hubicka + + * caller-save.c (reg_save_code, reg_restore_code): Index by mode, not + NREGS. + (insert_save, insert_restore): New parameter save_mode. + (init_caller_save): Update initialization of reg_save_code + and reg_restore_code. + (save_call_clobbered_regs): Compute save_modes and update calls to + reg_save_code and reg_restore_code. + (insert_restore): Unsignetize numbers; use save_modes to choose mode + of spill; update use of reg_restore_code. + (insert_save): Likewise. + * i386.h (HARD_REGNO_CALLER_SAVE_MODE): Update. + * c4x.h (HARD_REGNO_CALLER_SAVE_MODE): Update. + * regs.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise. + +Wed Feb 28 17:19:28 CET 2001 Jan Hubicka + + * ifcvt.c (noce_emit_store_flag, noce_try_store_flag_constants, + noce_try_store_flag_inc, noce_try_store_flag_mask, + noce_try_cmove_arith): + Use reversed_comparison_code instead of reverse_comparison and + can_reverse_comparison_p. + +Wed Feb 28 17:17:29 CET 2001 Jan Hubicka + + * jump.c (reversed_comparison_code_parts): Allow reversal of + unordered compares in -ffast-math mode; reverse ordered compares + for FP even w/o -ffast-math. + +2001-02-27 Richard Henderson + + * print-rtl.c (print_rtx) [i]: Don't print field five on + NOTEs other than NOTE_INSN_DELETED_LABEL. + +2001-02-27 Zack Weinberg + + * mips/xm-iris4.h: Delete #if 0 block (there since before 1997). + * pa/xm-linux.h, pa/xm-pa.h, pa/xm-papro.h: Don't declare errno. + +2001-02-27 Diego Novillo + + * c-common.c (walk_stmt_tree): Visit the chain of the current tree + even if walk_subtrees is 0. + * c-semantics.c (prune_unused_decls): Return a non-null value to + stop traversing the tree chain. + +2001-02-27 DJ Delorie + + * config/m68k/m68k.c (output_function_prologue): Save the new CFA + register, *then* define it as the new CFA. + +Tue Feb 27 16:49:13 2001 Jeffrey A Law (law@cygnus.com) + + * pa.c (override_options): Promote -fpic to -fPIC. + (legitimize_pic_address): Simplify due to removal of + small PIC as a code generation option. + (secondary_reload_class): Similarly. + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Similarly. + (PRINT_OPERAND_ADDRESS): Similarly. + * pa.md (various patterns): Similarly. + (small pic lo_sum pattern): Remove. + +Tue Feb 27 16:01:13 CET 2001 Jan Hubicka + Fergus Henderson + + * md.texi (min, max): Document + +Tue Feb 27 15:51:35 CET 2001 Jan Hubicka + + * i386.md (movsf, movdf): Use movaps for reg-reg moves if + TARGET_PARTIAL_REG_DEPENDENCY. + (truncdfsf2_1_sse, truncdfsf2_2): Penalize the fpreg->mem case. + +Tue Feb 27 15:36:48 CET 2001 Jan Hubicka + + * i386.md (mins*, maxs*): New patterns, expanders and splitters. + +2001-02-26 Jeffrey Oldham + + * mips.c (mips_make_temp_file): Fix thinko in last change. + +2001-02-26 Jason Eckhardt + + * combine.c (known_cond): Do not reverse the condition when + SMAX/UMAX is being considered and the condition is for equality + or inequality. + + * testsuite/gcc.c-torture/execute/20010221-1.c: New test. + +2001-02-26 Philip Blundell + + * config.gcc: Remove obsolete targets "arm*-*-linuxoldld" and + "armv2-*-linux". + * config/arm/linux-elf.h: Remove historical relics related to + above configurations. + * config/arm/linux-oldld.h: Delete. + * config/arm/linux-elf26.h: Delete. + +2001-02-26 Jason Merrill + + * c-decl.c (finish_decl): Set DECL_DEFER_OUTPUT on tentative file-scope + definitions. + * toplev.c (rest_of_decl_compilation): Check DECL_DEFER_OUTPUT to + recognize a tentative definition. Lose obsolete code. + + * toplev.c (wrapup_global_declarations): Don't emit DECL_COMDAT + variables unless necessary, either. + +2001-02-25 Richard Henderson + + * ifcvt.c (struct noce_if_info): Add test_bb. + (noce_get_alt_condition): New. + (noce_try_minmax, noce_try_abs): New. + (noce_operand_ok): New. + (noce_process_if_block): Use them. + * rtlanal.c (may_trap_p): NEG and ABS can never trap. + +Sun Feb 25 14:26:17 2001 Christopher Faylor + + * config/i386/cygwin.h (CPP_SPEC): Add missing space before w32api + include. + +2001-02-25 Zack Weinberg + + * config.gcc: Put back pa/t-openbsd and rs6000/t-openbsd. + * config/mips/mips.c (mips_make_temp_file): Set temp_filename + properly. + (mips_asm_file_end): Free temp_filename here. + +Sun Feb 25 08:34:23 2001 Richard Kenner + + * config/i386/i386-protos.h (ix86_set_move_mem_attrs): Move decl. + * config/i386/i386.c (ix86_set_move_mem_attrs_1): Fix typo. + + * config/i386/i386.md (movstrsi): Handle FAIL case. + +2001-02-25 Neil Booth + + * cppinit.c (builtin_array): Update. + (init_builtins): Flag builtins to warn if redefined or + undefined. Define __GXX_WEAK as a normal macro. + * cpplib.c (do_undef): Warn if flagged NODE_WARN. + * cpplib.h (NODE_WARN): New flag. + * cppmacro.c (builtin_macro): Remove handling of __GXX_WEAK__. + Handle __STDC__ as a builtin only on Solaris. + (warn_of_redefinition): Renamed from check_macro_definition. + Reverse sense of test. Always warn if NODE_WARN. + (_cpp_create_definition): Use warn_of_redefinition. Flag + any macro beginning with "__STDC_" to require a mandatory + warning if redefined or undefined. + +2001-02-24 Zack Weinberg + + * xm-interix.h, xm-lynx.h, alpha/xm-vms.h, convex/xm-convex.h, + i370/xm-i370.h, i370/xm-linux.h, i370/xm-mvs.h, i370/xm-oe.h, + i386/xm-beos.h, i386/xm-dos.h, i386/xm-mingw32.h, + i860/xm-i860.h, m68k/xm-3b1.h, m68k/xm-amix.h, m68k/xm-aux.h, + m68k/xm-crds.h, m68k/xm-mot3300.h, m88k/xm-sysv3.h, + mips/xm-mips.h, rs6000/xm-beos.h, vax/xm-vms.h: + Don't define any of: + USE_PROTOTYPES, vfork, mktemp, SVR3, NO_SYS_PARAMS_H, + P_tmpdir, MVS, NO_DBX_FORMAT, USE_STDARGS, STDC_HEADERS, + NO_PRECOMPILES, i860, __PTR_TO_INT, __INT_TO_PTR, rindex, + index, FULL_PROTOTYPES, AUX, R_OK, W_OK, X_OK, F_OK, + STACK_DIRECTION, MIPS, MAX_READ_LEN, MAX_WRITE_LEN. + + * alpha/xm-alpha.h, clipper/xm-clix.h, d30v/xm-d30v.h, + fr30/xm-fr30.h, i370/xm-linux.h: Remove commented-out macro + definitions. + + * m68k/xm-3b1.h, m68k/xm-crds.h, m88k/xm-sysv3.h: + Delete now-empty file. + + * alpha/vms.h: Define NEED_ATEXIT here... + * alpha/xm-vms.h: ...not here. + + * i386/cygwin.h: Don't define PARAMS. + * mips/mips.c: Don't prototype mktemp. Don't define + P_tmpdir. Use make_temp_file to create temporary files. + Don't be clever and delete temporary files early. + * config.gcc: Drop references to deleted files. Don't define + FULL_PROTOTYPES. + * gcc.texi: Don't mention USE_PROTOTYPES. + +Sat Feb 24 20:25:29 2001 Richard Kenner + + * config/i386/i386.c (ix86_set_move_mem_attrs): New function. + (ix86_set_move_mem_attrs_1): Likewise. + * config/i386/i386-protos.h (ix86_set_move_mem_attrs): New declaration. + * config/i386/i386.md (movstrsi): Call it. + +2001-02-24 Zack Weinberg + + * config.gcc: Expunge references to alpha/t-pe, pa/t-openbsd, + x-linux-aout, i386/t-go32, t-osf, m68k/x-m68kv, + ns32k/xm-netbsd.h, rs6000/t-openbsd, rs6000/t-xnewas, + rs6000/x-aix41-gld. These are nonexistent, empty, or obsolete. + + (i750a-*-*): Error here if hosting on i750a. + (alpha*-*-winnt*, ix86-*-winnt3*): Remove stanzas entirely. + + * x-linux-aout, xm-freebsd.h, i386/beos-pe.h, ns32k/xm-netbsd.h: + Remove (empty modulo comments). + + * 1750a/xm-1750a.h, alpha/config-nt.sed, alpha/win-nt.h, + alpha/xm-winnt.h, i386/config-nt.sed, i386/os2.h, + i386/t-winnt, i386/win-nt.h, i386/xm-freebsd.h, i386/xm-os2.h, + i386/xm-winnt.h, m68k/x-alloca-c, m88k/x-dguxbcs, + mips/x-netbsd, mips/x-nws3250v4, rs6000/t-xnewas, + rs6000/t-xrs6000, rs6000/xm-cygwin.h: Remove (obsolete) + + * i386/crtdll.h, i386/cygwin.h, i386/mingw32.h: + Remove reference to winnt.h in comment. + * rs6000/t-newas, rs6000/t-rs6000: Override LIBGCC1_TEST to null. + +2001-02-24 Franz Sirl + + * loop.c (check_dbra_loop): A biv has uses besides counting if it is + used to set another biv. + +Sat Feb 24 06:45:21 2001 Richard Kenner + + * tree.h (BLOCK_DEAD): New macro. + (struct tree_block): New flag, dead_flag. + * print-tree.c (print_node, case 'b'): Print missing fields. + * emit-rtl.c (remove_unnecessary_notes): Set BLOCK_DEAD. + * function.c (identify_blocks): Enable test for misplaced notes. + (all_blocks): Skip BLOCK_DEAD blocks. + * integrate.c (integrate_decl_tree): Likewise. + + * errors.c (internal_error, trim_filename): New functions. + (fancy_abort): Call internal_error. + * errors.h (internal_error, trim_filename): New declarations. + +2001-02-24 Alexandre Oliva + + * config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Reverted + 2000-08-26's patch. + (EXTRA_CONSTRAINT): Formatting changes. + +2001-02-23 Kaveh R. Ghazi + + * rtl.c (rtl_check_failed_code2): Fix typo in last change. + +2001-02-23 Per Bothner + + * gcc.c (record_temp_file, pfatal_with_name, error): Make non-static, + so they can be called from java/jvspec.c. + * gcc.h (record_temp_file, pfatal_with_name, error): Declare. + +Sat Feb 24 03:32:50 CET 2001 Jan Hubicka + + * i386.c (ix86_frame): New structure. + (ix86_compute_frame_size): Kill. + (ix86_compute_frame_layout): New. + (ix86_save_reg): New. + (ix86_can_use_return_insn_p): Use frame layout stuff. + (ix86_expand_prologue): Likewise. + (ix86_expand_epilogue): Likewise. + (ix86_initial_elimination_offset): Likewise. + (ix86_nsaved_regs): Use ix86_save_reg. + (ix86_emit_save_regs): Likewise. + +Sat Feb 24 03:30:38 CET 2001 Jan Hubicka + + * flow.c (find_sub_basic_blocks): New function. + (split_block): Be ready for basic block introduced by CODE_LABEL. + (commit_one_edge_insertion): Call find_sub_basic_block. + + * flow.c (make_edges): Add edge from entry for blocks starting with + label having ALTERNATE_NAME + +Sat Feb 24 03:19:42 CET 2001 Jan Hubicka + + * function.c (epilogue_done): Be ready for first basic block not + containing PROLOGUE_END note. + (reposition_prologue_and_epilogue_notes): Avoid placing + PROLOGUE_END note between BASIC_BLOCK. + +Sat Feb 24 03:17:09 CET 2001 Jan Hubicka + + * loop.c (canonicalize_condition): Move to reversed_comparison_code. + +2001-02-21 DJ Delorie + + * config/i960/i960.h (FRAME_POINTER_REQUIRED): Revert removal of + check for current_function_has_nonlocal_goto from 1999-11-12. + +Fri Feb 23 15:28:39 2001 Richard Kenner + + * diagnostic.c (trim_filename): No longer static. + * toplev.h (trim_filename): Declare. + * rtl.c (rtl_check_failed_bounds): Call internal_error. + (rtl_check_failed_type1, rtl_check_failed_type2): Likewise. + (rtl_check_failed_code1, rtl_check_failed_code2): Likewise. + (rtvec_check_failed_bounds): Likewise. + * tree.c (tree_check_failed, tree_class_check_failed): Likewise. + + * convert.c (convert_to_integer): Don't do unsigned unless result or + both inputs are unsigned. + + * fold-const.c (fold_convert): Don't call size_int_type_wide if + input overflows. + + * c-decl.c (set_block): Set NAMES and BLOCKS from BLOCK. + + * varasm.c (output_constant): Recompute CODE after lang-specific fn. + +2001-02-23 Jeffrey Oldham + + * Makefile.in (resource.o): Add params.h dependence. + * params.def (MAX_DELAY_SLOT_LIVE_SEARCH): New parameter. + * params.h (MAX_DELAY_SLOT_LIVE_SEARCH): Likewise. + * resource.c: Add dependence on params.h. + (current_live_regs): Fix explanatory comment. + (find_basic_block): Add new parameter to permit limiting search + for a BARRIER. + (mark_target_live_regs): Add new argument to find_basic_block call. + (incr_ticks_for_insn): Likewise. + +2001-02-23 Gabriel Dos Reis + + * diagnostic.c (output_to_stream): Rename to + output_buffer_to_stream. Loses the stream parameter. + (init_output_buffer): Set diagnosic_buffer's stream. + (flush_diagnostic_buffer): Adjust. + (default_print_error_function): Likewise. + (finish_diagnostic): Likewise. + (verbatim): Likewise. + + * diagnostic.h (struct output_buffer): Add `stream' field. + (output_buffer_attached_stream): New macro. + +2001-02-23 Jakub Jelinek + + * fold-const.c (extract_muldiv) [case PLUS_EXPR]: If not MULT_EXPR, + check if either operand is divisible by C. + (multiple_of_p): Handle LSHIFT_EXPR with small constant shift. + If type is signed, consider negative numbers as well. + +2001-02-22 Richard Henderson + + * config/ia64/crtbegin.asm (.fini): Use pc-relative relocs to + reach .text instead of gp-relative relocs. + * config/ia64/crtend.asm (.init): Likewise. + +2001-02-22 Andreas Jaeger + + * extend.texi (C++ Attributes): Fix typo. + +2001-02-21 David Mosberger + + * config/ia64/ia64.c (ia64_epilogue_uses): For syscall_linkage + functions, drop current_function_args_info.words test. + (ia64_compute_frame_size): Mark syscall_linkage functions as + using eight input registers. + +2001-02-21 Loren J. Rittle + Bruce Korb + + * fixinc/inclhack.def (freebsd_gcc3_breakage): new fix + * fixinc/README: Document how to convert sed substitutions + to format style c_fix-es. + * fixinc/fixincl.x: regen + +2001-02-21 Jeffrey D. Oldham + + * gcc.c: Add comment explaining how to add a command-line option. + Add title to specs language comment. + +2001-02-21 Jeffrey Oldham + + * gcc.c (cc1_options): Add "-param". + (DEFAULT_WORD_SWITCH_TAKES_ARG): Likewise. + (option_map): Likewise. + * toplev.c (display_help): Add entry for "--param". + (independent_decode_option): Fix typographical error. + +Wed Feb 21 18:57:28 CET 2001 Catherine Moore + Bernd Schmidt + Jan Hubicka + + * i386.c (function_arg_advance): Pass SSE arguments in registers. + (function_arg): Likewise. + +Wed Feb 21 18:12:41 CET 2001 Jan Hubicka + + * i386.md (mmx_lshrdi3, mmx_ashldi3): Guard by unspec. + +2001-02-21 Kazu Hirata + + * config/h8300/h8300.md (iorsi3): Do not output an extra newline + character. + (xorsi3): Likewise. + +Wed Feb 21 17:35:24 CET 2001 Jan Hubicka + + * flow.c (init_propagate_block_info): Canon address and use single_set + for killing dead memory stores. + +2001-02-21 Jeffrey Oldham + + * Makefile.in (reorg.o): Add params.h dependence. + * params.def: Fix typographical error in comment. + (MAX_DELAY_SLOT_INSN_SEARCH): New parameter. + * params.h: Modify introductory comment. + (MAX_DELAY_SLOT_INSN_SEARCH): New parameter. + * reorg.c: Add dependence on params.h. + (redundant_insn): Add parameterized throttle for search. + (fill_simple_delay_slots): Add a comment explaining a variable. + Move conditional out of loop, simplifying code. + (fill_eager_delay_slots): Fix typographical error in comment. + +2001-02-20 Aldy Hernandez + + * tm.texi (REVERSE_CONDEXEC_PREDICATES_P): New macro documentation. + + * flow.c (ior_reg_cond): Use REVERSE_CONDEXEC_PREDICATES_P macro. + (REVERSE_CONDEXEC_PREDICATES_P): Define macro. + +2001-02-21 Jason Merrill + + * tree.h (DECL_UNINLINABLE): Move from C++ frontend. + (struct tree_decl): Add uninlinable bitfield. + * c-decl.c (duplicate_decls): Set it. + * integrate.c (function_cannot_inline_p): Check it. + + * dwarf2out.c (add_name_and_src_coords_attributes): Don't add + DW_AT_MIPS_linkage_name to abstract methods. + (dwarf2out_abstract_function): Emit class context before calling + set_decl_abstract_flags. Don't clear DECL_ABSTRACT. + (gen_subprogram_die): Remove obsolete code. + (gen_member_die): Don't include clones in the member list. + (gen_decl_die): Emit abstract info for clone origin. + * dwarfout.c (output_type): Don't include clones in the member list. + * dbxout.c (dbxout_type_methods): Ignore abstract methods. + * toplev.c (note_deferral_of_defined_inline_function): Don't clear + DECL_ABSTRACT on a function that already has it set. + + * dwarf2out.c (gen_formal_types_die): Also accept a FUNCTION_DECL. + (get_subprogram_die): Pass it in. + +2001-02-21 Richard Earnshaw + + * flow.c (mark_set_1): Make not_dead unsigned long. For + non-pseudos, use it as a bitmask of the hard regs that + don't die. + +2001-02-21 Neil Booth + + * cppfiles.c: Update comments. + (_cpp_read_file): Don't check for NULL filenames any more. + * cppinit.c (cpp_start_read): Don't do canonicalization of + in_fname and out_fname. Use the passed file name exclusively. + (_cpp_handle_options): Don't treat "-" as a command line option, + but as a normal filename. + (_cpp_post_options): Canonicalize in_fname and out_fname. + * cppmain.c (printer_init): Don't check out_fname for NULL. + * c-lex.c (orig_filename): Rename cpp_filename for clarity. + (init_c_lex): Update, and use "" to represent stdin to CPP. + (yyparse): Update. + +2001-02-20 Will Cohen + + * config/pa/quadlib.c (_U_Qfcnvfxt_quad_to_usgl): New function. + * config/pa/long_double.h (FIXUNS_TRUNCTFSI2_LIBCALL): Added. + (INIT_TARGET_OPTABS): Use FIXUNS_TRUNCTFSI2_LIBCALL for + fixunstfsi_libfunc. + +2001-02-20 Stan Shebs + + * config/rs6000/rs6000.c (output_cbranch): Output branches + on separate lines instead of using ';' to separate. + +2001-02-20 Neil Booth + + * cppinit.c (set_lang): Move builtin handling to... + (init_builtins): ...here. + (_cpp_create_reader): Move call to set_lang. + +2001-02-20 Mark Mitchell + + * stmt.c (expand_return): If an attempt is made to return the + error_mar_node, treat the return like a return without a value. + +2001-02-19 Zack Weinberg + + * sibcall.c (skip_copy_to_return_value): Call + identify_call_return_value here, and return orig_insn if it + returns zero. Hardret and softret arguments now unnecessary. + (call_ends_block_p): Don't call identify_call_return_value here. + + * ggc-common.c (ggc_mark_rtx_children): No need to mark 'S' or + 's' slots in RTXen. + * ggc-page.c, ggc-simple.c (ggc_mark_if_gcable): Delete function. + * ggc.h (ggc_mark_if_gcable): Delete prototype. + +Mon Feb 19 20:30:16 2001 Jeffrey A Law (law@cygnus.com) + + * pa.c (move_operand): Accept code to load the address of a + symbol out of the DLT as a valid move operand. + (print_operand, case 'A'): New to handle generating a DLT + reference for a LO_SUM expression. + * pa.h (EXTRA_CONSTRAINT): Handle 'A' for DLT LO_SUM references. + * pa.md (movsi, movdi patterns): Allow DLT LO_SUM references. + +2001-02-19 Joseph S. Myers + + * README, cpp.texi, gcc.texi, version.c: Update version number to + 3.1. + * cpp.1, gcov.1, gcc.1: Regenerate. + +2001-02-19 Neil Booth + + * cppfiles.c (stack_include_file): Generate dependencies + here, and manage include_count here too. + (PRINT_THIS_DEP): Delete. + (_cpp_execute_include): Do not generate dependencies here, + apart from the case of a missing header. Do not manage + include_count. + (_cpp_read_file): Leave dependency generation to + stack_include_file. + +Mon Feb 19 10:17:47 2001 Jeffrey A Law (law@cygnus.com) + + * config.gcc (hppa*64*-*-hpux11*): Add MASK_GAS to + target_cpu_default. Remove dead assignment to + target_cpu_default. + +Mon Feb 19 16:47:39 CET 2001 Jan Hubicka + + * regclass.c (contains_reg_of_mode): Make global. + (init_reg_sets): Remove contains_reg_of_mode; take into account + CLASS_MAX_NREGS when looking for the proper mode. + (dump_regclass): Dump only classes considered for the pseudo. + (regclass): Use contains_reg_of_mode. + +Mon Feb 19 16:45:42 CET 2001 Jan Hubicka + + * gcc.c (do_spec_1): 'n' for printing notices. + * i386.h (CC1_CPU_SPEC): Notice deprecated options as deprecated. + +Mon Feb 19 15:51:30 CET 2001 Jan Hubicka + + * reg-stack.c (next_flags_user): Use current_block->end + (swap_rtx_condition): Look for next user if flags don't die; + give up on CALL_INSNs; use current_block->end. + +Mon Feb 19 08:27:21 2001 Richard Kenner + + * sibcall.c (call_ends_block_p): New function. + (optimize_sibling_and_tail_recursive_call): Use it. + +2001-02-18 Kazu Hirata + + * config/h8300/h8300.md: Update copyright. + (andsi3): Do not output an extra newline character. + +Sun Feb 18 15:45:17 2001 Richard Kenner + + * toplev.c (note_deferral_of_defined_inlined_function): Argument + FNDECL may be unused. + + * toplev.c (rest_of_compilation): Don't have CSE skip blocks or + follow jumps after first run. + If -fexpensive-optimizations rerun CSE after GCSE and iterate until + it doesn't change any jumps. + +Sun Feb 18 17:05:50 2001 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (rtlanal.o): Depend on hard-reg-set.h. + ($HOST_PREFIX_1)rtlanal.o: Remove rules for building + (mostlyclean): Corresponding changes. + * rtlanal.c (hard-reg-set.h): Include. + (rtx_unstable_p): Do not treat the argument pointer specially + if it is not a fixed register. + (rtx_varies_p, rtx_addr_can_trap_p): Similarly. + +Sun Feb 18 15:45:17 2001 Richard Kenner + + * sibcall.c (optimize_sibling_and_tail_recursive_call): Compare + against last real insn in basic block. + Rework to avoid gotos. + + * Makefile.in (gcse.o): Now includes ggc.h. + * gcse.c: Include ggc.h. + (want_to_gcse_p): Verify expression can be in SET as valid insn. + (try_replace_reg): Remove warning of uninitialize variable. + (process_insert_insn): Call invalid_insn_p to validate insn. + * recog.c (insn_invalid_p): Now global. + See if can make valid by adding CLOBBERs of SCRATCH only and do if so. + * recog.h (insn_invalid_p): New declaration. + + * jump.c (jump_optimize_1): Only define reversed_code #ifdef HAVE_trap. + + * config/sparc/sparc.c (eligible_for_epilogue_delay): Don't put + assignments from FP constants since 'Y' output code can't handle it. + (eligible_for_sibcall_delay): Likewise. + + * flow.c (print_rtl_and_abort_fcn): Renamed from print_rtl_and_abort. + Call fancy_abort directly, passing args. + (print_rtl_and_abort): Now a macro, like fancy_abort. + + * final.c (output_operand_lossage): Use internal_error, not error. + +2001-02-18 Shane Nay + + * mips.c (mips_expand_prologue) Add REG_MAYBE_DEAD to + structure shift insns. + +2001-02-18 Mark Mitchell + + * invoke.texi (-fsquangle): Remove documentation. + (-fname-mangling-version): Likewise. + +2001-02-18 Lars Brinkhoff + + * optabs.c (expand_abs): Remove reference to + HAVE_contitional_arithmetic. + * combine.c (simplify_set): Likewise. + +2001-02-18 Richard Henderson + + * ifcvt.c (dead_or_predicable): Don't move code if eh regions + would be disrupted. + +2001-02-18 Richard Henderson + + * config/ns32k/ns32k.h (ADJSP): Upcase arguments. + + * config/alpha/alpha.md (movsi_fix): Fix typo in pattern name. + + * reload1.c (reload_cse_simplify_set): Fix typo. + +Sun Feb 18 09:30:09 2001 Richard Kenner + + * diagnostic.c (_fatal_insn): Decrement errorcount. + + * invoke.texi (-I): Add note avoiding use for system header files. + + * rtl.h (add_clobbers): Remove duplicate declaration. + * recog.h (added_clobbers_hard_reg_p): New declaration. + * genemit.c (struct clobber_pat): New field has_hard_reg. + (gen_insn): Record if added clobbers clobber hard reg. + (gen_split): Avoid unused warning if number of operands is 0. + (output_added_clobbers_hard_reg_p): New function. + (main): Call it. + +2001-02-18 Alan Modra + + * pa.c (hppa_expand_prologue): Simplify code storing return + pointer. For large (>=8k) frames with a post_store, adjust stack + pointer by 8k-64 first rather than by 64. When testing with + VAL_14_BITS_P, always use the actual value rather than the value + negated. Add blockage to prevent scheduling of spills before + stack frame has been created. + (hppa_expand_epilogue): Simplify code loading return pointer. + Allow a slightly larger range for merge_sp_adjust_with_load case. + When testing with VAL_14_BITS_P, always use the actual value. + + * pa.c (pa_adjust_insn_length): Check that block move + pattern is a set before looking at operands. + +2001-02-17 Mark Mitchell + + * fold-const.c (fold_binary_op_with_conditional_arg): New + function, split out from ... + (fold): ... here. + * tree.def (COND_EXPR): Document the use of VOID_TYPE for + conditional arms that throw exceptions. + + * print-tree.c (print_node): Do not use BLOCK_CHAIN when we're not + looking at a BLOCK. + +2001-02-17 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_CHECK_DECL): Before attempting the test, + define HAVE_DECL_* to 1 to mask potential backup declarations. + * configure: Regenerated. + +2001-02-17 Mark Mitchell + + * invoke.texi (-Woverloaded-virtual): Clarify documentation. + +2001-02-17 Richard Henderson + + * reload1.c (reload_cse_simplify_set): Respect LOAD_EXTEND_OP + when replacing a memory load with a register. + +Sat Feb 17 14:48:30 2001 Richard Kenner + Jan Hubicka + + * recog.c (validate_replace_src_1): New. + (validate_replace_src_data): Likewise. + (validate_replace_src): Use note_uses. + * rtl.h (note_uses): Declare. + * rtlanal.c (note_uses): New. + +Sat Feb 17 10:52:34 CET 2001 Jan Hubicka + + * reg-stack.c (stack_def): Make field reg unsigned. + (remove_regno_note): Unsignetize parameter. + +2001-02-16 Jes Sorensen + + * ia64.c (errata_emit_nops): Add VOIDmode as second argument to + shladd_operand() call. + +2001-02-16 Bruce Korb + Rodney Brown + + * fixinc/mkfixinc.sh: Use C fixincludes for UnixWare 7. + * fixinc/inclhack.def: Add fixinc.svr4 patterns with matching + machine restrictions + * fixinc/fixincl.x: regen + +Fri Feb 16 12:41:30 2001 Richard Kenner + + * gcse.c (hash_scan_set): If cprop, see if REG_EQUAL or REG_EQUIV. + Don't CSE a nop. + (hash_scan_insn): Clean up calls to hash_scan_set. + (compute_kill_rd): REGNO now unsigned. + (try_replace_reg): Rework to use simplify_replace_rtx. + (cprop_jump, cprop_cc0_jump): Likewise. + (cprop_insn): Call find_reg_equal_equiv_note. + Reflect changes to cprop_jump and cprop_cc0_jump. + + * recog.c (validate_replace_src): Replace in operands of + ZERO_EXTRACT in SET_DEST. + + * cse.c (new_label_ref): New variable. + (insert): Set it instead of recorded_label_ref. + (cse_basic_block): Set recorded_label_ref if new_label_ref use, has + CODE_LABEL for this function, and not already in REG_LABEL note. + +2001-02-16 Jeffrey Oldham + + * resource.c (mark_referenced_resources): Fix typo in introductory + comment. + * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Fix typo in + string constant. + +2001-02-16 Jason Merrill + + * dwarf2out.c (add_bound_info): Don't crash if SAVE_EXPR_RTL is + NULL. + (gen_subprogram_die): Don't abort on seeing a second definition if + the previous one was abstract. Don't replace an abstract instance + in the lookup table. + + * dwarf2out.c (dwarf2out_abstract_function): Rename from + gen_abstract_function. + * dwarf2out.h: Declare it. + * toplev.c (note_outlining_of_inline_function): New fn. + * toplev.h: Declare it. + * integrate.c (output_inline_function): Call it. + * c-decl.c (duplicate_decls): Call it when redefining an extern + inline. Don't inline the new defn. + + * tree.h (BLOCK_CHAIN): Use BLOCK_CHECK. + +2001-02-16 Gerald Pfeifer + + * .gdbinit: Rename to gdbinit.in. + * gdbinit.in: New file, + * configure.in: Generate .gdbinit from gdbinit.in. + * configure: Regenerated. + * Makefile.in (distclean): Always remove .gdbinit. + +2001-02-16 Jakub Jelinek + + * objc/objc-act.c (start_class): Register implemented_classes with + GC. + +2001-02-16 Neil Booth + + * cppfiles.c (_cpp_make_system_header): Generate a file + change callback. + +2001-02-15 Jim Meyering + + * Makefile.in (install-common): Don't depend on installdirs here. + Instead, make each of the lang.install-common targets (e.g., + c++.install-common in cp/Make-lang.in) depend on it. + (install-driver): Depend on installdirs. + +Thu Feb 15 21:30:26 2001 Richard Kenner + + * flow.c (tidy_fallthru_edge): Never end block on line number NOTE. + + * function.c (assign_parms): Set RTX_UNCHANGING_P in pseudo when we + do in memory. + +2001-02-15 Mark Mitchell + + * invoke.texi (--param): Document. + +Thu Feb 15 15:16:38 2001 Alexandre Oliva + + * config/sh/sh.h (BOOL_TYPE_SIZE): Don't define. + +Thu Feb 15 10:52:31 CET 2001 Jan Hubicka + + * i386.md (extendsfdf2_2): Fix constraints. + +Thu Feb 15 09:46:21 CET 2001 Jan Hubicka + + * i386.md (fop_df_3 splitter): Fix operand number. + +Wed Feb 14 12:37:37 CET 2001 Jan Hubicka + + * invoke.texi (-mreg-alloc): Nuke. + * i386.c (ix86_reg_alloc_order, regs_allocated, + order_regs_for_local_alloc): Nuke. + (override_options): Kill reg_alloc code. + * i386.h (TARGET_OPTIONS): Kill reg-alloc. + (REG_ALLOC_ORDER): SSE goes before I387. + (ORDER_REGS_FOR_LOCAL_ALLOC): Kill. + (ix86_reg_alloc_order): Likewise. + * i386-protos.h (ix86_reg_alloc_order): Kill. + +2001-02-14 Richard Henderson + + * toplev.c (f_options): Clarify -fschedule-insns2 documentation. + +Wed Feb 14 11:59:58 CET 2001 Jan Hubicka + + * i386.h (RETURN_IN_MEMORY): Fix formating; reject TFmodes + +Wed Feb 14 11:12:38 CET 2001 Jan Hubicka + + * i386-protos.h (ix86_memory_move_cost): Move offline. + * i386.c (ix86_register_move_cost): Compute properly cost of + SSE, MMX and i387 instructions. + (*_cost): Add costs of SSE/MMX moves. + (ix86_memory_move_cost): Move offline from ....; Likewise. + * i386.h (MEMORY_MOVE_COST): .... here; + (struct processor costs): Add new fields to represent costs + of SSE/MMX moves. + +Wed Feb 14 10:08:26 CET 2001 Jan Hubicka + + * regclass.c (init_reg_sets_1): Reinstall the optimization of + move_cost together with Matt Kraai's fix. + +2001-02-14 Jeffrey Oldham + + * Makefile.in (OBJS): Add params.o. + +2001-02-14 Richard Henderson + DJ Delorie + + * jump.c (jump_optimize_1): When we delete a conditional jump + preceding a non-conditional jump to effectively the same place, + make sure that the combined jump skips any clobber insns between + the two labels. + +2001-02-14 Jeffrey Oldham + + * gcc.c (do_spec_1): Fix off-by-one error for '%M' case. + +2001-02-14 Mark Mitchell + + * Makefile.in (toplev.o): Depend on params.h. + (intergate.o): Likewise. + (params.o): New target. + * flags.h (inline_max_insns): Remove. + * integrate.c: Include params.h. + Use MAX_INLINE_INSNS instead of inline_max_insns. + * params.c: New file. + * params.h: Likewise. + * params.def: Likewise. + * toplev.c: Include params.h. + (lang_independent_params): New variable. + (decode_f_option): Use the param machinery instead of setting + max_inline_insns. + (independent_decode_option): Handle "--param name=value". + (main): Register language-independent parameters. + +Wed Feb 14 11:13:45 CET 2001 Jan Hubicka + + * i386.md (pushsf, pushdf_nointeger): Fix constraint. + +2001-02-14 Richard Henderson + + * regclass.c (init_reg_sets_1): Revert last two changes. + +2001-02-14 Jakub Jelinek + + * stor-layout.c (is_pending_size, put_pending_size): New functions. + (variable_size): Call put_pending_size. + * tree.h (is_pending_size, put_pending_size): Add prototypes. + * fold-const.c (extract_muldiv): If SAVE_EXPR is on the pending + sizes list, put newly created SAVE_EXPR there as well. + +2001-02-14 Jakub Jelinek + + * config/ia64/ia64.c (last_group): Only 2 entries are needed. + (errata_find_address_regs): load_group has only 2 entries. + (errata_emit_nops): Likewise. shladd is not problematic. + Clear last_group if nop was emitted. + (fixup_errata): load_group has only 2 entries. + Optimize. + +2001-02-14 Neil Booth + + * c-lex.c (lex_number): Only warn traditionally for U suffix + outside system macros. + * cppexp.c (parse_number): Similarly. + * cpplib.h (NODE_SYSHDR, cpp_sys_objmacro_p): New. + * cppmacro.c (struct cpp_macro): New member node. + (parse_args): Only warn about missing rest args if not + a system macro. + (funlike_invocation_p): Similarly for uninvoked funlike macros. + (cpp_sys_objmacro_p): New. + (_cpp_create_definition): Store the node with the macro defn. + Remember if the macro is defined in a system header. + +2001-02-13 DJ Delorie + + * configure.in (check_languages): determine languages to check + * Makefile.in (check-c++): alias for check-g++ + (check-f77): alias for check-g77 + (CHECK_TARGETS): depend on configured languages + +Wed Feb 14 01:13:59 CET 2001 Jan Hubicka + + * i386.md (fixsfsi2, fixdfdi2): Fix previous patch again. + (sqrtsf2): Use TARGET_SSE instead of TARGET_SSE2) + (sqrtsf2 patterns): Use 'x' instead of 'Y'. + (sqrtextendsfdf2): Disable for SSE2. + +Wed Feb 14 00:19:28 CET 2001 Jan Hubicka + + * i386.md (fixsfsi2, fixdfdi2): Fix previous patch again. + (sqrtsf2): Use TARGET_SSE instead of TARGET_SSE2) + (sqrtsf2 patterns): Use 'x' instead of 'Y'. + (sqrtextendsfdf2): Disable for SSE2. + +Wed Feb 14 00:11:20 CET 2001 Jan Hubicka + + * i386.md (movsfcc_1): Support integer cmove instruction. + (movdfcc_1): Likewise; new splitter. + +Tue Feb 13 23:19:27 CET 2001 Jan Hubicka + + * i386.c (output_fp_compare): Support SSE. + (prepare_fp_compare_args): SSE comparisons always support memory. + * i386.h (TARGET_CMOVE): SSE imply cmove. + * i386.md (cmp?f2): Enable for SSE too. + (cmpfp_i*): Support SSE. + (cmpfp_i_sse): New. + (cmpfp_i_sse_only): New. + (s*, b* fp expanters): Enable for SSE too. + (fp_jcc_1_sse, fp_jcc_1_sse_only, fp_jcc_2_sse, fp_jcc_2_sse_only): + New patterns. + +Tue Feb 13 23:05:42 CET 2001 Jan Hubicka + + * regclass.c (init_reg_sets_1): Silence warning. + +Tue Feb 13 22:03:07 CET 2001 Jan Hubicka + + * i386.md (sqrt?f2): Change to expander. + (sqrt?f2_1, sqrt?f2_sse_only, sqrt?f2_i387): New. + +Tue Feb 13 15:42:05 2001 Richard Kenner + + * rtlanal.c (find_reg_equal_equiv_note): New function. + * simplify-rtx.c (simplify_gen_unary, simplify_gen_ternary): New fns. + (simplify_gen_relational, simplify_replace_rtx): Likewise. + * rtl.h: Add declarations for above functions. + +Tue Feb 13 21:09:11 CET 2001 Jan Hubicka + + * cse.c (cse_main): Converts ifdefs on PIC_OFFSET_TABLE_REGNUM to + conditionals. + * defaults.h (PIC_OFFSET_TABLE_REGNUM): Default to INVALID_REGNUM. + * emit-rtl.c (init_emit_once): Convert ifdefs to conditionals. + * flow.c (mark_regs_live_at_end): Likewise. + (calculate_global_regs_live): Likewise. + * gcse.c (compute_hash_table): Likewise. + (compute_kill_rd): Likewise. + * resource.c (mark_target_live_regs): Likewise. + * rtl.h (INVALID_REGNUM): New macro. + +Tue Feb 13 20:59:22 CET 2001 Jan Hubicka + + * i386.md (fixsfsi2, fixdfdi2): Fix previous patch. + +Tue Feb 13 16:32:20 CET 2001 Jan Hubicka + + * i386.md (fixsfsi2, fixdfdi2): Force operand to register + for SSE. + +Tue Feb 13 14:53:16 CET 2001 Jan Hubicka + + * i386.md (add?f3, sub?f3, mul?f3, dif?f3): Enable for TARGET_SSE(2) + too. + (fop_sf_comm, fop_df_comm, fop_sf_1, fop_df_1): Support SSE. + (fop_sf_comm_sse, fop_df_comm_sse): New patterns. + (fop_sf_1_sse, fop_df_1_sse): New patterns + (fop_*): Disable float_extend and float patterns for SSE compilation. + * i386.c (output_387_binary_op): Support SSE. + +Tue Feb 13 14:16:34 CET 2001 Jan Hubicka + + * i386.md (dummy_extendsfdf2): Support SSE2 + (extendsfdf2): Enable if 80387 or SSE2. + (extendsfdf2_1): Support SSE2. Disable if SSE2 is avialble + and no MIX_I387_SSE2 + (extendsfdf2_1_sse_only): New pattern. + (truncdfsf2): Enable if SSE2 or 80387; Always use SSE only version + of SSE. + (truncdfsf2_1): Support SSE. + (truncdfsf2_2): Support SSE. + (truncdfsf2_2_1_sse): New pattern. + (fixtruncsfsi2): Always use SSE if available. + (fix_truncsfsi_sse): New pattern. + (fix_truncdfsi_sse): New pattern. + (floatsis?f2): Support SSE. + (floatsidf2_i387): New pattern. + (floatsidf2_sse): Likewise. + +Tue Feb 13 07:52:04 2001 Richard Kenner + + * configure.in: Use "have_gnat" variable, not "gnat". + * configure: Regenerated. + + * config/sparc/sparc.c (function_value): Treat all non-record + aggregate types like used to treat UNION_TYPE. + +Tue Feb 13 13:31:33 CET 2001 Jan Hubicka + + * i386.c (print_reg): Use ANY_FP_REG instead of FP_REG + * i386.h (MASK_128BIT_LONG_DOUBLE): Renumber + (MASK_SSE2): New. + (MASK_MIX_SSE_I387): New. + (TARGET_SSE): SSE2 imply SSE. + (TARGET_SSE2, TARGET_MIX_SSE_I387): New. + (TARGET_SWITCHES): Add "sse2", "mix-sse-i387". + (enum reg_class): Add new classes. + (REG_CLASS_NAMES): Likewise. + (REG_CLASS_CONTENTS): Likewise. + (ANY_FP_REG_P, ANY_FP_REGNO_P, SSE_REG_P, SSE_FLOAT_MODE): New macros. + (REG_CLASS_FROM_LETTER): 'x' and 'y' is SSE_REGS only when SSE is + supported. Add 'Y' to be SSE_REGS when SSE2 is supported. + (CLASS_MAX_NREGS): Use new macros. + (REGISTER_MOVE_COST): Rewrite using SECONDARY_MEMORY_MAYBE_NEEDED. + * i386.md (pushsf, movsf): Support SSE. + (pushdf_nointeger, pushdf_integer, pushdf): Support SSE, update + splitters to use ANY_FP_REGNO_P. + (movdf_nointeger, movdf_integer): Likewise. + +2001-02-13 Alexandre Oliva + + * combine.c (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD): New macro. + (try_combine): Use it. + +Tue Feb 13 11:37:06 CET 2001 Jan Hubicka + + * i386.h (SSE_CLASS_P, MMX_CLASS_P, MAYBE_FLOAT_CLASS_P, + MAYBE_SSE_CLASS_P, MAYBE_MMX_CLASS_P): New macros. + (PREFERRED_RELOAD_CLASS, SECONDARY_MEMORY_NEEDED): Move offline. + (REGISTER_MOVE_COST): Likewise. + * i386-protos.h (ix86_secondary_memory_needed, + ix86_preferred_reload_class, ix86_register_move_cost): Declare. + * i386.c (ix86_secondary_memory_needed, + ix86_preferred_reload_class, ix86_register_move_cost): New function. + +Die Feb 13 11:04:25 CET 2001 Jan Hubicka + + * i386.h (VALID_FP_MODE_P, VALID_INT_MODE_P): New. + (HARD_REGNO_MODE_OK): Move offline to .... + * i386.c (ix86_hard_regno_mode_ok) ... here; + refuse all incorrect modes. + * i386-protos.h (ix86_hard_regno_mode_ok): Declare. + +2001-02-13 Richard Henderson + + * sparc.md (cmp_cc_arith_op_set): Don't use match_dup on the + entire operator; replicate that and match_dup the operands. + (cmp_ccx_arith_op_set): Likewise. + (cmp_cc_arith_op_not_set): Likewise. + (cmp_ccx_arith_op_not_set): Likewise. + +2001-02-13 Alexandre Oliva + + * explow.c (trunc_int_for_mode): Sign-extend value to mode. + +2001-02-12 Geoffrey Keating + + * config/rs6000/sysv4.h (MASK_NO_BITFIELD_WORD): New macro. + (TARGET_NO_BITFIELD_WORD): New macro. + (SUBTARGET_SWITCHES): Add -mbit-word, -mno-bit-word options. + (BITFIELD_NBYTES_LIMITED): Define based on TARGET_NO_BITFIELD_WORD. + +Mon Feb 12 18:13:26 2001 Richard Kenner + + * cselib.c: New file, from simplify-rtx.c. + * simplify-rtx.c: Remove cselib parts. + * Makefile.in: Add cselib.o. + +2001-02-12 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_float_const): Remove warning. + (setup_incoming_varargs): Remove warning. + + * config/rs6000/rs6000.c (validate_condition_mode): When + flag_fast_math, allow floating-point conditionals to be reversed. + (rs6000_generate_compare): When flag_fast_math, don't generate + cror operations for FP conditionals. + + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Handle + -mcall-i960. + (ASM_SPEC): Likewise. + (CC1_ENDIAN_LITTLE_SPEC): Likewise. + (CC1_SPEC): Likewise. + (LINK_TARGET_SPEC): Likewise. + (CPP_ENDIAN_SPEC): Likewise. + * Makefile.in (check-consistency): New target. + +2001-02-12 Joseph S. Myers + + * c-decl.c (grokdeclarator): In C99 mode, give the more specific + "return type defaults" warning for functions with return type + defaulting to int. + * c-lang.c (c_init): In C99 mode, enable warnings for implicit + function declarations by default rather than only when pedantic. + +Mon Feb 12 17:28:48 CET 2001 Jan Hubicka + + * regclass.c (init_reg_sets_1): Optimize calculation of move_cost + arrays. + +2001-02-12 Nathan Sidwell + + * extend.texi (Deprecated): Deprecate new initializer lists. + +2001-02-12 Nathan Sidwell + + * mkdeps.c (deps_add_default_target): Robustify. Add + basename component only. + * cpp.texi (-M): Describe how default target is generated. + * invoke.texi (-M): Likewise. + +2001-02-12 Kazu Hirata + + * toplev.c (push_float_handler): Remove. + (pop_float_handler): Remove. + * toplev.h: Remove prototypes for the above functions. + +2001-02-12 Jakub Jelinek + + * c-common.c (constant_fits_type_p): New function. + (convert_and_check): Use it. + +2001-02-11 Mark Mitchell + + * Makefile.in (GXX_ABI_FLAG): Don't define. + * configure.in (--enable-new-gxx-abi): Remove option. + * config.in: Regenerated. + * configure: Likewise. + +2001-02-12 Alexandre Oliva + + * lcm.c (compute_earliest): Let EXIT_BLOCK be handled as a regular + basic block. + (optimize_mode_switching) [NORMAL_MODE]: Set up EXIT_BLOCK as a + regular basic block, and arrange for all edges into it to switch + to normal mode. + +2001-02-11 Gerald Pfeifer + + * Makefile.in (distclean): Do not remove .gdbinit. + +2001-02-11 Mark Mitchell + + * Makefile.in (gcc.o): Fix typos. + (protize.o): Likewise. + (unprotoize.o): Likewise. + +2001-02-11 Richard Henderson + + * tree.c (build1): Check for null operand in last change. + +2001-02-11 Richard Henderson + + * fold-const.c (split_tree): Don't assume a constant isn't splittable. + (fold): Don't assume a constant isn't foldable. + * tree.c (build): Set TREE_CONSTANT for an expression with no + side-effects and constant operands. + (build1): Likewise. + +2001-02-10 Richard Henderson + + * jump.c (squeeze_notes): Revert 2000-05-12 change. + +2001-02-10 Anthony Green + + * cpp.texi (Standard Predefined): Add documentation for + __OPTIMIZE_SIZE__. + + * c-common.c (combine_strings): Improve warning message. + +2001-02-10 Geoffrey Keating + + * config/rs6000/sysv4.h (LINK_TARGET_SPEC): Use two dashes for + --oformat. + * config/rs6000/sysv4le.h (LINK_TARGET_SPEC): Likewise. + +Fri Feb 9 15:05:27 2001 Christopher Faylor + + * config/i386/t-cygwin (T_CPPFLAGS): Use correct location for + CYGWIN_CROSS_DIR. + +2001-02-09 Alexandre Oliva + + * config/sh/sh.md (sibcalli, sibcalli_pcrel, sibcalli): Set + fp_mode attribute. + +2001-02-09 Nick Clifton + + * config/arm/arm.md: Change output contraint on post inc + load/store multiple patterns to be a read/write contraint. + +2001-02-09 Neil Booth + + * gcc.c (cpp_options): Delete .d files on error. Don't delete + .o files when using the -M options. + +2001-02-08 Franz Sirl + David Edelsohn + + * config/rs6000/rs6000.c (output_toc): Allow 32-bit targets to + handle DImode constants. Use one TOC entry for SImode and smaller + constants, aligned properly. + +2001-02-08 Jason Merrill + + * config/arm/arm.c (arm_expand_prologue): Do tell the dwarf2 backend + about the SP adjustment for saving the static chain pointer. + * dwarf2out.c (dwarf2out_frame_debug_expr): Use the specified + offset when setting a temporary CFA register. + +2001-02-08 Chandrakala Chavva + + * config.gcc : New targets, i386-*-chorusos*, sparc-*-chorusos*, + powerpc-*-chorusos* . + * config/rs6000/chorus.h : New file. + * config/i386/chorus.h : New file. + * config/sparc/chorus.h : New file. + * config/sparc/t-chorus-elf : New file. + +2001-02-08 David Edelsohn + + * config/rs6000/rs6000.h (ASM_OUTPUT_SYMBOL_REF): Move from here ... + * config/rs6000/aix.h (ASM_OUTPUT_SYMBOL_REF): ... to here. + * config/rs6000/aix51.h (CPLUSCPLUS_CPP_SPEC): Define it. + (__WCHAR_TYPE__): Correct macro name. + +2001-02-08 Richard Henderson + + * config/i386/i386.c (ix86_frame_pointer_required): New. + (ix86_setup_frame_addresses): New. + (struct machine_function): Add accesses_prev_frame. + * config/i386/i386.h (FRAME_POINTER_REQUIRED): Call + ix86_frame_pointer_required. + (SUBTARGET_FRAME_POINTER_REQUIRED): New. + (SETUP_FRAME_ADDRESSES): New. + * config/i386/i386-protos.h: Update. + * config/i386/sco5.h (SUBTARGET_FRAME_POINTER_REQUIRED): Rename + from FRAME_POINTER_REQUIRED. + * config/i386/svr3gas.h: Likewise. + * config/i386/sysv3.h: Likewise. + * config/i386/v3gas.h: Likewise. + +2001-02-08 Richard Henderson + + * config/sparc/sparc.c (function_arg_record_value_3): Fix + calculation of the number of integer registers required. + (function_arg_record_value): Likewise. + +2001-02-08 Jason Merrill + + * diagnostic.c (internal_error): Say "confused" after 1 error, not + two. Print file and line with "confused" message. + + * dwarf2out.c (dwarf2out_line): Include filename in -dA output. + +Thu Feb 8 11:21:28 2001 Richard Kenner + + * rtlanal.c (remove_node_from_expr_list): Correctly update PREV. + +2001-02-08 Bernd Schmidt + + * final.c (cleanup_subreg_operands): The address of a MEM can + contain SUBREGs. + + * config/ia64/ia64.c (ia64_variable_issue): Call group_barrier_needed_p + for asms, too. + +2001-02-08 Joseph S. Myers + + * gcc.texi (Incompatibilities): Update documentation of + preprocessing numbers. + +2001-02-07 Jakub Jelinek + + * c-decl.c (finish_enum): Revert part of 2000-01-05 change. + +2001-02-07 Mark Mitchell + + * config/rs6000/aix43.h (CPLUSCPLUS_CPP_SPEC): Define it. + + * defaults.h (CPLUSPLUS_CPP_SPEC): New macro. + * gcc.c (struct compiler): Add cpp_spec field. + (input_file_compiler): New variable. + (do_spec_1): Allow a particular compiler to handle `%C' + specially. + (main): Store the current compiler in input_file_compiler. + * tm.texi (CPLUSPLUS_CPP_SPEC): Document. + +2001-02-07 Zack Weinberg + + * cpphash.h (struct spec_nodes): Add n_true and n_false. + * cppinit.c (cpp_create_reader): Initialize them. + (append_include_chain): cxx_aware arg might be unused. + * cppexp.c (lex): In C++ mode, recognize 'true' and 'false' + keywords and give them their phase 7 meaning. Pedwarn about + this unless '__bool_true_false_are_defined' is defined. + +2001-02-07 Alexandre Oliva + + * lcm.c (optimize_mode_switching): Emit mode_set before the + JUMP_INSN of an abnormal edge. + +2001-02-07 Bernd Schmidt + + * builtins.c (expand_builtin_setjmp_receiver): Emit an ASM_INPUT as + a scheduling barrier at the end. + + * tm.texi (MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): Document. + +2001-02-07 Alexandre Oliva + + * config/sh/sh.md (reload_outsf): Removed. + (movsf_ie): Introduce constraints for FPUL loads and stores. + (reload_insf): Broaden the output constraint. + + * config/elfos.h (INT_ASM_OP): Don't define it if it's already + defined. + * config/sh/sh.h (INT_ASM_OP, ASM_OUTPUT_CONSTRUCTOR, + ASM_OUTPUT_DESTRUCTOR): Copy definitions from config/elfos.h. + +2001-02-06 Chandrakala Chavva + + * final.c: Revert my previous changes. + * output.h: Make profile_label_no extern. + * config/rs6000/rs6000.c (output_profile_hook): Use standard functions + for generating label. + +2001-02-06 Laurynas Biveinis + + * config/i386/djgpp.h: Add comments about standard paths. + (MD_EXEC_PREFIX): Undefine before defining. + (MD_STARTFILE_PREFIX): New. + +2001-01-30 Bruce Korb + + fixinc/fixincl.c(process): Emit error message only if appropriate :) + (load_file): do not rely on load_file_data() to close file pointer + fixinc/fixlib.c(load_file_data): do not close passed in file pointer + fixinc/inclhack.def(irix_limits_const): add test_text + +2001-02-06 Neil Booth + + * cppexp.c (parse_defined): Improve diagnostics for invalid + syntax. + +2001-02-06 Neil Booth + + * cppmacro.c (cpp_get_token): Avoid pasting after a builtin. + +2001-02-06 Mark Mitchell + + * config/rs6000/rs6000.h (ASM_OUTPUT_SYMBOL_REF): Define. + * config/rs6000/rs6000-protos.h (rs6000_output_symbol_ref): Declare. + * config/rs6000/rs6000.c (VTABLE_NAME_P): New macro. + (rs6000_output_symbol_ref): New function. + (output_toc): Use VTABLE_NAME_P. + +Tue Feb 6 07:54:51 2001 Richard Kenner + + * print-tree.c (print_node, case PARM_DECL): + Print DECL_ARG_TYPE and DECL_ARG_TYPE_AS_WRITTEN. + + * stor-layout.c (reference_types_internal): New variable. + (internal_reference_types): New function. + (layout_type, case REFERENCE_TYPE): Make Pmode if internal. + * tree.h (internal_reference_types): New declaration. + + * cse.c (find_best_addr): Fix typo in computing cost. + +Mon Feb 5 21:56:16 2001 Richard Kenner + + * combine.c (nonzero_bits, case PLUS): If pointers extend unsigned + and this is the sum of a pointer and a constant, we know the result + did not overflow. + (num_sign_bit_copies, case PLUS): Likewise. + * explow.c (convert_memory_address): Remove opposite SUBREG. + * function.c (instantiate_new_reg): New function (from common code). + (instantiate_virtual_regs_1): Call it. + For PLUS, handle if (plus (subreg (virt-reg) (const_int)) + if pointers sign- or zero-extend. + * simplify-rtx.c (simplify_unary_operation, case ZERO_EXTEND): + If pointers extend unsigned, use inside of SUBREG. + (simplify_unary_operation, case SIGN_EXTEND): Likewise, if sign extend. + +2001-02-05 Benjamin Kosnik + + * Makefile.in (-DGPLUSPLUS_TOOL_INCLUDE_DIR): Change to target + subdir of gcc_gxx_include_dir. + (gcc_gxx_target_include_dir): Remove. + +2001-02-05 Jeffrey Oldham + + * dwarf2out.c: Revise DWARF2 Abbreviation Glossary comments. + (dwarf2out_frame_debug_expr): Revise introductory comments to add + a high-level description. + +2001-02-05 Chandrakala Chavva + + * final.c: Move the declaration of profile_label_no to ... + * output.h: ... here. + * function.c (expand_function_start): Call PROFILE_HOOK. + * config/rs6000/aix.h: Define PROFILE_HOOK. + * config/rs6000/rs6000-protos.h: output_profile_hook new. + * config/rs6000/rs6000.c (output_profile_hook): Define. + (output_prolog): Do nothing for ABI_AIX as it is taken care by + output_profile_hook. + tm.texi : Explain new macro PROFILE_HOOK. + +2001-02-06 Hans-Peter Nilsson + + * extend.texi (Extended Asm): Do not say that semicolon is always + a valid line-breaking character for GNU assemblers. Use + newline-tab as the most commonly supported syntax. Use + newline-tab rather than semicolon in multi-insn examples. + +2001-02-05 Franz Sirl + + * Makefile.in (gcc_gxx_target_include_dir): Use $(target_alias). + +2001-02-05 Franz Sirl + David Edelsohn + + * config/rs6000/rs6000.c (rs6000_return_addr): Use PIC + code for AIX, even without flag_pic. + +2001-02-05 Jakub Jelinek + + * c-typeck.c (common_type): push and pop binding level around + calling common_type on function parameters. + +Mon Feb 5 14:30:37 2001 Christopher Faylor + + * config/i386/cygwin.h (CPP_SPEC): Add missing space after -idirafter. + +Mon Feb 5 11:23:16 2001 Richard Kenner + + * config/mips/mips.c (override_options): Fix typo in last change. + (mips_make_temp_file): Call fatal_io_error, not pfatal_with_name. + (mips_asm_file_end): Likewise; also pass more args to fatal_io_error. + +2001-02-05 Nathan Sidwell + + * invoke.texi (-fdump-class-layout): Document. + (-fdump-translation-unit): Use `=' as filename separator. + +2001-02-05 Mark Mitchell + + * Makefile.in (s-mlib): Don't build multilibs if + --disable-multilib. + (DRIVER_DEFINES): Adjust accordingly. + (gcc.o): Likewise. + (protoize.o): Likewise. + (unprotoize.o): Likewise. + * configure.in: Recognize --enable-multilib. + +2001-02-04 Mark Mitchell + + * Makefile.in (DRIVER_DEFINES): Fix quoting. + + * Makefile.in (site.exp): Always set HAVE_LIBSTDCXX_V3. + * configure.in: Remove --enable-libstdcxx_v3 support. + * configure: Regenerated. + +Sun Feb 4 15:52:44 2001 Richard Kenner + + * config/avr/avr.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): + Call abort instead of fatal. + (TRAMPOLINE_TEMPLATE): Call internal_error instead of fatal. + * config/dsp16xx/dsp16xx.h (FUNCTION_PROFILER): Likewise. + (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): Likewise. + (TRAMPOLINE_TEMPLATE, INITIALIZE_TRAMPOLINE): Likewise. + (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Likewise. + * config/rs6000/rs6000.h (RETURN_ADDRESS_OFFSET): Likewise. + + * diagnostic.h (set_internal_error_function): Renamed. + * toplev.h (internal_error): Renamed from fatal. + (pfatal_with_name): Deleted. + (fatal_io_error): Now has printf-style arguments. + * diagnostic.c (pfatal_with_name): Deleted. + (fatal_io_error): Rework to have args in printf-style. + (set_internal_error_function): Renamed from set_fatal_function. + (internal_error): Renamed from fatal. + (error_recursion, fancy_abort): Call internal_error instead of fatal. + * dwarf2out.c (get_cfa_from_loc_descr): Likewise. + * emit-rtl.c (gen_realpart, gen_imagpart): Likewise. + * expr.c (check_max_integer_computation_mode, expand_expr): Likewise. + * flow.c (verify_flow_info): Likewise. + * config/arm/arm.c (thumb_unexpanded_epilogue): Likewise. + * config/mips/mips.c (save_restore_insns): Likewise. + + * except.c (duplicate_eh_handlers): Call abort instead of fatal. + * flow.c (verify_flow_info): Likewise. + * config/arm/arm.c (thumb_load_double_from_address): Likewise. + * config/avr/avr.c (pttreg_to_str, unique_section): Likewise. + (avr_normalize_condition): Likewise. + * config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise. + * config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise. + (limit_reload_class, double_reg_to_memory): Likewise. + (print_operand_address, emit_1600_code_shift): Likewise. + (gen_tst_reg, gen_compare_reg): Likewise. + * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise. + * config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare): + Deleted. + * config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it. + + * c-parse.in (methoddef): Call fatal_error instead of fatal. + * objc/objc-act.c (build_ivar_chain): Likewise. + * dwarfout.c (dwarfout_init): Call fatal_io_error instead of + pfatal_with_name. + * graph.c (clean_graph_dump_file): Likewise. + * profile.c (init_branch_prob): Likewise. + * objc/objc-act.c (objc_init): Likewise. + + * config/arm/arm.c (arm_override_options): Make errors non-fatal. + * config/avr/avr.c (avr_override_options): Likewise. + * config/c4x/c4x.c (c4x_expand_prologue): Likewise. + * config/dsp16xx/dsp16xx.c (function_prologue): Likewise. + * config/h8300/h8300.c (h8300_init_once): Likewise. + * config/mips/mips.c (override_options): Likewise. + * config/i386/i386.c (override_options): Likewise, rework. + * config/m68k/m68k.c (override_options): Likewise. + + * config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage + instead of fatal. + * config/mips/mips.c (print_operand): Likewise. + * hash.c (hash_allocate): Don't check for failure returns from + obstack functions that can't fail. + (hash_table_init_n, hash_table_init): Likewise; also now return void. + * hash.h (hash_table_init_n, hash_table_init): Now return void. + * objc/objc_act.c (objc_check_decl): Remove unneeded fatal call. + (get_object_reference): Likewise. + +2001-02-04 Nick Clifton + + * config/arm/arm.c (all_cores): Add 710T, 720T, 740T, 940T, 9e, + StrongARM1110, 10TDMI, and 1020T. + +2001-02-04 Kaveh R. Ghazi + + * mips.h (MULTILIB_ISA_DEFAULT): Don't use #elif. + +2001-02-04 Alexandre Oliva + + * config/sh/sh.md (movdf load split): Pass register number to + FP_OR_XD_REGISTER_P. + +2001-02-04 Mark Mitchell + + * cppinit.c (BC): New macro. + (builtin_array): Add __GXX_WEAK__. + * cpplib.h (builtin_type): Add BT_WEAK. + * cppmacro.c (builtin_macro): Handle BT_WEAK. + * defaults.h (SUPPORTS_ONE_ONLY): Define. + * varasm.c (SUPPORTS_ONE_ONLY): Do not define. + +2001-02-03 Jakub Jelinek + + * cppinit.c (append_include_chain): Honor NO_IMPLICIT_EXTERN_C. + +2001-02-03 Neil Booth + + * cpphash.h: Rename _ALIGN POOL_ALIGN. + * cpplex.c (new_chunk, _cpp_pool_reserve): Update. + +2001-02-03 Neil Booth + + * cpphash.h: Rename ALIGN _ALIGN. + * cpplex.c (new_chunk, _cpp_pool_reserve): Update. + +Fri Feb 2 23:15:29 2001 Christopher Faylor + + * config/i386/cygwin.h (CPP_SPEC): Reorganize YA to better handle cross + compilation environment. + * config/i386/t-cygwin (T_CPPFLAGS): Define CYGWIN_CROSS_DIR to allow + control over location of cygwin includes and libs. + +2001-02-03 Michael Hayes + + * md.texi (Standard Names): remove reference to spur.md. + +2001-02-03 Michael Hayes + + * c4x.c (group1_reg_operand, group1_mem_operand, arx_reg_operand, + c4x_arn_reg_operand, c4x_arn_mem_operand): Do not check register + number before reload. + (c4x_adjust_cost): Return zero before reload. + * c4x.md (load_immed_address+1, load_immed_address+2): Do not + split before reload. + +2001-02-03 Herman A.J. ten Brugge + + * c4x.c (c4x_hard_regno_rename_ok): New. + * c4x-protos.h (c4x_hard_regno_rename_ok): New. + * c4x.h (HARD_REGNO_RENAME_OK): Define. + +Fri Feb 2 20:03:50 2001 Richard Kenner + + * diagnostic.h: Add missing "extern" in all declarations. + +2001-02-02 Alex Samuel + + * Makefile.in (gcc_gxx_target_include_dir): Generate dynamically + as for gcc_gxx_include_dir. + +2001-02-02 Neil Booth + + * cpp.texi, invoke.texi: Update -Wtraditional documentation. + +2001-02-02 Alexandre Oliva + + * config/sh/sh.c (output_far_jump): Don't use braf on SH1. Emit + label before alignment to be used as the braf base address. + * config/sh/sh.md (length): Use longer lengths for SH1 PIC far + branches. + (casesi_jump_2): Require at least TARGET_SH2. + + * config/float-sh.h (LDBL_EPSILON, LDBL_MIN, LDBL_MAX): Prevent + truncation to 32-bit doubles on -m3e and -m4-single-only. + +2001-02-02 Mark Mitchell + + * gcc.c (init_gcc_specs): New function. Make -shared-libgcc + the default when building a shared object. + (init_spec): Use it. + * testsuite/lib/g++.exp: Include the directory where libgcc + is located to the LD_LIBRARY_PATH list. + * invoke.texi (-shared-libgcc): Document the cases in which + GCC defaults to using the shared libgcc. + +2001-02-02 Alexandre Oliva + + * config/fp-bit.h (MAX_USI_INT, MAX_SI_INT): Don't assume + unsigned is wide enough. + (BITS_PER_SI): New. + * config/fp-bit.c (_fpmul_parts): Don't assume 32-bits SI. + (si_to_float): Likewise. + (float_to_si, float_to_usi): Use BITS_PER_SI. + +2001-02-01 Jeffrey Oldham + + * dwarf2out.c: Added explanation of abbreviations. + (def_cfa_1): Added comments listing DWARF2 instructions. + (cfa_temp_reg): Removed in favor of cfa_temp. + (cfa_temp_value): Removed in favor of cfa_temp. + (cfa_temp): New global variable. + (dwarf2out_frame_debug_expr): Added extensive introductory + comments explaining the function's transformations. Revised to + use cfa_temp. Added some rtx checking. Generalize IOR case. + (dwarf2out_frame_debug): Revised to use cfa_temp. + (output_aranges): Cast as "unsigned" to avoid warning. + * rtl.texi (RTX_FRAME_RELATED_P): Revise entry to emphasize better + explain which instructions must be marked. + +2001-02-01 Richard Henderson + + * local-alloc.c (update_equiv_regs): Copy INSN_CODE to the + new instruction. + +2001-02-01 Alexandre Oliva + + * config/sh/crt1.asm (main_k): Modified so that start calls + ___setup_argv_and_call_main. + +2001-02-01 Neil Booth + + * cpphash.h (struct cpp_buffer): Move saved_flags from cpp_reader. + * cpplex.c (_cpp_lex_token): New token picks up the saved flags, + and AVOID_LPASTE is cleared on meeting an unescaped newline. + * cppmacro.c (builtin_macro): Set builtin flags here. + (paste_all_tokens): Preserve AVOID_LPASTE on pasted token. + (replace_args): Clarify intent. + (cpp_get_token): Macro expansion tokens get the saved flags. + Update. + * cppmain.c (scan_buffer): Remove now-redundant print.printed + check. + +2001-02-01 Jeffrey Oldham + + * config/mips/iris6.h (SUPPORTS_INIT_PRIORITY): Reverse change of + 2001-Jan-29. + +Thu Feb 1 07:22:41 2001 Richard Kenner + + * builtins.c (expand_builtin_alloca): allocate_dynamic_stack_space + returns Pmode pseudo, but we need ptr_mode. + * explow.c (allocate_dynamic_stack_space): Use plus_constant. + Remove bogus conversions; use HOST_WIDE_INT for size. + Don't use TARGET if wrong mode. + + * config/i386/i386.c (ix86_compute_frame_size): Allow + stack_alignment_needed to be non-default even if size is zero. + +2001-01-31 Alan Modra + + * pa.c (hppa_init_pic_save): New function. + * pa.h (hppa_init_pic_save): Declare. + * pa.md (call, call_value, sibcall, sibcall_value): Use + the above instead of duplicated code. + + * pa.c (hppa_encode_label): Correct size of alloca buffer + so we don't overrun it. Correct leading `*' case. + * pa.h (STRIP_NAME_ENCODING): Simplify now that we don't + need to handle `*@'. + (FUNCTION_NAME_P): Likewise. + +2001-01-31 Richard Henderson + + * config.gcc (alpha-osf5): Use float-i128.h. + + * config/float-i128.h (FLT_EVAL_METHOD, DECIMAL_DIG): Define. + * config/float-i32.h: Likewise. + * config/float-i64.h: Likewise. + * config/float-sh.h: Likewise. + * config/float-sparc.h: Likewise. + +2001-01-31 DJ Delorie + + * expmed.c (extract_bit_field): allow non-integral modes if we + want to extract a whole register from itself. + +2001-01-31 Jakub Jelinek + + * c-typeck.c (set_init_index): If first is equal to last, assume as + if it was not a range at all. + +2001-01-31 Alexandre Oliva + + * config/fp-bit.c: Include tm.h. + (float_to_si): Don't assume SImode is 32-bits wide. + (float_to_usi): Likewise. + +2001-01-31 Joseph S. Myers + + * c-parse.in (structsp): Pedwarn when "enum foo" refers to an + incomplete type. + (typename): Call pending_xref_error after parsing typed_typespecs. + * c-decl.c (lookup_tag): Give error immediately rather than + leaving it pending if the tag of the wrong type is in the same + binding level. + (xref_tag): Don't pedwarn for forward declarations of enum types + here. + * gcc.texi (Actual Bugs): Remove entry for misuse of struct, union + and enum tags. + +2001-01-31 Alexandre Oliva + + * config/float-sparc.h (LDBL_MAX) [sparc32]: Fix typo. + +2001-01-31 Neil Booth + + * cpplib.c (T_ELIF): Move to STDC89, not that it matters. + (_cpp_handle_directive): Suggest not using #elif with -Wtraditional. + +2001-01-31 Neil Booth + + * cpphash.h (struct cpp_reader): New saved_flags. + * cppmacro.c (cpp_get_token): Use saved_flags to remember + to avoid a paste after a pasted token. + +2001-01-31 Alexandre Oliva + + * libgcc2.h (Wtype_MAX, Wtype_MIN): Define. + * libgcc2.c (__fixunssfSI, __fixunsdfSI, __fixunsxfSI): Use + Wtype_MIN instead of LONG_MIN. + +2001-01-30 Jeffrey Oldham + + * fixinc/fixincl.tpl: Add 2001 to copyright. Change name of + README file. + * fixinc/fixincl.x: Regenerated. + * fixinc/inclhack.def (irix_limits_const): New definition to + convert "const" to "__const" in limits.h. + +2001-01-30 Jeffrey Oldham + + * fixinc/genfixes (AG): Fix "autogen4" thinko. + +2001-01-30 Herman A.J. ten Brugge + + * regmove.c (try_auto_increment): Change REG_DEAD into REG_UNUSED + when register dies in the insn. + +2001-01-30 Neil Booth + + * diagnostic.c (fatal): Fix word wrap. + +2001-01-30 Alexandre Oliva + + * combine.c (try_combine): Fix SUBREG setting for + HOST_BITS_PER_WIDE_INT >= 2 * BITS_PER_WORD. + +2001-01-30 Franz Sirl + + * jump.c (comparison_dominates_p): Don't try to handle UNKNOWN + comparison codes. + +2001-01-30 Neil Booth + + * c-decl.c (c_expand_body): Check TYPE_SIZE_UNIT (ret_type) + is not NULL. + * toplev.c (decode_W_option): Update warn_larger_than + unconditionally for each processed switch. + +2001-01-30 John David Anglin + + * pa.c (pa_init_machine_status): Initialize pic_offset_table_save_rtx + to NULL_RTX. + (hppa_expand_prologue): Delete code to save pic offset table register + in the function prologue. + * pa.h (PIC_OFFSET_TABLE_SAVE_RTX): Correct type in comment. + * pa.md (call, call_value, sibcall, sibcall_value): Save the pic offset + table register at the beginning of the function after the prologue. + +2001-01-29 lars brinkhoff + + * tm.texi (PUSH_ROUNDING): Remove duplicate lines. + +2001-01-29 John David Anglin + Jeff Law + + * pa.md (return): Revise comment for trivial return. + (return_internal): Non-trivial return pattern for non-PIC code. + (return_internal_pic): Non-trivial return pattern for PIC code. + It uses the PIC register to ensure it is restored after + function calls. + (epilogue): Generate appropriate return for PIC and non-PIC code. + +Mon Jan 29 23:53:14 2001 Christopher Faylor + + * config/i386/cygwin.h: Fix -mno-cygwin search path for link. + +2001-01-29 DJ Delorie + + * combine.c (if_then_else_cond): Pass the correct mode to + operand_subword() for constants. + +Mon Jan 29 20:38:19 2001 Christopher Faylor + + * config/i386/cygwin.h: Add w32api to include search. Search different + directories in a cross-build environment. + +2001-11-29 Tim Josling + + * tree.h (TYPE_STUB_DECL): Add documentation. + +2001-11-29 Laurynas Biveinis + + * sdbout.c (sdbout_one_type): Skip types with indeterminate size. + (sdbout_field_types): Likwise. Fix use of host_integerp. + +2001-01-29 Thomas Pfaff + + * mingw32.h: Override STARTFILE_SPEC and LINK_SPEC declared in + cygwin.h. + +2001-01-29 Jeffrey Oldham + + * config/mips/iris6.h (SUPPORTS_INIT_PRIORITY): Revise definition + to use flag_gnu_linker. + +2001-01-29 Neil Booth + + * cpplib.c (T_BAD_DIRECTIVE): Remove. + (_cpp_init_stacks): Loop from 0 to N_DIRECTIVES - 1. + +2001-01-29 Joseph S. Myers + + * tree.c, tree.h (build_parse_node): Remove; was identical to + build_nt. + * c-lang.c (start_cdtor), objc/objc-act.c + (build_module_descriptor): Use build_nt instead of + build_parse_node. + +2001-01-29 Jakub Jelinek + + * config/i386/i386.md (addqi_1_lea): Fix mode (QI instead of HI). + (testqi_1, andqi_2): If widening to SImode, make sure CONST_INT does + not have any upper bits set. + +2001-01-29 Phil Edwards + + * COPYING.LIB: Update to LGPL 2.1 from the FSF. + +2001-01-28 Kaveh R. Ghazi + + * stmt.c (estimate_case_costs): Use integer_minus_one_node. + + * tree.c (build_common_tree_nodes_2): Set integer_minus_one_node. + + * tree.h (tree_index): Add new element TI_INTEGER_MINUS_ONE. + (integer_minus_one_node): Define. + +2001-01-28 Alexandre Oliva + + * Makefile.in (bootstrap2-lean): Fix typo. + +2001-01-28 Neil Booth + + * cpphash.c (_cpp_cleanup_hashtable, _cpp_lookup_with_hash) + : Don't set fe_value. + * cpplib.h (AVOID_LPASTE): New flag. + (struct cpp_hashnode): Remove fe_value. + * cpplex.c (cpp_avoid_paste): Don't paste '.' with a number. + * cppmacro.c (builtin_macro): Don't set flags here. + (replace_args): Set AVOID_LPASTE flag on first token of an + argument, and the token following it. + (cpp_get_token): Set AVOID_LPASTE flag on first token of a + macro expansion, and on the token following it. Do it for + builtins too. + * cppmain.c (scan_buffer): Avoid pasting only flagged tokens. + +2001-01-27 Richard Henderson + + * config/alpha/t-ieee: Remove multilibbing. + (TARGET_LIBGCC2_CFLAGS): Add -mieee. + +2001-01-27 Kaveh R. Ghazi + + * configure.in: Arrange to include defaults.h in [ht]config.h/tm.h. + + * Makefile.in: Remove all dependencies on defaults.h. + * builtins.c: Don't include defaults.h. + * c-common.c: Likewise. + * c-decl.c: Likewise. + * c-pragma.c: Likewise. + * c-typeck.c: Likewise. + * combine.c: Likewise. + * i386.c: Likewise. + * frame-ia64.c: Likewise. + * cppexp.c: Likewise. + * crtstuff.c: Likewise. + * dbxout.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * final.c: Likewise. + * frame-dwarf2.c: Likewise. + * libgcc2.c: Likewise. + * optabs.c: Likewise. + * profile.c: Likewise. + * sdbout.c: Likewise. + * toplev.c: Likewise. + * tradcif.y: Likewise. + * tree.c: Likewise. + * varasm.c: Likewise. + +2001-01-27 Kaveh R. Ghazi + + * builtins.c (expand_builtin_fputs): Use size_one_node when + transforming into fwrite. + +2001-01-27 Joseph S. Myers + + * extend.texi (Attribute Syntax): New section. + +2001-01-27 Michael Sokolov + + * fixproto: Correctly install synthesized unistd.h and stdlib.h when + they didn't need fixing. + +2001-01-27 Janis Johnson + + * config.gcc (i[34567]86-sequent-{ptx4*,sysv4*}): Use usegas.h + if appropriate. + * config/ptx4.h: Several fixes to build on DYNIX/ptx v4.[456], and + to remove macro definitions that are duplicated from elfos.h. + +2001-01-27 Richard Henderson + + * config/i386/sco5gas.h: Move ... + * config/usegas.h: ... here. + * config.gcc (i[34567]86-*-sco3.2v5) [tm_file]: Update. + +2001-01-27 Jakub Jelinek + + * c-typeck.c (struct constructor_stack): Add range_stack member. + (really_start_incremental_init): Clear it. + (push_init_level): Save constructor_range_stack and clear it if + pushing explicit braces. + (pop_init_level): abort if constructor_range_stack is nonzero at + explicit closing brace. Restore saved constructor_range_stack if + not implicit. + +2001-01-27 Alexandre Oliva + + * expr.c (emit_move_insn): Add REG_EQUAL note when constant loaded + into register was forced into memory. + +2001-01-27 Alexandre Oliva + + * Makefile.in: Remove uses of + before $(MAKE). + +2001-01-26 Richard Henderson + + * stmt.c (cost_table): Remove. + (COST_TABLE, cost_table_initialized): New. + (estimate_case_costs): Use the later instead of the former. + (balance_case_nodes): Likewise. + +2001-01-26 Richard Henderson + + * alias.c (objects_must_conflict_p): Read-only slots may not + conflict despite having the same type. + +2001-01-27 Michael Hayes + + * loop.c (loop_giv_reduce_benefit): Copy mode size into + int variable. + (check_ext_dependant_givs): Initialize u_start_val and + u_end_val. + (load_mems): Make last_max_reg unsigned. + (try_swap_copy_prop): Use INSN_P and initialize set. + +Fri Jan 26 23:22:58 2001 Denis Chertykov + + * README.AVR : Removed. + +Fri Jan 26 11:37:26 2001 Jeffrey A Law (law@cygnus.com) + + * pa-64.h (text_section): Remove declaration. + + * pa.md (return_internal): Remove mode on PIC register use. + +2001-01-25 lars brinkhoff + + * tm.texi (DATA_ALIGNMENT, LOCAL_ALIGNMENT, ASM_OPEN_PAREN, + ASM_CLOSE_PAREN): fix typos. + +2001-01-25 Mark Mitchell + + * acconfig.h: Define `const' to the empty string if neither + __STDC__ nor __cplusplus is defined. + * config.in: Regenerated. + +2001-01-25 David Edelsohn + + * config.gcc (rs6000-ibm-aix[5-9]*): Change to aix51.h. + * collect2.c (main): Delete importf. Add ".obj" file extension. + (GCC_CHECK_HDR): Handle AIX V5 new magic number. + (aix_std_libs): Add additional AIX libraries to skip. + * config/rs6000/aix.h (MY_ISCOFF): Add AIX V5 new magic number. + * config/rs6000/aix51.h: New file. + +2001-01-25 Michael Hayes + + * loop.c (loop_call_insn_emit_before, loop_call_insn_hoist): New. + (loop_insn_emit_before): No longer static. + (move_movables): Replace emit_insn_after with loop_insn_emit_after. + (loop_givs_rescan, load_mems): Likewise. + (check_dbra_loop): Replace emit_insn_before with loop_insn_emit_before. + (maybe_eliminate_biv_1): + (move_movables): Replace emit_call_insn_before with + loop_call_insn_hoist. + * loop.h (loop_insn_emit_before): Add. + * unroll.c (copy_loop_body): Replace emit_insn_before with + loop_insn_emit_before. + +2001-01-25 Neil Booth + + * diagnostic.c (fatal): Request preprocessed source. + +Thu Jan 25 02:01:16 2001 J"orn Rennecke + + * c-decl.c (duplicate_decls): If different_binding_level is nonzero, + olddecl has argument types and newdecl has none, use the argument + types from olddecl. + +2001-01-24 Ulrich Drepper + + * dwarf2out.c (prefix_of): New function. Determine longest common + prefix of the two arguments. The units are whole path components. + (output_file_names): When adding a new directory find the one entry + with the longest common prefix already in the list. Artificially + generate entry if there is none for this prefix. + Fix test to check whether the zeroth directory entry is used. + +Wed Jan 24 23:51:55 2001 J"orn Rennecke + + * reload1.c (reload_reg_free_for_value_p): New parameter start_regno. + Changed all callers. Take it into account when deciding if a + previously loaded value matches. + +2001-01-24 Richard Henderson + + * reload.c (find_reloads_subreg_address): Fail the substitution + if the resulting address is insufficiently aligned. + +2001-01-24 DJ Delorie + + * combine.c (combine_simplify_rtx): If the modes are all VOIDmode, + check the original operand's mode also. + * simplify-rtx.c (simplify_ternary_operation): Ditto. + +2001-01-24 Joseph S. Myers + + * c-parse.in (cast_expr): Move compound literals from here ... + (primary): ... to here. Use standard terminology "compound + literal" instead of "constructor expression". + +2001-01-24 Joseph S. Myers + + * gcc.1, cpp.1: Regenerate. + +2001-01-24 Alexandre Oliva + + * calls.c (emit_library_call_value_1): Memory slot for + pass-by-reference argument should have the mode of the argument, + not of the pointer to it. + +2001-01-24 Tom Tromey + + * gcc.texi (G++ and GCC): Mention gcj manual. + (Standards): Link to section of manual mentioning gcj/Java + compatibility. + +2001-01-24 Jakub Jelinek + + * cppfiles.c (_cpp_read_file): Add to dependencies if requested. + * cppinit.c (cpp_start_read): Remove deps_add_dep call. + * tradcpp.c (main): Add -imacros or -include'd dependencies + for -M*. + * cpp.texi (-M, -MM): Document -M -include behavior. + +2001-01-24 Roger Collins + + * config/i386/xm-i386.h: Make __i386__ a boolean macro. + +2001-01-24 Will Cohen + + * config/mips/abi64.h (RETURN_IN_MEMORY): Always take into account + whether registers are 32 bits or 64 bits in size. + +2001-01-24 Ben Elliston + + * config/m32r/m32r.h (PREDICATE_CODES): Remove m32r_not_same_reg. + +2001-01-24 Richard Henderson + + * config/alpha/alpha.md (builtin_longjmp_internal): New. + (builtin_longjmp): Use it instead of emit_indirect_jump. + +2001-01-23 John David Anglin + + * bb-reorder.c (make_reorder_chain_1): Handle case where + jump edge goes to the same block as the fallthru edge. + +2001-01-23 Jim Wilson + + * dwarf2out.c (dwarf2out_line): Make last_file_num be unsigned. + * frame.h (__ia64_personality_v1): Add prototype. + * libgcc2.c (ia64_throw_helper): Change personality declaration to + prototype form. Add void * cast to first argument to personality + call. + * real.c (e113toe): Surround with INTEL_EXTENDED_IEEE_FORMAT ifdefs. + (asctoe113): Likewise. + * config/ia64/frame-ia64.c: Include eh-common.h. + * config/ia64/ia64-protos.h (sdata_section, sbbs_section): Add + prototypes. + * config/ia64/ia64.c (emit_insn_group_barriers): Add ATTRIBUTE_UNUSED + to dump parameter. + (itanium_split_issue): Add prototype. + (gen_nop_type): Ifdef out. + (find_best_packet): Initialize best_packet. + (ia64_encode_section_info): New local string. Use for ggc_alloc_string + result. + * config/ia64/ia64.h (ASM_OUTPUT_LONG_DOUBLE): Use 0L not 0. + * config/ia64/ia64.md (bsp_value): Add explicit stop bit at start. + (flushrs): Add explicit stop bit at end. + * config/ia64/lib1funcs.asm (__ia64_restore_stack_nonlocal): Change + trailing \ to >. + +2001-01-23 Chris Demetriou + + * libgcc-std.ver (GCC_3.0): Add __terminate_func_set to list + of EH symbols. + * libgcc2.c (__terminate_func): Make variable static. + (__terminate_set_func): New function to set __terminate_func. + * libgcc2.h (__terminate_func_ptr): New typedef. + (__terminate_set_func): New function. + +2001-01-23 Richard Henderson + + * flow.c (init_propagate_block_info): Don't consider unchanging + memories for dead frame store elimination. + +2001-01-23 Richard Henderson + + * varasm.c (UNIQUE_SECTION): Move default implementation ... + * defaults.h: ... here. + +2001-01-24 Michael Hayes + + * c4x.h (TARGET_LOAD_DIRECT_MEMS): Define. + +2001-01-23 Neil Booth + + * c-lex.c (lex_charconst): Fix typo: s/p/str. + +2001-01-23 Franz Sirl + + * rs6000.h (rs6000_return_addr): Move prototype from here... + * rs6000-protos.h (rs6000_return_addr): ...to here. + (rs6000_init_expanders): Delete prototype. + +2001-01-23 Nick Clifton + + * invoke.texi: Replace , with \, inside @gccoptlist macros. + (Spec Files): Document %B and %j and %. and %v3 and %M and + %{S*&T} spec switches. + +2001-01-24 Herman A.J. ten Brugge + + * c4x.c (c4x_r11_set_p): Calculate rtx code correctly. + +2001-01-23 Chris Demetriou + Neil Booth + + * cpperror.c: Merge handlers of PEDWARN and WARNING. + Have -Werror make pedantic warnings errors, like the + rest of GCC. + +2001-01-23 Phil Edwards + + * c-tree.texi (IDENTIFIER_LENGTH): Fix typo. + +2001-01-23 Jakub Jelinek + + * integrate.h (struct inline_remap): Add compare_src, compare_mode. + * integrate.c (expand_inline_function): Initialize them. + (subst_constants): If changing COMPARE so that both its arguments + will be VOIDmode and the comparison mode will be lost, note + compare_mode. Use the recorded compare_mode to optimize + IF_THEN_ELSE. + +2001-01-23 Jason Merrill + + * dwarf2out.c (new_die): Use xcalloc. + (output_die): Abort rather than emit a local reference to offset 0. + +2001-01-17 Andrew Haley + + * libgcc2.c (get_reg_addr): Don't abort if we haven't got a copy + of a saved register; return NULL instead. + (copy_reg): Take a pointer to a source register rather than a + frame_state. + (next_stack_level): Remember the address in the stack frame of all + saved registers. + Use the saved register pointer array as the source of the CFA. + (throw_helper): Rewrite. Unwind once rather than twice and keep + track of saved registers as we go. + +2001-01-23 Herman A.J. ten Brugge + + * c4x-protos.h (c4x_legitimize_reload_address): Remove. + * c4x.c (c4x_legitimize_reload_address): Remove. + * c4x.h (LEGITIMIZE_RELOAD_ADDRESS): Rewrite to generate correct + reload address for ldp(k) insn. + +Mon Jan 22 20:53:47 2001 Jeffrey A Law (law@cygnus.com) + + * pa.md (return_internal): Add a USE of the PIC register to ensure + it is restored after each call. + (return expander): Corresponding changes. + +2001-01-22 Franz Sirl + + * rs6000.h (INIT_EXPANDERS): Delete. + (RETURN_ADDR_RTX): Call rs6000_return_addr(). + * rs6000.c (rs6000_override_options): Call *_machine_status from + here... + (rs6000_init_expanders): ...instead of here. Delete. + (rs6000_mark_machine_status): New function. + (rs6000_init_machine_status): Use xcalloc. + (rs6000_return_addr): Generate RTX for the return address. + (rs6000_ra_ever_killed): New, check if LR was ever destroyed. + (rs6000_stack_info): Use it. + +2001-01-22 Thomas Pfaff + + * gthr-win32.h: Include errno.h to get a declaration for + EINVAL and _mingw.h if the target is mingw32. + +2001-01-22 Andres Felipe Vargas + + * cpp.texi: Correct typos. + +Mon Jan 22 13:59:09 2001 Richard Kenner + + * explow.c (probe_stack_range): Ensure value passed to + stack_check_libfunc is ptr_mode, not Pmode. + +Mon Jan 22 16:53:06 2001 J"orn Rennecke + + * recog.c (validate_replace_rtx_1): In ZERO_EXTEND / SIGN_EXTEND + case, don't use operand_subword to calculate a SUBREG that is + wider than a word. + + * rtl.texi: Comparisons yield 0 or STORE_FLAG_VALUE. + +2001-01-22 Herman A.J. ten Brugge + + * c4x.c (c4x_valid_rptb_p, c4x_label_ref_used_p): New functions. + (c4x_rptb_insert): Call c4x_valid_rptb_p to check if repeat block is + valid. If not replace it by equivalent insns. + +2001-01-22 Herman A.J. ten Brugge + + * c4x.c (c4x_check_legit_addr): Only check CONST. Not if CONST + contains SYMBOL_REF, LABEL_REF and CONST_INT. + (c4x_U_constraint, symbolic_address_operand): Likewise. + (c4x_immed_float_constant): Do not check if CONST_DOUBLE is in + memory. + (c4x_r11_set_p, c4x_check_laj_p): New functions. + * c4x-protos.h (c4x_check_laj_p): Add prototype. + * c4x.md (in_annul_slot_3): Do not allow auto-increment in last + anulling slot because of silicon bug. + (laj, lajv): Call c4x_check_laj_p to check for silicon bug. + +2001-01-22 Alan Modra + + * cppexp.c (parse_charconst): Change `mask' type to agree + with parse_escape. + +2001-01-21 Richard Henderson + + * config/i386/i386.c (ix86_asm_file_end): Disable putting + pic_label_name in a linkonce section. + +2001-01-17 Philipp Thomas + + * aclocal.m4 (AM_WITH_NLS): Add -lintl to LIBS if gettext was + found in libintl. + * configure: Regenerate. + +Sun Jan 21 02:38:56 2001 J"orn Rennecke + + * expmed.c (synth_mult, expand_mult_highpart, expand_divmod): Guard + uses of shift_cost, shiftadd_cost and shiftsub_cost with bound checks. + +Sun Jan 21 09:44:17 2001 Denis Chertykov + + * config/avr/avr.c (ret_cond_branch): New argument (reverse) added. + If REVERSE nonzero then condition code in X must be reversed. + (encode_section_info): Optimize if/else. + (avr_function_value): Fix formatting. + + * config/avr/avr.md (branch): Call to ret_cond_branch changed. + (difficult_branch): Likewise. + (rvbranch): Likewise. + (difficult_rvbranch): Likewise. + + * config/avr/avr-protos.h (ret_cond_branch): Prototype changed. + + * config/avr/libgcc.S: Fix comment. + +2001-01-20 Michael Sokolov + + * sdbout.c (PUT_SDB_DEF): Fix after last bogus change. + +2001-01-20 Michael Sokolov + + * cppinit.c (INO_T_EQ): Don't use #elif, fix formatting. + +2001-01-20 Michael Sokolov + + * aclocal.m4 (gcc_AC_FUNC_STRSTR): New macro. + * configure.in (gcc_AC_FUNC_STRSTR): Add invokation. + * configure, config.in: Regenerate. + * Makefile.in (STRSTR, HOST_STRSTR, USE_HOST_STRSTR): New variables. + (LIBDEPS, HOST_LIBDEPS, LIBS, HOST_LIBS): Add strstr handling. + (strstr.o, $(HOST_PREFIX_1)strstr.o): New rules. + (doprint.o): New rule. + +2001-01-20 Joseph S. Myers + + * c-typeck.c (digest_init): Handle boolean types as scalars. + +Sat Jan 20 12:46:57 2001 Richard Kenner + + * stmt.c (expand_return): Don't return anything if size is zero. + Delete redundant assignment to BYTES. + * expr.c (move_block_from_reg): Do nothing if NREGS is zero. + +2001-01-20 Marek Michalkiewicz + + * config/avr/avr.h (INIT_TARGET_OPTABS): Remove most of it, was + the same as the default library function names. + * config/avr/avr.md: Document special characters after '%'. + (mulqi3, mulhi3, mulsi3): Call libgcc.S functions ourselves, + knowing which of the call-used registers are really clobbered. + (divmodqi4, udivmodqi4, divmodhi4, udivmodhi4, divmodsi4, udivmodsi4): + New. Both quotient and remainder from one libgcc.S call. + * config/avr/libgcc.S: Optimize mul/divmod for the new insns above, + clobber as few registers as possible. + * config/avr/t-avr (LIB1ASMFUNCS): Adjust for the above changes. + +2001-01-20 Neil Booth + + * cppmacro.c (funlike_invocation_p): Don't move back up to the + context of the top of the stack. + +2001-01-20 Jakub Jelinek + + * function.c (fixup_var_refs): Move CALL_PLACEHOLDER handling... + (fixup_var_refs_insns): ...here. + +2001-01-20 Zack Weinberg + + * function.c (fixup_var_refs_insns): Break up into + fixup_var_refs_insn [body of loop], fixup_var_refs_insns + [loop over entire insn list], and fixup_var_refs_insns_with_hash + [loop over hash table entries]. + (fixup_var_refs): Adjust calls to fixup_var_refs_insns and/or + fixup_var_refs_insns_with_hash, to match above changes. + +2001-01-19 John David Anglin + + * Makefile.in (ORDINARY_FLAGS_TO_PASS): Add MAKEOVERRIDES variable. + (libgcc.a): Likewise. + (stmp-multilib): Likewise. + (STAGE2_FLAGS_TO_PASS): Likewise. + +2001-01-19 Alexandre Oliva + + * config/sh/sh.c (prepare_move_operands) [PIC]: Use operands[0] as + temporary if no_new_pseudos. + +2001-01-19 Neil Booth + + * cppinternals.texi: Update. + +2001-01-19 Richard Earnshaw + + * arm.c (arm_init_builtins): Re-enable builtins. + +Fri Jan 19 13:02:56 2001 Richard Kenner + + * rtl.texi (SET, CLOBBER): Document PARALLEL as SET_DEST possibility. + * flow.c (mark_set_1, case PARALLEL): Don't require BLKmode, allow + element to be null, and always expect an EXPR_LIST. + * rtlanal.c (reg_overlap_mentioned_p, note_stores): Likewise. + * sched-deps.c (sched_analyze_1): Likewise. + * sched-rgn.c (check_live_1, update_live_1): Likewise. + + * regclass.c (max_set_parallel): New variable. + (reg_scan): Take it into account in computation of max_parallel. + (reg_scan_mark_refs, case SET): Compute it. + + * alias.c (rtx_equal_for_memref_p, case ADDRESSOF): Don't assume + args are REG. + * expr.c (store_constructor): Don't look at MEM_ALIAS_SET unless MEM. + * function.c (assign_parms): Use INTVAL for a CONST_INT. + +2001-01-19 Jason Merrill + + * dwarf2out.c (gen_subprogram_die): Don't reuse the in-class decl + for the abstract instance of an inline function. + +Fri Jan 19 14:31:35 2001 Alexandre Oliva + J"orn Rennecke + + * reload1.c (move2add_note_store): Treat all registers directly or + indirectly derived from a base register as members of the same set + of values. + (reload_cse_move2add): Adjust accordingly. Take mode and offset + of base register into account. + +Fri Jan 19 09:18:42 2001 J"orn Rennecke + + * alias.c (find_base_value): Recognize TRUNCATE. + (record_set): In PLUS case, invalidate if other summand is also a + base value. + +Thu Jan 18 06:43:04 2001 Richard Kenner + + * flow.c (mark_set_1, case PARALLEL): New case; rework to allow + entry to be EXPR_LIST. + * rtlanal.c (reg_overlap_mentioned_p): Allow PARALLEL in SET to + be an EXPR_LIST (but not null, which other code doesn't allow). + (note_stores): Properly handle PARALLEL in SET. + Recursively call for top-level PARALLEL. + * sched-deps.c (sched_analyze_1): Handle EXPR_LIST in PARALLEL in SET. + * sched-rgn.c (check_live_1, update_live_1): Likewise. + + * config.gcc (rs6000-ibm-aix*, rs6000-bull-bosx): Add rs6000/aix.h. + +2001-01-18 Neil Booth + + * cpplib.c (_cpp_handle_directive): Use buffer->was_skipping, + not pfile->skipping (== 0). + +2001-01-17 Nick Clifton + + * config/rs6000/rs6000.c: Add prototypes for {init|free}_ + machine_status. + +2001-01-17 Jim Wilson + + * invoke.texi (IA-64 options): Improve. + +2001-01-17 Tom Tromey + + * invoke.texi (Optimize Options): Use `{}' to around @samp + argument. + +2001-01-17 Aldy Hernandez + + * invoke.texi (-fno-guess-branch-probability): New option. + +Wed Jan 17 13:26:34 2001 Richard Kenner + + * combine.c (try_combine): Don't set i3_subst_into_i2 for + case of making new double-word constant. + Revert last change: instead just test i3_subst_into_i2. + +2001-01-17 Jakub Jelinek + + * config/i386/i386.md (cmpqi_minus_1): Use {b} for QImode operation. + Use q constraints instead of r. + +Tue Jan 16 22:23:04 2001 Alan Modra (alan@linuxcare.com.au) + + * config/pa/pa.h (PIC_OFFSET_TABLE_REGNUM_SAVED): Remove. + (machine_function): Define. + (PIC_OFFSET_TABLE_SAVE_RTX) : Define. + * config/pa/pa.c (pa_init_machine_status, pa_mark_machine_status, + pa_free_machine_status): New functions. + (override_options): Set {init,mark,free}_machine_status to above. + (hppa_expand_prologue): Use PIC_OFFSET_TABLE_SAVE_RTX instead of + PIC_OFFSET_TABLE_REGNUM_SAVED. + * config/pa/pa.md: Use PIC_OFFSET_TABLE_SAVE_RTX instead of + PIC_OFFSET_TABLE_REGNUM_SAVED throughout. + * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Remove + references to PIC_OFFSET_TABLE_REGNUM_SAVED. + * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise. + +2001-01-15 DJ Delorie + + * Makefile.in (gcov.1): Protect against texi2pod/pod2man failing. + (cpp.1): Ditto. + (gcc.1): Ditto. + +Tue Jan 16 17:20:43 2001 Richard Kenner + + * flow.c (propagate_one_insn): Make trying to delete a prologue + or epilogue insn an ICE, not a warning. Allow doing this if + the current function returns with stack pointer depressed. + + * combine.c (try_combine): If i3_subst_into_i2, properly check for + I3 having more than one SET. + +2001-01-16 Jim Wilson + + * invoke.texi: Document IA-64 options. + + * config/ia64/ia64.c (ia64_print_operand_address): Delete 'B' support. + (fixup_errata): Delete TARGET_A_STEP use. + * config/ia64/ia64.h (MASK_A_STEP, TARGET_A_STEP): Delete. + (TARGET_SWITCHES): Delete -ma-step option. + * config/ia64/ia64.md (all FP patterns): Delete %B0. + (movqicc_astep, movqi_internal_astep, movhicc_astep, + movhi_internal_astep, movsicc_astep, movsi_internal_astep, movdi+1, + movdi_internal_astep, movsfcc_astep, movsf_internal_astep, + movdfcc_astep, movdf_internal_astep, movtfcc_astep, + movtf_internal_astep, cmovdi_internal_astep, cmovsi_internal_astep): + Delete. + (movqi_internal, movhi_internal, movsi_internal, movdi_internal, + movsf_internal, movdf_internal, movtf_internal, cmovdi_internal, + cmovsi_internal): Delete ! TARGET_A_STEP check. + +2001-01-16 Gerald Pfeifer + + * gcc.texi (Bug Lists): Do not mention newsgroups nor the + possibility to report bugs via postal mail. Change a URL and + merge in a nearly duplicate statement... + (Bug Reporting): ...from here. + (Service): Refer to the Bug Reporting section instead of + duplicating an URL. + (Contributing): Remove trivial explanations concerning snapshots. + +2001-01-16 Alan Modra + + * cppmain.c (general_init): Don't use ANSI prototype. + +2001-01-16 Tom Tromey + + * gcc.c (cpp_options): Added `*' to specs for -MF, -MQ, and -MT. + +2001-01-16 Richard Henderson + + * config/i386/i386.h: Fix comment typo. + * config/i386/i386.md (shift+compare pattern names): s/cmpno/cmp/ + (ashr+compare patterns): Match CCGOCmode not CCNOmode. + +2001-01-16 Phil Edwards + + * gcc.c: Revert previous -fsyntax-only-related change; move + to cp/g++spec.c. + +2001-01-16 Jakub Jelinek + + * config/i386/i386.c (fcmov_comparison_operator): Only initialize + inmode after checking GET_CODE (op). + +2001-01-16 Richard Henderson + + * flow.c (struct propagate_block_info): Add mem_set_list_len. + (MAX_MEM_SET_LIST_LEN): New. + (propagate_one_insn): Update mem_set_list_len. + (invalidate_mems_from_autoinc): Likewise. + (invalidate_mems_from_set): Likewise. + (mark_used_regs): Likewise. + (init_propagate_block_info): Likewise. Stop collecting memories + when we reach MAX_MEM_SET_LIST_LEN. + (mark_set_1): Likewise. + +2001-01-16 Richard Henderson + + * unroll.c (precondition_loop_p): Fail if no iteration + variable found. + +2001-01-16 Phil Edwards + + * gcc.c: When -fsyntax-only is given, do not complain about + unused libraries. + +2001-01-15 Richard Henderson + + * config/i386/i386.c (asm_output_function_prefix): Remove. + (ix86_asm_file_end): New. + (load_pic_register): Generate pic_label_name into a + statically allocated buffer. + * config/i386/i386-protos.h: Update. + * config/i386/i386.h (ASM_OUTPUT_FUNCTION_PREFIX): Remove. + (ASM_FILE_END): New. + * config/i386/i386afe.h: New file. + * config.gcc (i?86-*-elf) [tm_file]: Use it. + (i?86-*-{freebsd,linux*,moss*}): Likewise. + * config/elfos.h (ASM_FILE_END): Undef before redefinition. + * config/i386/cygwin.h (ASM_FILE_END): Likewise. + * config/i386/osfrose.h (ASM_FILE_END): Invoke ix86_asm_file_end. + * config/i386/sco5.h (ASM_FILE_END): Likewise. + * config/i386/winnt.c (i386_pe_asm_file_end): Likewise. + +2001-01-15 Joseph S. Myers + + * Makefile.in (install-man): Remove explicit dependency on + $(srcdir)/gcc.1. + + * configure.in, configure: Revert previous patch requiring perl + 5.6.0. + +2001-01-12 Aldy Hernandez + + * toplev.c (flag_guess_branch_prob): New. + (f_options): Add guess-branch-probability option. + (rest_of_decl_compilation): Only estimate branch probability if + flag set. + (main): set flag_guess_branch_prob. + + * flags.h (flag_guess_branch_prob): New. + +2001-01-15 DJ Delorie + + * gcc.texi (Makefile): Add documentation for Makefile targets. + +2001-01-15 Philip Blundell + + * config/arm/arm.c (arm_finalize_pic): New arg "prologue". + (is_pic): Delete. + * config/arm/arm-protos.h (arm_finalize_pic): Update prototype. + (is_pic): Delete declaration. + * config/arm/arm.h (FINALIZE_PIC): Update call to arm_finalize_pic. + (OUTPUT_INT_ADDR_CONST): Remove special handling of PIC address. + * config/arm/arm.md (builtin_setjmp_receiver): New. + +2001-01-15 Richard Earnshaw + + * arm.c (use_return_insn): Don't try to determine the function type + until after reload has completed. + (arm_output_epilogue): Don't adjust the sp value recovered from the + stack. + (emit_multi_reg_push): Don't record dwarf information for the pc. + * arm.md (eh_epilogue): The function type may have changed, so it + needs to be recalculated. + * arm/netbsd.h (DWARF2_UNWIND_INFO): Delete. Can now use dwarf2 + unwind tables on arm/netbsd. + +2001-01-15 Richard Earnshaw + + * arm.md (cbranchsi4): Correct calculation of branch ranges. + (negated_cbranchsi4): Likewise. + +2001-01-15 Richard Earnshaw + + * config/arm/semi.h (SUBTARGET_EXTRA_SPECS): Define. + (SUBTARGET_EXTRA_ASM_SPEC): Define to empty string. + (ASM_SPEC): Call subtarget_extra_asm_spec. Don't + pass -mapcs-* options to assembler. + * config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Define. + (SUBTARGET_EXTRA_ASM_SPEC): Define to empty string. + (ASM_SPEC): Call subtarget_extra_asm_spec. + +2001-01-15 Andreas Jaeger + + * config/i386/i386.c (ix86_init_builtins): Make i size_t to remove + warnings. + (ix86_expand_builtin): Likewise. + + * gencodes.c (output_predicate_decls): Make i size_t to avoid + warning about comparison between signed and unsigned. + +2001-01-14 Geoffrey Keating + + * expr.c (do_jump): Treat VOIDmode CONST_DOUBLEs like CONST_INTs. + +2001-01-14 Ralf Baechle + + * config/mips/linux.h (SUBTARGET_CPP_SPEC): Default ABI is 32; change + SUBTARGET_CPP_SPEC appropriately. + +2001-01-12 Mark Mitchell + + * varasm.c (make_decl_rtl): Fix typo in last change. + +2001-01-14 Jeffrey Oldham + + * defaults.h (SUPPORTS_INIT_PRIORITY): New macro to indicate the + linker supports the init_priority C++ attribute. + * tm.texi (SUPPORTS_INIT_PRIORITY): Documentation for new macro. + * config/mips/iris6.h (SUPPORTS_INIT_PRIORITY): Indicate Irix + linker does not support init_priority C++ attribute. + +Sun Jan 14 22:31:30 2001 J"orn Rennecke + + * Makefile.in (libgcc1-test.o): Depends on stmp-int-hdrs. + +2001-01-14 Neil Booth + + * c-parse.in (finish_parse): Add comment about cpp_destroy. + * cp/lex.c (finish_parse): Similarly. + * cppinit.c (cpp_cleanup): Rename cpp_destroy for clarity. + Return the number of errors encountered. + * cpplib.h (cpp_cleanup): Rename cpp_destroy, return int. + * cppmain.c (main): Don't call cpp_destroy. + +2001-01-14 Joseph S. Myers + + * configure.in: Require at least perl 5.6.0 to regenerate + manpages. + * configure: Regenerate. + +2001-01-14 Richard Henderson + + * genrecog.c (DT_veclen_ge): New. + (add_to_sequence) [MATCH_PARALLEL]: Generate one. + (maybe_both_true_2): Simplify DT_veclen vs DT_veclen_ge. + (nodes_identical_1): Handle DT_veclen_ge. + (write_cond, debug_decision_2): Likewise. + +2001-01-14 Richard Earnshaw + + * arm.md (ldmsi_postinc, ldmsi, stmsi_postinc, smsi): Delete. Replace + with ... + (ldmsi_postinc[432], ldmsi[432], stmsi_postinc[432], stmsi[432]): New. + +2001-01-14 Neil Booth + + * cppmain.c (do_preprocessing): New function; most of the old + main. + (main): Call it to do most of the work. + (cb): Move from global scope to set_callbacks (). + (setup_callbacks): Get the callback pointer. + (general_init, printer_init): Clean up code and comments. + +2001-01-14 Richard Earnshaw + + * config/arm/semi.h (ASM_SPEC): Pass -k to the assembler when + compiling PIC. + +2001-01-14 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Update comments. + +Sun Jan 14 06:20:49 2001 Richard Kenner + + * ggc-page.c (alloc_annon): Call perror and correctly call exit. + (alloc_page, ggc_alloc): Add casts to remove warnings. + +2001-01-14 Geoffrey Keating + + * combine.c (simplify_comparison): Don't change `code' when + can't reverse comparison. + +2001-01-14 Richard Henderson + + * rtlanal.c (computed_jump_p_1): Rename from jmp_uses_reg_or_mem; + update all call sites. Return true for all non-label constants. + +Sun Jan 14 10:09:48 MET 2001 Jan hubicka + + * i386.c (ix86_expand_compare): Add bypass_test and second_test + parameters. + (ix86_expand_branch): Update. + (ix86_expand_setcc): Update to handle multiple test conditions. + (expand_int_movcc): Likewise. + (expand_fp_movcc): Likewise. + * i386-protos.h (ix86_expand_compare): New. + * i386.md (andqi_?_slp, orqi_?_slp): New. + (conditional trap expander): Update call to ix86_expand_compare. + +2001-01-14 Richard Henderson + + * config/vax/vax.md: Use nonimmediate_operand instead of + general_operand in destinations. + + * config/vax/vax.md (indirect_jump): Use register_operand. + + * config/vax/vax.h (RETURN_POPS_ARGS): Max at 255 arguments. + * config/vax/vax.md (call_pop): Turn into an expander. + (call_value_pop): Likewise. + (call, call_value): New. + +2001-01-14 Andreas Jaeger + + * config/i386/i386.c (ix86_split_fp_branch): Remove unused + variables. + (ix86_fp_compare_mode): Add unused attribute. + (ix86_expand_fp_movcc): Remove unused variable. + (ix86_expand_builtin): Make fcode unsigned. + + * expr.c (MOVE_BY_PIECES_P): Cast MOVE_RATIO to unsigned. + (expand_expr): Add cast to avoid signed warning. + (store_field): Likewise. + (store_constructor_field): Likewise. + (store_constructor): Likewise. + (store_expr): Likewise. + (clear_storage): Likewise. + (emit_group_store): Likewise. + (emit_group_load): Likewise. + +2001-01-13 Joseph S. Myers + + * c-common.c: Move format checking code to ... + * c-format.c: ... here. New file. Reorder some functions and + declarations. + (decl_handle_format_attribute, decl_handle_format_arg_attribute): + New functions. + * c-common.h (decl_handle_format_attribute, + decl_handle_format_arg_attribute): Declare. + * Makefile.in (C_AND_OBJC_OBJS): Add c-format.o. + (c-common.o): Adjust dependencies. + (c-format.o): New list of dependencies. + +2001-01-13 Jakub Jelinek + + * unroll.c (loop_iterations): If we cannot prove iteration variable + is set once in each iteration, punt. + +Sun Jan 14 00:23:15 2001 Denis Chertykov + + * config/avr/avr.md ("strlenhi"): Remove clobber of input address. + (*strlenhi): Remove clobber (which was buggy) of output address. + +2001-01-13 Joseph S. Myers + + * Makefile.in (generated-manpages): Add gcc.1 + ($(srcdir)/gcc.1): New target. + (maintainer-clean): Delete $(srcdir)/gcc.1. + * gcc.texi: Add macros @gccoptlist and @gol. + * invoke.texi: Include option summary in manpage. Mark up option + summary with @gccoptlist and @gol. Use @r in one place where + appropriate. + * texinfo.tex: Update to version 2000-12-11.07 from ftp.gnu.org. + * gcc.1: Generate from invoke.texi. + +2001-01-13 Richard Henderson + + * ggc-page.c (USING_MALLOC_PAGE_GROUPS): New; set if not using mmap. + (struct page_entry): Add group member. + (struct page_group): New. + (struct globals): Add page_groups member. + (alloc_anon): Only define for using mmap; remove valloc call. + (page_group_index): New. + (set_page_group_in_use): New. + (clear_page_group_in_use): New. + (alloc_page): Implement USING_MALLOC_PAGE_GROUPS. + (free_page, release_pages): Likewise. + * configure.in (with-gc): Default to ggc-page always. + +2001-01-13 Alexandre Oliva + + * reload1.c (replace_pseudos_in_call_usage): Use + reg_equiv_constant and reg_equiv_address, and don't try + regno_reg_rtx first. + +2001-01-13 Richard Henderson + + * ggc-page.c (alloc_page): Round up allocation size to one page. + Set e->order on extra pages. + +2001-01-13 Richard Henderson + + * genrecog.c (nodes_identical): Expand commentary. + (write_switch): Watch out for identical nodes. + +2001-01-13 Neil Booth + + * cppfiles.c (_cpp_fake_include): New function. + * cpphash.h (_cpp_fake_include): New. + * cpplib.c (do_line): Call _cpp_fake_include when entering + header files in preprocessed input. + * cppmain.c (cb_pragma_implementation): Remove handling. + (setup_callbacks): Don't register pragmas. + +2001-01-13 Neil Booth + + * extend.texi: Udate for CPP. + +2001-01-13 Andreas Jaeger + + * reload1.c: Add prototype for replace_pseudos_in_call_usage. + + * regmove.c: Add prototype for replace_in_call_usage. + +2001-01-13 Neil Booth + + * cpplib.h (cpp_pool, mi_state, mi_ind, struct cpp_macro, + struct cpp_chunk, struct htab, struct toklist, + struct cpp_context, CPP_STACK_MAX, struct lexer_state, + struct spec_nodes, struct cpp_reader, CPP_OPTION, CPP_BUFFER, + CPP_BUF_LINE, CPP_BUF_COL, CPP_BUF_COLUMN, U, ustrcmp, ustrncmp, + ustrlen, uxstrdup, ustrchr, ufputs): Move to cpphash.h. + (struct macro_args): Delete. + * cpphash.h: See above. + +2001-01-13 Neil Booth + + * cppmain.c (struct printer): Remove no_line_dirs. + (options, cb): New. + (main, setup_callbacks, scan_buffer, printer_init, cb_define) + : Use options rather than CPP_OPTION. + (setup_callbacks): Use cb rather than pfile->cb. + (main): No need to check for a buffer. Use cpp_errors. + (printer_init): Don't set no_line_dirs. + (maybe_print_line): Use options not no_line_dirs. + (cb_file_change): Don't call print_line if -P. + +2001-01-13 Neil Booth + + * c-lex.c (init_c_lex): Use cpp_get_callbacks to set + callbacks. + * c-parse.in (finish_parse): Use cpp_errors. + (__yylex): Use return value of cpp_pop_buffer. + * cp/lex.c (finish_parse): Use cpp_errors. + * cp/spew.c (read_token): Use return value of cpp_pop_buffer. + +Sat Jan 13 16:57:40 2001 Denis Chertykov + + * README.AVR: URLs corrected. + +Sat Jan 13 07:30:02 2001 Richard Kenner + + * c-decl.c (start_function): Don't warn if old prototype is builtin + that's not in C's namespace. + * libgcc2.c (_varargs): Update definition of __builtin_saveregs. + (_bb): Add prototype for ctime. + * config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Add missing protos. + +Sat Jan 13 09:53:32 MET 2001 Jan Hubicka + + * i386.c (ix86_fp_comparison_arithmetics_cost, + ix86_fp_comparison_fcomi_cost, ix86_fp_comparison_sahf_cost, + ix86_fp_comparison_cost): New functions. + (ix86_expand_fp_compare): Use the costs to choose best bethod; add + two new parameters SECOND_TEST and BYPASS_TEST; allow generating + two-branch sequences; make static. + (ix86_use_fcomi_compare): Do decision according to the costs. + (split_fp_branch): New. + * i386.md (compare-and-branch patterns): Use split_fp_branch. + * i386-protos.h (ix86_expand_fp_compare): Remove + (ix86_split_fp_branch): Declare. + + * i386.h (PREDICATE_CODES): Update codes from fcmov_comparison_operand + and ix86_comparison_operator. + + * i386.c (ix86_prepare_fp_compare_args): Try to rearange the comparison + to make it cheaper. + + * i386.c (put_condition_code): Output properly the unordered/ordered + compares in fp case. + (ix86_expand_fp_movcc): Use ix86_expand_compare infrastructure. + + * tm.texi (REVERSE_CONDITION): Document. + * i386.c (ix86_fp_compare_mode): Simplify; return always CCFPmode + in -ffast-math mode. + * i386.h (REVERSE_CONDITION, REVERSIBLE_CC_MODE): New macro. + +2001-01-13 Alexandre Oliva + + * config/sh/sh.c (sh_expand_epilogue): Use PR explicitly. + + * config/sh/sh.c (sh_expand_prologue): Let the second toggle_sz be + optimized away. + + * config/sh/sh.c (mova_p): Fix test for mova_const. + +2001-01-13 Neil Booth + + * fix-header.c (read_scan_file): Use cpp_get_callbacks and + cpp_get_options rather than dereferencing pfile and using + CPP_OPTION. + * scan-decls.c (scan_decls): Use return value of + cpp_pop_buffer rather than CPP_BUFFER. + +2001-01-13 Neil Booth + + * cppinit.c (cpp_handle_option): help_only is now part of the + cpp_options structure. + * cpplib.c (cpp_errors, cpp_get_options, cpp_get_callbacks, + cpp_set_callbacks): New functions. + * cpplib.h (cpp_callbacks): Break out as a named structure. + (cpp_options): Move help_only here from cpp_reader. + (CPP_FATAL_ERRORS): Update to use cpp_errors. + (cpp_errors, cpp_get_options, cpp_get_callbacks, + cpp_set_callbacks): New prototypes. + * cppmain.c (main): Update for help_only. + +2001-01-13 Joseph S. Myers + + * Makefile.in (info, maintainer-clean, install-info, uninstall): + Also build and remove and install and uninstall c-tree.info and + cppinternals.info. + ($(srcdir)/gcc.info): Add dependency on contrib.texi. + ($(srcdir)/cppinternals.info): New target. + * c-tree.texi: Change file name used when makeinfo used without -o + from ir.info to c-tree.info. Add info directory entry. + * cppinternals.texi: Add info directory entry. + * .cvsignore: Update. + +2001-01-12 Jakub Jelinek + + * c-typeck.c (store_init_value): Don't require constant initializer + elements with -pedantic -std=c99. + (digest_init): Change error about non-constant initializer elements + into pedwarn. + (constructor_range_end): Remove. + (constructor_incremental, designator_depth, + designator_errorneous): New variables. + (struct constructor_stack): Remove range_end, add incremental. + (struct constructor_range_stack, constructor_range_stack): New. + (struct initializer_stack): Add constructor_range_stack. + (finish_init): Set it. + (start_init): Likewise. require_constant_elements for non-static + trees only if not flag_isoc99. + (really_start_incremental_init): Remove constructor_range_end, add + constructor_incremental. + (pop_init_level): Likewise. + (push_init_level): Likewise. If implicit and the subobject had some + value set already, preinitialize the level with it. + Warn about missing braces only if not pushing due to designators. + (set_designator, push_range_stack): New functions. + (set_init_label): Use them. + (set_init_index): Likewise. Remove constructor_range_end. + Error if designator index is outside of array bounds. + (add_pending_init): Compare values of purpose index trees, not the + trees themselves. Allow overwriting of already initialized element. + Issue a warning if it had side-effects. + (set_nonincremental_init, set_nonincremental_init_from_string): New + functions. + (pending_init_member): Rename to... + (find_init_member): ...this function. Call set_nonincremental_init + if necessary. Compare values of purpose index trees, not the trees + themselves. Return the actual value, not just nonzero if something + is found. + (output_init_element): Remove checks for duplicates. + If field has zero size, only check the initializer for correctness. + Call set_nonincremental_init if necessary. Push RECORD/ARRAY into AVL + if constructor_incremental is zero. Change error about initializers + not computable at load time into pedwarn. + (output_pending_init_elements): Compare bit positions, not + FIELD_DECLs to take into account zero-sized fields. + (process_init_element): Use constructor_range_stack to fill all + ranges in the designator lists from current level up. + * extend.texi: Update documentation for labeled elements. + +2001-01-12 Alexandre Oliva + + * calls.c (emit_library_call_value_1): Add USEs and CLOBBERs + to function usage for arguments passed by reference. Optimize + callee-copied arguments. + * regmove.c (replace_in_call_usage): New function. + (fixup_match_1): Call it. + * cse.c (cse_insn): Canonicalize registers in function usage. + * reload1.c (replace_pseudos_in_call_usage): New function. + (reload): Call it. + + * Makefile.in: Reverted yesterday's wrong patch. Installed the + right version. + +2001-01-12 Jakub Jelinek + + * config/alpha/alpha.c (alpha_expand_block_move): GET_MODE of tmp, + not XEXP (tmp, 0). + +2001-01-12 DJ Delorie + + * Makefile.in (bootstrap): rename stages to be mnemonic. Add + restageN, unstageN, bubblestrap, quickstrap, and cleanstrap + targets. + +2001-01-12 Joseph S. Myers + + * cpp.texi, extend.texi, gcc.texi, install.texi, invoke.texi, + tm.texi: Consistently refer to ISO C instead of ANSI C. Refer to + -std options alongside references to -ansi. Update some + documentation for C99. + * cpp.1: Regenerate. + +2001-01-12 Andreas Jaeger + + * haifa-sched.c (restore_line_notes): Remove argument block B + since it's unused. + * sched-ebb.c (schedule_ebb): Change caller. + * sched-rgn.c (schedule_region): Likewise. + * sched-int.h (restore_line_notes): Adjust prototype. + + * loop.h: Remove wrong declaration of doloop_condition_get. + +2001-01-12 Phil Edwards + + * extend.texi: Move C++-extension-related node from the C section + into the C++ section. + +2001-01-12 Joseph S. Myers + + * extend.texi: Refer to an array of pointers to functions instead + of one of functions. + +Fri Jan 12 12:08:12 MET 2001 Andreas Jaeger + Jan Hubicka + + * combine.c (reversed_comparison): Fix typo in last patch. + Check X for NULL. + (combine_reversed_comparison_code): Make static to follow + prototype declaration. + +2001-01-12 Phil Edwards + + * install.texi: Remove misplaced duplicate entry. + +2001-01-11 Ulrich Drepper + + * config/float-i386.h: Define FLT_EVAL_METHOD and DECIMAL_DIG for C99. + +Thu Jan 11 17:06:30 EST 2001 John Wehle (john@feith.com) + + * final.c: (leaf_function_p): Fix typo. + +2001-01-11 Zack Weinberg + + * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE): Completely rewritten. + Now defines HAVE_MMAP_DEV_ZERO and/or HAVE_MMAP_ANON depending + which you have. + (AC_FUNC_MMAP_FILE): Don't AC_REQUIRE AC_FUNC_MMAP_ANYWHERE. + * configure.in: Set GGC to ggc-page if any of mmap_dev_zero, + mmap_anon, and valloc is available. + * ggc-page.c: Restructure ifdef logic to match new autoconf + spec. Don't throw away the test page in init_ggc. + + * configure, config.in: Regenerate. + +2001-01-12 Michael Hayes + + * loop.h (total_biv_increment): Constify iv_class pointer. + (struct induction): Replace `mem_mode' with `mem' rtx. + * unroll.c (total_biv_increment): Constify iv_class pointer. + * loop.c (loop_giv_reduce_benefit): Derive mem mode from mem rtx. + (find_mem_givs, combine_givs_p): Likewise. + (debug_ivs, debug_iv_class, loop_ivs_dump, loop_iv_class_dump): New. + +2001-01-10 Thomas Pfaff + + * gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32 + LastError. + (__gthread_getspecific): Ditto. + +Fri Jan 12 00:04:00 MET 2001 Jan Hubicka + + * i386.c (ix86_comparison_operator, fcmov_comparison_operator, + put_condition_code): Convert fp comparison codes to integer + before handling. + (ix86_expand_fp_compare): Postnote the fp comparison code conversion + to final. + + * i386.c (unsigned_comparison, no_comparison_operator): Kill. + * i386-protos.h (no_comparison_operator): Kill. + + * i386.c (ix86_expand_fp_compare): Fix ordered/unordered confussion. + + * combine.c (REVERSIBLE_CC_MODE): Remove. + (reversible_comparison_p): Remove. + (combine_reversed_comparison_code): New. + (reversed_comparison): New. + (combine_simplify_rtx): Use + combine_reversed_comparison_code/reversed_comparison instead + of reversible_comparison_p. + (simplify_if_then_else): Likewise. + (simplify_set): Likewise. + (simplify_logical): Likewise. + (if_then_else_cond): Likewise. + (known_cond): Likewise. + (simplify_comparison): Likewise. + +2001-01-11 Alan Lehotsky + + * builtins.c (std_expand_builtin_va_start): Handle varargs when + sizeof (int) is larger than sizeof(__word__). + +2001-01-11 Neil Booth + + * cppinit.c (do_includes): Fix typo. + +2001-01-11 Stephane Carrez + + * config/m68hc11/m68hc11.md (cmphi_1): Make sure reloading + in S_REGS does not occur because not all sources are possible + when a S_REGS is a destination (sometimes needs a clobber). + (movqi_const0, zero_extendhisi2, zero_extendqisi2): Likewise. + (zero_extendhidi2, extendqisi2, extendqihi2, extendhisi2): Likewise. + (anddi3, iordi3, xordi3, negqi2, one_cmplhi2, one_cmplqi2: Likewise. + (ashldi3_const32, ashldi3_const1, ashlsi3_const16): Likewise. + (ashlsi3_const1, ashlhi3_2, ashlqi3_const1, ashrhi3): Likewise. + (ashrqi3_const1, lshrdi3_const32, lshrdi3_const63): Likewise. + (lshrdi_const1, lshrsi3_const16): Likewise. + (*addhi3, lshrsi3_const1, lshrqi3_const1): Likewise. + (*movhi_68hc12, *movqi_68hc12): Likewise. + (movstrictqi): Make sure reloading in D_REGS as a destination + does not happen. + +2001-01-11 Neil Booth + + * cppspec.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. + +2001-01-11 Neil Booth + + * cppinit.c (cpp_start_read): If -fpreprocessed, ignore + -D, -U and -A, and don't initialize the builtins. + (do_includes): Error if -include or -imacros with -fpreprocessed. + * cppmain.c (cb_define, cb_undef): Unconditionally process + the callback. + * tradcpp.c (main): Fix typo. + +2000-01-11 Mark Elbrecht + + * cppfiles.c (cpp_included, find_include_file, _cpp_execute_include) + (read_name_map): Use IS_ABSOLUTE_PATH. + * tradcpp.c (get_filename): Likewise. + +2001-01-11 Stephane Carrez + + * config/m68hc11/m68hc11.md (*adcq, *subcq): Fix operand numbers. + (*ashlsi3_const16_zexthi, *ashlsi3_const1): Likewise. + (*lshrsi3_const, *lshrsi3_const1, *lshrsi3_const16): Likewise. + (*ashrsi3, *ashrsi3_const, *ashlsi3, *ashlsi3_const): Likewise. + (*ashlsi3_const1, *lshrsi3, *ashlsi3_const16): Likewise. + (cmphi_z_used): Don't use '@' for the output. + (tstqi_z_used): Likewise. + (cmpqi_z_used): Likewise. + (one_cmplsi2): Likewise. + +2001-01-11 Alexandre Oliva + + * config/sh/sh.c (barrier_align): Recognize branch around far + branch and redundant insn. + +2001-01-11 Neil Booth + + * invoke.texi: Restore documentation of the drivers' switches -MD + and -MMD. + +2001-01-11 Alexandre Oliva + + * config/sh/sh.h (LABEL_ALIGN): Use UNSPECV_ALIGN instead of 1. + + * Makefile.in (check-gcc//%, check-g++//%, check-g77//%, + check-objc//%): Support parallel testing of multilibs. + (TESTSUITEDIR): Set to testsuite by default, but override for + parallel testing. + (check-gcc, check-g++, check-g77, check-objc): Enter + $(TESTSUITEDIR). + +2001-01-11 Bernd Schmidt + + * alias.c (throughout): Use REGNO, rather than ORIGINAL_REGNO. + * sched-deps.c (deps_may_trap_p): Likewise. + * basic-block.h: Remove a comment. + * flow.c (PROP_POSTRELOAD): Remove. + (update_life_info): Don't add it to prop_flags. + (mark_set_1): Lose the code that was enabled by it. + +2001-01-11 Michael Hayes + + * flow.c (flow_call_edges_add): New. + * basic_block.h (flow_call_edges_add): New. + +2001-01-11 J"orn Rennecke + + * reload1.c (move2add_note_store): Update reg_set_luid even if + base reg remains the same. + +2001-01-10 Nick Clifton + + * config/d30v/d30v.c (d30v_init_machine_status): Initialize + machine_function structure to zero. + Add prototypes for machine_status functions. + +2001-01-10 Mark Mitchell + + * c-common.h (CTI_VOID_LIST): Remove. + (void_list_node): Likewise. + * tree.h (TI_VOID_LIST_NODE): New enumeral. + (void_list_node): New macro. + * config/arm/arm.c (arm_init_builtins): Use void_list_node. + * config/i386/i386.c (ix86_init_builtins): Likewise. + * config/ia64a/ia64.c (ia64_init_builtins): Likewise. + +2001-01-10 Neil Booth + + * Makefile.in (tradcpp0): Depend on mkdeps.h. Link mkdeps.o + * cppinit.c (cpp_start_read): Update comment, remove unneeded + if statement. + * tradcpp.c: Include mkdeps.h. + (deps, print_deps_phony_targets, deps_append, output_deps, + init_dependency_output, output_deps): New. + (deps_buffer, deps_allocated_size, deps_size, deps_column, + deps_output): Delete. + (print_deps_missing_files): Rename deps_missing_files. + (inhibit_output): Make global. + (main): Delete inhibit_output, deps_stream, deps_target. + Use mkdeps functionality in the same way as cpplib. Remove + -g3 handling. Handle -MF, -MP, -MQ, -MT. Update handling of + -M and -MM. Remove old handling of deps via deps_out, and + old reading of environment variables. + (get_filename): Update to use deps_add_dep. + +2001-01-10 Mark Mitchell + + * output.h (make_function_rtl): Remove prototype. + (make_decl_rtl): Likewise. + * varasm.c (make_function_rtl): Remove. + (make_decl_rtl): Determine top-levelness from DECL_CONTEXT, rather + than from a third parameter. + * tree.h (make_decl_rtl): Remove last parameter. + * c-decl.c (builtin_function): Remove last argument in call to + make_decl_rtl; use make_function_rtl instead of make_decl_rtl. + (start_function): Likewise. + * except.c (call_get_eh_context): Likewise. + * expr.c (emit_block_move): Likewise. + (clear_storage): Likewise. + * profile.c (output_func_start_profiler): Likewise. + * toplev.c (rest_of_decl_compilation): Likewise. + * objc/objc-act.c (create_builtin_decl): Likewise. + (synth_module_prologue): Likewise. + (generate_static_reference): Likewise. + (build_selector_reference_decl): Likewise. + (build_class_reference_decl): Likewise. + (build_objc_string_decl): Likewise. + (build_protocol_reference): Likewise. + +2001-01-10 Richard Henderson + + * hwint.h: Revert yesterday's change. + +2001-01-10 Nick Clifton + + * function.h (save_machine_status): Delete. + (restore_machine_status): Delete. + Amend comment describing {init|mark|free}_machine_status. + + * function.c (save_machine_status): Delete. + (restore_machine_status): Delete. + Amend comment describing {init|mark|free}_machine_status. + (push_function_context_to): Remove invocation of + save_machine_status. + (pop_function_context_from): Remove invocation of + restore_machine_status. + + * emit-rtl.c (init_emit_once): Amend comment describing + {init|mark|free}_machine_status. + + * tm.texi (Per-Function Data): New node. Describe the + INIT_EXPANDERS macro and the {init|mark|free}_machine_status + function pointers. + +2001-01-10 Neil Booth + + * cppinit.c (OPT_g): Remove. + (cpp_handle_option): Update for removed -g3. + (print_help): Update. + * cpplib.h (struct cpp_options): Remove debug_output. + * cppmain.c (setup_callbacks, cb_define): Update. + * gcc.c (cpp_options): Translate -g3 to -dD. + +2001-01-10 Aldy Hernandez + + * config/i960/i960.md: Change modifier to + on the zero_extract + pattern after the (rotate -2 reg) canonicalization pattern. + +2001-01-10 Richard Henderson + + * config/alpha/alpha.c (alpha_free_machine_status): New. + (override_options): Install it. + (alpha_mark_machine_status): Verify machine non-null. + * config/i386/i386.c (ix86_free_machine_status): New. + (override_options): Install it. + (ix86_init_machine_status): Use xcalloc. + (ix86_mark_machine_status): Verify machine non-null. + * config/ia64/ia64.c (ia64_free_machine_status): New. + (ia64_override_options): Install it. + (ia64_mark_machine_status): Verify machine non-null. + +Wed Jan 10 11:34:39 2001 Jeffrey A Law (law@cygnus.com) + + * function.c (instantiate_virtual_regs): Instantiate virtual + registers found in CALL_INSN_FUNCTION_USAGE. + +2001-01-10 Joseph S. Myers + + * i386.h (CPP_CPU_SPEC): Allow for -std=c* and -std=i* as + equivalent to -ansi in disabling -Di386. + +Wed Jan 10 16:38:31 MET 2001 Jan Hubicka + + * i386.c (ix86_fp_compare_code_to_integer, ix86_fp_comparison_codes): + new functions. + (ix86_expand_fp_compare): Make trivial use of new infrastructure. + +2001-01-10 Richard Earnshaw + + * arm.c (arm_init_builtins): Temporarily disable xscale builtins. + +2001-01-10 Joseph S. Myers + + * invoke.texi: Document that -fcond-mismatch isn't supported for + C++. + +2001-01-10 Joseph S. Myers + + * gcc.texi: Define macro gcctabopt. + * invoke.texi: Add manpage sections BUGS and AUTHOR. Use + @command, @env and @option in some places where appropriate. Use + @gcctabopt where appropriate. Put URLs and email addresses inside + @w. + +2001-01-10 Nathan Sidwell + + * gcc.c (cpp_options): Set MD file name from output + filename, if specified. + (suffix_subst): New static variable. + (do_spec): Clear it. + (do_spec_1, case '.'): Handle new `%.suffix' spec. + Clear it. + (give_switch): Handle suffix_subst. + +2001-01-10 Phil Edwards + + * invoke.texi: Fix another typo. + +2001-01-10 Phil Edwards + + * invoke.texi: Fix typo. + +2001-01-10 Neil Booth + + * c-lang.c (lang_hooks): Update. + (lang_decode_option): Remove. + (lang_init_options): Rename c_init_options. + * toplev.c (main): Use lang_hooks for lang_init_options + and lang_decode_option. + * toplev.h (lang_hooks): Add 2 new hooks. + * tree.h: Remove lang_init_options and lang_decode_option. + * cp/cp-tree.h (lang_decode_option): Rename cxx_decode_option. + * cp/decl2.c: Similarly. + * cp/lex.c (lang_init_options): Rename cxx_init_options. + (lang_hooks): Update. + * f/com.c (f_init, f_finish): Rename ffe_init, ffe_finish + for consistency. + (lang_init_options): Rename ffe_init_options. + (lang_hooks): Update. + (lang_decode_option): Remove. + * java/lang.c (lang_init_options): Rename java_init_options. + (lang_decode_option): Rename java_decode_option. + (lang_hooks): Update. + * objc/objc-act.c (lang_init_options): Rename objc_init_options. + (lang_decode_option): Rename objc_decode_option. + (lang_hooks): Update. + +2001-01-09 Nick Clifton + + * config/d30v/d30v.c (d30v_eh_epilogue_sp_ofs): Delete. + (d30v_return_addr_rtx): Delete. + (d30v_expand_epilogue): Use eh_epilogue_sp_ofs field in the + cfun->machine structure. + (struct machine_function): Move to d30v.h + (d30v_save_machine_status): Delete. + (d30v_restore_machine_status): Delete. + (d30v_init_machine_status): New Function. + (d30v_mark_machine_status): New Function. + (d30v_free_machine_status): New Function. + (d30v_init_expanders): Use new functions. + (d30v_return_addr): Use ra_rtx field in cfun->machine. + (d30v_add_gc_roots): Remove d30v_eh_epilogue_sp_ofs and + d30v_return_addr_rtx. + + * config/d30v/d30v.h (struct_machine): Move here. + Add eh_epilogue_sp_ofs field. + + *config/d30v/d30v.md (epilogue): Initialize eh_epilogue_sp_ofs + field in cfun->machine structure. + +Tue Jan 9 21:34:57 2001 John David Anglin + + * pa32-regs.h (CONDITIONAL_REGISTER_USAGE): When generating pic code, + PIC_OFFSET_TABLE_REGNUM_SAVED is a call_used register. + * pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Likewise. + +Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) + + * objc/lang-options.h: Remove bogus reference to + Java trademark. + +2001-01-09 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Use a struct shift_info to + return the result. + +2001-01-09 Alan Lehotsky + + * reload.c (find_reloads_address): Check for eliminable registers + when substituting a constant expression for a pseudo. + +2001-01-09 Joseph S. Myers + + * c-common.c (enum format_type): Add format_type_error. + (decode_format_type): New function. + (decl_attributes): Use it. + (format_kind_info): Adjust comment. + +2001-01-09 David O'Brien + + * config.gcc (*-*-gnu*, i[34567]86-*-elf*, i[34567]86-*-linux*libc1, + i[34567]86-*-linux*, i[34567]86-*-moss*): Specify needed platform specific + files in tm_file. + * config/i386/gnu.h: Don't include required platform specific .h files, + tm.h will do it instead. + * config/i386/i386elf.h: Likewise. + * config/i386/linux.h: Likewise. + * config/i386/moss.h: Likewise. + * config/mips/gnu.h: Likewise. + +2001-01-09 Franz Sirl + + * config.gcc (powerpc-*-beos*): Include ${tm_file} and rs6000/aix.h. + (rs6000-ibm-aix3.[01]*): Likewise. + (rs6000-ibm-aix3.2.[456789]*, powerpc-ibm-aix3.2.[456789]*): Likewise. + (rs6000-ibm-aix4.[12]*, powerpc-ibm-aix4.[12]*): Likewise. + (rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*): Likewise. + (rs6000-ibm-aix[56789].*, powerpc-ibm-aix[56789].*): Likewise. + (powerpc-*-sysv*): Include {tm_file}. svr4.h and rs6000/sysv4.h. + (powerpc-*-eabiaix*): Likewise. + (powerpc-*-eabisim*): Likewise. + (powerpc-*-elf*): Likewise. + (powerpc-*-eabi*): Likewise. + (powerpc-*-rtems*): Likewise. + (powerpc-*-linux*libc1): Likewise. + (powerpc-*-linux*): Likewise. + (powerpc-wrs-vxworks*): Likewise. + (powerpcle-wrs-vxworks*): Likewise. + (powerpcle-*-sysv*): Likewise. + (powerpcle-*-elf*): Likewise. + (powerpcle-*-eabisim*): Likewise. + (powerpcle-*-eabi*): Likewise. + (powerpcle-*-solaris2*): Likewise. + * config/rs6000/aix31.h: Delete includes. + * config/rs6000/aix3newas.h: Likewise. + * config/rs6000/aix41.h: Likewise. + * config/rs6000/aix43.h: Likewise. + * config/rs6000/beos.h: Likewise. + * config/rs6000/rtems.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + +2001-01-09 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove an argument cpu. + Change an argument mode of machine_mode to shift_mode of + shift_mode. Remove an extra error check. + (emit_a_shift): Adopt to the new calling prototype of + get_shift_alg. + (function_prologue): Fix code for a monitor + function. Support H8S. + (function_epilogue): Do not output pop for a monitor function. + +2001-01-09 Nick Clifton + + * config/rs6000/rs6000.c (rs6000_sysv_varargs_p): Delete. + (setup_incoming_varargs): Use sysv_varargs_p field of the + cfun->machine structure. + (struct machine_function): Move to rs6000.h + (rs6000_save_machine_status): Delete. + (rs6000_restore_machine_status): Delete. + (rs6000_init_machine_status): New Function. + (rs6000_free_machine_status): New Function. + (rs6000_init_expanders): Use new functions. + + * config/rs6000/rs6000.h (rs6000_sysv_varargs_p): Delete + export. + (struct machine_function): Move here. + + * config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Use + sysv_varargs_p field of the cfun->machine structure. + + * config/rs6000/rs6000-protos.h (rs6000_save_machine_status): + Remove prototype. + (rs6000_restore_machine_status): Remove prototype. + +2001-01-09 Richard Henderson + + * sched-int.h (struct deps): Add max_reg, reg_last_in_use; merge + reg_last_uses, reg_last_sets, reg_last_clobbers into struct deps_reg. + * sched-deps.c (sched_analyze_1): Update uses of struct deps. + (sched_analyze_2, sched_analyze_insn): Likewise. + (sched_analyze, init_deps): Likewise. + (free_deps): Likewise. Iterate with EXECUTE_IF_SET_IN_REG_SET. + * sched-rgn.c (propagate_deps): Likewise. Remove max_reg argument. + (compute_block_backward_dependences): Update propagate_deps call. + +2001-01-09 Mark Elbrecht + + * gcc.c (process_command): Set switches[n_switches].ordering to 0. + +2001-01-09 Neil Booth + + * cppinit.c (OPT_MD, OPT_MMD): Restore. + (cpp_handle_option): Handle them. + (cpp_post_options): Ensure one of -M or -MM is specified with + any other -M? option. + (init_dependency_output): Suppress output with -MG. + +2001-01-09 Neil Booth + + * cpp.texi: Update. + * invoke.texi: Update. + +2001-01-09 Bernd Schmidt + + * sh.md (reload_outsf): Generate recognizable patterns for + TARGET_SH3E. + +2001-01-09 Neil Booth + + * c-lang.c (lang_hooks): Update. + (lang_init): Rename c_init. + (lang_finish): Remove. + * toplev.c (compile_file): Use lang_hooks for lang_init () + and lang_finish (). + * toplev.h (lang_hooks): Add init () and finish (). + * tree.h (lang_init, lang_finish): Remove. + * cp/tree.h (lang_init, lang_finish): Remove. + * cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c. + * cp/lex.c (cxx_init, cxx_finish, cxx_post_options, + lang_hooks): New. + (lang_init, lang_finish): Remove. + * f/com.c (lang_init, lang_finish): Rename f_init, f_finish. + (lang_hooks): Update. + * java/lang.c (lang_init): Rename java_init. + (lang_finish): Remove. + (lang_hooks): Update. + * objc/objc-act.c (lang_init): Rename objc_init. + (lang_finish): Remove. + (lang_hoooks): Update. + +2001-01-09 Graham Stott + + * cppfiles.c (_cpp_execute_include): Move `len` initialisation + after `ptr` is initialized. + +2001-01-09 Alexandre Oliva + + * config/sh/sh.h (STATIC_CHAIN_REGNUM): Change from r13 to r3. + (INITIALIZE_TRAMPOLINE): Adjust accordingly. + * config/sh/sh.c (sh_expand_prologue): Use r1 as temporary for + stack adjusts, instead of r3. + +2001-01-09 Michael Hayes + + * flow.c (flow_loop_scan): Break out of ... + (flow_loops_find) ... here. + * basic-block.h (flow_loop_scan): New. + (LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES): Add. + (LOOP_EDGES, LOOP_EXITS_DOMS, LOOP_ALL): Redefine. + +2001-01-09 Alexandre Oliva + + * cppinit.c (cpp_cleanup): NULLify macro_buffer and zero + macro_buffer_len. + * cppmacro.c (cpp_macro_definition): Reset macro_buffer_len when + realloc()ing macro_buffer. + + * hwint.h (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Use long long + if it's wider than long and the target's long is wider than the + host's. + +2001-01-09 Mark Mitchell + + Remove support for using UWIN as a host machine. + * configure.in: Issue an error message. + * configure: Regenerated. + * config.gcc: Remove xm_* UWIN configury. + * config/i386/xm-uwin.h: Remove. + +2001-01-08 Nick Clifton + + * config/v850/v850.c (ra_rtx): Delete. + (v850_save_machine_status): Delete. + (v850_restore_machine_status): Delete. + (v850_init_machine_status): New function. + (v850_mark_machine_status): New function. + (v850_free_machine_status): New function. + (v850_return_addr): Use ra_rtx field in machine structure. + (v850_init_expanders): Use new functions. + + * config/v850/v850-protos.h: Fix prototypes for v850_output_* + * config/v850/v850.c: Change arguments to v850_output+* functions + to take a const char *, to avoid compile time warning. + * config/v850/v850.h (ASM_OUTPUT_LABELREF): Undefine, not needed. + (USER_LABEL_PREFIX): Redefine. + +2000-01-08 Jim Wilson + + * sched-rgn.c (BITSET_ADD, BITSET_REMOVE, bitset_member): Cast + 1 to unsigned HOST_WIDE_INT before left shift. + +2001-01-08 Nick Clifton + + * config/arm/arm.c (arm_mark_machine_status): Check to see if + the machine structure has been allocated. + (arm_free_machine_status): New function: Free the machine + specific function structure. + +2001-01-08 Richard Henderson + + * jump.c (simplejump_p): Revert last change. + +2001-01-08 Neil Booth + + * cppinit.c (init): Rename init_library. + (cpp_create_reader): Update. + * gcc.c (cpp_options): If -o given, use it as the target of + any -M options. + +2001-01-08 Richard Earnshaw + + * arm.c (arm_arch5e): New variable. + (all_cores): XScale is a 5TE device. + (arm_override_options): Set arm_arch5e. + (arm_init_builtins): __builtin_prefetch is in arch5e. + * arm.h (arm_arch5e): Declare it. + + * arm.h (PREDICATE_CODES): Add arm_hard_register_operand. + + * arm.md (define_constants): Add defines for UNSPEC and + UNSPEC_VOLATILE insns. Update all users. + (define_constants): Add constants for IP_REGNUM, SP_REGNUM, PC_REGNUM. + * arm.c (multi_register_push, note_invalid_constants) + (emit_multi_reg_push, emit_sfm, expand_prologue): Use constants. + * arm.h (SP_REGNUM, IP_REGNUM, PC_REGNUM): Delete defines. + (STACK_POINTER_REGNUM): Define in terms of SP_REGNUM. + +Mon Jan 8 16:14:56 MET 2001 Jan Hubicka + + * jump.c (jump_optimize_1): Use reversed_comparison_code + instead of can_reverse_comparison_p. + (jump_back_p): Likewise. + (invert_exp_1): Likewise. + (thread_jumps): Likewise. + * simplify-rtx.c (simplify_unary_operation): Likewise. + (simplify_ternary_operation): Likewise. + * cse.c (find_comparison_args): Convert to use + can_reverse_comparison_p. + (record_jump_equiv): Likewise. + +2001-01-08 Richard Earnshaw + + * arm.h (HARD_REGNO_RENAME_OK): Delete. + (EPILOGUE_USES): Define. + (INITIAL_ELIMINATION_OFFSET): Current prologue code does not + automatically stack the LR if it isn't live. + +Mon Jan 8 13:46:02 MET 2001 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Take care to reverse fp conditions + properly. + +Sun Jan 7 18:37:43 2001 Mark P Mitchell + + * ggc-page.c (max_alignment): New structure. + (MAX_ALIGNMENT): New macro. + (init_ggc): Use it to round up the sizes in the + extra_order_size_table. + +2001-01-07 Franz Sirl + + * config/rs6000/rs6000.h (EPILOGUE_USES): New, mark link register + after reload. + +2001-01-07 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_FPRINTF): New entry. + + * c-common.c (c_expand_builtin_fprintf): New function. + (init_function_format_info): Handle __builtin_fprintf. + (c_common_nodes_and_builtins): Declare fprintf/__builtin_fprintf. + (c_expand_builtin): Handle BUILT_IN_FPRINTF. + + * c-decl.c (duplicate_decls): Adjust comment. + + * extend.texi (fprintf): Document new builtin. + +2001-01-07 Richard Henderson + + * jump.c (simplejump_p): Recognize any single_set jump + of the proper form. + +2001-01-07 Richard Henderson + + * configure.in (slibdir): Accept an --with-slibdir option. + Use "test" not "[" in configure. Default to $(libdir). + + * config/t-linux (SHLIB_INSTALL): Double quote slibdir; + fix typo in rm -f. + * config/t-aix43 (SHLIB_INSTALL): Likewise. + * config/alpha/t-osf4 (SHLIB_INSTALL): Likewise. + (SHLIB_LINK): Create links for the soname. + * config/mips/t-iris6: Likewise. + * config/sparc/t-slibgcc: Likewise. + * config/sparc/t-slibgcc-sld: Likewise. + +2001-01-07 Jakub Jelinek + + * config/i386/i386.c (constant_call_address_operand): Accept + (const (plus (symbol_ref) (const_int))). + * config/i386/i386.h (PREDICATE_CODES): Add CONST for + constant_call_address_operand. + +2001-01-08 Michael Hayes + + * libgcc2.h (W_TYPE_SIZE): Fix case where MIN_UNITS_PER_WORD == 1 + and LONG_LONG_TYPE_SIZE > 32. + +2001-01-07 Gerald Pfeifer + + * jump.c (reversed_comparison_code_parts): Fix typo introduced by + the previous change. + +Sun Jan 7 19:37:48 MET 2001 Jan Hubicka + + * jump.c (reversed_comparison_code_parts, reversed_comparison_code): + New. + (can_reverse_comparison_p): Rewrite to use reversed_comparison_code. + (reverse_condition_maybe_unordered): Abort on unsigned comparisons. + * rtl.h (reversed_comparison_code_parts, reversed_comparison_code): + Declare. + +2001-01-07 Neil Booth + + * fix-header.c (read_scan_file): s/pfile/scan_in/. + +2001-01-07 Neil Booth + + * c-lang.c (c_post_options): Call cpp_post_options. + * objc/objc-act.c (objc_post_options): Similarly. + * cppmain.c (main): Similarly. + * fix-header.c (read_scan_file): Similarly. + * cppinit.c (cpp_start_read): Move option consistency checks + to cpp_post_options. Don't call init_dependency_output. + If needed, add default target and main file dependency. + (OPT_MD, OPT_MMD): Remove. + (OPT_MF): New. + (cpp_handle_option): Update for OPT_* changes. + (cpp_post_options): New. + (init_dependency_output): Command line -MF overrides environment + variables. Don't set default target etc. Suppress output + if dependencies are going to stdout. + (print_help): Update. + * cpplib.h (cpp_post_options): New. + * gcc.c (cpp_options): Update for -MD, -MMD, -MF. + +Sun Jan 7 14:44:19 MET 2001 Jan Hubicka + + * jump.c (comparison_dominates_p): Support unordered compares. + +Sun Jan 7 14:39:07 MET 2001 Jan Hubicka + + * simplify-rtx.c (simplify_relational_operation): Always simplify + ORDERED and UNORDERED when FLAG_FAST_MATH. Handle properly UNLE + and UNGE. + +Sun Jan 7 14:35:13 MET 2001 Jan Hubicka + + * combine.c (combine_simplify_rtx): Recognize the unordered compares. + (nonzero_bits): Likewise. + (simplify_comparison): Likewise. + (num_sign_bit_copies): Likewise; return more sane value depending + on STORE_FLAG_VALUE. + (known_cond): Do not assume EQ to be always true for equivalent + operands. + +Sun Jan 7 14:31:57 MET 2001 Jan Hubicka + + * cse.c (fold_rtx): Handle unordered comparisons. + +Sun Jan 7 13:49:19 MET 2001 Jan Hubicka + + * rtlanal.c (set_of_1): New static function. + (reg_set_last_1, reg_set_p_1, reg_set_reg, reg_set_flag, + reg_set_last_unknown, reg_set_last_value, reg_set_last_first_regno, + reg_set_last_last_regno): Remove. + (set_of): New global function. + (set_of_data): New structure. + (reg_set_p, reg_set_last): Revamp for set_of. + * rtl.h (set_of): New. + +2001-01-07 Joseph S. Myers + + * c-common.c (c_common_nodes_and_builtins): Add _Exit builtin. + * extend.texi: Document _Exit builtin. + +2001-01-07 Neil Booth + + * (initialize, initialize_builtins, + initialize_dependency_output, initialize_standard_includes): + Rename s/initialize/init. Update. + (init_dependency_output): Move to after + cpp_handle_options, the correct location temporally at least. + (opt_comp): Move next to init (), its caller. Fix prototype. + (init): Make "initialized" local scope. + (cpp_create_reader): Always call init (). + (cpp_start_read): Update. + (output_deps): New function, broken out of cpp_finish. + (cpp_finish): Break out output_deps. + +2001-01-07 Richard Henderson + + * collect2.c (COFF specific stuff): Revert 12-06 patch + to prototype system functions. + +2001-01-07 Michael Hayes + + * hard-reg-set.h: Add multiple include guard. + * basic-block.h (struct loop): Add `sink' field. + * loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h. + (emit_iv_add_mult): Delete. + (loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define. + (loop_iv_add_mult_emit_before, loop_insn_sink): Define. + (unroll_loop): Remove end_insert_before argument. + * loop.c (loop_givs_rescan): Remove end_insert_before argument. + (maybe_eliminate_biv_1): Likewise. + (emit_iv_add_mult): Delete. + (gen_add_mult, loop_regs_update): New. + (loop_insn_emit_after, loop_insn_emit_before): New. + (loop_insn_sink, loop_insn_sink_or_swim): New. + (emit_iv_add_mult): Delete. + (scan_loop): Set loop->sink. + (loop_givs_reduce): Use loop_insn_sink and its ilk. + (loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise. + (maybe_eliminate_biv_1): Likewise. + (maybe_eliminate_biv_1): Add basic block argument. + * unroll.c (unroll_loop): Remove end_insert_before argument. + (find_splittable_regs): Likewise. + (find_splittable_regs): Use loop_insn_sink and its ilk. + (find_splittable_givs, final_biv_value, final_giv_value): Likewise. + +2001-01-07 Michael Hayes + + * loop.h (loop_insn_hoist): New prototype. + * loop.c (loop_insn_hoist, loop_insn_emit_before): New. + (move_movables, loop_givs_rescan): Use loop_insn_hoist. + (check_dbra_loop, load_mems): Likewise. + * unroll.c (unroll_loop, find_splittable_regs): Likewise. + (find_splittable_givs): Likewise. + +2001-01-07 Michael Hayes + + * loop.c (emit_iv_add_mult): Use single_set to examine new insn. + +2001-01-07 Richard Henderson + + * sched-rgn.c (is_cfg_nonregular): Fix thinko's last change. + +2001-01-07 Richard Henderson + + * Makefile.in (DRIVER_DEFINES): Define ENABLE_SHARED_LIBGCC and + NO_SHARED_LIBGCC_MULTILIB as required for the target. + * gcc.c (init_spec): Massage the existing libgcc_spec into a + variant that handles a shared libgcc. + (process_command): Always validate -{static,shared}-libgcc. + (do_spec_1): New 'M' case. + * invoke.text (Link Options): Document -{static,shared}-libgcc. + +2001-01-07 Richard Henderson + + * Makefile.in (slibdir): New variable. + (libgcc.mk): Pass SHLIB_INSTALL to mklibgcc. + (installdirs): Create slibdir. + (install-libgcc, install-multilib): Defer to libgcc.mk. + * configure.in (slibdir): Substitute. + * mklibgcc.in (install): New target. + + * config/t-linux (SHLIB_LINK): Create links for the soname. + (SHLIB_INSTALL): New. + * config/alpha/t-osf4 (SHLIB_INSTALL): New. + * config/mips/t-iris6 (SHLIB_INSTALL): New. + * config/rs6000/t-aix43 (SHLIB_INSTALL): New. + * config/sparc/t-slibgcc (SHLIB_INSTALL): New. + * config/sparc/t-slibgcc-sld (SHLIB_INSTALL): New. + +2001-01-07 Richard Henderson + + * config/rs6000/aix.h (LINK_LIBGCC_SPECIAL_1): New. + * config/rs6000/rs6000.h (LIBGCC_SPEC): Remove. + * config/rs6000/sysv4.h (LIBGCC_SPEC): Remove. + +2001-01-07 Michael Hayes + + * loop.c (count_loop_regs_set): Delete. + (load_mems_and_recount_loop_regs_set): Delete. + (loop_regs_scan): Merge common code from count_loop_regs_set, + scan_loop, and load_mems_and_recount_loop_regs_set. + (scan_loop): Call load_mems directly and loop_regs_scan + again if new registers created. + +2001-01-07 Neil Booth + + * toplev.c (main): Call the front-end specific post_options + hook if one is given. + * toplev.h (struct_lang_hooks, lang_hooks): New. + * c-lang.c (c_post_options, lang_hooks): Implement lang_hooks + for the C front end. + * cp/decl2.c (cxx_post_options, lang_hooks): Implement + lang_hooks for the C++ front end. + * objc/objc-act.c (objc_post_options, lang_hooks): Implement + lang_hooks for the ObjC front end. + * f/com.c (lang_hooks): Hooks for the Fortran front end. + * java/lang.c (lang_hooks): Hooks for the Java front end. + +2001-01-07 Neil Booth + + * c-lex.c (init_c_lex): Request #define / #undef callbacks + for verbose DWARF[2] debugging. + (cb_define, cb_undef): The new callbacks. + * toplev.h (debug_define, debug_undef): Make const correct. + * toplev.c (debug_define, debug_undef): Similarly. Do not + perform the verbosity tests here anymore. + +2001-01-07 Alexandre Oliva + + * reload.c (subst_reloads): Take INSN argument. When + replacing a LABEL_REF in a JUMP_INSN, add a REG_LABEL note. + * reload.h (subst_reloads): Adjust prototype. + * reload1.c (reload_as_needed): Pass INSN to subst_reloads. + * jump.c (mark_all_labels): Canonicalize any REG_LABEL notes + present in JUMP_INSNs and copy them to JUMP_LABEL. + * flow.c (find_label_refs, find_basic_blocks_1): Skip + JUMP_INSNs and insns with REG_LABELs that are followed by + JUMP_INSNs with the same REG_LABEL. + * sched-rgn.c (is_cfg_nonregular): Likewise. + * rtlanal.c (computed_jump_p): Make it false if a REG_LABEL + note is available. + * unroll.c (unroll_loop): Look for REG_LABEL notes in + JUMP_INSNs too. + * rtl.texi (REG_LABEL): Document usage in JUMP_INSNs. + +2001-01-06 Richard Henderson + + * loop.c (scan_loop): Use xcalloc for the regs array. + (load_mems_and_recount_loop_regs_set): Zero the new memory + received from xrealloc. + +2001-01-06 Neil Booth + + * mkdeps.c (deps_add_dep): Fix vector re-allocation. + +Sat Jan 6 00:09:34 2001 J"orn Rennecke + + * integrate.c (copy_rtx_and_substitute): When copying + an ignored return value, strip REG_FUNCTION_VALUE_P. + +2001-01-06 Michael Hayes + + * loop.c (debug_biv, debug_giv): New. + (loop_biv_dump): Break out from ... + (record_biv): ... here. + (loop_giv_dump): Break out from ... + (record_giv): ... here. + (loop_bivs_check): Use print_simple_rtl. + * unroll.c (loop_iterations): Use print_simple_rtl. + +2000-01-05 John David Anglin + + * pa.md (return, return_internal): Modify patterns to prevent regrename + mucking with the return pointer. + +2001-01-05 Richard Henderson + + * dwarf2out.c (mem_loc_descriptor) [case MEM]: Revert 10-31 change. + +Fri Jan 5 16:34:18 2001 Nick Clifton + + * config/v850/lib1funcs.asm: Replace __mulsi3 routine with faster + version supplied by Matteo Frigo. + +2001-01-05 Neil Booth + + * cpp.texi: Update for -MQ. + * cppinit.c (cpp_create_reader): Always create pfile->deps. + (cpp_cleanup): Always free pfile->deps. + (initialize_dependency_output): Don't create pfile->deps. + (cpp_handle_option): Similarly. + (OPT_MQ): New. + * gcc.c (cpp_options): Handle -MQ. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. + * mkdeps.c (base_name): Remove. + (deps_init): Don't allocate vector space until it's needed. + (deps_free): Only free vectors if allocated. + (deps_add_target, deps_add_dep): Update for initial allocation. + (deps_add_default_target): Don't strip to the base_name. + +2001-01-05 DJ Delorie + + * config/v850/v850.h (RETURN_ADDR_RTX): Define. + (INIT_EXPANDERS): Define. + + * config/v850/v850.c (struct machine_function): Define. + (v850_save_machine_status): New function. + (v850_restore_machine_status): New function. + (v850_return_addr): New function. + (v850_init_expanders): New function. + + * config/v850/v850-protos.h: Add prototypes for v850_return_addr + and v850_init_expanders. + +2001-01-05 Zack Weinberg + + * cpplib.h (struct cpp_reader): Add help_only field. + * cppinit.c (COMMAND_LINE_OPTIONS): Add OPT_version. + (cpp_handle_option): Set pfile->help_only if we see -h, + --help, -target-help, or --version. Print version string but + do not set help_only if we see -v or -version. Make text + printed by -v match that printed by (-)-version. + + * cppmain.c (main): Exit after option parsing if + pfile->help_only is true. + + * toplev.c (independent_decode_option): Call print_version, + then exit, if we see --version (but not -version). + (print_version): Split lengthy message into two lines. + +2001-01-05 Nick Clifton + + * config/v850/v850.c (v850_encode_data_area): Use alloca to create + temporary string for initialisation before calling ggc_alloc_string. + +2001-01-06 Michael Hayes + + * rtl.h (print_simple_rtl): New. + * print-rtl.c (print_simple_rtl): New. + (flag_simple): New. + (print_rtx): Disable printing of flags and modes, etc., + if `flag_simple` nonzero. + +2001-01-05 Zack Weinberg + + * function.c (fixup_var_refs): Use push_to_full_sequence where + possible. + +2001-01-05 Michael Meissner + + * flags.h (flag_reorder_blocks): Add declaration. + (flag_rename_block): Ditto. + +2001-01-05 DJ Delorie + + * function.c (reorder_blocks): Make sure the flags are all reset + before using them to mark blocks, else a second invocation will + corrupt the block chain. + (reorder_blocks_0): New, resets the flags. + +Fri Jan 5 20:34:06 2001 J"orn Rennecke + + * cse.c (find_comparison_args): Stop if the argument is known to + be constant. + +2001-01-05 Alexandre Oliva + + * config/sh/sh.md (movdf): When splitting load into pair of + registers, don't clobber the register used in the address too + early. + +2001-01-05 Jeffrey Oldham + + * varasm.c (mark_constant_pool): Improve initial comments. + (mark_constants): Move marking of constants to mark_constant. + (mark_constant): New function to recursively mark all constants + referred to by a constant. + +2001-01-05 Catherine Moore + + * dbxout.c ((dbxout_parms): Handle invisible ref where decl is a REG. + +2001-01-05 Phil Edwards + + * cp/lang-options.h: Bring comment in line with reality. + * f/lang-options.h: Likewise. + * java/lang-options.h: Likewise. + * objc/lang-options.h: Likewise. + * ch/lang-options.h: Likewise. + * f/g77.texi: And update the manual. + +2001-01-05 Marek Michalkiewicz + Denis Chertykov + + * config/avr/avr-protos.h (avr_peep2_scratch_safe): Prototype. + * config/avr/avr.c (avr_peep2_scratch_safe): New function. + * config/avr/avr.md (all peepholes that request a scratch register): + Call it, FAIL the peephole if not safe (in interrupt functions). + +2001-01-05 Mark Mitchell + + * ggc-page.c (NUM_EXTRA_ORDERS): Hardwire to zero for now. + +2001-01-05 Joseph S. Myers + + * builtins.def (BUILT_IN_CONJ, BUILT_IN_CREAL, BUILT_IN_CIMAG): + Define. + * builtins.c (expand_builtin): Abort on BUILT_IN_CONJ, + BUILT_IN_CREAL and BUILT_IN_CIMAG. + * c-common.c (c_common_nodes_and_builtins): Create builtin conjf, + conj, conjl, crealf, creal, creall, cimagf, cimag and cimagl. + (expand_tree_builtin): Handle BUILT_IN_CONJ, BUILT_IN_CREAL and + BUILT_IN_CIMAG. + * extend.texi: Document these builtins. + +2001-01-05 Daniel Berlin + + * c-common.c (lang_get_alias_set): Say we know nothing of + VECTOR_TYPE aliasing. + + * dwarf2out.c (is_base_type): Handle VECTOR_TYPE properly. + +2001-01-05 Bruce Korb + + * fixinc/mkfixinc.sh(vax-*-bsd): convert exit and atexit calls to + their x* equivalent versions for atexit-less systems + * fixinc/fixincl.c(main): do not return from main() on atexit-less + systems (or any other system any more). + +2001-01-05 Richard Earnshaw + + * arm.md (ldmsi_postinc): Avoid use of match_dup between input and + output operands. Use arm_hard_register_operand for operand 4. + (stmsi_postinc): Similarly. + (ldmsi): Use arm_hard_register_operand for opernand 2. + (stmsi): Similarly. + * arm.c (arm_hard_register_operand): New function. + * arm-protos.h (arm_hard_register_operand): Prototype it. + + * arm.h (HARD_REGNO_RENAME_OK): Define. + +Fri Jan 5 16:29:49 MET 2001 Jan Hubicka + + * simplify-rtx.c (cfc_args): add "unordered" field. + (check_fold_consts): Set unordered field. + (simplify_relational_operation): Simplify the unordered + comparisons. + + * reg-stack.c (swap_rtx_condition): Ensure that the transformation + is valid. + + * emit-rtl.c (try_split): Fix code to mark labels. + * jump.c (mark_jump_label): Make global. + * rtl.h (mark_jump_label): Declare. + + * predict.c (estimate_probability): Handle unordred comparisons. + +2001-01-05 Neil Booth + + * cpp.texi: Update for -MP. Clarify behavior of -MT. + * cppinit.c (initialize_dependency_output): Update. + (cpp_finish): Output dummy targets for -MP. + (OPT_MP): New. + (cpp_handle_option): Handle -MP. Don't quote -MT options. + * cpplib.h (struct cpp_options): Add deps_phony_targets. + * gcc.c (cpp_options): Update to handle -MP. + * mkdeps.c (deps_add_target, deps_add_default_target): Update + to quote only the default target. + (deps_phony_targets): Insert a preceding newline. Rename from + deps_dummy_targets for consistency. + * mkdeps.h: Update + +2001-01-05 Alexandre Oliva + + * calls.c (emit_library_call_value_1): Support + INIT_CUMULATIVE_LIBCALL_ARGS. + * tm.texi (INIT_CUMULATIVE_LIBCALL_ARGS): Document it. + +2001-01-04 Richard Henderson + + * c-decl.c (finish_struct): Detect flexible array members + used in an inappropriate context. + * c-typeck.c (really_start_incremental_init): Special case + constructor_max_index for zero length arrays. + (pop_init_level): Allow initialization of flexible array + members. Deprecate initialization of zero length arrays. + Don't issue missing initializer warning for flexible array + members or zero length arrays. + (process_init_element): Don't dereference null DECL_SIZE. + * varasm.c (array_size_for_constructor): Return a HOST_WIDE_INT. + Don't abort for empty constructors. Use size_binop + (output_constructor): Add commentary regarding zero length + array futures. Abort if we try to initialize an array of + unspecified length with a non-empty constructor in the middle + of a structure. + + * extend.texi (Zero Length): Update and clarify documentation + on static initialization. + +2001-01-05 Michael Hayes + + * config/c4x/c4x.c (c4x_expand_prologue): Don't compile an ISR + with more than 32767 words of local storage. + +2001-01-05 Michael Hayes + + * config/c4x/c4x.c (c4x_init_builtins): Remove builtin support + for 'abs', 'labs', and 'fabs'. + (c4x_expand_builtin): Likewise. + * config/c4x/c4x.h (enum c4x_builtins): Likewise. + +2001-01-05 Alexandre Oliva + + * config/sh/sh.md (prget, prset): New insn types. + (return delay slot): Don't allow prset. + (call, sfunc delay slot): Don't allow prget. + (movsi_i, movsi_ie, movsi_i_lowpart): Create separate alternatives + for prset and prget. + +2001-01-05 Michael Hayes + + * loop.h (struct loop_reg): New. + (struct loop_regs): Change to use array of `struct loop_reg'. + * loop.c: Replace assortment of varrays with single regs array. + (count_one_set): Delete may_not_move array argument + and use regs array instead. All caller's changed. + (count_loop_regs_set): Delete may_not_move and single_usage + arguments and use regs array instead. All caller's changed. + (find_single_use_in_loop): Replace usage array argument with pointer + to regs structure. All caller's changed. + (loop_optimize): Delete `moved_once' array. + +2001-01-05 Michael Hayes + + * loop.c (prescan_loop): Set loop_info->has_nonconst_call. + Use it instead of loop_info->has_call for scanning loop mems. + (check_dbra_loop): Replace loop_info->has_call test with + loop_info->has_nonconst_call. + +2000-01-04 Matthew Hiller + + * config/sh/sh.h (EPILOGUE_USES): Recognize fpscr as epilogue-used + for TARGET_SH3E. + +2001-01-04 Joseph S. Myers + + * fold-const.c (fold): When folding a CONJ_EXPR of a COMPLEX_CST, + use TREE_REALPART and TREE_IMAGPART instead of TREE_OPERAND. + +2001-01-04 Joseph S. Myers + + * c-common.c (SIZE_TYPE, WCHAR_TYPE): Define. + (flag_short_double, flag_short_wchar): Define. + (c_common_nodes_and_builtins): Create many tree nodes shared + between C and C++ here instead of in cp/decl.c and ... + * c-decl.c (init_decl_processing): ... here. + (SIZE_TYPE, WCHAR_TYPE): Don't define. + (flag_short_double, flag_short_wchar): Don't define. + (record_builtin_type): New function. + (build_void_list_node): New function. + * c-common.h (flag_short_double, flag_short_wchar, + record_builtin_type, build_void_list_node): Declare. + +Thu Jan 4 21:09:47 2001 J"orn Rennecke + + * integrate.c (expand_inline_function): Don't put a virtual + register into the reg map. + + * function.c (fixup_var_refs_1): If force_operand didn't put + the address into the target, move it there. + +2001-01-04 Mark Mitchell + + Special-case tree_decl/tree_list allocations. + * ggc-page.c (OBJECT_PER_PAGE): Reimplement. + (OBJECT_SIZE): New macro. + (NUM_EXTRA_ORDER): Likewise. + (extra_order_size_table): New variable. + (NUM_ORDERS): New macro. + (objects_per_page_table): New variable. + (object_size_table): New variable. + (G.pages): Use NUM_ORDERS to bound the array. + (G.page_tails): Likewise. + (DIV_ROUND_UP): Remove. + (BITMAP_SIZE): Use CEIL, instead of DIV_ROUND_UP. + (alloc_page): Use OBJECT_SIZE. + (size_lookup): Don't make it const. + (ggc_alloc): Use OBJECT_SIZE. + (ggc_set_mark): Likewise. + (ggc_get_size): Likewise. + (init_ggc): Set up the object_size_table, objects_per_page_table, + and adjust size_lookup. + (ggc_recalculate_in_use_p): Use CEIL, not DIV_ROUND_UP. + (ggc_pop_context): Use NUM_ORDERS. + (clear_marks): Likewise. + (sweep_pages): Likewise. + (poison_pages): Likewise. + (ggc_print_statistics): Use OBJECT_SIZE. + +Thu Jan 4 15:54:05 2001 Richard Kenner + + * varasm.c (output_constructor): Use HOST_WIDE_INT for sizes. + Only call array_size_for_constructor if last field and array type + with no upper bound. + +2001-01-04 Philip Blundell + + * config/arm/arm.c (arm_gen_constant): Prefer to emit constants + from bit 31 downwards, if this requires no more insns. + (count_insns_for_constant): New helper function for above. + +2001-01-04 Alexandre Oliva + + * gencodes.c (output_predicate_decls): Remove empty initializer. + +2001-01-04 Mark Mitchell + + * tree.c (copy_node): Remove documentation about obstacks. + (buidl1): Check that nobody tries to build 2-argument nodes this + way. + +2001-01-04 Kaveh R. Ghazi + + * sparc.h (PREDICATE_CODES): Delete fp_sethi_p, fp_mov_p and + fp_high_losum_p. + + * gencodes.c (output_predicate_decls): Fill empty initializer + braces. + +2001-01-04 Jakub Jelinek + + * tradcpp.c (deps_file, print_deps_missing_files): New variables. + (main): Handle -MG, -MD, -MMD. Bail out if -MG is given without -M + or -MM. + (do_include): Handle missing headers like cpp0. + * cppfiles.c (_cpp_execute_include): Don't prefix absolute header + paths with first include pathname. Don't strcat to uninitialized + string. + +2001-01-04 Bernd Schmidt + + * regrename.c (regrename_optimize): Don't rename from frame pointer + if frame_pointer_needed. + (do_replace): Don't set ORIGINAL_REGNO to a hard register number. + * config/ia64/ia64.c (emit_all_group_insn_barriers): New function. + (ia64_reorg): Use it instead of scheduling if ! optimize. + (errata_emit_nops): Properly call asm_noperands. + (ia64_sched_reorder): Finish cycle if we see an asm. + (ia64_variable_issue): Clear scheduling state after asms. + +2001-01-04 Neil Booth + + * cpp.texi: Update for -MT. + * cppinit.c (initialize_dependency_output): Add a default + target if none has been given already. + (no_tgt, OPT_MT): New. + (cpp_handle_option): Handle -MT. Update -M etc. + * cpplib.h (struct cpp_options): Remove deps_target. + * gcc.c (cpp_options): Handle -MT. + * mkdeps.c (struct deps): Move from mkdeps.h. + (deps_calc_target): Rename deps_add_default_target. Add a + default target if none has been specified already. + * mkdeps.h (struct deps): Move to mkdeps.c. + (deps_calc_target): Rename deps_add_default_target. + +2000-01-03 Richard Henderson + + * c-decl.c (grokdeclarator): Give zero-length arrays size zero. + Remove dead code. + * c-typeck.c (push_init_level): Move checks for flexible array + members and zero length arrays ... + (pop_init_level): ... here. Silently discard empty initializations. + Remove dead code. + * varasm.c (output_constructor): Update for sizeof change to + zero-length arrays. + + * extend.texi (Zero Length): Clarify semantics. + +2001-01-03 Alexandre Oliva + + * configure.in (tm.h): Include isns-codes.h last. + * configure: Rebuilt. + +2001-01-03 Richard Henderson + + * config/alpha/alpha.md (addvsi3, addvdi3): New. + (negvsi2, negvdi2, subvsi3, subvdi3, mulvsi3, mulvdi3): New. + +2001-01-03 Franz Sirl + + * tradcpp.c (main): Make sure finclude() is called with a valid + indepth value while handling -include. + +2001-01-03 Alexandre Oliva + + * gencodes.c (output_predicate_decls): New function. + (main): Call it. + * machmode.h (GET_MODE_MASK): Arrange for it to be defined + even if it is not the first time machmode.h is #included. + * config/sh/sh.c (fpul_operand): Declare MODE argument. + * tm.texi (PREDICATE_CODES): Document predicate declarations. + * gcc.texi (Copyright): Added 2001. + +2001-01-03 Joseph S. Myers + + * c-common.c (c_common_lang_init): New function. Warn if format + warning options which only have effects when used with -Wformat + are used without -Wformat. + * c-common.h (c_common_lang_init): Declare. + * c-lang.c (lang_init): Call c_common_lang_init. + * objc/objc-act.c (lang_init): Call c_common_lang_init. + +2001-01-03 Joseph S. Myers + + * configure.in: Check for the mktemp command. + * configure: Regenerate. + * gccbug.in: Use a separate temporary file $TEMP0 for one use of + $TEMP. Create temporary files with mktemp, if available at + configure time; otherwise use set -C. Remove temporary files + before exit. + +2001-01-03 Joseph S. Myers + + * configure.in: Require at least texinfo 4.0. Check for whether + Pod::Man is sufficiently recent to regenerate GCC manpages. + * configure: Regenerate. + * Makefile.in (TEXI2POD): Call perl explicitly rather than relying + on #!. + (GENERATED_MANPAGES): Define. + (generated-manpages): New target. Depend on cpp.1 as well as + gcov.1. + (install-man): Depend on $(GENERATED_MANPAGES) (defined by + configure to generated-manpages or empty) rather than on the + manpages directly. Remove execute permission from installed + gcov.1 as well as cpp.1. + * cpp.1, gcov.1: Regenerate. + +2001-01-03 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strncmp): Use host_integerp and + tree_low_cst. Allow using cmpstrsi in more cases. + +Wed Jan 3 10:48:43 2001 Richard Kenner + + * config/sparc/sparc.h (RETURN_IN_MEMORY): Return 0 for variable + sized types. + +Wed Jan 3 12:22:32 2001 Alexandre Oliva + + * build-make (HOST_CFLAGS): Added `-DGENERATOR_FILE'. + * Makefile.in (HOST_CFLAGS): Mention build-make. + +Wed Jan 3 08:53:50 2001 Richard Kenner + + * config/sparc/sparc.md (nonlocal_goto): Emit goto_handler_and_restore + as JUMP_INSN. + +2001-01-01 Bernd Schmidt + + * builtins.c (expand_builtin_return_addr): Don't use MEM_ALIAS_SET on + a REG rtx. + + * cse.c (cse_rtx_varies_p): Accept additional FROM_ALIAS arg. All + callers changed. + + * alias.c (throughout): Use ORIGINAL_REGNO when accessing + reg_base_value and reg_known_value arrays. + (init_alias_analysis): Add more cases to detect known values. + * sched-deps.c (deps_may_trap_p): New function. + (sched_analyze_2): Use it. + +2001-01-03 Alexandre Oliva + + * combine.c (simplify_shift_const): Even if we're sign-extracting, + don't discard an ASHIFTRT if we're shifting in a wider mode. + +2000-01-02 John David Anglin + + * toplev.c (rest_of_compilation): Don't print basic block information + when CFG isn't up to date. + +2001-01-02 Mark Elbrecht + + * config/i386/djgpp.h (DWARF2_DEBUGGING_INFO): Define. + (UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_ASM_OP): Define. + (UNALIGNED_SHORT_ASM_OP): Define. + (CPP_PREDEFINES): Remove defines for GO32 and DJGPP. + +2001-01-02 Mark Mitchell + + * fold-const.c (fold_convert): Fix typo. + +2001-01-02 Richard Henderson + + * c-common.h (ASM_INPUT_P): New. + * c-parse.in (asm): Set it when needed. + * c-semantics.c (genrtl_asm_stmt): Test it instead of the + existence of an operand. + +Tue Jan 2 20:27:07 MET 2001 Jan Hubicka + + * dwarf2out.c (stack_adjust_offset): Handle PRE_MODIFY. + (dwarf2out_frame_debug_expr): Likewise. + (mem_loc_descriptor): Handle PRE and POST_MODIFY. + +Tue Jan 2 20:21:31 MET 2001 Jan Hubicka + + * i386.c (ix86_split_to_parts): Return number of part required; + handle TFmodes. + (print_operand, ix86_expand_branch, ix86_expand_fp_movcc): Handle + TFmodes. + (ix86_split_long_move): Use number of part returned + by ix86_split_to_parts + * i386.h (MASK_128BIT_LONG_DOUBLE, TARGET_128BIT_LONG_DOUBLE): + New macros. + (TARGET_SWITCHES): Add 128bit-long-double and 96bit-long-double + (LONG_DOUBLE_TYPE_SIZE): Change from constant. + (MAX_LONG_DOUBLE_TYPE_SIZE): New macro. + (INTEL_EXTENDED_IEEE_FORMAT): Likewise. + (ALIGN_MODE_128): Add TFmode. + (IS_STACK_MODE): Likewise. + (HARD_REGNO_NREGS): TFmode needs 3 registers. + (HARD_REGNO_OK): Support TFmodes. + (ASM_OUTPUT_LONG_DOUBLE): Handle TFmodes. + * i386.md (scheduler definitions): Use memory operand to determine + fst/fld instructions; use mode attribute to determine real mode of + the instruction. + (*tf): New patterns, expanders and splitters; based on XFmode patterns. + * invoke.texi (128bit-long-double, 96bit-long-double): Document. + +2001-01-02 Mark Mitchell + + * tree.def (TRUTH_NOT_EXPR): Improve documentation. + +Tue Jan 2 10:47:38 2001 Richard Kenner + + * config/mips/mips.c (function_arg): Don't pass NULL_TREE to + host_integerp. + +2001-01-02 Jeffrey Oldham + + * tm.texi (FUNCTION_ARG): Document that @var{type} can be an + incomplete type. + +Tue Jan 2 10:47:38 2001 Richard Kenner + + * tsystem.h: Define HAVE_DECL_GETOPT. + +2001-01-02 Philip Blundell + + * config/arm/linux-gas.h (CLEAR_INSN_CACHE): Avoid illegal clobber + of input operand. + +2001-01-02 Richard Henderson + + * alpha.md (*ze_and_ne): Duplicate insn condition to split. + +2001-01-02 Andreas Jaeger + + * c-decl.c (c_decode_option): Remove support of + -Wmissing-noreturn. + + * toplev.c (documented_lang_options): Remove -Wmissing-noreturn. + (W_options): Add -Wmissing-noreturn here. + + * flow.c: Define lang_missing_noreturn_ok_p. + (check_function_return_warnings): Use it. + + * c-common.h: Declare lang_missing_noreturn_ok_p. + + * c-lang.c (c_missing_noreturn_ok_p): New function. + (lang_init): Set lang_missing_noreturn_ok_p. + + * invoke.texi (Warning Options): Document this. + +2000-12-27 Phil Edwards + + * extend.texi (C++ Extensions): New node for C++ attributes; + describe init_priority and com_interface. + * invoke.texi: Remove -finit-priority as it now has zero effect. + * install.texi: Fix xref syntax. + * md.texi: Likewise. + +Mon Jan 1 21:28:29 2001 Richard Kenner + + * config.gcc (sparc64-wrs-vxworks*): New case. + * config/sparc/vxsparc64.h, config/sparc/t-vxsparc64: New files. + + * config/sparc/sparc.c (sparc_override_options): Do support different + pointer and architecture size. + * config/sparc/sparc.h (MIN_UNITS_PER_WORD): Always 4. + (POINTERS_EXTEND_UNSIGNED): Define. + (Pmode): Test TARGET_ARCH64, not TARGET_PTR64. + (FUNCTION_MODE): Define to be Pmode. + * config/sparc/sparc.md (64-bit call patterns): FUNCTION_MODE now DI. + + * function.c (expand_function_end): Properly handle DECL_RESULT + and copy when ptr_mode != Pmode. + * expmed.c (make_tree): Convert X from Pmode to ptr_mode, if needed. + +2001-01-01 Kaveh R. Ghazi + + * c-common.c (c_common_nodes_and_builtins): Set prototype + parameters for __builtin_fputs, __builtin_fputc and + __builtin_fwrite. Don't declare plain fputc as a builtin. + +2001-01-01 John David Anglin + + * loop.c (add_label_notes): Increment the label usage count when + a note is added to an insn which refers to a CODE_LABEL. + * gcse.c (add_label_notes): Likewise. + +2001-01-01 Andreas Jaeger + + * loop.c (scan_loop): Use xmalloc to allocate movables. + +2001-01-01 Alexandre Oliva + + * tm.texi (REGISTER_MOVE_COST): Add a mode argument. + * reload.c (REGISTER_MOVE_COST): Likewise. Adjust all callers. + * reload1.c (REGISTER_MOVE_COST): Likewise. + * regclass.c (REGISTER_MOVE_COST): Likewise. + (move_cost, may_move_in_cost, may_move_out_cost): Add mode + dimension. Adjust all users. + (init_reg_sets_1): Iterate on all modes. + * config/1750a/1750a.h (REGISTER_MOVE_COST): Adjust. + * config/a29k/a29k.h (REGISTER_MOVE_COST): Adjust. + * config/alpha/alpha.h (REGISTER_MOVE_COST): Adjust. + * config/arc/arc.h (REGISTER_MOVE_COST): Adjust. + * config/arm/arm.h (REGISTER_MOVE_COST): Adjust. + * config/avr/avr.h (REGISTER_MOVE_COST): Adjust. + * config/c4x/c4x.h (REGISTER_MOVE_COST): Adjust. + * config/d30v/d30v.h (REGISTER_MOVE_COST): Adjust. + * config/dsp16xx/dsp16xx.h (REGISTER_MOVE_COST): Adjust. + * config/h8300/h8300.h (REGISTER_MOVE_COST): Adjust. + * config/i386/i386.h (REGISTER_MOVE_COST): Adjust. + * config/ia64/ia64.h (REGISTER_MOVE_COST): Adjust. + * config/m32r/m32r.h (REGISTER_MOVE_COST): Adjust. + * config/m68hc11/m68hc11.h (REGISTER_MOVE_COST): Adjust. + * config/m68k/m68k.h (REGISTER_MOVE_COST): Adjust. + * config/mcore/mcore.h (REGISTER_MOVE_COST): Adjust. + * config/mips/mips.h (REGISTER_MOVE_COST): Adjust. + * config/mn10200/mn10200.h (REGISTER_MOVE_COST): Adjust. + * config/mn10300/mn10300.h (REGISTER_MOVE_COST): Adjust. + * config/ns32k/ns32k.h (REGISTER_MOVE_COST): Adjust. + * config/pa/pa.h (REGISTER_MOVE_COST): Adjust. + * config/pdp11/pdp11.h (REGISTER_MOVE_COST): Adjust. + * config/pj/pj.h (REGISTER_MOVE_COST): Adjust. + * config/romp/romp.h (REGISTER_MOVE_COST): Adjust. + * config/rs6000/rs6000.h (REGISTER_MOVE_COST): Adjust. + * config/sh/sh.h (REGISTER_MOVE_COST): Adjust. + * config/sparc/sparc.h (REGISTER_MOVE_COST): Adjust. + +2001-01-01 Bernd Schmidt + + * alias.c (fixed_scalar_and_varying_struct): Adjust prototype of + arg VARIES_P. Call it with extra arg. + (true_dependence): Likewise. + * rtl.h (rtx_addr_can_trap_p): Declare. + (rtx_varies_p, rtx_addr_varies_p, true_dependence): Update + prototypes. + * rtlanal.c (rtx_addr_can_trap_p): No longer static. + (rtx_varies_p): Accept extra arg FOR_ALIAS; only disallow + pic offset table register if it's zero. All callers changed. + (rtx_addr_varies_p): Accept extra arg FOR_ALIAS; all callers changed. + +Mon Jan 1 07:38:33 2001 Richard Kenner + + * explow.c (convert_memory_address, case SYMBOL_REF): Copy + STRING_POOL_ADDRESS_P. + + * config/sparc/sparc.c (input_operand): Properly test for short op. + + * config.gcc (sparc-*-elf): Include sparc/sol2.h. + (sparc-*-rtems*): Include sparc/sol2.h and sparc/elf.h. + (sparclite-*-elf*, sparc86x-*-elf*): Likewise. + * config/sparc/elf.h: No longer include sol2.h. + * config/sparc/lifeelf.h: No longer include sparc/elf.h. + * config/sparc/rtemself.h, config/sparc/sp86x-elf.h: Likewise. + + * config/sparc/sparc.md: Test TARGET_ARCH64 instead of TARGET_PTR64. + +2001-01-01 Michael Hayes + + * loop.c (check_insn_for_bivs): Use ivs->n_regs to check array bounds. + (find_mem_givs, record_biv, maybe_eliminate_biv): Likewise. + (record_initial): Likewise. + * unroll.c (copy_loop_body, loop_iterations): Likewise. + (remap_split_bivs): Likewise. + +2001-01-01 Michael Hayes + + * loop.c (loop_ivs_free): New function. + (strength_reduce): Break out from... + +2001-01-01 Michael Hayes + + * loop.h (struct iv): New. + (REG_IV_TYPE, REG_IV_CLASS, REG_INFO): Modify to use 'struct iv'. + (struct loop_ivs): Replace 'reg_iv_type', 'reg_iv_info', + 'reg_biv_class' fields with 'regs' and 'n_regs'. + (struct ivs): Rename 'loop_iv_list' field to 'list'. + * loop.c (loop_bivs_find, strength_reduce): Use ivs->regs array. + * unroll.c (loop_iterations): Check array bounds with ivs->n_regs. + +2001-01-01 Michael Hayes + + * loop.h (REG_IV_CLASS): New accessor macro. + * loop.c (REG_IV_CLASS): Use it instead of reg_iv_class array. + * unroll.c (REG_IV_CLASS): Likewise. diff --git a/contrib/gcc/ChangeLog-2002 b/contrib/gcc/ChangeLog-2002 new file mode 100644 index 00000000000..370ff0efbdd --- /dev/null +++ b/contrib/gcc/ChangeLog-2002 @@ -0,0 +1,35988 @@ +2002-12-31 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototypes. + * config/h8300/h8300.c (const_le_2_operand): Change to + const_int_le_2_operand. + (const_int_le_6_operand): Change to const_int_le_6_operand. + * config/h8300/h8300.md (two peepholes): Update the function + names. + +2002-12-31 Tom Tromey + + * doc/install.texi (Testing): Fixed typo. + +2002-12-31 Kazu Hirata + + * config/h8300/h8300.h (TRAMPOLINE_TEMPLATE): Remove. + (TRAMPOLINE_SIZE): Support the normal mode. + (INITIALIZE_TRAMPOLINE): Emit the entire trampoline. + +2002-12-31 Mark Mitchell + + * c-common.h (pending_lang_change): Declare. + +2002-12-31 Jerry Quinn + + * gcc/doc/invoke.texi (Optimization Options): Clean up -O flag + descriptions. + +2002-12-31 Jerry Quinn + + * gcc/doc/invoke.texi (Optimization Options): List the options + enabled by each -O flag. + +2002-12-31 Gerald Pfeifer + + * doc/install.texi (Configuration): Explicitly refer + gcc/config.gcc for a list of cpu models. + +2002-12-31 Kazu Hirata + + * config/h8300/h8300.h: Fix comment typos. + +2002-12-30 David Edelsohn + + * config/rs6000/rs6000.h (WIDEST_HARDWARE_FP_SIZE): Define. + +2002-12-30 Tom Tromey + + * doc/install.texi (Testing): Mention Jacks. + +2002-12-30 Joseph S. Myers + + * doc/gcc.texi, doc/gccint.texi: Update last modification dates. + +2002-12-30 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Use extu.w in more + cases. + (compute_logical_op_length): Update to reflect the change in + output_logical_op. + (compute_logical_op_cc): Likewise. + +2002-12-30 Joseph S. Myers + + * doc/service.texi: Uncomment and update FAQ link. + +2002-12-30 Andreas Jaeger + + * unwind-dw2-fde.h (last_fde): Add unused attribute for obj. + +2002-12-30 Kazu Hirata + + * config/h8300/h8300.md (*addsi3_lshiftrt_16_zexthi): New. + +2002-12-30 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Use extu.w if we + are clearing the most significant byte. + (compute_logical_op_length): Update to reflect the change in + output_logical_op. + (compute_logical_op_cc): Likewise. + +2002-12-29 Kazu Hirata + + * config/h8300/h8300.md: Give internal names to anonymous + insns. + +2002-12-29 Kazu Hirata + + * config/h8300/h8300.md: Reorder some insns. + +2002-12-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Add prototypes for + const_int_qi_operand and const_int_hi_operand. + * config/h8300/h8300.c (const_int_qi_operand): New. + (const_int_hi_operand): Likewise. + * config/h8300/h8300.md (three peepholes): New. + +2002-12-28 Joseph S. Myers + + * doc/cpp.texi, doc/gcc.texi, doc/gccint.texi, doc/install.texi: + Use @copying. + +2002-12-28 Joseph S. Myers + + * configure.in: Increase makeinfo version requirement to 4.[2-9]. + * configure: Regenerate. + * doc/install.texi: Update Texinfo version requirement. + +2002-12-28 Andreas Jaeger + + * config/i386/i386.c (x86_function_profiler): Mark labelno as + possibly unused. + + * c-parse.in (yyprint): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX for + correct format. + +2002-12-27 Kazu Hirata + + * config/h8300/h8300.md (*iorhi_shift_8): Change the name to + *iorhi_ashift_8. + (*iorhi_lshiftrt_8): New. + +2002-12-27 Joseph S. Myers + + * doc/include/texinfo.tex: Update to version 2002-12-26.16. + +2002-12-27 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Abramo and Roberto Bagnara. + +2002-12-26 Kazu Hirata + + * config/h8300/h8300-protos.h: Fix comment typos. + Update copyright. + * config/h8300/h8300.c: Fix comment typos. + +2002-12-26 Kazu Hirata + + * config/h8300/h8300.h (IDENT_ASM_OP): End with a tab. + +2002-12-26 Kazu Hirata + + * config/i386/athlon.md: Fix comment typos. + * config/i386/crtdll.h: Likewise. + * config/i386/djgpp.h: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/i386.md: Likewise. + * config/i386/k6.md: Likewise. + * config/i386/mingw32.h: Likewise. + * config/i386/pentium.md: Likewise. + * config/i386/sco5.h: Likewise. + * config/i386/winnt.c: Likewise. + * config/i386/xmmintrin.h: Likewise. + +2002-12-26 Jose Renau + + * ssa-dce.c (EXECUTE_IF_UNNECESSARY): Verify INSN is an + INSN_P before checking to see if it is dead. + (mark_all_insn_unnecessary): Similarly. + (ssa_eliminate_dead_code): Similarly. + * rtl.h (struct rtx_def): Update comments for in_struct usage + in dead code elimination pass. + (INSN_DEAD_CODE_P): Allow JUMP_INSN and CALL_INSN as well. + +2002-12-26 Andreas Schwab + + * config.gcc (powerpc*-*-*, rs6000-*-*): Fix assignment syntax. + +2002-12-25 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Convert to + tartet_flags_explicit. + * config/rs6000/rs6000.h (MASK_MULTIPLE_SET, MASK_STRING_SET): Delete. + Compact target_flags bits. + (TARGET_MULTIPLE_SET, TARGET_STRING_SET): Delete. + (TARGET_SWITCHES): Delete references to *_SET flags. + +Wed Dec 25 20:30:53 CET 2002 Jan Hubicka + + * i386.md (memory attribute): Fix setcc attribute. + +2002-12-25 Kazu Hirata + + * output.h: Fix comment typos. + * predict.c: Likewise. + * print-tree.c: Likewise. + * profile.c: Likewise. + * ra-build.c: Likewise. + * ra-colorize.c: Likewise. + * ra-debug.c: Likewise. + * ra-rewrite.c: Likewise. + * ra.c: Likewise. + * ra.h: Likewise. + * real.c: Likewise. + * recog.c: Likewise. + * reg-stack.c: Likewise. + * regclass.c: Likewise. + +2002-12-25 Kazu Hirata + + * config/h8300/h8300.c (print_operand_address): Do not negate + a negative number when printing one. + +2002-12-25 Kazu Hirata + + * config/h8300/h8300-protos.h: Add prototypes for + output_plussi, compute_plussi_length, and compute_plussi_cc. + * config/h8300/h8300.c (output_plussi): New. + (compute_plussi_length): Likewise. + (compute_plussi_cc): Likewise. + * config/h8300/h8300.md (addsi_h8300h): Call + output_plussi, compute_plussi_length, and compute_plussi_cc. + +2002-12-24 Kazu Hirata + + * config/h8300/h8300.md (two peepholes): Use match_dup instead + of match_operand in the new patterns. + +2002-12-24 Joseph S. Myers + + * doc/include/texinfo.tex: Update to version 2002-11-25.11. + +2002-12-24 Nathan Sidwell + + * configure.in (enable-coverage): Add SELF_COVERAGE. + * profile.c (end_branch_prob): Use SELF_COVERAGE. + +2002-12-24 Jim Wilson + + * alias.c (record_set): Handle multi-reg hard registers. + +2002-12-24 Kazu Hirata + + * regmove.c: Fix comment typos. + * reload.c: Likewise. + * reload1.c: Likewise. + * resource.c: Likewise. + * rtl.def: Likewise. + * rtl.h: Likewise. + * rtlanal.c: Likewise. + * sched-deps.c: Likewise. + * sched-rgn.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * ssa-ccp.c: Likewise. + * ssa.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * system.h: Likewise. + * tlink.c: Likewise. + * toplev.c: Likewise. + * tracer.c: Likewise. + * tree-inline.c: Likewise. + * tree.c: Likewise. + * tree.h: Likewise. + * unroll.c: Likewise. + * varasm.c: Likewise. + +2002-12-23 Larin Hennessy + + * doc/install.texi: Remove i386-*-isc, i860-*-bsd, + m68k-altos-sysv, m68k-isi-bsd, m68k-sony-bsd entries. + * doc/invoke.texi: Remove AMD 29K, ARM RISC/iX, Clipper, Convex, + DG/UX entries. + * doc/md.texi: Remove AMD 29K entries. + * doc/trouble.texi: Remove Alliant, DG/UX, Iris 4.0.5F, GAS + 1.38.1, NewsOS, RT PC, WE32K entries. + +2002-12-23 Aldy Hernandez + + PR/8763 + * config/rs6000/altivec.md (mulv4sf3): Rewrite to add -0.0 vector. + (altivec_vspltisw_v4sf): Name pattern. + (altivec_vslw_v4sf): New pattern. + +2002-12-23 Joseph S. Myers + + * doc/include/gcc-common.texi: Define DEVELOPMENT. + +2002-12-23 Mark Mitchell + + * stor-layout.c (update_alignment_for_field): Correct handling of + unnamed bitfields on PCC_BITFIELD_TYPE_MATTERS machines. + * doc/tm.texi (PCC_BITFIELD_TYPE_MATTERS): Note that an unnamed + bitfield does not affect alignment. + +2002-12-23 David Edelsohn + + * expr.c (expand_assignment): Apply special treatment to + ARRAY_TYPE. + +2002-12-23 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype of + expand_a_shift. + * config/h8300/h8300.c (expand_a_shift): Change the return + type to void. + * config/h8300/h8300.md: Update all the uses of + expand_a_shift. + +2002-12-22 Nathan Sidwell + + * tree.c (save_expr): Allow either side of a dyadic operand to be + constant. + + * doc/portability.texi (portability): Update portability goals. + +2002-12-23 Kazu Hirata + + * config/h8300/h8300.c (output_a_shift): Remove unused code. + +2002-12-22 Mark Mitchell + + * stor-layout.c (update_alignment_for_field): Guard use of + ADJUST_FIELD_ALIGN with #ifdef. + + * stor-layout.c (update_alignment_for_field): Use + ADJUST_FIELD_ALIGN when computing the alignment for a zero-width + bitfield when PCC_BITFIELD_TYPE_MATTERS. + +2002-12-22 Kazu Hirata + + * genautomata.c: Fix comment typos. + +Sun Dec 22 18:23:44 CET 2002 Jan Hubicka + + * params.def (tracer-min-branch-probability-feedback): Fix default. + * final.c (compute_alignments): Use profile to avoid code bloat. + +2002-12-22 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Make shift insn + sequences end with a valid cc0 whenever possible. + +2002-12-22 Kazu Hirata + + * config/h8300/h8300.md (negsf2): New. + (*negsf2_h8300): Likewise. + (*negsf2_h8300hs): Likewise. + +2002-12-21 Geoffrey Keating + + * integrate.c (output_inline_function): Don't hold private + pointers to 'struct function' over GC calls. + +2002-12-21 Kaz kojima + + * config/sh/lib1funcs.asm (__fpscr_values): Conditionalize with + NO_FPSCR_VALUES. + * config/sh/t-linux (TARGET_LIBGCC2_CFLAGS): Add -DNO_FPSCR_VALUES. + +2002-12-21 Kazu Hirata + + * config/h8300/h8300.md (zero_extendqisi2): Correct the + length. + +2002-12-21 Kazu Hirata + + * config/h8300/h8300.md (*zero_extendqihi2_h8300): Make the + second alternative "#". + (*zero_extendqihi2_h8300hs): Likewise. + (a define_split): New. + +2002-12-21 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + split_adds_subs. + Add prototypes for const_le_2_operand and const_le_6_operand. + * config/h8300/h8300.c (split_adds_subs): Add an argument to + specify whether inc/dec should be used when possible. + (const_le_2_operand): New. + (const_le_6_operand): Likewise. + * config/h8300/h8300.md (two peepholes): New. + +2002-12-21 Kazu Hirata + + * config/fr30/fr30.md: Fix a comment typo. + * config/i386/i386.c: Likewise. + * config/ip2k/ip2k.h: Likewise. + +2002-12-20 Jim Wilson + + * config/rs6000/spe.h (__ev_subifw): Reverse arguments. + (__ev_subw, __ev_subiw): New. + (ev_mwlssf, ev_mwlsmf, ev_mwlssfa, ev_mwlsmfa, ev_mwlssfaaw, + ev_mwlsmfaaw, ev_mwlssfanw, ev_mwlsmfanw): Delete. + +2002-12-20 John David Anglin + + * pa-linux.h (TARGET_HAS_STUBS_AND_ELF_SECTIONS): Delete define. + * pa32-linux.h (FUNCTION_OK_FOR_SIBCALL): Delete define. + * pa.c (pa_function_ok_for_sibcall): Allow non indirect sibcalls on + TARGET_ELF32. Add comment on sibcall issues for TARGET_64BIT. + +2002-12-20 Kazu Hirata + + * config/h8300/h8300-protos.h: Add prototypes for + incdec_operand and eqne_operator. + * config/h8300/h8300.c (incdec_operand): New. + (eqne_operator): Likewise. + * config/h8300/h8300.h (CONST_OK_FOR_M): Likewise. + (CONST_OK_FOR_O): Likewise. + (CONST_OK_FOR_LETTER_P): Use CONST_OK_FOR_M and + CONST_OK_FOR_O. + * config/h8300/h8300.md (UNSPEC_INCDEC): New. + (addhi3_incdec): New. + (addsi3_incdec): Likewise. + (two peepholes): Likewise. + +2002-12-20 Kazu Hirata + + * config/h8300/h8300.c (dosize): Remove warnings. + (print_operand): Likewise. + +2002-12-20 Richard Henderson + + * config/alpha/alpha.c (decl_has_samegp): New. + (samegp_function_operand): Use it. Rename from + current_file_function_operand. + (direct_call_operand): Handle -msmall-text via symbol->jump. + (tls_symbolic_operand_1): Use T for tprel64, t for smaller tprel. + (tls_symbolic_operand_type): Likewise. + (alpha_encode_section_info): Likewise. Handle -msmall-text. + (alpha_function_ok_for_sibcall): Use decl_has_samegp. + (alpha_end_function): Set symbol->jump for functions defined in + the text section. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (MASK_SMALL_TEXT, TARGET_SMALL_TEXT): New. + (TARGET_SWITCHES): Add -msmall-text and -mlarge-text. + (PREDICATE_CODES): Update. + * config/alpha/alpha.md (call patterns): Update for + samegp_function_operand rename; use !samegp reloc if + TARGET_EXPLICIT_RELOCS. + * doc/invoke.text: Document -msmall-text and -mlarge-text. + +2002-12-20 Ian Dall + + * config/ns32k/ns32k.md (movdi): Use "l" instead of "f" to match + all registers capable of holding a double float. + (*rcond): change name of "reverse branch" insns to + something more meaningful. + (*rbgt, *rblt, *rbge, *rble): Reverse branches to handle IEEE + comparisons properly. + (*ffs): Change operand 0 from write to read-modify-write. + (*ffsssi2): Drop constraints from define_expand. + + * config/ns32k/ns32k.h (STORE_RATIO, STORE_BY_PIECES): Avoid using + MOVE_RATIO as default for store operations. + + * config/ns32k/ns32k.h (enum reg_class, REG_CLASS_NAMES): Add + LONG_REGS class. + (CANNOT_CHANGE_MODE_CLASS): Can't subreg LONG_REGS. + (GO_IF_LEGITIMATE_ADDRESS): Remove spurious abort(). + * config/ns32k/ns32k.c (regclass_map): Add LONG_REGS class. + + * config/ns32k/STATUS: New File + * config/ns32k/NOTES: New file. + +2002-12-20 Hartmut Penner + + * doc/invoke.texi: Document -mzarch, -mesa, -mcpu= and -march= + option for S/390 and zSeries. + * config/s390/s390.c (s390_cpu, s390_cpu_string, s390_arch, + s390_arch_string): New variables. + (override_options): Checking for options and setting of + appropriate target_flags, cpu and arch flags. + * config/s390/s390.h: (processor_type): New enum. + (TARGET_SWITCHES): New switches -mesa/zarch. + * config/s390/s390.md: New attribute 'cpu'. + +2002-12-19 Kazu Hirata + + * c-pretty-print.h: Fix comment typos. + * integrate.c: Likewise. + * varasm.c: Likewise. + * config/c4x/c4x.h: Likewise. + * config/c4x/c4x.md: Likewise. + * config/fr30/fr30.md: Likewise. + * config/frv/frv.c: Likewise. + * config/h8300/h8300.c: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ip2k/ip2k.md: Likewise. + * config/m68hc11/m68hc11-crt0.S: Likewise. + * config/m68hc11/m68hc11.h: Likewise. + * config/m68hc11/m68hc11.md: Likewise. + * config/m68hc11/m68hc12.h: Likewise. + * config/mcore/mcore.md: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.md: Likewise. + * config/mmix/mmix-modes.def: Likewise. + * config/pa/pa.c: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + +2002-12-19 Kazu Hirata + + * config/h8300/h8300.md (output_a_shift): Clean up the code to + output shifts using rotation. + +2002-12-20 Zdenek Dvorak + + * flow.c (allocate_reg_life_data): Reset REG_FREQ. + +2002-12-19 Kazu Hirata + + * config/h8300/h8300.md (pushqi_h8300): Don't push the stack + pointer. + (pushqi_h8300hs): Likewise. + (pushhi_h8300): Likewise. + (pushhi_h8300hs): Likewise. + +Thu Dec 19 23:44:09 2002 J"orn Rennecke + + * sched-rgn.c (init_regions): Update comment. + +2002-12-19 David Edelsohn + + * config/rs6000/rs6000.md (define_attr type): Remove altivec. + * config/rs6000/altivec.md (movv4si_internal): Set correct instruction + attributes. + (movv8hi_internal,movv16qi_internal,movv4sf_internal): Same. + (get_vrsave_internal,set_vrsave_internal): Same. + (altivec_vspltisb,altivec_vspltish,altivec_vspltisw): Same. + (absv16qi2,absv8hi2,absv4si2,absv4sf2): Same + (altivec_abss_v16qi,altivec_abss_v8hi,altivec_abss_v4si): Same. + +2002-12-19 Casper S. Hornstrup + Danny Smith + Eric Kohl + + * config/i386/i386.c (ix86_handle_cdecl_attribute): Check for + attributes incompatible with fastcall attribute. + (ix86_handle_regparm_attribute): Likewise. + + * config/i386/i386.c (ix86_comp_type_attributes): Check for mismatched + fastcall types. + + * config/i386/cygwin.h (TARGET_OS_CPP_BUILTINS): Add fastcall + attributes. + (ASM_OUTPUT_LABELREF): Define as i386_pe_output_labelref. + * config/i386/i386-protos.h (i386_pe_output_labelref): Declare. + * config/i386/winnt.c (i386_pe_mark_dllimport). Add __imp_ prefix in + i386_pe_output_labelref rather than here. + (gen_fastcall_suffix): New function. Decorates a label name with the + fastcall prefix (@) and the stdcall suffix. + (i386_pe_encode_section_info): Call gen_fastcall_suffix() if a symbol + has a fastcall attribute. + (i386_pe_output_labelref): New function. Outputs a label reference. + * config/i386/i386.c (ix86_attribute_table): Accept 'fastcall' as a + valid attribute. + (ix86_return_pops_args): Fastcall functions pop the stack. + (init_cumulative_args): Reserve registers ECX and EDX if function has + fastcall attribute. + (function_arg): Use registers ECX and EDX if function has fastcall + attribute. + * config/i386/i386.h (CUMULATIVE_ARGS): Add fastcall attribute flag. + (DLL_IMPORT_EXPORT_PREFIX): Redefine as '#'. + (FASTCALL_PREFIX): Define as '@'. + * config/i386/mingw32.h (TARGET_OS_CPP_BUILTINS): Add fastcall + attributes. + * doc/extend.texi: Add documentation of fastcall attribute. + +2002-12-19 Nathanael Nerode + + * configure.in: FORBUILD when build!=host changed from + ../$build-alias to ../build-$build_alias to match change made + in top directory. + * configure: Regenerated. + +2002-12-19 Eric Botcazou + + PR optimization/8988 + * loop.c (maybe_eliminate_biv): Kill REG_EQUAL notes mentioning + the biv when eliminating. + +2002-12-19 Devang Patel + * gcc.c (struct default_compiler): Recognizes input file name with + .CPP extension as C++ source files + * cp/lang-spec.h: Same + * doc/invoke.texi: Add documentation for .CPP support. + +2002-12-19 Aldy Hernandez + + PR 8553 + * config/rs6000/altivec.md ("absv8hi2"): Add & to clobbered + registers. + ("absv16qi2"): Same. + ("absv4si2"): Same. + ("absv4sf2"): Same. + ("altivec_abss_v16qi"): Same. + ("altivec_abss_v8hi"): Same. + ("altivec_abss_v4si"): Same. + +2002-12-19 Ulrich Weigand + + * config/s390/s390.md ("*tsthiCCT", "*tsthiCCT_cconly", + "*tstqiCCT", "*tstqiCCT_cconly"): New insns. + +2002-12-19 Eric Botcazou + + PR target/8340 + * stmt.c (expand_asm_operands): Produce an error when + the PIC register is clobbered. + +2002-12-18 Daniel Berlin + + * Makefile.in (OBJS): Add alloc-pool.o + (alloc-pool.o): New object. + + * alloc-pool.c: New file. + * alloc-pool.h: New file. + +2002-12-18 Loren James Rittle + + * gcc.c (validate_switches): Robustify against skipping past '\0'. + +2002-12-18 Geoffrey Keating + + * config.gcc: Set extra_objs in the generic Darwin rule, + not in the machine-specific rules. + +2002-12-19 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.2: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.5: Likewise. + * cppexp.c: Likewise. + * df.c: Likewise. + * gcov.c: Likewise. + * gengtype.c: Likewise. + * reload1.c: Likewise. + * sched-rgn.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * timevar.c: Likewise. + * toplev.c: Likewise. + * tree.h: Likewise. + * varasm.c: Likewise. + * config/fr30/fr30.md: Likewise. + * config/i386/i386.c: Likewise. + * config/ia64/ia64.c: Likewise. + * config/pa/pa.c: Likewise. + +2002-12-18 Roger Sayle + + * basic-block.h (flow_bb_inside_loop_p): Correct prototype. + +2002-12-18 Aldy Hernandez + + PR 8551 + * config/rs6000/altivec.h (vec_cmplt macro): Reverse arguments in + macro. + (vec_cmplt C++ functions): Reverse arguments. + +2002-12-18 Geoffrey Keating + + * config/rs6000/t-rs6000: Move contents to t-fprules, + add rules for dependencies of rs6000.o and to build rs6000-c.o + * config/rs6000/t-fprules: New file from t-rs6000. + * config/rs6000/t-beos: Remove soft-fp rules. + * config/rs6000/t-ppccomm: Likewise. + * config/rs6000/t-newas: Likewise. + * config/rs6000/t-rs6000-c-rule: Delete. + * config.gcc: Use t-fprules for rs6000/ ports when appropriate. + Use t-rs6000 for all rs6000/ ports instead of t-rs6000-c-rule. + Create generic Darwin rules. + + * gengenrtl.c (gencode): Delete unnecessary rtl_obstack declaration. + +2002-12-18 Doug Evans + + * m32r/m32r.c (addr24_operand): Fix arg to CONSTANT_POOL_ADDRESS_P + and LIT_NAME_P. + (move_src_operand): Remove compile-time warning. + * m32r/m32r.h (ROUND_ADVANCE_ARG): Ditto. + +2002-12-18 Jason Merrill + + * unwind-dw2-fde.c (frame_downheap): Split out from... + (frame_heapsort): Here. + +2002-12-17 Jason Merrill + + * tree.c (make_node): Don't set TREE_TYPE on 's' class nodes. + (build1): Always set TREE_SIDE_EFFECTS on 's' class nodes. + + * gcc.c (do_spec_1) ['W']: End any pending argument from the braces. + + * calls.c (expand_call): Don't try to be clever about expanding + the return slot address. + +2002-12-18 Kaz kojima + + * config/sh/linux.h (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC): + Define. + +2002-12-17 Jason Merrill + + * genmultilib: Use 'cd ./foo'. + +2002-12-17 Kazu Hirata + + * doc/c-tree.texi: Restore deliberate spelling mistakes. + +2002-12-17 Kazu Hirata + + * doc/c-tree.texi: Fix typos and follow spelling conventions. + * doc/cpp.texi: Likewise. + * doc/extend.texi: Likewise. + * doc/gty.texi: Likewise. + * doc/install.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/md.texi: Likewise. + * doc/passes.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/tm.texi: Likewise. + +2002-12-17 Jerry Quinn + + * doc/invoke.texi: Minor spelling and grammar fixes. + +2002-12-17 Ulrich Weigand + + * config/s390/s390.c (s390_output_constant_pool): Replace + ASM_OUTPUT_INTERNAL_LABEL by (*targetm.asm_out.internal_label). + +Tue Dec 17 09:47:57 CET 2002 Jan Hubicka + + * convert.c (convert_to_real): Disable function transformation for + now. + +2002-12-16 Geoffrey Keating + + * gcc.c (handle_braces): Allow '@' as a switch name. + +2002-12-16 Jason Merrill + + * calls.c (expand_call): Handle CALL_EXPR_HAS_RETURN_SLOT_ADDR + with special struct-return ABIs. + + * c-semantics.c (add_scope_stmt): Abort if the end SCOPE_STMT + doesn't match the begin SCOPE_STMT in partialness. + +2002-12-16 Geoffrey Keating + + * genmultilib: Create temporary files in unique subdirectory. + + * gcc.c (validate_switches): Allow '@' as a switch name. + +2002-12-16 Loren J. Rittle + + * Makefile.in (gcov-iov.h): Improve portability. + +Mon Dec 16 23:39:19 CET 2002 Jan Hubicka + + * mips.h (ASM_OUTPUT_ADDR_DIFF_ELT): Do not use qpword on API_N32/not + gas + * mips.md (tablejump insn): Likewise. + +2002-12-16 Mark Mitchell + + * doc/include/gcc-common.texi: Change version number to 3.4. + +2002-12-16 Bruce Korb + + * fixinc/fixlib.h: add: #include + * fixinc/fixincl.c: remove: #include + +Mon Dec 16 17:20:04 2002 J"orn Rennecke + + * sh.h (EXTRA_CONSTRAINT_Z): New macro. + (EXTRA_CONSTRAINT): Use it. + * sh.md (anddi3): Use 'Z' constraint for alternative 2. + +2002-12-15 Zack Weinberg + + * config.gcc (need_64bit_hwint): New variable. + (alpha*-*-*, x86_64-*-*, ia64-*-*, mips*-*-*, powerpc*-*-*, + mmix-knuth-mmixware, rs6000*-*-*, sparc64*-*-*, s390*-*-*, + sh*-*-*, hppa*64*-*-linux, parisc*64*-*-linux, hppa*64*-*-hpux11*, + sparcv9-*-solaris2*, sparc*-*-solaris2.[789], ultrasparc-*-freebsd*): + Set it. + (powerpc*-*-darwin*): Unset it. + (alpha-*-interix, alpha64-dec-*vms*, i?86-*-interix3*, + i?86-*-interix*, sparc64-*-openbsd*): Remove references to + deleted/nonexistent xm-*.h headers. + * configure.in: AC_DEFINE NEED_64BIT_HOST_WIDE_INT if the + target set need_64bit_hwint in config.gcc. + * configure, config.in: Regenerate. + + * hwint.h: Overhaul. Don't bother trying int for + HOST_WIDE_INT. Do try __int64 if long is not enough. Base + decision to force 64-bit HOST_WIDE_INT on + NEED_64BIT_HOST_WIDE_INT, not (MAX_)LONG_TYPE_SIZE which is + not visible at this point. Don't allow prior definition of + any macro defined by this file. + + * config/alpha/xm-vms.h: Don't define HOST_WIDE_INT or + HOST_BITS_PER_WIDE_INT. + * config/c4x/c4x.h: Adjust redefinition of + HOST_WIDE_INT_PRINT_HEX to match changes to hwint.h. + * config/alpha/xm-alpha-interix.h, config/alpha/xm-vms64.h, + config/i386/xm-i386-interix.h: Delete file. + +2002-12-14 Rodney Brown + John David Anglin + + * pa.c (output_millicode_call): Convert ASM_OUTPUT_INTERNAL_LABEL. + * pa64-hpux.h (ASM_OUTPUT_INTERNAL_LABEL): Delete define. + +2002-12-14 Zack Weinberg + + * mkconfig.sh: Correct comment. Add copyright boilerplate. + +2002-12-14 Zack Weinberg + + * config/t-darwin, config/arm/t-pe, config/arm/t-strongarm-pe, + config/c4x/t-c4x, config/i370/t-i370, config/i386/t-cygwin, + config/i386/t-interix, config/i960/t-960bare, config/ia64/t-ia64, + config/rs6000/t-rs6000-c-rule, config/sparc/t-sol2, + config/v850/t-v850: Correct dependencies and normalize + compilation commands for files that include coretypes.h and tm.h. + + * config/sparc/gmon-sol2.c: Include tconfig.h and tsystem.h, + not config.h and system.h. + +Sat Dec 14 20:43:41 CET 2002 Jan Hubicka + + * i386.c (flags_reg_operand): New function. + * i386.h (PREDICATE_CODES): Add flags_reg_operand. + * i386.md (cmov splitter, movqicc): Use new predicate. + +Sat Dec 14 17:03:17 CET 2002 Jan Hubicka + + * i386.md (movqicc splitter): Fix template. + +2002-12-13 Jason Merrill + + * tree.h (CALL_EXPR_HAS_RETURN_SLOT_ADDR): New macro. + * calls.c (expand_call): Handle it. + * tree-inline.c (struct inline_data): Remove target_exprs field. + (optimize_inline_calls): Don't initialize it. + (expand_call_inline): Don't modify it. Handle + CALL_EXPR_HAS_RETURN_SLOT_ADDR. + (declare_return_variable): Take return slot addr. + * langhooks.h (copy_res_decl_for_inlining): Change target_exprs parm + to return_slot_addr. + * langhooks-def.h, langhooks.c: Adjust. + * explow.c (maybe_set_unchanging): Don't set RTX_UNCHANGING_P for + a decl with no DECL_INITIAL. + + * expr.c (expand_expr): Don't discard the target of a call which + returns in memory. + +2002-12-13 Neil Booth + + * cppinit.c (path_include): Take an environment variable name. + Tidy up. + (init_standard_includes): Simplify environment handling, and + move to ... + (cpp_read_main_file): ...here as -nostdinc should not affect + environment variable paths. + +2002-12-13 John David Anglin + + * pa.c (output_millicode_call): Correct typo. + (output_call): Likewise. + +Fri Dec 13 21:07:18 2002 Alexandre Oliva + + * config/mn10300/mn10300.c (print_operand) : Check + operand's range. Print value directly, without aid from + output_address. + : New. + : Make sure argument to fprintf has the right type. + * config/mn10300/mn10300.h (OK_FOR_T): New macro. + (EXTRA_CONSTRAINT): Adjust. + * config/mn10300/mn10300.md: Add new all-QImode pattern for + bclr. Use %U for immediate operands of bset and bclr. + (iorqi3): New expand, with insns for AM33 and mn10300. + +Fri Dec 13 16:02:27 2002 J"orn Rennecke + + * sh.c (sh_register_operand): New function. + (prepare_move_operands): Use it. + * sh.h (PREDICATE_CODES): Add entry for sh_register_operand. + * sh.md (movsi_media, movsi_media_nofpu): Allow stores of 0. + (movqi_media, movhi_media, movdi_media, movdi_media_nofpu): Likewise. + (movdf_media, movdf_media_nofpu, movv4sf_i, movsf_media): Likewise. + (movsf_media_nofpu, movv2hi_i, movv4hi_i, movv8qi_i): Likewise. + (movv2si_i): Likewise. + +2002-12-13 Jim Wilson + + * doc/extend.texi (Complex Numbers): Update info on debug info. + +2002-12-13 Kazu Hirata + + * config/h8300/h8300.md (addhi3_h8300): Remove the last + alternative. + +2002-12-12 Zdenek Dvorak + + * hooks.h (hook_tree_tree_bool_false): Declare + hook_bool_tree_tree_false instead. + +2002-12-12 Devang Patel + + * doc/invoke.texi: Document Darwin linker options, -bundle + -bind_at_load, -all_load and -arch_errors_fatal + +2002-12-12 Jim Wilson + + * dbxout.c (dbxout_fptype_value): New. + (dbxout_type, case COMPLEX_TYPE): Call it. Use 'R' instead of 'r'. + +2002-12-12 Kazu Hirata + + * c-decl.c: Fix a comment typo. + * cfg.c: Likewise. + * cfgcleanup.c: Likewise. + * cfglayout.c: Likewise. + * cfgrtl.c: Likewise. + * c-typeck.c: Likewise. + * dominance.c: Likewise. + * dwarf2asm.c: Likewise. + * dwarfout.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * final.c: Likewise. + * flow.c: Likewise. + * function.c: Likewise. + * gcc.c: Likewise. + * genautomata.c: Likewise. + * integrate.c: Likewise. + * loop.c: Likewise. + * loop.h: Likewise. + * output.h: Likewise. + * profile.c: Likewise. + * ra.h: Likewise. + * reload1.c: Likewise. + * reload.c: Likewise. + * sched-rgn.c: Likewise. + * stmt.c: Likewise. + * tree.h: Likewise. + * vmsdbgout.c: Likewise. + +2002-12-12 Kazu Hirata + + * config/h8300/h8300.md: Add a new peephole2. + +2002-12-12 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Accept a constant + that's accepted by CONST_OK_FOR_J. + +2002-12-12 Kazu Hirata + + * config/h8300/h8300.h (CONST_OK_FOR_J): New. + (CONST_OK_FOR_LETTER_P): Use CONST_OK_FOR_J. + * config/h8300/h8300.md (*addhi_h8300): Add a new alternative. + (*addhi_h8300hs): Likewise. + +Thu Dec 12 16:24:59 2002 J"orn Rennecke + + * sh.c (reg_class_from_letter): No longer const. Add 'e' entry. + (sh_register_move_cost): Add clause for SImode fp-fp moves. + Increase cost for moves involving multiple general purpose registers. + * sh.h (OVERRIDE_OPTIONS): Set reg_class_from_letter['e'] according to + TARGET_FMOVD. + (HARD_REGNO_MODE_OK): Allow V2SFmode and V4SFmode in general purpose + registers, and SImode in fp registers, for ! TARGET_SHMEDIA. + (enum reg_class reg_class_from_letter): No longer const. + (SECONDARY_OUTPUT_RELOAD_CLASS): Use REGCLASS_HAS_FP_REG / + REGCLASS_HAS_GENERAL_REG. + Handle SImode moves from/to fp registers. + ! TARGET_SHMEDIA && TARGET_FMOVD. + (SECONDARY_INPUT_RELOAD_CLASS): Use REGCLASS_HAS_FP_REG. + * sh.md (movsi_ie): Add alternatives to move from / to fp regisyters. + +2002-12-12 Andreas Schwab + + * config/ia64/ia64.c (ia64_hpux_asm_file_end): Fix typo in last + change and some warnings. + +2002-12-12 Kazu Hirata + + * doc/md.texi (pushm): Fix a typo. + +2002-12-12 Alexandre Oliva + + * config/mips/mips.c (mips_output_conditional_branch): Support + PIC-safe out-of-range branch and branch-likely. + * config/mips/mips.md (attr length): PIC-safe out-of-range + branches are longer. + ("jump"): Support PIC-safe out-of-range-for-branch jumps. Remove + unused code to support indirect jumps. + +2002-12-11 Zack Weinberg + + * Makefile.in (GTFILES): Add $(host_xm_file_list) and + $(tm_file_list). + +2002-12-11 David Edelsohn + + * config/rs6000/t-rs6000-c-rule: Add coretypes.h $(TM_H) dependencies. + +Wed Dec 11 15:20:45 CET 2002 Jan Hubicka + + * i386.md (cmove splitters): Avoid creation of unnecesary subregs. + +2002-12-11 John David Anglin + + * pa.h (BIGGEST_ALIGNMENT): Change 32-bit value to 64 bits. + (MAX_PARM_BOUNDARY, STACK_BOUNDARY): Express in terms of + BIGGEST_ALIGNMENT. + (PREFERRED_STACK_BOUNDARY): Express in terms of STACK_BOUNDARY. + (FUNCTION_BOUNDARY): Express in terms of BITS_PER_WORD. + +2002-12-11 Kazu Hirata + + * doc/invoke.texi: Correct dump file names. + +2002-12-09 Steve Ellcey + + * config/ia64/ia64.c (ia64_hpux_asm_file_end): Don't send stripped + name to globalize_label or assemble_name. + +Wed Dec 11 20:15:19 2002 J"orn Rennecke + + * sh.h (REG_CLASS_HAS_GENERAL_REG): Only true for SIBCALL_REGS + if not TARGET_SHMEDIA. + +Wed Dec 11 19:05:05 2002 J"orn Rennecke + + * sh.h (REG_CLASS_HAS_FP_REG): New. + (REGISTER_MOVE_COST) Use it. Put body into a function and + move it into: + * sh.c (sh_register_move_cost). + * sh-protos.h (sh_register_move_cost): Declare. + + * sh.c (sh_expand_builtin): Abort for unexpected nop values. + (sh_adjust_cost): Always return a value. + +Wed Dec 11 18:39:52 2002 J"orn Rennecke + + * sh.h (REG_CLASS_HAS_GENERAL_REG): New. + (REGISTER_MOVE_COST): Use it. + +2002-12-11 Richard Henderson + + * tree.h (MODULE_LOCAL_P): Kill. + * varasm.c (default_binds_local_p_1): Use decl_visibility instead. + +2002-12-11 Kazu Hirata + + * config/h8300/h8300.md (two define_peephole2): New. + +2002-12-11 Kazu Hirata + + * config/h8300/h8300.h (CONST_OK_FOR_J): Remove. + (CONST_OK_FOR_K): Likewise. + (CONST_OK_FOR_M): Likewise. + (CONST_OK_FOR_LETTER_P): Do not use the above macros. + +2002-12-11 Neil Booth + + * c-common.c (builtin_define_type_max): Handle unsigned + types too. + +2002-12-10 David Edelsohn + + * haifa-sched.c (rank_for_schedule): Correct style. + +2002-12-10 Per Bothner + + * cpplib.h (struct cpp_hashnode): Split a non-portably-signed field + directive_index into an unsigned field and a new is_directive field. + * cppinit.c (mark_named_operators): Update to set new fields. + * cpplex.c (_cpp_lex_direct): Now directive_field is unsigned. + * cpplib.c [_cpp_handle_directive]: Test is_directive field. + No longer need to subtract 1 from directive_index. + (_cpp_init_directives): No longer need to add 1 to directive_index. + * cpptrad.c (scan_out_logical_line): Use is_directive field. + +2002-12-10 Roger Sayle + + * builtins.c (fold_builtin): Remove -funsafe-math-optimizations + check for evaluating sqrt of a constant at compile time. + * simplify-rtx.c (simplify_unary_operation): Likewise. + +2002-12-10 Janis Johnson + + PR other/8882 + * doc/tm.texi (PUSH_ARGS): Remove misplaced line. + +2002-12-10 Devang Patel + + * config/darwin.h(LINK_SPEC): Add darwin specific linker options. + * doc/invoke.texi: Add new "Darwin Options" section. + +2002-12-10 Jim Wilson + + * rs6000.h (RETURN_IN_MEMORY): If ABI_V4, then TFmode is returned in + memory. + +2002-12-10 Andrew Haley + + * cse.c (cse_insn): Don't cse past a basic block boundary. + +2002-12-10 Jakub Jelinek + + * config/linux.h (LIB_SPEC): If -pthread, add -lpthread even if + -shared. + * config/alpha/linux-elf.h (LIB_SPEC): Likewise. + * config/alpha/linux.h (LIB_SPEC): Likewise. + * config/arm/linux-elf.h (LIB_SPEC): Likewise. + * config/pa/pa-linux.h (LIB_SPEC): Likewise. + * config/sparc/linux.h (LIB_SPEC): Likewise. + * config/sparc/linux64.h (LIB_SPEC): Likewise. + +2002-12-09 Larin Hennessy + + * doc/invoke.texi: Document UltraSparc III option. + +2002-12-09 Richard Henderson + + * config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Define + __tune_pentium2__ and __tune_pentium3__ as necessary. + +2002-12-09 Richard Henderson + + * target.h (gcc_target): Add cannot_force_const_mem. + * target-def.h (TARGET_CANNOT_FORCE_CONST_MEM): New. + (TARGET_INITIALIZER): Add it. + * varasm.c (force_const_mem): Fail if cannot_force_const_mem. + * expr.c (emit_move_insn): Be prepared for force_const_mem to fail. + * reload1.c (reload): Likewise. + * hooks.c (hook_bool_rtx_false): New. + * hooks.h: Declare it. + + * config/i386/i386.c (ix86_cannot_force_const_mem): New. + (TARGET_CANNOT_FORCE_CONST_MEM): New. + (ix86_expand_move): Remove de-const-pooling hack. + +Mon Dec 9 21:33:38 CET 2002 Jan Hubicka + + * toplev.c (dump_file): Fix order to match reality. + +2002-12-08 Geoffrey Keating + + * config/rs6000/rs6000.md (load_multiple): Use adjust_address_nv. + (store_multiple): Likewise. + +2002-12-09 John David Anglin + + * pa/fptr.c (__canonicalize_funcptr_for_compare): Don't canonicalize + function pointers in page 0. + +2002-12-09 Steve Ellcey + + * config/ia64/hpux.h (TARGET_STRUCT_ARG_REG_LITTLE_ENDIAN): Remove + definition + (MEMBER_TYPE_FORCES_BLK): Move. + * config/ia64/ia64.c (ia64_function_arg): Use PARALLEL to pass + aggregate arguments. + (ia64_function_value): Use PARALLEL to return aggregate values. + +2002-12-09 Steve Ellcey + + * doc/tm.texi (FUNCTION_ARG_REG_LITTLE_ENDIAN): Remove definition. + * defaults.h (FUNCTION_ARG_REG_LITTLE_ENDIAN): Remove definition. + * calls.c (store_unaligned_arguments_into_pseudos) Remove + FUNCTION_ARG_REG_LITTLE_ENDIAN. + * stmt.c (expand_return): Ditto. + * expr.c (move_block_from_reg): Ditto. + (copy_blkmode_from_reg): Ditto. + * expmed.c (store_bit_field): Ditto. + +2002-12-09 Svein E. Seldal + + * config.gcc: Added tic4x-* target as an alias to c4x-* + +Sun Dec 8 14:57:39 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Use force_operand instead of + constructing insn directly. + +2002-12-06 Per Bothner + + * cpplib.h (struct cpp_hashnode): Change field directive_index from + char to an int bit-field, for hosts where char is unsigned. + +2002-12-07 Roger Sayle + Richard Henderson + + * real.c (ieee_extended_motorola_format, + ieee_extended_intel_96_format, ieee_extended_intel_128_format, + ieee_quad_format, vax_d_format, vax_g_format, i370_double_format): + Provide appropriate values for new signbit field. + +2002-12-07 Roger Sayle + + * real.h (real_format): Add signbit field. + * real.c (ieee_single_format, ieee_double_format, + ieee_extended_motorola_format, ieee_extended_intel_96_format, + ieee_extended_intel_128_format, ibm_extended_format, + ieee_quad_format, vax_f_format, vax_d_format, + vax_g_format, i370_single_format, i370_double_format, + c4x_single_format, c4x_extended_format, real_internal_format): + Provide suitable signbit value, or -1 to avoid bit twiddling. + + * optabs.c (expand_unop): Try implementing negation of + floating point modes by flipping the sign bit. + (expand_abs): Try implementing abs of floating point modes + by clearing the sign bit. + +Sat Dec 7 22:29:47 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Use force_operand instead + of constructing insn directly. + +2002-12-07 Kazu Hirata + + * config/h8300/h8300.md (*iorhi_shift_8): New. + +2002-12-06 Bernd Schmidt + + * doc/invoke.texi: Document FRV port options. + * doc/md.texi: Document FRV register classes. + +2002-12-07 Gerald Pfeifer + + * doc/install.texi (Configuration): Improve description of cases + where `make distclean` may fail; clarify --with-gnu-as; fix grammar. + +2002-12-06 Per Bothner + + * cpplib.h (NODE_MACRO_ARG): New flag. + (struct cpp_hashnode): Give _cpp_hashnode_value tag to value union. + Remove value.operator field. Move arg_index field to value union. + (directive_index): Make signed, since also used for C++ operators. + * cppmacro.c (_cpp_save_parameter): Use NODE_MACRO_ARG flag to + check for duplicate parameter. Set NODE_MACRO_ARG flag. + Save node->value, and set node->value.arg_index. + (_cpp_create_definition): For each paramater, restore node->value. + (lex_expansion_token): Use NODE_MACRO_ARG flag, and moved arg_index. + * cpptrad.c (scan_out_logical_line): Likewise. + (scan_out_logical_line): Check for directive > 0. + * cpplib.c (cpp_handle_directive): Likewise. + * cpplex.c (_cpp_lex_direct): Update as value.operator is replaced + by negative of directive_index. + * cppinit.c (mark_named_operators): Likewise. + + * hashtable.h (struct ht_identifier): Swap fields, for better packing. + +2002-12-06 Dhananjay Deshpande + + * gcc/config/sh/sh.c (calc_live_regs): Save fpscr only if target has + FPU. + (push): Generate push_fpscr. + (pop): Generate pop_fpscr. + * gcc/config/sh/sh.md : Add define_expand "push_fpscr", "pop_fpscr". + (fpu_switch): Add alternative to push fpscr. Enable for TARGET_SH3E. + +Fri Dec 6 19:36:24 2002 J"orn Rennecke + + * sh.c (dump_table): DImode pool constants need only 32 bit alignment. + DFmode alignment depends on TARGET_FMOVD && TARGET_ALIGN_DOUBLE. + +Fri Dec 6 19:17:49 2002 J"orn Rennecke + + * sh.md (movdi_i): Name. Remove inappropriate comment. + +Fri Dec 6 15:44:46 2002 J"orn Rennecke + Merged from basic improvements branch (excerpt): + + 2002-11-19 Kaz Kojima + * config/sh/sh.h (SH_DBX_REGISTER_NUMBER): Handle PR_MEDIA_REG. + +2002-12-06 Jakub Jelinek + + * expr.c (expand_expr) : Never modify exp in place. + +Thu Dec 5 16:58:25 CET 2002 Jan Hubicka + + * i386.md (dimode peep2s): Re-add "&& 1". + +Thu Dec 5 14:10:15 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_prologue): Add comment, do not use + fast prologues for cold and normal functions. + +Thu Dec 5 00:52:37 CET 2002 Jan Hubicka + + * i386.c (x86_rep_movl_optimal): New variable. + (ix86_expand_movstr, ix86_expand_clrstr): Use TARGET_REP_MOVL_OPTIMAL + * i386.h (TARGET_REP_MOVL_OPTIMAL): New macro. + + * i386.md (negsf2_ifs, negdf2_ifs, negdf2_ifs_rex64, abssf2_ifs, + absdf2_ifs, absdf2_ifs_rex64): Fix constraints. + neg?f2_ifs, abs?f2_ifs splitters): Refuse memory operand; do not + generate unnecesary subregs. + +2002-12-05 John David Anglin + + * pa32-linux.h (CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL): Move define. + * pa.h (CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL): To here. + +2002-12-05 Dale Johannesen + + * tree.c (unsafe_for_reeval): Consider callee child of CALL_EXPR. + +2002-12-05 Danny Smith + + * config/i386/cygwin.h (SUBTARGET_PROLOGUE): Replace with + PROFILE_HOOK. + * config/i386/mingw32.h (SUBTARGET_PROLOGUE): Don't undef. + +2002-12-05 Aldy Hernandez + + * config/rs6000/spe.h (__ev_mwlufi): Remove. + (__ev_mwlufia): Remove. + (__ev_mwlumfaaw): Remove. + (__ev_mwlusfaaw): Remove. + (__ev_mwlumfanw): Remove. + (__ev_mwlusfanw): Remove. + +2002-12-05 Kazu Hirata + + * config/h8300/h8300.md (*andorsi3_shift_8): New. + +2002-12-05 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_si): Optimize ashift:HI and + lshiftrt:SI by 28, 29, and 30 bits when !TARGET_H8300. + (get_shift_alg): Return optimal assembly instructions for the + shifts mentioned above. + +Wed Dec 4 11:53:07 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Force operand into register for QImode + condtiional moves. + +2002-12-04 Kazu Hirata + + * config/h8300/h8300.c (h8300_init_once): Do not use loop to + implement ashiftrt:HI by 13 bits on H8S. + +2002-12-04 John David Anglin + + * pa/fptr.c (__canonicalize_funcptr_for_compare): New file and function. + * pa.md (canonicalize_funcptr_for_compare): Output library call to + canonicalize_funcptr_for_compare_libfunc on TARGET_ELF32. + * pa32-linux.h (CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL, + CTOR_LIST_BEGIN): New defines. + * pa/t-linux (LIB2FUNCS_EXTRA): New define. + (fptr.c): Add make rules. + +2002-12-04 Geoffrey Keating + + * combine.c (combine_simplify_rtx): Add new canonicalizations. + * doc/md.texi (Insn Canonicalizations): Document new + canonicalizations for multiply/add combinations. + * config/rs6000/rs6000.md: Add and modify floating add/multiply + patterns to ensure they're used whenever they can be. + +2002-12-04 Kazu Hirata + + * config/h8300/h8300.c: Update the comments related to shifts. + +2002-12-04 Chris Demetriou + + * config/mips/mips.md (get_fnaddr): Correct length attribute. + +2002-12-04 Kazu Hirata + + * config/h8300/h8300.md (*extzv_8_8): New. + (*extzv_8_16): Likewise. + +2002-12-04 Jason Merrill + + PR c++/8461, c++/8625 + * integrate.c (copy_decl_for_inlining): Handle explicit invisible + references. + * tree-inline.c (initialize_inlined_parameters): Likewise. + + * tree.c (variably_modified_type_p): Just return an error_mark_node. + +2002-12-04 Chris Demetriou + + * config/mips/mips.md (get_fnaddr): Avoid placing an "la" + macro instruction in a branch delay slot, to avoid assembler + warnings. + +2002-12-04 Eric Botcazou + + PR c/7622 + * c-semantics (genrtl_scope_stmt): Do not output inlined + nested functions that contain no code. + +Wed Dec 4 15:20:54 CET 2002 Jan Hubicka + + * cfgrtl.c (force_nonfallthru_and_redirect): Allow abnormal edge + to be forced into nonfallthru. + +2002-12-03 Jason Thorpe + + * config/t-netbsd (USER_H): Set to $(EXTRA_HEADERS). + +2002-12-03 Aldy Hernandez + + * config/rs6000/spe.md (*movv1di_const0): New pattern. + +2002-12-03 Richard Henderson + + * libgcc-std.ver: Inherit GCC_3.3 from GCC_3.0. + +2002-12-03 Hans-Peter Nilsson + + * bitmap.c (bitmap_ior_and_compl, bitmap_union_of_diff): + Initialize tmp.using_obstack to 0. + +2002-12-03 Andreas Schwab + + * config/m68k/m68k.h (EH_RETURN_DATA_REGNO): Define. + (EH_RETURN_STACKADJ_RTX): Define. + (EH_RETURN_HANDLER_RTX): Define. + (ASM_PREFERRED_EH_DATA_FORMAT): Define. + * config/m68k/m68k.c (m68k_save_reg): New function. Handle eh + registers and don't save fixed registers. + (m68k_output_function_prologue): Use it. + (use_return_insn): Likewise. + (m68k_output_function_epilogue): Likewise. + +2002-12-03 Kazu Hirata + + * config/h8300/h8300.c (single_one_operand): Fix a warning. + (single_zero_operand): Likewise. + +2002-12-02 Nathanael Nerode + + * Makefile.in configure configure.in dummy-conditions.c fix-header.c + gcov-iov.c gen-protos.c genattr.c genattrtab.c genautomata.c + gencheck.c gencodes.c genconditions.c genconfig.c genconstants.c + genemit.c genextract.c genflags.c gengenrtl.c gengtype-lex.l + gengtype-yacc.y gengtype.c genopinit.c genoutput.c genpeep.c + genpreds.c genrecog.c gensupport.c mkconfig.sh read-rtl.c + scan-decls.c scan.c config/sh/sh.h doc/configfiles.texi + doc/install-old.texi: Replace hconfig.h with bconfig.h. + * Makefile.in: Replace HCONFIG_H with BCONFIG_H. + +2002-12-02 Andrew Pinski + + * config/rs6000/rs6000.md (ffssi): Convert to expander. + (ffsdi): Likewise. + (cntlzw2, cntlzd2): New patterns. + +2002-12-02 H.J. Lu + + * config.gcc (mips*-*-netbsd*): Remove mips/t-netbsd. + (mips*-*-linux*): Remove mips/t-linux. + +Mon Dec 2 19:26:30 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Avoid overflow. + +2002-12-02 Kazu Hirata + + * config/h8300/h8300.c (dosize): Replace argument op with + sign. + (h8300_output_function_prologue): Update the call to dosize. + (h8300_output_function_epilogue): Likewise. + +2002-12-02 Bob Wilson + + * config/xtensa/xtensa.h: Delete ifndefs with nothing inside them. + +2002-12-02 Craig Rodrigues + + * configure.in: Use "missing" script to generate warning if + flex or bison programs not found, instead of invoking "false". + * configure: Rebuilt. + +Mon Dec 2 20:28:48 CET 2002 Jan Hubicka + + * unroll.c (copy_loop_body): Copy CONST_OR_PURE_CALL_P. + +Mon Dec 2 19:42:52 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Avoid overflow. + +2002-12-02 Kazu Hirata + + * config/h8300/h8300.c (dosize): Output r7/er7 instead of sp. + (push): Likewise. + (pop): Likewise. + (h8300_output_function_prologue): Likewise. + (h8300_output_function_epilogue): Likewise. + +Mon Dec 2 14:43:22 2002 J"orn Rennecke + + * expmed.c (store_bit_field): Use int_mode_for_mode to find + corresponding mode of non-integer mode, unless it is VOIDmode. + +2002-12-02 Kazu Hirata + + * config/h8300/h8300.md (stm_h8300s_2): New. + (stm_h8300s_3): Likewise. + (stm_h8300s_4): Likewise. + (five define_peephole2): Likewise. + +2002-12-02 Kazu Hirata + + * ra-build.c: Fix a comment typo. + +Sun Dec 1 16:50:47 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): fix + reversed BRANCH_COST test; be curefull about infinite recursion. + +2002-12-01 Kazu Hirata + + * config/h8300/h8300.c (h8300_output_function_prologue): + Remove variable idx. + (h8300_output_function_epilogue): Likewise. + +2002-12-01 Zack Weinberg + + * config/frv/xm-frv.h: Delete, unnecessary. + +2002-12-01 Kazu Hirata + + * config/h8300/h8300.md: Add comments for define_peephole2. + +2002-12-01 Mark Mitchell + + * builtin-types.def (BT_SIZE): Use size_type_node. + * builtins.c (fold_builtin): Make the builtin strlen returns a + size_t, not a sizetype. + * c-common.c (c_sizeof_or_alignof_type): Use size_type_node, not + c_size_type_node. + (c_alignof_expr): Likewise. + (c_common_nodes_and_builtins): Likewise. + * c-common.h (CTI_C_SIZE_TYPE): Remove. + (c_size_type_node): Likewise. + * c-format.c (T_ST): Use size_type_node, not c_size_type_node. + * tree.h (TI_SIZE_TYPE): New enumeral. + (size_type_node): Likewise. + +2002-11-30 Zack Weinberg + + * configure.in: Don't put ${tm_file} into host_xm_file, + build_xm_file, or xm_file. Do put tm-preds.h into tm_p_file. + Take location of tm-preds.h into account when calculating + tm_p_file_list. + * configure: Regenerate. + * mkconfig.sh: No need for separate TM_DEFINES and XM_DEFINES + arguments. Do not provide rtx, rtvec, tree, or GTY here. + Remove special case code for tm_p.h and *config.h; add new + special case code for tm.h and tconfig.h. Clean up a bit. + + * Makefile.in (tm_file, tm_file_list): New variables set from + @-substitutions. + (GCONFIG_H): Deleted. + (GTM_H, TM_H): New. + (CONFIG_H): Is now just config.h $(host_xm_file_list). + (TM_P_H): Move up with the other mkconfig.sh-generated + headers; don't mention tm-preds.h explicitly. + (tm.h, cs-tm.h): New rule. + (cs-config.h, cs-hconfig.h, cs-tconfig.h, cs-tm_p.h): Adjust + invocations of mkconfig.sh for changes to that program. + (mostlyclean): Delete print-rtl1.c. + (clean): Delete tm.h. + Update dependencies for the files listed below. + + * mklibgcc.in: Add 'coretypes.h $(TM_H)' to libgcc2_c_dep. + + * coretypes.h: New file. + * system.h: #define malloc to xmalloc and realloc to xrealloc + when FLEX_SCANNER or YYBISON is defined, independent of the + value of GCC_VERSION. + * alias.c, attribs.c, bb-reorder.c, bitmap.c, builtins.c, + c-aux-info.c, c-common.c, c-convert.c, c-decl.c, c-dump.c, + c-errors.c, c-format.c, c-lang.c, c-lex.c, c-objc-common.c, + c-opts.c, c-parse.in, c-pragma.c, c-pretty-print.c, + c-semantics.c, c-typeck.c, caller-save.c, calls.c, cfg.c, + cfganal.c, cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, + cfgrtl.c, collect2.c, combine.c, conflict.c, convert.c, + cppdefault.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, + cppinit.c, cpplex.c, cpplib.c, cppmacro.c, cppmain.c, + cppspec.c, cpptrad.c, crtstuff.c, cse.c, cselib.c, dbxout.c, + debug.c, df.c, diagnostic.c, doloop.c, dominance.c, + dummy-conditions.c, dwarf2asm.c, dwarf2out.c, dwarfout.c, + emit-rtl.c, errors.c, et-forest.c, except.c, explow.c, + expmed.c, expr.c, final.c, fix-header.c, flow.c, fold-const.c, + function.c, gcc.c, gccspec.c, gcov-dump.c, gcov-iov.c, gcov.c, + gcse.c, gen-protos.c, genattr.c, genattrtab.c, genautomata.c, + gencheck.c, gencodes.c, genconditions.c, genconfig.c, + genconstants.c, genemit.c, genextract.c, genflags.c, + gengenrtl.c, gengtype-lex.l, gengtype-yacc.y, gengtype.c, + genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, + gensupport.c, ggc-common.c, ggc-none.c, ggc-page.c, + ggc-simple.c, global.c, graph.c, haifa-sched.c, hashtable.c, + hooks.c, ifcvt.c, integrate.c, intl.c, jump.c, langhooks.c, + lcm.c, libgcc2.c, line-map.c, lists.c, local-alloc.c, loop.c, + main.c, mbchar.c, mips-tdump.c, mips-tfile.c, mkdeps.c, + optabs.c, params.c, predict.c, prefix.c, print-rtl.c, + print-tree.c, profile.c, protoize.c, ra-build.c, + ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, read-rtl.c, + real.c, recog.c, reg-stack.c, regclass.c, regmove.c, + regrename.c, reload.c, reload1.c, reorg.c, resource.c, + rtl-error.c, rtl.c, rtlanal.c, sbitmap.c, scan-decls.c, + scan.c, sched-deps.c, sched-ebb.c, sched-rgn.c, sched-vis.c, + sdbout.c, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, + ssa.c, stmt.c, stor-layout.c, stringpool.c, timevar.c, + tlink.c, toplev.c, tracer.c, tree-dump.c, tree-inline.c, + tree.c, unroll.c, varasm.c, varray.c, varray.h, vmsdbgout.c, + xcoffout.c, config/darwin-c.c, config/darwin.c, + config/fp-bit.c, config/alpha/alpha.c, config/alpha/vms-cc.c, + config/alpha/vms-ld.c, config/arc/arc.c, config/arm/arm.c, + config/arm/pe.c, config/avr/avr.c, config/c4x/c4x-c.c, + config/c4x/c4x.c, config/cris/cris.c, config/d30v/d30v.c, + config/dsp16xx/dsp16xx.c, config/fr30/fr30.c, + config/frv/frv.c, config/h8300/h8300.c, config/i370/i370-c.c, + config/i370/i370.c, config/i386/i386.c, config/i386/winnt.c, + config/i960/i960-c.c, config/i960/i960.c, + config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, + config/m32r/m32r.c, config/m68hc11/m68hc11.c, + config/m68k/m68k.c, config/m88k/m88k.c, config/mcore/mcore.c, + config/mips/irix6-libc-compat.c, config/mips/mips.c, + config/mmix/mmix.c, config/mn10200/mn10200.c, + config/mn10300/mn10300.c, config/ns32k/ns32k.c, + config/pa/pa.c, config/pdp11/pdp11.c, config/romp/romp.c, + config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, + config/s390/s390.c, config/sh/sh.c, config/sparc/gmon-sol2.c, + config/sparc/sparc.c, config/stormy16/stormy16.c, + config/v850/v850-c.c, config/v850/v850.c, config/vax/vax.c, + config/xtensa/xtensa.c, objc/objc-act.c, objc/objc-lang.c: + Include coretypes.h and tm.h. + + * genattrtab.c, genconditions.c, genemit.c, genextract.c, + gengenrtl.c, gengtype.c, genopinit.c, genoutput.c, genpeep.c, + genrecog.c: Include coretypes.h and tm.h from the file + generated by this program. + + * unwind-dw2-fde-darwin.c, unwind-dw2-fde-glibc.c, + unwind-dw2-fde.c, unwind-dw2.c, unwind-sjlj.c: Include + coretypes.h and tm.h, and tsystem.h when not already included. + No need to include stddef.h nor stdlib.h. + + * fixinc/fixlib.h: Include coretypes.h and tm.h. Do not + include auto-host.h or ansidecl.h/ + * fixinc/server.h: Do not include stdio.h, unistd.h, or fixlib.h. + * fixinc/procopen.c: Include server.h after fixlib.h. Do not + include auto-host.h, ansidecl.h, or system.h. + * fixinc/server.c: Likewise. Also, do not include signal.h, + and do not redefine volatile. + +Sat Nov 30 17:16:46 CET 2002 Jan Hubicka + + * i386.md (movdf_integer): Always enable in 64bit. + (movdf_nointeger): Always disable in 64bit. + +2002-11-30 John David Anglin + + * cfg.c (dump_flow_info): Use max_reg_num () to determine the largest + pseudo register number plus 1. + +Fri Nov 29 20:10:56 2002 J"orn Rennecke + + * expmed.c (store_bit_field): Use int_mode_for_mode to find + corresponding mode of non-integer mode, unless it is VOIDmode. + +2002-11-29 Hans-Peter Nilsson + + * cpplib.c (_cpp_test_assertion): Default *value to 0. + + * cppexp.c (num_part_mul): Initialize result.unsignedp, to 1. + +2002-11-29 Ulrich Weigand + + * config/s390/t-crtstuff: New target makefile fragment. + * config.gcc [s390-*-linux, s390x-*-linux]: Use it. + +2002-11-29 Kazu Hirata + + * config/h8300/h8300.md (movsi_h8300hs): Change the order of + alternatives to correct the length when the memory operand is + either pre_dec or post_inc. + +2002-11-29 Kazu Hirata + + * config/h8300/h8300.md (an anonymous pattern): Give an + internal name *tst_extzv_bitqi_1_n. + Accept bit_operand instead of bit_memory_operand. + Do not accept bit tests with the MSB. + (*tst_extzv_memqi_1_n): New. + +Thu Nov 28 23:56:24 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Add copy_rtx to avoid invalid RTX + sharing when operand is SUBREG. + +Thu Nov 28 08:57:26 CET 2002 Jan Hubicka + + * athlon.md (athlon-decodev): New reservation unit. + (athlon-direct0): New reservation. + (athlon-vector): New use athlon-decodev. + (athlon-double, athlon-direct): Better model. + (athlon_imul_k8): Use athlon-direct0. + (athlon_movlpd_load): New insn reservation. + +2002-11-28 Kazu Hirata + + * config/h8300/h8300.c (h8300_eightbit_constant_address_p): + Fix a comment typo. + (h8300_tiny_constant_address_p): Likewise. + +2002-11-28 Michael Matz + + * doc/passes.texi: Mention the other register allocator. + +2002-11-28 Kazu Hirata + + * config/h8300/h8300.md (6 new peephole2 patterns): New. + +2002-11-28 Jakub Jelinek + + * config.gcc (x86_64-*-linux*) [tmake_file]: Remove i386/t-crtstuff. + * config/t-linux (CRTSTUFF_T_CFLAGS_S): Add $(CRTSTUFF_T_CFLAGS). + * config/i386/t-linux64 (CRTSTUFF_T_CFLAGS): Define. + +2002-11-28 Kazu Hirata + + * config/h8300/h8300.c (h8300_and_costs): New. + * config/h8300/h8300.h (RTX_COSTS): Use h8300_and_costs. + * config/h8300/h8300-protos.h: Add a prototype for + h8300_and_costs. + +Wed Nov 27 20:34:13 CET 2002 Jan Hubicka + + * i386.c (x86_sse_partial_regs_for_cvtsd2ss): New. + * i386.h (x86_sse_partial_regs_for_cvtsd2ss): Declare. + (TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS): New macro. + * i386.md (truncdfsf patterns and splitters): Use + TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS + +2002-11-27 Zack Weinberg + + * config/rs6000/rs6000.c (altivec_init_builtins): Make the + pointer argument in the prototypes of the following builtins + be (const TYPE *) rather than (TYPE *): + + __builtin_altivec_ld_internal_4sf + + __builtin_altivec_ld_internal_4si + + __builtin_altivec_ld_internal_8hi + + __builtin_altivec_ld_internal_16qi + + __builtin_altivec_lvsl + + __builtin_altivec_lvsr + + __builtin_altivec_lvebx + + __builtin_altivec_lvehx + + __builtin_altivec_lvewx + + __builtin_altivec_lvxl + + __builtin_altivec_lvx + + __builtin_altivec_dst + + __builtin_altivec_dstt + + __builtin_altivec_dstst + + __builtin_altivec_dststt + +2002-11-27 Kaveh R. Ghazi + + * except.c (default_exception_section): Move variable into the + scope where it is used. + +2002-11-27 Krister Walfridsson + + * config.gcc (*-*-netbsd[2-9]*, *-*-netbsdelf[2-9]*): Test for + correct version. + +2002-11-27 Kazu Hirata + + * config/h8300/h8300.h (OK_FOR_U): Remove extra parentheses. + +2002-11-27 Kazu Hirata + + * config/h8300/h8300.c (h8300_shift_costs): New. + * config/h8300/h8300.h (RTX_COSTS): Use h8300_shift_costs. + * config/h8300/h8300-protos.h: Add a prototype for + h8300_shift_costs. + +2002-11-27 Jim Wilson + + * config/rs6000/spe.md (spu_evsplatfi, spu_evsplati): Swap operands + in output template. + +2002-11-27 Casper S. Hornstrup + + * config/i386/i386.h (DLL_IMPORT_EXPORT_PREFIX): Define. + * config/i386/winnt.c (i386_pe_dllexport_name_p): Use + DLL_IMPORT_EXPORT_PREFIX, not '@'. + (i386_pe_dllimport_name_p): Likewise. + (i386_pe_mark_dllexport): Likewise. + (i386_pe_mark_dllimport): Likewise. + (i386_pe_encode_section_info): Likewise. + (i386_pe_strip_name_encoding): Likewise. + +2002-11-27 Richard Henderson + + * mkmap-symver.awk (BEGIN): Set sawsymbol false. + (nm && NF == 3): Set sawsymbol true. + (END): Exit if no symbols seen. + (output): Fix map syntax error if no globals for the version. + +Wed Nov 27 14:45:46 CET 2002 Jan Hubicka + + * builtins.def (DEF_C99_BUILTIN): Fix. + +2002-11-26 Kaz Kojima + + * config/sh/lib1funcs.asm (FUNC, ENDFUNC0, ENDFUNC): New macros. + (all): Add .size and .type information. + +Tue Nov 26 22:43:50 CET 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Do not emit lea for short mode on + partial_reg_stall target. + +Tue Nov 26 22:27:47 CET 2002 Jan Hubicka + + * i386.md (movhicc): Allow general operand. + (movqicc): New expander. + (movqicc_noc): New pattern. + * i386.c (ix86_expand_carry_flag_compare): New function. + (ix86_expand_int_movcc): Optimize harder using sbb; support more + HImode conversion; support QImode conditional moves + +Tue Nov 26 16:30:59 CET 2002 Jan Hubicka + + * i386.c (FAST_PROLOGUE_INSN_COUNT): Set to 20. + (ix86_expand_prologue): Multiply the count by amount of registers to be + pushed. + +Tue Nov 26 15:55:27 CET 2002 Jan Hubicka + + * i386.c (override_options): Error about wrong -mcpu on x86-64 + compilation. + +2002-11-26 NIIBE Yutaka + + * config/sh/linux.h (FUNCTION_PROFILER): Implemented. + +Tue Nov 26 00:14:20 CET 2002 Jan Hubicka + + * i386-protos.h (x86_extended_QIreg_mentioned_p, + x86_extended_reg_mentioned_p): Declare. + * i386.c (extended_reg_mentioned_1): New static function. + (x86_extended_QIreg_mentioned_p, + x86_extended_reg_mentioned_p): New global functions. + * i386.h (REX_SSE_REGNO_P): New macro. + * i386.md (prefix_rex): New attribute. + (length attribute): Add rex. + +2002-11-26 Andrew Haley + + * unwind-sjlj.c (_Unwind_FindEnclosingFunction): Rename + from_Unwind_Find_Enclosing_Function. + * unwind-dw2.c (_Unwind_FindEnclosingFunction): Likewise. + * config/ia64/unwind-ia64.c (_Unwind_FindEnclosingFunction): Likewise. + * libgcc-std.ver (_Unwind_FindEnclosingFunction): Rename from + _Unwind_Find_Enclosing_Function, export @@GCC_3.3. + * unwind.h (_Unwind_FindEnclosingFunction): Add. + +2002-11-26 Hartmut Penner + + * config/s390/s390.c (390_output_constant_pool): Set alignment + before label in 64 bit mode, behind otherwise. + +2002-11-26 Richard Henderson + + * c-common.c (handle_visibility_attribute): Accept "default". + * tree.h (enum symbol_visibility): New. + (decl_visibility): Declare. + * target.h (gcc_target.visibility): Take visibility arg as integer. + * varasm.c (default_assemble_visibility): Likewise. + (decl_visibility): New. + (maybe_assemble_visibility): Use it. + * output.h (default_assemble_visibility): Update prototype. + * config/rs6000/rs6000.c (rs6000_assemble_visibility): Take + visibility arg as integer. + * doc/extend.texi: Document default visibility. + +2002-11-26 Kazu Hirata + + * config/h8300/h8300.c: Adjust spacing. + * config/h8300/h8300.h: Likewise. + +2002-11-26 Richard Henderson + + * hooks.c (hook_bool_void_false, hook_void_tree_int, + hook_void_FILEptr_constcharptr): Rename so that the return + type is first. + (hook_int_tree_tree_1, hook_void_tree, hook_void_tree_treeptr, + hook_bool_tree_false): New. + * hooks.h: Update. + * langhooks-def.h: Update for renames. + * target-def.h: Likewise. + * tree.c (default_comp_type_attributes, + default_set_default_type_attributes, default_insert_attributes, + default_function_attribute_inlinable_p, + default_ms_bitfield_layout_p): Remove. + * tree.h: Update. + +2002-11-26 John David Anglin + + * pa-protos.h (function_value): New prototype. + * pa.c (function_value): Use a PARALLEL to return small aggregates on + TARGET_64BIT. + * pa.h (FUNCTION_VALUE): Use function_value. + * pa.md (call_value_internal_symref, call_value_internal_reg_64bit, + call_value_internal_reg, sibcall_value_internal_symref, + sibcall_value_internal_symref_64bit): Remove =rf constraint on return + value. + +2002-11-26 John David Anglin + + * expr.c (gen_group_rtx, emit_group_move): New functions. + * expr.h (gen_group_rtx, emit_group_move): Prototype. + * function.c (expand_function_start): Use gen_group_rtx to create a + PARALLEL rtx to hold the return value when the real return rtx is a + PARALLEL. + (expand_function_end): Use emit_group_move to move the return value + from a PARALLEL to the real return registers. + * rtl.h (REG_FUNCTION_VALUE_P): Allow function values to be returned + in PARALLELs. + +2002-11-26 Jason Thorpe + + * config/t-libc-ok: Fix typo. + +2002-11-26 Jakub Jelinek + + * configure.in: Move AC_CANONICAL_SYSTEM and AC_ARG_PROGRAM back + before AC_PROG_CC. + * configure: Rebuilt. + +2002-11-26 Nathan Sidwell + + * c-decl.c: (start_struct): Commonize flag setting. + +2002-11-26 Jason Thorpe + + * config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Use + RS6000_CPU_CPP_ENDIAN_BUILTINS. + * config/rs6000/netbsd.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): Redefine. + +2002-11-26 Hartmut Penner + + * config/s390/s390.md (literal_pool_64, literal_pool_31 ): New + insns. + * config/s390/s390.c (struct machine_function): Introduction of + struct machine_function. + (s390_output_symbolic_const): Use of cfun. + (s390_optimize_prolog): Likewise. + (s390_fixup_clobbered_return_reg): Likewise. + (s390_frame_info): Likewise. + (s390_emit_prologue, s390_emit_epilogue): Likewise. + (s390_init_machine_status): New function. + (override_options): call s390_init_machine_status. + * config/s390/s390-protos.h (s390_output_constant_pool): Changed + prototype. + +2002-11-26 Jakub Jelinek + + * varasm.c (output_constant_pool): For pool constants in mergeable + section ensure each constant is padded to multiple of entity size. + +2002-11-26 Jakub Jelinek + + * varasm.c (default_exception_section): Move to... + * except.c (default_exception_section): ... here. Make + .gcc_except_table read-only if it is not expected to have any + dynamic relocations and linker handles it. + * dwarf2out.c (default_eh_frame_section): Make .eh_frame read-only + if it is not expected to have any dynamic relocations and linker + handles it. + * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Check what ld does + when linking read-only and read-write sections together. + * configure, config.in: Rebuilt. + * crtstuff.c (EH_FRAME_SECTION_CONST): Define. + (__EH_FRAME_BEGIN__, __FRAME_END__): Add it. + +Mon Nov 25 18:32:37 CET 2002 Jan Hubicka + + * i386.md (pushsf_rex64): Fix typo. + +2002-11-25 Aldy Hernandez + + * config/rs6000/spe.h (__ev_create_sfix32_fs): Change macro into + new function. + (__ev_create_ufix32_fs): Same. + (__ev_get_sfix32_fs_internal): New. + (__ev_get_sfix32_fs): Define to use function. + (__ev_get_ufix32_fs_internal): New. + (__ev_get_ufix32_fs): Define to use function. + (__ev_get_upper_ufix32_fs): Call __ev_get_ufix32_fs. + (__ev_get_lower_ufix32_fs): Same. + (__ev_get_upper_sfix32_fs): Call __ev_get_sfix32_fs. + (__ev_get_lower_sfix32_fs): Same. + (__ev_set_sfix32_fs_internal): New. + (__ev_set_ufix32_fs_internal): New. + (__ev_set_sfix32_fs): Call __ev_set_sfix32_fs_internal. + (__ev_set_ufix32_fs): Call __ev_set_ufix32_fs_internal. + (__ev_set_upper_sfix32_fs): Call function. + (__ev_set_lower_sfix32_fs): Same. + (__ev_set_upper_ufix32_fs): Same. + (__ev_set_lower_ufix32_fs): Same. + +2002-11-25 Douglas B Rupp + + * gcc.c (do_spec_1): Reset delete_this_arg to zero. + +2002-11-25 Jason Thorpe + + * config/elfos.h (HANDLE_SYSV_PRAGMA): Define as 1. + * config/interix.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/linux-aout.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/lynx-ng.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/lynx.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/netbsd.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/openbsd.h (HANDLE_SYSV_PRAGMA: Likewise. + * config/alpha/elf.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/arm/netbsd.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/cris/aout.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/d30v/d30v.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/frv/frv.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/i386/djgpp.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/i386/i386-interix.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/i386/vxi386.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/ia64/ia64.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/m88k/m88k.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/mmix/mmix.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/rs6000/aix.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/rs6000/darwin.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/sparc/linux-aout.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/sparc/vxsparc64.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/stormy16/stormy16.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/alpha/osf.h (HANDLE_SYSV_PRAGMA): Don't undef before + defining. + * config/i386/sco5.h (HANDLE_SYSV_PRAGMA): Likewise. + * config/mips/iris5.h (HANDLE_SYSV_PRAGMA): Likewise. + +2002-11-25 Dave Pitts + + * gcc/fixinc/mkfixinc.sh: add i370-*-openedition to bypass fixinc list + +2002-11-25 Kazu Hirata + + * config/h8300/h8300.md (an anonymous pattern): New. + +2002-11-25 Richard Henderson + + * alias.c (find_base_value): Use new_reg_base_value if it's live. + (copying_arguments): Make boolean. + +2002-11-25 Jason Thorpe + + * gcc.c (static_spec_functions): Add if-exists-else spec + function. + (if_exists_else_spec_function): New function. + * doc/invoke.texi: Document the if-exists-else spec function. + + * config/netbsd-elf.h (NETBSD_STARTFILE_SPEC): For -static, use + "%:if-exists-else(crtbeginT%O%s crtbegin%O%s)". + +2002-11-25 Jason Thorpe + + * config.gcc (powerpc-*-netbsd*): Replace "svr4.h" with + "netbsd.h netbsd-elf.h" in tm_file. Set tmake_file to + "${tmake_file} rs6000/t-netbsd". + * config/rs6000/netbsd.h: Rewrite. + * config/rs6000/t-netbsd: New file. + +2002-11-25 Kazu Hirata + + * config/h8300/h8300.md (an anonymous pattern): Relax the + condition for the pattern. + +2002-11-25 Aldy Hernandez + + * config/rs6000/rs6000.h (enum rs6000_builtins): Remove evmwlssf, + evmwlsmf, evmwlssfa, evmwlsmfa, evmwlssfaaw, evmwlsmfaaw, + evmwlssfanw, evmwlsmfanw. + + * config/rs6000/rs6000.c (bdesc_2arg): Same. + + * config/rs6000/spe.md: Same for patterns. + +2002-11-25 Christian Ehrhardt + + PR c/8639 + * fold-const.c (extract_muldiv): Don't propagate division unless + both arguments are multiples of C. + +2002-11-25 Andrew Haley + + * libgcc-std.ver (_Unwind_Find_Enclosing_Function): Add. + * config/ia64/unwind-ia64.c (_Unwind_Find_Enclosing_Function): New. + * unwind-sjlj.c (_Unwind_Find_Enclosing_Function): Likewise. + * unwind-dw2.c (_Unwind_Find_Enclosing_Function): Likewise. + +Sun Nov 24 10:38:04 CET 2002 Jan Hubicka + + * i386.c (x86_use_ffreep): New global variable. + * i386.h (x86_use_frfeep): Declare + (TARGET_USE_FFREEP): New macro + * i386.md (movs?f*): Use freep when asked for. + (push?f): Remove dead code. + +2002-11-24 Kazu Hirata + + * config/h8300/h8300.c (h8300_init_once): Fix a typo in the + target help message. + +2002-11-24 Jason Thorpe + + * config.gcc (*-*-netbsd*1.[7-9]*, *-*-netbsd*[2-9]*): Set + extra_parts to "crtbegin.o crtend.o crtbeginS.o crtendS.o + crtbeginT.o". + (arm*-*-netbsd*, i[34567]86-*-netbsd*, m68k*-*-netbsd*) + (ns32k-*-netbsd*, sparc-*-netbsd*, vax-*-netbsd*): Set extra_parts + to "" for a.out configurations. + * config/t-netbsd (CRTSTUFF_T_CFLAGS): Set to "-fPIC". + +2002-11-24 Jason Thorpe + + * config/alpha/netbsd.h (CPP_SUBTARGET_SPEC): Just use + NETBSD_CPP_SPEC directly. + (SUBTARGET_EXTRA_SPECS): Remove netbsd_cpp_spec. Add + netbsd_endfile_spec. + (ENDFILE_SPEC): Use %(netbsd_endfile_spec). + +2002-11-24 Jason Thorpe + + * config/netbsd-elf.h (STARTFILE_SPEC): Rename to + NETBSD_STARTFILE_SPEC. + (STARTFILE_SPEC): Redefine in terms of NETBSD_STARTFILE_SPEC. + (ENDFILE_SPEC): Likewise. + * config/netbsd.h (LIB_SPEC, LIBGCC_SPEC): Likewise. + +2002-11-24 Andreas Schwab + + * Makefile.in (install-driver): Remove versioned link before + trying to create it. + + * config/m68k/m68k.c: Fix typo in last change defining + TARGET_ASM_CAN_OUTPUT_MI_THUNK. + +2002-11-23 H.J. Lu + + * aclocal.m4: Include ../config/accross.m4. + (gcc_AC_COMPILE_CHECK_SIZEOF): Removed. + (gcc_AC_C_COMPILE_ENDIAN): Removed. + (gcc_AC_C_FLOAT_FORMAT): Check $ac_cv_c_bigendian + instead of $ac_cv_c_compile_endian. + + * configure.in: Replace gcc_AC_COMPILE_CHECK_SIZEOF with + AC_COMPILE_CHECK_SIZEOF. + Replace gcc_AC_C_COMPILE_ENDIAN with AC_C_BIGENDIAN_CROSS. + * configure: Rebuild. + +2002-11-23 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Update the use of + h8300_tiny_constant_address_p. + (h8300_adjust_insn_length): Likewise. + (h8300_tiny_constant_address_p): Check if the given rtx is a + variable declared with __attribute__ ((tiny_data)). + +2002-11-22 Dale Johannesen + + * toplev.c (rest_of_compilation): Fix comments. + +2002-11-22 Geoffrey Keating + + * aclocal.m4 (ac_cv_func_mmap_dev_zero): Darwin does not + allow mmap from /dev/zero. Don't make decisions for the host + based on presence or absence of /dev/zero on the build machine. + (ac_cv_func_mmap_anon): Darwin does have working MMAP_ANON. + (AC_FUNC_MMAP_FILE): Darwin does have mmap of a file. + * configure: Regenerate. + +2002-11-22 Daniel Jacobowitz + + * gcc.c (make_relative_prefix, split_directories) + (free_split_directories): Removed. + +2002-11-22 Daniel Jacobowitz + + * configure.in: Set insn=nop for DWARF-2 tests on ARM. + * configure: Regenerated. + +2002-11-22 Kazu Hirata + + * config/h8300/h8300.c (compute_a_shift_length): Fix the insn + length computation when xor.l is output. + +2002-11-21 Douglas B Rupp + + * alpha.md (movstrdi, clrstrdi): New VMS patterns. + (call_vms_1, call_value_vms_1): Cleanup syntax. + +Thu Nov 21 19:20:27 CET 2002 Jan Hubicka + + * athlon.md (define_atuomaton): Add athlon_load. + (athlon-double): New reservation. + (athlon-ieu0): New CPU unit. + (athlon-load?): Use athlon_load automaton. + (*_k8 reservations): New. + (other insn revervations): Activate for K8. + +Thu Nov 21 15:07:42 CET 2002 Jan Hubicka + + * cfgrtl.c (verify_flow_info): Accept EDGE_CAN_FALLTHRU flag. + +2002-11-21 Jim Wilson + + * config/rs6000/rs6000.c (function_arg): Set inner mode of SPE + vectors to SI. + +2002-11-21 Bob Wilson + + * config/xtensa/xtensa-protos.h (xtensa_copy_incoming_a7): Declare. + * config/xtensa/xtensa.c (struct machine_function): Add + incoming_a7_copied flag. + (xtensa_copy_incoming_a7): Define. + (xtensa_emit_move_sequence): Use xtensa_copy_incoming_a7. + * config/xtensa/xtensa.md (movdi, movsf, movdf): Ditto. + +Thu Nov 21 23:52:04 CET 2002 Jan Hubicka + + * i386-protos.h (x86_64_sign_extended_value): Fix prototype. + * i386.c (x86_64_general_operand, x86_64_szext_general_operand, + x86_64_nonmemory_operand, x86_64_movabs_operand, + x86_64_szext_nonmemory_operand, x86_64_immediate_operand, + ix86_expand_int_movcc): Update call of x86_64_sign_extended_value. + (local_symbolic_operand): Do not care the 64bit limits. + (x86_64_sign_extended_value): Remove allow_rip support. + (legitimate_pic_address_disp_p): Handle all cases allowed + with RIP addressing. + (legitimate_address_p): Use legitimate_pic_address_disp_p for PIC. + (legitimize_pic_address): Reorganize. + * i386.h (EXTRA_CONSTRAINT): Update call of x86_64_sign_extended_value. + +2002-11-21 Jason Thorpe + + * config.gcc (arm*-*-netbsdelf*): Enable configuration. + * config/arm/netbsd-elf.h: New file. + +2002-11-21 Jason Thorpe + + * config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add + subtarget_asm_float_spec. + (SUBTARGET_ASM_FLOAT_SPEC): Define, moving the + defaults from... + (ASM_SPEC): ...here. Use subtarget_asm_float_spec. + +2002-11-21 Nick Clifton + + * config/fr30/fr30.md (movsf_constant_store): Move code to + detect 0.0 into fr30.c. + * config/fr30/fr30-protos.h (fr30_const_double_is_zero): + Prototype. + * config/fr30/fr30.c (fr30_const_double_is_zero): New + function. Return true if the rtx is 0.0. + +2002-11-21 Jason Thorpe + + * config/arm/elf.h (ASM_SPEC, LINK_SPEC): Pass -EL + if -mlittle-endian is specified. + +2002-11-21 Richard Earnshaw + + PR optimization/2903 + * arm.md (anddi_notzesidi_di): Operand 2 is inverted not operand 1. + (anddi_notsesidi_di): Likewise. + +2002-11-21 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Use + h8300_eightbit_constant_address_p and + h8300_tiny_constant_address_p. + (h8300_adjust_insn_length): Likewise. + * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Remove. + (TINY_CONSTANT_ADDRESS_P): Likewise. + (OK_FOR_U): Use eightbit_constant_address_p. + +2002-11-21 Ulrich Weigand + + * config/s390/libgcc-libc.ver: Add multilib support. + * config/s390/linux.h (MULTILIB_DEFAULT): Define. + * config/s390/t-linux64 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES, + MULTILIB_OSDIRNAMES, LIBGCC, INSTALL_LIBGCC, + EXTRA_MULTILIB_PARTS): Define. + +2002-11-21 Richard Earnshaw + + * arm.c (arm_get_frame_size): A leaf function does not need its + stack padding to an aligned boundary if it has no frame. + (thumb_get_frame_size): Likewise. + +Wed Nov 20 22:25:53 CET 2002 Jan Hubicka + + * x86-64.h (MCOUNT_NAME): Fix typo in my previous patch. + (override_options): Likewise. + +Wed Nov 20 19:07:17 CET 2002 Jan Hubicka + + * config.gcc: Add k8 target alias support + * i386.c (_cost): Declare costs for various variants of divides and + multiplies. + (k8_cost): New. + (m_K8, m_ATHLON_K8): New macros. + (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen, + x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_fiop, + x86_promote_QImode, x86_sub_esp_?, x86_add_esp_?, + x86_integer_DFmode_moves, x86_partial_reg_dependency, + x86_memory_mismatch_stall, x86_accumulate_outgoing_args, + x86_prologue_using_move, x86_epilogue_using_move, + x86_arch_always_fancy_math_387, x86_sse_partial_regs, + x86_sse_typeless_stores): Set for K8 + (override_options): Add k8 support; fix athlon alignment; + complain about non-x86-64 capable CPU being used in x86-64 compilation. + (ix86_issue_rate): Set for K8. + (ix86_adjust_cost, ia32_use_dfa_pipeline_interface, + x86_machine_dependent_reorg): Handle K8 like + * i386.h + (x86_costs): Change mult_init and divide into array. + (TARGET_K8, TARGET_ATHLON): New macros. + (MODE_INDEX): New macro. + (RTX_COST): Use new costs. + (TARGET_CPU_CPP_BUILTINS): Define __k8__ and __tune_k8__. + (TARGET_CPU_DEFAULT_NAMES): Add k8 + (TARGET_CPU_DEFAULT_k8): New constant + (enum processor_type): Add PROCESSOR_K8. + * i386.md (cpu attribute): Add k8. + + * invoke.texi: Document -march=k8. + + * i386.md (type attribute): Add leave + (mode attribute): Remove unknownfp. + (length_immediate, modrm, memory attributes): Handle leave correctly. + (fp comparison patterns): Determine FP mode. + (leave, leave_rex64): Remove special cases. + * ppro.md (ppro_uops, ppro_p2): Add leave + * pentiun.md (pent_pop): Handle leave too. + * k6.md (k6_load): Handle leave. + * athlon.md (athlon_leave, athlon_pop): Fix. + (athlon_decode): Handle leave. + +2002-11-20 Steve Ellcey + + * emit-rtl.c (gen_reg_rtx): Simplify mapping of Complex type + to component type using GET_MODE_INNER. + * expr.c (emit_move_insn_1): Ditto. + * optabs.c (expand_binop): Ditto. + (expand_unop): Ditto. + (expand_complex_abs): Ditto. + +2002-11-20 Douglas B Rupp + + * hwint.h (HAVE___INT64): Fix typo (was HAVE__INT64). + +2002-11-20 DJ Delorie + + * config/stormy16/stormy16.c (s16builtins, + xstormy16_init_builtins, xstormy16_expand_builtin): New. + * config/stormy16/stormy16.md (divmodhi4, sdivlh, udivlh): New. + +2002-11-20 Hans-Peter Nilsson + + * Makefile.in (RUN_GEN, VALGRIND_DRIVER_DEFINES): New variables. + (DRIVER_DEFINES): Add $(VALGRIND_DRIVER_DEFINES). + (executing gencheck, genconfigs, genconditions, genflags, + gencodes, genconstants, genemit, genrecog, genopinit, genextract, + genpeep, genattr, genattrtab, genoutput, gengenrtl, genpreds, + gengtype, genprotos): Prepend $(RUN_GEN). + * configure.in: Move host compiler tests before --enable-checking + tests. + (--enable-checking=valgrind): New. + * config.in, configure: Regenerate. + * cppfiles.c [!ENABLE_VALGRIND_CHECKING] (VALGRIND_DISCARD): + Define as empty. + (read_include_file): When doing the mmap+1 trick, + valgrind-annotate the byte after the mmap:ed area as readable. + (purge_cache): Remove above annotation. + * gcc.c (execute) [ENABLE_VALGRIND_CHECKING]: Arrange to prepend + VALGRIND_PATH -q to each command. + + * ggc-common.c [!ENABLE_VALGRIND_CHECKING] (VALGRIND_DISCARD): + Define as empty. + (ggc_realloc): Update valgrind annotations. + * ggc-page.c [!ENABLE_VALGRIND_CHECKING] (VALGRIND_DISCARD): + Define as empty. + (alloc_anon, free_page, ggc_alloc, poison_pages): Add machinery to + valgrind-annotate memory. + +2002-11-20 Ulrich Weigand + + * recog.c (constrain_operands): Prefer exact match over reloadable + EXTRA_MEMORY_CONSTRAINT or EXTRA_ADDRESS_CONSTRAINT. + + * reload.c (find_reloads): Always reload EXTRA_ADDRESS_CONSTRAINT + operands in Pmode. + +2002-11-20 Eric Botcazou + + PR c/8518 + * c-decl.c (duplicate_decls): Outline the second definition + of an extern inline function in all cases. + +2002-11-20 Richard Sandiford + + * stor-layout.c (place_field): Update rli->offset as well as + rli->bitpos. + +2002-11-20 Richard Sandiford + + * sched-deps.c (sched_analyze): Check HARD_REGNO_CALL_PART_CLOBBERED. + +2002-11-20 Richard Sandiford + + * config/sh/sh.md (udivsi3): Don't put udivsi3_i4_media instructions + into a libcall block. + (divsi3): Likewise divsi3_i4_media. + +2002-11-20 Richard Sandiford + + * global.c (find_reg): Check HARD_REGNO_NREGS before kicking + out another register. + +2002-11-20 Jakub Jelinek + + * combine.c (force_to_mode): Only replace with (not Y) if all bits in fuller_mask + (not just mask) are set in C. + +2002-11-19 Steven Bosscher + + * config/mips/vr.h (DRIVER_SELF_SPECS): Change %{ + + * profile.c (index_counts_file): Fix obvious mistake. + +2002-11-19 Zdenek Dvorak + + * Makefile.in (profile.o): Add hashtab.h dependency. + * gcov-io.h (GCOV_SUMMARY_LENGTH): New. + * profile.c: Include hashtab.h. + (htab_counts_index_hash, htab_counts_index_eq, htab_counts_index_del, + cleanup_counts_index, index_counts_file, struct section_reference, + struct da_index_entry, counts_file_name, counts_file_index): New. + (get_exec_counts, init_branch_prob): Modified. + +2002-11-19 Kaz Kojima + + * config.gcc (sh*-*-linux*): Add t-slibgcc-elf-ver and t-linux + to tmake_file. Remove setting gas and gnu_ld here. + * config/sh/libgcc-glibc.ver: New file. + * config/sh/t-linux (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. + (SHLIB_MAPFILES): New. + * config/sh/linux.h (MD_EXEC_PREFIX): Undefine. + (MD_STARTFILE_PREFIX): Likewise. + (HANDLE_PRAGMA_PACK_PACK_PUSH_POP): Define. + (DWARF2_UNWIND_INFO): Redefine. + (ASM_PREFERRED_EH_DATA_FORMAT): Define. + (LINK_EH_SPEC): Redefine. + (MD_FALLBACK_FRAME_STATE_FOR): Define except for SH-media. + (SH_FALLBACK_FRAME_FLOAT_STATE): Define. + (SH_DWARF_FRAME_GP0, SH_DWARF_FRAME_FP0, SH_DWARF_FRAME_XD0, + SH_DWARF_FRAME_BT0, SH_DWARF_FRAME_PR, SH_DWARF_FRAME_PR_MEDIA, + SH_DWARF_FRAME_GBR, SH_DWARF_FRAME_MACH, SH_DWARF_FRAME_MACL, + SH_DWARF_FRAME_PC, SH_DWARF_FRAME_SR, SH_DWARF_FRAME_FPUL, + SH_DWARF_FRAME_FPSCR): Likewise. + * config/sh/sh-protos.h (sh_set_return_address): Declare. + * config/sh/sh.c (calc_live_regs): Count EH_RETURN_DATA_REGNO + registers if the current function calls EH return. + (sh_expand_epilogue): Handle EH stack adjustments. + (sh_set_return_address): New function. + * config/sh/sh.h (SH_DBX_REGISTER_NUMBER): Handle PR_MEDIA_REG. + Don't abort even if the number is mapped to -1. + (EH_RETURN_DATA_REGNO): Define. + (EH_RETURN_STACKADJ_RTX): Define. + * config/sh/sh.md (UNSPEC_EH_RETURN): New. + (eh_return): New pattern. + (eh_set_ra_di, eh_set_ra_si): Likewise. + Add splitter to perform EH return after reload. + +Tue Nov 19 12:52:07 2002 J"orn Rennecke + + * stor-layout.c (excess_unit_span): New function. + (place_field): Use it. + +2002-11-19 Andreas Schwab + + * unwind.h (_Unwind_GetTextRelBase): Revert last change, this is + not valid in C++. + +2002-11-19 Nathanael Nerode + + * configure.in, Makefile.in: Correct BUILD/HOST confusion. + * configure: Regenerate. + +Tue Nov 19 00:11:44 CET 2002 Jan Hubicka + + * convert.c (strip_float_extensions): New function. + (convert_to_real): Optimize some cases. + +2002-11-19 Andreas Jaeger + + * loop.c (record_giv): Initialize not_replaceable. + (check_final_value): Likewise. + +2002-11-19 Kazu Hirata + + * config/h8300/h8300.c (h8300_init_once): Replace 1 with + MASK_H8300S. + +2002-11-19 Vijay L. Khuspe + + * config/h8300/h8300.c (h8300_init_once): Allow -mn switch + only if -mh or -ms present. + (h8300_eightbit_constant_address_p): Support the normal mode. + (h8300_tiny_constant_address_p): Likewise. + * config/h8300/h8300.h (TARGET_NORMAL_MODE): New. + (POINTER_SIZE): Add 16 bit pointer for the normal mode. + (Pmode): Evaluate to HImode for the normal mode. + (SIZE_TYPE): Evaluate to unsigned int for normal mode. + (PTRDIFF_TYPE): Evaluate to int for the normal mode. + (ASM_WORD_OP): Evaluate to word for the normal mode. + * config/h8300/h8300.md (tablejump_normal_mode): New. + (indirect_jump_normal_mode): New. + * config/h8300/t-h8300 (MULTILIB_OPTIONS): Pass -mn option to + directory. + (MULTILIB_DIRNAMES): Create target dependent directory + 'normal'. + (MULTILIB_EXCEPTIONS): Don't turn on -mn on H8/300. + * doc/invoke.texi (gccoptlist): Describe the new switch -mn. + +Tue Nov 19 23:50:56 CET 2002 Jan Hubicka + + * i386.md (length_immediate): Do not refer to insn address. + (jcc*, jmp patterns): Compute length explicitly. + +2002-11-19 Eric Botcazou + + PR c/8588 + * optabs.c (expand_binop): Convert CONST_INTs in shift + operations too. + +2002-11-19 Roger Sayle + + * gcse.c (gcse_emit_move_after): Correct typo in REG_EQUAL note. + +2002-11-19 Kazu Hirata + + * config/h8300/h8300.md (an anonymous pattern): Relax the + condition to accept the same operands and/or subregs. + +2002-11-19 Daniel Jacobowitz + + * config/sh/sh.c (gen_shl_and): Revert previous patch. + * config/sh/sh.md (ashrdi3+1, ashrdi3+2): Predicate on + reload_completed. + +2002-11-19 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Update the use of + EIGHTBIT_CONSTANT_ADDRESS_P. + (h8300_adjust_insn_length): Likewise. + (h8300_eightbit_constant_address_p): Check if the given rtx is + a variable with __attribute__((eightbit_data)). + * config/h8300/h8300.h (OK_FOR_U): Update the use of + EIGHTBIT_CONSTANT_ADDRESS_P. + +2002-11-19 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add self as second contact in + addition to Jeff Law. + +2002-11-19 Andreas Jaeger + + * tree-inline.c: Move prototpyes of find_alloca_call_1 and + find_alloca_call to right place. + +2002-11-19 Kazu Hirata + + * cppfiles.c: Fix formatting. + +2002-11-19 Jason Thorpe + + * gcc.c (The Specs Language): Document spec functions. + (static_spec_functions, lookup_spec_function) + (eval_spec_function, handle_spec_function) + (if_exists_spec_function, alloc_args): New. + (execute): Abort if processing_spec_function is true. + (do_spec_1): Hand off spec to handle_spec_function if %: + is encountered. If processing_spec_function is true, + end any pending argument when the end of the string is reached. + (main): Use alloc_args to allocate the initial argument vector. + * gcc.h (struct spec_function): New. + (lang_specific_spec_functions): New extern. + + * config/netbsd-elf.h (STARTFILE_SPEC): Add if-exists(crti%O%s). + (ENDFILE_SPEC): Add if-exists(crtn%O%s). + * config/alpha/netbsd.h (ENDFILE_SPEC): Likewise. + + * doc/invoke.texi: Document spec functions. + + * cppspec.c (lang_specific_spec_functions): New. + * gccspec.c: Likewise. + +2002-11-18 Steve Ellcey + + * config/ia64/hpux_longdouble.h (FIXUNS_TRUNCTFSI2_LIBCALL): New. + (FIXUNS_TRUNCTFDI2_LIBCALL): New. + (fixunstfsi_libfunc): Change. + (fixunstfdi_libfunc): Change. + (sdiv_optab): Don't zero out SImode handler. + (udiv_optab): Don't zero out SImode handler. + (smod_optab): Don't zero out SImode handler. + (umod_optab): Don't zero out SImode handler. + +2002-11-18 Neil Booth + + PR preprocessor/8524 + * cpplib.c (run_directive): Remove previous kludge to _Pragma. + Add a new one in its place, which hopefully works. + (skip_rest_of_line): Change test for bottom-of-context-stack. + +Mon Nov 18 21:29:03 CET 2002 Jan Hubicka + + * i386.md (addqi_1_slp): Fix output template. + (subqi_1_slp): Fix type. + +Sun Nov 17 00:01:28 CET 2002 Jan Hubicka + + * calls.c (alloca_call_p): New global function. + * tree.h (alloca_call_p): New. + * tree-inline.c (inlinable_function_p): Do not inline when + function calls alloca. + (find_alloca_call, find_alloca_call_1): New functions. + +2002-11-18 Kazu Hirata + + * config/h8300/h8300.md (*andorqi3): Use bor between bld and + bst. Update the insn length. + (*andorhi3): Likewise. + (*andorsi3): Likewise. + +2002-11-18 Richard Sandiford + + * config/sh/sh-protos.h (sh_mark_label): Declare. + * config/sh/sh.c (sh_mark_label): New function, taken from + movdi_const, but fixing the case when the address has an addend. + * config/sh/sh.md (movdi_const, movdi_const_32bit): Use it. + +2002-11-18 Richard Sandiford + + * config/sh/sh.c (pool_node): New field: part_of_sequence_p. + (add_constant): Set it. + (dump_table): Don't reorder a constant if part_of_sequence_p. + (machine_dependent_reorg): Assume that float constants will + stay in their original order if used as a sequence. + +2002-11-18 Richard Sandiford + + * config/sh/sh.c (calc_live_regs): Update check for PIC liveness + in compact code. + +2002-11-18 Richard Sandiford + + * config/sh/sh.md (initialize_trampoline): Do not force the + trampoline address into R0_REGS here. + +Sun Nov 17 14:01:09 CET 2002 Jan Hubicka + + * i386.md (negsf2_ifs, negdf2_ifs, negdf2_ifs_rex64, abssf2_ifs, + absdf2_ifs, absdf2_ifs_rex64): Fix constraints. + (neg?f2_ifs, abs?f2_ifs splitters): Refuse memory operand; do not + generate unnecesary subregs. + +2002-11-17 Kazu Hirata + + * df.c: Fix formatting. + +2002-11-17 Kazu Hirata + + * config/h8300/h8300.md (two anonymous patterns): Fix insn + lengths. + +2002-11-17 Daniel Jacobowitz + + * sh.c (gen_shl_and): Don't create a zero_extend if the operand + is not an arith_reg_operand. + +2002-11-17 Graham Stott + + * real.c (real_to_decimal): Fix buffer overrun when buffer size + is smaller than representation. + +2002-11-17 Kazu Hirata + + * builtins.c: Fix formatting. + +Sat Nov 16 16:49:58 CET 2002 Jan Hubicka + + * i386.md (truncdfsf2_1_sse, truncdfsf2_1_sse_nooverlap, truncdfsf2_2, + floats?dff2_i387): + Work around regclass stupidity. + (truncdfsf_2_1_sse splitter): Accept !TARGET_PARTIAL_SSE_REGS + +Sat Nov 16 02:17:48 CET 2002 Jan Hubicka + + * i386.md (fop_df_6): New pattern. + (fop_xf_4, fop_xf_5): Handle both SF and DFmode extensions. + (fop_xf_6): Rewrite + (fop_xf_7): Delete. + (fop_tf_4, fop_tf_5): Handle both SF and DFmode extensions. + (fop_tf_6): Rewrite + (fop_tf_7): Delete. + +2002-11-16 Kazu Hirata + + * config/h8300/h8300.md (two anonymous patterns): Fix typos. + +2002-11-16 Kazu Hirata + + * config/h8300/h8300.md: Fix formatting. + +2002-11-16 Kazu Hirata + + * config/h8300/h8300.md: Replace spaces with tabs. + * config/h8300/t-h8300: Remove a trailing empty line. + +2002-11-16 Kazu Hirata + + * tlink.c: Fix formatting. + +2002-11-16 David Edelsohn + + PR 8362 + * config/rs6000/rs6000.c (rs6000_outout_load_multiple): New function. + * config/rs6000/rs6000.md (movti_string): Remove output modifier + when scratch register never needed. + (ldmsi[3-8]): New patterns. + +2002-11-16 Kazu Hirata + + * hard-reg-set.h: Follow spelling conventions. + * real.c: Likewise. + * target.h: Likewise. + +2002-11-16 Jakub Jelinek + + * config/i386/x86-64.h (MCOUNT_NAME): Change into string literal. + +2002-11-16 Kazu Hirata + + * optabs.c: Fix formatting. + +Sat Nov 16 02:06:02 CET 2002 Jan Hubicka + + * athlon.md, k6.md, pentium.md, ppro.md: Handle shift1, rotate1 + * i386.md (attribute type): Add type shift1 and rotate1. + (*_slp): Rewrite to have just two operands to avoid reload problems. + +2002-11-15 Kazu Hirata + + * config/h8300/h8300.md (4 anonymous patterns): New. + +2002-11-15 Geoffrey Keating + + * params.def (GGC_MIN_HEAPSIZE): Fix GGC_ALWAYS_COLLECT problem. + * doc/invoke.texi: Correct description of what needs to be done to + force collection at every ggc_collect call. + +2002-11-15 Ulrich Weigand + + * config/s390/s390.c (optimization_options): Set + flag_asynchronous_unwind_tables to 1 by default. + +2002-11-15 Ulrich Weigand + + * config/s390/s390.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. + +Fri Nov 15 14:54:19 CET 2002 Jan Hubicka + + * i386-protos.h (x86_function_profiler): New function + * i386.h (MCOUNT_NAME): New. + (PROFILE_COUNT_REGISTER): New. + (FUNCTION_PROFILER): Move offline to ... + * i386.c (x86_function_profiler) ... here; fix 64bit support + * beos-elf.h (FUNCTION_PROFILER): Kill. + (MCOUNT_NAME): New. + * freebsd-aout.h (FUNCTION_PROFILER): Kill. + (MCOUNT_NAME): New. + (PROFILE_COUNT_REGISTER): New. + * linux.h (FUNCTION_PROFILER): Kill. + (MCOUNT_NAME): New. + * x86-64.h (FUNCTION_PROFILER): Kill. + (MCOUNT_NAME): New. + * freebsd.h (FUNCTION_PROFILER): Kill. + (MCOUNT_NAME): New. + +2002-11-14 Jeroen Dobbelaere + + * config/arm/arm.h (EXPAND_BUILTIN_VA_ARG, + FUNCTION_ARG_PASS_BY_REFERENCE): Define. + * config/arm/arm.c (arm_va_arg, + arm_function_arg_pass_by_reference): New. + * config/arm/arm-protos.h: Add prototypes. + +2002-11-14 Kazu Hirata + + * gthr-single.h: Fix formatting. + +2002-11-14 Zack Weinberg + + * tree.c (tree_vec_elt_check_failed): New function. + * tree.h (TREE_VEC_ELT_CHECK): New checking macro. + (TREE_VEC_ELT): Use it. + + * tree-inline.c (optimize_inline_calls): Don't copy a + zero-length vector. + +2002-11-14 Gabriel Dos Reis + + * diagnostic.c (sorry): Don't repeat "sorry, unimplemented" text. + +2002-11-14 Jakub Jelinek + + * varasm.c (output_addressed_constants) [MINUS_EXPR]: Clear reloc if + both operands contain local relocations. + (categorize_decl_for_section): Don't use mergeable sections if + initializer has any relocations. + +2002-11-14 Kazu Hirata + + * gthr-vxworks.h: Fix formatting. + +2002-11-13 Janis Johnson + + * doc/install.texi (Testing): Document extra Java testing. + * doc/sourcebuild.texi (Test Suites): Document libgcj testing. + +2002-11-13 John David Anglin + + * pa64-hpux.h (LINK_SPEC): Move "+Accept TypeMismatch" switch to the + beginning of the spec. + (LDD_SUFFIX, PARSE_LDD_OUTPUT): Delete. + (LD_INIT_SWITCH, LD_FINI_SWITCH): Define but don't enable. Add comment + regarding problems with global constructors when using GNU ld. + +2002-11-13 Kazu Hirata + + * gthr-solaris.h: Fix formatting. + +2002-11-13 Kazu Hirata + + * gthr-posix.h: Fix formatting. + +2002-11-12 Devang Patel + * gcc.c (display_help): Two new options -Xpreprocessor and -Xassembler. + (process_command): Same. + * doc/invoke.texi: Info about these two new options. + +2002-11-12 Kazu Hirata + + * config/h8300/h8300.md (*andorsi3): New. + +2002-11-12 Franz Sirl + + * doc/install.texi (powerpc-*-linux-gnu*): Update binutils requirement. + +2002-11-12 Kazu Hirata + + * config/h8300/h8300.c (tiny_constant_address_p): Parenthesize + expressions appropriately. + +2002-11-12 Kazu Hirata + + * gthr-win32.h: Fix formatting. + +2002-11-12 Kazu Hirata + + * config/h8300/h8300.c (single_one_operand): Correctly compute + mask when mode is SImode. + (single_zero_operand): Likewise. + * config/h8300/h8300.md (two new anonymous insns): New. + +2002-11-12 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Use GCJ instead of gcj to refer + to that entire project. + +2002-11-12 Rainer Orth + + * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Restore old + directories. + +2002-11-11 Zack Weinberg + + * params.def (ggc-min-expand, ggc-min-heapsize): New parameters. + * doc/invoke.texi: Document them. + + * ggc-page.c: Include params.h. Remove definitions of + GGC_MIN_EXPAND_FOR_GC, GGC_MIN_LAST_ALLOCATED. Replace + GGC_POISON with ENABLE_GC_CHECKING in ifdefs, delete #define. + (init_gcc): Don't set G.allocated_last_gc here. + (ggc_collect): Use PARAM_VALUE (GGC_MIN_HEAPSIZE) and + PARAM_VALUE (GGC_MIN_EXPAND) to decide whether or not to + perform collection. + * ggc-simple.c: Similarly. + * Makefile.in (ggc-common.o, ggc-simple.o): Add $(PARAMS_H) to + dependencies. + +2002-11-11 Kazu Hirata + + * gthr-dce.h: Fix formatting. + +2002-11-11 Franz Sirl + + PR c/8467 + * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the + mode of DECL_RTL case. + +2002-11-11 Janis Johnson + + * doc/contrib.texi: Merge in the list from the libstdc++ web pages. + +Mon Nov 11 12:06:08 CET 2002 Jan Hubicka + + * i386.c (construct_container): Fix handling of SSE_CLASS. + +2002-11-10 Joel Sherrill + + * config/m68k/t-crtstuff (crti.o): Use this... + ($(T)crti.o): ... instead. + (crtn.o): Use this... + ($(T)crtn.o): ... instead. + +2002-11-10 Eric Botcazou + + PR c/8439 + * recog.c (validate_replace_rtx_1) [PLUS]: Simplify only + if there is something new to be simplified. + +2002-11-10 H.J. Lu + + * calls.c (PUSH_ARGS_REVERSED): Define only if not defined. + * expr.c (PUSH_ARGS_REVERSED): Likewise. + + * config/i386/i386.h (PUSH_ARGS_REVERSED): Set to 1. + +2002-11-10 Zack Weinberg + + * config/rs6000/sysv4.h: Define NO_IMPLICIT_EXTERN_C here... + * config/rs6000/linux.h, config/rs6000/linux64.h, + config/rs6000/windiss.h: ... not here. + +2002-11-10 Jason Thorpe + + * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define + __ABICALLS__ if TARGET_ABICALLS. + +Sun Nov 10 18:49:21 CET 2002 Jan Hubicka + + * i386.h (MIN_UNITS_PER_WORD): Define to 8 for x86-64 libgcc. + +2002-11-10 Joseph S. Myers + + * c-decl.c (grokdeclarator): Make error for duplicate type + qualifiers into a pedwarn, disabled for C99. + +2002-11-10 Hans-Peter Nilsson + + * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Define the same + as FUNCTION_ARG_PASS_BY_REFERENCE. + +2002-11-09 Zack Weinberg + + * doc/install.texi: Add *-*-vxworks* specific installation + instructions. + + * config/vxlib.c: Rewrite using generation numbers to identify + valid TSD keys. + +Sat Nov 9 00:10:54 CET 2002 Jan Hubicka + + * i386.c (x86_machine_dependent_reorg): Fix even more side cases. + +2002-11-09 John David Anglin + + * pa.h (STARTING_FRAME_OFFSET): Change offset for TARGET_64BIT to 16. + + * config.gcc (hppa*64*-*-linux*): Shorten lines in tm_file define. + (hppa*64*-*-hpux11*): Likewise. Use elfos.h with gas. + * pa.c (output_millicode_call): Use symbol difference rather than + $PIC_pcrel$0 when using HP assembler. + * pa64-hpux.h (TARGET_GAS): Define to 1 or 0 depending on whether or + not elfos.h (i.e., gas) is being used. + (ASM_FILE_START, STRING_ASM_OP, TEXT_SECTION_ASM_OP, + DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_COMMON, + ASM_OUTPUT_ALIGNED_LOCAL, GLOBAL_ASM_OP, ASM_DECLARE_FUNCTION_NAME, + ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL, + ASM_OUTPUT_INTERNAL_LABEL, ASM_GENERATE_INTERNAL_LABEL): Define when + using elfos.h. + (TARGET_ASM_GLOBALIZE_LABEL): Undefine when using elfos.h. + (DWARF2_ASM_LINE_DEBUG_INFO): Delete. + (ASM_FILE_START): Add standard .SPACE and .SUBSPA defines when not + using elfos.h. + (TEXT_SECTION_ASM_OP, READONLY_DATA_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): New HP style defines when not using elfos.h. + (TARGET_ASM_NAMED_SECTION, MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): + Don't define when not using elfos.h. + (ASM_DECLARE_RESULT): Don't define. + * doc/install.texi (hppa*-hp-hpux*): Remove statement that HP assembler + doesn't work on hppa64-hp-hpux11. + (hppa*-hp-hpux11): Update. + +2002-11-09 Jason Thorpe + + * config/mips/netbsd.h (SUBTARGET_ASM_SPEC): Don't pass -KPIC + to the assembler if -mno-abicalls was specified. + +2002-11-09 John David Anglin + + * pa-linux.h (PREFERRED_DEBUGGING_TYPE, DWARF2_ASM_LINE_DEBUG_INFO, + ASM_OUTPUT_DEF): Delete. + +2002-11-09 Neil Booth + + * c-opts.c (COMMAND_LINE_OPTIONS): Fix -Wimplicit. + +2002-11-08 Roger Sayle + + * real.c (real_sqrt): Update comment with bibliographic reference. + +Fri Nov 8 13:33:58 CET 2002 Jan Hubicka + + * i386.md (sse_loadss, sse2_loadsd): Fix expander. + +Fri Nov 8 13:25:41 CET 2002 Jan Hubicka + + * i386.c (x86_machine_dependent_reorg): Fix handling of empty functions. + +Fri Nov 8 13:01:42 CET 2002 Jan Hubicka + + * builtins.c (expand_builtin_mathfn): Handle floor/ceil/trunc/round/nearbyint + (expand_builtin): Likewise. + * builtins.def: Add + __builtin_floor, __builtin_floorf, __builtin_floorl + __builtin_ceil, __builtin_ceilf, __builtin_ceill + __builtin_round, __builtin_roundf, __builtin_roundl + __builtin_trunc, __builtin_truncf, __builtin_truncl + __builtin_nearbyint, __builtin_nearbyintf, __builtin_nearbyintl. + * genopinit.c (optabs): Initialize the new optabs. + * optab.c (init_optabs): Likewise. + * optabs.h (optab_index): Add OTI_floor, OTI_ceil, OTI_trunc, + OTI_round, OTI_nearbyint. + (floor_optab, ceil_optab, trunc_optab, round_optab, nearbyint_optab): New. + * doc/md.texi: Document new named patterns. + * doc/extend.texi (builtin functions) Document + floor, floorf, floorl, ceil, ceilf, + ceill, round, roundf, roundl, trunc, + truncf, truncl, nearbyint, nearbyintf, nearbyintl. + +Fri Nov 8 11:36:11 CET 2002 Jan Hubicka + + * i386.md (sse_movdfcc, sse_movsfcc): Fix typo in previous patch. + +2002-11-08 Dale Johannesen + + * dbxout.c (dbxout_type): Fix stabs info for vector types. + +2002-11-08 Neil Booth + + PR preprocessor/8497 + PR preprocessor/8501 + * cpptrad.c (scan_out_logical_line): A '#' from a macro doesn't + start a directive. In assembler, #NUM is not a line directive. + +2002-11-08 Neil Booth + + * cppmain.c (cpp_preprocess_file): Loop to pop any -included + buffers. + +2002-11-08 Kazu Hirata + + * config/h8300/h8300.md (two anonymous test insns): New. + +Fri Nov 8 11:20:19 CET 2002 Jan Hubicka + + * jump.c (mark_jump_label): Handle subregs of label_refs. + +Thu Nov 7 21:54:22 CET 2002 Jan Hubicka + + * i386.md (sse_movdfcc, sse_movsfcc): Avoid overactive matching. + * i386.c (ix86_expand_fp_movcc): Match the reversed cases. + +2002-11-07 David Mosberger + + * config/ia64/crtend.asm: Include "auto-host.h". + [HAVE_INITFINI_ARRAY]: Invoke __do_global_ctors_aux via .init_array. + * config/ia64/crtbegin.asm: Similarly. + * config/ia64/t-ia64 (crtbegin.o): Include from current directory. + (crtend.o, crtbeginS.o, crtendS.o): Likewise. + + * aclocal.m4 (gcc_AC_INITFINI_ARRAY): New. + * configure.in: Use it if --enable-initfini-array not specified. + * doc/install.texi (Configuration): Document --enable-initfini-array. + * configure, config.in: Rebuild. + +2002-11-07 Jason Thorpe + + * config/arm/arm-protos.h (arm_get_frame_size) + (thumb_get_frame_size): New prototypes. + * config/arm/arm.c (arm_get_frame_size) + (thumb_get_frame_size): New functions. + (use_return_insn, arm_output_epilogue, arm_output_function_epilogue) + (arm_compute_initial_elimination_offset, arm_expand_prologue): Use + arm_get_frame_size. + (thumb_expand_prologue, thumb_expand_epilogue): Use + thumb_get_frame_size. + * config/arm/arm.h (PREFERRED_STACK_BOUNDARY): Define. + (machine_function): Add frame_size member. + (THUMB_INITIAL_ELIMINATION_OFFSET): Use thumb_get_frame_size. + +2002-11-07 Richard Earnshaw + + * arm.c (bit_count): Make argument unsigned long. Return unsigned. + Adjust code to use portable unsigned bit manipulation. + (insn_flags, tune_flags): Change type to unsigned. + (struct processors): Make flags unsigned long. + (arm_override_options): Change type of count and current_bit_count + to unsigned. + +2002-11-07 Richard Earnshaw + + * arm/elf.h (TYPE_OPERAND_FMT): Prefix type with %. + +Thu Nov 7 15:50:18 2002 J"orn Rennecke + + * sh.h (DWARF_FRAME_RETURN_COLUMN): Use DWARF_FRAME_REGNUM. + +Thu Nov 7 11:18:01 CET 2002 Jan Hubicka + + * reg-stack.c (compensate_edge): Fix sanity check. + +2002-11-05 Geoffrey Keating + + * config.gcc: Don't create crtbegin, crtend on Darwin; do create + crt2.o. Rearrange t-darwin makefiles. + * crtstuff.c [OBJECT_FORMAT_MACHO]: Delete. + * unwind-dw2-fde-darwin.c: New. + * unwind-dw2-fde-glibc.c: Correct comment. + * unwind-dw2-fde.c (__register_frame_info_bases) + [DWARF2_OBJECT_END_PTR_EXTENSION]: Clear fde_end. + (classify_object_over_fdes): Use last_fde. + (add_fdes): Likewise. + (linear_search_fdes): Likewise. + * unwind-dw2-fde.h (struct object) + [DWARF2_OBJECT_END_PTR_EXTENSION]: Add fde_end field. + (last_fde): New. + * config/darwin.h (STARTFILE_SPEC): Include crt2.o not crtbegin.o. + (ENDFILE_SPEC): No crtend.o. + * config/t-darwin: New. + * config/i386/t-darwin: Delete. + * config/darwin-crt2.c: New. + * config/rs6000/t-darwin: Delete contents duplicated in t-rs6000 + or config/t-darwin. + +2002-11-06 Douglas B Rupp + + * config/i386/i386-interix.h (TARGET_SUBTARGET_DEFAULT): Or + MASK_MS_BITFIELD_LAYOUT + (SUBTARGET_OVERRIDE_OPTIONS): Warn about and turn off + MS bitfields for Objective-C. + (PCC_BIT_FIELD_TYPE_TEST, GROUP_BITFIELDS_BY_ALIGN): Remove + defines. + + * config/i386/i386.c (ix86_ms_bitfield_layout): New function. + (TARGET_MS_BITFIELD_LAYOUT_P): Define to above function. + (TARGET_USE_MS_BITFIELD_LAYOUT): Define. + + * config/i386/i386.h (MASK_MS_BITFIELD_LAYOUT: New mask. + TARGET_USE_MS_BITFIELD_LAYOUT): New macro. + (TARGET_SWITCHES): Add above mask. + + * testsuite/gcc.dg/bf-ms-layout.c: New test case. + * testsuite/gcc.dg/bf-no-ms-layout.c: New test case. + * testsuite/gcc.dg/i386-bitfield1.c (dg-options): Add appropriate + flags for interix. + +Wed Nov 6 18:54:47 2002 Alexandre Oliva + + * config/mips/mips.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output + .gpword/.gpdword for ABI_N32 and ABI_64 too, if using the GNU + assembler. + * config/mips/mips.md (tablejump_internal3): Output .cpadd + before jump on ABI_N32 too. + (tablejump_internal4): Ditto on ABI_64. Increase maximum + length to match. + +Wed Nov 6 17:16:48 CET 2002 Jan Hubicka + + * i386.md (negsf splitter): Accept memory operand in second register. + (abssf/absdf splitters): Simplify + (sse_loadss, sse_loadsd): Turn into expander. + +2002-11-06 David Edelsohn + + PR target/8480 + * config/rs6000/rs6000.md (movdi_internal64): Discourage + FPR to FPR moves. + +2002-11-06 Janis Johnson + + * doc/contrib.texi: Merge in the list from the Java web pages. + +2002-11-06 David O'Brien + + * config/sparc/freebsd: Fix typo. + +2002-11-06 John David Anglin + + * pa64-hpux.h (LDD_SUFFIX, PARSE_LDD_OUTPUT): Define. + +2002-11-06 Alexandre Oliva + + * config/mips/mips.md (call_value_multiple_internal2): Use dla for + non-SImode addresses. + +Tue Nov 5 14:34:36 CET 2002 Jan Hubicka + + * i386.md (float_truncate SSE splitter): Ensure that operand is not + stack register. + (float SSE splitters): Reorder conditional. + +2002-11-05 Bob Wilson + + * config/xtensa/elf.h (LIB_SPEC): Add "-lhal". + +2002-11-05 John David Anglin + + * pa64-hpux.h (LIB_SPEC): Fix p and pg options. + (STARTFILE_SPEC): Remove p and pg options. + +2002-11-05 Andrew Haley + + * fold-const.c (fold): Don't transform (a0 op compound(a1,a2)) + to (compound(a1,a0 op a2)) if a0 or a1 have side effects. + +2002-11-05 Richard Sandiford + + * config/mips/mips.h (CANNOT_CHANGE_MODE_CLASS): Move comment to... + * config/mips/mips.c (mips_cannot_change_mode_class): ...here. + +2002-11-04 Zack Weinberg + + * gthr-vxworks.h: Rewritten from scratch. + * config/vxlib.c: New file. + * config/t-vxworks: Add config/vxlib.c to LIB2FUNCS_EXTRA. + * config/rs6000/t-vxworks: Add config/vxlib.c to + LIB2FUNCS_EXTRA here too, because of clash with + config/rs6000/t-ppccomm. + +2002-11-04 Dale Johannesen + + * doloop.c (doloop_modify_runtime): Fix loop count computation + for unrolled loops. + * loop.c (loop_invariant_p): Support calling from unroller. + +2002-11-04 Ulrich Weigand + + * config/s390/s390.c (s390_decompose_address): Use arg_pointer_rtx + for comparison. + +2002-11-04 Aldy Hernandez + + * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. + + * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. + (CLASS_CANNOT_CHANGE_MODE): Remove. + (CANNOT_CHANGE_MODE_CLASS): New. + + * config/alpha/alpha.h: Same. + + * config/ia64/ia64.h: Same. + + * config/mips/mips.h: Same. + + * config/s390/s390.h: Same. + + * config/sh/sh.h: Same. + + * config/pa/pa64-regs.h: Same. + + * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. + + * config/sh/sh.c (sh_cannot_change_mode_class): New. + + * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add + prototype. + + * config/mips/mips.c (mips_cannot_change_mode_class): New. + + * doc/tm.texi (Register Classes): Remove + CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. + Document CANNOT_CHANGE_MODE_CLASS. + + * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. + (push_reload): Same. + + * simplify-rtx.c (simplify_subreg): Same. + + * reload1.c (choose_reload_regs): Same. + + * recog.c (register_operand): Same. + + * regrename.c (mode_change_ok): Change to use new + CANNOT_CHANGE_MODE_CLASS infrastructure. + + * regclass.c (cannot_change_mode_set_regs): New. + Declare subregs_of_mode. + (regclass): Use subregs_of_mode. + Remove references to reg_changes_mode. + (init_reg_sets_1): Remove class_can_change_mode and + reg_changes_mode code. + (invalid_mode_change_p): New. + (dump_regclass): Use invalid_mode_change_p instead of + class_can_change_mode. + (regclass): Same. + (record_operand_costs): Do not set reg_changes_mode. + + * local-alloc.c (struct qty): Remove changes_mode field. + (alloc_qty): Remove changes_mode initialization. + (update_qty_class): Remove set of changes_mode. + (find_free_reg): Use subregs_of_mode. + + * global.c (find_reg): Use subregs_of_mode info. + + * rtl.h (cannot_change_mode_set_regs): New prototype. + (invalid_mode_change_p): Same. + (REG_CANNOT_CHANGE_MODE_P): New macro. + + * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove + REG_CHANGES_MODE. + (life_analysis): Clear subregs_of_mode. + + * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. + Remove use of CLASS_CANNOT_CHANGE_MODE. + (simplify_set): Same. + (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove + REG_CHANGES_MODE. + + * regs.h: Add extern for subregs_of_mode; + Include hard-reg-set and basic-block. + (REG_CHANGES_MODE): Delete. + +2002-11-03 Roger Sayle + + * real.c (real_sqrt): New function to calculate square roots. + * real.h (real_sqrt): Add function prototype. + * builtins.c (fold_builtin): Fold sqrt of constant argument. + * simplify-rtx.c (simplify_unary_operation): Simplify sqrt + of constant argument. + +2002-11-03 John David Anglin + + * jump.c (never_reached_warning): Don't set contains_insn until the + first line note is seen. + +2002-11-03 David Edelsohn + + * config/rs6000/rs6000.md (movti_string): Use string instructions. + +2002-11-03 Roger Sayle + + PR c/7128 + * c-typeck.c (c_expand_asm_operands): Defend against + error_mark_nodes in the output argument to avoid ICE. + +2002-11-03 Eric Botcazou + + PR middle-end/8408 + * genrecog.c (preds): Handle ADDRESSOF. + (validate_pattern): Mark it as an lvalue. + +2002-11-02 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Use string + instructions when optimizing for size. + +2002-11-02 Kazu Hirata + + * config/h8300/h8300.h: Fix comment typos. + * config/h8300/h8300.md: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + +2002-11-02 Gerald Pfeifer + + Revert this change: + + *doc/install.texi (Installing GCC: Configuration): Clarify + the only supported ways to configure gcc. + +2002-11-01 Kazu Hirata + + * config/h8300/h8300.md (anonymous and:QI pattern): Use 'n' + instead of 'O' for the constraint for the second operand. + +2002-11-01 Mark Mitchell + + PR c++/8391 + * toplev.c (rest_of_compilation): Do not refuse to output code for + an inline function in a local class. + +2002-11-01 David O'Brien + + * config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Define __arch64__. + (TRANSFER_FROM_TRAMPOLINE): Reformat. + Add comment. + +2002-11-01 Kazu Hirata + + * config/h8300/h8300.h (CAN_ELIMINATE): Simplify. + +2002-11-01 Toshiyasu Morita + + * config/h8300/h8300.h (OPTIMIZATION_OPTIONS): New. + +2002-11-01 Steve Ellcey + + * config/ia64/ia64.h (MASK_INLINE_DIV_LAT): Remove. + (MASK_INLINE_DIV_THR): Remove. + (TARGET_INLINE_DIV_LAT): Remove. + (TARGET_INLINE_DIV_THR): Remove. + (TARGET_INLINE_DIV): Remove. + (MASK_INLINE_FLOAT_DIV_LAT): New macro. + (MASK_INLINE_FLOAT_DIV_THR): New macro. + (MASK_INLINE_INT_DIV_LAT): New macro. + (MASK_INLINE_INT_DIV_THR): New macro. + (TARGET_INLINE_FLOAT_DIV_LAT): New macro. + (TARGET_INLINE_FLOAT_DIV_THR): New macro. + (TARGET_INLINE_INT_DIV_LAT): New macro. + (TARGET_INLINE_INT_DIV_THR): New macro. + (TARGET_INLINE_FLOAT_DIV): New macro. + (TARGET_INLINE_INT_DIV): New macro. + * config/ia64/ia64.md (divsi3): Change to use new macros. + (modsi3): Ditto. + (udivsi3): Ditto. + (umodsi3): Ditto. + (divsi3_internal): Ditto. + (divdi3): Ditto. + (moddi3): Ditto. + (udivdi3): Ditto. + (umoddi3): Ditto. + (divdi3_internal_lat): Ditto. + (divdi3_internal_thr): Ditto. + (divsf3): Ditto. + (divsf3_internal_lat): Ditto. + (divsf3_internal_thr): Ditto. + (divdf3): Ditto. + (divdf3_internal_lat): Ditto. + (divdf3_internal_thr): Ditto. + (divtf3): Ditto. + (divtf3_internal_lat): Ditto. + (divtf3_internal_thr): Ditto. + * config/ia64/ia64.c (ia64_override_options): Change + to check new macros for conflicts in settings. + * doc/invoke.texi (-minline-divide-min-latency): Remove. + (-minline-divide-max-throughput): Remove. + (-minline-float-divide-min-latency): New. + (-minline-float-divide-max-throughput): New. + (-minline-int-divide-min-latency): New. + (-minline-int-divide-max-throughput): New. + +2002-11-01 Richard Earnshaw (rearnsha@arm.com) + + PR target/7856 + * arm.c (use_return_insn): Don't use a return insn if there are + saved integer regs, but LR is not one of them. + +Fri Nov 1 10:33:15 CET 2002 Jan Hubicka + + * expr.c (emit_move_insn): Use SCALAR_FLOAT_MODE_P + * machmode.h (SCALAR_FLOAT_MODE_P): New macro. + +Thu Oct 31 18:20:50 CET 2002 Jan Hubicka + + * i386.md (sse_loadss, sse_loadsd): Canonicalize; add expander + (movps, movpd splitters): Use canonical form. + (movv2di): Fix merge problem. + +Thu Oct 31 16:22:31 CET 2002 Jan Hubicka + + * i386.md (negdf2_ifs_rex64): Don't allow GPR operand. + +2002-10-31 Nathanael Nerode + + PR optimization/6162 + * doc/md.texi: Document restriction on commutative operand + specification. + +2002-10-31 Eric Christopher + + * explow.c (convert_memory_address): Use shallow_copy_rtx. + +2002-10-31 Steve Ellcey + + * expmed.c (store_bit_field): Check FUNCTION_ARG_REG_LITTLE_ENDIAN. + +2002-10-31 Steve Ellcey + + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Set for non-floats. + +Thu Oct 31 Dale Johannesen + + * config/rs6000/darwin.h: Correct formatting in previous. + +Thu Oct 31 Dale Johannesen + + * config/rs6000/darwin.h: Enable -falign-xxx options. + +Thu Oct 31 18:08:00 CET 2002 Jan Hubicka + + * i386.c (override_options): Set defaults for flag_omit_frame_pointer, + flag_asynchronous_unwind_tables, flag_pcc_struct_return. + * i386.c (optimization_options): Set flag_omit_frame_pointer, + flag_asynchronous_unwind_tables, flag_pcc_struct_return to 2. + Do not clear -momit-leaf-frame-pointer when profiling. + (ix86_frame_pointer_required): Frame pointer is always required when + profiling. + +Thu Oct 31 16:09:44 CET 2002 Jan Hubicka + + * i386.md (negdf2_ifs_rex64): Don't allow GPR operand. + +Thu Oct 31 12:45:55 2002 J"orn Rennecke + + * sh.h (binary_logical_operator): Declare. + * sh.c (binary_logical_operator): New function. + * sh.md (xordi3+1): New combiner splitter pattern. + +2002-10-31 David O'Brien + + * config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Define + __enable_execute_stack function. + +2002-10-30 Zack Weinberg + + * gthr.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, + gthr-solaris.h, gthr-win32.h: Remove __gthread_key_dtor. + * unwind-sjlj.c (fc_key_dtor): Delete. + (fc_key_init): Adjust __gthread_key_create call to match. + +2002-10-30 Aldy Hernandez + + * c-common.c: Add GTY to vector_type_node_list. + +2002-10-30 John David Anglin + + * pa-linux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Define. + * pa-protos.h (attr_length_millicode_call, attr_length_call, + pa_init_machine_status): Declare new global functions. + * pa.c (void copy_fp_args, length_fp_args, get_plabel): Declare and + implement new functions. + (attr_length_millicode_call, attr_length_call): Implement. + (total_code_bytes): Change type to long. + (pa_output_function_prologue): Compute total_code_bytes on TARGET_64BIT. + Reset counter if flag_function_sections. + (output_deferred_plabels): Set output alignment to 3 for TARGET_64BIT. + (output_cbranch): Move call to gen_label_rtx. + (output_millicode_call): Rewrite adding long TARGET_64BIT call, expose + delay slot in all variants, shorten pc-relative calls. + (output_call): Rewrite adding long TARGET_64BIT call, improved delay + slot usage and exposure, various new call variants, and shortened + sequences for some variants on TARGET_PA_20. + Miscellaneous format changes. + * pa.h (total_code_bytes): Change type to long. + (MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_LONG_ABS_CALL, + TARGET_LONG_PIC_SDIFF_CALL, TARGET_LONG_PIC_PCREL_CALL): Define. + (TARGET_SWITCHES): Add "-mlong-calls" and "-mno-long-calls" options. + (EXTRA_CONSTRAINT, GO_IF_LEGITIMATE_ADDRESS, + LEGITIMIZE_RELOAD_ADDRESS): Don't use long floating point loads and + stores on TARGET_ELF32. + *pa.md (define_delay): Allow insns in delay on TARGET_PORTABLE_RUNTIME. + (unnamed patterns for mulsi3, divsi3, udivsi3, modsi3, umodsi3 and + canonicalize_funcptr_for_compare expanders): Calculate attribute length + attr_length_millicode_call(). + (call_internal_symref, call_value_internal_symref): Clobber register 1. + Calculate attribute length using attr_length_call(). + (call_internal_reg_64bit, call_value_internal_reg_64bit): Move gp load + to delay slot. + (sibcall, sibcall_value): Rewrite. + (sibcall_internal_symref, sibcall_value_internal_symref): Clobber + register 1. Use attr_length_call(). + (sibcall_internal_symref_64bit, sibcall_value_internal_symref_64bit): + New patterns. + (unamed pattern for canonicalize_funcptr_for_compare): Rewrite. + * som.h (MEMBER_TYPE_FORCES_BLK): Define. + * t-pa64 (TARGET_LIBGCC2_CFLAGS): Add "-mlong-calls". + * doc/invoke.texi (mlong-calls): Document. + +2002-10-30 Roger Sayle + + * fold-const.c (fold_binary_op_with_conditional_arg): Improve + handling of cases where one or both branches of the conditional + have void type, i.e. throw an exception or don't return. + (fold): Only apply (and undo) type conversion to the non-void + branches of a COND_EXPR. + +2002-10-30 Mark Mitchell + + PR c++/8333 + * varasm.c (asm_output_aligned_bss): Do not call + ASM_GLOBALIZE_LABEL. + +2002-10-30 David Edelsohn + Torbjorn Granlund + + * config/rs6000/rs6000.md (load_toc_v4_PIC_1): Use preferred form + for addressibility. + (load_toc_v4_PIC_1b): Same. + +2002-10-30 Kazu Hirata + + * config/h8300/h8300.c (h8300_eightbit_constant_address_p): + Truncate the addresses for H8/300 using HImode. + +Tue Oct 29 23:28:10 CET 2002 Jan Hubicka + + * i386.md (negdf splitter): Fix construction of the constant. + +Tue Oct 29 20:47:06 CET 2002 Jan Hubicka + + * i386.md (negsf, negdf): Reorganize to use vector modes + for SSE variants. + (abssf, absdf): Use force_reg. + (movv4sf, movv2df): New splitters. + * i386.h (PREDICATE_CODES): add zero_extended_scalar_load_operand + * i386.c (zero_extended_scalar_load_operand + + * i386-protos.h (ix86_expand_call): Update prototype. + * i386.c (ix86_function_ok_for_sibcall): Handle 64bit + (ix86_expand_call): Use r11 for indirect sibcalls. + * i386.md (call, call_value, untyped_call, call_value_pop): + update x86_expand_call call. + (sibcall, sibcall_value): new patterns + (call_rex64, call_value_rex64): Do not accept sibcalls. + (sibcall_rex64, sibcall_value_rex64, + sibcall_rex64_v, sibcall_value_rex64_v): New. + +Tue Oct 29 15:37:39 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Reorganize way reg_scan is called + before final pass. + +2002-10-29 Hans-Peter Nilsson + + * toplev.c (rest_of_type_compilation): Return early in case of + errors. + (check_global_declarations): Don't call debug_hooks->global_decl + in case of errors. + +2002-10-28 Andreas Bauer + + * doc/c-tree.texi (Tree overview): Fix typos. + +2002-10-29 Phil Edwards + + * Makefile.in (gnucompare*): Only record bad comparisons + if there really was a bad comparison. + +Tue Oct 29 19:32:16 CET 2002 Jan Hubicka + + * i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'H' + * i386.md (movsf*, movdf*): Use 'C' instead of 'H' + * md.texi (machine dependent constraints): Document 'C' + + * simplify-rtx.c (simplify_subreg): Fix const_int->vector subregging. + + * i386.c (ix86_expand_vector_move): Fix. + + * i386.c (ix86_expand_builtin): Use sse2_maskmovdqu_rex64. + * i386.md (sse2_maskmovdqu_rex64): New pattern + + PR target/8322 + * xmmintrin.h (_mm_stream_pi, _mm_stream_pd): Fix cast. + (ix86_init_mmx_sse_builtins): Fix type. + +2002-10-29 Jason Thorpe + + * gthr-posix.h: Include for feature tests. + (sched_get_priority_max, sched_get_priority_min) + (pthread_getschedparam, pthread_setschedparam): Only use + if _POSIX_THREAD_PRIORITY_SCHEDULING is defined. + (__gthread_objc_thread_set_priority): Don't treat all nonzero + returns from sched_get_priority_max and sched_get_priority_min + as an error. + +2002-10-29 Kazu Hirata + + * config/h8300/h8300.h (TARGET_DEFAULT): Make it + MASK_QUICKCALL. + +2002-10-29 Kazu Hirata + + * config/h8300/h8300.c (h8300_eightbit_constant_address_p): New. + (h8300_tiny_constant_address_p): Likewise. + * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Use + h8300_eightbit_constant_address_p. + (TINY_CONSTANT_ADDRESS_P): Use h8300_tiny_constant_address_p. + * config/h8300/h8300-protos.h: Add the prototypes for the two + new functions. + +2002-10-29 Kazu Hirata + + * reload1.c (update_eliminables): Unconditionally check if + frame_pointer_needed has changed. + +Tue Oct 29 15:37:39 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Reorganize way reg_scan is called + before final pass. + +2002-10-29 Eric Botcazou + + PR optimization/8334 + * expr.c (expand_expr) [PLUS]: Don't use simplify_binary_operation; + check for zero operands explicitly. + +2002-10-29 Richard Sandiford + + * config/mips/mips.md (extv, extzv, insv): Set size of referenced + memory after adjusting to BLKmode. + +2002-10-29 Kazu Hirata + + * config/h8300/h8300.h (MASK_*): New. + (TARGET_*): Use MASK_*. + +2002-10-28 Zack Weinberg + + * config.gcc (*-*-vxworks, powerpc-wrs-vxworks*): New stanzas. + * config/t-vxworks, config/vxworks.h, config/rs6000/t-vxworks, + config/rs6000/vxworks.h: New files. + * config/rs6000/sysv4.h: Rip out -mvxworks and all related code. + + * config.gcc (alpha*-*-vxworks*, arm-*-vxworks*, + i?86-wrs-vxworks*, i960-wrs-vxworks* [all], + m68k-wrs-vxworks*, mips-wrs-vxworks, powerpc-wrs-vxworks*, + powerpcle-wrs-vxworks*, sparc*-wrs-vxworks* [all], + sparc-*-vxsim*): Delete stanzas. + * gthr-vxworks.h: Rip out all substantive code and just + include gthr-single.h. + + * config/alpha/vxworks.h, config/arm/vxarm.h, + config/i386/vxi386.h, config/i960/t-vxworks960, + config/i960/vx960-coff.h, config/i960/vx960.h, + config/m68k/t-vxworks68, config/m68k/vxm68k.h, + config/mips/vxworks.h, config/rs6000/vxppc.h, + config/sparc/t-vxsparc, config/sparc/t-vxsparc64, + config/sparc/vxsim.h, config/sparc/vxsparc.h, + config/sparc/vxsparc64.h: Delete files. + +2002-10-28 Jason Thorpe + + * config.gcc (*-*-netbsd*): Add NETBSD_ENABLE_PTHREADS to + tm_defines if pthreads are enabled. + * config/netbsd.h (LIB_SPEC): Only support the -pthread option + if NETBSD_ENABLE_PTHREADS is defined. + +2002-10-28 Kazu Hirata + + * ChangeLog.1: Fix typos. + * cse.c: Fix a comment typo. + * reload1.c: Likewise. + +2002-10-27 Hans-Peter Nilsson + + * fixinc/inclhack.def (libc1_G_va_list): Correct test_text. + * fixinc/tests/base/_G_config.h: New file. + +2002-10-27 Kazu Hirata + + * combine.c: Fix comment formatting. + * loop.c: Likewise. + * real.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * regrename.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * reload.c: Likewise. + * reload.h: Likewise. + * unroll.c: Likewise. + +2002-10-27 Kazu Hirata + + * reload1.c (reload): Fix a comment typo. + +Sun Oct 27 10:15:24 CET 2002 Jan Hubicka + + * linux64.h (DEFAULT_PCC_STRUCT_RETURN): Define. + +2002-10-27 Zdenek Dvorak + + * Makefile.in (dwarf2out.o): Add dependendcy on hashtab.h. + * dwarf2out.c: Include hashtab.h. + (is_main_source): New static variable. + (attr_checksum, die_checksum): Modified to handle die references. + (same_loc_p, same_dw_val_p, same_attr_p, same_die_p, same_die_p_wrap, + unmark_all_dies, htab_cu_hash, htab_cu_eq, htab_cu_del, check_duplicate_cu, + record_comdat_symbol_number): New static functions. + (output_comp_unit, compute_section_prefix, is_type_die, break_out_includes, + mark_dies, unmark_dies, dwarf2out_start_source_file): Modified. + * toplev.c (rest_of_decl_compilation): Call of dwarf2out_decl for type + declarations added. + +2002-10-26 Kazu Hirata + + * config/h8300/h8300.c (initial_offset): Change to + h8300_initial_elimination_offset. + * config/h8300/h8300.h (INITIAL_ELIMINATION_OFFSET): Use + h8300_initial_elimination_offset. + * config/h8300/h8300-protos.h: Update the prototype. + +2002-10-26 Hans-Peter Nilsson + + * config/mmix/mmix.h (LIBCALL_VALUE): Use + MMIX_RETURN_VALUE_REGNUM, not MMIX_OUTGOING_RETURN_VALUE_REGNUM. + (FUNCTION_VALUE_REGNO_P): Similar, but move code to... + * config/mmix/mmix.c (mmix_function_value_regno_p): New. + * config/mmix/mmix-protos.h: Remove needless ifdefs on TREE_CODE + and RTX_CODE. + (mmix_function_value_regno_p): Declare. + + * config/mmix/mmix.md ("fixuns_truncdfdi2"): Replace unsigned_fix, + invalid for floating point mode result, with fix. + +Fri Oct 25 00:04:21 2002 Alexandre Oliva + + * Makefile.in (GCC_FOR_TARGET): Add -L$(objdir)/../ld. + (STAGE2_FLAGS_TO_PASS): Pass GCC_FOR_TARGET. + (stage1_build): Likewise. + +2002-10-25 Mike Stump + + Fixes gcc.dg/warn-1.c. + * c-typeck.c (warn_for_assignment): Don't print argument number, + if zero. + +Sat Oct 26 01:44:46 CEST 2002 Jan Hubicka + + * toplev.c (dump_file_index): Add DFI_ce3. + (dump_file_info): Likewise. + (rest_of_compilation): Run first ifcvt pass before tracer. + +2002-10-25 Steve Ellcey + + * config/ia64/hpux.h (BITS_BIG_ENDIAN): Remove. + +2002-10-25 Richard Henderson + + * real.c (real_to_decimal): If the >1 tens reduction loop results + in a negative exponent, fall into the <1 pten computation. + +2002-10-25 Zack Weinberg + + PR middle-end/6994 + * c-objc-common.c (inline_forbidden_p): Can not inline + functions containing structures or unions containing VLAs. + * tree-inline.c (walk_tree): For all class 't' nodes, walk + TYPE_SIZE and TYPE_SIZE_UNIT. + (copy_tree_r): Copy types if they are variably modified. + +2002-10-25 Ulrich Weigand + + * config/s390/s390.md: Remove old-style peepholes. + +2002-10-25 Ulrich Weigand + + * config/s390/s390.c (s390_decompose_address): Do not range check the + displacement if base or index is the argument pointer register. + +2002-10-24 Hans-Peter Nilsson + + PR other/3337 + PR bootstrap/6763 + PR bootstrap/8122 + * fixinc/inclhack.def (libc1_G_va_list): New fix. + * fixinc/fixincl.x: Regenerate. + * config/i386/linux.h: Move MD_FALLBACK_FRAME_STATE_FOR inside + ifndef IN_LIBGCC2. Wrap it together with signal.h and + sys/ucontext.h inclusion in ifndef USE_GNULIBC_1. + * configure.in (gcc_AC_CHECK_DECLS): Check vasprintf too. + * config.in, configure: Regenerate. + +2002-10-24 Igor Shevlyakov + + * varasm.c (struct rtx_const): Array size 16 for V16QImode. + +2002-10-24 Richard Henderson + + * config/i386/i386.c (x86_output_mi_thunk): Fix x86_64 pic jump. + +2002-10-24 Kazu Hirata + + * config/h8300/h8300.c (initial_offset): Simplify by using + round_frame_size. + +2002-10-24 Marek Michalkiewicz + + * doc/install.texi (avr): Update required binutils version. + +2002-10-24 Theodore A. Roth + + * doc/install.texi: Point avr users at more up-to-date information. + +2002-10-24 Ulrich Weigand + + * config/s390/s390.md (movdi, movsi, movhi, movqi): Add peepholes2 + to pull operands out of the literal pool where possible. + +2002-10-24 Denis Chertykov + + * config/avr/avr.c (init_cumulative_args): Test fntype for zero. + +2002-10-24 Steve Ellcey + + * expr.c (convert_move): If unsignedp is less then zero there + is no equivalent code. + +2002-10-24 Zack Weinberg + + * tree.def: Delete mention of nonexistent ARRAY_TYPE fields. + +2002-10-24 Ulrich Weigand + + * config/s390/s390.h: Rework comments; re-sort target macro definitions + according to the sequence they are defined in the manual. + (POINTER_BOUNDARY): Remove. + +2002-10-24 Kazu Hirata + + * config/h8300/h8300.c (round_frame_size): Replace 8 with + BITS_PER_UNIT. + +2002-10-24 Kazu Hirata + + * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Make it + 64-bit safe. + (TINY_CONSTANT_ADDRESS_P): Likewise. + +2002-10-24 Richard Henderson + + * config/ia64/ia64.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): True. + (ia64_output_mi_thunk): Rewrite to use rtl, and to handle the + vcall offset. + +2002-10-24 Richard Henderson + + PR opt/7944 + * reload.c (find_reloads_toplev): Mode of X is not important + when simplifying subregs of constants. + +2002-10-24 Richard Sandiford + + * config.gcc (mips64vr-*-elf*, mips64vrel-*-elf*): Add + MIPS_MARCH_CONTROLS_SOFT_FLOAT=1 to $tm_defines. + * config/mips/mips.c (MIPS_MARCH_CONTROLS_SOFT_FLOAT): Default to 0. + (override_options): Base default setting of MASK_SOFT_FLOAT on -march + if MIPS_MARCH_CONTROLS_SOFT_FLOAT. + +2002-10-24 Richard Sandiford + + * optabs.c (expand_binop): Don't reuse the shift target in the + middle of shift sequences. + +Wed Oct 23 22:48:44 CEST 2002 Jan Hubicka + + * i386.md (abs splitters): Do not produce nested subregs. + +Wed Oct 23 12:42:32 CEST 2002 Jan Hubicka + + * i386.md (movti_rex64): Fix constraints. + +Wed Oct 23 12:01:21 CEST 2002 Jan Hubicka + + * i386.md (abssf,absdf): Use vector operands for SSE + (abssf2_ifs, absdf2_ifs, absdf2_ifs_rex64 and splitters): Update for + vector operand. + +2002-10-23 Ziemowit Laski + + * objc/objc-act.c (get_static_reference): Remove unneeded + TYPE_BINFO initialization. + (get_object-reference): Likewise. + (build_constructor): Tighten precondition check. + (finish_message_expr): Likewise. + +2002-10-23 Jakub Jelinek + + * config/i386/i386.c (local_symbolic_operand): Move LABEL_REF test + after CONST test. + +2002-10-23 Steve Ellcey + + * config/ia64/ia64.c (hfa_element_mode): Don't allow 128 bit floats + in HFAs. + +2002-10-23 Richard Henderson + + * config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): True. + (alpha_output_mi_thunk_osf): Handle vcall_offset. + +2002-10-23 Zack Weinberg + + * langhooks.h (struct lang_hooks_for_tree_inlining): Add + var_mod_type_p. + * langhooks-def.h: Default for tree_inlining.var_mod_type_p is + hook_tree_bool_false. + + * tree.c (variably_modified_type_p): Moved here from + cp/tree.c. Use lang_hooks.tree_inlining.var_mod_type_p for + language-specific cases. Due to this, must weaken some 'if + and only if' checks to merely 'if'. + * tree.h: Prototype variably_modified_type_p. + + * tree-inline.c (walk_tree): #undef WALK_SUBTREE_TAIL at end. + +2002-10-23 Ulrich Weigand + + * config/s390/linux.h (CC1_SPEC, CC1PLUS_SPEC): Remove. + * config/s390/s390.c (optimization_options): Disable -fcaller-saves. + + * config/s390/s390-protos.h (fp_operand): Remove. + * config/s390/s390.c (fp_operand): Remove. + * config/s390/s390.md ("movdi"): Replace fp_operand by FP_REG_P. + ("*movdi_lhi", "*movdi_lli", "*movdi_larl"): Likewise. + ("movsi", "*movsi_lhi", "*movsi_lli"): Likewise. + (movdi_31, movdf_31 splitters): Likewise. + + * config/s390/s390.h (IEEE_FLOAT): Remove. + (TARGET_FLOAT_FORMAT): Define in terms of TARGET_IEEE_FLOAT. + (INT_REGNO_P): Rename to ... + (GENERAL_REGNO_P): ... this. + (FLOAT_REGNO_P): Rename to ... + (FP_REGNO_P): ... this. + (ADDR_REGNO_P): New macro. + (GENERAL_REG_P, ADDR_REG_P, FP_REG_P, CC_REG_P): New macros. + (REGNO_OK_FOR_DATA_P, REGNO_OK_FOR_FP_P): Remove. + (DATA_REG_P, FP_REG_P, ADDRESS_REG_P): Likewise. + (HARD_REGNO_NREGS): Adapt to macro renaming. + (HARD_REGNO_MODE_OK): Likewise. + +2002-10-23 David Edelsohn + Geoff Keating + + * config/rs6000/rs6000.c (rs6000_register_move_cost): New function. + (rs6000_memory_move_cost): New function. + * config/rs6000/rs6000-protos.h: Declare them. + * config/rs6000/rs6000.h: Use them. + +2002-10-23 Ulrich Weigand + + * libgcc2.c (__udiv_w_sdiv): Use attribute ((always_inline)) when + inlining it into other libgcc2 routines. + (__udivmoddi4): Likewise. + +2002-10-22 Nathanael Nerode + + * doc/sourcebuild.texi (Test Suites): Improve. + +2002-10-22 Stan Shebs + + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Add missing + case for Darwin. + +2002-10-22 Jim Wilson + + * config/i386/i386.md (subdi3_1): Add call to ix86_binary_operator_ok. + +Wed Oct 23 01:52:36 CEST 2002 Jan Hubicka + + PR other/8289 + * xmmintrin.h: Add const to the argument of loads. + + * i386.md (pushv2di): New pattern. + PR target/6890 + * xmmintrin.h (_MM_TRANSPOSE4_PS): New. + +2002-10-22 Richard Henderson + + * target.h (gcc_target.asm_out): Merge output_mi_thunk and + output_mi_vcall_thunk into a single hook. Add can_output_mi_thunk. + * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Don't conditionalize. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove. + (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + (TARGET_ASM_OUT): Update. + * hooks.c (hook_bool_tree_hwi_hwi_tree_false): New. + (hook_bool_tree_hwi_hwi_tree_true): New. + (default_can_output_mi_thunk_no_vcall): New. + * hooks.h: Declare them. + * system.h (ASM_OUTPUT_MI_THUNK): Poison. + + * config/alpha/alpha.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + (alpha_output_mi_thunk_osf): Add VCALL_OFFSET parameter. + * config/arm/arm.c, config/cris/cris.c, config/frv/frv.c, + config/i960/i960.c, config/ia64/ia64.c, config/m68k/m68k.c, + config/mmix/mmix.c, config/pa/pa.c, config/sparc/sparc.c, + config/stormy16/stormy16.c: Similarly. + + * config/i386/i386.c (x86_output_mi_thunk): Merge vcall_offset code. + Handle 64-bit properly. Streamline. + (x86_output_mi_vcall_thunk): Remove. + (x86_this_parameter): Rename from ia32_this_parameter; handle 64-bit. + (x86_can_output_mi_thunk): New. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Remove. + (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + (override_options): Don't zap targetm.asm_out.output_mi_vcall_thunk. + + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Rename from + output_mi_thunk; make static; always use function_section. + (TARGET_ASM_OUTPUT_MI_THUNK): New. + (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + (rs6000_ra_ever_killed): Test no_new_pseudos not + targetm.asm_out.output_mi_thunk in conjunction with thunks. + * config/rs6000/rs6000-protos.h: Update. + * config/rs6000/sysv4.h (TARGET_ASM_OUTPUT_MI_THUNK): Remove. + * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't call + xcoffout_declare_function when using rs6000_output_mi_thunk. + + * config/s390/s390.c (s390_output_mi_thunk): Rename from + s390_output_mi_vcall_thunk. + (TARGET_ASM_OUTPUT_MI_THUNK): Remove. + (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + + * config/vax/vax.c (vax_output_mi_thunk): Static; add vcall_offset. + (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): New. + * config/vax/vax-protos.h: Update. + * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove. + +Wed Oct 23 00:33:11 CEST 2002 Jan Hubicka + + * i386.c (standard_sse_constant_p): Accept vector and integer zeros too. + * i386.h (EXTRA_CONSTRAINT): Recognize 'C' + * i386.md (movti_internal): Use 'C' + + * xmmintrin.h (_mm_cmplt_epi*): New. + +2002-10-22 Ulrich Weigand + + * config/s390/s390.md ("*movdi_64"): Fix op_type attribute. + ("*movdf_64"): Likewise. + ("*lshrdi3_64"): Likewise. + ("blockage"): Add length attribute. + ("lit"): Likewise. + +Tue Oct 22 23:51:34 CEST 2002 Jan Hubicka + + * i386.md: FIx typo. + (sse2_cvtsi2sd, sse2_pslrdq): Fix template. + (sse2_umulv2siv2di3): Fix predicate. + (sse2_psadbw, ashrv8hi3, ashrv4si3, lshrv8hi3 lshrv4si3, + lshrv2di3, ashlv8hi3, ashlv4si3, ashlv2di3): Likewise. + * xmmintrin.h (_mm_mul_epu16): Rename to... + (_mm_mul_epu32): This one. + (_mm_cvtsi32_si128, _mm_cvtsi128_si32): New. + + (contains_128bit_aligned_vector_p): Undo accidental checkin. + +2002-10-22 Eric Christopher + + * config/sparc/sparc.h: Add #error. + +2002-10-22 Ulrich Weigand + + * config.gcc [s390-*-linux]: Remove s390/t-linux from tmake_file. + [s390x-*-linux*]: Likewise. + * config/s390/t-linux: Remove. + * config/s390/s390.h: Include fixdfdi.h when building libgcc2. + +Tue Oct 22 19:07:03 CEST 2002 Jan Hubicka + + * i386.c (builtin_description): Add IX86_BUILTIN_PUNPCKHQDQ128. + (ix86_expand_builtin): Fix MASKMOVDQU expasion. + * i386.h (ix86_builtins): Add IX86_BUILTIN_PUNPCKHQDQ128. + * i386.md (mmx_punpck?dq): Simplify. + (sse2_pubpcklqdq): Fix. + (sse2_pubpckhqdq): New. + * xmmintrin.h (_mm_unpackhi_epi32): New. + + * xmmintrin.h (_mm_cvt*, _mm_stream_pd): Fix prototypes. + (_mm_shufflehi_epi16, _mm_shufflelo_epi16): Fix typo. + +2002-10-22 Nathan Sidwell + + PR c++/7209 + * fold_const.c (fold_binary_op_with_conditional_arg): Always + build compound_expr if we used save_expr. + +2002-10-22 Alan Modra + + * output.h (SECTION_NOTYPE): Define. + * varasm.c (default_section_type_flags_1): Set SECTION_NOTYPE for + init array sections. + (default_elf_asm_named_section): Mind SECTION_NOTYPE. + * config/arm/arm.c (arm_elf_asm_named_section): Likewise. Also + merge TLS support. + +2002-10-21 Richard Henderson + + * config/i386/i386.c (ix86_function_ok_for_sibcall): Look at + the function type, not the return type. + +2002-10-21 Richard Henderson + + * real.c (sticky_rshift_significand): Return inexact, don't + or it in immediately. + (sub_significands): Accept incomming carry. + (div_significands, rtd_divmod): Update for sub_significands change. + (round_for_format): Update for sticky_rshift_significand change. + (do_add): Don't involve the inexact bit in addition, do give the + inexact bit as the subtraction carry-in. + (encode_internal, decode_internal, real_internal_format): New. + * real.h (real_internal_format): Declare. + +2002-10-21 Ulrich Weigand + + * libgcc2.c: Fix __udiv_w_sdiv breakage on platforms that + don't define sdiv_qrnnd. + +2002-10-21 Kazu Hirata + + * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Simplify + using IN_RANGE. + (TINY_CONSTANT_ADDRESS_P): Likewise. + +Tue Oct 22 00:04:20 CEST 2002 Jan Hubicka + + * i386.c (builtin_description): Add punpcklqdq and movdq2q + (ix86_init_mmx_sse_builtins): Add v2di_ftype_void, di_ftype_v2di, + v16qi_ftype_pchar, void_ftype_pchar_v16qi, v4si_ftype_pchar, + void_ftype_pchar_v4si; Initialize __builtin_ia32_movdq2q, + __builtin_ia32_loaddqa, __builtin_ia32_loaddqu, __builtin_ia32_loadd + __builtin_ia32_storedqa, __builtin_ia32_storedqu, __builtin_ia32_stored + __builtin_ia32_setzero128. + (ix86_expand_builtin): Handle IX86_BUILTIN_CLRTI, IX86_BUILTIN_LOADDQA, + IX86_BUILTIN_LOADDQU, IX86_BUILTIN_LOADD, IX86_BUILTIN_STOREDQA, + IX86_BUILTIN_STOREDQU, IX86_BUILTIN_STORED, Ix86_BUILTIN_MOVQ. + * i386.h (ix86_builtins): Add IX86_BUILTIN_LOADDQA, IX86_BUILTIN_LOADDQU, + IX86_BUILTIN_STOREDQA, IX86_BUILTIN_STOREDQU, IX86_BUILTIN_LOADD, + IX86_BUILTIN_STORED, IX86_BUILTIN_CLRTI, IX86_BUILTIN_MOVDQ2Q, + IX86_BUILTIN_PUNPCKLQDQ128, Ix86_BUILTIN_MOVQ. + * i386.md (sse2_punpcklqdq, sse2_movqsse2_loadd, sse2_stored, + sse2_movq): New patterns. + (sse2_movdqa, sse2_movdqu, sse2_movdq2q): Fix. + * xmmintrin.h (_mm_load_si128, _mm_loadu_si128, _mm_loadl_epi64, + _mm_store_si128, _mm_storeu_si128, _mm_storel_epi64, + _mm_setzero_si128, _mm_set_epi64, _mm_set_epi32, _mm_set_epi16, + _mm_set_epi8, _mm_set1_epi64, _mm_set1_epi32, _mm_set1_epi16, + _mm_set1_epi8, _mm_setr_epi64, _mm_setr_epi32, _mm_setr_epi16, + _mm_setr_epi8, _mm_unpacklo_epi64,_mm_set_moveq): New functions. + (_mm_insert_epi16): Fix. + +2002-10-21 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_reverse_condition): Handle + unsafe math reversals correctly for RTL generation. + (output_cbranch): Replace rs6000_reverse_condition call + by its former definition. + +2002-10-21 Jakub Jelinek + + * config/i386/i386.c (x86_64_sign_extended_value): Add allow_rip + argument. In CM_SMALL_PIC model consider SYMBOL_REFs binding locally or + from constant pool or LABEL_REFs as sign extended if allow_rip. + Change all +-1GB limits to +-16MB. + (x86_64_general_operand, x86_64_szext_general_operand, + x86_64_nonmemory_operand, x86_64_movabs_operand, + x86_64_szext_nonmemory_operand, x86_64_immediate_operand, + legitimate_address_p, ix86_expand_int_movcc): Update callers. + (local_symbolic_operand): Don't allow offsets bigger than +-16MB + in CM_SMALL_PIC model. + (legitimate_pic_address_disp_p): Don't check offsets before + calling local_symbolic_operand. + (legitimize_pic_address): Force offsets bigger than +-16MB into + register. + * config/i386/i386.h (EXTRA_CONSTRAINT, CONST_COSTS): Likewise. + * config/i386/i386-protos.h (x86_64_sign_extended_value): Update + prototype. + + * configure.in: Test for @GOTNTPOFF and @INDNTPOFF on IA-32 too. + Add x86-64 test. Set tls_first_minor to 14 on IA-32 and x86-64. + * configure: Rebuilt. + * config/i386/i386.c (x86_64_sign_extended_value): Don't allow TLS + SYMBOL_REFs unless enclosed in UNSPEC. Handle UNSPEC_DTPOFF, + UNSPEC_GOTNTPOFF and UNSPEC_NTPOFF. + (legitimate_address_p): Allow foo@dtpoff(base) even on TARGET_64BIT + -fpic. + (ix86_encode_section_info): Don't ever generate TLSGD or TLSLD for + non-pic code if TARGET_64BIT. + (legitimize_address): Generate 64-bit TLS sequences. + (output_pic_addr_const): Support x86-64 TLS operators. + (i386_output_dwarf_dtprel): Output 64-bit DTPOFF as .long f@DTPOFF, 0. + (print_operand_address): Use %fs instead of %gs on TARGET_64BIT. + Don't append (%rip) in 64-bit TLSGD and TLSLD sequences. + (output_addr_const_extra): Support x86-64 TLS operators. + (maybe_get_pool_constant): Handle TARGET_64BIT -fpic. + (ix86_tls_get_addr): Use __tls_get_addr on TARGET_64BIT + unconditionally. + * config/i386/i386.md (*tls_global_dynamic_gnu): Renamed to... + (*tls_global_dynamic_32_gnu): ..., add !TARGET_64BIT. + (*tls_global_dynamic_sun): Renamed to... + (*tls_global_dynamic_32_sun): ..., add !TARGET_64BIT. + (tls_global_dynamic): Renamed to... + (tls_global_dynamic_32): ... this. + (tls_global_dynamic_64, *tls_global_dynamic_64): New. + (*tls_local_dynamic_base_dynamic_gnu): Renamed to... + (*tls_local_dynamic_base_dynamic_32_gnu): ..., add !TARGET_64BIT. + (*tls_local_dynamic_base_dynamic_sun): Renamed to... + (*tls_local_dynamic_base_dynamic_32_sun): ..., add !TARGET_64BIT. + (tls_local_dynamic_base_dynamic): Renamed to... + (tls_local_dynamic_base_dynamic_32): ... this. + (tls_local_dynamic_base_dynamic_64, + *tls_local_dynamic_base_dynamic_64): New. + (*tls_local_dynamic_once): Renamed to... + (*tls_local_dynamic_32_once): ... this. + +2002-10-21 Ulrich Weigand + + * libgcc2.c: Inline __udiv_w_sdiv when compiling __udivdi3, + __divdi3, __umoddi3, or __moddi3. + +2002-10-21 Ulrich Weigand + + * c-opts.c (missing_arg): Use cl_options[opt_index].opt_code + instead of just opt_index as switch expression. + + * calls.c (store_one_arg): Change type of 'excess_align' + to unsigned int. + + * profile.c (output_gcov_string): Change type of 'temp' + to size_t. + +2002-10-21 Ulrich Weigand + + * config/s390/fixdfdi.h (__fixunsdfdi, __fixdfdi): Add prototypes. + (__fixunssfdi, __fixsfdi): Likewise. + * config/s390/s390.c (s390_single_hi): Initialize 'value'. + (s390_single_qi): Likewise. + (s390_emit_epilogue): Initialize 'offset'. Remove signed vs. + unsigned comparison warning. + (s390_return_addr_rtx): New function. + * config/s390/s390-protos.h (s390_return_addr_rtx): Declare it. + * config/s390/s390.h (RETURN_ADDR_RTX): Use it. + (HARD_REGNO_MODE_OK): Rewrite condition to silence warnings. + +2002-10-21 Ulrich Weigand + + * config/s390/s390.c (s390_output_mi_vcall_thunk): New function. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define target hook. + (s390_output_mi_thunk): Remove. + (TARGET_ASM_OUTPUT_MI_THUNK): Remove. + +2002-10-21 Kazu Hirata + + * config/h8300/h8300.h (N_REG_CLASSES): Parenthesize. + +2002-10-20 Zack Weinberg + + * config/i386/i386.c (ix86_function_ok_for_sibcall): Fix an + inverted test in the conditional determining the possibility + of sibcalls in PIC mode. + +2002-10-20 Richard Henderson + + * target.h (struct gcc_target): Line wrap. + + * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Static. + (TARGET_ASM_OUTPUT_MI_THUNK): Define here... + * config/alpha/alpha.h: ... not here. + * config/alpha/alpha-protos.h: Update. + + * config/arm/arm.c, config/arm/arm.h, config/arm/arm-protos.h + config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, + config/frv/frv-protos.h, config/frv/frv.c, config/frv/frv.h, + config/i386/i386-protos.h, config/i386/i386.c, config/i386/openbsd.h, + config/i386/unix.h, config/i960/i960-protos.h, config/i960/i960.c, + config/i960/i960.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, + config/ia64/ia64.h, config/m68k/linux.h, config/m68k/m68k-protos.h, + config/m68k/m68k.c, config/m68k/netbsd-elf.h, config/m68k/openbsd.h, + config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, + config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, + config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, + config/sparc/openbsd.h, config/sparc/sparc-protos.h, + config/sparc/sparc.c, config/sparc/sparc.h, + config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, + config/stormy16/stormy16.h: Similarly. + + * config/m68k/m68k.c (m68k_output_mi_thunk): Replicate mnemonic + selection logic from call patterns. + +2002-10-20 Mark Mitchell + + * config/m68k/m68k.c (m68k_output_mi_thunk): Fix typo. + +2002-10-20 Zdenek Dvorak + + PR other/8202 + * i386.c (ix86_init_mmx_sse_builtins, ix86_expand_builtin): Define and + expand __builtin_ia32_pslldqi128 and __builtin_ia32_psrldqi128. + * i386.h (IX86_BUILTIN_PSLLDQI128, IX86_BUILTIN_PSRLDQI128): New. + * xmmintrin.h (_mm_srli_si128, _mm_slli_si128): New. + +2002-10-20 Roger Sayle + + PR c/761 + * toplev.c (flag_unsafe_profile_arcs): Remove. + (flag_bounded_pointers): Remove. + (flag_bounds_check): Correct comments. + (lang_independent_options): Remove -funsafe-profile-arcs and + -fbounded-pointers. Correct -fbounds-check comments. + + * flags.h: Correct flag_schedule_interblock comments. + (flag_bounded_pointers): Remove prototype. + (flag_bounds_check): Correct comments. + + * c-opts.c (c_common_init_options): No need to mark + flag_bounds_check as unspecified. + (c_common_post_options): And no need to set it from + flag_bounded_pointers if its still unspecified. + + * doc/invoke.texi: Fix some overfull hboxes in "make dvi". + Document --version, -feliminate-dwarf-2-dups, -fno-sched-interblock, + -fno-sched-spec, -fsched-spec-load, -fsched-spec-load-dangerous, + -fsched-verbose=n, -fno-branch-count-reg and -fbounds-check. + +Sat Oct 19 22:02:28 2002 Alexandre Oliva + Angela Marie Thomas + Brendan Kehoe + Nick Clifton + Andrew Haley + + * configure.in (--with-sysroot): New. Don't inhibit libc if + given. AC_SUBST TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_DEFINE + and CROSS_SYSTEM_HEADER_DIR. + * configure: Rebuilt. + * Makefile.in (CROSS_SYSTEM_HEADER_DIR): Set in configure. + (TARGET_SYSTEM_ROOT): New. + (DRIVER_DEFINES): Define CROSS_INCLUDE_DIR from + CROSS_SYSTEM_HEADER_DIR. + (install-gcc-tooldir): New target. + (stmp-fixinc): Do not create $(libsubdir), but rather bail out + if SYSTEM_HEADER_DIR does not exist and it's not the default + sys-include directory. + (deduced.h, stmp-fixproto): Quote SYSTEM_HEADER_DIR properly. + (install-mkheaders): Likewise. + * gcc.c (target_system_root): New variable. + (add_sysrooted_prefix): New function. + (process_command): Recompute run-time target_system_root from + gcc_exec_prefix, keeping it unchanged if the relocated sysroot + does not exist. + (do_spec_1): Process 'R' spec. + (main): Add md_exec_prefix to exec_prefixes regardless of + startfile_prefix_spec. Use add_sysrooted_prefix for + startfile_prefixes, and don't skip the default ones when cross + compiling with sysroot enabled. Removed unused case of + non-absolute standard_startfile_prefix. + * config/interix.h: Remove the only potential, yet disabled, + occurrence of non-absolute (empty) standard_startfile_prefix. + * config/sh/linux.h (LIB_SPEC): Add -rpath-link in non-static + linking. + * config/mips/linux.h (LIB_SPEC): Define as in sh/linux.h. + * doc/install.texi (--with-sysroot): Document. + (--with-headers, --with-libs): Deprecate. + +2002-10-19 Kaveh R. Ghazi + Mark Mitchell + + * alpha-protos.h (alpha_output_mi_thunk_osf): Update signature to + match target.h. + * arm-protos.h, arm.c (arm_output_mi_thunk): Likewise. + * cris-protos.h, cris.c (cris_asm_output_mi_thunk): Likewise. + * frv-protos.h, frv.c (frv_asm_output_mi_thunk): Likewise. + * i386-protos.h, i386.c (x86_output_mi_vcall_thunk, + x86_output_mi_thunk): Likewise. + * i960-protos.h, i960.c (i960_output_mi_thunk): Likewise. + * ia64-protos.h, ia64.c (ia64_output_mi_thunk): Likewise. + * m68k-protos.h, m68k.c (m68k_output_mi_thunk): Likewise. + * mmix-protos.h, mmix.c (mmix_asm_output_mi_thunk): Likewise. + * rs6000-protos.h, rs6000.c (output_mi_thunk): Likewise. + * s390-protos.h, s390.c (s390_output_mi_thunk): Likewise. + * stormy16-protos.h, stormy16.c (xstormy16_asm_output_mi_thunk): + Likewise. + * vax-protos.h, vax.c (vax_output_mi_thunk): Likewise. + + * target.h (gcc_target): Update output_mi_thunk and + output_mi_vcall_thunk to take a HOST_WIDE_INT delta and + vcall_index. + + * config/alpha/alpha.c: Replace ASM_OUTPUT_MI_THUNK with + TARGET_ASM_OUTPUT_MI_THUNK in comments. + * config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): Don't #undef it. + (TARGET_ASM_OUTPUT_MI_THUNK): #undef it. + * config/frv/frv.h (DEFAULT_VTABLE_THUNKS): Remove definition. + * config/i386/i386-protos.h (x86_output_mi_vcall_thunk): Update + signature. + * config/i386/i386.c (x86_output_mi_vcall_thunk): Likewise. + * config/i386/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with + TARGET_ASM_OUTPUT_MI_THUNK in comments. + * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Don't define. + (TARGET_ASM_OUTPUT_MI_THUNK): Do define. + * config/m68k/openbsd.h: Replace ASM_OUTPUT_MI_THUNK with + TARGET_ASM_OUTPUT_MI_THUNK in comments. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Remove #ifdef + ASM_OUTPUT_MI_THUNK and replace with check of targetm. + + * doc/tm.texi (TARGET_ASM_OUTPUT_MI_THUNK): Update signature. + (TARGET_ASM_OUTPU_MI_VCALL_THUNK): Likewise. + +2002-10-19 Brad Lucier + + * real.c (do_add): Fix 0+0 sign corner case. + (do_divide): Fix Inf/0 corner case. + +Sun Oct 20 00:31:31 CEST 2002 Jan Hubicka + + * i386.c (classify_argument): Pass MMX arguments in memory + (ix86_expand_builtin): Expand proper address mode for cflush. + * i386.md (movdqa): Fix typo. + (sse2_cflush): Accept DImode addresses. + + * xmmintrin.h (_mm_sqrt_sd): Accept two arguments. + (_mm_max_sd): Fix pasto. + (_mm_storeh_pd, _mm_storel_pd): Fix. + + * i386.c (bdesc_comi): Fix to match specification. + (ix86_expand_sse_comi): Emit the comparison properly. + * i386.md (sse_comi, sse2_comi, sse_ucomi, sse2_ucomi): + Do not use comparison operator. + (vnmaskcmp): Fix template. + + * xmmintrin.h (_mm_cvtps_pi16): Fix. + +2002-10-19 Sebastian Pop + + * dependence.c : Removed. + * Makefile.in : Remove dependence.o. + +Sat Oct 19 10:46:52 CEST 2002 Jan Hubicka + + * mmintrin.h (__m64): typedef it to v2si. + (_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16, + _mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16, + _mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64, + _mm_srli_pi64, _mm_and_si64, _mm_andnot_si64, + _mm_or_si64, _mm_xor_si64): Add neccesary casts. + * xmmintrin.h (_mm_setzero_si64): Likewise. + + * i386.h (ALIGN_MODE_128): Update comment; add missing modes + (SSE_REG_MODE_P, MMX_REG_MODE_P): New macros. + + PR target/7693 + Patch by Shawn Wagner + * mmintrin.h: Replace pi64 by si64. + +2002-10-18 David Edelsohn + + * rs6000.md (movdf_hardfloat32): Order alternatives consistently. + Use length of 4 not *. + (movdf_hardfloat64): Same. Support DFmode moves to/from CTR/LR. + (movdf_softfloat64): Likewise. + (movdi_internal32): Use length of 4 not *. + (movti_power): Same. + (ctrsi, ctrdi): Same. + +2002-10-18 Zack Weinberg + + * c-decl.c (start_decl): Point users of the old initialized- + typedef extension at __typeof__. + +2002-10-18 Richard Henderson + + * real.c (cmp_significand_0, rtd_divmod, ten_to_mptwo): New. + (real_to_decimal): Re-implement using the logic from the + gcc 3.2 etoasc. Comment heavily. + (div_significands): Simplify loop startup and comparison logic. + +2002-10-18 Mark Mitchell + + * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. + (TARGET_ASM_OUT): Add them. + * target.h (asm_out): Add output_mi_thunk and + output_mi_vcall_thunk. + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. + * config/arm/arm.c (arm_output_mi_thunk): Define. + * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust + prototype. + (x86_output_mi_vcall_thunk): Declare. + * config/i386/i386.c (override_options): Clear + output_mi_vcall_thunk in 64-bit mode. + (ix86_fntype_regparm): New function. + (ix86_return_pops_args): Use it. + (ia32_this_parameter): New function. + (x86_output_mi_vcall_thunk): New function. + (x86_output_mi_thunk): Use it + * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. + * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. + * config/i960/i960.c (i960_output_mi_thunk): New function. + * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. + * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. + * config/ia64/ia64.c (ia64_output_mi_thunk): Define. + * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. + * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. + * config/s390/s390.c (s390_output_mi_thunk): Define. + * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. + * config/vax/vax.c (vax_output_mi_thunk): Define. + * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... + (TARGET_ASM_OUTPUT_MI_THUNK): ... this. + * doc/tm.texi: Adjust documentation. + +2002-10-18 Jason Thorpe + + * config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): Define + __enable_execute_stack function. + * config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Define + as NETBSD_ENABLE_EXECUTE_STACK. + * config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Ditto. + * config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Ditto. + * config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Ditto. + * config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Ditto. + * config/sparc/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Ditto. + +2002-10-18 Jason Thorpe + + * config/i386/i386.c (x86_initialize_trampoline): Emit a call + to __enable_execute_stack with the address of the trampoline + if TRANSFER_FROM_TRAMPOLINE is defined. + * config/i386/i386.h (TARGET_64BIT): Expand to a compile-time + constant if building libgcc2. + +Thu Oct 17 17:40:05 CEST 2002 Jan Hubicka + + * i386.c (pentium4_cost): Fix according to Intel recommendations. + (ix86_memory_move_cost): Fix for 64bit compilation. + +2002-10-17 Roger Sayle + + * doc/c-tree.texi: Update description of COND_EXPR tree nodes. + +2002-10-17 Geoffrey Keating + + * config/rs6000/rs6000.h (HARD_REGNO_MODE_OK): Allow arbitrary modes + in CTR/LR/MQ. + * config/rs6000/rs6000.md (movcc_internal1): Support CCmode moves + to/from CTR/LR/MQ. + (movsf_hardfloat): Support SFmode moves to/from CTR/LR/MQ. + (movsf_softfloat): Likewise. + +2002-10-17 Janis Johnson + + * Makefile.in (site.exp): Add ALT_CXX_UNDER_TEST and COMPAT_OPTIONS. + +2002-10-17 Jason Thorpe + + * config/alpha/alpha.c (alpha_initialize_trampoline): Use + tramp, not addr, to pass the trampoline address to + __enable_execute_stack. + +Thu Oct 17 18:40:47 CEST 2002 Jan Hubicka + + * mmintrin.h: Guard by __MMX__ + * xmmintrin.h: Guard by __SSE__ + + PR other/8062 + * xmmintrin.h (_MM_SHUFFLE2): New macro. + (_mm_load*_?d): New functions. + (_mm_set*_?d): New functions. + (_mm_store*_?d): New functions. + +Wed Oct 16 15:01:29 CEST 2002 Jan Hubicka + + Really commit patch announced at Oct 14 + PR c/7344 + * predict.c (can_predict_insn_p): New function. + (estimate_probability): Avoid unnecesary work. + (process_note_prediction): Likewise. + * toplev.c (rest_of_compilation): Account early branch prediction pass + as TV_BRANCH_PROB. + + PR other/8048 + Found by Ian Ollmann + * xmmintrin.h (_mm_shuffle_pd): Fix typo. + (_mm_load?_pd): Likewise. + (_mm_store?_pd): Likewise. + + PR target/7386 + * i386.c (builtin_description):Drop cmpg[te]s[sd]. + * xmmintrin.h (__mm_cmpg[te]_s[sd]): Rewrite using + swapped alternative. + + PR opt/7630 + * reload1.c (reload_inner_reg_of_subreg): New argument output; + (push_reload): Update call. + +2002-10-17 Richard Sandiford + + * config.gcc (mips*-*-*): Add OBJECT_FORMAT_ELF to $tm_defines + if using mips/elf.h or mips/elf64.h. + * config/mips/elf.h (OBJECT_FORMAT_ELF): Remove. + * config/mips/elf64.h (OBJECT_FORMAT_ELF): Remove. + +2002-10-16 Aldy Hernandez + + * config/rs6000/rs6000.c (function_arg): Set inner mode of V1DI to + SI. + +2002-10-16 Ulrich Weigand + + * config/s390/linux.h (ASM_DOUBLE, _ASM_OUTPUT_LONG): Remove. + (LPREFIX): Likewise. + (ASM_COMMENT_START, LOCAL_LABEL_PREFIX, ASM_FORMAT_PRIVATE_NAME, + ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT, + ASM_OUTPUT_ALIGN, ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_BSS, + TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, BSS_SECTION_ASM_OP, + GLOBAL_ASM_OP, ASM_OUTPUT_MI_THUNK): Move to s390.h. + + * config/s390/s390.h (ASM_COMMENT_START, LOCAL_LABEL_PREFIX, + ASM_FORMAT_PRIVATE_NAME, ASM_OUTPUT_ALIGN, ASM_OUTPUT_SKIP, + ASM_OUTPUT_ALIGNED_BSS, TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP, + BSS_SECTION_ASM_OP): Move from linux.h. + (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + Also, use ASM_GENERATE_INTERNAL_LABEL instead of LPREFIX. + + * config/s390/s390.c (s390_function_profiler): Use + ASM_GENERATE_INTERNAL_LABEL instead of LPREFIX. + +2002-10-15 Eric Christopher + + * stor-layout.c (layout_type): Call GET_MODE_BITSIZE once. + * java/parse.y (obtain_incomplete_type): Make pointer + ptr_mode. + +2002-10-15 Richard Henderson + + * real.c (real_to_decimal): Accept BUF_SIZE and CROP_TRAILING_ZEROS + as arguments. Bound DIGITS by the available buffer size. + (real_to_hexadecimal): Likewise. + * real.h (real_to_decimal, real_to_hexadecimal): Update prototypes. + (REAL_VALUE_TO_DECIMAL): Remove. + * c-common.c, c-pretty-print.c, print-rtl.c, print-tree.c, + sched-vis.c, config/arc/arc.c, config/c4x/c4x.c, config/fr30/fr30.c, + config/i370/i370.h, config/i386/i386.c, config/i960/i960.c, + config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, + config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/sun2o4.h, + config/m68k/sun3.h, config/mips/mips.c, config/ns32k/ns32k.c, + config/pdp11/pdp11.h, config/vax/vax.h: Update all callers to + use real_to_decimal directly, and with the proper arguments. + * doc/tm.texi (REAL_VALUE_TO_DECIMAL): Remove. + +2002-10-15 Jim Wilson + + * reload1.c (merge_assigned_reloads): After converting overlapping + reloads to RELOAD_OTHER, abort if there are now conflicting reloads. + + * config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok. + +Tue Oct 15 22:08:35 CEST 2002 Jan Hubicka + + * expr.c (do_tablejump): Fix typo in my previous commit. + +2002-10-15 Richard Sandiford + + * config/mips/vr.h (DRIVER_SELF_SPECS): Change % + + * config/s390/s390.c (s390_split_branches): Add return + value. Add parameters TEMP_REG and TEMP_USED. Use unspec 104. + + (find_base_register_in_addr): New function. + (find_base_register_ref): New function. + (replace_base_register_ref): New function. + + (struct constant_pool): Add members pool_insn, insns, and anchor. + Remove member last_insn. + (s390_start_pool): Initialize them. + (s390_end_pool): Emit pool placeholder insn. + (s390_add_pool_insn): New function. + (s390_find_pool): Use insns bitmap instead of addresses. + (s390_dump_pool): Replace placeholder insn. Emit anchor. + Replace unspec 104 by local-pool-relative references. + (s390_output_constant_pool): Output anchor label if required. + (s390_output_symbolic_const): Handle unspec 104 and 105. + (s390_add_pool): Remove, replace by ... + (s390_add_constant, s390_find_constant): ... these new functions. + (s390_add_anchor): New function. + + (s390_chunkify_pool): Delete, replace by ... + (s390_chunkify_start, s390_chunkify_finish, + s390_chunkify_cancel): ... these new functions. + (s390_optimize_prolog): Add parameter TEMP_REGNO. + Recompute register live data for special registers. + (s390_fixup_clobbered_return_reg): New function. + (s390_machine_dependent_reorg): Rewrite to use new + s390_chunkify_... routines. + + config/s390/s390.md ("reload_base"): Rename to ... + ("reload_base_31"): ... this. + ("reload_base_64"): New insn. + ("reload_base2"): Remove. + ("reload_anchor"): New insn. + ("pool"): New insn. + + s390.c (s390_pool_overflow): Remove. + s390.h (s390_pool_overflow): Likewise. + s390.md ("cjump", "icjump", "doloop_si"): Remove s390_pool_overflow. + +Tue Oct 15 16:51:04 2002 J"orn Rennecke + + * sh.md (movv8qi_i+2): Don't split if source is -1. + +2002-10-15 Janis Johnson + + * doc/install.texi: Formatting changes for conformance to HTML 4.01. + +2002-10-15 Ulrich Weigand + + PR opt/7409 + * loop.c (loop_regs_scan): Mark registers used for function + argument passing as MAY_NOT_OPTIMIZE. + +Mon Oct 14 19:22:19 CEST 2002 Jan Hubicka + + * gcov-io.h (gcov_info): Fix type. + * profile.c (create_profiler): Fix type mismatch. + +Mon Oct 14 20:33:12 CEST 2002 Jan Hubicka + + * i386.md (movv2di_internal): New pattern. + (movv2df_internal, movv8hi_internal, movv16qi_internal): Fix predicate. + (movv2di): New expander. + * i386.c (ix86_preferred_reload_class): Return NO_REGS for vector operands. + + * i386.c (ix86_expand_timode_binop_builtin): Delete. + (builtin_description): Add SSE1 logicals; rename SSE2 logicals. + (ix86_init_mmx_sse_builtins): Kill SSE1 logicals. + (ix86_expand_builtin): Likewise. + * i386.h (sse_andti4_df_1, sse_andti3_df_2, sse_andti3_sf_1, sse_andti3_sf_2, + sse_andti3, + sse_andnti4_df_1, sse_andti3_df_2, sse_andti3_sf_1, sse_andti3_sf_2, + sse_andnti3, + sse_orti4_df_1, sse_orti3_df_2, sse_orti3_sf_1, sse_orti3_sf_2, + sse_orti3, + sse_xorti4_df_1, sse_xorti3_df_2, sse_xorti3_sf_1, sse_xorti3_sf_2, + sse_xorti3): Kill. + (sse_andv4sf3, sse_andnv4sf3, sse_orv2df3, sse_xorv2df3, sse_andv2df3, + sse_andnv2df3, sse_orv2df3, sse_xorv2df3): New expanders. + (*sse_andv4sf3, *sse_andnv2df3, *sse_orv4sf3, *sse_xorv4sf3, *sse_andv2df3, + *sse_andnv2df3, *sse_orv2df3, *sse_xorv2df3): New patterns. + (*sse_andsf3, *sse_andndf3, *sse_ordf3, *sse_xordf3, *sse_anddf3, + *sse_andndf3, *sse_orv2df3, *sse_xorv2df3): New patterns. + + * xmmintrin.h (__m128i): Define as __v2di. + + PR c++/6419 + (expand_expr): Use DECL_RTL_SET_P. + +2002-10-14 Roger Sayle + + * combine.c (simplify_set): Treat MODE_CC registers like cc0. + +2002-10-14 Roger Sayle + Zack Weinberg + + * config/i386/i386.c (k6_cost): Correct typo. + +2002-10-14 Mark Mitchell + + PR optimization/6631 + * alias.c (objects_must_conflict_p): Check honor_readonly when + examining TYPE_READONLY. + * function.c (assign_stack_temp_for_type): Likewise. + +2002-10-14 Falk Hueffner + + * config/alpha/alpha.md (extendsidi2_nofix, extendsidi2_fix): + Swap zero extension arguments. + (umaxhi3): Fix instruction class. + PR target/7211 + (prefetch): Fix prefetch instructions. + PR target/7238 + (pkwb): Fix output constraint. + +2002-10-14 Alexandre Oliva + + * config/mips/mips.c (print_operand): Increase buffer size for + real numbers. + +2002-10-14 Richard Henderson + + PR opt/8165 + * gcse.c (adjust_libcall_notes): Revert last change. + * simplify-rtx.c (simplify_replace_rtx): Handle LO_SUM. + +2002-10-14 Andrew Haley + + * tree-inline.c (remap_block): All local class initialization + flags go in the outermost scope. + (expand_call_inline): Call java_inlining_map_static_initializers. + (expand_call_inline): Call java_inlining_merge_static_initializers. + * java/lang.c (merge_init_test_initialization): New. + (java_inlining_merge_static_initializers): New. + (inline_init_test_initialization): New. + (java_inlining_map_static_initializers): New. + + * tree-inline.c (expand_call_inline): Convert retvar to expected + type. + +2002-10-14 Graham Stott + + * stmt.c (decl_conflicts_with_clobbers_p): Add REG_P check. + +2002-10-14 Aldy Hernandez + + * stmt.c: Fix typo in comment. + +Mon Oct 14 11:35:49 2002 J"orn Rennecke + + * c-common.c (c_common_type_for_mode): Add V2HImode case. + * tree.c (build_common_tree_nodes_2): Initialize + unsigned_V2HI_type_node and V2HI_type_node. + * tree.h (enum tree_index): Add TI_UV2HI_TYPE and TI_V2HI_TYPE. + (unsigned_V2HI_type_node, V2HI_type_node): Define. + +2002-10-14 Jakub Jelinek + + * config/i386/i386.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): + Handle TARGET_64BIT. + +2002-10-14 Richard Sandiford + + * config/mips/vr.h (DRIVER_SELF_SPECS): Define. + * config/mips/t-vr (MULTILIB_OPTIONS): Remove mlong32. + (MULTILIB_DIRNAMES): Remove long32. + (MULTILIB_EXCEPTIONS): Don't build -mabi=32 -mgp32 multilibs. + (MULTILIB_REDUNDANT_DIRS): Remove. + +2002-10-14 Richard Sandiford + + * doc/tm.texi (DRIVER_SELF_SPECS): Document. + * gcc.c (driver_self_specs): New variable. + (do_self_spec): New function. + (main): Use it to process driver_self_specs. + +2002-10-13 Richard Henderson + + * config/i386/i386.c (ix86_function_ok_for_sibcall): Reject + indirect sibcalls when regparm >= 3. + + * config/i386/i386.c (sibcall_insn_operand): New. + * config/i386/i386.h (PREDICATE_CODES): Update. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (sibcall_1, sibcall_value_1): Use it. + + * rtl.c (shallow_copy_rtx): Use memcpy for the entire node. + +2002-10-12 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation) [ASHIFTRT]: Optimize + arithmetic right shifts of ~0 during RTL simplifications. + +2002-10-12 Neil Booth + + PR preprocessor/7862 + PR preprocessor/8190 + * gcc.c (cpp_unique_options): Don't delete .d files. + Remove stray whitespace. + +2002-10-12 Naohiko Shimizu + + * pdp11.h (ASM_OUTPUT_SKIP): Add preceding 0 for octal constant. + (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. + * pdp11.c (pdp11_output_function_prologue): 0%o -> %#o. + (pdp11_output_function_epilogue, output_ascii): Likewise. + (output_addr_const_pdp11): Likewise. + * pdp11.md (movdi): Use offsetable memory for floating store. + (lshrsi3, negsi2): Delete irrelevant comment. + +2002-10-11 Andreas Bauer + + * config/i386/i386.c (ix86_function_ok_for_sibcall): Allow + indirect calls to be sibcall optimized. + * config/i386/i386.md (sibcall_1): New. + (call_1): Add no-sibcalls condition. + (sibcall_value_1): New. + (call_value_1): Add no-sibcalls condition. + +2002-10-11 Eric Christopher + + * output.h (default_valid_pointer_mode): Declare. + * varasm.c (default_valid_pointer_mode): Define. + * target-def.h (TARGET_VALID_POINTER_MODE): Use. + * target.h: Ditto. + * tree.c (build_pointer_type_for_mode): New function. + (build_pointer_type): Use. + (build_reference_type_for_mode): New function. + (build_reference_type): Use. + * tree.h: Declare new functions. + * c-common.c (handle_mode_attribute): Use new functions, check + for type. + * stor-layout.c (layout_type): Depend on machine mode for + REFERENCE_TYPE and POINTER_TYPE. + * dwarf2out.c (simple_type_size_in_bits): Move upward in file. + (modified_type_die): Use instead of PTR_SIZE for POINTER_TYPE + and REFERENCE_TYPE. + * config/mips/mips.c (mips_valid_pointer_mode): New function. + (TARGET_VALID_POINTER_MODE): Use and define. + * config/mips/mips-protos.h (mips_valid_pointer_mode): Declare. + +2002-10-11 Geoffrey Keating + + * cse.c (mention_regs): Set SUBREG_TICKED to the register number, + not the address of the REG. + (struct cse_reg_info): Make subreg_ticked unsigned. + +2002-10-11 Janis Johnson + + * doc/compat.texi: Add info about C++ libraries. + +2002-10-11 Richard Henderson + + PR opt/8165 + * gcse.c (adjust_libcall_notes): Also adjust notes for INSN. + +2002-10-11 John David Anglin + + * cfganal.c (dfs_enumerate_from): Use PARAMS. + * genautomata.c (output_insn_code_cases): Likewise. + * real.c (real_format): Likewise. + * tree.c (tree_size): Revise expressions using TREE_CODE_LENGTH to + ensure value is promoted before doing subtraction. + +Fri Oct 11 22:22:38 CEST 2002 Jan Hubicka + + * calls.c (expand_call): Simplify noreturn call. + + PR c/7344 + * cfgbuild.c (make_edges): Create edge cache when we do have + large jumptable. + * expr.c (do_tablejump): Note size of maximal jumptable. + * function.c (prepare_function_start): Zero out size. + * function.h (function): Add max_jumptable_ents. + + * cfgcleanup.c (insn_match_p): Verify sibcall flag for calls to. + +Fri Oct 11 12:34:33 2002 J"orn Rennecke + + * sh.md (movv8qi_i+2): For V8QI destinations, generate V4HI + register for mperm_w operation. + +Fri Oct 11 10:56:17 2002 J"orn Rennecke + + * emit-rtl.c (gen_lowpart_common): When asked to make a vector from + an integer, use simplify_gen_subreg. + +2002-10-10 Diego Novillo + + * calls.c (flags_from_decl_or_type): Make extern. + (ECF_*): Move ... + * rtl.h (ECF_*): ... here. + (flags_from_decl_or_type): Declare. + +2002-10-10 Roger Sayle + Nathan Sidwell + + * fold-const.c (fold) [RSHIFT_EXPR]: Optimize arithmetic right + shifts of the form -1 >> x. + +Thu Oct 10 16:52:55 CEST 2002 Jan Hubicka + + * cfgcleanup.c (insn_match_p): Verify sibcall flag for calls to. + +2002-10-10 Aldy Hernandez + + * extend.texi (Vector Extensions): Remove comment about single + element vectors. + +2002-10-10 Kaveh R. Ghazi + + * fold-const.c (size_htab_hash): Use htab_hash_pointer. + * function.c (insns_for_mem_hash): Likewise. + * varasm.c (STRHASH): Likewise. + +2002-10-10 Stuart Hastings + + * cse.c (struct cse_reg_info): Add subreg_ticked. + (SUBREG_TICKED): New. + (get_cse_reg_info): Initialize SUBREG_TICKED. + (mention_regs): Use it. + (invalidate): Set SUBREG_TICKED. + (invalidate_for_call): Likewise. + (addr_affects_sp_p): Likewise. + +2002-10-10 Jakub Jelinek + + * config/i386/i386.md (tls_local_dynamic_base): Put pic reg + into proper operand. + +2002-10-10 Denis Chertykov + + * config/ip2k/ip2k.c (function_epilogue): Optimize stack + deallocation. + * config/ip2k/libgcc.S: Combine routines used by function + epilogue. + +2002-10-10 Jim Wilson + + * cse.c (fold_rtx): Don't perform associative optimization for DIV and + UDIV. + +2002-10-10 David Edelsohn + + * config/rs6000/aix52.h: New file. + * config/rs6000/t-aix52: New File. + * config.gcc (rs6000-ibm-aix5.1.*): New entry. + (rs6000-ibm-aix[56789].*): Default to AIX 5.2. + +Thu Oct 10 19:37:54 CEST 2002 Jan Hubicka + + PR target/5610 + * invoke.texi (-msse-math): Kill + (-msse): Add note to mfpmath=sse. + +Thu Oct 10 17:08:30 CEST 2002 Jan Hubicka + + PR target/7723 + * i386.c (ix86_expand_vector_move): Do not generate const0->mem moves. + +2002-10-10 Neil Booth + + PR preprocessor/8179 + * gcc.c (cpp_options): Add {ansi}, move %{m*} to same location + as cc1_options. + (default_compilers): Pass debug options when preprocessing + stdin. + +2002-10-06 Richard Henderson + + * toplev.c (rest_of_compilation): Revert opt/2960 change. + +Wed Oct 9 21:18:43 CEST 2002 Jan Hubicka + + * i386.c (*_cost): Add branch costs. + (override_options): set ix86_branch_cost. + (ix86_expand_int_movcc): Use BRANCH_COST. + * i386.h (costs): Add branch_cost. + +2002-10-09 Zack Weinberg + + PR c/7353 + * c-decl.c (start_decl): Unconditionally issue error for + 'typedef foo = bar'. + (finish_decl): Remove special case for TYPE_DECL with initializer. + + * doc/extend.texi: Delete "Naming Types" section. Change all + cross-references to that section to refer to "Typeof" instead. + Add the useful safe-max()-macro example from "Naming Types" to + "Typeof", rewritten using that extension. Add some compatibility + notes to "Typeof." + +2002-10-09 Kaveh R. Ghazi + + * loop.c: Revert 2002-08-15 change. + (LOOP_REGNO_NREGS): Ensure type is int. + +2002-10-09 David Edelsohn + + * config/rs6000/rs6000.md (extenddftf2): Change to define_insn + which copies first FPR and clears second. + (extendsftf2): Same. + (floatditf2): Fix typo. + (floatsitf2): Same. + (fix_trunctfdi2): Same. + (fix_trunctfsi2): Same. + +2002-10-09 Kaveh R. Ghazi + + * conflict.c (arc_hash): Change return type to hashval_t. + * cselib.c (get_value_hash): Likewise. + * genautomata.c (automaton_decl_hash, insn_decl_hash, decl_hash, + state_hash, automata_list_hash): Likewise. + * read-rtl.c (def_hash): Likewise. + * tree.c (type_hash_hash): Likewise. + +2002-10-08 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Call + prologue_epilogue_contains instead of using REG_MAYBE_DEAD notes. + +Wed Oct 9 15:54:49 2002 J"orn Rennecke + + * sh.md (ffssi2): Fix emitted code. + +2002-10-09 Ulrich Weigand + + * cse.c (insn_live_p): Pass insn pattern, not full insn + to may_trap_p. + +2002-10-09 Neil Booth + + * cppmacro.c (paste_tokens): Only allow / to paste with =. + +2002-10-09 David Edelsohn + + * config/rs6000/rs6000.md (movdf splitter): Use gen_int_mode on + 64-bit hosts. + (movtf_internal): Reference correct displacement for second value + in memory. + (movtf splitter): Correct generation of constants in 64-bit mode. + +2002-10-09 Alan Modra + + * libgcc2.c (__floatdisf): Properly cure double rounding. + +2002-10-09 Gabriel Dos Reis + + * c-common.c (cb_register_builtins): Define __WCHAR_MAX__. + * doc/cpp.texi (Common Predefined Macros): Document. + +2002-10-09 Gabriel Dos Reis + + PR doc/7484 + * doc/invoke.texi (Option Summary): List + -Wmissing-declarations as a C only option. + +2002-10-08 Roger Sayle + + * fold-const.c (fold) [LROTATE_EXPR, RROTATE_EXPR]: Optimize + left and right rotates of ~0, i.e. integer_all_onesp (arg0). + [LSHIFT_EXPR, RSHIFT_EXPR]: Optimize shifts and rotates of zero. + +Tue Oct 8 01:24:19 CEST 2002 Jan Hubicka + + * i386.c (x86_sse_partial_reg_dependency, x86_sse_partial_regs, + x86_sse_typeless_stores, x86_sse_load0_by_pxor): New global + variables. + (safe_vector_operand): Update sse_clrv4sf call. + (ix86_expand_buildin): Likewise + * i386.h (x86_sse_partial_reg_dependency, x86_sse_partial_regs, + x86_sse_typeless_stores, x86_sse_load0_by_pxor): Declare. + (TARGET_SSE_PARTIAL_REG_DEPENDENCY, TARGET_SSE_PARTIAL_REGS, + TARGET_SSE_TYPELESS_STORES, TARGET_SSE_TYPELESS_LOAD0): New + macros. + * i386.md (movsf*, movdf*, movti, movv4sf, movv2df, movv16qi, movv8hi, + movv4si): Obey the new flags. + (floatsi2sf, floatdi2sf, truncatedf2sf): Emit extra load of 0 to avoid + reformating penalty. + (anddf, cmov patterns): Avoid reformating by first converting. + (sse_cvtsd2ss): Fix predicate. + (sse2_clrti): Fix mode, + (sse_clrv4sf): Avoid unspec. + +2002-10-08 Jakub Jelinek + + * config/sparc/t-linux64 (MULTILIB_OPTIONS): Remove + mno-app-regs|mcmodel=medany. + (MULTILIB_DIRNAMES, MULTILIB_OSDIRNAMES): Remove alt. + (MULTILIB_EXCEPTIONS, MULTILIB_EXCLUSIONS, MULTILIB_MATCHES): Remove. + (CRTSTUFF_T_CFLAGS): Define. + +2002-10-08 Roger Sayle + + PR target/8087 + * simplify-rtx.c (avoid_constant_pool_reference): Allow constant + pool references that are constructed using LO_SUM. + +2002-10-08 Nathan Sidwell + + * c-opts.c (c_common_decode_option): Add warn_strict_aliasing to + -Wall. + * c-typeck.c (build_c_cast): Use warn_strict_aliasing, tweak + message. + * flags.h (warn_strict_aliasing): Declare. + * toplev.c (warn_strict_aliasing): Define. + (lang_independent_options): Add it. + * doc/invoke.texi (-Wstrict-aliasing): Document it. + +2002-10-08 Zack Weinberg + + * system.h (GCCBUGURL): Delete. + * version.c (bug_report_url): New. Add commentary about + modifying both these strings in modified distributions. + * version.h: Declare bug_report_url. + + * diagnostic.c, gcc.c, gcov.c: Globally replace GCCBUGURL with + bug_report_url. + +2002-10-08 Nick Clifton + + * config/rs6000/spe.h (__ev_set_acc_u64): Use __ev_create_u64 to + convert uint64_t into __ev64_opaque__. + (__ev_set_acc_s64): Likewise, but using signed types. + +2002-10-08 Ulrich Weigand + + * config/s390/s390.md ("*doloop_si_long"): Add missing operand. + ("*doloop_di_long"): Likewise. + +Tue Oct 8 16:50:10 CEST 2002 Jan Hubicka + + * print-rtl.c (print_rtx): Increase buffer size for real numbers. + +2002-10-08 Richard Sandiford + + * config/mips/mips.md (define_attr cpu): Add r4111. + +2002-10-08 Anthony Green + + * bitmap.c (bitmap_equal_p): Clear all bitmap_head fields. + +2002-10-08 Michael Hayes + + * config/c4x/c4x.c (c4x_print_operand): Enlarge buffer + for REAL_VALUE_TO_DECIMAL output. + +2002-10-07 Richard Henderson + + * cse.c (fixed_base_plus_p): Turn FIXED_BASE_PLUS_P into a + function; cleanup PLUS case by using recursion. Update all users. + (NONZERO_BASE_PLUS_P): Remove. + (find_comparison_args): Use rtx_addr_can_trap_p instead. + (fold_rtx): Use nonzero_address_p. + * rtl.h (nonzero_address_p): Declare. + * rtlanal.c (rtx_varies_p): Handle ADDRESSOF. + (rtx_addr_can_trap_p): Likewise. + (nonzero_address_p): New. + * simplify-rtx.c (NONZERO_BASE_PLUS_P): Remove. + (simplify_relational_operation): Use nonzero_address_p. + +2002-10-07 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Set + real_format_for_mode for IBM extended format, if enabled. + (easy_fp_constant): Add TFmode. + (rs6000_legitimize_address): Add TFmode. + (rs6000_legitimate_address): Same. + (function_arg_advance): TFmode uses two FPRs. + (rs6000_emit_prologue): Fix warning. + (rs6000_output_function_epilogue): Add TFmode. + (output_toc): Add TFmode. + * rs6000.h (SLOW_UNALIGNED_ACCESS): Add TFmode. + (LEGITIMATE_OFFSET_ADDRESS_P): Add TFmode. + * rs6000.md (movtf splitter): Load TFmode constant. + +2002-10-07 Dale Johannesen + + * rtl.h: Add NOTE_PRECONDITIONED. + * unroll.c: Set it. + * loop.c: Set loop_info->preconditioned from it. + * doloop.c: Permit doloop treatment when loop_info->preconditoned. + +2002-10-07 Richard Henderson + + * config/i960/i960.c (i960_setup_incoming_varargs): Create a + new rtx for comparing the argument pointer against zero. + (i960_va_start): Similarly. + +2002-10-07 Richard Henderson + + * config/i960/i960.md (*): Use TFmode, not XFmode. + * config/i960/i960.c (*): Likewise. + (i960_arg_size_and_align): Remove XFmode alignment hack. + (i960_round_align): Merge code from ROUND_TYPE_ALIGN. + * config/i960/i960.h (LONG_DOUBLE_TYPE_SIZE): Use 128, not 96. + (MAX_LONG_DOUBLE_TYPE_SIZE): Likewise. + (DATA_ALIGNMENT, ROUND_TYPE_SIZE): Remove. + +2002-10-07 Richard Henderson + + * config/fp-bit.c (EXTENDED_FLOAT_STUBS): Flush out all XF/TFmode + entry points; use void return value and argument list. + +2002-10-06 Andreas Bauer + + * calls.c (expand_call): Fix function-is-volatile check. + +2002-10-05 Naohiko Shimizu + + * t-pdp11: Add MULTILIB support for msoft-float. + * pdp11.h (LEGITIMATE_CONSTANT_P): Fix soft-float case. + + * t-pdp11: Add LIB2FUNCS_EXTRA. + * pdp11.c (pdp11_output_function_prologue): Restrict offset to 16bit, + add preceding 0 to the octal constant, rename 'fp' to 'r5', rename + 'fldd' to 'ldd', rename 'fstd' to 'std'. + (pdp11_output_function_epilogue): Likewise. + (output_move_quad): Make the comment gas compatible. + (output_ascii): Add preceding 0 to the octal constant. + (print_operand_address): Add pre_modify, post_modify. + (output_addr_const_pdp11): Add preceding 0 to the octal constant. + * pdp11.h (GO_IF_LEGITIMATE_ADDRESS) : Add 'movb' pre_modify case + with the indication of Paul Koning. + (PRINT_OPERAND): Fix floating constant. + * pdp11.md (movdi): Restrict matching pattern. + (movqi): Generalize the matching pattern. + (movdf): Restrict matching pattern. + (zero_extendqihi2): Change constant representation. + (floatsidf2): Fix wrong operands. + (addqi3): Fix wrong instruction name. + (subqi3): Fix wrong instruction name. + (andsi3, andhi3, andqi3): Simplify and fix to use 'bic'. + (xorsi3): Fix wrong insn. + (one_cmplqi2): Add two operand pattern. + (lsrsi3): New. + (negsi2): New. + (call): Add register indirect case. + (mod): Fix wrong subreg. + +2002-10-06 Eric Botcazou + Volker Reichelt + + PR c/7411 + * expr.c (expand_expr) [PLUS]: Simplify after the operands + have been expanded in EXPAND_NORMAL mode. + +2002-10-06 Richard Henderson + + * config/rs6000/rs6000.md (load_toc_v4_PIC_2): Fix base constraint. + +2002-10-06 Richard Henderson + + PR optimization/2960 + * toplev.c (rest_of_compilation): Don't copy_loop_headers if + optimize_size. + +2002-10-06 Alexandre Oliva + + * config/mips/mips.h (SIZE_TYPE, PTRDIFF_TYPE): Override + previously definitions. + +2002-10-06 Frank Ch. Eigler + + * cppinit.c (init_standard_includes, parse_option): Use strncmp. + * c-opts.c (find_opt): Similarly. + +Sat Oct 5 22:48:06 CEST 2002 Jan Hubicka + + * athlon.md: rewrite to DFA. + * i386 (ix86_adjust_cost): Drop memory latency code. + (ia32_use_dfa_pipeline_interface): Return true for Athlon. + +2002-10-05 Jakub Jelinek + + * gcc.c (set_multilib_dir): Don't access *end. + Use memcpy instead of strncpy. Don't write beyond malloced buffer. + (print_multilib_info): Don't show paths starting with ".:". + * genmultilib: Add new option, "yes" if multilibs are enabled. + Update comments. If multilibs not enabled, print .:${osdirout} + for each directory. If multilibs are enabled, always print + ${dirout}:${osdirout}, even if the two are the same. + * Makefile.in (s-mlib): Pass @enable_multilib@ to genmultilib. + Pass all MULTILIB_* variables to genmultilib even if + --disable-multilib but MULTILIB_OSDIRNAMES is not empty. + +2002-10-04 Zack Weinberg + + * gcc.c (process_command): Set .validated for -pipe. Correct + grammar in comment. + +2002-10-04 Bruce Korb + + * fixinc/inclhack.def(hpux11_abs): use format fix + * fixinc/fixincl.x: regenerate + * fixinc/tests/base/stdlib.h: accommodate new fix test + +Sat Oct 5 19:42:45 CEST 2002 Jan Hubicka + + * c-common.c (cb_register_builtins): Use really_no_inline. + +2002-10-04 David Edelsohn + + * unroll.c (copy_loop_body): Remove REG_EQUAL note attached to + copied instruction if the note is not loop invariant. + +2002-10-04 Loren J. Rittle + + * gcc/ginclude/stddef.h: Support the FreeBSD 5 typedef system. + +2002-10-04 Steve Ellcey + + * doc/invoke.texi (HPPA): Add -mlinker-opt, -mgnu-ld, + and -mhp-ld options to list of options. Add -mgnu-ld + and -mhp-ld option descriptions. + +2002-10-04 Steve Ellcey + + * fixinc/inclhack.def (hpux11_abs): New. + (stdio_va_list): change __va_list__ to __gnuc_va_list. + * fixinc/fixincl.x: Rebuild. + +2002-10-04 Roger Sayle + + * config/i386/i386.h (processor_costs): Add new fields fadd, + fmul, fdiv, fabs, fchs and fsqrt to costs structure. + (RTX_COSTS): Use these fields to determine the RTX costs + of floating point addition/subtraction, multiplication, + division, fabs, negation and square root respectively. + * config/i386/i386.c (size_cost): Provide instruction sizes + for these new fields. + (i386_cost, i486_cost, pentium_cost, pentiumpro_cost, + k6_cost, athlon_cost, pentium4_cost): Provide typical cycle + counts for these new fields for all x86 processor variants. + +2002-10-04 Kaveh R. Ghazi + + * mips.c (mips_const_double_ok): Delete unused variable. + + * gengtype.c (rtx_next): Change type to int. + +2002-10-04 Andreas Jaeger + + * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Fix value. + +2002-10-04 Richard Henderson + + * real.h (SIGNIFICAND_BITS): Add one more word. + (CONST_DOUBLE_FORMAT): Accomodate 6 words. + * real.c (times_pten): New. + (real_to_decimal, real_from_string): Use it. + (sticky_rshift_significand): Use & to find modulus. + (rshift_significand, lshift_significand): Likewise. + (do_divide): Apply sticky bit after normalization. + (real_to_decimal, real_to_hexadecimal): Fix sign of Inf and NaN. + +2002-10-03 Andreas Bauer + + * doc/tm.texi (FUNCTION_OK_FOR_SIBCALL): Remove. + (TARGET_FUNCTION_OK_FOR_SIBCALL): New. + +2002-10-03 Andreas Jaeger + + * gengtype.c (adjust_field_rtx_def): Cast variables of type size_t + to unsigned long, adjust printf format string. + (output_mangled_typename): Likewise. + +2002-10-03 Jason Thorpe + + * config/vax/vax.c (vax_output_function_prologue): Use asm_fprintf. + * config/vax/vax.h (VAX_FUNCTION_PROFILER_NAME): New. + (FUNCTION_PROFILER): Rewrite to use ASM_GENERATE_INTERNAL_LABEL, + assemble_name, asm_fprintf, and VAX_FUNCTION_PROFILER_NAME. + (ASM_OUTPUT_MI_THUNK): Use asm_fprintf instead of REGISTER_PREFIX. + (PRINT_OPERAND_PUNCT_VALID_P): Fix comment. + * config/vax/elf.h (FUNCTION_PROFILER): Remove. + (VAX_FUNCTION_PROFILER_NAME): Redefine as "__mcount". + +2002-10-03 Mark Mitchell + + * doc/invoke.texi (-Wabi): Document mangling bug. + +2002-10-04 Alan Modra + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Use a + name for the tbtab label that depends on the function asm name. + Don't output tbtab label unless optional_tbtab. + (output_mi_thunk): Formatting. + +2002-10-03 Richard Henderson + + * config/m68k/m68k.h (OVERRIDE_OPTIONS): Move additional code ... + * config/m68k/m68k.c (override_options): ... here. + * config/m68k/m68kelf.h (OVERRIDE_OPTIONS): Remove. + * config/m68k/m68kv4.h (OVERRIDE_OPTIONS): Remove. + * config/m68k/linux.h (SUBTARGET_OVERRIDE_OPTIONS): Remove. + * config/m68k/netbsd-elf.h (SUBTARGET_OVERRIDE_OPTIONS): Remove. + +2002-10-03 Richard Henderson + + * real.h (struct real_value): Use ENUM_BITFIELD. + +2002-10-03 Richard Henderson + + * config/i960/i960.md (call, call_value): Use emit_call_insn. + +2002-10-03 Steve Ellcey + + * config/pa/pa64-hpux.h (INIT_ENVIRONMENT): New. + +2002-10-03 Steve Ellcey + + * config.gcc (hppa*64*-*-hpux11*): Check gnu_ld. + * config/pa/pa.h (MASK_GNU_LD): New. + (TARGET_GNU_LD): New. + * config/pa/pa64-hpux.h (LINK_SPEC): Set based + on gnu-ld and MASK_GNU_LD. + (SUBTARGET_SWITCHES): New gnu-ld & hp-ld flags. + +Thu Oct 3 23:35:51 CEST 2002 Jan Hubicka + + * i386.c (athlon_cost): Fix the move costs. + +Thu Oct 3 23:20:58 CEST 2002 Jan Hubicka + + * final.c (final): Use symbol name as function name for profiling. + * profile.c (get_exec_counts): Likewise. + (branch_prob): Likewise. + +2002-10-03 Jakub Jelinek + + * longlong.h (__udiv_qrnnd): Remove PARAMS from prototype. + +2002-10-03 Jakub Jelinek + + * gcc.c (print_multi_os_directory): New variable. + (option_map): Support --print-multi-os-directory. + (struct prefix_list): Add os_multilib field. + (multilib_os_dir): New variable. + (static_specs): Add multilib_options. + (find_a_file): Add multilib argument. Search in GCC or OS multilib + subdirs if nonzero. + (read_specs, execute): Update callers. + (find_file): Likewise. Don't prefix name with multilib_dir, instead + pass 1 as multilib option. + (display_help): Include --print-multi-os-directory. + (add_prefix): Add os_multilib argument. Initialize pl->os_multilib. + (process_command): Update callers. Handle --print-multi-os-directory. + (do_spec_1) ['D']: Use multilib_os_directory if pl->os_multilib is + set. + (main): Update find_a_file and add_prefix callers. + Handle print_multi_os_directory. + (struct mdswitchstr): New. + (mdswitches, n_mdswitches): New variables. + (used_arg): Add MULTILIB_DEFAULT switches too if they are not + present on the command line nor their mutually incompatible + switches. + (default_arg): Optimize. + (set_multilib_dir): Compute multilib_os_dir. Initialize mdswitches + array. + (print_multilib_info): Only print GCC multilib dir name, not OS + multilib dirname. + * genmultilib: Add osdirnames parameter. Output multilib_options + variable. If osdirnames is specified, output dirnames as + dirname:osdirname. + * mklibgcc.in: Use MULTILIB_OSDIRNAMES, --print-multi-directory + and --print-multi-os-directory instead of SHLIB_SLIBDIR_SUFFIXES + to compute libgcc_s soname and install path. + * Makefile.in (libgcc.mk): Pass MULTILIB_OSDIRNAMES instead of + SHLIB_SLIBDIR_SUFFIXES to mklibgcc. + (s_mlib): Pass MULTILIB_OSDIRNAMES or nothing as last genmultilib + argument. + + * config/sparc/t-linux64 (MULTILIB_OSDIRNAMES): Set. + (SHLIB_SLIBDIR_SUFFIXES): Remove. + * config/sparc/linux64.h (STARTFILE_SPEC32, STARTFILE_SPEC64, + ENDFILE_SPEC32, ENDFILE_SPEC64, ENDFILE_COMMON): Remove. + (STARTFILE_SPEC, ENDFILE_SPEC): Don't distinguish between -m32 + and -m64. + * config/sparc/t-sol2-64 (MULTILIB_OSDIRNAMES): Set. + (SHLIB_SLIBDIR_SUFFIXES): Remove. + * config/sparc/sol2-bi.h (STARTFILE_ARCH64_SPEC): Remove. + (STARTFILE_ARCH_SPEC): Remove. + * config/i386/t-linux64 (MULTILIB_OSDIRNAMES): Set. + (SHLIB_SLIBDIR_SUFFIXES): Remove. + * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Remove. + * config/mips/t-iris6 (MULTILIB_OSDIRNAMES): Set. + (SHLIB_SLIBDIR_SUFFIXES): Remove. + +Thu Oct 3 21:42:20 CEST 2002 Jan Hubicka + + * predict.c (choose_function_section): Avoid choice for linkonce functions. + +Thu Oct 3 15:15:00 CEST 2002 Jan Hubicka + + * i386.md (lea to mul peep2): Fix condition. + +2002-10-02 John David Anglin + + * pa-linux.h (FUNCTION_OK_FOR_SIBCALL): Delete macro. + * pa32-linux.h (FUNCTION_OK_FOR_SIBCALL): Define. + +2002-10-02 David Mosberger-Tang + + * unwind.h (_Unwind_GetTextRelBase): Mark _C argument with + attribute "unused". + + * config/t-libunwind: Mention unwind-sjlj.c. + * unwind-libunwind.c: Change #ifdef __USING_LIBUNWIND_EXCEPTIONS__ + to #ifndef __USING_SJLJ_EXCEPTIONS__. + + * configure.in: Move sjlj-exceptions and --enable-libunwind-exceptions + before inclusion of config.gcc, but after configuring the compiler etc. + Determine default value for --enable-libunwind-exceptions based on + whether the host has a libunwind library (not guaranteed to be correct, + but it's a reasonable first guess and can always be overridden with an + explicit --enable/disable-libunwind-exceptions. + * config.gcc: For target ia64*-*-linux*, mention t-libunwind as a + tmake_file when $use_libunwind_exceptions is enabled. + * Makefile.in: Update comment: LIB2ADDEH is updated not just by + ia64 (e.g., config/t-linux also updates it). + * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS]: Mention -lunwind + along with the shared version of libgcc since the latter requires + the former. + * unwind-libunwind.c: New file. + * config/t-libunwind: Ditto. + +2002-10-02 Nathanael Nerode + + * config.gcc: Remove support for vax-*-vms*. + * config/vax/vms.h: Remove. + * config/vax/xm-vms.h: Remove. + * config/vax/vax-protos.h: Remove VMS-specific code. + * config/vax/vax.c: Remove VMS-specific code. + +2002-10-02 Richard Henderson + + PR opt/7124 + * config/i386/i386.c (ix86_register_move_cost): Increase cost + for secondary_memory_needed pairs. + +2002-10-02 Nathanael Nerode + + * doc/vms.texi: Blow away false include file section. + +2002-10-02 Roger Sayle + + PR optimization/6627 + * toplev.c (force_align_functions_log): New global variable. + * flags.h (force_align_functions_log): Add extern prototype. + * varasm.c (assemble_start_function): Use it to force minimum + function alignment. + * config/i386/i386.h (FUNCTION_BOUNDARY): Set the correct + minimum function alignment to one byte. + (TARGET_PTRMEMFUNC_VBIT_LOCATION): Store the virtual bit in + the least significant bit of vtable member function pointers. + * tree.h (enum ptrmemfunc_vbit_where_t): Move definition to + here from cp/cp-tree.h. + +Wed Oct 2 17:01:36 CEST 2002 Jan Hubicka + + * i386.c (print_operand_address): Use RIP addressing for offsetted + label refs too. + +2002-09-30 David S. Miller + + PR middle-end/7151 + * config/sparc/sparc.md (movdi_insn_sp32_v9): Accept 'e' regs. + (movdi reg/reg split): Match only on sparc32, and v9 when int regs. + +2002-10-01 Andreas Bauer + + * calls.c (expand_call): Remove the `no indirect check' + for sibcall optimization; use function_ok_for_sibcall + target hook; refine check for `function is volatile'. + (FUNCTION_OK_FOR_SIBCALL): Remove the redefinition. + * hooks.c (hook_tree_tree_bool_false): New. + * hooks.h (hook_tree_tree_bool_false): Declare. + * target-def.h (TARGET_FUNCTION_OK_FOR_SIBCALL): New. + (TARGET_INITIALIZER): Add it. + * target.h (struct gcc_target): Add function_ok_for_sibcall. + * config/alpha/alpha.c: (alpha_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/alpha/alpha.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/arm/arm-protos.h: (arm_function_ok_for_sibcall): + Remove function declaration. + * config/arm/arm.c: (arm_function_ok_for_sibcall): Make + function static and accept another argument of type `tree'. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/arm/arm.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/frv/frv.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/i386/i386.c: (ix86_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/i386/i386.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/pa/pa-linux.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + (TARGET_HAS_STUBS_AND_ELF_SECTIONS): New definition. + * config/pa/pa.c: (pa_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/pa/pa.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/rs6000/rs6000-protos.h: (function_ok_for_sibcall): + Remove function declaration. + * config/rs6000/rs6000.c: (rs6000_function_ok_for_sibcall): + Rename function_ok_for_sibcall to rs6000_function_ok_for_sibcall; + rename first argument to `decl'; accept another argument + of type `tree'; make static. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/rs6000/rs6000.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/sh/sh.c: (sh_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/sh/sh.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/sparc/sparc.c: (sparc_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly. + * config/sparc/sparc.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + * config/xtensa/xtensa.h: (FUNCTION_OK_FOR_SIBCALL): Remove. + +2002-10-01 Roger Sayle + + * unroll.c (loop_iterations): Revert 2002-09-08 change. + +2002-10-01 Richard Henderson + + * real.c (real_to_decimal): Crop trailing zeros for DIGITS < 0. + (real_to_hexadecimal): Likewise. + * print-rtl.c (print_rtx): If we are linked with real.c, don't + dump the XWINT fields of a floating point CONST_DOUBLE. + +2002-10-01 Jason Thorpe + + * config/vax/elf.h (FUNCTION_PROFILER): Fix __mcount call. + +2002-10-01 Richard Henderson + + * calls.c (precompute_register_parameters): Force non-legitimate + constants into pseudos. + +2002-10-01 Nick Clifton + + * config/rs6000/spe.md (spe_evrlwi): Add missing third operand + to assembler template. + +2002-10-01 Richard Henderson + + * dwarf2out.c (loc_descriptor_from_tree): Relax requirement + for TLS debug info to !DECL_EXTERNAL. + +2002-10-01 Matt Thomas + Jason Thorpe + + * config.gcc (vax-*-netbsdelf*): Enable configuration. + * config/elfos.h (PCC_BITFIELD_TYPE_MATTERS): Define only + if not already defined. + * config/vax/elf.h: New file. + * config/vax/netbsd-elf.h: New file. + * config/vax/vax.c: Include "debug.h". + (vax_output_function_prologue): Add dwarf2 support. Use + MAIN_NAME_P when checking for VMS_TARGET stack adjust. + * config/vax/vax.h (CONST_OK_FOR_LETTER_P): Add cases for + 'J' [0..63], 'K' [-128..127], 'L' [-32768..32767], + 'M' [0..255], 'N' [0..65535], and, 'O' [-63..-1]. + (VAX_ISTREAM_SYNC): Remove. + (INITIALIZE_TRAMPOLINE): Use gen_sync_istream. + (JUMP_TABLES_IN_TEXT_SECTION): Define. + (ASM_OUTPUT_REG_POP): Use reg_names for the stack pointer. + (ASM_OUTPUT_ADDR_VEC_ELT): Use ASM_GENERATE_INTERNAL_LABEL + and assemble_name. + (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + (PRINT_OPERAND_PUNCT_VALID_P): Accept '|'. + (PRINT_OPERAND): Output REGISTER_PREFIX for '|'. + (INCOMING_RETURN_ADDR_RTX): Define. + * config/vax/vax.md (VUNSPEC_BLOCKAGE) + (VUNSPEC_SYNC_ISTREAM): Define. + (blockage): Use VUNSPEC_BLOCKAGE. + (sync_istream): New insn. + +2002-10-01 Richard Henderson + + * config/vax/vax.md (call_pop, *call_pop, call_value_pop) + (*call_value_pop, call, call_value): Add dwarf2 EH support. + (*call): New insn. + +2002-10-01 Nathan Sidwell + + PR c/8083 + * c-typeck.c (build_c_cast): Warn about type punning which breaks + type based aliasing. + +2002-10-01 Mark Mitchell + + * stor-layout.c (update_alignment_for_field): New function. + (place_union_field): Use it. + (place_field): Likewise. + +2002-10-01 Nathan Sidwell + + PR other/8077 + * gcc.c (cc1_options): Add space on -auxbase-strip. + +2002-10-01 Jim Wilson + + * config/v850/v850.h (EPILOGUE_USES): Define. + +2002-09-30 Andrew Haley + + * flow.c (insn_dead_p): When using non-call-exceptions, don't + eliminate insns that may trap. + * cse.c (insn_live_p): Likewise. + +2002-10-01 Richard Sandiford + + * config/mips/mips.h (PROCESSOR_R4121): Rename to PROCESSOR_R4120. + (TARGET_MIPS4121): Rename to TARGET_MIPS4120. + * config/mips/mips.c (mips_cpu_info): Rename vr4121 to vr4120. + * config/mips/mips.md: Apply same renaming here. + +2002-10-01 Richard Sandiford + + * config/mips/mips.c (PROCESSOR_R4320, TARGET_MIPS4320): Remove. + (GENERATE_MULT3_SI): Remove use of TARGET_MIPS4320. + * config/mips/mips.c (mips_cpu_info): Remove vr4320 entry. + * config/mips/mips.md (define_attr cpu): Remove r4320. + Remove vr4320 scheduler and uses of TARGET_MIPS4320. + +2002-10-01 Richard Sandiford + + * config/mips/mips.c (mips16_strings): New variable. + (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every + symbol in mips16_strings. Free the list. + (mips_encode_section_info): Keep track of local strings. + +2002-10-01 Richard Sandiford + + * config/mips/mips.md (bunge, bltgt, bungt): New define_expands. + (sordered_df, sordered_sf): Remove. + * config/mips/mips.c (get_float_compare_codes): New fn. + (gen_int_relational, gen_conditional_move): Use it. + +2002-10-01 Richard Sandiford + + * config/mips/mips-protos.h (mips_emit_fcc_reload): Declare. + * config/mips/mips.h (PREDICATE_CODES): Add fcc_register_operand. + * config/mips/mips.c (fcc_register_operand): New function. + (mips_emit_fcc_reload): New function, extracted from reload_incc. + (override_options): Allow TFmode values in float registers + if ISA_HAS_8CC. + * cnfig/mips/mips.md (reload_incc): Change destination prediate + to fcc_register_operand. Remove misleading source constraint. + Use mips_emit_fcc_reload. + (reload_outcc): Duplicate reload_incc. + +2002-09-30 Zack Weinberg + + * gcc.c (validate_switches): Handle all new forms of spec + syntax introduced recently. Now returns a char *. + (validate_all_switches): Repetitive logic broken out to... + (validate_switches_from_spec): ...here. + * mklibgcc.in: Don't @-flag commands to generate .oS files. + +2002-09-30 Ulrich Weigand + + * longlong.h: Partially synchronize with GMP-4.1 version: + Use i370 definitions also for s390. + Add generic definition of umul_ppmm in terms of smul_ppmm. + [s390] (umul_ppmm): Remove. + [s390] (smul_ppmm): Fix incorrect assembler constraints. + [s390] (smul_ppmm, sdiv_qrnnd): Rename __xx to __x. + +2002-09-30 Bob Wilson + + * config/xtensa/xtensa.h (REG_CLASS_NAMES, REG_CLASS_CONTENTS): + Add new RL_REGS register class. + (PREFERRED_RELOAD_CLASS, PREFERRED_OUTPUT_RELOAD_CLASS): + Call xtensa_preferred_reload_class for both input and output reloads. + * config/xtensa/xtensa.c (xtensa_regno_to_class): Use new RL_REGS class. + (xtensa_preferred_reload_class): Handle output reloads; use RL_REGS + instead of either AR_REGS or GR_REGS classes. + (xtensa_secondary_reload_class): Use new RL_REGS class. + * config/xtensa/xtensa-protos.h (xtensa_preferred_reload_class): Update. + +2002-09-30 John David Anglin + + * pa.c (hppa_encode_label): Don't drop '*' from function labels. + (pa_strip_name_encoding): Strip '@' and '*', in that order. + * pa.h (ASM_OUTPUT_LABELREF): Output user_label_prefix except when + there is a '*' prefix in NAME. + +Mon Sep 30 21:33:23 CEST 2002 Jan Hubicka + + * reload.c (push_reload): Handle subregs and secondary memory. + * reload1.c (gen_reload): Likewise. + + * jump.c (reg_or_subregno): New function. + * rtl.h (reg_or_subregno): Declare + * unroll.c (find_splittable_givs): Handle subregs. + +2002-09-30 Mark Mitchell + + * store-layout.c (finish_record_layout): Add free_p parameter. + (layout_type): Pass it. + * tree.h (finish_record_layout): Update prototype. + +Mon Sep 30 14:57:18 CEST 2002 Jan Hubicka + + * i386.h (TARGET_CPP_CPU_BUILTINS): Define __SSE_MATH__. + + * gcse.c (cprop_jump): Check that the register has not + been modified + (cprop_jump): Likewise. + +2002-09-30 Richard Earnshaw + + * arm.h (BASE_REG_CLASS): Always return LO_REGS for Thumb. + (MODE_BASE_REG_CLASS, case Thumb): Only return BASE_REGS if we know + that we have a SImode access, and only then if reload hasn't completed; + for all other cases, use LO_REGS. + +2002-09-29 Kaveh R. Ghazi + + * openbsd.h: Fix typo in last change. + +2002-09-29 Richard Henderson + + * real.c (real_from_string): Apply sign last. Tidy exponent handling. + +2002-09-29 Richard Henderson + + PR c/8002 + * combine.c (force_to_mode): Handle FLOAT_MODE destinations + for CONST_INT. + +2002-09-29 David Edelsohn + + * real.h (ibm_extended_format): Declare. + * real.c (encode_ibm_extended, decode_ibm_extended): New + functions. + +2002-09-29 Kaveh R. Ghazi + + * darwin-protos.h (darwin_asm_output_dwarf_delta): Prototype. + + * ia64.c (ia64_hpux_asm_file_end): Const-ify. + +2002-09-29 John David Anglin + + * expmed.c (extract_bit_field): Fix bit-field extraction from SUBREGs. + +2002-09-29 Kazu Hirata + + * builtins.def: Fix comment formatting. + * c-common.def: Likewise. + * cfgcleanup.c: Likewise. + * combine.c: Likewise. + * gengtype.c: Likewise. + * params.def: Likewise. + * predict.def: Likewise. + * rtl.def: Likewise. + * stab.def: Likewise. + * stor-layout.c: Likewise. + * tree.def: Likewise. + * config/darwin.c: Likewise. + * config/darwin.h: Likewise. + * config/dbxcoff.h: Likewise. + * config/elfos.h: Likewise. + * config/fp-bit.c: Likewise. + * config/freebsd-spec.h: Likewise. + * config/interix.h: Likewise. + * config/libgloss.h: Likewise. + * config/linux-aout.h: Likewise. + * config/linux.h: Likewise. + * config/lynx-ng.h: Likewise. + * config/lynx.h: Likewise. + * config/netbsd-aout.h: Likewise. + * config/netbsd.h: Likewise. + * config/netware.h: Likewise. + * config/psos.h: Likewise. + * config/ptx4.h: Likewise. + +2002-09-28 Kazu Hirata + + * ChangeLog.4: Fix typos. + * ChangeLog.6: Likewise. + * FSFChangeLog.10: Likewise. + * genattrtab.c: Fix comment typos. + * haifa-sched.c: Likewise. + * real.c: Likewise. + * tree.h: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/crti.asm: Likewise. + * config/arm/crtn.asm: Likewise. + * config/frv/frv.c: Likewise. + * config/frv/frv.md: Likewise. + * config/h8300/h8300.md: Likewise. + * config/i386/rtemself.h: Likewise. + * config/ia64/unwind-ia64.c: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/m88k/m88k.c: Likewise. + * config/m88k/m88k.md: Likewise. + * config/mips/sr71k.md: Likewise. + * config/mmix/mmix.c: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/sh/sh.md: Likewise. + +2002-09-26 Theodore A. Roth + + * config/avr/avr.c: Eliminate use of _PC_ in pc relative insns. + * config/avr/avr.md: Ditto. + +2002-09-27 Alexander N. Kabaev + + PR preprocessor/8055 + * cppmacro.c (stringify_arg): Do not overflow the buffer + with the terminating NUL when the argument to be stringified + has no tokens. + +2002-09-27 Richard Henderson + + * unroll.c (simplify_cmp_and_jump_insns): New. + (unroll_loop): Use it. Use simplify_gen_foo+force_operand + instead of expand_simple_foo. + +2002-09-27 Richard Henderson + + PR optimization/7520 + * cfganal.c (flow_active_insn_p): New. + (forwarder_block_p): Use it. + +2002-09-27 Richard Henderson + + * emit-rtl.c (active_insn_p): Revert last change. + +2002-09-27 Jakub Jelinek + + * doc/extend.texi (tls_model): Document. + * varasm.c (decl_tls_model): New. + * c-common.c (handle_tls_model_attribute): New. + (c_common_attribute_table): Add tls_model. + * config/alpha/alpha.c (alpha_encode_section_info): Use + decl_tls_model. + * flags.h (enum tls_model, flag_tls_default): Move... + * tree.h (enum tls_model, flag_tls_default): ...here. + (decl_tls_model): New prototype. + * config/ia64/ia64.c (ia64_encode_section_info): Likewise. + * config/i386/i386.c (ix86_encode_section_info): Likewise. + * config/i386/i386.md (tls_global_dynamic, tls_local_dynamic_base): + Allow !flag_pic. + +2002-09-27 Kazu Hirata + + * LANGUAGES: Follow spelling conventions. + * rtl.def: Likewise. + * sbitmap.c: Likewise. + * sched-int.h: Likewise. + * sched-rgn.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * ssa.c: Likewise. + * stab.def: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * target.h: Likewise. + * timevar.c: Likewise. + * toplev.c: Likewise. + * tree-dump.c: Likewise. + * tree-inline.c: Likewise. + * tree.c: Likewise. + * tree.def: Likewise. + * tree.h: Likewise. + * unroll.c: Likewise. + * varasm.c: Likewise. + * vmsdbgout.c: Likewise. + * treelang/treelang.texi: Likewise. + * treelang/treetree.c: Likewise. + +2002-09-27 Kazu Hirata + + * config/h8300/h8300.c (compute_saved_regs): Use a macro + instead of a hard register number. + (get_shift_alg): Use an enumerated type instead of numbers. + (h8300_shift_needs_scratch_p): Likewise. + +2002-09-26 Kazu Hirata + + * varasm.c (force_data_section): Remove. + (assemble_constant_align): Likewise. + * output.h: Remove corresponding prototypes. + +2002-09-26 Roger Sayle + + * stmt.c (expand_exit_loop_if_false): Expand a simple conditional + jump, if the loop to exit is the top of the current nesting stack. + +2002-09-26 Torbjorn Granlund + + * libgcc2.c (fixunsdfdi, fixunssfdi): Rewrite, avoiding `long long' + arithmetic. + +2002-09-26 David S. Miller + + PR optimization/7335 + * calls.c (emit_library_call_value_1): Passing args by reference + converts a CONST function into a PURE one. + +2002-09-26 David Edelsohn + + * dbxout.c (FORCE_TEXT): Switch to current_function_decl, not + text_section. + * xcoffout.h (DBX_STATIC_BLOCK_START): Remove explicit change to + text section. + * config/rs6000/rs6000.c (rs6000_override_options): Allow + function-sections and data-sections functionality on AIX. + +2002-09-26 David Edelsohn + Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_emit_move): Insert zero-extend + in RTL for sub-word loads from memory. + +2002-09-26 Richard Henderson + + PR c/7160 + * sched-deps.c (sched_analyze_insn): Make clobber insns depend + on call insns. + +2002-09-26 Richard Henderson + + * emit-rtl.c (const_double_htab_eq): Remove unused variable. + +2002-09-26 Chris Lattner + + * ssa.c (rename_insn_1): Handle RENAME_NO_RTX correctly when + handling undefined values. + +2002-09-26 Richard Henderson + + PR opt/7520 + * emit-rtl.c (active_insn_p): Consider a clobber of the + function return value to be active even after reload. + +2002-09-27 Alan Modra + + * doloop.c (doloop_modify_runtime ): Adjust + by absolute loop increment, not loop increment. + +2002-09-26 Kazu Hirata + + * c-common.h: Follow spelling conventions. + * cpplex.c: Likewise. + * cpplib.h: Likewise. + * gthr-dce.h: Likewise. + * gthr-posix.h: Likewise. + * optabs.c: Likewise. + * output.h: Likewise. + * profile.c: Likewise. + * protoize.c: Likewise. + * ra-rewrite.c: Likewise. + * real.c: Likewise. + * recog.c: Likewise. + * reg-stack.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reload.c: Likewise. + * reload.h: Likewise. + * reload1.c: Likewise. + * reorg.c: Likewise. + * resource.c: Likewise. + * rtl.h: Likewise. + * rtlanal.c: Likewise. + +2002-09-26 Steve Ellcey + + * config/ia64/ia64.c (ia64_expand_load_address): Ensure correct mode + for symbol address. + +2002-09-24 Eric Christopher + + * config/mips/elf.h: Add HANDLE_SYSV_PRAGMA. + * config/mips/elf64.h: Ditto. + +2002-09-24 Eric Christopher + + * except.c (expand_builtin_extract_return_address): Handle case + where Pmode != ptr_mode. + +2002-09-26 Steve Ellcey + + * config/ia64/hpux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): New + +2002-09-26 Steve Ellcey + + * config/ia64/hpux.h (TARGET_DEFAULT): Include TARGET_ILP32. + +2002-09-26 Igor Shevlyakov + + * combine.c (simplify_set): Don't call to force_to_mode if size + of integer type is larger than HOST_BITS_PER_WIDE_INT. + +2002-09-26 Janis Johnson + + * Makefile.in (qmtest-g++): Fix file path. + +2002-09-26 Ulrich Weigand + + * expr.c (expand_expr) [MINUS_EXPR]: Convert A - const to + A + (-const) on RTX level, even for unsigned types. + +2002-09-26 Ulrich Weigand + + * reload.c (dup_replacements): New function. + (find_reloads): Use it to duplicate replacements at the top level + of match_dup operands. + +2002-09-26 Miles Bader + + * v850.md ("length"): Change default value to 4. + +2002-09-26 Kazu Hirata + + * ChangeLog.1: Follow spelling conventions. + * ChangeLog.4: Likewise. + * ChangeLog.6: Likewise. + * FSFChangeLog.11: Likewise. + * doc/cpp.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/tm.texi: Likewise. + +2002-09-26 Nick Clifton + + * config.gcc: Add x prefix to v850e case for handling + --with-cpu=v850e. + +2002-09-25 Zack Weinberg + + * gcc.c (input_suffix_matches, switch_matches, + mark_matching_switches, process_marked_switches, + process_brace_body): New functions - split from handle_braces. + (handle_braces): Rewrite; handle %{S:X;T:Y;:D} syntax; accept + and ignore whitespace in more places. + (specs documentation comment): Document %{S:X;T:Y;:D}. + Clarify other %{...} docs. + * doc/invoke.texi: Document %{S:X;T:Y;:D}. Clarify other + %{...} docs. + + * config/arm/aof.h (LINK_SPEC): Change %{ov*,*} to %{ov*}. + * config/rs6000/sysv4.h: Use N-way choice spec syntax. + +2002-09-25 David S. Miller + + PR target/7842 + * config/sparc/sparc.c (set_extends): SImode ASHIFT does not + extend. + +2002-09-25 Richard Henderson + + * emit-rtl.c (const_double_htab_eq): Distinguish integer and + fp CONST_DOUBLE; use real_identical. + +2002-09-25 Mark Mitchell + + * doc/invoke.texi: Add more -Wabi examples. + +2002-09-25 Richard Sandiford + + * config/mips/mips.h (TARGET_MIPS4100): Add missing bracket. + +2002-09-24 Nathan Sidwell + + * profile.c (end_branch_prob): Only look for __gcov_init on + weak-enabled native compilers. + +2002-09-24 Denis Chertykov + + * config/ip2k/ip2k.c (function_epilogue): Fix wrong numbers in + cases of optimizing "add sp,w" to "inc sp". + +2002-09-24 Adam Nemet + + * config/arm/arm.c (thumb_unexpanded_epilogue): Don't generate + epilogue for naked functions. + +2002-09-24 Adam Nemet + Nick Clifton + + * config/arm/arm.h (THUMB_FUNCTION_PROFILER): Remove. + (FUNCTION_PROFILER): Only invoke THUMB_FUNCTION_PROFILER if it + is defined. + +2002-09-24 Ulrich Weigand + + * config/s390/s390.c (preferred_la_operand_p): New function. + * config/s390/s390-protos.h (preferred_la_operand_p): Declare it. + * config/s390/s390.md ("addaddr_esame", "*la_ccclobber"): Replace by ... + ("*la_64_cc", "*la_31_cc", splitters): ... these. + ("*la_31"): Deactivate for TARGET_64BIT. + ("*la_31_and", "*la_31_and_cc"): New. + +2002-09-24 Kaveh R. Ghazi + + * real.h (real_value): Make `exp' explicitly signed. + +2002-09-24 Kazu Hirata + + * config/elfos.h: Follow spelling conventions. + * config/alpha/alpha.h: Likewise. + * config/arc/arc.h: Likewise. + * config/arm/arm.md: Likewise. + * config/avr/avr.h: Likewise. + * config/cris/cris.md: Likewise. + * config/d30v/d30v.h: Likewise. + * config/frv/frv.c: Likewise. + * config/frv/frv.h: Likewise. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/sysv3.h: Likewise. + * config/i960/i960.h: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ia64/ia64.md: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/m32r/m32r.h: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m88k/m88k.h: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mcore/mcore.h: Likewise. + * config/mcore/mcore.md: Likewise. + * config/mips/mips.h: Likewise. + * config/mmix/mmix.h: Likewise. + * config/mmix/mmix.md: Likewise. + * config/ns32k/netbsd.h: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/ns32k/ns32k.md: Likewise. + * config/pa/pa.h: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/sparc/sparc.h: Likewise. + * config/stormy16/stormy-abi: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/vax/vax.h: Likewise. + +2002-09-23 Kazu Hirata + + * config/alpha/alpha.h: Remove commented-out macro + definitions of HAVE_{POST|PRE}_{INC|DEC}REMENT. + * config/avr/avr.h: Likewise. + * config/d30v/d30v.h: Likewise. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/i370/i370.h: Likewise. + * config/i386/i386.h: Likewise. + * config/i960/i960.h: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m88k/m88k.h: Likewise. + * config/mips/mips.h: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/pdp11/pdp11.h: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/s390/s390.h: Likewise. + * config/sh/sh.h: Likewise. + * config/sparc/sparc.h: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/vax/vax.h: Likewise. + +2002-09-23 Kazu Hirata + + * function.c (push_temp_slots_for_block): Remove. + (push_temp_slots_for_target): Likewise. + (get_target_temp_slot_level): Likewise. + (set_target_temp_slot_level): Likewise. + (get_first_block_beg): Likewise. + * function.h: Remove corresponding prototypes. + +2002-09-23 Zack Weinberg + + * version.c (version_string): Now const char[]. + * version.h: Update to match. + +2002-09-23 Richard Henderson + + * config/i386/i386.h (MASK_ACCUMULATE_OUTGOING_ARGS_SET, MASK_MMX_SET, + MASK_SSE_SET, MASK_SSE2_SET, MASK_3DNOW_SET, MASK_3DNOW_A_SET): Kill. + (TARGET_SWITCHES): Don't reference them. + * config/i386/i386.c (override_options): Use target_flags_explicit + to examine bits set by the user. + +2002-09-23 Dale Johannesen + + * dbxout.c (dbxout_parms): Set current_sym_code for params + passed on stack by invisible reference. + +2002-09-23 Richard Earnshaw + + * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Always allocate + at least one byte of space. + +2002-09-23 Mark Mitchell + + * c-common.h (flag_abi_version): Fix typo in comment. + * doc/invoke.texi (flag_abi_version): Document default value. + +2002-09-23 Hans-Peter Nilsson + + * doc/extend.texi (Extended Asm): Clarify that overlap between + asm-declared register variables used in an asm and the asm clobber + list is not allowed. + * stmt.c (decl_conflicts_with_clobbers_p): New function. + (expand_asm_operands): Keep track of clobbered registers. Call + decl_conflicts_with_clobbers_p for each input and output operand. + If no conflicts found before, also do conflict sanity check when + emitting clobbers. + +2002-09-23 Richard Henderson + + * c-common.c (cpp_define_data_format): Remove. + (cb_register_builtins): Don't define __WCHAR_BIT__, __SHRT_BIT__, + __INT_BIT__, __LONG_BIT__, __LONG_LONG_BIT__, __FLOAT_BIT__, + __DOUBLE_BIT__, __LONG_DOUBLE_BIT__. + * doc/cpp.texi: Don't document them either. + (__SCHAR_MAX__, __SHRT_MAX__, __INT_MAX__, __LONG_MAX__, + __LONG_LONG_MAX__): Document. + (__TARGET_FLOAT_FORMAT__): Remove. + +2002-09-23 Richard Henderson + + * real.c (do_multiply): Normalize U before addition. + +2002-09-23 Mark Mitchell + + * c-common.c (flag_abi_version): New variable. + * c-common.h (flag_abi_version): Declare it. + * c-opts.c (missing_arg): Add -fabi-version. + (c_common_decode_option): Process -fabi-version. + * doc/invoke.texi (-fabi-version): Document it. + (-Wabi): Add information about bit-fields in unions. + +2002-09-22 Roger Sayle + + * expr.c (STORE_BY_PIECES_P): New target macro. + (can_store_by_pieces, store_by_pieces): Use STORE_BY_PIECES_P + instead of MOVE_BY_PIECES_P. + * doc/tm.texi: Document this new macro. + +2002-09-22 Jason Thorpe + + * config/mips/netbsd.h (SUBTARGET_ASM_SPEC): Always pass -KPIC + unless -fno-pic or -fno-PIC is specified. + +2002-09-22 John David Anglin + + * c-common.c (preprocessing_trad_p): Define. + * pa-hiux.h, pa-hpux.h, pa-hpux7.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS, SUBTARGET_SWITCHES): Define. + * pa-hpux10.h (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. + * pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define. + * pa-linux.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS, CPP_SPEC): Define. + * pa32-linux.h, pa64-linux.h (CPP_SPEC): Delete. + * pa-osf.h, pa-pro-end.h, rtems.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS): Define. + * pa.h (MASK_SIO, TARGET_SIO, TARGET_PA_10): Define. + (TARGET_SWITCHES): Reformat. Use N_() macro. Add SUBTARGET_SWITCHES. + (SUBTARGET_SWITCHES): Provide default definition. + (TARGET_OPTIONS): Reformat. Use N_() macro. + (CPP_PA10_SPEC, CPP_PA11_SPEC, CPP_PA20_SPEC, CPP_64BIT_SPEC, + CPP_CPU_DEFAULT_SPEC, CPP_64BIT_DEFAULT_SPEC, SUBTARGET_EXTRA_SPECS, + EXTRA_SPECS, CPP_SPEC, CPLUSPLUS_CPP_SPEC, CPP_PREDEFINES): Delete. + (TARGET_CPU_CPP_BUILTINS): Define. + (TARGET_OS_CPP_BUILTINS): Define for BSD-like systems. + * doc/invoke.texi (msio, mwsio): Document new hppa options. + * doc/tm.texi (TARGET_CPU_CPP_BUILTINS): Document macro + preprocessing_trad_p(). + +2002-09-22 Jason Thorpe + + * doc/install.texi: Document behavior of --with-headers and + --with-libs when arguments are omitted. + +2002-09-22 Kazu Hirata + + * dbxout.c: Follow spelling conventions. + * defaults.h: Likewise. + * df.c: Likewise. + * diagnostic.h: Likewise. + * doloop.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * except.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + * flags.h: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * function.h: Likewise. + * gcc.c: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * genattrtab.c: Likewise. + * genconfig.c: Likewise. + * genrecog.c: Likewise. + * ggc-page.c: Likewise. + * ggc.h: Likewise. + * global.c: Likewise. + * gthr-win32.h: Likewise. + * integrate.c: Likewise. + * jump.c: Likewise. + * langhooks.c: Likewise. + * langhooks.h: Likewise. + * line-map.h: Likewise. + * local-alloc.c: Likewise. + * longlong.h: Likewise. + * loop.c: Likewise. + * loop.h: Likewise. + +Tue Aug 27 22:26:35 CEST 2002 Jan Hubicka + + * i386.h (BIGGEST_FIELD_ALIGNMENT): Set proper default for x86_64. + +Tue Aug 27 20:07:01 CEST 2002 Jan Hubicka + + * i386.c (overwrite_options): Set -mpreferred-stack-boundary to 128 + for -Os/TARGET_64BIT too. + +2002-09-21 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.0: Likewise. + * ChangeLog.1: Likewise. + * ChangeLog.2: Likewise. + * ChangeLog.3: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.5: Likewise. + * ChangeLog.6: Likewise. + * FSFChangeLog.10: Likewise. + * FSFChangeLog.11: Likewise. + * alias.c: Likewise. + * basic-block.h: Likewise. + * c-aux-info.c: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * c-format.c: Likewise. + * c-semantics.c: Likewise. + * c-typeck.c: Likewise. + * calls.c: Likewise. + * cfganal.c: Likewise. + * cfgloop.c: Likewise. + * collect2.c: Likewise. + * combine.c: Likewise. + * conflict.c: Likewise. + * cppexp.c: Likewise. + * cppfiles.c: Likewise. + * cpphash.h: Likewise. + * cppinit.c: Likewise. + * cpplex.c: Likewise. + * cpplib.c: Likewise. + * cpplib.h: Likewise. + * cppmacro.c: Likewise. + * cse.c: Likewise. + +2002-09-21 Richard Earnshaw + + * netbsd-aout.h (NETBSD_LINK_SPEC_AOUT): New, takes old definition of + LINK_SPEC. + (LINK_SPEC): Define to NETBSD_LINK_SPEC_AOUT. + * arm/netbsd.h (SUBTARGET_EXTRA_SEPCS): Add NETBSD_LINK_SPEC_AOUT. + (LINK_SPEC): Rework to use NETBSD_LINK_SPEC_AOUT). + +2002-09-21 Richard Earnshaw + + PR opt/7930 + * cse.c (fold_rtx): Calculate old_cost before we fold each + operand. + +2002-09-21 Richard Henderson + + * c-common.c (cpp_define_data_format): Remove __GCC_LITTLE_ENDIAN__, + __GCC_BIG_ENDIAN__, __TARGET_BITS_ORDER__, __TARGET_BYTES_ORDER__, + __TARGET_INT_WORDS_ORDER__, __TARGET_FLOAT_WORDS_ORDER__, + __TARGET_USES_VAX_F_FLOAT__, __TARGET_USES_VAX_D_FLOAT__, + __TARGET_USES_VAX_G_FLOAT__, __TARGET_USES_VAX_H_FLOAT__. + * doc/cpp.texi: Don't document them. + +2002-09-21 Richard Henderson + + * c-common.c (builtin_define_float_constants): Use real_format + to get the floating-point parameters. + +2002-09-21 Richard Henderson + + * real.c (struct real_format): Move to real.h. + (real_format_for_mode): Rename from fmt_for_mode; update all users; + initialize with ieee defaults. + (real_to_target_fmt, real_from_target_fmt): New. + (ieee_single_format, ieee_double_format, ieee_extended_motorola_format, + ieee_extended_intel_96_format, ieee_extended_intel_128_format, + ieee_quad_format, i370_single_format, i370_double_format, + c4x_single_format, c4x_extended_format): Rename from s/_format//. + (ieee_quad_format): Fix emin. + (format_for_size, init_real_once): Remove. + * real.h (struct real_format): Move from real.c. + (real_format_for_mode): Declare. + (real_to_target_fmt, real_from_target_fmt): Declare. + (ieee_single_format, ieee_double_format, ieee_extended_motorola_format, + ieee_extended_intel_96_format, ieee_extended_intel_128_format, + ieee_quad_format, vax_f_format, vax_d_format, vax_g_format, + i370_single_format, i370_double_format, c4x_single_format, + c4x_extended_format): Declare. + * toplev.c (do_compile): Don't call init_real_once. + + * defaults.h (INTEL_EXTENDED_IEEE_FORMAT): Remove. + * doc/tm.texi (INTEL_EXTENDED_IEEE_FORMAT): Remove. + + * config/alpha/alpha.h (TARGET_FLOAT_FORMAT): Define. + * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): 64, if vax mode. + * config/alpha/alpha.c (override_options): Set real_format_for_mode + for VAX, if enabled. + + * config/c4x/c4x.c (c4x_override_options): Set real_format_for_mode + for C4X. + + * config/i370/i370.h (OVERRIDE_OPTIONS): New. + * config/i370/i370.c (override_options): New. + * config/i370/i370-protos.h: Update. + + * config/i386/i386.c (override_options): Set real_format_for_mode + for Intel 80-bit extended. + * config/i386/i386.h (INTEL_EXTENDED_IEEE_FORMAT): Remove. + + * config/i960/i960.h (LONG_DOUBLE_TYPE_SIZE): Mind -mlong-double-64. + (OVERRIDE_OPTIONS): Move code... + * config/i960/i960.c (i960_initialize): ... here. Set + real_format_for_mode for Intel 80-bit extended. + + * config/ia64/ia64.c (ia64_override_options): Set real_format_for_mode + for Intel 80-bit extended, if enabled. + + * config/m68k/m68k.c (override_options): Set real_format_for_mode + for Motorola 96-bit extended. + + * config/vax/vax.h (OVERRIDE_OPTIONS): New. + * config/vax/vax.c (override_options): New. + * config/vax/vax-protos.h: Update. + +2002-09-21 Alan Modra + + * config/rs6000/rs6000.md (builtin_setjmp_receiver): Add + #if TARGET_MACHO. + + * config/rs6000/rs6000.md (floatdisf2_internal2): Combine + insns. Supply missing clobber of scratch reg. + +2002-09-20 Kazu Hirata + + * config/m32r/m32r.c: Follow spelling conventions. + * config/m32r/m32r.h: Likewise. + * config/m32r/m32r.md: Likewise. + * config/m68k/m68k.c: Likewise. + * config/m88k/m88k.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.h: Likewise. + * config/mmix/mmix.c: Likewise. + * config/mn10200/mn10200.c: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/pa/pa.c: Likewise. + * config/pa/pa64-linux.h: Likewise. + * config/pdp11/pdp11.h: Likewise. + * config/romp/romp.c: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/eabi.asm: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/rs6000/xcoff.h: Likewise. + +2002-09-20 Jim Wilson + + * config/v850/v850/lib1funcs.asm (__muldi3): Change r5 to r28. + +2002-09-20 Jakub Jelinek + + * config/i386/i386.md (UNSPEC_GOTNTPOFF, UNSPEC_INDNTPOFF): New. + * config/i386/i386.c (legitimate_pic_address_disp_p): Handle + UNSPEC_GOTNTPOFF and UNSPEC_INDNTPOFF like UNSPEC_GOTTPOFF. + (legitimate_address_p): Likewise. + (legitimize_address): Use @gotntpoff and @indntpoff. + (output_pic_addr_const): Handle UNSPEC_GOTNTPOFF and UNSPEC_INDNTPOFF. + (output_addr_const_extra): Likewise. + +2002-09-20 Jim Wilson + + * combine.c (try_combine): When split an instruction pair, where the + first has a sign_extend src, verify that the src and dest modes match. + +2002-09-20 Richard Henderson + + * config/mips/mips.c (dfhigh, dflow, sfhigh, sflow): Remove. + (override_options): Do not initialize them. + (mips_const_double_ok): Allow no fp constants except zero, + and not even that for mips16. + (const_float_1_operand): Use dconst1. + * config/mips/mips.md (movsf, movsf_internal1, movsf_internal2, + movdf, movdf_internal1, movdf_internal1a, movdf_internal2): + Don't allow arbitrary constants; fix predicates and C constraint. + +2002-09-20 Neil Booth + + * cppmacro.c: Don't warn about function-like macros without + '(' during pre-expansion. + +2002-09-20 Jim Wilson + + * config/v850/v850.c (current_function_anonymous_args): Delete. + (expand_prologue): Use current_function_args_info.anonymous_args. + (expand_epilogue): Delete use of current_function_anonymous_args. + * config/v850/v850.h (struct cum_arg): Add anonymous_args field. + (INIT_CUMULATIVE_ARGS): Clear anonymous_args field. + (current_function_anonymous_args): Delete extern declaration. + (SETUP_INCOMING_VARARGS): Set anonymous_args field. + +2002-09-20 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Update for change + to load_macho_picbase. + * config/rs6000/rs6000.md: Document Darwin-specific unspec IDs. + (load_macho_picbase): Take the symbol to use as a parameter. + (macho_correct_pic): New insn. + (builtin_setjmp_reciever): On Darwin, restore the PIC register. + + * config/rs6000/rs6000.h (ELIMINABLE_REGS): Use + RS6000_PIC_OFFSET_TABLE_REGNUM rather than hardcoding 30. + (CAN_ELIMINATE): Likewise. + (INITIAL_ELIMINATION_OFFSET): Likewise. + (TOC_REGISTER): Likewise. + +2002-09-20 Richard Henderson + + * real.c (real_hash): New. + * real.h: Declare it. + * cse.c (canon_hash): Use it. + * cselib.c (hash_rtx): Likewise. + * emit-rtl.c (const_double_htab_hash): Likewise. + * rtl.h (CONST_DOUBLE_REAL_VALUE): New. + * varasm.c (struct rtx_const): Reduce vector size; separate + integer and fp vectors. + (HASHBITS): Remove. + (const_hash_1): Rename from const_hash. Use real_hash. Do not + take modulus MAX_HASH_TABLE. + (const_hash): New. Do take modulus MAX_HASH_TABLE. + (output_constant_def): Do not take modulus MAX_HASH_TABLE. + (SYMHASH): Don't use HASHBITS. + (decode_rtx_const): Copy only active bits from REAL_VALUE_TYPE. + Fix CONST_VECTOR thinko wrt fp vectors. Fix kind comparison. + (simplify_subtraction): Fix kind comparison. + (const_hash_rtx): Return unsigned int. Don't use HASHBITS. + Use a union to pun integer array. + * config/rs6000/rs6000.c (rs6000_hash_constant): Use real_hash; + only hash two words of integral CONST_DOUBLE. + +2002-09-20 Steve Ellcey + + * config/ia64/hpux.h (STARTFILE_SPEC): Modify. + (STARTFILE_PREFIX_SPEC): New. + (LINK_SPEC): Modify. + (LIB_SPEC): Modify. + (LIBGCC_SPEC): New. + +2002-09-20 Jakub Jelinek + + * config/i386/i386.c (legitimate_pic_address_disp_p): Allow + UNSPEC_NTPOFF and UNSPEC_DTPOFF to be offsetted by constant. + +2002-09-20 Jeroen Dobbelaere + + * config/arm/arm.md (sign_extract_onebit, not_signextract_onebit): + Add clobber of the condition code register. + +2002-09-20 Richard Henderson + + * real.c (do_fix_trunc): Static. + (encode_ieee_single, encode_ieee_double, encode_ieee_extended, + encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, + encode_i370_single, encode_i370_double, encode_c4x_single, + encode_c4x_extended): Add default abort case. + +2002-09-20 Richard Henderson + + * real.h (enum real_value_class, SIGNIFICAND_BITS, EXP_BITS, + MAX_EXP, SIGSZ, SIG_MSB, struct real_value): Move from real.c. + (struct realvaluetype): Remove. + (REAL_VALUE_TYPE): Use struct real_value. + (REAL_VALUE_TYPE_SIZE): Use SIGNIFICAND_BITS. + (test_real_width): New. + * real.c: Global replace struct real_value with REAL_VALUE_TYPE. + (real_arithmetic): Avoid hoops for REAL_VALUE_TYPE parameters. + (real_compare, real_exponent, real_ldexp, real_isinf, real_isnan, + real_isneg, real_isnegzero, real_identical, exact_real_inverse, + real_to_integer, real_to_integer2, real_to_decimal, + real_to_hexadecimal, real_from_string, real_from_integer, + real_inf, real_nan, real_2expN, real_convert, real_to_target, + real_from_target): Likewise. + * tree.h (struct tree_real_cst): Use real_value not realvaluetype. + * gengtype-yacc.y (bitfieldopt): Accept an ID as well. + +2002-09-20 Richard Henderson + + * real.h (UNKNOWN_FLOAT_FORMAT, IEEE_FLOAT_FORMAT, VAX_FLOAT_FORMAT, + IBM_FLOAT_FORMAT, C4X_FLOAT_FORMAT, TARGET_FLOAT_FORMAT): Move ... + * defaults.h: ... here. + * config/arm/arm.h, config/avr/avr.h, config/d30v/d30v.h, + config/fr30/fr30.h, config/frv/frv.h, config/ia64/ia64.h, + config/ip2k/ip2k.h, config/mips/mips.h, config/stormy16/stormy16.h, + config/xtensa/xtensa.h (TARGET_FLOAT_FORMAT): Remove. + +2002-09-20 Hans-Peter Nilsson + + * config/mmix/mmix.md ("negdf2"): Rewrite. + ("*expanded_negdf2"): New. + +2002-09-19 Jim Wilson + + * combine.c (simplify_set): When optimizing a subreg src with a + cc0 dest, use GET_MODE (src) for mask instead of inner_mode. + +2002-09-19 Dale Johannesen + * combine.c (make_extraction): Don't create + invalid subreg. + +2002-09-19 Roger Sayle + + * tree.c (integer_nonzerop): New predicate for nonzero integers. + * tree.h (integer_nonzerop): Add function prototype. + * stmt.c (expand_end_loop): Don't rotate the loop when there + are no instructions in the test, i.e. the loop is unconditional. + (expand_exit_loop_if_false): Optimize RTL generation of loop + tests when the condition is always true or always false. + * c-semantics.c (genrtl_do_stmt): Optimize RTL generation of + do-loops when the condition is always true. + (genrtl_for_stmt): Optimize RTL generation of for-loops when + the for-expression is empty. + +2002-09-19 Zack Weinberg + + * gcc.c (use_pipes): New flag. + (process_command): Set it. Adjust check for -pipe conflicting + with -time or -save-temps. + (do_spec_1): Use it. Handle %|SUFFIX, %mSUFFIX, and + % + + * config/s390/s390.c (addr_generation_dependency_p): Handle SUBREG + and STRICT_LOW_PART within SET_DEST. + * config/s390/s390.md ("*extractqi", "*extracthi"): New insns with + splitters, replacing pre-reload splitters. + ("*zero_extendhisi2_31", "*zero_extendqisi2_31", + "*zero_extendqihi2_31"): New insns. + ("*zero_extendqihi2_64"): Do not clobber CC. + +2002-09-18 Devang Patel + + * cp/cp-tree.h: New prototype for walk_vtables(). + * cp/decl.c (walk_vtables_r): New function. + (struct cp_binding_level): Add new members, namespaces, + names_size and vtables. + (add_decl_to_level): Add decl in namespaces or vtables + chain, if conditions match. + (walk_vtables): New function. + (walk_namespaces_r): Travers separate namespace chain + for namespace decls. + (wrapup_globals_for_namespace): Use names_size instead + of list_length(). + * cp/decl2.c (finish_file): Use walk_vtables() instead of + walk_globals() to walk vtable decls. + +2002-09-19 Steve Ellcey + + * config/ia64/hpux.h (CTORS_SECTION_ASM_OP): New. + (DTORS_SECTION_ASM_OP): Ditto. + (READONLY_DATA_SECTION_ASM_OP): Moved. + (DATA_SECTION_ASM_OP): New. + (SDATA_SECTION_ASM_OP): New. + (BSS_SECTION_ASM_OP): New. + (SBSS_SECTION_ASM_OP): New. + (TEXT_SECTION_ASM_OP): New. + +2002-09-19 Kazu Hirata + + * config/fp-bit.c: Follow spelling conventions. + * config/d30v/d30v.c: Likewise. + * config/d30v/d30v.h: Likewise. + * config/fr30/fr30.c: Likewise. + * config/fr30/fr30.h: Likewise. + * config/fr30/fr30.md: Likewise. + * config/frv/frv.c: Likewise. + * config/frv/frv.h: Likewise. + * config/h8300/h8300.c: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + * config/i370/i370.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/i386.md: Likewise. + * config/i386/pentium.md: Likewise. + * config/i386/winnt.c: Likewise. + * config/i960/i960.c: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ip2k/ip2k.c: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/ip2k/ip2k.md: Likewise. + * config/ip2k/libgcc.S: Likewise. + +2002-09-19 Stephen Clarke + + * config/sh/sh.h (UNSPEC_GOTOFF_P): Define. + (GOTOFF_P): Extend to allow gotoff plus constant. + +2002-09-18 Richard Henderson + + * ifcvt.c (noce_process_if_block): Correctly detect X modified + with INSN_B before COND_EARLIEST. Don't check A and B for + modification in condition range. Reorder INSN_B for A==B properly. + (if_convert): Iterate until no matches for a block. + +2002-09-18 Richard Henderson + + * calls.c (store_one_arg): Rename default_align to parm_align; + always adjust parm_align for downward padding. + +2002-09-18 Richard Henderson + + * toplev.c (backend_init): Move init_real_once invocation ... + (do_compile): ... here. + +2002-09-18 Richard Henderson + + * sibcall.c (optimize_sibling_and_tail_recursive_call): Also remove + RTX_UNCHANGING_P markers for successful tail-recursive replacement. + +2002-09-18 Richard Henderson + + * real.c (round_for_format): Collect sticky as unsigned long, not bool. + +2002-09-19 Alan Modra + + * config/rs6000/rs6000.md: (floatdisf2): Rename to + floatdisf2_internal1. + (floatdisf2): New define_expand. + (floatdisf2_internal2): Likewise. + +2002-09-18 Richard Henderson + + * real.c (sticky_rshift_significand): Collect sticky as + unsigned long, not bool. + +2002-09-18 Ulrich Weigand + + * config/s390/s390.c (s390_address_cost): New function. + config/s390/s390-protos.h (s390_address_cost): Add prototype. + config/s390/s390.h (ADDRESS_COST): Call s390_address_cost. + (RTX_COST): Use COSTS_N_INSNS. + +2002-09-18 Douglas Rupp + Donn Terry + + * stor-layout.c (place_field): Handle alignment of whole + structures when MSVC compatible bitfields are involved. + Change method of computing location of MS bitfields to + be compatible with #pragma pack(n). + + * tree.h (record_layout_info): Add new field + remaining_in_alignment. + + * doc/tm.texi: (TARGET_MS_BITFIELD_LAYOUT_P): Update. + (pragma pack): Add paragraph on MSVC bitfield packing. + +2002-09-18 Richard Earnshaw (reanrsha@arm.com) + + PR optimization/7967 + * arm.md (ne_zeroextractsi): Add clobber of the condition code + register. + +2002-09-18 Kazu Hirata + + * config/s390/s390.c: Follow spelling conventions. + * config/sh/lib1funcs.asm: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/v850/v850.c: Likewise. + * config/v850/v850.h: Likewise. + * config/vax/vax.c: Likewise. + * config/vax/vax.h: Likewise. + +2002-09-18 Nick Clifton + + * config/rs60000/rs6000.c (rs6000_emit_move): Handle V1DImode moves. + * config/rs60000/rs6000.c (SPE_VECTOR_MODE): Include V1DImode. + * config/rs6000/spe.md (movv1di, movv1di_internal): New patterns. + +2002-09-17 Kazu Hirata + + * function.c (max_parm_reg_num): Remove. + * stmt.c (in_control_zone_p, stmt_loop_nest_empty, + drop_through_at_end_p, move_cleanups_up, + expand_end_case_dummy, case_index_expr_type): Likewise. + * stor-layout.c (pos_from_byte): Likewise. + * tree.c (chain_member_value, chain_member_purpose, listify, + tree_int_cst_msb, index_type_equal): Likewise. + * tree.h: Remove prototypes for unused functions. + +2002-09-17 Zack Weinberg + + * ABOUT-GCC-NLS: Remove reference to enquire, and out-of-date + statement that the only translation is to en_UK. + +2002-09-17 Kazu Hirata + + * config/alpha/alpha.c: Follow spelling conventions. + * config/alpha/alpha.h: Likewise. + * config/alpha/alpha.md: Likewise. + * config/arc/arc.h: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/pe.c: Likewise. + * config/arm/unknown-elf.h: Likewise. + * config/avr/avr.c: Likewise. + * config/avr/avr.h: Likewise. + * config/c4x/c4x.c: Likewise. + * config/cris/cris.c: Likewise. + * config/cris/cris.h: Likewise. + +2002-09-17 Samuel Figueroa + + * final.c (final_scan_insn): Use new macro ASM_OUTPUT_ALIGN_WITH_NOP. + * config/sparc/sparc.h (ASM_OUTPUT_ALIGN_WITH_NOP) New macro. + * doc/tm.texi (ASM_OUTPUT_ALIGN_WITH_NOP) New description. + +2002-09-17 Dale Johannesen + + * cfgcleanup.c (try_forward_edges): Do not forward a + branch to just after a loop exit before loop optimization; + this interfered with doloop detection. + +2002-09-17 Nick Clifton + + * config/arm/arm.c (output_return_instruction): Do not + writeback the stack pointer when it is being loaded. + (arm_output_epilogue): Likewise. + +2002-09-17 Kazu Hirata + + * optabs.c (prepare_cmp_insn): Let emit_library_call_value + generate a pseudo reg that receives the result of a libcall. + (prepare_float_lib_cmp): Likewise. + +2002-09-17 Steve Ellcey + + * config/ia64/elf.h: Remove CPP_PREDEFINES. + +Tue Sep 17 13:58:04 2002 Nicola Pero + + Fix PR/7014 and related objc bugs: + * c-typeck.c (comp_target_types): Added a reflexive argument. + Pass it to ObjC when/if calling objc_comptypes(). Updated all + callers to provide the appropriate reflexive argument. + * objc/objc-act.c (objc_comptypes): Carefully checked and fixed + typechecking for all cases of comparisons and assignments, + particularly the obscure and less common ones involving protocols. + +2002-09-17 Nick Clifton + + * machmode.def (V1DImode): New mode. A single element vector. + * tree.h (TI_UV1DI_TYPE, TI_V1DI_TYPE): New tree_index enums. + (unsigned_V1DI_type_node, V1D1_type_node): New type nodes. + * tree.c (build_common_tree_nodes_2): Build + unsigned_V1DI_type_node and V1D1_type_node. + * c-common.c (c_common_type_for_mode): Return + unsigned_V1DI_type_node or V1D1_type_node for V1DImode. + * rtl.c (class_narrowest_): Start integer vector nodes with V1DImode. + +Tue Sep 17 13:40:13 2002 Nicola Pero + + * doc/objc.texi (Constant string objects): Extended documentation + to make clear that the constant string class ivar layout is + completely fixed. + +2002-09-17 Roger Sayle + + * cfgrtl.c (flow_delete_block_noexpunge): Delete orphaned + NOTE_INSN_LOOP_CONT notes when deleting basic blocks. + +2002-09-16 Volker Reichelt + + * config/mips/mips.c (save_restore_insns): Remove unused variable. + * gcc.c (make_relative_prefix): Likewise. + * loop.c (check_final_value): Likewise. + * jump.c (init_label_info): Remove return value. + * cse.c (prev_insn): Move variable between #ifdef HAVE_cc0 ... #endif. + +2002-09-16 Kaveh R. Ghazi + + * dsp16xx.h (ASM_FORMAT_PRIVATE_NAME): Delete. + (ASM_PN_FORMAT): Define. + +2002-09-16 Kaveh R. Ghazi + + * alpha.h, alpha/vms.h, arc.h, arm/aof.h, arm/aout.h, avr.h, + c4x.h, cris.h, d30v.h, fr30.h, frv.h, h8300.h, i370.h, i386.h, + i960.h, ia64.h, ip2k.h, m32r.h, m68hc11.h, m68k/3b1.h, + m68k/hp320.h, m68k.h, m68k/mot3300.h, m68k/sgs.h, m68k/tower-as.h, + m88k.h, mcore.h, mips.h, mmix.h, mn10200.h, mn10300.h, ns32k.h, + pa.h, pdp11.h, romp.h, rs6000.h, s390/linux.h, sh.h, sparc.h, + stormy16.h, v850.h, vax.h, xtensa.h (ASM_FORMAT_PRIVATE_NAME): + Delete. + * alpha/vms.h, h8300.h, i370.h, ia64.h, m68k/3b1.h, m68k/hp320.h, + m68k/mot3300.h, m68k/sgs.h, m68k/tower-as.h, mmix.h, mn10200.h, + mn10300.h, pa.h, v850.h (ASM_PN_FORMAT): Define. + + * defaults.h (ASM_PN_FORMAT, ASM_FORMAT_PRIVATE_NAME): Define. + * doc/tm.texi (ASM_FORMAT_PRIVATE_NAME): Update documentation. + +2002-09-16 Richard Henderson + + * expr.c (emit_block_move): Set memory block size as appropriate + for the copy. + +2002-09-16 Richard Henderson + + PR fortran/3924 + * sdbout.c (sdbout_symbol): Don't handle offsets from a symbol. + +2002-09-16 Richard Henderson + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Adjust SIZE + as well as OFFSET for BITPOS. + +2002-09-16 Jeff Garzik + + * config.gcc: Treat winchip_c6-*|winchip2-*|c3-* as pentium-mmx. + * config/i386/i386.c (processor_alias_table): Add winchip-c6, + winchip2 and c3. + * doc/invoke.texi: Mention new aliases. + +2002-09-16 John David Anglin + + * calls.c (store_one_arg): Set default alignment for BLKmode arguments + to BITS_PER_UNIT when ARGS_GROW_DOWNWARD and the padding direction is + downward. + * function.c (pad_below): Always compile. + (locate_and_pad_parm): If defined ARGS_GROW_DOWNWARD, pad argument to + alignment when it is not in a register or REG_PARM_STACK_SPACE is true. + Pad below when the argument is not in a register and the padding + direction is downward. + + * pa-64.h (MUST_PASS_IN_STACK): Move define to pa.h. + (PAD_VARARGS_DOWN): Define. + * pa.c (function_arg_padding): Revise padding directions to make them + compatible with the 32 and 64-bit runtime architecture documentation. + (hppa_va_arg): Add code to handle variable and size zero arguments + passed by reference on TARGET_64BIT. Reformat. + (function_arg): Use a PARALLEL for BLKmode and aggregates args on + TARGET_64BIT. Use a DImode PARALLEL for BLKmode args 5 to 8 bytes + wide when !TARGET_64BIT. Move forward check for mode==VOIDmode. + Add comments. + * pa.h (MAX_PARM_BOUNDARY): Correct define for TARGET_64BIT. + (RETURN_IN_MEMORY): Return size zero types in memory. + (FUNCTION_VALUE): Return TFmode in general registers. + (MUST_PASS_IN_STACK): Define. + (FUNCTION_ARG_BOUNDARY): Simplify. + (FUNCTION_ARG_PASS_BY_REFERENCE): Pass variable and zero sized types + by reference. + (FUNCTION_ARG_CALLEE_COPIES): Define to FUNCTION_ARG_PASS_BY_REFERENCE. + +2002-09-16 Richard Henderson + + * real.c (do_fix_trunc): New. + (real_arithmetic): Call it. + * simplify-rtx.c (simplify_unary_operation): Handle FIX + with a floating-point result mode. + +2002-09-16 Richard Henderson + + * builtin-types.def (BT_FN_FLOAT_CONST_STRING): New. + (BT_FN_DOUBLE_CONST_STRING, BT_FN_LONG_DOUBLE_CONST_STRING): New. + * builtins.def (__builtin_nan, __builtin_nanf, __builtin_nanl): New. + (__builtin_nans, __builtin_nansf, __builtin_nansl): New. + * builtins.c (fold_builtin_nan): New. + (fold_builtin): Call it. + * real.c (real_nan): Parse a non-empty string. + (round_for_format): Fix NaN significand truncation. + * real.h (real_nan): Return bool. + * doc/extend.texi: Document new builtins. + +2002-09-16 Jason Merrill + Danny Smith + + * config/i386/winnt.c (ix86_handle_dll_attribute): Set + DECL_EXTERN and TREE_PUBLIC for dllimported variables here... + (i386_pe_mark_dllimport): Not here. + +2002-09-16 Nathan Sidwell + + * c-semantics.c (genrtl_do_stmt): Cope with NULL cond. + +2002-09-16 Geoffrey Keating + + * config/rs6000/rs6000.c (build_mask64_2_operands): Suppress + warnings about unused operands when HOST_BITS_PER_WIDE_INT is + < 64. + (rs6000_emit_cmove): Use real_isinf not target_isinf. + +2002-09-16 Kazu Hirata + + * calls.c (emit_library_call_value_1): Don't refer to + hard_libcall_value. + * optabs.c (prepare_float_lib_cmp): Likewise. + +2002-09-16 Geoffrey Keating + + * ggc-common.c (ggc_mark_rtx_children_1): Update for changed name + mangling. + + The following changes are merged from pch-branch: + + * doc/gty.texi (GTY Options): Document %a. + * gengtype.c (do_scalar_typedef): New function. + (process_gc_options): Handle `length' option. + (set_gc_used_type): A pointer to an array of structures doesn't + qualify as a pointer to a structure. + (output_escaped_param): Add `%a' escape. + (write_gc_structure_fields): Allow 'desc' on array of unions. + (main): Define `uint8', `jword' and `JCF_u2' as scalars; use + do_scalar_typedef. + + * gengtype.c (enum rtx_code): Make global. + (rtx_format): Make global. + (rtx_next): New. + (gen_rtx_next): New. + (write_rtx_next): New. + (adjust_field_rtx_def): Skip fields marked by chain_next. + (open_base_files): Delete redundant prototype. + (write_enum_defn): New. + (output_mangled_typename): Correct abort call. + (write_gc_marker_routine_for_structure): Handle chain_next and + chain_prev options. + (finish_root_table): Don't output redundant \n. + (main): Call gen_rtx_next, write_rtx_next, write_enum_defn. + * c-tree.h (union lang_tree_node): Add chain_next option. + + * gengtype.h (NUM_PARAM): New definition. + (struct type): For TYPE_PARAM_STRUCT, allow multiple parameters. + * gengtype.c (find_param_structure): New. + (adjust_field_type): Handle param_is option. + (process_gc_options): Detect use_params option. Update callers. + (set_gc_used_type): Add 'param' parameter, update callers. Handle + 'use_params' option. + (open_base_files): Add splay-tree.h to list of files included. + (output_mangled_typename): New. + (write_gc_structure_fields): Update 'param' parameter to support + multiple parameters. Change name mangling. Allow parameterized + fields to have an apparent scalar type. Handle param_is options, + use_param option. + (write_gc_marker_routine_for_structure): Update for change to name + mangling. Better guess the output file for parameterized types. + (write_gc_types): Update for change to name mangling. + (write_gc_root): Update for change to name mangling. Handle (ignore) + param_is options. + * doc/gty.texi (GTY Options): Add description of param_is + options, use_params option. + * ggc.h (ggc_mark_rtx): Update for changed name mangling. + * gengtype-lex.l: Produce token for param_is. + * gengtype-yacc.y: Parse param_is. + + * gengtype.c (adjust_field_tree_exp): Don't name a variable 'rindex'. + + * rtl.c: Update comment describing rtx_format. + * rtl.h (union rtunion): Separate definition and typedef. + (struct rtx_def): Use gengtype to mark. + * Makefile.in (gengtype.o): Also depend on rtl.def. + * ggc.h (ggc_mark_rtx_children): Delete prototype. + (ggc_mark_rtx): Change to alias of gengtype-generated routine. + * ggc-common.c (ggc_mark_rtx_children): Delete. + (ggc_mark_rtx_children_1): Delete. + (gt_ggc_m_rtx_def): Delete. + * gengtype.c (adjust_field_rtx_def): New. + (adjust_field_type): Call adjust_field_rtx_def. + (write_gc_structure_fields): Add 'default' case to switch if none + is specified; remove unused code. + + * tree.h (struct tree_exp): Update for change to meaning + of special. + * gengtype.c (adjust_field_tree_exp): New function. + (adjust_field_type): Handle `tree_exp' special here. + (write_gc_structure_fields): Don't handle `tree_exp' special here. + Handle new `dot' option. + + * gengtype.h: Make `info' a pointer-to-const. + * gengtype-yacc.y (yacc_ids): Use xasprintf. + + * gengtype.c (write_gc_structure_fields): Remove implementation + of `always' option, add `default' option. + * doc/gty.texi (GTY Options): Remove documentation of `always', + add `default'. + +2002-09-16 Hans-Peter Nilsson + + * output.h: Remove #ifdef RTX_CODE and #ifdef TREE_CODE. + +2002-09-16 Kaveh R. Ghazi + + * m68hc11.md (addhi_sp): Fix uninitialized variable bug. + + * c4x-c.c, c4x.c, darwin.c, i370-c.c, m32r.c: Include tm_p.h + instead of the *-protos.h file directly. + * t-c4x, t-i370, t-v850: Depend on $(TM_P_H). + * darwin.c (machopic_output_stub): Move prototype ... + * darwin-protos.h (machopic_output_stub): ... here. + * rs6000-protos.h (machopic_output_stub): Don't declare. + +2002-09-16 Richard Henderson + + * c-common.c (builtin_define_float_constants): Emit __FOO_DENORM_MIN__. + +2002-09-16 Richard Henderson + + * real.c, real.h: Rewrite from scratch. + + * Makefile.in (simplify-rtx.o): Depend on TREE_H. + (paranoia): New target. + * builtins.c (fold_builtin_inf): Use new real.h interface. + * c-common.c (builtin_define_with_hex_fp_value): Likewise. + * c-lex.c (interpret_float): Likewise. + * emit-rtl.c (gen_lowpart_common): Likewise. + * optabs.c (expand_float): Use real_2expN. + * config/ia64/ia64.md (divsi3, udivsi3): Likewise. + * defaults.h (INTEL_EXTENDED_IEEE_FORMAT): New. + (FLOAT_WORDS_BIG_ENDIAN): New. + * cse.c (find_comparison_args): Don't pass FLOAT_STORE_FLAG_VALUE + directly to REAL_VALUE_NEGATIVE. + * loop.c (canonicalize_condition): Likewise. + * simplify-rtx.c: Include tree.h. + (simplify_unary_operation): Don't handle FIX and UNSIGNED_FIX + with floating-point result modes. + * toplev.c (backend_init): Call init_real_once. + + * fold-const.c (force_fit_type): Don't call CHECK_FLOAT_VALUE. + * tree.c (build_real): Likewise. + * config/alpha/alpha.c, config/vax/vax.c (float_strings, + float_values, inited_float_values, check_float_value): Remove. + * config/alpha/alpha.h, config/m68hc11/m68hc11.h, + config/m88k/m88k.h, config/vax/vax.h (CHECK_FLOAT_VALUE): Remove. + * doc/tm.texi (CHECK_FLOAT_VALUE): Remove. + (VAX_HALFWORD_ORDER): Remove. + +2002-09-16 Ulrich Weigand + + * config/s390/s390.c: (legitimize_la_operand): Remove, replace by ... + (s390_load_address): ... this new function. + (s390_decompose_address): Allow the argument pointer and all + virtual registers as 'pointer' registers. + (s390_expand_plus_operand): Use s390_load_address. + config/s390/s390.md (movti, movdi, movdf splitters): Likewise. + ("force_la_31"): New insn pattern. + config/s390/s390-protos.h (legitimize_la_operand): Remove. + (s390_load_address): Add prototype. + + * config/s390/s390.c: Include "optabs.h". + (s390_expand_movstr, s390_expand_clrstr, s390_expand_cmpstr): New. + config/s390/s390-protos.h (s390_expand_movstr, s390_expand_clrstr, + s390_expand_cmpstr): Add prototypes. + config/s390/s390.md ("movstrdi", "movstrsi"): Call s390_expand_movstr. + ("movstrdi_short"): Rename to "movstr_short_64". Change predicates + for operands 0 and 1 to "memory_operand". Add type attribute. + ("movstrsi_short"): Rename to "movstr_short_31". Change predicates + for operands 0 and 1 to "memory_operand". Add type attribute. + ("movstrdi_long", "movstrsi_long"): Remove. + ("movstrdi_64"): Rename to "movstr_long_64". Add type attribute. + ("movstrsi_31"): Rename to "movstr_long_31". Add type attribute. + ("clrstrdi", "clrstrsi"): Call s390_expand_clrstr. + ("clrstrsico"): Remove, replace by ... + ("clrstr_short_64", "clrstr_short_31"): ... these new patterns. + ("clrstrsi_64"): Rename to "clrstr_long_64". + ("clrstrsi_31"): Rename to "clrstr_long_31". + ("cmpstrdi", "cmpstrsi"): Call s390_expand_cmpstr. + ("cmpstr_const"): Remove, replace by ... + ("cmpstr_short_64", "cmpstr_short_31"): ... these new patterns. + ("cmpstr_64"): Rename to "cmpstr_long_64". + ("cmpstr_31"): Rename to "cmpstr_long_31". + +2002-09-16 Kazu Hirata + + * ABOUT-NLS: Follow spelling conventions. + * ChangeLog: Likewise. + * ChangeLog.1: Likewise. + * ChangeLog.2: Likewise. + * ChangeLog.3: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.5: Likewise. + * ChangeLog.6: Likewise. + * FSFChangeLog.10: Likewise. + * FSFChangeLog.11: Likewise. + * c-common.c: Likewise. + * c-lex.c: Likewise. + * c-objc-common.c: Likewise. + * cppexp.c: Likewise. + * cppinit.c: Likewise. + * cpplex.c: Likewise. + * doloop.c: Likewise. + * flow.c: Likewise. + * function.c: Likewise. + * integrate.c: Likewise. + * loop.c: Likewise. + * reg-stack.c: Likewise. + * reload.h: Likewise. + * ssa.c: Likewise. + +2002-09-15 Kaveh R. Ghazi + + * Makefile.in (vmsdbgout.o): Depend on $(TARGET_H) + * vmsdbgout.c: Include "target.h". + +2002-09-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.0: Likewise. + * ChangeLog.1: Likewise. + * ChangeLog.2: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.6: Likewise. + * config.gcc: Likewise. + * dwarfout.c: Likewise. + * reload1.c: Likewise. + * simplify-rtx.c: Likewise. + * unwind-sjlj.c: Likewise. + * config/avr/avr.h: Likewise. + * config/d30v/d30v.h: Likewise. + * config/frv/frv.c: Likewise. + * config/frv/frv.h: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/m88k/m88k-move.sh: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + * doc/extend.texi: Likewise. + * doc/interface.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/md.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/tm.texi: Likewise. + * doc/trouble.texi: Likewise. + * ginclude/float.h: Likewise. + * treelang/treelang.texi: Likewise. + +2002-09-15 Kaveh R. Ghazi + + * i386-protos.h (i386_pe_dllexport_name_p, + i386_pe_dllimport_name_p, i386_pe_unique_section, + i386_pe_declare_function_type, i386_pe_record_external_function, + i386_pe_record_exported_symbol, i386_pe_asm_file_end): Add + prototype. + * i386/t-cygwin (winnt.o): Depend on $(TM_P_H). + * i386/t-interix (winnt.o): Likewise. + + * v850-protos.h (v850_output_addr_const_extra): Prototype. + +2002-09-15 Jason Thorpe + + * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Add + MIPS ABI CPP macros. + (TARGET_CPU_CPP_BUILTINS): Redefine. + (SUBTARGET_EXTRA_SPECS): Remove subtarget_endian_default. + (SUBTARGET_ENDIAN_DEFAULT_SPEC): Remove. + +2002-09-15 Kaveh R. Ghazi + + * ia64/aix.h (TARGET_OS_CPP_BUILTINS): Fix typo. + +2002-09-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.0: Likewise. + * ChangeLog.1: Likewise. + * ChangeLog.2: Likewise. + * ChangeLog.3: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.5: Likewise. + * ChangeLog.6: Likewise. + * FSFChangeLog.10: Likewise. + * FSFChangeLog.11: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-format.c: Likewise. + * c-opts.c: Likewise. + * cpplib.c: Likewise. + * langhooks.h: Likewise. + * real.c: Likewise. + * reg-stack.c: Likewise. + * toplev.c: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/linux-gas.h: Likewise. + * config/arm/netbsd.h: Likewise. + * config/c4x/c4x.c: Likewise. + * config/c4x/c4x.h: Likewise. + * config/c4x/c4x.md: Likewise. + * config/c4x/libgcc.S: Likewise. + * config/fr30/fr30.md: Likewise. + * config/frv/frv.md: Likewise. + * config/ia64/ia64.md: Likewise. + * config/mips/mips.h: Likewise. + * config/mn10300/mn10300.c: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/v850/v850.md: Likewise. + * doc/extend.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/md.texi: Likewise. + +2002-09-15 Jason Thorpe + + * config/netbsd.h (LIB_SPEC): Include the appropriate pthread + library if -pthread is specified. + +2002-09-15 Jason Thorpe + + * config.gcc (*-*-netbsd*): Set thread_file to 'posix' + for --enable-threads=yes and --enable-threads=posix. + +2002-09-15 Kazu Hirata + + * config/sparc/cypress.md: Replace Sparc with SPARC. + * config/sparc/freebsd.h: Likewise. + * config/sparc/gmon-sol2.c: Likewise. + * config/sparc/hypersparc.md: Likewise. + * config/sparc/lb1spc.asm: Likewise. + * config/sparc/lb1spl.asm: Likewise. + * config/sparc/linux.h: Likewise. + * config/sparc/linux64.h: Likewise. + * config/sparc/lynx.h: Likewise. + * config/sparc/sol2.h: Likewise. + * config/sparc/sparc-modes.def: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + * config/sparc/sparclet.md: Likewise. + * config/sparc/supersparc.md: Likewise. + * config/sparc/sysv4.h: Likewise. + * config/sparc/vxsim.h: Likewise. + * config/sparc/vxsparc64.h: Likewise. + +2002-09-14 Kaveh R. Ghazi + + * c-lex.c (cb_ident): Mark variable with ATTRIBUTE_UNUSED. + * collect2.c (ignore_library, aix_std_libs): Move into the context + where it is used. + * m68hc11.c (m68hc11_autoinc_compatible_p): Delete prototype. + (autoinc_mode, m68hc11_make_autoinc_notes): Add prototypes. + * m88k.c (output_call): Wrap variables with macro controlling use. + * rs6000.md: Likewise. Const-ify variable. + * sh.h (ASM_OUTPUT_LABELREF): Likewise. + * final.c (only_leaf_regs_used): Likewise. + * regrename.c (maybe_mode_change): Mark parameter with + ATTRIBUTE_UNUSED. + * reload.c (find_valid_class): Likewise. Likewise for variable. + (find_reloads_address_1): Likewise. + * varasm.c (weak_finish): Wrap variable with macro controlling use. + +2002-09-14 Marek Michalkiewicz + + * config/avr/avr.c (output.h): Move after inclusion of tree.h. + +2002-09-14 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.0: Likewise. + * ChangeLog.2: Likewise. + * ChangeLog.3: Likewise. + * ChangeLog.4: Likewise. + * ChangeLog.5: Likewise. + * ChangeLog.6: Likewise. + * cppfiles.c: Likewise. + * cppinit.c: Likewise. + * cpplib.h: Likewise. + * cse.c: Likewise. + * debug.h: Likewise. + * df.c: Likewise. + * dominance.c: Likewise. + * hashtable.c: Likewise. + * hashtable.h: Likewise. + * loop.c: Likewise. + * config/arm/README-interworking: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/frv/frv.c: Likewise. + * config/frv/frv.h: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/stormy16/stormy-abi: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/v850/v850.c: Likewise. + +2002-09-14 Kazu Hirata + + * loop.c: Fix a comment typo. + +2002-09-14 Kazu Hirata + + * config/fr30/fr30.h: Fix comment typos. + * config/frv/frv.c: Likewise. + * config/i386/xmmintrin.h: Likewise. + * config/mips/mips.c: Likewise. + * config/sh/sh.c: Likewise. + +2002-09-14 Kazu Hirata + + * haifa-sched.c: Follow spelling conventions. + * regclass.c: Likewise. + * regrename.c: Likewise. + * config/fp-bit.c: Likewise. + * config/frv/frv.h: Likewise. + * config/m88k/m88k.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/gnu.h: Likewise. + * config/rs6000/linux.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/sh/sh.c: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/ultra1_2.md: Likewise. + +2002-09-14 Stephane Carrez + + * config/m68hc11/m68hc11.md ("movdi_internal"): Allow any offsetable + memory operand when source is 0 (K constraint). + ("movsi_internal"): Likewise. + ("movdf_internal"): Likewise. + ("movsf_internal"): Likewise. + +2002-09-14 Alan Modra + + * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Use + targetm.binds_local_p to set SYMBOL_REF_FLAG. + (rs6000_xcoff_encode_section_info): Likewise. + * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + +2002-09-10 Theodore A. Roth + + * gcc/config/avr/avr.h: Set default options for C++ for avr. + +2002-09-13 Roger Sayle + + * stmt.c (struct nexting): Remove unused alt_end_label field. + (expand_start_loop): Delete initialization of alt_end_label. + (expand_start_null_loop): Likewise. + (expand_exit_loop_if_false): Delete updating of alt_end_label. + +2002-09-13 Richard Henderson + + * Makefile.in (toplev.o): Depend on real.h. + (print-rtl.o, varasm.o, ifcvt.o): Likewise. + +2002-09-14 Alan Modra + + * doc/tm.texi (DBX_OUTPUT_NFUN): Describe. + * dbxout.c (dbxout_function_end): Use DBX_OUTPUT_NFUN. + * config/rs6000/linux64.h (DBX_OUTPUT_NFUN): Define. + +2002-09-13 Nathan Sidwell + + * ggc-common.c (ggc_mark_roots): Don't iterate NULL hash tables. + +2002-09-13 Steve Ellcey + + * config.gcc (ia64*-*-aix*, ia64*-*-elf*, ia64*-*-freebsd*, + ia64*-*-linux*): Set extra_parts. + * config/ia64/t-aix (EXTRA_PARTS): Remove. + * config/ia64/t-ia64 (EXTRA_PARTS): Remove. + +2002-09-13 Kazu Hirata + + * config/h8300/fixunssfsi.c: Replace H8/S with H8S. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + * doc/invoke.texi: Likewise. + +2002-09-13 Kazu Hirata + + * config/h8300/h8300.c (h8300_init_once): Fix formatting. + +2002-09-13 Richard Henderson + + * config/alpha/alpha.md (attr type): Add callpal. + (imb, trap, load_tp, set_tp): Use it. + * config/alpha/ev4.md (ev4_callpal): New. + * config/alpha/ev5.md (ev5_callpal): New. + * config/alpha/ev6.md (ev6_ibr): Handle callpal. + * config/alpha/alpha.c (alphaev4_insn_pipe): Handle TYPE_CALLPAL. + (alphaev5_insn_pipe): Likewise. + +2002-09-13 Andreas Jaeger + + * Makefile.in (print-rtl.o): Depend on CONFIG_H. + +2002-09-13 Steve Ellcey + + * config/ia64/t-hpux (LIBGCC1_TEST, STMP_FIXPROTO, + LIB2ADDEH): New, set to NULL. + (SHLIB_EXT, SHLIB_LINK, SHLIB_INSTALL, SHLIB_MKMAP): New. + +2002-09-13 Steve Ellcey + + * config/ia64/quadlib.c (_U_Qfcmp): Make extern. + (_U_Qfcnvfxt_quad_to_sgl): Remove declaration. + (_U_Qfeq, _U_Qfne, _U_Qfgt, _U_Qfge, U_Qflt, U_Qfle, _U_Qfcomp): + Add declarations. + (_U_Qfneg): Remove. + +2002-09-13 Dhananjay Deshpande + + * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Add support + for H8/300, H8S aa:8 mode. + (TINY_CONSTANT_ADDRESS_P): Add support for H8S aa:16 mode. + * config/h8300/h8300.c (h8300_adjust_insn_length): Adjust length + for H8/300 aa:8 mode. + +2002-09-13 Hartmut Penner + + * config/s390/s390.md ("trap", "conditional_trap", "*trap"): New + insns. + +2002-09-12 Richard Henderson + + * Makefile.in (HOST_PRINT): Use print-rtl1.o + (print-rtl.o): Don't define GENERATOR_FILE. + (print-rtl1.o): Rename from $(BUILD_PREFIX_1)print-rtl.o. + * print-rtl.c (print_rtx): Include CONST_DOUBLE fp decimal output + unless GENERATOR_FILE. + +2002-09-12 Stan Shebs + + * config/darwin.h (USER_LABEL_PREFIX): Define here... + * config/i386/darwin.h: ... instead of here. + + * target.h (struct gcc_target): New field + terminate_dw2_eh_frame_info. + * target-def.h (TARGET_TERMINATE_DW2_EH_FRAME_INFO): Define. + (TARGET_INITIALIZER): Add it. + * dwarf2out.c (output_call_frame_info): Use target hook. + * dwarf2asm.c (dw2_asm_output_delta): Use macro + ASM_OUTPUT_DWARF_DELTA if defined. + * doc/tm.texi (TARGET_TERMINATE_DW2_EH_FRAME_INFO): Document. + (ASM_OUTPUT_DWARF_DELTA): Ditto. + (ASM_OUTPUT_DWARF_OFFSET): Ditto. + (ASM_OUTPUT_DWARF_PCREL): Ditto. + * config.gcc (i[34567]86-*-darwin*): Define extra_parts. + (powerpc-*-darwin*): Ditto. + * crtstuff.c [OBJECT_FORMAT_MACHO]: Update the Mach-O bits + to work correctly for Darwin. + * config/darwin.h (OBJECT_FORMAT_MACHO): Define. + (STARTFILE_SPEC): Add crtbegin.o. + (ENDFILE_SPEC): Define. + (EXTRA_SECTION_FUNCTIONS): Put gcc_except_tab in data segment. + (ASM_PREFERRED_EH_DATA_FORMAT): Handle more cases. + (ASM_OUTPUT_DWARF_DELTA): Define. + (TARGET_TERMINATE_DW2_EH_FRAME_INFO): Define. + * config/darwin.c (darwin_asm_output_dwarf_delta): New function. + +2002-09-13 Alan Modra + + * config/rs6000/rs6000.c (rs6000_emit_load_toc_table): Remove "if" + nesting. Correct test for non-PowerPC64 ELF ABI_AIX. + * config/rs6000/rs6000.md (load_toc_v4_PIC*): Disable when ABI_AIX. + +2002-09-12 Zack Weinberg + + * toplev.c: Move default definition of USER_LABEL_PREFIX... + * defaults.h: ... here. + +2002-09-12 Richard Henderson + + * vax.c: Include tree.h earlier. + +2002-09-12 Stan Shebs + + * config/darwin.c (machopic_finish): Remove #if 0 chunks. + (machopic_operand_p): Ditto. + +2002-09-12 Kazu Hirata + + * config/arm/arm.c (arm_compute_initial_elimination_offset): + Fix a comment typo. + +2002-09-12 Kazu Hirata + + * toplev.c (do_abort): Fix a comment typo. + +2002-09-12 Kazu Hirata + + * cselib.c: Fix comment formatting. + * gengtype.c: Likewise. + +2002-09-12 Kazu Hirata + + * config/h8300/h8300.md (udivmodqi4): Do not use an expander. + (udivmodhi4): Likewise. + +2002-09-12 Graham Stott + Roger Sayle + + * i386.c (any_fp_register_operand, fp_register_operand, + register_and_not_any_fp_reg_operand, register_and_not_fp_reg_operand): + New predicate functions. + * i386-protos.h: Add their prototypes. + * i386.h: Add them to PREDICATE_CODES. + * i386.md ("*pushsf_rex64"+2, "*pushsf_rex64"+3, "*pushdf_integer"+1, + "*pushdf_integer"+2, "*pushtf_integer"+1, "*pushtf_integer"+2, + "*pushtf_integer"+3, "*pushtf_integer"+4, "*dummy_extendsfdf2"+1, + "*dummy_extendsfdf2"+2, "*dummy_extendsfxf2"+1, + "*dummy_extendsftf2"+1, "*dummy_extendsftf2"+2, + "*dummy_extenddfxf2"+1, "*dummy_extenddftf2"+1, + "*dummy_extenddftf2"+2, "*negsf2_if"+1, "*negsf2_if"+2, + "*negdf2_if_rex64"+1, "*negdf2_if_rex64"+2, "*negxf2_if"+1, + "*negxf2_if"+2, "*negtf2_if"+1, "*negtf2_if"+2, "*abssf2_if"+1, + "*abssf2_if"+2, "*absdf2_if_rex64"+1, "*absdf2_if_rex64"+2, + "*absxf2_if"+1, "*absxf2_if"+2, "*abstf2_if"+1, "*abstf2_if"+2): + Use these new predicates to simplify and correct the use of + FP_REG_P, ANY_FP_REG_P, FP_REGNO_P and any ANY_FP_REGNO_P. + +2002-09-12 Jason Merrill + + * diagnostic.c (output_add_identifier): New fn. + * diagnostic.h: Declare it. + + * calls.c (store_one_arg): Use size_in_bytes to determine the + amount of space to push. + +2002-09-12 Jakub Jelinek + + * config/sparc/linux64.h (STARTFILE_SPEC32): Fix a typo. + +2002-09-12 Ulrich Weigand + + * config/s390/s390-modes.def (CCAPmode, CCANmode): New CC modes. + * config/s390/s390.c (s390_match_ccmode_set): Support new CC modes. + (s390_select_ccmode): Likewise. + (s390_branch_condition_mask): Likewise. + (optimization_options): Do not set flag_branch_on_count. + (s390_split_branches): Handle doloop branches. + (s390_chunkify_pool): Likewise. + * config/s390/s390.md ("*adddi3_imm_cc", "*addsi3_imm_cc"): New insns. + ("doloop_end"): New expander. + ("doolop_si", "*doloop_si_long", "doloop_di", "*doloop_di_long", + associated splitters): New. + +2002-09-11 Volker Reichelt + + * genattrtab.c (simplify_cond): Remove unused variable(s). + * global.c (record_conflicts): Likewise. + * jump.c (rebuild_jump_labels): Likewise. + * loop.c (scan_loop, check_final_value): Likewise. + * ra-colorize.c (colorize_one_web, assign_colors): Likewise. + * reload1.c (eliminate_regs_in_insn, do_input_reload): Likewise. + * rtlanal.c (reg_set_p): Likewise. + * stmt.c (expand_asm_operands, expand_decl): Likewise. + * genautomata.c (empty_reserv): Remove. + * loop.c (max_luid): Likewise. + * sched-rgn.c (bitlst_table_size): Likewise. + +2002-09-11 Nathan Sidwell + + Reimplement gcov format. + * gcov-io.h: Replace. + * gcov.c: Reimplement. + * gcov-iov.c: New file. + * gcov-dump.c: New file. + * libgcc2.c (L_bb): Replace with ... + (L_gcov): ... this. + (struct bb_function_info, struct bb): Remove. + (inhibit_libc): Never inhibit. + (gcov_list, gcov_crc): New static variables. + (gcov_version_mismatch): New static function. + (__bb_exit_func): Renamed to ... + (__gcov_exit): ... here. Made static. Reimplement. + (__gcov_init_func): Rename to ... + (__gcov_init): ... here. Check version, update crc. + (__bb_fork_func): Rename to ... + (__gcov_flush): ... here. + * libgcc2.h (struct bb, __bb_exit_func, __bb_init_func, + __bb_fork_func, gcov_type, __bb_find_arc_counters): Remove. + * calls.c (expand_call): Call __gcov_flush. + * profile.c (bb_file, last_bb_file_name): Remove. + (bbg_file_name): New global variable. + (output_gcov_string): Remove. + (get_exec_counts): Reimplement. + (branch_prob): Reimplement gcov file writing. + (init_branch_prob): Create bbg_file_name, don't create + bb_file_name. + (end_branch_prob): Adjust. Don't remove counter file when + instrumenting ourselves. + (create_profiler): Adjust. + * doc/gcov.texi (Gcov Data Files): Remove detailed specification, + point to gcov-io.h. + * Makefile.in (LANGUAGES): Add gcov-dump. + (coverageexts): Remove .bb. + (STAGESTUFF): Add gcov-dump. + (LIB2FUNCS_ST): Replace _bb with _gcov. + (profile.o): Depend on gcov-iov.h. + (final.o): Don't depend on profile.h, gcov.h. + (gcov.o): Depend on gcov-iov.h. + (gcov-iov.o): New target. + (gcov-iov): New target. + (gcov-iov.h): New target. + (gcov-dump.o): New target. + (GCOV_DUMP_OBJS): New variable. + (gcov-dump): New target. + (distclean): Remove coverageexts. + (stage1): Remove coverageexts. + +2002-09-11 Hartmut Penner + + * fold-const.c (make_range): Only narrow to signed range if + the signed range is smaller than the unsigned range. + +2002-09-12 Alan Modra + + * emit-rtl.c (set_mem_size): New function. + * expr.h (set_mem_size): Declare. + * config/rs6000/rs6000.c (expand_block_move_mem): Exterminate. + (expand_block_move): Instead, use adjust_address and + replace_equiv_address to generate proper aliasing info. + Move common code out of conditionals. Localize vars. + +2002-09-11 Eric Botcazou + + * optabs.c (expand_binop): Minor cleanup. + (expand_twoval_binop): Convert CONST_INTs like in expand_binop. + +2002-09-11 Dan Nicolaescu + + * print-tree.c (print_node): Print the restrict qualifier. + +2002-09-11 Janis Johnson + + * doc/install.texi: Fix typos. + +2002-09-11 Zack Weinberg + + * Makefile.in: Remove all references to s-under and underscore.c. + * collect2.c, tlink.c: Change all uses of prepends_underscore + to look directly at USER_LABEL_PREFIX. + +2002-09-11 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): Append + alignment to csect. + (rs6000_xcoff_unique_section): Only set section name for public + data. + (rs6000_xcoff_section_type_flags): Store log2 alignment in flags. + * config/rs6000/xcoff.h (TARGET_ASM_SELECT_SECTION): Remove + duplicate definition. + +2002-09-10 John David Anglin + + * pa.md (extzv): Check predicates before emitting extzv_32. + (insv): Likewise. + +2002-09-10 Ulrich Weigand + + * config/s390/s390.h (MOVE_MAX): Define to correct value. + (MAX_MOVE_MAX): Define. + (MOVE_BY_PIECES_P): Define. + (CLEAR_BY_PIECES_P): Define. + +2002-09-10 Denis Chertykov + + * config/avr/avr.md (movstrhi): Use right operands for conversion. + +2002-09-10 Richard Earnshaw + + PR c/7873 + * arm.md (insv): Use reg_or_int_operand for operand[3]. + +2002-09-10 David Edelsohn + + * rs6000.c (rs6000_assemble_visibility): Protect declaration + inside macro. Correct function definition typo. + (rs6000_xcoff_section_type_flags): New function. + (TARGET_SECTION_TYPE_FLAGS): Remove definition. + (rs6000_elf_section_type_flags): Call default_section_type_flags_1 + with appropriate PIC test. + (rs6000_xcoff_select_section): Use decl_readonly_section_1 to + determine readonly. + (rs6000_binds_local_p): Combine PIC flags. + * sysv4.h (TARGET_SECTION_TYPE_FLAGS): Define. + * xcoff.h (TARGET_SECTION_TYPE_FLAGS): Define. + +2002-09-09 Kaveh R. Ghazi + + * h8300.md: Fix signed/unsigned warnings. + * mcore.md: Likewise. + * mn10300.c (mask_ok_for_mem_btst): Likewise. + +2002-09-09 Per Bothner + + * print-tree.c (print_node): In a STRING_CST, escape non-ascii + characters, and only print TREE_STRING_LENGTH chars. + +2002-09-09 Steve Ellcey + + * config/ia64/hpux.h (TARGET_HPUX_LD): New, define true. + (ASM_FILE_END) New. + * config/ia64/ia64.h (TARGET_HPUX_LD): New, define false. + * config/ia64/ia64-protos.h (ia64_hpux_asm_file_end): New. + * config/ia64/ia64.c (ia64_asm_output_external): Create list + of external functions if TARGET_HPUX_LD is true. + (ia64_hpux_add_extern_decl): New, routine to put names on + list of external functions. + (ia64_hpux_asm_file_end): Put out declarations for external + functions if and only if they are used. + +2002-09-09 John David Anglin + + * pa.md (exception_receiver, builtin_setjmp_receiver): Add blockage + on TARGET_64BIT before pic register restore. + +2002-09-09 David Edelsohn + + * doc/tm.texi (TARGET_HAVE_SRODATA_SECTION): New description. + (TARGET_HAVE_TLS): New description. + +2002-09-09 Janis Johnson + + * doc/extend.texi (Statement Exprs): Fix broken link. + +2002-09-09 Denis Chertykov + + * config/avr/avr.md (movstrhi, clrstrhi): Use gen_int_mode for + right conversion of operands[1]. + +2002-09-09 Ulrich Weigand + + * config/s390/s390.md ("*tmdi_reg", "*tmsi_reg"): Do not mark as + commutative. Use "nonimmediate_operand" instead of "register_operand" + as predicate for operand 0. Move to after the "*tmXX_mem" insns. + + ("*tmdi_mem", "*tmsi_mem", "*tmhi_mem", "*tmqi_mem"): Do not mark + as commutative. + + ("*anddi3_ni", "*andsi3_ni", "*iordi3_ni", "*iorsi3_ni"): Do not + mark as commutative. Use "nonimmediate_operand" instead of + "register_operand" as predicate for operand 1. + + ("movstrictsi"): Fix typo in insn name. + +2002-09-09 Jan Hubicka + + * i386.c (index_register_operand): New. + * i386.h (predicate_codes): Add new predicate. + * i386.md (lea_general_*): Use index_register_operand + (ashift to lea splitter): Do not produce invalid leas + (ashift to mov+ashift split): New. + +2002-09-09 Nick Clifton + + * config/fr30/fr30.c (output.h): Move after inclusion of tree.h. + Fix folding marks. + +2002-09-09 Toshiyasu Morita + J"orn Rennecke + + * sh/sh.h (OVERRIDE_OPTIONS): align_functions is in bytes, not bits. + +2002-09-09 Alan Modra + + * config/rs6000/rs6000.c (rs6000_binds_local_p): Return bool. + (function_ok_for_sibcall): Use binds_local_p. Respect longcall + attributes. + +2002-09-08 Nathan Sidwell + + * basic_block.h (gcov_type): Explain why it is signed. + * final.c: Don't include profile.h. + (struct function_list, functions_head, functions_tail, + end_final): Moved to profile.c + (final): Move arc chaining code to profile.c. + * function.c (prepare_function_start): Remove duplicate line. + * output.h (end_final): Remove prototype. + * predict.c (estimate_loops_at_level): Use gcov_type. + * profile.c (struct function_list, functions_head, + functions_tail): Moved from final.c + (need_func_profiler): Remove. + (instrument_edges): Don't set need_func_profiler. + (get_exec_counts): Avoid signed/unsigned warning. + (compute_checksum): Use crc32. + (branch_prob): Adjust. Chain onto functions_head. + (init_branch_prob): Absorb init_edge_profiler. + (init_edge_profiler): Remove. + (create_profiler): Moved and renamed from final.c:end_final. + Emit data and constructor. + (output_func_start_profiler): Remove. + * profile.h (struct profile_info): checksum is unsigned. + * rtl.h (output_func_start_profiler): Remove prototype. + (create_profiler): Declare. + * toplev.c (compile_file): Call create_profiler, if instrumenting + arcs. Don't call end_final. + +2002-09-08 Kaveh R. Ghazi + + * fr30.c (fr30_print_operand): Fix bug in output of CONST_DOUBLE. + +2002-09-08 Richard Henderson + + * dwarf2.h (DW_OP_call_ref): Rename from DW_OP_calli. + (DW_OP_GNU_push_tls_address): New. + (DW_OP_lo_user): Fix. + * dwarf2out.c (INTERNAL_DW_OP_tls_addr): New. + (dwarf_stack_op_name): Handle it, plus other dwarf3 opcodes. + (size_of_loc_descr): Likewise. + (output_loc_operands): Handle INTERNAL_DW_OP_tls_addr. + (add_AT_location_description): Take a dw_loc_descr_ref not an rtx. + (loc_descriptor_from_tree): Handle TLS variables. + (rtl_for_decl_location): Do avoid_constant_pool_reference here ... + (add_location_or_const_value_attribute): ... not here. Defer + to loc_descriptor_from_tree for TLS variables. + + * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): New. + * config/i386/i386.c (i386_output_dwarf_dtprel): New. + * config/i386/i386-protos.h: Update. + +2002-09-08 Roger Sayle + + PR optimization/6405 + * unroll.c (loop_iterations): last_loop_insn should be the previous + non-note instruction before loop->end. + * loop.c (strength_reduce): The conditional jump is the last + non-note instruction before loop->end (as above). + +2002-09-08 Roger Sayle + + * combine.c (try_combine): Handle the case that undobuf.other_insn + has been turned into a return or unconditional jump, by inserting + a BARRIER if necessary. + (simplify_set): Test if a condition code setter has a constant + comparison at compile time, if so convert this insn to a no-op move + and update/simplify the condition code user (undobuf.other_insn). + +2002-09-08 Krister Walfridsson + + * config/arm/netbsd.h (INITIALIZE_TRAMPOLINE): Redefine. + (CLEAR_INSN_CACHE): Define. + +2002-09-08 Kazu Hirata + + * basic-block.h: Fix comment formatting. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-lex.c: Likewise. + * c-pretty-print.c: Likewise. + * cfglayout.c: Likewise. + * cfgloop.c: Likewise. + * defaults.h: Likewise. + * et-forest.c: Likewise. + * explow.c: Likewise. + * function.h: Likewise. + * gcov.c: Likewise. + * genattrtab.c: Likewise. + * gengtype.c: Likewise. + * ifcvt.c: Likewise. + * libgcc2.c: Likewise. + * loop.c: Likewise. + * profile.c: Likewise. + * ra-build.c: Likewise. + * real.c: Likewise. + * rtl.h: Likewise. + * tracer.c: Likewise. + * tree-inline.c: Likewise. + * varasm.c: Likewise. + +2002-09-08 Jan Hubicka + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Fix array_ref + handling. + + * loop.c (loop_givs_reduce): Emit addition after. + +2002-09-08 Alan Modra + + * varasm.c (default_assemble_visibility): Rename from + assemble_visibility. + * output.h: Here too. + * target-def.h (TARGET_ASM_ASSEMBLE_VISIBILITY): And here. + * config/rs6000/rs6000.c (rs6000_assemble_visibility): And here. + +2002-09-08 Alan Modra + + * reload.c (find_reloads

): Pass operand_mode to + find_reloads_address. + +2002-09-08 Kazu Hirata + + * config/h8300/h8300.md (udivmodqi4): Enable on H8/300. + (anonymous pattern): Likewise. + +2002-09-07 Igor Shevlyakov + + * machmode.def: Add modes for half-float vectors. + +2002-09-07 Scott Snyder + + PR target/7374 + * config/alpha/alpha.md (abstf2): Fix typo: 'neg' for 'abs'. + +2002-09-07 Roger Sayle + + * basic-block.h (struct loop): Remove unused cont_dominator field. + +2002-09-07 Igor Shevlyakov + + * varasm.c (decode_rtx_const): Don't check undefined field for + CONST_VECTOR. + +2002-09-07 Glen Nakamura + + PR opt/7814 + * sched-deps.c (sched_analyze_insn): Make sure to add insn + to reg_last->sets after flushing the dependency lists to guarantee + that subsequent clobbers will be dependent on it. + +2002-09-07 Igor Shevlyakov + + * combine.c (simplify_shift_const): Calculate rotate count + correctly for vector operands. + +2002-09-07 Ansgar Esztermann + + * c-typeck.c (c_tree_expr_nonnegative_p): New function. + (build_binary_op): Call c_tree_expr_nonnegative_p rather than + tree_expr_nonnegative_p. + (build_conditional_expr): Likewise. + * c-tree.h (c_tree_expr_nonnegative_p): Declare. + +2002-09-07 Richard Henderson + + * builtins.def (inf, inff, infl): Mark const. + (huge_val, huge_valf, huge_vall): Likewise. + (BUILT_IN_GETEXP, BUILT_IN_GETMAN): Remove. + + * real.c (ereal_inf): Clear E before use. + +2002-09-07 Kazu Hirata + + * config/h8300/h8300.md (udivmodqi4): Split the pattern into + an expander and an anonymous pattern. Zero out the upper half + of the dividend in the expander. + (udivmodqi4): Likewise. + +2002-09-07 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + +2002-09-07 Zdenek Dvorak + + * cfgcleanup.c (try_crossjump_to_edge): Fix updating of liveness + information. + +2002-09-07 Graham Stott + + * rtlanal.c (dead_or_set_regno_p): Fix typo. + +2002-09-07 Alan Modra + + * config/rs6000/linux64.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. + + * doc/tm.texi (TARGET_ASM_ASSEMBLE_VISIBILITY): Describe. + * target-def.h (TARGET_ASM_ASSEMBLE_VISIBILITY): Define. + (TARGET_ASM_OUT): Add the above here. + * target.h (struct gcc_target): Add "visibility" field. + * varasm.c (maybe_assemble_visibility): Call targetm visibility func. + * config/rs6000/rs6000.c (rs6000_assemble_visibility): New function. + (TARGET_ASM_ASSEMBLE_VISIBILITY): Define. + (rs6000_legitimize_reload_address, first_reg_to_save): Formatting. + +2002-09-06 Ziemowit Laski + + * c-lang.c (objc_is_id): New stub. + * c-tree.h (objc_is_id): New forward declaration. + * c-typeck.c (build_c_cast): Do not strip protocol + qualifiers from 'id' type. + * objc/objc-act.c (objc_comptypes): Correct handling + of protocol qualifiers. + (objc_is_id): New. + +Fri Sep 6 13:10:08 2002 Jeffrey A Law (law@redhat.com) + + * pentium.md (pentium-firstvboth): Fix typo. + +2002-09-06 Dhananjay Deshpande + + * h8300.c (enum shift_alg): Move to earlier in h8300.c. + (enum shift_type, enum h8_cpu): Likewise. + (INL, ROT, LOP, SPC macros): Likewise. + (shift_alg_qi, shift_alg_hi, shift_alg_si): Likewise. Lose + const designator. + (h8300_init_once): Update shift_alg_{qi,hi,si} to use more + space efficient algorithms when optimize for codesize. + +Fri Sep 6 16:35:32 2002 Nicola Pero + + Fix PR/1727 and long-standing failing testcase + objc/formal-protocol-6.m. + * objc-act.c (build_protocol_expr): If compiling for the GNU + runtime, create a list of Protocol statically allocated instances + if it doesn't exist, then add the Protocol object to this same + list. + (get_objc_string_decl): Fixed typo/bug - TREE_VALUE had been used + instead of TREE_CHAIN. + +Fri Sep 6 16:17:33 2002 Nicola Pero + + * objc/objc-act.c (dump_interface): Enlarged the char * buffer to + 10k. Fixed category dumping - print out category names with the + proper syntax. Print '@end\n' and not '\n@end' at the end of the + interface. + (finish_objc): Fixed the -gen-decls option. It was printing out + only the last class. Dump an interface declaration of all classes + being compiled instead. + +2002-09-06 Jason Thorpe + + * config/arm/arm-protos.h (arm_gen_return_addr_mask): New + prototype. + * config/arm/arm.c (arm_gen_return_addr_mask): New function. + * config/arm/arm.h (MASK_RETURN_ADDR): Use arm_gen_return_addr_mask + if not APCS26 and not Thumb or ARMv4-or-higher. Use gen_int_mode + rather than GEN_INT. + * config/arm/arm.md (UNSPEC_CHECK_ARCH): Define. + (return_addr_mask, *check_arch2): New. + +2002-09-06 Ulrich Weigand + + * config/s390/s390.md ("*adddi3_cc", "*adddi3_cconly", + "*adddi3_cconly2", "*adddi3_64", "*adddi3_31", "adddi3", + "*addsi3_carry1_cc", "*addsi3_carry1_cconly", + "*addsi3_carry2_cc", "*addsi3_carry2_cconly", + "*addsi3_cc", "*addsi3_cconly", "*addsi3_cconly2", "addsi3", + "adddf3", "*adddf3", "*adddf3_ibm", + "addsf3", "*addsf3", "*addsf3_ibm", + "muldi3", "mulsi3", "mulsidi3", + "muldf3", "*muldf3", "*muldf3_ibm", + "mulsf3", "*mulsf3", "*mulsf3_ibm", + "*anddi3_cc", "*anddi3_cconly", "anddi3", + "*andsi3_cc", "*andsi3_cconly", "andsi3", + "*iordi3_cc", "*iordi3_cconly", "iordi3", + "*iorsi3_cc", "*iorsi3_cconly", "iorsi3", + "*xordi3_cc", "*xordi3_cconly", "xordi3", + "*xorsi3_cc", "*xorsi3_cconly", "xorsi3"): Use "nonimmediate_operand" + instead of "register_operand" as predicate for "%0" operand. + +2002-09-06 Jakub Jelinek + + * configure.in (HAVE_AS_OFFSETABLE_LO10): Use -xarch=v9 + unconditionally when gcc_cv_as_flags64 checks are gone. + * configure: Rebuilt. + +2002-09-06 Alan Modra + + * config/rs6000/rs6000.md (extzvsi_internal2): Revert most of + 2002-07-26 change. Comment. + +2002-09-05 Kaveh R. Ghazi + + * frv.c (frv_unique_section, frv_select_section, + frv_select_rtx_section): Delete. + (frv_in_small_data_p): New. + (TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_SECTION, + TARGET_ASM_SELECT_RTX_SECTION): Delete. + (TARGET_IN_SMALL_DATA_P): Define. + +2002-09-05 Dale Johannesen + + * reload1.c (reload): Retain only those memory clobbers + added for variable-array handling. + +2002-09-05 Jason Thorpe + + * config/arm/arm.c (arm_return_in_memory): Implement ATPCS + return-in-memory rules. + * config/arm/arm.h (ARM_FLAG_ATPCS, TARGET_ATPCS): Define. + +2002-09-05 David Edelsohn + + * config/rs6000/xcoff.h (HOT_TEXT_SECTION_NAME): Delete. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Delete. + +2002-09-05 Jason Thorpe + + * real.c: Avoid parse error if FLOAT_WORDS_BIG_ENDIAN is + not a compile-time constant for the non-IBM case. + * config/arm/arm-protos.h (arm_float_words_big_endian): New + prototype. + * config/arm/arm.c (arm_float_words_big_endian): New function. + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __VFP_FP__ + if TARGET_VFP and not TARGET_HARD_FLOAT. + (ARM_FLAG_VFP, TARGET_VFP): Define. + (FLOAT_WORDS_BIG_ENDIAN): Use arm_float_words_big_endian. + +2002-09-05 David Edelsohn + + * doc/install.texi: Correct text of s390-*-linux* and s390x-*-linux* + URLs. Fix AIX wording. + +2002-09-05 Stan Shebs + + * config/rs6000/rs6000.c (rs6000_override_options): Make -fpic and + -fPIC equivalent on Darwin. + +Thu Sep 5 16:27:47 2002 J"orn Rennecke + + * sh.c (sh_expand_builtin): Return early if encountering an + error_mark for a type. + +2002-09-05 Ulrich Weigand + + * config/s390/s390.c (s390_expand_plus_operand): Do not require + double-word scratch register. + config/s390/s390.md ("reload_indi", "reload_insi"): Adapt. + + ("*tmqi_ext", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem", "*tmqi_mem", + "*cli"): Replace s_operand by memory_operand. + ("cmpstrdi", "cmpstrsi"): Replace s_operand by general_operand. + +2002-09-05 Kazu Hirata + + * config/h8300/h8300.c (asm_file_start): Add a missing + semicolon. + +2002-09-04 Volker Reichelt + + * c-typeck.c (build_function_call): Remove unused variable(s). + (build_c_cast): Likewise. + * calls.c (rtx_for_function_call): Likewise. + * cfglayout.c (duplicate_insn_chain): Likewise. + * cfgloop.c (flow_loop_nodes_find): Likewise. + * cfgrtl.c (split_edge): Likewise. + * df.c (df_ref_create): Likewise. + * except.c (expand_end_catch): Likewise. + * expr.c (emit_push_insn, store_constructor, expand_expr): Likewise. + * function.c (emit_return_into_block): Likewise. + (reposition_prologue_and_epilogue_notes): Likewise. + * gengtype.c (get_file_basename, write_gc_structure_fields): Likewise. + * combine.c (subst_prev_insn, need_refresh): Remove. + * dwarf2out.c (primary_filename): Remove. + * final.c (new_block): Remove. + * gcse.c (orig_bb_count): Remove. + +2002-09-04 Kaveh R. Ghazi + + * dsp16xx-protos.h (dsp16xx_compare_gen): Change to bool. + * dsp16xx.c (dsp16xx_compare_gen): Likewise. + * dsp16xx.md: Treat dsp16xx_compare_gen as a bool. Call functions + directly instead of using a function pointer. + +2002-09-04 Krister Walfridsson + + * config/i386/i386.h (GOT_SYMBOL_NAME): Define. + * config/i386/i386.c (output_set_got): Use GOT_SYMBOL_NAME. + (ix86_output_addr_diff_elt) Likewise. + (x86_output_mi_thunk) Likewise. + * config/i386/netbsd.h (GOT_SYMBOL_NAME): Redefine. + +2002-09-04 Kaveh R. Ghazi + + * frv.c (frv_encode_section_info): Fix error in last change. + +2002-09-04 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_flag_pic): New variable. + (rs6000_elf_encode_section_info): ATTRIBUTE_UNUSED. + (TARGET_BINDS_LOCAL_P): Define. + (rs6000_override_options): Save original flag_pic value. + (rs6000_elf_select_section): Call default_elf_select_section_1. + (rs6000_elf_unique_section): Call default_unique_section_1. + (rs6000_elf_in_small_data_p): New function. + (rs6000_xcoff_asm_named_section): Determine storage mapping class. + (rs6000_xcoff_select_section): Update based on defaults. + (rs6000_xcoff_unique_section): Set to basic name if not common. + (rs6000_binds_local_p): New function. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Set + targetm.have_srodata_section if SDATA_EABI. + (TARGET_IN_SMALL_DATA_P): Define. + +2002-09-04 Dale Johannesen + + * varasm.c (struct rtx_const, decode_rtx_const): + Make veclo and vechi fields not share storage. + +Thu Sep 5 00:34:33 2002 J"orn Rennecke + + * loop.c (scan_loop): Don't mark separate insns out of a libcall + for moving. + (move_movables): Abort if we see the first insn of a libcall. + +2002-09-04 Richard Henderson + + * builtin-types.def (BT_FN_FLOAT): New. + (BT_FN_DOUBLE, BT_FN_LONG_DOUBLE): New. + * builtins.def (BUILT_IN_INF, BUILT_IN_INFF, BUILT_IN_INFL, + BUILT_IN_HUGE_VAL, BUILT_IN_HUGE_VALF, BUILT_IN_HUGE_VALL): New. + * builtins.c (fold_builtin_inf): New. + (fold_builtin): Call it. + * real.c (ereal_inf): New. + * real.h: Declare it. + * doc/extend.texi: Document new builtins. + +2002-09-04 Richard Henderson + + * cse.c (cse_insn): Avoid subreg games if the equivalence + is already in the proper mode. + +2002-09-04 Eric Botcazou + + PR c/7102 + * optabs.c (expand_binop): Convert CONST_INTs in all cases. + +2002-09-04 John David Anglin + + * pa.md (setccfp0, setccfp1): New patterns. + +2002-09-04 Kaveh R. Ghazi + + * frv-protos.h (frv_init_builtins, frv_expand_builtin, + frv_select_section, frv_select_rtx_section, + frv_encode_section_info, frv_unique_section): Delete. + * frv.c: Update for target hooks. + * frv.h (STRIP_NAME_ENCODING, SLOW_ZERO_EXTEND, SELECT_SECTION, + SELECT_RTX_SECTION, ENCODE_SECTION_INFO, UNIQUE_SECTION, + EASY_DIV_EXPR, MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): Delete. + +2002-09-04 Kaveh R. Ghazi + + * ip2k-protos.h (function_prologue, function_epilogue, + encode_section_info): Update to match target hook specification. + * ip2k.c: Wrap `MDR' code in IP2K_MD_REORG_PASS. + (function_prologue, function_epilogue, encode_section_info): + Update to match target hook specification. + * ip2k.h (SELECT_SECTION, SELECT_RTX_SECTION, ASM_OPEN_PAREN, + ASM_CLOSE_PAREN, EASY_DIV_EXPR): Delete. + (NOTICE_UPDATE_CC): Cast to void. + * ip2k.md: Add defaults in switch statements. + +2002-09-04 Janis Johnson + + * doc/trouble.texi (Interoperation): Update information about C++ ABI + issues. + +2002-09-04 Jason Thorpe + + * config/sparc/t-netbsd64: Disable multilib for now. + +2002-09-04 David Edelsohn + + * target-def.h (TARGET_HAVE_SRODATA_SECTION): New macro. + * target.h (gcc_target): Add have_srodata_section member. + * varasm.c (section_category): Add SECCAT_SRODATA. + (categorize_decl_for_section): Return SECCAT_SRODATA for sdata if + READONLY_SDATA_SECTION defined. + (decl_readonly_section_1): True for SECCAT_SRODATA also. + (default_elf_select_section_1): Map SECCAT_SRODATA to .sdata2. + (default_unique_section_1): Likewise. + +2002-09-04 John David Anglin + + * expr.c (emit_group_load): Revise to allow splitting TCmode source + into DImode pieces. + + * pa-64.h (LONG_DOUBLE_TYPE_SIZE): Define to 128. + * pa64-regs.h (CLASS_CANNOT_CHANGE_MODE_P): Inhibit changes from SImode + for floating-point register class. + * pa.c (function_arg): Fix handling of modes wider than one word for + TARGET_64BIT. + +Wed Sep 4 18:48:10 2002 J"orn Rennecke + + * combine.c (make_compound_operation): Don't generate zero / sign + extensions in floating point modes. + +2002-09-04 Janis Johnson + + * doc/c-tree.texi: Fix overfull hboxes. + * doc/cppopts.texi: Ditto. + * doc/extend.texi: Ditto. + * doc/gty.texi: Ditto. + * doc/invoke.texi: Ditto. + * doc/makefile.texi: Ditto. + * doc/rtl.texi: Ditto. + * doc/standards.texi: Ditto. + * doc/tm.texi: Ditto. + +2002-09-04 Richard Henderson + + * c-common.c (builtin_define_with_hex_fp_value): New. + (builtin_define_float_constants): Use it. Fix H_FLOAT mant_dig. + +2002-09-04 Janis Johnson + + * doc/invoke.texi (-fshort-wchar): Move to Code Generation Options. + (-fpcc-struct-return, -freg-struct-return, -fshort-enums, + -fshort-double, -fshort-wchar, -fpack-struct, -fleading-underscore): + Warn that these options can break ABI compatibility. + +2002-09-04 Richard Henderson + + * real.c (ereal_to_decimal): Add digits parameter. + * real.h (REAL_VALUE_TO_DECIMAL): Remove format; add digits parameter. + * c-pretty-print.c (pp_c_real_literal): Update call. + * print-rtl.c (print_rtx): Likewise. + * print-tree.c (print_node_brief, print_node): Likewise. + * sched-vis.c (print_value): Likewise. + * config/arc/arc.c (arc_print_operand): Likewise. + * config/c4x/c4x.c (c4x_print_operand): Likewise. + * config/i370/i370.h (PRINT_OPERAND): Likewise. + * config/i386/i386.c (print_operand): Likewise. + * config/i960/i960.c (i960_print_operand): Likewise. + * config/ip2k/ip2k.c (asm_output_float): Likewise. + * config/m32r/m32r.c (m32r_print_operand): Likewise. + * config/m68hc11/m68hc11.c (print_operand): Likewise. + * config/m68k/hp320.h (PRINT_OPERAND, ASM_OUTPUT_FLOAT_OPERAND, + ASM_OUTPUT_DOUBLE_OPERAND, ASM_OUTPUT_LONG_DOUBLE_OPERAND): Likewise. + * config/m68k/m68k.h (ASM_OUTPUT_FLOAT_OPERAND, + ASM_OUTPUT_DOUBLE_OPERAND, ASM_OUTPUT_LONG_DOUBLE_OPERAND): Likewise. + * config/m68k/sun2o4.h (ASM_OUTPUT_FLOAT_OPERAND, + ASM_OUTPUT_DOUBLE_OPERAND): Likewise. + * config/m68k/sun3.h (ASM_OUTPUT_FLOAT_OPERAND, + ASM_OUTPUT_DOUBLE_OPERAND): Likewise. + * config/mips/mips.c (print_operand): Likewise. + * config/ns32k/ns32k.c (print_operand): Likewise. + * config/pdp11/pdp11.h (PRINT_OPERAND): Likewise. + * config/vax/vax.h (PRINT_OPERAND): Likewise. + * doc/tm.texi (REAL_VALUE_TO_DECIMAL): Update docs. + +2002-09-04 Bob Wilson + + * config/xtensa/elf.h (TARGET_SECTION_TYPE_FLAGS): Define to + xtensa_multibss_section_type_flags. + * config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Define. + +2002-09-04 Richard Henderson + + * doc/install-old.texi: Don't mention enquire. + * doc/sourcebuild.texi: Update float.h description. + +Wed Sep 4 11:22:14 2002 J"orn Rennecke + + * sh.md (mperm_w_little, mperm_w_big): Supply mode for zero_extract. + +2002-09-03 Roger Sayle + + * builtins.c (build_function_call_expr): Remove prototype, export + as non-static and add a comment above function definition. + (builtin_mathfn_code): New function to check for math builtins. + (fold_builtin): Optimize sqrt(0.0) as 0.0, sqrt(1.0) as 1.0, + exp(0.0) as 1.0, and log(1.0) as 0.0. Optimize exp(log(x)) and + log(exp(x)) as x. Optimize sqrt(exp(x)) as exp(x/2.0) and + log(sqrt(x)) as log(x)/2.0. + + * tree.h: Prototype build_function_call_expr and builtin_mathfn_code + in new "builtins.c" section. Place the build_range_type prototype + with the other prototypes from "tree.c". + + * fold-const.c (fold) [ABS_EXPR]: Fold fabs(sqrt(x)) as sqrt(x) + and fabs(exp(x)) as exp(x). [MULT_EXPR]: Fold sqrt(x)*sqrt(y) + as sqrt(x*y) and exp(x)*exp(y) as exp(x+y). [RDIV_EXPR]: Fold + x/exp(y) as x*exp(-y). + +2002-09-03 David Edelsohn + + * varasm.c (default_section_type_flags): Append _1 to name with + shlib parameter. Use original name to call new function with + implicit flag_pic. + (decl_readonly_section): Likewise. + (default_elf_select_section): Likewise. + (default_unique_section): Likewise. + (default_bind_local_p): Likewise. + (categorize_decl_for_section): Add shlib parameter to use in place + of implicit flag_pic. + * output.h: Declare new functions with _1 and shlib argument. + +2002-09-03 Janis Johnson + + * doc/install.texi: Fix typos, formatting problems, and obvious + overfull/underfull boxes. + + * Makefile.in (TEXI_GCC_FILES): Add compat.texi. + * doc/gcc.texi (Top): Add new chapter, Binary Compatibility, and + include its file, compat.texi. + * doc/compat.texi: New file with new chapter, Binary Compatibility. + +2002-09-03 Neil Booth + + Debian BTS Bug #157416 + * cpphash.h (FIRST, LAST, CUR, RLIMIT): Fix definitions. + * cpplib.c (destringize_and_run): Kludge around getting + tokens from in-progress macros. + (_cpp_do__Pragma): Simplify. + +2002-09-03 Steve Ellcey + + * config/ia64/ia64.h (EXTRA_SPECS): Remove cpp_cpu. + (CPP_CPU_SPEC): Remove. + (TARGET_CPU_CPP_BUILTINS): New. + * config/ia64/hpux.h (CPP_PREDEFINES): Remove. + (CPP_SPEC): Remove. + (TARGET_OS_CPP_BUILTINS): New. + * config/ia64/linux.h (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): New. + * config/ia64/aix.h (CPP_SPEC): Move some stuff to + TARGET_OS_CPP_BUILTINS. + (CPP_PREDEFINES): Remove. + (CPLUSPLUS_CPP_SPEC): Remove. + (TARGET_OS_CPP_BUILTINS): New. + +2002-09-03 Richard Henderson + + * Makefile.in (USER_H): Add ginclude/float.h. + (FLOAT_H): Remove. + (stmp-int-hdrs, install-mkheaders): Don't handle FLOAT_H. + (mostlyclean): Don't remove float.h intermediate files. + (distclean): Don't remove float.h. + * config.gcc: Remove all float_format references. + * configure.in (float_format, float_h_file): Remove. + + * c-common.c: Include tree-inline.h. + (builtin_define_with_int_value): New. + (builtin_define_type_precision): Use it. + (builtin_define_float_constants): New. + (cb_register_builtins): Use it. Define __FLT_RADIX__ and + __FLT_EVAL_METHOD__. + * defaults.h (TARGET_FLT_EVAL_METHOD): New. + * config/i386/i386.h (TARGET_FLT_EVAL_METHOD): New. + * config/m68k/m68k.h (TARGET_FLT_EVAL_METHOD): New. + * doc/tm.texi (INTEL_EXTENDED_IEEE_FORMAT): Mention moto 96-bit format. + (TARGET_FLT_EVAL_METHOD): New. + + * config/float-c4x.h, config/float-i128.h, config/float-i32.h, + config/float-i386.h, config/float-i64.h, config/float-m68k.h, + config/float-sh.h, config/float-sparc.h, config/float-vax.h: Remove. + * ginclude/float.h: New. + +2002-09-03 Stan Shebs + + * config/darwin.h (WARN_FOUR_CHAR_CONSTANTS): Remove, never used. + (DWARF2_DEBUGGING_INFO): Remove until assembler accepts Dwarf-2. + (PREFERRED_DEBUGGING_TYPE): Ditto. + (ASM_OUTPUT_IDENT): Remove empty definition. + +2002-09-03 Steve Ellcey + + * config.gcc (ia64*-*-hpux*): Add ia64-c.o to c_target and + cxx_target. + * config/ia64/hpux.h (REGISTER_TARGET_PRAGMAS): Register pragma + handling routine for builtin pragma. + * config/ia64/ia64-protos.h (ia64_hpux_handle_builtin_pragma): + Registered pragma handling routine. + * ia64-c.c (ia64_hpux_handle_builtin_pragma): Ditto. + (ia64_hpux_add_pragma_builtin) New subroutine used by above. + If builtin pragma seen for math routine and C89 conformance is + requested use different math function in order to set errno. + * t-ia64 (ia64-c.o): Add new rule for new file. + +2002-09-03 Ulrich Weigand + + * config/s390/s390.md ("movti"): Add Q->Q alternative. + ("*movdi_64", "*movdi_31", "*movsi", "movhi", "movqi_64", + "movqi", "*movdf_64", "*movdf_31", "*movsf"): Likewise. + + ("*movti_ss", "*movdi_ss", "*movsi_ss", "*movdf_ss", + "*movsf_ss"): Remove. + +2002-09-03 John David Anglin + + * pa32-regs.h (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): + Delete macros. + +2002-09-03 Arati Dikey + + * h8300.c (asm_file_start): Corrected optimization comment. + +2002-09-03 Stan Shebs + + * c-lang.c (recognize_objc_keyword): Remove, no longer used. + * c-tree.h (recognize_objc_keyword): Remove decl. + * c-typeck.c (comp_target_types): Update a comment. + +2002-09-03 Ulrich Weigand + + * config/s390/s390.c (s390_decompose_address): Remove STRICT parameter + and register validity checks. + (general_s_operand): Adapt to s390_decompose_address interface change. + (q_constraint): Likewise. + (s390_expand_plus_operand): Likewise. + (legitimiate_address_p): Likewise. + (legitimate_la_operand_p): Likewise. + (legitimize_la_operand): Likewise. + (print_operand_address): Likewise. + (print_operand): Likewise. + +Tue Sep 3 11:32:14 2002 Nicola Pero + + PR objc/5956: + * objc/objc-act.c (build_typed_selector_reference): Fix typo which + was causing the new selector never to match the existing ones + (Patch by Alexander Malmberg ). + +2002-09-03 Graham Stott + + * config/i386/i386.md ("femms"): Add "memory" attr "none". + +2002-09-03 Graham Stott + + * expr.c (expand_expr): Remove extraneous comment and code. + +2002-09-02 Nathan Sidwell + + * stor-layout (finish_builtin_struct): Renamed and moved from c++ + frontend. Take chain of fields. Allow NULL alignment type. + * tree.h (finish_builtin_struct): Declare. + +2002-09-01 Kaveh R. Ghazi + + * config/alpha/alpha.c config/alpha/alpha.h config/alpha/alpha.md + config/alpha/elf.h config/alpha/unicosmk.h config/alpha/vms.h + config/arc/arc.c config/arc/arc.h config/arm/aout.h + config/arm/arm.c config/arm/arm.h config/arm/arm.md + config/avr/avr.h config/d30v/d30v.h config/dbxcoff.h + config/dbxelf.h config/elfos.h config/fr30/fr30.h config/frv/frv.h + config/i386/i386.c config/i386/i386.md config/i386/sco5.h + config/ia64/ia64.h config/ip2k/ip2k.h config/m68hc11/m68hc11.md + config/m68k/hp320.h config/m68k/m68k.c config/m68k/m68k.md + config/m68k/mot3300.h config/m68k/sgs.h config/m68k/tower-as.h + config/m88k/m88k.c config/m88k/m88k.h config/mcore/mcore-pe.h + config/mcore/mcore.c config/mips/mips.c config/mips/mips.h + config/ns32k/ns32k.md config/pa/pa-linux.h config/pa/pa.c + config/pa/pa.h config/pa/pa.md config/romp/romp.h + config/rs6000/linux64.h config/rs6000/lynx.h + config/rs6000/rs6000.c config/rs6000/sysv4.h config/rs6000/xcoff.h + config/s390/s390.c config/s390/s390.md config/sh/sh.c + config/sparc/sparc.c config/sparc/sysv4.h + config/stormy16/stormy16.h dbxout.c defaults.h dwarf2out.c + dwarfout.c except.c final.c varasm.c vmsdbgout.c: Replace + ASM_OUTPUT_INTERNAL_LABEL macro with a call to the target hook. + + * doc/tm.texi: Update docs. + * default.h (ASM_OUTPUT_INTERNAL_LABEL): Don't define. + * system.h (ASM_OUTPUT_INTERNAL_LABEL): Poison. + +2002-08-31 Kaveh R. Ghazi + + * Makefile.in (sdbout.o, insn-output.o): Depend on $(TARGET_H). + * arc.c (arc_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Set. + * arc.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * arm.c (arm_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Set. + * arm.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * arm/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * i370.c (i370_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Set. + * i370.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * m68k/hp320.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * m68k.c (m68k_hp320_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Set. + * m88k.c (m88k_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Set. + * m88k.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): Set to target hook. + * genoutput.c (output_prologue): Include target.h in output file. + * output.h (default_internal_label): Declare. + * sdbout.c: Include target.h. + * target-def.h (TARGET_ASM_INTERNAL_LABEL): Set and add to + TARGET_ASM_OUT. + * target.h (internal_label): Add to struct gcc_target. + * varasm.c (default_internal_label): New function. + +2002-08-31 Kaveh R. Ghazi + + * alpha.h (ASM_OUTPUT_INTERNAL_LABEL): Delete. + * avr.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * c4x.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * cris.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * d30v.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * darwin.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * dsp16xx.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * elfos.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * h8300.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/att.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/bsd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/i386-coff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/lynx-ng.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/lynx.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i386/sco5.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * i960/i960.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/3b1.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/amix.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/atari.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/mot3300.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/tower-as.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m88k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * mcore.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * mips.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * mmix-protos.h (mmix_asm_output_internal_label): Likewise. + * mmix.c (mmix_asm_output_internal_label): Likewise. + * mmix.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * ns32k.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * pa.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * pdp11.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * romp.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * rs6000/xcoff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sh/coff.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sh/elf.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/freebsd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/linux.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/linux64.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/netbsd-elf.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/pbd.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/sol2.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * sparc/vxsim.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * stormy16.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * svr3.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * vax.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + + * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): Define. + +2002-08-31 Richard Henderson + + * expr.c (block_move_libcall_safe_for_call_parm): Fix thinko. + +2002-08-31 John David Anglin + + * pa.c (pa_globalize_label): Add ATTRIBUTE_UNUSED to prototype. + +2002-08-30 Richard Henderson + + PR opt/7515 + * c-objc-common.c: Include target.h. + (c_cannot_inline_tree_fn): Don't auto-inline functions that + don't bind locally. Factor setting DECL_UNINLINABLE. + * Makefile.in (c-objc-common.o): Update. + +2002-08-30 Janis Johnson + + * doc/install.texi (Configuration, Building): Fix a typo and + some formatting directives. + +2002-08-30 Paul Koning + + * doc/c-tree.texi (RDIV_EXPR): Fix typo. + * doc/rtl.texi (post_modify): Remove misplaced text, remove "not + implemented" note. + * doc/md.texi (IP2K): Move machine-specific constraints before MIPS + for alphabetic order. + * doc/tm.texi (TARGET_FLOAT_FORMAT): Update description for + VAX_FLOAT_FORMAT. Remove reference to HOST_FLOAT_FORMAT. + (VAX_HALFWORD_ORDER): Document. + (LARGEST_EXPONENT_IS_NORMAL): Remove note about being only for + IEEE float format. + (TARGET_SCHED_ISSUE_RATE): Reword reference to MAX_DFA_ISSUE_RATE. + (ASM_OUTPUT_LABEL_REF): Fix font. + (CASE_VECTOR_SHORTEN_MODE): Ditto. + +2002-08-30 Denis Chertykov + + * config/ip2k/ip2k.c (ip2k_set_compare): Remove all const_double + stuff. + (ip2k_gen_unsigned_comp_branch): Handle CONST_INT and + CONST_DOUBLE constants. + +2002-08-30 Jason Thorpe + + * config/alpha/alpha.h (TARGET_CPU_CPP_BUILTINS): Move language- + related defines to... + (SUBTARGET_LANGUAGE_CPP_BUILTINS): ...here. + * config/alpha/netbsd.h (SUBTARGET_LANGUAGE_CPP_BUILTINS): Redefine + as a no-op. + +2002-08-30 Krister Walfridsson + + * config/arm/arm.c (arm_asm_output_labelref): New function. + * config/arm/arm.h (ASM_OUTPUT_LABELREF): Call arm_asm_output_labelref. + * config/arm/arm-protos.h: Add prototype for arm_asm_output_labelref. + +2002-08-29 Rodney Brown + + * doc/install.texi (Specific, alpha*-dec-osf*): Add "virtual + memory exhausted" workarounds. + +2002-08-30 Gabriel Dos Reis + + * diagnostic.c (fancy_abort): Don't repeat "internal error". + * toplev.c (crash_signal): Likewise. + +Fri Aug 30 00:33:37 2002 Nicola Pero + + * doc/cpp.texi (__NEXT_RUNTIME__): Extended documentation. + * doc/invoke.texi (-fnext-runtime, -Wno-protocol, -Wselector): + Extended, updated documentation. + (-Wundeclared-selector): Documented. + +2002-08-29 Jason Thorpe + + * config/chorus.h: Consistently define *_DEBUGGING_INFO with + the value 1. Do not undef before defining. + * config/darwin.h: Likewise. + * config/dbx.h: Likewise. + * config/dbxcoff.h: Likewise. + * config/dbxelf.h: Likewise. + * config/elfos.h: Likewise. + * config/interix.h: Likewise. + * config/lynx-ng.h: Likewise. + * config/lynx.h: Likewise. + * config/netware.h: Likewise. + * config/psos.h: Likewise. + * config/svr3.h: Likewise. + * config/alpha/alpha.h: Likewise. + * config/alpha/elf.h: Likewise. + * config/alpha/vms.h: Likewise. + * config/arc/arc.h: Likewise. + * config/arm/aout.h: Likewise. + * config/arm/coff.h: Likewise. + * config/c4x/c4x.h: Likewise. + * config/h8300/h8300.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/djgpp.h: Likewise. + * config/i386/gas.h: Likewise. + * config/i386/gstabs.h: Likewise. + * config/i386/i386-coff.h: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/i386/svr3dbx.h: Likewise. + * config/i386/sysv3.h: Likewise. + * config/i386/win32.h: Likewise. + * config/i386/x86-64.h: Likewise. + * config/i960/i960.h: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ip2k/ip2k.h: Likewise. + * config/m32r/m32r.h: Likewise. + * config/m68k/3b1.h: Likewise. + * config/m68k/3b1g.h: Likewise. + * config/m68k/ccur-GAS.h: Likewise. + * config/m68k/coff.h: Likewise. + * config/m68k/hp2bsd.h: Likewise. + * config/m68k/hp310g.h: Likewise. + * config/m68k/hp320g.h: Likewise. + * config/m68k/hp3bsd.h: Likewise. + * config/m68k/hp3bsd44.h: Likewise. + * config/m68k/linux-aout.h: Likewise. + * config/m68k/m68k-aout.h: Likewise. + * config/m68k/mot3300.h: Likewise. + * config/m68k/netbsd.h: Likewise. + * config/m68k/openbsd.h: Likewise. + * config/m68k/pbb.h: Likewise. + * config/m68k/plexus.h: Likewise. + * config/m68k/sun2.h: Likewise. + * config/m68k/sun3.h: Likewise. + * config/m68k/tower-as.h: Likewise. + * config/m68k/vxm68k.h: Likewise. + * config/m88k/aout-dbx.h: Likewise. + * config/m88k/m88k-aout.h: Likewise. + * config/mcore/mcore-elf.h: Likewise. + * config/mcore/mcore-pe.h: Likewise. + * config/mips/elf.h: Likewise. + * config/mips/elf64.h: Likewise. + * config/mips/iris5gas.h: Likewise. + * config/mips/iris6.h: Likewise. + * config/mips/mips.h: Likewise. + * config/mips/sni-gas.h: Likewise. + * config/mmix/mmix.h: Likewise. + * config/ns32k/netbsd.h: Likewise. + * config/pa/pa64-hpux.h: Likewise. + * config/romp/romp.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/rs6000/xcoff.h: Likewise. + * config/sh/coff.h: Likewise. + * config/sh/elf.h: Likewise. + * config/sparc/linux64.h: Likewise. + * config/sparc/liteelf.h: Likewise. + * config/sparc/netbsd.h: Likewise. + * config/sparc/openbsd.h: Likewise. + * config/sparc/pbd.h: Likewise. + * config/sparc/sp64-elf.h: Likewise. + * config/sparc/sp86x-elf.h: Likewise. + * config/sparc/sparc.h: Likewise. + * config/vax/vax.h: Likewise. + * config/vax/vaxv.h: Likewise. + +2002-08-29 "Dhananjay R. Deshpande" + + * h8300.c (shift_alg_hi): Various tweaks to improve performance + of HImode shifts. + (get_shift_alg): Corresponding changes. + +2002-08-29 John David Anglin + + * som.h (ALWAYS_STRIP_DOTDOT): Define to 1. + +2002-08-29 Richard Henderson + + * expr.h (enum block_op_methods): New. + (emit_block_move): Update prototype. + * expr.c (block_move_libcall_safe_for_call_parm): New. + (emit_block_move_via_loop): New. + (emit_block_move): Use them. New argument METHOD. + (emit_push_insn): Always respect the given alignment. + (expand_assignment): Update call to emit_block_move. + (store_expr, store_field, expand_expr): Likewise. + * builtins.c (expand_builtin_apply): Likewise. + (expand_builtin_memcpy, expand_builtin_va_copy): Likewise. + * function.c (expand_function_end): Likewise. + * config/sh/sh.c (sh_initialize_trampoline): Likewise. + * config/sparc/sparc.c (sparc_va_arg): Likewise. + * calls.c (expand_call, emit_library_call_value_1): Likewise. + (save_fixed_argument_area): Use emit_block_move with + BLOCK_OP_CALL_PARM instead of move_by_pieces. + (restore_fixed_argument_area): Likewise. + (store_one_arg): Fix alignment parameter to emit_push_insn. + +2002-08-29 John David Anglin + + * install.texi (hppa64-hp-hpux11*): Document installation procedure. + +2002-08-29 Catherine Moore + + * config/v850/v850.h (MULDI3_LIBCALL, UCMPDI2_LIBCALL, CMPDI2_LIBCALL, + NEGDI2_LIBCALL, INIT_TARGET_OPTABS, MASK_STRICT_ALIGN): Define. + (PREDICATE_CODES): Include new predicates. + (RTX_COSTS): Handle UMOD and UDIV. Tune MULT for v850e. + (TARGET_SWITCHES): Add strict-align. + (TARGET_STRICT_ALIGN): New. + (MASK_DEFAULT, STRICT_ALIGNMENT): Redefine. + * config/v850/t-v850 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): + Define. + (LIB1ASMFUNCS): Add v850_negdi2, v850_cmpdi2, v850_ucmpdi2, + v850_muldi3. + * config/v850/lib1funcs.asm (L_callt_save_r2_r29, L_return_r2_r29, + L_callt_save_r2_r31, L_return_r2_r31, + L_save_all_interrupt): Change addi to add. + (L_save_interrupt, L_return_interrupt): Rework. + (__return_r31): Correct .size directive. + (mulsi3, divsi3, udivsi3, umodsi3, modsi3): Tune for v850e. + (v850_negdi2, v850_cmpdi2, v850_ucmpdi2, v850_muldi3): + New routines. + * config/v850/v850.c (expand_prologue): Call + gen_callt_save_interrupt, gen_callt_restore_all_interrupt, + gen_callt_return_interrupt and gen_callt_save_all_interrupt. + (reg_or_int9_operand): New predicate. + (reg_or_const_operand): New routine. + * config/v850/v850.md (return_interrupt): Changed from + restore_interrupt. + (callt_save_all_interrupt): Changed from save_all_interrupt_v850e. + (callt_save_interrupt): Change save sequence. + (callt_return_interrupt): New. + (save_interrupt): Don't use runtime function for LONG_CALLS + and TARGET_PROLOG_FUNCTION. + (save_all_interrupt): Likewise. + (mulsi3): Use new predicate. + (moviscc): Disallow some combination of constants. + Fix define_split for sasf insns, so that it will not generate bad + code if operand0 and operand5 are the same. + * config/v850/v850-protos.h: Prototype new predicates. + +2002-08-29 Zack Weinberg + + * config/rs6000/rs6000.c (processor_target_table): Add 405f. + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Likewise. + +2002-08-28 Gabriel Dos Reis + + * c-common.c (builtin_define_type_precision): New function. + (cb_register_builtins): Use it. Define __WCHAR_UNSIGNED__ is + wchar_t is unsigned in C++. + * doc/cpp.texi (Common Predefined Macros): Document + __WCHAR_UNSIGNED__, __CHAR_BIT__, __WCHAR_BIT__, __SHRT_BIT__, + __INT_BIT__, __LONG_BIT__, __LONG_LONG_BIT__, __FLOAT_BIT__, + __DOUBLE_BIT__, __LONG_DOUBLE_BIT__. + +2002-08-28 Sylvain Pion + + * doc/invoke.texi (-Wreorder): Remove remaining pieces from the generic + section. Mention that it is enabled by -Wall. + (-Wall): Mention that there can be language-specific warnings as well. + (-Wctor-dtor-privacy): Mention that it is enabled by default. + (-Wnon-virtual-dtor): Mention that it is enabled by -Wall. + +Wed Aug 28 15:35:17 2002 J"orn Rennecke + + * sh.c (calc_live_regs): Save FPSCR_REG in an interrupt handler + if it is ever live. + + * sh.c (sh_handle_interrupt_handler_attribute): Reject interrupt_handler + attribute for SHCOMPACT. + + * sh.h (OVERRIDE_OPTIONS): If align_function isn't set, set it + appropriately. + (FUNCTION_BOUNDARY): Specify only the minimum alignment required + by the ABI. + + * sh.h (SH5_WOULD_BE_PARTIAL_NREGS): Also handle TImode case. + +2002-08-28 Jason Thorpe + + * config.gcc (mips*-*-netbsd*): Set target_cpu_default to + "MASK_GAS|MASK_ABICALLS". + * config/mips/netbsd.h (TARGET_ENDIAN_DEFAULT) + (TARGET_DEFAULT): Remove. + (MACHINE_TYPE): Undefine before defining. + (DBX_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE): Remove. + +2002-08-27 Mark Mitchell + + * c-common.c (warn_abi): New variable. + * c-common.h (warn_abi): Likewise. + * c-opts.c (COMMAND_LINE_OPTIONS): Add -Wabi. + (c_common_decode_option): Handle it. + * doc/invoke.texi: Document -Wabi. + +Tue Aug 27 23:03:52 2002 Nicola Pero + + * c-common.c (warn_undeclared_selector): New variable. + * c-common.h (warn_undeclared_selector): Idem. + * c-opts.c (c_common_decode_option): Set warn_undeclared_selector + to on when -Wundeclared-selector is found. + (COMMAND_LINE_OPTIONS): Added -Wundeclared-selector. + * objc/objc-act.c (build_selector_expr): If + warn_undeclared_selector is set, check that the selector has + already been defined, and emit a warning if not. + +2002-08-27 Nick Clifton + Catherine Moore + Jim Wilson + + * config.gcc: Add v850e-*-* target. + Add --with-cpu= support for v850. + * config/v850/lib1funcs.asm: Add v850e callt functions. + * config/v850/v850.h: Add support for v850e target. + * config/v850/v850.c: Add functions to support v850e target. + * config/v850/v850-protos.h: Add prototypes for new functions in v850.c. + * config/v850/v850.md: Add patterns for v850e instructions. + * doc/invoke.texi: Document new v850e command line switches. + +Tue Aug 27 18:30:47 2002 J"orn Rennecke + Aldy Hernandez + + * doc/tm.texi: Applied numerous fixes to the automaton based + scheduler descrition. + +Tue Aug 27 19:51:05 CEST 2002 Jan Hubicka + + * i386.c (classify_argument): Handle variable sized objects. + +Tue Aug 27 19:18:16 CEST 2002 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Fix RTL sharing problem + +Tue Aug 27 18:01:45 CEST 2002 Jan Hubicka + + * libgcc2.c (__bb_exit_func): Properly write the summarized statistics. + +Tue Aug 27 18:00:11 CEST 2002 Jan Hubicka + + * i386.c (classify_argument): Properly compute word size of the analyzed object. + +Tue Aug 27 14:39:09 2002 J"orn Rennecke + + * sh.md (attribute type): Add types mt_group, fload, pcfload, fpul_gp, + mac_gp ftrc_s and cwb. Add / Adjust definitions in individual insn + accordingly. + (attribute insn_class): Provide default definitions based on type. + Remove all insn-specific settings. + (various function units): Remove old SH4 scheduling. + (branch_zero, dfp_comp, late_fp_use, any_fp_comp, any_int_load): + New attributes. Set them where appropriate. + (cpu unit FS): Don't define / use. + (F3, load_store): New cpu units. + (F01): New reservation. + (all insn_reservations): Make dependent on sh4 pipeline model. + Fix latencies. + (nil, reg_mov, freg_mov, sh4_fpul_gp, sh4_call): New insn_reservations. + (sh4_mac_gp, fp_arith_ftrc, arith3, arith3b): Likewise. + (mt insn_reservation): Use type mt_group. + (insn_reservation load_store): Split into sh4_load, sh4_load_si, + sh4_fload and sh4_store. + (insn_reservation branch_zero and branch): Replace with sh4_branch. + (insn_reservation branch_far): Replace with sh4_return. + (insn_reservation return_from_exp): Rename to: + (sh4_return_from_exp). Change to be just d_lock*5. + (insn_reservation lds_to_pr): Rename to: + (sh4_lds_to_pr). Change to be just d_lock*2. + (insn_reservation ldsmem_to_pr, sts_from_pr): Change to be just + d_lock*2. + (insn_reservation prload_mem): Rename to: + (sh4_prstore_mem). Change to d_lock*2,nothing,memory. + (insn_reservation fpscr_store): Rename to: + (fpscr_load). Change to d_lock,nothing,F1*3. + (insn_reservation fpscr_store_mem): Rename to: + (fpscr_load_mem). Change to d_lock,nothing,(F1+memory),F1*2. + (insn_reservation multi): Change to + d_lock,(d_lock+f1_1),(f1_1|f1_2)*3,F2. + (insn_reservation fp_arith): Change to issue,F01,F2. + (insn_reservation fp_div: Change to issue,F01+F3,F2+F3,F3*7,F1+F3,F2. + (insn_reservation dp_float): Change to issue,F01,F1+F2,F2. + (insn_reservation fp_double_arith): Change to issue,F01,F1+F2,fpu*4,F2. + (insn_reservation fp_double_cmp): Change to + d_lock,(d_lock+F01),F1+F2,F2. + (insn_reservation dp_div): Change to + issue,F01+F3,F1+F2+F3,F2+F3,F3*16,F1+F3,(fpu+F3)*2,F2. + * sh.c (flow_dependent_p, flow_dependent_p_1): New functions. + (sh_adjust_cost, SHcompact): Differentiate between different + kinds of dependencies. Drop factor of ten for superscalar. + Use new instruction types. Add new exception rules. + + * sh.md (mulhisi3, umulhisi3: Add a REG_EQUAL note. + + * sh.md (mperm_w): Add DONE. + +2002-08-27 David Edelsohn + + * longlong.h: Import current PowerPC defintion from GMP-4.1. + + * config/rs6000/rs6000.h (MIN_UNITS_PER_WORD): Add IN_LIBGCC2 case. + + * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Undef before define. + +Tue Aug 27 13:53:57 2002 J"orn Rennecke + + * sh.h (MAX_FIXED_MODE_SIZE): Define. + +2002-08-27 Gabriel Dos Reis + + * doc/cpp.texi (Common Predefined Macros): Don't mess with table + delimiter. + +2002-08-27 Gabriel Dos Reis + + * c-common.c (cpp_define_data_format): New function. + (cb_register_builtins): Call it. + + * doc/cpp.texi (Common Predefined Macros): Document + __TARGET_BITS_ORDER__, __TARGET_BYTES_ORDER__, + __TARGET_INT_WORDS_ORDER__, __TARGET_FLOAT_WORDS_ORDER__, + __TARGET_FLOAT_FORMAT__, __TARGET_USES_VAX_F_FLOAT__, + __TARGET_USES_VAX_D_FLOAT__, __TARGET_USES_VAX_G_FLOAT__, + __TARGET_USES_VAX_H_FLOAT__. + +2002-08-26 Ziemowit Laski + + * objc/objc-act.c (get_super_receiver): If inside a class method + of a category, cast the receiver to 'id' before accessing the 'isa' + field so that is not needed. For NeXT runtime. + +2002-08-26 Ulrich Weigand + + * config/s390/s390-protos.h (s390_function_prologue, + s390_function_epilogue): Remove. + config/s390/s390.c (s390_function_prologue, s390_function_epilogue, + TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE): Remove. + + config/s390/s390.c (s390_machine_dependent_recorg): New function. + config/s390/s390-protos.h (s390_machine_dependent_reorg): Declare it. + config/s390/s390.h (MACHINE_DEPENDENT_REORG): Call it. + config/s390/s390.c (s390_split_branches, s390_chunkify_pool): Adapt + to being called from MACHINE_DEPENDENT_REORG. Update regs_ever_live. + + config/s390/s390.c (s390_frame_info): Inline save_fprs_p. Always + assume BASE_REGISTER and RETURN_REGNUM need to be saved. + (s390_emit_prologue): Assume RETURN_REGNUM to be saved iff + function is not a leaf function. Use save_gprs and restore_gprs. + (s390_emit_epilogue): Likewise. + (save_gprs, restore_gprs): New functions. + (struct s390_frame): Remove return_reg_saved_p member. + (save_fprs_p): Remove. + (s390_optimize_prolog): New function. + (s390_legitimate_reload_constant): Remove now unnecessary check. + + (s390_function_count): Remove. + (s390_output_symbolic_const): Replace s390_function_count by + current_function_funcdef_no. + (s390_output_constant_pool): Likewise. + + (legitimize_pic_address): Use regs_ever_live to track PIC register + instead of current_function_uses_pic_offset_table. + (s390_emit_prologue): Likewise. + config/s390/s390.md ("call", "call_value"): Likewise. + +2002-08-26 Neil Booth + + * c-opts.c (find_opt): Don't complain about wrong languages + here. Return exact matches even for wrong language. + (c_common_decode_option): Complain about wrong languages + here. + +2002-08-24 Stuart Hastings + + * function.h (struct function): Add flag + all_throwers_are_sibcalls. + * except.c (set_nothrow_function_flags): Replaces + nothrow_function_p. Set new flag. + * except.h (set_nothrow_function_flags): Replaces + nothrow_function_p. + * dwarf2out.c (struct dw_fde_struct): Add flag + all_throwers_are_sibcalls. + (output_call_frame_info): Test it. + (dwarf2out_begin_prologue) Propagate it from cfun to + dw_fde_struct. + * toplev.c (rest_of_compilation): Update calls to + nothrow_function_p. + +2002-08-23 Zack Weinberg + + * ggc-page.c (compute_inverse): Short circuit calculation for + object sizes larger than half a page. + +2002-08-23 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_elf_select_section): Treat + DEFAULT_ABI == ABI_AIX like PIC. Test PIC & reloc for readonly + default. + (rs6000_elf_unique_section): Likewise. + +2002-08-23 Kaveh R. Ghazi + + * ns32k.c (ns32k_globalize_label): Delete. + * ns32k.h (ASM_OUTPUT_LABEL, TARGET_ASM_GLOBALIZE_LABEL): Delete. + +2002-08-23 Alan Modra + + * config/rs6000/rs6000.c (output_mi_thunk): Don't determine insns + for loading delta with num_insns_constant_wide. Calculate + delta_low, delta_high without using a conditional. + +2002-08-22 Jason Merrill + + * c-common.h (RETURN_STMT_EXPR): Rename from RETURN_EXPR. + * c-common.def: Adjust. + * c-dump.c (c_dump_tree): Adjust. + * c-semantics.c (genrtl_return_stmt): Adjust. + * c-pretty-print.c (pp_c_statement): Adjust. + * tree-inline.c (copy_body_r): Adjust. + +2002-08-22 Zack Weinberg + + * ggc-page.c: Avoid division in ggc_set_mark. + (DIV_MULT, DIV_SHIFT, OFFSET_TO_BIT, inverse_table, + compute_inverse): New. + (ggc_set_mark, ggc_marked_p): Use OFFSET_TO_BIT. + (init_ggc): Initialize inverse_table. + +2002-08-22 Tom Tromey + + * doc/install.texi (Configuration): Document --datadir. + +2002-08-22 Alexandre Oliva + + * Makefile.in ($(BUILD_PREFIX_1)varray.o): Depend on $(GGC_H). + +2002-08-22 Hans-Peter Nilsson + + * gengtype-lex.l (ID): Allow underscore as first character. + +2002-08-21 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_xcoff_asm_globalize_label): New + function. + (rs6000_xcoff_asm_named_section): Rename. + * config/rs6000/xcoff.h (TARGET_ASM_GLOBALIZE_LABEL): Define. + +2002-08-21 Tom Tromey + + For PR java/6005 and PR java/7611: + * fold-const.c (fold_truthop): Use can_use_bit_fields_p. + (fold): Likewise. + * langhooks.c (lhd_can_use_bit_fields_p): New function. + * langhooks-def.h (lhd_can_use_bit_fields_p): Declare. + (LANG_HOOKS_CAN_USE_BIT_FIELDS_P): New define. + (LANG_HOOKS_INITIALIZER): Use it. + * langhooks.h (struct lang_hooks) [can_use_bit_fields_p]: New + field. + +2002-08-21 Stan Shebs + + * tree.c (finish_vector_type): Fix a typo in a comment. + * Makefile.in: Fix "the the" stutters in comments. + * genautomata.c: Ditto. + * ifcvt.c: Ditto. + * regrename.c: Ditto. + * config/alpha/alpha.c: Ditto. + * config/alpha/vms-crt0-64.c: Ditto. + * config/alpha/vms-crt0.c: Ditto. + * config/alpha/vms-psxcrt0-64.c: Ditto. + * config/alpha/vms-psxcrt0.c: Ditto. + * config/d30v/d30v.h: Ditto. + * config/fr30/fr30.h: Ditto. + * config/rs6000/rs6000.c: Ditto. + * config/stormy16/stormy16.h: Ditto. + * doc/md.texi: Ditto. + +2002-08-21 John David Anglin + + * cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value. + +2002-08-21 Joseph S. Myers + + * c-decl.c (grokdeclarator): Make invalid combinations with long, + short, signed or unsigned into hard errors. Fixes PR c/4319. + Also make duplicate modifiers such as "short short" into hard + errors. + +2002-08-21 Andrew Pinski + Kaveh R. Ghazi + + * doc/tm.texi (TARGET_ASM_GLOBALIZE_LABEL): Move '@end deftypefn' + to the actual end. Add '@end table' and '@table @code'. + +2002-08-20 Geoffrey Keating + + * doc/tm.texi (Label Output): Add missing '@end deftypefn'. + + * unroll.c (biv_total_increment): Don't try to compute the total + increment for FP BIVs. + +2002-08-20 Kaveh R. Ghazi + + * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. + * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, + ASM_OUTPUT_ALIGNED_BSS): Use target hook. + * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. + * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. + * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. + (GLOBAL_ASM_OP): Define. + * arm.c (aof_globalize_label): New function. + (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. + * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. + * c4x.c (c4x_globalize_label): New function. + (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. + * c4x.h (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. + * darwin-protos.h (darwin_globalize_label): Declare. + * darwin.c (darwin_globalize_label): New function. + * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. + (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. + * dsp16xx.c (asm_output_common): Use target hook. + * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. + * frv.h (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + * i370.c (i370_globalize_label): New function. + (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. + * i370.h (ASM_GLOBALIZE_LABEL): Delete. + * i386.c (ix86_asm_file_end): Use target hook. + * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. + * ia64.c (ia64_asm_output_external): Likewise. + * ia64/sysv4.h: Update comment. + * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. + * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. + * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. + * mmix-protos.h (mmix_asm_globalize_label): Delete. + * mmix.c (mmix_asm_globalize_label): Likewise. + * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. + (GLOBAL_ASM_OP): Define. + * ns32k.c (ns32k_globalize_label): New function. + * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. + (ASM_GLOBALIZE_LABEL): Delete. + * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. + (TARGET_ASM_GLOBALIZE_LABEL): Undefine. + * pa.c (pa_globalize_label): New function. + * pa.h (ASM_GLOBALIZE_LABEL): Delete. + (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. + * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + (TARGET_ASM_GLOBALIZE_LABEL): Undef. + * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. + * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + * v850.c (v850_output_aligned_bss): Use target hook. + * vax.c (vms_globalize_label): New function. + (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. + * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + * defaults.h (ASM_GLOBALIZE_LABEL): Delete. + * doc/tm.texi: Update docs. + * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use + target hook. + * final.c (output_alternate_entry_point): Likewise. + * hooks.c (hook_FILEptr_constcharptr_void): New function. + * hooks.h (hook_FILEptr_constcharptr_void): Declare. + * output.h (assemble_global): Delete. + (default_globalize_label): Declare. + * system.h (ASM_GLOBALIZE_LABEL): Poison. + * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. + (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. + * target.h (gcc_target): Add globalize_label member. + * varasm.c (asm_output_bss, asm_output_aligned_bss, + globalize_decl): Use target hook. + (assemble_global): Delete. + (default_globalize_label): New function. + +2002-08-20 Kaveh R. Ghazi + + * dsp16xx.h (dsp16xx_umulhi3_libcall): Delete. + +2002-08-20 Devang Patel + * tree.c (get_qualified_type): Add TYPE_CONTEXT check. + +2002-08-20 Kaveh R. Ghazi + + * arc.c (output_shift): Use stdio instead of asm_fprintf. + * arm.c (thumb_output_function_prologue): Likewise. + * avr.c (print_operand): Likewise. + * c4x.c (c4x_print_operand): Likewise. + * c4x.h (ASM_OUTPUT_INTERNAL_LABEL, TRAMPOLINE_TEMPLATE, + ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Likewise. + * cris.c (cris_target_asm_function_prologue, + cris_asm_output_mi_thunk): Likewise. + * h8300.c (print_operand): Likewise. + * h8300.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * ip2k.c (print_operand): Likewise. Fix format specifier. + * m68hc11.c (asm_print_register, print_operand, + print_operand_address): Use stdio instead of asm_fprintf. + (print_operand_address): Fix format specifier. + * m68hc11.h (FUNCTION_PROFILER, ASM_OUTPUT_ADDR_DIFF_ELT, + ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ALIGN): Use stdio instead of + asm_fprintf. + * m68k/amix.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k/atari.h (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + * m68k.c (m68k_output_function_prologue, + m68k_output_function_epilogue, print_operand): Likewise. + * mmix.c (mmix_asm_output_mi_thunk, mmix_asm_weaken_label): + Likewise. Fix format specifier. + * mn10200.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * mn10300.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * v850.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + +2002-08-15 Eric Christopher + Jeff Knaggs + + * config.gcc (mipsisa64sr71k-elf): New target. + * config/mips/sr71k.md: New file. + * config/mips/mips.md: Use it. + (rot*): Add sr71k specifics. + * config/mips/t-sr71k: New file. + * config/mips/mips.h (sr71k): New cpu. + (TARGET_SR71K): Use it. + (TUNE_SR71K): Ditto. + (GENERATE_BRANCHLIKELY): Ditto. + (ISA_HAS_MULHI, ISA_HAS_MULS, ISA_HAS_MSAC, ISA_HAS_MACC, + ISA_HAS_ROTR_SIISA_HAS_ROTR_DI): Ditto. + * config/mips/mips.c (sr71k): New cpu. + (mips_use_dfa_pipeline_interface): Use. + +2002-08-15 Eric Christopher + Richard Sandiford + Aldy Hernandez + Graham Stott + Michael Meissner + Gavin Romig-Koch + Ken Raeburn + Alexandre Oliva + + * config.gcc (mips64vr-elf): New target. + * config/mips/5400.md: New file. + * config/mips/5500.md: Ditto. + * config/mips/mips.md: Use them. + (frsqrt): New. + * config/mips/mips.c (vr4111, vr4121, vr4320, vr5400, vr5500): New + cpus. + (mips_issue_rate): Use them. + (mips_use_dfa_pipeline_interface): New function. Use for 5400 and 5500. + (TARGET_SCHEDUSE_DFA_PIPELINE_INTERFACE): Define. Use above. + * config/mips/mips.h (vr4111, vr4121, vr4320, vr5400, vr5500): New + cpus. + (TARGET_MIPSx): Use them. + (TUNE_MIPSx): Ditto. + (GETNATE_MULT3_SI): Ditto. + (ISA_HAS_BRANCHLIKELY): Ditto. + (ISA_HAS_CONDMOVE): Ditto. + (ISA_HAS_NMADD_NMSUB): Ditto. + (ISA_HAS_MULHI): New. Ditto. + (ISA_HAS_MULS): Ditto. + (ISA_HAS_MSAC): Ditto. + (ISA_HAS_MACC): Ditto. + (ISA_HAS_ROTR_SI): Ditto. + (ISA_HAS_ROTR_DI): Ditto. + (RTX_COSTS): Use. + +2002-08-20 John David Anglin + + * cppinit.c (remove_dup_dir): Add head_ptr argument to handle removal + at head. + (remove_dup_nonsys_dirs): New function. + (remove_dup_dirs): Change argument head to head_ptr. Remove warnings. + (merge_include_chains): Remove non-system include directories from + quote and bracket include chains when they duplicate equivalent system + directories. + * doc/cpp.texi (-I): Update. + * doc/cppopts.texi (-I): Update. + * doc/install.texi (--with-local-prefix): Further document usage of + this option. + * doc/invoke.texi (-I): Update. + +2002-08-20 Richard Henderson + + * expr.c (TARGET_MEM_FUNCTIONS): Transform to boolean. + (emit_block_move): Split out subroutines. + (emit_block_move_via_movstr): New. + (emit_block_move_via_libcall): New. Emit bcopy via normal call also. + (emit_block_move_libcall_fn): New. Construct function prototype for + bcopy as well. + (clear_storage): Split out subroutines. + (clear_storage_via_clrstr): New. + (clear_storage_via_libcall): New. Emit bzero as a normal call also. + (clear_storage_libcall_fn): New. Construct function prototype for + bzero as well. + (emit_push_insn): Use emit_block_move. + (expand_assignment): Booleanize TARGET_MEM_FUNCTIONS. + (store_constructor): Likewise. + +2002-08-19 Ziemowit Laski + + * objc/objc-act.c (building_objc_message_expr): Rename to + current_objc_message_selector. + +2002-08-19 Ziemowit Laski + + * objc/objc-act.c (build_ivar_chain): Remove. + (objc_copy_list): Likewise. + (get_class_ivars): Inline call to removed build_ivar_chain + function. Save off a clean copy of ivars in the CLASS_OWN_IVARS + slot; use that slot (rather than CLASS_IVARS) when accessing + ivars for base classes. Call copy_list and chainon instead of + objc_copy_list. + (build_private_template): Call get_class_ivars instead of + build_ivar_chain. + (start_class): Allocate room for the CLASS_OWN_IVARS slot. + (continue_class): Call get_class_ivars instead of + build_ivar_chain. + (encode_field_decl): Check for DECL_BIT_FIELD_TYPE instead + of DECL_BIT_FIELD (which may have been cleared). + * objc/objc-act.h (CLASS_OWN_IVARS): New accessor macro. + +2002-08-19 Kaveh R. Ghazi + + * genautomata.c (output_translate_vect, output_state_ainsn_table, + output_min_issue_delay_table): Mark variable with ATTRIBUTE_UNUSED + in output file. + (output_internal_min_issue_delay_func): Initialize variable in + output file. + +2002-08-19 Alexandre Oliva + + * Makefile.in (GCC_FOR_TARGET): Prepend STAGE_CC_WRAPPER. + (stage2_build, stage3_build, stage4_build): Likewise, to CC. + +2002-08-19 Geoffrey Keating + Steve Ellcey + + * machmode.h (SCALAR_INT_MODE_P): New macro to test for + scaler integer mode (MODE_INT or MODE_PARTIAL_INT). + * explow.c (trunc_int_for_mode): Abort when the mode is not + a scaler integer mode. + * combine.c (expand_compound_operation): Don't expand Vector + or Complex modes into shifts. + (expand_field_assignment): Don't do bitwise arithmatic and + shifts on Vector or Complex modes. + (simplify_comparison): Don't call trunc_int_for_mode + for VOIDmode. + * recog.c (general_operand): Likewise. + (immediate_operand): Likewise. + (nonmemory_operand): Likewise. + +2002-08-19 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_set_const): Inline + multi-instruction SImode constant. Add REG_EQUAL note. + * config/rs6000/rs6000.md (movsi splitter): Use + rs6000_emit_set_const. + +2002-08-19 Kaveh R. Ghazi + + * tree-inline.c (initialize_inlined_parameters): Wrap variable in + the macro test controlling its use. + +2002-08-18 H.J. Lu (hjl@gnu.org) + + * config.gcc (*-*-linux*): Set extra_parts="crtbegin.o + crtbeginS.o crtbeginT.o crtend.o crtendS.o", gas=yes and + gnu_ld=yes. + (alpha*-*-linux*, cris-*-linux*, i370-*-linux*, + i[34567]86-*-linux*, x86_64-*-linux*, mips*-*-linux*, + s390-*-linux*, s390x-*-linux*, sparc-*-linux*, sparc64-*-linux*, + xtensa-*-linux*): Remove setting extra_parts, gas, and gnu_ld + here. + (cris-*-linux*): Remove setting thread_file here. + +2002-08-18 Neil Booth + + PR preprocessor/7602 + * cppinit.c (path_include): Treat the system environment + variables as being cxx_aware. + +2002-08-17 Joseph S. Myers + + * c-decl.c (flexible_array_type_p): New function. + (grokdeclarator, finish_struct): Use it. + * doc/extend.texi: Document constraints on use of structures with + flexible array members. + +2002-08-17 Richard Sandiford + + * config/mips/t-coff, config/mips/t-elf, config/mips/t-isa3264, + config/mips/t-r3900 (MULTILIB_MATCHES): Define. + * config/mips/mips.h (ASM_SPEC): Use %(endian_spec). + +2002-08-16 Stan Shebs + + * c-common.c (cb_register_builds): Define __NEXT_RUNTIME__ + for ObjC with -fnext-runtime. + * doc/cpp.texi: Document it. + +2002-08-16 Janis Johnson + + * doc/install.texi (Final installation): Replace links to individual + build status pages with a link to a common page that lists them all. + +2002-08-16 Sylvain Pion + + * doc/invoke.texi: Fix typo. + +2002-08-16 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Explain AIX shared object versioning. + +2002-08-16 Andrew Haley + + * tree-inline.c: Add includes for Java inliner. + (remap_decl): Don't handle anonymous types for Java. + (remap_block): Add handling for Java trees. + (copy_scope_stmt): Conditionalize for non-Java use only. + (copy_body_r): Handle Java trees. Add handling for + LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR, Java blocks. + (initialize_inlined_parameters): Handle Java trees. + (declare_return_variable): Likewise. + (expand_call_inline): Handle Java trees. + (walk_tree): Likewise. + (copy_tree_r): Don't handle SCOPE_STMTs for Java. + (add_stmt_to_compound): New function. + +2002-08-15 Richard Henderson + + * Makefile.in (LOOSE_WARN): Remove -fno-common. + (NOCOMMON_FLAG): New substitution point. + (GCC_WARN_CFLAGS): Include it. + * configure.in (ac_checking): Set nocommon_flag. + (nocommon_flag): New substitution point. + +2002-08-15 Alexandre Oliva + + * c-tree.h (skip_evaluation): Move declaration... + * c-common.h: ... here. + * c-typeck.c (build_external_ref): Don't assemble_external nor + mark a tree as used if skip_evaluation is set. + * c-parse.in (typeof): New non-terminal to set skip_evaluation + around TYPEOF. + (typespec_nonreserved_nonattr): Use it. + +2002-08-15 Douglas B Rupp + + * dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue. + (xcoff_debug_hooks): Update end_prologue. + * debug.c (do_nothing_debug_hooks): Update end_prologue, end_epilogue. + * debug.h (end_prologue): Add file arg. + (end_epilogue): Add line and file args. + (dwarf2out_end_epilogue): Add line and file args. + (vmsdbgout_after_prologue): Remove. + * dwarf2out.c (dwarf2out_end_epilogue): Add line and file args. + (dwarf2_debug_hooks): Update end_prologue. + * dwarfout.c (dwarfout_end_epilogue): Add line and file args. + (dwarfout_end_prologue): Add file arg. + * final.c (vmsdbgout_after_prologue): Remove + (final_end_function): Update end_epilogue call. + (final_scan_insn): Update end_prologue call. + * sdbout.c (sdbout_end_epilogue): Add line and file args. + (sdbout_end_prologue): Add file arg. + (sdb_debug_hooks): Update end_prologue. + (sdb_begin_prologue): Update sdbout_end_prologue call. + * vmsdbgout.c (vmsdbg_debug_hooks): Add vmsdbgout_end_prologue, + vmsdbgout_end_function. + (vmsdbgout_end_prologue): New function renamed from + vmsdbgout_after_prologue. Call vmsdbgout_source_line. + (vmsdbgout_end_function): New function. + (vmsdbgout_end_epilogue): Add line and file args. Call + vmsdbgout_source_line. + (write_pclines): Write only valid line numbers. + (write_srccorr): Don't write source correlation records if 0 lines. + * xcoffout.c (xcoffout_end_epilogue): Add line and file args. + +2002-08-15 Steve Ellcey + + * gcc/unwind.h (_Unwind_Ptr): Make 64 bits on IA64 HP-UX. + (_Unwind_Internal_Ptr): 32 bit version for use in + read_encoded_value_with_base. + * gcc/unwind-pe.h (read_encoded_value_with_base): Use + _Unwind_Internal_Ptr instead of _Unwind_Ptr in order to get the + right size. + +2002-08-15 Kaveh R. Ghazi + + * loop.c (scan_loop, move_movables, count_one_set): Cast to avoid + signed/unsigned warnings. + + * regclass.c (init_reg_sets_1, choose_hard_reg_mode, + record_reg_classes): Likewise. + + * reload.c (reload_inner_reg_of_subreg, push_reload, + find_reloads_address_1): Likewise. + +2002-08-15 David Edelsohn + + * rs6000.c (output_mi_thunk): Return to function section on + TARGET_ELF. + + * rs6000-c.c (rs6000_cpu_cpp_builtins): Define __PPC405__ if PPC405. + +2002-08-15 Ulrich Weigand + + * config/s390/s390.c (legitimize_address): Optimize loading + of large displacements. + +2002-08-14 Douglas B Rupp + + * config/alpha/alpha-protos.h: Update. + + * config/alpha/alpha.c: (LINKAGE_SYMBOL_REF_P): New macro. + (alpha_legitimate_address_p): Test LINKAGE_SYMBOL_REF_P. + (alpha_linkage_symbol_p): New static function. + (print_operand_address): Print linkage operand. + + (alpha_funcs_num, alpha_funcs_tree, alpha_links_tree): New static + variables. + (reloc_kind): New enum. + (struct alpha_funcs): New struct. + (struct alpha_links): Add reloc_kind field. Rename links_kind field. + + (alpha_need_linkage): Rewrite. + (alpha_use_linkage): New global function. + (alpha_write_linkage): Rewrite and make static. + (alpha_write_one_linkage): Rewrite + + (alpha_start_function): Remove procedure descriptor output. + (alpha_end_function): Write linkages at end of each function. + + * config/alpha/alpha.md (call_vms, call_value_vms): Rewrite. + (call_vms_1, call_value_vms_1): Rewrite. + + * config/alpha/vms.h (ASM_FILE_END): Remove. + +2002-08-14 Richard Henderson + + * ggc-page.c (RTL_SIZE): New. + (extra_order_size_table): Add specializations for 2 and 10 rtl slots. + * rtl.def (BARRIER, NOTE): Pad to 9 slots. + +2002-08-14 Richard Henderson + + * calls.c: Include target.h. + * Makefile.in (calls.o): Update. + + * config/alpha/alpha.c (alpha_end_function): Use targetm.binds_local_p. + * config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Likewise. + +2002-08-14 Richard Henderson + + * Makefile.in (LOOSE_WARN): Add -fno-common. + * c-common.h (constant_string_class_name): Add missing extern. + +2002-08-15 Neil Booth + + PR preprocessor/7358 + * c-opts.c (check_deps_environment_vars): Ignore main file + for SUNPRO_DEPENDENCIES. + * cppfiles.c (stack_include_file): Ignore main file if + appropriate. + * cpplib.h (struct cpp_options): New member in deps. + * doc/cppenv.texi: Update. + +2002-08-14 Neil Booth + + PR preprocessor/7526 + * cpplib.c (run_directive): Kludge so _Pragma dependency works. + +2002-08-14 Nathan Sidwell + + * doc/invoke.texi (-a): Remove documentation. + (-fprofile-arcs): Remove reference to -a, -ax options. + * doc/gcov.texi (Gcov Data Files): Data might be merged. + +2002-08-14 Gabriel Dos Reis + + Fix PR/7566 + * c-semantics.c (genrtl_case_label): Don't (mis)use + warning_with_decl. + +2002-08-14 Dale Johannesen + + * explow.c (emit_stack_restore): Emit memory clobbers + preceding the stack pop, to prevent the scheduler from + moving refs to variable arrays below this pop. + * reload1.c (reload): Preserve these clobbers for sched2. + * doc/rtl.texi: Document clobber (mem:BLK (scratch)). + +2002-08-14 Neil Booth + + * c-opts.c (c_common_post_options): Correct test. + +2002-08-14 Kaveh R. Ghazi + + * m88k.h (ASM_OUTPUT_SOURCE_FILENAME): Fix incorrect argument + order in call to fprintf. + +2002-08-14 Rainer Orth + + * config/sparc/sol2.h (SUBTARGET_EXTRA_SPECS): Define. + +2002-08-14 Ulrich Weigand + + * reload.c (find_reloads): Handle constraint letters marked by + EXTRA_ADDRESS_CONSTRAINT and EXTRA_MEMORY_CONSTRAINT. + (alternative_allows_memconst): Likewise. + * reload1.c (maybe_fix_stack_asms): Likewise. + * recog.c (asm_operand_ok, preprocess_constraints, + constrain_operands): Likewise. + * regclass.c (record_operand_costs, record_reg_classes): Likewise. + * local-alloc.c (block_alloc, requires_inout): Likewise. + * stmt.c (parse_output_constraint, parse_input_constraint): Likewise. + + * defaults.h (EXTRA_MEMORY_CONSTRAINT): Provide a default. + (EXTRA_ADDRESS_CONSTRAINT): Likewise. + * doc/tm.texi: Document these two new target macros. + + * config/s390/s390.c (s390_expand_plus_operand): Accept already + valid operands. + (q_constraint): New function. + config/s390/s390-protos.h (q_constraint): Declare it. + config/s390/s390.h (EXTRA_CONSTRAINT): Use it. + (EXTRA_MEMORY_CONSTRAINT): New macro. + + * config/s390/s390.md: Throughout the machine description, + replace all instances of the constraint combinations 'Qo' + or 'oQ' with simply 'Q'. + +2002-08-14 Stephane Carrez + + * config/m68hc11/m68hc11.h (LINK_SPEC): Support -mrelax. + * config/m68hc11/t-m68hc11-gas (LIBGCC2_DEBUG_CFLAGS): Can use -g now. + (LIBGCC2_CFLAGS): Compile with -mrelax. + +2002-08-14 Stephane Carrez + + * doc/invoke.texi: Document -minmax for 68HC12. + + * config/m68hc11/m68hc11.md ("umaxqi3"): Use TARGET_MIN_MAX. + ("uminqi3"): Likewise. + ("uminhi3", "umaxhi3"): Likewise. + + * config/m68hc11/m68hc11.h (MASK_MIN_MAX): Define. + (TARGET_MIN_MAX): Define. + (TARGET_SWITCHES): New option -minmax/-mnominmax. + +2002-08-14 Stephane Carrez + + * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Build __far_trampoline. + (MULTILIB_OPTIONS): Must also generate for -mlong-calls. + + * config/m68hc11/larith.asm: Put a mode for ELF ABI flags. + (ret, declare, farsym): New gas macros. + (__premain, exit, abort, _cleanup, memcpy, memset, ___adddi3, + ___subdi3, ___notdi2, __mulhi32, __mulsi3): Use them to use 'rtc' + and declare the symbol far when compiled with -mlong-calls. + (__far_trampoline): New for 68HC12 trampoline code to invoke a + far handler using jsr/bsr. + + * config/m68hc11/m68hc11-crt0.S: Put a mode for ELF ABI flags. + (jsr): New macro to transform a 'jsr' into a 'call'. + +2002-08-14 Stephane Carrez + + * doc/invoke.texi: Document -mlong-calls for 68HC12. + + * config/m68hc11/m68hc11.h (CPP_SPEC): Pass -D__USE_RTC__ when + -mlong-calls is specified. + (ASM_DECLARE_FUNCTION_NAME): Define to generate .far and .interrupt + assembler directives. + (TARGET_LONG_CALL, MASK_LONG_CALL): Declare. + (TARGET_SWITCHES): Add -mlong-calls options. + (current_function_far): Declare. + + * config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset): Take + into account the page register saved on the stack. + (m68hc11_override_options): Take into account -mlong-calls option. + (m68hc11_asm_file_start): Put a mode for the ELF flags ABI. + + * config/m68hc11/m68hc11.md ("*return_32bit"): Return rtc + if the function is going to be in 68HC12 banked memory (-mlong-calls). + ("*return_16bit"): Likewise. + ("*return_void"): Likewise. + ("call", "call_value"): Use call for a far function call. + +2002-08-14 Neil Booth + + * toplev.c (parse_options_and_default_flags): Don't call + post_options here. + (general_init): Initialize GC, pools and tree hash here, + instead of lang_independent_init. + (lang_independent_init): Rename backend_init. + (do_compile): Call post_options hook; exit early if there + have been errors after switch processing. + (toplev_main): Update. + +2002-08-14 Gabriel Dos Reis + + * c-pretty-print.h: Guard against multiple inclusion. + Robustify macros. + (pp_c_attributes): Declare. + * c-pretty-print.c (pp_c_attributes): New function. + +2002-08-13 Kaveh R. Ghazi + + * m68k.c (m68k_output_function_prologue, + m68k_output_function_epilogue): Delete versions for DPX2/MOTOROLA + and NEWS/MOTOROLA. + * genattrtab.c: Remove dpx2 comment. + * libgcc2.c (__enable_execute_stack): Delete versions for + NeXT/__MACH__, __convex__, __sysV88__, __pyr__ and + sony_news/SYSTYPE_BSD. + * longlong.h: Delete code for __a29k__, _AM29K, __clipper__, + __gmicro__, __i860__, __NeXT__ and __pyr__. + * rtl.h: Remove convex comment. + * varasm.c: Likewise. + +2002-08-13 Kaveh R. Ghazi + + * c-opts.c (lang_flags): Const-ify. + * ra-build.c (undef_table): Likewise. + * ra.c (eliminables): Likewise. + +2002-08-14 Gabriel Dos Reis + + * tree.h: Guard against multiple inclusion. + +2002-08-14 Hans-Peter Nilsson + + * reload1.c (reload_cse_simplify): Before checking + REG_FUNCTION_VALUE_P, check REG_P. + +2002-08-13 Geoffrey Keating + + * Makefile.in (attribs.o): Remove $(OBSTACK_H) dependency. + +2002-08-13 Neil Booth + + * c-opts.c (c_common_init_options): Extra braces needed. + +Tue Aug 13 17:40:25 2002 J"orn Rennecke + + * sh.c (sh_init_builtins): Add PARAMS to declaration. + (sh_media_init_builtins, sh_expand_builtin): Likewise. + (sh_expand_unop_v2sf): Use PARAMS for variable declaration. + (sh_expand_binop_v2sf): Likewise. + * sh-protos.h (sh_expand_unop_v2sf): Add PARAMS to declaration. + (sh_expand_binop_v2sf, sh_cfun_interrupt_handler_p): Likewise. + (sh_initialize_trampoline): Likewise. + +2002-08-13 Ulrich Weigand + + * s390-modes.def [CCL1, CCL2, CCT1, CCT2, CCT3, CCUR, CCSR]: Declare + new condition code modes. + s390.c (s390_match_ccmode_set): Handle those new CC modes. + (s390_select_ccmode): Likewise. + (s390_branch_condition_mask): Likewise. + + * s390-protos.h (s390_tm_ccmode): Declare. + s390.c (s390_tm_ccmode): New function. + (s390_match_ccmode): Allow VOIDmode as REQ_MODE. + + * s390.md ("*cmpdi_tm2"): Rename to "*tmdi_ext". + ("*cmpsi_tm2"): Rename to "*tmsi_ext". + ("*cmpqi_tm2"): Rename to "*tmqi_ext". + + ("*cmpdi_tm_reg", "*cmpdi_tm_mem", "*cmpsi_tm_reg", "*cmpsi_tm_mem", + "*cmphi_tm_sub","*cmphi_cct_0", "*cmpqi_tm", "*cmpqi_tm_sub", + "*cmpqi_cct_0", "*tm_0"): Remove, replace by ... + ("*tmdi_reg", "*tmsi_reg", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem", + "*tmqi_mem", "*tmhi_full", "*tmqi_full"): ... these new patterns. + + ("*ltgr", "*cmpdi_ccs_0_64", "*cmpdi_ccs_0_31", "*ltr", "*icm15", + "*icm15_cconly", "*cmpsi_ccs_0", "*icm3", "*cmphi_ccs_0", "*icm1", + "*cmpqi_ccs_0"): Remove, replace by ... + ("*tstdi_sign", "*tstdi", "*tstdi_cconly", "*tstdi_cconly_31", + "*tstsi", "*tstsi_cconly", "*tstsi_cconly2", "*tsthi", "*tsthi_cconly", + "*tstqi", "*tstqi_cconly"): ... these new patterns. + + ("*cmpsidi_ccs"): Remove, replace by ... + ("*cmpsi_ccs_sign"): ... this new pattern. + ("*cmpdi_ccs_sign", "*cmpdi_ccu_zero"): New patterns. + + ("*cmpqi_ccu_0", "*cmpqi_ccu_immed"): Remove, replace by ... + ("*cli"): ... this new pattern. + + ("*adddi3_sign", "*adddi3_zero_cc", "*adddi3_zero_cconly", + "*adddi3_zero", "*adddi3_cc", "*adddi3_cconly", "*adddi3_cconly2"): + New patterns. + ("adddi3_64"): Rename to "*adddi3_64". + ("adddi3_31"): Replace by insn and splitter "*adddi3_31". + ("adddi3"): Adapt expander. + + ("*addsi3_cc"): Allow "general_operand" for operand 2. + ("*addsi3_carry1_cc", "*addsi3_carry1_cconly", + "*addsi3_carry2_cc", "*addsi3_carry2_cconly"): New patterns. + + ("addhi3", "addqi3"): Remove, replace by ... + ("*addsi3_sign", "*addsi3_sub"): ... these new patterns. + + ("*subdi3_sign", "*subdi3_zero_cc", "*subdi3_zero_cconly", + "*subdi3_zero", "*subdi3_cc", "*subdi3_cconly"): New patterns. + ("subdi3"): Replace by insn and splitter "*subdi3_31". + ("subdi3"): New expander. + + ("*subsi3_borrow_cc", "*subsi3_borrow_cconly"): New patterns. + + ("subhi3", "subqi3"): Remove, replace by ... + ("*subsi3_sign", "*subsi3_sub"): ... these new patterns. + + ("*muldi3_sign"): New pattern. + ("muldi3"): Do not clobber CC. + ("mulsi3"): Likewise. + ("mulsi_6432"): Likewise. + +2002-08-13 Denis Chertykov + + * config/avr/avr.md: Call CC_STATUS_INIT in all peepnoles + which can change CC0. + +Tue Aug 13 14:49:20 2002 J"orn Rennecke + + * gcse.c (adjust_libcall_notes): New function. + (do_local_cprop): Use it. Add fourth parameter. Changed caller. + +2002-08-13 Nathan Sidwell + + * libgcc2.c (L_bb): Remove unneeded #includes. + (__global_counters, __gthreads_active): Remove unused globals. + (__bb_exit_func): Merge counts into files rather than appending. + * Makefile.in (INTERNAL_CFLAGS): Move COVERAGE_FLAGS from here ... + (ALL_CFLAGS): ... to here. + +2002-08-13 Denis Chertykov + + * config/ip2k/ip2k.c (commands_in_file): Variable removed. + (function_epilogue): Don't calculate function size. + (ip2k_set_compare): Don't use lookup_const_double. + (asm_file_start): Initialization of commands_in_file removed. + (asm_file_end): Output of commands_in_file removed. + + * config/ip2k/ip2k.c (CPP_PREDEFINES): Remove definition of + __INT_MAX__. + +2002-08-13 Neil Booth + + * c-opts.c (c_common_init_options): Check option array is + sorted if checking enabled. + +2002-08-13 Gabriel Dos Reis + + * c-pretty-print.c: #include "c-tree.h". + (pp_c_simple_type_specifier): Tweak. + (pp_c_storage_class_specifier): New. + (pp_c_function_specifier): Likewise. + (pp_c_declaration_specifiers): Likewise. + (pp_c_init_declarator): Likewise. + (pp_c_declaration): Likewise. + (pp_c_direct_declarator): Stub. + (pp_c_declarator): Likewise. + (pp_c_parameter_declaration): Likewise. + +2002-08-13 Neil Booth + + * c-opts.c (deps_seen, deps_file, deferred_count, deferred_size, + handle_deferred_opts, sanitize_cpp_opts, defer_opt, + struct deferred_opt): New. + (COMMAND_LINE_OPTIONS): Add -M*. + (missing_arg): Update. + (c_common_decode_option): Handle -M*. + (c_common_post_options): Handle -M*. Use sanitize_cpp_opts; + don't call cpp_post_options. + (c_common_finish, check_deps_environment_vars): Update. + * cppfiles.c (stack_include_file, handle_missing_header): Update. + * cpphash.h (CPP_PRINT_DEPS): Remove. + * cppinit.c: Don't include version.h. + (cpp_create_reader): Don't call deps_init. Initialize + warn_long_long. + (cpp_read_main_file): Init deps if necessary. + (cpp_destroy): Conditionally free deps. + (cpp_finish): Update. + (no_tgt): Remove. + (COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*. + (cpp_post_options): Rename post_options. + * cpplib.h (struct cpp_options): Remove some dependency options; + move others to a new structure. + (cpp_post_options): Remove. + (cpp_finish): Comment. + * fix-header.c (read_scan_file): Don't call cpp_post_options. + +2002-08-12 Hans-Peter Nilsson + + * config/mmix/mmix.md (define_constants): Add MMIX_rR_REGNUM. + ("divdi3", "*divdi3_nonknuth", "moddi3", "*moddi3_nonknuth"): Mark + MMIX_rR_REGNUM as clobbered. + * config/mmix/mmix.h (MMIX_REMAINDER_REGNUM): Use MMIX_rR_REGNUM. + +2002-08-12 Gabriel Dos Reis + + * diagnostic.h (output_formatted_scalar): Rename from + output_formatted_integer. + * diagnostic.def: Add DK_DEBUG. + * diagnostic.c (output_decimal): Adjust. + (output_long_decimal): Likewise. + (output_unsigned_decimal): Likewise. + (output_octal): Likewise. + (output_long_octal): Likewise. + (output_hexadecimal): Likewise. + (output_long_hexadecimal): Likewise. + * c-pretty-print.c (pp_c_type_specifier): New function. + (pp_c_specifier_qualifier_list): Likewise. + (pp_c_abstract_declarator): Likewise. + (pp_c_char): Replace pp_format_integer with pp_format_scalar. + +2002-08-12 David Edelsohn + + * doc/trouble.texi (Disappointments): Add static constructor and + destructor dependency information for AIX. + +2002-08-12 Neil Booth + + * cpphash.h (struct printer): New from cppmain.c. + (cpp_reader): New member. + * cppmain.c (struct printer): Move to cpphash.h. + (options, print): Remove. + (account_for_newlines, print_line, maybe_print_line, + cpp_preprocess_file, setup_callbacks, scan_translation_unit, + scan_translation_unit_trad, cb_line_change, cb_ident, + cb_define, cb_undef, cb_include, cb_file_change, dump_macro, + cb_def_pragma): Make reentrant. + +2002-08-12 Kaveh R. Ghazi + + * real.c (ieee_64): Always define. + (ieee_113): Guard with INTEL_EXTENDED_IEEE_FORMAT == 0. + (dec_h): Not used yet, hide it. + (emdnorm): Mark parameter in ATTRIBUTE_UNUSED. Guard label with + macro controlling use. + (TFbignan, TFlittlenan): Guard with INTEL_EXTENDED_IEEE_FORMAT == 0. + +Mon Aug 12 12:48:20 CEST 2002 Jan Hubicka + + * i386.md (tablejump): Sign extend the operand. + * i386.c (classify_argument): Fix missed case from previous patch. + +2002-08-12 Neil Booth + + * c-common.c (STDC_0_IN_SYSTEM_HEADERS, c_common_init): Move + to c-copts.c. + (warn_multichar): Die. + (cb_register_builtins): Export. + * c-common.h (warn_multichar, preprocess_file): Remove. + (cb_register_builtins): New. + * c-lang.c (c_init): Remove. + (LANG_HOOKS_INIT): Use c_objc_common_init. + * c-lex.c (init_c_lex): Don't canonicalize filename. + * c-opts.c (in_fname, STDC_0_IN_SYSTEM_HEADERS): New. + (preprocess_file): Make static. Update for cpplib. + (c_common_decode_option): Remove warn_multichar. Use in_fname. + (c_common_post_options): Set some cpp options here. + (c_common_init): Move from c-common.c. + * cppinit.c (cpp_post_options): Don't canonicalize in_fname. + * cpplib.h (struct cpp_options): Remove in_fname. + (cpp_preprocess_file): Update. + * cppmain.c (cpp_preprocess_file): Update for new prototypes. + +2002-08-11 Kaveh R. Ghazi + + * config.gcc (mips*-*-netbsd*): Include ${tm_file}. + +2002-08-11 Kaveh R. Ghazi + + * i370.h (TARGET_CPU_CPP_BUILTINS): Remove spurious trailing + backslash in comment preceeding macro definition. + * i370/linux.h (TARGET_OS_CPP_BUILTINS): Likewise. + * i370/mvs.h (TARGET_OS_CPP_BUILTINS): Likewise. + * i370/oe.h (TARGET_OS_CPP_BUILTINS): Likewise. + +2002-08-12 Hans-Peter Nilsson + + * expr.c (store_expr): In condition for checking if value is + generated in TARGET, move call to expr_size last. + +2002-08-11 Neil Booth + + * c-common.c (c_common_init): Call preprocess_file instead. + (c_common_finish): Move to c-opts.c. + * c-common.h (preprocess_file): new. + * c-opts.c (out_fname, out_stream, deps_append, preprocess_file, + check_deps_environment_vars, c_common_finish): New. + (c_common_decode_option): Update for out_fname and dependencies. + * cppinit.c (init_dependency_output, output_deps): Remove. + (cpp_destroy): Update prototype. + (cpp_add_dependency_target): New. + (cpp_read_main_file): Don't overlay a buffer. + (cpp_finish): Take a deps output stream and write deps to it. + Return the error count. + (cpp_post_options): Don't canonicalize out_fname, or do anything + with dependencies. + * cpplib.h (struct cpp_options): Remove out_fname and + preprocess_only. + (cpp_add_dependency_target): New. + (cpp_destroy, cpp_finish, cpp_preprocess_file): Update. + * cppmain.c (cpp_preprocess_file): Update prototype. Don't + set preprocess_only. Don't handle the output stream directly. + +2002-08-11 Kaveh R. Ghazi + + * dsp16xx.c (print_operand): Fix format specifier. + * dsp16xx.md: Avoid automatic aggregate initialization. + * frv.h (REG_CLASS_FROM_LETTER): Avoid char as array index. + * h8300.c (emit_a_rotate, h8300_adjust_insn_length): Avoid U + integer constant modifier. + * ip2k.c (ip2k_set_compare): Avoid signed/unsigned warning. + * mmix-protos.h (mmix_use_simple_return): Move outside TREE_CODE + guards. + * sh/netbsd-elf.h (FUNCTION_PROFILER): Fix format specifier. + * v850.c (v850_select_section): Mark parameter with + ATTRIBUTE_UNUSED. + * global.c (global_alloc): Const-ify. + * ra-colorize.c (hardregset_to_string): Fix format specifier. + +2002-08-11 Kaveh R. Ghazi + + * darwin-c.c (darwin_pragma_options): Const-ify. + * darwin.c (machopic_non_lazy_ptr_name, + machopic_validate_stub_or_non_lazy_ptr): Likewise. + (machopic_indirect_data_reference): Wrap variables in macros + controlling their use. + (machopic_finish, update_non_lazy_ptrs, update_stubs): Const-ify. + (machopic_select_section): Use parentheses around && within ||. + * i386/darwin.h (ASM_OUTPUT_ALIGN): Avoid ambiguous-else. + +2002-08-11 Kaveh R. Ghazi + + * ip2k.c (mdr_resequence_xy_yx, mdr_propagate_reg_equivs, + mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, + ip2k_adjust_stack_ref, mdr_try_move_pushes, mdr_try_propagate_clr, + ip2k_xexp_not_uses_reg_for_mem, mdr_try_propagate_move, + mdr_try_remove_redundant_insns, track_w_reload, + mdr_try_wreg_elim): Make function static to match prototype. + * mmix.c (mmix_target_asm_function_epilogue): Likewise. Mark + parameter with ATTRIBUTE_UNUSED. + +2002-08-11 Kaveh R. Ghazi + + * arc.c (arc_init): Don't use ISO C style function definitions. + * arm.c (count_insns_for_constant, thumb_far_jump_used_p, + arm_get_strip_length, arm_strip_name_encoding): Likewise. + * avr.h (progmem_section): Likewise. + * h8300.c h8300_asm_insn_count): Likewise. + * m32r.c (init_idents): Likewise. + * s390.c (s390_split_branches, s390_chunkify_pool): Likewise. + * sh.c (sh_cfun_interrupt_handler_p): Likewise. + * xtensa.c (xtensa_build_va_list): Likewise. + +2002-08-11 Neil Booth + + * c-common.h (enum c_language_kind): Emphasize that clk_c is 0. + * c-opts.c (parse_option): Rename find_opt. + (set_std_c99): New function. + (COMMAND_LINE_OPTIONS): Handle -remap and -o. Remove OPT_std_bad. + (missing_arg): Remove OPT_std_bad. Handle -o. + (c_common_decode_option): Handle input and output file names, + -o and -remap. Clean up -std= handling. + * cppinit.c (COMMAND_LINE_OPTIONS): Remove OPT_o and OPT_remap. + (cpp_handle_option): Similarly. Don't handle filenames. + +Sun Aug 11 14:43:17 CEST 2002 Jan Hubicka + + * i386.c (classify_argument): Fix computing of field's offsets. + +2002-08-11 Andreas Jaeger + + PR target/7531: + * doc/invoke.texi (i386 and x86-64 Options): Document -mcmodel. + +2002-08-10 Ziemowit Laski + + * config/alpha/alpha.h (TARGET_CPU_CPP_BUILTINS): Replace + reference to clk_objective_c with flag_objc. + * config/i386/i386-interix.h (TARGET_OS_CPP_BUILTINS): + Likewise. + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Likewise. + +2002-08-10 Neil Booth + + * c-opts.c (set_std_cxx98, set_std_c89): New. + (COMMAND_LINE_OPTIONS): Move more from cppinit.c. + (c_common_decode_option): Handle new switches from cppinit.c. + Add -std=gnu++98. + * cppinit.c (set_lang): Rename cpp_set_lang. Export. + (no_arg, no_num): Remove. + (COMMAND_LINE_OPTIONS): Move more to c-opts.c. Drop all lang- + switches apart from -lang-objc and lang-asm. + (cpp_handle_option): Similarly. + * cpplib.h (cpp_set_lang): New. + * doc/cppopts.texi, doc/invoke.texi: Document -std=c++98, + -std=gnu++98. + * objc/lang-specs.h: Remove -ansi. + +Sat Aug 10 19:59:43 CEST 2002 Jan Hubicka + Graham Stott + + * cfg.c (redirect_edge_succ_nodup): Avoid overflows due to roundoff + errors. + +2002-08-10 Kaveh R. Ghazi + + * emit-rtl.c (emit_jump_insn_before, emit_call_insn_before, + emit_jump_insn): Fix uninitialized variable. + * gcov.c (init_line_info): Likewise. + * genautomata.c (transform_3): Add braces around ambiguous + else. + * ifcvt.c (cond_exec_process_insns): Mark parameter with + ATTRIBUTE_UNUSED. + * ra-build.c (parts_to_webs_1): Fix uninitialized variable. + * regrename.c (copyprop_hardreg_forward): Fix uninitialized + variable. + + * gengtype.c (write_gc_structure_fields): Avoid signed/unsigned + warnings in output files. + +2002-08-09 Ziemowit Laski + + * c-common.c (flag_objc): New. + * c-common.h (c_language_kind): Get rid of clk_objective_c + enum value. + (flag_objc): New extern declaration. + * c-decl.c (implicitly_declare): Call objc_check_decl + instead of maybe_objc_check_decl. + (finish_decl): Likewise. + (grokfield): Likewise. + (finish_struct): Likewise. + * c-lang.c (maybe_objc_check_decl): Rename to objc_check_decl. + (maybe_objc_comptypes): Rename to objc_comptypes. + (maybe_building_objc_message_expr): Rename to + objc_message_selector. + * c-lex.c (lex_charconst): Remove uses of clk_objective_c, + replace with flag_objc as needed. + * c-opts.c (c_common_init_options): Likewise. + (c_common_decode_option): Likewise. + * c-parse.in (init_reswords): Likewise. + * c-tree.h (maybe_objc_check_decl): Rename to objc_check_decl. + (maybe_objc_comptypes): Rename to objc_comptypes. + (maybe_building_objc_message_expr): Rename to + objc_message_selector. + * c-typeck.c (comptypes): Call objc_comptypes instead of + maybe_objc_comptypes, and/or objc_message_selector instead of + maybe_building_objc_message_expr. + (comp_target_types): Likewise. + (convert_for_assignment): Likewise. + (warn_for_assignment): Likewise. + * cppinit.c (init_builtins): Set __OBJC__ manifest constant + independently of those for other languages. + * objc/objc-act.c (maybe_objc_comptypes): Delete. + (maybe_objc_check_decl): Delete. + (maybe_building_objc_message_expr): Rename to + objc_message_selector. + * objc/objc-lang.c (objc_init_options): Use clk_c instead of + clk_objective_c; set flag_objc flag. + +2002-08-09 Toshiyasu Morita + + * ifcvt.c (find_if_case_2): Test correct basic block for size. + +2002-08-09 Dale Johannesen + + * config/rs6000/rs6000.md: Add sibcall patterns. + * config/rs6000/rs6000.h (FUNCTION_OK_FOR_SIBCALL): Define. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): + Rewritten to handle sibcalls. + * config/rs6000/rs6000.c (function_ok_for_sibcall): New. + * config/rs6000/rs6000-protos.h (function_ok_for_sibcall): New. + +2002-08-08 Nathan Sidwell + + * profile.c (da_file_name): New static var. + (init_branch_prob): Initialize it. + (end_branch_prob): Remove da file. + + * Makefile.in (stage1_build): Pass empty COVERAGE_FLAGS. + * configure.in (coverage_flags): Default to nothing. + * configure: Rebuilt. + +2002-08-09 Neil Booth + + * Makefile.in (c-opts.o): Update + * c-opts.c: Include intl.h. + (print_help): Move from cppinit.c. Remove unused options. + (COMMAND_LINE_OPTIONS): Move more from cppinit.c. + (missing_arg): Complain for switches without an argument. + (c_common_decode_option): Reject missing joined arguments. + Handle new switches from cppinit.c. + * cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c. + (cpp_handle_option): Similarly. + (print_help): Moved to c-opts.c. + * cpplib.h (struct cpp_options): Remove help_only. + * gcc.c (cpp_unique_options): Remove -$. + * doc/cppopts.texi: Undocument -h. + +2002-08-08 Jakub Jelinek + + * config/i386/i386.c (legitimate_constant_p): UNSPEC_TP is not + legitimate constant. + (legitimate_pic_operand_p): Neither pic operand. + (legitimate_address_p): But legitimate address. + (get_thread_pointer): Generate MEM/u instead of CONST around + UNSPEC_TP. + (print_operand): Remove printing of UNSPEC_TP. + (print_operand_address): And print it here. + +2002-08-08 Devang Patel + + * objc/objc-act.c (build_selector_translation_table): Issue warning, + when -Wselector is used,if method for which selector is being + created does not exist. + +2002-08-08 Stephen Clarke + + * config/sh/sh.c (prepare_move_operands): Only call + target_reg_operand if TARGET_SHMEDIA. + +2002-08-08 Jakub Jelinek + + * config/rs6000/rs6000.h, config/rs6000/aix.h, + config/rs6000/darwin.h, config/rs6000/linux64.h: Revert last + two patches. + * config/rs6000/sysv4.h: Likewise, remove #undef ADJUST_FIELD_ALIGN. + +2002-08-08 Lars Brinkhoff + Richard Henderson + + * emit-rtl.c (gen_rtx_REG): After reload, only return + frame_pointer_rtx or hard_frame_pointer_rtx if frame_pointer_needed. + +2002-08-08 Jakub Jelinek + + * config/rs6000/rs6000-protos.h (rs6000_field_alignment): Remove. + * config/rs6000/rs6000.c (rs6000_field_alignment): Move... + * config/rs6000/rs6000.h (ADJUST_FIELD_ALIGN): ...inline into the + macro. + +2002-08-08 Adam Nemet + + * config/arm/arm.c (thumb_unexpanded_epilogue): Stack the PIC + register. + (thumb_expand_prologue): Likewise. + (thumb_output_function_prologue): Likewise. + * config/arm/arm.h (THUMB_INITIAL_ELIMINATION_OFFSET): Account for + the additional push of the PIC register. + +2002-08-08 Nathan Sidwell + + * configure.in (enable_coverage): New enable switch. + * configure: Rebuilt. + * Makefile.in (COVERAGE_FLAGS, coverageexts): New variables. + (INTERNAL_CFLAGS): Append COVERAGE_FLAGS. + (ALL_FLAGS): Reorder so INTERNAL_CFLAGS comes after CFLAGS. + (mostlyclean): Remove coverage files. + * doc/install.texi: Document enable_coverage. + + * cp/Make-lang.in (c++.mostlyclean): Remove coverage files. + * ada/Make-lang.in (ada.mostlyclean): Remove coverage files. + * f/Make-lang.in (f.mostlyclean): Remove coverage files. + * java/Make-lang.in (java.mostlyclean): Remove coverage files. + * objc/Make-lang.in (objc.mostlyclean): Remove coverage files. + * treelang/Make-lang.in (treelang.mostlyclean): Remove coverage + files. + +2002-08-08 Neil Booth + + * c-opts.c (cpp_opts): New. + (COMMAND_LINE_OPTIONS): Add switches from cppinit.c. + (c_common_decode_options): Handle cpplib switches. + (c_common_init_options): Set cpp_opts. + * cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c. + (cpp_handle_option): Similarly. + +2002-08-08 David Edelsohn + + * config/rs6000/aix.h (TARGET_ALTIVEC): Define to 0. + (TARGET_ALTIVEC_ABI): Same. + (TARGET_ALTIVEC_VRSAVE): Same. + + * config/rs6000/rs6000.c (rs6000_expand_ternop_builtin): Check + icode not CODE_FOR_nothing. Change switch to if. + +2002-08-08 Alan Modra + + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Pass -mpower4 when cpu=power4. + +2002-08-08 Jakub Jelinek + + * stor-layout.c (place_union_field): For bitfields if + PCC_BITFIELD_TYPE_MATTERS and TYPE_USER_ALIGN, set record's + TYPE_USER_ALIGN. + +2002-08-07 John David Anglin + + * pa.c (struct deferred_plabel): Constify name field. + +2002-08-07 Neil Booth + + * cppmacro.c (_cpp_builtin_macro_text): Remove unused variable. + +2002-08-07 John David Anglin + + * configure.in (PREFIX_INCLUDE_DIR): Don't define if prefix and + local_prefix are the same. + * configure: Rebuilt. + +2002-08-07 Jakub Jelinek + Richard Henderson + + * stor-layout.c (place_union_field): Apply ADJUST_FIELD_ALIGN + to type_align when PCC_BITFIELD_TYPE_MATTERS. Only apply + ADJUST_FIELD_ALIGN if not DECL_USER_ALIGN resp. TYPE_USER_ALIGN. + (place_field): Likewise. + * config/i386/i386.c (x86_field_alignment): Don't check + DECL_USER_ALIGN here. + * config/rs6000/rs6000.c (rs6000_field_alignment): New. + * config/rs6000/rs6000-protos.h (rs6000_field_alignment): New + prototype. + * config/rs6000/rs6000.h (ADJUST_FIELD_ALIGN): Define. + * config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Remove. + * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Remove. + * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Remove. + * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Remove. + * doc/tm.texi (ADJUST_FIELD_ALIGN): Update description. + +2002-08-07 Neil Booth + + * Makefile.in (c-opts.o, c-common.o, C_AND_OBJC_OBJS): Update. + * c-common.c: Don't include tree-inline.h. + (c_common_init_options, c_common_post_options): Move to c-opts.c. + * c-common.h (c_common_decode_option): New. + * c-decl.c (c_decode_option): Remove. + * c-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. + * c-opts.c: New file. + * c-tree.h (c_decode_option): Remove. + * doc/passes.texi: Update. + * objc/objc-act.c (objc_decode_option): Remove. + * objc/objc-act.h (objc_decode_option): Remove. + * objc/ojbc-lang.c (LANG_HOOKS_DECODE_OPTION): Use + c_common_decode_option. + +2002-08-07 Chris Demetriou + + * config/mips/mips.md (sunlt_sf, suneq_sf, sunle_sf): Remove + dependency on TARGET_DOUBLE_FLOAT. + +2002-08-07 Stephen Clarke + + * config/sh/lib1funcs.asm (GCC_shcompact_incoming_args): Don't + overwrite callee-save registers. Fix comment. + +2002-08-06 Chris Demetriou + + * config/mips/mips.c (override_options): Set MASK_BRANCHLIKELY + in target_flags based on ISA, if it was not set on the command + line. Warn if MASK_BRANCHLIKLEY is set but the ISA does not + support Branch Likely instructions. + * config/mips/mips.h (MASK_BRANCHLIKLEY): New macro. + (TARGET_BRANCHLIKELY): Likewise. + (TARGET_SWITCHES): Add -mbranch-likely and -mno-branch-likely. + (GENERATE_BRANCHLIKELY): Use TARGET_BRANCHLIKELY rather than + ISA_HAS_BRANCHLIKELY. + (ISA_HAS_BRANCHLIKELY): Do not include MIPS16 check. + * doc/invoke.texi: Document new MIPS -mbranch-likely and + -mno-branch-likely options. + +2002-08-06 Kaveh R. Ghazi + + * ip2k.c (ip2k_set_compare): Add missing iteration variable. + + * Makefile.in (dummy-conditions.o): Depend on $(HCONFIG_H) not + $(GCONFIG_H). + +2002-08-06 Aldy Hernandez + + * c-decl.c (duplicate_decls): Error out for incompatible TLS + declarations. + + * testsuite/gcc.dg/tls/diag-3.c: New. + +2002-08-06 Dale Johannesen + + * c-common.c (fname_decl): Use line number 0 for + __func__, to avoid confusing debuggers. + +2002-08-06 Nathan Sidwell + + * gcov.c: Tidy. + (struct line_info, struct coverage): New structures. + (gcov_file_name, gcov_file): Remove globals. + (output_data): Take source file parameter. Fix memory leak. Break + up into ... + (init_line_info, output_line_info, make_gcov_file_name, + accumulate_branch_counts): ... here. + (calculate_branch_probs, function_summary): Adjust. + (main): Adjust. + (function_*): Remove global variables. + +2002-08-06 Neil Booth + + * dwarf2out.c: Remove unused macros. + +2002-08-06 Neil Booth + + * function.c (TRAMPOLINE_ALIGNMENT): Always defined. + +2002-08-06 Neil Booth + + * cppinit.c (struct lang_flags): Rename trigraphs std. + (set_lang): Update. + * cpplib.h (struct cpp_options): New member std. + * cppmacro.c (_cpp_builtin_macro_text): Use std. + (collect_args): Flag whether to swallow a possible future + comma pasted with varargs. + (replace_args): Use this flag. + * doc/cpp.texi: Update varargs extension documentation. + +2002-08-06 Jakub Jelinek + + * config/i386/mmintrin.h (__m64): Make the type 64-bit aligned. + +2002-08-06 Jakub Jelinek + + * config/i386/i386.c (x86_field_alignment): Apply min for all MODE_INT + and MODE_CLASS_INT modes. + +2002-08-06 Jakub Jelinek + + * config.gcc (*-*-linux*): Default to --enable-threads=posix if no + --{enable,disable}-threads is given to configure. + (alpha*-*-linux*, hppa*-*-linux*, i[34567]86-*-linux*, + x86_64-*-linux*, ia64*-*-linux*, m68k-*-linux*, mips*-*-linux*, + powerpc-*-linux-gnualtivec*, powerpc-*-linux*, s390-*-linux*, + s390x-*-linux*, sh-*-linux*, sparc-*-linux*, sparc64-*-linux*): + Remove thread_file setting here. + +2002-08-06 David Edelsohn + + * doc/install.texi (Binaries): Update Bull Freeware URL. + +2002-08-06 Gerald Pfeifer + + * doc/gcc.texi (Top): Rename Index to Keyword Index. + +2002-08-05 Nathan Sidwell + + * gcov.c (output_data): Round to % to nearest, tweak formatting. + +2002-08-05 Jakub Jelinek + + * fold-const.c (associate_trees): Only optimize NEGATE_EXPR in one + of the operands into MINUS_EXPR if code is PLUS_EXPR. + +2002-08-05 Douglas B Rupp + + * config.gcc (i[34567]86-*-interix*): Replace interix.o with winnt.o + * config/i386/i386-interix.h (TARGET_NOP_FUN_DLLIMPORT, + drectve_section): Define. + * config/i386/t-interix: Replace interix.o rule with winnt.o. + * config/i386/interix.c: Remove. + +2002-08-05 Geoffrey Keating + + * attribs.c: Don't include obstack.h. + * builtins.c: Likewise. + * cfganal.c: Likewise. + * cfgbuild.c: Likewise. + * cfgcleanup.c: Likewise. + * emit-rtl.c: Likewise. + * loop.c: Likewise. + * stmt.c: Likewise. + + * Makefile.in (s-gtype): Re-add dependency on $(GTFILES). + +2002-08-05 Gabriel Dos Reis + + * doc/c-tree.texi (Expression trees): Document VA_ARG_EXPR + +2002-08-04 Chris Demetriou + + * doc/invoke.texi: Remove duplicated paragraph describing + TARGET_SWITCHES. + +2002-08-04 Geoffrey Keating + + * Makefile.in (sdbout.o): Doesn't need $(OBSTACK_H). + * collect2.h (permanent_obstack): Delete declaration. + * collect2.c (permanent_obstack): Delete definition. + (main): Don't initialize permanent_obstack. Use xstrdup instead. + * expr.c: Don't include obstack.h. + (permanent_obstack): Delete declaration. + * function.c: Don't include obstack.h. + (permanent_obstack): Delete declaration. + * integrate.c: Don't include obstack.h. + (function_maybepermanent_obstack): Delete declaration. + * print-tree.c (debug_tree): Use x*alloc not permalloc. + * sdbout.c (gen_fake_label): Use x*alloc not permalloc. + * tlink.c (pfgets): Use xstrdup not permanent_obstack. + * toplev.c (lang_independent_init): Rename init_obstacks to init_ttree. + * tree.h: Rename init_obstacks to init_ttree. Remove declarations + of permalloc, expralloc, perm_calloc. + * tree.c (permanent_obstack): Delete definition. + (init_ttree): Rename from init_obstacks. + (permalloc): Delete. + (perm_calloc): Delete. + (dump_tree_statistics): Don't print information about + permanent_obstack. + * varasm.c (assemble_start_function): Use xstrdup instead of + permalloc/strcpy. + (assemble_variable): Likewise. + * config/alpha/alpha.c (unicosmk_need_dex): Use xmalloc instead of + permalloc. + (unicosmk_add_extern): Likewise. + * config/c4x/c4x.c (c4x_external_ref): Likewise. + (c4x_global_label): Likewise. + * config/frv/frv.c (frv_encode_section_info): Likewise. + * config/i386/winnt.c (i386_pe_record_external_function): Likewise. + (i386_pe_record_exported_symbol): Likewise. + * config/mips/mips.c (mips_output_external): Likewise. + (mips_output_external_libcall): Likewise. + * config/pa/pa.c: (permanent_obstack): Delete declaration. + (output_call): Use ggc_strdup instead of allocating on + permanent_obstack. + * config/romp/romp.c: Include ggc.h. + (get_symref): Don't declare permanent_obstack, use ggc_strdup + intead of permanent_obstack. + * config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use concat + instead of permalloc. + * config/rs6000/rs6000.c (rs6000_gen_section_name): Use xmalloc + instead of permalloc + * config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Use concat + instead of permalloc. + * config/vax/vax.c (vms_check_external): Use xmalloc instead of + permalloc. + +2002-08-04 Bernd Schmidt + + Contribute a port developed primarily by Michael Meissner, + Catherine Moore, and Richard Sandiford . + * config.gcc: Add frv-elf target. + * config/frv/cmovd.c: New file. + * config/frv/cmovh.c: New file. + * config/frv/cmovw.c: New file. + * config/frv/frv-abi.h: New file. + * config/frv/frv-asm.h: New file. + * config/frv/frv-modes.def: New file. + * config/frv/frv-protos.h: New file. + * config/frv/frv.c: New file. + * config/frv/frv.h: New file. + * config/frv/frv.md: New file. + * config/frv/frvbegin.c: New file. + * config/frv/frvend.c: New file. + * config/frv/lib1funcs.asm: New file. + * config/frv/media.h: New file. + * config/frv/modi.c: New file. + * config/frv/t-frv: New file. + * config/frv/uitod.c: New file. + * config/frv/uitof.c: New file. + * config/frv/ulltod.c: New file. + * config/frv/ulltof.c: New file. + * config/frv/umodi.c: New file. + * config/frv/xm-frv.h: New file. + + * config/frv/media.h: Removed again. + +2002-08-04 Nathan Sidwell + + * gcov.c (bb_file_time): New static variable. + (object_directory): May also be object file. + (preserve_paths): New static variable. + (print_usage): Adjust. + (options): Adjust. + (process_args): Adjust. + (open_files): Simplify. Cope when OBJECT_DIRECTORY is an object + file. Find modification date on bb file. + (read_profile): Don't rewind a NULL file. + (format_hwint): New static function. + (function_summary): Use format_hwint. + (output_data): SOURCE_FILE_NAME is never relative to + OBJECT_DIRECTORY. Use format_hwint. Adjust gcov file name + mangling. Adjust output format to make it more machine readable. + * doc/gcov.texi: Document & clarify semantics. + +2002-08-04 Joseph S. Myers + + * doc/include/gcc-common.texi (version-GCC): Increase to 3.3. + +2002-08-04 Nathan Sidwell + + * gcc.c (cc1_options): Pass output file as auxbase when + appropriate. + * profile.c (init_branch_prob): FILENAME has already had ending + stripped. + * final.c (end_final): Likewise. + * toplev.c (aux_base_name): New global. + (compile_file): Pass aux_base_name to init init_branch_prob and + end_final. + (independent_decode_option, case 'a'): New auxinfo options. + (case 'd'): Protect against mising basename. + (do_compile): Initialize aux_base_name. + * toplev.h (aux_base_name): New global. + * doc/invoke.texi: Adjust documentation. + +2002-08-04 Nathan Sidwell + + * config/i386/i386.c (x86_field_alignment): Remove duplicate test + of TARGET_ALIGN_DOUBLE. + +2002-08-04 Gabriel Dos Reis + + * diagnostic.c (inform): New function. + * diagnostic.h (inform): Declare. + +2002-08-03 David Edelsohn + + * config/rs6000/rs6000.md (movsi_internal1): Add nop mnemonic. + (movhi_internal): Same. + (movqi_internal): Same. + (movdi_internal64): Same. + + * config/rs6000/t-ppccomm (MULTILIB_MATCHES_FLOAT): Add mcpu=405. + + * config/rs6000/xcoff.h (SKIP_ASM_OP): Define. + (ASM_OUTPUT_SKIP): Use it. SIZE unsigned. + (COMMON_ASM_OP): Define. + (ASM_OUTPUT_ALIGNED_COMMON): Use it. SIZE unsigned. + Use ALIGN parameter. + (LOCAL_COMMON_ASM_OP): Define. + (ASM_OUTPUT_LOCAL): Use it. SIZE unsigned. + +2002-08-03 Roger Sayle + + * builtins.def: Define new builtin functions exp, expf, expl, + log, logf and logl (and their __builtin_* variants). + * optabs.h (enum optab_index): Add new OTI_exp and OTI_log. + Define exp_optab and log_optab. + * optabs.c (init_optans): Initialize exp_optab and log_optab. + * genopinit.c (optabs): Implement exp_optab and log_optab + using exp?f2 and log?f2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXP* + and BUILT_IN_LOG* using exp_optab and log_optab respectively. + (expand_builtin): Ignore the new builtins (and all cos and + sin variants) when not optimizing. Expand new builtins via + expand_builtin_mathfn when flag_unsafe_math_optimizations. + + * doc/extend.texi: Document new exp and log builtins. + * doc/md.texi: Document new exp?f2 and log?f2 patterns + (and previously undocumented cos?f2 and sin?f2 patterns). + +2002-08-03 Jason Merrill + + * explow.c (int_expr_size): New fn. + * expr.c (expand_expr) [CONSTRUCTOR]: Use it. + * expr.h: Declare it. + +2002-08-02 Krister Walfridsson + + * Makefile.in (gengtype-lex.o, gengtype-yacc.o): Add path to + gengtype-* dependencies. + +2002-08-02 Eric Christopher + + * config.gcc (mips*-*-linux*): Fix ordering of tm_file. + * config/mips/mips.h (READONLY_DATA_SECTION_ASM_OP): Change + #ifndef to #undef. + (TARGET_MEM_FUNCTIONS): Define instead of define to 1. + +2002-08-02 David Edelsohn + + PR optimize/7067 + * config/rs6000/rs6000.h (RTX_COSTS): Artificially make MULT + small if optimizing for size. + +2002-08-02 Daniel Jacobowitz + + * configure.in (FORBUILD): Use $build_alias. + * configure: Regenerated. + +2002-08-02 Richard Sandiford + + * config.gcc: Don't include mips/abi64.h in $tm_file. + * hard-reg-set.h (call_really_used_regs): Declare. + * config/mips/abi64.h: Remove file. + * config/mips/linux.h, + * config/mips/iris6.h: Don't include it. + * config/mips/mips-protos.h (mips_conditional_register_usage): Declare. + * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Use it. + (REG_PARM_STACK_SPACE, STACK_BOUNDARY, STRICT_ARGUMENT_NAMING, + FUNCTION_ARG_PASS_BY_REFERENCE, FUNCTION_ARG_PADDING, + FUNCTION_ARG_CALLEE_COPIES, MUST_PASS_IN_STACK, MIPS_STACK_ALIGN): + Bring across definitions from abi64.h. + (GP_ARG_LAST, FP_ARG_LAST): Use MAX_ARGS_IN_REGISTERS. + (BIGGEST_MAX_ARGS_IN_REGISTERS): New. + (struct mips_args): Use it. + * config/mips/mips.c (mips_conditional_register_usage): Define. + +2002-08-02 Jason Merrill + + * langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro. + * langhooks.c (lhd_expr_size): Define default. + * langhooks.h (struct lang_hooks): Add expr_size. + * explow.c (expr_size): Call it. + * expr.c (store_expr): Don't copy an expression of size zero. + (expand_expr) [CONSTRUCTOR]: Use expr_size to calculate how much + to store. + * Makefile.in (builtins.o): Depend on langhooks.h. + +2002-08-02 Kaveh R. Ghazi + + * Makefile.in (ra-debug.o): Depend on $(TM_P_H). + * ra-debug.c: Include "tm_p.h". + * ra-rewrite.c (is_partly_live_1): Change return type to bool. + +2002-08-02 Toon Moene + + * simplify-rtx.c (simplify_binary_operation): x * 1 is allowed + when not honoring signalling NaNs. + (simplify_ternary_operation): a == b has a definite value + when not honoring NaNs. + +2002-08-02 Jason Merrill + + * gdbinit.in (pct): New macro. + +2002-08-01 Stan Shebs + Andreas Tobler + + * ginclude/stddef.h (_BSD_SIZE_T_DEFINED_): Define if not defined, + plays nice with Darwin headers. + (_BSD_RUNE_T_DEFINED_): Likewise. + +2002-08-01 Zack Weinberg + + * c-common.c (c_common_init): -Wtraditional also implies -Wlong-long. + * cppinit.c (cpp_post_options): Likewise. + + * cppexp.c (cpp_classify_number): Suppress -Wtraditional + warning about 'LL' suffix (but not 'ULL' etc) when + -Wno-long-long is in effect. + + * cppmacro.c (_cpp_builtin_macro_text) [BT_TIME, BT_DATE]: + Check for failing time()/localtime(), issue a warning, and + make __TIME__ and __DATE__ expand to fallback strings. + + * doc/cpp.texi, doc/extend.texi: Document behavior of __DATE__ + and __TIME__ when the date and time cannot be determined. + +2002-08-02 Alan Modra + + * config/rs6000/rs6000.c (output_cbranch): Hint differently for power4. + +2002-08-01 Daniel Jacobowitz + + * Makefile.in ($(BUILD_PREFIX_1)ggc-none.o): Use $(GGC_H). + +2002-08-01 Chris Demetriou + + * config.gcc (mipsisa64sb1-*-elf*): New configuration. + (mipsisa64sb1el-*-elf*): Likewise. + * config/mips/mips.c (mips_cpu_info_table): Add sb1. + * config/mips/mips.h (processor_type): Add PROCESSOR_SB1. + (TARGET_SB1, TUNE_SB1): New macros. + * doc/invoke.texi: Add sb1 to documentation for MIPS -march and + -mtune flags. + +2002-08-01 David Edelsohn + + * varasm.c (asm_emit_uninitialized): Return false if global BSS + and ASM_EMIT_BSS not supported by target. + (assemble_variable): Do not duplicate uninitialized logic. + Fall through if asm_emit_uninitialized failed. + +2002-08-01 Chris Demetriou + + * config/mips/mips.h (BRANCH_LIKELY_P): Remove unused macro. + +2002-08-02 Alan Modra + + * config/rs6000/linux64.h (DBX_OUTPUT_BRAC): Define. + (DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC): Define. + + * config/rs6000/rs6000.c (output_toc): Don't use lshift_double when + HOST_BITS_PER_WIDE_INT == 64. + +2002-08-01 Kaveh R. Ghazi + + * df.c (df_insn_table_realloc): Change parameter to unsigned. + * optabs.c (expand_binop): Make variable unsigned. + * simplify-rtx.c (simplify_subreg): Likewise. + * unroll.c (unroll_loop): Cast to avoid signed/unsigned warnings. + +2002-08-01 Franz Sirl + + * c-common.c (cb_register_builtins): Always define __GXX_ABI_VERSION. + +2002-08-01 Richard Henderson + + * toplev.c (parse_options_and_default_flags): Don't set + flag_reorder_blocks for -Os. + + * config/avr/avr.c (avr_optimization_options): Remove. + * config/avr/avr.h (OPTIMIZATION_OPTIONS): Remove. + * config/m68hc11/m68hc11.c (m68hc11_optimization_options): Remove. + * config/m68hc11/m68hc11.h (OPTIMIZATION_OPTIONS): Remove. + +2002-08-01 H.J. Lu + Richard Henderson + + * output.h (DECL_READONLY_SECTION): Remove. + (decl_readonly_section): Declare. + * varasm.c (decl_readonly_section): New. + (default_section_type_flags, default_select_section): Use it. + * config/arm/pe.c (arm_pe_unique_section): Likewise. + * config/i386/interix.c (i386_pe_unique_section): Likewise. + * config/i386/winnt.c (i386_pe_unique_section): Likewise. + * config/mcore/mcore.c (mcore_unique_section): Likewise. + * config/mips/mips.c (mips_unique_section): Likewise. + +2002-08-01 Richard Henderson + + * integrate.c (copy_rtx_and_substitute): Squash MEM_EXPR when it + refers to a subroutine parameter. + +2002-08-01 Jakub Jelinek + + * varasm.c (assemble_visibility): Strip name encoding. + +2002-08-01 Ian Dall + + * config/ns32k/ns32k.h (TARGET_IEEE_COMPARE): Correct earlier patch. + (RETURN_ADDR_RTX): Cannot determine return address for FRAME > 0 + when there is no frame pointer. + (INITIAL_FRAME_POINTER_OFFSET): Count stack space for saved fp + registers properly. + * config/ns32k/__unorddf2.c: New file. + * config/ns32k/__unordsf2.c: New file. + * config/ns32k/t-ns32k: New file. + * config.gcc (ns32k-*-netbsd*): Use it. + +2002-08-01 Aldy Hernandez + + * config/rs6000/rs6000.h (SPU_CONST_OFFSET_OK): Change to 0xff. + +2002-08-01 Neil Booth + + * c-common.c (__GXX_ABI_VERSION): Correct spelling. + +2002-08-01 Benjamin Kosnik + + * c-common.c (cb_register_builtins): Set __GXX_ABI_VERSION__ to 102. + +2002-08-01 Richard Sandiford + + * config/mips/mips.md: Add [!]TARGET_MIPS16 to sgtu conditions. + +2002-08-01 Zdenek Dvorak + + * gcse.c (expr_hash_table_size, n_exprs, set_hash_table_size, + n_sets): Removed. + (expr_hash_table, set_hash_table): Type changed to ... + (struct hash_table): New type. + (hash_scan_insn, hash_scan_set, hash_scan_clobber, hash_scan_call, + insert_expr_in_table, insert_set_in_table, compute_hash_table, + dump_hash_table, lookup_expr, lookup_set, compute_local_properties, + compute_ae_gen, compute_ae_kill): Modified to pass the table explicitly. + (alloc_set_hash_table, alloc_expr_hash_table): Merged to ... + (alloc_hash_table): New. + (free_set_hash_table, free_expr_hash_table): Merged to ... + (free_hash_table): New. + (compute_set_hash_table, compute_expr_hash_table): Merged to ... + (compute_hash_table_work): New. + (classic_gcse, one_classic_gcse_pass, compute_cprop_data, + find_avail_set, one_cprop_pass, find_bypass_set, compute_pre_data, + pre_edge_insert, pre_insert_copies, pre_delete, pre_gcse, + one_pre_gcse_pass, compute_transpout, compute_code_hoist_vbeinout, + hoist_code, one_code_hoisting_pass, + trim_ld_motion_mems): Altered due to changed type of hash tables. + +2002-08-01 Zack Weinberg + + * final.c (output_alternate_entry_point): + If ASM_OUTPUT_TYPE_DIRECTIVE is defined, use it. + +2002-08-01 Kaveh R. Ghazi + + * objc/objc-act.c (encode_complete_bitfield): Add prototype and + avoid ISO C style function definition. + + * expr.c (expand_assignment): Delete unused variable. + +2002-08-01 Toon Moene + + * c-common.c (cb_register_builtins): Set + __FINITE_MATH_ONLY__ to 1 if -ffinite-math-only + is given, and to 0 otherwise. + * combine.c (simplify_if_then_else): HONOR_NANS + implies FLOAT_MODE_P. + +2002-08-01 Neil Booth + + * cppinit.c (COMMAND_LINE_OPTIONS): Remove OPT_dollar. + (cpp_handle_option): Don't handle it. + (print_help): Update. + * doc/cppopts.texi: Update. + +2002-08-01 Neil Booth + + * c-common.c (cb_register_builtins): If C++, define + __EXCEPTIONS, __DEPRECATED and __GXX_ABI_VERSION as appropriate. + * gcc.c (cpp_unique_options): Remove __GXX_ABI_VERSION. +cp: + * lang-specs.h: Simplify in accordance with new code in + c-common.c. + +2002-08-01 Neil Booth + + * c-common.c: Define all C/ObjC/C++ warning and flag variables. + * c-common.h: Declare all C/ObjC/C++ warning and flag variables. + * c-decl.c: Move all warning and flag variables to c-common.c. + * c-format.c: Move all warning variables to c-common.c. + * c-tree.h: Move all warning and flag declarations to c-common.h. + * objc/objc-act.c: Move all warning variables to c-common.c. + (flag_warn_protocol): Rename warn_protocol. + +2002-07-31 John David Anglin + + * pa-linux.h (GLOBAL_ASM_OP): Fix typo. + +2002-07-31 Graham Stott + + * config/stormy16/stormy16.h (BSS_SECTION_ASM_OP): Add missing + .section prefix. + +2002-07-31 Stan Shebs + + * config.gcc (i[34567]86-*-darwin*): New configuration. + * config/darwin.h (TARGET_ENCODE_SECTION_INFO): Undefine before + defining. + (TARGET_ENCODE_SECTION_INFO): Ditto. + (ASM_PREFERRED_EH_DATA_FORMAT): Ditto. + * config/darwin.c (machopic_indirect_data_reference): Remove + setting of RTX_UNCHANGING_P. + (machopic_legitimize_pic_address): Move RTX_UNCHANGING_P up so as + not to be applied to sums. + * config/i386/t-darwin: New file. + * config/i386/darwin.h: New file. + * config/i386/i386.h (TARGET_MACHO): Add default definition. + * config/i386/i386.md (tablejump): Add TARGET_MACHO case. + * config/i386/i386.c (output_set_got): For Mach-O, output Mach-O + label and not the GOT add. + (constant_address_p): For Mach-O, seeing a CONST is enough. + (legitimate_pic_address_disp_p): Add a Mach-O case. + (legitimate_address_p): Also test machopic_operand_p if Mach-O. + (legitimize_pic_address): Use generic Mach-O code to legitimize. + (output_pic_addr_const): Suppress @PLT if Mach-O, and parens + if outputting a difference. + (ix86_output_addr_diff_elt): Add Mach-O case. + (ix86_expand_move): Similarly. + (ix86_expand_call): Similarly. + (current_machopic_label_num): New global. + (machopic_output_stub): New function. + (ix86_value_regno): New function. + (ix86_function_value): Use it instead of VALUE_REGNO. + (ix86_libcall_value): Ditto. + * config/i386/unix.h (VALUE_REGNO): Remove. + +2002-07-31 Graham Stott + + * config/rs6000/rs6000.c(rs6000_hash_constant): Fix + hash for LABEL_REF's. + +2002-07-31 Graham Stott + + * config/rs6000/rs6000.c (spe_init_builtins, + altivec_init_builtins, rs6000_common_init_builtins): + Replace ANSI with K&R function def. + +2002-07-31 David Edelsohn + + * rs6000.c (validate_condition_mode): Test flag_finite_math_only + for CCFPmode. + +2002-07-31 Richard Sandiford + + * config/mips/crtn.asm: Don't use __mips16 to determine the + return-address offset. Define RA to a suitable temporary + register for the return address. + +2002-07-31 Richard Sandiford + + * config/mips/mips.md (eh_set_lr_si, eh_set_lr_di): Change + constraints to 'd'. + +2002-07-30 Chris Demetriou + + * config/mips/elf.h (STARTFILE_SPEC): Define differently if + default ABI is MEABI. (Undoes incorrect change in Eric Christopher's + patch on 2002-07-29.) + * config/mips/elf64.h (STARTFILE_SPEC): Likewise. + +2002-07-30 Kaveh R. Ghazi + + * alpha.h, arc.h, arm/aout.h, avr.h, cris.h, d30v.h, dsp16xx.h, + fr30.h, h8300.h, i370.h, i386/sco5.h, i386/unix.h, i960.h, ia64.h, + ip2k.h, m32r.h, mcore.h, mips.h, mn10200.h, mn10300.h, ns32k.h, + openbsd.h, pa/pa-linux.h, pdp11.h, romp.h, rs6000/sysv4.h, + s390/linux.h, sh.h, sparc.h, stormy16.h, v850.h, vax.h, xtensa.h: + (ASM_GLOBALIZE_LABEL): Delete. + (GLOBAL_ASM_OP): Define. + + * m68hc11.h, m68k.h, m88k.h (ASM_GLOBALIZE_LABEL): Delete. + + * defaults.h (ASM_GLOBALIZE_LABEL): Provide a default. + * doc/tm.texi (ASM_GLOBALIZE_LABEL): Update docs. + +2002-07-30 Geoffrey Keating + + * doc/extend.texi (Hints implementation): Document that GCC + mostly ignores `register'. + +2002-07-30 Toon Moene + + * flags.h: Declare flag_finite_math_only. + Use it in definition of HONOR_NANS and + HONOR_INFINITIES. + * c-common.c (cb_register_builtins): Emit + __FINITE_MATH_ONLY__ when flag_finite_math_only + is set. + * combine.c (simplify_if_then_else): If + flag_finite_math_only is set, a == b has a + definite value. + * toplev.c: Initialize flag_finite_math_only. + (set_flags_fast_math): Set it on -ffast-math. + (flag_fast_math_set_p): Test it. + * doc/invoke.texi: Document -ffinite-math-only. + +2002-07-30 Richard Henderson + + * ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p. + (noce_process_if_block): Likewise. + +2002-07-30 Bernd Schmidt + + * ifcvt.c (cond_exec_process_if_block): Fix a merging error. + Bail out early if false_expr is NULL and we'd crash due to this. + * genemit.c (gen_expand): Recognize return insns even if the return + appears in a parallel. + * libgcc2.c: Expand macro DECLARE_LIBRARY_RENAMES if it is defined. + * config/fp-bit.c: Likewise. + * doc/tm.texi: Document it. + +2002-07-30 David Edelsohn + Zack Weinberg + + * rs6000.c (rs6000_expand_unop_builtin): Check icode not + CODE_FOR_nothing. Change switch to if. + (rs6000_expand_binop_builtin): Same. + (rs6000_expand_builtin): Expand builtin if target support enabled. + (rs6000_init_builtins): Init builtin if target support enabled. + (rs6000_common_init_builtins): Check icode not CODE_FOR_nothing. + +2002-07-30 Franz Sirl + + * gcc.c (cpp_unique_options): Define __GXX_ABI_VERSION, bump it to 101. + +2002-07-30 Richard Sandiford + + * config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Fix typo. + +Tue Jul 30 18:31:31 2002 J"orn Rennecke + + * sh.md (cond_delay_slot): New attribute. + (cbranch delay): Use it for anulled-true case. + (stuff_delay_slot): New pattern. + * sh.c (print_operand, case '.'): Don't print .s / /s fore zero-length + delay slot insn. + (gen_far_branch): Emit stuff_delay_slot pattern. + +Tue Jul 30 11:21:44 2002 J"orn Rennecke + + * unroll.c (copy_loop_body): Don't copy NOTE_INSN_LOOP_CONT. + +2002-07-30 Kazu Hirata + + * fold-const.c: Fix comment typos. + * gcse.c: Likewise. + * reload1.c: Likewise. + +2002-07-29 Aldy Hernandez + + * config/rs6000/rs6000.md: Disallow CCEQ compare with crnor/crnot + for TARGET_SPE. + +2002-07-30 Gabriel Dos Reis + + * c-pretty-print.h (pp_c_statement): Declare. + * c-pretty-print.c (pp_c_postfix_expression): #if 0 support for SRCLOC. + (pp_c_statement): Define. + +2002-07-30 Kaveh R. Ghazi + + * alpha.h, arc.h, arm/aout.h, avr.h, c4x.h, cris.h, d30v.h, + darwin.h, dsp16xx.h, fr30.h, h8300.h, i370.h, i386.h, i960.h, + ip2k.h, m32r.h, m68hc11.h, m68k.h, m88k.h, mcore.h, mips.h, + mn10200.h, mn10300.h, ns32k.h, pa/pa-linux.h, pdp11.h, romp.h, + rs6000/sysv4.h, s390/linux.h, sh.h, sparc.h, stormy16.h, + v850.h, vax.h, xtensa.h (ASM_OUTPUT_LABEL): Delete definition. + + * defaults.h (ASM_OUTPUT_LABEL): Provide a default. + * doc/tm.texi (ASM_OUTPUT_LABEL): Update docs. + +2002-07-30 Gabriel Dos Reis + + * c-pretty-print.c (pp_c_primary_expression): Handle STMT_EXPR. + (pp_c_postfix_expression): Handle ARROW_EXPR, FFS_EXPR, + COMPOUND_LITERAL_EXPR, VA_ARG_EXPR. + (pp_c_expression): Update. + +2002-07-29 Kaveh R. Ghazi + + * alpha/vms-cc.c (preprocess_args, main): Use xstrdup and/or + concat in lieu of xmalloc/strcpy/memcpy/sprintf. + * alpha/vms-ld.c (main): Likewise. + * dsp16xx.c (double_reg_to_memory): Likewise. + * mcore.c (mcore_expand_prolog): Likewise. + * cppfiles.c (read_name_map): Likewise. + * gensupport.c (process_rtx, identify_predicable_attribute, + alter_test_for_insn): Likewise. + * vmsdbgout.c (write_rtnbeg, vmsdbgout_init): Likewise. + +2002-07-29 Roger Sayle + + * builtins.c (expand_builtin): Change the default behavior to + only issue an error if the builtin function doesn't have a + fallback library call. Remove several cases handled by the + new default. + +2002-07-29 John David Anglin + + * real.c (ieee_24, ieee_53, ieee_64, ieee_113): Define only if the + floating point format of the target is IEEE. + * (dec_f, dec_d, dec_g, dec_h): Define only if the floating point + format of the target is DEC. + +2002-07-29 Richard Henderson + + * unroll.c (verify_addresses): Remove. + (find_splittable_givs): Never split DEST_ADDR givs. + +2002-07-29 Geoffrey Keating + + * doc/gty.texi (GGC Roots): Clarify that the list of syntaxes + is exhaustive. + (Files): Improve documentation on generated source files. + + * doc/extend.texi (Translation implementation): Document what + diagnostics look like. + (Identifiers implementation): Document that there's normally no + limit on identifier names. + (Integers implementation): Document two's complement. + (Hints implementation): Document that GCC honors 'inline', mostly. + (Preprocessing directives implementation): Document that GCC + requires the current time. + +2002-07-30 Gabriel Dos Reis + + * c-pretty-print.h (struct c_pretty_print_info): Add new member. + (pp_initializer): New macro. + (pp_c_initializer): Declare. + * c-pretty-print.c (pp_c_primary_expression): HAndle TARGET_EXPR. + (pp_c_initializer): Define. + (pp_c_initializer_list): New function. + (pp_c_postfix_expression): Handle ABS_EXPR, COMPLEX_CST, + VECTOR_CST, CONSTRUCTOR. + (pp_c_unary_expression): Handle CONJ_EXPR, REALPART_EXPR, + IMAGPART_EXPR. + (pp_c_cast_expression): Handle FLOAT_EXPR. + (pp_c_assignment_expression): Handle INIT_EXPR. + (pp_c_expression): Update. + +2002-07-30 Neil Booth + + * objc/objc-act.c (objc_init): Return immediately if filename + is NULL. + +2002-07-29 Eric Christopher + + * config/mips/elf.h: Remove ecoff.h and gofast includes. + (DWARF2_DEBUGGING_INFO, DBX_DEBUGGING_INFO): Define unconditionally. + (SDB_DEBUGGING_INFO): Undefine. + (PREFERRED_DEBUGGING_TYPE): Set to DWARF2_DEBUG. + (PUT_SDB_SIZE): Remove. + (SUBTARGET_ASM_DEBUGGING_SPEC): Redefine. + (STARTFILE_SPEC): Add isa3264 define. + * config/mips/elf64.h: Ditto. Move TARGET_MEM_FUNCTIONS from here... + * config/mips/ecoff.h: Remove. and here... + * config/mips/iris3.h: and here... + * config/mips/sni-svr4.h: and here... + * config/mips/mips.h: To here. Remove OBJECT_FORMAT_ROSE ifdefs. + Add assembler -mmdebug options for non-dwarf debugging. + * config/mips/r3900.h: Remove debug info defines. + * config/mips/isa32-linux.h: Remove, move functionality to config.gcc. + * config/mips/isa3264.h: Ditto. + * config/mips/t-isa3264: Fix up for file removal and gofast configure + change. + * config/mips/t-elf: Ditto. + * config/mips/t-ecoff: Ditto. + * config/mips/t-r3900: Ditto. + * config/mips/t-iris5-6: Ditto. + * config/mips/t-isa3264: Ditto. + * config/mips/t-linux: Remove. + * config/mips/t-netbsd: Remove. + * config/mips/t-mips: New file. + * config/mips/t-gofast: Ditto. + * config/mips/netbsd.h: Remove unnecessary undefines. + * config/mips/linux.h: Remove #include of mips.h. + * config.gcc: Add mips.h include for elf targets. Remove tm_file + for ecoff. Add gofast configure option for mips. + +2002-07-29 Chris Demetriou + + * configure.in (mips*-*-*): Add a test to see if MIPS libgloss + linker scripts use STARTUP directives consistently. + * configure: Regenerate. + * config.in: Regenerate. + * config/mips/elf.h (STARTFILE_SPEC): Define conditionally, based + on whether HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is defined. + * config/mips/elf64.h (STARTFILE_SPEC): Likewise. + * config/mips/isa3264.h (STARTFILE_SPEC): Do not redefine if + HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is set; the result + will be the same. + +2002-07-29 Aldy Hernandez + + * config/rs6000/rs6000.md ("cpu"): Add ppc8540 to attribute. + +2002-07-29 Aldy Hernandez + + * config/rs6000/rs6000.h (RTX_COSTS): Add MULT case for 8540. + +2002-07-29 Aldy Hernandez + + * config/rs6000/rs6000.md: Move altivec patterns from here... + + * config/rs6000/altivec.md: ...to here. + +2002-07-29 Aldy Hernandez + + * config/rs6000/spe.md ("spe_evmra"): Change to unspec. + +2002-07-29 Richard Henderson + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Rename from + set_mem_attributes and add BITPOS argument. Subtract it from + OFFSET when same is adjusted. + (set_mem_attributes): New wrapper function. + * expr.c (expand_assignment): Use set_mem_attributes_minus_bitpos; + remove offset adjustment hack. + * expr.h (set_mem_attributes_minus_bitpos): Declare. + +2002-07-29 Gabriel Dos Reis + + * Makefile.in (C_OBJS): Include c-pretty-print.o + (c-pretty-print.o): Add depency rule. + * pretty-print.h: Add more macros. + * c-pretty-print.c: New file. + * c-pretty-print.h: Likewise. + +2002-07-29 Aldy Hernandez + + * config/rs6000/spe.h (__internal_ev_mwhgumian): Cast vector + constants to __ev64_s32__. + (__internal_ev_mwhgsmian): Same. + (__internal_ev_mwhgsmfan): Same. + (__internal_ev_mwhgssfan): Same. + (__internal_ev_mwhgumiaa): Same. + (__internal_ev_mwhgsmiaa): Same. + (__internal_ev_mwhgsmfaa): Same. + (__internal_ev_mwhgssfaa): Same. + +2002-07-29 David Edelsohn + + * varasm.c (assemble_variable): Narrow test for uninitialized + without BSS target support. + +2002-07-29 Nathan Sidwell + + * profile.c: Add file comment describing the overall algorithm and + structures. + (struct edge_info): Add comments. + (struct bb_info): Add comments. + * basic-block.h (EDGE_*): Add comments. + * doc/gcov.texi (Gcov Data Files): Document bit flags. + +2002-07-29 Bob Wilson + + * config/xtensa/elf.h, config/xtensa/linux.h + (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Remove. + * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_SPEC): Remove. + +2002-07-29 Zack Weinberg + + * gensupport.c: Include hashtab.h. + (insn_elision, condition_table, hash_c_test, cmp_c_test, + maybe_eval_c_test): New routines and data structures to + support insn elision. + (init_md_reader): Read and initialize the condition_table. + (read_md_rtx): Discard insn patterns whose C test is provably + always false. + * gensupport.h: Declare new functions and data structures. + + * genconditions.c, dummy-conditions.c: New files. + * Makefile.in: Build genconditions; run it to construct + insn-conditions.c; build that and link it into most gen* + programs. + (HOST_SUPPORT, HOST_EARLY_SUPPORT): New variables. + (GEN): Delete, unused. + (STAGESTUFF): Update. + + * gencodes.c: (gen_insn): #define CODE_FOR_xxx equal to + CODE_FOR_nothing for all elided patterns. + (main): Tweaked to support this. + * genflags.c (gen_proto): Emit a static inline generator + function here for all elided patterns, which simply returns + NULL_RTX. + (gen_insn): Do not define HAVE_xxx for elided patterns. + (main): Tweaked to support this. No need to forward-declare + struct rtx_def. + * genrecog.c: Do not bother emitting the C test if it's known + to be true at compile time. + +2002-07-29 Mike Stump + + * config.gcc (target_gtfiles): Initialize, as otherwise cross + compilers hosted on powerpc-apple-darwin6.0 won't even build. + +2002-07-29 Richard Earnshaw + + * arm.md (sibcall, sibcall_value): Add RETURN as part of the pattern, + remove clobber of LR. + (sibcall_insn, sibcall_value_insn): Update accordingly. + (sibcall_epilogue): Remove debugging comment from assembler stream. + +2002-07-29 Gabriel Dos Reis + + * pretty-print.h: Define more macros. + * diagnostic.h (output_formatted_integer): Moved from... + * diagnostic.c: ... here. + +2002-07-28 Kaveh R. Ghazi + + * stormy16.h (ASM_OUTPUT_SYMBOL_REF): Use ASM_OUTPUT_LABEL_REF. + +2002-07-28 Zack Weinberg + + * defaults.h (ASM_OUTPUT_MEASURED_SIZE): Take only two + arguments. Always use ".-symbol" as expression argument. + * doc/tm.texi: Update to match. Document requirement for + ".size symbol, .-symbol" to be acceptable to assembler. + + * config/elfos.h, config/netbsd-aout.h, config/openbsd.h, + config/arm/elf.h, config/avr/avr.h, config/cris/aout.h, + config/i386/freebsd-aout.h, config/i386/sco5.h, + config/ip2k/ip2k.h, config/m88k/m88k.h, config/xtensa/elf.h, + config/xtensa/linux.h: Update uses of ASM_OUTPUT_MEASURED_SIZE. + +2002-07-28 Kaveh R. Ghazi + + * Makefile.in (gengtype-lex.c): Fix error in last change. + + * alpha/freebsd.h (TARGET_OS_CPP_BUILTINS): Add missing + backslash. + + * Makefile.in (vmsdbgout.o): Depend on function.h. + + * vmsdbgout.c: Include function.h. + +2002-07-28 Alan Modra + + * prefix.c (update_path): Don't strip single `.' path components + unless stripping a later `..' component. Exit loop as soon as + a valid path is found. + +2002-07-27 Roger Sayle + + * builtins.def [DEF_GCC_BUILTIN]: Require an explicit ATTRS + argument. Mark BUILT_IN_RETURN, BUILT_IN_EH_RETURN, + BUILT_IN_LONGJMP and BUILT_IN_TRAP as noreturn, the ISO C99 + floating point unordered comparisons (e.g. __builtin_isgreater) + as const, and leave the remaining GCC_BUILTINs unchanged. + + * c-decl.c (builtin_function): No need to explicitly mark + BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn. + +2002-07-27 Roger Sayle + + * Makefile.in: rtlanal.o now depends upon real.h. + + * flags.h [flag_signaling_nans]: New flag. + [HONOR_SNANS]: New macro. + + * toplev.c [flag_signaling_nans]: Initialize to false. + (f_options): Add processing for "-fsignaling-nans". + (set_fast_math_flags): Clear flag_signaling_nans with -ffast-math. + (process_options): flag_signaling_nans implies flag_trapping_math. + + * c-common.c (cb_register_builtins): Define __SUPPORT_SNAN__ + when -fsignaling-nans. First step to implementing WG14's N965. + + * fold-const.c (fold) [MULT_EXPR]: Conditionalize transforming + 1.0 * x into x, and -1.0 * x into -x on !HONOR_SNANS. + [RDIV_EXPR]: Conditionalize x/1.0 into x on !HONOR_SNANS. + + * simplify-rtx.c (simplify_relational_operation): Conditionalize + transforming abs(x) < 0.0 into false on !HONOR_SNANS. + + * rtlanal.c: #include real.c for TARGET_FLOAT_FORMAT definitions + required by HONOR_SNANS. (may_trap_p): Floating point DIV, MOD, + UDIV, UMOD, GE, GT, LE, LT and COMPARE may always trap with + -fsignaling_nans. EQ and NE only trap for flag_signaling_nans + not flag_trapping_math (i.e. HONOR_SNANS but not HONOR_NANS). + + * doc/invoke.texi: Document new -fsignaling-nans compiler option. + +2002-07-27 Kaveh R. Ghazi + + * Makefile.in (gengtype-lex.c): Work around a bug in flex. + * gengtype-lex.l (YY_USE_PROTOS): Undef. + (YY_DECL): Define. + +2002-07-27 Roger Sayle + + * doc/invoke.texi: Document that both -fno-builtin-foo and + -fno-builtin are supported by the g++ front-end. + +2002-07-27 Stan Shebs + + * configure.in: Rename config_gtfiles to target_gtfiles. + * configure: Regenerate. + * doc/gty.texi: Update reference. + * config.gcc (powerpc-*-darwin*): Set target_gtfiles + instead of appending to it. + +2002-07-25 Aldy Hernandez + + * config/rs6000/rs6000.c (function_arg_advance): SPE vararg + vectors are split into two registers. + (function_arg): Same. + +Thu Jul 26 23:00:13 2002 J"orn Rennecke + + * pa.md (extv): Check predicates before emitting extv_32. + +2002-07-27 Alan Modra + + * config/rs6000/rs6000.c (rs6000_traceback_name): New var. + (rs6000_traceback): New var. + (rs6000_override_options): Set rs6000_traceback. + (rs6000_output_function_epilogue): Implement traceback options. + * config/rs6000/rs6000.h (TARGET_OPTIONS): Add "traceback=". + (rs6000_traceback_name): Declare. + + * config/rs6000/rs6000.c (output_profile_hook): Don't generate profile + label reference when NO_PROFILE_COUNTERS. + +2002-07-26 Jason Merrill + + * function.c (assign_parms): Handle frontend-directed pass by + invisible reference. + +2002-07-26 Neil Booth + + * doc/cppopts.texi: Update. + +2002-07-26 Neil Booth + + * cppmacro.c (_cpp_create_definition): Don't attempt redefinition + warnings on assertions. + +2002-07-26 Neil Booth + + * c-common.h (RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ, + RID_OR, RID_OR_EQ, RID_XOR, RID_XOR_EQ, RID_BITAND, RID_BITOR, + RID_COMPL): Remove. + * c-parse.in (rid_to_yy): Similarly. + +2002-07-26 Jason Merrill + + * c-dump.c: Resurrect. + * tree-dump.c: Move C-specific stuff to c-dump.c. + * c-common.h: Declare c_dump_tree. + * c-lang.c (LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN): Define. + * Makefile.in (C_AND_OBJC_OBJS): Add c-dump.o. + (c-dump.o): New rule. + +2002-07-26 Alan Modra + + * config/rs6000/rs6000.md: Enable patterns using rlwinm for + PowerPC64. Replace "T" and "S" constraints with "n" when the + predicate will do. Formatting fixes. + (extzvsi_internal2): Use "andi.", "andis." and attr type of "compare" + as for extzvsi_internal1. + +2002-07-25 Neil Booth + + * dwarfout.c (VERSION_ASM_OP, DERIV_BEGIN_LABEL_FMT, + DERIV_END_LABEL_FMT): Remove. + (SL_BEGIN_LABEL_FMT, SL_END_LABEL_FMT): Move. + +2002-07-25 Neil Booth + + * objc/objc-act.c (UTAG_STATICS, UTAG_PROTOCOL_LIST, USERTYPE): + Remove. + +2002-07-25 Stan Shebs + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Remove unused + local var dwarfp. + (output_compiler_stub): Remove unused locals. + (output_call): Always initialize line number. + +Thu Jul 25 20:34:50 2002 J"orn Rennecke + + * sh.h (LOAD_EXTEND_OP): QImode zero-extends on SHmedia. + * sh.md (truncdiqi2, movqi_media): Likewise. + +2002-07-25 Neil Booth + + * gcse.c (obstack_chunk_alloc): Remove. + (gcse_alloc): Fix to count allocated bytes. + * collect2.c (SYMBOL__MAIN): Remove. + +2002-07-25 Neil Booth + + * gcc.c (TARGET_EXECUTABLE_SUFFIX): Only used if + HAVE_TARGET_EXECUTABLE_SUFFIX. + +Thu Jul 25 18:57:50 2002 J"orn Rennecke + + * rtl.h (mem_attrs): Spell out more clearly the roles of ALIGN, + SIZE, EXPR and OFFSET. + +2002-07-25 Richard Henderson + + * emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos + in ARRAY_REF of DECL_P case. + +2002-07-25 Richard Sandiford + + * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI + description. Document -mips32, -mips64, and the associated -march + values. Describe the "mipsN" arguments to -march. Say that the + -mipsN options are equivalent to -march. Reword the description + of default type sizes. + * toplev.h (target_flags_explicit): Declare. + * toplev.c (target_flags_explicit): New var. + (set_target_switch): Update target_flags_explicit. + * config/mips/abi64.h (SUBTARGET_TARGET_OPTIONS): Undefine. + * config/mips/elf64.h (MIPS_ISA_DEFAULT): Undefine. + * config/mips/iris6.h (SUBTARGET_ASM_SPEC): -mabi=64 implies -mips3. + * config/mips/isa3264.h (MIPS_ENABLE_EMBEDDED_O32): Undefine. + * config/mips/mips.h (mips_cpu_info): New struct. + (mips_cpu_string, mips_explicit_type_size_string): Remove. + (mips_cpu_info_table, mips_arch_info, mips_tune_info): Declare. + (MIPS_CPP_SET_PROCESSOR): New macro. + (TARGET_CPP_BUILTINS): Declare a macro for each supported processor. + Define _MIPS_ARCH and _MIPS_TUNE. + (MIPS_ISA_DEFAULT): Don't provide a default value. Instead... + (MIPS_CPU_STRING_DEFAULT): Set to "from-abi" if neither it nor + MIPS_ISA_DEFAULT were already defined. + (MULTILIB_DEFAULTS): Add MULTILIB_ABI_DEFAULT. + (TARGET_OPTIONS): Remove -mcpu and -mexplicit-type-size. + (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New. + (GAS_ASM_SPEC): Remove -march, -mcpu, -mgp* and -mabi rules. + (ABI_GAS_ASM_SPEC): Remove. + (MULTILIB_ABI_DEFAULT, ASM_ABI_DEFAULT_SPEC): New macros. + (ASM_SPEC): Add -mgp32, -mgp64, -march, -mabi=eabi and -mabi=o64. + Invoke %(asm_abi_default_spec) if no ABI was specified. + (CC1_SPEC): Remove ISA -> register-size rules. + (EXTRA_SPECS): Remove abi_gas_asm_spec. Add asm_abi_default_spec. + * config/mips/mips.c (mips_arch_info, mips_tune_info): New vars. + (mips_cpu_string, mips_explicit_type_size_string): Remove. + (mips_cpu_info_table): New array. + (mips_set_architecture, mips_set_tune): New fns. + (override_options): Rework to make -mipsN equivalent to -march. + Detect more erroneous cases, including those removed from CC1_SPEC. + Don't change the ABI based on architecture, or vice versa. + Unify logic with GAS. + (mips_asm_file_start): Get architecture name from mips_arch_info. + (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. + (mips_parse_cpu): Take the name of the option as argument. Handle + 'from-abi'. Raise an error if the option is wrong. + (mips_cpu_info_from_isa): New fn. + +2002-07-25 Richard Sandiford + + * config/mips/mips.md (tablejump_mips161): Use gen_rtx_LABEL_REF. + (tablejump_mips162): Likewise. + +Thu Jul 25 10:23:41 2002 J"orn Rennecke + + * simpify-rtx.c (simplify_subreg): Don't pass MODE_CC mode to + int_mode_for_mode. + +2002-07-25 Gabriel Dos Reis + + * c-common.c (c_sizeof_or_alignof_type): Take a third argument for + complaining. + * c-common.h (c_sizeof): Adjust definition. + (c_alignof): Likewise. + * c-tree.h (c_sizeof_nowarn): Now macro. + * c-typeck.c (c_sizeof_nowarn): Remove definition. + +2002-07-25 Neil Booth + + * c-decl.c (c_decode_option): No need to handle switches + cpplib handles. + +2002-07-24 Zack Weinberg + + * defaults.h (ASM_OUTPUT_TYPE_DIRECTIVE, ASM_OUTPUT_SIZE_DIRECTIVE, + ASM_OUTPUT_MEASURED_SIZE): New default definitions of new macros. + * doc/tm.texi: Document them. Also document SIZE_ASM_OP, + TYPE_ASM_OP, and TYPE_OPERAND_FMT. + + * config/elfos.h, config/netbsd-aout.h, config/openbsd.h, + config/alpha/elf.h, config/arm/elf.h, config/avr/avr.h, + config/cris/aout.h, config/i386/freebsd-aout.h, + config/i386/sco5.h, config/ia64/ia64.c, config/ip2k/ip2k.h, + config/m68k/m68kelf.h, config/m68k/m68kv4.h, config/m88k/m88k.h, + config/mcore/mcore-elf.h, config/mips/elf.h, config/mips/elf64.h, + config/mips/iris6.h, config/mips/linux.h, config/pa/pa-linux.h, + config/pa/pa64-hpux.h, config/rs6000/sysv4.h, + config/xtensa/elf.h, config/xtensa/linux.h: + Use the new macros. + Where possible, remove redundant definitions of SIZE_ASM_OP, + TYPE_ASM_OP, and TYPE_OPERAND_FMT. + +2002-07-24 Aldy Hernandez + + * config/rs6000/eabi.h: Define TARGET_SPE_ABI, TARGET_SPE, + TARGET_ISEL, and TARGET_FPRS. + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document + -mabi=spe, -mabi=no-spe, and -misel=. + + * config/rs6000/rs6000-protos.h: Add output_isel. + Move vrsave_operation prototype here. + + * config/rs6000/rs6000.md (sminsi3): Allow pattern for TARGET_ISEL. + (smaxsi3): Same. + (uminsi3): Same. + (umaxsi3): Same. + (abssi2_nopower): Disallow when TARGET_ISEL. + (*ne0): Same. + (negsf2): Change to expand and rename old pattern to *negsf2. + (abssf2): Change to expand and rename old pattern to *abssf2. + + New expanders: fix_truncsfsi2, floatunssisf2, floatsisf2, + fixunssfsi2. + + Change patterns that check for TARGET_HARD_FLOAT or + TARGET_SOFT_FLOAT to also check TARGET_FPRS. + + * config/rs6000/rs6000.c: New globals: rs6000_spe_abi, + rs6000_isel, rs6000_fprs, rs6000_isel_string. + (rs6000_override_options): Add 8540 case to + processor_target_table. + Set rs6000_isel for the 8540. + Call rs6000_parse_isel_option. + (enable_mask_for_builtins): New. + (rs6000_parse_isel_option): New. + (rs6000_parse_abi_options): Add spe and no-spe. + (easy_fp_constant): Treat !TARGET_FPRS as soft-float. + (rs6000_legitimize_address): Check for TARGET_FPRS when checking + for TARGET_HARD_FLOAT. + Add case for SPE_VECTOR_MODE. + (rs6000_legitimize_reload_address): Handle SPE vector modes. + (rs6000_legitimate_address): Disallow PRE_INC/PRE_DEC for SPE + vector modes. + Check for TARGET_FPRS when checking for TARGET_HARD_FLOAT. + (rs6000_emit_move): Check for TARGET_FPRS. + Add cases for SPE vector modes. + (function_arg_boundary): Return 64 for SPE vector modes. + (function_arg_advance): Check for TARGET_FPRS and + Handle SPE vectors. + (function_arg): Same. + (setup_incoming_varargs): Check for TARGET_FPRS. + (rs6000_va_arg): Same. + (struct builtin_description): Un-constify mask field. Move up in + file. + (bdesc_2arg): Un-constify and add SPE builtins. + (bdesc_1arg): Same. + (bdesc_spe_predicates): New. + (bdesc_spe_evsel): New. + (rs6000_expand_unop_builtin): Add SPE 5-bit literal builtins. + (rs6000_expand_binop_builtin): Same. + (bdesc_2arg_spe): New. + (spe_expand_builtin): New. + (spe_expand_predicate_builtin): New. + (spe_expand_evsel_builtin): New. + (rs6000_expand_builtin): Call spe_expand_builtin for SPE. + (rs6000_init_builtins): Initialize SPE builtins. Call + rs6000_common_init_builtins. + (altivec_init_builtins): Move all non-altivec builtin code to... + (rs6000_common_init_builtins): ...here. New function. + (branch_positive_comparison_operator): Allow NE code for SPE. + (ccr_bit): Return correct ccr bit for SPE fp. + (print_operand): Emit crnor in 'D' case for SPE. + New case 't'. + Add SPE code for 'y' case. + (rs6000_generate_compare): Generate rtl for SPE fp. + (output_cbranch): Handle SPE hard floats. + (rs6000_emit_cmove): Handle isel. + (rs6000_emit_int_cmove): New. + (output_isel): New. + (rs6000_stack_info): Adjust stack frame so GPRs are saved in + 64-bits for SPE. + (debug_stack_info): Add SPE info. + (gen_frame_mem_offset): New. + (rs6000_emit_prologue): Save GPRs in 64-bits for SPE abi. + Change mode of frame pointer, when saving it, to Pmode. + (rs6000_emit_epilogue): Restore GPRs in 64-bits for SPE abi. + Misc cleanups and use gen_frame_mem_offset when appropriate. + + * config/rs6000/rs6000.h (processor_type): Add PROCESSOR_PPC8540. + (TARGET_SPE_ABI): New. + (TARGET_SPE): New. + (TARGET_ISEL): New. + (TARGET_FPRS): New. + (FIXED_SCRATCH): New. + (RTX_COSTS): Add PROCESSOR_PPC8540. + (ASM_CPU_SPEC): Add case for 8540. + (TARGET_OPTIONS): Add isel= case. + (rs6000_spe_abi): New. + (rs6000_isel): New. + (rs6000_fprs): New. + (rs6000_isel_string): New. + (UNITS_PER_SPE_WORD): New. + (LOCAL_ALIGNMENT): Adjust for SPE. + (HARD_REGNO_MODE_OK): Same. + (DATA_ALIGNMENT): Same. + (MEMBER_TYPE_FORCES_BLK): New. + (FIRST_PSEUDO_REGISTER): Set to 113. + (FIXED_REGISTERS): Add SPE registers. + (reg_class): Same. + (REG_CLASS_NAMES): Same. + (REG_CLASS_CONTENTS): Same. + (REGNO_REG_CLASS): Same. + (REGISTER_NAMES): Same. + (DEBUG_REGISTER_NAMES): Same. + (ADDITIONAL_REGISTER_NAMES): Same. + (CALL_USED_REGISTERS): Same. + (CALL_REALLY_USED_REGISTERS): Same. + (SPE_ACC_REGNO): New. + (SPEFSCR_REGNO): New. + (SPE_SIMD_REGNO_P): New. + (HARD_REGNO_NREGS): Adjust for SPE. + (VECTOR_MODE_SUPPORTED_P): Same. + (REGNO_REG_CLASS): Same. + (FUNCTION_VALUE): Same. + (LIBCALL_VALUE): Same. + (LEGITIMATE_OFFSET_ADDRESS_P): Same. + (SPE_VECTOR_MODE): New. + (CONDITIONAL_REGISTER_USAGE): Disable FPRs when target does FP on + the GPRs. Set FIXED_SCRATCH fixed in SPE case. + (rs6000_stack): Add spe_gp_size, spe_padding_size, + spe_gp_save_offset. + (USE_FP_FOR_ARG_P): Check for TARGET_FPRS. + (LEGITIMATE_LO_SUM_ADDRESS_P): Same. + (SPE_CONST_OFFSET_OK): New. + (rs6000_builtins): Add SPE builtins. + + * testsuite/gcc.dg/ppc-spe.c: New. + + * config/rs6000/eabispe.h: New. + + * config/rs6000/spe.h: New. + + * config/rs600/spe.md: New. + + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define + __SIMD__ for TARGET_SPE. + + * config.gcc: Add powerpc-*-eabispe* case. + Add spe.h to user headers for powerpc. + +2002-07-24 Chris Demetriou + + * config/mips/elf.h (STARTFILE_SPEC): Undo previous change. + * config/mips/elf64.h (STARTFILE_SPEC): Likewise. + * config/mips/isa3264.h (STARTFILE_SPEC): Likewise. + +2002-07-24 Richard Henderson + + * expr.c (expand_expr) [TRY_FINALLY_EXPR]: Use GOTO_SUBROUTINE_EXPR + form when not optimizing. + +2002-07-24 David Mosberger + + * config/ia64/ia64.c (gen_thread_pointer): Fix typo in marking + thread_pointer_rtx as unchanging. + +2002-07-24 Michael Matz + + * ra-colorize.c (INV_REG_ALLOC_ORDER): New macro. + (free_reg): Use it. + +2002-07-24 Richard Earnshaw + + * arm.md (arm_buneq, arm_bltgt): put '\' before ';' in output + pattern. + (arm_buneq_reversed, arm_bltgt_reversed): Likewise. + (movsicc, movsfcc, movdfcc): FAIL if UNEQ or LTGT. + +2002-07-24 Chris Demetriou + + * config/mips/elf.h (STARTFILE_SPEC): Never include crt0.o. + * config/mips/elf64.h (STARTFILE_SPEC): Likewise. + * config/mips/isa3264.h (STARTFILE_SPEC): Do not redefine. + +Wed Jul 24 17:59:12 CEST 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Dump loops before clobbering + the structure. + +Wed Jul 24 17:23:16 CEST 2002 Jan Hubicka + + * rtlanal.c (keep_with_call_p): Avoid overflow in fixed_regs. + +2002-07-24 Frank van der Linden + + PR optimization/7291 + * config/i386/i386.c (ix86_expand_clrstr): Fix bzero alignment + problem on x86_64. + +2002-07-24 Gabriel Dos Reis + + * pretty-print.h: Add macros from cp/error.c + +2002-07-24 Alan Modra + + * config/rs6000/rs6000-protos.h (mask_operand_wrap): Declare. + (mask64_2_operand): Declare. + (build_mask64_2_operands): Declare. + (and64_2_operand): Declare. + (extract_MB): Declare. + (extract_ME): Declare. + * config/rs6000/rs6000.c (mask64_operand): Allow all ones. Remove + CONST_DOUBLE code. + (mask_operand_wrap): New insn predicate. + (mask64_2_operand): Likewise. + (and64_2_operand): Likewise. + (build_mask64_2_operands): New function. + (extract_MB): New function. + (extract_ME): New function. + (print_operand ): Use extract_MB and extract_ME. + (print_operand ): Allow all ones. Remove CONST_DOUBLE support. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 't'. + (PREDICATE_CODES): Add and64_2_operand, mask_operand_wrap and + mask64_2_operand. Remove CONST_DOUBLE from mask64_operand. + * config/rs6000/rs6000.md (andsi3_internal3): New + (andsi3_internal3+1): Enable split for powerpc64. + (andsi3_internal3+2): New split. + (andsi3_internal4): Renamed old andsi3_internal3. + (andsi3_internal5): New. + (andsi3_internal5+1): Enable split for powerpc64. + (andsi3_internal5+2): New split. + (andsi3_internal6, andsi3_internal7, andsi3_internal8): New. + (anddi3): Handle 't' constraint. + (anddi3+1): New split. + (anddi3_internal2): Handle 't' constraint. + (anddi3_internal2+1): New split. + (anddi3_internal3): Handle 't' constraint. + (anddi3_internal3+1): New split. + +2002-07-24 Alan Modra + + * config/rs6000/rs6000.md: Remove scratch reg on insns using + addze and similar (plus (comparison r1 r2) r3) insns. Add + missing scratch reg in one case. Formatting fixes. + +2002-07-24 Neil Booth + + * cppexp.c (parse_defined): Mark macro used. + * cpphash.h (struct cpp_macro): New member "used". + (_cpp_mark_macro_used, _cpp_warn_if_unused_macro): New. + (struct cpp_reader): New member. + * cppinit.c (cpp_finish_options): Set first_unused_line. + (cpp_finish): Warn of unused macros if requested. + (OPT_TABLE): New switches. + (cpp_handle_option): Handle them. + * cpplib.c (do_undef): Warn if macro unused. + (do_ifdef, do_ifndef): Mark macro used. + * cpplib.h (struct cpp_options): New member. + * cppmacro.c (_cpp_warn_if_unused_macro): New. + (enter_macro_context): Mark macro used. + (_cpp_create_definition): Mark macro unused; warn if unused + when redefined. + * cpptrad.c (scan_out_logcial_line, push_replacement_text): + Mark macros used. + * doc/cppopts.texi: Update. + +2002-07-23 Neil Booth + + * dwarf2out.c (SECTION_ASM_OP, + ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Remove. + * system.h (SECTION_ASM_OP): Poison. + * tree.c (FILE_FUNCTION_PREFIX_LEN): Remove. + * config/alpha/alpha-interix.h, config/mips/linux.h + (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Remove. + * config/mmix/mmix-protos.h, config/mmix/mmix.c + (mmix_asm_output_define_label_difference_symbol): Remove. + * config/mmix/mmix.h + (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Remove. + * doc/tm.texi: Remove documentation. + +Tue Jul 23 21:49:24 2002 J"orn Rennecke + + * recog.c (asm_operand_ok): Allow float CONST_VECTORs for 'F'. + (constrain_operands): Likewise. + * regclass.c (record_reg_classes): Likewise. + * reload.c (find_reloads): Likewise. + * doc/md.texi: Likewise. + + * reload.c (find_reloads_toplev): Use simplify_gen_subreg. + * simplify-rtx.c (simplify_subreg): When converting to a non-int + mode, try to convert to an integer mode of matching size first. + + * simplify-rtx.x (simplify_subreg): When constructing a CONST_VECTOR + from individual subregs, check that each subreg has been generated + sucessfully. + +2002-07-23 Neil Booth + + * genautomata.c (VLA_HWINT_SHORTEN, VLA_HWINT_LAST): Remove. + * df.c (HANDLE_SUBREG, FOR_EACH_BB_IN_BITMAP_REV, + FOR_EACH_BB_IN_SBITMAP): Remove. + * gcse.c (NEVER_SET, FOLLOW_BACK_EDGES): Remove. + * haifa-sched.c (DONE_PRIORITY, MAX_PRIORITY, TAIL_PRIORITY, + LAUNCH_PRIORITY, DONE_PRIORITY_P, LOW_PRIORITY_P): Remove. + * loop.c (PREFETCH_BLOACK_IN_LOOP_MIN, + PREFETCH_LIMIT_TO_SIMULTANEOUS): Remove. + * regrename.c (REGNO_MODE_OK_FOR_BASE_P): Remove. + +2002-07-23 Gabriel Dos Reis + + * pretty-print.h: New file. + +2002-07-23 Paul Koning + + * real.c (REAL_WORDS_BIG_ENDIAN): Make 1 for DEC. + (LARGEST_EXPONENT_IS_NORMAL): Ditto. + (VAX_HALFWORD_ORDER): Define (1 for DEC VAX, 0 otherwise). + (TARGET_G_FLOAT): Default to 0 if not defined. + (ieeetoe): New, common routine to convert target format floats + to internal form. + (e24toe, e53toe): Change to use ieeetoe, distinguish DEC + vs. others. + (e113toe): Change to use ieeetoe. + +2002-07-23 Roman Lechtchinsky + + * real.c (REAL_WORDS_BIG_ENDIAN): Make sure it is 0 for DEC and 1 for + IBM. + (e53toe): Assume IEEE if non of DEC, IBM and C4X is defined. + (e64toe): Remove special cases for DEC and IBM. Remove support for + ARM_EXTENDED_IEEE_FORMAT. + (e24toe): Remove special cases for DEC. + (significand_size): Simplify. Indent. + (ieee_format, ieee_24, ieee_53, ieee_64, ieee_113): New. + (etoieee, toieee): New. + (etoe113, toe113, etoe64, toe64, etoe53, toe53, etoe24, toe24): Use + etoieee and toieee for IEEE arithmetic. + +2002-07-23 Gabriel Dos Reis + + * doc/extend.texi: Say ISO C90, not ISO C89. + * doc/invoke.texi: Likewise. + * doc/standards.texi: Likewise. + +2002-07-23 Steve Ellcey + + * gcc/explow.c (convert_memory_address): Fix conversion of CONSTs. + Fix permutation of conversion and plus/mult. + * gcc/builtins.c (expand_builtin_memcpy) Ensure return pointer is + ptr_mode and not Pmode when POINTERS_EXTEND_UNSIGNED is defined. + (expand_builtin_strncpy) Ditto. + (expand_builtin_memset) Ditto. + +2002-07-23 Gabriel Dos Reis + + Fix PR/7363: + * c-common.c (c_sizeof_or_alignof_type): New function. + (c_alignof): Remove definition. + * c-common.h (c_sizeof, c_alignof): Define as macros. + (c_sizeof_or_alignof_type): Declare. + (my_friendly_assert): Moved from cp/cp-tree.h + * c-typeck.c (c_sizeof): Remove definition. + +2002-07-23 Jan Hubicka + + * gcse.c (try_replace_reg): Use num_changes_pending. + * recog.c (num_changes_pending): New function. + (validate_replace_src): Use validate_repalce_src_group. + (validate_replace_src_group): New. + * recog.h (validate_repalce_src_group): New. + (num_changes_pending): Likewise. + +Tue Jul 23 12:16:58 2002 J"orn Rennecke + + * calls.c (emit_library_call_value_1): If + FUNCTION_ARG_PASS_BY_REFERENCE is true, pretend this is neither + libcall, const call nor pure call. + +2002-07-23 Neil Booth + + * config/m88k/m88k.h (SECTION_ASM_OP): Remove. + +2002-07-23 Neil Booth + + * vmsdbgout.c (SECTION_ASM_OP): Remove. + +2002-07-23 Neil Booth + + * config/i386/i386.c (AT_BP): Remove. + +2002-07-23 Neil Booth + + * defaults.h (obstack_chunk_alloc, obstack_chunk_free): + Default definition. + * gcse.c: Don't define obstack_chunk_free. + * collect2.c, conflict.c, df.c, diagnostic.c, fix-header.c, + flow.c, gcc.c, genattrtab.c, genautomata.c, genflags.c, gensupport.c, + integrate.c, loop.c, ra.c, read-rtl.c, regrename.c, reload1.c, + reorg.c, tlink.c, tree.c, config/arm/arm.c, objc/objc-act.c: + Don't define obstack macros. + +2002-07-22 Stephane Carrez + + PR target/6744 + * config/m68hc11/m68hc11.c (m68hc11_z_replacement): Also replace + ASM_OPERANDS instructions. + +2002-07-22 Stephane Carrez + + PR target/7361 + * config/m68hc11/m68hc11.c (go_if_legitimate_address_internal): Accept + constant addresses only on 68HC12. + +2002-07-22 Neil Booth + + * cppfiles.c (stack_include_file): Correct test of whether + a dependency should be output. + +2002-07-22 David Edelsohn + + * collect2.c (is_ctor_dtor): Add other possible JOINER values. + +2002-07-22 Richard Earnshaw + + * arm.md (movqi): If optimizing and we can create pseudos, use + a ZERO_EXTEND to load from memory, then copy the result into the + target. + (movhi): Likewise, but only for ARMv4. + +2002-07-22 Neil Booth + + * ssa-ccp.c (PHI_PARMS): Remove. + +2002-07-22 Richard Sandiford + + * config/mips/mips.h (CLASS_CANNOT_CHANGE_MODE): Include FP_REGS + on big-endian targets. + +2002-07-22 Kaveh R. Ghazi + + * hwint.h (HOST_WIDE_INT_PRINT_DEC_SPACE, + HOST_WIDE_INT_PRINT_UNSIGNED_SPACE, + HOST_WIDEST_INT_PRINT_DEC_SPACE, HOST_WIDEST_INT_PRINT_DEC_SPACE): + New formatting macros. + + * ra-debug.c (dump_static_insn_cost): Avoid string concatenation. + +Mon Jul 22 15:27:25 2002 J"orn Rennecke + + * rtlanal.c (subreg_regno_offset): Return correct offset for + big endian paradoxical subregs. + + * optabs.c (expand_vector_unop): Don't expand using sub_optab + if we got the wrong mode. + + * hwint.c (define HOST_WIDE_INT_PRINT_DEC_C): New define. + * genrecog.c (write_switch, write_cond): Use it. + * genemit.c (gen_exp): Likewise. + +2002-07-22 Jakub Jelinek + + * c-decl.c (build_compound_literal): Set decl TREE_READONLY from TYPE. + +2002-07-22 Jakub Jelinek + + * c-decl.c (build_compound_literal): Defer compound literal decls + until until file end to emit them only if they are actually used. + +2002-07-21 Kaveh R. Ghazi + + * ra-build.c (check_conflict_numbers): Hide unused function. + (livethrough_conflicts_bb): Avoid automatic aggregate + initialization. + (parts_to_webs_1): Avoid `U' integer constant modifier. + (conflicts_between_webs): Wrap a variable in the macro controlling + its usage. + * ra-debug.c (ra_debug_msg): Use VA_OPEN/VA_CLOSE. + (dump_igraph, dump_graph_cost): Avoid string concatenation + (dump_static_insn_cost): Avoid automatic aggregate + initialization. + * ra-rewrite.c (insert_stores): Avoid automatic aggregate + initialization. + (dump_cost): Avoid string concatenation + +2002-07-21 Richard Henderson + + * expr.c (expand_expr) [TRY_FINALLY_EXPR]: Don't use + GOTO_SUBROUTINE_EXPR when finally_block can be re-expanded. + +2002-07-21 Richard Henderson + + * unroll.c (find_splittable_givs): Do not split DEST_ADDR givs + that are not unrolled completely. + +2002-07-21 Richard Henderson + + * loop.h (LOOP_AUTO_UNROLL): Rename from LOOP_FIRST_PASS. + * loop.c (strength_reduce): Update. + * toplev.c (rest_of_compilation): Do unrolling in the first + loop pass, not the second. + +2002-07-21 Richard Henderson + + * emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL + when flag_argument_noalias == 2. + * alias.c (nonoverlapping_memrefs_p): Handle that. + * print-rtl.c (print_mem_expr): Likewise. + +2002-07-21 Hartmut Schirmer + + * libgcc2.c (__divdi3, __moddi3): Use unary minus operator + instead of __negdi2 directly. + +2002-07-21 Neil Booth + + * gengenrtl.c (gencode): Don't define obstack_alloc_rtx. + * function.c (SYMBOL__MAIN): Remove definition. + * global.c (SET_CONFLICT, REGBITP, ALLOCNO_LIVE_P): Remove. + * predict.c (PROB_NEVER, PROB_LIKELY, PROB_UNLIKELY): Remove. + * profile.c (GCOV_INDEX_TO_BB): Remove. + * sched-rgn.c (ABS_VALUE, MIN_DIFF_PRIORITY, MIN_PROB_DIFF): Remove. + * simplify-rtx.c (FIXED_BASE_PLUS_P): Remove. + +2002-07-21 Neil Booth + + * c-lex.c (GET_ENVIRONMENT): Remove. + * collect2.c (GET_ENV_PATH_LIST): Remove. + (prefix_from_env): Use GET_ENVIRONMENT. + * cppinit.c (GET_ENV_PATH_LIST): Remove. + (init_standard_includes): Use GET_ENVIRONMENT. + * defaults.h (GET_ENVIRONMENT): Define here if not already. + * gcc.c (GET_ENV_PATH_LIST): Remove. + (make_relative_prefix, process_command): Update. + * protoize.c (GET_ENV_PATH_LIST): Remove. + (do_processing): Update. + +2002-07-21 Gabriel Dos Reis + + * c-decl.c (build_array_declarator): Say 'ISO C90', not 'ISO C89'. + (grokdeclarator): Likewise. + * c-format.c (C_STD_NAME): Likewise. + * c-lex.c (interpret_integer): Likewise. + * c-typeck.c (build_array_ref): Likewise. + * cpplex.c (_cpp_lex_direct): Likewise. + * toplev.c (documented_lang_options): Likewise. + +2002-07-21 Neil Booth + + * c-format.c (T99_I, T99_UI): Remove. + +2002-07-21 Neil Booth + + * c-typeck.c (SAVE_SPELLING_DEPTH): Remove. + +Sun Jul 21 21:36:41 CEST 2002 Jan Hubicka + + * gcse.c (do_local_cprop): Do not extend lifetimes of registers set by + do_local_cprop. + +2002-07-21 Andreas Jaeger + + * reload1.c (fixup_abnormal_edges): Remove unused variable. + +2002-07-21 Bernd Schmidt + + Improvements for the ifcvt pass from Michael Meissner, with patches + by Richard Sandiford + * basic-block.h (struct ce_if_block, ce_if_block_t): New types. + * ifcvt.c (cond_exec_changed_p): New static variable. + (last_active_insn): New function, renamed from last_active_insn_p + and changed to return the last active insn in a basic block. All + callers updated. + (block_fallthru): New function. + (cond_exec_process_insns): New argument CE_INFO. Pass it to + IFCVT_MODIFY_INSN. All callers updated. + Return false if START or END are NULL. + Handle case where we're processing an insn that is already + conditional. + + (noce_process_if_block): CE_INFO argument rather than + multiple args containing the involved basic blocks. All callers + changed. + (process_if_block, merge_if_block, find_if_block, + cond_exec_process_if_block): Likewise. + + (cond_exec_process_if_block): New arg DO_MULTIPLE_P. All callers + changed. + Use new function last_active_insn to simplify some code. + New code to handle multiple tests. + Call IFCVT_MODIFY_CANCEL in all failure cases, otherwise set + cond_exec_changed_p to TRUE. + + (process_if_block): New code to handle multiple tests. + (merge_if_block): Likewise. + (find_if_header): New arg PASS. Changed to return the currently + processed basic block or NULL instead of true/false. All callers + changed. + Call IFCVT_INIT_EXTRA_FIELDS. + (block_jumps_and_fallthru_p): New function. + (find_if_block): Discover opportunities to convert multiple tests. + Add additional debugging output. + Update the ce_info structure before returning. + + (if_convert): Run multiple passes of if-conversion. + * doc/tm.texi (IFCVT_MODIFY_TESTS, IFCVT_MODIFY_INSN, + IFCVT_MODIFY_FINAL, IFCVT_MODIFY_CANCEL, IFCVT_MODIFY_MULTIPLE_TESTS, + IFCVT_INIT_EXTRA_FIELDS, IFCVT_EXTRA_FIELDS): Update documentation for + these macros. + +Sun Jul 21 00:54:54 CEST 2002 Jan Hubicka + + * gcse.c: Include cselib.h + (constptop_register): Break out from ... + (cprop_insn): ... here; kill basic_block argument. + (do_local_cprop, local_cprop_pass): New functions. + (one_cprop_pass): Call local_cprop_pass. + +2002-07-20 Roger Sayle + + * simplify-rtx.c (simplify_relational_operation): Optimize + abs(x) < 0.0 (and abs(x) >= 0.0 when using -ffast-math). + +2002-07-20 Michae Matz + + * ra-build.c: (remember_web_was_spilled): Use GENERAL_REGS. + +2002-07-20 Neil Booth + + * cppexp.c (struct op): Add token pointer. + (check_promotion, CHECK_PROMOTION): New. + (optab): Update. + (_cpp_parse_expr): Update, use token pointer of struct op. + (reduce): Warn about change of sign owing to promotion. + * cppinit.c (cpp_handle_option): New warning if -Wall. + * cpplib.h (struct cpp_options): New member. + +2002-07-19 David Edelsohn + + * config/rs6000/rs6000.md: Remove ppc630 fpcompare from single + fpu list. Separate Power4 compare and delayed_compare. Correct + Power4 fpcompare. + (fix_truncdfsi2_internal): Restore FPR preference. + * config/rs6000/t-aix43 (MULTILIB_MATCHES): Add mcpu?power3, + mcpu?power4, mcpu?604e. Remove mpower, mpower2, mpowerpc. + +2002-07-19 Momchil Velikov + + * reload1.c (reload_as_needed): Duplicate oldpat. + +2002-07-20 Alan Modra + + PR optimization/7130 + * loop.h (struct loop_info): Add "preconditioned". + * unroll.c (unroll_loop): Set it. + * doloop.c (doloop_modify_runtime): Correct count for unrolled loops. + +2002-07-19 Zack Weinberg + + * rtl.def (CODE_LABEL): Remove slot 8. + * rtl.h (struct rtx_def): Document new uses of jump and call fields. + (LABEL_ALTERNATE_NAME): Delete. + (LABEL_KIND, SET_LABEL_KIND, LABEL_ALT_ENTRY_P): New. + * defaults.h: Remove default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. + + * final.c (output_alternate_entry_point): New. + (final_scan_insn): Use it instead of + ASM_OUTPUT_ALTERNATE_LABEL_NAME. Do not consider possibility + of a case label being an alternate entry point. + + * cfgbuild.c (make_edges, find_bb_boundaries): Use LABEL_ALT_ENTRY_P. + * emit-rtl.c (gen_label_rtx): Adjust call to gen_rtx_CODE_LABEL. + Do not clear LABEL_NUSES (unnecessary) or LABEL_ALTERNATE_NAME + (field deleted). + * print-rtl.c, ra-debug.c: Update code to output CODE_LABELs. + + * doc/rtl.texi: Document LABEL_KIND, SET_LABEL_KIND, and + LABEL_ALT_ENTRY_P; not LABEL_ALTERNATE_NAME. + * doc/tm.texi: Delete documentation of + ASM_OUTPUT_ALTERNATE_LABEL_NAME. + +2002-07-19 Rainer Orth + + * config/mips/iris5gas.h (DWARF2_DEBUGGING_INFO): Define. + (PREFERRED_DEBUGGING_TYPE): Use DWARF2_DEBUG. + (LINK_SPEC): Define. + (STARTFILE_SPEC): Define. + (ENDFILE_SPEC): Define. + + * config/mips/iris6-o32.h (LINK_SPEC): Move ... + * config/mips/iris6-o32-as.h (LINK_SPEC): ... here. + + * config/mips/iris6-o32-gas.h: New file. + * config.gcc (mips-sgi-irix6*o32): Use it. + + * config/mips/t-iris5-gas: New file. + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it. + +2002-07-19 Neil Booth + + * cppexp.c (ALWAYS_EVAL): Remove. + (optab, reduce): Always evaluate. + (num_unary_op, num_binary_op, num_div_op): Issue diagnostics + only if not skipping evaluation. + +2002-07-19 Marek Michalkiewicz + + * config/avr/avr.c (debug_hard_reg_set): Remove. + +2002-07-19 Chris Demetriou + + * gcc.c (cpp_options): Include "%1" (cc1_spec). + +2002-07-19 Richard Henderson + + * loop.c (loop_givs_rescan): Delete the REG_EQUAL note, not the insn. + +2002-07-19 Alan Modra + + * prefix.c (update_path): Don't zap single `.' path components + unless followed by another `.' and fix typo last patch. + +2002-07-18 Neil Booth + + * cppexp.c (cpp_num_mul): Remove unused parameter. + (UNARY, BINARY, OTHER, binary_handler): Remove. + (ALWAYS_EVAL): New. + (optab): Update. + (reduce): Refactor to a large switch, don't use a function + pointer. + +2002-07-18 Bo Thorsen + + * config/i386/linux64.h (STARTFILE_PREFIX_SPEC): Define this always. + +Thu Jul 18 19:39:18 2002 J"orn Rennecke + + * sh-protos.h (sh_expand_unop_v2sf): Move inside #ifdef RTX_CODE guard. + (sh_expand_binop_v2sf): Likewise. + * sh.c (machine_dependent_reorg): Add move for UNSPEC_MOVA. + (int_gpr_dest, trunc_hi_operand): New functions. + * sh.h (PREDICATE_CODES): Add any_register_operand, int_gpr_dest and + trunc_hi_operand. + (SPECIAL_MODE_PREDICATES, any_register_operand): Define. + * sh.md (cmpeqdi_t+1): Remove comments that genrecog warns about. + (adddi3_compact+1, subdi3_compact+1, ashlsi3_n+1, ashlhi3+1): Likewise. + (ashrsi2_16+1, ashrsi2_31+1, lshrsi3_n+1, ashrdi3+[12]): Likewise. + (and_shl_scratch+[12], zero_extendhidi2+1): Likewise. + (zero_extendhisi2_media+1, extendhidi2+1, extendqidi2+1): Likewise. + (extendhisi2_media+1, extendqisi2_media+1): Likewise. + (movsi_media_nofpu+[12], movhi_media+1, movdi_media_nofpu+1): Likewise. + (movdi_const_16bit+[12], movdf_i4+[123], reload_outdf+[2-5]): Likewise. + (movsf_ie+1): Likewise. + (loaddi_trunc): Use int_gpr_dest predicate. + (use_sfunc_addr, indirect_jump_scratch, sibcall_compact): Add mode(s). + (mova, mova_const, GOTaddr2picreg, ptrel, casesi_worker_0): Likewise. + (casesi_worker_0+[12], casesi_worker): Likewise. + (shcompact_preserve_incoming_args): Likewise. + (mov_nop): Use any_register_operand predicate. + (mperm_w0): Use trunc_hi_operand predicate. + +2002-07-18 John David Anglin + + * pa-linux.h (DWARF2_UNWIND_INFO): Delete define. + * pa.h (EH_RETURN_DATA_REGNO): Revise TARGET_64BIT and correct + numbering. + +2002-07-18 John David Anglin + + * pa.c (output_deferred_plabels): Remove unused millicode enum mulU. + +2002-07-18 Richard Henderson + + PR optimization/7147 + * ifcvt.c (noce_get_condition): Make certain that the condition + is valid at JUMP. + +Thu Jul 18 13:44:51 2002 J"orn Rennecke + + * sh.c (barrier_align, push): Shut up compiler warnings. + (initial_elimination_offset,sh_media_init_builtins): Likewise. + (reg_no_subreg_operand): Delete. + +2002-07-17 Bo Thorsen + + * config/i386/linux64.h (LINK_SPEC): Remove bogus -Y option. + (STARTFILE_PREFIX_SPEC): Define for NATIVE_CROSS compilations. + (STARTFILE_SPEC): Remove hardcoded library paths. + (ENDFILE_SPEC): Likewise. + +Thu Jul 18 09:38:59 CEST 2002 Jan Hubicka + + * gcse.c (hoist_expr_reaches_here_p): Stop once expr_bb is reached. + + * gcse.c (try_replace_reg): Do not return false positives. + +2002-07-18 Alan Modra + + * prefix.c: (update_path): Strip ".." components when prior dir + doesn't exist. Pass correct var to UPDATE_PATH_HOST_CANONICALIZE. + + * config/rs6000/sysv4.h (ASM_OUTPUT_REG_PUSH): Remove 64-bit support. + (ASM_OUTPUT_REG_POP): Likewise. + +2002-07-18 Alan Modra + + * config/rs6000/rs6000.c (first_reg_to_save): Remove bogus + adjustments to first_reg for profiling case. + (output_function_profiler): Correct lr save slot for ABI_AIX_NODESC. + Disable profiling for 64 bit code on both ABI_V4 and ABI_AIX_NODESC. + Save static chain reg to sp + 12 on ABI_AIX_NODESC. + * config/rs6000/sysv4.h (ASM_OUTPUT_REG_PUSH): Define. + (ASM_OUTPUT_REG_POP): Define. + * config/rs6000/linux64.h (ASM_OUTPUT_REG_PUSH): Undef. + (ASM_OUTPUT_REG_POP): Undef. + +2002-07-17 Neil Booth + + * cpplib.c (do_sccs): Handle #sccs on all systems. + * system.h (SCCS_DIRECTIVE): Poison. + * config/darwin.h, config/freebsd.h, config/netbsd.h, + config/ptx4.h, config/svr3.h, config/svr4.h, config/alpha/elf.h, + config/arm/linux-elf.h, config/c4x/c4x.h, config/d30v/d30v.h, + config/i370/i370.h, config/i386/gas.h, config/i386/sco5.h, + config/i960/i960.h, config/m68hc11/m68hc11.h, config/m68k/3b1.h, + config/m68k/3b1g.h, config/m68k/crds.h, config/m68k/mot3300.h, + config/m68k/pbb.h, config/m88k/m88k.h, config/mips/mips.h, + config/sparc/pbd.h, config/stormy16/stormy16.h, config/vax/vaxv.h: + Remove all references to SCCS_DIRECTIVE. + * doc/cpp.texi, doc/tm.texi: Update. + +Wed Jul 17 19:23:32 2002 J"orn Rennecke + + * regrename.c (maybe_mode_change): New function. + (find_oldest_value_reg, copyprop_hardreg_forward_1): Use it. + +2002-07-17 Rodney Brown + + * config/i386/i386.c (ix86_expand_int_movcc): In the general case + suppress addition when either ct or cf are zero. + +2002-07-17 Eric Botcazou + Glen Nakamura + + PR optimization/6713 + * loop.c (loop_givs_rescan): Explicitly delete the insn that + sets a non-replaceable giv after issuing the new one. + +2002-07-17 Neil Booth + + * cppexp.c (cpp_interpret_integer, append_digit, parse_defined, + eval_token): Clarify and correct use of "bool" variables. + * cpplib.h (struct cpp_options): Similarly. + * cppmacro.c (parse_params, _cpp_save_parameter): Ditto. + * cpptrad.c (recursive_macro): Similarly. + +Wed Jul 17 17:08:06 2002 J"orn Rennecke + + * config/sh/lib1funcs.asm (udivsi3_i4): Implement SHcompact version in + SHmedia code. + + * sh.md (cmpgtudi_media): Remove spurious @. + + * config/sh/lib1funcs.asm (FMOVD_WORKS): Don't define for little endian. + * sh.h (OVERRIDE_OPTIONS): Don't set FMOVD_BIT for little endian. + + * config/sh/lib1funcs.asm (init_trampoline): New entry point. + * sh-protos.h (sh_initialize_trampoline): Declare. + * sh.c (sh_initialize_trampoline): New function. + * sh.h (TRAMPOLINE_SIZE): Only 24 for TARGET_SHMEDIA32. + (TRAMPOLINE_ALIGNMENT): Need cache-line alignment for TARGET_SHMEDIA. + (INITIALIZE_TRAMPOLINE): Call sh_initialize_trampoline. + (TRAMPOLINE_ADJUST_ADDRESS): Not needed for SHcompact. + * sh.md (initialize_trampoline, double_shori): New patterns. + (initialize_trampoline_compact): Likewise. + (shmedia32_initialize_trampoline_big): Remove. + (shmedia32_initialize_trampoline_little): Likewise. + + * sh-protos.h (binary_float_operator): Remove declaration. + (sh_expand_unop_v2sf, sh_expand_binop_v2sf): Declare. + * sh.c (print_operand, case 'N'): Check against CONST0_RTX. + (unary_float_operator, sh_expand_unop_v2sf): New functions. + (sh_expand_binop_v2sf): Likewise. + (zero_vec_operand): Delete. + (SH_BLTIN_UDI): New builtin shared signature define. Renumbered + all non-shared ones. + (bdesc): Change all the mextr builtins to use SH_BLTIN_UDI. + Enable nsb and byterev. + * sh.h (CONDITIONAL_REGISTER_USAGE): Initialize DF_HI_REGS. + (HARD_REGNO_MODE_OK): Allow TImode in fp regs. Allow V2SFmode + in general regs. + (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add DF_HI_REGS. + (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. Remove clause for + immediate operands. + (SECONDARY_INPUT_RELOAD_CLASS): Add clause for immediate operands. + Add DF_HI_REGS. + (CLASS_CANNOT_CHANGE_MODE, CLASS_CANNOT_CHANGE_MODE_P): Allow + lowpart fp regs - only for big endian for now. + (LEGITIMATE_CONSTANT_P): Don't allow nonzero float vectors + when FPU is in use. + (EXTRA_CONTRAINT_U): Check against CONST0_RTX. + (LOAD_EXTEND_OP): NIL for SImode. + (REGISTER_MOVE_COST): Add DF_HI_REGS. Const for moves between + general and fp registers is 4. + PREDICATE_CODES: Amend binary_float_operator entry. + Remove zero_vec_operand. Add unary_float_operator. + * sh.md (udivsi3_i4_media): Use truncate instead of paradoxical + subreg SET_DEST. + (truncdisi2, truncdihi2, movv2sf): Allow memory destinations. + (truncdiqi2): Do sign extension. + (movsi_media, movdi_media): Allow to use r63 to an fp register. + (movdf_media, movsf_media): Likewise. + (movv2sf_i, movv2sf_i+1): Don't use f{ld,st}.p or SUBREGS. + Collapse to one define_insn_and_split. Allow immediate sources. + (addv2sf3, subv2sf3, mulv2sf3, divv2sf3): New patterns. + (movv4sf_i): Allow immediate sources. Use simplify_gen_subreg. + (movv4sf): Allow immediate sources. + (movsf_media_nofpu+1): Don't split moves to FP registers. + (unary_sf_op, binary_sf_op, mshflo_w_x, concat_v2sf): New patterns. + (movv8qi_i+3): Check against CONST0_RTX. + (mextr1, mextr2. mextr3. mextr4, mextr5, mextr6, mextr7): Use DImode + for input and output operands. Fix argument 3 to gen_mextr_rl. + (mmul23_wl, mmul01_wl, mmulsum_wq_i): s/const_vector/parallel/ + (msad_ubq_i, mshf4_b, mshf0_b, mshf4_l, mshf0_l, mshf4_w): Likewise. + (mshf0_w, fipr, ftrv): Likewise. + (mshfhi_l_di): Now insn_and_split. Can handle FP regs. + +2002-07-17 Jeroen Dobbelaere + + * arm.h (ARM_NUM_INTS, ARM_NUM_REGS, ARM_NUM_REGS2): Renamed from + NUM_INTS, NUM_REGS and ARM_NUM_REGS2 respectively. All uses changed. + * arm.c: Similarly. + +2002-07-17 Richard Sandiford + + * config/mips/mips-protos.h (mips_sign_extend): Declare. + * config/mips/mips.h (MASK_DEBUG_H, TARGET_DEBUG_H_MODE): Remove. + (TARGET_SWITCHES): Remove debugh. + (ISA_HAS_TRUNC_W): New macro. + (CLASS_CANNOT_CHANGE_MODE): Include FP_REGS if TARGET_FLOAT64. + (PREDICATE_CODES): Remove se_nonimmediate_operand. + * config/mips/mips.c (movdi_operand): Allow sign-extensions of + any SImode move_operand. + (se_nonimmediate_operand): Remove. + (mips_sign_extend): New. + (mips_move_2words): Use it for sign-extended source operands. + (override_options): Allow integers to be put into single FPRs. + (mips_secondary_reload_class): Handle integers in float registers. + * config/mips/mips.md (extendsidi2): Turn into a define_expand. + (fix_truncsfsi2, fix_truncdfsi2): Likewise. + (fix_truncdfsi2_insn, fix_truncdfsi2_macro): New. + (fix_truncsfsi2_insn, fix_truncsfsi2_macro): New. + (fix_truncdfdi2): Provide only a single alternative, in which the + integer is in a float register. Depend on TARGET_FLOAT64 rather + than TARGET_64BIT. + (fix_truncsfdi2, floatdidf2, floatdisf2): Likewise. + (floatsidf2, floatsisf2): Likewise, but no TARGET_FLOAT64 dependency. + (movdi_internal2): Don't allow the source operand to be sign-extended. + Add alternatives for float registers. + (*movdi_internal2_extend): New. Version of movdi_internal2 that + allows sign-extension. + (*movdi_internal2_mips16): Name the existing mips16 movdi pattern. + (movsi_internal2): Rename to movsi_internal. Add alternatives for + float registers. Remove TARGET_DEBUG_H_MODE test. + (movhi_internal1): Rename to movhi_internal. Don't check + TARGET_DEBUG_H_MODE. Fix transposed *d and *f source constraints. + (movqi_internal1): Rename to movqi_internal and remove + TARGET_DEBUG_H_MODE dependency. + (movsi_internal1, movhi_internal2, movqi_internal2): Remove. + +2002-07-16 Jim Wilson + + * toplev.c (lang_dependent_init): Create function context for + init_expr_once. + +2002-07-16 Hans-Peter Nilsson + + * config/cris/linux.h (CRIS_LINK_SUBTARGET_SPEC): Don't + --gc-sections if -r. + * config/cris/cris.h: Ditto. + +2002-07-16 Rodney Brown + + * config/i386/i386.c (ix86_expand_int_movcc): In the case where + the comparison directly gives a mask suppress addition when cf is + zero by complementing the mask. + +2002-07-16 Nathanael Nerode + + * Makefile.in: Delete references to enquire. + * enquire.c: Move to contrib. + +2002-07-16 Stan Shebs + + * config/darwin.h (ASM_OUTPUT_LABEL): Move to here from + config/rs6000/darwin.h. + (ASM_OUTPUT_SKIP): Ditto. + (TEXT_SECTION_ASM_OP): Ditto. + (DATA_SECTION_ASM_OP): Ditto. + (ASM_APP_ON): Define. + (ASM_APP_OFF): Define. + * config/rs6000/darwin.h (ASM_OUTPUT_LABEL, ASM_OUTPUT_SKIP, + TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Remove. + + * config/darwin.c (func_name_maybe_scoped): Remove unused decl. + (machopic_function_base_name): Declare result to be const. + (machopic_non_lazy_ptr_name): Ditto. + (machopic_stub_name): Ditto. + * config/darwin-protos.h: Ditto for the prototypes. + +Wed Jul 17 00:22:39 CEST 2002 Jan Hubicka + + * m68hc11.c (m68hc11_reorg): Do not rebuild CFG. + +Wed Jul 17 00:20:48 CEST 2002 Jan Hubicka + + * i386.md (prefetch): Fix for 64bit mode. + (prefetch_sse_rex, prefetch_3dnow_rex): New patterns. + +Wed Jul 17 00:19:20 CEST 2002 Jan Hubicka + + * i386.h (MACHINE_DEPENDENT_REORG): New macro. + * i386.c (x86_machine_dependent_reorg): New function. + * i386-protos.h (x86_machine_dependent_reorg): Declare. + +2002-07-16 Zack Weinberg + + * builtins.c (std_expand_builtin_va_start): Remove unused + first argument. + (expand_builtin_va_start): Call EXPAND_BUILTIN_VA_START and + std_expand_builtin_va_start with just two arguments. + * expr.h: Update prototypes. + + * alpha-protos.h, alpha.h, alpha.c, arc-protos.h, arc.h, + arc.c, d30v-protos.h, d30v.h, d30v.c, i386-protos.h, i386.h, + i386.c, i960-protos.h, i960.h, i960.c, m88k-protos.h, m88k.h, + m88k.c, mips-protos.h, mips.h, mips.c, mn10300-protos.h, + mn10300.h, mn10300.c, pa-protos.h, pa.h, pa.c, + rs6000-protos.h, rs6000.h, rs6000.c, s390-protos.h, s390.h, + s390.c, sh-protos.h, sh.h, sh.c, sparc-protos.h, sparc.h, + sparc.c, stormy16-protos.h, stormy16.h, stormy16.c, + xtensa-protos.h, xtensa.h, xtensa.c: Remove unused first + argument from all implementations of EXPAND_BUILTIN_VA_START + and all uses of std_expand_builtin_va_start. + +Tue Jul 16 19:32:58 2002 J"orn Rennecke + + * regrename.c (copy_value): Don't record high part copies. + +2002-07-16 Steve Ellcey + + * gcc/config/pa/long_double.h (FIXUNS_TRUNCTFDI2_LIBCALL): New define. + (fixunstfdi_libfunc): Change to use FIXUNS_TRUNCTFDI2_LIBCALL. + * gcc/config/pa/quadlib.c (_U_Qfcnvfxt_quad_to_udbl): New function. + +2002-07-16 Ian Dall + + * doc/invoke.texi (NS32K Options): Document -mieee-compare option + + * config/ns32k/ns32k.md (addsi3, *frame_addr, *stack_addr): merge + into addsi3 using register class "x" and "y". + + * config/ns32k/ns32k.md (*madddf, *maddsf, *msubdf, *msubsf): + "earlyclobber" constraint modifier for some alternative. + + * config/ns32k/ns32k.md (tstdf, tstsf, cmpdf, cmpsf, blt, ble) + (*ble, *blt): Flag to indicate bCOND and sCOND should check for + unordered. + config/ns32k/ns32k.h (CC_UNORD): define corresponding mask. + + * config/ns32k/ns32k.h (TARGET_IEEE_COMPARE, MASK_IEEE_COMPARE) + (TARGET_SWITCHES): Add -mieee-compare option. + (OVERRIDE_OPTIONS): 32332 is a subset of + 32532. Don't use IEEE_COMPARE -funsafe-math-optimizations. + (TARGET_SWITCHES): Fix description of bitfield option. + * config/ns32k/netbsd.h (TARGET_DEFAULT): Add + -mieee-compare option. Remove 32332 flag. + +2002-07-16 Steve Ellcey + + * explow.c (convert_memory_address): Remove special handling + when POINTERS_EXTEND_UNSIGNED < 0. + * config/ia64.md (movsi_symbolic): New instruction for ILP32 mode. + (movedi_symbolic): Fix typo. + (load_fptr): Remove mode restriction so it works for SI and DI. + (load_fptr_internal1): Ditto. + (load_gprel): Ditto. + (load_symptr_internal1): Ditto. + (call_pic): Ditto. + * config/ia64.c (call_operand): Modify mode check. + (ia64_expand_load_address): Handle DI and SI addresses and symbols. + (ia64_expand_move): Ditto. + (ia64_assemble_integer): Handle SImode function pointers. + (ia64_expand_fetch_and_op): Handle SImode mem addresses. + (ia64_expand_op_and_fetch): Ditto. + (ia64_expand_compare_and_swap): Ditto. + (ia64_expand_lock_test_and_set): Ditto. + (ia64_expand_lock_release): Ditto. + +2002-07-16 Jeroen Dobbelaere + + * arm.c (emit_sfm): Don't set RTX_FRAME_RELATED_P on DWARF. + +2002-07-16 Jeroen Dobbelaere + Richard Earnshaw + + * arm.h (LEGITIMATE_PIC_OPERAND_P): Only test + CONSTANT_POOL_ADDRESS_P if a SYMBOL_REF. Simplify logic. + +2002-07-16 Richard Earnshaw + + * arm.md (stack_tie): New insn. Use an idiom that the alias code + understands to be a memory clobber. + * arm.c (arm_expand_prologue): Use it. + +2002-07-16 Daniel Berlin + + * ra-rewrite.c: #include reload.h, insn-config.h + * ra-build.c: #include reload.h + * Makefile.in: Update ra-rewrite.o, ra-build.o dependencies to + depend on reload.h, insn-config.h. + +Tue Jul 16 11:57:45 2002 J"orn Rennecke + + * expr.c (emit_move_insn_1): Handle arbitrary moves that are + the same size as a word. + + * regrename.c (find_oldest_value_reg): Take WORDS_BIG_ENDIAN / + BYTES_BIG_ENDIAN into account. + +Tue Jul 16 12:22:44 CEST 2002 Jan Hubicka + + * i386.md (prefetch): Fix for 64bit mode. + (prefetch_sse_rex, prefetch_3dnow_rex): New patterns. + + * i386.md (movss, movsd): Use xorps/xorpd for Athlon. + +2002-07-16 Marek Michalkiewicz + + * hard-reg-set.h (TEST_HARD_REG_BIT): Return 1 if the bit is set. + +2002-07-15 Zack Weinberg + + * ginclude/varargs.h: Replace with stub which issues #error. + * ginclude/stdarg.h: __builtin_stdarg_start is renamed + __builtin_va_start. + + * builtins.def (BUILT_IN_VARARGS_START): Delete. + (BUILT_IN_VA_START): New. + * builtins.c (expand_builtin_va_start): Eliminate first + argument and code to implement pre-ISO varargs. + (std_expand_builtin_va_start): Ignore first argument; it is + always 1. + (expand_builtin): Handle BUILT_IN_VA_START and + BUILT_IN_STDARG_START identically. Delete + BUILT_IN_VARARGS_START case. + + * function.c (assign_parms): Delete hide_last_arg and all + its uses. + (mark_varargs): Delete function. + * function.h (struct function): Delete 'varargs' bit. + (current_function_varargs): Delete macro. + * tree.h: Don't declare mark_varargs. + + * c-decl.c (c_function_varargs, c_mark_varargs): Delete. + (c_expand_body): Don't call mark_varargs. + * c-objc-common.c: Handle BUILT_IN_VA_START and + BUILT_IN_STDARG_START identically. Delete + BUILT_IN_VARARGS_START case. + * c-tree.h: Don't declare c_mark_varargs. + * c-parse.in: Remove grammar rules for '&...' (which has been + commented out since before 2.7.2) and for '...' in K+R + argument declarations. + + * builtins.c, function.c, integrate.c, sibcall.c, + config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h, + config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c, + config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c, + config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h, + config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, + config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c, + config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h, + config/stormy16/stormy16.c: Delete all references to + current_function_varargs, and code predicated on that flag. + + * config/alpha/alpha.c (alpha_va_start), + config/arc/arc.c (arc_va_start), + config/i386/i386.c (ix86_va_start), + config/mips/mips.c (mips_va_start), + config/mn10300/mn10300.c (mn10300_va_start), + config/rs6000/rs6000.c (rs6000_va_start), + config/s390/s390.c (s390_va_start), + config/sh/sh.c (sh_va_start), + Ignore first argument; it is always 1. + + * config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start. + * config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start. + * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c: + Delete m68hc11_va_start. + * config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h: + No need to define EXPAND_BUILTIN_VA_START. + + * doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi, + doc/trouble.texi: Remove references to GCC-provided . + +2002-07-15 Eric Botcazou + + PR optimization/7153 + * regmove.c (optimize_reg_copy_3): Don't optimize if the register + dies in more than one insn. + +2002-07-15 Jason Thorpe + + * config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Remove. + +2002-07-15 Michael Matz , + Daniel Berlin , + Denis Chertykov + + Add a new register allocator. + + * ra.c: New file. + * ra.h: New file. + * ra-build.c: New file. + * ra-colorize.c: New file. + * ra-debug.c: New file. + * ra-rewrite.c: New file. + + * Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o, + (ra-rewrite.o): New .o files for libbackend.a. + (GTFILES): Add basic-block.h. + + * toplev.c (flag_new_regalloc): New. + (f_options): New option "new-ra". + (rest_of_compilation): Call initialize_uninitialized_subregs() + only for the old allocator. If flag_new_regalloc is set, call + new allocator, instead of local_alloc(), global_alloc() and + friends. + + * doc/invoke.texi: Document -fnew-ra. + * basic-block.h (FOR_ALL_BB): New. + * config/rs6000/rs6000.c (print_operand): Write small constants + as @l+80. + + * df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg. + (df_reg_table_realloc): Make size at least as large as max_reg_num(). + (df_insn_table_realloc): Size argument now is absolute, not relative. + Changed all callers. + + * gengtype.c (main): Add the pseudo-type "HARD_REG_SET". + * regclass.c (reg_scan_mark_refs): Ignore NULL rtx's. + + 2002-06-20 Michael Matz + + * df.h (struct ref.id): Make unsigned. + * df.c (df_bb_reg_def_chain_create): Remove unsigned cast. + + 2002-06-13 Michael Matz + + * df.h (DF_REF_MODE_CHANGE): New flag. + * df.c (df_def_record_1, df_uses_record): Set this flag for refs + involving subregs with invalid mode changes, when + CLASS_CANNOT_CHANGE_MODE is defined. + + 2002-05-07 Michael Matz + + * reload1.c (fixup_abnormal_edges): Don't insert on NULL edge. + + 2002-05-03 Michael Matz + + * sbitmap.c (sbitmap_difference): Accept sbitmaps of different size. + + Sat Feb 2 18:58:07 2002 Denis Chertykov + + * regclass.c (regclass): Work with all regs which have sets or + refs. + (reg_scan_mark_refs): Count regs inside (clobber ...). + + 2002-01-04 Michael Matz + + * df.c (df_ref_record): Correctly calculate SUBREGs of hardregs. + (df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only + add new refs. + (df_bb_refs_update): Don't clear insns_modified here, ... + (df_analyse): ... but here. + + * sbitmap.c (dump_sbitmap_file): New. + (debug_sbitmap): Use it. + + * sbitmap.h (dump_sbitmap_file): Add prototype. + + 2001-08-07 Daniel Berlin + + * df.c (df_insn_modify): Grow the UID table if necessary, rather + than assume all emits go through df_insns_modify. + + 2001-07-26 Daniel Berlin + + * regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS, + increase REG_N_REFS (like flow does), so that regclass doesn't + think a reg is useless, and thus, not calculate a class, when it + really should have. + + 2001-01-28 Daniel Berlin + + * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for + dataflow analysis. + +2002-07-15 Jakub Jelinek + + PR middle-end/7245 + * config/i386/i386.c (const_int_1_31_operand): New. + * config/i386/i386.h (PREDICATE_CODES): Add it. + * config/i386/i386.md (ashlsi3_cmp, ashlsi3_cmp_zext, ashlhi3_cmp, + ashlqi3_cmp, ashrsi3_cmp, ashrsi3_cmp_zext, ashrhi3_cmp, ashrqi3_cmp, + lshrsi3_cmp, lshrsi3_cmp_zext, lshrhi3_cmp, lshrqi3_cmp): Use it. + +2002-07-14 Alan Modra + + PR target/7282 + * config/rs6000/rs6000.md (floatsidf2): Enable for POWERPC64. + (floatunssidf2): Likewise. + (floatsidf_ppc64): New insn_and_split. + (floatunssidf_ppc64): Likewise. + +2002-07-14 Andreas Jaeger + + * config.gcc (sh64): Remove unused + target_requires_64bit_host_wide_int. + +2002-07-12 Roger Sayle + + * expr.c [CLEAR_RATIO]: New macro defining the maximum number + of move instructions to use when clearing memory, c.f. MOVE_RATIO. + [CLEAR_BY_PIECES]: New macro, using CLEAR_RATIO, to determine + whether clear_by_pieces should be used to clear storage. + (clear_storage): Use CLEAR_BY_PIECES instead of MOVE_BY_PIECES. + + * doc/tm.texi: Document these two new target macros. + +2002-07-12 Stephane Carrez + + * config/m68hc11/m68hc11.md ("zero_extendsidi2"): Use D_REG only for + the scratch register. + ("*movhi2_push"): Accept Z_REG because a split pattern can make use + of it, forbid reload to use it. + +2002-07-12 Marek Michalkiewicz + + * config/avr/avr.c (test_hard_reg_class): Fix TEST_HARD_REG_BIT + usage on 64-bit hosts, return value was truncated to 32 bits. + +Fri Jul 12 00:49:36 2002 J"orn Rennecke + + * simplify-rtx.c (simplify_subreg): Handle floating point + CONST_DOUBLEs. When an integer subreg of a smaller mode than + the element mode is requested, compute a subreg with an + integer mode of the same size as the element mode first. + +Thu Jul 11 22:02:57 2002 J"orn Rennecke + + * combine.c (try_combine): When converting a paradoxical subreg + to an extension, take LOAD_EXTEND_OP into account. + +2002-07-11 Rainer Orth + + * config.gcc (mips-sgi-irix6*o32): New configuration. + + * configure.in (libgcc_visibility): Disable for mips-sgi-irix6*o32 + configurations. + * configure: Regenerate. + + * config/mips/iris6-o32-as.h: New file. + * config/mips/iris6-o32.h: New file. + + * config/mips/iris5gas.h (TARGET_ASM_NAMED_SECTION): Define. + (NM_FLAGS): Define. + (HAVE_AS_SHF_MERGE): Undefine. + + * config/mips/t-iris5-as: New file. + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it. + + * config/mips/t-iris6 (SHLIB_EXT, SHLIB_SOLINK, SHLIB_SONAME, + SHLIB_NAME, SHLIB_MAP, SHLIB_OBJS, SHLIB_SLIBDIR_QUAL, SHLIB_LINK, + SHLIB_INSTALL, SHLIB_MKMAP, SHLIB_MAPFILES, FPBIT, DPBIT, + dp-bit.c, fp-bit.c): Move ... + * config/mips/t-iris5-6: ... here. + New file, shared by IRIX 5 and IRIX 6. + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix6*, + mips-sgi-irix5*): Use it. + + * config/mips/iris6.h: Remove duplicate comment. + + * config/mips/mips.c (TARGET_ASM_UNALIGNED_DI_OP) [TARGET_IRIX5 && + !TARGET_IRIX6]: Define. + (mips_asm_file_start): Don't emit mdebug. sections on IRIX 5/6. + + * config/mips/mips.h (ASM_DECLARE_FUNCTION_NAME): Fix comment. + +2002-07-11 John David Anglin + + * pa.md (adddi3): Change predicate of operand 2 to adddi3_operand + and delete code to force constant to register. + * pa-protos.h (adddi3_operand): Add prototype. + * pa.c (adddi3_operand): New function. + +2002-07-11 Roger Sayle + + * c-decl.c (duplicate_decls): Preserve the noreturn attribute on + non-ANSI builtin functions. + +Thu Jul 11 11:31:12 2002 J"orn Rennecke + + * rtl.h (gen_rtx_CONST_VECTOR): Declare. + * gengenrtl.c (special_rtx): Check for CONST_VECTOR. + * emit-rtl.c (gen_rtx_CONST_VECTOR): New function. + (gen_const_vector_0): Use it. + +2002-07-11 John David Anglin + + * pa.md (adddi3): For 32-bit targets, force constants to a register + if they don't fit in an 11-bit immediate. Change insn predicate to + arith11_operand. Remove comment. + * pa.c (cint_ok_for_move): Fix comment. + (emit_move_sequence): Don't directly split DImode constants on 32-bit + targets. + +2002-07-11 Tim Josling + + Remove front end hard coding from gengtype.c. + + * Makefile.in + (STAGESTUFF): add gtyp-gen.h + (GTFILES): Remove front end specific files. + (GTFILES_FILES_LANGS): New, from configure.. + (GTFILES_FILES_FILES): Likewise. + (GTFILES_LANG_DIR_NAMES): Likewise. + (GTFILES_SRCDIR): Likewise. + (gtyp-gen.h): Build from configure information. + (s-gtype): Remove command line parameters from gengtype. + (gengtype.o): Remove dependency on GTFILES. Depend on gtyp-gen.h. + (mostlyclean): Delete files generated by and for gengtype. + + * c-config-lang.in: New file. + + * configure.in (all_gtfiles_files_langs): New. Accumulate files + for each language. + (all_gtfiles_files_files): New. Accumulate language for each file + accumulated. + (gtfiles): Pick up value for C. + (srcdir): AC-SUBST this variable. + (all_gtfiles_files_langs): AC-SUBST this variable. + (all_gtfiles_files_files): AC-SUBST this variable. + + * configure: Regenerate. + + * gengtype-lex.l (parse_file): Make parameter const. + + * gengtype.c (toplevel): include gtyp-gen.h. + (BASE_FILE_ unnamed enum): Delete. + (lang_names): Delete (replaced by gtyp-gen.h) + (lang_dir_names): From gtyp-gen.h, replaces lang_names; changed + all references. + (NUM_GT_FILES): New. + (NUM_LANG_FILES): New. + (srcdir_len): New. + (NUM_BASE_FILES): Change calculation. + (open_base_files): Change prototype to avoid warning. + (startswith): Delete. + (get_file_basename): Iterate through generated language list not + hard coded list. + (get_base_file_bitmap): Use generated list of files and languages. + (close_output_files): Add prototype to rmove warning. + (main): Iterate through list of generated files from gtyp-gen.h + rather than command line paramaters. Ignore duplicated file + names. + + * gengtype.h (parse_file): Amend prototype for const parameter. + + * doc/sourcebuild.texi: Document gtfiles variable. + + * doc/gty.texi: Document changes to gtfiles variable for front + ends. + + * objc/config-lang.in (gtfiles): Add files needed for objc front + end. + +2002-07-10 Roger Sayle + + PR c/2454 + * combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply + to SUBREGs of MEMs. (num_sign_bit_copies): Likewise. + +2002-07-10 Roger Sayle + Zack Weinberg + + * builtins.def: Make the argument types of abort and exit + independent of the front-end. + +2002-07-11 Alan Modra + + * config/rs6000/linux64.h (ASM_SPEC): Define. + +2002-07-10 Aldy Hernandez + + * config/rs6000/rs6000.c (emit_frame_save): New. + (rs6000_frame_related): Replace reg2 before reg. + (rs6000_emit_prologue): Use emit_frame_save for saving gprs, fprs, + and eh_return registers. + +2002-07-10 Toon Moene + + Revert all patches for optimization of Complex .op. Real. + * complex_part_zero_p: Remove + * expand_cmplxdiv_straight: Replace complex_part_zero_p(x) + with x. + * expand_cmplxdiv_wide: Ditto. + * expand_binop: Ditto. + +2002-07-10 Marek Michalkiewicz + + * config/avr/avr.md: Fix two 0x80000000 constants to make them + negative also on 64-bit hosts. + + Default to -fno-reorder-blocks when optimizing for size. + * config/avr/avr-protos.h (avr_optimization_options): Declare. + * config/avr/avr.c (avr_optimization_options): New function. + * config/avr/avr.h (OPTIMIZATION_OPTIONS): New. + + Optimize returning from simple functions. + * config/avr/avr-protos.h (avr_simple_epilogue): Declare. + * config/avr/avr.c (avr_simple_epilogue): New function. + * config/avr/avr.md (return): New insn. + +2002-07-10 Douglas B Rupp + + * config/i386/i386.c (ix86_svr3_asm_out_constructor): Add + HAS_INIT_SECTION to protection. + +2002-07-10 Mark Mitchell + + * doc/invoke.texi (Debugging Options): Mention that -gdwarf is + deprecated. + +Wed Jul 10 19:50:03 2002 J"orn Rennecke + + * combine.c (gen_lowpart_for_combine): Handle vector modes. + Supply non-VOID mode to simplify_gen_subreg. + +Wed Jul 10 18:48:55 CEST 2002 Jan Hubicka + + * i386.c (ix86_init_mmx_sse_builtins): Fix thinko. + +2002-07-10 Jeffrey A Law + + * mn10200.c (expand_prologue): Create REG_MAYBE_DEAD notes + as appropriate. + + * mn10200.c (expand_epilogue): Fix test to determine which scratch + register to use. + +Wed Jul 10 16:06:00 2002 J"orn Rennecke + + * cse.c (cse_insn): Supply proper SUBREG_BYTE to simplify_gen_subreg. + Get mode from dest. + If simplify_gen_subreg fails, try next equivalent. + +2002-07-09 Gabriel Dos Reis + + * diagnostic.h: #include location.h + (location_t): Move definition to.. + * location.h: ... here. New file. + * tree.h: #include location.h + (DECL_SOURCE_LOCATION): New macro. + (DECL_SOURCE_FILE): Use. + (DECL_SOURCE_LINE): Likewise. + (struct tree_decl): REplace filename and linenum with locus. + * Makefile.in (TREE_H): add location.h + (diagnostic.o): Depends on gt-location.h + (gt-location.h): Depends on s-gtype + +2002-07-09 Matt Kraai + + * config/rs6000/aix.h: Convert CPP_PREDEFINES to + TARGET_OS_CPP_BUILTINS. + * config/rs6000/aix31.h: Likewise. + * config/rs6000/aix41.h: Likewise. + * config/rs6000/aix43.h: Likewise. + * config/rs6000/aix51.h: Likewise. + * config/rs6000/beos.h: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/eabi.h: Likewise. + * config/rs6000/eabisim.h: Likewise. + * config/rs6000/linux.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/lynx.h: Likewise. + * config/rs6000/mach.h: Likewise. + * config/rs6000/rtems.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/rs6000/vxppc.h: Likewise. + +2002-07-09 Devang Patel + * objc/objc-act.c (adjust_type_for_id_default): Fix my previous patch. + Do not allow ObjC objects as a parameter type for Objective-C methods. + My previous patch restricted 'struct' also. + +2002-07-09 Neil Booth + + * cpperror.c (cpp_error): Default to directive_line within + directives here. + * cppexp.c (cpp_interpret_integer): Only use traditional + number semantics in directives. + * cpplib.c (prepare_directive_trad): Don't reset pfile->line. + (do_include_common): Similarly. + * cpptrad.c (scan_out_logical_line): Implement accurate + quoting of <> in #include. + * doc/cpp.texi: Update. + +Tue Jul 9 22:37:44 2002 Stephen Clarke + J"orn Rennecke + + * sh.c (sh_adjust_cost): Special handling of SHMEDIA code. + * sh.md (attribute issues): Replace with: + (attribute pipe_model). All users changed. + (attribute type): Change pt / ptabs to pt_media / ptabs_media. + All users changed. + (function units sh5issue, sh5fds): New. + (attribute is_mac_media): New. + (adddi3_media, subdi3_media, divsi3_i1_media, anddi3): Add type. + (andcdi3, iordi3, xordi3, ashldi3_media, lshrdi3_media): Likewise. + (ashrdi3_media, negdi_media, extendsidi2, movqi_media): Likewise. + (movhi_media, shori_media, movv2sf_i, jump_media): Likewise. + (call_media, call_value_media, sibcall_media): Likewise. + (casesi_jump_media, casesi_shift_media, casesi_load_media): Likewise. + (return_media_i, addsf3_media, subsf3_media, mulsf3_media): Likewise. + (mac_media, divsf3_media, floatdisf2, floatsisf2_media): Likewise. + (fix_truncsfdi2, fix_truncsfsi2_media, cmpeqsf_media): Likewise. + (cmpgtsf_media, cmpgesf_media, cmpunsf_media, negsf2_media): Likewise. + (sqrtsf2_media, abssf2_media, adddf3_media, subdf3_media): Likewise. + (muldf3_media, divdf3_media, floatdidf2, floatsidf2_media): Likewise. + (fix_truncdfdi2, fix_truncdfsi2_media, cmpeqdf_media): Likewise. + (cmpgtdf_media, cmpgedf_media,cmpundf_media, negdf2_media): Likewise. + (sqrtdf2_media, absdf2_media, extendsfdf2_media): Likewise. + (truncdfsf2_media): Likewise. + (movsi_media, movsi_media_nofpu, movdi_media): Use new types. + (movdi_media_nofpui, movdf_media, movdf_media_nofpu): Likewise. + +Tue Jul 9 21:39:50 2002 J"orn Rennecke + + * sh.h (PREDICATE_CODES): Add general_extend_operand and inqhi_operand. + * sh.c (general_extend_operand, inqhi_operand): New functions. + * sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Collapse + alternatives using 'N' modifier. Add type. + (adddi3z_media): Likewise. Enable generator function generation. + (movdicc_false, movdicc_true, addsi3_media, subsi3_media): Use more + exact predicates / constraints. Add type. + (subsi3): Allow 0 for SHMEDIA. + (udivsi3_i4_media): Use match_operand for input values + rather than hard registers. + (udivsi3 - TARGET_SHMEDIA_FPU case): Don't ferry values + unnecessarily through hard registers. Keep copies of pseudo + registers outside of the libcall sequence. + (mulsidi3_media, umulsidi3_media): Use more exact predicates. Add type. + (ashlsi3_media, ashrsi3_media, lshrsi3_media): Likewise. + (zero_extendsidi2, zero_extendhidi2, zero_extendqidi2): Likewise. + (extendhidi2, extendqidi2): Likewise. + (andsi3_compact): Name. + (andcdi3): Enable generator function generation. + (zero_extendhisi2, zero_extendqisi2): Rename to + (zero_extendhisi2_compact, zero_extendqisi2_compact). + (extendhisi2, extendqisi2): Rename to + (extendhisi2_compact, extendqisi2_compact). + (rotldi3, rotldi3_mextr, rotrdi3, rotrdi3_mextr): New patterns. + (loaddi_trunc, zero_extendhisi2, zero_extendhisi2_media): Likewise. + (zero_extendhisi2_media+1, zero_extendqisi2): Likewise. + (zero_extendqisi2_media, extendhisi2, extendhisi2_media): Likewise. + (extendhisi2_media, extendhisi2_media+1, extendqisi2): Likewise. + (extendqisi2_media, extendqisi2_media+1, truncdisi2): Likewise. + (truncdihi2, truncdiqi2, reload_inqi, reload_inhi): Likewise. + (shmedia32_initialize_trampoline_big): Likewise. + (shmedia32_initialize_trampoline_little): Likewise. + (nsb, nsbsi, nsbdi, ffsdi2, ffssi2, byterev): Likewise. + (negdi2): Remove spurious T clobber. + (zero_extendhidi2+1, extendhidi2+1, extendqidi2+1): Handle TRUNCATE. + (movsi_media, movsi_media_nofpu): Remove spurious *k after b. + (movdi_media, movdi_media_nofpu, pt, ptb): Likewise. + (movsi_media_nofpu+2, movhi_media+1): Only do split after reload. + (ic_invalidate_line_media): Write back data cache before invalidating + instruction cache. Add type. + (movsf_media): Sign-extend when the destination is a general + purpose register. Add type. + (bgt_media, bge_media, bgtu_media, bgeu_media, blt_media_i): Allow 0. + (casesi_worker_0+1): Only increment ref count for proper label. + (casesi_worker_0+2): Likewise. + +2002-07-09 Mark Mitchell + + * dwarfout.c (dwarfout_init): Warn that DWARF1 is deprecated. + +2002-07-09 Steve Ellcey + + * gcc/except.c (expand_eh_region_end_cleanup): Change exception pointer + from Pmode to ptr_mode. + (get_exception_pointer): Ditto. + (connect_post_landing_pads): Ditto. + (dw2_build_landing_pads): Ditto. + +2002-07-08 Steve Ellcey + * gcc/c-pragma.h (add_to_renaming_pragma_list): New function. + * gcc/c-pragma.c (add_to_renaming_pragma_list): New function. + (handle_pragma_redefine_extname): Change to use new function. + +2002-07-08 Roger Sayle + + * combine.c (combine_simplify_rtx): Add an explicit cast + to avoid signed/unsigned comparison warning. + (simplify_if_then_else): Likewise. + (extended_count): Likewise. + (simplify_shift_const): Likewise. + (simplify_comparison): Likewise. + +2002-07-08 Richard Sandiford + + * config/mips/mips.md: Add imadd type. Update scheduler description + to use imadd as well as imul. + (*mul_acc_si, *madsi): Change imul alternatives to imadd. + (*mul_acc_di, *mul_acc_64bit_di): Likewise. + (*mul_sub_si): Likewise for first alternative. Change second + alternative from imul to multi. + +2002-07-07 Neil Booth + + * c-common.c (c_common_post_options): Update prototype; + don't init backends if preprocessing only. + * langhooks-def.h (LANG_HOOKS_POST_OPTIONS): Update. + * langhooks.h (struct lang_hooks): Update post_options to + return a boolean. + * toplev.c (parse_options_and_default_flags, do_compile, + lang_independent_init): Update prototypes. Allow the + front end to specify that there is no need to initialize + the back end. + (general_init): Move call to hex_init here... + (toplev_main): ...from here. Pass flag for back end init + suppression. + +Sun Jul 7 20:38:38 2002 J"orn Rennecke + + * sh.h (PRINT_OPERAND_PUNCT_VALID_P): Allow '\''. + (PREDICATE_CODES): Add entries for equality_comparison_operator, + greater_comparison_operator and less_comparison_operator. + * sh.c (print_operand): Add '\'' code. Make 'o' handle + more operators. + (equality_comparison_operator): New function. + (greater_comparison_operator, less_comparison_operator): Likewise. + * sh.md (beq_media_i): Disable generator function generation. + Use match_operator to handle a whole class of comparisons. Add + modifier in output template to provide branch prediction. Add type. + (bgt_media_i, ble_media_i): Likewise. Allow zero operands. + (bne_media_i, bge_media_i, bgtu_media_i, bgeu_media_i): Delete. + (blt_media_i, bleu_media_i, bltu_media_i): Likewise. + (bgt, blt, ble, bge, bgtu, bltu, bgeu, bleu): Allow zero operands. + +2002-07-07 Hans-Peter Nilsson + + Emit MMIX function prologue and epilogue as rtl. + * config/mmix/mmix.md ("call"): Use mmix_get_hard_reg_initial_val, + not unprototyped get_hard_reg_initial_val. + ("call_value", "nonlocal_goto_receiver"): Ditto. + ("return"): Make define_expand. Move real insn to... + ("*expanded_return"): New pattern. + ("prologue", "epilogue"): New define_expands. + * config/mmix/mmix.h (MMIX_rO_REGNUM): New macro. + (struct machine_function): New member in_prologue. + (FIRST_PSEUDO_REGISTER): Adjust for including rO as register. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Ditto. + (MMIX_MMIXWARE_ABI_REG_ALLOC_ORDER): Ditto. + (MMIX_GNU_ABI_REG_ALLOC_ORDER, REG_CLASS_CONTENTS): Ditto. + (REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES): Ditto. + (LOCAL_REGNO): Define. Adjust comment. + * config/mmix/mmix.c (MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS): + Consider regs_ever_live[MMIX_rJ_REGNUM], not just + leaf_function_p. + (MMIX_OUTPUT_REGNO): Don't translate registers while outputting + the prologue. + (mmix_target_asm_function_prologue): Make static. Just mark that + the prologue is being emitted. Move guts to... + (mmix_expand_prologue): New function. Adjust for emitting + prologue as rtl. For sizes, use HOST_WIDE_INT only. + (mmix_target_asm_function_epilogue): Make static. Simply emit a + \n. Move guts to... + (mmix_expand_epilogue): New function. Adjust for emitting + epilogue as rtl. For sizes, use HOST_WIDE_INT only. + (mmix_target_asm_function_end_prologue): Mark that the prologue + has ended. + (TARGET_ASM_FUNCTION_END_PROLOGUE): Define. + (mmix_conditional_register_usage): Improve comments. + (mmix_local_regno): New function. + (mmix_emit_sp_add, mmix_get_hard_reg_initial_val): Ditto. + * config/mmix/mmix-protos.h (mmix_local_regno): Prototype. + (mmix_expand_prologue, mmix_expand_epilogue): Ditto. + (mmix_get_hard_reg_initial_val): Ditto. + +2002-07-06 Andreas Jaeger + + * toplev.c (set_fast_math_flags): Don't use ISO C style function + definitions. + * gengtype.c (open_base_files): Likewise. + (close_output_files): Likewise. + * tracer.c (find_best_predecessor): Likewise. + (find_best_successor): Likewise. + (ignore_bb_p): Likewise. + +2002-07-05 Roger Sayle + + PR c++/7099 + * builtin-attrs.def: Define new attribute lists for use in + builtins.def. + * builtins.def [DEF_BUILTIN]: Modify to take an additional + ATTRS argument, an enumerated value defined in builtin-attrs.def + that represents the attribute list for the builtins. Modify + all builtin functions to pass an appropriate attribute list. + Specify "abort", "exit", "_exit" and "_Exit" builtins here with + their required noreturn attributes. + * tree.h (enum_builtin_function): Ignore the additional parameter + to DEF_BUILTIN. + * builtins.c (built_in_names): Likewise. + * c-common.c: (builtin_function_2): Replace the "int noreturn_p" + argument with a tree representing the functions attribute list. + Pass this "attrs" argument to builtin_function. No longer handle + the noreturn_p processing manually. + (built_in_attributes): Move the definitions from builtin-attrs.def + before c_common_nodes_and_builtins. + (c_common_nodes_and_builtins): Handle the new ATTRS parameter in + DEF_BUILTIN, passing it to both builtin_function and the changed + builtin_function_2. + + * doc/extend.texi: Document __builtin_abort, __builtin_exit, + __builtin__exit and __builtin__Exit. + +2002-07-05 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*movqi_68hc12"): Avoid allocating + QI mode registers in soft registers. + ("zero_extendqihi2"): Do not take into account soft registers + for register allocation (use '*' constraint). + +2002-07-05 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*ashlsi3"): Avoid saving y if we know + it is dead. + ("*ashrsi3"): Likewise. + ("*lshrsi3"): Likewise. + +2002-07-05 Vladimir Makarov + + * genautomata.c (output_max_insn_queue_index_def): Take latencies + into account. + +2002-07-05 Stephane Carrez + + * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize + address computation and memory moves. + +2002-07-03 Mark Mitchell + + PR c++/6706 + * dwarfout.c (output_reg_number): Fix warning message. + (output_bound_representation): Check SAVE_EXPR_RTL is not NULL + before using it. + +2002-07-05 Rainer Orth + + * gcc/gcc.c (asm_debug): Move initialization ... + (init_spec): ... here. + +2002-07-05 Nathan Sidwell + + * c-parse.in (extdef): Append ';'. + (old_style_parm_decls): Append ';'. + +2002-07-04 Daniel Jacobowitz + + * configure.in: Correct typos: gcc_cv_as_gdwarf2_debug_flag to + gcc_cv_as_gdwarf2_flag and gcc_cv_as_gstabs_debug_flag + to gcc_cv_as_gstabs_flag. + * configure: Rebuilt. + +2002-07-04 Geoffrey Keating + + * ggc.h (ggc_add_root): Document as obsolete. + +Thu Jul 4 07:58:01 2002 J"orn Rennecke + + * sh.md (mshfhi_b, mshflo_b, mshfhi_l, mshflo_l, mshfhi_w): Add DONE. + (mshflo_w): Likewise. + +Thu Jul 4 07:36:29 2002 J"orn Rennecke + + * simplify-rtx.c (simplify_subreg): Reduce problem of finding + vector mode subregs of constants to finding integer mode + subregs of constants. + * cse.c (cse_insn): Use simplify_gen_subreg. + * convert.c (convert_to_integer): Don't strip a NOP_EXPR + From a vector mode expression of different size than the + target mode. + +2002-07-03 Eric Christopher + + * config/mips/linux.h: Add #undef for SUBTARGET_CPP_SPEC. + * config/mips/mips.h: Remove deprecated -m options + and cc1_cpu_spec associated. + (CONSTANT_ADDRESS_P): Fix last patch. + (ASM_DECLARE_FUNCTION_NAME): Declare. Fix comment. + * config/mips/mips.md (bungt, bunge, sungt_df, sungt_sf, sunge_df, + sunge_sf): Remove. + +2002-07-03 Stan Shebs + + * config/darwin.h (APPLE_CC): Remove, not meaningful in FSF GCC. + (STRINGIFY_THIS, REALLY_STRINGIFY): Remove. + (CPP_SPEC): Remove insertion of APPLE_CC definition. + +2002-07-03 Roger Sayle + + * combine.c (struct_undo): Change types of recorded substitutions + to be either "int" or "rtx", instead of "unsigned int" and "rtx". + (do_SUBST_INT): Change types of the substitution from unsigned int + to int, to avoid compilation warning from SUBST_INT's only caller. + + (make_extraction): Add cast to avoid compilation warning. + (force_to_mode): Remove cast to avoid compilation warning. + +2002-07-03 Eric Botcazou + Jeff Law + + * i386.md (length_immediate attribute): Fix typo. + (length_address attribute): Likewise. + (modrm attribute): Set it to 0 for immediate call instructions. + (jcc_1 pattern): Set modrm attribute to 0. + (jcc_2 pattern ): Likewise. + (jump pattern): Likewise. + (doloop_end_internal pattern): Explicitly set length. + (leave pattern): Fix typo. + (leave_rex64 pattern): Likewise. + +2002-07-03 David Edelsohn + + * config/rs6000/rs6000.md (fix_truncdfsi2_internal): Ignore DImode + in FPR as preference. + (fctiwz): Same. + (floatdidf2, fix_truncdfdi2): Same. + (floatdisf2, floatditf2, fix_trunctfdi2): Same. + (floatditf2): Same. + (floatsitf2, fix_trunctfsi2): SImode in GPR. + (ctrdi): Remove FPR alternative and splitter. + +2002-07-03 Will Cohen + + * config/i386/i386.c (x86_integer_DFmode_moves): Disable for PPro. + +Wed Jul 3 10:24:16 2002 J"orn Rennecke + + * optabs.c (expand_vector_binop): Don't store using a SUBREG smaller + than UNITS_PER_WORD, unless this is little endian and the first unit + in this word. Let extract_bit_field decide how to load an element. + Force arguments to matching mode. + (expand_vector_unop): Likewise. + + * simplify-rtx.c (simplify_subreg): Don't assume that all vectors + consist of word_mode elements. + * c-typeck.c (build_binary_op): Allow vector types for BIT_AND_EXPR, + BIT_ANDTC_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR. + (build_unary_op): Allow vector types for BIT_NOT_EPR. + * emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg for + CONST_VECTOR. + * optabs.c (expand_vector_binop): Try to perform operation in + smaller vector modes with same inner size. Add handling of AND, IOR + and XOR. Reject expansion to inner-mode sized scalars when using + OPTAB_DIRECT. Use simplify_gen_subreg on constants. + (expand_vector_unop): Try to perform operation in smaller vector + modes with same inner size. Add handling of one's complement. + When there is no vector negate operation, try a vector subtract + operation. Use simplify_gen_subreg on constants. + * simplify-rtx.c (simplify_subreg): Add capability to convert vector + constants into smaller vectors with same inner mode, and to + integer CONST_DOUBLEs. + +2002-07-02 Kaveh R. Ghazi + + * c-parse.in (parsing_iso_function_signature): New variable. + (extdef_1): New, copied from... + (extdef): ... here. Reset parsing_iso_function_signature. + (old_style_parm_decls): Reset parsing_iso_function_signature. + (old_style_parm_decls_1): New, copied from old_style_parm_decls. + Warn about ISO C style function definitions. + (nested_function, notype_nested_function): Reset + parsing_iso_function_signature. + (parmlist_2): Set parsing_iso_function_signature. + + * doc/invoke.texi (-Wtraditional): Document new behavior. + +2002-07-02 Chris Demetriou + + * config.gcc (mips*el-*-*): Use tm_defines to set + TARGET_ENDIAN_DEFAULT, rather than including mips/little.h. + * config/mips/little.h: Remove. + +2002-07-02 Devang Patel + + * objc/objc-act.c (adjust_type_for_id_default): Do not allow an + object as parameter. Prevent something like 'NSObject' to be + used as the type for a method argument. + +2002-07-03 Neil Booth + + * cpptrad.c: Update comment. + +2002-07-02 Neil Booth + + * doc/cpp.texi: Update for traditional preprocessing changes. + * goc/cppopts.texi: Similarly. + +2002-07-02 Ziemowit Laski + + * c-parse.in (designator): Enable designated initializers if ObjC. + (objcmessageexpr): Remove references to objc_receiver_context. + * objc/objc-act.h (objc_receiver_context): Remove decl. + * objc/objc-act.c (objc_receiver_context): Remove. + (lookup_objc_ivar): Test objc_method_context instead of + objc_receiver_context. + +Tue Jul 2 18:45:45 2002 J"orn Rennecke + + * sh.c (print_operand, case 'N'): Allow zero vector. + (arith_reg_or_0_operand): Likewise. + (zero_vec_operand): Check for CONST_VECTOR, not PARALLEL. + * sh.h (CONST_COSTS): 0 has 0 cost. Check OUTER_CODE for + IOR, XOR, PLUS and SET and take their respective constant + ranges into account. + (PREDICATE_CODES, arith_reg_or_0_operand): Can be CONST_VECTOR. + * sh.md (subdi3, subdi3_media): Allow zero operand. + (movv8qi_i+3): Only vector that is not split is the zero vector. + Fix operand 3 to simplify_subreg. + (movv2si_i): Split alternative 1. + (mshfhi_l_di_rev+1): New splitter. + +2002-07-02 Neil Booth + + PR preprocessor/7029 + * cppinit.c (cpp_handle_option): Suppress warnings with an + implicit "-w" for "-M" and "-MM". + * doc/cppopts.texi: Update. + +2002-07-01 Roger Sayle + + * config/sh/sh.c (sh_media_init_builtins): Change use of poisoned + identifier "bzero" to "memset". Pass extra NULL_TREE argument to + builtin_function. + +2002-07-02 Alan Modra + + * README.Portability: Fix typos. + +2002-07-01 Hans-Peter Nilsson + + PR target/7177 + * config/cris/cris.h (LEGITIMIZE_RELOAD_ADDRESS): Correct number + of indirections for register inside sign-extended mem part. + +2002-07-01 Roger Sayle + + * tree.h: Modify builtin_function interface to take an extra + argument ATTRS, which is a tree representing an attribute list. + + * c-decl.c (builtin_function): Accept additional parameter. + * objc/objc-act.c (builtin_function): Likewise. + * f/com.c (builtin_function): Likewise. + * java/decl.c (builtin_function): Likewise. + * ada/utils.c (builtin_function): Likewise. + * cp/decl.c (builtin_function): Likewise. + (builtin_function_1): Likewise. + + * c-common.c (c_common_nodes_and_builtins): Pass an additional + NULL_TREE argument to builtin_function. (builtin_function_2): + Likewise. + * cp/call.c (build_java_interface_fn_ref): Likewise. + * objc/objc-act.c (synth_module_prologue): Likewise. + * java/decl.c (java_init_decl_processing): Likewise. + * f/com.c (ffe_com_init_0): Likewise. + + * config/alpha/alpha.c (alpha_init_builtins): Pass an additional + NULL_TREE argument to builtin_function. + * config/arm/arm.c (def_builtin): Likewise. + * config/c4x/c4x.c (c4x_init_builtins): Likewise. + * config/i386/i386.c (def_builtin): Likewise. + * config/ia64/ia64.c (def_builtin): Likewise. + * config/rs6000/rs6000.c (def_builtin): Likewise. + +2002-07-01 Zack Weinberg + + * config/ip2k/t-ip2k: Remove LIBGCC1, CROSS_LIBGCC1, and LIBGCC1_TEST. + * config/mips/t-isa3264: Likewise. + * config/mmix/t-mmix: Likewise. + +2002-07-01 John David Anglin + + * emit-rtl.c (init_emit_once): Add missing cast to HOST_WIDE_INT. + +2002-07-01 Roger Sayle + + PR opt/4046 + * fold-const.c (fold) [COND_EXPR]: Simplify A ? 0 : 1 to !A, + A ? B : 0 to A && B and A ? B : 1 into !A || B if both A and + B are truth values. + +2002-07-01 Nathanael Nerode + + * config/mmix/t-mmix: Eliminate last reference to LIBGCC1_TEST. + +2002-07-01 Matt Kraai + + * README.Portability (Function prototypes): Give an example of + declaring and defining a function with no arguments. + + * README.Portability (Function prototypes): Document new + variable-argument function macros. + +Mon Jul 1 19:55:17 2002 J"orn Rennecke + + * sh.c (langhooks.h): Include. + (sh_init_builtins, sh_media_init_builtins): New functions. + (sh_expand_builtin, arith_reg_dest,and_operand): Likewise. + (mextr_bit_offset, extend_reg_operand, zero_vec_operand): Likewise. + (sh_rep_vec, sh_1el_vec, sh_const_vec): Likewise. + (builtin_description): New struct tag. + (signature_args, bdesc): New arrays. + (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Undef / define. + (print_operand): Add 'N' modifier. + * sh.h (VECTOR_MODE_SUPPORTED_P): Add SHmedia vector modes. + (EXTRA_CONSTRAINT_U, EXTRA_CONSTRAINT_W): New macros. + (EXTRA_CONSTRAINT): Add 'U' and 'W' cases. + (CONST_COSTS): Add special case for SHmedia AND. + (PREDICATE_CODES): Add and_operand, arith_reg_dest, + extend_reg_operand, extend_reg_or_0_operand, mextr_bit_offset, + sh_const_vec, sh_1el_vec, sh_rep_vec, zero_vec_operand. + target_operand can also be const or unspec. + * sh.md (UNSPEC_INIT_TRAMP, UNSPEC_FCOSA UNSPEC_FSRRA): New constants. + (UNSPEC_FSINA, UNSPEC_NSB, UNSPEC_ALLOCO): Likewise. + (attribute type): Add new types. + (anddi3): Add splitter. + (movdi_const_16bit+1): Add code to handle vector constants and + bitmasks efficiently. + (shori_media): Have generator function made. + (movv8qi, movv8qi_i, movv8qi_i+1, movv8qi_i+2): New patterns. + (movv8qi_i+3, movv2hi, movv2hi_i, movv4hi, movv4hi_i): Likewise. + (movv2si, movv2si_i, absv2si2, absv4hi2, addv2si3, addv4hi3): Likewise. + (ssaddv2si3, usaddv8qi3, ssaddv4hi3, negcmpeqv8qi): Likewise. + (negcmpeqv2si, negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si): Likewise. + (negcmpgtv4hi, mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub): Likewise. + (mextr_rl, mextr_lr, mextr1, mextr2, mextr3, mextr4, mextr5): Likewise. + (mextr6, mextr7, mmacfx_wl, mmacfx_wl_i, mmacnfx_wl): Likewise. + (mmacnfx_wl_i, mulv2si3, mulv4hi3, mmulfx_l, mmulfx_w): Likewise. + (mmulfxrp_w, mmulhi_wl, mmullo_wl, mmul23_wl, mmul01_wl): Likewise. + (mmulsum_wq, mmulsum_wq_i, mperm_w, mperm_w_little): LIkewise. + (mperm_w_big, mperm_w0, msad_ubq, msad_ubq_i, mshalds_l): Likewise. + (mshalds_w, ashrv2si3, ashrv4hi3, mshards_q, mshfhi_b): Likewise. + (mshflo_b, mshf4_b, mshf0_b, mshfhi_l, mshflo_l, mshf4_l): Likewsie. + (mshf0_l, mshfhi_w, mshflo_w, mshf4_w, mshf0_w, mshfhi_l_di): Likewise. + (mshfhi_l_di_rev, mshflo_l_di, mshflo_l_di_rev): Likewise. + (mshflo_l_di_x, mshflo_l_di_x_rev, ashlv2si3, ashlv4hi3): Likewise. + (lshrv2si3, lshrv4hi3, subv2si3, subv4hi3, sssubv2si3): Likewise. + (ussubv8qi3, sssubv4hi3, fcosa_s, fsina_s, fipr, fsrra_s): Likewise. + (ftrv): Likewise. + + (fpu_switch+1, fpu_switch+2): Remove constraint. + +2002-07-01 Aldy Hernandez + + * tree.c (build_function_type_list): Update function comment. + Rename first argument to return_type. + +2002-07-01 Neil Booth + + * Makefile.in: Remove all trace of tradcpp.c, tradcpp.h, + tradcif.y and related files. + +2002-07-01 Neil Booth + + * cpptrad.c (skip_whitespace): Pass pointer to prior char. + +2002-07-01 Kaveh R. Ghazi + + * mips.h (FUNCTION_ARG_REGNO_P): Fix parentheses. + +2002-06-30 Devang Patel + + * objc/objc-act.c (finish_file): Avoid finish_objc() if + -fsyntax-only. + +Fri Jun 28 17:22:37 2002 Denis Chertykov + Frank Ch. Eigler + Matthew Green + Richard Henderson + Dave Hudson + Jeff Johnston + Alan Lehotsky + Bernd Schmidt + Graham Stott + + * doc/extend.texi: Add ip2k port to description of attribute + naked. + * doc/install.texi (Specific): Add ip2k description. + * doc/install-old.texi (Configurations): Add ip2k to possible + cpu types. + * doc/md.texi: Document ip2k constraints. + * config/ip2k/crt0.S: New file. + * config/ip2k/ip2k-protos.h: New file. + * config/ip2k/ip2k.c: New file. + * config/ip2k/ip2k.h: New file. + * config/ip2k/ip2k.md: New file. + * config/ip2k/libgcc.S: New file. + * config/ip2k/t-ip2k: New file. + +2002-06-30 Hans-Peter Nilsson + + * config/mmix/mmix.md ("return"): New pattern. + * config/mmix/mmix.h (TARGET_MASK_USE_RETURN_INSN) + (TARGET_USE_RETURN_INSN): New macros. + (TARGET_DEFAULT): Include TARGET_MASK_USE_RETURN_INSN. + (TARGET_SWITCHES): Add -msingle-exit and -mno-single-exit. + * config/mmix/mmix.c (MMIX_OUTPUT_REGNO): Fix spacing. + (MMIX_POP_ARGUMENT): New macro. + (mmix_target_asm_function_prologue): When no epilogue is executed, + just emit a blank line. Use MMIX_POP_ARGUMENT with final POP insn. + (mmix_print_operand) : New case. + (mmix_print_operand_punct_valid_p): Match '.'. + (mmix_use_simple_return): New function. + * config/mmix/mmix-protos.h (mmix_use_simple_return): Prototype. + * doc/invoke.texi (Option Summary) : Add + -msingle-exit, -mno-single-exit. + (MMIX Options): Ditto. + +2002-06-30 Aldy Hernandez + + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Fix typos. + +2002-06-30 Kaveh R. Ghazi + + * gengtype.c (oprintf): Move VA_CLOSE after all fixedarg uses. + +2002-06-30 Alan Modra + + * unroll.c (loop_iterations): Handle EQ loops. + +2002-06-29 David Edelsohn + + * config/rs6000/rs6000.md (ctrdi): Allocate pseudo for FPR + constraint in define_expand, not splitter. + Formatting. + +2002-06-29 Aldy Hernandez + + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use + build_function_type_list instead of build_function_type. + + * config/ia64/ia64.c (ia64_init_builtins): Same. + + * config/alpha/alpha.c (alpha_init_builtins): Same. + + * config/rs6000/rs6000.c (altivec_init_builtins): Same. + + * config/arm/arm.c (arm_init_builtins): Same. + + * tree.h: Add build_function_type_list prototype. + + * tree.c (build_function_type_list): New. + +2002-06-29 Kaveh R. Ghazi + + * collect2.c (scan_prog_file): Fix typo in message. + +2002-06-28 Aaron Lehmann + + * fold-cont.c: Remove unused CHARMASK. + +2002-06-29 Neil Booth + + PR preprocessor/7150 + * cppmain.c (scan_translation_unit_trad): Simplify. + * cppmacro.c (cpp_scan_nooutput): Handle traditional case. + +2002-06-29 Neil Booth + + * config/i386/crtdll.h: Define EXTRA_OS_CPP_BUILTINS. + Don't use CPP_PREDEFINES. + * config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): New. + Used TARGET_OS_CPP_BUILTINS in preference to CPP_PREDEFINES. + * config/i386/djgpp.h, config/i386/i386-coff.h, + config/i386/i386-interix.h, config/i386/i386-interix3.h, + config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h, + config/i386/openbsd.h, config/i386/ptx4-i.h, config/i386/sysv3.h, + config/i386/uwin.h: Similarly. + +2002-06-29 Herman A.J. ten Brugge + + * c4x.h: (TARGET_CPU_CPP_BUILTINS): Check flag_inline_functions and + flag_inline_trees to enable inlining. + +2002-06-28 Phil Edwards + + * configure.in (gcc_gxx_include_dir): Change to match versioned + C++ headers if --enable-version-specific-runtime-libs is used. + * configure: Regenerate. + +2002-06-28 Jan Hubicka + + * gcse.c (gcse_emit_move_after): Use gen_move_insn to produce the move. + +2002-06-28 Stephen Clarke + + * combine.c (combine_simplify_rtx): Pass the mode of the + shift count, not the shift operation when trying to simplify + a shift on a SHIFT_COUNT_TRUNCATED target. + +2002-06-28 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*addsi3"): Use 'o' constraint to + avoid the auto increment addressing modes. + ("*subsi3"): Likewise. + (split for add/sub on address): For 68HC12 push the value on + the stack and do the operation with a pop. + +2002-06-28 Neil Booth + + * cpplib.c (_cpp_handle_directive): Move #define-specific + code to the #define handler... + (do_define): ...here. + (lex_macro_node): No longer a need to check for comments here. + +2002-06-28 Stephane Carrez + + * config/m68hc11/m68hc11.h (OPTIMIZATION_OPTIONS): Define. + * config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options): + Declare. + * config/m68hc11/m68hc11.c (m68hc11_optimization_options): New, + do not reorder basic blocks at the end when optimizing for size. + +2002-06-28 Stephane Carrez + + * config/m68hc11/m68hc11.c (autoinc_mode): New function. + (m68hc11_make_autoinc_notes): New function. + (m68hc11_split_move): Be very cautious when spliting a move with + auto increment/decrement modes because this may result in incompatible + directions; add REG_INC notes to the resulting insn for CSE reg. + +2002-06-28 Stephane Carrez + + * config/m68hc11/m68hc11.c (register_indirect_p): For 68HC12 a constant + can be a valid address. + +2002-06-28 Aldy Hernandez + + * config/rs6000/rs6000.c: Remove unusued variables from last + patch. + +2002-06-27 Aldy Hernandez + + Revert: + * config/rs6000/rs6000.c (rs6000_override_options): Move + *SUBTARGET_OVERRIDE_OPTIONS before the -m options. + +2002-06-27 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_expand_builtin): Move + lvx/stv/dst builtins... + (altivec_expand_ld_builtin): ...to here. + (altivec_expand_st_builtin): ...here. + (altivec_expand_dst_builtin): ...and here (respectively). + +2002-06-28 Bob Wilson + + * config/xtensa/xtensa.h (RETURN_IN_MEMORY): Update comment. + +2001-06-08 Bernd Schmidt + + * emit-rtl.c (gen_lowpart_common): Don't create paradoxical FLOAT_MODE + subregs. + * recog.c (general_operand, register_operand): Disallow them. + +2002-06-28 Neil Booth + + PR preprocessor/7138 + * cpplib.c (_cpp_handle_directive): Do traditional + preparation after setting state.angled_headers. + * cpptrad.c (scan_out_logical_line): Fix potential + quote bug. + +2002-06-27 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): Move + *SUBTARGET_OVERRIDE_OPTIONS before the -m options. + +2002-06-27 Bob Wilson + + * config/xtensa/xtensa.md: Give "*xxx" names to all unnamed insn's. + (*lsiu, *ssiu, movstrsi_internal, zero_cost_loop_start, + zero_cost_loop_end): Remove unnecessary "parallel" from insns. + +2002-06-27 Roger Sayle + + * config/d30v/d30v.h: Remove commented out STACK_REGS #defines. + * config/stormy16/stormy16.h: Likewise. + + * config/stormy16/stormy16.h (CUMULATIVE_ARGS): Replace typedef + with #define. + +2002-06-26 Gerald Pfeifer + + * doc/install.texi (Binaries): Add Sinix/Reliant Unix. Move + Hitachi entry. Make punctuation more consistent. + +2002-06-27 Matt Kraai + + * doc/install.texi: Change ` bit' to `-bit'. + * doc/md.texi: Change `-bits' to `-bit'. + * doc/tm.texi: Change `-bits' to ` bits'. + +2002-06-27 Daniel Berlin + + * gcse.c (hoist_code): Rewrite to only get list of dominated + blocks once per BB. Also fix reversed test (by removing need for + the test at all). + +2002-06-27 Neil Booth + + * cpphash.h (_cpp_set_trad_context): Remove. + * cpplib.c (prepare_directive_trad): Do nothing for #define. + (cpp_push_buffer, _cpp_pop_buffer): Don't call _cpp_set_trad_context. + * cpptrad.c: Update comments. + (_cpp_read_logical_line_trad): Let scan_logical_line handle + updating the current context. + (scan_logical_line): Update the current context. + (_cpp_create_trad_definition): Similarly. + (_cpp_set_trad_context): Remove. + +2002-06-27 Neil Booth + + PR preprocessor/7070 + * c-lex.c (cb_def_pragma): Don't try to spell CPP_EOF. + +2002-06-26 Bob Wilson + + * config/xtensa/xtensa-protos.h (xtensa_return_addr): Declare. + config/xtensa/xtensa.c (xtensa_return_addr): New function. + config/xtensa/xtensa.h (RETURN_ADDR_RTX): Use xtensa_return_addr. + config/xtensa/xtensa.md (fix_return_addr): New pattern. + +2002-06-26 Kaveh R. Ghazi + + * mips.c (coprocessor_operand, coprocessor2_operand, + symbolic_operand): Move prototypes from here... + * mips-protos.h (coprocessor_operand, coprocessor2_operand, + symbolic_operand): ...to here. + +Wed Jun 26 16:32:57 2002 J"orn Rennecke + + * config/sh/crt1.asm: remove _stack label definition + and sentinel value. + +2002-06-26 Kaveh R. Ghazi + + * varasm.c: Include real.h before output.h. + +2002-06-26 Aldy Hernandez + + * config/rs6000/rs6000.h (ALTIVEC_VECTOR_MODE): Revert change to + check for TARGET_ALTIVEC. + +2002-06-26 Nathanael Nerode + + * config.gcc (vax-*-vms*): Make obselete. + +2002-06-25 Kaveh R. Ghazi + + * gcc.c (warn_std): Delete. + +2002-06-25 Loren J. Rittle + + * doc/extend.texi: Fix formatting of last checkin. + +2002-06-25 Rainer Orth + + * config/alpha/alpha.h (TARGET_CPU_CPP_BUILTINS): Remove leading + underscore from __IEEE_FP and __IEEE_FP_INEXACT. + +2002-06-25 Aldy Hernandez + + * doc/extend.texi (PowerPC AltiVec Built-in Functions): Document + discrepancies from motorola's documentation. + +Tue Jun 25 21:51:13 2002 J"orn Rennecke + + * optabs.c (expand_vector_binop, expand_vector_unop): Don't assume + GET_MODE_UNIT_SIZE (mode) == UNITS_PER_WORD. + + * config/sh/lib1funcs.asm (udivdi3): Make first divide step + produce a 32 bit result before normalization, then normalize with a + left shift. Compute approximative error of 2nd reciprocal + approximation in 2's complement. Fix mask generation from upper + longword of second divide stage result. + For large divisor, fix shift count used to truncate first stage + divide result; make decision if to adjust upwards based on comparison + of higher parts of normalized values. + (udivdi): Likewise. Undo normalization of result for large divisor + case. + +2002-06-25 David S. Miller + + * config/sparc/sparc.md: Change \\{t,n} to \{t,n}. + +2002-06-25 Neil Booth + + * cpplib.c (do_include_common): Revert to correct line number + if -traditional. + * cpptrad.c (scan_out_logical_line): Treat null directive as + white space. Invlidate MI optimization for non-whitespace + text outside a directive. + +2002-06-24 Kaveh R. Ghazi + + * Makefile.in (SHELL): Set to @SHELL@. + * fixinc/Makefile.in (SHELL): Likewise. + + * mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2, + fixuns_truncsfsi2, fixuns_truncsfdi2): Avoid automatic aggregate + initialization. + +2002-06-24 Jeff Law + + * flow.c (propagate_one_insn): When removing an insn + with a REG_LIBCALL note but not the entire libcall sequence, + delete the associated REG_RETVAL note. + +Mon Jun 24 21:05:09 2002 J"orn Rennecke + + * lib1funcs.asm (sdivsi3): Add optimized SH64 implementations. + (udivsi3): Likewise. Rewrite SH1 implementation. + (udivdi3, divdi3, umoddi3, moddi3): New SHmedia functions. + * sh.md (R20_REG, R21_REG, R22_REG, R23_REG, FR23_REG): New constants. + (udivsi3_i1_media, divsi3_i1_media): Fix clobber list. + * config/sh/t-sh64 (LIB1ASMFUNCS): (_udivdi3, _divdi3, _umoddi3): Add. + (_moddi3): Likewise. + + * lib1funcs.asm (ic_invalidate): Add data cache line writeback. + + * sh.h (FUNCTION_ARG_ADVANCE): Take SHCOMPACT_FORCE_ON_STACK + arguments into account for stack_regs. + +2002-06-24 Matt Kraai + + * doc/extend.texi: Change `@dots{}' to `/* @r{@dots{}} */' + in examples. + +2002-06-24 Art Haas + + * doc/extend.texi (Other Builtins): Change `...' to `@dots{}'. + * doc/tm.texi (Frame Layout): Likewise. + +2002-06-20 Steve Ellcey + + * gcc/config.gcc (ia64*-*-hpux*): Set use_collect2 to no. + Set float_format to i128. + +2002-06-24 David S. Miller + + * config/sparc/sparc.c (INIT_TARGET_OPTABS): If ARCH64, set the + 32-bit ABI libfuncs to NULL. + + * config/sparc/sparc.md: Use define_insn_and_split. Use braced + strings instead of quoted strings for code blocks. + + * expmed.c (expand_divmod): Do not set optab1/optab2 to the shift + optabs if op1 is const0_rtx. + + * Makefile.in (GTFILES): Add basic-block.h + * basic-block.h (label_value_list, tail_recursion_label_list): + Mark with GTY. + +2002-06-24 Neil Booth + + * cpptrad.c (scan_out_logical_line): Check recursing only when + we know we have a macro invocation in the function-like case. + Only call _cpp_handle_directive if we know we have a good + directive, or we want to reject a bad directive. + +2002-06-24 Alan Modra + + * doloop.c (doloop_valid_p): Correct comment. + (doloop_modify_runtime ): Simplify. + (doloop_modify_runtime ): Don't emit code when NE. + +Thu Jun 20 00:26:53 2002 Denis Chertykov + + * config.gcc: Add support for ip2k. + +2002-06-23 Jan Hubicka + Jeff Law + + * function.h (struct emit_status): Clarify potential contents + of regno_reg_rtx array. + * integrate.c (copy_rtx_and_substitute): Update comments. Make + sure entry in regno_reg_rtx is a REG before checking REG_POINTER. + + * reg-stack.c (convert_regs_exit): Push the registers to stack in + proper order. + +2002-06-22 Ulrich Weigand + + PR middle-end/6963 + * function.c (assign_stack_temp_for_type): Do not return + the same MEM rtx for multiple uses of a stack slot. + +2002-06-22 David S. Miller + + PR target/6841 target/6770 target/6719 + * config/sparc/sparc.h (PREFERRED_RELOAD_CLASS): Return + NO_REGS for constant X when CLASS is GENERAL_OR_FP_REGS or + GENERAL_OR_EXTRA_FP_REGS. + +2002-06-22 Neil Booth + + * cpptrad.c (struct fun_macro): Add line number. + (scan_out_logical_line): Set it, and use it to report unterminated + macro invocations. + +2002-06-21 Kaveh R. Ghazi + + * genautomata.c (copy_node, VLA_PTR_CREATE, VLA_PTR_EXPAND, + VLA_PTR_ADD, VLA_HWINT_CREATE, VLA_HWINT_EXPAND, VLA_HWINT_ADD, + DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, DECL_EXCL, DECL_PRESENCE, + DECL_ABSENCE, DECL_RESERV, DECL_INSN_RESERV, REGEXP_UNIT, + REGEXP_RESERV, REGEXP_SEQUENCE, REGEXP_REPEAT, REGEXP_ALLOF, + REGEXP_ONEOF, check_name): Const-ify. + +2002-06-21 Matt Thomas + + * config/vax/vax.c (vax_output_function_prologue): Use + REGISTER_PREFIX. Fix some indentation. + * config/vax/vax.h (FUNCTION_PROFILER): Use reg_names[]. + (VAX_ISTREAM_SYNC): Define. + (INITIALIZE_TRAMPOLINE): Use VAX_ISTREAM_SYNC. Move the + i-stream sync to the end. + (REGISTER_PREFIX): Define as "". + (ASM_OUTPUT_MI_THUNK): Use REGISTER_PREFIX. + +2002-06-21 Jason Thorpe + + * config.gcc (ns32k-*-netbsd*): Remove from list of obsolete + configurations. + +2002-06-21 Kaveh R. Ghazi + + * tree.c (tree_node_kind, tree_node_counts, tree_node_sizes, + tree_node_kind_names): Wrap in GATHER_STATISTICS macro. + +2002-06-21 Matt Thomas + + * config/vax/netbsd.h: Adjust a comment. + (TARGET_DEFAULT): Redefine as 0. + +2002-06-21 Richard Henderson + + * bb-reorder.c (make_reorder_chain_1): Search harder for the + vax casesi fallthru edge. + * cfglayout.c (cleanup_unconditional_jumps): Use + redirect_edge_succ_nodup. Do not delete ADDR_VEC insns as dead. + * cfgrtl.c (force_nonfallthru_and_redirect): Place redirection + block after ADDR_VEC. + +2002-06-21 Rainer Orth + + * config/sparc/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtfastmath.o. + +2002-06-21 Neil Booth + + * cpperror.c (cpp_error): For traditional CPP, default to + diagnostics on pfile->line. + * cpplib.c (prepare_directive_trad): Set line number for + diagnostics for #define too. + * cpptrad.c (skip_whitespace): Skip comments properly. + (_cpp_expansions_different_trad): Initialize quote2. + +2002-06-21 Hans-Peter Nilsson + + * config/mmix/mmix.md: Change GNU CC to GCC in file header comment. + * config/mmix/mmix.h: Ditto. + * config/mmix/mmix-protos.h: Ditto. + * config/mmix/mmix.c: Ditto. Fix typo in comment. + * config/mmix/mmix-modes.def: Change GNU CC to GCC in file header + comment. Comment extra CC modes. + +2002-06-20 Jan Hubicka + + * cfglayout.c (scope_to_insns_initialize): Call set_block_levels. + (scope_to_insns_finalize): Do not call set_block_levels; handle + sequences. + (choose_inner_scope): New. + * rtl.h (choose_inner_scope): Declare. + +2002-06-20 John David Anglin + + * pa-protos.h (pa_asm_output_mi_thunk): Change third argument to + HOST_WIDE_INT. + * pa.c (pa_asm_output_mi_thunk): Likewise. + (n_deferred_plabels): Change type to size_t. + (output_deferred_plabels, output_call): Use size_t instead of int. + +2002-06-20 Richard Henderson + + PR target/4041 + * config/m68k/m68k.md (zero_extendsidi2): Create expander; duplicate + pattern and adjust constraints for coldfire. + +2002-06-20 Richard Henderson + + * explow.c (probe_stack_range): Use gen_rtx_fmt_ee. + +2002-06-20 Chris Demetriou + + * config.gcc (mipsisa64-*-elf*, mipsisa64el-*-elf*): New targets. + +2002-06-20 Chris Demetriou + + * config/mips/mips.h (ISA_HAS_FP4): Fix comment to reflect use. + +2002-06-20 Stan Shebs + + * dominance.c: Include errors.h instead of error.h. + +2002-06-20 Neil Booth + + * cppexp.c (cpp_interpret_integer): Don't force traditional + numbers to be unsigned. + * cpplib.c (prepare_directive_trad): Set line number for + diagnostics. + * cpptrad.c (scan_out_logical_line): Continue scanning out + at start of buffer. + * gcc.c (trad_capable_cpp): Use cc1 always. + +2002-06-20 Jeffrey Law + + * i386.h (TARGET_DEFAULT): Do not turn on frame pointer + elimination in leaf functions by default yet. + +2002-06-20 Richard Sandiford + + * combine.c (make_extraction): Reapply to the argument of an ASHIFT. + +2002-06-20 Rainer Orth + + * config/sparc/t-crtfm (crtfastmath.o): Prefix with $(T) for + multilibs. + * config/sparc/t-sol2-64 (EXTRA_MULTILIB_PARTS): Add crtfastmath.o. + Fixes PR other/6836. + +Thu Jun 20 19:42:21 CEST 2002 Jan Hubicka + Pavel Nejedly + + Mon Jun 10 20:42:34 CEST 2002 Jan Hubicka + + * basic-block.h: Do not include et-forest.h + (dominance_info): Declare as struct dominance-info. + * cfglayout.c (cleanup_unconditional_jumps): Remove the edge before + deleting block. + * dominance.c (struct dominance_info): Define. + (BB_NODE, SET_BB_NODE): New macros. + (bb_hash_func, bb_eq_func): Kill. + (calculate_dominace_info, free_dominacne_info, set_immediate_dominator, + nearest_common_dominator, dominated_by_p, recount_dominator, + add_to_dominance_info, delete_from_dominance_info): update for new + representation. + (get_dominated_by, redirect_immediate_dominators): Rewrite using + enumerate_sons. + * ifcvt.c (process_double_test_block, merge_if_block, find_cond_trap, + find_if_case_1, find_if_case_2): Remove killed blocks from dominance + structure. + + * et-forest.h: Update copyright; revamp all function to operate on + nodes + (et_forest_value): Kill. + (et_forest_enumerate_sons, et_forest_node_value): New. + * et-forest.c: Update copyright. + * et-forest.h: Update copyright; revamp all function to operate on + nodes + (et_forest_value): Kill. + (et_forest_enumerate_sons, et_forest_node_value): New. + + Thu Jun 6 22:43:43 CEST 2002 Jan Hubicka + + * basic-block.h: Inlude et-forest.h + (basic_block_def): Kill dominator. + (dominance_info): New type. + (loops): Use dominace_info. + (dominace handling functions): Take dominace_info as argument + instead of bitmaps. + (create_preheader): Likewise. + * cfg.c (entry_exit_blocks): Kill dominator. + (dump_flow_info): Do not dump dominators. + * cfglayout.c (cleanup_unconditonal_jumps): Delete deleted block from + dominators. + * cfgloop.c (flow_pre_header_find): Use dominacne_info. + (flow_loops_pre_header_scan, make_forwarder_block, + canonicale_loop_headers, flow_loops_find): Likewise. + * dominance.c: Include error.h + (idoms_to_doms): Kill. + (bb_hash_func, bb_eq_func): New static functions. + (debug_dominace_info): New global function. + (calculate_dominance_info): Use new et forest structure. + (free_dominace_info, get_immediate_dominator, set_immediate_dominator, + get_dominated_by, redirect_immediate_dominators, + nearest_common_dominator, dominated_by_p, verify_dominators, + recount_dominator, iterate_fix_dominators, add_to_dominace_info, + delete_from_dominance_info): New global functions. + * gcse.c (domnators): CHange to dominance_info. + (alloc_hoist_mem): Do not alloc dominators + (free_code_hoist_mem): Use free_dominance_info. + (compute_code_hoist_data): Use dominance_info. + (hoist_code): Likewise. + * ifcvt.c (post_dominators): Likewise. + (find_if_case_2, if_convert): Likewise. + * predict.c (process_note_predictions, process_note_prediction, + estimate-probability): Likewise. + * sched-rgn.c (find_rgns, init_regions): Likewise. + * ssa-dce.c (find_all_control_dependences, fint_control_depemndence, + find_pdom, delete_insn_bb, ssa_eliminate_dead_code): Likewise. + * ssa.c (compute_dominance_frontiers_1, rename_block, rename_registers, + find_evaluations, convert_to_ssa): Likewise. + * ssa.h (compute_dominance_frontiers): Likewise. + + Thu Jun 6 22:57:34 CEST 2002 Pavel Nejedly + + * Makefile.in (et-forest.c): Add. + * et-forest.c: New file. + * at-forest.h: New file. + +2002-06-20 Kaveh R. Ghazi + + * c-decl.c (c_decode_option): Use ARRAY_SIZE in lieu of explicit + array size calculation. + * gengtype.c (NUM_BASE_FILES, create_file, write_gc_root): + Likewise. + + * diagnostic.c (diagnostic_kind_text): Const-ify. + * gengtype.c (lang_names): Likewise. + +Thu Jun 20 17:25:29 CEST 2002 JAn HUbicka + + * combine.c (subst): Be prepared for simplify_subreg to return VOIDmode. + +2002-06-20 Rainer Orth + + * config/sol2.h: New file. + * config.gcc (i?86-*-solaris2*): Include it before i386/sol2.h. + (sparc64-wrs-vxworks*): Include it before sparc/sol2.h. + (sparc-*-chorusos*): Likewise. + (sparc-*-elf*): Likewise. + (sparc-*-rtems*, sparc-*-rtemself*): Likewise. + (sparc64-*-solaris2*, sparcv9-*-solaris2*): Likewise. + (sparc-hal-solaris2*): Likewise. + (sparc-*-solaris2*): Likewise. + (sparclite-*-elf*): Likewise. + (sparc86x-*-elf*): Likewise. + (sparc64-*-elf*): Likewise. + + * config/i386/sol2.h (PREFERRED_DEBUGGING_TYPE): Moved to + config/sol2.h. + (ASM_SPEC): Override config/sol2.h version for now. + Removed obsolete GAS_REJECTS_MINUS_S variant. + (WINT_TYPE, WINT_TYPE_SIZE): Moved to config/sol2.h. + (HANDLE_PRAGMA_REDEFINE_EXTNAME): Likewise. + (TARGET_OS_CPP_BUILTINS): Likewise. + Assert system=unix. + (CPP_SPEC): Simplified using new CPP_SUBTARGET_SPEC. + (LIB_SPEC, ENDFILE_SPEC, STARTFILE_SPEC, LINK_SPEC): Moved to + config/sol2.h. + (SWITCH_TAKES_ARG, STDC_0_IN_SYSTEM_HEADERS): Likewise. + (ASM_CPU_SPEC): Define. + (SUBTARGET_EXTRA_SPECS): Define. + + * config/sparc/sol2-bi.h (LONG_DOUBLE_TYPE_SIZE): Removed, already + in config/sparc/sol2.h. + (ASM_SPEC): Moved to config/sol2.h. + (CPP_CPU_SPEC): Simplified. + (STARTFILE_SPEC32): Likewise, renamed to STARTFILE_ARCH32_SPEC for + consistency. + (STARTFILE_SPEC64): Renamed to STARTFILE_ARCH64_SPEC. + (STARTFILE_ARCH_SPEC): Use new names STARTFILE_ARCH32_SPEC, + STARTFILE_ARCH64_SPEC. + (STARTFILE_SPEC): Moved to config/sol2.h + (SUBTARGET_EXTRA_SPECS): Add startfile_arch. + (LINK_ARCH32_SPEC): Moved to config/sol2.h. + (LINK_ARCH64_SPEC): Simplified. + (LINK_ARCH_SPEC): Redefined config/sol2.h version for 64-bit support. + (LINK_SPEC): Moved to config/sol2.h + + * config/sparc/sol2.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Moved to + config/sol2.h. + Use BITS_PER_WORD for size. + (WINT_TYPE, WINT_TYPE_SIZE): Likewise. + (HANDLE_PRAGMA_REDEFINE_EXTNAME): Likewise. + (CPP_PREDEFINES): Removed OS-specific part handled by + TARGET_OS_CPP_BUILTINS. + (CPP_SUBTARGET_SPEC): Moved to config/sol2.h. + (CPLUSPLUS_CPP_SPEC): Removed, handled by TARGET_OS_CPP_BUILTINS. + (ASM_SPEC): Moved to config/sol2.h. + (PREFERRED_DEBUGGING_TYPE): Likewise. + (STARTFILE_SPEC, LIB_SPEC, LINK_SPEC): Likewise. + (SWITCH_TAKES_ARG, STDC_0_IN_SYSTEM_HEADERS): Likewise. + (TARGET_DEFAULT): Reordered to match config/sparc/sol2-bi.h version. + (TRANSFER_FROM_TRAMPOLINE): Moved to config/sol2.h + + * config.gcc (i?86-*-solaris2*): Removed obsolete gas support. + * config/i386/sol2gas.h: Removed. + +Thu Jun 20 12:14:01 CEST 2002 Jan Hubicka + + * i386.md (xorqi_1_slp, xorqi_2_slp): New patterns. + +2002-06-16 Aldy Hernandez + + * gcc.c-torture/execute/simd-1.c: New. + + * gcc.dg/simd-1.c: New. + + * doc/extend.texi (Vector Extensions): Document that we can + specify simd types not specifically supported by the hardware. + Document that simd types can be used as function arguments. + Document that signness does make a difference in SIMD types. + Misc cleanups and revisions to the vector extensions section. + + * simplify-rtx.c (simplify_subreg): Simplify subregs of vector + constants. + + * expr.c (vector_mode_valid_p): New. + + * expr.h: Add vector_mode_valid_p. + + * defaults.h (VECTOR_MODE_SUPPORTED_P): Set default. + + * c-common.c (type_for_mode): Always build vector nodes regardless + of VECTOR_MODE_SUPPORTED_P. + (handle_mode_attribute): Error if we can't emulate a nonexisting + vector mode. + (handle_vector_size_attribute): Same. + + * optabs.c (expand_binop): Open-code vector operations. + (expand_unop): Open-code vector unops. + (expand_vector_binop): New. + (expand_vector_unop): New. + + * c-typeck.c (build_binary_op): Allow vectors in binops. + Allow vectors in conditional operatiors. + (build_unary_op): Allow vectors in unary minus. + + * config/rs6000/rs6000.h (ALTIVEC_VECTOR_MODE): Conditionalize on + TARGET_ALTIVEC. + +2002-05-20 Richard Henderson + + * c-common.c (c_common_get_alias_set): Correctly handle characters. + Rearrange order of expressions; don't handle vectors here. + * alias.c (get_alias_set): Let vectors match their components. + +2002-06-19 Chris Demetriou + + * config/mips/mips.c (mips_emit_prefetch): Use hints which + match desired locality. + +2002-06-19 Dhananjay R. Deshpande + + * config/h8300/h8300.c (TARGET_INSERT_ATTRIBUTES): Define. + (h8300_insert_attributes): New. + +2002-06-19 Akim Demaille + + * c-parse.in (initelt: identifier ':' initval): Add an empty + action to fix a type clash. + (aliasdecl, classdef): Add the missing closing `;'. + Whitespace changes. + * gengtype-yacc.y (typedef_struct): Add an empty action to preevnt + $$ = $1 type clashes. + +2002-06-19 Eric Christopher + + * config/mips/mips.c (symbol_operand): New function. + (mips_emit_prefetch): Ditto. + * config/mips/mips-protos.h: Define. + * config/mips/mips.h (ISA_HAS_PREFETCH): Define. + (CONSTANT_ADDRESS_P): Adjust, use TARGET_GAS. + (LEGITIMIZE_ADDRESS): Ditto. + * config/mips/mips.md (prefetch, prefetch_si_address, + prefetch_si, prefetch_di_address, prefetch_di): New patterns. + +2002-06-19 Eric Christopher + + * config/fp-bit.h: Add unordered defines for gofast. + +2002-06-19 Vladimir Makarov + + * genautomata.c (DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, + DECL_EXCL, DECL_PRESENCE, DECL_ABSENCE, DECL_RESERV, + DECL_INSN_RESERV, REGEXP_UNIT, REGEXP_RESERV, REGEXP_SEQUENCE, + REGEXP_REPEAT, REGEXP_ALLOF, REGEXP_ONEOF): New macros with + checking and without it. + (decl_name, decl_mode_check_failed, regexp_name, + regexp_mode_check_failed): New functions. + (gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set, + gen_presence_set, gen_absence_set, gen_automaton, + gen_regexp_repeat, gen_regexp_allof, gen_regexp_oneof, + gen_regexp_sequence, gen_reserv, gen_insn_reserv, + automaton_decl_hash, automaton_decl_eq_p): Use the macros. + (find_automaton_decl): Ditto. Set up mode of work_automaton_decl. + (insn_decl_hash, insn_decl_hash, insn_decl_eq_p): Use the macros. + (find_insn_decl): Ditto. Set up mode of work_insn_decl. + (decl_hash, decl_eq_p): Use the macros. + (find_decl): Ditto. Set up mode of work_decl. + (process_excls, process_presence_absence, process_decls, + check_automaton_usage, process_regexp, process_regexp_decls, + check_usage, loop_in_regexp, check_loops_in_regexps, + process_regexp_cycles, add_advance_cycle_insn_decl, + initiate_states, initiate_excl_sets, + initiate_presence_absence_sets, copy_insn_regexp, transform_1, + transform_2): Use the macros. + (transform_3): Ditto. Check mode before making transformations of + ALLOF. + (regexp_transform_func, transform_insn_regexps, + process_unit_to_form_the_same_automaton_unit_lists, + form_the_same_automaton_unit_lists_from_regexp, + form_the_same_automaton_unit_lists, + process_seq_for_forming_states, process_alts_for_forming_states, + create_alt_states, form_ainsn_with_same_reservs, make_automaton, + form_arcs_marked_by_insn, NDFA_to_DFA, set_new_cycle_flags, + estimate_one_automaton_bound, compare_max_occ_cycle_nums, + units_to_automata_heuristic_distr, create_ainsns, + units_to_automata_distr, create_automata): Use the macros. + (form_regexp): Ditto. Fix typo in access to fields of ALLOF. + (longest_path_length, min_issue_delay_pass_states, + output_dead_lock_vect, output_tables, output_insn_code_cases, + output_internal_insn_latency_func, output_print_reservation_func, + output_description, output_automaton_units, generate): Use the + macros. + (make_insn_alts_attr): Ditto. Check case when there are not + alternatives in the reservation. + (make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, + make_bypass_attr, form_important_insn_automata_lists, + expand_automata): Use the macros. + +2002-06-20 Tim Josling + + * Makefile.in: Clean up code to check for misspecified languages + in enable-languages. + +2002-06-19 Andrew Pinski + + * cpptrad.c (_cpp_replacement_text_len): initialize len. + +2002-06-19 Jason Merrill + + * Makefile.in (unstrap, restrap): New targets. + (bootstrap): Mention restrap. + +2002-06-19 Matt Kraai + + * except.c (ehl_free): Remove. + + * doc/tm.texi (TARGET_CPU_CPP_BUILTINS): Correct misnamings of + builtin_define and builtin_define_std. + +2002-06-19 Ian Dall + + * config/ns32k/ns32k.md: Give "*xxx" names to all unnamed insn's. + (sCOND): Restrict operand class so that gcc knows how to reload them. + (bitfield_set): Merge two unnamed insn's using alternatives. + (call_value): Remove constraint on unused uperand. + (udivmodhi4, udivmodsi4, udivmoddihi4_internal): Remove. + (udivmoddiqi4_internal, udivmoddihi4, udivmoddiqi4): Remove. + + * longlong.h (count_trailing_zeros): Escape newline and beautify. + +2002-06-19 Mark Mitchell + + * Makefile.in (QMTEST_DIR): Simplify definition. + +2002-06-19 Nick Clifton + + * config/d30v/d30v.h (CUMULATIVE_ARGS): Replace typedef with + #define. + +2002-06-19 Neil Booth + + * cpphash.h (struct cpp_reader): Make date and time strings. + (_cpp_builtin_macro_text, _cpp_copy_replacement_text, + _cpp_replacement_text_len): New. + * cppinit.c (cpp_create_reader): Update. + (init_builtins): Register appropriate builtins for -traditional-cpp. + * cppmacro.c (new_number_token): Remove. + (_cpp_builtin_macro_text): New. + (builtin_macro): Use it. + (cpp_macro_definition): Update to handle traditional macros. + * cppmain.c (cb_line_change): Don't do column positioning for + traditional output. + * cpptrad.c (enum ls): Rename ls_fun_macro to ls_fun_open. New + state ls_fun_close. + (skip_whitespace): Fix. + (maybe_start_funlike): Don't set state.parsing_args. + (scan_out_logical_line): Remove duplicate error. Use lex_state + rather than state.parsing_args. + (push_replacement_text): Handle builtins. + (_cpp_replacement_text_len, _cpp_copy_replacement_text): New. + +2002-06-18 Hans-Peter Nilsson + Kaveh R. Ghazi + + * config/fp-bit.c (_fpmul_parts, _fpdiv_parts): Mark with + attribute __always_inline__. + +2002-06-18 Bob Wilson + + * config/xtensa/xtensa.h (FUNCTION_PROFILER): Respect flag_pic + when generating the call to _mcount. + (NO_PROFILE_COUNTERS): Define. + +2002-06-18 Richard Henderson + + * print-rtl.c (print_rtx): Adjust NOTE argument numbers for + 2002-06-02 change. + +Tue Jun 18 20:53:32 2002 J"orn Rennecke + + * t-sh (MULTILIB_EXCEPTIONS): Set to ml. + config/sh/t-linux (MULTILIB_EXCEPTIONS): Clear. + * config/sh/t-netbsd (MULTILIB_EXCEPTIONS): Likewise. + * config/sh/t-sh64 (MULTILIB_EXCEPTIONS): Likewise. + + * sh-protos.h (sh_pr_interrupt): Declare. + * sh.c (sh_pr_interrupt): New function. + (print_operand, calc_live_regs, sh_expand_prologue): Use it. + (sh_hard_regno_rename_ok): Likewise. + * sh.h (NORMAL_MODE): FP_MODE_NONE for interupt handlers. + +2002-06-18 Vladimir Makarov + + * rtl.def (DEFINE_AUTOMATON): Add description of new options + `time' and `v'. Fix incorrect description of option `w'. + + * doc/md.texi: Ditto. + + * genautomata.c (TIME_OPTION, V_OPTION): New macros. + (gen_automata_option): Process the new options. + (transform_2, transform_3): Initialize some variables. + (initiate_automaton_gen): Use the new macros. + +2002-06-18 Richard Sandiford + + * config/mips/mips-protos.h (mips_initial_elimination_offset): Declare. + (mips_set_return_address, mips_restore_gp): Declare. + * config/mips/mips.h (struct mips_frame_info): Move to mips.c + (current_frame_info): Remove. + (INITIAL_ELIMINATION_OFFSET): Use mips_initial_elimination_offset. + * config/mips/mips.c: Remove uses of current_frame_info. + (struct mips_frame_info): Moved from mips.h. Remove 'insns_len'. + (struct machine_function): Add 'frame' and 'insns_len'. + (current_frame_info, zero_frame_info): Remove. + (mips_restore_gp, mips_set_return_address): New. + (mips_initial_elimination_offset): New. + * config/mips/mips.md (exception_receiver): Use mips_restore_gp. + (eh_return define_split): Use mips_set_return_address. + +2002-06-18 Neil Booth + + * cpplib.c (dtable): Update. + (end_directive): Decrement expansion prevention count. + Clear state.in_expression. + (prepare_directive_trad): Set state.in_expression. + Increment expansion prevention count. + * cpptrad.c (enum ls): New. + (_cpp_overlay_buffer): Set overlaid_buffer. + (_cpp_remove_overlay): Use overlaid_buffer. + (_cpp_read_logcial_line_trad): Update buffer when it might + have changed. + (scan_out_logical_line): Handle state transitions for assertions + and defined() in #if, and for funlike invocations including the + directive case. Handle '<' and '>' as a quote mechanism in + #include. Warn about unterminated macro invocations. + * cpphash.h (struct lexer_state): New member in_expression. + (struct cpp_reader): New member overlaid buffer. + +2002-06-18 Hans-Peter Nilsson + + * config/cris/arit.c (do_31div, __Udiv, __Umod): Mark prototype + __always_inline__. + +2002-06-18 Alan Modra + + * config/ia64/ia64.md (doloop_end_internal): Correct rtl. + + * doloop.c (doloop_optimize): Extract pattern from insn. + +2002-06-17 Matt Kraai + + * doc/extend.texi (Function Attributes): Remove `,...' from @var. + +2002-06-17 Jeff Law + + * libgcc2.c: Do not include symcat.h or machmode.h. + +2002-06-17 Richard Henderson + + PR target/6922 + * expmed.c (make_tree): Handle SIGN_EXTEND/ZERO_EXTEND. + +2002-06-17 Tom Tromey + + * dwarfout.c: Include function.h. + +2002-06-17 Andreas Schwab + + * print-rtl.c (print_rtx): Print space before vector, not after. + (debug_rtx): Clear sawclose before printing. + (debug_rtx_list): Print newline after each list element. + (debug_rtx_range): Likewise. + +2002-06-17 Richard Henderson + + * function.h (struct function) [funcdef_no]: Rename profile_label_no. + (current_function_funcdef_no): Similarly. + * function.c (funcdef_no): Similarly. + (prepare_function_start): Set current_function_funcdef_no. + (expand_function_start): Don't set current_function_profile_label_no. + * dwarf2out.h (current_funcdef_number): Remove. + * dwarf2out.c (current_funcdef_number): Remove. Replace with + current_function_funcdef_no throughout. + * dwarfout.c, vmsdbgout.c: Similarly. + * except.c (sjlj_funcdef_number): Remove. + (sjlj_emit_function_enter): Use current_function_funcdef_no instead. + (output_function_exception_table): Likewise. + * final.c (profile_function): Use current_function_funcdef_no + instead of current_function_profile_label_no. + +2002-06-17 Vladimir Makarov + + * sched-ebb.c (init_ready_list): Check INSN_P first. + +Mon Jun 17 17:26:15 2002 J"orn Rennecke + + * sh.md (divsi3): Update way how to find insns in a sequence. + + * reload1.c (merge_assigned_reloads): Don't change reloads + other than RELOAD_FOR_INPUT_ADDRESS / RELOAD_FOR_INPADDR_ADDRESS + to RELOAD_OTHER when there are conflicting input reloads. + +2002-06-17 Richard Earnshaw (rearnsha@arm.com) + + * function.c (epilogue_done): Correctly build a sequence of insns for + a sibcall epilogue. + +2002-06-17 Nick Clifton + + * config/fr30/fr30.h (CUMULATIVE_ARGS): Replace typedef with + #define. + + * config/m32r/m32r.md: Replace gen_sequence with get_insns. + +2002-06-16 Richard Henderson + + * config/i386/i386.h (BIGGEST_FIELD_ALIGNMENT): Define instead + of ADJUST_FIELD_ALIGN if IN_TARGET_LIBS. + +2002-06-16 Richard Henderson + + PR opt/6722 + * regclass.c (globalize_reg): Update regs_invalidated_by_call. + +2002-06-16 Neil Booth + + * config.gcc: Add i386/sysv4-cpp.h; remove i386-aout.h from vxworks. + * config/i386/i386-aout.h, config/i386/i386elf.h, + config/i386/sysv4.h: Remove CPP_PREDEFINES. + * config/i386/linux64.h, config/i386/i386elf.h, config/i386/mach.h, + config/i386/netware.h, config/i386/rtemself.h, config/i386/sco5.h, + config/i386/sol2.h, config/i386/vsta.h, config/i386/vxi386.h, + config/i386/win32.h: Use TARGET_OS_CPP_BUILTINS rather than + CPP_PREDEFINES and part of CPP_SPEC. + * config/i386/sysv4-cpp.h: New. + +2002-06-16 Richard Henderson + + PR c/7030 + * dwarf2out.c (modified_type_die): Don't assign the qualified die + to the unqualified type. + +Sun Jun 16 22:16:10 CEST 2002 Jan Hubicka + + * i386-protos.h (x86_field_alignment): Declare. + * i386.c (x86_field_alignment): Define. + * i386.h (ADJUST_FIELD_ALIGNMENT): New. + (BIGGEST_FIELD_ALIGNMENT): Kill. + +2002-06-16 Richard Henderson + + * vax.md (casesi): Use emit_jump_insn. Tidy expander pattern. + +2002-06-16 Richard Henderson + + * c-common.c (flag_ms_extensions): Move from c++ front end. + * c-common.h (flag_ms_extensions): Declare. + * c-decl.c (c_decode_option): Add -fms-extensions. + (grokfield): Don't accept anonymous structures in ISO C mode; + accept only unnamed anonymous structures in GNU C mode; accept + Plan 9 extensions in MS mode. + * c-parse.in (SAVE_EXT_FLAGS, RESTORE_EXT_FLAGS): Rename from + SAVE/RESTORE_WARN_FLAGS; add flag_iso frobbing; update all callers. + (extension): Clear flag_iso. + * doc/invoke.texi (C Dialect Options): Add -fms-extensions. + +2002-06-16 Hans-Peter Nilsson + + PR target/7042 + * reorg.c (make_return_insns) [DELAY_SLOTS_FOR_EPILOGUE]: Exit + early if current_function_epilogue_delay_list is non-empty. + * config/cris/cris.md ("return"): Add sanity check asserting that + current_function_epilogue_delay_list is empty. + +2002-06-16 Jeff Law + + * emit-rtl.c (gen_rtx_REG): Temporarily turn off automatic + sharing of hard registers. + + * toplev.c (rest_of_compilation): Remove redundant conditional. + + * toplev.c (rest_of_compilation): Perform a simpler, less costly + cleanup of the CFG when not optimizing. + +2002-06-16 Alan Modra + + * gcc.c (main): Correct startfile_prefix_spec check. + +2002-06-12 Geoffrey Keating + + * config.gcc: Revert rth's patch of 2002-05-18. Instead, + include both darwin.o and rs6000-c.o. + +2002-06-15 Roger Sayle + + * expr.c (compare_from_rtx): Call simplify_relational_operation + on all comparisons, not just those between integer constants, + with the correct (possibly unsigned) comparison code. + (do_compare_rtx_and_jump): Likewise. + +2002-06-15 John David Anglin + + * Makefile.in (tm_defines): New configuration variable. + (cs-config.h, cs-hconfig.h, cs-tconfig.h): Rename DEFINES to XM_DEFINES. + Pass tm_defines in TM_DEFINES. + (cs-tm_p.h): Rename DEFINES to XM_DEFINES. Pass TM_DEFINES. + * config.gcc (tm_defines): New configuration variable. + (hppa*-*-* | parisc*-*-*): Use tm_defines instead of pa-700.h and + pa-7100.h headers. Change hppa1* scheduling default to 7100LC. + * configure.in: Substitute tm_defines. + * configure: Rebuilt. + * mkconfig.sh: Rename DEFINES to XM_DEFINES. Output TM_DEFINES. + * doc/install.texi: Update. + * pa/pa-700.h: Delete file. + * pa/pa-7100.h: Delete file. + +2002-06-15 Roger Sayle + + * fold-const.c (comparison_to_compcode): New function to convert + an comparison TREE CODE into a bit-based representation. + (compcode_to_comparison): New function to convert from this bit + based representation back to a comparison TREE CODE. + (fold_truthop): Simplify (x + + * tm.texi (MEMBER_TYPE_FORCES_BLK): Document MODE argument. + + * stor-layout.c (compute_record_mode): Remove check for + FUNCTION_ARG_REG_LITTLE_ENDIAN and VOIDmode when checking for + MEMBER_TYPE_FORCES_BLK. Pass new mode field to + MEMBER_TYPE_FORCES_BLK. + + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Same. + + * config/c4x/c4x.h (MEMBER_TYPE_FORCES_BLK): Same. + +2002-06-14 Jeff Sturm + + * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS): Add SPARC_STACK_BIAS. + +2002-06-14 Steve Ellcey + + * configure.in (USE_UNWIND_EXCEPTIONS): Add support to set + USE_UNWIND_EXCEPTIONS if --enable-libunwind-exceptions is set. + * configure, config.in: Regenerate. + +2002-06-14 Eric Botcazou + + * loop.c (check_final_value): Use v->always_executed + instead of v->always_computable. + * unroll.c (final_giv_value): Don't calculate the final + value as a function of the biv if the giv is not computed + for every loop iteration. + +2002-06-14 Eric Botcazou + + * loop.c (for_each_insn_in_loop): Fix formatting and comments. + +2002-06-14 Eric Botcazou + + PR c/6677 + * convert.c (convert_to_integer) [LSHIFT_EXPR]: Don't pass + the truncation down when the target type is signed. + [trunc1]: Use unsigned arithmetic for LSHIFT_EXPR. + * fold-const.c (extract_muldiv) [NOP_EXPR]: Don't pass through + the conversion if the target type is a smaller type. + +2002-06-14 Richard Henderson + + * fold-const.c (fold) [compare ops]: Move X>=C / X + + * config/alpha/alpha.md (builtin_zapnot): Fix op2 mode. + +2002-06-14 Franz Sirl + + * rtl.h (SCHED_GROUP_P): Disallow CODE_LABEL, BARRIER and NOTE. + * sched-deps.c (add_dependence): Likewise. + (group_leader): Likewise. + * sched-rgn.c (init_ready_list): Likewise. + * doc/rtl.texi: Adjust accordingly. + +2002-06-13 Jeffrey Law + + * gcse.c (delete_null_pointer_checks_1): Inform caller if any + null pointer checks were eliminated. Update prototype. + (delete_null_pointer_checks): Similarly. + * rtl.h (delete_null_pointer_checks): Update prototype. + * toplev.c (rest_of_compilation): Only run cleanup_cfg if + delete_null_pointer_checks deletes one or more null + pointer checks. Do not run cleanup_cfg before gcse, the + CFG is accurate and optimized at that point.. + + * rs6000.c (rs6000_frame_related): Avoid unwanted sharing + of hard registers. + +2002-06-14 Ulrich Weigand + + * Makefile.in (libgcc.mk): Depend on specs. + +Fri Jun 14 12:15:11 2002 J"orn Rennecke + + * sh.md (mulsi3): Update way how to find insns in a sequence. + +Fri Jun 14 12:04:02 2002 Dhananjay R. Deshpande + + * sh.h: Define HARD_REGNO_RENAME_OK + * sh.c: sh_hard_regno_rename_ok: New. If current function has + interrupt_handler attribute, only registers saved on stack are OK. + * sh-protos.h: Declare sh_hard_regno_rename_ok. + +2002-06-14 Kaz Kojima + + * config/sh/sh.md (jump): Emit jump insn. + (call_pcrel): Get pattern of the result of gen_call_site. + (call_value_pcrel, sibcall_pcrel, GOTaddr2picreg): Likewise. + +2002-06-14 Neil Booth + + * cpphash.h (struct cpp_buffer): Remove saved_line_base. + * cpptrad.c: Update comments. + (skip_whitespace, copy_comment): Take a new parameter. + (skip_escaped_newlines): Don't duplicate escaped newline test. + (copy_comment): Different location for CUR, decide here how + to copy / replace the comment. + (skip_whitespace): Copy whitespace. + (_cpp_overlay_buffer, _cpp_remove_overlay): Don't play with line_base. + (scan_out_logical_line): Let copy comment handle keeping or + replacing comments. + (scan_parameters, _cpp_create_trad_definition): Update. + +2002-06-13 Alan Lehotsky + + * reload.c (get_secondary_mem,find_reloads_address, + find_reloads_address_1): Pass reference to MEM to find_reloads_address + so that LEGITIMIZE_RELOAD_ADDRESS will be called. + +2002-06-13 Jessica Han + + * defaults.h (TARGET_VTABLE_ENTRY_ALIGN): New. + (TARGET_VTABLE_DATA_ENTRY_DISTANCE): New. + * doc/tm.texi: Document them. + * config/ia64/ia64.h (TARGET_VTABLE_ENTRY_ALIGN): New. + (TARGET_VTABLE_DATA_ENTRY_DISTANCE): New. + (TARGET_VTABLE_USES_DESCRIPTORS): 4 word descriptors for 32-bit mode. + (ASM_OUTPUT_FDESC): Likewise. + +2002-06-13 Eric Christopher + + * diagnostic.c (output_format): Fix thinko. + +Thu Jun 13 22:34:33 2002 J"orn Rennecke + + * config/sh/coff.h (HAS_INIT_SECTION, INVOKE__MAIN): Don't define. + (DWARF2_UNWIND_INFO): Define to 0. + + * config/sh/sh.c (calc_live_regs): Don't use initial_value + optimization for PR_MEDIA_REG. + +2002-06-13 Neil Booth + + * cpphash.h (_cpp_lex_identifier_trad): Remove. + * cpplib.c (end_directive): Don't skip, always remove overlay + apart from #define. + (prepare_directive_trad): Handle NULL pfile->directive. + (_cpp_handle_directive): Always call prepare_directive_trad + if traditional. + * cppmain.c (check_multiline_token): Rename account_for_newlines, + generalize inputs. + (scan_translation_unit_trad): Use it. + * cpptrad.c (skip_comment): Rename copy_comment, copy comment to + output, get escaped newline in comment close correct. + (check_output_buffer, skip_whitespace): Update. + (_cpp_lex_identifier_trad): Remove. + (scan_out_logical_line): Handle -C and comments in directives + properly. + +Thu Jun 13 20:18:38 2002 J"orn Rennecke + + * config.gcc: Add support for sh[234]*-*-elf*, sh[2346lbe]*-*-linux*. + * config/sh/linux.h (TARGET_DEFAULT): Use TARGET_CPU_DEFAULT. + * sh.h (SELECT_SH1, SELECT_SH2, SELECT_SH3, SELECT_SH3E): New macros. + (SELECT_SH4_NOFPU, SELECT_SH4_SINGLE_ONLY, SELECT_SH4): Likewise. + (SELECT_SH4_SINGLE, SELECT_SH5_64, SELECT_SH5_64_NOFPU): Likewise. + (SELECT_SH5_32, SELECT_SH5_32_NOFPU, SELECT_SH5_COMPACT): Likewise. + (SELECT_SH5_COMPACT_NOFPU): Likewise. + (TARGET_SWITCHES): Use them. + (TARGET_CPU_DEFAULT): Define if not already defined. + (TARGET_DEFAULT): Use it. + (LINK_DEFAULT_CPU_EMUL): Value now depends on TARGET_CPU_DEFAULT. + * config/sh/t-linux (MULTILIB_OPTIONS): Use MULTILIB_ENDIAN. + * config/sh/t-monolib: New file. + +2002-06-13 Roger Sayle + + * toplev.c (rest_of_compilation): Simplify (and correct) the + logic of the first delete-null-pointer-checks pass. + +Thu Jun 13 18:24:17 CEST 2002 Jan Hubicka + + * i386.c (ix86_expand_movstr): Fix pasto. + +Thu Jun 13 18:18:17 CEST 2002 Jan Hubicka + + * reload.c (find_valid_class): Fix thinko in my previous patch. + +2002-06-13 Ulrich Weigand + + * config/s390/s390.h (TARGET_CPU_CPP_BUILTINS): New macro. + * config/s390/linux.h (TARGET_OS_CPP_BUILTINS): New macro. + (CPP_PREDEFINES, CPP_SPEC, CPP_ARCH31_SPEC, CPP_ARCH64_SPEC): Remove. + (EXTRA_SPECS): Remove cpp_arch31 and cpp_arch64. + +2002-06-13 Gabriel Dos Reis + + * tree-inline.c (expand_call_inline): Don' mess with _DECL + fields. + +2002-06-13 Gabriel Dos Reis + + * diagnostic.c (output_format): Recognize "%H" as a format + specifier for a location_t. + (text_specifies_location): New function. + (diagnostic_set_info): Use it. + +2002-06-13 Jeffrey Law + + * emit-rtl.c (static_regno_reg_rtx): Define. + (init_emit_once): Initialize static_regno_reg_rtx. + (init_emit): Copy static_regno_reg_rtx into regno_reg_rtx instead + of building new hard reg objects once per function. + (gen_rtx_REG): Try to share hard regs. + * regclass.c (init_fake_stack_mems): New function broken out from + init_regs. + * rtl.h (init_fake_stack_mems): Declare. + * toplev.c (lang_independent_init): Call init_regs before + init_emit_once. Call init_fake_stack_mems after init_emit_once. + + * i386.md (extenddfxf2, extenddftf2): Fix typo/thinko. + + * alias.c (argument_registers): Remove. + (init_alias_once): Initialize static_reg_base_value here. Remove + initialization of argument_registers. + (init_alias_once_per_function): Remove. + (init_alias_analysis): Copy all the entries from static_reg_base_value + into new_reg_base_value all at once. + * rtl.h (init_alias_once_per_function): Remove declaration. + * function.c (prepare_function_start): Do not call + init_alias_once_per_function. + + * caller-save.c (init_caller_save): Use gen_rtx_INSN instead of + starting a sequence and emitting an INSN. + +2002-06-13 Richard Sandiford + + * config/mips/r3900.h (MIPS_CPU_STRING_DEFAULT): Make lower case. + +2002-06-13 David S. Miller + + * expmed.c (init_expmed): Remove duplicate init of 'reg'. + +2002-06-13 Neil Booth + + * cpplib.c (end_directive): Handle line skipping. Only remove + the rest of the line if the directive was valid. + * cppmacro.c (_cpp_push_text_context): Set NODE_DISABLED when + expanding a traditional macro. + * cpptrad.c (recursive_macro): New. + (read_logical_line_trad): Handle skipping. + (scan_out_logical_line): Continue after a successful directive. + Don't expand macros whilst skipping, or if recursing. + (_cpp_create_trad_definition): scan_out_logical_line now sets + the output current position. + +2002-06-12 Eric Christopher + + From Chris Demetriou + * config/mips/mips.h (ISA_HAS_FP4): Add ISA_MIPS64 and fix + comment. + (ISA_HAS_MADD_MSUB): Ditto. + (ISA_HAS_NMADD_NMSUB): Ditto. + +2002-06-12 Eric Christopher + + * config.gcc: Consolidate little endian handling and + little/big endian targets. + * config/mips/elfl.h: Remove file. + * config/mips/elfl64.h: Ditto. + * config/mips/ecoffl.h: Ditto. + * config/mips/r3900.h (SUBTARGET_CPP_SPEC): Remove. + +2002-06-12 Geoffrey Keating + + * gengtype.h (xvasprintf): New prototype. + (xasprintf): New prototype. + (struct outf): New. + (get_output_file): Return an outf_p. + (header_file): Is now an outf_p. + (base_files): Now are outf_p. + (oprintf): New. + * gengtype.c: Replace all output FILE * with outf_p; use oprintf + rather than stdio operations. Use xasprintf in a few places, + when appropriate. + (xvasprintf): New. + (xasprintf): New. + (struct filemap): Delete. + (files): Delete. + (output_files): New. + (oprintf): New. + (create_file): Create an outf_p. Add parameter to indicate output + file name, change all callers. + (open_base_files): Create gtype-desc.c here. + (get_output_file_with_visibility): Rewrite. + (get_output_file_name): Just look at 'name' field in struct outf. + (close_output_files): Rewrite. + +2002-06-12 Jason Thorpe + + * config/vax/vax.h (MASK_UNIX_ASM, MASK_VAXC_ALIGNMENT) + (MASK_G_FLOAT): Define. + (TARGET_UNIX_ASM, TARGET_VAXC_ALIGNMENT, TARGET_G_FLOAT): Use them. + (TARGET_SWITCHES): Likewise. + (TARGET_DEFAULT): Likewise. + +2002-06-12 Daniel Jacobowitz + + * config/mips/elf.h (DWARF2_DEBUG_INFO): Define. + * config/mips/mips.c (mips_output_filename): Don't print a + ".file" directive if we are using DWARF-2. + (mips_output_function_prologue): Do not emit source file + name for TARGET_GAS. + +Wed Jun 12 16:45:13 CEST 2002 Jan Hubicka + + * i386.md (shift patterns): Use (TARGET_SHIFT1 || optimize_size) to + decide whether emit the short opcode. + * i386.h (x86_shift1): Declare. + (TARGET_SHIFT1): New macro. + * i386.c (x86_shift1): New global variable. + + * toplev.c (rest_of_compilation): Call find_basic_block pre-loop + unconditionally; make loop to rebuild CFG; kill unnecesary + find_basic_block calls; kill compute_bb_for_insn call. + * cfgbuild.c (find_basic_blocks): Kill compute_bb_for_insn call. + * haifa-sched.c (sched_init): Likewise. + * ssa-ccp.c (ssa_const_prop): Likewise. + * ssa-dce.c (ssa_eliminate_dead_code): Likewise. + +2002-06-11 David S. Miller + + * emit-rtl.c (emit_*_scope): Only access INSN_SCOPE if + active_insn_p. + +2002-06-11 Richard Henderson + + * c-common.c (builtin_define_type_max): New. + (cb_register_builtins): Define __SCHAR_MAX__, __SHRT_MAX__, + __INT_MAX__, __LONG_MAX__, __LONG_LONG_MAX__, __CHAR_BIT__. + + From Joseph S. Myers: + * glimits.h: Rewrite to expect the double underscore definitions + from the compiler. + + * config/alpha/unicosmk.h, config/avr/avr.h, config/h8300/h8300.h, + config/i386/linux64.h, config/ia64/aix.h, config/ia64/hpux.h, + config/ia64/ia64.h, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, + config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, + config/pa/pa.h, config/rs6000/aix43.h, config/rs6000/aix51.h, + config/rs6000/linux64.h, config/s390/linux.h, config/sh/sh.h, + config/stormy16/stormy16.h: Don't define any of __SHRT_MAX__, + __INT_MAX__, __LONG_MAX__, or __LONG_LONG_MAX__. + +2002-06-11 Richard Henderson + + * config/alpha/alpha.c (ALPHA_BUILTIN_THREAD_POINTER): New. + (ALPHA_BUILTIN_SET_THREAD_POINTER): New. + (code_for_builtns): Update. + (alpha_init_builtins): Add __builtin_thread_pointer and + __builtin_set_thread_pointer. + (alpha_expand_builtin): Handle void builtins. + * doc/extend.texi (Alpha Built-in Functions): Update. + +2002-06-11 Hans-Peter Nilsson + + PR target/6997 + * config/cris/cris.md ("sleu"): Set attribute "cc" to "none". + +2002-06-11 Zack Weinberg + + * config.gcc: Make the name of the extra-modes file adjustable + by target stanzas. + (s390x, strongarm, xscale stanzas): Use this facility. + * configure.in: Update to match. + * configure: Regenerate. + +2002-06-11 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_emit_minmax): Treat unsigned + max/mins as unsigned GE compares. + +2002-06-11 Jason Thorpe + + * config.gcc (vax-*-bsd*): Add vax/bsd.h to ${tm_file}. + * config/vax/bsd.h: New file. + * config/vax/netbsd.h: Add missing notice. + (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): Define. + (CPP_SPEC): Use NETBSD_CPP_SPEC. + * config/vax/openbsd.h: Update copyright years. + (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): Define. + * config/vax/ultrix.h: Likewise. + * config/vax/vaxv.h: Likewise. + * config/vax/vms.h: Likewise. + * config/vax/vax.h (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_PREDEFINES, CPP_SPEC): Remove. + +Wed Jun 12 01:50:28 CEST 2002 Jan Hubicka + + * i386.md (addqi_1_slp, subqi_1_slp + (andqi_ext0, testqi_ext0): Remove unnecesary check. + (addhi*, addqi*): Simplify "dec" condition. + (testsi to testqi splitters): Remove TARGET_PROMOTE_QImode check. + (and, or, xor to QImode splitters): New. + (iorqi_ext*): New. + (xorqi_ext_0): New. + (xorqi_ext_1): Rename to xorqi_ext_2; bring to sync with and versions. + (andqi_ext_1_rex64): New. + (ashrqi*_slp): New. + (ashlqi*_slp): New. + (lshlqi*_slp): New. + (rotrqi3*_slp): New. + (rotlqi3*_slp): New. + +2002-06-11 Geoffrey Keating + + * config.gcc (powerpc*-*-*, rs6000-*-*-*): Don't bother including + softfloat.h. + * config/rs6000/vxppc.h (CPP_ENDIAN_BIG_SPEC): Delete. + (CPP_ENDIAN_LITTLE_SPEC): Delete. + * config/rs6000/sysv4le.h (CPP_ENDIAN_DEFAULT_SPEC): Delete. + * config/rs6000/sysv4.h (CPP_SYSV_SPEC): Delete _SOFT_FLOAT setting, + __LONG_DOUBLE_128__ setting, _CALL_* setting. + (CPP_DEFAULT_SPEC): Delete. + (CPP_FLOAT_DEFAULT_SPEC): Delete. + (CPP_LONGDOUBLE_DEFAULT_SPEC): Delete. + (CPP_SYSV_DEFAULT_SPEC): Delete. + (CPP_ENDIAN_BIG_SPEC): Delete. + (CPP_ENDIAN_LITTLE_SPEC): Delete. + (CPP_ENDIAN_SPEC): Delete. + (CPP_SPEC): Don't include cpp_endian, cpp_cpu. + (SUBTARGET_EXTRA_SPECS): Delete cpp_sysv_default, cpp_endian_default, + cpp_endian, cpp_endian_big, cpp_endian_little, cpp_float_default, + cpp_longdouble_default. + * config/rs6000/softfloat.h: Delete. + * config/rs6000/rs6000.h (CPP_CPU_SPEC): Delete. + (EXTRA_SPECS): Delete cpp_cpu. + (TARGET_CPU_CPP_BUILTINS): New. + * config/rs6000/rs6000-protos.h (rs6000_cpu_cpp_builtins): New + prototype. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): New. + * config/rs6000/linux64.h (CPP_PREDEFINES): Remove endianness defines. + (CPP_DEFAULT_SPEC): Delete. + * config/rs6000/eabiaix.h (CPP_SYSV_DEFAULT_SPEC): Delete. + * config/rs6000/darwin.h (CPP_PREDEFINES): Don't define __BIG_ENDIAN__. + * config/rs6000/beos.h (CPP_SPEC): Remove cpp_cpu. + (CPP_DEFAULT_SPEC): Delete. + * config/rs6000/aix51.h (CPP_SPEC): Remove cpp_cpu, -D_ARCH_PPC. + (CPLUSPLUS_CPP_SPEC): Likewise. + (CPP_CPU_SPEC): Delete. + (CPP_DEFAULT_SPEC): Delete. + * config/rs6000/aix43.h (CPP_SPEC): Remove cpp_cpu, -D_ARCH_PPC. + (CPLUSPLUS_CPP_SPEC): Likewise. + (CPP_CPU_SPEC): Delete. + (CPP_DEFAULT_SPEC): Delete. + * config/rs6000/aix41.h (CPP_SPEC): Remove cpp_cpu. + (CPP_DEFAULT_SPEC): Delete. + * config/rs6000/aix.h (CPP_SPEC): Remove cpp_cpu. + (CPP_DEFAULT_SPEC): Delete. + + * doc/gty.texi: Small updates. + +2002-06-12 Gabriel Dos Reis + + * objc/objc-act.c (warn_with_ivar): Adjust calls to + diagnostic_count_error. + (warn_with_method): Likewise. + + * diagnostic.h (warnings_are_errors_message): New field of + diagnostic_context. + (diagnostic_count_error): Rename to diagnostic_count_diagnostic to + match semantics. + * diagnostic.c: Adjust calls to diagnostic_count_error through out. + (diagnostic_count_diagnostic): Make aware of other kinds of + diagnostics. + (diagnostic_initialize): Initialize warnings_are_errors_message field. + +2002-06-11 Tom Tromey + + For PR java/6520: + * fold-const.c (fold_convert): Don't modify existing tree's type. + +2002-06-11 Geoffrey Keating + + * config/rs6000/ppc-asm.h: Remove some Windows NT leftovers. + +2002-06-11 Richard Henderson + + * caller-save.c (init_caller_save): Clear INSN_CODE each iteration. + +2002-06-11 Richard Henderson + + * defaults.h (EH_FRAME_SECTION_NAME): Don't define if + DWARF2_UNWIND_INFO is false. + +2002-06-11 Bob Wilson + + * config/xtensa/t-xtensa (LIBGCC1_TEST, CROSS_LIBGCC1): Delete. + + * config/s390/s390.c (emit_prologue): gen_store_multiple + returns an insn now, not a pattern. + +2002-06-11 Rainer Orth + + * Makefile.in (gccinstall.dvi): Pass absolute pathnames to + $(TEXI2DVI) -o. + +Tue Jun 11 21:53:37 CEST 2002 Jan Hubicka + + * i386.c (x86_promote_QImode): Set for Athlon + (x86_fast_prefix): New global variable. + (x86_arch_always_fancy_math_387): Fix formating. + * i386.h (x86_fast_prefix): Declare + (TARGET_FAST_PREFIX): define. + * i386.md (and to strict_low_part, HI to SI + promoting splitter): Use new macro. + + * i386.h (RTX_COSTS): float_extend is not for free for SSE. + +2002-06-11 Zack Weinberg + + * Makefile.in (distclean): Delete junk left in testsuite + directory, too. + +2002-06-11 Jeffrey Law + + * emit-rtl.c (try_split): Use INSN_LAST, not LAST_INSN to get the + last insn created by the splitter. + + * caller-save.c (init_caller_save): Move creation of SAVEINSN + and RESTINSN into the scope of the sequence. + + * mips.c (mips_expand_prologue): Use emit_jump_insn for trivial + RETURN insns. + + * loop.c (loop_regs_scan): Avoid useless generation of REG objects. + + * mips.c (function_arg_advance): gen_ashldi3 returns an INSN now, + not the pattern. So extract the pattern from the insn. + + * mips.c (embedded_pic_fnaddr_reg): Fix typo. + +2002-06-11 Ulrich Weigand + + * config/s390/s390.md (movsi): Only use floating point + register alternatives when operands are already fprs. + (movdi_31, movdi_64): Likewise. + +2002-06-11 David S. Miller + + * emit-rtl.c (try_split): Do not abort on non-INSN_P. + Only run RTX equality checks on INSN_P rtl. + +2002-06-11 Ulrich Weigand + + * config/s390/s390.md (reload_base, ltorg): Remove. + * s390.c (s390_stop_dump_lit_p, s390_dump_literal_pool, + s390_asm_output_pool_prologue, s390_pool_start_insn): Remove. + * s390-protos.h (s390_stop_dump_lit_p, s390_dump_literal_pool, + s390_asm_output_pool_prologue): Likewise. + * s390.h (s390_pool_start_insn): Likewise. + + * s390.c (s390_output_symbolic_const): Remove support for + old-style pool chunks. + (s390_function_epilogue): Likewise. + (s390_output_constant_pool): Likewise. Also, fix incorrect + alignment for 64-bit literal pools. + (print_operand_address): Remove 'y' and 'Y' format flags. + * s390.h (ASM_OUTPUT_POOL_PROLOGUE): Remove support for + old-style pool chunks. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise. + (ASM_OUTPUT_POOL_EPILOGUE): Remove. + (S390_CHUNK_MAX, S390_CHUNK_OV, S390_POOL_MAX): Remove. + + * s390.c (consttable_operand): New function. + * s390-protos.h (consttable_operand): Declare it. + * s390.h (PREDICATE_CODES): Add consttable_operand. + * s390.md (consttable_qi, consttable_hi, consttable_si, consttable_di, + consttable_sf, consttable_df, pool_start_31, pool_end_31, + pool_start_64, pool_end_64, reload_base, reload_base2): New insns. + * s390.c (struct constant, struct constant_pool): New data types. + (constant_modes, gen_consttable): New variables. + (s390_start_pool, s390_end_pool, s390_add_pool, + s390_dump_pool, s390_free_pool): New functions. + (s390_chunkify_pool): Completely reimplement literal pool + overflow handling. + + * s390.c (s390_pool_overflow): New variable. + * s390.h (s390_pool_overflow): Declare it. + * s390.md (cjump, icjump): Use it to adapt length for out-of-range + jumps in literal pool overflow situations. + + * s390.c (s390_decompose_address): Accept new-style pool chunk offsets. + (s390_frame_info): Account for possible use of RETURN_REGNUM + by new literal pool overflow code. + (s390_emit_prologue): Likewise. + +2002-06-05 David S. Miller + + Delete SEQUENCE rtl usage outside of reorg and ssa passes. + * rtl.h (gen_sequence, emit_insns, emit_insns_before, + emit_insns_before_scope, emit_insns_after, + emit_insns_after_scope): Delete declaration. + * ada/misc.c (insert_code_for): Use emit_insn* instead of + emit_insns_foo. + * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. + (alpha_set_memflags): Fix comment. + (set_frame_related_p): Use get_insns instead of gen_sequence. + * config/alpha/alpha.md (setjmp receiver splitter): Avoid + emitting no insns. + * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of + gen_sequence. + (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. + * config/fr30/fr30.c (fr30_move_double): Likewise. + * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): + Likewise. + * config/ia64/ia64.c (spill_restore_mem): Likewise. + * config/ia64/ia64.md (conditional move spliiter): Avoid emitting + no insns. + * config/m32r/m32r.c (gen_split_move_double): Use get_insns + instead of gen_sequence. + * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. + (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. + * config/sh/sh.c (sh_need_epilogue): Likewise. + * config/sparc/sparc.md (current_function_calls_alloca, flat): New + attributes. + (setjmp pattern and split): Use them to avoid splitter which emits + no RTL. + * genattrtab.c (main): Emit include of function.h + * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use + get_insns instead of gen_sequence. + * config/cris/cris.c (cris_split_movdx): Likewise. + * emit-rtl.c (emit_insns*): Kill. + (try_split): Expect insn list instead of SEQUENCE. + (make_jump_insn_raw, make_call_insn_raw): Fix comments. + (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. + Make them abort if a SEQUENCE is given and RTL checking is + enabled. + (emit_*_scope): Don't forget to set scope on final insn. + (gen_sequence): Move from here... + * ssa.c (gen_sequence): To here as private function. + * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix + comments. + (expand_builtin_return, expand_builtin_mathfn): Likewise. + (expand_builtin_strlen): Use get_insns instead of gen_sequence. + (expand_builtin_saveregs): Use emit_insn_foo, fix comments. + (expand_builtin_expect_jump): Use get_insns and fix comments. + * calls.c (try_to_integrate): Use emit_insn_foo. + (expand_call, emit_library_call_value_1): Likewise. + * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. + (emit_move_insn_1): Use get_insns instead of gen_sequence. + (expand_expr): Use emit_insn_foo. + * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. + * except.c (build_post_landing_pads): Likewise. + * flow.c (attempt_auto_inc): Likewise. + * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, + expand_nl_goto_receivers, expand_decl_cleanup): Likewise. + * function.c (fixup_var_refs_insn): Use get_insns instead of + gen_sequence. + (fixup_var_refs_1): Likewise and expect insn list from gen_foo. + (fixup_memory_subreg): Use get_insns instead of gen_sequence. + (fixup_stack_1, purge_addressof_1, expand_main_function, + get_arg_pointer_save_area): Likewise. + (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, + expand_function_end): Use emit_insn_foo. + (record_insns, keep_stack_depressed): Work with insn list instead + of SEQUENCE, fix comments. + * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, + noce_try_store_flag_constants, noce_try_store_flag_inc, + noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, + noce_try_minmax, noce_try_abs): Use emit_insn_foo. + (noce_process_if_block): Use get_insns instead of gen_sequence. + * optabs.c (add_equal_note): Work with insn list, fix comments. + (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. + (expand_unop, expand_complex_abs, expand_unop_insn, + expand_no_conflict_block): Likewise. + (gen_move_insn): Use get_insns instead of gen_sequence. + (gen_cond_trap): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + (emit_initial_value_sets): Use emit_insn_foo. + * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. + (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently + now that RTL generators give insn lists. + * sibcall.c (replace_call_placeholder): Use emit_insn_foo. + * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns + instead of gen_sequence. + (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. + * explow.c (emit_stack_save, emit_stack_restore): Use get_insns + instead of gen_sequence. + * loop.c (move_movables, emit_prefetch_instructions, + gen_add_mult, check_dbra_loop, gen_load_of_final_value): + Likewise. + (loop_regs_update): Work with insn list instead of SEQUENCE rtl. + (product_cheap_p): Likewise, and add commentary about RTL wastage + here. + * lcm.c (optimize_mode_switching): Use get_insns instead of + gen_sequence. + * profile.c (gen_edge_profiler): Likewise. + * regmove.c (copy_src_to_dest): Likewise. + * reg-stack.c (compensate_edge): Likewise and fix comment. + * gcse.c (process_insert_insn): Likewise. + (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. + * jump.c (delete_prior_computation): Update comment. + * genemit.c (gen_expand, gen_split, main): Use get_insns instead + of gen_sequence, update comments to match. + * recog.c (peephole2_optimize): Work with insn lists instead of + SEQUENCE rtl. + * sched-vis.c (print_pattern): Abort on SEQUENCE. + * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): + Use get_insns instead of gen_sequence. + (copy_loop_body): Likewise and don't emit dummy NOTE. + * genrecog.c: Don't mention SEQUENCE rtl in comments. + * combine.c (try_combine): Expect insn lists from split generator. + * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by + hand. + +2002-06-11 Roger Sayle + Andreas Jaeger + + * cfgbuild.c: Update copyright years. + +2002-06-11 Andreas Schwab + + * config/m68k/m68k.h (PREDICATE_CODES): Define. + +2002-06-11 Eric Christopher + + * doc/tm.texi (Run-time Target): Add comment about flag_iso + and strict ANSI. + * config/mips/ecoff.h (CPP_PREDEFINES): Remove. + * config/mips/ecoffl.h: Ditto. + * config/mips/elf64.h (SUBTARGET_CPP_SPEC): Remove. + (CPP_PREDEFINES): Ditto. + * config/mips/elfl64.h: Ditto. + * config/mips/elfl.h: Ditto. + * config/mips/iris3.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): #if 0 + out until irix header consolidation. + * config/mips/iris5.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): Replace + with SUBTARGET_OS_CPP_BUILTINS. + * config/mips/iris6.h: Ditto. + (CPLUSPLUS_CPP_SPEC): Remove. + * config/mips/linux.h: Ditto. + * config/mips/netbsd.h: Ditto. + * config/mips/openbsd.h: Ditto. + * config/mips/rtems.h: Ditto. + * config/mips/rtems64.h: Ditto. + * config/mips/sni-svr4.h: Ditto. + * config/mips/mips.h (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, + ISA_MIPS32, ISA_MIPS64): New defines. + (GENERATE_MULT3_SI, HAVE_SQRT_P, ISA_HAS_64BIT_REGS, + ISA_HAS_BRANCHLIKELY, ISA_HAS_CONDMOVE, ISA_HAS_8CC, ISA_HAS_FP4, + ISA_HAS_COND_TRAP, ISA_HAS_MADD_MSUB, ISA_HAS_NMADD_NMSUB, + ISA_HAS_CLZ_CLO, ISA_HAS_DCLZ_DCLO): Use. + (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_PREDEFINES, LONG_MAX_SPEC, CPP_FPR_SPEC, CPP_SPEC): Remove. + * config/mips/mips.md (mulsi3_mult3): Use ISA_MIPS32/64. + (movdicc): Remove check for ISA_MIPS32. + (bunordered, bordered, bungt, bunlt, buneq, bunge, bunle, + sunordered_df, sunordered_sf, sordered_df, sordered_sf, + sunlt_df, sunlt_sf, sungt_df, sungt_sf, suneq_df, suneq_sf, sunge_df, + sunge_sf, sunle_df, sunle_sf): New patterns. + +2002-06-11 Neil Booth + + * Makefile.in: Update cppmain.o. + * cpphash.h (struct cpp_reader): Move some members to a + nested structure. + (trad_line): Rename saved_line. + (_cpp_read_logical_line_trad): Update. + (_cpp_remove_overlay): New. + * cppinit.c (cpp_create_reader): No need to set saved_line. + (cpp_destroy): Update. + (cpp_read_main_file): Only overlay if compiling. + * cpplex.c (continue_after_nul): Return false if in directive. + * cpplib.c (EXPAND): New. + (directive_table, SEEN_EOL): Update. + (end_directive): Remove overlay if traditional; don't skip + line in traditional #define. + (prepare_directive_trad): New. + (_cpp_handle_directive, run_directive): Update for traditional + directives. + (lex_macro_node): Simplify, don't use lex_identifier_trad. + * cpplib.h (struct options): Add preprocess_only. + * cppmain.c: Don't include intl.h. + (cpp_preprocess_file): Set options->preprocess_only. + (scan_translation_unit_trad): Fix, and print line numbers. + * cpptrad.c (check_output_buffer, lex_identifier, scan_parameters, + maybe_start_funlike, scan_out_logical_line, replace_args_and_push, + save_replacement_text, _cpp_create_trad_definition): Update for + variable renaming. + (_cpp_overlay_buffer): Save line number. + (_cpp_remove_overlay): Rename from restore_buff, restore line. + (_cpp_read_logical_line_trad): Don't handle overlays here. + (scan_out_logical_line): Process directives. + +2002-06-11 Danny Smith + + * gthr-win32.h: Wrap functions in extern "C". + (__gthread_key_t): Typedef as unsigned long, + not win32 DWORD. + (__GTHREAD_ONCE_INIT): Use 0, not win32 FALSE. + (__gthread_mutex_t): Typedef as void*, not win32 HANDLE. + (__gthr_win32_once, __gthr_win32_key_create, + __gthr_win32_key_delete, __gthr_win32_getspecific, + __gthr_win32_setspecific, __gthr_win32_mutex_init_function, + __gthr_win32_mutex_lock,__gthr_win32_mutex_trylock, + __gthr_win32_mutex_unlock): Declare. + (__gthread_once,__gthread_key_create, + __gthread_key_delete, __gthread_getspecific, + __gthread_setspecific, __gthread_mutex_init_function, + __gthread_mutex_lock,__gthread_mutex_trylock, + __gthread_mutex_unlock): Call corresponding + __gthr_win32_* extern implementations if #defined + __GTHREAD_HIDE_WIN32API. + * config/i386/t-mingw32 (LIB2FUNCS_EXTRA): Set to + $(srcdir)/config/i386/gthr-win32.c + * config/i386/gthr-win32.c: New implementation file. + (__gthr_win32_once, __gthr_win32_key_create, + __gthr_win32_key_delete, __gthr_win32_getspecific, + __gthr_win32_setspecific, __gthr_win32_mutex_init_function, + __gthr_win32_mutex_lock,__gthr_win32_mutex_trylock, + __gthr_win32_mutex_unlock): New functions, based on + static inlines in gthr-win32.h. + +2002-06-10 Bob Wilson + + * config/xtensa/xtensa.c (override_options): Don't warn about + using -fpic or -fPIC when PIC is enabled by default. + +2002-06-10 Roger Sayle + + * toplev.c (rest_of_compilation): Revert flag_if_conversion change. + +2002-06-10 Zack Weinberg + + * Makefile.in (MACHMODE_H): Add @extra_modes_file@. + * configure.in: If $srcdir/config/${cpu_type}/${cpu_type}-modes.def + exists, substitute its pathname as @extra_modes_file@, define + EXTRA_MODES_FILE to be an appropriate string to #include it + with, and define EXTRA_CC_MODES to 1. + + * machmode.def: Update comments. Include EXTRA_MODES_FILE if + it's defined. Get rid of redundancy in calling sequence for + CC; don't use it to define CCmode, to avoid a warning. + * libgcc2.c: Include symcat.h for the sake of machmode.def. + + * arc-modes.def, arm-modes.def, c4x-modes.def, i386-modes.def, + i960-modes.def, ia64-modes.def, m88k-modes.def, mmix-modes.def, + pa-modes.def, pdp11-modes.def, rs6000-modes.def, sparc-modes.def: + New files. + * arc.h, arm.h, c4x.h, i386.h, i960.h, ia64.h, m88k.h, mmix.h, + pa.h, pdp11.h, rs6000.h, sparc.h: Don't define EXTRA_CC_MODES. + + * doc/sourcebuild.texi, doc/tm.texi: Document new scheme for + defining extra CC modes. + +2002-06-10 Roger Sayle + Andreas Jaeger + + * cfgrtl.c (create_basic_block_structure): Remove index argument + and use last_basic_block++ instead. (create_basic_block): Update. + * cfgbuild.c (find_basic_blocks_1): Likewise. + + * cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument. + * haifa-sched.c (sched_init): Update compute_bb_for_insn caller. + * sched-ebb.c (schedule_ebbs): Likewise. + * sched-rgn.c (schedule_insns): Likewise. + * ssa-ccp.c (ssa_const_prop): Likewise. + * ssa-dcs.c (ssa_eliminate_dead_code): Likewise. + * toplev.c (rest_of_compilation): Likewise. + * config/ia64/ia64.c (ia64_reorg): Likewise. + +2002-06-10 Roger Sayle + + * simplify-rtx.c (simplify_replace_rtx): Allow replacement + of matching registers. + +2002-06-10 Roger Sayle + + * toplev.c (rest_of_compilation): Disable early if-conversion pass. + * gcse.c (bypass_conditional_jumps): Fix typo in setcc test. + +2002-06-10 Hans-Peter Nilsson + + * config/mmix/mmix.h: Improve comments. + (CPP_SPEC, CPP_PREDEFINES): Don't define. + (TARGET_CPU_CPP_BUILTINS): Define. + (CANONICALIZE_COMPARISON): Don't define, replace with comment. + (PREDICATE_CODES) <"mmix_reg_or_8bit_or_256_operand">: Remove + unused predicate. + * config/mmix/mmix.c (MMIX_OUTPUT_REGNO): Add cast to avoid + compiler warning. + (mmix_constant_address_p): Remove another + redundant test before case. + (mmix_canonicalize_comparison): Remove unused function. + (mmix_print_operand_address): Don't test and adjust for operand in + non-canonical format. + (mmix_reg_or_8bit_or_256_operand): Remove unused predicate. + (mmix_gen_compare_reg): Don't use CANONICALIZE_COMPARISON. + +2002-06-10 Zack Weinberg + + * config/m32r/m32r.h: Don't define SELECT_CC_MODE. + * config/m32r/m32r-protos.h: Don't prototype m32r_select_cc_mode. + * config/m32r/m32r.c: Don't define m32r_select_cc_mode. + (gen_compare): Use CCmode unconditionally. + +2002-06-10 Jakub Jelinek + + PR optimization/6759 + * cse.c (cse_insn): Fold src_eqv just once, store it folded back into + the REQ_EQUAL note. + +2002-06-10 Jakub Jelinek + + PR c/6660 + * c-decl.c (grokfield): Allow user defined types if they declare + structs or unions for unnamed fields. + +2002-06-10 Jakub Jelinek + + PR c/6809 + * print-rtl.c (print_mem_expr): Don't crash on unnamed fields. + +2002-06-10 Jakub Jelinek + + PR optimization/6842 + * combine.c (combine_simplify_rtx) [SUBREG]: Don't ICE if VOIDmode + operand subreg cannot be simplified. + +2002-06-10 Jakub Jelinek + + * varasm.c (const_hash): Handle FDESC_EXPR like ADDR_EXPR. + (compare_constant): Likewise. + (output_addressed_constants): Likewise. + +2002-06-10 Jakub Jelinek + + * cfgcleanup.c (try_optimize_cfg): Make sure merge_blocks doesn't + merge bb with itself. + +2002-06-10 Richard Henderson + + * config/alpha/alpha.md (builtin_zap): Fix thinkos expanding mask. + (builtin_zapnot): Likewise. + + * config/alpha/ev5.md: Don't combine shift and mvi insns in one + reservation. + +2002-06-10 Eric Christopher + + * config/i386/i386.c (ix86_osf_output_function_prologue): Remove + prototype and function. + (TARGET_ASM_FUNCTION_PROLOGUE): Remove OSF version. + (call_insn_operand): Remove half pic references. + (legitimate_address_p): Ditto. + * config/i386/i386.h: Remove half pic defines. + +2002-06-10 Eric Christopher + + * doc/extend.texi (Return Address): Add note explaining the side- + effects of inlining on __builtin_return_address. + +2002-06-10 Tom Tromey + + * Makefile.in (LANGHOOKS_DEF_H): Include langhooks-def.h. + (c-common.o): Depend on langhooks.h. + +2002-06-10 Neil Booth + + * cpphash.h (_cpp_read_logical_line_trad, + _cpp_expansions_different_trad): Update prototypes. + * cpplex.c (continue_after_nul): New. + * cppmain.c: Include cpphash.h. + (scan_translation_unit_trad): New. + (cpp_preprocess_file): Call it. + * cpptrad.c (_cpp_read_logical_line_trad): Take new parameter + overlay. + (_cpp_expansions_different_trad): Update prototype. + +Mon Jun 10 18:02:24 2002 J"orn Rennecke + + Fix cfi generation for SH[1-4]: + + * sh.c (frame_insn): New function. + (output_stack_adjust): Add parameter emit_fn. All callers changed. + (push): Now returns rtx. Use frame_insn. + (sh_expand_prologue): Clear RTX_FRAME_RELATED_P for second push + of a DF register. + * sh.h (INCOMING_RETURN_ADDR_RTX, DWARF_FRAME_RETURN_COLUMN): Define. + +2002-06-10 Zack Weinberg + + * Makefile.in (STAGESTUFF): Add s-gtype, gt-*.h, gtype-*.h, + and gtype-desc.c. + (mostlyclean): Delete specs.h, options.h, gencheck.h here... + (distclean): ... not here. But do delete all testsuite/*.log, + testsuite/*.sum files here. Delete mkheaders. Delete + po/*.gmo and the testsuite directory in a split tree build. + +2002-06-10 Jeffrey Law + + * alias.c (static_reg_base_value): New to hold RTL for + items allocated once per function for the aliasing code. + (init_alias_once_per_function): Initialize static_reg_base_value. + (init_alias_analysis): Avoid throw-away allocations of RTL by + using pre-computed values in static_reg_base_value. + * function.c (prepare_function_start): Call + init_alias_once_per_function appropriately. + * rtl.h (init_alias_once_per_function): Declare. + * caller-save (init_caller_save): Restructure slightly to + avoid lots of silly RTL generation. + * expr.c (init_expr_once): Likewise. + * reload1.c (reload_cse_regs_1): Allocate throw-away register + RTL object here. Pass it into children. + (reload_cse_simplify_operands): Use passed-in register RTL + object. + (reload_cse_simplify): Pass through throw-away register + RTL object. + +2002-06-10 Daniel Berlin + + * Makefile.in (ssa.o): Add dependency on $(RTL_H), which was missing. + +2002-06-10 Richard Sandiford + + * gcc.c (process_command): Avoid assignment to read-only location. + Fix sizeof calculation. + +2002-06-10 Neil Booth + + * cpphash.h (struct cpp_macro): Put comments on their own lines. + (_cpp_expansions_different_trad): New. + * cppmacro.c (warn_of_redefinition): Fix for traditional case. + * cpptrad.c (canonicalize_text): New. + (scan_out_logical_line): Handle no arguments correctly. + (save_replacement_text): Commit memory when finished. + (_cpp_expansions_different_trad): New. + +2002-06-10 Tim Josling + + * gengtype.c (unnamed enum containing BASE_FILE_*): Add languages + TREELANG and COBOL. + (lang_names): Add treelang and cobol. + (get_file_basename): Add code to support treelang and cobol as + 4th and 5th users of c-common.c. + +2002-06-09 Geoffrey Keating + + * Makefile.in (install-driver): Install driver as + $(target_alias)-gcc-$(version). + * gcc.c (spec_version): Make const. + (process_command): Handle -V and -b by using exec. + * doc/invoke.texi (Target Options): Restore -V option, + update docs for -b option. + +2002-06-10 Tim Josling + + * configure.in (remaining_languages_check): + Added check that all languages specified were found. + Exit if not found. Previous behavior was silent failure. + * configure: Regenerated. + +2002-06-10 Tim Josling + + First steps to making treelang documentation compliant, based on + instructions in sourcebuild.texi. Also add to gcc.c list of + default languages. + + * doc/contrib.texi: Add self as contributor of treelang. + + * doc/frontends.texi: Add mention of treelang. + + * doc/invoke.texi (Overall Options): Add mention of treelang. + + * doc/standards.texi: Add mention of treelang. + +2002-06-09 Hans-Peter Nilsson + + * config/cris/cris.c: Include ggc.h + +2002-06-09 Neil Booth + + * cpphash.h (_cpp_push_text_context): Update. + (_cpp_arguments_ok): New. + * cppmacro.c (_cpp_arguments_ok): New, split out from... + (collect_args): ...here. + (_cpp_push_text_context): Change inputs. + * cpptrad.c (struct fun_macro, maybe_start_funlike, save_argument, + replace_args_and_push): New. + (lex_identifier, _cpp_lex_identifier_trad, scan_parameters): + Don't use IS macros directly. + (scan_out_logical_line): Handle function-like macro argument + collection. + (push_replacement_text): Update. + (replacement_length): Remove. + (_cpp_create_trad_definition): Don't skip whitespace before + checking for '('. + +2002-06-09 Marek Michalkiewicz + + * config/avr/avr.c (avr_mcu_types): Update for new devices. + * config/avr/avr.h (TARGET_SWITCHES, AVR_MEGA): Add -mshort-calls. + (LINK_SPEC, CRT_BINUTILS_SPECS): Update for new devices. + * config/avr/avr.md ("type" and "length" attributes): New type + "xcall", length 1 or 2 if AVR_MEGA. Use in all patterns that + output a single "call" or "rcall" insn depending on device size. + * config/avr/t-avr (MULTILIB_MATCHES): Update for new devices. + +2002-06-09 David Edelsohn + + * config/rs6000/{aix43.h,aix5.1} (ASM_CPU_SPEC): Add power3 + synonym for 630. Add power4. Remove embedded processors. Use -m604 + assembler option. + (CPP_CPU_SPEC): Add power3 and power4. + (PROCESSOR_DEFAULT): Change to 604e. + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Similar additions. + (CPP_CPU_SPEC): Similar additions. + (enum process_type): Add POWER4. + (RTX_COSTS): Add POWER4. + (CPP_CPU_SPEC): Similar additions. + * config/rs6000/linux64.h (PROCESSOR_DEFAULT): Define. + (PROCESSOR_DEFAULT64): Define. + * config/rs6000/rs6000.c (rs6000_override_options): Add power4. + (rs6000_adjust_cost): Add 603, 604, 604e, 620, 630, Power4 to + branch adjustment. + (rs6000_issue_rate): Add Power4. + * config/rs6000/rs6000.md (cpu attr): Add power4. + (iu compare): Remove 604, 604e, 620, 630. + Add basic Power4 scheduling information. + (mfcr/mtcrf): Change type attribute to cr_logical. + +2002-06-08 Kaveh R. Ghazi + + * gengtype.h (error_at_line): Use PARAMS, not VPARAMS. Add + ATTRIBUTE_PRINTF_2. + * gengtype-lex.l: Fix format specifier warning. + + * genautomata.c: Don't include ctype.h or limits.h. Use ISSPACE, + not isspace. + * gengtype-lex.l: Don't include ctype.h and use ISSPACE/ISIDNUM in + lieu of isspace/IDchar. + * gengtype.c: Likewise for ctype.h and ISALNUM vs isalnum. + * read-rtl.c: Likewise for ctype.h. Don't define ISDIGIT or + ISSPACE. + +2002-06-08 Zack Weinberg + + * Makefile.in (LIBCPP_OBJS): Take out version.o. + * cpphash.h (cpp_reader): Take out print_version member. + * cppinit.c: (cpp_handle_option): Don't do anything with + -version. Just set help_only for --version, --target-help. + Just set verbose option for -v. + (cpp_post_options): Don't print a version string. + +2002-06-08 Marek Michalkiewicz + + * config/avr/avr.c (TARGET_SECTION_TYPE_FLAGS): New. + (avr_section_type_flags): New, handle .noinit* sections. + +2002-06-08 Jason Thorpe + + * config/sh/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): Define + and include netbsd_entry_point. + (SUBTARGET_LINK_SPEC): Define as NETBSD_LINK_SPEC_ELF. + (NETBSD_ENTRY_POINT): Define. + +2002-06-08 Jason Thorpe + + * config/sh/sh.h (SUBTARGET_EXTRA_SPECS): Define empty + if not already defined. + (EXTRA_SPECS): Add SUBTARGET_EXTRA_SPECS. + +2002-06-08 Marek Michalkiewicz + + * config/avr/avr.c (avr_regs_to_save): No need to save any registers + in a noreturn function. + (avr_output_function_prologue, avr_output_function_epilogue): + Correct function size calculation. Do not crash on empty function. + (avr_output_function_epilogue): No need for epilogue after a BARRIER. + +2002-06-08 Jason Thorpe + + * config/mips/netbsd.h (SUBTARGET_EXTRA_SPECS): Add + netbsd_link_spec and netbsd_entry_point. + (LINK_SPEC): Use %(netbsd_link_spec). + (NETBSD_ENTRY_POINT): Define. + +2002-06-08 Jason Thorpe + + * config/sparc/netbsd-elf.h (LINK_ARCH32_SPEC): Only specify + linker emulation. + (LINK_ARCH64_SPEC): Likewise. + (LINK_SPEC, NETBSD_ENTRY_POINT): Define. + (SUBTARGET_EXTRA_SPECS): Add netbsd_link_spec and netbsd_entry_point. + +2002-06-08 Marc Espie + + * lists.c (free_list): Fix typo in comment. + +2002-06-08 Andreas Jaeger + + * lcm.c (optimize_mode_switching): Add unused attribute for + variable. + + * sched-deps.c (sched_analyze): Remove unused variable. + +2002-06-08 Gabriel Dos Reis + + * diagnostic.def: Don't capitalize diagnostict descriptors. + +2002-06-08 Jason Thorpe + + * config/m68k/netbsd-elf.h (EXTRA_SPECS): Add netbsd_entry_point. + (LINK_SPEC): Define as NETBSD_LINK_SPEC_ELF. + (NETBSD_ENTRY_POINT): Define. + +2002-06-08 Jason Thorpe + + * config/i386/netbsd-elf.h (LINK_SPEC): Define as + NETBSD_LINK_SPEC_ELF. + (SUBTARGET_EXTRA_SPECS): Add netbsd_entry_point. + (NETBSD_ENTRY_POINT): Define. + * config/i386/netbsd64.h (LINK_SPEC): Use %(netbsd_link_spec). + (SUBTARGET_EXTRA_SPECS): Add netbsd_link_spec and + netbsd_entry_point. + (NETBSD_ENTRY_POINT): Define. + +2002-06-08 Jason Thorpe + + * config/alpha/netbsd.h (SUBTARGET_EXTRA_SPECS): Add + netbsd_link_spec and netbsd_entry_point. + (LINK_SPEC): Use %(netbsd_link_spec). + (NETBSD_ENTRY_POINT): Define. + +2002-06-08 Jason Thorpe + + * config/netbsd-elf.h (LINK_SPEC): Rename to... + (NETBSD_LINK_SPEC_ELF): ...this. Use %(netbsd_entry_point) + to specify program entry point. + +2002-06-07 Jeff Law + + * simplify-rtx.c (simplify_gen_relational): Simplify RTL of the form + (ne (comp x y) 0) into (comp x y) where comp is a comparison code. + Simplify (eq (comp x y) 0) into (revcomp x y) if the sense of the + comparison code comp can be reversed. + +2002-06-07 Roger Sayle + + * fold-const.c (fold) [EQ_EXPR]: Place both integer and real + constants last in comparisons. Optimize (x+1.0)>0.0 into the + equivalent x > -1.0 when -ffast-math. + +2002-06-07 Jason Thorpe + + * config.gcc (mips*-*-netbsd*): Add mips/t-netbsd to ${tmake_file}. + * config/mips/t-netbsd: New file. + +2002-06-07 Zack Weinberg + + * cppinit.c (COMMAND_LINE_OPTIONS): Give all relevant -W + options their own entries. + (parse_option): Clarify comment. + (cpp_handle_option): Remove 'ignore' parameter and OPT_W + special case. Replace if/strcmp chain for -W options with + use of new OPT_* entries for them. + (cpp_handle_options): Update to match. + * cpplib.h: Remove last parameter to cpp_handle_option from prototype. + * c-decl.c: Update call to cpp_handle_option. + +2002-06-07 Akim Demaille + + * gengtype-yacc.y (optionseqopt): Add the ending `;' to the action. + Whitespace changes. + +2002-06-07 Jeffrey Law + + * sched-deps.c (free_deps): Avoid calling free_INSN_LIST_list + on empty lists. + +2002-06-07 H.J. Lu (hjl@gnu.org) + + * configure.in: Add --enable-__cxa_atexit. + * configure: Regenerated. + * config.in: Likewise. + + * defaults.h (DEFAULT_USE_CXA_ATEXIT): New. Defined to be 0 if + not defined. + +2002-06-07 Gabriel Dos Reis + + * diagnostic.c (diagnostic_build_prefix): Fix initialization. + +2002-06-07 Jason Thorpe + + * config/mips/netbsd.h (CACHE_FLUSH_FUNC): Define. + +2002-06-07 Jason Merrill + + * cppexp.c (num_equality_op): Use a temporary variable to work + around gcc 3.0.4 bug. + +2002-06-07 Gabriel Dos Reis + + * diagnostic.c (diagnostic_build_prefix): Tidy. + +2002-06-07 Neil Booth + + * cpptrad.c (struct block, BLOCK_HEADER_LEN, BLOCK_LEN, + scan_parameters, save_replacement_text, replacement_length): New. + (scan_out_logical_line): Take a macro and save parameters if + non-NULL. + (_cpp_logical_line_trad): Update. + (_cpp_create_trad_definition): Update to handle function-like + macros. + * cpplex.c (new_buff): Update. + (struct dummy, DEFAULT_ALIGNMENT, CPP_ALIGN): Move... + * cpphash.h: ...here. + (CPP_ALIGN2, _cpp_save_parameter): New. + * cppmacro.c (save_parameter): Rename, export. + (parse_params): Update. + +2002-06-07 Andreas Jaeger + + * config/mmix/mmix.c: Remove extra broken prototype for + mmix_init_machine_status. + +2002-06-06 Geoffrey Keating + + * gengtype.c: Add comments before all the routines. + +2002-06-07 Jason Thorpe + + * config.gcc (sh5*-*-netbsd*): Remove sh/t-netbsd-sh5-32 + from and add t-sh64 to ${tmake_file}. + (sh64*-*-netbsd*): Add t-sh64 to ${tmake_file}. + * config/sh/t-netbsd-sh5 (LIB1ASMFUNCS): Remove. + * config/sh/t-netbsd-sh5-32: Remove. + * config/sh/t-netbsd-sh5-64 (MULTILIB_OPTIONS): Use + MULTILIB_ENDIAN. + (MULTILIB_DIRNAMES): Define. + +Thu Jun 6 23:14:46 CEST 2002 Jan Hubicka + + * i386.md (and promoting splitters): Disable QI to SImode promoting + when doing so changes immediate to be 32bit. + + * rtl.h (emit_*_scope): Declare. + * emit-rtl.c (emit_*_scope): New global functions. + (try_split): Copy scope. + * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants, + noce_try_flag_inc, noce_try_store_flag_mask, noce_try_cmove, + noce_try_cmove_arith, noce_try_minmax, noce_try_abs, + noce_process_if_block, find_cond_trap): Copy scopes. + * recog.c (peephole2_optimize): likewise. + +2002-06-06 Jeffrey Law + + * h8300.h (OK_FOR_U): Fix thinko exposed by flag checking. + +Thu Jun 6 21:06:25 2002 J"orn Rennecke + + * gengtype-lex.l (INITIAL): New rule for "'"("\\".|[^\\])"'". + +2002-06-06 Rainer Orth + + * Makefile.in (TEXI_GCCINSTALL_FILES): Define. + ($(docdir)/gccinstall.info): New target. + (info): Depend on it. + (gccinstall.dvi): New target. + (dvi): Depend on it. + * doc/.cvsignore: Ignore new info files. + * doc/install.texi (@setfilename): Reflect new info filename. + +Thu Jun 6 15:57:23 2002 J"orn Rennecke + + * sh.c (machine_dependent_reorg): Don't set RTX_UNCHANGING_P + on an UNSPEC. + +Thu Jun 6 07:17:43 2002 Nicola Pero + + PR objc/6834 + * objc/objc-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define to be + c_common_get_alias_set. + (LANG_HOOKS_SAFE_FROM_P): Define to be c_safe_from_p. + +2002-06-06 John David Anglin + + * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): New + functions. + * rtl.h (get_first_nonnote_insn, get_last_nonnote_insn): Declare. + * avr/avr.c (avr_output_function_epilogue): Use above to determine + function size. + * pa/pa.c (pa_output_function_prologue): Likewise. + +2002-06-05 David S. Miller + + * integrate.c (subst_constants): Handle 'B' RTL format. + +2002-06-05 Eric Christopher + + * varasm.c (make_decl_rtl): Fix comment for removed + halfpic.c. + +2002-06-05 Eric Christopher + + * Makefile.in: Remove missed halfpic bits. + +2002-06-05 Eric Christopher + + * toplev.c: Remove half-pic. + * config/mips/mips.c: Ditto. + * config/mips/mips.h: Ditto. Remove unused defines. + * config/mips/openbsd.h: Update comment to reflect above. + * config/mips/mips.md: Remove half-pic constraints. + * halfpic.h: Delete. + * halfpic.c: Ditto. + +2002-06-05 Jeffrey Law + + * pa.h (EXTRA_CONSTRAINT, T case): Further refine so that it + rejects (mem (lo_sum (reg) (unspec))), but will allow + (mem (lo_sum (reg) (symbol_ref)) for PA2.0. + +2002-06-05 Neil Booth + + * cpphash.h (_cpp_create_definition): Update prototype. + (_cpp_push_text_context, _cpp_create_trad_definition): New. + ( cpp_lex_identifier_trad): New. + (_cpp_set_trad_context): New. + * cppinit.c (cpp_finish_options): Don't conditionalize builtins. + * cpplib.c (SEEN_EOL): Update. + (lex_macro_node): Update for -traditional. + (cpp_push_buffer, _cpp_pop_buffer): Similarly. + * cppmacro.c (_cpp_create_definition): Split into + create_iso_definition() and _cpp_create_trad_definition(). + (warn_of_redefinition): Update prototype; handle traditional + macros. + (_cpp_push_text_context): New. + * cpptrad.c (skip_whitespace, push_replacement_text): New. + (lex_identifier): Call ht_lookup with correct start. + (_cpp_lex_identifier_tradm _cpp_create_trad_definition, + _cpp_set_trad_context): New. + (scan_out_logical_line): Update to handle changing contexts. + +Wed Jun 5 20:42:31 2002 J"orn Rennecke + + * config.gcc (sh-*-elf*, sh64*-*-elf*): Unify. + (shl*-*-elf*): Add. + * config/sh/t-be (MULTILIB_ENDIAN): Set. + * config/sh/t-le (MULTILIB_ENDIAN): Likewise. + * t-sh (MULTILIB_ENDIAN): Set. + (MULTILIB_OPTIONS): Use it. + * t-sh64 (MULTILIB_OPTIONS): Likewise. + (MULTILIB_DIRNAMES): Likewise. + +2002-06-05 Gabriel Dos Reis + + * toplev.h (report_error_function): Remove. + + * diagnostic.h (location_t): New datatype. + (text_info): Likewise. + (diagnostic_info): Likewise. + (output_prefix): New macro. + (diagnostic_last_function_changed): Likewise. + (diagnostic_set_last_function): Likewise. + (diagnostic_last_module_changed): Likewise. + (diagnostic_set_last_module): Likewise. + (report_diagnostic): Now macro. + (diagnostic_set_info): Declare. + + * diagnostic.c (report_problematic_module): Rename to + diagnostic_repor_current_module. + (set_diagnostic_context): Remove. + (count_error): Rename to diagnostic_error_count. + (error_function_changed): Remove. + (record_last_error_function): Likewise. + (error_module_changed): Likewise. + (record_last_error_module): Likewise. + (context_as_prefix): Rename to diagnostic_build_prefix. + (flush_diagnostic_buffer): Rename to diagnostic_flush_buffer. + (diagnostic_set_info): New function. + + * objc/objc-act.c: #include diagnostic.h + (error_with_ivar): Adjust call to count_error. + (warn_with_method): Likewise. + * objc/Make-lang.in (objc-act.o): Depend on diagnostic.h + +2002-06-05 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_build_va_list): Use + lang_hooks.types.make_type instead of make_node; set up + __va_list_tag type decl. + (xtensa_builtin_saveregs): Remove broken use of + RTX_UNCHANGING_P and unnecessary use of MEM_IN_STRUCT_P + for saved registers; add varargs alias set. + +2002-06-05 Neil Booth + +config: + * alpha/gnu.h: Undef TARGET_OS_CPP_BUILTINS. + * i386/beos-elf.h: Use TARGET_OS_CPP_BUILTINS rather than + CPP_PREDEFINES and part of CPP_SPEC. + i386/freebsd-aout.h, i386/gas.h, i386/gnu.h, i386/linux-aout.h, + i386/linux.h, i386/moss.h, i386/xm-vsta.h: Similarly. + +Wed Jun 5 15:20:58 CEST 2002 Jan Hubicka + + * reg-stack.c (reg_to_stack): Do not call find_basic_blocks. + +2002-06-05 Alan Modra + + * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Define. + +2002-06-04 Zack Weinberg + + * gengtype-yacc.y: Make sure all rules end with a semicolon. + +2002-06-04 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_init_machine_status): Fix + typo in function prototype and include "ggc.h" header. + +2002-06-04 Richard Henderson + + * config/alpha/alpha.c (mode_mask_operand): Simplify without ifdefs. + (print_operand) ['U']: Likewise. + (alpha_expand_unaligned_store): Correct constants for 32-bit cross. + (alpha_expand_unaligned_store_words): Likewise. + (alpha_expand_builtin_vector_binop): Fix typo. + (enum alpha_builtin, code_for_builtin): Add remaining ext, ins, msk, + umulh, and cix insns. + (one_arg_builtins): Add cix builtins. + (two_arg_builtins): Add ext, ins, msk, umulh builtins. + (alpha_expand_builtin): Fix typo in arity. + * config/alpha/alpha.md (UNSPEC_CTLZ, UNSPEC_CTPOP): New. + (builtin_extbl, builtin_extwl, builtin_extll, builtin_extwh, + builtin_extlh, builtin_insbl, builtin_inswl, builtin_insll, + builtin_insql, builtin_inswh, builtin_inslh, builtin_insqh, + builtin_mskbl, builtin_mskwl, builtin_mskll, builtin_mskql, + builtin_mskwh, builtin_msklh, builtin_mskqh, builtin_cttz, + builtin_ctlz, builtin_ctpop): New. + * doc/extend.texi (Alpha Built-in Functions): Update. + +2002-06-04 Geoffrey Keating + + * gengtype.c (write_gc_root): Don't unnecessarily prevent + global variable-length arrays being roots. + + * config.gcc (powerpc-*-darwin*): Set config_gtfiles. + * configure.in (config_gtfiles): New variable. + (all_gtfiles): Initialize from config_gtfiles. + * configure: Regenerate. + +2002-06-04 Neil Booth + +config/i386: + * beos-elf.h, cygwin.h, djgpp.h, gas.h, gnu.h, i386-interix.h, + i386-interix3.h, i386elf.h, linux-aout.h, linux.h, linux64.h, + mingw32.h, netbsd-elf.h, netbsd.h, netbsd64.h, rtemself.h, + sco5.h, sol2.h, sysv3.h, sysv4.h, sysv5.h, uwin.h, vxi386.h, + win32.h (CPP_SPEC): Remove cpp_cpu. + * i386.h (TARGET_CPU_CPP_BUILTINS): Use. + (CPP_CPU_DEFAULT_SPEC, CPP_CPU_SPEC): Die! + +2002-06-04 Janis Johnson + + * config/ia64/ia64.c (gen_thread_pointer): Fix variable name. + +2002-06-04 Jeff Law + Michael Matz + + * sched-int.h (struct deps): New field libcall_block_tail_insn. + * sched_deps.c (init_deps): Initialize libcall_block_tail_insn. + * sched_deps.c (sched_analyze_insn): If libcall_block_tail_insn + is set, then mark the current insn as being part of a libcall + scheduling group. + (sched_analyze): Set and clear libcall_block_tail_insn appropriately. + + * haifa-sched.c (schedule_block): Do not count USE or CLOBBER + insns against the issue rate. + +Tue Jun 4 19:29:42 CEST 2002 Jan Hubicka + + * cfglayout.c (duplicate_insn_chain): Kill NOTE_INSN_RANGE notes. + * final.c (final_scan_insn): Likewise. + * ggc-common.c (ggc_mark_rtx_children_1): Likewise; use + NOTE_EXPECTED_VALUE instead of NOTE_RANGE. + * haifa-sched.c (unlink_other_notes): Likeewise. + (reemit_notes): Likewise. + * print-rtl.c (print_rtx): Likewise. + * sched-deps (sched-analyze): Likewise. + * rtl.c (note_insn_name): Likewise. + * rtl.h (NOTE_RANGE_INFO, NOTE_LIVE_INFO): Kill. + (enum insn_note): Kill NOTE_INSN_RANGE_*, NOTE_INSN_LIVE. + (RANGE_*): Kill. + +2002-06-04 Jason Thorpe + + * varasm.c (mark_constants): Handle RTX format 'B'. + +2002-06-04 Neil Booth + + * cpphash.h (FIRST, LAST, CUR, RLIMIT): New. + (struct cpp_context): Add traditional fields. + * cppmacro.c (paste_all_tokens, push_ptoken_context, + push_token_context, cpp_get_token, _cpp_backup_tokens): Update. + * cpptrad.c (skip_comment, lex_identifier, + _cpp_read_logical_line_trad, scan_out_logical_line): Update. + +2002-06-04 Kazu Hirata + + * gbl-ctors.h: Fix formatting. + * gcc.c: Likewise. + * gccspec.c: Likewise. + * gcov.c: Likewise. + * gcov-io.h: Likewise. + * gcse.c: Likewise. + * ggc-common.c: Likewise. + * ggc.h: Likewise. + * ggc-page.c: Likewise. + * ggc-simple.c: Likewise. + * global.c: Likewise. + * graph.h: Likewise. + * gthr-dce.h: Likewise. + * gthr.h: Likewise. + * gthr-posix.h: Likewise. + * gthr-rtems.h: Likewise. + * gthr-solaris.h: Likewise. + * gthr-win32.h: Likewise. + +2002-06-03 Geoffrey Keating + + Merge from pch-branch: + + * gengtype.h (UNION_OR_STRUCT_P): New macro. + * gengtype.c (write_gc_structure_fields): Use it. + (write_gc_root): Use it here too. + + * gengtype.c (write_gc_structure_fields): Assume that lengths + of typenames fit into an 'int'; don't pass a size_t to "%d" in + printf. + (write_gc_marker_routine_for_structure): Likewise. + (write_gc_types): Likewise. + (write_gc_root): Likewise. + + * varray.h (VARRAY_CLEAR): New. + (varray_clear): Prototype. + * varray.c (varray_clear): New. + * cselib.c (reg_values_old): New. + (used_regs_old): New. + (cselib_init): Use cached varrays if available to avoid + generating large amounts of garbage. + (cselib_finish): Don't throw away old varrays. + + * final.c (insn_addresses_): Move out of ifdef. + + * varray.c (uses_ggc): Make more varray kinds GCable. + * varray.h (union varray_data_tag): Let gengtype see + fields 'generic' and 'te'. + * reg-stack.c: Include gt-reg-stack.h, ggc.h. + (stack_regs_mentioned_data): Move out of ifdef; mark with gengtype. + (reg_to_stack): Don't call VARRAY_FREE. + * insn-addr.h (INSN_ADDRESSES_FREE): Don't use VARRAY_FREE. + (insn_addresses_): Use gengtype to mark. + * gengtype.c (write_gc_structure_fields): Handle arrays of generic + pointers; handle generic pointers in unused union fields. + (get_output_file_with_visibility): Include cselib.h, + insn-addr.h in gtype-desc.c. + * function.c (prologue): Use gengtype to mark. + (epilogue): Likewise. + (sibcall_epilogue): Likewise. + * dependence.c: Include gt-dependence.h, ggc.h. + (struct def_use): Use gengtype to mark. + (struct loop): Likewise. + (struct induction): Likewise. + (struct dependence): Likewise. + (def_use_chain): Likewise. + (dep_chain): Likewise. + (loop_chain): Likewise. + (induction_chain): Likewise. + (init_dependence_analysis): Don't free anything, just clear pointers. + (build_def_use): Use GGC to allocate def_use. + (add_loop): Use GGC to allocate loop. + (find_induction_variable): Use GGC to allocate induction. + (check_node_dependence): Use GGC to allocate induction, dependence. + (dump_node_dependence): Don't free varrays. + (end_dependence_analysis): Likewise. + * cselib.h (struct cselib_val_struct): Use gengtype to mark. + (struct elt_loc_list): Likewise. + (struct elt_list): Likewise. + * cselib.c: Don't include obstack.h. + (hash_table): Use gengtype to mark. + (reg_values): Use gengtype to mark. + (used_regs): Use gengtype to mark. + (cselib_obstack): Delete. + (cselib_startobj): Delete. + (empty_vals): Mark as deletable. + (empty_elt_lists): Mark as deletable. + (empty_elt_loc_lists): Mark as deletable. + (new_elt_list): Use GGC to allocate struct elt_list. + (new_elt_loc_list): Use GGC to allocate struct elt_loc_list. + (clear_table): Don't delete obstack; don't unnecessarily clear + deletable variables. + (new_cselib_val): Use GGC to allocate struct cselib_val. + (cselib_init): Don't set up obstacks. Use GGC to allocate + hash table. + (cselib_finish): Just clear variables, don't free anything. + * Makefile.in (cselib.o): Remove dependency on $(OBSTACK_H). + (reg-stack.o): Add dependency on gt-reg-stack.h, $(GGC_H). + (dependence.o): Add dependency on gt-dependence.h, $(GGC_H). + (GTFILES): Add insn-addr.h, cselib.h, dependence.c, reg-stack.c. + (gt-reg-stack.h): New rule. + (gt-dependence.h): New rule. + (gtype-desc.o): Add cselib.h, insn-addr.h. + + * varray.c: Use only necessary headers. + (element_size): New. + (uses_ggc): New. + (varray_init): Take type, not size. Use GGC if appropriate. + (varray_grow): Update for change to struct varray_head_tag. + Use GGC if appropriate. + * varray.h (struct const_equiv_data): Use gengtype. + (enum varray_data_enum): New. + (union varray_data_tag): Use gengtype. + (struct varray_head_tag): Use gengtype. Replace size field with + enum varray_data_enum. + (varray_init): Update prototype. + (VARRAY_SCHED_INIT): Delete. + (VARRAY_*_INIT): Update for change to varray_init. + (VARRAY_SCHED): Delete. + (VARRAY_PUSH_SCHED): Delete. + (VARRAY_TOP_SCHED): Delete. + * tree.h: Update for change to length specifier. + * tree-inline.c (optimize_inline_calls): Don't use VARRAY_FREE. + (clone_body): Likewise. + * ssa.h (ssa_definition): Use gengtype to mark. + * ssa.c (convert_from_ssa): Don't use VARRAY_FREE. + * ssa-dce.c (ssa_eliminate_dead_code): Don't use VARRAY_FREE. + * rtl.h (struct rtvec_def): Update for change to length specifier. + * integrate.c (expand_inline_function): Don't use VARRAY_FREE. + (struct initial_value_struct): Update for change to length specifier. + * ggc.h (ggc_add_rtx_varray_root): Delete prototype. + (ggc_add_tree_varray_root): Delete prototype. + (ggc_mark_rtx_varray): Delete prototype. + (ggc_mark_tree_varray): Delete prototype. + * ggc-common.c (ggc_add_rtx_varray_root): Delete. + (ggc_add_tree_varray_root): Delete. + (ggc_mark_rtx_varray): Delete. + (ggc_mark_tree_varray): Delete. + (ggc_mark_rtx_varray_ptr): Delete. + (ggc_mark_tree_varray_ptr): Delete. + * gengtype.h (enum typekind): Remove TYPE_VARRAY. + (create_varray): Delete prototype. + * gengtype.c (varrays): Delete. + (create_varray): Delete. + (adjust_field_type): Detect array of string pointers. + (process_gc_options): Remove code to handle varray_type option. + (set_gc_used_type): Remove TYPE_VARRAY case. + (output_escaped_param): New. + (write_gc_structure_fields): Use output_escaped_param on all + parameters. Handle 'skip' with 'use_param' option. Handle + arrays of strings. Remove TYPE_VARRAY handling. + (write_gc_roots): Use boolean to detect 'length' option. + * gengtype-yacc.y (VARRAY_TYPE): Delete token. + (struct_fields): Call adjust_field_type on array fields. + (type): Remove VARRAY_TYPE case. + (type_option): Likewise. + * gengtype-lex.l: Don't consider varray_type a keyword. + * function.h: Update for change to length specifier. + (free_eh_status): Delete prototype. + * function.c (free_after_compilation): Don't call free_eh_status. + (reorder_blocks): Don't use VARRAY_FREE. + * except.c (struct eh_status): Update for change to length specifier. + remove varray_type specifier. + (free_eh_status): Delete. + * dwarf2out.c: Include gt-dwarf2out.h. + (used_rtx_varray): Use gengtype to mark, move + outside ifdefs. + (incomplete_types): Likewise. + (decl_scope_table): Likewise. + (dwarf2out_init): Don't call ggc_add_tree_varray_root. + * cfglayout.c (scope_to_insns_finalize): Don't use VARRAY_FREE. + * c-tree.h (struct lang_type): Update for change to length specifier. + * c-parse.in (yylexstring): Don't use VARRAY_FREE. + * c-objc-common.c: Include gt-c-objc-common.h. + (deferred_fns): Mark for gengtype. + (c_objc_common_init): Don't call ggc_add_tree_varray_root. + (expand_deferred_fns): Just set deferred_fns to 0 to free it. + * Makefile.in (c-objc-common.o): Add gt-c-objc-common.h. + (gtype-desc.o): Update dependencies. + (dwarf2out.o): Add gt-dwarf2out.h. + (varray.o): Update dependencies. + (GTFILES): Add varray.h, ssa.h, dwarf2out.c, c-objc-common.c. + (gt-c-objc-common.h): New rule. + (gt-dwarf2out.h): New rule. + * objc/objc-act.c (build_objc_string_object): Don't use VARRAY_FREE. + + * doc/gty.texi (GTY Options): Correct spelling. + (GGC Roots): Likewise. + * Makefile.in (TEXI_CPP_FILES): New. + (TEXI_GCC_FILES): New. + (TEXI_GCCINT_FILES): New. + (TEXI_CPPINT_FILES): New. + ($(docdir)/cpp.info): Use new macros. + ($(docdir)/gcc.info): Likewise. + ($(docdir)/gccint.info): Likewise. + ($(docdir)/cppinternals.info): Likewise. + (cpp.dvi): Likewise. + (gcc.dvi): Likewise. + (gccint.dvi): Likewise. + (cppinternals.dvi): Likewise. + + * Makefile.in ($(docdir)/gccint.info): Depend on gty.texi. + * doc/gccint.texi (Top): Include gty.texi. + * doc/gty.texi: New file. + + * bitmap.c: Include ggc.h, gt-bitmap.h. + (bitmap_ggc_free): New. + (bitmap_elem_to_freelist): New. + (bitmap_element_free): Use bitmap_elem_to_freelist. + (bitmap_element_allocate): Allow use of GGC. + (bitmap_clear): Use bitmap_elem_to_freelist. + (bitmap_copy): Update for change to bitmap_element_allocate. + (bitmap_set_bit): Likewise. + (bitmap_operation): Update for changes elsewhere. + (bitmap_initialize): Allow to create bitmaps that will use GGC. + * bitmap.h (struct bitmap_element_def): Use gengtype. + (struct bitmap_head_def): Likewise. Also add 'using_obstack' field. + (bitmap_initialize): Add extra parameter. + (BITMAP_OBSTACK_ALLOC): Update for change to bitmap_initialize. + (BITMAP_ALLOCA): Delete. + (BITMAP_XMALLOC): Update for change to bitmap_initialize. + (BITMAP_GGC_ALLOC): New. + * Makefile.in (gtype-desc.o): Add bitmap.h. + (bitmap.o): Add gt-bitmap.h, $(GGC_H). + (GTFILES): Add bitmap.c. + (gt-bitmap.h): New rule. + ($(HOST_PREFIX_1)bitmap.o): Add gt-bitmap.h. + * basic-block.h: Update for changes to bitmap_initialize. + * except.c (exception_handler_label_map): Move into... + (struct eh_status): Here. + (struct eh_region): Make 'aka' GCable. + (free_eh_status): Don't need to specially handle + exception_handler_label_map. + (add_ehl_entry): Update for changes to exception_handler_label_map. + (find_exception_handler_labels): Likewise. + (remove_exception_handler_label): Likewise. + (maybe_remove_eh_handler): Likewise. + (for_each_eh_label): Likewise. + (remove_eh_handler): Allocate 'aka' using GGC. + * gengtype.c (get_output_file_with_visibility): Add bitmap.h + to list of includes. + + * gengtype.c (write_gc_marker_routine_for_structure): Name + the routines 'gt_ggc_mx_*' instead of 'gt_ggc_m_*'. + (write_gc_types): Arrange for the tests with NULL to be inlined. + (write_gc_roots): Update uses of procedure pointers. + * ggc-common.c (gt_ggc_mx_rtx_def): Rename from gt_ggc_m_rtx_def. + + * Makefile.in (explow.o): Add dependency on gt-explow.h. + (sdbout.o): Add dependency on gt-sdbout.h. + + * emit-rtl.c (const_int_htab): Use gengtype to clear unused entries. + (mem_attrs_htab): Likewise. + (init_emit_once): Don't call ggc_add_deletable_htab. + * fold-const.c (size_htab): Use gengtype to clear unused entries. + (size_int_type_wide): Don't call ggc_add_deletable_htab. + * gengtype.c (finish_root_table): Add LASTNAME and TNAME + parameters, use them, change callers. + (write_gc_root): Add IF_MARKED parameter, use it, change callers. + (write_gc_roots): Handle 'if_marked' option. + (main): Don't need to call set_gc_used_type any more. + * ggc.h (ggc_htab_marked_p): Delete. + (ggc_htab_mark): Delete. + (struct ggc_cache_tab): New. + (gt_ggc_cache_rtab): New declaration. + * ggc-common.c (struct d_htab_root): Delete. + (d_htab_roots): Delete. + (ggc_add_deletable_htab): Delete. + (ggc_htab_delete): Handle new htab-deleting mechanism. + (ggc_mark_roots): Use new htab-deleting mechanism. + * tree.c (type_hash_table): Use gengtype to clear unused entries. + Make static. + (init_obstacks): Don't call ggc_add_deletable_htab. + + * objc/objc-act.h (struct hashed_attribute): Use gengtype. + (struct hashed_entry): Likewise. + (nst_method_hash_list): Likewise. + (cls_method_hash_list): Likewise. + (HASH_ALLOC_LIST_SIZE): Delete. + (ATTR_ALLOC_LIST_SIZE): Delete. + * objc/objc-act.c (hash_init): Use ggc to allocate + nst_method_hash_list, cls_method_hash_list. + (hash_enter): Use ggc to allocate; allocate one entry at a time. + (hash_add_attr): Likewise. + (ggc_mark_hash_table): Delete. + (objc_act_parse_init): Delete. + (objc_init): Delete reference to objc_act_parse_init. + * tlink.c: Replace hash.h with hashtab.h. Explicitly include + obstack.h. Replace references to 'struct hash_table' with htab_t. + (struct symbol_hash_entry): Replace hash header with key field. + (struct file_hash_entry): Replace hash header with key field. + (struct demangled_hash_entry): Replace hash header with key field. + (hash_string_eq): New. + (hash_string_hash): New. + (symbol_hash_newfunc): Delete. + (symbol_hash_lookup): Modify to use htab_t. + (file_hash_newfunc): Delete. + (file_hash_lookup): Modify to use htab_t. + (demangled_hash_newfunc): Delete. + (demangled_hash_lookup): Modify to use htab_t. + (tlink_init): Modify to use htab_t. + * hash.h: Delete. + * hash.c: Delete. + * ggc.h: Delete forward structure declarations. + Delete prototypes for deleted functions. + * ggc-common.c: Don't include hash.h. + (ggc_add_tree_hash_table_root): Delete. + (ggc_mark_tree_hash_table_entry): Delete. + (ggc_mark_tree_hash_table): Delete. + (ggc_mark_tree_hash_table_ptr): Delete. + * gengtype.c (write_gc_structure_fields): Allow param_is option. + (write_gc_marker_routine_for_structure): Use visibility of + the parameter if there is one. + * function.c: Replace hash.h with hashtab.h. Replace references + to 'struct hash_table *' with htab_t. + (struct insns_for_mem_entry): Include a plain key. + (fixup_var_refs_insns_with_hash): Update to use htab_t. + (insns_for_mem_newfunc): Delete. + (insns_for_mem_hash): Update to use htab_t. + (insns_for_mem_comp): Likewise. + (insns_for_mem_walk): Likewise. + * c-lang.c: Include ggc.h. + * Makefile.in (OBJS): Remove hash.o. + (c-lang.o): Add GGC_H. + (COLLECT2_OBJS): Remove hash.o. + (tlink.o): Remove hash.h, add HASHTAB_H and OBSTACK_H. + (ggc-common.o): Remove hash.h. + (function.o): Remove hash.h, add HASHTAB_H. + (genautomata.o): Remove hash.h, add HASHTAB_H. + + * varasm.c (mark_const_str_htab_1): Delete. + (mark_const_str_htab): Delete. + (const_str_htab_del): Delete. + (const_str_htab): Use gengtype to mark. + (init_varasm_once): Use gengtype to mark hashtables. Use GC to + allocate them. + * tree.c (mark_tree_hashtable_entry): Delete. + (mark_tree_hashtable): Delete. + * tree.h (mark_tree_hashtable): Delete prototype. + * ggc.h (ggc_test_and_set_mark): Treat (void *)1 like NULL. + (ggc_mark): Likewise. + (ggc_calloc): New. + (htab_create_ggc): New. + * ggc-common.c (ggc_calloc): New. + * gengtype.h (enum typekind): Add TYPE_PARAM_STRUCT. + (struct type): Add param_struct structure. + * gengtype.c (param_structs): New. + (adjust_field_type): Handle param_is option. + (set_gc_used_type): Handle TYPE_PARAM_STRUCT. + (get_output_file_with_visibility): Include hashtab.h in gtype-desc.c. + (write_gc_structure_fields): Add new PARAM parameter. Update + callers. Handle use_param option. Handle TYPE_PARAM_STRUCT. + (write_gc_marker_routine_for_structure): Add new PARAM parameter. + Use it to generate function name. Update callers. + (write_gc_types): Add new PARAM_STRUCTS parameter. Update callers. + Process them. + (write_gc_roots): Handle TYPE_PARAM_STRUCT. Allow param_is + option. + (main): Define PTR as pointer-to-scalar. Don't specially + mark deferred_string or ehl_map_entry. + * gengtype-yacc.y (PARAM_IS): Add new token. + (externstatic): Use adjust_field_type. + (type_option): Add PARAM_IS. + * gengtype-lex.l: Add rule for typedef of function pointers. + Add rule for PARAM_IS. + (IWORD): Add size_t. + * except.c (exception_handler_label_map): Use gengtype to mark. + (type_to_runtime_map): Likewise. + (mark_ehl_map_entry): Delete. + (mark_ehl_map): Delete. + (init_eh): Use gengtype for roots; use GC to allocate hash tables. + (t2r_mark_1): Delete. + (t2r_mark): Delete. + * Makefile.in (gtype-desc.o): Correct dependencies. + (GTFILES): Add hashtab.h. + (genautomata.o): Actually uses hashtab.h. + + * Makefile.in (stringpool.o): Add $(GGC_H). + (dwarf2asm.o): Likewise. + (GTFILES): Add hashtable.h. + * c-common.h (struct c_common_identifier): Use gengtype. + * c-decl.h (c_mark_tree): Delete. + * c-lang.c (LANG_HOOKS_MARK_TREE): Delete. + * c-tree.h (struct lang_identifier): Use gengtype. + (union lang_tree_node): New. + (c_mark_tree): Delete prototype. + * dwarf2out.c [!DWARF2_DEBUGGING_INFO]: Define dummy + dwarf2_debug_hooks. + * gengtype-lex.l (IWORD): Allow 'bool'. + (ptr_alias): Match. + * gengtype-yacc.y (ALIAS): New token. + (type_option): New rule. + (option): Use type_option. + * gengtype.c (process_gc_options): New. + (set_gc_used_type): Use it. + (write_gc_structure_fields): Add 'bitmap' parameter, change callers. + Add new variable 't' to hold the type of the field being processed. + Add more error checking. Use UNION_P when looking at 'desc' option. + Handle language-specific structures containing other + language-specific structures. + (write_gc_types): Handle 'ptr_alias' option. + (main): Don't need to specially output lang_type, lang_decl, lang_id2. + * ggc-common.c (ggc_pending_trees): Delete. + (ggc_mark_roots): Don't manipulate ggc_pending_trees. + (ggc_mark_trees): Delete. + (gt_ggc_m_tree_node): Delete. + * ggc.h (ggc_pending_trees): Delete. + (ggc_mark_tree): Make alias of gt_ggc_m_tree_node. + * hashtable.h (ht_identifier): Use gengtype. + * langhooks-def.h (LANG_HOOKS_MARK_TREE): Delete. + * langhooks.h (struct lang_hooks): Delete mark_tree. + * sdbout.c [! SDB_DEBUGGING_INFO]: Define dummy sdb_debug_hooks + anyway. + * system.h: Poison LANG_HOOKS_MARK_TREE. + * tree.c (tree_node_structure): New. + * tree.h (struct tree_common): Use gengtype. + (struct tree_int_cst): Likewise. + (struct tree_real_cst): Likewise. + (struct tree_string): Likewise. + (struct tree_complex): Likewise. + (struct tree_vector): Likewise. + (struct tree_identifier): Likewise. + (struct tree_list): Likewise. + (struct tree_vec): Likewise. + (struct tree_exp): Likewise. + (struct tree_block): Likewise. + (struct tree_type): Likewise. + (struct tree_decl): Likewise. + (enum tree_structure_enum): New. + (union tree_node): Use gengtype, with an alias. + (tree_node_structure): Prototype. + * objc/objc-lang.c (LANG_HOOKS_MARK_TREE): Delete. + + Merge to tag pch-merge-20020430. The LANG_HOOKS_FUNCTION_MARK + macro was deleted. The LANG_HOOKS_FUNCTION_FREE macro was renamed + to LANG_HOOKS_FUNCTION_FINAL. + * Makefile.in (GTFILES): Add bitmap.h. + * except.c (struct eh_region): Mark field 'aka' to be skipped. + + * config/alpha/alpha.c [TARGET_ABI_UNICOSMK] + (alpha_init_machine_status): Give proper type. + * Makefile.in (c-lang.o): Depend on gtype-c.h. + (optabs.o): Depend on gt-optabs.h. + (GTFILES): Add optabs.o. + (gt-optabs.h): Add rule. + * optabs.c: Include gt-optabs.h. + + * gengtype.c (set_gc_used_type): Correct some errors in last change. + (write_gc_structure_fields): If a field which should be NULL is + not, abort. + * c-pragma.c: Move struct align_stack and variable alignment_stack + out from the ifdef. + + * config/xtensa/t-xtensa: Add dependencies for gt-xtensa.h. + * config/xtensa/xtensa.c: Include gt-cris.h. + (struct machine_function): Use gengtype to mark. + * config/mmix/mmix.h (struct machine_function): Use gengtype + to mark. + * config/cris/t-cris: Add dependencies for gt-cris.h. + * config/cris/cris.c: Include gt-cris.h. + (struct machine_function): Use gengtype to mark. + * config/rs6000/rs6000.h (struct machine_function): Use gengtype + to mark. + * doc/tm.texi (Per-Function Data): Delete references to + mark_machine_status. + * config/ia64/ia64.c (ia64_override_options): Don't set + mark_machine_status. + * config/i386/i386.c (override_options): Likewise. + * config/d30v/d30v.c (d30v_init_expanders): Likewise. + * config/arm/arm.c (arm_init_expanders): Likewise. + * config/alpha/alpha.c (override_options): Likewise. + * gengtype.h (enum gc_used_enum): Add GC_MAYBE_POINTED_TO. + * gengtype.c (set_gc_used_type): Handle 'maybe_null' option. + (write_gc_structure_fields): Don't handle 'really' option. + Handle 'maybe_null' option. + (write_gc_types): Handle 'maybe_null' option. + * function.h (struct function): Don't use "really". + (mark_machine_status): Delete declaration. + (mark_lang_status): Delete declaration. + (gt_ggc_mr_machine_function): Delete prototype. + (gt_ggc_mr_language_function): Delete prototype. + * function.c (mark_machine_status): Delete. + (mark_lang_status): Delete. + (gt_ggc_mr_machine_function): Delete. + (gt_ggc_mr_language_function): Delete. + * c-tree.h (mark_c_function_context): Delete prototype. + * c-objc-common.c (c_objc_common_init): Don't set mark_lang_status. + * c-decl.c (struct language_function): Rename from struct + c_language_function. Update uses. Use gengtype to mark. + (mark_c_function_context): Delete. + * c-common.h (struct c_language_function): Rename from struct + language_function. + (mark_stmt_tree): Delete prototype. + (c_mark_lang_decl): Delete prototype. + (mark_c_language_function): Delete prototype. + * c-common.c (mark_stmt_tree): Delete. + (c_mark_lang_decl): Delete. + (mark_c_language_function): Delete. + + * gengtype.h (enum typekind): Add TYPE_LANG_STRUCT. + (lang_bitmap): New typedef. Use where appropriate. + (struct type): Add gc_used field, lang_struct field. + (UNION_P): New macro. + (new_structure): New prototype. + (find_structure): Remove 'pos' parameter. Change all callers. + * gengtype-lex.l: Update for changes to find_structure. + * gengtype-yacc.y (typedef_struct): Use new_structure. + (yacc_ids): Suppress warning. + (type): Use new_structure. + * gengtype.c (string_type): Update for changes to struct type. + (find_structure): Just find a structure, don't worry about + creating one. + (new_structure): New. + (note_yacc_type): Use new_structure. + (set_gc_used_type): New. + (set_gc_used): New. + (write_gc_structure_fields): Allow for pointers to TYPE_LANG_STRUCT. + (write_gc_types): Handle TYPE_LANG_STRUCT. + (write_gc_marker_routine_for_structure): New. + (main): Call set_gc_used. Add some calls to set_gc_used_type + for places where GCC doesn't use gengtype properly yet. + * ggc.h (gt_ggc_m_rtx_def): Don't prototype. + (gt_ggc_m_tree_node): Likewise. + + * varasm.c (copy_constant): Call expand_constant if we hit + something we can't recognize. + + * ggc-common.c (ggc_mark_rtvec_children): Delete. + (ggc_mark_rtx_children): Use generic name for ggc_mark_rtvec. + (lang_mark_false_label_stack): Delete. + * rtl.h (struct rtvec_def): Use gengtype to mark. + * ggc.h (ggc_mark_rtvec): Delete. + (gt_ggc_m_rtvec_def): Delete. + (ggc_mark_nonnull_tree): Delete. + (ggc_mark_rtvec_children): Delete prototype. + (lang_mark_false_label_stack): Delete declaration. + + * gengtype.h (note_yacc_type): Add prototype. + * gengtype.c (note_yacc_type): New function. + * gengtype-lex.l: Add lexer support for yacc files. + * gengtype-yacc.y (start): Extract union from yacc files. + (yacc_union): New rule. + (yacc_typematch): New rule. + (yacc_ids): New rule. + (enum_items): Tweak for efficiency. + (optionseq): Likewise. + + * c-common.h (struct language_function): Use gengtype. + (struct c_lang_decl): Likewise. + * c-tree.h (struct lang_decl): Likewise. + (struct lang_type): Likewise. + * c-decl.c (lang_mark_tree): Use generated marker routines to mark + tree language substructures. + + * stringpool.c (mark_ident): Replace ggc_mark_nonnull_tree with + ggc_mark_tree. + * dwarf2asm.c (mark_indirect_pool_entry): Likewise. + + * varasm.c (struct rtx_const): Remove 'skip' tags for scalar arrays. + + * stmt.c (struct nesting): Add discriminator. Use gengtype to + mark. Remove 'data.block.cleanup_ptr' field. + (struct stmt_status): Use usual technique to mark struct nesting. + (gt_ggc_mr_nesting_cond): Delete. + (gt_ggc_mr_nesting_loop): Delete. + (gt_ggc_mr_nesting_block): Delete. + (gt_ggc_mr_nesting_case_stmt): Delete. + (expand_start_cond): Set discriminator. + (expand_start_loop): Likewise. + (expand_start_null_loop): Likewise. + (expand_start_bindings_and_block): Set discriminator. Don't set + deleted fields. + (expand_decl_cleanup): Replace 'cleanup_ptr' with + &thisblock->data.block.cleanups. + (expand_start_case): Set discriminator. + (expand_start_case_dummy): Set discriminator. + + * ggc-callbacks.c: Remove. + + * gengtype.h (struct type): Add 'u.s.bitmap' field. + (find_structure): Add 'pos' parameter. + * gengtype-lex.l: Update callers to find_structure. + * gengtype-yacc.y: Likewise. + * gengtype.c (find_structure): Allow for structures to be defined + in multiple language backends. + (get_output_file_with_visibility): Include debug.h in gtype-desc.c. + (counter): Rename to gc_counter. + (write_gc_structure_fields): Fail when writing out fields for + an incomplete structure. Ignore arrays of scalars. Handle + 'tree_vec' special. + (write_gc_types): Reset counter for each procedure written. + + * stmt.c (add_case_node): Use GGC to allocate struct case_node. + (free_case_nodes): Delete. + (expand_end_case_type): Delete call to free_case_nodes. + + * Makefile.in (cselib.o): Include gt-.h. + (gcse.o): Likewise. + (profile.o): Likewise. + (alias.o): Likewise. + (GTFILES): Add alias.c, cselib.c, gcse.c, profile.c, and + alphabetize backend files. + (gt-alias.h, gt-cselib.h, gt-gcse.h, gt-profile.h): New rules. + * alias.c: Use gengtype for roots. + * c-common.h (struct stmt_tree_s): Use gengtype. + * c-decl.c: Use gengtype for roots. + * cselib.c: Use gengtype for roots. + * expr.c: Use gengtype for roots. + * fold-const.c: Use gengtype for roots. + * gcse.c: Use gengtype for roots. + * gengtype-lex.l: Handle typedefs of function types. + Allow for empty array bounds. + Allow processing to stop on initializers. + * gengtype-yacc.y (externstatic): Stop processing on initializers. + (semiequal): New rule. + * gengtype.c (create_file): Tidy output files. + (get_output_file_with_visibility): Fix paren warning. Fix bug + involving multiple input files mapping to one output file. + (write_gc_structure_fields): Skip arrays of scalars. + (write_gc_types): Tidy output files. + (write_gc_root): New function. + (write_gc_roots): Fix bugs, add support for roots that are + structures. + * ggc-common.c (ggc_mark_rtx_ptr): Delete. + (ggc_mark_tree_ptr): Delete. + (ggc_add_rtx_root): Delete. + (ggc_add_tree_root): Delete. + (ggc_del_root): Delete. + * integrate.c (get_func_hard_reg_initial_val): Use ggc_alloc to + allocate struct initial_value_struct. + * profile.c: Use gengtype for roots. + * sdbout.c: Use gengtype for roots. + * varasm.c (mark_weak_decls): Delete unused prototype. + (mark_const_hash_entry): Delete unused function. + * config/darwin-protos.h: Use gengtype for roots. + (machopic_add_gc_roots): Delete. + * config/arm/arm.c: Use gengtype for roots. + * config/arm/arm.h: Use gengtype for roots. + * config/c4x/c4x-protos.h: Use gengtype for roots. + * config/c4x/c4x.c (c4x_add_gc_roots): Delete. + * config/d30v/d30v-protos.h: Use gengtype for roots. + * config/d30v/d30v.c (d30v_add_gc_roots): Delete. + * config/dsp16xx/dsp16xx.c (override_options): Use gengtype for roots. + * config/dsp16xx/dsp16xx.h: Use gengtype for roots. + * config/ia64/ia64-protos.h: Use gengtype for roots. + * config/ia64/ia64.c (ia64_add_gc_roots): Delete. + * config/m68hc11/m68hc11-protos.h: Use gengtype for roots. + * config/m68hc11/m68hc11.c (z_reg): Make global. + (z_reg_qi): Make global. + (m68hc11_add_gc_roots): Delete. + * config/mcore/mcore-protos.h: Use gengtype for roots. + * config/mcore/mcore.c (mcore_add_gc_roots): Delete. + * config/mips/mips.c (mips_add_gc_roots): Delete. + * config/mips/mips.h: Use gengtype for roots. + * config/mmix/mmix.c (override_options): Use gengtype for roots. + * config/mmix/mmix.h: Use gengtype for roots. + * config/mn10200/mn10200.c (asm_file_start): Use gengtype for roots. + * config/mn10200/mn10200.h: Use gengtype for roots. + * config/pa/pa.c: Use gengtype for roots, marking. + (struct deferred_plabel): Use GGC, gengtype. + (pa_add_gc_roots): Delete. + (mark_deferred_plabels): Delete. + * config/pj/pj-protos.h: Use gengtype for roots. + * config/pj/pj.h (OVERRIDE_OPTIONS): Don't define. + * config/rs6000/rs6000.c: Use gengtype for roots. Don't call + machopic_add_gc_roots. + * config/rs6000/rs6000.h: Use gengtype for roots. + * config/rs6000/t-darwin (darwin.o): Add dependency on gt-darwin.h. + (gt-darwin.h): Add rule. + * config/sh/sh.c: Use gengtype for roots. + * config/sh/t-sh ($(out_object_file)): Add dependency on gt-sh.h. + (gt-sh.h): Add rule. + * config/sparc/sparc.c: Use gengtype for roots. + (sparc_add_gc_roots): Delete. + (struct ultrasparc_pipeline_state): Use GGC, gengtype. + (mark_ultrasparc_pipeline_state): Delete. + * config/sparc/sparc.h: Use gengtype for roots. + + * Makefile.in (c-parse.o): Update dependencies. + (c-common.o): Likewise. + (GTFILES): Add c-common.h, c-tree.h, c-common.c, c-parse.in. + Add dependencies for the files they generate. + * c-common.c: Replace ggc_add_* uses with GTY annotations. + * c-common.h: Likewise. + * c-decl.c: Likewise. + (gt_ggc_mp_binding_level): Delete. + * c-lang.c: Include gtype-c.h. + * c-parse.in: Replace ggc_add_* uses with GTY annotations. Include + gt-c-parse.h. + * c-pragma.h: Replace ggc_add_* uses with GTY annotations. + (gt_ggc_mp_align_stack): Delete. + * c-tree.h: Replace ggc_add_* uses with GTY annotations. + * function.c: Replace ggc_add_* uses with GTY annotations. + (gt_ggc_mp_function): Delete. + * function.h: Replace ggc_add_* uses with GTY annotations. + * gengtype.c (lang_names): New. + (NUM_BASE_FILES): New. + (open_base_files): Create language base files. + (startswith): New. + (get_file_basename): New. + (get_base_file_bitmap): New. + (get_output_file_with_visibility): Rename from get_output_file. + Add more mappings for various C/Objc filenames. + (finish_root_table): New. + (write_gc_roots): Handle dependencies and scoping properly. + * gengtype.h: Add prototypes for new functions. + * ggc-common.c (struct deletable_root): Delete. + (deletables): Delete. + (ggc_add_deletable_root): Delete. + (ggc_mark_roots): No need to deal with deleted functionality. + * ggc.h (ggc_add_deletable_root): Delete prototype. + * objc/Make-lang.in (objc-act.o): Add gtype-objc.h dependency. + (gtype-objc.h): Add rule to create. + * objc/config-lang.in (gtfiles): New. + * objc/objc-act.c: Allocate imp_list using GGC. Replace uses of + ggc_add_* with GTY markers. Include gtype-objc.h. + (ggc_mark_imp_list): Delete. + * objc/objc-act.h: Replace uses of ggc_add_* with GTY markers. + * objc/objc-lang.c: Random Whitespace Change. + + * except.h (exception_handler_labels): Delete. + (get_exception_handler_labels): New. + * except.c (exception_handler_labels): Delete. + (struct eh_status): Add exception_handler_labels field. + (doing_eh): Don't add exception_handler_labels as root. + (free_eh_status): Don't need to free exception_handler_labels. + (get_exception_handler_labels): New. + (find_exception_handler_labels): Update for move of + exception_handler_labels. + (remove_exception_handler_label): Likewise. + * cfgrtl.c (can_delete_label_p): Use get_exception_handler_labels. + * jump.c (rebuild_jump_labels): Likewise. + * loop.c (find_and_verify_loops): Likewise. + * sched-rgn.c (is_cfg_nonregular): Likewise. + + * gengtype.c (write_gc_structure_fields): Handle variable-length + TYPE_ARRAYs. + + * varasm.c (struct weak_syms): Use GGC, gengtype. + (mark_weak_decls): Delete. + (weak_decls): Likewise. + (add_weak): Likewise. + (remove_from_pending_weak_list): Likewise. + (init_varasm_once): Likewise. + + * Makefile.in (gtype-desc.o): Add libfuncs.h dependency. + (GTFILES): Add tree.h, libfuncs.h, emit-rtl.c, explow.c, + stor-layout.c, regclass.c, and lists.c. + Add dependencies of gt-emit-rtl.h gt-explow.h gt-stor-layout.h + gt-regclass.h and gt-lists.h on s-gtype. + * emit-rtl.c: Use gengtype for roots. Include gt-emit-rtl.h. + * except.c: Use gengtype for roots. + * explow.c: Use gengtype for roots. Include gt-explow.h. + * expr.h (init_stor_layout_once): Delete prototype. + * function.c: Use gengtype for roots. + * gengtype-lex.l: Add ENT_EXTERNSTATIC lexing. + * gengtype-yacc.y (start): Can also be an externstatic. + (externstatic): New production. + (struct_fields): Correct array bounds inversion for 2-d arrays. + * gengtype.c (variables): New variable. + (note_variable): New function. + (get_output_file): Include libfuncs.h into gtype-desc.c. + (get_output_file_name): New function. + (write_gc_structure_fields): Suppress warnings. + (write_gc_types): Make static. + (put_mangled_filename): New function. + (write_gc_roots): New function. + (main): Call write_gc_roots. + * gengtype.h (note_variable): Prototype. + (get_output_file_name): Prototype. + (write_gc_types): Delete prototype. + * ggc.h: Clean up unnecessary structure predefinitions. + (struct ggc_root_tab): Define. + (gt_ggc_m_rtx_def): Make function, not macro. + (gt_ggc_m_tree_node): Likewise. + * libfuncs.h: Use gengtype for roots. + * lists.c: Use gengtype for roots. Include gt-lists.h. + (init_EXPR_INSN_LIST_cache): Delete. + * optabs.c: Use gengtype for roots. + (gt_ggc_mp_optab): Delete. + * optabs.h: Use gengtype for roots. + * regclass.c: Use gengtype for roots. Include gt-regclass.h. + * rtl.h: Use gengtype for roots. + (init_EXPR_INSN_LIST_cache): Delete prototype. + * stor-layout.c: Use gengtype for roots. + Include gt-stor-layout.h. + (init_stor_layout_once): Delete. + * toplev.c: Use gengtype for roots. Delete calls to deleted + routines. + * tree.c: Use gengtype for roots. + * tree.h: Use gengtype for roots. + * varasm.c: Use gengtype for roots. + + * Makefile.in (GTFILES): Add @all_gtfiles@. + * configure: Regenerate. + * configure.in: Construct all_gtfiles from the gtfiles definitions + in config-lang.in. + * gengtype-yacc.y (type): Warn about duplicate structure names. + * gengtype.c (get_output_file): Handle .c files in language + subdirectories. + + * Makefile.in (GTFILES): Run gengtype on all the config files + and on the target .c file. + * except.c (mark_eh_region): Delete. + (init_eh_for_function): Use GGC on struct eh_status. + (mark_eh_status): Delete. + (free_eh_status): Use GGC. + (expand_eh_region_start): Use GGC to + (collect_eh_region_array): Allocate last_region_number using GGC. + (duplicate_eh_region_1): Use GGC to allocate struct eh_region. + (remove_eh_handler): Let GGC free struct eh_region. + (add_call_site): Use GGC to reallocate call_site_record array. + * function.c (init_machine_status): Update calling sequence. + (mark_machine_status): Likewise. + (mark_lang_status): Likewise. + (prepare_function_start): Update init_machine_status call. + (mark_function_status): Delete. + (maybe_mark_struct_function): Delete. + (ggc_mark_struct_function): Delete. + (gt_ggc_mp_function): New. + (gt_ggc_mr_machine_function): New. + (gt_ggc_mr_language_function): New. + (init_function_once): Use canonical names. + * function.h (struct function): Use gengtype. + (init_machine_status): Return the structure. + (mark_machine_status): Take a 'void *'. + (mark_lang_status): Likewise. + * ggc-common.c (ggc_mark_trees): Use canonical name for + ggc_mark_struct_function. + * tree.h (ggc_mark_struct_function): Delete prototype. + * config/alpha/alpha.c (alpha_mark_machine_status): Delete. + (alpha_init_machine_status): Likewise. + (override_options): Use canonical name for alpha_mark_machine_status. + * config/alpha/unicosmk.h (struct machine_function): Use gengtype. + * config/arm/arm.h (struct machine_function): Use gengtype. + * config/arm/arm.c (arm_mark_machine_status): Delete. + (arm_init_machine_status): Update calling sequence. + (arm_init_expanders): Use canonical name for arm_mark_machine_status. + * config/cris/cris.c (cris_init_machine_status): Update + calling sequence. + * config/d30v/d30v.h (struct machine_function): Use gengtype. + * config/d30v/d30v.c (d30v_init_machine_status): Update + calling sequence. + (d30v_mark_machine_status): Delete. + * config/i386/i386.c: Include gt-i386.h. + (struct machine_function): Use gengtype. + (ix86_init_machine_status): Update calling sequence. + (ix86_mark_machine_status): Delete. + (override_options): Use canonical namke for ix86_mark_machine_status. + * config/ia64/ia64.h (struct machine_function): Use gengtype. + * config/ia64/ia64.c (ia64_init_machine_status): Update calling + sequence. + (ia64_mark_machine_status): Delete. + (ia64_override_options): Use canonical name for + ia64_mark_machine_status. + * config/mmix/mmix.c (mmix_init_machine_status): Update calling + sequence. + * config/rs6000/rs6000.c (rs6000_init_machine_status): Likewise. + * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. + * gengtype.c (get_output_file): Fix warning. + (main): Add prototype to suppress warning. + * tree.c: Remove tree_hash_mark prototype. + + * tree.h (init_stmt): Delete prototype. + * toplev.c (lang_independent_init): Don't call init_stmt. + * stmt.c (ALLOC_NESTING): Use GGC for 'struct nesting'. + (stmt_obstack): Delete. + (POPSTACK): No need to free 'struct nesting'. + (gt_ggc_mr_nesting_cond): Use canonical names. + (gt_ggc_mr_nesting_loop): Use canonical names. + (gt_ggc_mr_nesting_block): Use canonical names. + (gt_ggc_mr_nesting_case_stmt): Use canonical names. + (mark_stmt_status): Delete. + (init_stmt): Delete. + (clear_last_expr): Clear both last_expr_type and last_expr_value. + Use it everywhere that last_expr_type was cleared. + * lists.c (init_EXPR_INSN_LIST_cache): Use ggc_add_deletable_root. + (zap_lists): Delete. + * ggc.h (ggc_add_deletable_root): Prototype. + (mark_stmt_status): Remove prototype. + * ggc-common.c (ggc_add_deletable_root): New. + (ggc_mark_roots): Handle deletable roots. + * function.c (ggc_mark_struct_function): Use canonical name + for mark_stmt_status. + * emit-rtl.c (free_sequence_stack): New. + (start_sequence): Use a freelist for sequences. + (end_sequence): Likewise. + (init_emit_once): Add free_sequence_stack as a deleteable root. + * c-pragma.c Include gt-c-pragma.h. + (struct align_stack): Use gengtype. + (push_alignment): Use GGC for struct align_stack. + (mark_align_stack): Delete. + (gt_ggc_mp_align_stack): New. + (init_pragma): Use canonical name for mark_align_stack. + * c-decl.c: Include gt-c-decl.h. + (struct binding_level): Use gengtype. + (make_binding_level): Use GGC; handle the freelist here. + (pop_binding_level): New. + (pushlevel): Move code into make_binding_level. + (push_label_level): Likewise. + (poplevel): Move code into pop_binding_level. + (pop_label_level): Likewise. + (mark_binding_level): Delete. + (gt_ggc_mp_binding_level): New. + (c_init_decl_processing): Use canonical name for mark_binding_level. + Add free_binding_level as deletable root. + (mark_c_function_context): Use canonical name for mark_binding_level. + * Makefile.in (c-decl.o): Add gt-c-decl.h. + (c-pragma.o): Add gt-c-pragma.h. + (GTFILES): Add c-decl.c and c-pragma.c. + (gt-c-decl.h, gt-c-pragma.h): Create using gengtype. + + * tree.c (struct type_hash): Use gengtype. + (init_obstacks): Use canonical name for type_hash_mark. + (type_hash_mark): Delete. + Include gt-tree.h. + * rtl.h (struct mem_attrs): Use gengtype. + * optabs.h (struct optab): Use gengtype. + * optabs.c (expand_binop): Squish signed/unsigned warning. + (mark_optab): Make local, use canonical name, use autogenerated + marker procedure. + (init_optabs): Use canonical name for mark_optab. + (new_optab): Use GGC to allocate optabs. + * ggc.h: Delete mark_optab prototype. + * ggc-common.c (ggc_mark_rtx_children): Use canonical name for + mem_attrs marker procedure. + * gengtype.c (get_output_file): Include headers in gtype-desc.c + explicitly rather than deducing them from file names. + (write_gc_structure_fields): Handle arrays of structures. + (main): Return nonzero exit code if errors occur during output. + * emit-rtl.c (mem_attrs_mark): Delete. + (init_emit_once): Use canonical name for mem_attrs marker procedure. + * Makefile.in (gtype-desc.o): Explicitly name dependencies. + (tree.o): Depend on gt-tree.h. + (GTFILES): Add rtl.h, optabs.h, tree.c. + (gt-tree.h): Add it to s-gtype rule. + + * .cvsignore: Ignore gengtype flex/bison generated files. + * Makefile.in (GGC_H): Add gtype-desc.h. + (OBJS): Add gtype-desc.o. + (GEN): Add gengtype. + (STAGESTUFF): Add gengtype. + (varasm.o): Add gt-varasm.h. + (stmt.o): Add gt-stmt.h. + (except.o): Add gt-except.h. + (integrate.o): Add gt-integrate.h. + (GTFILES): New. + Add new rules for new files. + * configure: Regenerate. + * configure.in: Correct defaults.h paths. + * emit-rtl.c (mark_sequence_stack): Delete. + (mark_emit_status): Delete. + (start_sequence): Allocate sequence structures using GGC. + (end_sequence): Allocate sequence structures using GGC. + * except.c: Use gengtype for various structures. Include + gt-except.h. + * expr.c (mark_expr_status): Delete. + * function.c: Use gengtype for various structures. Include + gt-function.h. + (mark_function_status): Use standard gt_ggc names for marker functions. + (ggc_mark_struct_function): Likewise. + * function.h: Use gengtype for various structures. + * gengtype-lex.l: New file. + * gengtype-yacc.y: New file. + * gengtype.c: New file. + * gengtype.h: New file. + * ggc.h: Include gtype-desc.h. Alias some marker procedures to + the standard names. Remove some now-unnecessary prototypes. + * integrate.c: Use gengtype for various structures. Include + gt-integrate.h. + (mark_hard_reg_initial_vals): Delete. + * integrate.h (mark_hard_reg_initial_vals): Delete. + * stmt.c: Use gengtype for various structures. Include + gt-stmt.h. + (mark_case_node): Delete. + (mark_goto_fixup): Delete. + (mark_stmt_status): Use standard gt_ggc names for marker functions. + * system.h: Define GTY to empty. In flex/bison files, + don't poison malloc or realloc, instead just define them to + xmalloc and xrealloc. + * varasm.c: Use gengtype for various structures. Include + gt-varasm.h. Use standard gt_ggc names for marker functions. + (mark_pool_constant): Delete. + (mark_varasm_status): Delete. + (decode_rtx_const): #if 0 out non-typesafe hack. + + * function.h (free_lang_status): Mark as obsolete. + * function.c (free_lang_status): Mark as obsolete. + * c-decl.c (push_c_function_context): Use GC to allocate and free + struct language_function. + (pop_c_function_context): Likewise. + * c-common.c (mark_c_language_function): Mark struct + language_function. + + * doc/tm.texi (Per-Function Data): Don't document free_machine_status. + Document that the machine_function structures must be allocated + using GC. Update mark_machine_status documentation. + * function.h: Don't declare free_machine_status. + * function.c (free_machine_status): Don't define. + (free_after_compilation): Don't call free_machine_status. + (ggc_mark_struct_function): Mark f->machine. Call + mark_machine_status only on non-NULL pointers. + * system.h: Poison free_machine_status. + * config/xtensa/xtensa.c (xtensa_init_machine_status): Use GC on + struct machine_function. + (xtensa_free_machine_status): Delete. + (override_options): Don't set free_machine_status. + * config/rs6000/rs6000.c (rs6000_override_options): Don't set + free_machine_status. + (rs6000_init_machine_status): Use GC on struct machine_function. + (rs6000_free_machine_status): Delete. + * config/ia64/ia64.c (ia64_init_machine_status): Use GC on struct + machine_function. + (ia64_mark_machine_status): Likewise. + (ia64_free_machine_status): Delete. + (ia64_override_options): Don't set free_machine_status. + * config/i386/i386.c (override_options): Don't set + free_machine_status. + (ix86_init_machine_status): Use GC on struct machine_function. + (ix86_mark_machine_status): Likewise. + (ix86_free_machine_status): Delete. + * config/d30v/d30v.c: (d30v_init_machine_status): Use GC on struct + machine_function. + (d30v_mark_machine_status): Likewise. + (d30v_free_machine_status): Delete. + (d30v_init_expanders): Don't set free_machine_status. + * config/arm/arm.c (arm_mark_machine_status): Use GC on struct + machine_function. + (arm_init_machine_status): Likewise. + (arm_free_machine_status): Delete. + (arm_init_expanders): Don't set free_machine_status. + * config/alpha/alpha.c (override_options): Don't set + free_machine_status. + (alpha_init_machine_status): Use GC on struct machine_function. + (alpha_mark_machine_status): Likewise. + (alpha_free_machine_status): Delete. + + * varasm.c (compare_constant): Fix typo. + + * varasm.c: Don't include obstack.h. + (struct varasm_status): x_const_rtx_hash_table is a hash of rtxes. + (struct rtx_const): Give substructures names, improve formatting. + (struct constant_descriptor): Delete. + (struct constant_descriptor_tree): New, based on constant_descriptor. + (const_hash_table): Is a hash table of trees. + (mark_const_hash_entry): Is used for hashes of trees. Mark + constant_descriptor_tree structure. + (mark_const_str_htab_1): Mark deferred_string structure. + (compare_constant): Rewrite to compare trees. + (compare_constant_1): Delete. + (record_constant): Delete. + (record_constant_1): Delete. + (output_constant_def): Use struct constant_descriptor_tree. + Don't duplicate trees twice. + (struct constant_descriptor_rtx): New. + (struct pool_constant): Used for rtx constants. + (init_varasm_status): Update for change to struct varasm_status. + (mark_varasm_status): Likewise. + (free_varasm_status): Delete. + (compare_constant_rtx): Rewrite to handle constant_descriptor_rtx. + (record_constant_rtx): Likewise. + (mem_for_const_double): Update to use struct constant_descriptor_rtx. + (force_const_mem): Likewise. + * Makefile.in (varasm.o): Doesn't depend on obstack.h. + * function.c (free_after_compilation): Don't use free_varasm_status. + * function.h: Don't prototype free_varasm_status. + + * ggc-common.c (ggc_realloc): Handle X being NULL. + + * ggc-common.c (ggc_realloc): New function. + * ggc.h: Prototype it. + * emit-rtl.c (free_emit_status): Delete. + (init_emit): Allocate emit subarrays using GC. + (gen_reg_rtx): Reallocate subarrays using GC. + (init_emit): Use GC to allocate 'struct emit_status' and its + subarrays. + (mark_emit_status): Mark structure and its subarrays. + * stmt.c (free_stmt_status): Delete. + * expr.c (free_expr_status): Delete. + * function.h: Remove prototypes for deleted functions. + * function.c (free_after_compilation): Don't use deleted functions. + Don't call free() on x_parm_reg_stack_loc. + (free_after_parsing): Don't use free_stmt_status. + (assign_parms): Use GC to allocate and resize x_parm_reg_stack_loc. + (mark_function_status): Mark x_parm_reg_stack_loc. + + * varasm.c (init_varasm_status): Use GC to allocate + 'struct varasm_status' and its fields x_const_rtx_hash_table + and x_const_rtx_sym_hash_table. + (mark_varasm_status): Mark them. + (free_varasm_status): Use GC to free them. + * expr.c (init_expr): Use GC to allocate 'struct expr_status'. + (mark_expr_status): Mark the structure itself. + (free_expr_status): Use GC to free the structure. + * stmt.c (free_stmt_status): Use GC to free 'struct stmt_status'. + (mark_stmt_status): Mark the 'struct stmt_status' itself. + (init_stmt_for_function): Allocate the structure for GC. + + * dwarf2out.c (lookup_type_die): Use TYPE_SYMTAB_DIE. + (equate_type_number_to_die): Likewise. + * tree.h (TYPE_SYMTAB_DIE): New macro. + (struct die_struct): Predeclare. + (struct tree_type): Add field symtab.die. Add a tag + to the union type of field symtab. + + * varray.h (VARRAY_RTVEC_INIT): A varray of rtvec contains + 'struct rtvec_def *', not 'struct rtvec_def'. + + * function.h (original_arg_vector): Make a real rtvec. + * function.c (ggc_mark_struct_function): Adjust. + * integrate.c (expand_inline_function): Adjust. + +2002-06-04 Jason Thorpe + + * config.gcc (sh5-*-netbsd*, sh5l*-*-netbsd*) + (sh64-*-netbsd*, sh64l*-*-netbsd*): New targets. + * config/sh/netbsd-elf.h (TARGET_VERSION_ENDIAN) + (TARGET_VERSION_CPU): Define according to the + default target. + (TARGET_VERSION): Use TARGET_VERSION_ENDIAN and + TARGET_VERSION_CPU. + (TARGET_OS_CPP_BUILTINS): Use NETBSD_OS_CPP_BUILTINS_LP64 + if TARGET_SHMEDIA64. + (LINK_DEFAULT_CPU_EMUL): Define according to the + default target. + (SUBTARGET_LINK_EMUL_SUFFIX): Define. + (SUBTARGET_LINK_SPEC): Define. + (LINK_SPEC): Use SH_LINK_SPEC. + (ASM_SPEC): Remove. + (TARGET_DEFAULT): Use TARGET_CPU_DEFAULT. + (FUNCTION_PROFILER): Add cases for TARGET_SHMEDIA32 + and TARGET_SHMEDIA64 which abort, for now. + * config/sh/t-netbsd-sh5: New file. + * config/sh/t-netbsd-sh5-32: New file. + * config/sh/t-netbsd-sh5-64: New file. + +2002-06-03 Falk Hueffner + Richard Henderson + + * config/alpha/alpha.c (reg_or_const_int_operand): New. + (some_operand, input_operand): Accept CONST_VECTOR. + (alpha_extra_constraint): Add 'W'. + (alpha_expand_zap_mask): New. + (alpha_expand_builtin_vector_binop): New. + (enum alpha_builtin): New. + (zero_arg_builtins, one_arg_builtins, two_arg_builtins): New. + (alpha_init_builtins, alpha_expand_builtin): New. + (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): New. + * config/alpha/alpha.h (VECTOR_MODE_SUPPORTED_P): New. + (PREDICATE_CODES): Update. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (UNSPEC_CMPBGE, UNSPEC_ZAP, + UNSPEC_AMASK, UNSPEC_IMPLVER, UNSPEC_PERR, UNSPECV_RPCC): New. + (movv8qi, movv8qi_fix, movv8qi_nofix): New. + (movv4hi, movv4hi_fix, movv4hi_nofix): New. + (movv2si, movv2si_fix, movv2si_nofix): New. + (uminv8qi3, sminv8qi3, uminv4hi3, sminv4hi3): New. + (umaxv8qi3, smaxv8qi3, umaxv4hi3, smaxv4hi3): New. + (builtin_cmpbge, builtin_extql, builtin_extqh, builtin_zap, + builtin_zap_1, builtin_zapnot, builtin_zapnot_1, builtin_amask, + builtin_implver, builtin_rpcc, builtin_minub8, builtin_minsb8, + builtin_minuw4, builtin_minsw4, builtin_maxub8, builtin_maxsb8, + builtin_maxuw4, builtin_maxsw4, builtin_perr, builtin_pklb, + pklb, builtin_pkwb, pkwb, builtin_unpkbl, unpkbl, + builtin_unpkbw, unpkbw): New. + * doc/extend.texi (Alpha Built-in Functions): New. + +2002-06-03 Richard Henderson + + * crtstuff.c (__EH_FRAME_BEGIN__): Conditionalize on + USE_EH_FRAME_REGISTRY, not EH_FRAME_SECTION_NAME. + +2002-06-03 Richard Henderson + + * config/alpha/alpha-protos.h: Eliminate unneeded ifdefs. + + * config/alpha/alpha.c (reg_or_0_operand): Use CONST0_RTX. + (const0_operand): New. + (reg_or_fp0_operand, fp0_operand): Remove. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md: Replace all uses of reg_or_fp0_operand + and fp0_operand with reg_or_0_operand and const0_operand. + +2002-06-03 Dan Nicolaescu + + * alias.c (nonoverlapping_memrefs_p): Fix off by one error. + +2002-06-03 Roger Sayle + + * gcse.c (cprop_jump): Use single_set to get the pattern + from the setcc argument. + +2002-06-03 Gabriel Dos Reis + + * diagnostic.h (diagnostic_count): Move from output_buffer to + diagnostic_context. + (diagnostic_kind_count): Adjust definition. + +Mon Jun 3 19:11:53 CEST 2002 Jan Hubicka + + * except.c (except.c): Do not rebuild CFG. + * toplev.c (rest_of_compilation): Recompute CFG after sibcall + optimization. + +Mon Jun 3 11:53:01 CEST 2002 Jan Hubicka + + * integrate.c (copy_insn_list): Properly pace the INSN_SCOPE copies. + * toplev.c: Include cfglahout.h + * Makefile.in (toplev.c): Add dependnecy. + +2002-06-03 Neil Booth + + * config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): New. + (CPP_CPU32_SPEC, CPP_CPU64_SPEC): Kill. + (CPP_CPUCOMMON_SPEC): Rename CPP_CPU_SPEC. + +2002-06-03 Jason Thorpe + + * config/ns32k/netbsd.h: Update copyright years. + (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Remove. + * config/ns32k/ns32k.h (CPP_PREDEFINES): Remove. + (TARGET_CPU_CPP_BUILTINS): Define. + +2002-06-02 Kazu Hirata + + * emit-rtl.c: Fix formatting. + * errors.h: Likewise. + * except.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + +2002-06-02 Kazu Hirata + + * config/h8300/elf.h: Fix formatting. + * config/h8300/rtems.h: Likewise. + +2002-06-03 Jason Thorpe + + * config/rs6000/netbsd.h (DRAFT_V4_STRUCT_RET): Remove. + +2002-06-02 Tom Tromey + + * fixinc/fixincl.x: Rebuilt. + * fixinc/inclhack.def (thread_keyword): Match `*__thread'. + +2002-06-02 Neil Booth + +config/i370: + * i370.h (TARGET_CPU_CPP_BUILTINS): Use. + * linux.h: Use TARGET_OS_CPP_BUILTINS rather than CPP_PREDEFINES. + * mvs.h: Similarly. + * oe.h: Similarly. + +Mon Jun 3 00:18:20 CEST 2002 Jan Hubicka + + * final.c (final): Allow notes to not have computed addresses; + kill no longer needed STACK_REGS ifdef. + +2002-06-02 Richard Henderson + + * gcse.c (bypass_conditional_jumps): Fix typo last change. + +Sun Jun 2 23:02:11 CEST 2002 Jan Hubicka + + * loop.c (emit_prefetch_instructions): Properly place the address + computation. + +Sun Jun 2 22:56:48 CEST 2002 Jan Hubicka + + * basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill. + (set_block_for_insn): Turn into macro. + * cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn. + * cfglayout.c (insn_scopes): Kill. + (scope_to_insns_initialize): Do not use insn_scopes. + (scope_to_insns_finalize): Likewise. + (duplicate_insn_chain): Likewise. + (cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes. + * cfgrtl.c (basic_block_for_insn): Kill. + (delete_insn_and_edges, delete_insn_chain_and_edges): Simplify. + (create_basic_block_structure): Use reorder_insns. + (compute_bb_for_insn): Do not use basic_block_for_insn. + (merge_blocks_nomove): Likewise. + (update_bb_for_insn): Likewise. + (verify_flow_info): Likewise. + (set_block_for_insn): Kill. + * combine.c (try_combine): Update gen_rtx_INSN call. + * emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call. + (mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear + scopes and BBs. + (add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify. + (emit_note_before, emit_note_after, emit_line_note_after, emit_note): + Clear BB. + (emit_insns_after): Simplify. + (emit_copy_of_insn_after): Copy scope. + * final.c (final_start_function): Lower scopes. + * flow.c (check_function_return_warnings): Do not rely on deleted insn. + * integrate.c (copy_insn_list): Cope scopes. + * jump.c (duplicate_loop_exit_test): LIkewise; simplify. + * loop.c (loop_optimize): Do not care block notes. + * print-rtl.c (print_rtx): Print BB. + * recog.c (apply_change_group): Simplify. + * rtl.c (copy_rtx): Handle 'B'. + * rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields. + * rtl.h (Field accessors): Update indexes. + * sched-ebb.c (schedule_ebbs): Do not lower notes. + * sched-rgn.c (schedule_insns): Likewise. + * toplev.c (rest_of_compilation): Lower notes. + * unroll.c (unroll_loop): Do not care scoping notes. + (copy_loop_body): Copy scopes. + +2002-06-02 Neil Booth + +config/h8300: + * elf.h: Use TARGET_OS_CPP_BUILTINS rather than + SUBTARGET_SPEC. + * rtems.h: Similarly. + * h8300.h (CPP_PREDEFINES, CPP_SPEC, SUBTARGET_CPP_SPEC, + EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): Remove. + (TARGET_CPU_CPP_BUILTINS): Use. + +2002-06-02 Richard Henderson + + * alias.c: Include target.h. + (mark_constant_function): Use targetm.binds_local_p instead + of checking TREE_PUBLIC ourselves. + * Makefile.in (alias.o): Add TARGET_H. + +2002-06-02 Neil Booth + + * c-lex.c: Update copyright and file description. + +2002-06-02 Neil Booth + + * config/fr30/fr30.h: Update to new CPP macros. + +2002-06-02 Neil Booth + + * config/dsp16xx/dsp16xx.h: Update to new CPP macros. + +2002-06-02 Neil Booth + Zack Weinberg + + * c-common.c (c_common_init): Override cpplib's default + warn_long_long setting. + * c-lex.c (lex_number): Replace with interpret_integer, + interpret_float, narrowest_unsigned_type and + narrowest_signed_type, taking advantage of the new + cpplib functionality. + * cpperror.c (_cpp_begin_message): If a warning is turned + into an error, avoid printing "warning:". + * cppexp.c (cpp_num_sign_extend): New. + * cppinit.c: Update comment. + * cpplib.h (cpp_num_sign_extend): New. + * tree.h: Update comment. + +2002-06-02 Gabriel Dos Reis + + * diagnostic.h (struct diagnostic_context): Add new member + internal_error. + (internal_error_function): Remove declaration. + * diagnostic.c (internal_error_function): Remove definition.. + (internal_error): Adjust use. + +2002-06-02 Richard Henderson + + * rtl.h (CC0_P): New. + * gcse.c (cprop_jump): Use it with single_set. Tweak dump text. + (cprop_insn): Allow any mode register; use CC0_P. CSE out single_set. + (bypass_block): Save old dest block for dump text. + (bypass_conditional_jumps): Allow any mode register; use CC0_P. + Allow only true SET insns, not single_set. + +2002-06-02 Gabriel Dos Reis + + * diagnostic.c (diagnostic_finish): Rename to output_flush. + (clear_disgnostic_info): Rename to output_clear_data. Use false + instead of 0 for boolean value. + Adjust function call throughout. + +Sun Jun 2 19:15:27 CEST 2002 Jan Hubicka + + * cfgrtl.c (commit_one_edge_insertion): Fix warning. + * gcse.c (bypass_conditional_jumps): CSE out single_set call. + +2002-06-02 Neil Booth + + * d30v.h (CPP_PREDEFINES): Replace with + (TARGET_CPU_CPP_BUILTINS): New. + +2002-06-02 Roger Sayle + + * config/alpha/alpha.h [ASM_OUTPUT_LABELREF]: Fix typo. + +Sun Jun 2 12:11:52 CEST 2002 Jan Hubicka + + * gcse.c (bypass_conditional_jumps): Use single set to obtain set. + +2002-06-02 Richard Henderson + + * rtlanal.c (volatile_refs_p): Not automatically true for CALL. + +2002-06-02 Marek Michalkiewicz + + Support for C++ constructors/destructors. + * config/avr/avr.c (avr_output_function_epilogue): Jump to exit() + instead of looping if main() returns. + (asm_file_start): Output global symbols that cause .data and .bss + initialization code to be linked in, unconditionally for now. + (avr_asm_out_ctor, avr_asm_out_dtor): New functions. + * config/avr/avr.h (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): New. + (TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): New. + (LIBSTDCXX): New. + * config/avr/libgcc.S (_exit): Split in .fini9 and .fini0 sections. + (__tablejump__): New. + (__do_copy_data, __do_clear_bss): New. + (__do_global_ctors, __do_global_dtors): New. + * config/avr/t-avr (LIB1ASMFUNCS): Add _copy_data, _clear_bss, + _ctors, _dtors. + +2002-06-02 Neil Booth + + * c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): New. + (CPP_SPEC, CPP_PREDEFINES): Kill. + * c4x/rtems.h (CPP_PREDEFINES): Kill. + (TARGET_OS_CPP_BUILTINS): New. + +Sat Jun 1 23:29:51 CEST 2002 Jan Hubicka + + * Makefile.in (tracer.o): New. + * params.def (TRACER_*): New options. + * rtl.h (tracer): Declare. + * timevar.def (TV_TRACER): New. + * toplev.c (dump_file_index): Add DFI_tracer. + (dump_file_info): Add tracer. + (flag_tracer): New. + (lang_indepdenent_options): Add tracer. + (rest_of_compilation): Call tracer. + * tracer.c: New file. + * invoke.texi (-ftracer): Document. + (--param tracer-*): Document. + +2002-06-01 Daniel Berlin + + * tree-inline.c (expand_call_inline): Make the statement + expression we generate have a COMPOUND_STMT. + +2002-06-01 Roger Sayle + + * gcse.c (cprop_cc0_jump): Function deleted. + (cprop_jump): Take an additional argument which is the possibly + NULL cc setting insn immediately before the conditional jump. + When a MODE_CC set is present, substitute it into the JUMP_INSN + before attempting the constant propagation. + (cprop_insn): Recognize cc setters followed by conditional jumps + as a special case. Use cprop_jump instead of cprop_cc0_jump. + (cprop_one_pass): Call bypass_conditional_jumps if altering jumps. + (find_bypass_set): New function based upon find_avail_set used by + cprop, but finds constant expressions available at the end of + basic blocks. + (bypass_block): New function. Given a basic block that begins + with a conditional jump and multiple incoming edges, perform + the jump bypass optimization. + (bypass_conditional_jumps): New function. Call bypass_block with + each suitable basic block in the CFG using a simple single pass. + +2002-06-01 Roger Sayle + + * tree.c (real_minus_onep): New function to test for -1.0. + * fold-const.c (fold) [MULT_EXPR]: Optimize -1.0*x into -x. + +2002-06-01 Roger Sayle + + * fold-const.c (fold_truthop): Transform "a || b" into "(a|b) != 0" + and "!p && !q" into "(p|q) == 0" under suitable conditions. + +2002-06-01 Andreas Jaeger + + * cppexp.c (cpp_classify_number): Cast precission to int for + correct printf format. + +2002-06-01 Marek Michalkiewicz + + * config/avr/avr.c (avr_mcu_types): Remove devices that were once + expected, but don't really exist: atmega83, atmega85, attiny10. + * config/avr/avr.h (LINK_SPEC): Update to use the new avr[1-5] ld + emulations for all devices. + (CRT_BINUTILS_SPECS): Remove atmega83, atmega85, attiny10. + * config/avr/t-avr (MULTILIB_MATCHES): Remove atmega83, atmega85. + +2002-06-01 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + h8300_shift_needs_scratch_p. + * config/h8300/h8300.c (h8300_shift_needs_scratch_p): New. + * config/h8300/h8300.h (OK_FOR_R): New. + (OK_FOR_S): Likewise. + (OK_FOR_T): Likewise. + (EXTRA_CONSTRAINT): Call OK_FOR_R, OK_FOR_S, and OK_FOR_T. + * config/h8300/h8300.md (anonymous shift patterns): Use + constraints R, S, and T. + +Sat Jun 1 11:23:22 CEST 2002 Zdenek Dvorak + + * basic-block.h (struct basic_block_def): New field loop_father. + (BB_VISITED): New flag. + (struct loop): New field pred, removed field shared. + (struct loops): New field parray. + (LOOP_EXITS_DOMS): Removed. + (flow_loop_tree_node_add, flow_loop_tree_node_remove, + flow_loop_nested_p, flow_bb_inside_loop_p, get_loop_body, + dfs_enumerate_from, loop_preheader_edge, loop_latch_edge, + add_bb_to_loop, remove_bb_from_loops, find_common_loop, + verify_loop_structure): Declare. + * cfg.c (entry_exit_blocks): Initialize loop_father field. + * cfganal.c (dfs_enumerate_from): New function. + * cfgloop.c (HEAVY_EDGE_RATIO): New constant. + (flow_loop_entry_edges_find, flow_loop_exit_edges_find, + flow_loop_nodes_find, flow_loop_level_compute, flow_loop_nested_p, + flow_loop_dump, flow_loops_dump, flow_loops_free, + flow_loop_tree_node_add, flow_loop_level_compute, + flow_loops_level_compute, flow_loop_scan, flow_loops_update, + flow_loop_outside_edge_p): Modified for new infrastructure. + (make_forwarder_block, canonicalize_loop_headers, glb_enum_p, + redirect_edge_with_latch_update, flow_loop_free): New static functions. + (flow_loop_tree_node_remove, flow_bb_inside_loop_p, + get_loop_body, add_bb_to_loop, remove_bb_from_loops, + find_common_loop, verify_loop_structure, loop_latch_edge, + loop_preheader_edge): New functions. + (flow_loops_cfg_dump): Do not show dominators, as this information + does not remain up to date long. + (flow_loops_find): Store results in new format. + * predict.c (propagate_freq, estimate_probability, + estimate_loops_at_level, estimate_bb_frequencies): Use new loop + infrastructure. + +2002-06-01 Alan Lehotsky + + * except.c (nothrow_function_p): Walk epilogue delay list + checking the insn, not the chain for potential throws. + +2002-05-31 Zack Weinberg + + * Makefile.in (INSTALL_CPP, UNINSTALL_CPP): Remove. + (install): Refer to install-cpp directly. + (uninstall-cpp): Folded into uninstall rule. + * configure.in: Delete all code relating to --disable-cpp. + * configure: Regenerate. + * config/t-install-cpp: Delete. + +2002-05-31 Richard Henderson + + * configure.in (HAVE_AS_TLS): Add alpha tests. + * configure: Rebuild. + * config/alpha/alpha.c (TARGET_AS_TLS): New. + (alpha_tls_size, alpha_tls_size_string): New. + (overide_options): Set it. Always install machine_status hooks. + (input_operand): Accept got tls predicates. + (local_symbol_p): Merge into ... + (local_symbolic_operand): ... here. Reject tls symbols. + (global_symbolic_operand): Likewise. + (tls_symbolic_operand_1, dtp16_symbolic_operand): New. + (dtp32_symbolic_operand, gotdtp_symbolic_operand): New. + (tp16_symbolic_operand, tp32_symbolic_operand): New. + (gottp_symbolic_operand, tls_symbolic_operand_type): New. + (alpha_encode_section_info): Handle TLS symbols. + (alpha_strip_name_encoding): Likewise. + (alpha_legitimate_address_p): Likewise. + (alpha_legitimize_address): Likewise. + (alpha_expand_mov): Early exit to avoid nop moves. + (struct machine_function): Move from unicosmk.h. Add some_ld_name. + (alpha_init_machine_status, alpha_mark_machine_status, + alpha_free_machine_status): Always define. + (get_some_local_dynamic_name, get_some_local_dynamic_name_1): New. + (print_operand, print_operand_address): Add TLS relocs. + * config/alpha/alpha.h (HAVE_AS_TLS): Default 0. + (MASK_TLS_KERNEL, TARGET_TLS_KERNEL): New. + (TARGET_SWITCHES): Add -mtls-kernel. + (alpha_tls_size, alpha_tls_size_string): New. + (TARGET_OPTIONS): Add -mtls-size=. + (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, + REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Add R0_REG. + (ASM_OUTPUT_LABELREF): Skip %. + (PRINT_OPERAND_PUNCT_VALID_P): Add &. + (PREDICATE_CODES): Update. + * config/alpha/alpha.md (UNSPEC_TLSGD_CALL, UNSPEC_TLSLDM_CALL, + UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_DTPREL, UNSPEC_TPREL, + UNSPEC_TP, UNSPECV_SET_TP): New. + (adddi_er_lo16_dtp, adddi_er_hi32_dtp, adddi_er_lo32_dtp, + adddi_er_lo16_tp, adddi_er_hi32_tp, adddi_er_lo32_tp, load_tp, + set_tp, movdi_er_tlsgd, movdi_er_tlsldm, movdi_er_gotdtp, + movdi_er_gottp, call_value_osf_tlsgd, call_value_osf_tlsldm): New. + (call_value_osf_2_er): Accept anything as op4. + * config/alpha/alpha-protos.h: Update. + * config/alpha/unicosmk.h (struct machine_function): Move to alpha.c. + +2002-05-31 Zack Weinberg + + * cppinit.c (append_include_chain): Always pay attention to + cxx_aware when setting new->sysp. Remove ATTRIBUTE_UNUSED + marker on argument. + +2002-05-31 Kazu Hirata + + * target.h: Fix formatting. + * timevar.h: Likewise. + * tlink.c: Likewise. + * toplev.c: Likewise. + * toplev.h: Likewise. + * tree.c: Likewise. + * tree-dump.h: Likewise. + * tree.h: Likewise. + * tree-inline.h: Likewise. + * unroll.c: Likewise. + * unwind-dw2.c: Likewise. + * unwind-dw2-fde.c: Likewise. + * unwind-dw2-fde-glibc.c: Likewise. + * unwind-dw2-fde.h: Likewise. + * unwind.h: Likewise. + * unwind-sjlj.c: Likewise. + * varasm.c: Likewise. + * varray.h: Likewise. + * vmsdbg.h: Likewise. + * vmsdbgout.c: Likewise. + * xcoffout.h: Likewise. + +2002-05-31 Igor Shevlyakov + + * expr.c (compare_from_rtx): Generate comparison between op0 and op1 + rather than cc0 and 0 in a case when HAVE_cc0 is not defined. + +2002-05-31 Matthew Woodcraft + + * gcc.c (cpp_unique_options): Remove "-d" options. + (cpp_debug_options): New spec string. + (default_compilers): Use it. + * objc/lang-specs.h: Likewise. + +2002-05-31 Nathanael Nerode + + * gcc/Makefile.in: Replace HOST_PREFIX, HOST_PREFIX_1 with + BUILD_PREFIX, BUILD_PREFIX_1, to correct nomenclature. + * gcc/mklibgcc.in: Likewise. + * gcc/config/arc/t-arc: Likewise. + * gcc/configure.in: Likewise. + * gcc/configure: Regenerate. + +2002-05-31 Stan Shebs + Turly O'Connor + + * c-decl.c (struct binding_level): Change int field n_incomplete + to tree list incomplete_list. + (clear_binding_level): Init field with NULL. + (pushdecl): Add incomplete type to list. + (mark_binding_level): Mark the incomplete list. + (finish_struct): Scan the incomplete list for types instead + of all decls in the current binding level. + +2002-05-31 John David Anglin + + * pa.c (output_millicode_call): Add missing '%' characters. + (output_call): Likewise. + +2002-05-31 David Edelsohn + + * config/rs6000/xcoff.h (HOT_TEXT_SECTION_NAME): Define. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Define. + +2002-05-31 Alan Lehotsky + + * varasm.c (mark_constant_pool): Walk epilogue delay list + checking the insn, not the chain for potential constants. + +Fri May 31 12:38:43 2002 J"orn Rennecke + + * config/sh/elf.h (ASM_SPEC): Use subtarget_endian_asm_spec. + +Fri May 31 13:50:19 CEST 2002 Jan Hubicka + + * i386.c (classify_argument): Properly handle base types. + + * dwarf2out.c (expand_builin_init_dwarf_reg_sizes): + Store first DWARF_FRAME_REGISTERS dwarf registers, not pseudo + registers. + +Fri May 31 13:37:54 CEST 2002 Jan Hubicka + + * gcse.c (gcse_emit_move_after): New. + (pre_delete, hoist_store): Use it. + + * reload1.c (emit_input_reload_insns): Use constrain_operands + instead of constraint_accepts_reg_p to verify optimization. + (constraint_accepts_reg_p): Kill. + + * reload1.c (reload_cse_delete_noop_set): Kill. + (reload_cse_simplify): Use delete_insn_and_edges. + +2002-05-31 Zdenek Dvorak + + * cfgloop.c (flow_loops_find): Initialize first and last fields + correctly. + +2002-05-31 Neil Booth + + * c-common.c (builtin_define_std): Correct logic. + +2002-05-31 John David Anglin + + * pa.c (output_millicode_call): Correct "be,l" insn for TARGET_PA_20. + (output_call): Likewise. + +2002-05-31 John David Anglin + + * pa.c: Move output.h include after tree.h include. + (pa_asm_output_mi_thunk): Constify identifier lab. + +2002-05-31 Jason Thorpe + + * config/ns32k/ns32k.h: Define named constants for the + bits in target_flags and use them. + * config/ns32k/netbsd.h (TARGET_DEFAULT): Use named constants. + +2002-05-30 John David Anglin + + * config.gcc (tm_file): Prefix pa/pa-700.h to tm_file list for PA1.0 + architecture and pa/pa-7100.h for PA1.1 architecture, respectively. + * pa/pa.c (override_options): Use TARGET_SCHED_DEFAULT to select + default scheduling model. + * pa/pa.h (TARGET_SCHED_DEFAULT): Define if not defined to "8000". + * pa/pa-700.h (TARGET_SCHED_DEFAULT): New file for "700" scheduling. + * pa/pa-7100.h (TARGET_SCHED_DEFAULT): New file for "7100" scheduling. + * doc/install.texi (hppa*-*-*): Document default scheduling. + +2002-05-30 John David Anglin + + * pa.c (following_call): Check TARGET_JUMP_IN_DELAY. + +2002-05-31 Jason Thorpe + + * config.gcc (ns32k-*-netbsd*): Set tm_file to + "${tm_file} netbsd.h netbsd-aout.h ns32k/netbsd.h" + * config/ns32k/netbsd.h: Don't include ns32k/ns32k.h, + netbsd.h, or netbsd-aout.h. + +2002-05-31 Jason Thorpe + + * longlong.h (count_trailing_zeros): Add missing \, and clean up + whitespace in __ns32000__ case. + +2002-05-31 Aldy Hernandez + + * expr.c (expand_expr): Output partially zeroed out vectors with + output_constant_def. + +2002-05-30 Jason Thorpe + + * config.gcc (sh[123456789l]*-*-*): Set cpu_type to sh. + (sh-*-netbsdelf*) + (shl*-*-netbsdelf*): New targets. + * config/sh/netbsd-elf.h: New file. + * config/sh/t-netbsd: New file. + +2002-05-30 Richard Henderson + Eric Botcazou + + PR optimization/6822 + * config/i386/i386.c (ix86_expand_int_movcc): Don't cast INTVAL + to unsigned int for op1 comparisons. Use gen_int_mode. + +2002-05-30 Eric Botcazou + + * expmed.c (const_mult_add_overflow_p): New. + * expr.h: Declare it. + * loop.c (maybe_eliminate_biv_1) [COMPARE]: Use it. + Don't eliminate the biv if the giv has a constant multiplier and + the rhs argument of the comparison does satisfy the predicate. + Use expand_mult_add to compute the replacement constant. + +2002-05-30 Osku Salerma + + * c-common.c (c_common_attribute_table): Add "may_alias" entry. + (c_common_get_alias_set): Handle it. + * doc/extend.texi: Document it. + +2002-05-30 Richard Henderson + + * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill. + * toplev.c (process_options): Don't check it. + * doc/tm.texi: Don't document it. + * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): New. + (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): Kill. + * config/i386/i386.c (ix86_frame_pointer_required): Suppress leaf + frame pointer optimization if current_function_profile. + +2002-05-30 Kazu Hirata + + * langhooks.c: Fix formatting. + * langhooks.h: Likewise. + * lcm.c: Likewise. + * libgcc2.c: Likewise. + * lists.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * loop.h: Likewise. + +2002-05-30 Marc Espie + + * config.gcc (sparc64-*-openbsd*): New. + * config/sparc/openbsd1-64.h: New. + * config/sparc/openbsd64.h: New. + +2002-05-30 Jeff Law + + * flow.c (propagate_one_insn): Revise yesterday's patch. Delete + a dead insn with a REG_RETVAL note when the entire libcall is not + dead and remove the associated REG_LIBCALL note at the same time. + +Thu May 30 19:54:30 2002 J"orn Rennecke + + * lcm.c (output.h): #include. + (compute_earliest): Remove hack to treat renumbered EXIT_BLOCK + as an ordinary block. + (optimize_mode_switching): Don't pretend that the exit block is + an ordinary block, or handle sucessors of entry block specially. + Instead, split edges from entry block and to exit block, and + put a computing definition on the thus gained post-entry-block, + and a need on the pre-exit-block. + +Thu May 30 20:28:01 CEST 2002 Jan Hubicka + + * gengenrtl.c (type_from_format, accessor_from_format): Support 'B'. + * rtl.texi: Document 'B' + +2002-05-30 Jason Thorpe + + * config/m68k/netbsd-elf.h (LONG_DOUBLE_TYPE_SIZE): Compute + at run-time. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Set to 96 if not __mc68010__. + +2002-05-30 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_expand_unop_builtin): Return + const0_rtx instead of NULL_RTX when in error. + (altivec_expand_abs_builtin): Same. + (rs6000_expand_binop_builtin): Same. + (altivec_expand_predicate_builtin): Same. + (altivec_expand_stv_builtin): Same. + (rs6000_expand_ternop_builtin): Same. + (altivec_expand_builtin): Same. + +2002-05-29 David S. Miller + + * rtl.h (clear_emit_caches): Delete. + * integrate.c (output_inline_function): Don't call it. + * emit-rtl.c (restore_emit_status, init_emit): Likewise. + (clear_emit_caches): Delete definition. + (SEQUENCE_RESULT_SIZE, sequence_result, free_insn): Likewise. + +2002-05-30 Hans-Peter Nilsson + + * config/mmix/mmix.c: Include real.h. + (mmix_constant_address_p): Remove redundant test before switch. + +2002-05-29 Jason Thorpe + + * config/mips/mips.h (READONLY_DATA_SECTION_ASM_OP): Define + only if not already defined. + +2002-05-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove prototypes for + ok_for_bclr and small_power_of_two. + * config/h8300/h8300.c (small_power_of_two): Remove. + (ok_for_blcr): Likewise. + (fix_bit_operand): Make WHAT deal with an integer instead of a + constraint character. + * config/h8300/h8300.h (CONST_OK_FOR_O): Remove. + (CONST_OK_FOR_P): Likewise. + (CONST_OK_FOR_LETTER_P): Do not call CONST_OK_FOR_O or + CONST_OK_FOR_P any more. + * config/h8300/h8300.md (andqi3): Adjust to the new prototype + of fix_bit_operand. + (iorqi3): Likewise. + (xorqi3): Likewise. + +2002-05-29 Jason Thorpe + + * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Make sure this is undefined. + (CPP_SPEC): Place -D__mips=1 at the beginning of the spec, + since it is no longer in CPP_PREDEFINES. Don't -U__MIPSEL__ + or -U__MIPSEB__ before defining one or the other. Instead, + use %(subtarget_endian_default) if neither -EB nor -EL are + specified. + (SUBTARGET_EXTRA_SPECS): Define. + (SUBTARGET_CPP_SPEC): Remove __LONG64 handling. Use + %(netbsd_cpp_spec). + +2002-05-29 Hans-Peter Nilsson + + * doc/md.texi (Patterns): Note pattern condition pitfall + for unnamed insn. + +2002-05-29 Aldy Hernandez + + * rs6000.c: (altivec_expand_builtin): Only expand altivec builtins + when TARGET_ALTIVEC. Move handling of generic unary, binary, and + ternary operations from here... + (rs6000_expand_builtin): ...to here. + New argument expandedp. + Change all instances of altivec_expand_binop_builtin to + rs6000_expand_binop_builtin. + (altivec_expand_unop_builtin): Rename to + rs6000_expand_unop_builtin. + (altivec_expand_binop_builtin): Rename to + rs6000_expand_binop_builtin. + (altivec_expand_ternop_builtin): Rename to + rs6000_expand_ternop_builtin. + +2002-05-29 Richard Henderson + + * config/i386/biarch64.h (TARGET_64BIT_DEFAULT): Define with value. + (TARGET_BI_ARCH): Likewise. + * config/i386/i386.h: Test TARGET_64BIT_DEFAULT by value. + (TARGET_SWITCHES): Combine target defaults here not in TARGET_DEFAULT. + (TARGET_64BIT_DEFAULT): Default to 0. + (TARGET_DEFAULT): Default to MASK_OMIT_LEAF_FRAME_POINTER. + +2002-05-29 Richard Henderson + + * config/i386/i386.c (USE_HIDDEN_LINKONCE): New. + (get_pc_thunk_name): New. + (output_set_got): Use it. + (ix86_asm_file_end): If USE_HIDDEN_LINKONCE, emit get_pc thunks + into linkonce sections. + +2002-05-29 Jason Thorpe + + * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Make sure this is undefined. + (CPP_SUBTARGET_SPEC64, CPP_SUBTARGET_SPEC32): Remove. + (CPP_SUBTARGET_SPEC): Don't provide different versions for + default-32 and default-64. Just always use %(netbsd_cpp_spec). + (SUBTARGET_EXTRA_SPECS): Remove cpp_subtarget_spec32 and + cpp_subtarget_spec64. Add netbsd_cpp_spec. + * config/sparc/netbsd.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Make sure this is undefined. + (SUBTARGET_EXTRA_SPECS): Define. + (CPP_SPEC): Use %(netbsd_cpp_spec). + +2002-05-29 Jeff Law + + * pa.h (ASM_OUTPUT_MI_THUNK): Remove unwanted semi-colon. + + * flow.c (propagate_one_insn): Do not remove a dead insn if it + contains a REG_RETVAL note. + + * haifa-sched (sched_analyze): Remove another useless clearing + of SCHED_GROUP_P I missed yesterday. + + * pa.h (ASM_OUTPUT_MI_THUNK): Move implementation into pa.c. + * pa.c (pa_asm_output_mi_thunk): New function. + * pa-protos.h (pa_asm_output_mi_thunk): Declare. + +2002-05-29 Neil Booth + Marek Michalkiewicz + + * config/avr/avr.c (avr_base_arch_macro, avr_extra_arch_macro): New. + (avr_asm_only_p): Make non-static. + (enum avr_arch): Remove. + (avr_arch_types): New. + (avr_mcu_types): Update. + (avr_override_options): Use avr_arch_types table instead of switch. + * avr.h (CPP_PREDEFINES): Die. + (avr_base_arch_macro, avr_extra_arch_macro): New. + (TARGET_CPU_CPP_BUILTINS): New. + (CPP_SPEC, EXTRA_SPECS): Simplify. + (CPP_AVR1_SPEC, CPP_AVR2_SPEC, CPP_AVR3_SPEC, CPP_AVR4_SPEC, + CPP_AVR5_SPEC): Die. + +2002-05-29 Jason Thorpe + + * config/arm/netbsd.h (TARGET_OS_CPP_BUILTINS): Use + NETBSD_OS_CPP_BUILTINS_AOUT. + (SUBTARGET_EXTRA_SPECS): Define. + (CPP_SPEC): Use %(netbsd_cpp_spec). + +2002-05-29 Richard Henderson + + * config/i386/i386.c (ix86_output_function_epilogue): New. + (TARGET_ASM_FUNCTION_EPILOGUE): New. + (pic_label_name): Remove. + (pic_labels_used): New. + (ix86_asm_file_end): Emit one pc load stub for each register used. + (output_set_got): Generate deep pc load to any register. + (ix86_select_alt_pic_regnum): New. + (ix86_save_reg): Don't save pic register if we can find a valid + call-clobbered replacement. + (ix86_expand_prologue): If we found a valid replacement, renumber + pic_offset_table_rtx. + * config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Look at + pic_offset_table_rtx after reload. + (REAL_PIC_OFFSET_TABLE_REGNUM): New. + * config/i386/i386.md (set_got): Make insn, not expander. + (set_got_nopic, set_got_deep, set_got_nodeep): Remove. + +2002-05-29 Richard Henderson + + * config/i386/i386.c (ix86_compute_frame_layout): Do add bottom + alignment for alloca. + +2002-05-29 Richard Henderson + + * config/i386/i386.c (output_pic_addr_const): Lowercase rip. + (print_operand_address): Only add rip for symbolic addresses + for which we do not have another relocation type. + +2002-05-29 Jason Thorpe + + * config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define. + (EXTRA_SPECS): Add netbsd_cpp_spec. + (CPP_SPEC): Use %(netbsd_cpp_spec). + (CPP_PREDEFINES): Remove. + * config/m68k/netbsd.h (TARGET_OS_CPP_BUILTINS): Define. + (EXTRA_SPECS): Define. + (CPP_SPEC): Use %(netbsd_cpp_spec). + (CPP_PREDEFINES): Remove. + +2002-05-29 Neil Booth + + PR preprocessor/6844 + * cppmacro.c (cpp_macro_definition): Reserve space for terminating + NUL. + +2002-05-29 Eric Christopher + + * config/mips/linux.h (SUBTARGET_CPP_SPEC): Add support for + mips5/mips32/mips64 and _MIPS_ISA_MIPSXX. + +2002-05-29 Nick Clifton + + * config/fr30/fr30.md: Remove previous restriction on splits. + Enforce conformance through gen_lowpart and cont_int_operand. + * config/fr30/fr30.h (BSS_SECTION_ASM_OP): Use ".section .bss" + as the assembler does not support ".bss". + +2002-05-29 Jason Thorpe + + * config/i386/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Remove. + (SUBTARGET_EXTRA_SPECS): Define. + (CPP_SPEC): Use %(netbsd_cpp_spec). + * config/i386/netbsd.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES): Remove. + (SUBTARGET_EXTRA_SPECS): Define. + (CPP_SPEC): Use %(netbsd_cpp_spec). + * config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Define. + (CPP_PREDEFINES, CPP_LP64_SPEC, CPP_SUBTARGET_SPEC): Remove. + (SUBTARGET_EXTRA_SPECS): Remove cpp_lp64 and cpp_subtarget. + Add netbsd_cpp_spec. + (CPP_SPEC): Remove %(cpp_subtarget), add %(netbsd_cpp_spec). + +2002-05-29 Neil Booth + Zack Weinberg + + * cppexp.c (cpp_num): Move to cpplib.h. + (CPP_ERROR): Remove. + (interpret_float_suffix, interpret_int_suffix): New. + (struct suffix, vsuf_1, vsuf_2, vsuf_3): Remove. + (cpp_classify_number, cpp_interpret_integer): New. + (interpret_number): Remove. + (eval_token): Update to use new routines. + * cpphash.h (cpp_num_part): Move to cpplib.h. + * cppinit.c (cpp_post_options): Set warn_long_long. + * cpplib.h (struct cpp_options): Add warn_long_long. + (cpp_num, cpp_num_part, CPP_N_CATEGORY, CPP_N_INVALID, + CPP_N_INTEGER, CPP_N_FLOATING, CPP_N_WIDTH, CPP_N_SMALL, + CPP_N_MEDIUM, CPP_N_LARGE, CPP_N_RADIX, CPP_N_DEC, CPP_N_HEX, + CPP_N_OCTAL, CPP_N_UNSIGNED, CPP_N_IMAGINARY, cpp_classify_number, + cpp_interpret_integer): New. + +2002-05-29 Joel Sherrill + + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Use -m403 and -m405. + +2002-05-29 Jason Thorpe + + * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Use + NETBSD_OS_CPP_BUILTINS_ELF and NETBSD_OS_CPP_BUILTINS_LP64. + (CPP_SUBTARGET_SPEC): Define. + (SUBTARGET_EXTRA_SPECS): Define. + (CPP_SPEC): Remove. + +2002-05-29 Chris Lattner + + * ssa.c (rename_insn_1): Rename uses of undefined registers to + prevent confusion if/when the register is defined. + +2002-05-29 Hans-Peter Nilsson + + PR target/6838 + * config/cris/cris.md: Fix typos and thinkos in comments. + ("*mov_sideqi_biap_mem"): Remove '*' in constraint for operand 4, + second alternative. + ("*mov_sidehi_biap_mem", "*mov_sidesi_biap_mem"): Ditto. + ("*mov_sideqi_mem"): Similar, but for operand 3. + ("*mov_sidehi_mem", "*mov_sidesi_mem"): Ditto. + (splitter for mov_sideqi_mem, mov_sidehi_mem, mov_sidesi_mem): + Remove spurious mode specifier on operand 2. + +2002-05-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove the prototype for + o_operand. + Add prototypes for single_one_operand and single_zero_operand. + * config/h8300/h8300.c (o_operand): Remove. + (single_one_operand): New. + (single_zero_operand): Likewise. + (print_operand): For 'V' operand, and the operand with 0xff. + For 'V' and 'W' operands, do not and the bit position with 7. + * config/h8300/h8300.md (various anonymous patterns): Replace + use of exact_log2 with single_one_operand/single_zero_operand. + +2002-05-29 Ulrich Weigand + + * config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New. + +2002-05-29 Ulrich Weigand + + * config/s390/s390.c (legitimate_pic_operand_p): Do not + accept symbolic LARL operands. + (s390_emit_epilogue): Do not set FRAME_RELATED_P on + epilogue insns. + +2002-05-29 Hartmut Penner + + * config/s390/s390.md (cmpstr_64/31): Mark whole + input registers as used. + +2002-05-28 Richard Henderson + + * config/i386/i386.c (ix86_save_reg): Examine regs_ever_live, + not current_function_uses_pic_offset_table and + current_function_uses_const_pool; examine current_function_profile. + (ix86_expand_prologue): Likewise. Add pic_offset_table_rtx as + input to blockage if needed. + (ix86_expand_call): Do not set current_function_uses_pic_offset_table. + (legitimize_pic_address): Likewise. Set regs_ever_live for + pic_offset_table_rtx when invoked during reload. + * config/i386/i386.h (FINALIZE_PIC): Remove. + * config/i386/i386.md (tablejump): Reformat. Do not set + current_function_uses_pic_offset_table. + (tls_global_dynamic, tls_local_dynamic_base): Likewise. + (blockage): Accept anything as operand 0. + +2002-05-28 Jason Thorpe + + * config/netbsd-aout.h (NETBSD_OS_CPP_BUILTINS_AOUT): Define + common CPP built-ins for all NetBSD a.out targets. + * config/netbsd-elf.h (NETBSD_OS_CPP_BUILTINS_ELF): Define + common CPP built-ins for all NetBSD ELF targets. + * config/netbsd.h: Add missing notice. + (NETBSD_OS_CPP_BUILTINS_COMMON): Define common CPP built-ins + for all NetBSD targets. + (NETBSD_OS_CPP_BUILTINS_LP64): Define common CPP built-ins + for all NetBSD targets using an LP64 code model. + (NETBSD_CPP_SPEC): Define CPP_SPEC parts common to all + NetBSD targets. + +2002-05-28 Richard Henderson + + * flow.c (update_life_info_in_dirty_blocks): Only do a partial + update if UPDATE_LIFE_LOCAL. + +2002-05-28 Toshiyasu Morita + + * config/sh/sh.c: Include real.h for REAL_VALUE_TYPE. + +Tue May 28 21:16:18 2002 J"orn Rennecke + Jason R. Thorpe + + config/sh reorganization to factor out endianness and coff: + + * config/sh/little.h: New file. + * config/sh/sh.h (TARGET_ENDIAN_DEFAULT): If not already + defined, define to 0 to select big-endian. + (SUBTARGET_ASM_ENDIAN_SPEC): Define according to TARGET_ENDIAN_DEFAULT. + (TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT. + * config/sh/sh64.h (TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT. + * config/sh/t-be: New file. + * config/sh/t-le: New file. + + * sh.h (SDB_DEBUGGING_INFO, #include "dbxcoff.h"): Moved to sh/coff.h. + (SDB_DELIM, MAX_OFILE_ALIGNMENT, IDENT_ASM_OP): Likewise. + (TARGET_ASM_NAMED_SECTION, ASM_OUTPUT_SKIP): Likewise. + (USER_LABEL_PREFIX, LOCAL_LABEL_PREFIX): Likewise. + (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. + (ASM_FILE_END, ASM_DECLARE_FUNCTION_NAME): Deleted. + (CPP_SPEC, SUBTARGET_CPP_ENDIAN_SPEC): Likewise. + (SUBTARGET_CPP_SPEC, CPP_DEFAULT_CPU_SPEC, CPP_PREDEFINES): Likewise. + (EXTRA_SPECS): Remove SUBTARGET_CPP_ENDIAN_SPEC and + CPP_DEFAULT_CPU_SPEC. Add LINK_EMUL_PREFIX, LINK_DEFAULT_CPU_EMUL, + SUBTARGET_LINK_EMUL_SUFFIX and SUBTARGET_LINK_SPEC. + (LINK_SPEC): Define to SH_LINK_SPEC. + (TARGET_CPU_CPP_BUILTINS, SH_LINK_SPEC): Define. + (LINK_EMUL_PREFIX, LINK_DEFAULT_CPU_EMUL): Likewise. + (SUBTARGET_LINK_EMUL_SUFFIX, SUBTARGET_LINK_SPEC): Likewise. + (CPP_SPEC): Reduce to %(subtarget_cpp_spec). + (TARGET_ENDIAN_DEFAULT): Define if not already defined. + * config/sh/coff.h: New file. + (TARGET_ASM_NAMED_SECTION): Now default_coff_asm_named_section + (TARGET_OBJFMT_CPP_BUILTINS): Define. + * config/sh/elf.h (IDENT_ASM_OP): No need to #undef at the start. + (ASM_FILE_END, ASM_OUTPUT_SOURCE_LINE): Likewise. + (DBX_OUTPUT_MAIN_SOURCE_FILE_END, TARGET_ASM_NAMED_SECTION): Likewise. + (ASM_DECLARE_FUNCTION_NAME, MAX_OFILE_ALIGNMENT, SIZE_TYPE): Likewise. + (PTRDIFF_TYPE): Likewise. + ("dbxelf.h", "elfos.h", "svr4.h"): Don't #include. + (CPP_PREDEFINES): Don't define. + (TARGET_OBJFMT_CPP_BUILTINS): Define. + (LINK_SPEC): Define to SH_LINK_SPEC. + (LINK_EMUL_PREFIX): Redefine. + * config/sh/linux.h: (SUBTARGET_CPP_SPEC): Remove -fpic / -fPIC cases. + (SUBTARGET_CPP_ENDIAN_SPEC, CPP_DEFAULT_CPU_SPEC): Remove redefinition. + (CPP_PREDEFINES, SUBTARGET_ASM_ENDIAN_SPEC): Likewise. + (CC1_SPEC, CC1PLUS_SPEC, LINK_SPEC): Likewise. + (TARGET_OS_CPP_BUILTINS): Define. + (TARGET_DEFAULT): Redefine. + (SUBTARGET_LINK_EMUL_SUFFIX, SUBTARGET_LINK_SPEC): Likewise. + * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Remove. + (LINK_SPEC): Don't redefine. + (LINK_DEFAULT_CPU_EMUL): Redefine. + (TARGET_DEFAULT): Include TARGET_ENDIAN_DEFAULT. + * sh.c (sh_asm_named_section): Don't declare / define. + * t-linux (MULTILIB_OPTIONS): Rely on pre-set endianness option. + * config.gcc (sh-*-elf* tm_file): Add dbxelf.h elfos.h svr4.h. + (sh64-*-elf* tm_file): Likewise. + (sh-*-rtemself* tm_file): Likewise. + (sh-*-linux* tm_file): Likewise. Add sh/little.h. + (sh-*-linux* tmake_file): Add sh/t-le. + (sh-*-rtems* tm_file): Add sh/coff.h + (sh-*-* tm_file): Likewise. + +Tue May 28 21:16:18 2002 J"orn Rennecke + + * sh.h (LEGITIMATE_PIC_OPERAND_P): Check for SYMBOL_REF before using + CONSTANT_POOL_ADDRESS_P. + + * coff.h (HAS_INIT_SECTION, INVOKE__MAIN): Define. + +2002-05-28 David Edelsohn + Jeff Law + + * optabs.c (expand_binop): Fix nwords sign warnings. + generate pseudo for add_optab. + + * sched-deps.c (sched_analyze): Do not clear SCHED_GROUP_P. + * haifa-sched.c (move_insn): Clear SCHED_GROUP_P after it is used. + +2002-05-28 Marc Espie + + * config/i386/openbsd.h (HAVE_GAS_MAX_SKIP_P2ALIGN): Remove, + inherited from gas.h. + (ASM_QUAD): Undef. OpenBSD does not support it. + +2002-05-28 Danny Smith + + * doc/install.texi (binaries): Change mingw binaries + link to www.mingw.org. + +2002-05-28 Zdenek Dvorak + + * cfgloop.c (flow_loops_cfg_dump): Use bb->index, not i. + +2002-05-28 Richard Henderson + + * config/i386/i386.c (ix86_compute_frame_layout): Do not add + bottom alignment for leaf functions. + +2002-05-28 Zack Weinberg + + * config/pa/milli32.S, config/pa/lib1funcs.asm, + config/sparc/sol2-g1.asm: Delete unused files. + +2002-05-28 Richard Henderson + + * cfg.c (dump_flow_info): Print bb->index, not i, for block number. + + * flow.c (calculate_global_regs_live): Rename call_used to + invalidated_by_call. Initialize from regs_invalidated_by_call + instead of call_used_regs. + + * varasm.c (default_binds_local_p): Check TREE_PUBLIC before + DECL_EXTERNAL. + +2002-05-28 Zack Weinberg + + * tree.h: Don't include real.h. + Forward-declare struct realvaluetype. + (struct tree_real_cst): Point to the REAL_VALUE_TYPE, do not + contain it. + (TREE_REAL_CST_PTR): New accessor. + (TREE_REAL_CST): Update. + * real.h: Include machmode.h. + (realvaluetype): Make it struct realvaluetype, not a typedef. + (build_real): Prototype here. + + * tree.c: Include real.h. + (build_real): Allocate the REAL_VALUE_TYPE as a separate + object in GC memory, set TREE_REAL_CST_PTR to point to it. + (build_real_from_int_cst): Use build_real. + * ggc-common.c (ggc_mark_trees): Mark TREE_REAL_CST_PTR of a + REAL_CST. + + * builtins.c, c-common.c, c-lex.c, dwarf2out.c, expr.c, + fold-const.c, print-tree.c, real.c: Include real.h. + * Makefile.in: Update dependency lists. + +2002-05-28 Zdenek Dvorak + + * basic-block.h (last_basic_block): Declare. + (expunge_block_nocompact): Declaration removed. + (compact_blocks): Declare. + * cfg.c (last_basic_block): New variable. + (expunge_block_nocompact): Removed. + (expunge_block): Do not compact basic blocks. + (compact_blocks): New. + * cfganal.c (flow_call_edges_add): Use the fact that bb indices no + longer change. + * cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Set + last_basic_block. + * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Do not change + real positions of blocks. + (delete_unreachable_blocks): Simplified -- quadratic behavior now + cannot occur. + (cleanup_cfg): Compact blocks. + * cfgrtl.c (create_basic_block): Insert basic blocks to the end of + basic_block_info varray. + (flow_delete_block): Comment update. + (back_edge_of_syntactic_loop_p): Modify position check code. + (verify_flow_info): Update checking. + * flow.c (calculate_global_regs_live): Use FOR_EACH_BB. + * ifcvt.c (SET_ORIG_INDEX, ORIG_INDEX): Removed. + (find_if_case_1, find_if_case_2, if_convert): Use the fact that bb + indices no longer change. + * lcm.c (optimize_mode_switching): Replace n_basic_blocks with + last_basic_block. + * predict.c (estimate_bb_frequencies): Remove unneccessary code. + * profile.c (branch_prob): Compact blocks. + * sched-rgn.c (find_rgns): Replace n_basic_blocks with + last_basic_block. + +2002-05-28 Kazu Hirata + + * config/h8300/h8300.md (two anonymous patterns): New. + +2002-05-28 David S. Miller + + * config/sparc/sparc.md (cpu): Tidy. + (type): Delete 'return', add 'ialuX', 'flushw', 'iflush', and + 'trap'. + (in_call_delay): Delete reference to 'return' type. + (eligible_for_return_delay, in_return_delay, define_delay + referencing those): Delete. + (rest of file): Use new type attributes as appropriate. + * config/sparc/sparc-protos.h (eligible_for_return_delay): Delete. + * config/sparc/sparc.c (eligible_for_return_delay): Likewise. + * config/sparc/ultra1_2.md (us1_single): New reservation. + (us1_ialuX): Likewise. + * config/sparc/ultra3.md (us3_single): Likewise. + (us3_ialuX): Likewise. + (us3_imul, us3_idiv): Tweak. + +2002-05-28 Richard Henderson + + * config/alpha/alpha.c (alpha_in_small_data_p): Return false for + STRING_CST. + +2002-05-28 Richard Henderson + + * config.gcc: Obsolete mn10200. + +2002-05-28 Neil Booth + + * cppexp.c (interpret_number): Optimize for single-digit + and less-than-half-precision cases. + (num_trim, num_positive, num_div_op): Cast constants. + +2002-05-27 Bo Thorsen + + * config/i386/libgcc-x86_64-glibc.ver: Copy this file from the + 3.1 branch. The file was made by Jakub Jelinek. + * config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Add i386 + support so multilib doesn't break. And don't define this at all + when -Dinhibit_libc is used. + (MULTILIB_DEFAULTS): Always set default to 64 bit compilation. + * config/i386/t-linux64: Implement full multilib support. Patch + originally done by Andreas Jaeger and Jakub Jelinek. + +2002-05-27 Roger Sayle + + * c-common.c: Add support for __attribute__((nothrow)) to specify + that a function cannot throw an exception (using TREE_NOTHROW). + (handle_nothrow_attribute): New function to process this attribute. + + * doc/extend.texi: Document the new nothrow function attribute. + +2002-05-27 H.J. Lu (hjl@gnu.org) + + * cppexp.c (num_trim): Use 1UL instead of 1 for long int. + (num_positive): Likewise. + (num_div_op): Likewise. + +2002-05-27 Neil Booth + + * c-common.c (c_common_init): Always use intmax_t. + +2002-05-27 Neil Booth + + * c-common.c (c_common_init): Use intmax_t for now. + +2002-05-24 Andrew Haley + + * fold-const.c (fold): Don't convert (T)(x & c) into (T)x & (T)c + if T is a boolean type. + +2002-05-27 Zdenek Dvorak + + * basic-block.h (last_basic_block): Defined as synonym for + n_basic_blocks. + * cfganal.c (mark_dfs_back_edges, flow_reverse_top_sort_order_compute, + flow_depth_first_order_compute, flow_preorder_transversal_compute, + flow_dfs_compute_reverse_init): Replaced relevant occurences of + n_basic_blocks with last_basic_block. + * cfgbuild.c (make_edges): Likewise. + * cfgloop.c (flow_loop_scan, flow_loops_find): Likewise. + * cfgrtl.c (verify_flow_info, purge_all_dead_edges): Likewise. + * combine.c (combine_instructions): Likewise. + * df.c (df_alloc, df_analyse_1, df_analyse, iterative_dataflow_sbitmap, + iterative_dataflow_bitmap): Likewise. + * dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree, + calc_idoms, idoms_to_doms): Likewise. + * flow.c (update_life_info_in_dirty_blocks, free_basic_block_vars): + Likewise. + * gcse.c (gcse_main, alloc_gcse_mem, compute_local_properties, + compute_hash_table, expr_reaches_here_p, one_classic_gcse_pass, + one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p, + one_pre_gcse_pass, compute_transpout, delete_null_pointer_checks_1, + delete_null_pointer_checks, compute_code_hoist_vbeinout, + hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass, + compute_store_table, build_store_vectors): Likewise. + * haifa-sched.c (sched_init): Likewise. + * ifcvt.c (if_convert): Likewise. + * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, + pre_edge_lcm, compute_available, compute_nearerout, + compute_rev_insert_delete, pre_edge_rev_lcm, optimize_mode_switching): + Likewise. + * predict.c (estimate_probability, process_note_prediction, + note_prediction_to_br_prob): Likewise. + * profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): Likewise. + * recog.c (split_all_insns, peephole2_optimize): Likewise. + * regrename.c (copyprop_hardreg_forward): Likewise. + * resource.c (init_resource_info): Likewise. + * sched-rgn.c (build_control_flow, find_rgns, compute_trg_info, + init_regions, schedule_insns): Likewise. + * ssa-ccp.c (ssa_const_prop): Likewise. + * ssa-dce.c (ssa_eliminate_dead_code): Likewise. + * ssa.c (compute_dominance_frontiers, + compute_iterated_dominance_frontiers, convert_to_ssa): Likewise. + + * df.c (df_refs_unlink): Fix FOR_EACH_BB usage (in #if 0'ed code) + * gcse.c (alloc_rd_mem, alloc_avail_expr_mem): Use n_blocks for vector + sizes consistently. + +Mon May 27 14:28:12 CEST 2002 Jan Hubicka + + * basic-block.h (can_hoist_p, hoist_insn_after, hoist_insn_to_edge): + new. + * rtlanal.c (hoist_test_store, can_hoist_insn_p, hoist_update_store, + hoist_insn_after, hoist_insn_to_edge): New. + +Mon May 27 12:14:02 CEST 2002 Jan Hubicka + + * basic-block.h (PEOP_SCAN_DEAD_STORES): New. + (PROP_FINAL): Include. + * flow.c (life_analysis, update_life_info, + init_propagate_block_info, mark_set_1, mark_used_rgs): + Support SCAN_DEAD_STORE. + +2002-05-27 Neil Booth + + * c-common.c (c_common_init): Set CPP arithmetic precision. + * cppexp.c (cpp_num_part): Move typedef ... + * cpphash.h: ...here; make unsigned HOST_WIDE_INT. + * cppinit.c (cpp_create_reader): Default to host long arithmetic. + (sanity_checks): Update. + +2002-05-26 Geoffrey Keating + + * Makefile.in (INSTALL_HEADERS): Add 'install-mkheaders'. + (mkheaders): New rule. + (install-mkheaders): New rule. + * configure.in (all_outputs): Add mkheaders. + * configure: Regenerate. + * mkheaders.in: New file. + +2002-05-26 Jakub Jelinek + + * cse.c (fold_rtx): Don't optimize if SUBREG changes mode class. + +2002-05-26 Andreas Jaeger + + * cfg.c (dump_flow_info): Remove extra argument to fprintf. + +2002-05-26 Neil Booth + + * cppexp.c (possible_sum_sign, integer_overflow, left_shift, + right_shift): Remove. + (cpp_num, cpp_num_part, PART_PRECISION, HALF_MASK, LOW_PART, + HIGH_PART): New. + (struct op): Use cpp_num. + (num_zerop, num_eq, num_positive, num_greater_freq, num_trim, + num_part_mul, num_unary_op, num_binary_op, num_negate, + num_bitwise_op, num_inequality_op, num_equality_op, num_mul, + num_div_op, num_lshift, num_rshift, append_digit): New. + (interpret_number, parse_defined, eval_token, reduce): Update + for two-integer arithmetic. + (binary_handler): New typedef. + (optab): Update. + (COMPARE, EQUALITY, BITWISE, MINMAX, UNARY, SHIFT): Delete. + (_cpp_parse_expr, reduce): Update to handle two-integers. + * cpplib.c (_cpp_test_assertion): Back up on CPP_EOF. + +2002-05-26 Marek Michalkiewicz + + * config/avr/avr-protos.h (avr_out_sbxx_branch): Declare. + * config/avr/avr.c (jump_over_one_insn_p): Take length of the + branch insn into account, do not assume 1. + (avr_out_sbxx_branch): New function. Optimize cases of skipping + over single word insn. Handle upper half of I/O space too. + * config/avr/avr.md (*sbrx_branch): Use it. + (*sbrx_and_branchhi, *sbrx_and_branchsi): Likewise. + (*sbix_branch, *sbix_branch_bit7): Likewise. + (*sbix_branch_tmp, *sbix_branch_tmp_bit7): New. + Use RTL peepholes to optimize register operand sign tests. + +2002-05-26 Marek Michalkiewicz + + * config/avr/avr.c (avr_asm_only_p): New variable. + (avr_override_options): Set it here if AVR1. + (asm_file_start): Test it here, report an error if set. + +2002-05-26 Kazu Hirata + + * alias.c: Fix formatting. + * attribs.c: Likewise. + * bb-reorder.c: Likewise. + * bitmap.c: Likewise. + * bitmap.h: Likewise. + * builtins.c: Likewise. + +Sun May 26 14:00:44 CEST 2002 Jan Hubicka + + * reload.c (find_valid_class): Accept new argument DEST, + choose class accordingly. + (push_reload): Update callers. + +2002-05-26 Andreas Jaeger + + * combine.c (combine_instructions): Do not indent #if for + traditional C. + +2002-05-25 Richard Henderson + + * c-pragma.c (apply_pragma_weak): Convert value identifier to + string for decl_attributes. + (handle_pragma_weak): Call assemble_alias if we're modifying + an existing decl. + +2002-05-25 Richard Henderson + + PR target/6788 + * config/sparc/sparc.c (sparc_output_mi_thunk): New implementation + using rtl instead of fprintf. + * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Use it. + * config/sparc/sparc-protos.h: Update. + +2002-05-25 Neil Booth + + * Makefile.in (C_COMMON_H): Fix. + Update other targets. + * c-common.c: Don't include c-lex.h. + (builtin_define_with_value): Make static and prototype. + (builtin_define_std): Move from c-lex.h. + * c-common.h (init_c_lex): Move from c-lex.h. + * c-decl.c: Don't include c-lex.h. + (make_pointer_declarator): Move from c-parse.in. + * c-lex.c: Don't include c-lex.h. + * c-lex.h: Remove. + * c-parse.in: Don't include c-lex.h; include c-pragma.h. + (make_pointer_declarator): Move to c-decl.c. + * c-pragma.c: Don't include c-lex.h. + * c-pragma.h (yydebug, YYDEBUG, parse_in, c_lex): Move from c-lex.h. + * c-tree.h (make_pointer_declarator): New. +doc: + * passes.texi, tm.texi: Update. +objc: + * Make-lang.in: Update and correct. + * objc-act.c: Don't include c-lex.h or cpplib.h. +treelang: + * treetree.c: Don't include c-lex.h. +config: + * darwin-c.c: Don't include c-lex.h. + * c4x/c4x-c.c: Don't include c-lex.h. + * c4x/t-c4x: Update. + * i370/i370-c.c: Don't include c-lex.h. + * i370/t-i370: Update. + * i960/i960-c.c: Don't include c-lex.h. + * i960/i960.c: Don't include cpplib.h, c-lex.h or c-pragma.h. + * i960/t-960bare: Update. + * i960/t-vxworks: Update. + * rs6000/rs6000-c.c: Don't include c-lex.h; include c-pragma.h. + * rs6000/t-darwin: Update. + * rs6000/t-rs6000-c-rule: Update. + * v850/v850-c.c: Don't include c-lex.h. + * v850/v850.c: Don't include c-lex.h or cpplib.h. + + +2002-05-25 Kazu Hirata + + * tree.def: Fix typos. + * doc/install.texi: Likewise. + +2002-05-25 Richard Henderson + + * configure.in (HAVE_AS_TLS): Add ia64 test. + * configure: Rebuild. + * config/ia64/ia64.c (ia64_tls_size_string, ia64_tls_size): New. + (override_options): Set it. + (TARGET_HAVE_TLS): New. + (sdata_symbolic_operand): Look for 's'. + (tls_symbolic_operand): New. + (ia64_expand_load_address): Abort for tls symbols. + (gen_tls_get_addr): New. + (gen_thread_pointer): New. + (ia64_expand_move): Split out from movdi. Handle tls symbols. + (rtx_needs_barrier): Add new unspecs. + (ia64_encode_section_info): Handle tls symbols. + (ia64_strip_name_encoding): Strip two encoding chars. + * config/ia64/ia64.h (ia64_tls_size, ia64_tls_size_string): New. + (TARGET_TLS14, TARGET_TLS22, TARGET_TLS64): New. + (TARGET_OPTIONS): Add tls-size. + (ENCODE_SECTION_INFO_CHAR): Rename from SDATA_NAME_FLAG_CHAR. + * config/ia64/ia64.md (UNSPEC_LTOFF_DTPMOD, UNSPEC_LTOFF_DTPREL, + UNSPEC_DTPREL, UNSPEC_LTOFF_TPREL, UNSPEC_TPREL, UNSPEC_LD_BASE): New. + (movqi, movhi, movsi, movdi, movti): Use ia64_expand_move. + (movsf, movdf): Likewise. + (movdi_symbolic): Use match_scratch. Don't split if we won't + have a scratch availiable. + (load_ltoff_dtpmod, load_dtprel, load_dtprel64, load_dtprel22, + add_dtprel, add_dtprel14, add_dtprel22, load_ltoff_tprel, load_tprel, + load_tprel64, load_tprel22, add_tprel, add_tprel14, add_tprel22): New. + * config/ia64/ia64-protos.h: Update. + * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use + sdata_symbolic_operand. + (ASM_OUTPUT_LABELREF): Strip two characters. + +2002-05-25 Kazu Hirata + + * combine.c (simplify_set): Remove an unnecessary subreg. + +2002-05-25 Marek Michalkiewicz + + * config/avr/avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL. + + * config/avr/avr.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_BSS): New. + +2002-05-25 Gabriel Dos Reis + + * toplev.c (output_clean_symbol_name): Fix another thinko. Gosh. + +2002-05-25 Roger Sayle + + * simplify-rtx.c (simplify_gen_relational): Simplify the RTX + (cond (compare x y) 0) into the equivalent (cond x y). + +2002-05-25 Gabriel Dos Reis + + * toplev.c (output_clean_symbol_name): Use xstrdup. Fix thinko. + +2002-05-24 Zack Weinberg + + * config.gcc: Remove all stanzas for previously obsoleted + systems. Where necessary, add explicit error stanzas to + prevent removed systems from being misidentified as something + else. Begin a fresh obsoletions list, with the systems that + were reprieved last round. + * doc/install.texi: Remove all mention of dead targets. + * fixinc/mkfixinc.sh: Likewise. + + * config/arm/arm.h: Bit 31 of target_flags is no longer + reserved. + + * config/1750a/1750a-protos.h, config/1750a/1750a.c, + config/1750a/1750a.h, config/1750a/1750a.md, config/1750a/ms1750.inc, + config/a29k/a29k-protos.h, config/a29k/a29k.c, config/a29k/a29k.h, + config/a29k/a29k.md, config/a29k/rtems.h, config/a29k/t-a29kbare, + config/a29k/t-vx29k, config/a29k/unix.h, config/a29k/vx29k.h, + config/alpha/osf12.h, config/alpha/osf2or3.h, + config/arm/arm-wince-pe.h, config/arm/arm.h, config/arm/riscix.h, + config/arm/riscix1-1.h, config/arm/rix-gas.h, config/arm/t-riscix, + config/clipper/clipper-protos.h, config/clipper/clipper.c, + config/clipper/clipper.h, config/clipper/clipper.md, + config/clipper/clix.h, config/convex/convex-protos.h, + config/convex/convex.c, config/convex/convex.h, + config/convex/convex.md, config/convex/fixinc.convex, + config/convex/proto.h, config/elxsi/elxsi-protos.h, + config/elxsi/elxsi.c, config/elxsi/elxsi.h, config/elxsi/elxsi.md, + config/i386/386bsd.h, config/i386/aix386.h, config/i386/aix386ng.h, + config/i386/bsd386.h, config/i386/dgux.h, config/i386/djgpp-rtems.h, + config/i386/isc.h, config/i386/iscdbx.h, config/i386/linux-oldld.h, + config/i386/next.h, config/i386/osf1-ci.asm, config/i386/osf1-cn.asm, + config/i386/osf1elf.h, config/i386/osf1elfgdb.h, config/i386/osfelf.h, + config/i386/osfrose.h, config/i386/rtems.h, config/i386/seq-gas.h, + config/i386/seq-sysv3.h, config/i386/seq2-sysv3.h, + config/i386/sequent.h, config/i386/sun.h, config/i386/sun386.h, + config/i386/t-dgux, config/i386/t-next, config/i386/t-osf, + config/i386/t-osf1elf, config/i860/bsd-gas.h, config/i860/bsd.h, + config/i860/fx2800.h, config/i860/i860-protos.h, config/i860/i860.c, + config/i860/i860.h, config/i860/i860.md, config/i860/mach.h, + config/i860/paragon.h, config/i860/sysv3.h, config/i860/sysv4.h, + config/i860/t-fx2800, config/i860/varargs.asm, config/m68k/a-ux.h, + config/m68k/altos3068.h, config/m68k/apollo68.h, + config/m68k/aux-crt1.c, config/m68k/aux-crt2.asm, + config/m68k/aux-crtn.asm, config/m68k/aux-exit.c, + config/m68k/aux-low.gld, config/m68k/aux-mcount.c, + config/m68k/auxas.h, config/m68k/auxgas.h, config/m68k/auxgld.h, + config/m68k/auxld.h, config/m68k/ctix.h, config/m68k/dpx2.h, + config/m68k/dpx2.ifile, config/m68k/dpx2cdbx.h, config/m68k/dpx2g.h, + config/m68k/isi-nfp.h, config/m68k/isi.h, config/m68k/lynx-ng.h, + config/m68k/lynx.h, config/m68k/math-3300.h, config/m68k/news.h, + config/m68k/news3.h, config/m68k/news3gas.h, config/m68k/newsgas.h, + config/m68k/next.h, config/m68k/next21.h, config/m68k/rtems.h, + config/m68k/t-aux, config/m68k/t-lynx, config/m68k/t-next, + config/m68k/x-next, config/m88k/dgux.h, config/m88k/dgux.ld, + config/m88k/dguxbcs.h, config/m88k/dolph.h, config/m88k/dolphin.ld, + config/m88k/luna.h, config/m88k/m88k-coff.h, config/m88k/sysv3.h, + config/m88k/t-bug, config/m88k/t-dgux, config/m88k/t-dgux-gas, + config/m88k/t-dguxbcs, config/m88k/t-dolph, config/m88k/t-m88k-gas, + config/m88k/t-tekXD88, config/m88k/tekXD88.h, config/m88k/tekXD88.ld, + config/mips/bsd-4.h, config/mips/bsd-5.h, config/mips/dec-bsd.h, + config/mips/dec-osf1.h, config/mips/elflorion.h, + config/mips/iris4loser.h, config/mips/mips-5.h, config/mips/news4.h, + config/mips/news5.h, config/mips/nws3250v4.h, config/mips/osfrose.h, + config/mips/svr3-4.h, config/mips/svr3-5.h, config/mips/svr4-4.h, + config/mips/svr4-5.h, config/mips/svr4-t.h, config/mips/t-bsd, + config/mips/t-bsd-gas, config/mips/t-svr3, config/mips/t-svr3-gas, + config/mips/t-svr4, config/mips/t-svr4-gas, config/mips/t-ultrix, + config/mips/ultrix.h, config/nextstep-protos.h, config/nextstep.c, + config/nextstep.h, config/nextstep21.h, config/ns32k/encore.h, + config/ns32k/merlin.h, config/ns32k/pc532-mach.h, + config/ns32k/pc532-min.h, config/ns32k/pc532.h, + config/ns32k/sequent.h, config/ns32k/tek6000.h, + config/ns32k/tek6100.h, config/ns32k/tek6200.h, config/pj/lib1funcs.S, + config/pj/linux.h, config/pj/pj-protos.h, config/pj/pj.c, + config/pj/pj.h, config/pj/pj.md, config/pj/pjl.h, config/pj/t-pj, + config/sparc/rtems.h, config/we32k/we32k-protos.h, + config/we32k/we32k.c, config/we32k/we32k.h, config/we32k/we32k.md: + Delete file. + +2002-05-24 Richard Henderson + + * flags.h (TLS_MODEL_GLOBAL_DYNAMIC): Set to 1. + * toplev.c (flag_tls_default) Set to TLS_MODEL_GLOBAL_DYNAMIC. + * config/i386/i386.c (tls_model_chars): Add leading space. + (tls_symbolic_operand): Don't bias by 1. + (legitimize_address): Don't unbias by 1. + +2002-05-24 Toshiyasu Morita + + * lcm.c (optimize_mode_switching): Change bb used as indices + to bb->index. + +2002-05-24 Richard Henderson + + * config/ia64/ia64.c (ia64_reorg): Use update_life_info instead + of update_life_info_in_dirty_blocks. + +2002-05-24 Jakub Jelinek + + PR other/6782 + * final.c (get_mem_expr_from_op): Return 0 if op is NULL. + +2002-05-24 Neil Booth + + PR preprocessor/6780 + * cppmacro.c (enter_macro_context): Clear state.angled_headers. + +2002-05-24 Jim Blandy + + * dwarf2out.c (dwarf2out_finish): Don't forget to emit a final + entry with a type code of zero, marking the end of the compilation + unit's macro info. + +2002-05-24 Richard Henderson + + * varasm.c (asm_output_bss): Always output one byte. + * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. + +2002-05-24 Bryce McKinlay + + * tree.c (decl_type_context): Return NULL_TREE if decl's context is a + namespace. + +2002-05-24 Andreas Jaeger + + * ggc-page.c (alloc_page): Cast variables of type size_t to + unsigned long, adjust printf format string. + (ggc_alloc): Likewise. + (ggc_print_statistics): Likewise. + (ggc_print_statistics): Correct printf format string for SCALE to + use unsigned long. + +2002-05-24 Danny Smith + + * config/i386/mingw32.h (CPP_SPEC): Remove -remap. + +2002-05-23 Gabriel Dos Reis + Zack Weinberg + + * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Properly output + quoted strings. + * dwarf2out.c (lookup_filename): Properly quote filename in .file + directive in assembly file. + * config/m68k/dpx2.h (ASM_OUTPUT_SOURCE_FILENAME): Likewise. + * config/m88k/m88k.h (ASM_OUTPUT_SOURCE_FILENAME): Likewise. + * config/pj/pj.h (ASM_FILE_START): Likewise. + * config/rs6000/xcoff.h (ASM_FILE_START): Likewise. + * config/avr/avr.c (asm_file_end): Likewise. + * toplev.c (output_quoted_string): Handle possibly signed plain + char. + * toplev.h (output_clean_symbol_name): Declare + * toplev.c (output_clean_symbol_name): Define. + * config/alpha/alpha.c (unicosmk_output_module_name): Use it. + * config/1750a/1750a.h (ASM_FILE_START): Likewise. + +2002-05-24 Alan Modra + + * config/rs6000/rs6000.c (output_toc): Mask longs to 32 bits. + +2002-05-23 Vladimir Makarov + + * genautomata.c (reserv_sets_hash_value): Use shift equal to 3/4 + of size of unsigned. + +2002-05-23 Richard Henderson + + * configure.in (HAVE_AS_TLS): New test. + * config.in, configure: Rebuild. + * config/i386/i386.c (TARGET_HAVE_TLS): Set if HAVE_AS_TLS. + (ix86_tls_dialect_string, ix86_tls_dialect): New. + (override_options): Set it. + (tls_model_chars, tls_symbolic_operand): New. + (tls_symbolic_operand_1, global_dynamic_symbolic_operand): New. + (local_dynamic_symbolic_operand, initial_exec_symbolic_operand): New. + (local_exec_symbolic_operand): New. + (get_pic_label_name): Merge into output_set_got. + (ix86_asm_file_end): Emit pic_label_name if defined. + (legitimate_constant_p, constant_address_p): New. + (legitimate_pic_operand_p): New. + (legitimate_pic_address_disp_p): Handle GOTTPOFF, NTPOFF, DTPOFF. + (legitimate_address_p): Likewise. + (ix86_encode_section_info): Rename from i386_; handle tls decls. + (ix86_strip_name_encoding): New. + (get_thread_pointer): New. + (legitimize_address): Handle tls symbols. + (output_pic_addr_const): Handle GOTTPOFF, TPOFF, NTPOFF, DTPOFF. + Remove UNSPEC_PLT. + (struct machine_function): Add some_ld_name. + (get_some_local_dynamic_name, get_some_local_dynamic_name_1): Set it. + (print_operand) [&]: Use it. Handle UNSPEC_TP. + (output_addr_const_extra): New. + (maybe_get_pool_constant): New. + (ix86_split_to_parts): Use it. + (ix86_expand_move): Handle tls symbols. + (ix86_tls_get_addr): New. + * config/i386/i386.h (TARGET_GNU_TLS, TARGET_SUN_TLS): New. + (TARGET_OPTIONS): Add tls-dialect. + (CONSTANT_ADDRESS_P): Use new out-of-line function. + (LEGITIMATE_CONSTANT_P): Likewise. + (LEGITIMATE_PIC_OPERAND_P): Likewise. + (TARGET_STRIP_NAME_ENCODING): New. + (ASM_OUTPUT_LABELREF): New. + (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. + (OUTPUT_ADDR_CONST_EXTRA): New. + (PREDICATE_CODES): Update. + (ix86_tls_dialect, ix86_tls_dialect_string): New. + * config/i386/i386.md: Regroup and renumber unspec constants. + (tls_global_dynamic_gnu, tls_global_dynamic_sun): New. + (tls_local_dynamic_base_gnu, tls_local_dynamic_base_sun): New. + (tls_global_dynamic, tls_local_dynamic_base): New. + (tls_local_dynamic_once): New. + * config/i386/i386-protos.h: Update. + +2002-05-23 Richard Henderson + + * genemit.c (gen_insn): Print file:lineno comment before function. + (main): likewise. + * gensupport.c (struct queue_elem): Add filename member. + (queue_pattern): Initialize it; update all callers. + (process_include): Don't free filename. + (read_md_rtx): Set read_rtx_filename. + +2002-05-23 Hans Boehm + + * config/ia64/linux.h (IA64_GATE_AREA_END): Adjust for 64K pages. + +2002-05-23 Richard Henderson + + * config/i386/i386.c (output_set_got): Fix typo in pic no-deep case. + +2002-05-23 Richard Henderson + + * doc/extend.texi (C++98 Thread-Local Edits): Update with + commentary from Mark. + +2002-05-23 Zdenek Dvorak + + * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): + Use FOR_EACH_BB macros to iterate over basic block chain. + * cfg.c (clear_edges, clear_bb_flags, dump_flow_info, + alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges): + Likewise. + * cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add, + find_unreachable_blocks, create_edge_list, verify_edge_list, + remove_fake_edges, add_noreturn_fake_exit_edges, + flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute): + Likewise. + * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, + find_sub_basic_blocks): Likewise. + * cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks): + Likewise. + * cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps): + Likewise. + * cfgloop.c (flow_loops_cfg_dump, flow_loops_find): + Likewise. + * cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges, + commit_edge_insertions, commit_edge_insertions_watch_calls, + print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise. + * combine.c (combine_instructions, reg_dead_at_p): Likewise. + * conflict.c (conflict_graph_compute): Likewise. + * df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, + df_modified_p, df_refs_unlink, df_dump): Likewise. + * dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise. + * final.c (compute_alignments): Likewise. + * flow.c (update_life_info, update_life_info_in_dirty_blocks, + delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data, + count_or_remove_death_notes): Likewise. + * gcse.c (oprs_unchanged_p, record_last_reg_set_info, + compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill, + classic_gcse, compute_transp, cprop, compute_pre_data, + compute_transpout, invalidate_nonnull_info, + delete_null_pointer_checks_1, delete_null_pointer_checks, + compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems, + compute_store_table, build_store_vectors, store_motion): Likewise. + * global.c (global_conflicts, mark_elimination): Likewise. + * graph.c (print_rtl_graph_with_bb): Likewise. + * haifa-sched.c (sched_init): Likewise. + * ifcvt.c (if_convert): Likewise. + * lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete, + compute_available, compute_nearerout, compute_rev_insert_delete, + optimize_mode_switching): Likewise. + * local-alloc.c (local_alloc, update_equiv_regs): Likewise. + * predict.c (estimate_probability, note_prediction_to_br_prob, + propagate_freq, counts_to_freqs, expensive_function_p, + estimate_bb_frequencies): Likewise. + * profile.c (instrument_edges, get_exec_counts, + compute_branch_probabilities, compute_checksum, branch_prob, + find_spanning_tree): Likewise. + * recog.c (split_all_insns, peephole2_optimize): Likewise. + * reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs): + Likewise. + * regclass.c (scan_one_insn, regclass): Likewise. + * regmove.c (mark_flags_life_zones, regmove_optimize, + record_stack_memrefs): Likewise. + * regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise. + * reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise. + * resource.c (find_basic_block): Likewise. + * sched-ebb.c (schedule_ebbs): Likewise. + * sched-rgn.c (is_cfg_nonregular, build_control_flow, + find_single_block_region, find_rgns, schedule_insns) + * sibcall.c (optimize_sibling_and_tail_recursive_call) + * ssa-ccp.c (optimize_unexecutable_edges, + ssa_ccp_df_delete_unreachable_insns): Likewise. + * ssa-dce.c (ssa_eliminate_dead_code): Likewise. + * ssa.c (find_evaluations, compute_dominance_frontiers_1, + rename_block, convert_to_ssa, compute_conservative_reg_partition, + compute_coalesced_reg_partition, rename_equivalent_regs, + convert_from_ssa): Likewise. + * config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue, + process_for_unwind_directive): Likewise. + + * df.c (FOR_ALL_BBS): Removed. + * gcse.c (struct null_pointer_info): Type of current_block field + changed. + (struct reg_avail_info): Type of last_bb field changed. + * config/ia64/ia64.c (block_num): Removed. + (need_copy_state): Type changed. + (last_block): New. + +2002-05-23 Neil Booth + + * cppinit.c (mark_named_operators): Split out from init_builtins. + (cpp_finish_options): Call it from here instead. + +2002-05-23 Jason Thorpe + + * builtin-attrs.def: Update copyright years. + (ATTR_NONNULL): New attribute identifier. + (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): New + attribute tree lists. + (DEF_FORMAT_ATTRIBUTE): Chain a nonnull attribute for the + format operand. + (ATTR_FORMAT_ARG_1, ATTR_FORMAT_ARG_2): Use... + (DEF_FORMAT_ARG_ATTRIBUTE): ...this to generate format_arg + attribute lists. Chain the appropriate nonnull attribute. + * c-format.c (check_format_arg): Remove null format string + warning. + * testsuite/gcc.dg/format/null-1.c: New test. + +2002-05-23 Rainer Orth + + * Makefile.in (ADAC): Define. + (SYSLIBS): Define. + (.SUFFIXES): Move before language makefile fragments. + (STAGE2_FLAGS_TO_PASS): Use stage CC as ADAC. + +2002-05-23 Mark Mitchell + + * varasm.c (make_decl_rtl): Don't allow weak variables to be + placed in common. + +Thu May 23 19:43:41 CEST 2002 Jan Hubicka + + * cfg.c (dump_flow_info): Print results of + maybe_hot/probably_never_executed predicates. + * toplev.c (open_dump_file): Print function frequency. + +2002-05-23 David S. Miller + + * cse.c (approx_reg_cost_1, approx_reg_cost): Recode to not use + regsets. + +2002-05-23 Jason Thorpe + + * c-common.c (warn_nonnull): Declare. + (c_common_attribute_table): Add "nonnull" attribute. + (handle_nonnull_attribute, check_function_nonnull, nonnull_check_p, + check_nonnull_arg, get_nonnull_operand, check_function_arguments, + check_function_arguments_recurse): New functions. + * c-common.h (warn_nonnull): Declare extern. + (check_function_arguments, check_function_arguments_recurse): New + prototypes. + * c-decl.c (c_decode_option): Add -Wnonnull option. + * c-format.c (set_Wformat): Set warn_nonnull if enabling + format checking. + (format_check_context): New structure. + (check_format_info_recurse): Remove recursion and rename to... + (check_format_arg): ...this. Update comment. + (check_format_info): Use check_function_arguments_recurse. + * c-typeck.c (build_function_call): Call check_function_arguments + instead of check_function_format. + * doc/extend.texi: Document "nonnull" attribute. + * doc/invoke.texi: Docuemnt -Wnonnull option. + * testsuite/gcc.dg/nonnull-1.c: New test. + * testsuite/gcc.dg/nonnull-2.c: New test. + +2002-05-23 David S. Miller + + * basic-block.h (CLEANUP_NO_INSN_DEL): Define it. + * cfgcleanup.c (cleanup_cfg): If it is set do not + attempt to delete trivially dead insns. + * except.c (finish_eh_generation): Pass it to cleanup_cfg. + * toplev.c (rest_of_compilation): Document non-trivial aspect + the RTL before optimize_save_area_alloca is run. + +2002-05-23 Neil Booth + + * c-lex.c (indent_level): Remove. + (cb_file_change, c_lex): Remove indent level handling. + * c-lex.h (indent_level): Remove. + * input.h (struct file_stack): Remove indent_level. + * toplev.c (push_srcloc): Remove indent_level handling. + +2002-05-23 Jakub Jelinek + + PR target/6753 + * config/i386/i386.md (sse_movdfcc, sse_movdfcc_eq): Use Y instead + of x in constraints for clarity. + (sse_mov?fcc split): abort if op2 == op3. + (sse_movsfcc_const0_1, sse_movsfcc_const0_2, sse_movsfcc_const0_3, + sse_movsfcc_const0_4): Add earlyclobber. + (sse_movdfcc_const0_1, sse_movdfcc_const0_2, sse_movdfcc_const0_3, + sse_movdfcc_const0_4): Likewise. Use DFmode, not SFmode. + Use Y instead of x in constraints. + +2002-05-23 Richard Henderson + + * doc/extend.texi (C99 Thread-Local Edits): New subsection. + (C++98 Thread-Local Edits): New subsection. + + * config/i386/i386.c, config/i386/i386.h: Tidy comments and whitespace. + (ix86_arch): Set type to enum processor_type. + + * config/i386/i386.md (movsi_1, movdi_1_rex64): Use + LEGITIMATE_PIC_OPERAND_P not SYMBOLIC_CONST. + +2002-05-23 Jakub Jelinek + + * configure.in: Fix as version test for binutils 2.12.1 releases + (without dates). + * configure: Rebuilt. + +2002-05-23 Richard Henderson + + * config/i386/i386.c (get_pic_label_name): New. + (load_pic_register): Remove. + (output_set_got): New. + (ix86_expand_prologue): Use gen_set_got; mark insn REG_MAYBE_DEAD. + * config/i386/i386.md (UNSPEC_SET_GOT): New. + (UNSPECV_PROLOGUE_SET_GOT, UNSPECV_PROLOGUE_GET_PC): Remove. + (prologue_set_got, prologue_get_pc): Remove. + (set_got, set_got_nopic, set_got_deep, set_got_nodeep): New. + (builtin_setjmp_receiver): Use gen_set_got. + * config/i386/i386-protos.h: Update. + +Thu May 23 09:22:23 CEST 2002 Jan Hubicka + + * gcse.c (hash_expr): Do not use alias set for hashing. + +2002-05-22 Kevin Buettner + + * dbxout.c (dbxout_class_name_qualifiers): New function. + (dbxout_symbol): Output class/struct qualifiers for a .stabs entry. + +2002-05-23 Neil Booth + + * cpperror.c (_cpp_begin_message): No special casing + of CPP_FATAL_LIMIT. + * cppinit.c (sanity_checks): s/DL_FATAL/DL_ICE/. + (output_deps, cpp_handle_option, cpp_post_options): Use DL_ERROR. + * cpplib.c (do_include_common): Use DL_ERROR. + * cpplib.h (CPP_FATAL_LIMIT, CPP_FATAL_ERRORS, DL_FATAL): Remove. + (DL_ICE): Renumber. + * fix-header.c (read_scan_file): Update. + +2002-05-22 Richard Henderson + + * config/i386/i386.c (ix86_expand_call): New function, extracted + from md call patterns. Add pic_offset_table_rtx to + CALL_INSN_FUNCTION_USAGE when needed. + * config/i386/i386.md (call_pop, call): Use ix86_expand_call. + (call_value_pop, call_value, untyped_call): Likewise. + (call_exp, call_value_exp): Remove. + * config/i386/i386-protos.h: Update. + +2002-05-22 Richard Henderson + + * varasm.c (default_section_type_flags): Check for VAR_DECL + before using DECL_THREAD_LOCAL. + +2002-05-22 David Edelsohn + + * config/rs6000/aix43.h (LINK_SPEC): Add PE initializer. + (STARTFILE_SPEC): Delete PE crt0.o. + * config/rs6000/aix51.h: Same. + * config/rs6000/rs6000.c: Use TARGET_XCOFF, not OBJECT_FORMAT_COFF. + * config/rs6000/rs6000.h (ASM_WEAKEN_DECL): Append [DS] to + function descriptor symbol. Use RS6000_OUTPUT_BASENAME. + (ASM_OUTPUT_DEF_FROM_DECLS): Use RS6000_OUTPUT_BASENAME. + * config/rs6000/xcoff.h (ASM_OUTPUT_DEF): Define. + +2002-05-22 Richard Henderson + + * varasm.c (default_section_type_flags): Handle tls data and + default sections. + (default_unique_section): Handle tls sections. + +2002-05-23 Alan Modra + + * configure.in (CROSS): Define NATIVE_CROSS. + * configure: Regenerate. + * gcc.c (STARTFILE_PREFIX_SPEC): Define. + (startfile_prefix_spec): New var. + (static_specs): Add startfile_prefix_spec. + (do_spec_2): Split out from.. + (do_spec): ..here. + (main): Process startfile_prefix_spec. + * config/rs6000/linux64.h (LINK_OS_LINUX_SPEC) Change name of + dynamic linker. + (STARTFILE_PREFIX_SPEC): Define. + (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Rewrite without + absolute paths. + +2002-05-22 Kazu Hirata + + * cpperror.c: Fix formatting. + * cppexp.c: Likewise. + * cppfiles.c: Likewise. + * cpphash.c: Likewise. + * cpphash.h: Likewise. + * cppinit.c: Likewise. + * cpplex.c: Likewise. + * cpplib.c: Likewise. + * cppmacro.c: Likewise. + * cppmain.c: Likewise. + * cppspec.c: Likewise. + +2002-05-22 Jakub Jelinek + + * combine.c (force_to_mode): Use gen_int_mode. + Don't clear CONST_INT bits outside of mode. + +2002-05-22 Richard Henderson + + * fixinc/inclhack.def (thread_keyword): Match __thread as last arg. + * fixinc/fixincl.x, fixinc/tests/base/pthread.h: Rebuild. + +2002-05-22 Jakub Jelinek + + PR c/6643 + * emit-rtl.c (widen_memory_access): Only call compare_tree_int + if DECL_SIZE_UNIT is INTEGER_CST. + +2002-05-22 Richard Henderson + + * flow.c (life_analysis): Delete broken reg_label check. + +2002-05-22 Richard Henderson + + * fixinc/inclhack.def (thread_keyword): Allow as any prototype arg. + * fixinc/fixincl.x, fixinc/tests/base/pthread.h: Rebuild. + +Wed May 22 18:39:57 2002 J"orn Rennecke + + * t-sh (LIB2FUNCS_EXTRA): Now embed-bb.c. + (embed-bb.c): New rule. + * t-sh64 (LIB2FUNCS_EXTRA): Don't change. + * config/sh/embed_bb.c: Delete. + +Wed May 22 18:25:29 2002 J"orn Rennecke + + * c-common.c (cb_register_builtins): Don't indent '#' of #define. + +2002-05-22 Kazu Hirata + + * config/h8300/h8300.md (*andorqi3): New. + +2002-05-22 Neil Booth + + PR preprocessor/6517 + * Makefile.in: Update. + * c-common.c (c_common_post_options): Add preprocessor + errors to the error count. + * c-lang.c (c_post_options): Kill. + (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options. + * hooks.h: Add header guards. + * langhooks-def.h: Include hooks.h. + (LANG_HOOKS_POST_OPTIONS): Update. + * langhooks.h (struct lang_hooks): Update post_options. + * toplev.c (parse_options_and_default_flags): Update. +objc: + * objc-lang.c (objc_post_options): Kill. + (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options. + +2002-05-21 Bruce Korb + + * fixinc/tests/base/pthread.h(THREAD_KEYWORD_CHECK): add fix check + * fixinc/inclhack.def(thread_keyword): use c_fix = format. + * fixinc/fixincl.x: regen. + +2002-05-21 Kazu Hirata + + * cfgbuild.c: Fix formatting. + * cfg.c: Likewise. + * cfgcleanup.c: Likewise. + * cfglayout.c: Likewise. + * cfgloop.c: Likewise. + * cfgrtl.c: Likewise. + +2002-05-21 Richard Henderson + + * c-common.h (enum rid): Add RID_THREAD. + * c-decl.c (start_decl): Do not set DECL_COMMON for tls variables. + (grokdeclarator): Grok __thread. + * c-parse.in (reswords): Add __thread. + (rid_to_yy): Add RID_THREAD. + + * tree.h (DECL_THREAD_LOCAL): New. + (struct tree_decl): Add thread_local_flag. + * print-tree.c (print_node): Dump DECL_THREAD_LOCAL. + * tree.c (staticp): TLS variables are not static. + + * target-def.h (TARGET_HAVE_TLS): New. + * target.h (have_tls): New. + * output.h (SECTION_TLS): New. + * varasm.c (assemble_variable): TLS variables can't be common for now. + (default_section_type_flags): Handle .tdata and .tbss. + (default_elf_asm_named_section): Handle SECTION_TLS. + (categorize_decl_for_section): Handle DECL_THREAD_LOCAL. + + * flags.h (flag_tls_default): Declare. + * toplev.c (flag_tls_default): Define. + (display_help): Display help for it. + (decode_f_option): Set it. + + * doc/extend.texi (Thread-Local): New node describing language-level + thread-local storage. + * doc/invoke.texi (-ftls-model): Document. + + * fixinc/inclhack.def (thread_keyword): New. + * fixinc/fixincl.x: Rebuild. + +2002-05-21 Jeffrey A Law + + * optabs.c (expand_binop): For double-word integer multiplies, + do not compute intermediate results into something that is + not a register (such as a SUBREG or MEM). + + * i386.c (ix86_sched_reorder_ppro): Fix typo/thinko. + (ix86_sched_reorder): Make sure to initialize scheduling + data even when there's only one insn in the ready queue. + +2002-05-21 Vladimir Makarov + + * genautomata.c (reserv_sets_hash_value): Fix a typo. + +2002-05-21 Vladimir Makarov + + * genautomata.c (reserv_sets_hash_value): Define hash_value as + set_el_t. Transform the hash value into unsigned. + (output_cycle_reservs): Fix bug with output of repeated `nothing'. + (transform_3): Add code to process `(A,B)+(D,E)'. + +2002-05-21 NIIBE Yutaka + + * reload1.c (do_output_reload): Run delete_output_reload + only if optimizing. + +2002-05-21 Roger Sayle + + PR middle-end/6600 + * expr.c (STORE_MAX_PIECES): New macro to avoid immediate constants + larger than INTEGER_CST. (store_by_pieces_1): Use it here... + (can_store_by_pieces): ... and here to limit the largest mode used. + Add a comment to document this function. + +2002-05-21 Richard Henderson + + * flow.c (life_analysis): Fix test for deleted label. + +2002-05-21 Neil Booth + + * doc/tm.texi: Fix typo. + +2002-05-21 Zack Weinberg + + * c-common.c (c_common_init): Set options->unsigned_char from + flag_signed_char. + (cb_register_builtins): Define __STRICT_ANSI__ and + __CHAR_UNSIGNED__ here... + * cppinit.c (init_builtins): Not here. + (cpp_create_reader): unsigned_char option defaults to 0, not + !DEFAULT_SIGNED_CHAR. + (COMMAND_LINE_OPTIONS, cpp_handle_option): Lose -fsigned-char + and -funsigned-char. + + * cpphash.h (struct spec_nodes): Kill n__STRICT_ANSI__. + * cpphash.c (_cpp_init_hashtable): Don't set it. + * cppmacro.c (builtin_macro) [BT_STDC]: Use the language setting + directly. Clarify comment. + +2002-05-21 Zdenek Dvorak + + * bb-reorder.c (make_reorder_chain_1): Use prev_bb/next_bb to get to + neighboring basic blocks. Use ENTRY_BLOCK_PTR->next_bb instead of + BASIC_BLOCK (0). Use EXIT_BLOCK_PTR->prev_bb instead of + BASIC_BLOCK (n_basic_blocks - 1). + * cfganal.c (can_fallthru, flow_call_edges_add, + flow_preorder_transversal_compute): Too. + * cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks, + find_sub_basic_blocks): Too. + * cfgcleanup.c (try_simplify_condjump, try_optimize_cfg): Too. + * cfglayout.c (skip_insns_after_block, fixup_reorder_chain, + fixup_fallthru_exit_predecessor, cfg_layout_redirect_edge): Too. + * cfgrtl.c (tidy_fallthru_edges, verify_flow_info): Too. + * combine.c (this_basic_block): Type changed to basic_block. + (combine_instructions, set_nonzero_bits_and_sign_copies, try_combine, + nonzero_bits, num_sign_bit_copies, get_last_value_validate, + get_last_value, distribute_notes, distribute_links): Too. + * final.c (compute_alignments): Too. + * flow.c (regno_uninitialized, regno_clobbered_at_setjmp): Too. + * function.c (thread_prologue_and_epilogue_insns): Too. + * gcse.c (compute_code_hoist_vbeinout): Too. + * global.c (build_insn_chain): Too. + * ifcvt.c (find_if_block, find_cond_trap): Too. + * predict.c (last_basic_block_p, note_prediction_to_br_prob): Too. + * regmove.c (regmove_optimize): Too. + * resource.c (find_basic_block): Too. + * sched-ebb.c (schedule_ebbs): Too. + * ssa-dce.c (find_control_dependence, find_pdom): Too. + +2002-05-21 Andreas Jaeger + + * cppinit.c (sanity_checks): Avoid printf mismatch warnings. + +2002-05-21 Richard Henderson + + * reg-stack.c (swap_rtx_condition, subst_stack_regs_pat): Use + unspec names, not numbers. + +2002-05-21 Joseph S. Myers + + * doc/sourcebuild.texi: Mention snapshot-README and + snapshot-index.html as needing updating for new front ends. + +2002-05-21 Kaveh R. Ghazi + + * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): Avoid warnings when + disabling checking, and avoid multiple evaluation of RTX. + +2002-05-21 Richard Earnshaw + + * bitmap.c (bitmap_find_bit): Return early if we have the correct + element cached. + +Tue May 21 10:51:54 CEST 2002 Jan Hubicka + + * profile.c (gen_edge_profiler): Set alias set before the memory is + used. + +2002-05-20 David S. Miller + + * cselib.c (max_value_regs): New. + (cselib_lookup, cselib_invalidate_regno): Initialize it when + adding new entries to the REG_VALUES table and we are dealing with + a hard register. + (clear_table): Initialize it. + (cselib_invalidate_regno): Use it to determine which hard + registers to scan when mode is not VOIDmode. + +2002-05-20 Duraid Madina + + * tradcpp.c (fixup_newlines): Use old-style function header. + +2002-05-20 Krister Walfridsson + + * reload1.c (reload_cse_simplify): Fix typo in rtx code check. + +2002-05-20 H.J. Lu (hjl@gnu.org) + + Base on suggestions from Zhang Fuxin : + + * config/mips/mips.h (DFMODE_NAN): Defined. + (SFMODE_NAN): Likewise. + +2002-05-20 Dale Johannesen + + * combine.c (cant_combine_insn_p): Back out my + previous patch. + +2002-05-20 Kazu Hirata + + * params.c: Fix formatting. + * params.h: Likewise. + * predict.c: Likewise. + * prefix.c: Likewise. + * print-rtl.c: Likewise. + * print-tree.c: Likewise. + * profile.c: Likewise. + +2002-05-20 H.J. Lu (hjl@gnu.org) + + * gcc/config/mips/linux.h (SDB_DEBUGGING_INFO): Undefine. + +2002-05-20 Nick Clifton + + * config/arm/arm-wince-pe.h (ASM_SPEC): Pass -mcpu and -march + switches straight on to the assembler, do not abbreviate them. + * config/arm/elf.h (ASM_SPEC): As above. + * config/arm/semi.h (ASM_SPEC): As above. + * config/arm/unknown-elf-oabi.h (ASM_SPEC): As above. + * config/arm/xscale-coff.h (SUBTARGET_ASM_SPEC): Pass + -mcpu=xscale on to the assembler by default. + * config/arm/xscale-elf.h (SUBTARGET_ASM_SPEC): As above. + +2002-05-20 Richard Henderson + + * cse.c (canon_hash): Reorder do_not_record test. Always + allow pic_offset_table_rtx. + +2002-05-19 Toon Moene + + * optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p. + (expand_binop): Ditto (3 times). + +2002-05-19 Mark Mitchell + + * Makefile.in (distclean): Remove QMTest stuff. + (QMTEST_PATH): New variable. + (QMTESTFLAGS): Likewise. + (QMTESTRUNFLAGS): Likewise. + (QMTEST): Likewise. + (QMTEST_GPP_TESTS): Likewise. + (QMTEST_DIR): Likewise. + (QMTEST_DIR/context): New target. + (qmtest-g++): Likeise. + (qmtest-gui): Likewise. + (QMTEST_DIR/gpp-expected.qmr): Likewise. + +2002-05-19 Aldy Hernandez + + * config/rs6000/rs6000.h (FUNCTION_VALUE): Only return vectors in + an altivec register if TARGET_ALTIVEC. + + * config/rs600/rs6000.c (rs6000_emit_move): Change VECTOR_MODE_P + to ALTIVEC_VECTOR_MODE. + (rs6000_va_arg): Only vectors of type AltiVec are 16 byte aligned. + (rs6000_va_arg): Vectors may go in registers if they are not + altivec vectors. + +2002-05-19 Kazu Hirata + + * protoize.c: Fix formatting. + +2002-05-19 Richard Henderson + + * gensupport.c (init_include_reader): Merge into ... + (process_include): ... here. Simplify composite path creation. + Plug memory leaks. Fix file/line number tracking. Do not + process_define_cond_exec. Return void. + (process_rtx): Don't check process_include return value. + +2002-05-20 Zdenek Dvorak + + * basic_block.h (struct basic_block_def): Added prev_bb and next_bb + fields. + (FOR_BB_BETWEEN, FOR_ALL_BB, FOR_ALL_BB_REVERSE): New macros for + traversing basic block chain. + (create_basic_block_structure, create_basic_block): Declaration changed. + (link_block, unlink_block): Declare. + * cfg.c (entry_exit_blocks): Initialize new fields. + (link_block, unlink_block): New. + (expunge_block_nocompact): Unlink basic block. + (dump_flow_info): Print prev_bb/next_bb fields. + * cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Modified. + * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Modified. + * cfglayout.c (fixup_reorder_chain, cfg_layout_duplicate_bb): Modified. + * cfgrtl.c (create_basic_block_structure, create_basic_block, + split_block, force_nonfallthru_and_redirect, split_edge): Modified. + (verify_flow_info): Check that list agrees with numbering. + +2002-05-19 Neil Booth + + * c-common.c (preprocessing_asm): New macro. + * c-lex.h (builtin_define, builtin_assert): Use pfile. +doc: + * tm.texi: Update. +config/alpha: + * alpha.h (CPLUSPLUS_CPP_SPEC): Remove. + (CPP_SPEC): Simplify. + (TARGET_CPU_CPP_BUILTINS): Update. + * freebsd.h (TARGET_OS_CPP_BUILTINS): New. + (CPP_SPEC): Simplify. + * linux.h (CPLUSPLUS_CPP_SPEC): Remove. + (TARGET_OS_CPP_BUILTINS): Update. + * osf.h (CPP_XFLOAT_SPEC): Kill. + (TARGET_OS_CPP_BUILTINS): Update. + (CPP_SUBTARGET_SPEC, SUBTARGET_EXTRA_SPECS): Simplify. + * osf5.h (CPP_XFLOAT_SPEC): Kill. + * vms.h (CPP_SUBTARGET_SPEC): Kill. + (TARGET_OS_CPP_BUILTINS): Update. + +2002-05-19 Richard Henderson + + * varasm.c (default_binds_local_p): Fix typo. + +2002-05-19 Marek Michalkiewicz + + * config/avr/avr.c (machine_dependent_reorg): Sign extend the + CONST_INT operand to the correct mode after adding 1 to it. + +2002-05-19 Mark Mitchell + + * config.gcc (powerpc-wrs-windiss*): New target. + +2002-05-19 Franz Sirl + + * config/rs6000/rs6000.md (ashrdi3_no_power): New. + (ashrdi3): Use it. + +2002-05-18 Mark Mitchell + + * configure.in (AC_CHECK_FUNCS): Add checks for scandir and + alphasort. + * config.in: Regenerated. + * configure: Regenerated. + +2002-05-19 Richard Henderson + + * target-def.h (TARGET_BINDS_LOCAL_P): New. + * target.h (struct gcc_target): Move boolean fields to the end. + Add binds_local_p. + * varasm.c (default_binds_local_p): New. + * output.h: Declare it. + + * config/alpha/alpha.c (alpha_encode_section_info): Use the new hook. + * config/cris/cris.c (cris_encode_section_info): Likewise. + * config/i386/i386.c (i386_encode_section_info): Likewise. + * config/ia64/ia64.c (ia64_encode_section_info): Likewise. + * config/sh/sh.c (sh_encode_section_info): Likewise. + + * doc/tm.texi (TARGET_IN_SMALL_DATA_P): New. + (TARGET_BINDS_LOCAL_P): New. + +2002-05-19 Richard Henderson + + * system.h (BLOCK_PROFILER, BLOCK_PROFILER_CODE, + FUNCTION_BLOCK_PROFILER, FUNCTION_BLOCK_PROFILER_EXIT, + MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Poison. + + * toplev.c (display_help): Kill -a -ax help. + + * config/1750a/1750a.h, config/alpha/alpha.h, + config/clipper/clipper.h, config/dsp16xx/dsp16xx.h, + config/h8300/h8300.h, config/i960/i960.h, config/m68k/tower-as.h, + config/m88k/m88k.h, config/vax/vax.h, config/we32k/we32k.h: + (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): Kill. + + * libgcc2.c [L_bb] (BLOCK_PROFILER_CODE): Kill. + * config/m68k/sun3.h (BLOCK_PROFILER_CODE): Kill. + + * config/i386/i386-protos.h (ix86_output_block_profiler): Kill. + (ix86_output_function_block_profiler): Kill. + * config/m68hc11/m68hc11.c (m68hc11_block_profiler): Kill. + (m68hc11_function_block_profiler): Kill. + * config/m68hc11/m68hc11-protos.h: Update. + * config/m88k/m88k.c (output_block_profiler): Kill. + (output_function_block_profiler): Kill. + * config/m88k/m88k-protos.h: Update. + +2002-05-19 Richard Henderson + + * system.h (STRIP_NAME_ENCODING): Poison it. + * output.h (STRIP_NAME_ENCODING): Remove. + (default_strip_name_encoding): Declare. + * target-def.h (TARGET_STRIP_NAME_ENCODING): New. + * target.h (strip_name_encoding): New. + * varasm.c (default_strip_name_encoding): New. + + * dwarf2asm.c, varasm.c, config/darwin.c, config/darwin.h, + config/alpha/alpha.c, config/arm/pe.c, config/avr/avr.c, + config/cris/cris.c, config/i386/cygwin.h, config/i386/interix.c, + config/i386/winnt.c, config/m32r/m32r.h, config/mcore/mcore-elf.h, + config/mcore/mcore-pe.h, config/mcore/mcore.c, config/mcore/mcore.h, + config/mips/mips.c, config/mn10200/mn10200.h, config/mn10300/mn10300.h, + config/pa/pa.c, config/pa/pa.h, config/pa/som.h, + config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, + config/v850/v850.h: Use the hook, not the macro. + + * config/darwin-protos.h, config/darwin.c, config/darwin.h, + config/alpha/alpha.c, config/alpha/alpha.h, config/h8300/h8300.c, + config/h8300/h8300.h, config/i386/cygwin.h, config/i386/i386-interix.h, + config/i386/i386-protos.h, config/i386/win32.h, config/i386/winnt.c, + config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, + config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, + config/pa/pa.c, config/rs6000/rs6000.c, config/rs6000/sysv4.h, + config/rs6000/xcoff.h, config/sh/sh.c, config/sh/sh.h, + config/v850/v850.c, config/v850/v850.h: + Move STRIP_NAME_ENCODING to out-of-line function and add + TARGET_STRIP_NAME_ENCODING. + + * config/arm/arm.c, config/arm/arm.h, config/mmix/mmix-protos.h, + config/mmix/mmix.c, config/mmix/mmix.h: Replace STRIP_NAME_ENCODING + with TARGET_STRIP_NAME_ENCODING referencing existing function; + make function static. + + * xcoffout.c: Include target.h + * Makefile.in (xcoffout.o): Update. + + * config/avr/avr.c (avr_encode_section_info): Correct prototype. + * config/avr/avr.h (STRIP_NAME_ENCODING): Remove. + * config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Mark + reloc argument unused. + * config/sh/sh.c (TARGET_ENCODE_SECTION_INFO): New. + + * doc/tm.texi (TARGET_STRIP_NAME_ENCODING): Update from previous + STRIP_NAME_ENCODING docs. + +2002-05-19 Andreas Jaeger + + * gengenrtl.c: Add prototype for excluded_rtx. + + * real.h: Add prototype for exact_real_truncate. + +2002-05-18 Richard Henderson + + * system.h (ENCODE_SECTION_INFO): Poison it. + * target-def.h (TARGET_ENCODE_SECTION_INFO): New. + * target.h (encode_section_info): New. + * varasm.c (make_decl_rtl, output_constant_def): Use it. + * hooks.c (hook_tree_int_void): New. + * hooks.h: Declare it. + + * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, + config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, + config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, + config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, + config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, + config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, + config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, + config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, + config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, + config/mcore/mcore-protos.h, config/mcore/mcore.c, + config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, + config/mmix/mmix.h, config/rs6000/rs6000-protos.h, + config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, + config/stormy16/stormy16.c, config/stormy16/stormy16.h: + Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO + referencing existing function. Make function static. + + * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, + config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, + config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, + config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, + config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, + config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, + config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, + config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, + config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, + config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, + config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, + config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, + config/xtensa/xtensa.c, config/xtensa/xtensa.h: + Move ENCODE_SECTION_INFO to out-of-line function and add + TARGET_ENCODE_SECTION_INFO. + + * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. + (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. + + * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename + from SUBTARGET_* + (switch_to_section): Replace in_rdata case with in_readonly_data. + + * config/h8300/h8300.c (h8300_encode_label): Make static. + * config/h8300/h8300-protos.h: Update. + + * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename + from rs6000_encode_section_info; make static. + (rs6000_xcoff_encode_section_info): New. + + * config/v850/v850.c (v850_encode_data_area): Make static. + * config/v850/v850-protos.h: Update. + + * config/vax/vax.c: Include flags.h. + (vms_select_section): Fix typo. + + * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous + ENCODE_SECTION_INFO docs. + +2002-05-18 Richard Henderson + + * config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): Rename from + REGISTER_TARGET_PRAGMAS. + * config/rs6000/darwin.h (REGISTER_TARGET_PRAGMAS): Redefine. + + * config.gcc: Do not use rs6000-c.c on powerpc-darwin. + +2002-05-18 Richard Henderson + + * system.h (SELECT_RTX_SECTION): Poison. + * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. + * target.h (select_rtx_section): New. + * varasm.c (output_constant_pool): Use it. + (default_select_rtx_section, default_elf_select_rtx_section): New. + * output.h: Declare them. + + * config/darwin.h (SELECT_RTX_SECTION): Move ... + * config/darwin.c (machopic_select_rtx_section): ... here. + * config/darwin-protos.h: Update. + + * config/nextstep.h (SELECT_RTX_SECTION): Move ... + * config/nextstep.c (machopic_select_rtx_section): ... here. + (nextstep_select_section): Rename variable to avoid macro clash. + * config/nextstep-protos.h: Update. + + * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, + config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, + config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, + config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, + config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, + config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, + config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, + config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, + config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h + (SELECT_RTX_SECTION): Remove. + + * config/darwin.h, config/elfos.h, config/nextstep.h, + config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, + config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, + config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, + config/sparc/lynx.h, config/xtensa/xtensa.c + (TARGET_ASM_SELECT_RTX_SECTION): New. + + * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... + * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. + * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... + * config/ia64/ia64.c (ia64_select_rtx_section): ... here. + (ia64_aix_select_rtx_section): New. + * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before + redefining. + * config/mips/mips.c (mips_select_rtx_section): Make static. + Support ELF SHF_MERGE features. + * config/mips/mips-protos.h: Update. + * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... + * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. + (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; + make static, fall back to default_elf_select_rtx_section. + * config/rs6000/rs6000-protos.h: Update. + * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... + * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. + * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. + * config/romp/romp.c (romp_select_rtx_section): New. + * config/s390/s390.c (s390_select_rtx_section): New. + * config/xtensa/xtensa.c: Include output.h. Shuffle local function + declarations before target macro definition. + (xtensa_emit_call): Use static buffer. + (xtensa_select_rtx_section): New. + * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. + (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. + (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. + + * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from + SELECT_RTX_SECTION docs. + +Sun May 19 00:24:23 CEST 2002 Jan Hubicka + + * i386.md (movsi/movdi): Fix template. + (sse2 patterns): Set attributes consistently. + + * i386.md (pushqi2, ashrqi_*): Fix constraint. + +2002-05-18 Toon Moene + + * optabs.c (complex_part_zero_p): New. + * (expand_cmplxdiv_straight): Use it. + * (expand_cmplxdiv_wide): Ditto. + * (expand_binop): Ditto. + +2002-05-18 Richard Henderson + + * final.c (HAVE_READONLY_DATA_SECTION): New. + (shorten_branches): Use it instead of ifdefs. + * varasm.c (enum in_section): Add in_readonly_data. + (text_section, data_section): Tidy. + (readonly_data_section): Use READONLY_DATA_SECTION_ASM_OP if present. + + * config/darwin.h, config/nextstep.h, config/h8300/elf.h, + config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h + (READONLY_DATA_SECTION): Don't undef. + + * config/alpha/unicosmk.h, config/h8300/elf.h, config/i386/aix386ng.h, + config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h, + config/rs6000/lynx.h (READONLY_DATA_SECTION_ASM_OP): Undef. + + * config/elfos.h, config/svr3.h, config/alpha/alpha-interix.h, + config/alpha/elf.h, config/c4x/c4x.h, config/i386/i386-interix.h, + config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, + config/m88k/m88k.h, config/pa/pa64-hpux.h (USE_CONST_SECTION): Remove. + + * config/elfos.h, config/netware.h, config/alpha/alpha-interix.h, + config/alpha/elf.h, config/alpha/vms.h, config/arc/arc.h, + config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, + config/i386/dgux.h, config/i386/i386-interix.h, config/i386/sco5.h, + config/ia64/hpux.h, config/m32r/m32r.h, config/m68k/tower-as.h, + config/m88k/m88k.h, config/mcore/mcore-pe.h, config/mips/iris6.h, + config/mips/mips.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, + config/sparc/sysv4.h (READONLY_DATA_SECTION_ASM_OP): Rename from + CONST_SECTION_ASM_OP/READONLY_SECTION_ASM_OP/RDATA_SECTION_ASM_OP. + + * config/elfos.h, config/netware.h, config/1750a/1750a.h, + config/a29k/a29k.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, + config/arm/coff.h, config/h8300/h8300.h, config/i386/aix386ng.h, + config/i386/i386-interix.h, config/i386/osfrose.h, config/mmix/mmix.h, + config/pa/pa64-hpux.h, config/sparc/litecoff.h + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. + + * config/elfos.h, config/netware.h, config/svr3.h, + config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, + config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, + config/h8300/h8300.h, config/i386/i386-interix.h, + config/i386/osfrose.h, config/i386/svr3gas.h, config/mmix/mmix.h, + config/pa/pa64-hpux.h (READONLY_DATA_SECTION): Remove. + + * config/elfos.h, config/netware.h, config/svr3.h, + config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, + config/c4x/c4x.h, config/i386/aix386ng.h, config/i386/i386-interix.h, + config/i386/sco5.h, config/i386/svr3gas.h, config/mmix/mmix.h, + config/pa/pa64-hpux.h (CONST_SECTION_FUNCTION): Remove. + + * config/lynx.h, config/svr3.h, config/alpha/elf.h, config/alpha/vms.h, + config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/sco5.h, + config/i386/svr3gas.h, config/i860/sysv3.h, config/i860/sysv4.h, + config/ia64/sysv4.h, config/m32r/m32r.h, config/m88k/m88k.h, + config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mips/elf.h, + config/mips/elf64.h, config/mips/iris6.h, config/mips/linux.h, + config/mips/mips.h, config/mips/rtems64.h, config/mips/vxworks.h, + config/rs6000/sysv4.h, config/v850/v850.h + (EXTRA_SECTIONS): Remove in_const/in_rdata. + (EXTRA_SECTION_FUNCTIONS): Remove accompanying function. + + * config/svr3.h, config/c4x/c4x.h, config/i386/dgux.h, + config/i386/sco5.h, config/i386/svr3gas.h, config/ia64/aix.h, + config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mmix/mmix.h, + config/sparc/sysv4.h (SELECT_RTX_SECTION): Use readonly_data_section. + * config/alpha/alpha.c (alpha_start_function): Likewise. + (alpha_write_linkage): Likewise. + * config/m32r/m32r.c (m32r_select_section): Likewise. + * config/m88k/m88k.c (m88k_select_section): Likewise. + * config/mips/mips.c (mips_select_rtx_section): Likewise. + * config/rs6000/rs6000.c (rs6000_select_rtx_section): Likewise. + (rs6000_elf_select_section): Likewise. + * config/v850/v850.c (v850_select_section): Likewise. + + * config/1750a/1750a.h, config/i860/sysv3.h + (READONLY_DATA_SECTION_ASM_OP): New. + READONLY_DATA_SECTION_ASM_OP. + * config/i386/interix.c, config/i386/winnt.c + (i386_pe_unique_section): Always use .rdata prefix. + * config/pa/som.h (readonly_data): Always switch to read-only section. + (READONLY_DATA_SECTION): Predicate on flag_pic. + * config/we32k/we32k.h (READONLY_DATA_SECTION): Remove parenthesis. + * doc/tm.texi (READONLY_DATA_SECTION_ASM_OP): New. + (READONLY_DATA_SECTION): Update. + +2002-05-18 Jason Thorpe + + * c-common.c (c_common_post_options): Warn if -Wformat-zero-length + is used without -Wformat. + * c-common.h (warn_format_zero_length): Declare extern. + * c-decl.c (warn_options): Add "format-zero-length". + * c-format.c (warn_format_zero_length): Declare. + (set_Wformat): Set warn_format_zero_length for -Wformat. + (check_format_info): Only warn about zero-length formats if + warn_format_zero_length is true. Include the format type + name in the warning message. + * doc/invoke.texi: Document -Wformat-zero-length. + * testsuite/gcc.dg/format/zero-length-1.c: New test. + +2002-05-18 Kazu Hirata + + * timevar.c: Fix formatting. + * tlink.c: Likewise. + * toplev.c: Likewise. + * tree-dump.c: Likewise. + * tree-inline.c: Likewise. + +2002-05-18 Neil Booth + + * cppinit.c (cpp_post_options): If preprocessed, turn off + traditional. If traditional, turn off column numbers. + * cpplib.c (cpp_push_buffer): Lex from stage 3 if traditional. + * cpptrad.c (handle_newline): Update line_base. + (skip_comment): Handle -Wcomment. + +2002-05-17 Zack Weinberg + + * cppinit.c (struct builtin): Remove unused fields. + (CPLUS, BUILTIN, OPERATOR, O, builtin_array_end): Kill. + (operator_array): New - was second half of builtin_array. + (init_builtins): Simplify loop over builtin_array/operator_array. + +2002-05-18 Neil Booth + + * defaults.h (UNIQUE_SECTION): Remove. + * system.h (UNIQUE_SECTION, SELECT_SECTION): Poison. + +2002-05-17 Richard Henderson + + * expr.c (init_expr_once): Don't use start/end_sequence. + Use rtx_alloc instead of emit_insn. + * toplev.c (lang_dependent_init): Run init_expr_once here ... + (lang_independent_init): ... not here. + +2002-05-17 Jason Thorpe + + * config/sh/lib1funcs.asm (GLOBAL): Use __USER_LABEL_PREFIX__. + +2002-05-17 Marek Michalkiewicz + + * config/avr/avr.c (avr_regs_to_save): New function. Also check + for fixed registers, possibly used for global register variables. + (initial_elimination_offset, avr_output_function_prologue, + avr_output_function_epilogue): Move common code to avr_regs_to_save. + +2002-05-17 Neil Booth + + * Makefile.in: Update for cpptrad.c. + * cpphash.h (struct cpp_buffer): New members for buffer + overlays. + (struct cpp_reader): New members for traditional output. + (_cpp_read_logical_line, _cpp_overlay_buffer): New. + * cppinit.c (cpp_create_reader): Set trad_line. + (cpp_destroy): Free trad_out_base if used. + (cpp_read_main_file): Overlay an empty buffer if traditional. + (cpp_finish_options): Don't do builtins. + (COMMAND_LINE_OPTIONS): Add -traditional-cpp. + (cpp_handle_option): Handle it. + * cpplex.c (continue_after_nul): New. + (_cpp_lex_direct): Use handle_nul. + * cpplib.h (struct cpp_options): New traditional option. + * cpptrad.c: New file. + +2002-05-17 Neil Booth + + * c-common.c (c_common_init_options): Use C89 for Objective-C, + and set the options flag. + * cppinit.c (lang_flags): Remove objc. + (lang_defaults): Remove OBJC and OBJCXX. + (set_lang): Update. + (COMMAND_LINE_OPTIONS): Remove -+ and -lang-objc++. + (cpp_handle_option): Remove -+ and -lang-objc++. + For ObjC, just set a flag. + (print_help): Update. + * cpplib.h (enum c_lang): Remove CLK_OBJC and CLK_OBJCXX. + +2002-05-17 Rainer Orth + + * doc/install.texi (Specific, mips-sgi-irix6): Document need to + bootstrap with -mips3. + +2002-05-17 Kazu Hirata + + * final.c: Fix formatting. + * fix-header.c: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + +2002-05-17 David S. Miller + + PR c/6689, PR optimization/6615 + * local-alloc.c (struct equivalence): Rename 'src' to 'src_p' + and make it a pointer to rtx. Update comments. + (update_equiv_regs): When scanning for equivalences, record + address of SET_SRC (set) in reg_equiv[].src_p. Dereference + it while making the equiv replacements. + +2002-05-17 Rainer Orth + + * config/sparc/sparc.c (sparc_aout_select_section): Fixed typo. + +2002-05-17 kaz Kojima + + * config/sh/sh.h (ENCODE_SECTION_INFO): Consider MODULE_LOCAL_P + when encoding visibility into SYMBOL_REF_FLAG. + +2002-05-17 Richard Sandiford + + * expr.c (force_operand): Fix reversed move. + +2002-05-17 Kurt Wall + + * doc/install.texi (Testing): Mention two common DejaGnu warnings + that can be ignored. + +2002-05-16 Gerald Pfeifer + + * doc/install.texi (Final install): Recommend to install into a + "clean" target directory. + +2002-05-17 Richard Henderson + + * config/ia64/ia64.md: Use braced strings instead of quoted strings + for code blocks. Tidy whitespace. + +2002-05-17 Richard Henderson + + * hooks.c (hook_tree_bool_false): New. + * hooks.h: Declare it. + * target-def.h (TARGET_ASM_SELECT_SECTION): New. + (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. + * target.h (select_section, unique_section): New. + (in_small_data_p): New. + * varasm.c (resolve_unique_section): Use hooks instead of macros. + (variable_section, output_constant_def_contents): Likewise. + (default_select_section, default_unique_section): New. + (categorize_decl_for_section, default_elf_select_section): New. + * output.h: Declare them. + + * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. + (TARGET_ASM_SELECT_SECTION): New. + (SELECT_SECTION): Move ... + * config/darwin.c (machopic_select_section): ... here. + * config/darwin-protos.h: Update. + + * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. + (SELECT_SECTION): Move ... + * config/nextstep.c (nextstep_select_section): ... here. + * config/nextstep-protos.h: Update. + + * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION): New. + * config/svr3.h (SELECT_SECTION): Remove. + + * config/alpha/alpha.c (unicosmk_unique_section): Make static. + (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. + (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. + (alpha_encode_section_info): Use it. + * config/alpha/alpha-protos.h: Update. + * config/alpha/elf.h (DO_SELECT_SECTION): Remove. + (SELECT_SECTION, UNIQUE_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION): New. + * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. + + * config/arm/pe.h (UNIQUE_SECTION): Remove. + (TARGET_ASM_UNIQUE_SECTION): New. + + * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. + (avr_unique_section): Rename from unique_section; make static. + * config/avr/avr-protos.h: Update. + * config/avr/avr.h (UNIQUE_SECTION): Remove. + + * config/c4x/c4x.h (SELECT_SECTION): Remove. + + * config/i386/cygwin.h (UNIQUE_SECTION): Remove. + (TARGET_ASM_UNIQUE_SECTION): New. + * config/i386/i386-interix.h: Likewise. + * config/i386/win32.h: Likewise. + * config/i386/djgpp.h (UNIQUE_SECTION): Remove. + * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. + * config/i386/sco5.h (SELECT_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION): New. + * config/i386/svr3gas.h (SELECT_SECTION): Remove. + + * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION + instead of SELECT_SECTION. + * config/m68k/dpx2.h: Likewise. + * config/rs6000/lynx.h: Likewise. + + * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. + * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. + (ia64_in_small_data_p): New. + (ia64_encode_section_info): Use it. Reorganize overlarge conditional. + (ia64_aix_select_section, ia64_aix_unique_section): New. + * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. + (SELECT_SECTION, UNIQUE_SECTION): Remove. + + * config/m32r/m32r.h (SELECT_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION): New. + * config/m32r/m32r.c (m32r_select_section): Take align argument. + * config/m32r/m32r-protos.h: Update. + + * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. + (SELECT_SECTION): Move ... + * config/m88k/m88k.c (m88k_select_section): ... here. + + * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. + * config/mcore/mcore.h (UNIQUE_SECTION): Remove. + * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. + (mcore_unique_section): Make static. + * config/mcore/mcore-protos.h: Update. + + * config/mips/elf.h (UNIQUE_SECTION): Remove. + (TARGET_ASM_UNIQUE_SECTION): New. + * config/mips/elf64.h: Likewise. + * config/mips/iris6gld.h: Likewise. + * config/mips/linux.h: Likewise. + * config/mips/mips-protos.h: Update. + * config/mips/mips.c (mips_select_section): Add align argument. + * config/mips/mips.h (SELECT_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION): New. + + * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. + * config/mmix/mmix.c (mmix_select_section): Remove. + (mmix_unique_section): Remove. + * config/mmix/mmix-protos.h: Update. + + * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. + (SELECT_SECTION): Move ... + * config/pa/pa.c (pa_select_section): ... here. + * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. + + * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename + from rs6000_select_section and make static. + (rs6000_elf_unique_section): Similarly. + (rs6000_xcoff_select_section): From xcoff.h. + (rs6000_xcoff_unique_section): Likewise. + * config/rs6000/rs6000-protos.h: Update. + * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. + (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. + * config/rs6000/xcoff.h: Likewise. + + * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. + (SELECT_SECTION): Move ... + * config/sparc/sparc.c (sparc_aout_select_section): ... here. + + * config/v850/v850.h (SELECT_SECTION): Move ... + * config/v850/v850.c (v850_select_section): ... here. + (TARGET_ASM_SELECT_SECTION): New. + + * config/vax/vms.h (SELECT_SECTION): Move ... + * config/vax/vax.c (vms_select_section): ... here. + (TARGET_ASM_SELECT_SECTION): New. + + * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs + for the target hooks. + +2002-05-17 Nick Clifton + + * config/arm/arm.c (emit_multi_reg_push): Do not set + RTX_FRAME_RELATED_P on the SEQUENCE. + +2002-05-16 Richard Henderson + + * config/ia64/ia64.c (ia64_reorg): Rebuild bb_for_insn before + splitting. Use split_all_insns; update_life_info_in_dirty_blocks. + +2002-05-16 Richard Henderson + + * config/alpha/unicosmk.h (TARGET_OS_CPP_BUILTINS): Fix typo. + + * config/ia64/ia64.c (saveable_obstack): Do not declare. + +2002-05-16 Richard Henderson + + * basic-block.h, bb-reorder.c, cfg.c, cfganal.c, cfgbuild.c, + cfgcleanup.c, cfglayout.c, cfgloop.c, cfgrtl.c, combine.c, + conflict.c, df.c, df.h, dominance.c, final.c, flow.c, function.c, + gcse.c, global.c, graph.c, haifa-sched.c, ifcvt.c, lcm.c, + local-alloc.c, loop.c, predict.c, print-rtl.c, profile.c, + recog.c, reg-stack.c, regclass.c, regmove.c, regrename.c, + reload1.c, reorg.c, resource.c, sbitmap.c, sched-deps.c, + sched-ebb.c, sched-rgn.c, sibcall.c, ssa-ccp.c, ssa-dce.c, ssa.c: + Revert "Basic block renumbering removal", and two followup patches. + +2002-05-16 Jason Thorpe + + * lcm.c (optimize_mode_switching): Revert previous change. + +2002-05-16 Zdenek Dvorak + + * sched-rgn.c (schedule_insns): Initialize large_region_blocks + with only extant block numbers. + +2002-05-16 Jason Thorpe + + * lcm.c (optimize_mode_switching): Fix typo. + +2002-05-16 Zdenek Dvorak + + * flow.c (calculate_global_regs_live): Queue blocks in program order. + +2002-05-16 Rainer Orth + + * doc/install.texi (Configuration): Document PWDCMD. + +2002-05-16 Dale Johannesen + + * combine.c (cant_combine_insn_p): Reenable combinations + involving hard regs unless CLASS_LIKELY_SPILLED_P. + +2002-05-16 Neil Booth + + * c-common.c (cb_register_builtins): Handle more built-ins + here rather than in gcc.c specs. + * gcc.c (cpp_unique_options): Move many built-ins to c-common.c. + (cpp_options): Pass -O flags even when only preprocessing. + * toplev.c (set_fast_math_flags): New prototype. + (fast_math_flags_set_p): New. + (set_no_fast_math_flags): Remove. + (decode_f_option): Update. + * toplev.h (set_fast_math_flags): Update. + (fast_math_flags_set_p): New. + (set_no_fast_math_flags): Remove. +config: + * c4x/c4x.c (c4x_override_options): Update. + +2002-05-16 Zack Weinberg + + * c-common.c (STDC_0_IN_SYSTEM_HEADERS, REGISTER_PREFIX): + Default-define here. + (builtin_define_with_value): Can now wrap the expansion in + quotation marks if such is wanted. + (cb_register_builtins): Update calls to builtin_define_with_value. + Define __REGISTER_PREFIX__, __USER_LABEL_PREFIX__, and __VERSION__ + here. + (c_common_init): Set options->stdc_0_in_system_headers. + * c-lex.h: Update prototype of builtin_define_with_value. + * cppdefault.h: Remove default definitions of USER_LABEL_PREFIX + and REGISTER_PREFIX. + + * cppinit.c (VERS, ULP, C, X): Kill. + (builtin_array): Remove entries for __VERSION__, + __USER_LABEL_PREFIX__, __REGISTER_PREFIX__, and + __HAVE_BUILTIN_SETJMP__. Make __STDC__ always a builtin, not + a constant. + (init_builtins): Kill off a bunch of now-dead code. + (COMMAND_LINE_OPTIONS): Remove -fleading-underscore and + -fno-leading-underscore. + (cpp_handle_option): Remove code to set user_label_prefix. + (cpp_post_options): Likewise. + + * cpplib.h (struct cpp_options): Remove user_label_prefix. + (stdc_0_in_system_headers): New. + * cppmacro.c (builtin_macro): Check CPP_OPTION (pfile, + stdc_0_in_system_headers) too to decide the value of __STDC__. + + * tradcpp.c (user_label_prefix): Kill. + (main): Remove code handling -f(no-)leading-underscore. + (initialize_builtins): Don't define __REGISTER_PREFIX__ + or __USER_LABEL_PREFIX__. + (install_value): Wrap compound statement in dummy loop so the + macro works properly in an if statement. + + +2002-05-16 Janis Johnson + + * loop.h (struct loop_info): Add member has_prefetch. + * loop.c (PREFETCH_CONDITIONAL): Change default to 1. + (prescan_loop): Initialize has_prefetch. + (struct prefetch_info): Change prefetch_in_loop and + prefetch_before_loop from bit fields to ints. + (emit_prefetch_instructions): Several small fixes. + (check_dbra_loop): Don't reverse loop that uses prefetch. + +2002-05-16 Rainer Orth + + * Makefile.in: Allow for PWDCMD to override hardcoded pwd. + * configure.in: Likewise. + * fixinc/check.tpl: Likewise. + * fixinc/fixinc.dgux: Likewise. + * fixinc/fixinc.svr4: Likewise. + * fixinc/fixinc.winnt: Likewise. + * fixinc/fixincl.sh: Likewise. + * fixproto: Likewise. + * configure: Regenerate. + +2002-05-16 Zdenek Dvorak + + Basic block renumbering removal: + * basic_block.h (struct basic_block_def): Renamed index to sindex, + added prev_bb and next_bb fields. + (n_basic_blocks): Renamed to num_basic_blocks. + (last_basic_block): New, index of last basic block. + (FOR_BB_BETWEEN, FOR_ALL_BB, FOR_ALL_BB_REVERSE): New macros for + traversing basic block chain. + (BLOCK_NUM): index -> sindex. + (create_basic_block_structure, create_basic_block): Declaration changed. + (debug_num2bb): Declare. + (expunge_block_nocompact): Declaration removed. + (link_block, unlink_block, compact_blocks): Declare. + * bb-reorder.c (make_reorder_chain, make_reorder_chain_1): Modified. + * cfg.c (entry_exit_blocks): Initialize new fields. + (clear_edges, alloc_block, expunge_block, cached_make_edge, + redirect_edge_pred, dump_flow_info, dump_edge_info, + alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges, + free_aux_for_edges): Modified. + (link_block, unlink_block, compact_blocks, debug_num2bb): New. + (expunge_block_nocompact): Removed. + * cfganal.c (can_fallthru, mark_dfs_back_edges, flow_call_edges_add, + find_unreachable_blocks, create_edge_list, print_edge_list, + verify_edge_list, flow_edge_list_print, remove_fake_successors, + remove_fake_edges, flow_reverse_top_sort_order_compute, + flow_depth_first_order_compute, flow_preorder_transversal_compute, + flow_dfs_compute_reverse_init, flow_dfs_compute_reverse_add_bb, + flow_dfs_compute_reverse_execute): Modified. + * cfgbuild.c (make_edges, make_eh_edge, find_basic_blocks_1, + find_basic_blocks, find_many_sub_basic_blocks, find_sub_basic_blocks): + Modified. + * cfgcleanup.c (try_simplify_condjump, try_forward_edges, + merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps, merge_blocks, + outgoing_edges_match, try_crossjump_to_edge, try_crossjump_bb, + try_optimize_cfg, delete_unreachable_blocks, cleanup_cfg): Modified. + * cfglayout.c (skip_insns_after_block, label_for_bb, + record_effective_endpoints, scope_to_insns_finalize, + fixup_reorder_chain, verify_insn_chain, cleanup_unconditional_jumps, + fixup_fallthru_exit_predecessor, cfg_layout_redirect_edge, + cfg_layout_duplicate_bb): Modified. + * cfgloop.c (flow_loops_cfg_dump, flow_loop_dump, flow_loops_dump, + flow_loop_entry_edges_find, flow_loop_exit_edges_find, + flow_loop_nodes_find, flow_loop_pre_header_find, flow_loop_scan, + flow_loops_find, flow_loop_outside_edge_p): Modified. + * cfgrtl.c (create_basic_block_structure, create_basic_block, + flow_delete_block, compute_bb_for_insn, split_block, + try_redirect_by_replacing_jump, redirect_edge_and_branch, + force_nonfallthru_and_redirect, tidy_fallthru_edge, + back_edge_of_syntactic_loop_p, split_edge, commit_one_edge_insertion, + commit_edge_insertions, commit_edge_insertions_watch_calls, + dump_bb, print_rtl_with_bb, verify_flow_info, purge_dead_edges, + purge_all_dead_edges): Modified. + * combine.c (combine_instructions, set_nonzero_bits_and_sign_copies, + try_combine, nonzero_bits, num_sign_bit_copies, get_last_value_validate, + get_last_value, reg_dead_at_p, distribute_notes, distribute_links): + Modified. + * conflict.c (conflict_graph_compute): Modified. + * df.c (FOR_ALL_BBS): Removed. + (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1, + df_modified_p, df_analyse, df_refs_unlink, df_insn_modify, + df_dump, hybrid_search_bitmap, iterative_dataflow_sbitmap): Modified. + * df.h (DF_BB_INFO, DF_REF_BBNO): Modified. + * dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree, + calc_idoms, idoms_to_doms, calculate_dominance_info): Modified. + * final.c (compute_alignments, final_scan_insn): Modified. + * flow.c (verify_local_live_at_start, update_life_info, + update_life_info_in_dirty_blocks, free_basic_block_vars, + delete_noop_moves, calculate_global_regs_live, + initialize_uninitialized_subregs, allocate_bb_life_data, + regno_uninitialized, regno_clobbered_at_setjmp, mark_set_1, + mark_used_reg, count_or_remove_death_notes): Modified. + * function.c (thread_prologue_and_epilogue_insns): Modified. + * gcse.c (struct null_pointer_info): Change typo of current_block + to basic_block. + (gcse_main, alloc_gcse_mem, compute_local_properties, compute_sets, + oprs_unchanged_p, load_killed_in_block_p, record_last_reg_set_info, + compute_hash_table, alloc_rd_mem, handle_rd_kill_set, compute_kill_rd, + alloc_avail_expr_mem, expr_killed_p, compute_ae_kill, + expr_reaches_here_p_work, expr_reaches_here_p, handle_avail_expr, + classic_gcse, one_classic_gcse_pass, compute_transp, cprop, + one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p_work, + pre_expr_reaches_here_p, insert_insn_end_bb, pre_edge_insert, + pre_delete, one_pre_gcse_pass, compute_transpout, + invalidate_nonnull_info, delete_null_pointer_checks_1, + free_code_hoist_mem, compute_code_hoist_vbeinout, + hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass, + compute_ld_motion_mems, store_ops_ok, find_moveable_store, + compute_store_table, build_store_vectors, insert_insn_start_bb, + insert_store, replace_store_insn, free_store_memory, store_motion): + Modified. + * global.c (global_alloc, global_conflicts, mark_elimination, + build_insn_chain): Modified. + * graph.c (print_rtl_graph_with_bb): Modified. + * haifa-sched.c (sched_init): Modified. + * ifcvt.c (SET_ORIG_INDEX, ORIG_INDEX): Removed. + (find_if_block, find_cond_trap, find_if_case_1, find_if_case_2, + if_convert): Modified. + * lcm.c (compute_antinout_edge, compute_earliest, compute_laterin, + compute_insert_delete, pre_edge_lcm, compute_available, + compute_farthest, compute_nearerout, compute_rev_insert_delete, + pre_edge_rev_lcm, make_preds_opaque, optimize_mode_switching): + Modified. + * local-alloc.c (alloc_qty, local_alloc, update_equiv_regs): Modified. + * loop.c (loop_dump_aux): Modified. + * predict.c (combine_predictions_for_insn, estimate_probability, + last_basic_block_p, process_note_prediction, process_note_predictions, + note_prediction_to_br_prob, propagate_freq, counts_to_freqs, + expensive_function_p, estimate_bb_frequencies, + compute_function_frequency): Modified. + * print-rtl.c (print_rtx): Modified. + * profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX, instrument_edges, + get_exec_counts, compute_branch_probabilities, compute_checksum, + branch_prob, find_spanning_tree): Modified. + * recog.c (split_all_insns, peephole2_optimize): Modified. + * reg-stack.c (reg_to_stack, convert_regs_entry, compensate_edge, + convert_regs_1, convert_regs_2, convert_regs): Modified. + * regclass.c (scan_one_insn, regclass): Modified. + * regmove.c (mark_flags_life_zones, regmove_optimize, + combine_stack_adjustments): Modified. + * regrename.c (regrename_optimize, copyprop_hardreg_forward): Modified. + * reload1.c (reload, reload_combine, copy_eh_notes): Modified. + * reorg.c (dbr_schedule): Modified. + * resource.c (find_basic_block, init_resource_info): Modified. + * sbitmap.c (sbitmap_intersection_of_succs, + sbitmap_intersection_of_preds, sbitmap_union_of_succs, + sbitmap_union_of_preds): Modified. + * sched-deps.c (init_dependency_caches): Modified. + * sched-ebb.c (schedule_ebbs): Modified. + * sched-rgn.c (is_cfg_nonregular, build_control_flow, debug_regions, + find_rgns, compute_trg_info, init_regions, schedule_insns): Modified. + * sibcall.c (optimize_sibling_and_tail_recursive_call): Modified. + * ssa-ccp.c (examine_flow_edges, optimize_unexecutable_edges, + ssa_ccp_substitute_constants, ssa_ccp_df_delete_unreachable_insns, + ssa_const_prop): Modified. + * ssa-dce.c (set_control_dependent_block_to_edge_map_, + find_control_dependence, find_pdom, ssa_eliminate_dead_code): Modified. + * ssa.c (remove_phi_alternative, find_evaluations, + compute_dominance_frontiers_1, compute_iterated_dominance_frontiers, + insert_phi_node, rename_block, convert_to_ssa, eliminate_phi, + make_regs_equivalent_over_bad_edges, + make_equivalent_phi_alternatives_equival, + compute_conservative_reg_partition, + coalesce_regs_in_successor_phi_nodes, compute_coalesced_reg_partition, + rename_equivalent_regs, convert_from_ssa, for_each_successor_phi): + Modified. + +2002-05-16 Mark Mitchell + + * cfgrtl.c (purge_dead_edges): Correct handling of EDGE_EH. + +2002-05-16 Nick Clifton + + * config/arm/arm.c (arm_rtx_costs): Check for RTX being a + SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P. + (arm_adjust_cost): Check for RTX being a SYMBOL_REF before + calling CONSTANT_POOL_ADDRESS_P. + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Fix typo in code + to decide whether to define __arm__ or __thumb. + (THUMB_GO_IF_LEGITIMATE_ADDRESS): Check for RTX being a + SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P. + +2002-05-16 Neil Booth + + * config/arc/arc.h (CPP_PREDEFINES): Remove. + (CPP_SPEC): Update. + (TARGET_CPU_CPP_BUILTINS): New. + +2002-05-16 Neil Booth + + * cpphash.h (cpp_macro): Move here, and make expansion a union. + * cppmacro.c (cpp_macro): Remove. + (enter_macro_context, replace_args, warn_of_redefinition, + _cpp_create_definition, cpp_macro_definition): Update. + +2002-05-16 Jason Merrill + + * config/mips/mips.c (mips_output_external): Don't do sdata + optimization for a variable with DECL_COMDAT set. + +2002-05-15 Aldy Hernandez + + * config/rs6000/altivec.h: Cleanups for tighter typechecking. + Cleanups for accepting modifiers on pointers. + Fix predicate typos. + Allow long pointers as well as int pointers. + +2002-05-15 Richard Henderson + + * varasm.c (merge_weak): Remove special case for extern and common. + +2002-05-15 Matt Hiller + + * testsuite/gcc.c-torture/compile/20000804-1.x: Don't return 1 if + XFAILing. + * testsuite/gcc.c-torture/compile/20001226-1.x: Ditto. + * testsuite/gcc.c-torture/compile/920520-1.x: Ditto. + * testsuite/gcc.c-torture/compile/mipscop-1.x: XFAIL for now. + * testsuite/gcc.c-torture/compile/mipscop-2.x: Ditto. + * testsuite/gcc.c-torture/compile/mipscop-3.x: Ditto. + * testsuite/gcc.c-torture/compile/mipscop-4.x: Ditto. + +2002-05-15 Aldy Hernandez + + * reload1.c (forget_old_reloads_1): Do not use subreg offset. + +2002-05-15 Aldy Hernandez + + * config/rs6000/rs6000.md ("altivec_mtvscr"): Set VSCR register. + ("altivec_mfvscr"): Read from VSCR. + + Add vscr sets for the following insns: altivec_vctuxs, + altivec_vaddubs, altivec_vaddsbs, altivec_vadduhs, + altivec_vaddshs, altivec_vadduws, altivec_vaddsws, altivec_vctsxs, + altivec_vmhaddshs, altivec_vmhraddshs, altivec_vmsumuhs, + altivec_vmsumshs, altivec_vpkuhss, altivec_vpkshss, + altivec_vpkuwss, altivec_vpkswss, altivec_vpkuhus, + altivec_vpkshus, altivec_vpkuwus, altivec_vpkswus, + altivec_vsububs, altivec_vsubsbs, altivec_vsubuhs, + altivec_vsubshs, altivec_vsubuws, altivec_vsubsws, + altivec_vsum4ubs, altivec_vsum4sbs, altivec_vsum4shs, + altivec_vsum2sws, altivec_vsumsws. + + * config/rs6000/rs6000.h: Add VSCR fixed register. + (CALL_REALLY_USED_REGISTERS): Add vscr. + (CALL_USED_REGISTERS): Same. + (FIXED_REGISTERS): Same. + (REG_ALLOC_ORDER): Same. + (reg_class): Add VSCR_REGS. + (REG_CLASS_NAMES): Same. + (REG_CLASS_CONTENTS): Same. + (VSCR_REGNO): New. + (REGISTER_NAMES): Add vscr. + (DEBUG_REGISTER_NAMES): Same. + (ADDITIONAL_REGISTER_NAMES): Same. + (FIRST_PSEUDO_REGISTER): Increment. + (CONDITIONAL_REGISTER_USAGE): Set VSCR as a global register. + +2002-05-15 Jakub Jelinek + + * fold-const.c (fold): Fix a typo. + +2002-05-15 Eric Botcazou + + * fold-const.c (fold) [LT_EXPR]: Move the transformation of a + comparison against the highest or lowest integer value before + the 'X >= CST to X > (CST - 1)' and 'X < CST to X <= (CST - 1)' + transformation and that of an unsigned comparison against 0 + right after. + +2002-05-15 Richard Henderson + + * varasm.c (merge_weak): Error for any weakening after definition. + Adjust weakening after use warning to catch more cases. + (assemble_alias): Set TREE_USED and TREE_ASM_WRITTEN consistently. + * config/alpha/alpha.c (alpha_encode_section_info): Do not abort. + +Wed May 15 10:38:27 CEST 2002 Jan Hubicka + + * invoke.texi (-malign-double): Re-add lost warning. + + * i386-protos.h (x86_output_mi_thunk): Declare. + * unix.h (ASM_OUTPUT_MI_THUNK): Move offline to ... + * i386.c (x86_output_mi_thunk): ... here; handle 64bits. + + * dwarf2out.c (output_call_frame_info): Do not skip unwind info + when flag_asynchronous_unwind_tables is set. + + * flags.h (flag_reorder_functions): Declare. + * function.c (prepare_function_start): Initialize frequnecy. + * params.def (HOT_BB_COUNT_FRACTION, HOT_BB_FREQUENCY_FRACTION): New. + * Makefile.in (predict.o): Add dependency on target.h and params.h + * defaults.h (HOT_TEXT_SECTION_NAME, + UNLIKELY_EXECUTED_TEXT_SECTION_NAME): New macros. + * predict.c (choose_function_section): New function. + (estimate_bb_frequencies): Use it. + * toplev.c (flag_reorder_functions): New global variable. + (lang_independent_options): New. + (parse_options_and_default_flags): Set. + * varasm.c (assemble_start_function): Bypass functdion alignment + for never executed functions. + * invoke.texi (-freorder-blocks, -freorder-functions): Document. + (param hot-bb-count-fraction, hot-bb-frequency-fraction): New. + * tm.texi (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): + Document. + + Thu Jan 3 21:52:09 CET 2002 Jan Hubicka + + * predict.c: Inlude profile.h + (MIN_COUNT): Rename to MIN_COUNT_FRACTION + (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): + Use the information about maximal counter in the program. + + Thu Dec 20 22:14:00 CET 2001 Jan Hubicka + + * basic-block.h (maybe_hot_bb_p, probably_cold_bb_p, + probably_never_executed_bb_p): New functions. + * cfgcleanup.c (outgoing_edges_match): Use them. + * predict.c (MIN_COUNT, MIN_FREQUENCY): New macros. + (maybe_hot_bb_p, probably_cold_bb_p, + probably_never_executed_bb_p): New functions. + + * function.h (function): Add new field function_frequency. + * predict.c (compute_function_frequency): New function. + (estimate_probability): Call it. + +2002-03-09 Jakub Jelinek + + PR optimization/5172, optimization/5200 + * gcse.c (gcse_main): Disable store_motion. + +2002-05-14 Zack Weinberg + + * c-parse.in (MODIFIED_WCHAR_TYPE): New macro. + (c_common_nodes_and_builtins): Use it. + (builtin_define_with_value): New function. + (cb_register_builtins): Define __SIZE_TYPE__, + __PTRDIFF_TYPE__, __WCHAR_TYPE__, and __WINT_TYPE__ here, + using builtin_define_with_value. Use consistent notation when + defining __GXX_WEAK__. + (WCHAR_TYPE_SIZE): Don't redefine. + (combine_strings): Don't use WCHAR_TYPE_SIZE. + + * cppdefault.h: Don't provide defaults for SIZE_TYPE, + PTRDIFF_TYPE, WCHAR_TYPE, or WINT_TYPE. + * cppinit.c (builtin_array): Remove entries for __SIZE_TYPE__ etc. + * tradcpp.c (initialize_builtins): Likewise. + * gcc.c (cpp_unique_options): Don't muck with __WCHAR_TYPE__. + + * c-lex.h (builtin_define_with_value): Prototype. + * system.h: Poison NO_BUILTIN_SIZE_TYPE, NO_BUILTIN_WCHAR_TYPE, + NO_BUILTIN_PTRDIFF_TYPE, and NO_BUILTIN_WINT_TYPE. + * doc/tm.texi: Remove mention of NO_BUILTIN_SIZE_TYPE etc. + + * config/avr/avr.h, config/h8300/h8300.h, config/i386/i386.h, + config/ia64/ia64.h, config/mips/dec-osf1.h, config/mips/iris6.h, + config/mips/linux.h, config/mips/mips.h, config/mips/netbsd.h, + config/mips/osfrose.h, config/mips/sni-svr4.h, config/rs6000/aix51.h, + config/s390/linux.h, config/sh/sh.h, config/sh/sh64.h, + config/sparc/linux64.h, config/sparc/netbsd-elf.h, + config/sparc/sol2-bi.h, config/sparc/sparc.h: + Do not define NO_BUILTIN_SIZE_TYPE etc. Remove all references + to __SIZE_TYPE__ etc from all spec strings. When this makes + extra specs empty, delete them. + +2002-05-14 John David Anglin + + * pa.c (override_options): Override TARGET_JUMP_IN_DELAY when scheduling + for PA8000 or generating dwarf2 call frame information. + (output_call): Remove DO_FRAME_NOTES check from return pointer + optimization. + (following_call): Return 0 when scheduling for PA8000 or generating + dwarf2 call frame information. Revise comment. + +2002-05-14 Neil Booth + +config/alpha: + * alpha.h (TARGET_CPU_CPP_BUILTINS): Define __IEEE_FP + and __IEEE_FP_INEXACT as appropriate. + (CPLUSPLUS_CPP_SPEC): Don't define __cplusplus. + (CPP_SPEC): Remove ieee defines. + * freebsd.h, netbsd.h: Remove ieee defines and cpp_cpu. + +2002-05-14 Richard Henderson + + * config/i386/i386.c (ix86_save_reg): Make regno unsigned. + (ix86_safe_length, ix86_safe_length_prefix, ix86_safe_memory): Kill. + +2002-05-14 Neil Booth + + * arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_SPEC): Update. + (CPP_APCS_PC_SPEC, CPP_APCS_PC_DEFAULT_SPEC, + CPP_FLOAT_SPEC, CPP_FLOAT_DEFAULT_SPEC, CPP_ENDIAN_SPEC, + CPP_ENDIAN_DEFAULT_SPEC, CPP_INTERWORK_DEFAULT_SPEC, + CPP_INTERWORK_SPEC, CPP_PREDEFINES): Remove. + (EXTRA_SPECS): Update. + * arm/conix-elf.h, arm/linux-elf.h, arm/netbsd.h, arm/riscix.h, + arm/riscix1-1.h, arm/rtems-elf.h, arm/semiaof.h, arm/unknown-elf.h, + arm/unknown-elf-oabi.h, arm/vxarm.h: Remove CPP_PREDEFINES and + define TARGET_OS_CPP_BUILTINS if necessary. + +2002-05-14 Neil Booth + + * gcc.c (cpp_options): Must pass -m* and -f* options + to the front end even when only preprocessing. + (cc1_options): Remove redundant -lang-c. + * tradcpp.c (main): Ignore -m options. +objc: + * lang-specs.h: Similarly. + +2002-05-14 Vladimir Makarov + + * genautomata.c (transform_3): Add code for transformation + `(A,B,...)+C -> A+C,B,...'. + +Tue May 14 12:48:22 CEST 2002 Jan Hubicka + + * final.c (end_final): Do not output profile_arcs constructor, when + no functions are instrumented. + +Tue May 14 12:38:30 CEST 2002 Jan Hubicka + + * i386.md (testsi to testqi_zext_1 splitter): Fix typo. + +2002-05-14 Gerald Pfeifer + + * doc/install.texi: Remove special markup originally required for + HTML generation with texi2html. + +2002-05-14 Andreas Schwab + + * config/ia64/sysv4.h (DO_SELECT_SECTION): Factored out of + SELECT_SECTION. + (UNIQUE_SECTION): Define to get small data correctly. + + * varasm.c (resolve_unique_section): Add third parameter + flag_function_or_data_sections and use it instead of + flag_function_sections. + (assemble_start_function): Pass flag_function_sections. + (asm_emit_uninitialised): Pass flag_data_sections. + (assemble_variable): Likewise. + +2002-05-14 Richard Henderson + + * config/i386/i386.md: Use define_constants for unspec numbers. + * config/i386/i386.c: Likewise. + +2002-05-13 Neil Booth + + * doc/contrib.texi: Update my entry. + +2002-05-13 Mark Mitchell + + * fixinc/inclhack.def (winidss_valist): Limit applicability. + * fixinc/fixincl.x: Regenerated. + * fixinc/tests/base/math.h: Update. + * fixinc/tests/base/testing.h: Likewise. + +2002-05-13 Zack Weinberg + + * genattr.c (gen_attr): Don't emit a comma after the last + enumerator. + +2002-05-13 Richard Henderson + + * cfgrtl.c (purge_dead_edges): Handle abnormal call edges created + by non-local gotos. + * recog.c (peephole2_optimize): Likewise. + +2002-05-13 Andris Pavenis + + * cppfiles.c (open_file): Change mode (DJGPP only) of redirected + input to O_BINARY. + +2002-05-13 Jeffrey A Law (law@redhat.com) + + * flow.c (invalidate_mems_from_autoinc): Rewrite to use for_each_rtx. + Update prototype and callers. + (propagate_one_insn): Stack pointer adjustments kill MEMs on + the mem_set_list which reference the stack pointer, as do + calls to constant functions as they may clobber outgoing + argument space. + + * i386.c (ia32_multipass_dfa_lookahead): Prototype. + + * i386.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define. + (ia32_multipass_dfa_lookahead): New function. + +2002-05-13 Neil Booth + + * gcc.c (SWITCH_TAKES_ARG): Remove 'V'. + (translate_options): Remove 'V'. + (process_command): Similarly. +doc: + * invoke.texi: Remove documentation of 'V'. + +2002-05-13 Ulrich Weigand + + * config/s390/linux.h: Revert 2002-04-22 changes. + +2002-05-13 Scott Marks + + * config/fr30/fr30.md: Only allow splits of immediate loads + if the destination is a register. + +2002-05-13 Neil Booth + + * Makefile.in (c-common.o, cppinit.o): Update. + * c-common.c: Include except.h. + (cb_register_builtins): Handle __USING_SJLJ_EXCEPTIONS__. + Call TARGET_CPU_CPP_BUILTINS and TARGET_OS_CPP_BUILTINS. + * cppinit.c (__USING_SJLJ_EXCEPTIONS): Not here. + * defaults.h (TARGET_OS_CPP_BUILTINS, TARGET_CPU_CPP_BUILTINS, + CPP_PREDEFINES): Handle here. +config: + * alpha/alpha-interix.h, alpha/gnu.h, alpha/linux.h, + alpha/netbsd.h, alpha/openbsd.h, alpha/osf.h, alpha/unicosmk.h, + alpha/vms.h, alpha/vxworks.h: Remove CPP_PREDEFINES, define + TARGET_OS_CPP_BUILTINS. + * alpha/alpha.h (TARGET_CPU_CPP_BUILTINS): Define. + (CPP_SPEC, EXTRA_SPECS): Update. + (CPP_AM_BWX_SPEC, CPP_AM_MAX_SPEC, CPP_AM_FIX_SPEC, + CPP_AM_CIX_SPEC, CPP_IM_EV4_SPEC, CPP_IM_EV5_SPEC, + CPP_IM_EV6_SPEC, CPP_CPU_EV4_SPEC, CPP_CPU_EV5_SPEC, + CPP_CPU_EV56_SPEC, CPP_CPU_PCA56_SPEC, CPP_CPU_EV6_SPEC, + CPP_CPU_EV67_SPEC, CPP_CPU_DEFAULT_SPEC, CPP_CPU_SPEC): Remove. +doc: + * tm.texi (TARGET_REGISTER_CPP_BUILTINS): Remove. + (TARGET_OS_CPP_BUILTINS, TARGET_CPU_CPP_BUILTINS): Define. + +2002-05-12 Zack Weinberg + + * emit-rtl.c (global_rtl): Update comment. + (const_double_htab, const_double_htab_hash, + const_double_htab_hash, lookup_const_double): New. + (const_int_htab_hash, const_int_htab_eq): Remove const + qualifiers, which cause tons of warnings with RTL checking on. + (gen_rtx_CONST_DOUBLE): Deleted. + (const_double_from_real_value): New function - bears some + resemblance to the former immed_real_const_1. + (immed_double_const): Moved here from varasm.c and + simplified. + (gen_rtx_REG): Make REGNO unsigned to squelch warnings. + (gen_rtx_SUBREG): Use gen_rtx_raw_SUBREG. + (gen_rtx): Use immed_double_const. + (init_emit_once): Initialize the const_double_htab. Use + REAL_VALUE_FROM_INT where possible. Can now use + CONST_DOUBLE_FROM_REAL_VALUE when setting up const_tiny_rtx. + * varasm.c (struct varasm_status): Remove x_const_double_chain. + (const_double_chain, immed_real_const, clear_const_double_mem): Delete. + (immed_double_const, immed_real_const_1): Moved to emit-rtl.c. + (init_varasm_status, mark_varasm_status): Don't touch + x_const_double_chain. + + * output.h: Delete prototype for clear_const_double_mem. + * real.h: Make REAL_VALUE_TYPE a macro again. Remove leading + '0' slot from all CONST_DOUBLE_FORMAT definitions. Prototype + const_double_from_real_value, not immed_real_const_1, and use + it to define CONST_DOUBLE_FROM_REAL_VALUE. Define new macro + CONST_DOUBLE_ATOF. + * rtl.h (CONST_DOUBLE_CHAIN): Kill. + (CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH): Adjust. + (gen_rtx_CONST_DOUBLE, immed_real_const): Delete prototypes. + (gen_rtx_REG): Second arg is unsigned. + + * gengenrtl.c (special_rtx): Take out CONST_DOUBLE. + (excluded_rtx): New, return true for CONST_DOUBLE. + (genmacro): Write nothing for excluded codes. + * combine.c (combine_simplify_rtx): Use CONST_DOUBLE_FROM_REAL_VALUE. + * expr.c (expand_expr): Likewise. + * ggc-common.c (ggc_mark_rtx_children_1): Don't mark the + CONST_DOUBLE_CHAIN. + * toplev.c (rest_of_compilation): Don't call + clear_const_double_mem. + + * config/rs6000/rs6000.c (rs6000_float_const): Delete. + (rs6000_hash_constant): Remove CONST_DOUBLE special case. + (toc_hash_eq): Remove CONST_DOUBLE and LABEL_REF special cases. + * config/rs6000/rs6000-protos.h: Don't prototype rs6000_float_const. + * config/c4x/c4x.md, config/rs6000/rs6000.md: Use CONST_DOUBLE_ATOF. + * config/dsp16xx/dsp16xx.md, config/mips/mips.md, + config/pa/pa.md: Use CONST_DOUBLE_FROM_REAL_VALUE. + * config/sparc/sparc.md, config/sparc/sparc.c: Use immed_double_const. + +2002-05-12 Kaveh R. Ghazi + + * mips/iris6.h (CPLUSPLUS_CPP_SPEC): Define. + +2002-05-12 Tom Tromey + + * tree.h (copy_node): Don't mention TREE_PERMANENT. + +2002-05-12 Zack Weinberg + + * gensupport.c (n_comma_elts): Moved here from genattrtab.c. + (scan_comma_elt): New function. Accepts whitespace in comma lists. + * gensupport.h: Prototype new routines. + * genattr.c (gen_attr): Use scan_comma_elt. Avoid unnecessary + use of printf. + * genattrtab.c (n_comma_elts): Moved to gensupport.c. + (next_comma_elt): Use scan_comma_elt. + + * config/i386/i386.md: Use new attribute notation to break up + long lines in define_attr forms. + +2002-05-12 Richard Henderson + + * expr.c (compress_float_constant): New. + (emit_move_insn): Use it. + (float_extend_from_mem): New. + (init_expr_once): Initialize it. + * real.c (exact_real_truncate): New. + + * config/i386/i386.h (CONST_COSTS): Assume CONST_DOUBLE gets + dropped into memory; penalize for size. + (RTX_COSTS): FLOAT_EXTEND is free. + * config/i386/i386.md (extendsfdf2, extendsfxf2, extendsftf2, + extenddfxf2, extenddftf2): Accept constants and drop them to memory. + +2002-05-12 Richard Henderson + + * profile.h (profile_info): Add missing extern to declaration. + * profile.c (profile_info): Define it. + +2002-05-11 John David Anglin + + * pa/pa32-regs.h (HARD_REGNO_MODE_OK): Revise sets of general registers + used for DImode and TImode. + +2002-05-11 Neil Booth + + * cpplex.c (_cpp_lex_direct): When in a directive at EOF + fake a newline. + +2002-05-11 Zack Weinberg + + * config/rs6000/rs6000.c (rs6000_default_long_calls, + rs6000_longcall_switch, rs6000_set_default_type_attributes): New. + (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Set it. + (rs6000_override_options): Handle -m(no-)longcall. + (init_cumulative_args, output_mi_thunk): Check for both + longcall and shortcall attributes on the function. + (rs6000_attribute_table): Add "shortcall". + (rs6000_handle_longcall_attribute): Update comment. + (altivec_expand_unop_builtin, altivec_expand_binop_builtin, + altivec_expand_ternop_builtin): Add default clauses to switches + to silence warnings. + + * config/rs6000/rs6000.h: Declare rs6000_longcall_switch and + rs6000_default_long_calls. Define REGISTER_TARGET_PRAGMAS. + (TARGET_OPTIONS): Add longcall and no-longcall. + + * config/rs6000/rs6000.md (call_nonlocal_sysv, + call_value_nonlocal_sysv): Split by alternatives. One pair + accepts only SYMBOL_REFs and rejects if CALL_LONG is set in + the call cookie. The other pair accepts only LR/CTR and has + no restriction. + + * config.gcc (rs6000-*-* | powerpc*-*-* trailer stanza): + Set c_target_objs, cxx_target_objs; add t-rs6000-c-rule to + tmake_file. + * config/rs6000/rs6000-c.c: New file. + * config/rs6000/t-rs6000-c-rule: New file. + * config/rs6000/rs6000-protos.c: Add multiple-include guard. + Prototype rs6000_pragma_longcall. + + * doc/extend.texi: Document shortcall attribute. + * doc/invoke.texi: Document -mlongcall, -mno-longcall. + +2002-05-11 John David Anglin + + * reorg.c (dbr_schedule): Remove unnecessary test. + +Sat May 11 14:34:35 CEST 2002 Jan Hubicka + + * i386.md (testsi to testqi spliters): New. + + 2002-01-14 Josef Zlomek + + cfg.c (dump_edge_info): added dumping of EDGE_CAN_FALLTHRU. + + Wed Jan 9 2002 Josef Zlomek + + * basic-block.h: New flag EDGE_CAN_FALLTHRU + * cfganal.c (set_edge_can_fallthru_flag): New function; marks the edges + that can be made fallthru. + + Mon Nov 12 16:25:53 CET 2001 Jan Hubicka + + * cfglayout.c (cleanup_unconditional_jumps): New static function. + (cfg_layout_initialize): Use it. + +2002-05-11 Marek Michalkiewicz + + * config/avr/avr.c (avr_mcu_types): Update supported devices. + * config/avr/avr.h (CPP_SPEC, LINK_SPEC, CRT_BINUTILS_SPECS): Likewise. + * config/avr/t-avr (MULTILIB_MATCHES): Likewise. + +2002-05-11 Kazu Hirata + + * dbxout.c: Fix formatting. + * dependence.c: Likewise. + * df.c: Likewise. + * diagnostic.c: Likewise. + * doloop.c: Likewise. + * dominance.c: Likewise. + * doschk.c: Likewise. + * dwarf2asm.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + +2002-05-10 Richard Henderson + + * final.c (end_final): Tidy whitespace. Don't honor flag_pack_struct. + Convert integers constants as needed. Replace "nwords" field with + "sizeof_bb". + (final): Save profile data if cfun->arc_profile, not profile_arc_flag. + * function.h: Fix typo in comment. + * libgcc2.c (struct bb): Replace "nwords" with "sizeof_bb". + +2002-05-10 Roger Sayle + + * fold-const.c (build_range_check): Optimize (c>=1) && (c<=127) + into the equivalent (signed char)c > 0. + +2002-05-10 Janis Johnson + + * loop.c: (PREFETCH_EXTREME_DIFFERENCE, PREFETCH_BEFORE_LOOP): New. + (PREFETCH_CONDITIONAL): Renamed from PREFETCH_NOT_ALWAYS. + (struct prefetch_info): Fix spelling of member bytes_accessed. + (emit_prefetch_instructions): Make dump messages more regular; + restructure code to add more dump messages; use new macros for + heuristics. (There are no code generation changes in any of this). + +2002-05-10 David S. Miller + + * rtl.h (INSN_ANNULLED_BRANCH_P): Accept INSN too, update comment. + (struct rtx_def): Update unchanging flag comment. + * doc/rtl.texi (INSN_ANNULLED_BRANCH_P): Update description. + * reorg.c (delete_from_delay_list): INSN_ANNULLED_BRANCH_P needs + to be handled to INSN too. + (dbr_schedule): Likewise. + * resource.c (next_insn_no_annul): Likewise. + + * cse.c (rtx_cost): Remove multiplication by power of 2 special + casing. + +2002-05-14 Gerald Pfeifer + + * doc/install.texi (Specific, *-*-solaris2*): Update passus on + setting CONFIG_SHELL to /bin/ksh and remove alternate trick to + (possibly) work around broken /bin/sh. + +2002-05-10 Rainer Orth + + * config/mips/t-iris6 (SHLIB_SLIBDIR_SUFFIXES): Use mabi=64 and + . as N64/N32 libgcc_s.so subdirs. + +2002-05-10 David S. Miller + + * config/sparc/sparc.md: Use define_constants for unspec numbers. + + * rtl.h (struct rtx_def): Document unchanging and in_struct flags + more accurately. + (INSN_ANNULLED_BRANCH_P): Only valid for JUMP_INSN and CALL_INSN, fix + comment. + (INSN_FROM_TARGET_P): Valid also for CALL_INSN. + * doc/rtl.texi: Document these macros more accurately. + * recog.c (whole file): Only mess with INSN_ANNULLED_BRANCH_P for + JUMP_INSNs and CALL_INSNs. + * resource.c (whole file): Only mess with INSN_ANNULLED_BRANCH_P + or INSN_FROM_TARGET_P if the code is appropriate. + +2002-05-10 Marek Michalkiewicz + + * config/avr/avr.c (print_operand): Check that addr is a SYMBOL_REF + before using SYMBOL_REF_FLAG (addr). + + * config/avr/avr-protos.h (avr_io_address_p): Declare. + * config/avr/avr.c (io_address_p): Rename to avr_io_address_p. + Make non-static. Update all callers. + * config/avr/avr.md (*cbi, *sbi, *sbix_branch, *sbix_branch_bit7): + New insns to clear/set/test a single bit in I/O address space. + +2002-05-09 Kaveh R. Ghazi + + * rtl.h (ENABLE_RTL_FLAG_CHECKING): Also check for gcc >= 2.7. + +2002-05-09 Neil Booth + + * Makefile.in: Update. + * c-common.c (flag_iso, flag_undef, cb_register_builtins, + builtin_define_std): New. + (c_common_init): Register CPP builtins callback. + * c-common.h (flag_iso, flag_undef): New. + * c-decl.c (c_decode_option): Set flag_iso and flag_undef. + * c-lex.c: Don't include target.h. + (cb_register_builtins): Move to c-common.c. + (init_c_lex): Don't register hook here. + * c-lex.h (builtin_define, builtin_assert, builtin_define_std): New. + (cpp_define, cpp_assert): Remove. + * gcc.c (cc1_options): Pass -undef to front end. + * target-def.h (TARGET_REGISTER_CPP_BUILTINS): Remove. + (TARGET_INITIALIZER): Update. + * target.h (struct cpp_reader): Don't predeclare. + (struct gcc_target): Remove cpp builtin hook. + * tree.c (default_register_cpp_builtins): Remove. +doc: + * tm.texi: Update. + +2002-05-09 Neil Booth + + * cppexp.c (_cpp_expand_op_stack): Set op_limit. + +2002-05-09 Rainer Orth + + * config/mips/t-iris6 (SHLIB_SLIBDIR_SUFFIXES): Define. + (SHLIB_LINK, SHLIB_INSTALL): Adjust. + +2002-05-09 Jakub Jelinek + + * config/sparc/t-linux64 (SHLIB_MAPFILES): Set. + * config/sparc/libgcc-sparc-glibc.ver: New file. + * config/cris/t-linux (SHLIB_MAPFILES): Remove. + * mklibgcc.in: Preprocess SHLIB_MAPFILES with ml flags. + +2002-05-09 Jakub Jelinek + + PR target/6429 + * Makefile.in (libgcc.mk): Pass SHLIB_SLIBDIR_SUFFIXES to mklibgcc. + * mklibgcc.in: If SHLIB_SLIBDIR_SUFFIXES is defined, put libgcc_s + shared libraries into multilib dirs, with SONAME libgcc_s.so.1 for + base multilibs. + * config/t-slibgcc-elf-ver (SHLIB_LINK): Adjust for the above. + * config/t-slibgcc-sld (SHLIB_LINK): Likewise. + * config/sparc/t-linux64 (SHLIB_SLIBDIR_SUFFIXES): Define. + * config/sparc/t-sol2-64 (SHLIB_SLIBDIR_SUFFIXES): Define. + +2002-05-09 Richard Henderson + + * config/ia64/ia64.md: Use define_constants for unspec numbers. + * config/ia64/ia64.c: Likewise. + +2002-05-09 Richard Sandiford + + * config/mips/mips.c (mips_add_large_offset_to_sp): Remove FILE arg. + (save_restore_insns): Likewise. + (mips_expand_prologue, mips_expand_epilogue): Update callers. + (highpart_shift_operator): Attach ATTRIBUTE_UNUSED to mode argument. + +Thu May 9 11:50:09 2002 Jeffrey A Law (law@redhat.com) + + * athlon.md, k6.md, pentium.md, ppro.md): New files. + * i386.md: Move scheduling information into new files. + + * i386.md (type attribute): Add "rotate" for rotate insns. + (rotate insns): Set type to "rotate". + (various attributes and function units): Treat rotate like shift. + (pent_pair attribute): Only rotates by one bit position are + pairable. + (sbb insns): Explicitly set pent_pair attribute on a couple + that were missing it. + +Thu May 9 18:29:24 2002 J"orn Rennecke + + * sh.c (sh_builtin_saveregs): If starting with an odd fp register, + make sure that buffer starts on odd word address. + (sh_va_arg): Skip odd fp registers when reading a double precision + value. + +2002-05-09 Neil Booth + + * tree.h (preserve_data, object_permanent_p, type_precision): + Remove. + +2002-05-09 Neil Booth + + * cpplib.c (cpp_init_internal_pragmas): Remove #pragma poison. + * cppmacro.c (paste_all_tokens): Bad pastes are a hard error. +doc: + * cpp.texi: Update for removal of obsolete features. + +Thu May 9 07:46:18 2002 Jan Hubicka + Jeffrey A Law (law@redhat.com) + + * i386.c (ia32_use_dfa_pipeline_interface): New function. Use + the DFA interface for Pentium processors. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): DEFINE. + (attr_pent_pair, ix86_pent_find_pair): Remove. + (ix86_sched_reorder_pentium): Remove. + (ix86_sched_reorder): Remove reordering for Pentium. + * i386.md (Pentium scheduling): Rewrite using DFA description. + +Thu May 9 14:55:39 CEST 2002 Jan Hubicka + + * cfganal.c (can_fallthru): Fix fast path. + * cfgrtl.c (verify_flow_info): Avoid crash on conditionals + with edges to the next block. + +Thu May 9 14:52:45 CEST 2002 Jan Hubicka + Pavel Nejedly + + * final.c (end_final): Use C trees to output data structures for profiling. + + * Makefile.in (LIBGCC_DEPS): Added missing dependency on gcov-io.h + (profile.o): New dependency profile.h + (final.o): New dependency profile.h + * profile.h: New file. New global structure profile_info. + * final.h (count_edges_instrumented_now): Declare. + (current_function_cfg_checksum): Declare. + (function_list): New structure. + (functions_head, functions_tail): New static variables. + (end_final): Emits more data, removed some -ax stuff. + (final): Stores function names and chcksums. + * gcov-io.h (__write_gcov_string): New function. + (__read_gcov_string): New function. + * gcov.c (read_profile): New function. + (create_program_flow_graph): Uses read_profile instead of reading + da_file. + (read_files): Removed da_file checking, it's done by read_profile now. + * libgcc2.c (bb_function_info): New structure. + (bb): New field in structure, removed some -ax stuff. + (__bb_exit_func): Changed structure of da_file. + * profile.c (count_edges_instrumented_now): New global variable. + (current_function_cfg_checksum): New global variable. + (max_counter_in_program): New global variable. + (get_exec_counts): New function. + (compute_checksum): New function. + (instrument_edges): Sets count_edges_instrumented_now. + (compute_branch_probabilities): Uses get_exec_counts instead of + reading da_file. + (branch_prob): Calls compute_checksum and writes extra data to bbg_file. + (init_branch_prob): Removed da_file checking, done in get_exec_counts + now. + (end_branch_prob): Removed da_file checking, done in get_exec_counts + now. + * gcov.texi: Updated information about gcov file format. + +2002-05-09 Kazu Hirata + + * sbitmap.c: Fix formatting. + * scan.c: Likewise. + * scan-decls.c: Likewise. + * sched-deps.c: Likewise. + * sched-ebb.c: Likewise. + * sched-rgn.c: Likewise. + * sched-vis.c: Likewise. + * sdbout.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * ssa.c: Likewise. + * ssa-ccp.c: Likewise. + * ssa-dce.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * stringpool.c: Likewise. + +2002-05-09 David S. Miller + + * config/sparc/sol2.h (ASM_CPU_SPEC): Handle -mcpu=v9. + +2002-05-07 David S. Miller + + * config/sparc/sparc.h (TARGET_BUGGY_QP_LIB): Define to zero. + * config/sparc/sol2.h (TARGET_BUGGY_QP_LIB): Override to one. + * config/sparc/sparc.c (emit_soft_tfmode_libcall): If the Qp + library implementation clobbers the output before the inputs + are fully consumed, use stack temporary for the output. + +2002-05-09 Jason Thorpe + + * config/netbsd.h (CPP_SPEC): Remove. + * config/i386/netbsd-elf.h (CPP_SPEC): Define. + * config/i386/netbsd.h (CPP_SPEC): Define. + * config/ns32k/netbsd.h (CPP_SPEC): Define. + * config/sparc/netbsd-elf.h (CPP_SPEC): Remove. + * config/sparc/netbsd.h (CPP_SPEC): Define. + * config/vax/netbsd.h (CPP_SPEC): Define. + +2002-05-08 Kazu Hirata + + * read-rtl.c: Fix formatting. + * real.c: Likewise. + * recog.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * reload.c: Likewise. + * resource.c: Likewise. + * rtlanal.c: Likewise. + * rtl.c: Likewise. + * rtl-error.c: Likewise. + +2002-05-08 John David Anglin + + * pa/pa-64.h (MAX_WCHAR_TYPE_SIZE): Delete. + * pa/pa.h (MAX_WCHAR_TYPE_SIZE): Delete. + +2002-05-08 Bernd Schmidt + + * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Tweak previous change to + use __SSE2__ macro instead. + * config/i386/xmmintrin.h: Likewise. + +2002-05-08 Janis Johnson + + * rtl.h (RTL_FLAG_CHECK*): Add an argument for the macro name, + and use it in all invocations of these macros. Clean up comments. + * rtl.c (rtl_check_failed_flag): Add an argument for the name + of the flag access macro whose check failed. + * doc/rtl.texi (Flags): Document additional flag uses. + +2002-05-08 Robert Spier + Neil Booth + + PR preprocessor/6521 + * cppfiles.c (handle_missing_header): Don't do anything + different for <> includes. +doc: + * cppopts.texi: Update documentation for -MG. + +2002-05-08 Neil Booth + + * cpplex.c (cpp_interpret_charconst): Truncate as well as + sign-extend. +doc: + * cpp.texi: Clarify multichar charconst valuation. + +2002-05-08 Mark Mitchell + + * doc/invoke.texi: Document -mwindiss option. + +2002-05-08 Jason Merrill + + * dwarf2out.c (output_call_frame_info): Don't emit a CIE with no FDEs. + + * dwarf2out.c (gen_type_die): Abort on broken recursion. + + PR c++/6381 + * dwarf2out.c (rtl_for_decl_location): Only expand INTEGER_CST and + REAL_CST. + +2002-05-08 Nick Clifton + + * config/arm/t-arm-elf (MULTILIB): Do not allow big-endian/ + little-endian multilibs to override arm/thumb multilibs. + Do not build hardware floating point multilibs, nor apcs-26 + multilibs for the Thumb. + +2002-05-08 Mark Mitchell + + PR c/6569. + * varasm.c (mark_weak): New function. + (merge_weak): Use it. Do not call declare_weak. + (declare_weak): Use merge_weak. + +Wed May 8 13:12:11 CEST 2002 Jan Hubicka + + * cse.c (dead_libcall_p): Update counts. + (delete_trivially_dead_insns): Update call of dead_libcall_p. + +Wed May 8 11:08:50 CEST 2002 Jan Hubicka + + * cfglayout.c (function_tail_eff_head): Rename to ... + (function_footer): ... this one. + (unlink_insn_chain): New functions. + (label_for_bb): Only call block_label and emit debug message. + (record_effective_endpoints): Actually unlink the headers and footers. + (fixup_reorder_cahin): Re-insert the unlinked sequences. + (cfg_layout_duplicate_bb): Use duplicate_insn_chain. + * cfglayout.h (struct reorder_block_def): New fields footer/header; + remove eff_head/eff_end. + * rtl.h (set_first_insn): Declare. + * emit-rtl.c (set_first_insn): New function. + + * cfglayout.c (fixup_reorder_chain): Dump duplicated + (cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge, + cfg_layout_duplicate_bb): New global function. + (duplicate_insn_chain): New static function. + * cfglayout.h (cfg_layout_can_duplicate_bb_p, cfg_layout_rerirect_edge, + cfg_layout_duplicate_bb): Declare. + (struct reorder_block_def): Add "original" field. + * emit-rtl.c (emit_copy_of_insn_after): New function. + * rtl.h (emit_copy_of_insn_after): Declare. + + * cfglayout.c (fixup_fallthru_exit_predecessor): Kill. + (fixup_reorder_chain): properly handle edges to exit block. + +Wed May 8 11:10:31 CEST 2002 Zdenek Dvorak + Jan Hubicka + + * basic-block.h (note_prediction_to_br_prob): declare. + * c-semantics.c: Include predit.h + (expand_stmt): predict GOTO_STMT as not taken. + * cfgcleanup.c: (delete_unreachable_blocks): Make global. + (cleanup_cfg): Do not free tail_recursion_list. + * cfgrtl.c (can_delete_note_p): Delete NOTE_INSN_PREDICTION. + (flow_delete_block): Kill predictions past end of basic block. + * output.h (delete_unreachable_blocks): Declare. + * predict.c (predicted_by_p, process_note_predictions, + process_note_prediction, last_block_p): New function. + (estimate_probability): Bypass loop on PRED_CONTINUE; + do not handle noreturn heuristics; kill PRED_RETURN; add + PRED_EARLY_RETURN. + * predict.def (PRED_CONTINUE, PRED_EARLY_RETURN, PRED_GOTO, + PRED_CONST_RETURN, PRED_NEGATIVE_RETURN, PRED_NULL_RETURN): New. + * predict.h (IS_TAKEN): New constant. + * print-rtl.c (print_rtx): Pretty print NOTE_INSN_PREDICTION. + * rtl.c (NOTE_INSN_PREDICTION): New. + * rtl.h (NOTE_PREDICTION, NOTE_PREDICTION_ALG, NOTE_PREDICTION_FLAGS): + New macro. + (insn_note): add NOTE_INSN_PREDICTION. + * sibcall.c (optimize_sibling_and_tail_recursive_call): Do not build + CFG; free tail_recursion_label_list. + * stmt.c: Include predict.h; + (return_prediction): New. + (expand_value_return): Use it. + * toplev.c: Lower NOTE_INSN_PREDICTION before sibcall. + +2002-05-08 Richard Sandiford + + * config/mips/mips.md: Name the unspecs with define_constant. + (*HILO_delay): Rename to 'hilo_delay' (no star). + (reload_indi): Replace gen_rtx_UNSPEC with gen_hilo_delay. + (reload_outdi, reload_outsi): Likewise. + +2002-05-07 Kazu Hirata + + * toplev.c: Fix formatting. + +2002-05-07 Janis Johnson + + * config.in (ENABLE_RTL_FLAG_CHECKING): New. + * configure.in (ac_rtlflag_checking): New. + * doc/install.texi (--enable-checking): Document RTL flag checking. + +2002-05-07 Neil Booth + + * c-common.c (c_common_init): Set options->unsigned_wchar. + * cppinit.c (cpp_create_reader): Default unsigned_wchar, + group target dependencies. + (init_builtins, cpp_handle_option): Update. + * cpplex.c (cpp_interpret_charconst): Update. + * cpplib.h (struct cpp_options): Add unsigned_wchar, rename + signed_char to unsigned_char, group target dependencies. + * defaults.h (WCHAR_UNSIGNED): Remove. + * system.h (WCHAR_UNSIGNED, MAX_CHAR_TYPE_SIZE): Poison. +config: + * freebsd.h, interix.h, alpha/freebsd.h, arm/freebsd.h, + i386/386bsd.h, i386/beos-elf.h, i386/bsd386.h, i386/cygwin.h, + i386/djgpp.h, i386/freebsd-aout.h, i386/i386-interix.h, + i386/win32.h, ia64/freebsd.h, mips/netbsd.h, rs6000/freebsd.h, + sh/elf.h, sh/sh.h, sparc/freebsd.h: Remove WCHAR_UNSIGNED. +doc: + * tm.texi: Remove MAX_CHAR_TYPE_SIZE. + +2002-05-07 Mark Mitchell + + * fixinc/inclhack.def (windiss_math1): New fix. + (windiss_math2): Likewise. + (windiss_valist): Likewise. + * fixinc/fixincl.x: Regenerated. + +2002-05-07 Andreas Jaeger + + * genautomata.c (output_internal_min_issue_delay_func): Add + ATTRIBUTE_UNUSED to avoid warning with empty dfa. + (output_internal_trans_func): Likewise. + +Tue May 7 10:06:22 2002 Jeffrey A Law (law@redhat.com) + + * pa.c (hppa_profile_hook): Use force_reg to get the address + of the profile hook into an appropriate pseudo register. + +2002-05-07 Mark Mitchell + + * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -mwindiss. + (LINK_START_SPEC): Handle it. + (LINK_OS_SPEC): Likewise. + (CPP_SPEC): Likewise. + (STARTFILE_SPEC): Likewise. + (LIB_SPEC): Likewise. + (ENDFILE_SPEC): Likewise. Do not assume crtsavres.o is used on + all platforms. + (CRTSAVRES_DEFAULT_SPEC): New macro. + (LIB_WINDISS_SPEC): New macro. + (CPP_OS_WINDISS_SPEC): Likewise. + (STARTFILE_WINDISS_SPEC): Likewise. + (ENDFILE_WINDISS_SPEC): Likewise. + (LINK_START_WINDISS_SPEC): Likewise. + (LINK_OS_WINDISS_SPEC): Likewise. + * config/rs6000/windiss.h: New file. + +2002-05-07 Aldy Hernandez + + * config/rs6000/rs6000.c (bdesc_2arg): Fix vmax typos. + +2002-05-06 David S. Miller + + * config/sparc/sparc.md (shift insns): Do not mask off + second operand, 'I' constraint and SHIFT_COUNT_TRUNCATED + take care of it. + +2002-05-06 Richard Henderson + + PR c++/6212 + * expr.c (highest_pow2_factor_for_type): New. + (expand_assignment): Use it. + +2002-05-06 Aldy Hernandez + + * config/rs6000/rs6000.md ("altivec_mtvscr"): Change to + unspec_volatile. + ("altivec_mfvscr"): Same. + +2002-05-06 Janis Johnson + + * rtl.h (struct rtx_def): Update comments. + (RTL_FLAG_CHECK[12345678]): New. (rtl_check_failed_flag): Declare. + (RTL_FLAG): New. (CLEAR_RTX_FLAGS): New. (flag access macros): Use + RTL_FLAG_CHECK macros with list of expected RTL codes. + * rtl.c (copy_rtx, shallow_copy_rtx): Use RTX_FLAG macro. + (rtl_check_failed_flag): New. + * reload1.c (reload): Use REG macro before changing rtx to MEM. + (reload_cse_noop_set_p): Check rtx code before using access macro. + * config/ia64/ia64.c (process_for_unwind_directive): Check rtx code + before using access macro. + +2002-05-06 Janis Johnson + + * doc/rtl.texi (Flags): Update to reflect current usage. + +2002-05-06 Roger Sayle + + PR opt/3995 + * fold-const.c (sign_bit_p): New function. + (fold) [EQ_EXPR]: Use this to convert (A & C) == 0 into A >= 0 and + (A & C) != 0 into A < 0, when constant C is the sign bit of A's type. + Reapply fold when converting (A & C) == C into (A & C) != 0. + (fold_binary_op_with_conditional_arg): Fix typo in comment. + +2002-05-07 Neil Booth + + * c-common.c (warn_multichar): New. + (c_common_init): Set CPP's warn_multichar. + * c-common.h (warn_multichar): New. + * c-decl.c (warn_multichar): Remove. + * c-lex.c (lex_charconst): Update. + * c-tree.h (warn_multichar): Remove. + * cppexp.c (eval_token): Sign-extend charconst value. + * cppinit.c (cpp_create_reader): Set warn_multichar. + * cpplex.c (cpp_interpret_charconst): Don't sign-extend + each character. Update prototype. Sign-extend the result. + * cpplib.h: Fix conditions. + (struct cpp_options): Add new warning flag. + (cpp_interpret_charconst): Update prototype. +doc: + * cpp.texi: Update documentation. + +2002-05-06 Vladimir Makarov + + * genautomata.c (form_the_same_automaton_unit_lists_from_regexp): + Fix typo in usage of allof instead of unit. + +2002-05-06 Richard Henderson + + * recog.c (if_test_bypass_p): Accept multiple set insns for OUT, + and any jump or call for IN. + +2002-05-06 Bernd Schmidt + + * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Define __SSE2_BUILTINS__ if + -msse2. + * config/i386/xmmintrin.h: Use it to conditionalize SSE2 support. + +2002-05-06 Roger Sayle + + * fold-const.c (lshift-double): Cast the high word to an unsigned + HOST_WIDE_INT when extracting sign bit to avoid compiler warning. + (div_and_round_double): Cast carry to a signed HOST_WIDE_INT to + avoid compiler warning. (fold): Remove redundant code from + BIT_AND_EXPR as integer operands are canonicalized to be arg1. + +2002-05-06 Jeff Law + + * pa-protos.h (hppa_fpstore_bypass_p): Declare. + * pa.c (pa_adjust_cost): Remove all true dependency cost + adjustments. Also remove support for non-DFA scheduling. + * pa.md (700, 7100, 7100lc, 7200, 7300): Use bypass mechanism + to adjust true dependency costs. Update various comments. + (7100lc, 7200, 7300 scheduling): Simplify by combining the + FP ALU & MPY units into a single unit. + +2002-05-06 Catherine Moore + + * config/v850/v850.c (compute_register_save_size): Make sure + to count all of the registers that will be saved. + +Mon May 6 18:03:11 CEST 2002 Jan Hubicka + + * i386.c (q_regs_operand): Use ANY_QI_REGS_P. + +2002-05-06 David S. Miller + + * config/sparc/sparc.c (emit_soft_tfmode_libcall): Do not + allow result to overlap input operands in memory. + +2002-05-06 Neil Booth + +doc: + * cpp.texi: Update multichar charconst docs. + +2002-05-06 Neil Booth + + * cpplex.c (cpp_interpret_charconst): Sign-extend each + character. Don't ignore excess characters. Treat + multicharacter character constants as signed. + (cpp_parse_escape): Clarify diagnostic. + +2002-05-05 Jakub Jelinek + + * config/sparc/sparc.md (ashlsi3): If shift count is const1_rtx, + use add instead of shift. + (ashldi3_sp64): Likewise. + (ashlsi3_const1, ashldi3_const1): Remove. + * config/sparc/sparc.h (PREDICATE_CODES): Add const1_operand. + * config/sparc/sparc.c (const1_operand): New. + +2002-05-05 Jason Thorpe + + * config.gcc (alpha*-*-netbsd*): Don't use crtstuff. + +2002-05-05 Jakub Jelinek + + PR target/6561 + * config/sparc/sparc.md (muldi3_v8plus): Handle %1 equal to %2. + +2002-05-05 Richard Henderson + + * config/alpha/alpha.c (alpha_adjust_cost): Remove everything but + memory latency adjustments. + (alpha_variable_issue): Remove. + (alpha_use_dfa_pipeline_interface): New. + (alpha_multipass_dfa_lookahead): New. + * config/alpha/alpha.md: Remove define_function_unit scheduling; + include new dfa scheduling. + (attr type): Add none. + (blockage): Use it. + * config/alpha/ev4.md: New. + * config/alpha/ev5.md: New. + * config/alpha/ev6.md: New. + +2002-05-05 David S. Miller + + * recog.c (store_data_bypass_p): Handle CLOBBER inside PARALLEL. + +2002-05-05 Kazu Hirata + + * cse.c: Fix formatting. + * emit-rtl.c: Likewise. + +2002-05-05 Vladimir Makarov + + * genautomata.c (initiate_states): Add additional guard to + initialize `units_array'. + +2002-05-05 Vladimir Makarov + + * genautomata.c (form_the_same_automaton_unit_lists_from_regexp, + process_unit_to_form_the_same_automaton_unit_lists, + form_the_same_automaton_unit_lists + check_unit_distributions_to_automata): New prototypes and + functions. + (check_automata): Rename it into `check_automata_insn_issues'. + (unit_decl): New fields `the_same_automaton_unit' and + `the_same_automaton_message_reported_p'. + (unit_decl_t): New typedef. + (the_same_automaton_lists): New gloval variable. + (unit_regexp, unit_set_el, units_array, units_cmp, + output_get_cpu_unit_code_func): Use the typedef. + (evaluate_max_reserv_cycles): Increment + `description->max_insn_reserv_cycles'. + (initiate_states): Don't increment `max_cycles_num'. + (transform_insn_regexps): Move code around transformation of + regexps from `generate'. + (generate): Remove call of `transform_insn_regexps'. + (expand_automata): Call `transform_insn_regexps' and + `check_unit_distributions_to_automata'. Check errors before + `generate'. + + * config/sparc/ultra3.md (us3_a0, us3_a1): Move the units into + automaton `ultrasparc3_1'. + +2002-05-05 Neil Booth + + * c-common.c (c_common_init): Set up CPP arithmetic. + * cppinit.c (cpp_create_reader): Default CPP arithmetic to + something reasonable for the host. + (sanity_checks): Add checks. + (cpp_read_main_file): Call sanity_checks() from here... + (cpp_post_options): ... not here. + * cpplex.c (cpp_interpret_charconst): Get max_chars right. + * cpplib.h (struct cpp_options): New member int_precision. + +2002-05-05 Franz Sirl + + * doc/install.texi (powerpc-*-linux-gnu*): Update build requirements. + +2002-05-04 David S. Miller + + * config/sparc/linux.h, config/sparc/linux64.h + (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define twice. + + * config/sparc/sparc.c (sparc_rtx_costs): Describe costs of + more RTX codes. + * config/sparc/sparc.h (RTX_COSTS_CASES): List those new codes. + + * recog.c (store_data_bypass_p): Handle out_insn being a PARALLEL + of SETs. + +2002-05-05 Tim Josling + + * treelang; New directory for new sample language treelang. + +2002-05-04 Neil Booth + + * Makefile.in (c-lex.o): Update. + * c-lex.c: Include target.h. + (cb_register_builtins): New. + (init_c_lex): Set builtins callback. + * c-lex.h (cpp_define, cpp_assert): New prototypes. + * cppinit.c (init_builtins): Use callback, including for + GXX_WEAK. + * cpplib.h (struct cpp_callbacks): New member. + * target-def.h (TARGET_REGISTER_CPP_BUILTINS): New. + (TARGET_INITIALIZER): Update. + * target.h (struct gcc_target): New hook. + * tree.c (default_register_cpp_builtins): New. + * tree.h (default_register_cpp_builtins): New. +doc: + * tm.texi (TARGET_REGISTER_CPP_BUILTINS): Document. + +2002-05-04 Neil Booth + + * cppinit.c (MAX_WCHAR_TYPE_SIZE): Move to cpplib.h + (cpp_post_options): Move sanity checks to... + (sanity_checks): New. + * cpplex.c (maybe_read_ucs): Fix prototype. + (parse_string, cpp_parse_escape): Cast for %c format specifier. + * cpplib.h (cppchar_t): Use unsigned long or unsigned long long + if necessary. + +2002-05-04 Bernd Schmidt + + * config/i386/i386.c (bdesc_2arg): Add a couple of missing SSE2 + builtins. Use V2DI patterns instead of TI for logical operations. + (ix86_init_mmx_sse_builtins): Add a couple of missing SSE2 builtins. + Correct definitions of psadbw, pmovmskb128, movntdq, cvtdq2ps. + (ix86_expand_builtins): Change the pattern used for movntdq. + * config/i386/i386.md (sse2_andv2di3, sse2_iorv2di3, sse2_xorv2di3, + sse2_nandv2di3): New patterns. + (sse2_anddf3, sse2_nanddf3, sse2_iordf3, sse2_xordf3): Correct modes + on operands. + (sse2_movntv2di): Renamed from sse2_movntti and modes adjusted. + (cvtdq2pd): Correct mode on operand 1. + (sse2_umulsidi3): Describe without unspec. + (sse2_psadbw, mmx_psadbw): Describe with unspec; use more appropriate + machine modes. + (lshrv2di3): Renamed from sse2_lshrv2di3 and removed unspec. + (ashlv2di3): Likewise, from sse2_ashlv2di3. + (ashrv8hi3, ashrv4si3, lshrv8hi3, lshrv4si3, lshrv2di3, ashlv8hi3, + ashlv4si3, ashlv2di3): Use SImode for shift count. + (ashrv8hi3_ti, ashrv4si3_ti, lshrv8hi3_ti, lshrv4si3_ti, lshrv2di3_ti, + lshrv4si3_ti, lshrv2di3_ti, ashlv8hi3_ti, ashlv4si3_ti, ashlv2di3_ti): + New patterns. + * config/i386/xmmintrin.h (__v2df, __v2di, __v4si, __v8hi, __v16qi): + New typedefs. + (__m128i, __m128d): New macros. + (_mm_add_pd, _mm_add_sd, _mm_sub_pd, _mm_sub_sd, _mm_mul_pd, + _mm_mul_sd, _mm_div_pd, _mm_div_sd, _mm_sqrt_pd, _mm_sqrt_sd, + _mm_min_pd, _mm_min_sd, _mm_max_sd, _mm_max_pd, _mm_and_pd, + _mm_andnot_pd, _mm_xor_pd, _mm_or_pd, _mm_cmpeq_pd, _mm_cmplt_pd, + _mm_cmple_pd, _mm_cmpgt_pd, _mm_cmpge_pd, _mm_cmpneq_pd, + _mm_cmpnlt_pd, _mm_cmpnle_pd, _mm_cmpngt_pd, _mm_cmpnge_pd, + _mm_cmpord_pd, _mm_cmpunord_pd, _mm_cmpeq_sd, _mm_cmplt_sd, + _mm_cmple_sd, _mm_cmpgt_sd, _mm_cmpge_sd, _mm_cmpneq_sd, + _mm_cmpnlt_sd, _mm_cmpnle_sd, _mm_cmpngt_sd, _mm_cmpnge_sd, + _mm_cmpord_sd, _mm_cmpunord_sd, _mm_comieq_sd, _mm_comilt_sd, + _mm_comile_sd, _mm_comigt_sd, _mm_comige_sd, _mm_comineq_sd, + _mm_ucomieq_sd, _mm_ucomieq_sd, _mm_ucomilt_sd, _mm_ucomile_sd, + _mm_ucomigt_sd, _mm_ucomige_sd, _mm_ucomineq_sd, _mm_cvtepi32_pd, + _mm_cvtepi32_ps, _mm_cvtpd_epi32, _mm_cvtpd_pi32, _mm_cvtpd_ps, + _mm_cvttpd_epi32, _mm_cvttpd_pi32, _mm_cvtpi32_pd, _mm_cvtps_epi32, + _mm_cvttps_epi32, _mm_cvtps_pd, _mm_cvtsd_si32, _mm_cvttsd_si32, + _mm_cvtsd_ss, _mm_cvtsi32_sd, _mm_cvtss_sd, _mm_unpackhi_pd, + _mm_unpacklo_pd, _mm_loadh_pd, _mm_storeh_pd, _mm_storel_pd, + _mm_movemask_pd, _mm_packs_epi16, _mm_packs_epi32, _mm_packus_epi16, + _mm_unpackhi_epi8, _mm_unpackhi_epi16, _mm_unpackhi_epi32, + _mm_unpacklo_epi8, _mm_unpacklo_epi16, _mm_unpacklo_epi32, + _mm_add_epi8, _mm_add_epi16, _mm_add_epi32, _mm_add_epi64, + _mm_adds_epi8, _mm_adds_epi16, _mm_adds_epu8, _mm_adds_epu16, + _mm_sub_epi8, _mm_sub_epi16, _mm_sub_epi32, _mm_sub_epi64, + _mm_subs_epi8, _mm_subs_epi16, _mm_subs_epu8, _mm_subs_epu16, + _mm_madd_epi16, _mm_mulhi_epi16, _mm_mullo_epi16, _mm_mul_pu16, + _mm_mul_epu16, _mm_sll_epi16, _mm_sll_epi32, _mm_sll_epi64, + _mm_sra_epi16, _mm_sra_epi32, _mm_srl_epi16, _mm_srl_epi32, + _mm_srl_epi64, _mm_slli_epi16, _mm_slli_epi32, _mm_slli_epi64, + _mm_srai_epi16, _mm_srai_epi32, _mm_srli_epi16, _mm_srli_epi32, + _mm_srli_epi64, _mm_and_si128, _mm_andnot_si128, _mm_or_si128, + _mm_xor_si128, _mm_cmpeq_epi8, _mm_cmpeq_epi16, _mm_cmpeq_epi32, + _mm_cmpgt_epi8, _mm_cmpgt_epi16, _mm_cmpgt_epi32, _mm_max_epi16, + _mm_max_epu8, _mm_min_epi16, _mm_min_epu8, _mm_movemask_epi8, + _mm_mulhi_epu16, _mm_maskmoveu_si128, _mm_avg_epu8, _mm_avg_epu16, + _mm_sad_epu8, _mm_stream_si32, _mm_stream_si128, _mm_stream_pd, + _mm_movpi64_epi64, _mm_clflush, _mm_lfence, _mm_mfence): New + functions. + (_mm_shufflehi_epi16, _mm_shufflelo_epi16, _mm_shuffle_epi32, + _mm_extract_epi16, _mm_insert_epi16, _mm_shuffle_pd): New macros. + +2002-05-04 Kazu Hirata + + * dwarf2out.c: Fix formatting. + * varasm.c: Likewise. + +2002-05-04 David Edelsohn + + PR c/6543 + * config/rs6000/rs6000.md (sCC pattern and splitter): Remove + clobber and use result as temporary value. + +Sat May 4 13:20:54 CEST 2002 Jan Hubicka + + * expr.c (force_operand): Use expand_simple_* to handle more + cases. + +2002-05-04 Neil Booth + + * c-lex.c (lex_string): Let cpp_parse_escape handles truncation + and sign-extension. + (lex_charconst): Update for change in prototype of + cpp_interpret_charconst. Extend from cppchar_t to HOST_WIDE_INT + appropriately. + * cpphash.h (BITS_PER_CPPCHAR_T): New. + * cppinit.c (cpp_create_reader): Initialize them for no + change in semantics. + (cpp_post_options): Add sanity checks. + * cpplex.c (cpp_parse_escape): Handle precision, sign-extension + and truncation issues. Calculate in type cppchar_t. + (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): Remove. + (cpp_interpret_charconst): Calculate in type cppchar_t. Handle + run-time dependent precision correctly. Return whether the + result is signed or not. + * cpplib.c (dequote_string): Use cppchar_t; update. + * cpplib.h (cppchar_signed_t): New. + struct cpp_options): New precision members. + (cpp_interpret_charconst, cpp_parse_escape): Update prototypes. + * cppexp.c (eval_token): Update. + +2002-05-03 David S. Miller + + * config/sparc/sparc-protos.h (sparc_rtx_costs): New. + * config/sparc/sparc.c (sparc_rtx_costs): New function + implementing RTX_COSTS and CONST_COSTS. + * config/sparc/sparc.h (CONST_COSTS): Delete. + (RTX_COSTS_CASES): Define. + (RTX_COSTS): Expand RTX_COSTS_CASES and use sparc_rtx_costs to do + the work. + + * config/sparc/sparc.md (DFA schedulers): Split out... + * config/sparc/cypress.md, config/sparc/hypersparc.md, + config/sparc/sparclet.md, config/sparc/supersparc.md, + config/sparc/ultra1_2.md, config/sparc/ultra3.md: ... into here. + + * config/sparc/sparc.c (LEAF_REGISTERS): Do not do ifdef + checks on it, always defined for SPARC. + + * config/sparc/sparc.h (REG_ALLOC_ORDER, REG_LEAF_ALLOC_ORDER): + Tweak, and add more detailed comments. + +2002-05-03 Zack Weinberg + + * Re-apply patch accidentally reverted with + DFA scheduler merge: remove all rules and variables to slurp + source files out of libiberty and rebuild them with HOST_CC. + ($(HOST_PREFIX_1)varray.o): New rule. + (genattrtab rule): Word wrap. + +2002-05-03 Jason Thorpe + + * config/i386/netbsd64.h (CPP_LP64_SPEC): Define. + (CPP_SUBTARGET_SPEC): Define. + (SUBTARGET_EXTRA_SPECS): Redefine, adding cpp_lp64 and + cpp_subtarget specs. + (CPP_SPEC): Redefine to include %(cpp_subtarget). + +2002-05-03 David S. Miller + + * target-defs.h (TARGET_SCHED_CYCLE_DISPLAY): Delete. + * target.h (struct gcc_target): Delete cycle_display member. + + * config/ia64/ia64.c (ia64_emit_insn_before): Put it back. + (rtx_needs_barrier): Delete reference to cycle_display unspec. + (ia64_sched_reorder2): Mention need for cycle display handling + once such notes exist. + +2002-05-03 Richard Henderson + + * real.c (etoasc): Strip most trailing zeros for clarity. + * sched-vis.c: Include real.h. + (print_value): Use REAL_VALUE_TO_DECIMAL as needed. + * Makefile.in (sched-vis.o): Add real.h. + +2002-05-03 David S. Miller + + * haifa-sched.c (rank_for_schedule): Revert 2002-05-02 change, + no longer needed. + +2002-05-03 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_expand_binop_builtin): Error out + when we get an out of range literal. + (altivec_expand_ternop_builtin): Same. + (altivec_expand_unop_builtin): Same. + (altivec_expand_builtin): Same, for dss. + (altivec_expand_builtin): Use trees instead of rtl when + determining literal argument validity. + +2002-05-03 David S. Miller + + Delete cycle display scheduling hook. + * config/ia64/ia64.c (ia64_cycle_display, + TARGET_SCHED_CYCLE_DISPLAY, ia64_emit_insn_before): Delete. + (ia64_sched_reorder2): Don't check for CODE_FOR_cycle_display + and use emit_insn_before instead of ia64_emit_insn_before. + * config/ia64/ia64.md (unspec usage): Delete cycle display. + (cycle_display): Delete insn pattern. + * config/sparc/sparc.md (unspec usage): Delete cycle display. + (cycle_display): Delete insn pattern. + * config/sparc/sparc.c (sparc_cycle_display, + TARGET_SCHED_CYCLE_DISPLAY): Delete. + * doc/md.texi (cycle_display): Don't mention. + * doc/tm.texi (TARGET_SCHED_CYCLE_DISPLAY): Likewise. + +2002-05-03 Richard Henderson + + * recog.c (store_data_bypass_p, if_test_bypass_p): New. + * recog.h: Declare them. + + * config/sparc/sparc.c (ultrasparc_store_bypass_p): Remove. + * config/sparc/sparc.md: Use store_data_bypass_p instead. + * config/sparc/sparc-protos.h: Update. + +2002-05-03 Jason Thorpe + + * config/sparc/netbsd-elf.c (CPP_SUBTARGET_SPEC64): Remove + -D__arch64__. Add -D_LP64. + (CPP_ARCH32_SPEC): Redefine to match the non-bi-arch version + from sparc.h. + (CPP_ARCH64_SPEC): Likewise. + (NO_BUILTIN_PTRDIFF_TYPE): Undef. + (NO_BUILTIN_SIZE_TYPE): Undef. + +2002-05-03 Vladimir Makarov + + * genautomata.c (min_issue_delay_pass_states): Change return type + in the prototype. + (min_issue_delay_pass_states): Change the algorithm. + (min_issue_delay): Set up min_insn_issue_delay for the state. + (output_min_issue_delay_table): Interchange the nested loops and + and initiate min_insn_issue_delay for states. + +Fri May 3 22:59:15 CEST 2002 Jan Hubicka + + * cfgcleanup.c (try_optimize_cfg): Call merge_block only when + jump is simplejump. + +Fri May 3 22:53:37 CEST 2002 Jan Hubicka + + * i386.c (expand_movstr, expand_clrstr): Fix inline-all-stringops + sequence. + +2002-05-03 Richard Henderson + + PR opt/6534 + * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants, + noce_try_store_flag_inc, noce_try_store_flag_mask, noce_try_cmove, + noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Insert new + code before JUMP, not EARLIEST. + +2002-05-03 Joseph S. Myers + + * c-format.c (check_format_info_main): Don't check for presence of + parameter for * width until after operand number has been read, + and only check for it if format parameters are available. + Fixes PR c/6547. + +2002-05-03 Jason Thorpe + + * config/alpha/netbsd.h (CPP_PREDEFINES): Add -D_LP64. + (LINK_SPEC): Undef before defining. + +2002-05-03 Jakub Jelinek + + PR preprocessor/6489 + * tradcpp.c (fixup_newlines): New. + (main, finclude): Use it. + +2002-05-03 Richard Sandiford + + * config/mips/elf64.h (UNIQUE_SECTION): Use mips_unique_section. + * config/mips/mips.c (mips_unique_section): Strip encoding from + decl name. + +2002-05-03 Jakub Jelinek + + * config/i386/i386.c (ix86_expand_int_movcc): Truncate to proper + mode. + +2002-05-03 Rainer Orth + + * doc/install.texi (Installing): Mention GCC 3.1 buildstats. + (Specific): Removed buildstats references. + (Specific, hppa*-hp-hpux11): Adjust for GCC versions > 3.0. + (Specific, sparc-sun-solaris2*): Update 64-bit hints for GCC 3.1. + Accomodate Solaris versions beyond 8. + (Specific, sparc-sun-solaris2.7): Update as path for GCC 3.1. + (Specific, *-*-solaris2.8): Removed, obsolete. + +2002-05-03 Jakub Jelinek + + PR target/6542 + * config/sparc/sparc.h (leaf_reg_remap): Remove const. + (CONDITIONAL_REGISTER_USAGE): For TARGET_FLAT make + fill leaf_reg_remap with identity. + * config/sparc/sparc.c (leaf_reg_remap): Remove const. + +2002-05-03 Kazu Hirata + + * config/h8300/crti.asm: Remove trailing spaces. + * config/h8300/h8300.c: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + +2002-05-02 Jason Merrill + + * defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c. + * c-decl.c (c_init_decl_processing): Use it. + * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Define to INT_TYPE_SIZE. + * config/i960/i960.h (BOOL_TYPE_SIZE): Don't define. + * config/mcore/mcore.h (BOOL_TYPE_SIZE): Don't define. + +2002-05-03 Kazu Hirata + + * regrename.c: Fix formatting. + * tree.c: Likewise. + +Fri May 3 13:34:43 CEST 2002 Jan Hubicka + + * i386.md (attribute memory): Handle compares properly. + +Fri May 3 10:51:38 CEST 2002 Jan Hubicka + + * i386.md (sse_clrsf, sse_clrsi): Set memory attribute + to none. + +2002-05-02 Kazu Hirata + + * function.c: Fix formatting. + +2002-05-02 Jan Hubicka + + * haifa-sched.c (schedule_insn): Print table of instructions and + reservations. + (sched_block): Do not print ready list at verbosity level 1. + * sched-vis.c (print_insn): Make global. + * sched-ebb.c (ebb_print_insn): Rename from... + (print_insn): ... this one. + * sched-int.h (print_insn): Declare + +2002-05-02 Richard Henderson + + * haifa-sched.c (rank_for_schedule): Skip past last_scheduled_insn + emitted by cycle_display. + +2002-05-02 Loren J. Rittle + + * doc/install.texi (*-*-freebsd*): Update to latest status. + +2002-05-02 Jakub Jelinek + + PR target/6540 + * config.gcc (sparc*-*-solaris2*): Set float_format to i128. + * config/float-sparc.h: Assume 128-bit long double if + __LONG_DOUBLE_128__ is defined. + +2002-05-02 Vladimir Makarov + + * genattrtab.c (write_function_unit_info): Add a dummy element + when num_units == 0. + +2002-05-02 Herman A.J. ten Brugge + + * predict.c: (propagate_freq, estimate_bb_frequencies): Use + TYPE_MODE (double_type_node) instead of DFmode. + +Thu May 2 19:50:04 CEST 2002 Jan Hubicka + + * cfgrtl.c (try_redirect_by_replacing_jump): Do not kill computed + jumps post reload. + * toplev.c (rest_of_compilation): Revert Richard's patch. + +2001-05-02 John David Anglin + + * pa/x-ada (ADA_CFLAGS): Rename to X_ADA_CFLAGS. + +2002-05-02 Catherine Moore + + * config/v850/v850.h (TRAMPOLINE_TEMPLATE): Change r5 to r20. + +2002-05-02 Kazu Hirata + + * combine.c: Fix comment typos. + * expr.c: Likewise. + * genautomata.c: Likewise. + * stmt.c: Likewise. + * tree.h: Likewise. + +2002-05-02 Joseph S. Myers + + * doc/install.texi: State GNAT version requirements. + +2002-05-02 Nick Clifton + + * config/fr30/fr30.h (GO_IF_LEGITIMATE_ADDRESS): Accept any form + of the frame pointer or arg pointer register which strict register + checking is not enabled. + +2002-05-02 Aldy Hernandez + + * gcc.dg/altivec-8.c: New. + + * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow + PRE_INC and PRE_DEC for altivec modes. + +2002-05-01 Bruce Korb + + * fixinc/check.tpl(set-writable): make sure the function exists first + * fixinc/inclhack.def(alpha_assert): fix test_text + * fixinc/tests/base/assert.h: add in missing result + +2002-05-01 Jeff Law + + * pa.h (EXTRA_CONSTRAINT): Don't accept PIC addresses for the + 'T' constraint. + +2002-05-01 Joel Brobecker + + * dbxout.c (dbxout_type): Emit size information for range types, + as well, but only when using GDB extensions. + +2002-05-01 Richard Henderson + + * configure.in (HAVE_GAS_HIDDEN): Replace SPARC feature test with + target-independent gnu binutils date test. + +2002-05-01 Richard Henderson + + * cfgcleanup.c (merge_blocks_move_successor_nojumps): Emit dump + info before expunging the block. + +2002-05-01 Jakub Jelinek + + * cppinit.c (cpp_handle_option) [-dM]: Don't set no_output here... + (cpp_post_options): ...but here. Disable -dD, -dN and -dI when + -M -or -MM is in effect. + +2002-05-01 Zack Weinberg + + * config.gcc: Correct test of --enable-obsolete. Obsolete all + A29k configurations. + * doc/install.texi: Update to match. + +2002-05-01 Franz Sirl + + PR bootstrap/6514 + * varasm.c (globalize_decl): Compare DECL_ASSEMBLER_NAME to check + for duplicates. Always loop over whole list. + +Wed May 1 10:32:37 2002 Richard Kenner + + * reload.c (find_reloads, case 'p'): Set BADOP to 0. + +2002-05-01 Joel Sherrill + + * config/sparc/t-elf (sparc-rtems, sparc-elf): Build assembly + support routines. + +2002-05-01 Joel Sherrill + + * config/arm/rtems-elf.h: Add #undef TARGET_VERSION to prevent warning. + +2002-05-01 David Edelsohn + + * rs6000.md (abssi2_nopower): Convert to define_insn_and_split. + (nabs_nopower): Same. + (floatdisf2): New pattern. + (absdi2): Convert to define_insn_and_split. + (nabsdi2): Same. + (trunctfsf2): Same. + (floatditf2): Same. + (floatsitf2): Same. + (fix_trunctfdi2): Same. + (fix_trunctfsi2): Same. + +2002-05-01 Joseph S. Myers + + * doc/install.texi: Update Texinfo version requirement + documentation. + +2002-05-01 Jakub Jelinek + + PR target/6512, PR target/5628 + * config/sparc/sparc.md (movdf_insn_v9only_novis): Don't allow >= %f32 + when memory is not aligned. + (movdf_insn_v9only_vis): Likewise. + * config/sparc/sparc.h (SECONDARY_INPUT_RELOAD_CLASS): Request a FP_REGS + temporary for EXTRA_FP_REGS DFmode load from unaligned memory. + (SECONDARY_OUTPUT_RELOAD_CLASS): Similarly. + +2002-05-01 Aldy Hernandez + + * gcc.dg/altivec-7.c: New. + + * config/rs6000/altivec.h: Cleanup. + +2002-04-30 Aldy Hernandez + + * doc/invoke.texi (Option Summary): Add -mvrsave=. + (RS/6000 and PowerPC Options): Document -mvrsave=. + + * config/rs6000/rs6000.c (rs6000_altivec_vrsave): New global. + (rs6000_altivec_vrsave_string): Same. + (rs6000_override_options): Call rs6000_parse_vrsave_option. + (rs6000_parse_vrsave_option): New. + (rs6000_stack_info): Only generate vrsave instructions when + TARGET_ALTIVEC_VRSAVE. + + * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -mvrsave= option. + (rs6000_altivec_vrsave_string): Define extern. + (rs6000_altivec_vrsave): Same. + (TARGET_ALTIVEC_VRSAVE): New. + +2002-04-30 Richard Henderson + + PR opt/6516 + * toplev.c (rest_of_compilation): Don't run cross-jump before + bb-reorder. + +2002-04-30 Tom Rix + + * regrename.c (build_def_use, copyprop_hardreg_forward_1): Sanity + check which_alternative. + +2002-04-30 Kazu Hirata + + * cpplex.c: Fix comment formatting. + * function.c: Likewise. + * integrate.c: Likewise. + * regrename.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * tree-inline.c: Likewise. + +2002-04-30 John David Anglin + + * config.gcc (hppa1.1-*-pro*, hppa1.1-*-osf*, hppa1.1-*-rtems*, + hppa1.0-*-osf*, hppa1.1-*-bsd*, hppa1.1-*-hpux10*, hppa2*-*-hpux10*, + hppa1.0-*-hpux10*, hppa*64*-*-hpux11*, hppa1.1-*-hpux11*, + hppa2*-*-hpux11*, hppa1.0-*-hpux11*, hppa*-*-lites*): Define xmake_file. + * pa/t-linux, pa/t-pa, pa/t-pa64, t-pro (T_ADAFLAGS): Delete. + * pa/x-ada: New file. Define ADA_CFLAGS. + +2002-04-30 Hans-Peter Nilsson + + * config/mmix/mmix.h (MMIX_LAST_STACK_REGISTER_REGNUM): Renamed + from MMIX_LAST_REGISTER_FILE_REGNUM. + (NO_IMPLICIT_EXTERN_C): Remove cryptic obsolete comment. + (struct machine_function): New member highest_saved_stack_register + previously static variable in mmix.c. + (MACHINE_DEPENDENT_REORG): Define. + * config/mmix/mmix.c (highest_saved_stack_register): Deleted. + (MMIX_OUTPUT_REGNO): New. + (mmix_target_asm_function_prologue): Move calculation of last used + saved-stack-register into... + (mmix_machine_dependent_reorg): New function. Update to also handle + !TARGET_ABI_GNU. + (mmix_print_operand): Apply MMIX_OUTPUT_REGNO when emitting + register names, simplify somewhat by new variable regno. + : Remove fixed FIXME. Always emit highest used saved + register. + (mmix_print_operand_address): Apply MMIX_OUTPUT_REGNO when + emitting register names. + (mmix_asm_output_reg_push, mmix_asm_output_reg_pop): Ditto. + (mmix_dbx_register_number): Apply MMIX_OUTPUT_REGNO here too. + Remove fixed FIXME. + * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): + Declare. + + * config/mmix/mmix.md ("divmoddi4"): Update head comment. + +2002-04-30 Richard Henderson + + * config/sparc/sparc.c (emit_soft_tfmode_libcall, + emit_soft_tfmode_binop, emit_soft_tfmode_unop, emit_soft_tfmode_cvt, + emit_hard_tfmode_operation, emit_tfmode_binop, emit_tfmode_unop, + emit_tfmode_cvt): New. + * config/sparc/sparc.md (extendsftf2, extenddftf2, trunctfsf2, + trunctfdf2, floatsitf2, floatunssitf2, floatditf2, floatunsditf2, + fix_trunctfsi2, fixuns_trunctfsi2, fix_trunctfdi2, fixuns_trunctfdi2, + addtf3, subtf3, multf3, divtf3, sqrttf2): Use them. + * config/sparc/sparc-protos.h: Update. + +2002-04-30 Janis Johnson + + * install.texi (Final install): Add to the list of info to include + in a report of a successful bootstrap, and add link to 3.1 list. + +Tue Apr 30 19:15:36 CEST 2002 Jan Hubicka + + * i386.md (type): Add new SSE/MMX subtypes, remove usused fop1. + (mode): Add vector modes + (i387): Kill attribute. + (unit): New attribute. + (length_immediate): Grok new types. + (prefix_data16, prefix_rep, prefix_0f): Fix for SSE/MMX. + (modrm): Use "unit". + (memory): Handle MMX/SSE properly. + (scheduling descriptions): Kill uses of fop1. + (sse, mmx, fp patterns): Set type and mode properly. + +Tue Apr 30 09:31:59 2002 Jeffrey A Law (law@redhat.com) + + * pa.c (override_options): Default to PA8000 scheduling. + * doc/invoke.texi (HP-PA options): Mention newly added 7300 + scheduling parameter. + + * pa.md (7100lc, 7200, 7300 scheduling): Slightly refine + handling of double precision multiplies. + + * pa.md (7100lc, 7200, 7300 scheduling): Refine handling of + fpdiv and fpsqrt instructions. + (7200 & 7300 scheduling): Fix typo in handling of + store-load and store-store penalties. + +2002-04-30 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Use MIPS instead of Mips and + mips. Add two missing commas. + +2002-04-30 Paolo Carlini + + * doc/contrib.texi (Contributors): Update Paolo Carlini's + and Benjamin Kosnik's entries. + +2002-04-29 David S. Miller + + * config/sparc/sparc.h (BRANCH_COST, PREFETCH_BLOCK, + SIMULTANEOUS_PREFETCHES): Tune for UltraSPARC-III. + * config/sparc/sparc.md (call + jmp 32-bit peepholes): Likewise. + * config/sparc/sparc.c (sparc_initialize_trampoline): Likewise. + +2002-04-29 Franz Sirl + + * combine.c (find_split_point): Use gen_int_mode. + +2002-04-29 Vladimir Makarov + + Merging code from dfa-branch: + + 2002-04-24 Vladimir Makarov + + * genautomata.c (output_reserv_sets): Fix typo. + + 2002-04-23 Vladimir Makarov + + * genautomata.c (output_reserv_sets): Remove + next_cycle_output_flag. + + Thu Apr 18 08:57:06 2002 Jeffrey A Law (law@redhat.com) + + * sched-rgn.c (init_ready_list): Make the DFA code handle + USE/CLOBBER insns in the same way as the traditional + scheduler. + (new_ready): Similarly.. + + 2002-04-17 Vladimir Makarov + + * haifa-sched.c (schedule_block): Change the DFA state only after + issuing insn. + + Wed Apr 17 15:38:36 2002 Jeffrey A Law (law@redhat.com) + + * pa.c (hppa_use_dfa_pipeline_interface): New function. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define. + (override_options): Add PA7300 scheduling support. + (pa_adjust_cost): Update various comments. Properly + handle anti and output dependencies when using the + DFA scheduler. + (pa_issue_rate): Add PA7300 scheduling support. + (pa_can_combine_p): Call extract_insn before calling + constrain_operands (taken from mainline tree). + * pa.h (enum processor_type): Add PROCESSOR_PA7300. + * pa.md (cpu attr): Add 7300. Rewrite pipeline + descriptions using DFA descriptions. Add PA7300 + scheduling support. + + 2002-03-30 David S. Miller + + Add UltraSPARC-III DFA scheduling support. + * config/sparc/sparc.md (define_attr type): Add fpcrmove. + Update FP conditional move on register insn patterns to use it, as + appropriate. + (define_attr cpu): Add ultrasparc3. + (define_attr us3load_type): New, update integer load patterns to + set it, as appropriate. + (define_automaton): Add ultrasparc3_0 and ultrasparc3_1. + (rest): Add UltraSPARC3 scheduling description. + * config/sparc/sparc.h (TARGET_CPU_ultrasparc3): New. + (PROCESSOR_ULTRASPARC3): New. + ({ASM,CPP}_CPU64_DEFAULT_SPEC): Handle ultrasparc3. + ({ASM,CPP}_CPU_SPEC): Likewise. + (REGISTER_MOVE_COST): Likewise. + (RTX_COSTS): Likewise. + * config/sparc/sparc.c (sparc_override_options, + sparc_initialize_trampoline, sparc64_initialize_trampoline, + sparc_use_dfa_pipeline_interface, sparc_use_sched_lookahead, + sparc_issue_rate): Likewise. + * config/sparc/sol2.h: Likewise. + * config/sparc/sol2-sld-64.h: Likewise. + * config/sparc/linux64.h: Likewise. + + 2002-03-22 Vladimir Makarov + + * doc/md.texi: Add comments about usage the latency time for the + different dependencies and about case when two or more conditions + in different define_insn_reservations returns TRUE for an insn. + + * doc/md.texi: Add reference for automaton based pipeline + description. + + 2002-03-04 Vladimir Makarov + + * doc/passes.texi: Add missed information about genattrtab. + + 2002-03-01 Vladimir Makarov + + * genautomata.c (output_automata_list_transition_code): Check + automata_list on NULL. + + 2002-02-28 Vladimir Makarov + + * genautomata.c (output_insn_code_cases, + output_automata_list_min_issue_delay_code, + output_automata_list_transition_code, + output_automata_list_state_alts_code): Comment the functions. + + 2002-02-22 Vladimir Makarov + + * genautomata.c (automata_list_el_t): New typedef. + (get_free_automata_list_el,free_automata_list_el, + free_automata_list, automata_list_hash, automata_list_eq_p, + initiate_automata_lists, automata_list_start, automata_list_add, + automata_list_finish, finish_automata_lists, + output_insn_code_cases, output_automata_list_min_issue_delay_code, + output_automata_list_transition_code, + output_automata_list_state_alts_code, add_automaton_state, + form_important_insn_automata_lists): New functions and prototypes. + (insn_reserv_decl): Add members important_automata_list and + processed_p. + (ainsn): Add members important_p. + (automata_list_el): New structure. + (first_free_automata_list_el, current_automata_list, + automata_list_table): New global variables. + (create_ainsns): Initiate member important_p. + (output_internal_min_issue_delay_func): Generate the switch and + call output_insn_code_cases. + (output_internal_trans_func, output_internal_state_alts_func): + Ditto. + (generate): Call initiate_automata_lists. + (automaton_states): New global variable. + (expand_automata): Call form_important_insn_automata_lists. + (write_automata): Call finish_automata_lists. + + 2002-02-21 Vladimir Makarov + + * genautomata.c (add_excls, add_presence_absence): Check that + cpu units in the sets belong the same automaton. + + * rtl.def (EXCLUSION_SET, PRESENCE_SET, ABSENCE_SET): Add comment + about that cpu units in the sets belong the same automaton. + + * doc/md.texi: Ditto. + + 2001-12-20 Naveen Sharma + Nitin Gupta + + * config/sh/sh.c (sh_use_dfa_interface): New function. + + (sh_issue_rate): New Function. + TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE: define. + TARGET_SCHED_ISSUE_RATE: define. + + * config/sh/sh.md: Add DFA based pipeline description for SH4. + + (define_attr insn_class): New attribute used for DFA + scheduling. + (define_insn cmpgtsi_t): Set attribute insn_class mt_group. + (cmpgesi_t,cmpgtusi_t,cmpgeusi_t,cmpeqsi_t, + cmpeqdi_t): Likewise. + + (add,addc1,addsi3,subc,subc1,*subsi3_internal, + negc,negsi2,ashldi3_k,lshrdi3_k,ashrdi3_k): Set insn_class + ex_group. + (iorsi3,rotlsi3_1,rotlsi3_31,rotlsi3_16): Likewise. + + 2001-10-03 Vladimir Makarov + + * haifa-sched.c (queue_to_ready): Remove unnecessary condition for + break. + + 2001-10-03 Vladimir Makarov + + * genautomata.c (DFA_INSN_CODES_LENGTH_VARIABLE_NAME): New macro. + (output_dfa_insn_code_func): Expand dfa_insn_codes if it is + necessary. + (output_dfa_start_func): Initiate new variable insn_codes_length, + (write_automata): Output definition of the new variable. + + 2001-10-02 David S. Miller + + * haifa-sched.c (advance_one_cycle): New function. + (schedule_block): Use it. + (queue_to_ready): Use it, and also make sure to advance the DFA + state on all stall cycles, not just those where insn_queue links + are found. + + 2001-10-02 Richard Sandiford + + * haifa-sched.c (max_issue): Remove last_p argument. Only return + nonzero if the highest-priority instruction could be scheduled. + (choose_ready): Remove last argument from max_issue call. + + 2001-09-28 David S. Miller + + * config/sparc/sparc.c (sparc_use_sched_lookahead): Use 4 for + ultrasparc and 3 for other multi-issue sparcs. + + 2001-09-27 David S. Miller + + * config/sparc/sparc.md (cycle_display): New pattern. + * config/sparc/sparc.c (sparc_cycle_display): New. + (TARGET_SCHED_CYCLE_DISPLAY): Set it. + + 2001-09-25 David S. Miller + + Convert all of SPARC scheduling to DFA + * config/sparc/sparc.md: Kill all define_function_unit + directives and replace with DFA equivalent. + * config/sparc/sparc.c (ultrasparc_adjust_cost, + mark_ultrasparc_pipeline_state, ultra_cmove_results_ready_p, + ultra_fpmode_conflict_exists, ultra_find_type, + ultra_build_types_avail, ultra_flush_pipeline, + ultra_rescan_pipeline_state, ultrasparc_sched_reorder, + ultrasparc_variable_issue, ultrasparc_sched_init, + sparc_variable_issue, sparc_sched_reorder, ultra_code_from_mask, + ultra_schedule_insn, ultra_code_names, ultra_pipe_hist, + ultra_cur_hist, ultra_cycles_elapsed): Kill. + (sparc_use_dfa_pipeline_interface, sparc_use_sched_lookahead, + ultrasparc_store_bypass_p): New. + * config/sparc/sparc-protos.h (ultrasparc_store_bypass_p): + Declare. + + 2001-09-24 David S. Miller + + * haifa-sched.c (ready_remove): Fix thinko, we want to copy around + ready->vec[foo] not ready[foo]. + + 2001-09-07 Vladimir Makarov + + * doc/md.texi: Correct examples for define_insn_reservations + `mult' and `div'. + + 2001-09-07 Vladimir Makarov + + * genautomata.c (create_automata): Print message about creation of + each automaton. + (generate): Remove printing meease about creation of + automata. + + 2001-09-05 David S. Miller + + * config/sparc/linux.h: Set CPLUSPLUS_CPP_SPEC. + * config/sparc/linux64.h: Likewise. + + 2001-08-31 Vladimir Makarov + + * haifa-sched.c (insn_cost, schedule_insn, queue_to_ready, + schedule_block, sched_init, sched_finish): Add missed calls of + use_dfa_pipeline_interface. + + * sched-rgn.c (init_ready_list, new_ready, debug_dependencies): + Ditto. + + * sched-vis.c (get_visual_tbl_length): Ditto. + + 2001-08-27 Richard Henderson + + * genattr.c (main): Emit state_t even when not doing scheduling. + + 2001-08-27 Richard Henderson + + * genautomata.c (expand_automata): Always create a description. + + 2001-08-27 Vladimir Makarov + + * rtl.def (DEFINE_CPU_UNIT, DEFINE_QUERY_CPU_UNIT, EXCLUSION_SET, + PRESENCE_SET, ABSENCE_SET, DEFINE_BYPASS, DEFINE_AUTOMATON, + AUTOMATA_OPTION, DEFINE_RESERVATION, DEFINE_INSN_RESERVATION): New + RTL constructions. + + * genattr.c (main): New variable num_insn_reservations. Increase + it if there is DEFINE_INSN_RESERVATION. Output automaton based + pipeline hazard recognizer interface. + + * genattrtab.h: New file. + + * genattrtab.c: Include genattrtab.h. + (attr_printf, check_attr_test, make_internal_attr, + make_numeric_value): Move protypes into genattrtab.h. Define them + as external. + (num_dfa_decls): New global variable. + (main): Process DEFINE_CPU_UNIT, DEFINE_QUERY_CPU_UNIT, + DEFINE_BYPASS, EXCLUSION_SET, PRESENCE_SET, ABSENCE_SET, + DEFINE_AUTOMATON, AUTOMATA_OPTION, DEFINE_RESERVATION, + DEFINE_INSN_RESERVATION. Call expand_automata and write_automata. + + * genautomata.c: New file. + + * rtl.h (LINK_COST_ZERO, LINK_COST_FREE): Remove them. + + * sched-int.h: (curr_state): Add the external definition for + automaton pipeline interface. + (haifa_insn_data): Add comments for members blockage and units. + + * target-def.h (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN, + TARGET_SCHED_DFA_POST_CYCLE_INSN, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_INIT_DFA_BUBBLES, TARGET_SCHED_DFA_BUBBLE): New + macros. + (TARGET_SCHED): Use the new macros. + + * target.h (use_dfa_pipeline_interface, init_dfa_pre_cycle_insn, + dfa_pre_cycle_insn, init_dfa_post_cycle_insn, dfa_post_cycle_insn, + first_cycle_multipass_dfa_lookahead, init_dfa_bubbles, + dfa_bubble): New members in gcc_target.sched. + + * haifa-sched.c (insert_schedule_bubbles_p): New variable. + (MAX_INSN_QUEUE_INDEX): New macro for automaton interface. + (insn_queue): Redefine it as pointer to array. + (NEXT_Q, NEXT_Q_AFTER): Use MAX_INSN_QUEUE_INDEX instead of + INSN_QUEUE_SIZE. + (max_insn_queue_index_macro_value): New variable. + (curr_state, dfa_state_size, ready_try): New varaibles for + automaton interface. + (ready_element, ready_remove, max_issue): New function prototypes + for automaton interface. + (choose_ready): New function prototype. + (insn_unit, blockage_range): Add comments. + (unit_last_insn, unit_tick, unit_n_insns): Define them for case + FUNCTION_UNITS_SIZE == 0. + (insn_issue_delay, actual_hazard_this_instance, schedule_unit, + actual_hazard, potential_hazard): Add comments. + (insn_cost): Use cost -1 as undefined value. Remove + LINK_COST_ZERO and LINK_COST_FREE. Add new code for automaton + pipeline interface. + (ready_element, ready_remove): New functions for automaton + interface. + (schedule_insn): Add new code for automaton pipeline interface. + (queue_to_ready): Add new code for automaton pipeline interface. + Use MAX_INSN_QUEUE_INDEX instead of INSN_QUEUE_SIZE. + (debug_ready_list): Print newline when the queue is empty. + (max_issue): New function for automaton pipeline interface. + (choose_ready): New function. + (schedule_block): Add new code for automaton pipeline interface. + Print ready list before scheduling each insn. + (sched_init): Add new code for automaton pipeline interface. + Initiate insn cost by -1. + (sched_finish): Free the current automaton state and finalize + automaton pipeline interface. + + * sched-rgn.c: Include target.h. + (init_ready_list, new_ready, debug_dependencies): Add new code for + automaton pipeline interface. + + * sched-vis.c: Include target.h. + (get_visual_tbl_length): Add code for automaton interface. + (target_units, print_block_visualization): Add comments. + + * Makefile.in (GETRUNTIME, HASHTAB, HOST_GETRUNTIME, HOST_HASHTAB, + USE_HOST_GETRUNTIME, USE_HOST_HASHTAB, HOST_VARRAY): New variables. + (sched-rgn.o, sched-vis.o): Add new dependency file target.h. + (getruntime.o, genautomata.o): New entries. + (genattrtab.o): Add new dependency file genattrtab.h. + (genattrtab): Add new dependencies. Link it with `libm.a'. + (getruntime.o, hashtab.o): New entries for canadian cross. + + * doc/md.texi: Description of automaton based model. + + * doc/tm.texi (TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_ADJUST_COST): + Add comments. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_DFA_POST_CYCLE_INSN, + TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_INIT_DFA_BUBBLES, TARGET_SCHED_DFA_BUBBLE): The new + hook descriptions. + (TRADITIONAL_PIPELINE_INTERFACE, DFA_PIPELINE_INTERFACE, + MAX_DFA_ISSUE_RATE): New macro descriptions. + + * doc/contrib.texi: Add dfa based scheduler contribution. + + * doc/gcc.texi: Add more information about genattrtab. + +Mon Apr 29 17:19:10 2002 Richard Kenner + + * reload1.c (eliminate_regs, case SUBREG): Fix typo in + adjust_address_nv call. + +2002-04-29 Janis Johnson + + * doc/install.texi (Testing): Provide additional information, and + a stronger encouragement, for running the testsuites. + +2002-04-29 DJ Delorie + + * config/mips/mips.c (mips_parse_cpu): Warn if the CPU name is + given in upper case. + +2002-04-29 Rainer Orth + + * fixinc/inclhack.def (solaris_widec): Include in + Solaris 2 if missing. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/widec.h: New file. + +2002-04-29 Nick Clifton + + * toplev.c (f_options): Add "profile" switch so that + -fno-profile can be used to disable -p. + +2002-04-29 Bernd Schmidt + + * c-common.c (type_for_mode): Add support for V2DFmode, V2DImode, + UV2DImode. + * tree.c (build_common_tree_nodes_2): Likewise. + * tree.h (enum tree_index): Likewise. + (V2DF_type_node, V2DI_type_node, unsigned_V2DI_type_node): Define. + + * config/i386/i386.c (bdesc_comi, bdesc_2arg, bdesc_1arg): Add SSE2 + entries. + (init_mmx_sse_builtins): Initialize SSE2 builtins. + (ix86_expand_builtin): Add support for SSE2 builtins. + * config/i386/i386.h (VALID_SSE2_REG_MODE): New macro. + (VALID_SSE_REG_MODE): Use it. + (VECTOR_MODE_SUPPORTED_P): Allow SSE2 modes here as well. + (enum ix86_builtins): Add SSE2 builtins. + * config/i386/i386.md (movv2df_internal, movv2df, movv8hi_internal, + movv8hi, movv16qi_internal, movv16qi, pushv2df, pushv8hi, pushv16qi, + addv2df3, vmaddv2df3, subv2df3, vmsubv2df3, mulv2df3, vmmulv2df3, + divv2df3, vmdivv2df3, smaxv2df3, vmsmaxv2df3, sminv2df3, vmsminv2df3, + sse2_anddf3, sse2_nanddf3, sse2_iordf3, sse2_xordf3, sqrtv2df2, + vmsqrtv2df2, maskcmpv2df3, maskncmpv2df3, vmmaskcmpv2df3, + vmmaskncmpv2df3, sse2_comi, sse2_ucomi, sse2_movmskpd, sse2_pmovmskb, + sse2_maskmovdqu, sse2_movntv2df, sse2_movntti, sse2_movntsi, cvtdq2ps, + cvtps2dq, cvttps2dq, cvtdq2pd, cvtpd2dq, cvttpd2dq, cvtpd2pi, + cvttpd2pi, cvtpi2pd, cvtsd2si, cvttsd2si, cvtsi2sd, cvtsd2ss, + cvtss2sd, cvtpd2ps, cvtps2pd, addv16qi3, addv8hi3, addv4si3, addv2di3, + ssaddv16qi3, ssaddv8hi3, usaddv16qi3, usaddv8hi3, subv16qi3, subv8hi3, + subv4si3, subv2di3, sssubv16qi3, sssubv8hi3, ussubv16qi3, ussubv8hi3, + mulv8hi3, smulv8hi3_highpart, umulv8hi3_highpart, sse2_umulsidi3, + sse2_umulv2siv2di3, sse2_pmaddwd, sse2_clrti, sse2_uavgv16qi3, + sse2_uavgv8hi3, sse2_psadbw, sse2_pinsrw, sse2_pextrw, sse2_pshufd, + sse2_pshuflw, sse2_pshufhw, eqv16qi3, eqv8hi3, eqv4si3, gtv16qi3, + gtv8hi3, gtv4si3, umaxv16qi3, smaxv8hi3, uminv16qi3, sminv8hi3, + ashrv8hi3, ashrv4si3, lshrv8hi3, lshrv4si3, sse2_lshrv2di3, + ashlv8hi3, ashlv4si3, sse2_ashlv2di3, sse2_ashlti3, sse2_lshrti3, + sse2_unpckhpd, sse2_unpcklpd, sse2_packsswb, sse2_packssdw, + sse2_packuswb, sse2_punpckhbw, sse2_punpckhwd, sse2_punpckhdq, + sse2_punpcklbw, sse2_punpcklwd, sse2_punpckldq, sse2_movapd, + sse2_movupd, sse2_movdqa, sse2_movdqu, sse2_movdq2q, sse2_movq2dq, + sse2_movhpd, sse2_movlpd, sse2_loadsd, sse2_movsd, sse2_storesd, + sse2_shufpd, sse2_clflush, sse2_mfence, mfence_insn, sse2_lfence, + lfence_insn): New patterns. + (sse2_andti3, sse2_nandti3, sse2_iorti3, sse2_xorti3): Renamed from + sse_andti3_sse2, sse_nandti3_sse2, sse_iorti3_sse2, sse_xorti3_sse2. + +Mon Apr 29 17:03:24 CEST 2002 Jan Hubicka + + * i386.md (sse_mov?fcc*): Revert patch of Mar 14th. + +2002-04-29 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Paolo Carlini and + Janis Johnson. + Update Richard Henderson, Jakub Jelinek, and Mark Mitchell. + Refer to Objective-C instead of ObjC, SPARC instead of sparc, + and CPU instead of cpu. + +Mon Apr 29 13:36:41 CEST 2002 Jan Hubicka + + * toplev.c (flag_if_conversion, flag_if_conversion2): New static + variables. + (lang_independent_options): Add -fif-conversion, -fif-conversion2 + (rest_of_compilation): Do if conversion only when asked for. + (parse_options_and_default_flags): Set new variables to 1 for -O1 + * invoke.texi (-fif-conversion, -fif-conversion2): Document. + +Mon Apr 29 13:02:50 CEST 2002 Jan Hubicka + + * i386.c (dbx64_register_map): Fix typo. + +Mon Apr 29 12:18:35 CEST 2002 Jan Hubicka + + * predict.c (real_zero, real_one, real_almost_one, real_br_prob_base, + real_one_half, real_bb_freq_max): New static variables. + (debug_profile_bbauxs): Kill. + (process_note_predictions): Kill unused variable. + (block_info_def, edge_info_def): Use REAL_VALUE_TYPE instead of + volatile double. + (propagate_freq): Use REAL_ARITHMETICS. + (estimate_bb_frequencies): Likevise; init new static variables. + * Makefile.in (predict.o): Add dependency on real.h + +2002-04-28 David S. Miller + + PR target/6500 + * config/sparc/sparc.md (prefetch): Emit properly for 32-bit vs. + 64-bit TARGET_V9. Do not use prefetch page, use prefetch for + several {reads,writes} instead. + * config/sparc/sparc.h (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): + Define. + +2002-04-27 David S. Miller + + PR target/6494 + * config/sparc/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Be mindful + of the stack bias. + + * config/sparc/linux.h, config/sparc/linux64.h: Don't bother + including signal.h and sys/ucontext.h, not needed. + +2002-04-29 Hans-Peter Nilsson + + * varasm.c (output_constant_def): Correct test for not calling + ENCODE_SECTION_INFO for INTEGER_CST. + +2002-04-29 Neil Booth + + * cppexp.c (lex): Move some code to _cpp_parse_expr, but + keep most cases as function eval_token. + (eval_token): New function. + (_cpp_parse_expr): Read token here for improved diagnostics. + Don't use op_as_text. Detect bad ':' here. + (reduce): Don't detect bad ':' here. + (op_as_text): Remove. + * cpphash.h (_cpp_test_assertion): Change prototype. + * cpplib.c (_cpp_test_assertion): Change prototype. + +2002-04-28 Richard Henderson + + PR c/5154 + * ggc-common.c (ggc_mark_rtx_children_1): Rename from... + (ggc_mark_rtx_children): New. + +2002-04-28 Jakub Jelinek + + PR target/6496 + * config/sparc/sparc.md (call + jump 32-bit peepholes): Disable jump + after call peepholes for UltraSPARC. + (call + jump 64-bit peepholes): Remove. + +2002-04-28 Franz Sirl + + PR c/6497 + * config/rs6000/rs6000.md (sCC patterns): Remove clobber and use + result as temporary value. + +2002-04-28 Jakub Jelinek + + PR c++/6396 + * toplev.c (rest_of_compilation): Only run regrename and copy + propagation if optimizing. + +2002-04-28 Jakub Jelinek + + PR optimization/6475 + * reload1.c (alter_reg): Only call set_mem_expr if I is home pseudo + register of REGNO_DECL (i). + * Makefile.in (reload1.o): Add $(TREE_H). + +2002-04-28 Neil Booth + + * cppexp.c (lex): Update to use state.skip_eval. + (struct op): Remove prio and flags members. + (FLAG_BITS, FLAG_MASK, PRIO_SHIFT, EXTRACT_PRIO, EXTRACT_FLAGS, + SHORT_CIRCUIT, RIGHT_ASSOC, ..._PRIO, op_to_prio): Remove. + (LEFT_ASSOC): New macro. + (optab): New table of operator priorities and flags. + (SHIFT): Update. + (_cpp_parse_expr): Clean up logic. Return bool. Use a + malloc-ed parser stack. + (reduce): New; reduce the operator stack. + (_cpp_expand_op_stack): Expand the operator stack as necessary. + * cpphash.h (struct op): Predeclare. + (struct cpp_reader): New members op_stack, op_limit. + (struct lexer_state): New member skip_eval. + (_cpp_parse_expr): Update. + (_cpp_expand_op_stack): New. + * cpplib.c (do_if): Update. + * cppinit.c (cpp_create_reader): Create op stack. + (cpp_destroy): And destroy it. + * cpplib.h (CPP_LAST_CPP_OP): Correct. + (TTYPE_TABLE): Correct. + +2002-04-28 Franz Sirl + + PR c/6343 + * c-decl.c (duplicate_decls): Call merge_weak. + * c-pragma.c (apply_pragma_weak): Warn about misuse. + * output.h (merge_weak): Prototype merge_weak. + * varasm.c (merge_weak): New function. + (declare_weak): Make sure we don't give an error on VAR_DECLs. + Mark RTL with SYMBOL_REF_WEAK. + +2002-04-27 Kurt Garloff + + * tree-inline.c (inlinable_function_p): Improve heuristics + by using a smoother function to cut down allowable inlinable size. + * param.def: Add parameters max-inline-insns-single, + max-inline-slope, min-inline-insns that determine the exact + shape of the above function. + * param.h: Likewise. + +2002-04-26 Richard Henderson + + * c-parse.in (malloced_yyss, malloced_yyvs): New. + (yyoverflow): Re-add. Set them. + (free_parser_stacks): New. + * c-common.h: Declare it. + * c-lex.c (c_common_parse_file): Call it. + +2002-04-26 Richard Henderson + + * cfgrtl.c (tidy_fallthru_edge): Don't use next_real_insn + for fallthru search. + +2002-04-26 Eric Christopher + + PR optimization/3700 + * config/mips/mips.c (mips_issue_rate): Define. New function. + (TARGET_SCHED_ISSUE_RATE): Use. + +2002-04-25 David S. Miller + + PR target/6422 + * reorg.c (optimize_skip): Do not allow exception causing + instructions to be considered for delay slots. + (fill_simply_delay_slots, fill_slots_from_thread): Likewise. + (relax_delay_slots): Do not try to consider exception causing + instructions as redundant. + +2002-04-26 Richard Henderson + + PR c/5225 + * c-typeck.c (build_unary_op) [CONVERT_EXPR]: Invoke non_lvalue. + +2002-04-26 Mark Mitchell + + PR bootstrap/6445 + * config/i386/i386.md (untyped_call): Return the value in a float + register if TARGET_FLOAT_RETURNS_IN_80387, not just if + TARGET_80387. + +2002-04-26 Alexandre Oliva + + * tree.c (tree_int_cst_lt): Compare constants whose types differ + in unsigned-ness correctly. + +2002-04-26 John David Anglin + + * pa.h (FUNCTION_OK_FOR_SIBCALL): Don't do sibcalls when using the + portable runtime model. + +2002-04-26 Richard Henderson + + * c-parse.in (yyoverflow): Revert. + +2002-04-26 David Edelsohn + Richard Henderson + + * config/rs6000/rs6000.md (sCC pattern): Remove clobber and use + result as temporary value. + +2002-04-26 Richard Henderson + + PR c/3581 + * c-common.c (fix_string_type): Split out of ... + (combine_strings): ... here. Take a varray, not a tree list. + (c_expand_builtin_printf): Use fix_string_type. + * c-common.h: Update decls. + * c-parse.in (string): Remove. Update all uses to use STRING + instead, and not call combine_strings. + (yylexstring): New. + (_yylex): Use it. + * c-typeck.c (simple_asm_stmt): Don't call combine_strings. + (build_asm_stmt): Likewise. + * objc/objc-act.c (my_build_string): Use fix_string_type. + (build_objc_string_object): Build varray for combine_strings. + +2002-04-26 Bo Thorsen + + * config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Define for + x86-64. + +2002-04-26 Neil Booth + + * cppexp.c (CPP_UMINUS, CPP_UPLUS): New. + (HAVE_NO_R_OPERAND): Remove. + (HAVE_VALUE): Remove. + (op_to_prio): Update. + (UNARY): Don't alter flags. + (_cpp_parse_expr): want_value used to indicate whether + a number or unary operator is expected next. Distinguish + unary and binary +/-. + (op_as_text): Update for unary operators. + +2002-04-25 Richard Henderson + + PR c/2161 + * c-parse.in (yyoverflow): New. + +2002-04-25 Richard Henderson + + PR c/2098 + * c-common.c (shorten_compare): Simplfy conditions leading to + the generation of a warning. + +2002-04-25 Richard Henderson + + PR c/2035 + * expmed.c (extract_bit_field): Fall through to generic code rather + than aborting on subreg special case. + +2002-04-25 David S. Miller + + * config/sparc/sparc.h (FUNCTION_OK_FOR_SIBCALL): Add back check + for DECL being NULL. + +2002-04-25 Steve Christiansen + + * doc/md.texi (Machine Constraints): Add IA-64 constraints. + +2002-04-25 Eric Botcazou + + * c-decl.c (grokdeclarator): Remove outdated ??? note + on invalid declaration of flexible array members. + +2002-04-25 Richard Henderson + + * doc/invoke.texi: Document -gdwarf{,-2} vs debug level. + +2002-04-25 Ulrich Weigand + + * config/s390/s390.c (s390_emit_epilogue): Always restore registers + needed by the compiler, even if they are used as global regs. + +2002-04-25 Matt Hiller + + * mips.c (mips_class_max_nregs, mips_register_move_cost): New + functions. + * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls + of the corresponding functions. + * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): + New prototypes. + +2002-04-25 Matt Hiller + + * config/mips/mips.h (mips_sw_reg_names): Declare as extern. + + (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. + (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor + registers, adjust comment accordingly. + (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, + reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, + DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries + for coprocessor registers. + (ADDITIONAL_REGISTER_NAMES): Include + ALL_COP_ADDITIONAL_REGISTER_NAMES. + + (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, + COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, + COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, + COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, + COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. + + (mips_char_to_class): Adjust comment to include coprocessor + constraint letters. + + * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): + New functions. + (mips_reg_names, mips_regno_to_class): Include coprocessor + information. + (mips_sw_reg_names): Ditto, make non-static. + (mips_move_1word): Handle moves to and from coprocessor registers. + (mips_move_2words): Handle moves to and from coprocessor + registers. + (mips_class_max_nregs, mips_register_move_cost): Handle + coprocessor register classes. + (override_options): Initialize mips_char_to_class and + mips_hard_regno_mode_ok properly for coprocessor registers. + + * config/mips/mips.md (movdi_internal, movdi_internal2, + movsi_internal1, movsi_internal2): Add constraint-sets for + coprocessor registers. + * testsuite/gcc.c-torture/mipscop-1.c: New testcase. + * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target + isn't mips. + * testsuite/gcc.c-torture/mipscop-2.c: New testcase. + * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target + isn't mips. + * testsuite/gcc.c-torture/mipscop-3.c: New testcase. + * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target + isn't mips. + * testsuite/gcc.c-torture/mipscop-4.c: New testcase. + * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target + isn't mips. + + * doc/tm.texi: Document feature. + +2002-04-25 Neil Booth + + * integrate.c (function_attribute_inlinable_p): Simplify. + Check the table pointer is not NULL. + +2002-04-25 Steven Bosscher + + * doc/c-tree.texi: Fix typo in introduction. + +2002-04-25 Neil Booth + + * c-common.h (c_common_parse_file): Update. + * c-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. + * c-lex.c (YYDEBUG): Get from c-lex.h. + (c_common_parse_file): Update. + * c-lex.h (YYDEBUG, yydebug): New. + * c-parse.in (YYDEBUG): Get from c-lex.h. + (c_set_yydebug): Remove. + * c-tree.h (c_set_yydebug): Remove. + * langhooks-def.h (lhd_do_nothing_i): New. + (lhd_set_yydebug, LANG_HOOKS_SET_YYDEBUG): Remove. + (LANG_HOOKS_PARSE_FILE, LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_do_nothing_i): New. + (lhd_set_yydebug): Remove. + * langhooks.h (struct lang_hooks): Update. + * toplev.c (set_yydebug): New. + (compile_file): Update call to parse_file hook. + (decode_d_option): Update. +objc: + * objc-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. + +Wed Apr 24 23:45:37 2002 J"orn Rennecke + + * loop.c (load_mems): Don't change the interface of called functions. + + * calls.c (expand_call): Take current_function_pretend_args_size + into account when setting argblock for sibcalls. + +2002-04-24 Matt Hiller + + * cpplex.c: Remove conditional #undef of MULTIBYTE_CHARS. + * c-lex.c: Ditto. + + * cpplex.c (skip_line_comment): Process comment one multibyte + character at a time rather than one char at a time, if + appropriate. + (parse_string): Process string one multibyte character at a time + rather than one char at a time, if appropriate. + * c-lex.c (lex_string): Lex and copy multibyte strings + appropriately. + * cpplib.h (cppchar_t): Change to unsigned. + +2002-04-24 Richard Henderson + + PR c/3467 + * c-decl.c (grokdeclarator): Don't pedwarn variable sized arrays + for c99. + +Wed Apr 24 21:51:54 2002 J"orn Rennecke + + * sh.c (sh_va_arg): If argument was passed by reference, + dereference the pointer. + + * sh.h (PIC_OFFSET_TABLE_REGNUM): Conditionalize on flag_pic. + + * sh.md (divsi3_i4_media): Use match_operand for input values + rather than hard registers. + (divsi3 - TARGET_SHMEDIA_FPU case): Don't ferry values + unnecessarily through hard registers. Keep copies of pseudo + registers outside of the libcall sequence. + + * sh.md (casesi_shift_media): Add modes. + + * sh.h (RETURN_IN_MEMORY): Return variable size BLKmode + values in memory. + +2002-04-24 Neil Booth + + * attribs.c (c_common_attribute_table): Move table and handlers + to c-common.c. + (format_attribute_table, lang_attribute_table, + lang_attribute_common): Remove. + (init_attributes): Replace NULL pointers with pointers to the + empty table. + (handle_packed_attribute, handle_nocommon_attribute, + handle_common_attribute, handle_noreturn_attribute, + handle_noinline_attribute, handle_always_inline_attribute, + handle_used_attribute, handle_unused_attribute, + handle_const_attribute, handle_transparent_union_attribute, + handle_constructor_attribute, handle_destructor_attribute, + handle_mode_attribute, handle_section_attribute, + handle_aligned_attribute, handle_weak_attribute, + handle_alias_attribute, handle_visibility_attribute, + handle_no_instrument_function_attribute, handle_malloc_attribute, + handle_no_limit_stack_attribute, handle_pure_attribute, + handle_deprecated_attribute, handle_vector_size_attribute, + vector_size_helper): Move to c-common.c. + * c-common.c (c_common_attribute_table, + handle_packed_attribute, handle_nocommon_attribute, + handle_common_attribute, handle_noreturn_attribute, + handle_noinline_attribute, handle_always_inline_attribute, + handle_used_attribute, handle_unused_attribute, + handle_const_attribute, handle_transparent_union_attribute, + handle_constructor_attribute, handle_destructor_attribute, + handle_mode_attribute, handle_section_attribute, + handle_aligned_attribute, handle_weak_attribute, + handle_alias_attribute, handle_visibility_attribute, + handle_no_instrument_function_attribute, handle_malloc_attribute, + handle_no_limit_stack_attribute, handle_pure_attribute, + handle_deprecated_attribute, handle_vector_size_attribute, + vector_size_helper): Move from attribs.c. + * c-common.h (c_common_attribute_table, + c_common_format_attribute_table): New. + * c-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, + LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine. + * langhooks-def.h (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, + LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): 3 new attribute hooks. + * target-def.h (TARGET_ATTRIBUTE_TABLE): Default to NULL. + * target.h: Update comment. + * tree.c (default_target_attribute_table): Remove. + * tree.h (default_target_attribute_table, format_attribute_table, + lang_attribute_table, lang_attribute_common): Remove. +objc: + * objc-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, + LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Redefine. + +2002-04-24 Jason Merrill + + * dwarf2.h (enum dwarf_attribute): Add DW_AT_GNU_vector. + * dwarf2out.c (dwarf_attr_name): Support it. + (gen_array_type_die): Emit it. + (lookup_type_die): No special handling for VECTOR_TYPE. + (gen_type_die): Hand VECTOR_TYPE off to gen_array_type_die. + +2002-04-24 Richard Henderson + + * config/mips/mips.md (movdi_usd): Renumber. + +2002-04-24 David S. Miller + + PR target/6420 + * config/sparc/sparc.h (FUNCTION_OK_FOR_SIBCALL): Return false if + 32-bit SPARC and current_function_returns_struct is true. + +Wed Apr 24 13:48:25 CEST 2002 Jan Hubicka + + * loop.c (canonicalize_condition): Use gen_int_mode. + +2002-04-24 Aldy Hernandez + + * config/rs6000/altivec.h: Cleanup file. Add non individual + variants. + (vec_vaddubm): New. + (vec_vadduhm): New. + (vec_vadduwm): New. + (vec_vaddfp): New. + (vec_vaddcuw): New. + (vec_vaddubs): New. + (vec_vaddsbs): New. + (vec_vadduhs): New. + (vec_vadduws): New. + (vec_vaddsws): New. + (vec_vand): New. + (vec_vandc): New. + (vec_vavgub): New. + (vec_vavgsb): New. + (vec_vavguh): New. + (vec_vavgsh): New. + (vec_vavguw): New. + (vec_vavgsw): New. + (vec_vrfip): New. + (vec_vcmpbfp): New. + (vec_vcmpequb): New. + (vec_vcmpequh): New. + (vec_vcmpequw): New. + (vec_vcmpeqfp): New. + (vec_vcmpgefp): New. + (vec_vcmpgtub): New. + (vec_vcmpgtsb): New. + (vec_vcmpgtuh): New. + (vec_vcmpgtsh): New. + (vec_vcmpgtuw): New. + (vec_vcmpgtsw): New. + (vec_vcmpgtfp): New. + (vec_vcmpgefp): New. + (vec_vcfux): New. + (vec_vcfsx): New. + (vec_vctsxs): New. + (vec_vctuxs): New. + (vec_vexptefp): New. + (vec_vrfim): New. + (vec_lvx): New. + (vec_lvebx): New. + (vec_lvehx): New. + (vec_lde): Add vector float variant. + (vec_lvewx): New. + (vec_lvxl): New. + (vec_vlogefp): New. + (vec_vmaddfp): New. + (vec_vmhaddshs): New. + (vec_vmaxub): New. + (vec_vmaxsb): New. + (vec_vmaxuh): New. + (vec_vmaxsh): New. + (vec_vmaxuw): New. + (vec_vmaxsw): New. + (vec_vmaxsw): New. + (vec_vmaxfp): New. + (vec_vmrghb): New. + (vec_vmrghh): New. + (vec_vmrghw): New. + (vec_vmrglb): New. + (vec_vmrglh): New. + (vec_vmrglw): New. + (vec_vminub): New. + (vec_vminsb): New. + (vec_vminuh): New. + (vec_vminsh): New. + (vec_vminuw): New. + (vec_vminsw): New. + (vec_vminfp): New. + (vec_vmladduhm): New. + (vec_vmhraddshs): New. + (vec_msumubm): New. + (vec_vmsummbm): New. + (vec_vmsumuhm): New. + (vec_vmsumshm): New. + (vec_vmsumuhs): New. + (vec_vmsumshs): New. + (vec_vmuleub): New. + (vec_vmulesb): New. + (vec_vmuleuh): New. + (vec_vmulesh): New. + (vec_vmuloub): New. + (vec_mulosb): New. + (vec_vmulouh): New. + (vec_vmulosh): New. + (vec_vnmsubfp): New. + (vec_vnor): New. + (vec_vor): New. + (vec_vpkuhum): New. + (vec_vpkuwum): New. + (vec_vpkpx): New. + (vec_vpkuhus): New. + (vec_vpkshss): New. + (vec_vpkuwus): New. + (vec_vpkswss): New. + (vec_vpkshus): New. + (vec_vpkswus): New. + (vec_vperm): New. + (vec_vrefp): New. + (vec_vrlb): New. + (vec_vrlh): New. + (vec_vrlw): New. + (vec_vrfin): New. + (vec_vrsqrtefp): New. + (vec_vsel): New. + (vec_vslb): New. + (vec_vslh): New. + (vec_vslw): New. + (vec_vsldoi): New. + (vec_vsl): New. + (vec_vslo): New. + (vec_vspltb): New. + (vec_vsplth): New. + (vec_vspltw): New. + (vec_vspltisb): New. + (vec_vspltish): New. + (vec_vspltisw): New. + (vec_vsrb): New. + (vec_vsrh): New. + (vec_vsrw): New. + (vec_vsrab): New. + (vec_vsrah): New. + (vec_vsraw): New. + (vec_vsr): New. + (vec_vsro): New. + (vec_stvx): New. + (vec_stvebx): New. + (vec_stvehx): New. + (vec_stvewx): New. + (vec_stvxl): New. + (vec_vsububm): New. + (vec_vsubuhm): New. + (vec_vsubuwm): New. + (vec_vsubfp): New. + (vec_vsubcuw): New. + (vec_vsububs): New. + (vec_vsubsbs): New. + (vec_vsubuhs): New. + (vec_vsubshs): New. + (vec_vsubuws): New. + (vec_vsubsws): New. + (vec_vsum4ubs): New. + (vec_vsum4sbs): New. + (vec_vsum4shs): New. + (vec_vsum2sws): New. + (vec_vsumsws): New. + (vec_vrfiz): New. + (vec_vupkhsb): New. + (vec_vupkhpx): New. + (vec_vupkhsh): New. + (vec_vupklsb): New. + (vec_vupklpx): New. + (vec_vupklsh): New. + (vec_vxor): New. + +2002-04-23 Eric Botcazou + + PR c/5430 + * fold-const.c (split_tree): Add MINUS_LITP parameter; separate + added literals from substracted literals. + (associate_trees): Don't convert MINUS_EXPR into PLUS_EXPR. + (fold) [associate]: Preserve MINUS_EXPR if needed. + +2002-04-23 Zack Weinberg + + * doc/install.texi: Clarify which versions of alpha*-dec-osf* + are obsoleted. + +2002-04-23 Tom Tromey + + * gcc.c: Added --resource. For PR java/6314. + +2002-04-23 David O'Brien + + * cp/g++spec.c: Use profiled libstdc++ and libm with -p/-pg. + * config/freebsd.h (MATH_LIBRARY_PROFILE): Use the _p verions of + these libraries. + +2002-04-23 David O'Brien + + * config/freebsd.h(OBJECT_FORMAT_ELF): Define. + +Tue Apr 23 14:24:25 CEST 2002 Jan Hubicka + + * i386.c (ix86_output_addr_diff_elt): Avoid x86_64 binutils bug + workaround. + (ix86_expand_int_movcc): Avoid x86_64 compilation chrash. + (ix86_expand_clrstr): Fix typo. + * loop.c (gen_load_of_final_value): New. + (loop_givs_rescan, strength_reduce, check_dbra_loop): + Use it. + +2002-04-23 Roger Sayle + + * builtins.c (builtin_memset_gen_str): New function. + (expand_builtin_memset): Optimize the case of constant length, but + unknown value. + +2002-04-23 Aldy Hernandez + + * config/rs6000/altivec.h (vec_step): Remove extraneous + parentheses. + (vec_ctu): Cast return. + +2002-04-23 Alan Modra + + PR target/6413 + * function.h: (struct function): Add profile_label_no field. + (current_function_profile_label_no): Define. + * function.c: (profile_label_no): New static var. + (expand_function_start): Increment it, and copy to + current_function_profile_label_no. + * output.h (profile_label_no): Delete. + * final.c (profile_label_no): Delete. + (profile_function): Use current_function_profile_label_no. + (final_end_function): Don't increment profile_label_no here. + * config/i386/i386.c (ix86_osf_output_function_prologue): Replace + profile_label_no with current_function_profile_label_no. + * config/pa/pa.c (current_function_number): Delete. + (pa_output_function_prologue): Don't output profile label here. + (hppa_profile_hook): Use label_no param rather than + current_function_number. + (FUNC_BEGIN_PROLOG_LABEL): Move to .. + * config/pa/pa.h: .. here. + (FUNCTION_PROFILER): Output profile label here. + +2002-04-22 Eric Christopher + + * config/mips/mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Revert + patch of 2002-04-09 due to binutils issues. + (FUNCTION_ARG_REGNO_P): Ensure even numbered float register. + +2002-04-22 Aldy Hernandez + + * config/rs6000/rs6000.md ("*movv4si_internal"): Change 'm' + constraint to 'o' for m=r and r=m alternatives. + ("*movv8hi_internal1"): Same. + ("*movv16qi_internal1"): Same. + ("*movv4sf_internal1"): Same. + +2002-04-22 Janis Johnson + + * rtl.h (RTX_FLAG): New macro. + * emit-rtl.c (copy_most_rtx): Use macros to access rtx flags. + * final.c (alter_subreg): Use macro to access rtx flag. + * integrate.c (copy_rtx_and_substitute): Use new access macro. + * print-rtl.c (print_rtx): Use new access macro. + + * cse.c (insert): Check rtx code before accessing flag. + + * genattrtab.c (ATTR_IND_SIMPLIFIED_P, ATTR_CURR_SIMPLIFIED_P, + ATTR_PERMANENT_P, ATTR_EQ_ATTR_P): New. + (attr_hash_add_string, attr_rtx_1, attr_copy_rtx, check_attr_test, + convert_const_symbol_ref, make_canonical, make_alternative_compare, + evaluate_eq_attr, attr_rtx_cost, simplify_test_exp_in_temp, + simplify_test_exp, optimize_attrs, simplify_by_exploding, + find_and_mark_used_attributes, unmark_used_attributes, + add_values_to_cover, simplify_with_current_value, + simplify_with_current_value_aux, clear_struct_flag, walk_attr_value, + copy_rtx_unchanging, main): Use new access macros. + +2002-04-22 Tom Rix + + * expmed.c (init_expmed): Generate shifted constant once. + +2002-04-22 Zack Weinberg + + * c-lex.c (lex_charconst): Call convert to get constant in + proper type; don't just smash the type field. + Fixes PR c/6300. + + * config.gcc: Add list of obsolete configurations. Disallow + building these without --enable-obsolete. + * doc/install.texi: Document --enable-obsolete and obsoletion + policy. Mention obsoletion of individual targets in + appropriate places. + +2002-04-22 Richard Henderson + + * config/sparc/sol2-bi.h (ASM_DEBUG_SPEC): New. + +2002-04-22 Mark Mitchell + + PR f/6138. + * function.c (fixup_memory_subreg): Add promoted_mode parameter. + (walk_fixup_memory_subreg): Likewise. + (fixup_var_refs_insn): Adjust accordingly. + (fixup_var_refs_1): Likewise. + +2002-04-22 Ulrich Weigand + + * config/s390/linux.h: (LIBPATH_SPEC, LIBPATH_ARCH31_SPEC, + LIBPATH_ARCH64_SPEC): Define. + (EXTRA_SPECS): Add libpath, libpath_arch31, libpath_arch64. + (STARTFILE_SPEC, ENDFILE_SPEC): Define; use libpath. + (LINK_ARCH31_SPEC): Add libpath_arch31 to search path. + (LINK_ARCH64_SPEC): Add libpath_arch64 to search path. + +2002-04-22 Joel Sherrill + + * gthr-rtems.h: Correct prototypes to remove warnings. + +2002-04-22 Richard Henderson + + PR c/6344 + * alias.c (canon_true_dependence): Special case (mem:blk (scratch)). + + * gcse.c (free_insn_expr_list_list): New. + (clear_modify_mem_tables): Use it. Fix bit set usage. + (canon_list_insert): Use EXPR_LISTs for expressions. + (record_last_mem_set_info): Factor BLOCK_NUM (insn). + +2002-04-22 Neil Booth + + * cppfiles.c (_cpp_pop_file_buffer): Return void. Move + file change and include code to _cpp_pop_buffer. + * cpphash.h (struct pending_option): Predeclare. + (struct cpp_reader): New member next_include_file. + (_cpp_pop_file_buffer): Update. + (_cpp_push_next_buffer): Update, rename. + * cppinit.c (cpp_destroy): Free include chain and pending here. + (cpp_finish_options): Simplify. + (_cpp_push_next_buffer): Rename and clean up. + * cpplib.c (cpp_pop_buffer): Move code from _cpp_pop_file_buffer. + Clarify. + * cppmacro.c (cpp_scan_nooutput): Set return_at_eof here. + +2002-04-22 Aldy Hernandez + + * config/rs6000/altivec.h (vec_xor): Add variant for both args + being vector signed int. + (vec_andc): Same. + (vec_xor): Add variant for both args being vector signed char. + Remove redundant variant. + (vec_andc): Same. + +2002-04-21 David S. Miller + + * config/sparc/sparc.md (set then compare DI mode peephole2): Fix + compare mode in output RTL. + +2002-04-22 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Correct + style and formatting of previous patch. + +2002-04-22 Alan Modra + + * config/rs6000/rs6000.c (rs6000_override_options): Always clear + flag_pic for ABI_AIX. + +2002-04-21 Neil Booth + + * cppexp.c (struct op, parse_number): Replace U_CHAR with uchar. + * cppfiles.c (read_include_file): Similarly. + * cpphash.h (DSC, U_CHAR, ustrcmp, ustrncmp, ustrlen, + uxstrdup ustrchr, ufputs): Similarly. + * cppinit.c (TRIGRAPH_MAP, cpp_destroy): Similarly. + * cpplex.c (parse_slow, unescaped_terminator_p, save_comment, + cpp_ideq, parse_identifier, parse_number): Similarly. + * cpplib.c (struct directive, dequote_string, D, run_directive, + cpp_push_buffer): Similarly. + * cppmacro.c (new_string_token, builtin_macro, cpp_quote_string, + _cpp_create_definition, check_trad_stringification, + cpp_macro_definition): Similarly. + +2002-04-21 Neil Booth + + * cppmacro.c (funlike_invocation_p): Don't step back + over CPP_EOF. + +2002-04-21 David Edelsohn + + * config/rs6000/rs6000.c (output_profile_hook): Do not increment + labelno. + +2002-04-20 Joseph S. Myers + + * doc/invoke.texi: Remove Chill references. + * doc/gcc.texi: Update last modified date. + +2002-04-20 Kazu Hirata + + * config/h8300/lib1funcs.asm (___mulsi3): Remove unnecessary + push and pop. Replace add.l with add.w. + +2002-04-20 Toshiyasu Morita + + * config/h8300/lib1funcs.asm (___mulsi3): Use hardware + multiply instructions for H8/300H case. + +2002-04-20 Toshiyasu Morita + + * config/h8300/lib1funcs.asm (___cmpsi2, ___ucmpsi2): + Bum three instructions from each routine. + +2002-04-20 Neil Booth + + * Makefile.in: Update. + * decl.c (push_c_function_context, pop_c_function_context, + mark_c_function_context): Rename for consistency. + * c-objc-common.c (c_objc_common_init): Langhooks set elsewhere. + * c-tree.h (push_c_function_context, pop_c_function_context, + mark_c_function_context): Rename for consistency. + * c-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine. + * function.c (init_lang_status, save_lang_status, + restore_lang_status, mark_lang_status, free_lang_status): + Move to langhooks.h. + (push_function_context_to, pop_function_context_from, + free_after_parsing, prepare_function_start, ggc_mark_struct_function): + Update. + * function.h (init_lang_status, save_lang_status, + restore_lang_status, mark_lang_status, free_lang_status): + Move to langhooks.h. + * langhooks-def.h (LANG_HOOKS_FUNCTION_INIT, + LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_ENTER_NESTED, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK, + LANG_HOOKS_FUNCTION_INITIALIZER): New. + (LANG_HOOKS_INITIALIZER): Update. + (lhd_do_nothing_f): New. + * langhooks.h (struct lang_hooks_for_functions): New. + (struct lang_hooks): New hooks. + * langhooks.c (lhd_do_nothing_f): New. +objc: + * objc-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine. + +2002-04-19 David S. Miller + + * config/sparc/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Define. + * config/sparc/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Likewise. + +2002-04-19 Jakub Jelinek + + PR optimization/3756 + * config/i386/i386.c (ix86_expand_int_movcc): Optimize + x = ((int) y < 0) ? cst1 : cst2. + +2002-04-19 Jakub Jelinek + + PR c/6358 + * function.c: Reapply patch for c/6358. + (expand_function_end): Copy decl_rtl's mode, not + current_function_return_rtx mode. + +2002-04-19 Joel Sherrill + + * config/rtems.h (STARTFILE_SPEC, ENDFILE_SPEC): Fix for non-ELF + targets. + +2002-04-19 Tom Tromey + + * doc/install.texi (Specific): Update status of Solaris 2.8. + For PR libgcj/6158. + +2002-04-19 Andreas Schwab + + * real.c: Allow sizeof (REAL_VALUE_TYPE) > 2*NE. + (PUT_REAL): Restore old definition. + +2002-04-19 Dan Nicolaescu + Gerald Pfeifer + + * doc/install.texi (Specific, sparc-sun-solaris2*): Mention that + binutils 2.11.2 and higher generate smaller binaries than Sun's + native tools. + +2002-04-19 Mark Mitchell + + PR c++/6352 + * toplev.c (rest_of_compilation): Do not defer functions for which + TREE_SYMBOL_REFERENCED has already been set. + +Fri Apr 19 15:53:03 CEST 2002 Jan Hubicka + + * i386.md (movsi_1, movhi_1): Force reload to use more flexible + alternative. + +2002-04-19 Neil Booth + + * builtins.c: Include langhooks.h. + (lang_type_promotes_to): Remove. + (expand_builtin_va_arg): Use new hook. + * c-common.c (c_common_nodes_and_builtins): Don't set hook. + (simple_type_promotes_to): Move to c-typeck.c. + * c-common.h (simple_type_promotes_to): Remove. + * c-decl.c (duplicate_decls, grokdeclarator): Update. + * c-format.c: Include langhooks.h. + (check_format_types): Update. + * c-tree.h (c_type_promotes_to): New. + * c-typeck.c (c_type_promotes_to): Move from c-common.c. + (type_lists_compatible_p): Update. + * langhooks-def.h (lhd_type_promotes_to): New. + (LANG_HOOKS_TYPE_PROMOTES_TO): New. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update. + * langhooks.c (lhd_type_promotes_to): New. + * langhooks.h (struct lang_hooks_for_types): New hook. + * tree.h (lang_type_promotes_to): Remove. +objc: + * objc-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. + +2002-04-18 Richard Henderson + + * function.c: Revert patch for c/6358. + +2002-04-18 Richard Henderson + + * ifcvt.c (find_cond_trap): Handle cases with no proper THEN or JOIN + blocks. Handle multiple references to the TRAP block. Handle + non-adjacent THEN and OTHER blocks. + +2002-04-18 Richard Henderson + + * config/ia64/ia64.c (ia64_function_arg_pass_by_reference): Don't + crash with no type for by-mode libcalls. + + * config/ia64/ia64.md (conditional_trap): Fix predicate polarity. + +2002-04-18 Bob Wilson + + * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill, + __xtensa_nonlocal_goto): Use a syscall instructions to flush + the register windows. + +2002-04-18 Zack Weinberg + + * real.h: Define REAL_VALUE_TYPE_SIZE as 96 or 160, as + appropriate. Document need for extended precision even when + MAX_LONG_DOUBLE_TYPE_SIZE is smaller. Define REAL_WIDTH here, + based on REAL_VALUE_TYPE_SIZE. Use REAL_WIDTH to size + REAL_VALUE_TYPE. Define CONST_DOUBLE_FORMAT here. Use #error + instead of relying on later syntax error when REAL_WIDTH > 5. + * real.c: Define NE based only on whether or not we have a + full 128-bit extended type (not INTEL_EXTENDED_IEEE_FORMAT). + Require sizeof(REAL_VALUE_TYPE) == 2*NE. Unconditionally + define GET_REAL and PUT_REAL as simple memcpy operations; no + need to byteswap or round. + Use #error instead of #ifdef-ing out the entire file, for + prompt error detection. + + * rtl.c, gengenrtl.c: No need to calculate CONST_DOUBLE_FORMAT here. + +2002-04-18 David S. Miller + + * config/sparc/sparc.h (BRANCH_COST): Define. + + * fold-const.c (BRANCH_COST): Don't provide default here, expr.h + does it. + +2002-04-18 Hans-Peter Nilsson + + * flow.c (update_life_info): Ignore return value of cleanup_cfg. + Mask out PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE in + propagate_block calls after relaxation loop using new variable + stabilized_prop_flags. + +2002-04-18 Richard Henderson + + * config/ia64/ia64.c (ia64_function_arg_pass_by_reference): New. + (ia64_va_arg): Expect variable sized types by reference. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use + ia64_function_arg_pass_by_reference. + +2002-04-18 Richard Henderson + + * ifcvt.c: Include except.h. + (block_has_only_trap): Break out from find_cond_trap. + (find_cond_trap): Use it. Always delete the trap block. + (merge_if_block): Allow then block null. Be less simplistic about + what insns can end a block. + * Makefile.in (ifcvt.o): Depend on except.h. + + * config/ia64/ia64.md (trap, conditional_trap): New. + +2002-04-18 Jakub Jelinek + + PR c/6358 + * function.c (assign_parms): Assign hard current_function_return_rtx + register here... + (expand_function_end): ...not here. + +2002-04-18 Neil Booth + + * c-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine. + * c-tree.h (c_incomplete_type_error): New. + * c-typeck.c (require_complete_type, build_component_ref): Update. + (incomplete_type_error): Rename. + * langhooks-def.h (lhd_incomplete_type_error): New. + (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): New. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update. + * langhooks.c (lhd_incomplete_type_error): New. + * langhooks.h (struct lang_hooks_for_types): New hook. + * tree.c (size_in_bytes): Use new hook. + * tree.h (incomplete_type_error): Remove. +objc: + * objc-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine. + +2002-04-18 Zack Weinberg + + * config/arc/arc.md: Remove #if HOST_FLOAT_FORMAT != + TARGET_FLOAT_FORMAT blocks. + +2002-04-18 Gerald Pfeifer + + * doc/install.texi (Downloading the source): Do not mention Chill + any longer, but mention Ada. + (Configuration): Do not mention Chill any longer. + +2002-04-18 Hans-Peter Nilsson + + * config/cris/cris.h (TARGET_VERSION): Remove local version number. + +Thu Apr 18 17:14:08 CEST 2002 Jan Hubicka + + * i386.h (SSE_FLOAT_MODE_P): Fix bogus conflict resolution + in last patch. + +2002-04-18 Jakub Jelinek + + * fold-const.c (fold): Use (*lang_hooks.types.unsigned_type) + instead of unsigned_type. + +Thu Apr 18 15:49:12 CEST 2002 Jan Hubicka + + * i386.h (SSE_FLOAT_MODE_P): Kill bogus TARGET_SSE_MATH check. + * i386.md (sse_mov?fcc*): Swap operands for cases they will be swapped + later. + +2002-04-18 Bernd Schmidt + + * attribs.c (vector_type_node_list): New static variable. + (handle_vector_size_attribute): Use it to avoid generating a + new type node each time we are called. + + * combine.c (subst): Avoid trying to make a vector mode subreg of + an integer constant. + (gen_lowpart_for_combine): Likewise. + +2002-04-18 Roger Sayle + Jakub Jelinek + + * fold-const.c (fold) [NOP_EXPR]: Convert (T)(x&c) into ((T)x&(T)c) + for integer constant c (if x has unsigned type or sign bit is not + set in c). This folds the zero/sign extension into the bit-wise and + operation. + +2002-04-18 Jakub Jelinek + + PR middle-end/6205 + * config/i386/i386.md (movsf_1): Use pxor only if TARGET_SSE2, + otherwise xorps. + +2002-04-17 NIIBE Yutaka + + * config/sh/elf.h: Undefine ASM_OUTPUT_CASE_LABEL. + +2002-04-17 Nick Clifton + + * gcc.c (read_specs): Detect and fail if an attempt is made to + rename a spec string to an already existing string. + +2002-04-17 Ulrich Weigand + + * config/s390/s390.c (legitimize_pic_address): Do not generate + illegal address constant without CONST. + +2002-04-17 Kaveh R. Ghazi + + * sparc/linux64.h (CC1_SPEC): Error for -m32 and -m64. + * sparc/netbsd-elf.h (CC1_SPEC32, CC1_SPEC64): Likewise. + +2002-04-17 Ulrich Weigand + + PR optimization/6305 + * config/s390/s390.c (s390_expand_plus_operand): Use find_replacement + to make sure previous reloads are taken into account. Generate + better code if one operand is an in-range immediate constant. + +2002-04-16 Andrew Haley + + * doc/install.texi (Building): libgcj requires GNU make. + +2002-04-17 Jakub Jelinek + + PR bootstrap/6315 + * config/sparc/sparc.md (movtf reg<-reg split): Allow spliting + even if hard quad and register is not floating. + (movtf reg<-mem split): Disallow splitting if hard quad and + register is floating. + (movtf mem<-reg split): Likewise. + * config/sparc/sparc.c (fp_register_operand): New predicate. + * config/sparc/sparc.h (PREDICATE_CODES): Add fp_register_operand. + +2002-04-17 Zack Weinberg + + * Makefile.in (PROTO_OBJS): Add cppdefault.o. + (protoize.o): Take $(PREPROCESSOR_DEFINES) off command line. + (unprotoize.o): Ditto. Build from protoize.c. Define + UNPROTOIZE on command line. + * protoize.c: Include cppdefault.h. Delete include_defaults. + (in_system_include_dir): Use cpp_include_defaults (defined in + cppdefault.o). + * unprotoize.c: Delete file. + +2002-04-17 Aldy Hernandez + + * config/rs6000/altivec.h (vec_ld): Add array variants. + (vec_lde): Same. + (vec_ldl): Same. + +2002-04-17 Alan Matsuoka + Aldy Hernandez + + * config/rs6000/altivec.h: Define __ALTIVEC__. + (bool): New. + (__pixel): New. + (pixel): New. + (vec_cfux): New. + (vec_vmaddfp): New. + (vec_vsldoi): New. + Add parentheses to all macro arguments. + +2002-04-16 Richard Henderson + + PR c++/6320 + * except.c (remove_eh_handler): Insert inner regions at beginning + of sibling chain. Refactor expressions. + +2002-04-16 Richard Henderson + + * config/sparc/sol2-bi.h (AS_SPARC64_FLAG): New. + * config/sparc/sol2-gas-bi.h: New file. + * config.gcc (sparc*-solaris): Add it as needed. + * configure.in (AS_SPARC64_FLAG): Remove check. + * config.in, configure: Regenerate. + + * config/sparc/sol2-bi.h (CC1_SPEC): Error for -m32 and -m64. + +2002-04-16 Richard Henderson + + * config/mips/mips.c (override_options): Don't override N32 for + a 64-bit ISA. + + PR 6202 + * config/mips/mips.md (can_delay): Split out of existing define_delays. + (HILO_delay): Set can_delay false. + +2002-04-16 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_output_function_prologue): Compute + instruction addresses. + (rs6000_output_function_epilogue): Likewise. + +2002-04-16 Paolo Carlini + + * c-parse.in (poplevel, compstmt_start, + compstmt_primary_start): Add ending ';', in accordance + with POSIX. + +2002-04-16 Richard Henderson + + * config.gcc (sparcv9-solaris): Configure for 64-bit default. + Adjust tm_file order to get TARGET_DEFAULT set properly. + (sparc-solaris): Configure 2.[78] for 64-bit multilibs. + * doc/install.texi (sparc-solaris): Update. + +2002-04-16 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_emit_cmove): Fail if modes of + comparison operands do not match each other or if modes of + conditions do not match result. + +2002-04-16 Hartmut Penner + + PR target/6305 + * config/s390/s390.md (mulsidi3): Set both subregs of the + multiword register. + +2002-04-16 Aldy Hernandez + + * config/rs6000/altivec.h (vec_addc): Type check. + +2002-04-16 Jakub Jelinek + + PR middle-end/6279 + * expr.c (store_expr): Don't copy if DECL_RTL (exp) == target. + + * expr.c (safe_from_p): Cleanup: use DECL_RTL_IF_SET. + +2002-04-15 Richard Henderson + + * config/mips/abi64.h (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Set + call_really_used_regs too. + +2002-04-15 Richard Henderson + + * config/alpha/gnu.h (CPP_PREDEFINES): Underscores for gnu_hurd. + +2002-04-15 David S. Miller + + * rtlanal.c (note_stores): Don't present PARALLEL SET_DESTs + as being CLOBBERed. + +2002-04-16 Jakub Jelinek + + PR c/6290 + * config/rs6000/rs6000.c (easy_vector_constant): Return 1 if the + CONST_VECTOR is { 0, ... 0 }. + +2002-04-15 Loren J. Rittle + + * doc/install.texi (Installing GCC: Configuration): Clarify + the only supported ways to configure gcc. + +2002-04-15 Roland McGrath + + * config.gcc (alpha*-*-gnu*): New target configuration. + * config/alpha/gnu.h: New file for it. + * config/gnu.h (TARGET_MEM_FUNCTIONS): #undef before #define. + +2002-04-16 Mark Mitchell + + * c-common.h (STMT_EXPR_NO_SCOPE): New macro. + * c-common.c (c_expand_expr): Respect STMT_EXPR_NO_SCOPE. + * tree.h (expand_start_stmt_expr): Update prototype. + * stmt.c (expand_start_stmt_expr): Add has_scope parameter. + * tree-inline.c (expand_call_inline): Set STMT_EXPR_NO_SCOPE + on the STMT_EXPR created for the inline function. + +2002-04-15 Richard Henderson + + * config/alpha/linux.h, config/arm/linux-elf.h, config/i370/linux.h, + config/i386/linux-aout.h, config/i386/linux-oldld.h, + config/i386/linux.h, config/i386/linux64.h, config/ia64/linux.h, + config/m68k/linux-aout.h, config/m68k/linux.h, config/mips/linux.h, + config/pa/pa-linux.h, config/pj/linux.h, config/s390/linux.h, + config/sh/linux.h, config/sparc/linux-aout.h, config/sparc/linux.h, + config/sparc/linux64.h, config/xtensa/linux.h (CPP_PREDEFINES): + Define __gnu_linux__, not gnu_linux. + * config/rs6000/sysv4.h (CPP_OS_GNU_SPEC): Likewise for gnu_hurd. + +2002-04-15 Mark Mitchell + + Remove Chill front end. + * gcc.c (default_compilers): Remove Chill entries. + * ch: Remove directory. + * doc/frontends.texi: Remove information about Chill. + * doc/sourcebuild.texi: Likewise. + * doc/standards.texi: Likewise. + +2002-04-15 Douglas B Rupp + + * config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include. + (LONGLONG_STANDALONE): Define. + +2002-04-15 David S. Miller + + * config/sparc/sparc.c (sparc_emit_float_lib_cmp): + Call emit_library_call with LCT_NORMAL. + (sparc_initialize_trampoline): Use LCT_foo instead of + magic constant in emit_library_call invocations. + (sparc64_initialize_trampoline): Likewise. + (sparc_profile_hook): Likewise. + * config/sparc/sparc.md: Likewise. + + * config/sparc/sparc.c (sparc_extra_constraint_check): + Fix type of argument 'c'. + * config/sparc/sparc-protos.h (sparc_extra_constraint_check): + Likewise. + +2002-04-15 Gabriel Dos Reis + + * diagnostic.h (output_buffer_state): Redefine. + (output_format_decoder): New macro. + (output_prefixing_rule): Likewise. + (output_line_cutoff): Likewise. + (diagnostic_format_decoder): Adjust. + (diagnostic_prefixing_rule): Likewise. + (diagnostic_line_cutoff): Likewise. + (diagnostic_state): Likewise. + (diagnostic_kind_count): Likewise. + (diagnostic_buffer): Now a macro. + + * diagnostic.c (diagnostic_buffer): Remove definition. + (output_is_line_wrapping): Adjust. + (set_real_maximum_length): Likewise. + (output_set_maximum_length): Likewise. + (init_output_buffer): Likewise. + (lhd_print_error_function): Likewise. + (output_do_verbatim): Likewise. + +2002-04-14 Neil Booth + + * cpperror.c (print_location): Don't print include chain + if line == 0. + (cpp_begin_message): Update to use DL_ macros. + (cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning, + cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, + cpp_notice, cpp_notice_from_errno): Remove. + (cpp_error, cpp_error_with_line): Update to take a diagnostic + level. + (cpp_errno): New. + * cppexp.c (CPP_ICE): Remove. + (SYNTAX_ERROR, SYNTAX_ERROR2, parse_number, parse_defined, + lex, integer_overflow, _cpp_parse_expr): Update. + * cppfiles.c (read_include_file, find_include_file, + handle_missing_header, _cpp_read_file, remap_filename): Update. + * cpphash.h (enum error_type): Remove. + (_cpp_begin_message): Update. + * cppinit.c (append_include_chain, remove_dup_dirs, output_deps, + cpp_handle_option, cpp_post_options): Update. + * cpplex.c (trigraph_p, skip_escaped_newlines, skip_block_comment, + skip_whitespace, parse_identifier, parse_slow, parse_string, + _cpp_lex_direct, cpp_spell_token, maybe_read_ucs, cpp_parse_escape, + cpp_interpret_charconst): Update. + * cpplib.c (check_eol, directive_diagnostics, _cpp_handle_directive, + lex_macro_node, do_undef, glue_header_name, parse_include, + do_include_common, read_flag, do_line, do_linemarker, do_ident, + cpp_register_pragma, do_pragma_once, do_pragma_system_header, + do_pragma_poison, do_pragma_dependency, _cpp_do__Pragma, do_else, + do_elif, do_endif, parse_answer, parse_assertion, do_assert, + _cpp_pop_buffer, do_diagnostic): Update. + * cpplib.h (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, DL_ERROR, + DL_FATAL, DL_ICE, DL_EXTRACT, DL_WARNING_P): New. + (cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning, + cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, + cpp_notice, cpp_notice_from_errno): Remove. + (cpp_error, cpp_error_with_line): Update to take a diagnostic + level. + (cpp_errno): New. + * cppmacro.c (builtin_macro, stringify_arg, paste_all_tokens, + collect_args, enter_macro_context, save_parameter, parse_params, + _cpp_create_definition, check_trad_stringification, + cpp_macro_definition): Update. + * cppmain.c (cpp_preprocess_file): Update. + * fix-header.c (read_scan_file): Update. + +2002-04-14 Andreas Schwab + + * config/ia64/linux.h (CPP_PREDEFINES): Fix missing backslash. + +2002-04-14 Jeroen Dobbelaere + + * config/arm/linux-elf.h (CPLUSPLUS_CPP_SPEC): Define. + +2002-04-13 Mark Mitchell + + * config/i386/gnu.h (CPP_PREDEFINES): Define __gnu_hurd__, + not gnu_hurd. + +2002-04-13 Hans-Peter Nilsson + + * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Fix typo. + +2002-04-13 Joel Sherrill + + * config/sparc/t-elf: Enable v8 multilibs. Impacts + sparc-elf and sparc-rtems targets. + +2002-04-13 Mark Mitchell + + * alpha/linux.h: Define __gnu_linux__ wherever __linux__ is + defined, and __gnu_hurd__ wherever __GNU__ is defined. + * arm/linux-elf.h: Likewise. + * cris/aout.h: Likewise. + * cris/linux.h: Likewise. + * i370/linux.h: Likewise. + * i386/gnu.h: Likewise. + * i386/linux-aout.h: Likewise. + * i386/linux-oldld.h: Likewise. + * i386/linux.h: Likewise. + * i386/linux64.h: Likewise. + * ia64/linux.h: Likewise. + * m68k/linux-aout.h: Likewise. + * m68k/linux.h: Likewise. + * mips/linux.h: Likewise. + * pa/pa-linux.h: Likewise. + * pj/linux.h: Likewise. + * rs6000/sysv4.h: Likewise. + * s390/linux.h: Likewise. + * sh/linux.h: Likewise. + * sparc/linux-aout.h: Likewise. + * sparc/linux.h: Likewise. + * sparc/linux64.h: Likewise. + * xtensa/linux.h: Likewise. + +2002-04-13 Richard Sandiford + + * stmt.c (check_unique_operand_names): Expect operand names to + be strings rather than identifiers. Use simple_cst_equal to + compare them. + (resolve_operand_name_1): Make same identifier to string change here. + * c-parse.in (asm_operand): Convert a named operand into a string. + * cp/parse.y (asm_operand): Likewise. + +2002-04-13 Andreas Schwab + + * config/ia64/ia64.h (CPP_SPEC): Include %(cpp_cpu). + +2002-04-12 Mark Mitchell + + Revert these changes: + + 2002-04-06 Mark Mitchell + + PR c++/5571 + * stor-layout.c (layout_decl): Reset the RTL for the decl. + +2002-04-12 Richard Henderson + + * config.gcc (sparcv9-*-solaris2): Default to 32-bit code. + (sparc*-*-solaris): Clean up header files. + * configure.in (AS_SPARC64_FLAG): Error out if can't find it + and plan on generating 64-bit code. + * toplev.c (decode_g_option): Remove LINKER_DOES_NOT_WORK_WITH_DWARF2. + * config/sparc/sol2-64.h: Delete and reuse for default 64-bit code. + * config/sparc/sol2-sld-64.h: Rename ... + * config/sparc/sol2-bi.h: ... here. Remove the bits that checked + for AS_SPARC64_FLAG not defined. + * config/sparc/sol2-gld-bi.h: New. + * config/sparc/sol2-sld.h: Remove. + * config/sparc/sol26-sld.h: New. + * config/sparc/sol2.h: Tidy comments. + * doc/install.texi: Document sparc-solaris configury changes. + +2002-04-12 Richard Henderson + + * recog.c (offsettable_address_p): Match the logic in adjust_address. + + * config/sparc/sparc.h (LEGITIMIZE_RELOAD_ADDRESS): Handle TFmode + in 64-bit mode only. Use only for 32-bit or MEDLOW. + +2002-04-12 Rainer Orth + + * config/alpha/osf.h (LINK_SPEC): Pass -S to silence ld warnings. + +Fri Apr 12 15:42:59 2002 Jeffrey A Law (law@redhat.com) + + * pa.c (pa_can_combine_p): Call extract_insn before calling + constrain_operands. + +2002-04-12 Douglas B Rupp + + * config/i386/i386-interix.h (EH_FRAME_IN_DATA_SECTION): Define. + (TARGET_ASM_NAMED_SECTION, RETURN_IN_MEMORY) Define. + (DEFAULT_PCC_STRUCT_RETURN): Define as 0. + (CPP_PREDEFINES): Handle __declspec. + * config/i386/t-interix (USER_H): Remove. + +2002-04-12 DJ Delorie + + * integrate.c (compare_blocks): Make comparisons safe for when + sizeof(int) < sizeof(char *). + (find_block): Likewise. + +2002-04-12 Jan Hubicka + David Edelsohn + + * config/rs6000/rs6000.c (call_operand): Allow LINK and COUNT + registers. + (symbol_ref_operand): New. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add symbol_ref_operand. + * config/rs6000/rs6000.md (call_nonlocal_aix): Use symbol_ref_operand. + +2002-04-12 Andreas Schwab + + * config/ia64/ia64.h (ASM_SPEC): Moved from here ... + * config/ia64/sysv4.h (ASM_SPEC): ... to here, so that it + overrides the definition in config/svr4.h. + +2002-04-12 Eric Norum + + * config/rtems.h, config/a29k/rtems.h, config/arm/rtems-elf.h, + config/c4x/rtems.h, config/h8300/rtems.h, config/i386/rtems.h, + config/i386/rtemself.h, config/i960/rtems.h, config/m68k/rtems.h, + config/m68k/rtemself.h, config/mips/rtems.h, config/mips/rtems64.h, + config/pa/rtems.h, config/rs6000/rtems.h, config/sh/rtems.h, + config/sh/rtemself.h, config/sparc/rtems.h, config/sparc/rtemself.h, + config/v850/rtems.h (*-rtems*): Cleanup pass to move common + definitions to config/rtems.h and make the targets more similar. + +Fri Apr 12 08:06:54 2002 Richard Kenner + + * expr.c (expand_assigment): Remove duplicate conversions #ifdef + POINTERS_EXTEND_UNSIGNED. + (store_constructor, expand_expr, case COMPONENT_REF): Likewise. + (store_expr): Use TYPE_MODE (sizetype), not ptr_mode. + + * emit-rtl.c (widen_memory_access): Don't do anything if MEMOFFSET + not specified. + +Fri Apr 12 12:11:26 2002 J"orn Rennecke + + * sh.c (calc_live_regs, sh_pr_n_sets): Use of PR_MEDIA_REG / PR_REG + depends on TARGET_SHMEDIA, not TARGET_SH5. + +2002-04-12 Hans-Peter Nilsson + + * function.c (fixup_var_refs_1) : + For paradoxical (subreg VAR), replace VAR, don't try the subreg. + +Fri Apr 12 10:51:38 2002 J"orn Rennecke + + * sh.c (broken_move): Constant 0. / 1. load is OK if there is + no r0 clobber. + +2002-04-12 Andreas Schwab + + * config/ia64/ia64.h (EXTRA_SPECS): Fix missing backslash. + +2002-04-12 Richard Henderson + + PR bootstrap/4191 + * config/d30v/d30v.h (INIT_SECTION_ASM_OP): Don't undef. + + * flow.c (mark_used_reg): Manage reg_cond_dead properly for + modes spanning multiple hard regs. + + * recog.c (peephole2_optimize): Rebuild jump labels as needed. + +2002-04-11 John David Anglin + + * pa.c (pa_output_function_prologue): Don't accumulate the total + number of code bytes when using TARGET_64BIT, or gas, SOM and not + the portable runtime. + (output_deferred_plabels): Handle 64bit plabels. + (output_cbranch): Use $PIC_pcrel$0 for pc relative relocations when + generating pic code using the GAS assembler for object formats that + are not SOM (ie., ELF32 and ELF64). + (output_millicode_call): Check attribute type if attribute length is 28. + Likewise use $PIC_pcrel$0. Only call get_attr_length and + dbr_sequence_length once. + (output_call): Likewise use $PIC_pcrel$0, and call get_attr_length and + dbr_sequence_length once. + * pa.h (TARGET_SOM): Define if not defined. + * pa.md (pattern to load address of label): Likewise use $PIC_pcrel$0 + with GAS and not SOM. + (jump, call_internal_reg, call_value_internal_reg): Likewise. + * som.h (OBJ_SOM): Rename to TARGET_SOM. Undefine before defining. + +2002-04-11 David O'Brien + + * config/freebsd.h (NO_IMPLICIT_EXTERN_C, SCCS_DIRECTIVE): Give value. + (DEFAULT_PCC_STRUCT_RETURN) Do not redefine. + (USER_LABEL_PREFIX, HANDLE_SYSV_PRAGMA, IDENT_ASM_OP, + DWARF2_DEBUGGING_INFO, DBX_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE): + elfos.h and dbxelf.h values are fine now. + * config/i386/freebsd.h, config/alpha/freebsd.h + (DEFAULT_PCC_STRUCT_RETURN): Define to 0. + +2002-04-11 David O'Brien + + * config/ia64/aix.h (CPP_PREDEFINES): Do not define _LP64/__LP64__ + or set Acpu or Amachine. Reformat. + (ASM_SPEC, DONT_USE_BUILTIN_SETJMP, PROFILE_BEFORE_PROLOGUE): Do not + define. + (LINK_SPEC): Do not need to undef. + * config/ia64/elf.h (ASM_EXTRA_SPEC): Define. + * config/ia64/freebsd.h (LINK_SPEC): Do not need to undef. + (ASM_SPEC, DONT_USE_BUILTIN_SETJMP, PROFILE_BEFORE_PROLOGUE): Do not + define. + * config/ia64/hpux.h (ASM_EXTRA_SPEC): Define. + (ASM_SPEC): Do not define, use ASM_EXTRA_SPEC instead. + (LINK_SPEC): Do not need to undef. + (DONT_USE_BUILTIN_SETJMP): Do not define. + * config/ia64/ia64.h (ASM_SPEC, ASM_EXTRA_SPEC): Add. + (CPP_CPU_SPEC): Define _LP64, set Acpu and Amachine. Remove -Dia64. + (DONT_USE_BUILTIN_SETJMP, PROFILE_BEFORE_PROLOGUE): Define. + Remove trailing spaces. + * config/ia64/linux.h (CPP_PREDEFINES): Do not define _LP64/__LP64__, + __ELF__, or set Acpu or Amachine. Reformat. + (ASM_SPEC, DONT_USE_BUILTIN_SETJMP, PROFILE_BEFORE_PROLOGUE): Do not + define. + +2002-04-11 David O'Brien + + * config.gcc (ia64-*-freebsd*): Fix ordering of tm_files to match + all other *-*-freebsd* targets. + +2002-04-11 Richard Henderson + + * config.gcc (alpha*-*-linux*ecoff): Detect and reject. + +2002-04-11 David O'Brien + + * config.gcc (alpha*-*-openbsd, alpha64-dec-*vms,alpha*-dec-*vms): + Include {cpu}/{cpu}.h thru tm_file. + (alpha*-*-linux*ecoff): Remove target. + * config/alpha/elf.h (CPP_SUBTARGET_SPEC): Define __ELF__. + (LINK_SPEC): Remove, is not OS independent. + * config/alpha/freebsd.h (CPP_SPEC): Do not define __ELF__. + (LINK_SPEC): Do not need to #undef any longer. + * config/alpha/linux-ecoff.h (LINK_SPEC): Do not need to #undef + any longer. + * config/alpha/linux-elf.h (SUB_CPP_PREDEFINES): Do not define + __ELF__. + (LINK_SPEC): Moved here from alpha/elf.h. + * config/alpha/linux.h (CPP_PREDEFINES): No longer consumer of + SUB_CPP_PREDEFINES. + * config/alpha/linux-ecoff.h: Remove. + * config/alpha/netbsd.h (CPP_PREDEFINES): Do not define __ELF__. + (CPP_SPEC): Define _POSIX_SOURCE as needed. + (CPP_SUBTARGET_SPEC): Do not define. + (LINK_SPEC): Do not need to #undef any longer. + * config/alpha/openbsd.h: Do not directly include alpha/alpha.h. + * config/alpha/vms.h: Likewise. + +2002-04-11 Richard Sandiford + + * doc/extend.texi: Remove old claim that typedefs cannot have + an alignment attribute. + +2002-04-11 Jakub Jelinek + + PR optimization/6177 + * expr.c (expand_expr) [COMPONENT_REF]: Handle op0 CONCAT if + bitpos is 0 and bitsize CONCAT size. + +2002-04-11 Jakub Jelinek + + PR c/6223 + * combine.c (if_then_else_cond): Use trunc_int_for_mode on nz. + +2002-04-10 David O'Brien + + * config/alpha/freebsd.h: Minor reformatting. + (CPP_SPEC): Define ELF and add cpp_subtarget. + (ASM_SPEC): No longer needed. + +2002-04-11 Richard Henderson + + * config/sparc/sparc.md (movdi_insn_sp32): Add o/J alternative. + (movdi_insn_sp32_v9): Likewise. Only allow stx with aligned memory. + (dimode mem/zero splitter): New. + +2002-04-11 Hans-Peter Nilsson + + * config/cris/cris.c (cris_override_options): Tweak error message + for PIC not implemented. + + * config/cris/cris.h: Tweak comments related to parameter-passing. + + * t-cris (TARGET_LIBGCC2_CFLAGS): Don't -Dinhibit_libc here. + +2002-04-10 Richard Henderson + + * except.c (add_ehl_entry): Allow duplicates after landing pad + creation. + +2002-04-10 David Edelsohn + + * config/rs6000/t-aix43 (SHLIB_NM_FLAGS): Add -X32_64. + +2002-04-10 Toon Moene + + * c-decl.c (c_init_decl_processing): Move generation of + decls for g77_integer_type_node and friends from here ... + * c-common.c (c_common_nodes_and_builtins): ... to here. + +2002-04-10 Ulrich Weigand + + * reload1.c (choose_reload_regs): HARD_FRAME_POINTER_REGNUM + is only used as frame pointer when frame_pointer_needed is true. + +2002-04-10 Richard Earnshaw + + PR target/817 + * arm.md (arm_movdi): Adjust neg_pool_range attribute to allow + for the fact that the pool entry uses two words. + (movdf_hard_insn): Similarly. Also, ADR instruction can span + 1k bytes. + (movdf_soft_insn): Similarly. + (movxf_hard_insn): Adjust neg_pool_range attribute to allow + for the fact that the pool entry uses three words. + +2002-04-10 Richard Sandiford + + * config/mips/mips.c (mips_va_arg): When using the struct version + of the EABI va_list, allow arguments in the register save area to + take up less room than a stack argument. + +2002-04-10 Richard Henderson + + * expr.c (expand_expr) [INTEGER_CST]: Don't force into registers + if EXPAND_INITIALIZER. + +2002-04-09 Richard Henderson + + * config/alpha/alpha.md (movdi_er_maybe_g): New. + * config/alpha/alpha.c (alpha_expand_mov): Use it. + +2002-04-10 Alan Modra + + PR optimization/6233 + * rtlanal.c (pure_call_p): New function. + * rtl.h (pure_call_p): Declare. + * loop.c (prescan_loop): Use it to set has_nonconst_call. + * gcse.c (store_killed_in_insn): Use pure_call_p here too. + +2002-04-09 Eric Christopher + + * config/mips/mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Add additional + information to .comm directive. + +2002-04-09 Richard Henderson + + PR c/5078 + * expr.c (expand_expr) [INTEGER_CST]: Force overflows into registers. + +2002-04-09 Richard Henderson + + * basic-block.h (flow_delete_block_noexpunge): Declare. + (expunge_block_nocompact): Declare. + * cfg.c (expunge_block_nocompact): Split out from ... + (expunge_block): ... here. + * cfgrtl.c (can_delete_label_p): Don't use exception_handler_labels. + (flow_delete_block_noexpunge): Split out from ... + (flow_delete_block): ... here. + * cfgcleanup.c (delete_unreachable_blocks): Compact while + removing dead blocks. + * except.c (exception_handler_labels): Remove. + (exception_handler_label_map): New. + (struct eh_region): Add aka member. + (mark_ehl_map_entry, mark_ehl_map, free_region): New. + (ehl_hash, ehl_eq, ehl_free, add_ehl_entry): New. + (for_each_eh_label, for_each_eh_label_1): New. + (init_eh): Register exception_handler_label_map. + (free_eh_status): Use free_region. + (find_exception_handler_labels): Use the map, not the list. + (remove_exception_handler_label): Likewise. + (maybe_remove_eh_handler): Likewise. + (remove_eh_handler): Use the region aka bitmap. + * except.h (exception_handler_labels): Remove. + (for_each_eh_label): Declare. + * jump.c (rebuild_jump_labels): Don't check exception_handler_labels. + * loop.c (invalidate_loops_containing_label): New. + (find_and_verify_loops): Use it. Use for_each_eh_label. + * sched-rgn.c (is_cfg_nonregular): Use + current_function_has_exception_handlers. + +2002-04-09 Richard Henderson + + * sbitmap.c (sbitmap_union_of_diff, sbitmap_a_and_b, sbitmap_a_xor_b, + sbitmap_a_or_b, sbitmap_a_or_b_and_c, sbitmap_a_and_b_or_c): + Do not return changed status. + (sbitmap_union_of_diff_cg, sbitmap_a_and_b_cg, sbitmap_a_xor_b_cg, + sbitmap_a_or_b_cg, sbitmap_a_or_b_and_c_cg, sbitmap_a_and_b_or_c_cg): + New functions that do return changed status. + * sbitmap.h: Update decls. + * gcse.c, lcm.c: Use _cg functions as needed. + +Tue Apr 9 19:15:57 2002 J"orn Rennecke + + * config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h. + (sh64-*-elf*, sh-*-rtemself*): Likewise. + * config/sh/embed_bb.c: New file. + * config/sh/embed-elf.h: New file. + * sh.h (CPP_SPEC): Supply __SIZE_TYPE__ and __PTRDIFF_TYPE__ + if -m[12345]* option is given. Don't use subtarget_cpp_ptr_spec. + (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and + __PTRDIFF_TYPE__ . + (SUBTARGET_CPP_PTR_SPEC): Don't define. + (EXTRA_SPECS): Remove subtarget_cpp_ptr_spec. + Add subtarget_asm_endian_spec. + (ASM_SPEC): Use subtarget_asm_endian_spec. + (SUBTARGET_ASM_ENDIAN_SPEC): Define. + (RETURN_ADDR_RTX): Use PR_MEDIA_REG for TARGET_SH5. + (WCHAR_UNSIGNED): Define. + (SH_ELF_WCHAR_TYPE, SH_DBX_REGISTER_NUMBER): Define. + (DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER. + (ALLOCATE_INITIAL_VALUE): Use PR_MEDIA_REG for TARGET_SH5. + Fix value. + * sh.c (calc_live_regs): Use PR_MEDIA_REG for TARGET_SH5. + (sh_adjust_cost): Likewise. + sh64.h (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and + __PTRDIFF_TYPE__ . + (SUBTARGET_CPP_PTR_SPEC, WCHAR_TYPE): Don't #undef/ #define. + (WCHAR_TYPE_SIZE): Likewise. + (ASM_SPEC): Use subtarget_asm_endian_spec. + (SH_ELF_WCHAR_TYPE): #undef/ #define. + (MAX_WCHAR_TYPE_SIZE): Don't #undef. + * config/sh/elf.h (WCHAR_UNSIGNED): #undef . + (MAX_WCHAR_TYPE_SIZE): Don't #define . + (WCHAR_TYPE, WCHAR_TYPE_SIZE): #undef / #define . + (USER_LABEL_PREFIX): Don't #undef /#define . + (DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER. + * config/elf/linux.h (USER_LABEL_PREFIX): Don't #undef /#define . + (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Likewise. + (ASM_SPEC): Likewise. + (SUBTARGET_ASM_ENDIAN_SPEC): #undef / #define . + (CC1_SPEC): don't supply -m3 for -m4*, -m5*. + * t-sh: (LIB1ASMFUNCS): Use LIB1ASMFUNCS_CACHE. + (LIB2FUNCS_EXTRA): Define. + * t-sh64 (LIB2FUNCS_EXTRA): Define. + * config/sh/t-linux (LIB1ASMFUNCS): Don't redefine. + (LIB1ASMFUNCS_CACHE): Define. + (LIB2FUNCS_EXTRA): Redefine empty. + +2002-04-08 Richard Henderson + + * reorg.c (get_branch_condition): Use reversed_comparison_code. + +2002-04-09 Stephane Carrez + + * config/m68hc11/larith.asm (__map_data_section): Fix condition + and optimize for size. + (__do_global_ctors): Fix pointer comparison. + (__do_global_dtors): Likewise. + +2002-04-09 David S. Miller + + * config/sparc/sparc.c (sparc_extra_constraint_check): New + function, implementing EXTRA_CONSTRAINTS. For memory constraints, + allow reloading pseudos. + * config/sparc/sparc.h (EXTRA_CONSTRAINTS): Use it. + * config/sparc/sparc-protos.h: Declare it. + + * config/sparc/sparc.c (const64_is_2insns): Kill signed vs. + unsigned comparison warning. + (output_restore_regs): Mark leaf_function as unused. + +Tue Apr 9 09:35:45 2002 Richard Kenner + + * expr.c (is_aligning_offset): New function. + (expand_expr, case COMPONENT_EXPR): Call it. + +2002-04-08 David S. Miller + + PR target/6082 + * config/sparc/freebsd.h (SPARC_DEFAULT_CMODEL): Set to CM_MEDLOW + + Make init_priority work on SPARC when using GNU ld. + * config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/netbsd-elf.h, config/sparc/freebsd.h + (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Undefine. + * config/sparc/sol2-gld.h: New file to do the same. + * config.gcc (sparc*-*-solaris2*): If gnu_ld=yes add + sparc/sol2-gld.h to tm_file. + + PR optimization/4328 + * config/sparc/sparc.h (EXTRA_CONSTRAINT): Add new constraint 'W'. + * doc/md.texi: Document it. + * config/sparc/sparc.md (movdi_insn_sp64_novis, + movdi_insn_sp64_vis, movdf_insn_sp32, movdf_insn_v9only_novis, + movdf_insn_v9only_vis, movdf_insn_sp64_novis, + movdf_insn_sp64_vis): Use it as MEM constraing with 'e' registers. + * config/sparc/sparc.c (mem_min_alignment): Fix comment. + +2002-04-08 Andreas Jaeger + + * stmt.c (expand_asm_operands): Revert last patch from Richard + Henderson. + +2002-04-08 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add John David Anglin and Loren + J. Rittle (the latter also to Testers). Update David O'Brien's entry. + +2002-04-08 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add David O'Brien. + +2002-04-08 Alan Modra + + * configure.in (auto-build.h): Use target_alias and build_alias + when running configure. + (gcc_cv_as, gcc_cv_ld): Search install paths when build != host too. + (gcc_cv_nm, gcc_cv_objdump): Set for build != host too. + * configure: Regenerate. + +2002-04-07 David S. Miller + + * config.gcc (sparc64-*-linux*): Add t-crtfm to tmake_file. + +2002-04-07 John David Anglin + + PR 5933 + * pa.h (ASM_OUTPUT_MI_THUNK): Use indirect jump to target function when + generating 32-bit pic code. + +2002-04-06 Jason Thorpe + + * cppinit.c (cpp_create_reader): Initialize + discard_comments_in_macro_exp. + (COMMAND_LINE_OPTIONS): Add "-CC" option. + (cpp_handle_option): Handle "-CC" option. + * cpplex.c (save_comment): If saving a C++ comment in + a directive, convert it to a C comment. + (_cpp_lex_direct): Pass second comment start character to + save_comment to indicate comment type. + * cpplib.c (_cpp_handle_directive): If processing + a "#define" directive and discard_comments_in_macro_exp + is false, re-enable saving of comments. + (lex_macro_node): If discard_comments_in_macro_exp is false, + discard any comments before the macro identifier. + * cpplib.h (struct cpp_options): Add discard_comments_in_macro_exp + member. + * cppmacro.c (cpp_get_token): If expanding a macro while + processing a directive, discard any comments we might encounter. + (parse_params): If discard_comments_in_macro_exp is false, + ignore comments in the macro parameter list. + * gcc.c (cpp_unique_options): Add "-CC" option. + (option_map): Map "--comments-in-macros" to "-CC". + * doc/cppopts.texi: Document "-CC" option. + * f/lang-specs.h: Add "-CC" option. + * testsuite/gcc.dg/cpp/maccom1.c: New test. + * testsuite/gcc.dg/cpp/maccom2.c: New test. + * testsuite/gcc.dg/cpp/maccom3.c: New test. + * testsuite/gcc.dg/cpp/maccom4.c: New test. + * testsuite/gcc.dg/cpp/maccom5.c: New test. + * testsuite/gcc.dg/cpp/maccom6.c: New test. + +2002-04-06 John David Anglin + + PR middle-end/6180 + * reorg.c (dbr_schedule): Don't reposition prologue and epilogue notes. + +2002-04-06 Mark Mitchell + + PR c++/5571 + * stor-layout.c (layout_decl): Reset the RTL for the decl. + + PR opt/5120 + * sibcall.c (optimize_sibling_and_tail_recursive_call): Clear + RTX_UNCHANGING_P for the functions arguments when a tail call + is made. + +2002-04-06 Jason Merrill + + * toplev.c (flag_no_inline, flag_really_no_inline): Default to 2. + (parse_options_and_default_flags): Set them appropriately. + * c-common.c (c_common_post_options): Don't set flag_really_no_inline. + +2002-04-06 Hans-Peter Nilsson + + * config/mmix/t-mmix (TARGET_LIBGCC2_CFLAGS): Don't -Dinhibit_libc + here. + + * config/mmix/mmix.h (INITIAL_ELIMINATION_OFFSET): Remove spurious + semicolon. + + * config/mmix/mmix.c (mmix_expand_builtin_va_arg): Variable-size + types come in by-reference. Fix typo in comment. + +2002-04-05 David S. Miller + + * config/sparc/freebsd.h (ENDFILE_SPEC): Add crtfastmath bits. + * config.gcc (sparc64-wrs-vxworks, sparc-*-chorusos, + sparc-*-rtems*, sparclite-*-elf* sparc86x-*-elf*, sparc64-*-elf*, + {sparc64,ultrasparc}-*-freebsd*): Add sparc/t-crtfm to tmake_file. + +2002-04-05 David S. Miller + + * config/sparc/sparc.c (sparc_nonflat_function_epilogue): If we + are not going to emit return instructions, emit at least a nop + for the sake of sane backtraces. + +2002-04-05 Richard Henderson + + * doc/rtl.texi (Regs and Memory): Document (mem:BLK (scratch)). + +2002-04-05 Jakub Jeilnek + + * mklibgcc.in: Use $tmpmapfile, not tmp-$@. + +2002-04-05 Alexandre Oliva + + * config/mips/mips.h (ISA_HAS_BRANCHLIKELY, ISA_HAS_CONDMOVE, + ISA_HAS_FP4, ISA_HAS_MADD_MSUB, ISA_HAS_NMADD_NMSUB, + ISA_HAS_CLZ_CLO, ISA_HAS_DCLZ_DCLO): Disable if TARGET_MIPS16. + +2002-04-05 Andreas Schwab + + * c-convert.c: Include c-common.h. + * Makefile.in (c-convert.o): Updated. + +2002-04-05 Jakub Jelinek + + * mklibgcc.in: Use separate libgcc.map for each multilib. + * Makefile.in (distclean): Don't remove libgcc.map here. + +2002-04-05 Jakub Jelinek + + * Makefile.in (s-mlib): Handle --disable-multilib by separate + genmultilib invocation. + +2002-04-04 Richard Sandiford + + * config/mips/mips.h (CUMULATIVE_ARGS): Rename fp_regs to num_fprs + to avoid clash with Irix header file sys/ucontext.h. Rename gp_regs + to num_gprs for symmetry. + * config/mips/mips.c: Adjust accordingly. + +2002-04-04 Neil Booth + + * c-common.c (truthvalue_conversion): Rename, update. + * c-common.h (c_common_truthvalue_conversion): New. + * c-convert.c (convert): Update. + * c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. + * c-parse.in (expr_no_commas, if_prefix, select_or_iter_stmt): Update. + * c-typeck.c (build_binary_op, build_unary_op, + build_conditional_expr): Update. + * fold-const.c (constant_boolean_node, fold): Use langhook. + * langhooks-def.h (LANGHOOK_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New hook. + * stmt.c (expand_decl_cleanup): Use langhook. + * tree.h (truthvalue_conversion): Remove. +objc: + * objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. + +2002-04-05 Alan Modra + + * config/rs6000/t-linux64 (EXTRA_MULTILIB_PARTS): Add crtsavres.o + Add rules to make null object file. + +2002-04-04 Jim Blandy + + * cppmacro.c (cpp_macro_definition): Do not emit spaces after + macro formal parameter names. + +2002-04-04 David S. Miller + + * calls.c (store_one_arg): If ECF_SIBCALL, use tail_call_reg. + +2002-04-04 Richard Henderson + + PR middle-end/5099 + * stmt.c (expand_asm_operands): Validate outputs vs asm_operand_ok. + Support copies into and out of memory. Don't accept allows_reg + and allows_mem as gospel. + +2002-04-04 Richard Henderson + + PR opt/6165 + * alias.c (true_dependence): Force (mem:blk (scratch)) to conflict. + (write_dependence_p): Likewise. + +2002-04-04 Richard Henderson + + * predict.c (estimate_bb_frequencies): Do frequency calculation + with a volatile temporary. + +2002-04-04 Ulrich Weigand + + * config/s390/linux.h (LOCAL_LABEL_PREFIX): Define. + +2002-04-04 Jakub Jelinek + + PR c++/6119 + * final.c (final_start_function): Don't bump profile_label_no here... + (final_end_function): ...but here. + +2002-04-04 Jakub Jelinek + + * config/sparc/sparc.md (pic): New attribute. + (do_builtin_setjmp_setup): Save %fp, %i7 and %l7 for TARGET_V9 + into stack slots. + (split after do_builtin_setjmp_setup): New. + +2002-04-04 Jakub Jelinek + + PR fortran/6106 + * config/sparc/sparc.h (MIN_UNITS_PER_WORD): Backout 2001-01-01 + change. + +2002-04-04 Jakub Jelinek + + * config/sparc/sparc.c (sparc_va_arg): Adjust va_list by + UNITS_PER_WORD for zero sized aggregates. + +2002-04-03 David S. Miller + + * gcc.c (LINK_GCC_C_SEQUENCE_SPEC): No need for a new + one-character spec for this, just use %(link_gcc_c_sequence). + +2002-04-03 David S. Miller + + * config/sparc/crtfastmath.c (FPRS_NS): Delete bogus little-endian + handling. + +2002-04-03 John David Anglin + + * pa-linux.h (INCOMING_RETURN_ADDR_RTX): Move. + (DWARF_FRAME_RETURN_COLUMN): Move. + (ASM_PREFERRED_EH_DATA_FORMAT): Define. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Define. + * pa.c (except.h, predict.h): Include. + (FRP): Delete. + (store_reg_modify, set_reg_plus_d): Revise prototypes. + (output_ascii): Add cast. + (store_reg_modify): Revise to add frame notes. + (set_reg_plus_d): Likewise. + (compute_frame_size): Include space for eh data registers in frame if + the current function calls eh_return. + (hppa_expand_prologue): Ensure register %r2 is saved if the current + function calls eh_return. Save eh data registers if the current + function calls eh_return. Fix code to add frame notes. Emit + blockage to prevent insns with frame notes being scheduled in the + delay slot of calls. + (hppa_expand_epilogue): Restore eh data registers and do final stack + adjustment if the current function calls eh_return. Don't add frame + notes. + (output_call): Revise for change in length of call insn. Don't do + return pointer adjustment for an unconditional jump in the delay slot + of a call when using frame notes. + * pa.h (EH_RETURN_DATA_REGNO): Revise for TARGET_64BIT compatibility. + (EH_RETURN_HANDLER_RTX): Use saved value on stack. + (ARG_POINTER_CFA_OFFSET): Define. + * pa.md (return_external_pic): New pattern. + (prologue): Correct formatting. Use return_external_pic if current + function calls eh_return. + (call_internal_symref, call_value_internal_symref, + sibcall_internal_symref, sibcall_value_internal_symref): Change default + lengths of short, long non-pic, and long pic calls to 8, 68, and 84, + respectively. + (exception_receiver): Use hppa_pic_save_rtx () to restore pic register. + + * configure.in ("assembler dwarf2 debug_line support"): Add hppa*-*-* to + list of targets to check using "nop" insn. + * configure: Rebuilt. + +2002-04-04 Alan Modra + + * config/rs6000/t-linux64 (EXTRA_MULTILIB_PARTS): Define. + +2002-04-03 David S. Miller + + * gcc.c (LINK_GCC_C_SEQUENCE_SPEC): New spec to override the gcc/c + library sequence passed to the linker. + (LINK_COMMAND_SPEC): Use it. + * doc/tm.texi: Document it, and mention from LINK_COMMAND_SPEC as + a macro a target can use to avoid overriding LINK_COMMAND_SPEC. + * config/sparc/sparc.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + +2002-04-03 Jason Merrill + + * except.c (struct eh_status): Remove protect_list. + (begin_protect_partials, end_protect_partials): Remove. + (add_partial_entry): Remove. + * except.h: Remove prototypes. + + * expr.c (expand_expr) [WITH_CLEANUP_EXPR, TARGET_EXPR]: Use + expand_decl_cleanup_eh. + + PR c++/5636 + * tree.h (CLEANUP_EH_ONLY): New macro. + * stmt.c (expand_decl_cleanup_eh): New fn. + (expand_cleanups): Check CLEANUP_EH_ONLY. + * c-semantics.c (genrtl_decl_cleanup): Just take the CLEANUP_STMT. + Use expand_decl_cleanup_eh. + (expand_stmt): Adjust. + * c-common.h: Adjust prototype. + +2002-04-04 Hans-Peter Nilsson + + * config/cris/cris.c (cris_target_asm_function_prologue): Cast + uses of PIC_OFFSET_TABLE_REGNUM to int to silence warnings. + (cris_target_asm_function_epilogue): Ditto. + (cris_initial_frame_pointer_offset): Ditto. + (cris_simple_epilogue): Ditto. + (cris_expand_builtin_va_arg): Variable-size types come in + by-reference. + +2002-04-03 David S. Miller + + * config/sparc/crtfastmath.c (FPRS_NS): Get it right for + little-endian. + (set_fast_math): Correct 'fsr' type. + +2002-04-03 Richard Henderson + + PR opt/3569 + * langhooks.h (lang_hooks.decls.warn_unused_global): New. + * toplev.c (check_global_declarations): Use it. + * langhooks-def.h (lhd_warn_unused_global_decl): Declare. + (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. + (LANG_HOOKS_DECLS): Add it. + * langhooks.c (lhd_warn_unused_global_decl): New. + * c-decl.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. + * c-objc-common.c (c_warn_unused_global_decl): New. + * c-tree.h (c_warn_unused_global_decl): Declare. + * objc/objc-lang.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. + +2002-04-03 Neil Booth + + * langhooks-def.h (lhd_set_decl_assembler_name, + LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_set_decl_assembler_name): New, from tree.c + * langhooks.h (struct lang_hooks): New hook. + * tree.c (set_decl_assembler_name): Move to langhooks.c. + (lang_set_decl_assembler_name): Remove. + (init_obstacks): Don't set hook. + (decl_assembler_name): New function. + * tree.h (DECL_ASSEMBLER_NAME): Turn into a function call. + (decl_assembler_name): New. + (lang_set_decl_assembler_name): Remove. + +2002-04-03 Jakub Jelinek + + * configure.in (HAVE_SPARC_UA_PCREL_HIDDEN): Test whether %r_disp32() + works properly with .hidden symbols. + * configure: Rebuilt. + * config.in: Rebuilt. + * config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT): Use + DW_EH_PE_absptr for flag_pic && GLOBAL if %r_disp32() doesn't work + properly with .hidden symbols. + +2002-04-03 Jakub Jelinek + + PR middle-end/6102 + * df.c (df_insn_refs_record): Use XEXP not SET_DEST to access + USE argument. + +2002-04-03 Richard Henderson + + PR opt/4120 + * sched-rgn.c (sets_likely_spilled): New. + (sets_likely_spilled_1): New. + (add_branch_dependences): Use it. + +2002-04-02 Richard Henderson + + PR opt/4311 + * loop.h (LOOP_FIRST_PASS): New. + * loop.c (strength_reduce): Mind it when deciding to unroll. + * toplev.c (rest_of_compilation): Set it. + +2002-04-02 David S. Miller + + * config/sparc/sparc.md (ldd peephole2s): Fix final arg to + mems_ok_for_ldd_peep when the order of the loads being examined + is reversed. + * config/sparc/sparc.c (mems_ok_for_ldd_peep): Expand upon + existing comment to increase comprehension of this situation. + +2002-04-02 Zack Weinberg + + * config/sh/sh.md: Don't use union real_extract. + +2002-04-02 Richard Henderson + + * libgcc2.c (__bb_exit_func): Revert 03-31 change. + +2002-04-02 David O'Brien + + * config.gcc (i386-dg-dgux, i386-go32-msdos , i386-go32-rtems, + i386-ibm-aix, i386-moss-msdos, i386-ncr-sysv4, i386-next-, + i386-pc-msdosdjgpp, i386-sequent-bsd, i386-sequent-ptx1, + i386-sequent-ptx2, i386-sequent-ptx4, i386-sun-sunos, + i386-wrs-vxworks, i386-*-aout, i386-*-beoself, i386-*-bsd, + i386-*-bsdi, i386-*-chorusos, i386-*-coff, i386-*-elf, + i386-*-freebsd5, i386-*-freebsd-aout, i386-*-gnu, i386-*-interix, + i386-*-interix3, i386-*-isc, i386-*-linux, i386-*-linuxaout, + i386-*-linuxoldld, i386-*-lynxos, i386-*-mach, i386-*-mingw32, + i386-*-netbsd, i386-*-netbsdelf, i386-*-netware, i386-*-openbsd, + i386-*-osf1, i386-*-osfrose, i386-*-pe , i386-*-rtems, + i386-*-rtemscoff, i386-*-sco3.2v5, i386-*-solaris2, i386-*-sysv, + i386-*-sysv4, i386-*-sysv5, i386-*-udk, i386-*-uwin, i386-*-vsta, + i386-*-win32, x86_64-*-freebsd5, x86_64-*-linux, x86_64-*-netbsd): + Include as many configury headers via tm_file as possible. This + includes among others i386/unix.h, i386/bsd.h, i386/gas.h. + * config/openbsd-oldgas.h: New file. + * config/i386/386bsd.h, config/i386/aix386ng.h, config/i386/att.h, + config/i386/bsd.h, config/i386/djgpp.h, config/i386/freebsd-aout.h, + config/i386/gas.h, config/i386/gstabs.h, config/i386/i386-aout.h, + config/i386/i386-coff.h, config/i386/i386-interix.h, + config/i386/iscdbx.h, config/i386/linux-aout.h, + config/i386/linux-oldld.h, config/i386/lynx-ng.h, config/i386/lynx.h, + config/i386/mach.h, config/i386/netbsd.h, config/i386/next.h, + config/i386/openbsd.h, config/i386/osfelf.h, config/i386/osfrose.h, + config/i386/sco5.h, config/i386/seq-gas.h, config/i386/seq-sysv3.h, + config/i386/seq2-sysv3.h, config/i386/sequent.h, config/i386/sun.h, + config/i386/sun386.h, config/i386/svr3dbx.h, config/i386/svr3gas.h, + config/i386/sysv3.h, config/i386/uwin.h, config/i386/vsta.h, + config/i386/vxi386.h: Do not directly include configury headers. + * config/i386/cygwin.h, config/i386/djgpp.h, config/i386/win32.h: + Directly include configury headers that are no longer automatically + included by the above headers. + * config/i386/att.h, config/i386/bsd.h (TARGET_VERSION): Do not define. + * config/i386/386bsd.h, config/i386/aix386ng.h, config/i386/cygwin.h, + config/i386/djgpp.h, config/i386/i386-aout.h, config/i386/i386-coff.h, + config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mach.h, + config/i386/netbsd.h, config/i386/openbsd.h, config/i386/rtems.h, + config/i386/seq-sysv3.h, config/i386/sequent.h, config/i386/svr3gas.h, + config/i386/sysv3.h, config/i386/vsta.h, config/i386/vxi386.h + (TARGET_VERSION): Define. + * config/i386/beos-elf.h, config/i386/freebsd.h, + config/i386/i386-interix.h, config/i386/i386elf.h, config/i386/linux.h, + config/i386/linux64.h, config/i386/netbsd-elf.h, config/i386/netbsd64.h, + config/i386/osfelf.h, config/i386/osfrose.h, config/i386/ptx4-i.h, + config/i386/sco5.h, config/i386/sysv4.h + (TARGET_VERSION): Do not need to protect. + * config/i386/freebsd64.h (TARGET_VERSION): Fix style. + * config/i386/386bsd.h, config/i386/cygwin.h, config/i386/djgpp.h, + config/i386/freebsd-aout.h, config/i386/i386-aout.h, + config/i386/i386-interix.h, config/i386/linux-aout.h, + config/i386/linux-oldld.h, config/i386/mach.h, config/i386/netbsd.h, + config/i386/openbsd.h, config/i386/vsta.h, config/i386/win32.h + (YES_UNDERSCORES): Do not define - not needed. + * config/i386/bsd.h, config/i386/gas.h (LPREFIX, + ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL, + USER_LABEL_PREFIX): Do not handle the "NO_UNDERSCORES" case. + * config/i386/i386-coff.h, config/i386/lynx.h, config/i386/lynx-ng.h + (LPREFIX, ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL, + USER_LABEL_PREFIX): Define. (handles the "NO_UNDERSCORES" case) + * config/i386/isc.h: Preserve comment from config/i386/isccoff.h. + * config/i386/isccoff.h, config/i386/v3gas.h: Remove. + +2002-04-02 Eric Botcazou + Richard Henderson + + PR c/5484 + * function.c (assign_temp): Accept either type or decl argument. + Detect variables whose size is too large to fit into an integer. + * stmt.c (expand_decl): Pass the decl, not the type. + +2002-04-02 David O'Brien + + * protoize.c: Match include directory usage with cppdefault.c. + +2002-04-03 Jeffrey A Law (law@redhat.com) + Hans-Peter Nilsson + + * combine.c (simplify_comparison): Avoid narrowing a comparison + with a paradoxical subreg when doing so would drop signficant bits. + +2002-04-02 Steve Ellcey + + * builtins.c (expand_builtin_prefetch): Force op0 pointer to Pmode + if POINTERS_EXTEND_UNSIGNED is defined. + +2002-04-02 Richard Henderson + + PR opt/3967 + * local-alloc.c (contains_replace_regs): LO_SUM may contain + replace regs. + +2002-04-02 Richard Henderson + + * doc/standards.texi: Document required freestanding libc entry points. + +2002-04-02 Alan Modra + + * config/rs6000/rs6000.md (ctrdi*): Add FPR constraint and + associated splitter. Remove MQ constraint. + (ctrdi_internal4): Correct CCmode clobber. + +2002-04-02 John David Anglin + + * milli64.S ($$dyncall): New function. + * t-linux (LIB1ASMFUNCS): Revise module list. + (LIB1ASMSRC): Use pa/milli64.S. + +2002-04-02 Richard Henderson + + * fixinc/inclhack.def (AAB_solaris_sys_varargs_h): Move and + rename solaris_sys_varargs_h. + +Tue Apr 2 06:47:40 2002 Richard Kenner + + * stor-layout.c (layout_type, case ARRAY_TYPE): Give one-element array + the same mode as its component. + +2002-04-02 Richard Henderson + + PR opt/190 + * final.c (this_is_asm_operands): Export. + * output.h (this_is_asm_operands): Declare. + * config/i386/i386.c (print_operand): Error odd asm operands. + +2002-04-02 Richard Henderson + + PR opt/420 + * config/m68k/m68k.md (dbcc peepholes): Match four forms of dbra. + +2002-04-01 Richard Henderson + + PR target/1538 + * fixinc/inclhack.def (solaris_sys_varargs_h): New. + * fixinc/fixincl.x: Rebuild. + +2002-04-01 Richard Henderson + + * config/ia64/unwind-ia64.c: Include ia64intrin.h. + (atomic_alloc, atomic_free): New. + (SIZE, MASK_FOR, PTR_IN): New. + (emergency_reg_state, emergency_reg_state_free): New. + (emergency_labeled_state, emergency_labeled_state_free): New. + (reg_state_alloced, labeled_state_alloced): New. + (alloc_reg_state, free_reg_state): New. + (alloc_label_state, free_label_state, free_label_states): New. + (push, pop, dup_state_stack, free_state_stack): Use them. + (desc_label_state): Likewise. + (uw_frame_state_for): Free label states and state stack. + (uw_update_reg_address): Eliminate warnings. + +2002-04-01 Vladimir Makarov + + * config/pa/pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON, + ASM_OUTPUT_ALIGNED_LOCAL): Redefine them. + +2002-04-01 Neil Booth + + * c-decl.c (grokdeclarator): Update. + * c-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. + * c-tree.h (c_mark_addressable): New. + * c-typeck.c (default_function_array_conversion, build_unary_op, + build_array_ref, convert_for_assignment): Update. + (mark_addressable): Rename. + * calls.c (try_to_integrate, expand_call): Use langhook. + * expr.c (expand_expr): Use langhook. + * langhooks-def.h (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New hook. + * stmt.c (expand_asm_operands): Use langhook. + * tree.h (mark_addressable): Remove. +objc: + * objc-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. + +2002-04-01 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_va_arg): Fix compiler warning + in previous change. + +2002-04-01 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_va_arg): Fix to handle arguments + for which MUST_PASS_IN_STACK is true (e.g., variable-sized types). + +2002-04-01 Neil Booth + + * c-common.c (unsigned_conversion_warning, convert_and_check, + unsigned_type, signed_type, shorten_compare, + c_common_get_alias_set, c_common_nodes_and_builtins): Use new hooks. + (unsigned_type, signed_type, signed_or_unsigned_type): Rename. + * c-common.h (unsigned_type, signed_type, signed_or_unsigned_type): + New. + * c-decl.c (grokdeclarator): Update. + * c-format.c (check_format_types): Update. + * c-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. + * c-typeck.c (build_binary_op, convert_for_assignment): Update. + * convert.c (convert_to_integer): Use new hooks. + * expmed.c (make_tree): Use new hooks. + * expr.c (store_expr): Use new hooks. + * fold-const.c (operand_equal_for_comparison_p, build_range_check, + all_ones_mask_p, unextend, fold): Use new hooks. + * langhooks.h (struct lang_hooks_for_types): New hooks. + * tree.h (signed_or_unsigned_type, signed_type, + unsigned_type): Remove. +objc: + * objc-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. + +2002-03-31 Richard Henderson + + * config/ia64/unwind-ia64.c (alloc_spill_area): Fix offset. + (desc_frgr_mem): Fix reference to f16-f31. + +2002-03-31 Kaveh R. Ghazi + + * rtl.h (RTL_CHECK1, RTL_CHECK2, RTL_CHECKC1, RTL_CHECKC2, + RTVEC_ELT): Const-ify. + * varray.h (VARRAY_CHECK): Const-ify. + * ggc.h (ggc_mark_rtx, ggc_mark_tree, ggc_mark_nonnull_tree, + ggc_mark_rtvec, ggc_mark): Const-ify. + +2002-04-01 Neil Booth + + * diagnostic.c: Include langhooks-def.h. + * Makefile.in (diagnostic.o): Update. + +2002-03-31 Neil Booth + + * c-common.c (c_unsafe_for_reeval): Rename. + * c-common.h (c_unsafe_for_reeval): Rename. + * c-decl.c (finish_incomplete_decl): Rename. + (c_init_decl_processing): Don't set langhook. + * c-lang.c (LANG_HOOKS_FINISH_INCOMPLETE_DECL, + LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine. + * c-objc-common.c (c_objc_common_init): Don't set langhook. + * c-tree.h (finish_incomplete_decl): Rename. + * langhooks-def.h (lhd_unsafe_for_reeval): New. + (LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_unsafe_For_reeval): New. + * langhooks.h (struct langhooks): New hooks. + * toplev.c (incomplete_decl_finalize_hook): Remove. + (wrapup_global_declarations): Update. + * tree.c (lang_unsafe_for_reeval): Remove. + (unsafe_for_reeval): Update. + * tree.h (lang_unsafe_for_reeval, incomplete_decl_finalize_hook): + Remove. +objc: + * objc-lang.c (LANG_HOOKS_FINISH_INCOMPLETE_DECL, + LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine. + +2002-03-31 Neil Booth + + * diagnostic.c (print_error_function): Remove. + (default_print_error_function): Rename. + (report_error_function): Update. + * diagnostic.h (print_error_function): Remove. + (default_print_error_function): Remove. + * langhooks-def.h (struct diagnostic_context): Predeclare. + (lhd_print_error_function, LANG_HOOKS_PRINT_ERROR_FUNCTION): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct diagnostic context): Predeclare. + (struct lang_hooks): New hook. + +2002-03-31 Franz Sirl + + * config/rs6000/rs6000.h (RS6000_PIC_OFFSET_TABLE_REGNUM): New. + (PIC_OFFSET_TABLE_REGNUM): Use it and return INVALID_REGNUM if + !flag_pic. + (CONDITIONAL_REGISTER_USAGE): Adjust accordingly. + * config/rs6000/rs6000.h: Use RS6000_PIC_OFFSET_TABLE_REGNUM instead + of PIC_OFFSET_TABLE_REGNUM thruout. + * config/rs6000/rs6000.md: Likewise. + * config/rs6000/darwin.h: Likewise. + +Sun Mar 31 14:43:24 2002 Richard Kenner + + * emit-rtl.c (adjust_address_1, offset_address): Cast value to + unsigned HOST_WIDE_INT, not unsigned int. + +2002-03-31 Jakub Jelinek + + PR middle-end/6096, middle-end/6098, middle-end/6099 + * reorg.c (emit_delay_sequence): Only increment LABEL_NUSES for + CODE_LABELs. + (fill_slots_from_thread): Likewise. + +2002-03-31 Jakub Jelinek + + * config/sparc/sparc.c (function_arg_record_value_1): Pass complex + floating fields in float regs. + (function_arg_record_value_2): Likewise. + +2002-03-31 Hans-Peter Nilsson + + * config/mmix/mmix.md (define_constants): Remove misleading + FIXME. Add MMIX_fp_rO_OFFSET. + ("nonlocal_goto_receiver"): Don't have stack-frame address of + saved rO as part of the pattern. Remove FIXME. + ("*nonlocal_goto_receiver_expanded"): Similar. Generate address + here, at output-time. + +2002-03-31 Jakub Jelinek + + PR middle-end/6100 + * config/sparc/sparc.c (output_cbranch): Use REG_BR_PROB, not + REG_BR_PRED. + (output_v9branch): Likewise. + +2002-03-31 Alexandre Oliva + + * gcc.c: Revert previous patch for now. + * config/i386/djgpp.h: Likewise. + +2002-03-31 Hans-Peter Nilsson + + * config/mmix/crti.asm (_init): Register _fini with atexit. + * config/mmix/crtn.asm (_fini): Add omitted "POP 0,0". + +2002-03-31 Richard Henderson + + PR target/3997 + * config/alpha/elf.h (ASM_OUTPUT_DEF): Tidy. + (ASM_OUTPUT_DEF_FROM_DECLS): New. + +2002-03-31 Richard Henderson + + * libgcc2.c (__bb_exit_func): Make static. + + * config/alpha/alpha.md (trap): New. + +2002-03-31 Richard Henderson + + * builtins.c (expand_builtin_va_arg): Give warnings not errors for + promoted argument types; build trap. + (expand_builtin_trap): New. + (expand_builtin): Use it. + * stmt.c (expand_nl_goto_receivers): Likewise. + * expr.h (expand_builtin_trap): Declare. + * libfuncs.h (LTI_abort, abort_libfunc): New. + * optabs.c (init_optabs): Init abort_libfunc. + +2002-03-31 Alexandre Oliva + + * gcc.c (LIBGCC_SPEC): Folded %L and duplicate %G here... + (LINK_COMMAND_SPEC): ... from here. + (init_gcc_specs): Duplicate it here too, omitting + shared_name in the second copy. + (init_spec): Test for duplicate + * config/i386/djgpp.h (LINK_COMMAND_SPEC): Remove `%L %G'. + +2002-03-30 David S. Miller + + * config/sparc/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + * config/sparc/linux64.h (HANDLE_PRAGMA_PACK_PUSH_POP): Likewise. + +2002-03-30 Roger Sayle + Richard Henderson + + * regmove.c (combine_stack_adjustments_for_block): Avoid + emitting a stack adjustment of zero bytes. Let delete_insn + update bb->head. + +2002-03-30 Richard Henderson + + * config/sparc/sparc.c: Remove all references to TARGET_EPILOGUE. + (sparc_emitting_epilogue): New. + (leaf_label, output_return, sparc_return_peephole_ok): Remove. + * config/sparc/sparc-protos.h: Update. + * config/sparc/sparc.h (MASK_EPILOGUE, TARGET_EPILOGUE): Remove. + (TARGET_SWITCHES): Update. + * config/sparc/sparc.md (return): Remove. + (return_*): Use sparc_emitting_epilogue, not !TARGET_EPILOGUE. + * config/sparc/freebsd.h, config/sparc/linux64.h, config/sparc/lite.h, + config/sparc/liteelf.h, config/sparc/netbsd-elf.h, + config/sparc/sol2-sld-64.h, config/sparc/sol2.h, + config/sparc/sp64-aout.h, config/sparc/sp64-elf.h, + config/sparc/sp86x-aout.h, config/sparc/sp86x-elf.h, + config/sparc/splet.h, config/sparc/vxsparc64.h (TARGET_DEFAULT): + Remove MASK_EPILOGUE. + * doc/invoke.texi: Update. + +2002-03-30 Daniel Berlin + + * dwarf2out.c (dwarf2out_define): Remove start_source_file call, + CPP will start the file for us. + +2002-03-30 Richard Henderson + + PR target/5446 + * config/ia64/ia64.c (group_barrier_needed_p): Special case + prologue_allocate_stack. + (ia64_single_set): Use insn codes for recognition of special + cases, not rtl matching. + * config/ia64/ia64.md (prologue_allocate_stack): Op 3 is in-out. + +Sat Mar 30 23:48:41 CET 2002 Jan Hubicka + + * cfgbuild.c (find_basic_blocks_1): Clear aux for blocks. + +2002-03-30 Richard Henderson + + PR target/6032 + * config/sparc/sparc.h (OVERRIDE_OPTIONS): Don't override -fpic + or -fomit-frame-pointer with profiling. + (SUBTARGET_OVERRIDE_OPTIONS): Remove. + (FUNCTION_PROFILER): Do nothing. + (PROFILE_HOOK): New. + * config/sparc/sparc.c (sparc_override_options): Don't check + code models for profiling. + (sparc_function_profiler): Remove. + (sparc_profile_hook): New. + * config/sparc/sparc-protos.h: Update. + +2002-03-30 Jakub Jelinek + + PR optimization/6086 + * combine.c (combine_simplify_rtx): If simplify_rtx failed because + of SUBREG of volatile MEM or because the MEM was mode dependent, + return CLOBBER instead of unmodified SUBREG. + +Sat Mar 30 14:08:55 CET 2002 Jan Hubicka + + * local-alloc.c (local_alloc): Avoid call of update_equiv_regs + when not optimizing. + + * toplev.c (rest_of_compilation): Cann mark_constant_function + only when optimizing. + + * flow.c (calculate_global_regs_live): Ensure that all AUX fields + are NULL. + + * cfgcleanup.c (bb_flags): Add BB_NONTHREADABLE_BLOCK. + (thread_jump): Set BB_NONTHREADABLE_BLOCK, check it. + (try_optimize_cfg): clear all AUX fields. + + * i386.c (aligned_operand): Be prepared for SUBREGed registers. + (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG. + (ix86_address_cost): Be prepared for SUBREGed registers. + (legitimate_address_p): Accept SUBREGed registers. + +2002-03-29 Richard Henderson + + PR target/5672 + * expr.c (expand_expr): Pass along EXPAND_INITIALIZER one more place. + +2002-03-29 Franz Sirl + + * config/rs6000/rs6000.c (rs6000_va_arg): Correctly set register count + for aggregate and TFmode types. + +2002-03-29 Hans-Peter Nilsson + + * cfg.c (dump_flow_info): Guard against NULL regno_reg_rtx[i]. + +2002-03-29 Richard Henderson + + PR target/5886 + * config/ia64/aix.h (CPP_PREDEFINES): Add -D_LP64. + * config/ia64/hpux.h, config/ia64/linux.h: Likewise. + +2002-03-29 Richard Henderson + + PR target/6041 + * config/i386/i386.c (x86_arch_always_fancy_math_387): New. + (override_options): Disable NO_FANCY_MATH_387 if the arch allows. + * config/i386/i386.h (x86_arch_always_fancy_math_387): New. + * config/i386/i386.md (sqrtxf2, sqrtextendsfxf2, sinxf2): Fix + conditional. + * docs/invoke.texi: Update -mno-fancy-math-387 docs. + +2002-03-29 Dale Johannesen + + * loop.c (combine_movables): Do allow combination of pseudos. + +2002-03-29 Loren J. Rittle + + * config.gcc (*-*-freebsd*): Enable creation of libgcc_s.so. + * config/t-slibgcc-elf-ver (SHLIB_LC): Add macro and use it. + No functional change except ... + * config/t-slibgcc-nolc-override (SHLIB_LC): Override it. New file. + * doc/install.texi (*-*-freebsd*): Document port configuration. + +2002-03-29 Neil Booth + + * Makefile.in (convert.o, calls.o, expmed.o): Update. + * attribs.c (handle_mode_attribute, handle_vector_size_attribute): + Use new hooks. + * builtin-types.def (BT_PTRMODE): Update. + * c-common.c (type_for_size): Rename c_common_type_for_size. + (type_for_mode): Similarly. + (shorten_compare, pointer_int_sum, c_common_nodes_and_builtins): + Use new hook. + * c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New. + * c-decl.c (finish_enum, build_enumerator): Use new hooks. + * c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): + Redefine. + * c-typeck.c (common_type, comptypes, default_conversion): + Use new hooks. + * calls.c: Include langhooks.h. + (emit_library_call_value_1): Use new hooks. Avoid redundant + calls. + * convert.c: Include langhooks.h + (convert_to_pointer, convert_to_integer): Use new hooks. + * except.c (init_eh): Similarly. + * expmed.c: Include langhooks.h. + (expand_mult_add): Use new hooks. + * expr.c (store_expr, store_constructor, expand_expr, do_jump, + try_casesi): Similarly. + * fold-const.c (optimize_bit_field_compare, make_range, + decode_field_reference, fold_truthop, fold): Similarly. + * function.c (assign_stack_local_1, assign_stack_temp_for_type, + put_var_into_stack): Similarly. + * langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE, + LANG_HOOKS_TYPE_FOR_SIZE): New. + (LANG_HOOKS_TYPES_INITIALIZER): Update. + * langhooks.h (lang_hooks_for_types): New hooks. + * stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks. + * tree.c (get_unwidened, get_narrower): Similarly. + * tree.h (type_for_mode, type_for_size): Remove. + * varasm.c (force_const_mem): Use new hooks. + * utils2.c (nonbinary_modular_operation): Update. +objc: + * objc-act.c (handle_impent): Update. + * objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): + Redefine. + +2002-03-29 Steve Ellcey + + * config/ia64/ia64.md (*ptr_extend_plus_1, *ptr_extend_plus_2): New. + * config/ia64/ia64.c (basereg_operand): New. + * config/ia64/ia64-protos.h (basereg_operand): Declare. + * config/ia64/ia64.h (PREDICATE_CODES): Add basereg_operand. + +2002-03-29 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_target_asm_function_prologue): Correct + unwind information when frame_pointer_needed. + (mmix_assemble_integer): Tweak wording in comment. + +2002-03-29 Neil Booth + + * Makefile.in (except.o): Update. + * except.c: Include langhooks.h. + (init_eh): Use langhook. + * langhooks-def.h (LANG_HOOKS_MAKE_TYPE, + LANG_HOOKS_FOR_TYPES_INITIALIZER): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (lang_hooks_for_types): New. + (struct lang_hooks): Add it. + * tree.c (make_lang_type_fn, make_lang_type): Remove. + * tree.h (make_lang_type_fn, make_lang_type): Remove. +config: + * alpha/alpha.c: Include langhooks.h. + (alpha_build_va_list): Use langhook. + * d30v/d30v.c: Include langhooks.h. + (d30v_build_va_list): Use langhook. + * i386/i386.c: Include langhooks.h. + (ix86_build_va_list): Use langhook. + * rs6000/rs6000.c (rs6000_build_va_list): Use langhook. + * s390/s390.c: Include langhooks.h. + (s390_build_va_list): Use langhook. + * stormy16/stormy16.c: Include langhooks.h. + (stormy16_build_va_list): Use langhook. + +2002-03-29 Jakub Jelinek + + PR c++/5964 + * config/sparc/sparc.md (empty_delay_slot, branch_type): New + attributes. + (length): Compute variable length for branches/calls/jumps here. + (branch, inverted_branch, normal_fp_branch, inverted_fp_branch, + normal_fpe_branch, inverted_fpe_branch): Remove length attribute, + define branch_type attribute. + (divsi3_sp32): Maximum length is 6 not 7. + (call_address_struct_value_sp32, call_symbolic_struct_value_sp32, + call_address_untyped_struct_value_sp32, + call_symbolic_untyped_struct_value_sp32): Set length to 3 not 2. + * config/sparc/sparc.c (empty_delay_slot): New function. + * config/sparc/sparc.h (ADJUST_INSN_LENGTH): Remove. + * config/sparc/sparc-protos.h (empty_delay_slot): Add prototype. + +2002-03-29 Jakub Jelinek + + * combine.c (set_nonzero_bits_and_sign_copies): Don't call + nonzero_bits if not needed. + (nonzero_bits) [XOR]: Likewise. + (nonzero_bits) [REG]: Use reg_last_set_nonzero_bits even if + reg_last_set_mode and mode are both MODE_INT, but not equal. + (record_value_for_reg): Compute reg_last_set_nonzero_bits + in nonzero_bits_mode for MODE_INT modes. + +2002-03-28 Richard Henderson + + PR target/5715 + * config/alpha/osf.h (ASM_SPEC): Don't pass any special options + to GAS. Correct drift between alternatives. + +2002-03-28 Richard Henderson + + PR target/6087 + * reload1.c (fixup_abnormal_edges): Move insn to edge via sequence. + +2002-03-28 Alexandre Oliva + + * config/i386/freebsd.h (LINK_SPEC): Don't pass default + emulation to the linker. + +2002-03-28 Loren J. Rittle + + * config/alpha/freebsd.h (LINK_SPEC): Likewise. + * config/sparc/freebsd.h (LINK_SPEC): Likewise. + +Thu Mar 28 16:35:31 2002 Jeffrey A Law (law@redhat.com) + + * combine.c (simplify_and_const_int): Make sure to apply mask + when force_to_mode returns a constant integer. PR3311. + +2002-03-28 John David Anglin + + * pa-linux.h (LOCAL_LABEL_PREFIX): Define. + +2002-03-28 Gerald Pfeifer + + * doc/invoke.texi (Warning Options): Refer to C++ Dialect Options + and Objective-C Dialect Options. + +2002-03-28 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_conditional_branch): TFmode NE + comparison should be done vs !=0 not >0 return code. Tidy cases. + +2002-03-28 Richard Henderson + + * c-decl.c (finish_function): New arg can_defer_p. Pass it + on to c_expand_body. + * c-tree.h (finish_function): Update decl. + * c-objc-common.c, c-parse.in, objc/objc-act.c: Update calls. + +Thu Mar 28 19:13:36 CET 2002 Jan Hubicka + + * ifcvt.c (if_convert): Clear aux_for_blocks early enough. + +Thu Mar 28 13:21:53 CET 2002 Jan Hubicka + + * rtlanal.c: Include flags.h + (may_trap_p): Do not mark FP operations if trapping + if !flag_trapping_math + * Makefile.in (rtlanal.o): Add dependency on flag.h + * ifcvt.c (noce_operand_ok): Avoid the lameness. + +2002-03-27 Zack Weinberg + + * mips.md: Use dconst1, not 1.0, as first argument of + REAL_VALUE_LDEXP. Don't use union real_extract. + +2002-03-28 Alan Modra + + * configure.in (gcc_cv_as): Use $target_alias in directory searchs + rather than $target. Heed program_prefix and + program_transform_name. Search for gas in cross-compiler case too. + "test -x" rather than "test -f". + (gcc_cv_ld): Likewise. + (gcc_cv_nm): Heed program_prefix and program_transform_name. + (gcc_cv_objdump): Likewise. + * configure: Regenerate. + +2002-03-27 Neil Booth + + * Makefile.in (attribs.o): Update. + * attribs.c: Include langhooks.h. + (decl_attributes): Use langhook. + * c-decl.c (insert_default_attributes): Rename. + * c-tree.h (c_insert_default_attributes): New. + * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES):New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New hook. + * tree.h (insert_default_attributes): Remove. +objc: + * objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine. + +2002-03-27 Andreas Schwab + + * config/i386/i386.c (classify_argument): Also check for + QUAL_UNION_TYPE. + +2002-03-27 Rainer Orth + + * doc/install.texi (alpha*-dec-osf*): Don't need --enable-libgcj + any more. + +Wed Mar 27 23:19:30 CET 2002 Jan Hubicka + + * i960.md (ret): Set PC. + (nonlocal_goto): Fix expander. + * builtins.c (epxand_builin_longjmp): Check that we've emitted + some jump or call. + +Wed Mar 27 23:11:35 CET 2002 Jan Hubicka + + * optabs.c (emit_no_conflict_block, emit_libcall_block): Avoid nesting + of libcall regions. + +Wed Mar 27 22:54:14 CET 2002 Zdenek Dvorak + + * cfgrtl.c (merge_blocks_nomove): Use set_block_for_insn instead of + assigning to BLOCK_FOR_INSN directly. + +Wed Mar 27 22:33:05 CET 2002 Jan Hubicka + + * i386.c (ix86_output_addr_diff_elt): Remove binutils bug workaround. + +2002-03-27 Neil Booth + + * c-common.c (c_expand_expr): Fix prototype. + * c-common.h (c_expand_expr): Always declare, update. + * c-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. + * c-objc-common.c (c_objc_common_init): No global hook. + * expr.c (expand_expr): Use langhook. + * expr.h (enum expand_modifier): Conditionally declare. + * langhooks-def.h (lhd_expand_expr, LANG_HOOKS_EXPAND_EXPR): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_expand_expr): New. + * langhooks.h (struct lang_hooks): New hook. + * toplev.c (lang_expand_expr_t, lang_expand_expr): Delete. + (lang_independent_init): Don't default hook. +objc: + * objc-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. + +2002-03-27 Richard Henderson + + PR target/6054 + * config/ia64/ia64.c (ia64_expand_call): Use pic patterns for + TARGET_CONST_GP. Simplify conditions. + +2002-03-27 Richard Henderson + + * config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/netbsd-elf.h, config/sparc/pbd.h, config/sparc/sol2.h, + config/sparc/vxsim.h (LOCAL_LABEL_PREFIX): Define. + +2002-03-27 Danny Smith + + * config/i386/cygwin.h (TARGET_DLL, TARGET_WIN32, + TARGET_CYGWIN, TARGET_WINDOWS): Remove unused switches. + (MASK_DLL, MASK_WIN32, MASK_CYGWIN, MASK_WINDOWS): + Remove unnecessary masks. + (MASK_NOP_FUN_DLLIMPORT): Use an unused an bit. + (SUBTARGET_SWITCHES): Use empty masks for -mwin32, -mcygwin, + -mwindows, -mdll switches and their negations. + +2002-03-27 Neil Booth + + * gcc-common.c (lang_mark_false_label_stack): Remove. + * ggc.h (lang_mark_false_label_stack): Similarly. + +2002-03-26 Vladimir Makarov + + * pa/pa-pro-end.h (CPP_PREDEFINES): Add -D__pro__. + + * pa/lib2funcs.asm: Don't use .SPACE and .SUBSPACE if __pro__ + or __rtems_ is defined. + +2002-03-26 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_set_const): Add a REG_EQUAL note + if a non-trivial load was emitted. + (alpha_emit_set_const_1): Remove obsolete extension. Fix thinko + in high+extra+low case. + +2002-03-26 Richard Henderson + + * config.gcc (sparc*-solaris): Use float_format=sparc. + +2002-03-26 Richard Henderson + + * config/sparc/sparc.h (MAX_WCHAR_TYPE_SIZE): Don't define. + * config/sparc/linux-aout.h (MAX_WCHAR_TYPE_SIZE): Don't undef. + * config/sparc/linux.h, config/sparc/linux64.h: Likewise. + * config/sparc/sol2.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Redefine. + (WINT_TYPE_SIZE): Fix at 32. + +2002-03-26 Richard Henderson + + * toplev.c (rest_of_compilation): Delay emit_initial_value_sets + until after eh landing pad generation. + * config/alpha/alpha.c (alpha_gp_save_rtx): Use gen_mem_addressof. + * config/alpha/alpha.md (exception_receiver_2): Only accept MEMs. + +2002-03-26 Richard Henderson + + * expr.h (ADD_PARM_SIZE): One more convert for INC. + +2002-03-26 Phil Edwards + + * gcc.c (cpp_options): Preserve relative ordering of -pedantic + and warning switches. + (cc1_options): Likewise. + +2002-03-26 Hans Boehm + + * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR): + Restore more of the signal context. Set no_reg_stack_frame. + * config/ia64/unwind-ia64.c (unw_state_record): + Add no_reg_stack_frame, comments. + (uw_frame_state_for): Initialize when field to UNW_WHEN_NEVER. + (uw_update_context): Adjust bsp when unwinding from leaf, + but not signal frame. + +2002-03-26 David Edelsohn + + * config/rs6000/aix51.h (WCHAR_TYPE): Define. + +2002-03-26 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_va_arg): Handle variable-sized types. + +2002-03-26 Richard Earnshaw + + PR target/5621 + * arm.md (define_asm_attributes): Reapply patch of Thu Sep 9, 1999: + "Add a pool_range attribute", which was lost during the ARM/Thumb + merge. + +2002-03-26 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_valid_move): Allow move from + a register into the MAC16 accumulator. + +2002-03-26 Andrew Cagney + + * doc/invoke.texi (Option Summary): Mention -Wswitch-enum. + (Warning Options): Document -Wswitch-enum. + * toplev.c (W_options): Add -Wswitch-enum. Update comment on + -Wswitch. + (warn_switch_enum): Define variables. + * flags.h (warn_switch_enum): Declare variables. + * stmt.c (expand_end_case_type): When warn_switch_enum / + -Wswitch-enum, perform switch checks. + Fix PR c/5044. + +2002-03-26 Richard Earnshaw + + * arm.md (reload_mulsi3, reload_mulsi_compare0, reload_muladdsi) + (reload_mulsi_compare0_scratch, reload_muladdsi_compare0) + (reload_muladdsi_compare0_scratch): Delete. + +2002-03-26 Loren J. Rittle + + * doc/install.texi (*-*-freebsd*): Update. + +2002-03-26 Richard Henderson + + * expr.h (ADD_PARM_SIZE): Cast INC to ssizetype. + (SUB_PARM_SIZE): Cast DEC to ssizetype. + + * config/alpha/alpha.c (alpha_va_arg): Read MUST_PASS_IN_STACK + types from the normal argument frame. + + * config/sparc/sparc.c (function_arg_pass_by_reference): Pass + variable sized objects by reference. + (sparc_va_arg): Receive them by reference too. + +2002-03-26 Hartmut Penner + + * config/s390/s390.c (s390_emit_epilogue): Change epilogue + code to not restoring global registers. + +2002-03-26 Neil Booth + + * Makefile.in (ggc-common.o): Update. + * c-decl.c (lang_mark_tree): Rename c_mark_tree. + * c-lang.c (LANG_HOOKS_MARK_TREE): Redefine. + * c-tree.h (c_mark_tree): New. + * ggc-common.c: Include langhooks.h. + (gcc_mark_trees): Use new langhook. + * ggc-callbacks.c: Delete file. + * ggc.h (lang_mark_tree): Remove. + * langhooks-def.h (LANG_HOOKS_MARK_TREE): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New hook. +objc: + * objc-lang.c (LANG_HOOKS_MARK_TREE): Redefine. + +2002-03-25 Zack Weinberg + + * doc/cpp.texi: Exclude entire Top node from printed manual. + Move option index after directive index. Insert page breaks + before GFDL and concept index. Index environment variables + with command line options. + * doc/cppenv.texi: Use @vtable for environment variable list. + Add paragraph explaining semantics of empty elements in path + variables. Exclude a cross-reference to Fishkill from the + manpage. Remove an unnecessary cross-reference of the entry + right above the referer. Don't use @anchor in text that goes + into manpage. + * doc/cppopts.texi: Cross-reference the environment variables + section, not the specific environment variable, for consistency. + +2002-03-25 Richard Henderson + + * recog.c (peephole2_optimize): Distribute EH_REGION -1 notes + anywhere in the block. Don't refer to insns that have been + removed from the chain. Iterate backward through the new insns. + Don't refer to edges that have been removed. + +2002-03-26 Alan Modra + + * combine.c (simplify_comparison ): Correct + test for overflow of constant. + +2002-03-25 Richard Earnshaw + + PR target/2623 + * arm.md (loadhi_preinc, loadhi_predec, loadhi_shiftpreinc) + (loadhi_shiftpredec, loadhi-with-writeback peephole): Don't use + these patterns on arm_archv4. + +2002-03-25 Danny Smith + + * config/i386/mingw32.h (WINT_TYPE): Define as "short unsigned + int". + +2002-03-25 Zack Weinberg + + * toplev.c: Don't include setjmp.h. Kill float_handler_set, + float_handled, float_handler, float_signal, set_float_handler, + and do_float_handler. Set handler for SIGFPE to crash_signal. + * toplev.h: Don't prototype do_float_handler. + + * c-lex.c: Fold parse_float into lex_number. Make warning + about portability of hex float constants more informative, and + don't issue it on top of a syntax error. + * fold-const.c: Fold const_binop_1 and fold_convert_1 into + their callers. + * real.h: Define REAL_VALUE_ABS here... + * simplify-rtx.c: ... not here. Fold check_fold_consts, + simplify_unary_real, simplify_binary_real, and + simplify_binary_is2orm1 into their callers. + * tree.c: Fold build_real_from_int_cst_1 into caller. + + * doc/tm.texi: Document REAL_VALUE_ABS and REAL_VALUE_NEGATIVE. + + * tsystem.h: Include float.h here... + * libgcc2.c: ... not here. + +2002-03-25 Nick Clifton + + Fixes for: PR bootstrap/3591, target/5676 + * config/mcore/mcore.h (CC1_SPEC): Define only if not already + defined. Do not disable exceptions or rtti. + * config/mcore/mcore-pe.h (CC1_SPEC): Define before including + mcore.h. Disable exceptions and rtti, since they are not + supported by EPOC. + +2002-03-25 Neil Booth + + * c-decl.c (maybe_build_cleanup): Remove. + * expr.c (expand_expr): Use langhook. + * langhooks-def.h (lhd_return_null_tree, + LANG_HOOKS_MAYBE_BUILD_CLEANUP): New. + (LANGHOOKS_INITIALIZER): Update. + * langhooks.c (lhd_return_null_tree): New. + * langhooks.h (struct lang_hooks): New hook. + * tree-inline.c (initialize_inlined_parameters): Use langhook. + * tree.h (maybe_build_cleanup): Remove. + +2002-03-25 Jakub Jelinek + + * regrename.c (build_def_use): Move recog_memoized + before extract_insn. + +2002-03-25 Jakub Jelinek + + PR target/6043 + * expr.c (emit_group_store): Handle storing into CONCAT. + +2002-03-25 Jakub Jelinek + + * regrename.c (build_def_use): Share RTL between MATCH_OPERATOR and + corresponding MATCH_DUP. + +2002-03-24 Richard Henderson + + * unroll.c (unroll_loop): Zero label_map. + + * gcse.c: Include except.h. + * Makefile.in (gcse.o): Update. + +2002-03-24 Richard Henderson + + * varasm.c (asm_emit_uninitialised): Revert 2002-03-14 change. + Do resolve_unique_section before shared data clause. + +2002-03-24 Richard Henderson + + * config/alpha/elf.h (STARTFILE_SPEC): Use crtbeginT with -static. + +2002-03-24 Richard Henderson + + * recog.c (peephole2_optimize): Split blocks when EH insns are + generated in the middle of a block. Do global life update if + zapped EH edges. + +2002-03-24 Richard Henderson + + * mips.c (mips_function_value): Only promote_mode for non-libcalls. + +2002-03-24 Neil Booth + + preprocessor/3951 + * gcc.c (cpp_options): Pass -MD through as -MD not -M -MF. + * cppinit.c (cpp_handle_option): Set no_ouput if -MD or -MMD. + (init_dependency_output): Don't make no_output decision here. + +2002-03-24 Andrew Cagney + + * stmt.c (check_for_full_enumeration_handling): Remove tests of + warn_switch. Update description. + (expand_end_case_type): Call check_for_full_enumeration_handling + when warn_switch. + +2002-03-24 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_autoinc_compatible_p): New function. + (m68hc11_split_move): Call it to see if the source and destination + operands use the same direction auto inc/dec mode, otherwise make the + source an offsetable memory operand and generate an add. + +2002-03-24 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*subsi3_zero_extendhi"): Allow address + register for operand 2. + ("*subsi3_zero_extendqi"): Likewise. + ("*iorhi3_gen"): Do the operation on the upper bits and then lower + bits so that it is compatible with a pop. + ("*andhi3_gen"): Likewise. + ("xorhi3"): Likewise. + +2002-03-24 Neil Booth + + * cppinit.c (cpp_handle_option): Set warn_endif_labels if + -pedantic here... + (cpp_post_options): ... not here. + +2002-03-24 Neil Booth + Aldy Hernandez + + Removal of separate preprocessor cpp0. + + * Makefile.in (GCC_PASSES, STAGESTUFF, LIBCPP_OBJS, + cpp0, install-common): Update. + * c-common.c (flag_preprocess_only): New. + (c_common_init): Preprocess for -E. + * c-common.h (flag_preprocess_only): New. + * c-decl.c (c_decode_option): Handle -E and -std=c++98. + * c-objc-common.c (c_init_decl_processing): Exit quickly + for NULL return from c_common_init. + * cpplib.h (cpp_preprocess_file): New. + * cppmain.c (main, general_init, pfile, progname): Remove. + (do_preprocessing): Rename cpp_preprocess_file, don't call + cpp_finish. Don't close stdout here. + (setup_callbacks): Update prototype. + * gcc.c (trad_capable_cpp, cpp_unique_options, default_compilers): + Update. + * tradcpp.c (main): Ignore -quiet. +objc: + * lang-specs.h (default_compilers): Preprocess with cc1obj. + +2002-03-24 Richard Henderson + + PR optimization/5742 + * machmode.def: Add inner mode field to complex modes. + * config/mips/mips.c (mips_function_value): Always define. Add + new argument to handle libcalls. + * config/mips/mips.h (LIBCALL_VALUE): Use mips_function_value. + (FUNCTION_VALUE): Likewise. + * config/mips/abi64.h (FUNCTION_VALUE): Remove. + * config/mips/mips-protos.h: Update. + +2002-03-23 Richard Henderson + + * config/sparc/sparc.c (sparc_emit_floatunsdi): New. + * config/sparc/sparc-protos.h: Update. + * config/sparc/sparc.md (floatunsdisf2, floatunsdidf2): New. + +2002-03-23 Richard Henderson + + * config/sparc/gmon-sol2.c (internal_mcount): Assume either + _start or _init begins the text segment. + +2002-03-23 David Edelsohn + + * config/rs6000/rs6000.h (RETURN_IN_MEMORY): Cast to HOST_WIDE_INT + not HOST_WIDEST_INT. + (RS6000_ARG_SIZE): Remove unsigned cast of int_size_in_bytes. + +2002-03-23 Richard Earnshaw + + PR java/5489 + * arm.md (return, sibcall_epilogue): Pass const_true_rtx as the + operand argument to output_return_instruction. + * arm.c (arm_print_operand, case 'd'): If the operand is + const_true_rtx then just return. + (arm_print_operand, case 'D'): If the operand is const_true_rtx + then abort. + +2002-03-23 Andrew Cagney + + * doc/invoke.texi (Option Summary): Mention -Wswitch-default. + (Warning Options): Document -Wswitch-default. + * toplev.c (W_options): Add -Wswitch-default. Update comment on + -Wswitch. + (warn_switch_default): Define variable. + (warn_switch): Update comment. + * flags.h (warn_switch_default): Declare variable. + (warn_switch): Update comment. + * stmt.c (expand_end_case): Check for and, when + warn_switch_no_default, warn of a missing default case. + +2002-03-23 Alan Modra + + * real.h (N): Special case 128 bit doubles. + + * combine.c (simplify_comparison): When widening modes, ignore + sign extension on CONST_INTs. + +2002-03-22 Bob Wilson + + * config/xtensa/xtensa.c (print_operand): Fix incorrect mode + passed to adjust_address. Fix comment formatting. + + +2002-03-22 Zack Weinberg + + * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. + Always make REAL_VALUE_TYPE a struct containing an array of + HOST_WIDE_INT, not a double. Tidy up the code deciding how + big it is. Don't declare or use union real_extract. + + * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, + decode_rtx_const, output_constant_pool), config/a29k/a29k.c + (print_operand), config/arm/arm.c (output_move_double), + config/arm/arm.md (consttable_4, consttable_8), + config/romp/romp.c (output_fpops), config/s390/s390.h + (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c + (xtensa_output_literal): Don't use union real_extract. + + * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c + (sfmode_constant_to_ulong), config/ns32k/merlin.h + (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), + config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h + (PRINT_OPERAND): Don't use local version of union + real_extract. + + * config/convex/convex.c (check_float_value), config/vax/vax.c + (vax_float_literal), config/m88k/m88k.md (divdf3), + config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), + config/pdp11/pdp11.c (output_move_quad): Don't do host + arithmetic on target floating point quantities. + + * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c + (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. + + * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): + Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. + + * real.c (earith): Test INFINITY rather than REAL_INFINITY; + NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef + INFINITY. + * print-rtl.c (print_rtx): Disable code which needs + floating-point emulator. + * libgcc2.c: Include float.h and use DBL_MANT_DIG, + FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than + depending on HOST_FLOAT_FORMAT to be defined properly. + + * config/1750a/1750a.c (get_double, float_label): Delete. + (print_operand): Delete huge commented-out chunk. Use + REAL_VALUE_TO_DECIMAL. + * config/1750a/1750a-protos.h: Delete prototypes of deleted + functions. + * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to + IEEE_FLOAT_FORMAT. + * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): + Use REAL_VALUE_TO_DECIMAL as ELF version does. + * config/m88k/m88k.c (real_power_of_2_operand, + legitimize_operand): Take the REAL_VALUE_TYPE and/or union + real_extract out of the union; run the input through + REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords + from that into the union. + * config/pdp11/pdp11.c (output_move_double): Rearrange + parentheses to make automatic indenter happy. + + * doc/tm.texi (Cross-compilation): Rename node to "Floating + Point" and rewrite to describe current situation. Also adjust + documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to + match code. + * doc/rtl.texi: Adjust cross reference. + +2002-03-22 Bob Wilson + + * config/xtensa/xtensa-protos.h (non_acc_reg_operand): Remove. + (xtensa_valid_move, xtensa_preferred_reload_class): Define. + * config/xtensa/xtensa.c (non_acc_reg_operand): Remove. + (xtensa_valid_move, xtensa_preferred_reload_class): Define to + prevent use of sp as a reload register. + (xtensa_emit_move_sequence): Use xtensa_valid_move instead of + non_acc_reg_operand. + * config/xtensa/xtensa.h (PREDICATE_CODES): Remove non_acc_reg_operand. + (PREFERRED_RELOAD_CLASS): Move code to xtensa_preferred_reload_class. + * config/xtensa/xtensa.md (movsi_internal, movhi_internal, + movqi_internal): Use xtensa_valid_move instead of non_acc_reg_operand. + +2002-03-22 Neil Booth + + * cpphash.h (struct cpp_reader): Remove mls_line and mls_col. + * cpplex.c (unterminated): Delete. + (parse_string): No string literal may extend over multiple + lines. Suppress the error when preprocessing assembly. + * cppmain.c (scan_translation_unit): Strings are single-line. + + * doc/cpp.texi: Update to match. + +2002-03-22 Jakub Jelinek + + PR optimization/5854 + * config/m68hc11/m68hc11.h (CONST_OK_FOR_LETTER_VALUE_P): Use K for 0. + Shut up warnings. + (CONST_DOUBLE_OK_FOR_LETTER_P): Use G for 0.0. + (EXTRA_CONSTRAINT): Use S for non-push memory operand. + * config/m68hc11/m68hc11.c (m68hc11_split_move): Handle setting from + const0 if scratch register was not allocated. + (m68hc11_reload_operands, m68hc11_gen_lowpart, m68hc11_gen_highpart, + m68hc11_z_replacement): Replace gen_rtx (CONST_INT, VOIDmode, ...) + with GEN_INT (...). + (m68hc11_reorg): Compute BLOCK_FOR_INSN before reload_cse_regs. + * config/m68hc11/m68hc11.md: Replace gen_rtx (CONST_INT, VOIDmode, ...) + with GEN_INT (...) everywhere. Remove constraints in define_split + patterns. + (movdi_internal, movdf_internal, movsi_internal, movsf_internal): Don't + require scratch register for setting 0 into regs/non-pushable memory. + +2002-03-22 Alexandre Oliva + + * config/mips/mips.h (MASK_RETURN_ADDR): Define. + (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define. + +2002-03-22 Phil Edwards + + * cpplib.h (struct cpp_options): New member, warn_endif_labels. + * cppinit.c (cpp_create_reader): On by default. + (cpp_handle_option): Handle -W[no-]endif-labels. + (cpp_post_options): Also enable if -pedantic. + * cpplib.c (do_else): Use it. + (do_endif): Likewise. + * doc/cppopts.texi: Document new option. + * doc/invoke.texi: Document new option. + +2002-03-22 Lars Brinkhoff + + * config/i386/i386.c, config/i386/i386.md: Change all occurences + of GEN_INT (trunc_int_for_mode (...)) to gen_int_mode (...). + +2002-03-22 Alexandre Oliva + + * flow.c (calculate_global_regs_live): Clear aux fields of + ENTRY and EXIT. + +2002-03-22 Jakub Jelinek + + * config/v850/v850.c (v850_reorg): Only call alter_subreg on + REG or MEM subregs, pass rtx * instead of rtx to it. + * config/i860/i860.c (output_delayed_branch, output_delay_insn): Pass + rtx * instead of rtx to alter_subreg. + * config/m32r/m32r.c (gen_split_move_double): Likewise. + * config/pj/pj.c (pj_output_rval): Likewise. + +2002-03-22 Richard Henderson + + PR target/3177 + * config/ia64/ia64.h (CUMULATIVE_ARGS): Add int_regs. + (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Update. + * config/ia64/ia64.c (ia64_function_arg_advance): Set int_regs. + (ia64_expand_prologue): Look at int_regs, not words, for number + of incomming int regs. + +2002-03-22 Andrew MacLeod + + * expr.c (expand_expr): A RESULT_DECL is part of a call. + +Fri Mar 22 16:30:42 CET 2002 Jan Hubicka + + * toplev.c (flag_loop_optimize, flag_crossjumping): + New static variables. + (rest_of_compilation): Conditionalize crossjumping and + loop optimizer. + (parse_options_and_default_flags): Default loop_optimize and + crossjumping. + (lang_independent_options): Add -fcrossjumping and -floop-optimize + * invoke.texi (crossjumping, loop-optimize): Document. + +2002-03-22 Richard Sandiford + + * real.c (eiisneg): Move outside #ifdef NANS. + +Fri Mar 22 12:08:36 CET 2002 Jan Hubicka + + * cfgcleanup.c (outgoing_edges_math): Fix condition; relax + frequencies match; avoid match on different loop depths. + (try_crossjump_to_bb): Kill tests that no longer brings time + savings. + * cfgrtl.c (force_nonfallthru_and_redirect): Fix loop_depth + updating code. + (split_edge): Likewise. + + * flow.c (update_life_info_in_dirty_blocks): Fix uninitialized + variable. + + * Makefile.in (cfgrtl): Add insn-config.h depenendency. + * cfgrtl.c: Include insn-config.h + (split_block) Dirtify block in presence of conditional execution + +2002-03-22 Richard Sandiford + + * config/mips/abi64.h (SETUP_INCOMING_VARARGS): Undefine. + * config/mips/mips-protos.h (mips_setup_incoming_varargs): Declare. + (function_arg): Constify CUMULATIVE_ARGS. + (function_arg_partial_nregs, function_arg_pass_by_reference): Likewise. + * config/mips/mips.h (UNITS_PER_FPVALUE): Zero when TARGET_SOFT_FLOAT. + (UNITS_PER_DOUBLE): New macro. + (SETUP_INCOMING_VARARGS): Define. Use mips_setup_incoming_varargs. + (CUMULATIVE_ARGS): Reformat. Remove num_adjusts workaround and + last_arg_fp field. Replace arg_words and fp_arg_words with gp_regs, + fp_regs and stack_words. + (EABI_FLOAT_VARARGS_P): New macro. + * config/mips/mips.c (struct mips_arg_info): New. + (mips_arg_info): New function. + (function_arg_advance): Use it. Add adjustment instructions here + rather than in function_arg. + (function_arg): Constify CUMULATIVE_ARGS. Use mips_arg_info. Check + for VOIDmode at the beginning of the function. + (function_partial_nregs): Constify CUMULATIVE_ARGS. Use mips_arg_info. + (function_arg_pass_by_reference): Likewise. + (mips_setup_incoming_varags): New, largely based on old abi64.h code. + (mips_build_va_list): Test EABI_FLOAT_VARARGS_P. + (mips_va_start): Likewise. Use the new stack_words field of + CUMULATIVE_ARGS to set up overflow area. Reformat. + (mips_va_arg): Test EABI_FLOAT_VARARGS_P. Unify EABI handling of + doubles and other types, aligning the overflow pointer for non-doubles + too. Remove some code duplication. Replace hard-coded constants. + +2002-03-22 Richard Sandiford + + * config/mips/mips.h (FUNCTION_ARG_REGNO_P): Simplify. + (CLASS_UNITS): Undefine. + (CLASS_MAX_NREGS): Use FP_INC. + * config/mips/mips.c (compute_frame_size): Likewise. + (override_options): Use FP_INC and UNITS_PER_FPVALUE. + +2002-03-22 Neil Booth + + * cpplex.c (parse_identifier_slow): Rename parse_slow, adjust + prototype, and handle lexing numbers and identifiers. + (parse_identifier): Update to new form of parse_slow. + (parse_number): Fast path only, use parse_slow otherwise. + (_cpp_lex_direct): Update calls to parse_number. + +2002-03-21 DJ Delorie + + * bb-reorder.c (make_reorder_chain_1): Protect against + when redundant edges are omitted. + * predict.c (dump_prediction): Likewise. + +2002-03-21 Richard Henderson + + PR target/5996 + * fixinc/inclhack.def (solaris_stdio_tag): New. + * fixinc/fixincl.x: Regenerate. + +2002-03-21 Eric Botcazou + + PR c/5597 + * c-typeck.c (process_init_element): Flag non-static + initialization of a flexible array member as illegal. + +2002-03-22 Alan Modra + + * config/rs6000/t-linux64: New. + * config.gcc (powerpc64-*-linux* ): Drop t-ppcos and + t-ppccomm. Use t-rs6000 and t-linux64. + (powerpc64-*-gnu* ): Likewise. + * mklibgcc.in (SHLIB_MKMAP_OPTS): New variable. + * mkmap-symver.awk (dotsyms): If set, output .foo as well as foo. + * Makefile.in (SHLIB_MKMAP_OPTS): Pass to mklibgcc. + +2002-03-21 Aldy Hernandez + + * langhooks.c (lhd_tree_inlining_cannot_inline_tree_fn): Check + flag_really_no_inline instead of optimize == 0. + + * c-objc-common.c (c_cannot_inline_tree_fn): Same. + + * cp/tree.c (cp_cannot_inline_tree_fn): Same. + + * flags.h (flag_really_no_inline): New. + + * c-common.c (c_common_post_options): Initialize + flag_really_no_inline. + + * toplev.c (flag_really_no_inline): New. + +2002-03-21 Jakub Jelinek + + * config/avr/avr.md (length): Fix length computation for + conditional branches. + +2002-03-21 Neil Booth + + * Makefile.in (fold-const.o, stor-layout.o, stmt.o, + sdbout.o, profile.o): Update. + * c-common.c (c_common_nodes_and_builtins): Use pushdecl + langhook. + * c-common.h (gettags): Move here from tree.h. + * c-tree.h (pushdecl, pushlevel, poplevel, set_block, + insert_block, getdecls, kept_level_p, global_bindings_p): New. + * dbxout.c (dbxout_init): Use getdecls langhook. + * expr.c (expand_expr): Use insert_block langhook. + * fold-const.c: Include langhooks.h. + (fold_range_test, fold_binary_op_with_conditional_arg, + fold): Use global_bindings_p langhook. + * integrate.c (expand_inline_function): Use insert_block langhook. + * langhooks-def.h (LANG_HOOKS_DECLS, LANG_HOOKS_PUSHLEVEL, + LANG_HOOKS_POPLEVEL, LANG_HOOKS_GLOBAL_BINDINGS_P, + LANG_HOOKS_INSERT_BLOCK, LANG_HOOKS_SET_BLOCK, LANG_HOOKS_PUSHDECL, + LANG_HOOKS_GETDECLS): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_clear_binding_stack): Use global_bindings_p + langhook. + * langhooks.h (struct lang_hooks_for_decls): New. + (struct lang_hooks): Update. + * profile.c: Include langhooks.h. + (output_func_start_profiler): Use new langhooks. + * sdbout.c: Include langhooks.h. + (sdbout_init, sdbout_finish): Use getdecls langhook. + * stmt.c: Include langhooks.h. + (expand_fixup, fixup_gotos): Use new langhooks. + * stor-layout.c: Include langhooks.h. + (variable_size): Use global_bindings_p langhook. + * toplev.c (compile_file): Use getdecls langhook. + * tree-inline.c (remap_block): Use insert_block langhook. + * tree.h (pushdecl, pushlevel, poplevel, set_block, gettags, + insert_block, getdecls, kept_level_p, global_bindings_p): Remove. + +2002-03-21 Richard Henderson + + * config/rs6000/rs6000.c (rs6000_select_rtx_section): Put symbolic + constants in .data when -fpic. + +2002-03-21 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Use GNU/Linux instead of Linux + where appropriate. + +2002-03-21 Tom Tromey + + * config/i386/sol2.h (ASM_QUAD): Undef. Fixes PR bootstrap/5948. + +Thu Mar 21 09:50:48 2002 Richard Kenner + + * config/ia64/ia64.c (hfa_element_mode, case ARRAY_TYPE): Recurse. + + * expr.c (emit_group_store): Don't copy const0_rtx to a CONCAT. + +2002-03-21 Eric Botcazou + Richard Henderson + + PR c/5354 + * c-common.c (c_expand_expr): Preserve result of a statement + expression if needed. + +2002-03-21 Jakub Jelinek + + PR bootstrap/4195 + * genrecog.c (maybe_both_true_mode): Remove. + (maybe_both_true_2, write_switch): Revert 2001-07-17 changes. + * machmode.def (Pmode): Likewise. + +Thu Mar 21 01:55:06 EST 2002 John Wehle (john@feith.com) + + * alias.c: (nonlocal_mentioned_p): Use for_each_rtx. + (nonlocal_mentioned_p_1): New function. + (nonlocal_referenced_p, nonlocal_referenced_p_1): Likewise. + (nonlocal_set_p, nonlocal_set_p_1): Likewise. + (mark_constant_function): Recognize pure functions. + * rtl.h (global_reg_mentioned_p): New prototype. + * rtlanal.c (global_reg_mentioned_p, + global_reg_mentioned_p_1): New function. + +2002-03-21 Rainer Orth + + * fixinc/inclhack.def (alpha_assert): Fix assert macro in Tru64 + UNIX assert.h. + * fixinc/fixincl.x: Regenerate. + +2002-03-20 Jason Merrill + + * config/i386/cygwin.h (DWARF2_UNWIND_INFO): Define to 0. + +2002-03-20 Michael Meissner + + * doc/invoke.texi (Optimize Options): Document that -O2 sets + -fstrict-aliasing. + +2002-03-20 Bob Wilson + + * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Emit a + ".literal_position" directive before the constant pool. + +2002-03-20 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Update Geoffrey Keating. + Add Craig Rodrigues. + Add Brad Lucier to testers. + +2002-03-20 Jakub Jelinek + + PR target/4792 + * config/arc/arc.md (movsicc, movdicc, movsfcc, movdfcc): Add mode + to if_then_else. + (movsicc_insn, movdicc_insn, movsfcc_insn, movdfcc_insn): Likewise. + * config/arc/arc.c (arc_final_prescan_insn): Use extract_insn_cached + instead of insn_extract. + +2002-03-20 Jakub Jelinek + + PR bootstrap/4192 + * config/fr30/fr30.md (jump): Remove clobber of fixed register. + + * genemit.c (output_added_clobbers_hard_reg_p): Only output return + stmt if some case has been output. + +2002-03-20 Jakub Jelinek + + PR c/5972 + * config/i386/i386.md (movdicc_c_rex64, movsicc_noc, movhicc_noc, + movsfcc_1, movdfcc_1): Add %O2. + * config/i386/i386.c (print_operand): Handle %ON. + Print . before float condition codes in Sun as cmov syntax. + * config/i386/sol2.h (CMOV_SUN_AS_SYNTAX): Define for Sun as. + * config.gcc (i[34567]86-*-solaris2*): Remove comment which is + no longer true. + +2002-03-20 Philip Blundell + + * config/arm/arm.c (arm_output_epilogue): Don't generate separate + return instruction if PC was popped. + +2002-03-20 Bob Wilson + + * config/xtensa/xtensa.md: Remove unused type attributes. + (adddi_carry, subddi_carry): Change type attribute to "multi". + +2002-03-19 Dale Johannesen + + PR optimization/5999, middle-end/5731 + * expr.c (expand_expr) [RDIV_EXPR]: Only convert real divisions into + multiplications by reciprocals. + +2002-03-20 Neil Booth + + * Makefile.in: Update. + * c-common.c: Include langhooks.h. + (inline_forbidden_p): Use new hook. + * diagnostic.c: Include langhooks.h. + (format_with_decl, announce_function, + default_print_error_function): Use new hook. + * dwarf2out.c (dwarf2_name): Use new hook. + * function.c: Include langhooks.h. + (init_function_start): Use new hook. + * langhooks-def.h (lhd_decl_printable_name): New. + (LANGHOOKS_DECL_PRINTABLE_NAME): New. + (LANGHOOKS_INITIALIZER): Update. + * langhooks.c (lhd_decl_printable_name): New. + * langhooks.h (struct lang_hooks): New hook. + * toplev.c (decl_name, decl_printable_name): Remove. + (open_dump_file): Use new hook. + (process_options): Remove old hook. + * tree.h (decl_printable_name): Remove. +objc: + * objc-act.c (objc_init): Remove old hook. + (objc_printable_name): Export. + * objc-act.h (objc_printable_name): New. + * objc-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine. + +2002-03-19 Jim Blandy + + * c-lex.c (cb_file_change): Pass the #inclusion's line number to + the start_source_file debug hook, not the current line number. + +2002-03-19 Richard Henderson + + * flow.c (EH_USES): Provide default. + (calculate_global_regs_live): Use it for EH edges and noreturn calls. + * doc/tm.texi (EH_USES): New. + + * config/ia64/ia64.c (ia64_eh_uses): New. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.h (EH_USES): New. + +2002-03-19 Richard Henderson + + * varasm.c (output_constant_def): Fix stupid typo. + +2002-03-19 Richard Henderson + + PR 5879 + * except.c (current_function_has_exception_handlers): New. + * except.h: Declare it. + * sibcall.c (optimize_sibling_and_tail_recursive_call): Use it. + Combine tests that disable all sibcalls for the function. + +2002-03-19 Olivier Hainque + + * varasm.c (output_constant_def): Don't call ENCODE_SECTION_INFO + for INTEGER_CST. + +2002-03-19 Richard Henderson + + PR 5977, 5991 + * config/ia64/ia64.c: Revert 2002-03-01 patch. + * config/ia64/ia64.h (INIT_EXPANDERS): New. + +2002-03-19 Jim Blandy + + * cppmacro.c (cpp_macro_definition): Emit a space after the macro + name, even if the replacement list contains no tokens, as required + by Dwarf. + +2002-03-19 Jason Merrill + + * varasm.c (globalize_decl): Get the name from the RTL, not + DECL_ASSEMBLER_NAME. + + * Makefile.in (LIBGCC2_DEBUG_CFLAGS): Set to -g. + +2002-03-19 Bob Wilson + + * config/xtensa/xtensa.md (adddi3, adddi_carry, subdi3, + subdi_carry): Define. + +2002-03-19 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Only warn + about -fpic/-fPIC if extra_warnings set. + +2002-03-19 David Edelsohn + + * expr.c (expand_expr): Sign-extend CONST_INT generated from + TREE_STRING_POINTER. + * fold-const.c (fold): Delete #if 0 ARRAY_REF case. + +Tue Mar 19 14:12:32 2002 Richard Kenner + + * config/sparc/sparc.h (CAN_ELMINIATE): Can only eliminate FP + in favor of SP if FRAME_POINTER_REQUIRED is false. + +2002-03-19 Lars Brinkhoff + + * emit-rtl.c (gen_int_mode): New function. + * rtl.h: Prototype for it. + * combine.c (make_extraction, simplify_comparison), expmed.c + (store_bit_field, expand_mult_highpart, expand_divmod), expr.c + (convert_modes, store_field), optabs.c (expand_fix), + simplify-rtx.c (neg_const_int, simplify_unary_real), + + * config/rs6000/rs6000.c, config/rs6000/rs6000.md: + Use it instead of GEN_INT (trunc_int_for_mode (...)). + +2002-03-19 Jakub Jelinek + + PR c/5656 + * langhooks.h (struct lang_hooks_for_tree_inlining): Add + convert_parm_for_inlining. + * c-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): + Define. + * langhooks-def.h: Likewise. + * objc/objc-lang.c: Likewise. + * langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): New + function. + * tree-inline.c (initialize_inlined_parameters): + Call convert_parm_for_inlining lang hook if needed. + * c-typeck.c (c_convert_parm_for_inlining): New function. + * c-tree.h (c_convert_parm_for_inlining): Add prototype. + +2002-03-18 Mark Mitchell + + * calls.c (precompute_arguments): Do not assume that temporaries + can be destroyed after expanding the argument. + (expand_call): Likewise. + +2002-03-15 Eric Christopher + + * config/mips/mips.md (movdf_internal2): Add two new move constraints. + Fix register preference on last change. + * config/mips/mips.c (mips_return_in_memory): New function. + * config/mips/mips.h (RETURN_IN_MEMORY): Use. + * config/mips/mips-protos.h: Declare. + * config/mips/abi64.h (RETURN_IN_MEMORY): Remove. Add to above. + * config/mips/elf64.h: Add #ifndef/#endif brackets around defaults. + +2002-03-18 Alexandre Oliva + + * config/mips/mips.md (andsi3) [TARGET_MIPS16]: Force operand 1 to + a register too. + (anddi3, iorsi3): Likewise. + + * config/mips/mips.h (ENCODE_SECTION_INFO) [TARGET_MIPS16]: Don't + use %gprel for symbols that are going to be placed in linkonce + sections. + + * config/mips/mips.h (ELIMINABLE_REGS): Can't eliminate + RETURN_ADDRESS_POINTER_REGNUM to $ra. + (CAN_ELIMINATE): Only eliminate it to $sp if a frame pointer is + not needed. Disregard leaf_function_p(). + (INITIAL_ELIMINATION_OFFSET): Adjust for elimination of rap to + mips16 frame pointer. + * config/mips/mips.md (store ra): Only to small SP offsets. + 2001-08-22 Graham Stott + * config/mips/mips.h (RETURN_ADDR_RTX): For a leaf function + return a REG rtx for the return address register. + +2002-03-18 Bob Wilson + + * config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat + constant-pool addresses as "mode-dependent". + (GO_IF_LEGITIMATE_ADDRESS): Rename macro arguments. + +2002-03-18 Jakub Jelinek + + PR target/5740 + * expr.c (emit_group_load): Use extract_bit_field if + needed for CONCAT arguments. + +2002-03-18 Richard Earnshaw + + PR target/4863 + * arm.md (tablejump): Make this a define_expand. For PIC add the + offset to the base of the table. + (thumb_tablejump): Matcher for Thumb tablejump insn. + * config/arm/aout.h (ASM_OUTPUT_ADDR_DIFF_ELT): Output thumb entries + as the difference of two labels. + * config/arm/aof.h (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + * config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Only put ARM jump + tables in the code. + * config/arm/coff.h (JUMP_TABLES_IN_TEXT_SECTION): Likewise. + * arm.c (get_jump_table_size): If the table is not in the text + section, return zero. + +2002-03-18 Bernd Schmidt + + * config/arm/arm.c (arm_gen_movstrqi): Use gen_lowpart instead + of gen_rtx_SUBREG. + (arm_reload_out_hi): Use gen_lowpart instead of + gen_rtx_SUBREG to access QImode components. + * config/arm/arm.md: Disable zero_extend split for QImode + subregs in BIG_ENDIAN mode. + (storehi_bigend): Match use of least significant byte. + (storeinthi): Remove extraneous SUBREG. + Add missing construction of operands[2]. + (movhi): Use gen_lowpart in place of gen_rtx_SUBREG. + (movqi): Use gen_lowpart in place of gen_rtx_SUBREG. + Replace gen_rtx (SUBREG) with gen_rtx_SUBREG. + +2002-03-18 Aldy Hernandez + + * config/rs6000/rs6000.h (PREDICATE_CODES): Add PARALLEL to + any_operand. + +2002-03-17 Richard Henderson + + * config/alpha/alpha.c (alpha_emit_set_const_1): Build add insns + explicitly. + +2002-03-17 Hans-Peter Nilsson + + * config/mmix/mmix.md ("fixuns_truncdfdi2"): Use (unsigned_fix:DI + (unsigned_fix:DF op1)), not (unsigned_fix:DI (fix:DF op1)). + +2002-03-17 Kaveh R. Ghazi + + * ifcvt.c (dead_or_predicable): Fix uninitialized variable. + + * predict.c (estimate_bb_frequencies): Delete unused variables. + +2002-03-17 Richard Henderson + + * config/ia64/ia64.c (ia64_attribute_table): Move before + targetm definition. Make static. + +2002-03-17 Neil Booth + + * c-common.h (yyparse, c_common_parse_file): New. + * c-lang.c: Include c-common.h. + (LANG_HOOKS_PARSE_FILE): Redefine. + * c-lex.c: Include c-common.h. + (yyparse): Rename c_common_parse_file. Call yyparse. + * c-parse.in (yyparse): Remove macro. + * c-tree.h (yyparse_1): Remove. + * langhooks-def.h (LANG_HOOKS_PARSE_FILE): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hoooks): New hook parse_file. + * toplev.c (compile_file): Use parse_file hook. + * tree.h (yyparse): Remove. + * objc/objc-lang.c (LANG_HOOKS_PARSE_FILE): Redefine. + +2002-03-17 Hans-Peter Nilsson + + * config/mmix/mmix.md ("truncdfsf2"): Correct operator is + float_truncate, not fix. + ("*truncdfsf2_real"): Ditto. + ("*nonlocal_goto_receiver_expanded"): Fix output template formatting. + + * config/mmix/mmix.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Don't define. + +2002-03-16 Alexandre Oliva + + * config/mips/mips.h (CAN_ELIMINATE): Don't eliminate rap to $fp + (s8), but rather HARD_FRAME_POINTER_REGNUM. Add parentheses + where appropriate. Make the second reference to + leaf_function_p a function call, as intended. Reindented. + + * config/mips/mips.h (ISA_HAS_COND_TRAP): Not available on MIPS16. + * config/mips/mips.md (trap) [TARGET_MIPS16]: Emit `break 0'. + + * config/mips/mips.md (addsi3, adddi3): Use scratch register to + add register to non-constant into sp. + + * config/mips/mips-protos.h (embedded_pic_fnaddr_reg): New. + * config/mips/mips.h (embedded_pic_fnaddr_rtx): Lose. + (mips16_gp_pseudo_rtx): Lose. + (INIT_EXPANDERS): Deleted. + * config/mips/mips.c (mips_init_machine_status): New. + (mips_free_machine_status): New. + (mips_mark_machine_status): New. + (override_options): Set them. + (embedded_pic_fnaddr_rtx, mips16_gp_pseudo_rtx): Moved to... + (struct machine_function): ... new. Replaced all references. + (mips_add_gc_roots): Don't mark them. + (embedded_pic_fnaddr_reg): New, extracted from... + (embedded_pic_offset): ... here. + * config/mips/mips.md (movdi): Call embedded_pic_fnaddr_reg. + (movsi): Likewise. + +2002-03-16 Neil Booth + + * cppinit.c: Revert -MD removal. + +2002-03-16 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_override_options): Don't use + soft registers by default for 68HC12. + (m68hc11_conditional_register_usage): Don't use Z register for 68HC12 + when compiling with -fomit-frame-pointer. + (expand_prologue): Use push/pop to allocate 4-bytes of locals on 68HC12. + (expand_epilogue): Likewise. + (m68hc11_gen_rotate): Use exg when rotating by 8. + +2002-03-16 Stephane Carrez + + * config/m68hc11/m68hc11-protos.h (ix_reg): Declare. + * config/m68hc11/m68hc11.md ("addsi3"): Use general_operand for sources. + (splits): Remove unused add splits. + ("*addhi3_68hc12"): Tune constraints. + ("addhi_sp"): Try to use X instead of Y in all cases and if the + constant fits in 8-bits and D is dead use abx/aby instructions. + ("*addhi3"): Remove extern declaration of ix_reg. + ("*subsi3"): Optimize and provide new split. + ("subhi3"): Cleanup. + ("*subhi3_sp"): Avoid saving X if we know it is dead. + (arith splits): For 68hc12 save the address register on the stack + and do the arithmetic operation with a pop. + +2002-03-16 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*movqi_68hc12"): Fix constraints, avoid + allocating QImode in address registers. + ("*movqi_m68hc11"): Likewise. + +Sat Mar 16 12:57:28 CET 2002 Jan HUbicka + + * cfgcleanup.c (cleanup_cfg): Fix updating of liveness. + +2002-03-16 Neil Booth + + * cppinit.c (print_help): Display -MD and -MMD. + Don't display usage string. Update assertion syntax and + typo. + (COMMAND_LINE_OPTIONS): Remove OPT_MD, OPT_MMD. + (cpp_handle_option): Update. + +2002-03-15 Chris Demetriou + + * config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): Provide an + MEABI case for each definition of SUBTARGET_CPP_SIZE_SPEC, + and define it so that regardless of target CPU size, + __SIZE_TYPE__ and __PTRDIFF_TYPE__ are defined in terms + of "int" rather than "long." + +2002-03-15 Richard Henderson + + * config/alpha/alpha.c (alpha_va_arg): Manipulate the type + size as a tree. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.md ("tstqi_1"): Try to use ldab instead of tst. + ("tstqi" split): Avoid using memory for tstqi on address register. + (splits): Remove constraints. + ("cmphi_1_hc12"): New from "cmphi_1" and tuned for 68HC12. + ("cmpdf", "cmpsf"): Remove since not used. + ("*tbeq", "*tbne", "*tbeq8", "*tbne8"): Also look in cc_status.value2. + (peephole2): New peepholes to optimize tstqi and pre inc/dec addressing. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.md ("negsi2"): Optimize inline case. + ("neghi2"): Tighten constraints. + ("one_cmplsi2"): Optimize and simplify split. + * config/m68hc11/larith.asm (__negsi2): Likewise for library. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.md ("logicalsi3_zexthi"): Fix constraints + and split of AND operation to clear the upper bits. + ("*logicalsi3_zextqi"): Likewise. + ("*logicallhi3_zexthi_ashift8"): Likewise. + ("*logicalsi3_silshr16"): Likewise. + ("logicalsi3_silshl16"): Likewise. + ("anddi3", "iordi3", "xordi3" splits): Remove constraints. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_symbolic_p): New function. + (m68hc11_indirect_p): New function. + (m68hc11_override_options): Must set MASK_NO_DIRECT_MODE for 68HC12. + (m68hc11_gen_highpart): Use TARGET_NO_DIRECT_MODE instead of + TARGET_M6812. + (asm_print_register): Likewise. + * config/m68hc11/m68hc11-protos.h (m68hc11_symbolic_p): Declare. + (m68hc11_indirect_p): Declare. + * config/m68hc11/m68hc11.h (EXTRA_CONSTRAINT): New constraint 'R', 'Q'. + (TARGET_NO_DIRECT_MODE, TARGET_RELAX): New. + (TARGET_SWITCHES): New option -mrelax. + * config/m68hc11/m68hc11.md ("andsi3"): Allow soft register for + destination. + ("iorsi3", "xorsi3"): Likewise. + ("andhi3", "andqi3", "iorhi3", "iorqi3"): Use a define_expand. + ("*andhi3_mem"): New to handle destination in memory with bclr + and a scratch register. + ("*andqi3_mem", "*iorhi3_mem", "*iorqi3_mem"): Likewise. + ("*andhi3_const"): New when operand2 is constant. + ("*andqi3_const", "*iorhi3_const", "*iorqi3_const"): Likewise. + ("*andhi3_gen"): Cleanup of the old "andhi3". + ("*andqi3_gen", "*iorhi3_gen", "*iorqi3_gen"): Likewise. + ("xorqi3"): Update constraints. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look + for reg_equiv_memory_loc when the operand is a register that does + not get a hard register (stack location). + (tst_operand): After reload, accept all memory operand. + (symbolic_memory_operand): Fix detection of symbolic references. + * config/m68hc11/m68hc11.h (VALID_CONSTANT_OFFSET_P): For 68HC12 + accept symbols and any constant. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.c (emit_move_after_reload): Add a REG_INC + note on the insn that sets the soft frame register. + (must_parenthesize): ix and iy are also reserved names. + (print_operand_address): One more place where parenthesis are required + to avoid confusion with register names. + (m68hc11_gen_movhi): Allow push of stack pointer. + (m68hc11_check_z_replacement): Fix handling of parallel with a + clobber. + (m68hc11_z_replacement): Must update the REG_INC notes to tell what + the replacement register is. + * config/m68hc11/m68hc11.h (REG_CLASS_CONTENTS): Switch Z_REGS + and D8_REGS classes. + (MODES_TIEABLE_P): All modes are tieable except QImode. + +2002-03-15 Stephane Carrez + + * config/m68hc11/larith.asm (___adddi3): Optimize saving of result. + (___subdi3): Likewise. + (__mulsi3, __mulhi32): Avoid using _.tmp scratch location. + (__map_data_section): Optimize 68hc11 case. + +2002-03-15 Stephane Carrez + + * config/m68hc11/m68hc11.c (m6812_cost): Make cost of add higher + than a shift to avoid adding a register with itself. + (m68hc11_memory_move_cost): Take into account NO_REGS. + (m68hc11_register_move_cost): Update and use memory move cost + for soft registers. + (m68hc11_address_cost): Make cost of valid offset not 0 so that + it gives more opportunities to cse to optimize. + * config/m68hc11/m68hc11.h (REGISTER_MOVE_COST): Pass the mode. + * config/m68hc11/m68hc11-protos.h (m68hc11_register_move_cost): Update. + +2002-03-15 Mark Mitchell + + * c-common.c (statement_code_p): Handle CLEANUP_STMT. + * c-common.def (CLEANUP_STMT): New tree node. + * c-common.h (CLEANUP_DECL): New macro. + (CLEANUP_EXPR): Likewise. + * c-semantics.c (expand_stmt): Handle CLEANUP_STMT. + * expr.c (expand_expr): Tidy. + * tree-dump.c (dequeue_and_dump): Handle CLEANUP_STMT. + * tree-inline.c (initialize_inlined_parameters): Clean up + new local variables. + +2002-03-15 Jakub Jelinek + + PR bootstrap/4128 + * config/sparc/sparc.c (gen_v9_scc): Move early clobber test + before movrXX only, use reg_overlap_mentioned_p. + Only special case NE if just one insn can be generated. + +2002-03-15 Jason Merrill + + * varasm.c (assemble_variable): Call resolve_unique_section before + checking DECL_SECTION_NAME. Use zeros for a decl with DECL_INITIAL + of error_mark_node. + +2002-03-15 Richard Earnshaw + + PR target/5170 + * arm.md (split pattern for thumb shiftable immediates): Add comment + explaining non-obvious test. + +2002-03-15 Richard Earnshaw + + PR target/5712 + * arm.md (movaddr, movaddr_insn): Delete. + +2002-03-15 Jason Merrill + + * toplev.c (wrapup_global_declarations): Clarify variable handling. + -fkeep-static-consts doesn't apply to comdats. + +2002-03-14 Richard Henderson + + * c-decl.c: Include c-pragma.h. + (start_decl, start_function): Invoke maybe_apply_pragma_weak. + (finish_function): Tidy. + * c-pragma.c: Include c-common.h. + (pending_weaks, apply_pragma_weak, maybe_apply_pragma_weak): New. + (handle_pragma_weak): Use them. + (init_pragma): Register pending_weaks. + * c-pragma.h (maybe_apply_pragma_weak): Declare. + * print-tree.c (print_node): Print DECL_WEAK. + * varasm.c (mark_weak_decls): Remove. + (remove_from_pending_weak_list): Remove. + (add_weak): Remove. + (asm_emit_uninitialised): Call globalize_decl for weak commons. + (weak_decls): Make a tree_list. + (declare_weak): Cons weak_decls directly. + (globalize_decl): Remove weak_decls elements directly. + (weak_finish): Simplify weak_decls walk. Don't weaken unused + symbols. Don't pretend to handle aliases. + (init_varasm_once): Update weak_decls registry. + * Makefile.in: Update dependencies. + +2002-03-14 Richard Henderson + + PR target/5312 + * config/ia64/ia64.c: Include tm_p.h last. + (gen_nop_type): Remove duplicate definition. + (cycle_end_fill_slots): Set sched_data for second L slot. + (maybe_rotate): Call cycle_end_fill_slots to fill in nop slots. + (nop_cycles_until): Fix typos. + +2002-03-15 Jakub Jelinek + + PR optimization/5891 + * unroll.c (copy_loop_body) [CALL_INSN]: Copy SIBLING_CALL_P flag. + +2002-03-14 David Mosberger , Hans Boehm + + * config/ia64/unwind-ia64.c: Handle copy_state and label_state + descriptors correctly. + +2002-03-14 Michael Meissner + + * params.def (PARAM_MAX_UNROLLED_INSNS): New macro, default to + 100, allowing MAX_UNROLLED_INSNS to be overridden. + + * params.h (MAX_UNROLLED_INSNS): Define so it can be overridden by + --param. + + * unroll.c (params.h): Include. + (MAX_UNROLLED_INSNS): Delete, now in params.h. + + * doc/invoke.texi (--param max-unroll-insns): Document. + + * Makefile.in (unroll.o): Add $(PARAMS_H) dependency. + +2002-03-14 Richard Earnshaw + + * arm.md: Fix warnings about constraints in peepholes and splits. + +2002-03-14 Zack Weinberg + + * cpphash.h (struct lexer_state): Remove line_extension member. + * cpplib.c (dequote_string, do_linemarker): New functions. + (linemarker_dir): New data object. + (DIRECTIVE_TABLE): No longer need to interpret #line in + preprocessed source. Delete obsolete comment about return + values of handlers. + (end_directive, directive_diagnostics, _cpp_handle_directive): + Don't muck with line_extension. + (directive_diagnostics): No need to issue warnings for + linemarkers here. + (_cpp_handle_directive): Issue warnings for linemarkers here, + when appropriate. Dispatch linemarkers to do_linemarker, not + do_line. + (do_line): Code to handle linemarkers split out to do_linemarker. + Convert escape sequences in filename argument, both places. + + * cppmacro.c (quote_string): Rename cpp_quote_string and + export. All callers changed. + * cpplib.h (cpp_quote_string): Prototype. + * cppmain.c (print_line): Call cpp_quote_string on to_file + before printing it. + + * doc/cpp.texi: Document that escapes are now interpreted in + #line and in linemarkers, and that non-printing characters are + converted to octal escapes when linemarkers are generated. + +Thu Mar 14 19:04:29 CET 2002 Jan Hubicka + + * emit-rtl.c (try_split): Use delete_insns. + * recog.c (split_all_insns): Fix terminating condition. + +2002-03-14 Richard Earnshaw + Jeroen Dobbelaere + + PR target/5828 + * arm.c (arm_output_epilogue): Fix floating-point register save + adjustment when using a frame pointer. + +2002-03-14 Richard Sandiford + + * config/mips/mips.h (FP_INC, UNITS_PER_FPVALUE): New macros. + * config/mips/mips.c (compute_frame_size): Retrofit them here. + (save_restore_insns, mips_expand_epilogue): And here. + (build_mips16_call_stub): And here. + (mips_function_value): Use the new macros to decide whether a single + or complex float can be returned in floating-point registers. Return + a parallel rtx in the complex case. + +Thu Mar 14 11:03:12 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Add CLEANUP_UPDATE_LIFE to cfg_cleanup + call after liveness analysis. + + * recog.c (split_insn): Use delete_insn_and_edges. + + * cfgrtl.c (verify_flow_info): Be permisive about non-any_condjump + instructions to have branch prediction notes. + * ia64reorg.c (ia64_reorg): Do not rebuild CFG. + +2002-03-14 Geoffrey Keating + + * configure.in: Don't pass -Wno-long-long to a ADA compiler + that doesn't support it. + * configure: Regenerate. + +2002-03-13 Jakub Jelinek + + PR target/5626 + * config/sparc/sparc.md (normal_branch, inverted_branch, + normal_fp_branch, inverted_fp_branch, normal_fpe_branch, + inverted_fp_branch): Adjust calls to output_cbranch. + Set length attribute. + (normal_int_branch_sp64, inverted_int_branch_sp64): Adjust calls to + output_v9branch. Set length attribute. + * config/sparc/sparc.c (fcc0_reg_operand, noov_compare64_op): New + predicates. + (noov_compare_op): Handle CCX_NOOVmode the same way as CC_NOOVmode. + (output_cbranch): Likewise. Handle far branches. + (output_v9branch): Handle far branches. + * config/sparc/sparc-protos.h (output_cbranch, output_v9branch): + Adjust prototypes. + * config/sparc/sparc.h (PREDICATE_CODES): Add fcc0_reg_operand and + noov_compare64_op predicates. + +2002-03-13 Jason Merrill + + * gthr-posix.h (__gthread_active_p): Move __gthread_active_ptr + into the function and constify it. + * gthr-dce.h, gthr-solaris.h: Likewise. + +2002-03-13 David Edelsohn + + * config/rs6000/rs6000.h (PAD_VARARGS_DOWN): Define. + * config/rs6000/rs6000.c (rs6000_va_arg): Use + std_expand_builtin_va_arg if not ABI_V4. + +2002-03-13 Jason Merrill + + * varasm.c (globalize_decl): New fn. + (assemble_start_function): Use it. + (asm_emit_uninitialized): Use it. + (assemble_alias): Use it. + (assemble_variable): Use it. + +2002-03-13 Hans-Peter Nilsson + + * config/cris/cris.c (cris_target_asm_function_prologue): Revert + 2002-03-12 internal visibility change. + (cris_encode_section_info): Consider MODULE_LOCAL_P when encoding + visibility into SYMBOL_REF_FLAG. + +2002-03-13 Ulrich Weigand + + * expr.c (expand_expr, case NE_EXPR): Do not call copy_to_reg with + VOIDmode operand. Add compile-time optimization for constant results. + +2002-03-12 Jason Merrill + + * c-typeck.c (convert_for_assignment): Don't allow conversions + between pointers and references. Only allow lvalues to convert to + reference. + +2002-03-13 Hartmut Penner + + * config/s390/s390.h (PROFILE_BEFORE_PROLOGUE): Emit profile code + before prologue, to avoid scheduling problems. + +2002-03-13 Jakub Jelinek + + * config/sparc/sparc.h (INITIAL_FRAME_POINTER_OFFSET): Remove. + (ELIMINABLE_REGS): Add sfp->sp. + (INITIAL_ELIMINATION_OFFSET): Compute sfp->sp offset too. + +2002-03-13 Jakub Jelinek + + PR optimization/5892 + * config/ia64/ia64.c (rotate_one_bundle): Update current packet. + +2002-03-13 Jakub Jelinek + + * loop.c (basic_induction_var): Don't call convert_modes if mode + classes are different. + +2002-03-12 Richard Henderson + + PR optimization/5901 + * function.c (reposition_prologue_and_epilogue_notes): Position + the markers after/before the last/first insn not deleted. + +2002-03-12 Richard Henderson + + PR optimization/5878 + * config/arc/arc.h, config/cris/cris.h, config/i386/i386.h, + config/m68k/m68k.h, config/s390/s390.h, config/sparc/sparc.h + (PIC_OFFSET_TABLE_REGNUM): Conditionalize on flag_pic. + + * config/arm/arm.h config/i386/i386.h, config/m68k/m68k.h, + config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Set + PIC_OFFSET_TABLE_REGNUM based on INVALID_REGNUM not flag_pic. + + * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): New. + * config/arm/arm.c (arm_pic_register): Init to INVALID_REGNUM. + (arm_override_options): Set arm_pic_register if TARGET_APCS_STACK + also. Don't set it if not flag_pic. + * config/i386/i386.c (ix86_save_reg): Trust PIC_OFFSET_TABLE_REGNUM + to be INVALID_REGNUM when not used. + +2002-03-13 Aldy Hernandez + + * expmed.c (store_bit_field): Reset alias set for memory. + (extract_bit_field): Same. + +2002-03-12 Kaveh R. Ghazi + + * c-common.c (c_tree_code_type, c_tree_code_length, + c_tree_code_name, add_c_tree_codes): Delete. + * c-common.h (add_c_tree_codes): Delete. + * c-lang.c (tree_code_type, tree_code_length, tree_code_name): + Define. + * c-objc-common.c (c_objc_common_init): Don't call + add_c_tree_codes, instead set lang_unsafe_for_reeval. + * objc/objc-act.c (objc_tree_code_type, objc_tree_code_length, + objc_tree_code_name, add_objc_tree_codes): Delete. + (objc_init): Don't call add_objc_tree_codes. + * objc/objc-lang.c (tree_code_type, tree_code_length, + tree_code_name): Define. + * toplev.c (lang_independent_init): Don't set + tree_code_length[IDENTIFIER_NODE]. + * tree.c (tree_code_type, tree_code_length, tree_code_name): + Delete definitions, moved to language front-ends. + * tree.def (IDENTIFIER_NODE): Hardwire the length. + * tree.h (tree_code_type, tree_code_length, tree_code_name): + Const-ify. + (tree_code_length): Change type to unsigned char. + +2002-03-12 Richard Henderson + + * config/i386/i386.c (ix86_expand_prologue): Revert 2002-03-03 + internal visibility change. + +2002-03-12 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_expand_block_move): Use + validize_mem() instead of change_address to avoid clobbering + memory attributes. + +2002-03-12 Neil Booth + + * c-lex.h (position_after_whitespace): Remove. + +2002-03-12 Jakub Jelinek + + * c-lex.c (cb_ident, c_lex): Remove unnecessary cast. + (lex_string): Use unsigned char pointers. + +2002-03-12 Ulrich Weigand + + * reload1.c (reload): Ignore MEM REG_EQUIV notes if the equivalent + is not a valid memory_operand. + +2002-03-12 Bob Wilson + + * config/xtensa/xtensa-config.h: Define XCHAL_HAVE_LOOPS. + * config/xtensa/lib1funcs.asm: Fix copyright to include + special case for libgcc files. + (__udivsi3): Avoid loop instructions when XCHAL_HAVE_LOOPS is 0. + (__divsi3): Likewise. + (__umodsi3): Likewise. + (__modsi3): Likewise. + * config/xtensa/lib2funcs.S: Fix copyright to include + special case for libgcc files. + +2002-03-12 Tom Rix + + * collect2.c (resolve_lib_name): Move outside of + OBJECT_FORMAT_COFF ifdef. + (ignore_library): Same. + +2002-03-12 Bob Wilson + + * config/xtensa/t-xtensa (CRTSTUFF_T_CFLAGS_S): Define. + +2002-03-12 Bob Wilson + + * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Switch + to function_section before writing out the constant pool. + +2002-03-12 David Edelsohn + + * config/rs6000/rs6000.h (PREDICATE_CODES): Add any_operand and + zero_constant. + * config/rs6000/rs6000.c (easy_fp_constant): Fix formatting. + +2002-03-12 Alan Modra + + * config/rs6000/rs6000.md (addsi3): Optimize sign extension. + (adddi3): Likewise. + (movdf): Likewise. + (movdi): Likewise. + (cmpsi splitter): Likewise. + (modsi3): Fail if <= 0. + * config/rs6000/rs6000.c (reg_or_add_cint64_operand): Remove + redundant test when HOST_BITS_PER_WIDE_INT != 32. + (reg_or_sub_cint64_operand): Likewise. + (num_insns_constant_wide): Optimize sign extension. + (rs6000_legitimize_address): Likewise. + +2002-03-12 Andrew MacLeod + + * config/sparc/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + * config/sparc/linux64.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +2002-03-12 Andrew MacLeod + + * config/sparc/sparc.h (RETURN_ADDR_RTX): Include v9 stack bias in + address calculation. + +2002-03-12 Ulrich Weigand + + * config/s390/s390.md (reload_insi, reload_indi): Change mode of + scratch register to DImode / TImode. + config/s390/s390.c (s390_expand_plus_operand): Make sure scratch + register used does not overlap the target. + +2002-03-12 Kaveh R. Ghazi + + * Makefile.in (debug.o): Depend on debug.h. + * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Const-ify. + * debug.c (do_nothing_debug_hooks): Likewise. + * debug.h (debug_hooks, do_nothing_debug_hooks, dbx_debug_hooks, + sdb_debug_hooks, xcoff_debug_hooks, dwarf_debug_hooks, + dwarf2_debug_hooks, vmsdbg_debug_hooks): Likewise. + * dwarf2out.c (dwarf2_debug_hooks): Likewise. + * dwarfout.c (dwarf_debug_hooks): Likewise. + * integrate.c (output_inline_function): Likewise. + * objc/objc-act.c (synth_module_prologue): Likewise. + * sdbout.c (sdb_debug_hooks): Likewise. + * toplev.c (debug_hooks): Likewise. + * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. + +2002-03-12 Kaveh R. Ghazi + + * 1750a.h, a29k.h, arc.h, arm.h, c4x.h, clipper.h, cris.h, d30v.h, + dsp16xx.h, fr30.h, h8300.h, i370.h, i386.h, i860.h, i960.h, + m32r.h, m68hc11.h, m68k.h, m88k.h, mcore.h, mmix.h, mn10300.h, + ns32k.h, pa.h, pdp11.h, pj.h, romp.h, s390.h, stormy16.h, + v850.h, vax.h, we32k.h, xtensa.h (POINTER_SIZE): Delete. + * defaults.h (POINTER_SIZE): Define. + * doc/tm.texi (POINTER_SIZE): Document default. + +2002-03-12 Kaveh R. Ghazi + + * mn10200.h (PTRDIFF_TYPE): Change it to a signed type. + +2002-03-11 Richard Henderson + + * toplev.c (rest_of_compilation): Call purge_all_dead_edges + if rebuild_label_notes_after_reload. + +2002-03-12 Hans-Peter Nilsson + + * config/cris/cris.c (cris_target_asm_function_prologue): Do not + emit pic register load if "internal" visibility. + (cris_print_operand): Avoid traditional-warning for 0xffffffff. + (cris_expand_builtin_va_arg): Do all computations on trees. + +2002-03-11 Richard Henderson + + * rtlanal.c: Include recog.h. + (keep_with_call_p): Fix thinko. + * Makefile.in (rtlanal.o): Update dependencies. + +2002-03-11 Chris Meyer + + * genflags.c (gen_insn): Use IS_VSPACE. + * genoutput.c (output_insn_data): Likewise. + (process_template): Likewise. + +2002-03-11 Richard Henderson + + * toplev.c (rest_of_compilation): Don't compile if we've had errors. + +2002-03-11 Neil Booth + + * Makefile.in: Update. + * doc/cppenv.texi, cppopts.texi: Split out of cpp.texi and gcc.texi. + Update documentation. + * doc/gcc.texi: Include cppopts.texi and cppenv.texi. + * doc/cpp.texi: Include cppopts.texi and cppenv.texi. + +2002-03-11 Zack Weinberg + + * Makefile.in: Give texi2pod its input file as a command line + argument, not on stdin. + +2002-03-11 Dan Nicolaescu + Daniel Berlin + + C++ alias analysis improvement. + * alias.c (record_component_aliases): Record aliases for base + classes too. + +2002-03-11 Ulrich Weigand + + * config/s390/s390.h (REG_ALLOC_ORDER): Add missing register. + +2002-03-11 Douglas B Rupp + + * toplev.c (vms_fopen): Remove, not needed. + + * vmsdbgout.c (lookup_filename): Adjust creation date for GMT. + + * config/alpha/xm-vms.h (__UNIX_FWRITE): Define. + + * config/alpha/alpha.c (alpha_sa_size, VMS): Don't reserve space + for FP, already done later. + + * toplev.c (debug_args): Add entry for VMS_DEBUG. + * vmsdbgout.c (vmsdbgout_init): Fix typo in call to xmalloc. + +2002-03-11 Richard Sandiford + + * defaults.h (LARGEST_EXPONENT_IS_NORMAL, ROUND_TOWARDS_ZERO): New. + (MODE_HAS_NANS, MODE_HAS_INFINITIES): Evaluate to false if + LARGEST_EXPONENT_IS_NORMAL for the given mode. + (MODE_HAS_SIGN_DEPENDENT_ROUNDING): False when ROUND_TOWARDS_ZERO. + * real.c (eadd1): Make rounding dependent on !ROUND_TOWARDS_ZERO. + (ediv, emul, eldexp, esqrt): Likewise. + (etoe113, etoe64, etoe53, etoe24, etodec, etoibm, etoc4x): Likewise. + (e24toe): Only check NaNs & infinities if !LARGEST_EXPONENT_IS_NORMAL. + (saturate): New function. + (toe53, toe24): Saturate on overflow if LARGEST_EXPONENT_IS_NORMAL. + (make_nan): Use a saturation value instead of a NaN if + LARGEST_EXPONENT_IS_NORMAL. Warn when this happens. + * fp-bit.c (pack_d): Saturate on NaN, infinite or overflowing + inputs if LARGEST_EXPONENT_IS_NORMAL. Represent subnormals as + zero if NO_DENORMALS. Only round to nearest if !ROUND_TOWARDS_ZERO. + (unpack_d): No NaNs or infinities if LARGEST_EXPONENT_IS_NORMAL. + (_fpmul_parts, _fpdiv_parts): Only round to nearest if + !ROUND_TOWARDS_ZERO. + * doc/tm.texi (LARGEST_EXPONENT_IS_NORMAL): Document. + (ROUND_TOWARDS_ZERO): Document. + +2002-03-11 Andreas Jaeger + + * cfg.c (dump_flow_info): Remove unused variable. + +2002-03-11 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_expand_builtin_va_arg): Do all + computations on trees. + +2002-03-10 Richard Henderson + + PR 5693: + * reload.c (copy_replacements_1): New. + (copy_replacements): Use it to recurse through the rtx. + +2002-03-10 Richard Henderson + + * loop.c (strength_reduce): Compute number of iterations as + unsigned HOST_WIDE_INT. + +2002-03-10 Richard Henderson + + * sched-rgn.c (add_branch_dependences): Don't allow insns that throw + to move away from the end of the block. + +2002-03-10 Neil Booth + + PR preprocessor/5899 + * cppinit.c (init_dependency_output): Don't ignore -dM etc. + +2002-03-10 Kaveh R. Ghazi + + * mbchar.c (JIS_state_table, JIS_action_table): Const-ify. + + * attribs.c (decl_attributes): Fix signed/unsigned warning. + +2002-03-10 Hans-Peter Nilsson + + * config/mmix/mmix.c: Improve comments. + (mmix_target_asm_function_prologue): Drop variable + empty_stack_frame. Don't allocate unused slot above fp. + (mmix_target_asm_function_epilogue): Mirror prologue changes. + * config/mmix/mmix.h (MMIX_GNU_ABI_REG_ALLOC_ORDER): Don't have + brace in first column. + (enum reg_class): Ditto. + (FIRST_PARM_OFFSET): Now 0. + (USER_LABEL_PREFIX): Remove #if 0:d definition. + +2002-03-10 Kaveh R. Ghazi + + * combine.c (make_extraction): Fix error in last change. + +2002-03-09 Kaveh R. Ghazi + + * c4x.c (c4x_fp_reglist): Const-ify. + * cris.c (cris_print_operand): Likewise. + * i386.c (ix86_va_arg): Likewise. + * ia64/unwind-ia64.c (unw_decode_table): Likewise. + * m32r.c (m32r_hard_regno_mode_ok): Likewise. + * m32r.h (m32r_hard_regno_mode_ok): Likewise. + * mcore.c (regno_reg_class, mcore_unique_section): Likewise. + * mcore.h (regno_reg_class): Likewise. + * mips.c (gen_int_relational): Likewise. + * ns32k.c (ns32k_reg_class_contents, regclass_map): Likewise. + * ns32k.h (ns32k_reg_class_contents, regclass_map): Likewise. + * pdp11.c (move_costs): Likewise. + * pj.h (INITIALIZE_TRAMPOLINE): Likewise. + * s390.c (s390_branch_condition_mnemonic, regclass_map): + Likewise. + * s390.h (regclass_map): Likewise. + * sh.c (shift_amounts): Likewise. + * sh.md (rotlsi3): Likewise. + +2002-03-09 Geoffrey Keating + + * config/rs6000/rs6000.md (ne0+4): Add extra CLOBBER. + (ne0+5): Use new clobber to generate proper shift pattern. + Patch by Michael Matz . + +2002-03-09 Andreas Schwab + + * gcc.c (validate_all_switches): Also handle `%W{...}'. + +2002-03-09 Geoffrey Keating + + * config/rs6000/sysv4.h (BIGGEST_ALIGNMENT): Don't define. + +2002-03-09 Jakub Jelinek + + PR middle-end/5877 + * expr.c (highest_pow2_factor): Check TREE_INT_CST_LOW + even for non-representable constants. + +Sat Mar 9 07:20:01 2002 Richard Kenner + + * emit-rtl.c (copy_most_rtx): Accept EXPR_LIST for may_share. + * function.c (fixup_var_refs): Add MAY_SHARE parameter. + (fixup_var_refs_insns, fixup_var_refs_insns_with_has): Likewise. + (fixup_var_refs_insn, fixup_var_refs_1): Likewise. + (pop_function_context): Compute MAY_SHARE parameter for + fixup_var_refs. + (fixup_var_refs_1, case MEM): Pass MAY_SHARE to copy_most_rtx, not VAR. + (gen_mem_addressof): Call fixup_var_refs with new parm. + + * combine.c (make_extraction): Don't make extension of CONST_INT. + +2002-03-09 Alexandre Oliva + + * config/mips/mips.c (function_arg_pass_by_reference): Force to 0 + in o32 and o64 ABIs. + * config/mips/abi64.h (MUST_PASS_IN_STACK): Define as in expr.h, + but getting fixed-size structs passed in registers regardless of + padding in o32 and o64 ABIs. + + * config/mips/mips.c (mips_va_arg): Apply big-endianness address + offset before loading address of argument passed by transparent + reference. + +2002-03-08 John David Anglin + + * t-pa64 (LIB1ASMFUNCS, LIB1ASMSRC): Delete. + +2002-03-09 Alexandre Oliva + + * config/mips/mips.c (mips_expand_prologue): Set regno of vararg + marker such that registers after it are saved. + +2002-03-08 Kaveh R. Ghazi + + * sparc.c (arith_4096_operand): Fix error in last change. + +2002-03-08 Alexandre Oliva + + * config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): Remove duplicate + defaults for MEABI. + +2002-03-08 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_va_arg): Fix alignment for + vectors. + +2002-03-08 Aldy Hernandez + + * config/rs6000/sysv4.h (BIGGEST_ALIGNMENT): Change for altivec. + +Fri Mar 8 21:27:49 CET 2002 Jan Hubicka + + * cfgrtl.c (purge_dead_edges): Set BB_DRITY flags if edge has been + removed; fix return value. + * combine.c (combine_instructions): Dirtify blocks where we failed to + update liveness; purge dead edges; use update_life_info_in_dirty_blocks. + * toplev.c (rest_of_compilation): Do not purge_dead_edges after combine. + +2002-03-08 Kaveh R. Ghazi + + * gcse.c (insert_insn_end_bb): Fix typo in last change. + +Fri Mar 8 21:08:52 CET 2002 Jan Hubicka + + * recog.c (peephole2_optimize): Re-distribute EH edges. + +2002-03-08 Neil Booth + + * expr.c (expand_expr): Use unsave lang hook. + * langhooks-def.h (LANG_HOOKS_UNSAVE): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): New hook unsave. + * tree.c (lang_unsave, lang_unsave_expr_now): Remove. + (unsave_expr_1): Remove unused lang_unsave_expr_now. + (unsave_expr_now_r): Rename lhd_unsave. Update. Return input. + (unsave_expr_now): Remove. + * tree.h (unsave_expr_now, lang_unsave, + lang_unsave_expr_now): Remove. + (lhd_unsave): New. + +2002-03-08 Andreas Jaeger + + * flow.c (propagate_block_delete_insn): Remove unused variable. + +2002-03-08 Kazu Hirata + + * config/h8300/h8300.c (h8300_adjust_insn_length): Tighten + insn length for memory load/store. + +2002-03-08 Craig Rodrigues + + * doc/install.texi (--with-libiconv-prefix): Document. + +2002-03-08 Michael Y. Brukman + + * doc/sourcebuild.texi: Fix typo. + +2002-03-08 Jakub Jelinek + + PR c/3711 + * builtins.c (std_expand_builtin_va_arg): Do all computations on + trees. + +Fri Mar 8 06:48:45 2002 Richard Kenner + + * rtl.c (copy_most_rtx): Move from here ... + * emit-rtl.c (copy_most_rtx): ... to here. + +2002-03-08 Alexandre Oliva + + * config/mips/mips.h (LONG_MAX_SPEC): Rewrite, along with + SUBTARGET_CPP_SIZE_SPEC. + * config/mips/abi64.h (LONG_MAX_SPEC): Delete. + + * config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): Simplify. + +2002-03-07 Matt Hiller + + * gensupport.c (first_dir_md_include): Renamed from include; + change all references. + (last_dir_md_include): Renamed from last_include; change all + references. + (init_md_reader): Unconditionally initialize base_dir whether or + not filename is a relative path. + +2002-03-07 Alexandre Oliva + + * config/fp-bit.c (_unord_f2): Compile it in even if + US_SOFTWARE_GOFAST is enabled. + + * config/gofast.h (GOFAST_RENAME_LIBCALLS): Set gt and ge as + NULL_RTX. Set all HFmode operations as NULL_RTX. + * optabs.c (prepare_float_lib_cmp) : If libfunc is + NULL_RTX, try reversing the comparison and the operands. + +2002-03-06 Ulrich Weigand + + * genextract.c (walk_rtx): Recurse into MATCH_PAR_DUP. + genoutput.c (scan_operands): Recurse into MATCH_PAR_DUP + and MATCH_OP_DUP. + +Thu Mar 7 16:54:10 CET 2002 Jan Hubicka + + * reload1.c (reload_cse_delete_noop_set): Purge dead edges. + +Thu Mar 7 16:33:54 CET 2002 Jan Hubicka + + * basic-block.h (fixup_abnormal_edges): Declare. + * reload1.c (fixup_abnormal_edges): New function. + * reg-stack.c (convert_regs): Use it. + + * gcse.c (insert_insn_end_bb): Handle trapping insns. + + * gcse.c (hash_scan_set): Refuse instructions with EH edges. + +2002-03-07 Richard Sandiford + + * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New. + (MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New. + * flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New. + (HONOR_SIGN_DEPENDENT_ROUNDING): New. + * builtins.c (expand_builtin_mathfn): Use HONOR_NANS. + * c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y + unless x and y could be infinite. + (expand_unordered_cmp): New, mostly split from expand_tree_builtin. + Check that the common type of both arguments is a real, even for + targets without unordered comparisons. Allow an integer argument + to be compared against a real. + (expand_tree_builtin): Use expand_unordered_cmp. + * combine.c (combine_simplify_rtx): Use the new HONOR_... macros. + * cse.c (fold_rtx): Likewise. Fix indentation. + * fold-const.c (fold_real_zero_addition_p): New. + (fold): Use it, and the new HONOR_... macros. + * ifcvt.c (noce_try_minmax): Use the new HONOR_... macros. + * jump.c (reversed_comparison_code_parts): After searching for + the true comparison mode, use HONOR_NANS to decide whether it + can be safely reversed. + (reverse_condition_maybe_unordered): Remove IEEE check. + * simplify-rtx.c (simplify_binary_operation): Use the new macros + to decide which simplifications are valid. Allow the following + simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b), + and (a - -b) to (a + b). + (simplify_relational_operation): Use HONOR_NANS. + * doc/tm.texi: Document the MODE_HAS_... macros. + +2002-03-07 Richard Earnshaw + + * combine.c (simplify_comparison): If simplifying a logical shift + right and compare with constant, force the comparison to unsigned. + +2002-03-07 Aldy Hernandez + + * doc/invoke.texi: Add documentation for -mabi=no-altivec. + + * config/rs6000/rs6000.c (rs6000_parse_abi_options): Add + -mabi=no-altivec + (alt_reg_names): Remove % for vrsave. + +2002-03-06 Richard Henderson + + PR optimization/5844 + * genemit.c (gen_exp): New argument used. Invoke copy_rtx + if used indicates we've already emitted one copy of an operand. + (gen_insn, gen_expand, output_add_clobbers): Supply a null used. + (gen_split): Supply a non-null used. + +2002-03-06 Ulrich Weigand + + * reload1.c (reload): Unshare all rtl after reload is done. + + * simplify-rtx.c (simplify_plus_minus): Do not abort, + but simply fail if the expression is too complex to simplify. + (simplify_gen_binary): Handle simplify_plus_minus failures. + +Wed Mar 6 20:32:09 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Do jump threading before SSA path; + consistently call delete_trivially_dead_insns after CSE and GCSE; + fix DFI_life dumping; do jump threading after liveness; do crossjumping + after liveness2; update comment in last crossjumping. + * cfgcleanup.c (try_crossjump_to_edge): Dirtify block. + +Wed Mar 6 12:27:10 2002 Jeffrey A Law (law@redhat.com) + + * ssa-ccp.c (ssa_fast_dce): Update the DF def-use chains + after completing fast dead code elimination. + + * m68k.h (CONST_COSTS): Lower cost of 0.0 when used inside a + COMPARE operator. + +2002-03-06 Phil Edwards + + * version.c: Fix misplaced leading blanks on first line. + +Wed Mar 6 19:08:03 CET 2002 Jan Hubicka + + * cfgrtl.c (verify_flow_info): Accept RESX as EH edge source. + +Wed Mar 6 18:14:43 CET 2002 Jan Hubicka + + * cfgcleanup.c (mentions_nonequal_regs): New function. + (thread_jump): Use it. + * toplev.c (rest_of_compilation): Run jump threading after + liveness. + +2002-03-06 Jakub Jelinek + + * ssa-ccp.c (ssa_ccp_substitute_constants): Backout 2002-03-05 + patch. + +Wed Mar 6 11:28:19 CET 2002 Jan Hubicka + + * predict.c (estimate_bb_frequencies): Do not reload the + frequencies from notes. + +Wed Mar 6 10:59:39 CET 2002 Jan Hubicka + + * cfgrtl.c (delete_insn_and_edges, delete_insn_chain_and_edges): New. + * rtl.h (delete_insn_and_edges, delete_insn_chain_and_edges): Declare + + * basic-block.h (update_life_info, update_life_info_in_dirty_blocks, + delete_noop_moves): Return indeger. + * flow.c (ndead): New variable. + (propagate_block_delete_insn): Use delete_insn_and_edges; remove + BB argument; update callers. + (propagate_block_delete_libcall): Use delete_insn_chain_and_edges. + (life_analysis): Do not call purge_all_dead_edges. + (update_life_info): Return number of deleted insns; print statistics. + (update_life_info_in_dirty_blocks): likewise. + (delete_noop_moves): Use delete_insn_and_edges; print statistics; + return number of insns deleted. + + * cse.c: Include timevar.h + (delete_trivially_dead_insns): Kill preserve_basic_blocks argument; + iterate until stabilizes; print statistics; return number of killed + insns. + * Makefile.in: (cse.o): Add timevar.h dependency + * rtl.h (delete_trivially_dead_insns): New. + * timever.def: Add TV_DELETE_TRIVIALLY_DEAD timer. + * toplev.c (rest_of_compilation): Update callers. + + * cfgcleanup.c (try_optimize_cfg): Kill blocks. + (try_optimize_cfg): Do not update liveness. + (cleanup-cfg): Loop until try_optimize_cfg and dead code + removal stabilizes; use delete_trivially_dead_insns. + + * cfgrtl.c (verify_flow_info): Sanity check outgoing edges. + +2002-03-05 Zack Weinberg + + * cppmain.c (setup_callbacks): Disable #pragma and #ident + callbacks when processing assembly language. + +2002-03-05 John David Anglin + + * pa.h (ASM_FILE_END): Define. + * som.h (ASM_FILE_END): Delete. + + * pa.c (function_arg): Don't pass floats in general registers in + indirect calls if TARGET_ELF32. + +2002-03-05 Richard Henderson + + * config/i386/i386.md (floatsidf2): Conditionalize on hard-float. + +2002-03-05 Danny Smith + + * gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Define. + +2002-03-05 Jakub Jelinek + + * mklibgcc.in: Prepend a tab before .hidden, add $flags to gcc + -r command line. Don't hide any symbols if not building + shared libgcc. + +Tue Mar 5 18:31:27 CET 2002 Jan Hubicka + + * cfg.c (dump_flow_info): Warn about profile mismatches. + * cfgrtl.c (verify_flow_info): Few aditional sanity checks. + (purge_dead_edges): Remove REG_BR_PROB notes on simplejumps. + +2002-03-05 Jakub Jelinek + + * expmed.c (emit_store_flag): Don't test BITS_PER_WORD * 2 + wide volatile memory by parts. + +2002-03-05 Jakub Jelinek + + * ssa-ccp.c (ssa_ccp_substitute_constants): Don't crash if def + is NULL. + +2002-03-05 Richard Henderson + + * rs6000.h (TOTAL_ALTIVEC_REGS): Fix off-by-one error. + +2002-03-04 Geoffrey Keating + + * toplev.c (documented_lang_options): Document more + language-specific options. + * doc/invoke.texi (Warning Options): Correct documentation for + -Wno-multichar, -Wno-div-by-zero, and -Wsystem-headers. + * c-decl.c (c_decode_option): Use a table to handle warning options. + +2002-03-05 Hans-Peter Nilsson + + * config/mmix/mmix.h (ENCODE_SECTION_INFO): Pass on new second + parameter to mmix_encode_section_info. + (LINK_SPEC): Don't defsym __.MMIX.start..text if linking + relocatably. Always produce ELF, not mmo if linking relocatably. + * config/mmix/mmix.c (mmix_encode_section_info): If new parameter + first is nonzero, don't add symbol prefix. + * config/mmix/mmix-protos.h (mmix_encode_section_info): Tweak + prototype accordingly. + +2002-03-04 Krister Walfridsson + + * config.gcc (*-*-netbsd*): Add t-slibgcc-elf-ver to tmake_file. + +2002-03-05 Joseph S. Myers + + * configure.in: Increase required makeinfo version to 4.1. + * configure: Regenerate. + +2002-03-04 Geoffrey Keating + + * .cvsignore: Remove *.info* and genrtl*; these files are generated + elsewhere now. + +2002-03-04 Joseph S. Myers + + * doc/include/texinfo.tex: Update to version 2002-03-01.06. + * doc/invoke.texi: Fix @math uses. + +Mon Mar 4 15:33:54 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Cleanup CFG after dead jumptables + removal + +2002-03-03 Aldy Hernandez + + * config.gcc (powerpc-*-eabialtivec*): Use t-ppcendian. + (powerpc-*-eabisimaltivec*): Same. + + * config/rs6000/t-ppcendian: New. + +2002-03-04 Herman A.J. ten Brugge + + * c4x-protos.h, c4x.h, c4x.c, c4x.md: Add new functions + nonimmediate_src_operand and nonimmediate_lsrc_operand to + disallow ZERO_EXTEND with CONST_INT or CONST_DOUBLE. + +2002-03-03 Richard Henderson + + * toplev.c (rest_of_decl_compilation): Revert last two changes. + +2002-03-03 Zack Weinberg + + * emit-rtl.c, final.c, fold-const.c, gengenrtl.c, optabs.c, + print-tree.c, real.c, real.h, recog.c, rtl.c, simplify-rtx.c, + tree.c, config/m68k/m68k.c: + Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef + REAL_ARITHMETIC blocks unconditional. Delete some further + #ifdef blocks predicated on REAL_ARITHMETIC. + * flags.h, toplev.c: Delete remaining references to + flag_pretend_float. + + * doc/invoke.texi: Remove documentation of -fpretend-float. + * doc/tm.texi: Describe the various REAL_* macros as provided by + real.h, not by the target configuration files. + + * config/alpha/alpha.h, config/alpha/unicosmk.h, config/arm/arm.h, + config/avr/avr.h, config/c4x/c4x.h, config/convex/convex.h, + config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, + config/h8300/h8300.h, config/i370/i370.h, config/i386/i386.h, + config/i386/osf1elf.h, config/i960/i960.h, config/ia64/ia64.h, + config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/dpx2.h, + config/m68k/linux-aout.h, config/m68k/linux.h, config/m68k/m68k.h, + config/m68k/sun3.h, config/m68k/vxm68k.h, config/mcore/mcore.h, + config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, + config/mn10300/mn10300.h, config/pa/pa.h, config/pj/pj.h, + config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.h, + config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/sol2.h, config/sparc/sparc.h, config/sparc/vxsim.h, + config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, + config/xtensa/xtensa.h: + Do not define, undefine, or mention in comments any of + REAL_ARITHMETIC, REAL_VALUE_ATOF, REAL_VALUE_HTOF, + REAL_VALUE_ISNAN, REAL_VALUE_ISINF, + REAL_VALUE_TO_TARGET_SINGLE, REAL_VALUE_TO_TARGET_DOUBLE, + REAL_VALUE_TO_TARGET_LONG_DOUBLE, REAL_VALUE_TO_DECIMAL, + REAL_VALUE_TYPE, REAL_VALUES_EQUAL, REAL_VALUES_LESS, + REAL_VALUE_LDEXP, REAL_VALUE_FIX, REAL_VALUE_UNSIGNED_FIX, + REAL_VALUE_RNDZINT, REAL_VALUE_UNSIGNED_RNDZINT, + REAL_INFINITY, REAL_VALUE_NEGATE, REAL_VALUE_TRUNCATE, + REAL_VALUE_TO_INT, or REAL_VALUE_FROM_INT. + +2002-03-03 Kaveh R. Ghazi + + * 1750a.h, a29k.h, alpha.h, arc.h, arm.h, avr.h, c4x.h, clipper.h, + convex.h, cris.h, d30v.h, dsp16xx.h, elxsi.h, fr30.h, h8300.h, + i370.h, i386.h, i860.h, i960.h, ia64.h, m32r.h, m68hc11.h, m68k.h, + m88k.h, mcore.h, mips.h, mmix.h, mn10200.h, mn10300.h, ns32k.h, + pa.h, pdp11.h, pj.h, romp.h, rs6000.h, s390.h, sh.h, sparc.h, + stormy16.h, v850.h, vax.h, we32k.h, xtensa.h (BITS_PER_WORD): + Delete. + * defaults.h (BITS_PER_WORD): Define. + * doc/tm.texi (BITS_PER_WORD): Document default value. + + * 1750a.h, avr.h, convex.h, d30v.h, dsp16xx.h, fr30.h, ia64.h, + m68hc11.h, m88k.h, mips.h, pdp11.h, rs6000.h, sparc.c, + stormy16.h, xtensa.h, vmsdbgout.c (CHAR_TYPE_SIZE): Delete. + +2002-03-03 Kaveh R. Ghazi + + * attribs.c (init_attributes, decl_attributes): Use ARRAY_SIZE in + lieu of explicit sizeof/sizeof. + * i386.c (override_options, ix86_init_mmx_sse_builtins, + ix86_expand_builtin): Likewise. + * mips.c (mips_add_gc_roots): Likewise. + * mmix.c (mmix_output_condition): Likewise. + * rs6000.c (rs6000_override_options, altivec_expand_builtin, + altivec_init_builtins): Likewise. + * sparc.c (mark_ultrasparc_pipeline_state): Likewise. + * cppexp.c (Nsuff, parse_number): Likewise. + * cppinit.c (builtin_array_end): Likewise. + * gcc.c (n_default_compilers, process_command): Likewise. + * genpreds.c (output_predicate_decls): Likewise. + * ggc-page.c (NUM_EXTRA_ORDERS): Likewise. + * lcm.c (N_ENTITIES): Likewise. + * stor-layout.c (set_sizetype): Likewise. + +2002-03-03 Richard Henderson + + * toplev.c (rest_of_decl_compilation): Do not invoke make_decl_rtl + for types or labels. + +2002-03-03 Richard Henderson + + * c-decl.c (start_decl): Initialized variables are not common. + +2002-03-02 Per Bothner + + * gcc.c (option_map): Suport new --bootclasspath option. + --CLASSPATH is now just an alias for --classpath. + +2002-03-02 Richard Henderson + + * config/i386/i386.h (ix86_expand_prologue): Do not emit pic register + load if "internal" visibility. + * doc/extend.texi: Document visibility meanings. + +2002-03-02 Richard Henderson + + * config/i386/i386.h (ENCODE_SECTION_INFO): MODULE_LOCAL_P applies + to functions as well. + +2002-03-02 Richard Henderson + + * attribs.c (handle_alias_attribute): Don't call assemble_alias. + (handle_visibility_attribute): Don't call assemble_visibility. + * toplev.c (rest_of_decl_compilation): Invoke make_decl_rtl even + without asmspec. Invoke assemble_alias when needed. + * varasm.c (maybe_assemble_visibility): New. + (assemble_start_function, assemble_variable, assemble_alias): Use it. + +2002-03-02 Richard Henderson + + * varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P; + invoke ENCODE_SECTION_INFO with first call flag. + + * config/darwin-protos.h, config/darwin.c, config/darwin.h, + config/a29k/a29k.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, + config/alpha/alpha.h, config/arc/arc.h, config/arm/arm-protos.h, + config/arm/arm.h, config/arm/pe.c, config/arm/pe.h, + config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, + config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, + config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, + config/d30v/d30v.h, config/h8300/h8300.h, config/i370/i370.h, + config/i386/cygwin.h, config/i386/i386-interix.h, config/i386/i386.h, + config/i386/osfrose.h, config/i386/win32.h, config/i386/winnt.c, + config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, + config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, + config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, + config/m68hc11/m68hc11.h, config/m88k/m88k.h, + config/mcore/mcore-protos.h, config/mcore/mcore.c, + config/mcore/mcore.h, config/mips/mips.h, config/ns32k/ns32k.h, + config/pa/pa.h, config/romp/romp.h, config/rs6000/linux64.h, + config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, + config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.h, + config/sh/sh.h, config/sparc/sparc.h, + config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, + config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vms.h, + config/xtensa/xtensa.h, doc/tm.texi: ENCODE_SECTION_INFO now takes + FIRST argument. As needed, examine it and do nothing. + + * config/darwin.h, config/alpha/alpha.h, config/arm/pe.h, + config/i386/cygwin.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h, + config/mcore/mcore.h: Remove REDO_SECTION_INFO_P. + + * config/arm/t-pe (pe.o): Add dependencies. + +2002-03-02 Kaveh R. Ghazi + + * a29k.h, alpha.h, arc.h, arm.h, avr.h, clipper.h, convex.h, + cris.h, d30v.h, elxsi.h, fr30.h, h8300.h, i370.h, i386.h, i860.h, + i960.h, ia64.h, m32r.h, m68hc11.h, m68k.h, m88k.h, mcore.h, + mips.h, mmix.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pdp11.h, + pj.h, romp.h, rs6000.h, s390.h, sh.h, sparc.h, stormy16.h, v850.h, + vax.h, we32k.h, xtensa.h: (BITS_PER_UNIT): Delete. + * defaults.h (BITS_PER_UNIT): Define. + * doc/tm.texi (BITS_PER_UNIT): Document default value. + +2002-03-02 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + compute_a_shift_length. + * config/h8300/h8300.c (h8300_asm_insn_count): New. + (compute_a_shift_length): Likewise. + (h8300_adjust_insn_length): Do not adjust insn length of shift + insns. + * config/h8300/h8300.md (anonymous shift patterns): Use + compute_a_shift_length. + +Sat Mar 2 06:30:14 2002 Richard Kenner + + * config/sparc/sparc.c (sparc_initialize_trampoline): Use + trunc_int_for_mode. + + * emit-rtl.c (offset_address): Call update_temp_slot_address. + +2002-03-01 Kaveh R. Ghazi + + * Makefile.in (CRTSTUFF_CFLAGS): Add -fno-zero-initialized-in-bss. + * doc/invoke.texi (-fno-zero-initialized-in-bss): Document. + * flags.h (flag_zero_initialized_in_bss): Declare. + * toplev.c (flag_zero_initialized_in_bss): New flag. + (lang_independent_options): Add flag_zero_initialized_in_bss. + * tree.c (initializer_zerop): New function. + * tree.h (initializer_zerop): Declare. + * varasm.c (assemble_variable): If we can emit bss, put zero + initializers in the bss section. + +2002-03-02 Alan Modra + + * config/rs6000/rs6000.h (ASM_WEAKEN_DECL): AIX assembler doesn't + like more than one symbol per .weak directive. + +2002-03-01 Richard Henderson + + * config/ia64/ia64.c (ia64_initial_elimination_offset): Do not + adjust argument_pointer by pretend_args_size. + (ia64_va_start): Adjust va_start address by -pretend_args_size. + +2002-03-01 Kazu Hirata + + * config/h8300/h8300.c (h8300_adjust_insn_length): Clean up. + +Fri Mar 1 20:59:14 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Delete dead jumptables before + loop. + * flow.c (delete_dead_jumptables): Make global. + * rtl.h (delete_dead_jumptables): Declare. + +2002-03-01 David Edelsohn + + * config/rs6000/rs6000.h (HANDLE_PRAGMA_PACK): Delete. + * config/rs6000/darwin.h (HANDLE_SYSV_PRAGMA): Define. + * config/rs6000/xcoff.h (COLLECT_EXPORT_LIST): Delete. + +2002-03-01 Kazu Hirata + + * config/h8300/h8300-protos.h: Fix formatting. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + +2002-03-01 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Support 16-bit + constant addresses. + * config/h8300/h8300.h (TINY_CONSTANT_ADDRESS_P): New. + +2002-02-28 Richard Henderson + + * expmed.c (store_bit_field): Prevent generation of CONCATs; + pun complex values as integers; use gen_lowpart instead of + gen_rtx_SUBREG. + (extract_bit_field): Likewise. + +2002-03-01 Alan Modra + David Edelsohn + + * doc/tm.texi (ASM_WEAKEN_DECL): Document. + (ASM_WEAKEN_LABEL): Mention ASM_WEAKEN_DECL. + (SUPPORTS_WEAK): Likewise. + * output.h (add_weak): Add tree param. + * varasm.c (add_weak): Likewise. Save decl. + (struct weak_syms): Add decl field. + (mark_weak_decls): New function. + (init_varasm_once): ggc_add_root mark_weak_decls. + (assemble_start_function): Use ASM_WEAKEN_DECL. + (assemble_variable): Likewise. + (assemble_alias): Likewise. + (declare_weak): Pass decl to add_weak. + (weak_finish): Use ASM_WEAKEN_DECL. Try to find decl. + (remove_from_pending_weak_list): Declare and define for + ASM_WEAKEN_DECL. + * c-pragma.c (handle_pragma_weak): Adjust add_weak call. + * c-pragma.h (HANDLE_PRAGMA_WEAK): Define if ASM_WEAKEN_DECL too. + * defaults.h (SUPPORTS_WEAK): Likewise. + * config/rs6000/linux64.h (ASM_DECLARE_FUNCTION_NAME): Don't emit + .weak for code sym. Do emit .size for descriptor sym. + (ASM_DECLARE_FUNCTION_SIZE): Define. + * config/rs6000/rs6000.h (ASM_WEAKEN_DECL): Define. + (ASM_OUTPUT_DEF_FROM_DECLS): Don't emit .weak here. Don't output + .lglobl unless TARGET_XCOFF. Formatting fixes. + * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't emit + .weak for code sym. + (HANDLE_PRAGMA_WEAK): Remove. + (ASM_WEAKEN_LABEL): Remove. + * config/rs6000/aix.h (HANDLE_SYSV_PRAGMA): Define. + +2002-03-01 Jason Merrill + + * tree.h (TARGET_EXPR_SLOT, TARGET_EXPR_INITIAL): New macros. + (TARGET_EXPR_CLEANUP): New macro. + +2002-02-28 Steve Ellcey + + * doc/rtl.texi (SUBREG_PROMOTED_UNSIGNED_P): Change definition + to take ptr_extend into account as third type of extension. + (SUBREG_PROMOTED_UNSIGNED_SET): Definition of new macro to set bit + fields used by SUBREG_PROMOTED_UNSIGNED_P. + * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): New macro. + (SUBREG_PROMOTED_UNSIGNED_P): Change to return -1 as well as 0 or 1. + * calls.c (precompute_arguments): Use new macro. + (expand_call): Ditto. + * combine.c (nonzero_bits): Ditto. + (record_promoted_value): Ditto. + * expr.c (store_expr): Ditto. + (expand_expr): Ditto. + * function.c (assign_parms): Ditto. + +2002-02-28 Alexandre Oliva + + * gcc.c (init_gcc_specs): Get -static and -static-libgcc to + override -shared and -shared-libgcc. + +2002-02-28 David O'Brien + + * config.gcc (sparc64-*-freebsd): Explicitly accept a cpu specification + of "ultrasparc". + * config/sparc/freebsd.h: Do not use MASK_FASTER_STRUCTS. It appears + to be broken. + +2002-02-28 Richard Henderson + + * config/ia64/ia64.c (ia64_adjust_cost): All non-MM consumers have + 4 cycle latency from MM producers. + (ia64_internal_sched_reorder): Likewise with pipeline flush. + +2002-02-28 Jakub Jelinek + + * mklibgcc.in: Don't use GNU make extension. + +2002-02-28 Neil Booth + + * c-parse.in (STATIC): New terminal. + (scspec): New non-terminal. Update productions accordingly. + (program): Remove bogus ifc / end ifc. + (array_declarator): Simplify production using STATIC. + +2002-02-28 Jim Meyering + + * cpplex.c (cpp_parse_escape): Restore mistakenly-removed code: + \a still means TARGET_BELL. + +2002-02-28 Richard Henderson + + * haifa-sched.c (sched_emit_insn): New. + (schedule_block): Use last_scheduled_insn to track last insn. + * sched-int.h (sched_emit_insn): Prototype. + * config/ia64/ia64.c (last_issued): Remove. + (ia64_variable_issue): Don't set it. + (nop_cycles_until): Use sched_emit_insn. + +2002-02-28 Andrew MacLeod + + * config/sparc/sparc.c (sparc64_initialize_trampoline): Generate sign + extended constants. + +2002-02-28 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + * config/h8300/h8300.h: Likewise. + +2002-02-28 Marek Michalkiewicz + + * config/avr/avr.c (avr_hard_regno_mode_ok): Do not allow r29 + which may overwrite the high byte of the frame pointer. + +2002-02-28 Bo Thorsen + + * config/i386/linux64.h (LINK_SPEC): Fix 32/64 bit compilation. + (STARTFILE_SPEC): Add 64 bit files. + (ENDFILE_SPEC): Likewise. + +2002-02-28 Jason Merrill + + * c-decl.c (finish_function): Only warn about missing return + statement with -Wreturn-type. + +Don Feb 28 11:24:30 CET 2002 Jan Hubicka + + * cfgrtl.c (purge_dead_edges): Fix handling of EH edges. + + * i386.h (CONDITIONAL_REGISTER_USAGE): Do not write to + PIC_OFFSET_TABLE_REGNUM when it is INVALID_REGNUM + +Don Feb 28 11:07:36 CET 2002 Jan Hubicka + + * basic-block.h (BB_REACHABLE): Renumber. + (BB_DIRTY, BB_NEW): New flags. + (clear_bb_flags): Declare. + (update_life_info_in_dirty_blocks): Declare. + * cfg.c (clear_bb_flags): New function. + * cfgrtl.c (create_basic_block_structure): Set flags to BB_NEW. + * emit-rtl.c (add_insn_after, add_insn_before, remove_insn, + reorder_insns, emit_insn_after): Mark block as dirty. + * flow.c (update_life_info): Fix clearing of PROP_LOG_LINKS. + (update_life_info_in_dirty_blocks): New function. + * recog.c (apply_change_group): Dirtify block. + + * cse.c (cse_insn): Reorder emitting of jump insn to keep + cfg consistent. + * gcse.c (delete_null_pointer_checks): Likewise. + + * toplev.c (dump_file_index): Move cse2 after bp, + add DFI_null + (dump_file_info): Similary. + (rest_of_compilation): Avoid most of CFG rebuilds; + do first if converision after null pointer checks, do cse2 + after branch prediction; avoid full liveness rebuild after + initializing subregs. + * invoke.texi (-d options): Document -du, renumber. + + * cfgcleanup.c (bb_flags): Remove BB_UPDATE_LIFE. + (notice_new_block): Do not set BB_UPDATE_LIFE. + (try_forward_edges, merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps, merge_blocks, + try_crossjump_to_edge): Likewise. + (try_optimize_cfg): Likewise; use update_life_info_in_dirty_blocks. + * cfgrtl.c (merge_blocks_nomove): Copy b's flags to a. + * ifcvt.c (SET_UPDATE_LIFE, UPDATE_LIFE): Kill. + (merge_of_block): Do not use life_data_ok. + (find_if_case_1): Do not use SET_UPDATE_LIFE. + (if_convert): Use BB_DIRTY mechanizm to update life. + * lcm.c (optimize_mode_switching): Update + update_life_info_in_dirty_blocks + +2002-02-28 Neil Booth + + * Makefile.in (integrate.o): Update. + * c-decl.c (copy_lang_decl): Rename. + * c-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. + * integrate.c: Include langhooks.h. + (copy_decl_for_inlining): Update to use langhook. + * langhooks-def.h (lhd_do_nothing_t, + LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_do_nothing_t): New. + * langhooks.h (struct lang_hooks): Add dup_lang_specific_decl. + * tree.h (copy_lang_decl): Remove. +objc: + * objc-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. + +2002-02-27 Andrew MacLeod + + * dwarf2out.c (stack_adjust_offset): Add support for POST_INC, + POST_DEC, and POST_MODIFY. + +2002-02-27 Zack Weinberg + + * c-typeck.c (digest_init): Remove unused parameter; all + callers changed. + +2002-02-27 Geoffrey Keating + + * expmed.c (expand_shift): Correctly test for low part of a + subreg. + +2002-02-27 Ulrich Weigand + + * config/s390/s390.c (s390_chunkify_pool): Do not confuse + insn UIDs with insn addresses. + +2002-02-27 Zack Weinberg + + * c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in, + c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h, + cppmacro.c, objc/lang-specs.h, objc/objc-act.c, + builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c, + gcc.c, toplev.c: Delete code implementing -traditional mode. + + * doc/bugreport.texi, doc/cpp.texi, doc/extend.texi, + doc/invoke.texi, doc/standards.texi, doc/trouble.texi: + Document removal of -traditional mode for compilation, and + remove documentation only relevant to that mode. + + * config/nextstep.h, config/ptx4.h, config/svr4.h, + config/convex/convex.h, config/d30v/d30v.h, + config/i386/dgux.h, config/i386/osf1elf.h, + config/i386/osfelf.h, config/i386/osfrose.h, + config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h, + config/m68k/hp310.h, config/m88k/dgux.h, + config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c, + config/m88k/m88k.h, config/m88k/openbsd.h, + config/mips/abi64.h, config/mips/osfrose.h, + config/mips/svr4-5.h, config/mips/svr4-t.h, + config/sparc/sol2-sld-64.h, config/sparc/sol2.h, + config/stormy16/stormy16.h: Remove all references to + -traditional from target specs. Delete all mention of the + no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also + delete a couple of commented-out definitions of + DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring + to -traditional. + + * system.h: Poison TRADITIONAL_RETURN_FLOAT. + * doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro. + +2002-02-27 Zack Weinberg + + * mklibgcc.in: Don't use \n in a line subject to + interpretation by echo. + +2002-02-27 Graham Stott + + * config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DELC): + Constify NAME. + + * loop.c (prescan_loop): Handle PARALLEL. + + * unroll.c (loop_iterations): Return 0 if the add_val for + a BIV is REG. + + * final.c (output_operand_lossage): Constify PFX_STR. + + * df.c (df_insn_refs_record): Use XEXP (x, 0) for USE. + +Wed Feb 27 10:45:19 CET 2002 Jan Hubicka + + * linux64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Remove. + * x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Allways define. + +Wed Feb 27 10:39:20 CET 2002 Jan Hubicka + + * linux64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define. + +2002-02-27 Neil Booth + + * cpplex.c (_cpp_lex_token): Handle directives in macro + arguments. + * cpplib.c (_cpp_handle_directive): Save and restore state + if parsing macro args when entering a directive. + * cppmacro.c (collect_args): No need to handle directives + in macro arguments. + (enter_macro_context, replace_args): Use the original macro + definition in case it was redefined whilst collecting arguments. +doc: + * cpp.texi: Update. + +2002-02-26 David Edelsohn + + * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Delete. + * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Delete. + * config/rs6000/rs6000.c (rs6000_return_addr): Use efficient + method on AIX. + * config/rs6000/rs6000.md (movsi_low): Use gpc_reg_operand. + (movsi_low_st, movdf_low, movdf_low_st, movsf_low, movsf_low_st): Same. + (load_toc_v4_PIC_2): Same. + +2002-02-26 Alan Modra + + * config/rs6000/rs6000.md (load_toc_aix_di): Handle TARGET_RELOCATABLE. + +2002-02-26 Richard Henderson + + * config/alpha/alpha.md (ashldi_se): Re-enable. + +2002-02-26 Richard Henderson + + * config/alpha/alpha.c (alpha_encode_section_info): Examine + MODULE_LOCAL_P; improve commentary. + +2002-02-26 Zack Weinberg + + * doc/cpp.texi: Clarify documentation of relationship between + #line and #include. + +2002-02-26 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + compute_logical_op_length. Add the prototype for + compute_logical_op_cc. + * config/h8300/h8300.c (compute_logical_op_length): Figure out + code from operands. + (compute_logical_op_cc): New. + * config/h8300/h8300.md: Combine all the logical op patterns + in HImode and SImode. Use compute_logical_op_cc. + +2002-02-26 Kelley Cook + + * config/i386/i386.c (print_operand): Don't append ATT-style + length suffixs to x87 opcodes when in Intel mode. + +2002-02-26 Ryan T. Sammartino + + * emit-rtl.c (gen_const_vector_0): Remove TYPE argument. + (init_emit_once): Update calls. + * fixinc/gnu-regex.c (_GNU_SOURCE): Remove. + (init_syntax_once): Prototype. + +2002-02-26 John David Anglin + + * pa-linux.h (LIB_SPEC): Update definition. + * pa32-linux.h (LINK_COMMAND_SPEC): Delete. + +2002-02-26 Richard Henderson + + * config/ia64/ia64.c (nop_cycles_until): Do init_insn_group_barriers + if we emitted a stop bit. + +2002-02-26 Jakub Jelinek + + * configure.in (libgcc_visibility): Substitute. + * configure: Rebuilt. + * mklibgcc.in: If libgcc_visibility = yes, make libgcc.a global + defined symbols .hidden. + +2002-02-26 Jakub Jelinek + + * attribs.c (c_common_attribute_table): Add visibility. + (handle_visibility_attribute): New function. + * varasm.c (assemble_visibility): New function. + * output.h (assemble_visibility): Add prototype. + * tree.h (MODULE_LOCAL_P): Define. + * crtstuff.c (__dso_handle): Use visibility attribute. + * config/i386/i386.h (ENCODE_SECTION_INFO): Set SYMBOL_REF_FLAG + for MODULE_LOCAL_P symbols too. + * config/ia64/ia64.c (ia64_encode_section_info): Handle + MODULE_LOCAL_P symbols the same way as local symbols. + Add SDATA_NAME_FLAG_CHAR even if decl was explicitely forced + into .sdata/.sbss by the user. + * doc/extend.texi (Function Attributes): Document visibility + attribute. + +2002-02-26 Jakub Jelinek + + PR debug/5770 + * dwarf2out.c (rtl_for_decl_location): Return CONST_STRING for + STRING_CST initializer spanning the whole variable without + embedded zeros. + If expand_expr returned MEM, don't use it. + +2002-02-26 Alexandre Oliva + + * dwarf2out.c (gen_inlined_subroutine_die): If block is abstract, + generate a die for the lexical block. + +2002-02-26 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + compute_logical_op_length. + * config/h8300/h8300.c (compute_logical_op_length): New. + * config/h8300/h8300.md (anonymous logical patterns): Use + compute_logical_op_length for length. + +2002-02-26 Aldy Hernandez + + * dwarf2out.c (modified_type_die): Do not call type_main_variant + for vectors. + (gen_type_die): Same. + + * attribs.c (handle_vector_size_attribute): Set debug information. + +2002-02-26 Daniel Egger + + * config/rs6000/rs6000.md: Swap define_insn attributes to + fix incorrect generation of merge high instructions instead + of merge low. + +2002-02-26 Aldy Hernandez + + * c-typeck.c (really_start_incremental_init): Use + bitsize_zero_node for vectors. + +2002-02-26 Aldy Hernandez + + * config/rs6000/rs6000.md (get_vrsave_internal): Fix typo. + ("*set_vrsave_internal"): Same. + +2002-02-25 Richard Henderson + + * expr.c (expand_expr) [MULT_EXPR]: Do not apply distributive law + in EXPAND_SUM case. Use host_integerp/tree_low_cst. + +2002-02-25 Jakub Jelinek + + PR target/5755 + * config/i386/i386.c (ix86_return_pops_args): Only pop + fake structure return argument if it was passed on the stack. + +2002-02-25 Jason Merrill + + * attribs.c (decl_attributes): Also re-layout PARM_DECL and + RESULT_DECL. + +2002-02-25 Alexandre Oliva + + * gcc.c (init_gcc_specs): Get -shared-libgcc along with -shared to + link with shared_name only. + * doc/invoke.texi (Link Options): Document new behavior. + +2002-02-25 Aldy Hernandez + + * c-typeck.c (push_init_level): Handle vectors. + +2002-02-25 Alexandre Oliva + + * config/sparc/sparc.c (const64_high_operand): Zero-extend + operands of SPARC_SETHI_P. + (input_operand): Likewise. + (sparc_emit_set_const32): Likewise. + * config/sparc/sparc.h (SPARC_SETHI_P): Disregard TARGET_ARCH64. + (SPARC_SETHI32_P): Zero-extend operand from 32 bits. + (CONST_OK_FOR_LETTER_P): Use SETHI32 for `K'. Add `N' as SETHI. + * config/sparc/sparc.md (movdi_insn_sp64_novis): Use `N'. + (movdi_insn_sp64_vis): Likewise. + (movdi split, movdf split): Use SETHI32. + * doc/md.texi: Document SPARC constraints L, M and N. + +2002-02-25 Aldy Hernandez + + * config/rs6000/rs6000.md ("get_vrsave_internal"): New. + ("*set_vrsave_internal"): use mfspr for Darwin. + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Call + gen_get_vrsave_internal. + +Sun Feb 24 16:38:56 2002 Richard Kenner + + * optabs.c (widen_operand): Properly handle CONST_INT for NO_EXTEND. + +2002-02-24 Neil Booth + + * cpplex.c (cpp_interpret_charconst): Get signedness or + otherwise of wide character constants correct. + * cppexp.c (lex): Get signedness of wide charconsts correct. + +Sun Feb 24 07:41:31 2002 Richard Kenner + + * optabs.c (widen_operand): Only call convert_modes for + promoted SUBREG if signedness matches. + * config/alpha/alpha.md (*addsi_se2, *subsi_se2): New patterns. + +2002-02-23 Neil Booth + + * cpplib.c (glue_header_name): Use local buffer to build up + header name. + +2002-02-23 Neil Booth + + * doc/cpp.texi, doc/invoke.texi: Update documentation for -MM. + +2002-02-23 Kazu Hirata + + * config/h8300/h8300.c (output_simode_bld): Handle H8/300 and + H8/300[HS] separately. + * config/h8300/h8300.md: Remove the early clobber constraint + from bit field patterns. + +2002-02-23 Kazu Hirata + + * config/h8300/h8300.md (mulqihi3): Tighten predicates to + register_operand. + (mulhisi3): Likewise. + (umulqisi3): Likewise. + (umulhisi3): Likewise. + +2002-02-23 Neil Booth + + * cppinit.c (output_deps): Correct test for stdout output. + (init_dependency_output): Cure warning. + +Sat Feb 23 08:42:47 2002 Richard Kenner + + * expr.c (store_expr): When converting expression to promoted + equivalent type, allow using SUBREG_REG of TARGET as the target + of the expansion of EXP. + * loop.c (basic_induction_var, case SUBREG): Always look inside. + * config/alpha/alpha.c (rtx_equiv_function_matters): Delete decl. + (alpha_emit_set_const): Handle SImode when can't make new pseudos. + (alpha_emit_set_const_1, alpha_sa_mask): Use no_new_pseudos. + * config/alpha/alpha.md (addsi3, subsi3): Don't use if optimizing. + +2002-02-23 Joseph S. Myers + + * doc/contribute.texi, doc/extend.texi, doc/install.texi, + doc/invoke.texi, doc/md.texi, doc/passes.texi, doc/rtl.texi, + doc/standards.texi, doc/tm.texi: Remove trailing whitespace. + +2002-02-23 Jakub Jelinek + + PR optimization/5747 + * loop.c (scan_loop): Update reg info if move_movables created new + pseudos. + +2002-02-23 David Edelsohn + + * gcc.c (init_gcc_spec): Revert last change. + +2002-02-23 David Edelsohn + + * config/rs6000/rs6000.md (load_toc_aix_{si,di}): Use + gpc_reg_operand constraint. + +2002-02-23 Alan Modra + + * config/rs6000/rs6000.c (num_insns_constant): Fix formatting. + Simplify comparison of `low'. + (add_operand): Fix formatting. + (non_add_cint_operand): Use CONST_OK_FOR_LETTER_P. + (mask_operand): Disallow mask to wrap in 64-bit mode. + (rs6000_stack_info): Remove redundant test setting push_p. + (output_toc): Fix formatting. + * config/rs6000/rs6000.md (boolsi3, boolcsi3 splitters): Use + cc_reg_not_cr0_operand constraint. + (booldi3, boolcdi3 splitters): Same. + +2002-02-23 Aldy Hernandez + + * config/rs6000/altivec.h: Add extra level of parentheses on casts. + +2002-02-22 David Edelsohn + + * gcc.c (init_gcc_spec): Do not link with static libgcc.a if + gcc invoked with -shared-libgcc. + +2002-02-22 Jakub Jelinek + + PR c++/5748 + * stmt.c (expand_anon_union_decl): Set TREE_USED on the anon union + decl if any of elements was TREE_USED. + +2002-02-22 Alexandre Oliva + + * config/sparc/sol2.h: Don't include sys/mman.h. + * config/sparc/sparc.c (arith_operand): Use SMALL_INT32. + (arith_4096_operand): Don't throw high bits away. + (const64_operand): Take sign extension of CONST_INTs into account. + (const64_high_operand, sparc_emit_set_const32): Likewise. + (GEN_HIGHINT64): Likewise. + (sparc_emit_set_const64_quick1): Likewise. + (const64_is_2insns): Likewise. + (print_operand): Use trunc_int_for_mode for sign extension. + * config/sparc/sparc.h (SMALL_INT32): Likewise. + * config/sparc/sparc.md (movqi): Sign-extend CONST_DOUBLE + chars. Assume CONST_INT is already properly sign-extended. + (movdi split): Sign-extend each SImode part. + (andsi3 split): Don't mask high bits off, so that result + remains properly sign-extend. + (iorsi3 split): Likewise. + (xorsi3 split): Likewise. + +2002-02-22 Richard Sandiford + + * fold-const.c (fold): Fix typo in comments. + +2002-02-21 Diego Novillo + + * Makefile.in (langhooks.o): Update dependencies. + +2002-02-21 Diego Novillo + + * langhooks.c: Include flags.h. + +2002-02-21 Aldy Hernandez + + * testsuite/gcc.dg/attr-alwaysinline.c: New. + + * c-common.c (c_common_post_options): Set inline trees by + default. + + * doc/extend.texi (Function Attributes): Document always_inline + attribute. + Update documentation about inlining when not optimizing. + + * cp/decl.c (duplicate_decls): Merge always_inline attribute. + + * cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0 + unless DECL_ALWAYS_INLINE. + + * c-objc-common.c (c_cannot_inline_tree_fn): Do not inline at -O0 + unless DECL_ALWAYS_INLINE. + (c_disregard_inline_limits): Disregard if always_inline set. + + * langhooks.c (lhd_tree_inlining_disregard_inline_limits): + Disregard if always_inline set. + (lhd_tree_inlining_cannot_inline_tree_fn): Do not inline at -O0 + unless DECL_ALWAYS_INLINE. + + * attribs.c (handle_always_inline_attribute): New. + (c_common_attribute_table): Add always_inline. + + * config/rs6000/altivec.h: Add prototypes for builtins + requiring the always_inline attribute. + +2002-02-21 Eric Christopher + + * expmed.c (store_bit_field): Try to simplify the subreg + before generating a new one when when the mode size of + value is less than maxmode. + +2002-02-21 Richard Henderson + + * emit-rtl.c (offset_address): Use simplify_gen_binary rather + than gen_rtx_PLUS to form the sum. + * explow.c (force_reg): Rearrange to not allocate new pseudo + when force_operand returns a register. + * expr.c (expand_assignment): Allow offset_rtx expansion to + return a sum. Do not force addresses into registers. + (expand_expr): Likewise. + * simplify-rtx.c (simplify_gen_binary): Use simplify_plus_minus + to canonicalize arithmetic that didn't simpify. + (simplify_plus_minus): New argument force; update + all callers. Don't split CONST unless we can do something with it, + and wouldn't lose the constness of the operands. + + * config/i386/i386.c (legitimize_pic_address): Recognize UNSPECs + that we generated earlier. + +2002-02-21 Tom Tromey + + * dwarf2out.c (DWARF_LINE_MIN_INSTR_LENGTH): Removed. + (output_line_info): Use constant `1', with a long explanatory + comment. + * system.h (DWARF_LINE_MIN_INSTR_LENGTH): Poison. + +Thu Feb 21 22:43:44 2002 J"orn Rennecke + + * jump.c (redirect_jump): If old label has no UID, don't try to + delete it. + +Thu Feb 21 21:17:21 2002 J"orn Rennecke + + * sh.md (insv): Provide byte offsets for gen_rtx_SUBREG. + If input is constant, do shifts at compile time. + +2002-02-21 Joseph S. Myers + + * doc/extend.texi: Fix some more overfull hboxes. + +2002-02-21 Jakub Jelinek + + PR optimization/4994 + * config/i386/i386.md (movsi_1, movsf_1): Support MMX -> MMX + register moves. + +2002-02-21 Jakub Jelinek + + PR c++/4574 + * expr.h (expand_and): Add mode argument. + * expmed.c (expand_and): Add mode argument. + (expand_mult_highpart_adjust, emit_store_flag): Adjust callers. + * expr.c (store_field, expand_expr, do_store_flag): Likewise. + * except.c (expand_builtin_extract_return_addr): Likewise. + * config/alpha/alpha.c (alpha_initialize_trampoline): Likewise. + * config/sparc/sparc.c (sparc_initialize_trampoline): Likewise. + * config/c4x/c4x.h (INITIALIZE_TRAMPOLINE): Likewise. + Use GEN_INT (x) instead of gen_rtx (CONST_INT, VOIDmode, x). + * config/c4x/c4x.md: Use GEN_INT (x) instead of + gen_rtx (CONST_INT, VOIDmode, x). + +2002-02-21 Jakub Jelinek + + PR c/4697: + * stmt.c (warn_if_unused_value): Move side effects test once more. + +2002-02-20 Torbjorn Granlund + + * config/avr/avr.md: Add more patterns for mized-mode add and subtract + (addsi3_zero_extend, subhi3_zero_extend1, subsi3_zero_extend). + +Thu Feb 21 16:20:46 2002 Alexandre Oliva + + * rtlanal.c (replace_rtx): Don't make a CONST_INT the operand of + SUBREG or ZERO_EXTEND. + +Thu Feb 21 15:35:46 2002 J"orn Rennecke + + * sh.h (current_function_anonymous_args): Remove. + (SETUP_INCOMING_VARARGS): Don't set it - just check that one + of current_function_varargs and current_function_stdarg is set. + * sh.c (sh_expand_prologue): Check current_function_varargs / + current_function_stdarg / TARGET_SH5 instead of + current_function_anonymous_args. + + * sh64.h (TARGET_VERSION): Define. + +2002-02-20 David Edelsohn + + * config/rs6000/rs6000.h (EPILOGUE_USES): Conditionalize + VRSAVE_REGNO on TARGET_ALTIVEC. + +2002-02-20 Alan Modra + + * config/rs6000/rs6000.c (includes_lshift_p): Mask irrelevant + bits of SImode const_int. + (includes_rshift_p): Likewise. + (print_operand): Call mask_operand and mask64_operand with correct + mode. + (rs6000_output_function_epilogue): Pad traceback table to word. + * config/rs6000/rs6000.h (MASK_64BIT): Correct comment. + (EXTRA_CONSTRAINT, 'S' and 'T'): Call mask_operand and + mask64_operand with correct mode. + (FUNCTION_ARG_REGNO_P): Correct parentheses. + +2002-02-20 Jakub Jelinek + + PR debug/4461 + * varasm.c (get_pool_constant_mark): New. + * rtl.h (get_pool_constant_mark): Add prototype. + * dwarf2out.c (mem_loc_descriptor): A pool constant cannot + be represented if it has not been output. + +2002-02-20 Alexandre Oliva + + * combine.c (do_SUBST): Sanity check substitutions of + CONST_INTs, and reject them in SUBREGs and ZERO_EXTENDs. + (subst): Simplify SUBREG or ZERO_EXTEND instead of SUBSTing a + CONST_INT into its operand. + (known_cond): Likewise, for ZERO_EXTEND. + * simplify-rtx.c (simplify_unary_operation): Fix condition to + allow for simplification of wide modes. Reject CONST_INTs in + ZERO_EXTEND when their actual mode is not given. + +2002-02-20 Alexandre Oliva + + * c-decl.c (pushdecl): If no global declaration is found for an + extern declaration in block scope, try a limbo one. + +2002-02-20 Jakub Jelinek + + PR c++/4401 + * c-common.c (pointer_int_sum): Moved from... + * c-typeck.c (pointer_int_sum): ...here. + * c-common.h (pointer_int_sum): Add prototype. + +2002-02-20 Jakub Jelinek + + PR c++/5713 + * c-decl.c (duplicate_decls): Return 0 if issued error about + redeclaration. + +2002-02-20 Roger Sayle + Jakub Jelinek + + PR c/4389 + * tree.c (host_integerp): Ensure that the constant integer is + representable in a HOST_WIDE_INT or an unsigned HOST_WIDE_INT + when pos is zero or nonzero respectively. Clarify comment. + * c-format.c (check_format_info_recurse): Fix host_integerp + usage; the pos argument should be zero when assigning to a + signed HOST_WIDE_INT. + +2002-02-20 Richard Henderson + + * config/i386/i386.c (ix86_expand_vector_move): Use the mode + of the operand, rather than assuming TImode. + (ix86_expand_binop_builtin): Cope with commutative patterns + using nonimmediate_operand for both operands. + (ix86_expand_timode_binop_builtin): Likewise. + (ix86_expand_store_builtin): Validate operand 1. + (ix86_expand_unop1_builtin): Likewise. + +2002-02-20 Philip Blundell + + PR 5705 + * config/arm/arm.h (HARD_REGNO_RENAME_OK): New macro. + +2002-02-20 Richard Henderson + + PR c/5615 + * expr.h (ARGS_SIZE_TREE): Convert size.var to ssizetype. + +2002-02-20 Tom Tromey + + * config/fr30/fr30.h (DWARF_LINE_MIN_INSTR_LENGTH): Removed. + * config/sh/sh.h (DWARF_LINE_MIN_INSTR_LENGTH): Removed. + * config/pj/pj.h (DWARF_LINE_MIN_INSTR_LENGTH): Removed. + * config/cris/cris.h (DWARF_LINE_MIN_INSTR_LENGTH): Removed. + * dwarf2out.c (DWARF_LINE_MIN_INSTR_LENGTH): Define + unconditionally. + +Wed Feb 20 00:03:25 EST 2002 Alan Matsuoka + + * config/rs6000/rs6000.h (LEGITIMATE_OFFSET_ADDRESS_P): Look + for (const_int 0) in X not just INTVAL. + +2002-02-20 Joseph S. Myers + + * doc/extend.texi: Avoid or reduce overfull hboxes. + +2002-02-20 Diego Novillo + + * expmed.c (store_bit_field): Do not store bit fields using SUBREG + operations if the field does not start at a mode boundary. + +2001-02-20 Joel Sherrill + + * config/a29k/rtems.h, config/arm/rtems-elf.h, config/h8300/rtems.h, + config/mips/rtems.h: Use new style of -Asystem= rather than -Asystem(). + Also done for -Acpu and -Amachine. + +2002-02-20 Neil Booth + + * cppinit.c (init_dependency_output): Take deps output file + from -o if none given with -MF. Suppress normal output. + * gcc.c (cpp_unique_options): Have -M and -MM imply -E. + * doc/cpp.texi, doc/invoke.texi: Update. + +2002-02-19 Zack Weinberg + + * toplev.c (output_quoted_string): Write unprintable + characters with octal escapes. + +2002-02-19 David Edelsohn + + * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Set + really_call_used[VRSAVE_REGNO] if not Altivec. + +2002-02-19 Alan Modra + + * config/rs6000/rs6000.c (u_short_cint_operand): Mask op with + MODE_MASK. + (constant_pool_expr_1): Fix formatting. + (rs6000_legitimize_reload_address): Likewise. + +Tue Feb 19 20:13:57 2002 Richard Kenner + + * config/sparc/sparc.md (nonlocal_goto): Use hard_frame_pointer_rtx + now that we have one. + +2002-02-19 Zack Weinberg + + * tree.h (struct tree_common): Remove aux. Add unused_0 at + end of first block of bitfields (which was only seven bits); + rename dummy to unused_1; remove comment which is no longer true. + +2002-02-19 Gaute B Strokkenes + + * doc/c-tree.texi (Classes, TYPE_BINFO): Fix typo. + +2002-02-19 Philip Blundell + + PR 5399 + * config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept anything + if generating PIC. + + PR 5054 + * config/arm/arm.md (call_insn) [TARGET_THUMB]: Use + arm_is_longcall_p rather than inspecting call-type cookie + directly. + (call_value_insn) [TARGET_THUMB]: Likewise. + +2002-02-19 Graham Stott + + * config/i386/i386.c (ix86_expand_builtin): Fix typo. + +2002-02-19 David Edelsohn + + * config/rs6000/linux64.h (LINK_OS_LINUX_SPEC): Look in /lib64. + ({STARTFILE,ENDFILE}_LINUX_SPEC): Define. + (FP_SAVE_INLINE): Delete. + + * config/rs6000/sysv4.h (ENDFILE_SPEC): Add crtsaveres.o. + * config/rs6000/eabi.asm: Remove ABI save restore routines. + * config/rs6000/t-ppccomm: Build crtsavres.o. + * config/rs6000/crtsavres.asm: New file. + +2002-02-19 Philip Blundell + + * config/arm/arm.c (use_return_insn): Don't reject interrupt + functions. + (arm_compute_save_reg_mask): Save LR for interrupt functions too. + (output_return_instruction): Allow interrupt functions to return with + ldmfd sp!, {... pc}^. Use LDR to restore any single register. + (arm_expand_prologue): Subtract 4 before stacking LR in an + interrupt function. + +2002-02-19 Philip Blundell + + * config/arm/arm.c (arm_encode_call_attribute): Operate on any + decl, not just FUNCTION_DECL. + (legitimize_pic_address): Handle local SYMBOL_REF like LABEL_REF. + (arm_assemble_integer): Likewise. + * config/arm/arm.h (ARM_ENCODE_CALL_TYPE): Allow any decl to be + marked local. + +2002-02-19 matthew green + + * config.gcc (sparc-*-netbsdelf*): Enable target. + (sparc64-*-netbsd*): New target. + * config/sparc/netbsd-elf.h: New file. + * config/sparc/t-netbsd64: New file. + +2002-02-19 Gaute B Strokkenes + + * doc/rtl.texi (Flags, MEM_SCALAR_P): Fix typo. + +2002-02-19 Ryan T. Sammartino + + * doc/invoke.texi: explicitly list the style guidelines that + -Weffc++ checks for. + +Tue Feb 19 12:37:23 CET 2002 Jan Hubicka + + * regmove.c (regmove_optimize): Avoid increasing of register pressure. + +2002-02-19 Neil Booth + + PR other/5718 + * gcc.c (cpp_unique_options): Treat -o as indicating object file + only if not -E. If -E, pass -o through to the preprocessor. + +2002-02-19 Kazu Hirata + + * config/h8300/h8300.h (REGNO_REG_CLASS): Replace a literal + register number with an appropriate macro. + +2002-02-19 Bryce McKinlay + + * doc/rtl.texi (Constants): Close @code tag. + +2002-02-19 Aldy Hernandez + + * config/i386/i386.md ("mmx_uavgv8qi3"): Use const_vector. + ("mmx_uavgv4hi3"): Same. + ("pmulhrwv4hi3"): Same. + + * tree-inline.c (walk_tree): Handle vectors. + + * c-common.c (constant_expression_warning): Handle vectors. + (overflow_warning): Same. + + * sched-deps.c (sched_analyze_2): Handle vectors. + + * rtlanal.c (rtx_unstable_p): Handle vectors. + (rtx_varies_p): Same. + (count_occurrences): Same. + (regs_set_between_p): Same. + (modified_between_p): Same. + (modified_in_p): Same. + (volatile_insn_p): Same. + (volatile_refs_p): Same. + (side_effects_p): Same. + (may_trap_p): Same. + (inequality_comparisons_p): Same. + (replace_regs): Same. + (computed_jump_p_1): Same. + + * rtl.c (DEF_MACHMODE): Change all definitions to accept 8th + argument. + (inner_mode_array): New. + (copy_rtx): Handle vectors. + (copy_most_rtx): Same. + (rtx_equal_p): Same. + (get_mode_alignment): Adjust for vectors. + + * resource.c (mark_referenced_resources): Handle vectors. + (mark_set_resources): Same. + + * reload1.c (eliminate_regs): Handle vectors. + (elimination_effects): Same. + (scan_paradoxical_subregs): Same. + + * reload.c (subst_reg_equivs): Handle vectors. + + * regrename.c (scan_rtx): Handle vectors. + + * regclass.c (reg_scan_mark_refs): Handle vectors. + + * recog.c (find_single_use_1): Handle vectors. + + * local-alloc.c (equiv_init_varies_p): Handle vectors. + (contains_replace_regs): Same. + (memref_referenced_p): Same. + + * integrate.c (copy_rtx_and_substitute): Handle vectors. + (subst_constants): Same. + + * genattrtab.c (attr_copy_rtx): Handle vectors. + (encode_units_mask): Same. + (clear_struct_flag): Same. + (count_sub_rtxs): Same. + + * gcse.c (want_to_gcse_p): Handle vectors. + (oprs_unchanged_p): Same. + (hash_expr_1): Same. + (oprs_not_set_p): Same. + (expr_killed_p): Same. + (compute_transp): Same. + (store_ops_ok): Same. + + * function.c (purge_addressof_1): Do not allow paradoxical subregs + of vectors. + (fixup_var_refs_1): Same. + (instantiate_virtual_regs_1): Same. + + * fold-const.c (operand_equal_p): Handle vectors. + (fold): Same. + (rtl_expr_nonnegative_p): Same. + + * flow.c (mark_used_regs): Handle vectors. + + * df.c (df_uses_record): Handle vectors. + + * cselib.c (cselib_subst_to_values): Handle vectors. + (cselib_mem_conflict_p): Same. + (hash_rtx): Same. + + * cse.c (canon_reg): Handle vectors. + (fold_rt): Same. + (cse_process_notes): Same. + (count_reg_usage): Same. + (canon_hash): Same. + + * alias.c (nonlocal_mentioned_p): Add case for CONST_VECTOR. + + * combine.c (mark_used_regs_combine): Add case for CONST_VECTOR. + + * emit-rtl.c (init_emit_once): Generate const0_rtx for vectors. + (gen_rtx): Handle CONST_VECTOR. + (gen_const_vector_0): New. + (copy_rtx_if_shared): CONST_VECTORs can be shared. + (reset_used_flags): Same. + (copy_insn_1): Same. + (initializer_constant_valid_p): Handle VECTOR_CST. + + * doc/c-tree.texi (Expression trees): Document VECTOR_CST. + + * doc/rtl.texi (Constants): Document const_vector. + (CONST0_RTX): Update for vectors. + (RTL sharing): Same. + + * print-tree.c (print_node): Add case for VECTOR_CST. + + * tree.h (TREE_VECTOR_CST_ELTS): New. + (struct tree_vector): New. + (union tree_node): Add vector node. + (build_vector): Add prototype. + + * tree.def (VECTOR_CST): New. + + * tree.c (build_vector): New. + + * expmed.c (make_tree): Handle CONST_VECTOR. + + * rtl.h (CONSTANT_P): CONST_VECTORs are constants too. + (CONST_VECTOR_ELT): New. + (CONST_VECTOR_NUNITS): New. + + * machmode.h (GET_MODE_INNER): New. + (DEF_MACHMODE): Accept 8th arg. + + * machmode.def: Add 8th argument for vector inner mode. + Add inner vector modes for vectors. + + * rtl.def (VEC_CONST): Remove. + (CONST_VECTOR): New. + + * expr.c (clear_storage): Allow vectors. + (is_zeros_p): Handle VECTOR_CST. + + * varasm.c (output_constant_pool): Handle vectors. + (rtx_const): Add veclo and vechi fields. + (kind): Add RTX_VECTOR. + (decode_rtx_const): Add case for vector. + + * config/rs6000/rs6000-protos.h: Add zero_constant. + + * config/rs6000/rs6000.c (rs6000_emit_move): Handle vector + constants. Force easy vector constants into memory. + (easy_vector_constant): New. + (emit_easy_vector_constant): New. + (rs6000_legitimize_reload_address): Do not generate bad reloads on + darwin. + + * config/rs6000/rs6000.md ("altivec_lvx"): Reflect what + instruction does. + ("altivec_lvxl"): Same. + (altivec_lvebx): Same. + (altivec_lvehx): Same. + (altivec_lvewx): Same. + ("*movv4si_const0"): New. + ("*movv4sf_const0"): New. + ("*movv8hi_const0"): New. + ("*movv16qi_const0"): New. + +2002-02-18 Kazu Hirata + + * config/h8300/h8300.c (notice_update_cc): Use + cc_status.value2. + +2002-02-18 Kazu Hirata + + * config/h8300/h8300.md (divmod patterns): Change the + constraints for operands[1] to register_operand. + +2002-02-18 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove the prototype for + p_operand. + * config/h8300/h8300.c (p_operand): Remove. + * config/h8300/h8300.md: Replace p_operand with + const_int_operand. + +2002-02-18 Philip Blundell + + * config/arm/arm.c (arm_compute_save_reg_mask): Fix typo in + comment. + (output_return_instruction): Allow use of LDR to unstack + return addresss even for interrupt handlers or when + interworking. If compiling for ARMv5, use interworking-safe + return instructions by default. Remove duplicated code and + lengthy "strcat" sequences. + +2002-02-18 Franz Sirl + + * config/rs6000/sysv4.h (STARTFILE_SPEC): Use crtbeginT.o for -static. + (LINK_EH_SPEC): Define. + * config/rs6000/t-ppccomm (EXTRA_MULTILIB_PARTS): Add crtbeginT.o. + +2002-02-18 Ulrich Weigand + + * config/s390/s390.c (s390_emit_prologue): Do not set the + frame_related flag for call-clobbered registers. + +Mon Feb 18 15:07:35 CET 2002 Jan Hubicka + + * i386.c (classify_argument): Properly classify SSE/MMX modes and VOIDmode. + (construct_container): Fix handling of SSE operands. + (ix86_expand_builtin): Fix handling of 64bit pointers. + (mmx_maskmovq_rex): New pattern. + +Mon Feb 18 11:55:55 CET 2002 Jan Hubicka + + * regrename.c (kill_set_value): Handle subregs properly. + +2002-02-18 David Billinghurst + + * objc/objc-act.c (handle_impent): Remove leading '*' + from objc_class_name. + +2002-02-17 Richard Henderson + + * config/alpha/alpha.c (some_small_symbolic_operand, + some_small_symbolic_operand_1, split_small_symbolic_operand, + split_small_symbolic_operand_1): Rename from *symbolic_mem_op*. + Handle small SYMBOL_REFs anywhere, not just inside memories. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + * config/alpha/alpha.md (small symbolic operand splitter): Update. + +2002-02-17 Roland McGrath + + * config.gcc (powerpc-*-gnu-gnualtivec*, + powerpc-*-gnu*, powerpc64-*-gnu*): New configurations. + * config/rs6000/gnu.h: New file. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): + Grok "gnu" in rs6000_abi_name. + (ASM_SPEC, CC1_SPEC, LINK_START_SPEC, LINK_OS_SPEC, + CPP_ENDIAN_SPEC, CPP_SPEC, STARTFILE_SPEC, LIB_SPEC, ENDFILE_SPEC): + Grok -mcall-gnu analogous to -mcall-linux et al. + (LIB_GNU_SPEC, STARTFILE_GNU_SPEC, ENDFILE_GNU_SPEC, + LINK_START_GNU_SPEC, LINK_OS_GNU_SPEC, CPP_OS_GNU_SPEC): New macros. + (SUBTARGET_EXTRA_SPECS): Add *_os_gnu specs using them. + +2002-02-17 Jakub Jelinek + + PR c/3444: + * c-typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit + shortening. + +2002-02-17 Philipp Thomas + + * config/cris/cris.h: Undefine STARTFILE_SPEC and + ENDFILE_SPEC before (re)defining them. + +2002-02-17 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + * config/h8300/h8300.h: Likewise. + +2002-02-17 Philipp Thomas + + * doc/tm.texi: Explain why empty strings should not be + marked for translation. + +2002-02-17 Philipp Thomas + + * final.c (output_operand_lossage): Changed to accept + printf style arguments. Change calls where necessary. + * output.h (output_operand_lossage): Change declaration + accordingly. Update copyright. + * config/arc/arc.c config/fr30/fr30.c config/m32r/m32r.c + config/m88k/m88k.c : Adapt all calls to output_operand_lossage. + Update copyright date where necessary. + + * config/i386/i386.c (print_operand): Likewise. Remove use of + sprintf. + + * config/cris/cris.c (cris_operand_lossage): Likewise. + Rename parameter so that exgettext recognizes it as + translatable message. + (LOSE_AND_RETURN): Rename parameter to msgid. + +2002-02-17 Kazu Hirata + + * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Replace a + hard coded register number with an appropriate macro. + (HARD_REGNO_MODE_OK): Likewise. + (ARG_POINTER_REGNUM): Likewise. + (STATIC_CHAIN_REGNUM): Likewise. + (RETURN_ADDRESS_POINTER_REGNUM): Likewise. + * config/h8300/h8300.md (define_constants): Define more + register numbers. + +2002-02-17 Philipp Thomas + + * config/i386/i386.h: Don't mark empty strings for translation. + +2002-02-16 H.J. Lu + + * config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): New. + +2002-02-16 Zack Weinberg + + * cppinit.c (merge_include_chains): Check for brack being + NULL before attempting to merge it with qtail. + +2002-02-16 Andrew Cagney + + * config/rs6000/netbsd.h (PREFERRED_DEBUGGING_TYPE): Set to + DBX_DEBUG. + +2002-02-16 John David Anglin + + * pa/t-pa, pa/t-pro, som.h: Revert last patch. + +2002-02-16 John David Anglin + + * pa/t-pa (LIB2FUNCS_EXTRA): Don't build lib2funcs.asm. + * pa/t-pro (LIB2FUNCS_EXTRA): Likewise. + * som.h (DO_GLOBAL_DTORS_BODY): Delete define. + +Sat Feb 16 13:48:50 2002 Richard Kenner + + * config/alpha/alpha.md (*movsi_nt_vms_nofix): Was *movsi_nt_vms; + now only if !TARGET_FIX. + (*movsi_nt_vms_fix): New pattern. + +2002-02-16 Douglas B Rupp + + * config/alpha/alpha.c: Implement null frame procedure types on VMS. + (alpha_procedure_type): Replaces alpha_is_stack_procedure. + (alpha_sa_mask, alpha_sa_size): Reflect above change. + (alpha_pv_save_size, alpha_expand_prologue): Likewise. + (alpha_start_function, alpha_expand_epilogue): Likewise. + (unicosmk_gen_dsib): Likewise. + +Sat Feb 16 13:39:09 2002 Richard Kenner + + * expr.c (store_constructor): Handle target REG case for ARRAY_TYPE. + +2002-02-16 Ulrich Weigand + + * config/s390/s390.c (pool_stop_uid, other_chunk, far_away, + check_and_change_labels, s390_final_chunkify): Delete. + (s390_split_branches, s390_chunkify_pool): New functions. + (s390_function_prologue): Call them. + + * config/s390/s390.h (S390_REL_MAX): Delete. + (S390_CHUNK_MAX, S390_CHUNK_OV): Adjust values. + + * config/s390/s390.md (cjump, icjump, jump): Fix length + attribute calculation. + + +2002-02-15 David Edelsohn + + * config/rs6000/linux64.h (STRIP_NAME_ENCODING): Delete. + * config/rs6000/ppc-asm.h (JUMP_TARGET): Define for powerpc64. + +2002-02-15 John David Anglin + + * gcc.c (init_gcc_specs): Revert patch from 2002-02-15. + * config/pa/pa-linux.h (LIB_SPEC): Likewise. + * config/pa/pa32-linux.h (LINK_COMMAND_SPEC): Likewise. + +2002-02-15 Richard Sandiford + + * c-decl.c (grokdeclarator): Prevent a segfault on unnamed decls. + +2002-02-15 Richard Sandiford + + * reload.c (find_dummy_reload): Check that an output register + is valid for its mode. + +2002-02-14 Alexandre Oliva + + * combine.c (known_cond): After replacing the REG of a SUBREG, try + to simplify it. + + * function.c (assign_parms): Demote promoted argument passed by + transparent reference. + +2001-02-14 Joel Sherrill + + * config/arm/rtems-elf.h, config/h8300/rtems.h: Removed redundant + -Acpu() and -Amachine() to eliminate warnings. + +2002-02-14 Ulrich Weigand + + * config/s390/linux.h (ASM_OUTPUT_ALIGNED_BSS): New. + +2002-02-14 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + const_costs. + * config/h8300/h8300.c (const_costs): Treat SET as a little + more expensive operation. + * config/h8300/h8300.h (DEFAULT_RTX_COSTS): Update the + reference to const_costs. + +2002-02-14 Hans-Peter Nilsson + + * config.gcc (c4x-*-rtems*): Fix typo in tm_file setting. + +2002-02-14 Jakub Jelinek + + PR c/5503: + * c-decl.c (duplicate_decls): If builtin type has TYPE_ARG_TYPES NULL, + use arguments from newtype. + +2002-02-13 Eric Christopher + + * config/mips/mips.c (override_options): Add check for march/mipsX + on the same command line. Fix error message in cpu processing. + Remove architecture and ISA checks. + +2002-02-14 Aldy Hernandez + + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Adjust for vectors. + + * config/rs6000/sysv4.h (ROUND_TYPE_ALIGN): Add MAX. + +2002-02-14 Aldy Hernandez + + * config/rs6000/rs6000.md ("*movv4si_internal"): Add m<-r and r<-r + alternatives. + ("*movv8hi_internal1"): Same. + ("*movv16qi_internal1"): Same. + ("*movv4sf_internal1"): Same. + + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Do + not push_reload for altivec modes. + +2002-02-13 Joel Sherrill + + * config.gcc (a29k-*-rtems), config/a29k/rtems.h: General cleanup across + all RTEMS targets including removal of #includes from config/*/rtems*.h + file and adding them to tm_file setting. Added xm_defines=POSIX to + many targets. + * config.gcc (c4x-*-rtems), config/c4x/rtems.h: Ditto. + * config.gcc (h8300-*-rtems), config/h8300/rtems.h: Ditto. + * config.gcc (hppa1.1-*-rtems), config/pa/rtems.h: Ditto. + * config.gcc (i960-*-rtems), config/i960/rtems.h: Ditto. + * config.gcc (m68k-*-rtems*), config/m68k/rtems.h, + config/m68k/rtemself.h: Ditto. + * config.gcc (mips*-*-rtems*), config/mips/rtems.h, + config/mips/rtems64.h: Ditto. + * config.gcc (powerpc-*-rtems*), config/rs6000/rtems.h: Ditto. + * config.gcc (sh-*-rtems*), config/sh/rtems.h, config/sh/rtemself.h: + Ditto. + * config.gcc (sparc-*-rtems*), config/sparc/rtems.h, + config/sparc/rtemself.h: Ditto. + * config.gcc (v850-*-rtems*), config/v850/rtems.h: Ditto. + * config.gcc (arm-rtems), config/arm/rtems-elf.h: Ditto plus moved + arm-rtems stanza closer to other arm-elf targets and made arm-rtems + more like arm-elf. + * config.gcc (i[34567]86-*-rtems*), config/i386/djgpp-rtems.h, + config/i386/rtems.h, config/i386/rtemself.h: Ditto plus i386-rtemself + target made more similar to i386-elf. + * config/i386/t-rtems-i386: Added soft float support and multilibs. + * config/m68k/t-m68kbare: Add 68040 and 68060 as multilib alternatives to + be similar to config/m68k/t-m68kelf. + * gthr-rtems.h: Encapsulate with extern "C" for C++. + +Wed Feb 13 23:41:15 CET 2002 Jan Hubicka + + * regmove.c (kill_value): Handle subregs. + +Wed Feb 13 23:34:30 CET 2002 Jan Hubicka + + * i386.md (mul patterns): Allow memory operand to be first; + add expanders where needed; fix constraints. + (min?f_nonieee, max?f_nonieee, SSE TImode patterns): + Allow memory operand to be the first. + + * i386.c (ix86_prepare_fp_compare_args): Fix condition for swapping + operands. + +2002-02-13 Jakub Jelinek + + PR c/5681: + * expr.c (safe_from_p): Pass VOIDmode to true_dependence instead of + GET_MODE (x). + +2002-02-13 Jakub Jelinek + + PR optimization/5547: + * config/i386/i386.c (i386_simplify_dwarf_addr): Simplify + all valid IA-32 address modes involving non-scaled %ebx and + GOT/GOTOFF as displacement. + +2002-02-13 Ulrich Weigand + + * config/s390/s390.c (s390_final_chunkify): Re-run shorten_branches + after emitting ltorg insns. + + * config/s390/s390.md (*cmpdf_ccs_0, *cmpdf_ccs, *cmpsf_ccs_0, + *cmpsf_ccs, truncdfsf2_ieee, *adddf3, *addsf3, *subdf3, *subsf3, + *muldf3, *mulsf3, *divdf3, *divsf3, *negdf2, *negsf2, *absdf2, + *abssf2): Fix "op_type" attribute. + +2002-02-13 Douglas B Rupp + + * mkconfig.sh: Avoid using a subshell redirect. + ($output.T): Change to $(output)T. + (ENABLE_NLS): Remove unneeded undef. + + * config/alpha/vms.h (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX): Define. + * config/alpha/x-vms (libsubdir): Define. + + * config/alpha/vms.h (MD_FALLBACK_FRAME_STATE_FOR): Handle + register frame procedures. Optimize retrieving context. + + * config/alpha/t-vms (MULTILIB_OPTIONS): Define. + (MULTILIB_DIRNAME, LIBGCC, INSTALL_LIBGCC): Likewise. + * config/alpha/vms.h (ASM_FILE_START): Write .arch directive. + +Wed Feb 13 09:45:08 2002 Richard Kenner + + * alias.c (find_base_term, case ZERO_EXTEND, case SIGN_EXTEND): + Make same change as for find_base_value. + +2002-02-13 Kazu Hirata + + * config/h8300/h8300.h (MODES_TIEABLE_P): Accept a combination + of QImode and SImode. + +2002-02-13 Kazu Hirata + + * config/h8300/h8300.c (h8300_adjust_insn_length): Correct the + length computation of movsi. + * config/h8300/h8300.md (movsi_h8300hs): Correct the length. + +2002-02-13 Kazu Hirata + + * config/h8300/h8300.md (subqi3): Tighten the predicate for + operands[2] to register_operand. + +Wed Feb 13 10:35:56 CET 2002 Jan Hubicka + + * i386.md (fop_*_comm_*): allow nonimmediate in the first operand. + +2002-02-12 Aldy Hernandez + + * config/rs6000/rs6000.md: Use predicate altivec_register_operand + for altivec_lvx* and altivec_stvx*. + ("*movv4si_internal"): Add constraint for loading from GPRs. + ("*movv8hi_internal1"): Same. + ("*movv16qi_internal1"): Same. + ("*movv4sf_internal1"): Same. + + * config/rs6000/rs6000.c (altivec_register_operand): New. + + * config/rs6000/rs6000.h (PREDICATE_CODES): Add + altivec_register_operand. + +2002-02-13 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_assemble_integer) : Don't + handle SYMBOL_REF. + +2002-02-13 Stan Shebs + + * c-typeck.c (digest_init): Handle vectors. + (really_start_incremental_init): Same. + (pop_init_level): Same. + (process_init_element): Same. + + * varasm.c (output_constant): Same. + + * expr.c (clear_storage): Same. + (store_constructor): Same. + +2002-02-12 Eric Christopher + + * explow.c (hard_function_value): Add comment explaining + signed/unsigned comparison. + +2002-02-12 Jakub Jelinek + + * jump.c (never_reached_warning): Add finish argument. + If finish is NULL, stop on CODE_LABEL, otherwise stop before first + real insn after end. + * rtl.h (never_reached_warning): Adjust prototype. + * cse.c (cse_insn): Pass NULL as finish to never_reached_warning. + * cfgrtl.c (flow_delete_block): Pass b->end as finish to + never_reached_warning. + +2002-02-12 Graham Stott + + * config/hp/pa.h (GO_IF_LEGITIMATE_ADDRESS): Fix typos. + +2002-02-12 Kazu Hirata + + * config/h8300/h8300.c (shift_alg_hi): Improve the 15-bit + logical shifts on H8/300. + (shift_alg_si): Improve several shifts on H8/300. + (get_shift_alg): Likewise. + +2002-02-12 Graham Stott + + * config/pa/pa.c (compute_movstrsi_length): Fix typos. + +Tue Feb 12 10:12:56 2002 Richard Kenner + + * alias.c (find_base_value, case ZERO_EXTEND, case SIGN_EXTEND): + Handle #ifdef POINTERS_EXTEND_UNSIGNED. + +2002-02-11 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_assemble_integer) : Handle + non-CONST_INT through default_assemble_integer. + : Likewise, for non-CONST_INT, non-SYMBOL_REF. + : Abort for CONST_DOUBLE. + +2002-02-11 John David Anglin + + * gcc.c (init_gcc_specs): Add static libgcc to link when "-shared" + is specified. + * config/pa/pa-linux.h (LIB_SPEC): Delete. + * config/pa/pa32-linux.h (LINK_COMMAND_SPEC): Delete. + +2002-02-11 Andrew Haley + + * config/stormy16/stormy16.md (zero_extendqihi2): New. + +2002-02-11 Alexandre Oliva + + * regrename.c (regrename_optimize): Don't accept a + part-clobbered register if the replaced register is not part + clobbered. + + * calls.c (store_one_arg): In the non-BLKmode non-partial case, + take padding into account when computing the argument value. + + * config/sh/sh.h (FUNCTION_ARG_REGNO_P): Fix parenthesizing error. + + * combine.c (try_combine): Apply substitutions in + CALL_INSN_FUNCTION_USAGE too. + +2002-02-11 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_init_builtins): Handle + __builtin_altivec_abs*. + (bdesc_abs): New. + + * config/rs6000/rs6000.h (rs6000_builtins): Add + ALTIVEC_BUILTIN_ABS*. + + * config/rs6000/altivec.h: Use const char for builtins expecting + literals. + (vec_abs): New versions for C and C++. + (vec_abss): Same. + +2002-02-10 Kazu Hirata + + * config/h8300/h8300.h (INITIALIZE_TRAMPOLINE): Simplify by + using Pmode. + +2002-02-10 Kazu Hirata + + * config/h8300/h8300.h (STACK_POINTER_REGNUM): Use the + constant definition from h8300.md. + (FRAME_POINTER_REGNUM): Likewise. + * config/h8300/h8300.md (define_constants): Add FP_REG. + +2002-02-10 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove redundant code. + +2002-02-10 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove the prototype for byte_reg. + * config/h8300/h8300.c (byte_reg): Make it static. + +2002-02-10 Richard Henderson + + PR c/5623 + * c-typeck.c (incomplete_type_error): Handle flexible array members. + +2002-02-10 Richard Henderson + + PR c++/5624 + * tree.c (append_random_chars): Don't abort if main_input_filename + does not exist. + +2002-02-10 Hans-Peter Nilsson + + * config/mmix/t-mmix (MULTILIB_EXTRA_OPTS): Disable. + +2002-02-10 Kazu Hirata + + * config/h8300/h8300.md (pushhi1_h8300): Correct the mode used. + (pushhi1): Likewise. + +2002-02-10 John David Anglin + + * pa.c (reg_before_reload_operand): Don't accept a SUBREG operand. + * pa.h (PREDICATE_CODES): Adjust codes for reg_before_reload_operand. + +2002-02-09 David O'Brien + + * config/sparc/freebsd.h(TARGET_DEFAULT): Add MASK_EPILOGUE setting and + remove MASK_VIS. + (ASM_CPU_DEFAULT_SPEC): Remove. Default setting is fine. + +2002-02-09 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Use sub.w to clear + a half of an SImode register on H8/300. + +Sat Feb 9 18:28:02 CET 2002 Jan Hubicka + + * i386.md (movdi_2): Add missing '!'. + +2002-02-09 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. Remove commented-out + definitions. + +2002-02-09 Kazu Hirata + + * config/h8300/h8300.md (length): Correct the distance valid + for the short branch. + +2002-02-09 Kazu Hirata + + * config/h8300/h8300.md (iorhi3): Tighten the predicates. + +2002-02-09 Alexandre Oliva + + * config/sh/sh.h (REGISTER_NATURAL_MODE): Save part-clobbered + registers in SImode. + (HARD_REGNO_CALL_PART_CLOBBERED) [TARGET_SHMEDIA32]: Set r18 as + part-clobbered. + + * config/sh/sh.c (expand_prologue): Fix mis-applied 2001-11-09's + patch. + + Contribute sh64-elf. + 2002-02-09 Alexandre Oliva + * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... + (sh_cannot_modify_jumps_p): New function. + 2002-02-05 Alexandre Oliva + * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... + (sh_ms_bitfield_layout_p): New function. + 2002-02-04 Alexandre Oliva + Zack Weinberg + * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use + expand_simple_binop instead of expand_binop. + 2002-02-03 Alexandre Oliva + * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable + use of .quad and .uaquad. + * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, + TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. + 2002-01-24 Alexandre Oliva + * config/sh/sh.md (movdi_const, movdi_const_32bit, + movdi_const_16bit): Make sure all CONSTs have modes. + (sym2PIC): Ditto, but by adjusting all callers. + * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live + if the prologue calls the SHmedia argument decoder or register + saver. + 2002-01-24 Alexandre Oliva + * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. + (TARGET_ASM_ALIGNED_DI_OP): Likewise. + (sh_expand_epilogue): Don't emit USE of return target register. + (prepare_move_operands): Legitimize DImode PIC addresses. + (sh_media_register_for_return): Skip tr0, used to initialize the + PIC register. + (sh_expand_prologue): Remove explicit USE of return register. + (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in + CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. + * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. + (OVERRIDE_OPTIONS): Don't disable PIC on SH5. + (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of + EXTRA_CONSTRAINT_T. + (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. + (MOVI_SHORI_BASE_OPERAND_P): New. + (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. + (EXTRA_CONSTRAINT_T): Define in terms of them. + (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. + * config/sh/sh.md (movsi_media, movsi_media_nofpu, + movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to + alternatives supporting TARGET_REGS. + (UNSPEC_GOTPLT): New constant. + (movdi split): Move incrementing of LABEL_NUSES... + (movdi_const, movdi_const_32bit): Here. Use + MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. + (movdi_const_16bit): New. + (call, call_value) [flag_pic]: Use GOTPLT. + (call_pop, call_value_pop): New expands. + (call_pop_compact, call_pop_rettramp): New insns. + (call_value_pop_compact, call_value_pop_rettramp): New insns. + (sibcall) [flag_pic]: Use GOT. + (builtint_setjmp_receiver): Remove bogus, unused expand. + (GOTaddr2picreg): Implement for SHcompact and SHmedia. + (*pt, *ptb, ptrel): New insns. + (sym2GOT): Handle DImode GOT. + (sym2GOTPLT, symGOTPLT2reg): New expands. + (sym2PIC): New expand. + (shcompact_return_tramp): Use GOTPLT to return trampoline. + (shcompact_return_tramp_i): Use return register explicitly. + * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't + disable flag_reorder_blocks. + 2002-01-19 Alexandre Oliva + * config/sh/sh.md (sibcall_compact): Reorder return, uses and + clobbers, for clarity. + (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and + restoring of r0 in macl as MAYBE_DEAD. + 2002-01-18 Alexandre Oliva + * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. + * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of + alter_subreg all over. + (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after + reload, instead of emitting instructions that would require + reloading. + (casesi_load_media): Add missing modes. + 2001-11-09 Alexandre Oliva + * config/sh/sh.c (sh_expand_prologue): Mark the PIC register + as used if the argument decoder is called. + 2001-08-28 Alexandre Oliva + * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in + Pmode, then extend it to DImode if necessary. + 2001-08-28 Stephen Clarke + * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode + constants in FPU-enabled SHmedia, let them be loaded from memory. + 2001-08-28 Alexandre Oliva + * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): + Adjust whitespace in assembly output templates. + 2001-08-28 Stephen Clarke + * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust + mode of if_then_else. + 2001-08-04 Alexandre Oliva + * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in + sh.h. + 2001-07-26 Andrew Haley + Joern Rennecke + * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. + (SUBTARGET_CPP_PTR_SPEC): New. + (SUBTARGET_CPP_SPEC): Remove. + 2001-07-06 Chandrakala Chavva + * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): + Fix typo in previous checkin. + 2001-07-11 Chandrakala Chavva + * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. + 2001-07-10 Chandrakala Chavva + Alexandre Oliva + * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than + what single FP register can hold for SHmedia target. + 2001-07-06 Chandrakala Chavva + Alexandre Oliva + * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): + Do not split into SUBREG. + 2001-06-14 Alexandre Oliva + * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures + and added new functions as specified in SH5 ABI r9. + 2001-06-04 Alexandre Oliva + * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an + 8-byte boundary. + 2001-06-03 Alexandre Oliva + * config/sh/sh.c (dump_table): Add const0_rtx in calls of + gen_consttable_4 and gen_consttable_8. Emit multiple labels + and consttable_window_ends. + 2001-06-03 Graham Stott + * config/sh/sh.md (movdi split): Remove unused variable last_insn. + 2001-05-16 Alexandre Oliva + * config/sh/sh.c (print_operand): Handle floating-point pair, + vector and matrix registers. + * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer + vector modes into account. + * config/sh/sh.md (movv2sf): Split move between registers into + movdf. + (movv4sf, movv16sf): Introduce insns that get split only after + reload. + * config/sh/shmedia.h: Fix Copyright dates. + * config/sh/ushmedia.h: Likewise. Move loop counter + declarations into conditionals that uses them. + (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in + loop boundary. + * config/sh/sshmedia.h: Fix Copyright dates. + (sh_media_PUTCFG): Fix constraints. + 2001-05-12 Alexandre Oliva + * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to + ptrmemfunc_vbit_in_delta for SH5. + 2001-05-08 Alexandre Oliva + * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. + * invoke.texi: Likewise. + 2001-04-14 Alexandre Oliva + * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, + GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, + GCC_pop_shmedia_regs_nofpu): New global symbols. + * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. + * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. + * config/sh/sh.c (calc_live_regs): Account for PR's saving in + compact function with nonlocal labels. + (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. + (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. + (initial_elimination_offset): Account for their stack space. + * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. + * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, + movhi_media, movdi_media, movdi_media_nofpu, movdf_media, + movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at + least one of the operands to be a register. + (movv2sf): Likewise. Renamed to movv2sf_i. + (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): + prepare_move_operands() before emitting SHmedia insns. + 2001-04-03 Alexandre Oliva + * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: + Don't save nor initialize r12. Don't mis-align the stack. + Pad the code with a nop. + * config/sh/crti.asm: Don't restore r12. Don't mis-align the + stack. + 2001-03-13 Alexandre Oliva + * gcc/longlong.h (__umulsidi3, count_leading_zeros) + [__SHMEDIA__]: Implement. + 2001-03-11 Alexandre Oliva + * config/sh/sh.md: Set latency of `pt' closer to reality. + (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, + movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): + Set move, load and store type attributes. + * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. + * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable + profiling. + * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. + * config/sh/sh-protos.h (sh_media_register_for_return): Declare. + * config/sh/sh.c (sh_media_register_for_return): New function. + (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available + branch-target register. + (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. + * config/sh/sh.md (return_media_i): Use any call-clobbered + branch-target register. + (return_media): If r18 wasn't copied in the prologue, copy it + here. + * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: + Clear class FP0_REGS. + * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied + from elf.h. + 2001-03-08 DJ Delorie + * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. + 2001-02-09 Alexandre Oliva + * config/sh/sh.md (sibcall_compact): Set fp_mode to single. + 2001-02-07 Alexandre Oliva + * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. + 2001-02-03 Alexandre Oliva + * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode + return value correctly for call_cookie. + 2001-02-01 Alexandre Oliva + * config/sh/crt1.asm (start): Modified so as to call + ___setup_argv_and_call_main. + 2001-01-26 Alexandre Oliva + * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in + SHmedia mode. + 2001-01-20 Alexandre Oliva + * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. + (STRIP_NAME_ENCODING): Use it. + (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). + 2001-01-19 Alexandre Oliva + * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of + prepare_scc_operands(). + * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... + (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. + 2001-01-17 Alexandre Oliva + * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. + 2001-01-13 Alexandre Oliva + * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. + * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, + used in shcompact_incoming_args. + * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous + change. + * config/sh/crt1.asm (start) [SH5]: Switch to single-precision + mode. + * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): + Adjust accordingly. + * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): + Simplify. Adjust. Add sanity check. + * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set + FPU_SINGLE_BIT. + * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match + TARGET_SHCOMPACT. + (udivsi3, divsi3): Use them. + (force_mode_for_call): New insn. + (call, call_value, sibcall_value): Emit it before SHcompact + calls. + 2001-01-11 Alexandre Oliva + * config/sh/sh.md (call, call_value, sibcall): Make sure the + call cookie is non-NULL before taking its value. + 2001-01-10 Alexandre Oliva + * config.gcc (sh64): Set target_requires_64bit_host_wide_int. + 2001-01-09 Alexandre Oliva + * config/sh/sh.md (shcompact_incoming_args): Set argument memory + block. + * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. + * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as + temporary for stack adjusts. Use MACL and MACH to pass + arguments to shcompact_incoming_args. + * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't + clobber r1. + * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. + (nested_trampoline): Load static chain address into r1. + * config/sh/sh.md (movdi_media splits): Fix sign-extension. + 2001-01-07 Alexandre Oliva + * config/sh/sh.md (casesi): Sign-extend the first two operands, + and use signed compares for them. + * config/sh/sh.c (dump_table): Don't emit 8-byte constants after + 4-byte ones. Instead, inter-leave them, maintaining the 8-byte + ones properly aligned. + (find_barrier): Account for extra alignment needed for 8-byte wide + constants. + (machine_dependent_reorg): Require a label for the second 4-byte + constant after an 8-byte one. + * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's + change. + 2001-01-05 Alexandre Oliva + * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset + last_float when switching float modes. + * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer + auto-increment for general-purpose registers. + * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the + result. + * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary + for stack adjust. + * config/sh/sh.c (sh_builtin_saveregs): Support using all + registers for varargs. + 2001-01-01 Alexandre Oliva + * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. + * config/sh/sh.h (CALL_COOKIE_STACKSEQ, + CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. + (CALL_COOKIE_INT_REG_SHIFT): Adjust. + (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust + call_cookie accordingly. + (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. + (SHCOMPACT_BYREF): Likewise. + (SHCOMPACT_FORCE_ON_STACK): New macro. + * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. + (sh_builtin_saveregs): Likewise. + * config/sh/lib1funcs.asm (shcompact_call_trampoline, + shcompact_incoming_args): Use new shift values. Support + sequences of consecutive and non-consecutive pushes/pops. + * config/sh/sh.md (return): Don't explicitly use PR_REG. + 2001-01-05 Hans-Peter Nilsson + * config/sh/sh.h (TEXT_SECTION): Define. + * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. + 2001-01-05 Alexandre Oliva + * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. + * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for + return values on FPU-enabled SHmedia. + (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on + FPU-enabled SHmedia. + (INIT_CUMULATIVE_ARGS): Set up return trampoline only if + value is returned in a non-FP reg and is not returned by + reference. + * config/sh/sh.md (shcompact_return_tramp_i): Change type to + jump_ind. + 2000-01-04 Alexandre Oliva + * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. + (FUNCTION_ARG_CALLEE_COPIES): Require argument to be + quad-aligned to be passed by callee-copy reference. + 2001-01-03 Alexandre Oliva + * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. + * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. + 2001-01-02 Alexandre Oliva + * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in + copying low-numbered FP regs to r7 and r8. + * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of + FP regs to general-purpose regs only if the copy was passed on the + stack. + * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in + copying FP reg to r9. + * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to + copy FP regs to general-purpose regs only in outgoing calls. + * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect + change from 2000-10-30. Adjust for 64-bit (or 32-bit) + HOST_WIDE_INT. + * config/sh/sh.h (struct sh_args): Document all fields. + (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments + passed partially on the stack should not consider making + sibcalls. + * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to + stack_regs only for incoming calls. When passing FP args, + make sure there are FP regs available before modifying + call_cookie. + (SHCOMPACT_BYREF): Pass double args in general-purpose + registers by reference. + 2000-12-30 Alexandre Oliva + * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't + attempt to generate sibcalls if the caller got any arguments + by reference. + * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. + * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode + to 8-byte boundaries. + * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. + * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. + * config/sh/sh.c (sh_expand_prologue): Preserve args that will be + stored in the stack. + * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange + for the offsets to have the ISA bit set. + (shcompact_call_trampoline): Document. Swap r0 and r1, to match + invocation. Use beq instead of bgt to mark end of sequence of + loads. + (shcompact_incoming_args): Fix store of r2. Use beq instead of + bgt to mark end of sequence of stores. + * config/sh/sh.c (arith_operand): Don't check whether + CONST_OK_FOR_J for now. + * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT + instead of long for conversion. + 2000-12-29 Alexandre Oliva + * config/sh/sh.c (print_operand_address): Convert INTVAL to int + before passing it to fprintf. + 2000-12-28 Alexandre Oliva + * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. + Call set_fpscr before reading/writing SR. + * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. + Call set_fpscr. + * config/sh/lib1funcs.asm: Add `.align 2' directives before + SHmedia code. + (FMOVD_WORKS): Define on SH5 with FPU. + (set_fpscr): Define on SH5. Remove separate _fpscr_values + setting. + * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of + _fpscr_values. + 2000-12-28 Hans-Peter Nilsson + * config/sh/lib1funcs.asm (ct_main_table): Align contents to even + address. + (ia_main_table): Ditto. + 2000-12-27 Alexandre Oliva + * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. + * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate + the definitions from sh.h. + * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on + TARGET_SH5. + (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. + * config/sh/elf.h (PTRDIFF_TYPE): Likewise. + * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. + 2000-12-26 Alexandre Oliva + * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. + Increment LABEL_NUSES. + + * config/sh/sh.h (SIZE_TYPE): Define as conditional on + TARGET_SH5. + (SUBTARGET_CPP_SPEC): Arrange for __SIZE_TYPE__ to be always + defined. + * config/sh/elf.h (SIZE_TYPE): Likewise. + * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. + * config/sh/lib1funcs.asm (shcompact_call_trampoline, + shcompact_incoming_args): Load switch table addresses using + datalabel. + * config/sh/sh.h (SUBTARGET_CPP_SPEC): Define __SIZE_TYPE__. + (NO_BUILTIN_SIZE_TYPE): Define. + (SIZE_TYPE): Don't define. + * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Define __SIZE_TYPE__. + * config/sh/sh.h (CPP_SPEC): Fixed typo that prevented the + definition of __SH5__=32 for -m5-compact-nofpu. + * config/sh/sh.c (barrier_align): Ensure 32-bit alignment after + ADDR_DIFF_VEC. + 2000-12-24 Alexandre Oliva + * config/sh/sh.h (FUNCTION_ARG_PADDING): Removed. + 2000-12-23 Alexandre Oliva + * config/sh/sh.h (TARGET_CACHE32): Enable on SH5. + (FUNCTION_BOUNDARY): Ensure 32-bit alignment for SHmedia. + (INSN_LENGTH_ALIGNMENT): Likewise. + 2000-12-22 Alexandre Oliva + * config/sh/sh.md (call, call_value, sibcall): Simplify + copying of non-branch-target register. + 2000-12-22 Alexandre Oliva + * glimits.h (__LONG_MAX__): Revert 2000-12-13's patch. + * config/sh/sh.h (CPP_SPEC): Define it here for 64-bit SHmedia. + 2000-12-22 Alexandre Oliva + * config/sh/sh.h (GET_SH_ARG_CLASS): Handle complex + floating-point values as structs. + (FUNCTION_ARG): Use SH5_PROTOTYPED_FLOAT_ARG. + (SH5_PROTOTYPELESS_FLOAT_ARG): List FP registers before + general-purpose register. + (SH5_PROTOTYPED_FLOAT_ARG): New macro. + 2000-12-20 Alexandre Oliva + * config/sh/sh.md (addsi3): Force operand1 to reg for SHmedia. + * config/sh/sh.md (movsi_media): Split CONST_DOUBLE loads too. + * config/sh/sh.h (DATALABEL_REF_P): Don't require the CONST. + (ENCODE_SECTION_INFO): Enclose variables and constants in + DATALABEL unspecs. + (SH_DATALABEL_ENCODING, DATALABEL_SYMNAME_P): Define. + (STRIP_NAME_ENCODING): Strip SH_DATALABEL_ENCODING off. + (ASM_OUTPUT_LABELREF, AMS_OUTPUT_SYMBOL_REF): Define. + * config/sh/sh.c (gen_datalabel_ref): Use UNSPEC_DATALABEL + only for LABEL_REFs. For SYMBOL_REFs, prepend + SH_DATALABEL_ENCODING to the symbol name. + * config/sh/sh.md (indirect_jump): Use SUBREG instead of + convert_mode(). + 2000-12-20 Alexandre Oliva + * config/sh/sh.md (casesi): Enclose ADDR_DIFF_VEC address in + UNSPEC_DATALABEL. + * config/sh/sh.c (gen_datalabel_ref): Accept LABEL_REFs. + * config/sh/sh.h (DATALABEL_REF_NO_CONST_P): Likewise. + (DATALABEL_REF_P): Don't require CONST. + (ASM_OUTPUT_ADDR_DIFF_ELT): On SH5, output datalabel before + REL label. + 2000-12-19 Alexandre Oliva + * config/sh/sh.md (extendhidi2, extendqidi2): Use arithmetic shift + right. + 2000-12-18 Alexandre Oliva + * config/sh/sh.md (movsi_media, call, call_value, sibcall): + Use shallow_copy_rtx and PUT_MODE to change the mode of + SYMBOL_REFs, LABEL_REFs, CONSTs, etc. + * config/sh/sh.h (PREFERRED_RELOAD_CLASS): Reload SYMBOL_REFs + on SHmedia using GENERAL_REGs. + * config/sh/sh.md (ble_media_i, blt_media_i, bleu_media_i, + bltu_media_i): Fix reversion of conditions. + 2000-12-18 Alexandre Oliva + * config/sh/sh.md (zero_extendhidi2): Use logical shift right. + * config/sh/sh.c (output_far_jump): Save r13 in macl. + 2000-12-17 Alexandre Oliva + * config/sh/sh.c (gen_datalabel_ref): Fix mode of the UNSPEC. + 2000-12-16 Alexandre Oliva + * config/sh/lib1funcs.asm (ic_invalidate): Define for SH5. + (GCC_nested_trampoline): Likewise. + * config/sh/sh-protos.h (gen_datalabel_ref): Declare. + * config/sh/sh.c (gen_datalabel_ref): Define. + * config/sh/sh.h (TRAMPOLINE_SIZE): Adjust for SH5. + (INITIALIZE_TRAMPOLINE): Likewise. + (TRAMPOLINE_ADJUST_ADDRESS): Define. + (DATALABEL_REF_NO_CONST_P, DATALABEL_REF_P): Define. + (EXTRA_CONSTRAINT_T): Match DATALABEL unspecs. + (OUTPUT_ADDR_CONST_EXTRA): Handle DATALABEL unspecs. + * config/sh/sh.md (UNSPEC_DATALABEL): New constant. + (ic_invalidate): Adjust for SH5. + (ic_invalidate_line_media, ic_invalidate_line_compact): New insns. + * config/sh/t-sh64 (LIB1ASMFUNCS): Added _ic_invalidate and + _nested_trampoline. + 2000-12-15 Alexandre Oliva + * config/sh/sh.h (MOVE_MAX): Set to 8 for SHmedia, 4 elsewhere. + (MOVE_MAX_PIECES): Set to 8 on SHmedia too. + 2000-12-14 Alexandre Oliva + * config/sh/sh.h (DBX_REGISTER_NUMBER): Adjust for sh64-elf-gdb. + * config/sh/elf.h (DBX_REGISTER_NUMBER): Likewise. + 2000-12-14 Alexandre Oliva + * config/sh/sh.c (target_reg_operand): Match only target-branch + registers and pseudos that aren't virtual registers. + * config/sh/sh.md (call, call_value, sibcall) [TARGET_SHMEDIA]: + Copy operands that don't match target_reg_operand to pseudos. + (call_media, call_value_media, sibcall_media): Use + target_reg_operand instead of target_operand. + 2000-12-13 Alexandre Oliva + * glimits.h (__LONG_MAX__) [SH5 == 64]: Adjust for 64 bits. + * config/sh/sh.c (target_reg_operand): Match hardware registers + other than branch-target registers. + * config/sh/sh.md (zero_extendqidi2): Input operand is %1. + * config/sh/lib1funcs.asm (sdivsi3) [SH5]: Make it global. + (fpscr_values) [SH5 == 32]: Define. + * config/sh/t-sh64 (LIB1ASMFUNCS): Add fpscr_values. + * config/sh/sh.md (call, call_value, sibcall) [TARGET_SHMEDIA]: + Handle function addresses coming in SUBREGs. + 2000-12-12 Alexandre Oliva + * config/sh/lib1funcs.asm (shcompact_call_trampoline, + shcompact_return_trampoline): Use datalabel where appropriate. + 2000-12-09 Alexandre Oliva + * config/sh/sh.h (SECONDARY_OUTPUT_RELOAD_CLASS): Use a + general-purpose register to copy one branch-target register to + another. + 2000-12-06 Alexandre Oliva + * config/sh/sh.c (target_operand): Accept LABEL_REFs and + SYMBOL_REFs with VOIDmode. + * config/sh/sh.md (ble_media_i, blt_media_i, bleu_media_i, + bltu_media_i): New insns. + 2000-12-06 Alexandre Oliva + * config/sh/sh.h (RETURN_IN_MEMORY): Adjust for SH5 ABI. + (INIT_CUMULATIVE_ARGS): Likewise. + 2000-12-01 Alexandre Oliva + * machmode.def (V16SFmode): New mode. + * c-common.c (type_for_mode): Support V2SF and V16SF. + * tree.c (build_common_tree_nodes_2): Likewise. + * tree.h (tree_index): Likewise. + * calls.c (emit_call_1): Take args_so_far. Adjust all + callers. Introduce CALL_POPS_ARGS. + * tm.texi (CALL_POPS_ARGS): Document. + * config/sh/crt1.asm: Implement in SHmedia mode. + * config/sh/crti.asm, config/sh/crtn.asm: Likewise + * config/sh/elf.h (ASM_SPEC, LINK_SPEC): Support SH5 flags. + (DBX_REGISTER_NUMBER): Renumber registers for SH5. + * config/sh/lib1funcs.asm: Disable functions unused in SH5. + Implement divsi and udivsi in SHmedia mode. Introduce + SHcompact trampolines. + * config/sh/sh.c (GEN_MOV, GEN_ADD3, GEN_SUB3): Use DImode + only in SHmedia64. + (regno_reg_class): Rewrite. + (fp_reg_names): Remove. + (sh_register_names, sh_additional_register_names): New. + (print_operand): Added `u'. Support SUBREGs in addresses. + Add parentheses around shifted CONSTs. + (output_file_start): Output .mode and .abi directives. + (shiftcosts, addsubcosts, multcosts): Adjust. + (output_stack_adjust): Compute alignment. Sanity-check SIZE. + (push_regs): Take array of HOST_WIDE_INTs. Adjust callers. + (calc_live_regs): Output to array of HOST_WIDE_INTs. Count + bytes, not registers. Take into account the need for the + SHcompact incoming args trampoline. Adjust all callers. + (sh_expand_prologue): Take stack_regs into account. Call + incoming args trampoline. Keep stack aligned as per SH5 ABI. + (sh_expand_epilogue): Take stack_regs into accoutn. Keep + stack aligned as per SH5 ABI. + (sh_builtin_saveregs): Support SH5 ABI. + (sh_build_va_list, sh_va_start): Likewise. + (initial_elimination_offset): Take alignment into account. + Compute location of PR according to the SH5 stack frame. + (arith_reg_operand): Reject branch-target registers. + (shmedia_6bit_operand): New. + (logical_operand): Use CONST_OK_FOR_P on SHmedia. + (target_reg_operand): Match DImode only. Accept SUBREGs. + (target_operand): New. + * config/sh/sh.h (CPP_SPEC, SUBTARGET_CPP_SPEC): Support SH5 flags. + (CONDITIONAL_REGISTER_USAGE): Implement SH5 ABI. Initialize + SIBCALL_REGS for SHmedia. + (TARGET_SH3E, TARGET_SH4): Only if SH1_BIT is set too. + (TARGET_FPU_DOUBLE, TARGET_FPU_ANY): New. + (TARGET_SHMEDIA32, TARGET_SHMEDIA64): New. + (TARGET_SWITCHES): New SH5 flags. + (OVERRIDE_OPTIONS): Set SH5-specific options. Use + VALID_REGISTER_P to disable unsupported registers. + (LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE): Set. + (POINTER_SIZE, PARM_BOUNDARY): Adjust. + (FUNCTION_ARG_PADDING): Define. + (FASTEST_ALIGNMENT): Adjust. + (SH_REGISTER_NAMES_INITIALIZER): New. + (sh_register_names): Declare. + (DEBUG_REGISTER_NAMES): Define. + (REGISTER_NAMES): Define based on sh_register_names. + (SH_ADDITIONAL_REGISTER_NAMES_INITIALIZER): New. + (sh_additional_register_names): Declare. + (LAST_GENERAL_REG, LAST_FP_REG, LAST_XD_REG): Adjust for SHmedia. + (FIRST_TARGET_REG, LAST_TARGET_REG): Define. + (TARGET_REGISTER_P, SHMEDIA_REGISTER_P, VALID_REGISTER_P): Define. + (REGISTER_NATURAL_MODE): Define. + (FIRST_PSEUDO_REGISTER): Adjust. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Adjust. + (HARD_REGNO_CALL_PART_CLOBBERED): Define. + (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK): Adjust. + (VECTOR_MODE_SUPPORTED_P): Define. + (REG_CLASS_CONTENTS): Adjust. + (SMALL_REGISTER_CLASSES): Adjust. + (REG_ALLOC_ORDER): Adjust. + (INDEX_REG_CLASS): Adjust. + (CONST_OK_FOR_O, CONST_OK_FOR_P): New. + (CONST_OK_FOR_LETTER_P): Adjust. + (PREFERRED_RELOAD_CLASS): Adjust. + (SECONDARY_OUTPUT_RELOAD_CLASS): Adjust. + (SECONDARY_INPUT_RELOAD_CLASS): Adjust. + (NPARM_REGS, FIRST_PARM_REG, FIRST_RET_REG): Adjust. + (FIRST_FP_PARM_REG): Adjust. + (CALL_POPS_ARGS): Define. + (FUNCTION_ARG_REGNO_P): Adjust. + (struct sh_args): New fields. + (GET_SH_ARG_CLASS): Adjust. + (INIT_CUMULATIVE_ARGS): Adjust. + (INIT_CUMULATIVE_INCOMING_ARGS): Define. + (FUNCTION_ARG_ADVANCE): Adjust. + (FUNCTION_ARG): Adjust. + (FUNCTION_ARG_PASS_BY_REFERENCE, SHCOMPACT_BYREF): Define. + (FUNCTION_ARG_CALLEE_COPIES): Define. + (SH5_PROTOTYPELESS_FLOAT_ARG): Define. + (STRICT_ARGUMENT_NAMING): Define. + (PRETEND_OUTGOING_VARARGS_NAMED): Adjust. + (FUNCTION_ARG_PARTIAL_NREGS): Adjust. + (SH5_WOULD_BE_PARTIAL_NREGS): Define. + (SETUP_INCOMING_VARARGS): Adjust. + (HAVE_POST_INCREMENT, HAVE_PRE_DECREMENT): Adjust. + (USE_LOAD_POST_INCREMENT, USE_STORE_PRE_DECREMENT): Adjust. + (REGNO_OK_FOR_INDEX_P, REG_OK_FOR_INDEX_P): Adjust. + (SUBREG_OK_FOR_INDEX_P): Adjust. + (EXTRA_CONSTRAINT_S): Update. + (EXTRA_CONSTRAINT_T): New. + (EXTRA_CONSTRAINT): Adjust. + (GO_IF_LEGITIMATE_INDEX): Adjust. + (GO_IF_LEGITIMATE_ADDRESS): Adjust. + (LEGITIMIZE_ADDRESS, LEGITIMIZE_RELOAD_ADDRESS): Adjust. + (MOVE_MAX): Adjust. + (MAX_MOVE_MAX): Define. + (Pmode): Adjust. + (CONST_COSTS): Adjust. + (REGISTER_MOVE_COST): Adjust. + (BRANCH_COST): Adjust. + (TEXT_SECTION_ASM_OP): Adjust. + (DBX_REGISTER_NUMBER): Adjust. + (ASM_OUTPUT_DOUBLE_INT): New. + (UNALIGNED_DOUBLE_INT_ASM_OP): New. + (PREDICATE_CODES): Adjust. + (PROMOTE_MODE): Adjust. + (CRT_CALL_STATIC_FUNCTION): Do not define for SHmedia. + * config/sh/sh.md (AP_REG, PR_REG, T_REG, GBR_REG): Renumber. + (MACH_REG, MACL_REG, FPUL_REG, RAP_REG, FPSCR_REG): Renumber. + (PR_MEDIA_REG, T_MEDIA_REG, R10_REG): New. + (DR0_REG, DR2_REG, DR4_REG): Renumber. + (TR0_REG, TR1_REG, TR2_REG): New. + (XD0_REG): Renumber. + (UNSPEC_COMPACT_ARGS): New. + (type): Added pt and ptabs. + (length): Default to 4 on SHmedia. Default pt length to 12 + and 20 on SHmedia32 and SHmedia64, respectively. + (pt): New function unit. + (movdi, movsi): Add types pt and ptabs. Don't increment LABEL_NUSES. + Add whitespace between operands of SHmedia instructions. + (movdicc): Fix. + (adddi3_media, addsi3_media): Adjust constraints. + (subsi3) [SHmedia]: Force operand 1 into a register. + (udivsi3_i1_media, udivsi3_i4_media): New. + (udivsi3): Support SHmedia. + (divsi3_i1_media, divsi3_i4_media): New. + (divsi3): Support SHmedia. + (anddi3, iordi3, xordi3): Adjust constraints. + (zero_extendhidi2, zero_extendqidi2): New. + (extendsidi2, extendhidi2, extendqidi2): New. + (push, pop, push_e, push_fpul, push_4): Disable on SH5. + (pop_e, pop_fpul, pop_4): Likewise. + (movsi_media): Support FP and BT registers. + (movsi_media_nofpu): New. Adjust splits to DImode. + (lduw, ldub): Renamed to zero_extend* above. + (movqi_media): Fix typo. + (movdi_media): Support FP and BT registers. + (movdi_media_nofpu): New. Adjust splits for SHmedia32. + (movdi_const_32bit): New. + (shori_media): Require immediate operand. Use `u' for output. + (movdf_media, movsf_media): Simplified. + (movdf_media_nofpu, movsf_media_nofpu): New. + (movdf, movsf): Adjust + (movv2sf, movv2sf, movv16sf): New. + (beq_media, beq_media_i): Adjust constraints. Don't use + scratch BT register. + (bne_media, bne_media_i): Likewise. + (bgt_media, bgt_media_i): Likewise. + (bge_media, bge_media_i): Likewise. + (bgtu_media, bgtu_media_i): Likewise. + (bgeu_media, bgeu_media_i): Likewise. + (beq, bne, bgt, blt, ble, bge, bgtu, bltu, bgeu, bleu, + bunordered): Emit jump insn. Force operands to registers when + needed. + (jump_media, jump): Simplify. + (call_compact, call_compact_rettramp): New. + (call_value_compact, call_value_compact_rettramp): New. + (call_media, call_value_media): Simplify. + (sibcall_compact, sibcall_media): New. + (call, call_value): Adjust for SHmedia and SHcompact. + (sibcall, sibcall_value, untyped_call): Likewise. + (sibcall_epilogue): Preserve r0 across epilogue for SHcompact. + (indirect_jump): Adjust for SHmedia. + (casesi_jump_media): New. + (nop): Re-enable for SHmedia. + (call_site): Restrict to SH1. + (casesi): Adjust for SHmedia. + (casesi_shift_media, casesi_load_media): New. + (return): Explicitly use PR register. Call return trampoline + on SHcompact. + (return_i): Explicitly use PR register. + (shcompact_return_tramp, shcompact_return_tramp_i): New. + (return_media): Adjust. + (shcompact_incoming_args): New. + (epilogue): Adjust. + (seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu, sne): Adjust. + (movstrsi): Disable on SH5. + (fpu_switch0, fpu_switch1, movpsi): Enable on SH4. + (addsf3, addsf3_media): Test TARGET_SHMEDIA_FPU. + (subsf3, subsf3_media): Likewise. + (mulsf3, mulsf3_media, mac_media): Likewise. + (divsf3, divsf3_media): Likewise. + (floatdisf2, floatsisf2_media): Likewise. Adjust constraints. + (floatsisf2, fux_truncsfsi2): Likewise. + (fix_truncsfdi2, fix_truncsfsi2_media): Likewise. Adjust + constraints. + (cmpeqsf_media, cmpgtsf_media, cmpgesf_media): Likewise. + (cmpunsf_media, cmpsf): Likewise. + (negsf2, negsf2_media, sqrtsf2, sqrtsf2_media): Likewise. + (abssf2, abssf2_media): Likewise. + (adddf3, adddf3_media, subdf3, subdf3_media): Likewise. + (muldf3, muldf3_media, divdf3, divdf3_media): Likewise. + (floatdidf2, floatsidf2_media): Likewise. Adjust constraints. + (floatsidf2, fix_truncdfsi2): Likewise. + (fix_truncdfdi2, fix_truncdfsi2_media): Likewise. Adjust + constraints. + (cmpeqdf_media, cmpgtdf_media): Likewise. + (cmpgedf_media, cmpundf_media, cmpdf): Likewise. + (negdf2, negdf2_media, sqrtdf2, sqrtdf2_media): Likewise. + (absdf2, absdf2_media): Likewise. + (extendsfdf2, extendsfdf2_media): Likewise. + (truncsfdf2, truncsfdf2_media): Likewise. + * config/sh/sh64.h: New file. + * config/sh/t-sh64: New file. + * config/sh/shmedia.h: New file. + * config/sh/ushmedia.h: New file. + * config/sh/sshmedia.h: New file. + * configure.in: Added sh64-*-elf. + * configure: Rebuilt. + 2000-10-10 Alexandre Oliva + * config/sh/sh.c (GEN_MOV, GEN_ADD3, GEN_SUB3): New macros. + (reg_class_from_letter): Use `b' for TARGET_REGS. + (print_operand): Support `%M', `%m', `AND' and + `ASHIFTRT'. Do not precede constants with `#' on SHmedia. + (andcosts): Adjust for SHmedia. + (output_stack_adjust, sh_expand_prologue, sh_expand_epilogue): + Likewise. + (target_reg_operand): New function. + * config/sh/sh-protos.h (target_reg_operand): Declare. + * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Don't disable + FP registers on SH5. + (HARD_REGNO_MODE_OK): Accept them whenever they're acceptable + on SH4. + (TARGET_REGISTER_P): New macro. + (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Added TARGET_REGS. + (FUNCTION_VALUE): Use DImode for promoted types on SHmedia. + (EXTRA_CONSTRAINT_S): New macro. + (EXTRA_CONSTRAINT): Adjust. + (FLOAT_TYPE_SIZE): Define to 32. + (Pmode): DImode on SHmedia. + (CONST_COSTS): Adjust for SHmedia literals. + (PREDICATE_CODES): Added target_reg_operand. + (PROMOTE_MODE): Promote signed types to DImode on SHmedia. + * config/sh/sh.md: Remove all attrs from SHmedia insns. + (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): New insns. + (cmpdi): Accept SHmedia. + (movdicc_false, movdicc_true): New insns. + (movdicc): New expand. + (adddi3): Accept arith_operand for op2, but FAIL on SH1 if + no_new_pseudos. + (addsi3_media): Match `S' constraint. + (anddi3, andcdi3, iordi3, xordi3, negdi_media): New insns. + (negdi2): Expand for SHmedia. + (one_cmpldi2): New expand. + (zero_extendsidi2): Change from expand to insn. + (extendsidi2): Add constraints. + (movdi_media, movsi_media): Change `%x' to `%M'. Use `%m' for + LD/ST address. Fix SI immediate loading split. + (movhi_media, movqi_media, lduw, ldub): New insns. + (movhi, movqi): Accept SHmedia. + (shori_media, movdi_media): Relax input constraints. Split + symbolic constants. + (movdf_media, movsf_media): New insn. New split to movdi. + (movdf, movsf): Match on SHmedia. + (beq_media, bne_media, bgt_media, bge_media, bgtu_media, + bgeu_media): New insns and splits. New insns with `_i' suffix. + (beq, bne, bgt, blt, ble, bge, bgtu, bltu, bgeu, bleu): Adjust. + (bunordered): New expand. + (jump_compact): Renamed from `jump'. + (jump_media): New insn. + (jump): New expand. + (call_media, call_value_media): New insns. + (call, call_value): Adjust. + (indirect_jump_compact): Renamed from `indirect_jump'. + (indirect_jump_media): New insn. + (indirect_jump): New expand. + (untyped_call, return): Accept SHmedia. + (return_media): New insn. + (prologue, epilogue, blockage): Accept SHmedia. + (seq, slt, sle, sgt, sge, sgtu, sltu, sleu, sgeu, sne): Adjust. + (sunordered): New expand. + (addsf3, subsf3, mulsf3, divsf3, floatsisf2, fix_truncsfsi2, + cmpsf, negsf2, sqrtsf2, abssf2): Adjust for SHmedia. + (addsf3_media, subsf3_media, mulsf3_media, mac_media, + divsf3_media, floatdisf2, floatsisf2_media, fix_truncsfdi2, + fix_truncsfsi2_media, cmpeqsf_media, cmpgtsf_media, + cmpgesf_media, cmpunsf_media, negsf2_media, sqrtsf2_media, + abssf2_media): New insns. + (adddf3, subdf3, muldf3, divdf3, floatsidf2, fix_truncdfsi2, + cmpdf, negdf2, sqrtdf2, absdf2): Adjust for SHmedia. + (adddf3_media, subdf3_media, muldf3_media, divdf3_media, + floatdidf2, floatsidf2_media, fix_truncdfdi2, + fix_truncdfsi2_media, cmpeqdf_media, cmpgtdf_media, + cmpgedf_media, cmpundf_media, negdf2_media, sqrtdf2_media, + absdf2_media): New insns. + (extendsfdf2, truncdfsf2): Adjust for SHmedia. + (extendsfdf2_media, truncdfsf2_media): New insns. + 2000-09-14 Alexandre Oliva + * config/sh/sh.c (machine_dependent_reorg): On shmedia, skip for now. + * config/sh/sh.h (CONST_OK_FOR_J): Document. + (LEGITIMATE_CONSTANT_P): Accept CONST_DOUBLEs on shmedia. + * config/sh/sh.md (adddi3): New expand. + (adddi3_media, adddi3z_media): New insns. + (adddi3_compact): Renamed from adddi3. + (addsi3_media): Use add.l r63 to add constant zero. + (subdi3): New expand. + (subdi3_media): New insn. + (subdi3_compact): Renamed from subdi3. + (mulsidi3): New expand. + (mulsidi3_media): New insn. + (mulsidi3_compact): Renamed from mulsidi3. + (umulsidi3): New expand. + (umulsidi3_media): New insn. + (umulsidi3_compact): Renamed from umulsidi3. + (ashlsi3_media, ashrsi3_media, lshrsi3_media): New insns. + (ashlsi3, ashrsi3, lshrsi3): Use them. + (ashldi3_media, ashrdi3_media, lshrdi3_media): New insns. + (ashldi3, ashrdi3, lshrdi3): Use them. + (zero_extendsidi2): New expand. + (extendsidi2): New insn. + (movsi_media): New insn. Split to movdi to load constants. + (movsi): Enable for shmedia. + (movdi_media): New insn. Use shori_media to load wide constants. + (short_media): New insn. + (movdi): Enable for shmedia. + 2000-09-08 Alexandre Oliva + * config/sh/sh.h (CPP_SPEC): Added `m5'. + (SUBTARGET_CPP_SPEC): Added `!m5'. + (SH5_BIT, TARGET_SH5, TARGET_SHMEDIA, TARGET_SHCOMPACT): New macros. + (TARGET_SWITCHES): Added `5' and `5-compact'. Added SH1_BIT + to all other SH variants. + (TARGET_DEFAULT): Set to SH1_BIT. + (OVERRIDE_OPTIONS): Recognize sh5 CPU. + (BITS_PER_WORD): Raise to 64 on shmedia. + (MAX_BITS_PER_WORD): Change to 64. + (MAX_LONG_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): Set to MAX_BITS_PER_WORD. + (INT_TYPE_SIZE): Keep as 32. + (UNITS_PER_WORD): Raise to 8 on shmedia. + (MIN_UNITS_PER_WORD): Keep as 4. + (POINTER_SIZE): Raise to 64 on shmedia. + (CONST_OK_FOR_J): New macro. + (CONST_OK_FOR_LETTER_P): Use it. + (processor_type): Add PROCESSOR_SH5. + * config/sh/sh.md: Conditionalize all expands, insns and + splits to TARGET_SH1. + (cpu): Added sh5. + (addsi3_compact): Renamed from... + (addsi3): Now an expand. + (addsi3_media, subsi3_media): New insns. + (subsi3): Don't negate constants with SHmedia. + + * hooks.c: New file. + * hooks.h: New file. + * Makefile.in (HOOKS_H): New. + (TARGET_DEF_H): Added $(HOOKS_H). + (OBJS): Added hooks.o. + (cfgcleanup.o, bb-reorder.o): Added target.h. + (hooks.o): Added dependencies. + * target-def.h (TARGET_CANNOT_MODIFY_JUMPS_P): New, added to... + (TARGET_INITIALIZER): this. + * doc/tm.texi (TARGET_CANNOT_MODIFY_JUMPS_P): Document. + * target.h (struct gcc_target): Added cannot_modify_jumps_p. + * bb-reorder.c: Include target.h. + (reorder_basic_blocks): Skip if cannot modify jumps. + * cfgcleanup.c: Include target.h. + (try_optimize_cfg): Skip merge blocking if cannot modify jumps. + +2002-02-08 Chris Demetriou + + * config/mips/mips.md (casesi_internal, casesi_internal_di): + Protect jump delay slot instructions with .set noreorder and + .set nomacro. + +2002-02-08 Chris Demetriou + + * config/mips/mips.md (casesi_internal_di): Calculate + the index into the target offset table correctly. + +2002-02-08 Richard Henderson + + * expr.c (expand_expr): Mind EXPAND_INITIALIZER for truncation also. + * final.c (output_addr_const): Accept and discard SUBREG. + * varasm.c (decode_addr_const): Don't abort on unknown expressions -- + mark them unknown instead. + (simplify_subtraction): Handle RTX_UNKNOWN. + (initializer_constant_valid_p): Strip NOP_EXPRs that narrow the mode. + +2002-02-08 David Edelsohn + + * doc/invoke.texi (RS/6000 and PowerPC Options): Fix typo. + +2002-02-08 Richard Henderson + + * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_BSS): New. + +2002-02-08 Andreas Jaeger + + * config.gcc (x86_64-*-linux): Add t-linux64 makefile fragment. + * config/i386/t-linux64: New file. + +2002-02-08 Jakub Jelinek + + * c-common.c (c_expand_expr): Revert 2002-02-06 patch. + * c-parse.in (compstmt): Clear last_expr_type. + +2002-02-07 Richard Henderson + + * loop.c (strength_reduce): Sink final_value when not + eliminating a biv. + +2002-02-07 David O'Brien + + * config/sparc/freebsd.h: Fix mismatched spec {. + +2002-02-07 Richard Henderson + + * cfgrtl.c: Include recog.h and insn-config.h. + (keep_with_call_p): Fix general_operand invocation. + * Makefile.in (cfgrtl.o): Update dependencies. + +2002-02-07 Kazu Hirata + + * config/h8300/h8300.c (two_insn_adds_subs_operand): Revise a + comment. Accept HImode only if TARGET_H8300. + +2002-02-07 Eric Christopher + + * config/mips/crtn.asm: Cleanup #ifdefs. + +2002-02-07 Eric Christopher + + * config/mips/crti.asm: Add changes for mips16. mips16 uses + register 7 as RA instead of $31. + * config/mips/crtn.asm: Ditto. + * config/mips/mips.c (mips_move_2words): Add case for + TARGET_MIPS16 when HOST_BITS_PER_WIDE_INT >= 64. + (compute_frame_size): Fix typo. + (save_restore_insns): Ditto. Make documentation about using + register $7 as return register more precise. + (mips_expand_epilogue): Fix comment. Add code to work around not + being able to add to the stack pointer directly. + * config/mips/mips.h (EH_RETURN_DATA_REGNO): Change register number + to 2 for TARGET_MIPS16 as we need 6 and 7 as clobbers in the + epilogue. + +2002-02-07 Tom Rix + + * config/rs6000/rs6000.c (reg_or_aligned_short_operand): New. For + immediates in ldu and stdu DS opcode field. + * config/rs6000/rs6000.md (movdi_update, movdi_update1): Use. + * config/rs6000/rs6000-protos.h: Add reg_or_aligned_short_operand. + * config/rs6000/rs6000.h (PREDICATE_CODES): Same. + +2002-02-07 Jeff Sturm + + * config/sparc/sparc.c (compute_frame_size): Don't correct frame + offset for stack bias. + +2002-02-07 H.J. Lu + + * config/mips/linux.h (SUBTARGET_ASM_DEBUGGING_SPEC): Defined. + +2002-02-07 Ulrich Weigand + + * testsuite/gcc.dg/cpp/charconst-2.c: Add -fsigned-char option. + +Thu Feb 7 12:14:17 CET 2002 Jan Hubicka + + * i386-protos.h (x86_order_regs_for_local_alloc): Declare + * i386.c (x86_order_regs_for_local_alloc): New global function. + * i386.h (REG_ALLOC_ORDER): CLeanup. + (ORDER_REGS_FOR_LOCAL_ALLOC): New. + +2002-02-07 Richard Henderson + + PR optimization/2463 + * alias.c (find_base_value): Recall base values for fixed hard regs. + * loop.c (loop_regs_update): Don't use single_set on non-insns. + +2002-02-07 Alexandre Oliva + + * config/mips/mips.md (define_delay) [mips16]: Adjust required + length. + +2002-02-06 Richard Henderson + + PR c/5609 + * stmt.c (resolve_operand_name_1): Take more care with mixed + named and unnamed operands. + +2002-02-06 Janis Johnson + Jan Hubicka + + * loop.c (remove_constant_addition): Avoid clobbering a shared + CONST expression. + +2002-02-06 Ulrich Weigand + + * config.gcc (s390x-*-linux*): Add t-linux64 makefile fragment. + * config/s390/t-linux64: New file. + * config/s390/libgcc-glibc.ver: New file. + +2002-02-06 Ulrich Weigand + + * config/s390/linux64.h: Delete file. + * config/s390/s390x.h: New file. + * config.gcc (s390x-*-linux*): Use s390x.h instead of linux64.h + as target header file. + * config/s390/linux.h (TARGET_VERSION): Define depending on + DEFAULT_TARGET_64BIT. + (CPP_SPEC, ASM_SPEC, LINK_SPEC): Likewise. + (SIZE_TYPE, PTRDIFF_TYPE): Likewise. + (NO_BUILTIN_SIZE_TYPE, NO_BUILTIN_PTRDIFF_TYPE): Define. + (CPP_ARCH31_SPEC, CPP_ARCH64_SPEC): New defines. + (LINK_ARCH31_SPEC, LINK_ARCH64_SPEC): New defines. + (EXTRA_SPEC): New define. + * config/s390/s390.h (TARGET_VERSION): Define depending on + DEFAULT_TARGET_64BIT. + (MASK_RETURN_ADDR): Add run-time check for TARGET_64BIT. + +2002-02-06 Jason Merrill + + * c-decl.c (finish_function): Warn about a non-void function with + no return statement and no abnormal exit. + (current_function_returns_abnormally): New variable. + (start_function): Clear it. + (struct c_language_function): Add returns_abnormally. + (push_c_function_context): Save it. + (pop_c_function_context): Restore it. + (builtin_function): Set TREE_THIS_VOLATILE on return fns. + (grokdeclarator): Set C_FUNCTION_IMPLICIT_INT on functions without + an explicit return type. + * c-tree.h: Declare current_function_returns_abnormally. + (C_FUNCTION_IMPLICIT_INT): New macro. + * c-typeck.c (build_function_call): Set it. + (c_expand_return): Set current_function_returns_value even if the + value is erroneous. + +2002-02-06 Jakub Jelinek + + PR c/5420: + * c-common.c (c_unsafe_for_reeval): Make COMPOUND_LITERAL_EXPR + unsafe for reevaluation. + +2002-02-06 Jakub Jelinek + + PR c/5482: + * c-common.c (c_expand_expr) [STMT_EXPR]: If last expression is not + EXPR_STMT, but COMPOUND_STMT, recurse into it. + +2002-02-06 Richard Henderson + + * cfganal.c (keep_with_call_p): Source for fixed_reg dest must + be a general_operand. Dest for function value must be a pseudo. + +2002-02-06 Nick Clifton + + * dbxout.c (dbxout_symbol_location): Accept LABEL_REFs as well + as SYMBOL_REFs from the constant pool. + +2002-02-06 Alexandre Oliva + + * dbxout.c (dbxout_parms): Apply DEBUGGER_ARG_OFFSET to parameters + passed by invisible reference. + +2002-02-05 Richard Henderson + + * config/sparc/sparc.h (ARG_POINTER_CFA_OFFSET): No stack bias. + +2002-02-06 Hans-Peter Nilsson + + Implement using "base addresses" in insn operands as default. + * config/mmix/mmix.c (mmix_conditional_register_usage): if + -mabi=gnu, modify fixed_regs to fit the GNU ABI. + (mmix_extra_constraint): Use 'R' to indicate that GETA should be + used to read the rtx value. + (mmix_target_asm_function_epilogue): Fix spacing. + (mmix_constant_address_p): Handle TARGET_BASE_ADDRESSES. + (mmix_legitimate_address): Ditto. + (mmix_encode_section_info): Set SYMBOL_REF_FLAG on rtx:es that + should be loaded with a GETA insn. Don't allocate needless extra + char for nul termination and fix misleading comment. + (mmix_print_operand_address): Handle constants if + TARGET_BASE_ADDRESSES. + (mmix_output_register_setting): Use base addressing if + TARGET_BASE_ADDRESSES and the number of insns is 3. + * config/mmix/t-mmix (MULTILIB_EXTRA_OPTS): New. + * config/mmix/mmix.md ("movdi"): Change the alternative with GETA + to use R as constraint, add LDA to match s. + * config/mmix/mmix.h (TARGET_BASE_ADDRESSES): New. + (TARGET_DEFAULT): Add TARGET_MASK_BASE_ADDRESSES. + (TARGET_SWITCHES): Add -mbase-addresses, -mno-base-addresses. + (FIXED_REGISTERS): Make registers $231..$246 fixed by default. + (MMIX_MMIXWARE_ABI_REG_ALLOC_ORDER): Move $231..$246 last, in + order with other fixed registers. + (MMIX_GNU_ABI_REG_ALLOC_ORDER): Put forward $231, in order with + other parameter/call-clobbered registers. + * doc/invoke.texi (Option Summary) : Add + -mbase-addresses, -mno-base-addresses. + (MMIX Options): Ditto. + +2002-02-05 John David Anglin + + * pa.h (PREDICATE_CODES): Add reg_before_reload_operand. + +2002-02-06 Aldy Hernandez + + * config/rs6000/altivec.h: Change elem to _S_elem. + +2002-02-05 Jason Thorpe + + * config/netbsd.h (WCHAR_TYPE): Define. + (WCHAR_TYPE_SIZE): Ditto. + (WINT_TYPE): Ditto. + * config/alpha/netbsd.h (WCHAR_TYPE): Remove. + (WCHAR_UNSIGNED): Ditto. + (WCHAR_TYPE_SIZE): Ditto. + (WINT_TYPE): Ditto. + * config/arm/netbsd.h: Likewise. + * config/i386/netbsd-elf.h: Likewise. + * config/i386/netbsd.h: Likewise. + * config/m68k/netbsd-elf.h: Likewise. + * config/m68k/netbsd.h: Likewise. + * config/ns32k/netbsd.h: Likewise. + * config/sparc/netbsd.h: Likewise. + * config/vax/netbsd.: Likewise. + +2002-02-05 Alexandre Oliva + + * target.h (struct gcc_target): Added ms_bitfield_layout_p. + * target-def.h (TARGET_MS_BITFIELD_LAYOUT_P): New. Added to... + (TARGET_INITIALIZER): this. + * doc/tm.texi (TARGET_MS_BITFIELD_LAYOUT_P): Document. + (BITFIELD_NBYTES_LIMITED): Markup fix. + * tree.h (default_ms_bitfield_layout_p): Declare. + (record_layout_info): Added prev_field. + * tree.c (default_ms_bitfield_layout_p): New fn. + * c-decl.c (finish_struct): Disregard EMPTY_FIELD_BOUNDARY and + PCC_BITFIELD_TYPE_MATTERS for MS bit-field layout. + * stor-layout.c: Include target.h. + (start_record_layout): Initialize prev_field. + (place_field): Handle MS bit-field layout, and disregard + EMPTY_FIELD_BOUNDARY, BITFIELD_NBYTES_LIMITED and + PCC_BITFIELD_TYPE_MATTERS in this case. Update prev_field. + * Makefile.in (stor-layout.o): Adjust dependencies. + +2002-02-05 Jason Merrill + + * collect2.c (dump_file): Pass DMGL_VERBOSE to cplus_demangle. + +2002-02-05 Andreas Jaeger + + * crtstuff.c: Fix comments. + +2002-02-05 Richard Henderson + + PR fortran/3393 + * loop.c (loop_iv_add_mult_emit_before): Copy multiplier as well. + (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise. + + PR fortran/3392 + * config/mips/mips.c (function_arg): Handle TImode. + (function_arg_advance): Likewise. + +2002-02-05 Aldy Hernandez + + * config/rs6000/altivec.h (vec_step_help): Rename to + __vec_step_help. + +2002-02-05 Aldy Hernandez + + * config/rs6000/altivec.h: Fix typos. + +2002-02-05 Jason Thorpe + + * config/arm/netbsd.h: Correct a comment. + +2002-02-05 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_init_builtins): Fix typo + building void typed builtins. + + * config/rs6000/altivec.h (vec_ld*): Fix typos. + (vec_step): Implement for C++. + +Mon Feb 4 19:23:19 2002 Richard Kenner + + * final.c (final_scan_insn): Add case for NOTE_INSN_LOOP_END_TOP_COND. + +2002-02-04 Richard Henderson + + * combine.c (nonzero_bits): Re-introduce special case for + sp/fp/ap wrt REGNO_POINTER_ALIGN. + +2002-02-05 Aldy Hernandez + + * doc/extend.texi: Warn about unsupported usage of altivec + builtins. + + * config/rs6000/rs6000.md (altivec_vcmp*_p): Remove. + (altivec_predicate_*): New. + + * config/rs6000/altivec.h: Rewrite predicates to use new builtins. + Add C++ version of vec_*() functions. + + * config/rs6000/rs6000.c (bdesc_altivec_preds): New. + (bdesc_2arg): Remove altivec predicates. + (altivec_expand_builtin): Handle predicates. + (altivec_init_builtins): Handle predicates. + (altivec_expand_predicate_builtin): New. + +2002-02-04 John David Anglin + + * pa.c (DO_FRAME_NOTES): Move forward. + (store_reg): Revise handling of frame notes. + (load_reg): Likewise. + (set_reg_plus_d): Likewise. + (hppa_expand_prologue): Likewise. + (hppa_expand_epilogue): Likewise. + +2002-02-04 John David Anglin + + * unwind-dw2-fde-glibc.c: Define _GNU_SOURCE if not defined. + +2002-02-04 Jakub Jelinek + + PR c/4475, c++/3780: + * c-common.def (SWITCH_STMT): Add SWITCH_TYPE operand. + * c-common.h (SWITCH_TYPE): Define. + * c-typeck.c (c_start_case): Set SWITCH_TYPE. + * stmt.c (all_cases_count): Set lastval to thisval at end of loop. + Rename spareness variable to sparseness. + (expand_end_case_type): Renamed from expand_end_case, use orig_type + if non-NULL instead of TREE_TYPE (orig_index). + * tree.h (expand_end_case_type): Renamed from expand_end_case. + (expand_end_case): Define using expand_end_case_type. + * c-semantics.c (genrtl_switch_stmt): Pass SWITCH_TYPE + to expand_end_case_type. + * doc/c-tree.texi (SWITCH_STMT): Document SWITCH_TYPE. + +2002-02-04 John David Anglin + + * pa.h (PREFERRED_STACK_BOUNDARY): Define to match standard rounding. + (BIGGEST_ALIGNMENT): Change to 128. + +2002-02-04 John David Anglin + + * pa32-linux.h (LINK_COMMAND_SPEC): Define. + +2002-02-04 John David Anglin + + * pa.md (call_internal_reg_64bit): Remove unused variable. + +2002-02-04 Nick Clifton + + * config/arm/arm.h (machine_function): Add uses_anonymous_args + field. + (SETUP_INCOMING_VARARGS): Set uses_anonymous_args. + * config/arm/arm.c (current_function_anonymous_args): Delete, + replace uses with cfun->machine->uses_anonymous_args. + (arm_reorg): Do not reset uses_anonymous_args. + + * config/arm/arm.c (arm_hard_regno_mode_ok): Allow any value in + any geenral register. + +2001-02-04 Bernd Schmidt s + + * cfgrtl.c (force_nonfallthru_and_redirect): Don't try to redirect + the entry block. + +2002-02-04 Richard Henderson + + * combine.c (force_to_mode): Remove STACK_BIAS code. + (nonzero_bits): Likewise. Replace sp/fp special case with + REGNO_POINTER_ALIGN. + + * config/sparc/sparc.h (FRAME_POINTER_REGNUM): Change to SFP. + (HARD_FRAME_POINTER_REGNUM): New. + (FIRST_PSEUDO_REGISTER, REG_CLASS_CONTENTS): Update. + (FIXED_REGS, CALL_USED_REGS): Update. + (REG_ALLOC_ORDER, REGISTER_NAMES): Update. + (CONDITIONAL_REGISTER_USAGE): Update for HFP. + (HARD_REGNO_NREGS): Update for SFP. + (STACK_POINTER_OFFSET): Include bias here ... + (FIRST_PARM_OFFSET): ... not here. + (STACK_BIAS): Remove. + (INIT_EXPANDERS): New. + (STARTING_FRAME_OFFSET): Do not include bias. + (ELIMINABLE_REGS, CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET): New. + (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P): Update for SFP. + (REG_OK_FOR_INDEX_P, REG_OK_FOR_BASE_P): Likewise. + * config/sparc/aout.h (DBX_REGISTER_NUMBER): Update for HFP. + * config/sparc/litecoff.h, config/sparc/sol2.h: Likewise. + * config/sparc/sparc.c (mem_min_alignment): Update for HFP. + (sparc_nonflat_function_prologue, epilogue_renumber): Likewise. + (MUST_SAVE_REGISTER): Likewise. + (sparc_flat_function_prologue): Likewise. + (sparc_flat_function_epilogue): Likewise. + (HARD_FRAME_POINTER_MASK): Rename from FRAME_POINTER_MASK. + (sparc_init_modes): SFP is GENERAL_REGS. + (sparc_builtin_saveregs): SFP does not have bias applied. + +2002-02-04 Richard Henderson + + * config/alpha/alpha.c (current_function_is_thunk): Don't check + current_function_is_thunk. + (alpha_sa_mask): Distinguish between current_function_is_thunk + called from ASM_OUTPUT_MI_THUNK and not. + (alpha_does_function_need_gp): Thunks always need gp. + (alpha_start_function, alpha_output_function_end_prologue): Likewise. + (alpha_output_mi_thunk_osf): New. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): New. + +2002-02-04 Richard Sandiford + + * c-typeck.c (build_c_cast): Warn when qualifiers are added to + function types, not when they're taken away. + +Mon Feb 4 09:05:58 2002 Jeffrey A Law (law@redhat.com) + + * cfgrtl.c (try_redirect_by_replacing_jump): Remove associated + CODE_LABEL and jump table when replacing a table jump with a + simple jump. + +2002-02-04 Ulrich Weigand + + * config/s390/s390-protos.h (legitimize_la_operand, + s390_secondary_input_reload_class, s390_plus_operand, + s390_expand_plus_operand): Add prototypes. + + config/s390/s390.c (s390_secondary_input_reload_class, + s390_plus_operand, s390_expand_plus_operand): New functions. + + (struct s390_address): New member 'pointer'. + (s390_decompose_address): Compute it. + (legitimate_la_operand_p): Use it. + (legitimize_la_operand): New function. + (movti, movdi, movdf splitters): Call it. + + config/s390/s390.h (SECONDARY_INPUT_RELOAD_CLASS): Define. + (PREDICATE_CODES): Add s390_plus_operand. + + config/s390/s390.md (adddi3_inv_64, addaddr_ccclobber): Delete. + (la_ccclobber): Allow GENERAL_REGS as output operand. + + (reload_load_address, *reload_load_address_reg_0, *la, *do_la_reg_0, + *reload_la_64, *reload_la_31 and splitters): Delete, replace by ... + (*la_64, *la_31, reload_indi, reload_insi): ... these. + +2002-02-04 Ulrich Weigand + + * gcc/config/s390/s390.h (CRT_CALL_STATIC_FUNCTION): Fixed + register names for regular asm () construct. + +2002-02-04 Jakub Jelinek + + * config/i386/i386.md (movsf_1): Allow moving SF values in MMX + registers. + +2002-02-04 Jakub Jelinek + + * combine.c (recog_for_combine): Create a dummy insn with PATTERN + pat for recog. + +2002-02-04 Hartmut Penner + + * varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in + constant pool to be identical by string address and index. + +2002-02-04 Anthony Green + + * output.h (SECTION_OVERRIDE): Define. + * varasm.c (named_section): Obey SECTION_OVERRIDE. + +2002-02-03 Jason Thorpe + + * config.gcc (arm*-*-netbsdelf*): Placeholder to prevent match + by existing arm*-*-netbsd* (a.out) target. + (ns32k-*-netbsdelf*): Likewise. + (sparc-*-netbsdelf*): Likewise. + (vax-*-netbsdelf*): Likewise. + +2002-02-03 Danny Smith + + * gthr-win32.h: Protect against conflicting typedef for BOOL in windows + headers and libobjc headers. + +2002-02-03 Mumit Khan + + * gthr-win32.h (__mingwthr_key_dtor): Use extern "C" linkage for C++. + (_mingw.h): Remove duplicate include. + +2002-02-03 Jason Thorpe + + * config.gcc: Set cpu_type to m68k for 68010, as well. + (m68010-*-netbsdelf*): New... + (m68k*-*-netbsdelf*): ...targets. + * config/m68k/netbsd-elf.h: New file. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.c (hand_list): Move inside function_arg. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.c (h8_push_ops): Move inside + h8300_init_once. + (h8_pop_ops): Likewise. + (h8_move_ops): Likewise. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.c (os_task): Make it static. + (monitor): Likewise. + (pragma_saveall): Likewise. + +2002-02-02 Alexandre Oliva + + * config/sh/sh.md (ic_invalidate_line): Make sure the immediate + constant is a valid sign-extension for Pmode. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.md: Fix formatting. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.md (one_cmpl patterns): Tighten the + predicates of operands[1]. Split the patterns for each + processor variant. + +2002-02-02 Kazu Hirata + + * config/h8300/h8300.md (xor patterns): Tighten the predicates + of operands[1] to register_operand. + +2002-02-02 Neil Booth + + * cpphash.h (struct spec_nodes): Remove n__CHAR_UNSIGNED__. + * cpphash.c (_cpp_init_hashtable): Similarly. + * cppinit.c (cpp_create_reader): Default the signed_char flag. + (init_builtins): Define __CHAR_UNSIGNED__ appropriately. + (COMMAND_LINE_OPTIONS): Recognize -f{un,}signed-char. + (cpp_handle_option): Handle the new options. + * cpplex.c (cpp_interpret_charconst): Use new flag. + * cpplib.h (struct cpp_options): New member signed_char. + * gcc.c (cpp_unique_options): Remove %c spec and documentation. + (cpp_options): Handle -fsigned-char and -funsigned-char. + (static_specs): Remove signed_char_spec. + (do_spec1): Don't handle %c. + * system.h: Poison SIGNED_CHAR_SPEC. + * tradcif.y (yylex): Use flag_signed_char. + * tradcpp.h (flag_signed_char): New. + * tradcpp.c (flag_signed_char): New. + (main): Handle new command-line options. + (initialize_builtins): Define __CHAR_UNSIGNED__ if appropriate. +config: + * alpha/alpha.h (SIGNED_CHAR_SPEC): Remove. + * avr/avr.h: Remove old comments. + * i960/i960.h (CPP_SPEC): Pass -fsigned-char if -mic*. + (CC1_SPEC): Pass -fsigned-char if -mic*. + (SIGNED_CHAR_SPEC): Remove. +doc: + * tm.texi (SIGNED_CHAR_SPEC): Remove documentation. + +2002-02-01 Eric Christopher + + From Daniel Jacobowitz + * config/mips/mips.h (FUNCTION_PROFILER): Fix function profiling. + * config/mips/linux.h (ASM_OUTPUT_REG_PUSH): Undefine. + (ASM_OUTPUT_REG_POP): Ditto. + +2002-02-02 Neil Booth + + * c-decl.c, tree.c, tree.h, objc/objc-act.c: Revert bitfield + patch. + +2002-02-02 Jakub Jelinek + + * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Add missing | separators. + +2002-02-02 Jakub Jelinek + + PR c/5304: + * expmed.c (expand_mult_highpart): Use immed_double_const for wide_op1 + unconditionally. + +2002-02-01 Janis Johnson + + * cfganal.c: Include tm_p.h. + (keep_with_call_p): Fix the test that determines if a register holds + the return value of a call. + +2002-02-01 DJ Delorie + + * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): If + we are given conflicting registers, switch to the other one we + had allocated for us. + * config/sparc/sparc.md (reload_indi, reload_outdi): Pass op[2] + as TImode so we know when the "other" register is available. + +2002-02-01 David O'Brien + + * config/sparc/sol2-sld-64.h: Include sparc/biarch64.h rather than + sparc/sparc_bi.h. + +2002-02-01 Janis Johnson + + * cfganal.c (keep_with_call_p): New function. + (flow_call_edges_add): Prevent splitting a block between a call and + a single-set instruction that should be kept in the same block. + +2002-02-01 Craig Rodrigues + + * doc/install.texi (avr): Update outdated URL. + +2002-01-30 Andrew Haley + + * config/stormy16/stormy16.md (pushqi): New. + (popqi): New. + (pushhi): New. + (pophi): New. + (movhi): Remove stack operands. + (movqi): Likewise. + * config/stormy16/stormy16.h (PREDICATE_CODES): Add + nonimmediate_nonstack_operand. + * config/stormy16/stormy16.c (nonimmediate_nonstack_operand): + New. + * config/stormy16/stormy16-protos.h (nonimmediate_nonstack_operand) + New. + +2002-01-31 Jason Merrill + + * Makefile.in (c-parse.c): Handle .output file. + * objc/Make-lang.in (objc-parse.c): Likewise. + +2002-02-01 Alexandre Oliva + + * config/mips/mips.h (ENDIAN_SPEC): Output the endianness flag if + the -me[lb] option is given. Don't output the default flag + twice. + +2002-01-31 Zack Weinberg + + * c-lex.c (yyparse): Call debug_hooks->start_source_file for + the primary source file; this has not been done yet. + * c-decl.c (c_expand_body): Reset input_filename from + DECL_SOURCE_FILE (fndecl) before calling init_function_start. + +2002-01-31 Kazu Hirata + + * rtlanal.c (subreg_regno_offset): Do not use + SUBREG_REGNO_OFFSET. + * system.h: Add SUBREG_REGNO_OFFSET to the GCC poison list. + * doc/tm.texi (SUBREG_REGNO_OFFSET): Remove. + +2002-01-31 Joseph S. Myers + + * gccbug.in: Follow GNU Coding Standards for --version. Use GCC + version rather than GNATS version in --version output. + +2002-01-31 Richard Sandiford + + * ifcvt.c (noce_process_if_block): Make a copy of the destination + when copying back from a temporary. + +2002-01-30 Richard Henderson + + * ifcvt.c (dead_or_predicable): Handling merging when other_bb + and new_dest are the same. + +2002-01-30 Richard Henderson + + PR opt/5076 + * rtl.h (NOTE_INSN_LOOP_END_TOP_COND): New. + * rtl.c (note_insn_name): Update. + * emit-rtl.c (remove_unnecessary_notes): Kill it. + * stmt.c (expand_end_loop): Kill jump opt code. Use LOOP_END_TOP_COND + to perform loop rotation. + (expand_exit_loop_top_cond): New. + * tree.h (expand_exit_loop_top_cond): Declare it. + * c-semantics.c (genrtl_while_stmt): Use it. + (genrtl_for_stmt): Likewise. + +2002-01-30 Alexandre Oliva + + * config/mips/mips.h (PARM_BOUNDARY): Guarantee alignment of + arguments to 64-bit boundaries on 64-bit ABIs. + +2002-01-30 Steve Ellcey + + * loop.c (loop_invariant_p): Special case pic_offset_table_rtx. + +2002-01-31 Joseph S. Myers + + * c-decl.c (grokdeclarator): Handle type being a typedef for an + invalid type. + +2002-01-30 David O'Brien + + * config.gcc: Include sparc/biarch64.h rather than sparc/sparc_bi.h. + * config/sparc/sparc_bi.h: Remove file. + * config/sparc/biarch64.h: New file (rename of sparc_bi.h). + +2002-01-30 Richard Henderson + + * sched-deps.c (sched_analyze): Make a call read the frame pointer. + +2002-01-30 Zack Weinberg + + * expmed.c (emit_store_flag): Call protect_from_queue on op0 and op1. + +2002-01-30 Jason Merrill + + * dwarf2out.c (dwarf_cfi_name): Add other DWARF 3 codes. + (output_cfi): Likewise. Disable DW_CFA_GNU_negative_offset_extended. + (reg_save): Use DW_CFA_offset_extended_sf instead. + + * dwarf2out.c (dwarf2out_finish): Don't abort if there were errors. + +2002-01-29 Jakub Jelinek + + * cselib.c (cselib_record_sets): Use IF_THEN_ELSE result + in cselib_lookup. + +2002-01-29 Aldy Hernandez + + * rs6000.md ("*call_value_local32"): Remove constraints. + ("*call_value_local64"): Same. + ("*call_value_indirect_nonlocal_aix32"): Same. + ("*call_value_nonlocal_aix32"): Same. + ("*call_value_indirect_nonlocal_aix64"): Same. + ("*call_value_nonlocal_aix64"): Same. + ("*call_value_nonlocal_sysv"): Same. + +2002-01-29 Richard Henderson + + * config/alpha/elf.h (SDB_DEBUGGING_INFO): Undef. + +2002-01-29 Richard Henderson + + * expr.c (force_operand): Ignore flag_pic for detecting pic + address loads. + * regclass.c (init_reg_sets_1): Test fixed_regs not flag_pic + for determining if PIC_OFFSET_TABLE_REGNUM is call-clobbered. + * resource.c (mark_target_live_regs): Use regs_invalidated_by_call + instead of open-coded loop. + * doc/tm.texi (PIC_OFFSET_TABLE_REGNUM): Clarify that it must + be fixed when in use. + +2002-01-29 Richard Henderson + + * sched-int.h (struct deps_reg): Add uses_length, clobbers_length. + * sched-rgn.c (propagate_deps): Update them. + * sched-deps.c (sched_analyze_insn): Update them. Flush the + clobbers list when either gets too long. + +2002-01-29 Jakub Jelinek + + * config/i386/i386.h (LIMIT_RELOAD_CLASS): Handle LEGACY_REGS + and INDEX_REGS the same as GENERAL_REGS. + (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. + +2002-01-29 Neil Booth + + * tree.c (build_nonstandard_integer_type): Correct prototype. + +2002-01-29 Ulrich Weigand + + * config/s390/s390.md (movstrsico, movstrdix_64, + movstrsix_31): Remove, replace by ... + (movstrdi_short, movstrsi_short, movstrdi_long, + movstrsi_long): ... these. New. + (movstrdi, movstrsi): Adapt. + + (rotldi3, rotlsi3, ashldi3, *ashldi3_31, *ashldi3_64, + ashlsi3, lshrdi3, *lshrdi3_31, *lshrdi3_64, lshrsi3): + Remove unnecessary CC clobber. + (*ashrdi3_cc_31, *ashrdi3_cconly_31, *ashrdi3_cc_64, + *ashrdi3_cconly_64, *ashrsi3_cc, *ashrsi3_cconly): New. + + (divmoddi4): Don't partially initialize TImode register. + +2002-01-29 Geoffrey Keating + + * doc/sourcebuild.texi (C Tests): Document gcc.dg/debug directory. + +2002-01-29 Richard Henderson + + * flow.c (print_rtl_and_abort): Remove. + (print_rtl_and_abort_fcn): Remove. + (verify_local_live_at_start): Use dump_bb instead. + (verify_wide_reg): Likewise. Take a basic_block, not rtl endpoints. + (verify_wide_reg_1): Return 2 on mode test failure. + +2002-01-29 Neil Booth + + PR c/3325, c/3326, c/2511, c/3347 + * c-decl.c (enum_decl_context): Remove BITFIELD. + (grokdeclarator): Take bitfield width as an input. + Ensure bitfields are given the correct type. Perform + bitfield width validation with build_bitfield_integer_type + rather than waiting for finish_struct. + (grok_typename, grok_typename_in_parm_context, start_decl, + push_parmdecl, grokfield, start_function): Update calls to + grokdeclarator. + (build_bitfield_integer_type): New function. + (finish_struct): Move bitfield validation to grokdeclarator + and build_bitfield_integer_type. + * tree.c (build_nonstandard_integer_type): New function. + * tree.h (build_nonstandard_integer_type): New prototype. +objc: + * objc-act.c (objc_copy_list): Remove DECL_INITIAL kludge. + +2002-01-29 Jakub Jelinek + + PR other/1502: + * cppinit.c (cpp_handle_option): Add ignore argument, if it is zero, + don't ignore unrecognized -W* options. + (cpp_handle_options): Pass 1 as last argument to cpp_handle_option. + * cpplib.h (cpp_handle_option): Adjust prototype. + * c-decl.c (c_decode_options): Pass 0 as last argument to + cpp_handle_option. + + PR c/2896: + * gcc.c (cpp_unique_options): Split from cpp_options. + (cpp_options): Source cpp_unique_options. + (default_compilers): Use cpp_unique_options instead of cpp_options + when used together with cc1_options. + (static_specs): Add cpp_unique_options. + * objc/lang-specs.h: Use cpp_unique_options instead of cpp_options + when used together with cc1_options. + +2002-01-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype of + output_a_shift. + * config/h8300/h8300.c (output_a_shift): Remove an unused + argument 'insn'. Remove redundant code. + * config/h8300/h8300.md: Adust to the new prototype of + output_a_shift. + +2002-01-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototypes of + emit_a_rotate and expand_a_rotate. + * config/h8300/h8300.c (emit_a_rotate): Change the type of the + first argument to 'enum rtx_code'. + (expand_a_rotate): Likewise. + +2002-01-28 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype of + output_simode_bld. + * config/h8300/h8300.c (output_simode_bld): Remove an argumen + 'log2'. + * config/h8300/h8300.md: Adjust to the new prototype. + +2002-01-28 Kazu Hirata + + * conifg/h8300/h8300.c (h8300_adjust_insn_length): Remove + redundant code. + +2002-01-28 John David Anglin + + * emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM + is a fixed register before returning pic_offset_table_rtx. + * loop.c (scan_loop): Don't hoist insns that set pic_offset_table_rtx + when PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined. + +2002-01-28 Jason Merrill + + * dwarf2.h: Sync with src version. + +2002-01-28 Paul Koning + + * builtin-types.def (BT_FN_VOID_CONST_PTR_VAR): Replace + BT_FN_VOID_PTR_VAR. + * builtins.def (BUILT_IN_PREFETCH): Change first argument to be const. + * doc/extend.texi (__builtin_prefetch): Update documentation: + first argument is now const void ptr. + +2002-01-28 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove an unused prototype. + +2002-01-28 Roman Zippel + + * toplev.c (lang_independent_init): Round up identifier size. + +2002-01-28 Richard Earnshaw + + * config.gcc: Revert previous change. + +2002-01-28 Andris Pavenis + + * config/i386/djgpp.h: Use STRIP_NAME_ENCODING in macro UNIQUE_SECTION + +2002-01-28 Richard Earnshaw + + * config.gcc (*-*-netbsdelf*): Set up generic parameters. + (*-*-netbsd*): Always use collect2. Remove collect2 settings from + other non-elf netbsd config frags. + * config/netbsd-aout.h (STARTFILE_SPEC): Don't pull in c++rt0 since + collect2 will does that. + * config/netbsd.h (LIBGCC_SPEC): Add white space before -lgcc, so that + shared-lib frobbing will work. + +2002-01-28 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. + * config/h8300/h8300.md: Likewise. + +2002-01-28 Loren J. Rittle + + * fixinc/inclhack.def (strict_ansi_not): Add a bypass based on + the old, removed AAA_standards fix. + * fixinc/fixincl.x: Rebuilt. + +2002-01-28 Hans-Peter Nilsson + + * config/cris/cris.h (CRT_CALL_STATIC_FUNCTION): Change to emit + atexit call in crtbegin, hooked in after call to frame_dummy; + register EH before registering __fini__start. + +2002-01-28 Aldy Hernandez + + * config/rs6000/altivec.h: Remove spurious semicolons. + +2002-01-27 Kazu Hirata + + * config/h8300/h8300.md: Replace dead bit extraction patterns + with ones that work. + +Sun Jan 27 13:23:40 2002 Richard Kenner + + * emit-rtl.c (get_mem_attrs): Don't default alignment for non-BLKmode + if not STRICT_ALIGNMENT. + * rtl.h (MEM_ALIGN): Likewise. + +2002-01-27 Craig Rodrigues + + * doc/invoke.texi (-fdump-translation-unit): Revert this + patch: 2001-10-21 Craig Rodrigues + +2002-01-27 Kazu Hirata + + * config/h8300/h8300.md (define_constants): New. + (anonymous patterns) Use defined constants appropriately. + +2002-01-27 Kazu Hirata + + * config/h8300/h8300.c (function_arg): Remove redundant code. + +2002-01-26 Richard Henderson + + * sched-deps.c (reg_pending_uses_head): New. + (reg_pending_barrier): Rename from reg_pending_sets_all. + (find_insn_list): Don't mark inline. + (find_insn_mem_list): Remove. + (add_dependence_list, add_dependence_list_and_free): New. + (flush_pending_lists): Replace only_write param with separate + for_read and for_write parameters. Update all callers. Use + add_dependence_list_and_free. + (sched_analyze_1): Do not add reg dependencies here; just set + the pending bits. Use add_dependence_list. + (sched_analyze_2): Likewise. + (sched_analyze_insn): Replace schedule_barrier_found with + reg_pending_barrier. Add all dependencies for pending reg + uses, sets, and clobbers. + (sched_analyze): Don't add reg dependencies for calls, just + set pending bits. Use regs_invalidated_by_call. Treat + sched_before_next_call as a normal list, not a fake insn. + (init_deps): No funny init for sched_before_next_call. + (free_deps): Free pending mems lists. Don't zero reg_last. + (init_deps_global): Init reg_pending_uses. + (finish_deps_global): Free it. + * sched-int.h (deps): Make in_post_call_group_p boolean. Update docs. + (find_insn_mem_list): Remove. + * sched-rgn.c (concat_INSN_LIST, concat_insn_mem_list): New. + (propagate_deps): Use them. Zero temp mem lists. + +2002-01-26 Richard Henderson + + * Makefile.in (CRTSTUFF_CFLAGS): New. + (crtbegin.o, crtend.o, crtbeginS.o, crtendS.o, crtbeginT.o): Use it. + * config.gcc (alpha-linux, alpha-freebsd, alpha-netbsd): Use plain + crtstuff.c instead of alpha assembly version. + * crtstuff.c (CRT_CALL_STATIC_FUNCTION): Rewrite to assume the + entire dummy function sequence. Use FORCE_CODE_SECTION_ALIGN + not FORCE_{INIT,FINI}_SECTION_ALIGN. + (__do_global_dtors_aux): Mark used. + (frame_dummy, __do_global_ctors_aux): Mark used. + (fini_dummy, init_dummy): Remove. + + * config/alpha/crtbegin.asm: Remove file. + * config/alpha/crtend.asm: Remove file. + * config/alpha/t-crtbe: Remove file. + * config/alpha/elf.h (CRT_CALL_STATIC_FUNCTION): New. + (LINK_EH_SPEC): New. + + * config/cris/cris.h (CRT_CALL_STATIC_FUNCTION): Rewrite old + FORCE_INIT_SECTION_ALIGN hack. Register __fini_start before + calling constructors. + * config/cris/linux.h (CRT_CALL_STATIC_FUNCTION): Undef. + + * config/i386/i386.h (CRT_CALL_STATIC_FUNCTION): New. + * config/i386/linux.h (CRT_CALL_STATIC_FUNCTION): Replace old + CRT_END_INIT_DUMMY hack. + * config/i386/sol2.h (FORCE_CODE_SECTION_ALIGN): Replace + FORCE_{INIT,FINI}_SECTION_ALIGN. + + * config/mcore/mcore-elf.h (FORCE_CODE_SECTION_ALIGN): Replace + FORCE_{INIT,FINI}_SECTION_ALIGN. + + * config/s390/s390.h (CRT_CALL_STATIC_FUNCTION): Update for new + invocation sequence. + * config/sh/sh.h (CRT_CALL_STATIC_FUNCTION): Likewise. + + * doc/tm.texi (CRT_CALL_STATIC_FUNCTION): Update. + (FORCE_CODE_SECTION_ALIGN): New. + +2002-01-26 Richard Henderson + + * config/cris/cris.c (cris_print_operand): Handle 64-bit CONST_INT. + +2002-01-26 Richard Henderson + + * config/alpha/alpha.c (alpha_sa_mask): Mark RA for unicos here too. + (alpha_sa_size): Use alpha_sa_mask to compute size of saved regs. + +2002-01-26 Kazu Hirata + + * config/h8300/h8300.md: Remove bit extraction patterns that + cannot be triggered. + Restrict each bit extraction pattern to a variant on which the + pattern is tested. + +2002-01-26 Joseph S. Myers + + * doc/include/texinfo.tex: Update to version 2002-01-04.07. + +2002-01-26 Kazu Hirata + + * config/h8300/h8300.md: Remove bit test patterns that cannot + be triggered. + Restrict each bit test pattern to a variant on which the + pattern is tested. + +2002-01-26 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strncat): Remove redundant check for + INTEGER_CST. + +2002-01-25 David O'Brien + + * config/i386/x86-64.h (DEFAULT_PCC_STRUCT_RETURN): Do not overide + default setting. + * config/i386/freebsd64.h (DEFAULT_PCC_STRUCT_RETURN): Do not override + existing setting. + +2002-01-25 Geoffrey Keating + + * dbxout.c (dbxout_init): Use assemble_name rather than just + stripping off the first character. + (dbxout_source_file): Likewise. + +2002-01-25 DJ Delorie + + * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): Compare + using rtx_equal_p, not by comparing pointers. + +2002-01-25 Steve Ellcey + + * emit-rtl.c (gen_rtx_REG): Always return the same rtx + for PIC_OFFSET_TABLE_REGNUM. + (init_emit_once): Use gen_raw_REG to initialize pic_offset_table_rtx. + +2002-01-25 David O'Brien + + * config.gcc (x86_64-*-freebsd*): New target. + (x86_64-*-netbsd*,x86_64-*-linux*): Use ${tm_file} rather than its + value. + (i[34567]86-*-freebsd*): Don't include svr4.h. + * config/i386/freebsd64.h: New file. + +2002-01-25 Douglas B Rupp + + * config/alpha/x-vms (version): Make static. + + * config/alpha/vms.h (MD_FALLBACK_FRAME_STATE_FOR): Fix error + in previous checkin. + + * Makefile.in (install-headers-cp): New target. + * config.gcc (alpha-dec-*vms*): Install headers with + install-headers-cp + +Fri Jan 25 22:42:49 CET 2002 Jan Hubicka + + * unroll.c (unroll_loop): Lower final_value to nonmemory operand; + avoid it's copies. + +Fri Jan 25 08:26:19 2002 Richard Kenner + + * builtins.c (expand_builtin_strncpy): Use integer_zerop instead + of compare_tree_int. + (expand_builtin_strncat): Likewise. + * c-decl.c (finish_struct): Use tree_low_cst. + * tree.h (compare_tree_int): Arg is unsigned HOST_WIDE_INT. + * tree.c (compare_tree_int): Likewise. + +2002-01-25 Ulrich Weigand + + * reload1.c (eliminate_regs_in_insn): Recognize frame pointer + adjustments even if they are implemented by more than two insns. + +Fri Jan 25 20:43:56 CET 2002 Jan Hubicka + + * df.c (df_ref_create, df_ref_record_1, df_ref_record): Kill BB arg. + * df.h (struct ref): Kill B. + (DF_REF_BB, DF_REF_BBNO): Use BLOCK_FOR_INSN. + + * basic-block.h (PROP_EQUAL_NOTES): New flag. + * flow.c (propagate_one_insn): Use it. + (mark_used_regs): Handle NIL. + +2002-01-25 Geoffrey Keating + + * config/stormy16/stormy16.md (tablejump_pcrel): Use a MEM + to help folding. + +2002-01-25 David Edelsohn + + * rs6000.md (prefetch): Make address V4SI mode so that the address + is restricted to legitimate form for instruction. + +2002-01-25 Bob Wilson + + * doc/install.texi (xtensa-*-elf): New target. + (xtensa-*-linux*): New target. + * doc/contrib.texi: Add myself. + +2002-01-25 Nick Clifton + + * config/arm/arm.c (arm_hard_regno_mode_ok): Allow any general + purpose register to hold an SImode (or smaller) value. + +2002-01-25 Jakub Jelinek + + * unwind-dw2-fde-glibc.c: If inhibit_libc, use __register_frame* + registry only. + * crtstuff.c: Likewise. + +2002-01-25 Kazu Hirata + + * config/h8300/h8300.md (negation patterns): Tighten + predicates to register_operand. + +2002-01-24 Aldy Hernandez + + * loop.c (emit_prefetch_instructions): Use the prefetch insn's + mode, not Pmode. + + * builtins.c (expand_builtin_prefetch): Same. + +2002-01-24 Alexandre Oliva + + * config/sh/sh.md (sym_label2reg): Make sure all CONSTs have + modes. + +2002-01-24 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove support for + operand character 'A'. + * config/h8300/h8300.md (three anonymous patterns): Replace + operand character 'A' with either 'T' or 'S'. + +2002-01-24 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove support for + operand character 'U'. + +2002-01-24 Andris Pavenis + + * config/i386/t-djgpp: Use NATIVE_SYSTEM_HEADER_DIR. + +2002-01-24 Nick Clifton + + * config/arm/arm.c (arm_hard_regno_mode_ok): Allow SImode + values to be assigned to the stack pointer. + +2002-01-14 Hartmut Penner + + * emit_rtl.c (gen_lowpart_common): Conversion from const_int + to const_double needs to be done right for big-endian systems. + +2002-01-24 Jason Merrill + + PR c++/2432 + * config/sparc/sparc.md (call-jump peepholes): Pass the right insn + to can_throw_internal. + +2002-01-23 Richard Henderson + + * fold-const.c (fold): Change UINT_MAX test to check vs precision + rather than TYPE_MAX_VALUE. Fix indentation and a bogus negation. + +2002-01-24 Alexandre Oliva + + * config/sh/sh.md (symGOT_load, sym2GOT, sym2GOTOFF): New expands. + (symGOT2reg): Use them, then set as GOT value as unchanging. + (symGOTOFF2reg): Set REG_EQUAL note. Use a different pseudo + as a temporary, if possible. + (symPLT_label2reg): Enclose (pc) in UNSPEC_PIC. Emit + sym@PLT-(.LPCS#+2-.) instead of sym@PLT+.-(.LPCS#+2). + +2002-01-23 Kazu Hirata + + * config/h8300/h8300.md: Fix xorqi and xorqi so that they will + accept to accept 0x80 as operands[2]. + +2002-01-24 Alexandre Oliva + + * config/sparc/sparc.md (fix_trunctfdi2): Correct typo in mode. + +2002-01-23 Richard Henderson + + * config/alpha/alpha.md (call_value_osf_1_er peepholes): Fix typo. + +2002-01-23 Aldy Hernandez + + * c-parse.in (parmlist_or_identifiers): Add maybe_attribute. + (parmlist_or_identifiers_1): Verify that only a parmlist follows + an attribute. + +2002-01-23 Richard Henderson + + * expr.c (move_by_pieces_1): Extend size before negation. + + * config/m68k/t-m68kbare (MULTILIB_OPTIONS): Add 68040 and 68060. + (MULTILIB_MATCHES): Remove 68040 and 68060 aliases. + (MULTILIB_EXCEPTIONS): Ignore 68881 and soft-float for 68040 and 68060. + * config/m68k/t-m68kelf: Likewise. + +2002-01-23 Bob Wilson + + * config/xtensa/elf.h: New file. + * config/xtensa/lib1funcs.asm: New file. + * config/xtensa/lib2funcs.S: New file. + * config/xtensa/linux.h: New file. + * config/xtensa/t-xtensa: New file. + * config/xtensa/xtensa-config.h: New file. + * config/xtensa/xtensa-protos.h: New file. + * config/xtensa/xtensa.c: New file. + * config/xtensa/xtensa.h: New file. + * config/xtensa/xtensa.md: New file. + * config.gcc (xtensa-*-elf*): New target. + (xtensa-*-linux*): New target. + * cse.c (canon_hash): Compare rtx pointers instead of register + numbers. This is required for the Xtensa port. + * integrate.c (copy_insn_list): Handle case where the static + chain is in memory and the memory address has to be copied to + a register. + * doc/invoke.texi (Option Summary): Add Xtensa options. + (Xtensa Options): New node. + * doc/md.texi (Machine Constraints): Add Xtensa machine constraints. + +2002-01-23 Zack Weinberg + + * diagnostic.c (internal_error): Do ICE suppression only + when ENABLE_CHECKING is not defined. + + * c-typeck.c (require_complete_type): Return error_mark_node + if type is error_mark_node. + +2002-01-23 Janis Johnson + + * toplev.c (process_options): Disable -fprefetch-loop-arrays with + -Os and issue a warning. + +2002-01-23 Zack Weinberg + + * doc/fragments.texi, doc/hostconfig.texi: Update to reflect + current (lack of) need for host configuration by hand. + + * doc/gccint.texi, doc/rtl.texi, doc/tm.texi: Adjust cross + references. Documentation of some target macros moved from + hostconfig.texi to tm.texi. + +2002-01-23 Will Cohen + + * config/arm/arm.h (THUMB_FUNCTION_PROFILER): Define if not currently + defined. + +2002-01-23 Kazu Hirata + + * config/h8300/h8300.md (*andorhi3): Accept 0x8000 as an + operand[3]. + +2002-01-23 Jason Merrill + + * tree.c (build1): Don't set TREE_READONLY on INDIRECT_REF. + + * function.c (assign_parms): Don't put args of inline functions + into registers when not optimizing. + +2002-01-23 Nick Clifton + + * config/arm/arm.md (UNSPEC_PROLOGUE_USE): New unspec constant. + (prologue_use): New pattern. + * config/arm/arm.c (expand_prologue): Use gen_prologue_use in + preference to gen_rtx_USE. + (thumb_expand_prologue): Use gen_prologue_use in preference to + gen_rtx_USE. + (thumb_expand_epilogue): Use gen_prologue_use in preference to + gen_rtx_USE. + +2002-01-23 Hans-Peter Nilsson + + * loop.c [!HAVE_prefetch] (CODE_FOR_prefetch): Define to 0. + +2002-01-23 Neil Booth + + PR c/3504 + * doc/extend.texi: Correct documentation of __alignof__. + +2002-01-22 Zack Weinberg + + * params.h: Rename arguments of DEFPARAM so that it will be + recognized as a translation keyword. + +2002-01-22 Aldy Hernandez + + * extend.texi: Document altivec functions. + Fix N-bit adjectives in X86 builtin documentation. + +2002-01-22 Alexandre Oliva + + * reload.c (reg_overlap_mentioned_for_reload_p): Handle PLUS and + auto_inc_dec values. + +2002-01-22 Richard Earnshaw + + * config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove bogus white space + after backslash. + (ASM_DECLARE_OBJECT_NAME): Add missing backslash before final line. + +2002-01-22 Alexandre Oliva + + * config/i386/freebsd-aout.h (ASM_QUAD): Undefine. + +2002-01-22 Richard Henderson + + * config/alpha/alpha.c (split_small_symbolic_mem_operand): Use + copy_insn not copy_rtx. + +2002-01-23 Alan Modra + + * combine.c (simplify_and_const_int): Don't trunc_int_for_mode + "nonzero" as that might add "1" bits. Ensure "constop" is + properly sign extened. + (force_to_mode): Tweak for sign extended constop. + +2002-01-22 Richard Henderson + + * config/alpha/alpha.c (some_small_symbolic_mem_operand) Use + for_each_rtx instead of assuming we're already looking at the MEM. + (split_small_symbolic_mem_operand): Likewise. + * config/alpha/alpha.h (PREDICATE_CODES): Update. + * config/alpha/alpha.md (small symbolic memory splitters): Update. + +2002-01-22 Richard Henderson + + * config/alpha/alpha.md (divmodsi_internal_er): Generate lituse + sequence number for the literal. + (divmoddi_internal_er): Likewise. + +2002-01-22 Craig Rodrigues + + PR java/4972 + * aclocal.m4 (AM_ICONV): Put linking flags for libiconv + in LIBICONV variable. + * configure: Regenerated. + +2002-01-22 Krister Walfridsson + + * dependence.c (build_def_use): Remove array_idx. + + * dwarfout.c (last_filename): Remove. + (output_compile_unit_die): Remove last_filename. + +2002-01-22 Roger Sayle + Richard Henderson + + PR opt/3640 + * fold-const.c (fold): Optimize unsigned comparisons against + UINT_MAX (and similar unsigned constants). + +2002-01-22 Janis Johnson + + * Makefile.in (loop.o): Depend on OPTABS_H. + * loop.c (emit_prefetch_instructions): Check the prefetch operand + against the predicate. + + PR target/5379 + * config/i386/i386.md (prefetch_sse): Specify "p" as a constraint + for the address operand. + +2002-01-22 Richard Henderson + + * config/alpha/freebsd.h (FUNCTION_PROFILER): Remove. + +2002-01-22 Craig Rodrigues + + PR other/5450 + * config/i386/sysv4.h (CPP_SPEC): Define, and add CPU + preprocessor flags. + +2002-01-22 Jason Thorpe + + * config.gcc (x86_64-*-netbsd*): New target. + * config/i386/netbsd64.h: New file. + +2002-01-22 Aldy Hernandez + + * regrename.c (kill_value): Fix typo. + +2002-01-22 Aldy Hernandez + + * doc/tm.texi: Remove STARTING_FRAME_PHASE. + + * config/rs6000/rs6000.h: Same. + + * function.c (instantiate_virtual_regs): Remove + STARTING_FRAME_PHASE. + (assign_stack_local_1): Same. + Calculate frame phase. + +2002-01-22 Nick Clifton + + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move 'regno' + variable declaration to outer scope in order to simplify + future extensions. + (HARD_REGNO_MODE_OK): Replace macro body with a with a call to + arm_hard_regno_mode_ok. + * config/arm/arm-protos.h: Add a prototype for + arm_hard_regno_mode_ok. + * config/arm/arm.c (soft_df_operand): Remove now redundant + check for DImode values using IP_REGNUM. + (nonimmediate_soft_df_operand): Remove now redundant check for + DImode values using IP_REGNUM. + (arm_hard_regno_mode_ok): New function. New check: make sure + that DImode values are not stored in IP_REGNUM. + + * config/arm/arm.c (arm_expand_prologue): Replace REG_MAYBE_DEAD + note with a USE. + (thumb_expand_prologue): Replace REG_MAYBE_DEAD note with a USE. + +2002-01-22 Jason Merrill + + * c-semantics.c (genrtl_compound_stmt): Only check nesting + consistency if this COMPOUND_STMT is scoped. + +2002-01-22 Kazu Hirata + + * predict.c: Fix formatting. + * print-tree.c: Likewise. + * protoize.c: Likewise. + * real.h: Likewise. + * rtl.h: Likewise. + * sbitmap.h: Likewise. + * scan.c: Likewise. + * sched-deps.c: Likewise. + * sched-vis.c: Likewise. + * sdbout.c: Likewise. + * sibcall.c: Likewise. + * ssa.c: Likewise. + * ssa-ccp.c: Likewise. + * ssa-dce.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * system.h: Likewise. + +Tue Jan 22 06:26:33 2002 Richard Kenner + + * tree.c (int_fits_type_p): If bounds of a subtype are variable, see + if fits in bounds of base type. + + * dwarf2out.c (equate_decl_number_to_die): Add "int" to decls. + (loc_descriptor_from_tree, case CALL_EXPR, case ADDR_EXPR): New. + (add_bound_info, default): If can't find a context, make a + SAVE_EXPR. + (dwarf2out_finish): Check for SAVE_EXPR in node->created_for. + +2002-01-22 Hans-Peter Nilsson + + * c-typeck.c (parser_build_binary_op): If result from + build_binary_op is ERROR_MARK just return error_mark_node without + further processing. + +2002-01-21 Jason Thorpe + + * config/netbsd.h (TARGET_HAS_F_SETLKW): define. + Split a.out-specific bits into... + * config/netbsd-aout.h: ...this. + * config/netbsd-elf.h: New file. + * config/alpha/netbsd-elf.h: Remove. + * config/alpha/netbsd.h: Rewrite for a NetBSD/alpha ELF target. + * config/i386/netbsd-elf.h (LIB_SPEC): Remove. + (STARTFILE_SPEC): Remove redundant definition. + (ENDFILE_SPEC): Likewise. + (LINK_SPEC): Likewise. + (CPP_SPEC): Likewise. + (ASM_SPEC): Likewise. + (LIB_SPEC): Likewise. + (SWITCH_TAKES_ARG): Likewise. + (TARGET_MEM_FUNCTIONS): Likewise. + (CPP_PREDEFINES): Redefine. + (ASM_FINAL_SPEC): Remove redefinition. + (ASM_COMMENT_START): Redefine. + (FUNCTION_PROFILER): Define. + (TARGET_VERSION): Redefine. + Comment and formatting cleanup. + * config/i386/netbsd.h: Include . + * config/m68k/netbsd.h: Include . + * config/mips/netbsd.h: Rewrite for NetBSD/mips ELF target, + big- or little-endian. + * config/ns32k/netbsd.h: Include . + * config.gcc (*-*-netbsd*): Add definitions common to all + NetBSD configs. + (alpha*-*-netbsd*): Remove redundant xm_defines, gas, and + gnu_ld definitions. Add netbsd-elf.h to and remove + alpha/netbsd-elf.h from tm_file. Remove alpha/t-crtfm from + tmake_file, and don't lose previous tmake_file contents. + (arm*-*-netbsd*): Add netbsd-aout.h to tm_file. + (i[34567]86-*-netbsdelf*): Remove redundant xm_defines, gas, and + gnu_ld definitions. Add netbsd-elf.h to tm_file. + (mips-dec-netbsd*): Remove as alias for mipsel-*-netbsd*. + (mipsel-*-netbsd*): Rename this to... + (mips*-*-netbsd*): ...this. Add elfos.h to tm_file. Add + mips/little.h to tm_file for mips*el-*. + (powerpc-*-netbsd*): Remove redundant xm_defines definition. + (sparc-*-netbsd*): Add netbsd-aout.h to tm_file. + (vax-*-netbsd*): Add netbsd-aout.h to tm_file. + +2002-01-21 John David Anglin + + * pa-protos.h (reg_before_reload_operand): New function prototype. + * pa.c (reg_before_reload_operand): New function implementation. + * pa.md (decrement_and_branch_until_zero, movb): Use it. Change "!*m" + contraints to "*m". + +2002-01-21 Franz Sirl + + * combine.c (simplify_and_const_int): Properly sign-extend CONSTOP. + +2002-01-21 John David Anglin + + * pa64-hpux.h (MD_EXEC_PREFIX): Set to "/usr/ccs/bin". + (MD_STARTFILE_PREFIX): Set to "/usr/ccs/lib/pa20_64/". + (MD_STARTFILE_PREFIX_1): Set to "/opt/langtools/lib/pa20_64/". + (EH_FRAME_IN_DATA_SECTION): Define and update comment on init sections. + (ENDFILE_SPEC): Undefine. + (STARTFILE_SPEC): Redefine for PA. + +2002-01-21 Franz Sirl + + * config/rs6000/t-ppccomm (CRTSTUFF_T_CFLAGS_S): Re-add -fPIC. + +2002-01-21 Daniel Jacobowitz + + * config.gcc: Add entries to supported PowerPC --with-cpu + types. + +2002-01-21 Jakub Jelinek + + * config/i386/i386.c (ix86_function_arg_regno_p): Never return + true for 64-bit mode only SSE registers in 32-bit mode. + +2002-01-21 Kazu Hirata + + * unwind-dw2.c: Fix formatting. + * unwind-dw2-fde.c: Likewise. + * unwind-dw2-fde.h: Likewise. + * unwind-pe.h: Likewise. + * varasm.c: Likewise. + * varray.h: Likewise. + +2002-01-21 Hans-Peter Nilsson + + Remove workaround for register stack overwrite bug in mmix. + * config/mmix/mmix.c (mmix_target_asm_function_prologue): Remove + support for TARGET_REG_STACK_FILL_BUG. + * config/mmix/mmix.h: Remove member has_call_without_parameters. + (TARGET_MASK_REG_STACK_FILL_BUG, TARGET_REG_STACK_FILL_BUG): + Delete. + (TARGET_DEFAULT): Remove TARGET_MASK_REG_STACK_FILL_BUG. + (TARGET_SWITCHES): Remove -mreg-stack-fill-bug-workaround and + -mno-reg-stack-fill-bug-workaround. + * config/mmix/mmix.md ("call", "call_value"): Don't set struct + machine member has_call_without_parameters. + * doc/invoke.texi (Option Summary) : Remove + -mreg-stack-fill-bug-workaround and + -mno-reg-stack-fill-bug-workaround. + (MMIX Options): Ditto. + +2002-01-21 Kazu Hirata + + * config/h8300/h8300.c (function_arg): Replace 0 with NULL_RTX + as appropriate. + Remove redundant code. + +2002-01-21 Joseph S. Myers + + * config/alpha/alpha.h, config/arc/arc.h, config/avr/avr.h, + config/c4x/c4x.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, + config/fr30/fr30.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h, + config/mips/mips.h, config/rs6000/rs6000.h, config/sparc/sparc.h, + config/stormy16/stormy16.h, config/v850/v850.h: Remove commented + out target macro definitions and non-target-specific comments + mostly taken from old versions of the manual. + +2002-01-20 Kazu Hirata + + * config/h8300/h8300.h: Fix comment formatting. + * config/ia64/aix.h: Likewise. + * config/ia64/ia64-protos.h: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ia64/ia64intrin.h: Likewise. + * config/ia64/linux.h: Likewise. + * config/ia64/unwind-aix.c: Likewise. + * config/ia64/unwind-ia64.c: Likewise. + +2002-01-20 Kazu Hirata + + * config/h8300/h8300.c: Revise comments about shift code. + +2002-01-20 Kazu Hirata + + * config/h8300/h8300.c (function_arg): Update a comment. + +2002-01-20 Kazu Hirata + + * config/h8300/h8300.md: Update the comments at the beginning + of the file. + +2002-01-20 Kazu Hirata + + * config/i370/i370.c: Fix comment formatting. + * config/i370/i370.h: Likewise. + * config/i370/i370.md: Likewise. + * config/i370/linux.h: Likewise. + +Sun Jan 20 18:40:14 2002 Richard Kenner + + * reg-stack.c (subst_stack_regs): Properly check for deleted insn. + + * dwarf2out.c (loc_descriptor_from_tree): Add TRUTH_*_EXPR cases. + (gen_struct_or_union_type_die): Don't SIGSEGV if no TYPE_STUB_DECL + in incomplete case. + +2002-01-20 Graham Stott + + * cfgloop.c (flow_loop_preheader_scan): Fix typo. + +2002-01-19 John David Anglin + + * config.gcc (hppa*64*-*-hpux11*): Fix tmake_file. + +2002-01-19 Tom Rix + + * config/rs6000/rs6000.md: Fix DF split for 64 bit hosts. + +2002-01-18 Aldy Hernandez + + * doc/tm.texi (STARTING_FRAME_PHASE): Document. + + * function.c (assign_stack_local_1): Adjust x_frame_offset with + STARTING_FRAME_PHASE. + (STARTING_FRAME_PHASE): New. + (instantiate_virtual_regs): Check saneness of + STARTING_FRAME_PHASE. + + * config/rs6000/rs6000.h (STARTING_FRAME_PHASE): New. + +2002-01-19 Alexandre Oliva + + * config/sh/sh.md (movdf_i4 split): Fix alter_subreg calls. + +2002-01-18 Craig Rodrigues + + * doc/install.texi (hppa*-hp-hpux11): Clarify that GCC 2.95.x cannot + be used for bootstrapping GCC 3.0. + +2002-01-18 Kazu Hirata + + * config/h8300/h8300.md: Fix an insn length. + +2002-01-18 Kazu Hirata + + * bitmap.h: Fix comment formatting. + * combine.c: Likewise. + * cppfiles.c: Likewise. + * c-pragma.h: Likewise. + * c-typeck.c: Likewise. + * df.c: Likewise. + * dwarf2out.c: Likewise. + * function.c: Likewise. + * gcc.c: Likewise. + * genattrtab.c: Likewise. + * gthr-win32.h: Likewise. + * haifa-sched.c: Likewise. + * predict.c: Likewise. + * rtlanal.c: Likewise. + * rtl.h: Likewise. + * unwind-dw2-fde.h: Likewise. + * unwind-pe.h: Likewise. + * vmsdbgout.c: Likewise. + +Thu Jan 17 15:28:26 2002 Richard Kenner + + * attribs.c (decl_attributes): Clear ATTR_FLAG_TYPE_IN_PLACE + if type_required and passed decl. + +2002-01-17 Aldy Hernandez + + * config.gcc (cpu_type): Include altivec.h in powerpc + extra_headers. + Same for darwin. + + * config/rs6000/altivec.h: New. + +2002-01-17 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Update assembler and exception + handling information. + * doc/trouble.texi (Interoperation): Add libstdc++ information + for AIX. + (Misunderstandings): Add template instantiation and static template + member information for AIX. + +2002-01-17 Jason Merrill + + * dbxout.c (dbxout_type): Support const and volatile. + + * except.c (add_partial_entry): Remove backwards compatibility code. + (end_protect_partials): Likewise. + +2002-01-17 Jakub Jelinek + + * config/ia64/ia64.md (prologue_use): New. + * config/ia64/ia64.c (ia64_expand_prologue): Use + gen_prologue_use instead of gen_rtx_USE. + (group_barrier_needed_p): Handle CODE_FOR_prologue_use the same way + as CODE_FOR_pred_rel_mutex. + (ia64_sched_reorder2): Likewise. + +2002-01-16 Eric Christopher + + * config/mips/r3900.h: Reformat. + (SUBTARGET_CPP_SIZE_SPEC): Remove. + * config/mips/isa3264.h (SUBTARGET_CPP_SIZE_SPEC): Ditto. + * config/mips/mips.h (ABI_GAS_ASM_SPEC): Default to "". + (SUBTARGET_CPP_SIZE_SPEC): Rewrite. + * config/mips/t-elf: Remove mips3 multilib. + +2002-01-16 H.J. Lu + + * config/mips/linux.h: Include "mips/abi64.h". + +2002-01-16 H.J. Lu + + * config/mips/t-linux: New. + + * config.gcc: Add mips/t-linux to tmake_file for mips*-*-linux*. + + * config/mips/linux.h: Don't include "gofast.h". + (INIT_SUBTARGET_OPTABS): Removed. + +2002-01-16 Kazu Hirata + + * config/h8300/h8300-protos.h: Replace emit_a_shift with + output_a_shift. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.md: Likewise. + +2002-01-16 Kazu Hirata + + * config/h8300/h8300.md (pushqi1_h8300): Use a tab instead of + spaces after an opcode name. + (pushqi1_h8300hs): Likewise. + (pushhi1_h8300hs): Likewise. + +2002-01-16 Kazu Hirata + + * doc/extend.texi: Replace "option" with "attribute" + appropriately. + +2002-01-16 Jakub Jelinek + + * config/alpha/alpha.c (some_small_symbolic_mem_operand): Look into + (and:DI () (const_int -8)). + (split_small_symbolic_mem_operand): Split + (mem (and:DI () (const_int -8)). + +2002-01-16 Jakub Jelinek + + PR target/5309: + * config/sparc/sparc.c (ultrasparc_adjust_cost): Handle TYPE_IDIV the + same way as TYPE_IMUL. + (ultrasparc_sched_reorder): Likewise. + * config/sparc/sparc.md (type): Add comment to update + ultrasparc_sched_reorder when making changes. + +2002-01-16 Kazu Hirata + + * doc/invoke.texi: Change the dump file name of block + reordering pass from 28.bbro to 29.bbro. + Mention -dk option. + +Wed Jan 16 17:54:22 CET 2002 Jan Hubicka + + * i386.md (minsf splitter): Fix pasto. + +2002-01-16 Nick Clifton + + * config/arm/arm.c (arm_expand_prologue): Add REG_MAYBE_DEAD note + to frame pointer initialisation instruction. + (thumb_expand_prologue): Add REG_MAYBE_DEAD note to frame pointer + initialisation instruction. + (soft_df_operand): Do not accept the IP register. + (nonimmediate_soft_df_operand): Do not accept the IP register. + +2002-01-16 Jakub Jelinek + + PR target/5357: + * config/sparc/sparc.c (sparc_override_options): Avoid MASK_V9 and + MASK_V8 being both set. + +2002-01-16 Ulrich Weigand + + * config/s390/s390.c (s390_emit_prologue): Do not emit USE + insn for GOT register; add REG_MAYBE_DEAD notes instead. + config/s390/s390.md (call, call_value): Add GOT register to + CALL_INSN_FUNCTION_USAGE where needed. + (call_exp, call_value_exp): New. + +2002-01-16 Nick Clifton + + * config/arm/arm.c: General formatting tidy up. + +2002-01-16 Graham Stott + + * calls.c (try_to_integrate): Use "(size_t)" intermediate + cast and when casting an integer literal to "rtx" pointer. + (expand_call): Likewise. + * flow.c (try_pre_increment): Likewise. + (find_use_as_address): Likewise. + * integrate.c (expand_iline_function): Likewise. + * regmove.c (try_auto_increment): Likewise. + +2002-01-16 Graham Stott + + * sched-rgn.c (passed): Use sbitmap_free. + (header): Likewise. + (inner): Likewise. + (in_queue): Likewise. + (in_stack): Likewise. + +2002-01-15 Eric Christopher + + * flow.c (propagate_one_insn): Change to use fatal_insn. + +2002-01-15 Kazu Hirata + + * expmed.c (extract_fixed_bit_field): Remove unused code. + * system.h: Poison SLOW_ZERO_EXTEND. + * doc/tm.texi: Remove. + * config/1750a/1750a.h (SLOW_ZERO_EXTEND): Remove. + * config/arm/arm.h: Likewise. + * config/avr/avr.h: Likewise. + * config/clipper/clipper.h: Likewise. + * config/convex/convex.h: Likewise. + * config/d30v/d30v.h: Likewise. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/elxsi/elxsi.h: Likewise. + * config/fr30/fr30.h: Likewise. + * config/h8300/h8300.h: Likewise. + * config/i370/i370.h: Likewise. + * config/i386/i386.h: Likewise. + * config/m68k/m68k.h: Likewise. + * config/mips/mips.h: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/pdp11/pdp11.h: Likewise. + * config/pj/pj.h: Likewise. + * config/s390/s390.h: Likewise. + * config/sh/sh.h: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/v850/v850.h: Likewise. + * config/vax/vax.h: Likewise. + * config/we32k/we32k.h: Likewise. + +2002-01-15 Aldy Hernandez + + * config/rs6000/rs6000.md (altivec_stvx): Add parallels to stvx. + (altivec_lvsl): Change constraint to b. + (altivec_lvsr): Same. + (altivec_lvebx): Same. + (altivec_lvehx): Same. + (altivec_lvewx): Same. + (altivec_lvxl): Same. + (altivec_lvx): Same. + (altivec_stvx): Add parallel. + (altivec_stvxl): Same. + (altivec_stvehx): Same. + (altivec_stvebx): Same. + (altivec_stvebx): Same. + +2002-01-15 Aldy Hernandez + + * config.gcc: Change altivec.h to altivec-defs.h. + + * config/rs6000/altivec.h: Delete. + + * config/rs6000/altivec-defs.h: Add. + +2002-01-15 John David Anglin + + * vax.c (vax_rtx_cost): Return MAX_COST for unsupported MULT, UDIV + and UMOD modes. + + * vax.h (INDEX_TERM_P): Restrict indexing to modes which have a size + less than or equal to eight bytes. + + * vax.md (andsi3): Remove constraints and change SET destination + operand type to nonimmediate_operand. + (andhi3, andqi3): Likewise. Don't clear high order bits of operand 1 + when it is a CONST_INT. + +2002-01-15 Jason Merrill + + * c-common.def (FILE_STMT): New code. + * c-common.c (statement_code_p): It's a statement. + * c-common.h (stmt_tree_s): Add x_last_filename. + (FILE_STMT_FILENAME_NODE, FILE_STMT_FILENAME): New macros. + (last_expr_filename): New macro. + * c-semantics.c (begin_stmt_tree): Initialize it. + (add_stmt): If the filename changed, also insert a + FILE_STMT. + (expand_stmt): Handle seeing one. + +2002-01-15 Eric Christopher + + * flow.c (propagate_one_insn): Add error message and print out + insn for debugging. + +2002-01-15 Joseph S. Myers + + * system.h (ASM_IDENTIFY_GCC, STDC_VALUE, TRAMPOLINE_ALIGN, + ASM_IDENTIFY_GCC_AFTER_SOURCE): Poison. + * config/pdp11/pdp11.h (TRAMPOLINE_ALIGN): Rename to + TRAMPOLINE_ALIGNMENT. + * config/arm/arm.h, config/mcore/mcore.h: Likewise. Change value + to be in bits. + * config/i386/cygwin.h (PCC_BITFIELDS_TYPE_MATTERS): Rename to + PCC_BITFIELD_TYPE_MATTERS. + * config/interix.h (STDC_VALUE): Remove. Use + STDC_0_IN_SYSTEM_HEADERS. + * config/darwin.h (ASM_IDENTIFY_GCC), config/dsp16xx/dsp16xx.h + (ASM_IDENTIFY_GCC), config/stormy16/stormy16.h (ASM_IDENTIFY_GCC, + ASM_IDENTIFY_GCC_AFTER_SOURCE): Remove. + +2002-01-15 Craig Rodrigues + + * doc/install.texi (hppa*-hp-hpux11): --enable-threads does + not work on this platform currently. + +2002-01-15 Joseph S. Myers + + * c-typeck.c (build_unary_op): Don't wrap msgid argument of + readonly_warning in _(). + +2002-01-15 Douglas B Rupp + + * gcc.c (delete_if_ordinary): Backout previous change. + +2002-01-15 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove support for + unused operand characters. + + * read-rtl.c: Fix formatting. + * real.c: Likewise. + * recog.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * rtlanal.c: Likewise. + +2002-01-15 Kazu Hirata + + * config/i386/i386.c: Fix formatting. + +2002-01-15 Jakub Jelinek + + * c-typeck.c (process_init_element): Don't save_expr + COMPOUND_LITERAL_EXPR if just its initializer will be used. + +2002-01-15 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Do not + emit optional traceback table if optimize_size or TARGET_ELF. + * config/rs6000/rs6000.md (prefetch): New. + +2002-01-15 Andreas Jaeger + + * config.gcc (x86_64-*-*): Install mmintrin.h and xmmintrin.h. + +2002-01-15 Kazu Hirata + + * mips-tfile.c: Fix formatting. + +Tue Jan 15 00:56:11 CET 2002 Jan Hubicka + + * unroll.c (final_reg_note_copy): Fix previous commit. + +2002-01-14 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove the prototype for + eq_operator. + * config/h8300/h8300.c (eq_operator): Remove. + +2002-01-14 Richard Henderson + + * config/i386/i386.md (prefetch): Tidy. + (prefetch_3dnow): Fix locality operand. + +2002-01-14 Richard Henderson + + * config/mips/mips.h (HI_AND_FP_REGS): New register class. + (CLASS_CANNOT_CHANGE_MODE): Disallow HI in little-endian mode. + +2002-01-14 Hans-Peter Nilsson + + * reload1.c (reload_combine): Pass reg_sum replacement through + copy_rtx in loop performing multiple changes. + +2002-01-14 Jakub Jelinek + + * except.c (remove_unreachable_regions): New. + (free_eh_status): Clear exception_handler_labels. + (convert_from_eh_region_ranges): Call remove_unreachable_regions. + (find_exception_handler_labels): Don't add the same label more than + once. + (remove_exception_handler_label): Don't die if + find_exception_handler_labels hasn't been called for the current + function yet. + +Mon Jan 14 21:26:13 CET 2002 Jan Hubicka + + * toplev.c (rest_of_compilation): Rebuild jump labels after + gcse. + +2002-01-14 Joseph S. Myers + + * doc/extend.texi: Move documentation of X86 built-in functions + here. + * doc/invoke.texi: From here. + * doc/sourcebuild.texi: Document location of documentation for + machine built-in functions. + +2002-01-13 Christopher Faylor + + * cppfiles.c (TEST_THRESHOLD): New macro. + (SHOULD_MMAP): Ditto. + (read_include_file): Use SHOULD_MMAP macro to decide when mmap should + be used. + +Mon Jan 14 20:23:34 CET 2002 Jan Hubicka + + * unroll.c (final_reg_note_copy): Properly handle + REG_LABEL + (unroll_loops): Fix LOOP_CONDITION heuristics. + +2002-01-14 Geoffrey Keating + + * doc/invoke.texi (Xstormy16 Options): Add xstormy16 option. + * doc/md.texi (Machine Constraints): Use @minus{} where appropriate. + +Mon Jan 14 20:18:19 CET 2002 Jan Hubicka + + * cfgcleanup.c (try_forward_edges): Avoid infinite loop at infinite + threaded loop. + +2002-01-14 Tom Rix + + * config/rs6000/rs6000.md: Fix typo with sradi. + +2002-01-14 Ulrich Weigand + + * config/s390/s390.md (movstrdix_64, movstrsix_31, movstrdi_64, + movstrsi_31, clrstrsi_64, clrstrsi_31): Improve RTL templates. + (clrstrdi, clrstrsi): Adapt callers. + + (extendsidi2, zero_extendsidi2): Remove no-conflict blocks. + + (movti splitter): Never use register 0 as base register. + +2002-01-14 Hartmut Penner + + * combine.c (simplify_shift_const): Always generate new rtx + for shift expression instead of reusing given expression. + +Mon Jan 14 07:08:55 2002 Richard Kenner + + * config/alpha/alpha.c (alpha_expand_mov): Don't call + alpha_legitimize_address unless mode is Pmode. + +2002-01-13 Geoffrey Keating + + * doc/md.texi (Modifiers): Document the '*' constraint for the + user. + + * doc/md.texi (Machine Constraints): Add constraints for xstormy16. + * doc/extend.texi (Function Attributes): 'interrupt' is valid + for xstormy16 too. + +2002-01-13 Richard Henderson + + * reload.c (find_reloads): Use a hard reg destination as reload reg + for an input reload of the source. + +2002-01-13 Gerald Pfeifer + + * doc/install.texi (Binaries): Make link to ftp.writtenword.com + more generic. + +Sun Jan 13 07:23:01 2002 Douglas B Rupp + + * Makefile.in (LIB2FUNCS): Split into LIB2FUNCS_1 and LIB2FUNCS_2. + * mklibgcc.in (LIB2FUNCS): Split into LIB2FUNCS_1 and LIB2FUNCS_2. + + * config/alpha/x-vms (USE_COLLECT2): Set to empty. + +Sun Jan 13 06:55:31 2002 Richard Kenner + + * dwarf2out.c (mem_loc_descriptor, case ADDRESSOF): New case. + +2002-01-12 Tom Rix + + * config/rs6000/rs6000.c (rs6000_emit_set_long_const): Use ior for + TARGET_POWERPC64. + +2002-01-12 Richard Henderson + + * config/i386/i386.c (bdesc_2arg): Mark psadbw MASK_3DNOW_A. + + * doc/invoke.texi: Update Alpha options. + + * doc/invoke.texi: Update i386 built-in function lists. + +Sat Jan 12 17:38:11 CET 2002 Jan Hubicka + + * unroll.c (final_reg_note_copy): Avoid crash on REG_LABEL note + referencing outside. + +Sat Jan 12 08:54:51 2002 Richard Kenner + + * diagnostic.c (warn_deprecated_use): Rework to lower indentation. + * expr.c (emit_move_insn_1): Remove warning, use HOST_WIDE_INT for + offsets, and change line folding. + * optabs.c (expand_binop): Remove warnings. + * sdbout.c (sdbout_record_type_name): Constify NAME to avoid warning. + +2002-01-12 Graham Stott + + * attribs.c (handle_deprecated_attribute): constify WHAT. + * diagnostic.c (warn_deprecated_use): Add braces, fixes + dangling else warning and constify WHAT. + * except.h (struct function, struct inline_remap): Move + struct tag forward defs before all prototypes. + (duplicate_eh_regions): Whitespace. + +2002-01-12 Nick Clifton + + * config/arm/arm.h (ARM_LEGITIMIZE_RELOAD_ADDRESS): Use + MODE_BASE_REG_CLASS. + (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Use MODE_BASE_REG_CLASS. + +2002-01-12 Richard Henderson + + * config/i386/i386.c (override_options): If SSE, enable sse prefetch. + (ix86_expand_vector_move): New. + (bdesc_2arg): Remove andps, andnps, orps, xorps. + (ix86_init_mmx_sse_builtins): Make static. Remove composite builtins. + Remove old prefetch builtins. Special case the logicals removed above. + (ix86_expand_builtin): Likewise. + (safe_vector_operand): Use V4SFmode, not TImode. + (ix86_expand_store_builtin): Remove shuffle arg. Update callers. + (ix86_expand_timode_binop_builtin): New. + * config/i386/i386-protos.h: Update. + * config/i386/i386.h (enum ix86_builtins): Update. + * config/i386/i386.md: Correct predicates on MMX/SSE patterns. + Use ix86_expand_vector_move in vector move expanders. + (movti_internal, movti_rex64): Add xorps alternative. + (sse_clrv4sf): Rename and adjust from sse_clrti. + (prefetch): Don't work so hard. + (prefetch_sse, prefetch_3dnow): Use PREFETCH rtx, not UNSPEC. + * config/i386/xmmintrin.h (__m128): Use V4SFmode. + (_mm_getcsr, _mm_setcsr): Fix typo in builtin name. + +2002-01-11 Richard Henderson + + * config/i386/mmintrin.h: New file. + * config/i386/xmmintrin.h: New file. + * config.gcc (i?86-*-*): Add extra_headers. + * simplify-rtx.c (simplify_unary_operation): Handle saturating + truncation codes. + (simplify_binary_operation): Handle saturating arithmetic codes. + * config/i386/i386.c (ix86_expand_sse_comi): Return the full result, + not the lowpart subreg. + (ix86_expand_builtin): Return a TImode dummy register instead of 0 + on error. + * config/i386/i386.md (mmx_clrdi): Override memory attribute. + +2002-01-12 Michael Hayes + + * conflict.c (conflict_graph_compute): Free regsets when finished. + * ssa.c (compute_coalesced_reg_partition): Likewise. + +2002-01-12 Herman A.J. ten Brugge + + * global.c (find_reg): Check for HARD_REGNO_CALL_PART_CLOBBERED + every where we allocate a register. + +2002-01-12 Michael Hayes + + * gcse.c (compute_pre_data, pre_gcse): Use sbitmap_free. + * lcm.c (compute_earliest, compute_farthest): Likewise. + +2002-01-11 Janis Johnson + + * expr.c (expand_assignment): Fix misuse of MEM_KEEP_ALIAS_SET. + +2002-01-11 Janis Johnson + + * doc/rtl.texi (Insns): Fix 2 typos. + +2002-01-11 Joseph S. Myers + + * doc/invoke.texi: Avoid overfull hboxes. Add summary of D30V + options. Use @table @gcctabopt for MMIX options. Add index + entries for MMIX options. Start new paragraph with first + heading of the machine-dependent options. + +2002-01-11 Craig Rodrigues + + PR other/5299 + * config/ns32k/ns32k.md: Fix spelling mistake of "than" in comments. + * combine.c (force_to_mode): Same. + * reload1.c (clear_reload_reg_in_use): Same. + +2002-01-11 Nick Clifton + + * config/arm/arm.c (arm_gen_constant): Correct test of 'remainder' + and 'subtargets'. + +2002-01-11 Andreas Jaeger , + Brad Lucier + + * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Remove wrong + mcpu. + +Fri Jan 11 07:35:12 2002 Douglas B Rupp + + * config/alpha/vms.h: (MD_FALLBACK_FRAME_STATE_FOR): Fix errors. + Protect with IN_LIBGCC. + (LINK_EH_SPEC): Add required trailing space. + +Fri Jan 11 09:25:05 2002 Nicola Pero + + * c-tree.h: Move function declarations so that they are listed + under the filename which contains them. + (check_identifier, finish_decl_top_level, + lookup_name_current_level_global, shadow_record_fields): Remove. + +2002-01-11 Andreas Jaeger + + * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Remove duplicated + march. + +2002-01-10 Richard Henderson + + * config/alpha/alpha.c (print_operand): Add 'J'. + * config/alpha/alpha.md (call_osf_1_er, call_value_osf_1_er): Take a + new operand with the sequence number for the lituse. When splitting + the insns, use gen_movdi_er_high_g and generate a sequence number. + (gen_movdi_er_high_g): Print the sequence number if nonzero. + +2002-01-10 Aldy Hernandez + + * config/rs6000/rs6000.c (altivec_init_builtins): Add support for + lvebx, lvehx, lvewx, lvxl, lvx, stvx, stvebx, stvehx, stvewx, + stvxl. + (altivec_expand_builtin): Same. + (altivec_expand_stv_builtin): New. + + * config/rs6000/rs6000.h (rs6000_builtins): Same. + + * config/rs6000/rs6000.md ("altivec_lvebx"): New. + ("altivec_lvehx"): New. + ("altivec_lvewx"): New. + ("altivec_lvxl"): New. + ("altivec_lvx"): New. + ("altivec_stvx"): New. + ("altivec_stvebx"): New. + ("altivec_stvehx"): New. + ("altivec_stvewx"): New. + ("altivec_stvxl"): New. + +2002-01-10 Richard Henderson + + * cfgrtl.c (delete_insn): Assert insn hasn't been deleted yet. + * reload1.c (delete_output_reload): Zap spill_reg_store. Take + care not to delete instructions twice. + +2002-01-10 Zack Weinberg + + * toplev.c: Don't declare environ (it's not used anywhere). + * configure.in: Don't check for declaration of environ. + * config/i386/xm-mingw32.h: Don't #define environ. + * config.in, configure: Regenerate. + +2002-01-10 Zack Weinberg + + * configure.in: Set stage1_cflags for powerpc-*-darwin*. + * configure: Regenerate. + + * config/interix.h: Set DO_GLOBAL_CTORS_BODY and + DO_GLOBAL_DTORS_BODY here, not in xm-interix.h. + * config/alpha/vms.h: Set INCLUDE_DEFAULTS here, not in + alpha/xm-vms.h. + * config/m68k/t-next: Set OTHER_FIXINCLUDES_DIRS and + LIMITS_H_TEST here, not in m68k/x-next. + * config/rs6000/beos.h: Set STANDARD_INCLUDE_DIR and + SYSTEM_INCLUDE_DIR here, not in rs6000/xm-beos.h. + + * config/x-interix: Don't set RANLIB, RANLIB_TEST, SHELL, + LIBGCC2_INCLUDES, or SYSTEM_HEADER_DIR. + * config/alpha/x-vms: Don't set USE_COLLECT2. Add comments. + + * config/i386/x-djgpp: Renamed i386/t-djgpp. + * config/m88k/x-dolph: Renamed m88k/t-dolph. + * config/m88k/x-texXD88: Renamed m88k/t-texXD88. + * config/pa/x-pa-mpeix: Renamed pa/t-mpeix. Update for + replacement of quadlib.asm with quadlib.c. + + * config/x-interix3, config/xm-interix.h, config/i386/x-beos, + config/i386/xm-osf1elf.h, config/rs6000/x-darwin, + config/rs6000/xm-beos.h: Delete file. + + * config.gcc: Update to match above changes. + +2002-01-10 Kazu Hirata + + * config/h8300/h8300.h: Fix comment typos. + * config/h8300/h8300.md: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + +2002-01-10 Dale Johannesen + + PR optimization/5269 + * unroll.c (precondition_loop_p): Make *increment be the correct + sign when n_iterations known, to avoid confusing caller. + +2002-01-10 Kazu Hirata + + * doc/extend.texi (deprecated): Fix a typo. + +Thu Jan 10 22:35:54 CET 2002 Jan Hubicka + + * basic-block.h (update_br_prob_note): Declare. + * cfgcleanup.c (try_simplify_condjump): Call update_br_prob_note. + (try_forward_edges): Care negative frequencies and update note. + (outgoing_edges_match): Tweek conditional merging heuristics. + (try_crossjump_to_edge): use update_br_prob_note. + * cfglayout.c (fixup_reorder_chain): Likewise. + * cfrtl.c (update_br_prob_note): New. + * ifcvt.c (dead_or_predicable): Call update_br_prob_note. + + * i386.c (ix86_decompose_address): Return -1 if address contains + shift. + (legitimate_address_p): Require ix86_decompose_address to return 1. + + * gcse.c (hash_scan_set): Use CONSTANT_INSN_P. + (cprop_insn): Likewise. + +2002-01-10 Kazu Hirata + + * toplev.c: Fix formatting. + * tree.c: Likewise. + * tree-dump.c: Likewise. + * unroll.c: Likewise. + * unwind-dw2.c: Likewise. + * unwind-dw2-fde.c: Likewise. + * unwind-dw2-fde-glibc.c: Likewise. + * unwind-sjlj.c: Likewise. + +2002-01-10 Joseph S. Myers + + * doc/invoke.texi: Document PDP-11 options. + +2002-01-10 Kazu Hirata + + * config/h8300/h8300.h: Fix formatting. + +2002-01-10 Ira Ruben + + Add __attribute__ ((deprecated)). + * extend.texi: Document __attribute__ ((deprecated)). + * invoke.texi: Document -Wno-deprecated-declarations. + * testsuite/g++.dg/other/deprecated.C: New C++ test. + * testsuite/gcc.dg/deprecated.c: New C test. + * attribs.c (enum attrs): Declare handle_deprecated_attribute(). + (c_common_attribute_table): Add "deprecated" entry. + (handle_deprecated_attribute): New function. + * c-decl.c (deprecated_states): New enum. + deprecated_state: State of "deprecated" handling. + (start_decl): Set deprecated_state based on attributes. + (grokdeclarator): Test for deprecated uses, propagate attribute. + * c-typeck.c (build_component_ref): Test for deprecated fields. + (build_external_ref): Test for deprecated primaries. + * diagnostic.c (warn_deprecated_use) New function to issue + warnings about __attribute__ ((depricated)) references. + * flags.h (warn_deprecated_decl): Extern declared for + -W[no-]deprecated-declarations option. + * print-tree.c (print_node): Show deprecated flag status. + * toplev.c (warn_deprecated_decl): Defined. + (W_options): Added "deprecated-declaration". + * toplev.h (warn_deprecated_use): Extern declared. + * tree.h (struct tree_common): Define deprecated_flag. + (TREE_DEPRECATED): New macro to access flag. + * cp/call.c (build_call): Test for deprecated calls. + * cp/class.c (add_implicitly_declared_members): Set global + flag to tell grokdeclarator to not issue deprecated warnings. + * cp/cp-tree.h: Add extern for adding_implicit_members. + * cp/decl.c (deprecated_states): New enum. + (start_decl): Set deprecated_state based on attributes. + (grokdeclarator): Test for deprecated uses, propagate attribute. + * cp/lex.c (do_identifier): Test for deprecated primaries. + * cp/typeck.c (build_component_ref): Test for deprecated fields. + +2002-01-10 Ira Ruben + + Fix to assign attributes to inline member functions. + * cp/decl.c (start_method): Handle attrlist. + +2002-01-10 Kazu Hirata + + * combine.c (expand_field_assignment): Use subreg_lsb(). + +2002-01-10 David Edelsohn + + * alias.c (find_base_value): Add cases for HIGH, PRE_INC, PRE_DEC, + POST_INC, POST_DEC, PRE_MODIFY, and POST_MODIFY. + (find_base_term): Add cases for TRUNCATE, PRE_MODIFY, and POST_MODIFY. + Recurse for any operand of AND as long as constant is nonzero. + +2002-01-10 Kazu Hirata + + * config/h8300/h8300.md: Remove constraints from expanders. + +2002-01-10 Kazu Hirata + + * varasm.c: Fix formatting. + * varray.c: Likewise. + * vmsdbgout.c: Likewise. + * xcoffout.c: Likewise. + +Thu Jan 10 17:19:12 CET 2002 Jan Hubicka + + * cfgcleanup.c (try_forward_edges): Properly initialize nthreaded_edges; + update edge probabilities to match. + +2002-01-10 Joseph S. Myers + + * Makefile.in ($(docdir)/gccint.info, gccint.dvi): Add additional + dependencies. + * doc/languages.texi, doc/sourcebuild.texi: New files. + * doc/configfiles.texi: Make a subsubsection. Update. + * doc/configterms.texi: Add @node. Remove warning that this isn't + instructions for building GCC. + * doc/makefile.texi: Make a subsection. + * doc/gccint.texi: Update. + +Thu Jan 10 16:39:58 CET 2002 Jan Hubicka + + * i386.md (sse_mov?fcc_const0_?): Fix constraints. + +Thu Jan 10 12:45:50 2002 Nicola Pero + + * doc/cpp.texi: Document the __OBJC__ preprocessor macro. + +Thu Jan 10 11:19:18 CET 2002 Jan Hubicka + + * optabs.c (expand_fix): Look for wider integer modes first. + + * i386.md (mov?f): Avoid the fake const double trick for medium + memory model. + (min?f*/max?f*): Prohibit memory operands for i387 variant. + (fop_df_4): Disable for SSE compilation. + +2002-01-10 Graham Stott + + * dwarf2out.c (indirect_string_alloc, output_indirect_string): + Move prototype into DWARF2_DEBUGGING_INFO conditional block. + +2002-01-10 Richard Henderson + + * config/alpha/alpha.md (extendsidi2_fix): Penalize f/f alternative. + +2002-01-10 Richard Henderson + + * regrename.c (find_oldest_value_reg): Fix typo in mode change check. + (copyprop_hardreg_forward_1): Likewise. Use mode_change_ok. + +2002-01-10 Kazu Hirata + + * combine.c (can_combine_p): Fix a comment typo. + +2002-01-09 Zack Weinberg + + * Makefile.in (s-gencheck, s-options, s-specs): Handle an + empty list correctly. Change loop index $t to $f for + consistency with rest of Makefile. + +2002-01-08 Aldy Hernandez + + * testuite/gcc.dg/altivec-4.c: Add test for mtvscr, dssall, + mfvscr, dss, lvsl, lvsr, dstt, dstst, dststt, dst. + + * config/rs6000/rs6000.c (altivec_expand_builtin): Add support for + mtvscr, dssall, mfvscr, dss, lvsl, lvsr, dstt, dst, dstst, dststt. + (altivec_init_builtins): Same. + (altivec_expand_unop_builtin): Return NULL_RTX on error. + (altivec_expand_binop_builtin): Same. + (altivec_expand_ternop_builtin): Same. + (bdesc_dst): New. + + * config/rs6000/rs6000.md ("altivec_mtvscr"): New. + ("altivec_vctuxs"): Fix typo. + ("altivec_vnmsubfp"): Same. + ("altivec_dssall"): New. + ("altivec_mfvscr"): New. + ("altivec_dss"): New. + ("altivec_lvsl"): New. + ("altivec_lvsr"): New. + ("altivec_dstt"): New. + ("altivec_dstst"): New. + ("altivec_dststt"): New. + ("altivec_dst"): New. + + * config/rs6000/rs6000.h (rs6000_builtins): Add mtvscr, dssall, + mfvscr, dss, lvsl, lvsr, dstt, dstst, dststt, dst. + +2002-01-09 Richard Henderson + + * config/alpha/alpha.md (prologue_mcount): Remove lituse_jsr reloc. + +2002-01-10 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_asm_identify_gcc): Remove unused + function. + * config/mmix/mmix-protos.h (mmix_asm_identify_gcc): Don't + prototype. + * config/mmix/mmix.h (ASM_IDENTIFY_GCC): Remove unused macro. + +2002-01-09 Kazu Hirata + + * read-rtl.c: Fix formatting. + * real.c: Likewise. + * regclass.c: Likewise. + * regrename.c: Likewise. + * reg-stack.c: Likewise. + * reload1.c: Likewise. + * reload.c: Likewise. + * rtl.c: Likewise. + +2002-01-09 Kazu Hirata + + * rtlanal.c (find_reg_fusage): Use XEXP instead of SET_DEST + to extract items in the expr_list chain. + +2002-01-09 Richard Henderson + + * config/vax/vax.c (vax_rtx_cost): Never abort. + + * config/vax/vax.h (REAL_ARITHMETIC): Define. + +2002-01-09 Jan Hubicka + + * gcse.c (cprop_jump): Delete insn if simplified jump is no-op. + +2002-01-09 Richard Henderson + + * config/arm/arm.c (arm_gen_constant): Use trunc_int_for_mode. + Unify code from various alternatives. + +2002-01-09 Richard Henderson + + * regrename.c (copy_value): Ignore the copy if the source register + is present in the value chain with a narrower mode. + +2002-01-09 Herman A.J. ten Brugge + + * real.c (c4xtoe, toc4x): Do some special conversion on long doubles + for the c4x target. Also improve layout. + +2002-01-09 Richard Henderson + + * config/m32r/m32r.c (move_src_operand): Fix 32-bit int test. + * config/m32r/m32r.md (and ior xor splitters): Swap operands + to match insn patterns. + +2002-01-09 Richard Henderson + + * regrename.c (find_oldest_value_reg): Use gen_rtx_raw_REG. + (copyprop_hardreg_forward_1): Likewise. + +2002-01-09 John David Anglin + + * pa.md (decrement_and_branch_until_zero): Change predicate for + operand 0 from register_operand to reg_or_nonsymb_mem_operand. + +2002-01-09 Bryce McKinlay + + * ginclude/stddef.h: Define _BSD_WCHAR_T_DEFINED_ if _BSD_WCHAR_T_ + gets undefined. For Darwin. + +2002-01-09 Herman A.J. ten Brugge + + * config/c4x/c4x.h: Use PUSH_ARGS and PUSH_ROUNDING for stack passing. + +2002-01-09 Michael Hayes + + * config/c4x/c4x/md: Remove extraneous constraints from define_splits. + +2002-01-08 Richard Henderson + + * regrename.c (copy_value): Ignore overlapping copies. + +2002-01-08 Richard Henderson + + * config/alpha/alpha.c (alpha_split_conditional_move): Call copy_rtx + as needed to avoid shared structure. + +2002-01-08 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Fix 15-bit LSHIFTRT on + H8/300H and H8S. + +2002-01-08 Joseph S. Myers + + * doc/tm.texi (EASY_DIV_EXPR, IMPLICIT_FIX_EXPR, + LONGJMP_RESTORE_FROM_STACK, MAX_INT_TYPE_SIZE): Remove + documentation of obsolete macros. + * system.h: Poison these macros. + * config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, + config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, + config/c4x/c4x.h, config/clipper/clipper.h, + config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, + config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, + config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, + config/i386/i386.h, config/i860/i860.h, config/i960/i960.h, + config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, + config/m68k/m68k.h, config/m88k/m88k.h, config/mcore/mcore.h, + config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, + config/mn10300/mn10300.h, config/ns32k/ns32k.h, config/pa/pa.h, + config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, + config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.h, + config/sparc/sparc.h, config/stormy16/stormy16.h, + config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h: Remove + definitions and commented out definitions of obsolete macros. + * config/mips/iris5.h (MAX_WCHAR_TYPE_SIZE): Don't define in terms + of MAX_INT_TYPE_SIZE. + +2002-01-08 Ulrich Weigand + + * config/s390/s390.c (s390_preferred_reload_class): Never + return ADDR_REGS if it isn't a subset of the given class. + * config/s390/s390.h (REGISTER_MOVE_COST): Penalize not just + FP_REGS, but all superclasses as well. + + * config/s390/s390.c (s390_function_profiler): Fix thinko. + + * config/s390/s390.md (cmpdi_ccu_mem, cmpsi_ccu_mem, + cmphi_ccu_mem, cmpqi_ccu_mem): First operand of compare + must not be a const_int. + +2002-01-08 Richard Henderson + + * Makefile.in (toplev.o): Depend on options.h. + (gcc.o): Depend on specs.h. + +2002-01-08 Jakub Jelinek + + * expr.c (store_expr): Convert VOIDmode constants back to target's + mode. + +2002-01-08 Gerald Pfeifer + + * doc/invoke.texi: Markup gcc as @command. Refer to + http://gcc.gnu.org/onlinedocs/gcc/Contributors.html instead + of http://gcc.gnu.org/thanks.html. + +2002-01-08 Dale Johannesen + + * config/rs6000/rs6000.md: Add missing int register + target case to movdf_low. + +2002-01-08 Zack Weinberg + + * Makefile.in (cs-tconfig.h): Don't depend on $(CONFIG_H) or + except.h. Remove commands to define USING_SJLJ_EXCEPTIONS. + (cppinit.o): Depend on except.h. + (gencheck.h, options.h, specs.h, s-gencheck, s-options, + s-specs): New rules. + + * configure.in: Don't AC_DEFINE_UNQUOTED PACKAGE or VERSION. + Don't create specs.h/options.h/gencheck.h here. Remove + unnecessary variable settings from last argument of AC_OUTPUT. + * config.in, configure: Regenerate. + * intl.c: Hardcode package name as "gcc". + + * cppinit.c: Include except.h. + (builtin_array): Define __USING_SJLJ_EXCEPTIONS__ when + appropriate. + * unwind-dw2.c, unwind-sjlj.c, config/ia64/unwind-ia64.c: + Use #if(n)def __USING_SJLJ_EXCEPTIONS, not #if + (!)USING_SJLJ_EXCEPTIONS. + * doc/cpp.texi: Document __USING_SJLJ_EXCEPTIONS__. + +2002-01-08 Joseph S. Myers + + * doc/tm.texi (ASM_OUTPUT_EH_REGION_BEG, ASM_OUTPUT_EH_REGION_END, + ASM_OUTPUT_LABELREF_AS_INT, DOESNT_NEED_UNWINDER, EH_TABLE_LOOKUP, + OBJC_SELECTORS_WITHOUT_LABELS, OMIT_EH_TABLE): Remove + documentation of obsolete macros. + * system.h: Poison these macros. + * config/d30v/d30v.h, config/ns32k/encore.h, + config/stormy16/stormy16.h: Remove definitions and commented out + definitions of obsolete macros. + +Tue Jan 8 15:56:41 2002 Nicola Pero + + * objc/objc-act.c (handle_class_ref): Mark the declaration of + %sobjc_class_ref_%s as used - to prevent unwanted compiler + warnings. + +2002-01-08 Ulrich Weigand + + * config/s390/linux.h (ASM_OUTPUT_LABELREF): Remove. + * config/s390/s390.c (s390_emit_epilog): Add REG_FRAME_RELATED_EXPR + to insn adjusting stack/frame pointer. + * config/s390/s390.md (reload_la_64, reload_la_31): Do not + accept operands that cause the insn to be non-splittable. + +2002-01-08 Graham Stott + + * c-tree.h (C_TYPE_FIELDS_READONLY): Uppercase macro parameter. + (C_TYPE_FIELDS_VOLATILE): Likewise. + (C_TYPE_BEING_DEFINED): Likewise. + (C_IS_RESERVED_WORD): Likewise. + (C_TYPE_VARIABLE_SIZE): Likewise. + (C_DECL_VARIABLE_SIZE): Likewise. + (C_MISSING_PROTOTYPE_WARNED): Likewise. + (C_SET_EXP_ORIGINAL_CODE): Likewise. + (C_TYPEDEF_EXPLICITLY_SIGNED): Uppercase macro parameter and remove + parenthesis. + (C_DECL_ANTICIPATED): Likewise. + (c_build_type_variant): Add parenthesis. + +2002-01-08 Joseph S. Myers + + * gcc.c (option_map): Remove --version. + (process_command): Handle -fversion following the GNU Coding + Standards. Partially addresses PR other/704. + +2002-01-08 Graham Stott + + * combine.c (combine_instructions): Fix typo. + +2002-01-08 Graham Stott + + * debug.h: Use "tree" and "rtx" throughout. + + * debug.c: Likewise. + +2002-01-08 Nick Clifton + + * dbxout.c (dbxout_symbol_location): If a symbol ref is in the + constant pool, use the pool's version of the symbol instead. + +2002-01-07 Richard Henderson + + * regrename.c (find_oldest_value_reg): Ignore the value chain if + the original register was copied in a mode with a fewer number of + hard registers than the desired mode. + (copyprop_hardreg_forward_1): Likewise. + (debug_value_data): Fix loop test. + * toplev.c (parse_options_and_default_flags): Reenable + -fcprop-registers at -O1. + +2002-01-07 Aldy Hernandez + + * config/rs6000/rs6000.c (bdesc_2arg): Add altivec predicates. + (altivec_init_builtins): New node v4si_ftype_v16qi_v16qi. + + * config/rs6000/rs6000.h (rs6000_builtins): Add enums for altivec + predicates. + + * config/rs6000/rs6000.md: Add altivec predicate patterns. + +2002-01-07 John David Anglin + + * pa.c (FUNC_BEGIN_PROLOG_LABEL, current_function_number): Define. + (pa_output_function_prologue): Output local label at the beginning of + the prologue when profiling. + (hppa_profile_hook): Use the local label rather than the function label. + * pa.h (PROFILE_BEFORE_PROLOGUE): Define. + +2002-01-07 Aldy Hernandez + + * config/rs6000/rs6000.c (print_operand): Remove extra space. + (altivec_expand_unop_builtin): Fix thinko. + (altivec_expand_binop_builtin): Same. + (altivec_expand_ternop_builtin): Same. + (altivec_expand_builtin): Same. + +2002-01-07 Richard Henderson + + * config/rs6000/xcoff.h (ASM_FILE_START): Reverted to profile_flag. + +2002-01-07 Jason Merrill + + * unwind-dw2.c (execute_cfa_program): Use < again. + +2002-01-07 Jakub Jelinek + + * predict.c (combine_predictions_for_insn): Avoid division by zero. + +2002-01-07 Jakub Jelinek + + * simplify-rtx.c (simplify_plus_minus): Bump n_ops for NOT. + Don't allow -1 - x -> ~x simplifications in the first pass. + +2002-01-07 Aldy Hernandez + + * rs6000.c (altivec_expand_ternop_builtin): Don't die on invalid + arguments. + (altivec_expand_binop_builtin): Same. + (altivec_expand_unop_builtin): Same. + (print_operand): Fix typo. + (bdesc_1arg): Add vupk* variants. + + * rs6000.h (rs6000_builtins): Add vupk* enums. + + * rs6000.md: Add altivec_vupk* variants. + +2002-01-07 Joseph S. Myers + + * doc/gcc.texi, doc/gccint.texi, doc/cppinternals.texi, + doc/install.texi, doc/invoke.texi, doc/rtl.texi: Update copyright + and last update dates. + +2002-01-07 Janis Johnson + + * doc/rtl.texi (Flags): Clean up documentation of RTL flags + +2002-01-07 Marek Michalkiewicz + + * config/avr/avr.c (avr_mcu_types): Add new MCU types. + * config/avr/avr.h (CPP_SPEC): Likewise. + (LINK_SPEC): Likewise. + (CRT_BINUTILS_SPECS): Likewise. + * config/avr/t-avr (MULTILIB_MATCHES): Likewise. + * doc/invoke.texi (AVR Options): Document them. + +Mon Jan 7 11:59:34 CET 2002 Jan Hubicka + + * unroll.c (copy_loop_body): Always properly update JUMP_LABEL and + LABEL_NUSES. + +2002-01-07 Graham Stott + + * config/i386/i386.h: Update copyright date. + (HALF_PIC_PTR): Add parenthesis. + (OPTIMIZATION_OPTIONS): Whitespace, add parenthesis and wrap. + (CONSTANT_ALIGNMENT): Add parenthesis. + (DATA_ALIGNMENT): Likewise. + (LOCAL_ALIGNMENT): Likewise. + (FUNCTION_ARG_BOUNDARY): Whitespace, add parenthesis and wrap. + (IS_STACK_MODE): Uppercase macro parameter, add parenthesis and wrap. + (CONDITIONAL_REGISTER_USAGE): Wrap in do {...} while (0). + (HARD_REGNO_NREGS): Add paranethesis. + (VALID_SSE_REG_MODE): Whitespace. + (VALID_MMX_REG_MODE): Whitespace. + (VALID_FP_MODE_P): Uppercase macros parameter and whitespace. + (ix86_hard_regno_mode_ok): Add parenthesis. + (HARD_REGNO_CALLER_SAVE_MODE): Whitespace. + (RETURN_IN_MEMORY): Whitespace. + (N_REG_CLASSES): Add parenthesis. + (INTEGER_CLASS_P): Add parenthesis and wrap. + (FLOAT_CLASS_P): Likewise. + (SSE_CLASS_P): Likewise. + (MMX_CLASS_P): Likewise. + (MAYBE_INTEGER_CLASS_P): Likewise. + (MAYBE_FLOAT_CLASS_P): Likewise. + (MAYBE_SSE_CLASS_P): Likewise. + (MAYBE_MMX_CLASS_P): Likewise. + (Q_CLASS_P): Likewise. + (GENERAL_REGNO_P): Uppercase macro parameter. + (REX_INT_REGNO_P): Uppercase macro parameter and wrap. + (FP_REGNO_P): Likewise. + (ANY_FP_REGNO_P): Uppercase macro parameter. + (SSE_REGNO_P): Likewise. + (SSE_REGNO): Likewise. + (SSE_REG_P): Likewise. + (SSE_FLOAT_MODE_P): Likewise. + (MMX_REGNO_P): Likewise. + (MMX_REG_P):Likewise. + (STACK_REG_P): Likewise. + (NON_STACK_REG_P): Likewise. + (STACK_TOP_P): Likewise. + (CONVERT_HARD_REGISTER_TO_SSA_P): Add parenthesis. + (PREFERRED_RELOAD_CLASS): Add parenthesis and whitespace. + (SECONDARY_MEMORY_NEEDED): Likewise. + (SECONDARY_OUTPUT_RELOAD_CLASS): Whitespace. + (MD_ASM_CLOBBERS): Whitespace and wrap. + (MUST_PASS_IN_STACK): Whitespace and wrap. + (RETURN_POPS_ARGS): Add parenthesis. + (INIT_CUMULATIVE_ARGS): Likewise. + (FUNCTION_ARG): Likewise. + (FUNCTION_OK_FOR_SIBCALL): Add parenthesis and whitespace. + (SETUP_INCOMING_VARARGS): Likewise. + (BUILD_VA_LIST_TYPE): Add parenthesis. + (EXPAND_BUILTIN_VA_START): Uppercase macro paremeters and add + parenthsis. + (EXPAND_BUILTIN_VA_ARG): Likewise. + (FUNCTION_PROFILER): Wrap in do { ... } while (0) and add parenthesis. + (INITIALIZE_TRAMPOLINE): Add parenthesis. + (INITIAL_ELIMINATION_OFFSET): Likewise. + (REGNO_OK_FOR_INDEX_P): Add parenthesis. + (REGNO_OK_FOR_BASE_P): Likewise. + (REGNO_OK_FOR_SIREG_P): Add parenthesis and wrap. + (REGNO_OK_FOR_DIREG_P): Likewise. + (REG_OK_FOR_INDEX_P): Whitespace. + (REG_OK_FOR_BASE_P): Whitespace. + (GO_IF_LEGITIMATE_ADDRESS): Wrap in do { ... } while (0) and add + parenthesis. + (FIND_BASE_TERM): Fix typo. + (LEGITIMIZE_ADDRESS): Wrap in { .. } while (0) and add parenthesis. + (REWRITE_ADDRESS): Uppercase macro parameter and whitespace. + (SYMBOLIC_CONST; Whitespace. + (GO_IF_MODE_DEPENDENT_ADDRESS):Wrap in { .. } while (0) and wrap. + (ENCODE_SECTION_INFO): Whitespace. + (FINALIZE_PIC): Remove do { ... } while (0). + (PROMOTE_MODE): Wrap in do { ... } while (0). + (CONST_COSTS): Whitespace. + (RTX_COSTS): Add paramethesis, whitespace and wrap. + (REGISTER_MOVE_COST): Add parenthesis. + (MEMORY_MOVE_COST): Likewise. + (EXTRA_CC_MODES): Whitespace. + (SELECT_CC_MODE): Add parenthesis and whitespace. + (DBX_REGISTER_NUMBER): Uppercase macro parameter and add parenthsis. + (ASM_PREFERRED_EH_DATA_FORMAT): Add parenthesis and whitespace. + (ASM_OUTPUT_LABEL): Add paramethesis. + (ASM_OUTPUT_REG_PUSH): Add parenthesis and whitespace. + (ASM_OUTPUT_REG_POP): Likewise. + (ASM_OUTPUT_ADDR_VEC_ELT): Add parenthesis. + (ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + + * config/i386/i386.c: Update copyright. + (CHECK_STACK_LIMIT): Add parenthesis. + (AT_BP): Uppercase macro parameter. + (x86_64_int_parameter_registers): Constify. + (x86_64_int_return_registers): Likewise. + (ix86_compare_op0): Use rtx. + (construct_container): Constify INTREG parameter. + (function_arg): Use rtx. + + * diagnostic.h: Update copyright date. + (output_buffer_state): Add parenthesis. + (output_buffer_format_args): Likewise. + + * combine.c (combine_instructions): Replace XEXP (links, 0) + with link. + +2002-01-06 H.J. Lu + + * cfgcleanup.c (thread_jump): Fix 2 typos. + +2002-01-06 Aldy Hernandez + + * config.gcc: Add support for --enable-altivec. + +2002-01-06 Craig Rodrigues + + * emit-rtl.c (gen_highpart): Add check for NULL_RTX. + +2002-01-06 Jakub Jelinek + + * objc/objc-act.c (handle_impent): Use assemble_variable to emit + __objc_class_name_*. + +2002-01-06 Craig Rodrigues + + * doc/install.texi (sparcv9-*-solaris2*): Add documentation. + +2002-01-06 Richard Henderson + + * reorg.c (emit_delay_sequence): Remove death notes, not merely + nop them out. Increment label reference count for REG_LABEL. + (fill_slots_from_thread): Frob label reference count around + delete_related_insns. + +2002-01-05 Richard Henderson + + * cfgcleanup.c (try_forward_edges): Detect infinite loops while + jump threading. + +2002-01-05 Richard Henderson + + * c-decl.c (c_expand_body): Don't call outlining_inline_function. + * integrate.c (output_inline_function): Likewise. + * toplev.c (rest_of_compilation): Do it here instead. Move call + to remove_unnecessary_notes after emitting abstract instance. + Force an emitted nested function to have its parent emited as well. + * dwarf2out.c (loc_descriptor_from_tree): Read mode after checking + for null. + (rtl_for_decl_location): Do not look at reload data structures + before reload has run. + +2002-01-05 Kazu Hirata + + * cse.c: Fix formatting. + * dwarf2asm.c: Likewise. + * dwarf2out.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * function.c: Likewise. + * gcov.c: Likewise. + * gencheck.c: Likewise. + * genrecog.c: Likewise. + * ggc-common.c: Likewise. + * ggc-page.c: Likewise. + * global.c: Likewise. + +2002-01-05 Kazu Hirata + + * combine.c: Fix formatting. + +2002-01-05 Craig Rodrigues + + PR middle-end/1557 + * config/ia64/ia64.h (RENAME_EXTENDED_BLOCKS): Remove. + +2002-01-05 David Edelsohn + + * config/rs6000/rs6000.h (TARGET_POWERPC): For IN_LIBGCC2, define + as 1 for __powerpc64__ as well. + + * config/rs6000/t-aix43 (T_ADAFLAGS): Define. + + * alias.c (find_base_value, PLUS/MINUS): If we found a base, + return it. + +2002-01-05 Daniel Berlin + + * lcm.c: Revert change, due to performance regression it causes on + SPEC because it's slightly more conservative (sigh, I hate + edge-based LCM). + +Sat Jan 5 11:52:05 CET 2002 Jan Hubicka + + * cfgcleanup.c (try_forward_edges): Allow multiple jump threading. + +2002-01-05 Neil Booth + + * doc/cppinternals.texi: Update. + +2002-01-05 Hans-Peter Nilsson + + * doc/invoke.texi (Option Summary) : Document + -mbranch-predict, -mreg-stack-fill-bug-workaround and their + negatives. + (MMIX Options): Ditto. Fix item/itemx typo for -mno-zero-extend. + * config/mmix/mmix.c (mmix_target_asm_function_prologue): Rework + kludge for pre-october-14th mmix versions to handle new-found bug + with PUSHJ/PUSHGO and the register stack. + * config/mmix/mmix.h (struct machine_function): Rename member + has_call_value_without_parameters to has_call_without_parameters. + All referers changed. + (TARGET_MASK_REG_STACK_FILL_BUG, TARGET_DEFAULT + TARGET_MASK_BRANCH_PREDICT): New macros. + (TARGET_SWITCHES): New options -mreg-stack-fill-bug-workaround, + -mno-reg-stack-fill-bug-workaround. + * config/mmix/mmix.md ("call"): Set struct machine member + has_call_without_parameters. + +Sat Jan 5 02:20:22 CET 2002 Jan Hubicka + + * cfgcleanup.c (thread_jump): Fix handling of reversed branches. + +Sat Jan 5 01:35:29 CET 2002 Jan Hubicka + + * cfgcleanup.c: Include tm_p.h + (mark_effect): Fix handling of hard register; fix handling of SET + +2002-01-04 Kazu Hirata + + * config/h8300/h8300.md (anonymous patterns): Check that + operands are registers before using REGNO on them. + +2002-01-03 Roland McGrath + + * doc/invoke.texi (RS/6000 and PowerPC Options): Add -mcall-gnu. + +2002-01-04 Jakub Jelinek + + * tree.h (expand_expr_stmt_value): Add maybe_last argument. + * c-common.h (genrtl_expr_stmt_value): Likewise. + * stmt.c (expand_expr_stmt): Pass 1 as maybe_last. + (expand_expr_stmt_value): Add maybe_last argument. + Don't warn about statement with no effect if it is the last statement + in expression statement. + * c-semantics.c (genrtl_expr_stmt): Pass 1 as maybe_last. + (genrtl_expr_stmt_value): Add maybe_last argument, pass it down to + expand_expr_stmt_value. + (expand_stmt) [EXPR_STMT]: Pass 1 as maybe_last to + genrtl_expr_stmt_value if t is the last EXPR_STMT in its scope. + * expr.c (expand_expr) [LABELED_BLOCK_EXPR, LOOP_EXPR]: Pass 1 + as maybe_last to expand_expr_stmt_value. + +Fri Jan 4 11:45:05 2002 Jeffrey A Law (law@redhat.com) + + * c-common.c (c_expand_start_cond): Expect the IF_STMT node to + be passed in, do not build it. + (c_begin_if_stmt): New function. + (c_begin_while_stmt, c_finish_while_stmt_cond): Likewise. + * c-common.h (c_expand_start_cond): Update prototype. + (c_begin_if_stmt): Prototype new function. + (c_begin_while_stmt, c_finish_while_stmt_cond): Likewise. + * c-parse.in (if_prefix): Use c_begin_if_stmt, + c_begin_while_stmt and c_finish_while_stmt_cond. + +2002-01-04 William Cohen + + * config/pa/elf.h (ASM_FILE_START): Reverted to profile_flag. + * config/pa/pa-linux.h (ASM_FILE_START): Likewise. + * config/pa/pa64-hpux.h (ASM_FILE_START): Likewise. + * config/pa/som.h (ASM_FILE_START): Likewise. + +2002-01-04 Daniel Berlin + + * lcm.c: Include df.h. + Add available_transfer_function prototype. + (compute_available): Rework to use iterative dataflow framework. + (struct bb_info): s/bb_info/lcm_bb_info/g to avoid conflict + with bb_info in df.h + (available_transfer_function): New function. + + * Makefile.in (lcm.o): add df.h to dependencies. + +2002-01-04 Richard Henderson + + * config/alpha/alpha.c (some_operand): Accept HIGH. + (input_operand): Likewise; accept simple references to globals. + (alpha_const_ok_for_letter_p): New, outlined from alpha.h. + (alpha_const_double_ok_for_letter_p): Likewise. + (alpha_extra_constraint): Likewise. + (alpha_preferred_reload_class): Likewise. Do not force + symbolic constants to memory. + (alpha_legitimate_address_p): Accept simple references + to small_symbolic_operand. + (alpha_legitimize_address): New arg scratch. Be prepared to be + called when no_new_pseudos. Emit simple symbolic references. + Split integers into low, high, and rest. + (alpha_expand_mov): Use alpha_legitimize_address. + (some_small_symbolic_mem_operand): New. + (split_small_symbolic_mem_operand): New. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (CONST_OK_FOR_LETTER_P): Out-line. + (CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. + (EXTRA_CONSTRAINT): Likewise. + (PREFERRED_RELOAD_CLASS): Likewise. + (LEGITIMIZE_ADDRESS): Update for alpha_legitimize_address change. + (PREDICATE_CODES): Update. + * config/alpha/alpha.md: New post-reload splitters to convert + simplfied symbolic operands to the form that references $29. + (divide expanders): Use emit_move_insn, not gen_movdi_er_high_g. + (movdi_er_nofix, movdi_er_fix): Accept any symbolic operand. + +2002-01-03 Richard Henderson + + * local-alloc.c (function_invariant_p): Update commentary. + +2002-01-04 H.J. Lu + + * toplev.c (rest_of_compilation): Fix a typo when calling + cleanup_cfg. + +2002-01-03 Kazu Hirata + + * c-common.c: Fix formatting. + * diagnostic.c: Likewise. + * doloop.c: Likewise. + * dwarf2out.c: Likewise. + +2002-01-03 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Use 'not.w' instead + of 'neg.w' when xoring with 0x0000ffff or 0xffff0000. + +2002-01-03 Neil Booth + + * cpperror.c: Update comments and copyright. + * cppexp.c, cppfiles.c, cpphash.c, cpphash.h, cppinit.c, + cpplex.c, cpplib.c, cpplib.h, cppmacro.c, cppmain.c: Similarly. + +2002-01-03 John David Anglin + + * collect2.c (main): Use strcmp when testing for "-shared". + +2002-01-03 Neil Booth + + * cppmacro.c: Don't include intl.h. Update comments. + (new_number_token): Allocate enough buffer for 64-bit unsigned + integers; update prototype. + * cppmain.c: Update comments. + +2002-01-03 William Cohen + + * function.h (struct function): Add profile. + (current_function_profile): New. + doc/extend.texi: Update documentation. + * final.c (final_start_function): Use current_function_profile + instead of profile_flag. + (profile_after_prologue): Likewise. + * function.c (expand_function_start): Likewise. + (expand_function_start): Likewise. + * config/alpha/alpha.c (direct_call_operand): + (alpha_does_function_need_gp): Likewise. + (alpha_expand_prologue): Likewise. + * config/arm/arm.c (arm_expand_prologue): Likewise. + thumb_expand_prologue: Likewise. + * config/d30v/d30v.c (d30v_stack_info): Likewise. + * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Likewise. + (fr30_expand_prologue): Likewise. + * config/i386/cygwin.h (SUBTARGET_PROLOGUE): Likewise. + * config/i386/i386.c (ix86_osf_output_function_prologue): Likewise. + * config/i386/i386.h (FINALIZE_PIC): Likewise. + * config/i386/win32.h (SUBTARGET_PROLOGUE): Likewise. + * config/i960/i960.c (i960_output_function_prologue): Likewise. + * config/ia64/ia64.c (ia64_compute_frame_size): Likewise. + * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Likewise. + (m32r_expand_prologue): Likewise. + * config/m88k/m88k.c (m88k_layout_frame): Likewise. + (m88k_expand_prologue): Likewise. + * config/m88k/m88k.h (ADJUST_INSN_LENGTH): Likewise. + * config/mips/mips.c (compute_frame_size): Likewise. + (mips_expand_prologue): Likewise. + (mips_can_use_return_insn): Likewise. + * config/pa/elf.h (ASM_FILE_START): Likewise. + * config/pa/pa-linux.h (ASM_FILE_START): Likewise. + * config/pa/pa64-hpux.h (ASM_FILE_START): Likewise. + * config/pa/som.h (ASM_FILE_START): Likewise. + * config/romp/romp.c (romp_using_r14): Likewise. + * config/rs6000/rs6000.c (first_reg_to_save): Likewise. + (rs6000_stack_info): Likewise. + * config/rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * config/rs6000/xcoff.h (ASM_FILE_START): Likewise. + * config/v850/v850.c (compute_register_save_size): Likewise. + +2002-01-03 Jakub Jelinek + + * simplify-rtx.c (simplify_binary_operation) [DIV]: If + gen_lowpart_common fails, use gen_lowpart_SUBREG. + +2002-01-03 Turly O'Connor + + * darwin.c (machopic_output_possible_stub_label): Don't generate + stub routines for pseudo-stubs which we've just defined. + +2002-01-03 Kazu Hirata + + * builtins.c: Fix formatting. + * c-typeck.c: Likewise. + * combine.c: Likewise. + * expr.c: Likewise. + * loop.c: Likewise. + +2002-01-03 Andreas Schwab + + * cppfiles.c (_cpp_pop_file_buffer): Change return type to bool + and return true if _cpp_push_next_buffer pushed a new include + file. + * cpplib.c (_cpp_pop_buffer): Only call obstack_free if + _cpp_pop_file_buffer did not push a new file. + * cpphash.h (_cpp_pop_file_buffer): Update declaration. + +2002-01-02 Eric Christopher + + * final.c (final_scan_insn): Change 0 -> NULL_RTX in + FIND_REG_INC_NOTE call. Update copyright. + * loop.c (canonicalize_condition): Ditto. + * reorg.c (delete_scheduled_jump): Ditto. + +2002-01-03 Kazu Hirata + + * gcse.c: Fix formatting. + +2002-01-03 Graham Stott + + * mkconfig.sh: Output to config.h, hconfig.h and tconfig.h + forward defs for struct tags rtx_def, union_tree, rtvec_def + also output corresponding typedefs for rtx, tree, and rtvec. + + * system.h: Move forward defs for struct tags rtx_def, union_tree, + rtvec_def along with corresponding typedefs for rtx, tree, and + rtvec to config.h, hconfig.h, tconfig.h. + +2002-01-03 Graham Stott + + * tree.h: Update copyright date. + (IS_EXPR_CODE_CLASS): Add parenthesis. + (TREE_SET_CODE): Add whitespace. + (TREE_CHECK): Add parenthesis. + (TREE_CLASS_CODE): Add parenthesis and wrap long line. + (CST_OR_CONSTRUCTOR_CHECK): + (EXPR_CHECK): Add parenthis, whitespace and wrap line. + (TREE_SYMBOL_REFERENCED): Whitespace. + (INT_CST_LT): Likewise. + (INT_CST_LT_UNSIGNED): Likewise. + (tree_real_cst): Unwrap comment. + (tree_string): Likewise. + (tree_complex): Likewise. + (IDENTIFIER_POINTER): correct cast. + (SAVE_EXPR_CONTEXT): Whitespace. + (EXPR_WFL_FILENAME_NODE): Likewise. + (EXPR_WFL_FILENAME): Remove parenthesis. + (DECL_ORIGIN): Add parenthesis. + (DECL_FROM_INLINE): Use NULL_TREE. + (build_int_2): Whitespace. + (build_type_variant): Add parenthesis. + + * gcc/jcf-parse.c: Update copyright date. + (yyparse): Constify resource_filename. + +2002-01-03 Graham Stott + + * rtl.h: Update copyright date. + (RTL_CHECK1): Wrap long line. + (RTL_CHECK2): Likewise. + (RTL_CHECKC1): Wrap long line and whitespace. + (RTL_CHECKC2): Likewise. + (XWINT): Whitespace. + (XINT): Likewise. + (XSTR): Likewise. + (XEXP): Likewise. + (XVEC): Likewise. + (XMODE): Likewise. + (XBITMAP): Likewise. + (XTREE): Likewise. + (XBBDEF): Likewise. + (XTMPL): Likewise. + (X0WINT): Likewise. + (X0INT):Likewise. + (X0UINT): Likewise. + (X0STR): Likewise. + (X0EXP): Likewise. + (X0VEC): Likewise. + (X0MODE): Likewise. + (X0BITMAP): Likewise. + (X0TREE): Likewise. + (X0BBDEF): Likewise. + (X0ADVFLAGS): Likewise. + (X0CSELIB): Likewise. + (X0MEMATTR): Likewise. + (XCWINT): Likewise. + (XCINT): Likewise. + (XCUINT): Likewise. + (XCSTR): Likewise. + (XCEXP): Likewise. + (XCVEC): Likewise. + (XCMODE): Likewise. + (XCBITMAP): Likewise. + (XCTREE): Likewise. + (XCBBDEF): Likewise. + (XCADVFLAGS): Likewise. + (XCCSELIB): Likewise. + (XC2EXP): Likewise. + (INSN_UID): Likewise. + (PREV_INSN): Likewise. + (PATTERN): Likewise. + (INSN_CODE): Likewise. + (PUT_REG_NOTE_KIND): Likewise. + (CODE_LABEL_NUMBER): Likewise. + (NOTE_SOURCE_FILE): Likewise. + (NOTE_BLOCK): Likewise. + (NOTE_EH_HANDLER): Likewise. + (NOTE_RANGE_INFO): Likewise. + (NOTE_LIVE_INFO): Likewise. + (NOTE_BASIC_BLOCK): Likewise. + (NOTE_EXPECTED_VALUE): Likewise. + (NOTE_LINE_NUMBER): Likewise. + (LABEL_NAME): Likewise. + (LABEL_NUSES): Likewise. + (LABEL_ALTERNATE_NAME): Likewise. + (ADDRESSOF_DECL): Likewise. + (JUMP_LABEL): Likewise. + (LABEL_NEXTREF): Likewise. + (REGNO): Likewise. + (ORIGINAL_REGNO: Likewise. + (HARD_REGISTER_NUM_P): Add parenthesis. + (SUBREG_REG): Whitespace. + (SUBREG_BYTE): Likewise. + (ASM_OPERANDS_TEMPLATE): Remove parenthesis. + (ASM_OPERANDS_OUTPUT_CONSTRAINT): Likewise. + (ASM_OPERANDS_OUTPUT_IDX): Likewise. + (ASM_OPERANDS_INPUT_VEC): Likewise. + (ASM_OPERANDS_INPUT_CONSTRAINT_VEC): Likewise. + (ASM_OPERANDS_INPUT): Likewise. + (ASM_OPERANDS_INPUT_LENGTH): Likewise. + (ASM_OPERANDS_INPUT_CONSTRAINT_EXP): Likewise. + (ASM_OPERANDS_INPUT_CONSTRAINT): Likewise. + (ASM_OPERANDS_INPUT_MODE): Likewise. + (ASM_OPERANDS_SOURCE_FILE): Likewise. + (ASM_OPERANDS_SOURCE_LINE): Likewise. + (MEM_SET_IN_STRUCT_P): Minor reformat. + (TRAP_CONDITION): Whitespace. + (TRAP_CODE): Likewise. + (COND_EXEC_TEST): Likewise. + (COND_EXEC_CODE): Likewise. + (FIND_REG_INC_NOTE): Uppercase macro args and add parenthesis. + (PHI_NODE_P): Add parenthesis. + (plus_constant): Whitespace and add parenthesis. + +2002-01-03 Kazu Hirata + + * config/avr/avr.c: Fix comment typos. + * config/c4x/c4x.md: Likewise. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/dsp16xx/dsp16xx.md: Likewise. + * config/i386/i386.md: Likewise. + * config/ia64/ia64.c: Likewise. + * config/m32r/m32r.h: Likewise. + * config/m68hc11/m68hc11.md: Likewise. + * config/mmix/mmix.c: Likewise. + * config/mn10200/mn10200.c: Likewise. + * config/romp/romp.c: Likewise. + * config/sh/sh.c: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/stormy16/stormy16.md: Likewise. + +2002-01-03 Graham Stott + + * loop.h: Update copyright date. + (LOOP_MOVABLES): Fix typo. + (LOOP_REGS): Likewise. + (LOOP_IVS): Likewise. + +2002-01-03 Graham Stott + + * cppinit.c: Update copyright date. + Don't include output.h + * Makefile.in: Update copyright date. + Update dependency. + +2002-01-02 Craig Rodrigues + + PR c/5226 + * invoke.texi (-mthreads): Remove from documented RS/6000 options. + (-pthread) Add to RS/6000 options. + +2002-01-02 Kazu Hirata + + * except.c: Fix comment typos. + * loop.c: Likewise. + * varasm.c: Likewise. + * doc/tm.texi: Fix a typo. + +2002-01-02 Jakub Jelinek + + * c-typeck.c (output_init_element): Allow initializing static storage + duration objects with compound literals. + +2002-01-02 Richard Henderson + + * objc/objc-act.c (hack_method_prototype): Clear current_function_decl + after abusing it. + +2002-01-02 Kaveh R. Ghazi + + * gcc.c (default_compilers): Const-ify. + * mips-tdump.c (stab_names): Likewise. + * mips-tfile.c (map_coff_types, map_coff_storage, + map_coff_sym_type, map_coff_derived_type, stabs_symbol, + pseudo_ops_t, pseudo_ops): Likewise. + * protoize.c (default_include): Likewise + + * real.c (GET_REAL, PUT_REAL): Don't cast away const-ness. + (ezero, ehalf, eone, etwo, e32, elog2, esqrt2, epi): Const-ify. + Add array size in declaration. + (endian, emov, eisneg, eisinf, eisnan, eiisnan, eiisneg, emovi, + emovo, emovz, eiisinf, ecmpm, eaddm, esubm, m16m, edivm, emulm, + esub, eadd, eadd1, ediv, emul, e53toe, e64toe, e113toe, e24toe, + etoe113, etoe64, etoe53, etoe24, ecmp, eround, ltoe, ultoe, + eifrac, euifrac, e24toasc, e53toasc, e64toasc, e113toasc, etoasc, + efloor, efrexp, eldexp, eremain, dectoe, etodec, ibmtoe, etoibm, + c4xtoe, etoc4x, uditoe, ditoe, etoudi, etodi, esqrt, etens, + emtens, make_nan): Const-ify. + (TFbignan, TFlittlenan, XFbignan, XFlittlenan, DFbignan, + DFlittlenan, SFbignan, SFlittlenan): Make static and const-ify. + +2002-01-02 Joseph S. Myers + + * config.gcc (ia64-*-*): Set extra_headers. + (alpha*-dec-osf*): Likewise. Don't use alpha/t-osf. + * config/alpha/t-osf: Remove. + * config/ia64/t-ia64 (EXTRA_HEADERS): Remove. + +2002-01-02 David Edelsohn + + * config/rs6000/t-aix43: Revert previous change. + +2002-01-02 Jason Merrill + + * c-decl.c (c_expand_body): Call outlining_inline_function when + emitting an inline function out of line. + +2002-01-02 Richard Henderson + + * dwarf2out.c (limbo_die_node): Add created_for member. + (new_die): New argument created_for. Update all callers. + (mark_limbo_die_list): New. + (dwarf2out_init): Register limbo_die_list as a root. + (dwarf2out_finish): Force insert limbo dies into their function + context. + +2002-01-02 Nathan Sidwell + + PR c++/5089 + * doc/invoke.texi (-Wold-style-cast): Only warn about non-void casts. + +2002-01-02 Kazu Hirata + + * config/h8300/fixunssfsi.c: Update copyright. + Fix comment typos. + Fix formatting. + * config/h8300/h8300.c: Update copyright. + Eliminate warnings. + +2002-01-02 Kazu Hirata + + * config/romp/romp.c: Fix comment formatting. + * config/romp/romp.h: Likewise. + * config/romp/romp.md: Likewise. + * config/s390/s390.c: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + +2002-01-02 Alexandre Oliva + + * c-common.h (genrtl_expr_stmt_value): Declare. + * c-semantics.c (genrtl_goto_stmt): Redirect to... + (genrtl_goto_stmt_value): ... this new function. Pass new + argument down to expand_expr_stmt_value, taking + TREE_ADDRESSABLE into account. + * c-common.c (c_expand_expr): Mark the last EXPR_STMT of a + STMT_EXPR as addressable, i.e., one whose result we want. + * expr.c (expand_expr): Don't save expression statement value + of labeled_blocks or loop_exprs. + * stmt.c (expand_expr_stmt): Redirect to... + (expand_expr_stmt_value): ... this new function. Use new + argument to tell whether to save expression value. + (expand_end_stmt_expr): Reset last_expr_type and + last_expr_value if we don't have either. + * tree-inline.c (declare_return_variable): Mark its use + statement as addressable. + * tree.h: Document new use of TREE_ADDRESSABLE. + (expand_expr_stmt_value): Declare. + +2002-01-01 Tom Rix + + * config/rs6000/rs6000.c (rs6000_emit_set_long_const): Fix for use by + rs6000_emit_allocate_stack. + +2002-01-01 Joseph S. Myers + + * configure.in: Prepend ${srcdir}/config/${cpu_type}/ instead of + ${srcdir}/ginclude/ to every entry in extra_headers. + * configure: Regenerate. + * ginclude/math-3300.h: Rename to config/m68k/math-3300.h. + * ginclude/math-68881.h: Rename to config/m68k/math-68881.h. + * ginclude/ppc-asm.h: Rename to config/rs6000/ppc-asm.h. + * ginclude/proto.h: Rename to config/convex/proto.h. + +Tue Jan 1 17:12:56 2002 Richard Kenner + + * attribs.c (handle_vector_size_attribute): Use host_integerp + and tree_int_cst; remove warnings. + * caller-save.c (insert_restore): Add cast to get rid of warning. + (insert_save): Likewise. + * emit-rtl.c (adjust_address_1, offset_address): Likewise. + * regmove.c (find_matches): Add temporary var to kill a warning. + +2002-01-01 Douglas B Rupp + + * config/alpha/vms.h (DWARF2_UNWIND_INFO, EH_RETURN_HANDLER_RTX, + LINK_EH_SPEC, MD_FALLBACK_FRAME_STATE_FOR): Define. + * config/alpha/t-vms (EXTRA_PARTS): Add vms-dwarf2eh.o + (vms-dwarf2eh.o): Add Makefile rule. + * config/alpha/vms-ld.c (main): Handle vms-dwarf2eh.o. + * config/alpha/vms-dwarf2eh.asm: New file. + + * gcc.c (delete_if_ordinary): Delete all versions. + +2002-01-01 Hans-Peter Nilsson + + * config/mmix/mmix.md: Update FIXME to not mention + define_constants. + (MMIX_rJ_REGNUM): New define_constants constant. + ("movqi", "movsi", "movdi", "*movdicc_real_foldable", + "*movdicc_real"): Adjust contraints formatting. + ("*bCC_foldable"): Add %+ for P in output format and delete FIXME + for branch prediction. + ("*bCC", "*bCC_inverted_foldable", "*bCC_inverted"): Add %+ in + output template. + ("*call_real", "*call_value_real", "nonlocal_goto_receiver", + "*nonlocal_goto_receiver_expanded"): Use MMIX_rJ_REGNUM instead of + number. Delete related FIXMEs. + * config/mmix/mmix.h (MMIX_INCOMING_RETURN_ADDRESS_REGNUM): Change + from number to MMIX_rJ_REGNUM. + (TARGET_MASK_BRANCH_PREDICT): New. + (TARGET_DEFAULT): Change to TARGET_MASK_BRANCH_PREDICT. + (TARGET_SWITCHES): Update comment. Correct -mno-toplevel-symbols + value. Add -mbranch-predict and -mno-branch-predict. + (TARGET_VERSION): Drop date. + (ADDITIONAL_REGISTER_NAMES): Use MMIX_rJ_REGNUM, not number. + * config/mmix/mmix.c (mmix_encode_section_info): Correct condition + for finding out global symbols. + (mmix_asm_output_labelref): Revert condition for global symbol. + (mmix_print_operand): : Emit P for a likely branch. + (mmix_print_operand_punct_valid_p): A '+' is valid. diff --git a/contrib/gcc/ChangeLog-2003 b/contrib/gcc/ChangeLog-2003 new file mode 100644 index 00000000000..46045a92840 --- /dev/null +++ b/contrib/gcc/ChangeLog-2003 @@ -0,0 +1,37862 @@ +2003-12-31 Jan Hubicka + + PR opt/13473 + * recog.c (validate_replace_rtx_1): Take care for RTL sharing inside + ASM input operands + + PR opt/12617 + * toplev.c (dump_file_index): Reorder ce3 and bbro. + (dump_file): Likewise. + (rest_of_compilation): Likewise. + + PR debug/13367 + * cgraph.c (cgraph_function_possibly_inlined): Even with + flag_really_no_inline we inline always_inline functions. + * cgraphunit.c (cgraph_analyze_function): Clear inlinable flag + for non-always_inline functions when there is flag_really_no_inline. + (cgraph_decide_inlining): Limit work done when not inlining. + (cgraph_decide_inlining_incrementally): Likewise. + (cgraph_optimize_function): Check whether something got inlined. + * c-objc-common.c (c_disregard_inline_limits): Do not always inline + extern inline functions when not inlining. + + * opts.c (decode_options): Disable crossjumping at -O1 + * invoke.texi (-O1): Document change. + +2003-12-31 Richard Kenner + + * print-rtl.c (print_rtx): For hard register, write out register + number and register name instead of calling PRINT_REG. + * defaults.h (PRINT_REG): Deleted. + * config/i386/i386.c (print_reg): Remove handling of CODE of -1. + Move comments here from i386.h. + (print_operand, print_operand_address): Call print_reg directly. + * config/i386/i386.h (PRINT_REG): Deleted. + +2003-12-31 Roger Sayle + + * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define + _INCLUDE_LONGLONG. + +2003-12-31 Zack Weinberg + + * gcc.c (init_spec): Add -lunwind to shared case too if + USE_LIBUNWIND_EXCEPTIONS. + +2003-12-31 Joseph S. Myers + + * doc/include/texinfo.tex: Update to version 2003-12-21.10. + * doc/gcc.texi, doc/gccint.texi: Don't set font for + @def... commands. + * doc/invoke.texi: Don't use empty @opindex. + +2003-12-31 Mark Mitchell + + * c-common.c (c_expand_expr): Remove code to return a value + different from that returned by expand_expr. + * expr.c (store_expr): Use the validity of a target MEM, rather + than checking DECL_RTL (exp), to figure out if a copy is + required. + +2003-12-31 Kazu Hirata + + * config/v850/lib1funcs.asm: Fix comment formatting. + * config/v850/v850.c: Likewise. + * config/v850/v850.h: Likewise. + * config/v850/v850.md: Likewise. + +2003-12-31 Kazu Hirata + + * config/i386/i386.md (*movqi_insv_2): Remove AND in the + set source. + +2003-12-31 Kazuhiro Inaoka + + * config.gcc: Added m32r-linux m32rle-elf and m32le-linux targets. + * doc/invoke.texi: Document -mflush-func, -mflush-trap options. + Also add documentation for -mdebug, -malign-loops, -missue-rate, + and -mbranch-cost options. + * config/m32r/t-linux: New file: m32r-linux support. + * config/m32r/xm-linux.h: Likewise. + * config/m32r/xm-m32r.h: Likewise. + * config/m32r/linux.h: Likewise. + * config/m32r/little.h: New file: Little endian code generation + support. + * config/m32r/m32r-protos.h (m32r_legitimize_pic_address, + m32r_legitimate_pic_operand_p, load_pic_register): Add + prototypes. + * config/m32r/m32r.c (m32r_init): Add options for cache-flush. + (addr24_operand): Changes for PIC code generation. + * config/m32r/m32r.h (LABEL_ALIGN): Define to calculate PNOP + length at labels. + (ASM_SPEC): Add PIC support. + (FUNCTION_PROFILER): New define. + (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Changed to support + trampoline. + (CONDITIONAL_REGISTER_USAGE, CONSTANT_ADDRESS_P, + LEGITIMIZE_ADDRESS, JUMP_TABLES_IN_TEXT_SECTION, + PIC_OFFSET_TABLE_REGNUM, FINALIZE_PIC, LEGITIMATE_PIC_OPERAND_P, + ASM_OUTPUT_ADDR_DIFF_ELT, CASE_VECTOR_MODE): Define for PIC. + (move_src_operand, m32r_compute_frame_size, m32r_expand_prologue, + m32r_finalize_pic): Changes for PIC and profile support. + (global_offset_table, load_pic_register, m32r_legitimate_pic_operand_p, + m32r_legitimize_pic_address): Add for PIC support. + (m32r_file_start): Changed for little-endian-target. + * config/m32r/m32r.md (mvqi, movhi, movsi, movdi, movsf, movdf, + tablejump, tablejump_insn, call, call_value, call_value_via_label): + Changes for PIC. + (pic_load_addr, get_pc, builtin_setjmp_receiver): Added for PIC. + (flush_icache): Changes for cache-flush trap. + +2003-12-30 Kazu Hirata + + * config/i386/i386.h: Remove an unnecessary #undef. + +2003-12-30 Roger Sayle + + * cppfiles.c (pch_open_file): Minor tweak to work-around native + HPPA compiler bug. + +2003-12-30 Kazu Hirata + + * config/rs6000/aix.h: Fix comment formatting. + * config/rs6000/rs6000-modes.def: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + +2003-12-30 Kazu Hirata + + * config/i386/i386-protos.h: Remove prototype for + const_int_1_operand. + * config/i386/i386.c (const_int_1_operand): Remove. + * config/i386/i386.h (PREDICATE_CODES): Remove + const_int_1_operand. + * config/i386/i386.md: Replace all uses of const_int_1_operand + with const1_operand. + * config/i386/pentium.md: Likewise. + +2003-12-30 Geoffrey Keating + + * doc/tm.texi (PREFERRED_RELOAD_CLASS): Describe use of NO_REGS + with constants. + +2003-12-30 Mark Mitchell + + * stor-layout.c (layout_decl): Turn bitfields into ordinary + fields, even if they are the first field in a structure. + +2003-12-30 Roger Sayle + + * fold-const.c (fold) : Don't require strict type + equality, instead just prevent replacing a COND_EXPR of non-void + type by one of its operands of void type. + +2003-12-30 Andreas Schwab + + * doc/c-tree.texi: Fix @item vs. @itemx. + * doc/cpp.texi: Likewise. + * doc/install.texi: Likewise. + * doc/invoke.texi: Likewise. + +2003-12-30 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Fix typo in previous + change. + +2003-12-30 Jan Hubicka + + PR target/11936 + * i386.h (CLASS_LIKELY_SPILLED_P): Return true for + FP_TOP_REG/FP_SECOND_REG. + +2003-12-30 Steven Bosscher + + Backport from tree-ssa (relevant changes only): + 2003-12-18 Zdenek Dvorak + + * et-forest.h (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons): Declarations removed. + (struct et_node): New. + (et_new_tree, et_free_tree, et_set_father, et_split, et_nca, + et_below): Declare. + * et-forest.c (struct et_forest_occurrence, struct et_forest, + struct et_forest_node): Removed. + (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons, splay, remove_all_occurrences, + find_leftmost_node, find_rightmost_node, calculate_value): Removed. + (struct et_occ): New. + (et_nodes, et_occurences): New. + (set_depth, set_depth_add, set_prev, set_next, et_recomp_min, + et_check_occ_sanity, et_check_sanity, et_check_tree_sanity, + record_path_before_1, record_path_before, check_path_after_1, + check_path_after, et_splay, et_new_occ, et_new_tree, + et_free_tree, et_set_father, et_split, et_nca, et_below): New. + * basic-block.h (struct basic_block_def): New field dom. + (struct dominance_info): Type removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators): Declarations + changed. + (enum dom_state): New. + (dom_computed): New variable. + (first_dom_son, next_dom_son): Declare. + * dominance.c (struct dominance_info): Removed. + (BB_NODE, SET_BB_NODE): Removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators, + debug_dominance_info): Work over new datastructure. Access + dominance datastructures through CFG. + (assign_dfs_numbers, compute_dom_fast_query, first_dom_son, + next_dom_son): New. + * bt-load.c (dom): Variable removed. + (augment_live_range, combine_btr_defs, migrate_btr_def, + migrate_btr_defs, branch_target_load_optimize): Updated for the + new interface for dominance information. + * cfg.c {exit_entry_blocks): Update initializer. + * cfglayout.c (copy_bbs): Removed loops argument. Updated for + the new interface for dominance information. + * cfglayout.h (copy_bbs): Declaration changed. + * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump, + flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated + for the new interface for dominance information. + (flow_loop_scan): Loops argument removed. + (flow_loops_free): Don't release dominators. + * cfgloop.h (struct cfg): Dom field removed. + (flow_loop_scan, loop_split_edge_with, simple_loop_p, + just_once_each_iteration_p, split_loop_bb): Declaration changed. + * cfgloopanal.c (simple_loop_exit_p, simple_increment, + just_once_each_iteration_p, simple_loop_p): Remove loops argument. + Updated for the new interface for dominance information. + * cfgloopmanip.c (remove_bbs, find_path, create_preheader, + split_loop_bb, loopify, duplicate_loop_to_header_edge, + force_single_succ_latches, loop_split_edge_with): Ditto. + * gcse.c (dominators): Variable removed. + (free_code_hoist_mem, compute_code_hoist_data, hoist_code): + Updated for the new interface for dominance information. + * ifcvt.c (post_dominators): Variable removed. + (mark_loop_exit_edges, merge_if_block, find_if_header, + find_cond_trap, find_if_case_1, find_if_case_2, if_convert): + Updated for the new interface for dominance information. + * loop-init.c (rtl_loop_optimizer_init, + rtl_loop_optimizer_finalize): Ditto. + * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling, + decide_peel_completely, decide_unroll_stupid, + decide_unroll_constant_iterations, + decide_unroll_runtime_iterations): Loops argument removed. + Updated for the new interface for dominance information. + (unroll_and_peel_loops, peel_loops_completely, + unroll_loop_runtime_iterations): Updated for the new interface for + dominance information. + * loop-unswitch.c (may_unswitch_on_p, unswitch_loops, + unswitch_single_loop, unswitch_loop): Updated for the new + interface for dominance information. + * predict.c (process_note_predictions, process_note_prediction, + estimate_probability, note_prediction_to_br_prob): Ditto. + * sched-rgn.c (find_rgns, init_regions): Ditto. + * toplev.c (rest_of_handle_branch_prob): Free the dominators. + +2003-12-30 Jan Hubicka + + PR target/13456 + * i386.md (allocate_stack_worker): Use different pattern for pre and + post reload expansion. + (allocate_stack_worker_1, allocate_stack_worker_rex64): Use + match_scratch. + (allocate_stack_worder_1_postreload, + allocate_stack_worker_rex64_postreload): New. + +2003-12-29 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Add pretend args size + to the virtual incoming args pointer for downward stacks. + +2003-12-29 Roger Sayle + + PR fortran/12632 + * fold-const.c (fold) : Don't fold a constant condition, + if the type of the selected branch doesn't match its' parent. + +2003-12-29 Jan Hubicka + + * coverage.c (read_counts_file): Better error messages; cause corrupted + profiles to produce hard errors, not just warnings + (get_coverage_counts): Similarly. + + * toplev.c (rest_of_handle_loop_optimize): Enable LOOP_AUTO_UNROLL. + +2003-12-29 Phil Edwards + + * doc/cppopts.texi: Use of -idirafter, -iprefix, -iwithprefix, and + -iwithprefixbefore is not discouraged. + +2003-12-28 Mostafa Hagog + + * sbitmap.c (sbitmap_union_of_diff_cg, sbitmap_a_and_b_cg, + sbitmap_a_xor_b_cg): Accumulate "changed" properly. + (sbitmap_not): Zero all bits past n_bit. + +2003-12-27 Zdenek Dvorak + + PR opt/13159 + * cfgloopanal.c (mark_irreducible_loops): Fix the strongly connected + components detection. + * loop-unswitch.c (unswitch_loop): Preserve simple preheaders. + +2003-12-27 Bernardo Innocenti + + * config/m68k/uclinux.h (LIB_SPEC): Add elf2flt magic required for + correct linking of executables using id-based shared libraries. + +2003-12-27 Kazu Hirata + + * config/i386/i386-interix.h: Remove uses of "register" + specifier in declarations of arguments and local variables. + * config/i386/i386.c: Likewise. + * config/i386/i386elf.h: Likewise. + * config/i386/ptx4-i.h: Likewise. + * config/i386/sysv4.h: Likewise. + +2003-12-26 Fariborz Jahanian + Geoffrey Keating + David Edelsohn + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Do not + restrict DFmode and TFmode to word alignment. + * config/rs6000/rs6000.md (movdf_hardfloat64): Use 'o' constraint + for ld/std and order before mr. + +2003-12-26 Andrew Pinski + + * config/darwin.h (LINK_COMMAND_SPEC): Arrange + -fprofile-generate to imply -lgcov. + +2003-12-26 Kazu Hirata + + * config/h8300/h8300.md (ldm_h8300s_2_normal): Use HImode for + addresses. + +2003-12-25 Kazu Hirata + + * config/m32r/m32r.md: Remove a constraint from a splitter. + +2003-12-25 Andrew Pinski + + PR C++/13429, C/11944 + * c-common.c (c_build_qualified_type): Return early when type is + error_mark_node. + (c_apply_type_quals_to_decl): Likewise. + +2003-12-25 Kazu Hirata + + * config/alpha/alpha-modes.def: Fix comment formatting. + * config/alpha/alpha.c: Likewise. + * config/alpha/alpha.h: Likewise. + * config/alpha/elf.h: Likewise. + * config/alpha/lib1funcs.asm: Likewise. + * config/alpha/openbsd.h: Likewise. + * config/alpha/vms-cc.c: Likewise. + * config/alpha/vms-crt0-64.c: Likewise. + * config/alpha/vms-crt0.c: Likewise. + * config/alpha/vms-ld.c: Likewise. + * config/alpha/vms-psxcrt0-64.c: Likewise. + * config/alpha/vms-psxcrt0.c: Likewise. + * config/alpha/vms.h: Likewise. + * config/arc/arc.c: Likewise. + * config/arm/aof.h: Likewise. + * config/arm/arm-modes.def: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/linux-elf.h: Likewise. + * config/arm/vxworks.h: Likewise. + * config/avr/avr.c: Likewise. + * config/avr/avr.h: Likewise. + +2003-12-24 Kazu Hirata + + * config/xtensa/elf.h: Fix comment formatting. + * config/xtensa/xtensa-protos.h: Likewise. + * config/xtensa/xtensa.c: Likewise. + * config/xtensa/xtensa.h: Likewise. + +2003-12-24 Kazu Hirata + + * config/avr/avr.c: Fix comment formatting. + * config/avr/avr.md: Likewise. + +2003-12-24 Kazu Hirata + + PR target/12721. + * config/avr/avr.c: Include ggc.h. + (tmp_reg_rtx): Declare with GTY. + (zero_reg_rtx): Likewise. + (ldi_reg_rtx): Remove. + (avr_override_options): Initialize zero_reg_rtx and + ldi_reg_rtx. + (avr_init): Remove. + Include gt-avr.h. + * config/avr/avr.h (LDI_REG_REGNO): Remove. + Remove externs for tmp_reg_rtx, zero_reg_rtx, and ldi_reg_rtx. + +2003-12-24 David Edelsohn + + * doc/md.texi: Document PowerPC vector register constraint letter. + +2003-12-23 Mark Mitchell + + * calls.c (expand_call): Recognize calls to "sqrt" and create + corresponding notes. + +2003-12-23 Kaveh R. Ghazi + + * config/mips/mips.c (override_options): Use `inform' instead + of `warning' for -g -mabi=32 and native assembler. + + * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS): + Don't pass -Wno-error. + +2003-12-23 David Edelsohn + + * function.c (assign_parms): Update max_parm_reg and + parm_reg_stack_loc when adding new parm reg. + +2003-12-23 Kazu Hirata + + * config/ns32k/ns32k.c: Convert to ISO-C. + +2003-12-23 Zack Weinberg + + * config/ia64/ia64.c (ia64_va_arg): Pass pointer for + variable-sized type through convert_memory_address. + (ia64_in_small_data_p): Always return false for FUNCTION_DECLs. + +2003-12-23 Jan Hubicka + + * common.opt (fprofile-generate,fprofile-use): Add. + * gcc.c (LINK_COMMAND_SPEC): Arrange -fprofile-generate to imply -lgcov + * opts.c (profile_arc_flag_set, flag_profile_values_set, + flag_unroll_loops_set, flag_tracer_set, + flag_value_profile_transformations_set, + flag_peel_loops_set): New static variables. + (common_handle_option): Deal with -fprofile-generate/-fprofile-use + * invoke.texi (-fprofile-generate, -fprofile-use): Describe. + +2003-12-23 Mark Mitchell + + * Makefile.in (OBJS-common): Remove dwarfout.o. + (dwarfout.o): Remove. + * common.opt: Remove -gdwarf, -gdwarf+. + * defaults.h (PREFERRED_DEBUGGING_TYPE): Do not check for + DWARF_DEBUGGING_INFO. + * dwarf2out.c: Fix typo in comment. + * dwarfout.c: Remove. + * opts.c (common_handle_option): Remove OPT_gdwarf, OPT_gdwarf_. + * toplev.c (process_options): Remove check for + DWARF_DEBUGGING_INFO. + * config/elfos.h (DWARF_DEBUGGING_INFO): Do not #define it or + #undef it. + * config/netware.h (DWARF_DEBUGGING_INFO): Likewise. + * config/ptx4.h (DWARF_DEBUGGING_INFO): Likewise. + * config/vxworks.h (DWARF_DEBUGGING_INFO): Likewise. + * config/alpha/unicosmk.h (DWARF_DEBUGGING_INFO): Likewise. + * config/arc/arc.h (DWARF_DEBUGGING_INFO): Likewise. + * config/i386/sco5.h (DWARF_DEBUGGING_INFO): Likewise. + * config/i386/x86-64.h (DWARF_DEBUGGING_INFO): Likewise. + * config/m32r/m32r.h (DWARF_DEBUGGING_INFO): Likewise. + * config/mcore/mcore-elf.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/linux64.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/liteelf.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/sol26-sld.h (DWARF_DEBUGGING_INFO): Likewise. + * config/sparc/sp86x-elf.h (DWARF_DEBUGGING_INFO): Likewise. + * doc/invoke.texi: Do not mention -gdwarf, -gdwarf-1, -gdwarf-1+, + or -gdwarf+. + * doc/tm.texi: Likewise. + + * c-common.c (flag_abi_version): Default to 2. + * c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION + uniformly for versions above 2. + * doc/invoke.texi: Update documentation for -fabi-version. + +2003-12-22 Geoffrey Keating + + * config/rs6000/rs6000.md: Change many instances of '! + TARGET_POWERPC64' to 'TARGET_32BIT' when the pattern being guarded + was guarded only because it changed CR0 or the carry bit in XER. + +2003-12-23 Eric Botcazou + + PR optimization/13394 + * toplev.c (rest_of_compilation): Move call to + check_function_return_warnings right after the sibcall + optimization pass. + +2003-12-23 Eric Botcazou + + PR c/13382 + * c-typeck.c (convert_for_assignment): When converting from + integral type to pointer type, always call convert. + +2003-12-22 Mark Mitchell + + * doc/invoke.texi: Deprecate -fwritable-strings. + + * c-common.c (flag_external_templates): Remove. + (flag_alt_external_templates): Likewise. + * c-common.h (flag_external_templates): Remove. + (flag_alt_external_templates): Likewise. + * c-opts.c (c_common_handle_option): Unsupport + -falt-external-templates and -ftemplates. + * doc/invoke.texi: Remove mention of -fexternal-templates and + -falt-external-templates. + +2003-12-22 Andrew Pinski + + PR target/13466 + * config.gcc (powerpc-*-darwin): Remove overridden value of need_64bit_hwint. + + * emit-rtl.c (copy_rtx_if_shared): Add comment about its use of + copy_rtx_if_shared_1. + (copy_rtx_if_shared_1): Add comment about what the function does. + + * c-decl.c (finish_function): Change order of checks. + (c_expand_body): Likewise. + +2003-12-22 Fariborz Jahanian + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Correct + check for the legitimate offset when memory of + DImode/DFmode/TFmode/TImode mode is being referenced and target + is TARGET_POWERPC64. + +2003-12-22 Dale Johannesen + + * reload1.c: Add reg_reloaded_call_part_clobbered. + (reload_as_needed): Use it. + (forget_old_reloads_1): Ditto. + (emit_reload_insns): Ditto. + +2003-12-22 Dale Johannesen + + PR optimization/12828 + * loop.c: Add find_regs_nested to look inside CLOBBER(MEM). + (scan_loop): Call it. + * regclass.c (reg_scan_mark_regs): Look inside CLOBBER(MEM). + +2003-12-22 Andrew Pinski + + PR c/9163 + * c-decl.c (poplevel): Only set DECL_INITIAL of a current function + if it is non-null. + (finish_function): Check for error_mark_node or null on DECL_RESULT and + DECL_RESULT of fndecl. + (c_expand_body): Only expand when DECL_INITIAL of fndecl is not + error_mark_node and not null. + +2003-12-21 Dan Nicolaescu + + * rtl.h (dump_rtx_statistics): Declare it. + * rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts, + rtx_alloc_sizes): New static vars. + (rtx_alloc, rtvec_alloc): Update them. + (dump_rtx_statistics): New function. + * toplev.c (finalize): Call it. + * ggc-page.c (struct globals): Fix comments. Add new member + total_allocated_per_order. + (ggc_alloc): Keep track of the total allocated memory. + (ggc_print_statistics): Clarify message. Print total allocated + memory stats. + * configure.in (gather-detailed-mem-stats): New flag. + * configure: Regenerate. + * config.in: Regenerate. + * doc/install.texi (Configuration): Document + --enable-gather-detailed-mem-stats. + +2003-12-22 Kazu Hirata + + * system.h (CONVERT_HARD_REGISTER_TO_SSA_P): Poison. + * config/i386/i386.h (CONVERT_HARD_REGISTER_TO_SSA_P): Remove. + +2003-12-21 Roger Sayle + + * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define _ILP32 + when compiling in ILP32 mode. + +2003-12-21 Andrew Pinski + + * config/rs6000/rs6000.c (rs6000_tls_referenced_p): Return early if + TARGET_HAVE_TLS is false. + +2003-12-21 Kazu Hirata + + * config/ip2k/ip2k-protos.h: Remove the prototype for + asm_output_section_name. + * config/ip2k/ip2k.c (asm_output_section_name): Remove. + +2003-12-21 Kazu Hirata + + * alias.c: Fix comment formatting. + * alloc-pool.c: Likewise. + * bitmap.c: Likewise. + * bitmap.h: Likewise. + * bt-load.c: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * c-opts.c: Likewise. + * c-pretty-print.c: Likewise. + * caller-save.c: Likewise. + * cfghooks.h: Likewise. + * cgraph.c: Likewise. + * collect2.c: Likewise. + * cppfiles.c: Likewise. + * cpplib.h: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * final.c: Likewise. + * function.c: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * genemit.c: Likewise. + * ggc.h: Likewise. + * haifa-sched.c: Likewise. + * ifcvt.c: Likewise. + * libgcc2.h: Likewise. + * loop.c: Likewise. + * predict.h: Likewise. + * unwind-libunwind.c: Likewise. + * varasm.c: Likewise. + +2003-12-21 Kazu Hirata + + * config/mn10300/mn10300.c (mn10300_encode_section_info): Fix + a warning. + +2003-12-21 Kazu Hirata + + * config/arm/arm.c: Convert to ISO-C. + * config/avr/avr.h: Likewise. + * config/fr30/fr30.c: Likewise. + * config/ip2k/ip2k.c: Likewise. + * config/mn10300/mn10300.c: Likewise. + +2003-12-20 Andrew Pinski + Matt Thomas + + PR target/12749 + * config/i386/i386.c (print_operand): Print only the first + 8 characters of the float in hex. + +2003-12-20 John David Anglin + + * pa.h (TRAMPOLINE_TEMPLATE): Shorten sequence when generating PA + 2.0 code. + (TRAMPOLINE_CODE_SIZE, MIN_CACHELINE_SIZE): New defines. + (INITIALIZE_TRAMPOLINE): Rework to pass line length, and aligned start + and end addresses to I and D cache instruction patterns. + * pa.md (anddi3, iordi3): Change predicates of operands 1 and 2 to + and_operand and ior_operand, respectively. When generating 64-bit + code, only one operand needs to be a register operand. + (xordi3): Change predicates of operands 1 and 2 to register_operand. + (one_cmpldi2): Change predicate of operand 1 to register_operand. + (dcacheflush, icacheflush): Revise to flush an arbitrary number of + cache lines. + +2003-12-20 Josef Zlomek + + PR optimization/13430, PR optimization/12322 + * bb-reorder.c (copy_bb_p): Do not allow block with many successors to + be copied. + (find_traces_1_round): Surround check for fake edges by + #ifdef ENABLE_CHECKING #endif. + +2003-12-20 Eric Botcazou + + PR other/7956 + * genmultilib: New variable disable_multilib. Set it to 'yes' + if enable_multilib was set to 'no'. Emit DISABLE_MULTILIB + if disable_multilib was set to 'yes'. + * gcc.c: Include multilib.h before tm.h. + * config/sparc/sol2-bi.h (LINK_ARCH_SPEC): Emit an error + message for multiarch options if DISABLE_MULTILIB is set. + * config/sparc/sol2-gld-bi.h (LINK_ARCH_SPEC): Likewise. + +2003-12-20 Eric Botcazou + + PR c/12085 + * c-typeck.c (build_function_call): Issue a warning if a + function is called through an incompatible prototype and + replace the call by a trap in this case. + +2003-12-19 James E Wilson + + * install.texi (ia64-*-linux): Document minimum libunwind version + number. + +2003-12-19 Per Bothner + + * langhooks.c (lhd_print_error_function): Fix for PR c/13110. + Don't do pp_newline; it causes an extra blank line. + * pretty-print.c (pp_base_flush): Clear pp_needs_newline. + +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. + Add case for ASM_OPERANDS. + * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered + registers. + +2003-12-19 Kazu Hirata + + * expr.c (check_max_integer_computation_mode): Remove. + * dojump.c (do_jump): Don't use MAX_INTEGER_COMPUTATION_MODE. + * fold-const.c (fold): Likewise. + * system.h (MAX_INTEGER_COMPUTATION_MODE): Poison. + * doc/tm.texi (MAX_INTEGER_COMPUTATION_MODE): Remove. + +2003-12-19 James E Wilson + + * configure.in: Delete libunwind_has_eh_support test. + * configure: Regenerate. + * config.gcc (ia64*-*-linux*): Delete reference to t-libunwind-no-eh + and libunwind_has_eh_support check. + * config/t-libunwind-no-eh: Delete. + +2003-12-19 Joseph S. Myers + + * c-format.c (print_char_table): Allow 'I' flag on floating point + 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. + +2003-12-19 Kazu Hirata + + * dwarfout.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * gensupport.c: Likewise. + * local-alloc.c: Likewise. + * regclass.c: Likewise. + +2003-12-19 Kelley Cook + + * config.guess: Remove. + +2003-12-19 Jakub Jelinek + + * config/ia64/unwind-ia64.c (ia64_copy_rbs): New function. + (unw_access_gr): Only call ia64_rse_rnat_addr if addr is above + regstk_top. + (uw_frame_state_for): Handle locations inside bundles. + (uw_init_context_1): Initialize context->rnat. + Set context->regstk_top to lowest rbs address which has nat collection + in context->rnat. + (uw_install_context): Fix rnat restoring. + Restore ar.rsc to previous state. + * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR, + MD_HANDLE_UNWABI): Handle unwinding through SA_ONSTACK frames. + +2003-12-19 Jakub Jelinek + + PR c++/13239 + * builtins.c (expand_builtin_expect_jump): Update + TREE_VALUE (arglist) if unsave_expr_now langhook + created a new tree. + +2003-12-19 Richard Earnshaw + + * arm.c (thumb_base_register_rtx_p): Use regno in comparison against + FIRST_PSEUDO_REGISTER. + +2003-12-18 Hartmut Penner + + * gcc/config/rs6000/rs6000.c (USE_ALTIVEC_FOR_ARG_P): Don't check + for SVR4 ABI. + +2003-12-18 Geoffrey Keating + + * config/rs6000/aix.h (OS_MISSING_POWERPC64): Define. + (OS_MISSING_ALTIVEC): Define. + * config/rs6000/darwin.h (ASM_SPEC): Be generous about supplying + -force_cpusubtype_ALL. + * config/rs6000/rs6000.c (rs6000_override_options): Rearrange + CPU information table; now always set all CPU-specific values. + Also, use Altivec and powerpc64 when chip and OS supports them. + +2003-12-18 Geoffrey Keating + + * fixinc/inclhack.def (darwin_macho_dyldh): New. + * fixinc/fixincl.x: Regenerate. + +2003-12-18 Dara Hazeghi + + * version.c (version_string): Renumber as 3.4.0 + * doc/include/gcc-common.texi: Likewise + +2003-12-18 Richard Henderson + + * genrecog.c (print_host_wide_int): New. + (write_switch, write_cond): Use it. + +2003-12-18 Richard Henderson + + * c-decl.c (check_bitfield_type_and_width): Remove enum special + case suppression of pedwarn. + * system.h (ENUM_BITFIELD): Use __extension__. + (CHAR_BITFIELD): Likewise. + +2003-12-18 Ulrich Weigand + Mark Dettinger + + * config/s390/s390.md (UNSPEC_SRST): New constant. + ("strlendi", "strlensi"): New expanders. + ("*strlendi", "*strlensi"): New insns. + +2003-12-18 Mark Mitchell + + * config/sol2.h (LINK_ARCH32_SPEC): Define in terms of ... + (LINK_ARCH32_SPEC_BASE): ... this new macro. + * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC): Define in terms of + ... + (LINK_ARCH64_SPEC_BASE): ... this new macro. + * config/sparc/sol2-gld-bi.h (LINK_ARCH32_SPEC): New macro. + (LINK_ARCH64_SPEC): Likewise. + +2003-12-18 Jason Merrill + + PR middle-end/13234 + * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code + classes. + +2003-12-18 Steven Bosscher + + * Makefile.in (tracer.o, bb-reorder.o): Depend on timevar.h + * toplev.c (rest_of_handle_reorder_blocks, rest_of_handle_tracer): + Don't push and pop TV_REORDER_BLOCKS timevars, do it... + * bb-reorder.c (reorder_basic_blocks): ...here, and... + * tracer.c (tracer): here. + +2003-12-18 Ulrich Weigand + + * loop.c (move_movables): Handle combination of m->consec, + m->move_insn_first, and m->insert_temp all nonzero correctly. + +2003-12-18 Kazu Hirata + + * calls.c (load_register_parameters): Don't use + LOAD_ARGS_REVERSED. + * system.h (LOAD_ARGS_REVERSED): Poison. + * doc/tm.texi (LOAD_ARGS_REVERSED): Remove. + +2003-12-17 Per Bothner + + * emit-rtl.c (set_new_first_and_last_label_num): Remove function. + * rtl.h (set_new_first_and_last_label_num): Remove declaration. + +2003-12-17 Alexandre Oliva + + * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone + scratch insns of the then branch that clobber regs needed by the + else branch. + +2003-12-17 Kazu Hirata + + * calls.c (expand_call): Update comments. + * system.h (PRETEND_OUTGOING_VARARGS_NAMED): Poison. + * targhooks.c: Do not refer to PRETEND_OUTGOING_VARARGS_NAMED. + +2003-12-17 James E Wilson + Roger Sayle + + * Makefile.in (gcse.o): Add $(TREE_H) to dependencies. + * gcse.c: Include tree.h. + (implicit_set_cond_p): New. + (find_implicit_sets): Call it. + +2003-12-17 Santiago Vila + + * config/kfreebsdgnu.h (TARGET_OS_CPP_BUILTINS): Rename from + TARET_OS_CPP_BUILTINS. + +2003-12-16 Kazu Hirata + + * emit-rtl.c: Fix signed/unsigned comparison warnings. + +2003-12-17 Joseph S. Myers + + * predict.c (struct block_info_def, struct edge_info_def): Change + bit-fields of width 1 to unsigned int. + +2003-12-16 Geoffrey Keating + + PR 12480 + * c-pch.c (pch_init): Improve error message when precompiled + header can't be written. + + PR 12606 + * c-pch.c (pch_init): Make a PCH file appear invalid while it's + being written. + (c_common_write_pch): Make it valid once it's done. + +2003-12-17 Ulrich Weigand + + PR target/11992 + * config/s390/s390.md ("*cmpmem_long_64"): Use CLCLE instruction + instead of CLCL. + ("*cmpmem_long_31"): Likewise. + +2003-12-17 Vladimir Makarov + + * config/ia64/ia64.c: Add more comments about insn bundling. + +2003-12-17 Richard Earnshaw + + PR optimization/10592 + * caller-save.c (mark_referenced_regs): Don't short-circuit a reg + or subreg in SET_DEST if it isn't a hard register. + +2003-12-17 David Edelsohn + + * collect2.c (main): Add -fno-profile-arcs -fno-test-coverage + -fno-branch-probabilities to arguments when compiling ctors and + dtors. + +2003-12-17 Eric Botcazou + + * config/sparc/sol2.h: Set SUPPORTS_INIT_PRIORITY to 0. + * config/sparc/sol2-gld.h: Set SUPPORTS_INIT_PRIORITY to 1. + +2003-12-17 Richard Earnshaw + + * arm.c (thumb_base_register_rtx_p): Don't allow virtual registers + as base registers for sub-word operations. + (thumb_legitimate_address_p): Simplify REG+REG test. + +2003-12-17 Segher Boessenkool + + * opts.c (wrap_help): Fix overflow. + +2003-12-17 Fred Fish + + * configure.in: Remove code to examine linker scripts and set + HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES. + * configure, config.in: Regenerate. + +2003-12-16 Mark Mitchell + + PR c++/12218 + * varasm.c (initializer_constant_valid_p): Allow a conversion from + an integral constant to an OFFSET_TYPE. + +2003-12-16 Kazu Hirata + + PR target/11012 + * config/m32r/m32r.c (gen_compare): Call gen_addsi3 instead of + gen_cmp_ne_small_const_insn. + * config/m32r/m32r.md (cmp_ne_small_const_insn): Remove. + +2003-12-17 Neil Booth + Joseph S. Myers + + PR c/3347 + * c-decl.c (enum_decl_context): Remove BITFIELD. + (grokdeclarator): Take bit-field width as an input. + Perform bit-field width validation with + check_bitfield_type_and_width rather than waiting for + finish_struct. + (groktypename, groktypename_in_parm_context, start_decl, + push_parm_decl, grokfield, start_function): Update calls to + grokdeclarator. + (check_bitfield_type_and_width): New function. + (finish_struct): Move bit-field validation to grokdeclarator + and check_bitfield_type_and_width. + +2003-12-16 John David Anglin + + PR bootstrap/13386 + * configure.in (gcc_cv_ld_hidden): Set to yes on hppa64*-*-hpux* when + using HP native linker. + * configure: Rebuilt. + +2003-12-16 Mark Mitchell + + PR c++/13275 + * c-common.h (enum rid): Add RID_OFFSETOF. + * c-parser.in (rid_to_yy): Ignore RID_OFFSETOF. + * ginclude/stddef.h (offsetof): Reimplement for C++, using + __offsetof__. + * doc/extend.texi: Document __offsetof__. + +2003-12-16 Stan Cox + + * config/iq2000/iq2000.h: Formatting. + (MAX_INT_TYPE_SIZE, MAX_INT_TYPE_SIZE, CONST_COSTS, RTX_COSTS) + (ADDRESS_COST, ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL) + (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR, SLOW_ZERO_EXTEND): Remove + * config/iq2000/iq2000.c: Formatting. + (iq2000_rtx_costs): New. + +2003-12-16 Richard Earnshaw + + * arm.md (addsi3_carryin_shift): Add missing register constraints. + +2003-12-16 Loren James Rittle + + * testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to + pass with -pthread on FreeBSD systems. + +2003-12-16 Richard Sandiford + + * config/mips/mips.c (mips_file_end): Only write symbols that have + been referenced at some point. + +2003-12-16 Richard Sandiford + + * config/mips/mips.c: Include langhooks.h + (mips_build_builtin_va_list): Use lang_hooks.types.make_type. + +2003-12-16 Eric Botcazou + + PR optimization/13313 + * combine.c (make_extraction) [REG]: Do not use + gen_lowpart_for_combine when POS is non-zero. + +2003-12-16 Hartmut Penner + + * altivec.h (vec_cmple, vec_all_numeric): Fix typo. + * testsuite/gcc.dg/altivec-10.c: Test for above. + +2003-12-15 David O'Brien + + * Makefile.in (CPPFLAGS): Initialize from configure. + +2003-12-15 Roger Sayle + + PR middle-end/13400 + * ifcvt.c (noce_process_if_block): Disable unconditional write + optimizations if we could introduce a store to trapping memory + that wasn't present previously. + +2003-12-15 Kazu Hirata + + * system.h (DEFAULT_CALLER_SAVES): Poison. + * toplev.c (flag_caller_saves): Always initialize with 0. + * doc/tm.texi (DEFAULT_CALLER_SAVES): Remove. + +2003-12-15 Kazu Hirata + + * flow.c (EXIT_IGNORE_STACK): Move to ... + * defaults.h (EXIT_IGNORE_STACK): ... here. + * dojump.c (clear_pending_stack_adjust): Don't use #ifdef + EXIT_IGNORE_STACK. + * function.c (expand_function_end): Likewise. + * global.c (global_alloc): Likewise. + * ra.c (init_ra): Likewise. + * reload1.c (init_elim_table): Likewise. + * reorg.c (fill_simple_delay_slots): Likewise. + * resource.c (init_resource_info): Likewise. + * doc/tm.texi (EXIT_IGNORE_STACK): Document that the default + is 0. + +2003-12-15 J"orn Rennecke + + * reload.c (reg_overlap_mentioned_for_reload_p): + When looking at a PLUS in X, avoid spuriously returning nonzero + when IN is a REG or another simple PLUS, or a MEM containing one. + + * loop.c (loop_invariant_p): Amend comment about where new registers + might come from. + +2003-12-15 Andreas Jaeger + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Remove + handling of obsolete language CHILL. + +2003-12-15 Waldek Hebisch + + * tree.c (initializer_zerop): Add test for empty set. + * integrate.c (function_cannot_inline_p): Forbid inlining + functions calling `longjmp'. + +2003-12-15 Nathan Sidwell + + PR c++/11773 + * doc/gcov.texi (Gcov and Optimization): Document inline function + behaviour. Fix some file suffixes. + +2003-12-14 David O'Brien + + * config/i386/i386.h (__amd64, __amd64__): Remove duplicates. + +2003-12-14 Mark Mitchell + + * c-common.h (c_parse_error): Declare it. + * c-common.c (c_parse_error): New function. + * c-parse.y (yyerror): Use it. + +2003-12-14 John David Anglin + + PR target/13054 + * pa-protos.h (indexed_memory_operand, borx_reg_operand, + move_dest_operand, move_src_operand): New protypes. + (basereg_operand, move_operand, reg_or_nonsymb_mem_operand): Deleted. + * pa.c (copy_reg_pointer, indexed_memory_operand, move_dest_operand, + move_src_operand): New functions. + (basereg_operand, reg_or_nonsymb_mem_operand, move_operand): Delete. + (reg_or_0_or_nonsymb_mem_operand): Return false for unscaled indexed + address until cse is not expected on targets with non-equivalent + space registers. + (hppa_legitimize_address): Canonicalize unscaled indexed addresses + on targets non-equivalent space registers. + (emit_move_sequence): Break out indexed addresses from destination + operand. Similarly, break out unscaled indexed addresses from + source operand on targets with non-equivalent space registers. Fix + REG_POINTER flag when possible. Mark register pointer when creating + new pointers. + (print_operand): Handle unscaled index addresses. + * pa.h (IS_INDEX_ADDR_P, IS_LO_SUM_DLT_ADDR_P): New macro subroutines + for EXTRA_CONSTRAINT. + (EXTRA_CONSTRAINT): Rework to make more readable. + (MODE_OK_FOR_SCALED_INDEXING_P, MODE_OK_FOR_UNSCALED_INDEXING_P): New + subroutines for GO_IF_LEGITIMATE_ADDRESS. + (GO_IF_LEGITIMATE_ADDRESS): Rework using new subroutines. Allow scaled + and unscaled addresses. Canonicalize unscaled indexed addresses on + targets with non-equivalent space registers. Document issues in + handling indexed address modes on PA-RISC. + (PREDICATE_CODES): Update for new and deleted predicates. + * pa.md (move_dest_operand, move_src_operand, indexed_memory_operand): + Use new predicates in move patterns. + Add peephole2 patterns to optimize floating point stores. Fix + constrain preferencing in move patterns. Delete patterns for handling + unscaled indexed memory loads. Add missing load and store with + base-register modification patterns. Correct SFmode floating point + store pattern. Add missing zero extension loads. + +2003-12-13 Steven Bosscher + + * ggc-zone.c (struct alloc_zone): Don't pre-declare, it already + comes in with ggc.h. Add a new bool field `dead'. + (destroy_ggc_zone): Don't destroy a zone at once. Instead, only + set the `dead' flag for the dead zone. Wrap a sanity check in + ENABLE_CHECKING. + (ggc_collect_1): Always mark and sweep if a zone has the `dead' + flag set. + (ggc_collect): Free dead zones after collecting. + +2003-12-13 Jan Hubicka + + * coverage.c (get_coverage_counts): Use inform instead of warning + about missing profile. + +2003-12-12 Steven Bosscher + + * Makefile.in (opts.o, explow.o): Depend on langhooks.h + +2003-12-12 Geoffrey Keating + + * config.gcc : Don't use fixproto. + : Likewise. + +2003-12-12 Jakub Jelinek + + * config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K. + (MD_FALLBACK_FRAME_STATE_FOR): Set fpsr_loc, br_loc[6] and + br_loc[7]. Update comment. + (MD_HANDLE_UNWABI): Define. + * config/ia64/unwind-ia64.c (struct unw_state_record): Add + unwabi field. + (struct _Unwind_Context): Increase br_loc array size to 8 entries. + (desc_abi): Set unwabi. + (uw_update_reg_address): Allow br up to 7. + (uw_update_context): Invoke MD_HANDLE_UNWABI if defined. + (uw_install_context): Load b1..b5 from correct locations. + Fix insn loading ar.fpsr. + * doc/tm.texi: Document MD_HANDLE_UNWABI. + +2003-12-12 Roger Sayle + + PR optimization/13037 + * loop.c (update_giv_derive): Ignore redundant sets of a biv when + calculating how to derive a giv from a biv. + +2003-12-12 Neil Booth + + PR preprocessor/12935 preprocessor/12952 preprocessor/13046 + * cpplib.c (prepare_directive_trad): Clear skipping only in + #if and #elif directives. + (do_undef): Call the handler even if the identifier is not a macro. + * cpptrad.c (scan_parameters): Emit an error message. + (_cpp_create_trad_definition): Remember the params list even on + failure. + +2003-12-11 Zack Weinberg + + * arm.c (ARM_ADDRESS_COST, THUMB_ADDRESS_COST): Convert macros + to inline functions: arm_arm_address_cost, arm_thumb_address_cost + respectively. + (arm_address_cost): Use 'em. + +2003-12-12 Rainer Orth + + * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define + __STDC_VERSION__ to ISO C94 for C++. + + * fixinc/inclhack.def (alpha_wchar): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/wchar.h: New file. + +2003-12-11 David Mosberger + + * unwind-libunwind.c (_Unwind_SetGR): Clear the NaT bit as + required by C++ ABI for Itanium. + * config/t-libunwind (LIB2ADDEH): Remove unwind-libunwind.c. + * config/t-libunwind-no-eh: New file. + * configure.in: Check libunwind for _Unwind_Resume() and if it's + present, set libunwind_has_eh_support to "yes". + * configure: Regenerate. + * config.gcc (ia64*-*-linux*): If $libunwind_has_eh_support is + set to yes, use t-libunwind, otherwise, use t-libunwind-no-eh. + +2003-12-11 Richard Sandiford + + * config/mips/mips.c (mips_global_pointer): Force functions with + a nonlocal goto to set up $gp. + +2003-12-11 James E Wilson + + PR target/13132 + * function.c (gen_mem_addressof): When no decl, explicitly clear flag + bits. + +2003-12-12 Nick Clifton + + * config/m32r/m32r.c: Convert to ISO-C + +2003-12-12 Kazuhiro Inaoka + + * doc/invoke.texi: Replace Mitsubishi with Renesas. + * config/m32r/m32r.h: Ditto. + * config/m32r/m32r.c: Ditto. + * config/m32r/m32r.md: Ditto. + +2003-12-11 Steven Bosscher + + * basic-block.h (BLOCK_HEAD, BLOCK_END): Remove. + (BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove. + (basic_block_def): Rename `head' to `head_' and `end' to `end_'. + (BB_HEAD, BB_END): New accessor macros for the `head_' and `end_' + fields of a basic block. + * bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c, + cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c, + cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c, + final.c, flow.c, function.c, gcse.c, global.c, graph.c, + haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c, + loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c, + ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c, + regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c, + sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c, + config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of + accessing the `head' and `end' fields of a basic block directly. + + * gengtype.c: Teach about "void**" pointers and "void *" function + types. Fixes earlier commit. + +2003-12-10 Geoffrey Keating + + * doc/extend.texi (Vector Extensions): Document that bitwise + operations also work on vectors. + +2003-12-10 Richard Earnshaw + + * arm.md: New split patterns for optimizing bitfield accesses. + +2003-12-10 Steven Bosscher + + * README.Portability: Remove K+R section. + + * gengtype-lex.l: Teach about "void**" pointers and + "void*" function types. + +2003-12-10 Eric Botcazou + + PR target/13354 + * config/sparc/sparc.c (sparc_output_mi_thunk): Load DELTA + manually if one can do that with only one instruction. + +2003-12-10 Nick Clifton + + * config.gcc (arm-linux): Include linux.h in tm_file so that + LINUX_TARGET_OS_CPP_BUILTINS is defined. + * config/arm/linux-elf.h (LIB_SPEC): Protect the definition. + +2003-12-09 James E Wilson + + * rtl.def (CODE_LABEL, NOTE): Correct operand numbers in comments. + +2003-12-09 Matt Austern + + PR c/13134 + * c-decl.c (duplicate_decls): Copy visibility flag when appropriate. + +2003-12-09 Kazuhiro Inaoka + + * config/m32r/m32r.h: Add support for m32r2 processor. Including + a new command line option -m32r2 to select it. + * config/m32r/m32r.c: Add support for the new processor variant. + * config/m32r/m32r.md: Likewise. + * config/m32r/t-m32r: Add m32r2 multilibs. + * doc/invoke.texi: Document the new command line switch. + +2003-12-08 Kazu Hirata + + * defaults.h (LOCAL_REGNO): Give the default definition. + * flow.c (LOCAL_REGNO): Remove. + * reload1.c (LOCAL_REGNO): Likewise. + +2003-12-08 Geoffrey Keating + + PR target/11848 + * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Allow change of mode + in floating-point registers between TFmode and DImode. + * rs6000.c (rs6000_emit_move): Split moves early. + (secondary_reload_class): Random Whitespace Change. + (rs6000_split_multireg_move): Support moves involving FP registers. + Emit instructions directly. + * rs6000-protos.h (rs6000_split_multireg_move): Update prototype. + * altivec.md: Update for changes to rs6000_split_multireg_move. + * rs6000.md: Update for changes to rs6000_split_multireg_move. + (movtf_internal): Support moves to/from GPRs. + +2003-12-08 Stuart Hastings + + * config/i386/i386.md: Typo in split of fp-valued if_then_else. + +2003-12-08 James E Wilson + + PR target/13132 + * expmed.c (extract_bit_field): Only call mode_for_size for scalar + integer modes. + +2003-12-08 Nathanael Nerode + + * doc/install.texi: Revert change of Dec 7; gcc is still a 2.13 + directory. + +2003-12-08 Alexandre Oliva + + * config/frv/frv.md (subdi2): Merge with _internal insn_and_split, + by using match_scratch. + (negdi2): New. + +2003-12-08 Jason Merrill + Daniel Berlin + + PR debug/11114 + Support namespaces in DWARF 2 output. + * dwarf2out.c (gen_namespace_die): New function. + (force_namespace_die, setup_namespace_context): New fns. + (declare_in_namespace): New fn. + (gen_decl_die): Call declare_in_namespace. Handle namespaces. + (dwarf2out_decl): Handle namespaces. + (scope_die_for): Pass through a namespace scope. + (class_scope_p): Rename to class_or_namespace_scope_p. + (gen_subprogram_die, gen_variable_die): Adjust. + (gen_struct_or_union_die): Always emit a declaration + if context_die is a namespace. + +2003-12-08 Jan Hubicka + + * unwind-pe.h (read_uleb128): Fix handling of large values + (read_sleb128): Fix handling of large values + +2003-12-08 Andrew Pinski + + PR middle-end/10060 + * emit-rtl.c (copy_rtx_if_shared): Split out into ... + (copy_rtx_if_shared_1): here and optimize the last one + in the sequence into tail-recursion. + (reset_used_flags): Optimize the last one + in the sequence into tail-recursion. + +2003-12-08 Richard Earnshaw + + * arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y) + for constant X. + +2003-12-08 Richard Sandiford + + * calls.c (expand_call): Don't try using tail or recursive calls + after the function body has been expanded. + +2003-12-08 Jan Hubicka + + * i386.md (cmpstr expander): Obey TARGET_INLINE_ALL_STRINGOPS + +2003-12-08 Arnaud Charlet + + PR ada/13324, PR ada/12614 + * doc/install.texi: Update requirements for building Ada. + +2003-12-07 David Edelsohn + Graham Reed + + * collect2.c (GCC_OK_SYMBOL): Add support for AIX C_WEAKEXT. + (GCC_UNDEF_SYMBOL): Same. + +2003-12-07 Kazu Hirata + + * final.c (final_scan_insn): Don't use FINAL_PRESCAN_LABEL. + * system.h (FINAL_PRESCAN_LABEL): Poison. + * doc/tm.texi (FINAL_PRESCAN_LABEL): Remove. + +2003-12-07 Kaveh R. Ghazi + + * Makefile.in (compare): Combine toplevel and $(SUBDIRS) cases. + +2003-12-07 Nathanael Nerode + + * configure.in, aclocal.m4: Revert to pre-2.5x conversion status. + * configure: Regenerate with autoconf 2.13. + + * configure.in: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM + with modern equivalents. + * configure: Regenerate. + + * configure.in: Replace gcc_AC_CHECK_TYPE with AC_CHECK_TYPE. + * aclocal.m4 (gcc_AC_CHECK_TYPE): Remove. + * configure: Regenerate. + + * configure: Regenerate with (preferred) autoconf 2.57. + * doc/install.texi: Note that 'gcc' is now a 2.57 directory. + +2003-12-07 Eric Botcazou + + PR optimization/12965 + * caller-save.c (save_call_clobbered_regs): Do not save/restore + registers around no-return calls. + +2003-12-07 Nathanael Nerode + + * configure.in: Make minimum necessary changes for autoconf 2.5x. + * aclocal.m4: Make minimum necessary changes for autoconf 2.5x. + * configure: Regenerate with autoconf 2.58. + +2003-12-07 Eric Botcazou + + PR optimization/13318 + * loop.c (express_from): Protect integer division from overflow. + +2003-12-07 Eric Botcazou + + PR optimization/13060 + * function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a + replacement already exists. Fix again the whole insn if that fails. + +2003-12-06 Andrew Pinski + + * config/rs6000/rs6000.c (macho_branch_islands): Use + HOST_WIDE_INT_PRINT_UNSIGNED. + +2003-12-06 Richard Sandiford + + * varasm.c (incorporeal_function_p): New. + (assemble_external): Use it as a filter. + * config/mips/mips.c (mips_output_external): Don't check for builtin + functions here. + +2003-12-06 Richard Earnshaw + + * arm.md (IOR (COMPARISON) (AND)): New define_splits. + +2003-12-06 Kelley Cook + + * Makefile.in (program_transform_cross_name): Delete. + (GCC_CROSS_NAME, CPP_CROSS_NAME): Delete. + (PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Delete. + (AR_FOR_TARGET, RANLIB_FOR_TARGET, NM_FOR_TARGET): Adjust for above. + (install_cpp, install_driver, install-man, uninstall): Likewise. + +2003-12-06 Alan Modra + + PR 13169 + * basic-block.h (PROP_ASM_SCAN): Define. + * final.c (regs_asm_clobbered): New array. + * regs.h (regs_asm_clobbered): Declare. + * flow.c (life_analysis): Init it. + (mark_set_regs): Set PROP_ASM_SCAN for asms. + (mark_set_1): Set regs_asm_clobbered. + * global.c (global_alloc): Don't set eliminable_regset when + regs_asm_clobbered. + +2003-12-05 Mark Mitchell + + * config/ia64/ia64.h (MUST_PASS_IN_STACK): Define. + + PR c++/13314 + * emit-rtl.c (set_mem_attributes_minus_bitpos): Robustify. + +2003-12-05 Andrew Pinski + + PR driver/13211 + * gcc.c (execute) Increment execution_count when returning + early because verbose_only_flag is true. + +2003-12-05 Per Bothner + + * cppfiles.c (file_hash_hash): New static function. + (hash_string_eq): Renamed static function to file_hash_eq. + (_cpp_init_files): Create file_hash table with above callbacks. + (cpp_included): Must use htab_find_with_hash insead of htab_find. + (_cpp_find_find, make_cpp_dir): Must use htab_find_slot_with_hash. + +2003-12-05 Per Bothner + + * line-map.h (source_location): New typedef. + (fileline): Redefined as source_location. + (struct line_map, linemap_add, linemap_lookup): Replace filefile + by source_location. + * line-map.c (linemap_add, linemap_lookup): Use source_location. + +2003-12-05 Richard Henderson + + * config/alpha/alpha.c (alpha_build_builtin_va_list): Add dummy + field to suppress -Wpadded warnings. + +2003-12-05 Stuart Hastings + + * config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO. + +2003-12-05 Stuart Menefy + J"orn Rennecke + + PR target/13302 + * sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type). + +2003-12-05 Roger Sayle + + * dojump.c (do_jump): If the expression being compared against + zero, is the subreg of a promoted variable, perform the comparison + in the promoted mode. + * simplify-rtx.c (simplify_unary_operation): Optimize sign and + zero-extensions of subregs of promoted variables where the + extension is identical to that used to promote the variable. + +2003-12-05 Hans-Peter Nilsson + + PR target/13256 + * resource.h (enum mark_resource_type): Remove member MARK_DEST. + The only user changed as follows: + * resource.c (mark_set_resources) : Always recurse for + SET_SRC (x). + : Always recurse on + operands. + : Delete, deferring to default code. + +2003-12-05 Waldek Hebisch + + * stmt.c (expand_nl_goto_receiver): Copy hard register clobbers + and ASM_INPUT barrier from expand_builtin_setjmp_receiver. + +2003-12-05 Richard Sandiford + + * config/mips/mips.c (mips_expand_call): Don't allow laziy binding + for n32 & n64 abicalls. + +2003-12-05 Richard Sandiford + + PR bootstrap/13145 + * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Adjust comment. + * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Add $fcall. + (mips_load_got): Always create a constant MEM. + (mips_expand_call): Use load_callsi and load_calldi. + * config/mips/mips.md (UNSPEC_LOAD_CALL, FAKE_CALL_REGNO): New consts. + (load_callsi, load_calldi): New patterns. + +2003-12-05 Peter Gerwinski + + * tree.def (PLACEHOLDER_EXPR): Clarify commentary. + +2003-12-05 Steven Bosscher + + * config/d30v/d30v-protos.h , config/d30v/d30v.c, + config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, + config/fr30/fr30-protos.h, config/fr30/fr30.c, + config/i370/i370-protos.h, config/i370/i370.c, + config/i960/i960-protos.h, config/i960/i960.c, + config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, + config/m32r/m32r-protos.h, config/m32r/m32r.c, + config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, + config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c: + Convert to ISO C90 function declarations and definitions. + +2003-12-05 Eric Botcazou + + * doc/extend.texi (Constructing Calls): Add warning about + the limitations of the functions. + +2003-12-05 Eric Botcazou + + PR middle-end/11151 + * function.h (struct function): New field 'x_naked_return_label'. + * function.c (free_after_compilation): Set it to NULL. + (expand_function_end): Emit 'naked_return_label' if it exists. + * rtl.h (expand_naked_return): Declare. + * stmt.c (expand_naked_return): New function to generate a + jump to 'naked_return_label'. + * builtins.c (expand_builtin_return): Call expand_naked_return + instead of expand_null_return. + * config/sparc/sparc.md (untyped_return): Likewise. + +2003-12-04 Andrew Pinski + + PR target/11322 + * config/sh/netbsd-elf.h (NO_PROFILE_COUNTERS): Define. + + PR target/12467 + * config/rs6000/altivec.md (altivec_vmsummbm): Fix typo. + +2003-12-04 Stuart Hastings + + * rs6000.c (output_call, macho_branch_islands, + add_compiler_branch_island, no_previous_def, get_previous_label) + Revisions of xx_stub functions for branch islands, + add -fPIC support for Darwin. + * rs6000-protos.h (output_call) Prototype. + * rs6000.md Use output_call. + * invoke.texi Explain Darwin semantics of -longcall. + * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr. + +2003-12-04 Richard Henderson + + * config/i386/i386.md (addqi3_carry): Use q not r constraints. + (subqi3_carry): Likewise. + +2003-12-04 J"orn Rennecke + + PR optimization/13260 + * sh-protos.h (sh_expand_t_scc): Declare. + * sh.h (PREDICATE_CODES): Add cmpsi_operand. + * sh.c (cmpsi_operand, sh_expand_t_scc): New functions. + * sh.md (cmpsi): Use cmpsi_operand. If T_REG is compared to + something that is not a CONST_INT, copy it into a pseudo register. + (subc): Fix description of new T value. + (slt, sgt, sge, sgtu): Don't clobber T after rtl generation is over. + (sltu, sleu, sgeu): Likewise. + (seq, sne): Likewise. Use sh_expand_t_scc. + +2003-12-04 Nathanael Nerode + + * configure.in: Generalize the CONFIG_HEADERS pattern under which + we stamp cstamp-h. + * configure: Regenerate. + + * configure.in: Pull AC_CHECK_HEADER call out of shell if statement + to avoid trouble when updating to autoconf 2.5x. + * configure: Regenerate (with autoconf 2.13 still). + +2003-12-04 J"orn Rennecke + + * sh.md (truncdiqi2): Use andi opcode for immediate. + (reload_outdf+1,reload_outdf+2): Remove constraints. + (movv16sf_i): Fxi multiplier for SUBREG_BYTE. + (movv8qi_i+2): Zero-extend low byte before adding it to high byte. + (fipr, ftrv): Add .s suffix to opcode. + +2003-12-04 Richard Sandiford + + PR target/13186 + + Revert all of the following patch, except the addition of + hook_bool_machine_mode_true: + + 2003-11-02 Richard Sandiford + + * Makefile.in (targhooks.o, reload.o): Update dependencies. + (GTFILES): Add targhooks.c. + (gt-targhooks.h): New rule; depend on s-gtype. + * target.h (direct_pool_load_p): New hook. + * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro. + (TARGET_INITIALIZER): Include it. + * targhooks.h (default_direct_pool_load_p): Declare. + (hook_bool_machine_mode_true): Declare. + * targhooks.c: Include insn-config.h, recog.h, ggc.h and + gt-targhooks.h. + (pool_symbol): New variable. + (default_direct_pool_load_p): New function. + (hook_bool_machine_mode_true): New function. + * reload.c: Include target.h. + (find_reloads): If an alternative will force a constant into memory, + count an extra reload if constant pool symbols are not valid + addresses. If an alternative uses memory to move values between + registers, count the move as two reloads rather than one. + * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define. + * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document. + +2003-12-03 Mark Mitchell + + * config/ia64/hpux.h (TARGET_HAVE_TLS): Define it to false. + * config/ia64/ia64.h (TARGET_HAVE_TLS): Define it to true if + HAVE_AS_TLS is true. + * config/ia64/ia64.c (TARGET_HAVE_TLS): Do not define it. + +2003-12-03 James E Wilson + + * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name. + + * gcc-page.c (extra_order_size_tab): Correct comment. + +2003-12-03 Kazu Hirata + + * config/h8300/h8300.c (push): Call gen_push_h8300hs_advanced + instead of gen_push_h8300hs. + (pop): Call gen_pop_h8300hs_advanced instead of + gen_pop_h8300hs. + * config/h8300/h8300.h (TRAMPOLINE_SIZE): Use Pmode. + * config/h8300/h8300.md (*tablejump_h8300hs_advanced): + Tighten the predicate. + (*tablejump_h8300hs_normal): Tighten the predicate. + (push_h8300hs): Change to + push_h8300hs_advanced. + (pop_h8300hs): Change to pop_h8300hs_advanced. + +2003-12-03 Eric Christopher + + * rtl.c: Fix typo. + * config/mips/mips.h: Ditto. Fix formatting. + +2003-12-04 Ben Elliston + + * future.options: Remove. Move to gnu.org web pages. + +2003-12-03 Eric Christopher + + * c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move + from here... + * c-tree.h: to here. + +2003-12-03 Jan Hubicka + + PR optimization/12324 + * toplev.c (rest_of_decl_compilation): Do not deffer when compiling + in unit-at-a-time mode. + +2003-12-03 Jakub Jelinek + + * expr.c (store_constructor): Only set RTX_UNCHANGING_P for + read-only field if cleared is 0. + +2003-12-03 Nathanael Nerode + + * config.gcc: Mark obsolete targets for GCC 3.4. + +2003-12-03 Zack Weinberg + + * aclocal.m4 (AM_ICONV): Add explicit check for iconv.h. + * config.in, configure.in: Regenerate. + * cpphash.h: Check both HAVE_ICONV and HAVE_ICONV_H before + including iconv.h. + +2003-12-03 Alan Modra + + PR target/11229 + * cse.c (cse_insn): Set classp using src_const_elt if + src_eqv_elt is NULL. + +2003-12-03 Richard Earnshaw + + * gcse.c (reg_clear_last_set): New function. + (reg_set_info): If data is non-null, treat it as an sbitmap of + registers, set the bit for the register being set. + (compute_store_table): Allocate last_set_in with xcalloc. Do not + memset this array on each iteration. Pass reg_set_in_block[bb->index] + to note_stores while computing last_set_in instead of scanning + last_set_in after the first pass through the insns. + Clear last_set_in using reg_clear_last_set instead of explicitly + rescanning after each insn. If checking is enabled, assert that + last_set_in is completely zeroed after each bb has been processed. + +2003-12-02 Geoffrey Keating + + * df.c (df_uses_record) : The argument of a MEM is read-only, + never read-write. + : Delete incorrect comment. + : Remove 'use_flags' variable. + +2003-12-03 David Edelsohn + + * function.c (assign_parms): Make sure parm PARALLEL combined + in reg is composed of more than one object and the mode really + produces a reg. + +2003-12-03 Jan Hubicka + + * i386.c (classify_argument): Make it 64bit clean. + +2003-12-02 Richard Sandiford + + * config/mips/mips.c (mips_output_external): Replace checks for + specific builtin-in functions with a check for DECL_BUILTIN_IN. + +2003-12-02 Richard Henderson + + * rtl.h (PUT_CODE, PUT_MODE): Remove ENUM_BITFIELD cast. + * tree.h (TREE_SET_CODE): Likewise. + * recog.h (struct insn_operand_data): Move const after ENUM_BITFIELD. + +2003-12-02 Ben Elliston + + * dbxstclass.h: Rename from this .. + * xcoff.h: .. to this. + * xcoffout.c: Include xcoff.h. + +2003-12-01 Kaveh R. Ghazi + + * Makefile.in (GCC_CFLAGS): Add -Wold-style-definition. + +2003-12-01 James Lemke + + * config/arm/arm.c (arm_rtx_costs): Improve for xscale multiply. + +2003-12-01 Roger Sayle + + PR optimization/11634 + * recog.c (split_insn): Factor test of INSN_P and handling of + set_noop_p out of here into the two callers. + (split_all_insns): Add INSN_P test and set_noop_p handling here. + If deleting a no-op set after reload that has a REG_UNUSED note, + mark the basic block as changed and recalculate life information. + (split_all_insns_noflow): Add INSN_P test and set_noop_p handling + here. + +2003-12-01 Roger Sayle + + PR optimization/12322 + * gcse.c (struct ls_expr): Change type of hash_index from int to + unsigned int. + (hash_expr): Document hash_table_size parameter and wrap long line. + (ldst_entry): Calculate expression's hash_index and record in ptr. + (trim_ld_motion_mems): Use hash_index to search a single bucket + instead of scanning the entire hash_table. Remove the "del" local + variable and use the equivalent "expr == 0" instead. Change last + to be a pointer to the pointer to the current element, to simplify + and speed-up deleting from a linked list. + +2003-12-01 James E Wilson + + * doc/contrib.texi: Update David Mosberger. + + * doc/c-tree.texi (CONSTRUCTOR): Clarify element order and handling + of missing fields. + + PR target/8407 + * config/ia64/ia64.c (ia64_function_arg): For single-reg HFA, call + gen_rtx_REG to create new reg with argument mode. + +2003-12-01 Steven Bosscher + + * ggc.h (struct alloc_zone): Move forward declaration up. + (new_ggc_zone): New function prototype. + (destroy_ggc_zone): Ditto. + * ggc-simple.c (new_ggc_zone): New function, does nothing. + (destroy_ggc_zone): Ditto. + * ggc-page.c (new_ggc_zone): New function, does nothing. + (destroy_ggc_zone): Ditto. + * ggc-zone.c (struct page_entry): Fix comment. + (ggc_alloc_typed): Use a switch statement instead of ifs. + (new_ggc_zone): New function to set up a new GC zone. + (destroy_ggc_zone): New function to remove a GC zone. + init_ggc): Use new_ggc_zone to set up the default zones. + (ggc_collect): Walk a list of zones, instead of just the + default zones. Report statistics using the zone name. + +2003-12-01 Ulrich Weigand + + * unroll.c (find_splittable_givs): Add missing extend_value_for_giv. + +2003-12-01 Roger Sayle + + PR optimization/12628 + * toplev.c (rest_of_handle_jump_bypass): Call reg_scan. + * regclass.c (reg_scan): Include allocate_reg_info time in + TV_REG_SCAN. Minor clean-ups. + (reg_scan_update): Minor clean-ups. + +2003-12-01 Ulrich Weigand + + * config.gcc (s390x-ibm-tpf*): Add extra_parts. + +2003-12-01 James E Wilson + + * config/ia64/ia64.h (FUNCTION_ARG_REGNO_P): Use AR_REG_FIRST not + GR_ARG_FIRST. + +2003-12-01 Zack Weinberg + + * common.opt: Remove -fgnu-linker. + * flags.h: Remove flag_gnu_linker. + * opts.c: Don't handle OPT_fgnu_linker. + * toplev.c: Don't initialize flag_gnu_linker. + Remove gnu-linker entry from f_options. + * config/dsp16xx/dsp16xx.h (OPTIMIZATION_OPTIONS): + Don't reset flag_gnu_linker. + * config/mips/mips.c (override_options): Likewise. + * doc/invoke.texi: Remove all mention of -fgnu-linker. + +2003-12-01 Daniel Berlin + + * ggc-zone.c (ggc_pch_write_object): Calculate object size using + ggc_get_size (which accounts for large objects properly). + +2003-12-01 Jeff Sturm + + PR optimization/13024 + * toplev.c (rest_of_handle_new_regalloc): Remove rebuild_notes + parameter. + (rest_of_handle_old_regalloc): Likewise. Add rebuild_notes + declaration. Rebuild jump labels following local_alloc if necessary. + (rest_of_compilation): Remove rebuild_label_notes_after_reload + declaration. Don't pass rebuild_notes parameter to + rest_of_handle_new_regalloc and rest_of_handle_old_regalloc. + Don't rebuild jump labels. + +2003-12-01 Jeff Law + + * flow.c (count_or_remove_death_notes_bb): New. Extracted from + count_or_remove_death_notes. + (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP. + +2003-12-01 Andreas Krebbel + + * builtins.c (expand_builtin_longjmp): Added two memory clobbers. + +2003-12-01 Ulrich Weigand + + * reload.c (find_reloads_address): Split addresses of type + (plus (plus (reg) (reg)) (const_int)) only if one register + is either a valid base register or else one of the stack + frame related registers (sp/fp/ap). + +2003-12-01 Steven Bosscher + + * function.c (update_epilogue_consts): Don't use PARAMS. + * rtl.h (web_main): Ditto. + * target.h (is_costly_dependence): Ditto + +2003-12-01 Eric Botcazou + + PR middle-end/7847 + * expr.c (expand_expr) [normal_inner_ref]: When 'offset' is non-zero, + do not recheck that 'op0' is a MEM. Move comment. When testing for + unaligned objects, take also into account the alignment of 'op0' and + 'mode1' if 'op0' is a MEM. + +2003-12-01 Gabriel Dos Reis + + * doc/c-tree.texi (Function Bodies): Update HANDLER documentation. + +2003-12-01 Kelley Cook + + * doc/install.texi: Note that fastjar is built with automake 1.7.x + and autoconf 2.57. + +2003-12-01 Alan Modra + + * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Test + target_flags directly rather than using TARGET_* defines. + +2003-11-30 Ben Elliston + + * doschk.c: Remove. + +2003-11-30 Richard Sandiford + + PR target/12727 + * config/mips/mips.c (mips_save_reg): Fix frame information for sdc1 + on 32-bit big-endian targets. + +2003-11-30 Kazu Hirata + + * genemit.c (register_constraints): Remove. + +2003-11-30 Andreas Krebbel + + * config/s390/s390.md ("tmdi_reg", "tmsi_reg", "*movdi_64", "*movdi_31", + "iordi3"): Insns now use multiple letter constraints. + ("*movdi_lhi", "*movdi_lli", "*movdi_lay"): Insns deleted. They are now + covered by "*movdi_64". + ("*movsi_lhi", "*movsi_lli", "*movsi_lay"): Insns deleted. They are now + covered by "*movsi_zarch" and "*movsi_esa". + ("*movsi_zarch", "*movsi_!zarch"): New insns. + ("*llgt_sisi_split", "*llgt_didi_split"): Insns deleted. Now covered + by "*andsi3_zarch" and "anddi3". + ("*anddi3_ni"): Insn merged with "anddi3". + ("*andsi3_ni"): Insn merged with "*andsi3_zarch". + ("*andsi3_zarch", "*andsi3_esa"): New insns. + ("*iordi3_oi"): Insn merged with "iordi3". + ("*iorsi3_oi"): Insn merged with "*iorsi3_zarch". + ("*iorsi3_zarch", "*iorsi3_esa"): New insns. + + * config/s390/s390.c (s390_single_qi, s390_single_hi): Functions + merged to s390_single_part. + (s390_single_part): New function. + NOTE: Semantics have changed a bit. Now the value of the part must + be different from the others to get a non-negative return value. + (s390_extract_qi, s390_extract_hi): Functions merged to + s390_extract_part. + (s390_extract_part, s390_extra_constraint_str, + s390_const_ok_for_constraint_p): New functions. The L constraint got a + new meaning and the N constraint was added as a multiple letter + constraint. + (s390_extra_constraint): Function deleted. + (print_operand): New output modifier 'i' and 'j' added. + All uses of CONST_OK_FOR_LETTER_P were replaced by + CONST_OK_FOR_CONSTRAINT_P. + + * config/s390/s390-protos.h: Function prototypes adapted. + * doc/md.texi: Documentation for new constraint letters added. + +2003-11-30 Andreas Schwab + + * Makefile.in ($(DESTDIR)$(infodir)/%.info): Fix missing semicolon. + +2003-11-29 James E Wilson + + * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name + instead of in shared_name. + + * final.c (final_start_function): Delete code for NON_SAVING_SETJMP. + * reload1.c (reload): Re-add it here. + +2003-11-30 Alan Modra + + * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Don't + set SECTION_WRITE on TARGET_RELOCATABLE. + +2003-11-29 Kazu Hirata + + * config/h8300/h8300.h (LIBCALL_VALUE): Use R0_REG. + +2003-11-28 Gunther Nikl + + * config/m68k/m68k.c (MOTOROLA): Move from here... + * config/m68k/m68k.h (MOTOROLA): ... to here. + (OUTPUT_JUMP): Use do {...} while (0). + * config/m68k/m68k.md: Replace #ifdef MOTOROLA with C statements. + +2003-11-28 Gunther Nikl + + * config.gcc (m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*, + m68k*-*-netbsdelf*, m68k-*-rtems*): Add tm_defines containing + MOTOROLA and USE_GAS. + * config/m68k/rtemself.h (MOTOROLA): Delete. + * config/m68k/netbsd-elf.h (MOTOROLA, USE_GAS): Delete. + * config/m68k/m68kelf.h (MOTOROLA, USE_GAS, SGS_CMP_ORDER): Delete. + +2003-11-29 Kazu Hirata + + * config/h8300/h8300.h (WORDS_BIG_ENDIAN): Update the comment. + +2003-11-29 Kelley Cook + + * Makefile.in (install-info): Install gccinstall.info too. + +2003-11-29 Ulrich Weigand + + * config/s390/s390.md ("cmpint_di"): Fix incorrect instruction lengths. + +2003-11-29 Ulrich Weigand + + * config/s390/s390.md ("movhi"): Do not emit extender pattern + when loading from a (MEM (ADDRESSOF ...)). + ("movqi"): Likewise. + +2003-11-29 Joseph S. Myers + + PR c/10333 + * c-parse.in (typespec_reserved_nonattr): Reject typeof on + bit-fields. + +2003-11-29 Richard Sandiford + + * stmt.c (expand_asm_operands): Check whether force_const_mem + succeeded. + +2003-11-28 Kaveh R. Ghazi + + * config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New. + * config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): New. + + * config/alpha/gnu.h, config/alpha/linux.h, + config/arm/linux-elf.h, config/cris/cris.h, config/cris/linux.h, + config/i370/linux.h, config/i386/gnu.h, config/i386/i386.h, + config/i386/linux-aout.h, config/i386/linux.h, + config/i386/linux64.h, config/ia64/linux.h, config/m68k/linux.h, + config/m68k/uclinux.h, config/mips/linux.h, + config/mn10300/linux.h, config/pa/pa-linux.h, + config/rs6000/sysv4.h, config/s390/linux.h, config/sh/linux.h, + config/sparc/linux.h, config/sparc/linux64.h, + config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Use + HURD_TARGET_OS_CPP_BUILTINS/LINUX_TARGET_OS_CPP_BUILTINS or ensure + all necessary assertions are included. + +2003-11-28 Jan Hubicka + + * emit-rtl.c (set_used_flags): New. + (verify_rtx_sharing, verify_rtl_sharing): New. + (unshare_all_rtl_1): Rename to.... + (unshare_all_rtl_in_chain): ... this one; make static. + (copy_rtx_if_shared): LABEL_REF chan be shared. + * ifcvt.c (unshare_ifcvt_sequence): New. + (noce_try_move, noce_try_store_flag, noce_try_store_flag_constants, + noce_try_addcc, noce_try_addcc, noce_try_store_flag_mask, + noce_try_cmove, noce_try_store_flag_mask, noce_try_minmax, + noce_try_abs, noce_process_if_block, find_cond_trap + * rtl.h (verify_rtl_sharing, set_used_flags, unshare_all_rtl_in_chain): + Declare. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md: Fix a comment typo. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md (*movsf_h8300h): Change to + *movsf_h8300hs. + (addsi_h8300): Change to *addsi_h8300. + (addsi_h8300h): Change to *addsi_h8300hs. + (subsi3_h8300): Change to *subsi3_h8300. + (subsi3_h8300h): Change to *subsi3_h8300hs. + (neghi2_h8300h): Change to *neghi2_h8300hs. + (negsi2_h8300h): Change to *negsi2_h8300hs. + +2003-11-28 Kazu Hirata + + * config/h8300/h8300.md (*subhi3_h8300): Remove '&' from the + constraint. + (*subhi3_h8300hs): Likewise. + +2003-11-28 David Edelsohn + + * config/rs6000/rs6000.h (MASK_MFCRF): New. + (TARGET_MFCRF): Test target_flags, not processor type. + (TARGET_SWITCHES): Add mfcrf and no-mfcrf. + Change Don't to Do not. + * config/rs6000/rs6000.c (processors_target_table): Add MASK_MFCRF + to power4, 970, G5. + +2003-11-27 J"orn Rennecke + + * cse.c (cse_set_around_loop): When changing a constant load + to a register -register copy, add a REG_EQUAL note. + +2003-11-27 Randolph Chung + John David Anglin + + * pa.c (hppa_profile_hook): Split gen_call_profiler into separate + insns. Use the regular call expander for the call to the profiler. + * pa.md (call_profiler): Delete. + (load_offset_label_address): New insn to load the address of the + current function for the profiler. + (lcla1, lcla2): New insns to output a code label and load its address. + +2003-11-27 Kazu Hirata + + * final.c (final_scan_insn): Remove commented-out code. + +2003-11-27 Nathanael Nerode + + * doc/install.texi: Remove ADAC reference and make accurate. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.h (FUNCTION_VALUE): Use R0_REG. + (FUNCTION_VALUE_REGNO_P): Likewise. + * config/h8300/h8300.md: Define R0_REG. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.c: Fix formatting. + * config/h8300/h8300.md: Likewise. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.h (ELIMINABLE_REGS): Update a comment. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.md: Give names to anonymous insns. + +2003-11-27 Kazu Hirata + + * config/h8300/h8300.md (extendqisi2): Remove constraints. + +2003-11-27 Gunther Nikl + + * doc/tm.texi (SYSROOT_HEADERS_SUFFIX_SPEC): Fix typo. + +2003-11-27 Eric Botcazou + + PR optimization/13041 + * final.c (frame_pointer_needed): Fix comment. + * reload1.c (reload): Decrease alignment of the frame + pointer if it was used for register allocation. + +2003-11-27 Eric Botcazou + + PR target/12900 + * reg-stack (move_for_stack_reg): New prototype. Return + whether a control flow insn was deleted. + (subst_stack_regs_pat): Likewise, using the information provided + by move_for_stack_reg. + (subst_stack_regs): Likewise, using the information provided + by subst_stack_regs_pat. + (convert_regs_1): Record whether a control flow insn was deleted, + using the information provided by subst_stack_regs. Purge dead + edges only if a control flow insn was deleted. + +2003-11-27 Eric Botcazou + + PR middle-end/8028 + PR middle-end/9890 + PR middle-end/11151 + PR middle-end/12210 + PR middle-end/12503 + PR middle-end/12692 + * builtins.c (expand_builtin_apply): Use virtual_outgoing_args_rtx + as the base address to copy the memory arguments to. + +2003-11-26 Danny Smith + + * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Declare + function aliases as functions. + +2003-11-26 Nathanael Nerode + + * aclocal.m4 (gcc_AC_PROG_GNAT): Rewrite to account for removal + of ADAC. + * configure: Regenerate. + + * Makefile.in: Remove references to ADAC. + + * configure.in: Remove check for whether ${ADAC} accepts -Wno-long-long. + * configure: Regenerate. + +2003-11-26 Eric Botcazou + Olivier Hainque + + PR target/6466 + * config/sparc/sparc-protos.h (compute_frame_size): New prototype. + (sparc_flat_compute_frame_size): Likewise. + (sparc_flat_save_restore): Move prototype... + * config/sparc/sparc.c (sparc_flat_save_restore): ...here. + (save_regs): New prototype. + (build_big_number): Likewise. + (apparent_fsize): Change type to HOST_WIDE_INT. + (actual_fsize): Likewise. + (frame_base_offset): Likewise. + (build_big_number): Add support for HOST_BITS_PER_WIDE_INT == 64. + Change string descriptor to HOST_WIDE_INT_PRINT_DEC. + [TARGET_ARCH64]: Use the sequence of sparc_emit_set_const64_longway + to load a 64-bit constant. + (sparc_nonflat_function_prologue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Change offset type to HOST_WIDE_INT. + (output_restore_regs): Change offset type to HOST_WIDE_INT. + (sparc_nonflat_function_epilogue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Use build_big_number. + (output_sibcall): Change size type to HOST_WIDE_INT. Use + build_big_number. Change string descriptor to HOST_WIDE_INT_PRINT_DEC. + (sparc_frame_info): Change types for several components. + (sparc_flat_compute_frame_size): Update types according to previous + change. + (sparc_flat_function_prologue): Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Change offset type to int. Use + build_big_number. + (sparc_flat_function_epilogue): Change offset type to int. + Rename 'size1' into 'reg_offset1'. Change string descriptor to + HOST_WIDE_INT_PRINT_DEC. Use build_big_number. Change big number + limit to 4096 instead of 4095. + + * config/sparc/sparc.c (mems_ok_for_ldd_peep): Change offset type to + HOST_WIDE_INT. + +2003-11-24 Waldek Hebisch + + * function.c: Make outer_function-chain external. + * function.h: Likewise. + +2003-11-24 Richard Sandiford + + * config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when + using GNU ld. + * config/mips/iris6.h (IRIX6_STARTFILE_SPEC): New, taking the + whole of the previous STARTFILE_SPEC except crtbegin.o%s. + (IRIX6_ENDFILE_SPEC): Likewise ENDFILE_SPEC and crtend.o%s. + (STARTFILE_SPEC, ENDFILE_SPEC): Define in terms of the above. + (SUBTARGET_EXTRA_SPECS): Define. + * config/mips/iris6gld.h (LINK_SPEC): Change -init function + to __gcc_init and -fini function to __gcc_fini. + (STARTFILE_SPEC): Redefine, including irix6-crti.o before crtbegin.o. + (ENDFILE_SPEC): Likewise, including irix6-crtn.o after crtend.o. + (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Define. + * config/mips/t-iris6gld, + * config/mips/irix6-crti.asm, + * config/mips/irix6-crtn.asm: New files. + +2003-11-24 Eric Christopher + + PR C/13014 + * c-decl.c (c_in_iteration_stmt, c_in_case_stmt): New. + (start_function): Use. + (c_push_function_context): Ditto. + (c-pop_function_context): Ditto. + (language_function): Move... + * c-tree.h: ... here. Add x_in_iteration_stmt, and + x_in_case_stmt. + * c-parse.in (do_stmt_start, select_or_iter_stmt, stmt): Use + c_in_iteration_stmt, c_in_case_stmt for parser state. Move + check for valid break or continue statment here... + * c-semantics.c (genrtl_break_stmt, genrtl_continue_stmt): From + here. Change original errors to abort. + +2003-11-24 Jan Hubicka + + * fold-const.c (fold): Do not return early when optimizing + COMPONENT_REF and constant. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md (tablejump_h8300): Change to + *tablejump_h8300. + (tablejump_h8300h): Change to *tablejump_h8300hs_advanced. + (tablejump_normal_mode): Change to *tablejump_h8300hs_normal. + (indirect_jump_h8300): Change to *indirect_jump_h8300. + (indirect_jump_h8300h): Change to + *indirect_jump_h8300hs_advanced. + (indirect_jump_normal_mode): Change to + *indirect_jump_h8300hs_normal. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md: Remove constraints from expanders. + +2003-11-24 Kazu Hirata + + * config/h8300/h8300.md: (stm_h8300s_2): Change the name to + stm_h8300s_2_advanced. + (stm_h8300s_2_normal): New. + (stm_h8300s_2): Likewise. + (stm_h8300s_3): Change the name to stm_h8300s_3_advanced. + (stm_h8300s_3_normal): New. + (stm_h8300s_3): Likewise. + (stm_h8300s_4): Change the name to stm_h8300s_4_advanced. + (stm_h8300s_4_normal): New. + (stm_h8300s_4): Likewise. + (ldm_h8300s_2): Change the name to ldm_h8300s_2_advanced. + (ldm_h8300s_2_normal): New. + (ldm_h8300s_2): Likewise. + (ldm_h8300s_3): Change the name to ldm_h8300s_3_advanced. + (ldm_h8300s_3_normal): New. + (ldm_h8300s_3): Likewise. + (ldm_h8300s_4): Change the name to ldm_h8300s_4_advanced. + (ldm_h8300s_4_normal): New. + (ldm_h8300s_4): Likewise. + (two peephole2's): Enable only with !TARGET_NORMAL_MODE. + (two peephole2's): New. + +2003-11-24 Zdenek Dvorak + + * genattrtab.c (simplify_cond): Update indices correctly. + (attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, + attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New. + (check_attr_test, encode_units_mask, compute_alternative_mask, + make_alternative_compare, simplify_and_tree, + attr_rtx_cost, simplify_test_exp, gen_attr, + write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT. + * rtl.def (EQ_ATTR_ALT): New. + +2003-11-23 Zdenek Dvorak + + * genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros. + (length_str, delay_type_str, delay_1_0_str, num_delay_slots_str): + New variables. + (main): Initialize them. + (find_attr): Canonicalize the attribute name string. + (attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize + string arguments. + (attr_printf, attr_eq): Use DEF_ATTR_STRING. + (check_attr_test, check_attr_value, make_length_attrs, + write_length_unit_log, simplify_by_exploding, gen_attr, + write_test_expr, write_attr_value, write_eligible_delay, + write_complex_function, make_internal_attr, + write_const_num_delay_slots): Changed due to change of type of + find_attr. + (fill_attr, evaluate_eq_attr, simplify_and_tree, + attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use + strcmp_check. + +2003-11-23 Kazu Hirata + + PR target/13122 + * config/h8300/h8300.c (push): Call push_h8300hs_normal in + normal mode. + (pop): Call pop_h8300hs_normal in normal mode. + * config/h8300/h8300.md: Likewise. + (pushqi1_h8300hs_normal): New. + (pushqi1): Call pushqi1_h8300hs_normal in normal mode. + (pushhi1_h8300hs_normal): New. + (pushhi1): Call pushhi1_h8300hs_normal in normal mode. + (push_h8300hs_normal): New. + (pop_h8300hs_normal): Likewise. + +2003-11-23 Zdenek Dvorak + + * genattrtab.c (count_sub_rtxs): Removed. + +2003-11-23 Richard Earnshaw + + * recog.c (preprocess_constraints): Only zero those elements of + recog_op_alt that are needed for this insn. + * arm.c (note_invalid_constants): A function can't contain invalid + constants if it has no constraints. + +2003-11-22 Jan Hubicka + + * i386.c (classify_argument): Pass __float128 in memory. + (ix86_return_in_memory): Likewise. + (ix86_libcall_value): Likewsie. + +2003-11-22 Kazu Hirata + + * config/h8300/h8300.c (dosize): Convert to ISO-C. + +2003-11-22 J"orn Rennecke + + * flow.c (update_life_info): Amend comment about when a register + can become dead. + +2003-11-21 Kelley Cook + + * doc/.cvsignore: Delete. + +2003-11-21 Daniel Berlin + David Edelsohn + + * dwarf2out.c (add_location_or_const_value_attribute): Add support + for PARALLEL. + +2003-11-21 Rainer Orth + + * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS): Add -Wno-error. + (TARGET_LIBGCC2_CFLAGS): Define. + + * crtstuff.c [HAS_INIT_SECTION] (__do_global_dtors): Declare. + (__do_global_ctors): Likewise. + +2003-11-21 Mark Wielaard + + * doc/invoke.texi (-O2): Doesn't enable -fweb. + +2003-11-21 Kazu Hirata + + * doc/invoke.texi: Mention dV and dZ. + +2003-11-21 Kazu Hirata + + * doc/invoke.texi: Update dump file names. + Remove de, dW, and dX. + +2003-11-20 James E Wilson + + PR c/13133 + * reload1.c (reload): Delete special handling for setjmp. + +2003-11-21 Andreas Tobler + + * mklibgcc.in: Evaluate shlib_slibdir_qual during link + step too. + * config/t-slibgcc-darwin: Adjust install path. + * config/rs6000/t-darwin: Revert multilib matches since + it is not used on darwin. + +2003-11-20 Richard Henderson + + * ssa.c, ssa-dce.c, ssa-ccp.c: Remove files. + * Makefile.in (OBJS-common, GTFILES): Don't reference them. + (gtype-desc.o, toplev.o, flow.o): Remove ssa.h. + (ssa.o, ssa-dce.o, ssa-ccp.o): Remove. + * flow.c: Don't include ssa.h. + (set_phi_alternative_reg): Remove. + (calculate_global_regs_live): Don't call it. + (mark_used_regs): Don't handle PHI. + * gengtype.c (open_base_files): Don't reference ssa.h. + * rtl.def (PHI): Remove. + * timevar.def (TV_TO_SSA, TV_SSA_CCP, TV_SSA_DCE, TV_FROM_SSA): Kill. + * common.opt: Remove -fssa, -fssa-ccp, -fssa-dce. + * opts.c (common_handle_option): Likewise. + * toplev.c (f_options): Likewise. + (DFI_ssa, DFI_ssa_ccp, DFI_ssa_dce, DFI_ussa): Remove. + (dump_file): Update to match. + (flag_ssa, flag_ssa_ccp, flag_ssa_dce): Remove. + (rest_of_handle_ssa): Remove. + (rest_of_compilation): Don't call it. + * toplev.h (flag_ssa, flag_ssa_dce, flag_ssa_ccp): Remove. + * doc/invoke.texi: Remove -fssa, -fssa-ccp, -fssa-dce. + * doc/passes.texi (SSA optimizations): Remove. + +2003-11-20 Bob Wilson + + * configure.in: Add xtensa-*-* targets to test for dwarf2 debug_line. + * configure: Regenerate. + +2003-11-20 Kelley Cook + + * Makefile.in (Makefile): Pass along CONFIG_SHELL. + +2003-11-20 David Mosberger + + * config/t-libunwind (LIB2ADDEH): Add unwind-c.c. + (SHLIB_LC): Define. + * unwind-libunwind.c (_Unwind_GetCFA): Implement. + (_Unwind_GetBSP) [UNW_TARGET_IA64]: New function. + +2003-11-20 Fariborz Jahanian + David Edelsohn + + * calls.c (expand_call): Allocate new temp in pass1. + (store_one_arg): If PARALLEL, calculate excess using mode size of + rtvec elt. + * expr.c (emit_push_insn): If PARALLEL, calculate offset using + mode size of rtvec elt. + * function.c (assign_parms): Use parm in register, if available. + +2003-11-20 Kazu Hirata + + * config/h8300/lib1funcs.asm (MOVP): Remove. + (ADDP): Likewise. + (CMPP): Likewise. + +2003-11-20 Richard Earnshaw + + * arm.c (use_return_insn): New argument, SIBLING. Support returning + with a single instruction if the stack has been decremented by 4 + and we have a frame pointer. Update all callers. + (output_return_instruction): Likewise. + (arm_output_epilogue): Change argument to SIBLING. Calculate + really_return from the new argument. Update all callers. + * arm.h (USE_RETURN_INSN): Pass NULL for the sibling. + * arm.md (sibcall_epilogue): Call use_return_insn directly, and + pass the sibling call. + * arm-protos.h (use_return_insn, arm_output_epilogue): Update + prototypes. + +2003-11-20 Joseph S. Myers + + * Makefile.in (extraclean): Delete. + * configure.in (target_list): Remove extraclean. + * configure: Regenerate. + * doc/makefile.texi, doc/sourcebuild.texi: Update. + * objc/Make-lang.in (objc.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Makefile.in (lang_checks): Add. + (check-c++, check-f77, check-java, check-g++, check-g77, + check-objc): Remove hardcoded targets. + * doc/sourcebuild.texi: Document testsuite hooks. + * objc/Make-lang.in (check-objc, lang_checks): Add. + +2003-11-19 Scott Snyder + + PR target/13131 + * dwarf2out.c (gen_array_type_die): DW_AT_declaration should be a + flag, not a constant. + +2003-11-19 Kelley Cook + + * config/arc/arc-protos.h: Update to C90 prototypes. + * config/arc/arc.c: Likewise. + * config/arc/initfini.c: Likewise. + +2003-11-19 Andreas Krebbel + + * stmt.c (expand_goto): Memory clobbers added. + +2003-11-19 Andreas Krebbel + + * reload.c (find_reloads): Added missing type casts. + +2003-11-19 James E Wilson + + * combine.c (sets_function_arg_p): Delete unused function. + +2003-11-19 Eric Christopher + + * reload1.c (reload): Revert 2 previous checkins. + +2003-11-19 Nathanael Nerode + + * cpptrad.c (_cpp_scan_out_logical_line): Improve test for + whether directive begins at the beginning of a line. + +2003-11-19 Richard Sandiford + + * config/frv/frv.c (frv_init_libfuncs): Correct ufix_optab entries. + +2003-11-19 Gerald Pfeifer + + * doc/install.texi (Specific): Remove information on old versions + of glibc versus old versions of GCC. + +2003-11-19 Richard SAndiford + + * emit-rtl.c (gen_lowpart): Don't force MEMs into a register unless + the register lowpart is a TRULY_NOOP_TRUNCATION. + +2003-11-19 Richard Henderson + + * config/i386/i386.c (print_reg): Handle QI and HI modes for + non Q regs. + +2003-11-19 Andreas Tobler + + * config/config.gcc (powerpc-*-darwin*): Add libgcc build + specification file. + * config/t-slibgcc-darwin: New file, libgcc build specification. + * config/t-darwin: Add libgcc2 flag -fPIC. + * config/rs6000/t-darwin: Multilib matches float. + * libgcc-darwin.ver: New file, contains libgcc symbols. + +2003-11-18 Nathanael Nerode + + * config/ns32k/ns32k.h: Remove obsolete comment. + +2003-11-18 Roger Sayle + + PR middle-end/11821 + * config/arm/arm.c (arm_rtx_costs_1): Improve estimate of the code + size for calls to libgcc's div & mod subroutines when using -Os. + +2003-11-18 Jan Hubicka + + * cgraph.c (change_decl_assembler_name): Avoid bogus warnings. + +2003-11-18 Marc Espie + + * config/rs6000/sysv4.h: OpenBSD hooks. + +2003-11-18 Richard Henderson + + * expr.c (expand_expr): Don't look through constant arrays if + they don't bind locally. + +2003-11-17 Richard Kenner + + * expr.c (convert_move): Use GET_MODE_PRECISION instead of bitsize + when seeing if truncation or extension. + +2003-11-17 Eric Christopher + + * reload1.c (reload): Fix previous change. + +2003-11-17 Scott Snyder + + PR debug/11325 + * dwarf2out.c (struct die_struct): Add die_definition field. + (add_AT_specification): New. + (gen_subprogram_die, gen_variable_die, + gen_struct_or_union_type_die): Use it. + (prune_unused_types_mark): If we're marking a forward declaration, + also mark the full definition, if it exists. + +2003-11-16 Nick Clifton + + * config/stormy16/stormy16.h (BUILD_VA_LIST_TYPE): Delete. + * config/stormy16/stormy16-protos.h (xstormy16_build_va_list): + Remove prototype. + * config/stormy16/stormy16.c (xstormy16_build_va_list): Rename + to xstormy16_build_builtin_va_list and make static. + (TARGET_BUILD_BUILTIN_VA_LIST): Define. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300-protos.h: Add the prototype for + same_cmp_following_p. + * config/h8300/h8300.c (same_cmp_following_p): New. + * config/h8300/h8300.md (peephole2): Use it. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300.md: Don't use REGNO when its operand is + not guaranteed to be a REG. + +2003-11-16 Richard Sandiford + + * Makefile.in (expr.o): Depend on $(TARGET_H). + * target.h (return_in_msb): New target hook. + * target-def.h (TARGET_RETURN_IN_MSB): New macro. + (TARGET_CALLS): Include it. + * calls.c (shift_returned_value): New function. + (expand_call): Use it. + * expr.c: Include target.h. + (copy_blkmode_from_reg): Check targetm.calls.return_in_msb when + deciding what padding is needed. Change the name of the local + padding variable from big_endian_correction to padding_correction. + * stmt.c (shift_return_value): New function. + (expand_return): Use it. Adjust memory->register copy in the same + way as copy_blkmode_from_reg. Only change the return register's + mode if it was originally BLKmode. + * doc/tm.texi (TARGET_RETURN_IN_MSB): Document. + * config/mips/mips.c (TARGET_RETURN_IN_MSB): Define. + (mips_fpr_return_fields): New, split out from mips_function_value. + (mips_return_in_msb, mips_return_fpr_pair): New functions. + (mips_function_value): Rework to use the functions above. + * config/mips/irix6-libc-compat.c: Delete. + * config/mips/t-iris6 (LIB2FUNCS_STATIC_EXTRA): Undefine. + +2003-11-16 Kazu Hirata + + * doc/install.texi (--enable-checking): Update valgrind's URL. + +2003-11-16 Kazu Hirata + + * config/h8300/h8300.md: Fix warnings by replacing -2147483648 + with -2147483647 - 1. + +2003-11-16 Gerald Pfeifer + + Fix links in online manuals. + * doc/invoke.texi (H8/300 Options): @xref to ld, not ld.info. + (Precompiled Headers): @pxref to cpp, not cpp.info. + +2003-11-16 Jason Merrill + + * Makefile.in, objc/Make-lang.in (objc.tags): Create TAGS.sub + files in each directory and TAGS files that include them for each + front end. + +2003-11-15 Kazu Hirata + + * config/h8300/lib1funcs.asm (divnorm): Store the sign in bit + 3 of S2L. + (modnorm): Likewise. + (exitdiv): Look at bit 3 of S2L only. + +2003-11-15 Kazu Hirata + + * config/h8300/h8300.h (DO_GLOBAL_CTORS_BODY): Fix warnings. + (DO_GLOBAL_DTORS_BODY): Likewise. + +2003-11-15 Joseph S. Myers + + * doc/install.texi (Prerequisites): Refine documentation of + autoconf, automake and perl requirements. Document required + gettext version. + +<2003-11-14 Jason Merrill + + * function.c (assign_parms): Use TREE_TYPE to determine the real + type of the argument object. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Peel off the first + iteration. + +2003-11-14 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_move_block_from_reg): + New routine to save vararg registers on stack. Support for + -mpowerpc64 in mixed mode. + +2003-11-14 Bernardo Innocenti + + * config/m68k/m68k.c: Use C statements instead of #ifdef's when testing + for MOTOROLA versus MIT syntax. Improves readability and provides + better compile-time error checking for both code paths. + +2003-11-14 Kelley Cook + + * config/frv/frv-protos.h: Update for C90. + * config/frv/frv.h: Likewise. + * config/frv/frvbegin.c: Likewise. + * config/frv/frv.c: Likewise. + (frv_adjust_field_align): Delete unused variable. + +2003-11-14 Geoffrey Keating + + * config/rs6000/rs6000.md: Add 'DEFAULT_ABI == ABI_DARWIN' + to each place where TARGET_LONG_DOUBLE_128 is used with + DEFAULT_ABI == ABI_AIX. + + * cppfiles.c (_cpp_find_file): Make 'one or more PCH files were found' + message comply with GNU standards. + +2003-11-14 Richard Kenner + + PR/6552 + * function.c (struct epi_info): New field const_equiv. + (update_epilogue_consts): New function. + (keep_stack_depressed): Clear new field and verify scratch register + doesn't have it set. + Call new function via note_stores. + (handle_epilogue_set): Allow setting SP equiv reg in different mode. + Allow PLUS where second operand is register known set to constant. + (emit_equiv_load): Write load using proper mode if source different. + * config/mips/mips.md (return_internal): Put (return) first. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Add a comment. + +2003-11-14 Kazu Hirata + + * config/h8300/lib1funcs.asm (modsi3): Don't save unused + registers. + (divsi3): Likewise. + (reti): Don't restore unused registers. + +2003-11-14 Nick Clifton + + * config/fr30/fr30.c: Include toplev.h + +2003-11-14 Richard Earnshaw + + * except.c (sjlj_emit_function_enter): Mark internal label as LOCAL. + +2003-11-14 Richard Earnshaw + + * arm.c (arm_emit_vector_const, arm_output_load_gr): Use ISO C + function definition syntax. + +2003-11-14 Eric Christopher + + * reload1.c (reload): Revert previous patch. Make + check for assignment into reg_equiv_address stricter. + +2003-11-14 Arnaud Charlet + + * Makefile.in (POSTSTAGE1_FLAGS_TO_PASS): Pass ADAFLAGS. + +2003-11-14 Richard Sandiford + + * config/frv/frv.c (frv_in_small_data_p): Return false for unknown + section names. + +2003-11-14 Jason Merrill + + PR middle-end/12526 + * tree.c (build): A CALL_EXPR has side-effects if its arguments do. + * calls.c (call_expr_flags): New fn. + * tree.h: Declare it. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (__udivsi3): Remove. + (divmodsi3): Change the name to ___udivsi3. + Update all callers. + +2003-11-13 Kaveh R. Ghazi + + * libgcc2.c (__negdi2, __addvsi3, __addvdi3, __subvsi3, __subvdi3, + __mulvsi3, __negvsi2, __negvdi2, __mulvdi3, __lshrdi3, __ashldi3, + __ashrdi3, __ffsDI2, __muldi3, __clzDI2, __ctzDI2, __parityDI2, + __udivmoddi4, __divdi3, __moddi3, __cmpdi2, __ucmpdi2, + __fixunstfDI, __fixunsxfDI, __fixunsdfDI, __fixunssfDI, + __floatdixf, __floatditf, __floatdidf, __floatdisf, __gcc_bcmp): + Const-ify and/or initialize automatic variables at declaration. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (divmodsi4): Replace all the uses + of er4 with er3. Adjust all callers. + +2003-11-13 Andrew Pinski + + * config/darwin.c (machopic_output_possible_stub_label): + Allow stub symbol be not defined when outputting possible + stub label. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (___udivsi3): Jump to reti + instead of exitdiv. + (___umodsi3): Likewise. + (exitdiv): Do not restore any register. + (reti): Restore registers. + +2003-11-13 Steven Bosscher + + * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm: Fix comment typos. + +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (udivsi3): Don't save/restore + unused registers. Don't jump to exitdiv. + (umodsi3): Likewise. + +2003-11-13 Mark Mitchell + Kean Johnston + + PR c/13029 + * toplev.c (check_global_declarations): Do not warn about unused + static consts. + +2003-11-13 Pavel Pisa + Kazu Hirata + + * config/h8300/lib1funcs.asm (DenHighNonZero): Optimize using + the approximate quotient method. + +2003-11-13 Richard Earnshaw + + * combine.c (distribute_notes): When re-distributing the notes from + an insn we are about to delete, ensure we can't end up with a cyclic + list of notes. + +2003-11-13 Eric Botcazou + + PR optimization/12926 + * expr.c (expand_assignment) [COMPONENT_REF]: Don't put + the UNCHANGING_RTX_P flag on memory references to read-only + components that are not addressable. + +2003-11-12 Kazu Hirata + + * config/h8300/lib1funcs.asm (divmodsi4): Clear S0P in + DenHighNonZero. + +2003-11-13 Jan Hubicka + + PR opt/12275 + * c-decl.c (finish_decl): Use change_decl_assembler_name. + * c-pragma.c (handle_pragma_redefine_extname): Likewise. + * varasm.c (make_decl_rtl): Likewise. + * cgraph.c (change_decl_assembler_name): New function. + * tree.h (set_decl_assembler_name): Kill dead declaration. + (change_decl_assembler_name): Declare. + + * decl.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. + * decl2.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name. + +2003-11-12 Kazu Hirata + + * config/h8300/lib1funcs.asm (___mulsi3): Don't save/restore + an unused register. + +2003-11-12 Richard Sandiford + + PR bootstrap/12752 + * config/mips/t-iris6 (MULTILIB_OPTIONS): Put -mabi=n32 first. + (MULTILIB_OSDIRNAMES): Reorder accordingly. + +2003-11-12 Janis Johnson + + * rs6000-protos.h (rs6000_initial_elimination_offset): Add. + (rs6000_stack_info): Remove. (debug_stack_info): Remove. + (rs6000_emit_eh_reg_restore): Add + * rs6000.c (rs6000_stack_t): Move from rs6000.h, change data type + of vars_size and total_size to HOST_WIDE_INT. + (emit_frame_save): Change parameter size to HOST_WIDE_INT. + (rs6000_stack_info): Make static; change data size to HOST_WIDE_INT. + (debug_stack_info): Make static; change output format of HOST_WIDE_INT + values. + (rs6000_emit_eh_reg_restore): New, with code formerly in rs6000.md. + (rs6000_initial_elimination_offset): New, with code formerly in + INITIAL_ELIMINATION_OFFSET. + * rs6000.h (rs6000_stack_t): Remove. + (INITIAL_ELIMINATION_OFFSET): Replace code with call to function + rs6000_initial_elimination_offset. + * rs6000.md (UNSPECV_EH_RR split): Replace code with call to + rs6000_emit_eh_reg_restore. + +2003-11-12 Mike Stump + + * c-typeck.c (c_convert_parm_for_inlining): Add argnum, which + is the argumnt we are processing so that warnings and errors + will have that information. + * c-tree.h (c_convert_parm_for_inlining): Add argnum. + * lang-hooks-def.h + (lhd_tree_inlining_convert_parm_for_inlining): Likewse. + * langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise. + * langhooks.h (convert_parm_for_inlining): Likewise. + * tree-inline.c (initialize_inlined_parameters): Compute and + pass argnum down. + +2003-11-12 Alexey Starovoytov + Roger Sayle + + PR optimization/12953 + * tree-inline.c (inline_forbidden_p_1): Added check for BUILT_IN + before switch by FUNCTION_CODE. + +2003-11-12 Richard Earnshaw + + * arm.md (storehi): Avoid use of explicit subreg. + (storehi_bigend, storeinthi, movhi_bigend): Likewise. + +2003-11-12 J"orn Rennecke + + * config/sh/sh.md (prefetch): New pattern. + +2003-11-11 Eric Christopher + + * reload1.c (reload): Verify that addresses for + reg_equiv_* are valid for the architecture. + +2003-11-11 Eric Christopher + + * function.c (purge_addressof_1): Add libcall check. + Remove test for cached replacements on fallback case. + Simplify mode comparisons. Add libcall test for + paradoxical subregs. + +2003-11-11 Kazu Hirata + + * config/h8300/t-h8300: Fix an obsolete comment. + +2003-11-11 James E Wilson + + * expmed.c (store_bit_field, extract_bit_field): Revert last two + changes. + +2003-11-11 Kazu Hirata + + * config/h8300/lib1funcs.asm: Replace DenHighZero with + DenHighNonZero. + +2003-11-11 Jan Hubicka + + * cgraphunit.c (cgraph_function_possibly_inlined_p): Use + really_no_inline. + +2003-11-11 John David Anglin + + * pa.h (TRAMPOLINE_TEMPLATE): Fix flushing of cache lines when + generating 64-bit code. + +2003-11-10 David Edelsohn + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Remove + accidental commit in previous change. + +2003-11-10 Fariborz Jahanian + + * config/rs6000/rs6000.h (STACK_SIZE_MODE): Add definition. + * config/rs6000/rs6000.c (reg_or_mem_operand): Add macho-style + address recognition. + (macho_lo_sum_memory_operand): Routine to recognize macho-style + address recognition. + +2003-11-10 Richard Henderson + + * dwarf2out.c (gen_label_die): Cope with DECL_RTL not set. + +2003-11-10 Matt Austern + + * config/darwin-protos.h (darwin_assemble_visibility): Declare. + * config/darwin.c (darwin_assemble_visibility): Define. Warn for + anything other than VISIBILITY_DEFAULT and VISIBILITY_HIDDEN. + * config/darwin.h (TARGET_ASM_ASSEMBLE_VISIBILITY): Use + darwin_assemble_visibility instead of default. + +2003-11-10 Waldek Hebisch + + PR target/12865 + * config/sparc/sparc.c (sparc_initialize_trampoline): Call + __enable_execute_stack only after writing onto the stack. + (sparc64_initialize_trampoline): Likewise. + +2003-11-09 Roger Sayle + + * loop.c (check_dbra_loop): Try swapping the comparison operands + of the loop condition to identify a suitable induction variable. + * unroll.c (loop_iterations): Likewise. + +2003-11-09 Kaveh R. Ghazi + + * config/sparc/sparc.h (TARGET_CPU_CPP_BUILTINS): Fix sparc vs + sparc64 #cpu and #machine assertions. + +2003-11-09 Richard Henderson + + * Makefile.in (rtlanal.o): Depend on BASIC_BLOCK_H. + +2003-11-09 Jan Hubicka + + * tree-optimize.c (tree_rest_of_compilation): Fix warning. + + * cgraphunit.c (cgraph_expand_function): Use + cgraph_possibly_inlined_p. + * tree-optimize.c (tree_rest_of_compilation): Do not kill saved tree. + + * opts.c (common_handle_option): Do not set max-inline-insns. + * params.def: Update comments. + (PARAM_MAX_INLINE_INSNS): Kill. + * invoke.texi (max-inline-insns): Kill. + +2003-11-08 Joseph S. Myers + + PR c/3190 + PR c/8714 + * c-format.c (set_Wformat): Do not enable -Wformat-y2k by default. + * invoke.texi: Update. + +2003-11-08 John David Anglin + + PR optimization/12630 + * pa.c (compute_movstrsi_length): Rename to compute_movstr_length. + Handle length computation 64-bit moves. + (compute_clrstr_length, output_block_clear): Implement block clear. + (output_block_move): Handle 64-bit moves. + (pa_adjust_insn_length): Use compute_movstr_length and + compute_clrstr_length. + * pa.md (movstrsi): Revise operand order and comments. Don't use + match_scratch. + (movstrsi_internal): Delete. + (movstrsi_prereload, movstrsi_postreload): New insns. Define splitter + and peephole2 patterns to transform prereload to postreload form. + (movstrdi, movstrdi_prereload, movstrdi_postreload, clrstrsi, + clrstrsi_prereload, clrstrsi_postreload, clrstrdi, clrstrdi_prereload, + clrstrdi_postreload): New patterns for 64-bit block move, and block + clear. + * pa-protos.h (output_block_clear): New prototype. + +2003-11-08 Andreas Schwab + + * dbxout.c (current_file): Also wrap inside DBX_DEBUGGING_INFO || + XCOFF_DEBUGGING_INFO. + +2003-11-08 Kaveh R. Ghazi + + * dbxout.c (current_file): Wrap declaration in DBX_USE_BINCL. + +2003-11-07 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_legitimize_address): Remove + redundant parens. + + * cppfiles.c (pch_open_file): New parameter 'invalid_pch', set it. + (find_file_in_dir): Likewise. + (_cpp_find_file): Print message if no header file is found + but an invalid PCH file was. + +2003-11-08 Joseph S. Myers + + * c-typeck.c (pedantic_lvalue_warning): Deprecate compound + expressions as lvalues. + (internal_build_compound_expr): Remove special handling for + non-pedantic case. + * doc/extend.texi: Document that all extended lvalues are now + deprecated. + +2003-11-07 Geoffrey Keating + + PR 11654 + * dbxout.c (struct dbx_file): Do not save for PCH. + (current_file): Likewise. + (dbxout_init): Don't allocate struct dbx_file using GC. + (dbxout_start_source_file): Likewise. + +2003-11-07 Falk Hueffner + + * config/alpha/elf.h, config/alpha/unicosmk.h, + config/alpha/vms.h: Convert to ISO C90. + +2003-11-07 Nathanael Nerode + + * config/arm/pe.h: Convert to ISO C90. + +2003-11-07 J"orn Rennecke + + * sh-protos.h (sh_pch_valid_p): Declare. + * sh.c ("intl.h"): Include. + (TARGET_PCH_VALID_P): Override. + (sh_target_switches): New variable. + (target_switches): Define. + (sh_pch_valid_p): New function. + + * sh.h (MODE_AFTER): Don't change mode unless TARGET_HITACHI. + +2003-11-07 Jan Hubicka + + * i386.c (x86_64_sign_extended_value): Return false from tls variables. + (x86_64_zero_extended_value): likewise. + +2003-11-07 Richard Sandiford + + * config/mips/mips.md (loadgp): Take $25 as a second operand. + * config/mips/mips.c (mips_expand_prologue): Modify accordingly. + +2003-11-06 Matt Austern + + * c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY + field instead of hanging an attribute object off the decl. + * tree.h (DECL_VISIBLITY): New accessor macro for + symbol_visibility field in struct tree_decl. + (enum symbol_visibility): Move definition to before tree_decl. + (struct tree_decl): Define new two-bit field, symbol_visibility. + (decl_visibility): Remove declaration. + * varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY + instead of decl_visibility. + (default_binds_local_p_1): Use DECL_VISIBILITY instead of + decl_visibility. + (decl_visibility): Remove. + +2003-11-06 Ulrich Weigand + + * config/s390/s390.c (s390_emit_epilogue): Recognize more cases + where register 14 will be saved. + +2003-11-06 Geoffrey Keating + + * config/rs6000/rs6000.h (USE_FP_FOR_ARG_P): Move to rs6000.c. + (USE_ALTIVEC_FOR_ARG_P): Likewise. + * config/rs6000/rs6000.c (USE_FP_FOR_ARG_P): Move from rs6000.h. + Take a pointer as the CUM parameter. Update callers. + (USE_ALTIVEC_FOR_ARG_P): Likewise. Also correct for Darwin/AIX + 32-bit ABIs. + (function_arg_advance): Use USE_ALTIVEC_FOR_ARG_P. Correct case + of vector parameters as named arguments of stdarg function. + (function_arg): Likewise. + + * config/rs6000/darwin.h (ASM_SPEC): Use -force_cpusubtype_ALL when + -maltivec is specified, not the non-existent -faltivec. + +2003-11-06 Ulrich Weigand + + * config/s390/s390-protos.h (s390_function_value): Declare. + * config/s390/s390.c (TARGET_RETURN_IN_MEMORY): Define. + (s390_return_in_memory): New function. + (s390_function_value): New function. + (s390_function_arg_float): Return false for all arguments larger + than 8 bytes. + (s390_function_arg_pass_by_reference): Likewise. Return true for + all vector arguments. + (s390_function_arg_integer): New function. + (s390_function_arg_advance): Call it. Add sanity checks. + (s390_function_arg): Likewise. + * config/s390/s390.h (FUNCTION_VALUE): Call s390_function_value. + (LIBCALL_VALUE): Likewise. + (RET_REG): Remove. + (RETURN_IN_MEMORY): Remove. + +2003-11-06 Richard Sandiford + + * config/mips/mips-protos.h (mips_initial_elimination_offset): Change + return type to HOST_WIDE_INT. + * config/mips/mips.c (mips_frame_info): Give sizes type HOST_WIDE_INT. + Make initialized a bool. Make register masks unsigned ints. + (compute_frame_size): Make same mask change here. Use HOST_WIDE_INT + where appropriate. + (mips_initial_elimination_offset): Return a HOST_WIDE_INT. + (mips_output_function_prologue): Print sizes as HOST_WIDE_INTs. + +2003-11-06 Richard Sandiford + + * config/frv/frv.c (frv_initial_elimination_offset): Remove bogus + negation. + +2003-11-06 Richard Sandiford + + * config/frv/frv.h (ASM_OUTPUT_ALIGN_WITH_NOP): Define. + +2003-11-06 Momchil Velikov + + * config/mips/mips.c (override_options): Set MASK_SOFT_FLOAT + for VR4111 too. + +2003-11-06 Jan Hubicka + + * builtins.c (simplify_builtin_strrchr, simplify_builtin_strpbrk): Add + missing casts. + +2003-11-06 Zack Weinberg + + * genmodes.c: Change the word "bitsize" to "precision" throughout. + * machmode.def: Likewise. + * machmode.h (GET_MODE_SIZE): Cast value to unsigned short. + (GET_MODE_BITSIZE): Define as GET_MODE_SIZE * BITS_PER_UNIT. + (GET_MODE_PRECISION): New macro. + (mode_bitsize): Renamed mode_precision. + * stor-layout.c (mode_for_size, smallest_mode_for_size): + Use GET_MODE_PRECISION; clarify comments. + +2003-11-05 Joseph S. Myers + + * doc/install-old.texi: Remove old documentation of building + cross-compilers. + * doc/install.texi: Move some of it to here. + +2003-11-05 Per Bothner + + PR preprocessor/12891 + * c-opts.c (finish_options): Set include_cursor to disable premature + calls to push_command_line_include from cpp_scan_nooutput. + Fixes bug reported by DJ Delorie. + +2003-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (setup_incoming_varargs): Remove + code supporting old-style varargs. + + * config/rs6000/rs6000.c (rs6000_machopic_legitimize_pic_address): Use + an intermediate register for better optimisation. + +2003-11-05 Zdenek Dvorak + + PR optimization/10080 + * cfgloopanal.c (variable_initial_value, variable_initial_values, + simple_loop_exit_p): Record the fact that initial value is extended + from inner mode. + (count_strange_loop_iterations, count_loop_iterations): Handle + ivs that iterate in a narrower mode. Fix handling of overflows. + Improve handling of NE conditions. + (inverse, fits_in_mode_p): New static functions. + (simple_increment): Detect variables that iterate in a narrower mode. + * cfgloop.h (struct loop_desc): Fields inner_mode and extend added. + +2003-11-05 Geoffrey Keating + + * config/rs6000/rs6000.c (compute_vrsave_mask): Correct off-by-one + error. + + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Darwin + needs VRSAVE. + +2003-11-05 Joseph S. Myers + + * c-typeck.c (pedantic_lvalue_warning): Deprecate use of + conditional expressions as lvalues. + +2003-11-05 Kazu Hirata + + * tsystem.h: Add the prototype of strlen. + * unwind-pe.h (read_encoded_value_with_base): Add an + appropriate cast to handle a case where the pointer size is + smaller than sizeof (int). + +2003-11-04 Richard Sandiford + + * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete. + (mips_delegitimize_address): Delete. + (mips_gotoff_global, mips_load_got_page): Declare. + (mips_load_got_global, mips_rewrite_small_data): Declare. + + * config/mips/mips.h (FIND_BASE_TERM): Remove definition. + (DANGEROUS_FOR_LA25_P): Use global_got_operand. + (PREDICATE_CODES): Add global_got_operand, local_got_operand and + small_data_pattern. Remove CONST from const_arith_operand's entry. + + * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros. + (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise. + (mips_constant_type): Delete. + (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL, + SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP. + (NUM_SYMBOL_TYPES): New macro. + (mips_address_type): Remove ADDRESS_INVALID. + (machine_function): Add has_gp_insn_p. + (mips_constant_info): Delete. + (mips_address_info): Add the address type as an extra field. Replace + the c field with symbol_type. + (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays. + (TARGET_DELEGITIMIZE_ADDRESS): Remove definition. + (mips_reloc_offset_ok_p, mips_classify_constant): Delete. + (mips_split_const, mips_symbolic_constant_p): New functions. + (mips_symbolic_address_p): Take the symbol type and mode as arguments. + (mips_classify_address): Return true if the address is valid, storing + its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[] + to test whether a LO_SUM address is allowed. + (mips_symbol_insns): Return 0 for general mips16 symbols. + Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition. + Handle the new SYMBOL_GOTOFF_*s. + (mips_address_insns): Update call to mips_classify_address. + (mips_const_insns): Be more fussy about HIGH constants. Remove use + of mips_classify_constant. Be more accurate about CONSTs. + (mips_global_pic_constant_p): Delete. + (const_arith_operand): Only accept CONST_INTs. + (call_insn_operand): Remove call to mips_classify_constant. + Let mips_symbolic_constant_p check for invalid offsets. + (move_operand): Check for general_operands first. Only accept symbolic + constants if they satisfy mips_symbolic_constant_p and cannot be split. + (symbolic_constant): Use mips_symbolic_constant_p. + (global_got_operand, local_got_operand): New predicates. + (stack_operand): Update call to mips_classify_address. + (mips_legitimate_address_p): Likewise. + (mips_reloc, mips_lui_reloc): Delete. + (mips_force_temporary): Only use the given temporary if no_new_pseudos. + Use emit_move_insn. + (mips_split_symbol, mips_unspec_address): New functions. + (mips_unspec_offset_high): New function. + (mips_load_got): Replace reloc argument with a symbol_type. + Use mips_unspec_address to create the address and put it in a + LO_SUM with the base register. + (mips_load_got16, mips_load_got32): Delete. + (mips_emit_high, mips_legitimize_symbol): Delete. + (mips_gotoff_global): New function. + (mips_load_got_page, mips_load_got_global): New functions. + (mips_legitimize_symbol): Inline handling of LO_SUM splits. + (mips_legitimize_const_move): Likewise. Remove HIGH handling. + Inline code to handle constants plus invalid offsets. Use + mips_split_symbol to legitimize constant pool addresses. + (mips_delegitimize_address): Delete. + (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs + a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS. + (mips_subword): Pass memrefs through mips_rewrite_small_data. + (mips_output_move): Remove use of mips_classify_constant. + (mips_expand_call): Use mips_unspec_offset_high to calculate the + high part of the GOT address for calls to global functions. + (override_options): Initialize mips_split_p[], mips_lo_relocs[] + and mips_hi_relocs[]. + (print_operand): Use print_operand_reloc to handle '%h' and '%R'. + Remove use of mips_classify_constant. + (mips_reloc_string): Delete. + (print_operand_reloc): New function. + (print_operand_address): Update call to mips_classify_address. + (mips_rewrite_small_data_p, small_data_pattern_1): New functions. + (small_data_pattern): New predicate. + (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions. + (mips_function_has_gp_insn): New function. + (mips_global_pointer): Use it. + (mips_gp_insn): Delete. + (mips_expand_prologue): When compiling for n32/n64 abicalls, use a + single loadgp pattern to initialize $gp. Pass it the offset of _gp + from the start of the current function. + (mips16_gp_pseudo_reg): Revert last patch. + + * config/mips/mips.md (RELOC_*): Delete. + (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants. + (got): New insn attribute. + (type): Set to "load" if got == load. + (length): Set to 4 if got == load, 8 if got == xgot_high. + (lui[sd]i): Delete. + (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns. + (*got_disp[sd]i, *got_page[sd]i): Likewise. + (*low[sd]i): Change constraints to "d". Add a new define_split to + rewrite small data constants into LO_SUMs. + (loadgp): New insns. + +2003-11-04 Rainer Orth + + * config/mips/_tilib.c: Use _ABI* in _MIPS_SIM tests. + +2003-11-04 DJ Delorie + + * config/v850/v850.md (mulhisi3): Expand the const_int case + separately to avoid trying to sign extend the const. + +2003-11-04 Richard Sandiford + + * emit-rtl.c (copy_rtx_if_shared): Don't allow MEMs with constant + addresses to be shared. + (force_const_mem): Return a copy of the pool entry. + +2003-11-03 Andreas Jaeger + + * Makefile.in (GCC_CFLAGS): Remove @WERROR@ again. + +2003-11-03 Kelley Cook + + * Makefile.in (cpp.dvi): New target split from cpp.info. + (gcc.dvi): New target split from gcc.info. + (gccint.dvi): New target split from gccint.info. + (cppinternals.dvi): New target split from cppinternals.info + (gccinstall.info): New specific rule. + (gccinstall.dvi): Likewise. + (dvi): Move targets to $(docobjdir). + ($(docobjdir)/%.dvi): New implicit rule. + +2003-11-03 Richard Kenner + + * doc/gty.texi (tag, desc): Say more about role of desc values in + selecting between tags. + +2003-11-03 Alexander Kabaev + + * real.c (encode_ieee_single): Ensure proper promotion. + +2003-11-03 Volker Reichelt + + * doc/contrib.texi: Add Giovanni Bajo, Dara Hazeghi, Falk Hueffner, + and Andrew Pinski. + +2003-11-03 Syd Polk + + * config/rs6000/rs6000.c (rs6000_override_options): Add G3, G4, and G5 + marketing names to the list of supported processors. + * config/rs6000/rs6000.h: Ditto. + * doc/invoke.texi: Ditto. + * config.gcc: Ditto. + +2003-11-03 Rainer Orth + + * fixinc/inclhack.def (stdio_va_list): Allow tab before va_list. + Merge two substitutions. + * fixinc/fixincl.x: Regenerate. + Fixes PR bootstrap/12666. + +2003-11-03 Joseph S. Myers + + * doc/install-old.texi: Remove VMS documentation. + +2003-11-03 Jan Hubicka + + * i386.c (override_options): Remove hack enabling 128bit long double + commited by accident. + +2003-11-02 Per Bothner + + * c-opts.c (needValue): Do cpp_find_main_file before processing + any imacros flags, so pfile->main_file is set for the latter. + +2003-11-03 Andreas Jaeger + Zack Weinberg + + * Makefile.in (GCC_CFLAGS): Allow blacklisting of warnings. + (SYSCALLS.c.X-warn): Suppress warnings. + +2003-11-02 John David Anglin + + PR optimization/12845 + * pa.c (output_cbranch): Use cmpb for DImode comparisons with 0. + +2003-11-02 Zack Weinberg + + * print-rtl.c (print_rtx): Call PRINT_REG with second argument -1. + * config/i386/i386.c (print_reg): Abort on a virtual register + if code != -1; not if file == asm_out_file. + * config/i386/i386.h (PRINT_REG): Document meaning of CODE == -1. + (DEBUG_PRINT_REG): Delete, unused. + +2003-11-02 Andreas Schwab + + * config/ia64/fde-glibc.c (_GNU_SOURCE): Define to 1 instead of + empty to avoid conflict with the definition from configure. + +2003-11-02 Roger Sayle + + PR optimization/10817 + * ifcvt.c (noce_emit_move_insn): Improve documentation comment. + (noce_try_move): New function to optimize an if-the-else into an + unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a". + (noce_process_if_block): Attempt simplification with noce_try_move. + + * simplify-rtx.c (simplify_ternary_operation): Some minor fixes + and improvements to the optimizations of IF_THEN_ELSE expressions. + (simplify_subreg): Silence signed/unsigned comparison warning. + +2003-11-02 Richard Sandiford + + * Makefile.in (targhooks.o, reload.o): Update dependencies. + (GTFILES): Add targhooks.c. + (gt-targhooks.h): New rule; depend on s-gtype. + * target.h (direct_pool_load_p): New hook. + * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro. + (TARGET_INITIALIZER): Include it. + * targhooks.h (default_direct_pool_load_p): Declare. + (hook_bool_machine_mode_true): Declare. + * targhooks.c: Include insn-config.h, recog.h, ggc.h and + gt-targhooks.h. + (pool_symbol): New variable. + (default_direct_pool_load_p): New function. + (hook_bool_machine_mode_true): New function. + * reload.c: Include target.h. + (find_reloads): If an alternative will force a constant into memory, + count an extra reload if constant pool symbols are not valid + addresses. If an alternative uses memory to move values between + registers, count the move as two reloads rather than one. + * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define. + * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document. + +2003-11-02 Eric Botcazou + + PR optimization/12799 + * postreload.c (reload_cse_move2add): Generate the add2 + patterns manually. + +2003-11-02 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: + Return 0 for all complex modes whose size is lesser or equal to + a word. Add a ??? comment for the condition used with 16-byte + aligned modes. + +2003-11-01 Kelley Cook + + * .cvsignore: Remove c-parse* and tradcif.c. + * objc/.cvsignore: Delete. + +2003-11-01 Roger Sayle + + * unwind-sjlj.c (_Unwind_GetCFA): Return (_Unwind_Word)0 instead + of NULL. + +2003-11-01 John David Anglin + + * som.h (DO_GLOBAL_DTORS_BODY): Change to C90 declaration. + + * libgcc2.c (SYMBOL__MAIN): Provide C90 declaration. + + * collect2.c (scan_libraries): Fix typos. + + PR preprocessor/12847 + * cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c, + cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c, + c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, + DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with + "CPP_". + +2003-11-01 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Correct + no_units calculation. + +2003-11-01 Andreas Jaeger + + * unwind-dw2.c (_Unwind_FrameState): Remove commas at end of + enumeration list. + +2003-11-01 Andreas Schwab + + * config/ia64/sysv4.h (SDATA_SECTION_FUNCTION): Update to C90 + prototypes. + (SBSS_SECTION_FUNCTION): Likewise. + +2003-11-01 Andreas Jaeger + + * Makefile.in (GCC_CFLAGS): Add @WERROR@ for target files. + +2003-11-01 Andreas Tobler + + * config/rs6000/sysv4.h (EXTRA_SECTION_FUNCTIONS): Update to C90 + prototypes. + +2003-11-01 Andreas Jaeger + + * unwind-dw2.c (_Unwind_FindEnclosingFunction): Constify variable. + (uw_frame_state_for): Constify variables. + (extract_cie_info): Constify first argument. + + * unwind-dw2-fde-darwin.c: Adjust prototype of + _Unwind_Find_registered_FDE for recent changes. + (examine_objects): Constify return value and local variable result. + (_Unwind_Find_FDE): Constify return value and local variable ret. + +2003-10-31 Per Bothner + + * c-opts.c (finish_options): Change to returns boolean - false iff + the call to cpp_find_main_file fails. + (c_common_init): Skip preprocess_file if finish_options failed. + (c_common_parse_file): Break if finish_options failed. + Fixes PR preprocessor/12545. + +2003-10-31 John David Anglin + + * aclocal.m4: Blacklist ultrix* for mmap file. + * configure: Rebuilt. + + * function.c (assign_parms): Add ATTRIBUTE_UNUSED to variable + reg_parm_stack_space. + * toplev.c (default_get_pch_validity): Fix warning. + + * vax.c: Include toplev.h. + (vax_init_libfuncs): Fix typo (umod). + * vax.h (ASM_COMMENT_START): Define. + (PRINT_OPERAND): Fix warning when HOST_WIDE_INT is a long long. + +2003-10-31 Roger Sayle + + PR middle-end/11968 + * expr.c (expand_expr ): Remove inappropriate and + confusing comment; distributivity isn't handled in expand_expr. + * fold-const.c (extract_muldiv_1 ): Allow overflow + in distributivity, if wrap-around semantics are specified with + -fwrapv. + +2003-11-01 Alan Modra + + PR 12315 + * final.c (profile_function): Allow for NULL svrtx. + +2003-10-31 John David Anglin + + * pa.c (pa_select_section): Use new style declaration. + * som.h (readonly_data): Likewise. + +2003-10-31 Kelley Cook + + * config/rs6000/rs6000.c: Update to C90 prototypes. + +2003-10-31 Richard Earnshaw + + PR target/7513 + * arm.h (CONDITIONAL_REGISTER_USAGE): Disable use of LR in Thumb + code. + +2003-10-31 Andreas Jaeger , + Zack Weinberg + + + * crtstuff.c (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + * unwind-dw2-fde.h (struct fde_vector): + Constify 'orig_data' and 'array' fields. + (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + (get_cie, next_fde, _Unwind_Find_FDE): Constify arguments, + return values, and casts of type fde *, struct dwarf_fde *, + and struct dwarf_cie *. + * unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases) + (__deregister_frame_info, __deregister_frame_info_bases): + Constify void * argument. + (get_cie_encoding, ): Constify struct dwarf_cie * argument. + (get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare) + (fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert) + fde_split, SWAP, frame_downheap, frame_heapsort) + (classify_object_over_fdes, add_fdes, linear_search_fdes, + binary_search_unencoded_fdes, binary_search_single_encoding_fdes, + binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE): + Constify arguments, local variables, return values, and casts + of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *. + Use const pointer types in sizeof expressions, for clarity. + * unwind-dw2-fde-glibc.c + (_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value. + (struct unw_eh_callback_data): Constify 'ret' field. + +2003-10-31 Fariborz Jahanian + David Edelsohn + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): New. + (function_arg): Call it. + (rs6000_function_value): Widen integral return value to mode based + on TARGET_32BIT, not word_mode. + * config/rs6000/rs6000.h (PROMOTE_MODE): Likewise. + (UNITS_PER_ARG): New. + (RS6000_ARG_SIZE): Use it. + +2003-10-31 Gerald Pfeifer + + * .cvsignore: No longer ignore gengtype-lex.c, gengtype-yacc.c, + and gengtype-yacc.h. + +2003-10-31 Richard Earnshaw + + PR optimization/8896 + * postreload.c (reload_combine): Check that REGY doesn't die in an + insn of the form (set (regx) (plus (regx) (regy))), ie REGX != REGY. + +2003-10-31 Josef Zlomek + + PR/10239 + * cfgrtl.c (delete_insn): Decrease LABEL_NUSES for all REG_LABEL notes. + +2003-10-31 Josef Zlomek + + PR/11640 + * cfgrtl.c (try_redirect_by_replacing_jump): Move jump + immediatelly before BARRIER. + +2003-10-31 Kelley Cook + + * Makefile.in (STRICT2_WARN): Add -Wold-style-definition. + +2003-10-31 Richard Earnshaw + + PR target/11271 + * reload.c (find_reloads_address): Handle any register in + (PLUS (PLUS (REG) (REG)) (CONST_INT). + +2003-10-31 Richard Earnshaw + + * ggc-page.c (ggc_pch_read): Wrap call to poison_pages in + ENABLE_GC_CHECKING not in GGC_POISON. + +2003-10-31 Nathanael Nerode + + PR bootstrap/9863 + * configure.in: Bail out if awk is missing. + * configure: Regenerate. + + PR ada/12761 + * Makefile.in: Move default definitions of X_ADA_CFLAGS, + T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS from ada/Make-lang.in to here. + +2003-10-30 Richard Henderson + + * c-objc-common.c (c_tree_printer): Handle types correctly. + Factor code a bit. + +2003-10-30 Kelley Cook + + * value-prof.c, web.c: Update to C90. + +2003-10-30 Eric Christopher + + * function.c (purge_addressof_1): Add case for REG_RETVAL + notes when modes are unequal. + +2003-10-31 Jan Hubicka + + * i386-modes.def: Add XFmode format adjustment. + +2003-10-30 Jan Hubicka + + * real.c (encode_ieee_extended): Back out previous patch. + +2003-10-30 Jan Hubicka + + * real.c (encode_ieee_extended): Initialize whole array. + * reg-stack.c (move_for_stack_reg0: Use always XFmode. + * i386-modes.def: Change definitions of TFmode and XFmode. + * i386.c (classify_argument): Rename TFmodes to XFmodes; add new TFmode + code. + (construct_container): Allow constructing of TFmode integer containers. + (ix86_return_in_memory): XFmode is not returned in memory. + (init_ext_80387_constants): Always use XFmode. + (print_operand): Likewise. + (ix86_prepare_fp_compare_regs): Likewise. + (split_to_parts): Deal with TFmode. + (split_long_move): Simplify. + (ix86_init_mmx_sse_builtins): Add __float80, __float128. + (ix86_memory_move_cost): Do not confuse TFmode. + * i386.h (LONG_DOUBLE_TYPE_SIZE): Set to 96. + (IS_STACK_MODE): TFmode is not stack mode. + (HARD_REGNO_NREGS, CLASS_MAX_NREGS): Deal nicely with XFmode. + (VALID_SSE_REG_MODE): Allow TFmode. + (VALID_FP_MODE_P): Disallow TFmode. + (VALID_INT_MODE_P): Allow TFmode in 64bit mode. + * i386.md (TFmode patterns): Kill. + (movtf, motf_rex64): New patterns. + +2003-10-30 Richard Sandiford + + * config/mips/mips.md (adddi3): Fix typo in mips16 stack pointer code. + +2003-10-30 Richard Sandiford + + * config/mips/mips.md (mov_lwl): Use memory_operand where appropriate. + (mov_lwr, mov_swl, mov_swr): Likewise. + (mov_ldl, mov_ldr, mov_sdl, mov_sdr): Likewise. + +2003-10-30 Richard Sandiford + + * config/mips/mips.c (mips_global_pointer): Don't try to use $25. + +2003-10-30 Richard Henderson + + * config/mips/mips.c (mips_build_builtin_va_list): Use runtime + test for irix6 rather than preprocessor test. + +2003-10-30 Richard Henderson + + * cppcharset.c (one_utf8_to_utf16): Initialize 's' to silence warning. + +2003-10-30 Ulrich Weigand + + * config/s390/s390.c (struct machine_function): Use save_return_addr_p + as a general flag that the return address register needs to be saved, + not necessarily because of __builtin_return_addr (0). + (s390_split_branches): Remove TEMP_REG and TEMP_USED arguments, + remove special handling of zSeries machines. + (s390_optimize_prolog): Remove TEMP_USED argument, treat the return + register as a regular register on zSeries machines. + (s390_reorg): Adjust calls to s390_split_branches and + s390_optimize_prolog. + (s390_frame_info): On zSeries machines, do not assume the return + register is always used. Update regs_ever_live with current data + for the special registers. + (s390_emit_epilogue): Use save_return_addr_p to determine whether + the return register was saved. + * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Do not mark + RETURN_REGNUM fixed on zSeries machines. + (REG_ALLOC_ORDER): Use RETURN_REGNUM last. + * config/s390/s390.md ("*doloop_si"): Handle branch overflow + via ahi-jgne pair on zSeries machines. + ("*doloop_di"): Likewise. + ("*doloop_di_long"): Remove. + +2003-10-30 Richard Earnshaw + + * arm.c (arm_override_options): Revert change of arm_constant_limit + when optimizing for size. + +2003-10-29 Richard Henderson + + * fold-const.c (fold_single_bit_test): Convert the input to the + operational intermediate type. + +2003-10-29 Richard Henderson + + * builtins.c (std_build_builtin_va_list): New. + * expr.h (std_build_builtin_va_list): Declare. + * defaults.h (BUILD_VA_LIST_TYPE): New. + * system.h (BUILD_VA_LIST_TYPE): Poison. + * target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New. + * target.h (struct gcc_target): Add build_builtin_va_list. + * tree.c (build_common_tree_nodes_2): Use it. + + * config/alpha/alpha-protos.h, config/alpha/alpha.c, + config/alpha/alpha.h, config/alpha/unicosmk.h, + config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h, + config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, + config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h, + config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, + config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c, + config/mips/mips.h, config/rs6000/rs6000-protos.h, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, + config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, + config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h, + config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, + config/xtensa/xtensa.h: Rename foo_build_va_list to + foo_build_builtin_va_list; make it static. Define + TARGET_BUILD_BUILTIN_VA_LIST. Remove BUILD_VA_LIST_TYPE. + Update protos. + + * config/i386/i386.c (ix86_expand_carry_flag_compare): Make static. + * config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove. + +2003-10-29 James E Wilson + + * recog.c (asm_operand_ok): Add missing break after case 'X'. + Change if statements to else if statements in default case. + (extract_constrain_insn_cached): Fix misspelling of constrain_operands + in comment. + (constrain_operands_cached): Likewise. + (constrain_operands): Change if statements to else if statements in + default case. + * reload.c (find_reloads): Likewise. + +2003-10-29 Richard Henderson + + * config/m68k/m68k.c (notice_update_cc): Clear cc status for + shifts and rotates. + +2003-10-30 Alan Modra + + * config/rs6000/rs6000.md: Remove duplicate pattern. + +2003-10-29 Hans-Peter Nilsson + + * real.c (do_divide): Initialize result with a 0. + + * configure.in : Look for + first. AC_DEFINE HAVE_VALGRIND_MEMCHECK_H + if it exists. + * configure, config.in: Regenerate. + * ggc-common.c [ENABLE_VALGRIND_CHECKING && + HAVE_VALGRIND_MEMCHECK_H]: Include . Use + #elif for other alternatives. + * ggc-page.c: Ditto. + * ggc-zone.c: Don't assume ; instead copy + include structure from ggc-common.c. + +2003-10-29 John David Anglin + + * pa-linux.h (ASM_OUTPUT_ADDR_VEC_ELT): Use label in big switch ELTs. + (ASM_OUTPUT_ADDR_DIFF_ELT): Use label difference in big switch ELTs. + * pa.c (pa_adjust_insn_length): Check for btable branches using + attribute TYPE_BTABLE_BRANCH. + (pa_reorg): Simplify. + * pa.h (CASE_VECTOR_MODE): Change big switch mode to SImode. + (ASM_OUTPUT_ADDR_VEC_ELT): As above. + (ASM_OUTPUT_ADDR_DIFF_ELT): As above. + * pa.md (btable_branch): New instruction type. + (in_branch_delay, in_nullified_branch_delay, in_call_delay): Disallow + btable branches. + (define_delay): Add btable branches to insn types that may have an + insn in the delay position. + (Z2, Z3): Add btable branch to list. + Simplify unamed pattern set copy pic_label_operand to register. Add + PA 2.0 variant. + (short_jump): New jump for use in branch tables. + (casesi, casesi0): Revise for new branch table formats. + (casesi32, casesi32p, casesi64p): New casesi patterns. + (indirect_jump): Move. + +2003-10-29 David Edelsohn + + * config/rs6000/rs6000.h (UNITS_PER_WORD): Revert to + !TARGET_POWERPC64. + (UNITS_PER_GPR_WORD): Delete. + (HARD_REGNO_NREGS): Revert to UNITS_PER_WORD. + (HARD_REGNO_MODE_OK): Same. + (CLASS_MAX_NREGS): Same. + +2003-10-29 John David Anglin + + * pa.h (ASM_COMMENT_START): Define. + +2003-10-29 Zack Weinberg + + * genmodes.c (complete_mode): Record MODE_CC, MODE_INT, + MODE_FLOAT, and MODE_PARTIAL_INT modes as having one + component, not zero. + +2003-10-29 Andreas Schwab + + * config/ia64/t-ia64 (LIB2ADDEH): Add $(srcdir)/gthr-gnat.c. + +2003-10-29 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]: + Never return 1 for complex integral modes whose size is lesser or + equal to a word. + (function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode + in the comment. + (function_arg_advance) [TARGET_ARCH64]: Don't special-case complex + modes. + (sparc_va_arg) [TARGET_ARCH64]: Handle any types whose size is + greater than 16 bytes by reference. + +2003-10-29 Richard Kenner + + * config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE, + not TARGET_ILP32. + (ia64_initialize_trampoline): Use globalize_label target call. + +2003-10-29 Andreas Schwab + + * doc/install.texi (Building): Add a sentence about building Ada + for a canadian cross. + +2003-10-28 Zack Weinberg + + * config/ia64/ia64.c (cmptf_libfunc): New static. + (ia64_expand_compare): Add logic to open-code calls to + _U_Qfcmp for TFmode comparisons. + (ia64_hpux_init_libfuncs): Initialize cmptf_libfunc. + Set libfuncs for TFmode eq/ne/gt/ge/lt/gt to 0; these should + never be generated anymore. + * config/ia64/ia64.md (cmptf): New expander. + +2003-10-28 Zack Weinberg + + * ia64.md (UNSPEC_SETF_EXP,UNSPEC_FR_SQRT_RECIP_APPROX): New constants. + (*sqrt_approx): New instruction pattern for approximate square roots. + (*setf_exp_xf): New instruction pattern for exponentiation. + (*maddxf4_alts_truncsf): New instruction pattern for truncation. + (sqrtsf2_internal_thr): New define_and_split implementing + throughput-optimized inline calculation of SFmode square root. + (sqrtdf2_internal_thr): Likewise for DFmode. + (sqrtxf2_internal_thr): Likewise for XFmode. + (sqrtsf2, sqrtdf2, sqrtxf2): New expanders to choose between + latency- and throughput-optimized square root algorithms. + * ia64.h (MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, + TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT): + New macros. + (TARGET_SWITCHES): Add -minline-sqrt-min-latency and + -minline-sqrt-max-throughput. + * ia64.c (ia64_override_options): If both -minline-sqrt-min-latency + and -minline-sqrt-max-throughput are given, notify the user + that both options cannot be used simultaneously. + If -minline-sqrt-min-latency is given, notify the user that + this mode is not yet implemented. + (rtx_needs_barrier): Reformat initial comment to obey + 72-character width limit. Support UNSPEC_SETF_EXP and + UNSPEC_FR_SQRT_RECIP_APPROX. + +2003-10-29 Alan Modra + + * config/rs6000/rs6000.md (movdf_softfloat64): Allow dummy ctr,ctr + moves. + +2003-10-28 Franz Sirl + + PR target/11598 + PR libgcj/10610 + * config/rs6000/sysv4.h (PREFERRED_STACK_BOUNDARY): New macro. + +2003-10-28 Richard Earnshaw + + * arm.c (arm_output_epilogue): When using a frame pointer, don't emit + an extra stack adjustment insn if the stack pointer is already + pointing at the right place. + (use_return_insn): Allow a return insn to be used when we have a + frame pointer if the stack pointer is in the right place. + (output_return_instruction): Handle it. + +2003-10-28 Andreas Jaeger + + * ggc-zone.c (check_cookies): Add missing variable. + Add void to prototypes. + +2003-10-27 Kaveh R. Ghazi + + * config/mips/irix6-libc-compat.c (inet_makeaddr): Prototype. + * crtstuff.c (__do_global_ctors_1): Move prototype. + * unwind-dw2.c (NO_SIZE_OF_ENCODED_VALUE): Define when + appropriate. + * unwind-sjlj.c (_Unwind_GetCFA, _Unwind_FindEnclosingFunction): + Mark parameter with __attribute__((unused)). + +2003-10-27 Zack Weinberg + + * c-decl.c (pushdecl): Clarify comment. + +2003-10-27 Arnaud Charlet + + * doc/install.texi: Update instructions for Ada cross builds + + PR ada/5909: + * doc/sourcebuild.texi: Document Ada test suite. + +2003-10-27 Stephane Carrez + + * config/m68hc11/m68hc11.c: Convert to ISO C90. + * config/m68hc11/m68hc11-protos.h: Likewise. + +2003-10-27 Jan Hubicka + Eric Botcazou + + * toplev.c (enum dump_file_index, dump_file): Fix ordering of + webizer pass dump. + +2003-10-27 Jakub Jelinek + Jan Hubicka + + * reload1.c (struct elim_table): Change offset, initial_offset and + previous_offset fields to HOST_WIDE_INT. + (offsets_at): Change from int to HOST_WIDE_INT. + (reload): Adjust offsets_at initialization. + (eliminate_regs_in_insn): Change type of offset to HOST_WIDE_INT. + (verify_initial_elim_offsets): Change type of t to HOST_WIDE_INT. + * config/i386/i386.c (ix86_compute_frame_layout): Change offset type + to HOST_WIDE_INT. Don't save regs using mov for huge frame sizes + if TARGET_64BIT. + (pro_epilogue_adjust_stack): New function. + (ix86_expand_prologue, ix86_expand_epilogue): Use it. + * config/i386/i386.md (pro_epilogue_adjust_stack): Remove. + (pro_epilogue_adjust_stack_1): Remove * in front of name. + (pro_epilogue_adjust_stack_rex64): Handle -2147483648 properly. + (pro_epilogue_adjust_stack_rex64_2): New insn. + + * config/i386/i386.c (ix86_expand_epilogue): Fix comment typo. + + * config/i386/i386.c (ix86_expand_call): Replace 40 with + FIRST_REX_INT_REG + 3 /* R11 */. + +2003-10-26 Richard Henderson + + * config/alpha/alpha.md (attr cannot_copy): New. + (call_osf_2_er, call_value_osf_2_er, ldgp_er_1, ldgp_er_2, + prologue_ldgp_er_2, prologue_ldgp_1): Set it. + * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Test it. + +2003-10-26 Daniel Berlin + + * ggc-zone.c: New file, zone allocating collector. + * configure: Accept zone option for --with-gc + * configure.in: Ditto. + * ggc.h (ggc_pch_count_object): Pass bool indicating + stringiness. Update all callers. + (ggc_pch_alloc_object): Ditto. + (ggc_pch_write_object): Ditto. + (ggc_alloc_rtx): Use typed allocation, since all RTX's are of a single + type. + (ggc_alloc_rtvec): Ditto. + (ggc_alloc_tree): Use zone allocation, since some things using this macro + aren't a single typecode. + * ggc-none.c (ggc_alloc_typed): New function. + (ggc_alloc_zone): Ditto. + * ggc-page.c: Ditto on both functions. + +2003-10-26 Gunther Nikl + + * config/m68k/m68k.c (m68k_compute_frame_layout): Ensure FPU related + frame information is always valid. + (m68k_output_function_prologue): Remove superfluous TARGET_68881 + test; fix formatting. + +2003-10-26 Gunther Nikl + + * config/m68k/m68k.c (m68k_compute_frame_layout): Swap reg_mask and + reg_rev_mask computation. + (m68k_output_function_prologue): Fix usage of current_frame (one typo + and one missing); use reg_rev_mask not reg_mask. + (m68k_output_function_epilogue): Fix usage of current_frame; + use fpu_rev_mask not fpu_mask. + +2003-10-26 Bernardo Innocenti + + * config/m68k/m68k.c (m68k_output_function_prologue): Eliminate + num_saved_regs, use current_frame.reg_no instead. + +2003-10-26 Bernardo Innocenti + Paul Dale + + * doc/extend.texi (interrupt_handler): Add m68k to the + list of processors implementing it. + * doc/invoke.texi (-msep-data): Document new m68k option. + (-mno-sep-data): Likewise. + (-mid-shared-library): Likewise. + (-mno-id-shared-library): Likewise. + (-mshared-library-id): Likewise. + +2003-10-26 Andreas Jaeger + + * unwind-dw2.c (_Unwind_GetGR): Avoid warning about unsigned + comparison. + (_Unwind_SetGR): Likewise. + +2003-10-26 Ottavio Campana + + PR target/12690 + * config/i386/mmintrin.h (_mm_set1_pi8): Fix comment. + +2003-10-26 Gunther Nikl + + * config/m68k/m68k.c (m68k_output_function_prologue): Move front + comment from here to... + (m68k_save_reg): ...here. Fix comment formatting. + (m68k_output_function_prologue): Fix comment formatting. + (m68k_output_function_epilogue): Likewise. + (const_method): Likewise. + +2003-10-26 Kazu Hirata + + * toplev.c (default_get_pch_validity): Guard the use of + target_options with #ifdef TARGET_OPTIONS. + (default_pch_valid_p): Likewise. + +2003-10-26 Andreas Jaeger + Zack Weinberg + Andreas Tobler + + * dwarf2out.c (output_cfi): Use HOST_WIDE_INT_PRINT. + (output_die): Likewise. + (print_die): Likewise. + +2003-10-26 Andreas Jaeger + + * tree.h (dwarf2out_def_cfa, dwarf2out_args_size, + dwarf2out_reg_save, new_loc_descr): Update prototypes for recent + dwarf2out.c change. + + * toplev.c (default_pch_valid_p): Fix warning. + +2003-10-25 Roger Sayle + + * simplify-rtx.c (simplify_replace_rtx): Avoid allocating duplicate + RTL nodes. If an operator's operands are unchanged, return the + original argument unchanged. + +2003-10-26 Graham Stott + + Fix bootstrap failure. + * expmed.c (store_bit_field): Don't compare bitsize against + modes with zero bit-size. + + (extract_bit_field): Likewise + +2003-10-25 Jan Hubicka + + * dwarf2out.c (dw_cfi_oprnd_struct): Offset is HOST_WIDE_INT. + (cfa_loc): Likewise. + (reg_save, stack_adjust_offset, queue_reg_save): Replace long by + HOST_WIDE_INT. + (args_size, old_args_size): change type to HOST_WIDE_INT. + (dwarf2out_def_cfa, dwarf2out_args_size, + dwarf2out_reg_save, new_loc_descr): offset is HOST_WIDE_INT. + (dw_val_struct): integers, unsigneds and offsets are HOST_WIDE_INT. + (add_AT_int, add_AT_unsigned, att_AT_offset, AT_int, AT_unsigned, + AT_offset): Use HOST_WIDE_INT. + (based_loc_descr): offset is HOST_WIDE_INT. + (add_data_member): Likewise. + (add_const_value_attribute): Simplify. + +2003-10-25 Richard Henderson + + * config/i386/i386.c (ix86_eax_live_at_start_p): New. + (ix86_expand_prologue): Save and restore eax around stack probe + if it's live. + +2003-10-25 Jan Hubicka + + * cppcharset.c (one_utf8_to_utf32): Initialize 's' to silence warning. + +2003-10-25 Eric Botcazou + + PR target/12712 + * reg-stack.c (convert_regs_1): Create an arbitrary input stack + if the block has no predecessors. + (convert_regs_2): Document the problem with successors whose + only predecessor is the block to be processed. + (convert_regs): Don't create the arbitrary input stack here. + +2003-10-24 Zack Weinberg + + * genmodes.c (struct mode_data): Add contained and next_cont + fields. + (complete_mode): Maintain linked list of modes that have a + given component. + (emit_mode_unit_size): Delete. + (emit_mode_nunits): New. + (emit_insn_modes_c): Update to match. + (emit_mode_adjustments): Propagate size and alignment + adjustments from component modes to their containers. + * machmode.h (mode_unit_size): Delete. + (mode_nunits): New. + (GET_MODE_NUNITS): Just return the value in the table. + (GET_MODE_UNIT_SIZE): Compute using GET_MODE_INNER and + GET_MODE_SIZE. + * expmed.c (store_bit_field, extract_bit_field): Can use a + plain move instruction if bitsize >= GET_MODE_BITSIZE of + destination/source mode, respectively. + * varasm.c (assemble_real): Write out the full size of the + constant, not just its bitsize. + (output_constant): Honor TYPE_MODE of TREE_REAL_CSTs. + + * config/ia64/ia64-modes.def: Define XFmode as well as TFmode. + Use ADJUST_BYTESIZE and ADJUST_ALIGNMENT to set size and + alignment of XF and TF modes in compliance with ia64 ABIs. + Can now hardwire the format of both modes. + * config/ia64/ia64.c: Change TFmode to XFmode wherever appropriate. + (general_tfmode_operand, destination_tfmode_operand) + (tfreg_or_fp01_operand, spill_tfmode_operand): Rename to + general_xfmode_operand, destination_xfmode_operand, + xfreg_or_fp01_operand, spill_xfmode_operand respectively. + (ia64_init_builtins): Make TYPE_PRECISION of fpreg_type + and float80_type be 96 so they get XFmode. Use !TARGET_HPUX, + not INTEL_EXTENDED_IEEE_FORMAT, to decide how to define + __float128. + * config/ia64/ia64.h: Default TARGET_HPUX to 0. + Change TFmode to XFmode wherever appropriate. Remove all + references to INTEL_EXTENDED_IEEE_FORMAT. + (LONG_DOUBLE_TYPE_SIZE): Varies with TARGET_HPUX. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define (always 96). + (PREDICATE_CODES): Update to match function renames. + * config/ia64/ia64.md: Change TF to XF throughout; rename all + patterns to match. Remove all references to + INTEL_EXTENDED_IEEE_FORMAT. Update predicate calls to match + function renames. + * config/ia64/ia64-protos.c: Update all prototypes to match + renamed functions. + * config/ia64/hpux.h: Redefine TARGET_HPUX to 1. + Remove all references to INTEL_EXTENDED_IEEE_FORMAT. + * config/ia64/lib1funcs.asm: Add __divxf3 as new name for + __divtf3; keep old name for backward compatibility. + (L__compat): New section providing forwarding stubs for + __fixtfti, __fixunstfti, __floattitf. + * config/ia64/t-ia64: Add __compat to LIB1ASMFUNCS. + +2003-10-24 Geoffrey Keating + + PR 10757 + * c-pch.c: Include target.h. Improve comments. + (struct c_pch_validity): Add target_data_length. + (pch_init): Add target's validity data. + (c_common_valid_pch): Check target's validity data. + * target-def.h (TARGET_GET_PCH_VALIDITY): New. + (TARGET_PCH_VALID_P): New. + (TARGET_INITIALIZER): Add new fields. + * target.h: Include tm.h. + (struct gcc_target): Add get_pch_validity, pch_valid_p. + * toplev.h (default_get_pch_validity): New prototype. + (default_pch_valid_p): New prototype. + * toplev.c (default_get_pch_validity): New routine. + (default_pch_valid_p): New routine. + * Makefile.in (TARGET_H): Add TM_H. Replace all users of + target.h with $(TARGET_H). + (c-pch.o): Add TARGET_H. + * doc/tm.texi (PCH Target): New node. + (TARGET_GET_PCH_VALIDITY): Document. + (TARGET_PCH_VALID_P): Document. + +2003-10-24 Kelley Cook + + * Makefile.in: Define a vpath for %.texi. Remove explicit $(docdir) + and $(docdir)/include from any *.texi dependencies. + ($(docobjdir)/%.dvi): Depend on stmp-docobjdir. + ($(docobjdir)/%.1): Depend on .pod instead of .texi. + ($(docobjdir)/%.7): Likewise. + (%.pod): New implicit rule. + (cpp.pod): New dependency only rule. + (gcc.pod): New intermediate rule with dependencies and commands. + (gfdl.pod): Likewise. + (fsf-funding.pod): Likewise. + +2003-10-24 Nathanael Nerode + + * fixinc/mkfixinc.sh: Remove special cases for svr4 and ptx, and + related code. + * fixinc/fixinc.ptx: Remove. + * fixinc/fixinc.svr4: Remove. + +2003-10-24 Ulrich Weigand + + * config/s390/s390.c (load_multiple_operation): Allow both SImode + and DImode if word_mode is DImode. + (store_multiple_operation): Likewise. + * config/s390/s390.md ("load_multiple", "store_multiple"): Likewise. + ("*load_multiple_di"): Allow only if word_mode == DImode. + ("movqi"): Use LLGC whenever TARGET_ZARCH. + ("fix_truncdfsi2"): Fix incorrect temporary size. + ("fix_truncsfsi2"): Likewise. + ("*bras_r", "*brasl_r", "*basr_r"): Remove predicate and constraint + string for function return value operand. + ("*bras_tls", "*brasl_tls", "*basr_tls"): Likewise. + +2003-10-24 Joseph S. Myers + + * c-parse.in (array_declarator): Use expr_no_commas. + Fixes PR c/11943. + +2003-10-24 Richard Sandiford + + * config/mips/linux.h: Wrap MD_FALLBACK_FRAME_STATE_FOR and + associated includes in #ifndef inhibit_libc. + +2003-10-24 Roger Sayle + + * doc/libgcc.texi: Document some more of the libgcc API. + +2003-10-24 Richard Earnshaw + + * arm.c (arm_rtx_costs_1, case TARGET_THUMB): Adjust costs for + comparing a constant with small negative numbers and add costing + for constants in conjunction with AND. + (note_invalid_constants): Tidy previous change. + (thumb_cmp_operand): Tidy. + (thumb_cmpneg_operand): New function. + * arm.h (CONDITIONAL_REGISTER_USAGE): Don't use HI regs if optimizing + for size. + (FIRST_LO_REGNUM, FIRST_HI_REGNUM, LAST_HI_REGNUM): Define. + (PREDICATE_CODES): Add thumb_cmpneg_operand. + * arm.md (cbranchsi4): Convert to define_expand. Handle comparison + with a negative constant. + (cbranchsi4_insn): Matcher for cbranchsi4. + (cbranchsi4_scratch): Similar, but a scratch is available for + handling negative constants. + (movsi_cbranchsi4): New pattern. + (tstsi3_cbranch): Renamed from andsi3_cbranch_scratch, remove scratch + and use the TST instruction. + (andsi3_cbranch, orrsi3_cbranch, xorsi3_cbranch, cbranchne_decr1) + (addsi3_cbranch, subsi3_cbranch): Ensure that register preferencing + cannot see high regs or memory alternatives. + (bicsi3_cbranch_scratch, bicsi3_cbranch): New patterns. + +2003-10-24 Richard Earnshaw + + * arm.c (note_invalid_constants): Try to extract the constant + pool value using avoid_constant_pool_reference; only use + get_pool_constant if that returns the original reference. + +2003-10-24 Jan Hubicka + + PR c++/12624 + * varasm.c (notice_global_symbol): Disqualify global registers. + +2003-10-23 Roger Sayle + + PR middle-end/11414 + * loop.c (load_mems): Use redirect_jump to forward jumps from + the original loop end label to the new "loop sink" block's label. + +2003-10-23 Roger Sayle + + PR middle-end/12705 + * optabs.c (expand_binop): When expanding complex operations + inline, always calculate result into a new temporary register. + Minor code clean-ups. + +2003-10-24 Rainer Orth + + * objc/lang-specs.h: Handle -print-objc-runtime-info. + * doc/invoke.texi (Objective-C Dialect Options): Document it. + +2003-10-24 Danny Smith + + * config/i386/cygwin.asm: Add copyright notice. Add comment + on why this code is needed. + +2003-10-23 Kazu Hirata + + * config/h8300/clzhi2.c: Fix warnings. + * config/h8300/ctzhi2.c: Likewise. + * config/h8300/fixunssfsi.c: Likewise. + * config/h8300/parityhi2.c: Likewise. + * config/h8300/popcounthi2.c: Likewise. + +2003-10-23 James E Wilson + + * gcc.c (option_map): Delete --target and --use-version. + +2003-10-23 Fariborz Jahanian + David Edelsohn + + * config/rs6000/rs6000.h (UNITS_PER_WORD): Use TARGET_32BIT, not + TARGET_POWREPC64. + (UNITS_PER_GPR_WORD): Define. + (HARD_REGNO_NREGS): Use UNITS_PER_GPR_WORD. + (HARD_REGNO_CALL_PART_CLOBBERED): Define. + (HARD_REGNO_MODE_OK): Use UNITS_PER_GPR_WORD. + (CLASS_MAX_NREGS): Use UNITS_PER_GPR_WORD. + * config/rs6000/rs6000.c (function_arg): Generate PARALLEL for + DFmode and DImode in 32-bit ABI / 64-bit computation mode. + (rs6000_emit_prologue): Select reg_mode and reg_size using + TARGET_32BIT, not TARGET_POWERPC64. + (rs6000_function_value): Generate PARALLEL for DImode in 32-bit + ABI / 64-bit computation mode + +2003-10-22 Andrew Haley + + * toplev.c (output_file_directive): Allow for null input_name. + +2003-10-22 Waldek Hebisch + + * config/i386/i386.c (classify_argument): Handle SET_TYPE. + +2003-10-22 Chris Demetriou + + * configure.in: In --enable-generated-files-in-srcdir option + handling, fix default case handling. + * configure: Regenerate. + +2003-10-22 Phil Edwards + + * config.gcc: Update *-*-vxworks* generic hook and comments. + (arm-wrs-vxworks, i[4567]86-wrs-vxworks, mips-wrs-vxworks, + mips-wrs-windiss, sh-wrs-vxworks): New stanzas. + * genmultilib: Allow the MULTILIB_OSDIRNAMES to be mapped directly. + * config/svr4.h (SWITCH_TAKES_ARG): Undefine it before redefining it. + * config/windiss.h: New file. + * config/arm/t-vxworks: New file. + * config/arm/vxworks.h: New file. + * config/i386/t-vxworks: New file. + * config/i386/vxworks.h: New file. + * config/mips/t-vxworks: New file. + * config/mips/vxworks.h: New file. + * config/mips/windiss.h: New file. + * config/sh/t-vxworks: New file. + * config/sh/vxworks.h: New file. + +2003-10-22 Kazu Hirata + + * config/h8300/h8300.c (h8300_output_function_epilogue): Remove. + (h8300_saveall_function_p): New. + (h8300_insert_attributes): Insert the saveall attribute if + #pragma saveall is specified. + (h8300_attribute_table): Add saveall. + (TARGET_ASM_FUNCTION_EPILOGUE): Remove. + * doc/extend.texi: Mention the saveall attribute. + +2003-10-22 Joseph S. Myers + + * c-typeck.c (pedantic_lvalue_warning): Unconditionally warn of + deprecation of casts as lvalues. + * fixinc/inclhack.def (obstack_lvalue_cast): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/obstack.h: New test. + +2003-10-22 Andreas Schwab + + PR target/12676 + * config/m68k/m68k.c (output_addsi3): Fix range check to work on + LP64 platforms. + +2003-10-22 Jan Hubicka + + * dwarf2out.c (dwarf2out_abstract_function): Use DW_AT to check + presence of DW_AT_inline. + (gen_subprogram_die): Likewise; do not abort instead of emitting + DW_AT_not_inline. + +2003-10-22 Jan Hubicka + + * cgraph.c (cgraph_function_possibly_inlined_p): Be conservative when + global info is not ready. + +2003-10-22 Kazu Hirata + + * doc/extend.texi: Mention H8S wherever H8/300H is mentioned. + +2003-10-22 Ulrich Weigand + + * config/s390/s390.md ("movstr_short_64", "movstr_short_31"): Merge ... + ("*movstr_short"): ... into this insn pattern. + ("movstr_short"): New expander. + ("*movstr_long_64"): Rename from "movstr_long_64", simplify. + ("*movstr_long_31"): Rename from "movstr_long_31", simplify. + ("movstr_long"): New expander. + ("clrstr_short_64", "clrstr_short_31"): Merge ... + ("*clrstr_short"): ... into this insn pattern. + ("clrstr_short"): New expander. + ("*clrstr_long_64"): Rename from "clrstr_long_64", simplify. + ("*clrstr_long_31"): Rename from "clrstr_long_31", simplify. + ("clrstr_long"): New expander. + ("cmpmem_short_64", "cmpmem_short_31"): Merge ... + ("*cmpmem_short"): ... into this insn pattern. + ("cmpmem_short"): New expander. + ("*cmpmem_long_64"): Rename from "cmpmem_long_64". + ("*cmpmem_long_31"): Rename from "cmpmem_long_31". + ("cmpmem_long"): New expander. + * config/s390/s390.c (s390_expand_movstr): Use new expanders. + (s390_expand_clrstr): Likewise. + (s390_expand_cmpmem): Likewise. + +2003-10-22 Mark Mitchell + + * c-pch.c (struct c_pch_validity): Add pch_init field. + (pch_init): Set it. + (c_common_valid_pch): Check it. + +2003-10-22 David Taylor + + PR debug/12500 + * dbxout.c (dbxout_typedefs): Use COMPLETE_OR_VOID_TYPE_P. + +2003-10-22 Richard Kenner + + * config/alpha/alpha.c (function_value [ENABLE_CHECKING]): Don't call + alpha_return_in_memory if no VALTYPE specified. + +2003-10-22 Jan Hubicka + + PR debug/12389 + * Makefile.in (dwarf2out.o): Depend on cgraph.h. + * cgraph.c (cgraph_function_possibly_inlined_p): New function. + * cgraph.h (cgraph_function_possibly_inlined_p): Declare. + (cgraph_global_info): Add flag inlined + * dwarf2out.c (gen_subprogram_die, gen_decl_die): Use + cgraph_function_possibly_inded_p + * cgraphunit.c (mark_inline): Set inlined flag. + * toplev.c (rest_of_decl_compilation): Call outlining_inline_function + only for possibly inlined functions. + * c-decl.c (duplicate_decls): Never output abstract DIE representing old + body of function. + +2003-10-22 Andrew Haley + + * varasm.c (output_constructor): Make constructor annotation + conditional on ASM_COMMENT_START. + +2003-10-21 Jason Merrill + + * tree.c (get_unwidened): Check TREE_UNSIGNED on the field's type. + (get_narrower): Likewise. + + * stor-layout.c (layout_decl): Do packed field alignment for + bit-fields, too. + +2003-10-21 Eric Christopher + + * expr.c (convert_move): Use FLOAT_EXTEND for extensions. + +2003-10-21 Geoffrey Keating + + * c-pch.c: Add comments in various places. + (struct c_pch_validity): Add the lengths of various strings. + (host_machine): New static. + (target_machine): New static. + (get_ident): Bump version number. + (pch_init): Write out version, host, target validity data. + (c_common_valid_pch): Check version, host, target. + * Makefile.in (c-pch.o): Add version.h; define HOST_MACHINE and + TARGET_MACHINE. + +2003-10-21 Jason Merrill + + * tree.h (IS_EXPR_CODE_CLASS): Use strchr. + (EXPR_P): New macro. + +2003-10-21 Zack Weinberg + + * config/ia64/ia64.md (cmpxchg_acq_si): Mark operand 3 as DImode. + * config/ia64/ia64.c (ia64_expand_fetch_and_op, + ia64_expand_op_and_fetch): Make sure the REG for ar.ccv is + DImode. Use convert_move to load ar.ccv. + (ia64_expand_compare_and_swap): Likewise. + If expand_expr doesn't put 'old' and 'new' in the proper + modes, run them through convert_to_mode. + +2003-10-21 Eric Christopher + + * config/frv/frv.c (frv_adjust_field_align): Check DECL_ARTIFICIAL + for too large bitfields. + +2003-10-21 Mark Mitchell + + * Makefile.in ($(docobjdir)/%.info): Honor BUILD_INFO. + +2003-10-21 Andrew Haley + + * varasm.c (output_constructor): Annotate constructor. + +2003-10-21 Mark Mitchell + + * Makefile.in ($(DESTDIR)$(infodir)/%.info): Conditionalize chmod + on existence of destination file. + +2003-10-21 Jan Hubicka + + * haifa-sched.c (choose_ready): Initialize index. + +2003-10-21 Jason Merrill + + * tree.c (build1): Fix off-by-one error. + +2003-10-21 Robert Millan + + * config/i386/kfreebsdgnu.h: New. i386-*-kfreebsd-gnu definitions. + * config/kfreebsdgnu.h: New. *-*-kfreebsd-gnu definitions. + * config/t-kfreebsd-gnu: New. *-*-kfreebsd-gnu tmake_file. + * config.gcc: Add *-*-kfreebsd*-gnu and i[34567]86-*-kfreebsd*-gnu. + +2003-10-21 Eric Botcazou + + * web.c: Fix various comments. + +2003-10-20 Nicolas Pitre + + * config/arm/arm.c (arm_override_options): Set arm_constant_limit + to 2 instead of 1 when optimize_size is true. Gather code based on + optimize_size together. Add comment about XScale load latency. + +2003-10-21 Gunther Nikl + + * config/m68k/m68k.c (m68k_output_function_prologue): Remove + obsolete comments. + +2003-10-20 Kelley Cook + + * Makefile.in: Get parsedir and docobjdir from configure. + * configure.in: Recogonize --enable-generated-files-in-srcdir. + Pass along parsedir and docobjdir. + * configure: Regenerate. + * doc/install.texi: Document --enable-generated-files-in-srcdir. + +2003-10-20 Kelley Cook + + * Makefile.in: Define $(docdir) before the Make-lang.in fragments are + included. + +2003-10-20 Joseph S. Myers + + * c-common.c (expand_tree_builtin): Ensure creal and cimag + functions do not return lvalues. + +2003-10-20 Jason Merrill + + PR c/12553 + * tree.c (build1) : Set TREE_SIDE_EFFECTS + appropriately. + + PR c/11446 + * stor-layout.c (layout_decl): Fix alignment handling. + +2003-10-20 Joseph S. Myers + + * doc/extend.texi: Deprecate casts as lvalues. + +2003-10-20 Jan Hubicka + + * toplev.c (rest_of_compilation): Fix webizer pass ordering. + + * cgraphunit.c (decide_is_function_needed): Fix test dealing + with functions implicitly made inline. + + * cgraphunit.c (cgraph_decide_inlining_incrementally): New function. + (cgraph_finalize_function): Use it. + (cgraph_mark_inline): Allow incrmental decisions + * invoke.texi (max-inline-slope, min-inline-insns): Kill. + * params.def (PARAM_MAX_INLINE_SLOPE, PARAM_MIN_INLINE_INSNS): Kill. + * tree-inline.c (limits_allow_inlining): Kill. + (expand_call_inline): Always use unit-at-a-time path. + +2003-10-20 Zack Weinberg + + * fixinc/inclhack.def (hpux11_snprintf): New edit. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/stdio.h: Add test for hpux11_snprintf. + +2003-10-20 Mark Mitchell + + * Makefile.in (install-info): Simplify. + ($(DESTDIR)$(infodir)/%.info): New rule. + * configure.in (target_list): Remove install-info. + * doc/.cvsignore (gcc.info*): Remove. + (gccint.info*): Likewise. + (gccinstall.info*): Likewise. + (cpp.info*): Likewise. + (cppinternals.info*): Likewise. + (*.info*): Add it. + * doc/sourcebuild.texi: Update description of install-info. + * objc/Make-lang.in (objc.install-info): Remove. + +2003-10-20 Rainer Orth + + * config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Define _ABIO32. + Use it in _MIPS_SIM definition. + * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Likewise. + +2003-10-20 Zack Weinberg + + * config/i386/i386.c (print_reg): Abort if REGNO (x) is a + virtual register, but only if file == asm_out_file. + * config/i386/i386.h (HI_REGISTER_NAMES): Use "argp", not "", + for ARG_POINTER_REGNUM. + +2003-10-20 Zack Weinberg + + * c-common.c (registered_builtin_types): New static. + (c_common_type_for_mode): Consult registered_builtin_types. + (c_register_builtin_type): Add type to registered_builtin_types. + * optabs.c (init_floating_libfuncs): Initialize libfuncs for + all MODE_FLOAT modes, not just the ones corresponding to + float_type_node, double_type_node, and long_double_type_node. + +2003-10-20 Richard Henderson + + * config/alpha/alpha.h (PREDICATE_CODES): Add normal_memory_operand. + * config/alpha/alpha-protos.h: Remove PREDICATE_CODES prototypes. + +2003-10-20 Dorit Naishlos + + * config/rs6000/rs6000.h: (rs6000_sched_insert_nops): + support new flag -minsert-sched-nops. + (DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME): Define. + * config/rs6000/rs6000.c: (rs6000_sched_insert_nops): + support new flag -minsert-sched-nops. + (is_cracked_insn, is_microcoded_insn): New functions. + (rs6000_sched_finish): New function. + (rs6000_issue_rate): Return 5 for power4. + (get_next_active_insn, insn_terminates_group_p): New + functions. + (is_costly_group, force_new_group): New functions. + (redefine_groups, pad_groups): New functions. + (rs6000_variable_issue): Use new functions. + * doc/invoke.texi (-minsert-sched-nops): Document new + option. + +2003-10-20 David S. Miller + + * config/sparc/sparc.md (type attribute): Add new insn types + fpa, fpm_pack, fgm_mul, fgm_pdist, and fgm_cmp for VIS. + (patterns emitting VIS insns): Use them. + * config/sparc/ultra1_2.md: Add VIS scheduling rules. + * config/sparc/ultra3.md: Likewise. + +2003-10-20 Falk Hueffner + + PR target/12654 + * config/alpha/alpha.c (alpha_emit_conditional_branch): Don't do + comparison against constant by adjusting the argument except for + EQ and NE. + +2003-10-19 Mark Mitchell + + * config.gcc: Add support for arm926ejs, arm1026ejs, arm1136js, + arm1136jfs, and armv6j. + * config/arm/arm.c (FL_ARCH6J): New macro. + (FL_VFPV2): Likewise. + (all_cores): Add entries for arm926ejs, arm1026ejs, arm1136js, + and arm1136jfs. + (all_architectures): Add entry for armv6j. + (arm_override_options): Add entries for arm926ejs, arm1026ejs, + arm1136js, and arm1136jfs. + * config/arm/arm.h (TARGET_CPU_arm926ej_s): New macro. + (TARGET_CPU_arm1026ej_s): Likewise. + (TARGET_CPU_arm1136j_s): Likewise. + (TARGET_CPU_arm1136jf_s): Likewise. + * doc/invoke.texi: Document new ARM cores and architecture + variants. + +2003-10-19 Zdenek Dvorak + + * Makefile.in (toplev.o): Add value-prof.h dependency. + (value-prof.o): Add REGS_H dependency. + * common.opt (fprofile-values, fvpt): New. + * flags.h (flag_value_profile_transformations): Declare. + * opts.c (common_handle_option): Handle -fprofile_values and + -fvpt. + * profile.c (branch_prob): Don't remove death notes here. + * timevar.def (TV_VPT): New. + * value-prof.c: Include regs.h. + (insn_divmod_values_to_profile, gen_divmod_fixed_value, gen_mod_pow2, + gen_mod_subtract, divmod_fixed_value_transform,mod_pow2_value_transform, + mod_subtract_transform, value_profile_transformations): New. + (insn_values_to_profile): Call insn_divmod_values_to_profile. + (find_values_to_profile): Add dumps. + * value-prof.h (value_profile_transformations): Declare. + * toplev.c: Include value-prof.h. + (rest_of_handle_value_profile_transformations): New. + (enum dump_file_index): Add DFI_vpt. + (dump_file): Add vpt dump. + (flag_value_profile_transformations): New. + (lang_independent_options): Add flag_profile_values and + flag_value_profile_transformations. + (rest_of_compilation): Call + rest_of_handle_value_profile_transformations. + (process_options): Let -fvpt imply -fprofile-values. + * doc/invoke.texi (-fvpt): Document. + +2003-10-19 Jan Hubicka + + * i386.c (print_reg): Do not abort on certain registers. + + PR optimization/12612 + * reg-stack.c (subst_stack_regs_pat): Use st(1) for clobbers. + * i386.md (fpatan, fyl2x, fscale patterns and expanders): Use + match_scratch; avoid bogus paralles. + + PR target/12674 + * i386.c (ix86_function_regparm): Disable implicit register passing + conventions when profiling. + +2003-10-19 Eric Botcazou + Richard Henderson + + PR optimization/8178 + * config/i386/i386.md (*movsi_zero): Delete. + (*ffs_no_cmove): Use ix86_expand_clear to zero the third operand. + +2003-10-19 Richard Henderson + + * config/alpha/alpha.c (fix_operator): New. + (divmod_operator): Tidy. + (alpha_emit_xfloating_cvt): Handle UNSIGNED_FIX. + * config/alpha/alpha.h (FIXUNS_TRUNC_LIKE_FIX_TRUNC): Remove. + (PREDICATE_CODES): Update. + * config/alpha/alpha.md (fix_truncdfsi_ieee): Use match_operator. + (fix_truncdfsi_internal, fix_truncdfdi_ieee): Likewise. + (fix_truncsfsi_ieee, fix_truncsfsi_internal): Likewise. + (fix_truncsfdi_ieee): Likewise. + (fix_truncdfdi2, fix_truncsfdi2): Turn into define_expand. + (fixuns_truncdfdi2, fixuns_truncsfdi2, fixuns_trunctfdi2): New. + * config/alpha/alpha-protos.h: Update. + +2003-10-19 Richard Sandiford + + * config/mips/mips.h (INITIALIZE_TRAMPOLINE): Simplify. + * config/mips/mips.c (mips_load_got): Assume Pmode == ptr_mode. + * config/mips/mips.md (extendsidi2, *extendsidi2): Merge. Don't accept + constant operands. + +2003-10-18 Kazu Hirata + + * doc/extend.texi: Fix typos. + * doc/invoke.texi: Likewise. + +2003-10-18 Nicolas Pitre + + * config/arm/arm.c (arm_override_options): Use arm_tune_xscale for + XScale optimizations not arm_arch_xscale. + * config/arm/arm.h (CONSTANT_ALIGNMENT_FACTOR, MOVE_RATIO): Likewise. + +2003-10-18 Ulrich Weigand + + * config/s390/s390-protos.h (shift_count_operand): Add prototype. + * config/s390/s390.c (shift_count_operand): New function. + (s390_extra_constraint): Use it to implement 'Y' constraint. + (print_shift_count_operand): New function. + (print_operand): Use it to implement '%Y'. + * config/s390/s390.h (EXTRA_ADDRESS_CONSTRAINT): Add 'Y' constraint. + (PREDICATE_CODES): Add shift_count_operand. + * config/s390/s390.md ("rotldi3"): Merge alternatives, + using "shift_count_operand" predicate and "Y" constraint, + and "%Y" to output the combined shift count. + ("rotlsi3"): Likewise. + ("ashldi3", "*ashldi3_31", "*ashldi3_64"): Likewise. + ("ashrdi3", "*ashrdi3_31", "*ashrdi3_64", "*ashrdi3_cc_31", + "*ashrdi3_cc_64", "*ashrdi3_cconly_31", "*ashrdi3_cconly_64"): Likewise. + ("ashlsi3", "ashrsi3", "*ashrsi3_cc", "*ashrsi3_cconly"): Likewise. + ("lshrdi3", "*lshrdi3_31", "*lshrdi3_64"): Likewise. + ("lshrsi3"): Likewise. + +2003-10-18 Gunther Nikl + + * config/m68k/m68k.c (m68k_output_function_epilogue): Add missing + argument to asm_fprintf statement. + +2003-10-18 Fariborz Jahanian + + * rs6000.md: Separate TARGET_POWERPC64 patterns for TARGET_64BIT or TARGET_32BIT. + (ashrdisi3_noppc64) Generate more efficient code for 32-bit right-shift of + a "long long" argument. + +2003-10-18 Alexandre Oliva + + * final.c (final_scan_insn): Run FINAL_PRESCAN_INSNS on asm insns + as well. + +2003-10-18 Richard Sandiford + + * rtl.h (rtl_size): Declare. + (rtunion): Remove rtwint. + (rtx_def): Replace 'fld' with a union of an rtunion or a HOST_WIDE_INT. + (RTX_HDR_SIZE, RTX_SIZE): New macros. + (RTL_CHECK1): Adjust for new rtx_def layout. + (RTL_CHECK2, RTL_CHECKC1, RTL_CHECKC2): Likewise. + (XWINT, XCWINT): Likewise. Access the rtx structure directly. + (X0WINT): Remove. + (X0ANY): New macro. + * rtl.def: Adjust comments for new rtx_def layout. + * ggc.h (ggc_alloc_rtx): Take the rtx code as argument, not the + number of slots. + * rtl.c (rtx_size): New array. + (rtx_alloc): Adjust call to ggc_alloc_rtx. Use RTX_HDR_SIZE. + (copy_rtx): Use RTX_HDR_SIZE. Adjust for new rtx_def layout. + (shallow_copy_rtx): Adjust call to ggc_alloc_rtx. Use RTX_SIZE. + * integrate.c (copy_rtx_and_substitute): Use X0ANY to copy '0' fields. + * emit-rtl.c (copy_most_rtx): Likewise. + (copy_rtx_if_shared): Use RTX_SIZE. + (copy_insn_1): Use RTX_HDR_SIZE. Adjust for new rtx_def layout. + * gengenrtl.c (gendef): Adjust ggc_alloc_rtx call. Use RTX_HDR_SIZE. + * gengtype.c (write_rtx_next): Use RTX_HDR_SIZE. + (adjust_field_rtx_def): Expect "rtx_def" to be a union rather than + an array. Adjust output for new rtx_def layout. + * ggc-page.c (RTL_SIZE): Use RTX_HDR_SIZE. + * reload1.c (eliminate_regs): Use RTX_SIZE. + * rtlanal.c (loc_mentioned_in_p): Adjust for new rtx_def layout. + * gdbinit.in (pi): Likewise. + +2003-10-18 Jan Hubicka + + * integrate.c (copy_decl_for_inlining): Revert previous patch. + +2003-10-18 Jan Hubicka + + * integrate.c (copy_decl_for_inlining): Fix copying of copies. + +2003-10-18 Roger Sayle + + * libgcc.texi: Group multi-word types, such as "long double" and + "unsigned int", using braces in @deftypefn and @deftypefnx nodes. + Document __unord?f2 as returning a non-zero value, not just one. + +2003-10-18 Hans-Peter Nilsson + + * config/mmix/t-mmix (CRTSTUFF_T_CFLAGS): Define. + ($(T)crti.o, $(T)crtn.o): Pass CRTSTUFF_T_CFLAGS here too. + +2003-10-18 Eric Botcazou + + * config/i386/k6.md (k6_alux): Use the 'mode' attribute instead of + match_operand. + +2003-10-18 Eric Botcazou + + * config/sparc/sparc.c (function_arg_record_value_1): New fourth + parameter packed_p. Search for a DECL_PACKED field only if + packed_p is false. Pass packed_p recursively. + (function_arg_record_value_2): Likewise. + (function_arg_record_value): Update calls to + function_arg_record_value_1 and function_arg_record_value_2. + +2003-10-18 Eric Botcazou + + * cse.c (cse_insn) [src_folded]: Check that the tentative replacement + was successfully forced to memory before using the result. + +2003-10-18 Eric Botcazou + + PR optimization/8178 + * config/i386/i386.md (*movsi_zero): New insn to set + a register to zero on TARGET_USE_MOV0 targets. + +2003-10-18 Kelley Cook + + * Makefile.in (Makefile): Depend on the all Make-lang.in fragments. + (POSTSTAGE1_FLAGS_TO_PASS): Pass down MAKEINFO and MAKEINFOFLAGS. + +2003-10-17 David Edelsohn + + * doc/invoke.texi (gcse-las): Fix typo. + +2003-10-17 Andrew Pinski + + * doc/install.texi: Remove first part of the sentence for + zsh not working. Change gcc to GCC. + + PR bootstrap/12546 + * doc/install.texi: Document that zsh does not work when + configuring gcc. + +2003-10-17 Nathanael Nerode + + * config/ptx4.h: Switch to DWARF 2; update comments. + +2003-10-17 Segher Boessenkool + Hartmut Penner + + PR 10404, partial 11591, partial 11601 + * config/rs6000/altivec.md ("altivec_dst", "altivec_dstt", + "altivec_dstst", "altivec_dststt", "altivec_lvsl", "altivec_lvsr", + "altivec_lvebx", "altivec_lvehx", "altivec_lvewx", "altivec_lvxl", + "altivec_lvx", "altivec_stvx", "altivec_stvxl", "altivec_stvebx", + "altivec_stvehx", "altivec_stvewx"): Use a memory_operand. + * config/rs6000/rs6000.c (altivec_expand_lv_builtin): New function. + (altivec_expand_stv_builtin): Adjust for the memory_operand. + (altivec_expand_builtin): Call altivec_expand_lv_builtin. + (altivec_init_builtins): Use `long int' for memory offsets. + +2003-10-17 Jan Hubicka + + * opts.c (common_handle_option): Handle OPT_fweb + * invoke.texi (-fweb): Add missing parts of documentation. + +2003-10-17 Rainer Orth + + * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Undef + before redefinition. + +2003-10-17 Mostafa Hagog + + * common.opt: Add description of the new -fgcse-las flag. + * flags.h (flag_gcse_las): Declaration of global flag_gcse_las. + * gcse.c (hash_scan_set): Handle the case of store expression and + insert the memory expression to the hash table, this way we make it + possible to discover redundant loads after stores and remove them. + (pre_insert_copy_insn): moved the call to update_ld_motion_stores, + to pre_insert_copies, it is not the correct place to call it after + adding stores to be in the available expression hash table. + (pre_insert_copies): Added the call to update_ld_motion_stores when + one or more copies were inserted. + * opts.c (common_handle_option): Handle the -fgcse-las flag. + * toplev.c (flag_gcse_las): Initialization of flag_gcse_las. + + * doc/invoke.tex: Document new -fgcse-las flag. + +2003-10-18 Alan Modra + + * config/rs6000/crtsavres.asm: Correct alignment of powerpc64 code + for posterity, then remove it. + +2003-10-17 Richard Earnshaw + Nathan Sidwell + + * config/arm/arm.c (use_return_insn): Not a single instruction, if + there's a frame pointer. + (arm_output_epilogue): Protect stack pointer from being corrupted + on interrupt. + +2003-10-17 Ulrich Weigand + + * ifcvt.c (noce_try_addcc): Handle ifs with 'else' case. + +2003-10-17 Ulrich Weigand + + * combine.c (simplify_set): Do not clear out undobuf.other_insn + already set elsewhere. + +2003-10-17 Kelley Cook + + * config/i386/i386.c (ix86_expand_prologue): Use + gen_allocate_stack_worker. + +2003-10-17 Rainer Orth + + * config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 + without gas. + (mips-sgi-irix6*): Likewise. + + * config/mips/iris6gas.h: New file. + * gcc/config.gcc (mips-sgi-irix6*): Use it. + + * config/mips/mips.h (TARGET_IRIX): Provide default. + (TARGET_IRIX5): Likewise. + (TARGET_SGI_O32_AS): Likewise. + * config/mips/iris5.h (TARGET_IRIX): Redefine as 1. + (TARGET_IRIX5): Likewise. + * config/mips/iris6.h (TARGET_IRIX6): Remove. + (TARGET_IRIX5): Redefine as 0. + + * config/mips/mips.c (mips_output_external): Test for IRIX 6 O32 + linker workaround with TARGET_IRIX and mips_abi instead of + ASM_OUTPUT_UNDEF_FUNCTION. + (mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition, + testing TARGET_IRIX and mips_abi explicitly. + * config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove. + * config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef. + + * config/mips/mips.c (irix_output_external_libcall): Renamed from + mips_output_external_libcall. + Use new TARGET_IRIX in guard. + * config/mips/mips-protos.h (irix_output_external_libcall): Match + this. + * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise. + + * config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment. + Define as 0. + + * config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define + depending on mips_abi. + * config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1. + * config/mips/mips.c (mips_output_function_prologue): Test + FUNCTION_NAME_ALREADY_DECLARED at runtime. + (mips_output_function_epilogue): Likewise. + (build_mips16_function_stub): Likewise. + (build_mips16_call_stub): Likewise. + * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide + default. + + * config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native + IRIX 6 O32 assembler. + (SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI. + (TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define + _MIPS_SIM for O32 ABI. + (DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler. + (ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version. + (ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition. + Integrate O32 version. + (SUBTARGET_ASM_SPEC): Handle -mabi=32. + (SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with + O32 ABI. + (BSS_SECTION_ASM_OP_32): Define. + (BSS_SECTION_ASM_OP_64): Likewise. + (BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs + using them. + (TARGET_ASM_NAMED_SECTION): Reflect renaming. + Move up to allow override for O32 ABI without GNU as. + (EH_FRAME_SECTION_NAME): Define explicitly. + (MUST_USE_SJLJ_EXCEPTIONS): Define. + [_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP): Dummy definitions. + (TARGET_ASM_NAMED_SECTION): Undef statically. + (EH_FRAME_SECTION_NAME): Likewise. + (ASM_OUTPUT_FILENAME): Integrate mips.h version. + (LINK_SPEC): Only use default options -call_shared -no_unresolved + without -r. + Don't pass -init, -fini with -mabi=32. + (COLLECT_PARSE_FLAG): Define. + + * config/mips/mips.c (iris6_asm_named_section_1): Changed guard to + TARGET_IRIX. + Renamed to use irix_ prefix. + (iris6_asm_named_section): Likewise. + (iris_section_align_entry_eq): Likewise. + (iris_section_align_entry_hash): Likewise. + (iris6_file_start): Likewise. + (iris6_section_align_1): Likewise. + (iris6_file_end): Likewise. + (iris6_section_type_flags): Likewise. + (iris_section_align_htab): Likewise. + (iris_orig_asm_out_file): Likewise. + [TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename. + (TARGET_ASM_FILE_END): Likewise. + (TARGET_SECTION_TYPE_FLAGS): Likewise. + + * config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6] + (TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in + override_options instead. + (TARGET_ASM_UNALIGNED_SI_OP): Likewise. + (TARGET_ASM_UNALIGNED_DI_OP): Likewise. + * config/mips/mips.c (override_options) [USE_COLLECT2]: Restore + flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32 + assemblers. + Likewise for constructor/destructor handling. + (override_options): Handle IRIX O32 assembler quirks. + [TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and + without gas. + (mips_file_start): Use new TARGET_IRIX. + (mips_declare_object_name): No special processing for IRIX O32 + assembler. + (mips_finish_declare_object): Likewise. + (irix_asm_output_align): Renamed from iris6_asm_output_align. + Don't record alignment for O32 ABI. + (irix_file_start): Renamed from iris6_file_start. + Return early for O32 ABI. + (irix_file_end): Renamed from iris6_file_end. + Don't emit .section directives for O32 ABI. + * config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming. + * config/mips/mips-protos.h (irix_asm_output_align): Likewise. + + * config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32. + (MULTILIB_OSDIRNAMES): Likewise. + +2003-10-17 Rainer Orth + + * collect2.c (COLLECT_PARSE_FLAG): Provide default. + (main): Use it. + * doc/tm.texi (COLLECT_PARSE_FLAG): Document it. + +2003-10-17 Richard Earnshaw + + * arm-modes.def (CC_Nmode): New condition code mode. + * arm.c (thumb_condition_code): Delete. + (arm_select_cc_mode): Handle single-bit test for Thumb. + (arm_print_operand, cases 'd' and 'D'): Don't special case the + condition code logic for Thumb. + (get_arm_condition_code): Handle CC_Nmode. + (thumb_cbrch_target_operand): New function. + * arm.h (PREDICATE_CODES): Add thumb_cbrch_target_operand. + * arm-protos.h (thumb_cbrch_target_operand): Add prototype. + * arm.md: Add Thumb split patterns for zero_extract and + sign_extract. + (tbit_cbranch, andsi3_cbranch_scratch, andsi3_cbranch) + (orrsi3_cbranch_scratch, orrsi3_cbranch, xorsi3_cbranch_scratch) + (xorsi3_cbranch, addsi3_cbranch, addsi3_cbranch_scratch) + (subsi3_cbranch, subsi3_cbranch_scratch): New Thumb patterns. + (cbranchne_decr1): Re-work to use CC_Nmode. + + * arm.c (thumb_expand_epilogue): Add clobbers of registers restored + by the return instruction. Add a use of the link register if it + wasn't stored. + +2003-10-17 Richard Earnshaw + + * flow.c (init_propagate_block_info): Don't abort if a conditional + jump is not a comparison of a register. Instead, just don't record + conditional life information. + +2003-10-16 Jan Hubicka + + PR optimization/12630 + * pa.md (movstrsi, movstrsi_internal): Use match_scratch in clobbers + for operands 7 and 8. + +2003-10-16 Kelley Cook + + * objc/Make-lang.in (objc-parse.o): Honor $(parsedir) for objc-parse.c. + +2003-10-16 Danny Smith + + * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. + + * config/i386/winnt.c (gen_stdcall_suffix): Make static + (gen_fastcall_suffix): Likewise. + (i386_pe_dllexport_p): Likewise. + (i386_pe_dllimport_p): Likewise. + (i386_pe_mark_dllexport): Likewise. + (i386_pe_mark_dllimport): Likewise. + (i386_pe_asm_named_section): Fix formatting. + +2003-10-16 Zack Weinberg + + * configure.in: Add snprintf to gcc_AC_CHECK_DECLS list. + * system.h: Declare snprintf if necessary. + * configure, config.in: Regenerate. + +2003-10-15 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_va_arg): Only align vector + arguments if TARGET_ALTIVEC_ABI. + +2003-10-15 Roger Sayle + + * builtins.c (fold_builtin_memcpy, fold_builtin_mempcpy, + fold_builtin_memmove, fold_builtin_strcpy, fold_builtin_strncpy, + fold_builtin_memcmp, fold_builtin_strcmp, fold_builtin_strncmp): + New functions. + (expand_builtin_memcpy): Use integer_zerop instead of testing + host_integerp and tree_low_cst directly. Move misapplied hunk + for optimization wher SRC and DEST point to the same location. + (expand_builtin_mempcpy): From here. + (expand_builtin_memmove): Use integer_zerop instead of testing + host_integerp and tree_low_cst_directly. + (expand_builtin_memset): Likewise. + (expand_builtin_memcmp): Likewise (and for integer_onep). + (expand_builtin_strncmp): Likewise. + (fold_builtin): Call the appropriate fold_builtin_foo functions + to optimize memcpy, mempcpy, memmove, strcpy, strncpy, memcmp, + strcmp and strncmp. + +2003-10-15 Geoffrey Keating + + * config/darwin-protos.h (machopic_non_lazy_ptr_name): Delete + prototype. Clean up some whitespace. + * config/darwin.c: Use gen_rtx_FOO (...) rather than + gen_rtx (FOO, ...). + (machopic_non_lazy_ptr_name): Make static. + (name_needs_quotes): Allow '.' and '$' unquoted. + (machopic_legitimize_pic_address): Improve codegen in dynamic-no-pic + case. + +2003-10-15 Gábor Lóki + + * fold-const.c (tree_swap_operands_p): Disable some features + when optimizing for size. + +2003-10-15 David Daney + + * config/mips/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New + * config/mips/mips.h (DWARF_FRAME_REGNUM): Fixed to allow unwind + from leaf functions. + (DWARF_FRAME_RETURN_COLUMN): Ditto. + (SIGNAL_UNWIND_RETURN_COLUMN): New, used + by MD_FALLBACK_FRAME_STATE_FOR. + * testsuite/gcc.dg/cleanup-9.c: Added mips*-*-linux* target. + +2003-10-15 Zack Weinberg + + * genmodes.c: Include hashtab.h. + (modes_by_name, hash_mode, eq_mode, struct mode_adjust) + (adj_bytesize, adj_alignment, adj_format, new_adjust) + (_ADD_ADJUST, ADJUST_BYTESIZE, ADJUST_ALIGNMENT, ADJUST_FORMAT) + (print_maybe_const_decl, emit_mode_adjustments): New. + (known_modes): Rename to modes. + (find_mode): Kill class argument; look up in hash table. + (new_mode): Insert into hash table also. + (new_adjust): New. + (reset_float_format, make_partial_integer_mode) + (make_vector_mode): Tweak error reporting. + (reset_float_format): Correct type of fourth argument. + (emit_insn_modes_h): Add #defines to help make mode_size, + mode_base_align, and real_format_for_mode conditionally const. + (emit_mode_size, emit_mode_base_align): Use print_maybe_const_decl. + (emit_real_format_for_mode): Likewise, but temporarily disabled. + (emit_insn_modes_c): Call emit_mode_adjustments. + (main): Initialize modes_by_name. + * Makefile.in: Update dependencies. + * machmode.def: Document EXPR arguments and new ADJUST_* statements. + * machmode.h: Use CONST_MODE_SIZE and CONST_MODE_BASE_ALIGN in + declarations of mode_size and mode_base_align. Declare + init_adjust_machine_modes. + * toplev.c (backend_init): Call init_adjust_machine_modes. + +2003-10-15 Olivier Hainque + + * genmodes.c (calc_wider_mode): Allocate enough room for all the + entries we'll possibly assign in the sort buffer. + +2003-10-15 Ulrich Weigand + + * config.gcc (s390x-ibm-tpf*): New target. + * doc/install.texi: Document it. + * config/s390/t-tpf: New file. + * config/s390/tpf.h: New file. + +2003-10-15 Hans-Peter Nilsson + + PR target/12598 + * config/cris/cris.md (define_split "*mov_sidesi_biap_mem"+1) + (define_splits "*mov_sidesi_mem"+1, "casesi"+9, +10, +11, +12): + Use cris_mem_op and replace_equiv_address, not gen_rtx_MEM. + ("call", "call_value", define_split "*mov_sidesi_mem"+19, +20) + (define_split "*mov_sidesi_mem"+21, +22, +23, +24, +25, +26, +27) + (define_split "*mov_sidesi_mem"+28, +29, +30): Use + replace_equiv_address, not gen_rtx_MEM. + * config/cris/cris.c (cris_mem_op): New match_operator function. + (cris_notice_update_cc): Use replace_equiv_address, not + gen_rtx_MEM. + * config/cris/cris.h (PREDICATE_CODES): Add cris_mem_op. + +2003-10-15 Bernardo Innocenti + + * config/m68k/m68k.h (MASK_SEP_DATA, TARGET_SEP_DATA, + MASK_ID_SHARED_LIBRARY, TARGET_ID_SHARED_LIBRARY): Move + definitions after the other flags. + +2003-10-14 Ziemowit Laski + + * c-parse.in (methoddef, methodproto): Call objc_add_method() + instead of add_method(). + * objc/objc-act.c (objc_check_decl): Do not check for + constant_string_type. + (add_method): Rename to objc_add_method(). + (really_start_method): Call objc_add_method() instead of + add_method(). + * objc/objc-act.h (add_method): Rename to objc_add_method(). + +2003-10-14 Ulrich Weigand + + * config/s390/s390-protos.h (s390_alc_comparison): Add prototype. + (s390_slb_comparison): Likewise. + * config/s390/s390.c (s390_alc_comparison, s390_slb_comparison): + New functions. + * config/s390/s390.h (PREDICATE_CODES): Add s390_alc_comparison + and s390_slb_comparison. + * config/s390/s390.md ("*adddi3_31", "*subdi3_31"): Do not use on + zSeries machines. + ("*adddi3_31z", "*subdi3_31z"): New insns. + ("*adddi3_alc_cc", "*adddi3_alc", "*subdi3_slb_cc", "*subdi3_slb", + "*addsi3_alc_cc", "*addsi3_alc", "*subsi3_slb_cc", "*subsi3_slb"): + New insns. + +2003-10-14 Nathanael Nerode + + * configure.in: Clean up some feedback echoes. + * configure: Regenerate. + + * aclocal.m4: Properly quote names of macros being defined. + + * config.gcc (am33_2.0-*-linux*): Use t-slibgcc-elf-ver. + +2003-10-14 Steve Ellcey + + * config/ia64/ia64.c (ia64_expand_call): Force function address + to DImode. + * config/ia64/ia64.md (call_gp): Put DImode on operand 0. + +2003-10-14 Ulrich Weigand + + * config/s390/s390.md ("muldf3", "*muldf3", "*muldf3_ibm", + "mulsf3", "*mulsf3", "*mulsf3_ibm"): Do not clobber CC. + ("divdf3", "*divdf3", "*divdf3_ibm", "divsf3", "*divsf3", + "*divsf3_ibm"): Likewise. + +2003-10-14 Nathanael Nerode + + * config.gcc, config/m68hc11/t-m68hc11-gas: Replace uses of + target_alias with target_noncanonical. + +2003-10-14 Geoffrey Keating + + * expr.c (block_move_libcall_safe_for_call_parm): Clean up, + and add case for machines where outgoing register parameters + get stack space. + + * config/darwin.c (machopic_indirect_data_reference): Use a scratch + register when generating indirect address. + +2003-10-14 Richard Earnshaw + + * arm.c (arm_addimm_operand): MODE arguemnt is unused. + * arm.md (cbranchne_decr1): Fix bootstrap warning. + +2003-10-14 Rainer Orth + + * fixinc/inclhack.def (alpha_pthread_gcc): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/pthread.h [ALPHA_PTHREAD_GCC_CHECK]: New + testcase. + Fixes PR bootstrap/9330. + +2003-10-13 Eric Christopher + + * config/frv/frv.c (frv_adjust_field_align): Redo check for + too wide bitfields. + (frv_hard_regno_mode_ok): Add SPR_P and AP_FIRST. + * config/frv/frv.h (FUNCTION_PROFILER): Remove abort call. + (SBSS_SECTION_ASM_OP): Remove. + (EXTRA_SECTIONS): Remove in_sbss. + (EXTRA_SECTION_FUNCTIONS): Remove SBSS_SECTION_FUNCTION. + (SBSS_SECTION_FUNCTION, sbss_section): Remove. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change sbss_section to + named_section. + +2003-10-13 Nathanael Nerode + + * Makefile.in, configure.in, config.host, mkheaders.in: Replace + uses of ${target_alias} for directory names (and other places which + won't like the empty string) with ${target_noncanonical}. Introduce + call early in configure.in to _GCC_TOPLEV_NONCANONICAL_TARGET so it's + available. + * configure: Regenerate. + +2003-10-13 Ian Lance Taylor + + * config/arm/iwmmxt.md (cond_iwmmxt_movsi_insn): New pattern. + * config/arm/arm.md: For splits which rely on conditional moves, + remove ! TARGET_IWMMXT condition. + +2003-10-13 David S. Miller + + * ifcvt.c (num_removed_blocks): Rename to num_true_changes. + (find_cond_trap): Always increment if we emit a conditional + trap insn. + +2003-10-13 Zack Weinberg + + * Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o + with min-insn-modes.o. + (STAGESTUFF): Add min-insn-modes.c. + (genobjs): Add genmodes.o. + (print-rtl.o, print-rtl1.o): Depend on $(TM_P_H). + (insn-modes.o): Depend on $(TM_H) not $(GTM_H); also real.h. + (min-insn-modes.c, min-insn-modes.o): New rules. + (s-modes): Also generate min-insn-modes.c. + ($(BUILD_PREFIX_1)insn-modes.o): Kill. + * genmodes.c (struct mode_data): Add format field. + (blank_mode, validate_mode, complete_mode): Update to match. + (make_scalar_mode): Separate into make_int_mode and make_float_mode. + (_SCALAR_MODE): Kill. + (FLOAT_MODE, FRACTIONAL_FLOAT_MODE): Add format argument. + (emit_insn_modes_c_header): Adjust. + (emit_min_insn_modes_c_header, emit_real_format_for_mode) + (emit_min_insn_modes_c): New functions. + (emit_insn_modes_c): Call emit_real_format_for_mode. + (main): Add -m option to generate min-insn-modes.c. + * machmode.h: Update documentation. Add format argument to + all uses of FLOAT_MODE. + * real.c: Don't define real_format_for_mode here. + + * dwarfout.c: Move default definition of PRINT_REG... + * defaults.h: ...here. + * print-rtl.c: Include tm_p.h. + (DEBUG_PRINT_REG, DEBUG_REGISTER_NAMES, debug_reg_names, reg_names): + Kill. + (print_rtx): Use PRINT_REG, not DEBUG_PRINT_REG. But surround + this entire block with #ifndef GENERATOR_FILE. + * regclass.c: Unconditionally define reg_names. + * config/mips/mips.h, config/rs6000/rs6000.h, config/sh/sh.h + Don't define DEBUG_REGISTER_NAMES. + * config/rs6000/darwin.h: Don't use DEBUG_REGISTER_NAMES in + redefinition of REGISTER_NAMES. + * config/i386/i386.h: Don't define DEBUG_PRINT_REG. + + * combine.c: Change all preprocessor conditionals on + EXTRA_CC_MODES to use SELECT_CC_MODE instead; rearrange a bit + for clarity. + * genopinit.c: Remove mention of EXTRA_CC_MODES in comment. + * configure.in: Don't define EXTRA_CC_MODES. + * configure, config.in: Regenerate. + * doc/tm.texi: Remove documentation of EXTRA_CC_MODES. + + * config/arc/arc.c, config/m32r/m32r.c, config/sparc/sparc.c: + May assume that GET_MODE_CLASS is accurate for extra CC modes + at all times. + + * config/i860/i860.h (INIT_CUMULATIVE_ARGS): Pass correct + number of arguments to aggregate_value_p. + + * genmodes.c (RESET_FLOAT_FORMAT, reset_float_format): New. + * machmode.def: Explain ARCH-modes.def. Document + RESET_FLOAT_FORMAT. Improve commentary on various mode + clusters. Do not define OI, PQI, PHI, PSI, PDI, QF, HF, TQF, + XF, or TF modes here. Remove backward-compatibility + definition of CC. + + * config/alpha/alpha-modes.def: New file; define TF mode. + * config/arc/arm-modes.def: Define XF mode. + * config/c4x/c4x-modes.def: Define QF and HF modes. Unset + float format for SF and DF modes. + * config/dsp16xx/dsp16xx-modes.def: New file; define HF mode. + * config/i386/i386-modes.def: Define XF and TF modes. + * config/i960/i960-modes.def: Define TF mode. + * config/ia64/ia64-modes.def: Define TF and OI modes. + * config/m68k/m68k-modes.def: New file; define XF mode. + * config/mips/mips-modes.def: New file; define TF mode, reset + formats for SF and DF modes. + * config/pa/pa-modes.def: Define TF mode. + * config/rs6000/rs6000.c: Define TF and PSI modes. + * config/s390/s390-modes.def: Define OI mode. + * config/sh/sh-modes.def: New file; define PSI mode. + * config/sparc/sparc-modes.def: Define TF mode. + * config/vax/vax-modes.def: New file; reset formats for SF and + DF modes. + + * config/c4x/c4x.c (c4x_override_options): No need to mess + with real_format_for_mode or set REAL_MODE_FORMATs. + (c4x_immed_int_constant): Don't apply GET_MODE_CLASS to rtx + variable. + * config/i386/i386.c (override_options): No need to set + REAL_MODE_FORMATs here. + * config/i960/i960.c (i960_initialize): Likewise. + * config/m68k/m68k.c (m68k_override_options): Likewise. + * config/ia64/ia64.c (ia64_override_options): Set REAL_MODE_FORMAT + for TFmode only if not the default. + * config/mips/mips.c (override_options): Likewise. + * config/vax/vax.c (override_optionms): Set REAL_MODE_FORMAT for + DFmode only if not the default. + + * config/i370/i370.h (RET_REG): Don't consider TFmode. + * config/m68hc11/m68hc11.c (print_operand): Don't consider XFmode. + * config/dsp16xx/dsp16xx.c (hard_regno_mode_ok): #if 0 out use + of modes that don't appear anywhere in the machine description. + + * config/arc/arc-modes.def, config/arm/arm-modes.def + * config/c4x/c4x-modes.def, config/frv/frv-modes.def + * config/i386/i386-modes.def, config/i960/i960-modes.def + * config/ia64/ia64-modes.def, config/mmix/mmix-modes.def + * config/pa/pa-modes.def, config/pdp11/pdp11-modes.def + * config/rs6000/rs6000-modes.def, config/s390/s390-modes.def + * config/sparc/sparc-modes.def: Convert to new style for + declaring extra CC modes. + +2003-10-13 Zack Weinberg + + * cpplex.c (_cpp_clean_line): In the common case of a line + with no trigraphs and no \-newline, avoid writing to memory. + (_cpp_skip_block_comment): Use a local 'cur' pointer instead + of the buffer member. Make c an uchar to avoid unnecessary + sign extensions. + +2003-10-13 Nathanael Nerode + + * configure.in: Remove unnecessary test. + * configure: Regenerate. + + * configure.in: Fix grammatical error. Move UWIN host error to... + * config.host: Here. + * configure: Regenerate. + +2003-10-13 Andreas Krebbel + + * config/s390/s390.md ("*fmadddf4", "*fmsubdf4", "*fmaddsf4", + "*fmsubsf4"): Insns are now dependent on TARGET_FUSED_MADD instead + of flag_unsafe_math_optimizations. + * config/s390/s390.h ("MASK_NO_FUSED_MADD", "TARGET_NO_FUSED_MADD", + "TARGET_FUSED_MADD", "TARGET_SWITCHES"): Introduced new target flags + fused-madd and no-fused-madd. + * doc/invoke.texi: Documented the new options fused-madd and + no-fused-madd for S/390. + +2003-10-14 Alan Modra + + * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Choose + MASK_ALIGN_NATURAL if rs6000_alignment_string not given. Don't + assign DEFAULT_ABI. + (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Update comment. + * config/rs6000/rs6000.c: Formatting. + (rs6000_parse_alignment_option): Only set rs6000_alignment_flags + when rs6000_alignment_string given. + +2003-10-13 Eric Botcazou + + PR target/12538 + * config/sparc/sparc.c (MUST_SAVE_REGISTER): Delete. + (sparc_flat_must_save_register_p): New function to decide whether + a register must be saved/restored in the function prologue/epilogue. + (sparc_flat_compute_frame_size): Use it instead of MUST_SAVE_REGISTER. + +2003-10-12 Steven Bosscher + + * config/avr/avr.c, config/avr/avr-protos.h: Convert to + ISO C90 function declarations and definitions. + * config/sh/sh.c, config/sh/sh-protos.h: Likewise. + +2003-10-12 Nathanael Nerode + + * config.gcc (*-*-freebsd*): Use tm_defines instead of tiny + config files which do the same thing. + * config/freebsd3.h, config/freebsd4.h, config/freebsd5.h, + config/freebsd6.h: Remove now unnecessary files. + +2003-10-12 Steven Bosscher + + * c-common.c (c_common_truthvalue_conversion): Warn if the + address of a non-weak function is used as a truth value. + +2003-10-12 Kazu Hirata + + * config/h8300/h8300.c (WORD_REG_USED): Use SP_REG instead of + a literal. + * config/h8300/h8300.h (REGNO_OK_FOR_BASE_P): Use MAC_REG + instead of a literal. + +2003-10-12 Hans-Peter Nilsson + + * doc/extend.texi (Function Attributes): Mention the exceptional + path for noreturn-marked functions. + +2003-10-12 Jan Hubicka + + * cgraphunit.c (cgraph_decide_inlining): Fix uninitialized variable + warning. + +2003-10-12 Danny Smith + + * config/i386/i386.c (x86_this_parameter): Fix typo. + +2003-10-11 Jan Hubicka + + * Makefile.in (web.o): New. + * web.c: New file. + * rtl.h (web_main): Declare. + * timervar.def (TV_WEB): New. + * toplev.c (dump_file_index, dump_file_info): Add DFI_web. + (rest_of_hanle_web): New. + (flag_web): New static variable. + (lang_independent_options): Add "web". + (rest_of_compilation): Call rest_of_handle_web. + * invoke.texi (-fweb): Document. + * common.opt (fweb): New. + * flags.h (flag_web): New. + * opts.c (decode_options): Set flag_web at -O3. + + * passes.texi (web construction): Document. + * invoke.texi (-O3): Document that -fweb is enabled. + + * regrename.c (regrename_optimize): Deal better with situation when + replacement failed. + + * sched-ebb.c: Include params.h and profile.h + (schedule_ebbs): Use tracer parameters to discover superblocks + * Makefile.in (sched-ebb.o): Add dependencies. + +2003-10-11 Roger Sayle + + * fold-const.c (negate_mathfn_p): New function to determine whether + a built-in mathematical function is sign preserving, f(-x) == -f(x). + Add support for BUILT_IN_ASIN, BUILT_IN_ASINF and BUILT_IN_ASINL. + (tree_swap_operands_p): Change API to take an additional argument + indicating that the swapped operands evaluate in reverse order. + Canonicalize VAR_DECLs and PARM_DECLs last if we can, i.e. neither + operand side-effects or we don't care about flag_evaluation_order. + (reorder_operands_p): New function to check whether its safe to + evaluate the given operands in reverse order. + (negate_expr_p): We can always negate integer constants unless + we honor -ftrapv and the signed type would overflow. Only allow + -(A-B) into B-A if reorder_operands_p says that its OK. Allow + negation of COMPLEX_CST if both real and imaginary parts can be + negated. Allow negation through floating point extensions and + sign-preserving built-in functions. + (negate_expr): Move the code to negate integers from "fold" to + here. Always negate integer constants unless we honor -ftrapv + and the signed type would overflow. Always negate real constants + unless we honor -ftrapping-math. Only convert -(A-B) into B-A + if allowed by reorder_operands_p. Add support for COMPLEX_CST. + Optimize negation through floating point extensions and + sign-preserving built-in functions (as defined by negate_mathfn_p). + (fold): Adjust calls to tree_swap_operands_p. + (fold ): Move the remaining negation optimizations + to negate_expr_p/negate_expr. + (fold ): Use reorder_operands_p to check whether we're + allowed to convert (-A) - B into (-B) - A. + +2003-10-11 Roger Sayle + + * builtins.c (expand_builtin_strcmp): Defend against the possibility + that gen_cmpstrsi may fail: Stabilize the argument list against + re-evaluation and expand the library call directly using this saved + argument list if a cmpstrsi sequence can't be generated. + (expand_builtin_strncmp): Likewise. + + * config/i386/i386.md (cmpstrsi, movstrsi): Disable with -Os. + +2003-10-11 Roger Sayle + + PR optimization/12260 + * simplify-rtx.c (simplify_unary_operation): Simplify all unary + operations through CONST nodes. Optimize (neg (plus X C)) as + (minus -C X) for constant values C. + (simplify_binary_operation): Optimize (minus (neg X) C) as + (minus -C X) for constant values C. + (simplify_plus_minus): Avoid creating (neg (const (plus X C)), + instead create (minus -C X). + +2003-10-11 Roger Sayle + + * expr.c (expand_expr ): Let expand_operands call + safe_from_p for us, once it chooses an evaluation order. + (expand_expr ): Likewise. + (expand_expr ): Likewise. If expand_operands + places the second operand in "target", swap the operands. + (do_store_flag): Let expand_operands call safe_from_p for us. + +2003-10-11 Eric Botcazou + + PR optimization/12544 + * function.c (put_var_into_stack): Don't generate ADDRESSOFs + for DECL_NONLOCAL decls. + +2003-10-11 Kazu Hirata + + * expr.c: Follow spelling conventions. + * final.c: Likewise. + * optabs.c: Likewise. + * sched-deps.c: Likewise. + * sdbout.c: Likewise. + +Sat Oct 11 12:24:23 CEST 2003 Jan Hubicka + + * varasm.c (notice_global_symbol): Fix handling of variables; avoid + re-computing of variable. + +2003-10-11 Richard Henderson + + * config/alpha/alpha.c (alpha_return_in_memory): Rename from + return_in_memory, make static, change signature to match target hook. + (alpha_setup_incoming_varargs): Make static, change signature to + match target hook, add code for vms and unicos. + (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, + TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, + TARGET_RETURN_IN_MEMORY, TARGET_SETUP_INCOMING_VARARGS, + TARGET_STRICT_ARGUMENT_NAMING, + TARGET_PRETEND_OUTGOING_VARARGS_NAMED): New. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (PROMOTE_FUNCTION_ARGS, + PROMOTE_FUNCTION_RETURN, RETURN_IN_MEMORY, + SETUP_INCOMING_VARARGS): Remove. + * config/alpha/unicosmk.h (SETUP_INCOMING_VARARGS): Remove. + * config/alpha/vms.h (SETUP_INCOMING_VARARGS): Remove. + +2003-10-11 Ian Lance Taylor + + * config/arm/arm.c (arm_regno_class): Handle IWMMXT_GR_REGS. + +2003-10-11 Kazu Hirata + + * config/m68k/lb1sf68.asm: Follow spelling conventions. + * config/m68k/m68k.c: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m68k/m68k.md: Likewise. + +2003-10-11 Roger Sayle + + * builtins.c (expand_builtin_memcpy): Optimize case when the two + pointer arguments are the equal, non-volatile and side-effect free. + (expand_builtin_mempcpy): Likewise. + (expand_builtin_memmove): Likewise. + (expand_builtin_strcpy): Likewise. + (expand_builtin_memcmp): Likewise. + (expand_builtin_strcmp): Likewise. + (expand_builtin_strncmp): Likewise. + +2003-10-11 Roger Sayle + + * combine.c (apply_distributive_law): Enable "distributive" floating + point optimizations with -funsafe-math-optimizations. + +2003-10-11 Andrew Pinski + + * genmodes.c (emit_mode_mask) Change MASK to MODE_MASK. + +2003-10-11 Kazu Hirata + + * config/m68k/m68k-protos.h: Remove the prototype for + finalize_pic. + +2003-10-11 Kazu Hirata + + * config/m68k/m68k.c: Fix comment typos. + +2003-10-11 Bernardo Innocenti + + * config/m68k/m68k-protos.h (use_return_insn): Change return type from + int to bool. + * config/m68k/m68k.c (struct m68k_frame): Add funcdef_no member. + (current_frame): New global var. + (m68k_compute_frame_layout): Cache computations in current_frame. + (m68k_initial_elimination_offset): Use values from current_frame + instead of recomputing them. + (use_return_insn): Likewise. + (m68k_output_function_prologue): Likewise. + (m68k_output_function_epilogue): Likewise. + * config/m68k/m68k.h (TARGET_CPU_CPP_PREDEFINES): Fold __PIC__ handling + inside the block for __pic__. + +2003-10-11 Peter Barada + Bernardo Innocenti + + * config/m68k/m68k.c (m68k_frame): Move before protos referencing it. + (m68k_save_reg): Add boolean parameter `interrupt_handler'. + (m68k_interrupt_function_p): New function. + (m68k_handle_fndecl_attribute): Ditto. + (m68k_compute_frame_layout): Ditto. + (m68k_attribute_table): Define back-end specific attributes. + (m68k_output_function_epilogue): Emit RTE instruction for interrupt + functions. + +2003-10-11 Bernardo Innocenti + + * config/m68k/t-uclinux: New target Makefile fragment. + * config/m68k/uclinux.h: New target macro file. + * config.gcc (m68k-*-uclinux): New target definition. + +2003-10-10 Roger Sayle + + * builtins.c (builtin_mathfn_code): Generalize to check whether + the call is to any built-in function by comparing the call's + argument list against the builtin decl's function type. + +2003-10-10 Roger Sayle + + * cse.c (constant_pool_entries_regcost): New global variable to + hold the register cost component of constant_pool_entries_cost. + (fold_rtx): Calculate constant_pool_entries_regcost at the same + time as constant_pool_entries_cost. + (cse_insn): Set both src_folded_cost and src_folded_regcost from + constant_pool_entries_cost and constant_pool_entries_regcost. + (cse_main): Initialize constant_pool_entries_regcost to zero. + + * optabs.c (expand_unop): Attach a REG_EQUAL note describing + the semantics of the sequence of bit operations used to negate + a floating-point value. + (expand_abs_nojump): Likewise attach a REG_EQUAL note describing + the semantics of the bit operations used to abs a floating point + value. + +2003-10-11 Bernardo Innocenti + Paul Dale + + * config/m68k/lb1sf68.asm: Add __PIC__ and __ID_SHARED_LIBRARY__ + support. + * config/m68k/m68k-none.h (ASM_SPEC): Pass --pcrel to assembler on + -fpic, -fPIC, -msep-data and -mid-shared-library. + * config/m68k/m68k.c (m68k_library_id_string): New global variable. + (override_options): Add -msep-data and -mshared-library-id support. + (m68k_output_function_prologue): Generate code to load A5 for + TARGET_ID_SHARED_LIBRARY and TARGET_SEP_DATA. + (m68k_output_mi_thunk): Emit indirect jump on TARGET_ID_SHARED_LIBRARY. + (m68k_output_pic_call): New function. + * gcc/config/m68k/m68k.h (TARGET_SEP_DATA): New target flag. + (TARGET_ID_SHARED_LIBRARY): Ditto. + (TARGET_SWITCHES): Add switches for -mid-shared-library and -msep-data. + * gcc/config/m68k/m68k.md (call): Call m68k_output_pic_call(). + (call_value): Likewise. + +2003-10-10 Zack Weinberg + + * gengenrtl.c (find_formats, genheader): Make i an unsigned + int, remove cast of NUM_RTX_CODE. + * machmode.h: Make the HAVE_MACHINE_MODES #ifdef encompass the + entire file. Remove the #ifs on GET_MODE_MASK etc and + GET_MODE_WIDER_MODE etc. + +2003-10-10 Eric Christopher + + * lcm.c (optimize_mode_switching): Change NORMAL_MODE + to MODE_ENTRY and MODE_EXIT. Add MODE_AFTER for insns + that set mode. + * config/sh/sh.h (MODE_ENTRY): New macro. + (MODE_EXIT): Ditto. + (MODE_AFTER): Ditto. + * config/sh/sh.md: Change for MODE_AFTER. Add + fp_set attribute. + * doc/tm.texi: Document MODE_AFTER, MODE_ENTRY, and MODE_EXIT. + +2003-10-10 Zack Weinberg + + * genmodes.c, mode-classes.def: New files. + * machmode.def: Rewritten to genmodes.c interface. + * Makefile.in (extra_modes_file): New substitution variable. + (MACHMODE_H): No longer includes machmode.def or + @extra_modes_file@; instead, mode-classes.def and insn-modes.h. + (BUILD_RTL): Add $(BUILD_PREFIX)insn-modes.o. + (OBJS-common): Add insn-modes.o. + (STAGESTUFF): Add insn-modes.c, insn-modes.h, s-modes, and + genmodes$(build_exeext). + (insn-modes.o, insn-modes.c, insn-modes.h, s-modes, genmodes.o, + genmodes$(build_exeext), $(BUILD_PREFIX_1)insn-modes.o): New targets. + (s-genrtl): Don't depend on $(RTL_BASE_H). + (gengenrtl.o): Don't depend on coretypes.h, $(GTM_H), real.h, + or $(RTL_BASE_H); just rtl.def. + * gengenrtl.c: Don't include coretypes.h, tm.h, rtl.h, or + real.h. Give fake definition of CONST_DOUBLE_FORMAT and + substitute definition of NUM_RTX_CODE. Add casts to avoid + warnings. + * machmode.h: Include insn-modes.h, not machmode.def. Include + mode-classes.def to define enum mode_class. Tweak definitions + of GET_MODE_CLASS, GET_MODE_SIZE, GET_MODE_BITSIZE, GET_MODE_MASK, + GET_MODE_INNER, GET_MODE_WIDER_MODE, GET_CLASS_NARROWEST_MODE. + (inner_mode_array): Renamed mode_inner. + (mode_base_align): New. + * rtl.c (mode_name, mode_class, mode_bitsize, mode_size, + mode_unit_size, mode_wider_mode, mode_mask_array, + inner_mode_array, class_narrowest_mode): Delete definitions. + * stor-layout.c (get_mode_alignment): Use mode_base_align. + * real.h: Use MIN_MODE_FLOAT and MAX_MODE_FLOAT, not QFmode + and TFmode, in real_format_for_mode and REAL_MODE_FORMAT. + + * config/ip2k/ip2k.h, config/iq2000/iq2000.h: + No need to define BITS_PER_UNIT. + +2003-10-10 Richard Kenner + + * config/ia64/ia64.c (ia64_vms_init_libfuncs): New function. + (ia64_output_function_prologue): Only write .prologue if --with-gnu-as. + (ia64_initialize_trampoline): If not using GAS, declare trampoline + as global. + * config/ia64/ia64.h (ASM_APP_ON, ASM_APP_OFF): Add vers for not GAS. + (ASM_OUTPUT_DEBUG_LABEL): Likewise. + + * stor-layout.c (compute_record_mode): Don't force BLKmode if + field is zero-length BLKmode. + * expr.c (expand_expr, case COMPONENT_REF): Handle case of BLKmode + zero-size references. + + * combine.c (distribute_links): Properly test for REG being set. + + * config/alpha/alpha.c (alpha_expand_block_mode): Don't use + gen_lowpart and company except for REG. + +2003-10-10 John David Anglin + + * pa64-hpux.h (LINK_SPEC): Use `-z' option with HP ld. + +2003-10-10 Nathanael Nerode + + * config.gcc (mips*-*-netbsd*): Remove content-free line. + +2003-10-10 Herman A.J. ten Brugge + + * gcov-io.h: Check BITS_PER_UNIT when defining gcov_unsigned_t, + gcov_position_t and gcov_type. + +2003-10-09 Kaz Kojima + + * configure.in (HAVE_AS_TLS): Add sh-*-* and sh[34]*-*-* cases. + * configure: Regenerate. + +2003-10-09 Kazu Hirata + + * config/h8300/h8300.md (define_asm_attributes): Specify + the length of an asm insn more precisely. + +2003-10-09 Rainer Orth + + * config/mips/iris6.h (SUBTARGET_CPP_SPEC): Define. + +2003-10-09 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_dbx_register_number): Change first + FP register number to 48 and MAC16 accumulator to 0x210. + +2003-10-09 Nathanael Nerode + + * config.gcc: Remove redundant thread_file setting clauses for + various *-*-linux* targets. + +2003-10-09 Kazu Hirata + + * config/h8300/h8300.md (define_asm_attributes): New. + +2003-10-09 Roger Sayle + + * optabs.c (prepare_float_lib_cmp): Always attach a REG_EQUAL note + to the comparison, as emit_libcall_block calls copy_rtx on equiv. + +2003-10-09 Dorit Naishlos + + * haifa-sched.c (ok_for_early_schedule): New function. + (early_queue_to_ready): New function. + (schedule_block): Allow early removal of insns from Q. + (schedule_insn): Update INSN_TICK in case of premature + issue. + * common.opt (sched_stalled_insns): New flag. + (sched_stalled_insns_dep): New flag. + * flags.h: Same above flags. + * opts.c: Same as above. + * toplev.c: Same as above. + * target.h (targetm.sched.is_costly_dependence): New + hook. + * target-def.h: Same as above. + * config/rs6000/rs6000.h: (rs6000_sched_costly_dep): + Support new flag -msched-costly-dep. + (DEFAULT_SCHED_COSTLY_DEP): Define. + * config/rs6000/rs6000.c: + (rs6000_is_costly_dependence): New function. + (is_load_insn, is_store_insn): New functions. + (is_load_insn1, is_store_insn1, is_mem_ref): New + functions. + * doc/invoke.texi (-fsched-stalled-insns-dep) + (-fsched-stalled-insns, -msched-costly-dep): Document + options. + * doc/tm.texi (is_costly_dependence): Define new + scheduler target hook. + +2003-10-09 Jason Merrill + + PR c++/6392 + * c-common.c (c_build_qualified_type): Look through arrays first. + (c_apply_type_quals_to_decl): Look through arrays. + + * c-common.c (c_apply_type_quals_to_decl): Unset TREE_READONLY for + types with constructors. + + * coverage.c (build_ctr_info_value): Use build_decl to make a + VAR_DECL. + (create_coverage): Likewise. + + * stmt.c (resolve_asm_operand_names): Call check_unique_operand_names + here. + (expand_asm_operands): Not here. + (parse_input_constraint): No longer static. + * tree.h: Declare it. + +2003-10-08 Kaz Kojima + + * config/sh/t-linux (SHLIB_LINK): Override to use a linker script + libgcc_s.so. + (SHLIB_INSTALL): Likewise. + +2003-10-08 Nathanael Nerode + + * doc/install.texi: Remove reference to removed 'pthreads' thread + option. + +2003-10-08 Aldy Hernandez + + * config/rs6000/rs6000.md ("abssi2_isel"): Add early clobber to + operand 2. + +2003-10-08 Nathanael Nerode + + * config.gcc: Don't accept --enable-threads=pthreads. Clean + up related case statements. + * configure.in: Don't accept --enable-threads=pthreads, + decosf1, mach, or os2 (none of which work anyway). Alphabetize + supported thread files in case clause. + * configure: Regenerate. + +2003-10-08 Geoffrey Keating + + * function.c (pad_to_arg_alignment): Move 'boundary_in_bytes' + definition to above SPARC_STACK_BOUNDARY_HACK. + +2003-10-08 Jason Merrill + + * c-pretty-print.c (pp_c_postfix_expression) + : Fix thinko. + +2003-10-08 Rainer Orth + + * mklibgcc.in: Don't hide undefined or typeless symbols. + +2003-10-08 John David Anglin + + PR optimization/12142 + * cse.c (count_reg_usage): In a SET with a REG SET_DEST, count the + uses of the register in the SET_SRC. Remove unnecessary argument. + * pa.c (legitimize_pic_address): Before reload, use a scratch register + for the intermediate result in loading the address of a SYMBOL_REF. + Set the MEM_NOTRAP_P flag for the MEM. Add a REG_EQUAL to the insn + which loads the SYMBOL_REF address. + +2003-10-08 Timo Kokkonen + Eric Botcazou + + PR bootstrap/12490 + * scan-decls.c (MAX_EXTERN_C_BRACES): New preprocessor constant + to define the size of the extern_C_braces array. Set it to 200. + (scan_decls): Abort when extern_C_braces_length is out-of-bounds. + +2003-10-08 Carlo Wood + + * Makefile.in (gengtype-lex.c): flex 2.5.4[a] doesn't understand + a space after the -o option. flex 2.5.31 understands both, with + and without the space. Removed that space. + +2003-10-08 Richard Sandiford + + * config/mips/mips.c (mips_frame_info): Add cprestore_size field. + (compute_frame_size): Initialize it. Remove the .cprestore slot + from args_size. + (mips_output_function_prologue): Simplify accordingly. + (mips_debugger_offset): Change the mips16 frame pointer offset from + current_function_outgoing_args to cfun->machine->frame.args_size. + (mips_initial_elimination_offset): Likewise. + (mips_expand_prologue): Likewise. + (mips_expand_epilogue): Likewise. + +2003-10-08 Richard Sandiford + + * config/mips/mips.h (EXTRA_CONSTRAINT): Add 'W' constraint. + (EXTRA_MEMORY_CONSTRAINT): Define. + (CAN_ELIMINATE): Remove lwu workaround. + * config/mips/mips.md (*zero_extendsidi2_mem): Enable for mips16 too. + Use a 'W' constraint for the source operand. + +2003-10-08 Kazu Hirata + + * genopinit.c (main): Output code to declare undefined + variables. + +2003-10-07 Kelley Cook + + * gengtype-lex.l: Remove -Wtraditional cruft. + * Makefile.in (gengtype-lex.c): Likewise. + +2003-10-07 Zdenek Dvorak + + * cfgloopmanip.c (fix_irreducible_loops): Initialize e correctly. + +2003-10-07 Jason Merrill + + PR c++/12519 + * c-semantics.c (genrtl_cleanup_stmt): Ignore the CLEANUP_DECL if + it isn't a decl. + +2003-10-07 Alexandre Oliva + + * gcc.c (cpp_options): Only pass -fworking-directory for -g* if + not overridden. + Fixes PR bootstrap/12173. + +2003-10-07 Zack Weinberg + + * errors.c: Don't include coretypes.h or tm.h. + (trim_filename): Use IS_DIR_SEPARATOR. + * Makefile.in: Update dependencies of errors.o and + $(BUILD_PREFIX_1)errors.o. + +2003-10-07 Geoffrey Keating + + * function.c (pad_to_arg_alignment): Take STACK_POINTER_OFFSET into + account when aligning arguments. + * calls.c (STACK_POINTER_OFFSET): Move default from here ... + * defaults.h (STACK_POINTER_OFFSET): ... to here. + * config/sparc/sparc.h (STACK_BOUNDARY): Add comment about how + it's wrong when TARGET_ARCH64 && TARGET_STACK_BIAS. + (SPARC_STACK_BOUNDARY_HACK): Define. + * config/rs6000/rs6000.c (function_arg): On non-SVR4 systems, + arrange for vector parameters to varargs functions to be passed + in both memory and GPRs when appropriate. + (rs6000_va_arg): Vector arguments passed in memory are 16-byte + aligned. + + * hooks.c (hook_bool_tree_true): New. + (hook_rtx_tree_int_null): New. + (hook_rtx_rtx_null): Use NULL, not 0. + * hooks.h: Add 'extern' to everything. + (hook_bool_tree_true): New. + (hook_rtx_tree_int_null): New. + * targhooks.c (hook_bool_CUMULATIVE_ARGS_true): New. + * targhooks.h (hook_bool_CUMULATIVE_ARGS_true): New. + * config/rs6000/rs6000-protos.h (setup_incoming_varargs): Remove + prototype. + * config/rs6000/rs6000.c (rs6000_return_in_memory): New. + (setup_incoming_varargs): Prototype. + (TARGET_PROMOTE_FUNCTION_ARGS): Define. + (TARGET_PROMOTE_FUNCTION_RETURN): Define. + (TARGET_STRUCT_VALUE_RTX): Define. + (TARGET_RETURN_IN_MEMORY): Define. + (TARGET_SETUP_INCOMING_VARARGS): Define. + (TARGET_STRICT_ARGUMENT_NAMING): Define. + (TARGET_PRETEND_OUTGOING_VARARGS_NAMED): Define. + (init_cumulative_args): Use rs6000_return_in_memory. + (setup_incoming_varargs): Make 'static'. + * config/rs6000/rs6000.h (PROMOTE_FUNCTION_ARGS): Delete. + (PROMOTE_FUNCTION_RETURN): Delete. + (STRUCT_VALUE): Delete. + (RETURN_IN_MEMORY): Delete. + (SETUP_INCOMING_VARARGS): Delete. + +2003-10-07 Gerald Pfeifer + + * doc/invoke.texi (Warning Options): Simplify and clarify the + descriptions of -Wnonnull and -Winit-self. + +2003-10-07 Richard Earnshaw + + * optabs.c (init_intraclass_conv_libfuncs): Fix order of array + indicees for floating-point conversersion libcalls. + +2003-10-07 Nathanael Nerode + + * Makefile.in: Add more comments separating large conceptually + separate sections. + + * configure.in: Clean up thread file logic. + * configure: Regenerate. + +2003-10-07 Danny Smith + + * config/i386/cygming.h (READONLY_DATA_SECTION_ASM_OP): Define. + (switch_to_section): Handle in_readonly_data. + * config/i386/winnt.c (i386_pe_asm_named_section): Handle + readonly data. + +2003-10-07 Richard Earnshaw + + * arm.md (cmpsi2_addneg): New ARM pattern. Add peephole2 to generate + it. + (cbranchne_decr1): New Thumb pattern. + * arm.c (arm_addimm_operand): New insn predicate. + * arm-protos.h: Add a prototype for it. + * arm.h (PREDICATE_CODES): Add it. + +2003-10-07 Dorit Naishlos + + * sched-int.h (sched_info): New field + sched_max_insns_priority. + * sched-rgn.c (init_ready_list): Add invocations to + targetm.sched.adjust_priority. + (sched_max_insns_priority): Init new field. + * sched-ebb.c (sched_max_insns_priority): Init new field. + * haifa-sched.c (set_priorities): Set + sched_info->sched_max_insns_priority. + * config/rs6000/rs6000.h: + (rs6000_sched_restricted_insns_priority_str): Support new + flag -mprioritize-restricted-insns. + (DEFAULT_RESTRICTED_INSNS_PRIORITY): Define. + * config/rs6000/rs6000.c (is_dispatch_slot_restricted): New + function. + (rs6000_adjust_priority): Change priority of restricted + insns, using above new function and new flag. + * doc/invoke.texi (-mprioritize-restricted-insns): Document + new option. + +2003-10-07 Zack Weinberg + + * expr.c (cmpstr_optab, cmpmem_optab): New. + * genopinit.c: Initialize them. + * optabs.h: Declare them. + * optabs.c (init_optabs): Clear them. + (prepare_cmp_insn): Use cmpstr_optab and cmpmem_optab to find + block memory compare insns, not conditional chains. Restructure + the fallback generation of a call to memcmp/bcmp for better + readability. + +2003-10-07 Richard Sandiford + + * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): New macro. + (mips_save_restore_fn): New typedef. + (mips_add_large_offset_to_sp, mips_emit_frame_related_store): Remove. + (mips_set_frame_expr, mips_frame_set): Move above prologue code. + (save_restore_insns): Remove, replacing with... + (mips_save_restore_reg, mips_for_each_saved_reg): ...these new fns. + (mips_save_reg, mips_restore_reg): New function. + (mips_expand_prologue, mips_expand_epilogue): Rework. + * config/mips/mips.h (MIPS_TEMP1_REGNUM, MIPS_TEMP2_REGNUM): Remove. + (MIPS_PROLOGUE_TEMP_REGNUM, MIPS_EPILOGUE_TEMP_REGNUM): New macros. + (MIPS_PROLOGUE_TEMP, MIPS_EPILOGUE_TEMP): New macros. + +2003-10-07 Richard Sandiford + + * config/mips/mips.c (mips_expand_prologue): Remove unused + traversal of function arguments. + +2003-10-07 Richard Sandiford + + * doc/invoke.texi: Remove documentation of -mentry. + * config/mips/mips.c (mips_entry_string, mips_entry): Remove. + (override_options, mips_save_reg_p): Remove handling. + (compute_frame_size, mips_output_function_prologue): Likewise. + (mips_expand_prologue, mips_expand_epilogue): Likewise. + * config/mips/mips.h (mips_entry_string): Remove declaration. + (TARGET_OPTIONS): Remove -mentry. + * config/mips/mips16.S: Remove mention of -mentry. + +2003-10-06 Zack Weinberg + + * libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) + (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) + (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) + (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) + (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) + (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) + (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) + (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) + (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) + (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) + (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) + (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) + (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) + (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) + (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) + (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) + (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) + (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) + (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) + (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) + (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) + (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) + (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) + (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) + (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) + (fixunstfti_libfunc): Delete. + * optabs.h (struct optab_handlers): Break out of struct optab. + (struct convert_optab, convert_optab, enum convert_optab_index, + convert_optab_table, sext_optab, zext_optab, trunc_optab, + sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, + sfloat_optab, ufloat_optab): New. + (set_conv_libfunc): Prototype. + (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. + (trunc_optab): Renamed btrunc_optab. + * builtins.c (expand_builtin_mathfn): Update to match. + * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. + (convert_optab_table, new_convert_optab, init_convert_optab) + (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) + (set_conv_libfunc): New. + (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) + (expand_float, expand_fix): Use new conversion optabs, + not old insn code tables or long chains of ifs. + (init_optabs): No need to clear old insn code tables. + Initialize the new optabs, not the old libfunc array entries. + Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. + * genopinit.c: Initialize conversion optabs, not the + former insn code tables. Remove unnecessary casts. + Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. + * expr.c (convert_move): Remove redundant check that + to_real==from_real. Use the conversion optabs instead + of long chains of tests of modes. Move partial-integer-mode + interconversion above all integer conversion. Do not recurse + on a value forced into a register in the original mode. + + * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c + * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c + * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries + in new conversion optabs; do not reference the old libfunc + array entries. No need to include libfuncs.h. + +2003-10-06 Roger Sayle + + * config/i386/i386.c (ix86_expand_setcc): Annotate the floating + point comparison sequence with a REG_EQUAL note that describes + the comparison's semantics. + +2003-10-06 Roger Sayle + + * expr.c (expand_expr ): Handle the void type semantics + of COND_EXPR when expanding the "A op 0 ? FOO : A" optimizations. + +2003-10-06 Roger Sayle + Zack Weinberg + + * optabs.c (prepare_float_lib_cmp): Avoid searching for REG_RETVAL + instruction by using LCT_CONST and then calling emit_libcall_block + ourselves. + +2003-10-06 Falk Hueffner + + PR optimization/11974 + * optabs.c (expand_unop): Promote libcall outmode according to + hard_libcall_value. + +2003-10-06 Zack Weinberg + + * real.h (REAL_MODE_FORMAT): New macro. + * c-cppbuiltin.c, optabs.c, real.c, config/alpha/alpha.c + * config/c4x/c4x.c, config/i370/i370.c, config/i386/freebsd.h + * config/i386/i386.c, config/i960/i960.c, config/ia64/ia64.c + * config/m68k/m68k.c, config/mips/mips.c, config/rs6000/rs6000.c + * config/vax/vax.c: Use REAL_MODE_FORMAT instead of referring + directly to real_format_for_mode array, wherever possible. + +2003-10-06 Devang Patel + + * dwarf2out.c (is_main_source): Remove variable. + (dwarf2out_start_source_file): Do not check is_main_source. + Do not reset is_main_source. + (dwarf2out_init): Do not initialize is_main_source. + +2003-10-06 Rainer Orth + + * fixinc/inclhack.def (stdio_va_list): Removed _ap fix. + (irix_stdio_va_list): Don't require leading printf, IRIX 6.5.21 + introduced some multi-line prototypes. + * fixinc/fixincl.x: Regenerate. + +2003-10-06 Richard Sandiford + + * config/mips/mips.h (PREDICATE_CODES): Add stack_operand. + * config/mips/mips.c (stack_operand): New predicate. + * config/mips/mips.md: Use it for the destination of mips16 insns + that store $31. + +2003-10-06 Richard Sandiford + + * config/mips/mips.md (*lowsi): Renamed from lowsi. + (*lowdi): Likewise lowdi. + (*lowsi_mips16, *lowdi_mips16): New patterns. + * config/mips/mips.c (mips_const_insns, mips_output_move): Remove + mips16 CONSTANT_RELOC handling. + (mips_delegitimize_address): Adjust for new sdata representation. + +2003-10-06 Richard Sandiford + + * config/mips/mips.c (mips_arg_info): If MUST_PASS_IN_STACK, + skip any remaining register arguments. + +2003-10-06 Ulrich Weigand + + * reload.c (find_reloads_subreg_address): Use correct offset for + paradoxical MEM subregs on big-endian targets. + +2003-10-06 Andrew Haley + + * tree.c (get_callee_fndecl): Call + lang_hooks.lang_get_callee_fndecl. + * langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): New. + (lhd_get_callee_fndecl): New. + +2003-10-06 Andrew Pinski + + * config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one + error in calculating the length of the string. + (machopic_stub_name): Likewise. + +2003-10-06 Roger Sayle + + * optabs.c (prepare_float_lib_cmp): Attach a REG_EQUAL note + describing the return value of the comparison libcall to the + REG_RETVAL instruction of the emitted sequence. + +2003-10-06 Eric Botcazou + + PR optimization/12215 + * cse.c (cse_set_around_loop): Emit the move at the beginning + of the next basic block for trapping sets. + +2003-10-06 Eric Botcazou + + PR optimization/11637 + * combine.c (adjust_for_new_dest): New function to adjust the + notes and LOG_LINKS when the dest of an insn has changed. + (try_combine): Use it when deleting the first insn of a two-insn + parallel or splitting a two-load parallel. + +2003-10-06 Richard Sandiford + + * config/mips/mips.c (mips_classify_constant): Only allow UNSPECs + if TARGET_EXPLICIT_RELOCS. + +2003-10-06 Mark Mitchell + + PR bootstrap/12512 + * Makefile.in (info): Use double-colon rules. + (dvi): Likewise. + (generated-manpages): Likewise. + * configure.in: Do not create lang.info, lang.dvi, or + lang.generated-manpages hooks. + * configure: Regenerated. + * objc/Make-lang.in (objc.info): Remove. + (objc.dvi): Remove. + (objc.generated-manpages): Remove. + * doc/sourcebuild.texi: Update description of info, dvi, and + generated-manpages hooks. + +2003-10-06 Richard Sandiford + + * config/mips/mips.md: Merge mips16 lw/srl pattern with its splitter. + +2003-10-05 Andrew Pinski + + * config/darwin.c (machopic_non_lazy_ptr_name): Fix off by one + errors in memcpy destinations. + (machopic_stub_name): Likewise. + +2003-10-05 Andrew Pinski + + * config/darwin.c (machopic_non_lazy_ptr_name): + Change strcat to memcpy and add length together. + (machopic_stub_name): Likewise. + +2003-10-05 Kaz Kojima + + * config/sh/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Handle new + signal trampoline codes. + +2003-10-05 Chris Demetriou + + * config/mips/mips.md (*divsf3): Move description of + SB-1 F2 erratum from here to... + (divsf3): Here. Disable if TARGET_FIX_SB1 is set and + flag_unsafe_math_optimizations is not. + +2003-10-05 Aldy Hernandez + + * config/rs6000/linuxspe.h: Define TARGET_SPE_ABI, TARGET_SPE, + TARGET_E500, TARGET_ISEL, and TARGET_FPRS. + +2003-10-05 Kazu Hirata + + * c-pretty-print.c: Fix comment typos. + * c-pretty-print.h: Likewise. + * calls.c: Likewise. + * cfgloopmanip.c: Likewise. + * cgraphunit.c: Likewise. + * cppfiles.c: Likewise. + * final.c: Likewise. + * function.c: Likewise. + * gcov-io.h: Likewise. + * gcse.c: Likewise. + * genoutput.c: Likewise. + * loop.c: Likewise. + * postreload.c: Likewise. + * reg-stack.c: Likewise. + * regmove.c: Likewise. + * sched-int.h: Likewise. + * sched-rgn.c: Likewise. + * simplify-rtx.c: Likewise. + * tree-inline.c: Likewise. + * config/m68hc11/m68hc11.h: Likewise. + * config/mmix/mmix.c: Likewise. + * config/mn10300/mn10300.md: Likewise. + * config/sh/sh.h: Likewise. + +2003-10-05 Richard Henderson + + * tree-inline.c (remap_type): New. + (remap_decl): Use it. Remap DECL_SIZE*. + (copy_body_r): Use it. + (walk_tree): Walk TREE_TYPE too. + (copy_tree_r): Don't walk subtrees of types. + * tree.c (variably_modified_type_p): Restructure. Consider integer + types with non-const bounds variably modified. + +2003-10-05 Kazu Hirata + + * doc/invoke.texi: Fix typos. + +2003-10-05 Kazu Hirata + + * fold-const.c: Follow spelling conventions. + * function.c: Likewise. + * config/c4x/c4x.h: Likewise. + * config/c4x/c4x.md: Likewise. + * config/frv/frv.md: Likewise. + * config/rs6000/aix.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/xtensa/xtensa.c: Likewise. + +2003-10-05 Kazu Hirata + + * c-pretty-print.c: Fix comment formatting. + * cfglayout.c: Likewise. + * cfgloopanal.c: Likewise. + * cppcharset.c: Likewise. + * dbxout.c: Likewise. + * ggc-page.c: Likewise. + * ggc.h: Likewise. + * target.h: Likewise. + +2003-10-04 Kelley Cook + + * gengtype-lex.l: Recognize typedef of functions without PARAMS macro. + +2003-10-04 Nathanael Nerode + + * config/v850/v850-c.c, config/v850/v850-protos.h, config/v850/v850.c: + Convert to ISO C90 function declarations and definitions. + +2003-10-04 Zack Weinberg + + * libfuncs.h + (LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2) + (LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2) + (LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2) + (LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2) + (LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2) + (LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2) + (LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2) + (eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc) + (lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc) + (nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc) + (lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc) + (gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc) + (unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc) + (gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc + (eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc) + (lttf2_libfunc, letf2_libfunc, unordtf2_libfunc): + Delete. + * optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le) + (OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab) + (le_optab, unord_optab): New. + + * optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs + from the code_to_optab table, not a giant switch; use + swap_condition; do widening only if a comparison function that + we can call exists in a wider mode, not if a cmp_optab insn or + libfunc exists in a wider mode; call protect_from_queue + exactly once on each operand. + (init_optabs): Initialize the new optabs, not the deleted libfuncs. + + * config/gofast.h, config/ia64/ia64.c, config/mips/mips.c + * config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c: + Set floating point comparison libfuncs using set_optab_libfunc + on the appropriate optab. + + * config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo. + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI + selector conditionals. + +2003-10-04 Stephane Carrez + + * config/m68hc11/t-m68hc11-gas (MULTILIB_MATCHES): m68hcs12 is + identical to m68hc12 as far as libraries are concerned. + +2003-10-04 Eric Botcazou + + PR c/12446 + * c-typeck.c (convert_for_assignment): Issue an error for + array to pointer assignment after default conversion. + (digest_init): Likewise. + +2003-10-04 Fariborz Jahanian + + * c-decl.c (duplicate_decls): retain DECL_COMMON of old declaration + +2003-10-03 Gerald Pfeifer + + * doc/extend.texi (Function Attributes): Fix title of GNU C + Preprocessor manual. + (C++ Extensions): Fix reference to "Predefined Macros" in the + GNU C Preprocessor manual. + +2003-10-04 Richard Earnshaw + + * doc/extend.texi: Document how GCC estimates and relies on the size + of an asm. + +2003-10-04 Richard Sandiford + + * config/mips/mips.c (mips_pad_arg_upward): Pad floating-point + arguments downward for big-endian o64. + +2003-10-03 Robert Bowdidge + + * ggc-page.c (ggc_pch_write_object): Replace fseek() with fwrite() in + PCH generation, avoiding too-frequent flushes when writing to NFS + file system. + +2003-10-03 Ziemowit Laski + + * objc/objc-act.c (lookup_category): Mark as 'inline'. + +2003-10-03 Alexander Malmberg + Ziemowit Laski + + * objc/objc-act.c (add_method_to_hash_list, lookup_category): + New functions. + (lookup_method_in_hash_lists): New parameter indicating whether + we are messaging 'Class' or 'id'. + (check_duplicates): Likewise; do not assume all methods will + be either class or instance methods. + (generate_category, finish_class): Use lookup_category(). + (add_method): Use add_method_to_hash_list(); insert instance + methods of root classes into the global class method hash table. + (add_category): Use lookup_category(); avoid constructing + duplicate categories. + (really_start_method): Add method to corresponding @interface, + if not already there (and if the @interface exists). + (finish_message_expr, finish_objc): Adjust calls to + check_duplicates(). + +2003-10-03 Roger Sayle + + PR optimization/9325, PR java/6391 + * fold-const.c (fold_convert): For floating point to integer + conversions, return the maximum/minimum representable integer + value if the real constant overflows the destination type. + * tree.c (real_value_from_int_cst): Allow the type to be NULL, + meaning don't truncate the result to a floating point mode. + Simplify the logic by calling real_from_integer directly. + * simplify-rtx.c (simplify_unary_operation): Implement the + same semantics for folding floating point to integer conversions + in RTL. + +2003-10-03 Chris Demetriou + + * config/mips/mips.c (mips_emit_prefetch): Restructure + to avoid use of arrays, handle indexed prefetch. + * config/mips/mips.h (ISA_HAS_FP4, ISA_HAS_PREFETCH): Update comments. + (ISA_HAS_PREFETCHX): New deffine. + * config/mips/mips.md ("type" attr): Add new "prefetchx" value, + update comments. + (prefetch_indexed_di, prefetch_indexed_si): New insns. + +2003-10-03 Jeff Sturm + Roger Sayle + + PR optimization/12289 + * calls.c (emit_call_1): Pretend to have popped the arguments + to noreturn and longjmp functions instead of ignoring them. + (expand_call): Don't adjust stack_pointer_dela while + inhibit_defer_pop is set. + +2003-10-03 Andreas Schwab + + PR bootstrap/12276 + * configure.in: Check for libunwind on the host only if building + a native compiler. + * configure: Regenerated. + +2003-10-03 Paolo Carlini + + * unwind-pe.h (read_encoded_value_with_base): Constify u and + its inizialization cast. + +2003-10-03 Richard Sandiford + + PR target/12485 + * config/mips/mips.c (mips_load_got): GOT accesses can't trap. + +2003-10-02 Mark Mitchell + + PR optimization/12180 + * tree-inline.c (inline_forbidden_p_1): Do not permit inlining of + functions containing calls to __builtin_next_arg. + +2003-10-02 Chris Demetriou + + * config/mips/mips.c (mips_emit_prefetch): Use operand 3 + in instructions being output. + * config/mips/mips.md (prefetch_si_address): Change third + operand's constraint letter to 'I'. + (prefetch_di_address): Likewise. + (prefetch_si, prefetch_di): Set third operand to const0_rtx. + +2003-10-02 Zack Weinberg + + * system.h: Poison macros obsoleted by earlier patch. + * config/cris/cris.c: C90-ify a function definition. + +2003-10-02 Josef Zlomek + + PR/12292 + * combine.c (make_field_assignment): Check whether rtx's code + is CONST_INT before using INTVAL. + +2003-10-02 Josef Zlomek + + * cgraph.c (cgraph_node): Use INSERT instead of 1 in + htab_find_slot_with_hash. + (cgraph_node_for_identifier): Use NO_INSERT. + (cgraph_remove_node): Use NO_INSERT. + (cgraph_varpool_node): Use INSERT. + (cgraph_varpool_node_for_identifier): Use NO_INSERT. + +2003-10-02 Josef Zlomek + + Waldek Hebisch + PR/12072 + * varasm.c (compare_constant): Fix thinko. + +2003-10-02 Richard Sandiford + + * config/frv/frv.c (frv_issue_rate): New function. + (frv_pack_insns): Use it. + (TARGET_SCHED_ISSUE_RATE): Define. + +2003-10-02 Steven Bosscher + + * config/mcore/mcore.c: Convert to ISO C90 function declarations + and definitions. + * config/mcore/mcore.h: Likewise. + * config/mcore/mcore-protos.h: Likewise. + +2003-10-02 Richard Sandiford + + * config/frv/frv.c (frv_use_dfa_pipeline_interface): New function. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define. + +2003-10-01 Per Bothner + + * c-lex.c (src_line): Remove unneeded static variable. + (cb_line_change): Set input_line directly, instead of src_line. + (get_non_padding_token): We no longer need to compensate for the + "horrible things" the C++ front-end does with the current line number, + + * cpplib.c (_cpp_pop_buffer): Do generate a _cpp_do_file_change + callback even when popping the main file. + * c-lex.c (fe_file_change): Handle a NULL new_map. + * fix-header.c (cb_file_change): Likewise. + * c-ppoutput.c (pp_file_change): Likewise. + + * cppinit.c (cpp_read_main_file): Split into two functions: + Distribute _cpp_stack_file call over the two functions. + (cpp_find_main_file): New function. + Don't call _cpp_do_file_change even if working_directory flag set. + (cpp_push_main_file): New function. + * cppfiles.c (_cpp_find_failed): New helper function. + (find_file): Made non-static and renamed to _cpp_find_file. + (_cpp_stack_file): No longer needed. But note the following. + (stack_file): Made non-static and renamed to _cpp_stack_file. + * fix-header.c (cpp_read_main_file): Replace cpp_read_main_file + call with calls to cpp_find_main_file and cpp_push_main_file. + (search_path_head): If there is no current buffer, use main_file. + * cpphash.h: Update function declarations. + * cpplib.h: Update function declarations. + + * c-opts.c (c_common_post_options): Don't call cpp_find_main_file yet. + (c_common_parse_file): No longer need to call cpp_read_main_file + when file_index > 0 (as in multi-file or server compiation). + (finish_options): Change to is an LC_ENTER, not LC_RENAME + as this now happens before cpp_push_main_file. + (push_command_line_include): When done with options, pass LC_LEAVE + instead of LC_RENAME to cpp_change_file and finally cpp_push_main_file. + (fe_file_change): Handle NULL new_map, and simplify. + * cpplex.c (_cpp_get_fresh_line): Revert my no-longer-needed + 08-28 change, since we're never called with a NULL buffer. + (_cpp_lex_direct): Likewise. + * cpptrad.c (_cpp_read_logical_line_trad): Likewise. + Return false if buffer is NULL at end. + + * cpplex.c (_cpp_get_fresh_line): Return value now just depends on + whether pfile->buffer is NULL after pop, ignoring return_at_eof. + * cpphash.h (struct cpp_buffer): Remove unused return_at_eof field. + * cpplib.c (cpp_push_buffer): Since we no longer set return_at_eof, + remove the unused return_at_eof parameter. + * cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c: + Update callers of cpp_push_buffer. + +2003-10-01 Zack Weinberg + + * target.h (init_libfuncs): New hook. + * target-def.h: Default TARGET_INIT_BUILTINS and + TARGET_INIT_LIBFUNCS to hook_void_void. Add + TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. + * builtins.c (default_init_builtins): Delete. + * expr.h (default_init_builtins): Delete prototype. + * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. + Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. + Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, + DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, + MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, + and UMODDI3_LIBCALL, + + * Makefile.in (optabs.o): Depends on target.h. + * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. + * optabs.c: Include target.h. + (prepare_float_lib_cmp): No need for #ifdef around use of + FLOAT_LIB_COMPARE_RETURNS_BOOL. + (set_optab_libfunc): New function. + (init_optabs): Delete use of all *_LIBCALL defines. + Call targetm.init_libfuncs not INIT_TARGET_OPTABS. + * optabs.h: Prototype set_optab_libfunc. + + * config.gcc: Remove all references to pa/long_double.h, + ia64/hpux_longdouble.h, and gofast.h. + (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST + to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. + + * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c + * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c + * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c + * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c + * config/sparc/sparc.c, config/vax/vax.c: + Provide a definition for TARGET_INIT_LIBFUNCS. Where + necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. + + * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h + * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h + * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h + * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h + * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h + * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h + * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h + * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, + INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. + + * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. + Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. + * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, + HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. + * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. + + * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. + * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and + SUN_INTEGER_MULTIPLY_64 to 0. + * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and + SUN_INTEGER_MULTIPLY_64 to 1. + * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and + SUN_INTEGER_MULTIPLY_64 to 0. + * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: + Define US_SOFTWARE_GOFAST. + * config/vax/vax.h: Default TARGET_ELF to 0. + * config/vax/elf.h: Redefine TARGET_ELF to 1. + + * config/gofast.h: Don't define any macros here. Provide one + static function, gofast_maybe_init_libfuncs, which does what + INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST + is already defined. Do not clear negation libfuncs. Do + not mess with HFmode, XFmode, or TFmode libfuncs. + + * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. + +2003-10-01 Kelley Cook + + PR C/12466 + * c-parse.in (parmlist_2): Mark declaration with an ellipsis as ISO C. + +2003-10-01 Rainer Orth + + * config/mips/xm-iris5.h: Remove, unnecessary. + * config.build (mips-sgi-irix5*): Remove. + (mips-sgi-irix6*o32): Likewise. + * config.gcc (mips-sgi-irix6*o32): Remove xm_file. + (mips-sgi-irix5cross64): Likewise. + (mips-sgi-irix5*): Likewise. + * config.host (mips-sgi-irix5*): Remove. + (mips-sgi-irix6*o32): Likewise. + +2003-10-01 Zack Weinberg + + * dbxout.c (dbxout_fptype_value): Delete. + (dbxout_type): Emit R3 for all COMPLEX_TYPEs. + +2003-10-01 Alexandre Oliva + + * output.h (compute_reloc_for_constant): Declare. + * varasm.c (compute_reloc_for_constant): Extract from... + (output_addressed_constants): ... here. Adjust all callers. + +2003-10-01 John David Anglin + + * aclocal.m4: Add hpux10* and hpux11.00 to /dev/zero blacklist. + * configure: Rebuilt. + +2003-10-01 Richard Kenner + + * fold-const.c (make_range): When handling unsigned, don't reverse + range if high bound is zero. + +2003-09-30 Alexandre Oliva + + * config/frv/frv.h (PREDICATE_CODES): Added + condexec_si_media_operator, condexec_sf_add_operator and + condexec_sf_conv_operator. Removed condexec_sf_binary_operator + and condexec_sf_unary_operator. + +2003-10-01 John David Anglin + + * aclocal.m4: Add ultrix* to /dev/zero blacklist. + * configure: Rebuilt. + +2003-10-01 Rainer Orth + + * except.h (MUST_USE_SJLJ_EXCEPTIONS): Revert 2003-09-23 change. + Allow override. + * doc/tm.texi (MUST_USE_SJLJ_EXCEPTIONS): Document. + +2003-09-23 David S. Miller + + * config/sparc/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Undefine + before redefining. + * config/sparc/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise. + +2003-10-01 Steven Bosscher + + * config/cris/cris-protos.h, config/cris/cris.c: Convert to ISO + C90 function declarations and definitions. + +2003-10-01 Nathanael Nerode + + * config.gcc (cris-*-linux*): Revert mistaken commit. + +2003-10-01 Eric Botcazou + + PR optimization/11753 + * config/sparc/sparc.md (length attribute) [fcc branch]: Add 1 to + the length in the non-V9 case. + +2003-09-30 Richard Henderson + + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Honor + DWARF_ALT_FRAME_RETURN_COLUMN. + * unwind-dw2.c (dwarf_reg_size_table): Expand by one. + (_Unwind_GetGR, _Unwind_SetGR): Validate lookup column. + (uw_frame_state_for): Return end-of-stack for null return address. + * doc/tm.texi (DWARF_ALT_FRAME_RETURN_COLUMN): Add. + + * config/alpha/alpha.c (alpha_sa_mask): Add r31 for eh_return. + (alpha_expand_prologue): Store a zero for it. + (alpha_expand_epilogue): Don't reload it. + * config/alpha/alpha.h (DWARF_ALT_FRAME_RETURN_COLUMN): New. + * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Use column 64 + for the sigframe return address. + +2003-09-30 Kelley Cook + + * sdbout.c: Convert to ISO C90 prototypes. + * objc/objc-act.c: Likewise. + +2003-09-30 Kelley Cook + + * config/i386/cygwin1.c: Convert to ISO C90 prototypes. + * config/i386/winnt.c: Likewise. + * config/i386/cygming.h: Likewise. + +2003-09-30 Kazu Hirata + + * fold-const.c (fold): Fold (A & ~B) - (A & B) into + (A ^ B) - B for any B. + +2003-09-30 Nathanael Nerode + + * config.gcc (arm*-*-kaos*, i[34567]86-*-kaos*, powerpc-*-kaos*, + powerpcle-*-kaos*, strongarm-*-kaos*): Disable fixproto. + +2003-09-30 Richard Earnshaw + + * arm/ieee754-sf.S: Tidy formatting. + +2003-09-30 Nicolas Pitre + + * arm/lib1funcs.asm (ARM_DIV_MOD_BODY): Split into ARM_DIV_BODY + and ARM_MOD_BODY. + (ARM_MOD_BODY): Rewritten. added clz insns for __ARM_ARCH__ >= 5. + (ARM_DIV_BODY): Added clz insns for __ARM_ARCH__ >= 5, + added better divisor alignment in the other case. + (ARM_DIV2_ORDER): Added, finds the order of a single bit divisor. + (__divsi3, __udivsi3, __modsi3, __umodsi3): rewritten using the + macros above, add fast exits for divisor >= dividend, etc. + +2003-09-30 Nicolas Pitre + + * arm/ieee754-df.S: Split compilation of fixunsdfsi from + L_fixdfsi target. + * arm/t-arm-elf (LIB1ASMFUNCS): Add _fixunsdfsi. + +2003-09-30 Nathanael Nerode + + * config.gcc: Default use_fixproto to 'no'. + +2003-09-30 Richard Sandiford + + PR optimization/12345 + * config/mips/mips-protos.h (mips_restore_gp): Remove. + (mips_gp_save_slot): Declare. + * config/mips/mips.c (mips_restore_gp): Remove in favor of... + (mips_gp_save_slot): ...this new function. + * config/mips/mips.md (exception_receiver): Use mips_gp_save_slot + and mips_output_move to generate the output template. + (call_internal): Force splitting if TARGET_SPLIT_CALLS. Don't emit + a gp load after a noreturn call. Load the gp using a move rather + than an exception_receiver pattern. + (call_value_internal, call_value_multiple_internal): Likewise. + (call_split, call_value_split, call_value_multiple_split): Clobber $28. + +2003-09-30 Carlo Wood + + PR debug/12319 + * cfglayout.c (insn_scope): Use prologue_locator and + epilogue_locator; return the outer function scope for + pro- and epilogue insns. + +2003-09-29 Zack Weinberg + + * objc/objc-act.c (encode_type): Encode INTEGER_TYPEs and + REAL_TYPEs based on the bitsize of the type's mode, not the + mode directly. + +2003-09-29 Rainer Orth + + * dwarf2out.c (default_eh_frame_section): Split into ... + (named_section_eh_frame_section, collect2_eh_frame_section): ... new + functions. + * output.h (named_section_eh_frame_section): Declare. + (collect2_eh_frame_section): Likewise. + +2003-09-29 Zack Weinberg + + * real.c (real_sqrt): Use get_canonical_qnan directly. + + * dwarf2out.c (add_const_value_attribute): Use real_to_target. + + * varasm.c (assemble_real): Use real_to_target directly, + calculate the number of significant elements of the result + array and write them out in a loop, instead of using a giant + switch statement to pick the correct REAL_VALUE_TO_TARGET_* + macro. + +2003-09-29 Jan Hubicka + + PR c++/12175 + * varasm.c (notice_global_symbol): Discard external symbols. + + PR optimization/12286 + * gcov-io.c (gcov_read_words): Fix memmove call. + * profile.c (compute_branch_probabilities): Add extra sanity checks. + +2003-09-29 Rainer Orth + + * config.gcc (sparc-*-solaris2*): Handle Solaris 10 and up like + Solaris 7-9. + + * fixinc/inclhack.def (solaris_widec): Replace solaris2.[0-5]* by + wildcards which explicitly match micro versions. + * fixinc/fixincl.x: Regenerate. + +2003-09-29 Kazu Hirata + + * fold-const.c (fold): Fold (A & ~B) - (A & B) into + (A ^ B) - B, where B is any power of 2 minus 1. + +2003-09-29 Jan Hubicka + + * libgcov.c (gcov_exit): Fix two pastos. + +2003-09-29 Kazu Hirata + + * config/h8300/h8300.md (*tst_extzv_1_n): Combine with the + define_split immediately below to form define_insn_and_split. + +2003-09-29 Kazu Hirata + + * config/h8300/h8300.md (*tstsi_variable_bit): New. + (*tstsi_variable_bit_qi): Likewise. + +2003-09-28 Phil Edwards + + * doc/cppopts.texi: Use 'dashMP' instead of '-MP' as a cross- + reference name. + +2003-09-28 Richard Henderson + + * c-decl.c (duplicate_decls): Copy DECL_SOURCE_LOCATION, not + file and line separately. + +2003-09-28 Ulrich Weigand + + * config/s390/s390.md ("*adddi3_carry1_cc", "*adddi3_carry1_cconly", + "*adddi3_carry2_cc", "*adddi3_carry2_cconly", "*subdi3_borrow_cc", + "*subdi3_borrow_cconly"): New insns. + ("*addsi3_sub", "*subsi3_sub"): Remove. + ("*subdi3_cc", *subdi3_cconly"): Use only if TARGET_64BIT. + ("*subsi3_cc"): Fix op_type attribute. + +2003-09-28 Richard Henderson + + * stmt.c (expand_asm_operands): Take a location_t, instead of + individual file and line. + * c-typeck.c (c_expand_asm_operands): Likewise. + * tree.h (expand_asm_operands): Update decl. + * c-common.h (c_expand_asm_operands): Likewise. + * c-semantics (genrtl_asm_stmt): Update call. + +2003-09-28 Philip Blundell + + * config/arm/arm.c (legitimize_pic_address): Check + SYMBOL_REF_LOCAL_P, not ENCODED_SHORT_CALL_ATTR_P. + (arm_assemble_integer): Likewise. + +2003-09-28 Steven Bosscher + + * config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, + config/c4x/c4x-c.c, config/c4x/c4x-protos.h, config/c4x/c4x.c, + config/c4x/c4x.h: + Convert to ISO C90 function declarations and definitions. + +2003-09-28 Steven Bosscher + + * config/stormy16/stormy16.c, config/stormy16/stormy16-protos.h: + Convert to ISO C90 function declarations and definitions. + +2003-09-28 Richard Sandiford + + * config/mips/mips.c (mips_constant_info): Add reloc field. + (mips_classify_constant): Initialize it. Always set SYMBOL to the + underlying symbol, not to an unspec. + (mips_delegitimize_address, print_operand): Clean up accordingly. + +2003-09-28 Richard Sandiford + + * config/mips/mips-protos.h (mips16_gp_pseudo_reg): Remove. + * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Remove orphaned comment. + * config/mips/mips.c (mips_reloc_offset_ok_p): New function. + (mips_classify_constant): Use it. + (mips_splittable_symbol_p): Add an offset argument. + (mips_classify_address): Adjust call accordingly. + (mips_legitimize_symbol): Handle sdata references with LO_SUM rather + than a relocation unspec. Update call to mips_splittable_symbol_p. + Generalize the code that copes with symbols + invalid offsets. + (print_operand): Allow '%R' to be applied to small data addresses. + (mips_reloc_string): Remove RELOC_GPREL16. + (mips_sdata_pointer): Renamed from mips16_gp_pseudo_reg. Return $gp + for TARGET_EXPLICIT_RELOCS. Return null if we can't use gp-relative + relocation operators. + * config/mips/mips.md (RELOC_GPREL16): Remove. Shuffle other reloc + constants accordingly. + +2003-09-27 Roger Sayle + + * toplev.c (flag_evaluation_order): New global variable. + * flags.h (flag_evaluation_order): Prototype here. + * expr.c (expand_operands): If we need to preserve observable + evaluation order, protect exp1 from clobbering exp0's result. + +2003-09-28 Andreas Jaeger + + * c-decl.c (finish_function): Convert definition to ISO C90. + * ifcvt.c (mark_loop_exit_edges): Likewise. + * ra-rewrite.c (emit_colors): Likewise. + +2003-09-27 Nathanael Nerode + + * config.gcc (alpha*-dec-osf[45]*): Disable fixproto. + * config.gcc (arm*-*-uclinux*): Disable fixproto. + * config.gcc (powerpc-*-eabispe*, powerpc-*-eabisimaltivec*, + powerpc-*-eabialtivec*): Disable fixproto. + +2003-09-27 Eric Botcazou + + PR optimization/12340 + * loop.h (struct induction): Document the new semantics + of the 'same' field for bivs. + * unroll.c (biv_total_increment): Don't count the same + biv increment several times. + (loop_iterations) [GENERAL_INDUCT]: Likewise. + +2003-09-27 Graham Stott + + * unroll.c (loop_interations)[GT]: Add missing break. + +2003-09-27 Kelley Cook + + * config/chorus.h, config/darwin-c.c, config/darwin-protos.h, + config/darwin.c, config/darwin.h, config/dbx.h, config/dbxcoff.h, + config/dbxelf.h, config/elfos.h, config/fp-bit.h, + config/freebsd-nthr.h, config/freebsd-spec.h, config/freebsd.h, + config/freebsd3.h, config/freebsd4.h, config/freebsd5.h, + config/freebsd6.h, config/netbsd-aout.h, config/netbsd-elf.h, + config/netbsd.h, config/netware.h, config/openbsd-oldgas.h, + config/openbsd.h, config/ptx4.h, config/alpha/alpha-protos.h, + config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/alpha.md, + config/alpha/elf.h, config/alpha/ev4.md, config/alpha/ev5.md, + config/alpha/ev6.md, config/alpha/freebsd.h, config/alpha/linux-elf.h, + config/alpha/linux.h, config/alpha/netbsd.h, config/alpha/openbsd.h, + config/alpha/osf.h, config/alpha/osf5.h, config/alpha/unicosmk.h, + config/alpha/vms-cc.c, config/alpha/vms-crt0-64.c, + config/alpha/vms-crt0.c, config/alpha/vms-dwarf2.asm, + config/alpha/vms-dwarf2eh.asm, config/alpha/vms-ld.c, + config/alpha/vms-psxcrt0-64.c, config/alpha/vms-psxcrt0.c, + config/alpha/vms.h, config/alpha/vms64.h, config/alpha/vms_tramp.asm, + config/alpha/xm-vms.h, config/arc/arc-modes.def, + config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, + config/arc/arc.md, config/arc/initfini.c, config/arc/lib1funcs.asm, + config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, + config/avr/avr.md, config/d30v/d30v-protos.h, config/d30v/d30v.h, + config/d30v/d30v.md, config/fr30/fr30-protos.h, config/fr30/fr30.c, + config/fr30/fr30.h, config/fr30/fr30.md, config/fr30/lib1funcs.asm, + config/frv/cmovd.c, config/frv/cmovh.c, config/frv/cmovw.c, + config/frv/frv-abi.h, config/frv/frv-asm.h, config/frv/frv-modes.def, + config/frv/frv-protos.h, config/frv/frv.c, config/frv/frv.h, + config/frv/frv.md, config/frv/frvbegin.c, config/frv/frvend.c, + config/frv/lib1funcs.asm, config/h8300/clzhi2.c, config/h8300/ctzhi2.c, + config/h8300/parityhi2.c, config/h8300/popcounthi2.c, + config/i370/i370-c.c, config/i370/i370-protos.h, config/i370/i370.c, + config/i370/i370.h, config/i370/i370.md, config/i370/linux.h, + config/i370/mvs.h, config/i370/oe.h, config/i386/darwin.h, + config/i960/i960-c.c, config/i960/i960-coff.h, + config/i960/i960-modes.def, config/i960/i960-protos.h, + config/i960/i960.c, config/i960/i960.h, config/i960/i960.md, + config/i960/rtems.h, config/ia64/elf.h, config/ia64/ia64.h, + config/m32r/initfini.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, + config/m32r/m32r.h, config/m32r/m32r.md, config/m68hc11/larith.asm, + config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, + config/m68hc11/m68hc11.h, config/m68hc11/m68hc11.md, + config/m68hc11/m68hc12.h, config/m68k/coff.h, config/m68k/crti.s, + config/m68k/crtn.s, config/m68k/hp320.h, config/m68k/hp320base.h, + config/m68k/lb1sf68.asm, config/m68k/linux.h, config/m68k/m68020-elf.h, + config/m68k/m68k-aout.h, config/m68k/m68k-none.h, + config/m68k/m68k-protos.h, config/m68k/m68k.c, config/m68k/m68k.h, + config/m68k/m68k.md, config/m68k/m68kelf.h, config/m68k/m68kv4.h, + config/m68k/netbsd-elf.h, config/m68k/openbsd.h, + config/m68k/rtemself.h, config/m68k/sgs.h, config/mcore/lib1.asm, + config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, + config/mcore/mcore-protos.h, config/mcore/mcore.c, + config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h, + config/mips/elforion.h, config/mips/iris5.h, config/mips/iris6.h, + config/mips/iris6gld.h, config/mips/irix6-libc-compat.c, + config/mips/linux.h, config/mips/mips-protos.h, config/mips/mips.c, + config/mips/mips.h, config/mips/mips.md, config/mips/netbsd.h, + config/mips/openbsd.h, config/mips/r3900.h, config/mips/rtems.h, + config/mips/vr.h, config/mn10300/linux.h, + config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, + config/mn10300/mn10300.h, config/mn10300/mn10300.md, + config/ns32k/__unorddf2.c, config/ns32k/__unordsf2.c, + config/ns32k/netbsd.h, config/ns32k/ns32k-protos.h, + config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/ns32k/ns32k.md, + config/pdp11/2bsd.h, config/pdp11/pdp11-modes.def, + config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, + config/pdp11/pdp11.h, config/pdp11/pdp11.md, config/rs6000/biarch64.h, + config/rs6000/default64.h, config/sh/coff.h, config/sh/crt1.asm, + config/sh/crti.asm, config/sh/crtn.asm, config/sh/elf.h, + config/sh/embed-elf.h, config/sh/linux.h, config/sh/little.h, + config/sh/netbsd-elf.h, config/sh/rtems.h, config/sh/rtemself.h, + config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h, + config/sh/sh.md, config/sh/sh64.h, config/sh/shmedia.h, + config/sh/sshmedia.h, config/sh/ushmedia.h, config/sparc/pbd.h, + config/sparc/sparc.h, doc/install-old.texi, fixinc/fixinc.ptx, + fixinc/fixinc.svr4: GNU CC -> GCC. + +2003-09-26 Loren James Rittle + + * objc/objc-act.c (tm_p.h): Tweak order. + * objc/Make-lang.in (objc/objc-act.o): Add $(TM_P_H). + +2003-09-26 Nathanael Nerode + + * config.gcc (hppa*64*-*-linux* | parisc*64*-*-linux*): + Include t-slibgcc-elf-ver and t-linux in tmake_file. + * config.gcc (hppa*64*-*-linux* | parisc*64-*-linux*): + Disable fixproto. + * config.gcc (i960-*-coff*, m68k-*-aout*, sparclite-*-coff*): + Disable fixproto. + * config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*, + sparcv9-*-solaris2*, sparc-*-solaris2*): Disable fixproto. + + * config/i386/unix.h: Remove (unused) DEFAULT_ASSEMBLER_DIALECT. + +2003-09-26 Loren James Rittle + + * config/i386/i386.h (ix86_return_in_memory): Revert my last patch. + * objc/objc-act.c (tm_p.h): Include. + +2003-09-26 Per Bothner + + * dbxout.c (dbxout_typedefs): Output typedefs in forward order. + No longer any need to reverse by recursion. + +2003-09-26 Roger Sayle + Richard Henderson + + PR optimization/11741 + * gcse.c (pre_insert_copy_insn): Tweak the logic for finding the + appropriate set to match that in hash_scan_insn. Fall back to + the original copy method, if we can't validate changing insn. + (pre_delete): Only delete instructions that have a single_set, + instead of aborting when we encounter an PARALLEL insn with more + then one SET. + +2003-09-26 Andreas Krebbel + + * config/s390/s390.md ("builtin_setjmp_setup"): Insn deleted. + ("builtin_longjmp"): Insn deleted. + ("save_stack_nonlocal"): Save literal pool base pointer behind + backchain and stack pointer. + ("restore_stack_nonlocal"): Restore literal pool base pointer. + * config/s390/s390.h (STACK_SAVEAREA_MODE): Double size of + the stack save area for the nonlocal goto case. + +2003-09-26 John David Anglin + + PR bootstrap/12358 + * pa.c (output_bvb): Fix typo. + +2003-09-26 Richard Sandiford + + * expmed.c (store_bit_field): Don't search for an integer mode + unless we need the result. + +2003-09-26 Richard Sandiford + + * expr.c (emit_move_insn_1): If there is no move pattern for the + original mode, try using a pattern for the corresponding integer mode. + +2003-09-26 Richard Sandiford + + PR middle-end/9200 + * combine.c (if_then_else_cond): Tighten mode check. + +2003-09-25 Nathanael Nerode + + * cppcharset.c, cpphash.h: Rename 'struct strbuf' to + 'struct _cpp_strbuf'. + + * config/i386/netbsd-elf.h, config/i386/netbsd64.h, + config/i386/netware.h, config/i386/nto.h, config/i386/openbsd.h, + config/i386/pentium.md, config/i386/pmmintrin.h, config/i386/ppro.md, + config/i386/ptx4-i.h, config/i386/rtemself.h, config/i386/sco5.h, + config/i386/sol2.h, config/i386/svr3gas.h, config/i386/sysv3.h, + config/i386/sysv4-cpp.h, config/i386/sysv4.h, config/i386/sysv5.h, + config/i386/unix.h, config/i386/uwin.h, config/i386/vsta.h, + config/i386/xm-cygwin.h, config/i386/xm-djgpp.h, + config/i386/xm-mingw32.h, config/i386/xmmintrin.h: Replace + "GNU CC", "GNU compiler", and "GNU C-compiler" with "GCC". + * config/i386/i386-aout.h, config/i386/i386-coff.h, + config/i386/i386-interix.h, config/i386/i386-interix3.h, + config/i386/i386-modes.def, config/i386/i386-protos.h, + config/i386/i386.c, config/i386/i386.h, config/i386/i386.md, + config/i386/i386elf.h, config/i386/k6.md, config/i386/kaos-i386.h, + config/i386/linux-aout.h, config/i386/linux.h, config/i386/linux64.h, + config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h, + config/i386/mmintrin.h, config/i386/moss.h: GNU CC -> GCC. + "GNU compiler" -> GCC. + * config/i386/att.h, config/i386/beos-elf.h, config/i386/biarch64.h, + config/i386/bsd.h, config/i386/crtdll.h, config/i386/cygming.h, + config/i386/cygwin.h, config/i386/cygwin1.c, config/i386/cygwin2.c, + config/i386/darwin.h, config/i386/djgpp.h, config/i386/emmintrin.h, + config/i386/freebsd-aout.h, config/i386/freebsd.h, + config/i386/freebsd64.h, config/i386/gas.h: GNU CC -> GCC. + +2003-09-25 Kelley Cook + + * cgraph.c (dump_cgraph): Don't output newline before dump. Add in + "local" to the callgraph dump. Output "after inlining" earlier. + * cgraphunit.c: Fix dumpfile whitespace and commonize headers of the + callgraph dumps. Correct misspellings. + (cgraph_decide_inlining): Output number of insns before inlining. + Output the calling function into which a function is inlined. + (cgraph_decide_small_functions): Format dump file like always_inline. + +2003-09-25 Loren James Rittle + + * config/i386/i386.h (ix86_return_in_memory): Add prototype. + +2003-09-25 Ulrich Weigand + + * config/s390/s390.c (s390_emit_prologue): Simplify accesses to + FPR slots in the save area. + (s390_emit_epilogue): Likewise. + +2003-09-25 Richard Sandiford + + * cgraph.h (cgraph_remove_edge): Declare. + * cgraph.c (cgraph_remove_edge): Make extern. + * cgraphunit.c (cgraph_finalize_function): Call cgraph_remove_edge + instead of cgraph_remove_call. + +2003-09-25 Ulrich Weigand + + * objc/objc-act.c (gen_declaration_1): Fix printf format. + +2003-09-25 Richard Earnshaw + + * arm.c (all_cores): arm710t, arm720t and arm740t are all based on the + arm7tdmi core. + +2003-09-25 Ziemowit Laski + + * config/darwin-protos.h (objc_image_info_section): + New prototype. + +2003-09-25 Ziemowit Laski + + * Makefile.in (stub-objc.o): Depend on $(GGC_H). + +2003-09-25 Nathanael Nerode + + * config.gcc: Get rid of more gratuitious 'x'es. Actually allow + tsc701 as a --with-cpu, --with-tune setting for sparc. + +2003-09-25 Ziemowit Laski + + * c-parse.in (objc_try_stmt): Do not specify a %type. + +2003-09-25 Nathanael Nerode + + * config.gcc: New 'widely ported system' clause for rtems. + Set thread file there, not in individual clauses. + +2003-09-25 Richard Sandiford + + PR target/6222 + * config/mips/mips.c (mips_va_arg): Handle arguments that must be + passed on the stack. + +2003-09-25 Nathanael Nerode + + * config.gcc (widely ported systems section): Mostly alphabetize + by system. Comment the case where we can't. + * config.gcc (widely ported systems section): Reindent and clean up. + + * config.gcc: Remove some unnecessary uses of 'x' in case statements. + Actually allow ep9312 as an arm --with-arch setting. + + * config.gcc (*-hpux11): Disable fixproto. + +2003-09-24 Phil Edwards + + PR pch/12112 + * gcc/cppfiles.c (pch_open_file): Return based on combined + result of all files. + (validate_pch): Return validate flag for current file. + +2003-09-24 Roger Sayle + + PR bootstrap/12358 + * fold-const.c (tree_swap_operands_p): Only reorder operands when + one of the operands is constant. + +2003-09-24 Ziemowit Laski + + MERGE OF objc-improvements-branch into MAINLINE: + * Makefile.in (C_OBJS): Add in stub-objc.o. + (c-parse.y): Change sed demarcations to begin with '@@'. + (stub-objc.o): New rule. + * c-common.c (flag_nil_receivers, flag_objc_exceptions, flag_zero_link, + flag_replace_objc_classes): New flags. + * c-common.h (RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH, RID_AT_FINALLY, + RID_AT_SYNCHRONIZED): New keywords. + (flag_nil_receivers, flag_objc_exceptions, flag_zero_link, + flag_replace_objc_classes): New flags. + (lookup_interface, is_class_name, objc_is_object_ptr, objc_check_decl, + objc_comptypes, objc_message_selector, lookup_objc_ivar, + get_current_scope, objc_mark_locals_volatile): New prototypes, + some moved from c-tree.h. + * c-decl.c (get_current_scope, objc_mark_locals_volatile): New functions. + (finish_decl): Adjust where objc_check_decl() gets called. + * c-lang.c (lookup_interface, is_class_name, objc_is_id, objc_check_decl, + objc_comptypes, objc_message_selector, lookup_objc_ivar): Remove stubs. + * c-opts.c (c_common_handle_option): Add handling for flag_nil_receivers, + flag_objc_exceptions, flag_replace_objc_classes and flag_zero_link. + * c-parse.in: Replace 'ifc' and 'end ifc' sed markers with '@@ifc' and + '@@end_ifc', respectively. + (AT_THROW, AT_TRY, AT_CATCH, AT_FINALLY, AT_SYNCHRONIZED): New %tokens. + (objc_try_stmt, superclass, class_ivars, objc_try_catch-stmt, + objc_finally_block): New rules. + (component_decl_list2): Clean up semantic action for @defs construct. + (component_decl, c99_block_start): Remove call to add_objc_decls(). + (poplevel): Add call to objc_clear_super_receiver(). + (stmt): Add rules for @throw, @try..@catch..@finally and @synchronized + constructs. + (classdef, methodprotolist): Clean up/simplify. + (methodprotolist2): Eliminate. + (methodproto): Call add_method() instead of add_class_method() and + add_instance_method(). + (receiver): Add TYPENAME production. + (reswords): Add "throw", "try", "catch", "finally" and "synchronized". + (rid_to_yy): Add AT_THROW, AT_TRY, AT_CATCH, AT_FINALLY and + AT_SYNCHRONIZED. + * c-tree.h (lookup_interface, is_class_name, objc_is_id, objc_check_decl, + objc_comptypes, objc_message_selector) + * c-typeck.c (comptypes): In ObjC mode, call objc_comptypes() for + struct and pointer types. + (build_c_cast): Do not discard ObjC protocol qualifiers. + (convert_for_assignment): Cache result of comp_target_types() instead + of calling it more than once. + * c.opt (fnext-runtime): Update description string. + (fnil-receivers, fobjc-exceptions, freplace-objc-classes, fzero-link): + New ObjC/ObjC++-specific flags. + * function.h (GCC_FUNCTION_H): Header guard. + * gengtype-lex.l: Teach lexer about new @@... sed demarcations. + * stub-objc.c: New file, to be used to satisfy references to ObjC + functions by the C and C++ front-ends. + * config/darwin.c (_OBJC_IMAGE_INFO): New global metadata. + * config/darwin.h (FUNCTION): Add in_objc_image_info. + (SECTION_FUNCTION): Add objc_image_info_section. + * doc/invoke.texi: Link to GCC web site for Objective-C information. + (-fconstant-string-class): Update documentation. + (-fno-nil-receivers, -fobjc-exceptions, -freplace-objc-classes, + -fzero-link): New documentation. + * objc/Make-lang.in (objc-parse.y): Change sed demarcations to begin + with '@@'. + * objc/lang-specs.h (@objective-c-header): Fix -E spec. + * objc/objc/objc-act.c: Replace TYPE_NAME with OBJC_TYPE_NAME + throughout; provide casts for return values from memory allocation + functions (xmalloc, alloca, ggc_alloc, etc.). + (OBJC_VOID_AT_END): New macro. + (rtl.h): Do not #include any more. + (STRING_OBJECT_GLOBAL_NAME): Replaced with STRING_OBJECT_GLOBAL_FORMAT. + (TAG_MSGSEND_STRET, TAG_MSGSENDSUPER_STRET, TAG_MSGSEND_NONNIL, + TAG_MSGSEND_NONNIL_STRET, TAG_EXCEPTIONEXTRACT, TAG_EXCEPTIONTRYENTER, + TAG_EXCEPTIONTRYEXIT, TAG_EXCEPTIONMATCH, TAG_EXCEPTIONTHROW, + TAG_SYNCENTER, TAG_SYNCEXIT): New NeXT runtime entry points. + (struct val_stack, catch_count_stack, exc_binding_stack, val_stack_push, + val_stack_pop): New. + (objc_check_decl): Fix precondition for error message, along with + the message itself. + (lookup_and_install_protocols): Remove nonexistent protocols from + protocol list instead of returning error_mark_node. + (create_builtin_decl): Use DECL_ARTIFICIAL only for VAR_DECLs. + (setup_string_decl): Generalize to use STRING_OBJECT_GLOBAL_FORMAT. + (synth_module_prologue): General clean-up; construct NeXT-specific + runtime API prototypes if needed. + (build_string_class_template): Remove. + (check_string_class_template, string_layout_checked): New. + (build_objc_string_object): Generalize to work with + -fconstant-string-class. + (build_objc_symtab_template): Fix layout for the NeXT runtime. + (build_metadata_decl): New. + (forward_declare_categories): Call build_metadata_decl() instead of + create_builtin_decl() et al. + (build_module_descriptor): Use OBJC_VOID_AT_END instead of + void_list_node_1. + (build_selector_reference_decl, build_class_reference_decl, + build_objc_string_decl): Do not set TREE_READONLY. + (get_proto_encoding): Do not call hack_method_prototype(). + (get_class_reference): Add failure mode for invalid class names; + support -fzero-link; defer if in an ObjC++ template declaration. + (objc_declare_alias, objc_declare_class): Fix up duplicate name + lookup; check for global scope if in ObjC++. + (is_class_name): Generalize to work with various tree nodes (TYPE_DECL, + RECORD_TYPE, IDENTIFIER_NODE, etc.) + (objc_is_id): Removed. + (objc_is_object_ptr): New function. + (get_class_ivars_from_name): New function, used for @defs construct. + (get_class_ivars): Add option to return raw ivars; create a + ClASS_OWN_IVARS list for each class as needed. + (objc_enter_block, objc_exit_block, objc_declare_variable, + objc_build_throw_stmt, val_stack_push, val_stack_pop, + objc_build_try_enter_fragment, objc_build_extract_expr, + objc_build_try_exit_fragment, objc_build_extract_fragment, + objc_build_try_prologue, objc_build_try_epilogue, + objc_build_catch_stmt, objc_build_catch_epilogue, + objc_build_finally_prologue, objc_build_finally_epilogue, + objc_build_try_catch_finally_stmt, objc_build_synchronized_prologue, + objc_build_synchronized_epilogue, build_objc_exception_stuff): + New functions. + (_JBLEN): _setjmp jmpbuf size (needs to be made a target hook in + the future). + (build_private_template): Fix up calls to get_class_ivars(). + (offset_is_register, forwarding_offset): Remove. + (objc_method_parm_type, objc_encoded_type_size): New functions. + (encode_method_prototype): Simplify to no longer depend on + back-end information. + (build_tmp_function_decl_xxx, build_tmp_function_decl, + hack_method_prototype): Removed. + (generate_protocol_references): Remove calls to + build_tmp_function_decl(). + (generate_protocols): Adjust calls to encode_method_prototype(). + (build_class_template): Generate sel_id' and 'gc_object_type' fields + for the NeXT runtime. + (synth_forward_declarations): Call build_metadata_decl(). + (check_ivars): Check that the number of ivars matches also. + (build_super_template): Modify super_type directly; disable debugging + output while generating decl. + (build_ivar_list_initializer): Skip list elements that are not + FIELD_DECLs. + (ivar_list_length): New function. + (generate_ivar_lists): Call ivar_list_length() instead of list_length() + and encode_method_prototype() instead of encode_method_def(). + (build_shared_structure_initializer): Generate 'sel_id' field for + the NeXT runtime. + (generate_category): Do not set TREE_USED. + (build_keyword_selector): Ditto; transform into a function argument + chain. + (get_arg_type_list): If there are no user-specified arguments, use + '...'; use OBJC_VOID_AT_END. + (check_duplicates): Add a parameter indicating whether methods or + selectors are being checked. + (receiver_is_class_object): Add parameters indicating whether + receiver is 'self' or 'super'; robustify. + (build_message_expr): Defer call to finish_message_expr() if + inside an ObjC++ template. + (lookup_method_in_hash_lists): New function. + (finish_message_expr): Complete rewrite/fix. + (build_objc_method_call): Ditto; factor out commonalities between + the GNU and NeXT runtimes; acccommodate ..._stret and ...NonNil + messenger variants on the NeXT. + (lookup_instance_method_static, lookup_class_method_static): + Fold into a single lookup_method_static() function with an + additional parameter. + (add_class_method, add_instance_method): Fold into a single + add_method() function with an additional parameter. + (add_category): Make duplicate categories a hard error in ObjC++. + (add_instance_variable): Properly handle unnamed ivars, arrays of + zero or no size and bitfields. In ObjC++, check for nontrivial + C++ class instances. + (is_public): Allow C functions to access non-@public ivars, with + a warning. + (start_class): Move common initializations to + synth_module_prologue(); check for global scope if in ObjC++. + (continue_class): Fix calls to finish_struct(). + (objc_declare_protocols, start_protocol): Check for global scope + if in ObjC++. + (encode_pointer): Encode 'BOOL *' specially on the NeXT. + (encode_aggregate_within): Rewrite to properly distinguish + struct tags from typedefs in both ObjC and ObjC++. + (encode_bitfield, encode_complete_bitfield): Remove. + (encode_next_bitfield, encode_gnu_bitfield): New functions. + (encode_field_decl): Call encode_next_bitfield() or + encode_gnu_bitfield() as needed. + (synth_self_and_ucmd_args): New function. + (start_method_def): Use it. + (objc_types_are_equivalent): New function. + (comp_proto_with_proto): Use it instead of comptypes(), since + we need symmetry. + (really_start_method): Use lookup_method_static() instead of + lookup_class_method_static() and lookup_instance_method_static(); + Emit 'extern "C"' if in ObjC++ mode. + (add_objc_decls): Removed. + (UOBJC_SUPER_scope): New variable. + (get_super_receiver): Move construction of 'super' from + add_objc_decls(); remove dependency on struct objc_class. + (encode_method_def): Removed; encode_method_prototype() is + used instead. + (objc_clear_super_receiver): New function. + (objc_expand_function_end): Do not do anything for ordinary + C functions. + (finish_method_def): Mark ObjC methods as un-inlinable. + (gen_declaration_1): Emit widths of bitfields. + (finish_objc): Call generate_objc_image_info() if needed; + use check_duplicates() when checking for selector duplicates. + (generate_objc_image_info): New function. + * objc/objc-act.h (add_instance_method, add_class_method, + get_class_ivars): Remove prototypes. + (objc_build_throw_stmt, objc_build_try_catch_finally_stmt, + objc_build_synchronized_prologue, objc_build_synchronized_epilogue, + objc_build_catch_stmt, objc_build_catch_epilogue, + objc_build_finally_prologue, objc_build_finally_epilogue, + add_method, get_class_ivars_from_name): New prototypes. + (CLASS_BINFO_ELTS, PROTOCOL_BINFO_ELTS): New. + (TYPE_PROTOCOL_LIST): Robustify to distinguish from + TRANSLATION_UNIT_DECLs. + (OBJC_TYPE_NAME): New. + (objc_tree_code): Ensure that either or + got included. + (IS_SUPER): Robustify. + (umsg_stret_decl, umsg_super_stret_decl, umsg_nonnil_decl, + umsg_nonnil_stret_decl, objc_storage_class, objc_exception_extract_decl, + objc_exception_try_enter_decl, objc_exception_try_exit_decl, + objc_exception_match_decl, objc_exception_throw_decl, + objc_sync_enter_decl, objc_sync_exit_decl, objc_exception_data_template, + objc_setjmp_decl, objc_stack_exception_data, objc_caught_exception, + objc_rethrow_exception, objc_eval_once, objc_exception_block_stack, + objc_catch_type): New ObjC/ObjC++ roots. + * objc/objc-tree.def (MESSAGE_SEND_EXPR, CLASS_REFERENCE_EXPR): New + ObjC/ObjC++ tree node codes. + +2003-09-24 Alexandre Oliva + + * cpplib.c (do_pragma): Reintroduce cb_line_change call in the + code path that calls a handler. + +2003-09-24 Nathanael Nerode + + * config.gcc (c4x-*, tic4x-*, d30v-*, mmix-knuth-mmixware): + Disable fixproto. + + * config.gcc: Clean up and reindent $with_cpu=yes|no clause and + the section giving $with_cpu defaults by target. + + * config.gcc (arm-*-coff*, armel-*-coff*, arm*-*-ecos-elf, + arm*-*-elf, ep9312-*-elf, arm*-wince-pe*, arm*-*-pe*, arm*-*-pe*, + rs6000-ibm-aix4.[3456789]*, powerpc-ibm-aix4.[3456789]*, + rs6000-ibm-aix5.1.*, powerpc-ibm-aix5.1.*, + rs6000-ibm-aix[56789].*, powerpc-ibm-aix[56789].*, + i[34567]86-pc-msdosdjgpp*): Disable fixproto. + +2003-09-24 David Edelsohn + + * config/rs6000/rs6000.md (movti_power): Collapse case 1 and 2 + together. Protect load string instruction with TARGET_STRING. + (movti_string): Collapse case 1 and 2 together. + +2003-09-24 Nathan Sidwell + + * c-common.c (c_common_type_for_mode): Check for VOIDmode. + +2003-09-24 Richard Earnshaw + + * arm.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Wrap in + do...while(0) + +2003-09-23 Nathanael Nerode + + * config.gcc: Move use_fixproto=no from generic vxworks clause to + specific one. + + * config.gcc (powerpc-*-gnu-gnualtivec*): Disable fixproto + (accidentally missed in last pass). + +2003-09-23 Andrew Pinski + + PR bootstrap/12383 + * configure: Regenerate. + +2003-09-23 Nathanael Nerode + + * config.gcc (x86_64-*-freebsd*): Disable fixproto (accidentally + missed in last pass). + +2003-09-23 Alexandre Oliva + + * config/mn10300/mn10300.md (andsi3): Fix cut&pasto in 0xfffffffe + constant. + +2003-09-23 Nathanael Nerode + + * config.gcc: Move vax-*-vms* unsupported notice up with the rest. + + * config.gcc (alpha64*-dec-*vms*, alpha*-dec-*vms*, + powerpc-*-eabisim*, powerpc-*-eabi*, powerpcle-*-eabisim*, + powerpcle-*-eabi*): Disable fixproto. + + * config.gcc: Move use_fixproto=no from generic FreeBSD clause to + specific FreeBSD clauses. + * config.gcc: Move use_fixproto=no from generic NetBSD clause to + specific NetBSD clauses. + * config.gcc: Move use_fixproto=no from generic OpenBSD clause + to specific OpenBSD clauses. + +2003-09-23 John David Anglin + + * pa.c (hppa_expand_prologue): Do pic register save in frame marker + without adding a frame note. + * pa.md (allocate_stack): Save pic register in new frame marker when + generating pic code. + +2003-09-23 Kelley Cook + + * cgraphunit.c (cgraph_expand_all_functions): Renamed from + cgraph_expand_functions. + +2003-09-23 Kaveh R. Ghazi + + * Makefile.in (gnucompare*): Merge into ... + (slowcompare*): ... here. + (fastcompare*): New targets. + * aclocal.m4 (gcc_AC_PROG_CMP_IGNORE_INITIAL): Add checks for + other "fast" cmp programs. + * configure: Regenerate. + +2003-09-23 Rainer Orth + + * targhooks.c: Include output.h. + * Makefile.in (targhooks.o): Add output.h to dependency list. + +2003-09-23 Rainer Orth + + * config.host: Removed superfluous newline. + +2003-09-23 Nathanael Nerode + + * config.gcc: Use ${target}, not $machine. + * configure.in: Don't set $machine. + * configure: Regenerate. + +2003-09-23 Geoffrey Keating + + * config/t-darwin (crt2.o): Add stmp-int-hdrs to dependencies. + + * config/rs6000/rs6000.c (function_arg_pass_by_reference): Don't + pass zero-size arrays by reference. + (rs6000_va_arg): Likewise. + +2003-09-23 Nathanael Nerode + + * config.gcc: Set use_fixproto=no in each specific *-gnu* + configuration, rather than the generic one. + +2003-09-23 Richard Henderson + + * tree-inline.c (remap_save_expr): Map new save_expr to identity + rather than to error_mark_node. + +2003-09-23 Rainer Orth + + * configure.in (HAVE_GAS_SHF_MERGE): Always define to test result. + Update description. + * configure: Regenerate. + * config.in: Likewise. + * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Test for + HAVE_GAS_SHF_MERGE value. + * varasm.c (mergeable_string_section): Likewise. + (mergeable_constant_section): Likewise. + +2003-09-23 Rainer Orth + + * except.h (MUST_USE_SJLJ_EXCEPTIONS): Test for DWARF2_UNWIND_INFO + value. + +2003-09-23 Rainer Orth + + * target.h (struct gcc_target): New member external_libcall. + * target-def.h (TARGET_ASM_EXTERNAL_LIBCALL): Provide default. + (TARGET_ASM_OUT): Use it. + * doc/tm.texi (TARGET_ASM_EXTERNAL_LIBCALL): Document. + * targhooks.c: Convert to ISO C 90. + (default_external_libcall): New function. + * targhooks.h (default_external_libcall): Declare. + * varasm.c (assemble_external_libcall): Use + targetm.asm_out.external_libcall instead of + ASM_OUTPUT_EXTERNAL_LIBCALL. + * config/mips/mips-protos.h [TARGET_IRIX5 || TARGET_IRIX 6] + (mips_output_external_libcall): Declare. + * config/mips/mips.c (mips_output_external_libcall): Change + definition guard. + Change to match TARGET_ASM_EXTERNAL_LIBCALL. + Only operate for O32 ABI. + * config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Define + instead of ASM_OUTPUT_EXTERNAL_LIBCALL. + * config/mips/iris6.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Don't undef, + superceded by TARGET_ASM_EXTERNAL_LIBCALL. + +2003-09-22 Nathnael Nerode + + * config.gcc: Do per-target disabling of fixproto here in clauses, + not in t- fragments. + * configure.in: Adjust to set STMP_FIXPROTO correctly. + * configure: Regenerate. + * config/arm/t-semi, config/cris/t-cris, config/i386/t-beos, + config/i386/t-cygming, config/i386/t-nto, config/ia64/t-hpux, + t-freebsd, t-linux, t-netbsd, t-openbsd, t-rtems, t-vxworks, + xtensa/t-xtensa: Remove setting of STMP_FIXPROTO. + * config/i370/t-oe, config/i386/t-netware, config/pa/t-bsd, + t-interix, t-linux-aout: Delete files consisting only of + setting of STMP_FIXPROTO. + + * config.host: Allow unknown hosts (not targets). Allow + ns32k-*-netbsdelf* as a host (not a target). Remove redundant + empty clauses. Remove useless obsolete-configuration clause. + Prune unsupported configuration list. Collapse identical + clauses for closely related systems. Rewrite comment for + unsupported hosts list. Reorganize a little. + +2003-09-22 Richard Henderson + + * c-common.c (c_common_signed_or_unsigned_type): Examine mode, + not precision. + +2003-09-22 David Edelsohn + Hartmut Penner + Segher Boessenkool + + * config/rs6000/rs6000.c (altivec_in_gprs_p): Rename to ... + (gpr_or_gpr_p): Test INT_REGNO_P and convert to boolean. + (rs6000_split_altivec_in_gprs): Rename to ... + (rs6000_split_multireg_move): Add support for update addressing. + * config/rs6000/rs6000-protos.h: Same. + * config/rs6000/altivec.md: Same. + * config/rs6000/rs6000.md (movdi_internal32): Use new splitter for + multiple GPRs. + (movti): Remove TARGET_STRING || TARGET_POWERPC64 final condition. + (movti_power): Use new splitter for multiple GPRs. + (movti_string): Same. + (movti_ppc64): Same. + +2003-09-22 Bob Wilson + + * config/xtensa/xtensa-protos.h: Convert to ISO C90. + * config/xtensa/xtensa.c: Convert to ISO C90. Minor formatting fixes. + +2003-09-22 Alexandre Oliva + + * config/mn10300/mn10300.md: Revert 2003-09-17's patch. + (andsi3): Set attr cc to set_zn when using shifts or adds. + +2003-09-22 Bernardo Innocenti + + * doc/contrib.texi: Add Peter Barada, Paul Dale and myself. + +2003-09-22 Bernardo Innocenti + + * config/m68k/m68k.h (MASK_RTD, TARGET_RTD, RETURN_POPS_ARGS): + Resurrect -mrtd option. + +2003-09-21 Andrew Pinski + + PR target/12281 + * config/darwin.c (machopic_validate_stub_or_non_lazy_ptr): Call + mark_referenced instead of setting TREE_SYMBOL_REFERENCED. + +2003-09-22 Olivier Hainque + + PR target/9786 + * reg-stack.c (convert_regs_1): Purge possible dead eh edges + after potential deletion of trapping insn. Avoids later ICE + from call to fixup_abnormal_edges. + (convert_regs_2): Stack the current block successors before + processing this block, that is, before the potential deletion of + dead edges by convert_regs_1, because these edges have been used + to initialize the predecessors count. + +2003-09-22 Eric Botcazou + + * real.c: Fix several nits in the head comment. + +2003-09-21 Richard Henderson + + * tree.h c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c, + diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c, + print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c, + tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c, + config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Revert. + +2003-09-21 Richard Henderson + + * tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const. + (TREE_FILENAME, TREE_LINENO): Likewise. + (set_tree_locus, copy_tree_locus, set_tree_file_line): New. + (TREE_LOCUS_SET_P): New. + * c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c, + diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c, + print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c, + tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c, + config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match. + +2003-09-21 Nathanael Nerode + + * config/vax/vax-protos.h: Convert to ISO C90. + * config/vax/vax.c: Convert to ISO C90. + +2003-09-21 Graham Stott + + PR target/12353 + * config/i386/i386.md(ffs_no_cmove): Fix operand 2 constraint. + +2003-09-21 Eric Botcazou + + PR target/12301 + * reorg.c (stop_search_p): Return 1 for insns that can + throw internally. + +2003-09-20 Richard Henderson + + * c-format.c (gcc_diag_char_table): Add %J. + (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise. + (check_format_types): Fix wanted_type name lookup. + (init_dynamic_diag_info): Setup %J. + * diagnostic.c (text_specifies_location): Implement %J. + * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c, + dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c, + tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c, + config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, + config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics. + + * tree-inline.c: Include intl.h + (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason. + * Makefile.in (tree-inline.o): Update. + +2003-09-20 Roger Sayle + + * config/i386/i386.c (ix86_expand_carry_flag_compare): Fix + transformation of a>=0 into (unsigned)a<0x80000000. + +2003-09-20 Andrew Pinski + + * config/darwin.c (machopic_select_rtx_section): Fix check for PIC code. + +2003-09-20 Nathanael Nerode + + * Makefile.in: Don't set (unused) DLLTOOL. + + * config/arm/t-linux, config/arm/t-netbsd, config/arm-t-semi: + Remove obsolete references to ENQUIRE. + +2003-09-19 Nathanael Nerode + + * configure.in: Remove --with-elf, which doesn't work. + * configure: Regenerate. + * config.gcc: Remove references to $elf, which does nothing. + + * config/i386/xm-vsta.h: Remove xm-file believed useless. + * config.build (i386-vsta): Remove reference to it. + * config.host (i386-vsta): Remove reference to it. + +2003-09-19 Phil Edwards + + * doc/install.texi: Document the multiple testsuite options. + +2003-09-19 Gerald Pfeifer + + * doc/install.texi (Specific): Add the specific versions of GCC + where support for FreeBSD 1, HP-UX version 9 and older, and AIX + version 3 and older was discontinued. + +2003-09-19 Joel Sherrill + + * config/m68k/t-m68kbare, config/m68k/t-rtems: Change 68681 to + 68881. + +2003-09-19 Bernardo Innocenti + + * config/m68k/m68k.h (TARGET_CPU_CPP_PREDEFINES): Add predefines + for -m68030, -m68020-60 and -m68020-40. + * config/m68k/m68k.h (TARGET_68030): New target flag. + * config/m68k/m68k.h (MASK_RTD, TARGET_RTD, MASK_REGPARM, + TARGET_REGPARM): Remove. + * config/m68k/m68k.h: Regroup and renumber target flags. + * config/m68k/m68k.h (TARGET_SWITCHES): Fix some tabulations. + * config/m68k/m68k.h (RETURN_POPS_ARGS): Always evaluate to 0. + * config/m68k/m68k.h (FUNCTION_ARG): Likewise. + * config/m68k/m68k.h (FUNCTION_ARG_PARTIAL_NREGS): Likewise. + * config/m68k/m68k-none.h: Use MASK_xxx values in M68K_CPU_xxx macros. + +2003-09-19 Ralf Corsepius + + * config/m68k/t-rtems (m68k-*-rtems*): New. + * config.gcc: Use config/m68k/t-rtems. + +2003-09-19 Ralf Corsepius + + * config/mips/t-rtems: New. + * config.gcc (mips*-*-rtems*): Use config/mips/t-rtems. + +2003-09-19 Kelley Cook + + * cgraph.c: Fix typo in debugging output. + +2003-09-19 T. Papadopoulo + Eric Botcazou + + PR target/12166 + * config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1. + +2003-09-18 Mike Stump + + * c-ppoutput.c (print): Use fileline typedef for field 'line'. + (print_line, maybe_print_line, cb_define, cb_undef, cb_include, + cb_ident, cb_def_pragma): Use fileline typedef. + * cpphash.h (struct cpp_reader): Likewise for field out.first_line. + +2003-09-18 Danny Smith + + * config/i386/winnt.c (gen_stdcall_suffix): Quit summation of + total parm size if a parm has incomplete type. + (gen_fastcall_suffix): Likewise. + +2003-09-18 Richard Kenner + + * except.c (output_function_exception_table): Adjust last change + to handle TYPE of INTEGER_CST. + +2003-09-18 Mark Mitchell + + PR target/11184 + * builtins.c (expand_builtin_apply): Use convert_memory_address + before returning the value. + + * alias.c (find_base_value): Simplify use of + convert_memory_address. + (find_base_term): Likewise. + * builtins.c (expand_builtin_stejmp_setup): Likewise. + (expand_builtin_longjmp): Likewise. + (expand_builtin_prefetch): Likewise. + (get_memory_rtx): Likewise. + (expand_builtin_return): Likewise. + (expand_builtin_memcpy): Likewise. + (expand_builtin_strncpy): Likewise. + (expand_builtin_memset): Likewise. + (expand_builtin_va_arg): Likewise. + (expand_builtin_va_copy): Likewise. + (expand_builtin_alloca): Likewise. + * calls.c (expand_call): Likewise. + * except.c (expand_builtin_extract_return_addr): Likewise. + (expand_builtin_eh_return): Likewise. + * explow.c (convert_memory_address): Define even when + POINTER_EXTEND_UNSIGNED is not defined. Do nothing if the address + is already in the right mode. + * explow.c (memory_address): Simplify use of convert_memory_address. + (probe_stack_range): Likewise. + * expmed.c (make_tree): Likewise. + * expr.c (emit_block_move_in_libcall): Likewise. + (expand_assignment): Likewise. + (expand_expr): Likewise. + * function.c (assign_parms): Likewise. + (expand_function_end): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * stmt.c (expand_computed_goto): Likewise. + +2003-09-18 Roger Sayle + + * simplify-rtx.c (simplify_unary_operation): Only transform + (not (eq X Y)) into (ne X Y) when mode is BImode or STORE_FLAG_VALUE + is -1. RTL "not" is a bit-wise not, "~", not a logical not "!". + +2003-09-18 Zdenek Dvorak + + PR target/11674 + * config/i386/i386.c (x86_emit_floatuns): Also handle SImode operand. + +2003-09-18 Roger Sayle + + * tree.def (FFS_EXPR, CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, + PARITY_EXPR): Delete unused tree codes. + * c-common.c (c_common_truthvalue_conversion): Delete references + to FFS_EXPR and POPCOUNT_EXPR. + * c-pretty-print.c (pp_c_postfix_expression): Remove FFS_EXPR. + (pp_c_expression): Likewise. + * expr.c (expand_expr): Delete RTL expansion of FFS_EXPR, CLZ_EXPR, + CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR. + * fold-const.c (tree_expr_nonnegative_p): Remove FFS_EXPR, CLZ_EXPR, + CTZ_EXPR, POPCOUNT_EXPR and PARITY_EXPR. Add support for calls to + BUILT_IN_FFS, BUILT_IN_PARITY and BUILT_IN_POPCOUNT and their long + and long long variants. + +2003-09-18 Gabriel Dos Reis + + * c-pretty-print.h (pp_type_specifier_seq): Fix thinko. + * c-pretty-print.c: Fix formatting. + (pp_c_integer_constant): Append type annotation to literals. Tidy. + (pp_c_type_specifier): Tidy. + (pp_c_compound_literal): New function. + (pp_c_initializer): Simplify.. + (pp_c_initializer_list): Likewise. + (pp_c_brace_enclosed_initializer_list): New function. + (pp_c_postfix_expression): Simplify. + +2003-09-17 Alexandre Oliva + + * config/mn10300/mn10300.md (andsi3, iorsi3, xorsi3, + one_complsi2, bit-clear, bit-set, iorqi3): Make them set_zn. + +2003-09-17 Richard Henderson + + * tree-optimize.c (tree_rest_of_compilation): Save and restore + input_location. + +2003-09-17 Daniel Jacobowitz + + * config/rs6000/sysv4.h (LIB_LINUX_SPEC): Give -lpthread before -lc. + +2003-09-17 Richard Henderson + + * cfg.c (dump_flow_info): Skip register dump if reg_n_info null. + +2003-09-17 Rainer Orth + + * configure.in (gcc_cv_ld_hidden): Don't test gnu_ld_flag. + * configure: Regenerate. + +2003-09-17 Mark Mitchell + + PR debug/12066 + * dbxout.c (dbxout_init): Use a langhook to find builtin types. + * langhooks-def.h (lhd_return_null_tree_v): New function. + (LANG_HOOKS_BUILTIN_TYPE_DECLS): New macro. + (LANG_HOOKS_DECLS): Add it to the intializer. + * langhooks.c (lhd_return_null_tree_v): New function. + * langhooks.h (lang_hooks_for_decls): Add builtin_type_decls. + +2003-09-17 Daniel Jacobowitz + + * configure.in: Quote gcc_config_arguments for configargs.h. + * configure: Regenerated. + * gccbug.in: Don't shell-expand gcc_config_arguments. + +2003-09-17 Gabriel Dos Reis + + PR c++/11357 + * c-pretty-print.c (pp_c_floating_constant): Append + type-annotation to floating constants. + +2003-09-17 Rainer Orth + + * config/mips/iris5.h (TARGET_OS_CPP_BUILTINS): Define _LONGLONG. + Define _ABIO32. + Use it for _MIPS_SIM. + * config/mips/iris6-o32.h (TARGET_OS_CPP_BUILTINS): Removed. + + * config/mips/iris6-o32-as.h (SUBTARGET_ASM_OPTIMIZING_SPEC): + Moved ... + * config/mips/iris5.h (SUBTARGET_ASM_OPTIMIZING_SPEC): ... here, + updating comment. + Fixes PR target/10190. + +2003-09-17 Daniel Jacobowitz + + * config/rs6000/sysv4.h (LIB_LINUX_SPEC): Make -pthread apply + to shared libraries. + +2003-09-17 Eric Botcazou + + PR optimization/11646 + * cfgrtl.c (purge_dead_edges) [JUMP_INSN]: Rematerialize the + EDGE_ABNORMAL flag for EH edges. + * toplev.c (rest_of_handle_cse): Delete unreachable blocks + if dead edges were purged. + +2003-09-16 Bernardo Innocenti + + * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Add target predefines. + * config/m68k/m68k-none.h (CPP_CPU_DEFAULT_SPEC): Kill all definitions. + * config/m68k/m68k-none.h (CPP_FPU_SPEC): Remove. + * config/m68k/m68k-none.h (CPP_SPEC): Likewise. + +2003-09-16 Ian Lance Taylor + + * cfgcleanup.c (label_is_jump_target_p): Correct use of table + returned by tablejump_p. + +2003-09-16 Joel Brobecker + + * dwarf2asm.c (dw2_asm_output_nstring): Add comment. + +2003-09-16 Roger Sayle + + PR bootstrap/12269 + * simplify-rtx.c (simplify_gen_relational): Allow the cmp_mode + argument to be VOIDmode, taking the mode of the comparison from + the operands. Only call simplify_relational_operation if we + know the mode of the comparison. Honor FLOAT_STORE_FLAG_VALUE + if comparison has a floating point result. Ensure that the + result is always of the specified mode. + (simplify_replace_rtx): Simplify call to simplify_gen_relational. + (simplify_unary_operation): Ensure the correct mode and cmp_mode + are always passed to simplify_gen_relational. Simplify NOT of + comparison operator in any mode, not just BImode. + (simplify_ternary_operation): Correct tests on the return value + of simplify_relational_operation to use const_true_rtx, not + const1_rtx. Abort if it ever returns a non-constant result. + + * cfgloopanal.c (count_strange_loop_iterations): Use the function + simplify_relational_operation, not simplify_gen_relational, if + we're only interested in constant comparisons and will ignore + non-constant results. + +2003-09-16 Roger Sayle + + * fold-const.c (tree_swap_operands_p): New function to determine + the prefered ordering of operands. + (fold): Numerous clean-ups. Use tree_swap_operands_p when swapping + operands to commutative, comparison or ternary operators. Replace + uses of TREE_SET_CODE with recursive call to fold. Remove duplicate + transformation of A ? B : C into !A ? C : B. + +2003-09-16 Jakub Jelinek + + * config/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/alpha/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/arm/linux-elf.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/rs6000/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/rs6000/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/sh/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/sparc/linux.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + * config/sparc/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Define. + +2003-09-16 Jason Merrill + Jakub Jelinek + + * c-common.c (handle_warn_unused_result_attribute): New function. + (c_common_attribute_table): Add warn_unused_result. + (c_expand_expr): Issue warning when result of inlined function + with warn_unused_result attribute is ignored. + * calls.c (expand_call): Issue warning when result of function + with warn_unused_result attribute is ignored. + * c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Define. + * expr.c (expr_wfl_stack): Define. + (expand_expr) : If ignore, + pass const0_rtx as target. Chain locations into expr_wfl_stack. + * tree-inline.c (expand_call_inline): Set STMT_EXPR_WARN_UNUSED_RESULT + bit if inlined function has warn_unused_result attribute. + * input.h (expr_wfl_stack): Declare. + * doc/extend.texi: Document warn_unused_result attribute. + +2003-09-15 Alexandre Oliva + + * cpplib.c (do_pragma): Remove unnecessary cb_line_change. + +2003-09-15 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_multibss_section_type_flags): Add + ATTRIBUTE_UNUSED. + (call_insn_operand): For PIC, don't allow a direct call to a + function in a different section than the current one. + +2003-09-16 Volker Reichelt + + * doc/invoke.texi (Warning Options): Add missing hyphen before + "Wimport". Change "-Wno-endif-labels" to "-Wendif-labels". + Move "-Wold-style-definition" to the C-only section. + Fix the ordering of the warning options. + +2003-09-15 Zdenek Dvorak + Jeff Law + + * gcse.c (remove_reachable_equiv_notes): New. + replace_store_insn): Call it. Update antic list. + (store_killed_in_insn): Take REG_EQUAL notes into account. + (build_store_vectors, delete_store): Add parameter to + replace_store_insn call. + +2003-09-15 Bob Wilson + + * config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND_P): Use + SYMBOL_REF_LOCAL_P. + +2003-09-15 Kazu Hirata + + * expr.h (DEFAULT_FUNCTION_ARG_PADDING): New. + (FUNCTION_ARG_PADDING): Use DEFAULT_FUNCTION_ARG_PADDING. + * config/ia64/ia64.c (ia64_hpux_function_arg_padding): + Likewise. + * config/m68hc11/m68hc11.c (m68hc11_function_arg_padding): + Likewise. + * config/rs6000/rs6000.c (function_arg_padding): Likewise. + * config/sparc/sparc.c (function_arg_padding): Likewise. + +2003-09-15 Vladimir Makarov + + * haifa-sched.c (schedule_block): Use ready_remove_first instead + of choose_ready for non-dfa insn scheduling. + +2003-09-15 Andreas Jaeger + Kaveh R. Ghazi + + * doc/invoke.texi (Warning Options): Describe -Wold-style-definition. + * c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition. + * c-parse.in: Warn about old-style parameter definition. + * c-common.c: Define warn_old_style_defintion. + * c-common.h: Declare it. + * c.opt: Add Wold-style-defintion. + +2003-09-15 Andreas Jaeger + + * config/rs6000/altivec.h: Convert () prototypes to ISO C90. + * config/rs6000/rs6000.c: Likewise. + +2003-09-12 Zdenek Dvorak + + PR optimization/10914 + * expr.h (get_condition, canonicalize_condition): Declaration changed. + * cfgloopanal.c (simple_loop_exit_p): Add parameter to a get_condition + and canonicalize_condition calls. + * gcse.c (fis_get_condition, delete_null_pointer_checks_1, + delete_null_pointer_checks): Ditto. + * ifcvt.c (noce_get_alt_condition, noce_get_condition): Ditto. + * predict.c (estimate_probability, expected_value_to_br_prob): Ditto. + * loop.c (check_dbra_loop, get_condition_for_loop): Ditto. + (canonicalize_condition, get_condition): Allow to return comparisons + of cc mode registers. + * loop-unswitch.c (may_unswitch_on_p, unswitch_single_loop): Allow + cc mode registers comparison in condition. + +2003-09-12 Mark Mitchell + + * coverage.c (create_coverage): Do not call pushlevel/poplevel. + * langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New + function. + * langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it. + +2003-09-14 Kazu Hirata + + * combine.c (simplify_comparison): Convert + (ne (and (lshiftrt (xor X CST) Y) 1) 0) into + (eq (and (lshiftrt X Y) 1) 0). + +2003-09-14 Kazu Hirata + + * alias.c: Follow spelling conventions. + * cpphash.h: Likewise. + * fold-const.c: Likewise. + +2003-09-14 Alexandre Oliva + + * c-ppoutput.c (cb_line_change): Revert 2003-08-04's change. + * c-lex.c (cb_line_change): Skip line changing whenever + c-ppoutput.c would. + +2003-09-14 Steven Bosscher + + * ra.c: Convert to ISO C90 prototypes. + * ra-build.c: Likewise. + * ra-colorize.c: Likewise. + * ra-debug.c: Likewise. + * ra-rewrite.c: Likewise. + +2003-09-14 Richard Sandiford + + * Makefile.in (%.dvi): Remove excess $(docdir). + +2003-09-14 Richard Sandiford + + * function.c (STACK_BYTES): Move definition to head of file. + (assign_parms): Don't pass current_function_pretend_args_size + directly to SETUP_INCOMING_VARARGS. For partial register arguments, + round current_function_pretend_args_size up to STACK_BYTES. Skip any + excess before laying out the argument. + +2003-09-14 Andreas Jaeger + + * objc/objc-act.c: Convert to ISO C90 prototypes. + * objc/objc-act.h: Likewise. + +2003-09-14 Olaf Hering + + * config/rs6000/rs6000.c: Fix typo: Remove extra ')'. + +2003-09-13 Andrew Pinski + + PR target/12021 + * config/m68k/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Remove the asserts + as they already are done in config/m68k/m68k.h. + * config/m68k/netbsd.h (TARGET_OS_CPP_BUILTINS): Likewise + + * config/rs6000/rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Remove. + (machopic_output_stub): Only generate pic base symbols when using pic + and generate them in the form L00000000$spb. + +2003-09-13 Richard Henderson + + * cgraphunit.c (cgraph_assemble_pending_functions): Export. + (cgraph_finalize_function): Revert TREE_ASM_WRITTEN check. + * cgraph.h: Update. + +2003-09-12 Dale Johannesen + + * config/rs6000/rs6000.c: Fix typos in previous. + +2003-09-12 Ziemowit Laski + + * pretty-print.c (pp_construct): Use xcalloc instead of xmalloc + when allocating pp->buffer. + +2003-09-12 Geoffrey Keating + + * config/darwin.c (machopic_select_rtx_section): Use + const_data_section for things that might require relocation. + +2003-09-12 H.J. Lu + + PR bootstrap/12264 + * tree-inline.c (inline_forbidden_p_1): Cast the 3rd arg to tree. + +2003-09-12 Bob Wilson + + * config/xtensa/elf.h (ASM_SPEC): Remove no-density option. Reformat. + * config/xtensa/linux.h (ASM_SPEC): Likewise. + * config/xtensa/xtensa.h (TARGET_SWITCHES): Remove -mbig-endian, + -mlittle-endian, -m[no-]density, -m[no-]abs, -m[no-]addx, -m[no-]mac16, + -m[no-]mul16, -m[no-]mul32, -m[no-]nsa, -m[no-]minmax, -m[no-]sext, + -m[no-]booleans, -mhard-float, -msoft-float, -m[no-]hard-float-div, + -m[no-]hard-float-recip, -m[no-]hard-float-sqrt, and + -m[no-]hard-float-rsqrt options. Delete corresponding MASK_* macros + and redefine corresponding TARGET_* macros with constants from the + xtensa-config.h header. + * doc/invoke.texi (Option Summary, Xtensa Options): Remove documention + for the options listed above. + +2003-09-12 Dale Johannesen + + * config/rs6000/rs6000-protos.h: Use C90 prototypes. + * config/rs6000/rs6000-c.c: Ditto. + * config/rs6000/rs6000.c: Ditto. + * config/rs6000/ sysv4.h: Ditto. + +2003-09-12 Chris Lattner + + * loop.c: Move comments describing BIV's and GIV's to top of file + +2003-09-12 Roger Sayle + + PR optimization/8967 + * alias.c (write_dependence_p): Modify to take an additional constp + argument that controls whether the UNCHANGING_RTX_P flags are used. + (anti_dependence, output_dependence): Adjust write_dependence_p + callers to pass this additional argument, to return the same result. + (unchanging_anti_dependence): New variant of anti_dependence that + ignores the UNCHANGING_RTX_P property on memory references. + * rtl.h (unchaning_anti_dependence): Prototype here. + * flow.c (init_propagate_block): Place fake constant mem writes on + the mem_set_list so that dead writes to const variables are deleted. + (insn_dead_p): Change anti_dependence to unchanging_anti_dependence. + (mark_used_regs): Likewise. + +2003-09-12 Richard Sandiford + + * config/mcore/mcore-protos.h (mcore_r15_operand_p): Declare. + (mcore_secondary_reload_class): Declare. + (mcore_output_inline_const_forced): Remove. + * config/mcore/mcore.md (movsi): Remove the code that forced + non-inlineable constants into a register if the target was r15 + or the stack pointer. Remove constant restrictions from the main + define_insn. Remove r <- I, r <- M and r <- N alternatives in favor + of an r <- P alternative. Remove fallback define_insn for reload. + (movhi, movqi): Use gen_lowpart rather than gen_SUBREG. Remove reload + define_insn. Use mcore_output_move in the remaining define_insn. + Adjust condition and constraints in the way as for movsi. + (movdi): Always split unacceptable constants into two. Use + simplify_gen_subreg instead of operand_subword{,_force}. + * config/mcore/mcore.c (mcore_output_inline_const_forced): Remove. + (mcore_output_move): Support HImode and QImode moves as well. + (mcore_m15_operand_p): New function. + (mcore_reload_class): Use it to detect cases where LRW_REGS are better. + (mcore_secondary_reload_class): New function. + * config/mcore/mcore.h (SECONDARY_RELOAD_CLASS): Redefine in + terms of mcore_secondary_reload_class. + +2003-09-11 Mike Stump + + * c-lex.c (fe_file_change): Don't transform to_line with SOURCE_LINE. + +2003-09-11 Kaveh R. Ghazi + + * builtins.c (fold_builtin_logarithm): if N can't be truncated to + MODE exactly, then only convert logN(N) -> 1.0 if + flag_unsafe_math_optimizations is set. + + * builtins.c (builtin_dconsts_init, dconstpi, dconste, + init_builtin_dconsts): Delete. + * emit-rtl.c (dconstpi, dconste): Define. + (init_emit_once): Initialize dconstpi & dconste. + * real.h (dconstpi, dconste): Declare. + +2003-09-11 Alexandre Oliva + + PR fortran/11522 + * dwarf2out.c (gen_inlined_subroutine_die): Emit abstract function + for ultimate origin even if block is abstract. + +2003-09-11 Roger Sayle + + * combine.c (combine_simplify_rtx): Move several NOT and NEG + optimizations from here... + * simplify-rtx.c (simplify_unary_operation): to here. Recursively + simplify expressions using simplify_gen_*ary instead of gen_rtx_*. + +2003-09-11 Richard Henderson + + * cgraphunit.c (cgraph_finalize_function): Add nested arg. + Tweek tests for function already generated. + (cgraph_expand_function): Don't double announce in !unit-at-a-time. + * cgraph.h (cgraph_finalize_function): Update for extra arg. + * c-decl.c (finish_function): Likewise. + +2003-09-10 Joe Buck + + * c-decl.c (poplevel): Eliminate use of |= in function_body assignment. + +2003-09-10 Jerry Quinn + + * real.c: Update URL to VAX floating point docs. + (decode_vax_d): Extract 8 exponent bits instead of 7. + +2003-09-10 Ian Lance Taylor + + * combine.c (force_to_mode): Set fuller_mask based only on mask, + not op_mode. + +2003-09-11 Jan Hubicka + + * c-objc-common.c (c_cannot_inline_tree_fn): Warn + on why function is not inlinable; do not check + the body. + (inline_forbidden_p): Move to... + * tree-inline.c (inline_forbidden_p_1): ... here; Add warnings; + deal with alloca, longjmp. + (inline_forbidden_p): New static function. + (find_alloca_call_1, find_alloca_call, find_builtin_longjmp_call_1, + find_builtin_longjmp_call): Kill. + +2003-09-10 Richard Henderson + + * cgraph.h (struct cgraph_node): Rename lowered to analyzed. + * cgraphunit.c: Update to match. + (record_call_1): Rearrange. Call lang hook for language nodes. + (cgraph_analyze_function): Don't call lower_function. + * langhooks.h (struct lang_hooks_for_callgraph): Replace + lower_function with analyze_expr. + * langhooks-def.h: Update to match. + * langhooks.c (lhd_callgraph_analyze_expr): New. + +2003-09-10 Martin Husemann + + PR target/11965 + * config/sparc/sparc.c (sparc_v8plus_shift): Protect against + constants greater than 63. + * config/sparc/sparc.md (ashlsi3, ashrsi3, lshrsi3): Protect + against constants greater than 31. + (*ashldi3_sp64, *ashrdi3_sp64, *lshrdi3_sp64): Protect against + constants greater than 63. + +2003-09-09 Richard Henderson + + * cgraphunit.c (cgraph_finalize_function): Remove unused argument. + * cgraph.h (cgraph_finalize_function): Update. + * c-decl.c (finish_function): Update. + +2003-09-09 Devang Patel + + * config/darwin.h (LINK_SPEC): Pass -nofixprebinding to linker. + * doc/invoke.texi: Document new Darwin linker option -nofixprebinding. + +2003-09-09 Eric Christopher + + * configure.in: Change usage of 'head' to 'sed 1q'. + * configure: Regenerate. + +2003-09-09 Richard Henderson + + * except.c: Include cgraph.h. + (output_function_exception_table): Invoke + cgraph_varpool_mark_needed_node. + * Makefile.in (except.o): Update. + +2003-09-07 Kelley Cook + + * Makefile.in: Define REMAKEFLAGS for LANGUAGES & BOOT_CFLAGS + and use it throughout. + +2003-09-09 Kaveh R. Ghazi + + * builtins.c (real_dconstp, fold_builtin_logarithm, + fold_builtin_exponent): New, split out from fold_builtin. Also + generalize to add log2, log10, exp2 and exp10/pow10 equivalents. + * emit-rtl.c (dconst3, dconst10, dconstthird): New. + (init_emit_once): Initialize new dconsts, use ARRAY_SIZE in lieu + of hardcoded array size. + * fold-const.c (fold): Add cases for exp2, exp10 and pow10. + (tree_expr_nonnegative_p): Likewise. + * real.h (dconst3, dconst10, dconstthird): New. + +2003-09-09 Jan Hubicka + + * cgraphunit.c (cgraph_finalize_function): Fix handling of extern + inline functions. + (cgraph_finalize_compilation_unit): Fix crash when dealing with lost + DECL_SAVED_TREE. + +2003-09-09 Roger Sayle + + * builtins.c (fold_builtin_cabs): Protect the complex argument + against multiple evaluation when optimizing cabs* into sqrt*. + +2003-09-09 Jan Hubicka + + * varasm.c (notice_global_symbol): Properly deal with weak symbols. + +2003-09-08 Kelley Cook + + * Makefile.in: Revert yesterday's change. + +2003-09-08 Bernardo Innocenti + Peter Barada + + * config/m68k/coff.h (REGISTER_NAMES): Add fake register `argptr' + * config/m68k/hp320.h (REGISTER_NAMES): Likewise. + * config/m68k/linux.h (REGISTER_NAMES): Likewise. + * config/m68k/m68kelf.h (REGISTER_NAMES): Likewise. + * gcc/config/m68k/sgs.h (REGISTER_NAMES): Likewise. + * config/m68k/m68k-protos.h (m68k_initial_elimination_offset): Add prototype. + * config/m68k/m68k.c (m68k_frame): New struct, simular to ix86 back-end. + (m68k_compute_frame_layout): New function. + (m68k_initial_elimination_offset): New function. + (m68k_output_function_prologue): ColdFire-specific movem handling. + (m68k_output_function_epilogue): Likewise. + * config/m68k/m68k.h (FIRST_PSEUDO_REGISTER): Make room for argptr reg. + (ARG_POINTER_REGNUM): Add new definition. + (INITIAL_FRAME_POINTER_OFFSET): Remove macro. + (ELIMINABLE_REGS): Define new macro, like in ix86 back-end. + (CAN_ELIMINATE): Likewise. + (INITIAL_ELIMINATION_OFFSET): Likewise. + +2003-09-08 Bernardo Innocenti + + * config/m68k/m68k.c (m68k_output_function_prologue): Simplify + by removing redundant variable cfa_store_offset. + +2003-09-08 Mark Mitchell + + * langhooks-def.h (lhd_register_builtin_type): New function. + (LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update. + * langhooks.h (lang_hooks_for_types): Add register_builtin_type. + * langhooks.c (lhd_register_builtin_type): New function. + * c-common.h (c_register_builtin_type): Declare. + * c-common.c (c_register_builtin_type): New function. + * c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to + c_register_builtin_type. + * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg, + __float80, and __float128 macros. + * config/ia64/ia64.c (ia64_init_builtins): Create __fpreg, + __float80, and __float128 types. + +2003-09-08 Kaveh R. Ghazi + + * builtin-types.def + (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, + BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE, + BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT): New. + * builtins.def (BUILT_IN_CACOS, BUILT_IN_CACOSF, BUILT_IN_CACOSH, + BUILT_IN_CACOSHF, BUILT_IN_CACOSHL, BUILT_IN_CACOSL, + BUILT_IN_CARG, BUILT_IN_CARGF, BUILT_IN_CARGL, BUILT_IN_CASIN, + BUILT_IN_CASINF, BUILT_IN_CASINH, BUILT_IN_CASINHF, + BUILT_IN_CASINHL, BUILT_IN_CASINL, BUILT_IN_CATAN, + BUILT_IN_CATANF, BUILT_IN_CATANH, BUILT_IN_CATANHF, + BUILT_IN_CATANHL, BUILT_IN_CATANL, BUILT_IN_CCOS, BUILT_IN_CCOSF, + BUILT_IN_CCOSH, BUILT_IN_CCOSHF, BUILT_IN_CCOSHL, BUILT_IN_CCOSL, + BUILT_IN_CEXP, BUILT_IN_CEXPF, BUILT_IN_CEXPL, BUILT_IN_CPOW, + BUILT_IN_CPOWF, BUILT_IN_CPOWL, BUILT_IN_CPROJ, BUILT_IN_CPROJF, + BUILT_IN_CPROJL, BUILT_IN_CSIN, BUILT_IN_CSINF, BUILT_IN_CSINH, + BUILT_IN_CSINHF, BUILT_IN_CSINHL, BUILT_IN_CSINL, BUILT_IN_CSQRT, + BUILT_IN_CSQRTF, BUILT_IN_CSQRTL, BUILT_IN_CTAN, BUILT_IN_CTANF, + BUILT_IN_CTANH, BUILT_IN_CTANHF, BUILT_IN_CTANHL, BUILT_IN_CTANL): + New. + * doc/extend.texi: Document new builtins. + +2003-09-09 Jan Hubicka + + * cgraph.c (cgraph_varpool_finalize_decl): Sanity check duplicated + finalization. + * cgraphunit.c (decide_is_fnction_needed): Avoid special case of nested + functions, check for COMDAT. + (cgraph_assemble_pending_functions): Break out from... + (cgraph_finalize_function): ... here; allow redefinig of extern inline + functions. + (record_call_1): Record function references only in non-unit-at-a-time + mode. + (cgraph_analyze_function): Reset current_function_decl. + (cgraph_finalize_compilation_unit): Assemble pending functions. + +2003-09-08 Mark Mitchell + + * mklibgcc.in (libcc.a): Depend on stmp-dirs. + (libgov.a): Likewise. + (libgcc_eh.a): Likewise. + +2003-09-08 Roger Sayle + + * fold-const.c (operand_equal_p): Clarify documentation. + +2003-09-08 Richard Henderson + + * c-decl.c (c_expand_body_1): Push and pop function context here. + * tree-optimize.c (tree_rest_of_compilation): ... not here. Take + nested argument instead of computing nesting ourselves. + +2003-09-08 Jakub Jelinek + + * toplev.c (rest_of_handle_stack_regs): Call split_all_insns before + regstack if optimizing but not scheduling after reload. + +2003-09-08 Jakub Jelinek + + * config/sparc/sparc.c (struct machine_function): New type. + (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. + (sparc_override_options): Initialize init_machine_status. + (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand, + tie_symbolic_operand, tle_symbolic_operand): New functions. + (symbolic_operand): Disallow tls_symbolic_operand. + (symbolic_memory_operand): Likewise. + (tls_call_delay, sparc_cannot_force_const_mem, legitimate_constant_p, + constant_address_p, legitimate_pic_operand_p, legitimate_address_p): + New functions. + (sparc_tls_symbol): New variable. + (sparc_tls_get_addr, sparc_tls_got, legitimize_tls_address, + legitimize_address): New functions. + (print_operand): Handle %&. + (sparc_init_machine_status, get_some_local_dynamic_name, + get_some_local_dynamic_name_1): New functions. + (sparc_output_dwarf_dtprel): New function. + * config/sparc/sparc.h (CONSTANT_ADDRESS_P): Moved into + constant_address_p. + (LEGITIMATE_PIC_OPERAND_P): Moved into legitimate_pic_operand_p. + (LEGITIMATE_CONSTANT_P): Moved into legitimate_constant_p. + (GO_IF_LEGITIMATE_ADDRESS): Moved into legitimate_address_p. + (LEGITIMIZE_ADDRESS): Moved into legitimize_address. + (PRINT_OPERAND_PUNCT_VALID_P): Add '&'. + (TARGET_TLS, TARGET_SUN_TLS, TARGET_GNU_TLS): Define. + (ASM_OUTPUT_DWARF_DTPREL): Define. + (PREDICATE_CODES): Add tgd_symbolic_operand, tld_symbolic_operand, + tie_symbolic_operand, tle_symbolic_operand. + * config/sparc/sparc.md (UNSPEC_TLSGD, UNSPEC_TLSLDM, UNSPEC_TLSLDO, + UNSPEC_TLSIE, UNSPEC_TLSLE, UNSPEC_TLSLD_BASE): New constants. + (tls_call_delay): New attribute. + (in_call_delay): Use it. + (movqi, movhi, movsi, movdi): Call legitimize_tls_address if needed. + (tgd_hi22, tgd_lo10, tgd_add32, tgd_add64, tgd_call32, tgd_call64, + tldm_hi22, tldm_lo10, tldm_add32, tldm_add64, tldm_call32, tldm_call64, + tldo_hix22, tldo_lox10, tldo_add32, tldo_add64, tie_hi22, tie_lo10, + tie_ld32, tie_ld64, tie_add32, tie_add64, tle_hix22_sp32, + tle_lox10_sp32, tle_hix22_sp64, tle_lox10_sp64): New insns. + (tldo_ldub_sp32, tldo_ldub1_sp32, tldo_ldub2_sp32, tldo_ldsb1_sp32, + tldo_ldsb2_sp32, tldo_ldub_sp64, tldo_ldub1_sp64, tldo_ldub2_sp64, + tldo_ldub3_sp64, tldo_ldsb1_sp64, tldo_ldsb2_sp64, tldo_ldsb3_sp64, + tldo_lduh_sp32, tldo_lduh1_sp32, tldo_ldsh1_sp32, tldo_lduh_sp64, + tldo_lduh1_sp64, tldo_lduh2_sp64, tldo_ldsh1_sp64, tldo_ldsh2_sp64, + tldo_lduw_sp32, tldo_lduw_sp64, tldo_lduw1_sp64, tldo_ldsw1_sp64, + tldo_ldx_sp64, tldo_stb_sp32, tldo_stb_sp64, tldo_sth_sp32, + tldo_sth_sp64, tldo_stw_sp32, tldo_stw_sp64, tldo_stx_sp64): New + insns. + * config/sparc/sparc-protos.h (legitimate_constant_p, + constant_address_p, legitimate_pic_operand_p, legitimate_address_p, + legitimize_tls_address, legitimize_address, tls_symbolic_operand, + tls_call_delay, sparc_output_dwarf_dtprel): New prototypes. + * config/sparc/linux.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Define. + * config/sparc/linux64.h (TARGET_GNU_TLS, TARGET_SUN_TLS): Likewise. + * configure.in (sparc*-*-*): Add TLS check. + * configure: Rebuilt. + +2003-09-07 Eric Botcazou + + PR target/11689 + * config/i386/i386.c (memory_address_length): Fix computation when + the base is esp or ebp. + +2003-09-07 Mark Mitchell + + PR c++/11852 + * varasm.c (initializer_constant_valid_p): Correct logic for + CONSTRUCTORs. + +2003-09-07 Roger Sayle + + * expr.c (expand_operands): New function to expand an operand pair. + (expand_expr): Call expand_operands whenever we need to expand both + operands of a binary operator. + (do_store_flag): Likewise for operands of comparison operations. + +2003-09-07 Roger Sayle + + * combine.c (combine_simplify_rtx): Don't convert -(A*B) into + (-A)*B if we care about sign-dependent rounding. + +2003-09-07 Gabriel Dos Reis + + * c-pretty-print.h (pp_c_left_brace): Declare. + (pp_c_right_brace): Likewise. + * c-pretty-print.c (pp_c_left_brace): Now a function + (pp_c_right_brace): Likewise. + +2003-09-07 Jan Hubicka + + * cfgcleanup.c (try_simplify_condjump): Fix again the preivous patch. + +2003-09-07 Gabriel Dos Reis + + * diagnostic.c (warn_deprecated_use): Move to toplev.c + +2003-09-07 Gabriel Dos Reis + + * langhooks.c (lhd_print_error_function): Move from diagnostic.c. + * Makefile.in (langhooks.o): Depend on diagnostic.h + +2003-09-06 James E Wilson + + * loop.c (loop_regs_update): Delete else clause for PATTERN rtx and + simplify. + +2003-09-07 Kelley Cook + + * Makefile.in: Define $REMAKE to be $MAKE with LANGUAGES & BOOT_CFLAGS + and use it throughout. + +2003-09-07 Jan Hubicka + + * cfgcleanup.c (try_simplify_condjump): Fix my previous patch. + + * toplev.c (rest_of_decl_compilation): Do not finalize external + virables. + + * cgraph.c (cgraph_mark_reachable_node): Only enqueue finalized + functions. + (cgraph_varpool_finalize_decl): Notice global symbol when needed. + +2003-09-06 Jan Hubicka + + PR target/12070 + * calls.c (emit_library_call_value_1): Fix saving of BLKmode arguments. + + PR opt/12082 + * cfgcleanup.c (try_simplify_condjump): Avoid unreachable code warning. + +2003-09-06 Gabriel Dos Reis + + * diagnostic.c (announce_function): Move to toplev.c. + +2003-09-06 Zdenek Dvorak + + * gcse.c (expr_equiv_p): Don't consider anything to be equal to + volatile mem. + +2003-09-06 Kaveh R. Ghazi + + * ggc-common.c (init_ggc_heuristics): Don't use the heuristics + when gc checking is enabled. + +2003-09-06 Steven Bosscher + + PR c/9862 + * c-decl.c (c_expand_body_1): Move return warning from here... + (finish_function): ...to here. + +2003-09-05 Geoffrey Keating + + * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Always return + a subset of the input class. + +2003-09-05 Kazu Hirata + + * config/i860/i860.c: Follow spelling conventions. + * config/i860/i860.h: Likewise. + * config/sh/sh.h: Likewise. + +2003-09-05 Nitin Yewale + + * config/h8300/h8300-protos.h: Declare h8300_hard_regno_rename_ok + * config/h8300/h8300.h (HARD_REGNO_RENAME_OK): New. + * config/h8300/h8300.c (h8300_hard_regno_rename_ok): New. + +2003-09-05 Roger Sayle + Richard Henderson + + PR optimization/1823 + * expmed.c (expand_divmod ): Use an unsigned + multiplication to implement division by constant integer. + +2003-09-05 Jan Hubicka + + * opts.c (decode_options): Enable unit-at-a-time at -O2. + * params.def (max-inline-insns-single): Set to 500 + (max-inline-insns-auto): Set to 150 + * invoke.texi (max-inline-insns-single, max-inline-insns-auto): Update. + +2003-09-04 Richard Henderson + + * cgraph.c (cgraph_mark_reachable_node): Split out from ... + (cgraph_mark_needed_node): Remove needed argument. + * cgraph.h: Update to match. + * cgraphunit.c (decide_is_function_needed): Split out from ... + (cgraph_finalize_function): Reorg. Avoid deferred_inline_function + if we generated the function. + (record_call_1): Update for cgraph_mark_reachable_node. + * varasm.c (mark_referenced): Likewise. + * objc/objc-act.c (mark_referenced_methods): Likewise. + +2003-09-04 DJ Delorie + + * targhooks.c: Add comment explaining the migration process. + +2003-09-04 Eric Christopher + + * config/frv/t-frv: Fix path for frv-abi.h. + * config/frv/frv-asm.h: Fix string concatenation. + +2003-09-04 DJ Delorie + + * builtins.c (apply_args_size): Guard against a NULL cfun. + (expand_builtin_apply_args_1): Likewise. + (expand_builtin_apply): Likewise. + Fixes PR bootstrap/12172. + +2003-09-04 Rainer Orth + + * configure.in (gcc_cv_as_ix86_cmov_sun_syntax): Check if + assembler supports Sun syntax for cmov. + * configure: Regenerate. + * config.in: Likewise. + * config/i386/i386.c: Rename CMOV_SUN_AS_SYNTAX to + HAVE_AS_IX86_CMOV_SUN_SYNTAX. + * config/i386/sol2.h (CMOV_SUN_AS_SYNTAX): Remove. + Fixes PR target/12101. + +2003-09-04 Matt Austern + + * c-common.c (fname_as_string): Use lang_hooks.decl_printable_name + with verbosity 0, instead of DECL_NAME, for human-readable string. + +2003-09-04 Eric Christopher + + * targhooks.c (default_return_in_memory): Allow + unconverted ports. + +2003-09-04 Eric Christopher + + * targhooks.c (default_return_in_memory): Fix typo + in last checkin. + +2003-09-04 Eric Christopher + + * targhooks.c (default_return_in_memory): Fix default + definition. + +2003-09-04 Bernardo Innocenti + + * config/m68k/m68k.c (m68k_coff_asm_named_section): Restore + deleted function. + * config/m68k/coff.h (M68K_TARGET_COFF): Add flag used to + enable coff-only code in m68k.c. + +2003-09-04 Nick Clifton + + * config.gcc: Add v850e1 target. Allow --with-cpu to accept + v850e1. + * config/v850/v850.h: Accept v850e1 as a default CPU. + Accept -mv850e1 as a command line option. + * doc/invoke.texi: Document new -mv850e1 command line switch. + * config/v850/t-v850: Treat -mv850e1 as a multilib alias for + -mv850e. + +2003-09-04 Nick Clifton + + * config.gcc (v850e-*-*): Use t-v850e makefile fragment. + * config/v850/t-v850: Only produce one extra multilib - for + the v850e. + * config/v850/t-v850e: New file: Only produce one extra + multilib - for the v850. + +2003-09-04 Jakub Jelinek + + * config/ia64/libgcc-ia64.ver: Export _Unwind_GetBSP@@GCC_3.3.2. + * config/ia64/unwind-ia64.c (_Unwind_GetBSP): New function. + * unwind.h (_Unwind_GetBSP): New prototype. + * libgcc-std.ver: Add empty GCC_3.3.2 version. + * mkmap-symver.awk: For symbol versions with no exported symbols, + don't put anything into version script, just change all symbol + versions which inherit from it to inherit from its ancestor. + +2003-09-04 Eric Christopher + + * config/mips/mips.c (mips_expand_prologue): Convert to + calls.struct_value_rtx hook. + (reg_or_const_float_1_operand): New. + * config/mips/mips.h: Update Comments. + (mips_arg): Add reg_or_const_float_1_operand. + * config/mips/mips.md (divdf3); Convert to expander. + (divsf3): Ditto. + (*divdf3): New pattern. + (*divsf3): Ditto. + +2003-09-04 Jan Hubicka + + * toplev.c (wrapup_global_declarations): Fix final pass in + unit-at-atime mode. + +2003-09-04 Mark Mitchell + + * doc/extend.texi: Document removal of cast-as-lvalue extension in + C++. + +2003-09-04 Nicolas Roche + + * gcc.c (process_command): Fix typo. + +2003-09-03 David O'Brien + + optimization/11980 + * config/i386/freebsd.h (SIZE_TYPE): Support TARGET_64BIT. + (PTRDIFF_TYPE): Likewise. + (WCHAR_TYPE_SIZE): Likewise. + +2003-09-03 DJ Delorie + + * targhooks.c: New file. + * targhooks.h: New file. + * Makefile.in: Add targhooks.o support. + (function.o): Depend on$(TARGET_H). + (stmt.o): Likewise. + (combine.o): Depend on $(TREE_H) and $(TARGET_H). + * builtins.c (apply_args_size, expand_builtin_apply_args_1, + expand_builtin_apply): Convert to calls.struct_value_rtx hook. + (expand_builtin_saveregs): Convert to + calls.expand_builtin_saveregs hook. + * c-decl.c (start_decl): Handle new calls.promote_prototypes hook + here, instead of ... + (get_parm_info) ... here. + (store_parm_decls_oldstyle): Convert to calls.promote_prototypes + hook. + (finish_function): Handle calls.promote_prototypes hook here too. + * c-typeck.c (convert_arguments): Convert to + calls.promote_prototypes hook. + (c_convert_parm_for_inlining): Likewise. + * calls.c (initialize_argument_information): Convert to + calls.promote_function_args hook. + (expand_call): Convert to calls.struct_value_rtx, + calls.strict_argument_naming, + calls.pretend_outgoing_varargs_named, and + calls.promote_function_return hooks. Pass fndecl to + aggregate_value_p. Initialize CUMULATIVE_ARGS before calling + hooks, so they can use that. + (emit_library_call_value_1): Likewise. + * combine.c (setup_incoming_promotions): Convert to + calls.promote_function_args hook. + * emit-rtl.c: Convert to calls.struct_value_rtx hook. + * expr.c (expand_assignment): Pass call to aggregate_value_p. + (expand_expr): Likewise. + * expr.h: Remove support for SETUP_INCOMING_VARARGS, + STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, + RETURN_IN_MEMORY macro defaults. + * final.c (profile_function): Convert to calls.struct_value_rtx + hook. + * function.c (aggregate_value_p): Accept function type tree as + second parameter; try to deduce fntype from it. Convert to + calls.return_in_memory hook. + (assign_parms): Convert to calls.setup_incoming_varargs, + calls.strict_argument_naming, calls.promote_function_args, + calls.pretend_outgoing_varargs_named hooks. Pass fndecl to + aggregate_value_p. + (expand_function_start): Likewise. Convert to + calls.struct_value_rtx hook. + (expand_function_end): Convert to calls.promote_function_return hook. + (allocate_struct_function): Pass fndecl to aggregate_value_p. + * hard-reg-set.h: Update comments to new hook names. + * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. + * reg-stack.c (stack_result): Likewise. + * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. + * stmt.c (expand_value_return): Convert to + calls.promote_function_return hook. + * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, + TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, + TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, + TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, + TARGET_STRICT_ARGUMENT_NAMING, + TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. + * target.h: Likewise. + * tree.h (aggregate_value_p): Also takes a tree to deduce function + attributes from (for target hooks). + * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, + PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, + STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, + EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, + STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert + to hooks. + + * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function + to aggregate_value_p. + * config/arm/arm.c (arm_init_cumulative_args, + arm_output_mi_thunk): Likewise. + * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): + Likewise. + * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, + mips_can_use_return_insn): Likewise. + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. + * config/s390/s390.c (s390_output_mi_thunk): Likewise. + * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to + aggregate_value_p. + * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass + function to aggregate_value_p. + * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to + aggregate_value_p. + + * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. + (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, + sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c + (sh_handle_renesas_attribute, sh_promote_prototypes, + sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, + sh_setup_incoming_varargs, sh_strict_argument_naming, + sh_pretend_outgoing_varargs_named): New decls. + (targetm): Add new hooks. + (calc_live_regs): Save MACL and MACH if the function has the + renesas attribute. + (sh_expand_prologue): Support renesas attribute. + (sh_builtin_saveregs): Make static. + (sh_build_va_list): Support renesas attribute. + (sh_va_start): Likewise. + (sh_va_arg): Likewise. + (sh_promote_prototypes): New. + (sh_function_arg): New, moved from sh.h. Support renesas + attribute. + (sh_function_arg_advance): Likewise. + (sh_return_in_memory): Likewise. + (sh_strict_argument_naming): Likewise. + (sh_pretend_outgoing_varargs_named): Likewise. + (sh_struct_value_rtx): New. + (sh_attribute): Add renesas attribute. + (sh_handle_renesas_attribute): New. + (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. + (sh_ms_bitfield_layout_p): Support renesas attribute also. + (sh_output_mi_thunk): Pass function to aggregate_value_p. * + config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for + -mhitachi. + (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to + target hooks. + (sh_args): Add renesas_abi flag. + (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. + (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. + (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the + stack for the renesas abi. + (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, + SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, + PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set + call cookie to indicate renesas calls. + +2003-09-03 Mostafa Hagog + + * gcse.c (replace_one_set): New function. + (pre_insert_copy_insn): Change the order of copying + to make copy propagation discover additional PRE opportunities. + +2003-09-03 Roger Sayle + + PR optimization/11700. + * simplify-rtx.c (simplify_subreg): Check that the subreg offset + of a hard register is representable before trying to simplify it + using subreg_hard_regno. + +2003-09-04 Rainer Orth + + * configure.in (gcc_cv_ld_hidden): Disable unless using GNU ld. + * configure: Regenerate. + +2003-09-04 Rainer Orth + + * intl.h (N_): Remove parentheses. + +2003-09-03 Bernardo Innocenti + + * config.gcc (m68k-*-linux*): Remove definition of LINUX_DEFAULT_ELF. + * config/i370/linux.h (LINUX_DEFAULT_ELF): Remove unconditional + definition and code blocks compiled when not defined. + * config/i386/linux.h (LINUX_DEFAULT_ELF): Likewise. + * config/i386/linux64.h (LINUX_DEFAULT_ELF): Likewise. + * config/sparc/linux.h: (LINUX_DEFAULT_ELF): Likewise. + * config/sparc/linux64.h: (LINUX_DEFAULT_ELF): Likewise. + +2003-09-03 Jeff Sturm + + * cgraphunit.c (visited_nodes): New static variable. + (record_call_1): Use walk_tree with visited_nodes. + (cgraph_create_edges): Use walk_tree with visited_nodes. + Setup/teardown visited_nodes hashtable. + +2003-09-03 Roger Sayle + + * toplev.c (flag_rounding_math): New global variable. + (f_options): Add to the list of language independent options. + * flags.h (flag_rounding_math): Prototype here. + (HONOR_SIGN_DEPENDENT_ROUNDING): Use flag_rounding_math instead. + * common.opt (frounding-math): New common command line option. + * opts.c (common_handle_option): Handle OPT_frounding_math. + (set_fast_math_flags): -ffast-math clears flag_rounding_math. + + * doc/invoke.texi: Document this new command line option. + +2003-09-03 Rainer Orth + + * config/sol2.h (NO_IMPLICIT_EXTERN_C): Update comment. + +2003-09-03 Jan Hubicka + + * Makefile.in (c-objc-common.o): Kill gt-c-objc-common.h dependency. + * c-decl.c (finish_function): Kill arguments, always use cgraph path. + * c-objc-common.c: Kill include of gt-c-objc-common.h + (expand_deferred_fns, deffer_fn): Kill function. + (deferred_fns): Kill variable. + (finish_cdtor): Update finish_function call. + (c_objc_common_finish_file): Always call cgraph code. + * c-parse.c: Regenerate. + * c-parse.y: Regenerate. + * c-tree.h (finish_function): Update prototype. + * objc-acct.c (build_module_descriptor, finish_method_def): + Update call of finish_function. + * cgraphunit.c (cgraph_default_inline_p, cgraph_analyze_function): Add + forward prototype. + (cgraph_finalize_function): In non-unit-at-a-time mode analyze the + function and assemble it if needed. + (cgraph_finalize_compilation_unit): Do nothing in non-unit-at-a-time + mode. + (cgraph_optimize): Likewise. + (cgraph_expand_function): In non-unit-at-a-time mode keep function body + even when it has no inline callees. + * c-parse.in: Update calls to finish_function. + +2003-09-03 Nick Clifton + + * config/arm/arm.h: Handle TARGET_CPU_iwmmxt. + Use #error to generate the message if TARGET_DEFAULT is not + recognised. + +2003-09-03 Richard Sandiford + + * config/mips/mips.h (MASK_UNUSED1): Remove. + (MASK_XGOT, TARGET_XGOT): Define. + (TARGET_SWITCHES): Add an entry for -mxgot. + (ASM_SPEC): Map -mxgot to -xgot. + * config/mips/mips.c (mips_symbol_insns): Use TARGET_XGOT to decide + whether we're using a big-GOT sequences. + (mips_legitimize_const_move, mips_expand_call): Likewise. + (override_options): Revert 2003-01-09 change. + * doc/invoke.texi: Document -mxgot. + +2003-09-02 Jason Merrill + + * config/sol2.h (NO_IMPLICIT_EXTERN_C): Define here. + * config/sparc/sol2.h: Not here. + +2003-09-02 Roger Sayle + + * expr.c (expand_expr): The code following both_summands performs + the same task as simplify_gen_binary. Replace all gotos to + both_summands with a call to simplify_gen_binary and delete the + now unused label. + +2003-09-02 Jason Merrill + + PR c++/7327 + * config/sparc/sol2.h (NO_IMPLICIT_EXTERN_C): Define. + +2003-09-02 Jeff Sturm + + * cgraphunit.c (record_call_1): Use walk_tree_without_duplicates. + (cgraph_optimize_function): Set current_function_decl to the + fndecl we're integrating from. + +2003-09-02 Kaveh R. Ghazi + + * builtins.def: Break out _Complex math functions into their + own category. + +2003-09-02 Andreas Jaeger + + * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_STMT): Cast properly. + +2003-09-02 Josef Zlomek + + * cfgbuild.c (compute_outgoing_frequencies): Use NOTE instead of + finding the note again. + +2003-09-02 Nathanael Nerode + + * config.gcc: Remove host-specific rewrites of target_alias. + +2003-09-01 Mark Mitchell + + * Makefile.in (genprogs): Fix typo. + + * Makefile.in (gencheck.o): Remove build commands. + (dummy-conditions.o): Likewise. + (read-rtl.o): Likewise. + (gensupport.o): Likewise. + (genconfig$(build_exeext)): Remove rule. + (genconfig.o): Remove build commands. + (genflags$(build_exeext)): Remove rule. + (genflags.o): Remove build commands. + (gencodes$(build_exeext)): Remove rule. + (gencodes.o): Remove build commands. + (genconstants.o): Remove build commands. + (genemit$(build_exeext)): Remove rule. + (genemit.o): Remove build commands. + (genrecog$(build_exeext)): Remove rule. + (genrecog.o): Remove build commands. + (genextract$(build_exeext)): Remove rule. + (genextract.o): Remove build commands. + (genpeep$(build_exeext)): Remove rule. + (genpeep.o): Remove build commands. + (genattr$(build_exeext)): Remove rule. + (genattr.o): Remove build commands. + (genprognames): New variable. + (genprogs): Likewise. + (genobjs): Likewise. + (genprogs): New rule. + (genobjs): Likewise. + (genattrtab.o): Remove build commands. + (genautomata.o): Likewise. + (genoutput$(build_exeext)): Remove rule. + (genoutput.o): Remove build commands. + (gengenrtl.o): Likewise. + (genpreds.o): Likewise. + (gengtype.o): Likewise. + (genconditions.o): Likewise. + (gen-protos.o): Likewise. + (scan.o): Likewise. + (fix-header.o): Likewise. + (scan-decls.o): Likewise. + (check-g++): Combine with other check targets. + (check-gcc): Likewise. + (check-g77): Likewise. + (check-objc): Likewise. + +2003-09-01 Nathanael Nerode + + * config.gcc: Remove host-specific stuff which is unused here + since the introduction of config.host. + + * doc/fragments.texi: Mention config.host. + * doc/sourcebuild.texi: Mention config.host. Give brief descriptions + of config.build, config.host, and config.gcc. + +2003-09-01 Zack Weinberg + + * c-decl.c (pushdecl): Don't put variables on + C_TYPE_INCOMPLETE_VARS of a type unless that type is itself + incomplete. + +2003-09-01 Nathanael Nerode + + * config.host: New file. + * config.gcc: Remove some host-specific stuff and some + logic needed only for repeated invocation. + * configure.in: Use config.host. + * configure: Regenerate. + +2003-09-01 Josef Zlomek + + * c-typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. + * convert.c (convert_to_integer): Kill BIT_ANDTC_EXPR. + * fold-const.c (int_const_binop): Kill BIT_ANDTC_EXPR. + (fold): Kill BIT_ANDTC_EXPR and label bit_and. + * tree.def (BIT_ANDTC_EXPR): Kill. + +2003-08-31 Nathanael Nerode + + * configure.in: Remove uses of "for x in .. ${foo}" idiom. + * configure: Regenerate. + + * config.gcc: Remove references to install_headers_dir, now unused + since introduction of config.build. + * config.gcc (i860-*-sysv4*): Don't set unused USG, SVR3 defines. + + * doc/fragments.texi, doc/sourcebuild.texi: Mention new file + config.build. + + * config.build: New file. + * config.gcc: Remove some build-specific stuff. + * configure.in: Use config.build. + * configure: Regnerate. + +2003-08-31 Steven Bosscher + Roger Sayle + + PR middle-end/11823 + * stmt.c (expand_end_case_type): Only use jump tables for dense + switch statements when optimizing for size. + +2003-08-31 Olivier Hainque + + * builtins.c (expand_builtin_setjmp): Use emit_jump to jump around + the != 0 case, which ensures pending stack adjustments are flushed. + +2003-08-30 Zack Weinberg + + * configure.frag: Delete file. + * configure.in: Rename the substitution variables + dep_host_xmake_file and dep_tmake_file to xmake_file and + tmake_file respectively. Do not expand $srcdir in the + value of these; leave that for Make. Introduce a new + substitution varaible, all_lang_makefrags, which lists + subdirectory Make-lang.in files; exclude these from + all_lang_makefiles, which is now only for subdirectory + outputs. Do not invoke configure.frag. Do not set nor + AC_SUBST_FILE target_overrides, host_overrides, or + language_fragments. Create build subdirectories in + config.status extra commands. + * configure: Regenerate. + * Makefile.in: Update substitutions to match changes to + configure. Use include directives instead of @-insertions + to read in host, target, and language fragments. + (Makefile rule): Do not invoke configure.frag. Do not copy + config.status to config.run before executing it. Set + CONFIG_HEADERS and CONFIG_FILES so that only Makefile gets + regenerated. + (cstamp-h rule): Set CONFIG_FILES as well as CONFIG_HEADERS. + +2003-08-30 Zack Weinberg + + * c-tree.h: Delete COMPARE_DIFFERENT_TU from enumeration. + * c-typeck.c (same_translation_unit_p): New function. + (comptypes): Use it instead of flags parameter to identify + structure types from different translation units. + * c-decl.c (duplicate_decls): Always call comptypes with + COMPTYPE_STRICT flags argument. + (c_reset_state): Set BLOCK_SUPERCONTEXT of the block formed + to file_scope_decl. + +2003-08-30 Zack Weinberg + + * c-tree.h (C_TYPE_INCOMPLETE_VARS): New macro. + * c-decl.c (struct c_scope): Remove "incomplete" field. + (pushdecl): Attach variables with incomplete types to + the TYPE_MAIN_VARIANT of the incomplete type in question. + (finish_struct): Look at C_TYPE_INCOMPLETE_VARS for variables + to complete, not at current_scope->incomplete. All such + variables do need completion. + +2003-08-30 Richard Earnshaw + Nicolas Pitre + + * arm/lib1funcs.asm (RETCOND): Delete. + (RETLDM): New assembler macro. Use it for returning with ldm/ldr. + (ARM_LDIV0, THUMB_LDIV0): Collapse multiple definitions. + (__ARM_ARCH__): Move here from ieee754-?f.S. + (RET, RETc): Clean up definitions. + (DIV_FUNC_END): Renamed from FUNC_END. All uses changed. + (FUNC_END): New macro that marks the end of any function. + (ARM_FUNC_START): New macro that allows an assembler routine to be + implemented in ARM code even if a Thumb-only build. + Unconditionally include ieee754-?f.S. + * arm/ieee754-df.S: Delete macros moved to lib1funcs.asm. + Mark ends of functions. + Split into separate conditionally-compiled units. + Use RETLDM to return from routines. + * arm/ieee754-sf.S: Similarly. + * t-arm-elf (LIB1ASMFUNCS): Remove _ieee754_dp and _ieee754_sp. + Add _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 + _fixsfsi and _fixunssfsi. + + * arm/ieee754-df.S (__muldf3): Fix bug when result of a + multiplication underflows to zero. + (__adddf3): Fix bug when using VFP ordering on little-endian + processors. + (__fixdfsi): Use rrx to extract the carry into a register instead of + MRS instruction. Optimize later use of result. + * arm/ieee754-sf.S (__fixsfsi): Likewise. + (__fixunssfsi): Use a better sequence for handling negative-or-zero. + +2003-08-29 Richard Henderson + + * tree-optimize.c: New file. + * Makefile.in (OBJS-archive): Add tree-optimize.o. + (tree-optimize.o): New. + * c-decl.c (store_parm_decls): Use allocate_struct_function. + (finish_function): Don't free_after_parsing or free_after_compilation. + (set_save_expr_context): Move to tree-optimize.c. + (c_expand_body_1): Use tree_rest_of_compilation. + * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. + * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New. + * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines; + iterate until closure. + * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START, + LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New. + (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New. + * langhooks.h (struct lang_hooks_for_rtl_expansion): New. + * toplev.h (tree_rest_of_compilation): Declare it. + +2003-08-29 Richard Henderson + + * function.h (struct function): Add rtl_inline_init, saved_for_inline. + * integrate.c (save_for_inline): Set saved_for_inline. + * c-semantics.c (genrtl_scope_stmt): Check it. + * toplev.c (wrapup_global_declarations): Check it. + (rest_of_handle_inlining): Set and check rtl_inline_init. + (rest_of_compilation): Remove out of date comment. + +2003-08-29 Richard Henderson + + * function.c (allocate_struct_function): New, split out of ... + (prepare_function_start, init_function_start): ... here. + * expr.c (init_expr): Use ggc_alloc_cleared. + * stmt.c (init_stmt_for_function): Likewise. + * tree.h (allocate_struct_function): Declare. + +2003-08-29 Nathanael Nerode + + * config.gcc: Don't use negated character class in shell case + clause. + +2003-08-29 Richard Henderson + + * function.h (struct function): Move function_frequency and + max_jumptable_ents before start of bit field members. + +2003-08-29 Richard Henderson + + * builtins.c (expand_builtin_constant_p): Check cse_not_expected here, + (fold_builtin_constant_p) ... not here. + +2003-08-29 Richard Henderson + + * c-tree.h (C_DECL_FILE_SCOPE): Move ... + * tree.h (DECL_FILE_SCOPE_P): ... here, and rename. + * c-decl.c, c-objc-common.c, c-typeck.c: Update to match. + +2003-08-29 Kaveh R. Ghazi + + * builtins.def: Fix typos. + (ATTR_MATHFN_FPROUNDING_STORE): New macro. + (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL, BUILT_IN_MODF, + BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO, BUILT_IN_REMQUOF, + BUILT_IN_REMQUOL, BUILT_IN_SINCOS, BUILT_IN_SINCOSF, + BUILT_IN_SINCOSL): Use ATTR_MATHFN_FPROUNDING_STORE. + + * builtins.def (BUILT_IN_ERFC, BUILT_IN_ERFCF, BUILT_IN_ERFCL): + Use ATTR_MATHFN_FPROUNDING_ERRNO. + +2003-08-29 Nathanael Nerode + + * config.gcc (i386-*-vsta): Fix obvious bogosity. + + * fixinc/inclhack.def: Remove special cases for unsupported + PTX 1 and PTX 2 (including i[34567]86-sequent-sysv3). + * fixinc/fixincl.x: Regenerate. + +2003-08-29 Mark Mitchell + + * Makefile.in (cpp.info): Just state dependencies. + (gcc.info): Likewise. + (gccint.info): Likewise. + (gccinstall.info): Likewise. + (cppinternals.info): Likewise. + (cpp.dvi): Likewise. + (gcc.dvi): Likewise. + (gccint.dvi): Likewise. + (gccinstall.dvi): Likewise. + (cppinternals.dvi): Likewise. + (gcov.1): Likewise. + (cpp.1): Likewise. + (gcc.1): Likewise. + (gfdl.7): Likewise. + (gpl.7): Likewise. + (fsf-funding.7): Likewise. + ($(objdir)/%.info): New pattern rule. + (%.dvi): Likewise. + +2003-08-29 Kelley Cook + + * Makefile.in (restage1): Pass BOOT_CFLAGS to recursive make. + (restage2): Likewise. + (restage3): Likewise. + (restage4): Likewise. + (restageprofile): Likewise. + (restagefeedback): Likewise. + (bubblestrap): Likewise. + +2003-08-29 Nathanael Nerode + + * config.gcc: Narrow unsupported target match to avoid clobbering + i?86-sequent-sysv4*. + +2003-08-29 Kaveh R. Ghazi + + * builtins.c (mathfn_built_in): Handle new math builtins. + +2003-08-28 Per Bothner + + Fix (hopefully temporary) for breakage caused by my 08-21 patch. + * cpplex.c (_cpp_get_fresh_line): Check for null buffer. + (_cpp_lex_buffer): Likewise. + * cpptrad.c (_cpp_read_logical_line_trad): Likewise. + +2003-08-28 Ulrich Weigand + + * config/s390/s390.md ("*mulsi3_sign"): New insn. + ("mulsidi3" expander, "mulsi_6432" insn): Remove, replace by ... + ("mulsidi3"): ... this new insn. + ("umulsidi3"): New insn. + ("divmoddi3", "divmodtidi3", "divmodtisi3"): Simplify by using + mixed-mode matching constraints. + ("udivmodsi4", "udivmoddisi3"): New insns. + ("udivsi3", "umodsi3"): Use only in ESA/390 mode. + +2003-08-28 Kaveh R. Ghazi + + * builtin-types.def (BT_INT_PTR, BT_FLOAT_PTR, BT_DOUBLE_PTR, + BT_LONGDOUBLE_PTR, BT_FN_FLOAT_FLOAT_FLOATPTR, + BT_FN_DOUBLE_DOUBLE_DOUBLEPTR, + BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR, + BT_FN_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_INTPTR, + BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, + BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR, + BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR, + BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR, + BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR, + BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR): New. + * builtins.def (BUILT_IN_FREXP, BUILT_IN_FREXPF, BUILT_IN_FREXPL, + BUILT_IN_MODF, BUILT_IN_MODFF, BUILT_IN_MODFL, BUILT_IN_REMQUO, + BUILT_IN_REMQUOF, BUILT_IN_REMQUOL, BUILT_IN_SINCOS, + BUILT_IN_SINCOSF, BUILT_IN_SINCOSL): New. + * tree.c: Assign new type_nodes. + * tree.h (tree_index): Add TI_FLOAT_PTR_TYPE, TI_DOUBLE_PTR_TYPE, + TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE. + (float_ptr_type_node, double_ptr_type_node, + long_double_ptr_type_node, integer_ptr_type_node): New type_nodes. + + * doc/extend.texi: Document new builtins. + +2003-08-28 Kaveh R. Ghazi + + * builtin-types.def (BT_FN_FLOAT_INT_FLOAT, + BT_FN_DOUBLE_INT_DOUBLE, BT_FN_LONGDOUBLE_INT_LONGDOUBLE): New. + + * builtins.def (BUILT_IN_ERF, BUILT_IN_ERFC, BUILT_IN_ERFCF, + BUILT_IN_ERFCL, BUILT_IN_ERFF, BUILT_IN_ERFL, BUILT_IN_GAMMA, + BUILT_IN_GAMMAF, BUILT_IN_GAMMAL, BUILT_IN_J0, BUILT_IN_J0F, + BUILT_IN_J0L, BUILT_IN_J1, BUILT_IN_J1F, BUILT_IN_J1L, + BUILT_IN_JN, BUILT_IN_JNF, BUILT_IN_JNL, BUILT_IN_LGAMMA, + BUILT_IN_LGAMMAF, BUILT_IN_LGAMMAL, BUILT_IN_SIGNIFICAND, + BUILT_IN_SIGNIFICANDF, BUILT_IN_SIGNIFICANDL, BUILT_IN_TGAMMA, + BUILT_IN_TGAMMAF, BUILT_IN_TGAMMAL, BUILT_IN_Y0, BUILT_IN_Y0F, + BUILT_IN_Y0L, BUILT_IN_Y1, BUILT_IN_Y1F, BUILT_IN_Y1L, + BUILT_IN_YN, BUILT_IN_YNF, BUILT_IN_YNL): New. + + * doc/extend.texi: Document new builtins. + +2003-08-28 Nathanael Nerode + + * fixinc/mkfixinc.sh: Remove special case code for unsupported + variants of i?86, powerpcle, and thumb. + * fixinc/mkfixinc.sh: Remove special case code for unsupported + arm and hppa variants. + +2003-08-28 Kaveh R. Ghazi + + * builtin-types.def (BT_FN_INT_FLOAT, BT_FN_INT_DOUBLE, + BT_FN_INT_LONGDOUBLE, BT_FN_LONG_FLOAT, BT_FN_LONG_DOUBLE, + BT_FN_LONG_LONGDOUBLE, BT_FN_LONGLONG_FLOAT, + BT_FN_LONGLONG_DOUBLE, BT_FN_LONGLONG_LONGDOUBLE, + BT_FN_FLOAT_FLOAT_LONGDOUBLE, BT_FN_DOUBLE_DOUBLE_LONGDOUBLE, + BT_FN_FLOAT_FLOAT_INT, BT_FN_DOUBLE_DOUBLE_INT, + BT_FN_LONGDOUBLE_LONGDOUBLE_INT, BT_FN_FLOAT_FLOAT_LONG, + BT_FN_DOUBLE_DOUBLE_LONG, BT_FN_LONGDOUBLE_LONGDOUBLE_LONG, + BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE, + BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE): New. + + * builtins.def (BUILT_IN_ACOS, BUILT_IN_ACOSF, BUILT_IN_ACOSH, + BUILT_IN_ACOSHF, BUILT_IN_ACOSHL, BUILT_IN_ACOSL, BUILT_IN_ASIN, + BUILT_IN_ASINF, BUILT_IN_ASINH, BUILT_IN_ASINHF, BUILT_IN_ASINHL, + BUILT_IN_ASINL, BUILT_IN_ATANH, BUILT_IN_ATANHF, BUILT_IN_ATANHL, + BUILT_IN_CBRT, BUILT_IN_CBRTF, BUILT_IN_CBRTL, BUILT_IN_COPYSIGN, + BUILT_IN_COPYSIGNF, BUILT_IN_COPYSIGNL, BUILT_IN_COSH, + BUILT_IN_COSHF, BUILT_IN_COSHL, BUILT_IN_DREM, BUILT_IN_DREMF, + BUILT_IN_DREML, BUILT_IN_EXP10, BUILT_IN_EXP10F, BUILT_IN_EXP10L, + BUILT_IN_EXP2, BUILT_IN_EXP2F, BUILT_IN_EXP2L, BUILT_IN_EXPM1, + BUILT_IN_EXPM1F, BUILT_IN_EXPM1L, BUILT_IN_FDIM, BUILT_IN_FDIMF, + BUILT_IN_FDIML, BUILT_IN_FMA, BUILT_IN_FMAF, BUILT_IN_FMAL, + BUILT_IN_FMAX, BUILT_IN_FMAXF, BUILT_IN_FMAXL, BUILT_IN_FMIN, + BUILT_IN_FMINF, BUILT_IN_FMINL, BUILT_IN_HYPOT, BUILT_IN_HYPOTF, + BUILT_IN_HYPOTL, BUILT_IN_ILOGB, BUILT_IN_ILOGBF, BUILT_IN_ILOGBL, + BUILT_IN_LDEXP, BUILT_IN_LDEXPF, BUILT_IN_LDEXPL, BUILT_IN_LLRINT, + BUILT_IN_LLRINTF, BUILT_IN_LLRINTL, BUILT_IN_LLROUND, + BUILT_IN_LLROUNDF, BUILT_IN_LLROUNDL, BUILT_IN_LOG10, + BUILT_IN_LOG10F, BUILT_IN_LOG10L, BUILT_IN_LOG1P, BUILT_IN_LOG1PF, + BUILT_IN_LOG1PL, BUILT_IN_LOG2, BUILT_IN_LOG2F, BUILT_IN_LOG2L, + BUILT_IN_LOGB, BUILT_IN_LOGBF, BUILT_IN_LOGBL, BUILT_IN_LRINT, + BUILT_IN_LRINTF, BUILT_IN_LRINTL, BUILT_IN_LROUND, + BUILT_IN_LROUNDF, BUILT_IN_LROUNDL, BUILT_IN_NEXTAFTER, + BUILT_IN_NEXTAFTERF, BUILT_IN_NEXTAFTERL, BUILT_IN_NEXTTOWARD, + BUILT_IN_NEXTTOWARDF, BUILT_IN_NEXTTOWARDL, BUILT_IN_POW10, + BUILT_IN_POW10F, BUILT_IN_POW10L, BUILT_IN_REMAINDER, + BUILT_IN_REMAINDERF, BUILT_IN_REMAINDERL, BUILT_IN_RINT, + BUILT_IN_RINTF, BUILT_IN_RINTL, BUILT_IN_SCALB, BUILT_IN_SCALBF, + BUILT_IN_SCALBL, BUILT_IN_SCALBLN, BUILT_IN_SCALBLNF, + BUILT_IN_SCALBLNL, BUILT_IN_SCALBN, BUILT_IN_SCALBNF, + BUILT_IN_SCALBNL, BUILT_IN_SINH, BUILT_IN_SINHF, BUILT_IN_SINHL, + BUILT_IN_TANH, BUILT_IN_TANHF, BUILT_IN_TANHL): New. + + * doc/extend.texi: Document new builtins. + +2003-08-28 Ulrich Weigand + + * config/s390/s390.c (legitmate_constant_p): Use LARL on + zSeries machines even in 31-bit addressing mode. + (legitimate_reload_constant_p): Likewise. + (legitimize_pic_address): Likewise. + (legitimize_tls_address): Likewise. + (s390_split_branches): Likewise. + (s390_dump_pool): Likewise. + (s390_mainpool_finish): Likewise. + (s390_chunkify_start): Likewise. + (s390_select_rtx_section): Likewise. + * config/s390/s390.md ("doloop_si"): Likewise. + ("pool_start_31", "pool_end_31"): Likewise. + ("pool_start_64", "pool_end_64"): Likewise. + ("main_base_31_small", "main_base_31_large"): Likewise. + ("main_base_64"): Likewise. + ("reload_base_31", "reload_base_64"): Likewise. + ("*movsi_larl"): New insn. + ("cjump", "icjump"): Use long branches on zSeries machines. + ("jump"): Likewise. + ("call"): Use BRASL on zSeries machines. + ("call_value", "call_value_tls"): Likewise. + ("brasl", "bras", "basr_64", "basr_31", "bas_64", "bas_31"): Remove + and replace by ... + ("*bras", "*brasl", "*basr") ... these new insns. + ("brasl_r", "bras_r", "basr_64_r", "basr_31_r", "bas_64_r", + "bas_31_r"): Remove and replace by ... + ("*bras_r", "*brasl_r", "*basr_r") ... these new insns. + ("brasl_tls", "bras_tls", "basr_64_tls", "basr_31_tls", + "bas_64_tls", "bas_31_tls"): Remove and replace by ... + ("*bras_tls", "*brasl_tls", "*basr_tls") ... these new insns. + ("*return_si", "*return_di"): Remove and replace by ... + ("*return"): ... this new insn. + ("rotlsi3"): Allow on zSeries machines. + + * config/s390/s390.c (legitimize_reload_constant_p): Use + LL/LH type instructions in z/Architecture mode. + * config/s390/s390.md ("*movsi_lli"): Likewise. + ("*andsi3_ni", "*andhi3_ni", "*andqi3_ni"): Likewise. + ("*iorsi3_ni", "*iorhi3_ni", "*iorqi3_ni"): Likewise. + ("*extendqisi2"): Use LB in z/Architecture mode. + ("*zero_extendqisi2_64", "*zero_extendqisi2_31"): Use LLGC in + z/Architecture mode. + ("zero_extendqihi2", "*zero_extendqihi2_64", "*zero_extendqihi2_31"): + Likewise. + + * config/s390/s390.md ("*tmdi_ext"): Allow in both 64-bit + and 31-bit mode. + ("ptr_extend"): Allow only in 64-bit mode. + +2003-08-27 Daniel Jacobowitz + + * gcc.c (STANDARD_EXEC_PREFIX, STANDARD_STARTFILE_PREFIX) + (TOOLDIR_BASE_PREFIX, STANDARD_BINDIR_PREFIX): Remove unnecessary + definitions. + (main): Only use standard_startfile_prefix if native. + * doc/tm.texi (STANDARD_STARTFILE_PREFIX): Update. + +2003-08-27 Per Bothner + + * cpperror.c (print_location): Don't check for !pfile->buffer. That + test fails following my 08-21 change, and it seems unnecessary anyway. + (cpp_error): Likewise. + +2003-08-27 Jason Merrill + + * real.c (do_multiply): Initialize with memset. + +2003-08-27 Zdenek Dvorak + + * gcov.c (typedef struct arc_info): New field cs_count. + (accumulate_line_counts): Find cycles correctly. + +2003-08-27 Ulrich Weigand + + * config/s390/s390.c (struct machine_function): Remove member + literal_pool_label. + (s390_optimize_prolog): Replace TEMP_REG argument with + TEMP_USED and BASE_USED. Do not check get_pool_size (). + (general_s_operand): Accept all immediates before reload if + ALLOW_IMMEDIATE. If not ALLOW_IMMEDIATE, reject literal pool + references. + (s390_output_symbolic_const): Remove UNSPEC_LTREL_OFFSET handling. + (find_constant_pool_ref): Ignore UNSPECV_POOL_ENTRY insns. + (s390_alloc_pool): New function. + (s390_new_pool): Call it. + (s390_dump_pool): Add REMOTE_LABEL argument. + (s390_chunkify_start): Add BASE_REG argument. Do not check + get_pool_size (). + (s390_chunkify_finish): Add BASE_REG argument. Adapt + s390_dump_pool call. + (s390_pool_count, s390_nr_constants): Remove. + (s390_output_constant_pool): Remove. + (s390_mainpool_start): New function. + (s390_mainpool_finish): New function. + (s390_mainpool_cancel): New function. + (s390_reorg): Implement main literal pool handling. + (s390_emit_prologue): Emit main_pool placeholder instead of + literal_pool_31 / literal_pool_64 insns. + * config/s390/s390.h (s390_pool_count, s390_nr_constants): Remove. + (ASM_OUTPUT_POOL_PROLOGUE, ASM_OUTPUT_SPECIAL_POOL_ENTRY): Remove. + * config/s390/s390.md (UNSPEC_MAIN_BASE): New symbolic constant. + ("main_base_31_small", "main_base_31_large"): New insns. + ("main_base_64", "main_pool"): New insns. + ("literal_pool_31", "literal_pool_64"): Remove. + +2003-08-27 Nathanael Nerode + + * fixinc/inclhack.def (ptx_netswap): New disabled fix, ported from + fixinc.ptx. + * fixinc/inclhack.def (undefine_null): Don't generate \r characters. + Prettify a little. + * fixinc/fixincl.x: Regenerate. + +2003-08-27 Richard Earnshaw + + * lib1funcs.asm (L_ieee754_sp): New. Include ieee754-sf.S. + (L_ieee754_dp): New. Include ieee754-df.S. + * arm/ieee754-sf.S: Rework to allow interworking, calling from Thumb, + and compilation in apcs-26 mode. + * arm/ieee754-df.S: Likewise. + * t-arm-elf (DPBIT, FPBIT, fp-bit.c dp-bit.c): Delete rules + (LIB1ASMFUNCS): Add _ieee754_sp and _ieee754_dp targets. + +2003-08-27 Nicolas Pitre + + * arm/ieee754-sf.S: New. + * arm/ieee754-df.S: New. + +2003-08-27 Jakub Jelinek + + * builtins.c (expand_builtin_expect_jump): Save pending_stack_adjust + and restore it if returning NULL. + +2003-08-27 Richard Sandiford + + * calls.c (initialize_argument_information): If an argument has no + stack space associated with it, and BLOCK_REG_PADDING is defined, + use it to decide at which end the argument should be padded. + * function.c (assign_parms): Allocate BLKmode stack slots. + * config/mips/mips-protos.h (mips_pad_arg_upward): Declare. + (mips_pad_reg_upward): Declare. + * config/mips/mips.h (PAD_VARARGS_DOWN): Use FUNCTION_ARG_PADDING. + (CUMULATIVE_ARGS): Remove num_adjusts and adjusts. + (FUNCTION_ARG_PADDING): Use mips_pad_arg_upward. + (BLOCK_REG_PADDING): Use mips_pad_reg_upward. + * config/mips/mips.c (struct mips_arg_info): Remove struct_p. + (mips_expand_call): Remove code for generating structure shifts. + (mips_arg_info): Don't set struct_p. Don't set fpr_p for non-float + types unless using the EABI. + (function_arg_advance): Don't generate shift instructions. + (function_arg): Don't return them. Don't short-circuit the + check for double structure chunks for DFmode arguments. + (mips_pad_arg_upward, mips_pad_reg_upward): New functions. + (mips_expand_prologue): Remove code to emit structure shifts. + * config/mips/irix6-libc-compat.c: Remove workarounds for buggy + structure passing (inet_ntoa, inet_lnaof, inet_netof). Update + comments to say that only structure returns are a problem. + +2003-08-26 Nathanael Nerode + + * fixinc/tests/base/string.h, fixinc/tests/base/sys/regset.h: + Fix to match produced versions. + * fixinc/inclhack.def (longlong_t): New disabled test, ported + from fixinc.svr4. + * fixinc/inclhack.def (ptx_pwd_h): New disabled fix, ported + from fixinc.ptx. + * fixinc/inclhack.def (ptx_sys_mc_param_h): New disabled fix, + ported from fixinc.ptx. + +2003-08-26 Per Bothner + + * cpplib.h (struct cpp_token): Change type of field line to fileline. + (cpp_error_with_line): Use fileline for appropriate parameter. + * cpphash.h (struct cpp_macro): Change type of field line to fileline. + (struct cpp_reader): Likewise for fields line and directive_line. + (_cpp_begin_message): Use fileline for appropriate parameter. + * cpperror.c (print_location, _cpp_begin_message, cpp_error_with_line, + cpp_error): Use fileline for appropriate parameters and variables. + (print_location): New local lin, since it is not a fileline. + +2003-08-26 Roger Sayle + + PR middle-end/12002 + * tree.h (SCALAR_FLOAT_TYPE_P, COMPLEX_FLOAT_TYPE_P): New macros. + (FLOAT_TYPE_P): Define in terms of these two new macros. + * fold-const.c (fold ): Don't convert x+x into x*2.0 + for complex floating point types. + +2003-08-26 Ulrich Weigand + + * config/s390/s390.c (emit_prologue): Don't check literal pool size. + * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Call + s390_output_pool_entry. + +2003-08-26 Nathanael Nerode + + * fixinc/inclhack.def (svr4_preproc_lint_on, + svr4_preproc_lint_off, svr4_preproc_machine): New disabled + fixes, ported from fixinc.svr4. + +2003-08-26 Mark Mitchell + + * doc/install.texi (Prerequisites): Mention GNU make requirement. + + * Makefile.in (AR_FOR_TARGET): Export it. + (AR_CREATE_FOR_TARGET): Likewise. + (AR_FLAGS_FOR_TARGET): Likewise. + (AR_EXTRACT_FOR_TARGET): Likewise. + (AWK): Likewise. + (BUILD_PREFIX): Likewise. + (BUILD_PREFIX_1): Likewise. + (DESTDIR): Likewise. + (GCC_FOR_TARGET): Likewise. + (INCLUDES): Likewise. + (INSTALL_DATA): Likewise. + (LIB1ASMSRC): Likewise. + (LIBGCC2_CFLAGS): Likewise. + (MACHMODE_H): Likewise. + (NM_FOR_TARGET): Likewise. + (RANLIB_FOR_TARGET): Likewise. + (libsubdir): Likewise. + (slibdir): Likewise. + (ORDINARY_FLAGS_TO_PASS): Remove stuff that we're + exporting. + (libgcc.a): Don't pass them here. + (stmp-multilib): Or here. + (install-libgcc): Or here. + (install-multilib): Or here. + (POSTSTAGE1_FLAGS_TO_PASS): Or here. + (stage1_build): Or here. + +2003-08-26 Andreas Krebbel + + * config/s390/s390.md ("*llgt_sisi", "*llgt_sisi_split", "*llgt_didi", + "*llgt_didi_split", "*llgt_sidi", "*llgt_sidi_split"): New insns. + +2003-08-26 Andreas Krebbel + + * config/s390/s390.md ("*fmadddf", "*fmsubdf", + "*fmaddsf", "*fmsubsf"): New insns. + +2003-08-26 Roger Sayle + + * fold-const.c (fold ): Optimize (C1/X)*C2 into + (C1*C2)/X when unsafe math optimizations are allowed. + (fold ): Optimize C1/(X*C2) into (C1/C2)/X with unsafe + math optimizations. Minor code clean-ups. Recursively call + fold when constructing sub-expressions. + +2003-08-26 Roger Sayle + + * builtins.c (fold_builtin_bitop): New function to perform constant + folding of ffs, clz, ctz, popcount and parity builtin functions + and their long and long long variants (such as ffsl and ffsll). + (fold_builtin): fold_builtin_bitop when appropriate. + * simplify-rtx.c (simplify_unary_operation): Honor both + CLZ_DEFINED_VALUE_AT_ZERO and CTZ_DEFINED_VALUE_AT_ZERO when + evaluating clz and ctz at compile-time, for operands wider + than HOST_WIDE_INT. + +2003-08-26 Nathan Sidwell + + * builtins.c (build_function_call_expr): Don't set + TREE_SIDE_EFFECTS here. + * expr.c (emit_block_move_via_libcall): Likewise. + (clear_storage_via_libcall): Likewise. + * tree.c (build): Set TREE_SIDE_EFFECTS for non-const, non-pure + CALL_EXPRs. + + * gcse.c (is_too_expensive): New function. + (gcse_main, delete_null_pointer_checks, bypass_jumps): Use it. + +2003-08-25 Zack Weinberg + + * config.gcc (hppa*-*-hpux11*, ia64*-*-hpux*): Remove + commented-out logic to use DCE threads (if present), add + support for POSIX threads. + * config/ia64/hpux.h: Define CPP_SPEC to set appropriate + #defines for -pthread. Add -lpthread to LIB_SPEC when + -pthread. In both cases take -mt as a synonym for -pthread + for acc compatibility. + Define GTHREAD_USE_WEAK to 0. + * config/pa/pa-hpux11.h: Likewise for CPP_SPEC and LIB_SPEC. + Remove old logic for DCE threads from LIB_SPEC. + * config/pa/pa64-hpux.h: Define GTHREAD_USE_WEAK to 0. + +2003-08-25 Roger Sayle + + * builtins.c (expand_builtin_mathfn): Rearrange so that we only + return 0 for invalid argument types. Instead drop through to a + call of expand_call at the bottom of function. If op is SQRT, + try attaching a SQRT rtx as the REQ_EQUAL note of the libcall. + +2003-08-25 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_tls_address): Properly truncate + result when op0 is SImode. + +2003-08-25 Nathanael Nerode + + * fixinc/inclhack.def (svr4_sighandler_type): New fix, ported + from fixinc.svr4. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/sys/signal.h: Regenerate. + +2003-08-25 Ulrich Weigand + + * combine.c (simplify_comparison): Re-enable widening of comparisons + with non-paradoxical subregs of non-REG expressions. + +2003-08-25 Ulrich Weigand + + * combine.c (distribute_notes): Handle REG_ALWAYS_RETURN. + +2003-08-25 Ulrich Weigand + + * combine.c (combine_simplify_rtx): Fix RTL sharing bug. + +2003-08-25 Gabriel Dos Reis + + * pretty-print.h (pp_maybe_newline_and_indent): New macro. + * c-pretty-print.h (c_pretty_printer): Now typedef to the + structure. Be consistent with pretty-print.h abd cxx-pretty-print.h + (struct c_pretty_print_info): Document. Add new fields. + (pp_type_specifier_seq): Rename from pp_c_type_specifier. + (pp_direct_abstract_declarator): New macro. + (pp_ptr_operator): Likewise. + (pp_simple_type_specifier): Likewise. + (pp_expression): Likewise. + (pp_parameter_list): Rename from pp_parameter_declaration. + * c-pretty-print.c (pp_c_whitespace): Now a function. + (pp_c_left_paren): Likewise. + (pp_c_right_paren): Likewise. + (pp_c_dot): Likewise. + (pp_c_ampersand): Likewise. + (pp_c_arrow): Likewise. + (pp_c_semicolon): Likewise. + (pp_c_type_cast): New function. + (pp_c_space_for_pointer_operator): Likewise. + (pp_c_call_argument_list): Likewise. + (pp_c_cv_qualifier): Adjust prototype. + (pp_c_type_qualifier_list): Likewise. + (pp_c_pointer): Likewise. Handle REFERENCE_TYPE here. + (pp_c_type_specifier): Rename from pp_c_simple_type_specifier. + Adjust to follow standard grammar. + (pp_c_specifier_qualifier_list): Adjusr prototype. Handle + REFERENCE_TYPE. Tidy. + (pp_c_parameter_type_list): Adjust prototype. Tidy. + (pp_c_parameter_declaration): Remove. + (pp_c_abstract_declarator): Adjust prototype. + (pp_c_direct_abstract_declarator): Likewise. + (pp_c_type_id): Likewise. + (pp_c_storage_class_specifier): Likewise. + (pp_c_function_specifier): Likewise. + (pp_c_declaration_specifiers): Likewise. + (pp_c_direct_declarator): Likewise. + (pp_c_declarator): Likewise. + (pp_c_declarator): Likewise. + (pp_c_declaration): Likewise. + (pp_c_attributes): Likewise. Tidy. + (pp_c_function_definition): Adjust prototype. + (pp_c_char): Likewise. + (pp_c_string_literal): Likewise. + (pp_c_integer_constant): Likewise. + (pp_c_character_constant): Likewise. + (pp_c_bool_constant): Likewise. + (pp_c_enumeration_constant): Likewise. + (pp_c_floating_constant): Likewise. + (pp_c_constant): Likewise. + (pp_c_identifier): Likewise. + (pp_c_primary_expression): Likewise. Remove TARGET_EXPR case. Tidy. + (pp_c_initializer): Adjust prototype. + (pp_c_init_declarator): Likewise. + (pp_c_initializer_list): Likewise. + (pp_c_id_expression): Likewise. + (pp_c_postfix_expression): Likewise. + (pp_c_expression_list): Likewise. + (pp_c_unary_expression): Likewise. + (pp_c_cast_expression): Likewise. + (pp_c_multiplicative_expression): Likewise. + (pp_c_additive_expression): Likewise. + (pp_c_shift_expression): Likewise. + (pp_c_relational_expression): Likewise. + (pp_c_equality_expression): Likewise. + (pp_c_and_expression): Likewise. + (pp_c_exclusive_or_expression): Likewise. + (pp_c_inclusive_or_expression): Likewise. + (pp_c_logical_and_expression): Likewise. + (pp_c_logical_or_expression): Likewise. + (pp_c_conditional_expression): Likewise. + (pp_c_assignment_expression): Likewise. + (pp_c_expression): Likewise. Tidy. + (pp_c_statement): Likewise. Document. + (pp_c_pretty_printer_init): Adjust prototype. Tidy. + + * c-lang.c (c_initialize_diagnostics): Update. + * c-common.h (strip_pointer_operator): Declare. + * c-common.c (strip_pointer_operator): Define. + +2003-08-25 Mark Mitchell + + PR c++/8795 + * tree.h (build_method_type_directly): Declare. + * c-common.c (handle_vector_size_attributes): Handle METHOD_TYPEs. + (vector_size_helper): Likewise. + * tree.c (build_method_type_directly): New function. + (build_method_type): Use it. + +2003-08-24 Richard Henderson + + * config/i386.i386.c (ix86_return_in_memory): Reformat. Return true + for 16-byte vector modes if sse not enabled; warn for abi change. + (ix86_value_regno): Only return xmm0 for 16-byte vector types. + +2003-08-24 Kazu Hirata + + * rtlanal.c (may_trap_p): Simplify an integer comparison. + +2003-08-24 Nathanael Nerode + + * fixinc/inclhack.def (AAB_svr4_replace_byteorder): Enhance + comment. Enable for DYNIX/ptx systems (when they switch to + regular fixincludes). + * fixinc/fixincl.x: Regenerate. + +2003-08-23 Jason Eckhardt + + * config/i860/t-i860: New. + * config.gcc (i860-*-sysv4*): Add t-i860 to tmake_file. + +2003-08-23 Jakub Jelinek + + * c-decl.c (pushdecl): Only put decls which finish_struct will do + something about onto incomplete chain. + (finish_struct): If not removing type from incomplete + list, update prev. + +2003-08-20 Jan Hubicka + + PR target/11369 + * i386.c (ix86_expand_carry_flag_compare): Validate operand. + + PR target/11031 + * i386.c (const_0_to_3_operand, const_0_to_7_operand, + const_0_to_15_operand, const_0_to_255_operand): New predicates. + * i386.h (PREDICATE_CODES): Add these. + * i386.c (pinsrw and pextrw patterns): Use them. + + PR target/10984 + * i386.c (ix86_expand_binop_builtin): Behave sanely for VOIDmodes. + + PR target/8869 + * expr.c (convert_modes): Deal properly with integer to vector + constant conversion. + + PR target/8871 + * i386.md (zero_extendsidi2*): Add MMX and SSE alternatives. + +2003-08-23 Ulrich Weigand + + * config/s390/s390.h (LOAD_EXTEND_OP): Remove. + * config/s390/s390.md ("movhi"): New expander; old insn renamed to ... + ("*movhi"): ... this. + ("movqi", "*movqi"): Likewise. + ("movqi_64"): Remove. + ("*zero_extendhisi2_31"): Change predicate to s_operand. + +2003-08-23 Dale Johannesen + * calls.c (emit_library_call_value_1): Fix obvious errors in + arguments to emit_group_store. + +2003-08-23 Jason Eckhardt + + * calls.c (emit_library_call_value_1): Remove code related + to LIBGCC_NEEDS_DOUBLE. + * config/stormy16/stormy16.h: Remove mention of LIBGCC_NEEDS_DOUBLE. + * doc/tm.texi: Likewise. + * system.h: Poison the LIBGCC_NEEDS_DOUBLE macro. + +2003-08-23 Richard Sandiford + + * config/mips/linux64.h (STARTFILE_PREFIX_SPEC): Remove. + +2003-08-23 Richard Sandiford + + * config/mips/mips.c (mips_setup_incoming_varargs): Handle o32 and o64 + as well. Put memory references in the varargs alias set. + (mips_expand_prologue): Remove varargs handling from here. + +2003-08-23 Ulrich Weigand + + * config/s390/s390.c (s390_expand_movstr, s390_expand_clrstr, + s390_expand_cmpmem, s390_output_constant_pool, s390_build_va_list, + s390_function_profiler, s390_output_mi_thunk): Use ISO C syntax + for function pointer calls. + * config/s390/s390.md ("*negdi2_31"): Likewise. + +2003-08-23 Roger Sayle + + * combine.c (apply_distributive_law): Correct comment. + +2003-08-23 Jason Eckhardt + + * config/i860/i860.h: Remove comment mentioning LIBGCC_NEEDS_DOUBLE. + +2003-08-22 Jason Eckhardt + + * config/i860/i860.c (i860_build_va_list): Create the va_decl + declaration. Document the va_list structure. + (i860_va_start): Initialize the va_list structure. + (i860_va_arg): Rewrite completely. + * config/i860/i860.h (LIBGCC_NEEDS_DOUBLE): Don't define. + * config/i860/varargs.asm: Do not allocate or initialize + a va_list. Return the address of the register save area. + +2003-08-22 Kazu Hirata + + * config/iq2000/iq2000.c: Fix comment typos. + * config/iq2000/iq2000.md: Likewise. + +2003-08-22 Kazu Hirata + + * config/iq2000/iq2000.c: Follow spelling conventions. + * config/iq2000/iq2000.h: Likewise. + * config/mn10300/mn10300.c: Likewise. + +2003-08-22 Jason Eckhardt + + * config/i860/i860.c (output_move_double): Don't set latehalf + to zero for CONST_INT (since it could be, e.g., -1). + + * config/i860/i860.h (REMSI3_LIBCALL): Replace this macro... + (MODSI3_LIBCALL): ...with this one. + (UREMSI3_LIBCALL): Replace this macro... + (UMODSI3_LIBCALL): ...with this one. + +2003-08-22 Jason Eckhardt + + * config/i860/i860-protos.h (output_delay_insn): Remove prototype. + (output_delayed_branch): Remove prototype. + (single_insn_src_p): Remove prototype. + * config/i860/i860.c (single_insn_src_p): Remove function. + (output_delayed_branch): Remove function. + (output_delay_insn): Remove function. + (va_start): Remove unconditional test and dead code, re-format. + Fix coding style and spelling problems in various comments. + * config/i860/i860.md (UNSPECV_BLOCKAGE): Define constant... + (blockage pattern): ...and use it here. + (all define_peephole patterns related to delayed branches): Remove. + Fix coding style and spelling problems in various comments. + +2003-08-22 Jason Eckhardt + + * config/i860/i860.c: Replace all occurrences of 'GNU CC' with 'GCC'. + Remove all uses of the PARAMS macro. Remove superflous prototypes. + Convert all function definitions from traditional to ISO C90 syntax. + * config/i860/i860-protos.h: Replace all occurrences of 'GNU CC' + with 'GCC'. Remove all uses of the PARAMS macro. + * config/i860/i860.h: Replace all occurrences of 'GNU CC' with 'GCC'. + * config/i860/i860.md: Likewise. + * config/i860/sysv4.h: Likewise. + * config/i860/varargs.asm: Likewise. + +2003-08-22 Jason Eckhardt + + * config/i860/i860-protos.h (i860_va_start): Remove 'stdarg_p' + argument. + (tdesc_section): Add prototype. + Update copyright dates. + * config/i860/i860.c: Include coretypes.h, tm.h, and toplev.h. + (TARGET_ASM_FUNCTION_PROLOGUE): Move definition to end of file. + (TARGET_ASM_FUNCTION_EPILOGUE): Likewise. + (targetm): Likewise. + (i860_output_function_prologue): Substitute HOST_WIDE_INT_PRINT_DEC + for '%d' where necessary. + (i860_va_start): Remove 'stdarg_p' argument. Make conditional checks + on 'stdarg_p' unconditional. Divide current_function_args_info.ints + by UNITS_PER_WORD when referencing (likewise for .floats). + (I860_SVR4_VARARGS): Rename... + (I860_SVR4_VA_LIST): ...to this. + Call build() with 't' rather than 'field'. + (i860_rtx_costs): New function. + (TARGET_RTX_COSTS): Define. + (i860_internal_label): New function. + (TARGET_ASM_INTERNAL_LABEL): Define. + (i860_file_start): New function. + Update copyright dates. + * config/i860/i860.h (CPP_PREDEFINES): Remove. + (TARGET_CPU_CPP_BUILTINS): Define. + (EXPAND_BUILTIN_VA_START): Remove 'stdarg' argument. + (CONST_COSTS): Remove (and move code to i860_rtx_costs). + (ASM_FILE_START): Remove. + (ASM_FILE_START_1): Remove. + (ASM_GLOBALIZE_LABEL): Remove. + (ASM_OUTPUT_INTERNAL_LABEL): Remove. + (ASM_OUTPUT_CASE_LABEL): Replace call of ASM_OUTPUT_INTERNAL_LABEL + with targetm.asm_out.internal_label. + Update copyright dates. + * config/i860/sysv4.h (USER_LABEL_PREFIX): Define. + (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): Define. + (GLOBAL_ASM_OP): Define. + (ASM_FILE_START): Remove. + (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Define. + (TARGET_ASM_FILE_START): Define. + Update copyright dates. + +2003-08-22 Jason Eckhardt + + * gcc/config.gcc (i860-*-sysv4*): Add target. + * config/i860/i860-protos.h: New. + * config/i860/i860.c: New. + * config/i860/i860.h: New. + * config/i860/i860.md: New. + * config/i860/sysv4.h: New. + * config/i860/varargs.asm: New. + * config/i860/x-sysv4: New. + +2003-08-22 Jason Eckhardt + + * config/pa/pa.c: Replace 'GNU CC' with 'GCC'. + Remove all uses of PARAMS macro. + Convert all function definitions to ISO C90 syntax. + * config/pa/elf.h: Replace 'GNU CC' with 'GCC'. + * config/pa/fptr.c: Likewise. + * config/pa/lib2funcs.asm: Likewise. + * config/pa/long_double.h: Likewise. + * config/pa/milli64.S: Likewise. + * config/pa/pa-64.h: Likewise. + * config/pa/pa-hpux.h: Likewise. + * config/pa/pa-hpux10.h: Likewise. + * config/pa/pa-hpux11.h: Likewise. + * config/pa/pa-linux.h: Likewise. + * config/pa/pa-modes.def: Likewise. + * config/pa/pa-osf.h: Likewise. + * config/pa/pa-pro-end.h: Likewise. + * config/pa/pa.md: Likewise. + * config/pa/pa32-linux.h: Likewise. + * config/pa/pa64-linux.h: Likewise. + * config/pa/pa64-hpux.h: Likewise. + * config/pa/pa64-regs.h: Likewise. + * config/pa/quadlib.c: Likewise. + * config/pa/rtems.h: Likewise. + * config/pa/pa-protos.h: Replace 'GNU CC' with 'GCC' and remove + all uses of the PARAMS macro. + * config/pa/pa.h: Likewise. + * config/pa/som.h: Likewise. + + * config/iq2000/iq2000.c: Replace 'GNU CC' with 'GCC'. + Remove all uses of PARAMS macro. + Convert all function definitions to ISO C90 syntax. + * config/iq2000-protos.h: Replace 'GNU CC' with 'GCC'. + Remove all uses of PARAMS macro. + * config/iq2000.h: Remove all uses of PARAMS macro. + * config/iq2000/iq2000.md: Replace 'GNU CC' with 'GCC'. + +2003-08-23 Ulrich Weigand + + * config/s390/s390-protos.h (s390_output_pool_entry): Declare. + * config/s390/s390.c (gen_consttable): Remove. + (s390_dump_pool): Use UNSPECV_POOL_ENTRY for pool entry insns. + (s390_output_pool_entry): New function. + * config/s390/s390.md (UNSPECV_POOL_QI, UNSPECV_POOL_HI, + UNSPECV_POOL_SI, UNSPECV_POOL_DI, UNSPECV_POOL_TI, + UNSPECV_POOL_SF, UNSPECV_POOL_DF): Remove, replace by ... + (UNSPECV_POOL_ENTRY): ... this new constant. + ("consttable_qi", "consttable_hi", "consttable_si", "consttable_di", + "consttable_ti", "consttable_sf", "consttable_df"): Remove ... + ("*pool_entry"): ... and replace by this new insn. + ("literal_pool_31"): Do not emit anchor label if pool empty. + + * config/s390/s390.c (struct machine_function): Add save_return_addr_p. + (s390_optimize_prolog): Save RETURN_REGNUM if save_return_addr_p. + (s390_fixup_clobbered_return_reg): Remove. + (s390_reorg): Don't call s390_fixup_clobbered_return_reg. + (s390_return_addr_rtx): Always retrieve return address from save area + slot. Use save_return_addr_p to force slot to be filled. + (s390_emit_prologue): Remove has_hard_reg_initial_val test. + +2003-08-22 Chris Demetriou + + * config/mips/mips.h (MASK_FIX_SB1, TARGET_FIX_SB1): New defines. + (TARGET_SWITCHES): Add -mfix-sb1 and -mno-fix-sb1. + * config/mips/mips.md (divdf3, divsf3, sqrtdf2, sqrtsf2): Work + around SB-1 errata if TARGET_FIX_SB1 is set. + (recip.d insn, recip.s insn, rsqrt.d insn, rsqrt.s insn): Likewise. + * doc/invoke.texi: Document MIPS -mfix-sb1 and -mno-fix-sb1. + +2003-08-22 Roger Sayle + + * hashtable.c (ht_expand): Avoid calculating rehash for the common + case that the first probe hits an empty hash table slot. + +2003-08-22 Mark Mitchell + + * config/ia64/hpux.h (SUPPORTS_INIT_PRIORITY): Define to 0. + +2003-08-22 Mark Mitchell + + * config/ia64/ia64.md (*ptr_extend_plus_1): Rename to ... + (ptr_extend_plus_imm): ... this. + * config/ia64/ia64.c (addp4_optimize_ok): Do not disable addp4 + optimization in C++. + (ia64_output_mi_thunk): Support ILP32 mode. + +2003-08-22 Bernardo Innocenti + + * gcc/config/m68k/m68k.c (m68k_coff_asm_named_section): remove unused + function. + * gcc/config/m68k/m68k.c (-m68k_svr3_asm_out_constructor): likewise. + +2003-08-22 Kazu Hirata + + * config/i386/i386.c (const_int_1_operand): Simplify an + integer comparison. + +2003-08-22 Alan Modra + + * config/fp-bit.c: Specify config/ dir for include of fp-bit.h. + * config/rs6000/ppc64-fp.c: Likewise. + +2003-08-22 Kazu Hirata + + * cfgcleanup.c: Fix comment typos. + * emit-rtl.c: Likewise. + * optabs.c: Likewise. + * ra-build.c: Likewise. + * rtlanal.c: Likewise. + * tree.h: Likewise. + +2003-08-22 Kazu Hirata + + * c-decl.c: Fix comment formatting. + * cfgrtl.c: Likewise. + * combine.c: Likewise. + * convert.c: Likewise. + * dominance.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * expmed.c: Likewise. + * fold-const.c: Likewise. + * gcov.c: Likewise. + * genattrtab.c: Likewise. + * ggc-common.c: Likewise. + * mips-tfile.c: Likewise. + * regmove.c: Likewise. + +2003-08-22 Kazu Hirata + + * builtin-attrs.def: Fix comment formatting. + * c-pretty-print.c: Likewise. + * diagnostic.h: Likewise. + * langhooks.h: Likewise. + * recog.c: Likewise. + * simplify-rtx.c: Likewise. + * tree.def: Likewise. + +2003-08-22 Bernardo Innocenti + + * config/m68k/m68k-protos.h: Convert to ISO C90. + * config/m68k/m68k.c: Likewise. + +2003-08-21 Bernardo Innocenti + Paul Dale + Peter Barada + + * config/m68k/m68k.c (m68k_rtx_costs): Adjust mul/div costs for + ColdFire cores. + +2003-08-21 Zack Weinberg + + * Makefile.in (INCLUDES): Remove -I$(srcdir)/config. + * config.gcc (*-*-openbsd): Don't set tm_file. + (alpha*-*-openbsd, arm*-*-coff*, arm*-wince-pe*, + arm-*-pe*, avr-*-*, h8300-*-rtems*, h8300-*-elf*, + h8300-*-*, hppa*-*-osf*, hppa*-*-bsd*, hppa*-*-hpux*, + i370-*-opened*, i370-*-mvs*, i370-*-linux*, i?86-*-openbsd*, + i?86-*-lynxos, i?86-*-nto-qnx*, iq2000*-*-elf*, m68000-hp-hpux*, + m68k-hp-hpux*, m68k-*-aout*, m68k-*-coff*, m68020-*-elf*, + m68k-*-elf*, m68k*-*-netbsd*, m68k*-*-openbsd*, m68k-*-sysv4*, + m68k-*-linux*, m68k-*-rtems*, mcore-*-pe*, mips*-*-netbsd*, + mips*-*-openbsd*, rs6000-*-lynxos*, sh*-*-elf*, sh*-*-ka, + sh-*-rtemself, sparc-*-openbsd*, strongarm-*-pe, vax-*-openbsd*, + xscale-*-coff): Use explicit and complete lists of target headers + to include. Move definitions to tm_defines where appropriate. + (hppa*-*-openbsd*, powerpc-*-openbsd*): Comment out stanza for + not-yet-contributed configuration. + + * config/lynx.h, config/alpha/openbsd.h, config/arm/coff.h + * config/avr/avr.h, config/frv/frv.h, config/h8300/elf.h + * config/i370/linux.h, config/i370/mvs.h, config/i370/oe.h + * config/i386/nto.h, config/iq2000/iq2000.h, + * config/m68k/coff.h, config/m68k/hp310.h, config/m68k/hp320.h + * config/m68k/linux.h, config/m68k/m68k-aout.h + * config/m68k/m68k-none.h, config/m68k/m68kv4.h + * config/m68k/netbsd.h, config/m68k/openbsd.h + * config/m68k/sgs.h, config/mcore/mcore-pe.h, + * config/mips/netbsd.h, config/mips/openbsd.h, config/pa/pa.h, + * config/rs6000/lynx.h, config/sh/embed-elf.h, config/sparc/openbsd.h: + Remove includes of other target config headers, and + definitions of macros moved to tm_defines lists. Add #undefs + where now necessary to prevent redefinition warnings. + + * config/h8300/coff.h: New file split out of... + * config/h8300/elf.h: ...here. + * config/m68k/hp320base.h: New file split out of... + * config/m68k/hp320.h: ...here. + * config/rs6000/lynxbase.h: New file split out of... + * config/rs6000/lynx.h: ...here. + + * config/m68k/hp310g.h, config/m68k/hp320g.h, config/m68k/hpux7.h + * config/m68k/m68k-coff.h, config/mips/openbsd-be.h: Delete file. + + * config/sol2.h: Remove #if 0-ed #include of sys/mman.h. + * config/m68k/m68kelf.h: Remove commented out #include of m68k/sgs.h. + * config/mcore/mcore.h: Don't include hwint.h nor machmode.h. + Remove unnecessary #ifndef. + * config/s390/s390.h: Prefix #include of s390/fixdfdi.h + [under IN_LIBGCC2] with config/. + +2003-08-21 Per Bothner + + * cppfiles.c (stack_file): Correctly pass return_at_eof parameter + to cpp_push_buffer. + * cpplex.c (_cpp_get_fresh_line): Don't buffer->prev - handled + by return_at_eof check. Always call _cpp_pop_buffer at end. + +2003-08-21 Kazu Hirata + + PR target/11805 + * config/h8300/h8300.md (two anonymous patterns): Remove. + +2003-08-21 Richard Sandiford + + * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause. + * config/mips/mips.c (function_arg_pass_by_reference): Never return + true for n32 & n64. + +2003-08-21 Josef Zlomek + + * fold-const.c (fold): Fix bug in (A & C) == D where D & ~C != 0 + and similarly in (A | C) == D where C & ~D != 0. + +2003-08-20 Geoffrey Keating + + PR 8180 + * configure.in: When testing with_libs and with_headers, treat + 'no' as unset. Based on a patch by Dan Kegel . + * configure: Regenerate. + +2003-08-20 Peter Barada + + * longlong.h (umul_ppmm): Add ColdFire support. + +2003-08-20 Peter Barada + Bernardo Innocenti + + * config/m68k/m68k-none.h: Introduce new ColdFire archs. + * config/m68k/m68k.h: Likewise. + * config/m68k/lb1sf68.asm: Rename __mcf5200__ to __mcoldfire__. + * config/m68k/coff.h: Rename TARGET_5200 to TARGET_COLDFIRE. + * config/m68k/linux.h: Likewise. + * config/m68k/m68k.c: Likewise. + * config/m68k/m68k.md: Likewise. + * config/m68k/m68kelf.h: Likewise. + * config/m68k/netbsd-elf.h: Likewise. + * config/m68k/t-m68kelf: Add multilib targets for new ColdFire archs. + +2003-08-20 Bernardo Innocenti + + * config/m68k/m68k.c: Strip away code depending on NO_ADDSUB_Q definition. + * config/m68k/m68k.md: Likewise. + +2003-08-20 Mark Mitchell + + PR java/11996 + Revert this change: + 2003-08-19 Mark Mitchell + * c-common.c (c_common_signed_or_unsigned_type): Correctly handle + types with precisions other than those given by native machine + modes. + +2003-08-20 Gunther Nikl + + * config/m68k/m68k.md (anonymous define_insn): remove obsolete code + selected by FSGLMUL_USE_S and FSGLDIV_USE_S + * config/m68k/m68k.c (output_move_himode): remove SGS_NO_LI check + * config/m68k/m68k.md (anonymous define_insn): Likewise + * config/m68k/m68k.md (anonymous define_insn): remove ISI_OV check + * config/m68k/m68k.c (standard_68881_constant_p): remove obsolete + code selected by NO_ASM_FMOVECR + +2003-08-20 Gunther Nikl + + * config/m68k/m68k.c (output_move_const_into_data_reg, + output_move_himode): unify MOTOROLA/MIT handling of moveq + * config/m68k/m68k.md (movsi_const0, anonymous define_insn): + Likewise + +2003-08-20 Gunther Nikl + + * config/m68k/m68k.c (m68k_output_function_prologue): use %U in + label name + * config/m68k/m68k.c (m68k_output_function_epilogue): replace + HOST_WIDE_INT_PRINT_DEC with %wd + +2003-08-20 Loren James Rittle + + * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Handle + redefine warning. + +2003-08-20 Roger Sayle + + PR middle-end/11984 + * fold-const.c (fold ): Check for integer constant + operands before calling tree_int_cst_lt when performing associative + transformations. + +2003-08-20 Jason Merrill + + * tree.h (IS_EXPR_CODE_CLASS): Also include 'r' and 's'. + (EXPR_CHECK): Don't check for 'r' or 's' if we're + checking IS_EXPR_CODE_CLASS. + * calls.c (calls_function_1): Likewise. + * fold-const.c (fold): Likewise. + * tree.c (iterative_hash_expr): Likewise. + * tree-inline.c (walk_tree, copy_tree_r): Likewise. + +2003-08-20 Gunther Nikl + + * config/m68k/m68k.c (m68k_output_mi_thunk): delete obsolete code + depending on MOTOROLA_BSR + * config/m68k/m68k.md (anonymous define_insn): Likewise + +2003-08-20 Jason Merrill + + * builtins.c (expand_builtin_mathfn): Use get_callee_fndecl. + (expand_builtin_mathfn2, expand_builtin, builtin_mathfn_code, + fold_trunc_transparent_mathfn, fold_builtin): Likewise. + * dojump.c (do_jump): Likewise. + * fold-const.c (operand_equal_p, fold): Likewise. + (tree_expr_nonnegative_p): Likewise. + + * stor-layout.c (do_type_align): Only copy DECL_USER_ALIGN from + TYPE_USER_ALIGN for FIELD_DECLs. + + * attribs.c (decl_attributes): Rebuild the function pointer type after + changing the target type. + * tree.c (get_qualified_type): Also check that the attributes match. + +2003-08-19 Matt Kraai + + * Makefile.in (STAGESTUFF): Move cc1obj$(exeext) from here ... + * objc/config-lang.in (stagestuff): ... to here. + +2003-08-19 Mark Mitchell + + PR c++/11946 + * convert.c (convert_to_integer): Use CONVERT_EXPR (instead of + NOP_EXPR) when necessary. + * c-common.c (c_common_signed_or_unsigned_type): Correctly handle + types with precisions other than those given by native machine + modes. + +2003-08-19 Geoffrey Keating + + * cpppch.c (cpp_valid_state): Re-add warning about PCH not used + because some macro is defined. + + * config/darwin.h (LINK_COMMAND_SPEC): Add -arch and -arch_only + options. + * config/i386/darwin.h (ASM_SPEC): New. + (SUBTARGET_EXTRA_SPECS): New. + * config/rs6000/darwin.h (ASM_SPEC): New. + (SUBTARGET_EXTRA_SPECS): New. + * configure.in: Don't set CROSS or SYSTEM_HEADER_DIR when building + a cross-compiler between two different processors on Darwin. + * configure: Regenerate. + +2003-08-19 Kazu Hirata + + * builtins.c: Fix comment typos. + * c-common.c: Likewise. + * c-decl.c: Likewise. + * c-pretty-print.c: Likewise. + * cfgbuild.c: Likewise. + * cfglayout.c: Likewise. + * cfgloopanal.c: Likewise. + * cgraphunit.c: Likewise. + * cppfiles.c: Likewise. + * dwarfout.c: Likewise. + * expr.c: Likewise. + * fold-const.c: Likewise. + * gcse.c: Likewise. + * ggc-page.c: Likewise. + * haifa-sched.c: Likewise. + * pretty-print.c: Likewise. + * tree.c: Likewise. + * tree.h: Likewise. + * value-prof.c: Likewise. + +2003-08-19 Kazu Hirata + + * c-decl.c: Follow spelling conventions. + * cppfiles.c: Likewise. + +2003-08-19 Kazu Hirata + + * c-common.c: Fix comment formatting. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * cppinit.c: Likewise. + * cpplib.h: Likewise. + * emit-rtl.c: Likewise. + * input.h: Likewise. + * line-map.h: Likewise. + * opts.c: Likewise. + * opts.h: Likewise. + * simplify-rtx.c: Likewise. + +2003-08-19 Daniel Jacobowitz + + * unwind-c.c: Add libgcc-style exception. + * unwind-dw2.c: Likewise. + * unwind-pe.h: Likewise. + * unwind-sjlj.c: Likewise. + * unwind.inc: Likewise. + +2003-08-19 Andrew Pinski + + PR c/5582 PR c++/10538 + * langhooks-def.h (lhd_decl_uninit): Declare. + (LANG_HOOKS_DECL_UNINIT): New macro. + (LANG_HOOKS_INITIALIZER): Adjust. + * langhooks.h (struct lang_hooks): Add new field + decl_uninit. + * langhooks.c (lhd_decl_uninit): Define. + * c-common.c (c_decl_uninit_1): New function. + (c_decl_uninit): New function. + (warn_init_self): Define. + * c-common.h (c_decl_uninit): Declare. + (warn_init_self): Declare. + * c.opt: Introduce -Winit-self. + * c-opts.c (c_common_handle_options): Set warn_init_self. + * c-lang.c (LANG_HOOKS_DECL_UNINIT): Define. + * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Define. + * function.c (uninitialized_vars_warning): Call the language hook. + * doc/invoke.texi: Document -Winit-self. + +2003-08-19 Chris Demetriou + + * config/mips/mips.md: Adjust SI-mode "trap_if" instruction + to use better predicates and constraints. Define new + instruction to handle "trap_if" with DI-mode arguments. + (conditional_trap): FAIL if trap code is not 0. + +2003-08-19 Andrew Pinski + + * config/i386/i386.c (legitimate_pic_address_disp_p): Change the + strstr with $pb to a strcompare with "" + (ix86_output_addr_diff_elt): Output the real pic base. + +2003-08-19 Gabriel Dos Reis + + * langhooks-def.h (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling. + (LANG_HOOKS_INITIALIZER): Correct. + * c-lang.c: Likewise. + +2003-08-19 Jan Hubicka + + * cgraph.c (cgraph_mark_needed_node): Call notice_global_symbol. + (cgraph_varpool_mark_needed_node): Likewise. + * cgraph.h (notice_global_symbol): Declare + * varasm.c (notice_global_symbol): Break out from ... + (assemble_start_function): ... here; update for variables. + (assemble_variable): Use notice_global_symbol. + +2003-08-19 Richard Sandiford + + * config/mips/mips.c (mips_va_arg): If EABI_FLOAT_VARARGS_P, + expect SFmode and DFmode arguments to be passed in FPRs, + regardless of the underlying type. + +2003-08-19 Richard Sandiford + + PR target/11924 + * config/mips/mips.c (INTERNAL_SYMBOL_P): New macro. + (mips_classify_symbol, m16_usym8_4, m16_usym5_4): Use it. + +2003-08-18 Matt Kraai + + PR c/11207 + * c-typeck.c (set_init_index): Check for negative index. + +2003-08-18 Bob Wilson + + * config/xtensa/crti.asm (_init, _fini): Add alternate code for new + call0 ABI. + * config/xtensa/crtn.asm (_init, _fini): Likewise. + * config/xtensa/lib1funcs.asm (__mulsi3, __udivsi3, __divsi3, + __umodsi3, __modsi3): Likewise. + * config/xtensa/t-xtensa (crti.o, crtn.o): Add $(GCC_CFLAGS) and + $(INCLUDES). + +2003-08-18 Aldy Hernandez + + * config/rs6000/spe.md ("*nabssf2_gpr"): New. + +2003-08-18 Richard Sandiford + + * config/mips/mips.md: Quote C code in braces. Remove use of + fake const0_rtx operands. Remove double backslashes. Use \;. + Remove workarounds for bogus warnings. + +2003-08-18 Richard Sandiford + + * config/mips/mips.md (muldf3, mulsf3): Don't call a gen_* function. + (muldf3_internal, muldf3_r4300): Select based on TARGET_4300_MUL_FIX + rather than TARGET_MIPS4300. + (mulsf3_internal, mulsf3_r4300): Likewise. + +2003-08-18 Richard Sandiford + + * config/mips/mips.md: Renumber unspecs. Clean up comments. + +2003-08-17 Roger Sayle + + * simplify-rtx.c (associative_constant_p): New function to test + whether an RTX expression is an immediate constant. + (simplify_associative_operation): New function to perform some + reassociation optimizations of associative binary expressions. + (simplify_binary_operation): Use simplify_associative_operation + to simplify PLUS, MULT, AND, IOR, XOR, SMIN, SMAX, UMIN and UMAX. + Floating point expressions are only reassociated when unsafe + math optimizations are permitted. + +2003-08-17 Andreas Jaeger + + * config/alpha/alpha.md: Remove usage of PARAMS. + + * config/i386/cygwin.h: Convert K&R prototypes to ISO C90. + * config/i386/i386-interix.h: Likewise. + * config/i386/winnt.c: Likewise. + * config/i386/cygming.h: Likewise. + * config/i386/cygwin2.c: Likewise. + * config/darwin.c: Likewise. + * config/darwin-c.c: Likewise. + * config/darwin-protos.h: Likewise. + * config/darwin.h: Likewise. + * config/s390/s390-protos.h: Likewise. + * config/s390/s390.c: Likewise. + * config/ia64/ia64.c: Likewse + * config/ia64/ia64-protos.h: Likewise. + * config/ia64/ia64-c.c: Likewise. + +2003-08-16 Kaveh R. Ghazi + + * config/sparc/sparc.c: Convert to ISO C. + + * config/sparc/sparc-protos.h: Don't use the PARAMS macro. + * config/sparc/sparc.c: Likewise. + +2003-08-16 Nathan Sidwell + + PR c++/11512 + * stmt.c (expand_expr_stmt_value): Don't warn about any void + typed expression. + +2003-08-16 Jan Hubicka + + * i386.c (ix86_fntype_regparm): Rename from ... + (ix86_function_regparm): ... this one; add fastcall and local + functions. + (ix86_function_ok_for_sibcall): Update. + (ix86_return_pops_args): Likewise. + (init_cumulative_args): Likewise. + (x86_can_output_mi_thunk): Likewise. + (function_arg): Fix formating. + (x86_this_parameter): Fix fastcall. + (x86_output_mi_thunk): Likewise. + + * cgraph.c (cgraph_mark_needed_node): Do not mark functions without + body as reachable; mark nested functions as needed too. + (dump_cgraph): Do not output global.calls. + * cgraph.h (cgraph_global_info): Kill. + * cgraphunit.c (cgraph_finalize_function): Enqueue needed functions. + (record_call_1): Speedup. + (cgraph_analyze_function): Break out from ...; compute inlining + parameters. + (cgraph_finalize_compilation_unit): ... here. + (cgraph_mark_inline): Kill computation of calls. + (cgraph_decide_inlining): Do not compute most of initial values. + +2003-08-14 Roger Sayle + + * fold-const.c (negate_expr_p): MULT_EXPRs and RDIV_EXPRs are easy + to negate if either operand is easy to negate, if we don't care + about sign-dependent rounding. + (negate_expr): Make the logic to negate a REAL_CST explicit. + Attempt to negate a MULT_EXPR or RDIV_EXPR by negating an operand + that's easy to negate, if we don't honor sign-dependent rounding. + (fold ): Optimize -A * B as A * -B if B is easy to + negate, and the symmetric A * -B as -A * B if A is easy to negate. + (fold ): Likewise, optimize -A/B and C/-D as A/-B and + -C/D if B and C are cheap to negate. Add an explicit rule to + optimize X/-1.0 as -X when we don't care about signaling NaNs. + +2003-08-14 Zack Weinberg + + * Makefile.in (tm_file): Rename tm_include_list. + (tm_p_file): Rename tm_p_include_list. + (build_xm_file): Rename build_xm_include_list. + (host_xm_file): Rename host_xm_include_list. + (xm_file): Rename xm_include_list. + (xm_file_list): Add to be substituted. + (cs-config.h, cs-bconfig.h, cs-tconfig.h, cs-tm.h, cs-tm_p.h): + Update to match. + (bt-load.o): Add missing dependency on $(TM_H). + * configure.in: Prefix value of EXTRA_MODES_FILE with config/. + For each of tm_file, tm_p_file, xm_file, host_xm_file, and + build_xm_file, generate both *_file_list and *_include_list + values from it. (xm_file_list was formerly not being generated.) + In *_include_list, prefix the names of all headers found in + $(srcdir)/config with config/. In each loop, consider only + the special case files that can actually appear in that list. + AC_SUBST all *_file_list and all *_include_list variables; do + not AC_SUBST the plain *_file variables. + * configure: Regenerate. + +2003-08-14 Zdenek Dvorak + + * cfg.c (dump_edge_info): Add name of loop_exit edge flag. + +2003-08-14 John David Anglin + + * pa.c (pa_adjust_insn_length): Delete adjustment for delay slot in + direct calls. + (attr_length_call): Include it here. Improve length estimate for + local calls. + (output_call): Use targetm.binds_local_p. + +2003-08-14 Kaveh R. Ghazi + + * builtins.c (CASE_MATHFN): New helper macro. + (mathfn_built_in): Simplify and sort. + + * protoize.c (substr): Delete, callers changed to `strstr'. + +2003-08-13 Zack Weinberg + + * config.gcc (iq2000*-*-elf*): Don't set xm_file. + * config/iq2000/xm-iq2000.h: Delete file. + +2003-08-13 Geoffrey Keating + + * gengtype.c (walk_type): Process a subobject before processing + the pointer that points to the subobject. + +2003-08-13 Per Bothner + + * regclass.c (init_reg_modes): Make non-static. + Rename to init_reg_modes_once per new naming convention. + (init_regs): Don't call init_reg_modes here. + * emit-rtl.c (init_emit_once): Call init_reg_modes_once here instead. + * rtl.h (init_reg_modes_once): New declaration. + * toplev.c (backend_init): Call init_regs after init_emit_once. + +2003-08-13 Kaz Kojima + + * config/sh/linux.h (DBX_REGISTER_NUMBER): Define so to map a + special index for MD_FALLBACK_FRAME_STATE_FOR to itself. + +2003-08-13 J"orn Rennecke + + * sh.c (sh_get_pr_initial_val): Always wrap in unspec for TARGET_SH1. + * sh.md (load_ra): Change insn predicate to TARGET_SH1. + +2003-08-13 Dale Johannesen + + * config/rs6000/rs6000.md (ctrsi, ctrdi): Reenable + handling of decrement-and-branch farther than 32 bits. + +2003-08-12 Kelley Cook + + * configure.in (make_compare_target): Move test to ... + * aclocal.m4 (gcc_AC_PROG_CMP_IGNORE_INITIAL): here. + * configure: Regenerate. + +2003-08-12 Richard Sandiford + + * config/mips/iris6.h: Convert to C90 prototypes. + * config/mips/irix6-libc-compat.c: Likewise. + * config/mips/mips-protos.h: Likewise. + * config/mips/mips.c: Likewise. + +2003-08-12 Nathanael Nerode + + fixinc/inclhack.def (svr4_krnl): Rename from svr4_kernel. Enable + for selected machines. Comment heavily. + fixinc/fixincl.x: Rebuild. + fixinc/tests/base/fs/rfs/rf_cache.h: New file. + +2003-08-12 Richard Sandiford + + * config/mips/mips.h: Tweak various comments. + * config/mips/mips.c: Likewise. + +2003-08-11 James E Wilson + + PR optimization/11319 + PR target/10021 + * alias.c (find_base_value, case REG): Return 0 not src if no base + found. + +2003-08-11 Kaveh R. Ghazi + + * gcse.c (gmalloc): Fix last change. + +2003-08-11 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation): Replace calls to + gen_rtx_NEG and gen_rtx_NOT with calls to simplify_gen_unary, + and calls to gen_rtx_PLUS, gen_rtx_MULT, gen_rtx_LSHIFTRT, + gen_rtx_ASHIFT and gen_rtx_AND with calls to simplify_gen_binary. + +2003-08-11 Roger Sayle + + * expr.c (expand_expr): If an ABS_EXPR has a complex type, abort. + * c-typeck.c (build_unary_op): COMPLEX_TYPE is not a valid + typecode for an ABS_EXPR. + + * doc/c-tree.texi: Document ABS_EXPR. + +2003-08-11 Roger Sayle + + * fold-const.c (fold): Optimize any associative floating point + operator with -funsafe-math-optimizations, not just MULT_EXPR. + +2003-08-11 Kaz Kojima + + * config/sh/lib1funcs.asm (__udivdi3): Add .type and .size + information in SHmedia case too. + (__divdi3, __umoddi3, __moddi3, __init_trampoline, __ic_invalidate): + Likewise. + (__set_fpscr): Use an access via GOT for PIC case. + +2003-08-11 Kelley Cook + + * configure.in (intermodule): Make switch test more portable. + * configure: Regenerate. + +2003-08-11 Kelley Cook + + * Makefile.in (cleanstrap): Pass BOOT_CFLAGS to bootstrap. + (restrap): Likewise. + +2003-08-11 Kaveh R. Ghazi + + * gcse.c (gmalloc): Argument is a size_t. Add ATTRIBUTE_MALLOC. + (grealloc): Size argument is a size_t. + (gcalloc): New function. Use throughout in lieu of + gmalloc/memset. + + * config/avr/avr.c (avr_init_once): Use xcalloc in lieu of + xmalloc/memset. + * config/ia64/ia64.c (ia64_reorg): Likewise. + * conflict.c (conflict_graph_new): Likewise. + * fixinc/fixincl.c (run_compiles): Likewise. + * genattrtab.c (optimize_attrs): Likewise. + * genrecog.c (new_decision): Likewise. + * haifa-sched.c (schedule_block): Likewise. + * hashtable.c (ht_create): Likewise. + +2003-08-11 Bob Wilson + + * config/xtensa/lib2funcs.S: Fix whitespace. + * config/xtensa/xtensa.md (all insns and expanders): Use brace block + syntax where appropriate. Remove unnecessary backslash escapes. + Reformat comments and fix some code formatting. + (extendqisi2): Rearrange conditional. + (*btrue, *bfalse, *ubtrue, *ubfalse, *bittrue, *bitfalse, *masktrue, + *maskfalse, movsicc_internal0, movsfcc_internal0): Call abort instead + of fatal_insn. + +2003-08-11 Richard Sandiford + + * config/mips/mips.c: Various formatting fixes. + (override_options): Resync -mtune handling with gas. + (mips_issue_rate): Rearrange like mips_use_dfa_pipeline_interface. + * config/mips/mips.h: More formatting fixes. + (mips_abi): Move declaration. + * config/mips/mips.md (exception_receiver): Add mode to + unspec_volatile. + +2003-08-11 Aldy Hernandez + + * config/rs6000/rs6000.c (spe_init_builtins): Handle evsplati and + evsplatfi here. + (bdesc_1arg): Remove evsplati and evsplatfi. + +2003-08-11 J"orn Rennecke + + * dwarf2asm.c (dw2_output_indirect_constant_1): Take user_label_prefix + into account. + +2003-08-10 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strcat): Optimize constant strings. + +2003-08-10 Gabriel Dos Reis + + * pretty-print.c (pp_base_indent): Rename from pp_indent. + * c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype. + (struct c_pretty_print_info): Add more fields. + (pp_c_left_paren): Move to c-pretty-print.c. + (pp_c_right_paren): Likewise. + (pp_c_left_brace): Likewise. + (pp_c_right_brace): Likewise. + (pp_c_left_bracket): Likewise. + (pp_c_right_bracket): Likewise. + (pp_c_declarator): Declare. + (pp_c_direct_declarator): Likewise. + (pp_c_specifier_qualifier_list): Likewise. + (pp_c_type_id): Likewise. + * c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework.. + (pp_c_type_qualifier_list): New. + (pp_c_pointer): Likewise. + (pp_c_parameter_type_list): Likewise. + (pp_c_function_definition): Likewise. + (pp_c_id_expression): Likewise. + (pp_c_simple_type_specifier): Tidy. + (pp_c_unary_expression): Likewise. + (pp_c_expression): Likewise. + (pp_c_pretty_printer_init): Likewise. + (pp_c_specifier_qualifier_list): Rework.. + (pp_c_abstract_declarator): Likewise. + (pp_c_postfix_expression): Likewise. + (pp_c_primary_expression): Likewise. + (pp_c_cast_expression): Likewise. + (pp_c_direct_abstract_declarator): Likewise. + (pp_c_storage_class_specifier): Likewise. + (pp_c_function_specifier): Likewise. + (pp_c_declaration_specifiers): Likewise. + (pp_c_direct_declarator): Likewise. + (pp_c_declarator): Likewise. + (pp_c_declaration): Likewise. + (pp_c_statement): Likewise. + (pp_c_integer_constant): Rename from pp_c_integer_literal. + (pp_c_character_constant): Rename from pp_c_character_literal. + (pp_c_bool_constant): Rename from pp_c_bool_literal. + (pp_c_enumeration_constant): Rename from pp_c_enumerator. + (pp_c_floating_constant): Rename from pp_c_real_literal. + (pp_c_constant): Rename from pp_c_literal. + * c-lang.c: Include diagnostic.h and c-pretty-print.h + (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. + (c_initialize_diagnostics): New. + * Makefile.in (c-lang.o): Update dependency. + +2003-08-10 Nathan Sidwell + + * c-typeck.c (digest_init): Add conversion for VECTOR_TYPEs. + +2003-08-10 Richard Sandiford + + * config/mips/mips.c (mips_no_mips16_string): Remove. + (override_options): Don't handle -mips16 as part of -mipsN. + * config/mips/mips.h (mips_no_mips16_string): Remove declaration. + (TARGET_SWITCHES): Add -mips16 and -mno-mips16 entries. + (TARGET_OPTIONS): Remove -mno-mips16. + +2003-08-10 Richard Sandiford + + * config/mips/mips-protos.h (coprocessor_operand): Remove declaration. + (coprocessor2_operand): Likewise. + * config/mips/mips.c (STAB_CODE_TYPE): Remove. + (lookup_name): Remove declaration. + (abort_with_insn): Remove. Replace all uses with fatal_insn. + (mips16, mips_abicalls): Remove. + (mips_char_to_class): Remove initialiser: all entries are NO_REGS. + (arith32_operand, large_int, true_reg_or_0_operand): Remove. + (coprocessor_operand, coprocessor2_operand): Remove. + (override_options): Don't set mips16 or mips_abicalls. + (print_operand): Don't expect SIGN_EXTEND operands. + (mips_secondary_reload_class): Likewise. + (mips_output_conditional_branch): Remove disabled long-branch code. + * config/mips/mips.h (call_used_regs): Remove declaration. + (may_call_alloca): Likewise. + (mips_cpu_attr, mips_abicalls_type, mips_abicalls_attr): Remove. + (mips_abicalls, mips16): Remove declarations. + (ASM_FINAL_SPEC, LIB_SPEC): Remove. + (CC1_SPEC): Remove outdated comment. + (MIPS_VERSION, MACHINE_TYPE): Remove. + (TARGET_VERSION_INTERNAL, TARGET_VERSION): Remove. + (PC_REGNUM, STACK_POINTER_OFFSET): Remove disabled definitions. + (STRUCT_VALUE_RETURN_REGNUM, STACK_DYNAMIC_OFFSET): Likewise. + (PUSH_ROUNDING): Likewise. + (ASSEMBLER_SCRATCH_REGNUM): Remove. + * config/mips/mips.md: Replace mips_cpu_attr with mips_tune + and mips16 with TARGET_MIPS16. + +2003-08-09 Per Bothner + + * cppinit.c (cpp_read_main_file): Split out source-independent + initialization to separate function ... + (cpp_post_options): New function. + * cppfiles.c (cpp_stack_file): Rename public name to ... + (_cpp_stack_file): New internal function name. + * cpplib.h: Update accordingly. + * cppinit.c: (cpp_create_reader): Initialize cpp_readers line here. + (cpp_read_main_file): Don't initialize line here. + * c-opts.c (c_common_post_options): Call cpp_post_options. + (c_common_parse_file): Call cpp_read_main_file, not cpp_stack_file. + * fix-header.c (read_scan_file): Call cpp_post_options. + +2003-08-09 Per Bothner + + * c-decl.c (SCOPE_LIST_APPEND): Remove bogus line continuation. + +2003-08-09 John David Anglin + + * pa.c (pa_asm_output_mi_thunk): Fix typo. + +2003-08-09 Neil Booth + + PR preprocessor/11839 + * cppfiles.c (open_file): Handle ENOTDIR. + +2003-08-09 Richard Sandiford + + PR target/11699 + * config/mips/mips.c (override_options): Reject -mabi=eabi -mabicalls. + +2003-08-08 John David Anglin + + * pa.md (extzv, extv, insv): Fix operand limit checks. Fail if + source/destination is not a register operand. + +2003-08-08 Richard Henderson + + PR target/11535 + * config/ia64/ia64.c (ia64_initial_elimination_offset): Remove + RETURN_ADDRESS_POINTER_REGNUM. + (ia64_expand_prologue): Don't frob it. + (ia64_output_function_epilogue): Likewise. + (ia64_return_addr_rtx): New. + (ia64_split_return_addr_rtx): New. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.h (FIRST_PSEUDO_REGISTER): Decrement. + (RETURN_ADDRESS_POINTER_REGNUM): Remove. + (GENERAL_REGNO_P): Don't check it. + (AR_*_REGNUM): Renumber. + (FIXED_REGISTERS): Remove RETURN_ADDRESS_POINTER_REGNUM. + (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): Likewise. + (REG_ALLOC_ORDER, REG_CLASS_CONTENTS): Likewise. + (ELIMINABLE_REGS, REGISTER_NAMES): Likewise. + (RETURN_ADDR_RTX): Use ia64_return_addr_rtx. + * config/ia64/ia64.md (UNSPEC_RET_ADDR): New. + (movdi_ret_addr): New. + +2003-08-08 Geoffrey Keating + + * config.gcc (powerpc-*-darwin*): Don't build a soft-float multilib. + +2003-08-08 Roger Sayle + + * tree.h (get_identifier) Define a macro form of get_identifier + that calls get_identifier_with_length when the string is constant. + (get_identifier_with_length): Change type of second argument to + size_t in prototype. + * stringpool.c (get_identifier): Undefine the macro before giving + the function definition. + (get_identifier_with_length): Change type of second argument to + size_t in function definition. + * hashtable.c (calc_hash): Change type of second argument to size_t. + (ht_lookup): Change type of third argument to size_t. Reorganize + to speed-up the cases where the hash table slot is empty, or the + first probe matches (i.e. there isn't a collision). + * hashtable.h (ht_lookup): Adjust function prototype. + +2003-08-08 Bernardo Innocenti + + PR target/9697 + PR target/11777 + * longlong.h (count_leading_zeros): Exclude on __mcpu32__. + +2003-08-08 Neil Booth + + * common.opt: Add debug switches. + * flags.h (use_gnu_debug_info_extensions): Boolify. + * opts.c (write_symbols, debug_info_level, + use_gnu_debug_info_extensions): Move from toplev.c. + (set_debug_level): New. + (common_handle_options): Handle debug switches. + (print_help): Display target options directly. + * toplev.c (debug_hooks): Don't initialize. + (write_symbols, debug_info_level, + use_gnu_debug_info_extensions): Move to opts.c. + (debug_args, display_help, decode_g_option): Remove. + (process_options): Set no debug if level zero here, + and no-debug-hooks. Error here if impossible debug format selected. + * toplev.h (display_help, decode_g_option): Remove. + +2003-08-08 Richard Sandiford + + * tree.c (get_file_function_name_long): Fix size of alloca() area. + +2003-08-08 Kelley Cook + + * configure.in (gcc_cv_prog_cmp_skip): Flipflop make_compare_target + and gcc_cv_prog_cmp_skip. + * configure: Regenerate. + +2003-08-08 Stan Cox + + * config/iq2000: New port. + * config.gcc (iq2000-*-elf): Added. + * doc/install.texi (Specific): Add iq2000 description. + +2003-08-08 Andreas Schwab + + * configure.in (gcc_cv_as_ia64_ltoffx_ldxmov_relocs): Fix quoting + and insert missing empty argument. + * configure: Regenerate. + +2003-08-07 John David Anglin + + * pa.c (update_total_code_bytes): Use new macro IN_NAMED_SECTION_P. + (attr_length_millicode_call): Likewise. + (attr_length_call): Likewise. Revise some maximum insn lengths. + (attr_length_indirect_call): Likewise. + (output_call): Fix thinko that added extra nop. + * pa.h (IN_NAMED_SECTION_P): Define. + + PR c++/11712 + * pa-hpux.h, pa-hpux10.h, pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define + __STDC_EXT__ when using C++ dialect. + +2003-08-07 J"orn Rennecke + + * sh.c (calc_live_regs): If the return address pointer is live, + force pr live. + (sh5_schedule_saves): Exclude PR_MEDIA_REG from being a temp register + for saves / restores. + (sh_expand_epilogue): If sh_media_register_for_return returns a + register number, flag the instructions that restores PR_MEDIA_REG + as possibly dead. + Remove dead update of offset. + (sh_get_pr_initial_val): Use UNSPEC_RA if we don't know yet if + we can use the result of get_hard_reg_initial_val. + * sh.md (UNSPEC_RA): New constant. + (movsi_i_lowpart+1): Changed into a define_insn_and_split, named: + (load_ra). Handle UNSPEC_RA. + (sibcall_media): Use PR_MEDIA_REG. + + * sh.h (CALL_USED_REGISTERS): Include PR_REG and PR_MEDIA_REG. + * sh.c (calc_live_regs): Use sh_pr_n_sets to determine if pr + needs saving on SHmedia. + +2003-08-07 Ulrich Weigand + + * config/s390/s390.md: Replace all occurrences of \\t with \t. + +2003-08-07 Richard Sandiford + + * local-alloc.c (combine_regs): Fix comment typo. + +2003-08-06 Zack Weinberg + + * c-decl.c (builtin_decls): Replace with first_builtin_decl + and last_builtin_decl. + (c_init_decl_processing): Initialize both. + (c_reset_state): Iterate from first_builtin_decl to + last_builtin_decl inclusive to reintroduce builtins. + +2003-08-06 David Mosberger + + * doc/extend.texi (Function Attributes): Document the IA-64 version + of the "model" attribute. + + * config/ia64/ia64.h (SYMBOL_FLAG_SMALL_ADDR): New macro. + (SYMBOL_REF_SMALL_ADDR_P): Ditto. + (PREDICATE_CODES): Mention "small_addr_symbolic_operand". + + * config/ia64/ia64.c (ia64_handle_model_attribute): New function. + (ia64_encode_section_info): Likewise. + (ia64_attribute_table): Add "model" attribute. + (TARGET_ENCODE_SECTION_INFO): Define. + (small_addr_symbolic_operand): New function. + (got_symbolic_operand): Return 0 for a symbolref to an object + in the small address area. + (enum ia64_addr_area): New type. + (small_ident1): New variable. + (small_ident2): Likewise. + (init_idents): New function. + (ia64_get_addr_area): Likewise. + (ia64_encode_addr_area): Likewise. + (ia64_encode_section_info): Likewise. + (ia64_expand_load_address): For symbolic references to objects in + the small-address-area, load the address via gen_rtx_SET() (which, + eventually, will expand into "addl"). + +2003-08-06 Per Bothner + + * line-map.h (fileline): New typedef. + (struct line_map, linemap_add, linemap_lookup): Use it. + * input.h (struct location_s): Comment notes that long-term we want + to replace it by fileline. + +2003-08-06 J"orn Rennecke + + Fix SHcompact exception handling: + * sh.c (sh_get_pr_initial_val): If PR is or miight be clobbered + by the prologue, return a MEM with return_address_pointer_rtx + as address. + * sh.h (HARD_REGNO_MODE_OK): PR is OK for SImode. + (RETURN_ADDR_OFFSET): Don't define. + (SH_DBX_REGISTER_NUMBER): Use SHmedia numbers for SHmedia + registers that are visible in compact mode. Show that SHmedia + registers still exist in compact mode, even if there are not + readily accessible. + (ASM_PREFERRED_EH_DATA_FORMAT): Supply DW_EH_PE_indirect + if GLOBAL. Use DW_EH_PE_textrel (nominally) for CODE, + and DW_EH_PE_pcrel for pic data. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): If DW_EH_PE_textrel, + set SYMBOL_FLAG_FUNCTION in symbol, and actually use + DW_EH_PE_pcrel / DW_EH_PE_absptr encoding. + (ALLOCATE_INITIAL_VALUE): Put PR on stack if prologue clobbers it. + * sh.md (movsi_media-1): New splitter. + +2003-08-06 Graeme Peterson + + * config/i386/nto.h: New. + * config/i386/t-nto: New. + * config.gcc (i[34567]86-*-nto-qnx*): New. + +2003-08-06 Phil Edwards + + * doc/install.texi (*-*-solaris2*): Refine configure instructions. + +2003-08-06 Alan Modra + + * calls.c (load_register_parameters): Arrange for call_fusage to + report the whole register as used when shifting to the msb. + +2003-08-05 Roger Sayle + + * builtins.c (expand_builtin): When not optimizing, call the library + function for all builtins that have library functions (except alloca). + +2003-08-05 Alexandre Oliva + + * c.opt: Introduce -fworking-directory. + * doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it. + * c-common.h (flag_working_directory): Declare. + * c-common.c (flag_working_directory): Define. + * c-opts.c (c_common_handle_options): Set it. + (sanitize_cpp_opts): Set... + * cpplib.h (struct cpp_options): ... working_directory option. + (struct cpp_callbacks): Add dir_change. + * cppinit.c (read_original_filename): Call... + (read_original_directory): New. Look for # 1 "directory//" + and process it. + (cpp_read_main_file): Call dir_change callback if working_directory + option is set. + * gcc.c (cpp_unique_options): Pass -g*. + * c-lex.c (cb_dir_change): New. + (init_c_lex): Set dir_change callback. + * toplev.c (src_pwd): New static variable. + (set_src_pwd, get_src_pwd): New functions. + * toplev.h (get_src_pwd, set_src_pwd): Declare. + * dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd(). + * dwarf2out.c (gen_compile_unit_die): Likewise. + * dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise. + +2003-08-05 Gabriel Dos Reis + + * pretty-print.h (pp_set_line_maximum_length): Make macro. + (pp_set_prefix): Likewise. + (pp_destroy_prefix): Likewise. + (pp_remaining_character_count_for_line): Likewise. + (pp_clear_output_area): Likewise. + (pp_formatted_text): Likewise. + (pp_last_position_in_text): Likewise. + (pp_emit_prefix): Likewise. + (pp_append_text): Likewise. + (pp_flush): Likewise. + (pp_format_text): Likewise. + (pp_format_verbatim): Likewise. + (pp_tree_identifier): Tidy. + * pretty-print.c (pp_base_format_text): Rename from pp_format_text. + (pp_base_format_verbatim): Rename from pp_format_verbatim. + (pp_base_flush): Rename from pp_flush. + (pp_base_set_line_maximum_length): Rename from + pp_set_line_maximum_length. + (pp_base_clear_output_area): Rename from pp_clear_output_area. + (pp_base_set_prefix): Rename from pp_set_prefix. + (pp_base_destroy_prefix): Rename from pp_destroy_prefix. + (pp_base_emit_prefix): Rename from pp_emit_prefix. + (pp_base_append_text): Rename from pp_append_text. + (pp_base_formatted_text): Rename from pp_formatted_text. + (pp_base_last_position_in_text): Rename from pp_last_position_in_text. + (pp_base_remaining_character_count_for_line): Rename from + pp_remaining_character_count_for_line. + * diagnostic.h (diagnostic_format_decoder): Tidy. + (diagnostic_flush_buffer): Likewise. + * c-pretty-print.h: (pp_c_string_literal): Declare. + (pp_c_real_literal): Likewise. + (pp_c_integer_literal): Likewise. + * c-pretty-print.c (pp_c_char): Use pp_string in lieu of + pp_identifier. + (pp_c_character_literal): Tidy. + (pp_c_string_literal): Make public. + (pp_c_bool_literal): Likewise. + (pp_c_integer_literal): Likewise. + (pp_c_real_literal): Likewise. + + * Makefile.in (C_PRETTY_PRINT_H): New variable. + (c-pretty-print.o): Update dependence. + +2003-08-05 Chris Demetriou + + * config/mips/mips.md (fix_truncdfsi2_macro): Properly restore + ".set nomacro" state. + (fix_truncsfsi2_macro): Likewise. + +2003-08-05 Steven Bosscher + + * tree.h (DID_INLINE_FUNC): Remove macro. + (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h, + add tree check for FUNCTION_DECL. + (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h. + (struct tree_decl): Rename inlined_function_flag to + declared_inline_flag. + * c-common.h (c_lang_decl): Remove. + (DECL_ESTIMATED_INSNS): Remove. + * c-tree.h (struct lang_decl): Don't include c_lang_decl. + (DECL_DECLARED_INLINE_P): Remove. + * c-decl.c (grokdeclarator): Update comment. With -finline-functions, + do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC. + (finish_function): Make uninlinable a bool. Fixup call to + tree_inlinable_function_p() and fix some code style issues. + * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'. + * cgraph.c (dump_cgraph): Likewise. + * cgraphunit.c (cgraph_decide_inlining): Likewise + (cgraph_finalize_compilation_unit): Likewise. + Also update call to tree_inlinable_function_p(). + (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead + look at DECL_DECLARED_INLINE and reverse logic. + * print-tree.c (print_node): Likewise. + * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC. + * tree-inline.h (tree_inlinable_function_p): Make a bool. Update + prototype. + * tree-inline.c (inlinable_function_p): Split up in this function to + check for basic inlining inhibiting conditions, and new + limits_allow_inlining() function. Warn if inlining is impossible + because the inline candidate calls alloca or uses sjlj exceptions. + (limits_allow_inlining): this new function to check if the inlining + limits are satisfied. Throttle from currfn_max_inline_insns, not from + MAX_INLINE_INSNS_SINGLE. The latter only makes sense if + MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal. + Update prototypes. + (tree_inlinable_function_p): Make a bool. Update call to + inlinable_function_p + (expand_call_inline): Use limits_allow_inlining() when not in + unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC, + instead see if the function was declared `inline'. + +2003-08-05 Josef Zlomek + + * gcse.c (try_replace_reg): Fix updating of note. + +2003-08-04 Roger Sayle + + PR middle-end/11771 + * fold-const.c (negate_expr_p ): Change to match the + logic in negate_expr, i.e. we don't invert (A-B) for floating + point types unless flag_unsafe_math_optimizations. + +2003-08-04 Roger Sayle + + * fold-const.c (fold ): Transform x+x into x*2.0. + Optimize x*c+x and x+x*c into x*(c+1) and x*c1+x*c2 into x*(c1+c2) + for floating point expressions with -ffast-math. + (fold ): Don't transform x*2.0 into x+x. + * expmed.c (expand_mult): Wrap long line. Expand x*2.0 as x+x. + +2003-08-04 Roger Sayle + + * c-common.c (flag_noniso_default_format_attributes): Delete. + (built_in_attribute): Don't define/undefine DEF_FN_ATTR. + (c_attrs_initialized): Delete. + (c_common_nodes_and_builtins): Don't test c_attrs_initialized, + always call c_init_attributes. + (c_init_attributes): Don't define/undefine DEF_FN_ATTR. Don't + set c_attrs_initialized when done. + (c_common_insert_default_attributes): Delete. + * c-common.h (flag_noniso_default_format_attributes): Delete. + (c_coomon_insert_default_attributes): Delete prototype. + * c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set + flag_noniso_default_format_attributes. + + * c-decl.c (c_insert_default_attributes): Delete. + * c-tree.h (c_insert_default_attributes): Delete prototype. + + * attribs.c (decl_attributes): Don't call insert_default_attributes + langhook. Update function description comment. + * langhooks.h (lang_hooks): Remove insert_default_attributes field. + * langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete. + * c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. + * system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro. + + * objc/objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't + define. + +2003-08-04 Richard Sandiford + + * config/mips/mips.c (override_options): Disable -G on targets that + have no .section support. + (mips_select_section): Use default_select_section for such targets. + +2003-08-04 Nathanael Nerode + + * fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable. + * fixinc/inclhack.def (static_getrnge): Remove disabled hack. + * fixinc/fixincl.x: Rebuild. + * fixinc/tests/base/regexp.h: New test. + +2003-08-04 Alexandre Oliva + + * c-ppoutput.c (cb_line_change): Don't skip line changing while + parsing macro arguments in the top-level context. + +2003-08-04 Neil Booth + + * config.in: Remove HAVE_LSTAT. + * configure, configure.in: Don't test for lstat. + +2003-08-03 Gabriel Dos Reis + + * opts.c (decode_options): Do language-specific initialization for + the global diagnostic context. + * langhooks-def.h (lhd_initialize_diagnostics): Declare. + (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): New macro. + (LANG_HOOKS_INITIALIZER): Adjust. + * langhooks.h (struct lang_hooks): Add new field + initialize_diagnostics. + * langhooks.c (lhd_initialize_diagnostics): Define. + +2003-08-03 Gabriel Dos Reis + + * pretty-print.h: Adjust macro definitions. + * pretty-print.c (pp_newline): Rename to pp_base_newline. + (pp_character): Rename to pp_base_character. + (pp_string): Rename to pp_base_string. + * c-pretty-print.c (pp_buffer): Move to pretty-print.h + (pp_newline): Likewise. Adjust. + (pp_c_char): Adjust. + +2003-08-03 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_ABS, BUILT_IN_IMAXABS, BUILT_IN_LABS, + BUILT_IN_LLABS): Move to miscellaneous section. + +2003-08-03 Neil Booth + + PR preprocessor/11534 + * cppexp.c (parse_defined): Warn only if -pedantic. + +2003-08-03 Neil Booth + + * cppfiles.c (stack_file): Use file path. + +2003-08-02 Roger Sayle + + * builtin-types.def (BT_SSIZE): New primitive type. + (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, + BT_FN_STRING_CONST_STRING_CONST_STRING_INT, + BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, + BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR): New function types. + * builtins.def (BUILT_IN_DCGETTEXT, BUILT_IN_DGETTEXT, + BUILT_IN_FSCANF, BUILT_IN_GETTEXT, BUILT_IN_STRFMON, + BUILT_IN_STRFTIME, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): New builtins. + * builtin-attrs.def: Remove DEF_FN_ATTR construct and the last + few functions that define default attributes using it. + * c-common.c (c_common_insert_default_attributes): Do nothing. + + * doc/extend.texi: Document these "new" builtins. + +2003-08-02 Kaz Kojima + + * config/sh/linux.h (SUBTARGET_LINK_SPEC): Don't set rpath. + (LIB_SPEC): Set -lpthread always when -pthread set. Set -lieee + when -mieee-fp set and -shared not set. + (SH_FALLBACK_FRAME_FLOAT_STATE): Don't define for SH5. + +2003-08-02 Neil Booth + + * cppfiles.c (struct _cpp_file): Rename once_only_next to + next_file. Remove import and pragma_once, add once_only. + (find_file): Add new file structures to the all_files list. + (should_stack_file): Mark #import-ed files once-only, and + don't stack them if the file has already been stacked. + (_cp_mark_file_once_only): Simplify. + * cpphash.h (struct cpp_reader): Rename once_only_files + to all_files. Rename saw_pragma_once to seen_once_only. + (_cpp_mark_file_once_only): Update prototype. + * cpplib.c (do_pragma_once): Update. + +2003-08-02 Neil Booth + + * cppfiles.c (ENOTDIR): Remove. + (open_file_in_dir): Rename find_file_in_dir. Handle errors + other than ENOENT here. + (once_only_file_p): Rename should_stack_file. + (find_file, open_file_failed, read_file_guts): Report errors + with full path name. + (read_file): Move pch handling to should_stack_file. + (should_stack_file): Handle PCH and once-only issues, and + reading the file. + (stack_file): Don't do file reads. + +2003-08-02 Zdenek Dvorak + + * libgcov.c (gcov_exit): Cleanup and fix. + * profile.c (compute_value_histograms): Don't try to read profiles + that are not present. + +2003-08-02 Kaveh R. Ghazi + + * builtins.def: Categorize. + + * builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL): + Mind fp rounding. + (BUILT_IN_FFSL): Use DEF_EXT_LIB_BUILTIN. + +2003-08-02 Andreas Tobler + + * config.gcc: Enable posix threads by default on darwin. + +2003-08-01 Jakub Jelinek + + * cfgcleanup.c (outgoing_edges_match): Check REG_EH_REGION notes + even if nehedges1 is 0. + +2003-08-01 Nathanael Nerode + + * fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h, + fixinc/fixtests.c, fixinc/procopen.c, fixinc/server.c, + fixinc/server.h, fixinc/fixincl.c: ANSIfy function prototypes + and defintions. + + * fixinc/inclhack.def (broken_cabs): Make matching more generous. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/math.h: Regenerate to match test_text change. + +2003-08-01 Rainer Orth + + * ggc-common.c (gt_pch_restore): Case MAP_FAILED to void *. + +2003-08-01 Richard Kenner + + * except.c (sjlj_emit_dispatch_table): Use ptr_mode, not Pmode, + for accesses to exc_ptr. + +2003-08-01 Geoffrey Keating + + * doc/sourcebuild.texi (Front End Directory): Don't make references + to libsubdir, it's not part of the interface to frontends. + * doc/install.texi (Configuration): Help users read faster by saying + that GCC's configure options are the standard autoconf ones. + Mention --libdir. Update the default rules for finding the + assembler. Don't use libsubdir since we haven't said what it means. + (Specific): In the Solaris 7 notes, update the place to put the + assembler. + * doc/invoke.texi: Update lib/gcc-lib to lib/gcc. + * doc/cpp.texi (Search Path): Actually, the search path + depends on libdir, which can relocate with cpp. + * doc/tm.texi (Driver): Don't document STANDARD_EXEC_PREFIX, it's + now a private interface between the Makefile and the driver. + +2003-08-01 Richard Henderson + + * system.h: Poison ASM_SIMPLIFY_DWARF_ADDR. + + * varasm.c (lookup_constant_def): New function. + * rtl.h (lookup_constant_def): Declare it. + * dwarf2out.c (loc_descriptor_from_tree): Use it. + Use targetm.delegitimize_address, not ASM_SIMPLIFY_DWARF_ADDR. + +2003-08-01 Zack Weinberg + + * c-decl.c (gettags, pushdecl_function_level): Delete. + (last_function_parm_vars): Rename last_function_parm_others. + (current_function_parm_vars): Rename current_function_parm_others. + (struct c_scope): Rewrite comment explaining this data structure. + Add names_last, blocks_last, parms_last fields. Rename + incomplete_list to incomplete. + (SCOPE_LIST_APPEND, SCOPE_LIST_CONCAT): New macros. + (poplevel): Ignore second argument. No need to nreverse + anything. Restructure such that each list is processed + exactly once. Use 'const location_t *locus' syntactic sugar + variable where useful. Issue unused variable warnings + ourselves, do not rely on function.c. + (insert_block, pushdecl, bind_label): Use SCOPE_LIST_APPEND. + (pushdecl_top_level): Likewise. Don't call duplicate_decls. + (implicitly_declare): decl cannot be error_mark_node. + (undeclared_variable): Manipulate scope structure directly. + (c_make_fname_decl): Likewise. + (getdecls, c_init_decl_processing): Fix comment. + (mark_forward_parm_decls): Use SCOPE_LIST_CONCAT. No need + for 'last' variable. + (grokparms): No need to nreverse parms list. + (store_parm_decls_newstyle): Set up the parms_last and + names_last fields of the new scope too. + (store_parm_decls_oldstyle): Can assume DECL_WEAK is not set + on parms to begin with; check this under ENABLE_CHECKING. Set + up parms_last. + (check_for_loop_decls): Refer directly to current_scope->tags. + Use consistent quote style in diagnostics. + (c_write_global_declarations): The names list is not backward. + + * c-common.h: Don't prototype gettags. + * c-parse.in: Call poplevel with second argument 0 always. + +2003-08-01 Kaveh R. Ghazi + + * builtins.def: Resort builtins. + +2003-08-01 Kaveh R. Ghazi + + * builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN, + DEF_EXT_LIB_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN): + Prepend "__builtin_" onto NAME with string concatenation. Remove + explicit "__builtin_" from each macro call. + + Reformat entire file. + +2003-08-01 Kaveh R. Ghazi + + * builtins.def (ATTR_MATHFN_ERRNO, ATTR_MATHFN_FPROUNDING, + ATTR_MATHFN_FPROUNDING_ERRNO): New macros. Use throughout. + +2003-08-01 Andreas Krebbel + + * config/s390/s390.c (s390_select_ccmode): Do not attempt to use CCL, + CCL1, or CCL2 modes with floating point operations. + + * config/s390/s390.md ("*addsf3_cc", "*addsf3_cconly", "*adddf3_cc", + "*adddf3_cconly", "*subsf3_cc", "*subsf3_cconly", "*subdf3_cc", + "*subdf3_cconly"): New insns. + ("*negabssi2", "*negabsdi2", "*negabsdf2", "*negabssf2"): Likewise. + +2003-08-01 Neil Booth + + * Makefile.in: Refine dependencies. + * c-opts.c (c_common_handle_option): Do nothing for -Wimport. + * c.opt: Update help for -Wimport. + * cppfiles.c: Include hashtab.h. Update comments. + (stack_file): Read the file before updating dependencies. + (once_only_file_p): Be smarter about marking once-only files. + (_cpp_mark_file_once_only): Correct the check for existence on + the list. + (open_file_failed): Use name not path, which is NULL. + * cpphash.h: Don't include hashtab.h. + (struct _cpp_file): Remove. + (struct cpp_reader): Update. + * cppinit.c (cpp_create_reader): Don't initialize warn_import. + * cpplib.h (struct cpp_options): Remove warn_import. + (cpp_simplify_path): Remove. + +2003-08-01 Nathan Sidwell + + PR c++/11295 + * doc/extend.texi (Statement Expressions): Document C++ semantics. + +2003-07-31 SUGIOKA Toshinobu + + * config.gcc (sh-*-linux*): Do not override sh/t-linux with sh/t-le. + +2003-07-31 Kaveh R. Ghazi + + * builtin-types.def: Use `LONGDOUBLE' instead of `LONG_DOUBLE' + throughout. + * builtins.def: Likewise. + +2003-07-31 Jason Merrill + + * Makefile.in (bubblestrap): Don't require a previous full + bootstrap. + + * expr.c (mostly_zeros_p): No longer static. + * tree.h: Declare it. + * stmt.c (resolve_asm_operand_names): Don't copy the pattern + unless we need to do substitutions. + +2003-07-31 Roger Sayle + + * fold-const.c (fold ): Optimize both x*pow(x,c) and + pow(x,c)*x as pow(x,c+1) for constant values c. Optimize x*x + as pow(x,2.0) when the latter will be expanded back into x*x. + (fold ): Optimize pow(x,c)/x as pow(x,c-1). + * builtins.c (expand_builtin_pow): Ignore flag_errno_math as + pow can never set errno when used with an integer exponent. + Always use expand_powi when exponent is -1, 0, 1 or 2. + (fold_builtin): Don't rewrite pow(x,2.0) as x*x nor pow(x,-2.0) + as 1.0/(x*x). This avoids unbounded recursion as we now prefer + the pow forms of these expressions. + +2003-07-31 Geoffrey Keating + + * Makefile.in (libexecdir): New. + (libsubdir): Use gcc instead of gcc-lib. + (libexecsubdir): New. + (ORDINARY_FLAGS_TO_PASS): Add libexecsubdir. + (DRIVER_DEFINES): Add STANDARD_LIBEXEC_PREFIX, use gcc instead of + gcc-lib. + (installdirs): Make libexecsubdir. + (install-common): Put executables in libexecsubdir. + (itoolsdir): Use libexecsubdir. + (itoolsdatadir): New. + (install-mkheaders): Separate data files and executables. + (install-collect2): Put executables in libexecsubdir. + (uninstall): Remove libexecsubdir. + * mkheaders.in: Update for new arrangement of files. + (libexecdir): New. + (libexecsubdir): New. + (itoolsdir): Use libexecsubdir. + (itoolsdatadir): New. + * gcc.c (gcc_libexec_prefix): New. + (STANDARD_LIBEXEC_PREFIX): Use gcc instead of gcc-lib. + (standard_exec_prefix_1): Use libexec. + (standard_exec_prefix_2): New. + (standard_libexec_prefix): New. + (process_command): Update for new arrangement of files. Compute + gcc_libexec_prefix. Update for change from gcc-lib to gcc. + +2003-07-31 Nathanael Nerode + + * inclhack.def (stdio_va_list): Avoid bogus replacement which + triggers on Interix. + * fixincl.x: Regenerate. + +2003-07-31 Jakub Jelinek + + * config/i386/i386.c (legitimate_pic_address_disp_p): Disallow TLS + SYMBOL_REFs not inside UNSPEC even in PLUS rtx. + +2003-07-31 Richard Kenner + + * dwarf2out.c (loc_descriptor_from_tree, case CONSTRUCTOR): New case. + +2003-07-31 Per Bothner + + * opts.c (in_fnames, num_in_fnames): Moved here from c-opts. + (add_input_filename): New function. + (handle_options): Call add_input_filename directly instead of + with a lang hook. + * opts.h (in_fnames, num_in_fnames): Moved here. + (add_input_filename): Declare. + * c-decl.c: Need to #include opts.h. + * Makefile.in (c-decl.o): Also depends on opts.h. + * c-opts.c (in_fnames, num_in_fnames): Moved to opts.c. + (c_common_handle_filename): Replaced by add_input_filename. + * c-common.h (in_fnames, num_in_fnames, c_common_handle_filename): + Remove. + * langhooks.h (struct lang_hooks): Remove handle_filename hook. + * langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME): Remove macro. + (LANG_HOOKS_INITIALIZER): Remove use of LANG_HOOKS_HANDLE_FILENAME. + * c-lang.c (LANG_HOOKS_HANDLE_FILENAME): Remove macro. + +2003-07-31 Zdenek Dvorak + + * combine.c (try_combine): Set JUMP_LABEL for newly created + unconditional jump. + +2003-07-31 Zdenek Dvorak + + * fold-const.c (fold): Fold some comparisons of bit operations. + +2003-07-31 Jan Hubicka + + * cgraph.c (create_edge): Fix typo. + * i386.c (pic_symbolic_operand): Reorder tests. + +2003-07-31 Nathan Sidwell + + * doc/gcov.texi (Invoking Gcov): Describe output name mangling + more fully. + (Gcov Data Files): Update. + +2003-07-31 Rainer Orth + + * config.gcc (alpha*-dec-osf[45]*): Enable POSIX thread support by + default. + + * gthr-posix.c: New file. + * gthr-posix.h: Define _REENTRANT if missing. + Make _LIBOBJC #pragma weak visible with _LIBOBJC_WEAK. + + * config/alpha/t-osf4 (SHLIB_LINK): Hide dummy functions provided + by gthr-posix.o. + * config/alpha/t-osf-pthread: New file. + + * fixinc/inclhack.def (alpha_pthread): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/pthread.h [ALPHA_PTHREAD_CHECK]: New testcase. + + * doc/install.texi (alpha*-dec-osf*): Remove --enable-threads + warning. + Fixes PR bootstrap/9330. + +2003-07-31 Rainer Orth + + * configure.in (gcc_cv_ld_hidden): Also disable on mips-sgi-irix5* + without GNU ld. + Update comment. + * configure: Regenerate. + +2003-07-31 Vladimir Makarov + + * sched-deps.c (sched_analyze_2): Prevent interblock move of CC0 + setter. + +2003-07-30 Roger Sayle + + * builtins.def: Alphabetize. + +2003-07-30 Matt Kraai + + * doc/c-tree.texi: Normalize spellings of "lowercase" and + "uppercase". + * doc/cpp.texi: Likewise. + * doc/md.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/tm.texi: Likewise. + +2003-07-30 Matt Kraai + + * objc/Make-lang.in (objc.stage1, objc.stage2, objc.stage3) + (objc.stage4, objc.stageprofile, objc.stagefeedback): Remove moves + of cc1obj. + +2003-07-30 Chris Demetriou + + * config/mips/mips.h (SIZE_TYPE, PTRDIFF_TYPE): Undef these + macros before defining them. + +2003-07-31 Ulrich Weigand + + * config/s390/s390.md (UNSPEC_ROUND, UNSPEC_SETHIGH, + UNSPECV_BLOCKAGE): New constants. + ("*sethighqisi", "*sethighhisi", "*sethiqidi_64", "*sethiqidi_31", + "*extractqi", "*extracthi", "*extendqidi2" splitter, "*extendqisi2" + splitter, "fix_truncdfdi2_ieee", "fix_truncdfsi2_ieee", + "fix_truncsfdi2", "fix_truncsfsi2", "blockage"): Use them. + + (all insns and expanders): Write output control string as brace block + where appropriate. Remove \-escapes for doublequote characters. + +2003-07-31 Jan Hubicka + + * gcse.c (insert_store): Fix typo in previous patch. + +2003-07-30 Neil Booth + + * cppfiles.c (stack_file, open_file_failed): Use path for deps. + +2003-07-30 Andi Kleen + + * loop.c (check_dbra_loop): Allow LTU in the loop condition. + +2003-07-30 Zdenek Dvorak + + * combine.c (distribute_notes): Cancel REG_VALUE_PROFILE notes. + * gcov-io.h (GCOV_FIRST_VALUE_COUNTER, GCOV_LAST_VALUE_COUNTER, + GCOV_N_VALUE_COUNTERS): New. + * profile.c (compute_value_histograms): New static function. + (branch_prob): Read back the value histograms. + * rtl.c (reg_note_name): Add name for REG_VALUE_PROFILE note. + * rtl.h (enum reg_note): Add REG_VALUE_PROFILE note. + * value-prof.c: Add comment on reading the profile. + * value-prof.h (COUNTER_FOR_HIST_TYPE, HIST_TYPE_FOR_COUNTER): New. + * doc/invoke.texi (-fprofile-values): Document behavior with + -fbranch-probabilities. + +2003-07-30 David Edelsohn + + * longlong.h (PowerPC umul_ppmm): Do not test __vxworks__. + +2003-07-30 Ulrich Weigand + + * config/s390/s390.h (EH_RETURN_HANDLER_RTX): Compute offset + symbolically. + +2003-07-30 Jan Hubicka + + * gcse.c (insert_store): Ignore fake edges. + + * c-common.c (flag_vtable_gc): Kill. + * c-common.g (flag_vtable_gc): Kill. + * c-opts (c_common_handle_option): Kill. + * c.opt (fvtable-gc): Kill. + * final.c (final_scan_insn): Do not call assemble_vtable_entry. + * output.h (assemble_vtable_entry, assemble_vtable_inherit): Kill. + * varasm.c (assemble_vtable_entry, assemble_vtable_inherit): Kill. + + * invoke.texi (-ftable-gc): Kill documentation. + + * tree-inline.c (inlinable_function_p): Don't set DECL_UNINLINABLE + just because function body is missing. + + * i386.c (pic_symbolic_operand): Properly detect RIP relative unspecs. + +2003-07-30 Ranjit Mathew + + * unwind-sjlj.c: Fix typo in file description. + +2003-07-30 Alan Modra + + * calls.c (load_register_parameters): When shifting reg sized values + to the msb, move the value to a reg first. + +2003-07-29 Geoffrey Keating + + * cppfiles.c (stack_file): Leave filename as "" rather than "". + * line-map.h (linemap_add): Update comments. + * line-map.c (linemap_add): Update comments, interpret zero-length + filename as "". + +2003-07-29 Nathanael Nerode + + * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version. + +2003-07-29 Zack Weinberg + + * c-decl.c (last_function_parm_vars, current_function_parm_vars): + New static variables. + (struct c_scope): Add parms and warned_forward_parm_decls + fields; remove parm_order. + (storedecls, storetags): Delete. + (poplevel): Also clear bindings on the parms chain. + (pushdecl): Handle forward declarations of parameters, and + chain PARM_DECLs on the parms list, not the names list. + (lookup_name_current_level): Check for PARM_DECLs on the parms + list too. + (push_parm_decl): Don't update parm_order. + (clear_parm_order): Rename mark_forward_parm_decls. Issue the + warning, only once per parameter list, and set TREE_ASM_WRITTEN + on the decls here. Then move the forward decls to the names list. + (grokparms): Set last_function_parm_vars. + (get_parm_info): Don't use gettags or getdecls. No need to + extract non-parms from the parms list, or reorganize the parms + list. Feed nonparms back in the TREE_TYPE of the list node + returned. Issue only one error per parameter list for "void" + appearing more than once in said parameter list. Collapse + parmlist_tags_warning into this function to avoid double scan + of tags list. + (start_function): Set current_function_parm_vars. + (store_parm_decls_newstyle): Bypass pushdecl, manipulate scope + directly. Get non-parms from current_function_parm_vars; no + need to extract them from the parms chain. Properly bind tags + in the new scope. + (store_parm_decls_oldstyle): No need to extract non-parameters + from the parms chain, nor to store them back afterward. Move + declaration to top of function, restructure code reordering + DECL_ARGUMENTS. + (store_parm_decls): No need to save and restore warn_shadow. + * c-parse.in: Don't call parmlist_tags_warning nor + clear_parm_order. Call mark_forward_parm_decls when forward + parm decls are encountered. + * c-tree.h: Prototype mark_forward_parm_decls; not + clear_parm_order or parmlist_tags_warning. + +2003-07-29 Geoffrey Keating + + * c-common.c (allow_pch): Remove. + * c-common.h (allow_pch): Remove. + (c_common_no_more_pch): Declare. + * c-lex.c (c_lex): Call c_common_no_more_pch when appropriate. + * c-pch.c: Include hosthooks.h. + (c_common_valid_pch): Don't check allow_pch. + (c_common_read_pch): Clear valid_pch to prevent reading PCH files. + (c_common_no_more_pch): New. + * ggc-common.c: Include hosthooks.h. + (gt_pch_save): Call gt_pch_get_address. + (gt_pch_restore): Call gt_pch_use_address. + * hooks.c (hook_voidp_size_t_null): New. + (hook_bool_voidp_size_t_false): New. + * hooks.h (hook_voidp_size_t_null): New. + (hook_bool_voidp_size_t_false): New. + * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): New. + (HOST_HOOKS_GT_PCH_USE_ADDRESS): New. + (HOST_HOOKS_INITIALIZER): Add HOST_HOOKS_GT_PCH_GET_ADDRESS, + HOST_HOOKS_GT_PCH_USE_ADDRESS. + * hosthooks.h (struct host_hooks): Add gt_pch_get_address, + gt_pch_use_address. + * doc/hostconfig.texi (Host Common): Document + HOST_HOOKS_GT_PCH_GET_ADDRESS, HOST_HOOKS_GT_PCH_USE_ADDRESS. + * Makefile.in (c-pch.o): Depend on hosthooks.h. + (ggc-common.o): Likewise. + + * config/rs6000/host-darwin.c (HOST_HOOKS_GT_PCH_GET_ADDRESS): Define. + (HOST_HOOKS_GT_PCH_USE_ADDRESS): Define. + (pch_address_space): New. + (darwin_rs6000_gt_pch_get_address): New. + (darwin_rs6000_gt_pch_use_address): New. + +2003-07-29 Neil Booth + + PR preprocessor/11569 + PR preprocessor/11649 + * Makefile.in (LIBCPP_DEPS): Add HASHTAB_H. + * cppfiles.c: Completely rewritten. + * c-incpath.c (free_path, remove_duplicates, heads, tails, add_path): + struct cpp_path is now struct cpp_dir. + (remove_duplicates): Don't simplify path names. + * c-opts.c (c_common_parse_file): cpp_read_next_file renamed + cpp_stack_file. + * cpphash.h: Include hashtab.h. + (_cpp_file): Declare. + (struct cpp_buffer): struct include_file is now struct _cpp_file, + and struct cpp_path is now struct cpp_dir. Rename members. + (struct cpp_reader): Similarly. New members once_only_files, + file_hash, file_hash_entries, quote_ignores_source_dir, + no_search_path, saw_pragma_once. Remove all_include_files and + max_include_len. Make some members bool. + (_cpp_mark_only_only): Renamed from _cpp_never_reread. + (_cpp_stack_file): Renamed from _cpp_read_file. + (_cpp_stack_include): Renamed from _cpp_execute_include. + (_cpp_init_files): Renamed from _cpp_init_includes. + (_cpp_cleanup_files): Renamed from _cpp_cleanup_includes. + * cppinit.c (cpp_create_reader): Initialize no_search_path. Update. + (cpp_read_next_file): Rename and move to cppfiles.c. + (cpp_read_main_file): Update. + * cpplib.c (run_directive): Update for renamed members. + (do_include_common, _cpp_pop_buffer): Update. + (do_import): Undeprecate #import. + (do_pragma_once): Undeprecate. Use _cpp_mark_file_once_only. + * cpplib.h: Remove file_name_map_list. + (cpp_options): Remove map_list. + (cpp_dir): Rename from cpp_path. New datatype for name_map. + (cpp_set_include_chains, cpp_stack_file, cpp_included): Update. + +2003-07-29 Phil Edwards + + * Makefile.in: Make stamp-objdir safe for parallel builds. + +2003-07-29 Phil Edwards + + * Makefile.in (stmp-docobjdir): New target; ensure $docobjdir exists. + (info): Depend on stmp-docobjdir. + +2003-07-29 Rainer Orth + + * configure: Regenerate. + +2003-07-29 Jan Hubicka + + PR C++/11131 + * tree-inline.c (expand_call_inline): Always call inlinable_function_p + in !unit-at-a-time mode. + +2003-07-28 Geoffrey Keating + + * c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect + main function. + +2003-07-28 Mark Mitchell + + PR c++/11667 + * c-common.c (shorten_compare): Take into account differences + between C and C++ representation for enumeration types. + * tree.h (set_min_and_max_values_for_integral_type): Declare. + * stor-layout.c (set_min_and_max_values_for_integral_type): New + function, broken out from ... + (fixup_signed_type): ... here and ... + (fixup_unsigned_type): ... here. + +2003-07-28 Zack Weinberg + + * c-decl.c: Update commentary, adjust blank lines throughout. + (struct c_scope): Fix indentation. Reorder members so + outer-context pointers come first, booleans last. + (duplicate_decls, define_label): Use a 'locus' variable for + diagnostic locations in a few more places. + (warn_if_shadowing): Un-split a conditional that fits on one line. + (c_init_decl_processing): No need to clear current_scope and + current_function_scope. + (start_decl): Merge if/else if statements with same action. + (push_parm_decl): Rename old_immediate_size_expand to use + save_foo convention; save/restore around entire function. + (grokdeclarator): Remove unnecessary braces. + +2003-07-28 Hans-Peter Nilsson + Michael Culbertson + + * c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn + when warn_declaration_after_statement. Call pedwarn_c90, not + pedwarn. Correct message: it's "ISO C90", not "ISO C89". + * c-common.c (warn_declaration_after_statement): Define. + * c-common.h (warn_declaration_after_statement): Declare. + * c.opt (Wdeclaration-after-statement): New. + * c-errors.c (pedwarn_c90): New function. + * c-opts.c (c_common_handle_option) : New. + * c-tree.h (pedwarn_c90): Declare. + * doc/invoke.texi (Option Summary): Document + -Wdeclaration-after-statement. + (Warning Options): Ditto. + +2003-07-28 Jan Hubicka + + * i386.md (memory attribute) Avoid accessing uninitialized memory + for ishift1 type instructions. + +2003-07-28 Jakub Jelinek + + * configure.in (--enable-checking): Add fold category. + (ENABLE_FOLD_CHECKING): Define if requested. + * configure: Rebuilt. + * config.in: Rebuilt. + * doc/install.texi: Document it. + * fold-const.c: Include md5.h. + [ENABLE_FOLD_CHECKING] (fold): Define to fold_1. + [ENABLE_FOLD_CHECKING] (fold, fold_checksum_tree, fold_check_failed, + print_fold_checksum): New functions. + + * fold-const.c (fold): Never modify argument passed to fold, instead + change a copy and return it. + * convert.c (convert_to_integer): Likewise. + +2003-07-27 Nathanael Nerode + + * fixinc/fixinc.svr4: Remove dead code. Remove now-unnecessary + cleanup of junk after #else and #endif directives. Collapse repeated + clauses into for statment. + + * fixinc/fixincl.sh: GNU C -> GCC. Add usage comment. + +2003-07-27 Zack Weinberg + + * c-decl.c (struct c_scope): Remove keep_if_subblocks field. + (keep_next_if_subblocks): Rename next_is_function_body. + (pushlevel): Adjust commentary. Always set ->keep on the + outermost level of a function. Don't set ->keep_if_subblocks. + (poplevel): Adjust commentary. Don't look at ->keep_if_subblocks. + (store_parm_decls): Adjust to match. + (finish_function): Adjust to match. + Call poplevel with all three arguments zero. + + * c-decl.c (store_parm_decls_newstyle, store_parm_decls_oldstyle): + New functions split out of store_parm_decls. + Avoid unnecessary work. Use local variables consistently. + (store_parm_decls): Likewise. + + (finish_function): No need to set functionbody flag on call to + poplevel. + (struct language_function): Remove scope field. + (c_push_function_context, c_pop_function_context): No need to + save and restore current_scope. + +2003-07-27 Nathan Sidwell + + * doc/extend.texi (Deprecated Features): Implicit typename is + gone. Default args on types is going. + +2003-07-26 J"orn Rennecke + + * Makefile.in (ifcvt.o): Depend on target.h + * ifcvt.c (target.h): Include. + (if_convert): Don't call mark_loop_exit_edges if we can't + modify jumps. + +2003-07-26 Gerald Pfeifer + + * doc/install.texi (Testing): Adjust required versions of DejaGnu. + +2003-07-26 Richard Henderson + + PR inline-asm/11676 + * cse.c (count_reg_usage): Handle asm_operands properly. + +2003-07-26 Roger Sayle + + * builtins.def (DEF_FALLBACK_BUILTIN): Delete. + (DEF_EXT_FALLBACK_BUILTIN): Delete. + (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Declare using + the regular DEF_EXT_LIB_BUILTIN macro. + (BUILT_IN_FPUTC, BUILT_IN_FPUTS, BUILT_IN_FWRITE): Declare using + the regular DEF_LIB_BUILTIN macro. + (BUILT_IN_PUTCHAR_UNLOCKED, BUILT_IN_PUTS_UNLOCKED, + BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS_UNLOCKED, + BUILT_IN_FWRITE_UNLOCKED): Declare using the regular + DEF_EXT_LIB_BUILTIN macro. + + * c-decl.c (duplicate_decls): Remove code to handle builtin + functions prototyped without an argument list. + +2003-07-26 Danny Smith + + * config/i386/winnt.c: Revert 2003-07-08 change. + (i386_pe_section_type_flags): Remove error_with_decl here too. + +2003-07-26 Gabriel Dos Reis + + * config/arm/pe.c (arm_mark_dllimport): Don't use xxx_with_decl. + * config/mcore/mcore.c (mcore_mark_dllimport): Likewise. + * config/v850/v850.c (v850_handle_data_area_attribute): Likewise. + (v850_handle_data_area_attribute): Likewise. + +2003-07-26 Geoffrey Keating + + * varasm.c (output_constant_def_contents): Use + ASM_DECLARE_CONSTANT_NAME if defined. + * doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME. + * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized + objects get at least one byte to prevent assembler problems. + (ASM_DECLARE_CONSTANT_NAME): New. + + * Makefile.in (libbackend.o): Remove options_.h. + (mostlyclean): Likewise. + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't + insert a label at the end of an function under Mach-O. + + * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test. + +2003-07-25 Aldy Hernandez + + * config/rs6000/rs6000.c (is_ev64_opaque_type): Only check pointer + equality. + (spe_init_builtins): Declare __ev64_opaque__ as a builtin type. + + * config/rs6000/spe.h: Remove __ev64_opaque__ definition. + +2003-07-25 Gabriel Dos Reis + + * doc/passes.texi (Passes): Mention pretty-printing and + diagnostic files. + +2003-07-25 Nathan Sidwell + + * doc/extend.texi (Function Attributes): GNU C++ does now allow + unused parameter decls. + (Attribute Syntax): GNU C++ does not allow label attributes to be + after the ':'. + +2003-07-25 Gabriel Dos Reis + + * objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl. + (objc_declare_class): Likewise. + (error_with_ivar): Likewise. + (start_class): Likewise. + (warn_with_method): Likewise. + +2003-07-25 Gabriel Dos Reis + + Remove pedwarn_with_decl, warning_with_decl and error_with_decl + from GCC. + * calls.c (try_to_integrate): Don't use xxx_with_decl. + (expand_call): Likewise. + * dwarfout.c (output_reg_number): Likewise. + * expr.c (expand_expr): Likewise. + * function.c (assign_temp): Likewise. + (uninitialized_vars_warning): Likewise. + (setjmp_args_warning): Likewise. + (expand_function_end): Likewise. + * stmt.c (fixup_gotos): Likewise. + (warn_about_unused_variables): Likewise. + (expand_end_bindings): Likewise. + * stor-layout.c (layout_decl): Likewise. + (place_field): Likewise. + * toplev.c (check_global_declarations): Likewise. + (rest_of_handle_inlining): Likewise. + (default_tree_printer): New function. + (general_init): Initialize diagnostic machinery before routing + signals to the ICE machinery. Set default tree printer. + * toplev.h (pedwarn_with_decl): Remove declaration. + (warning_with_decl): Likewise. + (error_with_decl): Likewise. + (pedwarn): Remove attribute for the time being. + * tree-inline.c (expand_call_inline): Don't use xxx_with_decl. + * varasm.c (named_section): Likewise. + (make_decl_rtl): Likewise. + (assemble_variable): Likewise. + (merge_weak): Likewise. + (declare_weak): Likewise. + + * diagnostic.h: Move non-diagnostic stuff into pretty-print.h. + * diagnostic.c: Move non-diagnostic stuff into pretty-print.c. + (format_with_decl): Remove. + (diagnostic_for_decl): Likewise. + (pedwarn_with_decl): Likewise. + (warning_with_decl): Likewise. + (error_with_decl): Likewise. + (diagnostic_initialize): Adjust. + (diagnostic_count_diagnostic): Likewise. + (announce_function): Likewise. + (lhd_print_error_function): Likewise. + (diagnostic_report_current_module): Likewise. + (default_diagnostic_starter): Likewise. + (diagnostic_report_diagnostic): Likewise. + (default_diagnostic_finalizer): Likewise. + (verbatim): Likewise. + (error): Likewise. + (warning): Likewise. + * opts.c (common_handle_option): Likewise. + * pretty-print.c: New file. + * c-pretty-print.h (pp_base): Override. + * c-pretty-print.c: Adjust use of macros throughout. + (pp_buffer): New macro. + (pp_newline): Likewise. + * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy. + * Makefile.in (DIAGNOSTIC_H): New variable. + (c-errors.o): Use it. + (c-objc-common.o): Likewise. + (c-common.o): Likewise. + (c-opts.o): Likewise. + (c-format.o): Likewise. + (diagnostic.o): Likewise. + (opts.o): Likewise. + (toplev.o): Likewise. + (rtl-error.o): Likewise. + (dwarf2out.o): Likewise. + (jump.o): Likewise. + (pretty-print.o): New rule. + +2003-07-24 Roger Sayle + + * builtins.def (BUILT_IN_PRINTF, BUILT_IN_FPRINTF): Changed from + front-end builtins to normal builtins, using DEF_LIB_BUILTIN. + (BUILT_IN_PRINTF_UNLOCKED, BUILT_IN_FPRINTF_UNLOCKED): Changed + from front-end to normal builtins, using DEF_EXT_LIB_BUILTIN. + (DEF_FRONT_END_LIB_BUILTIN): Delete. + (DEF_EXT_FRONT_END_LIB_BUILTIN): Delete. + (BUILT_IN_FWRITE_UNLOCKED): Wrap long line. + + * builtins.c (build_string_literal): New function to construct + a char* pointer to a string literal. + (expand_builtin_fputs): Change 2nd argument from "int ignore" to + "rtx target" to be consistent with other expand_builtin_* functions. + Change 3rd argument from "int unlocked" to "bool unlocked". + (expand_builtin_printf): Rewrite of c_expand_builtin_printf from + c-common.c to avoid front-end dependencies. Optimize printf("") + as a no-op when the result isn't required. Handle embedded NULs + in format string. + (expand_builtin_fprintf): A rewrite of c_expand_builtin_fprintf + from c-common.c to avoid front-end dependencies. Likewise, optimize + fprintf(fp,"") as a no-op when the result isn't required, evaluating + fp for side-effects. Handle embedded NULs in format string. + (expand_builtin_sprintf): Fix typo. + (expand_builtin): Don't expand BUILT_IN_FPRINT{,_UNLOCKED} when not + optimizing. Adjust calls of expand_builtin_fputs to match the API + change. Expand BUILT_IN_PRINTF and BUILT_IN_PRINTF_UNLOCKED using + expand_builtin_printf. Likewise, expand BUILT_IN_FPRINTF_UNLOCKED + and BUILT_IN_FPRINTF using expand_builtin_fprintf. + + * c-common.c (is_valid_printf_arglist): Delete. + (c_expand_builtin): Delete. + (c_expand_builtin_printf): Moved to builtins.c. Delete. + (c_expand_builtin_fprintf): Moved to builtins.c. Delete. + (c_expand_expr): No longer treat CALL_EXPRs specially. + (CALLED_AS_BUILT_IN): Delete. + +2003-07-24 Zdenek Dvorak + + PR optimization/11631 + * gcse.c (store_motion): Connect infinite loops to exit. + +2003-07-24 Jason Merrill + + * tree.h (boolean_type_node): Move from C/C++/Java frontends. + (boolean_true_node, boolean_false_node): Likewise. + (enum tree_index): Add TI_BOOLEAN_{TYPE,FALSE,TRUE}. + * tree.c (build_common_tree_nodes): Init boolean_type_node. + (build_common_tree_nodes_2): Init boolean_{true,false}_node. + * stor-layout.c (set_sizetype): Handle an early BOOLEAN_TYPE. + * c-common.h (truthvalue_type_node): Renamed from boolean_type_node. + (truthvalue_true_node): Renamed from boolean_true_node. + (truthvalue_false_node): Renamed from boolean_false_node. + * c-decl.c: Just set truthvalue_* to integer_*. + * c-*.[ch]: s/boolean/truthvalue/. s/c_bool/boolean/. + +2003-07-24 Roger Sayle + + * c-decl.c (match_builtin_function_types): New subroutine of + duplicate_decls to test whether a redeclaration of a builtin + function is suitably close, i.e. the return type and all of + the argument types have the same modes as the builtin expects. + (duplicate_decls): Fuzzy type matching for builtin functions + moved to match_builtin_function_types. + +2003-07-24 Zdenek Dvorak + + * cfgloopmanip.c (duplicate_loop_to_header_edge): Update irreducible + flag correctly. + +2003-07-24 Zack Weinberg + + * c-decl.c: Search-and-replace change 'binding level' to + 'scope' in commentary. + (struct binding_level): Now struct c_scope. + (current_binding_level): Now current_scope. + (free_binding_level): Now scope_freelist. + (current_function_level): Now current_function_scope. + (global_binding_level): Now global_scope. + (make_binding_level): Now make_scope. + (pop_binding_level): Now pop_scope. + +2003-07-24 Rainer Orth + + * configure.in (libgcc_visibility): Add missing whitespace. + +2003-07-24 Richard Henderson + + * libgcc-std.ver (GCC_3.3.1): Export __gcc_personality_sj0, + __gcc_personality_v0. + +2003-07-24 Rainer Orth + + * Makefile.in: Replace pwd by ${PWD_COMMAND}. + +2003-07-24 Nathan Sidwell + + * doc/invoke.texi (-fprofile-arcs, -ftest-coverage): Update + documentation missed from my 2003-07-09 patch. + +2003-07-24 Nathanael Nerode + + * aclocal.m4 (_gcc_COMPUTE_GAS_VERSION): Set patch level to 0 if + it's not provided. + * configure: Rebuild. + +2003-07-24 Steven Bosscher + + PR c/10602 + * c-typeck.c (type_lists_compatible_p): Do not compare + arguments if one of them is an error_mark_node + +2003-07-24 Alan Modra + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Save fp regs inline + if current_function_calls_eh_return. + +2003-07-23 Mark Mitchell + + * doc/c-tree.texi (OFFSET_TYPE): Update description. + +2003-07-23 Bob Wilson + + * config/xtensa/crti.asm (_init, _fini): Increase frame size to 64. + * config/xtensa/lib1funcs.asm (__mulsi3, __udivsi3, __divsi3, + __umodsi3, __modsi3): Increase frame size to 32. + +2003-07-23 Geoffrey Keating + + * config/rs6000/host-darwin.c: ANSIfy, update comment for sigaltstack + prototype. + +2003-07-23 Mark Mitchell + + * doc/c-tree.texi (Types): Update documentation for OFFSET_TYPE. + + PR optimization/10679 + * tree-inline.c (inlinable_function_p): Honor MIN_INLINE_INSNS. + +2003-07-23 John David Anglin + + PR target/11607 and PR target/11516 + * pa.md (extzv, extv, insv): Revert latter half of last patch. + +2003-07-22 Mark Mitchell + + * fold-const.c (force_fit_type): Handle OFFSET_TYPE. + * varasam.c (output_constant): Likewise. + +2003-07-22 Kazu Hirata + + * alias.c: Fix comment formatting. + * c-common.c: Likewise. + * c-decl.c: Likewise. + * c-opts.c: Likewise. + * combine.c: Likewise. + * cpplib.c: Likewise. + * diagnostic.c: Likewise. + * dojump.c: Likewise. + * final.c: Likewise. + * fold-const.c: Likewise. + * gcc.c: Likewise. + * gcse.c: Likewise. + * ggc-page.c: Likewise. + * jump.c: Likewise. + * loop.c: Likewise. + * mips-tfile.c: Likewise. + * recog.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * tree.c: Likewise. + * tree.h: Likewise. + +2003-07-22 Per Bothner + + * line-map.c (add_line_map): Handle invalid LEAVE request. + Fixes PR preprocessor/11361. + +2003-07-22 Per Bothner + + * diagnostic.c.(diagnostic_report_current_module): Update to match + 2003-06-05 changes to push_srcloc and pop_srcloc. + +2003-07-22 Wolfgang Bangerth + + * doc/trouble.texi: Better document two-stage name lookup. + +2003-07-22 Eric Christopher + + * config/s390.c (s390_valid_pointer_mode): New. + (TARGET_VALID_POINTER_MODE): Use. + (s390_emit_prologue): Add tpf profiling hooks. + (s390_emit_epilogue): Ditto. + * config/s390.h (MASK_TPF): New. + (TARGET_TPF): Use. + (POINTERS_EXTEND_UNSIGNED): Define. + * config/s390.md (ptr_extend): New pattern. + +2003-07-22 Zack Weinberg + + * hashtable.c (approx_sqrt): Make static. + * hashtable.h: Don't prototype approx_sqrt. + * line-map.c (init_line_maps): Rename linemap_init. + (free_line_maps): Rename linemap_free. + (add_line_map): Rename linemap_add. + (lookup_line): Rename linemap_lookup. + (print_containing_files): Rename linemap_print_containing_files. + * linemap.h: Update to match. + + * cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to + linemap routines to use new names. + +2003-07-16 Nathan Sidwell + + * c-common.c (handle_packed_attribute): Don't pack a struct via a + typedef. Propagate packedness from a main variant. + +2003-07-22 Nathanael Nerode + + * Makefile.in (install-common): Add dependency on installdirs. + +2003-07-21 Alexandre Oliva + + * c-common.c (c_common_type_for_mode): Return integer types for + pointer modes. + +2003-07-22 Geoffrey Keating + + * c-decl.c (start_decl): Don't call maybe_apply_pragma_weak here. + (finish_decl): Call maybe_apply_pragma_weak here. + (grokdeclarator): Check that DECL_ASSEMBLER_NAME isn't set before + TREE_PUBLIC and TREE_STATIC are decided. + (start_function): Move call to maybe_apply_pragma_weak. Check that + DECL_ASSEMBLER_NAME isn't set too early. + + * cpplex.c (_cpp_process_line_notes): Mention option name in + trigraphs warning. + +2003-07-22 Kazu Hirata + + * combine.c (if_then_else_cond): Simplify the comparison of + rtx against -1, 0, and 1. + * loop.c (check_dbra_loop): Likewise. + * optabs.c (emit_conditional_move): Likewise. + (emit_conditional_add): Likewise. + * config/i386/i386.md (*movsi_or): Likewise. + (*movdi_or_rex6): Likewise. + +2003-07-22 Jan Hubicka + + * cgraphunit.c (cgraph_finalize_compilation_unit): Remove redundant if. + +2003-07-21 Neil Booth + + * cppfiles.c (open_file_pch): Don't put unused entries in the + splay tree. Remove dead code. + +2003-07-21 Geoffrey Keating + + * c-common.h (num_in_fnames): Declare. + (c_static_assembler_name): Move from here... + * c-tree.h (c_static_assembler_name): ... to here. + * c-opts.c: Don't include langhooks-def.h. + (c_static_assembler_name): Move to c-decl.c. + (num_in_fnames): Make externally visible. + * c-decl.c: Include langhooks-def.h. + (c_static_assembler_name): Move from c-opts.c. + * Makefile.in (c-decl.o): Add $(LANGHOOKS_DEF_H). + (c-opts.o): Remove $(LANGHOOKS_DEF_H). + + * c-pragma.c (maybe_apply_pragma_weak): Don't get DECL_ASSEMBLER_NAME + when it's not needed. + +2003-07-21 Jakub Jelinek + + * config/rs6000/rs6000.h (machine_function): Add ra_need_lr. + * config/rs6000/rs6000.c (rs6000_return_addr): Set it. + (rs6000_emit_prologue): Save FPRs inline if set. + +2003-07-21 H.J. Lu + + * config/ia64/ia64.md (prefetch): Support predicate. + +2003-07-21 Josef Zlomek + + * cfgcleanup.c (merge_blocks_move_successor_nojumps): Use tablejump_p. + * rtlanal.c (tablejump_p): Use next_active_insn for finding the jump + table. + +2003-07-17 Eric Botcazou + + PR optimization/11536 + * unroll.c (loop_iterations): Do not replace a register holding + the final value by its equivalent before the loop if it is not + invariant. + +2003-07-21 Dave Fluri + + * doc/extend.texi: Fixes to spelling, grammar, and diction. + +2003-07-21 Ben Elliston + + * doc/invoke.texi (Optimize Options): Replace "it's" with "its". + (V850 Options): Spelling fixes. + +2003-07-20 Lisa M. Goldstein + + * doc/invoke.texi: Fixes to style, grammar and diction. + +2003-07-20 Roger Sayle + + * builtins.def (BUILT_IN_ALLOCA): Remove "#if SMALL_STACK" form. + * system.h (SMALL_STACK): Poison obsolete target macro. + * doc/tm.texi (SMALL_STACK): Remove target macro documentation. + +2003-07-20 Phil Edwards + + * configure.in: Cache the results of testing for cmp's capabilities. + * configure: Regenerate. + +2003-07-20 Mark Mitchell + + PR debug/11279 + * dwarf2out.c (gen_enumeration_type_die): Remember that + enumerators can be unsigned. + +2003-07-19 Zack Weinberg + + * c-decl.c (named_labels, shadowed_labels, label_level_chain) + (push_label_level, pop_label_level): Kill. + (struct binding_level): Rename level_chain to outer. + Add outer_function field. Change parm_flag, function_body, + keep, keep_if_subblocks to 1-bit bitfields of type bool. + (current_function_level): New variable. + (keep_next_level_flag, keep_next_if_subblocks): Change type to bool. + (keep_next_level, declare_parm_level, warn_if_shadowing): + Update to match. + (struct language_function): Kill named_labels, shadowed_labels fields. + (c_init_decl_processing, start_function, c_push__function_context) + (c_pop_function_context): No need to muck with named_labels nor + shadowed_labels. + + (make_binding_level): No need to clear the structure here. + (pop_binding_level): Always operate on current_binding_level. + Update current_function_level if necessary. + (pushlevel): Don't clear named_labels. Update current_function_level + if necessary. Use "true" and "false" where appropriate. + (poplevel): Diagnose labels defined but not used, or vice + versa, and clear out label-meanings leaving scope, while + walking down the decls list, for all binding levels. + Handle LABEL_DECLs appearing in the shadowed list. + pop_binding_level takes no arguments. + (pushdecl_function_level): Use current_function_level. + + (make_label, bind_label): New static functions. + (declare_label): New exported function. + (lookup_label, define_label): Rewritten for new data structure. + (shadow_label): Kill. + + * c-tree.h: Prototype declare_label; don't prototype + push_label_level, pop_label_level, nor shadow_label. + * c-parse.in: Remove all calls to push_label_level and + pop_label_level. Use declare_label for __label__ decls. + + * doc/extend.texi: Clarify that __label__ can be used to + declare labels with local scope in any nested block, not + just statement expressions. Cross-reference nested functions + section from local labels section. + +2003-07-19 Zdenek Dvorak + + * sched-rgn.c (find_rgns): Initialize current_edge correctly. + +2003-07-19 Phil Edwards + + * doc/makefile.texi (restrap, profiledbootstrap): Document targets. + +2003-07-19 Kaveh R. Ghazi + + * fixinc/fixfixes.c fixinc/fixincl.c fixinc/fixlib.c + fixinc/server.c objc/objc-act.c: Remove unnecessary casts. + +2003-07-19 Ulrich Weigand + + * config/s390/s390.c (legitimize_pic_address): Access local symbols + relative to the GOT instead of relative to the literal pool base. + (s390_output_symbolic_const): Handle new GOT-relative accesses. + * config/s390/s390.md ("call"): Access local functions and PLT stubs + relative to the GOT instead of relative to the literal pool base. + ("call_value"): Likewise. + ("call_value_tls"): Likewise. + + * config/s390/s390.c (s390_chunkify_start): Remove pool anchor + reloading. Support LTREL_BASE / LTREL_OFFSET construct. + (s390_chunkify_finish): Likewise. + (s390_chunkify_cancel): Likewise. + (s390_reorg): Adapt caller. + (find_base_register_in_addr, + find_base_register_ref, replace_base_register_ref): Delete. + (find_ltrel_base, replace_ltrel_base): New functions. + (find_constant_pool_ref): Handle LTREL_BASE unspecs. + (s390_decompose_address): Handle LTREL_BASE unspecs. Optimize + base vs. index register usage. + (struct constant_pool): Remove 'anchor'. + (s390_add_anchor): Delete. + (s390_dump_pool): Remove anchor handling. + * config/s390/s390.md ("reload_anchor"): Remove. + + * config/s390/s390.c (s390_split_branches): Use LTREL_BASE/OFFSET. + (s390_load_got): New function. Use LTREL_BASE/OFFSET. + (s390_emit_prologue): Use it. + * config/s390/s390.md ("builtin_longjmp", "builtin_setjmp_setup", + "builtin_setjmp_receiver"): Cleanup. Use s390_load_got. Do not + hard-code register 14. + * config/s390/s390-protos.h (s390_load_got): Declare. + + * config/s390/s390.c (NR_C_MODES, constant_modes, gen_consttable): + Support TImode constants. + * config/s390/s390.md ("consttable_ti"): New. + ("consttable_si", "consttable_di"): Handle TLS symbols correctly. + + * config/s390/s390.md (UNSPEC_LTREL_OFFSET, UNSPEC_LTREL_BASE, + UNSPEC_GOTENT, UNSPEC_GOT, UNSPEC_GOTOFF, UNSPEC_PLT, UNSPEC_PLTOFF, + UNSPEC_RELOAD_BASE, UNSPECV_POOL, UNSPECV_POOL_START, UNSPECV_POOL_END, + UNSPECV_POOL_QI, UNSPECV_POOL_HI, UNSPECV_POOL_SI, UNSPECV_POOL_DI, + UNSPECV_POOL_TI, UNSPECV_POOL_SF, UNSPECV_POOL_DF, UNSPECV_MAIN_POOL): + New symbolic constants. + ("consttable_qi", "consttable_hi", "consttable_si", "consttable_di", + "consttable_sf", "consttable_df", "pool_start_31", "pool_end_31", + "pool_start_64", "pool_end_64", "reload_base_31", "reload_base_64", + "pool", "literal_pool_31", "literal_pool_64"): Cleanup. Use + symbolic UNSPEC values. + * config/s390/s390.c (larl_operand, s390_short_displacement, + bras_sym_operand, s390_cannot_force_const_mem, + s390_delegitimize_address, s390_decompose_address, + legitimize_pic_address, s390_output_symbolic_const, + s390_function_profiler): Use symbolic UNSPEC values. + +2003-07-19 Kaveh R. Ghazi + + * alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c + c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in + c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c + collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c + cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c + cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c + dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c + fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c + gcse.c genattr.c genattrtab.c genautomata.c genconditions.c + genemit.c genextract.c genoutput.c genrecog.c gensupport.c + ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c + integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c + loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c + postreload.c prefix.c print-tree.c protoize.c ra-build.c + ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c + regmove.c regrename.c reload.c reload1.c reorg.c resource.c + sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c + simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c + tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c + varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary + casts. + +2003-07-19 Gabriel Dos Reis + + * c-pragma.c (apply_pragma_weak): Don't use warning_with_decl. + * toplev.h (warning): Remove attribute. + +2003-07-19 Gabriel Dos Reis + + * c-decl.c (c_finish_incomplete_decl): Don't use xxx_with_decl. + (pop_label_level): Likewise. + (duplicate_decls): Likewise. + (implicitly_declare): Likewise. + (shadow_label): Likewise. + (start_decl): Likewise. + (finish_decl): Likewise. + (grokdeclarator): Likewise. + (get_parm_info): Likewise. + (detect_field_duplicates): Likewise. + (finish_struct): Likewise. + (start_function): Likewise. + (store_parm_decls): Likewise. + (finish_function): Likewise. + (c_expand_body_1): Likewise. + (check_for_loop_decls): Likewise. + (merge_translation_unit_decls): Likewise. + +2003-07-19 Neil Booth + + * common.opt: Document --param. + * opts.c (columns, undocumented_msg): New. + (print_help): Get number of columns from environment. Print + --param help. Tweak newline handling. + (print_param_help): New. + (print_filtered_help): Better handling of duplicates. Complain + about undocumented switches. + (print_switch): New. + (wrap_help): Improve wrapping, use COLUMNS. + * opts.sh: Ignore comments in records. + * params.def: Fix typos and remove trailing periods. + * toplev.c (display_help): Don't dump --param help. + * doc/sourcebuild.texi: Update. + +2003-07-18 Richard Henderson + + PR target/11556 + * optabs.c (prepare_operand): Fail gracefully instead of abort + if the predicate doesn't satisfy. + (gen_cond_trap): Allow prepare_operand to fail. + +2003-07-19 Gabriel Dos Reis + + * c-common.c: Don't undefine GCC_DIAG_STYLE. + (fname_decl): Don't use xxx_with_decl. + (c_add_case_label): Likewise. + (handle_section_attribute): Likewise. + (handle_alias_attribute): Likewise. + (handle_no_instrument_function_attribute): Likewise. + (handle_no_limit_stack_attribute): Likewise. + * c-objc-common.c (c_tree_printer): Print IDENTIFIER_NODEs. + * c-format.c (gcc_cdiag_char_table): Add '%E' format-specifier. + +2003-07-19 Zdenek Dvorak + + * Makefile.in (ifcvt.o): Add cfgloop.h. + * basic-block.h (EDGE_LOOP_EXIT): New flag. + * cfgrtl.c (rtl_verify_flow_info_1): Handle it correctly. + * ifcvt.c: Include cfgloop.h. + (mark_loop_exit_edges): New static function. + (if_convert): Call it. + (find_if_header): Ignore branches out of loops. + +2003-07-18 Kazu Hirata + + * combine.c (simplify_comparison): Don't share rtx when converting + (ne (and (not X) 1) 0) to (eq (and X 1) 0). + +2003-07-18 David Edelsohn + + * config/rs6000/aix.h (AGGREGATE_PADDING_FIXED): Define. + (AGGREGATES_PAD_UPWARD_ALWAYS): Define. + (MUST_PASS_IN_STACK): Define. + (BLOCK_REG_PADDING): Define. + +2003-07-18 Richard Henderson + + * cfgrtl.c (force_nonfallthru_and_redirect): Use tablejump_p + to skip the addr_vec. + +2003-07-18 Alexandre Oliva + + * combine.c (combinable_i3pat): Don't forbid occurrences of + i2dest or i1dest in inner_dest if inner_dest is a mem. + +2003-07-18 Jan Hubicka + + * cgraph.c (cgraph_remove_node): Clear the hash table slot. + +2003-07-17 Jakub Jelinek + + PR target/11087 + * loop.c (basic_induction_var): Check if convert_modes emitted any + instructions. Remove them and return 0 if so. + +2003-07-18 Eric Botcazou + + PR optimization/11083 + * toplev.c (rest_of_handle_addresof): Rename into + rest_of_handle_addressof. Delete unreachable blocks + if dead edges were purged after the addressof pass. + +2003-07-18 Neil Booth + + * Makefile.in, configure, configure.in: Remove handling of + lang-options.h and options_.h. + * toplev.c (struct lang_opt, documented_lang_options): Remove. + (display_help): Don't use documented_lang_options. + +2003-07-17 Zack Weinberg + + * c-decl.c (pushdecl_function_level): Make static, return nothing. + (kept_level_p): Fold into poplevel. + (undeclared_variable): Moved here from c-typeck.c. Export. + * c-tree.h (KEEP_YES, KEEP_NO, KEEP_MAYBE): New #defines. + (undeclared_variable): Prototype here. Don't prototype + kept_level_p nor pushdecl_function_level. + * c-parse.in: Change first argument to poplevel from + "kept_level_p()" to "KEEP_MAYBE". + * c-typeck.c (undeclared_variable): Moved to c-decl.c. + +2003-07-17 Roger Sayle + + * simplify-rtx.c (simplify_rtx): Use simplify_gen_binary to swap + commutative operands instead of modifying the RTL in-place. + +2003-07-17 Mark Mitchell + + PR optimization/11557 + * calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK + unless we know which function is being called. + +2003-07-17 Roger Sayle + + * cse.c (fold_rtx): Use swap_commutative_operands_p to determine + whether to reorder the operands of a commutative binary operator. + +2003-07-17 Roger Sayle + + * fold-const.c (const_binop): Avoid performing the FP operation at + compile-time, if either operand is NaN and we honor signaling NaNs, + or if we're dividing by zero and either flag_trapping_math is set + or the desired mode doesn't support infinities. + (fold_initializer): New function to fold an expression ignoring any + potential run-time exceptions or traps. + * tree.h (fold_initializer): Prototype here. + * c-typeck.c (build_binary_op): Move to the end of the file so + that intializer_stack is in scope. If constructing an initializer, + i.e. when initializer_stack is not NULL, use fold_initializer to + fold expressions. + * simplify-rtx.c (simplify_binary_operation): Likewise, avoid + performing FP operations at compile-time, if they would raise an + exception at run-time. + +2003-07-17 Geoffrey Keating + + PR 11498 + * Makefile.in (c-opts.o): Add $(LANGHOOKS_DEF_H). + (langhooks.o): Add $(GGC_H), gt-langhooks.h. + (GTFILES): Add langhooks.c. + (gt-langhooks.h): New. + * c-common.h (c_static_assembler_name): Prototype. + * c-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define. + * objc/objc-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define. + * c-opts.c: Include langhooks-def.h. + (c_static_assembler_name): New. + * langhooks.c: Include ggc.h. Include gt-langhooks.h. + (var_labelno): New. + (lhd_set_decl_assembler_name): Give static objects with context + unique names. + * varasm.c (var_labelno): Delete. + (make_decl_rtl): Don't change the assembler name once it's set. + + * c-opts.c (this_input_filename): New. + (finish_options): Take new parameter, name of file being compiled. + Update callers. Set this_input_filename. + (push_command_line_include): Use this_input_filename not + main_input_filename. + +2003-07-17 Neil Booth + + * Makefile.in: Depend .pot generation on options.c. + * po/exgettext: Add an extra_files variable containing additional + files to scan. + +2003-07-17 Zack Weinberg + + * objc/objc-lang.c: Override LANG_HOOKS_WRITE_GLOBALS to + c_write_global_declarations. + + * c-decl.c: Fix typos in several comments. Remove all + #if 0 blocks; reindent as needed. Remove unused argument + to declare_parm_level; all callers changed. + * c-parse.in: Update calls to declare_parm_level. Avoid + issuing a double warning in some circumstances. + * c-typeck.c: Update calls to declare_parm_level. + * c-tree.h: Update prototype of declare_parm_level. + + * c-pragma.c (apply_pragma_weak): Don't complain about a + redundant #pragma weak. + + * objc/objc-act.c (forward_declare_categories, + build_selector_reference_decl, build_class_reference_decl, + build_objc_string_decl, synth_forward_declarations, + build_protocol_reference): Set TREE_PUBLIC on synthetic + forward decl to 0, consistent with eventual definition. + Correct comments to match. + + * fixinc/inclhack.def (solaris_mutex_init_2): Escape braces + in regexp that don't form a range expression. + * fixinc/fixincl.def: Regenerate. + +2003-07-17 Richard Henderson + + PR target/10907 + * config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end + even with !TARGET_CONST_GP. + (ia64_function_ok_for_sibcall): Reject non-local functions. + +2003-07-17 Steven Bosscher + + * c-common.c (c_estimate_num_insns_1): Don't handle + METHOD_CALL_EXPR. + * expr.c (safe_from_p): Likewise. + * gengtype.c (adjust_field_tree_exp): Likewise. + * stmt.c (warn_if_unused_value): Likewise + * tree.c (first_rtl_op): Likewise. + * tree.def: Don't define METHOD_CALL_EXPR. + * java/lang.c (java_estimate_num_insns_1): Don't handle + METHOD_CALL_EXPR. + +2003-07-17 Eric Botcazou + + PR other/11466 + * doc/invoke.texi (SPARC Options): Document "-mlittle-endian" + and its restrictions for the SPARC64 port. + Move the entry of "-mimpure-text" before that of "-mv8". + +2003-07-17 Eric Botcazou + Phil Edwards + + * doc/install.texi (*-*-solaris2*): Document the step-by-step + procedure to bootstrap and install. + Document the preference for the legacy Sun tools in /usr/bin + over the POSIX tools in /usr/xpg4/bin for the build process. + +2003-07-17 Neil Booth + + * c.opt: Document Uncodumented; use it. Document ObjC options. + * opts.c (print_filtered_help): Skip undocumented switches. + * opts.h (CL_UNDOCUMENTED): New. + * opts.sh: Handle Undocumented. + * toplev.c (documented_lang_options): Prevent its becoming empty. +objc: + * lang-options.h: Remove. + +2003-07-16 Ulrich Weigand + + * loop.c (check_ext_dependent_givs): Pass const struct loop * + instead of struct loop_info * as argument. Accept BIVs with + increment +/- 1 provided there is a friendly exit test against + a loop-invariant value. + (strength_reduce): Adapt call to check_ext_dependent_givs. + +2003-07-16 J"orn Rennecke + Con Bradley + + * sh-protos.h (sh_get_pr_initial_val): Declare. + * sh.c (regno_reg_class): Make its elements type enum reg_class. + (output_stack_adjust): Remove emit_fn argument. Add epilogue_p + and live_regs_mask arguments. Changed all callers. + (save_schedule_s): New structure. + (save_schedule): New typedef. + (scavenge_reg, sh5_schedule_saves, sh5_schedule_saves): New functions. + (calc_live_regs): For TARGET_SHMEDIA, use leaf_function_p. + In interrupts handlers, also save registers that are usually + partially saved, and make sure there is at least one general purpose + register saved if a target register needs saving. + Add casts in comparisons to avoid warnings. + (sh_media_register_for_return): return -1 for interrupt handlers. + (MAX_SAVED_REGS, MAX_TEMPS): New defines. + (sh_expand_prologue): Use sh5_schedule_saves. Check that any temp + registers used are available. + Set RTX_FRAME_RELATED_P where appropriate. + Add an REG_FRAME_RELATED_EXPR for r0 + offset addressing. + (sh_expand_epilogue, sh_set_return_address): Use sh5_schedule_saves. + (initial_elimination_offset): Likewise. + * sh.h (DWARF_CIE_DATA_ALIGNMENT): Set to -4. + (LOCAL_ALIGNMENT, GENERAL_REGISTER_P): Add casts to avoid warnings. + (FP_REGISTER_P): Add casts to fix broken handling of unsigned REGNO. + (XD_REGISTER_P, TARGET_REGISTER_P): Likewise. + (HARD_REGNO_CALL_PART_CLOBBERED): Also yield nonzero for r15, + and for target registers. + (RETURN_IN_MEMORY): Add parentheses to avoid warnings. + (regno_reg_class): Make its elements type enum reg_class. + (CONSTRAINT_LEN): Don't use isdigit. + (FUNCTION_ARG_REGNO_P): Add casts to avoid warnings. + (FUNCTION_ARG): Add parentheses to avoid warnings. + (RETURN_ADDR_RTX): Use sh_get_pr_initial_val. + (RETURN_ADDR_OFFSET): Define to -1 for TARGET_SH5. + (SH_DBX_REGISTER_NUMBER): Add casts to avoid warnings. + (EH_RETURN_DATA_REGNO): Use unsigned constants to avoid warnings. + * sh.md (xordi3+1): Remove unused variable regno. + (return_media): Check that tr0 is available before using it. + +2003-07-16 Neil Booth + + * c.opt: Document more options. + +2003-07-16 Roger Sayle + + * combine.c (subst): Also handle (subreg (const_double ...)) case + if created by a substitution, by using the original inner mode. + +2003-07-16 Roger Sayle + + * simplify-rtx.c (simplify_replace_rtx): Convert constant comparisons + to MODE_FLOAT constants if FLOAT_STORE_FLAG_VALUE is defined. + (simplify_rtx): Likewise. Simplify (lo_sum (high X) X) as X. + +2003-07-16 Andrew Pinski + + * doc/install.texi (--without-headers): New. + + Partial Fix PR/10129 + * config/darwin.c (machopic_function_base_name): Only Return "". + (machopic_output_function_base_name): New; print the true pic label. + (machopic_classify_ident): Pic Base is always a defined data. + * config/darwin.h (ASM_OUTPUT_LABELREF): Support the pic base label. + * config/darwin-proto.h (machopic_output_function_base_name): Prototype. + + * gcse.c (gcse_constant_p): COMPARE of the same registers is a constant + if they are not floating point registers. + + PR c/10962 + * ggc.h: Add header guards. + * c-decl.c (finish_struct): Sort fields if + number greater than 15 and there are no + anonymous structs/unions. + * c-common.h: Include ggc.h. + (sorted_fields_type): New struct. + (field_decl_cmp): New prototype. + (resort_sorted_fields): New prototype. + (DECL_DECLARES_TYPE_NON_TEMPLATE_P): New macro. + * c-tree.h: (lang_type): Use pointer to sorted_fields_type + as s, removing other fields. + * c-typeck.c (lookup_field): Use s in lang_type. + These were mostly moved from cp/class.c: + * c-common.c (field_decl_cmp): New static function. + (field_decl_cmp): New function. + (resort_sorted_fields): New function. + +2003-07-16 Geoffrey Keating + + * config/darwin.c (machopic_select_section): Use decl_readonly_section + to do most of the work. + +2003-07-16 Hans-Peter Nilsson + + * config/mmix/mmix-protos.h: Convert prototypes to ISO C90. + * config/mmix/mmix.c: Convert functions to ISO C90. + (mmix_eh_return_handler_rtx, mmix_output_shifted_value): Tweak + formatting. + (mmix_get_hard_reg_initial_val): Tweak section head comment. + +2003-07-16 J"orn Rennecke + + * c-pragma.h (HANDLE_PRAGMA_WEAK): Always define to SUPPORTS_WEAK. + +2003-07-16 Jakub Jelinek + + * unwind-dw2.c (MD_FROB_UPDATE_CONTEXT): Define. + (uw_update_context_1): Use it. + * config/rs6000/rs6000.c (insn_after_throw): Remove. + (rs6000_aix_emit_builtin_unwind_init): Save $r2 to its location + in parent frame if _Unwind_* called directly instead of through + .plt. + (rs6000_emit_eh_toc_restore): Remove. + (rs6000_emit_prologue): Update stack pointer before doing any saving + if current_function_calls_eh_return. Generate unwind info for $r2. + (rs6000_emit_epilogue): Restore stack pointer after doing all + restoring if current_function_calls_eh_return. Restore $r2. + * config/rs6000/rs6000-protos.h (rs6000_emit_eh_toc_restore): Remove. + * config/rs6000/rs6000.md (eh_return): Remove call to + rs6000_emit_eh_toc_restore. + * config/rs6000/linux64.h (MD_FROB_UPDATE_CONTEXT): Define. + * config/rs6000/aix.h (MD_FROB_UPDATE_CONTEXT): Define. + +2003-07-15 Jakub Jelinek + + * expr.c (emit_block_move): Don't move anything if size is const 0. + (clear_storage): Test against const0_rtx instead of comparing INTVAL + against 0. + +2003-07-15 David S. Miller + + * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only + emit nop if the last real insn is CALL_INSN. + +2003-07-16 Danny Smith + + * config/i386/xm-mingw32.h (HOST_BIT_BUCKET): Define + as "nul". + * config/i386/xm-mingw32.h: Change GNU CC to GCC. + +2003-07-16 Danny Smith + + * config/i386/winnt.c (associated_type): Artificial methods are not + affected by the import/export status of their class unless they are + COMDAT. + (i386_pe_dllimport_p): Do not mark artificial methods as dllimport. + + * config/i386/winnt.c: Fix GCC copyright comment. + +2003-07-16 Gabriel Dos Reis + + PR c++/11531 + * diagnostic.c (diagnostic_report_diagnostic): Don't ICE if we're + not recursing on hard error. + (diagnostic_for_decl): Likewise. + * diagnostic.def: Rearrange. + +2003-07-15 J"orn Rennecke + + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): + If DWARF_FRAME_RETURN_COLUMN doesn't have a register mode, use Pmode. + +2003-07-15 J"orn Rennecke + Richard Henderson + + * unwind-dw2.c (_Unwind_GetGR): Use dwarf_reg_size_table + to decide if to access a _Unwind_Ptr or a _Unwind_Word. + (_Unwind_SetGR): Likewise. + (_Unwind_GetPtr, _Unwind_SetSpColumn): New functions. + (Unwind_SpTmp): New typedef. + (uw_update_context_1): Use _Unwind_SetSpColumn and _Unwind_GetPtr. + (uw_update_context): Use _Unwind_GetPtr. + (init_dwarf_reg_size_table): Move above uw_init_context_1. + (uw_init_context_1): Initialize dwarf_reg_size_table if necessary. + Use _Unwind_SetSpColumn. + (uw_install_context_1): Don't initialize dwarf_reg_size_table. + Use _Unwind_GetPtr. + +2003-07-15 Neil Booth + + * c.opt: Document more options. + * toplev.c (documented_lang_options): Remove all local help strings. + +2003-07-15 Mark Mitchell + + PR debug/11473 + * dbxout.c (dbxout_type): Use TYPE_SIZE to determine the sizes of + base classes. + +2003-07-15 Kazu Hirata + + PR target/10795 + * config/i386/i386.c (ix86_expand_carry_flag_compare): Don't + swap comparison operands if doing so would generate an + unrecognizable insn. + +2003-07-15 Eric Botcazou + + PR optimization/11320 + * sched-int.h (struct deps) [reg_conditional_sets]: New field. + (struct sched_info) [compute_jump_reg_dependencies]: New prototype. + * sched-deps.c (sched_analyze_insn) [JUMP_INSN]: Update call to + current_sched_info->compute_jump_reg_dependencies. Record which + registers are used and which registers are set by the jump. + Clear deps->reg_conditional_sets after a barrier. + Set deps->reg_conditional_sets if the insn is a COND_EXEC. + Clear deps->reg_conditional_sets if the insn is not a COND_EXEC. + (init_deps): Initialize reg_conditional_sets. + (free_deps): Clear reg_conditional_sets. + * sched-ebb.c (compute_jump_reg_dependencies): New prototype. + Mark registers live on entry of the fallthrough block and conditionally + set as set by the jump. Mark registers live on entry of non-fallthrough + blocks as used by the jump. + * sched-rgn.c (compute_jump_reg_dependencies): New prototype. + Mark new parameters as unused. + +2003-07-15 Richard Sandiford + + * doc/invoke.texi: Resync MIPS -march documentation. + +2003-07-15 Richard Sandiford + + * config/mips/mips.h (PROCESSOR_R9000): New processor_type. + (TARGET_MIPS9000, TUNE_MIPS9000): New macros. + (GENERATE_MULT3_SI): True for TARGET_MIPS9000. + * config/mips/mips.c (mips_cpu_info_table): Add rm9000 entry. + (mips_rtx_costs): Adjust integer multiplication costs for the rm9000. + (mips_issue_rate): Handle PROCESSOR_R9000. + (mips_use_dfa_pipeline_interface): Likewise. + * config/mips/9000.md: New file. + * config/mips/mips.md: Include it. + (define_attr cpu): Add r9000. + (mulsi3_mult3): Use "mul" for rm9000 code. + +2003-07-15 Stan Cox + + * config/mips/mips.h (PROCESSOR_R7000): New processor_type. + (TARGET_MIPS7000, TUNE_MIPS7000): New macros. + (GENERATE_MULT3_SI): True for TARGET_MIPS7000. + * config/mips/mips.c (mips_cpu_info_table): Add rm7000 entry. + (mips_rtx_costs): Adjust integer multiplication costs for the rm7000. + (mips_issue_rate): Handle PROCESSOR_R7000. + (mips_use_dfa_pipeline_interface): Likewise. + * config/mips/7000.md: New file. + * config/mips/mips.md: Include it. + (define_attr cpu): Add r7000. + (mulsi3_mult3): Use "mul" for rm7000 code. + +2003-07-15 Richard Sandiford + + * config/mips/mips.md (define_attr type): Add condmove. Use it for + the conditional move patterns. + * config/mips/5400.md (ir_vr54_move): Rename to ir_vr54_condmove. + Check for condmove type. + (ir_vr54_arith): Add move type. + * config/mips/5500.md (ir_vr55_move, ir_vr55_arith): Likewise. + * config/mips/sr71k.md (ir_sr70_move, ir_sr70_arith): Likewise. + +2003-07-15 Neil Booth + + * c-opts.c (print_help): Remove. + (c_common_handle_option): Don't handle --help. + * c.opt: Document some options. + (--help): Remove. + * opts.c (print_filtered_help): New. + (print_help): Use it. + +2003-07-14 Geoffrey Keating + + * c-common.c (c_common_type_for_mode): Handle V4DFmode. + * tree.c: (build_common_tree_nodes_2): Likewise. + * tree.h (enum tree_index): Add TI_V4DF_TYPE. + (V4DF_type_node): New. + + * c-opts.c (push_command_line_include): Don't free deferred_opts, + we'll need it. + (finish_options): Reset init_cursor. + +2003-07-15 Kazu Hirata + + * expr.c (expand_assignment): Remove an unused argument + SUGGEST_REG. + * expr.h: Update the prototype. + * function.c: Update the callers. + * stmt.c: Likewise. + +2003-07-14 Mark Mitchell + + PR debug/11098 + * integrate.c (copy_decl_for_inlining): Do not mark copied decls + as DECL_ABSTRACT. + +2003-07-14 Nathanael Nerode + + * fixinc/inclhack.def (avoid_bool_define, avoid_bool_type): Bypass + with __cplusplus, not "we must use the C++ compiler's type" + * fixinc/inclhack.def (void_null): Note that Interix needs this. + * fixinc/fixincl.x: Regenerate. + +2003-07-14 Geoffrey Keating + + * unwind-dw2-fde-darwin.c (live_image_destructor): Get seen_objects + and unseen_objects from the global data before calling + __deregister_frame_info_bases. + (examine_objects): Insert objects into the seen_objects list, + not unseen_objects. + (_Unwind_Find_FDE): Always unlock the global object lists, even if + we couldn't allocate a data structure to put in it. + + * objc/objc-act.h (CLASS_SUPER_NAME): Add a little typechecking. + (TYPE_PROTOCOL_LIST): Share use of type.context with C frontend. + (SET_TYPE_PROTOCOL_LIST): New. + * objc/objc-act.c (get_static_reference): Use SET_TYPE_PROTOCOL_LIST. + (get_object_reference): Likewise. + +2003-07-14 Jan Hubicka + + * cfglayout.c (locator_file): Break out from .... + (insn_file): ... here. + (locator_line): Break out from .... + (insn_line): ... here. + * rtl.h (locator_file, locator_line): Declare. + (final_start_function): Set proper line/file info. + +2003-07-14 Gabriel Dos Reis + + * c-pretty-print.c (pp_c_unary_expression): A CONVERT_EXPR is + handled by pp_c_cast_expression. + +2003-07-14 Richard Sandiford + + * config/mips/mips.c (mips_expand_prologue): Use a single insn to + allocate 32768 bytes of stack. Use addition rather than subtraction + when a single insn is enough. + * config/mips/mips.md: Remove insns and splitters for subtracting + constants. + (subsi3): Only accept register operands. + (subsi3_internal): Likewise. Use for TARGET_MIPS16 as well. + (subdi3_internal_3, subsi3_internal_2): Likewise. + (casesi): Use expand_binop to subtract the lower bound. + +2003-07-14 Richard Sandiford + + * config/mips/mips.c (mips_in_small_data_p): Don't handle + TARGET_MIPS16 specially. + +2003-07-14 Richard Sandiford + + * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Use + mips_output_aligned_bss. + * config/mips/linux.h: Likewise. + * config/mips/mips-protos.h (mips_output_aligned_bss): Declare. + * config/mips/mips.c (mips_output_aligned_bss): New function. + + * config/mips/elf.h (DBX_DEBUGGING_INFO): Delete. + * config/mips/elf64.h: Likewise. + + * config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use + mips_declare_object_name. + (ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object. + * config/mips/elf64.h: As for elf.h. + * config/mips/iris6.h: Likewise. + * config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h. + * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary + do...while (0) block. + * config/mips/mips-protos.h (mips_declare_object_name): Declare. + (mips_finish_declare_object): Declare. + * config/mips/mips.c (mips_declare_object_name): New function. + (mips_finish_declare_object): New function. + + * config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete. + * config/mips/linux.h: Likewise. + + * config/mips/mips.c (inside_function): Delete. + (file_in_function_warning, ignore_line_number): Delete. + (mips_output_filename): Don't warn about changing filenames within + a function. + (mips_output_lineno): Update accordingly. + (mips_output_function_prologue): Don't reset the deleted variables. + * config/mips/mips.h (inside_function): Delete. + (file_in_function_warning, ignore_line_number): Delete. + + * config/mips/elf.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Remove undefs. + * config/mips/elf64.h: Likewise. + * config/mips/openbsd.h: Likewise. + * config/mips/iris5.h (OBJECT_FORMAT_COFF): Remove undefs. + * config/mips/linux.h: Likewise. + * config/mips/mips.h (OBJECT_FORMAT_COFF, EXTENDED_COFF): Delete. + (CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB, MIPS_UNMARK_STAB): Delete. + + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Add mips/sdb.h + to the list of include files when using gas. + (mips*el-*-openbsd*, mips*-*-openbsd*): Add mips/sdb.h unconditionally. + * config/mips/elf.h: Remove #undef SDB_DEBUGGING_INFO. + * config/mips/elf64.h: Likewise. + * config/mips/iris5.h: Likewise. + * config/mips/linux.h: Likewise. + * config/mips/iris5gas.h (SDB_DEBUGGING_INFO): Remove definition. + * config/mips/mips.h (PREFERRED_DEBUGGING_TYPE): Likewise. + (SDB_DEBUGGING_INFO, sdb*, SDB_ALLOW_*, PUT_SDB*): Move to... + * config/mips/sdb.h: ...this new file. + +2003-07-14 Douglas Rupp + + * fixinc/server.c (server_setup): Don't use non-POSIX NULL first + argument to getcwd; use fixed buffer instead. + +2003-07-14 Nathanael Nerode + + * fixinc/mkfixinc.sh: Treat OpenBSD normally. + * fixinc/fixinc.wrap: Delete. + +2003-07-14 Dan Nicolaescu + + * ggc-page.c (extra_order_size_table): Insns have 9 slots. Regs + don't have 2. + +2003-07-14 Dan Nicolaescu + + * ggc-page.c (struct globals): Add new fields to keep track of the + total allocated memory and overhead. + (ggc_print_statistics): Print them. + (ggc_alloc): Keep track of the total allocated memory and the + overhead. + + * tree.c (dump_tree_statistics): Increase spacing. + (enum tree_node_kind): Move to ... + * tree.h (enum tree_node_kind): ... here. + (tree_node_counts, tree_node_sizes): Declare. + +2003-07-14 James A. Morrison + + * doc/include/texinfo.tex: Upgrade to texinfo 4.6. + +2003-07-14 Franz Sirl + + PR optimization/11440 + * gcse.c (try_replace_reg): Don't attach notes to ZERO_EXTRACT or + SIGN_EXTRACT SETs. + +2003-07-14 Alan Modra + + * doc/tm.texi (BLOCK_REG_PADDING): Describe. + * expr.h (struct locate_and_pad_arg_data): Add where_pad. + (emit_group_load, emit_group_store): Adjust declarations. + Remove most occurrences of #ifdef TREE_CODE. + * expr.c (emit_group_load): Add "type" param, and use + BLOCK_REG_PADDING to determine need for a shift. Optimize non- + aligned accesses if !SLOW_UNALIGNED_ACCESS. + (emit_group_store): Likewise. + (emit_push_insn, expand_assignment, store_expr, expand_expr): Adjust + emit_group_load and emit_group_store calls. + * calls.c (store_unaligned_arguments_into_pseudos): Tidy. Use + BLOCK_REG_PADDING to determine whether we need endian_correction. + (load_register_parameters): Localize vars. Handle shifting of + small values to the correct end of regs. Adjust emit_group_load + call. + (expand_call, emit_library_call_value_1): Adjust emit_group_load + and emit_group_store calls. + * function.c (assign_parms): Set mem alignment for stack slots. + Adjust emit_group_store call. Store values at the "wrong" end + of regs to the stack. Use BLOCK_REG_PADDING. + (locate_and_pad_parm): Save where_pad. + (expand_function_end): Adjust emit_group_load call. + * stmt.c (expand_value_return): Adjust emit_group_load call. + * Makefile.in (calls.o): Depend on $(OPTABS_H). + * config/rs6000/linux64.h (TARGET_LITTLE_ENDIAN): Redefine as 0. + (AGGREGATE_PADDING_FIXED, AGGREGATES_PAD_UPWARD_ALWAYS): Define. + (MUST_PASS_IN_STACK): Define. + (BLOCK_REG_PADDING): Define. + * config/rs6000/rs6000.h (struct rs6000_args): Remove orig_nargs. + (PAD_VARARGS_DOWN): Define in terms of FUNCTION_ARG_PADDING. + * config/rs6000/rs6000.c (init_cumulative_args): Don't set orig_nargs. + (function_arg_padding): !AGGREGATE_PADDING_FIXED compatibility code. + Act on AGGREGATES_PAD_UPWARD_ALWAYS. + +2003-07-13 Aaron W. LaFramboise + + * config/i386/gthr-win32.c (__GTHREAD_HIDE_WIN32API): Define to 1. + +2003-07-13 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): If reg, copy OP0 to MEM + both if OFFSET specified and if result BLKmode for ARRAY_RANGE_REF. + +2003-07-13 Nathanael Nerode + + PR other/11123 + * toplev.c: Don't cut off option names. + +2003-07-13 Andreas Jaeger + + * c-decl.c (link_hash_hash): Avoid warning about casting pointer + to integer of different size. + +2003-07-13 Kazu Hirata + + * combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0) + to (eq (and X 1) 0). + +2003-07-13 Andreas Jaeger + + * config.gcc: Add pmmintrin.h for x86_64-*-*. + +2003-07-13 Zack Weinberg + + * Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H). + (hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency + list. Move these all together down by cpplib. + + * cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining + definition of CPPCHAR_SIGNED_T. + + * cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c + * cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c + * line-map.c, mkdeps.c: Don't include coretypes.h or tm.h. + + * cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init. + * cppinit.c (cpp_create_reader): Likewise. + + * cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line. + * cpptrad.c: Likewise. All callers changed. + * cpplib.c: All callers changed. + * c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout. + * hashtable.h: Define GTY(x) to nothing here too. + +2003-07-13 Richard Kenner + + * stor-layout.c (compute_record_mode): Remove very obsolete test + that forces BLKmode for records with fields crossing word boundary. + +2003-07-13 Zack Weinberg + + * Makefile.in: Remove orphan reference to acconfig.h. + +2003-07-13 Andreas Jaeger + + * cgraphunit.c: Convert prototypes to ISO C90. + +2003-07-13 Nathanael Nerode + + * fixinc/inclhack.def (avoid_wchar_t_type): Use __cplusplus bypass + (for OpenBSD). + * fixinc/fixincl.x: Rebuild. + +2003-07-12 Zack Weinberg + + * configure.in: Always define HAVE_AS_GOTOFF_IN_DATA for + i?86-*-*. Use correct name of cache variable. + * configure: Regenerate. + +2003-07-12 Kazu Hirata + + * config/alpha/alpha.c: Fix comment typos. + * config/alpha/alpha.md: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/lib1funcs.asm: Likewise. + * config/avr/avr.md: Likewise. + * config/arm/README-interworking: Fix typos. + +2003-07-12 Kazu Hirata + + * c-format.c: Fix comment formatting. + * c-typeck.c: Likewise. + * coverage.c: Likewise. + * cppcharset.c: Likewise. + * cpplib.c: Likewise. + * dbxout.c: Likewise. + * gcov-io.h: Likewise. + * toplev.c: Likewise. + +2003-07-12 Nathanael Nerode + + * fixinc/inclhack.def (alpha_sbrk): Note that OpenBSD needs this + fix. + +2003-07-12 Zack Weinberg + + * aclocal.m4 (gcc_AC_CHECK_TYPE): Clone of AC_CHECK_TYPE, + uses three-argument AC_DEFINE so no acconfig.h entries are + needed. + (_gcc_COMPUTE_GAS_VERSION): Also provide gcc_cv_gas_vers + which contains the GAS version number as a scaled integer. + (gcc_GAS_VERSION_GTE_IFELSE): Use gcc_cv_gas_vers. Add + ability to check for ELF assembler. + (gcc_GAS_CHECK_FEATURE): New macro. + * configure.in: Use gcc_AC_CHECK_TYPE. Rewrite all + assembler feature checks using gcc_GAS_CHECK_FEATURE. + Use three-argument AC_DEFINE everywhere. + * acconfig.h: Deleted. + * config.in, configure: Regenerate. + +2003-07-12 Nathanael Nerode + + * fixinc/inclhack.def (struct_sockaddr): Avoid "fixing" sockaddr_in + (on OpenBSD). + * fixinc/fixincl.x: Regenerate. + + * fixinc/inclhack.def (gnu_types): Improve comment. + +2003-07-12 Andreas Jaeger + + * fp-test.c (main): Use ISO C90 prototype. + + * version.c: Remove unneded include of ansidecl.h. + + * cgraph.h: Convert prototypes to ISO C90. + * cgraph.c: Likewise. + * fix-header.c: Likewise. + * ra.h: Likewise. + * protoize.c: Likewise. + +2003-07-12 Jan Hubicka + + * cgraphunit.c (cgraph_inlined_into, cgraph_inlined_calees): Fix + warning. + +2003-07-12 Jan Hubicka + Gerald Pfeifer + + * cgraph.c (cgraph_max_uid): New global variable. + (cgraph_node): Set uid field. + (create_edge): Keep inline flags consistent. + (dump_cgraph): Dump more info. + * cgraph.h (struct cgraph_local_info): Remove inline_many and + can_inline_once; add inlinable, disgread_inline_limits, and self_insn + (struct cgraph_global_info): Add insns, calls, cloned_times, + will_be_output. + (struct cgraph_node): Add uid. + (struct cgraph_edge): Add inline_call. + (cgraph_max_uid, cgraph_inline_p): Declare. + * cgraph.c: Include params.h and fibheap.h + (cgraph_mark_functions_to_inline_once): Kill. + (INSNS_PER_CALL): New constant. + (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New + static variables. + (cgraph_finalize_function): Do not analyze inlining. + (cgraph_finalize_compilation_unit): Set inlining attributes. + (cgraph_mark_functions_to_output): More consistency checks. + (cgraph_optimize_function): Set current_function_decl to NULL. + (cgraph_expand_function): Use new inline flags. + (cgraph_postorder): Expand from cgraph_expand_functions. + (INLINED_TIMES, SET_INLINED_TIMES): New macros. + (cgraph_inlined_into, cgraph_inlined_callees, + cgraph_estimate_size_after_inlining, cgraph_estimate_growth, + cgraph_mark_inline, cgraph_check_inline_limits, + cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, + cgraph_decide_inlining, cgraph_inline_p): New functions. + * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, + PARAM_INLINE_UNIT_GROWTH): New parameters. + * tree-inline.c (struct inline_data): New field current_decl. + (expand_call_inline): Avoid forward declarations; use + inlinable_function_p. + (optimize_inline_calls): Set id.current_decl. + +2003-07-11 Andrew Pinski + + * configure.in: Remove wrongly added definition of + local_prefix. + * configure: Regenerate. + +2003-07-11 Dan Nicolaescu + + * rtl.def (NOTE): Do not use padding. + +2003-07-11 Dara Hazeghi + + * doc/install.tex: Update required binutils for i?86-*-linux* + +2003-07-11 Richard Henderson + + * Makefile.in (stage1_build): Force OBJS-onestep=OBJS. + +2003-07-11 Mark Mitchell + + * varasm.c (make_decl_rtl): Treat decls with a DECL_CONTEXT of + TRANSLATION_UNIT_DECL as top_level. + +2003-07-11 Jakub Jelinek + + * optabs.c (prepare_cmp_insn): Try cmpmemM first if it exists, + then fall back to cmpstrM. + * builtins.c (expand_builtin_memcmp): Likewise. + * config/s390/s390-protos.h (s390_expand_cmpstr): Rename to... + (s390_expand_cmpmem): ... this. + * config/s390/s390.md (cmpmemdi, cmpmemsi, cmpmem_short_64, + cmpmem_short_31, cmpmem_long_64, cmpmem_long_31): Renamed + from cmpstr* patterns. Rename call to s390_expand_cmpstr + to s390_expand_cmpmem. + * config/s390/s390.c (s390_expand_cmpstr): Rename to... + (s390_expand_cmpstr): ... this. Rename cmpstr* instructions + to cmpmem*. + * config/i370/i370.md (cmpmemsi, cmpmemsi_1): Renamed from + cmpstr* patterns. + * doc/md.texi (cmpstrM): Describe as String compare insn, not + Block compare insn. + (cmpmemM): Add. + +2003-07-11 Loren James Rittle + + * config/i386/freebsd.h (SET_ASM_OP): Remove. + (SUBTARGET_OVERRIDE_OPTIONS): Handle TARGET_64BIT case. + (ASM_COMMENT_START, ASM_APP_ON, ASM_APP_OFF, DBX_REGISTER_NUMBER + MCOUNT_NAME, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE_SIZE): Whitespace. + +2003-07-11 Richard Henderson + + * function.c (assign_parms): Don't recombine complex args if + fnargs is unchanged from orig_fnargs. + (split_complex_args): Return args without complex before copying. + Re-layout the modified parameters. + +2003-07-11 J"orn Rennecke + + * regclass.c (choose_hard_reg_mode): Add third argument. + Changed all callers. + * rtl.h (choose_hard_reg_mode): Update declaration. + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): + Take HARD_REGNO_CALL_PART_CLOBBERED into account. + +2003-07-11 Geoffrey Keating + + * c-decl.c (finish_decl): Handle 'used' here... + * cgraphunit.c (cgraph_finalize_function): ... and here ... + * c-common.c: (handle_used_attribute): ... not here. + + * configure.in (onstep): Support --enable-intermodule. + * Makefile.in (OBJS-common): New. + (OBJS-md): New. + (OBJS-archive): New. + (OBJS): Build from OBJS-common, OBJS-md, OBJS-archive. + (OBJS-onestep): New. + (libbackend.a): Support @onestep@. + (libbackend.o): New. + * configure: Regenerate. + + * c-common.h (c_reset_state): New prototype. + (c_parse_file): New prototype. + (finish_file): Move prototype from c-tree.h. + * c-decl.c: Include . + (builtin_decls): New. + (current_file_decl): New. + (duplicate_decls): Add extra parameter. Change all callers. Don't + output duplicate common symbols. + (link_hash_hash): New. + (link_hash_eq): New. + (poplevel): Handle popping of the top level. + (warn_if_shadowing): Handle TRANSLATION_UNIT_DECL. + (pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate. + (pushdecl_top_level): Likewise. + (redeclaration_error_message): Handle TRANSLATION_UNIT_DECL. + (c_init_decl_processing): Create TRANSLATION_UNIT_DECL. + (finish_decl): Handle TRANSLATION_UNIT_DECL. + (merge_translation_unit_decls): New. + (c_write_global_declarations): New. + (c_reset_state): New. + (implicitly_declare): Handle TRANSLATION_UNIT_DECL. + * c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New. + * c-objc-common.c (c_cannot_inline_tree_fn): Handle + TRANSLATION_UNIT_DECL. + (c_objc_common_finish_file): Call merge_translation_unit_decls. + * c-opts.c (in_fnames): Rename from in_fname. + (c_common_decode_option): Handle multiple input filenames. + (c_common_post_options): Likewise. + (c_common_parse_file): Likewise; also, call c_parse_file rather than + yyparse. + * c-parse.in: Move cleanup code to c_parse_file. + (free_parser_stacks): Move contents to c_parse_file. + (c_parse_file): New. + * c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT + for integer types. + (C_DECL_FILE_SCOPE): New. + (finish_file): Move prototype to c-common.h. + (merge_translation_unit_decls): New prototype. + (comptypes): Add extra parameter to prototype. + (c_write_global_declarations): New prototype. + * c-typeck.c (tagged_types_tu_compatible_p): New. + (function_types_compatible_p): Add extra parameter, change all callers. + (type_lists_compatible_p): Likewise. + (comptypes): Likewise. + (struct tagged_tu_seen): New. + (tagged_tu_seen_base): New. + (build_unary_op): Handle TRANSLATION_UNIT_DECL. + (c_mark_addressable): Remove #if 0 code. + * calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add + comment explaining why it shouldn't have to. + * cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY + options. + * cppinit.c (cpp_read_next_file): New. + (cpp_read_main_file): Use it. + * cpplib.c (undefine_macros): New. + (cpp_undef_all): New. + * cpplib.h (cpp_read_next_file): Prototype. + (cpp_undef_all): Prototype. + * langhooks-def.h (write_global_declarations): Remove prototype. + * toplev.h (write_global_declarations): Add prototype. + * tree.c (decl_type_context): Use switch statement, handle + TRANSLATION_UNIT_DECL. + * tree.def: Update documentation for TRANSLATION_UNIT_DECL. + (TRANSLATION_UNIT_DECL): New kind of tree. + * tree.h: Update documentation for TRANSLATION_UNIT_DECL. + * Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies. + * doc/invoke.texi: Make attempt to document new functionality. + + 2003-05-19 Per Bothner + + * gcc.c (combine_inputs): New. + (process_command): Set combine_inputs. + (do_spec_1): Handle combine_inputs. + (main): Likewise. + +2003-07-10 James E Wilson + + PR optimization/9745 + * loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before + loop_insn_emit_before. + (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise. + +2003-07-10 Zack Weinberg + + * cppcharset.c: Fix comment. + (iconv_close [!HAVE_ICONV]): #define to (void)0 to prevent warning. + (EILSEQ): #define to EINVAL if not already defined. + (convert_using_iconv): #if out when !HAVE_ICONV. + (init_iconv_desc): Handle !HAVE_ICONV here... + (cpp_init_iconv): ...not here. + +2003-07-11 Neil Booth + + * common.opt: More --help messages. + * opts.c (print_help): Use puts(). + * toplev.c (f_options): Remove help text. + (display_help): Don't dump f_options. + +2003-07-11 Nathanael Nerode + + * fixinc/mkfixinc.sh: Drop reference to unsupported alpha-*-interix*. + Move i?86-*-interix* to the don't-fix list. + * fixinc/fixinc.interix: Delete with extreme prejudice. + +2003-07-10 Dara Hazeghi + + PR bootstrap/10758 + * doc/install.texi: Document requirements for ia64-*-hpux* target. + +2003-07-10 Roger Sayle + + * config/ia64/hpux.h (TARGET_C99_FUNCTIONS): Define. + +2003-07-10 Zack Weinberg + + * cppcharset.c (one_utf8_to_cppchar, one_cppchar_to_utf8, + one_utf8_to_utf32, one_utf32_to_utf8, one_utf8_to_utf16, + one_utf16_to_utf8, conversion_loop, convert_utf8_utf16, + convert_utf8_utf32, convert_utf16_utf8, convert_utf32_utf8, + convert_no_conversion, convert_using_iconv): New functions. + (APPLY_CONVERSION): New macro. + (struct conversion, conversion_tab): New data structure. + (init_iconv_desc): Check conversion_tab for a custom conversion + primitive before trying to use iconv. + (convert_cset): Deleted. + (cpp_init_iconv): Use UTF- terminology, not UCS-. + (_cpp_destroy_iconv): Update to match. + (_cpp_valid_ucn): We don't need iconv to implement UCNs. + (convert_ucn): Use one_cppchar_to_utf8 and APPLY_CONVERSION. + (convert_escape, cpp_interpret_string): Use APPLY_CONVERSION. + (_cpp_interpret_string_notranslate): New function, moved here + from cpplib.c. + + * cpphash.h (convert_f, struct cset_converter): New types. + (struct cpp_reader): narrow_cset_desc and wide_cset_desc + are now struct cset_converter, not bare iconv_t. + Update prototypes. + * cpplib.c (interpret_string_notranslate): Moved to cppcharset.c; + all callers changed. + +2003-07-10 Kelley Cook + + * Makefile.in (options.h): Depend on Makefile. Add move-if-change + to opts.sh command line. + * opts.sh: Write to temporary files with a move-if-change at the end. + +2003-07-10 Denis Chertykov + Richard Kenner + + * combine.c (gen_binary): Handle the CLOBBER rtx and + don't build a binary operation with it. + +2003-07-10 Zdenek Dvorak + + * gcse.c (load_kills_store, find_loads, store_killed_in_insn, + store_killed_after, store_killed_before): Keep track of the correct + dependency function to use. + +2003-07-10 Steven Bosscher + * toplev.c (do_compile): Don't try to open dump files before + lang_dependent_init initializes dump_base_name. + +2003-07-10 Kaveh R. Ghazi + + * config/arm/arm.c (arm_init_iwmmxt_builtins, arm_expand_builtin): + Use ARRAY_SIZE. + * config/frv/frv.c (frv_expand_builtin): Likewise. + * config/sh/sh.c (sh_media_init_builtins): Likewise. + +2003-07-09 Mark Mitchell + + PR c++/10032 + * doc/invoke.texi (C++ Dialect Options): Change documentation of + -fpermissive. + +2003-07-10 J"orn Rennecke + + * tm.texi (RETURN_ADDR_OFFSET): Document. + +2003-07-10 Nathan Sidwell + + * gcov-io.h: Update documentation. + (GCOV_UNSIGNED2STRING): New. + (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH, + GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH, + GCOV_TAG_SUMMARY_LENGTH): Adjust. + (GCOV_TAG_BLOCKS_NUM, GCOV_TAG_ARCS_NUM, + GCOV_TAG_COUNTER_NUM): New. + (GCOV_BLOCK_SIZE): Number of words. + (gcov_var): Adjust buffer type. + * gcov-io.c (gcov_write_bytes, gcov_read_bytes): Rename to ... + (gcov_write_words, gcov_read_words): ... here. Take a 4-byte word + count, not byte count. + (gcov_open): Adjust overread init. + (gcov_allocate, gcov_write_unsigned, gcov_write_counter, + gcov_write_string, gcov_write_tag, gcov_write_length, + gcov_write_tag_length): Adjust. + (gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust. + (gcov_sync, gcov_seek): Adjust. + * gcov-dump.c (print_usage): Show gcc version only. + (dump_file): Use GCOV_UNSIGNED2STRING. + (tag_blocks, tag_arcs, tag_counters): Use GCOV_TAG_*_NUM macros. + * gcov.c (print_version): Show gcc version only. + (read_graph_file): Use GCOV_UNSIGNED2STRING. Use + GCOV_TAG_*_NUM macros. + (read_count_file): Use GCOV_UNSIGNED2STRING. Use + GCOV_TAG_COUNTER_LENGTH. + * coverage.c (read_counts_file): Use GCOV_UNSIGNED2STRING. + Use GCOV_TAG_COUNTER_NUM. + * libgcov.c (gcov_version): Use GCOV_UNSIGNED2STRING. + (__gcov_merge_single, __gcov_merge_delta): Use GCOV_CHECK. + +2003-07-10 Andreas Schwab + + * gcov-dump.c (dump_file): Fix missing address operator. + +2003-07-10 Kazu Hirata + + PR c/11449 + * fold-const.c (sign_bit_p): Return EXP if VAL is the sign bit + of HOST_WIDE_INT. + (fold_single_bit_test): If sign_bit_p() fails, assume that the + bit being tested is not a sign bit. + +2003-07-10 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-07-10 Alexandre Oliva + + 2001-12-13 Alexandre Oliva + * config/mn10300/linux.h (LINK_SPEC): Rename the dynamic linker + from ld-linux.so.2 to ld.so.1. + 2001-11-18 Alexandre Oliva + * config/mn10300/linux.h (LINK_SPEC): -lpthread, not -lthread. + * config/mn10300/linux.h (LINK_SPEC): Don't handle -Wl,-rpath + nor -Wl,-rpath-link. + (LIB_SPEC): Add -rpath-link if !static. + 2001-08-22 Alexandre Oliva + * config/mn10300/mn10300.c (mn10300_protect_label): New + variable. + * config/mn10300/linux.h (PRINT_OPERAND, + PRINT_OPERAND_ADDRESS): Set it during their execution. + (ASM_OUTPUT_LABELREF): Output `+' before symbol name if + mn10300_protect_label is set. + * config/mn10300/linux.h (LINK_SPEC): Recognize -Wl,-rpath and + -Wl,-rpath-link. + (LIB_SPEC, STARTFILE_SPEC): Define. + 2001-05-11 Alexandre Oliva + * config/mn10300/t-linux (dp-bit.c, fp-bit.c): Don't define + FLOAT_BIT_ORDER_MISMATCH. + 2001-05-09 Alexandre Oliva + * config.gcc (am33_2.0-*-linux*): Added. + * config/mn10300/linux.h: New. + * config/mn10300/t-linux: New. + +2003-07-10 Andreas Jaeger + + * fold-const.c: Properly wrap prototypes. + +2003-07-09 Alexandre Oliva + + 2003-06-16 Alexandre Oliva + * config/mn10300/mn10300.c (mn10300_unspec_int_label_counter): + Moved from... + * config/mn10300/mn10300.md (GOTaddr2picreg): ... here. + * config/mn10300/mn10300.h: GTY-declare it. + 2003-06-11 Alexandre Oliva + * config/mn10300/mn10300.c (mn10300_encode_section_info): Fix + prototype. Use incoming RTL argument. + 2002-12-12 Alexandre Oliva + * config/mn10300/mn10300.md (int_label): Move C statements... + (GOTaddr2picreg): ... here. + 2002-08-15 Alexandre Oliva + * config/mn10300/mn10300.h (ENCODE_SECTION_INFO): Move... + * config/mn10300/mn10300.c (mn10300_encode_section_info): + ... here. New function. + (TARGET_ENCODE_SECTION_INFO): Define to it. + 2001-11-04 Alexandre Oliva + * config/mn10300/mn10300.md (builtin_setjmp_receiver): Fix typo in + pattern name. + (mn10300_loadPC): Define as insn splittable after reload. + 2001-05-13 Alexandre Oliva + * config/sh/mn10300.h (JUMP_TABLES_IN_TEXT_SECTION): Let them + be defined in .rodata even in PIC, now that the assembler + supports that. + 2001-05-09 Alexandre Oliva + * config/mn10300/mn10300.h (GOT_SYMBOL_NAME): Don't let the + symbol take an underscore prefix. + 2001-04-14 Alexandre Oliva + * config/mn10300/mn10300-protos.h (legitimate_pic_operand_p, + legitimize_pic_address): Declare. + * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Mark + the PIC register as fixed. + (EXTRA_CONSTRAINT): Match UNSPEC_PLT and UNSPEC_PIC for 'S'. + (GO_IF_LEGITIMATE_ADDRESS): Require legitimate_pic_operand for + PIC. + (LEGITIMATE_PIC_OPERAND_P): Define. + (PIC_OFFSET_TABLE_REGNUM): Define. + (GOT_SYMBOL_NAME): Define. + (SYMBOLIC_CONST_P): Define. + (ENCODE_SECTION_INFO): Use SYMBOL_REF_FLAG to mark local + symbols. + (MN10300_GLOBAL_P): Test it. + (OUTPUT_ADDR_CONST_EXTRA): Handle PIC-related unspecs. + (JUMP_TABLES_IN_TEXT_SECTION): Enable for PIC. + * config/mn10300/mn10300.c (print_operand): Handle unspec. + (expand_prologue): Set PIC register. + (call_address_operand): Don't match SYMBOL_REFs in PIC. + (legitimize_address): Call legitimize_pic_address. + (legitimize_pic_address): New fn. + (legitimate_pic_operand_p): New fn. + * config/mn10300/mn10300.md (PIC_REG, SP_REG): New constants. + (UNSPEC_INT_LABEL, UNSPEC_PIC, UNSPEC_GOT, UNSPEC_GOTOFF, + UNSPEC_PLT): New constants. + (pop_pic_reg): New insn. + (movsi): Adjust non-PIC addresses. + (builtin_setjmp_receiver): Restore the PIC register. + (casesi): New insn. + (call): Adjust non-PIC addresses. + (int_label, GOTaddr2picreg): New expands. + (am33_loadPC): New insn. + (mn10300_loadPC): New expand. + (call_next_insn): New insn. + (add_GOT_to_pic_reg): New expand. + (symGOT2reg, symGOT2reg_i): New expands. + (symGOTOFF2reg, symGOTOFF2reg_i): New expands. + (sym2PIC, sym2PLT): New expands. + +2003-07-09 Alexandre Oliva + + * config/mn10300/mn10300.h (PREDICATE_CODES): Define. + 2001-05-01 Alexandre Oliva + * config/mn10300/mn10300.md (sqrtsf2): flag_fast_math was renamed + to flag_unsafe_math_optimizations. + 2001-04-14 Alexandre Oliva + * config/mn10300/mn10300.c (expand_prologue): Mark + FP-register-saving insns as frame-related. + 2001-02-13 Alexandre Oliva + * config/mn10300/mn10300.c + (mn10300_get_live_callee_saved_regs): Don't search past + LAST_EXTENDED_REGNUM. + (mn10300_gen_multiple_store, store_multiple_operation): Likewise. + * config/mn10300/mn10300.md: Remove excessive line breaks from + `@' output patterns that were accounted as additional + alternatives. + * config/mn10300/mn10300.md, config/mn10300/mn10300.c: + Re-introduce changes accidentally removed in Richard Sandiford's + 2000-12-05's patch. + * config/mn10300/t-mn10300 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): + Re-instate am33-2 lost in merge from net GCC. + 2000-08-26 Alexandre Oliva + * config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Added + floating-point registers. + 2000-08-07 Alexandre Oliva + * config/mn10300/mn10300.md (movdf): Revert some am33-specific + pessimizations that had gone in on 2000-05-08. + 2000-06-28 Graham Stott + * config/mn10300/mn10300.h (REG_CLASS_CONTENTS): Fix typo. + 2000-06-22 Graham Stott + * config/mn10300/mn10300.md (movqi): Use nonimmediate_operand for + operand 0. + * (movhi): Likewise. + * (movsi): Likewise. + * (movsf): Likewise. + * (movdi): Likewise. + * (movdf): Likewise. + 2000-05-24 Alexandre Oliva + * config/mn10300/mn10300.c (fp_regs_to_save): New function. + (can_use_return_insn, initial_offset): Add fp_regs_to_save. + (expand_prologue, expand_epilogue): Save and restore FP regs. + 2000-05-20 Alexandre Oliva + * config/mn10300/mn10300.md (movdi, movdf): 64-bit clean-up. + 2000-05-13 Alexandre Oliva + * config/mn10300/mn10300.md (abssf2, negsf2, rsqrtsf2, addsf3, + subsf3, mulsf3, divsf3, fmaddsf4, fmsubsf4, fnmaddsf4, fnmsubsf4): + Do not clobber cc0. + 2000-05-12 Alexandre Oliva + * config/mn10300/mn10300.md (abssf2, negsf2, rsqrtsf2): + Discourage the two-argument, longer opcodes. + (addsf3, subsf3, mulsf3, divsf3): Likewise for three-argument + ones. + * config/mn10300/mn10300.h (struct mn10300_cc_status_mdep): New. + (CC_STATUS_MDEP, CC_STATUS_MDEP_INIT): Define. + * config/mn10300/mn10300.md (cmpsf): New pattern. + (branch): Test mdep.fpCC and output fbCC. + * config/mn10300/mn10300.c (print_operand): Output conditions. + (notice_cc_update): Recognize fcmp and set mdep.fpCC. + 2000-05-10 Alexandre Oliva + * config/mn10300/mn10300.md (movsf, movdf, addsf3, subsf3, + mulsf3, divsf3): Use the `F' constraint for FP values. + * config/mn10300/mn10300.c (const_1f_operand): New function. + * config/mn10300/mn10300-protos.h (const_1f_operand): Declare. + * config/mn10300/mn10300.md (sqrtsf2): New expand. + (rsqrtsf2): New insn. + 2000-05-09 Alexandre Oliva + * config/mn10300/mn10300.md (movdf): Oops, I missed it in my + previous check-in. + 2000-05-08 Alexandre Oliva + * config/mn10300/mn10300.md (abssf2, negdf2): On + TARGET_AM33_2, expand to... + (abssf2_am33_2, negdf2_am33_2): New insns. + (addsf3, subsf3, mulsf3, divsf3): Likewise. + (fmaddsf4, fmsubsf4, fnmaddsf4, fnmsubsf4): Likewise. + * config/mn10300/mn10300.md (movqi, movhi, movsi, movsf, + movdi, movdf): Added FP regs. + * invoke.texi (-mam33-2, -mno-am33-2): Document. + 2000-04-29 Alexandre Oliva + * config/mn10300/mn10300.h (FIRST_FP_REGNUM, LAST_FP_REGNUM): + New macros. + (REGNO_AM33_2_FP_P): Renamed to... + (REGNO_FP_P): Redefine in terms of FIRST_* and LAST_*. + (CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise. + 2000-04-27 Alexandre Oliva + * config/mn10300/mn10300.h (REG_CLASS_CONTENTS): Remove FP + regs from GENERAL_REGS. + 2000-04-27 Alexandre Oliva + * config/mn10300/mn10300.h (REGNO_AM33_2_FP_P): New macro. + * config/mn10300/mn10300.c (mn10300_address_cost): Added FP_REGS. + * config/mn10300/mn10300.h (REGISTER_MOVE_COST): Added FP_REGS. + 2000-04-23 Alexandre Oliva + * config/mn10300/mn10300.h (CLASS_CANNOT_CHANGE_SIZE): Defined + as FP_REGS. + 2000-04-21 Alexandre Oliva + * config/mn10300/mn10300.h (OK_FOR_Q): New macro. + (EXTRA_CONSTRAINT): Added OK_FOR_Q. + * config/mn10300/mn10300.c (secondary_reload_class): Adjust. + * config/mn10300/mn10300.c (print_operand): Support `D' for doubles. + * config/mn10300/mn10300.h (FIRST_PSEUDO_REGISTER): Adjust. + (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER): Added + AM33/2.0 floating-point registers. + (CONDITIONAL_REGISTER_USAGE): Adjust. + (enum reg_class, REG_CLASS_NAMES): Added FP_REGS and FP_ACC_REGS. + (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Adjust. + (REG_CLASS_FROM_LETTER): Added `f' and `A'. + (REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES): Adjust. + * config/mn10300/t-mn10300 (MULTILIB_OPTIONS): Added am33-2. + (MULTILIB_DIRNAMES): Likewise. + * config/mn10300/mn10300.h (CPP_SPEC): Define `__AM33__=2' and + `__AM33_2__' when `-mam33-2' is given. + (TARGET_AM33_2): Define. + (TARGET_SWITCHES): Adjust. + * config/mn10300/mn10300.c (asm_file_start): Print `.am33_2' + when appropriate. + +2003-07-09 Matt Kraai + + * doc/install.texi: Add missing @. + +2003-07-09 Bob Wilson + + * config/xtensa/xtensa.h (CRT_CALL_STATIC_FUNCTION): Define. + +2003-07-09 Aldy Hernandez + + PR/11144 + * config/i386/i386.c (ix86_function_arg_boundary): Remove abort. + +2003-07-09 Nathanael Nerode + + PR bootstrap/11043 + * config/arc/t-arc: Replace bogus references to "x-crtinit.o", + "x-crtfini.o" with "crtinit.o", "crtfini.o". + + * fixinc/inclhack.def (limits_ifndefs): Add select test. + * fixinc/fixincl.x: Rebuild. + + * fixinc/inclhack.def (math_exception): Improve bypass and comment. + * fixinc/fixincl.x: Rebuild. + +2003-07-09 Hans-Peter Nilsson + + * doc/install.texi (Configuration): Document the valgrind option + to --enable-checking. + +2003-07-09 Jan Hubicka + + * objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New. + +2003-07-09 Rainer Orth + + * c-lex.c (cb_ident): Cast cstr.text to const char *. + +2003-07-09 Nathan Sidwell + + * gcov-io.h: Update documentation. + (GCOV_GRAPH_SUFFIX, GCOV_GRAPH_MAGIC): Rename to GCOV_NOTE_SUFFIX, + GCOV_NOTE_MAGIC. + (GCOV_DATA_SUFFIX, GCOV_NOTE_SUFFIX): Update. + (GCOV_DATA_MAGIC, GCOV_NOTE_MAGIC): Make non-palindromic. + (struct gcov_var): Change buffer's type. Add endian flag. + (gcov_open): Remove mode in libgcov. + (gcov_magic): Prototype. + * gcov-io.c (from_file): New. + (gcov_open): Clear endian flag. + (gcov_magic): New. + (gcov_write_bytes, gcov_read_bytes): Return gcov_unsigned_t + pointers. + (gcov_write_unsigned, gcov_write_counter, gcov_write_string, + gcov_write_tag, gcov_write_length, gcov_write_tag_length): Update. + (gcov_read_unsigned, gcov_read_counter, gcov_read_string): Update. + * gcov-iov.c (main): Correct cast. + * coverage.c (read_counts_file): Use gcov_magic. Remove endianness + conversion. + (gcov_begin_output): Use GCOV_NOTE_MAGIC. + (coverage_init): Use GCOV_NOTE_SUFFIX. + * libgcov.c (gcov_version_mismatch): Remove endianness conversion. + Rename to gcov_version, and return flag. + (gcov_exit): Use gcov_version. + (__gcov_init): Use gcov_version. + * Makefile.in (coverageexts): Update. + * gcov.c (print_version): Remove endianness conversion. + (create_file_names): Use GCOV_NOTE_SUFFIX. + (read_graph_file): Use gcov_magic. + (read_count_file): Likewise. + * gcov-dump.c (dump_file): Remove endianness conversion, use + gcov_magic. + +2003-07-09 Nathan Sidwell + + * configure.in (BUILD_PREFIX, BUILD_PREFIX_1): Set if enable + coverage is on. + * configure: Regenerated. + * Makefile.in (ALL_CFLAGS): Correct its comment. + +2003-07-08 Mark Mitchell + + * fold-const.c (make_range): Do not access operand 1 for a + zero-operand operator. + +2003-07-09 Neil Booth + + * toplev.c (warn_dummy, W_options): Die. + (display_help): Don't print W_options. + * common.opt: Add W_options help from toplev.c. + +2003-07-09 Andreas Jaeger + + * opts.c (wrap_help): Only pass int arguments as arguments to + printf's '*' modifier. Change argument of function. + +2003-07-08 Matt Kraai + + * doc/invoke.texi: Fix misspelling of "@item". + +2003-07-08 Kazu Hirata + + * config/i386/i386.md: Remove an old comment about + NOTICE_UPDATE_CC. + +2003-07-09 Jan Hubicka + + * cgraph.c (cgraph_node_name): New function. + (dump_cgraph): Use it. + * cgraph.h (cgraph_dump_file): Declare. + (cgraph_node_name): Declare. + * cgraphunit.c: Include timevar.h + (cgraph_finalize_compilation_unit): Use timevar; reorganize dumps. + (cgraph_optimize_function): Use TV_INTEGRATION. + (cgraph_mark_local_functions): reorganize dumps. + (cgraph_mark_functions_to_inline_once): Likewise. + (cgraph_optimize): Likewise; use timevar. + * timevar.def (TV_CGRAPH, TV_CGRAPHOPT): New. + * toplev.c (dump_file_index): Add DFI_cgraph. + (dump_file_info): Likewise. + (cgraph_dump_file): New global variable. + (do_compile): Open and close cgraph dump. + * invoke.texi (-d): Document new flag; renumber. + +2003-07-08 Roger Sayle + + PR c/11370 + * calls.c (emit_call_1): Don't bother popping the arguments off of + the stack after a noreturn function call; The adjustment is dead. + (expand_call): Likewise. + +2003-07-08 Geoffrey Keating + + * expr.c (MOVE_MAX_PIECES): Move from here... + * defaults.h (MOVE_MAX_PIECES): ... to here. + +2003-07-08 Matt Kraai + + * Makefile.in (stage1-start): Handle an empty SUBDIRS. + +2003-07-08 Kaveh R. Ghazi + + * genattr.c (internal_dfa_insn_code): Don't prototype. + * genattrtab.c (attr_desc): Add `static_p' field. + (expand_units): Make blockage range and ready cost functions + static. + (write_attr_get): Don't add extern prototypes in C file. Mark + static functions as appropriate. + (find_attr, make_internal_attr): Initialize static_p. + * genattrtab.h (ATTR_STATIC): New macro. + * genautomata.c (output_internal_reset_func): Mark output function + as inline. + (make_internal_dfa_insn_code_attr): Mark output function as static. + +2003-07-08 Kaveh R. Ghazi + + * genattrtab.h: Add new macros for attr `special' flags. + * genattrtab.c (attr_desc): Reorder/resize fields better. + Use attr `special' macros in all calls to make_internal_attr. + * genautomata.c: Likewise. + +2003-07-09 Jan Hubicka + + * c-common.c (c_estimate_num_insns_1): New static function. + (c_estimate_num_insns): New global function. + * c-common.h (DECL_NUM_STMTS): Rename to... + (DECL_ESTIMATED_INSNS): ... this. + (c_estimate_num_insns): Declare. + * c-decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS. + * c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New. + * c-semantics.c (add_stmt): Do not account statements. + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): + New. + * langhooks.h (lang_hooks_for_tree_inlining): Add + estimate_num_insns + * params.def (max-inline-insns-auto, max-inline-insns-auto): set + to 100. + (max-inline-insns): set to 300. + (min-inline-insns): set to 10. + * tree-inline.c (struct inline_data): Rename inlined_stmts to + inlined-insns. + (INSNS_PER_STMT): Kill. + (inlinable_function_p): Compute and store body size. + (expand_call_inline): Likewise. + (optimize_inline_calls): Likewise. + +2003-07-08 James E Wilson + + PR target/10021 + * emit-rtl.c (set_mem_attribute_minus_bitpos): When handle ARRAY_REF, + loop over new variable t2 instead of t. + +2003-07-08 Danny Smith + + PR bootstrap/11455 + * config/i386/winnt.c: Replace use of error(), warning() with + error_with_decl(), warning_with_decl(), throughout. + +2003-07-08 Neil Booth + + * opts.c (wrap_help): Use unsigned int, not size_t. + +2003-07-08 Stephane Carrez + + * config/m68hc11/m68hc11.h (HAVE_AS_DWARF2_DEBUG_LINE): Don't define + as .file/.loc directives are incompatible with linker relaxation. + +2003-07-08 Zack Weinberg + + * Makefile.in (fixinc.sh): Remove gnu-regex.[ch] from dependencies. + * fixinc/Makefile.in: Remove all references to gnu-regex.[och]. + * fixinc/fixfixes.c, fixinc/fixincl.c, fixinc/fixlib.c + * fixinc/fixtests.c: Use xregexec not regexec, xregcomp not regcomp. + * fixinc/fixlib.h: Include xregex.h not gnu-regex.h. + * fixinc/inclhack.def (hpux10_cpp_pow_inline, hpux11_cpp_pow_inline): + Escape { and } characters which are not part of range expressions. + * fixinc/fixincl.x: Regenerate. + * fixinc/gnu-regex.c, fixinc/gnu-regex.h: Delete file. + +2003-07-08 Steven Bosscher + + PR c/1687 + * tree-inline.c (find_alloca_call): Use + walk_tree_without_duplicates, instead of walk_tree. + (find_builtin_longjmp_call): Likewise. + * c-objc-common.c (c_cannot_inline_fn): Likewise. + * c-semantics.c (find_reachable_label): Likewise. + +2003-07-08 Jakub Jelinek + + PR c/11420 + * config/i386/i386.c (ix86_check_movabs): New function. + * config/i386/i386-protos.h (ix86_check_movabs): New prototype. + * config/i386/i386.md (movabs[shqd]i_1_rex64): Kill broken alternative. + (movabs[shqd]i_[12]_rex64): Add ix86_check_movabs check to conditions. + +2003-07-08 Chris Demetriou + + * Makefile.in (install-po): Cope with empty CATALOGS. + +2003-07-08 Richard Sandiford + + * config/mips/elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (SECTION_FUNCTION_TEMPLATE): Delete. + * config/mips/elf.h: As for elf64.h. + (ASM_OUTPUT_ALIGNED_BSS): Use named_section rather than sbss_section. + * config/mips/linux.h: As for elf.h + * config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete. + * config/mips/iris6.h (EXTRA_SECTIONS): Delete. + (EXTRA_SECTION_FUNCTIONS): Remove sdata_section. Remove the handling + of in_sdata from current_section_name and current_section_flags. + * config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete. + * config/mips/mips.h (sdata_section, sbss_section): Remove prototypes. + (MASK_GP_OPT, TARGET_GP_OPT): Delete. + (MASK_NO_FUSED_MADD): Use MASK_GP_OPT's old value. + (TARGET_SWITCHES): Neuter gpOPT, gpopt, no-gpOPT and no-gpopt. + (SMALL_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. + * config/mips/mips.c (TARGET_IN_SMALL_DATA_P): Override. + (TARGET_SECTION_TYPE_FLAGS): Override if TARGET_IRIX6. + (mips_classify_symbol): Use SYMBOL_REF_SMALL_P. + (override_options): Remove setting of MASK_GPOPT. + (mips_output_external): Use mips_in_small_data_p to check whether a + symbol needs an .extern directive. Don't emit such directives for + TARGET_EXPLICIT_RELOCS. + (mips_declare_object): Update accordingly. + (mips_select_rtx_section): Call named_section rather than + SMALL_DATA_SECTION. + (mips_select_section): Use default_elf_section_section for everything + except .text string constants. + (mips_in_small_data_p): New function. + (mips_encode_section_info): Remove small data handling. + (mips_unique_section): Delete. + (iris6_section_type_flags): New function. + * doc/tm.texi: Remove documentation of -mgpopt and -mhalf-pic. + +2003-07-08 John David Anglin + + PR Target/11453 + * pa.md: Disparage all mtsar constraints. + (extzv, extv, insv): Don't fail on length of {32|64}. + +2003-07-08 Zack Weinberg + + * system.h: Poison MAP_CHARACTER. + * config/i370/i370-protos.h (mvs_map_char): Delete. + * config/i370/i370.c (ascebc, ebcasc, mvs_map_char): Delete. + * config/i370/i370.h (MAP_CHARACTER): Delete definition. + (ASM_OUTPUT_ASCII): Don't use MAP_CHARACTER. + +2003-07-08 Danny Smith + + * toplev.c (randomize): Correct call to time(). + +2003-07-08 Jakub Jelinek + + * unroll.c (reg_dead_after_loop): Check for reg in REG_EQUAL and + REG_EQUIV notes as well. + +2003-07-08 Kazu Hirata + + * doc/md.texi: Fix the description of addmodecc. + +2003-07-07 Zack Weinberg + + * Makefile.in (top_builddir): Set to "..", not ".". + (INTLLIBS, INTLDEPS): Delete. + (LIBINTL, LIBINTL_DEP, LIBICONV_DEP): New variables to be substituted. + (LIBDEPS): Add $(LIBICONV_DEP). + (LIBS): Take out $(INTLLIBS), add $(LIBINTL) and $(LIBICONV). + (INCLUDES): Replace -I../intl with @INCINTL@. + ($(top_builddir)/intl/libintl.a): Delete rule. + (stage2-start, stage3-start, stage4-start, stageprofile-start, + stagefeedback-start): Use $$ for variable to be evaluated by + shell, not make. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, + HAVE_LC_MESSAGES, HAVE_STPCPY): Delete. + * aclocal.m4: sinclude ../config/progtest.m4. Add + contents of lcmessage.m4 from gettext distro. + * configure.in: Check for wchar.h and setlocale. Set + LIBICONV_DEP to the empty string and substitute it. + Call AM_LC_MESSAGES. Delete AC_ARG_ENABLE for --enable-nls; + this is handled elsewhere. Use ZW_GNU_GETTEXT_SISTER_DIR, + not CY_GNU_GETTEXT. Clear $LIBICONV if its text is included + in $LIBINTL, to avoid linking it twice. + * configure, config.in: Regenerate. + +2003-07-08 Nathanael Nerode + + * fixinc/mkfixinc.sh: Remove winnt support. + * fixinc/fixinc.winnt: Delete with extreme prejudice. + +2003-07-08 Neil Booth + + * Makefile.in: Update. + * c-opts.c (c_common_handle_option): opt_text now contains the '-'. + * c.opt: Update documentation. + * common.opt: Add some help text. + * opts.c: Include intl.h. + (wrap_help, print_help): New. + (find_opt, handle_option, common_handle_option): opt_text now + contains the '-'. Use print_help to output help. + * opts.h (struct cl_option): New member "help". + * opts.sh: Update to handle help text output and to prepend + options with '-'. + * toplev.c (display_help): Remove some help text. + +2003-07-07 David Edelsohn + Fariborz Jahanian + + * configure.in: Test for PowerPC mfcr field support in assembler. + * config.in, configure: Regenderated. + + * config/rs6000/power4.md: Add mfcrf reservation. + * config/rs6000/rs6000-protos.h (mfcr_operation): Declare. + * config/rs6000/rs6000.c (mfcr_operation): Define. + (print_operand): Add 'Q' case for mfcrf. + * config/rs6000/rs6000.h (TARGET_MFCRF): New. + * config/rs6000/rs6000.md (attribute "type"): Add mfcrf. + (movcc_internal1): Emit optional field operand for mfcr and set + "type" attribute appropriately. + (mfcr SCC): Likewise. + (movesi_from_cr_one): New. + +2003-07-07 Roger Sayle + + * config/i386/i386.md: Correct check-in of incorrect version. + +2003-07-07 Kaveh R. Ghazi + + * bitmap.c (debug_bitmap_file): Merge uses of HOST_PTR_PRINTF with + adjacent stdio calls. + * c-decl.c (c_print_identifier): Likewise. + * mips-tfile.c (write_varray, write_object, allocate_cluster): Likewise. + * print-rtl.c (print_rtx): Likewise. + * print-tree.c (print_node_brief, print_node): Likewise. + * system.h (HOST_PTR_PRINTF): Ensure we have a literal string. + + * configure.in (AC_COMPILE_CHECK_SIZEOF): Check for `void *'. + * config.in, configure: Regenerated. + +2003-07-07 Roger Sayle + + PR target/10979 + * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3): + Changed to define_expand patterns that copy operand[1] to prevent + it from being clobbered before emitting an atan2?f3_1 insn. + (atan2df3_1, atan2sf3_1, atan2xf_1, atan2tf3_1): New define_insn + patterns that actually specify the behaviour of x87's FPATAN. + +2003-07-07 Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Remove bogus + clearing of SYMBOL_FLAG_LOCAL bit. + If vcall_offset fits into signed 16-bit immediate, use + one instruction for both addition and load. + +2003-07-07 Neil Booth + + * opts.c (common_handle_option): Correct handling of the + -falign- switches that do and don't take an argument. + +2003-07-07 Kazu Hirata + + * config/h8300/h8300.md (pushqi1_h8300hs): Revert my patch + today. + (pushhi1_h8300hs): Likewise. + +2003-07-07 Andreas Jaeger + + * genextract.c: Convert remaining prototypes to ISO C90. + + * cpplex.c (_cpp_free_buff): Convert prototype to ISO C90. + * fold-const.c (fold_single_bit_test): Likewise. + * diagnostic.c (default_diagnostic_finalizer): Likewise. + * cfgrtl.c (rtl_redirect_edge_and_branch): Likewise. + + * gengtype.c (write_array): Generate ISO C90 prototypes. + + * genflags.c (gen_proto): Generate ISO C90 prototypes. + +2003-07-07 Roger Sayle + + PR optimization/11059 + * expr.c (can_store_by_pieces): Return true if length is zero. + (store_by_pieces): If length is zero and endp is two, abort, + othwerise, if length is zero and endp is not two, return "to". + (clear_by_pieces): Do nothing if length is zero. + (clear_storage): Do nothing if length is zero. + (store_constructor): Simplify code when size is zero, or the + target has already been cleared. This avoids emitting a + blockage instruction when initializing empty structures. + +2003-07-07 Andreas Jaeger + + * mips-tfile.c: Convert prototypes to ISO C90. + * mips-tdump.c: Convert prototypes to ISO C90. + +2003-07-07 Nathan Sidwell + + * rtl.h (emit_line_note): Take a location_t. + (emit_line_note_force): Remove. + (set_file_and_line_for_statement): Take a location_t. + * tree.g (emit_line_note): Take a location_t. + * emit-rtl.c (emit_line_note): Take a location_t. + (emit_line_note_force): Remove. + * function.c (init_function_start): Adjust emit_line_note call. + (expand_function_end): Use force_next_line_note, not + emit_line_note_force. + * c-parse.in (maybe_type_qual): Adjust emit_line_note calls. + * c-semantics.c (genrtl_do_pushlevel, genrtl_goto_stmt, + genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, + genrtl_while_stmt, genrtl_do_stmt_1, genrtl_return_stmt, + genrtl_for_stmt, genrtl_break_stmt, genrtl_continue_stmt, + genrtl_continue_stmt, genrtl_switch_stmt, + genrtl_asm_stmt): Likewise. + * expr.c (expand_expr): Likewise. + * integrate.c (expand_inline_function): Likewise. + * stmt.c (set_file_and_line_for_stmt): Take a location_t. + (expand_decl_init): Adjust emit_line_note call. + +2003-07-07 Dale Johannesen + + * config/rs6000/darwin-tramp.asm: Fix trampolines. PR 10900. + +2003-07-07 Andreas Jaeger + + * config/i386/i386-protos.h: Convert prototypes to ISO C90. + * config/i386/i386.c: Likewise. + +2003-07-07 Kazu Hirata + + * config/h8300/h8300.md: Use gen_int_mode instead of + GEN_INT (trunc_int_for_mode (...)). + +2003-07-07 Kazu Hirata + + * config/h8300/h8300.md (pushqi1_h8300hs): Optimize by pushing + 2 bytes and then subtract 2 from the stack pointer. + (pushhi1_h8300hs): Likewise. + +2003-07-07 Nathan Sidwell + + * configure.in (enable_coverage): Remove -DSELF_COVERAGE, add + -frandom-seed. + * configure: Regenerated. + * Makefile.in: Remove extraneous comment. + * toplev.c (randomize): Protect against potential multiple calls. + * doc/invoke.texi (-frandom-seed): Document use for in coverage + files. + +2003-07-07 Richard Kenner + Eric Botcazou + + PR optimization/11198 + * alias.c (objects_must_conflict_p): Return 1 if the types have + the same alias set, not if the alias sets only conflict. + +2003-07-07 Andrew Pinski + + * cppcharset.c (ICONV_CONST): Define iff !HAVE_ICONV. + (convert_cset): Change inbuf to type ICONV_CONST char. + * Makefile.in (LIBS): Add LIBICONV. + + * doc/invoke.texi (-falign-functions): Document that + when n is zero then a machine-dependent default is used. + (-falign-labels): Document that when n is zero then a + machine-dependent default is used and that -falign-labels =1 + is equivalent to -fno-align-labels. + (-falign-loops): Likewise. + (-falign-jumps): Likewise. + +2003-07-06 Art Haas + + * f/global.c (ffeglobal_type_string_): Fix obsolete GCC array + initializer syntax. + +2003-07-06 James E Wilson + + PR optimization/9812 + * rtl.h (mem_for_const_double): Delete prototype. + * varasm.c (mem_for_const_double): Delete function. + * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68kelf.h, + config/m68k/m68kv4.h, config/m68k/netbsd-elf.h + (LEGITIMATE_PIC_OPERAND_P): Delete duplicate definitions. + * config/m68k/m68k.h (LEGITIMATE_CONSTANT_P): Disallow XFmode. + (LEGITIMATE_PIC_OPERAND_P): Delete CONST_DOUBLE tests. + * config/m68k/m68k.md (movxf): Add reload_in_progress guard. Add + comment about confused support for XFmode constants. + +2003-07-07 Jan Hubicka + + * cfglayout.c (fixup_reorder_chain): Call delete_dead_jumptables. + +2003-07-06 Kazu Hirata + + * config/h8300/h8300.c: Fix comment typos. + * config/h8300/h8300.md: Likewise. + * config/i386/athlon.md: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/pentium.md: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/itanium1.md: Likewise. + * config/ia64/itanium2.md: Likewise. + * config/m32r/m32r.md: Likewise. + * config/m68hc11/m68hc11.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mips/sr71k.md: Likewise. + * config/mips/t-iris5-as: Likewise. + * config/mmix/mmix.h: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/ns32k/NOTES: Fix a typo. + +2003-07-06 Andreas Jaeger + + * stmt.c: Convert remaining prototypes to ISO C90. + * cfglayout.c: Likewise. + * dbxout.c: Likewise. + * gcc.c: Likewise. + * genemit.c: Likewise. + + * basic-block.h: Convert prototypes to ISO C90. + * c-parse.in: Likewise. + * c-pragma.h: Likewise. + * c-typeck.c: Likewise. + * cfghooks.h: Likewise. + * cfgloopanal.c: Likewise. + * dbxout.h: Likewise. + * debug.h: Likewise. + * dwarf2asm.h: Likewise. + * gcov.c: Likewise. + * gengtype-lex.l: Likewise. + * sched-int.h: Likewise. + * timevar.c: Likewise. + +2003-07-06 Neil Booth + + * c-common.h (c_comon_handle_filename, + c_common_missing_arguement): New. + * c-lang.c (LANG_HOOKS_HANDLE_FILENAME, + LANG_HOOKS_MISSING_ARGUMENT): New. + * c-opts.c (missing_arg): Rename c_common_missing_argument, + update to be an appropriate langhook. + (c_common_handle_option): Don't handle filenames. + (c_common_handle_filename): New. + * hooks.c (hook_void_constcharptr, + hook_bool_constcharptr_size_t_false): New. + * hooks.h (hook_void_constcharptr, + hook_bool_constcharptr_size_t_false): New. + * langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME, + LANG_HOOKS_MISSING_ARGUMENT): New. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (struct lang_hooks): Add handle_filename and + missing_argument. + * opts.c (handle_option): Don't handle filenames here, but ... + (handle_options): ... here. + (common_handle_option): Don't handle missing arguments here. + * objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME, + LANG_HOOKS_MISSING_ARGUMENT): New. + +2003-07-06 Neil Booth + + * Makfile.in: Remove traces of mbchar. + * c-parse.in (MULTIBYTE_CHARS): Remove. + * config.in (MULTIBYTE_CHARS): Remove. + * configure: Remove --enable-mbchar. + * configure.in: Remove --enable-mbchar. + * mbchar.c, mbchar.h: Remove. + * system.h: Poison MULTIBYTE_CHARS. + * config/linux-aout.h (MULTIBYTE_CHARS): Remove. + * config/linux.h (MULTIBYTE_CHARS): Remove. + * config/svr4.h (MULTIBYTE_CHARS): Remove. + * config/sparc/linux.h (MULTIBYTE_CHARS): Remove. + +2003-07-06 Andreas Jaeger + + * varray.c (varray_check_failed): Fix typo. + + * unroll.c: Convert prototypes to ISO C90. + * varasm.c: Likewise. + * varray.c: Likewise. + * varray.h: Likewise. + * vmsdbgout.c: Likewise. + * xcoffout.c: Likewise. + * xcoffout.h: Likewise. + +2003-07-06 Nathan Sidwell + + * gcov-io.h: Add a local time stamp. + (struct gcov_info): Add stamp field. + (gcov_truncate): New. + * coverage.c (read_counts_file): Skip the stamp. + (coverage_begin_output): Write the stamp. + (build_gcov_info): Declare and init the stamp. + (coverage_finish): Only unlink data file, if stamp is zero. + * gcov-dump.c (dump_file): Dump the stamp. + * gcov.c (bbg_stamp): New. + (release_structures): Clear bbg_stamp. + (read_graph_file): Read stamp. + (read_count_file): Check stamp. + * libgcov.c (gcov_exit): Check stamp and truncate if needed. + +2003-07-06 Nathan Sidwell + + * tree.h (default_flag_random_seed): Remove. + * toplev.h (local_tick): Declare. + * tree.c (flag_random_seed, default_flag_random_seed): Move to + toplev.c. + (append_random_chars): Don't call default_flag_random_seed. + * toplev.c (flag_random_seed): Define here. Set local_tick. + (local_tick): Define. + (randomize): New, moved from tree.c. + (print_switch_values): Adjust. + (toplev_main): Call randomize. + +2003-07-06 Nathan Sidwell + + * tree.h (crc32_string): Declare. + * tree.c (append_random_chars): Remove. + (crc32_string): New. + (get_file_function_name_long): Use crc32_string here. + +2003-07-06 Andreas Jaeger + + * gcc.c: Convert prototypes to ISO C90. + * gcc.h: Likewise. + * gcov-dump.c: Likewise. + * gcov-iov.c: Likewise. + * gcse.c: Likewise. + * genattrtab.h: Likewise. + * ggc.h: Likewise. + * global.c: Likewise. + * graph.c: Likewise. + * graph.h: Likewise. + * hosthooks.h: Likewise. + * hooks.h: Likewise. + * hooks.c: Likewise. + * hashtable.h: Likewise. + * hashtable.c: Likewise. + * haifa-sched.c: Likewise. + * integrate.h: Likewise. + * integrate.c: Likewise. + * input.h: Likewise. + * ifcvt.c: Likewise. + * jump.c: Likewise. + * langhooks-def.h: Likewise. Add extern to prototypes. + * langhooks.c: Likewise. + * langhooks.h: Likewise. + * lcm.c: Likewise. + * local-alloc.c: Likewise. + * loop-init.c: Likewise. + * loop-unroll.c: Likewise. + * loop-unswitch.c: Likewise. + * loop.c: Likewise. + * loop.h: Likewise. Add extern to prototypes. + * machmode.h: Likewise. + * main.c: Likewise. + * mbchar.c: Likewise. + * mbchar.h: Likewise. + * mkdeps.c: Likewise. + * mkdeps.h: Likewise. + * optabs.c: Likewise. + * optabs.h: Likewise. + * output.h: Likewise. + * gccspec.c: Likwise. + * postreload.c: Likewise. + * prefix.c: Likewise. + * prefix.h: Likewise. + * print-rtl.c: Likewise. + * print-tree.c: Likewise. + * profile.c: Likewise. + * read-rtl.c: Likewise. + * real.c: Likewise. + * real.h: Likewise. + * recog.c: Likewise. + * recog.h: Likewise. + * reg-stack.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * regrename.c: Likewise. + * regs.h: Likewise. + * reload.c: Likewise. + * reload.h: Likewise. + * reload1.c: Likewise. + * reorg.c: Likewise. + * resource.c: Likewise. + * resource.h: Likewise. + * rtl-error.c: Likewise. + * rtl.c: Likewise. + * rtl.h: Likewise. + * rtlanal.c: Likewise. + * sbitmap.c: Likewise. + * sbitmap.h: Likewise. + * scan-decls.c: Likewise. + * scan.c: Likewise. + * sched-deps.c: Likewise. + * sched-ebb.c: Likewise. + * sched-int.h: Likewise. + * sched-rgn.c: Likewise. + * sched-vis.c: Likewise. + * sibcall.c: Likewise. + * simplify-rtx.c: Likewise. + * sreal.c: Likewise. + * sreal.h: Likewise. + * ssa-ccp.c: Likewise. + * ssa-dce.c: Likewise. + * ssa.c: Likewise. + * ssa.h: Likewise. + * stack.h: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * stringpool.c: Likewise. + * target.h: Likewise. + * timevar.c: Likewise. + * timevar.h: Likewise. + * tlink.c: Likewise. + * tracer.c: Likewise. + * tree-inline.c: Likewise. + * tree-inline.h: Likewise. + * tree.c: Likewise. + * tree.h: Likewise. + +2003-07-05 Kazu Hirata + + * combine.c (nonzero_bits1): Fix a warning. + +2003-07-05 Kazu Hirata + + * config/h8300/h8300.c (compute_mov_length): Correct the + length of loading CONST0_RTX (SFmode). + +2003-07-05 Nathan Sidwell + + * toplev.c (output_clean_symbol_name): Remove. + * toplev.h (output_clean_symbol_name): Remove. + * config/alpha/alpha.c (unicosmk_output_module_name): Use + lbasename & clean_symbol_name. + +2003-07-05 Kazu Hirata + + * ggc.h: Follow spelling conventions. + * config/i386/i386.c: Likewise. + * config/i386/winnt.c: Likewise. + * config/rs6000/rs6000.c: Likewise. + +2003-07-05 Kazu Hirata + + * bt-load.c: Fix comment typos. + * c-incpath.c: Likewise. + * cfg.c: Likewise. + * cfgcleanup.c: Likewise. + * cfgloop.h: Likewise. + * cfgloopmanip.c: Likewise. + * cfgrtl.c: Likewise. + * diagnostic.h: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * et-forest.c: Likewise. + * et-forest.h: Likewise. + * expr.c: Likewise. + * gcse.c: Likewise. + * genattr.c: Likewise. + * jump.c: Likewise. + * langhooks.h: Likewise. + * local-alloc.c: Likewise. + * loop-unroll.c: Likewise. + * loop-unswitch.c: Likewise. + * ra-build.c: Likewise. + * regclass.c: Likewise. + * regmove.c: Likewise. + * rtl.def: Likewise. + * rtlanal.c: Likewise. + * sched-ebb.c: Likewise. + * sched-rgn.c: Likewise. + * simplify-rtx.c: Likewise. + * ssa.c: Likewise. + * tracer.c: Likewise. + * tree.c: Likewise. + +2003-07-05 Zack Weinberg + + * cppcharset.c: Use the correct return type for the fallback iconv + macro. + +2003-07-05 Zdenek Dvorak + + Blame to Jan Hubicka + * cfglayout.c (record_effective_endpoints): Split insns before + first basic block correctly. + +2003-07-05 Richard Kenner + + * expr.c (expand_expr, case COMPONENT_REF): When seeing if should use + bitfield operations, use STRICT_ALIGNMENT, not SLOW_UNALIGNED_ACCESS + if EXPAND_CONST_ADDRESS or EXPAND_INITIALIZER. + +2003-07-05 Andreas Jaeger + + * genattrtab.c (write_attr_get): Revert part of last patch to + always write out a prototype. + + * genemit.c (gen_split): Readd lost unused attributes in last + patch. + +2003-07-05 Zdenek Dvorak + + * cfgloopmanip.c (force_single_succ_latches): Force latch to be + different from header. + +2003-07-05 Andreas Schwab + + * config/m68k/m68k.c: Remove code protected by CRDS. + * config/m68k/m68k.md: Likewise. + +2003-07-05 Neil Booth + + PR driver/11417 + * c-opts.c (permit_fortran_options): New. + (c_common_init_options): Accept fortran front end options if + it looks like we might be preprocessing Fortran. + (c_common_handle_option): Don't reject switch if permit_fotran_options. + +2003-07-05 Kaveh R. Ghazi + + * genattr.c (internal_dfa_insn_code): Output prototype. + * genattrtab.c: Don't output unnecessary decls, output in ISO C. + * genautomata.c: Likewise. + * genconditions.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * gengenrtl.c: Likewise. + * gengtype.c: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * genpeep.c: Likewise. + * genrecog.c: Likewise. + +2003-07-04 Zack Weinberg + + * cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types. + (struct cpp_options): Add narrow_charset, wide_charset, + bytes_big_endian fields. Remove EBCDIC field. + (cpp_init_iconv, cpp_interpret_string): New external interfaces. + + * cpphash.h: Include if we have it, otherwise + provide a dummy definition of iconv_t. + (struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields. + (_cpp_valid_ucn): Update prototype. + (_cpp_destroy_iconv): New prototype. + + * doc/cpp.texi: Document character set handling. + * doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=. + * doc/extend.texi: Delete entire section on multiline strings. + Rewrite section on __FUNCTION__ etc now that these are + variables in C. + + * cppucnid.tab, cppucnid.pl: New files. + * cppucnid.h: New generated file. + * cppcharset.c: Include cppucnid.h. Lots of commentary added. + (iconv_open, iconv, iconv_close): Provide dummy definitions + if !HAVE_ICONV. + (SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv, + _cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn, + emit_numeric_escape, convert_hex, convert_oct, convert_escape, + cpp_interpret_string, narrow_str_to_charconst, + wide_str_to_charconst): New. + (ucn_valid_in_identifier): Use a binary search through the + ucnranges table defined in cppucnid.h, not a long chain of if + statements. + (_cpp_valid_ucn): Add a limit pointer. Downgrade "universal + character names are only valid in C++ and C99" to a warning. + Issue the "meaning of \[uU] is different in traditional C" + warning here. Take care not to let iconv see an invalid UCS + value if we get a malformed UCN. Issue an error if we don't + have iconv. + (cpp_interpret_charconst): Moved here from cpplex.c. Use + cpp_interpret_string to do the heavy lifting. + + * cppinit.c (cpp_create_reader): Initialize bytes_big_endian, + narrow_charset, wide_charset fields of options structure. + (cpp_destroy): Call _cpp_destroy_iconv. + * cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn. + (maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete. + (cpp_interpret_charconst): Moved to cppcharset.c. + * cpplib.c (dequote_string): Delete. + (interpret_string_notranslate): New. + (do_line, do_linemarker): Use interpret_string_notranslate. + + * Makefile.in (cppcharset.o): Depend on cppucnid.h. + + * c-common.c (fname_string, combine_strings): Delete. + * c-common.h (fname_string, combine_strings): Delete prototypes. + * c-lex.c (ignore_escape_flag): Delete. + (cb_ident): Use cpp_interpret_string, not lex_string. + (get_nonpadding_token): New function. + (c_lex): Handle Objective-C @-prefixed identifiers and strings here. + Adjust calls to lex_string. Don't write *value twice. + (lex_string): Now handles string constant concatenation. + Most of the work handed off to cpp_interpret_string. + Call fix_string_type here. + * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with + FUNC_NAME, throughout. + (OBJC_STRING): New token type. + (primary:STRING): No need to call fix_string_type here. + (primary:objc_string): Make that OBJC_STRING. + (objc_string nonterminal): Delete. + (yylexname): Delete code to handle fake string constants. + (yylexstring): Delete entirely. + (_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need + to handle CPP_ATSIGN. + + * c.opt (-fexec-charset=, -fwide-exec-charset=): New options. + * c-opts.c (missing_arg, c_common_handle_option): Handle + OPT_fexec_charset_ and OPT_fwide_exec_charset_. + (c_common_init): Set cpp_opts->bytes_big_endian, not + cpp_opts->EBCDIC. Call cpp_init_iconv. + (print_help): Document -fexec-charset= and -fexec-wide-charset=. + (TARGET_EBCDIC): Delete default definition. + + * objc/objc-act.c (build_objc_string_object): No need to + handle string constant concatenation. + +2003-07-04 Kazu Hirata + + * doc/install.texi: Fix typos. + * doc/invoke.texi: Likewise. + * doc/tm.texi: Likewise. + +2003-07-04 Kazu Hirata + + * config/pa/fptr.c: Fix comment typos. + * config/pa/pa-64.h: Likewise. + * config/pa/pa.c: Likewise. + * config/pa/pa.h: Likewise. + * config/rs6000/603.md: Likewise. + * config/rs6000/7xx.md: Likewise. + * config/rs6000/darwin.h: Likewise. + * config/rs6000/freebsd.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/rs6000/spe.h: Likewise. + +2003-07-04 Ulrich Weigand + + * config/s390/2064.md: Change GNU CC to GCC. + * config/s390/2084.md: Likewise. + * config/s390/fixdfdi.h: Likewise. + * config/s390/linux.h: Likewise. + * config/s390/s390-modes.def: Likewise. + * config/s390/s390-protos.h: Likewise. + * config/s390/s390.c: Likewise. + * config/s390/s390.h: Likewise. + * config/s390/s390.md: Likewise. + * config/s390/s390x.h: Likewise. + +2003-07-04 Jeff Law + + PR c/11428 + * expr.c (do_store_flag): Pass in the correct result type + when calling fold_single_bit_test. + * fold-const.c (fold_single_bit_test): Use result_type for the + result when folding a sign bit test. + +2003-07-04 Neil Booth + + * opts.c (common_handle_options): Negate sense of -falign- switches. + +2003-07-04 H.J. Lu + + * Makefile.in: Replace PWD with PWD_COMMAND. + +2003-07-04 Zdenek Dvorak + + * cfgloopanal.c (count_strange_loop_iterations): New static function. + (constant_iterations, count_loop_iterations, simple_loop_exit_p): + Handle strange loops. + +2003-07-04 Toon Moene + + * install.texi: Even the g77 manpage is derived from + the full g77 manual. + +2003-07-04 Zack Weinberg + + * ABOUT-NLS: Delete. + * intl: Delete entire directory. + * aclocal.m4: Include ../config/gettext.m4. Delete + AC_ISC_POSIX, AM_LANGINFO_CODESET, jm_GLIBC21, AM_LC_MESSAGES, + AM_PATH_PROG_WITH_TEST, AM_WITH_NLS, and AM_GNU_GETTEXT. + * configure.in: Use CY_GNU_GETTEXT, not AM_GNU_GETTEXT. + Remove intl/Makefile from all_outputs. + * configure, config.in: Regenerate. + * Makefile.in: Expunge all references to intl subdirectory. + Add -I../intl to INCLUDES. + * intl.h: Include libintl.h if and only if ENABLE_NLS is defined. + +2003-07-04 Roger Sayle + + * config/rs6000/aix51.h (TARGET_C99_FUNCTIONS): Define. + * config/rs6000/aix52.h (TARGET_C99_FUNCTIONS): Likewise. + +2003-07-04 Danny Smith + + PR c++/5287, PR c++/7910, PR c++/11021 + * config/i386/winnt.c (ix86_handle_dll_attribute): Don't add + dllimport attribute if function is defined at declaration, but + report error instead. Likewise for dllimport'd variable + definitions. Set implicit TREE_PUBLIC for dllimport'd variables + declared within functions, Report error if dllimport or dllexport + symbol is not global. + (i386_pe_dllimport_p): Ignore dllimport attribute of functions + if defined after declaration or if inlined. Don't allow definition + of static data members of C++ classes. Don't dllimport virtual + methods. + (i386_pe_mark_dllexport): Warn about inconsistent dll attributes. + (i386_pe_mark_dllimport): Remove unnecessary checks. + (i386_pe_encode_section_info): Warn if the dllimport attribute + and symbol prefix have been instantiated and then overridden. + + * doc/extend.texi: Document dllimport and dllexport attributes. + + * config/i386/winnt.c (i386_pe_output_labelref): Fix indents. + +2003-07-03 Uwe Stieber + + * config/kaos.h (CPP_PREDEFINES): Delete. + (TARGET_OS_CPP_BUILTINS): New. + +2003-07-03 Kaveh R. Ghazi + + * c-aux-info.c: Include toplev.h after c-tree.h. + * c-common.c: Likewise. + (GCC_DIAG_STYLE): Undef. + * c-semantics.c (GCC_DIAG_STYLE): Define. + * c-tree.h (GCC_DIAG_STYLE): Likewise. + * diagnostic.h (inform): Move prototype to toplev.h. + * jump.c: Include diagnostic.h before toplev.h. + * toplev.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG): Define. + (warning, error, fatal_error, pedwarn, sorry, inform, + error_for_asm, warning_for_asm): Mark with ATTRIBUTE_GCC_CXXDIAG. + +2003-07-03 Zdenek Dvorak + + * cfglayout.c (cfg_layout_duplicate_bb): Do not update frequencies + at all if edge is not specified. + (can_copy_bbs_p, copy_bbs): New. + * cfglayout.h (can_copy_bbs_p, copy_bbs): Declare. + * cfgloop.c (get_loop_body): Comment more precisely. + * cfgloopmanip.c (copy_bbs, record_exit_edges): Removed. + (scale_bbs_frequencies): Fix comment typo. + (can_duplicate_loop_p): Use can_copy_bbs_p. + (duplicate_loop_to_header_edge): Simplify by using copy_bbs. + +2003-07-03 Devang Patel + + * c-opts.c (c_common_parse_file): Remove extra + debug_hooks->start_source_file call. + +2003-07-03 Roger Sayle + + * real.c (real_trunc, real_floor, real_ceil): New functions + to implement trunc, floor and ceil respectively. + * real.h (real_trunc, real_floor, real_ceil): Prototype here. + * builtins.c (integer_valued_real_p): New function to test if + a floating point expression has an integer valued result. + (fold_trunc_transparent_mathfn): Optimize foo(foo(x)) as + foo(x) where foo is an integer rounding function. Similarly, + optimize foo(bar(x)) as bar(x), and foo((double)(int)x) as + (double)(int)x when both foo and bar are integer rounding + functions and we don't need to honor errno. + (fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil): + New functions to fold trunc, floor and ceil. + (fold_builtin): Use fold_builtin_trunc to fold BUILT_IN_TRUNC*, + fold_builtin_floor to fold BUILT_IN_FLOOR* and fold_builtin_ceil + to fold BUILT_IN_CEIL*. + * fold-const.c (tree_expr_nonnegative_p): Handle FLOAT_EXPR and + the remaining integer rounding functions. + +2003-07-03 Eric Botcazou + + * config/sparc/sparc.c (function_arg_partial_nregs): Use + SPARC_INT_ARG_MAX to determine where to split unnamed + complex FP arguments. + +2003-07-03 Jan Hubicka + + * basic-block.h (create_basic_block, merge_blocks_nomove): Kill. + * cfgcleanup.c (merge_blocks): Rename to merge_blocks_move. + (merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps): Use merge_blocks. + (try_optimize_cfg): Use merge_blocks_move. + * cfgrtl.c (create_basic_block): Rename to rtl_create_basic_block. + (merge_blocks_nomove): Rename to rtl_merge_blocks. + (cfg_layout_create_basic_block): New. + (rtl_can_merge_blocks): New. + (cfg_layout_split_block): Do not alloc aux by hand. + * cfghooks.h (cfg_hooks): Add create_basic_block, can_merge_blocks_p, + merge_blocks. + (create_basic_block, can_merge_blocks_p, merge_blocks): New macros. + * cfglayout.c (cfg_layout_duplicate_bb): Do not allocate aux by hand. + * cfgloopmanip.c (loop_split_edge_with): Likewise. + * ifcvt.c (merge_if_block): Use merge_blocks_nomove. + + * basic-block.h (basic_block_def): Add field 'rbi'. + * bb-reorder.c (find_traces, rotate_loop, mark_bb_visited, + find_traces_1_round, copy_bb, connect_traces): Update use of rbi. + * cfg.c (entry_exit_blocks): Add new field. + * cfglayout.c: Include alloc-pool.h; + (cfg_layout_pool): New. + (record_effective_endpoints, fixup_reorder_chain, + fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update use + of rbi. + (cfg_layout_initialize_rbi): New function. + (cfg_layout_initialize): Use it. + (cfg_layout_finalize): Clear rbi fields. + * cfglayout.h (RBI): Kill. + (cfg_layout_initialize_rbi): Declare. + * cfgloopmanip.c (copy_bbs): Use rbi. + (record_exit_edges): Likewise. + (duplicate_loop_to_header_edge): Likewise. + * cfgrtl.c (cfg_layout_create_basic_block): Use + cfg_layout_initialize_rbi. + (cfg_layout_split_block): Use rbi. + (cfg_layout_delete_block): Likewise. + * loop-init.c (loop_optimizer_finalize): Likewise. + * loop-unswitch.c (unswitch_loop): Likewise. + * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. + + * cfgrtl.c: Update comments. + (try_redirect_by_replacing_jump): New argument. + (redirect_branch_edge): Break out from ... + (rtl_redirect_edge_and_branch): ... this one. + (update_cfg_after_block_merging): Break out from ... + (rtl_merge_blocks): ... this one. + (cfg_layout_split_edge): New. + (cfg_layout_merge_blocks): New. + (cfg_layout_can_merge_blocks_p): New. + (cfg_layout_redirect_edge_and_branch): Reorganize. + (cfg_layout_rtl_cfg_hooks): Fill in. + (cfg_layout_delete_block): Kill barriers. + * cfganal.c (can_fallthru): Deal with exit blocks + * cfglayout.c (cfg_layout_function_header): New function + (record_effective_endpoints): Record function header. + (fixup_reorder_chain): Fixup dead jumptables; place header + + * basic-block.h (CLEANUP_CFGLAYOUT): New flag. + * bb-reorder.c (cfg_layout_initialize): Update call. + * cfgcleanup.c (try_optimize_cfg): Supress optimizations of fallthru + edges in cfglayout mode. + * cfglayout.c (cleanup_unconditional_jumps): Kill. + (cfg_layout_initialize): Kill agrument loops; use cfgcleanup. + * cfglayout.h (cfg_layout_initialize): Update prototype. + * cfgloop.h (CP_INSIDE_CFGLAYOUT): Kill. + * cfgloopmanip.c (loop_split_edge_with): Use split_edge. + * flow.c (propagate_block): Do not crash when basic block ends + by first insn in the chain. + * loop-init.c (loop_optimizer_init): First enter cfglayout mode; later + do loop discovery. + * tracer.c (tracer): Update call of cfg_layout_initialize. + +2003-07-03 Kaveh R. Ghazi + + * Makefile.in: Use dependency variables in lieu of explicit + files throughout. + +2003-07-03 Steven Bosscher + + * rtl.h (ECF_*, flags_from_decl_or_type): Move from here... + * tree.h: ...to here. + +2003-07-03 Kazu Hirata + + * config/s390/2064.md: Fix comment typos. + * config/s390/2084.md: Likewise. + * config/s390/s390.c: Likewise. + * config/s390/s390.md: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + * config/sh/sh.md: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/stormy16/stormy-abi: Fix a typo. + +2003-07-03 Kelley Cook + + * Makefile.in (ifcvt.o): Depend on OPTABS_H. + +2003-07-03 Kaveh R. Ghazi + + * config/mips/mips.h (save_argv): Delete. + +2003-07-03 Roger Sayle + + PR target/10700 + * fold-const.c (extract_muldiv_1): There's nothing that can be done + if the expression is a SAVE_EXPR. + +2003-07-03 Kazu Hirata + + * config/m32r/m32r.c: Fix comment typos. + * config/m68hc11/m68hc11.c: Likewise. + * config/m68hc11/m68hc11.h: Likewise. + * config/m68k/m68k.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mcore/mcore.h: Likewise. + * config/mcore/mcore.md: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.h: Likewise. + * config/mips/mips.md: Likewise. + * config/mips/netbsd.h: Likewise. + * config/mn10300/mn10300.c: Likewise. + +2003-07-03 Andreas Schwab + + * dbxout.c (pending_bincls): Move decl down inside + DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO section. + +2003-07-02 Nathan Sidwell + + * rtl.h (NOTE_DATA): Refer to whole union. + * emit-rtl.c (emit_note): Use memset to clear NOTE_DATA. + +2003-07-03 Eric Botcazou + + PR optimization/11381 + * simplify-rtx.c (simplify_relational_operation): Check that + two equal operands have no side-effects before simplifying + the comparison. + +2003-07-02 Jeff Law + + * expr.c (do_store_flag): Remove special case folding for + single bit tests. Instead call back into the commonized folder + routine. + * fold-const.c (fold_single_bit_test): New function, mostly + extracted from do_store_flag, with an additional case extracted + from fold. + (fold): Call fold_single_bit_test appropriately. + * tree.h (fold_single_bit_test): Prototype. + +2003-07-02 Zack Weinberg + + * system.h: Include filenames.h. + (IS_DIR_SEPARATOR, IS_ABSOLUTE_PATHNAME): Don't define. + (DIR_SEPARATOR, DIR_SEPARATOR_2): If not already defined, + define based on HAVE_DOS_BASED_FILE_SYSTEM. + * config/i386/xm-cygwin.h, config/i386/xm-djgpp.h + * config/i386/xm-mingw32.h: Don't define + HAVE_DOS_BASED_FILE_SYSTEM, + DIR_SEPARATOR, or DIR_SEPARATOR_2. + * doc/hostconfig.texi: Update to match. + + * cppfiles.c, gcc.c, gensupport.c, protoize.c, + config/i386/cygwin.h: + Use IS_ABSOLUTE_PATH throughout. + * gcc.c (DIR_UP): Delete, unused. + * protoize.c (IS_SAME_PATH): Define in terms of + FILENAME_CMP. + (is_abspath): Delete. + +2003-07-02 Kazu Hirata + + * config/i386/emmintrin.h: Fix comment typos. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/sco5.h: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/itanium2.md: Likewise. + +2003-07-02 H.J. Lu + + * dbxout.c (pending_bincls): Replace DBX_USE_BINCLS with + DBX_USE_BINCL. + (emit_bincl_stab): Same. + (emit_pending_bincls): Same. + +2003-07-02 Kazu Hirata + + * config/h8300/h8300.c (compute_mov_length): Fix the length of + loading CONST0_RTX (SFmode). + * config/h8300/h8300.h (CONST_DOUBLE_OK_FOR_LETTER_P): Change + 'G' to CONST0_RTX (SFmode). + * config/h8300/h8300.md (movsf_h8300): Change the first + constraint to 'G'. + (movsf_h8300h): Likewise. + +2003-07-02 Neil Booth + + * c-common.h (c_common_init_options): New prototype. + * c-opts.c (deferred_size): Remove. + (defer_opt): Array is now pre-allocated. + (c_common_init_options): Pre-allocate deferred_opts. Make + lang_flags unsigned. + (push_command_line_options): Free deferred_opts. + * hooks.c (hook_uint_uint_constcharptrptr_0): New. + * hooks.h (hook_uint_uint_constcharptrptr_0): New. + * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): Update. + * langhooks.h (struct lang_hooks): New prototype for init_options. + * main.c (main): Cast argv. + * opts.c (handle_option, handle_options): Update prototypes. + (decode_options): save_argc, save_argv are not global. Constify. + * opts.h (decode_options): New prototype. + * toplev.c (general_init): New protoype. + (save_argv): Make static. + (save_argc): Remove. + (print_switch_values, general_init): Constify. + (toplev_main): Save argv. + * toplev.h (toplev_main): Update prototype. + (save_argc, save_argv): Remove. + +2003-07-02 David Edelsohn + + * dbxout.c (pending_bincls): Guard with DBX_USE_BINCLS. + (emit_bincl_stab): Same. + (emit_pending_bincls): Same. + +2003-07-02 Nathan Sidwell + + PR c++/11072 + * ginclude/stddef.h (offsetof): Remove cast to 'char &'. Explain why. + +2003-07-02 Andreas Schwab + + * dbxout.c (pending_bincls): Only define if DBX_DEBUGGING_INFO. + +2003-07-02 Eric Botcazou + + PR optimization/11210 + * expr.c (handled_component_p) [NOP_EXPR]: Add ??? note + about the behaviour with regard to bitfields. + * fold-const (decode_field_reference): Record outermost type in + case the expression is a NOP. Strip all NOPs. Set the signedness + to that of the outermost type (if any) when the bitsize is equal + to the size of the type. + +2003-07-02 Richard Sandiford + + * config/mips/mips.md (addsi3): Remove workaround for adds of -32768. + (addsi3_internal, adddi3, adddi3_internal_2): Likewise. + (adddi3_internal_3, addsi3_internal_2): Likewise. + +2003-07-02 Richard Sandiford + + * config/mips/mips.c (machine_function): Add new fields: + ignore_hazard_length_p and all_noreorder_p. + (mips_flag_delayed_branch): New variable. + (override_options): Treat '/' as an operand punctuation character. + Set up mips_flag_delayed_branch. + (print_operand): Handle '/'. + (mips_output_function_prologue): Put the whole function in + .set noreorder and .set nomacro if all_noreorder_p is true. + (mips_output_function_epilogue): End the noreorder/nomacro sequence. + (mips16_optimize_gp): Remove "first insn" parameter. + (mips16_lay_out_constants): New function, split out from mips_reorg. + (mips_avoid_hazard, mips_avoid_hazards): New functions. + (mips_reorg): For mips16 code, call mips16_lay_out_constant + and (optionally) mips16_optimize. If TARGET_EXPLICIT_RELOCS, + do delayed-branch scheduling followed by hazard detection. + (mips_adjust_insn_length): Only account for hazards if + !ignore_hazard_length_p. + (mips_output_load_label): Add a nop to the o32 sequence if + the target suffers from load delays. + (mips_output_conditional_branch): Add %/ to the end of branches. + (mips_output_division): Fill the branch delay slot with %#. + * config/mips/mips.md: Remove redundant '%*' from mips16 branch + instructions. End all other %* branches with %/. + (ffssi2, ffsdi2): Fix lengths. + (truncdisi2, truncdihi2, truncdiqi2): Add store attributes. + (fix_truncdfsi2_macro): Turn off .set nomacro if appropriate. + (fix_truncsfsi2_macro): Likewise. + (mov_lwl): Set hazard to "none". + (ashldi3_internal): Fill the branch delay slot with %#. + (ashrdi3_internal, lshrdi3_internal): Likewise. + (exception_receiver): Explicitly set $28. + (hazard_nop): New pattern. + +2003-07-02 Jan Hubicka + + * cgraphunit.c (cgraph_finalize_unit): Set current_function_decl + before calling tree_inlinable_function_p. + +2003-07-02 Rainer Orth + + * fixinc/inclhack.def (irix_stdio_va_list): Apply to IRIX 6.5 + too. + (stdio_va_list): Apply to IRIX 6.5 and + too. + Substitute va_list uses in inline definition. + * fixinc/fixincl.x: Regenerate. + +2003-07-02 Rainer Orth + + * config/mips/iris5.h (SET_FILE_NUMBER): Moved here from iris3.h. + Undef before redefinition. + (LABEL_AFTER_LOC): Likewise. + (DEFAULT_SIGNED_CHAR): Likewise. + (ASM_OUTPUT_ASCII): Moved here from iris4.h. + Fix IRIX spelling. + + * config/mips/iris3.h: Remove, unused. + * config/mips/iris4.h: Likewise. + + * config/mips/mips.h (STACK_ARGS_ADJUST): Remove, unused. + + * config/mips/iris5.h (TARGET_DEFAULT): Move ... + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): ... here to + target_cpu_default. + + * config/mips/iris5.h: Move explicit includes ... + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): ... here. + + * config/mips/iris6.h (MIPS_ISA_DEFAULT, MIPS_ABI_DEFAULT): Move ... + * config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here to + tm_defines. + + * config/mips/iris6.h (TARGET_DEFAULT): Move ... + * config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here to + target_cpu_default. + + * config/mips/iris6.h: Fix IRIX spelling. + (MULTILIB_DEFAULTS): Undef before redefinition. + + * config/mips/iris6.h: Move explicit includes ... + * config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here. + +2003-07-02 Jan Hubicka + + * cgraph.c (cgraph_mark_needed_node, cgraph_varpool_mark_needed_node, + cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls): + Use next_needed field instead of aux to maintain the queue. + * cgraph.h (cgraph_node): Add next_needed. + (cgraph_varpool_node): Add next_needed; remove aux. + * cgraphunit.c (cgraph_finalize_compilation_unit): Use next_needed. + +2003-07-02 Jan Hubicka + + * cgraphunit.c (cgraph_finalize_function): Set finalized. + (cgraph_finalize_function): Do not examine inlinablility. + (cgraph_finalize_compilation_unit): Do it here. + * cgraph.h (cgraph_local_info): Add finalized field. + +2003-07-02 Rainer Orth + + * ggc-common.c (gt_pch_save): Cast MAP_FAILED to void *. + (gt_pch_restore): Likewise. + +2003-07-01 Kazu Hirata + + * config/alpha/alpha.c: Fix comment typos. + * config/alpha/elf.h: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/t-arm-coff: Likewise. + * config/arm/t-strongarm-pe: Likewise. + * config/arm/xscale-elf.h: Likewise. + * config/avr/avr.h: Likewise. + +2003-07-01 Jeff Law + + * stmt.c (any_pending_cleanups): Remove another redundant test. + +2003-07-01 David Edelsohn + J"orn Rennecke + + * config/rs6000/rs6000.md (ctr{s,d}i_internal?): Add earlyclobber + for MEM case. + +2003-07-01 Devang Patel + + * dbxout.c (DBXOUT_DECR_NESTING): Emit pending bincls, if required. + (binclstatus): New. + (struct dbx_file): New members - bincl_status, pending_bincl_name and + prev. + (pending_bincls): New. + (dbxout_init): Initialize new dbx_file members. + (dbxout_start_source_file): Same. + (emit_bincl_stab): New function. + (emit_pending_bincls): Same. + (emit_pending_bincls_if_required): Same. + (dbxout_end_source_file): Emit EINCL stab only if BINCL is already + processed. + (dbxout_begin_block): Emit pending BINCL stabs. + (dbxout_end_block): Same. + (dbxout_function_decl): Same. + (dbxout_continue): Same. + (dbxout_type): Same. + (dbxout_class_name_qualifiers): Same. + (dbxout_symbol): Same. + (dbxout_symbol_location): Same. + (dbxout_parms): Same. + +2003-07-01 Kaveh R. Ghazi + + * c-semantics.c (genrtl_case_label): Fix format specifier bug. + * cfgrtl.c (rtl_verify_flow_info_1): Likewise. + +2003-07-01 Andreas Jaeger + + * fold-const.c: Convert prototypes to ISO C90. + * function.c: Likewise. + * function.h: Likewise. + +2003-07-01 Kazu Hirata + + * doc/contrib.texi: Fix typos. + * doc/invoke.texi: Likewise. + * doc/passes.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/tm.texi: Likewise. + +2003-07-01 Kazu Hirata + + * basic-block.h: Fix comment typos. + * bb-reorder.c: Likewise. + * c-format.c: Likewise. + * cfgcleanup.c: Likewise. + * cfghooks.h: Likewise. + * cfgloop.c: Likewise. + * cfgloopmanip.c: Likewise. + * cfgrtl.c: Likewise. + * cgraph.h: Likewise. + * cgraphunit.c: Likewise. + * combine.c: Likewise. + * convert.c: Likewise. + * dbxout.c: Likewise. + * df.c: Likewise. + * df.h: Likewise. + * diagnostic.c: Likewise. + * dwarf2out.c: Likewise. + * et-forest.h: Likewise. + * flow.c: Likewise. + * fold-const.c: Likewise. + * function.h: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * gcse.c: Likewise. + * genautomata.c: Likewise. + * ggc-common.c: Likewise. + * ggc-page.c: Likewise. + * loop-unroll.c: Likewise. + * loop-unswitch.c: Likewise. + * loop.c: Likewise. + * mips-tfile.c: Likewise. + * optabs.c: Likewise. + * ra-build.c: Likewise. + * ra-colorize.c: Likewise. + * ra-rewrite.c: Likewise. + * ra.h: Likewise. + * regmove.c: Likewise. + * reload.c: Likewise. + * rtlanal.c: Likewise. + * sched-ebb.c: Likewise. + * sched-int.h: Likewise. + * sched-vis.c: Likewise. + * sreal.c: Likewise. + * ssa-ccp.c: Likewise. + * ssa.c: Likewise. + * toplev.c: Likewise. + * tree-inline.c: Likewise. + * value-prof.c: Likewise. + * value-prof.h: Likewise. + +2003-07-01 Nathan Sidwell + + * rtl.h (emit_line_note_after): Remove. + (emit_note_copy_after, emit_note_copy): New. + * emit-rtl.c (reorder_insns_with_line_notes): Replace + emit_line_note_after with emit_note_copy_after. + (emit_insn_after_with_line_notes): Likewise. + (emit_line_note_after): Kill. + (emit_note_copy_after): New. + (emit_note_copy): New. + * function.c (emit_return_into_block): Use emit_note_copy_after. + (thread_prologue_and_epilogue_insns): Likewise. + * integrate.c (expand_inline_function): Use emit_note_copy. + (copy_insn_list): Likewise. + * unroll.c (copy_loop_body): Likewise. + * cfglayout.c (duplicate_insn_chain): Likewise. + +2003-07-01 Nathan Sidwell + + * c-tree.h (define_label): Replace filename and lineno arguments + with a location_t. + * c-decl.c (poplevel): Adjust define_label call. + (pop_label_level): Likewise. + (define_label): Replace filename and lineno arguments with a + location_t. + (store_parm_decls): Use DECL_SOURCE_LOCATION. + * c-parse.in (label): Adjust define_label call. + +2003-07-01 Neil Booth + + * config/sol2.h, config/alpha/alpha.h, config/alpha/linux.h, + config/i386/i386-interix.h, config/ia64/hpux.h, config/mips/iris6.h, + config/mips/linux.h, config/mips/mips.h, config/pa/pa-hpux.h, + config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, config/pa/pa-pro-end.h, + config/pa/pa.h, config/pa/rtems.h: Use c_dialect_ macros. + +2003-07-01 Andreas Jaeger + + * final.c: Convert prototypes to ISO C90. + * flow.c: Likewise. + * flags.h: Likewise. + * gcov-io.c: Likewise. + * gcov-io.h: Likewise. + +2003-06-30 Bruno Haible + + PR middle-end/6578 + * libgcc2.c (__subvsi3): Remove simplification that would not work + when subtracting -0x80000000. + (__subvdi3): Remove simplification that would return a wrong result. + (__mulvsi3): Fix overflow check. + (__absvdi2): Fix simplification that would return a wrong result. + (__mulvdi3): Fix overflow check. + +2003-06-30 Jeff Law + + * stmt.c (any_pending_cleanups): Lose argument THIS_CONTOUR, it + was always passed in the value '1'. Simplify body appropriately. + * tree.h (any_pending_cleanups): Corresponding changes. + * calls.c: (expand_call): Corresponding changes. + +2003-06-30 Kazu Hirata + + * combine.c (distribute_notes): Don't bother REG_WAS_0. + * cse.c (cse_insn): Likewise. + * final.c (final_scan_insn): Likewise. + * jump.c (duplicate_loop_exit_test): Likewise. + * rtl.c (reg_note_name): Remove REG_WAS_0. + * rtl.h (REG_WAS_0): Remove. + * unroll.c (final_reg_note_copy): Don't bother REG_WAS_0. + * config/avr/avr.c (output_movqi): Don't use reg_was_0. + (output_movhi): Likewise. + (output_movsisf): Likewise. + (reg_was_0): Remove. + * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't use + REG_WAS_0. + (m68hc11_gen_movqi): Likewise. + * config/vax/vax-protos.h: Remove the prototype for + reg_was_0_p. + * config/vax/vax.c (follows_p): Remove. + (reg_was_0_p): Likewise. + * config/vax/vax.md (movsi): Don't use reg_was_0_p. + (movhi): Likewise. + (movqi): Likewise. + * doc/rtl.texi (REG_WAS_0): Remove. + +2003-06-30 Mark Mitchell + + * config/rs6000/spe.h (__ev_set_spefscr_frmc): Set the flag. + +2003-06-30 Bob Wilson + + * config/xtensa/lib1funcs.asm: Use "xtensa-config.h" from + top-level include directory. + * config/xtensa/lib2funcs.S: Likewise. + * config/xtensa/xtensa.h: Likewise. + * config/xtensa/xtensa-config.h: Remove. + * doc/install.texi: Update location of "xtensa-config.h" header. + +2003-06-30 Ulrich Weigand + + * config/s390/s390.c (s390_extra_constraint): New function. + * config/s390/s390-protos.h (s390_extra_constraint): Declare it. + * config/s390/s390.h (EXTRA_CONSTRAINT): Use it. + * config/s390/s390.c (q_constraint): Remove. + * config/s390/s390-protos.h (q_constraint): Likewise. + * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'R', 'S', 'T'. + (EXTRA_ADDRESS_CONSTRAINT): Define. + + * config/s390/s390.c (larl_operand): Refuse out-of-range operands. + (DISP_IN_RANGE, s390_short_displacement): New. + (legitimate_reload_operand_p): Support long displacements. + (s390_decompose_address): Likewise. + (legitimize_pic_address): Likewise. + (legitimize_address): Likewise. + (s390_fixup_clobbered_return_reg): Likewise. + (s390_emit_prologue, s390_emit_epilogue): Likewise. + (s390_output_mi_thunk): Likewise. + + * config/s390/s390.md (attr "op_type"): Add "RXY", "RSY", "SIY". + (attr "atype", attr "length"): Add defaults for new op_types. + (all insns): Change op_type attribute where appropriate. + + ("*movdi_lay", "*movsi_lay", "*extendqidi2", "*extendqisi2"): New insns. + ("*tmqi_ext", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem", *tmqi_mem", + "*tstsi", "*tstsi_cconly", "*tsthiCCT", "*tsthiCCT_cconly", + "*tsthi", "*tsthi_cconly", "*tstqiCCT", "*tstqiCCT_cconly", + "*tstqi", "*tstqi_cconly", "*cmpsi_ccs_sign", "*cmpsi_ccs", + "*cmpsi_ccu", "*cmphi_ccu", "*cmpqi_ccu", "*cli", + "movti", "*movdi_64", "*movdi_31", "*movsi", "movhi", "movqi_64", + "movqi", "*movstrictqi", "*movstricthi", "movstrictsi", + "*movdf_64", "*movdf_31", "*movsf", + "*load_multiple_si", "*store_multiple_di", + "*sethighqisi", "*sethighhisi", "*sethighqidi_31", "*extendhisi2", + "*la_64", "*la_31", "*la_31_and", "force_la_31", + "*addsi3_carry1_cc", *addsi3_carry1_cconly", + "*addsi3_carry2_cc", *addsi3_carry2_cconly", + "*addsi3_cc", "*addsi3_cconly", "*addsi3_cconly2", + "*addsi3_sign", "*addsi3_sub", "addsi3", + "*subsi3_borrow_cc", "*subsi3_borrow_cconly", "*subsi3_cc", + "*subsi3_cconly", "*subsi3_sign", "*subsi3_sub", "subsi3", + "mulsi3" + "*andsi3_cc", "*andsi3_cconly", "andsi3", + "*andqi3_ss", "*andqi3_ss_inv", + "*iorsi3_cc", "*iorsi3_cconly", "iorsi3", + "*iorqi3_ss", "*iorqi3_ss_inv", + "*xorsi3_cc", "*xorsi3_cconly", "xorsi3", + "*xorqi3_ss", "*xorqi3_ss_inv", + "*tls_load_31"): Add alternatives for long-displacement instructions. + + ("*cmpdf_ccs", "*cmpdf_ccs_ibm", "*cmpsf_ccs", "*cmpsf_ccs_ibm", + "*load_multiple_di", "*store_multiple_di", + "*sethighqidi_64", "*zero_extendhisi2_31", + "truncdfsf2_ibm", "extendsfdf2_ieee", "extendsfdf2_ibm", + "adddf3", "*adddf3", "*adddf3_ibm", + "addsf3", "*addsf3", "*addsf3_ibm", + "subdf3", "*subdf3", "*subdf3_ibm", + "subsf3", "*subsf3", "*subsf3_ibm", + "mulsi_6432", "divmoddisi3", + "muldf3", "*muldf3", "*muldf3_ibm", + "mulsf3", "*mulsf3", "*mulsf3_ibm", + "divdf3", "*divdf3", "*divdf3_ibm", + "divsf3", "div*sf3", "*divsf3_ibm", + "sqrtdf2", "sqrtsf2", + "*cjump_long", "*icjump_long", "indirect_jump", "casesi_jump", + "*doloop_si_long", "*doloop_di_long", "bas_64", "bas_31", + "bas_r_64", "bas_r_31", "bas_tls_31", "bas_tls_64"): Adapt memory + and address constraints for instructions that do not accept long + displacements. + +2003-06-30 Hartmut Penner + Ulrich Weigand + + * config/s390/2084.md: New file. + * config/s390/s390.md: Include it. + * config/s390/s390.c (s390_adjust_priority): New function. + (TARGET_SCHED_ADJUST_PRIORITY): Define. + (s390_first_cycle_multipass_dfa_lookahead): New function. + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Define. + (s390_sched_reorder2): New function. + (TARGET_SCHED_REORDER2): Define. + (s390_adjust_cost): Support PROCESSOR_2084_Z990 cpu type. + (s390_issue_rate): Likewise. + +Mon Jun 30 23:47:33 CEST 2003 Jan Hubicka + + * Makefile.in (GTFILES): Add cgraph.h. + * cgraph.c (known_decls): Remove. + (cgraph_hash, cgraph_nodes, cgraph_nodes_queue, + cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize. + (cgraph_node): Do not allocate known_decls; use polutate hashtable. + (cgraph_varpool_node): Likewise; add next pointer. + (cgraph_varpool_nodes): New static variable. + * cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info, + cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes, + cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize. + * gengtype.c (open_base_files): Include cgraph.h + +2003-06-30 Volker Reichelt + + * Changelog: Remove ">>>>>>>" from previous change. + +2003-06-30 Volker Reichelt + + * config/cris/cris.c: Fix spelling for "testcase". + * config/cris/cris.h: Likewise. + * config/cris/cris.md: Likewise. + * config/mmix/crti.asm: Likewise. + * config/mmix/mmix.h: Likewise. + * config/mmix/mmix.md: Likewise. + +2003-06-30 Kazu Hirata + + * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Make it always + 1. + +2003-06-30 Ulrich Weigand + + * config.gcc [s390*-*-*]: Support --with-arch, --with-tune, and + --with-mode configure options. + * config/s390/s390.h (OPTION_DEFAULT_SPECS): Define. + (DRIVER_SELF_SPECS): Define. + * config/s390/linux.h (ASM_SPEC): Pass architecture mode and cpu + architecture to assembler. + (LINK_SPEC): Merge 31-bit and 64-bit variants. + (LINK_ARCH31_SPEC, LINK_ARCH64_SPEC, EXTRA_SPECS): Remove. + * config/s390/s390.c (override_options): New default rules for + architecture mode and cpu architecture selection. + * doc/invoke.texi (-mesa, -mzarch, -march, -mtune): Document + new default rules. + + * config/s390/s390.h (enum processor_type): Add PROCESSOR_2084_Z990. + * config/s390/s390.md (attr "cpu"): Add "z990" processor type. + * config/s390/s390.c (override_options): Add "z990" to + processor_alias_table. + * doc/invoke.texi (-march): Document "z990" processor type. + + * config/s390/s390.c (s390_tune_flags, s390_arch_flags): New variables. + * config/s390/s390.h (s390_tune_flags, s390_arch_flags): Declare. + (enum processor_flags, TARGET_CPU_IEEE_FLOAT, TARGET_CPU_ZARCH, + TARGET_CPU_LONG_DISPLACEMENT, TARGET_LONG_DISPLACEMENT): New. + * config/s390/s390.c (override_options): Replace enum pta_flags by + enum processor_flags. Fill in s390_tune_flags and s390_arch_flags. + + * config/s390/s390.c (s390_cpu): Rename to ... + (s390_tune): ... this. + * config/s390/s390.h (s390_cpu, s390_tune): Likewise. + * config/s390/s390.c (s390_issue_rate, override_options): Likewise. + * config/s390/s390.md (attr "cpu"): Likewise. + +2003-06-30 Neil Booth + + * c-common.c (enum c_language_kind, flag_objc): Remove. + (fix_string_type, check_case_value, c_common_nodes_and_builtins, + c_add_case_label, finish_label_addr_expr, boolean_increment): + Use c_dialect_ macros. + * c-common.h (enum c_language_kind): Extend. + (c_dialect_cxx, c_dialect_objc): New. + (flag_objc): Remove. + (c_common_init_options): Update prototype. + * c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_ + macros. + * c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_ + macros. + * c-format.c (C_STD_VER, C_STD_NAME): Similarly. + * c-lang.c (c_init_options): Remove. + (c_language): Define. + (LANG_HOOKS_INIT_OPTIONS): Use common hook. + * c-lex.c (lex_charconst): Use c_dialect_ macros. + * c-opts.c (lang_flags): Make function-local. + (c_common_init_options): Use c_dialect_ macros. Handle + C++ diagnostic requirements. + (c_common_handle_option, c_common_post_options): Use flag_cxx. + * c-parse.in (init_reswords): Use c_dialect_objc (). + * c-pch.c (get_ident): Use c_language. + * c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros. + * c-typeck.c (comptypes, build_c_cast): Similarly. + * objc/objc-lang.c (c_language): Define. + (LANG_HOOKS_INIT_OPTIONS): Use common hook. + (objc_init_options): Remove. + +2003-06-30 Kazu Hirata + + * config/alpha/alpha.h (FUNCTION_ARG_PADDING): Remove. + * config/alpha/unicosmk.h: Don't #undef FUNCTION_ARG_PADDING. + +2003-06-30 Wolfgang Bangerth + + * doc/sourcebuild.texi: Don't reference gnats.html any more. + +2003-06-30 Kazu Hirata + + * config/h8300/h8300.c (compute_mov_length): Fix length of + mov:SF on H8/300. + +2003-06-30 Nick Clifton + + * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Make defintion + constant. + +Mon Jun 30 15:36:29 CEST 2003 Jan Hubicka + + (fyl2x_sfxf3, fyl2x_dfxf3, fscale_sfxf3, fscale_dfxf3): Fix condition. + +2003-06-30 Hartmut Penner + + * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function. + (altivec_in_gprs_p): New function. + + * config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New + prototype. + (altivec_in_gprs_p): New prototype. + + * config/rs6000/altivec.md (*movv4si_internal): Change + multi-assembler alternative to '#'. Add postreload splitter to + handle this cases. + (*movv4hi_internal): Likewise. + (*movv4qi_internal): Likewise. + (*movv4sf_internal): Likewise. + +2003-06-30 Jason Merrill + + * defaults.h (PUSH_ARGS_REVERSED): Define default here. + * calls.c: Not here. + +2003-06-30 Ben Elliston + + * config/arm/arm.c (arm_rtx_costs): Remove #if 0 block. + (bad_signed_byte_operand): Likewise. + (arm_output_epilogue): Likewise. + (arm_final_prescan_insn): Likewise. + +2003-06-30 Rainer Orth + + * cfgrtl.c (mark_killed_regs): Cast HARD_REGNO_NREGS to int. + +2003-06-30 Rainer Orth + + * c-pch.c (c_common_write_pch): Flush asm_out_file to allow for + subsequent writes. + +Mon Jun 30 10:03:02 CEST 2003 Jan Hubicka + + * cfgrtl.c (verify_flow_info): Accept degenerated condjumps + in cfglayout mode. + +Mon Jun 30 09:52:39 CEST 2003 Jan Hubicka + + * i386.c (standard_80387_constant_p): Accept TFmode constants too. + (init_ext_80387_constants): Likewise. + (standard_80387_constant_rtx): Likewise. + * i386.md (atanxf): Disable for TARGET_128BIT_LONG_LONG + (atantf): Disable for !TARGET_128BIT_LONG_LONG + (fyl2x_sfxf3, fyl2x_dfxf3): Accept TFmode operands. + (fyl2x_xfxf3, fyl2x_tfxf3): Enable/disable as needed. + (fscale_sfxf3, fscale_dfxf3): Accept TFmode operands. + (fscale_xfxf3, fscale_tfxf3): Enable/disable as needed. + (frndinttf2): New. + (f2xm1tf2): New. + (exp?f2): Use expsf2_tf when needed. + (exp?f2_tf): New. + (exptf): New. + +2003-06-29 Uwe Stieber + + * config.gcc (sh*-*-kaos*): Put tm_file setting in separate case + statement from tmake_file set. + +2003-06-29 James E Wilson + + * reload.c (find_reloads): Change push_reloads to push_reload in + comment. + * reload1.c (eliminate_regs): Likewise. + (dump_needs): Delete prototype for deleted function. + +2003-06-29 Kaveh R. Ghazi + + * builtin-attrs.def (gcc_diag, gcc_cdiag, gcc_cxxdiag): New + format attributes. + * c-format.c (enum format_type): Add gcc_diag_format_type, + gcc_cdiag_format_type, and gcc_cxxdiag_format_type. + (gcc_diag_length_specs, gcc_cdiag_length_specs, + gcc_cxxdiag_length_specs, gcc_diag_flag_pairs, + gcc_cdiag_flag_pairs, gcc_cxxdiag_flag_pairs, gcc_diag_flag_specs, + gcc_cdiag_flag_specs, gcc_cxxdiag_flag_specs, gcc_diag_char_table, + gcc_cdiag_char_table, gcc_cxxdiag_char_table): New. + (format_types_orig): Add new data. + (find_char_info_specifier_index, init_dynamic_diag_info): New + functions. + (handle_format_attribute): Update to handle new format attributes. + +2003-06-29 Dara Hazeghi + + * doc/install.texi: Remove install documentation for obsoleted targets + i?86-*-sco, i?86-*-sco3.2v4, powerpcle-*-pe, powerpcle-*-winnt, + arm-*-aof. + Update information about IA64 toolchain, AIX make requirements, + and binutils for m68k-*-hpux and *-*-linuxaout targets. + +Mon Jun 30 00:50:43 CEST 2003 Jan Hubicka + + * regmove.c (regmove_optimize): Don't try to make src and dst match + when they are in different modes. + +Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka + + * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid + busy work when builtin is not supported by the backend. + +2003-06-29 Zdenek Dvorak + + * loop.c (count_one_set): Fix detection of registers set in more + than one basic block. + +2003-06-29 Andreas Jaeger + + * target-def.h: Remove usage of OBJECT_FORMAT_ROSE. + * system.h: Poison OBJ_FORMAT_ROSE. + * doc/tm.texi (Macros for Initialization): Remove documentatin of + OBJECT_FORMAT_ROSE. + * config/rs6000/lynx.h: Remove undef of OBJECT_FORMAT_ROSE. + * collect2.c: Remove usage of OBJECT_FORMAT_ROSE. + +2003-06-29 John David Anglin + + * pa.c (update_total_code_bytes): New function. + (last_address): Number of bytes output for a function and its + associated thunks. + (compute_frame_size): Use BITS_PER_UNIT. + (pa_output_function_epilogue): Compute last_address. Use + update_total_code_bytes. + (output_lbranch): Handle long branch on portable runtime. + (attr_length_millicode_call, attr_length_call, + attr_length_indirect_call): Only use total_code_bytes for calls in + the text section. + (output_call): Only use an indirect call sequence when the target is + not local. + (pa_asm_output_mi_thunk): Handle updating of total_code_bytes. Improve + test to determine when an IA-relative branch can be used. Add various + long branch sequences. Avoid using an indirect branch on all ports + except SOM. + +2003-06-29 Ulrich Weigand + + * expr.c (clear_by_pieces): Fix prototype. + +2003-06-29 Andreas Jaeger + + * cse.c: Convert prototypes to ISO C90. + * cselib.c: Likewise. + * cselib.h: Likewise. + * dbxout.c: Likewise. + * debug.c: Likewise. + * df.c: Likewise. + * df.h: Likewise. + * dojump.c: Likewise. + * doloop.c: Likewise. + * dominance.c: Likewise. + * dwarf2asm.c: Likewise. + * dwarf2out.c: Likewise. + * dwarf2out.h: Likewise. + * dwarfout.c: Likewise. + * except.c: Likewise. + * except.h: Likewise. + * emit-rtl.c: Likewise. + * et-forest.c: Likewise. + * et-forest.h: Likewise. + * except.c: Likewise. + * explow.c: Likewise. + * expmed.c: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + +2003-06-29 Kazu Hirata + + * alloc-pool.c: Fix comment formatting. + * bitmap.c: Likewise. + * bitmap.h: Likewise. + * bt-load.c: Likewise. + * builtins.c: Likewise. + * caller-save.c: Likewise. + * cfganal.c: Likewise. + * cfgrtl.c: Likewise. + * collect2.c: Likewise. + * cse.c: Likewise. + * df.c: Likewise. + * diagnostic.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * expmed.c: Likewise. + * final.c: Likewise. + * flags.h: Likewise. + * fold-const.c: Likewise. + * gcc.c: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * genattrtab.c: Likewise. + * genautomata.c: Likewise. + * libgcov.c: Likewise. + * mips-tfile.c: Likewise. + * optabs.c: Likewise. + * prefix.c: Likewise. + * rtlanal.c: Likewise. + * stmt.c: Likewise. + * stor-layout.c: Likewise. + * toplev.c: Likewise. + * varasm.c: Likewise. + * vmsdbgout.c: Likewise. + +2003-06-29 Kazu Hirata + + * expr.c (emit_single_push_insn): If padding is needed + downward, adjust the stack pointer first, and then store the + data into the stack location using an offset. + +2003-06-29 Andreas Jaeger + + * collect2.h: Convert prototypes to ISO C90. + * collect2.c: Likewise. + * conflict.c: Likewise. + * coverage.c: Likewise. + * convert.h: Likewise. + * convert.c: Likewise. + +2003-06-29 Nathan Sidwell + + * c-decl.c (c_init_decl_processing): Use a location_t. Set input + filename to . + * tree.c (make_node): Just copy the current location. + +2003-06-29 Eric Botcazou + + PR optimization/11210 + * fold-const (decode_field_reference): Revert 2003-06-26 patch. + +2003-06-29 Neil Booth + + * toplev.c (flag_dummy): Remove. + (f_options): Restore flag pointers. + +2003-06-29 David Edelsohn + + * config/rs6000/rs6000.c (processor_target_table): Add 970. + * config.gcc: Add 970. + +2003-06-29 Kazu Hirata + + * dwarf2out.c (add_AT_string): Replace ggc_alloc_string (X, + -1) with ggc_strdup. + * stmt.c (expand_asm_operands): Likewise. + * config/rs6000/rs6000.md (builtin_setjmp_receiver): Likewise. + +2003-06-28 Kazu Hirata + + * config/ip2k/ip2k.c (ip2k_reorg): Use INSN_P instead of its + definition. + +2003-06-29 Franz Sirl + + * opts.c: Include insn-attr.h. + * Makefile.in (opts.o): Depend on INSN_ATTR_H. + +2003-06-27 J"orn Rennecke + + * flow.c (propagate_one_insn): Use proper test for a register + being part of the return value. + +2003-06-28 Kazu Hirata + + * config/avr/avr.c: Fix a comment typo. + +2003-06-28 Kazu Hirata + + * config/avr/avr-protos.h: Replace avr_simplify_comparision_p + with avr_simplify_comparison_p. + * config/avr/avr.c: Likewise. + +2003-06-28 Kazu Hirata + + * builtins.c: Follow spelling conventions. + * cgraph.c: Likewise. + * cpplex.c: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/iwmmxt.md: Likewise. + * config/c4x/c4x-modes.def: Likewise. + * config/c4x/c4x.c: Likewise. + * config/c4x/c4x.h: Likewise. + * config/c4x/c4x.md: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/mips/mips.h: Likewise. + +2003-06-28 Neil Booth + + * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Predicate + __mc68020__ on TARGET_68020. + +2003-06-28 Kazu Hirata + + * config/h8300/h8300.c: Fix a comment typo. + +2003-06-28 Nathan Sidwell + + * c-parse.in (yylexstring): Use a location_t. + + * diagnostic.h (diagnostic_set_info): Replace file and lineno + parameters with a location_t. + * diagnostic.c (diagnostic_set_info): Replace file and lineno + parameters with a location_t. + (inform, warning, pedwarn, error, sorry, fatal_error, + internal_error, warning_with_decl, pedwarn_with_decl, + error_with_decl): Adjust. + * c-error.c (pedwarn_c99): Adjust. + * c-format.c (status_warning): Adjust. + * rtl-error.c (file_and_line_for_asm): Rename to ... + (location_for_asm): Return a location_t. + (diagnostic_for_asm): Adjust. + +2003-06-28 Neil Booth + + * cpptrad.c (skip_macro_block_comment): New. + (copy_comment): Use it if appropriate. + +2003-06-28 Kazu Hirata + + * gcse.c (compute_ld_motion_mems): Use INSN_P instead of its + definition. + (store_killed_in_insn): Likewise. + * print-rtl.c (print_rtx): Likewise. + * config/frv/frv.c (frv_final_prescan_insn): Likewise. + * config/m68hc11/m68hc11.c (dead_register_here): Likewise. + (m68hc11_reassign_regs): Likewise. + (m68hc11_reorg): Likewise. + +2003-06-28 Gabriel Dos Reis + + * diagnostic.c (output_integer_with_precision): New macro. + (output_format): Use it. Handle more format specifiers. + (output_long_decimal): Remove. + (output_unsigned_decimal): Likewise. + (output_long_unsigned_decimal): Likewise. + (output_octal): Likewise. + (output_long_octal): Likewise. + (output_hexadecimal): Likewise. + (output_long_hexadecimal): Likewise. + (output_long_long_decimal): Likewise. + +2003-06-28 Andreas Schwab + + * config/ia64/ia64.md: Follow recent emit_note API change. + +2003-06-28 Nathan Sidwell + + * c-parse.in (%union): Replace filename & lineno with location. + (save_filename, save_lineno): Remove. + (save_location): New. + (fndef, old_style_parm_decls_1, lineno_datadecl, lineno_decl, + nested_function, notype_nested_function, if_prefix, lineno_stmt, + lineno_label, label): Adjust. + +2003-06-28 Jakub Jelinek + + * builtins.c (c_strlen): Add only_value argument. + Handle COND_EXPR and COMPOUND_EXPR. + (expand_builtin_strlen): Optimize also strlen (i++ ? "foo" : "bar"). + Adjust c_strlen callers. + (expand_builtin_strcpy, expand_builtin_strncpy, + expand_builtin_strcmp, expand_builtin_strncmp, + expand_builtin_fputs, expand_builtin_sprintf, + fold_builtin): Adjust c_strlen callers. + +2003-06-28 Josef Zlomek + + * bb-reorder.c (find_traces_1_round): Do not send basic block + to next round when we are in the last round. + +2003-06-28 Neil Booth + + * Makefile.in: Update. + * opts.c: Include tm_p.h. + (handle_options): Make static. + (decode_options): Copied from toplev.c. + * opts.h (decode_options): New. + * toplev.c (parse_options_and_default_flags): Move most to opts.c, + some to... + (general_init): ...here. + (toplev_main): Use decode_options instead. + * toplev.h (save_argc, save_argv): New. + +2003-06-28 Kazu Hirata + + * explow.c (find_next_ref): Remove. + * rtl.h: Remove the prototype for find_next_ref. + +2003-06-27 Roger Sayle + + * config/alpha/alpha.md (anonymous define_split): Adjust emit_note + call to match recent API change. + +2003-06-27 Zack Weinberg + + * dbxout.c (flag_debug_only_used_symbols): Delete redundant + declaration. + + * c-format.c (check_format_string, get_constant) + * cfgrtl.c (rtl_split_edge): + Mark the definition static, matching the forward declaration. + +2003-06-27 Gunther Nikl + + * unwind-c.c (PERSONALITY_FUNCTION): Delete duplicate define. + + PR target/11014 + * config/m68k/m68k.c (m68k_output_mi_thunk): Use correct assembly + syntax for MIT / MOTOROLA. + + PR other/10240 + * configure.in: Removed $(XCFLAGS) from BUILD_CFLAGS for build != host. + * configure: Rebuilt. + +2003-06-27 Chris Demetriou + + * config/mips/mips.c (mips_build_va_list): Make padding in + va_list structure explicit to avoid -Wpadded warnings. + +2003-06-27 Ulrich Weigand + + * config/s390/s390.h (SECONDARY_OUTPUT_RELOAD_CLASS): Define. + * config/s390/s390.c (s390_secondary_output_reload_class): New function. + * config/s390/s390-protos.h (s390_secondary_output_reload_class): + Declare it. + * config/s390/s390.md ("reload_outti", "reload_outdi", + "reload_outdf"): New expanders. + + * config/s390/s390.md ("movti" + splitters): Handle non-offsettable + memory operands as source. + ("movdi" + splitters): Likewise. + ("movdf" + splitters): Likewise. + * config/s390/s390.c (s390_split_ok_p): New function. + * config/s390/s390-protos.h (s390_split_ok_p): Declare it. + +2003-06-27 Kazu Hirata + + * combine.c (force_to_mode): Replace the equality comparison + of INTVALs with a pointer equality comparison. + (simplify_comparison): Likewise. + +2003-06-27 Kazu Hirata + + * jump.c (rtx_renumbered_equal_p): Replace an expression that + is known to be 0 with 0. + +2003-06-27 Kazu Hirata + + * gcse.c (expr_equiv_p): Replace expressions that are known to + be 0 with 0. + +2003-06-27 Kazu Hirata + + * cse.c (fold_rtx): Replace the equality comparison of INTVALs + with a pointer equality comparison. + +2003-06-27 Kazu Hirata + + * rtlanal.c (reg_mentioned_p): Return 0 earlier if REG and IN + are known to be not equivalent. + +2003-06-27 Richard Henderson + + * config/alpha/alpha.c (function_arg): Don't pass small aggregates + in floating point registers. Validate that we don't receive complex + values here. Use #elif. + (return_in_memory, function_value): New. + (alpha_va_arg): Handle complex values as two arguments. + * config/alpha/alpha.h (RETURN_IN_MEMORY): Use return_in_memory. + (FUNCTION_VALUE, LIBCALL_VALUE): Use function_value. + (SPLIT_COMPLEX_ARGS): New. + * config/alpha/alpha-protos.h: Update. + +2003-06-27 Ulrich Weigand + + * ggc-page.c (inverse_table): Change type of mult to size_t. + (compute_inverse): Compute inverse using size_t, not unsigned int. + Compute inverse also for sizes larger than half a machine page. + +Fri Jun 27 18:36:12 CEST 2003 Jan Hubicka + + * toplev.c (rest_of_decl_compilation): Only varpoolize argument + when called before cgraph_optimize. + +2003-06-27 Zack Weinberg + + * config/darwin.h, config/elfos.h, config/i960/i960-coff.h + * config/m68k/coff.h: ASM_FILE_START_FILE_DIRECTIVE should + be TARGET_ASM_FILE_START_FILE_DIRECTIVE. + +Fri Jun 27 17:41:16 CEST 2003 Jan Hubicka + + * cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing + of known_decls. + +2003-06-27 Hans-Peter Nilsson + + * defaults.h (REGISTER_MOVE_COST): Define default here. + * regclass.c: Don't define default REGISTER_MOVE_COST here. + * reload.c, reload1.c: Ditto. + +2003-06-27 Richard Earnshaw + + * flags.h: Really install previous change. + +2003-06-27 Nathan Sidwell + + * rtl.h (emit_note): Remove FILE parameter. + * emit-rtl.c (emit_line_note): Adjust emit_note call. + (emit_note): Remove FILE parameter. Adjust. + * builtins.c (expand_builtin_expect): Adjust emit_note call. + * c-semantics.c (genrtl_scope_stmt): Likewise. + (expand_stmt): Likewise. + * cfglayout.c (reemit_insn_block_notes): Likewise. + (duplicate_insn_chain): Likewise. + * except.c (expand_eh_region_start, expand_eh_region_end, + sjlj_emit_function_enter): Likewise. + * explow.c (probe_stack_range): Likewise. + * expr.c (emit_block_move_via_loop): Likewise. + * function.c (init_function_start, expand_function_start, + expand_function_end, thread_prologue_and_epilogue_insns): Likewise. + * integrate.c (expand_inline_function, copy_insn_list): Likewise. + * reg-stack.c (compensate_edge): Likewise. + * reload1.c (reload): Likewise. + * rtlanal.c (hoist_insn_to_edge): Likewise. + * stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop, + expand_loop_continue_here, expand_end_loop, expand_continue_loop, + expand_exit_loop_top_cond, expand_value_return, + expand_start_bindings_and_block, expand_end_bindings, + expand_decl_cleanup, expand_start_case): Likewise. + * unroll.c (copy_loop_body + * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise. + * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore, + rs6000_emit_allocate_stack, rs6000_output_function_prologue, + rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise. + * config/sh/sh.c (sh_output_mi_thunk): Likewise. + * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. + +2003-06-27 Nathan Sidwell + + * c-tree.h (grokfield): Remove unused filename and line parameters. + * c-decl.c (grokfield): Remove unused filename and line parameters. + * c-parse.in (component_decl): Adjust field grokking rules, adjust + grokfield calls. + (component_declarator): Likewise. + (component_notype_declarator): Likewise. + * objc/objc-act.c (build_module_descriptor): Adjust grokfield + calls. + (build_protocol_template, build_method_prototype_list_template, + build_method_prototype_template, build_category_template, + build_selector_template, build_class_template, + build_super_template, build_ivar_template, + build_ivar_list_template, build_method_list_template, + build_method_template, add_instance_variable): Likewise. + +2003-06-27 Kazu Hirata + + * stmt.c (do_jump_if_equal): Return 0 earlier if OP1 and + OP2 are known to be not equivalent. + +2003-06-26 Devang Patel + + * final.c (debug_flush_symbol_queue): New function. + (debug_queue_symbol): New function. + (debug_free_queue): New function. + (debug_nesting): New variable. + (symbol_queue): New variable. + (symbol_queue_index): Same. + (symbol_queue_size): Same. + * debug.h (debug_flush_symbol_queue): New. + (debug_queue_symbol): New. + (debug_free_queue): New. + (debug_nesting): New. + (symbol_queue_index): New. + * dbxout.c (DBXOUT_DECR_NESTING): New macro. + (DBXOUT_DECR_NESTING_AND_RETURN): New macro. + (dbxout_init): Delay symbol output. + (dbxout_global_decl): Save, set and reset TREE_USED bit around + dbxout_symbol() call. + (dbxout_begin_function): Same. + (dbxout_finish): Free symbol queue. + (dbxout_type): Put appropriate symbols in queue. + (dbxout_symbol): Put info for symbol's type in queue. + Decrement/Increment nesting counts flush symbol queue appropriately. + (dbxout_parms): Increment dbxout nesting. + (dbxout_reg_parms): Same. + * flags.h (flag_debug_only_used_symbols): New. + * toplev.c (flag_debug_only_used_symbols): New variable. + (lang_independent_options): Add entries for new option + -feliminate-unused-debug-symbols. + * common.opt: Add entry for -feliminate-unused-debug-symbols. + * opts.c (common_handle_options): Same. + * config/rs6000/darwin.h (CC1_SPEC): Interpret -gused as + -feliminate-unused-debug-symbols. + * doc/invoke.texi (Debugging Options): Document + -feliminate-unused-debug-symbols. + +2003-06-26 Roger Sayle + Jakub Jelinek + + * builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to + obtain the format string instead of using TREE_STRING_POINTER and + TREE_STRING_LENGTH. Only optimize sprintf(dst,"%s",src) when the + return value is unused or the length of src is a known constant. + +2003-06-26 Richard Henderson + + * config/ia64/ia64.h (REGISTER_NAMES): R0 is really AP. + +2003-06-26 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls. + (ia64_split_call): Only load descriptor for GP register inputs. + (ia64_expand_epilogue): Check current_frame_info.mask not + current_function_is_leaf to restore ar.pfs. + +2003-06-26 Richard Henderson + + * emit-rtl.c (try_split): Append to new CALL_INSN_FUNCTION_USAGE + instead of replacing it. + +2003-06-26 Richard Henderson + + * flow.c (propagate_one_insn): Kill function return value + registers across tail calls. + + * flow.c (propagate_one_insn): Preserve live-at-end registers + across tail calls. + +2003-06-26 J"orn Rennecke + + * reload.c (can_reload_into): New function. + (push_reload): Use it. + +2003-06-26 Kazu Hirata + + * config/h8300/h8300.c (compute_a_rotate_length): Fix the + references to the amount of a rotation. + +2003-06-26 Nathanael Nerode + + * config/sh/coff.h: Don't include dbxcoff.h. + * config.gcc: List it here. + +2003-06-26 Kazu Hirata + + * postreload.c (reload_cse_simplify_set): Call cselib_lookup + earlier. Don't check if SRC is a constant. + +2003-06-26 Kazu Hirata + + * Makefile.in (OBJS): Add postreload.o. + Remove cselib.h from the dependency list for reload1.o. + Add a dependency list for postreload.o. + * reload.h: Change the comment for the prototype of + reload_cse_regs. + * reload1.c: Don't include cselib.h. + (reload_cse_regs): Move to postreload.c + (reload_cse_regs_1): Likewise. + (reload_cse_noop_set_p): Likewise. + (reload_cse_simplify_set): Likewise. + (reload_cse_simplify_operands): Likewise. + (RELOAD_COMBINE_MAX_USES): Likewise. + (reload_combine_ruid): Likewise. + (LABEL_LIVE): Likewise. + (reload_combine): Likewise. + (reload_combine_note_use): Likewise. + (reload_combine_note_store): Likewise. + (reg_set_luid): Likewise. + (reg_offset): Likewise. + (reg_base_reg): Likewise. + (reg_mode): Likewise. + (move2add_luid): Likewise. + (move2add_last_label_luid): Likewise. + (MODES_OK_FOR_MOVE2ADD): Likewise. + (reload_cse_move2add): Likewise. + (move2add_note_store): Likewise. + (reload_cse_simplify): Likewise. + * postreload.c: New. + +2003-06-26 Kazu Hirata + + * config/avr/avr.c (final_prescan_insn): Remove support for + -mrtl. + * config/avr/avr.h (MASK_RTL_DUMP): Remove. + (TARGET_RTL_DUMP): Likewise. + (TARGET_SWITCHES): Remove -mrtl. + +2003-06-26 Kazu Hirata + + * config/h8300/h8300-protos.h: Change emit_a_rotate to + output_a_rotate. Add a prototype for compute_a_rotate_length. + * config/h8300/h8300.c (emit_a_rotate): Change to + output_a_rotate. + (compute_a_rotate_length): New. + (h8300_adjust_insn_length): Remove. + * config/h8300/h8300.h (ADJUST_INSN_LENGTH): Remove. + * config/h8300/h8300.md (adjust_length): Remove. + (*rotlqi3_1): Use output_a_rotate and compute_a_rotate_length. + (*rotlhi3_1): Likewise. + (*rotlsi3_1): Likewise. + +2003-06-26 Roger Sayle + Richard Henderson + + * builtins.c (expand_builtin_mathfn): Always stabilize the argument + list against re-evaluation. If expand_unop fails, call expand_call + with the stabilized argument list rather than return NULL_RTX. + (expand_builtin_mathfn2): Likewise, always stabilize the argument + list, and call expand_call ourselves if expand_binop fails. + +2003-06-26 Eric Botcazou + + PR optimization/11210 + * fold-const (decode_field_reference): Strip only NOPs that + don't affect the sign. + +2003-06-26 Dhananjay Deshpande + + * gcc/config/sh/sh.md (push_fpscr): Enable for TARGET_SH2E. + (pop_fpscr, fpu_switch): Likewise. + +2003-06-26 Zdenek Dvorak + + * value-prof.c: New. + * value-prof.h: New. + * Makefile.in (value-prof.o): New. + (LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta + (profile.o): Add value-prof.h and tree.h dependency. + * flags.h (flag_profile_values): Declare. + * gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS): + Add new counters. + (GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE, + GCOV_COUNTER_V_DELTA): New counter sections. + (__gcov_merge_single, __gcov_merge_delta): Declare. + * flow.c (mark_used_regs): Set subregs_of_mode only when the + structure is initialized. + * libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions. + * profile.c: Include value-prof.h and tree.h. + (gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler, + gen_const_delta_profiler, instrument_values): New static functions. + (get_exec_counts): Fix comment. + (branch_prob): Invoke instrument_values. + * toplev.c (flag_profile_values): New flag. + * doc/invoke.texi (-fprofile-values): Document. + +2003-06-26 Zdenek Dvorak + + * Makefile.in (cfgrtl.o): Add expr.h dependency. + * cfgrtl.c: Include expr.h. + (mark_killed_regs, safe_insert_insn_on_edge): New + functions. + * config/i386/i386.h (AVOID_CCMODE_COPIES): Define. + * basic-block.h (safe_insert_insn_on_edge): Declare. + +2003-06-26 Neil Booth + + * c-opts.c (missing_arg): Make non-static. + (c_common_handle_option): Don't check for missing arguments. + * opts.c (handle_option): Check for missing arguments. + +2003-06-26 David Edelsohn + + * config/rs6000/power4.md (power4-veccomplex): Correct latency. + +2003-06-25 Loren James Rittle + + * configure.in (ld_vers): Portability [sed]. + * configure: Regenerate with autoconf213. + +2003-06-25 H.J. Lu + + * doc/extend.texi: Document new builtin functions for Intel + Prescott New Intrunctions. + + * doc/invoke.texi: Document new command-line options, -mpni and + -mno-pni, for Intel Prescott New Intrunctions. + + * config.gcc (extra_headers): Add pmmintrin.h for i[34567]86-*-*. + + * config/i386/i386.c (override_options): Turn on MASK_SSE2 + for -mpni. Turn on MASK_SSE for -msse2. + (bdesc_2arg): Add PNI builtins with 2 args. + (bdesc_1arg): Add PNI builtins with 1 arg. + (ix86_init_mmx_sse_builtins): Handle PNI builtins. + (ix86_expand_builtin): Likewise. + + * config/i386/i386.h (MASK_3DNOW, MASK_3DNOW_A, + MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT, + MASK_TLS_DIRECT_SEG_REFS): Renumbered. + (TARGET_PNI): New. + (TARGET_SWITCHES): Don't enable MASK_SSE for -msse2 here. Add + -mpni and -mno-pni. + (TARGET_CPU_CPP_BUILTINS): Defined __PNI__ for PNI. + (ix86_builtins): Add PNI builtins. + (config/i386/i386.md): Add PNI patterns. + + * config/i386/pmmintrin.h: New file. + +2003-06-25 Kazu Hirata + + * config/h8300/h8300.md (call): Fix the insn lengths. + (call_value): Likewise. + +Thu Jun 26 00:13:35 CEST 2003 Jan Hubicka + + * c-common.c (handle_used_attribute): Use mark_referenced. + * varasm.c (mark_referenced): Break out from ... + (assemble_name): ... here. + * tree.h (mark_referenced): Declare. + +2003-06-25 Wolfgang Bangerth + + * gccbug.in: Add PCH to list of categories. + +2003-06-25 Martin Schaffner + + * cppfiles.c: Clarify comments. + * cpphash.h: Likewise. + * cpplib.h: Likewise. + * cppmacro.c: Likewise. + * mkdeps.h: Likewise. + +2003-06-25 Neil Booth + + * c-opts.c (complain_wrong_lang, write_langs): Remove. + (c_common_handle_option): Complaints about wrong language are + handled in opts.c now. + * opts.c (complain_wrong_lang, write_langs, handle_options): New. + (find_opt): Fix thinko. + (handle_option): Update prototype. Complain about switches for + a different front end. + * opts.h (lang_names, handle_options): New. + (handle_option): Remove. + * opts.sh: Write out language names array. + * toplev.c (parse_options_and_default_flags): Use handle_options. + +2003-06-25 H.J. Lu + + * config/i386/i386.c (MASK_SSE1): Removed. + (MASK_SSE164): Removed. + (MASK_SSE264): Removed. + (bdesc_2arg): Replace MASK_SSE1 with MASK_SSE. Replace + MASK_SSE164 with MASK_SSE | MASK_64BIT. Replace MASK_SSE264 + with MASK_SSE2 | MASK_64BIT. + (bdesc_1arg): Likewise. + (ix86_init_mmx_sse_builtins): Likewise. + + * config/i386/i386.h (TARGET_SSE): Remove MASK_SSE2. + (TARGET_SWITCHES): Enable both MASK_SSE and MASK_SSE2 for + -msse2. + +2003-06-25 Kaveh R. Ghazi + + * hwint.h (HOST_WIDE_INT_PRINT, HOST_WIDE_INT_PRINT_C): New macros. + (HOST_WIDE_INT_PRINT_DEC_SPACE, + HOST_WIDE_INT_PRINT_UNSIGNED_SPACE, + HOST_WIDEST_INT_PRINT_DEC_SPACE, + HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE): Delete. + (HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_DEC_C, + HOST_WIDE_INT_PRINT_UNSIGNED, HOST_WIDE_INT_PRINT_HEX): Define in + terms of HOST_WIDE_INT_PRINT and possibly HOST_WIDE_INT_PRINT_C. + + * final.c (asm_fprintf): Use HOST_WIDE_INT_PRINT. + * ra-debug.c (dump_static_insn_cost): Likewise. + +2003-06-26 Nick Clifton + + * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Define instead + of ADJUST_FIELD_ALIGN if IN_TARGET_LIBS. + Replace occurances of '???' with 'XXX' incase they are + mistaken for trigraphs. + (THUMB_PRINT_OPERAND_ADDRESS): abort if a compound address + does not have a register for the first operand. + +2003-06-25 Dhananjay Deshpande + + * config/sh/sh.c (sh_register_move_cost): + Add case for moving between MAC_REGS. + +2003-06-25 Zack Weinberg + + PR 10178 + * langhooks.h (struct lang_hooks): Add no_body_blocks bool. + * langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false. + * c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS + to true. + * stmt.c (is_body_block): If lang_hooks.no_body_blocks, always + return 0. + +2003-06-25 Kaveh R. Ghazi + + * Makefile.in (bt-load.o): Depend on $(TM_P_H). + * bt-load.c: Include "tm_p.h". + +2003-06-25 Kazu Hirata + + * config/h8300/h8300.c (compute_mov_length): Adjust for the + new optimization. + * config/h8300/h8300.md (*movsi_h8300): Optimize the load of + an SImode constant whose upper and lower are the same. + +Wed Jun 25 11:31:59 CEST 2003 Jan Hubicka + + * varasm.c (assemble_name): Mark needed variables even when + global info is ready. + +2003-06-24 Jerry Quinn + + PR other/11280 + * gcc/doc/invoke.texi (Optimization Options): Remove -Os from + -freorder-functions description. + +2003-06-25 Josef Zlomek + + * dwarf2out.c (gen_field_die): Return if type of decl is error mark. + +2003-06-25 Neil Booth + + * opts.c (common_handle_option): Add missing break;s. + +2003-06-24 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + compute_mov_length. + * config/h8300/h8300.c (compute_mov_length): New. + * config/h8300/h8300.md (*movqi_h8300): Use it. + (*movqi_h8300hs): Likewise. + (movstrictqi): Likewise. + (*movhi_h8300): Likewise. + (*movhi_h8300hs): Likewise. + (movstricthi): Likewise. + (*movsi_h8300): Likewise. + (*movsf_h8300): Likewise. + (*movsi_h8300hs): Likewise. + (*movsf_h8300hs): Likewise. + +2003-06-24 Kazu Hirata + + * jump.c (next_nondeleted_insn): Remove. + * rtl.h: Remove the prototype for next_nondeleted_insn. + +2003-06-24 Roger Sayle + + PR optimization/11311 + * builtins.c (powi_cost): Fix typo. The number of multiplications + required is the number to reduce the argument, result, plus the + cost of calculating the residual, val [not n, the original value]. + +2003-06-24 Roger Sayle + + * config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define. + +2003-06-24 Richard Henderson + (blame to: Loren James Rittle ) + + * real.h (ieee_extended_intel_96_round_53_format): New. + * real.c (ieee_extended_intel_96_round_53_format): New. + * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it + for XFmode and TFmode. + +2003-06-24 Kazu Hirata + + * config/h8300/h8300.md (4 anonymous patterns): Give internal + names. + (movsi_h8300): Change the name to *movsi_h8300. + (movsi_h8300hs): Change the name to *movsi_h8300hs. + (movsf_h8300): Change the name to *movsf_h8300. + (movsf_h8300hs): Change the name to *movsf_h8300hs. + +2003-06-24 Jakub Jelinek + + * builtins.c (expand_builtin_strcpy): Don't evaluate side-effects in + src twice. + +2003-06-24 J"orn Rennecke + + Back out these patches: + 2003-06-02 J"orn Rennecke + * sh.h (OLD_ARG_MODE): New macro. + (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it. + (FUNCTION_ARG_1): Break out of: + (FUNCTION_ARG). Use OLD_ARG_MODE. + 2003-06-06 J"orn Rennecke + * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode + of the generated register. + + * sh.h (FUNCTION_ARG_SCmode_WART): Define. + (FUNCTION_ARG): Unless FUNCTION_ARG_SCmode_WART is defined and + an even number of floating point regs are in use, use the same + sequence of argument passing registers for SCmode as would be + used for two SFmode values. + * sh.c (sh_va_arg): If FUNCTION_ARG_SCmode_WART is defined, + swap real / imaginary parts in incoming SCmode values passed + in registers. + +2003-06-24 Falk Hueffner + + PR target/11260 + * config/alpha/alpha.md (sqrtdf2): Fix operand substitution. + +Tue Jun 24 18:49:33 CEST 2003 Jan Hubicka + + * Makefile.in (cgraph.o): Depend on output.h, not depend on + tree-inline.h + * cgraph.c: Do not include tree-inline.h; include output.h + (known_fns): Rename to ... + (known_decls): ... this one; update all uses. + (cgraph_varpool_hash): New static variable. + (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global + variables. + (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node, + cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node, + cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls): + New functions. + * cgraph.h (cgraph_varpool_node): New structure. + (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare. + (cgraph_varpool_node, cgraph_varpool_node_for_identifier, + cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node, + cgraph_varpool_asemble_pending_decls): Declare. + * cgraphunit.c (record_call_1): Notice variable references. + (cgraph_finalize_compilation_unit): Assemble pending variables. + * toplev.c (wrapup_global_declarations): Use varpool. + (compile_file): Assemble pending declarations. + (rest_of_decl_compilation): Use varpool in unit-at-a-time mode. + * varasm.c (assemble_name): Notice varpool references. + +Tue Jun 24 13:52:11 CEST 2003 Jan Hubicka + + * langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro. + * langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable. + * varasm.c (assemble_variable): Call prepare_assemble_variable. + +2003-06-23 Roger Sayle + + * builtins.c (expand_builtin): Use expand_builtin_pow to expand + calls for pow, powf, powl and their __builtin_ variants. + (expand_builtin_pow): If the second argument is a constant + integer and compiling with -ffast-math, use expand_powi to + generate RTL if powi_cost is less than POWI_MAX_MULTS. + (powi_cost): New function to return the number of multiplications + necessary to evaluate an Nth power, for integer constant N. + (expand_powi): New function to expand the RTL for evaluating + the Nth power of a floating point value, for integer constant N. + + * doc/tm.texi (POWI_MAX_MULTS): Document new target macro. + +Mon Jun 23 23:07:35 CEST 2003 Jan Hubicka + + * cgraph.c (cgraph_nodes_queue): Declare. + (eq_node): Take identifier as p2. + (cgraph_node): Update htab_find_slot_with_hash call. + (cgraph_node_for_identifier): New. + (cgraph_mark_needed_node): Move here from cgraphunit.c. + * cgraph.h (cgraph_nodes_queue): Declare. + (cgraph_node_for_identifier): Declare. + * cgraphunit.c (cgraph_finalize_function): Collect entry points here + instead of in cgraph_finalize_compilation_unit; constructors and + destructors are entry points. + (cgraph_finalize_compilation_unit): Reorganize debug outout; + examine nested functions after lowerng; call collect_functions hook. + (cgraph_mark_local_functions): DECL_COMDAT functions are not local. + (cgraph_finalize_compilation_unit): Do not collect entry points. + * varasm.c: Include cgraph.h + (assemble_name): Mark referenced identifier as needed. + + * cgraphunit.c (record_call_1): Use get_callee_fndecl. + +2003-06-23 Jakub Jelinek + + * config/i386/i386.c (x86_output_mi_thunk): Don't pass MEM to %P0, + just SYMBOL_REF. + * config/s390/s390.c (s390_output_mi_thunk): Avoid .plt in -m31 + mode, as it requires pic register loaded. + + * varasm.c (resolve_unique_section): Remove prototype. No longer + static. + * tree.h (resolve_unique_section): New prototype. + +2003-06-23 Andreas Schwab + + PR debug/9905 + * dwarf2out.c (loc_descriptor_from_tree): Handle MODIFY_EXPR by + recursing through first argument. + +2003-06-23 Kazu Hirata + + * ChangeLog.1: Fix a typo. + * cfgrtl.c: Fix comment typos. + * dwarf2out.c: Likewise. + * expmed.c: Likewise. + * genrecog.c: Likewise. + * jump.c: Likewise. + * rtlanal.c: Likewise. + * ssa-dce.c: Likewise. + * toplev.c: Likewise. + +2003-06-23 Kazu Hirata + + * doc/extend.texi: Fix typos. + * doc/md.texi: Likewise. + * doc/tm.texi: Likewise. + +2003-06-23 Kazu Hirata + + * basic-block.h: Fix comment formatting. + * bt-load.c: Likewise. + * builtins.c: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-format.c: Likewise. + * coverage.c: Likewise. + * cpplib.h: Likewise. + * cpppch.c: Likewise. + * dbxout.c: Likewise. + * diagnostic.c: Likewise. + * dwarf2out.c: Likewise. + * expr.c: Likewise. + * fold-const.c: Likewise. + * function.c: Likewise. + * gcc.c: Likewise. + * gcov-io.c: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * profile.c: Likewise. + * real.h: Likewise. + * sched-deps.c: Likewise. + +2003-06-23 Roger Sayle + Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add a note on testing and + remove duplicates from testers list. + +2003-06-23 Nick Clifton + + * read-rtl.c (read_braced_string): Check for EOF. If + encountered issue an error message. + +2003-06-23 Kazu Hirata + + * doc/invoke.texi: Document dump options, dT and dW. + +2003-06-23 Kazu Hirata + + * genrecog.c (pred_table): Remove the entry for + mode_independent_operand. + * recog.c (next_insns_test_no_inequality): Remove. + (mode_independent_operand): Likewise. + * recog.h: Remove the prototype for mode_independent_operand. + +2003-06-22 Kazu Hirata + + * config/h8300/h8300.c (output_simode_bld): Use rotxl.l to + store into bit 0. + * config/h8300/h8300.md (*extzv_1_r_h8300hs): Change cc of the + second alternative to set_znv. + (*extzv_1_r_inv_h8300hs): Likewise. + +2003-06-23 Hans-Peter Nilsson + + * configure.in (in_tree_gas): Find out here whether GAS is ELF, + set in_tree_gas_is_elf accordingly. + (in_tree_ld): Find out whether LD emulation is ELF, set + in_tree_ld_is_elf accordingly. + (gcc_cv_as_subsections, gcc_cv_as_hidden, gcc_cv_as_leb128) + (gcc_cv_as_eh_frame, gcc_cv_as_shf_merge) + (gcc_cv_as_dwarf2_debug_line, gcc_cv_as_gdwarf2_flag) + (gcc_cv_as_gstabs_flag): Use $in_tree_gas_is_elf instead of + grepping gas/Makefile. + (gcc_cv_ld_ro_rw_mix, gcc_cv_ld_eh_frame_hdr, gcc_cv_ld_pie): Use + $in_tree_ld_is_elf instead of grepping ld/Makefile. + * configure: Regenerate. + +2003-06-22 Roger Sayle + + * builtins.c (expand_builtin_mathfn_2): Use tree_cons to build + up the stabilized argument list, not build_tree_list. + (expand_builtin_strcpy): Construct new argument list manually + instead of using chainon to modify the original argument list. + (expand_builtin_stpcpy): Construct new argument list manually + instead of using copy_list and chainon. + (expand_builtin_sprintf): New function. Optimize calls to + sprintf when the format is "%s" or doesn't contain a '%'. + (expand_builtin): Expand BUILT_IN_SPRINTF using the new function + expand_builtin_sprintf. + +2003-06-22 Andreas Schwab + + * function.c (set_insn_locators): Mark as unused. + +2003-06-22 Neil Booth + + * common.opt: Add -finline-limit. + * opts.c (common_handle_options): Handle it. + * opts.sh: Temporary kludge for -finline-limit. + * toplev.c (decode_f_option, independent_decode_option): Die. + (parse_options_and_default_flags): No independent_decode_option. + +2003-06-22 Andreas Jaeger + + * calls.c (emit_call_1): Readd lost ATTRIBUTE_UNUSED. + +2003-06-22 Kazu Hirata + + * doc/invoke.texi: Document dumps, .btl, .cfg, and .bypass. + +2003-06-22 Andreas Schwab + + * doc/invoke.texi: Remove leading `-' from options in index. + +2003-06-22 Kazu Hirata + + * bt-load.c: Follow spelling conventions. + +2003-06-22 Kazu Hirata + + * expr.c (emit_move_insn_1): Fix a comment typo. + +2003-06-22 Kazu Hirata + + * doc/invoke.texi: Alphabetize dump options. + +2003-06-22 Kazu Hirata + + * doc/invoke.texi: Remove a duplicate -dk. + +2003-06-22 Kazu Hirata + + * doc/invoke.texi: Update dump file names. + +2003-06-22 Zack Weinberg + + * config/i370/i370.c, config/i370/i370.h: Use HOST_CHARSET_ASCII + and HOST_CHARSET_EBCDIC, not HC_ASCII and HC_EBCDIC. + +2003-06-22 Kazu Hirata + + * doc/rtl.texi: Fix the @findex for pre_modify. + +2003-06-22 Andreas Jaeger + + * caller-save.c: Convert to ISO C90. + * calls.c: Likewise. + * cfg.c: Likewise. + * cfganal.c: Likewise. + * cfgbuild.c: Likewise. + * cfgcleanup.c: Likewise. + * cfghooks.c: Likewise. + * cfglayout.c: Likewise. + * cfglayout.h: Likewise. + * cfgloop.c: Likewise. + * cfgloop.h: Likewise. + * cfgloopanal.c: Likewise. + * cfgloopmainip.c: Likewise. + * cfgrtl.c: Likewise. + +2003-06-22 Richard Earnshaw + + * arm.h (BIGGEST_ALIGNMENT): Use TARGET_REALLY_IWMMXT for selecting + 64-bit alignment. + +2003-06-22 Richard Earnshaw + + * arm.md (all call_value patterns): Remove register constraints on + value operand. + +2003-06-22 Neil Booth + + * common.opt: More -f switches. + * opts.c (common_handle_options): Handle them. + * toplev.c (time_report): Make extern. + (f_options): USe flag_dummy. + (decode_f_option): No need to use f_options now. + * toplev.h (flag_cprop_registers, flag_ssa, flag_ssa_ccp, + flag_ssa_dce, time_report, flag_new_regalloc): Make extern. + +2003-06-22 Andreas Jaeger + + * c-lex.c: Convert to ISO C90. + * c-objc-common.c: Likewise. + * c-opts.c: Likewise. + * c-pch.c: Likewise. + * c-ppoutput.c: Likewise. + * c-pragma.h: Likewise. + * c-pretty-print.c: Likewise. + * c-pretty-print.h: Likewise. + * c-semantics.c: Likewise. + * c-tree.h: Likewise. + * c-typeck.c: Likewise. + + * c-lang.c: Convert to ISO C90. + +2003-06-22 Neil Booth + + * opts.c (find_opt): Fix to always guarantee a find of a + switch with joined parameter. + * opts.h (struct cl_option): New member back_chain. + * opts.sh: Update to calculate and add back_chain member. + +2003-06-22 Gabriel Dos Reis + + * diagnostic.h (output_host_wide_integer): Declare. + * diagnostic.c (output_long_long_decicaml): New function. + (output_host_wide_integer): Likewise. + (output_format): Use them. Handle "%ll" and "%w". + +2003-06-21 Jason Thorpe + + * config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file. + +2003-06-21 Zack Weinberg + + * aclocal.m4 (gcc_AC_C_CHARSET): Delete. + * configure.in: Don't use gcc_AC_C_CHARSET. + * configure, config.in: Regenerate. + * config/i370/i370.c, config/i370/i370.h: Use + (HOST_CHARSET == HC_EBCDIC) or (HOST_CHARSET == HC_ASCII) + instead of HOST_EBCDIC or !HOST_EBCDIC. Clarify comments a tad. + +2003-06-21 Neil Booth + + * Makefile.in: Update. + * common.opt: New switches. + * opts.c: Include diagnostic.h. + (common_handle_option): Handle new switches. + * toplev.c (flag_loop_optimize, flag_crossjumping, flag_if_conversion, + flag_if_conversion2, flag_delete_null_pointer_checks, + flag_rerun_cse_after_loop): Make extern. + (flag_dummy): New. + (f_options): Update to use flag_dummy for moved options. + (decode_f_option): Some switches moved to opts.c. + * toplev.h (flag_loop_optimize, flag_crossjumping, flag_if_conversion, + flag_if_conversion2, flag_delete_null_pointer_checks, + flag_rerun_cse_after_loop, flag_keep_static_consts, flag_peel_loops, + flag_tracer, flag_thread_jumps, flag_unroll_loops, + flag_unroll_all_loops, flag_unswitch_loops): New. + +Sat Jun 21 13:41:00 CEST 2003 Jan Hubicka + + * i386.c (ix86_va_arg): Fix allocation of temporary slot. + +2003-06-20 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + same_cmp_preceding_p. + * config/h8300/h8300.c (same_cmp_preceding): New. + * config/h8300/h8300.md: Extend peephole2's that transform + compare:SI into shorter sequences so that they can deal with + signed comparisons. + +2003-06-21 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Use Windows instead of Win32. + + Update Andreas Jaeger's entry. + + Merge the two entries of Kaveh Ghazi, David Edelsohn, and + Loren J. Rittle. + +2003-06-21 Nathanael Nerode + + * mkconfig.sh: Add multiple inclusion guards to generated headers. + +2003-06-20 Neil Booth + + * c-decl.c (store_parm_decls): Make saved_warn_shadow boolean. + * common.opt: Add remaining -W options and -g. + * diagnostic.c (warnings_are_errors): Remove. + * flags.h: Make most warning flags boolean. + * opts.c (common_handle_option): Handle remaining -W options, and -g. + Move many warning flags from toplev.c, making them boolean. + * toplev.c: Remove many warning flags. + (decode_W_option): Remove. + (decode_g_option): Make extern. Error on unknown switch. + (lang_independent_W_options): Use warn_dummy. + (independent_decode_option): Just handle -f switches now. + * toplev.h (decode_g_option): New. + +2003-06-20 Aldy Hernandez + + PR/11092 + * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Adjust for + vectors. + +2003-06-20 Kelley Cook + + * opts.sh: Tweak awk script for portability. + +2003-06-20 Mark Mitchell + + PR c++/10888 + * tree-inline.c (expand_call_inline): Do not warn about failing to + inline functions declared in system headers. + * doc/invoke.texi (-Winline): Expand on documentation. + +2003-06-20 Richard Henderson + + * config/alpha/alpha.c (alpha_file_start): Disable + file_start_file_directive for ELF and not MDEBUG. + +2003-06-20 J"orn Rennecke + + * sh.h (ROUND_TYPE_ALIGN): Remove. + +2003-06-20 Richard Henderson + + * hooks.c (hook_int_void_no_regs): Rename from + hook_reg_class_void_no_regs; change return type. + * hooks.h: Update. + * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Update. + * target.h (branch_target_register_class): Change return type to int. + Add documentation. + * config/sh/sh.c (sh_target_reg_class): Change return type. + * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. + +2003-06-20 Andreas Tobler + + * c-format.c: Change _Bool to bool reverting part of the last + patch. + +2003-06-20 John David Anglin + + * som.h (ASM_OUTPUT_SOURCE_LINE): Use targetm.strip_name_encoding to + strip name encoding. + +2003-06-20 Rainer Orth + + * configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns. + * configure: Regenerate. + Fixes PR driver/9362. + +2003-06-20 Richard Kenner + + * config/alpha/alpha.c (alpha_file_start): Fix typo. + +2003-06-20 Rainer Orth + + * config/mips/mips.h (PUT_SDB_FUNCTION_END): Pass 0 as third arg + to ASM_OUTPUT_SOURCE_LINE. + +2003-06-20 Daniel Egger + Gerald Pfeifer + + * doc/install.texi (Building): Correct and improve statement + about parallel builds. + +2003-06-20 Andreas Jaeger + + * c-common.c: Change _Bool to bool reverting part of the last + patch. + +2003-06-20 Nathan Sidwell + + * tree.h (expand_function_end): Remove all parameters. + * function.c (expand_function_end): Remove all parameters. + Use input_location. Never expand_end_bindings. + * c-decl.c (c_expand_body_1): Adjust expand_function_end call. + * coverage.c (create_coverage): Likewise. + +2003-06-20 Nick Clifton + + * doc/extend.texi (ARM Built-in Functions): New node. Document + ARM builtin functions for iWMMXt support. + +2003-06-20 Eric Botcazou + + * doc/install.texi (--with-gnu-as): Mention SPARC/Solaris and + SPARC64/Solaris as platforms where --with-gnu-as makes a difference. + (--with-as): Add @anchor. + (--with-gnu-ld): Fix typo. + (--with-ld): Add @uref to --with-as. + +2003-06-19 Zack Weinberg + + * doc/tm.texi: Uniformly use @defmac for macros, rather than + @table items. Minor formatting and editorial corrections. + +2003-06-20 Neil Booth + + * line-map.c, line-map.h: Convert to ISO prototypes. + +2003-06-20 Zdenek Dvorak + + * gcse.c (store_killed_in_insn): Fix. + +2003-06-19 Zack Weinberg + + * target.h (asm_out.file_start, file_start_app_off, + file_start_file_directive): New hooks. + * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, + TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): + New hook-definition macros. + * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. + * varasm.c (default_file_start): New. + * output.h: Prototype it. + * toplev.c (init_asm_output): Use targetm.asm_out.file_start. + * system.h: Poison ASM_FILE_START. + + * config/alpha/alpha.c (alpha_write_verstamp): Delete. + (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. + (unicosmk_asm_file_start): Rename unicosmk_file_start, + make static, take no arguments. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, + TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. + * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor + TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in + comment. + * config/arc/arc.c (arc_asm_file_start): Rename + arc_file_start, take no arguments, make static. + (TARGET_ASM_FILE_START): Set it. + * config/arm/arm.c (aof_file_start): New static function. + (TARGET_ASM_FILE_START): Set it, when appropriate. + * config/arm/coff.h, config/arm/elf.h: + Set TARGET_ASM_FILE_START_APP_OFF to true. + * config/avr/avr.c (asm_file_start): Rename avr_file_start, + take no arguments, make static. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): + Set them. + * config/c4x/c4x.c (c4x_file_start): New static function. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): + Set them. + * config/cris/cris.c (cris_file_start): New static function. + (TARGET_ASM_FILE_START): Set it. + * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename + dsp16xx_file_start, make static. + (luxworks_dsp16xx_file_start): Delete. + (TARGET_ASM_FILE_START): Set it. + * config/h8300/h8300.c (asm_file_start): Rename + h8300_file_start, make static, take no arguments. + (TARGET_ASM_FILE_START): Set it. + * config/i370/i370.c (i370_file_start): New static function. + (TARGET_ASM_FILE_START): Set it. + * config/i386/i386.c (x86_file_start): New static function. + (TARGET_ASM_FILE_START): Set it. + * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, + X86_FILE_START_FLTUSED): New macros, default to false. + * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. + * config/i386/sysv4.h, config/i386/sco5.h: Override + X86_FILE_START_VERSION_DIRECTIVE to true. + * config/ia64/ia64.c (ia64_file_start): New static function. + (TARGET_ASM_FILE_START): Set it. + (emit_safe_across_calls): Take no arguments. + * config/ia64/ia64.md: Update to match. + * config/m32r/m32r.c (m32r_asm_file_start): Rename + m32r_file_start, make static, take no arguments. + (TARGET_ASM_FILE_START): Set it. + * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename + m68hc11_file_start, make static, take no arguments. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + (print_options): Delete. + * config/m68k/m68k.c (m68k_hp320_file_start): New static function. + (TARGET_ASM_FILE_START_APP_OFF): Set. + * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to + m68k_hp320_file_start. + * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): + Make static, take no arguments. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + * config/mmix/mmix.c (mmix_asm_file_start): Rename + mmix_file_start, make static, take no arguments. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + * config/mn10300/mn10300.c (asm_file_start): Rename + mn10300_file_start, make static, take no arguments. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. + * config/pa/pa.c (pa_file_start_level, pa_file_start_space, + pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, + pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, + pa_hpux64_hpas_file_start): New static functions. + * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. + * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to + pa_linux_file_start. + * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to + pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as + appropriate. + * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. + * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. + (rs6000_file_start): Make static, take no arguments. Reset + default_cpu under certain conditions. + (rs6000_xcoff_file_start): New function. + * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. + * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, + TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. + * config/sh/sh.c (output_file_start): Rename + sh_file_start, make static, take no arguments. Merge in old + code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + * config/sh/sh.c (TARGET_ELF): Define to 0. + * config/sh/elf.h (TARGET_ELF): Redefine to 1. + * config/v850/v850.c (asm_file_start): Delete. + (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. + * config/vax/vax.c (vax_file_start): New static function. + (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. + + * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. + * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h + * config/i386/att.h, config/i386/gas.h, config/i386/linux.h + * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h + * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h + * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. + + * config/darwin.h, config/elfos.h, config/alpha/elf.h + * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h + * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h + * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h + * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h + * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h + * config/i370/i370.h, config/i386/att.h, config/i386/gas.h + * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h + * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h + * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h + * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h + * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h + * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h + * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h + * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h + * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h + * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h + * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. + + * config/alpha/alpha-protos.h, config/arc/arc-protos.h + * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h + * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h + * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h + * config/mips/mips-protos.h, config/mmix/mmix-protos.h + * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h + * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. + + * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: + Remove reference to ASM_FILE_START in comment. + * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h + * config/arm/linux-gas.h, config/arm/netbsd-elf.h + * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. + +2003-06-19 Graeme Peterson + + * gcc.c (target_sysroot_suffix, target_sysroot_hdrs_suffix, + SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC, sysroot_suffix_spec, + sysroot_hdrs_suffix_spec): New. + (static_specs): Initialize new variables. + (add_sysroot_suffix_prefix, do_spec_1, main): Use new variables. + * doc/tm.texi (SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC): + New macros. + +2003-06-19 Andreas Jaeger + + * c-aux-info.c: Convert to ISO C90. + * c-pragma.c: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-convert.c: Likewise. + * c-cppbuiltin.c: Likewise. + * c-dump.c: Likewise. + * c-decl.c: Likewise + * c-format.c: Likewise. + * c-incpath.c: Likewise. + * c-incpath.h: Likewise. + +2003-06-19 Roger Sayle + + * builtins.c (expand_errno_check): Assume that flag_errno_math + and HONOR_NANS have been tested before calling here. Only try + to set errno ourselves if the decl can't throw an exception. + (expand_builtin_mathfn): Move the code to stabilize the arg + after the main switch, so that that its only done when needed. + BUILT_IN_SQRT{,F,L} doesn't set errno if its arg is nonnegative. + Don't modify the original expr when stabilizing the argument. + (expand_builtin_mathfn_2): Likewise, move the code to stabilize + the args after the main switch, and don't modify the orginal exp. + +2003-06-19 Aldy Hernandez + + * expr.c (const_vector_from_tree): Initialize remaining elements + to 0. + +2003-06-19 Aldy Hernandez + + * config/rs6000/spe.md ("spe_evfscfsi"): Change operand types. + Change "fix" to "float". + +2003-06-19 Andreas Jaeger + + * c-tree.h: Remove declaration of poplevel. + + * tree.h: Remove declaration of approx_sqrt. + + * c-lex.c: Remove redundant declaration of asm_out_file. + + * flags.h: Remove declaration of warn_unknown_pragma and + main_input_filename. + + * rtl.h: Remove functions from fold-const.c since they're already + declared in tree.h. + + * regs.h: Remove redundant declaration of reg_names. + + * bt-load.c (migrate_btr_defs): Correct printf arguments. + + * protoize.c: Fix breakage from last patch. + +2003-06-19 J"orn Rennecke + + * hooks.h (hook_reg_class_void_no_regs): Only declare if tm.h + has been included. + +2003-06-18 James A Morrison + + * config/sparc/sparc.c: Update copyright year. + +2003-06-19 David Edelsohn + + * config/rs6000/rs6000.c (init_cumulative_args): Limit CALL_LIBCALL + to ABI_V4. + +2003-06-18 Joseph S. Myers + + PR bootstrap/4068 + * config/i386/liunx.h: Don't include sys/ucontext.h for glibc 2.0. + +2003-06-19 Kazu Hirata + + * config/h8300/h8300.c (TARGET_INITIALIZER and friends): Move + to the end of the file. Remove unnecessary prototypes. + +2003-06-19 Hans-Peter Nilsson + + * bt-load.c (migrate_btr_def) [INSN_SCHEDULING]: Conditionalize + calls to insn_default_latency and result_ready_cost. Initialize + def_latency to 1. + +2003-06-18 Richard Henderson + + * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New. + (_Unwind_FindEnclosingFunction): Implement. + +2003-06-18 Kazu Hirata + + * toplev.c (rest_of_handle_sched): Hide the entire function if + INSN_SCHEDULING is not defined. + (rest_of_compilation): Call rest_of_handle_sched() only when + INSN_SCHEDULING is defined. + +2003-06-18 Stephen Clarke + J"orn Rennecke + + * bt-load.c: New file. + * Makefile.in (OBJS): Include bt-load.o + (bt-load.o): Add dependencies. + * flags.h (flag_branch_target_load_optimize): Declare. + (flag_branch_target_load_optimize2): Likewise. + * hooks.c (hook_reg_class_void_no_regs): New function. + (hook_bool_bool_false): Likewise. + * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. + * rtl.h (branch_target_load_optimize): Declare. + * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. + (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. + (TARGET_INITIALIZER): Include these. + * target.h (struct gcc_target): Add branch_target_register_class + and branch_target_register_callee_saved members. + * toplev.c (enum dump_file_index): Add DFI_branch_target_load + (dump_file) Add "tars" entry. + (flag_branch_target_load_optimize): New variable. + (flag_branch_target_load_optimize2): Likewise. + (lang_independent_options): Add entries for new options. + (rest_of_compilation): Call branch_target_load_optimize. + * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. + (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. + * doc/invoke.texi: Document -fbranch-target-load-optimize and + -fbranch-target-load-optimize2. + * rtl.h (epilogue_completed): Declare. + * recog.c (epilogue_completed): New variable. + * toplev.c (rest_of_compilation): Set it. + * flow.c (mark_regs_live_at_end): Use it. + * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. + * config/sh/sh.c (sh_output_mi_thunk): Likewise. + * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. + + * sh.c (shmedia_space_reserved_for_target_registers): New variable. + (sh_target_reg_class): New function. + (sh_optimize_target_register_callee_saved): Likwise. + (shmedia_target_regs_stack_space): Likewise. + (shmedia_reserve_space_for_target_registers_p): Likewise. + (shmedia_target_regs_stack_adjust): Likewise. + (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. + (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. + (calc_live_regs): If flag_branch_target_load_optimize2 and + TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved + for target registers, make sure that we save all target registers. + (sh_expand_prologue, sh_expand_epilogue): Take target register + optimizations into account. Collapse stack adjustments if that + is beneficial. + (initial_elimination_offset): Reserve space for target registers + if necessary. + * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. + (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. + +2003-06-18 Nick Clifton + + * config.gcc: Add an extra_header for ARM targets. + Support configuring with --with-cpu=iwmmxt. + * doc/invoke.texi: Document new value for -mcpu= ARM switch. + * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register + names. Fix formatting. + * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register + names. + * config/arm/arm-protos.h (arm_emit_vector_const): New + prototype. + (arm_output_load_gr): New prototype. + * config/arm/arm.c (extra_reg_names1): Delete. + (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT, + * arch_is_iwmmxt): Define. + (all_cores, all_architecture): Add entry for iwmmxt. + (arm_override_options): Add support for iwmmxt. + (use_return_insn, arm_function_arg, arm_legitimate_index_p, + arm_print_value, arm_rtx_costs_1, output_move_double, + arm_compute_save_reg_mask, arm_output_epilogue, + arm_get_frame_size, arm_expand_prologue, arm_print_operand, + arm_assemble_integer, arm_hard_regno_ok, arm_regno_class): + Likewise. + (arm_init_cumulative_args): Count iwmmxt registers. + (arm_function_ok_for_sibcall): Return false of sibcall_blocked + has been set. + (struct minipool_node): Add fix_size field. + (add_minipool_forward_ref): Add support for 8-byte aligning of + the pool. + (add_minipool_backward_ref, add_minipool_offsets, + dump_minipool, push_minipool_fix): Likewise. + (struct builtin_description): New struct. + (builtin_description): New array of iwmmxt builtin functions. + (arm_init_iwmmxt_builtins): New function. + (arm_init_builtins): New function. + (safe_vector_operand): New function. + (arm_expand_binop_builtin): New function. + (arm_expand_unop_builtin): New function. + (arm_expand_builtin): New function. + (arm_emit_vector_const): New function. + (arm_output_load_gr): New function. + * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT, + TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT, + TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN, + DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define. + (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled. + (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt. + (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER, + reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, + REG_CLASS_FOR_LETTER): Add iwmmxt registers. + (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt + registers unless the iwmmxt target is selected. + (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM, + FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM, + IS_IWMMXT_GR_REGNUM): Define. + (FIRST_PSEUDO_REGISTER): Bump to 63. + (struct machine_function): Add sibcall_blocked field. + (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and + nargs fields. + (enum arm_builtins): New enum list. + * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC, + UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS, + UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI, + UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs. + (VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ, + VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs. + (movv2si, movv4hi, movv8qi): New expands for vector moves. + Include iwmmxt.md. + * config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt + multilib. + (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise. + * config/arm/mmintrin.h: New ARM specific header file. + * config/arm/iwmmx.md: New iWMMXt specific machine patterns. + +2003-06-18 J"orn Rennecke + + * toplev.c (Remaining -d letters summary): Update. + +2003-06-18 Franz Sirl + + * config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL + argument. + (function_arg): Handle CALL_LIBCALL flag. + * config/rs6000/rs6000-protos.h (init_cumulative_args): Update + prototype. + * config/rs6000/rs6000.h (CALL_LIBCALL): New macro. + (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. + (INIT_CUMULATIVE_ARGS): Add LIBCALL argument. + (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. + +2003-06-18 Neil Booth + + * Makefile.in: Update. + * common.opt: New options. + * opts.c (maybe_warn_unused_parameter, set_Wextra, handle_param, + set_Wunused): New. + (common_handle_option): Handle new options. + * toplev.c (set_target_switch): Export. + (set_Wextra, set_Wunused, maybe_warn_unused_parameter): Move to opts.c. + (decode_W_option): -Wunused and -Wextra handled in opts.c now. + (independent_decode_option): More options handled in opts.c now. + Change prototype. + * toplev.h (set_target_switch): New. + +2003-06-17 Robert Abeles + + PR debug/4252 + * c-opts.c (c_common_handle_option): Pass -fdump argument suffix + to dump_switch_p(). + * tree-dump.c (dump_switch_p): Remove redundant 'dump-' prefix + from static strings in dump_files. + +2003-06-17 Kaveh R. Ghazi + + * system.h (ANSI_PROTOTYPES, PTR_CONST, LONG_DOUBLE, VPARAMS, + VA_OPEN, VA_FIXEDARG, VA_CLOSE, VA_START): undef and poison these + libiberty macros. + +2003-06-17 Jason Merrill + + PR c++/10929 + * tree-inline.c (expand_call_inline): Don't warn about failing to + inline a function which was made inline by -finline-functions. + +2003-06-17 Kazu Hirata + + * config/h8300/h8300-protos.h: Update to ISO C. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + +2003-06-16 Nathanael Nerode + + * configure.in: Replace BUILD_CC references with CC_FOR_BUILD. + * configure: Regenerate. + * Makefile.in: Replace BUILD_CC references with CC_FOR_BUILD. + +2003-06-17 Ranjit Mathew + + * install.texi (Testing): Add information on how to run Java + runtime tests separately. + +2003-06-17 Rainer Orth + + * config/mips/mips.md (trap): Use break 0 when !TARGET_GAS. + + * config/mips/iris6-o32.h (MIPS_ISA_DEFAULT): Remove. + (MIPS_CPU_STRING_DEFAULT): Redefine to mips2. + +2003-06-17 Christopher Faylor + + * doc/install.texi: Add msvc rebuild caveat. + +2003-06-17 Kazu Hirata + + * config/sh/coff.h: Replace Hitachi with Renesas. + * config/sh/elf.h: Likewise. + * config/sh/embed-elf.h: Likewise. + * config/sh/lib1funcs.asm: Likewise. + * config/sh/sh-protos.h: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + * config/sh/sh.md: Likewise. + +2003-06-17 Kazu Hirata + + * ChangeLog.3: Fix comment typos. + * ChangeLog.6: Likewise. + * config/d30v/d30v.c: Likewise. + * config/h8300/h8300.md: Likewise. + * config/m32r/m32r.md: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.md: Likewise. + * config/ns32k/NOTES: Likewise. + +2003-06-17 Ranjit Mathew + Gerald Pfeifer + + * doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how + to run Java runtime tests separately. + +2003-06-17 Kazu Hirata + + * config/h8300/h8300-protos.h: Update a comment. + +2003-06-17 J"orn Rennecke + + * sh.h (ROUND_TYPE_ALIGN, LOCAL_ALIGNMENT): Complex modes + are aligned like integral modes. + (SH5_WOULD_BE_PARTIAL_NREGS): Also test for CDImode and DCmode. + + * sh.h (EXTRA_CONSTRAINT_Csy): Allow PIC_DIRECT_ADDR_P. + (LEGITIMATE_PIC_OPERAND_P): Allow LABEL_REF. + * sh.md (*pt): Remove. + + * sh.h (REG_ALLOC_ORDER): Avoid squandering call-saved registers. + + * sh.md (return_media_rte): New pattern. + (return_media): Use it. + +2003-06-17 Kazu Hirata + + * doc/contrib.texi: Replace Hitachi with Renesas. + * doc/install.texi: Likewise. + * doc/invoke.texi: Likewise. + +2003-06-17 J"orn Rennecke + + * sh.h (CONST_OK_FOR_J16): Fix HOST_BITS_PER_WIDE_INT >= 64 + behaviour. + +2003-06-17 Franz Sirl + + * doc/tm.texi (MD_FALLBACK_FRAME_STATE_FOR): Mention MAKE_THROW_FRAME. + + * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Partly revert + 2003-01-23 patch. Corrected to handle kernels with changed ucontext. + + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Error on invalid + -msdata=eabi usages. + + * gcc/config/rs6000/sysv4.h (USE_LIBC_1): Delete all uses. + +2003-06-17 Kaveh R. Ghazi + + * alloc-pool.c: Don't check HAVE_LONG_DOUBLE. + * fixinc/gnu-regex.c: Don't define `volatile'. + * ggc-page.c: Don't check HAVE_LONG_DOUBLE. + * ggc-simple.c: Likewise. + * system.h: Don't define `volatile'. + + * aclocal.m4 (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Delete. + * configure.in (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Don't + call these macros. + * config.in, configure: Regenerated. + +2003-06-17 Richard Kenner + + * config/ia64/ia64.c (ia64_expand_builtin, case IA64_BUILTIN_BSP): + Handle POINTERS_EXTEND_UNSIGNED. + +2003-06-17 Rainer Orth + + * config/mips/mips.c (TARGET_ASM_UNALIGNED_DI_OP) [TARGET_IRIX5 && + !TARGET_IRIX6]: Define as NULL. + +2003-06-17 Eric Botcazou + + * config/sparc/sparc.c (sparc_va_arg): Don't align 16-byte+ structures. + +2003-06-17 Eric Botcazou + + * dbxout.c (dbxout_source_line_counter): New global variable. + Mark it with GTY(()). + (dbxout_source_line): Increment dbxout_source_line_counter + and pass it to ASM_OUTPUT_SOURCE_LINE. + * sdbout.c (sdbout_source_line_counter): New global variable. + Mark it with GTY(()). + (unnamed_struct_number): Mark it with GTY(()). + (sdbout_source_line): Increment sdbout_source_line_counter + and pass it to ASM_OUTPUT_SOURCE_LINE. + * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter + (xcoffout_source_line): Pass 0 as third argument to + ASM_OUTPUT_SOURCE_LINE. + (xcoffout_begin_prologue): Likewise. + * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + Use it instead of 'sym_lineno' but without incrementing it. + * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/alpha/alpha.c (alpha_start_function): Pass 0 as third + argument to ASM_OUTPUT_SOURCE_LINE. + * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + * config/arm/aout.h: Remove useless comment. + * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + Use it instead of 'sym_lineno' but without incrementing it. + * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third + parameter. Use it instead of 'sym_lineno' but without incrementing it. + * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third + argument to ASM_OUTPUT_SOURCE_LINE. + * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter. + Use it instead of 'sym_lineno' but without incrementing it. + * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise. + * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter. + +2003-06-17 Richard Sandiford + + * config/mips/mips-protos.h (mips_expand_block_move): Declare. + (expand_block_move, output_block_move): Remove. + * config/mips/mips.h (enum block_move_type): Remove. + * config/mips/mips.c (block_move_call, output_block_move): Remove. + (mips_block_move_straight, mips_adjust_block_mem): New function. + (mips_block_move_loop): Renamed and reworked from block_move_loop. + (mips_expand_block_move): Likewise expand_block_move. Return false + to fall back on the target-independent code. + * config/mips/mips.md (movstrsi): Use mips_expand_block_move. + (movstrsi_internal*): Remove. + +2003-06-16 Zack Weinberg + + * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c + * cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c + * cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to + ISO C: new-style function declarations, no need for PARAMS, + no special punctuation on indirect function calls, use string + constant concatenation where convenient. + +2003-06-17 Andreas Jaeger + + * rtl.h: Remove declarations from coverage.h. + * toplev.c: Include coverage.h. + * Makefile.in (toplev.o): Depend on coverage.h. + + * toplev.h: Remove extra declaration of print_time. + + * gengtype.c (close_output_files): Remove duplicated declaration. + +2003-06-16 Nathanael Nerode + + * config/sparc/sysv4.h: Remove target-independent comment; + replace "GNU CC" with "GCC". + * config/vxworks.h: Replace "GNU compiler" with "GCC". + * config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h, + config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h, + config/sparc/netbsd-elf.h, config/sparc/openbsd.h, + config/sparc/rtemself.h, config/sparc/sol2-64.h, + config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h, + config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h, + config/sparc/sol2.h, config/sparc/sp64-aout.h, + config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h, + config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace + "GNU compiler", "GNU CC" with "GCC". + * config/sparc/cypress.md, config/sparc/hypersparc.md, + config/sparc/sparc-modes.def, config/sparc/sparc.c, + config/sparc/sparc.md, config/sparc/sparclet.md, + config/sparc/supersparc.md, config/sparc/ultra1_2.md, + config/sparc/ultra3.md: Replace "GNU CC", "GNU Compiler", and + "GNU C Compiler" with "GCC". + * config/ip2k/ip2k.h: Replace "GNU CC" and "GNU compiler" with "GCC". + +2003-06-16 Aldy Hernandez + + * simplify-rtx.c (simplify_subreg): Do not over-extend vector + constants. + + * testsuite/gcc.c-torture/execute/simd-4.c: New. + +2003-06-16 Nathanael Nerode + + * config/ip2k/ip2k.h: Remove target-independent comments. + + * config.gcc: Explicitly mention elfos.h in ip2k entry. + * config/ip2k/ip2k.h: Don't #include it here. + +2003-06-16 Kaveh R. Ghazi + + * bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c, + config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c, + dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c, + function.c, gcc.c, genoutput.c, gensupport.c, global.c, + haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c, + loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c, + read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c, + stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use + the PTR macro. + + * gengtype.c: Don't use UNION_INIT_ZERO. + * system.h (UNION_INIT_ZERO): Delete. + +2003-06-16 Richard Henderson + + * simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE instead of + GET_MODE_UNIT_SIZE when simplifying constant vectors. + +2003-06-16 Andreas Jaeger + + * timevar.c (get_run_time): Remove function provided also by + libiberty. + * timevar.h: Remove get_run_time declaration. + +2003-06-16 Kazu Hirata + + * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): Remove + unreachable code. + +2003-06-16 Kaveh R. Ghazi + + * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c, + cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't + use macros from "symcat.h", instead rely on ISO C. + + * system.h: Don't include "symcat.h". + * configure.in (AC_C_STRINGIZE): Delete. + * config.in, configure: Regenerate. + +2003-06-16 Richard Kenner + + * Makefile.in (install-mkheaders): Use INSTALL_SCRIPT for scripts. + + * tree.h (STMT_CHECK): New macro. + Also upper-case argument names on all checking macros and + fix some whitespace problems; assume CODE argument does not + have side-effects. + +2003-06-16 Kaveh R. Ghazi + + * scan.h: Convert to ISO C. + * system.h: Likewise. + + * c-format.c (dynamic_format_types): New pointer for dynamic data. + (find_length_info_modifier_index, init_dynamic_asm_fprintf_info): + New functions split out of... + (handle_format_attribute): ...here. + +2003-06-16 J"orn Rennecke + + * sh.h (REG_CLASS_FROM_LETTER): Change to: + (REG_CLASS_FROM_CONSTRAINT). + (CONST_OK_FOR_I): Rename to: + (CONST_OK_FOR_I08). Changed all users. + (CONST_OK_FOR_J): Rename to: + (CONST_OK_FOR_I16). Changed all users. + (CONST_OK_FOR_K): Rename to: + (CONST_OK_FOR_P27). Changed all users. + (CONST_OK_FOR_L): Rename to: + (CONST_OK_FOR_K08). Changed all users. + (CONST_OK_FOR_O): Rename to: + (CONST_OK_FOR_I06). Changed all users. + (CONST_OK_FOR_P): Rename to: + (CONST_OK_FOR_I10). Changed all users. + (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define. + (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise. + (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise. + (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise. + (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise. + (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise. + (CONST_OK_FOR_LETTER_P): Replace with + (CONST_OK_FOR_CONSTRAINT_P). + (EXTRA_CONSTRAINT_S): Rename to: + (EXTRA_CONSTRAINT_C16). Changed all users. + (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses. + (EXTRA_CONSTRAINT_T): Rename to: + (EXTRA_CONSTRAINT_Csy). Changed all users. + (EXTRA_CONSTRAINT_Z): Remove. + (EXTRA_CONSTRAINT): Replace with: + (EXTRA_CONSTRAINT_STR). + (EXTRA_CONSTRAINT_U): Rename to: + (EXTRA_CONSTRAINT_Z). Changed all users. + * sh.c (and_operand): Use CONST_OK_FOR_J16. + * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints. + (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise. + (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise. + (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise. + (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise. + (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise. + (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise. + (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise. + (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise. + (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise. + (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise. + (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise. + (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise. + (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise. + (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise. + (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise. + (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise. + (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise. + (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise. + (sssubv4hi3): Likewise. + (movsf_i): Change I[08]/r to G/r. + (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc. + + * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD. + +2003-06-16 Vladimir Makarov + + * config/i386/i386.c (ix86_memory_move_cost): Fix typo. + +2003-06-16 Andreas Jaeger + + * basic-block.h: Remove duplicate prototype of + note_prediction_to_br_prob. + + * tree.h: Remove duplicate prototype of strip_float_extensions. + +2003-06-16 Kaveh R. Ghazi + + * config/c4x/c4x.c: Don't include "c-tree.h". + * config/pa/pa.c: Likewise. + * langhooks.c: Likewise. + * tree.h (poplevel): Declare. + +2003-06-16 Kazu Hirata + + * config/h8300/h8300.c (const_costs): Move this to ... + (h8300_rtx_costs): ... here. + +2003-06-16 Roger Sayle + + * optabs.h (enum optab_index): Add new OTI_tan and OTI_atan. + (tan_optab, atan_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize tan_optab and atan_optab. + * genopinit.c (optabs): Implement tan_optab and atan_optab + using tan?f2 and atan?f2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_TAN{,F,L} + using tan_optab, and BUILT_IN_ATAN{,F,L} using atan_optab. + Change the default value of errno_set to false. + (expand_builtin): Expand BUILT_IN_TAN{,F,L} and BUILT_IN_ATAN{,F,L} + using expand_builtin_mathfn. + + * config/i386/i386.md (atansf2, atandf2, atanxf2, atantf2): New + expander patterns implemented using existing atan2?f3 patterns. + +2003-06-16 Roger Sayle + + * expr.c (expand_expr ): If operand_equal_p considers + both operands of the addition equal, reuse the expanded RTL. + (expand_expr ): Likewise for multiplication. + +2003-06-16 Roger Sayle + Jeff Law + + * fold-const.c (operand_equal_p): Consider two calls to "const" + functions with identical non-volatile arguments to be equal. + Consider the FUNCTION_DECL for the "__builtin_foo" form of a + built-in function to be equal to the "foo" form. + +2003-06-16 Nathanael Nerode + + * config/rs6000/sysv4le.h: Remove target-independent comment. + Replace "GNU compiler" with "GCC" in comment. + +2003-06-16 Andreas Jaeger + + * tracer.c: Remove duplicate declaration. + + * toplev.c: Remove extra declaration of decode_d_option. + + * ssa.c: Remove duplicate declaration. + + * sreal.c: Remove extra declaration of dump_sreal. + + * reload1.c: Remove duplicate declarations. + + * integrate.c: Remove extra declaration of + set_decl_abstract_flags. + + * flow.c: Remove extra declaration of dump_flow_info. + + * alias.c: Remove extra declaration of get_addr. + +2003-06-16 Nathanael Nerode + + * config/rtems.h, config/sol2.h, config/svr4.h, config/usegas.h, + config/vxworks.h: GNU CC -> GCC. + + * convert.c, dwarf2out.c, dwarfout.c, emit-rtl.c, function.c, + lists.c, print-rtl.c, print-tree.c, read-rtl.c, rtl-error.c, + stmt.c, toplev.c, integrate.h, loop.h, machmode.h, rtl.h, + ssa.h, tree.def: Replace overly specific references to "GNU C" + and "GNU C Compiler" with references to "GCC". + +2003-06-16 J"orn Rennecke + + * sh.c (prepare_move_operand): Check if operand 0 is an invalid + memory reference. Fix test that checks if operand 1 is using r0. + * sh.md (movhi_i): Don't allow st.w r0,@(rX,rY) . + + * defaults.h (REG_CLASS_FROM_CONSTRAINT): Only define if not already + defined. + +2003-06-15 Nathan Sidwell + + * function.h (struct emit_status): Remove x_last_linenum, + x_last_filename. Add x_last_location. + * rtl.h: #include "input.h". + (NOTE_DATA): New. + * cfglayout.c (duplicate_insn_chain): Use emit_line_note for line + number notes. + * emit-rtl.c (last_linenum, last_filename): Remove. + (last_location): New. + (emit_line_note_after): LINE must always be >= 0. + (emit_line_note): Likewise. Check not duplicate here... + (emit_note): ... rather than here. + (emit_line_note_force, force_next_line_note, init_emit): Adjust. + * integrate.c (expand_inline_function): Use emit_line_note for + line number notes. + (copy_insn_list): Likewise. + * unroll.c (copy_loop_body): Likewise. + * Makefile.in (RTL_H): Add input.h. + +2003-06-16 Richard Sandiford + + * optabs.c (emit_libcall_block): Don't hoist insns past a label. + +2003-06-16 Richard Henderson + + * config/alpha/alpha-protos.h, config/alpha/elf.h, + config/alpha/osf.h, config/alpha/unicosmk.h, config/alpha/vms.h, + config/alpha/vms-cc.c, config/alpha/vms-ld.c: Update to ISO C. + * config/alpha/alpha.c: Likewise. Move targetm init to end of file. + Remove unneeded static function decls. + +2003-06-16 Neil Booth + + * c-opts.c (c_common_handle_option): s/on/value/. + (OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value + directly rather than converting the argument. + * c.opt: Update docs. Use UInteger where appropriate. + * common.opt: Use UInteger where appropriate. + * opts.c (integral_argument): New. + (handle_argument): Handle integral arguments, and optional + joined arguments. + (common_handle_option): Update. + * opts.h (CL_MISSING_OK, CL_UINTEGER): New. + * opts.sh: Handle JoinedOrMissing and UInteger flags. + +2003-06-16 Neil Booth + + * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Remove + unnecessary extern declaration. + +2003-06-15 Nathanael Nerode + + * config/gofast.h, config/interix.h, config/interix3.h, + config/libgloss.h, config/linux-aout.h, config/linux.h, + config/lynx-ng.h, config/lynx.h: GNU CC -> GCC. + * config/kaos.h: "GNU compiler" -> GCC. + * config/linux-aout.h, config/lynx.h: Clarify comment describing file. + + * config/ip2k/crt0.S, config/ip2k/ip2k-protos.h, + config/ip2k/ip2k.c, config/ip2k/ip2k.md, config/ip2k/libgcc.S: + GNU CC -> GCC. + + * config/svr3.h: Remove #if 0 code, misleading comments. + GNU CC -> GCC. + +2003-06-15 Zack Weinberg + + * vmsdbgout.c (vmsdbgout_finish): Rename parameter to + main_input_filename to avoid conflict with input_filename macro. + +2003-06-15 Neil Booth + + * config/mips/mips.h (asm_file_name, g_switch_set, + g_switch_value): Remove. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Remove + unnecessary extern declarations. + +2003-06-15 Neil Booth + + * config/frv/frv.h: Remove declaration of g_switch_value. + * config/m32r/m32r.h: Remove declaration of g_switch_value. + * config/m68hc11/m68hc11.c: Remove declaration of asm_file_name. + +2003-06-15 Neil Booth + + * opts.sh: Quote '+' in regex. + +2003-06-15 Andrew Pinski + + * config/rs6000/t-rs6000: Add dependence of cfglayout.h to rs6000.o. + * config/rs6000/rs6000.c: Include cfglayout.h. + * config/alpha/alpha.c: Likewise. + * config/ia64/ia64.c: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sh/sh.c: Likewise. + +2003-06-15 Neil Booth + + * opts.sh: Quote '+' in regex. + +2003-06-15 Neil Booth + + * c-opts.c (lang_flags): Update for new spelling of flags. + (write_langs): Similarly. + * c.opt: Specify languages. + * opts.h: Remove languages. + * opts.sh: Recognise front-end defined languages. + * doc/sourcebuild.texi: Update. + +2003-06-15 Andreas Jaeger + + * alloc-pool.c: Convert to ISO C90 prototypes. + * alloc-pool.h: Likewise. + * alias.c: Likewise. + * attribs.c: Likewise. + * bb-reorder.c: Likewise. + * bitmap.h: Likewise. + * bitmap.c: Likewise. + * builtins.c: Likewise. + + * tree.h: Convert prototypes of attribs.c to ISO C90. + * basic-block.h: Convert prototypes of bb-reorder.c to ISO C90. + * rtl.h: Convert prototypes of alias.c and builtins.c to ISO C90. + * expr.h: Convert prototypes of builtins.c to ISO C90. + +2003-06-15 Roger Sayle + + * config/i386/i386.md (expsf2, expdf2, expxf2): New patterns to + implement exp, expf and expl built-ins as inline x87 intrinsics. + (UNSPEC_FSCALE, UNSPEC_FRNDINT, UNSPEC_F2XM1): New unspecs to + represent x87's fscale, frndint and f2xm1 insns respectively. + (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): New insn patterns + to encode x87's "fscale" instruction followed by a pop. + (*frndintxf2): New insn pattern for "frndint". + (*f2xm1xf2): New insn pattern for "f2xm1". + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT and + UNSPEC_F2XM1 like UNSPEC_{SIN,COS} and handle UNSPEC_FSCALE like + UNSPEC_FPATAN. + +2003-06-15 Richard Kenner + + * gencheck.c (main): Avoid generating duplicate macros. + + * Makefile.in (stagefeedback-start): Use $(SUBDIRS) instead of + knowing names of language subdirectories. + +2003-06-15 Neil Booth + + * c-pch.c (asm_file_name): Remove. + * common.opt: Add more switches. + * flags.h (g_switch_set): Boolify. + * opts.c (g_switch_value, g_switch_set, exit_after_options, + version_flag): Move from toplev.c. + (common_handle_option): Handle more switches from toplev.c. + * toplev.c (display_help, display_target_options, decode_d_option, + print_version): Make non-static, remove prototypes. + (aux_base_name, asm_file_name, aux_info_file_name): Constify. + (version_flag, g_switch_value, g_switch_set, exit_after_options): + Remove. + (independent_decode_option): Move some handlers to opts.c. + * toplev.h (aux_info_file_name, aux_base_name, asm_file_name, + exit_after_options, version_flag, display_help, display_target_options, + print_version, decode_d_option): New. + +2003-06-15 Kazu Hirata + + * config/alpha/alpha.md: Follow spelling conventions. + * config/arm/arm.c: Likewise. + * config/arm/arm.h: Likewise. + * config/arm/arm.md: Likewise. + * config/arm/crtn.asm: Likewise. + * config/m32r/m32r.c: Likewise. + * config/m32r/m32r.md: Likewise. + * config/rs6000/rs6000.c: Likewise. + +2003-06-15 Richard Henderson + + * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call + insn_locators_initialize. + * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. + * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. + * config/sh/sh.c (sh_output_mi_thunk): Do it later. + +2003-06-15 Kazu Hirata + + * builtins.c (expand_builtin_expect_jump): Remove redundant + tests that are also in any_condjump_p(). + +2003-06-15 Kaveh R. Ghazi + + * libgcc2.c: Delete sysV68 L_trampoline section. + * config/m68k/mot3300-crt0.S: Delete file. + * config/m68k/mot3300Mcrt0.S: Likewise. + +2003-06-15 Nathanael Nerode + + * config/aoutos.h: Remove. + * config.gcc: Remove reference to aoutos.h. + * config/m68k/m68k-aout.h: Remove reference to aoutos.h. + +2003-06-14 Kazu Hirata + + * doc/install.texi: Follow spelling conventions. + * doc/tm.texi: Likewise. + * config/fp-bit.c: Likewise. + * config/arm/arm.c: Likewise. + * config/frv/frv.c: Likewise. + * config/ns32k/NOTES: Likewise. + * config/ns32k/STATUS: Likewise. + +2003-06-14 Roger Sayle + Zack Weinberg + + * rtl.h (STORE_FLAG_VALUE): Remove default definition from here. + * defaults.h (STORE_FLAG_VALUE): Move default definition to here. + * doc/tm.texi (STORE_FLAG_VALUE): Document the default value. + + * config/alpha/alpha.h (STORE_FLAG_VALUE): Remove definition. + * config/arc/arc.h (STORE_FLAG_VALUE): Likewise. + * config/arm/arm.h (STORE_FLAG_VALUE): Likewise. + * config/cris/cris.h (STORE_FLAG_VALUE): Likewise. + * config/i370/i370.h (STORE_FLAG_VALUE): Likewise. + * config/i386/i386.h (STORE_FLAG_VALUE): Likewise. + * config/i960/i960.h (STORE_FLAG_VALUE): Likewise. + * config/ia64/ia64.h (STORE_FLAG_VALUE): Likewise. + * config/ip2k/ip2k.h (STORE_FLAG_VALUE): Likewise. + * config/m32r/m32r.h (STORE_FLAG_VALUE): Likewise. + * config/mcore/mcore.h (STORE_FLAG_VALUE): Likewise. + * config/mips/mips.h (STORE_FLAG_VALUE): Likewise. + * config/mmix/mmix.h (STORE_FLAG_VALUE): Likewise. + * config/ns32k/ns32k.h (STORE_FLAG_VALUE): Likewise. + * config/pa/pa.h (STORE_FLAG_VALUE): Likewise. + * config/pdp11/pdp11.h (STORE_FLAG_VALUE): Likewise. + * config/sh/sh.h (STORE_FLAG_VALUE): Likewise. + * config/sparc/sparc.h (STORE_FLAG_VALUE): Likewise. + * config/v850/v850.h (STORE_FLAG_VALUE): Likewise. + * config/xtensa/xtensa.h (STORE_FLAG_VALUE): Likewise. + +2003-06-14 Nathan Sidwell + + * opts.sh (POSIXLY_CORRECT): Unset it. + + * tree.h (init_function_start): Remove filename and line paramters. + * function.c (init_function_start): Remove filename and line + parameters. Use DECL_SOURCE_LOCATION. + * c-decl.c (store_parm_decls): Adjust init_function_start call. + (c_expand_body_1): Likewise. + * coverage.c (create_coverage): Likewise. + * objc/objc-act.c (build_tmp_function_decl): Set line number to + zero. + (hack_method_prototype): Adjust init_function_start call. + +2003-06-14 Richard Earnshaw + + PR target/3724 + * arm/linux-elf.h (PROFILE_HOOK): Define. + +2003-06-14 Richard Earnshaw + + PR target/11183 + * arm.h (CANNOT_CHANGE_MODE_CLASS): Define. + +2003-06-14 Roger Sayle + + * opts.sh: Work around a mysterious feature in cygwin's gawk + where specifying the input files explicitly has a different + behavior to piping them via stdin. + +2003-06-14 Neil Booth + + * doc/sourcebuild.texi: Update. + +2003-06-14 Richard Earnshaw + + PR target/11183 + * arm.c (output_move_double): Pass SImode to adjust_address. + +2003-06-14 Neil Booth + + * Makefile.in: Update to use common.opt and lang_opt_files. + (c-options.c, c-options.h): Remove. + (options.c, options.h): Add. + * c-opts.c: Include options.h not c-options.h. + * common.opt: New file. + * configure, configure.in: Add lang_opt_files. + * opts.c: Include flags.h and diagnostic.h. + (common_handle_option): New. + (handle_option): Update to recognize common options and all + language-dependent options. + * opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New. + (struct cl_option): Make flags of type int. + * opts.h: Flag option with front ends to which it applies. + Handle duplicate options. + * toplev.c (filename): Remove. + (independent_decode_option): Don't handle filenames and -quiet. + (process_options, do_compile): Update. + +2003-06-14 Nick Clifton + + * doc/install.texi (Specific): Add description of different + ARM supported file format targets. + +Sat Jun 14 11:12:04 CEST 2003 Jan Hubicka + + * reorg.c (emit_delay_sequence, dbr_schedule): Clear insn locators + inside delay slots. + +2003-06-13 Matt Kraai + + * unwind-c.c: Define NO_SIZE_OF_ENCODED_VALUE. + * unwind-pe.h (size_of_encoded_value): Do not define if + NO_SIZE_OF_ENCODED_VALUE is defined. + +2003-06-13 Roger Sayle + + * expr.c (expand_expr ): Handle the case of + expanding a complex constant into a CONCAT target. + +2003-06-13 Zack Weinberg + + * config/svr3.h (ASM_FILE_START): Don't use ASM_FILE_START_1. + (ASM_FILE_START_1): Delete. + * config/i386/att.h, config/i386/sco5.h, + config/i386/sysv3.h + (ASM_FILE_START_1): Delete. + +2003-06-13 Kelley Cook + + * config/i386/bsd.h: Remove ASM_FILE_START. + * config/i386/djgpp.h: Likewise. + * config/i386/gas.h (ASM_FILE_START): Output .file before .intel_syntax. + + * config/i386/djgpp.h: Move included unix.h, bsd.h, gas.h to ... + * config.gcc (i[34567]86-pc-msdosdjgpp): ... here. + +2003-06-13 Vladimir Makarov + + PR bootstrap/10835 + * haifa-sched.c (max_lookahead_tries, + cached_first_cycle_multipass_dfa_lookahead, + cached_issue_rate): New variables. + (max_issue): Check the number of tries. + (choose_ready): Calculate max_lookahead_tries. + (sched_init): Check cached_issue_rate. + +2003-06-13 Richard Henderson + + * cfgbuild.c (make_edges): Set ABNORMAL with SIBCALL. + * cfgrtl.c (purge_dead_edges): Expect it too. + +2003-06-13 Jim Wilson + Eric Botcazou + + PR bootstrap/10983 + * combine.c (make_extraction): Use gen_lowpart_for_combine + when extracting from a REG and not in the destination of a SET. + +2003-06-13 Doug Evans + + * tsystem.h (abort): Declare in inhibit_libc case to remove build + warnings for addvsi3, et.al. + +2003-06-13 Aldy Hernandez + + * c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro. + + * simplify-rtx.c (simplify_subreg): Same. + + * emit-rtl.c (gen_lowpart_common): Same. + +2003-06-13 Kazu Hirata + + * builtins.c: Fix comment typos. + * fold-const.c: Likewise. + +2003-06-13 Doug Evans + Kazuhiro Inaoka + + * config/m32r/m32r-protos.h (m32r_pass_by_reference): Declare. + * config/m32r/m32r.c (m32r_pass_by_reference): New fn. + (m32r_va_arg): Use it. + * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Ditto. + (RETURN_IN_MEMORY): Ditto. + +2003-06-13 Nathanael Nerode + + * c-typeck.c: Remove #if 0 clauses. + + PR other/1494 + * config/alpha/openbsd.h, config/i386/openbsd.h, + config/m68k/openbsd.h, config/sparc/openbsd.h: Remove + residual reference to EGCS. + +2003-06-13 Richard Earnshaw + + * arm.c (output_call_mem): If the address references the link-register + use an instruction sequence that avoids early-clobbering IP. + (eliminate_lr2ip): Delete. + +2003-06-13 Kaveh R. Ghazi + + * c-format.c (format_types_orig): Disallow '*' width/precision in + asm_fprintf format checks. + +2003-06-13 Ulrich Weigand + + * config/s390/s390.c (s390_va_arg): Fix alignment when retrieving + non-integral types from integer register save area slots. + +2003-06-13 Nathanael Nerode + + * config/i386/svr3dbx.h: GNU CC -> GCC; Intel 385 -> Intel 386. + +2003-06-13 Florian Weimer + + * doc/invoke.texi (SPARC Options): Document ``-mimpure-text''. + +2003-06-13 Kaz Kojima + + * config/sh/linux.h (TARGET_ASM_FILE_END): Set TARGET_ASM_FILE_END + to file_end_indicate_exec_stack. + +2003-06-12 Richard Henderson + + PR target/11089 + * config/i386/i386.md (sse_movaps): Use an expander to force + one operand to be a register. + (sse_movups): Likewise. + +2003-06-13 Doug Evans + + Remove some build warnings. + * config/m32r/initfini.c (__CTOR_LIST__,__DTOR_LIST__): Attribute used. + (__do_global_ctors,__do_global_dtors): Ditto. + +2003-06-12 Richard Henderson + + PR middle-end/10557 + * rtlanal.c (subreg_offset_representable_p): Relax subreg check. + +2003-06-13 Kazu Hirata + + * config/m32r/m32r.md: Fix a comment typo. + +2003-06-13 Eric Botcazou + Christian Ehrhardt + + PR target/10142 + * config/sparc/sparc.c (function_arg_record_value_parms): Add + new 'stack' field. + (function_arg_record_value_1): Set 'stack' to 1 if we run out of + integer slots for an integer field. + (function_arg_record_value_3): Shift vector index. + (function_arg_record_value_2): Likewise. + (function_arg_record_value): Initialize 'stack' to 0. + Set 'stack' to 1 if we run out of integer slots for an integer field. + Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1. + +2003-06-13 Eric Botcazou + + PR optimization/10955 + * unroll.c (unroll_loop): Fix off-by-one bug. + +2003-06-12 Aldy Hernandez + + * config/rs6000/rs6000.c (function_arg): Remove typo. + +2003-06-12 Richard Henderson + + * config/i386/i386.c (legitimate_constant_p): Handle UNSPEC_NTPOFF + and UNSPEC_DTPOFF. + +2003-06-12 Richard Henderson + + PR middle-end/10475 + * expmed.c (emit_store_flag): Use simplify_gen_subreg directly + for extracting sub-words. + +2003-06-12 Richard Henderson + + PR target/7594 + * config/m68k/m68k.md (zero_extendhisi2): Use gen_lowpart_SUBREG. + (zero_extendqihi2, zero_extendqisi2): Likewise. + +2003-06-12 Aldy Hernandez + + * config/rs6000/rs6000.c (function_arg): Always split vectors for + e500 if it's a stdarg function. + (function_arg_advance): Advance 2 registers for vectors in a + stdarg function. + (init_cumulative_args): Initialize stdarg. + (rs6000_spe_function_arg): New. + + * config/rs6000/rs6000.h (rs6000_args): Add stdarg. + +2003-06-12 Aldy Hernandez + + * config/rs6000/rs6000.h (MODES_TIEABLE_P): Add SPE vectors. + +2003-06-12 Roger Sayle + + PR middle-end/168 + * fold-const.c (tree_expr_nonnegative_p): Handle addition + and multiplication of zero extensions, floating point division, + and integer<->fp, fp<->fp and zero extension conversions. + The built-in ceil and floor functions preserve signedness. + +2003-06-12 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.2: Likewise. + * c-decl.c: Likewise. + * cfgloop.h: Likewise. + * cgraph.c: Likewise. + * coverage.c: Likewise. + * cppcharset.c: Likewise. + * cpphash.h: Likewise. + * cpplex.c: Likewise. + * cpplib.c: Likewise. + * dbxout.c: Likewise. + * df.c: Likewise. + * dwarf2out.c: Likewise. + * dwarfout.c: Likewise. + * emit-rtl.c: Likewise. + * explow.c: Likewise. + * gcov-io.c: Likewise. + * gcov-io.h: Likewise. + * gcov.c: Likewise. + * gengtype.c: Likewise. + * ggc.h: Likewise. + * opts.c: Likewise. + * real.c: Likewise. + * reload.c: Likewise. + * stmt.c: Likewise. + +2003-06-12 Janis Johnson + + * doc/install.texi (m32r-*-elf): Change company to Renesas. + +Thu Jun 12 20:00:55 CEST 2003 Jan Hubicka + + * basic-block.h (flow_delete_block_noexpunge): Kill. + * cfgrtl.c (flow_delete_block_noexpunge): Merge to + rtl_delete_block. + +2003-06-10 Richard Henderson + + PR inline-asm/4823 + * reg-stack.c (any_malformed_asm): New. + (check_asm_stack_operands): Set it. + (convert_regs_1): Check it before aborting. + +2003-06-12 Aldy Hernandez + + * config/rs6000/spe.md: Change all clobbers of the accumulator to sets. + +2003-06-12 Jakub Jelinek + + * c-opts.c (complain_wrong_lang): Add on argument. + Print no- switch if on is false. + (c_common_decode_option): Adjust caller. + +2003-06-12 Ulrich Weigand + + * config/s390/s390.c (s390_emit_prologue): Use LA instead of AR + to initialize GOT register. + +2003-06-12 Roger Sayle + + * fold-const.c (tree_expr_nonnegative_p): Add support for + floating point constants, addition and multiplication. + +2003-06-12 J"orn Rennecke + + * sh.md (adddi3_compact, subdi3_compact): Add earlyclobber + constraint modifier for operand 0. + +2003-06-12 Hans-Peter Nilsson + + Don't warn on dollars in builtin macro definitions, + e.g. __REGISTER_PREFIX__. + * cpphash.h (struct cpp_reader): Move member warn_dollars... + * cpplib.h (struct cpp_options): ...to here. Change type to + unsigned char. + * cppinit.c (cpp_create_reader): Set it to 1 here. + (post_options): Don't set it here. + * c-opts.c (c_common_init_options): Reset it to 0 here. + (finish_options): Set it here. + * cpplex.c (forms_identifier_p): Tweak for new location of + warn_dollars. + + * configure.in (assembler dwarf2 debug_line support): Define insn + for cris-*-* and mmix-*-*. + * configure: Regenerate. + +2003-06-11 Uwe Stieber + + * config.gcc (arm*-*-kaos*, i[34567]86-*-kaos*, powerpc-*-kaos*, + powerpcle-*-kaos*, strongarm-*-kaos*): New targets. + (sh-*-elf*): Add sh*-*-kaos* support. + * config/kaos.h, config/arm/kaos-strongarm.h, config/arm/kaos-arm.h, + config/i386/kaos-i386.h, config/rs6000/kaos-ppc.h, + config/sh/kaos-sh.h: New files. + +2003-06-12 Kazu Hirata + + * gcse.c (fis_get_condition): Make it a global function. + * reload1.c (reload_cse_move2add): Detect implicit sets. + * rtl.h: Add a prototype for fis_get_condition. + +2003-06-11 Richard Henderson + + * stmt.c (expand_asm_operands): Don't warn for memories with + queued addresses. + +2003-06-11 Kaz Kojima + + * config/sh/sh.h (SUBTARGET_ASM_RELAX_SPEC): Rewrite without + brackets. + +2003-06-11 Neil Booth + + * hooks.c (hook_int_size_t_constcharptr_int_0): New. + * hooks.h (hook_int_size_t_constcharptr_int_0): New. + * langhooks-def.h (lhd_decode_option, LANG_HOOKS_DECODE_OPTION): Die. + (LANG_HOOKS_HANDLE_OPTION, LANG_HOOKS_INITIALIZER): Update. + * langhooks.c (lhd_decode_option): Remove. + * langhooks.h (struct lang_hooks): Remove decode_option. + * opts.c (handle_option): No longer use decode_option. + +2003-06-11 Zdenek Dvorak + + * cfgloopanal.c (variable_initial_value): Update the set of altered + registers correctly. + +2003-06-11 Roger Sayle + Kaveh R. Ghazi + + * config/d30v/d30v.h: Delete reference to ASM_FINAL_SPEC. + * config/i386/netbsd-elf.h: Likewise. + * config/m32r/m32r.h: Likewise. + * config/mn10300/mn10300.h: Likewise. + * config/stormy16/stormy16.h: Likewise. + * config/v850/v850.h: Likewise. + * config/vax/netbsd-elf.h: Likewise. + * config/xtensa/elf.h: Likewise. + * config/xtensa/linux.h: Likewise. + +2003-06-11 Rainer Orth + + * config/mips/iris5gas.h (MDEBUG_ASM_SPEC): Override to match + DWARF 2 default. + + * config/mips/dbxmdebug.h: New file. + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it with + gas and --with-stabs. + +2003-06-11 Ulrich Weigand + + * expr.c (can_move_by_pieces): align argument may be unused. + +2003-06-11 J"orn Rennecke + + * expr.c (convert_move): Handle moves between two CONCATs. + +2003-06-11 Kazu Hirata + + * config/h8300/h8300.h (RETURN_IN_MEMORY): Accept DImode if + !TARGET_H8300. + +2003-06-11 Kazu Hirata + + * config/h8300/h8300.c (final_prescan_insn): Don't dump rtl. + * config/h8300/h8300.h (MASK_RTL_DUMP): Remove. + (TARGET_RTL_DUMP): Likewise. + (TARGET_SWITHCES): Remove -mrtl-dump. + +2003-06-10 Richard Henderson + + * optabs.c (gen_cond_trap): Fix prepare_operand typo. + +2003-06-10 Richard Henderson + + * config/ia64/ia64.md (call_gp): Fix memory mode. + +2003-06-10 James E Wilson + + PR target/8812 + * reload1.c (choose_reload_regs): For equiv reg, add loop over all + hard regs for reload_reg_used_at_all and reg_class_contents checks. + +2003-06-10 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove support for + operand character 'b'. + Add the AND case to operand character 'c'. + * config/h8300/h8300.md (two anonymous patterns): Replace + operand character 'b' with 'c'. + +2003-06-10 Kazu Hirata + + * config/h8300/h8300.c (print_operand): Remove support for + operand character 'u'. + +2003-06-10 Nathanael Nerode + + * configure.in: Fix typo. + * configure: Regenerate. + +2003-06-10 Loren James Rittle + + * config/alpha/alpha.c (unicosmk_file_end): Add conditional + compilation guard. + +2003-06-10 J"orn Rennecke + + * sh-protos.h (function_symbol): Declare. + * sh.c (expand_block_move, expand_ashiftrt): Use it. + (sh_expand_prologue, sh_expand_epilogue): Likewise. + (sh_initialize_trampoline): Likewise. + (function_symbol): New function. + * sh.md (udivsi3, divsi3, mulsi3, ic_invalidate_line): Use it. + (initialize_trampoline, call, call_pop, call_value, sibcall): Likewise. + (call_value_pop, shcompact_return_tramp): Likewise. + + * sh.h (OVERRIDE_OPTIONS): Don't suppress --profile-arc-flag. + + * sh.md (GOTaddr2picreg): Use gen_lowpart to get lowpart of + target register. + +2003-06-10 DJ Delorie + + * doc/md.texi (Machine Constraints): Document stormy's Z + constraint. + +2003-06-10 Geoffrey Keating + + * except.c (call_site_base): Mark with GTY. + +2003-06-10 Richard Earnshaw + + * arm-proto.h: Convert to ISO C90 prototypes. + * arm.c: Likewise. + +2003-06-10 J"orn Rennecke + + * sh.c (sh_output_mi_thunk): Call insn_locators_initialize. + +2003-06-10 Steve Ellcey + + * calls.c (expand_call): Convert structure_value_addr to Pmode if + necessary. + +2003-06-10 Andrew Haley + + * langhooks-def.h (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New. + (LANG_HOOKS_DECLS): Add LANG_HOOKS_DECL_OK_FOR_SIBCALL. + (lhd_decl_ok_for_sibcall): New. + * langhooks.c (lhd_decl_ok_for_sibcall): New. + * langhooks.h (lang_hooks_for_decls.ok_for_sibcall): New field. + * calls.c (expand_call): Check lang_hook before generating a + sibcall. + +2003-06-10 DJ Delorie + + * config/stormy16/stormy16.c (xstormy16_extra_constraint_p): Add Z, + which matches (const_int 0) for addhi3. + * config/stormy16/stormy16.md: Document known constraints. + (addhi3): Handle adding zero. + +2003-06-10 Kazuhiro Inaoka + + * config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New. + * config/m32r/m32r.c (m32r_hard_regno_rename_ok): New. + * config/m32r/m32r-protos.h: Prototype it. + +2003-06-10 Janis Johnson + + * config/rs6000/eabi.h (TARGET_OS_CPP_BUILTINS): Define builtins + common to rs6000 sysv targets. + * config/rs6000/eabisim.h (TARGET_OS_CPP_BUILTINS): Ditto. + * config/rs6000/rtems.h (TARGET_OS_CPP_BUILTINS): Ditto. + +2003-06-10 Nick Clifton + + * config.gcc: Add arm-wince-pe target. + * config/arm/pe.h (MULTILIB_DEFAULTS): Define. + Add comment about default apcs26 support. + * config/arm/t-pe (MULTILIB_OPTIONS): Add an -mapcs-32 + multilib. + (MULTILIB_DIRNAMES): Add 'apcs32'. + * config/arm/t-wince-pe: New makefile fragment. + * config/arm/wince-pe.h: New file. Overrides a few definitions + in arm/pe.h + +2003-06-10 Roger Sayle + + * builtins.c (fold_builtin): Optimize cos(-x) as cos(x). + * fold-const.c (fold ): Convert -f(x) into f(-x) + when x is easily negated and f is sin, tan or atan. + (fold ): Optimize tan(x)*cos(x) and cos(x)*tan(x) as + sin(x) with flag_unsafe_math_optimizations. + (fold ): With flag_unsafe_math_optimizations fold + sin(x)/cos(x) as tan(x) and cos(x)/sin(x) as 1.0/tan(x). + +2003-06-10 Roger Sayle + + * fold-const.c (fold ): Don't fold x == x only if x + is a floating point type *and* we currently honor NaNs. + (fold ): Likewise. + +2003-06-10 Mark Mitchell + + PR c++/11131 + * tree-inline.c (inlinable_function_p): Call the language-specific + hook early. + +2003-06-09 David Taylor + + * config/rs6000/rs6000.c (rs6000_va_start, rs6000_va_arg): Skip over + the f_res field. + +2003-06-09 Nathanael Nerode + + * configure.in: Remove references to host_truncate_target. + * configure: Regenerate. + * config.gcc: Remove references to truncate_target, + host_truncate_target. + + * Makefile.in, configure.in, config/m68hc11/t-m68hc11-gas: + Replace "build_canonical" with build, "host_canonical" with host. + * configure.in: Use GCC_TOPLEV_SUBDIRS. + * aclocal.m4: Include ../config/acx.m4. + * configure: Regenerate. + +2003-06-09 David Taylor + + * config/rs6000/rs6000.c (rs6000_build_va_list): Give the two + bytes of padding in the __va_list_tag structure a name (reserved). + +2003-06-09 Jason Merrill + + * fold-const.c (operand_equal_p): Handle ADDR_EXPR and TRUTH_NOT_EXPR. + +2003-06-09 Osku Salerma + + * c-format.c (check_format_string, get_constant): New. + (handle_format_attribute, handle_format_arg_attribute, + decode_format_attr): Change to use above functions. + +2003-06-09 Richard Henderson + + * stmt.c (expand_asm_operands): Re-word warning. + +2003-06-08 Andrew Pinski + + PR target/8787 + * config/i386/djgpp.h (ASM_FILE_START): emit `.intel_syntax' + if -masm=intel. + +2003-06-09 James E Wilson + + * config/frv/cmovc.c, config/frv/cmovh.c, config/frv/cmovw.c, + config/frv/frvbegin.c, config/frv/frvend.c, config/frv/lib1funcs.asm: + Add libgcc exception. + +2003-06-09 David Edelsohn + Ayal Zaks + + * config/rs6000/rs6000.md (define_attr "type"): Add insert_word. + (insvsi*): Add insert_word attribute. + * config/rs6000/rs6000.c (rs6000_variable_issue): Add TYPE_INSERT_WORD. + * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md, + power4.md,rios1.md,rios2.md,rs64.md}: Add insert_word. + +2003-06-09 Kazu Hirata + + * fold-const.c (fold): Fix a comment typo. + +2003-06-09 Nathan Sidwell + + * tree-inline.c (expand_call_inline): DECL_SOURCE_LINE_FIRST is + removed. + +2003-06-09 J"orn Rennecke + + * sh.c (gen_block_redirect): Use locators. + +2003-06-09 Richard Earnshaw + + * arm.h (THUMB_PRINT_OPERAND_ADDRESS): Use %wd in format and remove + cast to int. + +2003-06-09 Richard Sandiford + + * configure.in: Assume gas 2.14 and above can handle MIPS relocation + operators. + * configure: Regenerated. + +2003-06-09 Richard Sandiford + Alexandre Oliva + + * config/mips/mips.h (GLOBAL_POINTER_REGNUM): New macro. + (PIC_OFFSET_TABLE_REGNUM): Look at pic_offset_table_rtx after reload. + (STARTING_FRAME_OFFSET): Don't allocate a cprestore slot for + n32/64 PIC. + (MUST_SAVE_REGISTERS): Delete. + * config/mips/mips.c (mips_frame_info): Remove extra_size field. + (machine_function): Add global_pointer field. + (mips_classify_constant): Check for (const $gp) using pointer equality + with pic_offset_table_rtx. + (mips_classify_constant): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. + (mips_restore_gp): Use current_function_outgoing_args_size. + (print_operand): Use PIC_OFFSET_TABLE_REGNUM instead of + GP_REG_FIRST + 28. Handle relocation strings that have + more than one '('. + (mips_reloc_string): Handle RELOC_LOADGP_HI and RELOC_LOADGP_LO. + (mips_global_pointer): New function. + (mips_save_reg_p): New function, mostly split out from... + (compute_frame_size): ...here. Remove handling of extra_size. + Reclaim args_size if no variables depend on it. Don't treat gp + as a special case: handle it in the main GPR loop. + (mips_initial_elimination_offset): Fix comment. + (save_restore_insns): Save every register in the GPR mask, + removing distinction between mask and real_mask. + (mips_output_function_prologue): Update .frame psuedo-op after + the removal of extra_size. Move the SVR4 PIC stack allocation + and cprestore instructions to mips_expand_prologue. + (mips_gp_insn): New function. + (mips_expand_prologue): Set REGNO (pic_offset_table_rtx) to + the chosen global pointer. Handle SVR4 PIC stack allocation + in the same way as other ABIs. Adjust varargs code accordingly. + Emit a cprestore insn after allocating the stack. Use mips_gp_insn + to emit the loadgp sequence. Follow it with a loadgp_blockage + if not using explicit relocs. + (mips_output_function_epilogue): Reinstate the default gp register. + (mips16_gp_pseudo_reg): Use pic_offset_table_rtx. + (mips16_optimize_gp): Likewise. + * config/mips/mips.md (UNSPEC_LOADGP): Remove. + (UNSPEC_SETJMP, UNSPEC_LONGJMP): Remove. + (UNSPEC_CPRESTORE, RELOC_LOADGP_HI, RELOC_LOADGP_LO): New. + (loadgp): Remove. + (loadgp_blockage, cprestore): New instructions. + (builtin_setjmp_setup): Implement using emit_move_insn. Use + pic_offset_table_rtx. + (builtin_setjmp_setup_32, builtin_setjmp_setup_64): Remove. + (builtin_longjmp): Use gen_raw_REG to force use of $28. + +2003-06-09 Richard Sandiford + + * config/mips/mips-protos.h (mips_output_division): Declare. + * config/mips/mips.h (MASK_CHECK_RANGE_DIV): Remove. + (MASK_BRANCHLIKELY): Use MASK_CHECK_RANGE_DIV's old number. + (TARGET_NO_CHECK_ZERO_DIV, TARGET_CHECK_RANGE_DIV): Remove. + (TARGET_CHECK_ZERO_DIV): New macro. + (TARGET_SWITCHES): Remove -mcheck-range-div & -mno-check-range-div. + * config/mips/mips.c (mips_output_division): New function. + * config/mips/mips.md (length): Take TARGET_CHECK_ZERO_DIV into + account when calculating the default length of a division. + (divmodsi4, divmoddi4, udivmodsi4, udivmoddi4): Turn into define_insns. + Enable regardless of optimization level. Use mips_output_division. + (divmodsi4_internal, divmoddi4_internal, udivmodsi4_internal, + udivmoddi4_internal, div_trap, div_trap_normal, div_trap_mips16, + divsi3, divsi3_internal, divdi3, divdi3_internal, modsi3, + modsi3_internal, moddi3, moddi3_internal, udivsi3, udivsi3_internal, + udivdi3, udivdi3_internal, umodsi3, umodsi3_internal, umoddi3, + umoddi3_internal): Remove. + +2003-06-09 Richard Sandiford + + * config/mips/mips.c (mips_reg_names): Change hilo entry to "". + (mips_sw_reg_names): Likewise. + (mips_regno_to_class): Change hilo entry to NO_REGS. + (hilo_operand): Use MD_REG_P. + (extend_operator): New predicate. + (override_options): Remove 'a' constraint. + (mips_secondary_reload_class): Remove hilo handling. Also remove + handling of (plus sp reg) reloads for mips16. + (mips_register_move_cost): Remove hilo handling. + * config/mips/mips.h (FIXED_REGISTERS): Make hilo entry fixed. + (MD_REG_LAST): Remove hilo from range. + (HILO_REGNUM): Delete. + (reg_class): Remove HILO_REG and HILO_AND_GR_REGS. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. + (PREDICATE_CODES): Add entry for extend_operator. + (DEBUG_REGISTER_NAMES): Change hilo entry to "". + * config/mips/mips.md: Remove hilo clobbers wherever they occur. + Remove constraints from multiplication define_expands. Remove + clobbers from "decorative" define_expand patterns. + (UNSPEC_HILO_DELAY): Delete. + (*mul_acc_si, *mul_sub_si): Add early-clobber to operand 6. + (mulsidi3, umulsidi3): Change pattern to match the TARGET_64BIT case. + Adjust C code to just emit insns for !TARGET_64BIT. + (mulsidi3_internal): Rename to mulsidi3_32bit. + (mulsidi3_64bit): Use a "d" constraint for the destination. + Use extend_operator so that the pattern can handle umulsidi3 as well. + Split the instruction after reload. + (*mulsidi3_64bit_parts): New pattern, generated by mulsidi3_64bit. + (umulsidi3_internal): Rename to umulsidi3_32bit. + (umulsidi3_64bit): Remove. + (*smsac_di, *umsac_di): Line-wrap fixes. + (udivsi3_internal): Don't allow operand 2 to be constant. + (udivdi3_internal, umodsi3_internal, umoddi3_internal): Likewise. + (movdi_internal2, movsi_internal): Remove hilo alternatives. + (reload_in[sd]i, reload_out[sd]i, hilo_delay): Remove. + +2003-06-09 Richard Sandiford + + PR target/10913 + * config/mips/mips.h (TARGET_FILE_SWITCHING, NO_DBX_FUNCTION_END, + PUT_SDB_SCL, PUT_SDB_INT_VAL, PUT_SDB_VAL, PUT_SDB_ENDEF, + PUT_SDB_TYPE, PUT_SDB_SIZE, PUT_SDB_DIM, PUT_SDB_START_DIM, + PUT_SDB_NEXT_DIM, PUT_SDB_LAST_DIM, PUT_SDB_TAG, PUT_SDB_SRC_FILE, + SDB_GENERATE_FAKE, TEXT_SECTION): Delete. + (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF, PUT_SDB_BLOCK_START, + PUT_SDB_BLOCK_END, PUT_SDB_FUNCTION_END): Replace use of + asm_out_text_file with asm_out_file. + * config/mips/iris5gas.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Likewise. + * config/mips/elf.h (TEXT_SECTION): Undefine. + * config/mips/elf64.h (TEXT_SECION): Undefine. + * config/mips/openbsd.h (TEXT_SECION): Undefine. + * config/mips/mips.c (asm_out_text_file, asm_out_data_file): Delete. + (override_options): Disable small-data optimizations unless using + gas or explicit relocations. + (mips_asm_file_start, mips_asm_file_end, mips_output_function_epilogue, + iris6_asm_named_section, iris6_asm_file_start): Remove code for + handling TARGET_FILE_SWITCHING. + (copy_file_data): Move into TARGET_IRIX6 block. + +2003-06-08 Richard Henderson + + * expr.h (EXPAND_MEMORY): New. + * expr.c (expand_expr): Check it. + * stmt.c (expand_asm_operands): Provide it when the constraint + requires a memory. Warn for memory input constraints without + a memory operand. + +2003-06-08 Kaveh R. Ghazi + + * varasm.c: Don't include c-tree.h. + +2003-06-08 Andreas Jaeger + + * predict.h: Convert to ISO C90 prototypes. + * predict.c: Likewise. + * tree-dump.h: Likewise. + * tree-dump.c: Likewise. + * diagnostic.h: Likewise. + * diagnostic.c: Likewise. + * combine.c: Likewise. + + * rtl.h: Convert prototypes of combine.c to ISO C90. + +Sun Jun 8 21:27:41 CEST 2003 Jan Hubicka + + * cfglayout.c (insn_scope): New static function + (block_locators_*, line_locators*, file_locators*): New static varrays. + (scope_to_insns_initialize): Use them. + (insn_line, insn_file): New functions. + (scope_to_insns_finalize): Use insn_scope. + (prologue_locator, epilogue_locator): New global variables. + * emit-rt.c (try_split, make_insn_raw, make_jump_insn_raw, + make_call_insn_raw, emit_copy_of_insn_after): Use locators. + (emit_insn_after_scope, emit_insn_before_scope + emit_jump_insn_after_scope, emit_jump_insn_before_scope + emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to... + (emit_insn_after_setloc, emit_insn_before_setloc + emit_jump_insn_after_setloc, emit_jump_insn_before_setloc + emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these; + use locators. + * final.c (notice_source_line): Use locators. + (final_start_function): Set initial source file and line. + (final_scan_insn): Use locators. + * ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants, + noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove, + noce_try_cmove_arith, noce_try_minmax, noce_try_abs, + noce_process_if_block, find_cond_trap): Likewise. + * integrate.c (copy_insn_list): Likewise. + * jump.c (duplicate_loop_exit_test): LIkewise. + * print-rtl.c (print_rtx): Print locators. + * recog.c (peephole2_optimize): Likewise. + * rtl.h (INSN_SCOPE): Remove. + (emit_insn_after_scope, emit_insn_before_scope + emit_jump_insn_after_scope, emit_jump_insn_before_scope + emit_call_insn_after_scope, emit_call_insn_before_scope): Rename to... + (emit_insn_after_setloc, emit_insn_before_setloc + emit_jump_insn_after_setloc, emit_jump_insn_before_setloc + emit_call_insn_after_setloc, emit_call_insn_before_setloc): ... these; + (insn_file, insn_line, prologue_locator, epilogue_locator): Declare. + * unroll.c (copy_loop_body): Use locators. + * function.c (set_insn_locators): New function. + (thread_prologue_and_epilogue_insns): Set the locators accordingly. + +2003-06-08 Kazu Hirata + + * config/h8300/h8300.h (LONG_LONG_TYPE_SIZE): Set to 64. + * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _floatdisf + _fixsfdi _fixunssfdi. + (LIB2FUNCS_EXTRA): Add entries for clzhi2, ctzhi2, parityhi2, + popcounthi2. + (TARGET_LIBGCC2_CFLAGS): Remove -DDI=SI. + * config/h8300/clzhi2.c: New. + * config/h8300/ctzhi2.c: Likewise. + * config/h8300/parityhi2.c: Likewise. + * config/h8300/popcounthi2.c: Likewise. + +Sun Jun 8 15:52:17 CEST 2003 Jan Hubicka + + * i386.md (subsi_3_zext, sse2_nandv2di3): Fix predicates. + * i386.c (k8_avoid_jump_misspredicts): Fix debug output. + + * cfg.c (verify_flow_info): Move IL independent checks from cfgrtl here. + (dump_bb): New based on old dump_bb in cfgrtl.c + (debug_bb, debug_bb_n): Move the functions from cfgrtl.c here. + * cfghooks.h (cfgh_verify_flow_info): Return status. + * cfglayout.c (cfg_layout_finalize): Verify CFG correctness. + * cfgrtl.c (debug_bb, debug_bb_n): Move to cfg.c + (dump_bb): Remove generic parts. + (rtl_verify_flow_info_1): Break out from rtl_verify_flow_info. + (rtl_verify_flow_info): Only check things dependeing on linearized RTL. + +2003-06-08 Neil Booth + + * Makefile.in: Rename options.c and options.h to c-options.c and + c-options.h. + (OBJS): Remove options.o. + * c-opts.c: Don'tInclude c-options.h instead of options.h. + * opts.c: Don't include options.h. + (find_opt): Can't use enum opt_code or N_OPTS. + * opts.h (struct cl_option, cl_options, cl_options_count): Move from... + * opts.sh: ... here. + +2003-06-07 Eric Botcazou + Ulrich Weigand + + PR pch/9830 + * ggc-common.c (HAVE_MMAP_FILE): Include sys/types.h + if HAVE_MINCORE is defined. + (MAP_FAILED): Define if not defined. + (gt_pch_save): Test against MAP_FAILED. + (gt_pch_restore): If HAVE_MINCORE, use MAP_FIXED to force + the mapping address to the preferred base after checking it + is possible to do so. Test against MAP_FAILED. + * configure.in: Test for the presence of mincore in libc. + * config.in: Regenerate. + * configure: Regenerate. + +2003-06-07 Richard Henderson + + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Fix + conditional compilation guard. + +2003-06-08 Kazu Hirata + + * optabs.c (expand_abs): Set result_unsignedp to 1 if + flag_trav is zero. + +2003-06-07 Richard Henderson + + * c-cppbuiltin.c (c_cpp_builtins): Define __EXCEPTIONS for C also. + +2003-06-07 Richard Henderson + + * basic-block.h (EDGE_SIBCALL): New. + (EDGE_ALL_FLAGS): Update. + * cfg.c (dump_edge_info): Add sibcall name. + * cfgbuild.c (make_edges): Use EDGE_SIBCALL. + * cfgrtl.c (purge_dead_edges): Handle sibcalls. + +2003-06-07 Andreas Jaeger + + * mklibgcc.in (lib2funcs): Remove _exit. + * libgcc2.c: Remove L_exit. + * gbl-ctors.h: Remove declarations dependend on NEED_ATEXIT. + + * system.h: Poison NEED_ATEXIT, ON_EXIT, EXIT_BODY. + + * doc/tm.texi (Misc): Remove NEED_ATEXIT, ON_EXIT, EXIT_BODY. + + * ggc.h: Convert to ISO C90 prototypes. + * ggc-none.c: Likewise. + * ggc-common.c: Likewise. + * ggc-page.c: Likewise. + * ggc-simple.c: Likewise. + + * crtstuff.c: Remove undefined usage of INIT_SECTION_PREAMBLE. + + * system.h: Poison INIT_SECTION_PREAMBLE. + +2003-06-07 Zack Weinberg + + * config.gcc (with_cpu handling): Translate sparc64 in + $machine to --with-cpu=v9. + * config/alpha/alpha.c + (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition. + (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK. + + * target.h: New hook asm_out.file_end. + * target.h: Update to match. New hook macro TARGET_ASM_FILE_END. + * toplev.c (compile_file): Use targetm.asm_out.file_end. + * system.h: Poison ASM_FILE_END. + * varasm.c (file_end_indicate_exec_stack): New. + * output.h: Prototype it. + * doc/tm.texi: Document TARGET_ASM_FILE_END and + file_end_indicate_exec_stack. Delete references to attasm.h. + + * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end. + (ASM_FILE_END): Delete; move code... + * config/darwin.c (darwin_file_end): Here; new function. + * config/darwin-protos.h: Prototype it. + * config/alpha/alpha.c (unicosmk_asm_file_end): Make static, + rename unicosmk_file_end. + * config/arm/aof.h (ASM_FILE_END): Delete; move code... + * config/arm/arm.c (aof_file_end): ... here; new static function. + Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER. + Make aof_dump_imports and aof_dump_pic_table static. + * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static. + Set TARGET_ASM_FILE_END to avr_file_end. + * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments. + Set TARGET_ASM_FILE_END to c4x_file_end. + * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end, + make static. Take no arguments. Set TARGET_ASM_FILE_END to + h8300_file_end. + * config/i370/i370.h (ASM_FILE_END): Delete; move code... + * config/i370/i370.c (i370_file_end): ... here; new static function. + Set TARGET_ASM_FILE_END to i370_file_end. + * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end. + Take no arguments. Call file_end_indicate_exec_stack if + NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END. + * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. + Define NEED_INDICATE_EXEC_STACK to 0. + * config/i386/linux.h, config/i386/linux64.h: Redefine + NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END. + * config/i386/winnt.c (i386_pe_asm_file_end): Rename to + i386_pe_file_end. Take no arguments. Use ix86_file_end. + * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to + ia64_hpux_file_end, make static. Take no arguments. + * config/ip2k/ip2k.c (asm_file_start, asm_file_end, + commands_in_prologues, commands_in_epilogues): Delete. + (function_epilogue): Update to match. + * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end, + make static. Take no arguments. + (iris6_asm_file_end): Rename iris6_file_end, make static, use + mips_file_end, take no arguments. + Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as + appropriate. + * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end, + make static, take no arguments. Set TARGET_ASM_FILE_END to + mmix_file_end. + * config/pa/pa.c (output_deferred_plabels): Make static, take + no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels. + * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it. + (ASM_FILE_END): Delete; move code... + * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here; + new static function. + + * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h + * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h: + Don't set ASM_FILE_END. + * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h + * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h + * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to + file_end_indicate_exec_stack; don't set ASM_FILE_END. + * config/alpha/unicosmk.h, config/i386/cygming.h + * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. + * config/arm/arm-protos.h, config/alpha/alpha-protos.h + * config/avr/avr-protos.h, config/c4x/c4x-protos.h + * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h + * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h + * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update. + +Sat Jun 7 18:32:13 CEST 2003 Jan Hubicka + + * i386.h (OPTION_DEFAULT_SPECS): Avoid -mcpu default when -march is + specified. + +Sat Jun 7 15:20:01 CEST 2003 Jan Hubicka + + * Makefile.in (stageprofile_build): Kill redundant target. + * i386.c (mdep_reorg): Don't pad jumps for Athlon. + +2003-06-07 Andreas Jaeger + + * doc/tm.texi (Costs): Remove DONT_REDUCE_ADDR documentation. + + * config/avr/avr.h: Remove comment regarding DONT_REDUCE_ADDR. + * config/dsp16xx/dsp16xx.h: Likewise. + * config/i386/i386.h: Likewise. + * config/ip2k/ip2k.h: Likewise. + +2003-06-07 Neil Booth + + * Makefile.in (OJBS, c-opts.o): Update. + (c-options.c, c-options.h): Rename options.h and options.c. + (options.h): Rename options_.h. + (opts.o): New. + * c-common.h (c_common_handle_option): Replace c_common_decode_option. + (c_common_init_options): Update prototype. + * c-lang.c (c_init_options): Update prototype. + (LANG_HOOKS_HANDLE_OPTION): Override. + (LANG_HOOKS_DECODE_OPTION): Drop. + * c-opts.c: Include opts.h and options.h instead of c-options.h + and c-options.c. + (lang_flags): Move to file scope. + (find_opt, c_common_decode_option): Remove. + (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, + CL_REJECT_NEGATIVE): Move to opts.h. + (missing_arg): Update prototype. + (c_common_init_options): Update for new prototype. + (c_common_handle_options): Filenames are passed as N_OPTS. + * hooks.c (hook_int_void_0): New. + * hooks.h (hook_int_void_0): New. + * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. + (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. + (LANG_HOOKS_INITIALIZER): Update. + * langhooks.h (init_options): Update. + (handle_option): New. + * opts.c, opts.h: New files. + * opts.sh: Update c file to include opts.h and options.h. + * toplev.c: Include opts.h; change options.h to options_.h. + (parse_options_and_default_flags): Get lang_mask, use + handle_option for language-specific handling. + * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. + (LANG_HOOKS_HANDLE_OPTION): Override. + (objc_init_options): Update. + +2003-06-07 Magnus Kreth + Thibaud Gaillard + + PR other/7031 + * Makefile.in (install-common): Remove GCOV_INSTALL_NAME instead of + gcov. + +2003-06-07 Kelley Cook + + * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Remove quotes in + section names. + * configure: Regenerate. + +2003-06-07 Alan Modra + + * config/rs6000/linux64.h (CRT_CALL_STATIC_FUNCTION): Define. + +2003-06-06 James E Wilson + + PR inline-asm/10890 + * reload1.c (merge_assigned_reloads): Abort only if two reloads have + different in fields. + +2003-06-06 Nathanael Nerode + + * configure.in: Make $(target_subdir) correspond with top level usage. + * Makefile.in: Likewise. + * configure: Regenerate. + +2003-06-06 John David Anglin + + * pa.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_COMMON, + ASM_OUTPUT_ALIGNED_LOCAL): Cast `SIZE' and `ALIGNED' parameters to + unsigned HOST_WIDE_INT. + * pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMOM, ASM_OUTPUT_ALIGNED_LOCAL): + Likewise. + * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON, ASM_OUTPUT_ALIGNED_LOCAL): + Likewise. + +2003-06-06 Kaveh R. Ghazi + + * doc/install.texi (Prerequisites): New section documenting + tools and packages necessary prior to building and/or + modifying GCC. + * doc/install.texi2html: Also generate prerequisites.html. + +2003-06-06 Richard Earnshaw + + PR target/11052 + * ifcvt.c (noce_process_if_block): Fail if the destination has + side-effects. + +2003-06-06 Jason Merrill + + * stmt.c (resolve_asm_operand_names): Rename from + resolve_operand_names. No longer static. Avoid needless copying. + Don't build array of constraints. + (expand_asm_operands): Build it here. + * tree.h: Declare resolve_asm_operand_names. + + * stmt.c (expand_decl): Put artificial vars into registers even + when not optimizing, and don't mark the regs as user vars. + +2003-06-06 J"orn Rennecke + + * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode + of the generated register. + +2003-06-06 Daniel Jacobowitz + + * config.gcc: Add a missing sparc64 case. + +2003-06-06 Jakub Jelinek + + * mklibgcc.in: Propagate .note.GNU-stack section if needed into + the .hidden assembly stubs. + +2003-06-06 H.J. Lu + + * config.gcc (extra_headers): Add emmintrin.h for i[34567]86-*-* + and x86_64-*-*. + + * config/i386/mmintrin.h: Update version and add alternate + intrinsic names. + * config/i386/xmmintrin.h: Likewise. + + * config/i386/xmmintrin.h: Include . Move SSE2 + intrinsics to ... + * config/i386/emmintrin.h: Here. New file. + +2003-06-06 Roger Sayle + + * fold-const.c (fold ): Re-fold the result of folding + fabs(-x) into fabs(x). Use tree_expr_nonnegative_p to determine + when the ABS_EXPR (fabs or abs) is not required. + (tree_expr_nonnegative_p): Move the logic that sqrt and exp are + always nonnegative from fold to here. Additionally, cabs and fabs + are always non-negative, and pow and atan are non-negative if + their first argument is non-negative. + + * builtins.c (fold_builtin_cabs): New function to fold cabs{,f,l}. + Evaluate cabs of a constant at compile-time. Convert cabs of a + non-complex argument into fabs. Convert cabs(z) into + sqrt(z.r*z.r + z.i*z.i) at the tree-level with -ffast-math or + -funsafe-math-optimizations or -ffast-math. + (fold_builtin): Convert BUILT_IN_FABS{,F,L} into an ABS_EXPR. + Fold BUILT_IN_CABS{,F,L} using fold_builtin_cabs. + +Thu Jun 5 20:51:09 CEST 2003 Jan Hubicka + + * sourcebuild.texi (Front End Directory): Document new hooks. + +Fri Jun 6 11:02:35 CEST 2003 Jan Hubicka + + * function.c (FLOOR_ROUND, CEIL_ROUND): Fix. + * i386.md (gen_pro_epilogue_adjust_stack): Deal with gigantic + stack frames. + (pro_epilogue_adjust_stack_rex64_2): New pattern + +Fri Jun 6 11:03:14 CEST 2003 Jan Hubicka + Pop Sebastian + Zdenek Dvorak + + * cfghooks.h, cfghooks.c: New files. + * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. + (OBJS): Add cfghooks.o. + (cfghooks.o): New rule. + * basic-block.h (split_edge): Rename to rtl_split_edge. + (verify_flow_info): Rename to rtl_verify_flow_info. + (cfghooks.h): Included here. + * cfgrtl.c (split_edge): Renamed rtl_split_edge. + (verify_flow_info): Renamed rtl_verify_flow_info. + * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. + + * basic-block.h (split_block, split_edge, flow_delete_block, + redirect_edge_and_branch, redirect_edge_and_branch_force): Delete. + (flow_delete_block_noexpunge): Return void. + * cfg.c (verify_flow_info): New function. + * cfgcleanup.c (try_simplify_condjump, outgoing_edges_match, + try_crossjump_to_edge, try_optimize_cfg, delete_unreachable_blocks): + Use delete_block. + * cfglayout.c (function_footer): Rename to... + (cfg_layout_function_footer): ... this variable + (unlink_insn_chain): Make global. + (fixup_reorder_chain, record_effective_endpoints): Update. + (cleanup_unconditional_jumps): Use delete_block. + (cfg_layout_redirect_edge, cfg_layout_split_block): Move to cfgrtl.c + (cfg_layout_duplicate_bb): Use redirect_edge_and_branch_force. + (cfg_layout_initialize, cfg_layout_finalize): Update hooks. + * cfglayout.h (cfg_layout_redirect_edge, cfg_layout_split_block): Delete. + (cfg_layout_function_footer): Declare. + * cfgloopmanip (split_loop_bb): Do not update RBI. + (remove_bbs): Use delete_block. + (loop_reidrect_edge, loop_delete_branch_edge): Use + redirect_edge_and_branch. + (create_preheader): Use split_block and redirect_edge_and_branch_force. + (split_edge_with): Likewise. + * cfgrtl.c: Include cfglayout.h + (split_edge): Rename to ... + (rtl_split_edge) ... this one; make local. + (redirect_edge_and_branch): Rename to ... + (rtl_redirect_edge_and_branch) ... this one; make local. + (redirect_edge_and_branch_force): Rename to ... + (rtl_redirect_edge_and_branch_force) ... this one; make local. + (cfg_layout_delete_block, cfg_layout_delete_edge_and_branch_force): New. + (cfg_layout_redirect_edge_and_branch, cfg_layout_split_block): Move here from + cfglayout.c; update to directly call RTL counterparts. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): New functions. + * ifcvt.c (find_cond_trap): Use delete_block. + (find_if_case_1): Use delete_block. + (find_if_case_2): Use delete_block. + * rtl.h (unlink_insn_chain): Declare. + * toplev.c (rtl_reigster_cfg_hooks): New. + +2003-06-05 Richard Henderson + + * recog.c (peephole2_optimize): Revert last change. + +2003-06-05 Richard Henderson + + * recog.c (peephole2_optimize): Don't split block unless + can_throw_internal. + +2003-06-06 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Correct the syntax of rotxl. + * config/h8300/h8300.md (*addsi3_lshiftrt_16_zexthi): Likewise. + +2003-06-05 Kelley Cook + + PR optimization/4490 + * config/i386/i386.md: Don't use XFMode if TARGET_128BIT_LONG_DOUBLE. + * doc/invoke.texi (m96bit-long-double, m128bit-long-double): Reword + documentation to accurately reflect what these options do. + +2003-06-06 Kaz Kojima + + * config/sh/linux.h (STARTFILE_SPEC): Handle -pie. Simplify. + (ENDFILE_SPEC): Redefine to handle -pie. + +2003-06-05 Phil Edwards + + * Makefile.in (qmtest-g++): Use target_alias, not target. + +2003-06-05 Per Bothner + + * toplev.c (push_srcloc): Simplify behavior to save current location + and set current location to parameters. + (pop_srcloc): Simplify semantics. + (lang_dependent_init): Remove now-useless initial push_srcloc. + +2003-05-06 Richard Henderson + + * dwarf2out.c (loc_descriptor_from_tree): Return 0 for + language-specific tree codes. + +2003-06-05 John David Anglin + + PR middle-end/9986 + * pa.c (pa_init_builtins): Also set implicit_built_in_decls for + BUILT_IN_FPUTC_UNLOCKED to NULL_TREE. + +Thu Jun 5 18:32:46 CEST 2003 Jan Hubicka + + * install.tex: Document profiledbootstrap. + + * configure.in: Add support for lang.stageprofile and + lang.stagefeedback + * Makefile.in (clean, distclean): Kill new stages + (POSTSTAGE1_FLAGS_TO_PASS): Break from ... + (STAGE2_FLAGS_TO_PASS): ... this one. + (STAGEPROFILE_FLAGS_TO_PASS, STAGEFEEDBACK_FLAGS_TO_PASS): New. + (stage[2-4]_build): Add POSTSTAGE1_FLAGS_TO_PASS. + (stageprofile_build, stageprofile_copy, stagefeedback_build, + stagefeedback_copy): New. + (restageprofile, restagefeedback, stageprofile-start, + stageprofile, stagefeedback-start): Likewise. + +2003-06-05 David Miller + Richard Henderson + + * optabs.c (HAVE_conditional_trap): Provide default. + (gen_conditional_trap): Likewise. + (init_optabs): Merge init_traps. + (gen_cond_trap): Use prepare_operand. Restructure and avoid ifdef. + +Thu Jun 5 14:59:44 CEST 2003 Jan Hubicka + + * combine.c (simplify_if_then_else): (IF_THEN_ELSE (NE REG 0) (0) (8)) + is REG for nonzero_bits (REG) == 8. + +Thu Jun 5 13:23:51 CEST 2003 Jan Hubicka + + * i386.md (align): Fix warning; clarify what to do when no p2align + is available. + +2003-06-05 Nick Clifton + + * config.gcc (m32r-elf): Revert previous delta. + * config/m32r/t-m32r (crtinit.o): Fix rule to work with + multilibs. Remove m32rx specific version. + (crtfini.o): Likewise. + (EXTRA_MULTILIB_PARTS): Define. + +2003-06-05 Eric Botcazou + + * doc/md.texi (Machine Constraints): Correct the meaning of + constraints related to floating-point registers on SPARC. + +2003-06-05 Eric Botcazou + Paolo Bonzini + + PR target/10663 + * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Redirect + assembler and linker output to /dev/null. + Use a 'sed' construct instead of 'grep -A1'. + * configure: Regenerate. + +2003-06-04 Richard Henderson + + * config/i386/i386.c (struct ix86_address): Add seg. + (no_seg_address_operand): New. + (ix86_decompose_address): Restructure PLUS loop. Accept one + UNSPEC_TP if TARGET_TLS_DIRECT_SEG_REFS. Adjust ESP swap test + to test for a regnum, not stack_pointer_rtx. + (ix86_address_cost): Reduce cost if non-default segment. + (legitimate_address_p): Remove UNSPEC_TP check. + (get_thread_pointer): Add to_reg argument. Don't represent + the thread pointer as a memory load. + (legitimize_tls_address): Split out of ... + (legitimize_address): ... here. + (print_operand_address): Handle parts.seg. + (ix86_expand_move): Use legitimize_tls_address. + (ix86_rtx_costs): Handle UNSPEC_TP. + * config/i386/i386.h (MASK_TLS_DIRECT_SEG_REFS): New. + (TARGET_TLS_DIRECT_SEG_REFS): New. + (TARGET_SWITCHES): Add tls-direct-seg-refs. + (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): Default. + (PREDICATE_CODES): Add no_seg_address_operand. + * config/i386/i386.md (lea_1): Use it. + (lea_1_rex64, lea_1_zext, lea_2_rex64): Likewise. + (load_tp_si, add_tp_si, load_tp_di, add_tp_di): New. + * config/i386/linux.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New. + * config/i386/linux64.h (TARGET_TLS_DIRECT_SEG_REFS_DEFAULT): New. + * doc/invoke.texi: Add -mtls-direct-seg-refs. + +2003-06-04 Mark Mitchell + + * Makefile.in (QMTESTRUNFLAGS): Set for DejaGNU emulation. + (QMTEST_GPP_TESTS): Use "g++" by default. + (stamp-qmtest): Tweak database creation. + (QMTEST_DIR/context): Update context file format. + (qmtest-g++): Tweak command-line. + +2003-06-04 Kaveh R. Ghazi + + * Makefile.in (varasm.o): Don't set -Wno-error. + * rs6000/t-rs6000 (varasm.o, out_object_file): Don't clear. + +2003-06-04 Zack Weinberg + + PR bootstrap/3163 + * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE, AC_FUNC_MMAP_FILE): Delete. + (gcc_AC_FUNC_MMAP_BLACKLIST): New. + * configure.in: Check for sys/mman.h and mmap in AC_CHECK_HEADERS + and AC_CHECK_FUNCS lists, respectively. Use + gcc_AC_FUNC_MMAP_BLACKLIST, not AC_FUNC_MMAP_ANYWHERE nor + AC_FUNC_MMAP_FILE. + * configure, config.in: Regenerate. + +2003-06-04 Kaveh R. Ghazi + + * arm/aout.h (ASM_OUTPUT_SKIP): Fix cast for format specifier warning. + * arm.c (arm_output_function_prologue): Fix format specifiers. + * arm.h (ARM_PRINT_OPERAND_ADDRESS): Likewise. + * m68k.c (m68k_output_mi_thunk): Use more readable %wd instead of + HOST_WIDE_INT_PRINT_DEC. + * vax.c (vax_output_function_prologue): Fix format specifiers. + +2003-06-04 Richard Henderson + + * cse.c (find_best_addr): Consider binary operators even if second + argument is not CONST_INT. + +2003-06-04 Zdenek Dvorak + + * doc/invoke.texi (max-cse-path-length): Document. + +2003-06-04 Richard Henderson + + * config/i386/i386.md (align): Use ASM_OUTPUT_*ALIGN macros. + +2003-06-04 Andrew Pinski + + * config/rs6000/darwin.h (RS6000_OUTPUT_BASENAME): + Remove semi-colon at the end of the expression. + +2003-06-04 Kaveh R. Ghazi + + * i370.c (mvs_function_name_length): Fix signed/unsigned warnings. + * i370.h (mvs_function_name_length): Likewise. + * i960.h (CONSTANT_ALIGNMENT): Likewise. + * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * pa/pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * pa.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Delete unused + variable. + +2003-06-04 Daniel Jacobowitz + + * config.gcc: Reorganize --with-cpu logic. Set + configure_default_options according to the default CPU, --with-cpu, + --with-arch, --with-tune, --with-schedule, --with-abi, and + --with-float. Check for legal values of various options. + * configure.in: Define configure_default_options in configargs.h. + * configure: Regenerated. + * config/mips/mips.h (TARGET_DEFAULT_ARCH_P) + (TARGET_DEFAULT_FLOAT_P): New macros. + * gcc.c (do_option_spec): New function. + (struct default_spec, option_default_specs): New. + (main): Call do_option_spec. + * config/alpha/alpha.h, config/arm/arm.h, config/i386/i386.h, + config/mips/mips.h, config/pa/pa.h, config/rs6000/rs6000.h, + config/sparc/sparc.h (OPTION_DEFAULT_SPECS): Define. + + * doc/install.texi: Update --with-cpu documentation. Mention + --with-arch, --with-schedule, --with-tune, --with-abi, and + --with-float. + * doc/tm.texi (Driver): Document OPTION_DEFAULT_SPECS. + +2003-06-04 Daniel Jacobowitz + + * config.gcc: Only process --with-cpu logic in the third pass. + +2003-06-04 Daniel Jacobowitz + + * config.gcc: Reorganize --with-cpu section. Remove an + obsolete comment about the default CPU for x86-64. Fix + a typo for the ep9312. Update the list of supported PowerPC + CPUs. Support a limited set of new --with-cpu options + for i386. + +2003-06-04 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_complex_function_value): Unpack + complex numbers <= 32 bits into two registers. + +2003-06-04 Kaveh R. Ghazi + + * alpha.c (print_operand_address): Fix format specifier warnings. + * alpha/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * alpha/vms.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * arm/aof.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. + * arm/pe.h (ASM_OUTPUT_COMMON): Likewise. + * avr.h (ASM_OUTPUT_COMMON, ASM_GENERATE_INTERNAL_LABEL, + ASM_OUTPUT_SKIP): Likewise. + * c4x.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * dsp16xx.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * h8300.h (ASM_GENERATE_INTERNAL_LABEL, ASM_OUTPUT_COMMON): + Likewise. + * i370.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * i386/cygming.h (ASM_OUTPUT_COMMON): Likewise. + * i386/darwin.h (ASM_OUTPUT_COMMON): Likewise. + * i960.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * m68k/hp320.h (PRINT_OPERAND_ADDRESS): Likewise. + * mcore.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * pdp11.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * ptx4.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + * sparc/freebsd.h (ASM_GENERATE_INTERNAL_LABEL): Likewise. + * svr3.h (ASM_OUTPUT_COMMON): Likewise. + +2003-06-04 J"orn Rennecke + + * c-decl.c (c_init_decl_processing): Clear input_file_name + while building common nodes. + * dwarf2out.c (gen_compile_unit_die, dwarf2out_finish): + Don't add working directory for strings like . + +2003-06-04 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Native as and ld required + to bootstrap on AIX 5L. + +2003-06-04 Richard Henderson + + * c-common.c (handle_cleanup_attribute): New. + (c_common_attributes): Add it. + * c-decl.c (finish_decl): Honor the cleanup attribute. + * doc/extend.texi (Variable Attributes): Document it. + + * unwind-c.c: New file. + * Makefile.in (LIB2ADDEH): Add it. + * config/t-darwin, config/t-linux, config/t-linux-gnulibc1, + config/ia64/t-ia64: Likewise. + +2003-06-04 Jakub Jelinek + + * function.c (trampolines_created): New variable. + (expand_function_end): Set it when doing INITIALIZE_TRAMPOLINE. + * function.h (trampolines_created): Add. + * config/s390/linux.h (ASM_FILE_END): Define. + * config/alpha/linux-elf.h (ASM_FILE_END): Define. + * config/m68k/linux.h (ASM_FILE_END): Define. + * config/rs6000/linux.h (ASM_FILE_END): Define. + * config/rs6000/linux64.h (ASM_FILE_END): Define. + * config/rs6000/ppc-asm.h: Add .note.GNU-stack on powerpc-linux. + * config/sparc/linux.h (ASM_FILE_END): Define. + * config/sparc/linux64.h (ASM_FILE_END): Define. + * config/i386/i386.c (ix86_asm_file_end): Use SUBTARGET_FILE_END. + * config/i386/linux.h (SUBTARGET_FILE_END): Define. + * config/i386/linux64.h (SUBTARGET_FILE_END): Define. + +Wed Jun 4 18:39:33 CEST 2003 Jan Hubicka + + * i386.c (min_insn_size, k8_avoid_jump_misspredicts): New functions + (ix86_reorg): Use it. + * i386.md (align): New insn pattern. + +2003-06-04 Kaveh R. Ghazi + + * toplev.c (rest_of_type_compilation): Fix typo. + +2003-06-04 Jakub Jelinek + Alan Modra + + * config/i386/linux.h (NO_PROFILE_COUNTERS): Define to 1. + * config/i386/freebsd.h (NO_PROFILE_COUNTERS): Likewise. + * config/i386/netbsd-elf.h (NO_PROFILE_COUNTERS): Likewise. + * config/xtensa/xtensa.h (NO_PROFILE_COUTNERS): Likewise. + * config/darwin.h (NO_PROFILE_COUNTERS): Likewise. + * final.c (NO_PROFILE_COUNTERS): Define to 0 if not defined. + (profile_function): Allow NO_PROFILE_COUNTERS to be non-constant. + * config/rs6000/rs6000.c (output_profile_hook): Likewise. + + * configure.in (powerpc*-*, s390*-*): Set tls_as_opt. + Pass it to $gcc_cv_as. + * configure: Rebuilt. + + * config/rs6000/rs6000.c (rs6000_abi_name): Remove initializer. + (print_operand): Allow TARGET_AIX to be non-constant. + (rs6000_aix_emit_builtin_unwind_init, rs6000_emit_eh_toc_restore): + Define unconditionally. + (rs6000_elf_declare_function_name): New function. + * config/rs6000/rs6000.md (eh_return): Allow TARGET_AIX to be + non-constant. + * config/rs6000/linux64.h [!RS6000_BI_ARCH] (TARGET_64BIT): Define + to 1. + (DEFAULT_ARCH64_P, RS6000_BI_ARCH_P): Define. + [IN_LIBGCC2] (TARGET_64BIT): Define based on whether __powerpc64__ + is defined. + (TARGET_AIX): Define to 1 if TARGET_64BIT. + (PROCESSOR_DEFAULT): Remove. + (TARGET_RELOCATABLE, RS6000_ABI_NAME, INVALID_64BIT, + INVALID_32BIT, SUBSUBTARGET_OVERRIDE_OPTIONS): Define. + [RS6000_BI_ARCH] (OVERRIDE_OPTIONS, ASM_FILE_START): Define. + (ASM_DEFAULT_SPEC, ASM_SPEC, LINK_OS_LINUX_SPEC): Define for both + -m32 and -m64. + (MULTILIB_DEFAULTS): Define. + (SUBSUBTARGET_EXTRA_SPECS): Define. + (ASM_SPEC32, ASM_SPEC64, ASM_SPEC_COMMON): Define. + (TARGET_TOC): Define only if !RS6000_BI_ARCH. + (TARGET_NO_TOC): Remove. + [!RS6000_BI_ARCH] (TARGET_RELOCATABLE, TARGET_EABI, + TARGET_PROTOTYPE): Define to 0. + (NO_PROFILE_COUNTERS): Define to TARGET_64BIT. + (PROFILE_HOOK): Only call output_profile_hook if TARGET_64BIT. + (ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN): Adjust to work properly + if !TARGET_64BIT. + (USER_LABEL_PREFIX): Remove. + (JUMP_TABLES_IN_TEXT_SECTION): Define to TARGET_64BIT. + (SETUP_FRAME_ADDRESSES): Only call rs6000_aix_emit_builtin_unwind_init + if TARGET_64BIT. + (TARGET_OS_CPP_BUILTINS): Handle both -m32 and -m64. + (LINK_OS_LINUX_SPEC32, LINK_OS_LINUX_SPEC64): Define. + (STARTFILE_LINUX_SPEC, ENDFILE_LINUX_SPEC): Remove. + (TOC_SECTION_ASM_OP): Define depending on TARGET_64BIT. + (MINIMAL_TOC_SECTION_ASM_OP): Likewise. + (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Define depending on + TARGET_64BIT. + (RS6000_CALL_GLUE): Likewise. + (SAVE_FP_PREFIX, SAVE_FP_SUFFIX, RESTORE_FP_PREFIX, + RESTORE_FP_SUFFIX): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Remove. + (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_SOURCE_LINE, + DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Only output dot before function + name if TARGET_64BIT. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Handle both TARGET_64BIT and + !TARGET_64BIT. + (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Remove undefs. + (ASM_PREFERRED_EH_DATA_FORMAT): Take TARGET_64BIT into account. + (DRAFT_V4_STRUCT_RET): Define. + (SIGNAL_FRAMESIZE): New enum value. + (MD_FALLBACK_FRAME_STATE_FOR): Define. + * config/rs6000/default64.h: New file. + * config/rs6000/sysv4.h (SUBTARGET_SWITCHES): Add -m32 and -m64 + options. + (SUBTARGET_OVERRIDE_OPTIONS): If rs6000_abi_name is NULL, set it + to RS6000_ABI_NAME. Only disallow mixing of -fPIC with -mcall-aixdesc + if !TARGET_64BIT. + [!RS6000_BI_ARCH] (SUBSUBTARGET_OVERRIDE_OPTIONS): Define. + (ASM_DECLARE_FUNCTION_NAME): Use rs6000_elf_declare_function_name + function. + (TARGET_OS_SYSV_CPP_BUILTINS): Define. + (TARGET_OS_CPP_BUILTINS): Use it. + (CPP_SYSV_SPEC): Remove. + (CPP_SPEC): Remove cpp_sysv. + (SUBTARGET_EXTRA_SPECS): Remove cpp_sysv. + Add SUBSUBTARGET_EXTRA_SPECS. + (SUBSUBTARGET_EXTRA_SPECS): Define. + * config/rs6000/biarch64.h: New file. + * config/rs6000/rs6000-protos.h (rs6000_elf_declare_function_name): + New prototype. + * config/rs6000/x-linux64: New file. + * config/rs6000/t-linux64: Build -m64, -m32 and -m32 -msoft-float + multilibs. + * config/rs6000/eabi-ci.asm: Protect with #ifndef __powerpc64__. + * config/rs6000/eabi-cn.asm: Likewise. + * config/rs6000/tramp.asm: Likewise. + * config/rs6000/sol-ci.asm: Likewise. + * config/rs6000/sol-cn.asm: Likewise. + * config/rs6000/linux.h (TARGET_64BIT): Define to 0. + (TARGET_OS_CPP_BUILTINS): Use TARGET_OS_SYSV_CPP_BUILTINS. + * config/rs6000/ppc-asm.h: Move __powerpc64__ section before + _CALL_AIXDESC section. + * config.gcc (powerpc64-*-linux*): Configure a bi-arch compiler, + defaulting to -m64 unless --with-cpu= is one of the 32-bit CPUs + or default32. + +2003-06-04 Daniel Jacobowitz + + * config.gcc: Revert accidentally committed ARM changes. + +2003-06-04 Roger Sayle + + * builtins.c (dconstpi, dconste): New mathematical constants. + (init_builtin_dconsts): New function to initialize dconstpi + and dconste. + (fold_builtin): Optimize exp(1.0) = e. Evaluate exp(x) at + compile time with -ffast-math when x is an integer constant. + Optimize tan(0.0) = 0.0. Optimize atan(0.0) = 0.0, + atan(1.0) = pi/4 and tan(atan(x)) = x with -ffast-math. + +2003-06-04 Roger Sayle + + * calls.c (expand_call): Avoid calling pure or const functions + when the result is ignored (or void) and none of the arguments + are volatile. Move warning diagnostic earlier in function. + +2003-06-04 Andreas Jaeger + + * system.h: Do not poison TDESC_SECTION_ASM_OP, + RDATA_SECTION_ASM_OP and SUBTARGET_PROLOGUE. + +2003-06-04 Kaveh R. Ghazi + + * final.c (asm_fprintf): Update comments, accept "-+ #0" flags, + optimize '%' case, handle %c, don't accept %p, %e, %f or %g, + handle %ll, optimize regular character case. + +2003-06-04 Zdenek Dvorak + + * Makefile.in (cse.o): Add params.h dependency. + * cse.c: Include params.h. + (PATHLENGTH): Removed. + (struct cse_basic_block_data): Make path array dynamic. + (cse_end_of_basic_block): Use PARAM_MAX_CSE_PATH_LENGTH instead + of PATHLENGTH. + (cse_main, cse_basic_block): Allocate path array. + * params.def (PARAM_MAX_CSE_PATH_LENGTH): New. + +Wed Jun 4 09:49:21 CEST 2003 Jan Hubicka + + * i386.c (ix86_reorg): Replace the jump instead of adding nop. + * i386.md (UNSPEC_REP): New constant. + (return_internal_long): New pattern. + +2003-06-04 Eric Botcazou + + PR optimization/11018 + * config/sparc/sparc.c (sparc_v8plus_shift): Use which_alternative + consistently to decide whether the scratch register is really + required. + +2003-06-04 Eric Botcazou + + PR optimization/10876 + * config/sparc/sparc.h (CONST_OK_FOR_LETTER): Add + new 'O' constraint for constant 4096. + (CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. + * config/sparc/sparc.md (adddi3 expander): Canonicalize pattern. + Do not transform into MINUS insn for constant 4096. + (*adddi3_sp64 insn): Canonicalize pattern. Add new alternative + for constant 4096 as third operand. + (addsi3 expander): Remove. + (*addsi3 insn): Rename into 'addsi3'. Canonicalize pattern. Add + new alternative for constant 4096 as third operand. + (subdi3 expander): Do not transform into PLUS insn for constant 4096. + (*subdi3_sp64 insn): Add new alternative for constant 4096 as third + operand. + (subsi3 expander): Remove. + (*subsi3 insn): Rename into 'subsi3'. Add new alternative for + constant 4096 as third operand. + * doc/md.texi (Machine Constraints): Document new 'O' constraint for + the SPARC port. + +2003-06-03 Chris Demetriou + + * config/mips/t-linux64 (CRTSTUFF_T_CFLAGS_S): Define. + +2003-06-04 Andreas Jaeger + + * config/i386/uwin.h: Remove SUBTARGET_PROLOGUE. + + * config/i386/i386.c (ix86_expand_prologue): Do not use + SUBTARGET_PROLOGUE. + + * system.h: Poision SUBTARGET_PROLOGUE. + + * config/arm/arm-protos.h: Remove unused rdate_section prototype. + + * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP + dependend code. + + * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP. + + * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and + INSN_CACHE_LINE_WIDTH. + + * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed. + (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH, + INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. + + * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH, + INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. + + * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM. + (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL. + (dbxout_block): Remove usage of DBX_OUTPUT_CATCH. + (dbxout_block): Remove usage of DBX_LBRAC_FIRST. + (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME. + (dbxout_init): Remove test for DBX_WORKING_DIRECTORY. + + * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST, + DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and + DBX_WORKING_DIRECTORY. + + * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM, + DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY. + + * config/frv/frv-protos.h: Remove unused const_section + declaration. + * config/vax/vax-protos.h: Likewise. + + * output.h: Remove CONST_SECTION_ASM_OP usage. + + * system.h: Poison CONST_SECTION_ASM_OP. + + * crtstuff.c (__do_global_dtors_aux): Remove usage of + CRT_GET_RFIB_TEXT. + (frame_dummy): Likewise. + * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. + * system.h: Poison CRT_GET_RFIB_TEXT. + + * collect2.c (is_ctor_dtor): Remove CFRONT_LOSSAGE dependend code. + + * fix-header.c: Remove ADD_MISSING_EXTERN_C dependend variables. + (write_lbrac): Remove ADD_MISSING_EXTERN_C dependend code. + (recognized_function): Likewise. + (read_scan_file): Likewise. + +2003-06-03 Roger Sayle + + * optabs.c (expand_binop): Optimize complex multiplication for + the case of squaring a complex argument. + +2003-06-03 Roger Sayle + + * optabs.c (expand_binop): Attempt to reuse pseudos for duplicate + non-volatile operands of binary operations. + (prepare_cmp_insn): Likewise. + +2003-06-03 Roger Sayle + + * varasm.c (force_const_mem): Handle alignment of constants not + representable as a type in the front-end language. + +2003-06-03 Kazu Hirata + + * flow.c (initialize_uninitialized_subregs): Use + emit_move_insn instead of emitting a hardcoded move. + +2003-06-03 Richard Henderson + + * optabs.c (expand_abs_nojump): Split out from ... + (expand_abs): ... here. + * optabs.h (expand_abs_nojump): Declare. + * ifcvt.c: (noce_try_abs): Use expand_abs_nojump. + * Makefile.in (ifcvt.o): Depend on optabs.h. + +2003-06-03 Alan Modra + + * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants. + +2003-06-03 Jason Thorpe + + * config.gcc (default_use_cxa_atexit): New variable, defaults to no. + (*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*): Set default_use_cxa_atexit + to yes. + * configure.in: Allow default_use_cxa_atexit to determine the + value of DEFAULT_USE_CXA_ATEXIT if not explicitly enabled or + disabled. + * configure: Regenerate. + +2003-06-03 Douglas B Rupp + + * Makefile.in (TEXI_GCC_FILES): Remove vms.texi entry. + * doc/gcc.texi: Remove vms.texi section. + * doc/vms.texi: Remove obsolete file. + +2003-05-23 J"orn Rennecke + + * configure.in (inhibit_libc): Don't define when configuring + with --with-newlib --with-headers. + * configure: Regenerate. + + * t-sh: Remove LIB2FUNCS_EXTRA and embed-bb.c rules. + +2003-06-03 Rainer Orth + + * configure.in (gcc_cv_as_hidden): Disable .hidden completely on + IRIX 6 without GNU ld. + * configure: Regenerate. + +2003-06-03 Roger Sayle + + * expr.c (emit_move_insn_1): Use emit_move_insn to move the parts + of a complex number rather than invoke mov_optab directly. + +2003-06-03 Kazu Hirata + + * combine.c (simplify_set): Don't move a subreg in SET_SRC to + SET_DEST if WORD_REGISTER_OPERATIONS is not defined. + +2003-06-03 Nathanael Nerode + + * config/i386/x86-64.h: Remove two target-independent comments; + replace "GNU CC" with "GCC". + +2003-06-03 Anthony Green + + * config/frv/t-frv (EXTRA_HEADERS): Remove media.h + +2003-06-03 Roger Sayle + + * builtins.def (BUILT_IN_CABS, BUILT_IN_CABSF, BUILT_IN_CABSL): + New builtins representing ISO C99's cabs, cabsf and cabsl. + * builtins.c (expand_builtin_fabs): New function. + (expand_builtin_cabs): New function. + (expand_builtin): Expand BUILT_IN_FABS{,F,L} and BUILT_IN_CABS{,F,L} + using expand_builtin_fabs and expand_builtin_cabs respectively. + + * doc/extend.texi: Document new cabs, cabsf and cabsl builtins. + +2003-06-03 Aldy Hernandez + + * function.c (assign_parms): Split complex arguments. + + * doc/tm.texi (SPLIT_COMPLEX_ARGS): Document. + + * expr.h (SPLIT_COMPLEX_ARGS): Define. + (split_complex_types): Protoize. + (split_complex_values): Protoize. + + * calls.c (expand_call): Split complex arguments on architectures + that require it. + (split_complex_values): New. + (split_complex_types): New. + + * config/rs6000/rs6000.c (rs6000_libcall_value): New. + (rs6000_function_value): Handle complex values on AIX. + (rs6000_complex_function_value): New. + + * config/rs6000/rs6000-protos.h (rs6000_libcall_value): Protoize. + + * config/rs6000/rs6000.h (LIBCALL_VALUE): Call function. + (SPLIT_COMPLEX_ARGS): New. + +2003-06-03 Jakub Jelinek + + * configure.in (HAVE_LD_PIE): Check for ld -pie. + * config.in: Rebuilt. + * configure: Rebuilt. + * toplev.c (flag_pie, flag_shlib): New variables. + (f_options): Add -fpie and -fPIE. + (parse_options_and_default_flags): Set flag_pic if -fpie/-fPIE. + Set flag_shlib if flag_pic and not -fpie/-fPIE. + * flags.h (flag_pic, flag_shlib): Add. + * varasm.c (default_binds_local_p): Use flag_shlib instead of + flag_pic. + * gcc.c (LINK_PIE_SPEC): Define. + (LINK_COMMAND_SPEC): Use LINK_PIE_SPEC. + (option_map): Add --pie -> -pie mapping. + * config/sol2.h (ASM_SPEC): Handle -fpie the same way as -fpic + and -fPIE the same way as -fPIC. + * config/openbsd.h (ASM_SPEC): Likewise. + * config/frv/frv.h (ASM_SPEC): Likewise. + * config/arm/linux-gas.h (SUBTARGET_CPP_SPEC): Likewise. + * config/arm/semi.h (ASM_SPEC): Likewise. + * config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise. + * config/freebsd-spec.h (FBSD_CPP_SPEC): Likewise. + * config/i386/beos-elf.h (CC1_SPEC): Likewise. + * config/i386/freebsd-aout.h (ASM_SPEC): Likewise. + * config/m68k/linux.h (CPP_SPEC): Likewise. + * config/m68k/netbsd.h (ASM_SPEC): Likewise. + * config/m68k/openbsd.h (ASM_SPEC): Likewise. + * config/m68k/netbsd-elf.h (ASM_SPEC): Likewise. + * config/mips/linux.h (SUBTARGET_CPP_SPEC): Likewise. + * config/mips/openbsd.h (SUBTARGET_ASM_SPEC): Likewise. + * config/pa/pa-linux.h (CPP_SPEC): Likewise. + * config/netbsd-aout.h (ASM_SPEC): Likewise. + * config/rs6000/sysv4.h (ASM_SPEC, CPP_SYSV_SPEC): Likewise. + * config/rs6000/vxworks.h (CPP_SPEC): Likewise. + * config/sparc/linux.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. + * config/sparc/linux64.h (CPP_SUBTARGET_SPEC, ASM_SPEC): Likewise. + * config/sparc/sparc.h (ASM_SPEC): Likewise. + * config/sparc/sp64-elf.h (ASM_SPEC): Likewise. + * config/sparc/sysv4.h (ASM_SPEC): Likewise. + * config/sparc/netbsd-elf.h (ASM_SPEC): Likewise. + * config/sparc/openbsd64.h (ASM_SPEC): Likewise. + * config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise. + * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Handle -pie. + Simplify. + * config/alpha/elf.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/i386/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/ia64/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/rs6000/sysv4.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/rs6000/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/sparc/linux.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * config/sparc/linux64.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + * doc/invoke.texi: Document -pie, -fpie and -fPIE options. + +2003-06-03 Jakub Jelinek + + * builtins.c (expand_builtin_memcpy): Remove endp argument and endp + != 0 handling. Pass 0 to store_by_pieces. + (expand_builtin_mempcpy): Add endp argument. Don't call + expand_builtin_memcpy, call store_by_pieces resp. move_by_pieces + directly. If ignoring result, only do expand_call. + (expand_builtin_stpcpy): Likewise. Call expand_builtin_mempcpy + otherwise. + (expand_builtin_strncpy, expand_builtin_memset): Adjust + store_by_pices callers. + (expand_builtin): Adjust expand_builtin_memcpy and + expand_builtin_mempcpy callers. + * expr.c (can_move_by_pieces): New function. + (move_by_pieces): Add endp argument, return to resp. memory at end + or one byte earlier depending on endp. + (store_by_pieces): Likewise. + (emit_block_move): Adjust call to move_by_pieces. + (emit_push_insn): Adjust move_by_pieces caller. + * expr.h (can_move_by_pieces): New prototype. + (store_by_pieces): Adjust prototypes. + * rtl.h (move_by_pieces): Adjust prototype. + * config/mips/mips.c (expand_block_move): Adjust move_by_pieces + caller. + +2003-06-03 Ben Elliston + + * doc/md.texi (Processor pipeline description): Improve wording. + +2003-06-03 Neil Booth + + * c-opts.c (c_common_handle_option): New, pulled out of + c_common_decode_option. Substitute uses of argv. + (c_common_decode_option): Broken into two. + +2003-06-02 Roger Sayle + Zack Weinberg + + * emit-rtl.c (gen_complex_constant_part): Remove unnecessary + test of TREE_CONSTANT_POOL_ADDRESS_P. + +2003-06-02 Kaveh R. Ghazi + + * mips.c: Don't include output.h twice. + * stormy16.c: Likewise. + * xtensa.c: Likewise. + * output.h: Protect against multiple inclusion. + +2003-06-02 J"orn Rennecke + + * sh.h (OLD_ARG_MODE): New macro. + (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it. + (FUNCTION_ARG_1): Break out of: + (FUNCTION_ARG). Use OLD_ARG_MODE. + +2003-06-02 Kazuhiro Inaoka + + * gcc/config.gcc Add support multilib parts for m32rx processor. + +2003-06-02 Kaveh R. Ghazi + + * Makefile.in (c-options.c): Pass in $(AWK) to opts.sh. + (mostlyclean): Delete c-options.c and c-options.h. + +2003-06-02 Neil Booth + + * c-opts.c (CL_REJECT_NEGATIVE): New. + (c_common_decode_option): Update to use it. + * c.opt: Update documentation; use RejectNegative. + * opts.sh: Handle RejectNegative. + +2003-06-01 Zack Weinberg + + * ggc-page.c (init_ggc): Give better diagnostics on failure to + open /dev/zero. + * toplev.c (crash_signal): Reset handling for received signal + to SIG_DFL. + +2003-06-02 Ben Elliston + + * config/arm/arm.c (arm_use_dfa_pipeline_interface): Declare. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define if not already. + (arm_use_dfa_pipeline_interface): Implement. + * config/arm/arm.md (arm): New automaton. + (write_buf): Remove function units; new cpu unit. + (write_blockage): Remove function units; new cpu unit. + (core): Remove function units; new cpu unit. + (r_mem_f_wbuf): New instruction reservation. + (store1_wbuf, store2_wbuf, store3_wbuf, store4_wbuf): Likewise. + (store1_ldsched, store2, store3, store4): Likewise. + (load_ldsched, load_ldsched_xscale, load_or_store): Likewise. + (mult, mult_ldsched, mult_ldsched_strongarm): Likewise. + (multi_cycle, single_cycle): Likewise. + * config/arm/fpa.md (armfp): New automaton. + (fpa): Remove function units; new cpu unit. + (fpa_mem): Remove function unit; new cpu unit. + (fdivx, fdivd, fdivs, fmul, ffmul, farith, ffarith): New reservations. + (r_2_f, f_2_r, f_load, f_store, r_mem_f, f_mem_r): Likewise. + +2003-06-01 Kaveh R. Ghazi + + * builtin-attrs.def (ATTR_ASM_FPRINTF): New. + * c-format.c (enum format_type): Add asm_fprintf_format_type. + (NOARGUMENTS, asm_fprintf_length_specs, asm_fprintf_flag_specs, + asm_fprintf_flag_pairs, asm_fprintf_char_table): New. + (format_types_orig): Renamed from format_types. Add new data. + (format_types): Declare as pointer. + (handle_format_attribute): Move later in file so we have all + necessary declarations. Add section to capture HOST_WIDE_INT. + * output.h (ATTRIBUTE_ASM_FPRINTF, __gcc_host_wide_int__): New. + (asm_fprintf): Mark with ATTRIBUTE_ASM_FPRINTF. + +2003-06-01 Andreas Jaeger + + * doc/tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and + ROUND_TYPE_SIZE_UNIT. + + * stor-layout.c (finalize_record_size): Remove usages of + ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT. + (finalize_type_size): Likewise. + (layout_type): Likewise. + + * system.h: Poison ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT. + + * loop.c (check_insn_for_givs): Remove DONT_REDUCE_ADDR macro. + + * config/d30v/d30v.h: Remove text copied from the manual. + +2003-06-01 Roger Sayle + John David Anglin + Geoffrey Keating + + * emit-rtl.c (gen_lowpart_common): Handle interpreting integer + constants as condition code values. + +2003-06-01 DJ Delorie + + * cppmacro.c (warn_of_redefinition): Handle cases where the two + definitions have different numbers of tokens. + +2003-06-01 Andreas Jaeger + + * gen-protos.c (main): Readd unused attribute for argc. + +2003-06-01 Neil Booth + + * Makefile.in (c-options.c, c-options.h): Parallel make safe. + * c.opt: End in blank line. + * opts.sh: Take AWK from environment if available; use C locale. + +2003-06-01 Andreas Schwab + + * config/m68k/linux.h: Remove code protected by USE_GNULIBC_1. + +2003-06-01 Andreas Jaeger + + * gen-protos.c (main): Revert patch to check for argument. + +2003-06-01 Eric Botcazou + + PR target/11044 + * config/i386/i386.md (length attribute): Set length to 4 + for instructions of type "fcmp". + +2003-06-01 Andreas Jaeger + + * toplev.c: Use ISO C90 prototypes. + + * toplev.h: Use ISO C90 prototypes. + + * genrecog.c: Use ISO C90 prototypes. + (nodes_identical): Correct declaration to match prototype. + (maybe_both_true): Likewise. + (merge_trees): Likewise. + + * genpeep.c (gen_peephole): Remove #if 0 code. + Use ISO C90 prototypes. + + * genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code. + Remove #if 0'ed function simplify_by_alternatives. + (optimize_attrs): Remove #if 0'ed code. + Remove ^L. + Use ISO C90 prototypes. + (make_canonical): Remove #if 0'ed code. + (convert_const_symbol_ref): Remove #if 0'ed function. + + * gen-protos.c (main): Check for argument. + + * rtl.h: Use ISO C90 prototypes for functions from lists.c. + + * params.h: Use ISO C90 prototypes. + * params.c: Likewise. + * intl.c: Likewise. + * intl.h: Likewise. + * lists.c: Likewise. + * errors.c: Likewise. + * errors.h: Likewise. + * gencodes.c: Likewise. + * genpreds.c: Likewise. + * genattr.c: Likewise. + * gen-protos.c: Likewise. + * genflags.c: Likewise + * genconditions.c: Likewise. + * genautomata.c: Likewise. + * gencheck.c: Likewise. + * genconfig.c: Likewise. + * genconstants.c: Likewise. + * genemit.c: Likewise. + * genextract.c: Likewise. + * gengenrtl.c: Likewise. + * gengtype.c: Likewise. + * gengtype.h: Likewise. + * genopinit.c: Likewise. + * genoutput.c: Likewise. + * gensupport.c: Likewise. + * gensupport.h: Likewise. + + * sdbout.h: Use ISO C90 prototypes. + + * sdbout.c (CONTIN): Removed empty macro. + (sdbout_one_type): Remove CONTIN usages. + Remove ^Ls. + (tag_of_ru_type): Remove #if 0'ed function. + (sdbout_symbol): Remove #if 0'ed code. + (sdbout_one_type): Remove a #if 1. + (sdbout_one_type): Remove #if 0'ed code. + (sdbout_init): Remove RMS_QUICK_HACK_1 code. + Remove PARAMS, use ISO C90 prototypes for all functions. + +2003-06-01 Josef Zlomek + + * rtl.def (CONST_DOUBLE): Update comment. + +2003-06-01 Neil Booth + + * opts.sh: Remove path from sort. + +2003-06-01 Aldy Hernandez + + PR/9680 + * config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Require + TARGET_SPE for SPE_VECTOR_MODE. + +2003-05-31 Aldy Hernandez + + * toplev.c (botch): Remove. + (do_abort): Remove. + (set_Wunused): Comment. + (set_Wextra): Comment. + Remove ^L's. + (rest_of_compilation): Factor out common code into functions. + (rest_of_handle_inlining): New. + (rest_of_handle_ssa): New. + (rest_of_handle_cse): New. + (rest_of_handle_gcse): New. + (rest_of_handle_loop_optimize): New. + (rest_of_handle_jump_bypass): New. + (rest_of_handle_sibling_calls): New. + (rest_of_handle_null_pointer): New. + (rest_of_handle_addresof): New. + (rest_of_handle_flow): New. + (rest_of_handle_branch_prob): New. + (rest_of_handle_if_conversion): New. + (rest_of_handle_tracer): New. + (rest_of_handle_loop2): New. + (rest_of_handle_cse2): New. + (rest_of_handle_life): New. + (rest_of_handle_combine): New. + (rest_of_handle_if_after_combine): New. + (rest_of_handle_regmove): New. + (rest_of_handle_sched): New. + (rest_of_handle_old_regalloc): New. + (rest_of_handle_new_regalloc): New. + (rest_of_handle_regrename): New. + (rest_of_handle_reorder_blocks): New. + (rest_of_handle_sched2): New. + (rest_of_handle_new_regalloc): New. + (rest_of_handle_old_regalloc): New. + (rest_of_handle_regrename): New. + (rest_of_handle_reorder_blocks): New. + (rest_of_handle_stack_regs): New. + (rest_of_handle_machine_reorg): New. + (rest_of_handle_delay_slots): New. + (rest_of_handle_final): New. + + * toplev.h (botch): Remove prototype. + (do_abort): Same. + +2003-05-31 Neil Booth + + * Makefile.in (c-opts.o, c-options.h): Update dependencies. + * c-opts.c: Include c-options.h and c-options.c. + (CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY): + Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX. + (CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option, + OPT, opt_comp): Remove. + (missing_arg, c_common_init_options, c_common_decode_option, + write_langs): Update for macro redefinitions and enumeration + name changes. + * c.opt, opts.sh: New files. + * doc/passes.texi: Update. + +2003-05-31 Andreas Jaeger + + * function.c (trampoline_address): Remove ALLOCATE_TRAMPOLINE + usage. + + * doc/tm.texi (Trampolines): Remove ALLOCATE_TRAMPOLINE. + + * config/d30v/d30v.h: Remove traces of ALLOCATE_TRAMPOLINE. + + * system.h: Poison ALLOCATE_TRAMPOLINE. + + * doc/tm.texi (Misc): Remove HANDLE_PRAGMA. + * system.h: Poison HANDLE_PRAGMA. + +2003-05-31 Kazu Hirata + + * doc/invoke.texi: Update dump file names. + +2003-05-31 Kaveh R. Ghazi + + * c-format.c (format_length_info, format_char_info, + format_flag_spec, format_flag_pair, format_kind_info): + De-const-ify structure members. + +2003-05-31 Roger Sayle + + * flags.h (flag_wrapv): New flag controlling overflow semantics. + * toplev.c (flag_wrapv): Declare the variable with default false. + (lang_independent_options): New option "-fwrapv" to set the above. + + * fold-const.c (extract_muldiv_1): Disable optimization of (2*x)/2 + as x, when signed arithmetic overflow wraps around. + (fold): Optimize "-A - B" as "-B - A" if overflow wraps around. + * loop.c (basic_induction_var): Ignore BIVs that rely on undefined + overflow when flag_wrapv is true. + + * doc/invoke.texi: Document new -fwrapv command line option. + * doc/c-tree.texi: Mention that the overflow semantics of + NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR and MULT_EXPR is dependent + upon both flag_wrapv and flag_trapv. + +2003-05-31 Eric Botcazou + + * doc/install.texi (mips-sgi-irix5): Add missing + HTML


marker. + +2003-05-31 Eric Botcazou + + * doc/md.texi (Machine Constraints): Document + missing SPARC constraints. + +2003-05-31 Eric Botcazou + + * doc/md.texi (Automaton pipeline description): Use + "type" instead of "cpu" as the attribute in the examples. + +2003-05-30 Stan Shebs + + * system.h: Poison OBJC_PROLOGUE. + +2003-05-30 Roger Sayle + + * emit-rtl.c (gen_complex_constant_part): New function for getting + the constant real or imaginary part of a complex constant. + (gen_realpart): Use it. + (gen_imagpart): Likewise. + +2003-05-30 Kazu Hirata + + * doc/invoke.texi: Fix typos. + * doc/rtl.texi: Likewise. + +2003-05-30 Dhananjay Deshpande + + * config/h8300/crti.asm: Use .h8300hn and .h8300sn for normal + mode. + * config/h8300/crtn.asm: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + * config/h8300/h8300.c (asm_file_start): Likewise. + * config/h8300/elf.h (LINK_SPEC): Use h8300hnelf and + h8300snelf emulations for normal mode. + * config/h8300/h8300.h (LINK_SPEC): Use h8300hn and h8300sn + emulations for normal mode. + +2003-05-30 Dhananjay Deshpande + + * config/h8300/h8300.c (h8300_tiny_constant_address_p): Return + true if TARGET_NORMAL_MODE. + +2003-05-30 Roger Sayle + + * cse.c (cse_insn): Simplify REG_EQUAL note on libcalls when + making a substitution. + (dead_libcall_p): If directly replacing a libcall with a + constant value produces an invalid instruction, also try forcing + the constant into the constant pool. + * expr.c (emit_move_insn): Add a REG_EQUAL note when it is not + obvious that the source is a constant. + (compress_float_constant): Use set_unique_reg_note to place + REG_EQUAL notes on instructions. + +2003-05-30 Eric Christopher + + * config/mips/mips.c (extern_list): Add GTY marker. + (extern_head): Separate out definition. Add marker. + (mips_output_external): Use ggc_alloc for extern_list + allocation. + (mips_output_external_libcall): Ditto. + +2003-05-30 Florian Weimer + + * doc/install.texi: Ada-enabled bootstrap requires GNAT 3.14 or + later. + +2003-05-30 Kaveh R. Ghazi + + * vax.h (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier + warnings. + (PRINT_OPERAND): Likewise. + +2003-05-30 Rainer Orth + + * config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Move + -mdebug/-no-mdebug switches ... + (MDEBUG_ASM_SPEC): ... here. + Use only with gas. + (EXTRA_SPECS): Initialize mdebug_asm_spec. + +2003-05-29 Matt Kraai + + * gthr-gnat.c: Remove #undef UNUSED. + (__gnat_default_lock, __gnat_default_unlock): Prototype. + (__gnat_task_lock, __gnat_task_unlock): Make declarations + prototypes. + (__gnat_install_locks): Convert declaration to ISO C90, make + parameter declarations prototypes, and remove blank line. + * gthr-gnat.h (__gnat_install_locks): Make parameter + declarations prototypes. + +2003-05-29 Jason Merrill + + * Makefile.in (unstrap): Remove stage_last after make unstage1. + +2003-05-29 Roger Sayle + + * mips-tfile.c (PAGE_SIZE): Increase page size to 32K. + +2003-05-29 Roger Sayle + Kaveh Ghazi + + PR bootstrap/10169 + * mips-tfile.c (main): Use getopt_long instead of getopt. + Add new command line option --version to display version. + Treat --verbose like -v to report a single line version. + (options): New global variable for getopt_long. + * mips-tdump.c (main): Use getopt_long instead of getopt. + New command line options -v, --version and -verbose to display + the program version number (to match mips-tfile's behavior). + (options): New global variable for getopt_long. + + * gcov.c (options): Zero-terminate getopt_long array. + * gcov-dump.c (options): Likewise. + + * Makefile.in (mips-tdump.o): Add dependency on version.h. + +2003-05-29 Stan Shebs + + Remove OBJC_PROLOGUE everywhere. + * objc/objc-act.c (finish_objc): Remove use of OBJC_PROLOGUE. + * config/avr/avr.h: Remove no-op ref to OBJC_PROLOGUE. + * config/d30v/d30v.h: Similarly. + * config/ip2k/ip2k.h: Similarly. + * doc/tm.texi: Remove doc of OBJC_PROLOGUE. + +2003-05-29 Roger Sayle + + * c-semantics.c (genrtl_do_stmt_1): New function split out from... + (gen_rtl_do_stmt): ... here. Call genrtl_do_stmt_1. + (expand_unreachable_stmt): Expand unreachable while statements + using genrtl_do_stmt_1. + +2003-05-29 Richard Sandiford + + * config/mips/mips-protos.h (mips_output_load_label): Declare. + * config/mips/mips.c (mips_output_load_label): New function. + (mips_output_conditional_branch): Use it. + * config/mips/mips.md (jump): And here. + +2003-05-28 Bob Wilson + + * config/xtensa/xtensa-protos.h (smalloffset_double_mem_p): Delete. + (xtensa_split_operand_pair): New proto. + * config/xtensa/xtensa.c (move_operand): Handle DFmode and DImode. + (smalloffset_double_mem_p): Delete. + (gen_float_relational, printx, print_operand, xtensa_va_arg): + Fix whitespace. + (xtensa_split_operand_pair): New. + (xtensa_dbx_register_number): Fix formatting. + * config/xtensa/xtensa.h (EXTRA_CONSTRAINT): Remove 'S' constraint. + * config/xtensa/xtensa.md (movdi, movdf): Force constants to memory + instead of splitting them into single-word moves. Remove unnecessary + checks for reload_in_progress and reload_completed. + (movdi_internal, movdf_internal): Change to post-reload split patterns. + Add constraints to allow constant operands. + (movsf_internal): Allow CONST_INT operands. + +2003-05-27 Danny Smith + + * config.gcc (i[34567]86-*-mingw32*): Add host makefile + fragment i386/x-mingw32. + * config/i386/x-mingw32: New file. Make local_includedir + relative to EXEC_PREFIX. + +2003-05-27 Aaron W. LaFramboise + + * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Update. + (MD_STARTFILE_PREFIX): Define. + +2003-05-27 Denis Chertykov + + * cselib.c (cselib_invalidate_regno): Abort if hardreg have a + VOIDmode. + * cselib.c (cselib_process_insn): Pass reg_raw_mode for hardreg in + call of cselib_invalidate_regno. + +2003-05-28 Daniel Jacobowitz + + * config/mips/linux.h (LIB_SPEC): Add missing -lc and correct + -lthread to -lpthread. + +2003-05-28 Eric Botcazou + Bruce Korb + Arno Klaassen + + * fixinc/inclhack.def: Add missing declaration of getpagesize() + to unistd.h on Solaris 2.5.1. + Fix prototype of recv() and send() in sys/socket.h on + Solaris 2.5.1 and 2.6. + * fixinc/tests/base/unistd.h: Add solaris_unistd fix test. + * fixinc/tests/base/sys/socket.h: Add solaris_socket test. + * fixinc/check.tpl: Use 'diff -c', not 'diff -u'. + * fixinc/fixincl.x: Regenerate. + +2003-05-27 Jason Merrill + + * tree.c (expr_first, expr_length): New fns. + * tree.h: Declare them. + + * tree.c (iterative_hash_expr): Hash commutative expressions + consistently. + +2003-05-27 Richard Kenner + + * tree.h (contains_placeholder_p): Now returns bool. + (CONTAINS_PLACEHOLDER_P): New macro. + (type_contains_placeholder_p): New function. + * tree.c (save_expr): Remove code avoiding folding COMPONENT_REF. + (contains_placeholder_p): Now returns bool. + Rework to use CONTAINS_PLACEHOLDER_P macro. + (type_contains_placeholder_p): New function. + * fold-const.c (fold, case COMPONENT_REF): Don't fold if + type_contains_placeholder_p. + (fold_range_test, fold_mathfn_compare, fold_inf_compare, fold): + Use CONTAINS_PLACEHOLDER_P macro. + * builtins.c (fold_builtin): Likewise. + * calls.c (initialize_argument_information): Likewise. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. + * explow.c (expr_size): Likewise. + * expr.c (store_constructor, get_inner_reference): Likewise. + * function.c (assign_parms): Likewise. + * stor-layout.c (variable_size): Likewise. + +2003-05-25 Gabriel Dos Reis + + * diagnostic.h (output_verbatim, verbatim): Remove printf + attribute. + +2003-05-25 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Update Kean Johnston. + +2003-05-24 David Edelsohn + + * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add length attribute. + +2003-05-24 Nathanael Nerode + + * config/rs6000/440.md, config/stormy16/stormy16protos.h, + config/stormy16/stormy16.c, config/stormy16/stormy16.md: + Replace "GNU CC" with "GCC". + +2003-05-24 Matt Kraai + + * builtins.c (expand_builtin_memcpy): Use mode of dest_addr for + intermediate computation. + +2003-05-23 Eric Christopher + + * config/mips/mips.md (clzsi, clzdi): New patterns. + +2003-05-23 Geoffrey Keating + + * gcc.c (default_compilers): Use -o to specify preprocessor's output + file. Make -no-integrated-cpp work when building PCH files. + * objc/lang-specs.h: Likewise. + +2003-05-23 Nathanael Nerode + + * fixinc/Makefile.in: Correct description. + * fixinc/Makefile.in, fixinc/fixfixes.c, fixinc/fixincl.c, + fixinc/fixlib.c, fixinc/fixlib.h, fixinc/fixtests.c, + fixinc/genfixes: Replace "GNU CC" with "GCC". + +2003-05-23 Roger Sayle + + * builtins.def: Define atan, atanf, atanl, tan, tanf and tanl + builtin functions (and their __builtin_* variants). + * builtins.c (mathfn_built_in): Handle tan{,f,l} and atan{,f,l}. + (expand_builtin): Don't expand tan{,f,l} or atan{,f,l} when not + optimizing. + + * doc/extend.texi: Document new tan and atan builtins, and + their float and long double variants. + +2003-05-23 Jason Thorpe + + * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Define + __sparcv9 in the TARGET_ARCH64 case. + +Fri May 23 22:17:32 CEST 2003 Jan Hubicka + + * i386.c (ix86_reorg): Calls are also jumps. + +2003-05-23 J"orn Rennecke + + * cse.c (count_reg_usage): When processing an INSNs REG_EQUAL + note containing an EXPR_LIST, process all the arguments. + +Fri May 23 21:19:31 CEST 2003 Jan Hubicka + Andreas Jaeger + + * i386.h (TARGET_CPU_CPP_BUILTINS): Define __amd64 and __amd64__; + do not use assertion. + +2003-05-23 Mike Stump + + * tlink.c (scan_linker_output): Add support for darwin linker, as it + emits unresolved symbols one per line, consuming the entire line. + +2003-05-23 Larin Hennessy + Zack Weinberg + + * explow.c (allocate_dynamic_stack_space): Remove call to gen_probe. + * config/m68k/m68k.c (m68k_output_function_prologue): + Remove code under #if NEED_PROBE. + * config/m68k/m68k.h: Don't define NEED_PROBE. + * config/m68k/m68k.md: Remove "probe" insn. + * doc/md.texi: Remove documentation of "probe" pattern. + +2003-05-23 Dorit Naishlos + + * config/rs6000/rs6000.md (save_fpregs_{si,di}): Add branch attribute. + +2003-05-23 Eric Botcazou + + * doc/install.texi: Remove sparc64-*-*. Add sparc64-*-solaris2*. + Document sparcv9-*-solaris2* as a synonym for sparc64-*-solaris2*. + +2003-05-22 Roger Sayle + + * real.c (real_maxval): New function to return the largest finite + value representable in a given mode (i.e. FLT_MAX and DBL_MAX). + * real.h (real_maxval): Prototype here. + * fold-const.c (fold_inf_compare): Transform comparisons against + +-Infinity into comparisons against DBL_MAX (or equivalent). + +2003-05-22 Mike Stump + + * config.gcc (*-*-darwin*): Remove use_collect2=no, as it is the + default. + +2003-05-22 DJ Delorie + + * calls.c (expand_call): If the arg block is going to grow + downward, we need argblock to point to the top of the block, + not the bottom. + +2003-05-22 Richard Kenner + + * c-decl.c (duplicate_decls): Test DECL for ERROR_MARK. + + * expr.c (expand_expr, case CONSTRUCTOR): Put into memory if + constant and EXPAND_CONST_ADDRESS, not just EXPAND_INITIALIZER. + +2003-05-22 Kaveh R. Ghazi + + * m68hc11.c: Don't use the `0' flag for asm_fprintf specifiers. + * m68k.c: Likewise. + * m68k.h: Likewise. + +2003-05-22 Zack Weinberg + + PR other/2873 + * fixinc/inclhack.def (avoid_wchar_t_type): Add bypass + expressions to prevent triggering on recent curses.h, + linux/nls.h, or X11/Xlib.h. + (stdio_va_list): Add _G_va_list to bypass pattern. + (strict_ansi_not): Add bypass pattern for __SCO_VERSION__. + * fixinc/fixincl.x: Regenerate. + +2003-05-22 Rekha Bhintade + + * gcc/config/sh/sh.h (TARGET_SWITCHES): Display all the target + switches when --target-help option is specified. + +2003-05-22 Eric Botcazou + + PR bootstrap/10805 + * doc/install.texi (sparc-sun-solaris2.7): Document bootstrap + failure with Sun assembler 5.0 Alpha 03/27/98. + +2003-05-21 Loren James Rittle + + * config/sparc/freebsd.h (CPP_CPU64_DEFAULT_SPEC): Add -D__sparcv9 + to match system compiler convention. + +2003-05-21 Danny Smith + + * gthr-win32.h (__GTHREAD_HIDE_WIN32API): Test for nonzero + value, not just if defined. + Update copyright year. + +2003-05-21 John David Anglin + + PR target/6428 + * pa-hpux10.h (LINK_SPEC, LIB_SPEC): Move -L options for profiling + directories from LIB_SPEC to LINK_SPEC. Emit warning if `-p' or `-pg' + option is used without `-static'. + * pa-hpux11.h (LINK_SPEC, LIB_SPEC): Likewise. + * pa64-hpux.h (LINK_SPEC, LIB_SPEC): Likewise. + +2003-05-21 Bob Wilson + + * config/xtensa/xtensa.h (MASK_SERIALIZE_VOLATILE, + TARGET_SERIALIZE_VOLATILE): Delete. + (MASK_CONST16, MASK_ABS, MASK_ADDX): Renumber flag bits. + (TARGET_DEFAULT): Remove MASK_SERIALIZE_VOLATILE. + (TARGET_SWITCHES): Remove "-mserialize-volatile" and + "-mno-serialize-volatile". + * config/xtensa/xtensa.c (print_operand): Remove checks of + TARGET_SERIALIZE_VOLATILE. + * config/xtensa/xtensa.md (*lsiu, *ssiu): Likewise. + * doc/invoke.texi (Option Summary, Xtensa Options): Remove + "-mserialize-volatile" and "-mno-serialize-volatile" options. + +2003-05-21 Nathan Sidwell + + * c-parse.in (fndef): Set DECL_SOURCE_LINE and FILE earlier. + (nested_function): Likewise. + (notype_nested_function): Likewise. + +2003-05-21 Nick Clifton + + * config/stormy16/stormy-abi: Update overflow type for + R_XSTORMY16_16 reloc. + +2003-05-21 Nathan Sidwell + + * c-common.h (enum rid): Remove RID_BOUNDED, RID_UNBOUNDED. + * c-parse.in (reswords): Remove __bounded__ and __unbounded__. + (rid_to_yy): Remove RID_BOUNDED, RID_UNBOUNDED slots. + * print-tree.c (print_node): Remove ambient-boundedness. + * tree.h (tree_common): Remove bounded_flag. + (BOUNDED_INDIRECT_YPE_P, BOUNDED_POINTER_TYPE_P, + BOUNDED_REFERENCE_TYPE_P, MAYBE_BOUNDED_INDIRECT_TYPE_P, + MAYBE_BOUNDED_POINTER_TYPE_P, MAYBE_BOUNDED_REFERENCE_TYPE_P, + TREE_BOUNDED, TYPE_MAIN_VARIANTS_PHYSICALLY_EQUAL_P, + TYPE_MAIN_PHYSICAL_VARIANT, TYPE_BOUNDED, TYPE_QUAL_BOUNDED): + Remove. + (TYPE_QUALS): Remove BOUNDED. + (TREE_EXPR_QUALS, TREE_FUNC_QUALS): Remove. + (TYPE_BOUNDED_VALUE, TYPE_BOUNDED_BASE, TYPE_BOUNDED_EXTENT, + TYPE_BOUNDED_SUBTYPE, TYPE_UNBOUNDED_VARIANT, TYPE_POINTER_DEPTH, + TYPE_AMBIENT_BOUNDEDNESS, MAX_POINTER_DEPT, + VA_LIST_POINTER_DEPTH): Remove. + (struct tree_type): Remove pointer_depth. + +2003-05-20 Kaveh R. Ghazi + + * c-pretty-print.c (pp_c_integer_literal): Use + HOST_WIDE_INT_PRINT_DOUBLE_HEX. + +2003-05-20 Roger Sayle + Kazu Hirata + Joern Rennecke + + * gcse.c (cprop_jump): Make use of REG_EQUAL notes on both + setcc and jump, if they exist. If substituted instruction + fails to validate, store current effort in a REG_EQUAL note. + (cprop_insn): Don't attempt further substitutions if the + current instruction has been deleted. + (local_cprop_pass): Likewise. + + * jump.c (redirect_jump): Also update REG_EQUAL note, if + one is attached to the jump instruction. + (invert_jump): Delete REG_EQUAL note on jump, if one exists. + +2003-05-21 Danny Smith + + PR c++/9738 + * config/i386/winnt.c (i386_pe_encode_section_info): Enable + even if not first. + +2003-05-20 Kaveh R. Ghazi + + * genautomata.c (output_description, output_automaton_units, + output_state_arcs): Add missing specifiers. + +2003-05-20 Bob Wilson + + * config/xtensa/lib1funcs.asm: Avoid use of .Lfe* in .size directives. + (do_abs, do_addx2, do_addx4, do_addx8): New assembler macros. + (__mulsi3): Use do_addx* instead of ADDX* instructions. Formatting. + (nsau): Rename to do_nsau. Provide alternate version for use when + the NSAU instruction is available. + (__udivsi3, __divsi3, __umodsi3, __modsi3): Use do_nsau macro. + (__divsi3, __modsi3): Use do_abs macro instead of ABS instruction. + * config/xtensa/xtensa-config.h: Update comments to match binutils. + (XCHAL_HAVE_ABS, XCHAL_HAVE_ADDX): Define. + * config/xtensa/xtensa.h (MASK_ABS, MASK_ADDX): Define. + (TARGET_ABS, TARGET_ADDX): Define. + (TARGET_DEFAULT): Conditionally add MASK_ABS and MASK_ADDX. + (TARGET_SWITCHES): Add "abs", "no-abs", "addx", and "no-addx". + * config/xtensa/xtensa.md (*addx2, *addx4, *addx8, *subx2, *subx4, + *subx8): Set predicate condition to TARGET_ADDX. + (abssi2): Set predicate condition to TARGET_ABS. + * doc/invoke.texi (Option Summary): Document new "-mabs", "-mno-abs", + "-maddx", and "-mno-addx" options. + (Xtensa Options): Likewise. Also tag some opcode names with @code. + +2003-05-20 Kevin Ryde + Wolfgang Bangerth + + PR/10355 + * doc/extend.texi: Put a warning into the documentation + of attribute regparm. + +2003-05-20 Jason Merrill + + * tree.c (expr_last): New fn. + * tree.h: Declare it. + * objc/objc-act (expr_last): Rename to objc_expr_last. + +2003-05-20 J"orn Rennecke + + * sh.c (sh_register_move_cost): Add clase for moving between + FP registers and MAC registers. + +2003-05-19 John David Anglin + + * pa/milli64.S ($$mulI): Fix typo. + +2003-05-19 Matt Kraai + + * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p) + (nonlocal_set_p): Remove initial blank line. + * dwarf2out.c (simple_type_size_in_bits): Likewise. + * et-forest.c (et_forest_create): Likewise. + * explow.c (stabilize): Likewise. + * fix-header.c (write_lbrac): Likewise. + * graph.c (start_fct, node_data): Likewise. + * jump.c (only_sets_cc0_p, sets_cc0_p): Likewise. + * rtlanal.c (global_reg_mentioned_p): Likewise. + * tree.c (bit_position): Likewise. + +2003-05-19 Alexandre Oliva + + * config/mips/linux64.h (LIB_SPEC): Add missing -lc and correct + -lthread to -lpthread. + +2003-05-19 Neil Booth + + * c-opts.c (c_common_decode_option): Don't accept dollars + as identifier characters in assembly. + * doc/cpp.texi: Document this. + +2003-05-19 Seth Arnold + Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_stack_info): Do not add + vrsave_size twice. + +2003-05-19 Aldy Hernandez + + * doc/tm.texi (function_arg): Fix typo. + +2003-05-19 Matt Austern + + * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-offsetof option. + * c-common.h (warn_invalid_offsetof): Declare. + * c-common.c (warn_invalid_offsetof): Define. + * doc/invoke.texi: Document -Winvalid-offsetof. + * testsuite/g++.dg/other/offsetof3.C: New. + * testsuite/g++.dg/other/offsetof4.C: New. + +2003-05-19 Kevin B. Hendricks + David Edelsohn + + * config/rs6000/rs6000.c (rs6000_alignment_string, + rs6000_alignment_flags): New variables. + (rs6000_parse_alignment_option): New function. + (rs6000_override_options): Call it. + * config/rs6000/rs6000.h (TARGET_OPTIONS): Add -malign-XXX option. + (MASK_ALIGN_POWER, MASK_ALIGN_NATURAL, TARGET_ALIGN_NATURAL): New + macros. + * config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Always use COMPUTED + natural alignment if TARGET_NATURAL_ALIGNMENT + (ROUND_TYPE_ALIGN): Always use default record alignment if + TAGET_NATURAL_ALIGNMENT. + * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Same + (ROUND_TYPE_ALIGN): Same. + * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Same + (ROUND_TYPE_ALIGN): Same. + * doc/invoke.texi (Option Summary, PowerPC Options): Document + new options. + +2003-05-19 J"orn Rennecke + + * c-decl.c (finish_decl): When setting the DECL_ASSEMBLER_NAME + of a function using ASMSPEC, prepend a star. + +2003-05-19 Jason Merrill + + * tree-inline.c (copy_body_r): Avoid generating &* during inline + substitution. + +2003-05-19 Andrew Macleod + + * config/stormy16/stormy16.c (xstormy16_expand_prologue): Do + not mark assignments to the hard frame pointer as being stack + frame related. + (xstormy16_expand_epilogue): Mark adjustments to the stack + pointer as being stack frame related. + +2003-05-19 Richard Sandiford + + * config/mips/mips.h (ISA_HAS_LOAD_DELAY, ISA_HAS_XFER_DELAY, + ISA_HAS_FCMP_DELAY, ISA_HAS_HILO_INTERLOCKS): New macros. + (PREDICATE_CODES): Add hilo_operand. + * config/mips/mips.c (hilo_operand): New predicate. + (mips_adjust_insn_length): Account for the number nops that might + be needed to avoid hardware hazards. + * config/mips/mips.md (dslot): Remove attribute. + (hazard): New attribute. + (can_delay): Use it. Check for calls, branches & jumps. + (muldi3): Use the standard dmult pattern for mips16 code. + (muldi3_internal, muldi3_internal2): Adjust conditions accordingly. + +2003-05-19 Richard Sandiford + + * config/mips/mips-protos.h (final_prescan_insn, + mips_count_memory_refs, mips_fill_delay_slot): Remove. + * config/mips/mips.h (delay_type, dslots_load_total, + dslots_load_filled, dslots_jump_total, dslots_jump_filled, + dslots_number_nops, num_refs, mips_load_reg, mips_load_reg2, + mips_load_reg3, mips_load_reg4): Remove. + (MASK_STATS): Remove. + (MASK_EXPLICIT_RELOCS): Reuse its value. + (TARGET_STATS): Remove. + (TARGET_SWITCHES): Turn -mstats and -mno-stats into no-ops. + Warn that -mstats is now ignored. + (FINAL_PRESCAN_INSN): Undefine. + (DBR_OUTPUT_SEQEND): Remove handling of dslot statistics. + (ASM_OUTPUT_REG_POP): Likewise. + * config/mips/mips.c (dslots_load_total, dslots_load_filled, + dslots_jump_total, dslots_jump_filled, dslots_number_nops, num_refs, + mips_load_reg, mips_load_reg2, mips_load_reg3, mips_load_reg4, + mips_fill_delay_slot, mips_count_memory_refs, + final_prescan_insn): Remove. + (output_block_move): Remove calls to mips_count_memory_refs. + (print_operand): Remove printing of #nop for TARGET_STATS. + (mips_output_function_epilogue): Remove TARGET_STATS code. + Reorganize setting of fnnmae. + * config/mips/mips.md: Remove handling of dslot statistics + throughout file. Change all fcmp patterns into normal asm + templates, removing calls to mips_fill_delay_slot. + * doc/invoke.texi: Remove documentation of -mstats. + +2003-05-19 Richard Sandiford + + * config/mips/mips.c (mips_class_max_nregs): Return the number of + words in the mode. + +2003-05-19 Richard Sandiford + + * config/mips/mips.c (override_options): Disable explicit + relocs for old ABIs unless using gas. + +2003-05-18 Eric Christopher + + * config/mips/mips.h: Remove definition of g_switch_value. + +2003-05-18 Matt Kraai + + * flags.h (g_switch_value): Change to an unsigned + HOST_WIDE_INT. + * toplev.c (g_switch_value): Likewise. + + * config/alpha/alpha.c (small_symbolic_operand): Remove + g_switch_value cast. + (alpha_in_small_data_p): Cast size to an unsigned + HOST_WIDE_INT. + + * config/frv/frv.c (frv_in_small_data_p): Cast size to an + unsigned HOST_WIDE_INT. + * config/frv/frv.h (g_switch_value, g_switch_set): Remove. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Declare g_switch_set. + + * config/m32r/m32r.c (m32r_in_small_data_p): Cast size to an + unsigned HOST_WIDE_INT. + (m32r_asm_file_start): Use HOST_WIDE_INT_PRINT_UNSIGNED. + * config/m32r/m32r.h (g_switch_value, g_switch_set): Remove. + (ASM_OUTPUT_ALIGNED_COMMON): Declare g_switch_value. + + * config/rs6000/rs6000.c (rs6000_file_start): Use + HOST_WIDE_INT_PRINT_UNSIGNED. + (small_data_operand): Cast summand to unsigned HOST_WIDE_INT. + (rs6000_elf_in_small_data_p): Cast size to unsigned + HOST_WIDE_INT. + * config/rs6000/sysv4.h (g_switch_value, g_switch_set): + Remove. + (SUBTARGET_OVERRIDE_OPTIONS): Declare g_switch_value and + g_switch_set. + (ASM_OUTPUT_ALIGNED_LOCAL): Declare g_switch_value and remove + g_switch_value cast. + +2003-05-18 Roger Sayle + Zack Weinberg + + PR middle-end/10472 + * builtins.c (expand_builtin_memcpy): Call force_operand on + expressions and use simplify_gen_binary to create the addition. + +2003-05-18 Andreas Schwab + + * config/m68k/m68k.md: Use define_constants for unspec numbers. + +2003-05-18 Neil Booth + + * config/sparc/sparc.h: Define sparc for now. + +2003-05-18 Nathanael Nerode + + * config.gcc: Clear xm_file, md_file at the beginning of each pass. + + * config/stormy16/stormy16.h: Remove about 3000 lines of + target-independent comments. Update copyright notice. + + * doc/collect2.texi: GNU CC -> GCC. + * doc/headerdirs.texi: GNU CC -> GCC. + +2003-05-18 Gabriel Dos Reis + + * hashtable.h (struct ht_identifier): Add data member "hash_value". + * hashtable.c (ht_lookup): Use it when searching, remember. + (ht_expand): Do not recompute. + * tree.h (IDENTIFIER_HASH_VALUE): New macro. + +2003-05-18 Nathan Sidwell + + * gcov-io.c (gcov_read_bytes): Fix fread thinko. + +2003-05-18 Neil Booth + + * c-cppbuiltin.c (TARGET_OS_CPP_BUILTINS, TARGET_OBJFMT_CPP_BUILTINS): + Default here. + (c_cpp_builtins): Invoke TARGET_OBJFMT_CPP_BUILTINS(). + * defaults.h: Don't default TARGET_OS_CPP_BUILTINS here. + * config/elfos.h (TARGET_OBJFMT_CPP_BUILTINS): Define __ELF__. + * config/freebsd-spec.h, config/netbsd-elf.h, config/alpha/gnu.h, + config/arm/linux-elf.h, config/arm/rtems-elf.h, + config/arm/unknown-elf.h, config/cris/cris.h, config/cris/linux.h, + config/h8300/elf.h, config/i370/linux.h, config/i386/beos-elf.h, + config/i386/gnu.h, config/i386/linux.h, config/i386/linux64.h, + config/i386/moss.h, config/i386/rtemself.h, config/ia64/ia64.h, + config/m68k/rtemself.h, config/mcore/mcore-elf.h, config/mips/linux.h, + config/pa/pa-linux.h, config/rs6000/linux.h, config/rs6000/linux64.h, + config/rs6000/sysv4.h, config/rs6000/vxworks.h, config/s390/linux.h, + config/sh/coff.h, config/sh/elf.h, config/sh/rtemself.h, + config/sh/sh.h, config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/openbsd64.h, config/sparc/sp64-elf.h, + config/sparc/sp86x-elf.h, config/xtensa/elf.h, config/xtensa/linux.h: + Don't define __ELF__. + * config/alpha.h, config/m68k/linux.h (TARGET_OBJFMT_CPP_BUILTINS): + Define __ELF__. + * doc/cpp.texi: Document __ELF__. + * doc/tm.texi: Document TARGET_OBJFMT_CPP_BUILTINS. * + +2003-05-17 Kaveh R. Ghazi + + * builtins.c (validate_arglist): Eliminate libiberty VA_ macros, + always use stdarg. + * c-errors.c (pedwarn_c99): Likewise. + * c-format.c (status_warning): Likewise. + * c-semantics.c (build_stmt): Likewise. + * calls.c (emit_library_call, emit_library_call_value): Likewise. + * collect2.c (notice, fatal_perror, fatal, error): Likewise. + * cpperror.c (cpp_error, cpp_error_with_line): Likewise. + * diagnostic.c (build_message_string, output_printf, + output_verbatim, verbatim, inform, warning, pedwarn, error, sorry, + fatal_error, internal_error, warning_with_decl, pedwarn_with_decl, + error_with_decl, fnotice): Likewise. + * dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta, + dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, + dw2_asm_output_addr_rtx, dw2_asm_output_nstring, + dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128, + dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, + dw2_asm_output_encoded_addr_rtx): Likewise. + * emit-rtl.c (gen_rtx, gen_rtvec): Likewise. + * errors.c (warning, error, fatal, internal_error): Likewise. + * final.c (output_operand_lossage, asm_fprintf): Likewise. + * fix-header.c (fatal): Likewise. + * gcc.c (fatal, error, notice): Likewise. + * gcov.c (fnotice): Likewise. + * genattrtab.c (attr_rtx, attr_printf): Likewise. + * gengtype.c (error_at_line, xasprintf, oprintf): Likewise. + * gensupport.c (message_with_line): Likewise. + * mips-tfile.c (fatal, error): Likewise. + * protoize.c (notice): Likewise. + * ra-debug.c (ra_debug_msg): Likewise. + * read-rtl.c (fatal_with_file_and_line): Likewise. + * rtl-error.c (error_for_asm, warning_for_asm): Likewise. + * tree.c (build, build_nt, build_function_type_list): Likewise. + +2003-05-17 Neil Booth + + * defaults.h (TARGET_CPU_CPP_BUILTINS, CPP_PREDEFINES): Remove. + * gcc.c (cpp_predefines): Remove. + (cpp_unique_options, do_spec_1): Remove handling of CPP_PREDEFINES. + (static_specs): Remove predefines. + * system.h: Poison CPP_PREDEFINES. + * config/freebsd.h, config/openbsd.h, config/ptx4.h, config/svr3.h, + config/svr4.h, doc/tm.texi: Remove references to CPP_PREDEFINES. + +2003-05-17 Neil Booth + + * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68k-none.h, + config/m68k/m68k.h, config/m68k/m68kemb.h, config/m68k/m68kv4.h, + config/m68k/openbsd.h, config/m68k/rtemself.h: Remove CPP_PREDEFINES, + use TARGET_OS_CPP_BUILTINS and TARGET_CPU_CPP_BUILTINS instead. + +2003-05-17 Neil Booth + + PR c/9209 + * c-common.c, c-common.h (dollars_in_ident): Remove. + * c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true. + (c_common_init_options, c_common_decode_option): Set dollars_in_ident. + * cpphash.h (warned_dollar): Rename warn_dollars. + * cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang) + Permit dollars regardless of -std=. + (post_options): Set warn_dollars. + * cpplex.c (forms_identifier_p): Use warn_dollars. + * config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h: + Remove redundant definitions of DOLLARS_IN_IDENTIFIERS. + * doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi: + Update documentation. + +2003-05-17 Andreas Schwab + + * config/m68k/m68k.c (m68k_output_function_prologue): Use + HOST_WIDE_INT_PRINT_DEC for fprintf and %wd for asm_fprintf when + formatting a HOST_WIDE_INT. + (m68k_output_function_epilogue): Likewise. + +2003-05-17 Zack Weinberg + + * doc/install.texi: Remove information about desupported targets. + +2003-05-17 Andreas Schwab + + * config/m68k/coff.h: Remove support for Sun FPA and Sun SKY board. + * config/m68k/linux.h: Likewise. + * config/m68k/m68k-none.h: Likewise. + * config/m68k/netbsd-elf.h: Likewise. + * config/m68k/sgs.h: Likewise. + * config/m68k/m68k.h: Likewise. + * config/m68k/m68k.md: Likewise. + * config/m68k/m68k.c: Likewise. + * doc/md.texi (Machine Constraints): Remove Sun FPA specific + constraints. + * doc/invoke.texi (Option Summary): Remove -mfpa. + (M680x0 Options): Likewise. + +2003-05-17 David Edelsohn + + * rs6000.c (rs6000_function_value): Simplify REAL_TYPE logic. + +2003-05-17 Neil Booth + + * config/sol2.h: Add TARGET_SUB_OS_CPP_BUILTINS. + * config/sparc/liteelf.h, config/sparc/openbsd64.h, + config/sparc/rtemself.h, config/sparc/sol2-64.h, + config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h: + Update for use of TARGET_SUB_OS_CPP_BUILTINS. + +2003-05-17 Neil Booth + + * i960/i960.h, i960/rtems.h: Use TARGET_OS_CPP_BUILTINS and + TARGET_CPU_CPP_BUILTINS in preference to CPP_PREDEFINES. + +2003-05-17 Neil Booth + + * config.gcc (sparc-*-sysv4*): Add sparc/sysv4-only.h. + * sparc/aout.h, sparc/elf.h, sparc/freebsd.h, sparc/linux.h, + sparc/linux64.h, sparc/lite.h, sparc/litecoff.h, sparc/liteelf.h, + sparc/netbsd-elf.h, sparc/openbsd.h, sparc/openbsd64.h, + sparc/pbd.h, sparc/rtemself.h, sparc/sol2-64.h, sparc/sol2-bi.h, + sparc/sol2.h, sparc/sp64-elf.h, sparc/sp86-elf.h, sparc/sparc.h, + sparc/sysv4.h, + * sparc/sysv4-only.h: New. + +2003-05-17 Alan Modra + + * function.c (assign_parms): Check for zero size args. + +2003-05-16 Kaveh R. Ghazi + + * cfgloopanal.c (test_for_iteration): Use string concatentation on + HOST_WIDE_INT_PRINT_* format specifier to collapse multiple + function calls into one. + * dbxout.c (dbxout_symbol): Likewise. + * defaults.h (ASM_OUTPUT_SIZE_DIRECTIVE): Likewise. + * dwarf2asm.c (dw2_asm_output_data_uleb128, + dw2_asm_output_data_sleb128): Likewise. + * genrecog.c (debug_decision_2): Likewise. + * loop.c (emit_prefetch_instructions): Likewise. + * print-rtl.c (print_rtx): Likewise. + * print-tree.c (print_node_brief, print_node): Likewise. + * ra-debug.c (dump_igraph, dump_graph_cost, + dump_static_insn_cost): Likewise. + * ra-rewrite.c (dump_cost): Likewise. + * sdbout.c (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise. + * sreal.c (dump_sreal): Likewise. + * unroll.c (unroll_loop, precondition_loop_p): Likewise. + * varasm.c (assemble_vtable_entry): Likewise. + + * avr.c (avr_output_function_prologue, + avr_output_function_epilogue, print_operand): Fix format specifier + warnings. + (init_cumulative_args): Mark parameter with ATTRIBUTE_UNUSED. + * avr.h (FUNCTION_VALUE_REGNO_P): Fix signed/unsigned warnings. + +2003-05-16 Geoffrey Keating + + * config/rs6000/rs6000.c (expand_block_move): Unify the TARGET_STRING + and ! TARGET_STRING cases. + + * doc/cppopts.texi (-undef): Fix texinfo warning. + + * doc/cppopts.texi (-H): Document that -H works for PCH files too. + * cppfiles.c (validate_pch): When -H is used, print some information + about PCH files found. + +2003-05-16 Richard Kenner + + * config/mips/t-elf: Remove obsolete rules adding dependencies on tm.h. + * config/mips/t-isa3264, config/mips/t-r3900: Likewise. + * config/mips/t-sr71k: Likewise. + +2003-05-16 Kaveh R. Ghazi + + * arc.c (arc_output_function_prologue, + arc_output_function_epilogue): Fix format specifier warnings. + * arc.h (LARGE_INT): Fix signed/unsigned warnings. + + * v850.c (print_operand): Fix format specifier warnings. + + * ns32k.c (ADJSP, ns32k_output_function_prologue): Fix format + specifier warnings. + + * mcore.c (mcore_print_operand_address, mcore_print_operand): Fix + format specifier warnings. + + * ip2k.c (function_prologue, function_epilogue, print_operand): + Fix format specifier warnings. + * ip2k.md: Likewise. + + * i960.c (i960_output_function_prologue, i960_print_operand, + i960_print_operand_addr): Fix format specifier warnings. + + * i370.c (ascebc, ebcasc): Wrap in macros controlling usage. + (i370_output_function_prologue): Fix format specifier warnings. + * i370.h (PRINT_OPERAND): Likewise. + + * fr30.c (fr30_print_operand): Fix format specifier warnings. + + * dsp16xx.c (print_operand_address): Fix format specifier warning. + * dsp16xx.h (INCLUDE_DEFAULTS): Add missing initializers. + + * c4x.c (c4x_print_operand, c4x_print_operand_address): Fix format + specifier warnings. + + * alpha.c (print_operand_address, alpha_start_function, + unicosmk_output_ssib): Use string concatentation on + HOST_WIDE_INT_PRINT_* format specifier to collapse multiple + function calls into one. + * arm.c (arm_print_operand): Likewise. + * cris.c (cris_asm_output_mi_thunk): Likewise. + * frv.c (frv_asm_output_mi_thunk): Likewise. + * ia64.c (ia64_print_operand, process_set): Likewise. + * m68k.c (m68k_output_function_epilogue, m68k_output_mi_thunk): + Likewise. + * mips/iris5gas.h (PUT_SDB_SIZE): Likewise. + * mips.h (PUT_SDB_INT_VAL, PUT_SDB_SIZE): Likewise. + * pa.c (output_div_insn, pa_asm_output_mi_thunk): Likewise. + * pa.h (PRINT_OPERAND_ADDRESS): Likewise. + * rs6000.c (rs6000_va_start, print_operand_address): Likewise. + * s390.c (s390_assemble_integer): Likewise. + * sparc.c (sparc_flat_function_prologue, + sparc_flat_function_epilogue): Likewise. + * stormy16.c (xstormy16_print_operand_address, xstormy16_print_operand): Likewise. + * vax.c (vax_output_mi_thunk): Likewise. + + * frv.c (frv_print_operand_memory_reference): Fix format specifier + warning. + (frv_rtx_costs): Mark parameter with ATTRIBUTE_UNUSED. + + * m68k.c (m68k_output_function_epilogue): Fix format specifier + warnings. + + * stormy16-protos.h (xs_hi_general_operand, + xs_hi_nonmemory_operand): Prototype. + * stormy16.c (xstormy16_output_shift): Fix format specifier + warnings. + + * cris.c: Fix format specifier warnings. + +2003-05-16 Nick Clifton + + * config/arm/lib1funcs.asm: Fix typo: LSM instead of LSYM. + +2003-05-16 Wolfgang Bangerth + + * doc/bugreport.texi: Remove most of the of the preface of the + bugs section. + +2003-05-16 Jakub Jelinek + + * config/ia64/unwind-ia64.c (uw_update_reg_address): Handle + .save XX, r0. + +2003-05-15 Roger Sayle + + * config/alpha/alpha.h (ASM_OUTPUT_SKIP): Fix typo. + +2003-05-15 Eric Christopher + + * cfgcleanup.c (merge_blocks): Fix return value. + +2003-05-15 Eric Christopher + + * combine.c (expand_compound_operation): Make sure + that zero_extend operation is profitable. + +2003-05-15 Richard Henderson + + * config/alpha/linux.h, config/alpha/linux-elf.h: Remove + code protected by USE_GNULIBC_1. + +2003-05-15 Zack Weinberg + + * config.gcc: Purge all targets obsoleted in GCC 3.3. Also + remove hppa*-*-mpeix* which could not be built, and prune + files from tmake_file= or tm_file= lists that don't exist. + + * config/alpha/alpha-interix.h, config/alpha/alpha32.h + * config/alpha/t-interix, config/arm/conix-elf.h + * config/arm/t-arm-aout, config/arm/t-strongarm-coff + * config/arm/unknown-elf-oabi.h, config/i386/win32.h + * config/m68k/3b1.h, config/m68k/3b1g.h, config/m68k/amix.h + * config/m68k/atari.h, config/m68k/ccur-GAS.h, config/m68k/crds.h + * config/m68k/hp2bsd.h, config/m68k/hp3bsd.h + * config/m68k/hp3bsd44.h, config/m68k/linux-aout.h + * config/m68k/m68k-psos.h, config/m68k/mot3300.h + * config/m68k/pbb.h, config/m68k/plexus.h, config/m68k/sun2.h + * config/m68k/sun2o4.h, config/m68k/sun3.h, config/m68k/sun3mach.h + * config/m68k/sun3n.h, config/m68k/sun3n3.h, config/m68k/sun3o3.h + * config/m68k/t-mot3300, config/m68k/t-mot3300-gald + * config/m68k/t-mot3300-gas, config/m68k/t-mot3300-gld + * config/m68k/tower-as.h, config/m68k/tower.h + * config/m88k/aout-dbx.h, config/m88k/m88k-aout.h + * config/m88k/m88k-modes.def, config/m88k/m88k-move.sh + * config/m88k/m88k-protos.h, config/m88k/m88k.c + * config/m88k/m88k.h, config/m88k/m88k.md, config/m88k/openbsd.h + * config/m88k/sysv4.h, config/m88k/t-luna, config/m88k/t-luna-gas + * config/m88k/t-m88k, config/m88k/t-sysv4, config/mcore/gfloat.h + * config/mips/rtems64.h, config/mips/sni-gas.h + * config/mips/sni-svr4.h, config/mips/t-ecoff + * config/mn10200/lib1funcs.asm, config/mn10200/mn10200-protos.h + * config/mn10200/mn10200.c, config/mn10200/mn10200.h + * config/mn10200/mn10200.md, config/mn10200/t-mn10200 + * config/pa/pa-hiux.h, config/pa/pa-hpux7.h, config/pa/pa-hpux9.h + * config/pa/pa-oldas.h, config/pa/t-mpeix, config/psos.h + * config/romp/romp-protos.h, config/romp/romp.c + * config/romp/romp.h, config/romp/romp.md, config/rs6000/aix31.h + * config/rs6000/aix3newas.h, config/rs6000/mach.h + * config/sparc/bsd.h, config/sparc/hal.h + * config/sparc/linux-aout.h, config/sparc/lynx-ng.h + * config/sparc/lynx.h, config/sparc/netbsd.h + * config/sparc/sp86x-aout.h, config/sparc/splet.h + * config/sparc/sun4gas.h, config/sparc/sun4o3.h + * config/sparc/sunos4.h, config/sparc/t-chorus-elf + * config/sparc/t-halos, config/sparc/t-sparcbare + * config/sparc/t-splet, config/sparc/t-sunos41 + * config/v850/rtems.h: Delete file. + +2003-05-15 Aldy Hernandez + + * config/rs6000/rs6000-protos.h (function_value): Protoize. + + * config/rs6000/rs6000.h (FUNCTION_VALUE): Call function. + + * config/rs6000/rs6000.c (rs6000_function_value): New. + +2003-05-15 Philip Blundell + + * config/arm/arm.c (arm_is_xscale): Rename to arm_arch_xscale. + All uses updated. + (arm_tune_xscale): New variable. + (arm_override_options): Set it. + (arm_adjust_cost): Use it in place of arm_arch_xscale. + (arm_gen_load_multiple): Likewise. + (arm_gen_store_multiple): Likewise. + * config/arm/arm.md (is_xscale): Likewise. + * config/arm/arm.h (arm_tune_xscale): Declare. + +2003-05-15 Philip Blundell + + PR target/10730 + * config/arm/arm.c (adjacent_mem_locations): Reject offsets + involving invalid constants. + +2003-05-15 John David Anglin + + * pa.c (hppa_expand_prologue): Remove blockage. + +2003-05-15 Wolfgang Bangerth + + * doc/bugreport.texi: Remove most of the bug reporting + instructions and merge them into bugs.html. + +2003-05-14 Matt Kraai + + * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Cast + g_switch_value to unsigned HOST_WIDE_INT. + +2003-05-14 Eric Christopher + + * combine.c: Fix header comments. + (distribute_notes): Remove usage of elim_i1, elim_i2. Propagate + to all calls and prototype. + +2003-05-14 Roger Sayle + + PR optimization/10764 + * config/i386/i386.md (atan2df3, atan2sf3, atan2xf3, atan2tf3): + Add an explicit clobber to show that UNSPEC_FPATAN clobbers st(1). + (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): Likewise, + add an explicit clobber to show that UNSPEC_FYL2X clobbers st(1). + (logsf2, logdf2, logxf2, logtf2): Update expander patterns to match + the corresponding *fyl2x_?fxf3 instructions. + +2003-05-14 Bob Wilson + + * config/xtensa/lib2funcs.S (TRAMPOLINE_SIZE): Change from 49 to 59. + * config/xtensa/xtensa-config.h (XCHAL_HAVE_CONST16, + XCHAL_HAVE_L32R): New. + * config/xtensa/xtensa-protos.h (non_const_move_operand, + xtensa_load_constant, xtensa_function_prologue, + xtensa_function_epilogue): Delete prototypes. + (xtensa_expand_prologue): New. + * config/xtensa/xtensa.c (frame_size_const, + TARGET_ASM_FUNCTION_PROLOGUE, TARGET_MACHINE_DEPENDENT_REORG, + non_const_move_operand, xtensa_load_constant, xtensa_reorg, + xtensa_function_prologue): Delete. + (add_operand, xtensa_mem_offset): Formatting. + (move_operand): If the const16 option is available, allow any SFmode + and SImode constants. + (xtensa_emit_move_sequence): Inline the former contents of + xtensa_load_constant with modifications to handle the const16 option. + (override_options): Add xtensa_char_to_class['W'] and set it to + the general register class only if the const16 option is enabled. + Fix formatting. Disallow PIC when using the const16 option. + (print_operand): Reorganize to switch on "letter" instead of the + RTL code. Add output_operand_lossage calls for invalid cases. + Add support for 't' and 'b' letters. + (xtensa_expand_prologue): New function to replace + xtensa_function_prologue and xtensa_reorg. + (xtensa_function_epilogue): Declare this as static. Delete code + to print the retw.n or retw instruction. + (xtensa_return_addr): Use A0_REG instead of 0. + (xtensa_rtx_costs): Add costs for using the const16 option. + * config/xtensa/xtensa.h (MASK_CONST16, TARGET_CONST16): New. + (TARGET_DEFAULT): Add CONST16 if L32R instructions not available. + (TARGET_SWITCHES): Add "const16" and "no-const16". + (REG_CLASS_FROM_LETTER): Add comment about new 'W' letter. + (EXTRA_CONSTRAINT): Change 'T' constraint to only apply when not + using the const16 option. + (TRAMPOLINE_TEMPLATE): Rewrite to avoid hardwired use of l32r insn. + (TRAMPOLINE_SIZE): Change from 49 to 59. + (INITIALIZE_TRAMPOLINE): Adjust offsets to match new trampoline. + (GO_IF_LEGITIMATE_ADDRESS): Do not allow constant pool addresses + when using the const16 option. + (PREDICATE_CODES): Delete non_const_move_operand. + * config/xtensa/xtensa.md (define_constants): Add A1_REG, A8_REG, and + UNSPECV_ENTRY. + (movdi, movdf): If the source is a constant, always expand to a + sequence of movsi insns. + (movdi_internal, movdf_internal): Remove alternative using l32r insns. + (movsi_internal, movsf_internal): Add alternative using const16 insns. + (movsf): Add const16 support. + (entry, prologue, epilogue): New. + (set_frame_ptr): Add missing mode for unspec_volatile operation. + Likewise for subsequent split pattern. + * doc/invoke.texi (Option Summary, Xtensa Options): Document new + "-mconst16" and "-mno-const16" options. + +2003-05-14 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_load_address): Force destination + to be DImode register. Merge load_symptr. + * config/ia64/ia64.md (load_symptr): Remove. + +2003-05-14 Richard Henderson + + * rtl.h (TREE_CONSTANT_POOL_ADDRESS_P): Rename from + DEFERRED_CONSTANT_P. + * integrate.c (copy_rtx_and_substitute): Update use. + * varasm.c (build_constant_desc): Set SYMBOL_REF_DECL + to the copy generated. + (maybe_output_constant_def_contents): Examine TREE_ASM_WRITTEN + of the constant to see if we should emit. + (mark_constant): Similarly. + (output_constant_def_contents): Set TREE_ASM_WRITTEN. + +2003-05-14 David Edelsohn + + * config/rs6000/rs6000.md (movsi_internal2): Use compare for self + move record condition. + (movdi_internal2): Same. + +2003-05-14 Nathan Sidwell + + * gcov-io.h (gcov_write_bytes, gcov_read_bytes): Remove here. + (GCOV_TAG_*) Force type to gcov_unsigned_t. + (GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): New. + (struct gcov_var): Remove modified. Add start, length, offset, + overread. Have buffer array for libgcov. + (gcov_sync, gcov_seek): Definitions moved to gcov-io.c. + (gcov_position, gcov_rewrite, gcov_is_eof): Adjust. + * gcov-io.c (gcov_open): Set mode, do not read anything. + (gcov_close): Write final block. + (gcov_write_block, gcov_allocate): New. + (gcov_write_bytes): Make static. Write or allocate buffer. + (gcov_write_unsigned, gcov_write_counter): Buffer can never be + null. + (gcov_write_string): Adjust. + (gcov_write_tag) + (gcov_write_length): Adjust. Flush the block. + (gcov_write_tag_length): Buffer can never be null. + (gcov_read_bytes): Make static. Read in block. + (gcov_sync): Moved here. Adjust. + (gcov_seek): Moved here. Adjust. + * coverage.c (read_counts_file): Adjust. + * gcov-dump.c (print_prefix): Add position parameter. + (flag_dump_positions): New flag. + (options, main, print_usage): Add it. + (dump_file, tag_blocks, tag_arcs, tag_lines, tag_counters, + tag_summary): Adjust. + * gcov.c (read_graph_file, read_count_file): Adjust. + * libgcov.c (gcov_exit): Adjust. + + * Makefile.in (LIBGCC_DEPS): Use $(srcdir) on gcov files + (libgcov.a): Depend on libgcc.a. + (gcov.o, gcov-dump.o): Add gcov-io.c. + * mklibgcc.in (libgcov_c_dep): Use $(srcdir). + + * loop.c (check_dbra_loop): Factor common test. + +2003-05-14 Ben Elliston + + * doc/md.texi (Automaton pipeline description): Grammar fixes. + +2003-05-14 Richard Sandiford + + * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. + (TARGET_INITIALIZER): Include it. + * target.h (struct gcc_target): Add machine_dependent_reorg field. + * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. + * system.h: Poison MACHINE_DEPENDENT_REORG. + + * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. + * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. + * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (alpha_handle_trap_shadows): Remove "first insn" parameter. + (alpha_align_insns): Likewise. + (alpha_reorg): Likewise. Make static. Update calls to above + functions. + + * config/arm/arm-protos.h (arm_reorg): Remove declaration. + * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. + * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (arm_reorg): Remove parameter. Make static. + + * config/avr/avr-protos.h (machine_dependent_reorg): Remove. + * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. + * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (avr_reorg): Renamed from machine_dependent_reorg. Make static. + Remove parameter. + + * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. + * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. + * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (c4x_reorg): Renamed from c4x_process_after_reload. Make static. + Remove parameter. + + * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. + * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. + * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. + + * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. + * config/frv/frv.c: Remove orphaned comment. + + * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. + * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. + * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. + Remove parameter. + + * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. + * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. + * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (emit_insn_group_barriers): Remove "first insn" parameter. + (emit_all_insn_group_barriers): Likewise. + (ia64_reorg): Likewise. Make static. Update calls to above functions. + (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. + + * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. + * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. + * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. + Remove parameter. + + * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. + * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. + * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (m68hc11_reorg): Make static. Remove parameter. + + * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. + * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. + * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (conditionalize_optimization): Remove parameter. + (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. + Make static. Update call to conditionalize_optimization. + + * config/mips/mips-protos.h (machine_dependent_reorg): Remove. + * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. + * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. + Make static. + + * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. + * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. + * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. + Remove parameter. + + * config/pa/pa-protos.h (pa_reorg): Remove declaration. + * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. + * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (pa_combine_instructions): Remove "first insn" parameter. + (remove_useless_addtr_insns): Likewise. + (pa_reorg): Likewise. Make static. Update calls to above functions. + + * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove + commented-out definition. + + * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. + * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. + * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. + Remove parameter. + + * config/sh/sh-protos.h (machine_dependent_reorg): Remove. + * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. + * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (sh_reorg): Renamed from machine_dependent_reorg. Make static. + Remove parameter. + (sh_output_mi_thunk): Call sh_reorg directly. + * config/sh/sh.md: Update comment. + + * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove + commented-out definition. + + * config/v850/v850-protos.h (v850_reorg): Remove declaration. + * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. + * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (v850_reorg): Make static. Remove parameter. + + * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. + * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. + * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. + (xtensa_reorg): Make static. Remove parameter. + + * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. + (TARGET_MACHINE_DEPENDENT_REORG): Document. + +2003-05-13 Richard Henderson + + * c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if + the old decl had instantiated DECL_RTL. + +2003-05-13 Mike Stump + + * doc/invoke.texi (Option Summary): Kill off documentation for -$. + +2003-05-13 Janis Johnson + + * config/rs6000/sysv4.h (OUTPUT_ASM_ALIGNED_LOCAL): Expect + HOST_WIDE_INT argument. + +2003-05-13 Jason Merrill + + * tree.h (STRIP_MAIN_TYPE_NOPS): New macro. + + * tree.c (iterative_hash_expr): New fn. + + * c-semantics.c (emit_local_var): Don't mess with temp slots if + there's no initializer. + +2003-05-13 Richard Sandiford + + * final.c (final_scan_insn): Apply the effects of frame-related + delay slot insns before emitting a delayed branch. + +2003-05-13 Nick Clifton + + * config/mcore/mcore.md (jump): Use emit_jump_insn. + +2003-05-13 Ulrich Weigand + + * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Second + parameter of ASM_OUTPUT_SKIP must have type unsigned HOST_WIDE_INT. + +2003-05-12 DJ Delorie + + * expr.c (move_by_pieces): Honor the alignment of TO and FROM. + (emit_push_insn): Don't use push when the source alignment is less + than the stack's push rounding. + +2003-05-13 Zack Weinberg + + * diagnostic.c (output_format): Add support for %m. + (output_printf, output_verbatim, diagnostic_set_info, + verbatim): Set err_no field of the text_info structure being + initialized. + (fatal_io_error): Delete function. + * diagnostic.h (text_info): Add err_no field. + * toplev.h (fatal_io_error): Delete prototype. + + * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c + * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c + * objc/objc-act.c: Replace all calls to fatal_io_error with + calls to fatal_error; add ": %m" to the end of all the affected + error messages. + +2003-05-13 Zack Weinberg + + * varasm.c (notice_rtl_inlining_of_deferred_constant): New function. + * rtl.h: Prototype it. + * integrate.c (copy_rtx_and_substitute ): Call it + when appropriate. + +2003-05-13 Ulrich Weigand + + * config/s390/s390.md ("*iordi3_oi"): Do not mark commutative. + ("*iorsi3_oi"): Likewise. + +2003-05-13 Richard Earnshaw + + * arm.md (compare_scc): Use shorter sequence for EQ case. + (ior_scc_scc_cmp, and_scc_scc_cmp): New insn-and-split patterns. + (and_scc_scc): Ensure split only applies when there is a dominance + of the comparisons. + (and_scc_scc_nodom): New insn-and-split pattern. + +2003-05-13 Richard Sandiford + + * unwind-dw2.c (uw_init_context_1): Don't pass &outer_cfa directly + to _Unwind_SetGRPtr(). + +2003-05-13 Michael Eager + + * Makefile.in: Initialize program_transform_cross_name from + @program_transform_name@ instead of target_alias. + +2003-05-12 Janis Johnson + Alan Modra + Jakub Jelinek + + * configure.in (HAVE_AS_TLS): Add powerpc and powerpc64 tests. + * configure: Rebuild. + * config/rs6000/rs6000-protos.h: Update. + * config/rs6000/rs6000.c (rs6000_tls_size): New. + (rs6000_tls_size_string): New. + (rs6000_parse_tls_size_option): New. + (rs6000_legitimize_tls_address): New. + (rs6000_tls_get_addr): New. + (rs6000_got_sym): New. + (rs6000_tls_symbol_ref): New. + (rs6000_tls_symbol_ref_1): New. + (rs6000_get_some_local_dynamic_name): New. + (rs6000_get_some_local_dynamic_name_1): New. + (TARGET_HAVE_TLS): New. + (TARGET_CANNOT_FORCE_CONST_MEM): New. + (rs6000_override_options): Handle -mtls-size option. + (constant_pool_expr_1): Handle TLS symbols. + (rs6000_legitimize_address): Handle TLS symbols. + (rs6000_tls_referenced_p): New. + (rs6000_legitimate_address): Handle TLS symbols. + (rs6000_emit_move): Handle TLS symbols. + (print_operand): Handle TLS symbols. + (uses_TOC): Handle TLS symbols. + (rs6000_emit_prologue): Use symbol for unspec constant. + * config/rs6000/rs6000.h (HAVE_AS_TLS): New. + (some_ld_name): New. + (LEGITIMATE_CONSTANT_P): Handle TLS symbols. + (PRINT_OPERAND_PUNCT_VALID_P): Handle TLS symbols. + (PREDICATE_CODES): Add rs6000_tls_symbol_ref. + * config/rs6000/rs6000.md (load_toc_v4_PIC_1, load_toc_v4_PIC_1b): + Support TLS. + (tls_gd_32, tls_gd_64, tls_ld_32, tls_ld_64, tls_dtprel_32, + tls_dtprel_64, tls_dtprel_ha_32, tls_dtprel_ha_64, tls_dtprel_lo_32, + tls_dtprel_lo_64, tls_got_dtprel_32, tls_got_dtprel_64, tls_tprel_32, + tls_tprel_64, tls_tprel_ha_32, tls_tprel_ha_64, tls_tprel_lo_32, + tls_tprel_lo_64, tls_got_tprel_32, tls_got_tprel_64, tls_tls_32, + tls_tls_64): New. + * config/rs6000/sysv4.h (SUBTARGET_OPTIONS): Add tls_size. + +2003-05-12 Neil Booth + + * Makefile.in (stage2_build, stage3_build, stage4_build): + Set BUILD_CC to the same as CC. + +2003-05-12 Neil Booth + + * alloc-pool.c (last_id): Put in ENABLE_CHECKING guards. + +2003-05-12 Andreas Schwab + + * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Mark 'exp' + as unused. + (bundling): Initialize 'pos'. + (ia64_expand_builtin): Initialize 'rmode'. + +2003-05-12 David Edelsohn + + * config/rs6000/xcoff.h (ASM_OUTPUT_SKIP): Accept HOST_WIDE_INT. + (ASM_OUTPUT_ALIGNED_COMMON): Same. + (ASM_OUTPUT_LOCAL): Same. + +Mon May 12 21:53:29 CEST 2003 Jan Hubicka + + * varasm.c (output_constant): Fix underflow. + +2003-05-12 Mark Mitchell + + PR other/10745 + * configure.in: Correct detection of GNU ld version number. + * configure: Regenerated. + +2003-05-12 Zack Weinberg + + * diagnostic.c (diagnostic_for_decl): Take a + diagnostic_context argument. Restructure to be consistent + with diagnostic_report_diagnostic. + (diagnostic_count_diagnostic): Now static. Take a + diagnostic_info argument, not just a diagnostic_t. Some code + moved here from internal_error. Move a case label for + clarity. + (diagnostic_action_after_output): New function. Code moved + here from internal_error and fatal_error. + (bug_report_request): New #define so that this text appears in + only one place. + (diagnostic_report_diagnostic): Update to match changes to + diagnostic_count_diagnostic. Call diagnostic_action_after_output. + (diagnostic_set_info): Call gettext here. + + (pedwarn): Update comment. Don't call gettext here. + (sorry): Use report_diagnostic. Don't call gettext here. + (fatal_error): Remove final fnotice and exit, but call + real_abort to prevent warnings about noreturn function returning. + (internal_error): Likewise. Don't do ICE suppression here nor + call context->internal_error. + (warning_with_decl): Suppress for decls in system headers. + Adjust call to diagnostic_for_decl. + (pedwarn_with_decl): Likewise. + (error_with_decl): Adjust call to diagnostic_for_decl. + (error_recursion): Use bug_report_request. + + * diagnostic.h: Remove prototype of diagnostic_count_diagnostic. + * objc/objc-act.c (error_with_ivar, warn_with_method): Don't call + diagnostic_count_diagnostic. + +2003-05-12 John David Anglin + + * pa64-hpux.h (ASM_OUTPUT_ALIGNED_COMMON): Correct last patch. + +Mon May 12 15:57:54 CEST 2003 Jan Hubicka + + * rs6000/darwin.h (ASM_OUTPUT_COMMON): Accept HOST_WIDE_INT + * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Fix warning. + * mips/mips.h (ASM_OUTPUT_SKIP): Fix typo in the previous patch. + +2003-05-12 Roger Sayle + + * doc/rtl.texi: Document zero_extract as a valid destination + of a set insn. + +2003-05-12 Richard Earnshaw + + * arm/lib1funcs.asm (LSYM): Define -- on ELF prefix a local symbol with + '.'. Change all local symbol definitions and references to use LSYM. + +Mon May 12 11:32:53 CEST 2003 Jan Hubicka + + * expr.h (assemble_static_space): Update prototype. + * output.h (assemble_zeros, output_constant): Likewise. + * elfos.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): Make it 64bit clean + * alpha.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASK_OUTPUT_LOCAL): Make + it 64bit clean. + * elf.h (ASM_OTUPUT_SKIP): Likewise. + * unicosmk.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMM): Likewise. + * arm.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Expect HOST_WIDE_INT operand. + * aout.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Expect HOST_WIDE_INT operand. + * unknown-elf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Expect HOST_WIDE_INT operand. + * avr.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): Expect + HOST_WIDE_INT operand. + * c4x.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP, + ASM_OUTPUT_BSS): Expect HOST_WIDE_INT operand. + * aout.h (ASM_OTUPUT_SKIP): Likewise. + * cris.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Likewise. + * darwin.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON): Likewise. + * dsp16xx.h (ASM_OTUPUT_SKIP): Likewise. + * frv.h (ASM_OTUPUT_SKIP): Likewise. + * h8300.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_LOCAL): Likewise. + * 370.h (ASM_OTUPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): + Make it 64bit + clean. + * att.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand. + * bsd.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): + Make it 64bit clean. + * darwin.h (ASM_OUTPUT_SKIP): Make it 64bit clean.. + * sco5.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Expect + HOST_WIDE_INT operand + * svr3gas.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): + Expect HOST_WIDE_INT operand + * sysv3.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT operand + * i960.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, + ASM_OUTPUT_ALIGNED_LOCAL): Expect HOST_WIDE_INT operand + * ip2k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Likewise. + * m32r.h (ASM_OUTPUT_COMMON): Likewise. + * 3b1.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Likewise. + * amix.h (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. + * crds.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_ALIGNED_LOCAL): Likewise. + * hp320.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, + ASM_OUTPUT_SKIP): Likewise. + * m68k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): + Likewise. + * m68kelf.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, + ASM_OUTPUT_SKIP): Likewise. + * m68kv4.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, + ASM_OUTPUT_SKIP): Likewise. + * mot3300.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. + * netbsd-elf.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, + ASM_OUTPUT_SKIP): Likewise. + * sgs.h (ASM_OUTPUT_SKIP): Likewise. + * tower-as.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, + ASM_OUTPUT_SKIP): Likewise. + * m88k.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON, ASM_OUTPUT_SKIP): + Likewise. + * mcore.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_BSS, ASM_OUTPUT_SKIP): Likewise. + * iris.h (ASM_OUTPUT_LOCAL): Likewise. + * mips.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_SKIP): Likewise. + * ns32k.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, + ASM_OUTPUT_SKIP): Make it 64bit clean. + * pa-pro-end.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): + Make it 64bit clean. + * pa.h (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL, + ASM_OUTPUT_SKIP): Make it 64bit clean. + * hpux.h (ASM_OUTPUT_LOCAL, ASM_OUTPUT_ALIGNED_LOCAL): Make it + 64bit clean. + * romp.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect + HOST_WIDE_INT argument + * s390.h (ASM_OUTPUT_SKIP): Expect HOST_WIDE_INT argument. + * sh.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_LOCAL, ASM_OUTPUT_COMMON): Expect + HOST_WIDE_INT argument + * sol2.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument + * sparc.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON): HOST_WIDE_INT argument + * svr3.h (ASM_OUTPUT_SKIP): HOST_WIDE_INT argument + * vax.h (ASM_OUTPUT_SKIP, ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): + HOST_WIDE_INT argument + * vaxv.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument + * xtensa.h (ASM_OUTPUT_LOCAL): HOST_WIDE_INT argument + * varasm.c (asm_output_bss, asm_output_aligned_bss, + asm_emit_uninitialized, assemble_zeros, assemble_static_space): + HOST_WIDE_INT argument + +2003-05-10 Steven Bosscher + + * cgraphunit.c (cgraph_create_edges): Drop walk_tree in + favor of walk_tree_without_duplicates. Add comments. + +2003-05-12 Josef Zlomek + + * alloc-pool.h (ALLOC_POOL_ID_TYPE): New type. + (struct alloc_pool_def): New element 'id'. + * alloc-pool.c (fancy_abort): Extern function prototype. + (abort): Macro which uses fancy_abort. + (struct allocation_object_def): New structure. + (ALLOCATION_OBJECT_PTR_FROM_USER_PTR): New macro. + (USER_PTR_FROM_ALLOCATION_OBJECT_PTR): New macro. + (last_id): New variable. + (create_alloc_pool): Add the offset of u.data to size of element, + increase and use last_id. + (free_alloc_pool): Do the checking only when ENABLE_CHECKING. + (pool_alloc): Likewise. Set ID for elements. + (pool_free): Check whether the PTR was allocated from POOL. + +2003-05-11 Richard Henderson + + PR c/10675 + * c-decl.c: Include hashtab.h. + (detect_field_duplicates): New. + (finish_struct): Use it. + * Makefile.in (c-decl.o): Update. + * c-parse.in (structsp_attr): Nreverse component_decl_list results. + (component_decl_list, component_decl_list2, + components, components_notype): Build list in reverse order. + (enumlist): Clarify docs. Use TREE_CHAIN not chainon. + + * tree.c (chainon): Special case op2 null as well. + Reorg for clarity. + +2003-05-11 Roger Sayle + + * config/i386/i386.md (logsf2, logdf2, logxf2, logdf2): New patterns + to implement log, logf and logl built-ins as inline x87 intrinsics. + (UNSPEC_FYL2X): New unspec to represent x87's "fyl2x" instruction. + (*fyl2x_sfxf3, *fyl2x_dfxf3, *fyl2x_xf3, *fyl2x_tfxf3): New insn + patterns for x87's "fyl2x" instruction, used by log?f2 patterns. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2X like + UNSPEC_FPATAN, i.e. replaces two stack operands with single result. + +2003-05-11 Kaveh R. Ghazi + + * Makefile.in (out_object_file): Don't set -Wno-error for ${cpu}.o. + + * sparc.c (print_operand): Fix uninitialized warning. + +2003-05-12 Zdenek Dvorak + + * cfgloopanal.c (num_loop_insns, average_num_loop_insns): Count only + real insns. + * loop-unroll.c (unroll_loop_runtime_iterations): Remove superfluous + condition. + +2003-05-11 Neil Booth + + * doc/cpp.texi: Fix typos. + +2003-05-11 Ulrich Weigand + + * config/s390/s390.c (s390_function_arg_float): New function. + (s390_function_arg_pass_by_reference): Use it. + (s390_function_arg_advance): Likewise. + (s390_function_arg): Likewise. + (s390_va_arg): Likewise + +2003-05-11 Nathan Sidwell + + * coverage.h (coverage_counter_alloc): New function. + * function.h (struct function): Remove arc_profile flag. + * coverage.c (fn_ident): Remove. + (fn_b_ctrs, no_coverage): New. + (get_coverage_counts): Use current_function_funcdef_no. + (coverage_counter_alloc): New. + (coverage_counter_ref): Adjust. + (coverage_begin_output): Check no_coverage. Use + current_function_funcdef_no. + (coverage_end_function): Likewise. + (create_coverage): Set no_coverage. Set DECL_UNINLINEABLE rather + than clearing flag_inline_functions. Do not clear arc_profile + flag. + * function.c (prepare_function_start): Do not set arc_profile + flag. + * profile.c (instrument_edges): Return number of instrumented + edges. Use a for loop. + (branch_prob): Call coverage_counter_alloc. Make BB_TO_GCOV_INDEX + local to here and simplify. Use profile_arc_flag not arc_profile + flag. + (find_spanning_tree): Reformat. + * toplev.c (rest_of_compilation): Use profile_arc_flags and + flag_test_coverage rather than arc_profile flag. + +2003-05-11 Gabriel Dos Reis + + * doc/invoke.texi (Wctor-dtor-privacy): Update documentation. + +2003-05-11 Richard Kenner + + * varasm.c (copy_constant, case VIEW_CONVERT_EXPR): New case. + +2003-05-11 Bruno Haible + + * cppfiles.c (find_or_create_entry): Preserve errno. + +2003-05-11 Neil Booth + + * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into + cpplib as it's a Standard Predefined Macro. + * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins. + * cppinit.c (_cpp_init_builtins): Take HOSTED. Define + __STDC_HOSTED__ appropriately. + * cpplib.h (_cpp_init_builtins): Update. + * fix-header.c (read_scan_file): Update. + * doc/cpp.texi, doc/cppopts.texi: Update documentation. + +2003-05-11 Gabriel Dos Reis + + PR C++/689 + PR C++/9257 + * c-opts.c (c_common_decode_option): Don't set + warn_ctor_dtor_privacy wen -Wall. + * c-common.c (warn_ctor_dtor_privacy): Don't turn on by default. + +2003-05-10 Alexandre Oliva + + * reload1.c (reload_cse_move2add): Revert part of my 2003-05-09's + patch. + +2003-05-10 Zack Weinberg + + * diagnostic.c: Reorder functions for clarity, putting all the + functions in the "error" family next to each other, and + likewise all the functions in the "error_with_decl" family. + Some other routines were moved too. Add comments. + (vbuild_message_string): Fold into sole caller. + + +2003-05-11 Ulrich Weigand + + * except.c (EH_RETURN_STACKADJ_RTX): Do not define. + (EH_RETURN_HANDLER_RTX): Likewise. + (expand_builtin_eh_return): Do not copy stack adjustment + if EH_RETURN_STACKADJ_RTX is not defined. + (expand_eh_return): Likewise. Also, do not pass stack + adjustment as argument to the eh_return pattern. + * except.h (MUST_USE_SJLJ_EXCEPTIONS): Do not define just + because EH_RETURN_STACKADJ_RTX is not defined. + * unwind-dw.c (uw_update_context_1): If EH_RETURN_STACKADJ_RTX + is not defined, treat stack pointer like a regular register. + (uw_init_context_1): Set up fake initial stack pointer register. + (uw_install_context_1): Do not compute stack adjustment if + EH_RETURN_STACKADJ_RTX is not defined. + + * config/i386/i386.md ("eh_return"): Remove first argument. + * config/mips/mips.md ("eh_return"): Likewise. + * config/rs6000/rs6000.md ("eh_return"): Likewise. + * config/sh/sh.md ("eh_return"): Likewise. + + * config/s390/s390.h (EH_RETURN_STACKADJ_RTX): Remove. + +2003-05-10 Alexander Aganichev + + * config/i386/i386.h (MODES_TIEABLE_P): Fix typo. + +2003-05-10 Nathan Sidwell + + * defaults.h (GCOV_TYPE_SIZE): Remove. + * gcov-io.h (gcov_type): Set to specific mode int on target. + (gcov_unsigned_t, gcov_position_t): New. + (GCOV_TYPE_NODE): New. + (GCOV_TAG_SUMMARY_LENGTH): Adjust. + (GCOV_COUNTERS_SUMMABLE): New. + (gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn, + gcov_ctr_info, gcov_info): Adjust types. + (gcov_var): Adjust types. + (gcov_write_unsigned, gcov_write_tag, + gcov_write_length, gcov_write_tag_length, gcov_write_summary, + gcov_read_unsigned, gcov_read_summary): Adjust gcov types. + (gcov_position, gcov_sync, gcov_seek): Adjust gcov types. + * gcov-io.c (gcov_write_unsigned, gcov_write_tag, + gcov_write_length, gcov_write_tag_length, gcov_write_summary, + gcov_read_unsigned, gcov_read_summary): Adjust gcov types. + * libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit, + __gcov_init, __gcov_merge_add): Adjust gcov types. + * coverage.c (ctr_merge_functions): Constify. + (ctr_names): New. + (read_counts_file): Adjust gcov types. Only summarize & merge + summable counters. + (coverage_counter_ref): Use GCOV_TYPE_NODE. + (build_fn_info_type, build_fn_info_value, build_ctr_info_type, + build_ctr_info_value, build_gcov_info): Adjust types. + * profile.c (branch_prob): Adjust gcov types. + * gcov_dump (dump_file): Adjust gcov types. + +2003-05-10 Richard Earnshaw + + * arm.md (DOM_CC_X_AND_Y, DOM_CC_NX_OR_Y, DOM_CC_X_OR_Y): New + constants. + (ior_scc_scc, and_scc_scc): New insn_and_split patterns. + * arm.c (arm_select_dominance_cc_mode): Renamed from + select_dominance_cc_mode, no-longer static. Use DOM_CC... constants. + Callers updated. + * arm-protos.h (arm_select_dominance_cc_mode): Add prototype. + +2003-05-09 Roger Sayle + + * config/alpha/alpha.c (alpha_start_function): Declare frame_size + as unsigned to avoid signed/unsigned comparison warnings. + +2003-05-09 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_emit_loop_end): Only use "nop.n" + instruction if the Xtensa density option is enabled. + +2003-05-09 Matt Kraai + + * mklibgcc.in: Remove extra quotes. + +2003-05-09 Mark Mitchell + + * config/rs6000/rs6000.c (spe_init_builtins): Fix typo in creation + of int_ftype_void. + +2003-05-09 Alexandre Oliva + + * reload1.c (reload_cse_move2add): Don't turn an implicit + truncation into a self-set in the narrow mode. + +2003-05-09 Richard Earnshaw + + * arm.md (clzsi2): The CLZ instruction is predicable. + +2003-05-09 Bob Wilson + + * config/xtensa/xtensa.c: Formatting. + +2003-05-09 Diego Novillo + + * tree-dump.c (dequeue_and_dump): Use CONSTRUCTOR_ELTS, + instead of TREE_OPERAND to access the operand of a + CONSTRUCTOR node. + +2003-05-09 Diego Novillo + + * tree-dump.c (dequeue_and_dump): CONSTRUCTOR nodes contain only + one operand. + +2003-05-09 Gabriel Dos Reis + + * toplev.h (warning_with_file_and_line): Don't declare. + (error_with_file_and_line): Likewise. + * diagnostic.c (error_with_file_and_line): Remove. + (warning_with_file_and_line): Likewise. + +2003-05-09 Gabriel Dos Reis + + * c-parse.in (if_stmt_locus): New object. + (if_prefix rule): Use it. Don't use warning_with_file_and_line. + (select_or_iter_stmt rule): Likewise. + (if_stmt_file): Remove. + (if_stmt_line): Likewise. + * jump.c: include "diagnostic.h" + (never_reached_warning): Don't use warning_with_file_and_line. + * Makefile.in (jump.o): Add dependce on diagnostic.h + +2003-05-09 Alan Modra + + * expr.c (move_block_from_reg): Remove "size" parm. Localize vars. + Move code handling pieces not larger than a word to.. + * function.c (assign_parms): ..here, but use change_address instead + of adjust_address and operand_subword, and expand_binop instead of + expand_shift. Adjust calls to move_block_from_reg. + * expr.h (move_block_from_reg): Update declaration. + (copy_blkmode_from_reg): Formatting. + * Makefile.in (function.o): Add $(OPTABS_H) to deps. + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Adjust + move_block_from_reg calls. + * config/arc/arc.c (arc_setup_incoming_varargs): Likewise. + * config/i960/i960.c (i960_setup_incoming_varargs): Likewise. + * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. + * config/m88k/m88k.c (m88k_builtin_saveregsk): Likewise. + * config/mips/mips.c (mips_setup_incoming_varargs): Likewise. + * config/pa/pa.c (hppa_builtin_saveregs): Likewise. + * config/romp/romp.h (SETUP_INCOMING_VARARGS): Likewise. + * config/rs6000/rs6000.c (setup_incoming_varargs): Likewise. + * config/sh/sh.c (sh_builtin_saveregs): Likewise. + +2003-05-08 DJ Delorie + + * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_arg): Fix + to handle arguments for which MUST_PASS_IN_STACK is true (e.g., + variable-sized types). + (xstormy16_function_arg): New. Pass them that way too. + * config/stormy16/stormy16-protos.h (xstormy16_function_arg): New. + * config/stormy16/stormy16.h (FUNCTION_ARG): Call it. + +2003-05-08 Aldy Hernandez + + * mklibgcc.in: Use mkinstalldirs when installing multilib + directories. + +2003-05-08 J"orn Rennecke + + * sh.c (gen_block_redirect, split_branches): Use CODE_FOR_jump_compact + instead of CODE_FOR_jump + +2003-05-08 Gabriel Dos Reis + + * objc/objc-act.c (error_with_ivar): Don't use + error_with_file_and_line. + (warn_with_method): Don't use warning_with_file_and_line. + +2003-05-08 Gabriel Dos Reis + + * stmt.c (emit_locus): New macro. + (emit_filename): Remove. + (emit_lineno): Likewise. + (struct stmt_status): Replace members x_emit_filename and + x_emit_lineno with x_emit_locus. + (set_file_and_line_for_stmt): Adjust. + (expand_expr_stmt_value): Don't use warning_with_file_and_line. + (warn_if_unused_value): Likewise. + (check_seenlabel): Likewise. + +2003-05-08 Gabriel Dos Reis + + * c-decl.c (define_label): Tidy. Don't use any of + error_with_file_and_line or warning_with_file_and_file. + (pending_xref_error): Likewise. + (store_parm_decls): Likewise. + (current_function_prototype_locus): New object. Package from + current_function_prototype_file and current_function_prototype_line. + (start_function): Use it. + (current_function_prototype_file): Remove. + (current_function_prototype_line): Remove; + +2003-05-08 Kaveh R. Ghazi + + * builtins.c (readonly_data_expr): New function. + (expand_builtin_memmove): Optimize any rodata source, not just + strings. + +2003-05-07 David Mosberger + + * unwind-libunwind.c (_Unwind_FindEnclosingFunction): New. + +2003-05-07 Richard Henderson + + * config/i386/i386.c (ix86_split_long_move): Fix base register + mode for XFmode splits for TARGET_64BIT. + +2003-05-07 Richard Henderson + + * sched-ebb.c (schedule_ebb): Supply the correct starting + block number to save_line_notes. + +2003-05-07 Richard Henderson + + * toplev.c (enum dump_file_index): Swap DFI_ce3, DFI_bbro. + (dump_file): Likewise. + +2003-05-07 David Mosberger + + * config/ia64/crtbegin.asm (__do_jv_register_classes): Don't + forget to preserve gp. + * config/ia64/crtend.asm (__do_global_ctors_au): Ditto. + + * config/ia64/crtbegin.asm (__do_jv_register_classes): Add missing + .prologue directive. + Use .skip instead of data8 for .bss section to make Intel + Assembler (ias) happy. Minor whitespace fixups. Make "nop 0" + explicit in the .mib bundles and remove the unnecessary stop + bits. Replace local labels with normal labels, to make ias + happy. Don't register __do_global_ctors_aux here, do it in + crtend.asm instead. + + * config/ia64/crtend.asm [HAVE_INIT_FINI_ARRAY]: Register + __do_global_ctors_aux in .init_array section instead of + declaring it as a hidden global. Replace local labels with + ordinary labels to make ias happy. + +2003-05-07 Richard Henderson + + PR c++/10570 + * except.c: Revert 04-01 and 04-02 forced-unwind changes. + * flags.h, toplev.c, doc/invoke.texi: Likewise. + + * unwind-dw2.c (_Unwind_GetCFA): Fix ptr->int conversion warning. + * unwind.inc (_Unwind_DeleteException): Check for null + exception_cleanup. + + * unwind-sjlj.c (_Unwind_SjLj_Resume_or_Rethrow): New. + * unwind.inc (_Unwind_Resume_or_Rethrow): New. + * unwind.h: Declare them. + * libgcc-std.ver (GCC_3.3): Export them. + +2003-05-07 Richard Henderson + + * unwind-dw2.c (_Unwind_GetCFA): Cast pointer to _Unwind_Ptr, + not _Unwind_Word. + +2003-05-07 Zack Weinberg + + * stmt.c (force_label_rtx): New function, based on logic + formerly found in expand_expr. + * expr.h: Prototype it. + * expr.c (expand_expr ): Use force_label_rtx if + appropriate. + * varasm.c (decode_addr_const ): Use force_label_rtx. + + * print-tree.c (debug_tree): Free the table after we're done + with it. Use putc. + +2003-05-07 Aldy Hernandez + + * config/rs6000/spe.h: Reverse arguments for __ev_subfw. + Unreverse arguments for __ev_subw. + + * config/rs6000/spe.md (evsubfw): Reverse arguments of assembly. + +2003-05-07 Nick Clifton + + * config/stormy16/stormy-abi: Update to include + R_XSTORMY16_FPTR16, R_XSTORMY16_LO16, R_XSTORMY16_HI16 and + R_XSTORMY16_12 relocs. + +2003-05-07 Alan Modra + + * function.c (assign_parms): Correct reversed reg_parm_stack_space + test. Add partial in-regs size to stack_args_size. + +2003-05-07 Gerald Pfeifer + + * doc/invoke.texi (Warning Options): Mark -Wmissing-declarations + as a C only option. + +2003-05-07 Nathan Sidwell + + * gcov-io.h (GCOV_LOCKED): New #define. + (GCOV_LINKAGE): Make sure it is #defined. + (gcov_write_string, gcov_write_tag, gcov_write_length, + gcov_read_string, gcov_time): Poison in libgcov. + (gcov_seek_end): Remove. + (gcov_write_tag_length, gcov_sync, gcov_rewrite): New. + (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH, + GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH, + GCOV_TAG_SUMMARY_LENGTH): New #defines. + (gcov_write_tag, gcov_write_length): Not in libgcov. + * gcov-io.c (gcov_open): Use GCOV_LOCKED. + (gcov_write_tag, gcov_write_length): Not in libgcov. + (gcov_write_tag_length): New. + (gcov_write_summary): Use gcov_write_tag_length. + * libgcov.c: Always #include gcov-io.h. + (IN_LIBGCOV): -1 for inhibit_libc, +1 otherwise. + (GCOV_LINKAGE): Define to nothing for L_gcov. + (gcov_exit): Replace gcov_write_tag, gcov_write_length with + gcov_write_tag_length. Use gcov_rewrite & gcov_seek. + * gcov.c (read_graph_file): Replace gcov_seek by gcov_sync. + (read_count_file): Likewise. + * gcov-dump.c (dump_file): Likewise. + * coverag.c (read_counts_file): Likewise. + +2003-05-06 Mark Mitchell + + PR other/10658 + * gcc.c (process_command): Update copyright date. + +2003-05-06 Phil Edwards + + * doc/install.texi (mips-*-*): Add note about libstdc++. + +2003-05-06 DJ Delorie + + * config/stormy16/stormy16.c (xstormy16_function_profiler): New. + * config/stormy16/stormy16.h (FUNCTION_PROFILER): Call it. + * config/stormy16/stormy16-protos.h (xstormy16_function_profiler): New. + +2003-05-06 + + * c-opts.c (COMMAND_LINE_OPTIONS): Reject -Wmissing-prototypes + and -Wstrict-prototypes if C++. + +2003-05-06 Aldy Hernandez + + * config/rs6000/linuxspe.h: New file. + + * config.gcc: Add powerpc-*-linux-gnuspe* target. + +2003-05-06 Richard Henderson + + * unwind-dw2.c (uw_update_context_1): Only set cfa as sp if + previous frame didn't save sp. Clear sp for next frame. + (uw_install_context_1): Honor saved sp from frame. + +2003-05-06 Richard Sandiford + + * config/mips/mips-protos.h (mips_subword, mips_output_move): Declare. + (mips_move_1word, mips_move_2words): Remove declaration. + (mips_split_64bit_move_p, mips_split_64bit_move): Declare. + (mips_restore_gp): Remove insn argument. + * config/mips/mips.h (FP_REG_RTX_P): New macro. + * config/mips/mips.c (volatile_buffer): Remove. + (mips_subword, mips_split_64bit_move_p, mips_split_64bit_move): New. + (mips_move_1word, mips_move_2words): Remove, replacing with... + (mips_output_move): ...this new function. + (mips_restore_gp): Remove insn argument. Adjust for above changes. + (print_operand): Make '%h' print %hi(op) for HIGH operands. Remove + handling of floating-point constants. Handle zero CONST_DOUBLE + arguments. + (mips_annotate_frame_insn): Replace with... + (mips_set_frame_expr): ...this, which just takes one argument. + (mips_frame_set): Change the register argument to an rtx. + (mips_emit_frame_related_store): Use mips_split_64bit_move_p to + check whether moves should be split. Use mips_split_64bit_move + to split them. Use mips_subword to generate the high and low + parts of a paired FPR. Adjust calls to frame_set and + mips_set_frame_expr. + (mips_expand_prologue): Simplify due to above changes. + * config/mips/mips.md: Add splitters for 64-bit moves on 32-bit + targets, replacing xisting register-only versions. + (UNSPEC_STORE_DF_HIGH): New unspec. + (UNSPEC_LOAD_DF_LOW, UNSPEC_LOAD_DF_HIGH): New unspecs. + (mulsi3_r4000, muldi3_internal2): Avoid use of mips_move_1word. + (*paradoxical_extendhidi2): Remove. + (movdi_internal, movdi_internal2): Use mips_output_move. + (*movdi_internal2_mips16, movsi_internal, movcc): Likewise. + (movsf_internal1, movsf_internal2): Likewise. + (movdf_internal1a): Likewise. Fix length and type of f <- G case. + (movdf_internal1b): Use mips_output_move. Fix type of f <- G case. + (movdf_internal2): Use mips_output_move. Fix lengths of FPR moves. + Add m <- G alternative. + (load_df_low, load_df_high, store_df_low): New patterns. + (movhi_internal): Use @ template instead of calling a function. + Remove unnecessary 'z' alternatives. + (movqi_internal): Likewise. + (exception_receiver): Update call to mips_restore_gp. + +2003-05-06 Richard Sandiford + + * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Remove. + (mips_delegitimize_address): Declare. + * config/mips/mips.h (ASM_SIMPLIFY_DWARF_ADDR): Undefine. + (FIND_BASE_TERM): Define. + * config/mips/mips.c (TARGET_DELEGITIMIZE_ADDRESS): Defi~e. + (mips_delegitimize_address): Renamed from mips_simplify_dwarf_addr. + Handle small-data addresses. + +2003-05-05 Roger Sayle + + * real.c (real_powi): New function to calculate the value of + a real raised to an integer power, i.e. pow(x,n) for int n. + (real_sqrt): Convert to using the faster do_add, do_multiply + and do_divide API for consistency with the rest of real.c. + * real.h (real_powi): Prototype here. + * builtins.c (fold_builtin): Avoid local variable mode when + evaluating sqrt at compile time. Attempt to evaluate pow at + compile-time, by checking for an integral exponent. + +2003-05-05 Richard Henderson + + * doc/extend.texi (Variable Attributes): Re-sort table and tidy. + +2003-05-05 David O'Brien + + * config/rs6000/sysv4.h (CPP_OS_FREEBSD_SPEC): Add __ELF__ to mirror + other FreeBSD ports. + (LINK_OS_FREEBSD_SPEC): Mirror conventions on other FreeBSD ports. + (_LITTLE_ENDIAN): Use __LITTLE_ENDIAN__ instead. + +2003-05-05 Janis Johnson + + * Makefile.in: (site.exp): Add ALT_CC_UNDER_TEST, add quotes around + expanded variables. + * doc/sourcebuild.texi (C tests): Describe gcc.dg/compat tests. + +2003-05-05 Zack Weinberg + + * rtl.h (STRING_POOL_ADDRESS_P): Rename to DEFERRED_CONSTANT_P. + * varasm.c (struct varasm_status): Add deferred_constants field. + (n_deferred_strings): Delete variable. + (n_deferred_constants): New #define. + (struct constant_descriptor_tree): Kill next and label fields. + (const_hash_table, MAX_HASH_TABLE): Delete. + (const_desc_htab): New static variable. + (const_hash): Rename const_desc_hash, and make it fit the + hashtab.h interface. + (const_desc_eq): New. + (const_hash_1, compare_constant): Const-ify arguments. + (build_constant_desc): Set DEFERRED_CONSTANT_P on all new + SYMBOL_REFs. Clarify comments. Don't set desc->label. + (output_constant_def): Do the lookup/insert using the + hashtab.h interface. Don't muck with n_deferred_constants or + DEFERRED_CONSTANT_P here. + Always call maybe_output_constant_def_contents. + (maybe_output_constant_def_contents): Take a pointer to the + descriptor, not the EXP and RTL separately. Return + immediately if this constant is not deferred. Defer output of + everything, except writable string constants. Update + n_deferred_constants here. + (output_constant_def_contents): Now takes just one argument, + an rtx. Clear DEFERRED_CONSTANT_P here. + (mark_constant_pool): Update for rename of n_deferred_strings. + (mark_constant): Don't clear DEFERRED_CONSTANT_P here. + + (init_varasm_status): Clear p->deferred_constants. + (init_varasm_once): Call htab_create_ggc for const_desc_htab. + +2003-05-05 Kaveh R. Ghazi + + * builtins.c (expand_builtin_stpcpy): Only expand when the length + of the source string can be evaluated at compile-time. + +2003-05-05 Aldy Hernandez + + * testsuite/gcc.c-torture/compile/simd-6.c: New. + + * c-typeck.c (digest_init): Handle arrays of vector constants. + +2003-05-05 Jakub Jelinek + + * builtins.c (expand_builtin_mempcpy): New function. + (expand_builtin_stpcpy): Optimize stpcpy whose return value is + ignored into strcpy no matter what arguments it has. + (expand_builtin) : Call + expand_builtin_mempcpy. + +2003-05-05 Aldy Hernandez + + * testsuite/gcc.dg/20030505.c: New. + + * c-typeck.c (convert_for_assignment): Opaque pointers can + interconvert. + + * config/rs6000/rs6000.c: New global opaque_p_V2SI_type_node. + (rs6000_init_builtins): Initialize opaque_p_V2SI_type_node. + (spe_init_builtins): Rename all pv2si_type_node to + opaque_p_V2SI_type_node. + Remove declaration of pv2si_type_node. + (is_ev64_opaque_type): Accept opaque pointers. + +2003-05-05 Geoffrey Keating + + * config/rs6000/rs6000.c (validate_condition_mode): Use + flag_finite_math_only. + (rs6000_reverse_condition): Never return UNKNOWN; use + flag_finite_math_only. + (rs6000_generate_compare): Use flag_finite_math_only. + (rs6000_emit_cmove): Handle UNLE. Support UNEQ under -ffast-math. + Use HONOR_* rather than flag_unsafe_math_optimizations. Correct + UNGE and GT cases. Handle UNEQ and LTGT when ! HONOR_NANS. + + * toplev.c (check_global_declarations): Suppress not-used warning + for volatile variables. + +2003-05-05 Olivier Hainque + + * expr.c (expand_expr, case BIT_FIELD_REF): Refine the test forcing + usage of bitfield instructions for mode1 != BLKmode, only ignoring + SLOW_UNALIGNED_ACCESS if the field is not byte aligned. + (store_field): Likewise. + +2003-05-05 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_expand_binop_builtin): Add + evsubifw to builtins accepting 5-bit unsigned constants. + (easy_vector_constant): Return if V1DImode. Fix typo. + +2003-05-05 Aldy Hernandez + + * config/rs6000/spe.h: Revert licensing change from last patch. + +2003-05-05 DJ Delorie + + * config/stormy16/stormy16.md (negsi2): Allocate the pseudos + before reload, but defer the split until after. + * config/stormy16/stormy16.c (xstormy16_expand_arith): Modify + to match. + +2003-05-05 David Edelsohn + + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add 440 support. + * config/rs6000/vxworks.h (CC1_SPEC): Use -mcpu=440 for t440. + +2003-05-05 Zdenek Dvorak + + * libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc + is defined. + +2003-05-04 Kaveh R. Ghazi + + * builtin-attrs.def (ATTR_NOTHROW_NONNULL_1, + ATTR_NOTHROW_NONNULL_2, ATTR_NOTHROW_NONNULL_3): Renamed from + ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3. + + (ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4, + ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1, + ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1): + New. + + * builtins.def (DEF_EXT_FALLBACK_BUILTIN): Accept ATTRS argument. + (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Update comment + + (BUILT_IN_INDEX, BUILT_IN_RINDEX, BUILT_IN_MEMCPY, + BUILT_IN_MEMMOVE, BUILT_IN_MEMCMP, BUILT_IN_MEMSET, + BUILT_IN_MEMPCPY, BUILT_IN_STRCAT, BUILT_IN_STRNCAT, + BUILT_IN_STPCPY, BUILT_IN_STRCPY, BUILT_IN_STRNCPY, + BUILT_IN_STRCMP, BUILT_IN_STRNCMP, BUILT_IN_STRLEN, + BUILT_IN_STRSTR, BUILT_IN_STRPBRK, BUILT_IN_STRSPN, + BUILT_IN_STRCSPN, BUILT_IN_STRCHR, BUILT_IN_STRRCHR, BUILT_IN_NAN, + BUILT_IN_NANF, BUILT_IN_NANL, BUILT_IN_NANS, BUILT_IN_NANSF, + BUILT_IN_NANSL, BUILT_IN_PUTS, BUILT_IN_FPUTC, BUILT_IN_FPUTS, + BUILT_IN_FWRITE, BUILT_IN_PUTS_UNLOCKED, BUILT_IN_FPUTC_UNLOCKED, + BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE_UNLOCKED, + BUILT_IN_STRDUP): Add "nonnull" attribute. + +2003-05-04 Richard Kenner + + * expr.c (store_field): Don't clobber TEMP in shift: it might be + a variable. + (get_inner_reference): Don't go through a VIEW_CONVERT_EXPR + whose purpose is to step up the alignment. + (expand_expr, case ADDR_EXPR): Force LO_SUM into memory, just like REG. + + * stor-layout.c (compute_record_mode): Relax restriction + on fields crossing word boundaries forcing BLKmode. + +2003-05-04 Neil Booth + + * cppinit.c (cpp_create_reader, post_options): Warn about + trigraphs unless explicity set or -trigraphs. + * cpplex.c (warn_in_comment): New. + (_cpp_process_line_notes): Better handling of -Wtrigraphs. + (_cpp_skip_block_comment): Add call to _cpp_process_line_notes. + * doc/cppopts.texi, doc/cpp.texi: Update. + +2003-05-04 Zdenek Dvorak + + * Makefile.in (LIBGCOV): Add _gcov_merge_add. + * gcov-io.h: Make GCOV_LINKAGE extern in libgcov and prevent resulting + namespace clash. + (GCOV_MERGE_FUNCTIONS): New. + (gcov_merge_fn): Declare. + (struct gcov_ctr_info): New field "merge". + (__gcov_merge_add): Declare. + * coverage.c (ctr_merge_functions): New. + (build_ctr_info_type, build_ctr_info_value): Initialize merge field + of gcov_ctr_info type. + * libgcov.c (__gcov_merge_add): New. + (gcov_exit): Call a hook to merge values of counters. + +2003-05-04 Gabriel Dos Reis + + * toplev.h (pedwarn_with_file_and_line): Don't declare. + * diagnostic.c (pedwarn_with_file_and_line): Remove. + +2003-05-04 Gabriel Dos Reis + + * varasm.c (assemble_variable): Don't use error_with_file_and_line. + +2003-05-04 Kaveh R. Ghazi + + * builtins.c (expand_builtin_constant_p, expand_builtin_strlen, + expand_builtin_frame_address): Update prototypes. + (expand_builtin_constant_p, expand_builtin_strlen, + expand_builtin_strcpy, expand_builtin_memset, + expand_builtin_bzero, expand_builtin_args_info, + expand_builtin_frame_address): Pass in just the argument(s) + needed, not the entire expression `exp'. + (expand_builtin): Update all calls to these functions. + +2003-05-03 Richard Henderson + + * builtins.c (expand_builtin) : Remove. + : New. + * builtins.def (BUILT_IN_DWARF_FP_REGNUM): Remove. + (BUILT_IN_DWARF_SP_COLUMN): New. + * dwarf2out.c (expand_builtin_dwarf_fp_regnum): Remove. + (expand_builtin_dwarf_sp_column): New. + * except.h: Update to match. + * unwind-dw2.c (execute_stack_op): Correct stack push typo. + (execute_cfa_program): Record location expression address + before extracting length. + (uw_update_context_1): Install old CFA into stack pointer column. + (uw_init_context_1): Set cfa_reg to stack pointer column. + +2003-05-03 Richard Henderson + + * config/rs6000/rs6000.c (constant_pool_expr_p): Make static and + return bool. + (toc_relative_expr_p): Likewise. + (SPE_CONST_OFFSET_OK): Move from rs6000.h. + (legitimate_constant_pool_address_p): Move from rs6000.h, change + into a function, downcase all users. + (legitimate_small_data_p): Likewise. + (legitimate_offset_address_p): Likewise. + (legitimate_indexed_address_p): Likewise. + (legitimate_indirect_address_p): Likewise. + (legitimate_lo_sum_address_p): Likewise. + (rs6000_mode_dependent_address): Likewise. + * rs6000.h (CONSTANT_POOL_EXPR_P, TOC_RELATIVE_EXPR_P): Remove. + (SPE_CONST_OFFSET_OK, LEGITIMATE_CONSTANT_POOL_ADDRESS_P, + LEGITIMATE_SMALL_DATA_P, LEGITIMATE_OFFSET_ADDRESS_P, + LEGITIMATE_INDEXED_ADDRESS_P, LEGITIMATE_INDIRECT_ADDRESS_P, + LEGITIMATE_LO_SUM_ADDRESS_P): Move into rs6000.c. + (LEGITIMATE_ADDRESS_INTEGER_P): Remove. + (GO_IF_MODE_DEPENDENT_ADDRESS): Use rs6000_mode_dependent_address. + * config/rs6000/rs6000-protos.h: Update. + +2003-05-03 Geoffrey Keating + + * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Define. + (REVERSE_CONDITION): Define. + + * config/rs6000/rs6000.c (scc_comparison_operator): Make equivalent + to branch_positive_comparison_operator. + (ccr_bit): Check that sCOND conditions are actually a positive bit. + (print_operand): Remove %D substitution. + (rs6000_emit_sCOND): Generate complement operation to ensure that + sCOND input is a positive bit. + * config/rs6000/rs6000.md: Rearrange sCOND templates to be in the + same order as bCOND, and add the missing ones. Remove the %D + substitutions from the scc patterns. + + * simplify-rtx.c (simplify_relational_operation): Add case for + ! (fabs(x) < 0.0). + +2003-05-03 Bruce Korb + + * gcc/fixinc/fixincl.tpl(dne): restore this to force merge conflicts + in fixincl.x + * gcc/fixinc/inclhack.def(bsd_stdio_attrs_conflict): fix placement + +2003-05-03 Aldy Hernandez + + * config/rs6000/spe.h: Remove unecessary casts. Misc cleanups. + +2003-05-03 Zack Weinberg + + PR c/10604 + * c-common.c (warn_sign_compare): Initialize to -1. + * c-opts.c (c_common_init_options): Don't set warn_sign_compare here. + (c_common_decode_option ): Set warn_sign_compare + for C++ only. + (c_common_post_options): Set warn_sign_compare from extra_warnings + if it's still -1 at this point. + + * toplev.c (maybe_warn_unused_parameter): New static variable. + (set_Wextra): New static function. + (W_options): Remove "extra". + (decode_W_option): Call set_Wextra. + (independent_decode_option): Likewise. + (set_Wunused): Cooperate with set_Wextra in setting + warn_unused_parameter. + (rest_of_compilation): No need to check extra_warnings as + well as warn_uninitialized. + + * c-typeck.c (build_binary_op, build_conditional_expr): + No need to check extra_warnings as well as warn_sign_compare. + (internal_build_compound_expr): No need to check extra_warnings + as well as warn_unused_value. + * function.c (expand_function_end): No need to check extra_warnings + as well as warn_unused_parameter. + * stmt.c (expand_expr_stmt_value): No need to check extra_warnings + as well as warn_unused_value. + + * doc/invoke.texi: Clarify documentation of -Wsign-compare. + + * Makefile.in: Disable -Werror for gengtype-lex.o. + +2003-05-03 Olivier Hainque + + * emit-rtl.c (last_call_insn, add_function_usage_to): New functions. + * rtl.h (last_call_insn, add_function_usage_to): New prototypes. + * builtins.c (expand_builtin_apply): Use the new emit-rtl functions. + * calls.c (emit_call_1): Likewise. + (expand_call): For calls initializing constant memory, replace + emission of standalone mem /u clobber with function usage entry. + * expr.c (emit_block_move_via_libcall): Likewise. + * cse.c (count_reg_usage, case EXPR_LIST): New case. + * flow.c (propagate_one_insn): Pass entire operand of + CALL_INSN_FUNCTION_USAGE to mark_used_regs. + * integrate.c (try_constants): For CALL_INSNs, substitute constants + within the FUNCTION_USAGE also. + * loop.c (prescan_loop): Note clobbers of const mem mentioned in + FUNCTION_USAGE lists. + * reload1.c (replace_pseudos_in): Renamed. + (reload): Use it for clobbers surviving until the end of the reload. + +2003-05-03 Richard Kenner + + * expr.c (expand_expr, case VIEW_CONVERT_EXPR): Don't use + gen_lowpart on non-integer modes. + + * stor-layout.c (place_field): When adjusting offset_align, use + desired_align, not DECL_ALIGN. + +2003-05-03 Nathan Sidwell + + * c-decl.c (pending_invalid_xref_file): Remove. + (pending_invalid_xref_line): Remove. + (pending_invalid_xref_location): New. + (lookup_label): Use location_t and input_location directly. + (lookup_tag): Likewise. + (pending_xref_error): Likewise. + (c_expand_body_1): Likewise. + * c-common.c (x_expand_start_cond): Likewise. + * c-semantics.c (genrtl_for_stmt): Likewise. + (find_reachable_label): Likewise. + * expr.c (expand_expr): Likewise. + * integrate.c (output_inline_function): Likewise. + * tree-inline.c (find_alloca_call): Likewise. + (find_builtin_longjmp_call): Likewise. + * gcc.c (input_filename): Make static. + +2003-05-03 Richard Sandiford + + * config/mips/mips.md: Fix comment typo. + + * config/mips/mips.c (mips_integer_op): New structure. + (MIPS_MAX_INTEGER_OPS): Define. + (mips_const_insns): Use mips_build_integer to determine the number + of instructions needed to load a CONST_INT. + (move_operand): Reject compound CONST_INTs. + (mips_build_shift, mips_build_lower, mips_build_integer): New fns. + (mips_move_integer): New fn. + (mips_legitimize_const_move): Pass CONST_INTs to mips_move_integer. + (mips_legitimize_move): Only legitimize constants when moving + word or subword values. + +2003-05-02 Matt Kraai + + * Makefile.in (gcov-iov.h): Use move-if-change and a stamp. + +2003-05-02 Kaveh R. Ghazi + + * builtins.c (expand_builtin_stpcpy): Copy `arglist' before + modifying it. + +2003-05-03 Falk Hueffner + Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Zdenek Dvorak, Aldy + Hernandez, and Kazu Hirata. Update Richard Henderson. + +2003-05-02 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_attribute_table): Add 'extern' + to tentative declaration. + + * config/rs6000/sysv4.h (SYMBOL_FLAG_SMALL_V4): Delete. + (SYMBOL_FLAG_SMALL_V4): Delete. + * config/rs6000/rs6000.c (small_data_operand): Use SYMBOL_REF_SMALL_P. + (rs6000_elf_encode_section_info): Don't set SYMBOL_FLAG_SMALL_V4. + (rs6000_elf_in_small_data_p): Add extra section names. Add + comment about TREE_PUBLIC test. + + * c-semantics.c (genrtl_switch_stmt, genrtl_if_stmt): Call + expand_stmt on result of expand_unreachable_stmt. + +2003-05-02 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Daniel Berlin. + +2003-05-02 David Edelsohn + + * config/rs6000/{603.md,6xx.md,7450.md,7xx.md,rs64.md}: Decrease + number of automata. + + * config/rs6000/rs6000.c (symbol_ref_operand): Check + SYMBOL_REF_FUNCTION_P on AIX. + (current_file_function_operand): Same. + * config/rs6000/rs6000.md (call,call_value): Force non-function + symbol_ref into register on AIX. + +2003-05-02 Alan Modra + + * calls.c (struct arg_data): Move offset, slot_offset, size and + alignment_pad to struct locate_and_pad_arg_data. Update all refs. + (initialize_argument_information): Adjust call to locate_and_pad_parm. + Delete alignment_pad var. Don't calculate slot_offset here. + (emit_library_call_value_1): Delete alignment_pad, offset and size + vars. Use struct locate_and_pad_arg_data instead. Adjust refs. + Adjust call to locate_and_pad_parm. Don't tweak arg size for + partial in-regs here. Formatting fixes. + * expr.h (struct locate_and_pad_arg_data): New struct. + (locate_and_pad_parm): Adjust declaration. + * function.c (assign_parms): Localize vars. Use "locate" instead of + other arg location vars. Don't invoke FUNCTION_ARG or + FUNCTION_INCOMING_ARG unless pretend_named is different from + named_arg. Heed MUST_PASS_IN_STACK and set up "partial" before + calling locate_and_pad_parm. Adjust locate_and_pad_parm call. + Use slot_offset for stack home of reg parms. Correct test for + parm passed in memory. Formatting fixes. + (locate_and_pad_parm): Add "partial" to params. Replace offset_ptr + arg_size_ptr and alignment pad with "locate". Set slot_offset here. + Correct initial_offset_ptr handling. Localize vars. Always pad + locate->offset even when in_regs. + +2003-05-02 Nathan Sidwell + + * Makefile.in (TREE_H): Replace location.h with input.h. + (GTFILES) Remove location.h + (gt-lists.h): Replace gt-location.h with gt-input.h + * input.h (input_filename, input_line): Remove variables. + (location_s, location_t): Move from location.h. + (input_location): New. + (input_filename, input_line): New #defines. + * location.h: Remove. + * tree.h: Replace location.h with input.h. + (input_filename, input_line): Remove. + * diagnostic.h: Replace location.h with input.h. + * gcc.h (input_filename, input_filename_length): Remove declarations. + * toplev.c (input_filename, input_line): Remove. + (input_location): Define. + (push_srcloc, pop_srcloc): Adjust. + * diagnostic.c (diagnostic_report_current_module): Adjust. + +2003-05-02 Nick Clifton + + * configure.in: Add xstormy16 to list of targets that has a nop + instruction and hence which can be tested to see if the + assembler supports the --gdwarf2 switch. + * configure: Regenerate. + +2003-05-01 Falk Hueffner + + PR target/8257 + * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, + alpha_start_function, alpha_expand_epilogue, unicosmk_gen_dsib): + Avoid undefined shifts by making the shift operand unsigned. + +2003-05-01 DJ Delorie + + * reload.c (find_reloads): Also check that all of a multi-reg + value is in the class. + +2003-05-01 Nathan Sidwell + + * scan.h (lineno): Revert the rename here. + +2003-05-01 Stan Shebs + + * config/darwin.c (darwin_encode_section_info): Call + default_encode_section_info. + +2003-05-01 David Edelsohn + + * config/rs6000/rs6000.md (define_attr "type"): Add mfjmpr. + (movsi_internal1): Use new mfjmpr attribute. + (movhi_internal): Same. + (movqi_internal): Same. + (movcc_internal1): Same. + (movdi_internal64): Same. + * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md, + power4.md,rios1.md,rios2.md,rs64.md}: Add mfjmpr. + * config/rs6000/40x.md: Add fpu_405. + * config/rs6000/power4.md: Merge power4lsu and power4disp automata + into power4misc automata. Remove extraneous parentheses. + * config/rs6000/440.md: New file. + * config/rs6000/rs6000.c (processor_target_table): Add 440, + 440fp. Rename 405f to 405fp. + (function_arg_padding): Correct formatting. + (rs6000_rtx_costs): Add PROCESSOR_PPC440 cases. + +2003-05-01 Nathan Sidwell + + * input.h (lineno): Rename to ... + (input_line): ... here. + * tree.h (lineno): Rename to ... + (input_line): ... here. + * scan.h (lineno): Rename to ... + (input_line): ... here. + * toplev.c (lineno): Rename to ... + (input_line): ... here. + (push_srcloc, pop_srcloc): Rename lineno to input_line. + * c-common.c (c_expand_start_cond, fname_decl): Likewise. + * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag, + store_parm_decls, c_expand_body_1): Likewise. + * c-errors.c (pedwarn_c99): Likewise. + * c-format.c (status_warning): Likewise. + * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise. + * c-opts.c (c_common_post_options, c_common_parse_file): Likewise. + * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise. + * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var, + gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt, + genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt, + genrtl_return_stmt, genrtl_for_stmt, build_break_stmt, + build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt, + prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise. + * coverage.c (create_coverage): Likewise. + * diagnostic.c (pedwarn, sorry, error, fatal_error, + internal_error, warning, diagnostic_report_current_module, + inform): Likewise. + * expr.c (expand_expr): Likewise. + * integrate.c (expand_inline_function, + output_inline_function): Likewise. + * rtl-error.c (file_and_line_for_asm): Likewise. + * tree-inline.c (find_alloca_call, find_builtin_longjmp_call, + walk_tree): Likewise. + * tree.c (make_node): Likewise. + * ada, cp, f, java, objc, treelang: Likewise. + * objc/objc-act.c (objc_init): Rename lineno to input_line. + (build_module_descriptor, build_selector_translation_table, + build_protocol_template, build_method_prototype_list_template, + build_category_template, build_selector_table, + build_class_template, build_super_template, build_ivar_template, + build_ivar_list_template, build_method_list_template, + build_method_template, add_instance_variable): Likewise. + + * dwarf2out.c (dwarf2out_init, dwarf2out_finish): Change parameter + name from input_filename. + +2003-04-30 Eric Christopher + Richard Sandiford + + * configure: Regenerate from patches below. + * combine.c (gen_lowpart_for_combine): Fix comment and add tests + for all symbolic operands. + * config/mips/mips.c: Migrate RTX_COSTS and CONST_COSTS + to function. + * config/mips/linux.h: Fix typo. + * Merge from mips-3_4-rewrite branch: + + 2003-04-07 Richard Sandiford + + * config/mips/mips.c (mips_classify_symbol): Add catch-all case for + handling local labels when TARGET_ABICALLS. + + 2003-04-04 Richard Sandiford + + * config/mips/mips-protos.h (mips_expand_epilogue): Add an + integer argument. + (mips_expand_call): Likewise. + * config/mips/mips.h (TARGET_SIBCALLS): New macro. + (FIXED_REGISTERS): Clear $31 entry. + (CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTER): Likewise. + (EPILOGUE_USES): Define. + * config/mips/mips.c (mips_function_ok_for_sibcall): New function. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Use it. + (override_options): Add a 'j' register class. + (mips_expand_call): Handle sibcalls + (mips_expand_epilogue): Handle epilogues for sibcalls. + * config/mips/mips.md (epilogue): Adjust call to mips_expand_epilogue. + (sibcall_epilogue): New pattern. + (call, call_value): Adjust calls to mips_expand_call. + (sibcall, sibcall_value): New expanders. + (sibcall_internal, sibcall_value_internal): New patterns. + (sibcall_value_multiple_internal): New pattern. + + 2003-03-25 Richard Sandiford + + * config/mips/mips.md (extended_mips16): New attribute. + (define_attr length): Default to 8 if extended_mips16 == yes. + (truncdisi2): Set extended_mips16 to yes for the sll alternative. + (truncdihi2, truncdiqi2, *extendsidi2): Likewise. + (call_internal): Set extended_mips16 to yes for direct jumps. + Remove redundant mode attribute. + (call_value_internal, call_value_multiple_internal): Likewise. + (call_split): Remove redundant mode attribute. + (call_value_split, call_value_multiple_split): Likewise. + + * config/mips/mips.c (mips_symbol_insns): Rework. Fix handling + of unaligned offsets. + + * config/mips/mips.c (mips_splittable_symbol_p): Fix handling + of SYMBOL_GENERAL. + + 2003-03-22 Richard Sandiford + + * config/mips/mips.h (TARGET_EXPLICIT_RELOCS): Add commentary. + * config/mips/mips.c (override_options): Disable -mexplicit-relocs + for mips16 code. + + 2003-03-22 Richard Sandiford + + * config/mips/mips.h (ADDRESS_COST): Define. + + 2003-03-20 Richard Sandiford + + * config/mips/mips.h (EXTRA_CONSTRAINT): Give existing meaning of + 'R' to 'U'. Make 'R' mean a single-instruction memory reference. + * config/mips/mips.md: Replace 'R' constraints with 'U'. + + 2003-03-18 Richard Sandiford + + * config/mips/mips.md (truncdisi2): Add commentary. Use sll instead + of a two-instruction sequence. Add register->memory alternative. + (truncdihi2, truncdiqi2): Likewise. + Rework shift/truncate instructions so that they only handle right + shifts of 32 (or more, in the case of arithmetic shifts). + Add patterns for truncate/sign-extend. + + 2003-03-13 Richard Sandiford + + * configure.in (mips*-*-*): Check for explicit relocation support. + * configure: Regenerate. + + 2003-03-13 Richard Sandiford + + * config/mips/mips.h (TARGET_SWITCHES): Add -mexplicit-relocs + and -mno-explicit-relocs. + (MASK_EXPLICIT_RELOCS): Define. + (TARGET_EXPLICIT_RELOCS): Use it. + (mips_split_addresses): Remove declaration. + * config/mips/mips.c (override_options): Update comment for + mips_split_addresses. Clear MASK_EXPLICIT_RELOCS for non-PIC n64. + + 2003-03-13 Richard Sandiford + + * combine.c (gen_lowpart_for_combine): Treat the lowpart Pmode of + a CONST as identity. Check the return value of gen_lowpart_common. + + 2003-03-13 Richard Sandiford + + * config/mips/mips.c (mips_legitimize_symbol): Handle small data + references for TARGET_EXPLICIT_RELOCS. + (mips_reloc_string): Return "%gp_rel(" for RELOC_GPREL16 if + !TARGET_MIPS16. + + 2003-03-13 Richard Sandiford + + * config/mips/mips.md: Replace 'IQ' mips16 constraints with just 'Q'. + (addsi3): Remove redundant constraints. + (addsi3_internal): Use separate register & constant alternatives. + Use a 'Q' constraint and "addiu" insn for the latter. + (adddi3_internal_3, addsi3_internal_2): Likewise. + + 2003-03-13 Richard Sandiford + + * config/mips/mips-protos.h (mips_expand_unaligned_load): Declare. + (mips_expand_unaligned_store): Declare. + * config/mips/mips.c (mips_get_unaligned_mem): New fn. + (mips_expand_unaligned_load, mips_expand_unaligned_store): New fns. + * config/mips/mips.md (UNSPEC_ULW, UNSPEC_USW): Remove. + (UNSPEC_ULD, UNSPEC_USD): Remove. + (UNSPEC_LWL, UNSPEC_LWR, UNSPEC_SWL, UNSPEC_SWR): New. + (UNSPEC_LDL, UNSPEC_LDR, UNSPEC_SDL, UNSPEC_SDR): New. + (extv, extzv): Use mips_expand_unaligned_load. + (insv): Use mips_expand_unaligned_store. Use a reg_or_0_operand + predicate for operand 3. + (movsi_ulw, movsi_usw): Replace with... + (mov_lwl, mov_lwr, mov_swl, move_swr): ...these new insns. + (movdi_uld, movdi_usd): Likewise replace with... + (mov_ldl, mov_ldr, mov_sdl, move_sdr): ...these insns. + + 2003-02-26 Richard Sandiford + + * config/mips/mips-protos.h (mips_global_pic_constant_p): Declare. + * config/mips/mips.h (LEA_REGS): New register class. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add entries for it. + (GR_REG_CLASS_P): Include LEA_REGS. + (DANGEROUS_FOR_LA25_P): New macro. + (EXTRA_CONSTRAINT): Add !DANGEROUS_FOR_LA25_P to R's condition. + Add a T constraint for the DANGEROUS_FOR_LA25_P case. + * config/mips/mips.c (mips_regno_to_class): Change GR_REGS + entries to LEA_REGS. + (mips_global_pic_constant_p): New function. + (override_options): Add 'e' register constraint. + (mips_secondary_reload_class): Return LEA_REGS when reloading + a dangerous constant into a class containing $25. + * config/mips/mips.md (movdi_internal2): Add an e <- T alternative. + (movsi_internal): Likewise. + + 2003-02-23 Richard Sandiford + + * config/mips/mips.h (TARGET_SPLIT_CALLS): New macro. + * config/mips/mips.md (call_split): New insn. + (call_value_split, call_value_multiple_split): New insns. + (call_internal): Turn into a define_insn_and_split. Split the + instruction into a call and $gp load if TARGET_SPLIT_CALLS. + (call_value_internal, call_value_multiple_internal): Likewise. + + 2003-02-23 Richard Sandiford + + * config/mips/mips.c (mips_reloc_string): Return "%got(" for + RELOC_GOT_PAGE and RELOC_GOT_DISP if !TARGET_NEWABI. + (mips_encode_section_info): Don't take symbol visibility into + account if TARGET_ABICALLS. Add more commentary. + * config/mips/mips.md: Add commentary above reloc constants. + + 2003-02-12 Richard Sandiford + + * config/mips/mips.c (mips_legitimize_const_move): New, extracted + from mips_legitimize_move. Legitimize constant pool references. + (mips_legitimize_move): Call mips_legitimize_const_move. Attach + a REG_EQUAL note to the last instruction. + + 2003-02-11 Richard Sandiford + + * config/mips/mips-protos.h (mips_simplify_dwarf_addr): Declare. + * config/mips/mips.h (TARGET_EXPLICIT_RELOCS, TARGET_NEWABI): New. + (ASM_SIMPLIFY_DWARF_ADDR): Define to mips_simplify_dwarf_addr. + (EXTRA_CONSTRAINT): Allow symbolic call addresses for TARGET_ABICALLS. + * config/mips/mips.md (UNSPEC_HIGH): New constant. + (UNSPEC_RELOC_GPREL16): Rename to... + (RELOC_GPREL16): ...this. + (RELOC_GOT_HI, RELOC_GOT_LO, RELOC_GOT_PAGE, RELOC_GOT_DISP): New. + (RELOC_CALL16, RELOC_CALL_HI, RELOC_CALL_LO): New. + (macro_calls): New attribute. + (length): Use it to set the default length of calls. Don't allow + calls to have delay slots if macro_calls is "yes". + (luisi, luidi): New patterns. + (lowsi, lowdi): Use '%R' to print the relocation. + (lowdi_extend): Remove. + (loadgp): Remove mode from operand 0. Use '%0' instead of '%a0'. + (call_internal): Merge alternatives. Always use "jal". + (call_value_internal, call_value_multiple_internal): Likewise. + (reloc_gprel16): Remove. + * config/mips/mips.c (mips_got_alias_set): New variable. + (mips_classify_constant): Handle the new relocation constants. + (mips_classify_symbol): Reverse the sense of SYMBOL_REF_FLAG for PIC. + (mips_symbolic_address_p): Return false if generating explicit relocs. + Otherwise allow local PIC symbols to have an offset. + (mips_splittable_symbol_p): New function. + (mips_classify_address): Use it to check whether a LO_SUM is valid. + (mips_const_insns): Always accept HIGH. + (call_insn_operand): Don't accept global symbols if using explicit + relocs. + (move_operand): Don't accept HIGH when generating PIC. + (mips_reloc, mips_lui_reloc): New functions. + (mips_force_temporary): Remove MODE argument. Expect VALUE to + be a valid right-hand-side for a SET pattern. + (mips_load_got, mips_load_got16, mips_load_got32): New functions. + (mips_emit_high): New function. + (mips_legitimize_symbol): Use mips_reloc for the mips16 gp-relative + case. Use mips_splittable_symbol_p to check whether a LO_SUM + address should be used. Use mips_emit_high to generate the + high part of such an address. Adjust the global symbol + offset + case to match the change to mips_force_temprorary. + (mips_legitimize_move): Shuffle call to mips_legitimize_symbol. + If generating explicit-reloc PIC, load the address of global + symbols from the GOT. Use mips_emit_high to emit the high part + of an address. + (mips_simplify_dwarf_addr): New function. + (mips_move_1word): Use lwc1 instead of l.s and swc1 instead of s.s. + (mips_move_2words): Likewise ldc1/l.d and sdc1/s.d if TARGET_64BIT. + (mips_expand_call): Load the addresses of global functions using + %call* relocs if generating explicit-reloc PIC. Don't generate + an exception_receiver pattern. + (override_options): Initialize mips_got_alias_set. + (print_relocation): Remove in favor of... + (mips_reloc_string): ...this new function. + (print_operand): Handle '%R'. Use mips_reloc_string. + (print_operand_address): Use print_operand to print the symbolic + part of a LO_SUM address. + (mips_output_function_prologue): Use .cprestore, reverting last patch. + (mips_encode_section_info): Factor out DECL_RTL accesses. Reverse + sense of SYMBOL_REF_FLAG for PIC, using binds_local_p to check + for local symbols. + + 2003-02-02 Eric Christopher + + * config/mips/mips.c (mips_sign_extend): Remove. + * config/mips/mips-protos.h: Ditto. + * config/mips/mips.md (movdi_internal2_extend): Remove. + (extendsidi2): Fix mode of convert_memory_address. + + 2003-01-24 Eric Christopher + + * config/mips/mips.md: Rewrite zero_extend* and extend* + patterns. Use explicit instructions and split after reload + for register extensions. + (ashlsi3_internal1_extend): New combiner pattern for + shift and extend combinations. + * config/mips/mips.h: Change Pmode back to ptr_mode + for performance enhancement. + * combine.c (expand_compound_operation): Make sure + that zero_extend operation is profitable. + + 2003-01-14 Richard Sandiford + + * config/mips/mips.h (TRAMPOLINE_TEMPLATE): Make size of stored + addresses depend on ptr_mode rather than Pmode. + (TRAMPOLINE_SIZE, TRAMPOLINE_ALIGNMENT): Update acoordingly. + (INITIALIZE_TRAMPOLINE): Rework to handle Pmode != ptr_mode. + (CASE_VECTOR_MODE): Use ptr_mode for !TARGET_MIPS16. + (ASM_OUTPUT_ADDR_VEC_ELT): Update accordingly. + * config/mips/mips.md (tablejump): Likewise. Remove Pmode + condition for selecting cpaddsi or cpadddi: use cpadd instead. + (tablejump_internal1): Remove condition. + (tablejump_internal2): Change condition to TARGET_64BIT. + (cpaddsi): Rename to... + (cpadd): ...this. + (cpadddi): Remove. + + 2003-01-09 Richard Sandiford + + * config/mips/mips-protos.h (mips16_constant_after_function_p, + mips_address_cost, mips_check_split, double_memory_operand, + mips16_gp_offset, mips16_gp_offset_p, mips16_constant, + pic_address_needs_scratch, symbolic_operand): Remove declarations. + (mips_legitimate_address_p): Return bool. + (mips_address_insns, mips_fetch_insns, mips_const_insns, + mips_legitimize_address, mips_legitimize_move, + mips_expand_call): Declare. + (mips_return_addr): Move outside #ifdef RTX_CODE. + + * config/mips/mips.h (ABI_HAS_64BIT_SYMBOLS): New macro. + (PIC_FN_ADDR_REG): New reg_class. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Add corresponding entries. + (GR_REG_CLASS_P): True for PIC_FN_ADDR_REG. + (SMALL_OPERAND, SMALL_OPERAND_UNSIGNED, LUI_OPERAND, + CONST_HIGH_PART, CONST_LOW_PART, LUI_INT): New macros. + (SMALL_INT, SMALL_INT_UNSIGNED, CONST_OK_FOR_LETTER_P): Use new macros. + (EXTRA_CONSTRAINTS): Give new meanings to Q, R and S. + (CONSTANT_ADDRESS_P): Use mips_legitimate_address_p. + (LEGITIMATE_PIC_OPERAND): Undefine. + (LEGITIMATE_CONSTANT_P): Use mips_const_insns. + (LEGITIMIZE_ADDRESS): Use mips_legitimize_address. + (CONSTANT_AFTER_FUNCTION_P): Remove definition in #if 0 block. + (FUNCTION_MODE): Change to SImode. + (CONST_COSTS): Use mips_const_insns to calculate the cost of + most constants. Treat const_artih_operands specially if they + occur in a PLUS or MINUS. + (CONSTANT_POOL_COST): New macro. + (RTX_COSTS): Use mips_address_insns for MEMs, with a base cost of 2. + Add LO_SUM handling. + (ADDRESS_COST): Undefine. + (PREDICATE_CODES): Add symbolic_operand and const_arith_operand. + Add CONST to the list of codes for arith_operand. Add LABEL_REF + to call_insn_operand and remove CONST_INT. + + * config/mips/mips.c: Include integrate.h. + (SINGLE_WORD_MODE_P): New macro. + (mips_constant_type, mips_symbol_type, mips_address_type): New enums. + (mips_constant_info, mips_address_info): New structs. + (mips_regno_to_class): Map $25 to PIC_FN_ADDR_REG. + (mips_classify_constant, mips_classify_symbol, + mips_valid_base_register_p, mips_symbolic_address_p, + mips_classify_address, mips_symbol_insns, + mips16_unextended_reference_p, mips_address_insns, mips_const_insns, + mips_fetch_insns, mips_force_temporary, mips_add_offset, + mips_legitimize_symbol, mips_legitimize_address, mips_legitimize_move, + mips_print_relocation): New functions. + (const_arith_operand): New operand predicate. + (arith_operand): Use it. + (mips_const_double_ok, mips16_simple_memory_operand, + simple_memory_operand, double_memory_operand, mips_check_split, + mips_address_cost, pic_address_needs_scratch, mips16_gp_offset, + mips16_gp_offset_p, mips16_output_gp_offset, + mips16_constant_after_function_p, mips16_constant): Remove. + (call_insn_operand): Be more fussy about symbolic constants. + Use register_operand. + (move_operand): Use mips_symbolic_address_p to check symbolic + operands and general_operand to check the rest. + (symbolic_operand): Use mips_classify_constant. + (mips_legitimate_address_p): Use mips_classify_address. + (mips_move_1word): Combine handling of symbolic addresses. + Remove special treatment of gp-relative loads for TARGET_MIPS16. + (move_move_2words): Likewise. Assume addresses are offsettable + if they need to refer to more than one word. Add HIGH handling. + (mips_restore_gp): Use ptr_mode for the GP save slot. + (mips_expand_call): New function, combining the old mips.md + call and call_internal define_expands. If the address isn't + a call_insn_operand, force it into a register. For SVR4 PIC, + emit an exception_receiver instruction after the call. + (override_options): Only override flag_pic for TARGET_ABICALLS + if it is currently zero. Allow mips_split_addresses when + Pmode == DImode too, except when ABI_HAS_64BIT_SYMBOLS. + Add new register class letter, 'c'. + (print_operand): Use mips_classify_constant for constant operands. + (print_operand_address): Use mips_classify_address. + (mips_output_function_prologue): Don't use .cprestore. + (mips_expand_epilogue): For TARGET_MIPS16, only adjust the stack + via the frame pointer if current_function_calls_eh_return. + (mips_encode_section_info): For TARGET_ABICALLS, use SYMBOL_REF_FLAG + to mark whether a symbol is local or global. + (build_mips16_call_stub): Expect the address of the function rather + than a MEM reference to it. Update call generation sequences. + (mips16_optimize_gp): Remove Pmode checks. Temporarily disable + small-data adjustments. + + * config/mips/mips.md: Remove 'R'/'m' memory distinction. Use default + length for loads and stores. + (UNSPEC_CPADD, UNSPEC_RELOC_GPREL16): New constants. + (define_attr type): Add const and prefetch. + (define_attr length): Use mips_const_insns for const instructions. + Use mips_fetch_insns for load and store instructions. + (define_attr single_insn): New. + (define_attr can_delay): Use it. + (define_attr abicalls): Remove. + (define_delay): Use can_delay. Always allow calls to have delay slots. + (addsi3_internal_2): Add 'Q' constraint. + (movsi_ulw, movsi_usw, movdi_uld, movdi_usd): Set length to 8. + (high): Remove. + (lowsi): Renamed from low. + (lowdi): New pattern. + (movdi, movsi): Use mips_legitimize_move. Remove define_split. + (lwxc1, ldxc1, swxc1, sdxc1): Set length to 4. + (loadgp): Change operand 0 to an immediate_operand. + (tablejump): Use the same patterns for SVR4 PIC but emit a cpadd + beforehand. + (cpaddsi, cpadddi): New patterns. + (tablejump_internal3, tablejump_internal4): Remove define_expands + and associated define_splits. + (call, call_value): Use mips_expand_call. + (call_internal): New, replacing all existing call_internal* insns. + (call_value_internal): Likewise call_value_internal*. + (call_value_multiple_internal): Likewise call_value_multiple_internal*. + (untyped_call): Remove if (operands[0]) magic. + (prefetch_si_address, prefetch_si): Change type to "prefetch". + (prefetch_di_address, prefetch_di): Likewise. + (leasi, leadi): Remove. + (reloc_gprel16): New. + + * config/mips/5400.md (ir_vr54_hilo): Include const type. + * config/mips/5500.md (ir_vr55_hilo): Likewise. + * config/mips/sr71k.md (ir_sr70_hilo): Likewise. + + 2003-01-08 Eric Christopher + + * config.gcc (mipsisa32*): Change ABI_MEABI to ABI_EABI. + * config/mips/elf.h (STARTFILE_SPEC): Remove ABI_MEABI references and + configure check for libgloss. + * config/mips/elf64.h: Ditto. + * config/mips/mips.c: Remove ABI_MEABI. + * config/mips/mips.h: Ditto. + + 2002-11-05 Richard Sandiford + + Fix merge fallout. + * config/mips/mips.md (mul_acc_si): Reapply 2002-10-16 change. + (muldi3_internal): Remove outdated comment. + (*muls_di, *umuls_di): Fix comment and 64-bitness. + (*smsac_di, *umsac_di): Likewise. Reformat. + (umulsi3_highpart): Minor formatting tweaks. + (umulsi3_highpart_internal): Use only if !ISA_HAS_MULHI. Remove + redundant scratch operand. Minor formatting tweak. + (umulsi3_highpart_mulhi_internal): Use for !TARGET_64BIT as well. + (umulsi3_highpart_neg_mulhi_internal): Likewise. Fix asm template. + (smulsi3_highpart): As for the unsigned version. + (smulsi3_highpart_internal): Likewise. + (smulsi3_highpart_mulhi_internal): Likewise. + (smulsi3_highpart_neg_mulhi_internal): Likewise. + (smuldi3_highpart, umuldi3_highpart): Minor formatting tweaks. + (*smul_acc_di): Remove duplicated pattern. + (*umul_acc_di, *smul_acc_di): Reapply 2002-10-16 change. + (anddi3) [unnamed mips16 pattern]: Remove reintroduced length. + (zero_extendsidi2_internal2): Remove new, but commented-out pattern. + + 2002-10-22 Eric Christopher + + * config/mips/mips-protos.h (mips_return_addr): New. + * config/mips/mips.c (mips_return_addr): New. + (movdi_operand): Remove. + (se_register_operand): Ditto. + (se_reg_or_0_operand): Ditto. + (se_uns_arith_operand): Ditto. + (se_arith_operand): Ditto. + (se_nonmemory_operand): Ditto. + (extend_operator): Ditto. + (highpart_shift_operator): Ditto. + (mips_initial_elimination_offset): Remove return address pointer + elimination. + (mips_reg_names): Remove $ra. + (mips_regno_to_class): Ditto. + * config/mips/mips.h (POINTER_SIZE): Define based on TARGET_LONG64 + and TARGET_64BIT. + (POINTER_BOUNDARY): Remove. + (POINTERS_EXTEND_UNSIGNED): Define to 0. + (PROMOTE_MODE): Promote to Pmode. + (SHORT_IMMEDIATES_SIGN_EXTEND): Define. + (Pmode): Define to TARGET_64BIT. + (FUNCTION_MODE): Define as Pmode. + (mips_args): Remove deleted functions. + (SIZE_TYPE): Depend on POINTER_SIZE. + (PTRDIFF_TYPE): Ditto. + (FIXED_REGISTERS): Fix extra registers. + (CALL_USED_REGISTERS): Ditto. + (CALL_REALLY_USED_REGISTERS): Ditto. + (RAP_REG_NUM): Remove. + (RETURN_ADDRESS_POINTER_REGNUM): Ditto. + (RETURN_ADDR_RTX): Define to mips_return_addr. + (ELIMINABLE_REGS): Remove RETURN_ADDRESS_POINTER_REGNUM. + (CAN_ELIMINATE): Ditto. + * config/mips/mips.md: For DImode patterns, take into account + deletions above. Split mulsidi patterns into sign_extend and + zero_extend. + + 2002-10-16 Richard Sandiford + Michael Meissner + + * config/mips/mips.h (ISA_HAS_MACC): True for normal-mode vr4120 code. + * config/mips/mips.md (mulsi3_mult3): Add a define_peephole2 to + mop up unnecessarly moves through LO. + (*mul_acc_si): Remove vr5400 and vr5500 handling from here. + (*macc): New pattern for ISA_HAS_MACC. Add define_peephole2s to + change mtlo/macc sequences into mul/add sequences when a three- + address mul is available. + (*macc2): New pattern. Add a define_peephole2 to generate it. + (*mul_sub_si): Fix contraint for operand 5. + (*muls): Use in 32-bit code as well. + (*msac): Likewise. Use msub instead of msac in vr5500 code + if the destination is LO. Remove duplicate define_split. + (*muls_di): Use only in 32-bit code. Adjust rtl accordingly. + (*msac_di): Likewise. Fix formatting. + (smulsi3_highpart, umulsi3_highpart): Use mulhi in 32-bit code too. + (*xmulsi3_highpart_internal): Use only if !ISA_HAS_MULHI. + (*xmulsi3_highpart_mulhi): Use even if !TARGET_64BIT. + (*xmulsi3_neg_highpart_mulhi): Likewise. + (*mul_acc_64bit_di): Remove. + (*mul_acc_di): Use only in 32-bit code. Handle ISA_HAS_MACC as well. + + 2002-10-14 Richard Sandiford + + * config/mips/vr.h (DRIVER_SELF_SPECS): Define. + * config/mips/t-vr (MULTILIB_OPTIONS): Remove mlong32. + (MULTILIB_DIRNAMES): Remove long32. + (MULTILIB_EXCEPTIONS): Don't build -mabi=32 -mgp32 multilibs. + (MULTILIB_REDUNDANT_DIRS): Remove. + + 2002-10-14 Richard Sandiford + + * doc/tm.texi (DRIVER_SELF_SPECS): Document. + * gcc.c (driver_self_specs): New variable. + (do_self_spec): New function. + (main): Use it to process driver_self_specs. + + 2002-10-09 Richard Sandiford + + * config/mips/mips.md (one_cmpldi2): Use only if TARGET_64BIT. + Remove DImode define_split for !TARGET_64BIT. + (anddi3): Remove !TARGET_64BIT support from here as well. + Change operand 2's predicate to se_uns_arith_operand. + Add constant alternatives to define_insn. + (iordi3, xordi3, *nordi3): Likewise. + (anddi3_internal1, xordi3_immed): Remove. + + 2002-10-01 Richard Sandiford + + * config/mips/mips.h (PROCESSOR_R4121): Rename to PROCESSOR_R4120. + (TARGET_MIPS4121): Rename to TARGET_MIPS4120. + * config/mips/mips.c (mips_cpu_info): Rename vr4121 to vr4120. + * config/mips/mips.md: Apply same renaming here. + + 2002-10-01 Richard Sandiford + + * config/mips/mips.c (PROCESSOR_R4320, TARGET_MIPS4320): Remove. + (GENERATE_MULT3_SI): Remove use of TARGET_MIPS4320. + * config/mips/mips.c (mips_cpu_info): Remove vr4320 entry. + * config/mips/mips.md (define_attr cpu): Remove r4320. + Remove vr4320 scheduler and uses of TARGET_MIPS4320. + + 2002-10-01 Richard Sandiford + + * config/mips/mips.c (mips16_strings): New variable. + (mips_output_function_epilogue): Clear the SYMBOL_REF_FLAG of every + symbol in mips16_strings. Free the list. + (mips_encode_section_info): Keep track of local strings. + + 2002-10-01 Richard Sandiford + + * config/mips/mips.md (bunge, bltgt, bungt): New define_expands. + (sordered_df, sordered_sf): Remove. + * config/mips/mips.c (get_float_compare_codes): New fn. + (gen_int_relational, gen_conditional_move): Use it. + + 2002-10-01 Richard Sandiford + + * config/mips/mips-protos.h (mips_emit_fcc_reload): Declare. + * config/mips/mips.h (PREDICATE_CODES): Add fcc_register_operand. + * config/mips/mips.c (fcc_register_operand): New function. + (mips_emit_fcc_reload): New function, extracted from reload_incc. + (override_options): Allow TFmode values in float registers + if ISA_HAS_8CC. + * cnfig/mips/mips.md (reload_incc): Change destination prediate + to fcc_register_operand. Remove misleading source constraint. + Use mips_emit_fcc_reload. + (reload_outcc): Duplicate reload_incc. + + +2003-04-30 Diego Novillo + + * builtins.def (BUILTIN_CONSTANT_P): Mark as constant. + +2003-04-30 Geoffrey Keating + + * tree-inline.c (inlinable_function_p): Back out last change, it's + unnecessary. + +2003-04-30 Steven Bosscher + + * ggc-page.c (TREE_EXP_SIZE): Define. + (extra_order_size_table): New entry for expr trees with + two operands. + +2003-04-30 Gabriel Dos Reis + + * c-common.c (if_elt): Use location_t in lieu of "file, line" pair. + (c_expand_start_cond): Adjust. + (c_expand_end_cond): Don't use warning_with_file_and_file. + (shadow_warning): Likewise. + +2003-04-30 Nathan Sidwell + + * tree.h (DECL_POINTER_DEPTH): Remove. + (struct tree_decl): Remove pointer_depth. + +2003-04-30 Janis Johnson + + * config/rs6000/linux64.h (ASM_OUTPUT_LABELREF): Remove. + * config/rs6000/rs6000.c (rs6000_elf_strip_name_encoding): Remove. + (rs6000_xcoff_encode_section_info): Remove. + (current_file_function_operand): Use SYMBOL_REF_FLAGS; fix latent bug. + (rs6000_output_mi_thunk): Remove dead code; use SYMBOL_REF_FLAGS. + (small_data_operand, rs6000_emit_move, rs6000_elf_in_small_data_p,): + Use SYMBOL_REF_FLAGS. + (rs6000_elf_encode_section_info): Call default_encode_section_info for + generic flags, use SYMBOL_REF_FLAGS; code cleanups. + * sysv4.h (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove. + (SYMBOL_FLAG_SMALL_V4, SYMBOL_REF_SMALL_V4_P): New. + * xcoff.h (TARGET_ENCODE_SECTION_INFO): Remove. + (ASM_DECLARE_FUNCTION_NAME): Remove setting of SYMBOL_REF_FLAG. + +2003-04-30 Gabriel Dos Reis + + * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF. + +2003-04-30 Andreas Schwab + + * doc/extend.texi (Other Builtins): Enclose multiple word data + type in braces for @deftypefn. + +2003-04-30 Richard Kenner + + * stor-layout.c (mode_for_size_tree): Use BLKmode if SIZE overflows. + + * doc/install.texi (--enable-threads): Document "gnat" option. + +2003-04-30 Gabriel Dos Reis + + * diagnostic.h (output_formatted_scalar): Tweak. + * diagnostic.c (output_long_decimal): Likewise. + (output_unsigned_decimal): Likewise. + (output_long_unsigned_decimal): Likewise. + (output_octal): Likewise. + (output_long_octal): Likewise. + (output_hexadecimal): Likewise. + (output_long_hexadecimal): Likewise. + (output_pointer): New function. + (output_format): Use it. Recognize "%p" format specifier. + +2003-04-30 Zdenek Dvorak + + * function.c (purge_addressof_1): Postpone insn in fewer cases. + +2003-04-29 Geoffrey Keating + + * config/rs6000/host-darwin.c (segv_handler): When -dH is used, + call abort() after running out of stack space. + + * c-typeck.c (function_types_compatible_p): Ignore incompatible + 'volatile' qualifiers on a function's return type in GNU mode. + +2003-04-29 Aldy Hernandez + + * expr.c (emit_group_load): Dump parallels of simd types to + memory. + +2003-04-29 Vladimir Makarov + + * genautomata.c (add_vect): Check undefined value for range type + too. + +2003-04-29 Phil Edwards + + * configure.in: More general test for cmp --ignore-initial. + * configure: Regenerate. + +2003-04-29 Richard Kenner + + * stor-layout.c (mode_for_size_tree): Use tree_low_cst. + (layout_decl, place_field): Likewise. + Also make minor type and whitespace changes. + + * tree.c (save_expr): Don't fold a COMPONENT_REF. + +2003-04-29 Olivier Hainque + + * calls.c (expand_call): When modes of target and valreg match, force + sibcall failure when target is a MEM. + +2003-04-29 Geoffrey Keating + + * tree-inline.c (inlinable_function_p): Don't support inlining + functions using varargs. + + * doc/invoke.texi (Overall Options): Mention -x objective-c-header. + + * dwarf2out.c (output_call_frame_info): No need to output EH + unwind information if all_throwers_are_sibcalls. + + * c-semantics.c (expand_unreachable_stmt): Return a tree. + (expand_stmt): Update for change to expand_unreachable_stmt. + (expand_unreachable_if_stmt): Likewise. + + * Makefile.in (quickstrap): Pass BOOT_CFLAGS to submake. + +2003-04-29 Jason Merrill + + PR middle-end/10336 + * jump.c (never_reached_warning): Really stop looking if we reach + the beginning of the function. + +2003-04-29 Bob Wilson + + * config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE, USER_LABEL_PREFIX): + Remove redundant macros. + (WCHAR_TYPE, WCHAR_TYPE_SIZE): Change to "short unsigned int". + (LOCAL_LABEL_PREFIX): Define unconditionally. + (NO_DOT_IN_LABEL): Clarify comment. + * config/xtensa/linux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Add explicit + definition to "long int". + +2003-04-29 Alexander Kabaev + + bootstrap/10452 + * gengtype-yacc.y: Improve portability. + +2003-04-29 Zack Weinberg + + * config.gcc: Install obsolete target list for GCC 3.3. + * doc/install.texi: Mention in specific-target instructions + that certain configurations are deprecated. + +2003-04-29 Zack Weinberg + + * tree.h: Delete no-checking definition of CST_OR_CONSTRUCTOR_CHECK. + +2003-04-29 Kriang Lerdsuwanakij + + * c-pragma.c (maybe_apply_renaming_pragma): Fix typo. + * gcc.c (display_help): Likewise. + * toplev.c (f_options): Likewise. + * params.def (PARAM_MAX_INLINE_SCOPE): Likewise. + * config/c4x/c4x.h (TARGET_SWITCHES): Likewise. + * config/mcore/mcore.h (TARGET_SWITCHES): Likewise. + * config/s390/s390.h (TARGET_SWITCHES): Likewise. + * config/v850/v850.h (TARGET_SWITCHES): Likewise. + +2003-04-29 J"orn Rennecke + + * varasm.c (default_assemble_visibility): Use assemble_name. + +2003-04-29 David O'Brien + + * config/i386/freebsd64.h (LINK_SPEC): Mirror FreeBSD linker. + * config/rs6000/freebsd.h (LINK_SHLIB_SPEC): New macro. + (SIZE_TYPE): New macro. + * config/i386/freebsd-aout.h (NO_PROFILE_COUNTERS): New macro. + (SET_ASM_OP): New macro. + (HANDLE_SYSV_PRAGMA): New macro. + (ASM_WEAKEN_LABEL): New macro. + +2003-04-28 Mark Mitchell + + PR c++/10180 + * tree-inline.c (expand_call_inline): Call push_srcloc when + encountering EXPR_WITH_FILE_LOCATION. Honor warn_inline. + +2003-04-28 Mike Stump + + * gdbinit.in: Update to reflect new identifier structure. + +2003-04-28 Zack Weinberg + + * tree.h (TREE_CST_RTL, CST_OR_CONSTRUCTOR_CHECK): Delete. + (struct tree_int_cst, struct tree_real_cst, struct tree_string, + struct tree_complex, struct tree_vector): Remove RTL field. + (CONSTRUCTOR_ELTS): Use elt 0. + * tree.def (CONSTRUCTOR): Delete first of its two operands. + * varasm.c (output_constant_def): Remove early exit if + TREE_CST_RTL is set. Don't set TREE_CST_RTL. + (decode_addr_const): Don't mention TREE_CST_RTL in comment. + * target.h (select_section): Don't mention TREE_CST_RTL in comment. + * doc/tm.texi (encode_section_info): Don't talk about TREE_CST_RTL. + +2003-04-28 Jakub Jelinek + + * c-decl.c (finish_decl): When prototype with asmspec is found + for built-in, adjust built_in_decls as well as expr.c decls. + * expr.c (init_block_move_fn, init_block_clear_fn): New functions. + (emit_block_move_libcall_fn, clear_storage_libcall_fn): Use it. + * expr.c (init_block_move_fn, init_block_clear_fn): New prototypes. + +2003-04-28 Richard Henderson + + * config/sparc/sparc.c (print_operand): Add 's' to sign-extend. + * config/sparc/sparc.md (const_mulsidi3_v8plus): Fix mode of + integral constant mult operand. + (const_mulsidi3_sp32, const_mulsidi3_sp64): Likewise. + (const_smulsi3_highpart_v8plus): Likewise. + (const_smulsi3_highpart): Likewise. + (const_umulsidi3_sp32): Likewise; sign-extend it in the output. + (const_umulsidi3_sp64, const_umulsidi3_v8plus): Likewise. + (const_umulsi3_highpart_v8plus): Likewise. + (const_umulsi3_highpart): Likewise. + +2003-04-28 David O'Brien + + * config/i386/x86-64.h (NO_PROFILE_COUNTERS, HAVE_AS_DWARF2_DEBUG_LINE): + Define as 1. + +2003-04-28 David O'Brien + + * config/i386/i386.h (builtin_define): Add __amd64 and __amd64__. + +2003-04-28 Jakub Jelinek + + * builtins.def (BUILT_IN_BCOPY, BUILT_IN_MEMMOVE): New. + * builtin-types.def (BT_FN_VOID_CONST_PTR_PTR_SIZE): New. + * builtins.c (expand_builtin_memmove, expand_builtin_bcopy): New + functions. + (expand_builtin): Handle BUILT_IN_BCOPY and BUILT_IN_MEMMOVE. + +2003-04-28 Nick Clifton + + * config/arm/elf.h (ASM_OUTPUT_ALIGNED_COMMON): Remove definition. + +2003-04-27 Zack Weinberg + + * expr.c (expand_expr ): Always call + output_constant_def, use its result instead of TREE_CST_RTL (exp). + Can assume it has the form (mem (symbol_ref ".LCxxx")). + (expand_expr ): Can always just extract the + relevant field of a CONSTRUCTOR. + (expand_expr ): Make control flow explicit. + * varasm.c (output_constant_def): Can look at TREE_CST_RTL of + an INTEGER_CST. + +2003-04-27 Kazu Hirata + + * reload1.c (reg_set_luid): Fix a comment typo. + +2003-04-27 Zack Weinberg + + * varasm.c (const_str_htab_hash, const_str_htab_eq, STRHASH, + struct deferred_string, const_str_htab): Kill. + (n_deferred_strings): New static variable. + (build_constant_desc): Set SYMBOL_REF_DECL of the new + symbol_ref to point to the constant. + (output_constant_def): When a deferred string is forced out, + just clear STRING_POOL_ADDRESS_P and decrement n_deferred_strings. + (mark_constant): Likewise. + (maybe_output_constant_def_contents): When deferring a string + constant, just set STRING_POOL_ADDRESS_P and increment + n_deferred_strings. + (mark_constant_pool): Check n_deferred_strings, not the size + of const_str_htab. + (init_varasm_once): No need to create const_str_htab. + + * rtl.def, rtl.h, doc/rtl.texi: Document possibility that + SYMBOL_REF_DECL points to a constant. + +2003-04-26 Zack Weinberg + + * varasm.c (output_constant_def): Split out two new static + functions, build_constant_desc and maybe_output_constant_def_contents. + Restructure for comprehensibility. Don't call + output_addressed_constants. Treat defstr being non-NULL for + STRING_POOL_ADDRESS_P constants as an invariant. + (struct deferred_string): Remove labelno field. + (output_constant_def_contents): Kill labelno argument. Call + output_addressed_constants here. Use ASM_OUTPUT_LABEL, not + asm_out.internal_label. + (mark_constant): Update call to output_constant_def_contents. + Treat defstr being non-NULL for STRING_POOL_ADDRESS_P + constants as an invariant. + +2003-04-26 Richard Henderson + + * config/i386/i386.c (output_pic_addr_const): Use SYMBOL_REF_LOCAL_P. + (ix86_expand_call, ix86_rtx_consts): Likewise. + +2003-04-26 Kaveh R. Ghazi + + * doc/md.texi (cmpstr): Document additional restrictions. + +2003-04-26 Neil Booth + + * flags.h (time_report): Remove. + * timevar.c (timevar_enable): New. + (TIMEVAR_ENABLE): Remove, use timevar_enable. + (timevar_init): Rename from init_timevar. + * timevar.h (timevar_init): Rename from init_timevar. + * toplev.c (time_report): Make static. + (do_compile): Conditionally call init_timevar first. + (preprocess_options): Move some code to do_compile. + +2003-04-26 Stephane Carrez + + * doc/install.texi (Binaries): Mention binaries for HC11/HC12. + +2003-04-26 Neil Booth + + * _cpp_lex_direct: Remove pointless code. + +2003-04-26 Stephane Carrez + + * doc/extend.texi (Function Attributes): Document "near" and "far" + for 68HC11 and 68HC12. + +2003-04-25 Richard Kenner + + * expr.c (store_field): When making temporary for store, don't + make it TYPE_QUAL_CONST. + +2003-04-25 Phil Edwards + + * toplev.c (read_integral_parameter): Use "argument" in error + message to distinguish it from actual invalid options. + +2003-04-25 Bob Wilson + + * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Back out previous + addition of __PIC__ and __pic__ macros. + * config/xtensa/xtensa.h: Clean up indentation. + +2003-04-25 Bob Wilson + + * config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Remove definition of + _GNU_SOURCE. Add definitions of __PIC__ and __pic__. + (SUBTARGET_CPP_SPEC): Define. + (LIB_SPEC): Delete. + * config/xtensa/xtensa-protos.h (xtensa_declare_object): Delete. + * config/xtensa/xtensa.c (xtensa_declare_object): Delete. + * config/xtensa/xtensa.h (CPP_SPEC, SUBTARGET_CPP_SPEC, EXTRA_SPECS): + Define. + (ASM_OUTPUT_COMMON, ASM_OUTPUT_LOCAL): Delete. + (ASM_OUTPUT_ALIGNED_BSS, BSS_SECTION_ASM_OP): Define. + +2003-04-25 H.J. Lu + + * config/ia64/ia64.c (ia64_expand_compare_and_swap): Add rmode + for return mode. + (ia64_expand_builtin): Set rmode to SImode for + IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI, + IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI and + IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI. Set remode to DImode + for IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI. + +2003-04-25 Phil Edwards + + * configure.in (make_compare_target): Test for GNU cmp and set this + variable appropriately. + * Makefile.in (compare, compare3, compare4, compare-lean, compare3-lean, + compare4-lean): Rename actual targets to slowcompare*. New compare* + targets depend on names based on make_compare_target. + * configure: Regenerated. + +2003-04-25 Richard Henderson + + * config/ia64/ia64.c (ia64_compute_frame_size): Allow inline asm + to clobber ar.pfs and ar.unat. + (ia64_expand_prologue): Force alloc instruction if ar.pfs saved; + fix test for spilling ar.pfs to the stack. + +2003-04-25 Richard Henderson + + PR opt/10315 + * config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper + checks during reload; use validize_mem instead of adjust_address. + +2003-04-26 Ben Elliston + + * config/arm/arm.c (arm_adjust_cost): Correct logic that tests the + return values from recog_memoized(). + +2003-04-24 John David Anglin + + PR opt/8705 + * gcse.c (try_replace_reg): On a successful substitution of a constant + into a single set, try to simplify the source of the set. + * loop.c (scan_loop): Don't try to optimize a MODE_CC set with a + constant source. + +2003-04-24 Neil Booth + + * cpplex.c (cpp_token_len): Tighten up. + (cpp_token_as_text): Need extra byte now. + * cpplib.c (glue_header_name): Need extra 2 bytes. + * cppmacro.c (cpp_macro_definition): Need extra byte. + +2003-04-24 Alexander Kabaev + + * config/sparc/sparc.md (umulsidi3, mulsidi3): Avoid using + const_umulsidi3_sp32 and const_mulsidi3_sp32 on 64bit targets + where they might be not present. Use their _sp64 equivalent + instead. + +Thu Apr 24 20:42:12 CEST 2003 Jan Hubicka + + * i386.md (cvtsi2sdq): Fix typo in previous patch. + +2003-04-24 Krister Walfridsson + + * configure.in: Check whether mbstowcs works. + * configure, config.in: Regenerate. + * intl.c: Use HAVE_WORKING_MBSTOWCS. + +2003-04-24 H.J. Lu + + * config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di + for __sync_bool_compare_and_swap_di for int return type. + + * config/ia64/ia64intrin.h (__sync_bool_compare_and_swap_di): + Change return type to int. + (__sync_bool_compare_and_swap): Likewise. + +Thu Apr 24 16:55:26 CEST 2003 Jan Hubicka + + * cfgbuild.c (make_edges): Do not use next_nonnote_insn when + looking for fallthru edge. + + * athlon.md (athlon-agu, athlon-store, athlon-fany, athlon-faddmul): + Fix. + (athlon-load2, athlon-store2, athlon-fpsched, athlon-fpload, + athlon-fvector): New. + (athlon_*): Revisit to match new optimization guide. + * i386.c (ix86_adjust_cost): Fix memory operand costs on Athlon/k8 + * i386.md (cvt??2?? patterns): Fix modes. + (fistp patterns): Set modes. + + Accidentaly commited with my earlier reload patch: + PR c/10308 + * reload.c (find_reloads_address_1): Reload plus at the place of + index register. + +2003-04-24 Nathan Sidwell + + New GCOV_TAG_FUNCTION layout + * coverage.c (struct function_list): Replace name with ident. + (struct counts_entry): Likewise. + (fn_ident): New. + (htab_counts_entry_hash, htab_counts_entry_eq, + htab_counts_entry_del): Adjust. + (reads_count_file, get_coverage_counts, + coverage_begin_output, coverage_end_function): Adjust. + (build_fn_info_type, build_fn_info_value): Likewise. + * gcov-dump.c (tag_function): Adjust. + * gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV. + * gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV. + * gcov.c (struct function_info): Add ident. + (read_graph_file, read_count_file): Adjust. + * libgcov.c (gcov_exit): Adjust. + +2003-04-23 Richard Henderson + + PR opt/8300 + * toplev.c (rest_of_compilation): Delay no_new_pseudos until + after initialize_uninitialized_subregs; update reg info assuming + new pseudos were created. + +2003-04-23 Neil Booth + + * Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update. + * c-lex.c (MULTIBYTE_CHARS): Remove conditionals. + (lex_string): Take cpp_string with full spelling. + (cb_ident): Update. + (c_lex): Update diagnostics. + * cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL. + (create_literal): New. + (lex_string): Unterminated literals have type CPP_OTHER. + (_cpp_lex_direct): Update calls to lex_string. Use create_literal + for CPP_OTHER. + (cpp_token_len, cpp_spell_token, cpp_output_token): Simplify. + (_cpp_equiv_tokens, cpp_interpret_charconst): Update. + * cpplib.c (parse_include, do_line, do_linemarker, + destringize_and_run): Update for token storing full spelling. + * cpplib.h: Update token spelling types. + * cppmacro.c (stringify_arg, check_trad_stringification): + Update for token storing full spelling. + +2003-04-23 Ulrich Weigand + + * config/s390/s390.c (s390_expand_cmpstr): Disable CLC loop. + +2003-04-23 Richard Earnshaw + + * arm.h (TARGET_OPTIONS): Add value field. + +2003-04-23 Mark Mitchell + + * doc/extend.texi: Remove duplicate 2003 copyright date. + +2003-04-23 Nathan Sidwell + + * Makefile.in (LIBGCC_DEPS): Add gcov headers. + (libgcov.a): Depends on LIBGCC_DEPS. + * basic-block.h (profile_info): Moved here from coverage.h. Made + a pointer. + * coverage.c (struct function_list): Fixed array of counter types. + (struct counts_entry): Keyed by counter type, contains summary. + (profile_info): Moved to profile.c. + (prg_ctr_mask, prg_n_ctrs, fn_ctr_mask, fn_n_ctrs): New global + vars. + (profiler_label): Remove. + (ctr_labels): New. + (set_purpose, label_for_tag, build_counter_section_fields, + build_counter_section_value, build_counter_section_data_fields, + build_counter_section_data_values, build_function_info_fields, + build_function_info_value, gcov_info_fields, gcov_info_value): Remove. + (build_fn_info_type, build_fn_info_value, build_ctr_info_type, + build_ctr_info_value, build_gcov_info): New. + (htab_counts_entry_hash, htab_counts_entry_eq): Adjust. + (reads_counts_file): Adjust. + (get_coverage_counts): Takes counter number. Add summary + parameter. Adjust. + (coverage_counter_ref): Tkaes counter number. Adjust. Lazily + create counter array labels. + (coverage_end_function): Adjust. + (create_coverage): Adjust. + (find_counters_section): Remove. + * coverage.h (MAX_COUNTER_SECTIONS): Remove. + (struct section_info, struct profile_info): Remove. + (profile_info): Moved to basic-block.h. + (coverage_counter_ref): Takes a counter number. + (get_coverage_counts): Takes a counter number. Added summary + parameter. + (find_counters_section): Remove. + * gcov-dump.c (tag_arc_counts): Rename to ... + (tag_counters): ... here. Adjust. + (tag_table): Move tag_counters to 3rd entry. Remove + PROGRAM_PLACEHOLDER and PROGRAM_INCORRECT entries. + (dump_file): Check for counter tag values here. + (tag_summary): Adjust. + * gcov-io.c (gcov_write_summary, gcov_read_summary): Adjust. + * gcov-io.h (GCOV_LOCKED): New. + (GCOV_TAG_ARC_COUNTS): Rename to ... + (GCOV_TAG_COUNTS_BASE): ... here. + (GCOV_TAG_PLACEHOLDER_SUMMARY, GCOV_TAG_INCORRECT_SUMMARY): + Remove. + (GCOV_COUNTER_ARCS, GCOV_COUNTERS, GCOV_NAMES): New. + (GCOV_TAG_FOR_COUNTER, GCOV_COUNTER_FOR_TAG, + GCOV_TAG_IS_COUNTER): New. + (struct gcov_ctr_summary): New. + (struct gcov_summary): Adjust. + (struct gcov_counter_section): Remove. + struct gcov_counter_section_data): Remove. + (struct gcov_function_info): Rename to ... + (struct gcov_fn_info): ... here. Adjust. + (struct gcov_ctr_info): New. + (struct gcov_info): Adjust. + * gcov.c (read_count_file): Adjust. + (output_lines): Adjust. + * libgcov.c (gcov_exit): Adjust. + (__gcov_flush): Adjust. + * mklibgcc.in (libgcc2_c_dep): Add gcov headers. + * predict.c (maybe_hot_bb_p, probably_cold_bb_p, + probably_never_executed_bb_p, compute_frequency_function): Adjust + profile_info use. + * profile.c (struct counts_entry): Remove. + (profile_info): Define here. + (get_exec_counts): Adjust get_coverage_counts call. + (compute_branch_probablilities): Remove find_counters_section + call. + (gen_edge_profiler): Adjust coverage_counter_ref call. + * tracer.c (tail_duplicate): Adjust profile_info use. + +2003-04-23 Roger Sayle + + PR optimization/10339 + * builtins.c (expand_builtin_strcmp): Try to emit cmpstrsi insn + directly instead of unsafely transforming call into a memcmp. + (expand_builtin_strncmp): Likewise. + +2003-04-22 Roger Sayle + + * alias.c (mark_constant_function): Check for constancy and + purity even of void functions. Update both the function decl + and the cgraph RTL info with the results. + +2003-04-22 Roger Sayle + + * real.c (do_add): Change to return a bool indicating that the + result of the operation may be inexact due to loss of precision. + (do_multiply): Likewise. + (do_divide): Likewise. + +2003-04-22 Geoffrey Keating + Loren James Rittle + + * dwarf2out.c (fde_table_allocated): Mark with GTY. + (decl_die_table_allocated): Likewise. + (abbrev_die_table_allocated): Likewise. + (line_info_table_allocated): Likewise. + (separate_line_info_table_allocated): Likewise. + (pubname_table_allocated): Likewise. + (arange_table_allocated): Likewise. + (ranges_table_allocated): Likewise. + (decl_die_table_in_use): Unconditionalize; mark with GTY. + (abbrev_die_table_in_use): Likewise. + (line_info_table_in_use): Likewise. + (separate_line_info_table_in_use): Likewise. + (pubname_table_in_use): Likewise. + (arange_table_in_use): Likewise. + (ranges_table_in_use): Likewise. + (have_location_lists): Likewise. + (emitcount): New GTY-marked static, moved... + (maybe_emit_file): ...from here. + (label_num): New GTY-marked static, moved... + (gen_internal_sym): ...from here. + +2003-04-22 Richard Henderson + + PR 8866 + * rtl.h (MEM_NOTRAP_P): New. + (MEM_COPY_ATTRIBUTES): Copy it. + * rtlanal.c (may_trap_p): Check it. + * expr.c (do_tablejump): Set it. + * doc/rtl.texi (Flags): Document it. + + * cfgrtl.c (try_redirect_by_replacing_jump): Revert last three changes. + +2003-04-22 Olivier Hainque + + * config/alpha/alpha.c (alpha_expand_prologue [OPEN_VMS_ABI]): Don't + set FRP on stack adjustment for outgoing args if frame_pointer_needed. + +2003-04-22 Vincent Celier + + * gthr-gnat.h, gthr-gnat.c: new sources for implementation of + --enable-threads=gnat. + * Makefile.in: Add gthr-gnat.c to LIB2ADDEH. + * configure.in: Add gnat to the list of thread packages + * configure: Rebuild. + * config/t-linux: Add gthr-gnat.c to LIB2ADDEH and LIB2ADDEHDEP + +2003-04-22 Neil Booth + + * cpplex.c (_cpp_get_fresh_line): Pop the buffer if return_at_eof. + +2003-04-22 Devang Patel + + * cpptrad.c (_cpp_replacement_text_len): Add check for macro + parameter count. + (_cpp_copy_replacement_text): Same. + +2003-04-22 Neil Booth + + * c-lex.c (c_lex): Handle CPP_OTHER differently. + * cppexp.c (_cpp_parse_expr): Similarly. + * cpplex.c (SPELL_CHAR): Remove. + (_cpp_lex_direct): Stray chars are saved as byte strings. + (cpp_spell_token, cpp_output_token, _cpp_equiv_token): Don't + handle SPELL_CHAR. + (cpp_avoid_paste): Update handling of CPP_OTHER. + * cpplib.h: Spell CPP_OTHER like a number. + (struct cpp_token): Remove member c. + * cppmacro.c (stringify_arg): Update handling of CPP_OTHER. + +2003-04-22 David Turner + + * gbl-ctors.h: Add special license exception. + * libgcc2.h: Likewise. + * tsystem.h: Likewise. + * gcov-io.h: Likewise. + +2003-04-22 David Edelsohn + + * fold-const.c (fold_range_test): Use RANGE_TEST_NON_SHORT_CIRCUIT + macro defaulting to original BRANCH_COST heuristic. + * doc/tm.texi (RANGE_TEST_NON_SHORT_CIRCUIT): Document. + + * config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Define. + +2003-04-22 Aldy Hernandez + + * config/rs6000/t-spe: Merge in t-fprules into file. + + * config.gcc: Add t-spe to powerpc-eabispe. + +2003-04-22 Kean Johnston + + * tlink.c (recompile_files): Add missing '=' to putenv calls + +2003-04-22 Nathan Sidwell + + * ginclude/stddef.h: Provide C++ safe offsetof. + +2003-04-22 J"orn Rennecke + + * function.c (purge_addressof_1): In (mem (addressof (reg))) case + for reg notes, if there are no substitutions, just use a SUBREG. + +2003-04-21 Mark Mitchell + + * Makefile.in (calls.o): Depend on except.h. + * calls.c: Include except.h. + (emit_call_1): Call note_eh_region_may_contain_throw if + appropriate. + * except.c (eh_region): Add may_contain_throw. + (expand_eh_region_end_cleanup): Do not include handler code when + it cannot be reached. + (note_eh_region_may_contain_throw): New function. + * except.h (note_eh_region_may_contain_throw): New function. + +2003-04-21 Mark Mitchell + + * config/i386/winnt.c (i386_pe_mark_dllimport): Revert previous + changes. + +2003-04-21 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): No SPE means + 64-bit long doubles. + +2003-04-21 Olivier Hainque + + * fold-const.c (fold, case PLUS_EXPR and case MULT_EXPR): Restore + a number of conversions required for type consistency and previously + stripped off by STRIP_NOPS. + + * calls.c (expand_call): Prevent sibcall optimization for calls to + nested subprograms. + + * expmed.c (extract_bit_field): Reverse operands of && condition to + prevent a potential division by zero in the previously first branch. + * config/pa/pa.md (extv, extzv): FAIL if the bitfield length is zero. + +2003-04-21 Joel Brobecker + + * dwarf2out.c (is_ada, is_ada_subrange_type): New functions. + (subrange_type_die): Likewise. + (modified_type_die): Emit a subrange_type DIE for Ada subrange types. + (is_c_family, is_cxx, is_java, is_fortran): Return bool and clean up. + +2003-04-21 Nathan Sidwell + + Break out coverage routines to new file. + * Makefile.in (COVERAGE_H): New variable + (C_OBJS): Add coverage.o + (coverage.o): New target. + (profile.o, loop-init.o, sched-ebb.o, predict.o, tracer.o): Adjust + dependencies. + (GTFILES): Adjust. + (gt-coverage.h): New target. + (gt-profile.h): Remove. + * profile.h: Remove. Move to ... + * coverage.h: ... here. New. #include gcov-io.h. + * gcov-io.h: Move function definitions to ... + * gcov-io.c: ... here. New. + * profile.c: Move coverage routines to coverage.c. + (instrument_edges, get_exec_counts, branch_prob, init_branch_prob, + end_branch_prob): Adjust. + * coverage.c: New. Coverage routines from profile.c + (coverage_counter_ref, coverage_init, coverage_finish, + coverage_end_function, coverage_begin_output, + coverage_counter_ref, get_coverage_counts): Define. + * gcov-dump.c, gcov.c: #include gcov-io.c. + * libgcov.c: Likewise. Adjust. + * loop-init.c: Don't #include profile.h + * tracer.c, predict.c, sched-ebb.c: Adjust #includes. + * rtl.h: Add coverage prototypes. + * toplev.c (compile_file): Init coverage, not branch_prob. + Always call coverage_finish. + (rest_of_compilation): Call coverage_end_function. + +2003-04-21 Matt Kraai + + * config/rs6000/rs6000.md (*movsf_softfloat): Add "h" <- "0" case. + +2003-04-21 Neil Booth + + * c-ppoutput.c (cb_include): Don't take a cpp_token. + * cppfiles.c: Don't undef strcmp. + (find_include_file): Don't take a cpp_token. Check for empty + file names. + (_cpp_execute_include, _cpp_compare_file_date): Don't take a cpp_token. + (cpp_push_include): Simplify. + * cpphash.h (_cpp_execute_include, _cpp_compare_file_date): Update. + * cpplib.c (glue_header_name): Return the file name, not a cpp_token. + (parse_include): Similary. Don't check for zero-length filenames. + (do_include_common, do_pragma_dependency): Update accordingly. + * cpplib.h (struct cpp_callbacks): Change prototype of include. + +2003-04-21 Richard Kenner + + * doc/rtl.texi (RTX_UNCHANGING_P): Point to true_dependence for + details of conflict handling. + + * fold-const.c (extract_muldiv, case CONVERT_EXPR): Detect case + when conversion overflows. + + * stor-layout.c (layout_decl): Don't set DECL_SIZE_UNIT if already set. + + * expr.c (store_constructor): Set RTX_UNCHANGING_P if readonly_field_p + before clearing. + +2003-04-21 Mark Mitchell + + * config/i386/winnt.c (i386_pe_mark_dllimport): Make the new RTL + have the same form as the old RTL. + +2003-04-21 Andreas Jaeger + + * cppcharset.c (_cpp_valid_ucn): Cast field precision to int. + +2003-04-20 Chris Lattner + Zack Weinberg + + * c-common.h, c-semantics.c: Rename genrtl_decl_cleanup to + genrtl_cleanup_stmt. Correct comment at head of + genrtl_cleanup_stmt (no such thing as a DECL_CLEANUP). + + * stmt.c (struct nesting): Kill n_function_calls. + (expand_start_bindings): Don't set + thisblock->data.block.n_function_calls. + (expand_end_bindings): Compare function_call_count against 0. + (expand_cleanups): Kill DONT_DO argument; all callers passed + NULL_TREE. All callers updated to match. + +2003-04-20 Zack Weinberg + + * varasm.c (struct deferred_constant, defer_addressed_constants_flag) + (defer_addressed_constants, output_deferred_addressed_constants): Kill. + (output_constant_def): Remove code predicated on + defer_addressed_constants_flag. + + * output.h: Remove prototypes of deleted functions. + * c-typeck.c (constructor_subconstants_deferred): Kill. + (struct initializer_stack): Remove 'deferred' field. + (start_init): Remove all references to the above. + (finish_init): Likewise. Also remove never-executed call to + output_deferred_addressed_constants. Pull assignment to + defstr out of if expression. + +2003-04-20 Neil Booth + + * cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH, + NOTE_NEWLINE): Remove. + * cpplex.c (_cpp_clean_line, _cpp_process_line_notes): Update + to handle new form of line note type. + +2003-04-20 Zack Weinberg + + * target.h (encode_section_info): Add new argument carrying + the RTL to be modified by the hook. + + * varasm.c (make_decl_rtl, output_constant_def): Update calls + to encode_section_info. + (default_encode_section_info): Take and use RTL argument, + don't use TREE_CST_RTL or DECL_RTL. + * output.h: Update prototype of default_encode_section_info. + * config/darwin.h (ASM_DECLARE_OBJECT_NAME) + (ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): + Update calls to encode_section_info. + + * config/darwin.c, config/arm/arm.c, config/arm/pe.c + * config/h8300/h8300.c, config/i386/winnt.c, config/m32r/m32r.c + * config/m68hc11/m68hc11.c, config/m88k/m88k.c, config/mcore/mcore.c + * config/mips/mips.c, config/mmix/mmix.c, config/pa/pa.c + * config/romp/romp.c, config/rs6000/rs6000.c, config/s390/s390.c + * config/v850/v850.c (TARGET_ENCODE_SECTION_INFO definitions): + Take and use RTL argument, don't use TREE_CST_RTL or DECL_RTL, + except for PE dllimport/dllexport. Update calls to + default_encode_section_info. + + * config/darwin-protos.h, config/arm/arm-protos.h, config/i386-protos.h: + Update prototypes. + + * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update. + +2003-04-20 John David Anglin + + PR/8705 + * pa.md (movccfp): New expander. + (setccfp0, setccfp1): Rename to movccfp0 and movccfp1, respectively. + Reverse fcmp conditions. + +2003-04-20 Marek Michalkiewicz + + * config/avr/avr.md (*cmpqi_sign_extend): Handle negative values + of operand 1 correctly. + +2003-04-20 Nathan Sidwell + + * cpplex.c (_cpp_lex_direct): Set BOL for CPP_EOF tokens. + * gcov.c (output_lines): Don't be so fussy about going past EOF. + +2003-04-20 Neil Booth + + * Makefile.in (LIBCPP_OBJS): Add cppcharset.o. + (cppcharset.o): New target. + * c-lex.c (is_extended_char): Move to cppcharset.c. + (utf8_extend_token): Delete. + * cppcharset.c: New file. + * cpphash.h (_cpp_valid_ucn): New. + * cpplex.c (lex_identifier): Update prototype. + (continues_identifier_p): Rename forms_identifier_p. Handle UCN + escapes. + (maybe_read_ucs): Rename maybe_read_ucn. Update to use code + in cppcharset.c. + (lex_number, lex_identifier, cpp_parse_escape): Update. + (_cpp_lex_direct): Update to handle UCNs. + (cpp_avoid_paste): Don't paste to form a UCN. + +2003-04-19 Roger Sayle + + * builtins.c (expand_builtin): Don't expand a pure or const + built-in function if the result will be ignored and none of + its arguments are volatile. + +2003-04-19 Kean Johnston + + * unwind-dw2.c (_Unwind_GetCFA): cast return to avoid warning + * config.gcc: make SCO use dbxelf.h and elfos.h; only use one + target fragment now: t-sco5; dont compile crti.o. + * config/i386/sco5.h: major overhaul to remove all COFF remnants + and to use elfos.h for most definitions. + (BSS_SECTION_ASM_OP): set correct segment attributes. + (PREFERED_DEBUGGING_TYPE): set to DWARF-2. + (DWARF2_UNWIND_INFO): Always set to 1. + (MD_STARTFILE_PREFIX): Make /usr/gnu/lib the default. + (MD_STARTFILE_PREFIX_1): Define. + (MD_EXEC_PREFIX): Adjust to /usr/gnu/bin if using GAS. + (DEFAULT_LINKER): Define if not specified to configure. + (CTORS_SECTION_ASM_OP): Remove COFF crud. + (DTORS_SECTION_ASM_OP): Remove COFF crud. + (WINT_TYPE): Define. + (SDB_DEBUGGING_INFO): Remove. + (EXTRA_SECTIONS): Likewise. + (EXTRA_SECTION_FUNCTIONS): Likewise. + (CTOR_LIST_BEGIN): Likewise. + (CTOR_LIST_END): Likewise. + (INIT_SECTION_FUNCTION): Likewise. + (FINI_SECTION_FUNCTION): Likewise. + (SUBTARGET_FRAME_POINTER_REQUIRED): Likewise. + (LOCAL_LABEL_PREFIX): Likewise. + (NON_SAVING_SETJMP): Likewise. + (RETURN_POPS_ARGS): Likewise. + (ASM_OUTPUT_SKIP): Likewise. + (TARGET_ASM_NAMED_SECTION): Likewise. + (ASM_OUTPUT_INTERNAL_LABEL): Likewise. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. + (ASM_OUTPUT_IDENT): Likewise. + (ASM_OUTPUT_CASE_LABEL): Likewise. + (ASM_OUTPUT_ASCII): Likewise. + (ASM_OUTPUT_LIMITED_STRING): Likewise. + (ASM_OUTPUT_ALIGNED_LOCAL): Likewise. + (ASM_OUTPUT_ALIGNED_COMMON): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (ASM_FINISH_DECLARE_OBJECT): Likewise. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (ASM_DECLARE_RESULT): Likewise. + (ASM_WEAKEN_LABEL): Likewise. + (SUPPORTS_WEAK): Likewise. + (APPLY_RESULT_SIZE): Likewise. + (LPREFIX): Likewise. + (ALIGN_ASM_OP): Likewise. + (ASCII_DATA_ASM_OP): Likewise. + (IDENT_ASM_OP): Likewise. + (ASM_SHORT): Likewise. + (ASM_LONG): Likewise. + (TYPE_ASM_OP): Likewise. + (SIZE_ASM_OP): Likewise. + (STRING_ASM_OP): Likewise. + (SKIP_ASM_OP): Likewise. + (EH_FRAME_SECTION_ASM_OP): Likewise. + (READONLY_DATA_SECTION_ASM_OP): Likewise. + (INIT_SECTION_ASM_OP): Likewise. + (FINI_SECTION_ASM_OP): Likewise. + (TEXT_SECTION_ASM_OP): Likewise. + (DATA_SECTION_ASM_OP): Likewise. + (TYPE_OPERANT_FORMAT): Likewise. + (ASM_SPEC): Remove COFF code. + (STARTFILE_SPEC): Likewise. Always use crti.o; add -p and -pp support; + cause -pg to emit an error; use pcrt1elf.o with -pp + (ENDFILE_SPEC): Likewise. + (TARGET_OS_CPP_BUILTINS): Add _SCO_DS_LL. + (CPP_SPEC): Remove COFF crud; always look in /usr/gnu/include first. + (LINK_SPEC): Remove COFF crud; use -E for environment switch not -R; + add -z alt_resolve to support weak symbols the way GCC wants them. + (LIB_SPEC): Use the profiler libraries in -p or -pp mode. + (LIBGCC_SPEC): Dont use -lgcc in -G mode. + (ASM_PREFERED_EH_DATA_FORMAT): Remove. + * config/i386/t-sco5 (TARGET_LIBGCC2_CFLAGS): Remove. + (CRTSTUFF_T_CFLAGS_S): Define. + (MULTILIB_OPTIONS): Likewise. + (MULTILIB_DIRNAMES): Likewise. + (MULTILIB_MATCHES): Likewise. + (MULTILIB_EXTRA_OPTS): Likewise. + (LIBGCC): Likewise. + (INSTALL_LIBGCC): Likewise. + (crti.o): Remove. + * config/i386/t-sco5gas: Remove. + * doc/install.texi: Updated for new OpenServer instructions. + * testsuite/gcc.dg/nest.c: Allow failure on SCO (-pg not supported) + +2003-04-19 Kean Johnston + + * fixinc/check.tpl: Allow user to over-ride diff program. + * fixinc/inclhack.def: Removed extraneous #ifndef SVR5. + (sco_math): Added test for SCO math header files. + (sco_regset): Added check for conflicts with ieeefp.h. + (svr4_disable_opt): Removed extraneous #ifdef SVR4. + * fixinc/fixincl.x: Regenerated + * fixinc/tests/base/math.h: Added sco_math tests. + * fixinc/tests/base/string.h: New file. + * fixinc/tests/base/sys/regset.h: New file. + +2003-04-19 Neil Booth + + * cpphash.h (struct cpp_buffer): Remove backup_to. + * cpplex.c (BACKUP, get_effective_char): Die. + (_cpp_skip_block_comment): Assume '*' is location on entry. + (continues_identifier_p): Respect -fno-dollars-in-identifiers. + (IF_NEXT_IS): Update. + (_cpp_lex_direct): Don't use backup_to; look ahead directly. + +2003-04-19 Matt Kraai + + * README.Portability: Move to a new section and obsolete K+R + portability issues. + +Sat Apr 19 14:56:17 CEST 2003 Jan Hubicka + + * rtlanal.c (subreg_offset_representable_p): Fix call of + subreg_lowpart. + +2003-04-19 Neil Booth + + * cpphash.h (struct cpp_reader): New member warned_dollar. + * cpplex.c (continues_identifier_p): New function. + (parse_identifier, parse_number, parse_string): Rename lex_identifer, + lex_number and lex_string, and simplify. + (parse_slow, unescaped_terminator_p): Die. + (_cpp_lex_direct): Update. + +2003-04-19 Richard Kenner + + * calls.c (expand_call): Provide init for old_stack_pointer_delta. + +2003-04-19 Nathan Sidwell + + * doc/invoke.texi (-fprofile-arcs): Mention -lgcov, locking and + fork behavior. + +2003-04-19 Neil Booth + + * cppexp.c (eval_token): Permit true and false even if pedantic. + +2003-04-19 Neil Booth + + * cpplex.c (skip_whitespace): Rearrange to avoid stage1 ICE. + +2003-04-19 Neil Booth + + * cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD, + MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove. + (struct include_file): Remove fefcnt, mapped members. + (open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching. + (read_include_file): Don't use mmap, terminate buffers in '\r'. + (purge_cache): Don't use munmap. + * cpphash.h (CPP_BUF_COLUMN): Update. + (lexer_state): Remove lexing_comment. + (struct _cpp_line_note): New. + (struct cpp_buffer): New members cur_note, notes_used, notes_cap, + next_line and need_line. Remove col_adjust and saved_flags. + (_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line, + _cpp_skip_block_comment, scan_out_logical_line): New. + (_cpp_init_mbchar): Remove. + * cppinit.c (init_library): Remove call to _cpp_init_mbchar. + (cpp_read_main_file): Set line to 1 earlier. + (post_options): -traditional-cpp doesn't want trigraphs. + * cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this. + (add_line_note, _cpp_clean_line, _cpp_process_line_notes, + _cpp_get_fresh_line): New. + (handle_newline, skip_escaped_newlines, trigraph_p, + continue_after_nul, _cpp_init_mbchar): Remove. + (get_effective_char): Update. + (_cpp_skip_block_comment): Rename from skip_block_comment, simplify. + (skip_line_comment): Simplify. + (skip_whitespace, parse_identifier, parse_slow, parse_number, + parse_string): Update. + (cpp_lex_direct): Use clean lines and process line notes. Update. + (cpp_interpret_charconst): No MULTIBYTE_CHARS. + * cpplib.c (prepare_directive_trad): Call scan_out_logical_line + directly. + (_cpp_handle_directive): Don't set saved_flags. + (run_directive, destringize_and_run, cpp_define, cpp_define_builtin, + cpp_undef, handle_assertion, cpp_push_buffer): Update. + (_cpp_pop_buffer): Free notes. + * cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer. + * cpppch.c (cpp_read_state): \n terminate buffer. + * cpptrad.c (skip_escaped_newlines, handle_newline): Remove. + (copy_comment): Use _cpp_skip_block_comment. + (skip_whitespace, lex_identifier, _cpp_read_logical_line_trad): + Simplify. + (_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text, + save_replacement_text): Update. + (scan_out_logical_line): Update to use clean lines and process + line notes. + * fix-header.c (read_scan_file): Update. + +2003-04-18 Douglas B Rupp + + * unwind-dw2-fde.c (__register_frame_info_bases): Check for + null begin parameter (as well as pointer to null). + (__deregister_frame_info_bases): Likewise. + +2003-04-18 Richard Kenner + + * function.c (purge_addressof_1): For ADDRESSOF, see if SUB is a + hard or virtual register and copy into pseudo if replacement fails. + + * cfgcleanup.c (flow_find_cross_jump): Use INSN_P, not active_insn_p. + + * expmed.c (mask_rtx): Avoid undefined shifts for BITSIZE of 0. + +2003-04-18 Olivier Hainque + + * calls.c (expand_call): Move special case for constructor calls + to right place. Ensures constructor calls used to initialize + arguments get a clean outgoing argument block for themselves. + Move check for stack deallocation completeness until after last + deallocation. Add stack_pointer_delta to set of state + variables saved and restored along with current stack_level. + + * integrate.c (expand_inline_function): Ensure non-const actuals + don't end up const in the caller's flow after conversion to possibly + const formal type. + +2003-04-18 Vincent Celier + + * dwarf2out.c (loc_descriptor_from_tree): Treat all *_MOD_EXPR + and *_DIV_EXPR as TRUNC_*_EXPR. + +2003-04-18 Mark Mitchell + + * cfgrtl.c (try_redirect_by_replacing_jump): Create a basic block + for orphaned jump tables. + +2003-04-18 Kazu Hirata + + * reload1.c: Revert my previous patch on 2002-04-17. + +2003-04-18 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Prefer "bug fix" over "bugfix". + Add Segher Boessenkool. + +2003-04-18 Alexander Sotirov + + PR c/9177 + * c-decl.c (c_expand_body): Don't garbage collect the function + body if we are going to dump it later. + +2003-04-18 Richard Henderson + + * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): Remove. + (alpha_end_function): Don't set them. + (decl_in_text_section): Remove. + (alpha_encode_section_info): Remove. + (samegp_function_operand): Use SYMBOL_REF LOCAL_P and EXTERNAL_P. + (direct_call_operand): Use SYMBOL_REF_DECL and compare actual + sections, rather than decl_in_text_section results. + +2003-04-18 Roger Sayle + + * rtlanal.c (reg_overlap_mentioned_p): Handle ZERO_EXTRACT + and SIGN_EXTRACT. + +2003-04-18 Eric Botcazou + + PR optimization/7675 + * c-typeck.c (build_external_ref): Set the DECL_NONLOCAL flag + on VAR_DECL, PARM_DECL and FUNCTION_DECL from within + nested functions if they refer to declarations from parent functions. + * stmt.c (expand_decl): Don't put automatic variables in registers + if the DECL_NONLOCAL flag is set. + +2003-04-18 Hans-Peter Nilsson + + * gcse.c (compute_ld_motion_mems): For MEM destinations, only + consider those to be movable where the source matches + want_to_gcse_p. + (update_ld_motion_stores): In comment, refer to + compute_ld_motion_mems for validity of replacement. + +Fri Apr 18 01:28:51 CEST 2003 Jan Hubicka + + * gcov-dump.c (tag_summary): Remove max_sum + * gcov-io.h (gcov_summary, gcov_write_summary, + gcov_read_summary): Kill max_sum. + * libgcov.c (gcov_exit): Do one pass over the data. Make error + message more verbose. + + * emit-rtl.c (subreg_hard_regno): Check that register is + representable. + + * reload.c (reload_inner_reg_of_subreg): When register is not + representable, reload the whole thing. + (find_reloads): Likewsie. + * rtlanal.c (subreg_representable_p): New function. + + * profile.c (compute_branch_probabilities): Cleanup sanity checking; + allow negative probabilities for edges from the call to exit. + (branch_prob): Do not add fake edges for functions that may return + twice. + +2003-04-17 DJ Delorie + + * toplev.c (target_options): Add value field. + (set_target_switch): Handle target options with values. + * doc/tm.texi: Document how fixed vs variable target + options work. + * config/alpha/alpha.h, config/arc/arc.h, config/avr/avr.h, + config/c4x/c4x.h, config/cris/aout.h, config/cris/cris.h, + config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, + config/frv/frv.h, config/i386/i386.h, config/ia64/ia64.h, + config/m32r/m32r.h, config/m68hc11/m68hc11.h, + config/m68k/m68k.h, config/m88k/m88k.h, config/mcore/mcore.h, + config/mips/mips.h, config/mmix/mmix.h, config/pa/pa.h, + config/rs6000/rs6000.h, config/rs6000/sysv4.h, + config/s390/s390.h, config/sparc/sparc.h, config/v850/v850.h: + Add value initializer to target options. + +2003-04-07 Loren James Rittle + + * cpppch.c (cpp_valid_state): Unconditionally initialize nl. + +2003-04-17 Kazu Hirata + + * reload1.c (move2add_last_cc0): New. + (reload_cse_move2add): Detect implicit sets. + (move2add_note_store): Notice a store into cc0. + +2003-04-17 Roger Sayle + + PR c/10375 + * c-decl.c (duplicate_decls): Preserve "const" and "noreturn" + function attributes. + +2003-04-17 Janis Johnson + + * doc/sourcebuild.texi (Test Suites): Document support for testing + binary compatibility (moved from testsuite/README.compat). + +2003-04-17 Richard Henderson + + * config/ia64/ia64.c (ia64_in_small_data_p): Disallow strings. + +2003-04-17 Simon Law + + * doc/include/gpl.texi: Fix double-spacing after "MA" to match + the one provided by the FSF. + +2003-04-17 Gerald Pfeifer + + * doc/install.texi (Binaries): Update URL and list of platforms + provided by ftp.thewrittenword.com. + +2003-04-17 Richard Henderson + + * config/xtensa/xtensa.c (xtensa_encode_section_info): Remove. + (call_insn_operand): Use SYMBOL_REF_LOCAL_P. + * config/xtensa/xtensa.md (call, call_value): Likewise. + +2003-04-17 Richard Henderson + + * config/v850/v850.c (print_operand): Use SYMBOL_REF_[ZST]DA. + (print_operand_address): Likewise. + (ep_memory_operand): Likewise. + (special_symbolref_operand): Likewise. + (v850_encode_data_area): Use SYMBOL_REF_FLAGS. + (v850_encode_section_info): Call default_encode_section_info. + (v850_strip_name_encoding): Remove. + * config/v850/v850.h (EXTRA_CONSTRAINT): Use SYMBOL_REF_[ZST]DA. + (ASM_OUTPUT_LABELREF): Remove. + (ZDA_NAME_FLAG_CHAR, ZDA_NAME_P): Remove. + (SDA_NAME_FLAG_CHAR, SDA_NAME_P): Remove. + (TDA_NAME_FLAG_CHAR, TDA_NAME_P): Remove. + (ENCODED_NAME_P): Remove. + (SYMBOL_FLAG_ZDA, SYMBOL_REF_ZDA_P): New. + (SYMBOL_FLAG_SDA, SYMBOL_REF_SDA_P): New. + (SYMBOL_FLAG_TDA, SYMBOL_REF_TDA_P): New. + +2003-04-17 Richard Henderson + + * config/stormy16/stormy16.c (xstormy16_encode_section_info): Kill. + * config/stormy16/stormy16.h (ASM_OUTPUT_SYMBOL_REF): Use + SYMBOL_REF_FUNCTION_P. + +2003-04-17 Richard Henderson + + * config/sparc/sparc.c (sparc_encode_section_info): Remove. + (data_segment_operand): Use SYMBOL_REF_FUNCTION_P. + (text_segment_operand): Likewise. + +2003-04-17 Richard Henderson + + * config/sh/sh.c (gen_datalabel_ref): Don't add SH_DATALABEL_ENCODING. + (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL. + (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P. + (sh_encode_section_info): Remove. + (sh_strip_name_encoding): Remove. + * config/sh/sh.h (SH_DATALABEL_ENCODING): Remove. + (DATALABEL_SYMNAME_P, STRIP_DATALABEL_ENCODING): Remove. + (SH_TLS_ENCODING, TLS_SYMNAME_P, STRIP_TLS_ENCODING): Remove. + (ASM_OUTPUT_LABELREF): Remove. + (ASM_OUTPUT_SYMBOL_REF): Use SYMBOL_REF_FUNCTION_P. + * config/sh/sh.md (*): Use SYMBOL_REF_LOCAL_P. + +2003-04-17 Richard Henderson + + * config/s390/s390.c (SYMBOL_FLAG_ALIGN1): New. + (tls_model_chars): Remove. + (larl_operand): Use SYMBOL_REF_FLAGS. + (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL. + (legitimize_pic_address): Use SYMBOL_REF_LOCAL_P. + (s390_output_mi_thunk): Likewise. + (s390_emit_prologue): Set SYMBOL_FLAG_LOCAL as needed. + (s390_function_profiler): Likewise. + (s390_encode_section_info): Use default_encode_section_info + and SYMBOL_FLAG_ALIGN1. + (s390_strip_name_encoding): Remove. + * config/s390/s390.h (ASM_OUTPUT_LABELREF): Remove. + * config/s390/s390.md (call, call_value): Use SYMBOL_REF_LOCAL_P. + (builtin_setjmp_receiver): Set SYMBOL_FLAG_LOCAL as needed. + +2003-04-17 Richard Henderson + + * config/ns32k/ns32k.c (ns32k_encode_section_info): Remove. + (global_symbolic_reference_mentioned_p): Use SYMBOL_REF_LOCAL_P. + (print_operand_address): Likewise. + + * config/ns32k/ns32k.h (CANNOT_CHANGE_MODE_CLASS): Add CLASS argument. + * config/ns32k/ns32k.c (expand_block_move): Don't check + flag_unroll_loops. + +2003-04-17 Richard Henderson + + * config/mcore/mcore.c (mcore_encode_section_info): Don't set + SYMBOL_REF_FLAG. + +2003-04-17 Richard Henderson + + * rtl.h (SYMBOL_FLAG_MACH_DEP_SHIFT): New. + + * config/m32r/m32r.c (SYMBOL_FLAG_MODEL_SHIFT): New. + (SYMBOL_REF_MODEL): New. + (LIT_NAME_P): Move from m32r.h. + (m32r_select_section): Remove. + (m32r_encode_section_info): Use SYMBOL_REF_FLAGS. + (m32r_strip_name_encoding): Remove. + (m32r_in_small_data_p): New. + (small_data_operand): Use SYMBOL_REF_SMALL_P. + (addr24_operand): Use SYMBOL_REF_MODEL. + (call26_operand): Likewise. + (addr32_operand): Tidy. + (m32r_print_operand): Use HOST_WIDE_INT_PRINT_HEX. + * config/m32r/m32r.h (RODATA_SECTION_ASM_OP): Remove. + (SDATA_SECTION_ASM_OP, SBSS_SECTION_ASM_OP): Remove. + (READONLY_DATA_SECTION_ASM_OP): Remove. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. + (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Remove. + (TARGET_ASM_SELECT_SECTION): Remove. + (SDATA_FLAG_CHAR, MEDIUM_FLAG_CHAR, LARGE_FLAG_CHAR): Remove. + (SDATA_NAME_P, SMALL_NAME_P, MEDIUM_NAME_P): Remove. + (LARGE_NAME_P, ENCODED_NAME_P): Remove. + (ASM_OUTPUT_LABELREF): Remove. + +2003-04-17 Richard Henderson + + * config/ip2k/ip2k.c (is_regfile_address): Use SYMBOL_REF_FUNCTION_P. + (encode_section_info): Remove. + * config/ip2k/ip2k-protos.h: Update. + +2003-04-17 Richard Henderson + + * varasm.c (default_encode_section_info): Don't set + SYMBOL_FLAG_EXTERNAL if not TREE_PUBLIC. + * config/i370/i370.c (i370_encode_section_info): Remove. + * config/i370/i370.h (CONSTANT_ADDRESS_P): Use SYMBOL_REF_EXTERNAL_P. + (PRINT_OPERAND, PRINT_OPERAND_ADDRESS): Likewise. + * config/i370/i370.md (movsi): Likewise. + + * config/i370/t-i370: Add missing backslash. + +2003-04-17 Eric Botcazou + + * doc/invoke.texi (inline-limit): Fix pasto. + +2003-04-17 Richard Henderson + + * config/h8300/h8300.c (SYMBOL_FLAG_FUNCVEC_FUNCTION): New. + (small_call_insn_operand): Use it. + (SYMBOL_FLAG_EIGHTBIT_DATA): New. + (h8300_eightbit_constant_address_p): Use it. + (SYMBOL_FLAG_TINY_DATA): New. + (h8300_tiny_constant_address_p): Use it. + (h8300_encode_label, h8300_strip_name_encoding): Remove. + (h8300_encode_section_info): Set SYMBOL_REF_FLAGS. + * config/h8300/h8300.h (TINY_DATA_NAME_P): Remove. + (ASM_OUTPUT_LABELREF): Remove. + +2003-04-16 Richard Henderson + + * config/frv/frv.c (symbol_ref_small_data_p): Remove. Replace + all users with SYMBOL_REF_SMALL_P. + (const_small_data_p): Use SYMBOL_REF_SMALL_P. + (frv_encode_section_info): Remove. + (frv_strip_name_encoding): Remove. + (frv_in_small_data_p): Merge tests from encode_section_info. + (frv_print_operand): Use '@' not SDATA_FLAG_CHAR. + * config/frv/frv.h (SDATA_FLAG_CHAR): Remove. + (SDATA_NAME_P): Remove. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use SIZE not SDATA_NAME_P. + (ASM_OUTPUT_LABELREF): Remove. + (PRINT_OPERAND_PUNCT_VALID_P): Use '@' not SDATA_FLAG_CHAR. + + * config/frv/frv.c (frv_asm_out_constructor): New. + (frv_asm_out_destructor): New. + * config/frv/frv.h (CTORS_SECTION_ASM_OP): New. + (DTORS_SECTION_ASM_OP): New. + (ASM_OUTPUT_CONSTRUCTOR): Remove. + (ASM_OUTPUT_DESTRUCTOR): Remove. + +2003-04-16 Richard Henderson + + * config/cris/cris.c (cris_gotless_symbol, cris_got_symbol): Use + SYMBOL_REF_LOCAL_P; abort if not pic. + (cris_encode_section_info): Remove. + +2003-04-16 Richard Henderson + + * config/c4x/c4x.c (c4x_encode_section_info): Remove. + (c4x_T_constraint): Use SYMBOL_REF_FUNCTION_P. + + * config/c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): Declare + flag_inline_trees. + +2003-04-16 Richard Henderson + + * config/avr/avr.c (avr_encode_section_info): Remove. + (avr_insert_attributes): New. + (print_operand_address): Use SYMBOL_REF_FUNCTION_P. + (avr_assemble_integer): Likewise. + +2003-04-16 Richard Henderson + + * arc.c (arc_encode_section_info): Remove. + (arc_assemble_integer): Use SYMBOL_REF_FUNCTION_P. + (arc_print_operand, arc_print_operand_address): Likewise. + * arc.h (EXTRA_CONSTRAINT): Likewise. + +2003-04-16 Roger Sayle + + * c-semantics.c (find_reachable_label): New function to find a + potentially reachable label in an expression. + (expand_unreachable_if_stmt): Similar to expand_if_stmt but + assumes the start of the IF_STMT is unreachable (dead) code. + (expand_unreachable_stmt): Similar to expand_stmt but assumes + the start of the statement list is unreachable (dead) code. + (genrtl_if_stmt): If the controlling expression of the IF + is constant, use expand_unreachable_stmt for the THEN or ELSE + clause as appropriate. + (genrtl_switch_stmt): Use expand_unreachable_stmt to expand + the body of a SWITCH statement. + (expand_stmt): The code immediately following a "return", + "break", "continue" or "goto" is unreachable. + * Makefile.in (c-semantics.o): Depend upon tree-inline.h. + +2003-04-16 Richard Henderson + + * rtl.h (MEM_ALIAS_SET): Update documentation. + * doc/rtl.texi (Special Accessors): New node. + (SYMBOL_REF_FLAG): Note relationship with SYMBOL_REF_FLAGS. + +2003-04-16 Alexandre Oliva + + * reload1.c (reload_cse_noop_set_p): Return false if mode of + SET_DEST is not the same as that returned by... + * cselib.h (cselib_reg_set_mode): ... new function. + * cselib.c (cselib_reg_set_mode): Define it. + (REG_VALUES): Document semantics of first element as set mode. + (cselib_subst_to_values): Skip first element if ELT is NULL. + (cselib_lookup): Likewise. Insert past the first element. + (cselib_invalidate_regno): NULLify first element. + (cselib_record_set): Set first element. + +2003-04-16 Olivier Hainque + + * tree.c (skip_simple_arithmetics_at, saved_expr_p): New functions. + (save_expr): Replace loop by call to skip_simple_arithmetics_at. + * tree.h: Add prototypes for the two new functions. + * fold-const.c (fold_binary_op_with_conditional_arg): Replace test + updates introduced in the previous revision by call to saved_expr_p. + * stor-layout.c (put_pending_size): Use skip_simple_arithmetics_at. + + * expr.c (store_field): Force usage of bitfield instructions when + the field position requires it, whatever SLOW_UNALIGNED_ACCESS. + (expand_expr, case BIT_FIELD_REF): likewise. + +2003-04-16 Mark Mitchell + + PR middle-end/8866 + * cfgtrl.c (try_redirect_by_replacing_jump): Do not delete + jumptables. + +2003-04-16 Richard Henderson + + * config/ia64/ia64.c (sdata_symbolic_operand): Use + SYMBOL_REF_SMALL_P and SYMBOL_REF_LOCAL_P. + (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL. + (function_operand): Use SYMBOL_REF_FUNCTION_P. + (ia64_expand_load_address): Likewise. + (ia64_assemble_integer): Likewise. + (ia64_encode_section_info): Remove. + (ia64_strip_name_encoding): Remove. + * config/ia64/ia64.h (ENCODE_SECTION_INFO_CHAR): Remove. + * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Don't strip it. + +2003-04-16 Richard Henderson + + * config/alpha/alpha.c (SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP): New. + (samegp_function_operand): Use SYMBOL_FLAG_SAMEGP. + (direct_call_operand): Use SYMBOL_FLAG_NEAR. + (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P. + (small_symbolic_operand): Use SYMBOL_REF_SMALL_P. + (global_symbolic_operand): Similarly. + (tls_symbolic_operand_1): Use SYMBOL_REF_TLS_MODEL. + (tls_symbolic_operand_type): Likewise. + (alpha_encode_section_info): Use default_encode_section_info. + (alpha_strip_name_encoding): Remove. + (get_tls_get_addr): Split out from ... + (alpha_legitimize_address): ... here. + (alpha_emit_xfloating_libcall): Use init_one_libfunc. + (get_some_local_dynamic_name_1): Use SYMBOL_REF_TLS_MODEL. + (alpha_initialize_trampoline): Use init_one_libfunc. + (alpha_setup_incoming_varargs): Mark unused parameters. + (alpha_initial_elimination_offset): Likewise. + (alpha_end_function): Use SYMBOL_FLAG_NEAR, SYMBOL_FLAG_SAMEGP. + (unicosmk_unique_section): Use default_strip_name_encoding. + (unicosmk_ssib_name, unicosmk_output_externs): Likewise. + +2003-04-16 Aldy Hernandez + + * config.gcc: Add t-spe for eabispe. + + * config/rs6000/t-spe: New. + +2003-04-16 J"orn Rennecke + + Re-apply this patch: + + 2002-05-16 Dale Johannesen + * combine.c (cant_combine_insn_p): Reenable combinations + involving hard regs unless CLASS_LIKELY_SPILLED_P. + +2003-04-16 John David Anglin + + PR/10271 + * pa-protos.h (function_arg): Remove last argument. + * pa.c (function_arg): Likewise. Use CUMULATIVE_ARGS struct instead. + * pa.h (struct hppa_args): Add member incoming. + (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Initialize + member incoming. + (FUNCTION_ARG): Revise call to function_arg. + (FUNCTION_INCOMING_ARG): Delete. + +2003-04-15 Zack Weinberg + + * configure.in: Unify the code which creates symlinks to a + just-built as, ld, objdump, and nm with the code that detects + their presence for purposes of feature tests. + * configure: Regenerate. + +2003-04-15 Zack Weinberg + + * varasm.c (output_constant_def): Do not consult + CONSTANT_AFTER_FUNCTION_P. Remove all code predicated on it. + (after_function_constants, output_after_function_constants): Delete. + * doc/tm.texi: Delete documentation of CONSTANT_AFTER_FUNCTION_P. + * config/mips/mips-protos.h, config/mips/mips.c + (mips16_constant_after_function_p): Delete. + * config/mips/mips.h: Delete #if-0-ed definition of + CONSTANT_AFTER_FUNCTION_P. + * config/d30v/d30v.h, config/stormy16/stormy16.h: Remove + mention of CONSTANT_AFTER_FUNCTION_P in comment. + +2003-04-15 Geoffrey Keating + + * tree.c (next_decl_uid): Mark with GTY. + (next_type_uid): Likewise. + +2003-04-15 J"orn Rennecke + + PR target/9594: + * sh.c (barrier_align): Also recognize stuff_delay_slot as + an indicator that a barrier was created by branch splitting. + +2003-04-15 Mark Mitchell + + * c-decl.c (implicitly_declare): Copy declarations that are going + to be placed in a local scope. + +2003-04-15 James A. Morrison + + * invoke.texi (Spec Files): Wrap if-exists-else example. + (MCore): Remove duplicate @itemx entries and @opindex entries. + +2003-04-15 Ulrich Weigand + + * unwind.inc (_Unwind_Backtrace): New function. + * unwind.h (_Unwind_Backtrace): Declare it. + * libgcc-std.ver (_Unwind_Backtrace): Export it. + +2003-04-14 Jason Merrill + + PR middle-end/10336, c++/10401 + * jump.c (never_reached_warning): Also stop looking if we reach the + beginning of the function. + +2003-04-15 Kaveh R. Ghazi + + PR target/10338 + PR bootstrap/10198 + PR bootstrap/10140 + * fixinc/gnu-regex.c (regerror): Use mempcpy not __mempcpy. + +2003-04-15 J"orn Rennecke + + * i386.md (abssf2_if+1): Make condition agree with abssf2_1 . + +2003-04-15 Richard Kenner + + * optabs.c (expand_binop): In multi-word add cases, ensure + XTARGET is copied to TARGET if they are different. + +2003-04-15 Olivier Hainque + + * except.c (resolve_fixup_regions): Avoid dereferencing null pointer + to region, possible after integration of function with unreachable + regions that were optimized away. + +2003-04-15 Jakub Jelinek + + * config/rs6000/rs6000.h (EPILOGUE_USES): Use register 2, + instead of TOC_REGISTER in epilogue in + current_function_calls_eh_return functions. + +2003-04-14 Mark Mitchell + + * doc/extend.texi (Empty Structures): Correct description of G++'s + handling of these structures. + + * c-decl.c (grokdeclarator): Reject extern redeclarations of + static variables. + +2003-04-14 Janis Johnson + + * config/rs6000/rs6000.md (define_constants): Define constants for + all UNSPEC usage, including new values for TLS support. + (aux_truncdfsf2, fctiwz, movsi_got, movsi_got_internal, + load_toc_aix_si, load_toc_aix_di, load_toc_v4_pic_si, + load_toc_v4_PIC_1, load_toc_v4_PIC_1b, load_macho_picbase, + macho_correct_pic, blockage, move_from_CR_ov_bit, movesi_from_cr, + stack_tie, movsi_to_cr_one, movsi_to_cr, mtcrfsi, eh_set_lr_si, + eh_set_lr_di): Use them. + * rs6000.c: (mtcrf_operation, uses_TOC, rs6000_emit_prologue, + rs6000_emit_epilogue) Use them. + + * rtl.h (SYMBOL_REF_TLS_MODEL): Fix mask value. + +2003-04-14 Neil Booth + + * Makefile.in (c-opts.o): Use custom action. + +2003-04-14 Douglas B Rupp + + * ifcvt.c (noce_process_if_block): Fail on BLKmode move. + +2003-04-14 Richard Kenner + + * stor-layout.c (layout_type, case ARRAY_TYPE): Add missing code to + handle "superflat arrays" in Ada. + + * integrate.c (expand_inline_function): Don't inline if would + lose /u on a BLKmode TARGET. + +2003-04-14 Joel Brobecker + + * dbxout.c (print_int_cst_bounds_in_octal_p): New function, + extracted from dbxout_type. + (dbxout_range_type): print large bounds in octal format. + (dbxout_type): Replace extracted code by call to + print_int_cst_bounds_in_octal_p. + + * dwarf2out.c (gen_compile_unit_die): Emit DW_LANG_Ada95 instead + of DW_LANG_Ada83 for Ada units. + +2003-04-14 Olivier Hainque + + * explow.c (round_push): Use HOST_WIDE_INT instead of int for the + temporary used to round CONST_INT sizes. + + * tree.c (int_fits_type_p): Extract generic checks from the case + of constant type bounds. Refine the checks against constant type + bounds to allow for possible decisions against each of these bounds + without requiring both bounds to be constant. + (tree_int_cst_msb): Put back. + * tree.h (tree_int_cst_msb): Likewise. + + * global.c (global_conflicts): Prevent allocation of call clobbered + hard regs to pseudos live across abnormal edges, as later passes are + not ready to handle them. + + * fold-const.c (fold): Reorder tests for conditional expressions. + + * expr.c (highest_pow2_factor): Return unsigned. + * expr.h (offset_address): Likewise. + * emit-rtl.c (offset_address): POW2 argument now unsigned. + +2003-04-14 Roger Sayle + + * builtins.c (expand_builtin_strlen): Evaluate the lengths of + string literals at compile-time. + +2003-04-14 Roger Sayle + + * fold-const.c (fold): Transform (c1 - x) cmp c2, where cmp is a + comparison operation and c1/c2 are floating point constants into + x swap(cmp) (c1 - c2). + +2003-04-14 Vladimir Makarov + + * genautomata.c (output_translate_vect): Fix a typo in loop + condition. + +2003-04-14 Hans-Peter Nilsson + + PR target/10377 + * config/cris/cris.md ("*mov_sideqi", "*mov_sidehi") + ("*mov_sidesi", "*mov_sideqi_mem", "*mov_sidehi_mem") + ("*mov_sidesi_mem", "*clear_sidesi", "*clear_sidehi") + ("*clear_sideqi", "*ext_sideqihi", "*ext_sideqisi") + ("*ext_sidehisi", "*op_sideqi", "*op_sidehi", "*op_sidesi") + ("*op_swap_sideqi", "*op_swap_sidehi", "*op_swap_sidesi") + ("*extopqihi_side", "*extopqisi_side", "*extophisi_side") + ("*extopqihi_swap_side", "*extopqisi_swap_side") + ("*extophisi_swap_side", 8th, 9th, 10th, 11th, 14th peepholes): + When next to constraint R, replace constraint i with n. + +Mon Apr 14 16:18:37 CEST 2003 Jan Hubicka + + PR opt/10024 + * cfgrtl.c (force_nonfallthru_and_redirect): Use unchecked_make_edge. + +2003-04-14 Kriang Lerdsuwanakij + + * doc/contrib.texi (Contributors): Correct my entry. + +2003-04-13 Roger Sayle + + * tree.h (DECL_BUILT_IN_NONANSI): Remove. + * c-common.c (builtin_function_2): Don't set DECL_BUILT_IN_NONANSI. + * c-decl.c (duplicate_decls): Use invariant DECL_BUILT_IN_NONANSI + implies DECL_BUILT_IN to simplify logic. + * print-tree.c (print_node): Don't dump DECL_BUILT_IN_NONANSI. + +2003-04-13 Roger Sayle + + * builtin-types.def (BT_FN_STRING_CONST_STRING): New builtin type. + (BT_FN_PTR_SIZE_SIZE): Likewise. + * builtins.def (BUILT_IN_MALLOC, BUILT_IN_CALLOC, BUILT_IN_STRDUP): + New built-in functions for malloc, calloc and strdup respectively. + * calls.c (special_function_p): No need to handle malloc-like + functions any longer. ECF_MALLOC is set via built-in attributes. + + * c-decl.c (duplicate_decls): Preserve pure and malloc attributes. + + * doc/extend.texi: Document these new built-in functions. + +2003-04-13 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memcpy): Add `endp' argument, use it. + (expand_builtin_stpcpy): New. + (expand_builtin): Add BUILT_IN_MEMPCPY & BUILT_IN_STPCPY. + * builtins.def: Add mempcpy & stpcpy support. + * doc/extend.texi (mempcpy, stpcpy): Document new builtins. + +2003-04-13 Nick Clifton + + * config/rs6000/rs6000.c: Replace occurrences of "GNU CC" with + "GCC". + * config/rs6000/40x.md, config/rs6000/603.md, + config/rs6000/6xx.md, config/rs6000/7450.md, config/rs6000/7xx.md, + config/rs6000/8540.md, config/rs6000/aix.h, config/rs6000/aix31.h, + config/rs6000/aix3newas.h, config/rs6000/aix41.h, + config/rs6000/aix43.h, config/rs6000/aix51.h, + config/rs6000/aix52.h, config/rs6000/altivec-defs.h, + config/rs6000/altivec.h, config/rs6000/altivec.md, + config/rs6000/beos.h, config/rs6000/darwin.h, + config/rs6000/eabi.h, config/rs6000/eabialtivec.h, + config/rs6000/eabisim.h, config/rs6000/eabispe.h, + config/rs6000/freebsd.h, config/rs6000/gnu.h, + config/rs6000/host-darwin.c, config/rs6000/linux.h, + config/rs6000/linux64.h, config/rs6000/linuxaltivec.h, + config/rs6000/lynx.h, config/rs6000/mach.h, config/rs6000/mpc.md, + config/rs6000/netbsd.h, config/rs6000/power4.md, + config/rs6000/rios1.md, config/rs6000/rios2.md, + config/rs6000/rs6000-c.c, config/rs6000/rs6000-modes.def, + config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, + config/rs6000/rs6000.h, config/rs6000/rs6000.md, + config/rs6000/rs64.md, config/rs6000/rtems.h, config/rs6000/spe.h, + config/rs6000/spe.md, config/rs6000/sysv4.h, + config/rs6000/sysv4le.h, config/rs6000/vxworks.h, + config/rs6000/windiss.h, config/rs6000/xcoff.h: Likewise. + +2003-04-13 Nick Clifton + + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Delete + support for -mcall-aix switch. + * config/rs6000/eabiaix.h: Delete. + * config/rs6000/rs6000.h (rs6000_abi): Remove ABI_AIX_NODESC. + (RS6000_REG_SAVE, RS6000_SAVE_AREA, FP_ARGS_MAX_REG, + RETURN_ADDRESS_OFFSET): Remove use of ABI_AIX_NODESC. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Likewise. + * config/rs6000/rs6000.c (print_operand, rs6000_stack_info, + debug_stack_info, output_function_profiler, + rs6000_trampoline_size, rs6000_initialise_trampoline): Likewise. + * config/rs6000/rs6000.md (call, call_value, call_nonlocal_sysv, + call_indirect_nonlocal_sysv, call_value_indirect_nonlocal_sysv, + call_value_nonlocal_sysv, sibcall_value_nonlocal_sysv, + sibcall_nonlocal_sysv, sibcall_value_local64): Likewise. + * config/rs6000/t-ppcgas (MULTILIB_OPTIONS): Remove mcall-aix + multilibs. + (MULTILIB_DIRNAMES): Remove mcall-aix directories. + (MULTILIB_EXCEPTIONS): Delete. + (MULTILIB_MATCHES): Remove mcall-aix matches. + + * doc/fragments.texi: Replace -mcall-aix example with an ARM + one. + * doc/install.texi: Delete powerpc-*-eabiaix target. + * doc/invoke.texi: Remove documentation of mcall-aix switch. + * doc/tm.texi: Remove mcall-aix from example CPP_SPEC. + * config.gcc: Delete powerpc-*-eabiaix target. + +2003-04-13 Kazu Hirata + + * doc/invoke.texi: Fix typos. + * doc/tm.texi: Likewise. + +2003-04-12 Zack Weinberg + + * c-typeck.c (digest_init, push_init_level): Use CONSTRUCTOR_ELTS. + +2003-04-12 Zack Weinberg + + * tree.c (build_constructor): New function. + * tree.h: Prototype it. + + * c-typeck.c (build_c_cast, pop_init_level) + * profile.c (build_function_info_value, build_gcov_info_value) + (create_profiler): + Use build_constructor. + + * builtins.c (expand_builtin_args_info): Remove #if 0 blocks. + + * objc/objc-act.c (build_constructor): + Rename objc_build_constructor. Use build_constructor. + (build_objc_string_object, objc_add_static_instance) + (init_def_list, init_objc_symtab, init_module_descriptor) + (generate_static_references, build_selector_translation_table) + (build_descriptor_table_initializer, generate_descriptor_table) + (build_protocol_initializer, build_ivar_list_initializer) + (generate_ivars_list, build_dispatch_table_initializer) + (generate_dispatch_table, generate_protocol_list) + (build_category_initializer, build_shared_structure_initializer): + Update to match. + +2003-04-12 Zack Weinberg + + * intl.h: #define gcc_gettext_width to strlen when !ENABLE_NLS. + +2003-04-12 Stephane Carrez + + * config/m68hc11/m68hc11-protos.h + (m68hc11_eq_compare_operator): Declare + * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register new predicate. + * config/m68hc11/m68hc11.c (m68hc11_eq_compare_operator): New predicate + (d_register_operand): Check the operand mode. + (hard_addr_reg_operand): Likewise. + +2003-04-12 Stephane Carrez + + * config/m68hc11/m68hc11.md ("decrement_and_branch_until_zero"): New + pattern for dbcc/ibcc generation for 68HC12. + ("doloop_end"): New pattern. + ("m68hc12_dbcc_dec_hi"): New pattern for dbeq/dbne. + ("m68hc12_dbcc_inc_hi"): New pattern for ibeq/ibne. + ("m68hc12_dbcc_dec_qi"): New pattern. + ("m68hc12_dbcc_inc_qi"): New pattern. + (split): Add split for the above when we can't use dbcc/ibcc due to + reloading. + (peephole2): Add peephole2 to generate the above when possible. + +2003-04-12 Stephane Carrez + + * config/m68hc11/m68hc11.md ("bitcmpqi" split): No need to test the + mode of operand 0. + (peephole2 optimize const load): Likewise for operand 2. + ("*rotlhi3_with_carry"): Change pattern to a const 1 rotate which + clobbers CC_REGNUM. + ("*rotrhi3_with_carry"): Likewise. + (ashift:DI 1 split): Update pattern to create the above rotate. + (lshiftrt:DI 1 split): Likewise. + +2003-04-12 Stephane Carrez + + * config/m68hc11/m68hc11.md (SOFT_Z_REGNUM): New constant. + ("tstqi_z_used" split): Use it. + ("cmphi_z_used"): Likewise. + ("bitcmpqi_z_used"): Likewise; also use SP_REGNUM constant. + ("cmpqi_z_used"): Likewise. + +2003-04-12 Mark Mitchell + + PR c++/7910 + * config/i386/winnt.c (i386_pe_mark_dllimport): Fix thinko. + +2003-04-12 Zack Weinberg + + * configure.in: Check for wchar.h, mbstowcs, and wcswidth. + * configure, config.in: Regenerate. + * intl.c (gcc_gettext_width): New function. + * intl.h: Prototype it. + +2003-04-12 Stephane Carrez + + * config/m68hc11/m68hc11.h (TARGET_SWITCHES): Fix -mnominmax option; + recognize -mnorelax. + (reg_class): Add Z_OR_S_REGS to represent soft registers with Z + (REG_CLASS_NAMES): Add its name. + (REG_CLASS_CONTENTS): Define its content. + +2003-04-12 Stephane Carrez + + * config/m68hc11/larith.asm (memcpy): Use ARG macro to access stack + parameters so that offsets are valid for far definition. + (__mulsi3): Likewise and use ret to return. + (___adddi3, ___subdi3, ___notdi2, ): Don't use it to save the result. + +2003-04-12 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_hash_constant): Skip '0' fields. + +2003-04-12 Alexandre Oliva + + * mklibgcc.in (libgcc-stage-start): For every multilib directory + containing a libgcc.a, move lib* to the corresponding stage dir. + + * Makefile.in (stage1-start, stage2-start, stage3-start, + stage4-start): Move $(SPECS) to specs in stage dir. + (unstage1 unstage2 unstage3 unstage4): Move specs in stage dir + back as $(SPECS). + + * mklibgcc.in (libgcc-stage-start): Move into the stage directory + object files from the non-libgcc/ multilib directories as well. + +2003-04-11 Geoffrey Keating + + * profile.c (read_counts_file): Initialise 'checksum'. + + * emit-rtl.c (gen_rtx): Really correct typo. + + PR c++/9393 + * doc/invoke.texi (Debugging Options): Document -frandom-seed. + * configure.in: Check for gettimeofday. + * tree.c (flag_random_seed): Define. + (default_flag_random_seed): New. + (append_random_chars): Use flag_random_seed rather than trying + to acquire randomness here. + * tree.h (default_flag_random_seed): Declare. + * toplev.c (display_help): Add -frandom-seed and -fstack-limit-* + descriptions. + (decode_f_option): Handle -frandom-seed. + (print_switch_values): Call default_flag_random_seed. + * flags.h (flag_random_seed): Declare. + * configure: Regenerate. + * config.in: Regenerate. + * config/alpha/t-crtfm: Use -frandom-seed. + + * doc/extend.texi (Empty Structures): New. + + * c-pch.c: Include flags.h. Add comments to routines. + (struct c_pch_validity): New. + (get_ident): Update PCH file version number. + (pch_init): Output current debugging type. + (c_common_valid_pch): Check debugging type. + * Makefile.in (c-pch.o): Update dependencies. + * flags.h (debug_type_names): Declare. + * toplev.c (debug_type_names): Move out of decode_g_option. + +2003-04-11 Eric Christopher + + * emit-rtl.c (gen_rtx): Fix typos. + +2003-04-11 Richard Henderson + + * emit-rtl.c (gen_rtx): Zero '0' fields. + +2003-04-11 Richard Henderson + + PR c++/10202 + * expr.c (expand_expr): Use COMPLETE_OR_UNBOUND_ARRAY_TYPE_P + not COMPLETE_TYPE_P for re-invoking layout_decl. + +2003-04-11 Simon Law + + * doc/bugreport.texi: Fix paragraph breaking between sections + in preparation for TeXinfo's paragraph indentation fixes. + * doc/extend.texi: Ditto. + * doc/invoke.texi: Ditto. + * doc/objc.texi: Ditto. + * doc/gcov.texi: Wrap 'gcov' in @command{}. + * doc/invoke.texi (Darwin Options): Add a preamble. + +2003-04-11 Richard Henderson + + * config/i386/i386.c (tls_model_chars): Remove. + (ix86_encode_section_info, ix86_strip_name_encoding): Remove. + (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P. + (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL. + (tls_symbolic_operand_1): Likewise. + (legitimate_pic_address_disp_p): Use SYMBOL_REF_LOCAL_P. + * config/i386/i386.h (TARGET_ENCODE_SECTION_INFO): Remove. + (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove. + * config/i386/winnt.c (i386_pe_encode_section_info): Replace + bits "copied from i386.h" with default_encode_section_info. + +2003-04-11 Richard Henderson + + * rtl.def (SYMBOL_REF): Add two 0 fields. + * gengtype.c (adjust_field_rtx_def): Handle them. + * print-rtl.c (print_rtx): Print them. + * rtl.h (SYMBOL_REF_DECL, SYMBOL_REF_FLAGS): New. + (SYMBOL_FLAG_FUNCTION, SYMBOL_REF_FUNCTION_P): New. + (SYMBOL_FLAG_LOCAL, SYMBOL_REF_LOCAL_P): New. + (SYMBOL_FLAG_SMALL, SYMBOL_REF_SMALL_P): New. + (SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_TLS_MODEL): New. + (SYMBOL_FLAG_EXTERNAL, SYMBOL_REF_EXTERNAL_P): New. + (SYMBOL_FLAG_MACH_DEP): New. + * optabs.c (init_one_libfunc): Zap fake SYMBOL_REF_DECL. + * varasm.c (make_decl_rtl): Set SYMBOL_REF_DECL. + (assemble_static_space): Set SYMBOL_REF_FLAGS. + (assemble_trampoline_template): Likewise. + (output_constant_def, force_const_mem): Likewise. + (default_encode_section_info): New. + * output.h: Declare it. + * target-def.h (TARGET_ENCODE_SECTION_INFO): Use it. + +2003-04-11 Richard Henderson + + * libfuncs.h (LTI_setbits, LTI_gcov_flush, LTI_gcov_init): New. + (setbits_libfunc, gcov_flush_libfunc, gcov_init_libfunc): New. + * optabs.c (init_optabs): Initialize them. + (init_libfuncs): Use init_one_libfunc. + * calls.c (expand_call): Use gcov_flush_libfunc. + * expr.c (store_constructor): Use setbits_libfunc. + * function.c (expand_main_function): Use init_one_libfunc. + * profile.c (create_profiler): Use gcov_init_libfunc and DECL_RTL. + +2003-04-11 Mark Mitchell + + * doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT + documentation; add DECL_FRIEND_CONTEXT. + +2003-04-11 John David Anglin + + * doc/install.texi (hppa): Update links for HP-UX patches. Revise + notes on linker selection and configuration for 64-bit HP-UX port. + * doc/invoke.texi (hppa): Remove hppa text from description for + -ffunction-sections and -fdata-sections. Document -static, -nolibdld + and -threads options. + + * pa-hpux10.h (LIB_SPEC): Add link options to resolve dependency of + libc.a on libdld.sl when -static is specified and -nolibdld is not + specified. + * pa64-hpux.h (LIB_SPEC): Likewise. + * pa-hpux11.h (LIB_SPEC): Likewise. + (LINK_SPEC): Add __gcc_plt_call as an undefined symbol when -shared + is not specified. + +2003-04-11 Zack Weinberg + + * config/darwin-c.c (darwin_pragma_unused): Use lookup_name, + not IDENTIFIER_LOCAL_VALUE. + +2003-04-11 Richard Henderson + + PR c/10201 + * expr.c (expand_expr): Move DECL_RTL frobbing ... + * stor-layout.c (layout_decl): ... here. + +2003-04-11 James A. Morrison + + * doc/invoke.texi: Eliminate extra white-space caused by + @gccoptlist{ on its own line. + * doc/invoke.texi: Ensured there are two spaces between each option. + * doc/invoke.texi: Re-wrapped option lines that were too wide. + Added @gol to options that didn't have them. + +2003-04-11 Nathan Sidwell + + * Makefile.in (loop-init.o): Do not depend on gcov-io.h, + gcov-iov.h. + + Simplify interface to gcov reading and writing. + * gcov-io.h (gcov_file, gcov_position, gcov_length, gcov_buffer, + gcov_alloc, gcov_modified, gcov_errored): Move into ... + (struct gcov_var gcov_var): ... this static structure. + (gcov_write_unsigned, gcov_write_counter, gcov_write_string): + Return void. + (gcov_read_unsigned, gcov_read_couter, gcov_read_string): Return + read object. + (gcov_read_bytes, gcov_write_bytes): Set error flag on error. + (gcov_reserve_length): Remove. + (gcov_write_tag): New. + (gcov_write_length): Adjust. + (gcov_read_summary, gcov_write_summary): Adjust. + (gcov_eof, gcov_ok): Rename to ... + (gcov_is_eof, gcov_is_error): ... here. Return error code. + (gcov_save_position, gcov_resync): Rename to ... + (gcov_position, gcov_seek): ... here. + (gcov_skip, gcov_skip_string): Remove. + (gcov_error): Remove. + (gcov_open, gcov_close): Adjust. + * gcov.c (find_source): Take const char *, copy it on allocation. + (read_graph_file): Adjust. + (read_count_file): Adjust. + * libgcov.c (gcov_exit): Adjust. + * gcov-dump.c (tag_function, tag_blocks, tag_arcs, tag_lines, + tag_arc_counts, tag_summary): Return void. Adjust. + (struct tag_format): Adjust proc member. + (dump_file): Adjust gcov calls. + +2003-04-11 Alexandre Oliva + + * Makefile.in (fixinc.sh): Pass BUILD_LIBERTY as LIBERTY to + mkfixinc.sh. + * fixinc/mkfixinc.sh (defs): Add LIBERTY. + * configure.in (STMP_FIXINC, STMP_FIXPROTO): Don't disable on + build != host sysrooted builds. + * configure.in (SYSTEM_HEADER_DIR): Make sure it contains + TARGET_SYSTEM_ROOT even on sysrooted natives. + * configure: Rebuilt. + +2003-04-10 Zack Weinberg + + * c-decl.c (struct binding_level): Add shadowed_tags and + function_body; remove this_block, tag_transparent, and + subblocks_tag_transparent; update comments. + (clear_binding_level, lookup_tag_reverse): Kill. + (make_binding_level): Use ggc_alloc_cleared or memset. + (lookup_tag): Remove struct binding_level* parameter. All + callers changed. Just look at IDENTIFIER_TAG_VALUE, and + current_binding_level->tags if asked for thislevel_only or if + we might have to diagnose "struct foo; union foo;" + (pushlevel): Ignore argument. Do not push another binding + level on the transition from the parameters to the top level + of the function body; just tweak the flags and proceed. + (poplevel): Overhaul. Clear IDENTIFIER_TAG_VALUEs; on exiting + a function body, separate the parameter list from the + top-level local variables. + (set_block): Do nothing. + (pushtag): Set IDENTIFIER_TAG_VALUE and add an entry to + shadowed_tags if necessary. + (warn_if_shadowing): Nuke the special case for local shadowing + parameter. + (pushdecl): Do not create a shadow entry if we are replacing + an older decl in the same binding level. + (pushdecl_function_level): Tweak for new way of indicating + function scope. + (shadow_tag_warned): Use TYPE_NAME, not lookup_tag_reverse. + (start_function): Don't set subblocks_tag_transparent. + (finish_function): Fix up the binding_level stack for totally + empty functions. Otherwise, don't call poplevel. + + * c-common.c (shadow_warning): MANDATORY argument is no longer + necessary. Always use plain warning. + * c-common.h: Update to match. + + * cfglayout.c (scope_to_insns_initialize): Clear block when we + hit the FUNCTION_DECL. + * function.c: Do not create cyclic tree structure. + +2003-04-10 Zack Weinberg + + * c-tree.h (struct lang_identifier): Replace global_value, + local_value members with symbol_value, tag_value. Kill + implicit_decl and limbo_value. + (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_LOCAL_VALUE, + IDENTIFIER_LIMBO_VALUE, IDENTIFIER_IMPLICIT_DECL, + C_MISSING_PROTOTYPE_WARNED): Kill. + (IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE, + C_DECL_IMPLICIT, C_DECL_ISNT_PROTOTYPE): New. + (C_DECL_ANTICIPATED): Rename to C_DECL_INVISIBLE. + (implicit_decl_warning, lookup_name_current_level, + record_function_scope_shadow): Don't prototype. + (pushdecl_function_level): Prototype. + + * c-decl.c (truly_local_externals): New variable. + (struct binding_level): Adjust commentary. + (get_function_binding_level, clear_limbo_values, + record_function_scope_shadow): Kill. + (lookup_name_current_level, implicit_decl_warning): Are now static. + (any_external_decl, record_external_decl): New static functions. + (clone_underlying type): Split out of pushdecl. + (c_print_identifier): Update to match changes to struct + lang_identifier. + (poplevel): Delete #if 0 block. Make externals invisible + instead of clearing their IDENTIFIER_SYMBOL_VALUEs. Don't + call clear_limbo_values. Refer to IDENTIFIER_SYMBOL_VALUE not + IDENTIFIER_GLOBAL_VALUE or IDENTIFIER_LOCAL_VALUE. + (duplicate-decls): For real parm decl after a forward decl, + set TREE_ASM_WRITTEN here. Allow void foo(...) followed by + foo(...) { } with only a warning. Say whether a previous + declaration was implicit. + (warn_if_shadowing): Now handles all shadowing, not just + local-over-local. Clarify comments. + (pushdecl): Rewritten. There is no longer a distinction + between global and local symbol values; they're all + IDENTIFIER_SYMBOL_VALUE. Call record_external_decl on all + DECL_EXTERNAL decls, and use any_external_decl to check + against previous externals. Kill #if 0 blocks. Don't + tolerate error_mark_node being NULL. + (pushdecl_top_level): Handle only those cases which + Objective C (the only user) needs. + (pushdecl_function_level): New function. + (implicitly_declare): Create ordinary decls with + C_DECL_IMPLICIT set. Recycle old decls, however they got + created. + (lookup_name): It's always IDENTIFIER_SYMBOL_VALUE. Return 0 + for C_DECL_INVISIBLE symbols. + (lookup_name_current_level): Likewise. Use chain_member. + (c_make_fname_decl): Don't muck with DECL_CONTEXT. + Use pushdecl_function_level. + (builtin_function): Use C_DECL_INVISIBLE. + (start_function): Don't muck with IDENTIFIER_IMPLICIT_DECL. + Use C_DECL_ISNT_PROTOTYPE and C_DECL_IMPLICIT. + (store_parm_decls): It's IDENTIFIER_SYMBOL_VALUE now. + (identifier_global_value): Same. Must scan + global_binding_level in extremis. + + * c-typeck.c (undeclared_variable): New static function, split + from build_external_ref. + (build_external_ref): Use DECL_CONTEXT, not + IDENTIFIER_LOCAL_VALUE, to decide whether a local hides + an instance variable. Restructure for clarity. + * objc/objc-act.c: Use identifier_global_value, not + IDENTIFIER_GLOBAL_VALUE. + +2003-04-08 Jonathan Wakely + + * doc/extend.texi (Template Instantiation): Refer to ISO standard, + not Working Paper. + * doc/invoke.texi (C++ Dialect Options): Same. + +2003-04-10 Zack Weinberg + + * tree.c (tree_operand_check_failed): New function. + * tree.h (TREE_OPERAND_CHECK, TREE_OPERAND_CHECK_CODE, + TREE_RTL_OPERAND_CHECK): New checking macros. + (TREE_OPERAND, SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL, + RTL_EXPR_SEQUENCE, RTL_EXPR_RTL, WITH_CLEANUP_EXPR_RTL, + CONSTRUCTOR_ELTS, LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY, + EXIT_BLOCK_RETURN, LOOP_EXPR_BODY, EXPR_WFL_NODE, + EXPR_WFL_FILENAME_NODE, EXPR_WFL_FILENAME, TARGET_EXPR_SLOT, + TARGET_EXPR_INITIAL, TARGET_EXPR_CLEANUP): Use the new + checking macros. + +Thu Apr 10 23:52:30 CEST 2003 Jan Hubicka + + PR inline-asm/8803 + * function.c (instantate_virtual_regs): Verify that all ASM statements + match after the virutal regs instantiation. + +2003-04-10 Steve Ellcey + + * ia64-protos.h (addp4_optimize_ok): New. + * ia64.c (addp4_optimize_ok): New. + * ia64.md (*ptr_extend_plus_1): Use addp4_optimize_ok. + (*ptr_extend_plus_2): Ditto. + +2003-04-10 Steve Ellcey + + * expr.c (expand_assignment): Extend offset_rtx with convert_to_mode + not with convert_memory_address. + (store_constructor): Ditto, and same for copy_size_rtx. + (expand_expr): Ditto. + +2003-04-10 Douglas B Rupp + + * config/i386/i386.c (ix86_ms_bitfield_layout_p): Fix formatting. + +2003-04-10 Bob Wilson + + * config/xtensa/lib2funcs.S (__xtensa_sync_caches): Flush data cache + even if it is configured to be write-through. + +2003-04-10 Ulrich Weigand + + * config/s390/s390.c (larl_operand): Do not allow symbols + marked with '@'. + (s390_encode_section_info): Mark symbols with forced 1-byte + alignment with '@'. + (s390_strip_name_encoding): Strip '@'. + (legitimize_pic_address): Handle symbols that are not valid + LARL operands in 64-bit mode. + +2003-04-10 Andrew Haley + + * tree-inline.c (inlinable_function_p): Disable inlining for + synchronized methods. + +2003-04-09 Steven Bosscher + + * c-common.h (lang_statement_code_p): Remove declaration. + (statement_code_p): Ditto. + (c_common_stmt_codes): Define; list of c-common statement codes. + (statement_code_p): New extern declaration. + (STATEMENT_CODE_P): Define. + (INIT_STATEMENT_CODES): Define. + * c-common.c (statement_code_p): Kill the function, declare + as an array of bools instead. + (lang_statement_code_p): Remove. + (walk_stmt_tree): Use STATEMENT_CODE_P not statement_code_p. + (c_safe_from_p): Ditto. + * c-objc-common.c (c_objc_common_init): Use INIT_STATEMENT_CODES + to initialize the statement_code_p array. + * tree-inline.c (walk_tree): Use STATEMENT_CODE_P instead of + statement_code_p. + (copy_tree_r): Ditto. + * cp/cp-tree.h (cp_stmt_codes): Define; list of C++ specific + statement tree codes. + * cp/lex.c (cxx_init): Add missing print line break. Use + INIT_STATEMENT_CODES to initialize the statement_code_p array. + * cp/parser.c (cp_parser_statement): Use STATEMENT_CODE_P + instead of statement_code_p. + * cp/pt.c (tsubst_expr): Ditto. + * cp/tree.c (verify_stmt_tree_r): Ditto. + (cp_statement_code_p): Remove. + (init_tree): Don't set lang_statement_code_p, it's gone. + +2003-04-09 Dan Nicolaescu + Zack Weinberg + + * regrename.c (struct du_chain): Use a bitfield for reg_class. + * cse.c (struct qty_table_elem, struct table_elt, struct set): + Use bitfields for fields holding enum rtx_code or + enum machine_mode values. Add comments explaining size choices. + +2003-04-09 Alexandre Oliva + + * config/fp-bit.c (unpack_d): Handle pair of doubles with + different signs correctly. + +2003-04-09 Vladimir Makarov + + * sched-deps.c (reg_pending_barrier_mode): New enumeration. + (reg_pending_barrier): Make it of the enumeration type. + (sched_analyze_2): Define the barrier as MOVE_BARRIER or + TRUE_BARRIER. + (sched_analyze): Ditto. + (sched_analyze_insn): Ditto. Use anti-dependencies for + MOVE_BARRIER and true-dependencies as TRUE_BARRIER. + (init_deps_global): Initialize the barrier as NO_BARRIER. + +2003-04-09 Vladimir Makarov + + * config/ia64/ia64.c (issue_nops_and_insn): Add new parameter. + Check that asm insn starts on a new cycle. Add nops after asm + insn to end bundle. + (bundling): Move insn type evaluation from the loop. Call + issue_nops_and_insn with the new parameter. Ignore changing + position for nops after asm insn. + +2003-04-09 Alexandre Oliva + + * optabs.c: Comment that gen_add2_insn and others may actually + return emitted insns, if the gen functions turn out to return + emitted insns. + * reload1.c (reload_cse_move2add): Cope with emitted insns from + gen_add2_insn. + +2003-04-09 Richard Henderson + + * config/ia64/ia64.c (move_operand): Allow symbolic_operand, + but not tls_symbolic_operand. + (ia64_expand_load_address): Remove scratch operand. + (ia64_expand_tls_address): Split out from ia64_expand_move. + (ia64_expand_move): Split symbolics only after reload. + (ia64_emit_cond_move): New. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.md (movsi_symbolic, movdi_symbolic): Remove. + (symbolic splitter): Accept SImode operands too. + (cmove splitter): Use ia64_emit_cond_move. + +2003-04-09 Nick Clifton + + * doc/install.texi: Note that ARM toolchains need binutils 2.13 or + newer. + * config/arm/elf.h (SUBTARGET_ASM_FLOAT_SPEC): Pass -mfpu=softfpa + instead of -mno-fpu. + * config/arm/semi.h (ASM_SPEC): Likewise. + * config/arm/xscale-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise, + but only if -msoft-float is specified pass. Otherwise pass + -mfpu=softvfp. + +2003-04-09 Zdenek Dvorak + + * function.c (purge_addressof): Use free_INSN_LIST_node instead of + free_EXPR_LIST_node. + +2003-04-08 Roger Sayle + + * fold-const.c (fold): Use "fold" following build in more places. + Optimize sqrt(x)*sqrt(x) as x, pow(x,y)*pow(z,y) as pow(x*z,y), + pow(x,y)*pow(x,z) as pow(x,y+z) and x/pow(y,z) as x*pow(y,-z). + +2003-04-08 Roger Sayle + + * builtins.c (fold_builtin): Constant fold expressions as x*0.5 + instead of x/2.0. Optimize sqrt(pow(x,y)) as pow(x,y*0.5), + log(pow(x,y)) as y*log(x), pow(exp(x),y) as exp(x*y), + pow(sqrt(x),y) as pow(x,y*0.5) and pow(pow(x,y),z) as pow(x,y*z). + Delete function scope "fcode" variable to avoid shadowing. + +2003-04-08 Kevin Buettner + + * dwarf2out.c (DWARF_ARANGES_HEADER_SIZE, DWARF_ARANGES_PAD_SIZE): + Take into account DWARF_INITIAL_LENGTH_SIZE. + +2003-04-08 Hans-Peter Nilsson + + * reorg.c (fill_slots_from_thread): When considering changing the + insn following a reg-to-reg copy insn to use the source reg of the + copy, bail out if there's overlap between the registers. + +2003-04-08 Zdenek Dvorak + + * function.c (postponed_insns): New. + (purge_addressof_1): Postpone processing of insns if addressofs + are not put into stack. + (purge_addressof): Process postponed insns. + +2003-04-08 J"orn Rennecke + + * sh.h (NORMAL_MODE): If interrupt handler and TARGET_FMOVD, + this is FP_MODE_DOUBLE . + * sh.c (ra.h): #include. + (push_regs): Add second parameter. Changed all callers. + If necessary, set fpscr before saving floating point registers. + (calc_live_regs): If interrupt handler and TARGET_FMOVD, always + do saves / restores with SZ == 1. + (sh_expand_prologue): If interrupt handler, don't use gen_toggle_sz. + (sh_expand_epilogue): Likewise. For TARGET_FMOVD, if floating point + registers are being restored, restore FPSCR only after restoring them. + +2003-04-08 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_init_builtins): Set opaque types + regardless of architecture. + (spe_init_builtins): Change V2SI and V2SF types to opaque types. + +2003-04-08 J"orn Rennecke + + * sh.c (push_regs, calc_live_regs): Return int. Take single + HARD_REG_SET * parameter. Changed all callers. + +Tue Apr 8 11:12:07 CEST 2003 Jan Hubicka + + * i386.c (legitimate_pic_address_disp_p): Do not accept PLUS in the + GOTOFF operand. + (legitimize_pic_address): Move plus outside the unspec. + * i386.c (legitimate_constant_p): Check (CONST (PLUS (UNSPEC ... + for validity. + +2003-04-08 Nathan Sidwell + + * gcov-io.h (gcov_save_position): Remove __inline__ from + declaration. + +2003-04-07 Matt Kraai + + * doc/install.texi: Use @command and @samp for single- and + multi-word commands respectively. + * doc/makefile.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + +2003-04-07 Christian Ehrhardt + Richard Henderson + + PR c/9516 + * expr.c (safe_from_p): Rearrange to avoid deep recursion in + favor of looping and tail recursion for TREE_LIST and binops. + +2003-04-08 Zdenek Dvorak + + * loop.h (REGNO_FIRST_LUID, REGNO_LAST_LUID): Provide defaults + for insns without luid. + +2003-04-07 Glen Nakamura + + PR opt/8634 + * explow.c (maybe_set_unchanging): Don't flag non-static const + aggregate type initializers with RTX_UNCHANGING_P. + +2003-04-07 Richard Henderson + + PR opt/8634 + * function.c (purge_addressof_1): Don't try arithmetics for + unchanging memories. + +2003-04-07 Janis Johnson + + * doc/sourcebuild.texi (Test Suites): Document testing support for + gcov and profile-directed optimizations; describe gcc.misc-tests. + +Mon Apr 7 22:19:59 CEST 2003 Jan Hubicka + + PR target/10077 + * i386.md (movsi_1, movsi_nointerunit_1): Fix SSEMOV alternative. + +2003-04-07 Eric Botcazou + + * doc/rtl.texi (Comparison operations): Update to + record the allowed comparison modes. + +2003-04-07 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_common_init_builtins): Rename all + V2SI_type_node to opaque_V2SI_type_node. Rename all + V2SF_type_node to opaque_V2SF_type_node. + (rs6000_init_builtins): Define opaque_V2SI_type_node and + opaque_V2SF_type_node. + (is_ev64_opaque_type): The types opaque_V2SI_type_node and + opaque_V2SF_type_node are opaque types. + +2003-04-07 J"orn Rennecke + + * gcse.c (replace_store_insn): Use single_set. + +2003-04-07 Nathan Sidwell + + Change gcov file interface to single file at a time. + * gcov-io.h: Replace IN_LIBGCC1 with IN_LIBGCOV. Use IN_GCOV. + Convert to C89 prototypes. + (gcov_file, gcov_length, gcov_position, gcov_buffer, gcov_alloc, + gcov_error, gcov_modified): New static variables. + (gcov_open, gcov_close, gcov_read_bytes, gcov_write_bytes): New + functions. + (gcov_write_unsigned, gcov_write_counter, gcov_write_string, + gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust. + (gcov_read_summary, gcov_write_summary): Adjust. + (gcov_save_position, gcov_reserve_length, gcov_write_length): + Adjust. + (gcov_resync, gcov_skip, gcov_skip_string): Adjust. + (da_file_open, da_file_close, da_file_eof, da_file_error): Remove. + (da_file_position, da_file_seek, da_file_write, da_file_read): + Remove. + (gcov_error, gcov_eof, gcov_ok, gcov_time): New functions. + * gcov.c (gcov_type): Don't typedef here. + (IN_GCOV): #define + (read_graph_file, read_count_file): Adjust. + * gcov-dump.c (gcov_type): Don't typedef here. + (IN_GCOV): #define. + (tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts): + Remove FILE parameter, adjust. + (struct tag_format): Adjust proc member. + (dump_file): Adjust. + * libgcov.c (IN_LIBGCOV): #define. + (gcov_exit): Adjust. + * loop-init.c: Don't #include gcov-io.h + * profile.c (struct counts_entry): New structure to hold counter + values. + (struct section_reference, struct da_index_entry): Remove. + (bbg_file, da_file): Remove. + (htab_counts_index_hash, htab_counts_index_eq, + htab_counts_index_del): Replace with ... + (htab_counts_entry_hash, htab_counts_entry_eq, + htab_counts_entry_del): ... these. + (cleanup_counts_index, index_counts_file): Remove. + (read_counts_file): New function. + (get_exec_counts): Adjust. + (compute_branch_probabilities): Don't free the exec counts here. + (branch_prob): Adjust. + (init_branch_prob): Adjust. + (end_branch_prob): Adjust. + +2003-04-07 Aldy Hernandez + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document + -mfloat-gprs. + + * config/rs6000/rs6000.c: Delete rs6000_fprs. + Declare rs6000_float_gprs. + Declare rs6000_float_gprs_string. + (rs6000_parse_float_gprs_option): New. + (rs6000_override_options): Genericize rs6000_parse_* calls to use + rs6000_parse_yes_no_option. + Change check for cpu=8540, to use TARGET_E500. + (rs6000_parse_isel_option): Delete. + (rs6000_parse_spe_option): Delete. + (rs6000_parse_vrsave_option): Delete. + + * config/rs6000/rs6000.h: Rename rs6000_fprs to rs6000_float_gprs. + Define rs6000_float_gprs_string. + (TARGET_OPTIONS): Add rs6000_float_gprs option. + + * config/rs6000/eabi.h (TARGET_FPRS): Change to use rs6000_float_gprs. + + * config/rs6000/eabispe.h: Set rs6000_float_gprs. + +Mon Apr 7 14:36:24 CEST 2003 Jan Hubicka + + PR opt/10024 + * cfglayout.c (cfg_layout_redirect_edge): + Redirect any branch edges unified with the fallthru one. + * cfgrtl.c (force_nonfallthru_and_redirect): Do not special + case fallthru edges when called via cfglayout.c + +2003-04-07 J"orn Rennecke + + * c-typeck.c (output_init_element): Check for type == error_mark_node. + +2003-04-07 Kazu Hirata + + * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Always + split. + (a splitter): Do zero-extension via HImode. + +2003-04-07 James A. Morrison + + * doc/invoke.texi: Eliminate extra white-space caused by + @gccoptlist{ on its own line. + * doc/invoke.texi: Ensured there are two spaces between each option. + * doc/invoke.texi: Re-wrapped option lines that were too wide. + Added @gol to options that didn't have them. + +2003-04-07 James A Morrison + + * doc/extend.texi (Darwin Pragmas): Fix spelling of Mac OS. + +2003-04-06 Zack Weinberg + + * tree.c (tree_size): For all 'c' and 'x' nodes, look directly + at the sizes of the relevant structures, rather than relying + on TREE_CODE_LENGTH. Call lang_hooks.tree_size to get the + sizes of any such we don't know about. Use + lang_hooks.identifier_size for IDENTIFIER_NODE. + + (initializer_zerop): Use CONSTRUCTOR_ELTS. + * tree.def: Update commentary. Make fourth element of + the definition for all 'c' and 'x' nodes zero. + + * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE. + * langhooks-def.h: Update to match. + * langhooks.c: New default, lhd_tree_size. + + * c-common.def (SRCLOC): Kill. + * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]): + Remove entirely - was already #if-ed out. + + +2003-04-06 Zack Weinberg + + * mklibgcc.in: Use a here document to avoid running afoul of + shells that generate control-A from "echo \1". + +2003-04-06 Aldy Hernandez + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mspe + option. + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Set + rs6000_spe. + + * config/rs6000/eabi.h (TARGET_E500): Define. + + * config/rs6000/rs6000.h (TARGET_E500): Define. + (TARGET_OPTIONS): Add spe= option. + Declare rs6000_spe and rs6000_spe_string extern. + + * config/rs6000/rs6000.c (branch_positive_comparison_operator): + Change TARGET_SPE to TARGET_E500. + (ccr_bit): Change TARGET_SPE to TARGET_E500. Check for + !TARGET_FPRS. + (print_operand): Same. + (rs6000_generate_compare): Same. + (output_cbranch): Same. + (rs6000_spe): Declare. + (rs6000_spe_string): Declare. + (rs6000_override_options): Call rs6000_parse_spe_option. + (rs6000_parse_spe_option): New. + +2003-04-06 Steven Bosscher + + * hashtable.c (gcc_obstack_init): Delete this function + and everything related to it. + * hashtable.h: Remove prototype. + * bitmap.c (bitmap_element_allocate): Cleanup redundant + defines. Cleanup some unnecessary whitespace. + * defaults.h (obstack_chunk_alloc): Redefine with + appropriate casts for libiberty obstacks. + (obstack_chunk_free): Ditto. + (OBSTACK_CHUNK_SIZE): Define, default to 0. + (gcc_obstack_init): Define as a call to _obstack_begin. + * tree.c (print_obstack_statistics): Delete this unused + function. + * tree.h (obstack): Don't forward-declare. + (print_obstack_statistics): Delete prototype. + (print_obstack_name): Ditto. + (gcc_obstack_init): Ditto. + * rtl.h (gcc_obstack_init): Ditto. + * java/jv-scan.c (gcc_obstack_init): Delete this + function, its prototype and related defines. + * java/jvgenmain.c (gcc_obstack_init): Delete this + function, and related defines. + * java/parse-scan.y (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Ditto + +2003-04-06 Geoffrey Keating + + * dbxout.c (dbxout_handle_pch): Move prototype out from + #if defined DBX_DEBUGGING_INFO. + +2003-04-05 Nathan Sidwell + + * gcov.c (struct arc_info): Replace local_span with cycle. + (struct block_info): Replace u.span with u.cycle. Add is_call_return. + (solve_flow_graph): Set is_call_return. + (add_line_counts): Adjust. In block mode, blocks attach to last line. + (accumulate_line_counts): Find graph cycles, not spanning tree. + (output_branch_count): Adjust. + (output_lines): Adjust. + * doc/gcov.texi: Update. + +2003-04-06 Kazu Hirata + + * config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Change + the second alternative to "#". + +2003-04-05 Kazu Hirata + + * config/h8300/h8300.c (single_one_operand): Use GET_MODE_MASK. + (single_zero_operand): Likewise. + +2003-04-05 Daniel Berlin + + * Makefile.in (df.o): Depend on alloc-pool.h, not obstack.h. + * df.c: Include alloc-pool.h, not obstack.h. + (df_ref_obstack): Remove. + (df_ref_pool, df_link_pool): Add pools. + (df_alloc): Init the new pools. + (df_free): And free them. + (df_link_create): Use the pools. + (df_ref_create): Ditto. + +2003-04-05 Kazu Hirata + + * simplify-rtx.c: Fix formatting. + +2003-04-05 Andrew Pinski + + * config/rs6000/rs6000.c (addrs_ok_for_quad_peep): Allow addr2 + reg with reg1 == reg2 and offset1 = -8. + +2003-04-05 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Halve Power4 + multiply costs. Correct Power4 divide costs. + * config/rs6000/power4.md: Restore multiply and FP latency. + +2003-04-05 Zdenek Dvorak + + * alias.c (find_base_term): Export. + * rtl.h (find_base_term): Declare. + * gcse.c (find_moveable_store): Test for flag_non_call_exceptions + instead of flag_exceptions. Move test for parameter passing ... + (store_killed_in_insn): ... here. + +2003-04-05 Gerald Pfeifer + + PR bootstrap/10267 + * doc/install.texi (*-*-solaris2): /bin/ksh is not just recommended + for configuring. + +2003-04-04 Geoffrey Keating + + * dbxout.c (scope_labelno): Add GTY. + (have_used_extensions): Add GTY. + (source_label_number): Add GTY. + (lastfile): Add GTY. + (lastfile_is_base): New. + (base_input_file): New. + (dbxout_handle_pch): New. + (dbx_debug_hooks): Add handle_pch. + (xcoff_debug_hooks): Likewise. + (dbxout_function_end): Remove scope_labelno. + (dbxout_init): Set base_input_file. + (dbxout_handle_pch): New. + (dbxout_source_file): Honour lastfile_is_base. + * dwarfout.c (dwarf_debug_hooks): Add dummy handle_pch. + * sdbout.c (sdb_debug_hooks): Add dummy handle_pch. + * vmsdbgout.c (vmsdbg_debug_hooks): Add dummy handle_pch. + * dwarf2out.c (dwarf2_debug_hooks): Add dummy handle_pch. + * debug.c (do_nothing_debug_hooks): Add dummy handle_pch. + * debug.h (struct gcc_debug_hooks): Add handle_pch. + * c-pch.c (pch_init): Don't call start_source_file, but do call + handle_pch. + (c_common_write_pch): Call handle_pch. + (c_common_read_pch): Don't call start_source_file, + or end_source_file. + +Fri Apr 4 17:43:52 2003 Olivier Hainque + + * emit-rtl.c (get_mem_attrs): Adjust alignment tests determining + use of default attributes to agree MEM_ALIGN macro. + +Fri Apr 4 17:33:24 2003 Joel Brobecker + + * dbxout.c (dbxout_type): When printing type index of range type + whose bounds are printed in octal format, print type of parent type if + it exists so enumerated type descriptions are not transformed + into unsigned types. + +2003-04-04 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + compute_a_shift_cc. + * config/h8300/h8300.c (shift_one): Update the CC status. + (shift_two): Likewise. + (output_a_shift_cc): Set cc_inline and cc_special. + (compute_a_shift_cc): New. + * config/h8300/h8300.md (shift insns): Use compute_a_shift_cc. + +2003-04-04 Richard Henderson + + * cse.c (fold_rtx): Fix 03-30 change; do check insn non-null. + +2003-04-04 Loren James Rittle + + * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New. + * fixinc/fixincl.x: Rebuilt. + * fixinc/tests/base/stdio.h: Regenerated. + +2003-04-04 Nathan Sidwell + + * gcov.c (accumulate_line_counts): Fix span tree merge bug. + +Fri Apr 4 15:58:52 2003 J"orn Rennecke + + * sh.h (ACTUAL_NORMAL_MODE): New macro, broken out of + (NORMAL_MODE). + * sh.c (fpscr_set_from_mem): Use ACTUAL_NORMAL_MODE. + +2003-04-04 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add entries for Wolfgang + Bangerth, DJ Delorie, Christian Ehrhardt, Christopher Faylor, + Nathanael Nerode, Diego Novillo, Hartmut Penner, Volker Reichelt, + Danny Smith, and Ulrich Weigand. + Update Kriang Lerdsuwanakij and fix a typo in Janis Johnson's + entry. + +2003-04-04 Nick Clifton + + * config/sparc/sol2-bi.h: Revert previous delta. + * config/sparc/sol2-gas-bi.h (AS_SPARC64_FLAG): Prepend -TSO + +2003-04-04 Nick Clifton + + * config/v850/v850.c (expand_prologue): Only use register save + helper functions if long calls are not being used. + Add a clobber of r11 id using long calls. + (pattern_is_ok_for_prologue): Account for the extra clobber. + (construct_save_jarl): Likewise. + * config/v850/v850.md (prolog pattern): Do not use this pattern + for v850e's. + +2003-04-04 Andreas Schwab + + * stor-layout.c (layout_decl): Avoid syntax error in last change + when PCC_BITFIELD_TYPE_MATTERS is defined but not + EMPTY_FIELD_BOUNDARY. + +2003-04-03 Jason Merrill + + PR c/10175 + * jump.c (never_reached_warning): Revert patch of 2002-11-02. + Look backwards for a line note. + +2003-04-03 Neil Booth + + * fix-header.c (read_scan_file): Defer switch processing. + +2003-04-03 Matt Austern + + * cpppch.c (reset_ht): Remove. + (cpp_read_state): Remove loop to reset hashtable identifiers. + * ggc-common.c (gt_pch_save): Add call to gt_pch_fixup_stringpool + after pch file is written. + * ggc.h (gt_pch_fixup_stringpool): Declare. + * stringpool.c (ht_copy_and_clear): Define. Callback. Copy + hashnode's value to another hashtable, then clear the original. + (saved_ident_hash): Define. + (gt_pch_save_stringpool): Create saved_ident_hash, use it to + store definitions in ident_hash, and clear ident_hash. + (gt_pch_fixup_stringpool): Define. Restore definitions from + saved_ident_hash to ident_hash, then destroy saved_ident_hash. + +Thu Apr 3 22:27:40 CEST 2003 Jan Hubicka + + * cfgrtl.c (update_bb_for_insn): Do not set block for barriers. + +2003-04-03 Eric Botcazou + + PR optimization/10157 + * gcse.c (can_copy_p): Rename it to can_copy. + (can_copy_init_p): Remove. + (compute_can_copy): Use can_copy instead of can_copy_p. + (can_copy_p): New exported function. Call compute_can_copy. + (hash_scan_set): Use it. + (gcse_main): Don't call compute_can_copy. + (bypass_jumps): Don't call compute_can_copy. + * rtl.h (can_copy_p): Declare. + * loop.c (scan_loop): Don't move the source and add a reg-to-reg + copy if the mode doesn't support copy operations. + +2003-04-03 Jason Merrill + + * Makefile.in (unstrap): Also remove stage_last. + + * dwarf2out.c (lookup_filename): Don't check for "". + (dwarf2out_source_line): Don't do anything if line==0. + + * stor-layout.c (do_type_align): New fn, split out from... + (layout_decl): ...here. Do all alignment calculations for + FIELD_DECLs here. + (update_alignment_for_field): Not here. + (start_record_layout, debug_rli): Remove unpadded_align. + * tree.h (struct record_layout_info_s): Remove unpadded_align. + * c-decl.c (finish_enum): Don't set DECL_SIZE, DECL_ALIGN + or DECL_MODE on the CONST_DECLs. + (finish_struct): Don't mess with DECL_ALIGN. + +Thu Apr 3 18:57:19 CEST 2003 Jan Hubicka + + * i386.c (print_operand): Do not bypass output_addr_const at flag_pic. + +Thu Apr 3 17:08:09 2003 J"orn Rennecke + + * sh.c (sh_function_ok_for_sibcall): Return 0 if the current + function is an interrupt handler. + + * sh.c (sh_expand_epilogue): Avoid clash of temp register for + restoring target registers with EH_RETURN_STACKADJ_RTX; use + multiple registers in round-robin fashion. + +2003-04-03 Kaveh R. Ghazi + + * gengtype-lex.l (IWORD): Add CHAR_BITFIELD. + * system.h (CHAR_BITFIELD): New. + +2003-04-03 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Generalize to accept GT + and LE. + (another peephole2): Likewise. + +2003-04-03 Nick Clifton + + * config/sparc/sol2-bi.h (ASM_CPU64_DEFAULT_SPEC): Add -TSO. + (DEF_ARCH64_SPEC): Likewise. + +Thu Apr 3 09:53:40 CEST 2003 Jan Hubicka + + * i386.c (constant_address_p): Use legitimate_constant_p. + (legitimate_address_p): Do not use CONSTANT_ADDRESS_P. + +2003-04-02 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + gtle_operator. + * config/h8300/h8300.c (gtle_operator): New. + * config/h8300/h8300.h (PREDICATE_CODES): Add an entry for + gtle_operator. + * config/h8300/h8300.md (a peephole2): Generalize to accept GT + and LE. + +2003-04-02 Richard Henderson + + * libgcc-std.ver (_Unwind_GetCFA): New. + * unwind-dw2.c (_Unwind_GetCFA): New. + * unwind-libunwind.c (_Unwind_GetCFA): New. + * unwind-sjlj.c (_Unwind_GetCFA): New. + * unwind.h: Declare it. + +Thu Apr 3 00:31:21 CEST 2003 Jan Hubicka + + PR inline-asm/8088 + * i386.c (ix86_hard_regno_mode_ok): Return 0 for MMX/SSE registers + when MMX/SSE is not available. + +2003-04-02 Mike Stump + + * doc/install.texi (Specific): Update pointers to apple.com. + +Thu Apr 3 00:18:49 CEST 2003 Jan Hubicka + + * i386.c (override_options): Disable red zone by default on i386. + (compute_frame_layout, ix86_force_to_memory, ix86_free_from_memory): + Do not test TARGET_64BIT together with TARGET_RED_ZONE + +2003-04-02 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Tighten the condition. + +2003-04-02 Richard Henderson + + * longlong.h (umul_ppmm) [alpha]: Use __builtin_alpha_umulh. + +2003-04-02 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-04-02 Richard Henderson + + * except.c (sjlj_find_directly_reachable_regions): Recognize when + must-not-throw region has been deleted. + +2003-04-02 Richard Henderson + + * dwarf2out.c (output_call_frame_info): Ignore fde->nothrow as an + optimization when flag_exceptions not enabled. + +2003-04-02 Vladimir Makarov + + * config/rs6000/rs6000.c + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Redefine the + macros. + (rs6000_issue_rate): Add case for 8540. + (rs6000_use_sched_lookahead): New function. + + * config/rs6000/8540.md: Rename SIU units into SU ones and MIU + units into MU ones. + (ppc8540_branch, ppc8540_cr_logical): Add one cycle in the + reservation before retirement. + (ppc8540_multiply, ppc8540_load, ppc8540_store, + ppc8540_simple_float, ppc8540_vector_load, ppc8540_vector_store): + Remove additional cycle in the reservation before retirement. + (ppc8540_mfcr, ppc8540_mtcrf, ppc8540_mtjmpr): Add missed + reservation of ppc8540_issue. + +2003-04-02 Andreas Schwab + + * real.c (decode_ieee_single): Fix decoding of SNaN bit. + +2003-04-01 Richard Henderson + + * except.c (convert_from_eh_region_ranges_1): Smash REG_EH_REGION + notes for nothrow calls if flag_forced_unwind_exceptions. + (build_post_landing_pads): Mind flag_forced_unwind_exceptions. + (sjlj_find_directly_reachable_regions): Likewise. + (reachable_handlers): Likewise. + (can_throw_external): Likewise. + (collect_one_action_chain): Record cleanups after catch-all and + must-not-throw if flag_forced_unwind_exceptions. + * flags.h (flag_forced_unwind_exceptions): Declare. + * toplev.c (flag_forced_unwind_exceptions): New. + (lang_independent_options): Add it. + * doc/invoke.text: Add it. + +2003-04-01 David Mosberger + + * config/ia64/crti.asm: Clean up trailing whitespace. + Remove trailing hashes (#) from identifiers. + + * config/ia64/crtn.asm: Ditto. + + * config/ia64/crtend.asm: Remove trailing hashes (#) from + identifiers. + (__do_global_ctors_aux): Align to 32-byte boundary. Add unwind + directives. Drop explicit bundling---it just makes the code + harder to read. Don't save/restore gp needlessly. + + * config/ia64/crtbegin.asm: Remove trailing hashes (#) from + identifiers (they're only needed if the identifier would clash + with a register name otherwise). + (__do_global_dtors_aux): Align to 32-byte boundary. Add unwind + directives. Drop explicit bundling---it just makes the code + harder to read. + (__do_jv_register_classes): Ditto. + (.fini_array): Remove "progbits" (newer + assemblers don't like wrong section-types). + (.init_array): Ditto. + +2003-04-01 Roger Sayle + + PR fortran/9974 + * gcse.c (reg_killed_on_edge): New function to test whether the + given reg is overwritten by any instruction queued on an edge. + (bypass_block): Ignore substitutions killed on incoming edges. + Don't bypass outgoing edges that have queued instructions. + +2003-04-01 Alexandre Oliva + + * real.h (EXP_BITS): Make room for... + (struct real_value): ... added canonical bit. + (struct real_format): Added pnan. + (mips_single_format, mips_double_format, mips_extended_format, + mips_quad_format): New. + * real.c: Copy p to pnan in all formats. + (get_canonical_qnan, get_canonical_snan): Set canonical bit. + (real_nan): Use pnan to compute significand's shift. + (real_identical): Disregard significand in canonical + NaNs. + (real_hash): Likewise. Take signalling into account. + (encode_ieee_single, encode_ieee_double, encode_ieee_quad): + Disregard significand bits in canonical NaNs. Set all bits of + canonical NaN if !qnan_msb_set. + (encode_ibm_extended, decode_ibm_extended): Likewise. Use + qnan_msb_set to tell the base double format. + (ibm_extended_format): Use 53 as pnan. + (mips_single_format, mips_double_format, mips_extended_format, + mips_quad_format): Copied from the corresponding ieee/ibm + formats, with qnan_msb_set false. + * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Use mips_extended_format. + * config/mips/linux64.h (MIPS_TFMODE_FORMAT): Use mips_quad_format. + * config/mips/mips.c (override_options): Use mips_single_format + and mips_double_format. Default TFmode to mips_quad_format. + * config/mips/t-linux64 (tp-bit.c): Define QUIET_NAN_NEGATED. + * config/mips/t-irix6: Likewise. + * config/mips/t-mips (fp-bit.c, dp-bit.c): Likewise. + * config/fp-bit.c (pack_d, unpack_d): Obey it. + +2003-04-01 Geoffrey Keating + + * unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New. + (live_image_destructor): Reset image to initial state. + (examine_objects): Set DESTRUCTOR_MAY_BE_CALLED_LIVE. + +2003-04-01 Eric Botcazou + + * config/sparc/sparc.c (input_operand): Accept bare + CONSTANT_P_RTX operands. + +2003-04-01 Zdenek Dvorak + + * gcse.c (struct ls_expr): Added pattern_regs field. + (ldst_entry): Initialize it. + (extract_mentioned_regs, extract_mentioned_regs_helper): New. + (store_ops_ok): Use regs precomputed by them. + (find_loads, store_killed_in_insn, load_kills_store): Change return + type to bool. + (store_killed_before, store_killed_after): Take position of register + set in account. + (reg_set_info): Store position of the setter. + (gcse_main): Enable store motion. + (mems_conflict_for_gcse_p): Enable load motion of non-symbol mems. + (pre_insert_copy_insn, update_ld_motion_stores, insert_store): Prevent rtl + sharing. + (simple_mem): Enable store motion of non-symbol mems. + (regvec): Type changed. + (LAST_AVAIL_CHECK_FAILURE): New. + (compute_store_table_current_insn): New. + (build_store_vectors): Computation of availability and anticipatability + moved ... + (compute_store_table, find_moveable_store): ... here. + (delete_store): Remove senseless comment. + (store_motion): Reorganize. + +2003-04-01 Kevin Buettner + + * config/mips/mips.c (override_options): Provide mappings for + HI_REGNUM and LO_REGNUM. + * config/mips/mips.h (MD_DBX_FIRST): Define. + +2003-04-01 Franz Sirl + + * combine.c (merge_outer_ops): Fix typo. + + * varasm.c (make_decl_one_only): Revert 2003-03-09 patch. + +2003-04-01 David Edelsohn + + * config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md, + power4.md,rios1.md,rios2.md,rs64.md}: Change mult_compare to + imul_compare. Add lmul_compare. + * config/rs6000/power4.md: Bump some latencies. Model extra cycle + in second pair of dispatch slots. Model stores more accurately. + Tweak multiply model. Add bypasses for CR instructions dependent + on complicated compares. + * config/rs6000/rs6000.md (mulsi3): Name imul_compare patterns. + (muldi3): Add lmul_compare patterns. + * config/rs6000/rs6000.c (rs6000_variable_issue): Move FPLOAD_UX + and FPSTORE_UX to split instructions and add COMPARE, + DELAYED_COMPARE, IMUL_COMPARE, LMUL_COMPARE, IDIV, LDIV. + (rs6000_adjust_cost): Add IMUL_COMPARE and LMUL_COMPARE. + (rs6000_rtx_costs): Separate POWER4 multiply case. + +2003-04-01 Ulrich Weigand + + * config/s390/s390.c (s390_fixup_clobbered_return_reg): + Do nothing if __builtin_return_address was not used. + +Tue Apr 1 18:18:23 CEST 2003 Jan Hubicka + + * i386.md (test patterns): Allow memory operand in operand1. + +2003-04-01 Aldy Hernandez + + * testsuite/gcc.c-torture/execute/simd-3.c: New. + + * expr.c (expand_expr): Handle VECTOR_CST. + (const_vector_from_tree): New. + + * varasm.c (output_constant): Handle VECTOR_CST. + + * c-typeck.c (digest_init): Build a vector constant from a + VECTOR_TYPE. + + * config/rs6000/rs6000.c: Remove prototype for + easy_vector_constant. + (easy_vector_constant): Add mode parameter. Rewrite to handle + more easy constants. + (rs6000_emit_move): Pass mode to easy_vector_constant. + Call emit_easy_vector_insn for SPE V2SI vector constant moves. + (emit_easy_vector_insn): New. + (easy_vector_same): New. + (EASY_VECTOR_15): New macro. + (EASY_VECTOR_15_ADD_SELF): New macro. + (bdesc_2arg): Rename to xorv2si3. + (easy_vector_constant_add_self): New. + (input_operand): Allow vector constants. + + * config/rs6000/rs6000.h (PREDICATE_CODES): Add + easy_vector_constant, easy_vector_constant_add_self. + (EXTRA_CONSTRAINT): Add 'W'. + + * config/rs6000/rs6000-protos.h: Add prototype for + easy_vector_constant, emit_easy_vector_insn. + + * config/rs6000/altivec.md (xorv8hi3): New. + (xorv16qi3): New. + Remove all _const0 patterns. + (movv4si_internal): Rewrite to use code. Add vector constant to + vector alternative. Add splitter. + (movv8hi_internal): Same. + (movv16qi_internal): Same. + (movv4sf_internal): Same. + Change the unspecs for vspltis* to use constants. + + * config/rs6000/spe.md ("xorv4hi3"): New. + ("spe_evxor"): Rename to xorv2si3. + ("xorv1di3"): New. + Remove all _const0 patterns. + (movv2si_internal): Rewrite to use code. Add vector constant to + alternatives. Add splitter. + (movv4hi_internal): Add vector constant to alternatives. + (movv1di_internal): Same. + (movv2sf_internal): Same. + +2003-03-31 Mark Mitchell + + PR c/9936 + * c-decl.c (grokdeclarator): Clear SAVE_EXPR_CONTEXT for + variably-sized arrays in parameters. + (set_save_expr_context): New function. + (c_expand_body): Use it, via walk_tree. + +2003-03-31 Eric Christopher + + * combine.c (can_combine_p): Allow ZERO_EXTRACT and STRICT_LOW_PART. + (combinable_i3pat): Remove call to expand_field_assignment and + #if 0'd code. + +2003-03-31 Mark Mitchell + + PR c++/10278 + * c-common.c (finish_label_address_expr): Handle the + error_mark_node. + +2003-03-31 Richard Henderson + + * real.c (real_identical): Reorg so as to not compare + signalling for normals. + +2003-03-31 Stephane Carrez + + * config/m68hc11/m68hc11.c (hard_reg_operand): Check the mode. + +2003-03-31 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't rely on REG_WAS_0 + notes as they are boggus. + (m68hc11_gen_movqi): Likewise. + +2003-03-31 Stephane Carrez + + * config/m68hc11/m68hc11.c (expand_prologue): For an interrupt handler + save the soft registers after the frame pointer so that gdb can unwind + the frame more easily. + (expand_epilogue): Likewise in opposite order; allow to use X register + as scratch if the return value is by reference. + +2003-03-31 Jason Merrill + + PR java/10145 + * stor-layout.c (update_alignment_for_field): Respect + DECL_USER_ALIGN for zero-length bitfields, too. + * c-decl.c (finish_struct): Don't set DECL_ALIGN for normal + fields. + +2003-03-31 Matt Austern + + * cpppch.c (struct cpp_savedstate): Add defs and n_defs members. + (count_defs): Keep track of number of defs as well as total size. + (write_defs): Put every definition in cpp_savedstate's defs array. + (comp_hashnode): Define. Comparison function for qsort. + (cpp_write_pch_deps): Sort definitions before writing them. + (struct ht_node_list): Define. Like cpp_savedstate but simpler. + (collect_ht_nodes): Define. + (cpp_valid_state): When verifying that undefined identifiers in + the pch file are still undefined, read a sorted list of undefined + identifiers, collect all defined identifiers into a sorted list, + and walk through both lists to make sure there's no match. + +2003-03-31 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-03-31 Michael Matz + + * config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Change 1 into 0. + +2003-03-31 Segher Boessenkool + + PR target/10177 + * config/rs6000/rs6000.h (HARD_REGNO_RENAME_OK): New. + * config/rs6000/rs6000.c (compute_vrsave_mask): Don't mark + all call-clobbered registers as used. + +2003-03-31 Michael Matz + + * cppexp.c (cpp_classify_number): Accept '.' after "0x". + * testsuite/gcc.dg/cpp/c99-hexfloat-3.c: New file. + +2003-03-31 Nathan Sidwell + + * gcov.c: Add -a & -u options. + (struct arc_info): Add local_span, is_call_non_return, + is_nonlocal_return, is_unconditional flags, remove is_call flag. + (struct block_info): Add flags, is_call_site, is_nonlocal_return + members. Make encodings a union with span member. + (struct function_info): Add blocks_executed, line, src, line_next + members. + (struct coverage_info): Make branches a union with blocks member. + (struct source_info): Add functions member. + (object_summary, program_count): New global variables. + (flag_all_blocks, flag_unconditional): New flags. + (find_source, output_branch_count): New functions. + (print_usage): Adjust. + (options): Adjust. + (process_args): Adjust. + (read_graph_file) : Adjust. + : Read flags. + : Adjust. + (read_count_file): Process SUMMARY tags. + (solve_flow_graph): Set is_unconditional and clear is_call_site + appropriately. + (add_branch_counts): Adjust. Don't count unconditional branches. + (add_line_counts): Deal with all-blocks mode, accumulate block + coverage. + (accumulate_line_counts): Adjust, generate local spanning tree for + all-blocks mode. + (output_lines): Adjust. + * profile.c (branch_prob): Alter GCOV_FUNCTION_TAG record. + * doc/gcov.texi: Document. + +2003-03-31 Kazu Hirata + + * config/h8300/h8300.md: Organize peephole2's that transform + (compare (reg:HI) (const_int)). + +2003-03-31 Roger Sayle + + * emit-rtl.c (dconstm2, dconsthalf): New real constants. + (init_emit_once): Initialize dconstm2 and dconsthalf here. + * real.h (dconstm2, dconsthalf): Add prototypes here. + * real.c (real_sqrt): Use dconsthalf rather than local copy. + * builtins.c (fold_builtin): When optimizing sqrt(exp(x)) as + exp(x/2.0) remember to fold the division if possible. + Fold sin(0.0) as 0.0, cos(0.0) as 1.0, pow(x,1.0) as x, + pow(x,-1.0) as 1.0/x, pow(x,2.0) as x*x, pow(x,-2.0) as + 1.0/(x*x) and pow(x,0.5) as sqrt(x). + +2003-03-31 Kazu Hirata + + * config/h8300/h8300.md (a new peephole2): New. + +2003-03-31 Richard Sandiford + + * gcse.c (simple_mem): Return false for floating-point accesses + if flag_float_store is true. + +2003-03-30 Roger Sayle + + * gcse.c (gcse_constant_p): New function to identify constants + suitable for constant propagation, including COMPARE with two + integer constant arguments. + (hash_scan_set): Use gcse_constant_p. + (find_avail_set): Likewise. + (cprop_insn): Likewise. + (do_local_cprop): Likewise. + (find_implicit_sets): Likewise. + (find_bypass_set): Likewise. + +2003-03-30 Matt Kraai + + * except.h: Remove definition of varray_type. + +2003-03-30 Richard Henderson + + PR opt/10011, opt/10252: + * toplev.c (rest_of_compilation): Run purge_builtin_constant_p + before post-gcse cse pass. + +2003-03-30 Roger Sayle + + * dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison. + +2003-03-30 DJ Delorie + + * profile.c (instrument_edges): Make sure any newly created + jump insns have correct jump label info. + +2003-03-30 Richard Henderson + + * cfgbuild.c (make_edges): Use tablejump_p. + * cfgcleanup.c (label_is_jump_target_p): Likewise. + * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise. + * cfgrtl.c (flow_delete_block_noexpunge): Likewise. + (try_redirect_by_replacing_jump): Likewise. + (redirect_edge_and_branch): Likewise. + * cse.c (fold_rtx): Likewise. + * jump.c (delete_related_insns): Likewise. + * rtlanal.c (get_jump_table_offset): Likewise. + * ssa-ccp.c (ssa_ccp_df_delete_unreachable_insns): Likewise. + +2003-03-30 Gabriel Dos Reis + + * Makefile.in (STRICT_WARN): Don't warn for ISO C constructs. + (STRICT2_WARN): Likewise. + +2003-03-30 Kaveh R. Ghazi + + PR other/6955 + * collect2.c (collect_wait): Use WCOREDUMP and fix output message. + * system.h (WCOREDUMP, WCOREFLG): Define if necessary. + +2003-03-30 Richard Henderson + + PR c/10083 + * config/alpha/alpha.md (umuldi3_highpart): Change to expander; + don't zero_extend const inputs. + +2003-03-30 Kazu Hirata + + * reload1.c (reload_cse_move2add): Fix a comment typo. + +2003-03-30 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Remove useless code. + +2003-03-29 Kazu Hirata + + * config/h8300/h8300.md (*iorsi3_and_ashift): New. + (*iorsi3_and_lshiftrt): Likewise. + (*iorsi3_zero_extract): Likewise. + +2003-03-29 Kazu Hirata + + * config/h8300/h8300.md (*insv_si_8_8): New. + (*insv_si_8_8_lshiftrt_8): Likewise. + (a peephole2): Likewise. + +2003-03-29 Gerald Pfeifer + + * doc/contrib.texi: Add Eric Botcazou and Roger Sayle. + Uniformly use bugfix instead of bug fix. + +2003-03-29 Gerald Pfeifer + + PR doc/895 + * ONEWS: Remove those items that already appear in the EGCS + release notes on our web pages. + +2003-03-29 Alan Modra + + * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Respect + TARGET_HARD_FLOAT. Reformat. + (FUNCTION_ARG_REGNO_P): Likewise, and remove unneeded casts. + +2003-03-28 Albert Chin-A-Young + + * gcc/fixinc/inclhack.def: Update solaris_mutex_init_1 to + work on Solaris 2.5.1. + +2003-03-28 Kazu Hirata + + * config/h8300/h8300.md (*addsi3_and_r_1): Put under plus:SI + section of h8300.md + (*addsi3_and_nor_r_1): Likewise. + +2003-03-29 Ulrich Weigand + + * config/s390/s390.c (s390_emit_prologoue): Make sure backchain is + set up before any trapping memory access if flag_non_call_exceptions. + +2003-03-29 Alan Modra + + * reload1.c (reload_as_needed): Allow a USE in asm reloads. + + * loop.c: (find_mem_in_note_1, find_mem_in_note): Comment. + +2003-03-28 Nathanael Nerode + + * configure.in: Clarify comments. + * configure: Regenerate. + +2003-03-28 Ulrich Weigand + + * config/s390/s390.md ("literal_pool_31"): Output pool anchor + label even if pool empty when generating PIC. + ("literal_pool_31", "literal_pool_64"): Coding style cleanup. + +2003-03-28 Kazu Hirata , + Dhananjay Deshpande + + PR target/10205 + * config/h8300/h8300.c (h8300_initial_elimination_offset): + Correct the offset computation when TARGET_NORMAL. + +2003-03-28 Eric Botcazou + + PR target/10067 + * config/sparc/sparc.md (jump pattern): Correct order + when issuing the annuling marker. + +2003-03-28 Eric Botcazou + + PR c/8281 + * config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative. + (movdi reg/reg split): Match only on sparc32, and v9 when int regs. + +2003-03-28 Alan Modra + + * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary + globalize_label. + * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/i960/i960.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/sparc/sparc.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. + * config/v850/v850.c (v850_output_aligned_bss): Likewise. + +2003-03-28 Alan Modra + + * loop.c: (find_mem_in_note_1, find_mem_in_note): New functions. + (replace_loop_mems): Add "written" param. Remove invalid REG_EQUAL + notes after hoisting. + (load_mems): Adjust replace_loop_mems call. + +2003-03-28 Eric Botcazou + Richard Henderson + + PR target/10114 and PR target/10084 + * dwarf2out.c (mem_loc_descriptor): Handle LO_SUM. + +2003-03-27 Richard Henderson + + * config/alpha/alpha.md (adddi_er_high_l): Valid only after reload. + +2003-03-27 Roger Sayle + + * fold-const.c (fold_inf_compare): New function to simplify FP + comparisons against +Infinity or -Infinity. + (fold): Optimize floating point comparisons against Infs and NaNs. + +2003-03-27 Janis Johnson + + * libgcov.c: Provide only dummy functions if libc is not available. + +2003-03-27 Richard Henderson + + * real.h (struct real_value): Add signalling. + (EXP_BITS): Decrement. + * real.c (get_canonical_qnan): Don't set MSB-1. + (get_canonical_snan): Likewise. Set signalling. + (real_identical): Compare signalling. + (round_for_format): Remove force-one-bit on code. + (real_nan): Likewise. Set signalling. + (encode_ieee_single): Add force-one-bit code; honor signalling. + (encode_ieee_double, encode_ieee_extended, encode_ieee_quad): Likewise. + (decode_ieee_single): Set signalling. + (decode_ieee_double, decode_ieee_extended, decode_ieee_quad): Likewise. + +2003-03-27 Olivier Hainque + + PR ada/9953 + * ada/Makefile.in (gnatlib configuration for HPUX): Split + the general section for HPUX into specific sections for + HPUX 10 and HPUX 11. Fix the setting of TGT_LIB in the HPUX + 11 case. + +2003-03-27 Glen Nakamura + + PR opt/10087 + * loop.c (loop_givs_reduce): Skip bivs with duplicate locations + while incrementing giv. + (record_biv): Check for duplicate biv locations and + set (struct induction *) v->same if found. + +2003-03-27 David Mosberger + + * unwind-libunwind.c (uw_frame_state_for): Adjust for libunwind + v0.9 API change: replace read of UNW_REG_HANDLER with + unw_get_proc_info(). + (_Unwind_GetLanguageSpecificData): Replace read of UNW_REG_LSDA + with unw_get_proc_info(). + (_Unwind_GetRegionStart): Replace UNW_REG_PROC_START with + unw_get_proc_info(). + +2003-03-27 Vladimir Makarov + + * config/rs6000/8540.md: Use presence_set instead of absence_set. + +2003-03-26 Richard Henderson + + * c-decl.c (finish_function): Always defer if DECL_DECLARED_INLINE_P. + +2003-03-26 Roger Sayle + + PR bootstrap/10051, PR bootstrap/10169. + * mips-tfile.c (init_file): Don't provide a static initializer. + (initialize_init_file): Initialize the contents of init_file. + (add_file): Call initialize_init_file if not already initialized. + +2003-03-26 Ulrich Weigand + + * config/s390/s390.c (s390_optimize_prolog): Do not save/restore + registers used for global asm variables. + (s390_frame_info, s390_arg_frame_offset): Likewise. + (s390_emit_prologue, s390_emit_epilogue): Likewise. + +2003-03-26 Vladimir Makarov + + * config/rs6000/8540.md: New file. + + * config/rs6000/{40x.md, 603.md, 6xx.md, 7450.md, 7xx.md, mpc.md, + power4.md, rios1.md, rios2.md, rs64.md}: Add mult_compare to + reservations for imul. + + * config/rs6000/rs6000.md: Include 8540.md. Change + delayed_compare onto mult_compare for insns generating + multiplication. + (mult_compare, fpsimple, brinc, vecdiv, veccmpsimple, vecfdiv): + New type attribute values. + + * config/rs6000/spe.md (*negsf2_gp, *abssf2_gpr): Use type + fpsimple instead of fp. + (*divsf3_gpr): Use type vecfdiv instead of fp. + (spe_evfsabs, spe_evfsnabs, spe_evfsneg): Use type vecsimple + instead of vecfloat. + (spe_evfsdive): Use type vecfdiv instead of vecfloat. + (spe_brinc): Use type brinc instead of veccomplex. + (spe_evaddw, spe_evaddiw): Use type vecsimple instead of + veccomplex. + (spe_evdivws, spe_evdivwu): Use type vecdiv instead of veccomplex. + (*movv2si_internal, *movv1di_internal, *movv4hi_internal, + *movv2sf_internal): Define type attribute values for all + alternatives. + (cmpsfeq_gpr, cmpsfgt_gpr, cmpsflt_gpr): Use type veccmp instead + of fpcompare. + (tstsfeq_gpr, tstsfgt_gpr, tstsflt_gpr): Use type veccmpsimple + instead of fpcompare. + +2003-03-26 David Edelsohn + + * config/rs6000/power4.md: Allow delay between dispatch and + function units for simple instructions. Correct store units. + Allow branch to occupy as many dispatch slots as necessary. + +2003-03-26 Jakub Jelinek + + * config/ia64/ia64.c (ia64_expand_op_and_fetch): Fix comment. + (ia64_expand_compare_and_swap): Use always DImode ar.ccv, + zero extend old to it. + * config/ia64/ia64.md (cmpxchg_acq_si): Remove mode from ccv + operand. + +2003-03-26 Eric Botcazou + + PR target/7784 + * reload.c (find_reloads_address): Handle + (PLUS (PLUS (REG) (REG)) (CONST_INT)) form for + all base registers. + +2003-03-25 Marcelo Abreu + + PR other/10203 + * version.c: Reference the GCC web site in the URL. + +2003-03-26 Alan Modra + + * c-incpath.c (add_standard_paths): Add both "translated" and + non-translated header paths. + +2003-03-25 Loren James Rittle + + * doc/install.texi (*-*-freebsd*): Update with known status. + +2003-03-21 Jason Merrill + + PR optimization/10171 + * unroll.c (unroll_loop): Don't delete the jump at the end unless + we also delete a jump at the beginning. + +2003-03-25 Stephane Carrez + + * doc/contrib.texi (Contributors): Mention self as 68HC11/68HC12 + contributor. + +Tue Mar 25 20:35:51 CET 2003 Jan Hubicka + + * i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic + constants are not expensive. + +Mon Mar 24 20:03:03 CET 2003 Jan Hubicka + + PR opt/10056 + * cfglayout.c (fixup_reorder_chain): Fix dealing with the conditional + jump jumping to the next instruction. + * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. + +2003-03-25 Gerald Pfeifer + + * doc/passes.texi (Passes): Properly document that we do not + perform jump2 any longer; remove command-line option -dJ. + +2003-03-25 Eric Botcazou + + PR optimization/8746 + * config/i386/i386.md (and promoting splitters): Disable HImode to + SImode promoting when the sign bit matters and is not preserved, or + when TARGET_FAST_PREFIX is true. Disable promoting when optimizing + for size. + +2003-03-24 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Extend to support loads + in QImode and HImode. + +2003-03-24 Stephane Carrez + + * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Add _call_far and + _return_far + (MULTILIB_OPTIONS): Don't multilib on -mlong-calls. + (MULTILIB_EXCEPTIONS): Likewise. + * config/m68hc11/m68hc11.md ("call"): Support far calls for 68HC11 + by calling some board support routine. + ("call_value"): Likewise. + ("*return_void"): Likewise for return. + ("*return_16bit"): Likewise. + ("*return_32bit"): Likewise. + * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Generate .far + for 68HC11 too. + (DWARF2_ADDR_SIZE): Use 4 so that addresses can + * config/m68hc11/m68hc11.c (m68hc11_override_options): Accept + -mlong-calls for 68HC11. + * config/m68hc11/larith.asm (declare_near): New macro. + (__premain, ___negsi2, ___one_cmplsi2, ___ashlsi3): Use it. + (___ashrsi3, ___lshrsi3, ___lshrhi3, ___lshlhi3): Likewise. + (___rotrhi3, ___rotlhi3, ___ashrhi3, ___ashrqi3): Likewise. + (___lshlqi3, __divmodhi4, ___mulqi3, ___mulhi3): Likewise. + (__mulhi32): Likewise. + (ret): Update macro for 68HC11. + (__far_trampoline): Implement for 68HC11. + (__call_a16, __call_a32, __return_void, __return_16): New support + routines for 68HC11 memory bank switching calling support. + (__return_32): Likewise. + +2003-03-24 Neil Booth + + * toplev.c (independent_decode_option): Don't skip a 'Y' prefix. + +2003-03-24 Janis Johnson + + * doc/install.texi (Testing): Mention test result links from build + status pages. + +2003-03-24 Mark Mitchell + + * function.c (put_var_into_stack): Change bool parameter to int. + (gen_mem_addressof): Likewise. + * rtl.h (gen_mem_addressof): Likewise. + * tree.h (put_var_into_stack): Likewise. + * config/alpha/alpha.c (alpha_gp_save_rtx): Adjust call to + gen_mem_addressof or put_var_into_stack. + * config/c4x/c4x.c (c4x_expand_builtin): Likewise. + * config/ia64/ia64.c (spill_tfmode_operand): Likewise. + +2003-03-24 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-03-24 Jakub Jelinek + + * dojump.c (do_jump): Handle UNSAVE_EXPR specially. + +2003-03-24 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Update Janis Johnson. + +2003-03-23 Eric Botcazou + + PR target/10072 + * combine.c (simplify_if_then_else): Check that the mode + has MODE_INT class before applying the (OP Z (mult COND C2)) + transformation. + +2003-03-23 Eric Botcazou + + PR optimization/9414 + * config/sparc/sparc.md (widening peepholes): Use + widen_memory_access instead of change_address. + +2003-03-23 Mark Mitchell + + PR c++/7086 + * c-typeck.c (c_mark_addressable): Adjust calls to + put_var_into_stack. + * expr.c (expand_expr): Likewise. + * function.c (put_var_into_stack): Add rescan parameter. Do not + call fixup_var_refs when rescan is false. + (gen_mem_addressof): Likewise. + (assign_parms): Adjust calls to put_var_into_stack. + (setjmp_protect): Likewise. + (setjmp_protect_args): Likewise. + * rtl.h (gen_mem_addressof): Change prototype. + * stmt.c (expand_decl): Adjust calls to put_var_into_stack. + * tree.h (put_var_into_stack): Change prototype. + +2003-03-23 Arpad Beszedes + + PR middle-end/9967 + * builtins.c (expand_builtin_fputs): When optimizing for size, + don't transform fputs into fwrite. + +2003-03-23 Glen Nakamura + + PR c/8224 + * fold-const.c (extract_muldiv_1): Don't pass through type conversions + when signedness changes for division or modulus. + +2003-03-24 Alan Modra + + * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Remove unnecessary + globalize_label. + +2003-03-23 Roger Sayle + + PR c/10178 + * stmt.c (expand_end_case_type): Check for overflow in range when + determining whether to use a bit-test implementation. + +2003-03-23 Richard Henderson + + * cfgcleanup.c (try_optimize_cfg): Allow merging of tablejumps + before flow2. + * cfgrtl.c (try_redirect_by_replacing_jump): Similarly. + +2003-03-23 Richard Henderson + + PR opt/10116 + * ifcvt.c (find_if_block): Disallow tablejump insns outgoing + from then_bb or else_bb after flow2. + +2003-03-23 Zack Weinberg + + * configure.in: Check whether it is necessary to link against + libm to use ldexp. + * configure: Regenerate. + * Makefile.in: Add LDEXP_LIB substitution variable. + +2003-03-23 Kazu Hirata + + * config/h8300/h8300.md: Fix comment typos. + +2003-03-22 John David Anglin + + * pa.c (output_cbranch): Fix typo in comment. + +2003-03-22 Richard Henderson + + * cfgcleanup.c (insns_match_p): Do not do EQUIV substitution + after reload. + +2003-03-22 DJ Delorie , + Bruce Korb + + * fixinc/inclhack.def (solaris_mutex_init_1): New; Fix + buggy Solaris 2.6 mutex/cond initializers. + (solaris_mutex_init): Rename to solaris_mutex_init_2. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/pthread.h: Update. + * fixinc/fixincl.c(initialize): be explicit about the default case + and indicate verbose level when being very, very verbose. + * fixinc/check.tpl(VERBOSE): provide a means for passing the value in + +2003-03-22 Andreas Jaeger + + * config/i386/i386.c (ix86_init_machine_status): Return value. + +2003-03-22 John David Anglin + + * pa.c (output_cbranch, output_bb, output_bvb): Output nop for + conditional branch to the following instruction. Use next_real_insn + instead of next_active_insn. + (output_dbra, output_movb, jump_in_call_delay): Use next_real_insn + instead of next_active_insn. + +2003-03-22 Ulrich Weigand + + * config/s390/s390.md ("movti", "*movdi_31", "*movdf_31"): Use 'o' + instead of 'm' constraint in forced-split alternatives. + ("*adddi3_31", "*subdi3_31"): Likewise. Also, pass 0 instead of 1 as + VALIDATE_ADDRESS parameter to operand_subword. + +2003-03-22 Kazu Hirata + + * config/h8300/h8300.c (notice_update_cc): Correctly handle + the case where the set destination is STRICT_LOW_PART. + +2003-03-22 Svein E. Seldal + + * config/c4x/t-c4x (INSTALL_LIBGCC): Make gcc recognize a c33 as a + c30 instead of a c40 processor. + +2003-03-22 Alan Modra + + * combine.c (simplify_comparison ): Use gen_int_mode. Tidy. + +2003-03-21 Zack Weinberg + + * c-common.c: Include intl.h. + (shadow_warning): Rewrite to allow better diagnostic translations. + * c-common.h: Update prototype of shadow_warning. Declare sw_kind enum. + * c-decl.c (warn_if_shadowing): Update calls to shadow_warning; + use it throughout. + * Makefile.in (c-common.o): Add intl.h. + +2003-03-21 Nathanael Nerode + + * config.gcc: Remove 'float_format'. + + * fixproto: Define NULL and size_t in generated stdlib.h and + unistd.h. Kill unused required_stdlib_h, required_unistd_h. + Rearrange file generation loop for readability. Generate time.h, + string.h if missing. + * tsystem.h: Include , unconditionally. + * config.gcc: Blow away POSIX defines. + +2003-03-22 Stephane Carrez + + * config/m68hc11/m68hc11.md ("call_value"): Fix trap check. + +2003-03-22 Stephane Carrez + + * config/m68hc11/m68hc11.h (ASM_DECLARE_FUNCTION_NAME): Fix typo in + writing .interrupt command. + * config/m68hc11/m68hc11.md ("call"): Look at the symbol to see + if it's a far or near function. + ("call_value"): Likewise. + * config/m68hc11/m68hc11.c (m68hc11_attribute_table): Add far and + near attributes. + (m68hc11_handle_fntype_attribute): Accept attributes on methods. + (m68hc11_override_options): Ignore -mlong-calls for 68HC11. + (m68hc11_initial_elimination_offset): Set current_function_far + according to attributes. + (expand_prologue): Likewise. + (trap_handler_symbol): New global to keep track of trap handlers. + (m68hc11_encode_section_info): Mark symbol as far if needed; set + trap symbol. + (m68hc11_is_far_symbol): New function. + (m68hc11_is_trap_symbol): New function. + * config/m68hc11/m68hc11-protos.h (m68hc11_is_far_symbol): Declare. + (m68hc11_is_trap_symbol): Declare. + +2003-03-21 Jan Hubicka + + * i386.c (ix86_compute_frame_layout): Recompute fast prologues + only when amount of saved regs changed. + (ix86_init_machine_status): Initialize use_fast_prologue_epilgoue_nregs. + * i386.h (machine_function): New fields use_fast_prologue_epilgoue_nregs. + +2003-03-21 Jan Hubicka + + PR inline-asm/7916 + * function.c (instantiate_virtual_regs_lossage): New function. + (instantiate_virtual_regs_1): Use it. + (instantiate_virtual_regs): Do not continue in substition when insn has + been deleted. + +2003-03-21 Kazu Hirata + + * combine.c (make_field_assignment): Fix a warning. + +2003-03-21 Kazu Hirata + + * config/h8300/h8300.md (*insv_si_1_n_lshiftrt_16): New. + +2003-03-21 Dale Johannesen + + * config/rs6000/rs6000.h (REG_ALLOC_ORDER): Increase + priority for R2 on Darwin. + (HARD_REGNO_MODE_OK): Don't accept R31 for DFmode. + +2003-03-21 Kazu Hirata + + * combine.c (make_field_assignment): Remove unnecessary AND + when storing into zero_extract. + +2003-03-21 Zack Weinberg + + * aclocal.m4 (gcc_AC_EXAMINE_OBJECT, gcc_AC_C_FLOAT_FORMAT): Delete. + * configure.in: Don't call gcc_AC_C_FLOAT_FORMAT. + * defaults.h: Remove reference to HOST_FLOAT_WORDS_BIG_ENDIAN + in comment. + +2003-03-21 DJ Delorie + + * optabs.c (init_integral_libfuncs): Make sure we init at least up + to "long long" size words. + +2003-03-21 Ulrich Weigand + + * config/s390/s390.h: Do not include fixdfdi.h on s390x. + (TARGET_64BIT): Define as compile-time constant when IN_LIBGCC2. + (MIN_UNITS_PER_WORD): Do not define when IN_LIBGCC2. + +2003-03-21 Volker Reichelt + + PR doc-bug/9813 + * doc/extend.texi: Move misplaced paragraph about underscores in + variables in macros. + +2003-03-21 Eric Botcazou + Richard Henderson + + PR optimization/8366 + * config/sparc/sparc.h: (SYMBOLIC_CONST): New macro. + (GO_IF_LEGITIMATE_ADDRESS): Use it. Reject the form + PIC+SYMBOLIC_CONST in other modes than Pmode. + (GO_IF_MODE_DEPENDENT_ADDRESS): Use it. Mark + the form PIC+SYMBOLIC_CONST as mode dependent. + +2003-03-21 DJ Delorie + + * config/stormy16/stormy16.c (xstormy16_expand_arith): Make + sure we always emit at least one insn. + +2003-03-21 Christopher Faylor + + * config.gcc (i[34567]86-*-cygwin*): Use new common makefile + stub t-cygming. Use common target header cygming.h. Add extra + c_target_obj and cxx_target_obj file. Default cygwin to posix + threading. Enforce i386 as float format. + (i[34567]86-*-mingw*): Use new common makefile stub t-cygming. + Remove cygwin.h as target header. Use common target header + cygming.h Enforce i386 as float format. Correct typo. + * config/i386/cygming.h: New file, containing definitions + common to mingw32 and cygwin. + * config/i386/cygwin.h: Remove definitions common to cygwin and + mingw. Simplify special spec logic. Define "wrappers" around + certain include path defines to accommodate -mno-cygwin. + Remove some #if 0'ed code. + (STANDARD_INCLUDE_DIR) Always define when not cross-compiling. + (LINK_SPEC): Don't use cyg search prefix when -mno-cygwin. + (GCC_DRIVER_HOST_INITIALIZATION): Define as call to mingw_scan. + * config/i386/mingw32.h: Remove definitions common to cygwin and + mingw. + (EXTRA_OS_CPP_BUILTINS): Adjust. + (TARGET_VERSION): Define. + * config/i386/crtdll.h (EXTRA_OS_CPP_BUILTINS): Override + mingw32.h definitions. + (LIBGCC_SPEC): Add libmingwex.a as in mingw32.h. + * config/i386/t-cygwin (EXTRA_GCC_OBJS): Define as cygwin1.o. + Add compilation rules for cygwin1.o cygwin2.o. + * config/i386/cygwin1.c: New file. + * config/i386/cygwin2.c: New file. + * config/i386/t-cygming: New makefile stub. + +2003-03-20 Richard Henderson + + * fold-const.c (extract_muldiv_1): Revert changing order of + operands in case MULT_EXPR of 2003-02-16 patch. + +2003-03-20 Daniel Berlin + Merge changes from new-regalloc-branch + + From Michael Matz + * df.c (df_ref_record_1): Move init of loc to safe point. + Only recurse on interesting things in parallels. + Handle CLASS_CANNOT_CHANGE_MODE smarter. + (df_uses_record): Ditto. + + * df.h (DF_REF_MEM_OK): New enum member, used to mark ref's which + it's already okay to use memory operands in (IE doesn't require + adding another insn or anything). + +2003-03-20 Richard Henderson + + PR middle-end/6348 + * explow.c (allocate_dynamic_stack_space): Handle STACK_SIZE_MODE + different from word_mode. + +2003-03-20 Kazu Hirata + + * config/h8300/h8300.md (*insv_si_1_n_lshiftrt): Restrict the + source operand to those that can be extracted with bld. + +2003-03-20 Richard Earnshaw + + PR 10066 + * arm.md (UNSPEC_PIC_BASE): New constant. + (pic_add_dot_plus_four): Wrap with unspec. + (pic_add_dot_plus_eight): Likewise. + +2003-03-20 Kazu Hirata + + * config/h8300/h8300.md (*insv_si_1_n): New. + (*insv_si_1_n_lshiftrt): Likewise. + +2003-03-20 Roger Sayle + + * fold-const.c (fold_mathfn_compare): New function to simplify + comparisons against built-in math functions. Fold comparisons + of sqrt against constants. + (fold): Call fold_mathfn_compare when appropriate. + +2003-03-20 Richard Earnshaw + + * ifcvt.c (find_if_case_1): If we add a new bb, update the dominance + information. + +2003-03-20 Per Bothner + + Various cleanups to help compile server. + + * cppinit.c (cpp_create_reader): Take extra hash_table* argument, + and pass that to _cpp_init_hashtable. + (cpp_read_main_file): Drop hash_table* argument; don't call + _cpp_init_hashtable. + * cpplib.h: Update declarations to match. + * c-opts.c (c_common_init_options): Pass ident_hash to + cpp_create_reader. + (c_common_post_options): Don't pass ident_hash to cpp_read_main_file. + * fix-header.c (read_scan_file): Likewise pass NULL table to + cpp_create_reader rather than cpp_read_main_file. + + * cppfiles.c (cpp_rename_file): Generalized and renamed + to cpp_change_file. + * cpplib.h: Update declaration to match. + * c-opts.c (push_command_line_line, finish_options): Change + cpp_rename_file calls to cpp_change_file. + + * line-map.c (add_line_map): Allow leaving the outermost file. + Allowing entering an outermost-file after the initial time. + + * toplev.c (pop_srcloc): Allow popping from initial file. + +2003-03-20 Kazu Hirata + + * fold-const.c (fold): Fold A - (A & B) into ~B & A. + +2003-03-20 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-03-20 Kazu Hirata + + * config/h8300/h8300.md (*addsi3_and_r_1): New. + (*addsi3_and_not_r_1): Likewise. + +2003-03-19 Loren James Rittle + + * Makefile.in (STRICT2_WARN): Add @WERROR@. + (GCC_WARN_CFLAGS): Remove $(WERROR). + (fixinc.sh-warn): New. + * ada/Make-lang.in (ada-warn): Add $(WERROR). + * cp/Make-lang.in (cp-warn): Add $(WERROR). + * f/Make-lang.in (f-warn): Add $(WERROR). + * java/Make-lang.in (java-warn): Add $(WERROR). + * treelang/Make-lang.in (treelang-warn): Add $(WERROR). + +2003-03-19 Nathanael Nerode + + * c-common.h (c_dump_tree), c-dump.c (c_dump_tree), + langhooks-def.h (lhd_tree_dump_dump_tree), + langhooks.c (lhd_tree_dump_dump_tree), langhooks.h (*dump_tree): + Change return type from 'int' to 'bool'. Replace 0 and 1 with + true and false in return statements. + +2003-03-19 Kevin Buettner + + * dwarf2out.c (DWARF_INITIAL_LENGTH_SIZE): Define. + (DWARF_COMPILE_UNIT_HEADER_SIZE): Take into account + DWARF_INITIAL_LENGTH_SIZE. + (output_compilation_unit_header, output_pubnames, output_aranges) + (output_line_info): Output 0xffffffff escape value for 64-bit + DWARF extension. + * config/mips/iris6.h (DWARF_INITIAL_LENGTH_SIZE): Define. + +2003-03-19 Ulrich Weigand + + * config/s390/s390.c (s390_preferred_reload_class): Do not + force constants to the pool unless necessary. + (s390_decompose_address): Prefer to use pointer as base, + not index register. + * config/s390/s390.md ("*tsthiCCT_only"): Remove '?' from + Q alternative. + ("*movdi_64", "*movsi", "movhi", "movqi_64", "movqi", + "*movdf_64", "*movsf"): Add '?' to Q->Q alternatives. + ("*extractqi", "*extracthi", "*zero_extendhisi2_31", + "*zero_extendqisi2_31", "*zero_extendqihi2_31", + "*adddi3_31", "*subdi3_31"): Do not set "type" attribute. + +2003-03-19 Jan Hubicka + + * i386.h (machine_function): New fields use_fast_prologue_epilogue. + * i386.c (use_fast_prologue_epilogue): Remove. + (ix86_frame): New field save_regs-using_mov; + (ix86_compute_frame_layout): Decide on fast prologues; + allocate saved registers in red zone. + (ix86_expand_epilogue, ix86_expand_prolgoues): Obey new parameters. + +2003-03-19 Nick Clifton + + * config/mcore/mcore.h (CPP_SPEC): Remove trailing semi-colon. + +2003-03-18 John David Anglin + + PR 10062 + * config/pa/pa-hpux.h (TARGET_HPUX_UNWIND_LIBRARY): Redefine. + * pa-protos.h (output_lbranch): New prototype. + * pa.c (compute_frame_size): Change size of the frame marker on the + 64-bit ports to 48 bytes. + (pa_output_function_prologue): Document why SAVE_SP is set. + (hppa_expand_prologue): Save previous stack pointer into frame marker + on targets which use the hpux unwind library. + (output_cbranch): Use output_lbranch. + (output_lbranch): New function to output long unconditional branches. + * pa.h (TARGET_HPUX_UNWIND_LIBRARY): Define. + (STACK_POINTER_OFFSET): Update offset for 48-byte frame marker on + 64-bit ports. + * pa.md (jump): Use output_lbranch. + (allocate_stack): New expander for dynamic stack allocation. + +2003-03-19 Alan Modra + + * config/rs6000/rs6000.c (rs6000_stack_info): Only require a frame + when debugging on XCOFF targets. Delete "abi" temp. + + PR target/10073 + * combine.c (force_to_mode ): Use gen_int_mode. + +2003-03-18 Jakub Jelinek + + * config/s390/s390.c (s390_output_dwarf_dtprel): New. + * config/s390/s390-protos.h (s390_output_dwarf_dtprel): New proto. + * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Define. + + * config/ia64/ia64.c (ia64_output_dwarf_dtprel): New. + * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): New proto. + * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Define. + +2003-03-18 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't clone + the result of machopic_function_base_name. + * config/darwin.c (machopic_function_base_name): Use a gc-allocated + string rather than a static array. + + * Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies. + + * gengtype.c: Include rtl.h. + (enum rtx_code): Don't define. + (rtx_format): Make declaration match rtl.h. + (rtx_next_new): Rename from rtx_next to avoid conflict. Change all + users. + (adjust_field_rtx_def): Describe strings in NOTE_LINE_NUMBER notes. + * Makefile.in (gengtype.o): Update dependencies. + +2003-03-18 Andreas Schwab + + * config/m68k/m68k.md (iordi3): Fix setting low half to -1. From + martin@blom.org. + +2003-03-18 Geoffrey Keating + + * function.c (next_block_index): Mark with GTY. + + * config/rs6000/rs6000.md (macho_correct_pic): Correct pattern. + +2003-03-18 Richard Henderson + + * config/ia64/ia64.md (UNSPECV_SETJMP_RECEIVER): New. + (builtin_setjmp_receiver): Delay call to ia64_reload_gp + until after reload. + +2003-03-18 Richard Henderson + + * builtins.c (expand_builtin_unop): New target_mode operand; + use it to convert the result to the correct mode. + (expand_builtin): Update all callers. + +2003-03-18 Ulrich Weigand + + * config/s390/s390.md ("movti", "movhi", "movqi"): Add "type" attribute. + +2003-03-18 Jan Hubicka + + * i386.md: Fix previous commit that mistakely applied the patch + twice. + + * alias.c (rtx_equal_for_memref_p): Assume that X and Y has been + canonicalized. + (memrefs_conflict_p): Likewise. + (addr_side_effect_eval): Canonicalize the constructed address. + +2003-03-18 Jan Hubicka + + * i386.md (cvtts?2si peep2): New. + +2003-03-18 Kazu Hirata + + * config/h8300/h8300.md (*iorsi3_two_qi_zext): New. + +2003-03-18 Andreas Schwab + + * dwarf2out.c (output_file_names): Cast size_t to unsigned long + for format. + +2003-03-17 Jason Merrill + + PR c++/10091 + * expr.c (expand_expr) [ADDR_EXPR]: Disallow taking the address of + an unaligned member of TREE_ADDRESSABLE type. + +2003-03-18 Alan Modra + + * config/rs6000/linux64.h (MASK_PROFILE_KERNEL): Define. + (TARGET_PROFILE_KERNEL): Define. + (SUBTARGET_SWITCHES): Handle -mprofile-kernel. + (PROFILE_BEFORE_PROLOGUE): Don't define. + (PROFILE_KERNEL): Remove hacks. + * config/rs6000/rs6000.c (TARGET_PROFILE_KERNEL): Define default. + (rs6000_stack_info): No need to save lr if just for profiling when + TARGET_PROFILE_KERNEL. + (output_profile_hook): Output nothing when TARGET_PROFILE_KERNEL. + (output_function_profiler): Localize label generation. Emit code + for kernel profiling. + +2003-03-17 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + byte_accesses_mergeable_p. + * config/h8300/h8300.c (byte_accesses_mergeable_p): New. + * config/h8300/h8300.md (*iorhi3_two_qi_mem): Likewise. + (a splitter): Likewise. + (*iorsi3_ashift_16_ashift_24): Likewise. + (*iorsi3_ashift_16_ashift_24_mem): Likewise. + +2003-03-17 Kaveh R. Ghazi + + * dwarf2asm.h: Delete obsolete comment. + (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, + dw2_asm_output_pcrel, dw2_asm_output_addr, + dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx, + dw2_asm_output_nstring, dw2_asm_output_data_uleb128, + dw2_asm_output_data_sleb128, dw2_asm_output_delta_uleb128, + dw2_asm_output_delta_sleb128): Add ATTRIBUTE_NULL_PRINTF. + +2003-03-17 Zack Weinberg + + * c-tree.h (struct lang_identifier): Remove error_locus field. + (IDENTIFIER_ERROR_LOCUS): Kill. + (record_function_scope_shadow): New prototype. + * c-typeck.c (build_external_ref): Don't complain if + decl is error_mark_node. When not at file scope, bind the + decl's local value to error_mark_node to suppress further + warnings, instead of setting IDENTIFIER_ERROR_LOCUS. + + * c-decl.c (get_function_binding_level): New static function. + (record_function_scope_shadow): New exported function. + (c_make_fname_decl): Use get_function_binding_level. + +2003-03-17 Steve Ellcey + + * stmt.c (tail_recursion_args): Call promote_mode to set + unsignedp flag correctly before calling convert_move. + +2003-03-17 Zdenek Dvorak + + * loop-unroll.c (decide_peel_completely, + decide_unroll_constant_iterations, decide_unroll_stupid, + decide_unroll_runtime_iterations, decide_peel_simple): Set + loop->has_desc. + +2003-03-17 Jan Hubicka + + * ggc-common.c (ggc_mark_roots): Use htab_traverse_noresize. + +2003-03-17 Olivier Hainque + + * function.c (assign_parms): For a struct value address passed as + first argument, delay the function's result RTL setup code until + after the emission of parameter conversions. + +2003-03-17 Dave Love + Rainer Orth + + * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define __digital__, + __arch64__ to match Compaq cc. + +2003-03-17 Neil Booth + + * c-opts.c: Default TARGET_EBCDIC to 0 if not defined. + (c_common_init): Set EBCDIC in cpp options. + * cpplex.c (maybe_read_ucs, cpp_parse_escape): Use EBCDIC option, + not conditional compilation. + * cpplib.h (struct cpp_options): New entry EBCDIC. + +2003-03-17 Neil Booth + + * fix-header.c (read_scan_file): Need to malloc arguments to add_path. + +2003-03-17 Michael Hayes + + * function.c (thread_prologue_and_epilogue_insns): Set delete_unused + argument to 0 for redirect_jump. + +2003-03-16 Mark Mitchell + + PR c++/8805 + * except.c (eh_region_u_cleanup): Add prev_try. + (expand_eh_region_end_cleanup): Set it. + (reachable_handlers): Use it to skip over cleanup blocks. + +2003-03-17 Andreas Jaeger + + * Makefile.in (TAGS): Remove obsolete handling of =*.[chy]. + +2003-03-17 Alan Modra + + * config/rs6000/linux64.h (TARGET_64BIT): Redefine. + (TARGET_RELOCATABLE, TARGET_EABI, TARGET_PROTOTYPE): Likewise. + (SUBTARGET_SWITCHES, SUBTARGET_OPTIONS): Likewise. + (SUBTARGET_OVERRIDE_OPTIONS, CPP_SYSV_SPEC): Likewise. + +2003-03-16 Richard Henderson + + * simplify-rtx (simplify_binary_operation): Don't abort for + SS_PLUS, US_PLUS, SS_MINUS, US_MINUS. + +2003-03-16 Richard Henderson + + * config/i386/i386.md (movstrictqi, movstrictqi_1): Check + optimize_size as well. + +2003-03-16 Stephane Carrez + + * config/m68hc11/m68hc11.c (print_operand): Handle 'b' modifier + for D register to specify the low part of it, aka B. + (m68hc11_gen_movhi): Use REG_WAS_0 note and increment or decrement + the register if we are loading 1 or -1 to it; avoid using temp + register when moving X/Y to Y/X. + (m68hc11_gen_movqi): Likewise. + (m68hc11_check_z_replacement): Fix last insn setting for compare case. + +2003-03-14 Mark Mitchell + + PR optimization/9016 + * config/i386/i386.c (ix86_expand_move): Force more CONST_DOUBLEs + into the constant pool. + +2003-03-16 Falk Hueffner + + PR target/9164 + * tree.c (get_narrower): For extensions with unchanged bit number, + return the unsignedness of the outer mode. + +2003-03-16 Roger Sayle + + * c-typeck.c (build_component_ref): Turn "for" into "do .. while" + to avoid "may be used uninitialized" warning on ia64-hpux. + * config/ia64/ia64-c.c: Include "tm_p.h" for function prototypes. + +2003-03-16 Andreas Jaeger + + * configure.in: Improve check for memcheck.h. + * configure: Regenerated. + +2003-03-16 Neil Booth + + * doc/cppopts.texi: Remove documentation of -A-. + +2003-03-15 Zack Weinberg + + * doc/libgcc.texi: Remove @tie. + +2003-03-15 Josef Zlomek + + * rtl.h (subrtx_p): Renamed to rtx_referenced_p. + (rtx_pair): Added new element update_label_nuses, renamed to + replace_label_data. + * cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge): Use + replace_label_data instead of rtx_pair. + * loop.c (load_mems): Likewise. + * rtlanal.c (replace_label): Replace label in pool constants and in + INSN_LIST (in REG_LABEL note). + (subrtx_p): Renamed to rtx_referenced_p. + (subrtx_p_1): Renamed to rtx_referenced_p_1, compare the interior of + LABEL_REF with CODE_LABEL, traverse constants from pool. + +2003-03-15 Aldy Hernandez + Zack Weinberg + + * Makefile.in (TEXI_GCCINT_FILES): Add libgcc.texi. + * doc/libgcc.texi: New file. + * doc/interface.texi: Delete paragraph about libgcc interface. + * doc/gccint.texi: Add libgcc menu entry and @include libgcc.texi. + +2003-03-15 Jason Merrill + + PR debug/9039 + * dwarf2out.c (gen_decl_die): Ignore frontend tree codes. + + PR debug/6387 + * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested + function DIEs at toplevel. + (decls_for_scope): At -g1, don't descend into subblocks. + +2003-03-15 Ulrich Weigand + + * varasm.c (struct rtx_const): Change type of un.addr member + to struct holding an additional 'symbol' member. + (decode_rtx_const): Re-enable optimization to count SYMBOL_REFs + with equal string addresses as equal. + (simplify_subtraction): Adapt to struct rtx_const change. + +2003-03-15 Neil Booth + + * fix-header.c (read_scan_file): Read main file before handling -D. + +2003-03-15 Roger Sayle + + * c-cppbuiltin.c (builtin_define_with_value_n): Fix whitespace. + * c-typeck.c (c_tree_expr_nonnegative_p): Likewise. + * cfgbuild.c (find_many_sub_basic_blocks): Likewise. + (find_sub_basic_blocks): Likewise. + * cgraphunit.c (cgraph_expand_functions): Likewise. + * dwarf2out.c (prune_unused_types): Likewise. + * expr.c (store_field): Likewise. + * genextract.c (print_path): Likewise. + * haifa-sched.c (schedule_insn): Likewise. + * lcm.c (compute_antinout_edge): Likewise. + * loop-unroll.c (decide_peel_once_rolling): Likewise. + * ra-colorize.c (ra_colorize_free_all): Likewise. + * ra-debug.c (dump_igraph): Likewise. + (debug_hard_reg_set): Likewise. + * reg-stack.c (reg_to_stack): Likewise. + * rtlanal.c (refers_to_regno_p): Likewise. + * tracer.c (layout_superblocks): Likewise. + +2003-03-15 Neil Booth + + * fix-header.c (read_scan_file): Fix thinko. + +2003-03-15 Glen Nakamura + + * reload1.c (choose_reload_regs): Use && instead of || + with REG_CANNOT_CHANGE_MODE_P condition. + +2003-03-15 Neil Booth + + * Makefile.in: Update. + * c-common.h (cb_register_builtins): Rename c_cpp_builtins. + * c-lex.c (init_c_lex): Register builtins hook is dead. + * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U. + (c_common_decode_option): Don't call cpp_handle_option. + Handle -A, -D and -U. + (handle_deferred_opts): Simplify. + (finish_options): Define builtins and command line macros. + * c-ppoutput.c (init_pp_output): Register builtins hook is dead. + * cppinit.c: Don't include intl.h. + (init_builtins): Rename cpp_init_builtins. No hook to call. + (init_library): Don't need to sort options. + (cpp_create_reader): Don't set pending. + (cpp_destroy): Don't free pending. + (struct pending_option, cl_directive_handler, struct cpp_pending, + APPEND, free_chain, new_pending_directive, parse_option, opt_comp, + cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option, + cl_options, cpp_handle_option): Remove. + * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option, + cpp_finish_options): Remove. + (cpp_init_builtins): New. + * fix-header.c (read_scan_file): Update to handle -D. Fix + handling of -I. Replace call to cpp_finish_options. + +2003-03-15 Michael Hayes + + PR optimization/9387 + * function.c (thread_prologue_and_epilogue_insns): Use redirect_jump + for conditional returns. + +2003-03-14 Jason Merrill + + PR optimization/6871 + * varasm.c (assemble_variable): Leave constant zeroes in .rodata. + +2003-03-14 Neil Booth + + * c-opts.c (finish_options): New. + (COMMAND_LINE_OPTIONS, c_common_decode_option): Add -imacros. + (missing_arg): Handle OPT_include and OPT_imacros. + (c_common_init, c_common_parse_file): Use finish_options. + (handle_deferred_opts): Update. + * cppinit.c (struct cpp_pending): Remove imacros_head and imacros_tail. + (cpp_finish_options): Don't handle -imacros here. + (no_fil): Remove. + (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -imacros. + +2003-03-14 Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_emit_load_toc_table): Don't call + rs6000_maybe_dead if !fromprolog. + +2003-03-14 Neil Booth + + * Makefile.in: Update. + * c-common.h (fe_file_change, pp_file_change): New. + * c-lex.c (init_c_lex): Don't set cb_file_change. + (c_common_parse_file): Move to c-opts.c. + (cb_file_change): Rename fe_file_change. + * c-opts.c: Include debug.h. + (warn_unused_macros, include_cursor): New. + (push_command_line_include, cb_file_change): New. + (COMMAND_LINE_OPTIONS): Handle -include. + (c_common_decode_option): Use local warn_unused_macros. + Handle OPT_include. + (c_common_post_options): Set file change callback. + (handle_deferred_opts): Skip -include. Don't free the array. + (c_common_init): Call cpp_finish_options here, and push an + initial -include file. + * c-ppoutput.c (cb_file_change): Rename pp_file_change. + (preprocess_file): Don't call cpp_finish_options. + (init_pp_output): Don't set the file change callback. + (pp_file_change): Return if no line commands or no output. + * cpphash.h (next_include_file, first_unused_line): Remove. + * cppinit.c (include_head, include_tail): Remove. + (cpp_destroy): Don't free -include chain. + (cpp_finish_options): Don't handle -include, or worry about + -Wunused-macros. + (_cpp_maybe_push_include_file): Remove. + (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -include. + * cpplib.c (_cpp_pop_buffer): Don't handle -include. + * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_create_definition): + Used flag is set based upon the state of the warn_unused_macros + flag, and so use of first_unused_line is unnecessary. + +2003-03-13 Jan Hubicka + + * cselib.c (clear_table): Do not take argument; always clear just + used slots. + (cselib_process_insn): Update call of clear_table + (cselib_init): Do not call clear_table. + (cselib_finish): Clear table. + + * cse.c (count_reg_usage): Do not check side_effects_p. + * rtlanal.c (set_noop_p): Check side_effects_p only when set looks + like noop. + (find_reg_equal_equiv_note): Do not use find_reg_note. + +2003-03-14 Richard Henderson + + PR target/9700 + * config/alpha/alpha.c (alpha_va_start): Account for + current_function_pretend_args_size in the AP offset. + + * config/alpha/alpha.h (SETUP_INCOMING_VARARGS): Move out of line. + (INITIAL_ELIMINATION_OFFSET): Move out of line. + * config/alpha/alpha.c (alpha_setup_incoming_varargs): New. + (alpha_initial_elimination_offset) New. + * config/alpha/alpha-protos.h: Update. + +2003-03-14 Jakub Jelinek + + * stmt.c (expand_start_case): Call emit_queue (). + +2003-03-14 Chris Demetriou + Alexandre Oliva + + * config/mips/mips.h (FUNCTION_PROFILER): _mcount() doesn't pop 2 + words in new abis. + +2003-03-14 Eric Botcazou + + PR optimization/8396 + * tree-inline.c (initialize_inlined_parameters): Make sure the value + of read-only constant arguments is passed with the right type. + +2003-03-14 Steven Bosscher + + * doc/extend.texi (Function Names): Make the example compilable. + +2003-03-13 David Edelsohn + + * config/rs6000/rs6000.c (processor_target_table): Really allow + GP optional instructions on Power4. + +2003-03-13 Roger Sayle + + * calls.c (flags_from_decl_or_type): Factor and remove redundant + conditional tests. + +2003-03-13 Mike Stump + + * ggc-page.c (struct page_entry): Remove varray.h header. + Add index_by_depth field. + Remove save_in_use_p field. + (struct globals): Add depth_in_use, depth_max, by_depth_in_use, + by_depth_max, by_depth, and save_in_use fields. + (INITIAL_PTE_COUNT): Add. + (save_in_use_p_i): Add. + (save_in_use_p): Add. + (adjust_depth): Add. + (move_ptes_to_front): Add. + (push_depth): Add. + (push_by_depth): Add. + (prefetch): Add. + (free_page): Add support for and use faster data structures. + (ggc_alloc): Likewise. + (init_ggc): Likewise. + (ggc_recalculate_in_use_p): Likewise. + (ggc_pop_context): Likewise. + (clear_marks): Likewise. + (ggc_pch_read): Likewise. + * Makefile.in (ggc-page.o): Remove varray.h. + +2003-03-13 Nathanael Nerode + + * ChangeLog: Rotated last year's entries to... + * ChangeLog.8: New. + + * config/ia64/fde-glibc.c, config/ia64/freebsd.h, + config/ia64/hpux.h, config/ia64/hpux_longdouble.h, + config/ia64/ia64-c.c, config/ia64/ia64-modes.def, + config/ia64/ia64-protos.h, config/ia64/ia64.c, + config/ia64/ia64.h, config/ia64/ia64.md, + config/ia64/itanium1.md, config/ia64/itanium2.md, + config/ia64/quadlib.c, config/ia64/unwind-ia64.c, + config/ia64/unwind-ia64.h: It's GCC, not GNU CC. + +2003-03-13 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_dwarf_register_span): + Differentiate endianness. + (s6000_override_options): Use cpu type instead of TARGET_SPE. + +2003-03-13 Nick Clifton + + * config/arm/arm.c (print_multi_reg): Do not generate a type 2 + LDM instructions with writeback enabled. + (output_return_instruction): Likewise. + + * config/arm/pe.h (FIXED_REGISTERS): Remove definition. + (CALL_USED_REGISTERS): Remove definition. + (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Define. + +2003-03-13 Alan Modra + + * config/rs6000/rs6000.c (rs6000_flag_pic): Delete. + (rs6000_xcoff_encode_section_info): #ifdef TARGET_XCOFF. + (rs6000_binds_local_p, TARGET_BINDS_LOCAL_P): #if TARGET_MACHO. + (rs6000_override_options): Don't clear flag_pic for ABI_AIX. + (rs6000_legitimize_address): Formatting. + (rs6000_emit_move): Likewise. + (rs6000_return_addr): Test ABI_AIX as well as flag_pic. + (rs6000_emit_prologue ): Likewise. + (rs6000_elf_select_section): Comment reason for shlib being + set for ABI_AIX. + (rs6000_elf_unique_section): Likewise. + (rs6000_elf_encode_section_info): Test !TARGET_AIX as well as ABI_AIX. + * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Test ABI_AIX + as well as flag_pic. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. + (MINIMAL_TOC_SECTION_ASM_OP): Likewise. + * config/rs6000/linux64.h (TARGET_ENCODE_SECTION_INFO): Don't define. + +2003-03-13 Richard Henderson + + * emit-rtl.c (try_split): Handle 1-1 splits of call insns properly. + + * config/ia64/ia64.c (TARGET_FUNCTION_OK_FOR_SIBCALL): New. + (ia64_gp_save_reg): Remove. + (struct ia64_frame_info): Move to the beginning of the file; + add reg_save_gp. + (ia64_expand_call): Rearrange for new call patterns. + (ia64_reload_gp): New. + (ia64_split_call): New. + (ia64_compute_frame_size): Allocate reg_save_gp. + (ia64_expand_prologue): Save reg_save_gp. + (ia64_expand_epilogue): Don't restore gp. + (ia64_hard_regno_rename_ok): Remove R4 hack. + (ia64_function_ok_for_sibcall): New. + (ia64_output_mi_thunk): Set reload_completed, no_new_pseudos; + call try_split on sibcall pattern. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.md (call_nogp, call_value_nogp, sibcall_nogp): + Rename from nopic versions. Confiscate 2nd argument to call as + a marker. + (call_pic, call_value_pic, sibcall_pic): Remove. + (call_gp, call_value_gp, sibcall_gp): New. + (builtin_setjmp_setup): Remove. + (builtin_setjmp_receiver): Call ia64_reload_gp. + +2003-03-12 Nathanael Nerode + + * config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, + config/dsp16xx/dsp16xx.h, config/dsp16xx/dsp16xx.md: Replace + "GNU CC" with "GCC". + + * config/c4x/c4x-c.c, config/c4x/c4x-modes.def, + config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, + config/c4x/c4x.md, config/c4x/libgcc.S, config/c4x/rtems.h: + GCC, not GNU CC. + + * genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h, + langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC". + + * c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c, + langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c, + unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace + "GNU CC" with "GCC". + + * config/v850/lib1funcs.asm, config/v850/rtems.h, + config/v850/v850-c.c, config/v850/v850-protos.h, + config/v850/v850.c, config/v850/v850.h, config/v850/v850.md: + GCC, not GNU CC. + + * config/vax/bsd.h, config/vax/elf.h, config/vax/netbsd-elf.h, + config/vax/netbsd.h, config/vax/openbsd.h, config/vax/openbsd1.h, + config/vax/ultrix.h, config/vax/vax-protos.h, config/vax/vax.c, + config/vax/vax.h, config/vax/vax.md, config/vax/vaxv.h: GCC, not + GNU CC. + +2003-03-12 Benjamin Kosnik + + * cpppch.c (cpp_valid_state): Use DL_WARNING_SYSHDR, not DL_WARNING. + +2003-03-12 Nathanael Nerode + + * fixinc/fixinc.interix: Remove dead code (most of it). + * fixinc/fixinc.dgux: Remove. + + * ginclude/float.h, ginclude/iso646.h, ginclude/stdarg.h, + ginclude/stdbool.h, ginclude/stddef.h: GCC, not GNU CC. + +2003-03-12 John David Anglin + + * pa.c (pa_init_builtins): Fix warning. + +2003-03-12 Steve Ellcey + + * config/ia64/ia64.h (ASM_OUTPUT_XDATA_CHAR): Remove. + (ASM_OUTPUT_XDATA_SHORT): Remove. + (ASM_OUTPUT_XDATA_INT): Remove. + (ASM_OUTPUT_XDATA_DOUBLE_INT): Remove. + (ASM_OUTPUT_ADDR_DIFF_ELT): Handled 32 bit address diffs. + (ASM_PREFERRED_EH_DATA_FORMAT): Handle 32 bit EH pointers. + (CASE_VECTOR_MODE): Handle 32 bit pointers in case statement. + +2003-03-12 Andrew Lewycky + + PR c++/7050 + * expr.c (store_expr): Don't attempt to store void-typed trees, + just evaluate them for side effects. + +2003-03-12 Neil Booth + + * cppfiles.c (cpp_rename_file, cpp_push_include): New. + * cppinit.c (push_include): Move with changes to cppfiles.c. + (cpp_read_main_file): Mark named operators here... + (cpp_finish_options): ...not here. Update. + (_cpp_maybe_push_include_file): Update. + * cpplib.h (cpp_push_include, cpp_rename_file): New. + +2003-03-12 Nathanael Nerode + + * aclocal.m4: Introduce gcc_GAS_VERSION_GTE_IFELSE, + _gcc_COMPUTE_GAS_VERSION. + * configure.in: Use them. + * configure: Regenerate. + +2003-03-12 Bob Wilson + + * config/xtensa/xtensa.md (adddi3): Don't clobber source operand used + to detect carry. + (subdi3): Reorder emitted instructions. + +2003-03-12 Andreas Jaeger + + * config/i386/netbsd64.h (TARGET_OS_CPP_BUILTINS): Remove call to + NETBSD_OS_CPP_BUILTINS_LP64. + +2003-03-12 Nathanael Nerode + + * Makefile.in: Eliminate all.indirect. Update and clean up comments. + Rearrange. Reorganize. + * configure.in: Rearrange. + * configure: Regenerate. + +2003-03-12 Andreas Jaeger + + * c-cppbuiltin.c (cb_register_builtins): Define LP64 builtins for + LP64 targets. + + * doc/cpp.texi (Common Predefined Macros): Document __LP64__ and + _LP64. + + * config/ia64/ia64.h (TARGET_CPU_CPP_BUILTINS): Do not define + _LP64 macros here. + * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Likewise. + + * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove call to + NETBSD_OS_CPP_BUILTINS_LP64. + * config/sh/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise. + * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise. + + * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_LP64): Remove. + +2003-03-12 Jan Hubicka + + * i386.c (ix86_setup_incoming_varargs): Set stack_alignment_needed to 128. + +2003-03-12 Daniel Jacobowitz + + Fix PR target/9797 and PR c/9853. + * stmt.c (expand_decl_init): Call push_temp_slots () and + pop_temp_slots (). + +2003-03-12 J"orn Rennecke + + * sh.c: Include basic-block.h. + (sh_output_mi_thunk, emit_load_ptr): New functions. + (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine. + +2003-03-12 Nick Clifton + + * config/arm/pe.h (FIXED_REGISTERS): Add Maverick registers. + (CALL_USED_REGISTERS): Likewise. + * config/arm/arm.h (FIRST_PSEUDO_REGISTER): Update comment + describing how this value is calculated. + +2003-03-12 Hans-Peter Nilsson + + * configure.in (rlim_t): Define to long if no valid definition + found in sys/resource.h. + * config.in, configure: Regenerate. + +2003-03-12 Neil Booth + + * config/mcore/mcore-elf.h (CPP_PREDEFINES): Replace with + TARGET_OS_CPP_BUILTINS. + * config/mcore/mcore-pe.h: Similarly. + * config/mcore/mcore.h: Replace CPP_PREDEFINES and part of + CPP_SPEC with TARGET_CPU_CPP_BUILTINS. + +2003-03-12 Eric Botcazou + + PR c/9928 + * c-decl.c (duplicate_decls): Discard the initializer of the new decl + only if it is a VAR_DECL. + +2003-03-12 Eric Botcazou + + PR optimization/9888 + * config/i386/i386.md (jcc_1): Fix range. + (jcc_2): Likewise. + (jump): LIkewise. + (doloop_end_internal): Likewise. + +2003-03-12 Danny Smith + + * config/i386/winnt.c (DLL_IMPORT_PREFIX): New define. + Use throughout instead of DLL_IMPORT_EXPORT_PREFIX and "e." + (DLL_EXPORT_PREFIX): New define. Use throughout instead of + DLL_IMPORT_EXPORT_PREFIX and "i." + (i386_pe_dllexport_name_p): Here. + (i386_pe_dllimport_name_p): Here. + (i386_pe_mark_dllexport): Here. Remove DLL_IMPORT_PREFIX, + not 9 chars when getting identifier name. + (i386_pe_mark_dllimport): Here. + (i386_pe_encode_section_info): Here. Remove DLL_IMPORT_PREFIX, + not 9 chars when getting identifier name. Correct comment. + (i386_pe_strip_name_encoding): Here. Add comments for different + cases. + (gen_fastcall_suffix): Break down xmalloc() argument to + components. + (gen_stdcall_suffix): Likewise. + Update copyright year. + +2003-03-12 Eric Botcazou + + PR optimization/9888 + * config/i386/i386.md (movsi_1): Remove special alternatives + for %eax register. + (movsi_1_nointernunit): Likewise. + (movhi_1): Likewise. + * config/i386/i386.c (memory_address_length): Do not use + short displacement when there is no base. + (ix86_attr_length_address_default): Handle LEA instructions. + +2003-03-12 Neil Booth + + * c-cppbuiltin.c (builtin_define_std): Make non-static. + +2003-03-11 Loren James Rittle + + * config/freebsd-spec.h (FBSD_CPP_PREDEFINES): Remove. + (FBSD_TARGET_OS_CPP_BUILTINS): New port-specific macro. + (FBSD_TARGET_CPU_CPP_BUILTINS): New port-specific macro. + * config/freebsd.h (CPP_PREDEFINES): Remove. + (TARGET_OS_CPP_BUILTINS): New. + * config/alpha/freebsd.h: Use overridden FBSD_TARGET_CPU_CPP_BUILTINS + instead of TARGET_OS_CPP_BUILTINS. + * config/sparc/freebsd.h (CPP_PREDEFINES): Remove. + +2003-03-11 Geoffrey Keating + + * c-cppbuiltin.c (builtin_define_std): Add ATTRIBUTE_UNUSED. + +2003-03-11 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_stack_info): Remove + insn_chain_scanned. Use insn_chain_scanned_p in machine_function. + + * config/rs6000/rs6000.h (machine_function): Add insn_chain_scanned_p. + +2003-03-11 Alexandre Oliva + + * toplev.c (independent_decode_option): Return success for --help, + --target-help and --version. + +2003-03-11 Alexandre Oliva + + * config/mips/linux64.h (DRIVER_SELF_SPECS): Add endian_spec. + Default to -mips3 on -mabi=64. Don't add -mips* flag if -march is + specified. + (SUBTARGET_ASM_SPEC): Remove -mips*-adding code obviated by + DRIVER_SELF_SPECS. + (LINK_SPEC): Let endian options affect the linker emulation name. + +2003-03-11 J"orn Rennecke + + * sh.md (reload_inqi): Fix mode for source in second set. + +2003-03-11 Jan Hubicka + + * cselib.c (cselib_invalidate_mem_1): Move too ... + (cselib_invalidate_mem): ... here; use new list + (dummy_val, first_containing_mem): New static variables. + (clear_table): Initialize first_containing_mem. + (discard_useless_values): Compact the containing_mem list. + (add_mem_for_addr): Add to the list. + * cselib.h (cselib_val): Add next_containing_mem. + +2003-03-11 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): Disable string + instructions for e500. + +2003-03-11 Neil Booth + + * Makefile.in: Update. + * c-cppbuiltin.c: Include tm_p.h. + +2003-03-11 Aldy Hernandez + + * doc/tm.texi (Frame Registers): Document DWARF_REG_TO_UNWIND_COLUMN. + + * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Define. + (_Unwind_GetGR): Use DWARF_REG_TO_UNWIND_COLUMN. + (_Unwind_SetGR): Same. + (_Unwind_GetGRPtr): New. + (_Unwind_SetGRPtr): New. + (uw_update_context_1): Use accesor functions instead of accessing + context->reg[] directly. + (uw_install_context_1): Same. + (execute_cfa_program): Same. + (__frame_state_for): Same. + + * config/rs6000/rs6000.c (spe_synthesize_frame_save): Use 1200 as + the synthetic register offset. + + * config/rs6000/rs6000.h (DWARF_REG_TO_UNWIND_COLUMN): New. + +2003-03-11 Hans-Peter Nilsson + + * config/cris/cris.md: Remove lingering EGCS reference. + ("*extopqihi_side_biap"): For HI operation, match + cris_additive_operand_extend_operator, not + cris_operand_extend_operator. Adjust condition. + ("*extopqihi_side", "*extopqihi"): Ditto. + ("*extopqisi_side_biap"): Correct operand numbers in condition. + ("*extophisi_side_biap", "*extopqisi_swap_side_biap"): Ditto. + ("*extophisi_swap_side_biap", "*extopqisi_swap"): Ditto. + ("*extophisi_swap"): Ditto. + ("*extopqihi_swap_side_biap"): For HI operation, match a simple + PLUS, not cris_operand_extend_operator. Adjust condition and + output template. + ("*extopqihi_swap_side", "*extopqihi_swap"): Ditto. + * config/cris/cris.h (PREDICATE_CODES): Add + cris_additive_operand_extend_operator. + * config/cris/cris.c (cris_additive_operand_extend_operator): + New predicate. + +2003-03-11 Hartmut Penner + + * df.c (read_modify_subreg_p): Change from static to global. + * df.h (read_modify_subreg_p): Add prototype. + * sched-deps.c (sched_analyze_1): Generate true dependency for + strict_low_part, certain subregs and zero/sign_extract. + +2003-03-11 Neil Booth + + * Makefile.in: Update. + * c-common.c: Don't include real.h or except.h. + (REGISTER_PREFIX): Remove. + (builtin_define_std, builtin_define_with_value, + builtin_define_with_int_value, builtin_define_with_hex_fp_value, + builtin_define_type_max, builtin_define_type_precision, + builtin_define_float_constants): Move to c-cppbuiltin.c. + (c_stddef_cpp_builtins): New. + * c-common.h (builtin_define_with_value, c_stddef_cpp_builtins): New. + * c-cppbuiltin.c: New, extracted from c-common.c. + (define__GNUC__): New. + * cppspec.c (lang_specific_driver): Remove support of -no-gcc. + * gcc.c: Remove support of %v1, %v2 and %v3 specs. + (cpp_unique_options): Don't support no-gcc. + (do_spec_1): Remove support of version specs. + * doc/invoke.texi: Remove documentation of %v1, %v2 and %v3. + * doc/passes.texi: Update. + * doc/tm.texi: Update. + +2003-03-10 Aldy Hernandez + + * dwarf2out.c (multiple_reg_loc_descriptor): Fix thinko. + +2003-03-10 Andrew Pinski + + * config/darwin.c (machopic_function_base_name): If dynamic-no-pic + is on should not get here. + (machopic_indirect_data_reference): If dynamic-no-pic is on just + generate high/low parts of the address. + (machopic_legitimize_pic_address): Change MACHOPIC_PURE to + MACHOPIC_INDIRECT. Dynamic-no-pic uses 0 as the pic base. Generate + symbol and labels with a new reg. Dynamic-no-pic does not have a + pic_offset_table_rtx. + (machopic_select_section): Change references of flag_pic to + MACHOPIC_INDIRECT. + (machopic_asm_out_destructor): Likewise. + * config/darwin.h (ASM_DECLARE_UNRESOLVED_REFERENCE): Change + reference of flag_pic to MACHOPIC_INDIRECT. + (MACHO_DYNAMIC_NO_PIC_P): Define as TARGET_DYNAMIC_NO_PIC. + (MACHOPIC_INDIRECT): Is also true when dynamic-no-pic is on. + (MACHOPIC_JUST_INDIRECT): Is also true when dynamic-no-pic is on. + (MACHOPIC_PURE): Is not pure when dynamic-no-pic is on. + * config/i386/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define as + 0 for right now as dynamic-no-pic is not implemented on Darwin/ia32. + * config/rs6000/darwin.h (MASK_MACHO_DYNAMIC_NO_PIC): Define. + (TARGET_DYNAMIC_NO_PIC): Define. + (SUBTARGET_SWITCHES): Define, have sub-target switches for + dynamic-no-pic. + (SUBTARGET_OVERRIDE_OPTIONS): Move check for -fpic from + rs6000_override_options to here. Dynamic-no-pic overrides + pic. + (CC1_SPEC): Change from not static then pic to not static and not + dynamic-no-pic then pic. + * config/rs6000/rs6000.c (rs6000_override_options): Move the + check for -fpic and DARWIN_ABI to config/rs6000/darwin.h + (rs6000_legitimize_reload_address): Add case for loading floating in + dynamic-no-pic. + (rs6000_emit_move): Add case for dynamic-no-pic. Change reference + of flag_pic to MACHOPIC_INDIRECT. + (secondary_reload_class): Conditional change the reference of + flag_pic to MACHOPIC_INDIRECT. + (rs6000_output_mi_thunk): Change reference of flag_pic to + MACHOPIC_INDIRECT. + (output_profile_hook): Likewise. + (machopic_output_stub): Non-pure (dynamic-no-pic) is now supported. + * config/rs6000/rs6000.md (movdf_low): Add the case for + MACHO_DYNAMIC_NO_PIC_P. + (call): Change references for flag_pic in TARGET_MACHO to + MACHOPIC_INDIRECT. + (SUBTARGET_OVERRIDE_OPTIONS): Add case where -fpic is on and + -mdynamic-no-pic is on. Also move case for -fpic from rs6000.c. + * doc/invoke.texi (-mdynamic-no-pic): Document. + +2003-03-10 Devang Patel + + PR c++/9394 + * gcc.c (DEFAULT_SWITCH_TAKES_ARG): Remove. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove. + * gcc.h (DEFAULT_SWITCH_TAKES_ARG): Add. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Add. + * cppspec.c (DEFAULT_SWITCH_TAKES_ARG): Remove. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Remove. + +2003-03-10 Steven Bosscher + + PR optimization/7189 + * toplev.c (rest_of_compilation): Move + check_function_return_warnings up to just after + delete_unreachable_blocks. + +2003-03-10 Stephane Carrez + + * config/m68hc11/m68hc11.h (HARD_REGNO_RENAME_OK): Define. + * config/m68hc11/m68hc11-protos.h (m68hc11_hard_regno_rename_ok): + Declare. + * config/m68hc11/m68hc11.c (m68hc11_hard_regno_rename_ok): New function + for reg rename optimization to avoid using Z and Y registers. + +2003-03-10 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*addhi3_68hc12"): Accept any constant + when adding to X and Y since leax/leay are fast. + ("*addhi3"): Accept 'I' constraint when adding to address register. + ("rotlhi3"): Operand 1 must be a register_operand. + (peephole2): New peephole to optimize some adds. + * config/m68hc11/m68hc11.h (CONST_OK_FOR_LETTER_P): Use 'I' constraint + to represent -2 .. 2 small integer range. + +2003-03-10 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_rotate): Set carry before + each 16-bit rotation. + +2003-03-10 Zack Weinberg + + * c-opts.c (add_prefixed_path): Don't use concat. When + prefixing with cpp_GCC_INCLUDE_DIR, copy only the first + cpp_GCC_INCLUDE_DIR_len characters. + +2003-03-10 Segher Boessenkool + + * testsuite/gcc.dg/altivec-9.c: New file. + + * config/rs6000/rs6000.c (altivec_frame_fixup): Remove. + (rs6000_emit_prologue): Use rs6000_frame_related instead. + +2003-03-10 Aldy Hernandez + + * config/rs6000/spe.h: Define __ev64_*64__ to use single element + vectors. + (__ev_convert_u64): Remove macro. Define as inline. + (__ev_convert_s64): Same. + +2003-03-10 Aldy Hernandez + + * config/rs6000/rs6000.h (DWARF_FRAME_REGISTERS): Define. + (rs6000_stack_t): Add spe_64bit_regs_used. + + * config/rs6000/rs6000.c (rs6000_stack_info): Calculate + spe_64bit_regs_used, and use it to determine the size of the + frame. + (spe_func_has_64bit_regs_p): New. + (spe_synthesize_frame_save): New. + (rs6000_frame_related): Handle SPE synthetic registers. + (rs6000_emit_prologue): Only save in 64-bits if the function used + any registers in 64-bit mode. + (rs6000_emit_epilogue): Same, but for restore. + +2003-03-10 Richard Earnshaw + + * arm.h (enum floating_point_type): Delete. Replace with... + (enum fputype): ... new. + (FPUTYPE_DEFAULT): Renamed from FP_DEFAULT. Values reworked. + * linux-elf.h (FPUTYPE_DEFAULT): Likewise. + * arm.md (attr fpu): Reworked for new underlying enum values. + * arm.c (arm_fpu_arch): Now enum fputype. + (arm_fpu_tune): Renamed from arm_fpu. Now enum fputype. + (arm_override_options, arm_output_epilogue, arm_expand_prologue): + Update uses of arm_fpu_arch and arm_fpu_tune. + +2003-03-10 Josef Zlomek + + * cfgcleanup.c (outgoing_edges_match): Compare the jump tables. + (try_crossjump_to_edge): Replace refereces to one jump table by + references to identical jump table. + * loop.c (load_mems): Moved setting the JUMP_LABEL to replace_label. + (replace_label): Moved to rtlanal.c. + (struct rtx_pair): Moved to rtl.h. + * rtl.h (struct rtx_pair): Moved from loop.c. + (replace_label): New extern function. + (subrtx_p): New extern function. + (tablejump_p): New extern function. + * rtlanal.c (replace_label): Moved from loop.c. + (subrtx_p_1): New static function. + (subrtx_p): New function. + (tablejump_p): New function. + +2003-03-10 Jan Hubicka + + * cfgcleanup.c (try_optimize_cfg): Fix thinko in previous patch. + + * cfgcleanup.c (merge_blocks): Return where to iterate next. + (try_optimize_cfg): Use return value of merge_blocks + +2003-03-10 Michael Matz + + * cfg.c (unchecked_make_edge): New. + (cached_make_edge): Use it. + * basic-block.h (unchecked_make_edge): Declare. + * cfglayout.c (cfg_layout_duplicate_bb): Use it. + +2003-03-10 Richard Earnshaw + + * fpa.md: New file. Move all patterns relating to FPA co-processor + to here... + * arm.md: ... from here. + (cirrus.md, fpa.md): Include at end of description. + (divsf3, divdf3, modsf3, movdf3, sqrtsf2, sqrtdf2): New expands. + (pic_load_addr_based): Remove register constraint from expander. + (seq, sne, sgt, sle, slt, sge, sgeu, sleu, sgtu, sltu, sunordered) + (sordered, sungt, sunle, sunge, sunlt): Likewise. + (eh_epilogue, tablejump): Likewise. + +2003-03-09 Richard Kenner + + * tree.c (substitute_in_expr, case 'e'): Only make recursive call + on operands if it has a PLACEHOLDER_EXPR. + +2003-03-09 David Edelsohn + Mostafa Hagog + + * config/rs6000/rs6000.md (movsi_update1): Add TARGET_UPDATE final + condition. + +2003-03-09 Neil Booth + + * config/frv/frv.h: Use TARGET_CPU_CPP_BUILTINS, not CPP_PREDEFINES. + * config/ip2k/ip2k.h: Similarly. + * config/m32r/m32r.h: Similarly. + * config/m68hc11/m68hc11.h: Similarly. + * config/mn10200/mn10200.h: Similarly. + * config/mn10300/mn10300.h: Similarly. + * config/pdp11/pdp11.h: Similarly. + * config/v850/v850.h: Similarly. + * config/rs6000/vxworks.h: Similarly for TARGET_OS_CPP_BUILTINS. + * config/v850/retms.h: Similarly for TARGET_OS_CPP_BUILTINS. + * config/mips/iris3.h: Remove #if 0 block. + +2003-03-09 Roger Sayle + Joern Rennecke + + * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle + pending argument upon return from handle_braces here. + (do_spec_2): Instead handle it upon return from do_spec_1 here. + +2003-03-09 Roger Sayle + Joern Rennecke + + * gcc.c (do_spec_1) ['{']: Revert 2003-02-24 patch. Don't handle + pending argument upon return from handle_braces here. + (do_spec_2): Instead handle it upon return from do_spec_1 here. + +2003-03-09 Franz Sirl + + * varasm.c (make_decl_one_only): Use declare_weak(). + +2003-03-09 John David Anglin + + PR middle-end/9986 + * c-common.c (c_common_nodes_and_builtins): Initialize target builtins + after the common builtins. + * pa-hpux.h (DONT_HAVE_FPUTC_UNLOCKED): Define. + * pa.c (TARGET_INIT_BUILTINS): Define. + (pa_init_builtins): New function. + + * pa.md (call, call_value, sibcall, sibcall_value): When sufficient + space has been allocated for the outgoing arguments, set the arg + pointer for a call emitted after virtuals have been instantiated + using the stack pointer offset, otherwise abort. + +2003-03-09 DJ Delorie + + * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH): Revert. + +2003-03-09 Richard Earnshaw + + * arm.md (fix_truncsfsi2, fix_truncdfsi2, arm_fix_truncsfsi2) + (arm_fix_truncdfsi2): Add missing fix in floating point mode before + conversion to integer. + * cirrus.md (cirrus_truncsfsi2, cirrus_truncdfsi2): Likewise. + +2003-03-09 Roger Sayle + + * builtins.def: Fix typo and improve grammar. + * loop-unroll.c (decide_peel_completely): Tidy log message. + +2003-03-09 Kazu Hirata + + * config/h8300/h8300.md (*tstsi_upper_bit): New. + (*iorsi3_e2f): Likewise. + +2003-03-08 Kazu Hirata + + * config/h8300/h8300.c (h8300_and_costs): Return the number of + assembly instructions needed. + (h8300_shift_costs): Likewise. + +2003-03-09 Hans-Peter Nilsson + + * config/cris/aout.h (ENDFILE_SPEC): Undef. + + * optabs.c (gen_move_insn): Move logic for synthesizing MODE_CC + moves from here ... + * expr.c (emit_move_insn_1): ... to here. + + * config/cris/aout.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__AOUT__ to... + (TARGET_OS_CPP_BUILTINS): New macro. + * config/cris/cris.h (CRIS_CPP_SUBTARGET_SPEC): Move -D__ELF__ to... + (TARGET_OS_CPP_BUILTINS): New macro. + (CPP_PREDEFINES): Don't define. Move old definitions and... + (CPP_SPEC): ...move -D__CRIS_ABI_version=2 to... + (TARGET_CPU_CPP_BUILTINS): New macro. + * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC): Move constant + definitions and the optional __PIC__, __pic__ and + __NO_UNDERSCORES__ definitions to... + (TARGET_OS_CPP_BUILTINS): New macro. + + * flags.h (flag_leading_underscore): Declare. + + * c-opts.c (c_common_post_options): On fopen failure, return + false, not NULL. + +2003-03-08 Hans-Peter Nilsson + + * config/cris/cris_abi_symbol.c: #include tconfig.h and tm.h, not + config.h. + * config/cris/cris.h (HAVE_GAS_HIDDEN): Don't define here. + * config/cris/aout.h (HAVE_GAS_HIDDEN): Undef. + +2003-03-08 Neil Booth + + * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of + CPP_PREDEFINES. + * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of + CPP_PREDEFINES. + +2003-03-08 Neil Booth + + * c-common.h (c_common_init, c_common_post_options): Update. + * c-objc-common.c (c_objc_common_init): Update for new prototype. + * c-opts.c (saved_lineno): New. + (c_common_post_options, c_common_init): Update prototypes, + move call to cpp_read_main_file from latter to former. + * c-tree.h (c_ojbc_common_init): Update. + * langhooks-def.h (lhd_post_options): New. + (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update. + * langhooks.c (lhd_post_options): New. + * langhooks.h (struct lang_hooks): Update post_options and init hooks. + * toplev.c (no_backend): New. + (process_options): Call post_options hook and set main_input_filename + and input_filename here. + (lang_dependent_init, do_compile): post_options hook moved to + process_options. + * objc/objc-act.c (objc_init): Update prototype. + * objc/objc-act.h (objc_init): Update prototype. + +2003-03-08 Roger Sayle + + * emit-rtl.c (gen_lowpart): Don't attempt to load a part of + a complex or vector type, using a load in the original mode. + +2003-03-08 Jan Hubicka + + * Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h. + * gt-cgraph.h: New GC file. + * cgraph.c (known_fns): New static variable. + (cgraph_node): Add the decl into varray. + +2003-03-08 Hans-Peter Nilsson + + * config/mmix/mmix.md ("*movcc_expanded"): Add missing alternatives. + +2003-03-08 Richard Earnshaw + + * arm.c (fpa_rhs_operand, fpa_add_operand, const_double_rtx_ok_for_fpa) + (neg_const_double_ok_for_fpa, output_mov_long_double_fpa_from_arm) + (output_mov_long_double_arm_from_fpa, output_mov_double_fpa_from_arm) + (output_mov_double_arm_from_fpa): Renamed to use fpa instead of fpu. + All callers changed. + * arm.md, arm.h, arm-protos.h: Updated. + + * arm.h (enum reg_class FPA_REGS): Renamed from FPU_REGS. + (CLASS_MAX_NREGS, REGISTER_MOVE_COST, REG_CLASS_FROM_LETTER): Updated. + * arm.c (arm_regno_class, f_register_operand): Updated. + +2003-03-08 Hans-Peter Nilsson + + * config/cris/cris.h: Remove EGCS references. + (CPP_SPEC): Remove "-$". + (INIT_CUMULATIVE_ARGS): Adjust parameter name to FNDECL. + +2003-03-08 Neil Booth + + * config/stormy16/stormy16.h (TARGET_CPU_CPP_BUILTINS): Use in + preference to CPP_PREDEFINES. + +2003-03-08 Neil Booth + + * cppinit.c (cpp_finish_options): Set first_unused_line to -1. + +2003-03-08 Kazu Hirata + + * config/h8300/h8300.md (*extzv_16_8): New. + +2003-03-08 Jan Hubicka + + * c-decl.c: (finish_function): Update call of tree_inlinable_function_p. + * cgraph.h: (cgraph_local_info): Add can_inline_once + (cgraph_global_info): Add inline_once. + (cgraph_node): Add previous. + (cgraph_remove_node): New. + * cgraphunit.c (cgraph_mark_functions_to_inline_once): New static + function. + (cgraph_optimize): Call it. + (cgraph_finalize_function): Set inlinable flags. + (cgraph_finalize_compilation_unit): Actually remove the reclaimed nodes. + (cgraph_mark_functions_to_output): Use new inlining heuristics flags. + (cgraph_expand_function): Likewise. + * cgraph.c + (cgraph_node): Put nodes into doubly linked chain. + (cgraph_remove_node): New function. + * flags.h (flag_inline_functions_called_once): Declare. + * tree-inline.c: Include cgraph.h + (inlinable_functions_p): Add extra argument to bypass limits. + (expand_call_inline): Obey cgraph flag. + * tree-inline.h (tree_inlinable_function_p): Update prototype. + +2003-03-08 Zdenek Dvorak + + * gcse.c (bypass_block, bypass_conditional_jumps): Do not create + irreducible loops. + + * loop-unroll.c (unroll_loop_runtime_iterations): Update irreducible + loops info correctly. + +2003-03-08 Eric Botcazou + + PR middle-end/7796 + * unroll.c (calculate_giv_inc): Handle constants being + loaded with LSHIFTRT. + +2003-03-07 David Edelsohn + + * config/rs6000/rs6000.c (processor_target_table): Do not disable + GP optional instructions on Power3, Power4, 620, and 630. + +2003-03-07 Kazu Hirata + + * calls.c: Fix comment formatting. + * cfgloopanal.c: Likewise. + * cfgloopmanip.c: Likewise. + * combine.c: Likewise. + * dwarf2out.c: Likewise. + * ggc-common.c: Likewise. + * langhooks.c: Likewise. + * loop-unroll.c: Likewise. + * loop.c: Likewise. + * ra-build.c: Likewise. + * sbitmap.c: Likewise. + * toplev.c: Likewise. + +2003-03-07 James E Wilson + + * config/sh/sh.h (HARD_REGNO_NREGS): Round up the XD register count. + +2003-03-07 Geoffrey Keating + + * objc/lang-specs.h (objective-c-header): Use .gch not .pch; + support -no-integrated-cpp. + + * c-pch.c (get_ident): Use c_language_kind and flag_objc rather + than langhooks.name. + +2003-03-07 Michael Matz + + * df.h (enum df_ref_flags.DF_REF_STRIPPED): New. + (DF_FOR_REGALLOC): New. + * df.c (df_ref_record): Set DF_REF_STRIPPED. + (read_modify_subreg_p): Simplify. + (df_def_record_1, df_uses_record): Set DF_REF_MODE_CHANGE more often. + Use DF_FOR_REGALLOC. + * ra.h (struct web): New member subreg_stripped. + (invalid_mode_change_regs): Declare. + * ra.c (invalid_mode_change_regs): New. + (init_ra): Initialize it. + * ra-build.c (init_one_web_common, remember_web_was_spilled): Use it. + Use CANNOT_CHANGE_MODE_CLASS as ifdef guard. + (reinit_one_web, parts_to_web_1): Deal with subreg_stripped. + * ra-colorize.c (colorize_one_web): Use invalid_mode_change_regs. + Use CANNOT_CHANGE_MODE_CLASS as ifdef guard. + +2003-03-07 Richard Earnshaw + + * arm.md (addsf3, adddf3, subsf3, subdf3, mulsf3, muldf3, negsf2) + (negdf2, abssi2, abssf2, absdf2, floatsisf2, floatsidf2) + (fix_truncsfsi2, fix_truncdfsi2, truncdfsf2): Moved back into main + machine description file from ... + * cirrus.md: ... here. + +2003-03-06 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Don't use + reg_overlap_mentioned_p. + +2003-03-06 Geoffrey Keating + + * c-pch.c: Include langhooks.h. + (IDENT_LENGTH): New. + (get_ident): New. + (pch_ident): Delete. + (pch_init): Use get_ident, IDENT_LENGTH. + (c_common_valid_pch): Likewise. Also, use actual language + in warning message. + * Makefile.in (c-pch.o): Add langhooks.h to dependencies. + + * objc/config-lang.in (gtfiles): Add objc-act.c. Remove duplicate + c-parse.in. + * objc/Make-lang.in (objc/objc-act.o): Add dependency on + gt-objc-objc-act.h. + (gt-objc-objc-act.h): New rule. + * objc/lang-specs.h: Support PCH. + * objc/objc-act.c: Include gt-objc-objc-act.h. + (objc_add_static_instance): Move num_static_inst out, mark for PCH. + (build_selector_reference_decl): Move idx out, mark for PCH. + (build_class_reference_decl): Likewise. + (build_objc_string_decl): Move *_idx out, mark for PCH. + (build_tmp_function_decl): Move xxx out, mark for PCH. + +2003-03-06 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_binds_local_p): Consider + global functions for inlining on Darwin. + +2003-03-06 Vladimir Makarov + + * haifa-sched.c (schedule_block): Don't call reorder when sorting + is prohibited. + +2003-03-06 Neil Booth + + * Makefile.in (c-ppoutput.o): Update. + * c-common.h (init_pp_output): New. + (preprocess_file): Update. + * c-lex.c (init_c_lex): Move mbchar initialization to cpplib. + Register builtins. + * c-opts.c (c_common_init): Call init_pp_output if preprocessing. + Make call to cpp_read_main_file common to whether preprocessing + or not. Don't register builtins. + * c-ppoutput.c: Include c-pragma.h. + (setup_callbacks): Rename init_pp_output. + (preprocess_file): No longer setup callbacks or call + cpp_read_main_file. + * cpphash.h (_cpp_init_mbchar): New. + * cppinit.c (init_library): Call _cpp_init_mbchar. + * cpplex.c (_cpp_init_mbchar): New. + +2003-03-06 Roger Sayle + + * emit-rtl.c (gen_lowpart): When requesting the low-part of a + MEM, try loading the MEM into a register and taking the low-part + of that, to help CSE see the use of the MEM in its true mode. + +2003-03-05 Tom Tromey + + * config/stormy16/stormy16.h (DWARF_LINE_MIN_INSTR_LENGTH): + Define. + +2003-03-05 Nick Clifton + + * config/stormy16/stormy16.md ("*eqbranchsi"): Remove '+' on + operand 2. + ("*ineqbranchsi"): Likewise. + +2003-03-05 Andrew Haley + + * config/stormy16/stormy16.c (xstormy16_expand_prologue): Delete + mem_fake_push_rtx. Instead construct a SEQUENCE to show the + register store followed by a stack increment. + +2003-03-05 Chris Moller + + * config/stormy16/stormy16.c (REG_NEEDS_SAVE): added a term + to inhibit saving CARRY_REGS. + + * config/stormy16/stormy16.c (xs_hi_general_operand): + added predicate to detect and error-out on out-of-range + const_ints for movhi. + * config/stormy16/stormy16.md (movhi): use + xs_hi_general_operand. + + * config/stormy16/stormy16.c (xstormy16_expand_prologue): + added a check for local vbl size overflow. + * config/stormy16/stormy16.c (xs_hi_nonmemory_operand): + added predicate to detect and error-out on out-of-range + const_ints for addhi and subhi. + * config/stormy16/stormy16.md (addhi3, addchi4, addchi5, + subhi3, subchi4, subchi5): used xs_hi_nonmemory_operand. + + * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): + add a term to accept PRE_MODIFY addresses. + * config/stormy16/stormy16.c (xstormy16_expand_move): + add code to expand PRE_MODIFY addresses to an add followed + by a move. + +2003-03-06 Jason Merrill + + * tree-inline.c (inlinable_function_p): Revert earlier change + pending investigation. + +2003-03-06 Kazu Hirata + + * config/h8300/h8300.md (a new peephole2): New. + +2003-03-06 Jan Hubicka + + * cgraph.c (cgraph_node): Do not confuse nested functions and methods. + +2003-03-06 Zdenek Dvorak + + * dwarf2out.c (size_of_die): Compute size of external reference to + die correctly. + +2003-03-06 Hans-Peter Nilsson + + * config/mmix/mmix.md ("*movcc_expanded"): New pattern. + ("movcc", "movcc_uns", "movcc_fp", "movcc_fpeq", "movcc_fun"): New + expanders. + +2003-03-05 Roger Sayle + + * expr.h (lang_expand_expr): Delete obsolete prototype. + +2003-03-05 Kazu Hirata + + * emit-rtl.c (gen_highpart_mode): Fix a comment typo. + +2003-03-05 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Generalize to + accept a memory operand. + +2003-03-05 Olivier Hainque + + * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'. + * config/alpha/alpha.c (print_operand, case '+'): New. + * config/alpha/alpha.md (call_osf_1_noreturn): Document and use. + (call_value_osf_1_noreturn): Likewise. + +2003-03-05 Richard Kenner + + * stmt.c (fixup_gotos): Change meaning of DONT_JUMP_IN. + (expand_end_bindings): Likewise. + +2003-03-05 John David Anglin + + * pa.md (return_external_pic): Add !TARGET_PA_20 to constraint. + (epilogue): Don't generate return_external_pic when emitting PA 2.0 + code. + +2003-03-05 Aldy Hernandez + + * doc/tm.texi: Document TARGET_DWARF_REGISTER_SPAN. + + * config/rs6000/rs6000.c (rs6000_dwarf_register_span): New. + + * hooks.c (hook_rtx_rtx_null): New. + + * hooks.h (hook_rtx_rtx_null): Protoize. + + * target-def.h (TARGET_DWARF_REGISTER_SPAN): New macro. + (TARGET_INITIALIZER): Add TARGET_DWARF_REGISTER_SPAN. + + * target.h (struct gcc_target): Add dwarf_register_span. + + * dwarf2out.c (multiple_reg_loc_descriptor): New. + (one_reg_loc_descriptor): New. + (reg_loc_descriptor): Add support for values that span more than + one register. + +2003-03-05 Jan Hubicka + + * Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h + * alias.c: Include cgraph.h + (mark_constant_function): Use cgraph_rtl_info. + * calls.c: Include cgraph.h + (flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const + calls. + (expand_call): Use cgraph_rtl_info to set preferred stack boundary. + * cgraph.c (cgraph_rtl_info): New function. + * cgraph.h (cgraph_rtl_info): Declare + (cgraph_rtl_info): Likewise. + * function.h (struct function): Add recursive_call_emit. + * toplev.c: Include cgraph.h. + (rest_of_compilation): Set preferred_incoming_stack_boundary. + +2003-03-05 Kazu Hirata + + * config/h8300/h8300.c (output_simode_bld): Clear the + destination first if possible. + * config/h8300/h8300.md (extzv_1_r_h8300hs): Add an + alternative. + (extzv_1_r_inv_h8300hs): Likewise. + +2003-03-05 Zdenek Dvorak + + * basic-block.h (EDGE_IRREDUCIBLE_LOOP, EDGE_ALL_FLAGS): New. + * cfg.c (dump_edge_info): Add EDGE_IRREDUCIBLE_LOOP flag dump. + * cfgloop.c (flow_loop_free): Made global. + (establish_preds): New static function. + (flow_loop_tree_node_add): Handle subloops of added loop correctly. + (get_loop_exit_edges): New. + (verify_loop_structure): Verify EDGE_IRREDUCIBLE_LOOP flags. + * cfgloop.h (flow_loop_free, get_loop_exit_edges, unloop): Declare. + * cfgloopanal.c (mark_irreducible_loops): Mark edges in irreducible + loops. + * cfgloopmanip.c (loop_delete_branch_edge): Allow to test for + removability of an edge. + (fix_irreducible_loops): New static function. + (find_path, remove_path): Add ability to remove enclosing loops. + (unloop): New. + (copy_bbs, duplicate_loop_to_header_edge): Use EDGE_IRREDUCIBLE_LOOP + flags. + * cfgrtl.c (verify_flow_info): Handle EDGE_IRREDUCIBLE_LOOP flag. + * loop-unroll.c (peel_loops_completely): Do not duplicate loop if + not neccessary. + (decide_peel_completely, peel_loops_completely): Allow complete peeling + of non-duplicable once rolling loops. + * loop-unswitch.c (unswitch_loop): Update EDGE_IRREDUCIBLE_LOOP flags. + +2003-03-05 J"orn Rennecke + + * sh.h (OVERRIDE_OPTIONS): For TARGET_SHMEDIA, the minimum value + for align_jumps is 4. + + (SECONDARY_INPUT_RELOAD_CLASS): If reloading a PLUS into FPUL, + use GENERAL_REGS. + +2003-03-05 Stephane Carrez + + * config/m68hc11/m68hc11.h (PAD_VARARGS_DOWN): Define and return + according to va_arg type. + (EXPAND_BUILTIN_VA_ARG): Remove. + * config/m68hc11/m68hc11.c (m68hc11_va_arg): Remove. + * config/m68hc11/m68hc11-protos.h (m68hc11_va_arg): Remove. + +2003-03-05 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_variable_issue): Remove unnecessary + else clauses. + +2003-03-05 Michael Matz + + * i386/i386.c (ix86_save_reg): Also test + current_function_uses_const_pool. + +2003-03-05 Michael Matz + + * unwind.h: Add the GPL exception. + * Makefile.in (USER_H): Add unwind.h. + +2003-03-05 Eric Botcazou + + PR c/9799 + * c-typeck.c (push_init_level): Add sanity check. + +2003-03-05 Jan Hubicka + + * toplev.c (rest_of_compilation): Defer RTL compilation only when + RTL inlining is done. + + * cgraphunit.c (cgraph_mark_local_functions): New local function. + (cgraph_optimize): Mark local functions. + * i386-protos.h (init_cumulative_args): Update prototype. + * i386.c (init_cumulative_args): Use register passing convention for + local functions. + + * cgraph.c (cgraph_global_info_ready): New global variable + (cgraph_local_info, cgraph_global_info): New functions. + * cgraph.h (struct cgraph_local_info, cgraph_global_info): New + structures. + (cgraph_local_info, cgraph_global_info, cgraph_global_info_ready): + Declare. + * cgraphunit.c (cgraph_finalize_function): Set inline_many. + (cgraph_mark_functions_to_output): Use inline_many. + (cgraph_expand_function): Free DECL_SAVED_TREE uncondtionally. + (cgraph_expand_functions): Expand inline functions last. + (cgraph_optimize): Do not emit uneeded functions. + +2003-03-04 Steve Ellcey + + * expr.c (convert_modes): Check for legal hard register. + +2003-03-04 Tom Tromey + + * doc/sourcebuild.texi (Front End Directory): Document tags. + * configure: Rebuilt. + * configure.in (target_list): Added tags. + * Makefile.in (TAGS): Depend on lang.clean. Include subdirectory + TAGS files by reference. + * objc/Make-lang.in (objc.tags): New target. + +2003-03-04 Zdenek Dvorak + + * gcov-io.h (gcov_save_position, gcov_reserve_length, gcov_resync, + gcov_skip, gcov_skip_string, gcov_write_unsigned, gcov_write_counter, + gcov_write_string, gcov_read_unsigned, gcov_read_counter, + gcov_read_string, gcov_write_length): Modified to enable reading/ + writing of whole .da file just once. + (da_file_open, da_file_close, da_file_eof, da_file_error, + da_file_position, da_file_seek, da_file_write, da_file_read): New + functions. + (actual_da_file, actual_da_file_position, actual_da_file_length, + actual_da_file_buffer, actual_da_file_buffer_size): New static + functions. + * libgcov.c (gcov_exit): Modified to read/write the whole .da file at + just once. + + +2003-03-04 Andreas Schwab + + * config/m68k/m68k.c (m68k_output_function_prologue): Fix CFA + offset without frame pointer. + +2003-03-04 Steve Ellcey + + * expr.c (expand_expr): Call promote_mode to set unsignedp. + +2003-03-04 Daniel Jacobowitz + + * configure.in: Don't always define TARGET_SYSTEM_ROOT. + * configure: Regenerated. + * gcc.c: Check whether TARGET_SYSTEM_ROOT is defined. + +2003-03-04 Andreas Jaeger + + * configure.in: Check for . + * configure: Regenerated. + + * config.in: Define HAVE_MEMCHECK_H. + + * ggc-common.c: Use if available instead of + . + * ggc-page.c: Likewise. + * cppfiles.c: Likewise. + +2003-03-04 Kazu Hirata + + * config/h8300/h8300.md (*extzv_8_8): Fix cc and lengths. + +2003-03-04 Eric Botcazou + + PR c/9262 + * c-typeck.c (do_case): Attach the first case label to the SWITCH_BODY. + (c_finish_case): Rechain the next statements to the SWITCH_STMT. + +2003-03-04 Jan Hubicka + + * doc/invoke.texi: Document that unit-at-a-time is enabled for -O3 + * toplev.c (parse_options_and_default_flags): Enable flag_unit_at_a_time + for -O3. + +2003-03-04 Nathanael Nerode + + * configure.in: Delete three unused variables. Move a variable + definition closer to its use. Simplify use_collect2 logic. Start to + organize. Simplify tests for in-tree gas and ld. + * configure: Regenerate. + +2003-03-04 Neil Booth + + * Makefile.in: Update. + * c-common.c (flag_no_line_commands, flag_no_output, + flag_dump_macros, flag_dump_includes): New. + * c-common.h (flag_no_line_commands, flag_no_output, + flag_dump_macros, flag_dump_includes, preprocess_file): New. + (init_c_lex): Update prototype. + * c-lex.c (init_c_lex): Update prototype; move some code to + c_common_init. + * c-opts.c (preprocess_file): Subsume into c_common_init. + (c_common_decode_option): Update flags. + (c_common_init): Move code from preprocess_file and init_c_lex. + (sanitize_cpp_opts): Update. + * c-ppoutput.c: New, cppmain.c almost verbatim. + * cpphash.h (struct printer): Remove. + (struct cpp_reader): Remove print. + * cpplib.h (dump_none, dump_only, dump_names, dump_definitions, + cpp_preprocess_file): Remove. + (struct cpp_options): Remove no_output, no_line_commands, dump_macros + and dump_includes. + * cppmain.c: Remove. + * doc/passes.texi: Update. + +2003-03-04 John David Anglin + + * function.c (STACK_ALIGNMENT_NEEDED): New macro. Default to 1. + (assign_stack_local_1): Perform overall stack alignment only when + STACK_ALIGNMENT_NEEDED is nonzero. + * doc/tm.texi (STACK_ALIGNMENT_NEEDED): Document. + + * pa.c (compute_frame_size): Rename fsize to size. Account for + alignment to a word boundary before general register save block. Only + account for double-word alignment before floating point register save + block if one or more are saved. Don't allocate space for %r3 when + frame pointer is needed. + (hppa_expand_prologue): Include alignment to word boundary in local + frame size. + * pa.h (STARTING_FRAME_OFFSET): Define to 8 on both 32 and 64-bit ports. + (STACK_ALIGNMENT_NEEDED): Define. + +2003-03-04 Kevin Buettner + + * dwarf2out.c (rtl_for_decl_location): Don't return NULL_RTX for + global register variables. + +2003-03-04 Alexandre Oliva + + * reload.c (reload_adjust_reg_for_mode): New function. + (subst_reloads): Call it. + (operands_match_p): Adjust registers using HARD_REGNO_NREGS. + * reload.h (reload_adjust_reg_for_mode): Declare. + * reload1.c (emit_input_reload_insns, emit_output_reload_insns): + Call it. + +2003-03-03 James E Wilson + + * optabs.c (add_equal_note): Delete SUBREG_REG use. + Fixes PR c/7872. + +2003-03-03 Kazu Hirata + + * config/h8300/h8300.md (*ixorsi3_ashift_16): New. + (*ixorsi3_lshiftrt_16): New. + (*iorsi3_ashift_16): Remove. + +2003-03-03 Kazu Hirata + + * config/h8300/h8300.md (*extzv_8_8): Use '?' to simplify the + pattern. + +2003-03-03 Geoffrey Keating + + * doc/install.texi (Specific): Update entry for powerpc-darwin. + +2003-03-03 Richard Henderson + + * config/ia64/ia64.h (HAVE_AS_LTOFFX_LDXMOV_RELOCS): Default to 0. + +2003-03-03 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_multipass_dfa_lookahead): Delete. + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): Delete. + (rs6000_variable_issue): Do not return negative value. + (rs6000_issue_rate): Uniformly set issue rate to 1 for first + scheduling pass. + +2003-03-03 Zdenek Dvorak + + * dwarf2out.c (dwarf2out_finish): Swap order of break_out_includes and + prune_unused_types calls. + +2003-03-03 Jason Merrill + + * tree-inline.c (find_builtin_longjmp_call): Save and restore + lineno and input_filename. + (find_alloca_call): Likewise. + (inlinable_function_p): Run the langhook earlier. + + * calls.c (compute_argument_addresses): Give the new MEMs a + minimum alignment of PARM_BOUNDARY. + +2003-03-03 J"orn Rennecke + + * config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and + subtarget_asm_isa_spec. + (SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define. + (ASM_SPEC): Define as SH_ASM_SPEC. + (SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h. + Use subtarget_asm_relax_spec and subtarget_asm_isa_spec. + * config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC. + (SUBTARGET_ASM_ISA_SPEC): Undef / define. + + * sh.h (OVERRIDE_OPTIONS): Set default values for align_loops + and align_jumps if not set. + Force align_jumps to be at least 2. + When relaxing, force align_functions to be at least the maximum of + align_loops, align_jumps and 4. + * sh.c (find_barrier, barrier_align): Honour align_jumps_log. + (sh_loop_align): Honour align_loops_log. + + * sh.md (length attribute): Use prev_nonnote_insn instead of PREV_INSN + to check for indirect_jump_scratch. + (indirect_jump_scratch): Add second set. + * sh.c (output_far_jump): Use prev_nonnote_insn instead of PREV_INSN + when looking for indirect_jump_scratch. + Extract scratch register taking new structure of indirect_jump_scratch + into account. + (gen_block_redirect): Set INSN_SCOPE for indirect_jump_scratch. + +2003-03-03 Jan Hubicka + + * calls.c (rtx_for_function_call): Take the address as an argument + (expand_call): Do not modify the expression. + + * toplev.c (rest_of_compilation): Avoid cfg_cleanup calls when not + optimizing. + +2003-03-03 Kazu Hirata + + * config/h8300/h8300.md (*ixorsi3_zext_hi): Restrict to + TARGET_H8300H and TARGET_H8300S. + +2003-03-03 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-03-03 Kazu Hirata + + * config/h8300/h8300.md (*extzv_8_8): Use shorter code when + operands[0] and operands[1] are different. + +2003-03-03 Kazu Hirata + + * reload1.c (reload_cse_move2add): Remove variable success. + +2003-03-02 Kaveh R. Ghazi + + * ggc-common.c (ggc_rlimit_bound): Cast RLIM_INFINITY to avoid + warnings. + +2003-03-02 Richard Henderson + + * configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test. + * config.in, configure: Rebuild. + * config/ia64/ia64.c (ia64_ld_address_bypass_p): Accept lo_sum. + * config/ia64/ia64.md (load_symptr): Use high/lo_sum for the + paired ldtoffx and ldxmov annotations. + (load_symptr_internal1): Remove. + (load_symptr_high, load_symptr_low): New. + +2003-03-02 Neil Booth + + * c-incpath.c (add_path): Fix sysp assignment. + +2003-03-02 Kurt Garloff + + * params.def: Introduce parameter max-inline-insns-rtl for + a separate limit for the RTL inliner. + * params.h: Likewise. + * integrate.c (function_cannot_inline_p): Use it. + * toplev.c (decode_f_option): Set multiple parameters + controlling inlining with -finline-limit. + * params.def: Fix orthographic and typographic errors. + * doc/invoke.texi: Document parameters controlling inlining + and the way -finline-limit sets multiple of them. + + * tree.h (struct tree_decl): Introduce inlined_function_flag, + recording whether the function became eligible for inlining + by a compiler flag rather than the declaration. + Provide DID_INLINE_FUNC macro to access it. + * c-decl.c (grokdeclarator): Set DID_INLINE_FUNC. + * cp/decl.c (grokfndecl): Likewise. + * toplev.c (rest_of_compilation): Likewise. + * cp/optimize (maybe_clone_body): Copy DID_INLINE_FUNC. + * print-tree.c (print_node): Report it. + * params.def: Introduce new max-inline-insns-auto limit. + * params.h: Likewise. + * tree-inline.c (inlinable_function_p): Apply it to functions + with DID_INLINE_FUNC set. + * toplev.c (decode_f_option): Initialize it from -finline-limit + value. + * doc/invoke.texi: Document new parameter. + +2003-03-02 Geoffrey Keating + + * fix-header.c (read_scan_file): Don't reference simplify_path. + +2003-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_override_options): Don't enable + min/max instructions by default as may result in reload errors. + +2003-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.md ("mulqi3"): Allow address register to + avoid reload problems; define split for it. + +2003-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_shift_operator): New function. + * config/m68hc11/m68hc11-protos.h (m68hc11_shift_operator): Declare. + * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register. + * config/m68hc11/m68hc11.md ("rotrhi3", "rotlhi3"): New patterns for + rotatert and rotate. + ("rotrhi3_const", "rotlhi3_const"): Rename of old 'rotrhi3' insns. + ("*rotrhi3", "*rotlhi3"): New insn pattern for non-const rotatert. + ("*rotrhi3_addr"): New split for shift insns on address register. + ("*lshrhi3", "*ashrhi3", "*ashlhi3_2"): Use new split. + * config/m68hc11/larith.asm (___rotlhi3): New asm function. + (___rotrhi3): Likewise. + * config/m68hc11/t-m68hc11-gas (LIB1ASMFUNCS): Build them. + +2003-03-02 Neil Booth + + * toplev.c (aux_base_name): Moved from toplev.h. + (filename): Constify. + (lang_dependent_init): Don't duplicate name. + (process_options): Set aux_base_name here, not... + (do_compile): ...here. Change protoype. + (toplev_main): Move some code from do_compile. + * toplev.h: Remove aux_base_name. + +2003-03-02 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + iorxor_operator. + * config/h8300/h8300.c (print_operand): Handle 'c'. + (iorxor_operator): New. + * config/h8300/h8300.h (PREDICATE_CODES): Add iorxor_operator. + * config/h8300/h8300.md (*iorhi3_zext): Remove. + (*iorsi3_zexthi): Likewise. + (*iorsi3_zextsi): Likewise. + (*xorhi3_zextqi): Likewise. + (*xorsi3_zexthi): Likewise. + (*xorsi3_zextsi): Likewise. + (*ixorhi3_zext): New. + (*ixorsi3_zext_qi): Likewise. + (*ixorsi3_zext_hi): Likewise. + +2003-03-02 Neil Booth + + * c-incpath.c (remove_component_p, simplify_path): Move back to + cppfiles.c. + (remove_duplicates): Use cpp_simplify_path. + * c-incpath.h (simplify_path): Remove. + * c-lex.c: Don't include c-incpath.h. + (init_c_lex): Remove simplify_path. + * cppfiles.c (remove_component_p, cpp_simplify_path): Restore. + (find_or_create_entry, validate_pch): Revert. + +2003-03-02 Ashif Harji + + * gcc.c (default_compilers): Add -no-integrated-cpp flag to invoke + an external cpp during compilation. + (option_map): Likewise. + * objc/lang-specs.h (default_compilers): Similarly. + * doc/invoke.texi: Document -no-integrated-cpp flag. + +2003-03-02 Kazu Hirata + + * config/h8300/h8300.md (zero_extendqisi2): Change to an + expander. + (*zero_extendqisi2_h8300): New. + (*zero_extendqisi2_h8300hs): New. + (two splitters): New. + +2003-03-02 Kaveh R. Ghazi + + * fp-bit.h (float_to_usi): Fix condition wrapping prototype. + +2003-03-01 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Remove dead code. + +2003-03-01 Roger Sayle + + PR c++/9367 + * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro. + (BT_FN_INT_CONST_STRING_VALIST_ARG, + BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, + BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, + BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, + BT_FN_INT_STRING_CONST_STRING_VAR, + BT_FN_INT_CONST_STRING_CONST_STRING_VAR, + BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types. + * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, + ATTR_NONNULL_3): Also include the nothrow attribute. + (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf, + vsnprintf, vscanf, vsscanf): Don't define attributes here. + * builtins.def (putchar, puts): Make full C89 built-ins. + (snprintf, sprintf, scanf, sscanf, vprintf, vscanf, + vsscanf, vsnprintf, vsprintf): New built-ins. + * c-common.c (c_common_nodes_and_builtins): Handle new macro + DEF_FUNCTION_TYPE_VAR_3. + + * doc/extend.texi: Document these new built-in functions. + +2003-03-01 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-03-01 Richard Earnshaw + + * predict.c (estimate_bb_frequencies): Correctly set + real_values_initialized after initialization. + +2003-03-01 Neil Booth + + * Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS, + cppinit.o, cppdefault.o, fix-header): Update. + * c-incpath.c: New file. + * c-incpath.h: New file. + * c-lex.c: Include c-incpath.h. + (init_c_lex): Register path simplifier. + * c-opts.c: Include cppdefault.h and c-incpath.h. + (TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc, + std_cxx_inc, quote_chain_split, add_prefixed_path): New. + (COMMAND_LINE_OPTIONS): Add more options from cpplib. + (missing_arg, c_common_decode_option): Handle them. + (c_common_post_options): Register include chains. + (print_help): Update. + * cppdefault.h (struct default include): Update. + Move some macros to ... + * cppdefault.c: ... here. + (cpp_include_defaults): Add extra field add_sysroot. + * cppfiles.c (include_file, search_from, find_or_create_entry, + cpp_included, find_include_file, remap_filename): Update for + renaming of search_path to cpp_path, and of the chain headers. + (remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c. + * cpphash.h (struct search_path): Move to cpplib.h. + (struct cpp_buffer, struct cpp_reader): Update. + (_cpp_simplify_pathname): Remove. + * cppinit.c: Don't include prefix.h and cppdefault.h. + (INO_T_EQ, INO_T_COPY, path_include, append_include_chain, + remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs, + init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir, + no_pth, cpp_handle_options): Remove. + (struct pending_option): Remove chain members. + (cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS, + cpp_handle_option): Update. + * cpplib.h (struct cpp_path, cpp_set_include_chains): New. + (struct cpp_options): Remove quote_include, bracket_include, + include_prefix, include_prefix_len, verbose, ignore_srcdir, + no_standard_includes, no_standard_cplusplus_includes. + (struct cpp_callbacks): Add simplify_path. + (cpp_handle_options): Remove. + * fix-header.c: Include c-incpath.h. + (read_scan_file): Update to use c-incpath functionality. + * doc/passes.texi: Update. + +2003-03-01 Kazu Hirata + + * config/h8300/h8300.c (bit_operand): Accept MEM only if it + satisfies EXTRA_CONSTRAINT 'U'. + +2003-03-01 Kazu Hirata + + * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Take a scratch + register. + (*tst_extzv_memqi_1_n): Change to a splitter. + (a peephole2): Update. + +2003-03-01 Richard Earnshaw + + * predict.c (estimate_bb_frequencies): Initialize the sreal + constants once per compilation. + +2003-02-28 Richard Henderson + + * toplev.c (flag_eliminate_unused_debug_types): Enable by default. + +2003-02-28 scott snyder + + * flags.h: Add flag_eliminate_unused_debug_types. + * toplev.c: Add flag_eliminate_unused_debug_types. + (f_options): Add -feliminate-unused-debug-types. + * dwarf2out.c (struct file_table): Add emitted member. + (splice_child_die): Fix the parent pointer for the child being + spliced. + (lookup_filename): Maintain file_table.emitted array. Don't + output .file directive here. + (maybe_emit_file): (new) + (init_file_table): Set up file_table.emitted. + (dwarf2out_source_line): Use maybe_emit_file. + (dwarf2out_start_source_file): Use maybe_emit_file. + (dwarf2out_init): Use maybe_emit_file. + (prune_unused_types_walk_attribs): (new) + (prune_unused_types_mark): (new) + (prune_unused_types_walk): (new) + (prune_unused_types_prune): (new) + (prune_unused_types): (new) + (dwarf2out_finish): Call prune_unused_types if + flag_eliminate_unused_debug_types is set. + * doc/invoke.texi (Option Summary): Add + -feliminate-unused-debug-types. + (Debugging Options): Likewise. + +2003-02-28 Geoffrey Keating + + * doc/invoke.texi: Change .pch to .gch. + * cppfiles.c (open_file_pch): Likewise. + * gcc.c (default_compilers): Likewise. + +2003-02-28 Aldy Hernandez + + * floatlib.c: Remove. + +2003-02-28 Jason Merrill + + * stor-layout.c (variable_size): Leave a "minus 1" outside the + SAVE_EXPR. + +2003-02-28 David Edelsohn + + * config/rs6000/power4.md: Add compare bypass. + +2003-02-28 Jason Thorpe + + * config/netbsd.h: Update copyright years. + (NETBSD_CPP_SPEC): Define _REENTRANT and _PTHREADS if + -pthread is specified on the command line. + +2003-02-28 Dale Johannesen + + * loop.c (struct movable): Add insert_temp, shrink savemode. + (scan_loop): Accept invariants that require copying; mark as + insert_temp. + (combine_movables): Don't combine insert_temp movables. + (move_movables): Insert copies for insert_temp movables. + Don't record the info based on regno for insert_temp's. + +2003-02-28 Joel Sherrill + + PR 9638/other + * config/i386/i386.c (DEFAULT_PCC_STRUCT_RETURN): Ensure the + this constant defaults to 1. + +2003-02-28 Bob Wilson + + * config.gcc (xtensa-*-linux*): Add t-slibgcc-elf-ver to tmake_file. + +2003-02-28 Richard Earnshaw + + * arm.md (mulhisi3, mulhisi3addsi, mulhidi3adddi): Enable for any + ARMv5e processor, not just for XScale. Instructions are predicable. + (mulhisi3tb, mulhisi3bt, mulhisi3tt): New patterns for ARMv5e. + +2003-02-28 Nick Clifton + + * config/arm/arm.c (note_invalid_constants): Change parameter type + from bool to int. + +2003-02-28 Kazu Hirata + + * config/h8300/h8300.md (*tst_extzv_bitqi_1_n): Accept the + test of bit 7. + (*tst_extzv_memqi_1_n): Likewise. + (a peephole2): New. + +2003-02-28 Richard Sandiford + + * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Wrap in + #ifndef __mips16. + +2003-02-28 Jan Hubicka + + * combine.c (gen_lowpart_for_combine): Update handling of + subregs_of_mode + * flow.c (life_analysis, mark_used_regs): Likewise. + * regclass.c (subregs_of_mode): Turn into single bitmap. + (cannot_change-mode_set_regs, invalid_mode_change_p): Update + dealing with subregs_of_mode + * regs.h (subregs_of_mode): Update prototype. + +2003-02-28 Josef Zlomek + + * emit-rtl.c (set_reg_attrs_for_parm): New function. + * rtl.h (set_reg_attrs_for_parm): New exported function. + * function.c (assign_parms): Use set_reg_attrs_for_parm instead of + set_reg_attrs_from_mem. + +2003-02-27 Roger Sayle + Zack Weinberg + + * gcc.c (do_spec_1): Treat %U like %u for unique associations. + +2003-02-27 Kazu Hirata + + * reload1.c (sext_for_mode): Remove. + (reload_cse_move2add): Use trunc_int_for_mode instead of + sext_for_mode. + (move2add_note_store): Likewise. + Reset register information if we see a set in non-integer + mode. + +2003-02-27 David Edelsohn + + * config/rs6000/aix43.h (ASM_SPEC): Only emit -mppc64 if no -mcpu + option. + (ASM_CPU_SPEC): Use -m620 for Power3, Power4, 620, 630. + * config/rs6000/aix51.h: Same. + * config/rs6000/aix52.h: Same. + * config/rs6000/power4.md: Additional VMX bypasses. + +2003-02-27 Geert Bosch + + * toplev.c (print_version): Add indentation for GGC heuristics and + output after printing version information. + +2003-02-27 James E Wilson + + * combine.c (simplify_comparison): Require integral mode when + permuting SUBREG with AND. + +2003-02-27 Steve Ellcey + + * config/ia64/hpux.h (STARTFILE_PREFIX_SPEC): Remove. + +2003-02-27 Nick Clifton + + * config/arm/arm.md (extendsfdf2): Add pattern accidentally + deleted when cirrus instructions were added. + +2003-02-27 Jason Thorpe + + * config.gcc (*-*-netbsd[2-9]*, *-*-netbsdelf[2-9]*): Enable + POSIX thread support by default. + +2003-02-27 Roger Sayle + + * config/i386/cygwin.h: Don't include any other files directly. + * config/i386/mingw32.h: Don't include cygwin.h directly. + * config.gcc (cygwin, mingw32, uwin): Instead make these files + explicit in the tm_files variable. + +2003-02-27 Alan Modra + + * config/rs6000/rs6000.md: Add TI constant splitter. + +2003-02-26 Alexandre Oliva + + * builtins.c (purge_builtin_constant_p): Handle subreg of + constant_p_rtx too. + + * function.c (assign_stack_local_1): Truncate constant added to + frame_pointer_rtx or virtual_stack_vars_rtx for Pmode. + +2003-02-26 David Edelsohn + + * config.gcc: Add power4 to PowerPC with_cpu list. + +2003-02-26 Jan Hubicka + + * objc-act.c: (mark_referenced_methods): Fix compilation problem. + +2003-02-26 Zdenek Dvorak + + * gcov-dump.c (print_prefix): Fix signedness warning. + * gcov-io.h (struct counter_section, struct counter_section_data): New. + (struct function_info): n_arc_counts field removed, n_counter_sections, + counter_sections fields added. + (struct gcov_info): arc_counts, n_arc_counts fields removed, + n_counter_sections, counter_sections fields added. + * libgcov.c (gcov_exit, __gcov_flush): Add support for multiple + profile sections. + * profile.h (MAX_COUNTER_SECTIONS): New. + (struct section_info): New. + (struct profile_info): count_instrumented_edges, + count_edges_instrumented_now fields removed, n_sections, section_info + fields added. + (find_counters_section): Declare. + * profile.c (struct function_list): count_edges field removed, + n_counter_sections, counter_sections fields added. + (set_purpose, label_for_tag, build_counter_section_fields, + build_counter_section_value, build_counter_section_data_fields, + build_counter_section_data_value, build_function_info_fields, + build_function_info_value, build_gcov_info_fields, + build_gcov_info_value): New static functions. + (find_counters_section): New function. + (instrument_edges, get_exec_counts, compute_branch_probabilities, + branch_prob, create_profiler): Modified to support multiple profile + sections. + +2003-02-26 John David Anglin + + * pa.c (compute_frame_size): Don't assume PREFERRED_STACK_BOUNDARY + is 8 * STACK_BOUNDARY. + * pa.h (PREFERRED_STACK_BOUNDARY): Change to 128 on 64-bit port. + +2003-02-26 Michael Matz + + * ra-colorize.c (merge_moves): Fix list handling. + +2003-02-26 Nick Clifton + + * config/arm/arm.c (is_load_address): Rename to... + (arm_memory_load_p) ... this and make it check for SUBREGs and + constant loads that will be converted into loads from the + minipool. + (is_cirrus_insn): Rename to ... + (arm_cirrus_insn_p): ... this, for consistency. Replace test + of CIRRUS_NO with CIRRUS_NOT. + (cirrus_reorg): Use renamed functions. + (note_invalid_constants): Change from a void function to bool. + Add an extra parameter, saying whether the fixups should be + pushed. Return true if fixups are needed. + (arm_reorg): Use renamed functions. Use INSN_P. Replace test + of CIRRUS_NO with CIRRUS_NOT. + * config/arm/arm.h (FLOAT_WORDS_BIG_ENDIAN): Mention that + other floating point co-processors can also affect this. + * config/arm/arm.md ("type" attribute): Add mav_farith and + mav_dmult. Replace references to "cirrus_type" attribute with + "type". + * config/arm/cirrus.md ("cirrus_fpu" attribute): Delete. + ("cirrus_type" attribute): Delete - use "type" instead. + ("cirrus" attribute): Replace 'no' with 'not' and 'yes' with + 'normal'. + +2003-02-25 Jan Hubicka + + * objc-act.c: Include cgraph.h + (mark_referenced_methods): New function. + (objc_init): Call it. + * objc-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Set. + + * c-decl.c (finish_function): Honor can_defer_p even in unit-at-a-time + mode. + + * optabs.c (expand_fix): Do not widen the input operand. + + * expr.c (emit_group_store): Fix crash when converting single + register into complex register. + + * Makefile.in (jump.o, regclass.o, alias.o): Add dependency on timevar.h + * alias.c: Include timevar.h + (init_alias_analysis): Set timevar + * jump.c: Include timevar.h + (rebuild_jump_labels): Set timevar + * regcalss.c: Include timevar.h + (reg_scan): Set timevar + * timevar.def (TV_ALIAS_ANALYSIS, TV_REG_SCAN, TV_REBUILD_JUMP): New + +2003-02-26 Zdenek Dvorak + + * cse.c (count_reg_usage): Fix handling of REG_EQUAL notes. + + * Makefile.in (loop-unroll.o): New. + * cfgloop.h (UAP_PEEL, UAP_UNROLL, UAP_UNROLL_ALL): New. + (unroll_and_peel_loops): Declare. + * alias.c (init_alias_analysis): Flag_unroll_loops renamed to + flag_old_unroll_loops. + * loop.c (loop_invariant_p): Ditto. + * unroll.c (unroll_loop): Flag_unroll_all_loops renamed to + flag_old_unroll_all_loops. + * flags.h (flag_unroll_loops): Renamed to flag_old_unroll_loops. + (flag_unroll_all_loops): Renamed to flag_old_unroll_all_loops. + * params.def (PARAM_MAX_UNROLLED_INSNS): Default value changed. + (PARAM_MAX_AVERAGE_UNROLLED_INSNS, PARAM_MAX_UNROLL_TIMES, + PARAM_MAX_PEELED_INSNS, PARAM_MAX_PEEL_TIMES, + PARAM_MAX_COMPLETELY_PEELED_INSNS, PARAM_MAX_COMPLETELY_PEEL_TIMES, + PARAM_MAX_ONCE_PEELED_INSNS): New. + * toplev.h (flag_old_unroll_loops, flag_old_unroll_all_loops): New. + (flag_unroll_loops, flag_unroll_all_loops): Used for new unroller + instead of old one. + (flag_peel_loops): New. + (lang_independent_options): The new flags added. + (rest_of_compilation): Call new unroller. + (process_options): Setup flags for coexistence of old and new unroller. + * doc/invoke.texi: Document new options. + * doc/passes.texi: Document new unroller pass. + +2003-02-26 David Billinghurst + + * fixinc/fixincl.x: Regenerate + +2003-02-26 Josef Zlomek + + * function.c (assign_parms): Set reg_attrs for parameters passed in + registers. + +2003-02-26 Alan Modra + + PR target/9681 + * tlink.c (scan_linker_output): Drop leading '.' from symbol names. + +2003-02-25 David Edelsohn + + * config/rs6000/xcoff.h (ASM_FILE_START): Do not emit machine + pseudo-op. + +2003-02-25 Roger Sayle + + * combine.c (combine_simplify_rtx, simplfy_comparison): Use CC0_P. + * cse.c (invalidate_skipped_set): Likewise. + * integrate.c (subst_constants): Likewise. + * jump.c (reversed_comparison_code_parts): Likewise. + * loop.c (canonicalize_condition): Likewise. + * simplify-rtx.c (simplify_relational_operation): Likewise. + +2003-02-25 Roger Sayle + + * builtins.def (DEF_LIB_ALWAYS_BUILTIN, DEF_UNUSED_BUILTIN): Delete. + (abs, labs, fabs, fabsf, fabsl, abort, exit, _exit, _Exit): Use + the appropriate macro to define built-in function. + (fmod,fmodf,fmodl): New built-in functions. + + * doc/extend.texi (fmod,fmodf,fmodl): Document new built-ins. + +2003-02-25 Richard Henderson + + * config/i386/i386.c (function_arg): Pass variable sized + structures correctly on the stack. + +2003-02-25 Kazu Hirata + + * reload1.c (reload_cse_move2add): Use STRICT_LOW_PART if PLUS + does not reduce the cost of SET. + +2003-02-25 Franz Sirl + + PR target/9732 + * config/rs6000/rs6000.c (first_reg_to_save): Handle + PIC_OFFSET_TABLE_REGNUM for -fPIC too. + (rs6000_emit_prologue): Likewise. + (rs6000_emit_epilogue): Likewise. + * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Make + PIC_OFFSET_TABLE_REGNUM a fixed register for -fPIC. + +2003-02-25 Richard Henderson + + * real.c (real_to_integer2): Force overflow result only for + unsigned overflow. + +2003-02-25 Kazu Hirata + + * gcse.c (cprop_jump): Revert the 2003-02-23 change. + +2003-02-25 Vladimir Makarov + Richard Henderson + + * sched-ebb.c (add_deps_for_risky_insns): Add the dependence when + there is no similar load. + +2003-02-25 Vladimir Makarov + Richard Henderson + + * sched-int.h (INSN_TRAP_CLASS, WORST_CLASS): Move them from + sched-rgn.c. + (add_forward_dependence): New function prototype. + + * sched-rgn.c (INSN_TRAP_CLASS, WORST_CLASS): Move them to + sched-init.h. + (CONST_BASED_ADDRESS_P, may_trap_exp, haifa_classify_insn): Move + them to haifa-sched.c. + + * haifa-sched.c (CONST_BASED_ADDRESS_P, may_trap_exp, + haifa_classify_insn): Move them from sched-rgn.c. + + * sched-deps.c (add_dependence): Return flag of creating a new + entry. + (add_forward_dependence): New function. + (compute_forward_dependences): Use the function. + + * sched-ebb.c (earliest_block_with_similiar_load): New function. + (add_deps_for_risky_insns): New function. + (schedule_ebb): Call the function. + +2003-02-20 Aldy Hernandez + + * doc/tm.texi: Document Rename TARGET_VECTOR_TYPES_COMPATIBLE to + TARGET_VECTOR_OPAQUE_P. Document accordingly. + + * testsuite/gcc.dg/20030218-1.c: Check that initialization of + opaque types fail. + + * c-typeck.c (comptypes): Change call to vector_types_compatible + to vector_opaque_p. + (convert_for_assignment): Call vector_opaque_p instead of + vector_types_compatible. + (really_start_incremental_init): Disallow initialization of opaque + types. + + * target-def.h: Remove TARGET_VECTOR_TYPES_COMPATIBLE. + Define TARGET_VECTOR_OPAQUE_P. + (TARGET_INITIALIZER): Same. + + * target.h (struct gcc_target): Remove vector_types_compatible. + Add vector_opaque_p. + + * config/rs6000/rs6000.c (rs6000_spe_vector_types_compatible): + Remove. + (is_ev64_opaque_type): Check for TARGET_SPE and make sure type is + a vector type. Change return type to bool. + (TARGET_VECTOR_TYPES_COMPATIBLE): Remove. + (TARGET_VECTOR_OPAQUE_P): Define. + + * cp/parser.c (cp_parser_init_declarator): Call vector_opaque_p + target hook. + Include target.h. + (cp_parser_init_declarator): Fix typo in function comments. + +2003-02-25 Jan Hubicka + + * Makefile.in (lcm.o): Add dependency on function.h + * lcm.c (function.h): Include. + * i386.c (machine_function, ix86_stack_locals, + * ix86_save_varrargs_registers) : Move to + ... + * i386.h (machine_function, ix86_stack_locals, + ix86_save_varrargs_registers): ... here; add optimize_mode_switching + (ix86_optimize_mode_switching): New. + * i386.md (fix patterns): Set ix86_optimize_mode_switching + +2003-02-25 Nick Clifton + + * config/d30v/d30v.c (d30v_init_cumulative_args): Fix typo. Name + of fourth arg is 'fndecl' not 'indirect'. Update comment + describing the function's parameters. + +2003-02-24 Jan Hubicka + + * combine.c (simplify_shift_const): Fix previous patch. + +2003-02-24 Jeff Law + + * i386.md (testdi_1_rex64): Discourage reload from using the %eax + alternative. + (testsi_1, testhi_1, testqi_1): Likewise. + +2003-02-24 Rainer Orth + + * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Rename + __EXTERN_PREFIX to __PRAGMA_EXTERN_PREFIX. + * doc/extend.texi (Tru64 Pragmas): Reflect this. + + * fixinc/inclhack.def (alpha___extern_prefix): Indicate #pragma + extern_prefix support for Tru64 UNIX V5 . + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_CHECK]: New + testcase. + Fixes PR c/5059, c/6126, other/9671. + +2003-02-24 Roger Sayle + + * gcc.c (do_spec_1) ['{']: Handle pending argument upon return + from handle_braces in "%{...}". + +2003-02-24 Kaz Kojima + + * config/sh/sh.c (TARGET_HAVE_TLS): Conditionally define. + (prepare_move_operands): Handle TLS operands. + (tls_symbolic_operand): New. + (nonpic_symbol_mentioned_p): Handle TLS UNSPECs. + (legitimize_pic_address): Do nothing for the TLS symbol. + (sh_encode_section_info): Handle TLS case. + (sh_strip_name_encoding): Drop TLS encoding. + * config/sh/sh-protos.h (tls_symbolic_operand): Add prototype. + * config/sh/sh.h (SH_TLS_ENCODING): Define. + (TLS_SYMNAME_P, STRIP_TLS_ENCODING): Likewise. + (ASM_OUTPUT_LABELREF): Drop TLS encoding. + (OUTPUT_ADDR_CONST_EXTRA): Handle TLS UNSPECs. + * config/sh/sh.md: Define TLS UNSPEC constants. + (type): Add tls_load. + ("tls_global_dynamic", "tls_local_dynamic"): New insns. + ("sym2DTPOFF", "symDTPOFF2reg", "sym2GOTTPOFF"): New expanders. + ("tls_initial_exec"): New insn. + ("sym2TPOFF", "symTPOFF2reg"): New expanders. + ("load_gbr"): New insn. + + * configure.in (HAVE_AS_TLS): Add sh-*-* and sh[34]*-*-* cases. + * configure: Regenerate. + +2003-02-24 Alan Modra + + PR 9297, PR 9722 + * calls.c (store_one_arg): Revert 1999-02-16 change. Revert + 2000-12-17 change. Pass EXPAND_STACK_PARM to expand_expr. + * expr.h (enum expand_modifier): Define EXPAND_STACK_PARM. + (enum block_op_methods): Reorder for better store_expr optimization. + * expr.c (store_expr): Test bit 1 of "want_value" for call param + stores, test bit 0 for original want_value meaning. Pass + BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set. Adjust + recursive calls, and calls to expand_param. + (expand_expr): Handle EXPAND_STACK_PARM modifier. When cse + expected, set target to 0 rather than to subtarget. Formatting. + +2003-02-23 Kazu Hirata + + * gcse.c (cprop_jump): Use the REG_EQUAL note if available. + +2003-02-23 Kaveh R. Ghazi + + * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Document + new default behavior. + * ggc-common.c: Include sys/resource.h. + (ggc_rlimit_bound): New function. + (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic): Update + defaults to account for rlimits. + +2003-02-22 Richard Henderson + + * i386.c, i386.h (TUNEMASK): Rename from CPUMASK. + +2003-02-22 Kelley Cook + + * i386.h, i386.c, i386.md (ix86_tune): Rename from ix86_cpu. + (ix86_tune_string): Rename from ix86_cpu_string. + +2003-02-22 Kelley Cook + + * config/i386/i386.c: Replace "mcpu" with "mtune". + * config/i386/i386.h (TARGET_OPTIONS): Likewise. + (CC1_CPU_SPEC): Likewise. New warning for "-mcpu". + * doc/invoke.texi (i386 and x86-64 Options): Replace "mcpu" + with "mtune". Note that "mcpu" is a deprecated synonym for "mtune". + +2003-02-23 Andreas Schwab + + * config.gcc: Delete references to m68k/t-linux and + m68k/t-linux-aout. + * config/m68k/t-linux, config/m68k/t-linux-aout: Removed. + +2003-02-22 Jan Hubicka + + * toplev.c (rest_of_compilation): Apply fotgotten hunk + of track scheduling patch. + +2003-02-22 Jan Hubicka + + * config/linux.h (TARGET_HAS_F_SETLKW): Define. + * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Likewise + +2003-02-22 Jan Hubicka + + * c-decl.c (c_expand_body_1): Fix. + +2003-02-22 Jan Hubicka + + * expmed.c (expand_divmod): Undo sign extensions for unsigned operands + + * cfgcleanup.c (try_forward_edges): Don't check loop structures + when not optimizing. + (cleanup_cfg): Do not iterate trought delete_trivially_dead_insns + when not expensive. + * toplev.c (rest_of_compilation): Duplicate loop headers only when + optimizing; Delete trivially dead insns early; fix optimize check. + + * Makefile.in (c-decl.o, c-objc-common.o, cgraph.o, tree-inline.o): Add + dependency on cgraph.h + * c-decl.c: Include cgraph.h + (finish_function): Update call of tree_inlinable_function_p. + * c-objc-common.c: Include cgraph.h + * cgraph.h: New file. + * cgraphunit.c: New file. + * cgraph.c (cgraph_node, cgraph_edge): Move into cgraph.h + (cgraph_nodes, cgraph_n_nodes): Globalize. + (cgraph_finalize_function, cgraph_finalize_compilation_unit + cgraph_create_edges, cgraph_optimize, cgraph_mark_needed_node): + Move into cgraphunit.c + * tree-inline.c: Include cgraph.h + * tree-inline.c: Include cgraph.h + +2003-02-22 Josef Zlomek + + * config/i386/i386.md: Use gen_lowpart instead of gen_rtx_REG + for copying a register. + +2003-02-22 Steven Bosscher + + PR other/3782 + * toplev.c (process_options): If flag_detailed_statistics is set, + then set time_report as well. + + PR c/8828 + * jump.c (never_reached_warning): Don't fall through BARRRIER + insns. Update comments to reflect what the function really does. + +2003-02-21 Roger Sayle + + * fold-const.c (omit_one_operand): No longer static. + * tree.h (omit_one_operand): Prototype here. + (div_and_round_double): Keep fold-const.c prototypes together. + * builtins.c (builtin_mathfn_code): Handle binary built-in + funtions, such as "pow" and "atan2". + (fold_builtin): Optimize both pow(x,0.0) and pow(1.0,y) to 1.0. + Simplify optimizations using "type" the builtin's return type. + +2003-02-22 Hans-Peter Nilsson + + * config/cris/cris.c (cris_rtx_costs): Blockify dangling else. + Fix functionalization typo. + + * regmove.c (optimize_reg_copy_1): Do not replace a hard register + in an asm. + +2003-02-21 Kaveh R. Ghazi + + * Makefile.in (ggc-common.o): Depend on $(PARAMS_H) + * doc/invoke.texi (ggc-min-expand, ggc-min-heapsize): Update + documentation. + * ggc-common.c: Include params.h + (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic, + init_ggc_heuristics): New functions. + * ggc.h (ggc_min_expand_heuristic, ggc_min_heapsize_heuristic, + init_ggc_heuristics): Prototype. + * toplev.c (print_version): Output GGC heuristics. + (parse_options_and_default_flags): Call init_ggc_heuristics. + +2003-02-22 Jan Hubicka + + * i386.c (def_builtin): Special case 64bit builtins. + (MASK_SSE164, MASK_SSE264): New constants. + (builtin_description): Add 64bit builtins. + (ix86_init_mmx_sse_builtins): Likewise. + * i386.h (enum ix86_builtins): Likewise. + * i386.md (cvtss2siq, cvttss2siq, cvtsd2siq, cvttsd2siq, cvtsi2sdq, + sse2_movq2dq_rex64, sse2_movsq2q_rex64): New. + (sse2_movq2dq, sse2_movsq2q): Disable for 64bit. + * mmintrin.h (_mm_cvtsi64x_si64, _mm_set_pi64x, _mm_cvtsi64_si64x): New. + * xmmintrin.h (_mm_cvtss_si64x, _mm_cvttss_si64x, _mm_cvtsi64x_ss, + _mm_set_epi64x, _mm_set1_epi64x, _mm_cvtsd_si64x, _mm_cvttsd_si64x, + _mm_cvtsi64x_sd, _mm_cvtsi64x_si128, _mm_cvtsi128_si64x): New. + +2003-02-22 Jan Hubicka + + * i386.c (builtin_description): Add __builtin_ia32_paddq and + __builtin_ia32_psubq. Fix __builtin_ia32_paddq128 + and __builtin_ia32_psubq128. + * i386.h (IX86_BUILTIN_PADDQ, IX86_BUILTIN_PSUBQ): New. + * i386.md (addv*, mmx_ior*, mmx_xoe*, mmx_and*): Add missing '%'. + (mmx_adddi3, mmx_subdi3): New. + * mmintrin.h (_mm_add_si64, _mm_sub_si64): New. + * xmmintrin.h (_mm_movepi64_pi64): New. + (_mm_add_epi64, _mm_sub_epi64): fix. + (_mm_mul_pu16): Rename to... + (_mm_mul_su32): ... this one. + + * builtins.c (expand_builtin_expect): Do not predict + flag_guess_branch_prob is not set. + * c-semantics.c (expand_stmt): Likewise. + * predict.c (predict_insn): Likewise. + * stmt.c (expand_continue_loop): Likewise. + * toplev.c (rest_of_compilation): Do not call + note_prediction_to_br_prob and note_prediction_to_br_prob + when not optimizing. + +2003-02-21 Jan Hubicka + + * cfgrtl.c (commit_edge_insertions): Call + find_many_sub_basic_block only when some code has been emitted. + (commit_edge_insertions_watch_calls): Bring into sync with + commit_edge_insertions + +2003-02-21 J"orn Rennecke + + * sh.h (OVERRIDE_OPTIONS): Fix code that clears 'e' register class. + + * sh.md (binary_sf_op): Use extra constant operand instead of + negating constant operand 4. + * sh.c (sh_expand_binop_v2sf): Supply it. + +2003-02-21 Zack Weinberg + + * cpphash.h (struct lexer_state): Add directive_wants_padding. + * cpplib.c (_cpp_handle_directive): Set directive_wants_padding + for directives of type INCL. + (glue_header_name, parse_include): Use get_token_no_padding. + * cppmacro.c (replace_args): If directive_wants_padding, + provide padding tokens. + +2003-02-21 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-02-21 Jan Hubicka + + * cfgrtl.c (commit_one_edge_insertion): Only mark BB for splitting. + (commit_edge_insertions): Call find_many_sub_basic_blocks + + * reg-stack.c (convert_regs): Cleax aux for blocks. + +2003-02-21 Jan Hubicka + + * toplev.c (parse_options_and_default_flags): Undo accidental commit. + +2003-02-21 Glen Nakamura + + PR optimization/8613 + * builtins.c (expand_builtin): Emit postincrements before expanding + builtin functions. + +2003-02-21 Ben Elliston + + PR other/5634 + * doc/install.texi (Configuration): Explain using $HOME instead of + the ~ metacharacter when referring to home directories. + +2003-02-20 Alexandre Oliva + + * configure.in (TARGET_SYSTEM_ROOT): Set default to + ${exec_prefix}/${target_alias}/sys-root. Match explicit + '${exec_prefix}' (in addition to the expansion thereof) as + relocatable. + * configure: Rebuilt. + +2003-02-20 Kazu Hirata + + * config/h8300/h8300.md (addhi3_incdec): Change the name to + *addhi3_incdec. + (addsi3_incdec): Change the name to *addsi3_incdec. + +2003-02-20 Roger Sayle + + * explow.c (force_reg): Avoid useless REG_EQUAL notes. + +2003-02-20 Toon Moene + + PR fortran/9038 + * c-opts.c (sanitize_cpp_opts): Add Fortran front end + options to be ignored. + (c_common_decode_option): Ignore them when preprocessing. + +2003-02-20 Jan Hubicka + + * toplev.c (flag_sched2_use_superblocks, flag_sched2_use_traces): New + global variables. + (lang_independent_options): Add -fsched2-use-superblocks + -fsced2-use-traces. + (rest_of_compilation): Deal with it. + * invoke.texi (-fsched2-use-traces, fsched2-use-superblocks): Declare. + * flags.h (flag_sched2_use_superblocks, flag_sched2_use_traces): + Declare. + * rtl.h (reg_to_stack): Update prototype. + * reg-stack.c (reg_to_stack): Return when something has changed; + update liveness when executing after superblock scheduling. + + * combine.c (simplify_shift_const): Simplify few special cases + into constants. + +2003-02-20 David Edelsohn + + * config/rs6000/rs6000.md: (attr "type"): Add fast_compare. + (add.,subf.,neg.): Change attribute to fast_compare. + All DFA descriptions updated. + +2003-02-20 Nathan Sidwell + + Change base class access representation. + * tree.h (TREE_VIA_PUBLIC, TREE_VIA_PROTECTED, + TREE_VIA_PRIVATE): Remove. + (BINFO_BASEACCESSES): New binfo elt. + (BINFO_BASEACCESS): New accessor. + (BINFO_ELTS): Increase. + (TI_ACCESS_PUBLIC, TI_ACCESS_PROTECTED, TI_ACCESS_PRIVATE): New. + (access_public_node, access_protected_node, + access_private_node): New global nodes. + * tree.c (build_common_tree_nodes_2): Initialize access nodes. + * dbxout.c (dbxout_type): Adjust. + * dwarf2out.c (gen_inheritance_die): Add access parameter. + (gen_member_die): Adjust. + * dwarfout.c (output_inheritance_die): ARG is array of two trees. + (output_type): Adjust. + * tree-dump.c (dequeue_and_dump): Adjust binfo dumping. + + Change base class access representation. Share virtual base + binfos. + * cp/call.c (build_special_member_call): Remove binfo_for_vbase + call. + * cp/class.c (build_base_path): Likewise. + (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use. + (build_secondary_vtable): Remove FOR_TYPE arg. Adjust. + (make_new_vtable): Adjust. + (force_canonical_binfo_r): Delete. + (force_canonical_binfo): Delete. + (mark_primary_virtual_base): Delete. + (dfs_unshared_virtual_bases): Delete. + (mark_primary_bases): Adjust. + (maybe_warn_about_overly_private_class): Adjust. + (dfs_base_derived_from): Delete. + (base_derived_from): Follow the inheritance chain. + (struct find_final_overrider_data): Add vpath member. + (dfs_find_final_overrider): Adjust. + (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New. + (find_final_overrider): Adjust. + (update_vtable_entry_for_fn): Adjust. + (modify_all_vtables): Adjust. + (walk_subobject_offsets): Adjust. + (layout_nonempty_base_or_field): Adjust. + (layout_empty_base): Remove last parameter. Adjust. + (build_base_field): Adjust. + (build_base_fields): Adjust. + (propagate_binfo_offsets): Remove last parameter. Adjust. + (dfs_set_offset_for_unshared_vbases): Delete. + (layout_virtual_bases): Adjust. + (finish_struct_1): Adjust. + (init_class_processing): Don't init access nodes. + (dfs_get_primary_binfo): Delete. + (get_primary_binfo): Adjust. + (dump_class_hierarchy_r): Remove most derived arg, add IGO + parameter. Adjust. + (dump_class_hierarchy): Adjust. + (finish_vtbls): Adjust. + (get_original_base): Delete. + (build_vtt_inits): Adjust. + (dfs_build_secondary_vptr_vtt_inits): Adjust. + (dfs_ctor_vtable_bases_queue_p): Adjust. + (build_ctor_vtbl_group): Adjust. + (dfs_accumulate_vtbl_inits): Adjust. + (build_vtbl_initializer): Adjust. + (build_vbase_offset_vtbl_entries): Adjust. + (add_vcall_offset_vtbl_entries_1): Adjust. + * cp/cp-tree.h (CPTI_ACCESS_*): Remove. + (access_*_node): Remove. + (CANONICAL_BINFO): Delete. + (BINFO_UNSHARED_MARKED): Remove. + (BINFO_MARKED): Set LANG_FLAG_0 directly. + (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete. + (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly. + (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED): + Delete. + (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust. + (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED): + Delete. + (BINFO_DEPENDENT_BASE_P): New. + (dfs_walk, dfs_walk_real): Queue function takes derived binfo and + index. + (markedp, unmarkedp): Adjust. + (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p, + dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp, + find_vbase_instance, binfo_for_vbase): Delete. + (copied_binfo, original_binfo): Declare. + (finish_base_specifier): Add virtual_p arg. + (unshare_base_binfos): Delete. + (copy_base_binfos): Declare. + (reverse_path): Delete. + * cp/decl.c (xref_basetypes): Access and virtuality passed + differently. Don't copy direct base binfos here. Call + copy_base_binfos. + * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust. + (initialize_vtbl_ptrs): Adjust. + (expand_member_init): Adjust. + * cp/parser.c (cp_parser_base_specifier): Adjust. + * cp/pt.c (instantiate_class_template): Adjust. + (get_template_base_recursive): Adjust. + * cp/rtti.c (get_pseudo_ti_init): Adjust. + (get_pseudo_ti_desc): Adjust. + * cp/tree.c (unshare_base_binfos): Rename to ... + (copy_base_binfos): ... here, reimplement. + (make_binfo): Set BINFO_DEPENDENT_BASE_P. + (reverse_path): Remove. + * cp/typeck.c (get_delta_difference): Adjust error messages. + * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust. + * cp/search.c (lookup_base_r): Adjust. + (dynamic_cast_base_recurse): Adjust. + (canonical_binfo): Remove. + (dfs_canonical_queue): Remove. + (dfs_assert_unmarked_p): Remove. + (assert_canonical_unmarked): Remove. + (shared_marked_p, shared_unmarked_p): Remove. + (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE. + (dfs_access_in_type): Adjust. + (access_in_type): Adjust. + (dfs_accessible_queue_p): Adjust. + (dfs_accessible_p): Adjust. + (is_subobject_of_p_1, is_subobject_of_p): Remove. + (struct lookup_field_info): Remove from_dep_base_p field. + (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P. + (lookup_field_r): Remove dependent base code. + (lookup_member): Likewise. + (dfs_walk, dfs_walk_real): Add access arg to queue fn. + (dfs_unmarked_real_bases_queue_p): Remove. + (dfs_marked_real_bases_queue_p): Remove. + (dfs_skip_vbases): Remove. + (dfs_get_pure_virtuals): Adjust. + (markedp, unmarkedp): Adjust. + (marked_vtable_pathp, unmarked_vtable_pathp): Remove. + (marked_pushdecls_p, unmarked_pushdecls_p): Adjust. + (dfs_unmark): Adjust. + (dfs_get_vbase_types):Remove. + (dfs_build_inheritance_graph_order): Remove. + (get_vbase_types): Remove + (dfs_find_vbase_instance): Remove. + (find_vbase_instance): Remove. + (dfs_debug_unmarkedp): Adjust. + (dependent_base_p): Remove. + (dfs_push_type_decls): Adjust. + (dfs_push_decls): Adjust. + (dfs_no_overlap_yet): Adjust. + (copied_binfo): New function. + (original_binfo): New function. + (binfo_for_vbase): Remove. + + Change base class access representation. + * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC. + (add_interface_do): Likewise. + +2003-02-20 David Edelsohn + + * config/rs6000/sysv4.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Define. + * config/rs6000/power4.md (power4-store,power4-vecstore): New + insn reservations. + (power4-fpstore): Compact. + +2003-02-20 Kazu Hirata + + * config/h8300/h8300.md (*iorsi3_w): New. + +2003-02-20 Josef Zlomek + + * combine.c (distribute_notes): Kill REG_EXEC_COUNT. + * rtl.c (reg_note_name): Likewise. + * rtl.h (enum reg_note): Likewise. + * doc/invoke.texi: Likewise. + * doc/rtl.texi: Likewise. + +2003-02-20 Josef Zlomek + + * bb-reorder.c (find_traces_1_round): Fix comment typo. + +2003-02-19 Roger Sayle + + * fold-const.c (fold_real_zero_addition_p): Don't fold a zero + addition in the presence of signaling NaNs. + +2003-02-19 Krister Walfridsson + + * tm.texi (INIT_CUMULATIVE_ARGS): Fix typo. + +2003-02-19 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Optimize or.l when + ORing with 0xffff??00 with the highest bit of the ?? part set. + (compute_logical_op_length): Update. + (compute_logical_op_cc): Likewise. + +2003-02-19 Josef Zlomek + + * bb-reorder.c (find_traces_1_round): Fixed condition for small + destination block with multiple predecessors. + (connect_traces): Check whether the block is a start of trace. + +2003-02-19 Jan Hubicka + + * calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS + * function.c (assign_params): Likewise. + * arm-protos.h (arm_init_cumulative_args): Update prototype. + * arm.c (arm_init_cumulative_args): Update function. + * arm.h (INIT_CUMULATIVE_ARGS): Update. + * avr-protos.h (init_cumulative_args): Update prototype. + * avr.c (init_cumulative_args): Update function. + * avr.h (INIT_CUMULATIVE_ARGS): Update. + * d30v-protos.h (d30v_init_cumulative_args): Update prototype. + * d30v.c (d30v_init_cumulative_args): Update function. + * d30v.h (INIT_CUMULATIVE_ARGS): Update. + * frv-protos.h (frv_init_cumulative_args): Update prototype. + * frv.c (frv_init_cumulative_args): Update function. + * frv.h (INIT_CUMULATIVE_ARGS): Update. + * mips.c (mips_expand_prolgue): Update call of INIT_CUMULATIVE_ARGS. + * pa.h (INIT_CUMULATIVE_ARGS): Update. + * sparc-protos.h (init_cumulative_args): Update prototype. + * sparc.c (init_cumulative_args): Update function. + * sparc.h (INIT_CUMULATIVE_ARGS): Update. + * tm.texi (INIT_CUMULATIVE_ARGS): Update documentation. + +2003-02-19 Kazu Hirata + + * config/h8300/h8300.md (*iorsi3_two_qi_sext): New. + (*ashiftsi_sextqi_7): Likewise. + +2003-02-19 Rainer Orth + + * config/mips/iris6.h (TARGET_OS_CPP_BUILTINS): Define __c99 for + ISO C99 and C++. + + * fixinc/inclhack.def (irix___restrict): Don't change __restrict + for C++ on IRIX 6.5.1[89]. + * fixinc/tests/base/internal/sgimacros.h: New file. + + * fixinc/inclhack.def (irix_wcsftime): Use XPG5 variant for C99. + * fixinc/tests/base/internal/wchar_core.h: New file. + + * fixinc/inclhack.def (irix_socklen_t): Fix broken IRIX 6.5.1[78] + socklen_t definition. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/sys/socket.h: New file. + Fixes PR libgcj/9652. + +2003-02-19 Jan Hubicka + + * i386.md (movsfcc_1, movdfcc_1): Fix constrains. + +2003-02-19 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Initialize + align_jumps_max_skip and align_loops_max_skip. + +2003-02-19 Thierry Moreau + + * config/rs6000/rs6000.c (rs6000_encode_section_info): Do not + test size if named section. + +2003-02-19 Daniel Jacobowitz + + * expr.c (expand_expr): Use gen_int_mode for the argument + to gen_rtx_MULT. + +2003-02-19 Jan Hubicka + + * i386.md (cosxf2): Fix conditional. + +2003-02-19 Kazu Hirata + + * config/h8300/h8300.md (extendqisi2): Change to an expander. + (*extendqisi2_h8300): New. + (*extendqisi2_h8300hs): Likewise. + +2003-02-19 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + split_adds_subs. Remove the prototypes for + const_int_le_2_operand and const_int_le_6_operand. + * config/h8300/h8300.c (split_adds_sub): Don't output inc/dec. + (const_int_le_2_operand): Remove. + (const_int_le_6_operand): Likewise. + * config/h8300/h8300.h (PREDICATE_CODES): Remove the entries + for const_int_le_2_operand and const_int_le_6_operand. + * config/h8300/h8300.md: Update all uses of split_adds_subs. + (a peephole2): New. + +2003-02-18 Jan Hubicka + + * cgraph.c (NPREDECESORC, SET_NPREDECESORS): Kill. + (cgraph_expand_function): Rewrite. + +2003-02-18 Matt Austern + + * toplev.c, langhooks.c, langhooks-def.h: Move + write_global_declarations from toplev.c to langhooks.c. + +2003-02-18 Kazu Hirata + + * config/h8300/h8300.c (general_operand_src): Always check + MODE. + (general_operand_dst): Likewise. + +2003-02-18 Roger Sayle + + * convert.c (convert_to_real): Also optimize (float)log(x) into + logf(x) where x is a float, i.e. also handle BUILT_IN_LOG{,L}. + +2003-02-18 Kaz Kojima + + * config/sh/sh.c (unspec_caller_rtx_p): New. + (sh_cannot_copy_insn_p): New. + (TARGET_CANNOT_COPY_INSN_P): New. + +2003-02-18 Richard Henderson + + * c-common.c (handle_used_attribute): Accept static data too. + +2003-02-18 Nick Clifton + Aldy Hernandez + + * testsuite/gcc.dg/20030218-1.c: New. + + * doc/tm.texi: Document TARGET_VECTOR_TYPES_COMPATIBLE. + + * target-def.h (TARGET_INITIALIZER): Add + TARGET_VECTOR_TYPES_COMPATIBLE. + (TARGET_VECTOR_TYPES_COMPATIBLE): New macro. + + * target.h (struct gcc_target): Add field vector_types_compatible. + + * c-typeck.c (comptypes): Take into account + TARGET_VECTOR_TYPES_COMPATIBLE. + (convert_for_assignment): Same. + + * config/rs6000/rs6000.c (is_ev64_opaque_type): New. + (rs6000_spe_vector_types_compatible): New. + (TARGET_VECTOR_TYPES_COMPATIBLE): Define. + +2003-02-19 Andreas Schwab + + * Makefile.in (toplev.o): Depend on $(LANGHOOKS_DEF_H). + * toplev.c: Include langhooks-def.h. + +2003-02-18 Chris Demetriou + + * config/mips/mips.h (enum processor_type): Sort entries + alphabetically. + * config/mips/mips.md (define_attr cpu): Sync with processor_type + enum values, including adding entries that were missing. + +2003-02-18 J"orn Rennecke + + * sh.c (calc_live_regs): Also check GET_CODE when checking if + initial value for PR_REG is still the PR_REG register. + +2003-02-18 Jim Wilson + + * config/ia64/ia64.md (floatdidf2, floatdisf2): Add %, before second + instruction in output template. + (bsp_value): Change output template from string to C code, add %, + before actual instruction. + (flushrs): Mark as not predicable. + +2003-02-18 Krister Walfridsson + + * inclhack.def (netbsd_bogus_semicolon): New fix. + * fixincl.x: Rebuilt. + * tests/base/ctype.h: Update. + +2003-02-18 Roger Sayle + + * fold-const.c (negate_expr_p): New function to determine whether + an expression can be negated cheaply. + (fold) [MINUS_EXPR]: Use it to determine whether to transform + -A - B into -B - A for floating point types. + +2003-02-18 Roger Sayle + + * sbitmap.c (sbitmap_resize): New function. + * sbitmap.h (sbitmap_resize): Prototype here. + * recog.c (split_all_insns): Use sbitmap_resize. + +2003-02-18 Kazu Hirata + + * config/h8300/h8300.md (*zero_extendhisi2_h8300): Fix the + insn length. + (extendqisi2): Likewise. + (*extendhisi2_h8300): Likewise. + +2003-02-18 Matt Austern + + * langhooks.h, langhooks-def.h: introduce new langhook, + final_write_globals, with write_global_declarations as default. + * toplev.c: Move invocation of wrapup_global_declarations from + compile_file to new function, write_global_declarations. Change + compile_file to use final_write_globals hook. Change + wrapup_global_declarations so writing to DECL_DEFER_OUTPUT is + conditional. + +2003-02-18 John David Anglin + + * pa.md: Correct and enhance comment. + +2003-02-18 Geoffrey Keating + + * gcc.c (validate_switches): Don't scan past closing '}'. + +2003-02-18 Ben Elliston + + PR c++/1607 + * doc/extend.texi (Function Attributes): Document the effect of + the C++ "this" parameter on the counting of arguments for the + "format" and "format_arg" attributes. + +2003-02-17 Aldy Hernandez + + * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg. + (__ev_stdw): Same. + (__ev_stdh): Same. + +2003-02-17 Jan Hubicka + + * recog.c (split_all_insns): Fix memory overflow. + +2003-02-17 Kazu Hirata + + * config/h8300/h8300.md (cmpqi): Remove mode from compare. + (cmphi): Likewise. + (*cmphi_h8300): Likewise. + (*cmphi_h8300hs): Likewise. + (cmpsi): Likewise. + (7 peephole2): Likewise. + +2003-02-16 Jan Hubicka + + * c-typeck.c (build_c_cast): Fold constant variables into + initial values. + +2003-02-16 Gerald Pfeifer + + * doc/install.texi (Specific): Fix link for m68k-att-sysv. + (Binaries): Ditto for Sinix/Reliant Unix. + +2003-02-16 Richard Earnshaw + + * arm.c (arm_reload_in_hi): Ensure that the scratch register does + not overlap the final result register. + +2003-02-16 Arend Bayer + Richard Henderson + + PR c/8068 + * fold-const.c (extract_muldiv_1): Rename from extract_muldiv; + rearrange mult arguments for less recursion. + (extract_muldiv): New. Prevent runaway recursion. + +2003-02-16 Danny Smith + + * config/i386/cygwin.h (TARGET_SUBTARGET_DEFAULT): Set + MASK_ALIGN_DOUBLE. + +2003-02-15 Roger Sayle + + * config/i386/i386.c (x86_ext_80387_constants): Use 80387 insns + to load mathematical constants on K6, Athlon, Pentium 4 and PPro. + (ext_80387_constants_table): Global table of 80387 special constants + guarded by ext_80387_constants_init flag when not initialized. + (init_ext_80387_constants): New function to initialize this table. + (standard_80387_constant_p): Extend to recognize extra 80387 + constants, in XFmode, on processors where this is a win. + (standard_80387_constant_opcode): New function to return the + opcode associated with standard_80387_constant_p. + (standard_80387_constant_rtx): New function to return the XFmode + CONST_DOUBLE associated with standard_80387_constant_p. + (ix86_rtx_costs): Give the new constants the same cost as 1.0. + + * config/i386/i386-protos.h (standard_80387_constant_opcode): + Prototype here. + (standard_80387_constant_rtx): Likewise. + + * config/i386/i386.md (*movsf1, *movsf1_nointerunit, *movdf_nointeger, + *movdf_integer, *movxf_nointeger, *movtf_nointeger, *movxf_integer, + *movtf_integer): Simplify using new standard_80387_constant_opcode. + +2003-02-15 Geoffrey Keating + + * doc/invoke.texi (Optimize Options): Correct @option syntax. + +2003-02-15 Richard Henderson + + * Makefile.in (cfglayout.o): Depend on TARGET_H. + * cfglayout.c: Include target.h. + (cfg_layout_can_duplicate_bb_p): Check targetm.cannot_copy_insn_p. + * target-def.h (TARGET_CANNOT_COPY_INSN_P): New. + * target.h (struct gcc_target): Add cannot_copy_insn_p. + + * config/alpha/alpha.c (alpha_cannot_copy_insn_p): New. + (TARGET_CANNOT_COPY_INSN_P): New. + (override_options): Revert 2003-02-08 hack. + +2003-02-15 Richard Henderson + + * gcse.c (bypass_block): Use BLOCK_FOR_INSN for resolving LABEL_REFs. + (bypass_conditional_jumps): Accept computed_jump_p insns as well. + +2003-02-15 David Edelsohn + + * config/rs6000/rs6000.h (processor_type): Add PPC440. + * config/rs6000/rs6000.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_VARIABLE_ISSUE): Define. + (rs6000_use_dfa_pipeline_interface): New function. + (rs6000_multipass_dfa_lookahead): New Function. + (rs6000_variable_issue): New function. + (rs6000_adjust_cost): Add CMP and DELAYED_CR types. + (rs6000_issue_rate): Add PPC440. + * config/rs6000/rs6000.md (unspec list): Correct typo. + (attr "type"): Add load_ext, load_ext_u, load_ext_ux, load_u, + store_ux, store_u, fpload_ux, fpload_u, fpstore_ux, fpstore_u, + cmp, delayed_cr, mfcr, mtcr. + (automata_option): Set "ndfa". + (extendMMNN2): Update attributes. + (movcc_internal1): Discourage move to non-cr0. Update + attributes. + (movMM_update): Update attributes. + (cmpMM_internal): Update attributes. + (sCC CR materialization): Update attributes. + (branch patterns): Do not discourage non-cr0. + (cr logical patterns): Prefer destructive register allocation. + Update attributes. + (movesi_from_cr): Update attribute. + (mtcrf_operation): Update attribute. + (mtcrfsi): Update attribute. + * config/rs6000/40x.md: New file. + * config/rs6000/603.md: New file. + * config/rs6000/6xx.md: New file. + * config/rs6000/7450.md: New file. + * config/rs6000/7xx.md: New file. + * config/rs6000/mpc.md: New file. + * config/rs6000/power4.md: New file. + * config/rs6000/rios1.md: New file. + * config/rs6000/rios2.md: New file. + * config/rs6000/rs64.md: New file. + [Some DFA descriptions based on work by Michael Hayes] + +2003-02-15 Richard Henderson + + * bb-reorder.c (find_traces_1_round): Don't connect easy to copy + successors with multiple predecessors. + (connect_traces): Try harder to copy traces of length 1. + + * function.h (struct function): Add computed_goto_common_label, + computed_goto_common_reg. + * function.c (free_after_compilation): Zap them. + * stmt.c (expand_computed_goto): Use them to produce one + indirect branch per function. + +2003-02-15 Richard Henderson + + * cfgcleanup.c: Include params.h. + (try_crossjump_bb): Use PARAM_MAX_CROSSJUMP_EDGES. Fix test for + too many outgoing edges from a block. + * Makefile.in (cfgcleanup.o): Depend on PARAMS_H. + * params.def (max-crossjump-edges): New. + * doc/invoke.texi: Document it. + +2003-02-15 Richard Henderson + + * recog.c (split_all_insns): Include new blocks in life update; + do a global life update. + +2003-02-15 Danny Smith + + * config/i386/mingw32.h (LIBGCC_SPEC): Add libmingwex.a. + Update copyright. + * config/i386/cygwin.h (LIBGCC_SPEC): Add libmingwex.a for + -mno-cygwin case. + +2003-02-14 Falk Hueffner + + PR optimization/7702 + * reload1.c (reload_cse_simplify_set): Honor + CANNOT_CHANGE_MODE_CLASS. + +2003-02-14 Alexandre Oliva + + * config/mn10300/mn10300.c (mn10300_wide_const_load_uses_clr): New + function. + * config/mn10300/mn10300-protos.h: Declare it. + * config/mn10300/mn10300.md (movdi, movdf): Use it to compute + attribute cc of instructions that may use clr. + +2003-02-14 Kazu Hirata + + * simplify-rtx.c (simplify_binary_operation): Simplify ~y when + (x - (x & y)) is found. + +2003-02-14 Rainer Orth + + * configure.in: Fix typo. + * configure: Regenerate. + +2003-02-14 Kazu Hirata + + * config/h8300/h8300.md (*iorsi2_and_1_lshiftrt_1): New. + +2003-02-13 Adam Nemet + + PR opt/2391 + * combine.c: Fix spelling in comment. + (cached_nonzero_bits): New function. + (cached_num_sign_bit_copies): New function. + (nonzero_bits_with_known): New macro. + (num_sign_bit_copies_with_known): New macro. + (nonzero_bits1): Rename from nonzero_bits. Add three new + arguments. Change calls from nonzero_bits to + nonzero_bits_with_known. + (num_sign_bit_copies1): Rename from num_sign_bit_copies. Add + three new arguments. Change calls from num_sign_bit_copies to + num_sign_bit_copies_with_known. + (nonzero_bits): New macro. + (num_sign_bit_copies): New macro. + (update_table_tick): Don't traverse identical subexpression more + than once. + (get_last_value_validate): Likewise. + +2003-02-13 Zack Weinberg + + * emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx. + * function.h (struct emit_status): Length of regno_pointer_align + and x_regno_reg_rtx as seen by gengtype is only x_reg_rtx_no, + not regno_pointer_align_length (i.e. length actually used, not + length as allocated) + + * config/i386/i386.c (struct stack_local_entry): New. + (struct machine_function): Replace huge array with alist. + (assign_386_stack_local): Change to match. + +2003-02-13 John David Anglin + + * inclhack.def (hpux_long_double): Tighten select and add bypass + regexp. + * fixincl.x: Rebuilt. + +2003-02-13 Josef Zlomek + + * cfgcleanup.c (outgoing_edges_match): When there is single outgoing + edge and block ends with a jump insn it must be simple jump. + +2003-02-13 Daniel Jacobowitz + + * Makefile.in (PREPROCESSOR_DEFINES): Add + @TARGET_SYSTEM_ROOT_DEFINE@. + * configure.in (PREFIX_INCLUDE_DIR): Don't define if $with_sysroot + is specified or if building a cross compiler. + (TARGET_SYSTEM_ROOT_DEFINE): Add TARGET_SYSTEM_ROOT_RELOCATABLE + if the sysroot is under $exec_prefix. + * configure: Regenerated. + * cppdefault.h: Use native include paths if TARGET_SYSTEM_ROOT is + defined. + (struct default_include): Add add_sysroot field. + (cpp_SYSROOT): Declare. + * cppdefault.c (cpp_include_defaults): Fill in add_sysroot + field. + (cpp_SYSROOT): New variable. + * cppinit.c (cpp_create_reader): Initialize + CPP_OPTION (pfile, sysroot). + (init_standard_includes): Handle add_sysroot. Do not + add unrelocated copies of relocated directories. + (COMMAND_LINE_OPTIONS): Add -isysroot. + (cpp_handle_option): Handle -isysroot. + * cpplib.h (struct cpp_options): Add sysroot member. + * gcc.c (The Specs Language): Update description of %I. + (target_system_root_changed): New variable. + (process_command): Conditionalize make_relative_prefix call + on !VMS and TARGET_SYSTEM_ROOT_RELOCATABLE. Set + target_system_root_changed. + (do_spec_1): Add -isysroot to %I. + * doc/invoke.texi (Spec Files): Update description of %I. + * doc/install.texi (--with-sysroot): Update comment about + relocation. + +2003-02-13 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-02-13 Robert Lipe + Gerald Pfeifer + + * doc/install.texi (Specific): Update three SCO-related URLs. + +2003-02-13 Andreas Schwab + + * cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t. + Parenthesize properly. + (NPREDECESORS): Parenthesize properly. + +2003-02-13 Gabriel Dos Reis + + * timevar.h (POP_TIMEVAR_AND_RETURN): New macro. + +2003-02-12 Roger Sayle + + * config/i386/i386.md (UNSPEC_FPATAN): New UNSPEC constant. + (atan2sf3, atan2df3, atan2xf3, atan2tf3): New patterns. + + * reg-stack.c (subst_stack_regs_pat): Add support for binary + UNSPEC instructions (e.g. "fpatan"). + +2003-02-12 Mike Stump + + * varray.c (element_size): Remove. + (uses_ggc): Remove. + (element): Add. + (varray_init): Use new interface. + (varray_grow): Use new interface. + (varray_clear): Use new interface. + +2003-02-12 Aldy Hernandez + + * config/rs6000/spe.h: Add casts to the arguments of the following + macros: evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul, + evfsdiv, evfscfui, evfscfsi evfscfuf evfscfsf, evfsctui, evfsctsi, + evfsctuf, evfsctsf, evfsctuiz, evfsctsiz, __ev_get_upper*, + __ev_get_lower*, __ev_get_u32, __ev_get_s32, __ev_get_fs, + __ev_get_u16, __ev_get_s16. + +2003-02-12 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): New. + +2003-02-12 Jan Hubicka + + * Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time + (OBJS): Add cgraph.o + (cgraph.o): New. + * c-decl.c (expand_body_1): Break out from ... + (expand_body): This one; change calling convention + (finish_function): Move some of expand_body logic here. + (c_expand_deferred_function): Update call of expand_body + (c_expand_stmt): Use c_expand_body_1. + * c-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define. + * c-objc-commin.c (c_objc_common_finish_file): Use callgraph code. + * c-tree.h (c_expand_body): Declare. + * cgraph.c: New file. + * flags.h (flag_unit_at_a_time): Declare. + * langhooks.h (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION, + LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, + LANG_HOOKS_CALLGRAPH_INITIALIZER): New macros. + * langhooks.h (struct lang_hooks_for_callgraph): New. + (struct lang_hooks): Add callgraph field. + * toplev.c (flag_unit_at_a_time): New. + (lang_independent_options): Add flag_unit_at_a_time. + (process_options): Disable unit-at-a-time mode for frontends not + supporting callgraph. + * tree-inline.c (typedef struct inline_data): Add "decl" + (expand_call_inline): Update callgraph. + (optimize_inline_calls): Set id.decl. + * tree.h (cgraph_finalize_function, cgraph_finalize_compilation_unit, + cgraph_create_edges, dump_cgraph, cgraph_optimize, cgraph_remove_call + cgraph_calls_p): Declare. + * invoke.texi (-funit-at-a-time): Document. + +2003-02-12 Aldy Hernandez + + * config/rs6000/spe.h: Fix misc formatting. + (__ev_create_ufix32_fs): Cast ev argument. + (__ev_create_sfix32_fs): Same. + (__ev_get_sfix32_fs_internal): Cast arguments to builtins. + (__ev_get_ufix32_fs_internal): Same. + +2003-02-12 Ranjit Mathew + + * doc/tm.texi (MODIFY_JNI_METHOD_CALL): Document. + * config/i386/cygwin.h (MODIFY_JNI_METHOD_CALL): New macro. + +2003-02-12 Zack Weinberg + + * cpplib.c (do_include_common): Move warnings for + #include_next and #import out to callers. Use early-return + instead of nested ifs. Don't do check_eol here. + (parse_include): Do check_eol here with the rest of the + parsing stuff. + (do_include_next, do_import): Now handle warnings. + +2003-02-11 Gerald Pfeifer + + * doc/install.texi (Specific): Update AVR- and Darwin-related URLs. + +2003-02-12 Jan Hubicka + + * predict.c (estimate_probability): Fix roundoff error. + +2003-02-12 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Don't handle 65535. + (two peephole2): New. + +2003-02-12 Kazu Hirata + + * config/h8300/h8300.md (several peephole2): Replace + find_regno_note with peep2_reg_dead_p. + +2003-02-11 Richard Henderson + + * gcse.c (lookup_set): Remove unused argument PAT. Update + both callers. + +2003-02-11 Geoffrey Keating + + * diagnostic.c (real_abort): New. + (diagnostic_report_diagnostic): Call real_abort on error. + * diagnostic.h (diagnostic_abort_on_error): New. + (struct diagnostic_context): Add abort_on_error field. + * toplev.c (setup_core_dumping): New. + (decode_d_option): Handle 'H' case. + * doc/invoke.texi (Debugging Options): Document -dH. + +2003-02-11 Nathanael Nerode + + * Makefile.in: Remove pointless setting of CXXFLAGS for dejagnu + which refers to obsolete directories. + +2003-02-11 Richard Henderson + + * config/alpha/linux.h (TARGET_C99_FUNCTIONS): New. + +2002-10-21 Jan Hubicka + + * i386.c (contains_128bit_aligned_vector_p): New function. + (ix86_function_arg_boundary): Properly align vector modes. + +2003-02-11 Bob Wilson + + * config/xtensa/xtensa.md (set_frame_ptr): Change rtl to set reg a7. + * config/xtensa/xtensa.c (xtensa_reorg): Search for UNSPECV_SET_FP + as a SET pattern. + +2003-02-11 Roger Sayle + + * builtins.c: Fix failure caused by commiting wrong patch. + +2003-02-11 Dale Johannesen + * ra-build.c (compare_and_free_webs): Relax checking. + * config/rs6000/darwin.h (HOT_TEXT_SECTION_NAME): Define. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Define. + +2003-02-11 Falk Hueffner + + PR optimization/9651 + * rtlanal.c (may_trap_p): Handle FIX. + +2003-02-11 Dave Jones + + * config/i386/i386.c (override_options): Define c3-2 as a 686 with SSE. + * doc/invoke.texi: Extra alias. + +2003-02-11 Geoffrey Keating + + * config/rs6000/host-darwin.c: Fix comment. + +2003-02-11 David Edelsohn + + * config/rs6000/rs6000.md (divmodsi4): Use register_operand + predicate for mod result. + +2003-02-11 John David Anglin + + * inclhack.def (hpux_long_double, hpux10_ctype_declarations1, + hpux10_ctype_declarations2, hpux_ctype_macros): New hacks. + * fixincl.x: Rebuilt. + * tests/base/stdlib.h: Update. + * tests/base/ctype.h: New file. + +2003-02-11 Jan Hubicka + + * emit-rtl.c (emit_copy_of_insn_after): Copy insn recog cache too. + +2003-02-11 Richard Henderson + + * config/i386/i386.c (ix86_expand_movstr): Fail if esi or edi + appropriated as globals. + (ix86_expand_clrstr): Similarly. + * config/i386/i386.md (cmpstrsi): Similarly. + +2003-02-11 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Add a case of 255. + +2003-02-11 Roger Sayle + + * optabs.h (enum optab_index): Add new OTI_pow and OTI_atan2. + (pow_optab, atan2_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize pow_optab and atan2_optab. + * genopinit.c (optabs): Implement pow_optab and atan2_optab + using pow?f3 and atan2?f3 patterns. + * builtins.c (expand_errno_check): New function to update errno + if necessary, split out from expand_builtin_mathfn. + (expand_builtin_mathfn): Use expand_errno_check. + (expand_builtin_mathfn_2): New function to handle expanding binary + math functions, reusing the code in expand_errno_check. + (expand_builtin): Handle the pow and atan2 math built-ins, + BUILT_IN_{POW,POWF,POWL,ATAN2,ATAN2F,ATAN2L} via the new function + expand_builtin_mathfn_2. + + * doc/md.texi: Document new pow?f3 and atan2?f3 patterns. + +2003-02-11 Jan Hubicka + + * combine.c (combine_simplify_rtx): Fix folding of + nested float_truncates. + +2003-02-11 Kazu Hirata + + * config/h8300/h8300.md (a peephole2): Fix a typo. + +2003-02-11 Richard Earnshaw + + * arm.mc (return_address_mask): Use CC_REGNUM for the condition code + register number. + +2003-02-11 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + gtuleu_operator. + * config/h8300/h8300.c (gtuleu_operator): New. + * config/h8300/h8300.h (PREDICATE_CODES): Add gtuleu_operator. + * config/h8300/h8300.md (a peephole2): New. + +2003-02-11 Jan Hubicka + + * sched-ebb.c (schedule_ebbs): Do not verify_flow_info. + +2003-02-11 Jan Hubicka + + * predict.c (choose_function_section): Choose sections correctly. + +2003-02-10 John David Anglin + + * reload1.c (first_label_num): New. + (reload): Index offsets_known_at and offsets_at using difference of + label number and first label number. Don't use offset pointers. + (set_label_offsets, set_initial_label_offsets): Likewise. + +2003-02-10 Roger Sayle + + * mips-tfile.c (init_file): Add missing initializers in the + "#ifdef __alpha" case. + (file_offset, max_file_offset): Declare as unsigned long. + (write_varray): Cast to "unsigned long" in comparisons against + either file_offset or max_file_offset. + (write_object): Likewise. + (read_seek): Likewise. + (copy_object): Likewise. Declare "ifd" as int to match its use + in add_ext_symbol, and avoid signed/unsigned conditional warning. + +2003-02-10 Nick Clifton + Aldy Hernandez + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Do not + override options which have been specified on the command line. + +2003-02-10 Kazu Hirata + + * config/h8300/h8300.md (abssf2): New. + (*abssf2_h8300): Likewise. + (*abssf2_h8300hs): Likewise. + +2003-02-10 Phil Edwards + + * tree.c (build_tree_list): Fix parameter names in comment. + +2003-02-10 Janis Johnson + + * config/rs6000/ppc64-fp.c: New file. + * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Add ppc64-fp.c. + +2003-02-10 Josef Zlomek + + * Makefile.in (bb-reorder.o): Add dependency on $(FIBHEAP_H). + * bb-reorder.c (make_reorder_chain): Deleted. + (make_reorder_chain_1): Deleted. + (find_traces): New function. + (rotate_loop): New function. + (mark_bb_visited): New function. + (find_traces_1_round): New function. + (copy_bb): New function. + (bb_to_key): New function. + (better_edge_p): New function. + (connect_traces): New function. + (copy_bb_p): New function. + (get_uncond_jump_length): New function. + (reorder_basic_blocks): Use new functions (Software Trace Cache). + * cfgcleanup.c (outgoing_edges_match): Enable crossjumping across loop + boundaries. + +2003-02-10 Aldy Hernandez + + * config/rs6000/rs6000.c (bdesc_2arg): Change spe_evxor to xorv2si3. + +2003-02-09 Dan Nicolaescu + + * tree.h (struct tree_decl): Remove unused live_range_rtl field. + (DECL_LIVE_RANGE_RTL): Remove. + +2003-02-10 Nick Clifton + + * config/arm/aof.h, config/arm/aout.h, config/arm/arm-modes.def, + config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, + config/arm/arm.md, config/arm/cirrus.md, config/arm/coff.h, + config/arm/conix-elf.h, config/arm/ecos-elf.h, config/arm/elf.h, + config/arm/freebsd.h, config/arm/linux-elf.h, + config/arm/linux-gas.h, config/arm/netbsd-elf.h, + config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h, + config/arm/rtems-elf.h, config/arm/semi.h, config/arm/semiaof.h, + config/arm/strongarm-coff.h, config/arm/strongarm-elf.h, + config/arm/strongarm-pe.h, config/arm/uclinux-elf.h, + config/arm/unknown-elf-oabi.h, config/arm/unknown-elf.h, + config/arm/xscale-elf.h: Replace occurances of "GNU CC" with "GCC" + and reformat as appropriate. + +2003-02-10 Kazu Hirata + + * config/h8300/clzsi2.c: Remove. + * config/h8300/ctzsi2.c: Likewise. + * config/h8300/paritysi2.c: Likewise. + * config/h8300/popcountsi2.c: Likewise. + * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Remove clzsi2, + ctzsi2, paritysi2, and popcountsi2. + +2003-02-10 Eric Botcazou + Christian Ehrhardt + + PR c/7741 + * c-decl.c (duplicate_decls): Discard the initializer of the + new decl when the types are conflicting. + +2003-02-10 Josef Zlomek + + * Makefile.in (sreal.o): Added. + (predict.o): Depends on sreal.h instead of real.h. + * sreal.c: New file. + * sreal.h: New file. + * predict.c: Use sreal.c instead of real.c. + +2003-02-10 Nick Clifton + + * Contributed support for the Cirrus EP9312 "Maverick" + floating point co-processor. Written by Aldy Hernandez + . + (config/arm/arm.c): Add Cirrus support. + (config/arm/arm.h): Likewise. + (config/arm/aout.h): Likewise. + (config/arm/arm.md): Likewise. + (config/arm/arm-protos.h): Likewise. + (config.gcc): Likewise. + (doc/invoke.texi): Describe new -mcpu value and new + -mcirrus-fix-invalid-insns switch, + (cirrus.md): New file. + +2003-02-10 Jan Hubicka + + * combine.c (combine_simplify_rtx): Simplify using + (float_truncate (float x)) is (float x) + (float_extend (float_extend x)) is (float_extend x). + +2003-02-10 Alan Modra + + * calls.c (try_to_integrate): Tidy stack_usage_map access. + (emit_library_call_value_1): Likewise. Formatting. + (store_one_arg): Likewise. + +2003-02-09 Nick Clifton + Aldy Hernandez + + * config/rs6000/spe.md: spe_evlhhesplat, spe_evlhhossplat, + spe_evlhhousplat, spe_evlwhsplat, spe_evlwwsplat, spe_evldd, + spe_evldh, spe_evldw, spe_evlwhe, spe_evlwhos, spe_evlwhou, + spe_evstdd, spe_evstdh, spe_evstdw, spe_evstdwx, spe_evstwhe, + spe_evstwho, spe_evstwwe, spe_evstwwo: Fix syntax to match newest + docs. Add range test for immediate value. + +2003-02-09 Aldy Hernandez + + Rename spe_evxor to xorv2si3. + (xorv4hi3): New. + (xorv1di3): New. + +2003-02-10 Glen Nakamura + + * doc/extend.texi (C++98 Thread-Local Edits): Add missing @item + tag. + +2003-02-10 Jan Hubicka + + * i386.c (vector_move_operand): New predicate. + (ix86_expand_vector_move): Be happy about 0. + * i386.h (PREDICATE_CODES): Add sse-move_operand. + * i386.md (mov*_internal): Add 'C' alternative. + +2003-02-09 Jan Hubicka + + * i386.md (floathi*): Deal with SSE. + +2003-02-09 Jan Hubicka + + * simplify-rtx.c (simplify_unary_operation, + simplify_binary_operation): Deal with vector modes + (simplify_ternary_operation): Deal with no-op VEC_MERGE. + +2003-02-09 Richard Sandiford + + * toplev.c (rest_of_compilation): Recompute register usage after + split_all_insns. + +2003-02-09 Richard Henderson + + * libgcc-std.ver (__clztf2): New. + (__ctztf2, __popcounttf2, __paritytf2): New. + * libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2, + __popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode; + adjust code to match the different type sizes. + * libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2, + __clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros. + + * optabs.c (init_integral_libfuncs): Don't hard-code SImode and + TImode; select word_mode and twice that. + (init_floating_libfuncs): Don't hard-code SFmode and TFmode; + select the modes from float, double, and long double. + (init_optabs): Remove duplicate initializations. + +2003-02-09 Wolfgang Bangerth + + * doc/install.texi: Squeeze and streamline section on + testing and regression checking. + +2003-02-09 Jan Hubicka + + * i386.md (ahi?v*3): Set third operand type to TImode. + * i386.c (ix86_expand_binop_builtin): Extend operand when needed. + + * simplify-rtx.c (simplify_subreg): Fix conversion from vector into + integer mode. + + * rtl.def (VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_DUPLICATE): + Change code so they are arithmetic expressions now. + * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, + simplify_ternary_operation): Deal with VEC_* expressions. + + * i386.md (vmaskcmp, pinsrw, movd patterns): Fix RTL representation. + +2003-02-08 Jan Hubicka + + * cfgrtl.c (verify_flow_info): Use control_flow_insn_p. + * reload1.c (fixup_abnormal_edges): Split basic blocks when EH edges + possibly got duplicated. + +2003-02-08 Richard Henderson + + * config/alpha/alpha.c (override_options): Turn off explicit + relocs until post-peep2 code duplication resolved. + +2003-02-08 Kazu Hirata + + * optabs.c (expand_unop): Widen clz properly when clz is done + via libcall. + +2003-02-08 Kazu Hirata + + * config/h8300/clzsi2.c: Replace "GNU CC" with "GCC". + * config/h8300/crti.asm: Likewise. + * config/h8300/crtn.asm: Likewise. + * config/h8300/ctzsi2.c: Likewise. + * config/h8300/fixunssfsi.c: Likewise. + * config/h8300/h8300-protos.h: Likewise. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + * config/h8300/paritysi2.c: Likewise. + * config/h8300/popcountsi2.c: Likewise. + * config/h8300/rtems.h: Likewise. + +2003-02-08 Zdenek Dvorak + + * doc/invoke.texi: Documentation for my previous commit. + * doc/passes.texi: Ditto. + +2003-02-08 Zdenek Dvorak + + * cfgloop.h (fix_loop_placement, can_duplicate_loop_p, + duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb): + Declare. + (DLTHE_FLAG_UPDATE_FREQ): New. + * cfgloopmanip.c (duplicate_loop, duplicate_subloops, copy_loops_to, + loop_redirect_edge, loop_delete_branch_edge, copy_bbs, remove_bbs, + rpe_enum_p, find_branch, alp_enum_p, add_loop, fix_loop_placements, + fix_bb_placement, fix_bb_placements, place_new_loop, + scale_loop_frequencies, scale_bbs_frequencies, record_exit_edges): + New static functions. + (fix_loop_placement, can_duplicate_loop_p, + duplicate_loop_to_header_edge, loopify, remove_path, split_loop_bb): + New functions. + + * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize, + unswitch_loops): Declare. + * loop-init.c: New file. + * loop-unswitch.c: New file. + * Makefile.in (loop-init.o, loop-unswitch.o): New. + * params.def (PARAM_MAX_UNSWITCH_INSNS, PARAM_MAX_UNSWITCH_LEVEL): New. + * toplev.c (DFI_loop2): New dump. + (flag_unswitch_loops): New. + (lang_independent_options): Add it. + (rest_of_compilation): Call new loop optimizer. + (parse_options_and_default_flags): Turn flag_unswitch_loops on with -O3. + +2003-02-08 Kazu Hirata + + * config/h8300/clzsi2.c: New. + * config/h8300/ctzsi2.c: Likewise. + * config/h8300/paritysi2.c: Likewise. + * config/h8300/popcountsi2.c: Likewise. + * config/h8300/t-h8300 (LIB2FUNCS_EXTRA): Add above files. + +2003-02-07 David Edelsohn + + * config/rs6000/rs6000.h (CLZ_DEFINED_VALUE_AT_ZERO): Define. + * config/rs6000/rs6000.md (clzsi2): Rename from cntlzw2. + (ctzsi2): New pattern. + (ffssi2): Use clz instead of unspec. + (clzdi2): Rename from cntlzd2. + (ctzdi2): New pattern. + (ffsdi2): Use clz instead of unspec. + +2003-02-07 Loren James Rittle + + * config/alpha/freebsd.h (LINK_SPEC): Weaken error to notice. + * config/ia64/freebsd.h (LINK_SPEC): Likewise. + * config/sparc/freebsd.h (LINK_SPEC): Likewise. + * config/i386/freebsd.h (LINK_SPEC): Add clause to mirror other arches. + +2003-02-07 Wolfgang Bangerth + + * doc/trouble.texi: Document pitfalls of two-stage name lookup. + +2003-02-07 Richard Henderson + + PR 9226 + * gcse.c (local_cprop_find_used_regs): New. + (local_cprop_pass): Use it. + +2003-02-07 Fred Fish + + * mips-tfile.c (parse_def): Parenthesize assignments to fix + precedence bugs. + +2003-02-07 Segher Boessenkool + + * genoutput.c (output_get_insn_name): Handle NOOP_MOVE_INSN_CODE. + +2003-02-07 Roger Sayle + + * builtin-types.def (BT_FN_FLOAT_FLOAT_FLOAT): New built-in type. + (BT_FN_LONG_DOUBLE_LONG_DOUBLE_LONG_DOUBLE): Likewise. + (BT_FN_DOUBLE_DOUBLE_DOUBLE): Likewise. + * builtins.def: Define pow, powf, powl, atan2, atan2f and atan2l + builtin functions (and their __builtin_* variants). + * builtins.c (mathfn_built_in): Handle missing log{,f,l} cases. + (expand_builtin): Don't expand log{,f,l}, pow{,f,l} or atan2{,f,l} + when not optimizing. + + * doc/extend.texi: Document new pow and atan2 builtins, and + their float and long double variants. Realphabetize builtins. + +2003-02-07 Jan Hubicka + + * i386.md (sse2_nandv2di3): Fix. + +2003-03-07 Danny Smith + + * config/i386/i386.h (MS_AGGREGATE_RETURN): New define. + * config/i386/cygwin.h (MS_AGGREGATE_RETURN): Override default + definition. + * config/i386/i386.h (ix86_return_in_memory): Return aggregate + types of up to 8 bytes via registers if MS_AGGREGATE_RETURN. + +2003-02-07 Jan Hubicka + + * i386.md (movdi_rex64_1): Fix mmx<->int move opcode. + +2003-02-07 Daniel Berlin + + * cfg.c (dump_flow_info): Add back accidently deleted line. + +2003-02-07 Andrey Petrov + + * optabs.c (expand_float): Search wider integer modes first. + +2003-02-07 Bob Wilson + + * config/xtensa/xtensa.h (LIBGCC2_WORDS_BIG_ENDIAN): Set this + based on preprocessor flag. + +2003-02-07 Roger Sayle + Richard Henderson + + * gcse.c (implicit_sets): New. + (compute_hash_table_work): Include them in hash table. + (find_implicit_sets, fis_get_condition): New. + (one_cprop_pass): Allocate and free implicit_sets; call + find_implicit_sets before building hash table. + +2003-02-07 Jason Thorpe + + * config/t-netbsd (USER_H): Revert previous change. + +2003-02-07 Gabor Greif + + * doc/c-tree.texi (Namespaces): Fix typo. + +2003-02-07 Jan Hubicka + + * regrename.c (do_replace, find_oldest_value_reg, + copyprop_hardreg_forward_1): Update register attributes. + +2003-02-06 Vladimir Makarov + + * genautomata.c (VLA_PTR_CREATE, VLA_PTR_EXPAND, VLA_PTR_ADD, + VLA_HWINT_CREATE, VLA_HWINT_EXPAND, VLA_HWINT_ADD): Use temporay + variables starting with underscore. + (struct unit_usage): New structure. + (unit_usages, cycle_alt_unit_usages): New global variables. + (check_unit_distribution_in_reserv): Remove it. + (store_alt_unit_usage): New function. + (check_regexp_units_distribution): Rewrite it. + +2003-02-06 John David Anglin + + * config.gcc (hppa*-*-linux*): Set MASK_NO_SPACE_REGS in + target_cpu_default. + * pa.c (attr_length_call): Add 8 to call length (long indirect PA 1.X) + if not MASK_NO_SPACE_REGS. + (output_call): Adjust return pointer, don't load new space register + into %sr0, and use %sr4 for call if TARGET_NO_SPACE_REGS is true. + (pa_asm_output_mi_thunk): Don't load new space register into %sr0 if + TARGET_NO_SPACE_REGS is true. + * pa.md (return_external_pic): Add TARGET_NO_SPACE_REGS to insn + conditions. + (epilogue): Always use return_internal if TARGET_NO_SPACE_REGS is true. + (interspace_jump): Add new pattern for when TARGET_NO_SPACE_REGS is + true. Use bve when TARGET_64BIT is true. + +2003-02-06 Richard Henderson + + * combine.c (nonzero_bits): Fix double break. + +2003-02-06 Eric Botcazou + Richard Henderson + + PR c/9530 + * config/i386/i386.c (ix86_function_ok_for_sibcall): Forbid sibcalls + from functions that return a float to functions that don't. + +2003-02-06 Jan Hubicka + + * i386.c (x86_inter_unit_moves): New variable. + (ix86_secondary_memory_needed): Fix 64bit case, honor + TARGET_INTER_UNIT_MOVES + * i386.h (x86_inter_unit_moves): Declare. + (TARGET_INTER_UNIT_MOVES): New macro. + * i386.md (movsi_1): Cleanup constraints; disable + when not doing inter-unit moves. + (movsi_1_nointernunit): New. + (movdi_1_rex64): Fix constraints; deal with SSE->GPR moves. + (movdi_1_rex64_nointerunit): New. + (mivsf_1): disable when not doing inter-unit moves. + (movsf_1_nointerunit): New. + + * basic-block.h (inside_basic_block_p): Declare. + * cfgbuild.c (inside_basic_block_p): Make global. + * haifa-sched.c (unlink_other_notes): Deal with NOT_INSN_BASIC_BLOCK. + * scheudle-ebb.c (schedule_ebb): Return last basic block of trace; + update CFG. + (fix_basic_block_boundaries, add_missing_bbs): New. + (rank): Use profile. + (scheudle_ebbs): Rely on CFG; update coments. + +2003-02-05 Geoffrey Keating + + * Makefile.in (host_hook_obj): New. + (OBJS): Add $(host_hook_obj). + (host_default.o): New rule. + * config.gcc (host_hook_obj): New, default to host-default.o. + (powerpc-*-darwin*): Use host-darwin.o. + (out_host_hook_obj): New. + * configure: Regenerate. + * configure.in: Print information about out_host_hook_obj, substitute + into output files. + * host-default.c: New file. + * hosthooks.h: New file. + * toplev.c (general_init): Call host_hooks.extra_signals. + * config/rs6000/host-darwin.c: New file. + * config/rs6000/x-darwin: New file. + * doc/hostconfig.texi: Add documentation for new host hook. + Rearrange existing documentation. + +2003-02-05 Roger Sayle + + * dwarf2out.c (mem_loc_descriptor): Replace ASM_SIMPLIFY_DWARF_ADDR + with *targetm.delegitimize_address. + (rtl_for_decl_location): Likewise. + * dwarfout.c (output_mem_loc_descriptor): Likewise. Include target.h. + * Makefile.in (dwarf2out.c, dwarfout.c): Depend upon $(TARGET_H) + + * config/i386/i386.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition. + * config/i386/i386-protos.h (i386_simplify_dwarf_addr): Remove + prototype. + * config/i386/i386.c (ix86_delegitimize_address): Renamed from + i386_simplify_dwarf_addr. Made static. Prototyped. + (TARGET_DELEGITIMIZE_ADDRESS): Update definition from + i386_simplify_dwarf_addr to ix86_delegitimize_address. + (ix86_find_base_term): Likewise. + (maybe_get_pool_constant): Likewise. + + * config/s390/s390.h (ASM_SIMPLIFY_DWARF_ADDR): Remove definition. + * config/s390/s390-protos.h (s390_simplify_dwarf_addr): Remove + prototype. + * config/s390/s390.c (s390_delegitimize_address): Renamed from + s390_simplify_dwarf_addr. Made static. Prototyped. + (TARGET_DELEGITIMIZE_ADDRESS): Define as s390_delegitimize_address. + +2003-02-05 Richard Henderson + + PR c/8602 + * integrate.c (output_inline_function): Reset input_filename + and lineno from the decl before rest_of_compilation. + +2003-02-05 Richard Henderson + + * defaults.h (CLZ_DEFINED_VALUE_AT_ZERO): New. + (CTZ_DEFINED_VALUE_AT_ZERO): New. + * doc/rtl.texi, doc/tm.texi: Document them. + + * combine.c (nonzero_bits) [CLZ, CTZ]: Handle the definedness + of the value at zero properly. + * fold-const.c (tree_expr_nonnegative_p): Likewise. + * simplify-rtx.c (simplify_unary_operation): Likewise. + + * config/alpha/alpha.h (CLZ_DEFINED_VALUE_AT_ZERO): New. + (CTZ_DEFINED_VALUE_AT_ZERO): New. + + * config/arm/arm.c (TARGET_INIT_BUILTINS): Remove. + (TARGET_EXPAND_BUILTIN): Remove. + (def_builtin, arm_init_builtins, arm_expand_builtin): Remove. + * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO): New. + (enum arm_builtins): Remove. + * config/arm/arm.md (UNSPEC_CLZ): Remove. + (clzsi2): Rename from clz; use clz instead of unspec. + (ctzsi2): New. + * config/arm/arm-protos.h: Update. + +2003-02-05 Jan Hubicka + + * i386-protos.h (x86_emit_floatuns): Declare. + * i386.c (x86_emit_floatuns): New global function. + * i386.md (floatunssisf2, floatunsdisf2, + floatunsdidf2): New patterns. + +2003-01-25 Zdenek Dvorak + + * cfgloopmanip.c (force_single_succ_latches): Fix missindentation. + +2003-02-05 Hans Boehm + + * config/ia64/unwind-ia64.c: include coretypes.h, tm.h to get + config/ia64/linux.h + +2003-02-05 Roger Sayle + + * cfgloop.h (flow_bb_inside_loop_p): Correct prototype again. + +2003-02-05 Jakub Jelinek + + PR optimization/8555 + * config/i386/i386.md (sse_mov?fcc split): Handle op2 == op3 case + instead of aborting. + +2003-02-04 Richard Henderson + + * config/i386/i386.md (UNSPEC_BSF): Remove. + (ffssi2): Split into cmove and no_cmove insns and splitters; + lose pentium float trick for now. + (ffssi_1): Add * to name; use CTZ instead of UNSPEC. + (ctzsi2, clzsi2, bsr): New. + +2003-02-04 Richard Henderson + + * config/ia64/ia64.c (rtx_needs_barrier): Handle POPCOUNT, + UNSPEC_GETF_EXP; remove UNSPEC_POPCNT. + * config/ia64/ia64.md (UNSPEC_POPCNT): Remove. + (ffsdi2): Use popcount instead of unspec. + (popcountdi2): Rename from *popcnt. + (ctzdi2, clzdi2, getf_exp_tf): New. + +2003-02-04 Kazu Hirata + + * genconfig.c (main): Generate CC0_P. + * rtl.h (CC0_P): Remove. + +2003-02-04 Richard Henderson + + * libgcc2.h, libgcc2.c (__ffsSI2): New. + (__ffsDI2): Rename from __ffsdi2. + * mklibgcc.in (lib2funcs): Add _ffssi2. + +2003-02-04 Richard Henderson + + * libgcc2.c (__paritysi2, __paritydi2): Replace last two reduction + rounds with a "bit table" lookup. + +2003-02-04 Ulrich Weigand + + * reload.c (find_reloads): Do not use the mode specified in the insn + pattern as reload mode for address operands. Do not generate optional + reloads for operands where a mandatory reload was already pushed. + +2003-02-04 Richard Henderson + + * longlong.h [alpha] (count_leading_zeros, count_trailing_zeros): Use + builtins instead of inline assembly. + +2003-02-04 Falk Hueffner + + PR c/9376 + * libgcc2.c (__subvdi3): Fix typo. + +2003-02-04 Jan Hubicka + + * i386.md (movti_rex64): Fix constraint. + +2003-02-04 Jan Hubicka + + * i386.md (vector push splitters): Fix typo in resolving conflict. + +2003-02-04 Rodney Brown + + * config/i386/i386.c (x86_function_profiler): Fix typo in format. + +2003-02-04 Phil Edwards + + * doc/install.texi (*-*-linux-gnu): Mention glibc requirements + for recent libstdc++. Remove formatting cruft. + +2003-02-04 Jakub Jelinek + + * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir + attribute even if input file name is absolute, but one of the + includes is relative. + +2003-02-04 Joseph S. Myers + + * doc/gcc.texi, doc/gccint.texi, doc/gcov.texi, + doc/include/fdl.texi, doc/invoke.texi: Update to GFDL 1.2. + * doc/install.texi: Update copyright dates. Update to GFDL 1.2. + +2003-02-03 Richard Henderson + + * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, + __popcountsi2, __popcountdi2, __paritysi2, __paritydi2): Change + return type to "int". Shuffle declarations and undef int trap. + * libgcc2.h: Remove their declarations. + * optabs.c (expand_unop): Force outmode to int for bitops. + +2003-02-03 Bob Wilson + + * config/xtensa/xtensa.c (order_regs_for_local_alloc): Order the + coprocessor registers before floating-point registers. + * config/xtensa/xtensa.h (REG_ALLOC_ORDER): Adjust register numbers + to account for a previously removed register. + (SPEC_REG_FIRST, SPEC_REG_LAST, SPEC_REG_NUM, COUNT_REGISTER_REGNUM): + Delete unused macros. + +2003-02-03 Jan Hubicka + + * i386.c (ix86_expand_store_builtin): Always force op1 to register. + (mov*_internal): Fix predicates; require one of operands to not be + memory. + (SSE?MMX move expanders): Fix predicates; force one of operands to + register. + (SSE/MMX push patterns): Reorganize; fix x86-64 code generation. + (movups/movupd/movdqu patterns): Force one of operands to not be + memory. + +2003-02-03 Roger Sayle + + * hooks.c (hook_rtx_rtx_identity): Generic hook function that + takes a single rtx and returns it unmodified. + * hooks.h (hook_rtx_rtx_identity): Prototype here. + * target.h (struct gcc_target): Add "delegitimize_address" + field to target structure. + * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Provide default + for delegitimize_address target using hook_rtx_rtx_identity. + (TARGET_INITIALIZER): Initialize delegitimize_address field + using TARGET_DELEGITIMIZE_ADDRESS macro. + * simplify-rtx.c (avoid_constant_pool_reference): Handle float + extensions of constant pool references. Use delegitimize_address + to undo the obfuscation of "-fpic". + * Makefile.in (simplify-rtx.o): Add dependency on target.h. + + * config/i386/i386.c (TARGET_DELEGITIMIZE_ADDRESS): Define as + i386_simplify_dwarf_addr. + (ix86_find_base_term): Simplify using i386_simplify_dwarf_addr. + (maybe_get_pool_constant): Likewise. + +2003-02-03 Jan Hubicka + + * i386.c (ix86_expand_int_movcc): Fix setcc sign bit case. + +2003-02-03 Jan Hubicka + + * regclass.c (cannot_change_mode_set_regs): Correct argument order. + +2003-02-02 Kaveh R. Ghazi + + * mips/_tilib.c: Don't include tsystem.h or defaults.h. Don't + define LIBGCC2_WORDS_BIG_ENDIAN. Include coretypes.h and tm.h. + +2003-02-02 Andreas Schwab + + * varasm.c (asm_output_aligned_bss): Declare as possibly unused. + +2003-02-02 Richard Earnshaw + + * arm.md (sibcall_epilogue): Set the "conds" to "clob". + (epilogue_insns): Likewise. + +2003-02-02 John David Anglin + + * doc/install.texi (hppa*-hp-hpux11*): Update installation notes. + +2003-02-02 John David Anglin + + * pa-protos.h (attr_length_millicode_call): Remove second argument. + (attr_length_indirect_call, attr_length_indirect_call, + attr_length_save_restore_dltp): New prototypes. + * pa.c (attr_length_millicode_call): Remove second argument. Check + INSN_ADDRESSES_SET_P in distance calculation. + (output_millicode_call): Check INSN_ADDRESSES_SET_P before using + INSN_ADDRESSES. + (attr_length_call): Check INSN_ADDRESSES_SET_P in distance calculation. + (output_call): Check INSN_ADDRESSES_SET_P before using INSN_ADDRESSES. + Call attr_length_call directly. + (attr_length_indirect_call, output_indirect_call, + attr_length_save_restore_dltp): New functions. + * pa.md (attr_length_millicode_call): Drop second argument from all + patterns. + (return_internal_pic): Delete. + (return_external_pic): Remove use of PIC register and pic operand and + flag checks. + (epilogue): Use return_internal for both normal and pic code. + (call, call_value): Emit new 32-bit pic patterns for symref and + indirect calls. Remove uses for arg pointer and pic register. + (call_symref_pic, call_symref_pic_post_reload, call_reg_pic, + call_reg_pic_post_reload, call_val_symref_pic, + call_val_symref_pic_post_reload, call_val_reg_pic, + call_val_reg_pic_post_reload): New pre and post reload insn patterns. + Implement define_split and define_peephole2 patterns for pre reload + patterns. + (call_symref_64bit, call_internal_reg_64bit, call_value_symref_64bit, + call_value_internal_reg_64bit): Shorten names. + (all call patterns): Explicitly indicate registers used and clobbered. + Use attr_length_indirect_call and attr_length_save_restore_dltp for + attribute length calculation. Move code generation for indirect calls + to output_indirect_call. + (sibcall, sibcall_value): Don't restore PIC register. + (exception_receiver, builtin_setjmp_receiver): Add blockage after PIC + register retore. + +2003-02-02 Gerald Pfeifer + + * doc/install.texi (Testing): Simplify and compress instructions + concerning Dejagnu. + +2003-02-01 John David Anglin + + * collect2.c (pexecute_pid): Rename to pid. + (collect_wait, collect_execute, scan_prog_file, scan_libraries): Use + pid. + +2003-02-01 Geoffrey Keating + + * doc/extend.texi (Function Attributes): Remove documentation + for PowerPC Windows NT function attributes.. + +2003-02-01 Daniel Jacobowitz + + * dwarf2out.c (gen_type_die): Check for typedefs before calling + for TYPE_MAIN_VARIANT. + +2003-02-01 Richard Henderson + + * libgcc2.c: Include auto-host.h. + (ATTRIBUTE_HIDDEN): New. + (__clz_tab): Don't declare here for clz and ctz. + (__clzsi2, __clzdi2): Use count_leading_zeros. + (__ctzsi2, __ctzdi2): Use count_trailing_zeros. + (__popcount_tab): Mark ATTRIBUTE_HIDDEN. + (__paritysi2, __paritydi2): Use shifts instead of __popcount_tab. + * longlong.h (__clz_tab): Mark ATTRIBUTE_HIDDEN. + +2003-02-01 Richard Henderson + + * config/i386/i386.md (addsi_1_zext splitter): Add TARGET_64BIT + to the conditional. + (ashlsi3_1_zext splitter): Likewise. + +2003-02-01 Richard Henderson + + * optabs.c (expand_unop): Use word_mode for outmode of bit scaners. + * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, + __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change + return type to Wtype. + + * libgcc-std.ver (GCC_3.4): Fix inheritance. + + * config/i386/i386.md (ffssi2): Use nonimmediate_operand for + expander input constraint. + +2003-02-01 Falk Hueffner + + * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and + OTI_parity. + (clz_optab, ctz_optab, popcount_optab, parity_optab): New. + * optabs.c (widen_clz, expand_parity): New. + (expand_unop): Handle clz and parity. Hardcode SImode as outmode + for libcalls to clz, ctz, popcount, and parity. + (init_optabs): Init clz_optab, ctz_optab, popcount_optab and + parity_optab, and set up libfunc handlers. + * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2, + __popcountsi2, __popcountdi2, __paritysi2 __paritydi2, + __popcount_tab): New. + * libgcc2.h: Declare them. + * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c. + * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab + and parity_optab. + * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New. + * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT, + BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL, + BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL, + BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL, + BUILT_IN_PARITYLL): New. + * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs + and add optab argument. + (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*. + * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New. + * expr.c (expand_expr): Handle them. + * fold-const.c (tree_expr_nonnegative_p): Likewise. + * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New. + * reload1.c (eliminate_regs): Handle them. + (elimination_effects): Likewise. + * function.c (instantiate_virtual_regs_1): Likewise + * genattrtab.c (check_attr_value): Likewise. + * simplify-rtx.c (simplify_unary_operation): Likewise. + * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR. + * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY. + (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY. + * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New. + * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to + __builtin_arm_clz. + * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move... + * mklibgcc.in (lib2funcs): ...here and merge. Add new members. + * doc/extend.texi (Other Builtins): Add new builtins. + * doc/md.texi (Standard Names): Add new patterns. + +2003-02-01 Ulrich Weigand + + * reload.c: Revert 2003-01-31 change. + +2003-02-01 Jan Hubicka + + * combine.c (combine_simplify_rtx): Use reversed_comparison_code_parts. + +2003-02-01 Richard Sandiford + + * flags.h (flag_volatile): Remove declaration. + (flag_volatile_global, flag_volatile_static): Likewise. + * c-typeck.c (build_indirect_ref): Don't check flag_volatile. + * toplev.c (flag_volatile): Remove definition. + (flag_volatile_global, flag_volatile_static): Likewise. + (f_options): Remove corresponding entries here. + * varasm.c (make_decl_rtl): Don't check flag_volatile_global + or flag_volatile_static. + * doc/invoke.texi: Remove documentation of -fvolatile, + -fvolatile-global and -fvolatile-static. + +2003-01-31 John David Anglin + + * pa.c (pa_output_function_prologue, pa_output_function_epilogue): Move + updating of total_code_bytes from prologue to epilogue. + +2003-01-31 Ulrich Weigand + + * reload.c (find_reloads): Do not use the mode specified in the insn + pattern as reload mode for address operands. Do not generate optional + reloads for operands where a mandatory reload was already pushed. + Generate optional reloads only in the final pass though find_reloads. + (have_replacement_p): New function. + +2003-01-31 Gerald Pfeifer + + * doc/install.texi (Testing): Remove a reference to our obsolete + /testresults web pages and strip redundant information concerning + test results. + (Binaries): Refer to Microsoft Windows instead of listing all + possible variants. + +2003-02-01 Jan Hubicka + + * loop.c (emit_prefetch_instructions): Do conversion at right place in + RTL chain. + + * combine.c (simplify_set): Reverse order of ragumetns to + REG_CANNOT_CHANGE_MODE_P + * df.c (df_def_record_1): Likewise. + * recog.c (register_operand): Likewise. + * simplify-rtx.c (simplify_subreg): Likewise. + * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): Update use of + CANNOT_CHANGE_MODE_CLASS. + * regclass.c (cannot_change_mode_set_regs, invalid_mode_change_p): + Likewise. + * reload.c (push_reload): Likewise. + * alpha.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * ia64.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * mips.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * mips-protos.h (mips_cannot_change_mode_class): Update prototype. + * mips.c (mips_cannot_change_mode_class): Update. + * pa64-regs.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * s390.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * sh.h (CANNOT_CHANGE_MODE_CLASS): Update definition. + * sh-protos.h (sh_cannot_change_mode_class): Update prototype. + * sh.c (sh_cannot_change_mode_class): Update. + * i386.h (CANNOT_CHANGE_MODE_CLASS): New. + * tm.texi (CANNOT_CHANGE_MODE_CLASS): Update documentation. + +2003-01-31 Geoffrey Keating + + * config/darwin.h (LINK_COMMAND_SPEC): Update for Nathan's recent + change to LINK_COMMAND_SPEC in gcc.c. + +2003-01-31 Jan Hubicka + + PR c/9506 + * i386.c (override_options): Use DEFAULT_PCC_STRUCT_RETURN. + +2003-01-31 John David Anglin + + * pa32-regs.h (REGNO_REG_CLASS, REG_CLASS_FROM_LETTER): Delete + duplicated code. + +2003-01-31 Nathan Sidwell + + * tree.h (TYPE_BINFO_SIZE, TYPE_BINFO_SIZE_UNIT): Remove. + (BINFO_ELTS): New #define. + * stor-layout.c (finalize_record_size): Don't set them. + * cp/cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, + BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. + (BINFO_LANG_ELTS): New #define. + * cp/tree.c (make_binfo): Use BINFO_LANG_ELTS. + * java/class.c (make_class): Use BINFO_ELTS. + (set_super_info): Likewse. + (add_interface_do): Likewise. + * objc/objc-act.c (start_class): Use BINFO_ELTS. + +2003-01-31 Danny Smith + + * timevar.c (getrusage): Don't ever declare if not HAVE_GETRUSAGE. + (times): Don't ever declare if not HAVE_TIMES. + (clock): Don't ever declare if not HAVE_CLOCK. + +2003-01-30 Richard Henderson + + * flow.c (update_life_info): Zap life info after cleanup_cfg. + (regno_uninitialized): Use correct live at function entry set. + (regno_clobbered_at_setjmp): Likewise. + + * expr.c (store_expr): Promote all MEM intermediates to regs. + +2003-01-30 Kazu Hirata + + * config/arm/arm.c: Fix comment typos. + * config/arm/arm.h: Likewise. + * config/arm/netbsd-elf.h: Likewise. + * config/arm/netbsd.h: Likewise. + +2003-01-30 Geoffrey Keating + + * gengtype.c (struct walk_type_data): Add needs_cast_p. + (walk_type): Set needs_cast_p in walk_type_data. + (write_types_process_field): Supply casts when required to suppress + warnings. + (write_root): Cast gt_pch_n_S to suppress warning. + * Makefile.in: Remove -Wno-error from gtype-desc.o and c-decl.o. + * config/rs6000/rs6000.c (print_operand): Mask off high bits only + when they might exist. + * config/rs6000/t-rs6000: Remove -Wno-error from varasm.o, + insn-conditions.o, and rs6000.o. + +2003-01-30 Richard Henderson + + * ggc-page.c (G.context_depth_allocations): New. + (G.context_depth_collections): New. + (alloc_page): Set G.context_depth_allocations. + (ggc_collect): Set G.context_depth_collections. + (ggc_push_context): Limit to HOST_BITS_PER_LONG contexts. + (ggc_pop_context): Early exit for no allocations or collections. + +2003-01-30 Richard Henderson + + * tree-inline.c (walk_tree): Streamline duplicate hash table lookup. + +2003-01-30 Richard Earnshaw + + * arm.c (arm_compute_initial_elimination_offset): If optimizing for + size, the link register is always saved if any other register is + saved. + +2003-01-30 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + compute_plussi_cc. + (cpp_reader): Declare before it is used. + * config/h8300/h8300.c (compute_plussi_cc): Change the return + type to int. + * config/h8300/h8300.md (monitor_prologue): Call abort() if we + see an unknown H8 variant. + +2003-01-30 Ralf Corsepius + + PR target/9316 + * config/rs6000/rtems.h: Add CPP_OS_DEFAULT_SPEC. + * config/rs6000/sysv4.h: Add CPP_OS_RTEMS_SPEC. + * config/rs6000/t-rtems: New file. multilib variants to match OS. + * config.gcc (powerpc-*-rtems*): Use rs6000/t-rtems instead of + rs6000/t-ppcgas so we get the desired multilibs. + +2003-01-30 Nick Clifton + + * config/arm/arm.c (arm_output_epilogue): Update stack pointer + when popping saved IP register off the stack. + +2003-01-30 Kazu Hirata + + * config/rs6000/aix43.h: Fix comment typos. + * config/rs6000/aix51.h: Likewise. + * config/rs6000/aix52.h: Likewise. + * config/rs6000/altivec.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/rs6000/spe.md: Likewise. + +2003-01-29 Mark Mitchell + + * c-common.c (builtin_define_float_constants): Define + ___HAS_INFINITY__ and ___HAS_QUIET_NAN__. + +2003-01-30 Kazu Hirata + + * config/sh/lib1funcs.asm: Fix comment typos. + * config/sh/linux.h: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.md: Likewise. + +2003-01-30 Loren James Rittle + + * objc/Make-lang.in (objc-parse.y): Find c-parse.in in $(srcdir). + +2003-01-30 Alexandre Oliva + + * config/fp-bit.h (__make_dp): Declare if TMODES. + +2003-01-29 Kazu Hirata + + * config/h8300/h8300.h (PREDICATE_CODES): Add entries for + general_operand_src and general_operand_dst. + +2003-01-29 David Edelsohn + + * config/rs6000/rs6000.c (function_arg_pass_by_reference): + Return true for variable sized types. + (rs6000_va_arg): Handle variable sized types passed by reference + on non-SVR4 ABI. + +2003-01-29 Richard Earnshaw + + * arm.c (arm_legtimize_address): New function. + * arm-protos.h (arm_legtimize_address): Add prototype. + * arm.h (ARM_LEGITIMIZE_ADDRESS): Use arm_legitimize_address. + (LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS): Wrap with + do ... while (0) + +2003-01-29 Joel Sherrill + + PR bootstrap/9296 + * gthr-rtems.h: Define __GTHREAD_MUTEX_INIT. Apparently no code + depended on it being defined until now. + +2003-01-29 Joel Sherrill + + PR target/9295 + * config/mips/rtems.h: Predefine __USE_INIT_FINI__ so generic + RTEMS code knows which C++ initialization style the toolset + configuration is using. + +2003-01-29 Joel Sherrill + + PR bootstrap/9293 + * config/m68k/t-crtstuff: Replace spaces with tabs, add + $(MULTILIB_CFLAGS) as compiler option and multilib crtbegin/end.o. + +2003-01-29 Joel Sherrill + + PR bootstrap/9292 + * config.gcc (hppa1.1-rtems): Did not include t-rtems nor enable + RTEMS threads. + * config/pa/rtems.h (LIB_SPEC): Use -N when linking. + +2003-01-29 Nick Clifton + + * Makefile.in (c-parse.o): Locate source file in $(parsedir) + not $(srcdir). + +2003-01-29 Andrew Haley + + * tree-inline.c (walk_tree): Add CHAR_TYPE. + +2003-01-29 Jan Hubicka + + * i386.md (subdi3_carry_rex64): Fix typo. + +2003-01-28 Stan Shebs + + * coretypes.h (cpp_reader): Forward declare struct. + * c-pragma.h (cpp_reader): Remove forward declaration. + * hashtable.h (cpp_reader): Likewise. + * scan.h (cpp_reader): Likewise. + * tree.h (cpp_reader): Likewise. + * config/darwin-protos.h (cpp_reader): Likewise. + * config/arm/arm-protos.h (cpp_reader): Likewise. + * config/rs6000/rs6000-protos.h: Remove GCC_CPPLIB_H ifdef, use + struct cpp_reader in prototypes. + +2003-01-28 Christian Cornelssen + + * doc/install.texi: Add documentation for installation into + tooldirs and with DESTDIR. + +2003-01-28 Richard Henderson + + * config.gcc (ia64*-*-aix*): Remove. + * config/ia64/aix.h, config/ia64/t-aix: Remove file. + * config/ia64/unwind-aix.c: Remove file. + +2003-01-28 Andreas Schwab + + * config/m68k/m68k.md (tablejump+2): Don't sign extend an address + register. + * config/m68k/apollo68.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/coff.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/linux.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/m68kelf.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/mot3300.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/netbsd-elf.h (ASM_RETURN_CASE_JUMP): Likewise. + * config/m68k/pbb.h (ASM_RETURN_CASE_JUMP): Likewise. + +2003-01-28 Richard Sandiford + + * combine.c (nonzero_bits): Fix check for negative divide operands. + +2003-01-28 Richard Henderson + + * config/ia64/ia64.c (ia64_rwreloc_section_type_flags): New. + * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): New. + +2003-01-28 Richard Henderson + + * cse.c (find_best_addr): Kill !ADDRESS_COST code. + + * config/cris/cris.c (cris_address_cost): Make static. + (TARGET_RTX_COSTS, TARGET_ADDRESS_COST): New. + * config/cris/cris.h (ADDRESS_COST): Remove. + * config/cris/cris-protos.h: Update. + +2003-01-23 Mike Stump + + * regclass.c (init_reg_autoinc): New function. + (regclass): Move initialization of forbidden_inc_dec_class from + here... + (init_regs): to here. Avoids reinitialization for each function, + saving compilation time. + +2003-01-28 Jason Merrill + + * cpplib.h (struct cpp_options): Add warn_deprecated field. + * cppinit.c (cpp_create_reader): Turn it on by default. + * c-opts.c (c_common_decode_option): Set it. + * cpplib.c (do_pragma_once): Only complain about #pragma once + if warn_deprecated is set. + +2003-01-28 Dale Johannesen + + * emit-rtl.c (const_double_htab_hash): Use mode in the hash. + * loop.c (scan_loop): Move movables on -Os rich-register targets. + * config/rs6000/rs6000.md (sibcall*): Use match_operand for LR. + +2003-01-28 Richard Henderson + + * target.h (targetm.address_cost): New. + * target-def.h (TARGET_ADDRESS_COST): New. + (TARGET_RTX_COSTS): Uncomment. Oops. + * cse.c (address_cost): Use new target hook. + (default_address_cost): New. + * output.h (default_address_cost): Declare. + * hooks.c (hook_int_rtx_0): New. + * hooks.h (hook_int_rtx_0): Declare. + * loop.c (combine_givs_p): Remove if 0 code. + * system.h (ADDRESS_COST): Poison. + + * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c, + config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h, + config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, + config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c, + config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, + config/xtensa/xtensa.c, config/xtensa/xtensa.h + (TARGET_ADDRESS_COST): Define as hook_int_rtx_0. + (ADDRESS_COST): Remove. + + * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, + config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, + config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, + config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, + config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h, + config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h, + config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h, + config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h, + config/mips/mips.c, config/mips/mips.h, + config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, + config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h, + config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h, + config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, + config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h, + config/vax/vax.c, config/vax/vax.h + (foo_address_cost): Make static. + (TARGET_ADDRESS_COST): New. + (ADDRESS_COST): Remove. + + * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h, + config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c, + config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, + config/stormy16/stormy16.h + (ADDRESS_COST): Move code ... + (foo_address_cost): ... here. + (TARGET_ADDRESS_COST): New. + + * config/m32r/m32r.c (m32r_address_cost): Remove. + * config/m32r/m32r-protos.h: Update. + + * config/mmix/mmix.c (mmix_address_cost): Remove. + * config/mmix/mmix-protos.h: Update. + + * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from + mn10300_address_cost; move unsig allocation ... + (mn10300_address_cost): ... here. + (TARGET_ADDRESS_COST): New. + * config/mn10300/mn10300-protos.h: Update. + * config/mn10300/mn10300.h (ADDRESS_COST): Remove. + + * doc/tm.texi: Update. + +2003-01-28 Vladimir Makarov + + * haifa-sched.c (schedule_insn): Return necessary cycle advance + after issuing the insn. + (rank_for_schedule): Make a insn with /S the highest priority + insn. + (move_insn): Ignore schedule groups. Clear SCHED_GROUP_P. + (choose_ready): Check SCHED_GROUP_P. + (schedule_block): Advance cycle after issuing insn if it is + necessary. Don't reorder insns if there is an insn with /S. + (set_priorities): Ignore schedule groups. + + * sched-deps.c (remove_dependence, group_leader): Remove the + functions. + (add_dependence): Ignore schedule groups. + (set_sched_group_p): Don't make copy of dependencies from previous + insn of the schedule group. Add anti-dependency to the previous + insn of the schedule group. + (compute_forward_dependences): Ignore schedule groups. + + * sched-ebb.c (init_ready_list): Ignore schedule groups. + + * sched-rgn.c (init_ready_list): Ditto. + (can_schedule_ready_p): Ditto. + +2003-01-28 Vladimir Makarov + + * config/i386/i386.md (*movsi_1): Use movdqa to move one xmm + register to another one. + +2003-01-28 Richard Henderson + + * calls.c (default_must_pass_in_stack): Fix typo in !type case. + +2003-01-28 Roger Sayle + + * cse.c (cse_insn): Avoid redundant REG_EQUAL notes. + +2003-01-28 Richard Sandiford + + * config/sh/sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA, and the given + class contains a floating-point register, return the size of the + mode in half words. + +2003-01-28 Jan Hubicka + + * i386.c (ix86_carry_flag_operator): New predicate. + (fcmov_operator): Fix whitespace. + (ix86_expand_carry_flag_compare): Deal with floating point. + (ix86_expand_int_movcc): Deal with fp; update insn expansion + (ix86_expand_int_addcc): Likewise. + (ix86_expand_strlensi_unroll_1): likewsie. + * i386.h (PREDICATE_CODES): Add ix86_carry_flag_operator. + * i386.md (add?i_carry_rex64): Use new predicate. + (sub?i3_carry_rex64): Likewise. + (x86_mov?icc_0_m1*): Likewise. + +2003-01-28 Andreas Schwab + + * cfgloopmanip.c (create_preheader): Initialize src to avoid + warning. + + * expmed.c (emit_store_flag): Fix cast to avoid sign + comparison warning. + + * combine.c (force_to_mode): Add cast to fix warning when + STORE_FLAG_VALUE is negative. + +2003-01-27 Richard Henderson + + * Makefile.in (cse.o): Depend on TARGET_H. + * cse.c (rtx_cost): Use targetm.rtx_costs. + * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. + * doc/tm.texi: Update. + + * target.h (targetm.rtx_costs): New. + * target-def.h (TARGET_RTX_COSTS): New. + * hooks.c (hook_bool_rtx_int_int_intp_false): New. + * hooks.h: Update. + + * config/alpha/alpha.c (alpha_rtx_cost_data): New. + (alpha_rtx_costs, TARGET_RTX_COSTS): New. + * config/alpha/alpha.h (PROCESSOR_MAX): New. + (CONST_COSTS, RTX_COSTS): Remove. + + * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, + config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, + config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, + config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, + config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, + config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, + config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, + config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, + config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, + config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, + config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, + config/mn10200/mn10200.h, config/mn10300/mn10300.c, + config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, + config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, + config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, + config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, + config/stormy16/stormy16.c, config/stormy16/stormy16.h, + config/v850/v850.c, config/v850/v850.h, + config/xtensa/xtensa.c, config/xtensa/xtensa.h + (CONST_COSTS, RTX_COSTS): Move code ... + (foo_rtx_costs, TARGET_RTX_COSTS): ... here. + + * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. + (arm_rtx_costs, TARGET_RTX_COSTS): New. + * config/arm/arm-protos.h: Update. + * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. + + * config/avr/avr.h (CONST_COSTS): Move code ... + * config/avr/avr.c (avr_rtx_costs): ... here. + (default_rtx_costs): Make static. + * config/avr/avr-protos.h: Update. + + * config/h8300/h8300.c (const_costs): Make static. + (h8300_and_costs, h8300_shift_costs): Likewise. + * config/h8300/h8300-protos.h: Update. + + * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. + (CONST_COSTS): Move code ... + * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from + default_rtx_costs; update for signature change. + * config/ip2k/ip2k-protos.h: Update. + + * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. + (CONST_COSTS): Move code ... + * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. + (TARGET_RTX_COSTS): New. + (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. + * config/m68hc11/m68hc11-protos.h: Update. + + * config/m68k/m68k.c (const_int_cost): Make static. + * config/m68k/m68k-protos.h: Update. + + * config/mcore/mcore.c (mcore_const_costs): Make static. + (mcore_and_cost, mcore_ior_cost): Likewise. + * config/mcore/mcore-protos.h: Update. + + * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. + (mmix_rtx_cost_recalculated): Remove. + * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. + * config/mmix/mmix-protos.h: Update. + + * config/sh/sh.c (shiftcosts): Make static. + (addsubcosts, andcosts, multcosts): Likewise. + * config/sh/sh-protos.h: Update. + + * config/sparc/sparc.c (TARGET_RTX_COSTS): New. + (sparc_rtx_costs): Make static; update for change in signature. + * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. + * config/sparc/sparc-protos.h: Update. + + * config/v850/v850.c (const_costs): Make static. + * config/v850/v850-protos.h: Update. + + * config/vax/vax.h (RTX_COSTS): Remove. + (CONST_COSTS): Move code ... + * config/vax/vax.c (vax_rtx_costs_1): ... here; rename + from vax_rtx_cost. + (vax_rtx_costs, TARGET_RTX_COSTS): New. + +2003-01-27 Richard Henderson + + * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Remove. Really. + * config/vax/vax-protos.h: Update. Really. + +2003-01-28 Alexandre Oliva + + * config/mips/mips.h (UNITS_PER_HWFPVALUE): Renamed from... + (UNITS_PER_FPVALUE): Defined as the width of a long double, or + zero if no hardware floating point. + (LONG_DUBLE_TYPE_SIZE): Set to 128 on N32 and N64. + (MAX_FIXED_MODE_SIZE): Define to LONG_DOUBLE_TYPE_SIZE. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define. + (BIGGEST_ALIGNMENT): Same as LONG_DOUBLE_TYPE_SIZE. + (FUNCTION_VALUE_REGNO_P): Set for FP_RETURN+2 on N32 and N64. + * config/mips/mips.c (mips_arg_info): Pass TFmode values in + even FP registers on N32 and N64. + (mips_setup_incoming_varargs): Use UNITS_PER_HWFPVALUE. + (mips_va_start): Adjust alignment of ARG_POINTER_REGNUM. + (mips_va_arg): Use UNITS_PER_HWFPVALUE. Impose additional + even-register-like alignment to 128-bit arguments. + (save_restore_insns): Use UNITS_PER_HWFPVALUE. + (mips_function_value): Likewise. Return TFmode in $f0 and $f2 + on N32 or N64. + * config/mips/_tilib.c (__negti2, __ashlti3, __lshrti3): New. + * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Add _tilib.c. + (TPBIT): Set to tp-bit.c. + (tp-bit.c): Create out of fp-bit.c. + +2003-01-28 Gabriel Dos Reis + + * c-parse.in: Remove '%expect 32' directive in objc mode. + +2003-01-27 Nathan Sidwell + + * Makefile.in (LIB2FUNCS_ST): Remove _gcov. + (LIBGCOV): New variable. + (libgcc.mk): Add LIBGCOV. + (LIBGCC_DEPS): Add libgcov.c. + (libgcov.a): New target. + (clean): Remove libgcov.a. + (install-libgcc): Do libgcov too. + (stage1-start, stage2-start, stage3-start, stage4-start): Deal + with libgcov.a. + * libgcc2.c (L_gcov): Move into ... + * libgcov.c: ... here. New file. + * mklibgcc.in: Add libgcov rules. + * gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling. + + * doc/invoke.texi (profile-arcs, test-coverage): Update and + clarify. + + * profile.c (index_counts_file): Remove duplicate check for open file. + +2003-01-27 Jerry Quinn + + * gcc/doc/invoke.texi (Optimization Options): Group together + optional and experimental flags. Move trapv and bounds-check + out of this section. Group floating point flags together. + (Code Gen Options): Move trapv and bounds-check to here. + +2003-01-27 Josef Zlomek + + * gcse.c (constprop_register): Check NEXT_INSN (insn) != NULL. + +2003-01-27 Richard Earnshaw + + PR optimization/9090 + * function.c (purge_addressof_1): After pushing an addressed register + onto the stack, simplify the result. + +2003-01-27 Volker Reichelt + + * doc/extend.texi: Fix typo. + +2003-01-27 Volker Reichelt + + * doc/cppopts.texi: Fix typo. + * doc/objc.texi: Likewise. + * doc/passes.texi: Likewise. + +2003-01-27 Alexandre Oliva + + * real.c (ibm_extended_format): Add 53 to minimum exponent. + (encode_ibm_extended): Adjust. + +2003-01-26 Gabriel Dos Reis + + * timevar.def (TV_OVERLOAD, TV_TEMPLATE_INSTANTIATION): New + timevar_id enumerations. + +2003-01-26 Kazu Hirata + + * combine.c: Fix formatting. + +2003-01-26 Kazu Hirata + + * doc/gccint.texi: Update the copyright. + +2003-01-26 Kazu Hirata + + * doc/cpp.texi: Fix typos. + * doc/extend.texi: Likewise. + * doc/gty.texi: Likewise. + * doc/install.texi: Likewise. + * doc/passes.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/tm.texi: Likewise. + +2003-01-26 Kazu Hirata + + * config/ia64/fde-glibc.c: Fix comment typos. + * config/ia64/hpux.h: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ia64/unwind-ia64.c: Likewise. + +2003-01-26 Kazu Hirata + + * config/i386/i386-modes.def: Fix comment typos. + * config/i386/i386.c: Likewise. + * config/i386/i386.md: Likewise. + +2003-01-26 Steven Bosscher + + * config/avr/avr.h, config/cris/aout.h, config/elfos.h, + config/i386/freebsd-aout.h, config/mips/iris6.h: Undefine + ASM_FINISH_DECLARE_OBJECT before defining it. + * toplev.c (rest_of_decl_compilation): Don't define + ASM_FINISH_DECLARE_OBJECT. Only use it if it is defined. + (rest_of_type_compilation): Don't ATTRIBUTE_UNUSED function + parameters for DWARF2 targets because they _are_ used. + +2003-01-26 Alexandre Oliva + + * fp-bit.h: Define macros for TFmode floating-point constants + in IBM-extended TFmode types. + (TMODES): Define if __LDBL_MANT_DIG__ has the newly-supported + widths. + * config/fp-bit.c (pack_d, unpack_d): Support IBM-extended + TFmode type. + + * config/fp-bit.h: Define macros for TFmode floating-point + constants in IEEE quad TFmode type. Declare functions according + to L_ macros. + (TMODES): Define if __LDBL_MANT_DIG__ is 113. + (TFtype, TItype, UTItype): Define if TMODES is defined. + (MAX_UDI_INT, MAX_DI_INT, BITS_PER_DI): Likewise. + (F_T_BITOFF, D_T_BITOFF): Define. + (IMPLICIT_1, IMPLICIT_2): Cast constants to types that are + guaranteed to be wide enough. + * config/fp-bit.c: Check for L_ macros for tf functions. + (__thenan_tf): New. + (nan): Adjust. + (pack_d, unpack_d): Support IEEE 854 quad type. + (_fpmul_parts): Support TFmode. Compute exponent adjustment + from FRAC_NBITS, FRAC_BITS and NGARDS. + (usi_to_float): Cast constants to be shifted to fractype + instead of assuming long long is wide enough. + (sf_to_tf, df_to_tf, __make_tp, tf_to_df, tf_to_sf): New. + +2003-01-26 Andreas Jaeger + + * df.c: Remove prototype of unused function df_regno_rtl_debug. + +2003-01-26 Alexandre Oliva + + * Makefile.in (FPBIT_FUNCS): Added _sf_to_tf. + (DBBIT_FUNCS): Added _df_to_tf. + (TPBIT_FUNCS): New. + (libgcc.mk): Pass TPBIT and TPBIT_FUNCS down. + (LIBGCC_DEPS): Added TPBIT. + * mklibgcc.in: Support TPBIT and TPBIT_FUNCS. + + * optabs.c (expand_binop) : Return xtarget if we haven't + been able to move the result to target. + + * expr.c (emit_group_store): Initialize dst with CONST0_RTX + for the appropriate mode. + + * calls.c (emit_library_call_value_1): Handle return values + in a PARALLEL. + + * rtl.c (get_mode_alignment): Moved to... + * stor-layout.c: ... here. + + * print-rtl.c (print_rtx): Don't print MEM details in + GENERATOR_FILEs. + +2003-01-26 Michael Hayes + + * df.h: Update comments, tidy formatting. + (DF_FORWARD, DF_REVERSE, DF_UNION, DF_INTERSECTION): Rename from FORWARD, + REVERSE, UNION, INTERSECTION. All uses updated. + (OLD_DF_INTERFACE): Remove. + (struct insn_info): Remove commented out insn field. + * df.c: Update comments, tidy formatting. + (df_def_table_realloc): Remove. + + +2003-01-26 Alan Modra + + * calls.c (save_fixed_argument_area): Tidy. + (restore_fixed_argument_area): Tidy. Set alignment of stack_area. + (expand_call): Comment typo fixes. Don't init low_to_save. Start + call chain loop at 1 if !try_tail_call. Formatting. + (emit_library_call_value_1): Don't init low_to_save or high_to_save. + Use save_fixed_argument_area and restore_fixed_argument_area. + +2003-01-26 Michael Hayes + + * df.c (df_uses_record): Handle CC0. + +2003-01-25 Ulrich Weigand + + * reload.c (maybe_memory_address_p): New function. + (find_reloads_address): Use it instead of memory_address_p. + +2003-01-25 Kaz Kojima + + * final.c (shorten_branches): Align the address of code label + when computing initial lengths and addresses. + +2003-01-25 Kazu Hirata + + * config/m68hc11/m68hc11.md: Fix a comment typo. + +2003-01-25 Andreas Jaeger + + * config/i386/i386.c (x86_output_mi_thunk): Correct test for + TARGET_MACHO. + +2003-01-25 Roger Sayle + + * gcse.c (bypass_last_basic_block): New global variable. + (bypass_block): Use redirect_edge_and_branch_force to redirect + fall-through edges. Use bypass_last_basic_block to determine + which blocks have valid PRE information. + (bypass_conditional_jumps): Initialize bypass_last_basic_block. + +2003-01-25 Jan Hubicka + + * gcse.c (local_cprop_pass): Update reg_sets table when needed. + +2003-01-25 Jan Hubicka + Eric Botcazou + + PR opt/8492 + * gcse.c (one_cprop_pass): Delete unreachable blocks. + +2003-01-25 Richard Henderson + + * config/ia64/ia64.c (ia64_rwreloc_select_rtx_section): Rename + from ia64_aix_select_rtx_section. + (ia64_rwreloc_select_section): Simlarly; use default*_1 function + instead of saving and restoring flag_pic. + (ia64_rwreloc_unique_section): Similarly. + * config/ia64/aix.h (TARGET_ASM_SELECT_SECTION, + TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Update. + * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, + TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): New. + +2003-01-25 Kazu Hirata + + * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Update a + comment. + +2003-01-25 Richard Henderson + + * config/m68k/m68k-none.h (ASM_SPEC): Adjust inter-option spacing. + +2003-01-25 Kelley Cook + + * ggc-simple.c (debug_ggc_tree): Add PTR cast. + +2003-01-25 Segher Boessenkool + + * bitmap.h (BITMAP_WORD): New typedef: fundamental storage + type for bitmaps. Use unsigned long. + (nBITMAP_WORD_BITS): New macro. + (BITMAP_WORD_BITS): New macro. + (rest of file): Use it. + * bitmap.c: Use it. + +2003-01-25 Richard Henderson + + 2002-02-19 Robert Lipe + * config/i386/t-sco5gas: (CRTSTUFF_T_CFLAGS_S): Delete -mcoff. + +2003-01-25 Roger Sayle + + * builtins.c (purge_builtin_constant_p): Scan insn stream + sequentially rather than by basic block. + * function.c (purge_addressof): Simplify test with INSN_P. + +2003-01-25 Kazu Hirata + + * combine.c (simplify_comparison, case AND): Remove a redundant test. + +2003-01-25 Roger Sayle + + * function.h (struct function): New field calls_constant_p. + (current_function_calls_constant_p): New macro for above. + * function.c (prepare_function_start): Initialize calls_eh_return + and calls_constant_p. + * builtins.c (expand_builtin_constant_p): Set calls_constant_p. + * toplev.c (rest_of_compilation): Only call purge_builtin_constant_p + when the current_function_calls_constant_p. + * integrate.c (expand_inline_function): Set calls_constant_p if + the function being inlined has calls_constant_p set. + +2003-01-25 Roger Sayle + + * cse.c (fold_rtx): Instantiate CONSTANT_P_RTX to 0 when not + optimizing, even if flag_gcse is true. + * toplev.c (rest_of_compilation): purge_builtin_constant_p + only needs to be called when "optimize > 0 && flag_gcse". + +2003-01-25 Roger Sayle + + * stmt.c (emit_case_bit_tests): New routine to implement suitable + switch statements using the equivalent of "if ((1< + + * config/ia64/crtend.asm [HAVE_INITFINI_ARRAY]: Make + __do_global_ctors_aux hidden global and don't put it in + .init_array. + * config/ia64/crtbegin.asm [HAVE_INITFINI_ARRAY]: Put it here + instead so that it comes first. + +2003-01-25 Jan Hubicka + + * df.c (read_modify_subreg_p): When osize == UNITS_PER_WORD, + subreg is read/modify. + +2003-01-25 Jan Hubicka + + * i386.c (ix86_expand_movstr, ix86_expand_clrstr): Consistently + do libcall for large blocks. + * i386.md (comi patterns): Set type to ssecomi. + (sse2_unpck?pd): Fix mode of vec_select. + + * cse.c: Include except.h + (cse_set_around_loop): Do not create new basic blocks. + * Makefile.in (cse.o): Add dependnecy on except.h + +2003-01-25 Jan Hubicka + + * builtins.c (fold_trunc_transparent_mathfn): New function. + (fold_builtin): Use it. + * convert.c (convert_to_real): Re-enable code to convert + math functions; add support for floor familly functions. + +2003-01-25 Zdenek Dvorak + + * Makefile.in (cfgloop.o, cfgloopanal.o, cfgloopmanip.o): Add + dependencies on coretypes.h and $(TM_H). + +2003-01-25 Jan Hubicka + + * builtins.c (fold_trunc_transparent_mathfn): Undo accidental commit. + +2003-01-24 Stuart Hastings + + * config/i386/i386.c (x86_output_mi_thunk): Add Darwin/x86 support. + +2003-01-25 Michael Hayes + + * config/c4x/c4x.md (UNSPEC_BU): New constants. + (UNSPEC_RPTS, UNSPEC_LSH, UNSPEC_CMPHI, UNSPEC_RCPF): Likewise. + (UNSPEC_RND, UNSPEC_RPTB_FILL, UNSPEC_LOADHF_INT): Likewise. + (UNSPEC_STOREHF_INT, UNSPEC_RSQRF, UNSPEC_LOADQF_INT): Likewise. + (UNSPEC_STOREQF_INT, UNSPEC_LDIV, UNSPEC_PUSH_ST): Likewise. + (UNSPEC_POP_ST, UNSPEC_PUSH_DP, UNSPEC_POP_DP): Likewise. + (UNSPEC_POPQI, UNSPEC_POPQF, UNSPEC_ANDN_ST): Likewise. + (UNSPEC_RPTB_INIT, UNSPEC_TOIEEE, UNSPEC_FRIEEE): Likewise. + +2003-01-24 Jan Hubicka + + * emit-rtl.c (reg_attrs_htab): New static variable. + (reg_attrs_htab_hash, reg_attrs_htab_eq, get_reg_attrs): New static + functions. + (reg_rtx): Do not maintain regno_decl. + (gen_rtx_REG_offset, set_reg_attrs_from_mem, set_delc_rtx, + set_mem_attrs_from_reg): New global function. + (init_emit): Do not initialize regno_decl. + (init_emit_once): initialize reg_attrs_htab. + * final.c (alter_subreg): Do not replace REG by SUBREG. + (gen_mem_expr_from_op): Improve output. + (output_asm_operands): Likewise. + * function.c (assign_params): Do not set REGNO_DECL. + * function.h (struct function): Kill regno_decl. + (REGNO_DECL): Kill. + * gengtype.c (adjust_field_rtx_def): Handle new field of reg. + * print_rtl.c (print_rtx): Output REG information. + * regclass.c (reg_scan_mark_refs): Update attrs. + * reload1.c (alter_reg): Likewise. + * simplify_rtx.c (simplify_subreg): Likewise. + * stmt.c (expand_decl): Likewise. + * rtl.def (REG): Add new field. + * rtl.h (struct reg_attrs): New. + (rtunion_def): At rtreg. + (X0MEMATTR): Add checking. + (X0REGATTR, REG_ATTRS, REG_EXPR, REG_OFFSET): New macro. + (set_reg_attrs_from_mem, set_mem_attrs_from_reg, gen_rtx_REG_offset): + Declare. + * tree.h (SET_DECL_RTL): Call set_decl_rtl. + +2003-01-24 Bob Wilson + + * config/xtensa/xtensa.c: Remove unused include of machmode.h. + (xtensa_emit_call, print_operand): Fix printf format strings + to avoid compile warnings. + (xtensa_function_prologue, xtensa_function_epilogue): Change type + of "size" argument to HOST_WIDE_INT to fix compile warnings. + * config/xtensa/xtensa-protos.h + (xtensa_function_prologue, xtensa_function_epilogue): Ditto. + +2003-01-24 Jan Hubicka + + * builtins.c (DEF_BUILTIN): Accept 10 arguments. + (implicit_built_in_decls): New global array. + (mathfn_built_in): New global function. + (fold_trunc_transparent_mathfn): New static function + (expand_builtin_strstr, expand_bultin_strchr, + expand_builtin_strpbrk, expand_builtin_strcpy, + expand_builtin_strncpy, expand_bultin_strcmp, + expand_bultin_strncat, expand_builtin_fputs): Use + implicint_built_in_decls. + (fold_builtin): Fold floor/trunc/round/ceil/nearbyint. + * builtins.def: Fix comments. + (DEF_GCC_BUILTIN, DEF_FALLBACK_BUILTIN, DEF_EXT_FALLBACK_BUILTIN, + DEF_LIB_BUILTIN, DEF_LIB_ALWAYS_BUILTIN, DEF_EXT_LIB_BUILTIN, + DEF_C99_BULTIN, DEF_FRONT_END_LIB_BUILTIN, + DEF_EXT_FRONT_END_LIB_BUILTIN): Pass implicit as needed. + (DEF_C99_C90RES_BULTIN): New. + (*f, *l builtins): Update. + * c-common.c (DEF_BUILTIN): Initialize implicit array. + (c_expand_builtin_printf, c_expand_builtin_fprintf): Update. + * convert.c (strip_float_extensions): New global function. + * tree.h (DEF_BUILTIN): Accept 10 arguments. + (implicit_built_in_decls, mathfn_built_in, strip_float_extension): + Declare. + * java/builtins.c (define_builtin): Handle implicit. + (DEF_BUILTIN): Update. + * tm.texi (TARGET_C99_FUNCTIONS): Document. + * defaults.h (TARGET_C99_FUNCTIONS): Default to 0. + * config/linux.h (TARGET_C99_FUNCTIONS): Default to 1 + when using glibc2. + +2003-01-24 Bob Wilson + + * config.gcc (xtensa-*-elf*): Removed assignments to with_newlib, + extra_parts, and fixincludes. Add xtensa/t-elf tmake_file. + (xtensa-*-linux*): Add xtensa/t-linux tmake_file. + * config/xtensa/crti.asm: New file. + * config/xtensa/crtn.asm: New file. + * config/xtensa/t-elf: New file. + * config/xtensa/t-linux: New file. + * config/xtensa/t-xtensa: Add rules for crti.o and crtn.o. + Move various CFLAGS settings to new t-elf file. + +2003-01-24 Richard Henderson + + PR optimization/4382 + * tree-inline.c (find_builtin_longjmp_call_1): New. + (find_builtin_longjmp_call): New. + (inlinable_function_p): Use it. + +2003-01-24 Zdenek Dvorak + + * config/i386/i386-protos.h (function_arg_pass_by_reference): Declare. + * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Use it. + * config/i386/i386.c (function_arg_pass_by_reference): New. + (ix86_va_arg): Support arguments passed by reference. + +2003-01-24 Zdenek Dvorak + + * cfgloopanal.c: New file. + * cfgloopmanip.c: New file. + * Makefile.in (cfgloopanal.o, cfgloopmanip.o): New. + (toplev.o, loop.o, doloop.o, unroll.o, cfgloop.o, predict.o, + cfglayout.o): Add dependency on cfgloop.h. + (cfgloop.o): Add flags.h dependency. + * basic-block.h (BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK): New flags. + (VLS_EXPECT_PREHEADERS, VLS_EXPECT_SIMPLE_LATCHES): Removed. + (struct loop, struct loops, flow_loops_find, flow_loops_update, + flow_loops_free, flow_loops_dump, flow_loop_dump, + flow_loop_scan, flow_loop_tree_node_add, flow_loop_tree_node_remove, + LOOP_TREE,,LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES, + LOOP_ALL, flow_loop_outside_edge_p, flow_loop_nested_p, + flow_bb_inside_loop_p, get_loop_body, loop_preheader_edge, + loop_latch_edge, add_bb_to_loop, remove_bb_from_loops, + find_common_loop, verify_loop_structure): Declarations moved to ... + * cfgloop.h: New file. + * bb-reorder.c (reorder_basic_blocks): Modified. + * cfglayout.c: Include cfgloop.h. + (cleanup_unconditional_jumps, cfg_layout_redirect_edge, + cfg_layout_duplicate_bb, cfg_layout_initialize): Update loop structure. + (break_superblocks): New static function. + (cfg_layout_finalize): Use it. + (cfg_layout_split_block): New function. + * cfglayout.h (struct reorder_block_def): Add copy and duplicated + fields. + (cfg_layout_initialize, cfg_layout_redirect_edge): Declaration + changed. + (cfg_layout_split_block): Declare. + * cfgloop.c: Include cfgloop.h and flags.h. + (flow_loop_dump, flow_loops_free, flow_loop_exit_edges_find, + get_loop_body): Avoid signed versus unsigned comparison warnings. + (make_forwarder_block, flow_loops_find, loop_preheader_edge, + loop_latch_edge): Modified. + (verify_loop_structure): Modified to use flags stored in loop structure; + check irreducible loops. + (cancel_loop, cancel_loop_tree): New functions. + (estimate_probability): Use loop analysis code for predictions. + (estimate_loops_at_level): Avoid signed versus unsigned comparison + warnings. + * doloop.c: Include cfgloop.h. + * loop.c: Include cfgloop.h. + * predict.c: Include cfgloop.h. + * toplev.c: Include cfgloop.h. + * unroll.c: Include cfgloop.h. + * tracer.c (tracer): Modified. + +2003-01-24 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Fix a typo. + +2003-01-24 Ulrich Weigand + + * configure.in (HAVE_AS_TLS): Add s390-*-* and s390x-*-* cases. + * configure: Regenerate. + + * config/s390/s390-protos.h (tls_symbolic_operand): Add prototype. + (tls_symbolic_reference_mentioned_p): Add prototype. + (s390_tls_get_offset): Add prototype. + (emit_pic_move): Remove prototype, replace by ... + (emit_symbolic_move): .. this new prototype. + + * config/s390/s390.c (TARGET_HAVE_TLS): Conditionally define. + (tls_model_chars): New global variable. + (s390_encode_section_info): Encode TLS model. + Use targetm.binds_local_p to check for local symbols. + (s390_strip_name_encoding): New function. + (TARGET_STRIP_NAME_ENCODING): Define. + + (get_thread_pointer): New function. + (legitimize_tls_address): New function. + (legitimize_address): Call it. + (emit_pic_move): Remove, replace by ... + (emit_symbolic_move): ... this new function. + + (larl_operand): Handle TLS operands. + (legitimate_constant_p): Likewise. + (s390_decompose_address): Likewise. + (s390_cannot_force_const_mem): New function. + (TARGET_CANNOT_FORCE_CONST_MEM): Define. + + (s390_output_symbolic_const): Handle TLS unspecs. + (print_operand): New code 'J'. + (machine_function): Add struct member 'some_ld_name'. + (get_some_local_dynamic_name, get_some_local_dynamic_name_1): New. + + (enum s390_builtin): New type. + (code_for_builtin_64, code_for_builtin_31): New global variables. + (s390_init_builtins, s390_expand_builtin): New functions. + (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. + + * config/s390/s390.h (TLS_SYMBOLIC_CONST): New macro. + (ASM_OUTPUT_LABELREF): Define. + (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Handle TLS constants. + + * config/s390/s390.md: Define TLS UNSPEC constants. + ("movdi", "movsi"): Handle TLS operands. + ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): New insns. + ("*tls_load_64", "*tls_load_31"): New insns. + ("call_value_tls", "call_value_tls_exp"): New expanders. + ("brasl_tls", "bras_tls", "basr_tls_64", "basr_tls_31", + "bas_tls_64", "bas_tls_31"): New insns. + +2003-01-24 Nathan Sidwell + + * config/rs6000/rs6000.c (rs6000_parse_abi_options): Make sure + spe ABI is configured, if requested. + +2003-01-24 Volker Reichelt + + * doc/passes.texi: Fix typo. + +2003-01-24 Andreas Schwab + + * stor-layout.c (excess_unit_span): Only define if used. + +2003-01-24 Jerry Quinn + + * gcc/doc/invoke.texi (Optimization Options): List -O levels + for each optimization flag. + +2003-01-24 Kazu Hirata + + * config/h8300/h8300.md (*andsi3_ashift_n_lower): New. + +2003-01-24 Volker Reichelt + + * doc/bugreport.texi: Use @command instead of @code for commands. + * doc/collect2.texi: Likewise. + * doc/headerdirs.texi: Likewise. + * doc/invoke.texi: Likewise. + * doc/standards.texi: Likewise. + * doc/tm.texi: Likewise. + * doc/trouble.texi: Likewise. + +2003-01-24 Nick Clifton + + * config/arm/arm.c (use_return_insn): Do not use a single return + instruction for interrupt handelrs which have to create a stack + frame. + (arm_expand_prologue): Do not pre-bias the return address of + interrupt handlers which create a stack frame. + +2003-01-24 Nick Clifton + + * Add sh2e support: + + 2002-08-12 Alexandre Oliva + + * config/sh/sh.c (output_branch) [TARGET_SH2E]: Handle + med_cbranches. Fix logic in short_cbranches. + + 2002-04-03 Alexandre Oliva + + * config/sh/sh.md (delay for cbranch): Don't annul delay + slots on SH2e. + * config/sh/sh.c (sh_insn_length_adjustment): Add 2 for + cbranch with unfilled delay slot on SH2e. + (output_branch): Fill with a nop the delay slot of a + branch that required a delay slot but didn't get one. + + 2002-04-02 Alexandre Oliva + + * doc/invoke.texi (SH options): Document -m2e. + * config/sh/crt1.asm: Add __SH2E__ Next to __SH3E__. + * config/sh/lib1funcs.asm: Likewise. + * config/sh/sh.c: Replace all uses of TARGET_SH3E with SH2E. + * config/sh/sh.h (CPP_SPEC): Define __SH2E__ for -m2e, and + not __sh1__. + (CONDITIONAL_REGISTER_USAGE): Don't disable FP regs from + SH2E up. + (SH3E_BIT): Renamed to... + (SH_E_BIT): ... this. Replace all uses. + (TARGET_SH2E): Define from SH_E_BIT and TARGET_SH2. + Replace all uses of TARGET_SH3E with TARGET_SH2E. + (TARGET_SWITCHES): Added 2e. + (OVERRIDE_OPTIONS): Set sh_cpu for SH2E. + (processor_type): Added PROCESSOR_SH2E. + * config/sh/sh.md: Replace all uses of TARGET_SH3E with + TARGET_SH2E, except in sqrtsf2_i. + (attribute cpu): Added sh2e. + * config/sh/t-sh (MULTILIB_OPTIONS): Replace m3e with m2e. + (MULTILIB_MATCHES): Use m2e multilib for m3e. + * config.gcc: Add sh2e target support. + +2003-01-24 Phil Edwards + + Rename -W to -Wextra. + * c-decl.c: Update comments. + * c-typeck.c: Likewise. + * flags.h: Likewise. + * function.c: Likewise. + * stmt.c: Likewise. + * toplev.c: Update comments. + (W_options): Add 'extra'. + (display_help): Remove '-W'. + (decode_W_option): Special warn_uninitialized treatment in the case + of -Wextra. + * doc/invoke.texi: Update with new entries. + +2003-01-23 Richard Henderson + + * ifcvt.c (noce_process_if_block): Re-add check vs X being changed + in no-else-block case. Add commentary. + +2003-01-23 Kaveh R. Ghazi + + * configure.in: Revert last change. + +2003-01-23 Kaveh R. Ghazi + + * configure.in: Don't include ansidecl.h in tconfig.h. + * gcov-io.h (PARAMS, ATTRIBUTE_UNUSED): Define if IN_LIBGCC2. + * unwind-dw2-fde.h (last_fde): Use __attribute__, not + ATTRIBUTE_UNUSED. + + * configure: Regenerate. + +2003-01-23 Franz Sirl + + PR java/6748 + * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Don't destroy + regs->nip. Fix rt_sigreturn frame layout. Add support for newer + kernels. + +2003-01-23 Kaveh R. Ghazi + + * cpplex.c (cpp_interpret_charconst): Squelch warning with cast. + +2003-01-23 Ulrich Weigand + + * genattrtab.c (write_attr_get): Mark 'insn' paramter + as ATTRIBUTE_UNUSED. + +2003-01-23 Richard Earnshaw + + * arm.c (thumb_base_register_rtx_p): New function. + (thumb_index_register_rtx_p): New function. + (thumb_legitimate_address_p): New function. + (thumb_legitimate_offset_p): New function. + * arm.h (REG_STRICT_P): Define according to setting of REG_OK_STRICT. + (ARM_GO_IF_LEGITIMATE_ADDRESS): Use REG_STRICT_P to avoid duplicate + definitions. + (THUMB_GO_IF_LEGITIMATE_ADDRESS): Use thumb_legitimate_address_p. + (THUMB_LEGITIMATE_OFFSET): Delte. + (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Use thumb_legitimate_offset. + * arm-protos.h (thumb_legitimate_address_p): Add prototype. + (thumb_legitimate_offset_p): Likewise. + +2003-01-23 Andreas Schwab + + * unwind.h (_Unwind_GetTextRelBase): Mark parameter as unused. + +2003-01-23 Kaveh R. Ghazi + + * fixinc/Makefile.in (FL_LIST): Revert last change. + +2003-01-23 Volker Reichelt + + PR other/7341 + * invoke.texi (ftest-coverage): Fix broken cross-reference. + Change @code to @command for gcov command. + + * gcc.texi: Adjust title of gcov section. + Adjust copyright. + * gcov.texi: Likewise. + +2003-01-22 Roger Sayle + + PR optimization/8423 + * cse.c (fold_rtx): Only eliminate a CONSTANT_P_RTX to 1 when + its argument is constant, or 0 if !flag_gcse. + * simplify-rtx.c (simplify_rtx): Convert CONSTANT_P_RTX to 1 + if it's argument is constant. + * gcse.c (want_to_gcse_p): Ignore CONSTANT_P_RTX nodes. + (hash_scan_set): Don't record CONSTANT_P_RTX expressions. + (do_local_cprop): Don't propagate CONSTANT_P_RTX constants. + * builtins.c (purge_builtin_constant_p): New function to force + instantiation of any remaining CONSTANT_P_RTX nodes. + * rtl.h (purge_builtin_constant_p): Prototype here. + * toplev.c (rest_of_compilation): Invoke purge_builtin_constant_p + pass after GCSE and before loop. + (flag_gcse): No longer static. + * flags.h (flag_gcse): Prototype here. + +2003-01-22 Ulrich Weigand + + * config/s390/s390.h (HARD_REGNO_MODE_OK): Fix warning regression + introduced by last change. + +2003-01-22 Andreas Schwab + + * ra-rewrite.c (rewrite_program2): Initialize bb to avoid warning. + +2003-01-22 Kazu Hirata + + * config/h8300/h8300.c (h8300_shift_needs_scratch_p): Don't + request a scratch reg on H8S when the shift count is 8. + +2003-01-22 Ulrich Weigand + + * config/s390/s390-protos.h (preferred_la_operand_p): + Remove second parameter. + * config/s390/s390.c (preferred_la_operand_p): Likewise. + * config/s390/s390.h (FRAME_REGNO_P, FRAME_REG_P): New macros. + (HARD_REGNO_MODE_OK): Use FRAME_REGNO_P. + * config/s390/s390.md ("*la_cc_64", "*la_cc_31", splitters): Remove. + Add peepholes to transform ADD to LOAD ADDRESS. + +2003-01-22 Richard Earnshaw + + * arm.c (arm_address_register_rtx_p): New function. + (arm_legitimate_address_p): New function. + (arm_legitimate_index_p): New function. + (legitimize_pic_address): Use arm_legitimate_index_p. + * arm-protos.h (arm_legtimate_address_p): Add prototype. + * arm.h (ARM_GO_IF_LEGITIMATE_INDEX): Delete. + (ARM_GO_IF_LEGITIMATE_ADDRESS): Call arm_legitimate_address_p. + +2003-01-22 Hartmut Penner + + * config/s390/s390.md (floatdfdi2): Insn has type 'itof'. + * config/s390/2064.md (define_bypass): Correct 'Load' and + 'Load-address' bypass values. + +2003-01-22 Andreas Schwab + + * config/ia64/t-ia64 (insn-attrtab.o-warn): Define as -Wno-error. + +2003-01-21 Zack Weinberg + + * genautomata.c (output_internal_insn_latency_func, + output_print_reservation_func): Short circuit when there is no + automaton to generate code for. + +2003-01-21 Kaveh R. Ghazi + + * Makefile.in (ssa-ccp.o): Depend on coretypes.h $(TM_H). + (df.o): Delete duplicate dependency on coretypes.h $(TM_H). + +2003-01-21 Geoffrey Keating + + * config/rs6000/rs6000.md: Remove warning. + (builtin_setjmp_receiver): Likewise. + * config/darwin.c (update_stubs): Slightly improve terrible hack + with identifiers. Add comment pointing out problems with it. + (update_non_lazy_ptrs): Likewise. + +2003-01-21 Richard Henderson + + * dwarf2out.c (lookup_filename): Fix printf format warning. + * system.h (fread_unlocked, fwrite_unlocked): Undef. + + * fixinc/Makefile.in (FL_LIST): Add $($@-warn) hook. + (fixincl.o-warn, gnu-regex.o-warn): New. + * fixinc/fixfixes.c (FIX_PROC_HEAD): Mark parameters unused. + * fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Likewise. + * fixinc/fixincl.c (process): Fix printf format warning. + +2003-01-21 Ulrich Weigand + + * dwarf2out (output_file_names): Don't crash if called + with empty file_table. + +2003-01-21 Zack Weinberg + + * genautomata.c (output_internal_insn_latency_func): Add + missing break statement to generated code. + +2003-01-21 Roger Sayle + + * stmt.c (same_case_target_p): New function to determine whether + two case labels branch to the same target. Split out from... + (group_case_nodes): ... here. Use same_case_target_p instead. + (strip_default_case_nodes): Remove explicit case nodes + that branch to the default destination. + (expand_end_case_type): Call strip_default_case_nodes after + group_case_nodes, to simplify the case-list before we count it. + Only generate table_label RTX when actually needed. Try to share + thiscase->exit_label and thiscase->data.case_stmt.default_label + when a switch has no explicit default case. Simplify test for + constant index. + +2003-01-21 Kazu Hirata + + * config/h8300/h8300.md (*negsf2_h8300): Use \\t instead of + \t. + (*negsf2_h8300hs): Likewise. + (*addsi3_lshiftrt_16_zexthi): Likewise. + (*iorhi3_lshiftrt_8): Likewise. + +2003-01-21 Ulrich Weigand + + * dwarf2out.c (fde_table_in_use): Mark GTY. + (dwarf2out_cfi_label_num): New variable, marked GTY. + (dwarf2out_cfi_label): Use it instead of static label_num. + * emit-rtl.c (label_num): Mark GTY. + +2003-01-21 Kazu Hirata + + * config/h8300/h8300.c (output_plussi): Support H8/300. + (compute_plussi_length): Likewise. + (compute_plussi_cc): Likewise. + * config/h8300/h8300.md (addsi_h8300): Use output_plussi to + output assembly instructions. + +2003-01-21 Kaveh R. Ghazi + + * calls.c (fix_unsafe_tree): Prototype. + + * Makefile.in (GCC_WARN_CFLAGS): Add $(WERROR) $($@-warn) + (gtype-desc.o-warn, c-decl.o-warn, varasm.o-warn, gcc.o-warn, + insn-conditions.o-warn, out_object_file, gengtype-yacc.o-warn, + c-parse.o-warn): Add -Wno-error. + (STAGE2_FLAGS_TO_PASS): Add WERROR="@WERROR@". + + * configure.in (--enable-werror): Add new flag. + * doc/install.texi (--enable-werror): Document. + * configure: Regenerate. + + * objc/Make-lang.in (objc/objc-parse.o-warn): Add -Wno-error. + +2003-01-21 Andreas Schwab + + * genautomata.c (output_internal_insn_latency_func): Fix missing + close paren in output. + +2003-01-21 Zack Weinberg + + * genautomata.c: Space savings in generated code: + (output_dfa_insn_code_func): Split out the table-enlargement + path to an out-of-line static function, dfa_insn_code_enlarge. + (output_internal_insn_latency_func): Use a lookup table for the + default latencies. + (output_print_reservation_func): Use a lookup table for the + strings. + +2003-01-21 Christian Ehrhardt + + PR opt/7507 + * calls.c (fix_unsafe_tree): Split out from ... + (expand_call): ... here. Use it on the function address too. + +2003-01-20 Richard Henderson + + * expr.h (default_must_pass_in_stack): Move decl outside ifdef. + +2003-01-20 Richard Henderson + + PR opt/7154 + * stmt.c (expand_asm_operands): Validize memory operands. + +2003-01-20 Richard Henderson + + PR opt/8848 + * ifcvt.c (noce_process_if_block): Correct arguments to + modified_between_p for no-else-block case. + +2003-01-20 Kazu Hirata + + * config/h8300/h8300.c (const_costs): Remove a warning. + (output_plussi): Likewise. + (compute_plussi_length): Likewise. + (compute_plussi_cc): Likewise. + +2003-01-20 Kazu Hirata + + * config/h8300/h8300.md (addsi_h8300): Remove the last + alternative. + +2003-01-20 Kazu Hirata + + * config/h8300/h8300.c (get_shift_alg): Remove redundant code. + +2003-01-20 Kaveh R. Ghazi + + * system.h (__NO_STRING_INLINES): Define. + +2003-01-20 John David Anglin + + * ifcvt.c (noce_emit_store_flag): Don't emit store flag if mode of x + is not a scalar int mode. + +2003-01-20 Roger Sayle + + * cse.c (cse_insn): Avoid RTL sharing when updating the RETVAL + insn's notes following a substitution inside a libcall. + +2003-01-20 Zack Weinberg + + * configure.in: Check for system-provided 'uchar' type. + * configure, config.in: Regenerate. + * cpphash.h: Only typedef 'uchar' if the system doesn't. + +2003-01-20 Richard Henderson + + * expr.h (MUST_PASS_IN_STACK): Move implementation... + * calls.c (default_must_pass_in_stack): ... here. + +2003-01-20 Vladimir Makarov + + * genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c. + + * genautomata.c (INSN_ALTS_FUNC_NAME): Move it into genattrtab.h. + + * genattr.c (main): Output default definition of AUTOMATON_ALTS. + Wrap up definition of `insn_alts'. + + * genattrtab.c (main): Wrap up `insn_alts'. + +2003-01-20 Kaveh R. Ghazi + + * collect2.c (ldgetname): Check HAVE_DECL_LDGETNAME before + prototyping. + * configure.in: Check for and ldgetname() prototype. + + * config.in, configure: Regenerate. + +2003-01-20 Nick Clifton + + * config/arm/arm.md (sibcall_epilogue): Add an + UNSPEC_PROLOGUE_USE to prevent the link register from being + considered dead. + +2003-01-20 Jan Hubicka + + * i386.md (SSE cmov splitter): Handle memory operand in operand 5. + +2003-01-20 Andreas Schwab + + * system.h: Don't declare strsignal if the decl test hasn't been + run yet. + +2003-01-20 Kazu Hirata + + * config/h8300/h8300.c (notice_update_cc): Don't assume that + recog_data.operands[0] is always associated with cc0. + +2003-01-19 David Edelsohn + + * collect2.c (ldgetname): Expand declaration to prototype. + * read-rtl.c (atoll): Add prototype. + * system.h (strsignal): Also declare if no declaration found. + +2003-01-19 Alexandre Oliva + + * config.gcc (mips64*-*-linux*): Added. + * config/mips/linux64.h, config/mips/t-linux64: New file. + * config/mips/iris6.h (MIPS_TFMODE_FORMAT): Define. + * config/mips/mips.c (override_options): Use it. + * config/mips/mips.h (TARGET_SWITCHES): Added... + (SUBTARGET_TARGET_SWITCHES): New, empty by default. + * Makefile.in (SPECS): New. + (STAGESTUFF, specs, mostlyclean, install-common): Use it. + * gcc.c (process_command): Move self-spec processing past spec + file loading. + * doc/tm.texi (DRIVER_SELF_SPECS): Document the change. + * doc/fragments.texi (MULTILIB_EXTRA_OPTS): Document need for + CRTSTUFF_T_CFLAGS. + (SPECS): Document. + * doc/invoke.texi (-mabi-fake-default): Document. + +2003-01-19 Stephane Carrez + + * config/m68hc11/m68hc11.c (stack_push_word, stack_pop_word, + z_reg, z_reg_qi): Declare static and GTY(). + (da_reg): Remove. + (create_regs_rtx): Don't create da_reg. + ("gt-m68hc11.h"): Include for GTY roots. + * config/m68hc11/m68hc11.h (ix_reg, iy_reg, d_reg): Declare extern + and GTY() here. + (m68hc11_compare_op0, m68hc11_compare_op1): Likewise. + (m68hc11_soft_tmp_reg): Likewise. + * config/m68hc11/m68hc11-protos.h: Remove above declarations. + +2003-01-18 Kazu Hirata + + * basic-block.h: Fix comment formatting. + * calls.c: Likewise. + * combine.c: Likewise. + * convert.c: Likewise. + * gcov.c: Likewise. + * haifa-sched.c: Likewise. + * libgcc2.c: Likewise. + * loop.c: Likewise. + * profile.c: Likewise. + * system.h: Likewise. + +2003-01-18 Roger Sayle + + * config/pa/pa.md (muldi3): Avoid invalid sharing of SUBREG RTXs. + +2003-01-17 Kaveh R. Ghazi + + * ra-build.c (undef_to_size_word): Avoid `switch' warning. + +2003-01-17 Dale Johannesen + + * config/rs6000/rs6000.md (*floatsidf2_internal): Add earlyclobbers. + (*floatunssidf2_internal): Ditto. + +2003-01-17 Kazu Hirata + + * alias.c: Fix comment typos. + * basic-block.h: Likewise. + * c-common.c: Likewise. + * c-common.h: Likewise. + * c-decl.c: Likewise. + * c-opts.c: Likewise. + * c-pragma.c: Likewise. + * c-pretty-print.h: Likewise. + * cfg.c: Likewise. + * cfganal.c: Likewise. + * cfgbuild.c: Likewise. + * cfgcleanup.c: Likewise. + * cfglayout.c: Likewise. + * cfgrtl.c: Likewise. + * convert.c: Likewise. + * cpphash.h: Likewise. + * cpplex.c: Likewise. + * cpplib.h: Likewise. + * df.h: Likewise. + * diagnostic.c: Likewise. + * diagnostic.h: Likewise. + * dwarf2.h: Likewise. + +2003-01-17 Stan Shebs + + * config/darwin-protos.h: Forward-declare struct cpp_reader. + +2003-01-17 Douglas B Rupp + + * config/alpha/alpha.c (alpha_need_linkage): Fix obvious + mistake in last checkin. + +2003-01-17 Kazu Hirata + + * et-forest.c: Fix comment typos. + * et-forest.h: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * flags.h: Likewise. + * flow.c: Likewise. + * gcc.c: Likewise. + * gcse.c: Likewise. + * genattrtab.c: Likewise. + * genautomata.c: Likewise. + * gengtype.c: Likewise. + * genrecog.c: Likewise. + * global.c: Likewise. + * gthr-rtems.h: Likewise. + +2003-01-17 Kaveh R. Ghazi + + * i386.c (x86_function_profiler): Fix format specifier. + +2003-01-17 Richard Henderson + + * gengtype.c (walk_type): Allow paramN_is. + +2003-01-17 Nick Clifton + + * config/i960/t-960bare (i960-c.o): Add missing newline escape. + +2003-01-16 Richard Henderson + + * config/alpha/linux-elf.h (LIB_SPEC): Adjust inter-option spacing. + +2003-01-16 Richard Henderson + + * config/alpha/alpha.c (alpha_sr_alias_set): Mark GTY. + (alpha_next_sequence_number): Likewise. + (alpha_this_literal_sequence_number): Likewise. + (alpha_this_gpdisp_sequence_number): Likewise. + (struct alpha_funcs, alpha_funcs_num): Likewise. + (struct alpha_links): Fix branch merge error. + (alpha_need_linkage, alpha_use_linkage): Use GC for alpha_funcs. + +2003-01-17 Alexandre Oliva + + * config/mips/mips.h: Don't use #elif. Reported by Kaveh + R. Ghazi. + +2003-01-16 Kazu Hirata + + * ifcvt.c: Fix comment typos. + * lcm.c: Likewise. + * libgcc2.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * predict.c: Likewise. + * ra-build.c: Likewise. + * ra.c: Likewise. + * ra-colorize.c: Likewise. + * ra.h: Likewise. + * ra-rewrite.c: Likewise. + * regmove.c: Likewise. + * reload.h: Likewise. + * rtlanal.c: Likewise. + * toplev.c: Likewise. + * tree.h: Likewise. + * unwind-dw2-fde-glibc.c: Likewise. + * vmsdbgout.c: Likewise. + +2003-01-16 Richard Henderson + + * dwarf2out.c (struct file_table): Remove. + (FILE_TABLE_INCREMENT): Remove. + (file_table): Make a varray; mark for GC. Update all users. + (file_table_last_lookup_index): Extract from struct file_table. + (output_file_names): Fix unsigned compare warnings. + (add_name_attribute): Remove inline marker. + (add_comp_dir_attribute): Split out from gen_compile_unit_die. + (lookup_filename): Don't manage size of file_table. + (init_file_table): Allocate file_table with GC. + (dwarf2out_init): Don't record main_input_filename here. + (dwarf2out_finish): Do it here instead. + +2003-01-16 Bruce Korb + + * gcc/fixinc/inclhack.def(limits_ifndef): QNX needs a bypass, too. + +2003-01-16 Kaz Kojima + + * config/sh/sh.c (sh_initialize_trampoline): Emit rotrdi3_mextr + instead of rotldi3_mextr. + +2003-01-16 Vladimir Makarov + + * haifa-sched.c (move_insn): Restore moving all schedule group. + (set_priorities): Restore taking SCHED_GROUP_P into account. + + * sched-deps.c (add_dependence): Restore processing the last group + insn. + (remove_dependence, group_leader): Restore the functions. + (set_sched_group_p): Restore adding dependencies from previous insn + in the group. + (compute_forward_dependences): Restore usage of group_leader. + + * sched-ebb.c (init_ready_list): Restore taking SCHED_GROUP_P into + account. + + * sched-rgn.c (init_ready_list): Restore taking SCHED_GROUP_P into + account. + (can_schedule_ready_p): Ditto. + (add_branch_dependences): Restore skipping over the group insns. + +2003-01-16 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix handling + 68HC12 pre/post inc/dec side effects. + +2003-01-16 Stephane Carrez + + * config/m68hc11/m68hc11.h (MASK_M6812): Define. + +2003-01-16 J"orn Rennecke + + * sh.md (mshflo_w_x): Fix description of operation. + +2003-01-16 Zack Weinberg + + * config/rs6000/rs6000.h: Mention Altivec registers in + commentary. Fix typo. + +2003-01-16 David Edelsohn + + * config/rs6000/rs6000.md (movti_string): Remove clobber. + * config/rs6000/rs6000.c (rs6000_emit_move, TImode): Explicitly + generate PARALLEL with clobber for TARGET_POWER. + +2003-01-16 Kaveh R. Ghazi + + * ra-colorize.c (colorize_one_web): Initialize variable. + * regmove.c (fixup_match_1): Likewise. + * reload1.c (reload_as_needed): Likewise. + * sdbout.c (SET_KNOWN_TYPE_TAG): Add cast. + +2003-01-16 Zdenek Dvorak + + * cfgloop.c (flow_loops_find): Fix handling of abnormal edges. + +2003-01-16 Kaveh R. Ghazi + + * dbxout.c (lastfile, cwd): Fix `unused' warning. + * dwarf2out.c (fde_table_in_use, current_funcdef_fde, + dw_cfi_oprnd1_desc, dw_cfi_oprnd2_desc, next_die_offset, + is_main_source, file_table, decl_die_table_in_use, + abbrev_die_table_in_use, line_info_table_in_use, + separate_line_info_table_in_use, pubname_table_in_use, + arange_table_in_use, ranges_table_in_use, + current_function_has_inlines): Likewise. + * flow.c (life_analysis): Likewise. + * genemit.c (gen_insn): Likewise. + * protoize.c (cplus_suffix): Likewise. + + * arm.c (ROUND_UP_WORD): Renamed from ROUND_UP. + * arm.h (ROUND_UP_WORD): Likewise. + + * arm.h (CONDITIONAL_REGISTER_USAGE): Avoid signed/unsigned + warning. + * emit-rtl.c (gen_rtx_REG, set_mem_attributes_minus_bitpos, + init_emit_once): Likewise. + * flow.c (mark_regs_live_at_end, calculate_global_regs_live): + Likewise. + * function.c (assign_stack_temp_for_type): Likewise. + * loop.c (loop_invariant_p): Likewise. + * recog.c (push_operand): Likewise. + * regclass.c (init_reg_sets_1): Likewise. + * reload.c (update_auto_inc_notes): Likewise. + * reload1.c (reload_as_needed, emit_input_reload_insns): Likewise. + * stmt.c (expand_asm_operands): Likewise. + * stor-layout.c (start_record_layout): Likewise. + +2003-01-16 Herman A.J. ten Brugge + + * config/c4x/c4x.md (epilogue): Correct last patch. + +2003-01-15 Richard Henderson + + * config/alpha/alpha.c (find_lo_sum_using_gp): Rename from find_lo_sum; + also check that GP is being used. + (alpha_find_lo_sum_using_gp): New. + (alpha_does_function_need_gp): Use get_attr_usegp. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (attr usegp): New. Annotate patterns + as needed. + +2003-01-15 Roger Sayle + + * gcse.c (one_cprop_pass): Change function arguments to take both + cprop_jumps and bypass_jumps flags instead of just alter_jumps. + (gcse_main): Update calls to one_cprop_pass, disabling bypassing. + (bypass_jumps): New function to perform separate jump bypassing pass. + * rtl.h (bypass_jumps): Add function prototype. + * timevar.def (TV_BYPASS): New timing variable. + * toplev.c (enum dump_file_index): Add new entry DFI_bypass. + (dump_file): New entry for the bypass RTL dump file. + (rest_of_compilation): Insert new jump bypassing optimization + pass after loop. + * doc/passes.texi: Document new pass. + +2003-01-15 John David Anglin + + * som.h (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY, + ASM_WEAKEN_LABEL, GTHREAD_USE_WEAK): Define. + * pa.h (TARGET_SOM_SDEF): Define. + * pa-hpux11.h (TARGET_SOM_SDEF): Define. + +2003-01-16 Stephane Carrez + + * config/m68hc11/m68hc11.c (expand_prologue): Use push/pop to + allocate 4-bytes of locals on 68HC11. + (expand_epilogue): Likewise. + (m68hc11_memory_move_cost): Increase cost of HI/QI soft registers. + +2003-01-15 Stephane Carrez + + * config/m68hc11/m68hc11.h (ASM_SPEC): Handle -m68hcs12; Pass -mshort + and -mshort-double to the assembler to specify the ABI. + (LINK_SPEC): Likewise. + (CPP_SPEC): Pass HCS12 specific define. + (MASK_M68S12): New define. + (TARGET_M68S12): Likewise. + (TARGET_SWITCHES): New options -m68hcs12 and -m68S12. + (TARGET_VERSION): Update. + * config/m68hc11/m68hc12.h (CPP_SPEC): Pass HCS12 specific define. + (LINK_SPEC): Update. + (ASM_SPEC): Update. + * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Update. + * doc/invoke.texi (M68hc1x Options): Document -m68hcs12. + +2003-01-15 Stephane Carrez + + * config/m68hc11/m68hc11.md ("return"): Use emit_jump_insn to emit + the return code. + +2003-01-15 Josef Zlomek + + * cfganal.c (set_edge_can_fallthru_flag): Clear the EDGE_CAN_FALLTHRU + flag before setting it. + +2003-01-15 Roger Sayle + + * c-semantics.c (genrtl_while_stmt): Improve initial RTL generation + when loop condition is known true, i.e. "while (1) { ... }". + (genrtl_for_stmt): Similarly for "for" statements. + +2003-01-15 Roger Sayle + + * real.c (real_sqrt): Return a bool result indicating whether + a floating point exception or trap should be raised. + * real.h (real_sqrt): Update function prototype. + * builtins.c (fold_builtin): Only fold non-trapping square + roots unless we're ignoring errno and trapping math. + +2003-01-15 John David Anglin + + * expr.h (emit_conditional_add): Add PARAMS to declaration. + * gengtype-lex.l (malloc, realloc): Move defines after include of + system.h. Remove duplicate include of system.h. + +2003-01-15 Roger Sayle + + PR middle-end/9009 + * optabs.c (expand_unop): When manipulating the FP sign bit + using integer operations, account for targets with different + integer and FP word orders. + (expand_abs): Likewise. + +2003-01-15 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_gen_section_name): Do not include + file extension in section name. + +2003-01-15 Richard Earnshaw + + * flow.c (find_auto_inc): Also try to generate a PRE_MODIFY with + constant offset. + +2003-01-15 Richard Earnshaw + + * arm.h (HAVE_PRE_MODIFY_DISP, HAVE_PRE_MODIFY_REG): Define. + (HAVE_POST_MODIFY_DISP, HAVE_POST_MODIFY_REG): Define. + (ARM_GO_IF_LEGITIMATE_ADDRESS): Handle pre/post-modify addresses. + (ARM_PRINT_OPERAND_ADDRESS): Likewise. + +2003-01-15 Jan Hubicka + + PR f/9258 + * global.c (struct allocno): Add no_stack_reg. + (global_conflicts): Set no_stack_reg. + (find_reg): Use it. + + * convert.c (convert_to_real): Fold - and abs only when profitable. + * fold-const.c (fold): Fold truncates in - and abs. + +2003-01-15 Josef Zlomek + + Segher Boessenkool + + * predict.c (real_inv_br_prob_base): New variable. + (propagate_freq): Use multiply by reciprocal instead of + division. Don't divide by 1.0 at all. + (estimate_bb_frequencies): Similar. + +2003-01-15 Alexandre Oliva + + * configure.in (libgcc_visibility): Force disabled on IRIX 6 too. + * configure: Rebuilt. + +2003-01-15 Hartmut Penner + + * config/s390/s390.c (s390_safe_attr_type): New function. + (s390_use_dfa_pipeline_interface): New function, return true for z900. + (s390_issue_rate): New function. + (s390_agen_dep_p): New function. + (addr_generation_dependency_p): Use 's390_safe_attr_type'. + (s390_adjust_cost): Return 'cost' if new DFA is used. + (s390_adjust_priority): Delete function. + * config/s390/s390-protos.h: (s390_agen_dep_p): New prototype. + * config/s390/s390.md (atype attribute): Attribute 'atype' default + determined by 'op_type'. + (type attribute): Added more type attributes. + * config/s390/2064.md: New DFA description for z900 pipeline. + +2003-01-15 Alexandre Oliva + + * config/i386/i386.c (ix86_expand_vector_move): Validize constant + forced to memory. Fixes PR bootstrap/9036. + + * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Define so as + to set $gp before the call. + +2003-01-14 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_mov): Use correct mode + for force_const_mem. + +2003-01-14 Kaveh R. Ghazi + + * genattr.c (main): Rearrange output to avoid prototype warning. + * genautomata.c (transform_3): Fix ambiguous-else warning. + * local-alloc.c (requires_inout): Add parentheses around + assignment used as truth-value. + * timevar.c: Move system includes above local includes. Include + toplev.h + * Makefile.in (timevar.o): Depend on toplev.h. + +2003-01-14 Denis Chertykov + + * config/ip2k/ip2k.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. + (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. + + * config/ip2k/ip2k.c (ip2k_attribute_table): New table of + attributes. + (TARGET_ATTRIBUTE_TABLE): New macro. + (valid_machine_type_attribute): Remove. + (valid_machine_decl_attribute): Remove. + (ip2k_handle_progmem_attribute): New function. + (ip2k_handle_fndecl_attribute): New function. + +2003-01-10 Andrew Haley + + * config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Rename + registers to be in correct order. Add rip. + +2003-01-14 Kazu Hirata + + * config/h8300/h8300.md (*andsi3_lshiftrt_9_sb): New. + (*iorsi3_and_lshiftrt_9_sb): Likewise. + +2003-01-14 Jan Hubicka + + * convert.c (strip_float_extensions): Look for narrowest type handling + FP constants. + + * fold-const.c (fold): Fold (double)float1 CMP (double)float2 into + float1 CMP float2. + * convert.c (strip_float_extensions): Make global. + * tree.h (strip_float_extensions): Declare. + +2003-01-14 Gabriel Dos Reis + + * timevar.def: define TV_NAME_LOOKUP. + * timevar.c (timevar_pop): Be verbose when aborting. + +2003-01-13 Andreas Schwab + + * Makefile.in ($(parsedir)/gengtype-lex.c): Don't change to + $(parsedir), just move the temporary file at the end. + ($(parsedir)/gengtype-yacc.c): Likewise. + +2003-01-13 Alexandre Oliva + + * aclocal.m4 (gcc_AC_PROG_GNAT): Don't try to prepend + ${ac_tool_prefix} to ADAC or CC. Protect them from word + splitting. + * configure: Rebuilt. + +2003-01-13 Kaveh R. Ghazi + + * config/sparc/gmon-sol2.c (moncontrol, monstartup, _mcleanup, + internal_mcount): Don't use PARAMS. + (monstartup, _mcleanup, internal_mcount, moncontrol): Convert to + ISO C style. + (internal_mcount): Use __attribute__, not ATTRIBUTE_UNUSED. + +2003-01-13 Andreas Schwab + + * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Output type + directive. + +2003-01-13 Kazu Hirata + + * config/h8300/h8300.md (*andsi3_lshift_n_sb): New. + (*iorsi3_and_lshiftrt_n_sb): Likewise. + +2003-01-12 Mark Mitchell + + PR c++/9264 + * c-lex.c (c_lex): Set the token value to error_mark_node for + invalid numeric constants. + +2003-01-12 Kaveh R. Ghazi + + * c-pch.c (asm_file_startpos): Change to `long'. + (pch_init): Use ftell, not ftello. + (c_common_write_pch): Use ftell/fseek, not ftello/fseeko. + Use `long' instead of `off_t'. + (c_common_read_pch): Likewise. + * ggc-common.c (gt_pch_save): Use long/ftell instead of + off_t/ftello. + +2003-01-12 Alan Modra + + * expr.c (expand_expr ): Correct recursive call args. + +2003-01-11 Richard Earnshaw (rearnsha@arm.com) + + * arm-protos.h (struct cpp_reader): Add declaration. + +2003-01-11 Jan Hubicka + + PR target/9068 + * i386.c (output_fp_compare): Fix typo. + +2003-01-10 David Edelsohn + + * config/rs6000/rs6000.c (common_mode_defined): Mark for PCH. + +2003-01-10 Geoffrey Keating + + * Makefile.in (parsedir): New variable. + (docobjdir): New variable. + (c-parse.o, c-parse.c, c-parse.y, gengtype-lex.o, gengtype-yacc.o, + gengtype-lex.c, gengtype-yacc.c): Use parsedir. + (info, cpp.info, gcc.info, gccint.info, gccinstall.info, + cppinternals.info, generated-manpages, gcov.1, cpp.1, gcc.1, gfdl.7, + gpl.7, fsf-funding.7, maintainer-clean, install-info, install-man): + Use docobjdir. + * objc/Make-lang.in (objc/objc-parse.c, objc/objc-parse.y, + objc.maintainer-clean): Use parsedir. + + * varasm.c (struct constant_descriptor_rtx): Remove unused + `label' field. + + * toplev.c (documented_lang_options): Document -Winvalid-pch. + +2003-01-10 Richard Henderson + + * config/alpha/alpha.h (NO_PROFILE_COUNTERS): Set. + (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Kill. + +2003-01-10 Richard Henderson + + * combine.c (make_compound_operation): Use SCALAR_INT_MODE_P, + not INTEGRAL_MODE_P when widening extensions. + +2003-01-10 Richard Henderson + + * config/alpha/alpha.c (decl_has_samegp): True for !TREE_PUBLIC. + +2003-01-10 Geoffrey Keating + + * ggc-page.c (ggc_collect): Avoid overflow computing + min_expand. + + * Makefile.in (RANLIB_FOR_TARGET): Use RANLIB when native. + (RANLIB_TEST_FOR_TARGET): Delete. Don't pass down to sub-makes. + Remove calls. + * mklibgcc.in: Remove uses of RANLIB_TEST_FOR_TARGET. + +2003-01-10 Jan Hubicka + + * ifcvt.c (noce_try_addcc): Do not call emit_conditional_add + with weird operands. + +2003-01-10 Dale Johannesen + + * calls.c (load_register_parameters): Add is_sibcall, sibcall_failure + parameters. Call check_sibcall_argument_overlap if indicated. + (check_sibcall_argument_overlap): Add mark_stored_args_map + parameter. Don't mark parameter area as clobbered if not set. + (expand_call): Adjust calls to above. + +2003-01-10 Kelley Cook + + * configure.in (linker read-only and read-write section mixing): + Squelch some assembler warnings. + * configure: Likewise. + +2003-01-10 Hartmut Penner + + * doc/invoke.texi: Document -mtune, delete -mcpu + option for S/390 and zSeries. + * config/s390/s390.c (s390_tune_string) New variable. + (s390_cpu_string) Delete variable. + (override_options): Use s390_tune_string instead of + s390_cpu_string. + * config/s390/s390.h: (TARGET_OPTIONS) '-mtune' instead of '-mcpu'. + +2003-01-10 Kazu Hirata + + * config/h8300/h8300.md (*iorsi3_ashift_31): New. + +2003-01-10 Josef Zlomek + + * jump.c (next_nonnote_insn_in_loop): New function. + (copy_loop_headers): Use next_nonnote_insn_in_loop instead of + next_nonnote_insn. + (duplicate_loop_exit_test). Likewise. + +2003-01-09 Geoffrey Keating + + Merge from pch-branch: + + 2003-01-06 Geoffrey Keating + + * ggc-page.c (ggc_pch_read): Update the statistics after a PCH + load. + + 2002-12-24 Geoffrey Keating + + * cpplib.c (count_registered_pragmas): New function. + (save_registered_pragmas): New function. + (_cpp_save_pragma_names): New function. + (restore_registered_pragmas): New function. + (_cpp_restore_pragma_names): New function. + * cpphash.h (_cpp_save_pragma_names): Prototype. + (_cpp_restore_pragma_names): Likewise. + * cpppch.c (struct save_macro_item): Split from save_macro_data. + (struct save_macro_data): New field 'saved_pragmas'. + (save_macros): Update for changes to struct save_macro_data. + (cpp_prepare_state): Call _cpp_save_pragma_names, update + for changes to struct save_macro_data. + (cpp_read_state): Call _cpp_restore_pragma_names, update + for changes to struct save_macro_data. + + * cpppch.c (cpp_read_state): Restore the hashtable references + in the cpp_reader. + + * tree.h (built_in_decls): Mark for PCH. + + * dbxout.c (lastfile): Don't mark for PCH. + + * ggc.h: Document PCH calls into memory managers. + + 2002-12-18 Geoffrey Keating + + * doc/invoke.texi (Precompiled Headers): Document the + directory form of PCH. + * cppfiles.c (validate_pch): New function. + (open_file_pch): Search suitably-named directories for PCH files. + + 2002-12-14 Geoffrey Keating + + * doc/gty.texi (GTY Options): Document chain_next, chain_prev, + reorder options. + (Type Information): Mention that the information is also + used to implement PCH. + * doc/passes.texi (Passes): Improve documentation of + language-specific files. + + 2002-12-11 Geoffrey Keating + + * gengtype.c (struct write_types_data): Add reorder_note_routine field. + (struct walk_type_data): Add reorder_fn field. + (walk_type): Process 'reorder' option. + (write_types_process_field): Reorder parameters to gt_pch_note_object, + call reorder_note_routine. + (write_func_for_structure): Reorder parameters to gt_pch_note_object. + (ggc_wtd): Update for change to struct write_types_data. + (pch_wtd): Likewise. + * ggc.h (gt_pch_note_object): Reorder parameters. + (gt_handle_reorder): New definition. + (gt_pch_note_reorder): New prototype. + * ggc-common.c (struct ptr_data): Add reorder_fn. + (gt_pch_note_object): Reorder parameters. + (gt_pch_note_reorder): New. + (gt_pch_save): Call reorder_fn. + * stringpool.c (gt_pch_n_S): Update for change to gt_pch_note_object. + + * dbxout.c (cwd): Don't mark for PCH. + + 2002-12-09 Geoffrey Keating + + * gengtype.c (finish_root_table): Fix some warnings. + (write_root): Handle TYPE_STRING. + * ggc.h (gt_ggc_m_S): Add prototype. + * stringpool.c (gt_ggc_m_S): New function. + + 2002-11-30 Geoffrey Keating + + * dwarf2out.c (dw2_string_counter): New. + (AT_string_form): Use it. + (same_dw_val_p): Update for removal of hashtable.h hash tables. + + 2002-11-22 Geoffrey Keating + + * dbxout.c: Include gt-dbxout.h. + (lastfile): Mark for PCH/GGC. + (cwd): Likewise. + (struct typeinfo): Likewise. + (typevec): Likewise. + (typevec_len): Likewise. + (next_type_number): Likewise. + (struct dbx_file): Likewise. + (current_file): Likewise. + (next_file_number): Likewise. + (dbxout_init): Allocate typevec, struct dbx_file with GGC. + (dbxout_start_source_file): Allocate struct dbx_file with GGC. + (dbxout_end_source_file): Don't free struct dbx_file. + (dbxout_type): Use GGC to allocate typevec. + * Makefile.in (dbxout.o): Depend on gt-dbxout.h, $(GGC_H). + (GTFILES): Add dbxout.c. + (gt-dbxout.h): New rule. + + * Makefile.in (c-pch.o): Add debug.h as dependency. + * c-pch.c: Include debug.h. + (pch_init): Call start_source_file to keep nesting right. + (c_common_read_pch): Add orig_name parameter. Call + start_source_file debug hook. Call end_source_file debug hook. + * c-common.h (c_common_read_pch): Update prototype. + * cpplib.h (struct cpp_callbacks): Add fourth field to read_pch + callback. + * cppfiles.c (struct include_file): Add new field `header_name'. + (find_or_create_entry): Default it to `name'. + (open_file_pch): Set it to the original header file searched for. + (stack_include_file): Don't stack an empty buffer, just handle + PCH files immediately. Pass header_name field to read_pch callback. + + 2002-11-19 Geoffrey Keating + + * function.c (funcdef_no): Mark to be saved in a PCH. + + 2002-11-15 Geoffrey Keating + + * ggc-page.c (ggc_pch_read): Remove unused 'bmap_size'. + + * cpppch.c (cpp_read_state): Correct size reallocated for 'defn'. + + 2002-11-14 Geoffrey Keating + + * optabs.h (code_to_optab): Add GTY marker. + + 2002-11-13 Geoffrey Keating + + * Makefile.in (GTFILES): Add cpplib.h. + * c-common.h (struct c_common_identifier): Don't skip 'node' field. + * c-decl.c (build_compound_literal): Don't use var_labelno. + * cpplib.h (struct cpp_hashnode): Use gengtype to mark. + * dwarf2asm.c (dw2_force_const_mem): Don't use const_labelno. + * varasm.c (const_labelno): Use gengtype to mark. + (var_labelno): Likewise. + (in_section): Likewise. + (in_named_name): Likewise. + (struct in_named_entry): Likewise. + (in_named_htab): Likewise. + (set_named_section_flags): Use GGC to allocate struct in_named_entry. + (init_varasm_once): Use GGC to allocate in_named_htab. + * config/darwin.c (current_pic_label_num): Mark for PCH. + + 2002-11-11 Geoffrey Keating + + * ggc-simple.c (init_ggc_pch): New stub procedure. + (ggc_pch_count_object): Likewise. + (ggc_pch_total_size): Likewise. + (ggc_pch_this_base): Likewise. + (ggc_pch_alloc_object): Likewise. + (ggc_pch_prepare_write): Likewise. + (ggc_pch_write_object): Likewise + (ggc_pch_finish): Likewise. + (ggc_pch_read): Likewise. + + 2002-11-08 Geoffrey Keating + + * c-pch.c (c_common_write_pch): Write the macro definitions after + the GCed data. + (c_common_read_pch): Call cpp_prepare_state. Restore the macro + definitions after the GCed data. + * cpplib.c (save_macros): New. + (reset_ht): New. + (cpp_write_pch_deps): Split out of cpp_write_pch. + (cpp_write_pch_state): Split out of cpp_write_pch. + (cpp_write_pch): Delete. + (struct save_macro_data): Delete. + (cpp_prepare_state): New. + (cpp_read_state): Erase and restore initial macro definitions. + * cpplib.h (struct save_macro_data): Forward-declare. + (cpp_write_pch_deps): Prototype. + (cpp_write_pch_state): Prototype. + (cpp_write_pch): Delete prototype. + (cpp_prepare_state): Prototype. + (cpp_read_state): Add fourth argument. + + 2002-11-04 Geoffrey Keating + + * gengtype.c (adjust_field_rtx_def): Don't use skip on valid fields. + (write_array): Remove warning. + + * gengtype.c (contains_scalar_p): New. + (finish_root_table): Add the table to all languages, even if it's + empty. + (write_roots): Output gt_pch_scalar_rtab. + * ggc-common.c (gt_pch_save): Write out scalars. + (gt_pch_restore): Read scalars back. + + * ggc-page.c (OBJECTS_IN_PAGE): New macro. + (struct page_entry): Delete pch_page field. + (ggc_recalculate_in_use_p): Use OBJECTS_IN_PAGE. + (clear_marks): Likewise. + (sweep_pages): Likewise. + (poison_pages): Likewise. + (ggc_print_statistics): Likewise. + (ggc_pch_read): Don't free objects read from a PCH. + Properly set up in_use_p and page_tails. + + 2002-10-25 Geoffrey Keating + + * gengtype.c (struct write_types_data): New. + (struct walk_type_data): Make `cookie' const; add extra + prev_val item; add `orig_s' field. + (walk_type): Update prev_val[3]. + (write_types_process_field): New. + (write_func_for_structure): Take write_types_data structure. + (write_types): New. + (ggc_wtd): New. + (pch_wtd): New. + (write_types_local_process_field): New. + (gc_mark_process_field): Delete. + (write_local_func_for_structure): New. + (gc_mark_func_name): Delete. + (write_gc_types): Delete. + (write_local): New. + (finish_root_table): Don't include 'ggc_' in PFX. + (write_root): Rename from write_root. Fill pchw field of structures. + (write_array): New. + (write_roots): Rename from write_gc_roots. Split out to write_array. + Update to changes to other routines. Write gt_pch_cache_rtab table. + (main): Write PCH walking routines. + * ggc-common.c: Include toplev.h, sys/mman.h. + (ggc_mark_roots): For cache hashtables, also mark the hash table + and the array of entries. + (saving_htab): New. + (struct ptr_data): New. + (POINTER_HASH): New. + (gt_pch_note_object): New. + (saving_htab_hash): New. + (saving_htab_eq): New. + (struct traversal_state): New. + (call_count): New. + (call_alloc): New. + (compare_ptr_data): New. + (relocate_ptrs): New. + (write_pch_globals): New. + (struct mmap_info): New. + (gt_pch_save): New. + (gt_pch_restore): New. + * ggc-page.c (ROUND_UP_VALUE): New. + (ROUND_UP): New. + (struct page_entry): Add field `pch_page'. + (init_ggc): Use ROUND_UP. + (struct ggc_pch_data): Declare. + (init_ggc_pch): New. + (ggc_pch_count_object): New. + (ggc_pch_total_size): New. + (ggc_pch_this_base): New. + (ggc_pch_alloc_object): New. + (ggc_pch_prepare_write): New. + (ggc_pch_write_object): New. + (ggc_pch_finish): New. + (ggc_pch_read): New. + * ggc.h (gt_pointer_operator): New. + (gt_note_pointers): New. + (gt_pch_note_object): New prototype. + (gt_pointer_walker): New. + (struct ggc_root_tab): Use gt_pointer_walker, add `pchw' field. + (LAST_GGC_ROOT_TAB): Update. + (gt_pch_cache_rtab): Declare. + (gt_pch_scalar_rtab): Declare. + (struct ggc_cache_tab): Use gt_pointer_walker, add `pchw' field. + (LAST_GGC_CACHE_TAB): Update. + (gt_pch_save_stringpool): Declare. + (gt_pch_restore_stringpool): Declare. + (gt_pch_p_S): Declare. + (gt_pch_n_S): Declare. + (struct ggc_pch_data): Forward-declare. + (init_ggc_pch): Declare. + (ggc_pch_count_object): Declare. + (ggc_pch_total_size): Declare. + (ggc_pch_this_base): Declare. + (ggc_pch_alloc_object): Declare. + (ggc_pch_prepare_write): Declare. + (ggc_pch_write_object): Declare. + (ggc_pch_finish): Declare. + (ggc_pch_read): Declare. + (gt_pch_save): Declare. + (gt_pch_restore): Declare. + * fold-const.c (size_int_type_wide): Allocate size_htab using GGC. + * emit-rtl.c (init_emit_once): Allocate const_int_htab, + const_double_htab, mem_attrs_htab using GGC. + * c-pch.c: Include ggc.h. + (pch_init): Allow reading PCH file back. + (c_common_write_pch): Call gt_pch_save. + (c_common_read_pch): Call gt_pch_restore. + * c-parse.in (init_reswords): Delete now-untrue comment. + Allocate ridpointers using GGC. + * c-objc-common.c (c_objc_common_finish_file): Write PCH before + calling expand_deferred_fns. + * c-common.h (ridpointers): Mark for GTY machinery. + * Makefile.in (stringpool.o): Update dependencies. + (c-pch.o): Update dependencies. + (ggc-common.o): Update dependencies. + * stringpool.c: Include gt-stringpool.h. + (gt_pch_p_S): New. + (gt_pch_n_S): New. + (struct string_pool_data): New. + (spd): New. + (gt_pch_save_stringpool): New. + (gt_pch_restore_stringpool): New. + * tree.c (init_ttree): Make type_hash_table allocated using GC. + + 2002-10-04 Geoffrey Keating + + * gengtype.c (adjust_field_rtx_def): Don't pass size_t to printf. + (output_mangled_typename): Don't pass size_t to printf. + + * tree.h (union tree_type_symtab): Add tag to `address' field. + (union tree_decl_u2): Add tag to 'i' field. + * varasm.c (union rtx_const_un): Add tags to all fields. + * gengtype.c (struct walk_type_data): New. + (output_escaped_param): Take struct walk_type_data parameter. + (write_gc_structure_fields): Delete. + (walk_type): New. + (write_gc_marker_routine_for_structure): Delete. + (write_func_for_structure): New. + (gc_mark_process_field): New. + (gc_mark_func_name): New. + (gc_counter): Delete. + (write_gc_types): Use write_func_for_structure. + (write_gc_roots): Use walk_type. + + 2002-10-02 Geoffrey Keating + + * ggc-common.c (ggc_mark_roots): Delete 'x'. + (ggc_splay_dont_free): Fix warning about unused 'x'. + (ggc_print_common_statistics): Remove warnings. + + 2002-10-01 Mike Stump + + * ggc-common.c (ggc_splay_alloc): Actually return the allocated area. + * gengtype.c (write_gc_structure_fields): Handle param[digit]_is. + + 2002-09-01 Geoffrey Keating + Catherine Moore + + * Makefile (c-pch.o): Update dependencies. + (LIBCPP_OBJS): Add cpppch.o. + (cpppch.o): New. + * c-common.c (c_common_init): Don't call pch_init here. + * c-common.h (c_common_read_pch): Update prototype. + * c-lex.c (c_common_parse_file): Call pch_init here. + * c-opts.c (COMMAND_LINE_OPTIONS): Add -Winvalid-pch, -fpch-deps. + (c_common_decode_option): Handle them. + * c-pch.c: Include c-pragma.h. + (save_asm_offset): Delete. + (pch_init): Move contents of save_asm_offset into here, call + cpp_save_state. + (c_common_write_pch): Call cpp_write_pch. + (c_common_valid_pch): Warn only when -Winvalid-pch. Call + cpp_valid_state. + (c_common_read_pch): Add NAME parameter. Call cpp_read_state. + * cppfiles.c (stack_include_file): Update for change to + parameters of cb.read_pch. + * cpphash.h (struct cpp_reader): Add `savedstate' field. + * cpplib.h (struct cpp_options): Add `warn_invalid_pch' and + `restore_pch_deps' fields. + (struct cpp_callbacks): Add NAME parameter to `read_pch'. + (cpp_save_state): Prototype. + (cpp_write_pch): Prototype. + (cpp_valid_state): Prototype. + (cpp_read_state): Prototype. + * cpppch.c: New file. + * flags.h (version_flag): Remove prototype. + * mkdeps.c (deps_save): New. + (deps_restore): New. + * mkdeps.h (deps_save): Prototype. + (deps_restore): Prototype. + * toplev.c (late_init_hook): Delete. + (version_flag): Make static again. + (compile_file): Don't call late_init_hook. + * toplev.h (late_init_hook): Delete. + * doc/cppopts.texi: Document -fpch-deps. + * doc/invoke.texi (Warning Options): Document -Winvalid-pch. + + 2002-08-27 Geoffrey Keating + + * c-pch.c (c_common_write_pch): Rename from c_write_pch, change + callers. + (c_common_valid_pch): Rename from c_valid_pch, change callers. + (c_common_read_pch): Rename from c_read_pch, change callers. + + * c-opts.c (COMMAND_LINE_OPTIONS): Allow -output-pch= to have + a space between it and its argument. + + 2002-08-24 Geoffrey Keating + + * c-pch.c: New file. + * toplev.h (late_init_hook): Declare. + * toplev.c (late_init_hook): Define. + (version_flag): Make globally visible. + (compile_file): Call late_init_hook. + (init_asm_output): Make output file seekable. + * gcc.c (default_compilers): Update c-header rule. + * flags.h (version_flag): Declare. + * cpplib.h (struct cpp_callbacks): Add 'valid_pch' and 'read_pch' + fields. + * cppfiles.c (struct include_file): Add 'pch' field. + (INCLUDE_PCH_P): New. + (open_file_pch): New. + (stack_include_file): Handle PCH files specially. + (find_include_file): Call open_file_pch instead of open_file. + (_cpp_read_file): Explain why open_file is used instead of + open_file_pch. + * c-opts.c (c_common_decode_option): Correct OPT__output_pch case. + * c-objc-common.c (c_objc_common_finish_file): Call c_write_pch. + * c-lex.c (init_c_lex): Set valid_pch and read_pch fields + in cpplib callbacks. + * c-common.c (pch_file): Correct comment. + (allow_pch): Define. + (c_common_init): Call pch_init. + * c-common.h (allow_pch): Declare. + (pch_init): Declare. + (c_valid_pch): Declare. + (c_read_pch): Declare. + (c_write_pch): Declare. + * Makefile.in (c-pch.o): New. + (C_AND_OBJC_OBJS): Add c-pch.o. + * doc/invoke.texi (Precompiled Headers): Add index entries, + complete truncated paragraph. + + 2002-08-17 Geoffrey Keating + + * c-common.c: (pch_file): Define. + * c-common.h (pch_file): Declare. + * c-opts.c (COMMAND_LINE_OPTIONS): Add --output-pch=. + (missing_arg): Require --output-pch= to have an argument. + (c_common_decode_option): Handle --output-pch=. + * gcc.c: Document new %V. + (default_compilers): Handle compiling C header files. + (do_spec_1): Implement %V. + (main): Handle "gcc foo.h" without trying to run linker. + * doc/invoke.texi (Invoking GCC): Add new menu item for PCH. + (Overall Options): Document what the driver does with header files, + document new -x option possibilities. + (Invoking G++): More documentation for PCH. + (Precompiled Headers): New. + + 2002-08-09 Geoffrey Keating + + * ggc.h: Don't include varray.h. Rearrange functions to be more + organized. + (ggc_add_root): Delete. + (ggc_mark_rtx): Delete. + (ggc_mark_tree): Delete. + (struct ggc_statistics): Remove contents. + * ggc-common.c: Remove unneeded includes. + (struct ggc_root): Delete. + (roots): Delete. + (ggc_add_root): Delete. + (ggc_mark_roots): Don't mark `roots'. Call ggc_mark_stringpool. + (ggc_print_common_statistics): Remove most of the contents. + * Makefile.in (GGC_H): No longer uses varray.h. + (ggc-common.o): Update dependencies. + (c-parse.o): Add varray.h to dependencies. + (c-common.o): Add varray.h. + * stringpool.c (mark_ident): Use mangled name for tree marker routine. + (mark_ident_hash): Rename to ggc_mark_stringpool. + (init_stringpool): Don't use ggc_add_root. + * c-parse.in: Include varray.h. + * c-common.c: Include varray.h. + * objc/Make-lang.in (objc-act.o): Add varray.h. + * objc/objc-act.c: Include varray.h. + + 2002-07-25 Geoffrey Keating + + * dwarf2out.c (dw_cfi_oprnd2_desc): Fix ISO-only function definition. + (dw_cfi_oprnd1_desc): Likewise. + + 2002-07-17 Geoffrey Keating + + * config/alpha/alpha.c (struct alpha_links): Use gengtype to mark; + move out of ifdef. + (alpha_links): Use gengtype to mark; move out of ifdef. + (mark_alpha_links_node): Delete. + (mark_alpha_links): Delete. + (alpha_need_linkage): Use GGC to allocate splay tree, struct + alpha_links, strings. Don't use ggc_add_root. + * ggc-common.c (ggc_splay_alloc): New. + (ggc_splay_dont_free): New. + * ggc.h (ggc_mark_rtx): Update for changed name mangling. + (ggc_mark_tree): Likewise. + (splay_tree_new_ggc): New. + (ggc_splay_alloc): Declare. + (ggc_splay_dont_free): Declare. + * dwarf2asm.c: Include gt-dwarf2asm.h. + (mark_indirect_pool_entry): Delete. + (mark_indirect_pool): Delete. + (indirect_pool): Use gengtype to mark. + (dw2_force_const_mem): Don't use ggc_add_root. + * Makefile.in (dwarf2asm.o): Depend on gt-dwarf2asm.h. + (GTFILES): Add SPLAY_TREE_H, dwarf2asm.c. + (gt-dwarf2asm.h): Depend on s-gtype. + + 2002-07-08 Geoffrey Keating + + * tree.h (union tree_type_symtab): Mark `die' field. + * Makefile.in (dwarf2out.o): Update dependencies. + * dwarf2out.c: Use GGC to allocate all structures. Convert to htab_t + hash tables. + (dw_cfi_oprnd1_desc): New function. + (dw_cfi_oprnd2_desc): New function. + (indirect_string_alloc): Delete. + (debug_str_do_hash): New function. + (debug_str_eq): New function. + (mark_limbo_die_list): Delete. + (dwarf2out_init): Don't call ggc_add_root. + +2003-01-09 Vladimir Makarov + + The following changes are merged from itanium-sched-branch: + + 2003-01-08 David Edelsohn + + * doc/md.texi: Clarify assignment of units to automata description. + + 2003-01-08 Vladimir Makarov + + * genautomata.c (unit_decl): Remove members + `the_same_automaton_unit' and + `the_same_automaton_message_reported_p'. + (process_unit_to_form_the_same_automaton_unit_lists, + form_the_same_automaton_unit_lists_from_regexp, + form_the_same_automaton_unit_lists, the_same_automaton_lists): + Remove them. + (annotation_message_reported_p): New global variable. + (check_unit_distribution_in_reserv, + check_regexp_units_distribution): New functions. + (check_unit_distributions_to_automata): Rewrite it. + + 2003-01-04 Vladimir Makarov + + * genautomata.c (form_the_same_automaton_unit_lists_from_regexp): + Use continue instead of break if cycle is too big. + + 2002-12-20 Vladimir Makarov + + * genautomata.c (check_unit_distributions_to_automata): Output at + most one message for a unit. + (process_unit_to_form_the_same_automaton_unit_lists): Check + automaton of units instead of units themself. + + * doc/md.texi: Describe the constraint about assigning unit to + automata. + + 2002-12-20 Jan Hubicka + Vladimir Makarov + + * genautomata.c (unit_decl): Add new members `min_occ_cycle_num' + and `in_set_p'. + (gen_cpu_unit): Initialize the new members. + (process_regexp_cycles): Calculate minimal finish cycle too. Set + up `min_occ_cycle_num'. + (evaluate_max_reserv_cycles): Change the function call. + (CLEAR_BIT): New macro. + (states_union, state_shift): Use the mask. + (initiate_excl_sets, form_reserv_sets_list): Set up `in_set_p'. + (form_reservs_matter): New function. + (make_automaton): Call the function and use the mask. + (estimate_one_automaton_bound): Take `min_occ_cycle_num' into + account. + + 2002-12-17 Vladimir Makarov + + * config/ia64/itanium2.md (lfetch): Change the insn reservation. + + 2002-12-17 Vladimir Makarov + + * config/ia64/ia64.c (bundling): Try to insert 2 nops for M insn + for Itanium. + + 2002-12-17 Vladimir Makarov + + * config/ia64/ia64.c (ia64_override_options): Make itanium2 as + default cpu. + + 2002-12-17 Vladimir Makarov + 2002-10-31 Dale Johannesen + + * haifa-sched.c (find_set_reg_weight): New function. + (find_insn_reg_weight): Use the new function. + (schedule_block): Do sorting ready queue always + after insn issue. + + 2002-11-27 Vladimir Makarov + + * config/ia64/ia64.c (bundling): Use MFI template instead of MLX. + + 2002-11-19 Vladimir Makarov + + * haifa-sched.c (choice_entry): New structure. + (choice_stack, cycle_issued_insns): New variables. + (max_issue): Rewrite it. + (choose_ready): Set up ready_try for unknown insns too. + (schedule_block): Allocate and free choice_stack. Set up + and modify cycle_issued_insns. + + * config/ia64/ia64.c (issue_nops_and_insn): Combine insn issue + with and without filling the bundle. + (bundling): Combine calls of issue_nops_and_insn. + + 2002-10-17 Vladimir Makarov + + * config/ia64/itanium1.md: New file. + + * config/ia64/itanium2.md: New file. + + * config/ia64/ia64.md: Move DFA descriptions into the new files. + Remove the old pipeline description. + + * config/ia64/ia64.c (ia64_override_options): Add aliases of + itanium processor names. + + 2002-10-16 Vladimir Makarov + + * config/ia64/ia64.c (bundling): Print states for Itanium2 too. + (ia64_reorg): Set up queried unit codes for Itanium2 too. + + * config/ia64/ia64.md: Add descriptions for Itanium2. + + 2002-10-08 Vladimir Makarov + + * config/ia64/ia64.h (processor_type): New enumeration. + (ia64_tune, ia64_tune_string): New external declarations. + (TARGET_OPTIONS): Add option `tune='. + + * config/ia64/ia64.c (ia64_tune, ia64_tune_string): New global + variables. + (ia64_override_options): Set up `ia64_tune'. + (ia64_sched_reorder2): Set up `clocks' only for Itanium. + (ia64_dfa_new_cycle): Set up `add_cycles' only for Itanium. + (bundling): Add nops for MM-insns only for Itanium. + (ia64_reorg): Allocate and free `clocks' and `add_cycles' only for + Itanium. + + * config/ia64/ia64.md (cpu): New attribute. + (DFA description): Enable it only for Itanium. + + 2002-10-08 Vladimir Makarov + Richard Henderson + + * config/ia64/ia64.h (MASK_TUNE_STOP_BITS): Rename it to + MASK_EARLY_STOP_BITS. + (TARGET_TUNE_STOP_BITS): Rename it to TARGET_EARLY_STOP_BITS. + (TARGET_SWITCHES): Rename option `tune-stop-bits' to + `early-stop-bits'. + + * config/ia64/ia64.c (ia64_dfa_new_cycle, + final_emit_insn_group_barriers): Use TARGET_EARLY_STOP_BITS + instead of TARGET_TUNE_STOP_BITS. + + * doc/invoke.texi: Rename option `-mtune-stop-bits' to + `-mearly-stop-bits'. + + * config/ia64/ia64.c (automata_option "v"): Comment it. + + 2002-10-07 Vladimir Makarov + + * config/ia64/ia64.h (MASK_TUNE_STOP_BITS, TARGET_TUNE_STOP_BITS): + New macros. + (TARGET_SWITCHES): Add entries for the new option. + + * config/ia64/ia64.c (dfa_stop_insn, last_scheduled_insn, rtx + dfa_pre_cycle_insn, ia64_nop): Don't make them as roots for GC. + (stops_p, stop_before_p, clocks_length, clocks, add_cycles): New + global variables. + (ia64_sched_reorder2): Set up `clocks'. + (ia64_variable_issue): Set up `stops_p' and reset `stop_before_p'. + (ia64_dfa_new_cycle): Set up add_cycle. Permit sorting ready + queue when TARGET_TUNE_STOP_BITS. + (bundling): Insert additional nops for MM-insns. + (final_emit_insn_group_barriers): Add insertion of stop bits + according `stops_p'. + (ia64_reorg): Initiate the new varibales. + + * doc/invoke.texi: Add description of option `-mtune-stop-bits'. + + 2002-10-02 Vladimir Makarov + + * haifa-sched.c (schedule_block): Modify INSN_TICK of depended + insns at the end of block insn scheduling. + + 2002-09-30 Vladimir Makarov + + * sched-deps.c (remove_dependence, group_leader): Remove it. + (add_dependence): Add dependence to group leader to. + (set_sched_group_p): Add dependence to the first insn of the + schedule group too. + (sched_analyze_insn): Make dependence to jump as anti-dependence. + Change true dependence by anti-dependence when + `reg_pending_barrier'. + + * sched-rgn.c (init_ready_list, can_schedule_ready_p, + add_branch_dependences): Ignore schedule groups. + + * sched-ebb.c (init_ready_list): Ditto. + + * (move_insn, set_priorities): Ditto. + + * config/ia64/ia64.c (ia64_sched_init): Check that schedule group + flag is clear after reload. + (adjust_cost): Change cost only for output dependencies. + + * config/ia64/ia64.md: Add more insns into bypass for MM-insns. + + 2002-09-26 Vladimir Makarov + + * Makefile.in (sched-ebb.o): Add `$(TARGET_H)' to the entry. + + * target.h (gcc_target): Add member + `dependencies_evaluation_hook'. + + * target-def.h (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): New + macro. + (TARGET_SCHED): Add initiatialization of the new member. + + * sched-ebb.c: Include `target.h'. + (schedule_ebb): Call `dependencies_evaluation_hook'. + + * sched-rgn.c (schedule_region): Call + `dependencies_evaluation_hook'. + + * config/ia64/ia64.c (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): + New macro. + (ia64_dependencies_evaluation_hook): New function. + + * doc/tm.texi (TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK): + Describe the new hook. + + 2002-09-25 Vladimir Makarov + + * target.h (gcc_target): Add members + `first_cycle_multipass_dfa_lookahead_guard' and `dfa_new_cycle'. + + * target-def.h (TARGET_SCHED_DFA_NEW_CYCLE, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): New + macros. + (TARGET_SCHED): Add initiatialization of the new members. + + * haifa-sched.c (schedule_insn): Update last_clock_var for the 1st + insn scheduling too. + (choose_ready): Use `first_cycle_multipass_dfa_lookahead_guard' to + initialize `ready_try'. + (schedule_block): Use `dfa_new_cycle'. Sort `ready' only unless + `dfa_new_cycle' says not to do it. + + * config/ia64/ia64.md: Add DFA Itanium 1 description for insn + bundling. + + * config/ia64/ia64.h (CPU_UNITS_QUERY): New macro. + + * config/ia64/ia64.c: Include `hashtab.h'. + (ia64_first_cycle_multipass_dfa_lookahead_guard, + ia64_dfa_new_cycle, final_emit_insn_group_barriers, + ia64_dfa_sched_reorder, get_free_bundle_state, free_bundle_state, + initiate_bundle_states, finish_bundle_states, bundle_state_hash, + bundle_state_eq_p, insert_bundle_state, + initiate_bundle_state_table, finish_bundle_state_table, + try_issue_nops, try_issue_insn, issue_nops_and_insn, get_max_pos, + get_template, get_next_important_insn, bundling): New functions. + (ia64_internal_sched_reorder): Remove it. + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD, + TARGET_SCHED_DFA_NEW_CYCLE): New macros. + (ia64_safe_itanium_requires_unit0): Remove it. + (group_barrier_needed_p): Place group barrier right before a real + insn. + (bundle, ia64_packet, NR_PACKETS, type_names, packets, packets): + Remove them. + (bundle_name): New variable. + (_0mii_, _0mmi_, _0mfi_, _0mmf_, _0bbb_, _0mbb_, _0mib_, _0mmb_, + _0mfb_, _0mlx_, _1mii_, _1mmi_, _1mfi_, _1mmf_, _1bbb_, _1mbb_, + _1mib_, _1mmb_, _1mfb_, _1mlx_, pos_1, pos_2, pos_3, pos_4, pos_5, + pos_6, dfa_stop_insn, last_scheduled_insn, dfa_state_size, + temp_dfa_state, prev_cycle_state): New global variables. + (insn_matches_slot, maybe_rotate, finish_last_head, + rotate_one_bundle, rotate_one_bundles, nop_cycles_until, + cycle_end_fill_slots, packet_matches_p, get_split, find_best_insn, + find_best_packet, itanium_reorder, dump_current_packet, + schedule_stop, gen_nop_type, ia64_emit_nops): Remove them. + (sched_data, sched_ready, sched_types): Remove them. + (ia64_sched_init): Initiate only `last_scheduled_insn' and call + `init_insn_group_barriers'. + (ia64_sched_reorder, ia64_sched_reorder2): Call + ia64_dfa_sched_reorder. + (ia64_variable_issue): Rewrite it. + (bundle_state): New structure. + (index_to_bundle_states, bundle_states_num, + allocated_bundle_states_chain, free_bundle_state_chain): New + global variables. + (ia64_sched_finish): Add stop bits and call `bundling' after the + 2nd insn scheduling. + (ia64_use_dfa_pipeline_interface): Return zero always. + (ia64_first_cycle_multipass_dfa_lookahead): Return 6 for the 2nd + insn scheduling. + (ia64_init_dfa_pre_cycle_insn): Initialize `dfa_state_size', + `temp_dfa_state', `prev_cycle_state', and `dfa_stop_insn'. + (ia64_reorg): Add bundling insns. + + * doc/tm.texi + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD, + TARGET_SCHED_DFA_NEW_CYCLE): Describe the new hooks. + + 2002-09-23 Vladimir Makarov + + * config/ia64/ia64.md: Add Itanium1 DFA description. + (itanium_class): Add `nop' and `pre_cycle'. Add + define_function_unit for `nop'. + (nop): Change attribute `itanium_class'. + (pre_cycle): New define_insn. + + * config/ia64/ia64-protos.h (bundling_p): New external variable. + (ia64_st_address_bypass_p, ia64_ld_address_bypass_p, + ia64_produce_address_p): New function prototypes. + + * config/ia64/ia64.c (bundling_p): New global variable. + (ia64_use_dfa_pipeline_interface, + ia64_first_cycle_multipass_dfa_lookahead, + ia64_init_dfa_pre_cycle_insn, ia64_dfa_pre_cycle_insn): New + functions. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD, + TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN, + TARGET_SCHED_DFA_PRE_CYCLE_INSN): New macros. + (ia64_sched_init, ia64_sched_reorder, ia64_sched_reorder2, + ia64_variable_issue, ia64_sched_finish): Do nothing before reload. + (dfa_pre_cycle_insn): New variable. + + 2002-09-20 Vladimir Makarov + + * rtl.def (FINAL_PRESENCE_SET, FINAL_ABSENCE_SET): New + constructions. + + * genattrtab.h (gen_final_presence_set, gen_final_absence_set): + New function prototypes. + + * genattrtab.c (main): Process the new constructions. + + * genautomata.c (gen_presence_absence_set, + process_presence_absence_names, process_presence_absence_patterns, + add_presence_absence, check_absence_pattern_sets): Add parameter + `final_p'. + (unit_decl): Add new members `final_presence_list' and + `final_absence_list'. + (unit_pattern_rel_decl): Add new member `final_p'. + (gen_final_presence_set, gen_final_absence_set): New functions. + (process_decls): Use member `final_p'. + (temp_reserv): New global variable. + (reserv_sets_are_intersected): Add processing `final_presence_set' + and `final_absence_set'. + (initiate_states): Allocate `temp_reserv'. + (unit_final_presence_set_table, unit_final_absence_set_table): New + gloabal variables. + (initiate_presence_absence_pattern_sets): Initiate them. + (NDFA_to_DFA): Fix typo. + (output_description): Output `final_presence_set' and + `final_absence_set'. + + * doc/md.texi (final_presence_set, final_absence_set): Describe + them. + + 2002-09-20 Vladimir Makarov + + * genautomata.c (transform_3): Process a missing case (nothing on + unit place). + + 2002-09-20 Vladimir Makarov + + * rtl.def (DEFINE_QUERY_CPU_UNIT, AUTOMATA_OPTION): Change + comments about queried units and the minimization. + + * doc/md.texi: Ditto. + + * genautomata.c (create_composed_state): Return nonzero if the new + state has been created. + (first_cycle_unit_presence): New function. + (state_is_differed): Add new parameter. Use the new function. + Take queried units into account. + (partition_equiv_class): Pass additional parameter to + `state_is_differed'. + (merge_states): Process composed states too. + (build_automaton, create_automata, output_min_issue_delay_table, + output_tables, output_statistics): Output more information. + (output_reserved_units_table): Use function + `first_cycle_unit_presence'. + (output_tables): Output table of queried units even if the + minimization is switched on. + (write_automata): Output code for querying units even if the + minimization is switched on. + + 2002-09-19 Vladimir Makarov + + * rtl.def (PRESENCE_SET, ABSENCE_SET): Add comments about extended + syntax of the constructions. + + * doc/md.texi (PRESENCE_SET, ABSENCE_SET): Add description of + extended syntax of the constructions. + + * genautomata.c (unit_rel_decl): Rename it to + `unit_pattern_rel_decl'. + (pattern_set_el, pattern_reserv): New structures. + (pattern_set_el_t, pattern_reserv_t): New types. + (gen_presence_absence_set): New function. + (process_presence_absence): Remove it. + (process_presence_absence_names, + process_presence_absence_patterns): New functions. + (get_presence_absence_set): Remove it. + (initiate_presence_absence_sets): Rename it on + `initiate_presence_absence_pattern_sets'. Use new function + `form_reserv_sets_list'. + (form_reserv_sets_list, check_presence_pattern_sets, + check_absence_pattern_sets, output_pattern_set_el_list): New + functions. + (unit_decl): Change types of members `presence_list' and + `absence_list'. + (unit_rel_decl): Rename member `names_num' to `all_names_num'. + (decl): Change types of members `excl', `presence', and `absence'. + (get_str_vect): Rename `par_flag' to `paren_p'. Add null element + at the end of the vector. + (gen_cpu_unit, gen_query_cpu_unit, gen_bypass, gen_excl_set, + gen_automaton, gen_regexp_repeat, gen_regexp_allof, + gen_regexp_oneof, gen_regexp_sequence): Use boolean values. + (gen_presence_set, gen_absence_set): Use new function + `gen_presence_absence_set'. + (add_presence_absence): Process `pattern_list' instead of + `source_list'. + (process_decls): USe new functions + `process_presence_absence_names' and + `process_presence_absence_patterns'. + (reserv_sets_are_intersected): Use new function + `check_presence_pattern_sets'. + (presence_set, absence_set): Remove them. + (unit_presence_set_table, unit_absence_set_table): New global + variables. + (output_description): Use new function + `output_pattern_set_el_list'. + (generate): Use `initiate_presence_absence_pattern_sets'. + + 2002-09-18 Vladimir Makarov + + * genattr.c (main): Add output of prototype of new interface + function `dfa_clean_insn_cache'. + + * genautomata.c (output_dfa_clean_insn_cache_func): New function. + (DFA_CLEAN_INSN_CACHE_FUNC_NAME): New macro. + (output_dfa_start_func): Use function `dfa_clean_insn_cache' in + the generated code. + (write_automata): Call the new function. + +2003-01-09 Jan Hubicka + + * i386.md (unit, prefix_0f, memory attributes): Hanlde sseicvt + correctly. + +2003-01-09 Paolo Carlini + + * doc/tm.texi (EXTRA_ADDRESS_CONSTRAINT): Fix typo. + +2003-01-09 J"orn Rennecke + + * defaults.h (EXTRA_MEMORY_CONSTRAINT): Add STR argument. + (EXTRA_ADDRESS_CONSTRAINT): Likewise. + (CONSTRAINT_LEN): Provide default definition. + (CONST_OK_FOR_CONSTRAINT_P): Likewise. + (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Likewise. + (EXTRA_CONSTRAINT_STR): Likewise. + (REG_CLASS_FROM_CONSTRAINT): Define. + * genoutput.c (check_constraint_len, constraint_len): New functions. + (validate_insn_alternatives): Check CONSTRAINT_LEN for each + constraint / modifier. + (gen_insn): Call check_constraint_len. + * local-alloc.c (block_alloc): Update to use new macros / pass + second argument to EXTRA_{MEMORY,ADDRESS}_CONSTRAINT. + * ra-build.c (handle_asm_insn): Likewise. + * recog.c (asm_operand_ok, preprocess_constraints): Likewise. + (constrain_operands, peep2_find_free_register): Likewise. + * regclass.c (record_operand_costs, record_reg_classes): Likewise. + * regmove.c (find_matches): Likewise. + * reload.c (push_secondary_reload, find_reloads): Likewise. + (alternative_allows_memconst): Likewise. + * reload1.c (maybe_fix_stack_asms): Likewise. + (reload_cse_simplify_operands): Likewise. + * stmt.c (parse_output_constraint, parse_input_constraint): Likewise. + * doc/tm.texi (CONSTRAINT_LEN, REG_CLASS_FROM_CONSTRAINT): Document. + (CONST_OK_FOR_CONSTRAINT_P): Likewise. + (CONST_DOUBLE_OK_FOR_CONSTRAINT_P, EXTRA_CONSTRAINT_STR): Likewise. + (EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT): Add STR argument. + * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Likewise. + + * sh.h (OVERRIDE_OPTIONS): Allow first scheduling pass for SH5. + +2003-01-09 Kazu Hirata + + * config/h8300/h8300.md (*extzv_1_r_h8300): Correct the insn + length. + (*extzv_1_r_h8300hs): Likewise. + (*extzv_1_r_inv_h8300): Likewise. + (*extzv_1_r_inv_h8300hs): Likewise. + +2003-01-09 Kazu Hirata + + * config/h8300/h8300.h (PREDICATE_CODES): New. + +2003-01-09 Kazu Hirata + + * config/h8300/h8300.md (*addsi3_upper): New. + (*iorsi3_shift): Likewise. + (two splitters): Likewise. + (*addsi3_shift): Likewise. + (two splitters): Likewise. + +2003-01-09 Josef Zlomek + + * Makefile.in (optabs.o): Add dependency on basic-block.h. + * basic-block.h (control_flow_insn_p): Fuction was exported. + * cfgbuild.c (control_flow_insn_p): Fuction was made non-static. + * optabs.c (emit_libcall_block): Emit REG_LIBCALL and REG_RETVAL + notes only when the region is contained in a single basic block. + +2003-01-09 Eric Botcazou + + PR inline-asm/8832 + * tree.h (expand_asm): New prototype. + * stmt.c (expand_asm): Set the MEM_VOLATILE_P flag if instructed + to do so. + * c-semantics (genrtl_asm_stmt): Pass the RID_VOLATILE qualifier + down to expand_asm. + * c-typeck.c (simple_asm_stmt): Set the RID_VOLATILE qualifier. + * rtlanal.c (volatile_insn_p) [ASM_INPUT]: Test the MEM_VOLATILE_P flag. + (volatile_refs_p) [ASM_INPUT]: Likewise. + (side_effects_p) [ASM_INPUT]: Likewise. + +2003-01-09 Jan Hubicka + + * i386.md (*mul*): FIx constraints; remove confused comment; fix + athlon_decode attributes + (imul/k8 optimization peep2s): New. + + * athlon.md (athlon_ssecmp*): Handle ssecomi as well. + * i386.md (type attribute): Add ssecomi. + (unit, memory, prefix attributes): Handle ssecomi. + (cvt?2? patterns): Fix athlon_decode attribute + (comi patterns): Set attribute to ssecomi. + + PR target/8343 + * m68k.md (umulsidi, mulsidi expanders): Use register operand. + +2003-01-09 Richard Sandiford + + * config/mips/mips.h (PREDICATE_CODES): Add ADDRESSOF for predicates + that match register_operands. + * config/mips/mips.c (reg_or_0_operand, true_reg_or_0_operand): Make + register_operand the default case. + +2003-01-09 Eric Botcazou + + PR c/8032 + * c-typeck.c (process_init_element) [RECORD_TYPE]: For + an empty element, do not advance the pointer to unfilled + fields if there are pending initializers. + +2003-01-09 Christian Cornelssen + + * Makefile.in (ORDINARY_FLAGS_TO_PASS): Also pass DESTDIR. + (install-gcc-tooldir, install-cpp, installdirs, + install-common, install-driver, install-info, install-man, + install-headers, install-include-dir, install-headers-tar, + install-headers-cpio, install-headers-cp, install-mkheaders, + install-collect2, uninstall): Prepend $(DESTDIR) to + destination paths in all (un)installation commands. + (install-driver): Rewrite $(LN) commands to support DESTDIR + with "ln" as well as with "ln -s". + (installdirs): Simply use mkinstalldirs. + (install-libgcc, install-multilib): Also pass DESTDIR. + * mklibgcc.in: Prepend $(DESTDIR) to $(libsubdir) in the + installation destination variable ldir. + * config/alpha/t-osf4, config/arm/t-netbsd, + config/ia64/t-hpux, config/mips/t-iris5-6, + config/pa/t-hpux-shlib, config/rs6000/t-aix43, + config/rs6000/t-aix52, config/t-slibgcc-elf-ver, + config/t-slibgcc-sld: Prepend $$(DESTDIR) to $$(slibdir) + in the definition of SHLIB_INSTALL. + * config/arc/t-arc (install-multilib-arc): Prepend $(DESTDIR) to + $(libsubdir) in the installation commands. + +2003-01-08 Kaz Kojima + + * config/sh/sh.h (CASE_VECTOR_MODE): Use SImode for a + non-optimizing compile. + (ASM_OUTPUT_ADDR_VEC_ELT): Use .long for a non-optimizing + compile. + +2003-01-08 Douglas B Rupp + + * config/i386/i386.c (ix86_attribute_table): Add new attributes + ms_struct and gcc_struct. + (ix86_handle_struct_attribute): New function. + (ix86_ms_bitfield_layout_p): Update to take new attributes + into account. + * doc/extend.texi: Document new attributes. + * testsuite/gcc.dg/bf-ms-attrib.c: New test. + +2003-01-08 Danny Smith + + PR optimization/8750 + * config/i386/i386.c (ix86_expand_prologue): Don't allow + scheduling pass to move insns across __alloca call. + +2003-01-08 Dale Johannesen + + * config/rs6000/rs6000.md: Replace *store_multiple_string + with *stmsi[3-8]. + +2003-01-08 Jeff Sturm + + PR target/9210 + * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): + Set SYMBOL_REF_FLAG on local data sym_ref. + +2003-01-08 Dale Johannesen + + * function.c (assign_parms): Don't set pretend_args_size if + REG_PARM_STACK_SPACE. + config/rs6000/rs6000.c (setup_incoming_varargs): Don't set + pretend_args_size. + +2003-01-08 Nathanael Nerode + + * gcc.hlp: Delete. + +2003-01-09 Jan Hubicka + + * i386.c (ix86_expand_int_addcc): Fix thinko. + +2003-01-08 David Edelsohn + + * config/rs6000/rs6000.h (FUNCTION_MODE): Always use SImode. + * config/rs6000/rs6000.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Redefine + as hook_bool_tree_hwi_hwi_tree_true. + (rs6000_emit_allocate_stack): Use TARGET_32BIT. + (rs6000_emit_epilogue): Same. + (rs6000_output_mi_thunk): Re-implement as RTL. + * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Call + xcoffout_declare_function if any debugging enabled. + +2003-01-08 Chris Demetriou + + * config.gcc (mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*): New + targets, to support MIPS32 Release 2 (MIPS32R2) configurations. + * config/mips/mips.h (enum processor_type): Rename + PROCESSOR_R4KC to PROCESSOR_4KC, PROCESSOR_R5KC to + PROCESSOR_5KC, and PROCESSOR_R20KC to PROCESSOR_20KC. + Add PROCESSOR_M4K. + (TARGET_MIPS4KC, TARGET_MIPS5KC): Update for the renaming. + (ISA_MIPS32R2): New define. + (GENERATE_MULT3_SI, ISA_HAS_CONDMOVE, ISA_HAS_8CC) + (ISA_HAS_MADD_MSUB, ISA_HAS_CLZ_CLO) + (ISA_HAS_PREFETCH): Add support for MIPS32R2. + (MIPS_ISA_DEFAULT): Likewise. Also, fix indentation. + (TARGET_CPU_CPP_BUILTINS): Add support for MIPS32R2. Add new + predefine __mips_isa_rev for MIPS32, MIPS32R2, and MIPS64. + (ISA_HAS_ROTR_SI): Add support for MIPS32R2, and avoid if + compiling MIPS16 code. + (ISA_HAS_ROTR_DI): Do not use if compiling MIPS16 code, and fix + comment. + (ISA_HAS_SEB_SEH): New define. + (ASM_SPEC, LINK_SPEC): Pass -mips32r2 to assembler and linker. + * config/mips/mips.c (mips_cpu_info_table): Adjust for enum + processor_type value renaming. Add support for MIPS32R2. + Clean up comments, and move "sb1" entry with other MIPS64 CPU + entries. + (override_options): Reimplement -mipsN option handling so that + it will work correctly for -mips32r2. Avoid branch-likely + instructions on MIPS32R2. + * config/mips/mips.md (mulsi3_mult3): Add support for MIPS32R2. + (extendhisi2): Use extendhisi2_hw if ISA_HAS_SEB_SEH. + (extendqisi2): Use extendqisi2_hw if ISA_HAS_SEB_SEH. + (extendhisi2_hw, extendqisi2_hw): New. + * config/mips/netbsd.h (TARGET_CPU_CPP_BUILTINS): Add support + for MIPS32R2. Add new predefine __mips_isa_rev for MIPS32, + MIPS32R2, and MIPS64. + (LINK_SPEC): Pass -mips32r2 to linker. + * config/mips/t-isa3264: Built -mips32r2 multilibs. + * doc/invoke.texi (MIPS Options): Add -mips32r2, add support + for mips32r2 in the -march description. Alphabetically sort + CPU names in the -march description. Add long-missed -mips32 + and -mips64 to MIPS option summary. + + * config.gcc: Update copyright years to include 2003. + * config/mips/mips.c: Likewise. + * config/mips/mips.h: Likewise. + * config/mips/mips.md: Likewise. + * config/mips/netbsd.h: Likewise. + * doc/invoke.texi: Likewise. + +2003-01-08 Andreas Schwab + + * aclocal.m4 (gcc_AC_INITFINI_ARRAY): Fix spelling of cache + variable. + * configure: Regenerated. + +2003-01-08 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Replace byte/word + extraction of det with b0, b1, w0, w2, etc. + (compute_logical_op_length): Likewise. + (compute_logical_op_cc): Likewise. + +2003-01-08 Kazu Hirata + + * config/h8300/h8300.h (CONSTANT_ADDRESS_P): Allow CONST and + HIGH on all variants. + +2003-01-08 Josef Zlomek + + * Makefile.in (PARTITION_H): New. + (BASIC_BLOCK_H): Added hard-reg-set.h and $(PARTITION_H). + * basic-block.h: Include hard-reg-set.h. + +2003-01-08 Richard Earnshaw + + * arm.h (ENABLE_XF_PATTERNS): Delete. + * arm.md (addxf3, subxf3, mulxf3, divxf3, modxf3, negxf2, absxf2) + (sqrtxf2, floatsixf2, fix_truncxfsi2, truncxfsf2, truncxfdf2) + (extendsfxf2, extenddfxf2, movxf, cmpxf, cmpxf_insn) + (cmpxf_trap): Delete. + (movxf_hard_insn): Remove test of ENABLE_XF_PATTERNS. + +2003-01-08 Jan Hubicka + + * i386.md (adddi3_carry_rex64, subdi3_carry_rex64): Name pattern. + (addhi3_carry, addqi3_carry, subhi3_carry, subqi3_carry): New patterns. + (add??cc): New expanders. + * i386.c (expand_int_addcc): New function. + * i386-protos.h (expand_int_addcc): Declare. + + * alias.c (memory_modified_1): New static function. + (memory_modified): New static varaible. + (memory_modified_in_insn_p): New global function. + * rtl.h (memory_modified_in_insn_p): Declare. + * rtlanal.c (modified_between_p, modified_in_p): Be smart about memory + references. + + * expr.h (emit_conditional_add): Declare. + +2003-01-07 Janis Johnson + + PR other/8947 + * doc/invoke.texi (-malign-double): Explain that the option breaks + binary compatibility. + +2003-01-08 Andreas Schwab + + * config.gcc (m68k-*-linux*): Don't set extra_parts and gnu_ld, + should come from the generic *-*-linux* entry. + +2003-01-07 Jan Hubicka + + * cselib.c (cselib_current_insn_in_libcall): New static variable. + (new_elt_loc_list, cselib_process_insn, cselib_init): Keep track on whether + we are inside libcall. + * cselib.h (elt_loc_list): Add in_libcall. + * gcse.c (do_local_cprop): Do not copy propagate using insns + in libcalls. + +2003-01-07 David Edelsohn + + * doc/tm.texi (TARGET_SCHED_VARIABLE_ISSUE): CLOBBER and USE do + not normally affect to issue rate. + +2003-01-07 Jan Hubicka + + * genopinit.c (optabs): Add addc_optab. + * ifcvt.c (noce_try_store_flag): Rename to ... + (noce_try_addcc): ... this one; handle generic conditional increment. + (noce_process_if_block): Update noce_try_addcc call. + * optabs.c (emit_conditional_add): New. + (init_obtabs): Initialize addc_optab. + * optabs.h (optab_index): Add OTI_addcc. + (addcc_optab): New macro. + * md.texi: Document addMcc + + PR target/8322 + * i386.c (ix86_init_mmx_sse_builtins): Constify arguments of loads. + * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts. + * xmmintrin.h (_mm_load*_si128. _mm_store*_si128): Add casts. + + * reload1.c (delete_output_reload): Avoid repeated attempts + to delete insn. + +2003-01-07 Andreas Schwab + + * configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY. + Move --enable-initfini-array check ... + * aclocal.m4 (gcc_AC_INITFINI_ARRAY): ... here. Define + HAVE_INITFINI_ARRAY also when --enable-initfini-array is given. + Don't AC_SUBST gcc_cv_initfinit_array. Use AC_TRY_RUN. + * configure: Rebuild. + +2003-01-07 Richard Henderson + + * alias.c (find_base_value): Only use new_reg_base_value shortcut + if the register is set once. + +2003-01-07 Sylvain Pion + + * config/i386/i386.c (ix86_init_mmx_sse_builtins): + __builtin_ia32_ldmxcsr and __builtin_ia32_stmxcsr are SSE, not MXX. + * config/i386/i386.md (ldmxcsr, stmxcsr): SSE, not MMX. + +2003-01-07 Benjamin Kosnik + Sunil Davasam + + PR libstdc++/9076 + * unwind-dw2.c (execute_cfa_program): DW_CFA_undefined, + DW_CFA_same_value, read next and ignore. + +2003-01-07 Richard Henderson + + * cfganal.c (flow_call_edges_add): Don't crash on noreturn call. + +2003-01-07 Daniel Berlin + + * cfg.c: Include alloc-pool.h + (edge_pool): New pool. + (bb_pool): New pool. + (first_deleted_edge): Remove. + (first_deleted_block): Remove. + (init_flow): Alloc/free the pools. + (free_edge): Use pools. + (alloc_block): Ditto. + (expunge_block): Ditto. + (cached_make_edge): Ditto. + + * Makefile.in (cfg.o): Add alloc-pool.h dependency. + +2003-01-07 Daniel Berlin + + * et-forest.c: Include alloc-pool.h. + (struct et_forest): Add node_pool and occur_pool. + (et_forest_create): Create the new pools. + (et_forest_delete): Delete them. + (et_forest_add_node): Allocate and free using pools. + (et_forest_add_edge): Ditto. + (et_forest_remove_node): Ditto. + (et_forest_remove_edge): Ditto. + + * Makefile.in (et-forest.o): Add alloc-pool.h dependency. + +2003-01-07 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Simplify and + optimize the handling of SImode. + * config/h8300/h8300.c (compute_logical_op_length): Update + accordingly. + * config/h8300/h8300.c (compute_logical_op_cc): Likewise. + +2003-01-07 Richard Sandiford + + * config/mips/mips.c (mips_va_arg): In the EABI code, apply the + big-endian correction to indirect arguments too. + +2003-01-06 Aldy Hernandez + + Segher Boessenkool + + * config/rs6000/rs6000.c (rs6000_reg_names): Add missing registers. + (alt_reg_names): Ditto, fix formatting. + * config/rs6000/rs6000.h (DEBUG_REGISTER_NAMES): Fix formatting. + +2003-01-06 Kazu Hirata + + * config/h8300/h8300.c (final_prescan_insn): Constify uid. + (output_logical_op): Constify intval and det. + (compute_logical_length): Likewise. + (compute_logical_cc): Likewise. + (output_a_shift): Constify mask. + (h8300_encode_label): Constify len. + +2003-01-06 Kazu Hirata + + * config/h8300/h8300.c (h8300_expand_prologue): Remove fsize. + (h8300_expand_epilogue): Likewise. + +2003-01-06 Aldy Hernandez + + Segher Boessenkool + + * config/rs6000/altivec.md: Remove spaces from assembler + instruction argument lists. + +2003-01-07 Michael Hayes + + * config/c4x/c4x.c (c4x_naked_function_p): Rename from + c4x_assembler_function_p. + (c4x_null_epilogue_p): Complement return value, all uses updated. + (c4x_insert_attributes): Add naked. + * config/c4x/c4x.md (c4x_null_epilogue_p): Changes uses. + * doc/extend.texi: Update C4x function attributes. + +2003-01-06 Richard Henderson + + * config/alpha/alpha.c (alpha_encode_section_info): Adjust symbol_str + properly when changing "local-ness". + * config/alpha/alpha.md (movdi_er_high_g): Allow all symbols. + +2003-01-06 Dale Johannesen + + * config/darwin-protos.h: Add prototypes for new section functions. + +2003-01-06 Chris Demetriou + + * config.gcc (mipsisa32-*-elf*, mipsisa32el-*-elf*): Default ABI + to EABI. + +2003-01-06 Zack Weinberg + + * hwint.h: If the current compiler has no 64-bit type at all, + make HOST_WIDEST_INT 32 bits. + +2003-01-06 Eric Christopher + + * config/mips/mips.md (movdf_internal2): Fix constraints. + +2003-01-06 Kazu Hirata + + * config/h8300/h8300.md (*twoshifts_l16_r1): New. + +2003-01-06 Richard Sandiford + + * config/mips/mips.md (leadi): Use dla rather than la. + +2003-01-06 Svein E. Seldal + + * config/c4x/c4x.h: Updated specs for new gas format. Fixed bug + in C33_FLAG. Added proper C33 support in ASM_FILE_START macro. + +2003-01-06 Herman A.J. ten Brugge + + * config/c4x/c4x.h: Remove hwint.h include and HOST_WIDE_INT_PRINT_HEX + redefinition. + +2003-01-05 Kazu Hirata + + * config/h8300/h8300.md (*extzv_8_23): New. + +2003-01-05 John David Anglin + + * pa64-hpux.h (JCR_SECTION_NAME): Define. + (PA_INIT_FRAME_DUMMY_ASM_OP): Check EH_FRAME_SECTION_NAME instead of + USE_EH_FRAME_REGISTRY when defining. + +2003-01-05 Kazu Hirata + + * config/h8300/h8300.c (output_a_shift): Do not output a + variable shift. + * config/h8300/h8300.md (two splitters): New. + +2003-01-05 Richard Sandiford + + * config/mips/mips.md: Disable the movstrsi define_split. + +2003-01-05 Kaveh R. Ghazi + + * alloc-pool.c: Don't include "libiberty.h". + * config/sparc/gmon-sol2.c: Include . + * convert.c (convert_to_real): Hide unused variable. + +2003-01-04 Kaveh R. Ghazi + + * Makefile.in (gtyp-gen.h): Const-ify. + * gcov-dump.c (tag_table): Likewise. + +2003-01-04 Bruce Korb + + * fixinc/fixfixes.c(wrap_fix): the wrapper guard must be a function + of *both* the file name and the fix name. + +2003-01-04 John David Anglin + + * config.gcc (hppa*64*-*-hpux11*): Define extra_parts. Don't use + collect2. + * pa-hpux11.h (LDD_SUFFIX, PARSE_LDD_OUTPUT): Undefine. + (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Define. + * pa64-hpux.h (HP_INIT_ARRAY_SECTION_ASM_OP, + GNU_INIT_ARRAY_SECTION_ASM_OP, HP_FINI_ARRAY_SECTION_ASM_OP, + GNU_FINI_ARRAY_SECTION_ASM_OP): Define. + (CTORS_SECTION_ASM_OP, DTORS_SECTION_ASM_OP): Define when not using + elfos.h. + (EH_FRAME_IN_DATA_SECTION): Delete define. + (HAS_INIT_SECTION, LD_INIT_SWITCH, LD_FINI_SWITCH): Undefine. + (STARTFILE_SPEC): Use crtbegin.o. + (ENDFILE_SPEC): Use crtend.o. + (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION, + SUPPORTS_INIT_PRIORITY, PA_CXA_FINALIZE_STUB, PA_INIT_FINI_HACK, + PA_INIT_FRAME_DUMMY_ASM_OP, PA_JV_REGISTERCLASSES_STUB, + DTOR_LIST_BEGIN): Define. + * pa.c (TARGET_ASM_CONSTRUCTOR): Define. + (pa_asm_out_constructor, pa_asm_out_destructor): New functions. + * som.h (SUPPORTS_INIT_PRIORITY): Delete define. + +2002-12-31 Larin Hennessy + + * fixinc/fixinc.svr4: Remove references to i860, Sony NewsOS, and spur. + * fixinc/inclhack.def: Remove tests for Apple A/UX, ARM/RISCiX, DG/UX, + m88k-*-sysv3*, Sony NewsOS. Remove references to i860. + Cleanup handling of replacement text. + * fixinc/mkfixinc.sh: Remove reference to i?86-*-osf1* + +2003-01-04 Bruce Korb + + * fixinc/tests/base/math.h: removed obsolete results + * fixinc/tests/base/stdlib.h: ditto + * fixinc/tests/base/sys/param.h: ditto + * fixinc/tests/base/sys/stat.h: ditto + * fixinc/tests/base/time.h: ditto + * fixinc/tests/base/X11/Intrinsic.h: removed obsolete file + * fixinc/tests/base/sys/byteorder.h: ditto + * fixinc/inclhack.def: Remove superfluous backslashes + +2003-01-04 Kazu Hirata + + * config/h8300/h8300-protos.h: Add prototypes for + the new functions defined below. + * config/h8300/h8300.c (TARGET_ASM_FUNCTION_PROLOGUE): Do not + define. + (dosize): Emit RTL instead of assembly code. + (push): Likewise. + (pop): Likewise. + (h8300_output_function_prologue): Remove. + (h8300_expand_prologue): New. + (h8300_expand_epilogue): New. + (h8300_output_function_epilogue): Do only the reset of + pragma_saveall. + * config/h8300/h8300.md (push_h8300): New. + (push_h8300hs): Likewise. + (pop_h8300): Likewise. + (pop_h8300hs): Likewise. + (*stm_h8300s_2): Change the name to stm_h8300s_2. + (*stm_h8300s_3): Change the name to stm_h8300s_3. + (*stm_h8300s_4): Change the name to stm_h8300s_4. + (*ldm_h8300s_2): New. + (*ldm_h8300s_3): Likewise. + (*ldm_h8300s_4): Likewise. + (return): Likewise. + (*return_1): Likewise. + (prologue): Likewise. + (epilogue): Likewise. + (monitor_prologue): Likewise. + +2003-01-03 Dale Johannesen + + * config/darwin.h: (EXTRA_SECTIONS): Add machopic_symbol_stub1, + machopic_picsymbol_stub1. + (EXTRA_SECTION_FUNCTIONS): Ditto. + * rs6000/rs6000.c: Update copyright. + (machopic_output_stub): Use them. Remove an insn from stub code. + +2003-01-02 Jason Merrill + + * fold-const.c (fold) [COND_EXPR]: Avoid NOP_EXPRs better. + + * integrate.c (copy_decl_for_inlining): Don't clear the rtl for + static/external decls. + + * c-common.c (finish_fname_decls): Put the DECL_STMTs inside the + outermost scope. + * c-decl.c (c_make_fname_decl): Push the decls there, too. + +2003-01-03 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + h8300_current_function_interrupt_function_p. + * config/h8300/h8300.c (interrupt_handler): Remove. + (os_task): Likewise. + (monitor): Likewise. + (pragma_interrupt): New. + (WORD_REG_USED): Use + h8300_current_function_interrupt_function_p. + (dosize): Likewise. + (h8300_output_function_prologue): Likewise. + Do not set interrupt_handler, os_task, monitor. + (h8300_output_function_prologue): Use + h8300_current_function_interrupt_function_p. + Do not set interrupt_handler, os_task, monitor. + (h8300_current_function_interrupt_function_p): New. + (h8300_pr_interrupt): Set pragma_interrupt. + (h8300_insert_attributes): Reset pragma_interrupt. + +2003-01-03 Gerald Pfeifer + + * doc/install.texi (Configuration): Fix markup for reference to + gcc/config.gcc. + +2003-01-02 Kazu Hirata + + * config/h8300/h8300.md (*iorhi3_zext): Relax the condition. + (*iorhi3_two_qi): Likewise. + (*iorsi3_zexthi): Likewise. + (*xorhi3_zextqi): Likewise. + (*xorsi3_zexthi): Likewise. + (*xorsi3_zextqi): Likewise. + +2003-01-02 Kazu Hirata + + * config/h8300/h8300.c (stack_pointer_operand): New. + (const_int_gt_2_operand): Likewise. + (const_int_ge_8_operand): Likewise. + * config/h8300/h8300.md (a splitter): Likewise. + (a peephole2): Likewise. + * config/h8300/h8300-protos.h: Add prototypes for the new + functions above. + +2003-01-02 Steven Bosscher + + * objc/Make-lang.in, objc/config-lang.in, objc/lang-specs.h, + objc/objc-act.h: Fix copyright years. + +2003-01-02 Steven Bosscher + + * doc/passes.texi: Fix documentation for -fssa-ccp + +2003-01-02 Neil Booth + + * gccbug.in: Update for new categories. + +2003-01-01 Kazu Hirata + + * config/h8300/h8300.md: Reorder some patterns. + +2003-01-01 Kazu Hirata + + * config/h8300/h8300.c (output_logical_op): Fix a warning. + +2003-01-01 Neil Booth + + * config/darwin-protos.h, config/c4x/c4x-protos.h, + config/cris/cris-protos.h, config/i370/i370-protos.h, + config/i960/i960-protos.h, config/ia64/ia64-protos.h, + config/v850/v850-protos.h: Use struct, and don't conditionally + compile on GCC_C_PRAGMA_H. + +2003-01-01 Kazu Hirata + + * config/arm/arm-protos.h: Remove #ifdef GCC_C_PRAGMA_H. + * config/h8300/h8300-protos.h: Likewise. + * config/sh/sh-protos.h: Likewise. + +2003-01-01 Kazu Hirata + + * config/arm/arm-protos.h: Use struct cpp_reader instead of + cpp_reader. + * config/h8300/h8300-protos.h: Likewise. + * config/sh/sh-protos.h: Likewise. + +2003-01-01 Neil Booth + + * config/arm/arm.c (arm_pr_long_calls, arm_pr_no_long_calls, + arm_pr_long_calls_off): Use struct. + * config/h8300/h8300.c (h8300_pr-interrupt, h8300_pr_saveall) + : Similarly. + Don't include cpplib.h. + * config/sh/sh.c (sh_pr_interrupt, sh_pr_trapa, + sh_pr_nosave_low_regs): Similarly. + +2003-01-01 Kazu Hirata + + * config/h8300/h8300.c: Include cpplib.h. + +2003-01-01 Steven Bosscher + + * objc/Make-lang.in, objc/config-lang.in, objc/lang-options.h, + objc/lang-specs.h, objc/objc-act.c, objc/objc-act.h, + objc/objc-lang.c, objc/objc-tree.def: Replace "GNU CC" with + "GCC" in the copyright header. + +2003-01-01 Neil Booth + + * c-pragma.c (c_register_pragma): New. + (init_pragma): Use it. + * c-pragma.h (cpp_register_pragma): Don't declare. + (c_register_pragma): New. + * cpplib.h: Remove #ifdef GCC_C_PRAGMA_H. + * config/darwin.h (REGISTER_TARGET_PRAGMAS): Update. + * config/arm/arm.h (REGISTER_TARGET_PRAGMAS): Update. + * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Update. + * config/h8300/h8300.h (REGISTER_TARGET_PRAGMAS): Update. + * config/i370/i370.h (REGISTER_TARGET_PRAGMAS): Update. + * config/i960/i960.h (REGISTER_TARGET_PRAGMAS): Update. + * config/ia64/hpux.h (REGISTER_TARGET_PRAGMAS): Update. + * config/rs6000/rs6000.h (REGISTER_TARGET_PRAGMAS): Update. + * config/sh/sh.h (REGISTER_TARGET_PRAGMAS): Update. + * config/v850/v850.h (REGISTER_TARGET_PRAGMAS): Update. + * doc/tm.texi (REGISTER_TARGET_PRAGMAS): Update diff --git a/contrib/gcc/ChangeLog-2004 b/contrib/gcc/ChangeLog-2004 new file mode 100644 index 00000000000..71d1f8c71fa --- /dev/null +++ b/contrib/gcc/ChangeLog-2004 @@ -0,0 +1,47880 @@ +2004-12-31 Richard Henderson + + PR tree-opt/19042 + * tree-sra.c (decide_block_copy): Force use_block_copy false + for complex values. + +2004-12-31 Richard Henderson + + PR middle-end/17799 + * function.c (use_register_for_decl): Check DECL_IGNORED_P instead + of DECL_ARTIFICIAL. + (assign_parms_augmented_arg_list): Set DECL_IGNORED_P. + * c-decl.c (build_compound_literal): Likewise. + * dwarf2asm.c (dw2_force_const_mem): Likewise. + * gimplify.c (create_artificial_label): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + * var-tracking.c (vt_initialize): Likewise. + * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P. + +2004-12-31 Andrew Pinski + + PR target/19211 + * config/darwin.c (machopic_legitimize_pic_address): If the orig + is subregister return orig. + +2004-12-31 Zdenek Dvorak + + * tree-scalar-evolution.c (instantiate_parameters_1): Copy the + expression only if needed. + +2004-12-31 John David Anglin + + * pa-hpux.h (HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +2004-12-31 Hans-Peter Nilsson + + PR target/18701 + * combine.c (combine_simplify_rtx): Do not allow paradoxical + subregs of MEM. + + PR target/18701 + * combine.c (gen_lowpart_for_combine): When stripping SUBREG of + MEM, adjust imode and isize. + +2004-12-30 Richard Henderson + + * config/ia64/ia64.c (hfa_element_mode): Return false for + zero-sized top-level aggregates. + +2004-12-30 Jan Hubicka + + PR target/18019 + * i386.md (movqi_1): Fix -Os instruction choice. + +2004-12-30 Steven Bosscher + + * global.c (regclass_intersect): Remove. + (mark_reg_use_for_earlyclobber): Use reg_classes_intersect_p instead. + +2004-12-30 Richard Henderson + + * config/ia64/ia64.c (ia64_function_value): Use PARALLEL for + aggregates with XF/XCmode. + +2004-12-29 Richard Henderson + + * target.h (targetm.calls.arg_partial_bytes): New. + * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. + * calls.c (store_unaligned_arguments_into_pseudos): Update for + partial in bytes. + (load_register_parameters): Likewise. + (store_one_arg): Likewise. + (initialize_argument_information): Use targetm.calls.arg_partial_bytes. + (emit_library_call_value_1): Likewise. + * expr.c (block_move_libcall_safe_for_call_parm): Likewise. + (emit_push_insn): Update for partial in bytes. + * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * function.c (assign_parm_find_entry_rtl): Use + targetm.calls.arg_partial_bytes. Update for result in bytes. + (locate_and_pad_parm): Update for partial in bytes. + * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. + * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. + * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. + * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from + FUNCTION_ARG_PARTIAL_NREGS. + + * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, + config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, + config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, + config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + + * config/alpha/alpha.c (alpha_arg_partial_bytes): New. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/alpha/alpha.h, config/alpha/unicosmk.h, + config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + + * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... + * config/arm/arm.c (arm_arg_partial_bytes): ... here. + (TARGET_ARG_PARTIAL_BYTES): New. + + * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... + * config/cris/cris.c (cris_arg_partial_bytes): ... here. + (TARGET_ARG_PARTIAL_BYTES): New. + + * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from + fr30_function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/fr30/fr30-protos.h: Update. + + * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/frv/frv.c (frv_arg_partial_bytes): Rename from + frv_function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/frv/frv-protos.h: Update. + + * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from + ia64_function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/ia64/ia64-protos.h: Update. + + * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/iq2000/iq2000-protos.h: Update. + + * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/m32r/m32r-protos.h: Update. + + * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from + mcore_function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/mcore/mcore-protos.h: Update. + + * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/mips/mips.c (mips_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/mips/mips-protos.h: Update. + + * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/mn10300/mn10300-protos.h: Update. + + * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... + * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. + (TARGET_ARG_PARTIAL_BYTES): New. + + * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/pa/pa.c (pa_arg_partial_bytes): Rename from + function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/pa/pa-protos.h: Update. + + * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/rs6000/rs6000-protos.h: Update. + + * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... + * config/sh/sh.c (sh_arg_partial_bytes): ... here. + (TARGET_ARG_PARTIAL_BYTES): New. + + * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/sparc/sparc-protos.h: Update. + + * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. + * config/v850/v850.c (v850_arg_partial_bytes): Rename from + function_arg_partial_nregs. Adjust to return bytes. + (TARGET_ARG_PARTIAL_BYTES): New. + * config/v850/v850-protos.h: Update. + +2004-12-30 Hans-Peter Nilsson + + * config/mmix/mmix.h (ASM_OUTPUT_INTERNAL_LABEL): Define. + * config/mmix/mmix.c (mmix_asm_output_internal_label): New + function. + * config/mmix/mmix-protos.h (mmix_asm_output_internal_label): + Prototype. + +2003-12-29 Richard Henderson + + * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): True. + +2004-12-29 Jeff Law + + * tree-outof-ssa.c (insert_backedge_copies): New function. + (rewrite_out_of_ssa): Use it. + +2004-12-29 Ira Rosen + + PR tree-optimization/18179 + * tree-vectorizer.c (vect_get_base_and_offset): Call get_inner_reference + and vect_analyze_offset_expr. + (vect_create_addr_base_for_vector_ref): Build address_base by combining + base and initial_offset fields of vect_stmt_info. + (vect_update_inits_of_dr): Update offset of data-ref instead of its + access-fn. Remove argument. + (vect_update_inits_of_drs): Call vect_update_inits_of_dr with new + arguments. + (vect_compute_data_ref_alignment): Check misalignment info in + vect_stmt_info. Remove argument. + (vect_compute_data_refs_alignment): Call vect_compute_data_ref_alignment + with correct argument. + (vect_analyze_data_ref_access): Check access info in vect_stmt_info. + (vect_analyze_pointer_ref_access): Update step and initial_offset fields + of vect_stmt_info. + (vect_get_memtag_and_dr): Call vect_get_base_and_offset and set the + fields of stmt_vec_info. + (vect_analyze_data_refs): Find vectype and pass it to + vect_get_memtag_and_dr. + (vect_get_first_index): Remove. + (vect_compute_array_base_alignment): Remove. + (vect_compute_array_ref_alignment): Remove + (vect_create_data_ref_ptr): Use TYPE_SIZE_UNIT instead GET_MODE_SIZE. + (vect_gen_niters_for_prolog_loop): Use TREE_CONSTANT instead + host_integerp. + (vectorizable_load): Use size arithmetics. + +2004-12-29 Ira Rosen + + PR tree-optimization/18179 + * tree-vectorizer.c (vect_get_base_and_offset): Rename (previous name + vect_get_base_and_bit_offset). + (vect_get_memtag_and_dr): Rename (previous name vect_get_symbl_and_dr). + +2004-12-29 Ira Rosen + + PR tree-optimization/18179 + * tree-vectorizer.h (struct _stmt_vec_info): Add new fields: + initial_offset, step, misalignment and base_aligned_p and macros + to access them. + * tree-vectorizer.c (vect_analyze_offset_expr): New function. + (new_stmt_vec_info): Initialize the new fields of stmt_vec_info. + + (vect_create_data_ref_ptr): Fix printings. + +2004-12-29 Ira Rosen + + PR tree-optimization/18179 + * tree-vectorizer.c (vect_get_symbl_and_dr): Reorganize. Add memtag + retrieval. + (vect_analyze_data_refs): Remove memtag retrieval. + +2004-12-28 Richard Henderson + + PR inline-asm/15740 + * gimplify.c (gimplify_asm_expr): Move resolve asm names ... + * c-typeck.c (build_asm_expr): ... here. Validate input + constraints. Mark memory inputs addressable. + +2004-12-28 Hans-Peter Nilsson + + PR target/18321 + * config/mmix/mmix.c (mmix_expand_epilogue): Change type of + variable offset to HOST_WIDE_INT. Remove obsolete comment. Fix + spacing. + +2004-12-28 Andrew Pinski + + * fold-const.c (fold_build_cleanup_point_expr): For a RETURN_EXPR, + we only need a cleanup point expression when the expression on the + left hand side of the MODIFIY_EXPR inside the return has side + effects. + +2004-12-28 Dorit Naishlos + + * tree-vectorizer.c (vect_mark_relevant) First argument changed from + varray_type to varray_type*. + (vect_mark_stmts_to_be_vectorized): Pass &worklist instead of worklist + when calling vect_mark_relevant. + +2004-12-28 Alan Modra + + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Don't + generate non-offsettable DImode lo_sum addresses. + +2004-12-28 Zdenek Dvorak + + PR rtl-optimization/19103 + * loop-iv.c (iv_number_of_iterations): Fix typo. + +2004-12-28 Andreas Jaeger + + * genrecog.c (compute_predicate_codes): Avoid warning. + +2004-12-27 John David Anglin + + * vax.c (vax_address_cost, vax_rtx_cost): Correct casts. + (vax_rtx_cost): Handle small offsets for both PLUS and MINUS. + +2004-12-27 Jeff Law + + * tree-ssa-dom.c (thread_across_edge): Remove broken code to + avoid threading into a loop. + +2004-12-27 Richard Henderson + + PR target/17406 + * config/i386/i386.c (ix86_expand_prologue): Add REG_FRAME_RELATED_EXPR + note for allocate_stack_worker insn. + +2004-12-27 Jason Merrill + + * doc/tm.texi (TARGET_RELAXED_ORDERING): Document. + * target.h (struct gcc_target): Add relaxed_ordering field. + * target-def.h (TARGET_RELAXED_ORDERING): Define default. + (TARGET_INITIALIZER): Add it. + * config/alpha/alpha.c (TARGET_RELAXED_ORDERING): Define. + * config/ia64/ia64.c (TARGET_RELAXED_ORDERING): Define. + * config/rs6000/rs6000.c (TARGET_RELAXED_ORDERING): Define. + * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define. + +2004-12-27 Roger Sayle + + PR driver/16118 + * doc/invoke.texi: Document the interaction between -save-temps + and -x. + +2004-12-27 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_eliminate_indexed_memrefs): + Do not break apart constant pool addresses. + (rs6000_emit_move): Only force source into REG if target is MEM. + +2004-12-27 Mark Mitchell + + PR c++/19148 + * gimplify.c (gimplify_cond_expr): Add post_p parameter. + (gimplify_modify_expr_rhs): Adjust call to gimplify_cond_expr. + (gimplify_expr): Likewise. + +2004-12-27 Richard Henderson + + * config/i386/i386.h (UNITS_PER_SIMD_WORD): Don't use MMX/3DNOW. + +2004-12-26 Richard Henderson + + * config/i386/i386.c (ix86_gimplify_va_arg): Also pass the result + of type_natural_mode to examine_argument. + + * config/i386/i386.md (mov_internal_rex64): New. + (movv2sf_internal_rex64): New. + (mov_internal): Use no register preferences at all. + (movv2sf_internal): Likewise. + +2004-12-26 Richard Henderson + + * simplify-rtx.c (simplify_relational_operation_1): Don't simplify + plus/minus across EQ for floating-point. + +2004-12-26 John David Anglin + + PR target/17643 + * pa.c (pa_function_ok_for_sibcall): Sibcalls are not ok when + generating code for the portable runtime. + +2004-12-25 Richard Henderson + + * expr.c (clear_storage): Validate CONST0_RTX extant. Special case + complex modes. + +2004-12-25 Zdenek Dvorak + + PR rtl-optimization/19078 + * tree-ssa-loop-ivopts.c (determine_use_iv_cost_generic, + determine_use_iv_cost_outer): Fix computing of cost for the original + bivs. + (dump_use): Handle case related_cands == NULL. + +2004-12-25 Marek Michalkiewicz + + PR target/19059 + * config/avr/avr.c (avr_mcu_types): Move attiny{13,2313} from avr4 + to avr2. + * config/avr/avr.h (LINK_SPEC): Ditto. + * config/avr/t-avr (MULTILIB_MATCHES): Ditto. + +2004-12-25 Alan Modra + + PR target/19137 + * config/rs6000/rs6000.md (movti_power, movti_string): Relax + operand[1] predicate to input_operand, and add r<-n alternative. + Move TImode const_double_operand splitter to where it belongs. + +2004-12-25 Alan Modra + + PR target/19147 + * config/rs6000/rs6000.md (andsi3_internal7, andsi3_internal8): Delete. + +2004-12-24 Uros Bizjak + + * config/i386/i386.md (*fix_trunc{d,s,h}i_1): + Rename to *fix_trunc{d,s,h}i_i387. + (fix_trunc{d,s}fdi2): Reorder tests. + +2004-12-24 Daniel Berlin + + Fix PR debug/14638 + + * tree.h (DECL_DEBUG_ALIAS_OF): New macro. + * var-tracking.c (track_expr_p): Don't disqualify tracking of variables + that are aliases of variables we want to track, unless the + original variable is also ignored for debugging purposes. + (VARIABLE_HASH_VAL): Use DECL_UID, so that this is deterministic. + * tree-outof-ssa.c (create_temp): Note who we are a debug alias of. + * dwarf2out.c (dwarf2out_var_location): Add us to the location of + the decl we are an alias of. + +2004-12-24 Alan Modra + + PR target/19142 + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Allow + DFmode for 32-bit again. + +2004-12-23 Roger Sayle + + * reload.c (regno_clobbered_p): Add a gcc_assert that regno + refers to a hard register. + +2004-12-23 Mark Mitchell + + * gimplify.c (gimplify_modify_expr_rhs): Use types_compatible_p. + +2004-12-23 DJ Delorie + + * genrecog.c (did_you_mean_codes): New. + (compute_predicate_codes): Fail unmatched codes. + +2004-12-23 Eric Christopher + + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add + assert for machine=mips for !TARGET_IRIX. + * config/mips/linux.h: Remove machine=mips assert. + * config/mips/netbsd.h: Ditto. + * config/mips/openbsd.h: Ditto. + +2004-12-23 Dale Johannesen + + * tree.c (iterative_hash_expr): Canonicalize builtins. + +2004-12-23 Alexandre Oliva + + PR target/16819 + * calls.c (load_register_parameters): Don't call use_regs when + nregs is zero. + +2004-12-23 Eric Botcazou + + PR middle-end/17746 + * expr.c (get_inner_reference): Add 'keep_aligning' parameter. + Break on aligning VIEW_CONVERT_EXPR nodes on STRICT_ALIGNMENT + platforms only if keep_aligning is true. + (expand_assignment): Adjust call to get_inner_reference. + (expand_expr_addr_expr_1): Likewise. + (expand_expr_real_1): Likewise. + * dojump.c (do_jump): Likewise. + * dwarf2out.c (loc_descriptor_from_tree_1): Likewise. + * fold-const.c (optimize_bit_field_compare): Likewise. + (decode_field_reference): Likewise. + (split_address_to_core_and_offset): Likewise. + * tree-ssa-loop-ivopts.c (split_address_cost): Likewise. + * tree.h (get_inner_reference): Adjust prototype. + +2004-12-23 Richard Henderson + + * config/i386/i386.c (override_options): Revert last change + wrt fancy 387 math. + +2004-12-23 Richard Henderson + + * config/alpha/alpha.md (one_cmpl2, and3, andnot3, + ior3, iornot3, xor3, xornot3): New macroized + vector operate patterns. + +2004-12-23 Richard Henderson + + * config/i386/i386.c (ix86_expand_vector_move): Tidy. + (ix86_expand_vector_move_misalign): New. + (ix86_misaligned_mem_ok): Remove. + (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (SSEMODEI): Rename from SSEINT16. + (MMXMODEI): Rename from MMXINT8. + (SSEMODE, MMXMODE, movmisalign): New. + +2004-12-23 Mark Mitchell + + PR c++/16405 + * gimplify.c (gimplify_modify_expr_rhs): Handle + INDIRECT_REF/ADDR_EXPR combinations. + +2004-12-22 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_mov): Split out ... + (alpha_expand_movmisalign): ... misaligned vector support. + (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (VEC): New macro. + (movv8qi, movv4hi, movv2si): Compress with VEC. + (movv8qi_fix, movv4hi_fix, movv2si_fix): Likewise. + (movv8qi_nofix, movv4hi_nofix, movv2si_nofix): Likewise. + (movmisalign): New. + +2004-12-22 Richard Henderson + + * optabs.h (OTI_movmisalign, movmisalign_optab): New. + * optabs.c (init_optabs): Create it. + * genopinit.c (optabs): Initialize it. + * expr.c (expand_expr_real_1) : Use it. + * tree-vectorizer.c (vect_supportable_dr_alignment): Likewise. + * target-def.h (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. + * target.h (vectorize.misaligned_mem_ok): Remove. + * targhooks.c (default_vect_misaligned_mem_ok): Remove. + * doc/md.texi (movmisalign): New. + * doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): Remove. + +2004-12-22 Richard Henderson + + * config/i386/emmintrin.h (_mm_loadh_pd): Don't cast pointer arg + to __v2si. + (_mm_storeh_pd, _mm_loadl_pd, _mm_storel_pd): Likewise. + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use double* or + const double* for __builtin_ia32_loadhpd, __builtin_ia32_loadlpd, + __builtin_ia32_storehpd, __builtin_ia32_storelpd. + (ix86_expand_builtin): Update to match. + (ix86_expand_vector_init): Use sse2_loadlpd. + * config/i386/i386.md (vec_setv2df): Use sse2_loadlpd, sse2_loadhpd. + (vec_extractv2df): Use sse2_storelpd, sse2_storehpd. + (sse2_storehpd, sse2_loadhpd, sse2_storelpd, sse2_loadlpd): New. + (sse2_movhpd): Remove. + +2004-12-23 Alan Modra + + PR target/18751 + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Return + false for anything larger than 32 bits in 32-bit code. + +2004-12-22 Richard Henderson + + * config/i386/i386.md (btsq, btrq, btcq): Fix modes. + (bt peepholes): Likewise. + + * varasm.c (force_const_mem): Call set_mem_align. + +2004-12-22 Richard Henderson + + * config/i386/predicates.md (sse_comparison_operator): Fix + typo in ieee test. + (arith_or_logical_operator): Downcase codes. + +2004-12-23 Kaz Kojima + + PR target/18511 + * reload1.c (emit_output_reload_insns): Check if OLD is a hard + register before calling regno_clobbered_p. + * reload.c: Update comment for regno_clobbered_p. + +2004-12-22 Richard Henderson + + * config/i386/i386.c (override_options): Respect user disable of + fancy 387 math, sse, mmx. + (construct_container): Generate error if we need an sse regster + and sse has been disabled. + * config/i386/i386.h (TARGET_SWITCHES): Disabling sse also disables + later sse generations. Disabling mmx also disables 3dnow. + +2004-12-22 Daniel Berlin + + * tree-inline.c (struct inline_data): Remove inlined_fns. + (expand_call_inline): Remove dead code setting + inlined_fns. + (optimize_inline_calls): Remove dead code setting DECL_INLINED_FNS. + * tree.h (struct tree_decl): Remove inlined_fns. + +2004-12-22 Roger Sayle + + * tree-browser.c: Remove obsolete #ifdef HOST_EBCDIC code. + +2004-12-23 Alan Modra + + PR target/18896 + * function.c (split_complex_args): Set DECL_ARTIFICIAL, DECL_IGNORED_P + for real and imaginary parts if the parm is addressable. + (assign_parms_unsplit_complex): If parm addressable, save real + and imaginary parts to a stack temp. Pass assign_parm_data_all. + (assign_parms): Adjust assign_parms_unsplit_complex call. + +2004-12-22 Daniel Berlin + + * tree.h (DECL_PTA_ALIASVAR): Dead. + (struct tree_decl): Remove alias_var field. + +2004-12-22 Nathan Sidwell + + * system.h (IN_RANGE): Restore HOST_WIDE_INT cast. + * tree.h (IS_EXPR_CODE_CLASS): Do not use IN_RANGE. + +2004-12-22 Richard Henderson + Uros Bizjak + + * config/i386/i386.md (truncdfsf2): Don't create stack temp when + using sse math only. Use truncdfsf2_with_temp. + (truncdfsf2_with_temp): New. + (truncdfsf_fast_i387): Rename from truncdfsf2_noop. Add memory + output alternative. + (truncdfsf_mixed): Rename from truncdfsf2_1_sse. Compress duplicate + alternatives. + (truncdfsf_fast_sse): Rename from truncdfsf2_2. Remove f alternative. + (truncdfsf2_3, truncdfsf2_sse_only): Remove. + (truncdfsf_i387): Rename from truncdfsf2_1. Compress duplicates. + (truncdfsf_fast_mixed): New. + (truncdfsf splitters): Remove all except the 387 load/store split. + (truncxfsf2_1, truncxfdf2_1): Unify enable constraint with + respect to TARGET_SSE2, TARGET_80387, TARGET_SSE_MATH and + TARGET_MIX_SSE_I387. + (*truncxf{s,d}f2_1): Rename to *truncxf{s,d}f2_mixed. + (truncxf{s,d}f2_noop) Rename to truncxf{d,s}f2_i387_noop. + (*truncxf{s,d}f2_i387): New patterns. + (*truncxf{s,d}f2_2): Rename to *truncxf{s,d}f2_i387_1. + (truncxf{s,d}f2, fmod{s,d}f3, drem{s,d}f3, log1p{s,d}f2, + rint{s,d}f2, floor{s,d}f2, ceil{s,d}f2, btrunc{s,d}f2, + nearbyint{s,d}f2): Use renamed patterns. + +2004-12-22 Richard Kenner + + * tree.h (TYPE_SIZES_GIMPLIFIED): New. + * function.c (gimplify_parm_type): Don't gimplify type if already done. + * gimplify.c (gimplify_decl_expr): Likewise. + (gimplify_type_sizes): Set TYPE_SIZES_GIMPLIFIED. Examine nested + array types. + +2004-12-22 Richard Henderson + + * gimplify.c (eval_save_expr): Remove. + (gimplify_one_sizepos): Unshare expr before gimplifying. + * stor-layout.c (variable_size): Revert 2004-12-19 change. + (layout_decl): Revert 2004-12-18 change. + (layout_type): Revert 2004-12-21 change. + +2004-12-22 Richard Kenner + + * tree-sra.c (type_can_be_decomposed_p): Reject variable sized types. + +2004-12-22 Mark Mitchell + + * Makefile.in (install-common): Remove special-case code for when + SPECS is defined. + +2004-12-22 Jan Beulich + + * config.gcc: Add dbxelf.h to NetWare's tm_file. + * config/i386/netware-crt0.c: Prototype __init_environment and + __deinit_environment prior to their definition. + (__init_environment): Correct invokation of constructor function. + * config/i386/netware.h (TARGET_OS_CPP_BUILTINS): Use + builtin_define_std rather than builtin_define on IAPX386. + * config/i386/nwld.h: Disable stabs debugging info with the linker + this file supports. + * config/i386/t-nwld (SHLIB_LINK): Do not use a temporary file for + the output. Add -posix to the options as that is the more compatible + mode. + * gthr-nks.h: Formatting. + (__gthread_mutex_init_function): Kill the dubious use of + NX_MUTEX_RECURSIVE as it is now clear that the traditional mutexes + were not meant to be recursive. + (__gthread_recursive_mutex_t, __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION, + __gthread_recursive_mutex_init_function, + __gthread_recursive_mutex_lock, __gthread_recursive_mutex_trylock, + __gthread_recursive_mutex_unlock): New. + +2004-12-22 Alexandre Oliva + + * config/mips/t-linux64: Remove code that messed with $(SPECS). + (MULTILIB_OPTIONS, MULTILIB_DIRNAMES, MULTILIB_OSDIRNAMES): Move + n32 to the front. + (MULTILIB_EXTRA_OPTS, CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): + Removed. + * config/mips/linux64.h (DRIVER_SELF_SPECS): Don't handle + -mabi-fake-default. + (SUBTARGET_TARGET_SWITCHES): Likewise. + +2004-12-21 Andrew Pinski + + PR c++/18984 + * pointer-set.c (pointer_set_contains): Add back. + * pointer-set.h (pointer_set_contains): Add back. + +2004-12-21 Richard Henderson + + * gimplify.c (eval_save_expr): New. + (gimplify_one_sizepos): Use it. + * stor-layout.c (layout_type): Unshare TYPE_MIN/MAX_VALUE. + +2004-12-21 Nathan Sidwell + + * system.c (IN_RANGE): Use plain unsigned, not unsigned + HOST_WIDE_INT. + * tree.def (VOID_TYPE, INTEGER_TYPE, REAL_TYPE, COMPLEX_TYPE, + VECTOR_TYPE, OFFSET_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, CHAR_TYPE, + POINTER_TYPE, REFERENCE_TYPE, METHOD_TYPE, FUNCTION_TYPE, + FILE_TYPE, ARRAY_TYPE, RECORD_TYPE, UNION_TYPE, + QUAL_UNION_TYPE): Reorder for better code efficiency. + (CONST_DECL, TYPE_DECL, VAR_DECL, FIELD_DECL, PARM_DECL): Likewise. + (INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): Likewise. + * tree.h (INDIRECT_REF_P): Reorder checks for better optimization. + (IS_EXPR_CODE_CLASS): Use IN_RANGE. + (INTEGRAL_TYPE_P, FLOAT_TYPE_P): Reorder checks for better + optimization. + +2004-12-21 David O'Brien + + * config/freebsd-spec.h: Use KSE pthread lib for -pthread. + +2004-12-21 James A. Morrison + + PR c/18963 + * c-decl.c (pushdecl): Remove block trying to merge static function + declarations at block scope to file scope declarations. + +2004-12-21 James A. Morrison + + PR c/18596 + * c-parse.in (initdcl): Don't process a declaration if start_decl fails. + (notype_initdcl): Don't process a declaration if start_decl fails. + * c-decl.c (start_decl): Fail if grokdeclarator fails. + (grokdeclarator): Fail if a function definition has an invalid storage + class. + * c-typeck.c (start_init): Treat error_mark_node the same as 0. + +2004-12-21 Richard Henderson + + * config/i386/i386.c (x86_sse_split_regs): Rename from + x86_sse_partial_regs. + * config/i386/i386.h (x86_sse_split_regs): Likewise. + (TARGET_SSE_SPLIT_REGS): Rename from TARGET_SSE_PARTIAL_REGS. + * config/i386/i386.md (*): Update to match. Remove two + floatsisf splitters that use it. + + * config/i386/i386.h (x86_sse_partial_regs_for_cvtsd2ss): Remove. + + * config/i386/i386.c (x86_sse_partial_regs_for_cvtsd2ss): Remove. + * config/i386/i386.h (TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS): Remove. + * config/i386/i386.md (truncdfsf2_1_sse): Don't test it. + (truncdfsf2_2, truncdfsf2_sse_only): Likewise. + (truncdfsf2_1_sse_nooverlap, truncdfsf2_2_nooverlap): Remove. + (truncdfsf2_sse_only_nooverlap): Remove. + + * config/i386/i386.h (TARGET_SSE_TYPELESS_LOAD0): Remove. + +2004-12-21 Eric Botcazou + + * expr.c (emit_group_load_1): Return the source if the move + is a regular move between complex values. + +2004-12-20 Roger Sayle + + PR middle-end/18683 + * config/rs6000/rs6000.c (current_file_function_operand): Only check + current_function_decl's DECL_RTL if it has already been set. + +2004-12-20 Roger Sayle + + PR middle-end/18683 + * function.c (pop_function_context_from): Don't reset reg_renumber. + +2004-12-20 Eric Botcazou + + PR middle-end/18776 + * expr.c (write_complex_part): Use a subreg if the original object + is a hard reg that spans an even number of regs or a MEM. + (read_complex_part): Likewise. + +2004-12-20 Mark Mitchell + + * Makefile.in (install-common): Do not install the specs file + unless SPECS is defined. + +2004-12-20 Zdenek Dvorak + + PR rtl-optimization/18942 + * simplify-rtx.c (simplify_relational_operation_1): Simplify + x + cst1 == cst2 to x == cst2 - cst1. Made static. + +2004-12-20 Matt Austern + + PR c++/19044 + * c-common.c (set_builtin_user_assembler_name): New. + * c-common.h (set_builtin_user_assembler_name): Declare. + * c-decl.c (finish_decl): Use set_builtin_user_assembler_name + +2004-12-20 Diego Novillo + + PR tree-optimization/19080 + + Merge from tree-cleanup-branch + + * tree-flow-inline.h (clear_call_clobbered): New function. + * tree-ssa-alias.c (init_alias_info): Call it. + +2004-12-20 Richard Henderson + + * config/i386/i386.md (sse2_movsd): Remove ix86_binary_operator_ok + check. + +2004-12-20 Steven Bosscher + Andrew Pinski + + PR middle-end/18191 + PR middle-end/18965 + PR middle-end/18999 + * expr.c (categorize_ctor_elements_1): Count the total number + of elements in the constructor. + (categorize_ctor_elements): Return it in a new argument. + * tree.h (categorize_ctor_elements): Adjust prototype. + * gimplify.c (gimplify_init_ctor_eval_range): New. + (gimplify_init_ctor_eval): Gimplify RANGE_EXPR. + (gimplify_init_constructor): Block clear the object if the + constructor has fewer elements than the object type. Only try + to add assignments to individual elements when we have to. + +2004-12-20 Richard Henderson + + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use + long_long_integer_type_node in building V2DI_type_node. + + * config/i386/emmintrin.h: Use __vector_size__ instead of vector_size. + * config/i386/mmintrin.h, config/i386/xmmintrin.h: Likewise. + +2004-12-20 Ben Elliston + + * doc/md.texi (Expander Definitions): Use @emph instead of @strong + around Note: text to workaround a limitation of the Info format. + * doc/cpp.texi (Invocation): Likewise. + * doc/cppopts.texi: Likewise. + +2004-12-19 Dale Johannesen + + * tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Don't + reference operand 1 of ADDR_EXPRs. + +2004-12-19 Mark Mitchell + + * defaults.h (ASM_OUTPUT_INTERNAL_LABEL): New macro. + * output.h (assemble_name_raw): Declare it. + * system.h (ASM_OUTPUT_INTERNAL_LABEL): Do not poison it. + * varasm.c (assemble_name_raw): New function. + (assemble_name): Use it. + (default_internal_label): Likewise. + * config/darwin.c (darwin_asm_output_dwarf_delta): Likewise. + * doc/tm.texi (ASM_OUTPUT_INTERNAL_LABEL): Document. + +2004-12-19 Richard Henderson + + PR 18067 + * stor-layout.c (variable_size): Force creation of a SAVE_EXPR. + +2003-12-19 Steven Bosscher + + * config/i386/i386.c (ix86_split_to_parts): Use an array with + four elements for decoding a CONST_DOUBLE on 64 bits targets. + +2004-12-19 Bernardo Innocenti + + * config/m68k/m68kemb.h (TARGET_OS_CPP_BUILTINS): Remove redundant + definition of mc68000, already present in TARGET_CPU_CPP_BUILTINS. + +2004-12-18 Daniel Berlin + + * lambda-code.c (can_convert_to_perfect_nest): Make checking + match up with what perfect_nestify can actually handle. + (perfect_nestify): Don't return false in the phi node loop. + +2004-12-18 Richard Henderson + + * config/i386/i386.md (SSEINT16): New. + (movv16qi, movv8hi, movv4si, movv2di): Compress via macros. + (movv16qi_internal, movv8hi_internal, movv4si_internal, + movv2di_internal): Compress via macros. Add SSE zero alternative. + Fix pure SSE alternatives to use 'x' instead of 'Y'. + (MMXINT8): New. + (movv8qi, movv4hi, movv2si, movv8qi_internal, movv4hi_internal, + movv2si_internal): Compress via macros. + (SSEPUSH, MMXPUSH): New. + (pushv18qi, pushv8hi, pushv4si, pushv2di, pushti, pushv4sf, pushv2df, + pushv8qi, pushv4hi, pushv2si, pushv2sf): Compress via macros. + +2004-12-18 Richard Henderson + + PR middle-end/16417 + * c-decl.c (store_parm_decls): Clarify get_pending_sizes insertion + comment. + * c-objc-common.c (c_cannot_inline_tree_fn): Remove pending sizes + checks. + * c-tree.h (struct lang_decl): Remove pending_sizes. + * function.c: Include tree-gimple.h + (assign_parm_setup_reg): Remove callee-copies code. + (gimplify_parm_type, gimplify_parameters): New functions. + (expand_pending_sizes): Remove. + (expand_function_start): Don't call it. + * gimplify.c (gimplify_expr): Examine DECL_VALUE_EXPR for PARM_DECL. + (gimplify_body): Add do_parms argument. Use gimplify_parameters. + (gimplify_function_tree): Setup cfun. Update gimplify_body call. + * tree-gimple.h (gimplify_body): Update decl. + * tree-inline.c (initialize_inlined_parameters): Update gimplify_body + call. + * tree.h (gimplify_parameters): Declare. + * Makefile.in (function.o): Depend on TREE_GIMPLE_H. + +2004-12-18 Richard Henderson + + * c-decl.c (finish_struct): Add DECL_EXPR for variable sized + structures seen inside functions. + +2004-12-18 Richard Henderson + + * c-decl.c (grokdeclarator): Save variable array size before + subtracting 1, rather than after. + +2004-12-18 Eric Botcazou + + PR middle-end/15486 + * varasm.c (asm_emit_uninitialised): Return early if + a custom section is requested. + (assemble_variable): Revert 2002-03-15 patch. + +2004-12-18 Richard Henderson + + * stor-layout.c (layout_decl): Use unshare_expr, not unsave_expr. + +2004-12-18 Zdenek Dvorak + + PR tree-optimization/18800 + * params.def (PARAM_IV_ALWAYS_PRUNE_CAND_SET_BOUND): New parameter. + * tree-ssa-loop-ivopts.c (struct iv_ca): Add n_cands field. + (ALWAYS_PRUNE_CAND_SET_BOUND): New macro. + (iv_ca_set_no_cp, iv_ca_set_cp, iv_ca_new): Update n_cands field. + (iv_ca_delta_join, iv_ca_delta_reverse, iv_ca_n_cands, iv_ca_prune): + New functions. + (iv_ca_extend): Return number of candidates in the set. + (try_add_cand_for): Add argument to iv_ca_extend calls. + (try_improve_iv_set): Use iv_ca_prune. + * doc/invoke.texi (iv-always-prune-cand-set-bound): Document. + +2004-12-18 Zdenek Dvorak + + PR rtl-optimization/19001 + * loop-iv.c (iv_number_of_iterations): Record assumptions for loops + with power of two step to 'infinite' field. + +2004-12-18 Roger Sayle + + * Makefile.in (stor-layout.o): Depend upon gt-stor-layout.h. + (tree-ssa-propagate.o): Depend upon gt-tree-ssa-propagate.h. + (tree-ssa-operands.o): Depend upon gt-tree-ssa-operands.h. + (tree-mudflap.o): Depend upon gt-tree-mudflap.h. + (expr.o): Depend upon gt-expr.h. + (regclass.o): Depend upon gt-regclass.h. + (bitmap.o): Depend upon gt-bitmap.h. + (lists.o): Depend upon gt-lists.h. + + (cfgexpand.o): Don't depend upon gt-tree-cfg.h. + + (GTFILES): Remove fold-const.c. + (gt-stmt.h, gt-fold-const.h, gt-input.h, gt-tree-ssa-ccp.h): + Remove rules. + +2004-12-18 Richard Henderson + + * stor-layout.c (layout_decl): Unshare size expressions copied + from the type. + + * fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when + BOTTOM is a power of two. + +2004-12-18 Richard Henderson + + * tree-nested.c (save_tmp_var): New. + (struct walk_stmt_info): Add is_lhs. + (walk_stmts) : Be more accurate with setting of + val_only; set is_lhs. + (convert_nonlocal_reference): Use save_tmp_var when is_lhs; + clear is_lhs when appropriate. + (convert_local_reference): Likewise. + +2004-12-18 Richard Earnshaw + + * arm/ieee754-sf.S (floatdisf): Fix label definition in FPA + compatibility code. + +2004-12-18 Roger Sayle + + * ifcvt.c (total_bb_rtx_cost): Rename function to cheap_bb_rtx_cost_p. + Take a max_cost argument to avoid scanning large blocks, by returning + a Boolean instead of a total. Include the cost of a "fstp %st(0)" + instruction required to pop dead values off of a register stack. + +2004-12-18 Roger Sayle + + PR middle-end/18548 + * expr.c (expand_expr_real_1) : Ensure that target, op0 + and op1 are all registers (or constants) before expanding the RTL + comparison sequence [to avoid reg_overlap_mentioned (target, op1)]. + +2004-12-18 Eric Botcazou + + PR rtl-optimization/16968 + * loop.c (scan_loop): Stop scanning the loop for movable + insns as soon as an optimization barrier is encountered. + +2004-12-17 Zack Weinberg + + PR 18897 + * toplev.c (compile_file): Call process_pending_assemble_externals + just before targetm.asm_out.file_end. + +2004-12-17 Diego Novillo + + tree-optimization/18501 + * tree-optimize.c (init_tree_optimization_passes): Run + pass_late_warn_uninitialized before the last DCE run. + +2004-12-17 Richard Henderson + + * config/i386/i386.c (x86_64_reg_class_name): Re-indent. + (classify_argument, examine_argument, construct_container, + merge_classes): Remove prototypes. + (type_natural_mode): Split out from ... + (function_arg): ... here. + (gen_reg_or_parallel): Remove alt_mode argument. Update callers. + Use orig_mode unless it's BLKmode. + (construct_container): Add orig_mode argument. Update callers. + Use gen_reg_or_parallel for SSE registers. + (ix86_function_value): Use type_natural_mode. + (ix86_gimplify_va_arg): Likewise. + (ix86_hard_regno_mode_ok): Always accept all SSE, MMX, 3DNOW modes in + SSE registers; always accept all MMX, 3DNOW modes in MMX registers. + * config/i386/i386.h (VALID_SSE2_REG_MODE): Don't include + VALID_MMX_REG_MODE. + * config/i386/i386.md (attribute mode): Add V1DF. + (movsi_1): Use 'x' instead of 'Y' constraints. + (movsi_1_nointernunit, movdi_2, movdi_1_rex64): Likewise. + (movdi_1_rex64_nointerunit): Likewise. + (movdf_nointeger, movdf_integer): Likewise. Handle SSE1. + (movsf_1, movsf_1_nointerunit): Line up constraint alternatives. + (swapsf): Use fp_register_operand, don't disable for TARGET_SSE. + (swapdf): Likewise. + (swapxf): Enable only for TARGET_80387. + (movv2sf, movv2sf_internal, pushv2sf): Enable for MMX. + (movtf): Remove double-check for TARGET_64BIT. + (movv2df_internal): Enable for SSE1. + (movv8hi_internal, movv16qi_internal): Likewise. + (movv2df, movv8hi, movv16qi): Likewise. + (pushv2di, pushv8hi, pushv16qi, pushv4si): Likewise. + (pushdi2_rex64, movv4sf_internal, movv4si_internal, movv2di_internal, + movv8qi_internal, movv4hi_internal, movv2sf_internal, + movv2df_internal, movv8hi_internal, movv16qi_internal, + movti_internal): Add leading '*' to name. + +2004-12-17 Dale Johannesen + + * c-decl.c (diagnose_mismatched_decls): Accept mismatched + function types: void with previous implicit int. + +2004-12-17 Andreas Krebbel + + * config/s390/s390.c (s390_gimplify_va_arg): Set alias set to + s390_sr_alias_set. + +2004-12-17 Jan Beulich + + PR target/17603 + * config/i386/i386.c (enum x86_64_reg_class): Define + X86_64_COMPLEX_X87_CLASS. + (x86_64_reg_class_names): Add name for X86_64_COMPLEX_X87_CLASS. + (merge_classes): Handle X86_64_COMPLEX_X87_CLASS. + (classify_argument): XCmode is X86_64_COMPLEX_X87_CLASS. + (examine_argument): X86_64_COMPLEX_X87_CLASS requires two + registers when dealing with a return value. + (construct_container): Handle X86_64_COMPLEX_X87_CLASS. + Eliminate impossible case of two X87/X87UP pairs (this now is + being expressed by a single COMPLEX_X87). + (x86_libcall_value): XCmode gets returned in st0/st1. + +2004-12-17 Steven Bosscher + + * tree.c (type_contains_placeholder_1): Always return false + for VECTOR_TYPE if its TREE_TYPE does not contain a placeholder. + +2004-12-17 Uros Bizjak + + * config/i386/i386.md (extendsfdf2, *extendsfdf2_1, + *extendsfdf2_1_sse_only): Unify enable constraint with + respect to TARGET_SSE2, TARGET_80387, TARGET_SSE_MATH + and TARGET_MIX_SSE_I387. + (*extendsfdf2_i387): New insn pattern. + (*extendsfdf2_1): Rename to *extendsfdf2_mixed. Fix + register constraint for operand 0. + (*extendsfdf2_1_sse_only): Rename to *extendsfdf2_sse. + (*extend{s,d}fxf2_1): Rename to *extend{s,d}fxf2_i387. + +2004-12-16 Andrew Pinski + + PR target/19041 + * config/darwin.c (machopic_symbol_defined_p): Return false + if the binds local and is a common symbol. + +2004-12-16 Richard Henderson + + * config/i386/i386.md (extv, extzv, insv): Revalidate the + operand with ext_register_operand. + +2004-12-16 Kazu Hirata + + * global.c: Fix a comment typo. + +2004-12-16 Eric Botcazou + Roger Sayle + + PR tree-optimization/18707 + * cfgloopmanip.c (create_preheader): Move the preheader + only if the latch was falling through to the header. + +2004-12-16 Danny Smith + + PR target/18997 + * config/i386/cygwin.h (GTHREAD_USE_WEAK): Define to 0. + +2004-12-16 Richard Henderson + Aldy Hernandez + + * simplify-rtx.c (simplify_replace_rtx): Do not blindly replace + hard registers. + +2004-12-16 H.J. Lu + + PR other/18508 + * config/alpha/t-osf4 (SHLIB_LINK): Use `.backup' as the suffix + to back up the existing shared library. + * config/arm/t-netbsd (SHLIB_LINK): Likewise. + * config/mips/t-slibgcc-irix (SHLIB_LINK): Likewise. + * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise. + * config/sh/t-linux (SHLIB_LINK): Likewise. + * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise. + * config/t-slibgcc-darwin (SHLIB_LINK): Likewise. + * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise. + * config/t-slibgcc-sld (SHLIB_LINK): Likewise. + + * config/i386/t-nwld (SHLIB_LINK): Don't use the temporary + file. + +2004-12-16 Richard Henderson + + * Makefile.in (MD_DEPS, s-mddeps): New. + (s-config, s-conditions, s-flags, s-codes, s-constants, s-emit, + s-recog, s-opinit, s-extract, s-peep, s-attr, s-attrtab, s-output, + s-preds): Depend on MD_DEPS instead of md_file. + (genobjnames): Add genmddeps.o + (build/genmddeps, build/genmddeps.o): New. + (mostlyclean): Remove mddeps.mk. + * genmddeps.c: New file. + * gensupport.c (include_callback): New. + (process_include): Call it. + * gensupport.h (include_callback): Declare. + +2004-12-16 Nathan Sidwell + + * local-alloc.c (block_alloc): Replace IN_RANGE with simple + comparison. + + * doc/c-tree.texi (CONSTRUCTOR): Mention RANGE_EXPRs. + +2004-12-16 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): Two new fields: + madbr, maebr. + (s390_rtx_costs): Added handling of multipy and add in SFmode. + More precise values for cost of multiply and add. + +2004-12-15 Richard Henderson + + PR target/19028 + * config/i386/i386.md (sse compare splitter): Test for SF and DFmode + explicitly instead of using VALID_SSE_REG_MODE. + +2004-12-15 Richard Henderson + + PR target/19005 + * config/i386/i386.md (swaphi_1): Swap with swaphi_2, allow with + optimize_size. + (swapqi_1): Rename from swapqi. Enable only for no partial reg + stall and optimize_size. + (swapqi_2): New. + (swaphi_1, swaphi_2, swapqi_1): Add athlon_decode. + (swapsi, swaphi_1, swaphi_2, swapqi_1, swapdi): Remove modrm override. + +2004-12-16 Uros Bizjak + + * config/i386/i386.md (*floathisf2_i387, *floathidf2_i387): + Also enable for TARGET_MIX_SSE_I387. + +2004-12-16 Uros Bizjak + + * config/i386/i386.md (sqrt{s,d}f2_1, sqrt{s,d}f2_1_sse_only, + sqrt{s,d}f2_i387): Unify enable constraint with respect to + TARGET_SSE, TARGET_SSE2, TARGET_USE_FANCY_MATH_387, + TARGET_SSE_MATH and TARGET_MIX_SSE_I387. + (sqrt{s,d}f2_1): Rename to *sqrt{s,d}f2_mixed. + (sqrt{s,d}f2_1_sse_only): Rename to *sqrt{s,d}f2_sse. + (sqrt{s,d}f2_i387): Rename to *sqrt{s,d}f2_i387. + (*sqrtextendsfdf2): Also enable for TARGET_MIX_SSE_I387. + (*sqrtextend?f?f2): Rename to *sqrtextendsfdf2_i387. + +2004-12-16 Uros Bizjak + + * config/i386/i386.md (*fop_?f_comm_{,sse,nosse}, + *fop_?f_1_{,sse,nosse}, *fop_{d,x}f_{2,3,4,5,6}): Unify enable + constraint with respect to TARGET_80387, TARGET_SSE, TARGET_SSE2, + TARGET_SSE_MATH and TARGET_MIX_SSE_I387. + (*fop_?f_{comm,1}): Rename to *fop_?f_{comm,1}_mixed. + (*fop_?f_{comm,1}_nosse): Rename to *fop_?f_{comm,1}_i387. + (*fop_{d,x}f_{2,3,4,5,6}): Rename to *fop_{d,x}f_{2,3,4,5,6}_i387. + +2004-12-15 H.J. Lu + + PR target/18153 + * configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports + -Bstatic/-Bdynamic option. + * config.in: Regenerated. + * configure: Likewise. + + * gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static + -lunwind if possible. + +2004-12-15 Daniel Berlin + + * cfgloop.c (flow_loops_dump): Don't print out levels. + (flow_loops_find): Don't set loop->levels. + (flow_loops_level_compute): Make void. + * cfgloop.h (struct loops): Remove levels member. + Add comment about loops in parray possibly being NULL. + +2004-12-15 Alexandre Oliva + + * reload.c (SMALL_REGISTER_CLASS_P): New. + (push_secondary_reload, find_reusable_reload, find_reloads): Use + it instead of testing only the class size. + +2004-12-15 Eric Botcazou + + PR c++/17972 + * tree-inline.c (expand_call_inline): Set TREE_SIDE_EFFECTS + on the STMT_EXPR wrapping up the inlined body. + +2004-12-15 Vladimir Makarov + Steven Bosscher + PR middle end/17340 + + * global.c: Update comments in a few places. + (check_earlyclobber): Return true if there are early clobber + classes. + (calculate_local_reg_bb_info): Do not try to mark earlyclobber + regs if there are none. + (bb_info, allocate_bb_info, free_bb_info, modify_reg_pav, + make_accurate_live_analysis): Rename pavin, pavout to live_pavin, + live_pavout. + (modify_bb_reg_pav): Remove. + (calculate_reg_pav): Use code from modify_bb_reg_pav. + (temp_bitmap): New variable. + (calculate_reg_pav): Allocate/deallocate temp_bitmap. + +2004-12-15 Richard Henderson + + PR target/19010 + * config/i386/i386.c (ix86_must_pass_in_stack): Don't return true + for TImode vectors. + (gen_reg_or_parallel): New. + (function_arg): Use it. + (ix86_hard_regno_mode_ok): Test SSE1 and SSE2 separately, + MMX and 3DNOW separately. + (ix86_rtx_costs): Simplify FLOAT_EXTEND case. + (ix86_vector_mode_supported_p): Test SSE1 and SSE2 separately. + * config/i386/i386.h (VALID_SSE2_REG_MODE): Move SSE2 cases from ... + (VALID_SSE_REG_MODE): ... here. + +2004-12-15 David Edelsohn + + * xcoffout.c (xcoffout_declare_function): Change strncpy to memcpy. + +2004-12-15 Ian Lance Taylor + + * config/arm/arm.c (arm_xscale_rtx_costs): Increase cost of + COMPARE of MULT. + * config/arm/arm.md (mulsi3_compare0): Don't check + arm_arch_xscale. + (mulsi_compare0_scratch, mulsi3_addsi_compare0): Likewise. + (mulsi3addsi_compare0_scratch): Likewise. + +2004-12-15 Eric Botcazou + + PR other/18665 + * libgcc-std.ver (GCC_3.4.4): Inherit from GCC_3.4.2. + Export __absvti2, __addvti3, __mulvti3, __negvti2 and __subvti3. + * libgcc2.c (__addvsi3): Rename to __addvSI3. + New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (__addvdi3): Rename to __addvDI3. + (__subvsi3): Rename to __subvSI3. Use word type for the result. + New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (__subvdi3): Rename to __subvDI3. + (_mulvsi3): Rename to _mulvSI3. + New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (_mulvdi3): Rename to _mulvDI3. + (__negvsi2): Rename to __negvSI2. + New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (__negvdi2): Rename to __negvDI2. + (__absvsi2): Rename to __absvSI2. + New version if COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (__absvdi2): Rename to __absvDI2. + * libgcc2.h (64-bit targets): Define COMPAT_SIMODE_TRAPPING_ARITHMETIC. + (__absvSI2, __addvSI3, __subvSI3, __mulvSI3, __negvSI2, __absvDI2, + __addvDI3, __subvDI3, __mulvDI3, __negvDI2): Define to the appropriate + symbol and declare. + (__absvsi2, __addvsi3, __subvsi3, __mulvsi3, __negvsi2): Declare if + COMPAT_SIMODE_TRAPPING_ARITHMETIC. + +2004-12-15 Kazuhiro Inaoka + + * config/m32r/m32r.h (PREFERRED_DEBUGGING_TYPE): + Use DWARF2_DEBUG. + + * config/m32r.c (m32r_legitimize_pic_address): Changed + to support GOTOFF relocation. + * config/m32r.md (UNSPEC_GOTOFF): New. + (gotoff_load_addr): New. + +2004-12-15 Richard Sandiford + + * config/mips/mips.c (mips_arg_info): Use FUNCTION_ARG_BOUNDARY to + decide whether an argument is double-word aligned. + +2004-12-15 Richard Henderson + + * config/i386/i386.md: Fix missing modes on cmove splitters. + +2004-12-15 Jan Beulich + + * mklibgcc.in (libgcc2_c_dep): Add dependency on libgcc2.h. + +2004-12-15 Uros Bizjak + + * config/i386/i386.md (floathisf2, *floathisf2_1, floatsisf2, + *floatsisf2_i387, *floatsisf2_sse, floatdisf2, + *floatdisf2_i387_only, *floatdisf2_i387, *floatdisf2_sse, + floathidf2, *floathidf2_1, *floatsidf2_i387, *floatsidf2_sse, + floatdidf2, *floatdidf2_i387_only, *floatdidf2_i387, + *floatdidf2_sse, floatunssisf2, floatunsdisf2, floatunsdidf2): + Unify enable constraint with respect to TARGET_80387, TARGET_SSE, + TARGET_SSE2, TARGET_64BIT, TARGET_SSE_MATH and TARGET_MIX_SSE_I387. + (*float?i?f_i387): Rename to *float?i?f2_mixed. + (*float?i?f2_1): Rename to *float?i?f2_i387. + (*float?i?f2_i387_only): Rename to *float?i?f2_i387. + (float?ixf2): Penalize integer register operand. + +2004-12-14 John David Anglin + + PR c++/17242 + * configure.ac: Add GAS check for HP-UX .nsubspa comdat. + * configure, config.in: Rebuilt. + * config/pa/pa-hpux10.h (SUPPORTS_ONE_ONLY, MAKE_DECL_ONE_ONLY): Delete + defines. + * config/pa/pa.c (pa_select_section): Allow uninitialized variables in + one-only (comdat) subspaces. + * config/pa/som.h (SUPPORTS_SOM_COMDAT): New define. + (SUPPORTS_ONE_ONLY): True if SUPPORTS_WEAK or SUPPORTS_SOM_COMDAT are + true. + (MAKE_DECL_ONE_ONLY): Place uninitialized variables in common. + +2004-12-14 Ian Lance Taylor + + * combine.c (combine_validate_cost): Consider cost of + undobuf.other_insn rather than always allowing the recombination + if it is set. + +2004-12-14 John David Anglin + + * pa-host.c (MAP_FAILED): Define if not defined. + (pa_gt_pch_use_address): Handle short reads. + +2004-12-14 Richard Henderson + + PR target/17990 + * config/i386/i386.c (x86_use_bt): New. + (ix86_expand_unary_operator): Use MEM_P. + (ix86_expand_fp_absneg_operator): New. + * config/i386/i386.h (x86_use_bt): Declare. + (TARGET_USE_BT): New. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (negsf2): Use ix86_expand_fp_absneg_operator. + (negdf2, negxf2, abssf2, absdf2, absxf2): Likewise. + (negsf2_memory, negsf2_ifs, negsf2_if, negdf2_memory, negdf2_ifs, + negdf2_ifs_rex64, negdf2_if, negdf2_if_rex64, negxf2_if, + abssf2_memory, abssf2_ifs, abssf2_if, absdf2_memory, absdf2_ifs, + absdf2_ifs_rex64, absdf2_if, absxf2_if): Remove. + (absnegsf2_mixed, absnegsf2_sse, absnegsf2_i387, absnegdf2_mixed, + absnegdf2_sse, absnegdf2_i387, absnegxf2_i387): New. Merge all + neg and abs splitters. Handle DFmode in general regs in 64-bit mode. + (negextendsfdf2, absextendsfdf2): Disable for non-mixed sse math. + (btsq, btrq, btcq): New. Add peepholes as well. + (movv4sf_internal splitter): Postpone til after reload. + (movv2di_internal splitter): Likewise. + * config/i386/predicates.md (const_0_to_63_operand): New. + (absneg_operator): New. + +2004-12-14 John David Anglin + + * pa.h (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, REGNO_OK_FOR_FP_P): + Check register number and that reg_renumber is nonzero before using it. + +2004-12-14 Steve Ellcey + + * doc/invoke.texi (IA-64 options): Add existing options that + weren't already listed. + +2004-12-14 Jeff Law + + * tree-outof-ssa.c (coalesce_abnormal_edges): Pass the correct target + partition to conflict_graph_merge_regs. + +2004-12-14 Uttam Pawar + Janis Johnson + + * rs6000.c (rs6000_handle_altivec_attribute_tree): Report errors + for vector types with invalid component types. + +2004-12-14 Jakub Jelinek + + PR middle-end/18951 + * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2, + expand_builtin_mathfn_3): Avoid using arguments passed to + save_expr after that call. + + * fold-const.c (fold_single_bit_test): If flag_syntax_only, pretend + LOAD_EXTEND_OP is not defined. + (fold): Likewise. If flag_syntax_only, don't depend on BITS_PER_WORD. + +2004-12-14 Tobias Schlueter + + * tree.def, doc/c-tree.texi: Correctly document restrictions on the + shift width. + +2004-12-14 Kazu Hirata + + * expr.h (expand_modifier): Define EXPAND_STACK_PARM as 1. + +2004-12-14 Richard Earnshaw + + PR target/18973 + arm-cores.def (arm926ej-s, arm1026ej-s, arm1136j-s, arm1136-jfs) + (arm1176jz-s, arm1176jzf-s, mpcorenovfp, mpcore): Add load-scheduling + property to flags. + +2004-12-14 Diego Novillo + + * tree-gimple.c (get_base_address): Update documentation. + +2004-12-13 Richard Henderson + + PR middle-end/17930 + * passes.c (rest_of_clean_state): Fix computation of + preferred_incoming_stack_boundary. + +2004-12-13 Wolfgang Bangerth + + * reload.h: Remove struct needs and its only use. + +2004-12-13 Roger Sayle + + PR rtl-optimization/18928 + * simplify_rtx.c (plus_minus_operand_p): New function to encode + the test for suitable operands for calls to simplify_plus_minus. + Only allow (CONST (PLUS x y)) if both x and y are CONSTANT_P. + (simplify_binary_operation): Use plus_minus_operand_p. + +2004-12-13 Alexandre Oliva + + PR tree-opt/16951 + * tree-inline.c (setup_one_parameter): Don't directly map a + parameter to the address of another variable of the same + function. + +2004-13-12 Steven Bosscher + + * basic-block.h (PROP_POSTRELOAD): Do not include PROP_AUTOINC, we + can never create autoinc insns after reload. + +2004-12-13 Jeff Law + Kazu Hirata + + PR tree-optimization/18694 + * tree-ssa-dom.c (thread_across_edge): Do not thread jumps if a + PHI argument is set from a PHI_RESULT in the same block and the + PHI argument is not the same as the PHI result. + +2004-12-13 David Edelsohn + + * xcoffout.c (xcoffout_declare_function): Always strip storage + class encoding. + +2004-12-13 Andrew Pinski + + PR target/18964 + * config/darwin.c (darwin_assemble_visibility): Fix minor diagnostic + problem, adding a space at the end of the string before concatenation. + +2004-12-13 Kazu Hirata + + * c-common.c (fname_as_string): Free namep if we are returning + cstr.text. + + * tree-ssa-dom.c (record_edge_info): Fix memory leak. + +2004-12-13 Andrew Pinski + + * tree-cfg.c (remove_useless_stmts_cond): Call fold on COND_EXPR_COND. + +2004-12-13 Kazu Hirata + + * tree-ssa-dom.c (record_equivalences_from_phis): Speed up by + doing a pointer comparison. + + * tree-ssa-dom.c (record_equivalences_from_phis): Add a + comment. + + * defaults.h, stmt.c, tree-cfg.c, tree-ssa-dce.c: Fix comment + typos. + +2004-12-13 Kazuhiro Inaoka + + * config/m32r/t-linux (SHLIB_MAPFILES): Add libgcc-glibc.ver to + the list rather than replacing the existing value. + +2004-12-13 Richard Henderson + + * cfg.c (dump_flow_info): Don't dump pseudo info after reload. + +2004-12-13 Richard Henderson + + * Makefile.in (insn-preds.o): Depend on REGS_H. + * genpreds.c (write_insn_preds_c): Include regs.h. + * config/i386/predicates.md (index_register_operand): Use + REG_OK_FOR_INDEX_STRICT_P and REG_OK_FOR_INDEX_NONSTRICT_P. + + * config/i386/i386.h (REG_CLASS_FROM_LETTER): Add 'l'. + * config/i386/i386.md (lea_general_1, lea_general_1_zext, + lea_general_2, lea_general_2_zext, lea_general_3, lea_general_3_zext, + adddi_1_rex64, addsi_1, addsi_1_zext, addhi_1_lea, addqi_1_lea, + ashldi3_1_rex64, ashlsi3_1, ashlsi3_1_zext, ashlhi3_1_lea, + ashlqi3_1_lea): Use 'l' for index register operand. + (ashldi3_1_rex64 splitter): Use index_register_operand. + (ashlsi3_1 splitter): Be more careful with modes. + +2004-12-13 Danny Smith + + PR target/18459 + * defaults.h (TARGET_USE_JCR_SECTION): New macro. + * doc/tm.texi (TARGET_USE_JCR_SECTION): Document it. + * config/i386/cygming.h (TARGET_USE_JCR_SECTION): Override + default. + +2004-12-13 Uros Bizjak + + PR target/14941 + PR target/18503 + * config/i386/i386.md (sse_movss, sse2_movsd, sse2_movhpd): + Fix wrong vec_merge selector bitmask. + +2004-12-12 Richard Henderson + + PR rtl-opt/17186 + * reg-stack.c (move_nan_for_stack_reg): New. + (subst_stack_regs_pat): Use it. + (move_for_stack_reg): Handle source register not live with a nan. + +2004-12-12 Richard Henderson + + * config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatch + errors across operations. + +2004-12-12 Di-an Jan + + * doc/passes.texi (Pass Manager): Correct list of source files. + +2004-12-12 Richard Henderson + + * expr.c (emit_move_change_mode): New. + (emit_move_via_alt_mode): Use it. + +2004-12-12 Nathanael Nerode + John David Anglin + + PR middle-end/17564 + * dojump.c (do_compare_and_jump): Only canonicalize function pointers + in a comparison if both sides are function pointers. + +2004-12-12 Richard Henderson + + PR target/18932 + * config/i386/i386.md (all splits and peepholes): Use flags_reg_operand + and compare_operator to propagate the input CC mode to the output. + * config/i386/predicates.md (compare_operator): New. + +2004-12-12 Andrew Pinski + + PR tree-opt/18040 + * expr.c (get_inner_reference): Remove NON_LVALUE_EXPR, NOP_EXPR, + CONVERT_EXPR cases. + (handled_component_p): Likewise. + +2004-12-12 Kazu Hirata + + * reg-stack.c (convert_regs_2): Free stack. + + * tree-ssa-dom.c (thread_across_edge, dom_opt_finalize_block): Fix + comment typos. + +2004-12-12 Daniel Berlin + + * tree-ssa-loop-ch.c (copy_loop_headers): Loop can be null. + * tree-ssa-loop-im.c (determine_lsm): tree_root may not have a real + inner loop. + +2004-12-12 Diego Novillo + + * tree-gimple.c (get_base_address): Update documentation. + +2004-12-12 Kazu Hirata + + * lcm.c (optimize_mode_switching): Free ptr even when mode_set + is NULL_RTX. + +2004-12-12 Roger Sayle + + * reg-stack.c (change_stack): Avoid placing the new top-of-stack in + its correct location during popping if we need to permute the stack + afterwards. Attempt to preserve the original stack ordering. + +2004-12-12 Kazu Hirata + + * lcm.c (optimize_mode_switching): Free insert and delete in + the "for" loop. + +2004-12-11 David Edelsohn + Ulrich Weigand + + PR target/18641 + * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Reload all + constants into all register classes intersecting with FLOAT_REGS + via memory. + * config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): Same. + * config/rs6000/rs6000.md (movdi_internal32): Ignore FPRs when + choosing register preferences. + (movdi_internal64): Same. + +2004-12-11 Kazu Hirata + + * tree-into-ssa.c (rewrite_ssa_into_ssa): Free SSA_NAME_AUX + before we release an SSA_NAME. + +2004-12-11 Roger Sayle + + PR middle-end/18921 + * fold-const.c (fold_unwidened_comparison): Use omit_one_operand + instead of constant_boolean_node as arg0 may have side-effects. + +2004-12-10 John David Anglin + + * pa-host.c (pa_gt_pch_use_address): Use lseek and read to copy PCH + file to anonymous private map. + +2004-12-10 Roger Sayle + + PR target/18002 + PR middle-end/18424 + * dojump.c (do_jump): When attempting to reverse the effects of + fold_single_bit_test, we need to STRIP_NOPS and narrowing type + conversions, and handle BIT_XOR_EXPR that's used to invert the + sense of the single bit test. + +2004-12-10 Devang Patel + + PR 18732 + * gcc.c (main): Do not break out of loop when error is reported while + processing one source file. + +2004-12-10 Diego Novillo + + * tree-into-ssa.c (REWRITE_THIS_STMT): Define. + (mark_def_sites): Clear REWRITE_THIS_STMT for statements that + don't need any operands rewritten. + (rewrite_stmt): Ignore statements that don't need to be + rewritten. + (rewrite_operand): Validate that an existing SSA_NAME is + identical to the current reaching definition of the operand. + +2004-12-10 Diego Novillo + + * tree-dfa.c (mark_call_clobbered_vars_to_rename): New function. + * tree-vectorizer.c (vectorizable_load): Call it. + * tree-flow.h (mark_call_clobbered_vars_to_rename): Declare. + * tree-sra.c (mark_all_v_defs): Also mark VUSEs for renaming. + +2004-12-10 Kazu Hirata + + * regmove.c (combine_stack_adjustments_for_block): Free + memlist if it hasn't been freed. + +2004-12-10 Ziemowit Laski + + * c-typeck.c (lookup_field): Check if a TYPE_LANG_SPECIFIC + pointer field is set before dereferencing it. + +2004-12-10 Andrew Pinski + + PR middle-end/18903 + * tree-cfg.c (remove_bb): Put the moved label at the beginning + of the basic block. + +2004-12-10 Kazu Hirata + + * tree-data-ref.c (free_data_refs): Free each data_reference + object. + + * tree-ssa-dom.c (thread_across_edge): Speed up by avoiding a + call to is_gimple_min_invariant if we know the result. + +2004-12-10 Jeff Law + + * tree-ssa-alias.c (setup_pointers_and_addressables): Remove + redundant test of v_ann->mem_tag_kind. + + * tree-ssa-operands.c (get_indirect_ref_operands): Remove + redundant conditional clearing opf_kill_def. + +2004-12-10 Richard Sandiford + + * config/frv/frv-modes.def: Fix comment typos. + (CC_NZ): Define new mode. + * config/frv/frv-protos.h (frv_select_cc_mode): Declare. + (condexec_intop_cmp_operator): Delete. + * config/frv/frv.c (comparison_string): New function. + (frv_print_operand): Use it to handle 'c' and 'C'. + (relational_operator): Redefine in terms of integer_relational_operator + and float_relational_operator. + (signed_relational_operator, unsigned_relational_operator): Delete. + (integer_relational_operator): New predicate, combining the above. + Check the mode of the first operand but leave frv.md to check the rest. + (float_relational_operator): Just check the mode of the first operand + and leave frv.md to check the rest. + (intop_compare_operator): Assume the result is compared with zero + in mode CC_NZmode. Allow PLUS and MINUS. Leave frv.md to check + the operand predicates. + (condexec_intop_cmp_operator): Delete. + (frv_ifcvt_modify_tests, frv_ifcvt_modify_multiple_tests) + (frv_hard_regno_mode_ok): Handle CC_NZmode. + (frv_select_cc_mode): New function. + * config/frv/frv.h (SELECT_CC_MODE): Use frv_select_cc_mode. + (REVERSIBLE_CC_MODE): Include CC_NZmode. + (PREDICATE_CODES): Replace entries for signed_relational_operand and + unsigned_relational_operator with one for integer_relational_operator. + Delete entry for condexec_intop_cmp_operator. + * config/frv/frv.md (movcc_nz, *internal_movcc_nz, reload_incc_nz) + (reload_outcc_nz, *cmpsi_cc_nz, *cond_exec_cmpsi_cc_nz): New patterns. + (*combo_intop_compare2, *combo_intop_compare4): Delete. + (*combo_intop_compare1): Change mode to CC_NZ. + (*combo_intop_compare2): Likewise. Renamed from *combo_intop_compare3. + (branch_{un,}signed_true, branch_{un,}signed_false) + (*scc_{un,}signed, *scc_neg1_{un,}signed, *ck_{un,}signed) + (*movqicc_internal1_{un,}signed, *movqicc_internal2_{un,}signed) + (*movhicc_internal1_{un,}signed, *movhicc_internal2_{un,}signed) + (*movsicc_internal1_{un,}signed, *movsicc_internal2_{un,}signed) + (*movsfcc_has_fprs_{un,}signed, *movsfcc_no_fprs_{un,}signed) + (*return_{unsigned_,}true, *return_{unsigned_,}false): Merge these + pattern pairs. Use integer_relational_operator. Remove mode from + icc_operand. + +2004-12-10 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): New fields ml, + sqdbr, sqebr. + (s390_rtx_costs): Added the missing handling of multiply & add, + square root, and umulsidi. + +2004-12-10 Kazu Hirata + + * expmed.c (synth_mult): Initialize new_limit.latency before + making a recursive call. + +2004-12-10 Nick Clifton + + * config/mn10300/mn10300.c (legitimate_address_p): Reject address + whose index is itself the sum of two other parts. + +2004-12-10 Alan Modra + + * config/t-slibgcc-sld (SHLIB_LINK): Correct symlink. + +2004-12-10 Uros Bizjak + + * config/i386/i386.md (*cmpfp_sf): Change type attribute to "multi". + +2004-12-09 Richard Henderson + + PR c/18282 + * attribs.c (decl_attributes): Use relayout_decl. + * c-common.c (handle_mode_attribute): Copy all relevant type + parameters from the new underlying integral type. + +2004-12-09 Richard Henderson + + * c-common.c (shorten_compare): Don't special-case min/maxval + for C enumerations. + +2004-12-09 Richard Sandiford + + * simplify-rtx.c (simplify_subreg): In the CONCAT case, check whether + the request subreg is entirely contained in the requested component. + (simplify_gen_subreg): Return null for CONCATs that are rejected + by simplify_subreg. + * expmed.c (store_bit_field): Create a temporary when changing the + value to an integer mode. + +2004-12-09 David Edelsohn + + * real.c (ibm_extended): Correct comment. + +2004-12-09 Stan Shebs + + * config/rs6000/darwin-asm.h: New file, 32/64-bit assembly macros + formerly in darwin-tramp.asm. + * config/rs6000/darwin-tramp.asm: Include darwin-asm.h. + * config/rs6000/darwin-fpsave.asm: Use 32/64-bit macros. + * config/rs6000/t-darwin: Add dependencies. + +2004-12-09 Richard Henderson + + PR target/17025 + * config/i386/i386.md (testqi_1_maybe_si, andqi_2_maybe_si): New. + (test_qi_1, andqi_2): Do not promote to simode. + +2004-12-09 Andrew Pinski + + PR tree-opt/18904 + * tree-chrec.c (chrec_convert): Use fold_convert + instead of convert. + +2004-12-09 Matt Rice + + PR preprocessor/18102 + * c-incpath.c (remove_duplicates): Check for construct + equality. + +2004-12-09 Dorit Naishlos + + * genopinit.c (vec_realign_store_optab): Initialization removed. + * optabs.c (optab_for_tree_code): REALIGN_STORE_EXPR case removed. + * optabs.h (optab_index): OTI_vec_realign_store Removed. + (vec_realign_store_optab): Removed. + * target-def.h (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Removed. + * target.h (builtin_mask_for_store): Removed. + * tree.def (REALIGN_STORE_EXPR): Removed. + * config/rs6000/rs6000.c (rs6000_builtin_mask_for_store): Removed. + (altivec_builtin_mask_for_store): Removed. + (altivec_init_builtins): Removed initialization of + altivec_builtin_mask_for_store. + + * doc/tm.texi (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New. + (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): New. + +2004-12-09 Nathan Sidwell + + * doc/c-tree.texi (CONSTRUCTOR): Mention RANGE_EXPRs. + + * tree.def (SET_TYPE): Remove. + (CONSTRUCTOR): Update description. + * builtins.c (type_to_class) Remove SET_TYPE case. + * dbxout.c (dbxout_type): Likewise. + * dwarf2out.c (is_base_type): Likewise. + (gen_set_type_die): Remove. + (gen_type_die): Remove SET_TYPE case. + * expr.c (count_type_elements): Likewise. + (mostly_zeroes_p): Likewise. + (store_constructor): Likewise. + * print_tree.c (print_node): Likewise. + * stor-layout.c (layout_type): Likewise. + * tree-browser.c (browse_tree): Likewise. + * tree-inline.c (remap_type): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree.c (type_contains_plaeholder_1, type_hash_eq, + variably_modified_type_p, initializer_zerop): Likewise. + * tree.h (SET_OR_ARRAY_CHECK): Remove. + (AGGREGATE_TYPE_P): Remove SET_TYPE check. + (TYPE_DOMAIN): Use ARRAY_TYPE_CHECK. + * typeclass.h (enum type_class): Remove set_type_class. + * varasm.c (const_hash_1): Remove SET_TYPE case. + (compare_constant, copy_constant, output_constant): Likewise. + * config/i386/i386.c (classify_argument): Likewise. + * config/ia64/ia64.c (hfa_element_mode): Likewise. + * config/sparc/sparc.c (sparc_type_code): Likewise. + + PR c++/16681 + * tree-inline.c (estimate_num_insns_1): Add RANGE_EXPR case. + +2004-12-08 Richard Henderson + + * config/i386/i386.md: Use FLAGS_REG everywhere. + +2004-12-08 Eric Christopher + + * config/mips/mips.c (mips_scalar_mode_supported_p): Rewrite + to avoid call to default function. + +2004-12-08 Zack Weinberg + + PR 17982 + * varasm.c (pending_assemble_externals): New static. + (assemble_external_real): Meat of assemble_external split out + to this new function. + (process_pending_assemble_externals): New function. + (assemble_external): Use gcc_assert. If flag_unit_at_a_time + is true and the basic test passes, merely cons the decl onto + the pending list to be handled later. + * tree.h: Declare process_pending_assemble_externals. + * cgraphunit.c (cgraph_optimize): Call it. + + * config/h8300/h8300.h: Do not define ASM_OUTPUT_EXTERNAL. + +2004-12-08 Kazu Hirata + + * cfgloopmanip.c (create_preheader): Speed up by "unrolling" + and simplifying FOR_EACH_EDGE. + +2004-12-08 Richard Sandiford + + * config/frv/frv.c (frv_sort_insn_group): Always initialize + packet_group->nop. + +2004-12-08 Nathan Sidwell + + PR c++/18672 + * gimplify.c (canonicalize_addr_expr): Cope with array of + incomplete type. + (gimplify_conversion): Remove redundant checks. + + * doc/trouble.texi (Non-bugs): Clarify empty loop removal. + +2004-12-08 Uros Bizjak + + * config/i386/i386.c (output_387_binary_op, + ix86_prepare_fp_compare_args): Fix is_sse condition. + +2004-12-07 Uros Bizjak + + * config/i386/i386-protos.h (ix86_split_fp_branch): New rtx + argument. + + * config/i386/i386.c (output_fp_compare): Fix is_sse condition. + Use EFLAGS_P only when fcomi insn should be used. Fix handling + of eflags_p variable. Change alt table accordingly. For non-fcomi + compare insn always use trailing fnstsw insn. Fix intmode + calculation for ficom insn. + (ix86_split_fp_branch): Add "rtx pushed" as new parameter. Call + ix86_free_from_memory when "pushed" is specified. + (ix86_expand_branch): Change call to ix86_split_fp_branch. + + * config/i386/i386.md (*cmpfp_0_sf, *cmpfp_0_df, *cmpfp_0_xf): + Change eflags_p parameter in call to output_fp_compare. + (*cmpfp_2_sf, *cmpfp_2_df, *cmpfp_2_xf): Remove. + (*cmpfp_2_sf_1, *cmpfp_2_df_1, *cmpfp_2_xf_1): Rename to + *cmpfp_2_sf, *cmpfp_2_df, *cmpfp_2_xf. Change eflags_p + parameter in call to output_fp_compare. + (*cmpfp_2_u): Remove. + (*cmpfp_2_u_1): Rename to *cmpfp_2_u. Change eflags_p parameter + in call to output_fp_compare. + (*ficom_1): Remove insn definition and corresponding define_split. + (*cmpfp_si): New insn definition. + (*fp_jcc_8): New insn definition. Add new splitters for + "memory_operand" and "register_operand". + (define_split): Add new parameter in call to ix86_split_fp_branch. + + config/i386/predicates.md (float_operator): New predicate. + +2004-12-08 Kazu Hirata + + * c-common.c (verify_tree): Don't check code length if we know + we are handling tcc_unary. + * print_tree.c (print_node): Remove code to handle RTL + appearing as a part of a tree node. + * tree-gimple.c (recalculate_side_effects): Rename fro as len. + * tree.c (build1_stat): Don't check TREE_CODE_LENGTH. + (PROCESS_ARG): Don't refer to fro. + (build2_stat, build3_stat, build4_stat): Don't compute fro. + +2004-12-07 Roger Sayle + + PR middle-end/18293 + * expmed.c (EXACT_POWER_OF_2_OR_ZERO_P): Move definition earlier. + (expand_mult): Special case powers of two to avoid synth_mult. + * loop.c (product_cheap_p): Handle case where expand_mult does + require/generate any instructions (i.e. multiplication by zero). + +2004-12-07 Richard Henderson + + * tree-pretty-print.c (dump_array_domain): Split out from + dump_generic_node; fix off-by-one error on zero-based array bounds. + (dump_generic_node): Use it. + (print_declaration): Likewise. + +2004-12-08 Richard Guenther + + * doc/invoke.texi: Adjust default values for + large-function-growth and inline-unit-growth to match + params.def. Clarify used algorithm. + +2004-12-07 David Mosberger + + PR target/18443 + * config/ia64/ia64.c (ia64_assemble_integer): Add support for + emitting unaligned pointer-sized integers. + +2004-12-07 Steven Bosscher + + PR c/18867 + * c-typeck.c (c_start_case): Set orig_type to error_mark_node + when the type of the controlling expression is not a valid type. + +2004-12-07 Steven Bosscher + + PR tree-optimization/17340 + * tree-ssa-pre.c (compute_antic): Fix comment. + (compute_avail): Do not recurse, instead do a DFS using a stack + and a loop. + (execute_pre): Adjust. + +2004-12-07 Ziemowit Laski + + * c-tree.h (struct lang_type): Rename 'objc_protocols' field + to 'objc_info'. + +2004-12-07 Eric Christopher + + PR target/16317 + * config/netbsd.h (NO_IMPLICIT_EXTERN_C): Define. + +2004-12-07 Eric Christopher + + * config/mips/mips-protos.h (mips_valid_pointer_mode): Move + prototype... + * config/mips/mips.c: ... here. Make static. + +2004-12-07 Eric Christopher + + PR target/18442 + * config/mips/mips.c (mips_vector_mode_supported_p): New function. + (TARGET_SCALAR_MODE_SUPPORTED_P): Define to above. + +2004-12-07 Kazu Hirata + + * c-common.c, expr.c, fold-const.c, print-tree.c, + tree-gimple.c, tree-inline.c, tree-pretty-print.c, + tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c: Replace uses of + first_rtl_op with TREE_CODE_LENGTH. + * tree.c (first_rtl_op): Remove. + Replace uses of first_rtl_op with TREE_CODE_LENGTH. + * tree.h: Remove the prototype for first_rtl_op. + +2004-12-07 David Edelsohn + + * config/rs6000/t-aix43, config/rs6000/t-aix52 (SHLIB_LINK): + Revert 2004-12-01 change. + +2004-12-06 Ziemowit Laski + + * c-tree.h (struct lang_type): Add 'objc_protocols' field. + +2004-12-06 DJ Delorie + + * reload.c (find_valid_class): Fix logic to test inner mode as well. + (push_reload): Pass inner mode. + +2004-12-06 Eric Christopher + + * doc/tm.texi (TARGET_VALID_POINTER_MODE): Document. + +2004-12-06 Aldy Hernandez + + * config/rs6000/sysv4.h: Define RELOCATABLE_NEEDS_FIXUP to 1. + +2004-12-06 Zdenek Dvorak + Kazu Hirata + + PR tree-optimization/18601 + * tree-cfg.c (thread_jumps, thread_jumps_from_bb): Removed. + (tree_forwarder_block_p): Do not consider blocks that are its own + successors forwarders. + (cleanup_forwarder_blocks, remove_forwarder_block): New functions. + (cleanup_tree_cfg): Use cleanup_forwarder_blocks instead of + thread_jumps. + * tree-flow.h (bb_ann_d): Remove forwardable. + +2004-12-06 Kazu Hirata + + * expr.c (expand_expr_real_1): Remove an "if" whose condition + is always false. + +2004-12-06 Roger Sayle + + * c-gimplify.c (gimplify_c_loop): Improve initial implementations + for loops whose conditions are known at compile-time. + * gimplify.c (append_to_statement_list_1): Remove side_effects + parameter, this function should never be called if its false. + (append_to_statement_list): Only call append_to_statement_list_1 + if t is non-NULL tree with side-effects. + (append_to_statement_list_force): Likewise, if t is not NULL. + +2004-12-06 J"orn Rennecke + + * bt-load.c (btr_def_s): New member own_end; + (add_btr_to_live_range): Add second parameter. Changed caller. + (clear_btr_from_live_range): Clear btrs_live_at_end bit + for the register its definition basic block if own_end is set. + (augment_live_range): Also take btrs_live_at_end into account. + (combine_btr_defs): Don't bother with + other_def->other_btr_uses_after_use if it pertains to a different + register. + (move_btr_def): Set def->other_btr_uses_before_def after + calling combine_btr_defs." + + * bt-load.c (augment_live_range): New argument full_range. + Changed all callers. + + * bt-load.c (move_tr_def): Set other_tr_uses_before_def + taking new btr assignment into account. + +2004-12-05 Daniel Berlin + + * tree-ssa-alias.c (create_global_var): Use void_type_node, + not size_type_node. + +2004-12-05 Kazu Hirata + + * expr.c (expand_expr_real_1): Abort on COND_EXPR of + VOID_TYPE. + +2004-12-05 Richard Henderson + + PR target/18841 + * config/alpha/alpha.md (UNSPECV_SETJMPR_ER): New. + (builtin_setjmp_receiver_er_sl_1): Use it. + (builtin_setjmp_receiver_er_1): Likewise. + (builtin_setjmp_receiver_er, exception_receiver_er): Remove. + (builtin_setjmp_receiver): Don't split for explicit relocs until + after reload. + (exception_receiver): Likewise. + +2004-12-05 Andrew Pinski + + * mklibgcc.in (vis_hide): Add the prototype for the test. + +2004-12-05 Roger Sayle + + * c-typeck.c (c_finish_loop): Improve initial implementations + for loops whose conditions are known at compile-time. + +2004-12-05 Kazu Hirata + + * builtins.c: Fix comment typos. + +2004-12-04 John David Anglin + + PR middle-end/18730 + * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When + the first/last insn is a sequence, return the first/last insn of the + sequence. + + PR bootstrap/18804 + * mklibgcc.in (vis_hide): Use implementation instead of declaration + for test function. + +2004-12-04 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_unaligned_load): Don't forget to + use ofs in BWX two byte special case. + (alpha_expand_unaligned_store): Likewise. + +2004-12-04 Kazu Hirata + + * gcse.c (gcse_main): Add a comment. + +2004-12-04 Andrew Pinski + + PR middle-end/17909 + * builtins.c (fold_builtin_next_arg): Export and return true + when there is a warning or an error. + (expand_builtin_va_start): When fold_builtin_next_arg returns true, + return const0_rtx. + (expand_builtin): Likewise. + * gimplify.c (gimplify_call_expr): Error out if there is not + enough arguments to va_start. Call fold_builtin_next_arg also + on the second argument. + * tree.h (fold_builtin_next_arg): Prototype. + +2004-12-04 Alan Modra + + * mklibgcc.in: Build shared libgcc and shared libunwind in gcc/. + Don't subst shlib_dir for SHLIB_LINK, SHLIBUNWIND_LINK, + SHLIB_INSTALL, and SHLIBUNWIND_INSTALL. + * config/i386/t-nwld (SHLIB_NAME): Use shlib_base_name in place of + shlib_dir and shlib_so_name. + * config/mips/t-slibgcc-irix (SHLIB_NAME): Likewise. + * config/t-libunwind-elf (SHLIB_NAME): Likewise. + * config/t-slibgcc-darwin (SHLIB_NAME): Likewise. + * config/t-slibgcc-elf-ver (SHLIB_NAME): Likewise. + * config/t-slibgcc-sld (SHLIB_NAME): Likewise. + (SHLIB_LINK): Don't use shlib_dir when creating symlink. + +2004-12-03 Roger Sayle + + * doc/tm.texi (TARGET_DELEGITIMIZE_ADDRESS): Document target hook. + +2004-12-03 Richard Henderson + + * alias.c (component_uses_parent_alias_set): Rename from + can_address_p. Return bool. Reverse the sense of the result. + Reinstate the check for alias set zero. + (get_alias_set): Update to match. + * alias.h (component_uses_parent_alias_set): Likewise. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. + * expr.c (expand_assignment): Likewise. + * expr.h: Remove commented out prototypes that were moved to alias.h. + +2004-12-03 Richard Henderson + + * doc/tm.texi (TARGET_BUILD_BUILTIN_VA_LIST): New. + (TARGET_CANNOT_FORCE_CONST_MEM): New. + +2004-12-04 Alan Modra + + PR middle end/18718 + * sched-rgn.c (schedule_region): Don't assume REG_SAVE_NOTEs are + in pairs. + * sched-ebb.c (schedule_ebb): Likewise. + +2004-12-03 Andreas Schwab + + * Makefile.in (HOSTHOOKS_DEF_H): Define. + (ggc-common.o): Depend on $(HOSTHOOKS_DEF_H). + (host-default.o): Likewise. + +2004-12-03 Eric Christopher + + * config/stormy16/stormy16.md (pushqi, popqi, pushhi, + pophi): Add number of arguments to name so that the + pattern is recognized as a named pattern. + +2004-12-03 Janis Johnson + + * doc/extend.texi (AltiVec Builtins): Fix info about signedness. + +2004-12-03 Andreas Tobler + + * config/rs6000/rs6000.c (rs6000_override_options): Protect + darwin_one_byte_bool with #if. + +2004-12-03 Paolo Bonzini + + * doc/tm.texi (Misc): Document TARGET_FOLD_BUILTIN. + +2004-12-03 H.J. Lu + + * mklibgcc.in: Put back the default set of EXTRA_MULTILIB_PART. + +2004-12-03 Richard Sandiford + + * configure.ac: Move TL_AC_GCC_VERSION into initialization section. + Set libstdcxx_incdir directly. + * configure: Regenerate. + +2004-12-03 Kazu Hirata + + * tree-ssa-dom.c (record_equivalences_from_phis): Remove an + "if" whose condition is always true. + + * cfgrtl.c (rtl_verify_flow_info_1): Use JUMP_P instead of + INSN_P. + +2004-12-02 Stan Shebs + + * config/rs6000/rs6000.c (rs6000_override_options): Make 64-bit + Darwin default to one-byte bools. + +2004-12-02 Richard Henderson + + PR 18774 + * simplify-rtx.c (simplify_immed_subreg): Fail complex modes. + +2004-12-03 Ben Elliston + + * doc/cfg.texi (Edges): Update. Document the edge_iterator data + type and its methods. + +2004-12-02 Richard Henderson + + * expr.c (write_complex_part): Use simplify_gen_subreg when the + submode is at least as large as a word. + (read_complex_part): Likewise. + +2004-12-02 H.J. Lu + + PR bootstrap/18532 + * mklibgcc.in: Build one set of EXTRA_MULTILIB_PARTS for + multilib at a time. Don't build the default set. Don't add + EXTRA_MULTILIB_PARTS to shared libunwind nor libgcc. Remove + filter for shared libunwind and libgcc. + +2004-12-02 Roger Sayle + + PR target/18759 + * config/i386/i386.c (override_options): If -fomit-frame-pointer has + already been specified, ignore the -momit-leaf-frame-pointer option. + +2004-12-02 H.J. Lu + + * varasm.c (make_decl_rtl): Add the missing `;'. + +2004-12-02 Andrew Pinski + + * tree.c (is_attribute_p): Split out to .. + (is_attribute_with_length_p): Here. Use IDENTIFIER_LENGTH instead + of strlen and compare the string lengths before calling strcmp. + (lookup_attribute): Call is_attribute_with_length_p instead of + is_attribute_p. + +2004-12-02 Devang Patel + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -gfull and -gused. + * config/rs6000/darwin.h (CC1_SPEC): Do not handle -gfull and -gused. + * config/i386/darwin.h (CC1_SPEC): Same. + +2004-12-02 Richard Henderson + + * optabs.c (lowpart_subreg_maybe_copy): New. + (expand_unop, expand_abs_nojump): Use it. + +2004-12-02 J"orn Rennecke + + * sh.md (extv, extzv): Add pattern predicate. + +2004-12-02 Kazu Hirata + + * tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF + is not null. + + * tree-cfg.c (phi_alternatives_equal): Check that PHI_ARG_DEF + is not null. + + * tree-cfg.c (thread_jumps): Reduce the size of WORKLIST. + +2004-12-02 Jeff Law + + * tree-eh.c: Revert yesterday's change. + +2004-12-02 Andrew Pinski + + * varasm.c (decode_reg_name): Revert change to check for zero + length strings. + (make_decl_rtl): Make sure that we call decode_reg_name only + when needed. + +2004-12-02 Dorit Naishlos + + PR tree-opt/18716 + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Properly set + then and else labels. + +2004-12-02 Andreas Schwab + + * Makefile.in (WERROR_FLAGS): Renamed from WERROR. + (STRICT2_WARN): Use $(WERROR_FLAGS) instead of $(WERROR). + (STAGE2_FLAGS_TO_PASS): Likewise. + + * config/i386/x-mingw32: Set WERROR_FLAGS instead of WERROR. + +2004-12-02 Richard Sandiford + + * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. Remove + now-redundant AC_SUBSTs. + * aclocal.m4: Include ../config/gcc-version.m4. + * configure: Regenerate. + +2004-12-02 Alan Modra + + * config/rs6000/rs6000.c (rs6000_assemble_integer): Put back the + #ifdef RELOCATABLE_NEEDS_FIXUP. + +2004-12-01 Roger Sayle + + PR target/9908 + * config/i386/i386.md (*call_value_1, *sibcall_value_1): Correct + Intel assembler syntax by using %A1 instead of %*%1. + +2004-12-01 Richard Henderson + + * expr.c (expand_assignment): Handle CONCAT both as a final + destination and as a middle point. + +2004-12-01 Jeff Law + + * tree-eh.c (save_eptr, save_filt): Now file scoped statics. + (honor_protect_cleanup_actions): Only create save_eptr and + save_filt if they do not already exist. + (lower_eh_constructs): Wipe all knowledge of save_eptr and + save_filt before returning. + +2004-12-02 Kazu Hirata + + * tree-phinodes.c (remove_phi_arg_num): Fix a comment. + +2004-12-02 Alan Modra + + PR target/16952 + * config/rs6000/rs6000.c (rs6000_assemble_integer): Replace + #ifdef RELOCATABLE_NEEDS_FIXUP with if. + * config/rs6000/linux.h (RELOCATABLE_NEEDS_FIXUP): Define in terms + of target_flags_explicit. + * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Ditto for biarch + case. Define as 0 for non-biarch. + +2004-12-01 Zack Weinberg + + * config/rs6000/t-aix43, config/rs6000/t-aix52 (SHLIB_LINK): + Change temporary file tag from a prefix to an infix. + +2004-12-02 Andreas Schwab + + * gcc.c (struct option_map): Add entry for "--pass-exit-codes". + +2004-12-01 Andrew Pinski + + PR tree-opt/18763 + PR tree-opt/18746 + * tree-ssa-alias.c (init_alias_info): Get statement operands for all + the statements if aliases_computed_p is true. + +2004-12-01 Mark Mitchell + + * Makefile.in (WERROR): New variable. + (STRICT2_WARN): Use it. + (STAGE2_FLAGS_TO_PASS): Likewise. + * config/i386/x-mingw32 (WERROR): Add -Wno-format. + +2004-12-01 Richard Henderson + + * expr.c (get_inner_reference): Fix thinko in REAL/IMAGPART_EXPR + offsetting. + +2004-12-01 Diego Novillo + + PR tree-optimization/18291 + * tree-ssa-copy.c (merge_alias_info): Fix merging of + flow-sensitive alias information. If the new pointer has no + name tag, copy it from the original pointer. Otherwise, make + sure that the pointed-to sets have a common intersection. + +2004-12-01 Richard Henderson + + PR rtl-opt/15289 + * emit-rtl.c (gen_complex_constant_part): Remove. + (gen_realpart, gen_imagpart): Remove. + * rtl.h (gen_realpart, gen_imagpart): Remove. + * expmed.c (extract_bit_field): Remove CONCAT hack catering to + gen_realpart/gen_imagpart. + * expr.c (write_complex_part, read_complex_part): New. + (emit_move_via_alt_mode, emit_move_via_integer, emit_move_resolve_push, + emit_move_complex_push, emit_move_complex, emit_move_ccmode, + emit_move_multi_word): Split out from ... + (emit_move_insn_1): ... here. + (expand_expr_real_1) : Use write_complex_part. + : Use read_complex_part. + * function.c (assign_parm_setup_reg): Hard-code transformations + instead of using gen_realpart/gen_imagpart. + + * expr.c (optimize_bitfield_assignment_op): Split out from ... + (expand_assignment): ... here. Use handled_component_p to gate + get_inner_reference code. Simplify MEM handling. Special case + CONCAT destinations. + + * expmed.c (store_bit_field): Use simplify_gen_subreg instead + of gen_rtx_SUBREG directly. + +2004-12-01 David Edelsohn + Nathan Sidwell + + PR target/17107 + * config/rs6000/rs6000.md (sge): Enable for non-TARGET_POWER. + (sgt): Same. + (sle): Same. + (slt): Same. + +2004-12-01 Nathan Sidwell + + PR middle-end/18667 + * params.c (set_param_value): Add range check. + * params.def: Add min and max values. Reformat long strings. + * params.h (struct param_info): Add min and max fields. + (enum compiler_param): Adjust DEFPARAM. + * toplev.c (lang_independent_params): Likewise. + +2004-12-01 Alan Modra + + PR target/12817 + * config/rs6000/rs6000.c (rs6000_emit_prologue): Use r0 for vrsave. + +2004-12-01 Joseph S. Myers + + * doc/standards.texi: Update for C99 TC2. + +2004-11-30 Jeff Law + + * sbitmap.c (sbitmap_any_common_bits): New function. + * sbitmap.h (sbitmap_any_common_bits): Prototype. + * modulo-sched.c (sms_schedule_by_order): Use sbitmap_any_common_bits + No longer allocate/free "psp", "pss" sbitmaps. + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Similarly for + the "res" sbitmap. + (group_aliases): Similarly. + +2004-11-30 Nathan Sidwell + + * tree-vectorizer.c (vect_analyze_data_refs): Reformat and avoid + uninitialized variable. + +2004-11-30 Eric Christopher + + * fold-const.c (fold_widened_comparison): Make sure that we're + passing an INTEGER_TYPE to int_fits_type_p. + (fold): Clean up comment. + +2004-11-30 Zack Weinberg + + * mklibgcc.in: Correct calculation of libgcc_s_soname and + libunwind_soname. Use $out, not $outS, in commands for + no-shared-library case. Move EXTRA_MULTILIB_PARTS rules above + library build rules, make $libunwind_so and $libgcc_s_so + depend on them in the normal fashion, and filter those objects + out of @shlib_objs@. + +2004-11-30 Janis Johnson + + * config/rs6000/altivec.h (vec_step_help): Support const vector types. + +2004-11-30 Andrew Pinski + + PR tree-opt/18298 + * tree-optimize.c (init_tree_optimization_passes): Add a may_alias + pass right after fold builtins. + +2004-11-30 Andreas Krebbel + + * config/s390/s390-modes.def: Added cc modes documentation. + * config/s390/s390.c: (s390_tm_ccmode, s390_select_ccmode, + s390_expand_addcc): Added cc mode comments. + * config/s390/s390.md: Removed old cc mode documentation. + +2004-11-30 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): New data type. + (s390_cost, z900_cost, z990_cost): New global variables. + (override_options): Initialize s390_cost. + (s390_rtx_costs): Reimplement. + +2004-11-29 Daniel Berlin + + Fix PR tree-optimization/18673 + + * tree-ssa-pre.c: Remove splay-tree.h include. + (bitmap_value_replace_in_set): Fix to add if it does not exist. + (find_or_generate_expression): Remove now-wrong condition. + (create_expression_by_pieces): Fix condition and comment reason + for it. + (insert_aux): Fix condition and comment reasons for it. + Factor insertion code from here. + (insert_into_preds_of_block): To here. Fix conditions in factored + function and comment reasons for them. + +2004-11-30 Ira Rosen + + PR tree-opt/18607 + * tree-vectorizer.c (vect_analyze_data_refs): Use temporary + variable for data_reference when looking for memtag. + +2004-11-30 Jakub Jelinek + + * c-opts.c (check_deps_environment_vars): If spec != NULL, set + deps_seen. + +2004-11-30 Dorit Naishlos + + * tree-vectorizer.c (vect_gen_niters_for_prolog_loop): Use + tree_low_cst instead of TREE_INT_CST_LOW. + +2004-11-30 Dorit Naishlos + + PR target/18173 + * tree-vectorizer.c (vect_can_force_dr_alignment_p): Return false for + decls that are assembled before vectorization takes place. + (vect_compute_data_ref_alignment): Set DECL_USER_ALIGN to 1. + +2004-11-30 Ulrich Weigand + + * passes.c (rest_of_handle_old_regalloc): Delete unreachable blocks + if local_alloc modified jumps. + +2004-11-30 Alan Modra + + * varasm.c (default_encode_section_info): Don't set SYMBOL_FLAG_SMALL + on TLS symbols. + * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Remove TLS + check. + +2004-11-30 Zack Weinberg + + * gthr-gnat.c, gthr-gnat.h, gthr.h, libgcc2.h, unwind-dw2-fde.h + * unwind.h: Surround all visibility pragmas with #ifndef HIDE_EXPORTS. + + * mklibgcc.in: Drastic restructure for comprehensibility. + Remove the old hidden-directive hack. + Eliminate support for .txt files in LIB2ADD etc (never used). + Eliminate support for assembly source files in LIB2ADDEH* and + LIBUNWIND (also never used). + Build up dependency lists for libraries incrementally. + If we have SHLIB_LINK, compile each file twice, once for the + static and once for the shared library; also probe for + -fvisibility=hidden in the generated libgcc.mk. If found, + pass that and -DHIDE_EXPORTS to the compilation of every C + source file going into the static library. If found, generate + hidden-directive lists for every assembly source file going + into the static library, but incorporate them with -include + instead of ld -r. + Write comments into generated libgcc.mk to facilitate debugging. + * Makefile.in: Pass ASM_HIDDEN_OP to mklibgcc. + * config/t-slibgcc-darwin: Define ASM_HIDDEN_OP. + + * config/darwin.h (REAL_LIBGCC_SPEC): Put -lgcc back in + -Zdynamiclib case. + +2004-11-29 Richard Henderson + + * expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR. + (handled_component_p): Likewise. + * alias.c (can_address_p): Reformat and simplify. Handle + REAL/IMAGPART_EXPR. Do not disable addressability based on + alias set zero. + * fold-const.c (build_fold_addr_expr_with_type): Remove duplicate + check for REAL/IMAGPART_EXPR. + * gimplify.c (gimplify_compound_lval): Likewise. + * tree-cfg.c (verify_expr): Likewise. + * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. + * tree-nested.c (build_addr, convert_nonlocal_reference): Likewise. + (convert_local_reference): Likewise. + * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Likewise. + +2004-11-30 Alan Modra + + * expr.c (emit_group_load_1): Don't die on const_int orig_src. + +2004-11-29 John David Anglin + + PR pch/14940 + * config/pa/pa-host.c, config/pa/x-hpux, config/pa/x-linux: New files. + * config.host (hppa*-*-hpux*, hppa*-*-linux): Define out_host_hook_obj + and host_xmake_file using new host configuration files. + +2004-11-29 Roger Sayle + + * reg-stack.c (change_stack): Improve algorithm used to pop regs + off the stack to maximize ffreep usage and reduce fxch count. + +2004-11-30 James A. Morrison + + PR middle-end/18596 + * c-decl.c (grokdeclarator): Reset DECL_INTIAL to error_mark_node + on errors. + +2004-11-30 Richard Kenner + + * expr.c (expand_expr_real_1, case NOP_EXPR): Properly handle + REDUCE_BIT_FIELD by applying it to result, not input, of conversion. + +2004-11-30 Ben Elliston + + * Makefile.in (REGS_H): Depend on $(BASIC_BLOCK_H). + +2004-11-29 Andrew Pinski + + PR c/18479 + * c-common.c (handle_visibility_attribute): When the type decl + is really a identifier node, warn about being ignored and return. + +2004-11-29 Richard Henderson + + * tree-cfg.c (tree_node_can_be_shared): Fix typo'd error_mark_node. + +2004-11-29 Steven Bosscher + + * cfgcleanup.c (outgoing_edges_match, try_crossjump_to_edge): + Remove CASE_DROPS_THROUGH checks, it is never defined. + * cfglyout.c (fixup_reorder_chain): Likewise. + * cfgrtl.c (rtl_verify_flow_info): Likewise. + * stmt.c (expand_case): Likewise. + * cfgbuild.c (make_edges): Likewise. Also remove force_fallthru, + it is now always 0. + * system.h (CASE_DROPS_THROUGH): Poison. + * doc/md.texi (casesi): Remove documentation of CASE_DROPS_THROUGH. + * doc/tm.texi (casesi): Remove documentation of CASE_DROPS_THROUGH. + + * config/v850/v850.h: Remove commented out CASE_DROPS_THROUGH. + +2004-11-29 Andrew Pinski + + PR middle-end/18725 + * tree-cfg.c (tree_node_can_be_shared): Error_mark_node can be + shared always. + +2004-11-29 Diego Novillo + + PR tree-optimization/18712 + * tree-into-ssa.c (insert_phi_nodes_for): Pass argument + WORK_STACK by reference. + Call VEC_safe_push instead of VEC_quick_push. + Update all users. + +2004-11-29 Daniel Jacobowitz + + PR c/7544 + * Makefile.in (c-lang.o): Update dependencies. + * c-lang.c: Include "c-pragma.h". + (finish_file): Call maybe_apply_pending_pragma_weaks. + * c-pragma.c (maybe_apply_pending_pragma_weaks): New function. + * c-pragma.h (maybe_apply_pending_pragma_weaks): New prototype. + +2004-11-29 Richard Henderson + + PR target/17224 + * config/ia64/predicates.md (sdata_symbolic_operand): Deny offsets + outside the referenced object. + +2004-11-29 Kazu Hirata + + * tree-if-conv.c (replace_phi_with_cond_modify_expr): Use + EDGE_PRED instead of PHI_ARG_EDGE. + * tree-ssa-live.c: Likewise. + * tree-ssa-loop-manip.c: Likewise. + * tree-ssa.c: Likewise. + + * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Speed up by + simplifying edge manipulation. + + * cfgrtl.c (rtl_tidy_fallthru_edge): Speed up by using + EDGE_COUNT. + + * tree-cfg.c (tree_redirect_edge_and_branch): Call find_edge + only when needed. + + * cfg.c (flow_obstack): Remove. + (flow_firstobj): Likewise. + (init_flow): Remove all uses of flow_obstack. + +2004-11-29 Alan Modra + + * varasm.c (default_elf_select_section_1): Only pass DECL_P decl + to named_section. + +2004-11-29 Nathan Sidwell + + * opts.c (decode_options): Do not set max-inline-insns-rtl. + (common_handle_option): Likewise. + * params.def (PARAM_MAX_INLINE_INSNS_RTL): Remove. + * params.h (MAX_INLINE_INSNS_RTL): Remove. + * doc/invoke.texi (max-inline-insns-rtl): Remove. + +2004-11-29 Alan Modra + + PR target/9571 + * varasm.c (default_elf_select_section_1): Pass decl to named_section. + +2004-11-28 Andrew Pinski + + PR middle-end/18164 + * gimplify.c (gimplify_asm_expr): If the length of an output operand + is zero, do not process it, just let it go through. + +2004-11-28 Richard Kenner + Diego Novillo + + PR/18662, also backported from tree-cleanup-branch. + * tree-ssa-ccp.c (substitute_and_fold): If replaced anything, + always call maybe_clean_eh_stmt and modify_stmt. + +2004-11-28 Richard Kenner + + PR/18664 + * tree-ssa-operands.c (build_ssa_operands, case MODIFY_EXPR): + Ignore a VIEW_CONVERT_EXPR on LHS when deciding if must or may def. + * tree-ssa-ccp.c (visit_assignment): If LHS is a VIEW_CONVERT_EXPR, + add an inverse VIEW_CONVERT_EXPR to const_val. + + PR/18657 + * tree-nested.c (check_for_nested_with_variably_modified): New. + (create_nesting_tree): Call it. + + * tree-ssa-alias.c (compute_points_to_and_addr_escapes): Remove + special code for assigning to non-pointer. + (is_escape_site): If RHS is a conversion between pointer and integer + types, this is an escape site. + + * gcse.c (insert_store): Error if try to insert store on abnormal edge. + (store_motion): Don't move store if any edge we'd want to move it + to is abnormal. + + * expr.c (expand_expr_real_1, case ARRAY_REF): Properly fold with + non-zero lower bound. + + * expr.c (categorize_ctor_elements_1, case STRING_CST): New case. + +2004-11-28 Matt Kraai + + PR diagnostic/17594 + * opts.c (find_opt): Require that the input match a switch exactly + or that the switch take a joined option to be interpreted as a + match for another language. + +2004-11-28 Andrew Pinski + + * timevar.def (TV_TREE_REDPHI): New timevar. + * tree-ssa.c (pass_redundant_phi): Use TV_TREE_REDPHI for the tv id. + +2004-11-28 Nathanael Nerode + + PR preprocessor/17651 + * c-opts.c (sanitize_cpp_opts): Make flag_no_output imply + flag_no_line_commands. + * c-ppoutput.c (pp_file_change): Remove now-redundant check of + flag_no_output. + +2004-11-28 Theodore A. Roth + + * config/avr/avr.c (avr_handle_fndecl_attribute): Generate a + warning if the function name does not begin with "__vector" and the + function has either the 'signal' or 'interrupt' attribute. + +2004-11-28 Theodore A. Roth + + * config/avr/avr.c (avr_mcu_types): Add entries for atmega48, + atmega88, atmega168, attiny13, attiny2313, at90can128, atmega165, + atmega325, atmega3250, atmega645 and atmega6450. + * config/avr/avr.h (LINK_SPEC): Ditto. + (LIB_SPEC): Ditto. + (LIBGCC_SPEC): Ditto. + (CRT_BINUTILS_SPECS): Ditto. + * config/avr/t-avr (MULTILIB_MATCHES): Ditto. + +2004-11-28 Nathanael Nerode + + PR preprocessor/17610 + * testsuite/gcc.dg/cpp/empty-include.c: New testcase. + +2004-11-28 Jeff Law + + * tree-ssa-alias.c (count_calls_and_maybe_create_global_var): New. + (pass_maybe_create_global_var): New. + * tree-pass.h (pass_maybe_create_global_var): Declare. + * tree-optimize.c (init_tree_optimization_passes): Link in + pass_maybe_create_global_var. + +2004-11-28 Richard Kenner + + * tree-inline.c (inline_forbidden_p_1, case RECORD_TYPE): Add comment. + +2004-11-28 Ulrich Weigand + + PR rtl-optimization/18420 + * simplify-rtx.c (simplify_gen_subreg): Revert 2004-10-28 change. + +2004-11-28 Steven Bosscher + John David Anglin + + * config/vax/vax.h (CASE_DROPS_THROUGH): Don't define. + * config/vax/vax.md (casesi): Emit a test-and-branch to make sure + that the case is in range, to make sure the casesi insn is always + in range and never falls through. + (casesi1): Add comment to explain why casesi never falls through. + Remove the unnamed special case casesi pattern. + +2004-11-28 Hans-Peter Nilsson + + PR target/18331 + * config/mmix/mmix.md ("*movdicc_real_reversible"): Rename from + "*movdicc_real". Only match reversible comparisons. + ("*movdicc_real_nonreversible"): New pattern, split from + "*movdicc_real". Match only nonreversible comparisons. Exclude + reversed alternatives. + ("*movdfcc_real_reversible", "*movdfcc_real_nonreversible"): + Similar. + +2004-11-27 Richard Henderson + + * config/ia64/ia64.md: Move all define_predicate's ... + * config/ia64/predicates.md: ... here. New file. + +2004-11-27 Per Bothner + + PR bootstrap/18142 + Re-applied following, with two modifications: add a URL for the + fixed cctools; only exit if $build = $target. + + 2004-10-18 Kelley Cook + * configure.ac (powerpc-*-darwin*): Require assembler to support + .machine directive. + * configure: Regenerate. + +2004-11-28 David Edelsohn + + PR target/16800 + * config/rs6000/rs6000.c (rs6000_rtx_costs): Improve accuracy of + EQ, GTU, and LTU costs. Add costs for GT, LT, and UNORDERED. + Distinguish between SImode and DImode CONST_INT. + +2004-11-28 Andreas Fischer + Alan Modra + + PR target/16343 + * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow + functions, strings and thread-local vars. + +2004-11-28 Alan Modra + + * config/rs6000/rs6000.h (WORLD_SAVE_P): Define. + * config/rs6000/darwin.h (WORLD_SAVE_P): Define. + * config/rs6000/rs6000.c (compute_save_world_info): Use WORLD_SAVE_P + to allow non-darwin ABIs to optimize away code. + (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise. + +2004-11-27 Kazu Hirata + + * tree.c (operand_equal_for_phi_arg_p): New. + * tree.h: Add a prototype for operand_equal_for_phi_arg_p. + * tree-cfg.c, tree-ssa-dom.c, tree-ssa-phiopt.c, tree-ssa.c: + Replace operand_equal_p with operand_for_phi_arg_p + appropriately. + + * bb-reorder.c (find_traces_1_round): Speed up by using + EDGE_COUNT instead of FOR_EACH_EDGE. + + * fold-const.c, config/i386/linux64.h: Fix comment typos. + +2004-11-27 John David Anglin + + PR pch/14940 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Revert 2004-11-22 change. + +2004-11-27 Kazu Hirata + + * config/i386/linux.h: Fix a comment typo. + * doc/extend.texi: Fix a typo. + +2004-11-27 Jeff Law + + * tree-cfg.c (cleanup_tree_cfg): Also return true if blocks + are merged. + +2004-11-27 Jakub Jelinek + + * config/i386/linux64.h (REG_NAME): Define. + +2004-11-27 Jakub Jelinek + + * fold-const.c (extract_muldiv_1) : If ctype is + unsigned and type signed, build ABS_EXPR with signed_type (ctype) + and only afterwards convert to ctype. + +2004-11-27 Richard Sandiford + + * config/mips/mips-protos.h (function_arg_boundary): Declare. + * config/mips/mips.h (PARM_BOUNDARY): Simplify definition. + (STACK_BOUNDARY, MIPS_STACK_ALIGN): Likewise. + (FUNCTION_ARG_BOUNDARY): Use new function_arg_boundary function. + * config/mips/mips.c (function_arg_boundary): New function. + Impose a maximum alignment of STACK_BOUNDARY. + +2004-11-27 Jakub Jelinek + + PR rtl-optimization/17825 + * combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new) + or not. + +2004-11-27 Alan Modra + + PR target/12769 + * config/rs6000/rs6000.c (init_cumulative_args): Set call_cookie + from rs6000_default_long_calls for libcalls. + +2004-11-26 Richard Kenner + + * expmed.c (extract_bit_field): When extracting from non-integer mode, + force a SUBREG into a register because we may be taking a further + SUBREG of it. + +2004-11-27 Di-an Jan + + * doc/contrib.texi (Tim Josling): Remove nesting quotation marks. + +2004-11-26 Robert Millan + + Changes for k*bsd-gnu support. + * config/i386/linux.h: Define REG_NAME to allow overriding of + register names in sc structure. + * config/i386/linux-unwind.h: Refer to sc->REG_NAME(reg) instead + of sc->reg. + * config.gcc: Detect x86_64-k*bsd-gnu systems. + +2004-11-26 Jeff Law + + * tree-ssa.c (verify_flow_sensitive_alias_info): Don't + retrieve annotations or pointer info before it's necessary. + Reorder tests for early continue of the loop. Manually CSE + SSA_NAME_VAR. + +2004-11-26 Eric Botcazou + + * target.h (struct gcc_target): New field 'dwarf_handle_frame_unspec'. + * target_def.h (TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define to 0. + (TARGET_INITIALIZER): Add TARGET_DWARF_HANDLE_FRAME_UNSPEC. + * dwarf2out.c (dwarf2out_frame_debug_expr): Allow REG->REG move + to a fixed reg if the source is the Return Address register. + Implement new Rule 15. + * doc/tm.texi (Frame Layout): Document TARGET_DWARF_HANDLE_FRAME_UNSPEC. + * config/sparc/sparc.c (TARGET_DWARF_HANDLE_FRAME_UNSPEC): Define to + sparc_dwarf_handle_frame_unspec. + (gen_save_register_window): New function. + (emit_stack_pointer_increment): Rename into gen_stack_pointer_inc. + (emit_stack_pointer_decrement): Rename into gen_stack_pointer_dec. + (expand_prologue): Adjust calls to emit_stack_pointer_{in,de}crement. + Set RTX_FRAME_RELATED_P on the appropriate insns and members of insns. + (sparc_asm_function_prologue): Do not emit call frame debugging info. + (emit_and_preserve): Adjust calls to emit_stack_pointer_{in,de}crement. + (sparc_expand_epilogue): Likewise. + (sparc_dwarf_handle_frame_unspec): New function. + * config/sparc/sparc.md (save_register_window): Remove. + (save_register_windowdi): Rewrite modelled on the callframe debug info. + (save_register_windowsi): Likewise. + +2004-11-26 Alexandre Oliva + + * config/frv/frv-protos.h: Guard ifcvt functions declarations with + BB_HEAD, not BLOCK_HEAD. + +2004-11-26 Alexandre Oliva + + * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone + scratch insns that set a register live at the join point. + +2004-11-26 Kazu Hirata + + * cse.c, tree-ssa-operands.c: Fix comment typos. + + * tree-cfg.c (tree_split_edge): Speed up by using find_edge. + +2004-11-26 James A. Morrison + + PR target/18510 + * doc/extend.texi (SPARC VIS Built-in Functions): New section. + +2004-11-26 Kazu Hirata + + * cfgrtl.c (try_redirect_by_replacing_jump): Speed up the + check that tests if all edges go to the same destination. + + * bitmap.c (bitmap_find_bit): Speed up by traversing from + head->first if that seems profitable. + +2004-11-25 Jeff Law + + * timevar.def (TV_TREE_LOOP_INIT, TV_TREE_LOOP_FINI): New timevars. + * tree-ssa-loop.c (pass_loop_init): Use TV_TREE_LOOP_INIT. + (pass_loop_done): Use TV_TREE_LOOP_FINI. + +2004-11-26 Alan Modra + + PR rtl-optimization/16356 + * config/rs6000/rs6000.md (floatdisf2_internal2): Rewrite with + separate output register and one less jump. Enable for powerpc64. + (floatdisf2): Adjust for above. + +2004-11-25 Bob Wilson + + * config/xtensa/xtensa.h (STARTFILE_SPEC): Add crt0. + (GCC_DRIVER_HOST_INITIALIZATION): Define. + +2004-11-25 Andrew Pinski + + PR middle-end/17957 + * tree-complex.c (vector_inner_type): New variable moved from + build_word_mode_vector_type. + (vector_last_type): Likewise. + (vector_last_nunits): Likewise. + (build_word_mode_vector_type): Use the new variables. + * Makefile.in (tree-complex.o): Add gt-tree-complex.h $(GGC_H). + (GTFILES): Add tree-complex.c. + (gt-tree-complex.h): New rule, add it to the rest of the gt-* rules. + +2004-11-25 Bob Wilson + + * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define + __XTENSA_WINDOWED_ABI__. + +2004-11-25 Richard Henderson + + * dwarf2out.c (dwarf2out_stack_adjust): Add after_p argument. Save + args_size adjustments for calls even with cfa as stack pointer. + Search calls for stack adjustments after the insn is issued. + (dwarf2out_frame_debug): Add after_p argument; pass it on. + * dwarf2out.h (dwarf2out_frame_debug): Update to match. + * final.c (final_start_function, final_scan_insn): Likewise. + +2004-11-25 Richard Henderson + + PR c++/6764 + * reload1.c (set_initial_eh_label_offset): New. + (set_initial_label_offsets): Use it. + +2004-11-25 Kaz Kojima + + * config/sh/sh.c (sh_output_mi_thunk): Initialize bitmap obstacks + before calling life_analysis and release them after. + +2004-11-25 Kazu Hirata + + * tree-ssa-forwprop.c (substitute_single_use_vars): Remove + duplicate code. + +2004-11-25 Andrew Pinski + + * bitmap.h (BITMAP_XMALLOC): Use BITMAP_ALLOC and not + BITMAP_OBSTACK_ALLOC. + (BITMAP_XFREE): Use BITMAP_FREE and not BITMAP_OBSTACK_FREE. + +2004-11-25 Andrew Pinski + + parts of PR rtl-opt/18463, rtl-opt/17647 + * cse.c (canon_for_address): New function. + (find_best_addr): Call canon_for_address before getting the + address's cost when checking if we should take that address. + +2004-11-25 Kazu Hirata + + * tree-phinodes.c (add_phi_arg): Take "tree" instead of + "tree *" as the first argument. + * tree-flow.h: Update the prototype of add_phi_arg. + * lambda-code.c, tree-cfg.c, tree-into-ssa.c, + tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-pre.c, + tree-ssa-threadupdate.c, tree-ssa.c, tree-tailcall.c, + tree-vectorizer.c: Update all call sites of add_phi_arg. + +2004-11-25 Nathan Sidwell + + * bitmap.c (bitmap_malloc_alloc, bitmap_malloc_free): Remove. + * bitmap.h (bitmap_malloc_alloc, bitmap_malloc_free): Remove. + (BITMAP_XMALLOC): Forward to BITMAP_OBSTACK_ALLOC. + (BITMAP_XFREE): Forward to BITMAP_OBSTACK_FREE. + +2004-11-25 Andrew MacLeod + + PR tree-optimization/18587 + * tree-flow-inline.h (mark_call_clobbered, mark_non_addressable): Flag + call clobbered caches as invalid. + * tree-ssa-operands.c (ssa_call_clobbered_cache_valid): New. Flag + indicating whether the call clobbered operand cache is valid. + (ssa_ro_call_cache_valid): New. Flag indicating whether the + pure/const call operand cache is valid. + (clobbered_v_may_defs, clobbered_vuses, ro_call_vuses): New. Cached + list of operands for cached call virtual operands. + (clobbered_aliased_loads, clobbered_aliased_stores, + ro_call_aliased_load): New. flags caching whether alias bits are + to be set in call stmt's. + (fini_ssa_operands): Remove call operand caches if present. + (get_expr_operands, get_asm_expr_operands, + get_indirect_ref_operands): Pass stmt annotation to add_stmt_operand. + (get_call_expr_operands): Add call clobbered variables first. + (add_stmt_operand): Take stmt annotation rather than stmt as a param. + (add_call_clobber_ops, add_call_read_ops): Use the call operand cache + if it is valid, otherise fill the cache. + * tree-ssa-operands.h (ssa_clobbered_cache_valid): Declare extern. + * tree-flow.h (struct var_ann_d): Add in_vuse_list and + in_v_may_def_list bits. + * tree-ssa-operands.c (cleanup_v_may_defs): New. Clear the + in_list bits for the v_may_def elements and empty the operand + build array + (finalize_ssa_vuses): Use cleanup_v_may_defs and remove redundant + VUSES by checking the in_v_may_def_list bit. + (append_v_may_def, append_vuse): Use the in_list bit rather than + scanning the array for duplicates. + +2004-11-25 Ulrich Weigand + + * config/s390/s390.c (s390_short_displacement): UNSPEC_GOTNTPOFF + displacements are not short. + +2004-11-25 Ulrich Weigand + + * config/s390/s390.c (legitimize_pic_address): Use s390_load_address + to load addresses. + +2004-11-25 Mark Mitchell + + PR c++/18001 + * c-common.h (lvalue_use): Move here from c-ctypeck.c. + (lvalue_or_else): Declare. + * c-common.c (lvalue_or_else): Move here from c-typeck.c. + * c-typeck.c (lvalue_use): Remove. + (lvalue_or_else): Remove. + + PR c++/18556 + * toplev.c (check_global_declarations): Set DECL_IGNORED_P on + unemitted variables with static storage duration. + +2004-11-25 Gerald Pfeifer + + * tree-cfg.c (tree_verify_flow_info): Do not terminate error() + message with \n. + +2004-11-25 Nathan Sidwell + + * config/rs6000/altivec.md (VIshort): New mode macro. + (altivec_vaddubs, altivec_vadduhs, altivec_vadduws): Replace + with ... + (altivec_vaddus): ... this. + (altivec_vaddsbs, altivec_vaddshs, altivec_vaddsws): Replace + with ... + (altivec_vaddss): ... this. + (altivec_vsububs, altivec_vsubuhs, altivec_vsubuws): Replace + with ... + (altivec_vsubus): ... this. + (altivec_vsubsbs, altivec_vsubshs, altivec_vsubsws): Replace + with ... + (altivec_vsubss): ... this. + (altivec_vavgub, altivec_vavguh, altivec_vavguw): Replace + with ... + (altivec_vavgu): ... this. + (altivec_vavgsb, altivec_vavgsh, altivec_vavgsw): Replace + with ... + (altivec_vavgs): ... this. + (altivec_vmsumubm, altivec_vmsumuhm): Replace with ... + (altivec_vmsumum): ... this. + (altivec_vmsummbm, altivec_vmsummhm): Replace + with ... + (altivec_vmsummm): ... this. + (altivec_vandc): Remove. + (*andc3): Renamed to ... + (andc3): ... here. Swap operand 1 and 2 numbering. + (altivec_vrlb, altivec_vrlh, altivec_vrlw): Replace + with ... + (altivec_vrl): ... this. + (altivec_vslb, altivec_vslh, altivec_vslw): Replace + with ... + (altivec_vsl): ... this. + (altivec_vsrb, altivec_vsrh, altivec_vsrw): Replace + with ... + (altivec_vsr): ... this. + (altivec_vsrab, altivec_vsrah, altivec_vsraw): Replace + with ... + (altivec_vsra): ... this. + (altivec_vsum4sbs, altivec_vsum4shs): Replace with ... + (altivec_vsum4ss): ... this. + (altivec_vperm_4si, altivec_vperm_8hi, altivec_vperm_16qi): Replace + with ... + (altivec_vperm_): ... this. + (altivec_vsel_4sf): Rename to ... + (altivec_vsel_v4sf): ... here. + (altivec_vsel_4si, altivec_vsel_8hi, altivec_vsel_16qi): Replace + with ... + (altivec_vsel_): ... this. + (altivec_vsldoi_4si, altivec_vsldoi_8hi, + altivec_vsldoi_16qi): Rename to ... + (altivec_vsldoi_v4si, altivec_vsldoi_v8hi, + altivec_vsldoi_v16qi): ... here. + (altivec_vsldoi_4sf): Rename to ... + (altivec_vsldoi_v4sf): ... here. + (altivec_predicate_v4si, altivec_predicate_v8hi, + altivec_predicate_v16qi): Replace with ... + (altivec_predicate_): ... this. + (altivec_lvebx, altivec_lvehx, altivec_lvewx): Replace + with ... + (altivec_lvex): ... this. + (altivec_stvebx, altivec_stvehx, altivec_stvewx): Replace + with ... + (altivec_stvex): ... this. + (absv16qi2, absv8hi2, absv4si2): Replace + with ... + (abs2): ... this. + (altivec_abss_v16qi, altivec_abss_v8hi, altivec_abss_v4si): Replace + with ... + (altivec_abss_): ... this. + (vec_realign_load_v16qi, vec_realign_load_v8hi, + vec_realign_load_v4si): Replace with ... + (vec_realign_load_): ... this. + * config/rs6000/rs6000.c (bdesc_3arg, bdesc_2arg): Update tweaked + insn names. + (rs6000_expand_ternop_builtin): Likewise. + +2004-11-25 Andrew Haley + + * gcc.c (process_command): Don't supply -v to linker. + +2004-11-25 Joseph S. Myers + + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Use %qs + instead of `%s' in diagnostic. + +2004-11-25 Nathan Sidwell + + * basic-block.h (OBSTACK_ALLOC_REG_SET): Adjust. + (FREE_REG_SET): Adjust. + * bitmap.c (bitmap_obstack_free): Cope with NULL bitmap. + * bitmap.h (BITMAP_OBSTACK_ALLOC): Rename to ... + (BITMAP_ALLOC): ... here. + (BITMAP_OBSTACK_FREE): Rename to ... + (BITMAP_FREE): Don't check for NULL bitmap here. + * tree-ssa-pre.c (value_insert_into_set_bitmap, + bitmap_set_new): Use new names. + + * bt-load.c (migrate_btr_defs): Remove unneeded NULL check. + * df.c (df_free): Likewise. + * ra-build.c (ra_build_free, ra_build_free_all): Likewise. + * tree-ssa-loop-ivopts.c (set_use_iv_cost): Likewise. + + * basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ... + (ALLOC_REG_SET): ... here. + (FREE_REG_SET): Adjust. + (XMALLOC_REG_SET, XFREE_REG_SET): Remove. + * bb-reorder.c (fix_crossing_conditional_branches): Adjust. + * cfglayout.c (cfg_layout_duplicate_bb): Adjust. + * cfgrtl.c (rtl_split_block, rtl_split_edge, + safe_insert_insn_on_edge, cfg_layout_split_edge): Adjust. + * flow.c (update_life_info, calculate_global_regs_live, + allocate_bb_life_data, init_propagate_block_info): Adjust. + * global.c (build_insn_chain): Adjust. + * ifcvt.c (dead_or_predicable): Adjust. + * loop-iv.c (simplify_using_initial_values): Adjust. + * recog.c (peephole2_optimize): Adjust. + * sched-deps.c (init_deps_global): Adjust. + +2004-11-25 Ralf Corsepius + + * config.gcc (avr-*-rtems*): Fix typo. + +2004-11-25 J"orn Rennecke + + * sh.c (sh_output_mi_thunk): Do not call regset_release_memory. + +2004-11-24 Jeff Law + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Reduce + the number of queries to random elements in the ai->written_vars + bitmap. + +2004-11-24 Roger Sayle + + * config/i386/i386.c (override_options): Disable x87 fancy math + intrinsics if -mfpmath= doesn't include 387 (default on x86_64). + +2004-11-24 Roger Sayle + + * configure.ac: Tweak test for HAVE_DECL_LDGETNAME to avoid a + system header conflict on AIX 5.2. + * configure: Regenerate. + +2004-11-24 Kazu Hirata + + * tree-outof-ssa.c (coalesce_abnormal_edges): Use e->dest_idx + instead of calling phi_arg_from_edge. + + * tree-phinodes.c (remove_phi_args): Replace phi_arg_from_edge + with e->dest_idx. + +2004-11-24 Ben Elliston + + * config/i386/i386.h (ASM_OUTPUT_DWARF_ADDR_CONST): Remove. + * config/i386/i386.c (i386_dwarf_output_addr_const): Likewise. + * config/i386/i386-protos.h (i386_dwarf_output_addr_const): + Likewise. + +2004-11-24 Richard Kenner + + * tree-sra.c (sra_walk_modify_expr): Handle RHS first, then LHS. + + * tree-inline.c (copy_body_r): Explicitly copy a constant if the + type will be remapped. + +2004-11-24 Steven Bosscher + + * c-opts.c (c_common_post_options): Don't clear + flag_inline_functions. + * dojump.c (clear_pending_stack_adjust): Remove check on + flag_inline_functions, it's always true. + * config/alpha/alpha.md (movdi_er_maybe_g): Remove splitter + that can never trigger. + * config/c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): Don't look at + flag_inline_trees, now that flag_inline_functions is never + cleared. + * config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Don't set + flag_inline_functions at optimization levels greater than + or equal to 3. This is already done by default. + +2004-11-24 Kazu Hirata + + * tree-outof-ssa.c (eliminate_build): Use g->e->dest_idx + instead to find the PHI argument. Do not take I as an + argument. + (eliminate_phi): Adjust the call to eliminate_build. Do not + take I as an argument. + (rewrite_trees): Adjust the call to eliminate_phi. + +2004-11-24 Richard Sandiford + + * optabs.h (force_expand_binop): Declare. + * optabs.c (force_expand_binop): Export. + * stmt.c (shift_return_value): Delete. + (expand_return): Don't call it. + * expr.h (shift_return_value): Declare. + * calls.c (shift_returned_value): Delete in favor of... + (shift_return_value): ...this new function. Leave the caller to check + for non-BLKmode values passed in the msb of a register. Take said mode + and a shift direction as argument. Operate on the hard function value, + not a pseudo. + (expand_call): Adjust accordingly. + * function.c (expand_function_start): If a non-BLKmode return value + is padded at the last significant end of the return register, use the + return value's natural mode for the DECL_RESULT, not the mode of the + padded register. + (expand_function_end): Shift the same sort of return values left by + the appropriate amount. + +2004-11-24 Matt Austern + + * recog.c (recog_memoized_1): Remove. + * recog.h (recog_memoized_1): Remove declaration. + (recog_memoized): Change from macro to inline function. + +2004-11-24 Devang Patel + + PR/18555 + * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add isysroot. + * config/darwin-c.c (darwin_register_frameworks): Use sysroot. + +2004-11-24 Devang Patel + + * gcc.c (process_command): Supply -v to linker. + +2004-11-24 David Edelsohn + Paolo Bonzini + + * config/rs6000/rs6000.c (rs6000_return_in_memory): Allow Altivec + vector modes without ALTIVEC_ABI. Use GCC vector instead of + synthetic vector. + (rs6000_pass_by_reference): Split conditional into pieces. Use + GCC vector instead of synthetic vector. + +2004-11-24 Aldy Hernandez + + * tree.c (recompute_tree_invarant_for_addr_expr): The address of a + thread-local variable is invariant. + +2004-11-24 Richard Kenner + + * tree-pretty-print.c (dump_generic_node, case POINTER_TYPE): + Handle TYPE_REF_CAN_ALIAS_ALL. + (print_declaration): Print array dimensions like dump_generic_node. + + * fold-const.c (operand_equal_p): Remove kludge allowing ARG0 and + ARG1 to be null; instead define OP_SAME and OP_SAME_NULL and use them. + +2004-11-24 Nathan Sidwell + + * bitmap.c (INLINE): Do not define. + (bitmap_elem_to_freelist, bitmap_element_free, + bitmap_element_allocate, bitmap_clear, bitmap_element_zerop, + bitmap_element_link, bitmap_find_bit): Use inline keyword/macro. + +2004-11-24 Kazu Hirata + + * tree-ssa-dom.c (cprop_into_successor_phis): Remove code to + find the index of a PHI argument. Use e->dest_idx instead. + Replace hint with index. + + * tree-ssa-dom.c (cprop_into_successor_phis): Replace index + with indx. + +2004-11-24 Diego Novillo + + * tree-ssa-alias.c (merge_pointed_to_info): Fix comment + regarding PT_MALLOC. + +2004-11-24 Joseph Myers + + * config/i386/i386.c (optimization_options): Use + SUBTARGET_OPTIMIZATION_OPTIONS. + * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define. + (TARGET_SUBTARGET_DEFAULT): Don't include + MASK_OMIT_LEAF_FRAME_POINTER. + +2004-11-24 Mark Mitchell + + * config/i386/sol2.h (X86_FILE_START_VERSION_DIRECTIVE): + Define to false. + +2004-11-24 Joseph Myers + + * config/i386/t-sol2-10 (MULTILIB_DIRNAMES, MULTILIB_OSDIRNAMES): + Use amd64 instead of 64. + +2004-11-24 Mark Mitchell + Joseph Myers + + * crtstuff.c (IN_LIBGCC2): Define it. + (EH_FRAME_SECTION_CONST): Check EH_TABLES_CAN_BE_READ_ONLY + instead of HAVE_LD_RO_RW_SECTION_MIXING. + * defaults.h (EH_TABLES_CAN_BE_READ_ONLY): New macro. + * dwarf2out.c (named_section_eh_frame_section): Check + EH_TABLES_CAN_BE_READ_ONLY. + * except.c (default_exception_section): Likewise. + * config/i386/sol2.h (EH_TABLES_CAN_BE_READ_ONLY): Define. + * doc/tm.texi (EH_TABLES_CAN_BE_READ_ONLY): Document. + +2004-11-24 Kazu Hirata + + * tree-ssa-pre.c (phi_translate): Use find_edge to find the + index of a PHI argument. + + * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use + find_edge to find the index of a PHI argument. + +2004-11-24 Steven Bosscher + + * expr.c (expand_expr_real_1): Remove cases for EXIT_BLOCK_EXPR + and LABELED_BLOCK_EXPR. + * gimplify.c (gimplify_labeled_block_expr): Remove. + (gimplify_exit_block_expr): Remove. + (gimplify_expr): Don't call them. + * tree-inline.c (copy_body_r): Don't handle EXIT_BLOCK_EXPR + and LABELED_BLOCK_EXPR. + (estimate_num_insns_1): Likewise. + (walk_tree): Likewise. + * tree-pretty-print.c (dump_generic_node): Don't handle + EXIT_BLOCK_EXPR and LABELED_BLOCK_EXPR. + * tree.def (EXIT_BLOCK_EXPR): Moved to java-tree.def. + (LABELED_BLOCK_EXPR): Likewise. + * tree.h (LABELED_BLOCK_LABEL): Moved to java-tree.h. + (LABELED_BLOCK_BODY): Likewise. + (EXIT_BLOCK_LABELED_BLOCK): Likewise. + (EXIT_BLOCK_RETURN): Removed. + +2004-11-24 Steven Bosscher + + * cfgrtl.c (rtl_delete_block): Fix comment. + * emit-rtl.c (remove_unnecessary_notes): Die if we see BLOCK_BEG + or BLOCK_END insn notes. + * jump.c (squeeze_notes): Likewise. + * haifa-sched.c (reemit_notes): Don't "re-emit" EH_REGION_BEG and + EH_REGION_END notes, we never have them to begin with. + * sched-deps.c (sched_analyze_insn): When updating loop notes, + verify that we have indeed only recorded loop notes. + (sched_analyze): Die if we see EH_REGION_BEG or EH_REGION_END notes. + Only record loop notes. + + * cfgexpand.c (tree_expand_cfg): Fix comment. + + * passes.c (rest_of_compilation): Don't do a second call to + convert_from_eh_region_ranges from here, it's already called + from cfgexpand.c. + * except.c (resolve_fixup_regions): Remove. + (remove_fixup_regions): Remove. + (convert_from_eh_region_ranges_1): Remove. + (convert_from_eh_region_ranges): Remove the case where EH is + not already lowered at the tree level. We always lower there. + +2004-11-24 Paolo Bonzini + + PR c++/16882 + * tree.c (make_vector_type): Move qualifiers to the vector type, + use the inner type's main variant and build a main variant for + the vector type if necessary. + (type_hash_eq): Check a vector type's TYPE_VECTOR_SUBPARTS. + +2004-11-24 Eric Botcazou + + * target.h (late_rtl_prologue_epilogue): Remove. + * target-def.h (TARGET_LATE_RTL_PROLOGUE_EPILOGUE): Remove. + * system.h: Poison TARGET_LATE_RTL_PROLOGUE_EPILOGUE. + * passes.c (rest_of_handle_prologue_epilogue): Remove and move + remaining bits to... + (rest_of_handle_flow2): ...here. + (rest_of_compilation): Remove call to rest_of_handle_prologue_epilogue. + * doc/tm.texi (TARGET_LATE_RTL_PROLOGUE_EPILOGUE): Remove. + +2004-11-23 Mark Mitchell + + * hwint.h (HOST_LONG_LONG_FORMAT): New macro. Use it throughout. + * config/i386/xm-mingw32.h (HOST_LONG_LONG_FORMAT): Define. + * doc/hostconfig.texi (HOST_LONG_LONG_FORMAT): Document. + +2004-11-24 Daniel Jacobowitz + + * config/i386/i386.c (override_options): Move + SUBTARGET_OVERRIDE_OPTIONS before defaulting + flag_omit_frame_pointer. + +2004-11-23 Richard Henderson + + * rtl.h (validate_subreg): Declare. + * emit-rtl.c (validate_subreg): New. + (gen_rtx_SUBREG): Use it. + * simplify-rtx.c (simplify_subreg): Likewise. + (simplify_gen_subreg): Likewise. Remove duplicate asserts. + * expr.c (emit_move_insn_1): Tidy complex move code. Use memory + fallback whenever gen_realpart/gen_imagpart would not be able to + create SUBREGs. + +2004-11-23 Richard Henderson + + * expmed.c (extract_bit_field): Use simplify_gen_subreg instead of + hard-coding avoiding calls to gen_rtx_SUBREG. Split complex return + modes to CONCAT. + +2004-11-23 Diego Novillo + + PR tree-optimization/18618 + * tree-into-ssa.c (DEF_VEC_MALLOC_P(basic_block)): Declare. + (insert_phi_nodes_for): Change third argument to VEC(basic_block). + * tree-ssa-dom.c (avail_exprs_stack): Change type to VEC(tree_on_heap). + Update all users. + (stmts_to_rescan): Likewise. + (const_and_copies_stack): Likewise. + (nonzero_vars_stack): Likewise. + (vrp_variables_stack): Likewise. + +2004-11-23 Richard Henderson + + * cse.c (record_jump_cond_subreg): New. + (record_jump_cond): Use it instead of gen_lowpart. + +2004-11-23 Daniel Jacobowitz + Joseph Myers + + * config/sol2-c.c (solaris_register_pragmas): Use + c_register_pragma_with_expansion. + * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. + * c-pragma.c (c_register_pragma): Update call to + cpp_register_pragma. + (c_register_pragma_with_expansion): New function. + (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. + * c-pragma.h (c_register_pragma_with_expansion): New prototype. + * doc/extend.texi (Solaris Pragmas): Mention macro expansion for + #pragma align. + * doc/tm.texi (c_register_pragma_with_expansion, + HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. + +2004-11-23 Richard Henderson + + * combine.c (gen_lowpart_for_combine): Factor out mode of x as well + as mode sizes into local temporaries. Unify failure path. + +2004-11-23 Richard Henderson + + * emit-rtl.c, rtl.h (subreg_hard_regno): Remove. + * caller-save.c (mark_set_regs): Use subreg_regno instead. + * final.c (alter_subreg): Likewise. + * local-alloc.c (reg_is_born): Likewise. + +2004-11-23 Richard Henderson + + * simplify-rtx.c (simplify_subreg): Use subreg_regno_offset directly + instead of using a SUBREG temporary. + +2004-11-23 Kazu Hirata + + * tree-cfg.c (tree_forwarder_block_p): Speed up by reordering + two checks. + +2004-11-23 Zack Weinberg + + * function.h (struct function): Remove calls_longjmp. + (current_function_calls_longjmp): Delete. + * tree.h (ECF_LONGJMP): Delete. + (ECF_SIBCALL, ECF_PURE, ECF_SP_DEPRESSED, ECF_ALWAYS_RETURN) + (ECF_LIBCALL_BLOCK): Everybody slide down one. + (ECF_CONST, ECF_NORETURN, ECF_SIBCALL): Clarify comments. + * builtins.c (expand_builtin_longjmp): Don't set + current_function_calls_longjmp. + * calls.c (special_function_p): Mark longjmp and siglongjmp + with ECF_NORETURN, not ECF_LONGJMP. + (emit_call_1, expand_call, emit_library_call_value_1): + Don't check for ECF_LONGJMP. + * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt) + (need_fake_edge_p): Likewise. + + * config/avr/avr.h, config/ip2k/ip2k.h: Don't define NON_SAVING_SETJMP. + * system.h: Poison NON_SAVING_SETJMP. + * function.c (use_register_for_decl) + * gcse.c (compute_hash_table_work, compute_store_table) + * postreload-gcse.c (record_opr_changes) + * reload.c (find_equiv_reg) + * reload1.c (reload) + * config/i386/i386.c (ix86_can_use_return_insn_p): + Remove code conditional on NON_SAVING_SETJMP. + * doc/tm.texi: Delete documentation of NON_SAVING_SETJMP. + + * config/i386/sysv3.h: Delete file. + * config/i386/i386.c (ix86_svr3_asm_out_constructor): Delete. + +2004-11-23 Dorit Naishlos + + * tree-vectorizer.c (vect_analyze_operations): Don't vectorize if + the vectorization factor is greater than the iteration count. + (vect_gen_niters_for_prolog_loop): No need to calculate min if the + iteration count is known. + + (vect_build_symbol_bound): Removed. Its functionality moved to + vect_generate_tmps_on_preheader. + (vect_generate_tmps_on_preheader): Moved content of + vect_build_symbol_bound here instead of calling it. Changed some + variables names. + + (vect_build_loop_niters): We don't expect a new_bb to be generated - + use gcc_assert. + (vect_gen_niters_for_prolog_loop): Likewise. + (vect_gen_niters_for_prolog_loo): Likewise. + + (slpeel_make_loop_iterate_ntimes): Use buildN instead of build. + (slpeel_add_loop_guard): Likewise. + (slpeel_tree_peel_loop_to_edge): Likewise. + (vect_do_peeling_for_alignment): Likewise. + + (vect_get_first_index): Missing space. + +2004-11-23 Ulrich Weigand + + * config/s390/s390.md ("*iordi3"): Mark commutative. + ("*iorsi3_zarch", "*iorsi3_esa"): Likewise. + +2004-11-23 Kazu Hirata + + * tree-phinode.c (resize_phi_node): Abort when LEN is strictly + greater than PHI_ARG_CAPACITY. + (reserve_phi_args_for_new_edge): Initialize the new PHI + argument to NULL_TREE. Increment PHI_NUM_ARGS. + (add_phi_arg): Add a PHI argument to the slot given by + E->dest_idx. + (remove_phi_arg_num): Do not write to PHI_ARG_EDGE. + * tree-flow-inline (phi_arg_from_edge): Return E->dest_idx. + * tree-ssa.c (ssa_redirect_edge): Check for a missing PHI + argument by looking at PHI_ARG_DEF. + (verify_phi_args): Check for a missing PHI argument. Remove + the check for duplicate PHI arguments. + * tree.h (PHI_ARG_EDGE): Redefine in terms of EDGE_PRED. + (phi_arg_d): Remove e. + + * tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up + by restricting to the case with two outgoing edges. + +2004-11-23 Andreas Krebbel + + * config/s390/s390.c (s390_backchain_string): Removed. + (s390_return_addr_rtx, s390_back_chain_rtx, s390_frame_info) + (s390_emit_prologue, s390_va_start, s390_gimplify_va_arg): + Changed users of TARGET_BACKCHAIN, TARGET_NO_BACKCHAIN and + TARGET_KERNEL_BACKCHAIN to reflect the new options. + * config/s390/s390.h (MASK_BACKCHAIN, MASK_PACKED_STACK): New macros. + (TARGET_KERNEL_BACKCHAIN): Removed. + (TARGET_BACKCHAIN): Former triple state option change to a target flag. + (TARGET_PACKED_STACK): New macro. + (TARGET_SWITCHES): New switches added. + (TARGET_OPTIONS): "backchain", "no-backchain" and "kernel-backchain" + removed. + (DYNAMIC_CHAIN_ADDRESS): Use TARGET_PACKED_STACK. + * config/s390/s390.md ("allocate_stack", "restore_stack_block") + ("save_stack_nonlocal", "restore_stack_nonlocal"): Modified to reflect + the change in target switch semantics. + * config/s390/tpf.h (TARGET_DEFAULT_BACKCHAIN): Removed. + (TARGET_DEFAULT): MASK_BACKCHAIN added. + * doc/invoke.texi: Added documentation for the new/changed options. + +2004-11-23 Uros Bizjak + + PR rtl-optimization/18614 + * simplify-rtx.c (simplify_binary_operation): Do not + simplify inner elements of constant arguments of + VEC_CONCAT insn. + +2004-11-23 Eric Botcazou + + * gthr-solaris.h (__gthread_recursive_mutex_init_function): Use + 0 instead of NULL. + +2004-11-23 Kazu Hirata + + * tree-phinode.c (make_phi_node): Use a new variable, + capacity, to receive the return value of ideal_phi_node_len. + +2004-11-23 Eric Botcazou + + * gthr-solaris.h (__gthread_recursive_mutex_t): New type. + (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Define to + __gthread_recursive_mutex_init_function. + (__gthread_key_create): Properly cast -1. + (__gthread_recursive_mutex_init_function): New function. + (__gthread_recursive_mutex_lock): Rewrite. + (__gthread_recursive_mutex_trylock): Likewise. + (__gthread_recursive_mutex_unlock): Likewise. + +2004-11-23 Ralf Corsepius + + * config/c4x/t-rtems: New. + * config.gcc: Reflect having added c4x/t-rtems. + +2004-11-23 Dorit Naishlos + + PR tree-opt/18403 + PR tree-opt/18505 + * tree-vectorizer.c (vect_create_data_ref_ptr): Use + lang_hooks.types.type_for_size instead of integer_type_node for the + type of ptr_update. + +2004-11-23 Ralf Corsepius + + * config.gcc (h8300-*-rtems*): Use h8300/t-rtems. + +2004-11-23 Ralf Corsepius + + * config/arm/t-rtems: New. + * config.gcc: Reflect having added arm/t-rtems. + +2004-11-23 Kazu Hirata + + * tree-cfg.c (tree_execute_on_growing_pred): New. + (tree_cfg_hooks): Add tree_execute_on_growing_pred. + * tree-flow.h: Add a prototype for + reserve_phi_args_for_new_edge. + * tree-phinodes.c (reserve_phi_args_for_new_edge): New. + (add_phi_arg): Don't resize a PHI array. + +2004-11-23 Ralf Corsepius + + * config.gcc: Add avr-*-rtems*. + * config/avr/t-rtems: New. + * config/avr/rtems.h: New. + +2004-11-22 Daniel Berlin + + * df.c (dataflow_set_a_op_b): Remove reslt parameter, since it's + always the same as op1. Use bitmap_ior_into and bitmap_and_into. + Add comment to function. + +2004-11-22 John David Anglin + + PR pch/14940 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __hppa__. + + PR rtl-optimization/14838 + * emit-rtl.c (get_first_nonnote_insn): Don't assume first insn is a + note. + (get_last_nonnote_insn): Don't assume last insn is a note. + +2004-11-22 Roger Sayle + + * fold-const.c (nondestructive_fold_binary_to_constant): Rename + to fold_binary_to_constant. + (nondestructive_fold_unary_to_constant): Likewise, rename to + fold_unary_to_constant. + (fold_relational_hi_lo): Update call to fold_binary_to_constant. + * tree.h (nondestructive_fold_binary_to_constant): Update prototype. + (nondestructive_fold_unary_to_constant): Likewise. + * tree-ssa-ccp.c (ccp_fold): Update calls to fold_unary_to_constant + and fold_binary_to_constant. + * tree-ssa-loop-niter.c (EXEC_BINARY, EXEC_UNARY): Delete macros. + (inverse, number_of_iterations_cond): Replace uses of EXEC_BINARY + and EXEC_UNARY with calls to fold_*nary_to_constant. + * tree-ssa-loop-ivopts.c (EXEC_BINARY, EXEC_UNARY): Delete macros. + (idx_find_step): Replace uses of EXEC_BINARY with calls to + fold_binary_to_constant. + +2004-11-22 Nick Clifton + + * sbitmap.c (sbitmap_union_of_preds): Remove redundant + initialisation of 'e'. + +2004-11-22 Roger Sayle + + * config/i386/i386.h (TARGET_USE_FANCY_MATH_387): New macro. + * config/i386/i386.c (override_options): Set MASK_NO_FANCY_MATH_387 + automatically for targets without TARGET_80387. + * config/i386/i386.md (sqrtsf2, sqrtsf2_1, sqrtsf2_i387, sqrtdf2, + sqrtdf2_1, sqrtdf2_i387, *sqrtextendsfdf2, sqrtxf2, + *sqrtextenddfxf2, *sqrtextendsfxf2, fpremxf4, fmodsf3, fmoddf3, + fmodxf3, fprem1xf4, dremsf3, dremdf3, dremxf3, *sindf2, *sinsf2, + *sinextendsfdf2, *sinxf2, *cosdf2, *cossf2, *cosextendsfdf2, + *cosxf2, sincosdf3, sincossf3, *sincosextendsfdf3, sincosxf3, + *tandf3_1, tandf2, *tansf3_1, tansf2, *tanxf3_1, tanxf2, + atan2df3_1, atan2df3, atandf2, atan2sf3_1, atan2sf3, atansf2, + atan2xf3_1, atan2xf3, atanxf2, asindf2, asinsf2, asinxf2, + acosdf2, acossf2, acosxf2, fyl2x_xf3, logsf2, logdf2, logxf2, + log10sf2, log10df2, log10xf2, log2sf2, log2df2, log2xf2, + fyl2xp1_xf3, log1psf2, log1pdf2, log1pxf2, *fxtractxf3, logbsf2, + logbdf2, logbxf2, ilogbsi2, *f2xm1xf2, *fscalexf4, expsf2, + expdf2, expxf2, exp10sf2, exp10df2, exp10xf2, exp2sf2, exp2df2, + exp2xf2, expm1df2, expm1sf2, expm1xf2, frndintxf2, rintdf2, + rintsf2, rintxf2, frndintxf2_floor, floordf2, floorsf2, + floorxf2, frndintxf2_ceil, ceildf2, ceilsf2, ceilxf2, + frndintxf2_trunc, btruncdf2, btruncsf2, btruncxf2, + frndintxf2_mask_pm, nearbyintdf2, nearbyintsf2, nearbyintxf2): + Simplify conditionals using TARGET_USE_FANCY_MATH_387. + +2004-11-22 Dale Johannesen + + * config/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Conditionalize + properly and comment. + +2004-11-22 James A. Morrison _vis, alignaddr_vis): New patterns. + +2004-11-22 Devang Patel + + * tree-if-conv.c (clean_predicate_lists): Clean all basic blocks. + +2004-11-22 Devang Patel + + * tree-if-conv.c (if_convertable_phi_p): Rename to ... + (if_convertible_phi_p): ... new name. + (if_convertable_modify_expr_p): Rename to ... + (if_convertible_modify_expr_p): ... new name. + (if_convertable_stmt_p): Rename to ... + (if_convertible_stmt_p): ... new name. + (if_convertable_bb_p): Rename to ... + (if_convertible_bb_p): ... new name. + (if_convertable_loop_p): Rename to ... + (if_convertible_loop_p): ... new name. + +2004-11-22 Eric Botcazou + + PR target/18444 + * configure.ac (threading): Accept 'posix95'. + * configure: Regenerate. + * config.gcc (i[34567]86-*-solaris2*): On Solaris up to 2.6, + include sol26.h and default to posix95 threads if have_pthread_h. + (sparc-*-solaris2*): Likewise. + * gthr.h: Include gthr-posix95.h if _PTHREADS95 is defined. + * gthr-posix95.h: New file. + * config/sol26.h: New file. + * doc/install.texi (--enable-threads): Document 'posix95'. + +2004-11-23 Ben Elliston + + * pointer-set.h (pointer_set_contains): Remove. + * pointer-set.c (pointer_set_contains): Likewise. + +2004-11-22 Dale Johannesen + + * calls.c (expand_call): Do not call preserve_temp_slots. + +2004-11-22 Kazu Hirata + + * tree-flow.h: Remove the prototype for remove_phi_arg. + Add a prototype for remove_phi_args. + * tree-phinodes.c (remove_phi_arg): Remove. + (remove_phi_args): New. + * tree-ssa.c (ssa_remove_edge): Call remove_phi_args instead + of remove_phi_arg. + + * cfg.c (unchecked_make_edge): Call execute_on_growing_pred + after making an edge. + (remove_edge): Call execute_on_shrinking_pred before removing + an edge. + (redirect_edge_succ): Call execute_on_growing_pred and + execute_on_shrinking_pred. + * cfghooks.c (execute_on_growing_pred): New. + (execute_on_shrinking_pred): Likewise. + * cfghooks.h (cfg_hooks): Add execute_on_growing_pred and + execute_on_shrinking_pred. + Add prototypes for execute_on_growing_pred and + execute_on_shrinking_pred. + * cfgrtl.c (rtl_cfg_hooks): Add NULL hooks to + execute_on_growing_pred and execute_on_shrinking_pred. + (cfg_layout_rtl_cfg_hook): Likewise. + * tree-cfg.c (tree_cfg_hooks): Likewise. + + * tree-cfg.c (tree_execute_on_shrinking_pred): New. + (tree_cfg_hooks): Use it. + * tree-ssa.c (ssa_remove_edge): Don't call remove_phi_args. + (ssa_redirect_edge): Don't call remove_phi_arg_num. + + * tree-phinodes.c (remove_phi_arg_num): Make it static. + * tree-flow.h: Remove the corresponding prototype. + + * tree-ssa.c (ssa_remove_edge): Remove. + * tree-flow.h: Remove the corresponding prototype. + * tree-cfg.c: Replace ssa_remove_edge with remove_edge. + * basic-block.h: Likewise. + * tree-if-conv.c: Likewise. + * tree-ssa-threadupdate.c: Likewise. + +2004-11-23 Ben Elliston + + * doc/cfg.texi (Maintaining the CFG): Use @ftable instead of + @table to list the BSI methods. Use individual @findex directives + instead of one with a comma-separated list of index entries. + +2004-11-22 Zdenek Dvorak + + PR tree-optimization/18529 + * fold-const.c (fold_to_nonsharp_ineq_using_bound): New function. + (simple_operand_p): Use STRIP_NOPS. Consider SSA names simple. + (fold): Call fold_to_nonsharp_ineq_using_bound. + * tree-ssa-loop-niter.c (simplify_replace_tree): New function. + (number_of_iterations_cond): Fold the expressions before futher + processing. + (tree_simplify_using_condition): Handle case when cond or expr is + an EQ_EXPR specially. + +2004-11-22 Daniel Berlin + + * tree-ssa.c (verify_ssa): SSA_OP_ALL_USES should be + SSA_OP_ALL_USES | SSA_OP_ALL_KILLS for verification purposes. + +2004-11-22 David Edelsohn + Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_return_in_memory): Test + TARGET_ALTIVEC_ABI. + (function_arg_boundary): Align 8 to 16 byte vectors like SPE. + Align 16 byte and larger vectors like Altivec. + (function_arg_advance): Pass any 16 byte vector like Altivec vector. + (function_arg): Same. + (rs6000_pass_by_references): Test TARGET_ALTIVEC_ABI. + +2004-11-22 Andrew Pinski + + PR tree-opt/18572 + * tree-sra.c (scalarize_init): Unshare the rhs before gimplifying + it. + +2004-11-22 Richard Henderson + + * function.c (assign_parm_setup_block): Revert 11-13 change to + forcably re-mode a (possibly BLKmode) hard register. + +2004-11-22 Eric Botcazou + + * config/sparc/sparc.c (mem_min_alignment): Check MEM_ALIGN. + +2004-11-22 David Edelsohn + + * config/rs6000/power4.md: Remove delay between dispatch and issue + associated with dispatch group slots 3 and 4. + * config/rs6000/power5.md: Same. + +2004-11-21 Jeff Law + + * cfg.c (cached_make_edge): Use find_edge rather than an inlined + variant. + * cfgbuild.c (make_edges): Likewise. + * cfghooks.c (can_duplicate_block_p): Likewise. + * cfgloop.c (loop_latch_edge): Likewise. + * cfgloopmanip.c (force_single_succ_latches): Likewise. + * cfgrtl.c (rtl_flow_call_edges_add): Likewise. + * predict.c (predict_loops, propagate_freq): Likewise. + * tracer.c (tail_duplicate): Likewise. + * tree-cfg.c (disband_implicit_edges): Likewise. + (tree_forwarder_block_p, tree_flow_call_edges_add): Likewise. + +2004-11-22 Nick Clifton + + * sbitmap.c (sbitmap_union_of_preds): Remove redundant + initialisation of 'e'. + +2004-11-22 Kazu Hirata + + PR rtl-optimization/18599 + * regrename.c (copyprop_hardreg_forward): Speed up by putting + BB_VISITED flags on basic blocks as we process them. + +2004-11-22 Nathan Sidwell + + PR target/18531 + * config/rs6000/altivec.md (VI_char): New mode attribute. + (addv16qi3, addv8hi3, addv4ai3): Replace with ... + (add3): ... this. + (subv16qi3, subv8hi3, subv4ai3): Replace with ... + (sub3): ... this. + (smaxv16qi3, smaxv8hi3, smaxv4ai3): Replace with ... + (smax3): ... this. + (sminv16qi3, sminv8hi3, sminv4ai3): Replace with ... + (smin3): ... this. + (umaxv16qi3, umaxv8hi3, umaxv4ai3): Replace with ... + (umax3): ... this. + (uminv16qi3, uminv8hi3, uminv4ai3): Replace with ... + (umin3): ... this. + (andv16qi3, andv8hi3, andv4ai3): Replace with ... + (and3): ... this. + (iorv16qi3, iorv8hi3, iorv4ai3): Replace with ... + (ior3): ... this. + (xorv16qi3, xorv8hi3, xorv4ai3): Replace with ... + (xor3): ... this. + (andv16qi3, andv8hi3, andv4ai3): Replace with ... + (and3): ... this. + (iorv16qi3, iorv8hi3, iorv4ai3): Replace with ... + (ior3): ... this. + (altivec_vnor): Replace with ... + (altivec_nor): ... this. + (one_cmplv16qi2, one_cmplv8hi2, one_complv4ai2): Replace with ... + (one_cmpl2): ... this. + (altivec_vandc): New expander. + (*andc3): New insn. + * config/rs6000/rs6000.c (bdesc_2arg): Adjust for new insn names. + +2004-11-22 Dorit Naishlos + + PR tree-opt/18536 + * tree-vectorizer.c (make_loop_iterate_ntimes): Use type of niters when + creating iv instead of integer_type. + (vect_build_loop_niters): Remove redundant code. + (vect_transform_loop_bound): Removed (duplicates functionality of + make_loop_iterate_ntimes. + (vect_gen_niters_for_prolog_loop): Add documentation. Call + lang_hooks.types.type_for_size to create a type of the required size. + Use that type instead of integer_type. Remove redundant code. + (vect_update_niters_after_peeling): Use type of niters instead of + integer_type. + (vect_transform_loop): Unify handling of known and unknown loop bound + cases. Call make_loop_iterate_ntimes instead of + vect_transform_loop_bound. + +2004-11-22 Andrew Pinski + + PR target/18217 + * config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Move darwin-fallback.c to + (LIB2ADDEH): Here. + +2004-11-22 Dorit Naishlos + + PR tree-opt/18544 + * tree-vectorizer.c (vect_analyze_data_refs): Fail if memtag not found. + +2004-11-22 Kazuhiro Inaoka + + * config.gcc: Use t-slibgcc-elf to build libgcc_s.so on + m32r*linux. + * config/m32r/t-linux (SHLIB_MAPFILES): Override to use + m32r/libgcc-glibc.ver. + * config/m32r/libgcc-glibc.ver: Add New file. + +2004-11-22 Nathan Sidwell + + * bitmap.h (struct bitmap_obstack): New obstack type. + (struct bitmap_head_def): Replace using_obstack with obstack + pointer. + (bitmap_default_obstack): New. + (bitmap_initialize): Make inline, does not do allocation. + (bitmap_release_memory): Remove. + (bitmap_obstack_initialize, bitmap_obstack_release): Declare. + (bitmap_obstack_alloc, bitmap_malloc_alloc, bitmap_gc_alloc, + bitmap_obstack_free, bitmap_malloc_free): Declare. + (BITMAP_OBSTACK_ALLOC, BITMAP_GGC_ALLOC, BITMAP_XMALLOC): Adjust. + (BITMAP_FREE): Replace with ... + (BITMAP_OBSTACK_FREE): ... this. + (BITMAP_XFREE): Adjust. + (BITMAP_INIT_ONCE): Remove. + * bitmap.c (bitmap_obstack, bitmap_obstack_init, bitmap_free: Remove. + (bitmap_default_obstack): New. + (bitmap_elem_to_freelist): Adjust. + (bitmap_element_allocate): Adjust. Break initialization into ... + (bitmap_obstack_initialize): ... here. + (bitmap_release_memory): Replace with ... + (bitmap_obstack_release): ... this. + (bitmap_obstack_alloc, bitmap_malloc_alloc, bitmap_gc_alloc, + bitmap_obstack_free, bitmap_malloc_free): New. + (bitmap_ior_and_compl, bitmap_ior_and_compl_into): Use + bitmap_initialize. + (bitmap_initialize): Move to bitmap.h. + * gengtype.c (open_base_files): Add obstack.h to ifiles. + * Makefile.in (BASIC_BLOCK_H, REGS_H): Add obstack.h. + * basic-block.h (INIT_REG_SET): Allocate from reg_obstack. + (INITIALIZE_REG_SET): Remove. + (FREE_REG_SET): Use BITMAP_OBSTACK_FREE. + (INIT_ONCE_REG_SET, MAX_REGNO_REG_SET): Remove. + (flow_obstack): Do not declare. + (reg_obstack): Declare. + * regs.h: Include obstack.h. + * tree-optimize.c (tree_rest_of_compilation): Initialize and + release bitmap obstack here. + * bb-reorder.c: #include regs, not basic-block. + (fix_crossing_conditional_branches): Allocate regsets from + reg_obstack. + * bt-load.c: Do not inlude bitmap.h, sbitmap.h, basic-block.h or + obstack.h. + * caller-save.c: Include regs.h earlier. + * cfg.c: Do not include basic-block.h or obstack.h. + (reg_obstack): Define. + * cfganal.c: Include obstack.h + * cfgcleanyp.c: Do not include basic-block.h. Include regs.h + earlier. + * cfglayout.c: Do not include obstack.h. + (flow_obstack): Remove declaration. + (cfg_layout_duplicate_bb): Use reg_obstack. + * cfgloop.c, cfgloopanal.c, cfgloopmanip.c: Include obstack.h. + * cfgrtl.c (rtl_split_block): Use reg_obstack. + (force_nonfallthru_and_redirect, rtl_split_edge): Likewise. + (safe_insert_insn_on_edge): Use OBSTACK_ALLOC_REG_SET, adjust. + (cfg_layout_split_edge): Use reg_obstack. + * cse.c: Include regs.h earlier. + * ddg.c: Do not include basic-block.h. + * dominance.c: Inlude obstack.h. + * flow.c (update_life_info): Use OBSTACK_ALLOC_REG_SET, adjust. + (calculate_global_regs_live): Likewise. + (allocate_bb_life_data): Use reg_obstack. + (init_propagate_block_info): Use OBSTACK_ALLOC_REGSET. + * global.c: Do not include basic-block.h. + (build_insn_chain): Use OBSTACK_ALLOC_REG_SET, adjust. + * graph.c: Include obstack.h. + * haifa-sched.c: Do not include basic-block.h. + * ifcvt.c: Use OBSTACK_ALLOC_REG_SET, adjust. + * local-alloc.c: Do not include basic-block.h. + * loop-init.c, loop-invariant.c: Include obstack.h. + * loop-iv.c: Likewise. + (simplify_using_initial_values): Use OBSTACK_ALLOC_REG_SET, + adjust. + * loop-unroll.c, loop-unswitch.c: Inlude obstack.h. + * modulo-sched.c: Do not include basic-block.h. + * passes.c (rest_of_handle_final): Do not call + regset_release_memory. + * ra-debug.c: Include regs.h earlier. Do not include + basic-block.h. + * recog.c (peephole2_optimize): Use OBSTACK_ALLOC_REG_SET, adjust. + * regclass.c (init_reg_sets): Do not call INIT_ONCE_REG_SET. + (allocate_reg_info): Do not call MAX_REGNO_REG_SET. + (regset_release_memory): Remove. + * resource.c: Do not include basic-block.h. + * rtlanal.c: Do not include basic-block.h. + * sbitmap.c: Include obstack.h. + * sched-deps.c: Do not include basic-block.h. + (reg_pending_sets_head, reg_pending_clobbers_head, + reg_pending_uses_head): Remove. + (init_deps_global): Use OBSTACK_ALLOC_REG_SET. + * sched-ebb.c: Do not include basic-block.h. + * sched-rgn.c: Likewise. + * tree-if-conv.c (get_loop_body_in_if_conv_order): Use + BITMAP_XFREE. + * tree-outof-ssa.c (perform_edge_inserts): Use BITMAP_XFREE. + * tree-sra.c (decide_instantiations): Adjust bitmap + initialization. + * tree-ssa-dce.c: Include obstack.h. + * tree-ssa-pre.c (grand_bitmap_obstack): Make a bitmap_obstack. + (value_insert_into_set_bitmap): Remove useless bitmap_clear. + (bitmap_set_new): Likewise. + (init_pre): Initialize bitmap obstack. + (fini_pre): Release bitmap obstack. + * tree-ssanames.c (ssa_names_to_rewrite): Make static. + (marked_for_rewrite_p): ssa_names_to_rewrite is never NULL. + (mark_for_rewrite, unmark_for_rewrite): Likewise. + (marked_ssa_names): Likewise. + (init_ssanames): Use BITMAP_XMALLOC. + (fini_ssanames): Use BITMAP_XFREE. + * web.c: Include obstack.h + +2004-11-22 Nick Clifton + + * sbitmap.c (sbitmap_union_of_preds): Set 'e' to the next edge + predecessor in the first for-loop. + +2004-11-21 Stan Shebs + + * config/rs6000/rs6000.c: (rs6000_darwin64_function_arg): Add + UNION_TYPE case. + (function_arg): Move darwin test up, sniff mode first for + efficiency, test for union type. + +2004-11-21 Dale Johannesen + + * config/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Define. + +2004-11-21 Jeff Law + + * tree-ssa.c (verify_use): Fix comment. + (verify_phi_args): Check that the number of incoming edges matches + the number of PHI arguments. Check that each PHI argument is + either an SSA_NAME or an invariant. Coalesce tests for PHIs for + dead or duplicated edges. Clear e->aux earlier and avoid separate + loop to clear e->aux and test for missed edges. + (verify_ssa): Remove first walk over statements. Move checking + of PHI args into verify_phi_args. Move checking of statements + with aliased stores and V_MAY_DEFS into the remaining loop over + the statements. Register defs by walking through the formal + SSA_NAME table. + +2004-11-21 Roger Sayle + + PR middle-end/18520 + * dojump.c (compare_from_rtx): Clarify mode argument in function + description. Correct order of mode/cmp_mode arguments in call to + simplify_relational_operation. Check "tem" for COMPARISON_P. + +2004-11-21 Paolo Bonzini + David Edelsohn + + PR target/17836 + * config/rs6000/rs6000.c (rs6000_return_in_memory): Return + synthetic vectors in memory. + (function_arg_boundary): Align large synthetic vectors. + (rs6000_pass_by_reference): Pass synthetic vectors in memory. + +2004-11-21 Jeff Law + + * cfg.c (update_bb_profile_for_threading): Do not rescale the + successor probabilities if they are not going to change. Pull + division out of loop if we do need to rescale successor probabilities. + + * tree-ssa-threadupdate.c (redirection_data_hash): Use the + index of the destination block for the hash value rather than + hashing a pointer. + +2004-11-20 Joseph S. Myers + + * c-typeck.c (build_array_ref): Don't check for index == 0. Make + checks for neither argument being an array or pointer (swapping + the arguments if necessary), the array argument being a pointer to + or array of functions and for -Wchar-subscripts warnings upfront. + +2004-11-20 Jeff Law + + * regrename.c (copyprop_hardreg_forward): Only search for a + previously processed block if the current block only has one + predecessor. + +2004-11-20 Kazu Hirata + + * tree-ssa-threadupdate.c, tree-vectorizer.c: Fix comment + typos. + * config/arm/arm.c: Follow spelling conventions. + +2004-11-20 Richard Earnshaw + + * arm.c (arm_override_options): Use arm_ld_sched rather than testing + a bit in tune_flags. + (const_double_needs_minipool): Likewise. Split most of the code out + into ... + (arm_const_double_inline_cost): ... new function here. + * arm-protos.h (arm_const_double_inline_cost): Add prototype. + * arm.h (EXTRA_CONSTRAINT_STR_ARM): Add D[abc] constraints for double- + word constants of length 2, 3 and 4 insns respectively. + (CONSTRAINT_LEN): The 'D' prefix is a 2-letter constraint. + * arm.md (arm_movdi, movdf_soft_insn): Add alternatives for D[abc] + constraints. Set insn lenghts accordingly. + +2004-11-19 Jeff Law + + * tree-ssa-threadupdate.c: Replace REDIRECTION_DATA varray with + a hash table. Extensive modifications throughout to support + that change. + (struct el): New. + (struct local_info): New. + (struct redirection_data): Add new INCOMING_EDGES and DO_NOT_DUPLICATE + fields. + (redirection_data): Now a hashtable. + (redirection_data_hash, redirection_data_eq): New. + (lookup_redirection_data, create_duplicates): New. + (create_edge_and_update_destionation_phis): New. + (fixup_template_block, redirect_edges): New. + (thread_block): Use hash table traversals instead of loops over + varray entries or incoming edge vectors. + +2004-11-19 Kazu Hirata + + * basic-block.h (edge_def): Add dest_idx. + * cfg.c (unchecked_make_edge): Initialize dest_idx. + (remove_edge): Simplify the disconnection of an edge from its + destination. + (redirect_edge_succ): Likewise. + * cfghooks.c (verify_flow_info): Check the consistency of + dest_idx for each edge. + +2004-11-19 Aldy Hernandez + + * simplify-rtx.c (simplify_ternary_operation): Use + gen_int_mode. + +2004-11-19 Kazu Hirata + + * tree-cfg.c (reinstall_phi_args): New. + (tree_split_edge): Use it after redirecting an edge. Don't + modify PHI_ARG_EDGE. + +2004-11-19 Andreas Tobler + + * tree-vectorizer.c (slpeel_verify_cfg_after_peeling): Define only + if checking is enabled. + +2004-11-19 Joseph S. Myers + + * c-decl.c (push_scope): Remove "\n" from end of diagnostic for + too many nested scopes. + +2004-11-19 Dorit Naishlos + + PR tree-opt/18181 + * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Peeling scheme + changed to suppoer uses-after-loop and to void creating flow paths + that shouldn't exist. + (slpeel_update_phi_nodes_for_guard): Takes additional two arguments. + Modified to fit the new peeling scheme. Avoid quadratic behavior. + (slpeel_add_loop_guard): Takes additional argument. + (slpeel_verify_cfg_after_peeling): New function. + (vect_update_ivs_after_vectorizer): Takes additional argument. Updated + documentation. Use 'exit-bb' instead of creating 'new-bb'. + (rename_variables_in_bb): Don't update phis for BBs out of loop, to fit + the new peeling scheme. + (copy_phi_nodes): Function removed. Its functionality moved to + update_phis_for_duplicate_loop. + (slpeel_update_phis_for_duplicate_loop): Functionality of copy_phi_nodes + moved here. Added documentation. Modified to fit the new peeling scheme. + (slpeel_make_loop_iterate_ntimes): Setting loop->single_exit not not + needed - done in slpeel_tree_peel_loop_to_edge. + (slpeel_tree_duplicate_loop_to_edge_cfg): Debug printouts compacted. + (vect_do_peeling_for_loop_bound): Add documentation. Call + slpeel_verify_cfg_after_peeling. Call vect_update_ivs_after_vectorizer + with additional argument. + (vect_do_peeling_for_alignment): Call slpeel_verify_cfg_after_peeling. + + (vect_finish_stmt_generation): Avoid 80 column oveflow. + +2004-11-19 Dorit Naishlos + + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Last two + arguments removed. + (slpeel_tree_peel_loop_to_edge): Call slpeel_make_loop_iterate_ntimes + without last two arguments. Update single_exit of loops. + (vect_update_niters_after_peeling): Removed. Its functionality was + moved to vect_do_peeling_for_alignment. + (vect_do_peeling_for_loop_bound): New name for function previously + called vect_transform_for_unknown_loop_bound. + (vect_transform_loop_bound): Call slpeel_make_loop_iterate_ntimes + instead of code that duplicates the same functionality. + (vect_do_peeling_for_alignment): Functionality of + vect_update_niters_after_peeling moved here. + (vect_transform_loop): Unify call to vect_do_peeling_for_loop_bound - + previously named vect_transform_for_unknown_loop_bound - for both known + and unknown loop bound cases. + +2004-11-19 Dorit Naishlos + + * tree-vectorizer.c (slpeel_can_duplicate_loop_p): New name for function + previously called verify_loop_for_duplication. All conditions compacted + into one compound condition. Removed debug dumps. + (vect_analyze_loop_with_symbolic_num_of_iters): Removed. Some of the + functionality moved to vect_can_advance_ivs_p, and some to + vect_analyze_loop_form. + (vect_can_advance_ivs_p): New function. Contains functionality that was + taken out of vect_analyze_loop_with_symbolic_num_of_iters. + (slpeel_tree_peel_loop_to_edge): Call slpeel_can_duplicate_loop_p. + (vect_analyze_operations): Call vect_can_advance_ivs_p and + slpeel_can_duplicate_loop_p. + (vect_get_loop_niters): Added documentation. + (vect_analyze_loop_form): Check the loop entry always - not only in case + of unknown loop bound. Create preheader and exit bb if necessary. Apply + a check that used to take place in + vect_analyze_loop_with_symbolic_num_of_iters. + (vectorize_loops): Call verify_loop_closed_ssa under ENABLE_CHECKING. + Remove redundant call to rewrite_into_loop_closed_ssa. + (vect_compute_data_refs_alignment): Removed obsolete comment. + +2004-11-19 Dorit Naishlos + + * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): New name for + function previously called tree_duplicate_loop_to_edge. + (slpeel_tree_duplicate_loop_to_edge_cfg): New name for function + previously called tree_duplicate_loop_to_edge_cfg. + (slpeel_update_phis_for_duplicate_loop): Prefix 'slpeel' added to + function name. + (slpeel_update_phi_nodes_for_guard): Likewise. + (slpeel_make_loop_iterate_ntimes): Likewise. + (slpeel_add_loop_guard): Likewise. + (allocate_new_names, free_new_names): Function declaration moved to top + of file. + (rename_use_op, rename_def_op): Likewise. + (rename_variables_in_bb, rename_variables_in_loop): Likewise. + (vect_generate_tmps_on_preheader): Function declaration moved. + (vect_transform_for_unknown_loop_bound): Added missing function + declaration. + +2004-11-19 Andrew Pinski + + PR tree-opt/18507 + * tree-flow.h (tree_on_heap): Typedef because there is already a VEC(tree). + Define a VEC(tree_on_heap) for head. + (register_new_def): Change second argument to be a VEC(tree_on_heap). + * tree-ssa-dom.c (block_defs_stack): Change to be a VEC(tree_on_heap). + (tree_ssa_dominator_optimize): Initialize block_defs_stack with + the VEC(tree_on_heap) function. Also free it before returning. + (dom_opt_initialize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE + for block_defs_stack. + (restore_currdefs_to_original_value): Use VEC_length instead of + VARRAY_ACTIVE_SIZE. VEC_pop instead of VARRAY_TOP_TREE/VARRAY_POP. + (dom_opt_finalize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE + for block_defs_stack. + * tree-into-ssa.c (block_defs_stack): Change to be a VEC(tree_on_heap). + (rewrite_initialize_block): Use VEC_safe_push instead of VARRAY_PUSH_TREE + for block_defs_stack. + (ssa_register_new_def): Likewise. + (ssa_rewrite_initialize_block): Likewise. + (rewrite_finalize_block): Use VEC_length instead of + VARRAY_ACTIVE_SIZE. VEC_pop instead of VARRAY_TOP_TREE/VARRAY_POP. + (ssa_rewrite_finalize_block): Likewise. + (register_new_def): Change second argument to be a VEC(tree_on_heap). + Use VEC_safe_push instead of VARRAY_PUSH_TREE. + (rewrite_blocks): Initialize block_defs_stack with + the VEC(tree_on_heap) function. Also free it before returning. + (rewrite_ssa_into_ssa): Likewise. + +2004-11-19 Fariborz Jahanian + + * config/darwin.c (machopic_data_defined_p): return 1 for + MACHOPIC_DEFINED_FUNCTION. + +2004-11-19 Jeff Law + + * tree-ssa.c (verify_ssa): Remove redundant checking of PHI + arguments. + +2004-11-19 Paul Brook + + PR target/17735 + * varasm.c (default_assemble_integer): Allow pointer-sized values. + Expand comment. + +2004-11-19 Nick Clifton + + * config/stormy16/stormy16.c (combine_bnp): Add code to handle + zero_extension and lshiftrt insns. + Replace uses of XEXP(...) with either SET_DEST() or SET_SRC() + where appropriate. + * config/stormy16.stormy16.md (bclrx3, bsetx3): New patterns + to handle bp and bn insn patterns with a zero_extend rtx + inside them. + +2004-11-19 Ian Lance Taylor + + * config/arm/arm.md (generic_sched): Make const. + +2004-11-19 Kazu Hirata + + * emit-rtl.c (classify_insn): Make it static. + * rtl.h: Remove the corresponding prototype. + + * integrate.c (has_func_hard_reg_initial_val, + get_func_hard_reg_initial_val): Make them static. + * integrate.h: Remove the corresponding prototypes. + +2004-11-19 Ben Elliston + + * dwarf2asm.h (dw2_asm_output_pcel): Stub out with #if 0. + (dw2_asm_output_delta_sleb128): Likewise. + * dwarf2asm.c (dw2_asm_output_pcrel): Likewise. + (dw2_asm_output_delta_sleb128): Likewise. + +2004-11-19 Adam Nemet + + * tree-ssa-alias.c: Fix comment. + +2004-11-19 Kazu Hirata + + * tree-outof-ssa.c: Fix a comment typo. + +2004-11-19 Ben Elliston + + * predict.h (predict_insn): Remove extern declaration. + * predict.c (predict_insn): Make static. + +2004-11-19 Alan Modra + + * config/rs6000/rs6000.c (function_arg): Don't return BLKmode regs. + +2004-11-18 Nicolas Pitre + + * config/arm/arm.c (const_double_needs_minipool): New function to + determine if a CONST_DOUBLE should be pushed to the minipool. + (note_invalid_constants): Use it. + +2004-11-18 Paul Brook + + * config/arm/arm.c (target_float_switch): New variable.. + (arm_override_options): Use TARGET_DEFAULT_FLOAT_ABI and + target_float_switch. + * config/arm/arm.h (target_float_switch): Declare. + (ARM_FLAG_SOFT_FLOAT): Remove. + (TARGET_SWITCHES): Remove hard-float and soft-float. + (TARGET_OPTIONS): Add hard-float and soft-float. + (TARGET_DEFAULT_FLOAT_ABI): Define. + * config/arm/coff.h (TARGET_DEFAULT_FLOAT_ABI): Define + (TARGET_DEFAULT): Don't use ARM_FLAG_SOFT_FLOAT. + * config/arm/elf.h: Don't use ARM_FLAG_SOFT_FLOAT. + * config/arm/netbsd-elf.h: Ditto. + * config/arm/netbsd.h: Ditto. + * config/arm/pe.h: Ditto. + * config/arm/unknown-elf.h: Ditto. + * config/arm/wince-pe.h: Ditto. + * config/arm/linux-elf.h (TARGET_DEFAULT_FLOAT_ABI): Define. + * config/arm/semi.h (TARGET_DEFAULT_FLOAT_ABI): Define. + * config/arm/semiaof.h (TARGET_DEFAULT_FLOAT_ABI): Define. + +2004-11-18 Nathan Sidwell + + * config/rs6000/altivec.md (VI, VF, V): New mode macros. + (altivec_lvx_4si, altivec_lvx_8hi, altivec_lvx_16qi, + altivec_lvx_4sf): Rename and replace with ... + (altivec_lvx_): ... mode macro version. + (altivec_stvx_4si, altivec_stvx_8hi, altivec_stvx_16qi, + altivec_stvx_4sf): Rename and replace with ... + (altivec_stvx_): ... mode macro version. + (movv4si, movv8hi, movv16qi, movv4sf}): Replace with ... + (mov): ... mode macro version. + (*movv4si_internal, *movv8hi_internal1, *movv16qi_internal1, + *movv4sf_internal1): Replace with ... + (*mov_internal): ... mode macro version. + (get_vrsave_internal, *set_vrsave_internal, *save_world, + *restore_world): Unquote output statements. + * config/rs6000/rs6000.c (altivec_expand_ld_builtin, + altivec_expand_st_builtin): Adjust insn names. + +2004-11-18 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_complex_function_value): Revert + previous change. + (rs6000_override_options): Likewise. + (spe_build_register_parallel): Handle complex doubles on e500v2. + (rs6000_spe_function_arg): Likewise. + (function_arg): Likewise. + (rs6000_function_value): Likewise. + (rs6000_libcall_value): Likewise. + +2004-11-18 Andrew Pinski + + * ifcvt.c (find_if_block): Move the check for the number of edges + above the loops checking for complex edges. + Remove the counting of edges as we use EDGE_COUNT now. + +2004-11-18 Kazuhiro Inaoka + + * config/m32r/linux.h (TARGET_ASM_FILE_END): Set + TARGET_ASM_FILE_END to file_end_indicate_exec_stack. + +2004-11-18 Andreas Schwab + + * config/i386/i386.md (define_peephole2): Revert last change. + +2004-11-18 Kazuhiro Inaoka + + * config/m32r/linux.h (TARGET_ASM_FILE_END): Set + TARGET_ASM_FILE_END to file_end_indicate_exec_stack. + +2004-11-18 Diego Novillo + + * tree-ssa-propagate.c (ssa_prop_init): Use FOR_ALL_BB instead + of FOR_EACH_BB. + +2004-11-18 Jon Grimm + + * Makefile.in (macro_list): Depend on s-macro_list. + (s-macro_list): New target. + +2004-11-18 Nathan Sidwell + + PR target/17107 + * fold-const.c (RANGE_TEST_NON_SHORT_CIRCUIT): Rename to ... + (LOGICAL_OP_NON_SHORT_CIRCUIT): ... here. + (fold_range_test): Adjust. + (fold_truthop): Use it. + * config/rs6000/rs6000.h (RANGE_TEST_NON_SHORT_CIRCUIT): Rename to ... + (LOGICAL_OP_NON_SHORT_CIRCUIT): ... here. + +2004-11-18 Uros Bizjak + + * configure/i386/i386.md (*fix_trunch_1): Add "&& 1" to + insn split constraint. + (define_peephole2): Remove unneeded "&& 1" from peephole2 + constraints. + +2004-11-18 Ben Elliston + + * doc/cfg.texi (Maintaining the CFG): Remove duplicated @item + element for bsi_prev; use @findex instead. + +2004-11-18 Ben Elliston + + * opts.h (add_input_filename): Remove extern declaration. + * opts.c (add_input_filename): Make static. + +2004-11-17 Mark Mitchell + + * config/i386/i386.c (i386_solaris_elf_named_section): Mark with + ATTRIBUTE_UNUSED. + +2004-11-17 Zack Weinberg + + * defaults.h, config/darwin.h: Don't define TARGET_SUPPORTS_HIDDEN. + * system.h: Poison it. + * doc/tm.texi: Delete its documentation. + +2004-11-18 Daniel Jacobowitz + Mark Mitchell + + * config/i386/sol2-10.h, config/i386/t-sol2-10: New files. + * config/i386/i386.c (i386_solaris_elf_named_section): New + function. + * config.gcc (i[34567]86-*-solaris2*): Handle Solaris 2.10. + * config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Handle + 64-bit. + (ASM_QUAD): Don't undefine for biarch targets. + * config/i386/t-sol2: Introduce multilib support. + +2004-11-18 Ben Elliston + + * cgraphunit.c: Replace "it's" with "its" and fix a typo. + +2004-11-18 Ben Elliston + + * cgraph.h: Replace "it's" with "its" throughout. + +2004-11-18 Ben Elliston + + * doc/rtl.texi (Flags): Grammar fix. + +2004-11-17 Kazu Hirata + + * expmed.c (alg_code): Add alg_unknown. + (alg_hash_entry): New. + (NUM_ALG_HASH_ENTRIES): Likewise. + (alg_hash): Likewise. + (synth_mult): Cache the result into alg_hash. + +2004-11-17 Zack Weinberg + + * config/rs6000/t-darwin: Augment SHLIB_MAPFILES with + config/rs6000/libgcc-ppc64.ver. + +2004-11-17 Kazu Hirata + + * cfgrtl.c (rtl_verify_flow_info): Don't use INSN_P when + checking if an unconditional return is followed by a barrier. + + * jump.c (condjump_p): Remove unreachable code. + + * basic-block.h, c-common.h, df.h, expr.h, output.h, rtl.h, + tree-chrec.h, tree-flow.h, tree-scalar-evolution.h, + tree-ssa-live.h, tree.h: Remove unused prototypes. + +2004-11-17 Jeff Law + + * tree-cfg.c (edge_to_cases): Renamed from edge_to_case_leader. + (edge_to_cases_elt): Renamed from edge_to_case_leader. + (edge_to_cases_hash): Renamed from edge_to_case_leader_hash. + (edge_to_cases_eq): Renamed from edge_to_case_leader_eq. + (edge_to_cases_cleanup, recording_case_labels_p): New functions. + (get_cases_for_edge): New function. + (start_recording_case_labels, end_recording_case_labels): Similarly. + (record_switch_edge): Don't muck with the CASE_LABEL. Instead + chain equivalent CASE_LABEL_EXPRs together. + (get_case_leader_for_edge, get_case_leader_for_edge_hash): Kill. + (make_switch_expr_edges): Do not record edge/cases here. + (cleanup_tree_cfg): Record cases around the call to thread_jumps. + (split_critical_edges): Record cases around the edge splitting code. + (cleanup_dead_labels): Use CASE_LABEL again. + (tree_redirect_edge_and_branch): If we have a mapping from edge + to cases, use it to handle redirections. Else do it the slow way. + * tree.h (CASE_LEADER_OR_LABEL): Kill. + (CASE_LABEL): Revert to just looking at the tree's second operand. + * tree.c (get_case_label): Kill. + +2004-11-17 Diego Novillo + + PR tree-optimization/18307 + * tree-ssa-alias.c (merge_pointed_to_info): ICE if 'dest' and + 'orig' are the same node. + (collect_points_to_info_r): Do not call merge_pointed_to_info + when the PHI argument is identical to the LHS. + +2004-11-17 Steven Bosscher + + * tree-ssa-propagate.c (cfg_blocks_add): Assert we're not trying + to insert the exit or entry block. + (ssa_prop_init): Use add_control_edge to seed the algorithm. + +2004-11-16 Zack Weinberg + + * mkmap-flat.awk, mkmap-symver.awk: If the last version + assigned to a symbol was '%exclude', do not emit it anywhere. + If leading_underscore is true, prefix all symbols from the + version scripts with a leading underscore before comparing + them with nm output or emitting them. Remove support for dot + symbols. + * config/t-slibgcc-darwin (SHLIB_LINK): Use mkmap-flat.awk. + (SHLIB_MAPFILES): Use libgcc-std.ver. + (SHLIB_MKMAP_OPTS): Enable leading-underscore mode. + (SHLIB_LINK): Add -Wl,-exported_symbols_list,$(SHLIB_MAP). + * config/sh/t-linux: Use the normal libgcc-std.ver, plus + libgcc-excl.ver and libgcc-glibc.ver. + + * config/sh/libgcc-excl.ver: New file. + * config/sh/libgcc-std.ver, libgcc-darwin.ver: Delete. + +2004-11-16 Daniel Berlin + + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Swap + the test when the edge has the opposite meaning, not when + the first argument is invariant. + +2004-11-16 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): Split e500v2 + doubles. + (rs6000_complex_function_value): Handle e500 v2 variant. + +2004-11-16 Daniel Berlin + + Fix PR tree-optimization/18519 + + * tree-optimize (execute_todo): Add case for TODO_cleanup_cfg. + * tree-pass.h: Add TODO_cleanup_cfg. + * tree-ssa-ccp.c (pass_ccp): Use TODO_cleanup_cfg. + (ccp_finalize): Remove call to cleanup_cfg. + * tree-ssa-dce.c (pass_dce): Use TODO_cleanup_cfg and TODO_dump_func. + (pass_cd_dce): Ditto. + (perform_tree_ssa_dce): Remove call to cleanup_cfg, + dump_function_to_file. + * tree-ssa-loop-ch.c (copy_loop_headers): Remove call + to cleanup_cfg. + (pass_ch): Add TODO_cleanup_cfg. + * tree-ssa-loop.c (tree_ssa_loop_done): Remove call to + cleanup_cfg. + (pass_loop_done): Add TODO_cleanup_cfg. + * tree-ssa-phiopt.c (pass_phiopt): Ditto. + (tree_ssa_phiopt): Remove call to cleanup_cfg. + +2004-11-16 Devang Patel + + * optabs.c (vector_compare_rtx): Fix COMPARISON_CLASS_P use. + +2004-11-16 Kazu Hirata + + * expmed.c, ra-colorize.c: Fix comment typos. + + * doc/tm.texi: Fix typos. + +2004-11-16 Daniel Jacobowitz + Mark Mitchell + + PR target/6123 + * config/sol2.h (TARGET_OS_CPP_BUILTINS): Define __PIC__ and + __pic__ if PIC. + +2004-11-16 Ulrich Weigand + + * regmove.c (regmove_optimize): Use lowpart_subreg instead of + gen_rtx_SUBREG with incorrect offset to compute SRC_SUBREG. + +2004-11-16 Devang Patel + + * tree-if-conv.c (clean_predicate_lists): Update gcc_assert check. + +2004-11-16 Eric Christopher + + * config/mips/mips.c: Use rtl _P predicates. + * config/mips/mips.h: Ditto. + * config/mips/mips.md: Ditto. + +2004-11-16 Fariborz Jahanian + + * config/rs6000/altivec.md (altivec_vandc): Canonicalize + the pattern. + +2004-11-16 Andreas Krebbel + + * config/s390/s390.c (s390_cc_modes_compatible): New function. + (TARGET_CC_MODES_COMPATIBLE): Target macro defined. + +2004-11-16 Kaz Kojima + + PR target/18447 + * config/sh/sh.c (prepare_move_operands): Emit blockage insns + before and after the insns for getting GOT address in non-PIC + TLS_MODEL_INITIAL_EXEC tls sequence when the first scheduling + is enabled. + +2004-11-16 Andreas Krebbel + + * cse.c (struct change_cc_mode_args): New structure. + (cse_change_cc_mode_insn): New function. + (cse_change_cc_mode): Use validate_change to perfom changes. + (cse_change_cc_mode_insns, cse_condition_code_reg): + Call cse_change_cc_mode_insn. + +2004-11-16 Steven Bosscher + + * stack.h: Remove. + +2004-11-16 Steven Bosscher + + * config/i386/i386.c (x86_schedule): Fix typo, m_K6 intead of m_K8. + +2004-11-15 Dale Johannesen + + * tree-flow.h (add_referenced_temp_var): Remove name from prototype. + +2004-11-15 Dale Johannesen + + * profile.c (compute_branch_probabilities): Prevent + crash with EH in RTL-based profiling. + +2004-11-16 Kazu Hirata + + * tree-cfg.c (verify_expr): Replace TREE_OPERAND with + COND_EXPR_COND. + * tree-if-conv.c (tree_if_convert_cond_expr): Likewise. + * tree-ssa-dom.c (thread_across_edge): Likewise. + * tree-vectorizer.c (vect_transform_loop_bound): Replace + TREE_OPERAND with COND_EXPR_COND, COND_EXPR_THEN, or + COND_EXPR_ELSE. + + * tree-cfg.c (bsi_commit_edge_inserts): Remove an argument. + (tree_flow_call_edges_add): Update the call to + bsi_commit_edge_inserts. + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. + * profile.c (branch_prob): Likewise. + * tree-mudflap.c (mf_decl_cache_locals): Likewise. + * tree-sra.c (scalarize_function): Likewise. + * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. + * tree-ssa-pre.c (fini_pre): Likewise. + * tree-flow.h: Update the prototype for + bsi_commit_edge_inserts. + +2004-11-15 Eric Christopher + + * sched-deps.c (set_sched_group_p): Delete. + (delete_all_dependencies): New function. + (fixup_sched_groups): Use. New function. + (sched_analyze_insn): Use. + +2004-11-15 Joseph S. Myers + + * c-common.c (binary_op_error): Don't allow LROTATE_EXPR, + RROTATE_EXPR or unknown code. + * c-typeck.c (build_binary_op): Don't allow RROTATE_EXPR, + LROTATE_EXPR, MAX_EXPR, MIN_EXPR, UNORDERED_EXPR, ORDERED_EXPR, + UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, LTGT_EXPR + or unknown code. + +2004-11-15 Joseph S. Myers + + PR c/18498 + * c-decl.c (grokdeclarator): Call check_bitfield_type_and_width + after processing the declarator. + +2004-11-15 Aldy Hernandez + + * config/rs6000/altivec.md ("altivec_vsplth"): Rewrite with + vec_duplicate. + (altivec_vspltb): Same. + (altivec_vspltw): Same. + (altivec_vspltisb): Same. + (altivec_vspltish): Same. + (altivec_vspltisw): Same. + (altivec_vspltisw_v4sf): Same. + (define_constants): Remove UNSPEC_VSPLTISB, UNSPEC_VSPLTISW, + UNSPEC_VSPLTISH. + Move "End of vector xor's" comment to the right place. + +2004-11-15 Steve Ellcey + + * config/ia64/ia64.md (*movtf_internal): Use destination_operand + instead of nonimmediate_operand. + +2004-11-15 Mark Mitchell + + * config/i386/sol2.h (ASM_OUTPUT_CALL): Use print_operand. + * config/sparc/sol2.h (ASM_OUTPUT_CALL): Likewise. + * config/sol2.c (solaris_output_init_fini): Update calls to + ASM_OUTPUT_CALL. Include "rtl.h". + +2004-11-15 Mark Mitchell + + * config/sol2-c.c (cmn_err_char_table): Add "p". + +2004-11-15 Mark Mitchell + + * config/sparc/sol2.h (SUPPORTS_INIT_PRIORITY): Remove. + * config/sol2.h (SUPPORTS_INIT_PRIORITY): Define here. + +2004-11-15 Mark Mitchell + + * config/t-slibgcc-sld (SHLIB_LINK): Make symlinks entirely + within the multilib directory. + +2004-11-15 Nick Clifton + + * config/stormy16/stormy16.h (TARGET_CPU_CPP_BUILTINS): Add + builtin assert of cpu=xstormy16. + +2004-11-15 Nathan Sidwell + + * tree-ssa-pre.c (bitmap_print_value_set): Fix uninitialized + variable. + +2004-11-14 Richard Henderson + + PR 18480 + * calls.c (struct arg_data): Add parallel_value. + (precompute_register_parameters): Set it. + (load_register_parameters): Use it. + (store_one_arg): Also set it here. + +2004-11-14 Zdenek Dvorak + + PR tree-optimization/18431 + * fold-const.c (associate_trees): Do not produce x + 0. + (fold_widened_comparison, fold_sign_changed_comparison): New functions. + (fold): Use them. + * tree-ssa-loop-niter.c (upper_bound_in_type, lower_bound_in_type): + Moved ... + * tree.c (upper_bound_in_type, lower_bound_in_type): Here. + * tree.h (upper_bound_in_type, lower_bound_in_type): Declare. + +2004-11-14 Eric Botcazou + + * doc/rtl.texi (SUBREG): Adjust BYTENUM value in example. + +2004-11-14 Kazu Hirata + + * cfgrtl.c, global.c, tree-ssa-copy.c, tree-ssa-loop-ivopts.c, + value-prof.c: Fix comment typos. + +2004-11-14 Stan Shebs + + Basic ABI changes for passing structs by value in 64-bit Darwin. + * config/rs6000/rs6000.c (rs6000_darwin64_abi): New flag. + (rs6000_override_options): Set it for 64-bit Darwin. + (rs6000_parse_abi_options): Add testing options to change it. + (rs6000_return_in_memory): Test whether the type is one + that can be passed in registers. + (darwin64_function_arg_advance): New. + (function_arg_advance): Call it, plus add recursion depth + argument and test when counting off arguments. + (rs6000_darwin64_function_arg): New. + (function_arg): Call it. + (setup_incoming_varargs): Add argument to function_arg_advance. + (rs6000_darwin64_function_value): New. + (rs6000_function_value): Call it. + * config/rs6000/rs6000.h (FUNCTION_ARG_ADVANCE): Pass depth arg. + * config/rs6000/rs6000-protos.h: Update decl of + function_arg_advance. + +2004-11-14 Andrew Pinski + + PR c/17279 + * c-common.c (c_common_nodes_and_builtins): Ask the back-end if we + support TImode before adding __int128_t and __uint128_t types. + +2004-11-14 Dorit Naishlos + + PR tree-opt/18400 + * tree-vectorizer.c (make_loop_iterate_ntimes): Set loop->nb_iterations. + (vect_transform_loop_bound): Set loop->nb_iterations. + +2004-11-14 Dorit Naishlos + Andrew Pinski + + PR tree-opt/18425 + * tree-vectorize.c (vect_build_loop_niters): Do not insert + NULL into the instruction stream. Initialize new_bb to NULL. + (vect_update_ivs_after_vectorizer): Likewise. + (vect_gen_niters_for_prolog_loop): Likewise. + +2004-11-14 Zdenek Dvorak + + PR tree-optimization/18431 + * tree-flow.h (stmt_references_memory_p): Declare. + * tree-ssa-loop-im.c (stmt_cost): Use stmt_references_memory_p. + * tree-ssa.c (stmt_references_memory_p): New function. + +2004-11-14 Andreas Schwab + + * Makefile.in (lambda-code.o, tree-loop-linear.o): Depend on + $(EXPR_H). + +2004-11-14 Kazu Hirata + + * c-common.c (walk_stmt_tree): Remove. + * c-common.h: Remove the corresponding prototype. + + * emit-rtl.c (push_to_full_sequence): Remove. + * rtl.h: Remove the corresponding prototype. + + * cselib.c, expr.c: Fix comment typos. + +2004-11-13 Richard Henderson + + * calls.c (precompute_register_parameters): Force all PARALLELs + into pseudo registers. + (load_register_parameters): Copy PARALLELs into hard registers. + * function.c (assign_parm_setup_block): Copy PARALLELS into + pseudo registers. Do emit_group_store in conversion_insns. + * expr.c (emit_group_load_1): Rename from emit_group_load, take + tmps as an argument. Move final copy loop ... + (emit_group_load): ... here. New function. + (emit_group_load_into_temps, emit_group_move_into_temps): New. + * expr.h: Declare them. + +2004-11-14 Kazu Hirata + + * tree-cfg.c, tree-if-conv.c, tree-ssa-loop-ivopts.c, + tree-ssa-loop-manip.c, tree-vectorizer.c: Replace TREE_CHAIN + with PHI_CHAIN where appropriate. + +2004-11-13 Dale Johannesen + + * tree-flow.h (bsi_commit_one_edge_insert): Remove name from prototype. + (tree_block_label): Ditto. + (flush_pending_stmts): Ditto. + (insert_edge_copies): Ditto. + (expr_invariant_in_loop_p): Ditto. + (TDF_USE_OPS): Parenthesize definition. + (TDF_USE_VOPS): Ditto. + +2004-11-13 David Edelsohn + + * config/rs6000/aix51.h (ASM_CPU_SPEC): Add 970 and G5. + * config/rs6000/aix52.h (ASM_CPU_SPEC): Same. + (atoll): Declare. + * config/rs6000/t-aix52 (BOOT_LDFLAGS): Define. + +2004-11-14 Joseph Myers + + * config/i386/i386.c (override_options): Move loop to set default + tuning to correct place. + +2004-11-13 Zak Kipling + + PR target/18300 + * config/i386/i386.c (classify_argument): Fix infinite loop when + passing object with 3 or more base classes by value. + +2004-11-13 Eric Botcazou + + * doc/md.texi (constraints) <% modifier>: Mention that it is + useless when the two alternatives are strictly identical. + +2004-11-13 Richard Henderson + + * expmed.c (extract_split_bit_field): Temporarily disable call to + extract_force_align_mem_bit_field. + +2004-11-13 Kazu Hirata + + * bitmap.c, bitmap.h, expmed.c, tree-cfg.c: Fix comment + formatting. + + * c-cppbuiltin.c, cgraph.c, domwalk.h, except.c, gimplify.c, + lambda-code.c, postreload.c, predict.c, tree-sra.c, + tree-ssa-loop-manip.c, tree.c: Fix comment typos. + +2004-11-13 Kelley Cook + + * doc/install.texi (automake): Correctly document that everything now + will use automake 1.9.3. + +2004-11-13 Hans-Peter Nilsson + + PR target/18347 + * config/mmix/mmix.c (mmix_function_outgoing_value): Handle + TImode. Sorry for other non-complex larger-than-64-bit modes. + * config/mmix/mmix.h (MIN_UNITS_PER_WORD): Do not define. + +2004-11-13 Kelley Cook + + * doc/install.texi (automake): Document that everything now uses 1.9. + +2004-11-13 Bernd Schmidt + + * cse.c (cse_insn): Stores in a libcall sequence can invalidate + previous loads. + +2004-11-13 Kazu Hirata + + * tree.h: Fix comment typos. + +2004-11-13 Steven Bosscher + + * cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and + HARD_REGISTER_NUM_P. + + * cselib.c (new_cselib_val): Make comment correct and more detailed. + * flow.c (mark_set_1): Likewise. + + * except.c (duplicate_eh_region_1, duplicate_eh_region_2, + duplicate_eh_regions): Remove. + * except.h (duplicate_eh_regions): Remove prototype. + * integrate.c (get_label_from_map, copy_rtx_and_substitute, + global_const_equiv_varray): Remove. + * integrate.h (get_label_from_map, copy_rtx_and_substitute, + global_const_equiv_varray, set_label_in_map): Remove prototypes, + extern declaration, and #define. + (MAYBE_EXTEND_CONST_EQUIV_VARRAY, SET_CONST_EQUIV_DATA): Remove. + (struct inline_remap): Remove. + * varray.c (struct element): Remove entry for const_equiv_data. + * varray.h (struct const_equiv_data): Remove. + (enum varray_data_enum) : Remove. + (union varray_data_tag) : Remove. + (VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV, + VARRAY_PUSH_CONST_EQUIV, VARRAY_TOP_CONST_EQUIV): Remove. + + * regstack.c (record_label_references): Remove unused function. + + * rtl.def (VALUE): Update comment. + (LABEL_REF): Remove unused operand 2. + * rtl.h (struct rtx_def): Update for removed accessor macros. + (XCADVFLAGS, INSN_DEAD_CODE_P, LINE_NUMBER, CONTAINING_INSN, + REG_LOOP_TEST_P): Remove. + (ADDR_DIFF_VEC_FLAGS, CSELIB_VAL_PTR, LABEL_NEXTREF): Add comments. + * web.c (entry_register): Don't copy REG_LOOP_TEST_P. + * doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove. + +2004-11-13 James A. Morrison + Eric Botcazou + + PR target/18230 + * config/sparc/sparc.c (sparc_rtx_costs): Handle the NAND vector + patterns. + * config/sparc/sparc.md (V64I): New macro for 64-bit modes. + (V32I): New macro for 32-bit modes. + (anddi3, anddi_sp32, anddi_sp64, and_not_di_sp32, and_not_di_sp64, + iordi3, iordi3_sp32, iordi_sp64, or_not_di_sp32, or_not_di_sp64, + xordi3, xordi3_sp32, xordi3_sp64, {AND, IOR, XOR} DI splitter, + xor_not_di_sp32, xordi_not_di_sp64, one_cmpldi2, one_cmpldi_sp32, + one_cmpldi_sp64): Use V64I instead of DI. + (andsi3, andsi_sp32, andsi_sp64, and_not_si, iorsi3, or_not_si, + xorsi3, xor_not_si, one_cmplsi2): Use V32I instead of SI. + (addv2si3, addv4hi3, addv2hi3): Remove % modifier. + (nandv64i_vis, nandv32i_vis): New patterns. + +2004-11-12 Mike Stump + + * Makefile.in: Add html support. + * java/Make-lang.in: Likewise. + * fortran/Make-lang.in: Likewise. + * treelang/Make-lang.in: Likewise. + * doc/install.texi: Likewise. + * doc/makefile.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + +2004-11-13 Kazu Hirata + + * tree-ssa-loop-manip.c: Fix a comment typo. + +2004-11-12 Mike Stump + + * doc/cppinternals.texi (Index): Fix html generation with makeinfo by + renaming this node to Concept Index. + * doc/gccint.texi (Index): Likewise. Also minor formatting tweaks + to more closely match gcc.texi. + +2004-11-12 Jeff Law + + * tree-cfg.c (hashtab.h): Include. + (struct edge_to_case_leader_elt): New structure. + (edge_to_case_leader): New. + (edge_to_case_leader_hash): New hashtable hasing function. + (edge_to_case_leader_eq): New hashtable equality function. + (record_switch_edge): New function. + (get_case_leader_for_edge, get_case_leader_for_edge): New functions. + (make_switch_expr_edges): Build the edge-to-case-leader + hash table. Tear down the hash table when we're done. + (cleanup_dead_labels): Use CASE_LEADER_OR_LABEL instead of + CASE_LABEL. + (tree_node_can_be_shared): Allow sharing of CASE_LABEL_EXPR nodes. + (tree_redirect_edge_and_branch, case SWITCH_EXPR): Update + to use new concept of case leaders to reduce overhead of + redirecting outgoing edges from switch statements. + * tree.c (get_case_label): New function. + * tree.h (CASE_LABEL): Define in terms of get_case_label. + (CASE_LEADER_OR_LABEL): Define. + +2004-11-12 Ziemowit Laski + + * varasm.c (output_addressed_constants): For CONST_DECLs, + output the initializer if present. + +2004-11-12 Ziemowit Laski + + * config/rs6000/darwin.h: Fix confusing typo in comment. + +2004-11-12 Devang Patel + + * optabs.c (vector_compare_rtx): Use COMPARISON_CLASS_P. + +2004-11-12 Devang Patel + + * tree-if-conv.c (clean_predicate_lists): Use loop header + and latch directly. + +2004-11-12 Richard Henderson + + PR 17778 + * config/i386/i386.h (TARGET_96_ROUND_53_LONG_DOUBLE): New. + * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Remove. + (TARGET_96_ROUND_53_LONG_DOUBLE): New. + * config/i386/i386-modes.def (XF): Use it. + +2004-11-11 Geoffrey Keating + + * Makefile.in (macro_list): Use move-if-change to avoid spurious + rebuilds. + +2004-11-12 Mark Mitchell + + PR c++/18416 + * passes.c (rest_of_decl_compilation): Do not look at DECL_RTL + when deciding whether to pass a variable to + cgraph_varpool_finalize_decl or assemble_variable. + * toplev.c (check_global_declarations): Do not clear DECL_RTL. + +2004-11-12 Kazu Hirata + + * tree-vectorizer.c: Fix a comment typo. + +2004-11-12 Bernd Schmidt + + * genconfig.c (walk_insn_part): Look at match_dups inside a label_ref. + +2004-11-12 Diego Novillo + + * tree-scalar-evolution.c (analyzable_condition): Remove + superfluous TREE_THIS_VOLATILE checks on SSA_NAMEs. + +2004-11-12 Ralf Corsepius + + * config/rs6000/t-rtems (MULTILIB_NEW_EXCEPTIONS_ONLY): + Remove m505/roe multilib variant. + +2004-11-12 Eric Botcazou + + * expr.c (emit_group_load) : Use extract_bit_field + to load from the stack. + +2004-11-12 Richard Henderson + + * toplev.c (floor_log2): Rename from floor_log2_wide, use CLZ_HWI. + (exact_log2): Rename from exact_log2_wide, use CTZ_HWI. + * toplev.h (FL2T__): Remove. + (CLZ_HWI): Rename from FL2T_CLZ__. + (CTZ_HWI): New. + (floor_log2): Simplify. + (exact_log2): New. + +2004-11-12 Sebastian Pop + + * tree-data-ref.c (analyze_subscript_affine_affine): Correctly + compute the first overlapping iterations. + +2004-11-12 Sebastian Pop + + PR middle-end/18005 + * tree-data-ref.c (estimate_niter_from_size_of_data): Ensure + that arguments of EXACT_DIV_EXPR are INTEGER_CST. + +2004-11-12 Steven Bosscher + + PR tree-optimization/18419 + * tree-ssa.c (walk_use_def_chains_1): Make the visited map a + pointer set instead of a bitmap. + (walk_use_def_chains): Create, pass and clean up that pointer_set. + + * tree-ssa-alias.c (struct alias_info): Make the ssa_names_visited + field an sbitmap. + (init_alias_info): Allocate and zero it here. + (delete_alias_info): Delete it here. + (collect_points_to_info_for): Use it. + +2004-11-11 Kazu Hirata + + * alias.c (record_alias_subset, addr_side_effect_eval): + Make them static. + * alias.h: Remove the prototype for record_alias_subset. + * expr.h: Remove the commented-out prototype for + record_alias_subset. + * rtl.h: Remove the prototype for addr_side_effect_eval. + + * cfglayout.c (choose_inner_scope): Make it static. + * rtl.h: Remove the corresponding prototype. + + * cfgloopmanip.c (update_single_exits_after_duplication, + unloop): Make them static. + * cfgloop.h: Remove the corresponding prototypes. + + * c-typeck.c (c_size_in_bytes, record_maybe_used_decl): + Make them static. + * c-tree.h: Remove the corresponding prototypes. + + * explow.c (round_push): Make it static. + * expr.h: Remove the corresponding prototype. + + * varasm.c (get_named_section_flags, decl_tls_model): Make + them static. + * output.h: Remove the prototype for get_named_section_flags. + * tree.h: Remove the prototype for decl_tls_model. + +2004-11-11 Kazu Hirata + + * function.c (expand_function_end): Remove an "if" statement + that always triggers. + * stmt.c (expand_null_return_1): Likewise. + +2004-11-11 James E. Wilson + + * config/ia64/ia64.h (HARD_REGNO_NREGS): Handle XCmode. + (HARD_REGNO_MODE_OK, MODES_TIEABLE_P, SECONDARY_MEMORY_NEEDED, + CLASS_MAX_NREGS): Likewise. + +2004-11-11 Zdenek Dvorak + + PR tree-optimization/17742 + * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle + MINUS_EXPR correctly. + +2004-11-11 Sebastian Pop + + * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi): + Give up as soon as the evolution is known not computable. + +2004-11-11 Nathan Sidwell + + PR target/16457 + * config/rs6000/rs6000.c (mask64_2_operand): Stub to call + mask64_1or2_operand. + (mask64_1or2_operand): Broken out of mask64_2_operand, add flag + to spot rlwinm opportunities. + (and64_2_operand): Use mask_1or2_operand. + * config/rs6000/rs6000.md (anddi3): Use rlwinm when possible. + +2004-11-11 Dorit Naishlos + + * tree-vectorizer.c (update_phi_nodes_for_guard): Call reverse_phis. + (vect_update_ivs_after_vectorizer): Update function documentation. + Avoid quadratic behavior and direct write to PHI_ARG_DEF. + +2004-11-11 Kazu Hirata + + * config/arm/arm.c: Fix a comment typo. + +2004-11-11 Nathan Sidwell + + * bitmap.h (nBITMAP_WORD_BITS): Remove. + (BITMAP_WORD_BITS): Force unsigned by use of 1u. + (BITMAP_ELEMENT_WORDS, BITMAP_ELEMENT_ALL_BITS): Remove + unnecessary casts. + (bitmap_first_set_bit): Return unsigned, use ctzl. + (bitmap_last_set_bit): Remove. + * bitmap.c (bitmap_element_zerop, bitmap_copy): Make iterator + unsigned. + (bitmap_first_set_bit): Return unsigned, require non-empty bitmap, + remove special case code for two word elements. + (bitmap_last_set_bit): Remove. + * ra-build.c (livethrough_conflicts_bb): Replace unnecessary use of + bitmap_first_set_bit with bitmap_empty_p. + * tree-outof-ssa.c (analyze_edges_for_bb): Likewise. + * tree-ssa-pre.c (bitmap_print_value): Use simple flag rather than + bitmap_last_bit_set. + +2004-11-11 Nathan Sidwell + + PR target/16796 + * config/rs6000/rs6000.md: Add DF & SF reg move peepholes. + + PR target/16458 + * config/rs6000/rs6000.c (rs6000_generate_compare): Generate an + unsigned equality compare when we know the operands are unsigned. + +2004-11-10 Peter S. Mazinger + + * config/mips/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Define + __PIC__ and __pic__ only if TARGET_ABICALLS. + (SUBTARGET_CPP_SPECS): Don't define or undefine __PIC__ and __pic__. + (SUBTARGET_ASM_SPECS): Don't pass -non_shared to assembler; pass + -KPIC only if not -mno-abicalls. + + * config/alpha/linux.h, config/arm/linux-elf.h, config/pa/pa-linux.h + * config/sparc/linux.h, config/sparc/linux64.h + (TARGET_OS_CPP_BUILTINS): Define __PIC__ and __pic__ if flag_pic. + + * config/arm/linux-gas.h (CPP_SPEC): Don't define __PIC__ or __pic__. + * config/pa/pa/linux.h (CPP_SPEC): Likewise. + * config/sparc/linux.h (CPP_SUBTARGET_SPEC): Likewise. + * config/sparc/linux64.h (CPP_SUBTARGET_SPEC): Likewise. + +2004-11-11 Paul Brook + + * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Save PIC + register if current_function_uses_pic_offset_table is set. + +2004-11-10 David Edelsohn + + * config/rs6000/rs6000.md (define_attr "type"): Add two and three. + Change multi-instruction sequences to new attribute. + * config/rs6000/{40x.md,440.md,603.md,6xx.md, + 7450.md,7xx.md,8540.md,mpc.md,power4.md,power5.md, + rios1.md,rios2.md,rs64.md}: Add descriptions for two and three. + +2004-11-10 Daniel Berlin + + * tree-data-ref.c (build_classic_dist_vector): If either loop + is outside of the nest we asked about, the dependence can't + matter. + (build_classic_dir_vector): Ditto. + +2004-11-10 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (get_address_cost): Add address elements in + right order. + (force_var_cost): Determine cost of addition and multiplication more + precisely. + (get_computation_cost_at): Add cost for computing address elements to + the final cost. + + * fold-const.c (fold): Attempt to use ptr_difference_const whenever + one of the arguments of MINUS_EXPR is an address. + (split_address_to_core_and_offset): New function. + (ptr_difference_const): Handle case when one of the operands is a + pointer. + * tree-ssa-loop-ivopts.c (determine_base_object): Fold &*addr. + (ptr_difference_cost): Pass addresses instead of objects to + ptr_difference_const. + +2004-11-10 Nathan Sidwell + + * tree.c (tree_check_failed): Emit general error if the list of + node types is empty. + +2004-11-10 Eric Botcazou + + * config/sparc/sparc.c (function_arg_union_value): New 'slotno' + argument. When the union is passed in the 6th slot, build a + PARALLEL with only one element. + (function_arg): Adjust call to function_arg_union_value. + (function_value): Likewise. + +2004-11-10 Fariborz Jahanian + + PR tree-optimization/17892 + * tree-ssa-dom.c (unsafe_associative_fp_binop): Add test for + MINUS_EXPR operator. + +2004-11-10 James A. Morrison + + PR target/18230 + config/sparc/sparc.md (addsi3, subsi3): Set "fptype" attribute. + (addv2si, addv4hi, addv2hi, subv2si, subv4hi, subv2hi): New patterns. + +2004-11-10 Steven Bosscher + + * basic-block.h (XMALLOC_REG_SET, XFREE_REG_SET): New. + (struct basic_block_def): Remove local_set and cond_local_set + fields. Update comment for global_live_at_start. + * flow.c (calculate_global_regs_live): Allocate local_sets and + cond_local_sets here as arrays of bitmaps previously stored in + bb->local_set and bb->cond_local_set. Use xmalloc instead of + obstack allocated bitmaps. + +2004-11-09 H.J. Lu + + PR target/18380 + * config/ia64/unwind-ia64.h (_Unwind_FindTableEntry): Mark it + hidden. + + * unwind-dw2.c (_Unwind_FindTableEntry): Removed. + +2004-11-09 Jeff Law + + * cfganal.c (flow_dfs_compute_reverse_execute): Accept new + argument holding last unvisited block. Start search for + unvisited blocks at LAST_UNVISITED rather than EXIT_BLOCK. + (connect_infinite_loops_to_exit): Supply last unvisited block + to flow_dfs_compute_reverse_execute. + +2004-10-22 Aldy Hernandez + + * config/rs6000/rs6000.md (fix_truncdfsi2): Handle e500 + doubles. + (floatunssidf2): Same. + (floatsidf2): Same. + ("extendsfdf2"): New expander. + (*extendsfdf2_fpr): Rename. + (*truncdfsf2_fpr): Same. + (*negdf2_fpr): Same. + (*absdf2_fpr): Same. + (*nabsdf2_fpr): Same. + (*adddf3_fpr): Same. + (*subdf3_fpr): Same. + (*muldf3_fpr): Same. + (*divdf3_fpr): Same. + + * config/rs6000/spe.md ("spe_extendsfdf2"): Remove FIXME comment. + ("spe_fix_truncdfsi2"): Same. + (spe_floatunssidf2): Same. + (spe_floatsidf2): Same. + +2004-11-09 Joseph S. Myers + + PR c/18322 + * c-common.c (fname_decl): Don't use line number of decl in + diagnostic. + +2004-11-09 Ulrich Weigand + + * config/s390/s390-protos.h (s390_pool_operand): Remove. + * config/s390/s390.c (s390_pool_operand): Likewise. + (s390_extra_constraint_str): Handle 'B' constraints. + * config/s390/s390.h (CONSTRAINT_LEN): Handle 'B' constraints. + * config/s390/s390.md: Document 'B' constraints. + ("*cmpdi_cct", "*cmpsi_cct"): Use 'B' constraint instead of + s390_pool_operand to prevent insns with two literal pool + references. Make pattern commutative. + ("*cmpdi_ccu", "*cmpsi_ccu", "*cmphi_ccu", "*cmpqi_ccu"): Use + 'B' constraint instead of s390_pool_operand. + +2004-11-09 Kazu Hirata + + * tree-cfg.c (create_bb): Remove unnecessary memset. + +2004-11-09 Kazu Hirata + + * tree-ssa-threadupdate.c (copy_phis_to_block): Remove. + (thread_block): Call flush_pending_stmt instead of + copy_phis_to_block. + +2004-11-09 Kazu Hirata + + * loop-iv.c (iv_number_of_iterations): Make it static. + * cfgloop.h: Remove the corresponding prototype. + +2004-11-09 Kazu Hirata + + * function.c (combine_temp_slots, assign_parms, + expand_pending_sizes): Make them static. + * tree.h: Remove the corresponding prototypes. + +2004-11-09 Kazu Hirata + + * emit-rtl.c (copy_most_rtx): Remove. + * rtl.h: Remove the corresponding prototype. + +2004-11-09 Kazu Hirata + + * cfgloop.c (flow_loops_update): Remove. + * cfgloop.h: Remove the corresponding prototype. + +2004-11-09 Kazu Hirata + + * conflict.c (mark_reg, conflict_graph_compute): Remove. + * basic-block.h: Remove the prototype for + conflict_graph_compute. + +2004-11-09 Kazu Hirata + + * tree-if-conv.c (add_to_dst_predicate_list): Change the + second argument to basic_block. + (tree_if_convert_cond_expr): Update call sites. + +2004-11-09 Kazu Hirata + + * fold-const.c (pedantic_non_lvalue): Make it static. + * tree.h: Remove the corresponding prototype. + +2004-11-09 Kazu Hirata + + * optabs.c (prepare_operand): Make it static. + * optabs.h: Remove the corresponding prototype. + +2004-11-09 Kazu Hirata + + * reload1.c (reloads_conflict, gen_reload): Make them static. + * reload.h: Remove the corresponding prototypes. + +2004-11-09 Kazu Hirata + + * reload.c (refers_to_mem_for_reload_p, + refers_to_regno_for_reload_p): Make them static. + * reload.h: Remove the corresponding prototypes. + +2004-11-09 James A. Morrison + Eric Botcazou + + PR target/18230 + * doc/md.texi (SPARC constraints): Document 'Y' constraint. + * config/sparc/sparc-modes.def: Add vector modes of 4 and 8 bytes. + * config/sparc/sparc.c (sparc_vector_mode_supported_p): New function. + (TARGET_VECTOR_MODE_SUPPORTED_P): Set to sparc_vector_mode_supported_p. + (fp_zero_operand): Accept MODE_VECTOR_INT modes. + (input_operand): Accept CONST_VECTOR with MODE_VECTOR_INT modes. + (sparc_cannot_force_const_mem): Return false for CONST_VECTOR. + (sparc_init_modes): Set sparc_mode_class to SF_MODE or DF_MODE for + MODE_VECTOR_INT modes. + (sparc_extra_constraint_check): Add new constraint 'Y'. + * config/sparc/sparc.h: Define UNITS_PER_SIMD_WORD to 8 for TARGET_VIS. + * config/sparc/sparc.md (V32): New mode macro for 32-bit modes. + (V64): New mode macro for 64-bit modes. + (movsf): Use V32 for mode instead of SF. + (movsf_insn_vis): Use V32 for mode instead of SF. Add 'Y' constraint + alongside 'G' constraint. + (movdf): Use V64 for mode instead of DF. + (movdf_insn_v9only_vis, modf_insn_sp64_vis): Use V64 for mode instead + of DF. Add 'Y' constraint alongside 'G' constraint. + (multi-isn and misaligned mems DFmode splitters): Use V64 for mode + instead of DF. + +2004-11-09 Ulrich Weigand + + * config/s390/s390.c (s390_select_ccmode): Return CCAPmode for + integer NEG and ABS. + * config/s390/s390.md ("*negdi2_64"): Fix op_type attribute. + ("*negdi2_31"): Reimplement using a splitter. + ("*negdi2_cc", "*negdi2_cconly"): New insns. + ("*negdi2_sign", "*negdi2_sign_cc"): Likewise. + ("*negsi2_cc", "*negsi2_cconly"): Likewise. + ("*negdf2_cc", "*negdf2_cconly"): Likewise. + ("*negsf2_cc", "*negsf2_cconly"): Likewise. + ("*absdi2_cc", "*absdi2_cconly"): New insns. + ("*absdi2_sign", "*absdi2_sign_cc"): Likewise. + ("*abssi2_cc", "*abssi2_cconly"): Likewise. + ("*absdf2_cc", "*absdf2_cconly"): Likewise. + ("*abssf2_cc", "*abssf2_cconly"): Likewise. + ("*negabsdi2_cc", "*negabsdi2_cconly"): New insns. + ("*negabsdi2_sign", "*negabsdi2_sign_cc"): Likewise. + ("*negabssi2_cc", "*negabssi2_cconly"): Likewise. + ("*negabsdf2_cc", "*negabsdf2_cconly"): Likewise. + ("*negabssf2_cc", "*negabssf2_cconly"): Likewise. + +2004-11-09 Ulrich Weigand + + * config/s390/s390.c (s390_canonicalize_comparison): Reverse condition + when eliminating an UNSPEC_CMPINT. + (s390_secondary_input_reload_class): Fix test for CC register reload. + (s390_secondary_output_reload_class): Likewise. + (s390_expand_cmpmem): Swap operands. Use gen_cmpint. + * config/s390/s390.md ("*cmpint_si", "*cmpint_di"): Remove. + ("cmpint", "*cmpint_cc", "*cmpint_sign", "*cmpint_sign_cc"): New + insn patterns with splitters. + +2004-11-09 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Add EQ, GTU, and LTU. + * config/rs6000/rs6000.md (sCC): Split GTU and LTU patterns. + +2004-11-09 Kazu Hirata + + * tree-phinodes.c (phi_reverse): New. + * tree-cfg.c (tree_make_forwarder_block, tree_duplicate_bb): + Use it. + * tree-flow.h: Add a prototype for phi_reverse. + +2004-11-09 Kazu Hirata + + * tree-ssa-loop-ivopts.c: Fix a comment typo. + +2004-11-09 James A. Morrison + + PR pch/14940 + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __sparc__ + definitions. + +2004-11-09 Joseph S. Myers + + * builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument" + instead of "arg" in diagnostics. + +2004-11-09 Joseph S. Myers + + * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, + c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, + gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, + tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, + config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, + config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, + config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, + config/iq2000/iq2000.c, config/m32r/m32r.c, + config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, + config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, + config/ns32k/ns32k.c, config/rs6000/host-darwin.c, + config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, + config/sh/symbian.c, config/stormy16/stormy16.c, + config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< + and %> as appropriate. Use %' as apostrophe in diagnostics where + applicable. Use %< and %> in place of '' quotes where applicable. + Use %qs in place of %<%s%>. Consistently quote __builtin function + names. + +2004-11-09 Hans-Peter Nilsson + + * gdbinit.in (pbb, pbm): New macros. + +2004-11-08 Jeff Law + + * cfg.c (redirect_edge_succ_nodup): Use find_edge rather than + implementing it inline. + + * cfganal.c (find_edge): Search pred->succs or succ->preds, + whichever is shorter. + +2004-11-08 Kazu Hirata + + * passes.c (rest_of_handle_jump): Remove dead code. + +2004-11-08 Kazu Hirata + + * tree-cfg.c (thread_jumps): Speed up by keeping a pointer to + the last used element in the worklist. + +2004-11-08 Kazu Hirata + + * tree-inline.c (remap_save_expr): Make it static. + * tree-inline.h: Remove the corresponding prototype. + +2004-11-08 Kazu Hirata + + * tree-ssa-loop-niter.c (upper_bound_in_type, + lower_bound_in_type): Make them static. + * tree.h: Remove the corresponding prototypes. + +2004-11-08 Kazu Hirata + + * tree-ssa-live.c (tpa_init, pop_best_coalesce): Make them + static. + * tree-ssa-live.h: Remove the corresponding prototypes. + +2004-11-08 Kazu Hirata + + * tree-if-conv.c (tree_if_conversion): Make it static. + * tree-flow.h: Remove the corresponding prototype. + +2004-11-08 Kazu Hirata + + * tree-ssa-operands.c (build_ssa_operands): Make it static. + * tree-flow.h: Remove the corresponding prototype. + +2004-11-08 Andrew Pinski + + PR tree-opt/18299 + * tree-inline.c (copy_body_r): Change "t = t" to empty + statement instead of "t". + +2004-11-08 Kazu Hirata + + * modulo-sched.c (create_partial_schedule, + free_partial_schedule, reset_partial_schedule, + ps_add_node_check_conflicts, rotate_partial_schedule): Make + them static. + +2004-11-08 Richard Henderson + + * expmed.c (extract_force_align_mem_bit_field): Correct handling at + the end of a page. + +2004-11-08 Kazu Hirata + + * sched-deps.c (add_insn_mem_dependence): Make it static. + * sched-int.h: Remove the corresponding prototypes. + +2004-11-08 Kazu Hirata + + * flow.c (allocate_bb_life_data): Make it static. + * basic-block.h: Remove the corresponding prototype. + +2004-11-08 Kazu Hirata + + * calls.c (split_complex_values, split_complex_types): Make + them static. + * expr.h: Remove the corresponding prototypes. + +2004-11-08 Richard Earnshaw + + * arm.c (arm_handle_notshared_attribute): Wrap declaration and use + with #if TARGET_DLLIMPORT_DECL_ATTRIBUTES. + +2004-11-08 Kazu Hirata + + * tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if" + statements that always trigger. + +2004-11-08 Kazu Hirata + + * tree-cfg.c, tree-if-conv.c, tree-into-ssa.c, + tree-scalar-evolution.c, tree-ssa-loop-im.c, + tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c, + tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where + appropriate. + +2004-11-08 Ben Elliston + + * cgraph.h (cgraph_calls_p): Remove. + * cgraph.c (cgraph_calls_p): Likewise. + + * varray.h (varray_copy): Remove. + * varray.c (varray_copy): Likewise. + +2004-11-07 Andrew Pinski + + PR target/18269 + * config/darwin.c (machopic_indirect_data_reference): + Call gen_macho_high and gen_macho_low instead of + checking the mode and calling gen_macho_high_di directly. + * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. + * config/rs6000/rs6000.md: Move most of TARGET_MACHO expand/insns + to darwin.md. + (movdf_low, movsf_low, movsf_low_st, movsi_low, macho_correct_pic, + load_macho_picbase, macho_low, macho_high): Removed. + (builtin_setjmp_receiver): Call gen_macho_high and + gen_macho_low instead of checking the mode and calling + gen_macho_high_di directly. + * config/rs6000/darwin.md (load_macho_picbase_di): Use the MD constant. + (movdf_low_si, movsf_low_si, movsf_low_st_si, movsi_low_st): + Moved from rs6000.md. + (macho_high): New expander. + (macho_high_si): Renamed version of macho_high from rs6000.md. + (macho_low): New expander. + (macho_low_si): Renamed version of macho_low from rs6000.md. + (load_macho_picbase): New expander. + (load_macho_picbase_si): Renamed version of load_macho_picbase + from rs6000.md. + (macho_correct_pic): New expander. + (macho_correct_pic_si): Renamed version of macho_correct_pic + from rs6000.md. + +2004-11-07 Joseph S. Myers + + * c-decl.c (finish_struct): Use complete sentences for diagnostic + for structures or unions with no members or named members. + +2004-11-07 Joseph S. Myers + + * c-typeck.c (build_unary_op): Replace unreachable diagnostic for + taking address of bit-field by assertion. + +2004-11-06 Ulrich Weigand + + * config/s390/s390.md (attribute "op_type"): Default to "NN". + (attribute "atype"): Default to "agen". + (attribute "length"): Default to 6. + (define_asm_attibutes): Remove. + ("movti", "*movdi_64", "*movdi_31", "*movsi_zarch", "*movsi_esa", + "*movhi", "*movqi", "*movdf_64", "*movdf_31", "movsf", + "*clc", "*mvc", "*nc", "*oc", "*xc", "*xc_zero"): + Do not set type attribute to "cs" where already default. + ("*cmpint_si", "*cmpint_di", "fix_truncdfsi2_ibm", "floatsidf2_ibm", + "*negdi2_31"): + Do not set type attribute to "other" where already default. + ("movti", "*movdi_64", "*movdi_31", "*movdf_31", + "*strlendi", "*strlensi", + "*movmem_long_64", "*movmem_long_31", + "*clrmem_long_64", "*clrmem_long_31", + "*cmpmem_long_64", "*cmpmem_long_31", + "*cmpint_si", "*cmpint_di", + "addti3", "*adddi3_31z", "*adddi3_31", + "subti3", "*subdi3_31z", "*subdi3_31", "*negdi2_31", + "*sconddi", "*scondsi", "*sconddi_neg", "*scondsi_neg", + "fix_truncdfsi2_ibm", "floatsidf2_ibm", "extendsfdf2_ibm", + "*pool_entry", "pool_align", "pool_section_start", + "pool_section_end", "main_pool", "reload_base_31", "pool"): + Do not set op_type attribute to "NN" where already default. + ("*extractqi", "*extracthi", "*zero_extendhisi2_31", + "*zero_extendqisi2_31", "*zero_extendqihi2_31", + "fix_truncdfsi2_ibm", "floatsidf2_ibm"): + Do not set atype attribute to "agen" where already default. + ("*movmem_short", "*clrmem_short", "*cmpmem_short"): Don't set op_type. + +2004-11-06 Richard Sandiford + + * config/mips/t-iris6 (tp-bit.c): Fix target filename. + +2004-11-06 Richard Sandiford + + PR target/16830 + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Don't define the + R3000 and R4000 macros on IRIX. + +2004-11-06 Andreas Schwab + + PR target/16286 + * config/rs6000/altivec.h: Replace bool by __bool and pixel by + __pixel. + +2004-11-06 Kazu Hirata + + * tree-ssa-copyrename.c (rename_ssa_copies): Make it static. + +2004-11-06 Ulrich Weigand + + * config/s390/2064.md ("z_int", "z_agen"): Ensure the condition + matches no insns already matched by other reservations. + * config/s390/2084.md ("x_int", "x_agen"): Ensure the condition + matches no insns already matched by other reservations. + ("x_ss"): Remove, replace by ... + ("x_cs"): ... this new reservation. Check type instead of op_type. + Update bypasses to use x_cs instead of x_ss. + ("x_nn"): Remove, replace by ... + ("x_other"): ... this new reservation. Check type instead of op_type. + Add x_other and x_branch to bypasses. + ("x_vs"): New reservation. + * config/s390/s390.md (attribute "type"): Default according to op_type. + ("*execute"): Set type to "cs". + +2004-11-06 Kazu Hirata + + * fold-const.c (non_lvalue): Don't construct NON_LVALUE_EXPR + if we are in GIMPLE. + +2004-11-06 Hans-Peter Nilsson + + PR rtl-optimization/17933 + * rtlanal.c (dead_or_set_regno_p): Break out common code to... + (covers_regno_p): New function. Handle SETs of PARALLEL, + and defer the rest to... + (covers_regno_no_parallel_p): New function. + +2004-11-06 Eric Botcazou + + * config/sparc/sparc.c (function_arg_record_value_1): Skip + fields with zero length. + (function_arg_record_value_2): Likewise. + (function_arg_record_value_3): Use smallest_mode_for_size + instead of mode_for_size. + (function_arg_union_value): Return naked register for unions + with zero length. + +2004-11-06 Eric Botcazou + + * config/sparc/sparc.c (scan_record_type): Handle vector types. + (function_arg_slotno): Handle vector types specially. + (function_arg_record_value_1): Split fields with vector type and + BLKmode into their subparts. + (function_arg_record_value_2): Likewise. Be prepared to handle + more than 2 registers per field. + (function_arg_union_value): Increment regno inside the loop. + (function_arg_vector_value): New function. + (function_arg): Use it to split fields with vector type and + BLKmode into their subparts and build a PARALLEL. Treat + other vector types like floats. + (function_value): Likewise. + (sparc_pass_by_reference): Handle vector types. + (sparc_return_in_memory): Likewise. + +2004-11-06 Kazu Hirata + + * tree-cfg.c (find_taken_edge_cond_expr): Remove an "if" + statement that never triggers. + +2004-11-06 Ulrich Weigand + + * config/s390/2064.md ("z_o2", "z_o3"): Remove. + * config/s390/2084.md ("x_o2", "x_o3"): Remove. + ("x_fdivd"): Use also for fsqrtd type. + ("x_fdivs"): Use also for fsqrts type. + * config/s390/s390.md (attribute "type"): Remove "o2" and "o3" types. + ("fix_truncdfsi2_ieee"): Set type to "ftoi". + ("fix_truncdfsi2_ibm"): Set type to "other". + ("floatdidf2", "floatdisf2"): Do not clobber CC. + ("floatsidf2", "floatsidf2_ieee"): Likewise. + ("floatsisf2", "floatsisf2_ieee"): Likewise. + ("truncdfsf2", "truncdfsf2_ieee"): Only allow "register_operand". + ("truncdfsf2_ibm"): Only allow "nonimmediate_operand". Use LER + instead of LRER. + ("extendsfdf2_ibm"): Do not set atype. Set type to "floads". + ("sqrtdf2"): Set type to "fsqrtd". + ("sqrtsf2"): Set type to "fsqrts". + +2004-11-06 Kazu Hirata + + * tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a + pointer to the last PHI node in the new PHI chain. + +2004-11-06 Kaz Kojima + + * config/sh/sh.c (prepare_move_operands): Emit a use of r12 + for non-PIC TLS_MODEL_INITIAL_EXEC case. + +2004-11-06 Kazu Hirata + + * expmed.c: Fix a comment typo. + +2004-11-06 Aaron W. LaFramboise + + PR target/18106 + * config/i386/cygming.h + [HAVE_GAS_WEAK] (ASM_WEAKEN_LABEL): Macro defined. + +2004-11-06 Kazu Hirata + + * config/sh/sh4a.md: Fix copyright. + +2004-11-06 Kazu Hirata + + * config/rs6000/darwin.md, config/sh/sh4a.md: Replace GNU CC + with GCC. + +2004-11-05 David Edelsohn + + * config/rs6000/rs6000.md (scc patterns): Replace subfc with subf + when carry not used. Suggested by Torbjorn Granlund. + + * config/rs6000/rs6000.c (rs6000_emit_move): Don't force_reg + operand[1] unnecessarily. Suggested by Eric Christopher. + (rs6000_adjust_cost): Increase latency of store to wider load. + (rs6000_rtx_costs): mulli only allows 16-bit constants. + +2004-11-05 Stan Shebs + + * config/rs6000/rs6000.c (machopic_output_stub): Output + ldu instead of lwzu for 64-bit stubs. + +2004-11-05 Richard Henderson + + * config/alpha/alpha.c (alpha_expand_unaligned_load): Special case + size 2 with BWX. + (alpha_expand_unaligned_store): Likewise. + +2004-11-05 Richard Henderson + + * expmed.c (extract_force_align_mem_bit_field): New. + (extract_split_bit_field): Call it. + +2004-11-05 Richard Henderson + + * ia64.md (UNSPEC_SHRP): New. + (dshift_count_operand): New. + (ashrti3, ashrti3_internal, lshrti3, lshrti3_internal, shrp): New. + * ia64.c (rtx_needs_barrier): Handle UNSPEC_SHRP. + +2004-11-05 Joseph S. Myers + + * c-typeck.c (output_init_element): Return early if value is + error_mark_node. + +2004-11-05 James E Wilson + + * invoke.texi (-fno-guess-branch-probability): Rewrite. + + * config/ia64/ia64.c (rtx_needs_barrier, case UNSPEC_GR_SPILL): Change + 1 to UNSPEC_GR_SPILL. + +2004-11-05 Andreas Krebbel + + * config/s390/s390.c (s390_fixed_condition_code_regs): New function. + (TARGET_FIXED_CONDITION_CODE_REGS): Macro defined. + +2004-11-05 Nathan Sidwell + + * bitmap.h (enum bitmap_bits): Remove. + (bitmap_operation): Remove. + (bitmap_and, bitmap_and_into, bitmap_and_compl, + bitmap_and_compl_into, bitmap_ior, bitmap_ior_into, bitmap_xor, + bitmap_xor_into): Prototype. + * bitmap.c (bitmap_elt_insert_after, bitmap_elt_clear_from): New. + (bitmap_operation): Remove. + (bitmap_and, bitmap_and_into, bitmap_and_compl, + bitmap_and_compl_into, bitmap_ior, bitmap_ior_into, bitmap_xor, + bitmap_xor_into): New. + (bitmap_ior_and_compl, bitmap_ior_and_compl_into): Adjust. + + PR tree-optimization/18307 + * tree-ssa-alias.c (merge_pointed_to_info): Protected against DEST + and ORIG being the same node. + +2004-11-04 Geoffrey Keating + + * Makefile.in (distclean): Don't delete nonexistent fixinc/ directory. + (install-mkheaders): Install the version built for the + host, not for the build machine. + * configure.ac: Always run fixincludes. + (all_outputs): Remove mkheaders. + * configure: Regenerate. + * fixinc.in: Move to fixincludes/. + * mkfixinc.sh: Likewise. + * mkheaders.in: Likewise. + * README-fixinc: Likewise. + +2004-11-05 Ramana Radhakrishnan + + PR target/18263 + * config/arc/lib1funcs.asm (___umulsidi3): Change use of cmp to the + equivalent on the A4. + +2004-11-05 Joseph S. Myers + + * doc/c-tree.texi, doc/cfg.texi, doc/contrib.texi, doc/cpp.texi, + doc/cppopts.texi, doc/extend.texi, doc/fragments.texi, + doc/frontends.texi, doc/gcov.texi, doc/hostconfig.texi, + doc/implement-c.texi, doc/install.texi, doc/invoke.texi, + doc/libgcc.texi, doc/md.texi, doc/passes.texi, + doc/portability.texi, doc/rtl.texi, doc/sourcebuild.texi, + doc/standards.texi, doc/tm.texi, doc/tree-ssa.texi, + doc/trouble.texi: Correct end-of-sentence markup and markup of + "etc.", "e.g." and "i.e.". Use @code in various places where + appropriate. + +2004-11-05 Joseph S. Myers + + * doc/c-tree.texi, doc/cfg.texi, doc/extend.texi, doc/gty.texi, + doc/install.texi, doc/invoke.texi, doc/md.texi, doc/passes.texi, + doc/rtl.texi, doc/tm.texi, doc/tree-ssa.texi: Remove trailing + whitespace. + +2004-11-04 Mark Mitchell + + * config/arm/arm.c (arm_handle_notshared_attribute): New function. + * doc/extend.texi: Document "notshared" attribute. + +2004-11-04 Kazu Hirata + + * tree-phinodes.c (make_phi_node): Make it static. + * tree.h: Remove the prototypes for make_phi_node. + +2004-11-04 Kazu Hirata + + * stmt.c (expand_asm, expand_asm_operands): Make them static. + * tree.h: Remove the prototypes for expand_asm and + expand_asm_operands. + +2004-11-04 Kazu Hirata + + * passes.c (rest_of_compilation): Make it static. + * toplev.h: Remove the prototype for rest_of_compilation. + +2004-11-04 Kazu Hirata + + * jump.c (cleanup_barriers): Use delete_insn instead of + delete_barrier. + (delete_barrier): Remove. + * rtl.h: Remove the corresponding prototype. + +2004-11-04 Kazu Hirata + + * expr.c (mostly_zero_p): Make it static. + * tree.h: Remove the prototype for mostly_zeros_p. + +2004-11-04 Kazu Hirata + + * cfgrtl.c (force_nonfallthru_and_redirect): Make it static. + +2004-11-04 Kazu Hirata + + * builtins.c (expand_builtin_return_addr, + expand_builtin_longjmp, expand_builtin_trap): Make them static. + * expr.h: Remove the prototypes for expand_builtin_longjmp and + expand_builtin_trap. + * tree.h: Remove the prototype for expand_builtin_return_addr. + +2004-11-04 Kazu Hirata + + * tree-cfg.c (find_taken_edge): Reject VAL begin NULL. + * tree-ssa-ccp.c (visit_cond_stmt): Don't call find_taken_edge + with VAL being NULL. + +2004-11-04 Kazu Hirata + + * cfghooks.c (delete_basic_block): Remove code to truncate + edge vectors. + +2004-11-04 Andrew Pinski + + * flow.c (init_propagate_block_info): Change the type of i to + unsigned. + +2004-11-04 Ulrich Weigand + + PR tree-optimization/18184 + * c-typeck.c (comptypes): Do not treat pointers of different + modes or alias-all flags as equivalent. + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Likewise. + +2004-11-04 Joseph S. Myers + + * doc/gty.texi, doc/makefile.texi, doc/sourcebuild.texi: Don't + reference specific C parser files in examples. + +2004-11-04 Richard Sandiford + + PR target/15342 + * regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs + as OP_INOUT if the instruction is predicated. + +2004-11-04 Kazu Hirata + + * bitmap.h: Fix a comment typo. Follow spelling conventions. + * tree-vectorizer.c: Fix a comment typo. + +2004-11-04 Kazu Hirata + + * sdbout.c (SDB_GENERATE_FAKE): Remove. + (gen_fake_label): Don't use SDB_GENERATE_FAKE. + * system.h: Poison SDB_GENERATE_FAKE. + * doc/tm.texi (SDB_GENERATE_FAKE): Remove. + +2004-11-04 Ulrich Weigand + + * config/s390/s390.md ("*addsi3_sign"): Use canonical RTL. + +2004-11-04 Eric Botcazou + + PR other/18277 + * gthr-posix.h (__gthread_recursive_mutex_init_function): Revert + 2004-10-29 patch + +2004-11-04 Nathan Sidwell + + * predict.c (propagate_freq): Make bitno unsigned. Move + npredecessors update out of loop. + + * bitmap.h (bitmap_iterator): Remove word_bit and bit + fields. Rename others. + (bmp_iter_common_next_1, bmp_iter_single_next_1, + bmp_iter_single_init, bmp_iter_end_p, bmp_iter_single_next, + bmp_iter_and_not_next_1, bmp_iter_and_not_init, + bmp_iter_and_not_next, bmp_iter_and_next_1, bmp_iter_and_init, + bmp_iter_and_next): Remove. + (bmp_iter_set_init, bmp_iter_and_init, bmp_iter_and_compl_init, + bmp_iter_next, bmp_iter_set, bmp_iter_and, bmp_iter_and_compl): + New. + (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_IN_BITMAP, + EXECUTE_IF_AND_COMPL_IN_BITMAP): Adjust. + + * bitmap.h (bitmap_a_or_b, bitmap_a_and_b): Remove. + * df.c (dataflow_set_a_op_b): Use bitmap_and, bitmap_ior, + bitmap_and_into, bitmap_ior_into as appropriate. + * except.c (remove_eh_handler): Likewise. + * global.c (modify_bb_reg_pav, make_accurate_live_analysis): Likewise. + * tree-dfa.c (mark_new_vars_to_rename): Likewise. + * tree-ssa-alias.c (merge_pointed_to_info): Likewise. + * tree-ssa-live.h (live_merge_and_clear): Likewise. + * tree-ssa-loop-ivopts.c (find_best_candidate, try_add_cand_for): + Likewise. + + * bitmap.c (bitmap_print): Make bitno unsigned. + * bt-load.c (clear_btr_from_live_range, + btr_def_live_range): Likewise. + * caller-save.c (save_call_clobbered_regs): Likewise. + * cfganal.c (compute_dominance_frontiers_1): Likewise. + * cfgcleanup.c (thread_jump): Likewise. + * cfgrtl.c (safe_insert_insn_on_edge): Likewise. + * conflict.c (conflict_graph_compute): Likewise. + * ddg.c (add_deps_for_use): Likewise. + * df.c (df_refs_update): Likewise. + * except.c (remove_eh_handler): Likewise. + * flow.c (verify_local_live_at_start, update_life_info, + initialize_uninitialized_subregs, propagate_one_insn, + free_propagate_block_info, propagate_block, find_use_as_address, + reg_set_to_hard_reg_set): Likewise. + * gcse.c (clear_modify_mem_tables): Likewise. + * global.c (global_conflicts, build_insn_chain): Likewise. + * ifcvt.c (dead_or_predicable): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * loop.c (load_mems): Likewise. + * ra-build.c (livethrough_conflicts_bb, conflicts_between_webs): + Likewise. + * ra-rewrite.c (reloads_to_loads, rewrite_program2, actual_spill): + Likewise. + * reload1.c (order_regs_for_reload, finish_spills): Likewise. + * sched-deps.c (sched_analyze_insn, free_deps): Likewise. + * sched-rgn.c (propagate_deps + * tree-cfg.c (tree_purge_all_dead_eh_edges): Likewise. + * tree-dfa.c (dump_dfa_stats + tree-into-ssa.c (compute_global_livein, insert_phi_nodes, + insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags): + Likewise. + * tree-outof-ssa.c (coalesce_ssa_name, coalesce_vars, + free_temp_expr_table, find_replaceable_exprs): Likewise. + * tree-sra.c (scan_function, scalarize_parms): Likewise. + * tree-ssa-alias.c (init_alias_info, + compute_points_to_and_addr_escape, + compute_flow_sensitive_aliasing, maybe_create_global_var): Likewise. + * tree-ssa-dce.c (mark_control_dependent_edges_necessary): Likewise. + * tree-ssa-live.c (new_tree_live_info, live_worklist, + calculate_live_on_entry, calculate_live_on_exit, compare_pairs, + sort_coalesce_list, build_tree_conflict_graph, dump_live_info + tree-ssa-loop-manip.c (add_exit_phis_var): Likewise. + tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops, + add_call_read_ops): Likewise. + * tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Likewise. + * tree-ssa-live.h (num_var_partitions): Return unsigned. + +2004-11-03 Dorit Naishlos + + PR tree-optimization/18009 + * tree-vectorizer.h (enum dr_alignment_support): New type. + (MAX_NUMBER_OF_UNALIGNED_DATA_REFS): Removed. + (LOOP_UNALIGNED_DR): replaced with LOOP_VINFO_UNALIGNED_DR and holds a + single data_reference (instead of a varray of references). + * tree-vectorizer.c (new_loop_vec_info): Likewise. + (vect_gen_niters_for_prolog_loop): Likewise. + (vect_update_inits_of_drs): Likewise. + + (vect_update_inits_of_drs): Setting of DR_MISALIGNMENT moved to + vect_enhance_data_refs_alignment. + (vect_do_peeling_for_alignment): Likewise. + (vect_enhance_data_refs_alignment): Decide if and by how much to peel; + this functionality used to be in vect_analyze_data_refs_alignment. + Also update DR_MISALIGNMENT due to peeling; this functionality used to + be in vect_update_inits_of_drs and vect_do_peeling_for_alignment). + (vect_analyze_data_refs_alignment): Decision on whether and by how much + to peel moved to vect_enhance_data_refs_alignment. Call + vect_supportable_dr_alignment. + + (vect_compute_data_ref_alignment): Set STMT_VINFO_VECTYPE. + (vect_compute_data_refs_alignment): Return bool. Consider return value + of vect_compute_data_ref_alignment and return true/false accordingly. + (vect_enhance_data_refs_alignment): Consider return value of + vect_compute_data_refs_alignment and return true/false accordingly. + + (vect_supportable_dr_alignment): New function. + (vectorizable_store): Call vect_supportable_dr_alignment. + (vectorizable_load): Call vect_supportable_dr_alignment. Alignment + support checks moved from here to vect_supportable_dr_alignment. + + (vect_transform_loop): Avoid 80 columns overflow. + +2004-11-03 Andrew Pinski + + * timevar.c (timevar_enable): Change from + static. + (timevar_push): Rename to ... + (timevar_push_1): this and remove the + enabled check. + (timevar_pop): Rename to ... + (timevar_pop_1): this and remove the + enabled check. + * timevar.h (POP_TIMEVAR_AND_RETURN): Use do/while loops. + (timevar_pop): New macro. + (timevar_push): New macro. + (timevar_enable): Declare. + +2004-11-03 Andrew Pinski + + * config/darwin.h (REAL_LIBGCC_SPEC): Define to use shared + libgcc for shared libraries. + +2004-11-03 Ulrich Weigand + + * config/s390/s390-protos.h (s390_split_access_reg): Add prototype. + * config/s390/s390.c (s390_split_access_reg): New function. + (regclass_map): Add access registers. + (get_thread_pointer): Use access register instead of UNSPEC_TP. + * config/s390/s390.h (FIRST_PSEUDO_REGISTER): Set to 38. + (ACCESS_REGNO_P, ACCESS_REG_P): New macros. + (TP_REGNUM): New define. + (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, + REG_ALLOC_ORDER): Add access registers. + (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, CLASS_MAX_NREGS, + CANNOT_CHANGE_MODE_CLASS): Support access registers. + (enum reg_class): Add ACCESS_REGS. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Likewise. + (REG_CLASS_FROM_LETTER): Add 't' constraint. + (REGISTER_NAMES): Add access registers. + * config/s390/s390.md (UNSPEC_TP): Remove. + ("*movdi_64"): Add access register alternatives. Provide splitters + to split DImode access register <-> GPR moves into SImode moves. + ("*movsi_zarch", "*movsi_esa"): Add access register alternatives. + ("movstrictsi"): Likewise. + ("get_tp_64", "get_tp_31"): Reimplement using access registers. + ("set_tp_64", "set_tp_31"): Likewise. + ("*set_tp"): New insn. + +2004-11-03 Kazu Hirata + + * tree-phinodes.c (resize_phi_node): Copy only a portion of + the PHI node currently in use. + +2004-11-03 Andrew Pinski + + PR tree-opt/18231 + * tree.c (staticp) : Nested functions are static + also. + +2004-11-03 Andrew MacLeod + + PR tree-optimization/18270 + * tree-outof-ssa.c (analyze_edges_for_bb): If a block has incoming + abnormal edges, commit all pending stmts on incoming edges. + +2004-11-03 Ulrich Weigand + + * tree-ssa-loop-ivopts.c (get_address_cost): Offset zero does not + cause extra costs. Generate canonical RTL. + +2004-11-02 Daniel Berlin + + * lambda-code.c (lambda_compute_auxillary_space): Update comments. + (lambda_compute_target_space). Ditto. + * lambda.h (lambda_trans_matrix): Ditto. + (lambda_linear_expression): Ditto. + (lambda_body_vector): Ditto. + (lambda_loopnest): Ditto. + * tree-loop-linear.c (gather_interchange_stats): Combine tests, + update comments, and remove pointless addition of 0. + (linear_transform_loops): Update comments. + +2004-11-03 Sebastian Pop + + * tree.c (tree_fold_gcd): Use FLOOR_MOD_EXPR instead of + CEIL_MOD_EXPR. + +2004-11-03 Jeff Law + + * predict.c (struct block_info_def): Kill "tovisit" field. + (propagate_freq): Accept new "tovisit" parameter. Change + read/write access methods for "tovisit" to check the "tovisit" + bitmap instead of a bit in block_info_def. + (estimate_loops_at_level): Allocate "tovisit" bitmap. Pass + it to propagate_freq. + + * stmt.c (expand_case): Speed up code to detect duplicate case + label targets and count unique case label targets. + +2004-11-03 Kazu Hirata + + * cppdefault.c, cppdefault.h, timevar.h: Update copyright. + +2004-11-03 Kazu Hirata + + * bitmap.h, dbxout.c, tree-mudflap.c: Fix comment formatting. + +2004-11-03 Kazu Hirata + + * tree-cfg.c (find_taken_edge): Abort if we are given a + statement that is neither COND_EXPR nor SWITCH_EXPR. + +2004-11-02 Zdenek Dvorak + + * fold-const.c (fold): Reassociate also (x - mult) + mult and + (mult - x) + mult. Cast operands of expression after applying + distributive law to the correct types. Apply distributive law + to a * c - b * c for all non-float types. + +2004-11-02 Geoffrey Keating + + * configure.ac: Don't clear STMP_FIXINC or STMP_FIXPROTO just + because we don't want to run them now; instead, set them to + stmp-install-fixproto or stmp-install-fixinc. + * Makefile.in (stmp-install-fixproto): New. + (stmp-install-fixinc): New. + * configure: Regenerate. + +2004-11-02 Nathan Sidwell + + * flow.c (init_propagate_block_info): Use bitmap_empty_p on result + of bitmap_xor. + +2004-11-02 Ziemowit Laski + + * c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove. + (c_types_compatible_p): Move function definition... + * c-objc-common.c (c_types_compatible_p): ...here. + * c-objc-common.h (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from + c-lang.c. + +2004-11-02 Steven Bosscher + + * cfgloop.h (struct loop): Update comment. + * cse.c (cse_main): Remove obsolete comment. + + * expr.h (gen_cond_trap): Move prototype under functions provided + by optabs.c. + (canonicalize_condition, get_condition): Move to... + * rtl.h (canonicalize_condition, get_condition): ...here. + (branch_target_load_optimize): Add comment that this function is + in bt-load.c. + * loop.c (canonicalize_condition, get_condition): Move to... + * rtlanal.c (canonicalize_condition, get_condition): ...here. + * sched-deps.c (get_condition): Rename to sched_get_condition. + (add_dependence): Update this caller. + +2004-11-02 Andrew Pinski + + PR tree-opt/16808 + * tree-ssa.c (replace_immediate_uses): If we call fold_stmt, make sure + that the vops get marked for renaming. + +2004-11-02 Andreas Krebbel + + * config/s390/s390.md ("movcc"): Set type attribute. + +2004-11-02 Kazu Hirata + + * tree-phinodes.c (add_phi_arg): Add an assertion that the + edge already exists. + +2004-11-02 Kazu Hirata + + * tree-phinodes.c (remove_phi_arg_num): Do not zero the + element that's being removed. + +2004-11-02 Kazu Hirata + + * tree-ssa-threadupdate.c (copy_phis_to_block): Install PHI + arguments using PENDING_STMT. + (thread_block): Call copy_phis_to_block after redirecting an + edge. + +2004-11-02 Nathan Sidwell + + * bitmap.h (bitmap_and, bitmap_and_into, bitmap_and_compl, + bitmap_and_compl_into, bitmap_ior, bitmap_iot_into, + bitmap_ior_compl, bitmap_xor, bitmap_xor_into): Produce void. + (bitmap_ior_and_compl_into): Produce bool. + (bitmap_union_of_diff): Rename to ... + (bitmap_ior_and_compl): ... here. Produce bool. + * bitmap.c (bitmap_ior_and_compl_into): Return bool. Use + bitmap_operation directly. + (bitmap_union_of_diff): Rename to ... + (bitmap_ior_and_compl): ... here. Return bool, use + bitmap_operation directly. + * df.c (df_rd_transfer_function): Use bitmap_ior_and_compl. + (df_ru_transfer_function, df_lr_transfer_function): Likewise. + * global.c (modify_bb_reg_pav): Likewise. + + * bitmap.h (bitmap_equal_p): Return bool. + (bitmap_intersect_p, bitmap_intersect_compl_p): Declare. + * bitmap.c (bitmap_equal_p): Return bool. Compare directly. + (bitmap_intersect_p, bitmap_intersect_compl_p): New. + * flow.c (calculate_global_regs_live): Use bitmap_intersect_p and + bitmap_intersect_compl_p. + * ifcvt (dead_or_predicable): Likewise. + +2004-11-02 Nathan Sidwell + + PR rtl-optimization/17104 + * config/rs6000/rs6000.c (rs6000_emit_move): Don't wrap small + loads in zero_extend. + +2004-11-02 Danny Smith + + PR debug/18242 + * toplev.c (debug_type_names): Remove "dwarf-1". + +2004-11-02 Ben Elliston + + * timevar.h (timevar_get): Remove. + * timevar.c (timevar_get): Remove unused function. + +2004-11-02 Joseph S. Myers + + * doc/include/texinfo.tex: Update from Texinfo CVS. + +2004-11-02 Ben Elliston + + * cppdefault.h (cpp_SYSROOT): Remove. + * cppdefault.c (cpp_SYSROOT): Likewise. + +2004-11-01 Andrew MacLeod + + PR tree-optimization/16447 + * tree-cfg.c (bsi_commit_one_edge_insert): Rename from + bsi_commit_edge_inserts_1, and make funtion external. Return new block. + (bsi_commit_edge_inserts): Use renamed bsi_commit_one_edge_insert. + * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Enable listing. + * tree-flow.h (bsi_commit_one_edge_insert): Extern decl. + * tree-outof-ssa.c (rewrite_trees): Don't commit edges here. + (same_stmt_list_p): New. Return TRUE if edge is to be forwarded. + (identical_copies_p): New. Return true is two copies are the same. + (identical_stmt_lists_p): New. Return true if stmt lists are the same. + (analyze_edges_for_bb): New. Determine how best to insert edge stmts + for a basic block. + (perform_edge_inserts): New. Determine what to do with all stmts that + have been inserted on edges. + (remove_ssa_form): Analyze and commit edges from here. + +2004-11-01 Andrew Pinski + + PR bootstrap/18232 + * bitmap.h (bmp_iter_end_p): Take a const pointer instead of a struct. + (EXECUTE_IF_SET_IN_BITMAP): Update call to bmp_iter_end_p. + (EXECUTE_IF_AND_COMPL_IN_BITMAP): Likewise. + (EXECUTE_IF_AND_IN_BITMAP): Likewise. + +2004-11-01 Joseph S. Myers + + PR c/18239 + * c-decl.c (get_parm_info): Allow FUNCTION_DECLs to appear amongst + parameter declarations. + +2004-11-01 Andreas Krebbel + + * config/s390/s390.c (regclass_map): Put reg 33 (cc) to CC_REGS group. + (s390_secondary_input_reload_class) + (s390_secondary_output_reload_class): Use GENERAL_REGS to reload a cc + register. + (s390_expand_cmpmem): Enable cmpmem implementation. + * config/s390/s390.h (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): + Added three new classes: CC_REGS, ADDR_CC_REGS, GENERAL_CC_REGS. + (REG_CLASS_FROM_LETTER): New constraint 'c' added. + * config/s390/s390.md ("movcc"): New insn pattern. + * doc/md.texi: Document 'c' constraint for s390. + +2004-11-01 Nathan Sidwell + + PR c++/18064 + * doc/extend.texi (Deprecated Features): Deprecate G++ covariant + extension. + +2004-10-16 Daniel Berlin + + Fix PR tree-optimization/17672 + Fix PR tree-optimization/18168 + + * lambda-code.c (lambda_lattice_compute_base): Fix reversed + assert test. + (gcc_tree_to_linear_expression): Add extra to existing constant. + (depth_of_nest): Factor out function used in various places. + (gcc_loop_to_lambda_loop): Clean up code a little bit. No + functional changes. + (find_induction_var_from_exit_cond): Stop guessing, and just + get the right answer :). + (gcc_loopnest_to_lambda_loopnest): Remove useless pre-allocation. + Print out message about result of attempt to create perfect nest. + (lbv_to_gcc_expression): Add type argument, use it to do math + and induction variable creation. + (lle_to_gcc_expression): Ditto. + (lambda_loopnest_to_gcc_loopnest): Create new iv with same type as + oldiv. Pass type argument to lle_to_gcc_expression and + lbv_to_gcc_expression. + Reset number of iterations after transformation. + (perfect_nestify): Remove useless pre-allocation, and cleanup + a small amount. + + * tree-data-ref.c (build_classic_dist_vector): Return false for + dependences completely outside of the loop nest we asked about. + (build_classic_dir_vector): Ditto. + (compute_data_dependences_for_loop): Only add dependence relations + inside the loop we asked about. + + * tree-loop-linear.c (linear_transform_loops): Use DDR_SIZE_VECT. + Compute immediate uses. + + * tree-optimize.c: Move linear_transform_loops to before ivcanon. + +2004-11-01 Kazu Hirata + + * tree-cfg.c (thread_jumps): Fix a comment typo. + +2004-11-01 Kazu Hirata + + * tree-cfg.c (thread_jumps): Fix a comment typo. + +2004-10-31 Nicolas Pitre + + * config/arm/ieee754-sf.S (floatdisf): Fix regression with + values smaller than 2^32. + +2004-10-31 Jeff Law + + * cfgloop.h (struct loop): Remove unused "nodes" field. + * timevar.def (TV_TREE_LOOP_BOUNDS): New. + * tree-data-ref.c (find_data_references_in_loop): Use get_loop_body + instead of calling flow_bb_inside_loop_p for every basic block + in the function. + * tree-ssa-loop.c (pass_record_bounds): Use TV_TREE_LOOP_BOUNDS. + +2004-10-31 Graham Stott + + * config/pa/pa.md: (prefetch_64, prefetch_32): Fix typo. Use + INT_5_BITS instead of VAL_5_BITS_P. + +2004-10-31 Roger Sayle + + PR middle-end/14521 + * tree-inline.c (inline_forbidden_p_1): Use %qF instead of '%F' + for consistent quoting in diagnostic messages. + (expand_call_inline): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree-ssa.c (warn_uninitialized_var): Likewise. + (warn_uninitialized_phi): Likewise. + +2004-10-31 Richard Sandiford + + * config/mips/mips.c (mips_cannot_change_mode_class): Use a stricter + mode check. + +2004-10-31 Kazu Hirata + + * c-common.c: Fix a comment typo. + +2004-10-31 Jason Merrill + + PR middle-end/17526 + * tree-gimple.c (is_gimple_mem_rhs): Also require a val for + aggregate types that are not BLKmode. + +2004-10-30 Ziemowit Laski + + * c-common.h (objc_lookup_ivar): Add second parameter to + prototype. + * c-typeck.c (build_external_ref): After looking up symbol, + pass it to objc_lookup_ivar() to decide whether it or the + ivar should be used, rather than deciding the issue locally. + * stub-objc.c (objc_lookup_ivar): Add an OTHER parameter, + which is simply returned in the non-ObjC case. + +2004-10-30 Danny Smith + + * sdbout.c (sdbout_symbol): Do not output type .def statements + for builtin types. + +2004-10-30 Gabriel Dos Reis + + * c-common.c (catenate_strings): New. + (c_parse_error): Use it. Don't over-escape. + +2004-10-30 Kaz Kojima + + * config/sh/sh.c (calc_live_regs): Declare reg as unsigned and + modify the for loop expressions for it. Remove unnecessary casts. + (sh_expand_prologue): Declare reg as unsigned. + (sh_gimplify_va_arg_expr): Initinalize lab_over. + (sh_handle_sp_switch_attribute): Add const qualifier appropriately. + +2004-10-30 Geoffrey Keating + + * doc/invoke.texi (Darwin Options): Improve description of + how the subtype is chosen. + +2004-10-30 Roger Sayle + + PR middle-end/18096 + * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Check that + the stack adjustment, "size", is valid for Pmode. If the stack + frame is too large, generate a trap insn and issue a warning. + +2004-10-30 Kazu Hirata + + * tree-ssa-dom.c: Fix comment typos. + +2004-10-30 Kaz Kojima + + * config/sh/sh.c (prepare_move_operands): Use operands[0] + for the output rtl if no_new_pseudos is set. Remove redundant + line. + +2004-10-30 Joseph S. Myers + + PR c/16666 + * c-decl.c (start_function): Don't check for DECL_BUILT_IN when + determining whether to copy parameter types from a previous + prototype declaration. + +2004-10-29 Roger Sayle + + PR rtl-optimization/17581 + * cselib.c (cselib_process_insn): The last instruction of a libcall + block, with the REG_RETVAL note, should be considered in the libcall. + * gcse.c (do_local_cprop): Allow constants to be propagated outside + of libcall blocks. + (adjust_libcall_notes): Use simplify_replace_rtx instead of + replace_rtx to avoid creating invalid RTL in REG_RETVAL notes. + +2004-10-30 Kazu Hirata + + * tree-phinodes.c (create_phi_node): Don't zero PHI_REWRITTEN. + +2004-10-29 Jeff Law + + * tree-ssa-dom.c (struct edge_info): New structure holding + edge equivalences and edge redirection information. + (get_eq_expr_value, record_dominating_conditions): Kill. + (propagate_to_outgoing_edges): Renamed from cprop_into_phis. + Call record_edge_info. + (allocate_edge_info, free_edge_info): New. + (tree_ssa_dominator_optimize): Use propagate_to_outgoing_edges + rather than cprop_into_phis. Free all edge infos before threading + jumps. + (thread_across_edge): Allocate new edge info structures as needed + and store the redirection target into the edge info structure + instead of the edge's AUX field. + (dom_opt_initialize_block): Mark unused argument with ATTRIBUTE_UNUSED. + (record_equivalence_from_incoming_edge): Lose unnecessary argument. + Revamp code which finds and records equivalences associated with + edges to use saved data in the edge_info structure. + (record_equivalencs_from_phis): Similarly. + (dom_opt_finalize_block): Revamp code which finds and records + equivalences associated with edges to use saved data in the + edge_info structure. + (build_and_record_new_cond): New function. + (record_conditions): Use build_and_record_new_cond to record + dominating conditions. + (record_edge_info): New function. + (record_range): Tighten test for conditions which create + useful range records. + +2004-10-29 Geoffrey Keating + + * config/i386/darwin.h (ASM_SPEC): Simplify. + (SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec. + * config/rs6000/darwin.h (DARWIN_SUBARCH_SPEC): New. + (SUBTARGET_EXTRA_SPECS): Add darwin_subarch spec. + * config/darwin.h (LINK_COMMAND_SPEC): Don't pass -arch here. + (LINK_SPEC): Do pass -arch here. Handle -force_cpusubtype_ALL + in all cases. Pass the right -arch or -arch_only based on -mcpu. + (ASM_SPEC): Handle -force_cpusubtype_ALL. + * doc/invoke.texi (Darwin Options): Improve documentation for + Darwin linker (and libtool) switches. + + * config/rs6000/darwin-fallback.c: Include . + +2004-10-29 Stan Shebs + + * config/rs6000/darwin-tramp.asm: Make more 64-bit-friendly. + +2004-10-29 Kazu Hirata + + * tree-phinodes.c (allocate_phi_node): New. + (make_phi_node, resize_phi_node): Use it. + +2004-10-29 David Edelsohn + + * config/rs6000/sysv4.h (TARGET_POWER): Define as 0. + * config/rs6000/darwin.h (TARGET_POWER): Define as 0. + +2004-10-29 Kazu Hirata + + * tree-phinodes.c (make_phi_node, resize_phi_node): Don't zero + the whole PHI node. + * tree.h (tree_phi_node): Tell the garbage collector to chase + num_args arguments. + +2004-10-29 Richard Earnshaw + + * opts.c (decode_options): Lower the crossjump threshold for -Os. + +2004-10-29 Diego Novillo + + * tree.h (struct tree_ssa_name): Remove field 'equiv'. + +2004-10-28 Nathan Sidwell + + * bitmap.h (bitmap_empty_p): New. + (bitmap_and, bitmap_and_into, bitmap_and_compl, + bitmap_and_compl_into, bitmap_ior, bitmap_ior_into, + bitmap_ior_compl, bitmap_xor, bitmap_xor_into): New bitmap + operation macros. + (bitmap_ior_and_compl): Rename to ... + (bitmap_ior_and_compl_into): ... here. + * bitmap.c (bitmap_equal_p): Use bitmap_xor. + (bitmap_ior_and_compl): Rename to ... + (bitmap_ior_and_compl_into): ... here. Adjust. Return changed + flag. + (bitmap_union_of_diff): Use renamed bitmap functions. + * basic-block.h (AND_REG_SET, AND_COMPL_REG_SET, IOR_REG_SET, + XOR_REG_SET, IOR_AND_COMPL_REG_SET): Likewise. + * cfgrtl.c (safe_insert_insn_on_edge): Likewise. + * df.c (df_bb_rd_local_compute) + * flow.c (calculate_global_regs_live, + init_propagate_block_info): Likewise. + * ifcvt.c (find_if_case_1, find_if_case_2, + dead_or_predicable): Likewise. + * ra-build.c (union_web_part_roots, livethrough_conflicts_bb, + reset_conflicts, conflicts_between_webs): Likewise. + * ra-rewrite.c (reloads_to_loads, rewrite_program2, + detect_web_parts_to_rebuild): Likewise. + * sched-ebb.c (compute_jump_reg_dependencies): Likewise. + * tree-int-ssa.c (insert_phi_nodes_for, rewrite_into_ssa): Likewise. + * tree-sra.c (decide_instantiations): Likewise. + * tree-ssa-alias.c (create_name_tags, + merge_pointed_to_info): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. + * tree-ssa-loop-im.c (move_computations): Likewise. + * tree-ssa-operands.c (get_call_expr_operands): Likewise. + * tree-ssa-pre.c (fini_pre): Likewise. + * tree-ssa.c (verify_flow_sensitive_alias_info): Likewise. + * tree-ssanames.c (any_marked_for_rewrite_p): Likewise. + * tree-vectorizer.c (vectorize_loops): Likewise. + +2004-10-29 Nick Clifton + + config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): When + adding the PIC register to the fixed_regs array, also add it + to the call_used_regs array. + +2004-10-29 Eric Botcazou + + * gthr-posix.h (__gthread_recursive_mutex_init_function): Guard + with #ifdef PTHREAD_MUTEX_RECURSIVE/#endif pairs. + +2004-10-28 Daniel Berlin + + * tree-into-ssa.c (rewrite_virtual_phi_arguments): New function. + (rewrite_blocks): Modify argument, and use it to decide which + function to call. + (rewrite_def_def_chains): Call rewrite_blocks with true here. + (rewrite_into_ssa): and call it with false here. + +2004-10-29 Kazu Hirata + + * tree-phinodes.c (add_phi_arg): Turn an "if" that always + triggers into gcc_assert. + +2004-10-28 Diego Novillo + + PR tree-optimization/16728 + * tree-flow.h (get_ptr_info): Declare. + * tree-ssa-alias.c (get_ptr_info): Make extern. + * tree-ssa-copy.c (merge_alias_info): Merge flow-sensitive + alias information. + +2004-10-28 Stan Shebs + + * config/rs6000/darwin.h (SUBTARGET_EXTRA_SPECS): Handle -m64. + * config/rs6000/rs6000.c (rs6000_darwin_file_start): Add ppc64 + case. + +2004-10-28 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_init): Mark cache-lookup decls to + prevent their later unnecessary registration. + (mf_build_check_statement_for): Remove "addr" argument, and + related "__mf_value" generated code. Update callers. + (mf_decl_eligible_p): New function, factored from mx_register_decls. + (mx_register_decls): Call it. + (mf_xform_derefs_1): Rewrite COMPONENT_REF and ARRAY_REF cases + to restore support for complex nested expressions. + (mudflap_enqueue_decl): Simplify. Move registration call emission + out ... + (mudflap_finish_file): ... to here. + (mudflap_enqueue_constant): Remove dump code. + +2004-10-28 Zack Weinberg + + PR 18199 + * dbxout.c (dbxout_begin_complex_stabs_noforcetext): New function. + (DBX_FINISH_STABS): Add (unused by default) SYM parameter. + (dbxout_finish_complex_stabs): Update to match. + (dbxout_symbol_location): Call emit_pending_bincls_if_required + and FORCE_TEXT before DBX_STATIC_BLOCK_START. Use + dbxout_begin_complex_stabs_noforcetext. + * xcoffout.h (DBX_FINISH_STABS): Restore special case for + N_GSYM, using new SYM parameter. Correct logic for special + cases for N_FUN. + + * varasm.c (function_section): If DECL is NULL_TREE, don't try + to do anything else. Do not call get_insns if cfun or + cfun->emit are NULL. + +2004-10-28 Adam Nemet + + PR middle-end/18160 + * c-typeck.c (c_mark_addressable): Issue error if address of a + register variable is taken. Use "%qD" to print DECL_NAME. + +2004-10-28 Diego Novillo + + * opts.c (decode_options): Don't run PRE at -Os. + +2004-10-28 Richard Henderson + + * config/alpha/alpha.md (movqicc_internal): Allow exactly one + zero in the conditional. + (movhicc_internal, movsicc_internal, movdicc_internal): Likewise. + +2004-10-28 Richard Henderson + + * cse.c (memory_extend_rtx): Remove. + (cse_main): Don't set it. + (cse_insn): Use a local buffer instead. + +2004-10-28 Andreas Krebbel + + * profile.c (branch_prob): Call to init_edge_profiler added. + * rtl-profile.c (rtl_init_edge_profiler): New function. + (rtl_gen_edge_profiler): Replaced call to insert_insn_on_edge with + call to safe_insert_insn_on_edge. + (rtl_profile_hooks): rtl_init_edge_profiler added. + * tree-profile.c (tree_init_edge_profiler): New function. + (tree_profile_hooks): tree_init_edge_profiler added. + * value-prof.h (profile_hooks) init_edge_profiler prototype added. + +2004-10-28 Nick Clifton + + * config/iq2000/iq2000.c (iq2000_expand_epilogue): Use + emit_jump_insn() to generate the return instruction. + +2004-10-28 Kazu Hirata + + * tree-phinodes.c: Remove trailing whitespace. + +2004-10-28 Kazu Hirata + + * tree-ssa-loop-ivopts.c: Fix a comment typo. + * doc/invoke.texi: Fix a typo. + +2004-10-28 Kazu Hirata + + * Makefile.in (OBJS-common): Remove duplicates. + +2004-10-28 Kazu Hirata + + * lambda-code.c (nestify_update_pending_stmts): Remove. + (perfect_nestify): Use flush_pending_stmts instead of + nestify_update_pending_stmts. + * tree-cfg.c (tree_make_forwarder_block): Use + flush_pending_stmts. + * tree-flow.h: Add a prototype for flush_pending_stmts. + * tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge): + Use flush_pending_stmts. + (lv_update_pending_stmts): Remove. + (tree_ssa_loop_version): Use flush_pending_stmts instead of + lv_update_pending_stmts. + * tree-ssa.c (flush_pending_stmts): New. + +2004-10-28 Ulrich Weigand + + PR target/15286 + * final.c (alter_subreg): Compute correct offset to use with + paradoxical SUBREGs of memory operands. + * recog.c (general_operand): Allow paradoxical SUBREGs of + memory operands after reload. + * simplify-rtx.c (simplify_gen_subreg): Fail if simplify_subreg + has failed when passed a hard register. + +2004-10-28 Aldy Hernandez + + * function.c (assign_parm_setup_block): Handle parallels correctly. + +2004-10-28 Kaz Kojima + + * final.c (shorten_branches): Initialize flags structure. + +2004-10-28 Nathan Sidwell + + * tree.c (int_cst_node, int_cst_hash_table): New variables. + (init_ttree): Initialize them. + (int_cst_hash_hash, int_cst_hash_eq): New hashing functions. + (build_int_cst_wide): Use hash table for oversized integers. + +2004-10-28 Nick Clifton + + * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Define + begin_label. + +2004-10-27 Richard Henderson + + PR middle-end/18163 + * expr.c (emit_group_load): Don't go force temporary for memory + or concat source. + (emit_group_store): Similarly. + +2004-10-27 Andrew Pinski + + PR other/18186 + * common.opt (--param): Fix spelling of parameter. + +2004-10-27 Andrew Pinski + + PR tree-opt/17529 + * tree-cfg.c (remove_useless_stmts_1) : + Don't fold statement. + : Fold the statement. + +2004-10-28 Kazu Hirata + + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary) + : Use EDGE_COUNT instead of GOTO_DESTINATION. + +2004-10-28 Joseph S. Myers + + * doc/contrib.texi, doc/cpp.texi, doc/cppopts.texi, + doc/extend.texi, doc/gcov.texi, doc/install.texi, doc/invoke.texi, + doc/libgcc.texi, doc/md.texi, doc/passes.texi, + doc/sourcebuild.texi, doc/tm.texi: Improve Texinfo formatting. + +2004-10-28 Joseph S. Myers + + * doc/c-tree.texi, doc/cpp.texi, doc/implement-c.texi, + doc/invoke.texi, doc/md.texi, doc/passes.texi, doc/tm.texi: Put + punctuation outside quotes. + +2004-10-27 David Mosberger + James E Wilson + + PR target/13158 + * config/ia64/ia64.c (ia64_expand_epilogue): Set RTX_FRAME_RELATED_P on + sibcall alloc instruction. + (process_set): Handle sibcall alloc instruction. + +2004-10-27 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_attribute_table): Add + SUBTARGET_ATTRIBUTE_TABLE. + * config/darwin.h (ASM_WEAKEN_DECL): Handle weak_import. + (SUBTARGET_ATTRIBUTE_TABLE): Define. + * config/darwin.c (darwin_handle_weak_import_attribute): New. + (HAVE_DEAD_STRIP): Delete. + (no_dead_strip): Don't test HAVE_DEAD_STRIP. + * config/darwin-protos.h (darwin_handle_weak_import_attribute): + Prototype. + + * doc/tm.texi (USE_SELECT_SECTION_FOR_FUNCTIONS): Document. + + * config/darwin.h (GTHREAD_USE_WEAK): Define. + +2004-10-28 Ben Elliston + + * params.def (PARAM_SRA_MAX_STRUCTURE_SIZE): New. + (PARAM_SRA_FIELD_STRUCTURE_RATIO): Likewise. + * params.h (SRA_MAX_STRUCTURE_SIZE): New. + (SRA_FIELD_STRUCTURE_RATIO): Likewise. + * tree-sra.c: Include "params.h". + (decide_block_copy): Use new parameters. + * doc/invoke.texi (Optimize Options): Document new SRA pass + parameters sra-max-structure-size and sra-field-structure-ratio. + +2004-10-27 Nicolas Pitre + + * config/arm/ieee754-df.S (floatdidf): Fix regression with big values. + +2004-10-27 Zdenek Dvorak + + PR tree-optimization/18048 + * fold-const.c (try_move_mult_to_index): New function. + (fold): Use try_move_mult_to_index. + * tree-ssa-loop-ivopts.c (try_add_cand_for): Prefer common candidates. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Produce + an all-ones unsigned constant without extra bits. + * tree.c (build_low_bits_mask): New function. + * tree.h (build_low_bits_mask): Declare. + +2004-10-27 David Edelsohn + + PR target/17956 + * config/rs6000/rs6000.md (maxsf3): Add !flag_trapping_math to + final condition. + (minsf3): Same. + (maxdf3): Same. + (mindf3): Same. + +2004-10-27 Kazu Hirata + + * tree-cfg.c (thread_jumps): Speed up by reordering the two + conditions for entering basic blocks into worklist. + +2004-10-27 Kazu Hirata + + * tree-cfg.c (thread_jumps): Speed up by pretending to have + ENTRY_BLOCK_PTR in worklist. + +2004-10-27 Kazu Hirata + + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary) + : Don't let an explicit GOTO_EXPR slip through. + +2004-10-27 Daniel Berlin + + Fix PR tree-optimization/17133 + + * tree-cfg.c (rewrite_to_new_ssa_names_bb): Also rewrite must + def kill operand. + + * tree-flow-inline.h: V_MUST_DEF_OP became V_MUST_DEF_RESULT. + (get_v_must_def_result_ptr): Modify for new structure of + v_must_defs array. + (get_v_must_def_kill_ptr): New. + (op_iter_next_use): Add support for the kill that occurs in V_MUST_DEFs. + (op_iter_next_tree): Ditto. Also V_MAY_DEF_OP became V_MAY_DEF_RESULT. + (op_iter_next_def): V_MAY_DEF_OP became V_MAY_DEF_RESULT. + (op_iter_init): Initialize new mustu members. + (op_iter_next_mustdef): New function. + (op_iter_init_mustdef): Ditto. + + * tree-flow.h (rewrite_def_def_chains): New function. + + * tree-into-ssa.c (mark_def_sites): Handle mustdefkill operands. + (ssa_mark_def_sites): Ditto. + (rewrite_stmt): Ditto. + (ssa_rewrite_stmt): Ditto. + (rewrite_blocks): Factor out from rewrite_into_ssa. + (mark_def_block_sites): Ditto. + (rewrite_def_def_chains): New function, just rewrites def-def + chains without phi node insertion. + + * tree-pass.h (TODO_fix_def_def_chains): New todo flag. + + * tree-optimize.c (execute_todo): Handle TODO_fix_def_def_chains. + + * tree-pretty-print.c (dump_vops): Print out MUST_DEF's so that + they include the rhs now. + + * tree-ssa-ccp.c (visit_assignment): V_MUST_DEF_OP became + V_MUST_DEF_RESULT. + + * tree-ssa-dce.c (mark_operand_necessary): Add phionly argument. + Update callers. + (mark_really_necessary_kill_operand_phis): New function. + (perform_tree_ssa_dce): Call it. + (pass_dce): Add TODO_fix_def_def_chains. + (pass_cd_dce): Ditto. + + * tree-ssa-loop-im.c (determine_max_movement): Look at kills as + well. + (rewrite_mem_refs): Ditto. + + * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Look at kills + as well. + + * tree-ssa-operands.c (allocate_v_may_def_optype): + v_may_def_operand_type_t became v_def_use_operand_type_t. + (allocate_v_must_def_optype) Ditto. + (finalize_ssa_v_must_defs): Update for new operand type, as well + as setting the use portion as well. + (copy_virtual_operands): Copy the kill operand as well. + (create_ssa_artficial_load_stmt): V_MUST_DEF_OP became + V_MUST_DEF_RESULT. + + * tree-ssa-operands.h (v_may_def_operand_type): Renamed to + v_def_use_operand_type. + (v_must_def_optype_d): Use v_def_use_operand_type. + (V_MUST_DEF_OP_*): Renamed to V_MUST_DEF_RESULT_* + (V_MUST_DEF_KILL_*): New macros. + (struct ssa_operand_iterator_d): Add num_v_mustu and v_mustu_i + members. + Rename existing must_i and num_v_must members to mustd_i and + num_v_mustd. + (SSA_OP_VMUSTDEFKILL): New flag. + (SSA_OP_VIRTUAL_KILLS): New flag. + (SSA_OP_ALL_OPERANDS): Add in SSA_OP_ALL_KILLS. + (SSA_OP_ALL_KILLS): New flag. + (FOR_EACH_SSA_MUSTDEF_OPERAND): New macro. + + * tree-ssa.c (verify_ssa): Verify virtual kills as well. + + * tree-vectorizer.c (vect_create_data_ref_ptr): V_MUST_DEF_OP + became V_MUST_DEF_RESULT. + (rename_variables_in_bb): Rename kill pointer as well. + + * tree-dfa.c (compute_immediate_uses_for_stmt): Add kills into the + immediate uses. + +2004-10-27 Richard Sandiford + + * dbxout.c (dbxout_source_line): Move declaration of begin_label to + the block that needs it. + +2004-10-27 Zack Weinberg + + * dbxout.c (dbxout_finish_complex_stabs): Mark 'line' variable + ATTRIBUTE_UNUSED. + +2004-10-27 Zack Weinberg + + * c-lex.c (cb_def_pragma): Clean up code for making location + palatable to diagnostic.c. + +2004-10-27 Steven Bosscher + + PR tree-optimization/17757 + * tree-phinodes.c (remove_phi_arg_num): Don't remove PHIs + without any PHI arguments left. Make sure the argument that + we're supposed to remove exists at all. + +2004-10-27 Paul Brook + + * configure.ac: Don't test for [build] __cxa_atexit when building a + cross compiler. + * configure: Regenerate. + +2004-10-27 Paul Brook + + * configure.ac: Use build_exeext not host_exeext when lookin for + target tools. + * configure: Regenerate. + +2004-10-27 Andreas Krebbel + + * config/s390/s390.md ("*subdf3_cc"): Replaced plus by minus. + +2004-10-27 Andreas Krebbel + patch originally created by Kelley Cook + + PR middle-end/14684 + * opts.c (OPT_fprofile_generate): Default to -funroll-loops + to match -fprofile-use. + +2004-10-27 Kazu Hirata + + * config/rs6000/rs6000.c: Fix a comment typo. + +2004-10-27 Zack Weinberg + + * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Increment line + counter. + +2004-10-27 Andreas Schwab + + * varasm.c (default_stabs_asm_out_destructor): Mark symbol as + unused. + (default_stabs_asm_out_constructor): Likewise. + +2004-10-26 Geoffrey Keating + + * builtins.c (fold_builtin_unordered_cmp): Always bring both + operands to the same type. + +2004-10-26 James E Wilson + + PR target/18010 + * emit-rtl.c (emit_copy_of_insn_after): Copy RTX_FRAME_RELATED_P. + +2004-10-26 Zack Weinberg + + * dbxout.c: Include obstack.h. + (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in + default definition. + (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): + Default-define here. + (DBX_CONTIN_LENGTH): Move definition with others. + (DBX_FINISH_STABS): New target macro. + (current_sym_code, current_sym_value, current_sym_addr) + (current_sym_nchars, CHARS, dbxout_continue) + (print_int_cst_octal, print_octal, print_wide_int) + (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. + (stabstr_ob, stabstr_last_contin_point): New variables. + (NUMBER_FMT_LOOP): New improper macro. + (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) + (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) + (dbxout_stab_value_internal_label_diff, dbxout_stabd) + (dbxout_begin_stabn, dbxout_begin_stabn_sline) + (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) + (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) + (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) + (stabstr_continue, DECL_ACCESSIBILITY_CHAR) + New functions and/or proper function-like macros. + (CONTIN): Use stabstr_continue, unconditionally. + (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. + (dbxout_init): Initialize stabstr_ob. Check + NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label + if it was used. Use the new interfaces. + (dbxout_source_file): Remove file argument; always write to + asm_out_file. Use the new interfaces. + (dbxout_type_method_1): Remove second argument which is always + DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. + (dbxout_type_methods): Remove write-only variables. Use the + new interfaces. + (dbxout_parms): Refactor to remove code duplicated in each of + several successive if-else-if blocks. Use the new interfaces. + (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) + (dbxout_source_line, dbxout_finish, dbxout_type_index) + (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) + (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) + (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) + (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): + Use the new interfaces. + * Makefile.in (dbxout.o): Update dependencies. + + * defaults.h: Don't define ASM_STABD_OP. + * output.h: Prototype new dbxout_* interfaces. + * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. + * varasm.c: Don't define ASM_STABS_OP. + (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): + Use the new dbxout.c interfaces. Call sorry if neither + DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. + + * xcoffout.h: Don't define ASM_STABS_OP. + (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. + (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. + (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. + (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to + do { ... } while (0) idiom. + + * config/alpha/alpha.c (num_source_filenames): Export. + * config/alpha/alpha.h (num_source_filenames): Declare. + (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. + (SDB_OUTPUT_SOURCE_LINE): Add missing newline. + * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. + Always use .debugsym. Update commentary. + * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. + (SDB_OUTPUT_SOURCE_LINE): Add missing newline. + * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): + Use new interfaces. + * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. + (macho_branch_islands): Use new interfaces. + + * doc/tm.texi: Update. + +2004-10-26 Aldy Hernandez + + * expr.c (emit_group_store): Do not treat floats as BLKmode. + (emit_group_load): Same. + +2004-10-26 Joseph S. Myers + + * c-parse.in (datadef): Use pedwarn rather than error and warning + for diagnostic in case of no declaration specifiers. + +2004-10-26 Richard Sandiford + + PR bootstrap/15747 + * doc/install.texi (mips-sgi-irix5): Document that /bin/sh has been + reported to hang during bootstrap and that CONFIG_SHELL=/bin/ksh + can be used to work around this. + +2004-10-26 Aldy Hernandez + + * config/rs6000/rs6000.h (MEMBER_TYPE_FORCES_BLK): Adjust for e500 + doubles. + +2004-10-26 Kazu Hirata + + * stmt.c (expand_case): Update a comment. + +2004-10-26 Kazu Hirata + + * stmt.c (expand_case): Put an assertion that index_expr is + never INTEGER_CST. Don't special case for constant + index_expr. + +2004-10-26 Andrew Pinski + + PR 18162 + * c-parse.in (designator): Finish with a semi-colon. + +2004-10-26 Fariborz Jahanian + + * config/rs6000/rs6000.md (andsi3_internal8): Set CR when splitting + into rotlsi3. + +2004-10-26 Kazu Hirata + + * stmt.c (expand_case): Remove code to handle SWITCH_EXPR with + a default case only. + +2004-10-26 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_hard_regno_nregs): Adjust for + e500 doubles. + (spe_build_register_parallel): New. + (rs6000_spe_function_arg): Handle e500 doubles. + (function_arg): Same. + (spe_func_has_64bit_regs_p): Same. + (rs6000_function_value): Same. + (rs6000_libcall_value): Same. + (legitimate_lo_sum_address_p): Return false for e500 doubles. + + * config/rs6000/rs6000.h (LOCAL_ALIGNMENT): Adjust for e500 + doubles. + (DATA_ALIGNMENT): Same. + (CANNOT_CHANGE_MODE_CLASS): Same. + +2004-10-26 Aldy Hernandez + + * expr.c (emit_group_load): Handle floats. + (emit_group_store): Same. + +2004-10-26 Nathan Sidwell + + * c-lex.c (get_nonpadding_token): Remove. + (c_lex_with_flags): Push timevar and eat padding here. Improve + stray token diagnostic. + (lex_string): Replace logic with switch statement, eat padding + token here. + +2004-10-26 Geoffrey Keating + + PR 18149 + * config/i386/darwin.h (ASM_SPEC): Undef it before defining. + +2004-10-25 Geoffrey Keating + + * config/darwin.h (LINK_SPEC): Default weak_reference_mismatches + to 'non-weak'. + (MAKE_DECL_ONE_ONLY): Set DECL_WEAK. + (ASM_MAKE_LABEL_LINKONCE): Delete. + (ASM_WEAKEN_DECL): New. + (ASM_DECLARE_OBJECT_NAME): Look at DECL_WEAK not DECL_ONE_ONLY. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (TEXT_SECTION_ASM_OP): Add a tab. + (DATA_SECTION_ASM_OP): Likewise. + (SECTION_FUNCTION): Add a tab. Use fputs. Don't call + data_section on every section change. + (EXTRA_SECTIONS): Add a bunch of new extra sections. + (EXTRA_SECTION_FUNCTIONS): Likewise. + (USE_SELECT_SECTION_FOR_FUNCTIONS): Define. + (JCR_SECTION_NAME): Define. + (TARGET_SECTION_TYPE_FLAGS): Don't define. + * config/darwin.c (darwin_encode_section_info): A symbol is defined + in this file if it is not weak. + (textcoal_section): Delete. + (datacoal_section): Delete. + (darwin_make_decl_one_only): Delete. + (machopic_select_section): Handle functions. + (darwin_asm_named_section): Add a tab. + (darwin_section_type_flags): Delete. + (darwin_unique_section): Delete contents. + (darwin_emit_unwind_label): Add a tab. Make decls weak if + DECL_WEAK is set. + * config/darwin-protos.h (darwin_section_type_flags): Delete. + (darwin_make_decl_one_only): Delete. + (text_coal_section): New. + (text_unlikely_section): New. + (text_unlikely_coal_section): New. + (const_coal_section): New. + (data_coal_section): New. + (const_data_coal_section): New. + * varasm.c (function_section): Honour + USE_SELECT_SECTION_FOR_FUNCTIONS. + * dwarf2out.c (output_call_frame_info): Look at DECL_WEAK when + TARGET_USES_WEAK_UNWIND_INFO is in effect. + * dbxout.c (dbxout_source_file): Don't change sections while + a function is being output. + +2004-10-25 David Ayers + + * c-common.h: Remove RID_ID. + * c-parse.in: Remove OBJECTNAME and references to RID_ID. + (typespec_reserved_attr): Add rule for TYPENAME + non_empty_protocolrefs. + (yylexname): Remove special handling of RID_ID. + +2004-10-25 James E Wilson + + * doc/invoke.texi (-fcrossjumping): Not enabled at -O. + +2004-10-25 Joseph S. Myers + + PR c/16667 + * c-parse.in (array_designator): New. + (designator): Use it. + (initelt): Only permit array_designator without '=', not ".foo". + +2004-10-25 Kenneth Zadeck + * Makefile.in: removed ggc for cgraphunit. + * cgraph.c.dump_cgraph_node: removed static var analysis. + * cgraph.h: removed static var analysis data structures and calls. + * cgraphunit.c: + cgraph_mark_local_and_external_functions:changed name to + cgraph_mark_local_functions + (print_order,convert_UIDs_in_bitmap,new_static_vars_info, + cgraph_reset_static_var_maps,get_global_static_vars_info, + get_global_statics_not_read,get_global_statics_not_written,searchc, + cgraph_reduced_inorder,has_proper_scope_for_analysis,check_rhs_var, + check_lhs_var,get_asm_expr_operands,process_call_for_static_vars, + scan_for_static_refs,cgraph_characterize_statics_local, + clear_static_vars_maps,cgraph_propagate_bits,cgraph_characterize_statics): + removed. + (cgraph_optimize,init_cgraph): removed calls to static vars analysis + * tree-dfa.c find_referenced_vars: removed call to static vars + analysis + * tree-flow.h static_vars_info: removed + * tree-ssa-operands.c (add_call_clobber_ops,add_call_read_ops): + removed calls to static vars analysis. + get_call_expr_operands: removed callee variable. + +2004-10-25 Kazu Hirata + + * cfg.c (unchecked_make_edge, redirect_edge_succ, + redirect_edge_pred): Use VEC_safe_push instead of + VEC_safe_insert. + * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. + +2004-10-25 Kazu Hirata + + * cfgloopmanip.c (loopify): Take two more arguments true_edge + and false_edge. + * cfgloop.h: Adjust the corresponding prototype. + * loop-unswitch.c (unswitch_loop): Adjust a call to loopify. + * tree-ssa-loop-manip.c (tree_ssa_loop_version): Likewise. + +2004-10-25 Jakub Jelinek + + * dwarf2out.c (rtl_for_decl_location): Avoid segfault if + DECL_INCOMING_RTL is NULL. + +2004-10-25 Steven Bosscher + + * timevar.def (TV_FIND_REFERENCED_VARS): New. + * tree-dfa.c (pass_referenced_var): Use it. + +2004-10-25 Roger Sayle + John David Anglin + + * cse.c: Change encoding of quantity numbers to avoid undefined + pointer arithmetic on qty_table. + (REGNO_QTY_VALID_P): A quantity is now valid if it isn't negative. + (get_cse_reg_info): Initialize reg_qty to a unique negative value. + (new_basic_block): Assign "real" quantity numbers from zero. + (delete_reg_equiv): Do nothing if quantity is invalid. Reset the + REG_QTY to its unique negative value. + (merge_equiv_classes): Calculate need_rehash if quantity is valid. + (cse_main): Don't include max_reg when determining max_qty. + (cse_basic_block): Avoid subtracting a large offset from qty_table, + which causes undefined C99 behaviour. Only allocate needed memory. + +2004-10-25 Kazu Hirata + + * stmt.c (expand_case): Remove an obsolete comment. + +2004-10-25 Andrew Pinski + + PR middle-end/17407 + * c-decl.c (grokdeclarator) : Remove the call + layout_type as it is already done by build_array_type. + * tree.c (build_array_type): Layout the type even + +2004-10-25 Alexandre Oliva + + * config/frv/linux.h (TARGET_C99_FUNCTIONS): Define to 0. + +2004-10-25 Alexandre Oliva + + * config/frv/frv.md (movdi, movdf): Handle wide-constant splits + with wider-than-32-bit HOST_WIDE_INTs. + +2004-10-25 David Billinghurst + + * config/mips/mips.c(mips_output_filename): Remove unused + array ltext_label_name + +2004-10-24 Geoffrey Keating + + * config/rs6000/darwin.h (BLOCK_REG_PADDING): Define. + +2004-10-25 Ben Elliston + + * cfgcleanup.c (outgoing_edges_match): Fix typo in dump output. + +2004-10-23 Andrew Pinski + + * predict.c (predict_loops): Call scev_finalize instead of + scev_reset. + +2004-10-24 Kazu Hirata + + * config/dbxcoff.h, config/dbxelf.h, config/libgloss.h, + config/openbsd.h, config/mips/r3900.h, config/pdp11/pdp11.md, + config/sh/ushmedia.h, config/sparc/elf.h, + config/sparc/sp64-elf.h: Update copyright. + +2004-10-24 Kazu Hirata + + * stmt.c (expand_case): Handle the default label outside of + the for loop. Remove code to handle a missing default label. + +2004-10-23 Kazu Hirata + + * dbxout.c (dbxout_function_decl): Don't use + DBX_OUTPUT_FUNCTION_END. + * system.h: Poison DBX_OUTPUT_FUNCTION_END. + * doc/tm.texi (DBX_OUTPUT_FUNCTION_END): Remove. + +2004-10-23 Andrew Pinski + + PR middle-end/17967 + * tree-cfg.c (remove_usless_stmts_cond): Don't Fold statement. + +2004-10-23 Daniel Berlin + + * tree-ssa-dom.c (record_equality): Use loop depth to determine + which way to record the equality as well. + (loop_depth_of_name): New function. + +2004-10-23 Eric Botcazou + + PR middle-end/17793 + * gimplify.c (gimplify_addr_expr) : Look + through the operand if it is a useless type conversion. + +2004-10-23 Ben Elliston + + * cfg.c (remove_edge): Use VEC_unordered_remove. + (redirect_edge_succ): Likewise. + (redirect_edge_pred): Likewise. + * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. + +2004-10-22 Kazu Hirata + + * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP): Don't access PTR + beyond its end. + +2004-10-22 Eric Christopher + + * config/rs6000/rs6000.c (setup_incoming_varargs): Align DFmode + saves. + +2004-10-22 Aldy Hernandez + + * config/rs6000/spe.md (spe_extendsfdf2): New. + (movdf_e500_double): New. + (spe_truncdfsf2): New. + (spe_absdf2): New. + (spe_nabsdf2): New. + (spe_negdf2): New. + (sub_adddf3): New. + (spe_subdf3): New. + (spe_muldf3): New. + (spe_floatsidf2): New. + (spe_floatunssidf2): New. + (fix_truncdfsi2): New. + (spe_fixuns_truncdfsi2): New. + + * config/rs6000/rs6000.md (truncdfsf2): Change to expander. + (fpr_truncdfsf2): New. + (negdf2): Change to expander. + (fpr_negdf2): New. + (fpr_nabsdf2): Name pattern. + (adddf3): Change to expander. + (fpr_adddf3): Nem. + (subdf3): Change to expander. + (fpr_subdf3): New. + (muldf3): Change to expander. + (fpr_muldf3): New. + (divdf3): Change to expander. + (fpr_divdf3): New. + (movdf_softfloat32): Change !TARGET_FPRS to TARGET_E500_SINGLE. + (cmpdf): Allow for TARGET_E500_DOUBLE. + +2004-10-22 Kazu Hirata + + * c-semantics.c (re_push_stmt_list): Remove. + * c-common.h: Remove the corresponding prototype. + +2004-10-22 Kazu Hirata + + * stmt.c (asm_op_is_mem_input): Remove. + * tree.h: Remove the corresponding prototype. + +2004-10-22 Kazu Hirata + + * tree-gimple.c (is_gimple_constructor_elt): Remove. + * tree-gimple.h: Remove the corresponding prototype. + +2004-10-22 Kazu Hirata + + * varasm.c (get_pool_mode_for_function, get_pool_offset): + Remove. + * rtl.h: Remove the corresponding prototypes. + +2004-10-22 Kazu Hirata + + * tree-cfg.c (thread_jumps_from_bb): Speed up by extracting + edge information when we commit ourselves to threading a + particular jump. + +2004-10-22 Kazu Hirata + + * tree-cfg.c (thread_jumps): Speed up by putting basic blocks + into worklist instead of their indexes. + +2004-10-22 Kazu Hirata + + * alias.c, basic-block.h, cgraphunit.c, combine.c, domwalk.h, + final.c, gengtype.c, genpreds.c, ggc-page.c, insn-notes.def, + lambda-code.c, loop-unroll.c, modulo-sched.c, pointer-set.c, + pretty-print.c, ra-colorize.c, sbitmap.c, tree-complex.c, + tree-data-ref.c, tree-dfa.c, tree-inline.c, tree-into-ssa.c, + tree-scalar-evolution.c, tree-ssa-dom.c, + tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, + tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-threadupdate.c, + tree-vectorizer.c, vec.h: Fix comment formatting. + +2004-10-22 Kazu Hirata + + * dwarf.h, gthr-dce.h, gthr-single.h, gthr-solaris.h, gthr.h, + libfuncs.h, libgcc2.h, stab.def, tsystem.h: Update copyright. + +2004-10-22 Kazu Hirata + + * config/ptx4.h, config/mcore/mcore-pe.h, + config/rs6000/eabi.h, config/vax/elf.h: Update copyright. + +2004-10-22 Peter Barada + + * config/m68k/m68k.h (HARD_REGNO_RENAME_OK): New macro. + * config/m68k/m68k.c (m68k_hard regno_rename_ok): Disallow + renaming of non-live registers in interrupt functions. + * config/m68k/m68k-protos.h (m68k_hard_regno_rename_ok): Add prototype. + +2004-10-22 Zdenek Dvorak + + * tree-ssa-loop-niter.c (inverse): Count in HOST_WIDE_INT if possible. + Use integer for loop counter. + (num_ending_zeros): New function. + (number_of_iterations_cond): Use num_ending_zeros. + +2004-10-21 Aldy Hernandez + + * config.gcc: Add support for --enable-e500_double. + + * config/rs6000/e500-double.h: New file. + + * config/rs6000/rs6000.h: Define TARGET_E500_SINGLE and + TARGET_E500_DOUBLE. + + * config/rs6000/eabi.h: Define TARGET_E500_SINGLE and + TARGET_E500_DOUBLE. + + * config/rs6000/linuxspe.h: Same. + + * doc/invoke.texi (Option Summary): Document new options for + mfloat-gprs. + (RS/6000 and PowerPC Options): Same. + + * config/rs6000/rs6000.c (rs6000_parse_float_gprs_option): New + function. + (rs6000_override_options): Use it. Use + SUB3TARGET_OVERRIDE_OPTIONS. + Add 8548 to processor_target_table. + (rs6000_legitimate_address): Handle e500 doubles. + (rs6000_legitimize_address): Same. + (rs6000_legitimize_reload_address): Same. + (rs6000_hard_regno_nregs): Same. + (spe_func_has_64bit_regs_p): Same. + (emit_frame_save): Same. + (gen_frame_mem_offset): Same. + (rs6000_dwarf_register_span): Same. + (rs6000_generate_compare): Same. + (easy_fp_constant): Same. + (legitimate_offset_address_p): Same. + + * config/rs6000/spe.md: (cmdfeq_gpr): New. + (tstdfeq_gpr): New. + (cmpdfgt_gpr): New. + (tstdfgt_gpr): New. + (tstdfgt_gpr): New. + (cmpdflt_gpr): New. + (tstdflt_gpr): New. + Add new constants. + +2004-10-21 Giovanni Bajo + + * config/arc/lib1funcs.asm (___umulsidi3): Fix typo. + +2004-10-21 Zack Weinberg + + * dbxout.c: Remove unnecessary #undefs. + (GDB_INV_REF_REGPARM_STABS_LETTER, DBX_MEMPARM_STABS_LETTER) + (FILE_NAME_JOINER, STABS_GCC_MARKER): Remove; fold sole + definition into use sites. + (cwd): Make local to dbxout_init. + (dbxout_init): Restructure cwd-using logic for clarity. Use + IS_DIR_SEPARATOR. + * xcoffout.h (DBX_OUTPUT_GCC_MARKER): Definition of + STABS_GCC_MARKER folded in here. + * system.h: Poison now-unused macros. + * doc/tm.texi: Remove documentation of now-unused macros. + +2004-10-21 Andrew Pinski + + PR c/17538 + * c-opts.c (push_command_line_include): Use the current file + name instead of the main one. + +2004-10-21 Andrew Pinski + + PR objc/17923 + * tree.c (staticp): A CONST_DECL has static storage if either + TREE_STATIC or DECL_EXTERNAL is set. + * c-decl.c (pushdecl_top_level): Accept CONST_DECLs which can + have null names. + +2004-10-21 Kazu Hirata + + * expr.c (store_expr): Remove dont_store_target. + +2004-10-21 Kazu Hirata + + * tree-cfg.c (thread_jumps): Speed up by using a worklist. + +2004-10-21 Kazu Hirata + + * tree-cfg.c (thread_jumps): Move a part of it to ... + (thread_jumps_from_bb): ... here. + +2004-10-21 David Edelsohn + + * dbxout.c (DBX_FINISH_SYMBOL): Add asm_out_file argument. + * xcoffout.h (DBX_FINISH_SYMBOL): Change asmfile to (ASMFILE). + +2004-10-21 Kazu Hirata + + * expr.c (store_expr): Clean up by renaming want_value to + call_param_p. + +2004-10-21 Kaz Kojima + + * config/sh/linux-unwind.h (sh_fallback_frame_state): Don't + fixup pc here. + +2004-10-21 Aldy Hernandez + + PR 18004. + * expmed.c (store_bit_field): Pass original 'value' before + recursing. + +2004-10-21 Nicolas Pitre + + * config/arm/ieee754-sf.S: Large speed improvements. Fix NAN handling. + * config/arm/ieee754-df.S: Ditto. + +2004-10-20 Zack Weinberg + + * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. + (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): + Default to 0. + (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. + When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit + an internal label and an N_SLINE .stabn whose value is the + difference between that label and the function entry label. + (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, + but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a + label and an N_SO stab with an empty string referring to it. + (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead + of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. + (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. + (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this + macro is never defined. + * sdbout.c (sdbout_source_line_counter): Delete. + (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. + (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes + only two arguments. + * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. + + * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. + * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro + definitions (identical to default). + * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h + * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: + Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not + DBX_OUTPUT_MAIN_SOURCE_FILE_END. + * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h + * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: + Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. + * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. + * config/alpha/alpha.c: Move declaration of num_source_filenames up. + (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. + (sym_lineno): Delete. + (alpha_output_filename): Do not emit N_SOL stabs here. Remove + now-unused variable. + (alpha_output_lineno): Delete. + * config/mips/mips-protos.h: Don't prototype mips_output_lineno. + * config/mips/mips.c (mips_output_filename): Don't use + ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. + (mips_output_lineno): Delete. + (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. + * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and + SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. + * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. + * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. + * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. + * config/mmix/mmix.h: Likewise. + * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. + * config/mmix/mmix-protos.h: Don't prototype it. + * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; + no need to #undef ASM_OUTPUT_SOURCE_LINE. + * config/arm/aout.h: Remove RISCiX-specific definition of + DBX_OUTPUT_MAIN_SOURCE_FILENAME. + * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not + ASM_OUTPUT_SOURCE_LINE. + * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Rename to + DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. + * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. + + * doc/tm.texi: Update. + +2004-10-20 Richard Henderson + + * tree-sra.c (instantiate_element): Copy DECL_IGNORED_P also. + +2004-10-20 Kelley Cook + + * configure.ac: Revert my previous patch. + * configure: Regenerate. + +2004-10-20 Ben Elliston + + * config/rs6000/rs6000.c + (rs6000_va_start): Use build_va_arg_indirect_ref. + (rs6000_gimplify_va_arg): Likewise. + +2004-10-20 Bryce McKinlay + + PR java/15575 + * configure.ac: Declare AM_LANGINFO_CODESET. + * aclocal.m4: Define AM_LANGINFO_CODESET. + * configure, config.in: Rebuilt. + +2004-10-20 Kazu Hirata + + * expr.c (store_expr): Remove code that is run when + want_value & 1 is nonzero. + +2004-10-20 Mark Mitchell + + * gthr-posix.h (__gthread_active_p): Use __extension__ around cast + from function pointer to void *. + +2004-10-20 Kaz Kojima + + PR target/18032 + * config/sh/sh.c (sh_expand_epilogue): Emit a blockage insn before + the frame pointer adjustment when exception handling is enabled. + +2004-10-20 Kazu Hirata + + * stor-layout.c: Fix a comment typo. + +2004-10-20 Kazu Hirata + + * expr.c (store_field): Remove two arguments value_mode and + unsignedp. + (expand_assignment, store_constructor_field, + expand_expr_real_1): Adjust calls to store_field. + +2004-10-18 Ramana Radhakrishnan + + * config/arc/lib1funcs.asm (___umulsidi3): Correct usage of flags. + + PR target/17317 + * config/arc/arc.h (REGNO_OK_FOR_BASE_P,REGNO_OK_FOR_INDEX_P, + REG_OK_FOR_BASE, REG_OK_FOR_INDEX): Consider blink(r31) as a valid + base and index register for loads. + + * config/arc/t-arc: Fix multilib handling. + +2004-10-20 Hans-Peter Nilsson + + * cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb, + don't inspect BLOCK_FOR_INSN for barriers. + * emit-rtl.c (emit_barrier_before): Revert last change. + (emit_barrier_after, emit_barrier): Ditto. + + * doc/extend.texi (Extended Asm): Warn and provide example + solution for using a call-clobbered asm register. + (Local Reg Vars): Similar. Cross-reference example. + +2004-10-19 Andrew Pinski + + * tree-cfg.c (group_case_labels): Look at the second to last + case statement for combing with the default case. + +2004-10-19 Richard Hendeson + + PR 17962 + * stor-layout.c (layout_type): Set TYPE_ALIGN for vectors. + +2004-10-19 Richard Hendeson + + * builtins.c (expand_builtin_memmove): If fold_builtin_memmove + succeeds, only expand the result. + +2004-10-19 Richard Hendeson + + PR middle-end/17885 + * tree.c (recompute_tree_invarant_for_addr_expr): Always poll address + of INDIRECT_REF. + +2004-10-19 Kazu Hirata + + * tree-cfg.c (thread_jumps): Use a do-while loop instead of a + loop with goto. + +2004-10-19 Kazu Hirata + + * expr.c (expand_assignment): Remove the last argument. + Change the return type to void. + * expr.h: Update the prototype of expand_assignment. + * function.c (assign_parm_setup_reg): Update a call to + expand_assignment. + * stmt.c (expand_asm_expr): Likewise. + +2004-10-19 Kazu Hirata + + * expr.c (expand_expr_real_1) : Remove + unnecessary assignments to temp. Return const0_rtx. + +2004-10-19 Kaz Kojima + + * config/sh/sh.c (sh5_schedule_saves): Fix typo. + +2004-10-18 Kelley Cook + + * configure.ac (powerpc-*-darwin*): Require assembler to support + .machine directive. + * configure: Regenerate. + +2004-10-18 Kazu Hirata + + * reload1.c (ior_hard_reg_set): Remove. + (finish_spills): Use IOR_HARD_REG_SET instead of + ior_hard_reg_set. + +2004-10-18 Kazu Hirata + + * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP): Speed up by shifting + the currently visited word to right. + +2004-10-18 Eric Botcazou + + PR middle-end/18045 + * expmed.c (expand_smod_pow2): Handle modes whose size + is greater than that of HOST_WIDE_INT. + +2004-10-18 Ziemowit Laski + + * c-parse.in (reservedwords): Add OBJC_TYPE_QUAL as alternative. + +2004-10-18 Eric Botcazou + Roger Sayle + + PR middle-end/17813 + * dojump.c (discard_pending_stack_adjust): New function. + (clear_pending_stack_adjust): Call it. + * expr.h (discard_pending_stack_adjust): Declare it. + * explow.c (emit_stack_save): Emit pending stack adjustments + before saving the stack pointer. + (emit_stack_restore): Discard pending stack adjustments before + restoring the stack pointer. + +2004-10-18 Richard Henderson + + * c-common.c (handle_mode_attribute): Allow scalar->vector + type changes yet. + +2004-10-18 Kazu Hirata + + * expr.c (expand_expr_real_1) [MODIFY_EXPR]: Don't request a + value to expand_assignment. + +2004-10-18 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Don't iterate on + thread_jumps. + (thread_jumps): Iterate until no new forwarder block arises. + +2004-10-18 Kazu Hirata + + * tree-cfg.c (tree_forwarder_block_p): Don't set forwardable. + (thread_jumps): Use forwardable as cache of + tree_forwarder_block_p throughout the function. + +2004-10-18 Andreas Krebbel + + * cfg.c (dump_flow_info): Remove redundant dump of reg life info. + +2004-10-18 Andrew Pinski + + PR middle-end/15014 + PR middle-end/16973 + * tree-cfg.c (remove_bb): If we have a label expression in the + basic block and the label we have taken the address, move the + label expression to the basic block which is previous in the + linked list. + (tree_verify_flow_info): Fix printing out the label name of the + problematic label expression. + +2004-10-18 Pat Haugen + + PR rtl-optimization/18002 + * simplify-rtx.c (mode_signbit_p): Externalize function... + * rtl.h (mode_signbit_p): ... to here. + * combine.c (simplify_shift_const): Recognize PLUS signbit as + canonical form of XOR signbit and move to outer op. + +2004-10-18 Diego Novillo + + * tree-cfg.c (bsi_for_stmt): Rename from stmt_for_bsi. + Update all callers. + * tree-ssa.c (replace_immediate_uses): Call bsi_for_stmt. + Don't call fold_stmt more than once, use bsi_replace. + +2004-10-18 Diego Novillo + + PR tree-optimization/17656 + * tree-ssa.c (replace_immediate_uses): When replacing a + constant, if the call to fold_stmt produced a different + statement, get an appropriate statement pointer by scanning + STMT's basic block. + +2004-10-18 Richard Henderson + + * pointer-set.c (hash1): Don't use libm functions in fallback case. + +2004-10-18 H.J. Lu + + PR bootstrap/17684 + * Makefile.in (clean): Remove libgcc_s$(SHLIB_EXT).1.stage?. + (stage1-start): Remove and copy libunwind.a and + libunwind*$(SHLIB_EXT) instead of libunwind*. + (stage2-start): Likewise. + (stage3-start): Likewise. + (stage4-start): Likewise. + (stageprofile-start): Likewise. + (stagefeedback-start): Likewise. + + * config/alpha/t-osf4 (SHLIB_LINK): Use a temporary file for + the shared library to be created and don't remove the existing + shared library. + * config/arm/t-netbsd (SHLIB_LINK): Likewise. + * config/i386/t-nwld (SHLIB_LINK): Likewise. + * config/mips/t-slibgcc-irix (SHLIB_LINK): Likewise. + * config/pa/t-hpux-shlib (SHLIB_LINK): Likewise. + * config/sh/t-linux (SHLIB_LINK): Likewise. + * config/t-libunwind-elf (SHLIBUNWIND_LINK): Likewise. + * config/t-slibgcc-darwin (SHLIB_LINK): Likewise. + * config/t-slibgcc-elf-ver (SHLIB_LINK): Likewise. + * config/t-slibgcc-sld (SHLIB_LINK): Likewise. + + * mklibgcc.in (libgcc-stage-start): Also move "*${objext}s" + files. + +2004-10-18 Kazu Hirata + + * basic-block.h (reg_set_iterator): New. + (EXECUTE_IF_SET_IN_REG_SET): Make it iterator style. + (EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise. + (EXECUTE_IF_AND_IN_REG_SET): Likewise. + * caller-save.c (save_call_clobbered_regs): Adjust to the new + style. + * cfgcleanup.c (thread_jump): Likewise. + * cfgrtl.c (safe_insert_insn_on_edge): Likewise. + * conflict.c (conflict_graph_compute): Likewise. + * flow.c (verify_local_live_at_start, update_life_info, + initialize_uninitialized_subregs, propagate_one_insn, + init_propagate_block_info, free_propagate_block_info, + propagate_block, dump_regset): Likewise. + * global.c (global_conflicts): Likewise. + * graph.c (start_bb): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * loop.c (load_mems): Likewise. + * reload1.c (compute_use_by_pseudos, order_regs_for_reload, + find_reg, finish_spills): Likewise. + * resource.c (mark_target_live_regs): Likewise. + * sched-deps.c (sched_analyze_insn): Likewise. + * sched-rgn.c (sched-rgn.c): Likewise. + * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. + +2004-10-18 Jakub Jelinek + + * config/i386/i386.md (addqi_1_slp): Test for incdec_operand + operand 1 instead of 2 + +2004-10-18 Kazu Hirata + + * loop-unroll.c: Fix comment typos. + +2004-10-18 Revital Eres + + * Makefile.in (loop-unroll.o): Add VARRAY_H dependency. + * loop-unroll.c: Include varray.h. + (struct var_to_expand, struct opt_info): Rename split_ivs_info to + opt_info and expand it to support variable expansion. + (analyze_insns_in_loop): Rename analyze_ivs_to_split and + expand it to support variable expansion. + (pt_info_start_duplication): Rename si_info_start_duplication. + (apply_opt_in_copies): Rename split_ivs_in_copies and add support + to the variable expansion optimization. + (free_opt_info): Rename free_si_info. + (analyze_insn_to_expand_var, referenced_in_one_insn_in_loop_p, + expand_var_during_unrolling, insert_var_expansion_initialization, + combine_var_copies_in_loop_exit, release_var_copies, + get_expansion): New functions. + (peel_loop_completely, unroll_loop_constant_iterations, + unroll_loop_runtime_iterations, peel_loop_simple, + unroll_loop_stupid): Change uses of struct si_info + to struct opt_info + and add uses of fvariable-expansion-in-unroller flag. + * params.def: Add parameter to restrict the number of expansions. + * params.h: (MAX_VARIABLE_EXPANSIONS): New define to restrict + the number of expansions. + * common.opt: (fvariable-expansion-in-unroller): New flag. + * doc/invoke.texi: (fvariable-expansion-in-unroller): Document. + +2004-10-18 Danny Smith + + * config/i386/cygming.h (TARGET_OS_CPP_BUILTINS): Define + __GXX_MERGED_TYPEINFO_NAMES to 0. + +2004-10-17 Hans-Peter Nilsson + + * cfgrtl.c (rtl_verify_flow_info_1): When checking insns in a bb, + handle barriers in a bb by checking that it points to a NULL bb. + * emit-rtl.c (emit_barrier_before): Set BLOCK_FOR_INSN to NULL. + (emit_barrier_after, emit_barrier): Ditto. + +2004-10-18 Joseph S. Myers + + * doc/extend.texi (Attribute Syntax): Clarify details of + attributes on parameters. + +2004-10-17 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize): Move checking out of + loop. + +2004-10-17 Andrew Pinski + + Revert: + 2004-10-17 Andrew Pinski + + * c-typeck.c (default_function_array_conversion): Always create + &a[0] for array types. + (build_unary_op): Do not fold &a[x] into a + x. + +2004-10-17 Andrew Pinski + + PR middle-end/17925 + * cfgexpand.c (expand_gimple_cond_expr): Emit line notes for next basic + block if there is a goto with a locus. + +2004-10-17 Kazu Hirata + + * config/elfos.h, config/gofast.h, config/interix.h, + config/netbsd.h, config/svr3.h, config/vxworks.h, + config/alpha/alpha-modes.def, config/alpha/alpha-protos.h, + config/alpha/ev4.md, config/alpha/ev5.md, config/alpha/ev6.md, + config/alpha/netbsd.h, config/arm/arm-modes.def, + config/arm/unknown-elf.h, config/c4x/c4x-modes.def, + config/cris/aout.h, config/frv/frv-modes.def, + config/i386/beos-elf.h, config/i386/gas.h, + config/i386/i386-coff.h, config/i386/i386-modes.def, + config/i386/linux.h, config/i386/linux64.h, + config/i386/mingw32.h, config/i386/netbsd-elf.h, + config/i386/netbsd64.h, config/i386/sco5.h, + config/i386/sol2.h, config/i386/uwin.h, config/i860/i860.md, + config/ia64/ia64-modes.def, config/ia64/itanium1.md, + config/ia64/itanium2.md, config/m68k/m68k-modes.def, + config/mips/mips-modes.def, config/mips/sdb.h, + config/mips/vr.h, config/mips/vxworks.h, + config/pa/pa-hpux10.h, config/pa/pa-hpux11.h, + config/pa/pa32-linux.h, config/rs6000/40x.md, + config/rs6000/7450.md, config/rs6000/8540.md, + config/rs6000/linuxspe.h, config/rs6000/power4.md, + config/rs6000/rs6000-modes.def, config/rs6000/rtems.h, + config/rs6000/spe.h, config/s390/2064.md, config/s390/linux.h, + config/s390/s390-modes.def, config/sh/elf.h, + config/sh/sh-modes.def, config/sh/sh64.h, + config/sparc/ultra1_2.md, config/sparc/ultra3.md, + config/stormy16/stormy16.md, config/v850/v850-protos.h, + config/vax/vax.md: Update copyright. + +2004-10-17 Kazu Hirata + + * expr.c (expand_expr_real_1): Remove an obsolete comment. + +2004-10-17 Andrew Pinski + + * c-typeck.c (default_function_array_conversion): Always create + &a[0] for array types. + (build_unary_op): Do not fold &a[x] into a + x. + +2004-10-17 Jakub Jelinek + + * pointer-set.c (hash1): Use integer part of 2^64 / phi + instead 2^32 / phi if long is 64-bit. + +2004-10-17 Joseph S. Myers + + * c-common.h (enum rid): Remove RID_PTRBASE, RID_PTREXTENT and + RID_PTRVALUE. + * c-parse.in (PTR_VALUE, PTR_BASE, PTR_EXTENT): Remove %token + declarations. + (reswords): Remove __ptrbase, __ptrbase__, __ptrextent, + __ptrextent__, __ptrvalue and __ptrvalue__. + (rid_to_yy): Remove RID_PTRBASE, RID_PTREXTENT and RID_PTRVALUE + entries. + +2004-10-16 Dale Johannesen + + * c-common.c (c_common_get_alias_set): Use GGC for type_hash_table. + +2004-10-16 Zdenek Dvorak + + PR tree-optimization/17766 + * basic-block.h (enum dom_state): DOM_CONS_OK removed. + (dom_info_available_p): Declare. + * cfghooks.c (split_block, make_forwarder_block): Use + dom_info_available_p. + * dominance.c (compute_dom_fast_query, calculate_dominance_info, + free_dominance_info, verify_dominators): Ditto. + (dom_info_available_p): New function. + * tree-cfg.c (cleanup_control_expr_graph): Free dominance information. + (thread_jumps): Use dom_info_available_p. + * tree-complex.c (expand_complex_div_wide): Ditto. + * tree-mudflap.c (mf_build_check_statement_for): Ditto. + +2004-10-16 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (struct ivopts_data): New field important_candidates. + (find_best_candidate): Take also important candidates into account. + (find_optimal_iv_set): Initialize important_candidates bitmap. + +2004-10-16 Zdenek Dvorak + + PR tree-optimization/17560 + * predict.c (tree_estimate_probability): Mark irreducible + loops. + +2004-10-16 Zdenek Dvorak + + PR rtl-optimization/17723 + * cfgcleanup.c (merge_memattrs): Handle case when + MEM_SIZE == NULL_RTX. + +2004-10-15 Andrew Pinski + + * toplev.c (dump_file_name): Change type to be const. + +2004-10-15 Joseph S. Myers + + * c-typeck.c (build_compound_expr, build_c_cast): Don't try to use + non_lvalue to stop something being a null pointer constant. + +2004-10-15 Aldy Hernandez + + * config/rs6000/rs6000.h (FUNCTION_ARG_REGNO_P): FPRs are only + available for TARGET_FPRS. + (FUNCTION_VALUE_REGNO_P): Same. + +2004-10-15 Geoffrey Keating + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document + -maltivec in same style as other ISA options. + +2004-10-15 Jon Grimm + + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Add __powerpc__ + definition. + +2004-10-15 Kazu Hirata + + * bitmap.c, bitmap.h, builtin-attrs.def, cfglayout.h, + collect2.h, conflict.c, coretypes.h, coverage.h, errors.h, + gcc.h, gcov-dump.c, gen-protos.c, gencheck.c, gencodes.c, + genconstants.c, gengenrtl.c, genmodes.c, genpeep.c, + gensupport.h, graph.h, gthr-gnat.c, gthr-gnat.h, gthr-posix.c, + gthr-posix.h, hard-reg-set.h, hwint.h, integrate.h, libgcc2.c, + lists.c, machmode.def, mips-tdump.c, opts.h, params.c, + predict.def, predict.h, protoize.c, reload.h, resource.h, + rtl-error.c, sbitmap.c, sbitmap.h, sreal.c, tlink.c, + tree-dump.h, tree-inline.h, unwind-dw2-fde.c, unwind-dw2.c, + unwind-sjlj.c, value-prof.h: Update copyright. + +2004-10-15 Kazu Hirata + + * pointer-set.c, tree-vectorizer.c: Fix comment typos. + +2004-10-15 Diego Novillo + + * tree-optimize.c (execute_one_pass): Stop timer right after + executing the pass. + +2004-10-14 Andrew Pinski + + Revert: + 2004-10-14 Andrew Pinski + PR middle-end/17967 + Revert: + * tree-cfg.c (remove_usless_stmts_cond): Fold statement. + (remove_useless_stmts_1): Fold trees we know how to fold. + +2004-10-14 David Edelsohn + + * configure.ac: Add .machine power4 directive when testing for + mfcr field. + * configure: Regenerate. + +2004-10-14 Geoffrey Keating + + * config/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Don't define. + +2004-10-14 Andrew Pinski + + * tree-vectorizer.c (vect_transform_loop): Declare vectorization_factor + always. + +2004-10-14 Daniel Jacobowitz + + * config/rs6000/rs6000.h (REG_CLASS_FROM_LETTER): Return NO_REGS + for 'f' if !TARGET_FPRS. + +2004-10-14 Richard Henderson + + PR debug/14492 + * dwarf2out.c (loc_descriptor_from_tree_1): Handle FIX_*_EXPR. + +2004-10-14 Richard Henderson + + PR c/17023 + * c-decl.c (store_parm_decls_oldstyle): Care for parameter type + as error_mark_node. + * c-parse.in (compstmt_primary_start): Check cur_stmt_list non-null + instaed of current_function_decl non-null. + +2004-10-14 Matt Austern + + * pointer-set.c: New file, special-purpose hash table. + * pointer-set.h: New file. + * tree.h (struct pointer_set_t): Declare as opaque type. + (tree_walk): Last argument is pointer_set_t* now. + * tree-inline.c (WALK_SUBTREE): Convert from htab to pset. + (walk_type_fields): + (walk_tree): Convert from htab_t to pointer_set_t for keeping + track of which nodes have already been visited. + (walk_tree_without_duplicates): Convert from htab_t to pointer_set_t. + * cgraphunit.c (cgraph_create_edges): Likewise. + (cgraph_characterize_statics_local): Likewise. + * tree-dfa.c (collect_dfa_stats): Likewise. + * langhooks-def.h (lhd_tree_inlining_walk_subtrees): Last arg is + pointer_set_t* now. + * langhooks.c (lhd_tree_inlining_walk_subtrees): Likewise. + * langhooks.h (struct lang_hooks_for_tree_inlining): Last arg type + of walk_subtrees is pointer_set_t* now. + * Makefile.in (OBJS-common): add pointer-set.o + (tree-inline.o): Depends on pointer-set.h + (tree-dfa.o): Likewise + (cgraphunit.o): Likewise + +2004-10-14 Geoffrey Keating + + * config/rs6000/darwin.h (ASM_SPEC): Delete. + (TARGET_ASM_FILE_START): Define. + * config/darwin.h (ASM_SPEC): Define. + * config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Don't supply + -mlong-double-128, it's the default. Update comment about reason + for force_cpusubtype_ALL. + * config/rs6000/darwin-vecsave.asm: Supply .machine. + * config/rs6000/darwin-world.asm: Likewise. + * config/rs6000/rs6000.c (rs6000_darwin_file_start): New. + (symbolic_operand): Delete #if 0ed code. + +2004-10-14 Andrew Pinski + + * stmt.c (add_case_node): Make sure that we have integer + constant before calling tree_int_cst_compare. + +2004-10-14 Andrew Pinski + + PR middle-end/17967 + Revert: + * tree-cfg.c (remove_usless_stmts_cond): Fold statement. + (remove_useless_stmts_1): Fold trees we know how to fold. + +2004-10-14 Joseph S. Myers + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS), + config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Disallow + -m64. + +2004-10-14 Ulrich Weigand + + * reload.c (find_reloads): When reloading a PLUS with constant + operand, make sure the constant is pushed to the constant pool + if required. + * config/s390/s390.c (s390_secondary_input_reload_class): Remove + reload bug workaround. + (s390_expand_plus_operand): Likewise. + +2004-10-14 David Edelsohn + + * opts.c (common_handle_option): Do not enable + flag_speculative_prefetching for -fprofile-generate/use. + +2004-10-14 Devang Patel + + PR 17635 + * tree-if-conv.c (process_phi_nodes): Process latch block. + (combine_blocks): Process latch block and update loop structure. + +2004-10-14 Olga Golovanevsky + + * tree-vectorizer.c (vect_generate_tmps_on_preheader): + (vect_update_ivs_after_vectorizer): + (vect_transform_for_unknown_loop_bound): + (tree_duplicate_loop_to_edge): + (allocate_new_names): + (rename_use_op): + (rename_def_op): + (rename_variables_in_bb): + (free_new_names): + (rename_variables_in_loop): + (copy_phi_nodes): + (update_phis_for_duplicate_loop): + (update_phi_nodes_for_guard): + (make_loop_iterate_ntimes): + (tree_duplicate_loop_to_edge_cfg): + (add_loop_guard): + (vect_analyze_loop_with_symbolic_num_of_iters): + (verify_loop_for_duplication): + (vect_gen_niters_for_prolog_loop): + (vect_update_niters_after_peeling): + (vect_update_inits_of_dr): + (vect_update_inits_of_drs): + (vect_build_loop_niters): + (vect_do_peeling_for_alignment): New functions. + (vect_transform_loop): Add unknown and known but indivisible loop + bound support; add peeling for unalignment support. + (vect_analyze_loop_form): Support symbolic number of iterations. + (vect_transform_loop_bound): New input parameter. + (vect_get_loop_niters): Change input parameter type. + (new_loop_vec_info): LOOP_VINFO_NITERS is tree now. + (vectorizable_store): Allow unaligned access. + (vectorize_loops): Add rewrite_into_loop_closed_ssa. + (vect_analyze_data_refs_alignment): Allowed one unaligned + store. + * tree-vectorizer.h (LOOP_VINFO_NITERS_KNOWN_P): Redefined + to use tree. + (LOOP_VINFO_INT_NITERS): New macro. + (MAX_NUMBER_OF_UNALIGNED_DATA_REFS): New define. + (do_peeling_for_alignment): + (unaligned_drs): New members of _loop_vec_info. + (LOOP_DO_PEELING_FOR_ALIGNMENT): New macro. + +2004-10-14 Ranjit Mathew + + * tree.h (TREE_STRING_POINTER): Wrap in "const char *". + (struct tree_string): Remove "const" qualifier for "str". + +2004-10-14 Ira Rosen + + * tree-vectorizer.c (vect_analyze_data_refs): Call + vect_get_base_and_bit_offset to get memory tag for array ref. + (vect_create_addr_base_for_vector_ref): Remove redundant checks. + +2004-10-14 Richard Earnshaw + + * configure.ac: Use $LN_S for creating symlinks (not $LN). + * configure: Regenerate. + +2004-10-14 Kaveh R. Ghazi + + * doc/install.texi (*-*-solaris2*): Update with info about kernel + patches to solve spurious testsuite failures. + +2004-10-14 Dorit Naishlos + + * tree-vectorizer.c (get_vectype_for_scalar_type): Added debug prinouts. + Added check that vectype is VECTOR_MODE_P, instead of check for BLKmode. + (vect_analyze_operations): Make sure the vectorization factor > 1. Add + gcc_assert under ENABLE_CHECKING. + (vectorizable_operation): Remove check for VECTOR_MODE_P (moved to + get_vectype_for_scalar_type). + + (vect_get_vec_def_for_operand): Remove redundant variables. + (vect_transform_loop): Likewise. + +2004-10-14 Richard Sandiford + + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Make r11 fixed and + global for -mcaller-super-interworking. + (CALLER_INTERWORKING_SLOT_SIZE): New macro. + * config/arm/arm.c (thumb_compute_save_reg_mask): Save r11 if + CALLER_INTERWORKING_SLOT_SIZE is nonzero and the function does + not need a frame pointer. + (arm_get_frame_offsets): Add CALLER_INTERWORKING_SLOT_SIZE bytes to + the soft frame pointer offset. + (thumb_expand_prologue): Set up r11 for -mcaller-super-interworking. + * config/arm/arm.md (*call_reg_thumb, *call_value_reg_thumb): Use + _interwork_{r7,r11}_call_via_rN if some arguments are passed on + the stack. Use frame_pointer_needed to choose between them. + * config/arm/lib1funcs.asm (_arm_return_{r7,r11}): New functions. + (interwork_with_frame): New macro. + (interwork): Add _interwork_{r7,r11}_call_via_rN(). + +2004-10-14 Ben Elliston + + PR other/17900 + * diagnostic.c (trim_filename): Fix logic bug in walking backwards + up the filename looking for a previous directory separator. + +2004-10-14 Joseph S. Myers + + * c-tree.h (enum c_typespec_kind, struct c_typespec, + parser_xref_tag): New. + (struct c_declspecs): Add tag_defined_p. Adjust definition of + typedef_p. + (declspecs_add_type): Adjust prototypes. + * c-parse.in (%union): Add tstype. + (typespec_nonattr, typespec_attr, typespec_reserved_nonattr, + typespec_reserved_attr, typespec_nonreserved_nonattr, + structsp_attr, structsp_nonattr): Change to tstype. Update + actions. + * c-decl.c (build_null_declspecs): Initialize tag_defined_p. + (declspecs_add_type): Update to take struct c_typespec argument. + Set tag_defined_p and typedef_p as appropriate. + (xref_tag): Rename to parser_xref_tag and replace by wrapper. + Update to return struct c_typespec. + (shadow_tag_warned): Don't let empty declarations with qualifiers + or storage class specifiers redeclare a tag if a previous + declaration is visible. + +2004-10-13 Richard Henderson + + PR debug/15860 + * dwarf2out.c (rtl_for_decl_location): Apply big-endian correction + for DECL_INCOMING_RTL. + +2004-10-14 Hans-Peter Nilsson + + PR target/17984 + * config/cris/cris.md (asrandb, asrandw, lsrandb, lsrandw): Apply + trunc_int_for_mode for constants used in shortened mode. + +2004-10-13 Richard Henderson + + PR c/17384 + * c-common.c (handle_mode_attribute): Disallow mode changes that + alter the CODE of the top-level type. + + * crtstuff.c (__FRAME_END__): Remove mode attribute. Find 32-bit + integer from internal limits macros. + * config/i386/mm3dnow.h (__v2sf): Fix base type. + +2004-10-13 Richard Henderson + + PR debug/13841 + * function.c (instantiate_decl): Recurse for CONCAT. + +2004-10-13 David Edelsohn + + * config/rs6000/rs6000.md (andsi3): Add attribute "compare" for + andi./andis. + (anddi3): Same. + (extzvdi_internal1): Add attribute "compare". + (extzvdi_internal2): Same. + +2004-10-12 Tom Tromey + + * doc/md.texi (Insn Canonicalizations): Removed extraneous quote. + +2004-10-13 Dale Johannesen + + * doc/extend.texi (Extended Asm): Rewrite asm volatile description. + +2004-10-13 Frank Ch. Eigler + + * toplev.c (compile_file): Call mudflap_finish_file from here ... + * c-decl.c (c_write_global_declarations): ... instead of here ... + * cp/decl.c (cp_finish_file): ... and here. + * tree-mudflap.c (mudflap_enqueue_decl): Reword a warning message. + +2004-10-13 Andrew Pinski + + * tree-ssa-dom.c (record_range): Free the element if we are not + going to use it. + +2004-10-13 Tom Tromey + + PR java/15578: + * gcc.c (option_map): Added --extdirs and --encoding. + +2004-10-13 Eric Botcazou + + PR target/14454 + * config/sparc/sparc.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Set to + sparc_can_output_mi_thunk. + (sparc_output_mi_thunk): Simplify handling of delta offset. Add + handling of vcall offset. + (sparc_can_output_mi_thunk): New predicate. + * doc/tm.texi (TARGET_ASM_OUTPUT_MI_THUNK): Document VCALL_OFFSET. + (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Delete. + (TARGET_ASM_CAN_OUTPUT_MI_THUNK): New target hook. + + * config/sparc/sparc.c (emit_and_preserve): Preserve stack alignment. + + * config/sparc/sparc.md (movdi): Remove redundant test. + +2004-10-13 Paolo Bonzini + + * tree-dump.c (dump_options): Remove TDF_TREE, TDF_RTL, + TDF_IPA from -fdump-tree-*-all. + +2004-10-13 Paul Brook + + * config/arm/arm-protos.h (arm_load_pic_register): Update prototype. + * config/arm/arm.c (thumb_find_work_register): Update comments. + (arm_load_pic_register): Add argument for scratch register. + (arm_expand_prologue, thumb_expand_prologue): Pass extra argument. + * config/arm/arm.md (builtin_setjmp_receiver): Ditto. + +2004-10-13 Kazu Hirata + + * tree-data-ref.c: Fix comment typos. + +2004-10-13 Jakub Jelinek + Zdenek Dvorak + + PR tree-optimization/17724 + * tree-cfg.c (tree_purge_dead_eh_edges): Free dominance info. + +2004-10-13 Dorit Naishlos + + * rs6000.c (altivec_builtin_mask_for_load): Made static GTY(()). + (altivec_builtin_mask_for_store): Likewise. + (altivec_init_builtins): Use lang_hooks.builtin_function to + create the decls for builtin_altivec_mask_for_load/store. + +2004-10-13 Nick Clifton + + * config/c4x/c4x.c: Remove inclusion of loop.h. + +2004-10-12 Ben Elliston + + * basic-block.h (edge_iterator): Keep the address of VEC(edge) *. + (ei_container): New; renamed. + (ei_start, ei_last): New macros. + (ei_start_1, ei_last_1): Renamed from ei_start. + (ei_last_1, ei_end_p): Use ei_container() where applicable. + (ei_one_before_end_p, ei_next, ei_edge): Likewise. + * gcse.c (remove_reachable_equiv_notes): Use ei_container(). + +2004-10-11 Sebastian Pop + + * Makefile.in (tree-ssa-loop-niter.o): Depends on tree-data-ref.h. + * cfgloop.c (initialize_loops_parallel_p): New. + (flow_loops_find): Initialize the parallel_p field to true for all + the loops. + * tree-ssa-loop-niter.c: Include "tree-data-ref.h". + (estimate_numbers_of_iterations_loop): Infers the loop bounds from + the size of the data accessed in the loop. + (struct nb_iter_bound): Moved... + * cfgloop.h (struct nb_iter_bound): ... here. + (estimated_nb_iterations, parallel_p): New fields in struct loop. + (record_estimate): Declare extern here. + * tree-chrec.c: Fix comments. + (nb_vars_in_chrec): New function. + * tree-chrec.h (nb_vars_in_chrec): Declared here. + * tree-data-ref.c: Don't include lambda.h, that is already included + in tree-data-ref.h. + (tree_fold_divides_p): Don't check for integer_onep. + (tree_fold_bezout): Removed. + (gcd): New static duplicated function. + (int_divides_p, dump_subscript): New. + (dump_data_dependence_relation): Use dump_subscript. + (dump_dist_dir_vectors, dump_ddrs, compute_estimated_nb_iterations, + estimate_niter_from_size_of_data): New. + (analyze_array_indexes, analyze_array): Call + estimate_niter_from_size_of_data during the detection of array + references. Pass in a pointer to the statement that contains the + array reference. + (all_chrecs_equal_p): New. + (compute_distance_vector): Renamed compute_subscript_distance. + Deal with multivariate conflict functions. + (initialize_data_dependence_relation): Initialize DDR_AFFINE_P, + DDR_SIZE_VECT, DDR_DIST_VECT, and DDR_DIR_VECT. + (non_affine_dependence_relation): New. + (analyze_ziv_subscript, analyze_siv_subscript_cst_affine, + analyze_siv_subscript, analyze_miv_subscript, + analyze_overlapping_iterations, subscript_dependence_tester): + Initialize and return last_conflicts function. + (initialize_matrix_A, FLOOR, compute_overlap_steps_for_affine_univar, + compute_overlap_steps_for_affine_1_2): New. + (analyze_siv_subscript_affine_cst): Removed. + (analyze_subscript_affine_affine): Disprove dependences based on the + iteration domains. Solve the univariate dependence case as before, + but use lambda_matrix_right_hermite instead of tree_fold_bezout. + Implement the multivariate case of 2 versus 1 variables. + (build_classic_dist_vector, build_classic_dir_vector): Implement some + unhandled cases. + (find_data_references_in_loop): Compute and initialize + loop->estimated_nb_iterations and loop->parallel_p. + (analyze_all_data_dependences): Modify the debug dump order. + * tree-data-ref.h (SUB_LAST_CONFLICT_IN_A, SUB_LAST_CONFLICT_IN_B, + subscript->last_conflict_in_a, subscript->last_conflict_in_b): Removed. + (SUB_LAST_CONFLICT, subscript->last_conflict, + data_dependence_relation->affine_p, data_dependence_relation->size_vect, + DDR_AFFINE_P, DDR_SIZE_VECT): New. + (find_data_references_in_loop, initialize_data_dependence_relation, + dump_subscript, dump_ddrs, dump_dist_dir_vectors): Declared here. + +2004-10-12 Kelley Cook + + * configure: Regenerate. + +2004-10-12 Fariborz Jahanian + + PR 17892 + * tree-ssa-dom.c (unsafe_associative_fp_binop): New function. + (simplify_rhs_and_lookup_avail_expr): Disallow associativity + and constant folding of floating point MULT_EXPR/PLUS_EXPR + expressions. + +2004-10-12 Ulrich Weigand + + * config/s390/s390.c (s390_va_start): Use build_va_arg_indirect_ref. + (s390_gimplify_va_arg): Likewise. + +2004-10-12 Daniel Jacobowitz + + * defaults.h (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P) + (MODE_BASE_REG_REG_CLASS, REGNO_MODE_OK_FOR_REG_BASE_P) + (REG_MODE_OK_FOR_REG_BASE_P): Provide default definitions. + * regclass.c (record_address_regs): Remove ifdef. Use + REG_MODE_OK_FOR_REG_BASE_P and MODE_BASE_REG_REG_CLASS. + * regrename.c (REG_MODE_OK_FOR_BASE_P): Remove unnecessary + definition. + (scan_rtx_address, replace_oldest_value_addr): Use + REG_MODE_OK_FOR_REG_BASE_P and MODE_BASE_REG_REG_CLASS. + * reload.c (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Remove + unnecessary definitions. + (find_reloads_address_1): Support REG_MODE_OK_FOR_REG_BASE_P + and MODE_BASE_REG_REG_CLASS. + * config/arm/arm.h (MODE_BASE_REG_CLASS): Don't check reload_completed. + (MODE_BASE_REG_REG_CLASS): Define. + (REGNO_MODE_OK_FOR_REG_BASE_P): Define. + (REG_MODE_OK_FOR_REG_BASE_P): Define. + * doc/tm.texi (Register Classes): Document MODE_BASE_REG_REG_CLASS, + REG_MODE_OK_FOR_REG_BASE_P, and REGNO_MODE_OK_FOR_REG_BASE_P. + +2004-10-12 Daniel Berlin + + * tree-ssa-alias.c (verify_name_tags): New function. + (verify_flow_sensitive_alias_info): Remove code that used to check name tags. + (verify_alias_info): Call verify_name_tags. + +2004-10-12 Kazu Hirata + + PR rtl-optimization/17931 + * config/i386/i386.c (ix86_rtx_costs): Handle COMPARE with + ZERO_EXTRACT in it. + +2004-10-12 Richard Earnshaw + + * arm.c (arm_print_operand): Use output_operand_lossage where possible + rather than aborting. + +2004-10-12 Paul Brook + + * config.gcc: Add armv6{k,z,zk} + * config/arm/arm-cores.def: Add arm1176 and mpcore. + * config/arm/tune.md: Regenerate. + * config/arm/arm.c (FL_FOR_ARCH6K, FL_FOR_ARCH6Z, FL_FOR_ARCH6ZK): + Define. + (all_architectures): Add armv6k, armv6z, armv6zk. + * config/arm/lib1funcs.asm: Recognise new arm arcitectures. + * doc/invoke.texi: Document new arch and cpu values. + +2004-10-12 Paul Brook + + * config/arm/bpabi.h (SUBTARGET_EXTRA_ASM_SPEC): Change meabi=3 to + meabi=4. + +2004-10-12 Paul Brook + + * config/arm/arm.md (addsi3_cbranch_scratch): Correct constraints. + Handle negative constants. + +2004-10-12 Joseph S. Myers + + PR c/17301 + * c-typeck.c (convert_arguments): Return error_mark_node if there + are too few arguments. + (build_function_call): Handle error_mark_node return from + convert_arguments. + +2004-10-06 Paolo Bonzini + + * configure.ac (symbolic_link): Replace with $LN_S. + (Assembler/Linker): Hard link from gas and binutils trees. + * aclocal.m4 (gcc_AC_PROG_LN_S): Try "cp -p" before cp. + * configure: Regenerate. + +2004-10-12 Paul Brook + + * configure.ac: Don't look for host assembler when building a canadian + cross. + * configure: Regenerate. + +2004-10-11 Roger Sayle + + PR other/17361 + * c-opts.c (permit_fortran_options): Delete/obsolete global variable. + (c_common_init_options): Remove #ifdef CL_F77 code. Scan command + line options for "-lang-asm" and if found allow any of the C-family + front-end options. + (c_common_handle_option): Remove last use of permit_fortran_options. + +2004-10-11 Ulrich Weigand + + * config/s390/s390.c (print_operand): Support 'S' format flag. + * config/s390/s390.md ("*tmqi_mem"): Use 'S' format flag. + ("*tstsi", "*tstsi_cconly", "*tstsi_cconly2"): Likewise. + ("*tsthiCCT", "*tsthiCCT_cconly", "*tsthi", "*tsthi_cconly"): Likewise. + ("*tstqiCCT", "*tstqiCCT_cconly", "*tstqi", "*tstqi_cconly"): Likewise. + ("*cmphi_ccu", "*cmpqi_ccu", "*clc"): Likewise + ("movti", "*movdi_31", "*movqi", "*movdf_31", "*mvc"): Likewise. + ("*movstricthi"): Likewise. + ("*load_multiple_di", "*load_multiple_si"): Likewise. + ("*store_multiple_di", "*store_multiple_si"): Likewise. + ("*sethiqisi", "*sethihisi"): Likewise. + ("*sethiqidi_64", "*sethiqidi_31"): Likewise. + ("*andqi3_zarch", "*andqi3_esa", "*nc"): Likewise. + ("*iorqi3_zarch", "*iorqi3_esa", "*oc"): Likewise. + ("*xorqi3", "*xc", "*xc_zero"): Likewise. + ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): Likewise. + + ("*tmhi_full"): Fix incorrect op_type attribute. + + ("*adddi3_alc_cc", "*adddi3_alc"): Remove double backslash. + ("*subdi3_slb_cc", "*subdi3_slb"): Likewise. + ("*addsi3_alc_cc", "*addsi3_alc"): Likewise. + ("*subsi3_slb_cc", "*subsi3_slb"): Likewise. + +2004-10-11 Andrew Pinski + + * config/s390/s390.c (s390_trampoline_template): Generate shorter + trampoline code. + (s390_trampoline_instantiate): Adapt. + * config/s390/s390.h (TRAMPOLINE_SIZE): Adapt to new code. + +2004-10-11 Roger Sayle + + PR middle-end/17657 + * stmt.c (add_case_node): Add additional type argument. Declare + as static to match prototype. Convert the upper and lower bounds + to the specified index type. Optimize away case ranges/values + that are outside the index type's bounds. Truncate case ranges + that span the index type's bounds. + (expand_case): Avoid unnessary computation and memory allocation + when index type is error_mark_node. Pass index_type as required + by change to add_case_node API. No need to convert case range + bounds to index_type, this is now done by add_case_node. + +2004-10-11 Ulrich Weigand + + * config/s390/s390-protos.h (s390_offset_p): Add prototype. + * config/s390/s390.c (s390_offset_p): New function. + * config/s390/s390.md ("*cmpdi_cct", "*cmpsi_cct", "*cmpdi_ccu", + "*cmpsi_ccu", "*cmphi_ccu", "*cmpqi_ccu"): Use splitter to + transform Q->Q alternatives to *clc pattern. + ("*clc"): Move. + ("movti", "*movdi_64", "*movdi_31", "*movsi_zarch", "*movsi_esa", + "*movhi", "*movqi", "*movdf_64", "*movdf_31", "movsf"): Use splitter + to transform Q->Q alternatives to *mvc pattern. + ("*mvc"): Move. Add peephole to merge adjacent MVCs. + ("*anddi3", "*andsi3_zarch", "*andsi3_esa", "*andhi3_zarch", + "*andhi3_esa", "*andqi3_zarch", "*andqi3_esa"): Use splitter to + transform Q->Q alternatives to *nc pattern. + ("*nc"): New insn. New peephole to merge adjacent NCs. + ("*iordi3", "*iorsi3_zarch", "*iorsi3_esa", "*iorhi3_zarch", + "*iorhi3_esa", "*iorqi3_zarch", "*iorqi3_esa"): Use splitter to + transform Q->Q alternatives to *oc pattern. + ("*oc"): New insn. New peephole to merge adjacent OCs. + ("*xordi3", "*xorsi3", "*xorhi3", "*xorqi3"): Use splitter to + transform Q->Q alternatives to *xc pattern. + ("*xc"): New insn. New peephole to merge adjacent XCs. + ("*xc_zero"): Move. Add peephole to merge adjacent XCs. + +2004-10-11 Andrew Pinski + + * gimplify.c (gimple_push_condition): Make sure that we don't + have any saved condition cleanup if we were at the top level. + +2004-10-11 Richard Sandiford + + * config/frv/frv.md (*adddi3_internal): Change name to... + (adddi3): ...replacing the exisiting define_expand. Combine + alternatives. Fix the range of the constant constraints ('J' instead + of 'NOP'). Remove bogus operands[2] check. Use simplify_gen_subreg + to extract the lower and upper halves of the DImode operands. + Always use addi3_lower and adddi3_upper, not the subdi3 forms. + (adddi3_lower): Fix the range of the constant constraints and + remove the bogus operands[2] check. + (adddi3_upper): Use gpr_or_int10_operand as the predicate for + operand 2. Use addxi to handle constant operands. + (subdi3_lower, subdi3_upper): Don't handle constant operands. + +2004-10-11 Nathan Sidwell + + * gengtype-lex.l: Add commented } & ) characters to unconfuse + editor's paren matching. Allow #define inside a struct. + +2004-10-10 Andrew Pinski + + PR middle-end/17703 + part of PR c++/17657 + * fold-const.c (fold_build_cleanup_point_expr): New function. + * tree.h (fold_build_cleanup_point_expr): Prototype. + +2004-10-10 Eric Christopher + + * dwarf2out.c: Move attribute to subprogram declaration + instead of subroutine type. + +2004-10-10 Kazu Hirata + + * basic-block.h: Remove the prototypes for can_hoist_insn_p, + hoist_insn_after, and hoist_insn_to_edge. + * rtl.h: Remove the prototypes for reg_referenced_between_p, + no_jumps_between_p, and insn_dependent_p. + * rtlanal.c (no_jumps_between_p, reg_referenced_between_p, + insn_dependent_p, insn_dependent_p_1, hoist_test_store, + can_hoist_insn_p, hoist_update_store, hoist_insn_after, + hoist_insn_to_edge): Remove. + +2004-10-10 Joseph S. Myers + + PR c/17881 + * c-decl.c (grokparms): Don't warn for parameters of incomplete + type in declarations that are not definitions except for the case + of parameters of void type. + +2004-10-10 Kazu Hirata + + * tree-cfg.c: Fix comment typos. + +2004-10-10 Joseph S. Myers + + PR c/17301 + * builtins.c (expand_builtin_va_start): Check for too few + arguments to va_start. + +2004-10-10 Joseph S. Myers + + PR c/17189 + * c-decl.c (grokfield): Make diagnostic for bad cases of unnamed + fields a pedwarn. Pedwarn here for unnamed structs/unions if + pedantic. + * c-parse.in (component_decl): Don't pedwarn here for unnamed + fields. + +2004-10-09 Zdenek Dvorak + + PR tree-optimization/17906 + * tree-tailcall.c (tree_optimize_tail_calls_1): Do not attempt to + copy non-gimple reg arguments. + +2004-10-09 Roger Sayle + + PR rtl-optimization/17853 + * simplify-rtx.c (simplify_relational_operation): Correct comment. + Reorganize handling of comparison operations with floating point + results (always return 0.0 even without FLOAT_STORE_FLAG_VALUE). + Likewise, introduce support for comparison operations with vector + result types, introducing a new VECTOR_STORE_FLAG_VALUE target macro. + + * doc/rtl.texi: Document new VECTOR_STORE_FLAG_VALUE target macro. + * doc/tm.texi: Likewise. + +2004-10-09 Steven Bosscher + + * regs.h (struct reg_info_def): Remove the last_node_uid and + changes_mode fields. + (REGNO_LAST_NOTE_UID): Don't define. + * regclass.c (reg_scan_mark_refs): Don't set REGNO_LAST_NOTE_UID. + * regmove.c (copy_src_to_dest): Likewise. + +2004-10-09 Roger Sayle + + PR middle-end/17894 + * fold-const.c (fold_div_compare): When optimizing X/C1 op C2, the + relational comparison operator op needs to be swapped/reversed when + C1 is negative. i.e. X/-10 < 1 becomes X >= -9, not X < -9. + +2004-10-08 Andrew Pinski + + PR tree-opt/17902 + * tree-ssa-phiopt.c (conditional_replacement): Use bsi_after_labels + instead of bsi_start. + (value_replacement): Likewise. + (abs_replacement): Likewise + +2004-10-09 Steven Bosscher + + * cfgexpand.c (maybe_dump_rtl_for_tree_stmt): New function. + (expand_gimple_cond_expr, expand_gimple_tailcall, + expand_gimple_basic_block): Use it to dump RTL for each stmt. + (tree_expand_cfg): Announce full RTL function dump. + * tree-optimize.c (execute_one_pass): Use normal RTL printing, + not the graph version. + * tree-pretty-print.c (dump_generic_node): Allow empty statements + in the arms of a COND_EXPR for lowered nodes. + +2004-10-08 Joseph S. Myers + + * config/rs6000/spe.h (atosfix16, atosfix32, atosfix64, atoufix16, + atoufix32, atoufix64, strtosfix16, strtosfix32, strtosfix64, + strtoufix16, strtoufix32, strtoufix64): Declare. + +2004-10-08 Joseph S. Myers + + * c-lex.c (interpret_float): Give a pedwarn rather than a warning + for an out-of-range floating point constant. + * builtins.c (fold_builtin_inf): Give a pedwarn rather than a + warning if the target format does not support infinities. + +2004-10-08 Kazu Hirata + + * emit-rtl.c (last_label_num, base_label_num): Remove. + (max_label_num): Always return label_num. + (set_new_last_label_num, restore_emit_status): Remove. + (init_emit): Don't initialize last_label_num. + * function.c (pop_function_context_from): Don't call + restore_emit_status. + * function.h: Remove the prototype for restore_emit_status. + * rtl.h: Remove the prototype for set_new_last_label_num. + +2004-10-08 Kazu Hirata + + * stmt.c (expand_decl_init): Remove. + * tree.h: Remove the corresponding prototype. + +2004-10-08 Kazu Hirata + + * integrate.c (try_constants, subst_constants, mark_stores): + Remove. + * integrate.h: Remove the prototype for try_constants. + +2004-10-08 Joseph S. Myers + + * c-typeck.c (enum impl_conv): Add ic_argpass_nonproto. + (convert_for_assignment): Handle ic_argpass_nonproto. Add + comments about its relevance to errors. + (c_convert_parm_for_inlining): Use ic_argpass_nonproto. + +2004-10-08 Andrew Pinski + + PR c/16999 + * c-ppoutput.c (cb_ident): Don't quote string as it is already + quoted. + +2004-10-08 Diego Novillo + + * tree-ssa-pre.c (init_pre): Use size of ARRAY_REF to allocate + reference_node_pool. + +2004-10-08 Kazu Hirata + + * tree-cfg.c: Fix a comment typo. + +2004-10-08 Andreas Krebbel + + * config/s390/s390.c (s390_register_info): Don't save fprs for + -msoft-float. + (s390_conditional_register_usage): Make fprs 'fixed' for -msoft-float. + +2004-10-08 Ulrich Weigand + + * config/s390/s390.h (TARGET_DEFAULT_BACKCHAIN): New define. + (TARGET_DEFAULT): Use symbolic values. + * config/s390/tpf.h (TARGET_DEFAULT_BACKCHAIN): Redefine. + (TARGET_DEFAULT): Use symbolic values. + * config/s390/s390.c (s390_backchain_string): Initialize to + TARGET_DEFAULT_BACKCHAIN. + +2004-10-08 Kaveh R. Ghazi + + * builtins.c (expand_builtin_mempcpy): Move tree handling code to + fold_builtin_mempcpy. Accept a type parameter. Delete duplicate + code. + (expand_builtin_strcat): Accept a type parameter. + (fold_builtin_mempcpy): Accept a type and endp parameter. + + * builtins.c (expand_builtin_strncpy): Delete duplicate code. + Accept an `exp' instead of an `arglist'. + +2004-10-08 Nathan Sidwell + + * tree-tailcall.c (tree_optimize_tail_calls_1): Use fold_convert, + reverting my 2004-09-07 patch to use build_int_cst. + +2004-10-08 Eric Botcazou + + PR target/17245 + * config/sparc/sparc.c (input_operand): Remove redundant code + for handling LO_SUM. + (legitimate_address_p) : Do not recheck TARGET_V9. + : If LO_SUM is offsettable, accept it for TFmode on V9. + Otherwise only accept it for TFmode if quad move insns are available. + +2004-10-08 Kazu Hirata + + * tree-cfg.c (tree_forwarder_block_p): Reorder checks so that + common cases will be caught earlier than others. + +2004-10-08 Michael Matz + + * loop-doloop.c (doloop_optimize): Extend count. + +2004-10-08 Kaz Kojima + + * config/sh/sh.md (prefetch_media, prefetch_i4): New insns. + (prefetch): Convert to expander. + +2004-10-08 Kaz Kojima + + * config/sh/sh.md (tls_global_dynamic): Use MEM pattern for the + first argument of CALL. + (tls_local_dynamic): Likewise. + +2004-10-08 Joseph S. Myers + + * c-typeck.c (enum impl_conv): New. + (convert_for_assignment): Use it. Take tree for function called + instead of its name. Handle ObjC selectors for diagnostics at + start of function. Select diagnostic text within the function + using full sentences for diagnsotics. Use %qE to name functions + in diagnostics. + (convert_arguments, build_modify_expr, + c_convert_parm_for_inlining, digest_init, c_finish_return): Update + callers to convert_for_assignment. + (warn_for_assignment): Remove. + +2004-10-08 Nick Clifton + + * config/sh/symbian.c (symbian_possibly_export_base_class): + Replace use of deleted TYPE_USES_VIRTUAL_BASECLASSES macro with + TYPE_CONTAINS_VPTR_P. + +2004-10-08 Kazuhiro Inaoka + + * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Don't exclude + fixed registers form all_used_regs. Update call_really_used_regs. + (CALL_REALLY_USED_REGISTERS): Define. + * config/m32r/m32r.c (MUST_SAVE_REGISTER): Replace call_used_regs + with call_really_used_regs. + +2004-10-08 Alan Modra + + * config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Choose gcrt1.o + for -profile as well as -p and -pg. + +2004-10-07 Andrew Pinski + + * libgcc2.c (__moddi3): Cast &w to UDWtype*. + +2004-10-07 Kazu Hirata + + * tree-cfg.c (tree_block_forwards_to): Remove. + * tree-flow.h: Remove the corresponding prototype. + +2004-10-07 Kazu Hirata + + * tree-flow-inline.h (phi_nodes): Remove an unnecessary check + for ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR. + +2004-10-07 Geoffrey Keating + + Radar 3813796 + * config/rs6000/rs6000.c (rs6000_generate_compare): When + flag_trapping_math is in effect, don't generate subtract + instructions. + +2004-10-07 Ulrich Weigand + + * config/s390/s390-protos.h (s390_narrow_logical_operator): Add. + * config/s390/s390.c (s390_narrow_logical_operator): New function. + (s390_extra_constraint_str): Add 'A' constraints. + (s390_const_ok_for_constraint_p): Add 'Nx' constraints. + * config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Add 'A' constraint. + (CONSTRAINT_LEN): Likewise. + * config/s390/s390.md ("*anddi3"): Add NI alternative and splitter. + ("*andsi3_zarch", "*andsi3_esa"): Likewise. + ("*andhi3_zarch", "*andhi3_esa"): Likewise. + ("*iordi3"): Add OI alternative and splitter. + ("*iorsi3_zarch", "*iorsi3_esa"): Likewise. + ("*iorhi3_zarch", "*iorhi3_esa"): Likewise. + ("*xordi3"): Add XI alternative and splitter. + ("*xorsi3", "*xorhi3"): Likewise. + +2004-10-07 Richard Sandiford + + * config/mips/mips.c (mips_function_rodata_section): New function. + (TARGET_ASM_FUNCTION_RODATA_SECTION): Use it. + +2004-10-07 Devang Patel + + * rs6000/altivec.md (UNSPEC_VCMPBFP, UNSPEC_VCMPEQUB, UNSPEC_VCMPEQUH, + UNSPEC_VCMPEQUW, UNSPEC_VCMPGEFP, UNSPEC_VCMPGTUB, UNSPEC_VCMPGTSB, + UNSPEC_VCMPGTUH, UNSPEC_VCMPGTSH, UNSPEC_VCMPGTUW, UNSPEC_VCMPGTSW, + UNSPEC_VCMPGTFP, UNSPEC_VSEL4SI, UNSPEC_VSEL4SF, UNSPEC_VSEL8HI, + UNSPEC_VSEL16QI, UNSPEC_VCOND_V4SI, UNSPEC_VCOND_V4SF, UNSPEC_VCOND_V8HI, + UNSPEC_VCOND_V16QI, UNSPEC_VCONDU_V4SI, UNSPEC_VCONDU_V8HI, + UNSPEC_VCONDU_V16QI): New constant defines. + (vcondv4si, vcondv4sf, vcondv8hi, vcondv16qi, vconduv4si, vconduv8hi, + vconduv16qi): New patterns. + * rs6000/rs6000-protos.h (rs6000_emit_vector_cond_expr): New function. + * rs6000/rs6000.c (rs6000_emit_vector_cond_expr): New function. + (get_vec_cmp_insn): Same. + (get_vsel_insn): Same. + (rs6000_emit_vector_compare): Same. + (rs6000_emit_vector_select): Same. + (INSN_NOT_AVAILABLE): New. + +2004-10-07 Zdenek Dvorak + + PR tree-optimization/17749 + * tree-tailcall.c (find_tail_calls): Check that parameter is + a gimple_reg. + +2004-10-07 Kazu Hirata + + * config/ia64/ia64.c: Fix a comment typo. + +2004-10-07 Eric Botcazou + + * doc/install.texi (*-*-solaris2*): Fix marker for URL. + +2004-10-07 Giovanni Bajo + + PR c++/17115 + * tree-inline.c (expand_call_inline): Do not warn for functions + marked with attribute noinline. + +2004-10-07 Eric Botcazou + + PR target/17862 + * config/sparc/sparc.c (sparc_output_mi_thunk): Set + current_function_uses_only_leaf_regs as well as sparc_leaf_function_p. + + * config/sparc/sparc.c (sparc_gimplify_va_arg): Pass 'false' instead + of 0 as 4th argument to pass_by_reference. + Call build_va_arg_indirect_ref instead of build_fold_indirect_ref. + +2004-10-06 Eric Christopher + + * config/sh/sh.c (sh_dwarf_calling_convention): Fix renesas dwarf + attribute. + +2004-10-07 Richard Sandiford + + PR target/17770 + * config/mips/mips.md (mov_l): Remove hazard=none attribute. + +2004-10-07 Zdenek Dvorak + + PR rtl-optimization/17791 + * loop-doloop.c (doloop_modify): Take number of iterations as + argument. + (doloop_optimize): Extend or shorten the number of iterations + when changing mode of counter register. + * loop-iv.c (lowpart_subreg): Export. + * rtl.h (lowpart_subreg): Declare. + +2004-10-07 Zdenek Dvorak + + PR tree-optimization/17806 + * cfghooks.c (split_edge): Update IRREDUCIBLE_LOOP flags. + * cfgloopmanip.c (loop_split_edge_with): Updating of IRREDUCIBLE_LOOP + flags moved to split_edge. + +2004-10-07 Eric Botcazou + + PR middle-end/17835 + * expmed.c (expand_sdiv_pow2): Force a stack adjustment + before tentatively building the conditional move sequence. + +2004-10-07 Richard Sandiford + + PR target/16815 + * function.c (assign_parm_setup_block_p): Tighten BLOCK_REG_PADDING + check. + * config/pa/pa.h (BLOCK_REG_PADDING): Define in terms of + function_arg_padding. + +2004-10-07 Richard Sandiford + + PR bootstrap/17857 + * Makefile.in (stmp-fixproto): Pass FIX_HEADER=build/... to fixproto. + +2004-10-07 Kazu Hirata + + * hooks.c (hook_int_void_1, hook_void_int): Remove. + * hooks.h: Remove the corresponding prototypes. + +2004-10-06 Andrew Pinski + + PR middle-end/17849 + * tree-nested.c (walk_stmt_info): Add changed field. + (convert_nonlocal_reference): Set changed to when we + change a decl to unnested decl. + : Instead of checking if the immediate part + of the ADDR_EXPR changed, check the field changed. + Use recompute_tree_invarant_for_addr_expr instead of unsetting + TREE_INVARIANT. + (convert_local_reference): Set changed to when we + change a decl to unnested decl. + : Instead of checking if the immediate part + of the ADDR_EXPR changed, check the field changed. + Also call recompute_tree_invarant_for_addr_expr on the ADDR_EXPR. + +2004-10-06 Kazu Hirata + + * defaults.h (DWARF2_GENERATE_TEXT_SECTION_LABEL): Remove. + * dwarf2out.c (dwarf2out_init): Remove references to + DWARF2_GENERATE_TEXT_SECTION_LABEL. + * system.h: Poison DWARF2_GENERATE_TEXT_SECTION_LABEL. + * doc/tm.texi (DWARF2_GENERATE_TEXT_SECTION_LABEL): Remove. + +2004-10-06 Joseph S. Myers + + * c-typeck.c (convert_arguments): Take expression for called + function rather than its name. Handle ObjC selectors directly + rather than relying on warn_for_assignment to do so. Call warning + directly rather than warn_for_assignment. Use %qE in diagnostics. + Say "argument" rather than "arg" in diagnostics. + (build_function_call): Update call to convert_arguments. + +2004-10-06 Andrew Pinski + + PR debug/17787 + * dbxout.c (dbxout_symbol): Really handle RECORD, UNION, and + ENUMs specially instead of just saying we do. + +2004-10-06 Eric Christopher + + * dwarf2.h: Sync with include/elf/dwarf2.h + +2004-10-06 Daniel Berlin + + * tree-pretty-print.c (dump_generic_node): Fix printing of BINFO + and TREE_VEC nodes. + +2004-10-06 Daniel Berlin + + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Convert + to use FOR_EACH_SSA_USE_OPERAND iterator, and propagate_value. + +2004-10-06 Daniel Berlin + + * lambda-code.c (compute_nest_using_fourier_motzkin): New + function. + (lambda_compute_auxillary_space): Split from here. + +2004-10-06 Daniel Berlin + + * tree-ssa-loop-ivopts.c (expr_invariant_in_loop): Make non-static. + * tree-flow.h: Add prototype. + * lambda-code.c (invariant_in_loop_and_outer_loops): Use + expr_invariant_in_loop. + +2004-10-06 Kazu Hirata + + * tree-cfg.c (thread_jumps): Remove a duplicate check for + EXIT_BLOCK_PTR. + +2004-10-06 Ulrich Weigand + + * config/s390/s390-protos.h (s_imm_operand): Remove. + (s390_pool_operand): Add prototype. + * config/s390/s390.c (general_s_operand): Remove. + (s_imm_operand): Remove. + (s_operand): Merge contents of general_s_operand. + (s390_pool_operand): New function. + * config/s390/s390.h (PREDICATE_CODES): Remove s_imm_operand. + * config/s390/s390.md ("*cmpdi_cct", "*cmpsi_cct"): New insns. + ("*cmpdi_ccu"): Merge Q->Q alternative. + ("*cmpsi_ccu", "*cmphi_ccu"): Likewise. + ("*cmpqi_ccu"): Merge Q->Q, n->Q, n->S alternatives. + ("*cli"): Remove. + ("*cmpdi_ccu_mem", "*cmpsi_ccu_mem"): Likewise. + ("*cmphi_ccu_mem", "*cmpqi_ccu_mem"): Likewise. + ("*movstricthi"): Use memory_operand instead of s_imm_operand. + +2004-10-06 Steve Ellcey + + * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to + call ia64_function_arg_boundary. + * config/ia64/ia64-protos.h (ia64_function_arg_boundary): New. + * config/ia64/ia64.c (ia64_function_arg_boundary): New. + (ia64_function_arg_advance): Do not put 128 bit floats into + FP registers. + +2004-10-06 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strcpy): Delete duplicate code. + Accept an expression instead of an arglist. + (expand_builtin_stpcpy): Accept an expression instead of an + arglist. + +2004-10-06 Eric Botcazou + + PR target/16007 + * doc/install.texi (*-*-solaris2*): Mention potential problem + with Sun assembler + GNU linker and C++ programs. + Document status of binutils 2.15 release. + +2004-10-06 Jan Hubicka + + * cse.c (cse_main): Kill push/pop context. + +2004-10-05 Zack Weinberg + + * pretty-print.c: Include tree.h. + (pp_base_prepare_to_format): New function, logic from + text_specifies_location. + (pp_base_format_text): Use gcc_assert. + * pretty-print.h (pp_prepare_to_format): New macro. + (pp_base_prepare_to_format): Prototype. + * diagnostic.c (text_specifies_location): Delete. + (bug_report_request): Delete. + (diagnostic_set_info): Don't call text_specifies_location. + (diagnostic_action_after_output): Put text from + bug_report_request inline here. Use gcc_unreachable. + (diagnostic_report_current_function): Fix comment. + (diagnostic_report_diagnostic): Clarify logic for error recursion. + Call pp_prepare_to_format before diagnostic_starter. + (trim_filename): Use IS_DIR_SEPARATOR. + (fatal_error, internal_error): Use gcc_unreachable. + (error_recursion): Call diagnostic_action_after_output to + issue the bug_report_request message and exit. + * Makefile.in (diagnostic.o, pretty-print.o): Update dependencies. + + * c-parse.in: Add list of diagnostic messages to insulate + translation template from version of yacc/bison used to + compile the grammar. + +2004-10-06 Alan Modra + + PR 16406 + * doc/tm.texi (USE_LD_AS_NEEDED, LINK_EH_SPEC): Document. + +2004-10-05 Kazu Hirata + + * basic-block.h: Remove the prototype for + flow_preorder_transversal_compute. + * cfganal.c (dfst_node): Remove. + (flow_preorder_transversal_compute): Likewise. + * rtl.h: Remove the prototype for get_jump_table_offset. + * rtlanal.c (get_jump_table_offset): Remove. + +2004-10-05 Richard Henderson + + PR 17756 + * tree-ssa-operands.c (get_expr_operands): Handle CONST_DECL. + +2004-10-05 Kelley Cook + + PR bootstrap/17817 + * Makefile.in: Stage the build directory too. + +2004-10-05 Aldy Hernandez + + * config/frv/frv.h (LEGITIMIZE_ADDRESS): New. + + * config/frv/frv-protos.h (frv_legitimize_address): Protoize. + (frv_emit_move): Same. + + * config/frv/frv.c (frv_emit_move): New. + (frv_legitimize_address): New. + + * config/frv/frv.md ("movsi"): Call frv_emit_move. + ("movqi"): Same. + ("movhi"): Same. + ("movdi"): Same. + ("movsf"): Same. + ("movdf"): Same. + +2004-10-05 Joseph S. Myers + + * c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in + system headers. + +2004-10-05 Joseph S. Myers + + * c-decl.c (pushdecl): When an extern declaration at block scope + refers to a visible entity with internal linkage, use the old DECL + rather than the new one. + +2004-10-05 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Remove extra parentheses in + comments. + +2004-10-05 Kazu Hirata + + * tree-cfg.c (thread_jumps): Remove a duplicate check for + an infinite loop. + +2004-10-05 Kazu Hirata + + * tree-cfg.c (thread_jumps): Iterate with FOR_EACH_BB instead + of FOR_BB_BETWEEN. Remove a useless check for unreachable + blocks. + +2004-10-05 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Don't call + delete_unreachable_blosk() after thread_jumps(). + (thread_jumps): Always remove basic blocks as they become + unreachable. + +2004-10-05 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Remove variable + something_changed. Simplify the while loop. + +2004-10-05 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memmove): Delete duplicate code + and accept a tree type for the result. + (expand_builtin_bcopy): Accept a tree type for the result. + (fold_builtin_memmove): Accept an arglist and tree type for + the result. + +2004-10-05 Ulrich Weigand + + * config/s390/s390.c (s390_dump_pool): Remove return value. + Use gen_pool_align, gen_pool_section_start/end instead of + gen_pool_start/end_31/64. + * config/s390/s390.md (UNSPECV_POOL_START, UNSPECV_POOL_END): Remove. + (UNSPECV_POOL_SECTION, UNSPECV_POOL_ALIGN): New constants. + ("pool_start_31", "pool_end_31"): Remove. + ("pool_start_64", "pool_end_64"): Likewise. + ("pool_align", "pool_section_start", "pool_section_end": New insns. + + * config/s390/s390.c (s390_cannot_copy_insn_p): New function. + (TARGET_CANNOT_COPY_INSN_P): Define. + (s390_cannot_force_const_mem): Handle UNSPEC_INSN. + (struct constant_pool): New member 'execute'. + (s390_add_execute, s390_find_execute): New functions. + (s390_execute_label, s390_execute_target): Likewise. + (s390_dump_pool): Output in-pool execute target templates. + (s390_dump_execute): New function. + (s390_alloc_pool, s390_free_pool): Handle execute templates. + (s390_mainpool_start, s390_mainpool_finish): Likewise. + (s390_chunkify_start, s390_chunkify_finish): Likewise. + * config/s390/s390.md (UNSPEC_INSN, UNSPEC_EXECUTE): New constants. + ("*execute"): New insn pattern. + ("movmem_short", "*movmem_short"): Use splitters to generate + explicit execute pattern, remove embedded execute. + ("clrmem_short", "*clrmem_short"): Likewise. + ("cmpmem_short", "*cmpmem_short"): Likewise. + +2004-10-05 Daniel Berlin + + * tree-ssa.c (verify_ssa): Verify phi arguments only + contain renamed names. + +2004-10-05 Alan Modra + + * config/rs6000/linux.h: Formatting, whitespace. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/rs6000-protos.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + (easy_vector_splat_const): Add fall thru comments. + (output_vec_const_move): Likewise. + +2004-10-05 Kelley Cook + + * Makefile.in: Update -Wno-error exceptions for move to build dir. + +2004-10-05 Chao-Ying Fu + Richard Sandiford + + * doc/invoke.texi (-mpaired-single): Link to the new description of the + built-in functions. Document dependencies. + (-mips3d): Add link here too. + * doc/extend.texi (MIPS Paired-Single Support): New section. + +2004-10-04 Chao-ying Fu + + * config/mips/mips.h (UNITS_PER_SIMD_WORD): Define. + +2004-10-04 Diego Novillo + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): + Initialize OPT_STATS to 0. + +2004-10-04 Kazu Hirata + + * tree-data-ref.c: Fix comment typos. + +2004-10-04 Sebastian Pop + + * tree-data-ref.c (array_base_name_differ_p): Fix comments. When + the predicate cannot be computed, don't initialize the result to + false. + +2004-10-01 Eric Christopher + + * dwarf2.h (dwarf_calling_convention): Add GNU prefix to + locally defined enum. + * dwarf2out.c (add_calling_convention_attribute): Don't + emit DW_CC_normal. + +2004-10-03 Andrew Pinski + + PR c/17178, PR c/17820 + * c-decl.c (pop_scope): Do not warn about unused static + variables as they warned in the middle-end. + +2004-10-03 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memcpy): Delete duplicate code + and make the first parameter the expression not the arglist. + +2004-10-03 Ulrich Weigand + + * expr.c (expand_expr_addr_expr): Only accept Pmode or ptr_mode + as valid modes to expand address expressions. + +2004-10-03 Joseph S. Myers + + * c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c, + c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c, + c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow + code formatting conventions. + +2004-10-03 Richard Sandiford + + * config/mips/mips.md (mulsidi3_32bit_r4000): Fix unsigned case. + +2004-10-03 Kazu Hirata + + PR tree-optimization/16632 + * fold-const.c (fold) [EQ_EXPR]: When seeing if D & ~C != 0 to + fold (A & C) == D into 0, fold ~C. Similarly, for the case + where | is used instead of &. + +2004-10-03 Kazu Hirata + + * ginclude/stddef.h: Fix a comment typo. + +2004-10-03 Eric Botcazou + + PR target/17443 + * config.gcc (i?86-*-solaris2*): Restore correct logic + for --enable-threads option. + (sparc64-*-solaris2*): Likewise. + (sparc-*-solaris2*): Likewise. + +2004-10-03 Alan Modra + + * config/rs6000/linux.h (TARGET_C99_FUNCTIONS): Define. + (OS_MISSING_POWERPC64): Move, and comment. + * config/rs6000/linux64.h (TARGET_C99_FUNCTIONS): Define. + (OS_MISSING_POWERPC64): Move, and comment. + +2004-10-02 Ian Lance Taylor + + * arm.c (output_call_mem): Add missing \t. + +2004-10-02 Kaveh R. Ghazi + + * builtins.c (expand_builtin_memcmp, expand_builtin_strcmp, + expand_builtin_strncmp): Delete duplicate code. + +2004-10-02 Frank Ch. Eigler + + * tree-mudflap.c (mf_build_check_statement_for): Reorganize to + take check-base and -limit arguments. + (mf_xform_derefs_1): Reorganize slightly to pass proper base/limit + check ranges for ARRAY_REF and COMPONENT_REF. + (execute_mudflap_fnction_ops, ..._decls): Limit unnecessary + instrumentation. + +2004-10-02 Joseph S. Myers + + * c-objc-common.c (c_tree_printer): Correct description of %E. + Don't fall through after printing an expression. + +2004-10-02 Kazu Hirata + + * tree-cfg.c, config/s390/tpf-unwind.h: Fix comment typos. + +2004-10-02 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Speed up by calling + delete_unrechable_blocks() only when necessary. + +2004-10-02 P.J. Darcy + + * gthr-tpf.h (__gthread_recursive_mutex_t): New type. + (__GTHREAD_RECURSIVE_MUTEX_INIT): Define. + (__gthread_recursive_mutex_lock, __gthread_recursive_mutex_trylock, + __gthread_recursive_mutex_unlock): New functions. + +2004-10-02 P.J. Darcy + + * config/s390/t-tpf (LIB2ADDEH): Remove tpf-eh.c. + * config/s390/tpf-eh.c: Remove file. + * config/s390/tpf-unwind.h: New file. + * config/s390/tpf.h (MD_FALLBACK_FRAME_STATE_FOR): Remove. + (MD_UNWIND_SUPPORT): Define. + +2004-10-02 Joseph S. Myers + + * c-typeck.c (warn_for_assignment): Don't permit argnum == 0. + +2004-10-01 Ulrich Weigand + + * config/s390/s390-protos.h (s390_comparison): Add prototype. + * config/s390/s390.c (s390_comparison): New function. + (s390_branch_condition_mask): Return -1 for invalid comparisons. + (s390_branch_condition_mnemonic): Assert valid comparison. + * config/s390/s390.h (PREDICATE_CODES): Add s390_comparison. + * config/s390/s390.md ("*cjump_64", "*cjump_31", "*cjump_long", + "*icjump_64", "*icjump_31", "*icjump_long", "*trap"): Use + s390_comparison instead of comparison_operator. + + * config/s390/s390.md (UNSPEC_CMPINT): New constant. + ("cmpmemdi"): Remove. + ("cmpmem_short", "*cmpmem_short"): Use CCUmode instead of CCSmode. + ("cmpmem_long", "*cmpmem_long_64", "*cmpmem_long_31"): Likewise. + ("cmpint_si"): Rename to ... + ("*cmpint_si"): ... this. Use UNSPEC_CMPINT. + ("cmpint_di", "*cmpint_di"): Likewise. + * config/s390/s390.c (s390_canonicalize_comparison): Remove + redundant UNSPEC_CMPINT conversions. + (s390_expand_cmpmem): Adapt to cmpint pattern changes. + +2004-10-01 Kazu Hirata + + * collect2.c (COLLECT_PARSE_FLAG): Remove. + (main): Remove a reference to COLLECT_PARSE_FLAG + * system.h: Poison COLLECT_PARSE_FLAG. + * doc/tm.texi (COLLECT_PARSE_FLAG): Remove. + +2004-10-01 Paul Brook + + * config/arm/crti.asm: Give _init and _fini function type. + +2004-10-01 Zdenek Dvorak + + * common.opt (ftree-loop-ivcanon): Enable by default. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): + Enable complete loop unrolling. + (canonicalize_induction_variables, tree_unroll_loops_completely): + Reset scev info. + +2004-10-01 Paul Brook + + * config/arm/arm.c (thumb_compute_saved_rag_mask): Or with bitmask, + not register number. + (thumb_find_work_register): Search full register range. + +2004-10-01 Andrew Pinski + + PR tree-opt/17343 + * tree-cfg.c (group_case_labels): Get the label and not + the case expr for the default case. + When the label we looking at is the default, decrement the + new_size. + +2004-10-01 Jan Hubicka + + * c-decl.c (c_expand_body): Update call tree_rest_of_compilation. + * cgraphunit.c (cgraph_build_static_cdtor): Likewise. + * toplev.h (tree_rest_of_compilation): Update prototype. + * tree-optimize.c (tree_rest_of_compilation): Kill nested_p argument. + +2004-10-01 Kazu Hirata + + * tree-cfg.c (cleanup_tree_cfg): Pull a call to + cleanup_control_flow() out of the while loop. + +2004-10-01 Paolo Bonzini + + * tree-vectorizer.c (vectorizable_operation): Fail unless + the mode for the vector type is indeed a vector mode. + +2004-10-01 Zdenek Dvorak + + * tree-chrec.c (chrec_fold_plus_poly_poly, chrec_fold_plus_1, + chrec_fold_multiply): Use fold_convert or build_int_cst_type instead + of convert. + * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, + add_to_evolution, set_nb_iterations_in_loop, follow_ssa_edge_in_rhs, + follow_ssa_edge_in_rhs): Ditto. + * tree-ssa-loop-ivopts.c (struct iv): Add base_object field. + (dump_iv): Dump base_object. + (dump_use, dump_cand): Use dump_iv. + (determine_base_object): New function. + (alloc_iv): Initialize base_object field. + (record_use): Clear the ssa_name field of iv. + (get_computation_cost_at): Do not use difference of addresses of + two different objects. + (may_eliminate_iv): Do not require the loop to have just single exit. + * tree-ssa-loop-niter.c (zero_p): Do not check for overflows. + (nonzero_p): New function. + (inverse, number_of_iterations_cond, simplify_using_outer_evolutions, + tree_simplify_using_condition, simplify_using_initial_conditions, + loop_niter_by_eval, find_loop_niter_by_eval, + estimate_numbers_of_iterations_loop, compare_trees, + upper_bound_in_type, lower_bound_in_type, + can_count_iv_in_wider_type_bound): Use buildN instead of build. Use + fold_convert or build_int_cst_type instead of convert. Use (non)zero_p + instead of integer_(non)zerop. + +2004-10-01 Jakub Jelinek + + Revert + 2004-09-29 Jakub Jelinek + + * tree.h (enum tree_index): Add TI_VA_LIST_GPR_COUNTER_FIELD + and TI_VA_LIST_FPR_COUNTER_FIELD. + (va_list_gpr_counter_field, va_list_fpr_counter_field): Define. + * tree-pass.h (pass_stdarg): Add. + * tree-optimize.c (init_tree_optimization_passes): Add pass_stdarg. + * tree-stdarg.c: New file. + * Makefile.in (OBJS-common): Add tree-stdarg.o. + (tree-stdarg.o): Add dependencies. + * function.h (struct function): Add va_list_gpr_size and + va_list_fpr_size fields. + * function.c (allocate_struct_function): Initialize them. + + * config/i386/i386.c (ix86_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (ix86_setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (ix86_va_start): Don't set up fields that won't be used. + + * config/rs6000/rs6000.c (rs6000_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (rs6000_va_start): Don't set up fields that won't be used. + +2004-09-30 Eric Christopher + + * dwarf2.h (dwarf_calling_convention): Add enum for renesas + sh abi. + * dwarf2out.c (add_calling_convention_attribute): New function. + (gen_subroutine_type_die): Use. + * target-def.h (TARGET_DWARF_CALLING_CONVENTION): New hook. + * target.h (gcc_target): Add dwarf_calling_convention. + * hooks.c (hook_int_tree_0): New function. + * hooks.h: Prototype. + * config/sh/sh.c: Include dwarf2.h. + (sh_dwarf_calling_convention): New function. + (TARGET_DWARF_CALLING_CONVENTION): Use. + * doc/tm.texi (TARGET_DWARF_CALLING_CONVENTION): Document. + +2004-09-30 Kaveh R. Ghazi + + * builtins.c (expand_builtin_strstr, expand_builtin_strchr, + expand_builtin_strrchr, expand_builtin_strpbrk, + expand_builtin_strncat, expand_builtin_strspn, + expand_builtin_strcspn, expand_builtin_fputs): Eliminate duplicate + code. + +2004-09-30 Ulrich Weigand + + * config/s390/s390-protos.h (s390_expand_logical_operator): Add + prototype. + (s390_logical_operator_ok_p): Likewise. + * config/s390/s390.c (s390_expand_logical_operator): New function. + (s390_logical_operator_ok_p): Likewise. + * config/s390/s390.md ("anddi3"): New expander. + ("*anddi3"): Rename from old anddi3 pattern, add Q->Q alternative. + ("*anddi3_ss", "*anddi3_ss_inv"): Remove. + ("andsi3"): Use s390_expand_logical_operator. + ("*andsi3_esa", "*andsi3_zarch"): Add Q->Q alternative. + ("*andsi3_ss", "*andsi3_ss_inv"): Remove. + ("andhi3"): New expander. + ("*andhi3_zarch", "*andhi3_esa"): New patterns. + ("andhi3", "*andhi3_ni", "*andhi3_ss", "*andhi3_ss_inv"): Remove. + ("andqi3"): New expander. + ("*andqi3_zarch", "*andqi3_esa"): New patterns. + ("andqi3", "*andqi3_ni", "*andqi3_ss", "*andqi3_ss_inv"): Remove. + ("iordi3"): New expander. + ("*iordi3"): Rename from old iordi3 pattern, add Q->Q alternative. + ("*iordi3_ss", "*iordi3_ss_inv"): Remove. + ("iorsi3"): Use s390_expand_logical_operator. + ("*iorsi3_esa", "*iorsi3_zarch"): Add Q->Q alternative. + ("*iorsi3_ss", "*iorsi3_ss_inv"): Remove. + ("iorhi3"): New expiorer. + ("*iorhi3_zarch", "*iorhi3_esa"): New patterns. + ("iorhi3", "*iorhi3_ni", "*iorhi3_ss", "*iorhi3_ss_inv"): Remove. + ("iorqi3"): New expiorer. + ("*iorqi3_zarch", "*iorqi3_esa"): New patterns. + ("iorqi3", "*iorqi3_ni", "*iorqi3_ss", "*iorqi3_ss_inv"): Remove. + ("xordi3"): New expander. + ("*xordi3"): Rename from old xordi3 pattern, add Q->Q alternative. + ("*xordi3_ss", "*xordi3_ss_inv"): Remove. + ("xorsi3"): New expander. + ("*xorsi3"): Rename from old xorsi3 pattern, add Q->Q alternative. + ("*xorsi3_ss", "*xorsi3_ss_inv"): Remove. + ("xorhi3"): New expander. + ("*xorqi3"): Rename from old xorhi3 pattern, add Q->Q alternative. + ("*xorhi3_ss", "*xorhi3_ss_inv"): Remove. + ("xorqi3"): New expander. + ("*xorqi3"): Rename from old xorqi3 pattern, add Q->Q alternative. + ("*xorqi3_ss", "*xorqi3_ss_inv"): Remove. + +2004-09-30 Roger Sayle + + * combine.c (force_to_mode) : Only convert the expression + (AND (NE FOO 0) CONST) into (AND FOO CONST) if FOO has the same + machine mode as the result. + +2004-09-30 Ben Elliston + + PR bootstrap/17761 + * lcm.c (optimize_mode_switching): Update to use EDGE_SUCC and + FOR_EACH_EDGE macros. + +2004-09-30 Joseph S. Myers + + * c-tree.h (readonly_error): Remove. + * c-typeck (enum lvalue_use): New. + (lvalue_or_else, readonly_error): Use it. All callers changed. + (readonly_error): Make static. + +2004-09-30 Jan Hubicka + + PR debug/13974 + * cfgrtl.c (try_redirect_by_replacing_jump, + force_nonfallthru_and_redirect, commit_one_edge_insertion, + cfg_layout_merge_blocks): Do not attach any line number information + to newly inserted instructions. + * emit-rtl.c (emit_insn*_before, emit_insn*_after): Rename to + emit_insn_*_noloc. + (emit_*insn_before, emit_insn*_after): New. + (emit_*insn_before_setloc, emit_*insn_after_setloc): Do not overwrite + existing locators. + * rtl.h (emit_*insn_before_noloc, emit_*insn_after_noloc): Declare. + (emit_*insn_before_sameloc, emit_*insn_after_sameloc): Kill. + +2004-09-30 Ulrich Weigand + + * config/s390/s390-protos.h (s390_arg_frame_offset): Remove. + (s390_return_address_offset): Remove. + (s390_can_eliminate): Add prototype. + (s390_initial_elimination_offset): Add prototype. + * config/s390/s390.h (CAN_ELIMINATE): Call s390_can_eliminate. + (INITIAL_ELIMINATION_OFFSET): Call s390_initial_elimination_offset. + * config/s390/s390.c (s390_arg_frame_offset): Remove. + (s390_return_address_offset): Remove. + (s390_can_eliminate, s390_initial_elimination_offset): New functions. + (struct machine_function): New member split_branches_pending_p. + (s390_mainpool_start): Allow nonexistant pool insn for empty pool. + (s390_mainpool_finish): Likewise. Clear base_reg if pool empty. + (s390_optimize_prologue): Remove base_used argument. Call + s390_update_frame_layout instead of s390_register_info. Handle + prologue/epilogue insns that touch only RETURN_REGNUM. + (s390_reorg): Remove base_used. Clear split_branches_pending_p. + (s390_register_info): Remove base_used and return_addr_used + arguments, compute special register usage inline. Return live + register data to caller. + (s390_frame_info): Remove arguments, do not call s390_register_info. + (s390_init_frame_layout): New function. + (s390_update_frame_layout): Likewise. + (s390_emit_prologue): Call s390_update_frame_layout; some code + move to there. Do not emit pool placeholder insn if unnecessary. + +2004-09-30 Ulrich Weigand + + * config/s390/s390.c (legitimate_reload_constant_p): Remove + floating point constant workaround. + (s390_secondary_input_reload_class): Handle PLUS reloads + with too-large constant. + (s390_expand_plus_operand): Likewise. + * config/s390/s390.md ("movdi"): Do not call force_const_mem. + ("movsi"): Likewise. Also, remove workaround for non-general + operands. + ("movdf"): Do not call force_const_mem. + ("movsf"): Likewise. Merge expander with *movsf insn. + ("*movsf"): Remove, merge with movsf expander. + +2004-09-30 Paul Brook + + * config/arm/symbian.h (STARTFILE_SPEC): Remove crt*.o. + (ENDFILE_SPEC): Define. + * config/arm/t-symbian.h (EXTRA_MULTILIB_PARTS): Set. + +2004-09-30 Richard Henderson + + * config/alpha/qrnnd.asm: Mark for noexecstack. + +2004-09-30 Kazu Hirata + + * protoize.c, tree-cfg.c: Fix comment typos. + +2004-09-30 Joseph S. Myers + + PR c/17730 + * c-typeck.c (lvalue_or_else): Pass msgid directly to error. + +2004-09-30 Diego Novillo + + * tree-ssa-alias.c (collect_points_to_info_r): Move analysis of + expressions... + (add_pointed_to_expr): ... here. + Call add_pointed_to_expr for variables with DECL_INITIAL set. + * tree-dfa.c (add_referenced_var): Scan DECL_INITIAL of any + pointer variable, if set. + +2004-09-30 Kazu Hirata + + * config/sh/sh.c: Follow spelling conventions. + +2004-09-29 Richard Henderson + + * unwind-dw2.c (_Unwind_GetGR): Honor DWARF_ZERO_REG. + * doc/tm.texi (DWARF_ZERO_REG): New. + + * config/alpha/alpha.c (alpha_sa_mask, alpha_expand_prologue, + alpha_expand_epilogue): Revert 2003-09-30 change to store zero. + * config/alpha/alpha.h (DWARF_ZERO_REG): New. + +2004-09-29 Ulrich Weigand + + * builtins.c (expand_builtin_strlen): Do not call emit_move_insn + with a PLUS as source operand. + (expand_movstr): Likewise. + (expand_builtin_stpcpy): Likewise. + +2004-09-29 Richard Henderson + + PR 17739 + * tree-gimple.c (is_gimple_reg): Reject hard registers. + (is_gimple_asm_val): New. + * tree-gimple.h (is_gimple_asm_val): Declare. + * gimplify.c (gimplify_asm_expr): Use it. + * tree-pretty-print.c (print_declaration): Dump hard regs. + * tree-outof-ssa.c (check_replaceable): Don't check for hard regs. + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. + * tree-ssa-pre.c (is_undefined_value): Likewise. + * tree-ssa-copy.c (may_propagate_copy): Likewise. + (may_propagate_copy_into_asm): Protect DECL_HARD_REGISTER. + * tree-ssa.c (warn_uninit): Likewise. + * tree.h (DECL_HARD_REGISTER): Check for VAR_DECL. + +2004-09-29 Fariborz Jahanian + + * c-decl.c (merge_decls): Use comptype when comparing + types to decide on DECL_SIZE save of olddecl. + +2004-09-29 Daniel Berlin + + * tree.h (INDIRECT_REF_P): New macro. + * alias.c (get_alias_set): Use it + (nonoverlapping_memrefs_p): Ditto. + * emit-rtl.c (mem_expr_equal_p): Ditto. + (set_mem_attributes_minus_bitpos): Ditto. + (is_gimple_addressable): Ditto. + (get_base_address): Ditto. + * tree-ssa-alias.c (find_ptr_derefernece): Ditto. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Ditto. + * tree-ssa-dom.c (record_equivalences_from_stmt): Ditto. + * tree-ssa-loop-im.c (is_call_clobbered_ref): Ditto. + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Ditto. + (add_address_candidates): Ditto. + (rewrite_address_base): Ditto. + +2004-09-30 Ben Elliston + + * tree-flow.h (struct bb_ann_d): Remove num_preds member. + * tree-into-ssa.c (rewrite_into_ssa): Don't set it. + (rewrite_ssa_into_ssa): Likewise. + * tree-phinodes.c (create_phi_node): Access the number of + predecessor edges using EDGE_COUNT() and not num_preds. + +2004-09-29 Joseph S. Myers + + PR c/7425 + * c-decl.c (merge_decls): Merge TREE_DEPRECATED. + +2004-09-29 Eric Christopher + + * fold-const.c (tree_swap_operands_p): Remove duplicated code. + +2004-09-29 Hans-Peter Nilsson + + * config/cris/cris.md (moverside, movemside): With MEM, make sure + the address is (plus reg mem). + +2004-09-29 David Edelsohn + + * config/rs6000/linux64.h (PROCESSOR_DEFAULT): Define. + +2004-09-29 Nathan Sidwell + + * tree.c (make_node_stat): Fix uninitialized warning. Replace + cascaded if ... else if with a switch. + +2004-09-29 Aaron W. LaFramboise + + * read-rtl.c (apply_macro_to_string): Replace index with strchr. + +2004-09-29 Jakub Jelinek + + * tree.h (enum tree_index): Add TI_VA_LIST_GPR_COUNTER_FIELD + and TI_VA_LIST_FPR_COUNTER_FIELD. + (va_list_gpr_counter_field, va_list_fpr_counter_field): Define. + * tree-pass.h (pass_stdarg): Add. + * tree-optimize.c (init_tree_optimization_passes): Add pass_stdarg. + * tree-stdarg.c: New file. + * Makefile.in (OBJS-common): Add tree-stdarg.o. + (tree-stdarg.o): Add dependencies. + * function.h (struct function): Add va_list_gpr_size and + va_list_fpr_size fields. + * function.c (allocate_struct_function): Initialize them. + + * config/i386/i386.c (ix86_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (ix86_setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (ix86_va_start): Don't set up fields that won't be used. + + * config/rs6000/rs6000.c (rs6000_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (rs6000_va_start): Don't set up fields that won't be used. + +2004-09-29 Jakub Jelinek + + * builtins.def (BUILT_IN_FPUTC, BUILT_IN_FPUTC_UNLOCKED, + BUILT_IN_FPUTS, BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE, + BUILT_IN_FWRITE_UNLOCKED, BUILT_IN_PUTCHAR, BUILT_IN_PUTCHAR_UNLOCKED, + BUILT_IN_PUTS, BUILT_IN_PUTS_UNLOCKED): Remove nothrow attribute. + * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_1_2, + ATTR_NONNULL_1_4): New. + +2004-09-29 Jakub Jelinek + + PR tree-optimization/17697 + * tree-ssa-ccp.c (execute_fold_all_builtins): Update eh and cleanup + cfg if needed. + +2004-09-28 Per Bothner + + * profile.c (branch_prob): Pass correct value to output_location, + even when USE_MAPPED_LOCATION. Fixes bug from 09-11. + +2004-09-28 Richard Henderson + + PR 15089 + * tree-ssa-copy.c (may_propagate_copy_into_asm): New. + * tree-flow.h (may_propagate_copy_into_asm): Declare. + * tree-ssa-ccp.c (replace_uses_in): Use it. + * tree-ssa-dom.c (cprop_operand): Likewise. + +2004-09-28 Jeff Law + + * tree-ssa-threadupdate.c (create_block_for_threading): Request + that no outgoing edges be left in the duplicate block. Do no + update information on outgoing edges or PHI nodes in target + blocks here. + (remove_ctrl_stmt_and_useless_edges): Renamed from + remove_last_stmt_and_useless_edges. Handle case where the + block is empty or has no control statements. Do not update edge + flags here. + (thread_block): Create a template block rather than copying the + original block every time. Create outgoing edges from the + duplicate blocks and update PHIs at the target of the outgoing + edges here. Fix edge flags for the original block if necessary. + * cfghooks (duplicate_block): No longer assert that the original + block has incoming edges. + +2004-09-29 Hans-Peter Nilsson + + * doc/extend.texi (Extended Asm): Add blurb about using Explicit + Reg Vars to enforce register allocation with general constraints. + (Explicit Reg Vars): Clarify relation to asm statements. + (Local Reg Vars): Similar. + +2004-09-28 Ulrich Weigand + + * sched-rgn.c (haifa_edge, edge_table, NEXT_IN, NEXT_OUT, FROM_BLOCK, + TO_BLOCK, nr_edges, in_edges, out_edges, IN_EDGES, OUT_EDGES, + build_control_flow, new_edge): Remove. + (schedule_insns): Remove edge_table/in_edges/out_edges cleanup. + (bitlst, bitlst_table_last, bitlst_table): Remove. + (bblst): Store basic_block pointer instead of block index. + (bblst_table): Likewise. + (edgelst): Store edge pointer instead of edge index. + (edgelst_table, edgelst_last): New variables. + (extract_bitlst): Rename to ... + (extract_edgelst): ... this. Return edge pointers, not indices. + (split_edges): Update call. + (rgn_edges): Store edge pointers instead of indices. + (edge_to_bit): Remove. + (EDGE_TO_BIT): Store per-region edge index in edge->aux. + (SET_EDGE_TO_BIT): New macro. + (is_cfg_nonregular): Check for simple cases of unreachable blocks. + (find_rgns): Remove edge_list parameter. Traverse standard CFG + data structures instead of haifa_edge et al. Use edge pointers + instead of edge indices everywhere. + (compute_dom_prob_ps): Use standard CFG data structures. Account + for exit edges. + (compute_trg_info): Likewise. + (propagate_deps): Likewise. + (debug_candidate): Account for bblst data structure change. + (check_live_1, update_live_1, is_pfree): Likewise. + (IS_REACHABLE): Use standard CFG data structures. + (init_ready_list): Update bblst_table/edgelst_table allocation. + (schedule_region): Update alloc/cleanup code to data structure + changes. Use edge->aux to store per-region edge index. + (init_regions): No longer call build_control_flow. Do not + create edge list any more. + +2004-09-28 Ulrich Weigand + + * cse.c (cse_insn): Avoid creating direct non-local jumps. + * combine.c (can_combine_p): Likewise. + * local-alloc. (update_equiv_regs): Likewise. + +2004-09-28 Richard Henderson + + PR 17531 + * expr.c (expand_expr_addr_expr_1): Only assemble_external for decls. + Don't check VOIDmode here. Force PLUS operands to common type. + (expand_expr_addr_expr): Do VOIDmode check earlier. Force use of + Pmode if given a non pointer type. + +2004-09-28 Zdenek Dvorak + + PR 17531 + * optabs.c (expand_binop): Force constants to the correct mode. + +2004-09-28 Ulrich Weigand + + * config/s390/s390.c (s390_adjust_cost): Remove. + (TARGET_SCHED_ADJUST_COST): Do not redefine. + (s390_adjust_priority): Handle TYPE_STM like TYPE_STORE. + * config/s390/s390.md ("main_pool"): Use "larl" type + attribute if TARGET_CPU_ZARCH. + +2004-09-28 Jakub Jelinek + + * config/ia64/ia64.c (ia64_expand_prologue): Declare ei + variable. + +2004-09-28 Diego Novillo + + * tree-ssa-loop.c (pass_record_bounds): Do not assign a + name to the pass. + +2004-09-28 Steven Bosscher + + * common.opt (flag_gcse_sm): Disable by default. + (flag_gcse_las): Likewise. + (flag_web): Likewise. Create from this file. + * flags.h: Remove flag_web declaration. + * toplev.c (flag_web): Likewise. + (process_options): Never set flag_web. + +2004-09-28 Steven Bosscher + + * Makefile.in (tree-ssa-propagate.o): Depend on vec.h. + * tree-ssa-propagate.c: Include vec.h. + (interesting_ssa_edges, varying_ssa_edges): Make these VECs + instead of varrays. + (cfg_blocks_add): Assert the block is not already in the worklist. + Update uses of interesting_ssa_edges and varying_ssa_edges. + (process_ssa_edge_worklist, ssa_prop_init, ssa_prop_fini, + ssa_propagate): Likewise. + +2004-09-28 Joseph S. Myers + + PR c/16409 + * c-decl.c (start_decl): Check for initializing incomplete array + of VLAs. + (build_compound_literal): Check for TYPE being error_mark_node. + * c-parse.in (primary): Check for VLA compound literals. + +2004-09-28 Diego Novillo + + * tree-ssa-live.c (calculate_live_on_entry): Fix warnings + with --disable-checking. + +2004-09-28 Devang Patel + + * tree-pretty-print.c (dump_generic_node): Print vector types. + +2004-09-28 Nick Clifton + + * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Replace with an + invocation of the function sh_init_cumulative_args. + (INIT_CUMULATIVE_LIBCALL_ARGS): Likewise. + (INIT_CUMULATIVE_INCOMING_ARGS): Delete. + * config/sh/sh-protos.h: Prototype sh_init_cumulative_args. + * config/sh/sh.c (sh_init_cumulative_args): New function based + on the contents of the old INIT_CUMULATIVE_ARGS macro but with a + heuristic added to determine the setting of force_mem when a + library function is being called. + +2004-09-28 Diego Novillo + + * tree-ssa-loop-im.c (single_reachable_address) : + Skip constant arguments. + +2004-09-28 Diego Novillo + + * tree-ssa-alias.c (create_name_tags): If PTR points to a + volatile type, mark the tag volatile. + (get_tmt_for): If TAG_TYPE is a volatile type, mark the tag + volatile. + +2004-09-28 Andrew Pinski + + * tree.def (vec_cond_expr): Fix. Change 'e' + to tcc_expression. + +2004-09-28 Kazu Hirata + + * basic-block.h: Fix a comment typo. + +2004-09-28 Kazu Hirata + + * optabs.c, optabs.h: Fix comment typos. + +2004-09-28 Eric Botcazou + + * config/sparc/sparc.md (call_address_struct_value_sp32): + Properly mask the immediate field of the 'unimp' instruction. + (call_symbolic_struct_value_sp32): Likewise. + +2004-09-28 Ben Elliston + Steven Bosscher + Andrew Pinski + + Merge from edge-vector-branch: + * basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge). + (struct edge_def): Remove pred_next, succ_next members. + (struct basic_block_def): Remove pred, succ members. Add preds + and succs members of type VEC(edge). + (FALLTHRU_EDGE): Redefine using EDGE_SUCC. + (BRANCH_EDGE): Likewise. + (EDGE_CRITICAL_P): Redefine using EDGE_COUNT. + (EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New. + (edge_iterator): New. + (ei_start, ei_last, ei_end_p, ei_one_before_end_p): New. + (ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise. + (FOR_EACH_EDGE): New. + * bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros + where applicable. + (rotate_loop): Likewise. + (find_traces_1_route): Likewise. + (bb_to_key): Likewise. + (connect_traces): Likewise. + (copy_bb_p): Likewise. + (find_rarely_executed_basic_blocks_and_crossing_edges): Likewise. + (add_labels_and_missing_jumps): Likewise. + (fix_up_fall_thru_edges): Likewise. + (find_jump_block): Likewise. + (fix_crossing_conditional_branches): Likewise. + (fix_crossing_unconditional_branches): Likewise. + (add_reg_crossing_jump_notes): Likewise. + * bt-load.c (augment_live_range): Likewise. + * cfg.c (clear_edges): Likewise. + (unchecked_make_edge): Likewise. + (cached_make_edge): Likewise. + (make_single_succ_edge): Likewise. + (remove_edge): Likewise. + (redirect_edge_succ_nodup): Likewise. + (check_bb_profile): Likewise. + (dump_flow_info): Likewise. + (alloc_aux_for_edges): Likewise. + (clear_aux_for_edges): Likewise. + (dump_cfg_bb_info): Likewise. + * cfganal.c (forwarder_block_p): Likewise. + (can_fallthru): Likewise. + (could_fall_through): Likewise. + (mark_dfs_back_edges): Likewise. + (set_edge_can_fallthru_flag): Likewise. + (find_unreachable_blocks): Likewise. + (create_edge_list): Likewise. + (verify_edge_list): Likewise. + (add_noreturn_fake_exit_edges): Likewise. + (connect_infinite_loops_to_exit): Likewise. + (flow_reverse_top_sort_order_compute): Likewise. + (flow_depth_first_order_compute): Likewise. + (flow_preorder_transversal_compute): Likewise. + (flow_dfs_compute_reverse_execute): Likewise. + (dfs_enumerate_from): Likewise. + (compute_dominance_frontiers_1): Likewise. + * cfgbuild.c (make_edges): Likewise. + (compute_outgoing_frequencies): Likewise. + (find_many_sub_basic_blocks): Likewise. + (find_sub_basic_blocks): Likewise. + * cfgcleanup.c (try_simplify_condjump): Likewise. + (thread_jump): Likewise. + (try_forward_edges): Likewise. + (merge_blocks_move): Likewise. + (outgoing_edges_match): Likewise. + (try_crossjump_to_edge): Likewise. + (try_crossjump_bb): Likewise. + (try_optimize_cfg): Likewise. + (merge_seq_blocks): Likewise. + * cfgexpand.c (expand_gimple_tailcall): Likewise. + (expand_gimple_basic_block): Likewise. + (construct_init_block): Likewise. + (construct_exit_block): Likewise. + * cfghooks.c (verify_flow_info): Likewise. + (dump_bb): Likewise. + (delete_basic_block): Likewise. + (split_edge): Likewise. + (merge_blocks): Likewise. + (make_forwarder_block): Likewise. + (tidy_fallthru_edges): Likewise. + (can_duplicate_block_p): Likewise. + (duplicate_block): Likewise. + * cfglayout.c (fixup_reorder_chain): Likewise. + (fixup_fallthru_exit_predecessor): Likewise. + (can_copy_bbs_p): Likewise. + (copy_bbs): Likewise. + * cfgloop.c (flow_loops_cfg_dump): Likewise. + (flow_loop_entry_edges_find): Likewise. + (flow_loop_exit_edges_find): Likewise. + (flow_loop_nodes_find): Likewise. + (mark_single_exit_loops): Likewise. + (flow_loop_pre_header_scan): Likewise. + (flow_loop_pre_header_find): Likewise. + (update_latch_info): Likewise. + (canonicalize_loop_headers): Likewise. + (flow_loops_find): Likewise. + (get_loop_body_in_bfs_order): Likewise. + (get_loop_exit_edges): Likewise. + (num_loop_branches): Likewise. + (verify_loop_structure): Likewise. + (loop_latch_edge): Likewise. + (loop_preheader_edge): Likewise. + * cfgloopanal.c (mark_irreducible_loops): Likewise. + (expected_loop_iterations): Likewise. + * cfgloopmanip.c (remove_bbs): Likewise. + (fix_bb_placement): Likewise. + (fix_irreducible_loops): Likewise. + (remove_path): Likewise. + (scale_bbs_frequencies): Likewise. + (loopify): Likewise. + (unloop): Likewise. + (fix_loop_placement): Likewise. + (loop_delete_branch_edge): Likewise. + (duplicate_loop_to_header_edge): Likewise. + (mfb_keep_just): Likewise. + (create_preheader): Likewise. + (force_single_succ_latches): Likewise. + (loop_split_edge_with): Likewise. + (create_loop_notes): Likewise. + * cfgrtl.c (rtl_split_block): Likewise. + (rtl_merge_blocks): Likewise. + (rtl_can_merge_blocks): Likewise. + (try_redirect_by_replacing_jump): Likewise. + (force_nonfallthru_and_redirect): Likewise. + (rtl_tidy_fallthru_edge): Likewise. + (commit_one_edge_insertion): Likewise. + (commit_edge_insertions): Likewise. + (commit_edge_insertions_watch_calls): Likewise. + (rtl_verify_flow_info_1): Likewise. + (rtl_verify_flow_info): Likewise. + (purge_dead_edges): Likewise. + (cfg_layout_redirect_edge_and_branch): Likewise. + (cfg_layout_can_merge_blocks_p): Likewise. + (rtl_flow_call_edges_add): Likewise. + * cse.c (cse_cc_succs): Likewise. + * df.c (hybrid_search): Likewise. + * dominance.c (calc_dfs_tree_nonrec): Likewise. + (calc_dfs_tree): Likewise. + (calc_idoms): Likewise. + (recount_dominator): Likewise. + * domwalk.c (walk_dominator_tree): Likewise. + * except.c (emit_to_new_bb_before): Likewise. + (connect_post_landing_pads): Likewise. + (sjlj_emit_function_enter): Likewise. + (sjlj_emit_function_exit): Likewise. + (finish_eh_generation): Likewise. + * final.c (compute_alignments): Likewise. + * flow.c (calculate_global_regs_live): Likewise. + (initialize_uninitialized_subregs): Likewise. + (init_propagate_block_info): Likewise. + * function.c (thread_prologue_and_epilogue_insns): Likewise. + * gcse.c (find_implicit_sets): Likewise. + (bypass_block): Likewise. + (bypass_conditional_jumps): Likewise. + (compute_pre_data): Likewise. + (insert_insn_end_bb): Likewise. + (insert_store): Likewise. + (remove_reachable_equiv_notes): Likewise. + * global.c (global_conflicts): Likewise. + (calculate_reg_pav): Likewise. + * graph.c (print_rtl_graph_with_bb): Likewise. + * ifcvt.c (mark_loop_exit_edges): Likewise. + (merge_if_block): Likewise. + (find_if_header): Likewise. + (block_jumps_and_fallthru_p): Likewise. + (find_if_block): Likewise. + (find_cond_trap): Likewise. + (block_has_only_trap): Likewise. + (find_if_case1): Likewise. + (find_if_case_2): Likewise. + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise. + (perfect_nestify): Likewise. + * lcm.c (compute_antinout_edge): Likewise. + (compute_laterin): Likewise. + (compute_available): Likewise. + (compute_nearerout): Likewise. + * loop-doloop.c (doloop_modify): Likewise. + * loop-init.c (loop_optimizer_init): Likewise. + * loop-invariant.c (find_exits): Likewise. + * loop-iv.c (simplify_using_initial_values): Likewise. + (check_simple_exit): Likewise. + (find_simple_exit): Likewise. + * loop-unroll.c (peel_loop_completely): Likewise. + (unroll_loop_constant_iterations): Likewise. + (unroll_loop_runtime_iterations): Likewise. + * loop-unswitch.c (may_unswitch_on): Likewise. + (unswitch_loop): Likewise. + * modulo-sched.c (generate_prolog_epilog): Likewise. + (sms_schedule): Likewise. + * postreload-gcse.c (eliminate_partially_redundant_load): + Likewise. + * predict.c (can_predict_insn_p): Likewise. + (set_even_probabilities): Likewise. + (combine_predictions_for_bb): Likewise. + (predict_loops): Likewise. + (estimate_probability): Likewise. + (tree_predict_by_opcode): Likewise. + (tree_estimate_probability): Likewise. + (last_basic_block_p): Likewise. + (propagate_freq): Likewise. + (estimate_loops_at_level): Likewise. + (estimate_bb_frequencies): Likewise. + * profile.c (instrument_edges): Likewise. + (get_exec_counts): Likewise. + (compute_branch_probabilities): Likewise. + (branch_prob): Likewise. + * ra-build.c (live_in): Likewise. + * ra-rewrite.c (rewrite_program2): Likewise. + * ra.c (reg_alloc): Likewise. + * reg-stack.c (reg_to_stack): Likewise. + (convert_regs_entry): Likewise. + (compensate_edge): Likewise. + (convert_regs_1): Likewise, + (convert_regs_2): Likewise. + (convert_regs): Likewise. + * regrename.c (copyprop_hardreg_forward): Likewise. + * reload1.c (fixup_abnormal_edges): Likewise. + * sbitmap.c (sbitmap_intersection_of_succs): Likewise. + (sbitmap_insersection_of_preds): Likewise. + (sbitmap_union_of_succs): Likewise. + (sbitmap_union_of_preds): Likewise. + * sched-ebb.c (compute_jump_reg_dependencies): Likewise. + (fix_basic_block_boundaries): Likewise. + (sched_ebbs): Likewise. + * sched-rgn.c (build_control_flow): Likewise. + (find_rgns): Likewise. + * tracer.c (find_best_successor): Likewise. + (find_best_predecessor): Likewise. + (tail_duplicate): Likewise. + * tree-cfg.c (make_edges): Likewise. + (make_ctrl_stmt_edges): Likewise. + (make_goto_expr_edges): Likewise. + (tree_can_merge_blocks_p): Likewise. + (tree_merge_blocks): Likewise. + (cfg_remove_useless_stmts_bb): Likewise. + (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. + (tree_block_forwards_to): Likewise. + (cleanup_control_expr_graph): Likewise. + (find_taken_edge): Likewise. + (dump_cfg_stats): Likewise. + (tree_cfg2vcg): Likewise. + (disband_implicit_edges): Likewise. + (tree_find_edge_insert_loc): Likewise. + (bsi_commit_edge_inserts): Likewise. + (tree_split_edge): Likewise. + (tree_verify_flow_info): Likewise. + (tree_make_forwarder_block): Likewise. + (tree_forwarder_block_p): Likewise. + (thread_jumps): Likewise. + (tree_try_redirect_by_replacing_jump): Likewise. + (tree_split_block): Likewise. + (add_phi_args_after_copy_bb): Likewise. + (rewrite_to_new_ssa_names_bb): Likewise. + (dump_function_to_file): Likewise. + (print_pred_bbs): Likewise. + (print_loop): Likewise. + (tree_flow_call_edges_add): Likewise. + (split_critical_edges): Likewise. + (execute_warn_function_return): Likewise. + (extract_true_false_edges_from_block): Likewise. + * tree-if-conv.c (tree_if_conversion): Likewise. + (if_convertable_bb_p): Likewise. + (find_phi_replacement_condition): Likewise. + (combine_blocks): Likewise. + * tree-into-ssa.c (compute_global_livein): Likewise. + (ssa_mark_phi_uses): Likewise. + (ssa_rewrite_initialize_block): Likewise. + (rewrite_add_phi_arguments): Likewise. + (ssa_rewrite_phi_arguments): Likewise. + (insert_phi_nodes_for): Likewise. + (rewrite_into_ssa): Likewise. + (rewrite_ssa_into_ssa): Likewise. + * tree-mudflap.c (mf_build_check_statement_for): Likewise. + * tree-outof-ssa.c (coalesce_abnormal_edges): Likewise. + (rewrite_trees): Likewise. + * tree-pretty-print.c (dump_bb_header): Likewise. + (dump_implicit_edges): Likewise. + * tree-sra.c (insert_edge_copies): Likewise. + (find_obviously_necessary_stmts): Likewise. + (remove_data_stmt): Likewise. + * tree-ssa-dom.c (thread_across_edge): Likewise. + (dom_opt_finalize_block): Likewise. + (single_incoming_edge_ignoring_loop_edges): Likewise. + (record_equivalences_from_incoming_edges): Likewise. + (cprop_into_successor_phis): Likewise. + * tree-ssa-live.c (live_worklist): Likewise. + (calculate_live_on_entry): Likewise. + (calculate_live_on_exit): Likewise. + * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. + (copy_loop_headers): Likewise. + * tree-ssa-loop-im.c (loop_commit_inserts): Likewise. + (fill_always_executed_in): Likewise. + * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. + * tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise. + (compute_phi_arg_on_exit): Likewise. + * tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise. + (get_loops_exit): Likewise. + (split_loop_exit_edge): Likewise. + (ip_normal_pos): Likewise. + * tree-ssa-loop-niter.c (simplify_using_initial_conditions): + Likewise. + * tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise. + (replace_phi_with_stmt): Likewise. + (value_replacement): Likewise. + * tree-ssa-pre.c (compute_antic_aux): Likewise. + (insert_aux): Likewise. + (init_pre): Likewise. + * tree-ssa-propagate.c (simulate_stmt): Likewise. + (simulate_block): Likewise. + (ssa_prop_init): Likewise. + * tree-ssa-threadupdate.c (thread_block): Likewise. + (create_block_for_threading): Likewise. + (remove_last_stmt_and_useless_edges): Likewise. + * tree-ssa.c (verify_phi_args): Likewise. + (verify_ssa): Likewise. + * tree_tailcall.c (independent_of_stmt_p): Likewise. + (find_tail_calls): Likewise. + (eliminate_tail_call): Likewise. + (tree_optimize_tail_calls_1): Likewise. + * tree-vectorizer.c (vect_transform_loop): Likewise. + * var-tracking.c (prologue_stack_adjust): Likewise. + (vt_stack_adjustments): Likewise. + (vt_find_locations): Likewise. + * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. + * config/i386/i386.c (ix86_pad_returns): Likewise. + * config/ia64/ia64.c (ia64_expand_prologue): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. + +2004-09-28 Eric Botcazou + + PR target/16532 + * config/sparc/sparc.c (struct machine_function): New field + 'leaf_function_p' and 'prologue_data_valid_p'. + (sparc_leaf_function_p, sparc_prologue_data_valid_p): New macro + to conveniently access the above fields. + (TARGET_LATE_RTL_PROLOGUE_EPILOGUE): Delete. + (eligible_for_return_delay): Use 'sparc_leaf_function_p' instead + of the generic flavor 'current_function_uses_only_leaf_regs'. + (eligible_for_sibcall_delay): Likewise. + (sparc_expand_prologue): Compute 'sparc_leaf_function_p' and set + 'sparc_prologue_data_valid_p'. Use 'sparc_leaf_function_p'. + (sparc_asm_function_prologue): Add sanity check for the assumption + made in 'sparc_expand_prologue'. Use 'sparc_leaf_function_p'. + (sparc_can_use_return_insn_p): New function. + (sparc_expand_epilogue): Use 'sparc_leaf_function_p'. + (output_restore): Likewise. + (output_sibcall): Likewise. + (sparc_output_mi_thunk): Likewise. + * config/sparc/sparc-protos.h (sparc_can_use_return_insn_p): Declare. + * config/sparc/sparc.md (return): New expander. + + * config/sparc/sparc.h (INITIAL_ELIMINATION_OFFSET): Minor tweak. + +2004-09-27 Mark Mitchell + + PR c++/17642 + * stor-layout.c (layout_decl): Use fold_convert, not convert. + (bit_from_pos): Likewise. + (byte_from_pos): Likewise. + (pos_from_bit): Likewise. + (normalize_offset): Likewise. + (place_field): Likewise. + (finalize_type_size): Likewise. + (layout_type): Likewise. + * tree.c (build_index_type): Likewise. + +2004-09-27 Devang Patel + + * expr.c (expand_expr_real_1): Handle VEC_COND_EXPR. + * genopinit.c (optabs): New entry for vcond_gen_code and + vcondu_gen_code. + * optabs.c (vcond_gen_code, vcondu_gen_code): New optabs. + (get_rtx_code): New function. + (vector_compare_rtx): New function. + (init_optabs): Initialize vcond_gen_code and vcondu_gen_code. + (expand_vec_cond_expr_p): New function. + (expand_vec_cond_expr): New function. + (get_vcond_icode): New function. + * optabs.h (expand_vec_cond_expr, expand_vec_cond_expr_p): New externs. + (vcond_gen_code, vcondu_gen_code): Same. + +2004-09-27 Kelley Cook + + * Makefile.in (STAGESTUFF): Split into ... + (STAGECOPYSTUFF, STAGEMOVESTUFF): ... these. + (mostlyclean): Update. + (stage1-start, stage2-start, stage3-start, stage4-start, + stageprofile-start, stagefeedback-start): Copy the STAGECOPYSTUFF. + Move the STAGEMOVESTUFF. + +2004-09-27 Eric Botcazou + + * system.h (getpagesize): Return 'int' instead of 'long'. + +2004-09-27 Michael Matz + + PR bootstrap/17698 + PR bootstrap/17702 + * bitmap.h (bmp_iter_single_init, bmp_iter_and_not_init, + bmp_iter_and_init): Shift by bit_in_word. + +2004-09-27 Kelley Cook + + * aclocal.m4: Quote m4_includes. Include ../config/gcc-lib-path.m4. + * configure.ac: Don't sinclude it here. + * configure: Regenerate. + +2004-09-27 Dorit Naishlos + + * config/rs6000/rs6000.c (rs6000_legitimate_address, print_operand): + Handle AND pattern + +2004-09-27 Joseph S. Myers + + PR c/13804 + * c-typeck.c (build_component_ref): Name type involved in + diagnostic for structure or union without a member of the given + name. + +2004-09-27 DJ Delorie + + * config/stormy16/stormy16.c (xstormy16_asm_output_aligned_common): + .comm alignment is bytes, not bits. + +2004-09-27 Devang Patel + + * tree-pretty-print.c (dump_generic_node): Print VEC_COND_EXPR. + (print_call_name): Do not print VEC_COND_EXPR. + +2004-09-27 Devang Patel + + * tree-pretty-print.c (dump_generic_node): Print VEC_COND_EXPR. + +2004-09-27 Jan Hubicka + + * i386.c (athlon_cost, k8_cost): Set BRANCH_COST to 5. + +2004-09-27 Kazu Hirata + + * bitmap.h: Fix a comment typo. + +2004-09-27 Aaron W. LaFramboise + + * libgcc2.c (getpagesize): Change type of return value to int. + +2004-09-26 Matt Austern + + * ggc-page.c (GGC_QUIRE_SIZE): Bump up from 16 to 256 if we're + using mmap. + +2004-09-26 Zdenek Dvorak + + * bitmap.h (EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_AND_COMPL_IN_BITMAP, + EXECUTE_IF_AND_IN_BITMAP): Changed to iterator style. + (bitmap_iterator): New type. + (bmp_iter_common_next_1, bmp_iter_single_next_1, bmp_iter_single_init, + bmp_iter_end_p, bmp_iter_single_next, bmp_iter_and_not_next_1, + bmp_iter_and_not_init, bmp_iter_and_not_next, bmp_iter_and_next_1, + bmp_iter_and_init, bmp_iter_and_next): New functions. + * basic-block.h (EXECUTE_IF_SET_IN_REG_SET, + EXECUTE_IF_AND_COMPL_IN_REG_SET, EXECUTE_IF_AND_IN_REG_SET): Changed to + use iterator-style EXECUTE_IF_IN_BITMAP macros. + * bitmap.c (bitmap_print): Ditto. + * bt-load.c (clear_btr_from_live_range, add_btr_to_live_range, + btr_def_live_range): Ditto. + * cfganal.c (compute_dominance_frontiers_1) Ditto. + * cgraphunit.c (convert_UIDs_in_bitmap, cgraph_characterize_statics): + Ditto. + * ddg.c (build_inter_loop_deps): Ditto. + * df.c (FOR_EACH_BB_IN_BITMAP, df_bb_reg_info_compute, df_refs_update): + Ditto. + * except.c (remove_eh_handler): Ditto. + * flow.c (reg_set_to_hard_reg_set): Ditto. + * gcse.c (clear_modify_mem_tables): Ditto. + * global.c (build_insn_chain): Ditto. + * ifcvt.c (dead_or_predicable): Ditto. + * loop-invariant.c (get_inv_cost, set_move_mark, move_invariant_reg): + Ditto. + * ra-build.c (livethrough_conflicts_bb, conflicts_between_webs): Ditto. + * ra-rewrite.c (reloads_to_loads, rewrite_program2, + detect_web_parts_to_rebuild, delete_useless_defs, actual_spill): Ditto. + * tree-cfg.c (allocate_ssa_names, tree_duplicate_sese_region, + tree_purge_all_dead_eh_edges): Ditto. + * tree-into-ssa.c (compute_global_livein, insert_phi_nodes, + insert_phi_nodes_for, debug_def_blocks_r, invalidate_name_tags, + rewrite_ssa_into_ssa): Ditto. + * tree-outof-ssa.c (find_replaceable_exprs): Ditto. + * tree-sra.c (scan_function, decide_instantiations, scalarize_parms): + Ditto. + * tree-ssa-alias.c (init_alias_info, compute_points_to_and_addr_escape, + compute_flow_sensitive_aliasing, maybe_create_global_var, + dump_points_to_info_for): Ditto. + * tree-ssa-dce.c (EXECUTE_IF_CONTROL_DEPENDENT): Ditto. + * tree-ssa-dse.c (dse_finalize_block): Ditto. + * tree-ssa-live.c (live_worklist, calculate_live_on_entry, + calculate_live_on_exit, build_tree_conflict_graph, dump_live_info): + Ditto. + * tree-ssa-loop-ivopts.c (find_induction_variables, + find_interesting_uses, add_old_ivs_candidates, alloc_use_cost_map, + determine_use_iv_costs, determine_set_costs, find_best_candidate, + set_cost_up_to, create_new_ivs, remove_unused_ivs, free_loop_data): + Ditto. + * tree-ssa-loop-manip.c (add_exit_phis_var, add_exit_phis): Ditto. + * tree-ssa-operands.c (get_asm_expr_operands, add_call_clobber_ops, + add_call_read_ops): Ditto. + * tree-ssa-pre.c (bitmap_print_value_set, insert_aux): Ditto. + +2004-09-26 John David Anglin + + * pa.c (print_operand): Use non-trapping completers for UNLE, UNLT, + UNGE, UNGT, UNEQ, UNORDERED and ORDERED comparisons. + +2004-09-26 Ulrich Weigand + + * builtins.c (expand_builtin_memcmp): Adjust MEM_SIZE to + reflect size of memory regions being compared. + +2004-09-26 Ulrich Weigand + + * builtins.c (get_memory_rtx): Set mem attributes for non-ADDR_EXPR + expressions. Always clear MEM_SIZE and alias set. + +2004-09-26 Roger Sayle + Giovanni Bajo + + PR middle-end/17112 + * stor-layout.c (compute_record_mode): For records with a single + field, only use the field's mode if its size matches what we'd + have choosen for the record ourselves. This forces the use of + BLKmode for packed records that don't completely fill a mode. + +2004-09-26 Roger Sayle + + PR middle-end/17151 + * combine.c (force_to_mode): Remove dubious early return test that + inhibits further optimization. + +2004-09-26 Kazu Hirata + + * profile.c: Fix a comment typo. + +2004-09-26 Zdenek Dvorak + + PR bootstrap/17591 + * tree-ssa-loop-im.c (for_each_index): Call callback for component_refs + with varying offset. + * tree-ssa-loop-ivopts.c (abnormal_ssa_name_p): New function. + (idx_contains_abnormal_ssa_name_p): Scan step and lower bound for + ARRAY_REFS. + (expr_invariant_in_loop_p): New function. + (idx_find_step): Handle step and lower bound for ARRAY_REFs. Handle + component_ref_field_offset for COMPONENT_REFs. Do not allow + ALIGN_INDIRECT_REFs and MISALIGNED_INDIRECT_REFs. + (add_address_candidates): Do not handle ALIGN_INDIRECT_REFs and + MISALIGNED_INDIRECT_REFs. + (idx_remove_ssa_names): Handle step and lower bound for ARRAY_REFs. + (rewrite_address_base): Do not handle ALIGN_INDIRECT_REFs and + MISALIGNED_INDIRECT_REFs. + +2004-09-26 Joseph S. Myers + + PR c/11459 + * gcc.c (cpp_options, cc1_options): Preserve relative order of + -std and -ansi options. + +2004-09-26 Jan Hubicka + + * dwarf2out.c (dwarf2out_finish): Set parent to comp_unit_die + for nested functions whose proper parent has not been output. + + * profile.c (compute_branch_probabilities): Use REG_BR_PROB notes + when re-constructing profile previously invalidated by loop. + +2004-09-25 Dale Johannesen + + * tree-gimple.c: Move GIMPLE definition... + * doc/tree-ssa.texi: here. + +2004-09-25 Kazu Hirata + + * tree-vectorizer.c: Fix a comment typo. + +2004-09-25 Kazu Hirata + + * c-typeck.c, defaults.h, dwarf.h, dwarf2out.c, fold-const.c, + gthr-dce.h, gthr-posix.h, gthr-solaris.h, gthr-win32.h, + lambda-code.c, lambda-mat.c, libgcc2.c, stmt.c, + tree-ssa-pre.c, tree-vn.c, tree.h: Fix comment formatting. + +2004-09-25 Kazu Hirata + + * tree-ssa-loop-unswitch.c: Fix a comment typo. + +2004-09-25 Kazu Hirata + + * doc/passes.texi: Fix a typo. + +2004-09-25 Zdenek Dvorak + + * tree-optimize.c (init_tree_optimization_passes): Add + pass_record_bounds. + * tree-pass.h (pass_record_bounds): Declare. + * tree-ssa-loop.c (tree_ssa_loop_bounds, pass_record_bounds): + New pass. + +2004-09-25 Zdenek Dvorak + + PR tree-optimization/17474 + * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Determine + offset of the field correctly when DECL_FIELD_BIT_OFFSET != 0. + +2004-09-25 Jan Hubicka + + * predict.c (counts_to_freqs): Make global. + * predict.h (counts_to_freqa): Declare. + * profile.c (compute_branch_probabilities): Compute frequencies + * tree-profile.c (do_tree_profiling): Refine conditional on when + tree profiling pass is needed. + + * passes.c (rest_of_handle_cfg): Disable const/pure function + detection when doing tree based profiling. + + * tree-inline.c (expand_call_inline): Fix incorrectly reversed + conditional. + +2004-09-25 Richard Sandiford + + * config/mips/mips.h (struct mips_args): Clarify comments. + * config/mips/mips.c (struct mips_arg_info): Likewise. + (mips_arg_info): Don't allow fpr_p to affect the register or + stack alignment. Remove o64 silliness. + (function_arg): Deal with the o32 float,float case specially. + +2004-09-25 Richard Sandiford + + * config/mips/mips.md (loadx, storex): Define for V2SF. + +2004-09-25 Ulrich Weigand + + * config/s390/s390-protos.h (s390_back_chain_rtx): Add prototype. + * config/s390/s390.c (s390_back_chain_rtx): New function. + * config/s390/s390.md ("allocate_stack"): Use s390_back_chain_rtx. + Call anti_adjust_stack. + ("restore_stack_block"): Use s390_back_chain_rtx. Enable pattern + only if compiling with back chain. + ("save_stack_nonlocal", "restore_stack_nonlocal"): Save/restore + back chain only if back chain enabled. Use s390_back_chain_rtx. + +2004-09-25 Joseph S. Myers + + * doc/trouble.texi: Remove obsolete information. Update + information on how to regenerate fixincluded headers. + +2004-09-25 Joseph S. Myers + + PR c/12951 + * doc/invoke.texi: Document that + -Wno-error-implicit-function-declaration is not accepted. + +2004-09-24 Richard Henderson + + * config/alpha/alpha.h (UNITS_PER_SIMD_WORD): New. + * config/alpha/alpha.c (alpha_vector_mode_supported_p): Don't depend + on TARGET_MAX. + (alpha_expand_mov): Allow unaligned vectors. + (alpha_expand_unaligned_store): Use CONST0_RTX. + (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New. + +2004-09-24 Jeff Law + + * tree-ssa-dom.c (dom_opt_finalize_block): Fix violation of strict + aliasing rules. + (simplify_cond_and_lookup_avail_expr): Likewise. + +2004-09-24 Joseph S. Myers + + PR c/12802 + * doc/extend.texi (Unnamed Fields): Remove "." from end of long + title. Document interaction with -fms-extensions. + * doc/invoke.texi (-fms-extensions): Refer to Unnamed Fields + section. + +2004-09-24 Joseph S. Myers + + PR c/12713 + * doc/extend.texi: Document interaction of attribute noreturn and + longjmp. + +2004-09-24 Richard Henderson + + PR rtl-opt/17503 + * regclass.c (subregs_of_mode): Turn into an htab. Make static. + (som_hash, som_eq): New. + (init_subregs_of_mode, record_subregs_of_mode): New. + (cannot_change_mode_set_regs): Rewrite for htab implementation. + (invalid_mode_change_p): Likewise. + * combine.c (gen_lowpart_for_combine): Use record_subregs_of_mode. + * flow.c (mark_used_regs): Likewise. + (life_analysis): Use init_subregs_of_mode. + * regs.h (subregs_of_mode): Remove. + * rtl.h (init_subregs_of_mode, record_subregs_of_mode): Declare. + +2004-09-24 Andrew Pinski + + * tree-ssa-phiopt.c (conditional_replacement): Use the correct + type with the copy of the conditional. + +2004-09-24 Andrew Pinski + + PR tree-opt/16954 + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): + Prevent renaming if the aliasing sets of the type which the + pointer points to are different. + +2004-09-24 Joseph S. Myers + + PR c/17188 + * c-decl.c (diagnose_mismatched_decls): Check for duplicate + declarations of enumerators. + (start_struct): Check TYPE_SIZE rather than TYPE_FIELDS to check + for redefinition. Check for nested redefinition. + (finish_struct): Don't check for nested redefinition. + (start_enum): Check for nested redefinition. + +2004-09-24 Devang Patel + + * tree-if-conv.c (tree_if_convert_cond_expr0: Create temp. variable + only when necesssary. + (combine_blocks): Combine loop header and exit block. + +2004-09-24 Paolo Bonzini + + * hooks.c (hook_tree_tree_bool_null): New. + * hooks.h (hook_tree_tree_bool_null): Declare it. + * target-def.c (TARGET_FOLD_BUILTIN): Point to it. + * targhooks.c (default_fold_builtin): Remove. + * targhooks.h (default_fold_builtin): Remove. + +2004-09-24 Zdenek Dvorak + + PR rtl-optimization/17625 + * loop-doloop.c (doloop_modify): Unshare rtl before emitting it. + +2004-09-24 Andrew Pinski + + PR tree-opt/17624 + * tree-ssa-forwprop.c (record_single_argument_cond_exprs): + Reject if any of the operands occur in an abnormal PHI. + +2004-09-24 Andreas Schwab + + * tree-ssa-dom.c (record_range): Fix violation of strict aliasing + rules. + +2004-09-24 Eric Botcazou + + * config.gcc (sparc64-*-solaris2*): Include sparc/sol2-gas.h + if the GNU assembler is used. + (sparc-*-solaris2*): Likewise. + * dbxout.c (NO_DBX_BNSYM_ENSYM): Default to zero. + (dbxout_function_end): Protect N_ENSYM with it. + (dbxout_begin_prologue): Protect N_BNSYM with it. + * doc/tm.texi (NO_DBX_BNSYM_ENSYM): Document it. + * config/sparc/sol2.h (NO_DBX_BNSYM_ENSYM): Define to 1. + * config/sparc/sol2-gas.h: New file. + +2004-09-23 H.J. Lu + + PR bootstrap/17369 + * Makefile.in (@set_gcc_lib_path@): Added. + + * configure.ac: Include ../config/gcc-lib-path.m4. Use + TL_AC_GNU_MAKE_GCC_LIB_PATH. + * configure: Regenerated. + +2004-09-24 Joseph S. Myers + + PR c/6980 + * c-typeck.c (build_c_cast): Improve wording of + -Wbad-function-cast diagnostic. + +2004-09-23 Hans-Peter Nilsson + + PR target/17626 + * config/cris/cris.md (moverside, movemside): Rename variable + "reg" to "otherop". To generate canonical RTX, check that otherop + isn't constant instead of checking that operand 1 is a register. + +2004-09-23 Jakub Jelinek + + * tree-ssa-propagate.c (set_rhs): Fail if EXPR is COMPOUND_EXPR. + +2004-09-23 Diego Novillo + Jakub Jelinek + + * tree-flow.h (find_new_referenced_vars): Add prototype. + * tree-sra.c (find_new_referenced_vars_1, find_new_referenced_vars): + Move to... + * tree-dfa.c (find_new_referenced_vars_1, find_new_referenced_vars): + ... here. + (mark_new_vars_to_rename): Walk through all operands. + * tree-ssa-ccp.c (convert_to_gimple_builtin): New function. + (execute_fold_all_builtins): Use it. + (pass_fold_builtins): Add TODO_rename_vars to todo_flags_finish. + +2004-09-23 P.J. Darcy + + * gthr-tpf.h: New file. + * config.gcc (s390x-ibm-tpf*): Add thread_file='tpf'. + * gthr.h: Use gthr-tpf.h on TPF OS. + +2004-09-23 Jeff Law + + * tree-ssa-ccp.c (get_default_value): Use SSA_NAME_VALUE rather + than SSA_NAME_EQUIV and SET_SSA_NAME_EQUIV. + (substitute_and_fold): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Remove everything + except invariants from SSA_NAME_VALUE. + (thread_across_edge): Use SSA_NAME_VALUE rather than SSA_NAME_EQUIV + and SET_SSA_NAME_EQUIV. + (restore_vars_to_original_value, record_const_or_copy): Likewise. + (record_equivalences_from_phis, record_const_or_copy_1): Likewise. + (record_equality, cprop_into_successor_phis): Likewise. + (record_equivalences_from_stmt, cprop_operand): Likewise. + (lookup_avail_expr): Likewise. + * tree-ssa-pre.c (fini_pre): Remove everything except invariants + from SSA_NAME_VALUE. + * tree.h (SSA_NAME_EQUIV, SET_SSA_NAME_EQUIV): Kill. + (struct tree_ssa_name): Kill EQUIV field. Remove GGC skip + annotation from the VALUE_HANDLE field. + +2004-09-21 Fariborz Jahanian + + PR c++/13989 + PR c++/9844 + * tree.c (reconstruct_complex_type): Remove extra "this". + * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): + Add V4SFmode to case statement. + +2004-09-23 Joseph S. Myers + + PR c/16833 + * doc/extend.texi, doc/invoke.texi: Document interaction of + -fno-builtin with format checks. Note that built-in functions + have effects beyond generating code that avoids calls to those + functions. + +2004-09-23 Frank Ch. Eigler + + PR tree-optimization/17533 + * dominance.c (verify_dominators): Tolerate even more incorrect + dominance data during error message printing. + * tree-mudflap.c (mf_build_check_statement_for): Build basic blocks + and edges more correctly. + +2004-09-23 Dorit Naishlos + + * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): + New tree-codes. + * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and + MISALIGNED_INDIRECT_REF. + * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. + * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): + Likewise. + * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) + (find_interesting_uses_address): Likewise. + * fold-const.c (non_lvalue, operand_equal_p): Likewise. + (build_fold_addr_expr_with_type): Likewise. + * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. + * print-rtl.c (print_mem_expr): Likewise. + * tree-dump.c (dequeue_and_dump): Likewise. + * tree-eh.c (tree_could_trap_p): Likewise. + * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. + * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. + * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): + Likewise. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. + * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. + * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. + (add_address_candidates, rewrite_address_base): Likewise. + * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): + Likewise. + * tree.c (staticp, build1_stat): Likewise. + + * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. + * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * expr.c (expand_expr_real_1): Likewise. + + * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New + optabs. + (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values + for the new optabs. + (expand_ternary_op): New function. + * genopinit.c (optabs): Handle the new optabs. + * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. + (init_optabs): Initialize vec_realign_load_optab. + (expand_ternary_op): New functions. + + * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. + (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. + (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. + (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. + * target.h (struct vectorize): New member for struct gcc_target. + (misaligned_mem_ok): New member for targetm.vectorize. + (builtin_mask_for_load): Likewise. + (builtin_mask_for_store): Likewise. + * targethooks.c (default_vect_misaligned_mem_ok): New function. + * targethooks.h (default_vect_misaligned_mem_ok): New function. + + * config/rs6000/altivec.md (build_vector_mask_for_load): New + define_expand. + (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) + (vec_realign_load_v16qi): New define_insn. + * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): + (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. + * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): + (altivec_builtin_mask_for_store): New variables. + (rs6000_builtin_mask_for_load): New function. Implements + TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. + (rs6000_builtin_mask_for_store): New function. Implements + TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. + (rs6000_expand_builtin): Expand the target builtins + builtin_mask_for_load and builtin_mask_for_store. + (altivec_init_builtins): Initialize the new target builtins. + * config/i386/i386.c (ix86_misaligned_mem_ok): New function. + Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. + + * tree-vectorizer.c (vect_create_data_ref): Renamed to + vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. + (vect_create_addr_base_for_vector_ref): Additional argument (offset). + (vectorizable_store): Call vect_create_data_ref_ptr with additional + arguments, and create an indirect_ref with its return value data_ref. + Check aligned_access_p. + (vectorizable_load): Handle misaligned loads, using software-pipelined + scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if + vec_realign_load_optab is supported, or using a scheme without + software-pipelining with MISALIGNED_INDIRECT_REF if the target hook + misaligned_mem_ok is supported. + + (vect_finish_stmt_generation): Typo. + (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. + (vect_analyze_data_refs_alignment): Don't fail vectorization in the + presence of misaligned loads. + (vect_analyze_data_ref_access): Add check for constant init. + (vect_get_symbl_and_dr): Remove duplicate line. + * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. + +2004-09-23 Kazu Hirata + + * builtins.c: Fix a comment typo. + +2004-09-23 Jan Hubicka + + * profile.c (branch_prob): Do not verify flow info in the middle of the + pass. + +2004-09-23 Zdenek Dvorak + + * cfgloop.h (update_single_exits_after_duplication): Declare. + (loopify, split_loop_bb): Declaration changed. + * cfgloopmanip.c (split_loop_bb): Take void * as an argument instead + of rtx. + (loopify): Added redirect_all_edges argument. + (update_single_exits_after_duplication): Export. + * loop-unswitch.c (unswitch_loop): Changed due to loopify change. + * tree-flow.h (tree_duplicate_loop_to_header_edge, + tree_ssa_loop_version): Declare. + * tree-ssa-loop-manip.c (copy_phi_node_args, rename_variables, + set_phi_def_stmts, tree_duplicate_loop_to_header_edge, + lv_adjust_loop_header_phi, lv_adjust_loop_entry_edge, + lv_update_pending_stmts, tree_ssa_loop_version): New functions. + + * tree-ssa-loop-unswitch.c: New file. + * Makefile.in (tree-ssa-loop-unswitch.o): Add. + * timevar.def (TV_TREE_LOOP_UNSWITCH): New timevar. + * tree-flow.h (tree_ssa_unswitch_loops): Declare. + * tree-optimize.c (init_tree_optimization_passes): Add pass_unswitch. + * tree-pass.h (pass_unswitch): Declare. + * tree-ssa-loop.c (tree_ssa_loop_unswitch, + gate_tree_ssa_loop_unswitch, pass_unswitch): New pass. + * doc/passes.texi: Documen tree level loop unswitching. + +2004-09-23 Kazu Hirata + + * cfgexpand.c, config/s390/tpf-eh.c: Fix comment typos. + +2004-09-22 Eric Christopher + + * builtins.c (simplify_builtin_va_start): Remove. + (simplify_builtin): Ditto. + (fold_builtin_strchr): Ditto. + (simplify_builtin_*): Rename remainders to fold_builtin_*. + (expand_builtin): Fix up for above changes. + (fold_builtin_1): Add new folders. Change for above. + (expand_builtin_va_start): Call fold_builtin_next_arg. + * gimplify.c (gimplify_call_expr): Fix calls to simplify_builtin. + * tree.h: Remove prototype for simplify_builtin. + +2004-09-23 Jan Hubicka + + PR debug/17389 + * dwarf2out.c (dwarf2out_finish): Deal with nested functions + of fully inlined functions. + * tree-inline.c (inline_forbidden_p_1): Nested functions can be + inlined. + + * cfgexpand.c (add_reg_br_prob_note): New function. + (expand_gimple_cond_expr): Use it. + (tree_expand_cfg): No longer kill the profile. + * cfgrt.c (rtl_verify_flow_info_1): Check profile consistency + only if it is present. + * passes.c (rest_of_handle_loop_optimize): Kill the profile. + * predict.c (combine_predictions_for_insn): Set the probabilities + based on REG_BR_PROB note if present. + * predict.c (branch_prob): Profile is read only with + flag_branch_probabilities. + +2004-09-22 Kelley Cook + + * aclocal.m4: Add in gettext's m4 includes. + (AC_ICONV, AC_LCMESSAGES, GCC_PATH_PROG): Remove. + * configure.ac: Add in check for iconv.h + * configure: Regenerate. + +2004-09-22 Kelley Cook + + * aclocal.m4: Update for rename of gettext-sister.m4. + +2004-09-22 Daniel Berlin + + Fix PR tree-optimization/17587 + * tree-ssa-pre.c (fini_pre): Commit edge inserts here. + (insert_aux): Instead of here. + +2004-09-22 Diego Novillo + + PR tree-optimization/16721 + * tree-dfa.c (dump_variable): Show TREE_THIS_VOLATILE. + * tree-ssa-alias.c (create_memory_tag): Move setting of + TREE_THIS_VOLATILE ... + (get_tmt_for): ... here. + +2004-09-22 Eric Botcazou + + * config/sparc/sparc.md (cmove splitter): Fix formatting. + (conditional_trap expander): Reject inappropriate CCmodes. + (conditional trap insn): Use V9 syntax if possible. + +2004-09-22 Joseph S. Myers + + PR c/16566 + * c-typeck.c (build_component_ref): Don't special-case + COMPOUND_EXPR. + +2004-09-22 Frank Ch. Eigler + + * dominance.c (verify_dominators): Don't SEGV if recount_dominator + returns NULL. + +2004-09-22 Kazu Hirata + + * doc/c-tree.texi (TRUTH_NOT_EXPR, TRUTH_ANDIF_EXPR, + TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR, + TRUTH_XOR_EXPR): Mention the restriction on types. + +2004-09-22 Matt Austern + + * config/darwin.c (darwin_make_decl_one_only): + Allow coalesced symbol to appear in static archive's table of contents + +2004-09-22 Kazu Hirata + + PR tree-optimization/17512 + * convert.c (convert_to_integer): Don't handle TRUTH_*_EXPR as + special cases. + +2004-09-22 David Edelsohn + + * dbxout.c (get_lang_number): Do not define if + DBX_OUTPUT_MAIN_SOURCE_DIRECTORY is defined. + +2004-09-22 Ralf Corsepius + + PR target/15583 + * config/rs6000/rtems.h (TARGET_OS_CPP_BUILTINS): Add + builtin_define ("__USE_INIT_FINI__"). + +2004-09-22 P.J. Darcy + + * config/s390/s390-protos.h (s390_emit_tpf_eh_return): Add prototype. + * config/s390/s390.c (s390_emit_tpf_eh_return): New function. + * config/s390/s390.h (TARGET_TPF): New macro. + * config/s390/s390.md ("eh_return"): New expander. + * config/s390/t-tpf (LIB2ADDEH): Use unwind-dw2-fde.c rather than + unwind-dw2-fde-glibc.c. Add config/s390/tpf-eh.c. + (LIB2ADDEHDEP): Remove unwind-dw2-fde.c. + * config/s390/tpf.h (TARGET_TPF): Define to 1. + (STACK_POINTER_OFFSET): Increase to 448. + (TARGET_DEFAULT): Set -mtpf-trace on as default. + (TPF_LOC_DIFF_OFFSET): New macro. + (ASM_PREFERRED_EH_DATA_FORMAT): Redefine to always use absolute + encoding. + (__isPATrange): Add prototype. + (MD_FALLBACK_FRAME_STATE_FOR): Define. + * config/s390/tpf-eh.c: New file. + +2004-09-22 Diego Novillo + + * fold-const.c (fold): Avoid non INTEGER_TYPEs when widening + operands in an integer comparison. + * tree-cfg.c (find_taken_edge): Call fold() to determine + whether the predicate is known. + +2004-09-22 Kelley Cook + + * aclocal.m4: Import AM_PROG_CC_C_O and AM_AUX_DIR_EXPAND. + * configure.ac: Call AM_PROG_CC_C_O instead of AC_PROG_CC_C_O. + Create build and doc directories along with the language directories. + Don't create doc directory separately. + * configure: Regenerate. + * Makefile.in: Create all object and executables files built + with the build compiler in a build/ directory. + (genobjnames): Add missing build objects. + (STAGESTUFF): Don't stage the gen* programs. + (ggc-none.o): Define dependencies for the target compiler. + (build-print-rtl.o): Rename to build/print-rtl.o. + (build-errors.o): Rename to build/errors.o. + (build-varray.o): Rename to build/varray.o. + (maintainerclean): Delete the contents of the build directory. + ($(genobjs): %.o): Explicitly use -o. + (build/insn-conditions.o): Delete specfic rule to use generic rule. + (build/gengtype-lex.o): Likewise. + (build/gengtype-yacc.o): Likewise. + (build/gcov-iov.o): Likewise. + +2004-09-22 Nathan Sidwell + + * vec.h (VEC_space): Return true if there _is_ space. + (VEC_reserve): Adjust. + +2004-09-22 Richard Sandiford + + * config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64, + use FPRs for scalar, complex and vector types only. + +2004-09-21 Jeff Law + + * tree-ssa-dom.c (opt_stats): Move so that it lives just after + the opt_stats_d structure. + (vrp_data): Change from a varray into a hash table. + (vrp_hash_elt): New structure for elements in the vrp hash table. + (vrp_hash, vrp_eq):New functions for hashing and testing equality + in the vrp hash table. + (tree_ssa_dominator_optimize): Initialize VRP_DATA. Reorganize + initialization slightly to make it easier to read. No longer need + to grow/clear the varray. Instead empty and delete the hash table. + (dom_opt_finalize_block): Update due to change of VRP_DATA from + a varray to a hash table. + (simplify_cond_and_loop_avail_expr, record_range): Similarly. + + * tree-ssa-ccp.c (get_default_value): If we have a constant + value recorded for an SSA_NAME, then use that constant as + the initial lattice value. + (substitute_and_fold): Transfer equivalences discovered into + SSA_NAME_EQUIV. + + * tree.h (SSA_NAME_EQUIV): Add comments. + (SET_SSA_NAME_EQUIV): Similarly. + +2004-09-21 David Edelsohn + + * config/rs6000/linux64.h (PROCESSOR_DEFAULT64): Default to POWER4. + + * config/rs6000/rs6000.c (rs6000_adjust_cost): dep_insn is used. + +2004-09-21 Mark Mitchell + + * c-decl.c (implicityl_declare): Call maybe_apply_renaming_pragma. + (finish_decl): Likewise. + +2004-09-21 Devang Patel + + * tree.def (VEC_COND_EXPR): New tree node. + * tree-ssa-operands.c (get_expr_operands): Handle VEC_COND_EXPR. + +2004-09-21 Stan Shebs + + * config/rs6000/darwin-tramp.asm: Add __ppc64__ case. + * config/rs6000/darwin-world.asm: Likewise. + +2004-09-21 Daniel Berlin + + * tree-ssa.c (verify_def): Use print_generic_stmt, + not debug_generic_stmt. + (verify_use): Ditto. + (verify_phi_args): Ditto. + (verify_ssa): Ditto. + +2004-09-21 Paul Brook + + * varasm.c (default_assemble_integer): Return false for values wider + than the target word size. Works around GAS bug. + +2004-09-21 Zack Weinberg + + * reg-notes.def (REG_DEP_TRUE): New entry, place first so it + gets value 0. + * print-rtl.c (print_rtx): Print the name of a REG_NOTE even + if it has value 0. + +2004-09-21 Daniel Berlin + + * c-typeck.c (build_function_call): Give name of object + we are attempting to call in error message. + * c-objc-common.c (c_tree_printer): Call pp_expression, + not return false, for 'E' case. + +2004-09-21 Steven Bosscher + + PR rtl-optimization/17482 + * postreload-gcse.c (reg_avail_info, oprs_unchanged_p, + load_killed_in_block_p): Clarify comments. + (record_last_reg_set_info): Make static inline. + (mark_call, mark_set, mark_clobber, mark_oprs_set): Remove. + (record_opr_changes): New function to replace the above. + (compute_hash_table): Clarify comments. Use record_opr_changes. + (reg_set_between_after_reload_p): Clean up. + (reg_used_between_after_reload_p): Likewise. + (eliminate_partially_redundant_load): Clarify comments. + +2004-09-21 Eric Botcazou + + PR rtl-optimization/17266 + * regmove.c (optimize_reg_copy_3): Make a new SUBREG for each insn. + +2004-09-21 Uros Bizjak + + PR rtl-optimization/14851 + * rtlanal.c (commutative_operand_precedence): Calculate + precedence of stripped constant. + +2004-09-20 Jeff Law + Jan Hubicka + + * tree-ssanames.c (make_ssa_name): No longer need to clear, then + initialize key elements here. + (release_ssa_name): Zero the released SSA_NAME here. + * tree.h (SSA_NAME_EQUIV, SET_SSA_NAME_EQUIV): New macros. + (struct tree_ssa_name): Add new "equiv" field. + * tree-ssa-dom.c (const_and_copies): Kill the global varray. + (tree_ssa_dominator_optimize): No longer allocate, resize or + clear CONST_AND_COPIES. + (get_value_for, set_value_for): Kill. + (thread_across_edge): Get/set the equivalency using + SSA_NAME_EQUIV and SET_SSA_NAME_EQUIV. + (restore_vars_to_original_value): Likewise. + (record_equivalences_from_phis): Likewise. + (record_dominating_conditions): Likewise. + (record_const_or_copy, record_equality): Likewise. + (lookup_avail_expr): Likewise. + (record_equivalences_from_stmt, cprop_operand): Likewise. + (cprop_into_successor_phis): No longer need to pass around + CONST_AND_COPIES. Callers updated. Get equivalences via + SSA_NAME_EQUIV. + (cprop_into_phis): Likewise. + +2004-09-20 Matt Austern + Zack Weinberg + + * c-common.c (fix_string_type): Build the unqualified array + type unconditionally, then use c_build_qualified_type to get + the proper const-qualified variant, and set its + TYPE_MAIN_VARIANT to refer to the unqualified type. + * c-lex.c (c_lex_return_raw_string): New global. + (c_lex_with_flags): Honor it. + * c-pragma.h: Declare it. + +2004-09-20 Daniel Berlin + + * Makefile.in: Fix flags.h dependencies to be $(FLAGS_H). + +2004-09-21 Jan Hubicka + + PR middle-end/17126 + * tree-optimize.c (update_inlined_to_pointers): Fix the recursion. + (tree_rest_of_compilation): Cleanup. + +2004-09-20 Ulrich Weigand + + * config/s390/s390.c (s390_select_rtx_section): Remove. + (TARGET_ASM_SELECT_RTX_SECTION): Do not redefine. + +2004-09-20 Kaz Kojima + + * config/sh/sh.c (sh_expand_prologue): Add a REG_FRAME_RELATED_EXPR + note to pretend a direct save from the original register when an + intermediate register is used for the save. + +2004-09-20 Kaveh R. Ghazi + + * tsystem.h (alloca): Provide a default definition. + + Revert: + 2001-08-31 Kaveh R. Ghazi + * unwind-dw2.c: Call __builtin_alloca, not alloca. + +2004-09-20 Andrew Pinski + + PR tree-opt/17558 + * tree-ssa-copy.c (may_propagate_copy): Only allow if the + aliasing sets are the same rather than just conflicting. + +2004-09-20 Jan Hubicka + + PR middle-end/16460 + + * cgraph.c (cgraph_unnest_node): New function. + (c_finalize): Rename to .... + (c_warn_unused_result_recursivly): ... this one; do only the warning + (finish_function): Finalize the toplevel function; do not lower nested tree. + * cgraph.h (cgraph_unnest_node): Declare. + * cgraphunit.c (decide_is_function_needed): Do not use cgraph + nestedness datastructure. + * cse.c (cse_insn): Do not cprop nonlocal LABEL_REFs. + * reload1.c (set_label_offsets): Fix call of set_label_offsets. + * tree-nested.c (finlize_nesting_tree_1): Use un-nesting code. + +2004-09-20 Richard Henderson + + * config/alpha/alpha.c (some_small_symbolic_operand_int): Rename + from some_small_symbolic_operand_1; export. + (some_small_symbolic_operand): Remove. + * config/alpha/alpha.md (some_small_symbolic_operand splitter): Remove + extra C check. + * config/alpha/predicates.md (some_small_symbolic_operand): New. + +2004-09-20 Jan Hubicka + + * predict.c (return_prediction): New function. + (apply_return_prediction): Likewise. + (tree_bb_level_predictions): Likewise. + (tree_estimate_probability): Add noreturn exit edges; call + bb_level_predictions; fix logic of return heuristics. + (predict_paths_leading_to): Rescuesce from old CVS version of + process_note_prediction function. + * predict.def (PRED_TREE_EARLY_RETURN): New predictor. + +2004-09-20 Andreas Krebbel + + * config/s390/s390.c (s390_frame_info): Added alignment statement for + floating point register area on stack. + +2004-09-20 Jakub Jelinek + + * predict.c (expr_expected_value): Use *_CLASS_P macros. + +2004-09-20 Daniel Berlin + + * tree-ssa-pre.c (compute_antic_aux): Use malloc'd worklist, to avoid + generating useless garbage. + +2004-09-20 Paolo Bonzini + + * builtins.c (fold_builtin): Call the new omonymous + target hook for machine-dependent built-ins. + * target-def.h (TARGET_FOLD_BUILTIN): New. + * target.h (struct gcc_target): Add the fold_builtin hook. + * targhooks.c (default_fold_builtin): New. + * targhooks.h (default_fold_builtin): Declare it. + +2004-09-20 Kazu Hirata + + * cfg.c, tree-ssa-threadupdate.c, tree-vectorizer.c: Fix + comment typos. + +2004-09-20 Richard Sandiford + + PR target/17565 + * config/mips/mips.md (define_asm_attributes): Set can_delay to no. + +2004-09-20 Jan Hubicka + + * predict.c (estimate_probability): Remove unnecesary code. + +2004-09-19 Ira Rosen + + * tree-vectorizer.h (stmt_vec_info): Add vect_dr_base field. + (STMT_VINFO_VECT_DR_BASE): Declare. + (VECT_SMODULO): Declare. + * tree-vectorizer.c (vect_compute_array_ref_alignment): New function. + (vect_compute_array_base_alignment): New function. + (vect_analyze_data_ref_access): Check array indices. Remove one + dimensional arrays restriction. + (vect_get_ptr_offset): New function. + (vect_get_symbl_and_dr): New function. + (vect_get_base_and_bit_offset): Support additional data refs. Renamed + (former name vect_get_base_decl_and_bit_offset). + (vect_create_index_for_array_ref): Removed. + (vect_create_index_for_vector_ref): New function. + (vect_create_addr_base_for_vector_ref): New function. + (vect_create_data_ref): Handle additional data refs. Call + vect_create_index_for_vector_ref and vect_create_addr_base_for_vector_ref. + (vect_compute_data_ref_alignment): Support the changes. Call + vect_get_base_and_bit_offset. + (vect_analyze_data_refs): Call vect_get_symbl_and_dr. Support additional + data refs. Store vect_dr_base. + (vect_analyze_data_ref_accesses): Support nonconstant init. + (new_stmt_vec_info): Initialize vect_dr_base field. + (vect_is_simple_iv_evolution): Call initial_condition_in_loop_num. + (get_vectype_for_scalar_type): Check for BLKmode. + * tree-chrec.h (initial_condition_in_loop_num): Declare. + * tree-chrec.c (initial_condition_in_loop_num): New function. + (chrec_component_in_loop_num): New function. + (evolution_part_in_loop_num): Call chrec_component_in_loop_num. + * tree-data-ref.c (analyze_array_indexes): Change parameter (access_fns) + to be pointer to varray_type. + +2004-09-19 Jan Hubicka + + * basic-block.h (update_bb_profile_after_threading): Declare. + * cfg.c (update_bb_profile_after_threading): Break out from ... + * cfgcleanup.c (try_forward_edges): ... here; use it. + * tree-ssa-dom.c (thread_across_edge): Use it. + * tree-ssa-threadupdate.c (create_block_for_threading): Zero out + profile of the new BB. + +2004-09-19 Daniel Berlin + + * tree-ssa-pre.c (insert_into_set): Don't put + is_gimple_min_invariant values into the set. + +2004-09-19 Andreas Jaeger + + * tree-ssa-dom.c (restore_nonzero_vars_to_original_value): Fix + prototype. + +2004-09-18 Kazu Hirata + + * config/cris/cris.h: Preserve the original spelling in a + quote. + +2004-09-18 Jeff Law + + * tree-ssa-dom.c (nonzero_vars_stack, vrp_variables_stack): New + global varrays to replace the block local varrays. + (struct dom_walk_block_data): Remove, no longer used. + (get_eq_expr_value): No longer need to pass around pointers to local + varrays. Callers updated. Unused markers added to unused parameters. + (record_range, record_equivalences_from_stmt): Likewise. + (record_equivalences_from_incoming_edge): Likewise. + (record_var_is_nonzero): Likewise. Update now that we have a + single global varray of SSA_NAMEs that need restoring. + (dom_opt_initialize_block_local_data): Kill, no longer used. + (tree_ssa_dominator_optimize): Initialize new global varrays. + Update callbacks in dominator walker structure. + (dom_opt_initialize_block): Add markers to NONZERO_VAR_STACK and + VRP_VARIABLES_STACK. + (restore_nonzero_vars_to_original_value): Update now that we have + a single global varray of SSA_NAMEs that need restoring. + (dom_opt_finalize_block): Similarly for VRP_VARIABLES_STACK. + Remove unused variables. + (optimize_stmt): Remove unused variable. + +2004-09-18 Jan Hubicka + + * tree-cfg.c (thread_jumps): Fix updating of the profile. + + * tree-optimize.c (tree_rest_of_compilation): Kill forgotten + verify_cgraph call. + +2004-09-18 Kazu Hirata + + * alias.c, crtstuff.c, dbxout.c, domwalk.c, domwalk.h, gcc.c, + gcse.c, global.c, lambda-code.c, loop.c, mips-tdump.c, + optabs.h, predict.c, reg-stack.c, regclass.c, sched-rgn.c, + tree-optimize.c, tree-ssa-dom.c, tree-ssa-forwprop.c, + tree-ssa-operands.c, tree-ssa-phiopt.c, + tree-ssa-threadupdate.c: Fix comment typos. + +2004-09-18 Kazu Hirata + + * config/darwin-c.c, config/arc/arc.c, config/arc/arc.md, + config/arm/README-interworking, config/arm/arm-cores.def, + config/arm/arm.c, config/arm/arm.h, config/arm/pe.c, + config/arm/vfp.md, config/c4x/c4x.c, config/c4x/c4x.h, + config/cris/cris.c, config/cris/cris.h, config/fr30/fr30.c, + config/fr30/fr30.h, config/fr30/fr30.md, config/frv/frv.c, + config/frv/frv.md, config/i386/winnt.c, + config/ia64/unwind-ia64.c, config/iq2000/iq2000.c, + config/iq2000/iq2000.h, config/m68hc11/m68hc11.c, + config/m68hc11/m68hc11.md, config/m68k/m68k.c, + config/mcore/mcore.c, config/mips/mips.h, + config/mn10300/mn10300.md, config/pa/pa.c, + config/pa/pa64-regs.h, config/pdp11/pdp11.c, + config/rs6000/rs6000.c, config/sh/symbian.c, + config/sparc/sparc.h: Fix comment typos. Follow spelling + conventions. + +2004-09-18 Joseph S. Myers + + PR c/17424 + * c-typeck.c (c_expr_sizeof_expr): Check for error_mark_node. + +2004-09-18 Diego Novillo + + * tree-ssa-alias.c (setup_pointers_and_addressables): Don't + remove TREE_ADDRESSABLE from RESULT_DECL. + +2004-09-18 Diego Novillo + + * tree-ssa-alias.c (dump_alias_info): Ignore NULL SSA_NAMEs. + +2004-09-18 Jan Hubicka + + * tree-into-ssa.c (rewrite_ssa_into_ssa): Expect ssa_name to return + NULL. + * tree-ssa-alias.c (init_alias_info): Likewise. + * tree-ssa.c (verify_flow_sensitive_alias_info): Likewise. + (verify_ssa): Likewise. + * tree-ssanames.c (make_ssa_name): Clear out ssa_names arrays. + +2004-09-18 Jan Hubicka + + * i386.c (legitimize_pic_address): Fix splitting of PLUS with + huge offset. + +2004-09-18 Kaz Kojima + + * config/sh/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove. + * config/sh/sh.h (ASM_PREFERRED_EH_DATA_FORMAT): Use + DW_EH_PE_sdata* for data. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. + +2004-09-17 Geoffrey Keating + + * tree-inline.c (copy_tree_r): Don't duplicate constants, they're + shared anyway. + + PR pch/13361 + * c-typeck.c (constructor_asmspec): Delete. + (struct initializer_stack): Delete field 'asmspec'. + (start_init): Delete saving of asmspec. + (finish_init): Don't update constructor_asmspec. + * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. + * stmt.c (expand_asm): Duplicate strings from tree. + (expand_asm_operands): Likewise. + * tree.c (tree_size): Update computation of size of STRING_CST. + (make_node): Don't make STRING_CST nodes. + (build_string): Allocate string with tree node. + (tree_code_size): Clean up assertions, don't allow requests + for "the size of a STRING_CST". + * tree.def (STRING_CST): Update comment. + * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. + (tree_string): Place contents of string in tree node. + * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string + from tree. + +2004-09-17 Zack Weinberg + + * Makefile.in (c-parse.o): Depend on $(C_PRAGMA_H). + * objc/Make-lang.in (objc/objc-parse.o): Likewise. + +2004-09-17 Jones Desougi + + * configure.ac: Replace AC_COMPILE_CHECK_SIZEOF with AC_CHECK_SIZEOF. + * configure, config.in: Regenerate. + +2004-09-17 Zack Weinberg + + * tree.c, tree.h (tree_class_strings): Make array const. + Reindent per coding convention. Move asterisk to proper place + per coding convention. + +2004-09-18 Andreas Schwab + + * Makefile.in (gimple-low.o): Depend on $(EXPR_H). + (tree-vectorizer.o): Likewise. + (targhooks.o): Likewise. + +2004-09-17 Jeffrey D. Oldham + Zack Weinberg + + * alias.c (find_base_decl): Remove unreachable case '3' block. + * expr.c (safe_from_p): Abort if passed a type. + * tree-gimple.c (recalculate_side_effects): Abort if passed + anything other than an expression. + * tree-ssa-pre.c (phi_translate): Return expr immediately if + is_gimple_min_invariant is true for it. Reorder cases for clarity. + Abort on un-handled tree classes. + (valid_in_set): Likewise. + * tree.c (tree_code_class_strings): New static data. + + * tree.h (enum tree_code_class): New. + (tree_code_class_strings): Declare. + (TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P) + (REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P) + (STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros. + (TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS) + (checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update. + + * tree.def, c-common.def, objc/objc-tree.def: Use + tree_code_class enumeration constants instead of code letters. + + * alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c + * c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c + * emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c + * langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c + * tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c + * tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c + * tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c + * tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c + * tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c + * tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c + * tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c + * config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c + * config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c + Update to match. + + * LANGUAGES: Add note about change. + +2004-09-17 Diego Novillo + + PR tree-optimization/17319 + * tree-ssa-alias.c (compute_points_to_and_addr_escape): Also + examine pointers on the LHS of an assignment. + (collect_points_to_info_r): Handle RETURN_EXPR. + +2004-09-17 Jeff Law + + * tree-ssa-dom.c (const_and_copies_stack): New. + (dom_walk_block_data): Remove const_and_copies field. + (record_const_or_copy): No longer need to pass in varray_type *. + Use CONST_AND_COPIES_STACK rather than passed in block local stack. + Callers updated. + (record_equality): Similarly. + (restore_vars_to_original_value): Similarly. Revamp to use new + single global stack rather than per-block stacks. + (tree_ssa_dominator_optimize): Initialize the CONST_AND_COPIES_STACK. + (thread_across_edge): Remove now unused parameters. + (dom_opt_initialize_block_local_data): No longer test the block + local CONST_AND_COPIES. + (dom_opt_initialize_block): Push a marker on CONST_AND_COPIES_STACK. + +2004-09-17 Jan Hubicka + + PR tree-optimization/17509 + * tree-optimize.c (update_inlined_to_pointers): New function. + (tree_rest_of_compilation): Use it. + +2004-09-17 Devang Patel + + * dbxout.c (get_lang_number): New. + (dbxout_init): Include lang number in N_SO stab. + * dbxout.h (N_SO_AS, N_SO_C, N_SO_ANSI_C, N_SO_CC, N_SO_FORTRAN, + N_SO_PASCAL, N_SO_FORTRAN90, N_SO_OBJC, N_SO_OBJCPLUS): New #define. + +2004-09-17 Diego Novillo + + PR tree-optimization/17273 + * tree-ssa.c (replace_immediate_uses): Call fold_stmt if the + replacement is a constant. + +2004-09-17 Joseph S. Myers + + * c-tree.h (enum c_typespec_keyword): New. + (struct c_declspecs): Adjust description of "type". Remove + specbits, explicit_int_p and explicit_char_p. Rename + typedef_signed_p to explicit_signed_p. Add default_int_p, long_p, + short_p, signed_p, unsigned_p and complex_p. + (finish_declspecs): New. + * c-parse.in (datadef, datadecl, setspecs, decl, component_decl, + typename): Call finish_declspecs. + * c-decl.c (finish_declspecs): New. + (declspecs_add_type): Check for combinations which cannot occur in + valid specifier lists. Update comments. + (shadow_tag_warned): Remove checks done in finish_declspecs. + Don't report useless type name if type defaulted to int. + (grokdeclarator): Remove checks and actions done in + finish_declspecs. Don't allow for type being NULL. Update for + datastructures changes. Initialize decl_attr. + (build_null_declspecs, quals_from_declspecs): Update for + datastructures changes. + +2004-09-17 Sylvain Pion + + * doc/extend.texi: Fix duplicated word. + +2004-09-17 Toon Moene + + * doc/invoke.texi: Remove stray explanation on + -freduce-all-givs and -fmove-all-movables. + +2004-09-17 James Morrison + + * doc/cfg.texi: Use @smallexample. + * doc/md.texi: Likewise. + * doc/tree-ssa.texi: Likewise. + * doc/extend.texi: Likewise. Use @r{} in comments. + * doc/trouble.texi: Use @r{} in comments. + +2004-09-17 Hans-Peter Nilsson + + * configure.ac (gcc_cv_gld_version): Handle whitespace before + "VERSION=". + * aclocal.m4 (_gcc_COMPUTE_GAS_VERSION): Ditto. + * configure: Regenerate. + +2004-09-17 J"orn Rennecke + + * sh.c (sh_gimplify_va_arg_expr): Don't call pass_by_reference. + (sh_pass_by_reference): Work around std_gimplify_va_arg_expr bug. + * t-sh (MULTILIB_CPUS): s/ML_m/ML_sh/g . + * t-sh64 (MULTILIB_CPU_DIRS): Likewise. Match dashes and trailing + slashes in substitutions. + (MULTILIB_DIRNAMES): Remove defunct removal of /media32. + +2004-09-17 Kazu Hirata + + * basic-block.h, c-decl.c, c-parse.in, cgraphunit.c, ddg.c, + gimplify.c, lambda-code.c, optabs.c, predict.c, + tree-scalar-evolution.c, tree-sra.c, tree-ssa-loop-ch.c, + tree-ssa.c, vec.h: Fix comment typos. Follow spelling + conventions. + +2004-09-17 Kazu Hirata + + * doc/compat.texi, doc/cpp.texi, doc/cppopts.texi, + doc/extend.texi, doc/install.texi, doc/invoke.texi, + doc/sourcebuild.texi, doc/tm.texi, doc/tree-ssa.texi, + doc/trouble.texi: Use @option around options. + +2004-09-17 Richard Sandiford + + * Makefile.in (gen-protos.o): Depend on errors.h. + +2004-09-17 Steven Bosscher + + PR tree-optimization/17513 + * cfgexpand.c (construct_init_block): Clear EDGE_EXECUTABLE + for successors of the entry block. + +2004-09-17 Uros Bizjak + + PR rtl-optimization/15187 + * ifcvt.c (noce_try_cmove_arith): Exit early if total + insn_rtx_cost of both branches > BRANCH_COST + +2004-09-16 Diego Novillo + + PR tree-optimization/17528 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Do not + erase the may-alias set for a tag when merging it with + another. + +2004-09-16 Kaz Kojima + + * config/sh/sh.md (call): Extend 32-bit addresses to DImode + for 32-bit TARGET_SHMEDIA. + (call_value): Likewise. + +2004-09-16 Diego Novillo + + * tree-ssa-operands.c (add_call_clobber_ops): Make read-only + test apply only to TREE_STATIC and DECL_EXTERNAL. + +2004-09-16 Zdenek Dvorak + + * Makefile.in (tree-cfg.o): Add CFGLAYOUT_H dependency. + * basic-block.h (get_dominated_by_region): Declare. + * dominance.c (get_dominated_by_region): New function. + * tree-cfg.c: Include cfglayout.h. + (tree_duplicate_bb): Duplicate also phi nodes. + (struct ssa_name_map_entry): New type. + (add_phi_args_after_copy_bb, add_phi_args_after_copy, + ssa_name_map_entry_hash, ssa_name_map_entry_eq, + allocate_ssa_names, rewrite_to_new_ssa_names_def, + rewrite_to_new_ssa_names_use, rewrite_to_new_ssa_names_bb, + rewrite_to_new_ssa_names, tree_duplicate_sese_region): New functions. + * tree-flow.h (tree_duplicate_sese_region, add_phi_args_after_copy_bb, + add_phi_args_after_copy, rewrite_to_new_ssa_names_bb, + rewrite_to_new_ssa_names, allocate_ssa_names, + rewrite_into_loop_closed_ssa, verify_loop_closed_ssa): Declare. + * tree-ssa-loop-ch.c (duplicate_blocks): Removed. + (copy_loop_headers): Use tree_duplicate_sese_region. + +2004-09-16 Frank Ch. Eigler + + * profile.c (branch_prob): Restore support for USE_MAPPED_LOCATION. + +2004-09-16 Jeff Law + + * tree-into-ssa.c (block_defs_stack): New toplevel varray. + (rewrite_block_data): Remove, no longer used. + (rewrite_initialize_block_local_data): Remove, no longer used. + (rewrite_initialize_block): Mark parameters as unused as needed. + Change references to the block local block_defs to be block_defs_stack. + Push a marker onto the block_defs_stack. + (ssa_rewrite_initialize_block): Similarly. + (rewrite_stmt, ssa_rewrite_stmt): Similarly. + (ssa_register_new_def): No longer needs varray argument. Use + block_defs_stack instead. No longer handle possibly null block_defs + varray. Reverse order of items we push on the stack to make it + easier to identify our marker. + (register_new_def): No longer handle possibly null block_defs + varray. + (rewrite_finalize_block): Revamp to look for markers in the global + block_defs_stack varray rather than wiping a block local varray. + Mark arguments as unused as needed. + (ssa_rewrite_finalize_block): Similarly. + (rewrite_into_ssa): Update initialization of dom walker structure + to reflect that we don't need block local data anymore. Initialize + the block_defs_stack varray. + (rewrite_ssa_into_ssa): Similarly. + * tree-ssa-dom.c (block_defs_stack): New toplevel varray. + (struct dom_walk_data): Kill block_defs field. + (tree_ssa_dominator_optimize): Initialize block_defs_stack. + (thread_across_edge): Use the global block_defs_stack instead of + the old block_defs varray. + (dom_opt_initialize_block_local_data): Update now that we don't have + block_defs field to check anymore. + (dom_opt_initialize_block): Push a marker onto block_defs_stack. + (restore_currdefs_to_original_value): Use the new block_defs_stack + instead of a block local varray. + (dom_opt_finalize_block): Similarly. + (record_equivalencs_from_phis): Similarly. + (optimize_stmt, register_definitions_for_stmt): Similarly. + +2004-09-16 Andrew MacLeod + + PR tree-optimization/17517 + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't + coalesce same-root variables without checking for abnormal PHI usage. + +2004-09-16 Daniel Berlin + + * cfgloop.h (duplicate_loop): Add prototype. + * cfgloopmanip.c (duplicate_loop): Make non-static. + * lambda-code.c (perfect_nestify): Factor out test whether + we can handle this loop into separate function. + Call it. + (can_convert_to_perfect_nest): New function. + (replace_uses_of_x_with_y): Add modify_stmt call. + * tree-loop-linear.c (linear_transform_loops): Call + rewrite_into_loop_closed_ssa and free_df. + +2004-09-16 Daniel Berlin + + * lambda-code.c (invariant_in_loop): is_gimple_min_invariant is + loop invariant as well. + (perfect_nestify): new function. + (gcc_loop_to_lambda_loop): New parameters to track lower bounds, + upper bounds, and steps. + Set outerinductionvar properly. + (gcc_loopnest_to_lambda_loopnest): Add loops and need_perfect + parameters. + Return NULL if we need a perfect loop and can't make one. + (lambda_loopnest_to_gcc_loopnest): Correct algorithm. + (not_interesting_stmt): New function. + (phi_loop_edge_uses_def): Ditto. + (stmt_uses_phi_result): Ditto. + (stmt_is_bumper_for_loop): Ditto. + (perfect_nest_p): Ditto. + (nestify_update_pending_stmts): Ditto. + (replace_uses_of_x_with_y): Ditto. + (stmt_uses_op): Ditto. + (perfect_nestify): Ditto. + * lambda-mat.c (lambda_matrix_id_p): New function. + * lambda-trans.c (lambda_trans_matrix_id_p): Ditto. + * lambda.h: Update prototypes. + * tree-loop-linear (linear_transform_loop): Use new + perfect_nest_p. Detect and ignore identity transform. + * tree-ssa-loop.c (pass_linear_transform): Use TODO_write_loop_closed. + +2004-09-16 Sebastian Pop + + * tree-loop-linear.c (gather_interchange_stats): Add more comments. + Gather also strides of accessed data. Pass in the data references + array. + (try_interchange_loops): Add a new heuristic for handling the temporal + locality. Pass in the data references array. + (linear_transform_loops): Pass the data references array to + try_interchange_loops. + +2004-09-16 Kazu Hirata + + * doc/invoke.texi: Fix typos. Follow spelling conventions. + +2004-09-16 Nathan Sidwell + + * doc/c-tree.texi (Classes): Remove index entries for + TREE_VIA_{PUBLIC,PROTECTED,PRIVATE}. + +2004-09-16 Zdenek Dvorak + + * fold-const.c (fold): Fold difference of addresses. + (ptr_difference_const): Moved from tree-ssa-loop-ivopts, based on + get_inner_reference. + * tree-ssa-loop-ivopts.c (peel_address): Removed. + (ptr_difference_const): Moved to fold-const.c. + (split_address_cost): Use get_inner_reference instead of peel_address. + (ptr_difference_cost): Change type of diff to HOST_WIDE_INT. + * tree.h (ptr_difference_const): Export. + + * tree-ssa-loop-ivopts.c (dump_iv, dump_use, dump_cand): Add induction + variable type to the dump. Fix indentation. + (idx_find_step): Handle nonconstant array_ref_element_size and + array_ref_low_bound. + (idx_record_use): Handle array_ref_element_size and + array_ref_low_bound. + (find_interesting_uses_stmt): Handle memory = nontrivial_expression + statements correctly. + (get_computation_at, iv_value): Do not unshare expressions here. + (rewrite_use_outer): Unshare the expression before it is emitted + to code. + * tree-ssa-loop-niter.c (unsigned_type_for, signed_type_for): + Moved to tree.c. + * tree.c (unsigned_type_for, signed_type_for): Moved from + tree-ssa-loop-niter.c. Use langhooks. + * tree.h (signed_type_for): Export. + +2004-09-16 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): Update + prototype. + +2004-09-15 Andrew Pinski + + PR target/11572 + * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. + Add two parameters to extra_includes. + (C_INCPATH_INIT): Remove. + * c-incpath.c (register_include_chains): Call extra_pre_includes + before adding the standard include directory. + Update call to extra_includes. + (!defined TARGET_EXTRA_INCLUDES): Update + hook_void_charptr_charptr_int and add !define + TARGET_EXTRA_PRE_INCLUDES. + (!define TARGET_EXTRA_INCLUDES): Define as + hook_void_charptr_charptr_int. + (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. + (target_c_incpath): Always declare. + * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a + empty function. + (define TARGET_EXTRA_PRE_INCLUDES): Likewise. + * config/darwin.h: (darwin_register_frameworks): Update for + the two new parameters. + (darwin_register_objc_includes): Add prototype. + (TARGET_EXTRA_PRE_INCLUDES): Define. + * config/darwin-c.c (darwin_register_objc_includes): New function. + (darwin_register_frameworks): Update for the two new parameters. + (target_c_incpath): Remove. + * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to + the compile line. + * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new + parameters. + (TARGET_EXTRA_PRE_INCLUDES): Document. + + * gcc.c (spec_function): Add replace-outfile. + (replace_outfile_spec_function): New function. + * config/darwin.h (LINK_SPEC): Add replace + -lobjc with -lobjc-gnu if -fgnu-runtime is + supplied. + * invoke.texi (replace-outfile): Document. + +2004-09-13 Jan Hubicka + + * predict.c (expr_expected_value, strip_builtin_expect): New function. + (tree_predict_by_opcode): Use it. + (tree_estimate_probability): Add, for now disabled, + strip_builtin_expect call. + +2004-09-15 James E Wilson + + PR target/17455 + * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Return false + if current_function_decl is a sibcall. + +2004-09-15 Mark Mitchell + + * varasm.c (default_function_rdodata_section): Make sure to pass + along a decl for a link-once section. + +2004-09-15 Richard Henderson + + * tree-ssa-operands.c (add_call_clobber_ops): Fix unused variable + warning with code disable. Fix formatting. + +2004-09-15 Steven Bosscher + + * Makefile.in (tree-ssa-dom.o): Depend on tree-ssa-propagate.h. + * tree-ssa-dom.c (cprop_into_stmt): Recompute TREE_INVARIANT + after propagating into an ADDR_EXPR. + +2004-09-15 Andrew Pinski + + PR rtl-opt/17427 + * gcse.c (process_insert_insn): insn_invalid_p has side effects. + Move it out of gcc_assert. + +2004-09-15 Joseph S. Myers + + * attribs.c, builtins.c, c-format.c, c-pch.c, coverage.c, + except.c, fold-const.c, function.c, langhooks.c, params.c, + reload.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, + tree-dump.c, tree-mudflap.c, tree.c, varasm.c: Use %<, %> and %q + for quoting in diagnostics going through pretty-print.c. Use '' + for quoting in other diagnostic text. + * langhooks.c: Include intl.h. Mark text locating diagnostics for + translation. + * Makefile.in (langhooks.o): Update dependencies. + * pretty-print.h (pp_printf): Mark as accepting GCC diagnostic + formats. + +2004-09-15 Mark Mitchell + + * configure.ac: Check for COMDAT support. Robustify check for + SHF_MERGE support. + * configure: Regenerated. + * config.in: Likewise. + * langhooks-def.h (lhd_comdat_group): New function. + (LANG_HOOKS_COMDAT_GROUP): New macro. + (LANG_HOOKS_DECLS): Use it. + * langhooks.c (lhd_comdat_group): Define. + * langhooks.h (lang_hooks_for_decls): Add comdat_group. + * output.h (named_section_flags): Make it a macro. + (named_section_real): New function. + (default_no_named_section): Add decl parameter. + (default_elf_asm_named_section): Likewise. + (default_coff_asm_named_section): Likewise. + (default_pe_asm_named_section): Likewise. + * target.h (gcc_target): Adjust type of named_section. + * varasm.c (named_section_flags): Rename to named_section_real. + Add decl parameter. + (default_no_named_section): Add decl parameter. + (default_elf_asm_named_section): Use COMDAT, if available. Deal + with the case that ASM_COMMENT_START is "@". + (default_coff_asm_named_section): Add decl parameter. + (default_pe_asm_named_section): Likewise. + * config/alpha/alpha.c (vms_asm_named_section): Add decl + parameter. + (unicosmk_asm_named_section): Likewise. + * config/arm/arm.c (arm_elf_asm_named_section): Remove. + * config/arm/elf.h (TARGET_ASM_NAMED_SECTION): Likewise. + * config/c4x/c4x.c (c4x_asm_named_section): Add decl parameter. + * config/cris/cris-protos.h (cris_target_asm_named_section): + Likewise. + * config/cris/cris.c (cris_target_asm_named_section): + Likewise. + * config/darwin/darwin-protos.h (darwin_asm_named_section): + Likewise. + * config/darwin/darwin.c (darwin_asm_named_section): Likewise. + * config/h8300/h8300.c (h8300_asm_named_section): Likewise. + * config/i386/i386-protos.h (i386_pe_asm_named_section): + Likewise. + * config/i386/winnt.c (i386_pe_asm_named_section): Likewise. + * config/m68k/m68k.c (m68k_coff_asm_named_section): Likewise. + * config/mcore/mcore.c (mcore_asm_named_section): Likewise. + * config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): + Likewise. + * config/sparc/sparc.c (sparce_elf_asm_named_section): Likewise. + * cp/cp-lang.h (LANG_HOOKS_COMDAT_GROUP): Define. + * cp/cp-tree.h (cxx_comdat_group): Declare. + * cp/decl.c (cxx_comdat_group): New function. + +2004-09-15 Jan Hubicka + + * tree-ssa.c (verify_flow_sensitive_alias_info): Do not walk dead nodes. + * tree-tailcall.c (eliminate_tail_call): Release SSA name. + + * tree-cfg.c (remove_bb): Release SSA defs. + +2004-09-15 Kazu Hirata + + * doc/tm.texi: Follow spelling conventions. + +2004-09-15 Kazu Hirata + + * tree-ssa-dom.c: Fix comment typos. + +2004-09-15 Alan Modra + + * config/rs6000/linux-unwind.h (struct gcc_pt_regs): Extend to + include ccr. + (ppc_fallback_frame_state): Save location of CR. + +2004-09-15 Jakub Jelinek + + * expr.c (string_constant): Handle also read-only variables + initialized to string literals. + + * builtins.c (expand_builtin_memmove): Optimize memmove (x, y, 1) + into memcpy (x, y, 1) if memcpy can be expanded inline. + +2004-09-15 Zdenek Dvorak + + PR tree-optimization/17468 + * tree-ssa.c (verify_use, verify_phi_args, verify_ssa): Verify that + definition inside a block precede uses. + * tree-tailcall.c (adjust_return_value): Emit statements in the + correct order. + +2004-09-15 Richard Sandiford + + * config/mips/mips.h (POINTERS_EXTEND_UNSIGNED): Delete. + +2004-09-15 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Properly format warning. + +2004-09-14 Jeff Law + + * tree-ssa-dom.c (avail_exprs_stack): New global varray. + (struct dom_walk_block_data): Remove avail_exprs member. + (tree_ssa_dominator_optimize): Initialize avail_exprs_stack. + (lookup_avail_expr): No longer need to pass in address of + the block local available exprs stack. All callers changed. + (simplify_cond_and_lookup_avail_expr): Similarly. + (simplify_switch_and_lookup_avail_expr): Similarly. + (get_eq_expr_value, record_cond): Likewise. + (record_dominating_conditions): Likewise. + (update_rhs_and_lookup_avail_expr): Likewise. + (record_equivalences_from_stmt): Likewise. + (dom_opt_initialize_block_local_data): No longer test state of + block local avail_exprs. + (dom_opt_initialize_block): Mark unwind point in the global + avail_expr stack. + (remove_expressions_from_table): Update to unwind to the + most recent unwind marker in the global avail_expr stack. + All callers changed. + (dom_opt_finalize_block): Mark unwind point in the global + avail_expr stack as needed. + (record_cond): Push elements into the global avail_exprs stack. + + * tree-dfa.c (free_df_for_stmt): No longer static. + (free_df): Update comments. + * tree-flow.h (free_df_for_stmt): Prototype. + * tree-ssa-dse.c (dse_optimize_stmt): Call free_df_for_stmt. Also + call release_defs. + +2004-09-14 Diego Novillo + + PR tree-optimization/17252 + * tree-ssa-alias.c (may_alias_p): Don't assume that a + pointer may not point to itself when using relaxed + aliasing rules. + +2004-09-14 Richard Henderson + + PR middle-end/17397 + * gimplify.c (gimplify_addr_expr): Don't inadvertently change types + while folding >. + +2004-09-14 Andrew Pinski + + * tree-ssa-copy.c (may_propagate_copy): Don't check the aliasing + sets of the pointers but the aliasing sets of what they point to. + +2004-09-14 Roger Sayle + + PR rtl-optimization/9771 + * regclass.c (CALL_REALLY_USED_REGNO_P): New macro to eliminate + conditional compilation in init_reg_sets_1. + (init_reg_sets_1): Let global_regs[i] take priority over the frame + (but not stack) pointer exceptions to regs_invalidated_by_call. + (globalize_reg): Globalizing a fixed register may need to update + regs_invalidated_by_call. + +2004-09-14 Diego Novillo + + PR tree-optimization/15262 + * tree-dfa.c (dump_variable): Also print the type of the + variable. + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): If two + memory tags are of conflicting alias sets but have no aliased + symbols in common, add one tag to the alias set of the other. + (setup_pointers_and_addressables): Remove hack to deal with + programs with no aliased symbols. + (may_alias_p): Don't special case aggregate types. + +2004-09-14 Joseph S. Myers + + PR c/15498 + * doc/invoke.texi (Environment Variables): Correct example locale. + +2004-09-14 Jan Hubicka + + * cfg.c (expunge_block): Revert previous change adding ggc_free call. + +2004-09-14 Mark Mitchell + + * config.gcc: Do not build a shared libgcc for arm-none-eabi. + +2004-09-14 Joseph S. Myers + + * c-tree.h (struct c_declspecs): Add const_p, volatile_p and + restrict_p. + (struct c_declarator): Change u.array.quals and pointer_quals to + int. Add u.array.attrs. + (quals_from_declspecs): New. + * c-decl.c (quals_from_declspecs): New. + (shadow_tag_warned): Give more specific message for useless type + qualifiers. + (build_array_declarator, set_array_declarator_inner, + grokdeclarator, make_pointer_declarator, build_null_declspecs, + declspecs_add_qual): Update for changed structures. + +2004-09-14 Jeff Law + + * tree-ssa-dom.c (stmts_to_rescan): Move from a block-local + to a global varray. + (tree_ssa_dominator_optimize): Allocate stmts_to_rescan. + (dom_opt_initialize_block_local_data): No longer test state + of stmts_to_rescan. + (dom_opt_finalize_block): Update due to change in scope of + stmts_to_rescan. + (optimize_stmt): Similarly. + +2004-09-14 Kazu Hirata + + * cgraph.h, cgraphunit.c, fold-const.c, lambda-mat.c, + lambda.h, profile.c, tree-optimize.c, tree-sra.c, vec.h: Fix + comment typos. Follow spelling conventions. + +2004-09-14 Kazu Hirata + + * config/darwin-c.c, config/alpha/alpha.c, config/i386/i386.c, + config/i386/predicates.md, config/sparc/sparc.c: Follow + spelling conventions. + +2004-09-14 Zdenek Dvorak + Steven Bosscher + + * Makefile.in (loop-unroll.o): Add HASHTAB_H and RECOG_H dependency. + * basic-block.h (struct reorder_block_def): Add copy_number field. + * cfgloop.h (biv_p): Declare. + * cfgloopmanip.c (duplicate_loop_to_header_edge): Set copy_number. + * common.opt (fsplit-ivs-in-unroller): New flag. + * loop-iv.c (biv_p): New function. + * loop-unroll.c: Include hashtab.h and recog.h. + (struct iv_to_split, struct split_ivs_info): New types. + (analyze_ivs_to_split, si_info_start_duplication, split_ivs_in_copies, + free_si_info, si_info_hash, si_info_eq, analyze_iv_to_split_insn, + determine_split_iv_delta, get_ivts_expr, allocate_basic_variable, + insert_base_initialization, split_iv): New functions. + (peel_loop_completely, unroll_loop_constant_iterations, + unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid): + Use them. + * doc/invoke.texi (-fsplit-ivs-in-unroller): Document. + +2004-09-14 Zdenek Dvorak + + * tree-cfg.c (thread_jumps): Update dominators correctly in + case destination of threaded edge dominates its source. + +2004-09-14 Zdenek Dvorak + + * unroll.c: Removed. + * loop.h: Removed. + * Makefile.in (LOOP_H, unroll.o): Removed. + (toplev.o, passes.o, stmt.o, integrate.o, loop.o): Remove LOOP_H + dependency. + * alias.c (init_alias_analysis): Remove flag_old_unroll_loops + reference. + * cfgloop.h (LOOP_PREFETCH, loop_optimize): Moved from loop.h. + * common.opt (fold-unroll-loops, fold-unroll-all-loops): Removed. + * loop.c: Do not include loop.h. + (LOOP_INFO, LOOP_MOVABLES, LOOP_REGS, LOOP_IVS, INSN_LUID, + REGNO_FIRST_LUID, REGNO_LAST_LUID, enum g_types, struct induction, + struct iv_class, enum iv_mode, struct iv, REG_IV_TYPE, REG_IV_INFO, + REG_IV_CLASS, struct loop_ivs, struct loop_mem_info, struct loop_reg, + struct loop_regs, struct loop_movables, struct loop_info): Moved + from loop.h. + (back_branch_in_range_p, fold_rtx_mult_add, biv_total_increment, + reg_dead_after_loop, final_biv_value, loop_find_equiv_value, + find_common_reg_term, loop_iterations, final_giv_value): Moved + from unroll.c. + (uid_luid, uid_loop, max_uid_for_loop, max_reg_before_loop, + loop_dump_stream, for_each_insn_in_loop, express_from, + extend_value_for_giv, loop_iv_add_mult_emit_before, + loop_iv_add_mult_sink, loop_iv_add_mult_hoist, + loop_insn_first_p, get_condition_for_loop, + loop_insn_emit_before, loop_insn_hoist, + loop_insn_sink): Made static. + (loop_invariant_p): Made static. Removed flag_old_unroll_loops + reference. + (strength_reduce): Do not call unroller. + (record_giv): Do not initialize unrolled field. + (prescan_loop): Do not set loop_info->preconditioned. + * passes.c: Do not include loop.h. + (rest_of_handle_loop_optimize): Do not call unroller. + * predict.c: Do not include loop.h. + * rtl.h (NOTE_PRECONDITIONED): Removed. + * stmt.c: Do not include loop.h. + * toplev.c: Do not include loop.h. + (process_options): Do not handle flag_old_unroll_loops. + + * doc/invoke.texi (fold-unroll-loops, fold-unroll-all-loops): + Documentation removed. + * doc/passes.texi (unroll.c, loop.h): Documentation removed. + +2004-09-14 Nathan Sidwell + + * Makefile.in (STAGE1_CHECKING): New variable. + (stage1_build): Use it. + * tree-ssa.c (verify_ssa): Preserve state of dominance + information. + +2004-09-14 Uros Bizjak + + * config/i386/i386.c (output_fp_compare): Add generation + of ftst instruction. + * config/i386/i386.md (*cmpfp_0_sf, cmpfp_0_df, cmpfp_0_xf): + Use output_fp_compare () function. + (cmpfp_i, *cmpfp_i_sse, *cmpfp_i_sse_only): Fix insn constraint. + (fix_truncdi_memory): Remove operands[5] copy. + +2004-09-14 Kazu Hirata + + * config/m32r/m32r.md, config/m68k/m68kelf.h, + config/mcore/mcore.md, config/rs6000/linux64.h, + config/rs6000/rs6000.c, config/sparc/sparc.c: Fix comment + typos. + +2004-09-13 James E Wilson + + * Makefile.in (GEN_PROTOS_OBJS): Add $(BUILD_ERRORS). + * gen-protos.c: Include errors.h. + (progname): Delete. + +2004-09-14 Jan Hubicka + + * Makefile.in (predict.o): Depend on tree-scalar-evolution.h + * predict.c: Include tree-scalar-evolution.h and cfgloop.h + (predict_loops): Use number_of_iterations_exit to predict + number of iterations on trees. + +2004-09-13 Dale Johannesen + + PR 17408 + PR 17409 + * c-decl.c (start_decl): Repair TREE_STATIC for initialized + objects declared extern. + +2004-09-14 Paul Brook + + * config/arm/arm.c (arm_expand_prologue): Make args_to_push a + HOST_WIDE_INT. + +2004-09-13 Daniel Jacobowitz + + * fold-const.c (fold_checksum_tree): Ignore TYPE_CACHED_VALUES. + Only use TYPE_BINFO for aggregates. + +2004-09-13 Daniel Jacobowitz + + * expmed.c (synth_mult): Initialize latency. Check cost before + checking ops count. + +2004-09-13 Kenneth Zadeck + + * tree-ssa-operands.c (get_call_expr_operands): Added parm to + add_call_clobber_ops and add_call_read_ops. + (add_call_clobber_ops, add_call_read_ops): Added code to reduce + the number of vdefs and vuses inserted based on analysis of global + variables across calls. + * tree-dfa.c (find_referenced_vars): Needed to reset static + var maps before each function is compiled. + * cgraphunit.c: + (static_vars_to_consider_by_tree,static_vars_to_consider_by_uid, + static_vars_info,functions_to_static_vars_info,module_statics_escape, + all_module_statics,searchc_env,dfs_info): New fields to support + analysis of static global variables. + (print_order, convert_UIDs_in_bitmap, new_static_vars_info, + cgraph_reset_static_var_maps, get_global_static_vars_info, + get_global_statics_not_read, get_global_statics_not_written, + searchc, cgraph_reduced_inorder, has_proper_scope_for_analysis, + check_rhs_var, check_lhs_var, get_asm_expr_operands, + process_call_for_static_vars, scan_for_static_refs, + cgraph_characterize_statics_local, cgraph_get_static_name_by_uid, + clear_static_vars_maps, cgraph_propagate_bits, + cgraph_characterize_statics): New. Functions to support analysis + of static global variables. + (cgraph_mark_local_and_external_functions): Renamed from: + (cgraph_mark_local_functions) + (cgraph_expand_all_functions): Remove call to + cgraph_mark_local_and_external_functions. + (cgraph_optimize): Added driver to analyze static variables whose + scope is within the compilation unit. + * cgraph.h (struct cgraph_local_info, GTY): Added + statics_read, statics_written, local, calls_read_all, + calls_write_all, for_functions_valid. (struct cgraph_node): + Added next_cycle. + * cgraph.c (dump_cgraph_node): Added print routines for new fields. + * makefile.in: macroized cgraph.h, added cgraphunit.c to the ggc + list. + +2004-09-13 Joseph S. Myers + + * c-decl.c (grokdeclarator): Correct comments about where storage + class specifiers are rejected by grammar and add corresponding + asserts. Diagnose typedefs and parameters declared inline. + Change warning for inline main to a pedwarn. Only diagnose inline + main if hosted. + (declspecs_add_scspec): Allow duplicate "inline". + +2004-09-13 Steve Ellcey + + * config/ia64/ia64.c (ia64_scalar_mode_supported_p): New. + (TARGET_SCALAR_MODE_SUPPORTED_P): New. + +2004-09-13 Richard Henderson + + PR 17436 + * tree.h (TYPE_CONTAINS_PLACEHOLDER_INTERNAL): New. + (tree_type): Replace spare with contains_placeholder_bits. + (type_contains_placeholder_1): Rename from type_contains_placeholder_p, + make static. Remove seen_types list. + (type_contains_placeholder_p): New. + +2004-09-13 James E Wilson + + * config/mips/mips.c (CODE_FOR_mips_sqrt_ps): New. + (sb1_bdesc, bdesc_map, bdesc_arrays): New. + (mips_expand_builtin): Add SB-1 support. Use bdesc_map and + bdesc_arrays instead of mips_bdesc. + (mips_init_builtins): Likewise. + * config/mips/mips.h (TARGET_SB1): New. + (HAVE_SQRT_P): Delete. + * config/mips/mips.md (divide_condition): Support V2SF. + (sqrt_condition, recip_condition): New. + (div3): Use ANYF instead of SCALARF. + (*div3): Use ANYF instead of SCALARF. Use UNITMODE instead of + MODE. + (*recip3, *rsqrta, *rsqrtb): Use recip_condition + instead of ISA_HAS_FP4. Use ANYF instead of SCALARF. Use UNITMODE + instead of MODE. + (sqrt2): Use sqrt_condition instead of HAVE_SQRT_P. Use ANYF + instead of SCALARF. Use UNITMODE instead of MODE. + +2004-09-13 Zack Weinberg + + * config.in: Regenerate after removal of libbanshee. + +2004-09-13 Andrew MacLeod + + PR tree-optimization/17400 + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't + coalesce partitions when one occurs in an abnormal PHI. + +2004-09-13 Andrew Pinski + + * config/rs6000/darwin.h (ASM_OUTPUT_COMMON): Change variable size's + name to _new_size. + +2004-09-13 Richard Henderson + + PR inline-asm/6806 + * cselib.c (cselib_invalidate_rtx): Export. Remove unused args. + (cselib_invalidate_rtx_note_stores): New. + (cselib_record_sets, cselib_process_insn): Update to match. + * cselib.h (cselib_invalidate_rtx): Declare. + * postreload.c (reload_cse_simplify): Invalidate asm clobbers. + +2004-09-13 Richard Henderson + + PR tree-opt/10528 + * tree-inline.c (copy_body_r): Recompute bits for ADDR_EXPR, + after copying its argument. + +2004-09-13 Joseph S. Myers + + * c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c, + c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting + in diagnostics. Use %' for English apostrophes. + * c-tree.h (ATTRIBUTE_GCC_CDIAG): Define. + (pedwarn_c90, pedwarn_c99): Use it. + * c-decl.c (lookup_label): Quote label name in diagnostic. + * c-parse.in (yyprint): Use ' instead of ` for left quote. + * c-typeck.c (warn_for_assignment): Likewise. + +2004-09-13 Jan Hubicka + + * i386.c (x86_schedule): New global variable. + (override_options): Disable scheduling when not supported. + * i386.h (x86_schedule): Declare. + (TARGET_SCHEDULE): New macro. + +2004-09-12 Richard Henderson + + PR c++/16254 + * fold-const.c (fold) : Remove. + * tree.c, tree.h (has_cleanups): Remove. + +2004-09-12 Zdenek Dvorak + + * tree-ssa-loop-manip.c (split_loop_exit_edge): Handle non-ssaname + arguments of the phi nodes correctly. + +2004-09-12 Jan Hubicka + + * ggc-common.c (cmp_statistics): Fix sorting. + +2004-09-12 David Edelsohn + + PR target/16795 + * expmed.c (expand_divmod): If cheap power of 2 divide is + available, use it for negative constant as well. + +2004-09-12 Andrew Pinski + + * darwin.h (ASM_OUTPUT_COMMON): Make sure we do not have a + size of 0. + + * tree-chrec.c (initialize_scalar_evolutions_analyzer): Remove. + +2004-09-12 Richard Henderson + + * config/i386/i386.c (ix86_split_ashldi): Special case op1 as one + or minus one. + (ix86_split_ashrdi, ix86_split_lshrdi): Clean up conditions for + post-reload, and scratch NULL. + * config/i386/i386.md (testqi_1): Use FLAGS_REG name. + (x86_shift_adj_2): Use ix86_expand_clear. + (ashldi3): Remove CMOVE expansion difference. + (ashldi3_1): Remove. + (*ashldi3_1): Rename from *ashldi3_2. Use reg_or_pm1_operand and + add constraints for immediates. New peephole for split-with-temp. + Run splitter after peep2 pass. + (ashrdi3, ashrdi3_1, ashrdi3_2): Similarly. + (lshrdi3, lshrdi3_1, lshrdi3_2): Similarly. + (setcc_2): Rename with *. + * config/i386/predicates.md (reg_or_pm1_operand): New. + (ashldi_input_operand): New. + +2004-09-12 Richard Henderson + + * common.opt: Remove flags -fmove-all-movables and + -freduce-all-givs. + * loop-invariant.c (find_invariants_to_move): + Remove all uses of flag_move_all_movables. + * loop.c (move_movables): Remove all uses of + flag_move_all_movables. + (strength_reduce): Remove all uses of + flag_reduce_all_givs. + * doc/invoke.texi: Remove documentation of flags + -fremove-all-movables and -freduce-all-givs. + +2004-09-11 Roger Sayle + + PR middle-end/17411 + * tree-sra.c (generate_element_zero): Revert recent build_int_cst + change. elt->type may be a floating point type, so use fold_convert. + +2004-09-11 Geoffrey Keating + + * config/darwin.c (machopic_validate_stub_or_non_lazy_ptr): Mark + the thing referenced as used, not the stub itself. + +2004-09-11 Joseph S. Myers + + * c-tree.h (enum c_storage_class): New. + (struct c_declspecs): Add storage_class, inline_p and thread_p. + * c-decl.c (shadow_tag_warned): Give errors for "inline" in empty + declarations and "auto" or "register" in file scope empty + declarations. Give more specific warnings for other cases of + storage class specifiers in empty declarations. + (grokdeclarator): Update for new structures. Don't check for + multiple storage classes. Diagnose file-scope "register" if + pedantic. + (build_null_declspecs): Update. + (declspecs_add_scspec): Update. Diagnose multiple storage class + specifiers and invalid uses of "__thread". + +2004-09-11 Zack Weinberg + + * tree.c (tree_code_size): New function, bulk of code from tree_size. + (tree_size, make_node): Use it. + * tree-ssa-pre.c (init_pre): Use it. + * tree.h: Prototype it. + +2004-09-11 Zdenek Dvorak + + * tree-cfg.c (set_bb_for_stmt): Use PHI_BB. + * tree-dfa.c (compute_immediate_uses, add_immediate_use, + redirect_immediate_use): Use PHI_DF. + * tree-flow-inline.h (stmt_ann): Abort on phi nodes. + (bb_for_stmt): Use PHI_BB. + (get_immediate_uses): Use PHI_DF. + * tree-ssa-dse.c (max_stmt_uid): New variable. + (get_stmt_uid): New function. + (dse_optimize_stmt, dse_record_phis, tree_ssa_dse): Do not use phi + node annotations. + * tree-ssa-loop-im.c (LIM_DATA): Do not use phi statement annotations. + (max_uid): Renamed to max_stmt_uid. + (get_stmt_uid): New function. + (maybe_queue_var, single_reachable_address, determine_lsm): Do not use + phi node annotations. + * tree-ssa.c (replace_immediate_uses): Do not use phi node annotations. + * tree.h (PHI_BB, PHI_DF): New accessor functions. + (struct tree_phi_node): Add bb and df fields. + +2004-09-11 Richard Henderson + + PR middle-end/17416 + * cfgexpand.c (expand_used_vars_for_block): Fix off-by-one bug + in conflict loop. + +2004-09-11 Jan Hubicka + + * i386.h (MODE_NEEDED): Calls need UNINITIALIZED mode; add comment. + (EMIT_MODE_SET): UNINITIALIZED mode needs no set. + * i386.md (i387_cw): Add 'uninitialized' mode. + + * profile.c (BB_TO_GCOV_INDEX): move more to the front. + (output_location): Break out from .... + (branch_prob): ... here; handle gcov output on trees. + * toplev.c (process_options): No longer be sorry about coverage for + trees. + +2004-09-11 Steven Bosscher + + PR c++/17412 + * fold-const.c (fold): Do not try to fold the operand of a + CLEANUP_POINT_EXPR if that operand does itself not have any + operands. + + PR middle-end/17417 + * langhooks.c (lhd_decl_printable_name): Make sure that this + function is called with is a decl node that has an identifier. + * tree-pretty-print.c (dump_function_name): New function to + wrap PRINT_FUNCTION_NAME and dump_decl_name. + (print_call_name): Use it. + +2004-09-11 Mohan Embar + + * ggc-none.c: Include "bconfig.h" if -DGENERATOR_FILE, + "config.h" if not. + +2004-09-11 Jakub Jelinek + + * tree-ssa-alias.c (collect_points_to_info_r): Handle + pointing to PTR + OFFSET as PTR, not as pointing to PTR or pointing + to OFFSET. + +2004-09-11 Richard Henderson + + * expr.c (expand_expr_addr_expr_1) Rename from expand_expr_addr_expr. + (expand_expr_addr_expr): New function. Take ADDR_EXPR instead of the + operand of the ADDR_EXPR. + (expand_expr_real_1): Update to match. + +2004-09-11 David Edelsohn + + PR target/17277 + * config/rs6000/aix.h (MD_FROB_UPDATE_CONTEXT): Use __64BIT__ to + choose 64-bit version. + +2004-09-11 Richard Henderson + + PR c/17396 + * c-typeck.c (build_unary_op): Add legacy offsetof hack. + +2004-09-11 Kazu Hirata + + * doc/cfg.texi, doc/hostconfig.texi, doc/install.texi, + doc/invoke.texi, doc/md.texi, doc/tm.texi, doc/tree-ssa.texi: + Insert @: after i.e. or e.g. + +2004-09-10 Geoffrey Keating + + * tree-pretty-print.c (dump_decl_name): Print unnamed decls as + D.xxx rather than . + +2004-09-10 Adam Nemet + + * configure.ac (AC_MSG_CHECKING(what linker to use)): + in_tree_ld_is_elf should be true for LynxOS. + * configure: Regenerate. + +2004-09-10 Adam Nemet + + * Makefile.in (all.cross): Add srcextra. + +2004-09-10 Roger Sayle + + PR middle-end/17024 + * fold-const.c (fold_cond_expr_with_comparison): Handle unordered + floating point comparison operators. Change aborts to gcc_asserts. + +2004-09-10 Geoffrey Keating + + * final.c (output_asm_insn): Correct problem with -fverbose-asm. + +2004-09-10 James E Wilson + + * Makefile.in (LIBGCC_DEPS): Delete duplicate stmp-int-hdrs reference. + (stmp-fixproto): Change stmp-int-headers to stmp-int-hdrs in comment. + + * convert.c (convert_to_vector): Replace recursive call with + error_mark_node. + + * emit-rtl.c (gen_const_vector): Renamed from gen_const_vector_0. + Add integer argument named constant. Use const_tiny_rtx instead of + CONST0_RTX. + (gen_rtx_CONST_VECTOR): Rewrite to handle checks for both CONST0_RTX + and CONST1_RTX. + (init_emit_once): Fix users of gen_const_vector. Set CONST1_RTX for + vector types. + * expr.c (const_vector_from_tree): Call gen_rtx_CONST_VECTOR instead + of gen_rtx_raw_CONST_VECTOR. + +2004-09-10 Eric Christopher + + PR c/16046 + * c-parse.in (attribute): Add NULL_TREE for error case + for error recovery. + +2004-09-10 Zack Weinberg + + * c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h. + (extract_interface_info): Delete prototype. + * c-decl.c (extract_interface_info): Delete stub. + * c-lex.c (get_fileinfo): Initialize file_info_tree here, if + it's not already been done ... + (init_c_lex): ... not here. + (fe_file_change): Don't call extract_interface_info. + +2004-09-11 Joseph S. Myers + + * c-tree.h (struct c_declspecs): Remove typedef_decl. Add + typedef_p and typedef_signed_p. + * c-decl.c (shadow_tag_warned): Check typedef_p, not typedef_decl. + (grokdeclarator): Don't use typedef_decl for warn_deprecated_use. + Check typedef_p and typedef_signed_p, not typedef_decl. + (grokfield): Check typedef_p, not typedef_decl. + (build_null_declspecs): Initialize typedef_p and typedef_signed_p, + not typedef_decl. + (declspecs_add_type): Set typedef_p and typedef_signed_p, not + typedef_decl. + +2004-09-10 Kazu Hirata + + * doc/tm.texi, doc/tree-ssa.texi: Fix typos. + +2004-09-10 Geoffrey Keating + + * gimplify.c (create_tmp_var_raw): Don't name otherwise-nameless + temporary variables. + + * dbxout.c (dbxout_block): Update for + current_function_func_begin_label a string. + * dwarf2out.c (dwarf2out_begin_prologue): Likewise. + * except.c (dw2_output_call_site_table): Likewise. + * toplev.c (current_function_func_begin_label): Likewise. + * tree.h (current_function_func_begin_label): Likewise. + * config/rs6000/linux64.h (DBX_OUTPUT_BRAC): Likewise. + + * final.c (output_asm_insn): Use strtoul instead of atoi, save a + loop. + + * config/darwin.c: Include target.h. + (struct machopic_indirection): Make ptr_name a string. + (machopic_indirection_hash): Update for ptr_name a string. + (machopic_indirection_eq): Likewise. + (machopic_indirection_name): Likewise. + (machopic_output_indirection): Likewise. + (machopic_validate_stub_or_non_lazy_ptr): Update for ptr_name a + string. Don't expect stub names to be in the identifier hash table. + Do call strip_name_encoding before looking up entry in ID hash table. + * config/t-darwin (darwin.o): Add target.h to dependencies. + + * config/rs6000/rs6000.c (print_operand): Use fputs instead + of fprintf for register names. + + * output.h (unlikely_section_label): Delete declaration. + (unlikely_text_section_name): Likewise. + * varasm.c (unlikely_section_label_printed): Make static. + (unlikely_section_label): Likewise. + (unlikely_text_section_name): Likewise. + (assemble_start_function): Use reconcat. + + * rtl.def (REG): Add comment to describe third field. + +2004-09-10 Andrew Pinski + + * config/darwin.c (machopic_mcount_stub_name): Call + machopic_indirection_name instead of making the string + ourselves. + +2004-09-10 Diego Novillo + + Revert + + 2004-09-08 Jie Zhang + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): If type + memory tag is call clobbered, so are its aliases. + (group_aliases): When two memory tags being grouped, if one is + call clobbered, so are the other and its aliases. + (add_may_alias): Remove call-clobbering stuff. + (replace_may_alias): Likewise. + (merge_pointed_to_info): Merge pt_global_mem + +2004-09-10 Kazu Hirata + + * bb-reorder.c, c-common.c, c-incpath.c, c-typeck.c, + genrecog.c, lambda-code.c, mips-tdump.c, mips-tfile.c, + passes.c, tree-data-ref.c, tree-data-ref.h, tree-mudflap.c, + tree-scalar-evolution.c, tree-ssa-copyrename.c, + tree-ssa-live.c, tree-ssa-live.h: Fix comment typos. + +2004-09-10 Richard Sandiford + + * config/frv/frv.md (UNSPEC_MASACCS, UNSPEC_MDASACCS): New constants. + (maddaccs, msubaccs, *maddacc): Turn operand 0 into a single ACC/ACCG + pair. Remove match_dup from inputs. Remove masaccs handling. + (mdaddaccs, mdsubaccs, *mdaddacc): Likewise a dual ACC/ACCG pair. + (masaccs, mdasaccs): Turn into define_insns. + +2004-09-10 Richard Sandiford + + * tree-tailcall.c (process_assignment): Only do accumulator transforms + for floating-point types if flag_unsafe_math_optimizations. + +2004-09-10 Kazu Hirata + + * config/darwin.c, config/alpha/alpha.h, config/arm/arm.c, + config/arm/arm.h, config/arm/arm.md, config/arm/bpabi.h, + config/arm/predicates.md, config/frv/frv.c, config/frv/frv.md, + config/h8300/h8300.md, config/i386/gmm_malloc.h, + config/ia64/ia64.md, config/ip2k/libgcc.S, + config/mips/mips-ps-3d.md, config/mips/mips.c, + config/rs6000/rs6000.c, config/s390/s390.c, + config/sh/symbian.c: Fix comment typos. + +2004-09-10 Andreas Krebbel + + * config/s390/s390.c (s390_emit_prologue): Added missing + "{}" brackets. + +2004-09-10 Kazu Hirata + + * doc/extend.texi, doc/invoke.texi, doc/passes.texi: Fix + typos. Follow spelling conventions. + +2004-09-10 Joseph S. Myers + + * toplev.c (warn_deprecated_use): Correct logic for saying "type" + in diagnostic. Don't dereference NULL TYPE_NAME. + +2004-09-10 Kazu Hirata + + * c-common.c, c-pch.c, defaults.h, lambda-code.c, passes.c, + tree-data-ref.c, tree-flow.h, tree-ssa-operands.c, + tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, + value-prof.c: Fix comment typos. Follow spelling conventions. + +2004-09-10 Jan Hubicka + + * tree-ssa-dce.c (remove_dead_stmt): Update profile. + * tree-split_edge.c (tree_split_edge): Likewise. + (thread_jumps): Likewise. + +2004-09-10 Kazu Hirata + + * cgraphunit.c, predict.c, tree-ssa-loop-ivopts.c: Fix comment + typos. + +2004-09-10 Paolo Bonzini + + * cgraph.h (cgraph_dump_file): Do not declare. + * cgraphunit.c (cgraph_dump_file): Declare as static. + (init_cgraph): New. + * toplev.c (cgraph_dump_file): Do not declare. + (compile_file): Call init_cgraph. + * tree-dump.c (dump_files): Add IPA dump file, remove + XML dump of call graph. + (get_dump_file_name): Support IPA dump file naming scheme. + * tree.h (enum tree_dump_index): Add IPA dump file, remove + XML dump of call graph. + * doc/invoke.texi (Debugging Options): Document the new options. + +2004-09-10 Richard Sandiford + + * doc/extend.texi: Document the FR-V built-in functions. + +2004-09-09 James E Wilson + + * doc/sourcebuild.texi: Delete libbanshee reference. + +2004-09-10 Kelley Cook + + * Makefile.in (s-gtype): Add $(build_exeext) to gengtype command. + +2004-09-09 James E Wilson + + * c-typeck.c (convert_for_assignment): Check that rhs has VECTOR_TYPE + before calling vector_types_convertible_p. + (digest_init): Check that inside_init has VECTOR_TYPE before calling + vector_types_convertible_p. Don't give another error if + convert_for_assignment returns error_mark_node. + +2004-09-09 Roger Sayle + + PR middle-end/17055 + * fold-const.c (build_zero_vector): New function to construct a + vector (either floating point or integer) of zeros. + (fold_convert): Internally, enable conversions of integer zero + to arbitrary vector types, using the new build_zero_vector. + +2004-09-09 Roger Sayle + + * config/i386/i386.c (ix86_expand_ashlsi3_const): New function to + expand a left shift by an immediate constant as either an ashl or + a sequence of additions. + (ix86_split_ashldi): Use new ix86_expand_ashlsi3_const function + instead of calling gen_ashlsi3 with a constant directly. + +2004-09-09 Roger Sayle + + * config/i386/i386.c (ix86_split_long_move): When optimizing for + size, and the low and high parts of a DImode constant are equal, + copy one register to another instead of loading the same immediate + value twice. + +2004-09-09 Richard Henderson + + PR middle-end/17367 + * function.c (assign_parm_setup_block): Only put PARALLELs into + a register if use_register_for_decl. + +2004-09-09 Eric Christopher + + * ra-colorize.c (reset_lists): Move variable declaration inside + ENABLE_CHECKING to avoid unused variable warnings when + not --enable-checking. + (check_colors): Ditto. + +2004-09-09 Mike Stump + + * version.c (version_string): Bump to 4.0.0. + * doc/include/gcc-common.texi (version-GCC): Likewise. + +2004-09-10 Jakub Jelinek + + * doc/extend.texi (nothrow attribute): The attribute is not + implemented in 3.2 and earlier. + +2004-09-09 Steve Ellcey + + * genrecog.c (compute_predicate_codes): Use op0_codes + instead of codes. + +2004-09-09 Ulrich Weigand + + * ra-colorize.c (hardregset_to_string): Adapt to HARD_REG_SET + implementation changes. + +2004-09-09 Ulrich Weigand + + * combine.c (try_combine): When swapping i2 and i3, newi2pat may be + a PARALLEL instead of a SET due to added clobbers. + +2004-09-09 Ulrich Weigand + + * reload.c (find_reloads_address): Pass correct operand to + maybe_memory_address_p. + +2004-09-09 Daniel Berlin + + * Makefile.in: Remove libbanshee, tree-alias-*. + Remove tree-alias-common.h dependencies. + * common.opt: Remove -ftree-points-to. + * configure.ac: Remove libbanshee. + * flags.h: Remove pta_type, flag_tree_points_to. + * gengtype.c (open_base_files): Remove tree-alias-type.h. + * opts.c (OPT_ftree_points_to): Remove. + * toplev.c: Remove tree-alias-common.h, flag_tree_points_to. + * tree-dfa.c: Remove tree-alias-common.h + * tree-into-ssa.c: Ditto. + * tree-outof-ssa.c: Ditto. + * tree-ssa-copyrename.c: Ditto. + * tree-ssa-live.c: Ditto. + * tree-optimize.c: Ditto. + * tree-ssa.c: Ditto. + Remove pass_build_pta, pass_del_pta. + * tree-pass.h: Ditto. + * tree-ssa-alias.c: Remove tree-alias-common.h. + (struct alias_stats_d): Remove pta_queries, pta_resolved. + (pass_may_alias): Remove PROP_pta requirement. + (may_alias_p): Remove pta_queries, pta_resolved, use of andersens. + (get_tmt_for): Ditto. + (dump_alias_stats): Ditto. + * doc/passes.texi: Remove blurb about points-to analysis. + * fortran/Make-lang.in: Remove tree-alias-*.o. + +2004-09-09 Richard Sandiford + + * genattrtab.c (write_insn_cases): New function, split out from + write_attr_case. Correctly handle define_peepholes when printing + the instruction name. + (write_attr_case, write_const_num_delay_slots): Use write_insn_cases. + +2004-09-09 Hans-Peter Nilsson + + PR target/17377 + * config/cris/cris-protos.h (cris_return_address_on_stack): Declare. + * config/cris/cris.c (cris_return_address_on_stack): New function. + * config/cris/cris.md ("return"): For location of return address, + also check cris_return_address_on_stack. + +2004-09-09 Diego Novillo + + * tree-outof-ssa.c (coalesce_abnormal_edges): Fix typo in + calling phi_ssa_name_p. + +2004-09-09 Richard Henderson + + PR c/17322 + * c-typeck.c (valid_compound_expr_initializer): Use only + initializer_constant_valid_p, and not TREE_CONSTANT. + (digest_init): Likewise. + (output_init_element): Likewise. + +2004-09-09 Giovanni Bajo + + * ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1, + live_out_1, prune_hardregs_for_mode, init_one_web_common, + reinit_one_web, add_subweb, add_subweb_2, init_web_parts, + record_conflict, compare_and_free_webs, init_webs_defs_uses, + parts_to_webs_1, parts_to_webs, reset_conflicts, + check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, + ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. + * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, + put_move, remove_move, combine, select_spill, colorize_one_web, + try_recolor_web, insert_coalesced_conflicts, check_colors, + break_precolored_alias, restore_conflicts_from_coalesce, + sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. + * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, + reloads_to_loads, rewrite_program2, emit_colors): Likewise. + * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, + check_df): Likewise. + * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, + real_arithmetic, real_compare, real_exponent, real_ldexp, + real_identical, real_to_integer, real_to_integer2, real_to_decimal, + real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, + real_digit, real_nan, real_maxval, round_for_format, real_convert, + real_to_target, real_from_target, real_hash, encode_ieee_single, + encode_ieee_double, encode_ieee_extended, encode_ieee_quad, + encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, + encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. + * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, + extract_insn, peep2_next_insn, peep2_reg_dead_p, + peep2_find_free_register, peephole2_optimize, store_data_bypass_p, + if_test_bypass_p): Likewise. + * reg-stack.c (record_label_references, get_asm_operand_n_inputs, + stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, + emit_swap_insn, swap_to_top, move_for_stack_reg, + subst_stack_regs_pat, subst_asm_stack_regs, change_stack, + compensate_edge, convert_regs_1): Likewise. + * regclass.c (init_reg_sets, init_reg_sets_1, + memory_move_secondary_cost): Likewise. + * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): + Likewise. + * reload.c (push_secondary_reload, find_valid_class, push_reload, + operands_match_p, decompose, immune_p, find_reloads, + find_reloads_toplev, find_reloads_address_1, subst_reloads, + copy_replacements, refers_to_regno_for_reload_p, + reg_overlap_mentioned_for_reload_p): Likewise. + * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, + count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, + verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, + reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, + choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, + do_output_reload, fixup_abnormal_edges): Likewise. + * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, + fill_slots_from_thread, relax_delay_slots): Likewise. + * resource.c (mark_referenced_resources, mark_set_resources): + Likewise. + * rtl.c (copy_rtx, rtx_equal_p): Likewise. + * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, + dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, + subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, + find_first_parameter_load, can_hoist_insn_p, hoist_update_store, + hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. + * rtlhooks.c (gen_lowpart_general): Likewise. + * sbitmap.c (sbitmap_difference): Likewise. + * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, + sched_analyze, add_forward_dependence): Likewise. + * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. + * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, + schedule_insns): Likewise. + * sched-vis.c (print_pattern): Likewise. + * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. + * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, + simplify_const_relational_operation, simplify_ternary_operation, + simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): + Likewise. + * sreal.c (copy, sreal_sub, sreal_div): Likewise. + * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, + resolve_operand_name_1, expand_return, expand_decl, + expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. + * stor-layout.c (put_pending_size, smallest_mode_for_size, + int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, + set_sizetype, get_mode_bounds): Likewise. + +2004-09-09 Zack Weinberg + + * defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default. + * config/arm/pecoff.h, config/i386/beos-elf.h + * config/i386/cygming.h, config/i386/i386-interix.h: + Define MULTIPLE_SYMBOL_SPACES to 1, not nothing. Remove + comment cloned from manual. + * doc/tm.texi: Update description of MULTIPLE_SYMBOL_SPACES. + +2004-09-09 Frank Ch. Eigler + + * builtins.c (build_va_arg_indirect_ref): New function. + (std_gimplify_va_arg_expr): Call it instead of mudflap check and + build_fold_indirect_ref. + * config/i386/i386.c (ix86_gimplify_va_arg): Ditto. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Ditto. + * tree.h: Declare new function. + +2004-09-09 Nathan Sidwell + + * cgraphunit.c (cgraph_mark_functions_to_output): Renable node + dumping for development builds. + * emit-rtl.c (verify_rtx_sharing): Give verbose failure for + development builds only. + * genattrtab.c (write_eligible_delay): Fix typo in previous + commit. + * tree.c (iterative_hash_expr): Replace gcc_unreachable with + gcc_assert. + +2004-09-09 Nathan Sidwell + + * gcse.c (INSN_CUID, insert_set_in_table, find_avail_set, + cprop_insn, do_local_cprop, local_cprop_pass, find_bypass_set, + process_insert_insn, insert_insn_end_bb, pre_insert_copy_insn, + hoist_code, extract_mentioned_regs_helper, compute_store_table, + insert_store): Use gcc_assert and gcc_unreachable. + * ggc-common.c (ggc_splay_alloc, ggc_splay_dont_free, + gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, + ggc_record_overhead): Likewise. + * ggc-page.c (alloc_page, free_page, ggc_set_mark, ggc_marked_p, + init_ggc, ggc_push_context, ggc_recalculate_in_use_p, + ggc_pop_context, clear_marks, validate_free_objects, + ggc_pch_read): Likewise. + * ggc-zone.c (ggc_allocated_p, free_chunk, ggc_set_mark, + ggc_marked_p, ggc_get_size, init_ggc, destroy_ggc_zone, + ggc_push_context, check_cookies, ggc_collect, + ggc_print_statistics): Likewise. + * gimple-low.c (lower_function_body, lower_stmt, + lower_bind_expr): Likewise. + * gimplify.c (gimple_tree_eq, push_gimplify_context, + pop_gimplify_context, gimple_pop_condition, create_tmp_var, + declare_tmp_vars, gimple_add_tmp_var, annotate_all_with_locus, + mostly_copy_tree_r, gimplify_return_expr, gimplify_switch_expr, + gimplify_case_label_expr, gimplify_exit_block_expr, + canonicalize_component_ref, gimplify_compound_lval, + gimplify_self_mod_expr, gimplify_call_expr, + gimplify_init_ctor_eval, gimplify_init_constructor, + gimplify_modify_expr, gimplify_save_expr, gimplify_target_expr, + gimplify_expr, check_pointer_types_r, + force_gimple_operand): Likewise. + * global.c (global_alloc, build_insn_chain): Likewise. + * graph.c (clean_graph_dump_file, + finish_graph_dump_file): Likewise. + gcov-io.c (gcov_open): Use GCOV_CHECK. + +2004-09-09 Richard Sandiford + + * config/frv/frv.c (acc_operand, accg_operand): Use REGNO. + +2004-09-09 Jan Hubicka + + middle-end/17128 + * tree-inline.c (expand_call_inline): Make overactive sanity check + happy. + +2004-09-09 Jan Hubicka + + * tree-ssa-loop-ivopts.c (peel_address): Fix abort on + VIEW_CONVERT_EXPR. + +2004-09-09 Nathan Sidwell + + * Makefile.in (gengtype): Use $(BUILD_ERRORS). + (gengtype.o): Depend on errors.h. + * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. + (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, + attr_alt_subset_p, attr_alt_subset_of_compl_p, + attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, + write_test_expr, write_attr_value, write_eligible_delay, + make_internal_attr, make_numeric_value): Likewise. + * genautomata.c (regexp_name, get_str_vect, + gen_presence_absence_set, automaton_decl_hash, + automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, + decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, + process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, + test_unit_reserv, it_is_empty_reserv_sets, + reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, + reserv_sets_and, output_cycle_reservs, get_free_state, + intersected_state_reservs_p, states_union, remove_arc, + copy_insn_regexp, transform_1, transform_2, transform_3, + regexp_transform_func, store_alt_unit_usage, + check_regexp_units_distribution, process_seq_for_forming_states, + process_alts_for_forming_states, make_automaton, + form_arcs_marked_by_insn, create_composed_state, + set_out_arc_insns_equiv_num, partition_equiv_class, + process_insn_equiv_class, set_insn_equiv_classes, + units_to_automata_heuristic_distr, form_regexp, + longest_path_length, output_dfa_max_issue_rate, add_vect, + out_state_arcs_num, add_vect_el, output_trans_table, + output_state_alts_table, output_dead_lock_vect, + output_max_insn_queue_index_def, + output_min_insn_conflict_delay_func, + output_internal_insn_latency_func, output_print_reservation_func, + output_cpu_unit_reservation_p, output_state_arcs, + make_insn_alts_attr, make_internal_dfa_insn_code_attr, + make_default_insn_latency_attr, + form_important_insn_automata_lists): Likewise. + * genemit.c (gen_exp, output_add_clobbers, + output_added_clobbers_hard_reg_p): Likewise. + * genextract.c (print_path, main): Likewise. + * genflags.c (gen_macro): Likewise. + * gengenrtl.c: Include errors.h + (type_from_format, accessor_from_format): Likewise. + * gengtype.c (get_file_basename, output_mangled_typename, + walk_type, write_types_process_field, + write_types_local_process_field): Likewise. + * genmodes.c (complete_mode): Likewise. + * genopinit.c (gen_insn): Likewise. + * genoutput.c (output_insn_data, check_constraint_len, + constraint_len): Likewise. + * genpreds.c (add_mode_tests):Likewise. + * gen-protos.c (add_hash): Likewise. + * genrecog.c (find_operand, find_matching_operand, + validate_pattern, add_to_sequence, maybe_both_true, + nodes_identical_1, merge_trees, write_switch, write_cond, + write_action, is_unconditional, make_insn_sequence, + debug_decision_2): Likewise. + * gensupport.c (is_predicable, collect_insn_data, + alter_predicate_for_insn, maybe_eval_c_test): Likewise. + +2004-09-09 Jan Hubicka + + * basic-block.h (guess_outgoing_edge_probabilities): Declare. + * cfgbuild.c (compute_outgoing_frequencies): When probability is + missing, guess it. + (find_many_sub_basic_blocks): Do update profile only when it is + present. + * predict.c (set_even_probabilities): Break out from ... + (combine_predictions_for_insn): ... here; deal with + !can_predict_insn_p insns. + (combine_predictions_for_bb): Use set_even_probabilities. + (bb_estimate_probability_locally): Break out from .... + (estimate_probability): ... here. + (guess_outgoing_edge_probabilities): New entry point. + +2004-09-09 Nathan Sidwell + + * gcc.c (add_sysrooted_prefix, execute, do_self_spec, do_spec_1, + handle_braces, process_brace_body, main, used_arg, + set_multilib_dir, print_multilib_info): Use fatal, not abort. + + * tree-nested.c (create_tmp_var_for): Correct missinverted assert. + + * tree-outof-ssa.c (free_temp_expr_table): Add missed assert. + * tree-ssa-ccp.c (set_lattice_value): Correct missapplied de + Morgan's theorem in last checkin. + +2004-09-09 Giovanni Bajo + Nathan Sidwell + + * targhooks.c (default_unwind_emit, default_scalar_mode_supported_p): + Use gcc_assert, gcc_unreachable & internal_error instead of abort. + * timevar.c (timevar_push, timevar_pop, timevar_start, + timevar_stop): Likewise. + * toplev.c (default_pch_valid_p): Likewise. + * tracer.c (tail_duplicate): Likewise. + * tree-alias-common.c (get_alias_var_decl, + get_values_from_constructor, create_alias_var, delete_alias_vars, + empty_points_to_set, same_points_to_set, ptr_may_alias_var): + Likewise. + * tree.c (tree_size, make_node_stat, copy_node_stat, + build_int_cst_wide, integer_all_onesp, list_length, chainon, + tree_node_structure, type_contains_placeholder_p, substitute_in_expr, + substitute_placeholder_in_expr, tabilize_reference_1, build0_stat, + build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p, + lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr, + build_method_type_directly, decl_type_context, get_callee_fndecl, + get_set_constructor_bits, build_vector_type_for_mode, int_cst_value, + tree_fold_gcd): Likewise. + * tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges, + make_cond_expr_edges, group_case_labels, tree_merge_blocks, + cleanup_control_expr_graph, find_taken_edge, + find_taken_edge_switch_expr, phi_alternatives_equal, + is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt, + stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate, + tree_split_edge, tree_verify_flow_info, thread_jumps, + tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise. + * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly, + chrec_fold_multiply_poly_poly): Likewise. + * tree-complex.c (extract_component, expand_complex_division, + expand_complex_comparison, expand_complex_operations_1, + build_replicated_const, expand_vector_operations_1): Likewise. + * tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector, + build_classic_dir_vector): Likewise. + * tree-dfa.c (compute_immediate_uses_for_phi, + compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann, + create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise. + * tree-dump.c (dequeue_and_dump): Likewise. + * tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region, + record_in_finally_tree, replace_goto_queue_1, + maybe_record_in_goto_queue, verify_norecord_switch_expr, + do_return_redirection): Likewise. + * tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr, + add_to_dst_predicate_list, find_phi_replacement_condition, + replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order): + Likewise. + * tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r, + initialize_inlined_parameters, declare_return_variable, + estimate_num_insns_1, expand_call_inline, expand_calls_inline, + optimize_inline_calls, copy_tree_r): Likewise. + * tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt, + ssa_rewrite_stmt, rewrite_into_ssa): Likewise. + * tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after, + tsi_split_statement_list_after, tsi_split_statement_list_before): + Likewise. + * tree-mudflap.c (mf_varname_tree): Likewise. + * tree-nested.c (create_tmp_var_for, lookup_field_for_decl, + lookup_tramp_for_decl, convert_all_function_calls): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi, + coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis, + free_temp_expr_table, add_dependance, finish_expr, rewrite_trees): + Likewise. + * tree-phinodes.c (resize_phi_node, add_phi_arg, + remove_all_phi_nodes_for): Likewise. + * tree-pretty-print.c (op_prio, print_call_name): Likewise. + * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler, + tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise. + * tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree, + sra_elt_eq, sra_walk_expr, instantiate_missing_elements, + generate_one_element_ref, generate_element_copy, + generate_element_zero, scalarize_copy, scalarize_init, + scalarize_ldst): Likewise. + * tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p, + add_may_alias, add_pointed_to_expr, add_pointed_to_var, + collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise. + * tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise. + * tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value, + set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment, + widen_bitfield, ccp_fold_builtin): Likewise. + * tree-ssa-copy.c (may_propagate_copy, merge_alias_info, + replace_exp_1, propagate_tree_value): Likewise. + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. + * tree-ssa-dce.c (set_control_dependence_map_bit, + find_control_dependence, find_pdom, mark_operand_necessary, + mark_stmt_if_obviously_necessary, + mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise. + * tree-ssa-dom.c (dom_opt_initialize_block_local_data, + simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis, + eliminate_redundant_computations, avail_expr_eq): Likewise. + * tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise. + * tree-ssa-loop-ch.c (should_duplicate_loop_header_p, + duplicate_blocks): Likewise. + * tree-ssa-loop-im.c (for_each_index, set_level, + is_call_clobbered_ref): Likewise. + * tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos, + stmt_after_increment, set_iv, contains_abnormal_ssa_name_p, + find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates, + peel_address, ptr_difference_cost, may_replace_final_value, + determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer, + rewrite_use, rewrite_uses): Likewise. + * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, + check_loop_closed_ssa_use): Likewise. + * tree-ssanames.c (make_ssa_name): Likewise. + * tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses, + finalize_ssa_v_must_defs, finalize_ssa_stmt_operands, + get_stmt_operands, get_expr_operands, get_asm_expr_operands, + get_indirect_ref_operands, add_stmt_operand): Likewise. + * tree-ssa-pre.c (value_exists_in_set_bitmap, + value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set, + phi_translate, valid_in_set, compute_antic, + find_or_generate_expression, create_expression_by_pieces, insert_aux, + create_value_expr_from, eliminate): Likewise. + * tree-ssa-propagate.c (cfg_blocks_get): Likewise. + * tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges): + Likewise. + * tree-tailcall.c (independent_of_stmt_p, adjust_return_value, + eliminate_tail_call): Likewise. + * tree-vectorizer.c (vect_create_index_for_array_ref, + vect_align_data_ref, vect_create_data_ref, + vect_create_destination_var, vect_get_vec_def_for_operand, + vect_finish_stmt_generation, vect_transform_stmt, + vect_transform_loop_bound, vect_transform_loop, + vect_analyze_operations): Likewise. + * tree-vn.c (vn_compute, set_value_handle, get_value_handle): + Likewise. + * tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr, + get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start, + bsi_after_labels, bsi_last): Likewise. + * tree-ssa-live.c (var_union, change_partition_var, + create_ssa_var_map, calculate_live_on_entry, root_var_init, + type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce): + Likewise. + * tree-ssa-live.h (partition_is_global, live_entry_blocks, + tpa_find_tree): Likewise. + (register_ssa_partition_check): Declare. + (register_ssa_partition): use it. + * tree-ssa-live.c: Include errors.h. + (register_ssa_partition_check): New. + * tree-ssa-operands.c: Include errors.h. + * Makefile.in (tree-ssa-operands.o): Depend on errors.h. + +2004-09-09 Richard Sandiford + Catherine Moore + + * config/frv/frv-protos.h (FRV_CPU_FR550, FRV_CPU_FR450) + (FRV_CPU_FR405): New processor enums. + (frv_issue_rate, frv_acc_group): Declare. + * config/frv/frv.h (CPP_SPEC, CPP_FRV_SPEC, CPP_FR500_SPEC): Delete. + (CPP_FR400_SPEC, CPP_SIMPLE_SPEC): Delete. + (MASK_DEFAULT_FR550, MASK_DEFAULT_FR450): New macros. + (SUBTARGET_EXTRA_SPECS, EXTRA_SPECS, CPP_CPU_DEFAULT_SPEC): Delete. + (TARGET_CPU_CPP_BUILTINS): Define the macros that were previously + handled by CPP_SPEC. + (MASK_LONG_CALLS, TARGET_LONG_CALLS): New macros. + (MASK_ALIGN_LABELS, TARGET_ALIGN_LABELS): New macros. + (ACC_MASK): New macro. + (TARGET_MEDIA_REV2): Include FRV_CPU_{FR405,FR450,FR550}. + (TARGET_MEDIA_FR450): New macro. + (TARGET_FR500_FR550_BUILTINS, TARGET_FR405_BUILTINS): New macros. + (TARGET_SWITCHES): Add -m{no-,}align-labels and -m{no-,}long-calls. + (LABEL_ALIGN_AFTER_BARRIER): Define. + (ACC_LAST, ACCG_LAST): Add four new accumulator registers. + (IACC_FIRST, IACC_LAST): New pair of SPRs. + (ACCG_FIRST, AP_FIRST, SPR_FIRST, SPR_LAST): Adjust accordingly. + (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER) + (REGISTER_NAMES): Add entries for new registers. + (REG_CLASS_CONTENTS): Update for new register ranges. + (EXTRA_CONSTRAINT_FOR_S): Redefine in terms of call_operand. + (ISSUE_RATE, CLEAR_VLIW_START, SET_VLIW_START): Delete. + (PACKING_FLAG_USED_P): Delete. + (FRV_BUILTIN_MQLCLRHS, FRV_BUILTIN_MQLMTHS, FRV_BUILTIN_MQSLLHI) + (FRV_BUILTIN_MQSRAHI, FRV_BUILTIN_SMUL, FRV_BUILTIN_UMUL) + (FRV_BUILTIN_PREFETCH0, FRV_BUILTIN_PREFETCH, FRV_BUILTIN_SMASS) + (FRV_BUILTIN_SMSSS, FRV_BUILTIN_SMU, FRV_BUILTIN_SCUTSS) + (FRV_BUILTIN_ADDSS, FRV_BUILTIN_SUBSS, FRV_BUILTIN_SLASS) + (FRV_BUILTIN_IACCread{l,ll}, FRV_BUILTIN_IACCset{ll,l}) + (FRV_BUILTIN_SCAN): New members of frv_builtin_enum. + (FRV_BUILTIN_FIRST_NONMEDIA): New macro. + (CPU_UNITS_QUERY): Define to 1. + * config/frv/frv.c: Include gt-frv.h + (NUM_NOP_PATTERNS, NTH_UNIT, UNIT_NUMBER, PACKING_FLAG_P): New macros. + (SET_PACKING_FLAG, CLEAR_PACKING_FLAG, FOR_EACH_REGNO): New macros. + (frv_insn_group): New enumeration. + (frv_unit_names, frv_unit_groups, frv_unit_codes): New variables. + (frv_type_to_unit, frv_nops, frv_num_nops): New variables. + (REGSTATE_DEAD, REGSTATE_LIVE, REGSTATE_UNUSED, REGSTATE_MASK) + (REGSTATE_CONDJUMP): Delete. Shuffle other numbers to cover the + gap left by REGSTATE_LIVE. + (regstate_t): New typedef. + (TARGET_MACHINE_DEPENDENT_REORG): Define. + (frv_default_flags_for_cpu): Handle FRV_CPU_{FR550,FR450,FR405}. + (frv_override_options): Check for -mcpu={fr550,fr450,fr405}. + Initialize frv_unit_codes[] and frv_type_to_unit[]. + (frv_conditional_register_usage): Remove redundant fixing of + accumulator registers. + (frv_insn_packing_flag): Update specification. + (frv_function_prologue): Don't set frv_insn_packing_flag here. + Zero out frv_nops[]. + (frv_expand_epilogue): Remove comments about the no-longer-present + SIBCALL_P argument. + (frv_asm_output_mi_thunk): Check frv_issue_rate() rather than + PACKING_FLAG_USED_P() when deciding whether to pack instructions. + (frv_asm_output_opcode, frv_final_prescan_insn): Simplify in light + of the new meaning of frv_insn_packing_flag. Emit an mnop.p if + packing is disabled and if INSN can only issue to M1. + (call_operand): Check TARGET_LONG_CALLS. + (acc_operand, even_acc_operand, quad_acc_operand) + (accg_operand): Simplify. Don't accept pseudo registers. + (output_move_single): Handle SPR<-zero moves. + (frv_issue_rate): Make non-static. Handle FRV_CPU_{FR550,FR450,FR405}. + (frv_registers_update, frv_registers_used_p): Delete. + (frv_registers_set_p): Delete. + (frv_acc_group_1, frv_acc_group, frv_insn_unit): New functions. + (frv_issues_to_branch_unit_p): New function. + (frv_packet): New structure. + (frv_cond_flags, frv_regstate_conflict_p): New functions. + (frv_registers_conflict_p_1, frv_registers_conflict_p): New functions. + (frv_registers_update_1, frv_registers_update): New functions. + (frv_start_packet, frv_start_packet_block, frv_finish_packet) + (frv_pack_insn_p, frv_add_insn_to_packet, frv_insert_nop_in_packet) + (frv_for_each_packet, frv_sort_insn_group_1, frv_compare_insns) + (frv_sort_insn_group, frv_reorder_packet): New functions. + (frv_pack_insns): Use frv_reorder_packet. + (frv_packet_address): New variable. + (frv_fill_unused_units, frv_align_label, frv_reorg_packet) + (frv_register_nop, frv_reorg): New functions. + (bdesc_1arg): Add __SCUTSS. + (bdesc_2arg): Add __MQLCLRHS, __MQLMTHS, __SMUL, __UMUL, __ADDSS, + __SUBSS, __SLASS and __SCAN. + (bdesc_2argimm): Add __MQSLLHI and __MQSRAHI. + (bdesc_int_void2arg, bdesc_prefetches): New arrays. + (frv_init_builtins): Register the above builtins. + (frv_int_to_acc): Use ACC_MASK to check for valid accumulator + registers. Turn the referenced accumulators into global registers. + (frv_read_iacc_argument): New function. + (frv_expand_int_void2arg, frv_expand_prefetches): New functions. + (frv_split_iacc_move): New function. + (frv_expand_builtin): Handle the new builtins. + * config/frv/frv.md: Replace old schedulers with new order-independent + ones. Add schedulers for the FR405, FR450 and FR550. Describe new + packing algorithm. + (cpu): Add fr550, fr450 and fr405. + (type): Add macc, scan, cut, fnop, fscmp, fdcmp, mnop, mqlimh and + mqshift. Replace fmas with fsmadd and fmad with fdmadd. Delete m7. + (*muladd[sd]f4, *mulsub[sd]f4): Fix types. + (*cmp[sd]f_cc_fp): Use new f[sd]cmp types. + (fnop, mnop): New patterns. + (UNSPEC_MQLCLRHS, UNSPEC_MQLMTHS, UNSPEC_MQSLLHI, UNSPEC_MQSRAHI): + New constants. + (mexpdhw, *cond_exec_mexpdhw): Fix destination operands. + (mclracca8): Use ACC_MASK to determine the upper set of accumulator + registers. + (mqlclrhs, mqlmths, mqsllhi, mqsrahi): New patterns. + (UNSPEC_SMUL, UNSPEC_UMUL, UNSPEC_SMU, UNSPEC_ADDSS, UNSPEC_SUBSS) + (UNSPEC_SLASS, UNSPEC_SCAN, UNSPEC_INTSS, UNSPEC_SCUTSS) + (UNSPEC_PREFETCH0, UNSPEC_PREFETCH, UNSPEC_IACCreadll) + (UNSPEC_IACCreadl, UNSPEC_IACCsetll, UNSPEC_IACCsetl, UNSPEC_SMASS) + (UNSPEC_SMSSS, UNSPEC_IMUL, IACC0_REG): New constants. + (smul, umul, smass, smsss, smu, addss, subss, slass, scan, scutss) + (frv_prefetch0, frv_prefetch): New patterns. + * config/frv/t-frv (MULTILIB_OPTIONS): Remove -mcpu=frv and + -mcpu=simple. Add -mcpu=fr550. + (MULTILIB_DIRNAMES): Update accordingly. + (MULTILIB_MATCHES): Use the fr400 multilibs for -mcpu=fr405 and + -mcpu=fr450. + * doc/invoke.texi: Document the new -mcpu={fr550,fr450,fr405}, + -mlong-calls and -malign-labels options for FR-V. + +2004-09-09 Joseph S. Myers + + PR c/8420 + * c-tree.h (struct c_declspecs): New. + (struct c_declarator, struct c_type_name, struct c_parm): Update + element types. + (build_array_declarator, grokfield, shadow_tag, shadow_tag_warned, + start_function, start_decl, build_c_parm, + make_pointer_declarator): Update prototypes. + (build_null_declspecs, declspecs_add_qual, declspecs_add_type, + declspecs_add_scspec, declspecs_add_attrs): New. + (split_specs_attrs): Remove. + * c-parse.in (%union): Add dsptype. + (declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea, + declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea, + declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea, + declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea, + declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea, + declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea, + declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea, + declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea, declspecs_ts, + declspecs_nots, declspecs_ts_nosa, declspecs_nots_nosa, + declspecs_nosc_ts, declspecs_nosc_nots, declspecs_nosc, declspecs, + maybe_type_quals_attrs): Change to dsptype. + (struct c_declspec_stack): New. + (current_declspecs, declspec_stack): Change type. + (PUSH_DECLSPEC_STACK, POP_DECLSPEC_STACK): Update to new + structures. + (extdefs): Likewise. + (setspecs): Likewise. + (fndef): Use current_declspecs for empty declspecs list. + (declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea, + declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea, + declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea, + declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea, + declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea, + declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea, + declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea, + declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea): Update to new + structures and helper functions. Update comments. + (typespec_nonattr): Correct comment. + (maybe_type_quals_attrs, typename): Update to new structures. + * c-decl.c (grokdeclarator, build_array_declarator, grokfield, + shadow_tag, shadow_tag_warned, start_function, start_decl, + build_c_parm, make_pointer_declarator, + set_array_declarator_inner, groktypename): Update to new + structures. + (build_null_declspecs, declspecs_add_qual, declspecs_add_type, + declspecs_add_scspec, declspecs_add_attrs): New. + (split_specs_attrs): Remove. + (shadow_tag_warned): Make warning for useless type names a + pedwarn. Give hard error for long, short, signed, unsigned or + _Complex used with struct, union or enum in empty declaration. + Make found_tag a bool. + (grokdeclarator): Remove checks now done at parse time. + +2004-09-09 Joseph S. Myers + + * c-tree.h (enum c_declarator_kind, struct c_arg_info, struct + c_declarator, struct c_type_name, struct c_parm): New. + (build_array_declarator, set_array_declarator_inner, + get_parm_info, grokfield, groktypename, grokparm, push_parm_decl, + start_function, start_decl, build_c_parm, build_attrs_declarator, + build_function_declarator, make_pointer_declarator, c_cast_expr, + store_parm_decls_newstyle, c_expr_sizeof_type): Update prototypes. + (build_id_declarator): New. + * c-typeck.c (c_cast_expr, c_expr_sizeof_type): Update to new + structures. + * c-decl.c (ARG_INFO_PARMS, ARG_INFO_TAGS, ARG_INFO_TYPES, + ARG_INFO_OTHERS): Remove. + (build_id_declarator): New. + (build_array_declarator, set_array_declarator_inner, groktypename, + start_decl, grokparm, push_parm_decl, grokparms, get_parm_info, + grokfield, start_function, store_parm_decls_newstyle, + store_parm_decls_oldstyle, store_parm_decls, + build_c_parm, build_attrs_declarator, build_function_declarator, + make_pointer_declarator, grokdeclarator): Update to new + structures. + * c-parse.in (%union): Add arginfotype, dtrtype, typenametype and + parmtype. + (declarator, notype_declarator, after_type_declarator, + parm_declarator, parm_declarator_starttypename, + parm_declarator_nostarttypename, array_declarator, typename, + absdcl, absdcl1, absdcl1_ea, absdcl1_noea, direct_absdcl1, + absdcl_maybe_attribute, parm, firstparm, parms, parmlist, + parmlist_1, parmlist_2, parmlist_or_identifiers, + parmlist_or_identifiers_1): Use these types. + (primary, after_type_declarator, parm_declarator_starttypename, + notype_declarator, component_decl, component_declarator, + component_notype_declarator, typename, absdcl, + absdcl_maybe_attribute, absdcl1_ea, direct_absdcl1, parmlist_1, + parmlist_2, parmlist_or_identifiers_1): Update to new structures. + +2004-09-09 Joseph S. Myers + + * c-tree.h (C_DECL_USED, parser_obstack, in_alignof, in_sizeof, + in_typeof, record_maybe_used_decl, pop_maybe_used, + c_expr_sizeof_expr, c_expr_sizeof_type): New. + * c-decl.c (parser_obstack): New. + (c_init_decl_processing): Initialize parser_obstack. + (c_write_global_declarations_1): Check for used but undefined + static functions. + * c-parse.in (%union): Add otype. + (save_obstack_position): New. + (extdefs): Use it. + (unary_expr): Update in_sizeof and in_alignof. Use + c_expr_sizeof_expr and c_expr_sizeof_type. + (sizeof): Update in_sizeof. + (alignof): Update in_alignof. + (typeof): Update in_typeof. + (typespec_nonreserved_nonattr): Call pop_maybe_used. + * c-typeck.c (in_alignof, in_sizeof, in_typeof, struct + maybe_used_decl, maybe_used_decls, record_maybe_used_decl, + pop_maybe_used, c_expr_sizeof_expr, c_expr_sizeof_type): New. + (build_external_ref): Set C_DECL_USED or call + record_maybe_used_decl if appropriate. + * toplev.c (check_global_declarations): Check TREE_NO_WARNING. + +2004-09-08 Eric Christopher + + * builtins.c: Fix prototype for fold_builtin_atan. + +2004-09-08 Eric Christopher + + * builtins.c (fold_builtin_strlen, fold_builtin_sqrt, fold_builtin_cbrt, + fold_builtin_pow, fold_builtin_sin, fold_builtin_cos, fold_builtin_tan, + fold_builtin_atan): New functions. Migrate function bodies... + (fold_builtin_1): ... from here. + +2004-09-09 Alan Modra + + * config/rs6000/rs6000.c (rs6000_stack_info): Correct alignment of + save_size. + +2004-09-08 David Edelsohn + + * config/rs6000/power4.md (power4-lmul): du4 feeds iu1. + * config/rs6000/power5.md (power5-lmul): Same. + +2004-09-08 Richard Henderson + + PR rtl-opt/17186 + * function.c (expand_function_end): Have fall-off-the-end + return path jump around return register setup. + +2004-09-08 Eric Botcazou + + * config/sparc/sparc.c (sparc_indent_opcode): New variable. + (output_return): Do not test for the presence of the 'unimp' insn. + Use 'current_function_uses_only_leaf_regs' and 'final_sequence' + as predicates instead of custom ones. Return raw strings when + possible. + (output_sibcall): Likewise. Concatenate strings. + (output_ubranch): Remove kludge for TurboSPARC. + (output_cbranch): Remove 'noop' parameter. Do not output 'nop'. + (output_v9branch): Likewise. + (print_operand): Use 'final_sequence' instead of 'dbr_sequence_length'. + <#>: Set sparc_indent_opcode if the delay slot is filled. + <(>: Likewise. + <)>: New operand to emit the displacement from the saved PC on return. + <@>: Remove. + * config/sparc/sparc.h (sparc_indent_opcode): Declare it. + (ASM_OUTPUT_OPCODE): New macro. + (PRINT_OPERAND_PUNCT_VALID_P): Remove '^' and add ')'. + * config/sparc/sparc.md (normal_branch, inverted_branch, + normal_fp_branch, inverted_fp_branch, normal_fpe_branch, + inverted_fpe_branch): Adjust call to output_cbranch. + (normal_int_branch_sp64, inverted_int_branch_sp64): Adjust + call to output_v9branch. + * config/sparc/sparc-protos.h (output_cbranch): Adjust. + (output_v9branch): Likewise. + +2004-09-08 Devang Patel + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -segaddr, + -segs_read_only_addr and -segs_read_write_addr. + (WORD_SWITCH_TAKES_ARG): Same. + (LINK_SPEC): Same. + * doc/invoke.texi: Document -segaddr, -segs_read_only_addr and + -segs_read_write_addr. + +2004-09-08 Richard Henderson + + * function.c (reference_callee_copied): New. + (assign_parm_setup_reg): Use it. + * calls.c (initialize_argument_information): Likewise. + (emit_library_call_value_1): Likewise. + * function.h (reference_callee_copied): Declare. + + * target.h (struct gcc_target): Add callee_copies. + * target-def.h (TARGET_CALLEE_COPIES): New. + (TARGET_PASS_BY_REFERENCE): Update default. + * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * targhooks.c (hook_callee_copies_named): New. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from + hook_pass_by_reference_false. + (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. + * targhooks.h: Update decls. + * config/arc/arc.c (TARGET_CALLEE_COPIES): New. + * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. + * config/frv/frv.c (frv_function_arg_callee_copies): Remove. + * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. + * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. + * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/mips/mips.c (TARGET_CALLEE_COPIES): New. + (mips_callee_copies): New. + * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. + * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. + * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/pa/pa.c (TARGET_CALLEE_COPIES): New. + * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/sh/sh.c (sh_callee_copies): New. + (TARGET_CALLEE_COPIES): New. + * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * config/v850/v850.c (TARGET_CALLEE_COPIES): New. + * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. + * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation + for FUNCTION_ARG_CALLEE_COPIES. + * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. + +2004-09-08 Devang Patel + + * tree-if-conv.c (find_phi_replacement_condition): Return true + edge block. + (replace_phi_with_cond_modify_expr): Select conditional expr args + based on true edge basic block. + +2004-09-08 Jan Hubicka + + * tree-ssa-operands.c (add_stmt_operand): Use V_MUST_DEF even for + variables being alias set. + +2004-09-08 Nathan Sidwell + + * final.c (shorten_branches, final, get_insn_template, + output_alternate_entry_point, final_scan_insn, alter_subreg, + alter_cond, output_operand, asm_fprintf, final_forward_branch_p, + leaf_renumber_regs_insn): Use gcc_assert and gcc_unreachable. + * fix-header.c (lookup_std_proto): Likewise. + * flow.c (first_insn_after_basic_block_note, verify_wide_reg, + verify_local_live_at_start, update_life_info, mark_reg, + calculate_global_regs_live, allocate_reg_life_data, + init_propagate_block_info, mark_set_regs, flush_reg_cond_reg_1, + ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond, + attempt_auto_inc, mark_used_reg, mark_used_regs): Likewise. + * fold-const.c (force_fit_type, div_and_round_double, + may_negate_without_overflow_p, int_const_binop, const_binop, + size_binop, size_diffop, fold_convert_const, fold_convert, + invert_tree_comparison, swap_tree_comparison, + comparison_to_compcode, compcode_to_comparison, invert_truthvalue, + range_binop, make_range, fold_cond_expr_with_comparison, + fold_div_compare, fold, fold_checksum_tree, fold_negate_const, + fold_abs_const, fold_not_const, fold_relational_const, round_up, + round_down): Likewise. + * function.c (find_function_data, assign_stack_temp_for_type, + instantiate_virtual_regs_lossage, aggregate_value_p, + assign_parm_find_entry_rtl, assign_parm_setup_block, + expand_function_start, expand_function_end, keep_stack_depressed, + handle_epilogue_set, thread_prologue_and_epilogue_insns): Likewise. + +2004-09-08 Daniel Berlin + + * Makefile.in (tree-loop-linear.o): Added. + (OBJS-common): Add tree-loop-linear.o + * common.opt: New flag, ftree-loop-linear. + * timevar.def: New timevar, TV_TREE_LOOP_LINEAR. + * tree-flow.h: Add prototype for linear_transform_loops. + * tree-optimize.c: Add linear transform after vectorization. + * tree-pass.h: Add struct pass_linear_transform. + * tree-ssa-loop.c: Add pass_linear_transform. + * tree-loop-linear.c: New file. + * lambda-code.c: gcc_assertify. + (gcc_loop_to_lambda_loop): Handle all exit tests. + Handle case where we have (invariant >= induction var). + (find_induction_var_from_exit_cond): Ditto. + +2004-09-08 Jie Zhang + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): If type + memory tag is call clobbered, so are its aliases. + (group_aliases): When two memory tags being grouped, if one is + call clobbered, so are the other and its aliases. + (add_may_alias): Remove call-clobbering stuff. + (replace_may_alias): Likewise. + (merge_pointed_to_info): Merge pt_global_mem + +2004-09-08 Jan Hubicka + + * cgraph.c (cgraph_remove_node): Free DECL_INITIAL field of node. + * cgraphunit.c (verify_cgraph): Don't verify on syntax errors. + (cgraph_expand_function): Remove stale cgraph edges of currently + compiled function; fix non-unit-at-a-time code copying function + node for later reuse. + +2004-09-08 Nathan Sidwell + + * vec.c (vec_p_reserve, vec_o_reserve): Rename to ... + (vec_gc_p_reserve, vec_gc_o_reserve): ... here. Clone to + (vec_heap_p_reserve, vec_heap_o_reserve): ... here, adjust. + (vec_gc_free, vec_heap_free): New. + * vec.h (DEF_VEC_GC_P, DEF_VEC_MALLOC_P): New. + (DEF_VEC_P): Add allocator argument. Adjust. + (DEF_VEC_GC_O, DEF_VEC_MALLOC_O): New. + (DEF_VEC_O): Add allocator argument. Adjust. + (VEC(free)): New. + + * tree.h (tree): Define a GC'd vector. + * lamba-code.c (lambda_loop): Likewise. + * value-prof.h (histogram_value): Likewise. + +2004-09-08 Nathan Sidwell + + * emit-rtl.c (immed_double_const): Use gcc_assert and gcc_unreachable. + (gen_rtx_SUBREG, gen_reg_rtx, mark_user_reg, subreg_hard_regno, + gen_lowpart_common, gen_highpart, gen_highpart_mode, + subreg_highpart_offset, operand_subword, operand_subword_force, + mem_expr_equal_p, set_mem_attributes_minus_bitpos, + set_mem_alias_set, change_address_1, verify_rtx_sharing, + copy_most_rtx, set_first_insn, set_last_insn, prev_cc0_setter, + try_split, add_insn_after, add_insn_before, remove_insn, + remove_unnecessary_notes, emit_insn_before, emit_jump_insn_before, + emit_call_insn_before, emit_insn_after, emit_jump_insn_after, + emit_call_insn_after, emit_insn, emit_jump_insn, emit_call_insn, + set_unique_reg_note, emit, push_to_full_sequence, copy_insn_1, + gen_const_vector_0, emit_copy_of_insn_after): Likewise. + * et-forest.c (set_prev, set_next, et_check_occ_sanity, + record_path_before_1, check_path_after_1, check_path_after): Likewise. + * except.c (gen_eh_region, resolve_one_fixup_region, + remove_unreachable_regions, convert_from_eh_region_ranges_1, + add_ehl_entry, duplicate_eh_region_1, build_post_landing_pads, + connect_post_landing_pads, sjlj_emit_function_exit, + remove_exception_handler_label, remove_eh_handler, + reachable_next_level, collect_one_action_chain, + output_function_exception_table): Likewise. + * explow.c (trunc_int_for_mode, copy_to_mode_reg, + optimize_save_area_alloca, allocate_dynamic_stack_space, + probe_stack_range, hard_function_value): Likewise. + * expmed.c (mode_for_extraction, store_bit_field, + store_fixed_bit_field, extract_bit_field, expand_shift, + expand_mult_const, expand_mult, choose_multiplier, + expand_mult_highpart, expand_divmod, emit_store_flag, + do_cmp_and_jump): Likewise. + * expr.c (convert_move, convert_modes, move_by_pieces, + move_by_pieces_ninsns, move_by_pieces_1, emit_block_move, + move_block_from_reg, gen_group_rtx, emit_group_load, + emit_group_move, emit_group_store, use_reg, use_regs, + can_store_by_pieces, store_by_pieces, store_by_pieces_1, + emit_move_insn, emit_move_insn_1, emit_push_insn, + expand_assignment, store_expr, count_type_elements, + store_constructor, store_field, safe_from_p, expand_var, + expand_expr_addr_expr, expand_expr_real_1, do_store_flag): Likewise. + +2004-09-08 Nathan Sidwell + + * dbxout.c (dbxout_type, dbxout_type_name, dbxout_symbol): Use + gcc_assert and gcc_unreachable. + * ddg.c (create_ddg_dependence, add_deps_for_def, + add_deps_for_use, create_ddg, add_edge_to_ddg): Likewise. + * df.c (df_ref_unlink, df_ref_record, df_uses_record, + df_reg_def_chain_create, df_reg_use_chain_create, df_analyze, + df_insn_delete, df_refs_reg_replace, df_ref_reg_replace, + df_insns_modify, df_pattern_emit_before, df_bb_reg_live_start_p, + df_bb_reg_live_end_p, df_bb_regs_lives_compare, + df_bb_single_def_use_insn_find, dataflow_set_a_op_b, + dataflow_set_copy, hybrid_search, diagnostic.c, + diagnostic_build_prefix, diagnostic_count_diagnostic): Likewise. + * dojump.c (do_jump): Likewise. + * dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree, + compute_dom_fast_query, calculate_dominance_info, + free_dominance_info, get_immediate_dominator, + set_immediate_dominator, get_dominated_by, + redirect_immediate_dominators, nearest_common_dominator, + dominated_by_p, verify_dominators, recount_dominator, + iterate_fix_dominators, add_to_dominance_info, + delete_from_dominance_info): Likewise. + * dwarf2asm.c (size_of_encoded_value, eh_data_format_name, + dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128, + dw2_force_const_mem, dw2_asm_output_encoded_addr_rtx): Likewise. + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes, reg_save, + initial_return_save, stack_adjust_offset, dwarf2out_stack_adjust, + flush_queued_reg_saves, dwarf2out_frame_debug_expr, + dwarf2out_frame_debug, dw_cfi_oprnd1_desc, output_cfi, + output_call_frame_info, output_loc_operands, build_cfa_loc, + decl_ultimate_origin, AT_flag, AT_int, AT_unsigned, AT_string, + AT_string_form, add_AT_specification, AT_ref, set_AT_ref_external, + AT_loc, AT_loc_list, AT_addr, AT_lbl, add_child_die, + splice_child_die, attr_checksum, same_dw_val_p, + break_out_includes, build_abbrev_table, size_of_die, mark_dies, + unmark_dies, value_format, output_loc_list, output_die, + output_pubnames, output_aranges, base_type_die, is_base_type, + modified_type_die, dbx_reg_number, multiple_reg_loc_descriptor, + mem_loc_descriptor, loc_descriptor, loc_descriptor_from_tree_1, + field_byte_offset, add_data_member_location_attribute, + add_const_value_attribute, rtl_for_decl_location, + add_location_or_const_value_attribute, add_byte_size_attribute, + add_bit_offset_attribute, add_bit_size_attribute, + add_abstract_origin_attribute, pop_decl_scope, scope_die_for, + decl_start_label, gen_formal_parameter_die, + gen_type_die_for_member, gen_subprogram_die, gen_label_die, + gen_typedef_die, gen_type_die, gen_tagged_type_instantiation_die, + force_decl_die, force_type_die, gen_decl_die, + dwarf2out_imported_module_or_decl, prune_unused_types_prune, + dwarf2out_finish): Likewise. + +2004-09-08 Andreas Tobler + + * Makefile.in (builtins.o): Depend on tree-mudflap.h. + * builtins.c: Include tree-mudflap.h. + +2004-09-08 Uros Bizjak + + * config/i386/i386.c (ix86_prepare_fp_compare_args): Do not + force operand 0.0 into register in XFmode. Also do not force + operand 0.0 into register if !TARGET_CMOVE. + * config/i386/i386.md (*cmpfp_0): Delete. Remove comment. + (*cmpfp_0_sf, cmpfp_0_df, cmpfp_0_xf): New patterns to + implement ftst x87 instruction. + (*fp_jcc_7): New insn pattern. Change corresponding split + pattern to handle "general_operand" instead of + "nonimmediate_operand". + +2004-09-08 Ben Elliston + + * doc/rtl.texi (Insns): Document NOTE_INSN_FUNCTION_BEG. + +2004-09-07 Frank Ch. Eigler + + * builtins.c (std_gimplify_va_arg_expr): Mark INDIRECT_REF nodes + generated from standard va_arg expansion. + * tree-mudflap.c (mx_xform_derefs_1): Omit instrumentation from + marked nodes. + (mf_varname_tree, mf_file_function_line_tree): Add some support + for column numbers if compiled with USE_MAPPED_LOCATION. + +2004-09-07 Ziemowit Laski + + * c-decl.c (groktypename_in_parm_context): Remove function. + * c-tree.h (groktypename_in_parm_context): Remove prototype. + +2004-09-07 Ziemowit Laski + + * Makefile.in (c-parse.o): Depend on $(C_COMMON_H). + * c-parse.in: Include c-common.h instead of objc-act.h. + (ivar_decl_list, ivar_decls, ivar_decl, ivars, ivar_declarator, + myparms, myparm): Remove %type declarations. + (methodtype, optparms, OBJC_TYPE_QUAL, objc_quals, objc_qual, + objc_typename, objc_try_catch_stmt, optellipsis): Add %type + declarations. + (objc_inherit_code, objc_public_flag): Remove. + (typespec_nonreserved_nonattr): Call + objc_get_protocol_qualified_type() instead of get_static_reference() + and get_protocol_reference(). + (stmt_nocomp): Call grokparm() on @catch parameter. + (objcdef): Move semantic action to objc_finish_implementation(). + (classdef): Move semantic action to objc_start_class_interface(), + objc_continue_interface(), objc_finish_interface(), + objc_start_class_implementation(), objc_continue_implementation(), + objc_start_category_interface() and + objc_start_category_implementation(). + (protocoldef): Move semantic actions to objc_start_protocol() and + objc_finish_interface(). + (ivar_decl_list): Remove nonterminal. + (visibility_spec): Move semantic actions to objc_set_visibility(). + (ivar_decls): Remove assignment to $$. + (ivar_decl): Rephrase in terms of component_decl; call + objc_add_instance_variable(). + (ivars, ivar_declarator): Remove nonterminals. + (opt_semi): New nonterminal. + (methodtype): Remove semantic actions. + (methoddef): Move semantic actions to objc_set_method_type(), + objc_start_method_definition() and objc_finish_method_definition(). + (methodproto): Move semantic actions to objc_set_method_type() and + objc_add_method_declaration(). + (methoddecl): Use objc_typename instead of typename; move semantic + actions to objc_build_method_signature(). + (optarglist, myxdecls, mydecl, myparms, myparm): Remove nonterminals. + (optparmlist): Express in terms of optparms and optellipsis. + (optparms, optellipsis, objc_qual, objc_quals, objc_typename): New + nonterminals. + (keyworddecl): Use objc_typename instead of typename. + (rid_to_yy): Mark RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF + and RID_ONEWAY as returning OBJC_TYPE_QUAL to yyparse(). + +2004-09-08 Alan Modra + + * doc/tm.texi (MD_UNWIND_SUPPORT): Document. + (MD_FALLBACK_FRAME_STATE_FOR): Update. + * unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined. + (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. + (MD_FROB_UPDATE_CONTEXT): Remove default. + (uw_update_context_1): Instead #ifdef invocation. + * config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined. + (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. + * config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef. + (MD_UNWIND_SUPPORT): Undefine this instead. + * config/i386/gnu.h: Likewise. + * config/alpha/linux-unwind.h: New file, macro converted to + function, extracted from.. + * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this. + (MD_UNWIND_SUPPORT): Define. + * config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise. + * config/i386/linux-unwind.h, config/i386/linux.h, + config/i386/linux64.h: Likewise. + * config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise. + MD_HANDLE_UNWABI too. + * config/mips/linux-unwind.h, config/mips/linux.h: Likewise. + * config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise. + * config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise. + * config/s390/linux-unwind.h, config/s390/linux.h: Likewise. + * config/sparc/linux-unwind.h, config/sparc/linux.h, + config/sparc/linux64.h: Likewise. + * config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge + SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state. + * config/rs6000/linux-unwind.h, config/rs6000/linux.h, + config/rs6000/linux64.h: Likewise. Split out get_sigcontext + function. Use ARG_POINTER_REGNUM for 32-bit temp reg too. + +2004-09-07 Jan Hubicka + + * cse.c (fold_rtx): Avoid building of + (CONST (MINUS (CONST_INT) (SYMBOL_REF))) + + * tree-ssa-pre.c (grand_bitmap_obstack): New. + (value_insert_into_set_bitmap, bitmap_set_new): Use the obstack. + (init_pre): Initialize obstack. + (fini_pre): Free obstack. + +2004-09-07 David Daney + + * config.gcc: Added support for --with-divide=[breaks|traps] for + mips targets. + * config/mips/mips.h (MASK_DIVIDE_BREAKS): New target_flags bit. + (TARGET_DIVIDE_TRAPS): New macro. + (TARGET_SWITCHES): Added -mdivide-traps and -mdivide-breaks. + (OPTION_DEFAULT_SPECS): Added --with-divide= support. + * config/mips/mips.c (mips_idiv_insns): Generate proper count on + GENERATE_DIVIDE_TRAPS. + (mips_output_division): Emit conditional trap if + GENERATE_DIVIDE_TRAPS is set. + * doc/install.texi: Document --with-divide. + * doc/invoke.texi: Document -mdivide-traps and -mdivide-breaks. + +2004-09-07 Caroline Tice + + * cfgrtl.c (rtl_verify_flow_info_1): Add new edge flag, + EDGE_CROSSING, to flags test case. + +2004-09-07 Jan Hubicka + + * tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Deal with '<' + class too. + +2004-09-07 Nathan Sidwell + + * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, + cfgbuild.c, inside_basic_block_p, control_flow_insn_p, + make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert + or gcc_unreachable. + * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, + remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, + alloc_aux_for_edges, free_aux_for_edges): Likewise. + * cfgcleanup.c (try_forward_edges, + merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps): Likewise. + * cfgexpand.c (expand_gimple_cond_expr, + expand_gimple_tailcall): Likewise. + * cfghooks.c (duplicate_block): Likewise. + * cfglayout.c (record_effective_endpoints, + insn_locators_initialize, change_scope, fixup_reorder_chain, + verify_insn_chain, fixup_fallthru_exit_predecessor, + duplicate_insn_chain, cfg_layout_finalize): Likewise. + * cfgloopanal.c (check_irred): Likewise. + * cfgloop.c (superloop_at_depth, flow_loops_free, + flow_loop_entry_edges_find, flow_loops_find, + flow_loop_outside_edge_p, get_loop_body, + get_loop_body_in_dom_order, get_loop_body_in_bfs_order, + get_loop_exit_edges, num_loop_branches, cancel_loop, + verify_loop_structure): Likewise. + cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, + duplicate_loop_to_header_edge, create_preheader, + create_loop_notes): Likewise. + * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, + edirect_branch_edge, force_nonfallthru_and_redirect, + rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, + commit_edge_insertions, commit_edge_insertions_watch_calls, + purge_dead_edges, cfg_layout_redirect_edge_and_branch, + cfg_layout_redirect_edge_and_branch_force, + cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. + * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, + cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, + cgraph_varpool_node): Likewise. + * cgraphunit.c (cgraph_finalize_function, + cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, + cgraph_expand_function, cgraph_remove_unreachable_nodes, + cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, + cgraph_mark_inline, cgraph_expand_all_functions, + cgraph_build_static_cdtor): Likewise. + * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, + simplify_logical, distribute_notes, insn_cuid): Likewise. + * conflict.c (conflict_graph_add, print_conflict): Likewise. + * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, + coverage_checksum_string): Likewise. + * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, + hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, + cse_cc_succs, cse_condition_code_reg): Likewise. + * cselib.c (entry_and_rtx_equal_p, remove_useless_values, + rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, + new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, + cselib_record_set): Likewise. + +2004-09-07 Jan Hubicka + + * tree-ssa-loop-ivopts.c (iv_value): Avoid invalid sharing on niter. + +2004-09-07 Nathan Sidwell + + * builtins.c (fold_builtin_strchr): Use build_int_cst, not + fold_convert. + (fold_builtin_strpbrk): Likewise. + * expr.c (array_ref_low_bound): Likewise. + * tree-scalar-evolution.c (chrec_is_positive, add_to_evolution_1, + interpret_rhs_modify_expr, number_of_iterations_in_loop): Likewise. + * tree-sra.c (generate_element_zero): Likewise. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + * tree-ssa-loop-ivopts.c (determine_biv_step, idx_find_step, + add_old_iv_candidates, add_iv_candidates): Likewise. + * tree-tailcall.c (tree_optimize_tail_calls_1): Likewise. + +2004-09-07 Nathan Sidwell + + * c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable. + * c-common.c (c_type_hash, c_common_nodes_and_builtins, + c_expand_expr, boolean_increment, nonnull_check_p, + check_function_arguments_recurse, fold_offsetof_1): Likewise. + * c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros, + builtin_define_type_max): Likewise. + * c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level, + implicit_decl_warning, builtin_function, build_compound_literal, + complete_array_type, grokdeclarator, get_parm_info, + start_function, store_parm_decls_oldstyle, + c_write_global_declarations): Likewise. + * c-format.c (get_constant, decode_format_attr, + maybe_read_dollar_number, get_flag_spec, check_format_arg, + check_format_types, format_type_warning, + find_char_info_specifier_index, init_dynamic_asm_fprintf_info, + init_dynamic_diag_info, handle_format_attribute): Likewise. + * c-gimplify.c (push_context, pop_context, finish_bc_block): + * c-lex.c (c_lex_with_flags, lex_string): Likewise. + * c-objc-common.c (c_tree_printer): Likewise. + * c-pch.c (pch_init): Likewise. + * c-pragma.c (maybe_apply_pragma_weak): Likewise. + * c-pretty-print.c (pp_c_tree_decl_identifier): Likewise. + * c-typeck.c (c_incomplete_type_error, composite_type, + common_pointer_type, common_type, same_translation_unit_p, + tagged_types_tu_compatible_p, finish_init, pop_init_level, + set_designator, set_nonincremental_init_from_string, + process_init_element, c_finish_if_stmt): Likewise. + * caller-save.c (init_caller_save, save_call_clobbered_regs, + insert_restore, insert_save, insert_one_insn): Likewise. + * calls.c (emit_call_1, compute_argument_block_size, + precompute_arguments, expand_call, emit_library_call_value_1, + store_one_arg): Likewise. + +2004-09-07 Nathan Sidwell + + * configure.ac (enable-checking): Add release option. Reorganize + to avoid repetition. + * configure: Rebuilt. + * doc/install.texi (enable-checking): Amend documentation. + +2004-09-06 H.J. Lu + + PR bootstrap/17313 + * Makefile.in (specs.ready): Depend on cc1$(exeext). + +2004-09-06 James E Wilson + + * config/mips/mips.md (movsf_hardfloat, movdf_hardfloat_64bit, + movdf_hardfloat_32bit): Split fG into two alternatives. + (movv2sf_hardfloat_64bit): Split fYG into two alternatives. + + * emit-rtl.c (try_split): Check INSN_P before may_trap_p call. + +2004-09-06 Eric Botcazou + + * final.c (output_in_slot): Delete. + (final_scan_insn): Revert 2004-09-03 change. + (output_asm_insn): Likewise. + * config/sparc/sparc.c (output_return): Likewise. + (output_sibcall): Likewise. + +2004-09-06 Jan Hubicka + + * loop.c (loop_dump_aux): Do not print RTL when not available. + * tree-ssa-loop-ivopts.c (add_standard_iv_candidates): Do not use + frontend specific type nodes. + (produce_memory_decl_rtl): Break out from ... + (prepare_decl_rtl): ... here. Handle ADDR_EXPR correctly. + (get_computation_at): Avoid random tree sharing. + (tree_ssa_iv_optimize): Verify tree sharing; dump loops. + +2004-09-06 Zack Weinberg + + * Makefile.in (rtl.o, bitmap.o): Correct dependencies, remove + unnecessary commands. + +2004-09-06 Mohan Embar + + * Makefile.in (rtl.o): Remove -DGENERATOR_FILE. + (bitmap.o): Likewise. + +2004-09-06 Paolo Bonzini + + Unify the management of RTL and tree-level dump files. + + * cfgexpand.c (tree_expand_cfg): Fix incorrect comment. + Don't print function name to the dump file, the pass manager + would do this for us. Add code from the top of + rest_of_compilation, up to the initial RTL dump. + * passes.c (rest_of_handle_jump): Call fixup_tail_calls and + close the DFI_sibling dump file. + (rest_of_compilation): Don't do that here. Remove code up to the + initial RTL dump. + (init_optimization_passes): Remove. + (pass_rest_of_compilation): Change pass name to NULL. + * toplev.c (lang_dependent_init): Do not use an empty dump file prefix. + Do not call init_optimization_passes. + * toplev.h (init_optimization_passes): Remove. + + * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, + finish_graph_dump_file): Remove SUFFIX parameter. + * graph.h (print_rtl_graph_with_bb, clean_graph_dump_file, + finish_graph_dump_file): Likewise. + + * tree-pass.h (struct tree_opt_pass): Add `letter' field. + * cfgexpand.c (pass_expand): Adjust. + * gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust. + * passes.c (pass_rest_of_compilation): Adjust. + * predict.c (pass_profile): Adjust. + * tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust. + * tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts, + pass_split_crit_edges, pass_warn_function_return): Adjust. + * tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust. + * tree-dfa.c (pass_referenced_vars): Adjust. + * tree-eh.c (pass_lower_eh): Adjust. + * tree-if-conv.c (pass_build_ssa): Adjust. + * tree-into-ssa.c (pass_build_ssa): Adjust. + * tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. + * tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. + * tree-nrv.c (pass_nrv): Adjust. + * tree-optimize.c (pass_gimple, pass_all_optimizations, + pass_cleanup_cfg_post_optimizing, pass_free_datastructures, + pass_init_datastructures): Adjust. + * tree-outof-ssa.c (pass_del_ssa): Adjust. + * tree-profile.c (pass_tree_profile): Adjust. + * tree-sra.c (pass_sra): Adjust. + * tree-ssa-alias.c (pass_may_alias): Adjust. + * tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust. + * tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust. + * tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust. + * tree-ssa-dom.c (pass_dominator): Adjust. + * tree-ssa-dse.c (pass_dse): Adjust. + * tree-ssa-forwprop.c (pass_forwprop): Adjust. + * tree-ssa-if-conv.c (pass_if_conversion): Adjust. + * tree-ssa-loop-ch.c (pass_ch): Adjust. + * tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim, + pass_loop_done, pass_complete_unroll, pass_iv_canon, + pass_iv_optimize, pass_vectorize): Adjust. + * tree-ssa-phiopt.c (pass_phiopt): Adjust. + * tree-ssa-pre.c (pass_pre, pass_fre): Adjust. + * tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized, + pass_late_warn_uninnitialized): Adjust. + * tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust. + + * Makefile.in (tree-dump.o): Add new dependencies. + * cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all. + * cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize): + Likewise. + * toplev.c (dump_file_name): New. + * tree-dump.c (dump_enable_all): Add LETTER parameter. + (struct dump_file_info): Add NUM and LETTER fields. + (dump_files): Adjust and add RTL dump files. + (dump_register): Add NUM and LETTER fields. + (get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New. + (dump_begin): Use get_dump_file_name. + (dump_switch_p_1): Adjust call to dump_enable_all. + * tree-dump.h (dump_register): Adjust prototype. + * tree-optimize.c (register_one_dump_file): Take dump file index. + Support flags for RTL dumps. + (register_dump_files): Fill in NUM field of struct dump_file_info. + Track properties both when the gate is executed and when it is not. + (execute_todo): Dump RTL. Add PROPERTIES parameter. + (execute_one_pass): Pass properties to execute_todo. Handle VCG + dumps of RTL. + * tree-pass.h (dump_file_name): New. + * tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p): + New. + + * Makefile.in (passes.o): Add new dependencies. + * passes.c (struct dump_file_info, enum dump_file_index, + dump_file_tbl, init_optimization_passes): Remove. + (open_dump_file, close_dump_file): Use tree-dumping infrastructure. + (rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use + dump_enabled_p. + (finish_optimization_passes): Update finish_graph_dump_file loop. + (enable_rtl_dump_file): Remove. + * tree-dump.c (dump_files): Adjust and add RTL dump files. + (enable_rtl_dump_file): Add here. + * tree.h (enum tree_dump_index): Add RTL dump file indices. + * doc/invoke.texi (Debugging options): Document new RTL debugging + options. Update. + +2004-09-05 Kazu Hirata + + * c-common.c, c-decl.c, combine.c, defaults.h, fold-const.c, + gimplify.c, gthr-nks.h, hooks.c, lambda-code.c, lambda-mat.c, + stor-layout.c, target.h, tree-cfg.c, tree-chrec.c, + tree-if-conv.c, tree-inline.c, tree-into-ssa.c, + tree-mudflap.c, tree-optimize.c, tree-scalar-evolution.c, + tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dce.c, + tree-ssa-pre.c, tree-vectorizer.c, tree-vectorizer.h, tree.h, + vec.h: Fix comment formatting. + +2004-09-05 Kazu Hirata + + * c-common.c, cfgexpand.c, cgraphunit.c, defaults.h, + et-forest.c, expr.c, gimplify.c, global.c, gthr-lynx.h, + hard-reg-set.h, modulo-sched.c, optabs.c, postreload-gcse.c, + tree-data-ref.c, tree-flow.h, tree-if-conv.c, tree-inline.c, + tree-sra.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, + tree-ssa-loop-niter.c, tree-ssa-operands.c, + tree-ssa-operands.h, tree-ssa-propagate.c, + tree-ssa-propagate.h, tree-ssa-threadupdate.c, value-prof.c, + vec.c, vec.h: Fix comment typos. Follow spelling conventions. + +2004-09-05 Diego Novillo + + * tree-if-conv.c (gate_tree_if_conversion): Enable only if the + vectorizer is enabled. + +2004-09-05 Andreas Jaeger + + * tree-if-conv.c: Spell check comments and clean up whitespace. + +2004-09-05 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c: New file. + * Makefile.in (tree-ssa-loop-ivopts.c): Add. + * cfgloop.h (target_avail_regs, target_res_regs, target_small_cost, + target_pres_cost, target_spill_cost): Declare. + * cfgloopanal.c (avail_regs, res_regs, small_cost, pres_cost, + spill_cost): Renamed to ... + (target_avail_regs, target_res_regs, target_small_cost, + target_pres_cost, target_spill_cost): ... and exported. + (init_set_costs, global_cost_for_size): Work with renamed variables. + * common.opt (flag_ivopts): New flag. + * expr.c (expand_expr_real_1): Handle SSA_NAME case. Handle + REF_ORIGINAL. + * gimplify.c (struct gimplify_ctx): Add into_ssa field. + (internal_get_tmp_var, gimplify_modify_expr, gimplify_expr): Support + generating SSA form. + (force_gimple_operand): New function. + * timevar.def (TV_TREE_LOOP_IVOPTS): New timevar. + * tree-cfg.c (stmt_bsi): New function. + * params.def (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND, + PARAM_IV_MAX_CONSIDERED_USES): New. + * tree-flow.h (stmt_bsi, tree_ssa_iv_optimize, split_loop_exit_edge, + bsi_insert_on_edge_immediate_loop. standard_iv_increment_position, + ip_end_pos, ip_normal_pos, force_gimple_operand): Declare. + * tree-gimple.c (is_gimple_formal_tmp_var): Accept ssa names. + * tree-nested.c (build_addr): Export. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_iv_optimize. + * tree-pass.h (pass_iv_optimize): Declare. + * tree-ssa-loop-im.c (for_each_index): Handle REALPART_EXPR and + IMAGPART_EXPR. + * tree-ssa-loop-manip.c (create_iv): Force the base to be acceptable + as a phi node argument. + (split_loop_exit_edge, bsi_insert_on_edge_immediate_loop, + ip_end_pos, ip_normal_pos, standard_iv_increment_position): New + functions. + * tree-ssa-loop-niter.c (zero_p, unsigned_type_for): Export. + * tree-ssa-loop.c (tree_ssa_loop_ivopts, gate_tree_ssa_loop_ivopts, + pass_iv_optimize): New pass. + * tree-ssa-operands.c (get_indirect_ref_operands): Handle REF_ORIGINAL. + * tree-ssanames.c (release_ssa_name): Allow calling with var = NULL. + * tree.c (build_int_cst_type, cst_and_fits_in_hwi): New functions. + * tree.h (REF_ORIGINAL): New macro. + (build_int_cst_type, unsigned_type_for, zero_p, + cst_and_fits_in_hwi, build_addr): Declare. + * doc/invoke.texi (-fivopts): Document. + (PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND, + PARAM_IV_MAX_CONSIDERED_USES): Document. + * doc/passes.texi: Document induction variable optimizations pass. + +2004-09-04 Kaveh R. Ghazi + + * builtin-attrs.def (ATTR_NOTHROW_SENTINEL_1): New. + * builtins.def (BUILT_IN_EXECLE): Set ATTR_NOTHROW_SENTINEL_1. + * c-common.c (c_common_attribute_table): Accept parameters to + sentinel attribute. + (check_function_sentinel, handle_sentinel_attribute): Likewise. + * doc/extend.texi: Update accordingly. + +2004-09-04 Kaveh R. Ghazi + + * builtin-attrs.def (ATTR_SENTINEL, ATTR_SENTINEL_NOTHROW_LIST): + New. + * builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP): Add `sentinel' + attribute. + * c-common.c (handle_sentinel_attribute, check_function_sentinel): + New functions. + (c_common_attribute_table): Add `sentinel' attribute. + (check_function_arguments): Handle `sentinel' attribute. + * doc/extend.texi: Document `sentinel' attribute. + +2004-09-04 H.J. Lu + + * configure: Regenerated. + +2004-09-04 Richard Kenner + + * gimplify.c (internal_get_tmp_var): Remove unused var CLASS. + + * tree.c (save_expr): No longer TREE_READONLY. + +2004-09-04 Jan Hubicka + + * passes.c (rest_of_clean_state): Fix merge conflict made during + commiting the patch. + +2004-09-04 Jan Hubicka + + * passes.c (rest_of_clean_state): Decompose the instruction stream. + +2004-09-04 Richard Sandiford + + * doc/md.texi (shift patterns): New anchor. Add reference to + TARGET_SHIFT_TRUNCATION_MASK. + * doc/tm.texi (TARGET_SHIFT_TRUNCATION_MASK): Document. + * target.h (shift_truncation_mask): New target hook. + * targhook.h (default_shift_truncation_mask): Declare. + * targhook.c (default_shift_truncation_mask): Define. + * target-def.h (TARGET_SHIFT_TRUNCATION_MASK): Define. + (TARGET_INITIALIZER): Include it. + * simplify-rtx.c (simplify_binary_operation): Combine ASHIFT, ASHIFTRT + and LSHIFTRT cases. Truncate arg1 if SHIFT_COUNT_TRUNCATED, otherwise + reject all out-of-range values. Fix sign-extension code for modes + whose width is smaller than HOST_BITS_PER_WIDE_INT. + * optabs.c (simplify_expand_binop, force_expand_binop): New functions. + (expand_superword_shift, expand_subword_shift): Likewise. + (expand_doubleword_shift_condmove, expand_doubleword_shift): Likewise. + (expand_binop): Use them to implement double-word shifts. + * config/arm/arm.c (arm_shift_truncation_mask): New function. + (TARGET_SHIFT_TRUNCATION_MASK): Define. + +2004-09-04 Jan Hubicka + + * tree.c (iterate_hash_expr): Optimize, avoid use of iterative_hash_object. + (mix): New macro copied from hashtab.c + (iterative_hash_hashval_t, iterative_hash_pointer, + iterative_hash_host_wide_int): New functions based on hashtab.c + implementation. + +2004-09-04 Richard Sandiford + + * config/mips/mips.md (mask): New mode attribute. + (zero_extendsidi2): Add memory alternative. + (*zero_extendsidi2_mem): Delete. + (zero_extend[qh]i[sd]i2): Redefine using :GPR and :SHORT. Use + memory_operand in the TARGET_MIPS16 check. + (*zero_extend[qh]i[sd]i2{,_mips16}): Name previously unnamed patterns. + Redefine using :GPR and :SHORT. + (zero_extendqihi2): Use memory_operand in the TARGET_MIPS16 check. + +2004-09-04 Uros Bizjak + + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_RINT{,F,L} + using rint_optab. + (expand_builtin): Expand BUILT_IN_RINT{,F,L} using + expand_builtin_mathfn. + * genopinit.c (optabs): Rename trunc_optab to btrunc_optab. Use + btrunc?f patterns for btrunc_optab. Implement rint_optab using + rint?f patterns. + * optabs.c (init_optabs): Initialize rint_optab. + * optabs.h (enum optab_index): Rename OTI_trunc to OTI_btrunc. + Add new OTI_rint. + (btrunc_optab): Rename macro from trunc_optab. + (rint_optab): Define corresponding macro. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FRNDINT_FLOOR, + UNSPEC_FRNDINT_CEIL, UNSPEC_FRNDINT_TRUNC, UNSPEC_FRNDINT_MASK_PM. + + * config/i386/i386-protos.h (emit_i387_cw_initialization): + Change prototype. Add new int parameter. + * config/i386/i386.c (emit_i387_cw_initialization): + Handle new rounding modes. + + * config/i386/i386.h (enum fp_cw_mode): Delete. + (MODE_NEEDED): Handle new rounding modes. + (EMIT_MODE_SET): Change condition to handle new rounding modes. + + * config/i386/i386.md (UNSPEC_FRNDINT_FLOOR, UNSPEC_FRNDINT_CEIL, + UNSPEC_FRNDINT_TRUNC, UNSPEC_FRNDINT_MASK_PM): New unspecs to + represent different rounding modes of frndint insn. + (type): Add frndint type. + (i387, length, memory): Handle this type. + (i387_cw): New attribute definition. + (*fix_truncdi_1, fix_truncdi_nomemory, fix_truncdi_memory, + *fix_truncsi_1, fix_truncsi_nomemory, fix_truncsi_memory, + *fix_trunchi_1, fix_trunchi_nomemory, fix_trunchi_memory): + Add "i387_cw" attribute defined to "trunc". + (x86_fnstcw_1): Remove comment. + (*frndintxf2): Rename insn definition to frndintxf2. Move + insn definition near rint?f2 expanders. + (rintdf2, rintsf2, rintxf2): New expanders to implement rint, + rintf and rintl built-ins as inline x87 intrinsics. + (frndintxf2_floor): New pattern to implement floor rounding + mode with frndint x87 instruction. + (floordf2, floorsf2, floorxf2): New expanders to implement floor, + floorf and floorl built-ins as inline x87 intrinsics. + (frndintxf2_ceil): New pattern to implement ceil rounding + mode with frndint x87 instruction. + (ceildf2, ceilsf2, ceilxf2): New expanders to implement ceil, + ceilf and ceill built-ins as inline x87 intrinsics. + (frndintxf2_trunc): New pattern to implement trunc rounding + mode with frndint x87 instruction. + (btruncdf2, btruncsf2, btruncxf2): New expanders to implement trunc, + truncf and truncl built-ins as inline x87 intrinsics. + (frndintxf2_mask_pm): New pattern to implement rounding + mode with exceptions with frndint x87 instruction. + (nearbyintdf2, nearbyintsf2, nearbyintxf2): New expanders to + implement nearbyint, nearbyintf and nearbyintl built-ins as + inline x87 intrinsics. + +2004-09-04 Richard Sandiford + + * config/mips/mips.md (SHORT): New mode macro. + (size): New mode attribute. + (extend[qh]i[sd]i2): Redefine using :GPR and :SHORT. + (*extend[qh]i[sd]i2): New define_insn_and_split, combining previous + *extend[qh]i[sd]i2 and *extend[qh]i[sd]i2_mem patterns. Use only if + !ISA_HAS_SEB_SEH. + (*extend[qh]i[sd]i2_se[bh]): New pattern, combining previous + *extend[qh]isi2_hw patterns and extending them to di. + (extendqihi2): Implement as define_insn_and_split that produces + extendqisi2 after reload. + +2004-09-03 Devang Patel + + * Makefile.in (OBJS-common): Add tree-if-conv.o + (tree-if-conv.o): New rule. + * cfgloop.c (flow_loop_exit_edges_find): Set EDGE_LOOP_EXIT flag. + (get_loop_body_in_bfs_order): New. + * cfgloop.h (get_loop_body_in_bfs_order): New. + * tree-flow.h (enum move_pos): Move here from .. + * tree-ssa-loop-im.c (enum move_pos): here. + (movement_possibility): Make externally visible. + * tree-optimize.c (init_tree_optimization_passes): New entry for + if conversion pass. + * tree-pass.h (pass_if_conversion): New. + * tree-ssa-operands.c (get_expr_operands): Handle COND_EXPR. + * tree-if-conv.c: New file. + * doc/passes.texi: Document tree if-conversion pass. + * doc/tree-ssa.texi: Same. + +2004-09-03 H.J. Lu + + PR target/14925: + Makefile.in (LIB2ADDEHSTATIC): New. + (LIB2ADDEHSHARED): New. + (LIBUNWIND): New. + (LIBUNWINDDEP): New. + (SHLIBUNWIND_LINK): New. + (SHLIBUNWIND_INSTALL): New. + (libgcc.mk): Pass LIB2ADDEHSTATIC, LIB2ADDEHSHARED, LIBUNWIND, + LIBUNWINDDEP, SHLIBUNWIND_LINK and SHLIBUNWIND_INSTALL. + (clean): Remove libunwind* + (stage1-start): Remove and copy stage1/libunwind*. + (stage2-start): Remove and copy stage2/libunwind*. + (stage3-start): Remove and copy stage3/libunwind*. + (stage4-start): Remove and copy stage4/libunwind*. + (stageprofile-start): Remove and copy stageprofile/libunwind*. + (stagefeedback-start): Remove and copy stagefeedback/libunwind*. + + * config.gcc (ia64*-*-linux*): Always add t-libunwind to + tmake_file. Add t-libunwind-elf and ia64/t-glibc-libunwind to + tmake_file if --with-system-libunwind isn't used. + + * config/ia64/t-glibc-libunwind: New file. + * config/t-libunwind-elf: Likewise. + * unwind-compat.c: Likewise. + * unwind-compat.h: Likewise. + * unwind-dw2-fde-compat.c: Likewise. + + * config/ia64/t-glibc (LIB2ADDEH): Updated. + * config/ia64/t-hpux (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. + + * config/ia64/unwind-ia64.c: Include "unwind-compat.h". Define + aliases if needed. + * unwind-dw2-fde-glibc.c: Likewise. + * unwind-dw2.c: Likewise. + + * config/t-libunwind (LIB2ADDEH): Updated. + (LIB2ADDEHSTATIC): New. + (T_CFLAGS): Add -DUSE_LIBUNWIND_EXCEPTIONS. + (TARGET_LIBGCC2_CFLAGS): Set to -DUSE_GAS_SYMVER. + + * configure.ac: Change --enable-libunwind-exceptions to + --with-system-libunwind. Don't define USE_LIBUNWIND_EXCEPTIONS. + * configure: Regenerated. + * config.in: Updated. + + * doc/install.texi (ia64-*-linux): Require libunwind 0.98 or + above and mention --with-system-libunwind. + (ia64-*-hpux*): Mention --enable-libunwind-exceptions is + removed in gcc 3.4.3 and later. + + * gcc.c (init_spec): Add -lunwind to -lgcc_s if + USE_LIBUNWIND_EXCEPTIONS is defined. + + * mklibgcc.in: Support libunwind. + +2004-09-03 H.J. Lu + + * config/i386/i386.c (x86_branch_hints): Remove m_PENT4 and + m_NOCONA. + +2004-09-03 Richard Henderson + + PR middle-end/9997 + * cfgexpand.c (LOCAL_ALIGNMENT): Provide default. + (STACK_ALIGNMENT_NEEDED, FRAME_GROWS_DOWNWARD): Likewise. + (struct stack_var, EOC, stack_vars, stack_vars_alloc, stack_vars_num, + stack_vars_sorted, stack_vars_conflict, stack_vars_conflict_alloc, + frame_phase, get_decl_align_unit, add_stack_var, triangular_index, + resize_stack_vars_conflict, add_stack_var_conflict, + stack_var_conflict_p, add_alias_set_conflicts, stack_var_size_cmp, + union_stack_vars, partition_stack_vars, dump_stack_var_partition, + expand_one_stack_var_at, expand_stack_vars, expand_one_stack_var, + expand_one_static_var, expand_one_hard_reg_var, + expand_one_register_var, expand_one_error_var, defer_stack_allocation, + expand_one_var, expand_used_vars_for_block, clear_tree_used): New. + (expand_used_vars): Rewrite. + * Makefile.in (cfgexpand.o): Update dependencies. + +2004-09-04 Jan Hubicka + + * cfg.c (free_edge): Use ggc_free. + (expunge_block): Use ggc_free. + * passes.c (rest_of_clean_state): Free after compilation. + * tree-ssa.c (delete_tree_ssa): Free annotations; call release_defs + * tree-ssanames.c (release_defs): Ignore non-SSA_NAME arguments. + +2004-09-03 James E Wilson + + * tree-ssa-alias.c (may_be_aliased): Move TREE_STATIC check after + DECL_EXTERNAL check. + +2004-09-03 Eric Botcazou + + * final.c (output_in_slot): New global variable. + (final_scan_insn): Add new state '2' to the 'nopeepholes' parameter. + Pass 2 as 'nopeepholes' to self for insns in a SEQUENCE. Set + 'output_in_slot' before invoking output_asm_insn. + (output_asm_insn): Add a space after the tab if 'output_in_slot' + is set. + * config/sparc/sparc.c (output_return): Pass 2 as 'nopeepholes' to + final_scan_insn. + (output_sibcall): Likewise. + +2004-09-03 Jan Hubicka + + * tree-ssa-operands.c (fini_ssa_operands): ggc_free unused arrays. + * tree-ssanames (init_ssanames): Likewise. + +2004-09-03 Ziemowit Laski + + * stub-objc.c (objc_is_id, objc_declare_alias, objc_declare_class, + objc_declare_protocols, objc_start_protocol, + objc_start_class_interface, objc_start_category_interface, + objc_continue_interface, objc_finish_interface, + objc_add_instance_variable, objc_set_visibility, objc_set_method_type, + objc_start_class_implementation, objc_start_category_implementation, + objc_continue_implementation, objc_finish_implementation, + objc_add_method_declaration, objc_start_method_definition, + objc_finish_method_definition, objc_build_keyword_decl, + objc_build_method_signature, objc_build_encode_expr, + objc_build_protocol_expr, objc_build_selector_expr, + objc_build_message_expr, objc_build_string_object, + objc_get_class_reference, objc_get_protocol_qualified_type, + objc_static_init_needed_p, objc_generate_static_init_call): New stubs. + +2004-09-03 James E Wilson + + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips3d. + + * config/mips/generic.md (generic_frecip_fsqrt_step): New. + * config/mips/mips-ps-3d.md (mips_rsqrt1_): Use frsqrt1 type. + (mips_rsqrt2_): Use frsqrt2 type. + (mips_recip1_): Use frdiv1 type. + (mips_recip2_): Use frdiv2 type. + * config/mips/mips.md (type): Add frdiv1, frdiv2, frsqrt1, frsqrt2. + * config/mips/sb1.md (ir_sb1_fpu_2pipes, ir_sb1_fpu_1pipe): Add frdiv1 + and frsqrt1. + (ir_sb1_fpu_step2_2pipes, ir_sb1_fpu_step2_1pipe): New. + +2004-09-03 Daniel Jacobowitz + + * reload.c (find_reloads): Swap operand_loc pointers for + find_dummy_reload if we have swapped two operands. + +2004-09-03 Hans-Peter Nilsson + + * config/cris/cris.h (ASM_OUTPUT_CASE_END): Use prev_nonnote_insn + to get the tablejump-insn before the jump-table label. + +2004-09-03 Ziemowit Laski + + * c-common.h (objc_is_id, objc_declare_alias, objc_declare_class, + objc_declare_protocols, objc_build_message_expr, + objc_finish_message_expr, objc_build_selector_expr, + objc_build_protocol_expr, objc_build_encode_expr, + objc_build_string_object, objc_get_protocol_qualified_type, + objc_get_class_reference, objc_get_class_ivars, + objc_start_class_interface, objc_start_category_interface, + objc_start_protocol, objc_continue_interface, objc_finish_interface, + objc_start_class_implementation, objc_start_category_implementation, + objc_continue_implementation, objc_finish_implementation, + objc_set_visibility, objc_set_method_type, objc_build_method_signature, + objc_add_method_declaration, objc_start_method_definition, + objc_finish_method_definition, objc_add_instance_variable, + objc_build_keyword_decl, objc_build_throw_stmt, objc_begin_try_stmt, + objc_finish_try_stmt, objc_begin_catch_clause, + objc_finish_catch_clause, objc_build_finally_clause, + objc_build_synchronized, objc_static_init_needed_p, + objc_generate_static_init_call): New prototypes. + +2004-09-03 Steve Ellcey + + * config/ia64/ia64.c (ia64_function_arg): Use PARALLEL even if there + is only one reg. + (ia64_function_value): Ditto. + +2004-09-03 Jan Beulich + + * config.gcc: Resurrect NetWare as a target. Handle special case of + Novell linker to be used (specified through --with-ld=) and threading + model of either Posix (default) or NKS. + * config/i386/i386.c (ix86_return_pops_args): Conditionalize popping + of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER. + * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New. + * config/i386/netware.c, config/i386/netware.h: New. + * config/i386/nwld.c, config/i386/nwld.h: New. + * config/i386/netware-crt0.c: New. + * config/i386/netware-libgcc.c: New. + * config/i386/netware-libgcc.def: New. + * config/i386/netware-libgcc.exp: New. + * config/i386/t-netware, config/i386/t-nwld: New. + * gthr-nks.h: New. + * doc/install.texi: Document NKS threading model. + +2004-09-03 Jan Beulich + + PR c/7054 + * defaults.h (TARGET_DEFAULT_PACK_STRUCT): Provide default. + * tree.h (initial_max_fld_align): Declare + * stor-layout.c (initial_max_fld_align): Define and initialize. + (maximum_field_alignment): Initialize to the same value. + * common.opt: Add -fpack-struct= variant of switch. + * opts.c: Handle -fpack-struct= variant of switch. + * c-pragma.c: Change #pragma pack() handling so that it becomes + compatible to other compilers: accept individual 'push' argument, + make final pop restore (command line) default, correct interaction + of push/pop and sole specification of a new alignment (so that the + sequence #pragma pack(push) - #pragma pack() becomes identical + to #pragma pack(push, ). + * doc/extend.texi: New node "Structure-Packing Pragmas" under + "Pragmas", describing #pragma pack. + * doc/invoke.texi: Document -fpack-struct= variant of switch. + * doc/tm.texi: Adjust description for HANDLE_PRAGMA_PACK_PUSH_POP. + Document new TARGET_DEFAULT_PACK_STRUCT. + +2004-09-03 Devang Patel + + * dwarf2out.c (gen_field_die). Equate decl number to die. + +2004-09-03 Vladimir Makarov + + PR target/15832 + * global.c (modify_reg_pav): New function. + (make_accurate_live_analysis): Call the new function. Move pavin + modification by earlyclobber set into the new function. + +2004-09-03 Andreas Schwab + + * config/m68k/m68k.c (output_andsi3): Use -1 instead of + (HOST_WIDE_INT)0xffffffff since CONST_INT value are always sign + extended. + +2004-09-02 Jan Beulich + + * Makefile.in (LIB2ADDEHDEP): Add unwind.h and unwind-pe.h. + * mklibgcc.in (libgcc_dep): New, covering general dependencies, but + not unwind code specific ones. + (libgcc2_c_dep): Replace general dependencies with use of libgcc_dep. + Remove unwind code specific dependencies. + (libgcov_c_dep): Replace general dependencies with use of libgcc_dep. + Remove gbl-ctors.h. + Add libgcc_dep to output generated for LIB2ADD, LIB2ADDEH, and + LIB2ADD_ST. Add LIB2ADDEHDEP to output generated for LIB2ADDEH. + * tsystem.h: Declare memcpy and memset when inhibit_libc. + +2004-09-02 Roman Zippel + + * combine.c (try_combine): Delay modifying of insns which cannot + be easily undone. + +2004-09-02 Daniel Berlin + + * common.opt: Rename ivcanon to tree-loop-ivcanon, tree-lim to + tree-loop-im. + * tree-ssa-loop.c: Ditto + * tree-ssa-loop-ivcanon.c: Ditto + * doc/invoke.texi: Ditto. + +2004-09-02 Ziemowit Laski + + * c-decl.c (store_parm_decls_newstyle): Make static. + (store_parm_decls_from): New function. + * c-tree.h (store_parm_decls_newstyle): Remove prototype. + (store_parm_decls_from): New prototype. + +2004-09-02 David Edelsohn + + * config/rs6000/rs6000.c (expand_block_move): Use SImode and + HImode with STRICT_ALIGNMENT. + +2004-09-02 Mark Mitchell + + * config/arm/bpabi.h (TARGET_BPABI_CPP_BUILTINS): Define. + (TARGET_OS_CPP_BUILTINS): Likewise. + * config/arm/symbian.h (TARGET_OS_CPP_BUILTINS): Include + TARGET_BPABI_CPP_BUILTINS. + +2004-09-02 Roman Zippel + + * combine.c (distribute_notes): Don't add REG_LABEL to jump insn. + +2004-09-02 Eric Christopher + + * builtins.c (expand_builtin_cabs): Delete. + (expand_builtin): If unable to fold the values do a normal + library call for builtin_cab*. + (fold_builtin_cabs): Depend on optimize and optimize_size. + * optabs.c (expand_cmplxdiv_straight): Delete. + (expand_cmplxdiv_wide): Ditto. + (expand_vector_binop): Ditto. + (expand_vector_unop): Ditto. + (expand_complex_abs): Delete. + (expand_binop): Remove calls to above functions. + Remove open coding of complex arithmetic. + (expand_unop): Ditto. + * optabs.h: Remove prototypes. + +2004-09-02 Ziemowit Laski + + * c-decl.c (store_parm_decls_newstyle): Make externally visible. + * c-tree.h (store_parm_decls_newstyle): New prototype. + +2004-09-02 Geoffrey Keating + + * config/rs6000/rs6000.c (expand_block_clear): Use vector + instructions if available. + (expand_block_move): Likewise. + +2004-09-03 Jan Hubicka + + * rtl.def (RANGE_INFO, RANGE_REG, RANGE_VAR, RANGE_LIVE): Kill. + +2004-09-02 Mark Mitchell + + * config/arm/symbian.h (LIB_SPEC): Define to empty. + * config/arm/t-symbian (SHLIB_LC): Likewise. + +2004-09-02 Paul Brook + + * config/arm/bpabi.c (__aeabi_ul2d, __aeabi_ul2f): Remove. + +2004-09-02 Richard Sandiford + + * config/mips/mips.c (mips_classify_symbol, mips_fetch_insns): + (mips_restore_gp, mips_set_return_address, mips_expand_prologue) + (mips16_fp_args, mips_avoid_hazard): Replace abort with gcc_assert. + (build_mips16_call_stub): Likewise. Remove daft CALL_INSN checks. + (mips_issue_rate): Remove unreachable abort. + (mips_symbolic_constant_p, mips_symbolic_address_p, mips_symbol_insns) + (mips_output_move, mips_relational_operand_ok_p, mips_arg_info) + (mips_block_move_straight, print_operand_address, mips_file_start) + (mips_initial_elimination_offset, mips16_fp_args, dump_constants_1) + (mips_output_conditional_branch, mips_expand_builtin_direct) + (mips_expand_builtin_compare): Replace abort with gcc_unreachable. + * config/mips/mips.md (rotr3, consttable_float): Replace abort + with gcc_assert. + +2004-09-02 Richard Sandiford + + * config/mips/mips.md (*lea_high64): Change split condition to + flow2_completed. Add a peephole2 to generate a more parallel version. + +2004-09-02 Jan Hubicka + + * gimplify.c (gimplify_compound_lval): Move "stack" varray out of + GGC. + + * ggc-page.c: include tree-flow.h. + (extra_order_size_table): Add stmt_ann_d. + (STAT_LABEL): Rename from .... + (LABEL): ... this one. + * Makefile.in (ggc-page.o): Add dependency. + + * ggc-common.c (ggc_force_collect): New global variable. + (loc_description): Add fields "freed", "collected" + (ptr_hash): New static hash + (ptr_hash_entry): New structure. + (hash_ptr,eq_ptr,ggc_prune_ptr): New static functions. + (ggc_record_overhead): Take ptr argument, record it + (ggc_prune_overhead_list, ggc_free_overhead): New functions. + (cmp_statistics): Imrove sorting. + (dump_ggc_loc_statistics): Output newly collected statistics + * ggc-page.c (ggc_alloc): Update call of ggc_record_overhead + (ggc_free): Call ggc_free_overhead. + (ggc_collect): Force collection when asked to be forced. + (ggc_collect): Call ggc_prune_overhead_list. + * ggc.h (ggc_force_collect): Declare + (ggc_record_overhead): Update prototype. + (ggc_free_overhead, ggc_prune_overhead_list): Declare. + +2004-09-02 James E Wilson + + * common.opt (ftrapping-math): Default to on. + +2004-09-02 Richard Earnshaw + + * arm/predicates.md (arm_reload_memory_operand): Allow MEM. + +2004-09-02 Denis Chertykov + + PR target/16884 + * config/avr/avr.md ("movmemhi"): Substitute match_dup to + match_scratch. + (*movmemqi_insn): Likewise. + (*movmemhi): Likewise. + (clrmemhi): Likewise. + (*clrmemqi): Likewise. + (*clrmemhi): Likewise. + +2004-09-02 Paul Brook + + * config.gcc (arm*-*-eabi* | arm*-*-symbianelf*): Set + default_use_cxa_atexit=yes. + +2004-09-02 Alan Modra + + * config/rs6000/linux64.h: Don't include signal.h or sys/ucontext.h. + (struct kernel_old_ucontext): Delete. + (struct gcc_pt_regs, gcc_sigcontext, gcc_ucontext): New. + (MD_FALLBACK_FRAME_STATE_FOR): Use gcc_* structs. Only define + when IN_LIGGCC2. + +2004-09-02 Richard Sandiford + + * toplev.c (process_options): Fix typo. + +2004-09-01 Richard Henderson + + PR middle-end/17258 + * calls.c (initialize_argument_information): Tighten pass-through + conditions for pass-by-reference. Remove dead TARGET_EXPR code. + Use build_fold_addr_expr. + (emit_library_call_value_1): Use build_fold_addr_expr. Remove code + that assumes ADDR_EXPR allocates stack space. + * fold-const.c (build_fold_addr_expr_with_type): Look through + WITH_SIZE_EXPR. + +2004-09-01 Dan Nicolaescu + + * gengenrtl.c (gendef): Use rtx_alloc, don't do PUT_CODE. + * ggc.h (ggc_alloc_rtx): Delete. + +2004-09-01 Roger Sayle + + * expmed.c (enum alg_code): Remove long unused enumeration values. + (struct mult_cost): New structure to hold the "score" of a synthetic + multiply sequence, including both a rtx_cost and a latency field. + (MULT_COST_LESS): New macro to compare mult_cost to a constant. + (CHEAPER_MULT_COST): New macro to compare two mult_costs. + (struct algorithm): Change type of cost field to be mult_cost. + (synth_mult): Change type of cost_limit argument to be a + pointer to a mult_cost. Update all cost comparisons to use the + new mult_cost infrastructure. For alg_add_factor and + alg_sub_factor operations, latency is lower than the rtx_cost. + (choose_mult_variant): Update calls to synth_mult. Perform + cost comparisons using the new mult_cost infrastructure. + (expand_mult_highpart): Use alg.cost.cost instead of alg.cost + to optain the total rtx_cost of a synth_mult "algorithm". + +2004-09-01 David Edelsohn + + * config/rs6000/power4.md: Increase store latency to 12. + * config/rs6000/power5.md: Same. + +2004-09-01 James E Wilson + + PR target/14064 + * config/avr/avr.c (avr_unique_section): Delete prototype and + definition. + (TARGET_ASM_UNIQUE_SECTION): Delete. + +2004-09-01 Ziemowit Laski + + * c-parse.in (primary): Call objc_build_message_expr(), + objc_build_selector_expr(), objc_build_protocol_expr(), + objc_build_encode_expr() and objc_build_string_object() instead of + build_message_expr(), build_selector_expr(), build_protocol_expr(), + build_encode_expr() and build_objc_string_object(), respectively. + (component_decl_list2): Call objc_get_class_ivars() instead of + get_class_ivars_from_name(). + (keyworddecl): Call objc_build_keyword_decl() instead of + build_keyword_decl(). + (receiver): Call objc_get_class_reference() instead of + get_class_reference(). + (reswords): Add blank line before @@ifobjc section, for clarity. + +2002-09-01 Fariborz Jahanian + + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Restrict alignment + to Altivec vetors. + +2004-09-01 Wu Yongwei + Danny Smith + + * gthr-win32.h (__gthread_recursive_mutex_t): Use 'unsigned long', + not Windows 'DWORD'. + (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Correct typo. + (__GTHREAD_RECURSIVE_MUTEX_INIT_DEFAULT): Likewise. + (__gthr_win32_recursive_mutex_init_function): Add prototype for + __GTHREAD_HIDE_WIN32API case.. + (__gthr_win32_recursive_mutex_lock): Likewise. + (__gthr_win32_recursive_mutex_trylock): Likewise. + (__gthr_win32_recursive_mutex_unlock): Likewise. + (__gthread_recursive_mutex_init_function); Add definition for + __GTHREAD_HIDE_WIN32API case. + (__gthread_recursive_mutex_lock): Correct call to InterlockedDecrement. + * config/i386/grthr-win32.c (__gthread_recursive_mutex_lock): Correct + call to InterlockedDecrement. + +2004-09-01 Richard Kenner + + * tree-tailcall.c (find_tail_calls): Also fail is statement has + volatile operands. + + * tree-ssa.c (propagate_into_addr): Properly test for LHR. + + * doc/c-tree.texi: Document new operands for ARRAY_REF and + COMPONENT_REF. + +2004-09-01 Zdenek Dvorak + + * Makefile.in (rtl-profile.o, value-prof.o): Add GCC_H dependency. + * common.opt (fspeculative-prefetching): New. + * flags.h (flag_speculative_prefetching_set): Declare. + * gcov-io.c (gcov_write_counter, gcov_read_counter): Allow negative + values. + * opts.c (flag_sepculative_prefetching_set): New variable. + (common_handle_option): Handle -fspeculative-prefetching. + * passes.c (rest_of_compilation): Ditto. + * profile.c (instrument_values, compute_value_histograms, branch_prob): + Use vectors instead of arrays. + * toplev.c (process_options): Handle -fspeculative-prefetching. + * rtl-profile.c: Include ggc.h. + (rtl_gen_interval_profiler, rtl_gen_pow2_profiler, + rtl_gen_one_value_profiler_no_edge_manipulation, + rtl_gen_one_value_profiler, rtl_gen_const_delta_profiler): Type of + argument changed. + * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler, + tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Type of + argument changed. + * value-prof.c: Include ggc.h. + (NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX): New + macros. + (insn_prefetch_values_to_profile, find_mem_reference_1, + find_mem_reference_2, find_mem_reference, gen_speculative_prefetch, + speculative_prefetching_transform): New. + (value_profile_transformations): Call speculative_prefetching_transform. + (insn_values_to_profile): Call insn_prefetch_values_to_profile. + (insn_divmod_values_to_profile, rtl_find_values_to_profile, + tree_find_values_to_profile, find_values to profile): Use vectors + instead of arrays. + (free_profiled_values): Removed. + * value-prof.h (struct histogram_value): Renamed to + struct histogram_value_t. + (histogram_value, histogram_values): New types. + (find_values_to_profile): Declaration changed. + (free_profiled_values): Removed. + (struct profile_hooks): Type of argument of the hooks changed to + histogram_value. + * doc/invoke.texi (-fspeculative-prefetching): Document. + +2004-09-01 Zdenek Dvorak + + PR rtl-optimization/16408 + * gcse.c (replace_store_insn): Fix LIBCALL/RETVAL notes. + +2004-09-01 Richard Henderson + + * config/ns32k/ns32k.h (TRANSFER_FROM_TRAMPOLINE): Remove. + (TRAMPOLINE_TEMPLATE): Merge code from __trampoline inline. + +2004-09-01 Jakub Jelinek + + * libgcc-std.ver (GCC_3.4.2): Export also __trampoline_setup. + +2004-09-01 Mike Stump + + * config/darwin.c (machopic_symbol_defined_p): In addition to + being SYMBOL_REF_LOCAL_P, a symbol must also be + ! SYMBOL_REF_EXTERNAL_P, as only those are _always_ locally + defined in this output file, or translation unit in the case + of IMA not being used. + (machopic_output_indirection): SYMBOL_REF_LOCAL_P symbols + never need .indirect_symbol when indirecting. + +2004-09-01 Jakub Jelinek + + * Makefile.in (bb-reorder.o): Add several dependencies. + +2004-09-01 Jakub Jelinek + + * fold-const.c (operand_equal_p): Require equal sign also for + FIX_{CEIL,TRUNC,FLOOR,ROUND}_EXPR. + +2004-09-01 Richard Earnshaw + + * config.gcc (--with-cpu on ARM): Preserve the canonical cpu name + for use in configargs.h. Put the cname in a separate variable. Use + that to set target_cpu_default2. + +2004-09-01 J"orn Rennecke + Nick Clifton + + * config/sh/sh.md ("length"): Increase branch length when + SH1 pic code to 18: 12 bytes of instructions, 4 byte for the + constant, 2 byte for aligning the constant. + +2004-09-01 Richard Earnshaw + + * arm/arm-cores.def (ARM_CORE): Add new field for the real name of the + CPU. + (arm7tdmi-s): New CPU name. + * arm/arm.c (ARM_CORE): Update for new format. + * arm/arm.h (ARM_CORE): Likewise. + * arm/gentune.sh: Update for extra field. + * config.gcc: Likewise. + * arm/arm-tune.md: Regenerate. + * doc/invoke.texi: Document the real processor names for ARM cpus. + +2004-09-01 Richard Earnshaw + + * arm/ieee754-df.S (aeabi_ul2d, aeabi_l2d, floatundidf) + (floatdidf): New functions. + * arm/ieee754-sf.S (aeabi_ul2f, aeabi_l2f, floatundisf) + (floatdisf): New functions. + * t-arm-elf: Use them. + +2004-09-01 Ziemowit Laski + + * c-common.h (lookup_interface): Remove prototype. + (is_class_name): Rename to objc_is_class_name. + (lookup_objc_ivar): Rename to objc_lookup_ivar. + (get_current_scope): Rename to objc_get_current_scope. + * c-decl.c (get_current_scope): Rename to objc_get_current_scope. + * c-parse.in (parmlist_or_identifiers_1): Get rid of unused variable. + (yylexname): Call objc_is_class_name() instead of is_class_name(). + * c-typeck.c (build_external_ref): Call objc_lookup_ivar() + instead of lookup_objc_ivar(). + * stub-objc.c (lookup_interface): Remove stub. + (is_class_name): Rename to objc_is_class_name. + (lookup_objc_ivar): Rename to objc_lookup_ivar. + +2004-08-31 Mark Mitchell + + * config.gcc (arm*-*-symbianelf*): Do not include t-bpabi. + * config/arm/lib1funcs.asm: Do not include supplemental .S files + when compiling for Symbian. + * config/arm/symbian.h (RENAME_LIBRARY): New macro. + (TARGET_OS_CPP_BUILTINS): Likewise. + * config/arm/t-symbian (LIB1ASMFUNCS): Define. + +2004-08-31 Stan Shebs + + * toplev.c (process_options): Ensure debug_hooks is initialized. + +2004-08-31 Mark Mitchell + + * target-def.h (TARGET_CXX): Add TARGET_CXX_EXPORT_CLASS_DATA. + * target.h (cxx): Add export_class_data. + * config/arm/arm.c (arm_cxx_export_class_data): New function. + (TARGET_CXX_EXPORT_CLASS_DATA): Use it. + * doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Document it. + +2004-08-31 Kaz Kojima + + * config/sh/sh.c (output_branch): Check the insn length possibly + in the delayed slot. + +2004-08-31 Richard Kenner + + * tree-pretty-print.c (dump_generic_node, case CONVERT_EXPR): Add + blank after ')'. + (op_symbol, case *_{DIV,MOD}_EXPR): Say what rounding is being used. + + * c-common.c (c_alignof_expr): Use DECL_ALIGN_UNIT and TYPE_ALIGN_UNIT. + (c_sizeof_of_alignof_type): Likewise. + * expr.c (array_ref_element_size): Likewise. + (highest_pow2_factor_for_target): Likewise. + * gimplify.c (canonicalize_addr_expr): Likewise. + (gimplify_compound_lval): Likewise. + * stor-layout.c (finalize_record_size, finalize_type_size): Likewise. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. + * varasm.c (assemble_variable): Likewise. + (output_constant_def_contents): Alignments are unsigned. + +2004-08-31 Richard Kenner + Jeff Law + + * tree-cfg.c (cfg_remove_useless_stmts_bb): Also invalidate if VAL + gets modified. + +2004-08-31 Mark Mitchell + + * hooks.c (hook_bool_void_true): New function. + * hooks.h (hook_bool_void_true): Declare. + * target-def.h (TARGET_CXX): Add + TARGET_CXX_KEY_METHOD_MAY_BE_INLINE. + * target.h (struct cxx): Add key_method_may_be_inline. + * config/arm/arm.c (arm_cxx_key_method_may_be_inline): New + function. + (TARGET_CXX_KEY_METHOD_MAY_BE_INLINE): New macro. + * config/arm/bpabi.h: Use __THUMB_INTERWORK__ instead of + __THUMB_INTERWORK. + +2004-08-31 Denis Chertykov + + PR target/15417 + * config/avr/avr.c (avr_hard_regno_mode_ok): Enable usage of + frame pointer register only in Pmode while reload in progress. + +2004-08-31 Stephane Carrez + + PR target/15334 + * config/m68hc11/m68hc11.c (m68hc11_override_options): Disable -fweb + because it breaks the 32-bit shift patterns that rely on a match_dup. + +2004-08-31 Matt Austern + + * config/darwin.c (darwin_make_decl_one_only): Allocate section + names once per compilation, instead of once per symbol. + +2004-08-31 Paolo Bonzini + + * Makefile.in (build_subdir): New substitution. + (fixinc.sh): Simplify heavily since fixincludes is already built. + (stmp-fixinc): Depend on specs.ready. + (install-mkheaders): Use new location of fixincludes. + (clean): Do not descend into fixinc. + (FORBUILD): Replace with ../$(build_subdir). + * configure.ac (build_subdir): Substitute. + (FORBUILD): Do not set. + (all_outputs): Remove fixinc/Makefile. + (default commands): Do not create links in fixinc. + * mkfixinc.sh: New, from fixinc/mkfixinc.sh without + the fixincludes configuration steps and substituting + @FIXINCL@ in fixinc.in. + * fixinc.in: New, from fixinc/fixincl.sh. + + * fixinc/*: Removed. + +2004-08-31 Joseph S. Myers + + * attribs.c (strip_attrs): Remove. + (split_specs_attrs): Move ... + * c-decl.c: ... to here. + * tree.h (split_specs_attrs, strip_attrs): Remove. + * c-tree.h (split_specs_attrs): Declare. + +2004-08-31 Richard Sandiford + + * read-rtl.c: Disable RTL checking. + (apply_macro_to_rtx): Use XTMPL to access 'T' fields. + +2004-08-31 Richard Sandiford + + * config/mips/mips.md (fcond): New code macro and attribute. + (sunordered_[sd]f, suneq_[sd]f, sunlt_[sd]f, sunle_[sd]f) + (seq_[sd]f, slt_[sd]f, sle_[sd]f): Redefine using :SCALARF and fcond. + (sgt_[sd]f, sge_[sd]f): Redefine using :SCALARF. + +2004-08-30 Mark Mitchell + + Revert: + 2004-08-29 Mark Mitchell + PR rtl-optimization/16590 + * gcse.c (pre_delete): Do not create invalid REG_EQUAL notes. + +2004-08-30 Andrew Pinski + + * hard-reg-set.h: + s/HOST_BITS_PER_WIDES_FAST_INT/HOST_BITS_PER_WIDEST_FAST_INT. + * ChangeLog: Fix previous ChangeLog entry. + + PR rtl-opt/13987 + * config.host (use_long_long_for_widest_fast_int): New, default is + off. + (ia64-*-hpux*): Enable use_long_long_for_widest_fast_int. + * configure.ac: If use_long_long_for_widest_fast_int, then + define USE_LONG_LONG_FOR_WIDEST_FAST_INT. + * configure: Regenerate. + * config.in: Regenerate. + * hwint.h (HOST_WIDEST_FAST_INT, HOST_BITS_PER_WIDEST_FAST_INT): + New: widest integer type supported efficiently in hardware for the + host. + * sbitmap.h (SBITMAP_ELT_BITS): Define based on + HOST_BITS_PER_WIDEST_FAST_INT. + (SBITMAP_ELT_TYPE): Define based on HOST_WIDEST_FAST_INT. + * hard-reg-set.h (HARD_REG_ELT_TYPE): Define based on + HOST_WIDEST_FAST_INT + instead of HOST_WIDE_INT. + (HARD_REG_SET_LONGS): Likewise. + (UHOST_BITS_PER_WIDE_INT): Likewise. + Change the checks for the fast cases to be based on + HOST_BITS_PER_WIDEST_FAST_INT instead of HOST_BITS_PER_WIDE_INT. + +2004-08-30 Steven Bosscher + + * cfgcleanup.c (merge_memattrs): Look at the value of MEM_SIZE, + not the pointers. + +2004-08-30 Geoffrey Keating + + PR 12738 + PR 17205 + Radar 3460526 + Radar 3775729 + * c-decl.c (grokdeclarator): Produce error for 'static' on local + function declaration. + +2004-08-30 Richard Henderson + + * expr.c (array_ref_element_size): Force aligned_size back to + sizetype. + (component_ref_field_offset): Similarly for aligned_offset. + * tree.c (recompute_tree_invarant_for_addr_expr): Mark raw + low-bound, element-size, field-offset fields rather than + computed values. + +2004-08-30 Joseph S. Myers + + * c-parse.in (parmlist_or_identifiers_1): Remove unreachable and + redundant code. + +2004-08-30 Joseph S. Myers + + * c-tree.h (struct language_function): Add arg_info element. + * c-decl.c (current_function_arg_info): New. + (grokdeclarator, store_parm_decls): Use it instead of + DECL_ARGUMENTS. + (c_push_function_context, c_pop_function_context): Save and + restore it. + +2004-08-30 Richard Henderson + + * c-typeck.c (build_unary_op): Don't expand ADDR_EXPR of a + COMPONENT_REF to pointer arithmetic. + * varasm.c (initializer_constant_valid_p): Allow "&(*c).f", for + constant "c" as a valid constant initializer. Allow narrowing of + differences against the same base object, for any base object. + +2004-08-30 Richard Henderson + + * expr.c (expand_expr_addr_expr): New. + (expand_expr_real_1) : Use it. + +2004-08-30 Richard Sandiford + + * config/mips/mips.c (MIPS_FP_CONDITIONS): New macro. + (mips_fp_condition): New enum. + (mips_fp_conditions): New array. + (print_fcc_operand): Delete. + (print_operand): Remove %V, %v and %Q. Redefine %Z so that it prints + the operand and comma if and only if ISA_HAS_8CC. Add %Y. + (builtin_description): Add "cond" field. + (DIRECT_BUILTIN): Initialize it. + (CMP_{SCALAR,PS,4S}_BUILTINS, MOVTF_BUILTINS): Split INSN parameter + into INSN and CODE. Initialize the "cond" field. + (CMP_BUILTINS): Update accordingly. + (mips_bdesc): Use MIPS_FP_CONDITIONS to invoke CMP_BUILTINS. + (mips_expand_builtin_movtf, mips_expand_builtin_compare): Take the + mips_fp_condition as argument. Make it the final operand of the + comparison instruction. + (mips_expand_builtin): Update accordingly. + * config/mips/mips.md (UNSPEC_C_*, UNSPEC_CABS_*): Delete. + (UNSPEC_C, UNSPEC_CABS): New constants. Shuffle others to fill + the gaps. + * config/mips/mips-ps-3d.md (mips_cond_move_tf_ps, bc1any[24][ft]): + Don't use the 'Q' operand prefix; just print the operand normally. + (mips_cabs_*, mips_c_*): Delete, replacing with... + (mips_c_cond_{ps,4s}, mips_cabs_cond_{s,d,ps,4s}): ...these new + patterns. Split the 4s versions into 2 ps patterns after reload. + +2004-08-30 Richard Henderson + + * fold-const.c (tree_expr_nonzero_p): Use get_base_address before + assuming an ADDR_EXPR is non-null. + +2004-08-30 Jason Merrill + + * gthr-posix.h, gthr-dce.h: Add #pragma weaks. + +2004-08-30 Nathan Sidwell + + * alias.c (mems_in_disjoint_alias_sets_p, record_alias_subset, + record_set, rtx_equal_for_memref_p, init_alias_analysis): Use + gcc_assert and gcc_unreachable instead of abort. + * alloc-pool.c (abort, fancy_abort): Remove. + (create_alloc_pool, free_alloc_pool, pool_alloc, pool_free): Use + gcc_assert or gcc_unreachable. + * attribs.c (init_attributes, decl_attributes): Likewise. + * bb-reorder.c (FREE, find_traces_1_round, copy_bb, + mark_bb_for_unlikely_executed_section, + add_labels_and_missing_jumps, fix_crossing_conditional_branches, + fix_crossing_unconditional_branches): Likewise. + * bitmap.c (bitmap_first_set_bit, bitmap_last_set_bit, + bitmap_operation): Likewise. + * bt-load.c (insn_sets_btr_p, augment_live_range, + move_btr_def): Likewise. + * builtins.c (c_readstr, expand_builtin_longjmp, apply_args_size, + apply_result_size, expand_builtin_apply, expand_builtin_mathfn, + expand_builtin_mathfn_2, expand_builtin_mathfn_3, + builtin_memcpy_read_str, expand_movstr, expand_builtin_stpcpy, + expand_builtin_memcmp, expand_builtin_args_info, + std_gimplify_va_arg_expr, expand_builtin_unop, + expand_builtin_fputs, expand_builtin_profile_func, + expand_builtin_fork_or_exec, fold_builtin_bitop, + fold_builtin_classify, fold_builtin_fputs): Likewise. + +2004-08-30 Nathan Sidwell + + * gcov-io.c (GCOV_CHECK): Use gcc_assert when available. + * gcov.c (abort): Remove undef. + + * tree.h (BINFO_PRIMARY_BASE_OF): Remove. + (struct tree_binfo): Remove primary field. + +2004-08-30 Paolo Bonzini + + * fixinc/Makefile.in (machname.h): Remove. + (fixincl.x): Do not pass $@ to genfixes. + * fixinc/genfixes: Remove code to produce machname.h. + * fixinc/fixincl.sh: Move it here instead. + * fixinc/fixlib.c: Do not conditionalize on MN_NAME_PAT's presence, + instead check if pz_mn_name_pat is NULL. Make mn_get_regexps + return a bool indicating whether pz_mn_name_pat is NULL. + * fixinc/fixlib.h: Do not conditionalize on MN_NAME_PAT's presence. + Declare extern C variables for the ENV_TABLE. + * fixinc/fixfixes.c: Do not conditionalize on MN_NAME_PAT's presence, + instead use the result of mn_get_regexps. + * fixinc/fixtests.c: Likewise. + +2004-08-30 Paolo Bonzini + + * configure.ac: Do not run fixincludes after stage1 during + toplevel bootstrap. + * configure: Regenerate. + +2004-08-30 Richard Earnshaw + + * sched-deps.c (get_condition): Partially revert previous, by never + trying to extract the condition from a condjump. + +2004-08-30 Nathan Sidwell + + * c-common.c (c_sizeof_or_alignof_type): Use gcc_assert. + (handle_visibility_attribute, c_determine_visibility): Likewise. + * c-common.h (my_friendly_assert): Remove. + +2004-08-30 Richard Sandiford + + * config/mips/mips.md (UNSPEC_{RSQRT,RECIP}[12]_{S,D,PS}): Delete. + (UNSPEC_{RSQRT,RECIP}[12]): New constants. + (UNSPEC_MOVE_TF_PS): Renumber to avoid gaps. + * config/mips/mips-ps-3d.md (*movcc_v2sf_[sd]i): Use :GPR. + (mips_{rsqrt,recip}[12]_{s,d,ps}): Use :ANYF. + +2004-08-30 Diego Novillo + + * tree-pretty-print.c (dump_generic_node): Handle VALUE_HANDLE + in COMPONENT_REF nodes. + +2004-08-29 Gabriel Dos Reis + + PR c++/15378 + * c-opts.c (c_common_handle_option): set + global_dc->warning_as_error_requested. + * diagnostic.c (diagnostic_initialize): Tidy. + * diagnostic.h (diagnostic_context::x_data): Remove + (diagnostic_context::issue_warnings_are_errors_message): Rename + from warnings_are_errors_message. + (diagnostic_context::warning_as_error_requested): New. + +2004-08-30 Richard Earnshaw + + * sched-deps.c (get_condition): Fix breakage in previous patch. + +2004-08-30 Paul Brook + + * doc/install.texi: Fix broken mpfr link. + +2004-08-29 David O'Brien + + * config/rs6000/sysv4.h (LINK_OS_FREEBSD_SPEC): Sync '-p' handling with + other FreeBSD platforms. + +2004-08-29 Richard Earnshaw + + * arm.h (REVERSE_CONDITION): Define. + (REVERSIBLE_CC_MODE): All comparisons are now reversible. + +2004-08-29 Richard Earnshaw + + * flow.c (REVERSE_CONDEXEC_PREDICATES_P): Use the whole comparison, not + just the codes, call reversed_comparison_code (). + (ior_reg_cond): Update arguments to REVERSE_CONDEXEC_PREDICATES_P. + (not_reg_cond): Use reversed_comparison_code. + (and_reg_cond): Likewise. + * ifcvt.c (cond_exec_process_if_block): Likewise. + * doc/tm.texi (REVERSE_CONDEXEC_PREDICATES_P): Update documentation. + +2004-08-29 Richard Earnshaw + + * sched-deps.c (get_condition): Rewrite using jump support functions. + Use reversed_comparison_code. + (conditions_mutex_p): Use reversed_comparison_code. + +2004-08-29 Richard Sandiford + + * config/mips/mips.c (override_options): Disable hot/cold partitioning + for MIPS16. + +2004-08-29 Richard Sandiford + + * config/mips/mips.h (mips_builtins, mips_cmp_choice): Delete. + (mips_function_type): Move to mips.c. + * config/mips/mips.c (mips_builtin_type): New enum. + (builtin_description): Replace code and ftype with builtin_type + and function_type. + (DIRECT_BUILTIN, CMP_SCALAR_BUILTINS, CMP_PS_BUILTINS, CMP_4S_BUILTINS) + (MOVTF_BUILTINS, CMP_BUILTINS): New macros. + (CODE_FOR_mips_abs_ps): Define. + (mips_bdesc): Use new macros. + (mips_expand_builtin): Use builtin_type. Update calls to subroutines. + (mips_init_builtins): Use the mips_bdesc[] index as the function code. + (mips_expand_builtin_direct): New function. + (mips_expand_builtin_movtf): Renamed from mips_expand_ps_cond_move_ + builtin. Replace boolean parameter with builtin_type. + (mips_expand_compare_builtin, mips_expand_scalar_compare_builtin) + (mips_expand_4s_compare_builtin): Delete, replacing with... + (mips_expand_builtin_compare): ...this new function. + +2004-08-29 Mark Mitchell + + PR rtl-optimization/16590 + * gcse.c (pre_delete): Do not create invalid REG_EQUAL notes. + +2004-08-29 Diego Novillo + + * tree-ssa-ccp.c (ccp_visit_stmt): Remove #if 0 guards. + * tree-ssa-propagate.c: Fix documentation. + +2004-08-29 Richard Sandiford + + * config/mips/mips.md (*mov[sd]f_on_*): Redefine using :SCALARF. + (mov[sd]fcc): Likewise. + +2004-08-29 Richard Sandiford + + * config/mips/mips.md (cmp[sd]f): Redefine using :SCALARF. + +2004-08-29 Richard Sandiford + + * config/mips/mips.md (divide_condition): New mode attribute. + (div[sd]f3, *div[sd]f3): Use it. Redefine using :SCALARF. + (sqrt[sd]f3): Redefine using SCALARF. + (*recip[sd]f3, *rsqrt[ab]): Likewise. Name formerly unnamed + patterns. + +2004-08-29 Richard Sandiford + + * config/mips/mips.md (ANYF, SCALARF): New mode macros. + (loadx, storex, fmt, UNITMODE): New mode attributes. + (add{sf,df,v2sf}3, sub{sf,df,v2sf}3): Redefine using :ANYF. + (mul[sd]f3): Redefine using :SCALARF. + (*mul[sd]f3): Renamed from mul[sd]f3_internal. Use :SCALARF. + (*mul[sd]3_r4300): Likewise mul[sd]f3_r4300. + (*m{add,sub}{sf,df,v2sf}3): Name formerly unnamed patterns. Use :ANYF. + Check TARGET_FUSED_MADD for V2SF too. + (*nm{add,sub}{sf,df,v2sf}3{,_fastmath}): Likewise, except v2sf patterns + were already named. + (abs{sf,df,v2sf}3, neg{sf,df,v2sf}3): Redefine using :ANYF. + (*[sl][wd]xc1_[sd]i): Redefine using :ANYF. + +2004-08-29 Richard Sandiford + + * config/mips/mips.c (mips_init_builtins): Simplify. Only create + V2SF_type_node if it will be needed. + +2004-08-29 Richard Sandiford + + * config/mips/mips.h (MIPS_CMP_MOVT, MIPS_CMP_MOVF): Delete. + * config/mips/mips.c (mips_prepare_builtin_arg): New function. + (mips_prepare_builtin_target): New function. + (mips_expand_builtin): Use them. Update calls to subroutines. + (mips_expand_ps_cond_move_builtin): Use the new functions. Replace + cmp_choice with a boolean argument to select between movt and movf. + Take the comparison's icode as an argument, not the function's fcode. + (mips_expand_compare_builtin): New function. Rename existing function + to mips_expand_scalar_compare_builtin. + (mips_expand_scalar_compare_builtin, mips_expand_4s_compare_builtin) + (mips_expand_ps_compare_builtin): Use the new functions. Take the + comparison's icode as an argument, not the builtin's fcode. + +2004-08-29 Richard Sandiford + + * config/mips/mips.c (print_operand): Remove '%Y' and '%y'. + (mips_expand_4s_compare_builtin): Redefine CCV4 to be 0 if all + registers are false and -1 if all registers are true. + (mips_expand_ps_compare_builtin): Likewise CCV2. Use subregs for + MIPS_CMP_UPPER and MIPS_CMP_LOWER. + * config/mips/mips.md (mips_cond_move_tf_ps): Use %Q rather than %y. + (bc1any4t, bc1any4f): Adjust for new CCV4 interpretation. + (bc1any2t, bc1any2f): Likewise CCV2. + (bc1upper2t, bc1lower2t, bc1upper2f, bc1lower2f): Delete. + +2004-08-29 Richard Sandiford + + * config/mips/mips.md (UNSPEC_MOVE_TF_PS): New. + * config/mips/mips-ps-3d.md (mips_cond_move_tf_ps): Express as an + UNSPEC rather than an IF_THEN_ELSE. + * config/mips/mips.c (mips_expand_ps_cond_move_builtin): Emit + mips_cond_move_tf_ps by name. + +2004-08-29 Chao-ying Fu + James E Wilson + + * config/mips/mips-modes.def (V2SF, CCV2, CCV4): New modes. Give CCV2 + 8 byte size and alignment. Give CCV4 16 byte size and alignment. + * config/mips/mips-ps-3d.md: New file. + * config/mips/mips.c (TARGET_VECTOR_MODE_SUPPORTED_P, + TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. + (mips_const_insns): Handle CONST_VECTOR the same as CONST_DOUBLE. + (mips_output_move): Emit "mov.ps" for V2SFmode. + (mips_arg_info): Add checks for VECTOR_FLOAT_TYPE_P and + MODE_VECTOR_FLOAT. + (override_options): Check if TARGET_MIPS3D and there was an explicit + !TARGET_PAIRED_SINGLE_FLOAT. Set MASK_PAIRED_SINGLE, if TARGET_MIPS3D. + Check if TARGET_FLOAT64 and TARGET_HARD_FLOAT are both true, when + TARGET_PAIRED_SINGLE_FLOAT is true. Check if the ISA supports + TARGET_PAIRED_SINGLE_FLOAT. Allow MODE_VECTOR_FLOAT in fp registers, + and allow CCV2 and CCV4 to occupy two and four CC registers. + (print_fcc_operand): New function. + (print_operand): Add %Y, %y, %V, %v, %Q for CCV2, CCV4, CC. Modify + %Z to call print_fcc_operand. + (mips_function_value): Handle MODE_VECTOR_FLOAT. + (mips_class_max_nregs): Check for ST_REGS, and handle CCmodes. + (mips_vector_mode_supported_p): New function. + (mips_hard_regno_nregs): Check for ST_REG_P, and handle CCmodes. + (builtin_description): New struct. + (mips_bdesc): New array of struct builtin_description. + (mips_expand_builtin, mips_init_builtins, + mips_expand_ps_cond_move_builtin, mips_expand_4s_compare_builtin, + mips_expand_compare_builtin, mips_expand_ps_compare_builtin): New + functions. + * config/mips/mips.h (MASK_PAIRED_SINGLE, MASK_MIPS3D): New defines. + (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D): New defines. + (TARGET_CPU_CPP_BUILTINS): Add __mips_paired_single_float. + (TARGET_SWITCHES): Added "-mpaired-single", "-mno-paired-single", + "-mips3d", and "-mno-mips3d". + (ASM_SPEC): Map -mips3d to -mips3d in gas. + (EXTRA_CONSTRAINT_Y): New macro. + (EXTRA_CONSTRAINT_STR): Renamed from EXTRA_CONSTRAINT. Add new + multi-letter constraint 'Y'. + (CONSTRAINT_LEN): New macro. + (enum mips_builtins): New for MIPS builtin functions. + (enum mips_function_type): New for the types of MIPS builtin functions. + (enum mips_cmp_choice): New for the MIPS comparison builtin functions. + * config/mips/mips.md: New constants for paired single and MIPS-3D + instructions. Include the new mips-ps-3d.md file. + (addv2sf3, subv2sf3, mulv2sf3, absv2sf2, negv2sf2, movv2sf, + movv2sf_hardfloat_64bit): New named patterns. + (madd.ps, msub.ps, nmaddv2sf, nmaddv2sf_fastmath, nmsubv2sf, + nmsubv2sf_fastmath, ldxc1_v2sf_si, ldxc1_v2sf_di, sdxc1_v2sf_si, + sdxc1_v2sf_di): New unnamed patterns. + * config/mips/predicates.md (const_0_operand, const_1_operand): Add + const_vector support. + (const_0_or_1_operand): New predicate. + * doc/invoke.texi (MIPS Options): Add -mpaired-single and -mips3d. + +2004-08-29 Diego Novillo + + * Makefile.in (OBJS-common): Add tree-ssa-propagate.o + (tree-ssa-propagate.o): New rule. + (GTFILES): Add tree-ssa-propagate.c. + * tree-flow.h (struct stmt_ann_d): Remove field + in_ccp_worklist. + * tree-ssa-propagate.c: New file. + * tree-ssa-propagate.h: New file. + * tree-ssa-ccp.c: Re-write to use the routines from + tree-ssa-propagate.c. + +2004-08-28 Andrew Pinski + + * tree-ssa-loop.c: Remove extra include of basic-block.h. + +2004-08-28 Ziemowit Laski + + * c-common.h: Update comments about ObjC/ObjC++ entry points. + (objc_is_reserved_word): New prototype. + (get_current_scope, objc_mark_locals_volatile): Move prototypes to + separate section; these are call-backs. + * c-lex.c (c_lex_with_flags): Call objc_is_reserved_word() to detect + ObjC/ObjC++ "@" keywords. + * c-tree.h (get_current_scope, objc_mark_locals_volatile): Remove + prototypes; they already live in c-common.h. + * stub-objc.c: Update copyright notice. + (objc_is_reserved_word): New stub. + +2004-08-28 Nathan Sidwell + + * system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR + even when not checking. + +2004-08-27 Jason Merrill + + PR c++/13684 + * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY. + (gimple_push_cleanup): Add eh_only parm. + (gimplify_target_expr): Pass it. + * c.opt (-fno-threadsafe-statics): New option. + * c-opts.c (c_common_handle_option): Handle it. + * c-common.h (flag_threadsafe_statics): Declare it. + * c-common.c (flag_threadsafe_statics): Record it. + * doc/invoke.texi: Document it. + * tsystem.h (_GNU_SOURCE): Define. + * gthr-posix.h (__gthread_recursive_mutex_t): New typedef. + (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro. + (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro. + (__gthread_recursive_mutex_init_function): New fn. + (__gthread_recursive_mutex_lock): New fn. + (__gthread_recursive_mutex_trylock): New fn. + (__gthread_recursive_mutex_unlock): New fn. + * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise. + * gthr-win32.h, gthr-vxworks.h: Likewise. + * gthr.h: Document. + +2004-08-27 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Increase + maximum skip to 15. Set function alignment, jump alignment, and + loop alignment to 16 for processors that form dispatch groups. + (rs6000_rtx_costs): outer_code is used. + +2004-08-27 Nathan Sidwell + + * stor-layout.c (sizetype_set): Remove. + (set_sizetype): Don't test or set it. + + * tree.h (size_int_type): Remove. + * fold-const.c: Do not #include gt-fold-const.h. + (size_htab_hash, size_htab_eq): Remove. + (size_int_kind): Use build_int_cst. + (new_const, size_htab): Remove. + (size_int_type): Remove. + (round_up): Use build_int_cst. + (round_down): Likewise. Remove spurious constant build. + +2004-08-27 Nathan Sidwell + + * configure.ac: Add ENABLE_ASSERT_CHECKING control. + Add is_release variable, use it for --enable-werror and + --enable-checking defaults. + * system.h (gcc_assert, gcc_unreachable): New. + * doc/install.texi (--enable-checking): Update. + * configure, config.in: Rebuilt. + +2004-08-26 Richard Sandiford + + * rtl.h (read_rtx): Change prototype. + * read-rtl.c (read_rtx): Provide the caller with both an rtx and a + line number. Return true on success. + * gensupport.c (process_include, init_md_reader_args_cb): Adjust + callers accordingly. + +2004-08-26 Richard Henderson + + * c-typeck.c (build_offsetof): Remove. + * c-tree.h (build_offsetof): Remove. + * c-common.c (fold_offsetof_1, fold_offsetof): New. + * c-common.h (fold_offsetof): Declare. + * c-parse.in (offsetof_base): New. + (offsetof_member_designator): Use it. Build references, not just + a tree list. + (primary): Use fold_offsetof, not build_offsetof. + +2004-08-26 Richard Henderson + + * tree.c (staticp): Return the static object. + * tree.h (staticp): Update decl. + * langhooks.h (struct lang_hooks): Change staticp return type to tree. + * langhooks.c (lhd_staticp): Return NULL_TREE. + * langhooks-def.h (lhd_staticp): Update decl. + * c-common.c (c_staticp): Return the static object. + * c-common.h (c_staticp): Update decl. + +2004-08-26 Richard Henderson + + * config/alpha/alpha.h (HARD_REGNO_MODE_OK): Allow complex float + modes. + +2004-08-26 Joseph S. Myers + + PR c/13801 + * c-decl.c (struct c_binding): Add type and inner_comp fields. + (bind): Set type and inner_comp fields. + (pop_scope): Restore type of decl to the correct type from an + outer scope. Give error when popping file scope for incomplete + arrays completed incompatibly with default initialization in an + inner scope. + (diagnose_mismatched_decls): Handle externs with initializers at + block scope. + (pushdecl): Set type of external declaration at block scope based + only on the visible declarations. Save type when changing the + type of a declaration. Merge an external declaration at block + scope with a visible static declaration at file scope. + (implicitly_declare): Give recycled old declaration the new type + except for incompatible declarations of built-in functions, saving + the old type. + +2004-08-26 Ziemowit Laski + + * c-parse.in (OBJC_TYPE_QUAL): New %token for ObjC use. + +2004-08-26 Daniel Berlin + + * tree-alias-common.c (gate_pta): New function. + (pass_build_pta): Use it. + (pass_del_pta): Use it. + (delete_alias_vars): Don't check flag_tree_points_to. + +2004-08-26 Fariborz Jahanian + + * config/rs6000/rs6000.h (HARD_REGNO_CALL_PART_CLOBBERED): Added + TFmode as additional register mode cloberred by call. + +2004-08-26 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_libcall_value): Generate + parallel pattern for library call returning DImode in + mixed mode. + +2004-08-26 Fariborz Jahanian + + * config/rs6000/rs6000.c (function_arg): Generate parallel + pattern for more split args. + +2004-08-26 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_split_multireg_move): Call + either gen_movdi_di_update or gen_movdi_si_update depending on + target mode. + * config/rs6000/rs6000.md (movdi_update): Changed to movdi__update, + to generate two versions. + +2004-08-26 Daniel Berlin + + * Makefile.in (lambda-code.o): New. + (lambda-trans.o): Ditto. + (TREE_DATA_REF_H): Ditto. + (LAMBDA_H): Ditto. + (lambda-mat.o): Use LAMBDA_H. + (tree-data-ref.o): Ditto. + * lambda-code.c: New file. Lambda code generation algorithm. + * lambda-trans.c: Ditto. Lambda transformation matrix support. + * lambda.h: Add lambda loop structures. + Add lambda loopnest structures. + Add lambda body vector structure. + Add lambda linear expression structures. + Add prototypes for functions in new files. + * lambda-mat.c: Include tree.h + +2004-08-26 Daniel Berlin + Sebastian Pop + + * tree-data-ref.h: Include lambda.h + (free_dependence_relation): Declared here. + (free_dependence_relations): Ditto. + (free_data_refs): Ditto. + * tree-data-ref.c (free_dependence_relation): New function. + (free_dependence_relations): Ditto. + (free_data_refs): Ditot. + (analyze_all_data_dependences): Free datarefs and dependence_relations. + (build_classic_dist_vector): Store in the dependence_relations the + information. Each arc in the dependence_relations graph is labelled + with the distance and direction vectors. + (build_classic_dir_vector): Ditto. + (compute_rw_wr_ww_dependences): Renamed again compute_all_dependences. + Now computes again the whole dependence graph including read-read + relations. + (compute_data_dependences_for_loop): Now dependence_relations contains + all the data, and thus it doesn't need to initialize the classic_dir + and classic_dist vectors. + (analyze_all_data_dependences): Adjusted for using the new interface of + compute_data_dependences_for_loop. Remove the statistics dump. + +2004-08-26 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_ld_opcodes, xtensa_st_opcodes): Delete. + (xtensa_expand_block_move): Update comment. + (override_options): Remove initialization of xtensa_{ld,st}_opcodes. + +2004-08-26 Richard Earnshaw + + PR target/13506 + * toplev.c (crash_signal): If we crashed while emitting + a user asm, then die more gracefully. + +2004-08-26 Kazuhiro Inaoka + + PR target/17119. + * config/m32r.c (gen_compare): Use reg_or_int16_operand when + checking for a valid constant, regardless of sign. + +2004-08-25 Richard Henderson + + PR target/16974 + * config/alpha/alpha.md (adddi_fp_hack): Don't rely on splitting + if the constant satisfies add_operand. + +2004-08-25 Richard Henderson + + PR debug/10695 + * config/alpha/alpha.c (emit_frame_store_1, emit_frame_store): New. + (alpha_expand_prologue): Handle >32-bit frames. Generate proper + unwind info for >16-bit frames. + +2004-08-25 Richard B. Kreckel + + PR target/17171 + * config/i386/gas.h (ASM_COMMENT_START): Define to "#". + +2004-08-25 Richard Henderson + + * config/alpha/alpha.c (alpha_cannot_force_const_mem): New. + (TARGET_CANNOT_FORCE_CONST_MEM): New. + +2004-08-25 Andrew MacLeod + + * doc/tree-ssa.texi: Document new operand iterator. + +2004-08-26 Alan Modra + + PR target/16480 + * config/rs6000/rs6000.c (rs6000_split_multireg_move): Don't abort + on "(mem (symbol_ref ..))" rtl. Look at LO_SUM base regs as well + as PLUS base regs. + +2005-08-28 Paul Brook + + * config/arm/symbian.h (SUBTARGET_ASM_FLOAT_SPEC): Default to + -mfpu=vfp -march=armv5t + * config/arm/t-symbian: Change multilib to mfloat-abi=softfp. + +2004-08-25 Richard Henderson + + * target-def.h (TARGET_SCALAR_MODE_SUPPORTED_P): New. + * target.h (struct gcc_target): Add scalar_mode_supported_p. + * targhooks.c (default_scalar_mode_supported_p): New. + * targhooks.h (default_scalar_mode_supported_p): Declare. + * doc/tm.texi (TARGET_SCALAR_MODE_SUPPORTED_P): Document. + + * c-common.c (handle_mode_attribute): Query scalar_mode_supported_p + before attempting to create types. Tidy. + * expr.c (vector_mode_valid_p): Use scalar_mode_supported_p. + + * config/alpha/alpha.c (alpha_scalar_mode_supported_p): New. + (TARGET_SCALAR_MODE_SUPPORTED_P): New. + +2004-08-25 Richard Henderson + + * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Don't + set REAL_MODE_FORMAT for TFmode. + +2004-08-25 Ziemowit Laski + + * c-decl.c (grokparm): New function. + * c-tree.h (grokparm): New prototype. + +2004-08-25 Andrew MacLeod + + * tree-ssa-operands.h (struct ssa_operand_iterator_d): New. SSA operand + iterator controlling structure. + (SSA_OP_USE, SSA_OP_DEF, SSA_OP_VUSE, SSA_OP_VMAYUSE, SSA_OP_VMAYDEF, + SSA_OP_VMUSTDEF, SSA_OP_VIRTUAL_USES, SSA_OP_VIRTUAL_DEFS, + SSA_OP_ALL_USES, SSA_OP_ALL_DEFS, SSA_OP_ALL_OPERANDS): New. Operand + iterator flags. + (FOR_EACH_SSA_TREE_OPERAND): New. Iterate over operands as trees. + (FOR_EACH_SSA_USE_OPERAND): New. Iterate over operands as uses. + (FOR_EACH_SSA_DEF_OPERAND): New. Iterate over operands as defs. + (FOR_EACH_SSA_MAYDEF_OPERAND): New. Iterate over V_MAY_DEFs. + * tree-ssa-operands.c (NULL_DEF_OPERAND_P, NULL_USE_OPERAND_P): New. + Empty operand pointers. + * tree-flow-inline.h (op_iter_done): New. Return true if finished. + (op_iter_next_use): New. Return next use_operand_p. + (op_iter_next_def): New. Return next def_operand_p. + (op_iter_next_tree): New. Return next operands as a tree. + (op_iter_init): New. Initialize an iterator structure. + (op_iter_init_use): New. Initialize structure and get the first use. + (op_iter_init_def): New. Initialize structure and get the first def. + (op_iter_init_tree): New. Initialize structure and get the first tree. + (op_iter_next_maydef): New. Return next V_MAY_DEF operands. + (op_iter_init_maydef): New. Initialize structure and get the first + V_MAY_DEF operands. + * tree-cfg.c (tree_duplicate_bb): Use new operand iterator. + * tree-dfa.c (compute_immediate_uses_for_stmt, + redirect_immediate_uses): Use new operand iterator. + (v_may_defs_disappeared_p, v_must_defs_disappeared_p): Delete. + (mark_new_vars_to_rename): Use new operand iterator. Count virtual + operands instead of using *_disappeared_p routines. + * tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites, rewrite_stmt, + ssa_rewrite_stmt): Use new operand iterator. + * tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb, + rewrite_trees): Use new operand iterator. + * tree-pretty-print.c (dump_vops): Use new operand iterator. + * tree-sra.c (mark_all_v_defs): Use new operand iterator. + * tree-ssa-alias.c (compute_points_to_and_addr_escape, + dump_points_to_info): Use new operand iterator. + * tree-ssa-ccp.c (cp_lattice_meet, visit_stmt, initialize, + replace_uses_in, replace_vuse_in, likely_value, set_rhs): Use new + operand iterator. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary, + propagate_necessity): Use new operand iterator. + * tree-ssa-dom.c (cprop_into_stmt, optimize_stmt): Use operand iterator. + (register_definitions_for_stmt): Use new operand iterator. Take stmt as + a parameter instead of a stmt_ann_t. + * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry, + build_tree_conflict_graph): Use new operand iterator. + * tree-ssa-loop-im.c (determine_max_movement, single_reachable_address, + rewrite_mem_refs): Use new operand iterator. + * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, + check_loop_closed_ssa_use): Use new operand iterator. + * tree-ssa.c (verify_ssa, replace_immediate_uses): Use operand iterator. + * tree-ssanames.c (release_defs): Use new operand iterator. + * tree-vectorizer.c (vect_create_data_ref): Use new operand iterator. + +2004-08-25 Adam Nemet + + * tlink.c (initial_cwd): New variable. + (tlink_init): Initialize it. + (recompile_files): Use tlink_execute() instead of system(). Don't + duplicate verbose output of collect_execute. Restore initial_cwd. + Update comment before the function. + +2004-08-25 Ziemowit Laski + + * c-typeck.c (build_c_cast): In ObjC, always preserve (and silently + accept) a cast from one Objective-C pointer type to another. + +2004-08-25 Paolo Carlini + + * doc/install.texi: Document that libstdc++-v3 requires + now automake 1.9.1. + +2004-08-25 Caroline Tice + + * bb-reorder.c (partition_hot_cold_basic_blocks): Add more details + to comments at start of function. + * cfgbuild.c (make_edges): Add more details to hot/cold partitioning + comment. + * cfgcleanup.c (try_simplify_condjump, try_forward_edges, + merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps, merge_blocks_move, + try_crossjump_to_edge, try_crossjump_bb): Likewise. + * cfglayout.c (fixup_reorder_chain): Likewise. + * cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump, + cfg_layout_can_merge_blocks_p): Likewise. + * ifcvt.c (find_if_case_1, find_if_case_2): Likewise. + * passes.c (rest_of_compilation): Update comments for calling + optimization that partitions hot/cold basic blocks. + * doc/invoke.texi: Update documentation of + freorder-blocks-and-partition flag. + +2004-08-25 Richard Sandiford + + * config/mips/mips.md (reg): Renamed mode attribute from ccreg. + (*mov*_on_*): Adjust accordingly. Add an explicit MOVECC: prefix. + +2004-08-25 Richard Sandiford + + * config/mips/mips.md (any_shift): New code macro. + (optab, insn): New code attributes. + ({ashl,ashr,lshr}[sd]i3): Redefine using :GPR and any_shift. + Use the standard rather than internal patterns for the MIPS16 + double-shift optimization. + (*{ashl,ashr,lshr}[sd]i3): New names for the non-mips16 shift patterns. + Redefine using :GPR and any_shift. + (*{ashl,ashr,lshr}si3_extend): Generalize ashlsi3_internal1_extend + to cover all three shifts. + (*{ashl,ashr,lshr}si3_mips16): New names for the mips16 SImode shifts. + Redefine using any_shift. Use :GPR and any_shift to combine splitters. + (*{ashl,ashr,lshr}di3_mips16): New names for the mips16 DImode shifts. + +2004-08-24 Geoffrey Keating + + * gimplify.c (lookup_tmp_var): Separate temporaries when not + optimizing. + +2004-08-25 John David Anglin + + PR libstdc++/17005 (fix for HP-UX 11.11) + * config.gcc (hppa*-*-*): Move MASK_BIG_SWITCH to target_cpu_default2. + (hppa*-*-hpux*): Consolidate hppa1.0-*-* code. Rework handling of + tm_file including pa-hpux1010.h or pa-hpux1111.h when appropriate. + * config/pa/pa-hpux1010.h, config/pa/pa-hpux1111.h: New files. + * config/pa/pa-hpux.h (TARGET_HPUX): Define. + (LINK_SPEC): Handle march=1.0 option. + * config/pa/pa-hpux10.h (TARGET_OS_CPP_BUILTINS): Predefine _XOPEN_UNIX + and _XOPEN_SOURCE_EXTENDED for UNIX 95. + (SUBTARGET_OPTIONS): New define. + (LINK_SPEC): Handle march=1.0 option. + (STARTFILE_SPEC): New define. + * config/pa/pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Predefine _XOPEN_UNIX + and _XOPEN_SOURCE_EXTENDED for UNIX 95. Additionally, predefine + _INCLUDE__STDC_A1_SOURCE and _INCLUDE_XOPEN_SOURCE_500 for UNIX 98. + (SUBTARGET_OPTIONS): New define. + (LINK_SPEC): Handle march=1.0 option. + (STARTFILE_SPEC): New define. + * config/pa/pa.c (override_options): Add code to process -munix= option. + * config/pa/pa.h (pa_unix_string, flag_pa_unix): Declare. + (TARGET_HPUX, TARGET_HPUX_10_10, TARGET_HPUX_11_11): Provide default + defines. + (TARGET_OPTIONS): Add SUBTARGET_OPTIONS to option list. + (SUBTARGET_OPTIONS): Provide default define. + * config/pa/pa64-hpux.h (STANDARD_STARTFILE_PREFIX_1, + STANDARD_STARTFILE_PREFIX_2): New defines. + (STARTFILE_SPEC): Provide unix95.o or unix98.o startfiles as necessary. + (ENDFILE_SPEC): Use %O. + * doc/install.texi (hppa*-*-hpux*): Reword paragraph on -g and gas. + Mention issue caused by changing namespace and runtime to UNIX 95/98. + * doc/invoke.texi (HPPA options): Move misplaced text to FRV options. + Document -munix=std option. + +2004-08-25 Steven Bosscher + + * cse.c (cse_around_loop, cse_check_loop_start, + cse_set_around_loop): Remove. + (cse_basic_block): Remove the around_loop argument. + (cse_end_of_basic_block): Remove the after_loop argument. + (cse_main): Likewise. + * rtl.h (cse_main): Update prototype. + * passes.c (rest_of_handle_cse, rest_of_handle_cse2, + rest_of_handle_gcse): Update cse_main calls. + +2004-08-25 Nathan Sidwell + + * tree.h (build_int_cst): New, sign extended constant. + (build_int_cstu): New, zero extended constant. + (build_int_cst_wide): Renamed from build_int_cst. + * tree.c (build_int_cst, build_int_cstu): New. + (build_int_cst_wide): Renamed from build_int_cst. + (make_vector_type, build_common_tree_nodes, + build_common_tree_nodes_2): Adjust build_int_cst calls. + * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, + expand_builtin_strpbrk, expand_builtin_fputs, + build_string_literal, expand_builtin_printf, + expand_builtin_sprintf, fold_builtin_classify_type, + fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, + fold_builtin_toascii, fold_builtin_isdigit, + simplify_builtin_strstr, simplify_builtin_strpbrk, + fold_builtin_fputs, simplify_builtin_sprintf): Likewise. + * c-common.c (start_fname_decls, fix_string_type, shorten_compare, + DEF_ATTR_INT): Likewise. + * c-decl.c (complete_array_type, check_bitfield_type_and_width): + Likewise. + * c-lex.c (interpret_integer, lex_charconst): Likewise. + * c-parse.in (primary) Likewise. + * c-pretty-print.c (pp_c_integer_constant): Likewise. + * c-typeck.c (really_start_incremental_init, push_init_level, + set_nonincremental_init_from_string): Likewise. + * calls.c (load_register_parameters): Likewise. + convert.c (convert_to_pointer): Likewise. + coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, + build_fn_info_type, build_fn_info_value, build_ctr_info_value, + build_gcov_info): Likewise. + * except.c (init_eh, assign_filter_values): Likewise. + * expmed.c (store_fixed_bit_field, extract_bit_field, + extract_fixed_bit_field, extract_split_bit_field, expand_shift, + expand_mult_const, expand_mult_highpart_adjust, extract_high_half, + expand_sdiv_pow2, expand_divmod, make_tree): Likewise. + * expr.c (convert_move, emit_group_load, emit_group_store, + expand_assignment, store_constructor, store_field, + expand_expr_real_1, reduce_to_bit_field_precision): Likewise. + fold-const.c (force_fit_type, int_const_binop, fold_convert_const, + invert_truthvalue, optimize_bit_field_compare, + decode_field_reference, all_ones_mask_p, constant_boolean_node, + fold_div_compare, fold, fold_read_from_constant_string, + fold_negate_const, fold_abs_const, fold_not_const, round_up, + round_down): Likewise. + * function.c (assign_parm_setup_block): Likewise. + * stmt.c (shift_return_value, expand_case, estimate_case_costs): + Likewise. + * stor-layout.c (layout_type, initialize_sizetypes, + set_min_and_max_values_for_integral_type): Likewise. + * tree-chrec.c (chrec_fold_multiply_poly_poly, + reset_evolution_in_loop): Likewise. + * tree-chrec.h (build_polynomial_chrec): Likewise. + * tree-complex.c (build_replicated_const): Likewise. + * tree-eh.c (honor_protect_cleanup_actions, + lower_try_finally_onedest, lower_try_finally_copy, + lower_try_finally_switch): Likewise. + * tree-mudflap.c (mf_build_string, mx_register_decls, + mudflap_register_call, mudflap_enqueue_constant): Likewise. + * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): + Likewise. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + * tree-ssa-loop-niter.c (number_of_iterations_cond, + loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): + Likewise. + * tree-ssa-loop-ivcanon.c (create_canonical_iv, + canonicalize_loop_induction_variables): Likewise. + * tree-vectorizer.c (vect_create_index_for_array_ref, + vect_transform_loop_bound, vect_compute_data_ref_alignment): + Likewise. + + * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, + alpha_gimplify_va_arg_1): Likewise. + * config/arm/arm.c (arm_get_cookie_size): Likewise. + * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. + * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. + * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, + mips_gimplify_va_arg_expr): Likewise. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. + * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, + add_compiler_branch_island): Likewise. + * config/s390/s390.c (s390_va_start): Likewise. + * config/sh/sh.c (sh_va_start): Likewise. + * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): + Likewise. + * config/xtensa/xtensa.c (xtensa_va_start, + xtensa_gimplify_va_arg_expr): Likewise. + + * objc/objc-act.c (build_objc_string_object, + build_objc_symtab_template, init_def_list, init_objc_symtab, + init_module_descriptor, generate_static_references, + build_selector_translation_table, get_proto_encoding, + build_typed_selector_reference, build_selector_reference, + build_next_objc_exception_stuff, + build_method_prototype_list_template, generate_descriptor_table, + generate_protocols, build_protocol_initializer, + build_ivar_list_template, build_method_list_template, + build_ivar_list_initializer, generate_ivars_list, + generate_dispatch_table, generate_protocol_list, + build_category_initializer, build_shared_structure_initializer, + generate_shared_structures, handle_impent, + generate_objc_image_info): Likewise. + +2004-04-25 Paolo Bonzini + + * cfglayout.c (duplicate_insn_chain): Remove references to + NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. + * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. + * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. + * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP + and NOTE_INSN_LOOP_CONT. + * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. + * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP + and NOTE_INSN_LOOP_CONT. + * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, + check_dbra_loop, loop_dump_aux): Remove references to removed notes + and fields. + * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. + * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove + references to removed notes and fields. + (subtract_reg_term, ujump_to_loop_cont): Remove. + +2004-08-25 Paolo Bonzini + + * doc/install.texi: Document that libcpp does not require + Automake any longer. Document that Automake 1.9.1 should + work everywhere. + +2004-08-25 Zack Weinberg + + * flags.h (enum debug_info_type): Remove DWARF_DEBUG. + * defaults.h (PREFERRED_DEBUGGING_TYPE): Remove check for + DWARF_DEBUGGING_INFO from choice-of-definition chain; + restructure using C89 features (#elif, #error). + * c-lex.c, final.c, opts.c, config/cris/cris.c, config/frv/frv.c + * config/sh/sh.h: Remove references to DWARF_DEBUG. + * doc/invoke.texi: Remove references to DWARF version 1; + clarify why -gdwarf-2 doesn't work. + +2004-08-25 Zack Weinberg + + * basic-block.h (BB_SET_PARTITION): Clear old value first. + * cfg.c (clear_bb_flags): Don't clear partition setting. + * ifcvt.c (find_if_case_1): Remove ??? comment. + +2004-08-25 Alan Modra + + PR target/17052 + * config/rs6000/rs6000.h (machine_function): Remove sysv_varargs_p. + * config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Use + current_function_stdarg in place of sysv_varargs_p. + * config/rs6000/rs6000.c (setup_incoming_varargs): Don't set + sysv_varargs_p. + +2004-08-24 Richard Henderson + + PR target/16298 + * config/i386/i386.c (legitimate_constant_p): Rework to not accept + random codes within CONST. + +2004-08-24 James E Wilson + + * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS): Remove + -freorder-blocks-and-partition. + +2004-08-24 John David Anglin + + PR middle-end/17044 + * tree-ssa-threadupdate.c (redirection_data): Make static. + (thread_block): Use ggc_alloc_cleared to allocate struct + redirection_data. Don't free elements in redirection_data. + +2004-08-24 Richard Sandiford + + * config/mips/predicates.md (small_data_pattern): Match prefetches. + +2004-08-24 Zdenek Dvorak + + PR tree-optimization/17016 + * tree-ssa-loop-niter.c (number_of_iterations_cond, + number_of_iterations_exit): Use POINTER_TYPE_P instead + of testing for POINTER_TYPE. + +2004-08-24 Zdenek Dvorak + + * tree-ssa-loop-ivcanon.c: New file. + * tree-ssa-loop-manip.c (create_iv): New function. + * Makefile.in (tree-ssa-loop-ivcanon.o): Add. + (tree-ssa-loop.o, tree-ssa-loop-manip.o): Add SCEV_H dependency. + * cfgloop.c (mark_single_exit_loops): New function. + (verify_loop_structure): Verify single-exit loops. + * cfgloop.h (struct loop): Add single_exit field. + (LOOPS_HAVE_MARKED_SINGLE_EXITS): New constant. + (mark_single_exit_loops): Declare. + (tree_num_loop_insns): Declare. + * cfgloopmanip.c (update_single_exits_after_duplication): New function. + (duplicate_loop_to_header_edge): Use it. + * common.opt (fivcanon): New flag. + * timevar.def (TV_TREE_LOOP_IVCANON, TV_COMPLETE_UNROLL): New timevars. + * tree-cfg.c (tree_find_edge_insert_loc): Return newly created block. + (bsi_commit_edge_inserts_1): Pass null to tree_find_edge_insert_loc. + (bsi_insert_on_edge_immediate): New function. + * tree-flow.h (bsi_insert_on_edge_immediate, + canonicalize_induction_variables, tree_unroll_loops_completely, + create_iv): Declare. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_iv_canon and pass_complete_unroll. + * tree-pass.h (pass_iv_canon, pass_complete_unroll): Declare. + * tree-scalar-evolution.c (get_loop_exit_condition, + get_exit_conditions_rec, number_of_iterations_in_loop, + scev_initialize): Use single_exit information. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Record + missing assumptions. + (loop_niter_by_eval): Return number of iterations as unsigned + int. + * tree-ssa-loop.c (tree_ssa_loop_init): Mark single exit loops. + (tree_ssa_loop_ivcanon, gate_tree_ssa_loop_ivcanon, pass_iv_canon, + tree_complete_unroll, gate_tree_complete_unroll, pass_complete_unroll): + New passes. + (tree_ssa_loop_done): Call free_numbers_of_iterations_estimates. + * tree-ssanames.c (make_ssa_name): Allow creating ssa name before + the defining statement is ready. + * tree-vectorizer.c (vect_create_iv_simple): Removed. + (vect_create_index_for_array_ref, vect_transform_loop_bound): + Use create_iv. + (vect_transform_loop_bound): Use single_exit information. + (vect_analyze_loop_form): Cleanup bogus tests. + (vectorize_loops): Do not call flow_loop_scan. + * tree.h (may_negate_without_overflow_p): Declare. + * fold-const.c (may_negate_without_overflow_p): Split out from ... + (negate_expr_p): ... this function. + (tree_expr_nonzero_p): Handle overflowed constants correctly. + * doc/invoke.texi (-fivcanon): Document. + * doc/passes.texi: Document canonical induction variable creation. + +2004-08-24 Richard Sandiford + + * config/mips/mips.h (ISA_HAS_INT_CONDMOVE): Delete. + * config/mips/mips.c (print_operand): Fold %B/%b handling into %T/%t, + using the mode of the operand to decide between them. + * config/mips/mips.md (MOVECC): New mode macro. + (ccreg): New mode attribute. + (*mov{si,di,sf,df}_on_{cc,si,di}): Name formerly unnamed patterns. + Redefine using :GPR and :MOVECC. Use %T and %t for the condition. + (mov[sd]icc): Redefine using :GPR. + +2004-08-24 Richard Sandiford + + * config/mips/mips-protos.h (mips_emit_prefetch): Delete. + (mips_prefetch_cookie): New function. + * config/mips/mips.c (print_operand_address): Fix handling of + ADDRESS_CONST_INT. + (mips_emit_prefetch): Delete. + (mips_prefetch_cookie): New function. + * config/mips/mips.md (prefetch): Turn into a define_insn. Use a + mode of QImode for the address_operand. Use mips_prefetch_cookie + to calculate the first "pref" operand. + (prefetch_[sd]i, prefetch_[sd]i_address): Delete. + (prefetch_indexed_[sd]i): Redefine using :P. Use mips_prefetch_cookie. + +2004-08-24 Richard Earnshaw + + * arm.md: Include predicates.md. + * predicates.md: New file. + * arm.c (s_register_operand, arm_hard_register_operand) + (arm_general_register_operand, f_register_operand, reg_or_int_operand) + (arm_immediate_operand, arm_neg_immediate_operand) + (arm_not_immediate_operand, arm_rhs_operand, arm_rhsm_operand) + (arm_add_operand, arm_addimm_operand, arm_not_operand) + (offsettable_memory_operand, alignable_memory_operand) + (arm_reload_memory_operand, arm_float_rhs_operand) + (arm_float_add_operand, vfp_compare_operand, arm_float_compare_operand) + (index_operand, shiftable_operator, logical_binary_operator) + (shift_operator, equality_operator, arm_comparison_operator) + (minmax_operator, cc_register, dominant_cc_register) + (arm_extendqisi_mem_op, power_of_two_operand, nonimmediate_di_operand) + (di_operand, nonimmediate_soft_df_operand, soft_df_operand) + (const_shift_operand, load_multiple_operation) + (store_multiple_operation, multi_register_push, thumb_cmp_operand) + (thumb_cmpneg_operand, thumb_cbrch_target_operand) + (cirrus_register_operand, cirrus_fp_register) + (cirrus_shift_const): Delete, replaced with equivalents in + predicates.md. + (shift_op): Handle ROTATE. + * arm-protos.h: Delete declarations for above. + * arm.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. + * t-arm (MD_INCLUDES): Add predicates.md. + (s-preds): Depends on MD_INCLUDES. + +2004-08-24 Richard Sandiford + + * config/mips/mips.c (mips_gen_conditional_trap): Fix mode. + * config/mips/mips.md (*conditional_trap[sd]i): Name previously unnamed + patterns. Redefine using :GPR. Give the match_operator a mode. + Use '%2' rather than '%z2' for operand 2. + +2004-08-24 Richard Sandiford + + * config/mips/mips.md (load_call[sd]i): Redefine using :P. Add mode + attribute. + +2004-08-24 Richard Sandiford + + * config/mips/mips.md (indirect_jump): Use force_reg. Adjust names + of internal patterns. + (indirect_jump[sd]i): Renamed from indirect_jump_internal[12]. + Redefine using :P. + (tablejump): Use expand_binop to calculate address. Adjust names + of internal patterns. + (tablejump[sd]i): Renamed from tablejump_internal[12]. + Redefine using :P. + (tablejump_mips16[12]): Delete. + +2004-08-24 Richard Sandiford + + * config/mips/mips.md (*seq_[sd]i, *seq_[sd]i_mips16, *sne_[sd]i) + (*sgt_[sd]i, *sgt_[sd]i_mips16, *sge_[sd]i, *slt_[sd]i) + (*slt_[sd]i_mips16, *sle_[sd]i, *sle_[sd]i_mips16, *sgtu_[sd]i) + (*sgtu_[sd]i_mips16, *sge_[sd]i, *sltu_[sd]i, *sltu_[sd]i_mips16) + (*sleu_[sd]i, *sleu_[sd]i_mips16): Redefine using :GPR. + +2004-08-24 Richard Sandiford + + * config/mips/mips.md (cmpsi, cmpdi): Redefine using :GPR. + (*branch_zero[sd]i): Renamed from branch_zero{,_di}. Redefine + using :GPR. + (*branch_zero[sd]i_inverted): Likewise branch_zero{,_di}_inverted. + (*branch_equality[sd]i): Likewise branch_equality{,_di}. + (*branch_equality[sd]i_inverted): Likewise + branch_equality{,_di}_inverted. + (*branch_equality[sd]i_mips16): Name formerly unnamed patterns. + Redefine using :GPR. + +2004-08-24 Zack Weinberg + + * rtl.def: Reorganize, placing all codes used only in machine + descriptions at the end. + + * rtl.def: Wrap MD-only codes in #ifdef GENERATOR_FILE. + * gengtype.c: Don't include rtl.h. Define enum rtx_code and + rtx_name, rtx_format arrays by direct reference to rtl.def, + first undefining GENERATOR_FILE. Define enum insn_note and + note_insn_name array by direct reference to insn-notes.def. + (adjust_field_rtx_def): Remove local definition of rtx_name. + Use symbolic names for insn notes. + * Makefile.in (gengtype.o): Update dependencies. + +2004-08-24 Zack Weinberg + + * basic-block.h (struct basic_block_def): Reorder fields to + eliminate interior padding. Remove 'partition' field. + (BB_DISABLE_SCHEDULE, BB_HOT_PARTITION, BB_COLD_PARTITION) + (BB_UNPARTITIONED, BB_PARTITION, BB_SET_PARTITION) + (BB_COPY_PARTITION): New macros. + * bb-reorder.c, cfgcleanup.c, cfglayout.c, cfgrtl.c, ifcvt.c + Replace all references to the 'partition' field of a basic + block with new macros. + + * insn-notes.def: Delete NOTE_INSN_DISABLE_SCHED_OF_BLOCK. + * final.c (final_scan_insn): Don't handle it. + * modulo-sched.c: Set BB_DISABLE_SCHEDULE flag on g->bb + instead of emitting a NOTE_INSN_DISABLE_SCHED_OF_BLOCK note. + * sched-rgn.c (sched_is_disabled_for_current_region_p): + Look for a BB_DISABLE_SCHEDULE flag on the block instead of a note. + +2004-08-24 Nathan Sidwell + + * c-decl.c (c_init_decl_processing): Adjust + build_common_tree_nodes call. + * expmed.c (const_mult_add_overflow_p): Use + build_distinct_type_copy. + * stor-layout.c (early_type_list): Remove. + (layout_type): Don't append to early_type_list. + (initialize_sizetypes): Add signed_p argument. + (set_sizetype): Overwrite the stub type nodes directly. + * tree.c (copy_node_stat): Clear a type's value cache here ... + (build_distinct_type): ... not here. + (build_common_tree_nodes): Add signed_sizetype argument. Adjust. + * tree.h (initialize_sizetypes): Add signed_p argument. + (build_common_tree_nodes): Likewise. + + * objc/objc-act.c (get_static_reference): Use + build_variant_type_copy. + (get_protocol_reference): Likewise. + * objc/objc-act.h (TREE_STATIC_TEMPLATE): Use TREE_PRIVATE. + +2004-08-24 Richard Henderson + Andrew Pinski + + * gimplify.c (gimplify_array_ref_to_plus): Delete. + (gimplify_addr_expr): Do not call gimplify_array_ref_to_plus + for ARRAY_REF. + + * config/rs6000/rs6000.c (altivec_expand_builtin): Go passed + ARRAY_REF also to get to the STRING_CST. + +2004-08-24 Paul Brook + + * config/arm/arm.c (arm_override_options): Update error message. + * config/arm/arm.h (TARGET_HARD_FLOAT): Rename to + TARGET_HARD_FLOAT_ABI. + (TARGET_SOFT_FLOAT_ABI): Rename to TARGET_HARD_FLOAT. + (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Use TARGET_HARD_FLOAT_ABI. + +2004-08-24 Kazuhiro Inaoka + + PR target/17093 + * config/m32r.md (movsi_sda): Add SI mode specification to + UNSPEC. + +2004-08-24 Nick Clifton + + * config/m32r/m32r.h (PREDICATE_CODES): Remove duplicate definition + of seth_add3_operand. + +2004-08-24 Nathan Sidwell + + * Makefile.in (PROTO_OBJS): Add errors.o. + * protoize.c (fancy_abort): Remove. + * mips-tfile.c (fancy_abort): Add parameters. + +2004-08-24 Jonathan Wakely + + * doc/trouble.texi (C++ misunderstandings): Fix example code. + +2004-08-24 Andreas Tobler + + * Makefile.in (HOOKS_H): Add dependency on MACHMODE_H. + (host-default.o): Add dependency on HOOKS_H. + * config/x-linux: Likewise. + * config/x-solaris: Likewise. + * config/i386/x-mingw32: Likewise. + * config/rs6000/x-darwin: Likewise. + +2004-08-23 James E Wilson + + * reg-notes.def (REG_NOTE): In comment, change DEF_INSN_NOTE to + DEF_REG_NOTE. + +2004-08-23 Mark Mitchell + + PR c/14492 + * dwarf2out.c (loc_descriptor_from_tree): Robustify. + +2004-08-23 Diego Novillo + + * cfg.c (check_bb_profile): Fix typos. + * function.c (assign_parm_is_stack_parm): Likewise. + * tree-nested.c: Likewise. + +2004-08-23 Daniel Jacobowitz + + * ggc-zone.c (struc alloc_chunk): Rearrange flag bits and SIZE. + Remove TYPECODE. + (ggc_alloc_zone_1): Mark TYPE as unused. Don't save it in the chunk. + +2004-08-23 Eric Christopher + + * defaults.h (VECTOR_MODE_SUPPORTED_P): Remove macro. + * system.h (VECTOR_MODE_SUPPORTED_P): Poison. + * target-def.h (TARGET_VECTOR_MODE_SUPPORTED_P): Define. + * target.h: Ditto. + * hooks.h: Include machmode.h. + (hook_bool_mode_false): Declare. + * hooks.c (hook_bool_mode_false): Define. + * expr.c (vector_mode_valid_p): Use targetm.vector_mode_supported_p. + * stor-layout.c (layout_type): Ditto. + * config/alpha/alpha.c (alpha_vector_mode_supported_p): New function. + Define to target macro. + * config/alpha/alpha.h (VECTOR_MODE_SUPPORTED_P): Delete. + * config/arm/arm.c: Ditto. Use. + * config/arm/arm.h: Ditto. + * config/arm/arm-protos.h: Ditto. + * config/i386/i386.c: Ditto. + * config/i386/i386.h: Ditto. + * config/rs6000/rs6000.c: Ditto. + * config/rs6000/rs6000.h: Ditto. + * config/sh/sh.c: Ditto. + * config/sh/sh.h: Ditto. + * config/sh/sh-protos.h: Ditto. + * config/sh/sh.md: Use. + * doc/tm.texi: Move documentation for VECTOR_MODE_SUPPORTED_P + to TARGET_VECTOR_MODE_SUPPORTED_P. + +2004-08-23 Nathan Sidwell + + * Makefile.in (BUILD_ERRORS): Set to build-errors. + (errors.o): New target for host. + (build-errors.o): New target for build. + (genobjs): Replace errors.o with build-errors. + (gengenrtl$(buildexeext)): Add $(BUILD_ERRORS). + (GCOV_OBJS, GCOV_DUMP_OBJS): Add errors.o. + (fix-headers$(build_exeext)): Add $(BUILD_ERRORS). + (fix-header.o): Add errors.h + * collect2.c (fancy_abort): Add parameters. + * collect2.h (fancy_abort): Don't declare. + * errors.h (fancy_abort): Don't declare. + * errors.c: Include either bconfig.h or config.h. + (fancy_abort): Trim filename. + * fix-header.c (v_fatal, fatal): Remove. + (progname): Remove definition. + (main): Set progname here. + * gcc.c (fancy_abort): Add parameters. + * gcc.h (fancy_abort): Remove declaration. + * gcov.c (fancy_abort): Remove. + * rtl.h (fancy_abort): Don't declare. + (abort): Don't define. + * tree.h (fancy_abort): Don't declare. + (abort): Don't define. + * system.h (fancy_abort): Declare. + (abort): Define to fancy_abort. + * fixinc/Makefile.in (ALLOBJ): Add ../build-errors.o + + * tree.h (enum size_type_kind): Remove USIZETYPE, UBITSIZETYPE. + (usize_type, ubitsizetype): Remove. + * stor-layout.c (set_sizetype): Don't initialize usizetype, + ubitsizetype. + * fold-const.c (size_diffop): TYPE can never be ubitsizetype. + + * tree.h (build_distinct_type_copy): New. + (build_type_copy): ... here. Rename to ... + (build_variant_type_copy): ... here. + * tree.c (build_qualified_type): Rename build_type_copy call. + (build_distinct_type_copy): New, broken out of ... + (build_type_copy): ... here. Rename to ... + (build_variant_type_copy): ... here. Use + build_distinct_type_copy. + (build_common_tree_nodes_2): Rename build_type_copy call. + * c-common.c (c_common_nodes_and_builtins): Rename build_type_copy + call. + (handle_packed_attribute, handle_unused_attribute, + handle_transparanet_union_attribute, handle_aligned_attribute, + handle_deprecated_attribute): Likewise. + * c-decl.c (clone_underlying_type, store_parm_decls_oldstyle): + Likewise. + * config/arm/arm.c (arm_handle_isr_attribyte): Likewise. + * config/rs6000/rs6000.c (rs6000_init_builtins): Use + build_distinct_type_copy. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (mfhilo_[sd]i): Redefine using :GPR. Add mode + attribute. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (length): Don't use mips_fetch_insns for indexed + loads and stores. + (*lwxc1_, *ldxc1_, *swxc1_, *sdxc1_): Name + formerly unnamed patterns. Redefine using :P for the address. Remove + explicit length attributes. + +2004-08-23 Zdenek Dvorak + + * tree-ssa-loop-im.c (fem_single_reachable_address, for_each_memref): + New functions. + (single_reachable_address): Use them. + (schedule_sm): Add dump. + (is_call_clobbered_ref): New function. + (determine_lsm_reg): Check whether the reference is call clobbered. + Only work for gimple_reg_type values. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (*mov_ra): Name previously unnamed MIPS16 + $31 store insns. Redefine using :GPR. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (P): New mode macro. + (*xgot_hi[sd]i, *xgot_lo[sd]i, *got_disp[sd]i, *got_page[sd]i) + (*load_got[sd]i, *low[sd]i, *low[sd]i_mips16): Redefine using :P. + Add mode attributes. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (UNSPEC_[LS][WD][LR]): Delete in favor of... + (UNSPEC_{LOAD,STORE}_{LEFT,RIGHT}): ...these new constants. Shuffle + later constants to cover the gap. + (load, store): New mode attributes. + (mov_l[wd]l, mov_l[wd]r, mov_s[wd]l, mov_s[wd]r): Redefine using :GPR. + Use new unspec constants. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (one_cmpl[sd]i2): Redefine using :GPR. + (and[sd]3, ior[sd]i3, xor[sd]i3): Likewise. Change 32-bit patterns + to use register_operand rather than uns_arith_operand as the predicate + for operand 1. Remove redundant MIPS16 force_reg() for operand 1. + (*and[sd]i3, *ior[sd]i3, *xor[sd]i3): Name formerly unnamed patterns. + Redefine using :GPR. Make same predicate change here. Extend the + commutativity of operands 1 and 2 from the SImode version to the + DImode one. + (*and[sd]i3_mips16, *ior[sd]i3_mips16, *xor[sd]i3_mips16): Likewise, + but with no predicate changes. + (*nor[sd]i3): Redefine using :GPR. + +2004-08-23 Zdenek Dvorak + + * tree-ssa-operands.c (get_call_expr_operands): Add VUSE operands for + noreturn functions. + +2004-08-23 Richard Sandiford + + * config/mips/mips.h (ISA_HAS_DCLZ_DCLO): Delete. + * config/mips/mips.md (abs[sd]i2): Redefine using :GPR. Only use + branch-likely insns for absdi2 if GENERATE_BRANCHLIKELY. Use "%." + rather than "%z2" (with a fake const0_rtx for operand 2). + (ffs[sd]i2): Redefine using :GPR. + (clz[sd]i2): Likewise. Use ISA_HAS_CLO_CLZ for the 64-bit case. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md ({,u}divmod[sd]i4): Redefine using :GPR. + +2004-08-23 Richard Sandiford + + * config/mips/mips.md (any_extend): New code macro. + (u, su): New code attributes. + ({,u}mulsidi3, {,u}mulsidi3_32bit_internal, {,u}mulsidi3_32bit_r4000) + ({u,s}mulsi3_highpart, {u,s}mulsi3_highpart_internal) + ({u,s}mulsi3_highpart_mulhi_internal, {s,u}muldi3_highpart) + (*{s,u}mul_acc_di): Redefine using any_extend. + (*{,u}muls_di, *{s,u}msac_di): Likewise. Change names of patterns + to reflect real insn names. + (*mulsidi3_64bit, *mulsidi3_64bit_parts): Replace use of match_operator + with an any_extend template. + ({u,s}mulsi3_highpart_neg_mulhi_internal): Redefine using any_extend. + Add '*' to name. + +2004-08-23 Richard Sandiford + + * config/mips/mips.h (GENERATE_MULT3_SI): Check TARGET_MAD. + * config/mips/mips.md (mul[sd]i3, mul[sd]i3_internal) + (mul[sd]i3_r4000): Redefine using :GPR. + (mulsi3_mult3): Don't check TARGET_MAD separately. + (muldi3_mult3): Moved after mulsi_mult3. + +2004-08-23 Richard Sandiford + + * config.gcc (mips-*-*): Remove definitions of MASK_GAS and + OBJECT_FORMAT_ELF. Set MASK_SPLIT_ADDR by default if using GNU ld. + * config/mips/mips.h (MASK_GAS): Delete. Shuffle later masks down. + (TARGET_GAS, TARGET_MIPS_AS): Delete. + (TARGET_GPWORD): Define to true for n32 on IRIX. + (TARGET_SWITCHES): Remove -mmips-as. Turn -mgas into a no-op. + (MIPS_AS_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC): Delete. + (GAS_ASM_SPEC): Delete, folding into ASM_SPEC. + (ASM_ABI_DEFAULT_SPEC, TARGET_ASM_SPEC): Delete. + (MDEBUG_ASM_SPEC): Delete, folding into... + (SUBTARGET_ASM_DEBUGGING_SPEC): ...here. + (ASM_SPEC): Inline old GAS_ASM_SPEC. Use GNU names for ABI switches. + (EXTRA_SPECS): Remove mips_as_asm_spec, gas_asm_spec, target_asm_spec, + subtarget_mips_as_asm_spec, mdebug_asm_spec. Use MULTILIB_ABI_DEFAULT + to define asm_abi_default_spec. + (ASM_STABS_OP, ASM_STABN_OP, ASM_STABD_OP): Delete. + (TARGET_ASM_SELECT_SECTION): Delete. + * config/mips/mips.c (MIPS_MAX_FIRST_STACK_STEP): Define to 0x7ff0 + for non-mips16 code, removing previous workaround for SGI assemblers. + (TARGET_ASM_INTEGER, mips_assemble_integer): Delete. + (TARGET_ASM_ALIGNED_DI_OP): Define this instead. + (override_options): Remove !TARGET_GAS and !have_named_sections code. + (print_operand): Fold TARGET_GAS conditionals into asm strings. + (mips_output_filename): Remove !TARGET_GAS code. Replace use of + ASM_STABS_OP and ASM_STABN_OP. + (mips_file_start): Remove TARGET_MIPS_AS/TARGET_GAS checks. + (mips_output_aligned_decl_common): Remove mention of SGI o32 assembler. + (mips_output_function_prologue): Remove !TARGET_GAS code. + (mips_select_rtx_section): Remove !have_named_sections code. + (mips_select_section): Delete. + * config/mips/mips.md (trap): Remove !TARGET_GAS check. + * config/mips/linux.h (TARGET_DEFAULT): Remove use of MASK_GAS. + * config/mips/sdb.h (PUT_SDB_DEF, PUT_SDB_PLAIN_DEF): Delete. + (PUT_SDB_BLOCK_START, PUT_SDB_BLOCK_END): Fold TARGET_GAS conditional. + * config/mips/vxworks.h (ASM_SPEC): As for mips.h. + * config/mips/windiss.h (ASM_SPEC): Likewise. + +2004-08-23 Richard Sandiford + + * read-rtl.c (map_value, mapping, macro_group): New structures. + (BELLWETHER_CODE): New macro. + (modes, codes, bellwether_codes): New variables. + (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) + (uses_code_macro_p, apply_code_macro, apply_macro_to_string) + (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) + (add_condition_to_rtx, apply_macro_traverse, add_mapping) + (add_map_value, initialize_macros): New functions. + (def_hash, def_hash_eq_p): Generalize to anything that points to, + or starts with, a char * field. + (find_macro, read_mapping, check_code_macro): New functions. + (read_rtx_1): New, split out from read_rtx. Handle the new + define_{mode,code}_{macro,attr} constructs. Use find_macro + to parse the name of a code or mode. Use BELLWETHER_CODE to + extract the format and to choose a suitable code for rtx_alloc. + Modify recursive invocations to use read_rtx_1. + (read_rtx): Call initialize_macros. Apply code and mode macros + to the rtx returned by read_rtx_1. Cache everything after the + first macro expansion for subsequent read_rtx calls. + * doc/md.texi: Document new .md constructs. + * config/mips/mips.md (GPR): New mode macro. + (d, si8_di5): New mode attributes. + (any_cond): New code macro. + (add[sd]i3): Redefine using :GPR. + (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. + (*add[sd]i3_sp[12], *add3_mips16): Redefine using :GPR, naming + previously unnamed MIPS16 patterns. + (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long + lines. Don't match (plus (const_int 0) ...). + (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. + Use a define_split to generate the addition. + (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. + (subsi3_internal): Delete. + (*subsi3_extended): Renamed from subsi3_internal_2. + (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) + (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine + using an any_cond template. + +2004-08-23 Richard Sandiford + + * read-rtl.c (read_rtx): Tidy use of format_ptr. + +2004-08-23 Richard Sandiford + + * read-rtl.c (string_obstack): New file-scope variable. + (read_string, read_quoted_string, read_braced_string) + (read_escape): Remove obstack parameter and use string_obstack instead. + (read_rtx): Remove function-local rtl_obstack and initialize + string_obstack instead. Update call to read_string. + +2004-08-22 Andrew Pinski + + PR c/15262 + * c-typeck.c (build_unary_op): Use &a.b if the foldded lowered + expression is not constant. + (c_finish_return): Do not go through INDIRECT_REF when looking + for the inner expression of an ADDR_EXPR for warning about. + +2004-08-22 Richard Henderson + + PR 17075 + * cfgexpand.c (expand_gimple_tailcall): Detect when we can both + create new blocks and fall through. + (expand_gimple_basic_block): Update to match. + +2004-08-22 Ulrich Weigand + + * reload.c (find_reloads_address): Make return value tri-state. + Return -1 if LEGITIMIZE_RELOAD_ADDRESS succeeded. + (find_reloads): Assume that reloaded addresses match 'o' or + EXTRA_MEMORY_CONSTRAINT constraints only if find_reloads_address + returned 1 (not -1). Omit optional reloads for address operands + only if find_reloads_address returned 1 (not -1). + + * config/s390/s390.c (legitimize_reload_address): New function. + * config/s390/s390-protos.h (legitimize_reload_address): Declare. + * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Define. Call + legitimize_reload_address. + +2004-08-22 Richard Hendersion + + * tree.h (SAVE_EXPR_RESOLVED_P): New. + * gimplify.c (gimplify_save_expr): Use it. + * expr.c (expand_expr_real_1): Likewise. Also set DECL_IGNORED_P + on the temporary variable. + +2004-08-22 Andrew Pinski + + * fold-const.c (rtl_expr_nonnegative_p): Delete. + * tree.h (rtl_expr_nonnegative_p): Remove. + +2004-08-22 Steven Bosscher + + * config/i386/ppro.md (ppro_complex_insn): Add missing check + for cpu==pentiumpro. + + * combine.c (struct reg_stat): Fix comment typo. + +2004-08-22 Joseph S. Myers + + * c-tree.h (c_sizeof_nowarn): Remove. + +2004-08-21 Joseph S. Myers + + * c-decl.c (set_array_declarator_type): Rename to + set_array_declarator_inner. + (build_c_parm, build_attrs_declarator, build_function_declarator): + New functions. + (make_pointer_declarator): Call build_attrs_declarator. + * c-tree.h (set_array_declarator_type): Rename to + set_array_declarator_inner. + (build_c_parm, build_attrs_declarator, build_function_declarator): + New prototypes. + * c-parse.in (after_type_declarator, + parm_declarator_starttypename, parm_declarator_nostarttypename, + notype_declarator, absdcl_maybe_attribute, direct_absdcl1, parm, + firstparm): Use these functions + +2004-08-21 Joseph S. Myers + + * c-decl.c (build_array_declarator, set_array_declarator_type, + start_decl, grokdeclarator, grokparms): Change boolean parameters + to type bool. + * c-tree.h (build_array_declarator, set_array_declarator_type, + start_decl): Update prototypes. + * c-decl.c, c-parse.in: All callers changed. + +2004-08-21 Mike Stump + + * config/rs6000/darwin.h (SUBTARGET_OPTIONS): Move from here, to... + (darwin_fix_and_continue): Likewise. + (darwin_fix_and_continue_switch): Likewise. + * config/darwin.h (SUBTARGET_OPTIONS): ...here, to fix -mone-byte-bool. + (darwin_fix_and_continue): Likewise. + (darwin_fix_and_continue_switch): Likewise. + +2004-08-21 Danny Smith + + PR c++/16030 + * config/i386/winnt/c (gen_stdcall_suffix, gen_fastcall_suffix): + Remove, merging into ... + (gen_stdcall_or_fastcall_suffix): New function, returning tree + rather than const char*, and accepting additional parameter. + Don't add suffix to '*'-prefixed symbols or variadic functions. + (i386_pe_encode_section_info): Adjust for call to new function. + Call change_decl_assembler_name. + +2004-08-20 Mike Stump + + * config/darwin.c (machopic_indirect_data_reference): Mark + stubs as defined. + * config/386/386.c (darwin_local_data_pic): Add. + (legitimate_constant_p): Reorder so that PLUS handling runs + before darwin_local_data_pic to match the ordering in + legitimate_pic_address_disp_p and so that MINUS runs after + darwin_local_data_pic as otherwise the darwin_local_data_pic + logic can be skipped, which would be very bad. + (legitimate_pic_address_disp_p): Move from from here to + darwin_local_data_pic so it can be reused. + +2004-08-21 Alan Modra + + * config/rs6000/linux64.h (DOT_SYMBOLS): Define. + (CRT_CALL_STATIC_FUNCTION): Define !DOT_SYMBOLS version. + (ASM_DECLARE_FUNCTION_SIZE): Modify for !DOT_SYMBOLS. + (ASM_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC, DBX_OUTPUT_NFUN): Likewise. + (RS6000_ABI_NAME): Define as "linux". + (SUBSUBTARGET_OVERRIDE_OPTIONS): Set dot_symbols. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Select + ABI_AIX when rs6000_abi_name is "linux" and TARGET_64BIT. + * config/rs6000/rs6000-protos.h (rs6000_output_function_entry): Decl. + * config/rs6000/rs6000.c (dot_symbols): New global var. + (rs6000_output_function_entry): New function, modified for + !DOT_SYMBOLS.. + (print_operand ): ..extracted from here. + (rs6000_assemble_visibility): Modify for !DOT_SYMBOLS. + (rs6000_output_function_epilogue): Likewise. + (rs6000_elf_declare_function_name): Likewise. + * config/rs6000/rs6000.h (DOT_SYMBOLS): Define. + (ASM_WEAKEN_DECL, ASM_OUTPUT_DEF_FROM_DECLS): Modify for !DOT_SYMBOLS. + * configure.ac (HAVE_LD_NO_DOT_SYMS): Add new AC_DEFINE. + * configure: Regenerate. + * config.in: Regenerate. + +2004-08-20 Mark Mitchell + + * reload.c (find_reloads_address): Fix thinko in previous change. + + * reload.c (find_reloads_address): Reload the sum of a LO_SUM and + a CONST_INT. + +2004-08-20 Jakub Jelinek + + PR rtl-optimization/17099 + * combine.c (force_to_mode): Check if inner_mask has any bits set + outside of GET_MODE (x) instead of op_mode. + +2004-08-20 Mark Mitchell + + * config.gcc (arm*-*-symbianelf*): Add t-symbian Makefile + fragment. + * config/arm/bpabi.h (RENAME_LIBRARY_SET): Fix typo. + (SUBTARGET_EXTRA_ASM_SPEC): Pass -meabi=3 to the assembler. + * config/arm/symbian.h (SUBTARGET_CPU_DEFAULT): Assume ARMV5 + architecture. + (SUBTARGET_ASM_FLOAT_SPEC): Default to -mfpu=vfp for hard-float + configurations. + * config/arm/t-symbian: New file. + +2004-08-20 Andrew Pinski + + * regrename.c (kill_value_regno): ANSIfy. + +2004-08-20 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Improve DIV/MOD. + +2004-08-20 Daniel Jacobowitz + + * regrename.c (kill_value_one_regno): Renamed from kill_value_regno. + (kill_value_regno): New function, derived from kill_value. + (kill_value): Update. + (copyprop_hardreg_forward_1): Update call to kill_value_regno. + +2004-08-20 Daniel Berlin + + Fix PR tree-optimization/17111 + * tree-ssa-pre.c (create_value_expr_from): Don't change the types + of non-value_handles. + (bitmap_set_contains): All constants are in every set. + +2004-08-20 Nathan Sidwell + + * fold-const.c (round_up, round_down): Use build_int_cst. + Optimize common case. + +2004-08-20 Zack Weinberg + John David Anglin + + * config/pa/pa-protos.h (readonly_data, one_only_readonly_data_section, + one_only_data_section): Rename to som_readonly_data_section, + som_one_only_readonly_data_section and som_one_only_data_section. + * config/pa/pa.c (ONE_ONLY_TEXT_SECTION_ASM_OP, + NEW_TEXT_SECTION_ASM_OP, DEFAULT_TEXT_SECTION_ASM_OP): Delete + conditional defines. + (som_text_section_asm_op): Replace ONE_ONLY_TEXT_SECTION_ASM_OP, + NEW_TEXT_SECTION_ASM_OP and DEFAULT_TEXT_SECTION_ASM_OP with actual + string values. + (pa_select_section): Use renamed section functions. + * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, + SOM_READONLY_DATA_SECTION_FUNCTION, + SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION, + SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): + Define here ... + * config/pa/som.h: ... not here. + (DEFAULT_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP, + ONE_ONLY_TEXT_SECTION_ASM_OP, READONLY_DATA_ASM_OP, + ONE_ONLY_READONLY_DATA_SECTION_ASM_OP, + ONE_ONLY_DATA_SECTION_ASM_OP): Delete. + (READONLY_DATA_SECTION): Use som_readonly_data_section. + +2004-08-20 Nathan Sidwell + + * fold-const.c (int_const_binop): Don't generate non-overflowing + size-types specially. + (fold_convert_const): Likewise. + + * stor-layout.c (initialize_sizetypes): Set SIZETYPE earlier, + clear cache on copied sizetype. + +2004-08-20 Ben Elliston + + * configure.ac: Don't escape apostrophe in --enable-coverage help. + * configure: Regenerate. + +2004-08-20 Danny Smith + + PR 5620 + * gcc.c (struct stat input_stat): Don't define if + HOST_LACKS_INODE_NUMBERS + (do_spec_1): If HOST_LACKS_INODE_NUMBERS, use lrealpath rather + than stat to determine if temp file is same as input file. + * doc/hostconfig.texi: Document HOST_LACKS_INODE_NUMBERS. + * config/i386/xm-mingw32.h: Define HOST_LACKS_INODE_NUMBERS + +2004-08-20 Richard Sandiford + + * configure.ac (mips*-*-*): Print an error if not using GAS. + * configure: Regenerated. + * doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove + comments about buggy MIPSpro assemblers. + * config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h + before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix. + Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for + IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld. + * config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES) + (DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC) + (NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE) + (TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h. + (WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor + of more general IRIX 6 definitions. + (OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL) + (HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions. + (TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION) + (LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC) + (ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) + (PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER) + (LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL) + (TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS) + (ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS) + (SUBTARGET_EXTRA_SPECS): Delete definitions or undefs. + (LINK_SPEC): Move most of definition to iris.h. + (SUBTARGET_LINK_SPEC): New macro. + (IRIX_STARTFILE_SPEC): Fold into... + (STARTFILE_SPEC): ...here. + (IRIX_ENDFILE_SPEC): Fold into... + (ENDFILE_SPEC): ...here. + * config/mips/iris6.h (TARGET_IRIX5): Remove override. + (WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE) + (DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP) + (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME) + (ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h. + (TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits. + (DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL) + (SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO) + (PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX) + (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE) + (FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY) + (POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC) + (SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC) + (BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*) + (EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP) + (DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME) + (ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL) + (ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs. + (TARGET_IRIX6): Define to 1. + (DRIVER_SELF_SPECS): Define. + (DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS. + (SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS. + (SUBTARGET_LINK_SPEC): New macro. + (IRIX_STARTFILE_SPEC): Fold into... + (STARTFILE_SPEC): ...here. Remove !mabi=* case. + (SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros. + (LIB_SPEC, LIBGCC_SPEC): Use them. + (LIB_SPEC): Remove !mabi=* case. + (IRIX_ENDFILE_SPEC): Fold into... + (ENDFILE_SPEC): ...here. Remove !mabi=* case. + * config/mips/mips-protos.h (irix_output_external_libcall): Delete. + * config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete. + (TARGET_IRIX6): New macro. + (ASM_ABI_DEFAULT_SPEC): Remove !ELF definition. + (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER) + (LABEL_AFTER_LOC): Delete. + * config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END) + (TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions. + (mips_build_builtin_va_list): Check TARGET_IRIX6. + (override_options): Remove TARGET_SGI_O32_AS-related code. + (irix_output_external_libcall): Make static. + (mips_output_filename): Avoid use of SET_FILE_NUMBER and + LABEL_AFTER_LOC. + (mips_file_start): Tidy guard for ABI sections. Remove use of + ABICALLS_ASM_OP; use .abicalls instead. + (mips_output_aligned_decl_common, mips_declare_object_name) + (mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS. + (mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting + .globl foo .text directives. + (irix_asm_named_section_1, irix_asm_named_section) + (irix_section_align_entry, irix_section_align_htab) + (irix_orig_asm_out_file, irix_section_align_entry_eq) + (irix_section_align_entry_hash, irix_asm_output_align) + (irix_file_start, irix_section_align_1, copy_file_data) + (irix_file_end, irix_section_type_flags): Delete. + * config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section. + Use standard section syntax. Remove protective "jr $31". + (__gcc_fini): Likewise .gcc_fini. + * config/mips/irix-crtn.asm: Adjust sections accordingly. + * config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from + iris5gas.h. + * config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved + from t-irix-gld. + (EXTRA_MULTILIB_PARTS): Define. + * config/mips/t-iris6: Remove bogus comment. + (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete. + * config/mips/iris5gas.h, config/mips/iris5gld.h, + config/mips/iris6gas.h, config/mips/iris6gld.h, + config/mips/t-iris5-as, config/mips/t-iris5-gas + config/mips/t-irix-gld: Delete. + * config/mips/iris.h: New file. + * config/mips/t-slibgcc-irix: Renamed from t-iris5-6. + +2004-08-20 Richard Earnshaw + + * postreload.c (reload_cse_move2add): Allow any condjump, but check + that the implicit set isn't clobbered in the jump insn. + +2004-08-19 Mark Mitchell + + * defaults.h (TARGET_LIBGCC_LIBFUNCS): Remove. + * optabs.c (init_optabs): Don't check it. + * config/arm/bpabi.h (TARGET_LIBGCC_LIBFUNCS): Do not define. + * doc/tm.texi (TARGET_LIBGCC_FUNCS): Remove. + +2004-08-18 Andreas Krebbel + + * config/s390/s390.md (s390_warn_framesize_string) + (s390_warn_dynamic_string, s390_stack_size_string) + (s390_stack_guard_string): New global string variables. + (s390_warn_framesize, s390_warn_dynamicstack_p, s390_stack_size) + (s390_stack_guard): New global variables. + (override_options): Added checks for the new options. + (s390_emit_prologue): Emit stack check and trap code and perform + compile time stack size checking. + + * config/s390/s390.h (TARGET_OPTIONS): Added new options + "warn-framesize", "warn-dynamicstack", "stack-size" and + "stack-guard". + + * doc/invoke.texi: Added documentation for the new options. + +2004-08-19 Ulrich Weigand + + * unwind-dw2-fde.c (get_cie_encoding): Cast argument to strlen + to eliminate warning. + (linear_search_fdes): Declare p as unsigned. + (binary_search_mixed_encoding_fdes): Likewise. + * unwind-dw2.c (get_cie_encoding): Cast argument to strlen + to eliminate warning. + * config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Add missing + type cast. + +2004-08-19 Ulrich Weigand + + * config/s390/s390-protos.h (preferred_la_operand_p): Adapt prototype. + * config/s390/s390.c (preferred_la_operand_p): Accept two operands + instead of one. Check for strictly legitimate address. + * config/s390/s390.md ("*la_31"/"*la_64" peepholes): Adapt call + to preferred_la_operand_p, do not call gen_rtx_PLUS in predicate. + +2004-08-19 Eric Christopher + + * langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove. + * langhooks.h (unsave_expr_now): Ditto. + * tree.h (unsave_expr_1): Remove prototype. + (lhd_unsave_expr_now): Rename to unsave_expr_now. + * tree-inline.c (unsave_expr_1): Move here + from tree.c. Make static. + (unsave_expr_now): Rename from lhd_unsave_expr_now. + * tree-sra.c: Fix up for rename. + * tree-ssa-copy.c: Ditto. + * tree-eh.c: Ditto. + * tree.c (unsave_expr_1): Move to tree-inline.c. + +2004-08-19 Caroline Tice + + * config/i386/cygming.h (switch_to_section): Fix typo (change + in_unlikely_text_section to in_unlikely_executed_text). + +2004-08-19 Daniel Berlin + + * vec.h (VEC_lower_bound): New macro. + +2004-08-19 Richard Sandiford + + PR target/16446 + * config/mips/mips.c (struct mips_arg_info): Delete num_bytes. + (mips_arg_info): Update accordingly. Remove common treatment of fpr_p; + treat each ABI separately. Deal with n32/n64 complex float arguments. + (function_arg): Add associated complex handling here. + +2004-08-19 Richard Henderson + + * config/arm/arm.c (arm_gen_load_multiple): Use + adjust_automodify_address. Take base memory and offset instead + of unchanging/struct/scalar bits. + (arm_gen_store_multiple): Likewise. + (arm_gen_movmemqi): Use adjust_automodify_address. + * config/arm/arm-protos.h: Update decls. + * config/arm/arm.md (load_multiple): Update arm_gen_load_multiple call. + (store_multiple): Similarly. + +2004-08-19 J"orn Rennecke + + * regclass.c (globalize_reg): Update call_really_used_regs. + +2004-08-19 Nathan Sidwell + + * doc/invoke.texi (integer-share-limit): Document. + + * tree.h (TYPE_CACHED_VALUES_P): New. + (TYPE_CACHED_VALUES): New. + (TYPE_ORIG_SIZE_TYPE): Adjust. + * tree.def (INTEGER_CST): Update documentation. + * tree.c: Inlcude params.h. + (build_int_cst): Cache small values. + (build_type_copy): Do not copy the value cache. + * c-common.c (c_common_nodes_and_builtins): Add comment, remove + unneeded zeroing. + * c-typeck.c (build_c_cast): Add comment about OVERFLOW setting. + * expmed.c (const_mult_add_overflow_p): Clear type copy's value + cache. + * fold-const.c (force_fit_type): Copy value when setting + overflows. + (int_const_binop): Likewise. + * stor-layout.c: Include params.h + (set_sizetype): Create values cache. + (fixup_unsigned_type): Set UNSIGNED_P before caching any values. + * params.def (PARAM_INTEGER_SHARE_LIMIT): New. + * params.h (INTEGER_SHARE_LIMIT): New. + * Makefile.in (tree.o, stor-layout.o): Depend on PARAMS_H. + +2004-08-19 Paolo Bonzini + + * gimplify.c (gimplify_minimax_expr): Remove. + (gimplify_expr) : Remove special handling. + +2004-08-19 Dorit Naishlos + + * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace + STACK_BOUDARY with PREFERRED_STACK_BOUNDARY. + +2004-08-19 Mark Mitchell + + * bpabi.h (FPUTYPE_DEFAULT): Set it to FPUTYPE_VFP. + +2004-08-18 Andrew Pinski + + * varasm.c (ecode_reg_name): Do nothing if the asmspec is empty. + +2004-08-18 Mark Mitchell + + * config/arm/bpabi.c (__aeabi_ul2d): Give it default visibility. + (__aeabi_ul2f): Likewise. + +2004-08-18 Richard Henderson + + * config/xtensa/xtensa.c (xtensa_expand_block_move): Expand block + move to rtl completely. + (struct meminsnbuf, xtensa_emit_block_move): Remove. + (xtensa_find_mode_for_size): Remove. + * config/xtensa/xtensa-protos.h (xtensa_emit_block_move): Remove. + * config/xtensa/xtensa.md (movmemsi_internal): Remove. + +2004-08-18 Richard Henderson + + * config/mcore/mcore.c (mode_from_align): Remove DImode. + (block_move_sequence): Rewrite to use adjust_address. + (mcore_expand_block_move): Cleanup logic. Accept only operands. + Return boolean indicating success/failure. + * config/mcore/mcore-protos.h (mcore_expand_block_move): Update decl. + * config/mcore/mcore.md (movmemsi): Update to match. + +2004-08-18 Mike Stump + + * doc/invoke.texi (-mfix-and-continue): Add support for + fast turn around debugging. + (-ffix-and-continue): Likewise. + (-mindirect-data): Likewise. + (-findirect-data): Likewise. + * config/darwin.c (TARGET_FIX_AND_CONTINUE): Likewise. + (indirect_data): Likewise. + (machopic_data_defined_p): Likewise. + (machopic_output_indirection): Likewise. + (darwin_encode_section_info): Likewise. + (darwin_fix_and_continue): Likewise. + (darwin_fix_and_continue_switch): Likewise. + * config/darwin.h (MACHO_SYMBOL_STATIC): Likewise. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise. + (SUBTARGET_OPTION_TRANSLATE_TABLE): Likewise. + (SUBTARGET_OPTIONS): Likewise. + (darwin_fix_and_continue): Likewise. + (darwin_fix_and_continue_switch): Likewise. + (TARGET_FIX_AND_CONTINUE): Likewise. + * config/rs6000.c (rs6000_emit_prologue): Likewise. + +2004-08-19 Steven Bosscher + + * basic-block.h (struct edge_def): Remove crossing_edge. + (EDGE_CROSSING): New define. + (EDGE_ALL_FLAGS): Update. + * bb-reorder.c (find_traces_1_round, better_edge_p, + find_rarely_executed_basic_blocks_and_cr, fix_up_fall_thru_edges, + find_jump_block, fix_crossing_conditional_branches, + fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): + Replace all occurences of crossing_edge with an edge flag check + or set/reset. + * cfgcleanup.c (try_simplify_condjump, try_forward_edges, + try_crossjump_bb): Likewise. + * cfglayout.c (fixup_reorder_chain): Likewise. + * cfgrtl.c (force_nonfallthru_and_redirect, + commit_one_edge_insertion): Likewise. + + * Makefile.in (cfganal.o): Depend on TIMEVAR_H. + * tree-flow.h (compute_dominance_frontiers): Move prototype... + * basic-block.h: ...here. + * tree-cfg.c (compute_dominance_frontiers_1, + compute_dominance_frontiers): Move from here... + * cfganal.c: ...to here. Include timevar.h. + +2004-08-18 James E Wilson + + * config/mips/mips.h (ASM_SPEC): In comment, change -meabi= to -mabi=. + * config/mips/sb1.md (ir_sb1_divsf_1pipe): Renamed from ...1pipes. + + * config/mips/mips.md (type): Add frdiv. + (divsf3+1, divsf3+2): Change type to frdiv. + * config/mips/sb1.md (ir_sb1_recipsf_2pipes, ir_sb1_recipsf_1pipe, + ir_sb1_recipdf_2pipes, ir_sb1_recipdf_1pipe): New. + + * config/mips/3000.md (r3k_fdiv_single, r3k_fdiv_double): Add frdiv. + * config/mips/4300.md (r4300_fdiv_single, r4300_fdiv_double): Likewise. + * config/mips/4600.md (r4600_fdiv_single, f4600_fdiv_double): Likewise. + * config/mips/5000.md (r5k_fdiv_single): Likewise. + * config/mips/5400.md (ir_vr54_fdiv_sf, ir_vr54_fdiv_df): Likewise. + * config/mips/5500.md (ir_vr55_fdiv_sf, ir_vr55_fdiv_df): Likewise. + * config/mips/6000.md (r6k_fdiv_single, r6k_fdiv_double): Likewise. + * config/mips/7000.md (rm7_fp_divsqrt_df, rm7_fp_divsqrt_sf): Likewise. + * config/mips/9000.md (rm8k_fdivs, rm9k_fdivd): Likewise. + * config/mips/generic.md (generic_fdiv_single, generic_fdiv_double): + Likewise. + * config/mips/sr71k.md (ir_sr70_fdiv_sf, ir_sr70_fdiv_df): Likewise. + +2004-08-18 Robert Bowdidge + + * config/rs6000/x-darwin: Remove XCFLAGS -mdynamic-no-pic to + get regression tester working again. + +2004-08-18 Zack Weinberg + + * insn-notes.def, reg-notes.def: New files. + * rtl.h: Use them to define enum insn_note and enum reg_note. + * rtl.c: Use them to define note_insn_name and reg_note_name. + * Makefile.in (RTL_BASE_H): Update. + + * modulo-sched.c, sched-rgn.c, final.c: NOTE_DISABLE_SCHED_OF_BLOCK + renamed to NOTE_INSN_DISABLE_SCHED_OF_BLOCK. + +2004-08-18 Richard Earnshaw + + * arm.c (arm_size_rtx_costs): New function. + (arm_override_options): Use it if optimizing for space. + +2004-08-18 Richard Henderson + + * emit-rtl.c (gen_const_mem): New. + * rtl.h (gen_const_mem): Declare. + * expr.c (do_tablejump): Use it. + * varasm.c (force_const_mem): Likewise. + * config/darwin.c (machopic_indirect_data_reference): Likewise. + (machopic_legitimize_pic_address): Likewise. + * config/arm/arm.c (legitimize_pic_address): Likewise. + * config/i386/i386.c (legitimize_pic_address): Likewise. + (legitimize_tls_address): Likewise. + * config/ia64/ia64.c (ia64_expand_tls_address): Likewise. + * config/ia64/ia64.md (load_fptr): Likewise. + * config/m32r/m32r.c (m32r_legitimize_pic_address): Likewise. + * config/pa/pa.c (legitimize_pic_address): Likewise. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise. + (rs6000_emit_move): Likewise. + * config/s390/s390.c (legitimize_pic_address): Likewise. + (legitimize_tls_address): Likewise. + * config/s390/s390.md (casesi): Likewise. + * config/sh/sh.c (sh_reorg): Likewise. + * config/sparc/sparc.c (legitimize_pic_address): Likewise. + * config/v850/v850.md (casesi): Likewise. + + * config/darwin.c (machopic_indirect_call_target): Set MEM_NOTRAP_P. + * config/sh/sh.c (prepare_move_operands): Remove incorrect + use of MEM_READONLY_P. + +2004-08-18 Steven Bosscher + + * Makefile.in (OBJS-common): Add postreload-gcse.c. + Add new postreload-gcse.o. + * cse.c (SAFE_HASH): Define as wrapper around safe_hash. + (lookup_as_function, insert, rehash_using_reg, use_related_value, + equiv_constant): Use SAFE_HASH instead of safe_hash. + (exp_equiv_p): Export. Add for_gcse argument when comparing + for GCSE. + (lookup, lookup_for_remove, merge_equiv_classes, find_best_addr, + find_comparison_args, fold_rtx, cse_insn): Update callers. + (hash_rtx): New function derived from old canon_hash and bits + from gcse.c hash_expr_1. + (canon_hash_string): Rename to hash_rtx_string. + (canon_hash, safe_hash): Make static inline. Call hash_rtx. + * cselib.c (hash_rtx): Rename to cselib_hash_rtx. + (cselib_lookup): Update this caller. + * gcse.c (modify_mem_list_set, canon_modify_mem_list_set): + Make static. + (hash_expr): Call hash_rtx. + (ldst_entry): Likewise. + (expr_equiv_p): Call exp_equiv_p. + (struct unoccr, hash_expr_1, hash_string_1, lookup_expr, + reg_used_on_edge, reg_set_between_after_reload_p, + reg_used_between_after_reload_p, get_avail_load_store_reg, + is_jump_table_basic_block, bb_has_well_behaved_predecessors, + get_bb_avail_insn, hash_scan_set_after_reload, + compute_hash_table_after_reload, + eliminate_partially_redundant_loads, gcse_after_reload, + get_bb_avail_insn, gcse_after_reload_main): Remove. + * postreload-gcse.c: New file, reincarnating most of the above. + * rtl.h (exp_equiv_p, hash_rtx): New prototypes. + (gcse_after_reload_main): Update prototype. + * timevar.def (TV_GCSE_AFTER_RELOAD): New timevar. + * passes.c (rest_of_handle_gcse2): Use it. + +2004-08-18 Diego Novillo + + * tree-ssa-loop.c (pass_loop_init): Add TODO_dump_func. + (pass_loop_done): Likewise. + +2004-08-18 Andrew Pinski + + * config/rs6000/darwin.md: Delete the altivec patterns which are + handled differently now. + (load_macho_picbase_di): Make sure that is only happens for TARGET_64BIT + (macho_correct_pic_di): Likewise. + (call_indirect_nonlocal_darwin64): Likewise. + Delete the save world/saveFP/saveVec patterns. + + Revert the reversion of: 2004-08-16 Stan Shebs + * config/darwin.c (macho_indirect_data_reference): Add DImode case. + * config/rs6000/rs6000.md: Include darwin.md. + (builtin_setjmp_receiver): Add DImode case. + * config/rs6000/rs6000.c (rs6000_emit_move): Add DImode case to + Darwin bits. + +2004-08-18 Matt Austern + + Dead code stripping + * darwin.h (EH_FRAME_SECTION_ATTR): Mark so it doesn't get stripped. + * darwin.c (darwin_file_end): Mark file as potentially strippable. + +2004-08-18 Richard Henderson + + * alias.c (readonly_fields_p): Remove. + (objects_must_conflict_p): Don't call it. + * tree.h (readonly_fields_p): Remove. + * langhooks.h (struct lang_hooks): Remove honor_readonly. + * langhooks-def.h (LANG_HOOKS_HONOR_READONLY): Remove. + +2004-08-18 Diego Novillo + + * tree-dfa.c (add_referenced_var): Only global variables are + call-clobbered. + * tree-flow.h (struct ptr_info_def): Add field pt_global_mem. + * tree-ssa-alias.c (compute_points_to_and_addr_escape): Mark + all pointers dereferenced if the statement dereferences them. + (create_name_tags): Do not create memory tags for pointers + that have PT_ANYTHING set. + Also check if PT_VARS is not empty before creating a name tag. + (compute_flow_sensitive_aliasing): Don't mark call-clobbered + variables that share the same alias set with a pointer that + may point anywhere. + (add_may_alias): Add FIXME comment to remove clobbering + aliased variables and tags. + (replace_may_alias): Likewise. + (set_pt_anything): Do not clear PT_VARS nor IS_DEREFERENCED. + (merge_pointed_to_info): If the original variable has not + points-to information, call set_pt_anything. + (add_pointed_to_var): Do not prevent adding a pointed-to + variable if the pointers is PT_ANYTHING. + If the variable is a global, set PT_GLOBAL_MEM. + (collect_points_to_info_r): Don't assume that PLUS_EXPRs of + pointer type only come in PTR+OFFSET flavours. + Always call merge_pointed_to_info on PHI arguments that are + SSA_NAMEs. + (get_nmt_for): Mark call-clobbered tags whose pointer points + to global memory. + * tree-ssa-operands.c (opf_kill_def, opf_no_vops): Switch + values. + (get_indirect_ref_operands): Always clear OPF_KILL_DEF from + FLAGS. + (add_stmt_operand): Abort if the caller tried to add a killing + definition for a memory tag. + * tree-ssa.c (verify_flow_sensitive_alias_info): Remove + unnecessary checks. + +2004-08-18 J"orn Rennecke + + * sh.h (CONDITIONAL_REGISTER_USAGE): Don't exclude fixed registers + from call_used_regs. Update call_really_used_regs. + (CALL_REALLY_USED_REGISTERS): Define. + * sh.c (output_stack_adjust, shmedia_target_regs_stack_space): + Replace call_used_regs with call_really_used_regs. + (calc_live_regs, sh_media_register_for_return): Likewise. + (sh5_schedule_saves, sh_expand_prologue, reg_unused_after): Likewise. + * sh.md (return_media): Likewise. + +2004-08-18 Andrew Pinski + + * config/darwin.c (machopic_legitimize_pic_address): Only set + MEM_READONLY_P in the non TARGET_TOC case. + +2004-08-18 Zack Weinberg + + * rtl.def (NIL): Delete. + * read-rtl.c (read_rtx): Handle (nil) like (define_constants). + Tighten the syntax a little. + + * cfgloop.h, combine.c, cse.c, loop-iv.c, postreload.c, reload.c + * config/alpha/alpha.c, config/alpha/alpha.h, config/arc/arc.h + * config/arm/arm.h, config/frv/frv.h, config/i386/i386.c + * config/i386/predicates.md, config/m32r/m32r.h + * config/m68hc11/m68hc11.c, config/mcore/mcore.h, config/mips/mips.c + * config/mmix/mmix.c, config/pa/pa.h, config/sh/sh.h + * config/sparc/sparc.h, doc/tm.texi: + Replace all occurrences of NIL with UNKNOWN. + +2004-08-18 Zack Weinberg + + * dojump.c (do_jump ): Do not recursively call + self with a TRUTH_ORIF_EXPR; generate the appropriate jump + sequence inline. Move drop_through_label code into this + block, being the only place it is used. Adjust comments. + +2004-08-18 Fariborz Jahanian + + * config/rs6000/altivec.md: Add new patterns for calls to + save_world/rest_world functions. + + * config/rs6000/rs6000-protos.h: (save_world_operation, + restore_world_operation) new declarations. + + * config/rs6000/rs6000.c: (struct rs6000_stack) new world_save_p + field added. + (rs6000_stack_info): Set world_save_p field. + (save_world_operation): New function. + (restore_world_operation): New function. + (compute_save_world_info): New function. + (rs6000_stack_info): Call compute_save_world_info. + (rs6000_emit_prologue): Check for world_save_p and generate + pattern to call save_world for saving all non-volatile and + special registers. + (rs6000_emit_epilogue): Check for world_save_p and generate + pattern to call rest_world to restore saved registers. + + config/rs6000/rs6000.h: macros FIRST_SAVED_ALTIVEC_REGNO, + FIRST_SAVED_FP_REGNO, FIRST_SAVED_GP_REGNO defined. + (rs6000_reg_names): New entries added for save_world_operation and + restore_world_operation. + +2004-08-18 Caroline Tice + + * Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add + "-freorder-blocks-and-partition" to the flags used in second + stage of profiledbootstrap. + * bb-reorder.c (push_to_next_round_p): Add new variable, + next_round_is_last; set and use variable to make sure, when + partitioning, that the last trace construction round consists + of all (and only) cold basic blocks. + (rotate_loop): Don't copy blocks that end in a section + crossing jump. + (copy_bb): Correctly initialize "partition" of duplicated bb. + (add_unlikely_executed_notes): Add a comment. + (find_rarely_executed_basic_blocks_and_crossing_edges): Modify + to make sure, if function contains hot blocks, that the + successors of ENTRY_BLOCK_PTR are hot; also, only look for + crossing edges if the architecture supports named sections. + (mark_bb_for_unlikely_executed_section): Modify to always + insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after + the basic block note insn. + (fix_crossing_unconditional_branches): Remove extra space. + (fix_edges_for_rarely_executed_code): Modify to only do + partitioning work if the architecture supports named sections. + (reorder_basic_blocks): Modify to only add + NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture + supports named sections. + * c-common.c (handle_section_attribute): Initialize new global + variable, user_defined_section_attribute, to true if user has + specified one. + * cfgcleanup.c (try_forward_edges): Modify to not attempt to + forward edges that cross section boundaries. + * cfglayout.c (fixup_reorder_chain): Modify to only fix up + partitioning information if the architecture supports named + sections. + * cfgrtl.c (target.h): Add statement to include this. + (rtl_split_block): Make sure newly created bb gets correct + partition. + (try_redirect_by_replacing_jump): Make sure redirection isn't + attempting to cross section boundaries. + (force_nonfallthru_and_redirect): Only do partition fix up if + architecture supports named sections. + (rtl_split_edge): Make sure newly created bb ends up in + correct partition. + (commit_one_edge_insertion): Remove code that incorrectly + updated basic block partition; Make sure partition fix up only + happens if architecture supports named sections and it's not + already done. + (rtl_verify_flow_info_1): Fix if-condition on test/error + condition that fallthru edges are not allowed to cross section + boundaries. + * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this. + * final.c (final_scan_insn): Remove redundant test from if-statement; + change calls to text_section into calls to function_section; add code + to only to partitioning fix up if architecture supports named + sections. + * ifcvt.c (find_if_case_1): Make sure newly created bb has correct + partition. + (if_convert): Add targetm.have_named_sections to test. + * output.h (unlikely_section_label): Extern declaration for new global + variable. + (unlikely_text_section_name): Likewise. + * opts.c (decode_options): If both partitioning and DWARF debugging + are turned on, issue a warning that this doesn't work, and change + partitiong to basic block reordering (without hot/cold partitions). + * passes.c (rest_of_handle_final): Re-set new global variable, + user_defined_section_attribute, to false. + (rest_of_compilation): Change options for calling partitioning + function: Don't call if the user defined the section attribute, and + don't call if DECL_ONE_ONLY is true for the current function. + * predict.c (choose_function_section): Return immediately if we + are doing hot/cold partitioning (i.e. let the basic block partitioning + determine where the function belongs). + * reg-stack.c (emit_swap_insn): Add condition to step over + NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. + * toplev.c (user_defined_section_attribute): New global variable. + * toplev.h (user_defined_section_attribute): Extern declaration + for new global variable. + * varasm.c (unlikely_section_label): New global variable. + (unlikely_text_section_name): New global variable. + (unlikely_text_section): Add code to initialize + unlikely_text_section_name if necessary; modify to use + unlikely_text_section_name and unlikely_section_label; also to use + named_section properly. + (in_unlikely_text_section): Modify to work correctly with + named_section and to use unlikely_text_section_name. + (named_section): Add code to work properly with cold section. + (function_section): Clean up if-statement. + * config/darwin.c (darwin_asm_named_section): Return to original + code, removing use of SECTION_FORMAT_STRING. + * config/arm/pe.h (switch_to_section): Add case for + in_unlikely_executed_text to switch statement. + * config/i386/cygming.h (switch_to_section): Likewise. + * config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. + (SECTION_FORMAT_STRING): Likewise. + * config/mcore/mcore.h (switch_to_section): Likewise. + * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove. + (SECTION_FORMAT_STRING): Remove. + +2004-08-18 Roger Sayle + + * config/i386/i386.h (FIXED_REGISTERS): Update encoding to be + -ffixed-reg safe, by preserving the meanings of zero and one. + (CALL_USED_REGISTERS): Likewise. + (CONDITIONAL_REGISTER_USAGE): Update to process new encodings. + +2004-08-18 Kaz Kojima + + * config/sh/sh.c (split_branches): Check the result of + next_active_insn. + (sh_output_mi_thunk): Call init_flow if basic_block_info is null. + Call rtl_register_cfg_hooks. + +2004-08-18 Richard Henderson + + * rtl.h (MEM_READONLY_P): Replace RTX_UNCHANGING_P. + * alias.c (true_dependence): Update to match new semantics. + (canon_true_dependence, write_dependence_p): Likewise. + (anti_dependence, output_dependence): Update write_dependence_p args. + (unchanging_anti_dependence): Remove. + * calls.c (purge_mem_unchanging_flag): Remove. + (fixup_tail_calls): Don't call it. + (expand_call): Don't add unchanging memory to function usage. + * expr.c (emit_block_move_via_libcall): Likewise. + (clear_storage_via_libcall): Don't clobber RTX_UNCHANGING_P mems. + (get_subtarget): Don't use RTX_UNCHANGING_P. + (expand_assignment, store_constructor, expand_expr_real_1): Likewise. + (do_tablejump): Set MEM_READONLY_P, not RTX_UNCHANGING_P. + * combine.c (get_last_value_validate): Use MEM_READONLY_P. + * cse.c (insert): Don't use RTX_UNCHANGING_P. + (cse_insn, canon_hash): Use MEM_READONLY_P. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Use MEM_READONLY_P + instead of RTX_UNCHANGING_P. + * explow.c (maybe_set_unchanging): Remove. + * expr.h (maybe_set_unchanging): Remove. + * flow.c (insn_dead_p, mark_used_regs): Use anti_dependence. + * function.c (assign_stack_temp_for_type): Don't use RTX_UNCHANGING_P. + (assign_parm_setup_reg, expand_function_start): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * ra-rewrite.c (emit_colors): Likewise. + * regmove.c (copy_src_to_dest, regmove_optimize): Likewise. + (fixup_match_1): Likewise. + * reload1.c (reload, alter_reg): Likewise. + * local-alloc.c (validate_equiv_mem): Check MEM_READONLY_P, + not RTX_UNCHANGING_P. + (equiv_init_varies_p): Likewise. + * loop-invariant.c (check_maybe_invariant): Likewise. + * resource.c (mark_referenced_resources, mark_set_resources): Likewise. + * loop.c (note_addr_stored): Likewise. + (prescan_loop): Likewise. Don't check function usage for clobbered + unchanging memory. + * rtlanal.c (rtx_unstable_p): Check MEM_READONLY_P, + not RTX_UNCHANGING_P. + (rtx_varies_p, modified_between_p, modified_in_p): Likewise. + * varasm.c (force_const_mem): Likewise. + * stmt.c (expand_decl): Don't set RTX_UNCHANGING_P. + * web.c (entry_register): Likewise. + * tree-gimple.h (get_base_address): Move decl ... + * tree.h: ... here. + * doc/rtl.texi (MEM_READONLY_P): Replace RTX_UNCHANGING_P. + + * config/alpha/alpha.c (alpha_set_memflags_1): Rewrite to be + called via for_each_rtx. Copy MEM_SCALAR_P, MEM_NOTRAP_P too. + (alpha_set_memflags): Update to match. + + * config/darwin.c (machopic_indirect_data_reference): Set + MEM_READONLY_P instead of RTX_UNCHANGING_P. + (machopic_indirect_call_target): Likewise. + (machopic_legitimize_pic_address): Likewise. + * config/arm/arm.c (legitimize_pic_address, arm_gen_load_multiple, + arm_gen_store_multiple, arm_gen_movmemqi): Likewise. + * config/arm/arm.md (load_multiple, store_multiple): Likewise. + * config/frv/frv.md (symGOT2reg): Likewise. + * config/i386/i386.c (legitimize_pic_address, + legitimize_tls_address, ix86_split_to_parts): Likewise. + * config/ia64/ia64.c (ia64_expand_tls_address): Likewise. + * config/ia64/ia64.md (load_fptr): Likewise. + * config/m32r/m32r.c (m32r_legitimize_pic_address): Likewise. + * config/m68k/m68k.c (legitimize_pic_address): Likewise. + * config/mcore/mcore.c (block_move_sequence): Likewise. + * config/mn10300/mn10300.md (symGOT2reg): Likewise. + * config/pa/pa.c (legitimize_pic_address): Likewise. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise. + (rs6000_emit_move): Likewise. + * config/s390/s390.c (legitimize_pic_address): Likewise. + (legitimize_tls_address): Likewise. + * config/s390/s390.md (casesi): Likewise. + * config/sh/sh.c (prepare_move_operands, sh_reorg): Likewise. + * config/sh/sh.md (symGOT2reg): Likewise. + * config/sparc/sparc.c (legitimize_pic_address): Likewise. + * config/v850/v850.md (casesi): Likewise. + + * config/ia64/ia64.c (gen_thread_pointer): Don't set RTX_UNCHANGING_P. + * config/iq2000/iq2000.c (save_restore_insns): Likewise. + * config/mips/mips.c (mips_restore_gp): Likewise. + (mips_save_restore_reg, mips16_gp_pseudo_reg): Likewise. + * config/sh/sh.c (sh_reorg): Likewise. + +2004-08-18 Richard Henderson + + * tree.h (struct tree_decl): Add gimple_formal_temp. + (DECL_GIMPLE_FORMAL_TEMP_P): New. + * gimplify.c (pop_gimplify_context): Clear it. + (lookup_tmp_var): Set it, if is_formal. + (gimplify_init_constructor): Use rhs_predicate_for for COMPLEX. + Use is_gimple_val for VECTOR. Simplify return value. + (gimplify_save_expr): Use and set DECL_GIMPLE_FORMAL_TEMP_P. + (gimplify_expr): Likewise. + * tree-gimple.c (is_gimple_formal_tmp_rhs): Rename from + is_gimple_tmp_rhs for clarity. Update all callers. + (is_gimple_reg_rhs): Simplify logic. + (is_gimple_formal_tmp_var): Rename from is_gimple_tmp_var for + clarity; use DECL_GIMPLE_FORMAL_TEMP_P. + (is_gimple_formal_tmp_reg): Similarly. + * tree-gimple.h: Update decls. + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Use + DECL_IGNORED_P, not DECL_ARTIFICIAL. Tidy formatting. + * tree-ssa-live.c (var_union, type_var_init): Likewise. + +2004-08-18 Paolo Bonzini + + * c4x.c (legitimize_operands): Remove calls to + preserve_subexpressions_p. + +2004-08-18 David Edelsohn + + * varasm.c (MAX_OFILE_ALIGNMENT): Move ... + * defaults.h (MAX_OFILE_ALIGNMENT): ... here. + +2004-08-18 Ziemowit Laski + + * gcc.c (default_compilers): Add info about ".mm", ".M" and ".mii" + Objective-C++ extensions. + * gengtype.c (get_file_basename): Match entire subdirectory name + ('cp', 'objc', 'objcp') rather than just its suffix. + (get_base_file_bitmap): Allow for files to belong to more than one + language. + (get_output_file_with_visibility): Treat objc/objc-act.h as a header + used by more than one front-end. + +2004-08-18 Richard Earnshaw + + * arm.md (addsi3, subsi3, andsi3, iorsi3, movsi, movhi): Rework to + avoid use of preserve_subexpressions_p. + +2004-08-17 Richard Henderson + + PR 17051 + * tree-sra.c (scalarize_use): Mark all v_defs for !is_output too. + +2004-08-17 DJ Delorie + + * doc/extend.texi: Document new xstormy16 attribute. + + * config/stormy16/stormy16.c (xstormy16_splittable_below100_operand): New. + (xstormy16_splittable_below100_or_register): New. + (combine_bnp): New. + (xstormy16_reorg): New. + (TARGET_MACHINE_DEPENDENT_REORG): Define. + + * config/stormy16/stormy16.md (movqi_internal): Make name public. + (movhi_internal): Likewise. + (cbhranchhi): Likewise. + (cbhranchhi_neg): Likewise. + (andhi3): Only allow splittable below100 operands. + (iorhi3): Likewise. + (peephole2): New and/zero_extend->and peephole. + (peephole2): New load/ior/save->set1 peephole. + (peephole2): New load/and/save->clr1 peephole. + (bclrx, bclrx2, bclr7, bclr15): New. + (bsetx, bsetx2, bset7, bset15): New. + + * config/stormy16/stormy16.c (xstormy16_print_operand): Be more + liberal about acceptable 'B' masks. + + * config/stormy16/stormy16-protos.h + (xstormy16_asm_output_aligned_common, xstormy16_below100_symbol, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand): New. + (PREDICATE_CODES): Add new predicates. + + * config/stormy16/stormy16.c + (xstormy16_asm_output_aligned_common, xstormy16_below100_symbol, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand): New. + (xstormy16_expand_iorqi3, xstormy16_expand_andqi3): New. + (xstormy16_legitimate_address_p): Allow below100 symbols. + (xstormy16_extra_constraint_p): Add 'W' for below100 operands. + (xstormy16_expand_move): Leave below100 operands as-is. + (xstormy16_encode_section_info): Encode below100 symbols. + (xstormy16_strip_name_encoding): New. + (xstormy16_print_operand): Print 'b' as shift mask. + (xstormy16_attribute_table): Add below100 attributes. + (xstormy16_handle_below100_attribute): New. + + * config/stormy16/stormy16.h (EXTRA_SECTIONS): add in_bss100. + (XSTORMY16_SECTION_FUNCTION): New. + (EXTRA_SECTION_FUNCTIONS): Define using the above. + (ASM_OUTPUT_ALIGNED_DECL_COMMON, ASM_OUTPUT_ALIGNED_DECL_LOCAL): New. + (ASM_OUTPUT_SYMBOL_REF): Handle encoded symbols. + (ASM_OUTPUT_LABELREF): Define. + + * config/stormy16/stormy16.md (movqi_internal): Add below100 support. + (movhi_internal): Add below100 support. + (andhi3): Add below100 support. + (iorhi3): Add below100 support. + (iorqi3, iorqi3_internal, andqi3, andqi3_internal): New. + +2004-08-17 James E Wilson + + * config/mips/mips.c (gen_conditional_move): Use GET_MODE (op0) instead + of VOIDmode for comparison code mode. + * config/mips/mips.md: For conditional move patterns, use mode of + first compare operand for comparison mode, instead of VOIDmode. + + * config/mips/mips.md: Add canonical nmadd and nmsub patterns for both + normal and -ffast-math code. + +2004-08-17 Mark Mitchell + + PR c++/15871 + * doc/invoke.texi (-fkeep-inline-functions): Update documentation. + +2004-08-17 Robert Bowdidge + + * config/rs6000/x-darwin: Add -mdynamic-no-pic to gcc build flags. + +2004-08-17 Andreas Tobler + + * config/rs6000/darwin.md (*call_nonlocal_darwin64): Add #else clause + for non Darwin targets. + (*call_value_nonlocal_darwin64): Likewise. + +2004-08-17 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_function_value): Check for + altivec mode for altivec return register. + +2004-08-17 David Edelsohn + + Revert 2004-08-16 Stan Shebs + * config/darwin.c (macho_indirect_data_reference): Add DImode case. + * config/rs6000/rs6000.md: Include darwin.md. + (builtin_setjmp_receiver): Add DImode case. + * config/rs6000/rs6000.c (rs6000_emit_move): Add DImode case to + Darwin bits. + +2004-08-17 Dorit Naishlos + + * tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE + trees. + * tree-vectorizer.h: New File: Same. + * Makefile.in (tree-vectorizer.c, tree-vectorizer.h): Add new files. + * common.opt (ftree-vectorize): New flag to enable vectorization. + * timevar.def (TV_TREE_VECTORIZATION): New dump file for + vectorization pass. + * tree-data-ref.h (init_data_ref): Additional argument. + (array_base_name_differ_p): Moved to tree-data-ref.c. + * tree-data-ref.c (array_base_name_differ_p): Revised. + (initialize_data_dependence_relation): Call array_base_name_differ_p + with an extra argument. + (analyze_all_data_dependences): Same. + (init_data_ref): Additional argument is_read to set DR_IS_READ. + * tree-ssa-phiopt.c (empty_block_p): Expose for usage out of this + file. + * tree-flow.h (vectorize_loops, empty_block_p): Add declaration. + * tree-optimize.c (pass_vectorize): Schedule the vectorization pass. + * tree-pass.h (tree_opt_pass pass_vectorize): Declare the new + vectorization pass. + * tree-ssa-loop.c (tree_ssa_loop_init): Call scev_initialize. + (tree_ssa_loop_done): Call scev_finalize. + (tree_vectorize): Define the new vectorization pass. + * defaults.h (UNITS_PER_SIMD_WORD): Allow targets to specify the + size of the vector they support (until support for multiple vector + sizes is added to the vectorizer). + * config/i386/i386.h (UNITS_PER_SIMD_WORD): Define. + * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Define. + * invoke.texi (fdump-tree-vect, ftree-vectorize): Add + documentation. + +2004-08-17 Nathan Sidwell + + * objc/objc-act.c (build_protocol_initializer): Fix build_int_cst + usage. + (generate_protocol_list, handle_impent): Likewise. + +2004-08-17 Roger Sayle + + * regclass.c (init_reg_sets_1): Add ENABLE_CHECKING sanity tests to + ensure that call_used_regs is a superset of both fixed_regs and + call_really_used_regs. + +2004-08-17 Daniel Bornstein + + PR target/17019 + * arm.md (addsi3_cbranch_scratch): Correct case labels. + +2004-08-17 Paolo Bonzini + + PR middle-end/17036 + * fold-const.c (fold): Check for integer operand when + folding (A >> N) & 1 ? (1 << N) : 0. Fix from Andrew + Pinski . + +2004-08-17 Paolo Bonzini + + * configure.ac: Trust toplevel's notion of BISON/FLEX/MAKEINFO. + No need to check if in a cross configuration. + * configure: Regenerate. + + * calls.c (precompute_register_parameters): + Inline preserve_subexpressions_p (). + * expmed.c (expand_mult_const, emit_store_flag): Likewise. + * optabs.c (expand_binop, expand_twoval_binop, prepare_cmp_insn): + Likewise. + * expr.c (get_subtarget): Likewise. + * rtl.h (preserve_subexpressions_p): Remove. + * stmt.c (preserve_subexpressions_p): Remove. + + * dojump.c (do_jump) : + Abort on gimplified cases. + +2004-08-16 James E Wilson + + * tree.h (VECTOR_FLOAT_TYPE_P): New. + (FLOAT_TYPE_P): Use it. + * c-typeck.c (build_binary_op): After convert calls, check for + check for ERROR_MARK operands. + +2004-08-16 Zack Weinberg + + * Makefile.in (BUILD_PREFIX, BUILD_PREFIX_1): Delete. + (BUILD_RTL, BUILD_PRINT, BUILD_ERRORS, BUILD_VARRAY): Update. + (genobjs): Add build-rtl.o, build-print-rtl.o, build-varray.o. + (genobjs static pattern rule): Remove %.c dependency. + ($(BUILD_PREFIX_1)rtl.o, print-rtl.o, $(BUILD_PREFIX_1)varray.o): + Rename rules; delete commands; fix dependencies. + (mostlyclean): Do not delete temporary source copies. + * configure.ac: Delete all references to BUILD_PREFIX and + BUILD_PREFIX_1. + * configure: Regenerate. + + * print-rtl.c: Include bconfig.h #ifdef GENERATOR_FILE. + Do not include tree.h, real.h, flags.h, hard-reg-set.h, or + basic-block.h #ifdef GENERATOR_FILE. Surround some more code + with #ifndef GENERATOR_FILE so that nothing from those headers + is used. + + * rtl.c, varray.c: Include bconfig.h #ifdef GENERATOR_FILE. + +2004-08-16 Adam Nemet + + * Makefile.in (LIBS): Move $(LIBIBERTY) after $(BANSHEELIB). + +2004-08-16 Andrew Pinski + + * target-def.h (TARGET_EH_RETURN_FILTER_MODE): Remove + extraneous semicolon. + +2004-08-16 Devang Patel + + * c-common.c (handle_used_attribute): Set DECL_PRESERVE_P. + * print-tree.c (print_node): Print DECL_PRESERVE_P. + * target-def.h (TARGET_ASM_MARK_DECL_PRESERVED): New #define. + (TARGET_ASM_OUT): New member, TARGET_ASM_MARK_DECL_PRESERVED + * target.h (struct gcc_target): New member, mark_decl_preserved. + * hooks.c (hook_void_charptr): Rename to ... + (hook_void_constcharptr): ... new name. + * hooks.h (hook_void_charptr): Rename to .. + (hook_void_constcharptr): ... new name. + * tree.h (DECL_PRESERVE_P): New #define. + (struct tree_decl): New member, preserve_flag. + * varasm.c (assemble_start_function): Mark decl preserved. + (assemble_variable): Same. + * darwin.c (darwin_mark_decl_preserved): New function. + * darwin.h (TARGET_ASM_MARK_DECL_preserved): New #define. + * darwin-protos.h (darwin_mark_decl_preserved): New decl. + * doc/tm.texi (TARGET_ASM_MARK_DECL_PRESERVED): Document. + +2004-08-16 Joseph S. Myers + + * c-decl.c (grokdeclarator): Allow for function definition where + innermost declarator has attributes. + +2004-08-16 Fariborz Jahanian + + * except.c (get_exception_filter, build_post_landing_pads, + dw2_build_landing_pads): Use target-specific mode for 'filter'. + * target-def.h (TARGET_EH_RETURN_FILTER_MODE): macro defined and used. + * target.h (eh_return_filter_mode): New field added. + * targhooks.c (default_eh_return_filter_mode): Defined. + * targhooks.h (default_eh_return_filter_mode): Declared. + * config/rs6000/rs6000.c (rs6000_eh_return_filter_mode): Defined. + +2004-08-16 Nathanael Nerode + + * configure.ac: Replace _GCC_TOPLEV_NONCANONICAL_TARGET with + ACX_NONCANONICAL_TARGET; remove now-unneeded AC_SUBST. + * configure: Regenerate. + +2004-08-16 Stan Shebs + + Basic support for 64-bit Darwin. + * config/darwin.c (macho_indirect_data_reference): Add DImode case. + (machopic_legitimize_pic_address): Similarly, plus use Pmode + instead of SImode. + * config/rs6000/darwin.h (PTRDIFF_TYPE): Be "long int" if 64-bit. + (TARGET_OS_CPP_BUILTINS): Add 64-bit preprocessor macro. + (SUBTARGET_SWITCHES): Add -m32 and -m64 flags. + (SUBTARGET_OVERRIDE_OPTIONS): Require 64-bit processor if -m64. + (PROCESSOR_DEFAULT64): Define. + * config/rs6000/darwin.md: New file, patterns specific to 64-bit + Darwin. + * config/rs6000/rs6000.md: Include darwin.md. + (builtin_setjmp_receiver): Add DImode case. + * config/rs6000/rs6000.c (TARGET_ASM_UNALIGNED_DI_OP): Define for + Darwin. + (TARGET_ASM_ALIGNED_DI_OP): Ditto. + (rs6000_emit_move): Add DImode case to Darwin bits. + (machopic_output_stub): Use .quad if 64-bit. + * invoke.texi: Document -m32 and -m64. + +2004-08-16 Janis Johnson + + * doc/extend.texi (AltiVec builtins): Document additional differences + from the Motorola AltiVec PIM. + +2004-08-16 Nathan Sidwell + + * c-typeck.c (build_c_cast): Only copy overflow from expr nodes. + * tree.h (IS_NON_TYPE_CODE_CLASS): Simplify. + (struct tree_common): Update public_flag documentation. + +2004-08-16 Nathanael Nerode + + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): + Check for artificial variables, not is_gimple_tmp_var. + * tree-ssa-live.c (var_union): Likewise. + +2004-08-16 Nathan Sidwell + + * calls.c (load_register_parameters): Remove spurious FIXME token. + +2004-08-15 Ziemowit Laski + + * Makefile.in (C_PRETTY_PRINT_H): Add c-pretty-print.h. + (c-lang.o): Depend on c-objc-common.h. + (c-objc-common.o): Depend on $(C_PRETTY_PRINT_H) and + c-objc-common.h; remove duplicate $(C_TREE_H) dependency. + * c-lang.c: Include c-objc-common.h. + (LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS, + LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION, + LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS, + LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P, + LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE, + LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION, + LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL, + LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, + LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, + LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT, + LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, + LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, + LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, + LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, + LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING, + LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, + LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, + LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE, + LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE, + LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, + LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO, + LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS): + Move to c-objc-common.h. + * c-objc-common.c: Include c-objc-common.h. + * c-objc-common.h: New file. + +2004-08-15 Andreas Tobler + Andrew Pinski + + PR target/14931 + * config/rs6000/darwin-tramp.asm (L_abort$stub): Change to new stub + style. + +2004-08-15 Nathan Sidwell + + * tree.h (build_int_cst): New. + (build_int_2): Remove. + * tree.c (build_int_2): Remove. + (build_int_cst): New. + (make_vector_type, build_common_tree_nodes, + build_common_tree_nodes_2): Use build_int_cst. + * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, + expand_builtin_strpbrk, expand_builtin_fputs, + build_string_literal, expand_builtin_printf, + expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, + fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, + fold_builtin_isdigit, simplify_builtin_strstr, + simplify_builtin_strpbrk, fold_builtin_fputs, + simplify_builtin_sprintf): Use build_int_cst. + * c-common.c (start_fname_decls, fix_string_type, + c_common_nodes_and_builtins, c_init_attributes, + shorten_compare): Likewise. + * c-decl.c (complete_array_type, + check_bitfield_type_and_width): Likewise. + * c-lex.c (interpret_integer, lex_charconst): Likewise. + * c-parse.in (primary): Likewise. + * c-pretty-print.c (pp_c_integer_constant): Likewise. + * c-typeck.c (really_start_incremental_init, push_init_level, + set_nonincremental_init_from_string): Likewise. + * calls.c (load_register_parameters): Likewise. + * convert.c (convert_to_pointer): Likewise. + * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, + build_fn_info_type, build_ctr_info_value, build_gcov_info): + Likewise. + * except.c (init_eh, assign_filter_values, assign_filter_values): + Likewise. + * expmed.c (store_fixed_bit_field, extract_bit_field, + extract_fixed_bit_field, extract_split_bit_field, expand_shift, + expand_mult_const, expand_mult_highpart_adjust, extract_high_half, + expand_sdiv_pow2, expand_divmod, make_tree): Likewise. + * expr.c (convert_move, emit_group_load, emit_group_store, + expand_assignment, store_constructor, store_field, + expand_expr_real_1, reduce_to_bit_field_precision): Likewise. + * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, + invert_truthvalue, optimize_bit_field_compare, + decode_field_reference, all_ones_mask_p, constant_boolean_node, + fold_div_compare, fold, fold_read_from_constant_string, + fold_negate_const, fold_abs_const, fold_not_const): Likewise. + * function.c (assign_parm_setup_block): Likewise. + * stmt.c (shift_return_value, expand_end_case_type, + estimate_case_costs): Likewise. + * stor-layout.c (layout_type, initialize_sizetypes, + set_min_and_max_values_for_integral_type): Likewise. + * tree-chrec.c (chrec_fold_multiply_poly_poly, + reset_evolution_in_loop): Likewise. + * tree-chrec.h (build_polynomial_chrec): Likewise. + * tree-complex.c (build_replicated_const): Likewise. + * tree-eh.c (honor_protect_cleanup_actions, + lower_try_finally_onedest, lower_try_finally_copy, + lower_try_finally_switch): Likewise. + * tree-mudflap.c (mf_build_string, mx_register_decls, + mudflap_register_call, mudflap_enqueue_constant): Likewise. + * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): + Likewise. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + * tree-ssa-loop-niter.c (number_of_iterations_cond, + loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): + Likewise. + + * config/alpha/alpha.c (alpha_initialize_trampoline, + alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. + * config/arm/arm.c (arm_get_cookie_size): Likewise. + * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. + * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. + * config/i860/i860.c (i860_va_start): Likewise. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. + * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, + mips_gimplify_va_arg_expr): Likewise. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. + * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, + add_compiler_branch_island): Likewise. + * config/s390/s390.c (s390_va_start): Likewise. + * config/sh/sh.c (sh_va_start): Likewise. + * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): + Likewise. + * config/xtensa/xtensa.c (xtensa_va_start, + xtensa_gimplify_va_arg_expr): Likewise. + + * objc/objc-act.c (build_objc_string_object, + build_objc_symtab_template, init_def_list, init_objc_symtab, + init_module_descriptor, generate_static_references, + build_selector_translation_table, get_proto_encoding, + build_typed_selector_reference, build_selector_reference, + build_next_objc_exception_stuff, + build_method_prototype_list_template, generate_descriptor_table, + generate_protocols, build_protocol_initializer, + build_ivar_list_template, build_method_list_template, + build_ivar_list_initializer, generate_ivars_list, + generate_dispatch_table, generate_protocol_list, + build_category_initializer, build_shared_structure_initializer, + generate_shared_structures, handle_impent, + generate_objc_image_info): Use build_int_cst. + +2004-08-15 Ben Elliston + + * vec.h: Comment improvements. + +2004-08-14 Roger Sayle + + * c-common.c (shorten_compare, pointer_int_sum, + c_common_truthvalue_conversion, boolean_increment): Replace calls + to build with calls to buildN. + * c-decl.c (complete_array_type, grokdeclarator): Likewise. + * c-gimplify.c (c_build_bind_expr, gimplify_c_loop, + gimplify_switch_stmt): Likewise. + * c-typeck.c (default_function_array_conversion, + build_component_ref, build_array_ref, build_function_call, + pointer_diff, build_unary_op, build_conditional_expr, + build_compound_expr, build_modify_expr, c_finish_goto_label, + c_finish_goto_ptr, c_finish_return, c_finish_loop, + c_finish_bc_stmt, c_finish_stmt_expr, c_end_compound_stmt, + build_binary_op): Likewise. + +2004-08-15 Steven Bosscher + + * rtl.c (note_insn_name): Add NOTE_DISABLE_SCHED_OF_BLOCK. + +2004-08-14 John David Anglin + + * fixinc/inclhack.def (stdio_va_list): Also fix com_err.h, cps.h, + curses.h, krb5.h, lc_core.h, pfmt.h, wchar.h and curses_colr/curses.h. + * fixinc/fixincl.x: Rebuilt. + +2004-08-14 Richard Sandiford + + * config/mips/mips-protos.h (mips_symbolic_constant_p) + (mips_atomic_symbolic_constant_p, mips_stack_address_p) + (mips_small_data_pattern_p): Declare. + * config/mips/mips.h (CONST_GP_P): Moved from mips.c. + (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Delete. + * config/mips/mips.c (mips_symbolic_constant_p): Make global. + (mips_atomic_symbolic_constant_p, mips_stack_address_p): New functions. + (uns_arith_operand, const_arith_operand, arith_operand, sle_operand) + (sleu_operand, small_int, reg_or_0_operand, const_float_1_operand) + (reg_or_const_float_1_operand, hilo_operand, extend_operator) + (macc_msac_operand, equality_op, cmp_op, trap_cmp_op) + (pc_or_label_operand, call_insn_operand, move_operand) + (consttable_operand, symbolic_operand, general_symbolic_operand) + (global_got_operand, local_got_operand, stack_operand) + (fp_register_operand, lo_operand, fcc_register_operand): Delete. + (mips_small_data_pattern_1): Renamed from small_data_pattern_1. + (mips_small_data_pattern_p): Replace previous small_data_pattern + predicate. Turn into a bool () (rtx) function. + * config/mips/predicates.md: New file. + * config/mips/mips.md: Include it. Use the target-independent + comparison_operator instead of cmp_op. Rename trap_cmp_op to + trap_comparison_operator and equality_op to equality_operator. + Replace uses of small_int with the equivalent const_arith_operand. + Rename reg_or_const_float_1_operand to reg_or_1_operand. Rename + const_float_1_operand to const_1_operand. Rename fcc_register_operand + to fcc_reload_operand. + * config/mips/sb1.md: Rename fp_register_operand to fpr_operand. + +2004-08-14 John David Anglin + + PR libstdc++/17005 partial fix. + * pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Define _INCLUDE__STDC_A1_SOURCE + except when generating ANSI/C89 code. + +2004-08-14 Nathan Sidwell + + * c-common.c (shorten_compare): Use force_fit_type directly. + +2004-08-14 Gerald Pfeifer + Dimitri Papadopoulos-Orfanos + Dave Korn + + * doc/install.texi (Building): Avoid duplicate reference to GNU + make requirement. + (*-*-solaris2*): Do not recommend GNU make any longer. Simplify. + +2004-08-14 Richard Henderson + + * config/alpha/alpha.h (PROMOTE_MODE): Don't promote vector types. + * config/alpha/alpha.c (function_value): Use PROMOTE_MODE. + +2004-08-13 Richard Henderson + + * config/i386/i386.md (call_1, sibcall_1, call_1_rex64): Use Pmode + for constant_call_address_operand. + (call_value_pop_1, call_value_1): Likewise. + (sibcall_value_1, call_value_1_rex64): Likewise. + +2004-08-13 James E Wilson + + * config/mips/sb1.md (ir_sb1_divdf_2pipes, ir_sb1_divdf_1pipe): + Correct mode from SFmode to DFmode. + +2004-08-13 Ziemowit Laski + + * config/darwin.h (EXTRA_SECTION_FUNCTIONS): Mark the __sel_fixup, + __cstring_object and __image_info sections with the no_dead_strip + attribute. + +2004-08-13 Roger Sayle + David Billinghurst + + PR libgfortran/15930 + * fixinc/inclhack.def (irix___generic1, irix___generic2): New. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/internal/math_core.h: New file. + +2004-08-13 Richard Henderson + + * dbxout.c (NO_DBX_FUNCTION_END): Default to zero. + (dbxout_function_end): Remove ifdefs for it. + (dbxout_begin_prologue): Protect N_BNSYM with it, and gdb extensions. + +2004-08-13 Richard Henderson + + * Makefile.in (insn-preds.o): Depend on TREE_H. + * genpreds.c (write_insn_preds_c): Include tree.h. + * config/alpha/alpha.c (reg_or_0_operand, reg_or_6bit_operand, + reg_or_8bit_operand, cint8_operand, add_operand, sext_add_operand, + const48_operand, and_operand, or_operand, mode_width_operand, + mode_mask_operand, mul8_operand, const0_operand, + hard_fp_register_operand, hard_int_register_operand, + reg_or_cint_operand, some_operand, some_ni_operand, input_operand, + samegp_function_operand, direct_call_operand, small_symbolic_operand, + global_symbolic_operand, call_operand, symbolic_operand, + dtp16_symbolic_operand, dtp32_symbolic_operand, + gotdtp_symbolic_operand, tp16_symbolic_operand, tp32_symbolic_operand, + gottp_symbolic_operand, alpha_comparison_operator, + alpha_zero_comparison_operator, alpha_swapped_comparison_operator, + signed_comparison_operator, alpha_fp_comparison_operator, + divmod_operator, fix_operator, aligned_memory_operand, + unaligned_memory_operand, reg_or_unaligned_mem_operand, + any_memory_operand, reg_not_elim_operand, normal_memory_operand, + reg_no_subreg_operand, addition_operation): Move to predicates.md. + (reg_or_const_int_operand): Remove. Replace all users with + reg_or_cint_operand. + (tls_symbolic_operand_1): Export. Don't check mode or for CONST. + (resolve_reload_operand): Split out of aligned_memory_operand. + * config/alpha/alpha-protos.h: Update for exports. + * config/alpha/alpha.h (PREDICATE_CODES): Remove. + * config/alpha/alpha.md: Include predicates.md. + * config/alpha/predicates.md: New file. + +2004-08-13 Richard Sandiford + + * genattrtab.c (insn_ent): Replace insn_code, insn_index and lineno + fields with a pointer to the instruction definition. + (get_attr_value, fill_attr, make_length_attrs, remove_insn_ent) + (insert_insn_ent, simplify_test_exp, optimize_attrs, write_attr_get) + (write_attr_case, write_const_num_delay_slots): Update accordingly. + (write_attr_case, write_const_num_delay_slots): Write the name of + an insn next to its case statement. + * genoutput.c (data): Add a filename field. + (gen_insn, gen_peephole, gen_expand, gen_split): Set it. + (output_insn_data): Print the location of each insn definition. + * genrecog.c (write_action): Print the name of an insn above + the statement that returns its code. + +2004-08-12 Andrew Pinski + + * config/darwin-c.c (find_subframework_file): Fix spelling of cannot. + * config/libgloss.h: Likewise. + * config/arm/arm.c (arm_gen_load_multiple): Likewise. + * c4x/c4x-modes.def: Likewise. + * config/c4x/c4x.c (c4x_hard_regno_rename_ok): Likewise. + (c4x_rptb_nop_p): Likewise. + (c4x_rptb_valid_p): Likewise. + (c4x_rptb_insert): Likewise. + (c4x_address_conflict): Likewise. + * config/c4x/c4x.md: Likewise. + * config/frv/frv.md: Likewise. + * config/i386/athlon.md: Likewise. + * config/i386/i386.md: Likewise. + * config/i386/predicates.md: Likewise. + * config/ia64/ia64.c: Likewise. + * config/ia64/itanium1.md: Likewise. + * config/ia64/itanium2.md: Likewise. + * config/iq2000/iq2000.md: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/r3900.h: Likewise. + * config/mips/sb1.md: Likewise. + * config/pa/milli64.S: Likewise. + * config/pa/pa.c: Likewise. + * config/pa/pa.h: Likewise. + * config/rs6000/8540.md: Likewise. + +2004-08-13 Daniel Berlin + + * Makefile.in (BOOT_CFLAGS): Remove accidental addition of -dU. + +2004-08-13 J"orn Rennecke + + * sh.md (cbranch define_delay) Use cond_delay_slot for + non-anulled condition too. + +2004-08-12 David Edelsohn + + * config/rs6000/rs6000.c (any_parallel_operand): New predicate. + * config/rs6000/rs6000.h (PREDICATE_CODES): Add + any_parallel_operand, lmw_operation, stmw_operation, + mfcr_operation, mtcrf_operation. Remove PARALLEL from any_operand. + * config/rs6000/rs6000.md (save_fpregs_{si,di}): Use + any_parallel_operand. + (return_and_restore_fpregs_{si,di}): Same. + +2004-08-12 Zack Weinberg + + * genrecog.c (add_to_sequence): When processing a MATCH_PARALLEL, + if pred->singleton != PARALLEL, issue a warning and pretend it was. + Also issue a warning for any predicate we don't know about. + +2004-08-12 Richard Henderson + + * config/i386/i386.c (internal_label_prefix): Export. + (internal_label_prefix_len, struct ix86_address, + ix86_decompose_address, maybe_get_pool_constant, + ix86_fp_compare_code_to_integer, ix86_fp_comparison_codes, + memory_address_length): Export. + (any_fp_register_operand, fp_register_operand, + register_and_not_any_fp_reg_operand, register_and_not_fp_reg_operand, + x86_64_general_operand, x86_64_szext_general_operand, + x86_64_nonmemory_operand, x86_64_movabs_operand, + x86_64_szext_nonmemory_operand, x86_64_immediate_operand, + x86_64_zext_immediate_operand, const_int_1_31_operand, + symbolic_operand, pic_symbolic_operand, local_symbolic_operand, + tls_symbolic_operand, global_dynamic_symbolic_operand, + local_dynamic_symbolic_operand, initial_exec_symbolic_operand, + local_exec_symbolic_operand, call_insn_operand, sibcall_insn_operand, + constant_call_address_operand, const0_operand, const1_operand, + const248_operand, const_0_to_3_operand, const_0_to_7_operand, + const_0_to_15_operand, const_0_to_255_operand, incdec_operand, + shiftdi_operand, reg_no_sp_operand, mmx_reg_operand, + general_no_elim_operand, nonmemory_no_elim_operand, + index_register_operand, q_regs_operand, flags_reg_operand, + non_q_regs_operand, zero_extended_scalar_load_operand, + vector_move_operand, no_seg_address_operand, sse_comparison_operator, + ix86_comparison_operator, ix86_carry_flag_operator, + fcmov_comparison_operator, promotable_binary_operator, + cmp_fp_expander_operand, ext_register_operand, binary_fp_operator, + mult_operator, div_operator, arith_or_logical_operator, + memory_displacement_operand, cmpsi_operand, long_memory_operand, + aligned_operand): Move to predicates.md as define_predicates. + (tls_symbolic_operand_1): Remove. + (x86_64_sign_extended_value): Merge into x86_64_immediate_operand. + (x86_64_zero_extended_value): Merge into x86_64_zext_immediate_operand. + (legitimize_address): Merge tls_symbolic_operand contents. + (ix86_expand_move): Likewise. + * config/i386/i386-protos.h: Update for exports. + * config/i386/i386.h (EXTRA_CONSTRAINT): Update for renames. + (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Remove. + * config/i386/i386.md: Include predicates.md. + * config/i386/predicates.md: New file. + +2004-08-13 Mark Mitchell + + PR c++/16924 + * config/i386/winnt.c (i386_pe_mark_dllexport): Set + SYMBOL_REF_DECL. + (i386_pe_mark_dllimport): Likewise. + (i386_pe_encode_section_info): Likewise, when overriding + dllimport attribute. + +2004-08-12 Geoffrey Keating + + * configure.ac: When testing for flex, nm, ar, and bison, check + that they will actually be built. + * configure: Regenerate. + +2004-08-12 Ulrich Weigand + + * config/s390/s390.h (MAX_FIXED_MODE_SIZE): Define. + (MOVE_MAX_PIECES): Define. + +2004-08-12 Devang patel + + * dbxout.c (dbxout_begin_prologue): New function. + (dbx_debug_hooks): Use new begin prologue hook. + (dbxout_function_end): Emit N_ENSYM. + * stab.def (N_BNSYM, N_ENSYM): Define and document these two new stabs. + +2004-08-12 Janis Johnson + + * config/rs6000/altivec.h (vec_dst): Fix C++ functions whose first + argument is float*. + + * config/rs6000/rs6000.c (altivec_init_builtins): Fix argument type + for vec_dss. + + * doc/extend.texi (AltiVec builtins): Fix description for recent + changes. Update operation list to match current support. + +2004-08-12 Andreas Krebbel + + * config/s390/s390.c (struct s390_frame_layout): New struct as element + of struct machine_function. + (cfun->machine->frame_size): Moved into cfun->machine->frame_layout and + changed all uses. + (cfun->machine->save_fprs_p): Replaced by cfun_save_high_fprs and + changed all uses. + (cfun_frame_layout, cfun_save_high_fprs_p, cfun_gprs_save_area_size) + (cfun_set_fpr_bit, cfun_fpr_bit_p): New macros. + (s390_frame_area, s390_register_info): New functions. + (s390_optimize_prolog): Renamed to s390_optimize_prologue. Added check + for base register. + (s390_return_addr_rtx, s390_return_address_offset) + (s390_va_start, s390_gimplify_va_arg) + (s390_emit_prologue, s390_emit_epilogue): Adjusted for new stack + layouts. + (s390_frame_info): Functionality partly moved to s390_register_info. + Made adaptions for new stack layout. + (save_gprs, restore_gprs): Changed meaning of second parameter and + adapted all callers. + + * config/s390/s390.h (s390_backchain_string): New global variable. + (MASK_BACKCHAIN): Removed definition. + (TARGET_BACKCHAIN): Changed check. + (TARGET_KERNEL_BACKCHAIN): New macro. + (TARGET_SWITCHES): Removed entries of "backchain" and "no-backchain". + (TARGET_OPTIONS): Added "backchain", "no-backchain" and + "kernel-backchain". + (DYNAMIC_CHAIN_ADDRESS): Adjusted for new stack layouts. + + * config/s390/s390.md ("allocate_stack"): Added TARGET_KERNEL_BACKCHAIN + as condition. Adjusted for new stack layout. + + * doc/invoke.texi: Added documentation for new option + "-mkernel-backchain" and adjusted documentation of "-mbackchain" and + "-mno-backchain". + +2004-08-12 Paul Brook + + * config/arm/lib1funcs.asm (ARM_FUNC_ALIAS): Also alias _L__name. + (aeabi_uidivmod, aeabi_idivmod): Provide thumb implementation. + +2004-08-12 David Daney + + * java/gcj.texi: Add subsection on signal usage. + +2004-08-12 David Edelsohn + + * expr.c (move_by_pieces): Set alignment for move to minimum of + MOVE_MAX_PIECES mode alignment and the largest non-slow mode + alignment, but not less than the original alignment. + (move_by_pieces_ninsns): Same. + (can_store_by_pieces): Similar for store with STORE_MAX_PIECES. + (store_by_pieces_1): Same. + +2004-08-12 Diego Novillo + + PR tree-optimization/16867 + * tree.c (is_global_var): New function. + (needs_to_live_in_memory): Check for TREE_ADDRESSABLE. + Call is_global_var. + * tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Remove. + Update all users. + (is_global_var): Declare. + * tree-dfa.c (dump_variable): Display global and addressable + attributes. + (add_referenced_var): Clarify documentation when marking + variables call-clobbered. + * tree-flow-inline.h (is_call_clobbered): Call is_global_var + instead of needs_to_live_in_memory. + (mark_call_clobbered): If the variable is a tag, mark it + DECL_EXTERNAL. + * tree-gimple.c (is_gimple_reg): Don't check for + TREE_ADDRESSABLE. + (is_gimple_non_addressable): Likewise. + * tree-ssa-alias.c (get_nmt_for): Always check whether the tag + needs to be marked call-clobbered. + (setup_pointers_and_addressables): Call is_global_var instead + of needs_to_live_in_memory. + * tree-ssa-dce.c (need_to_preserve_store): Remove. + Update all users with is_global_var. + (mark_stmt_if_obviously_necessary): Fix processing of aliased + stores. Don't check the virtual definitions. Rather, check + whether the store is going into global memory. + (find_obviously_necessary_stmts): Get the symbol from the PHI + result. + * tree-ssa-operands.c (get_call_expr_operands): Do not add + clobbering may-defs if the call does not have side effects. + +2004-08-12 Jakub Jelinek + + PR c++/16276 + * output.h (default_function_rodata_section, + default_no_function_rodata_section): New prototypes. + * target.h (struct gcc_target): Add asm_out.function_rodata_section. + * target-def.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define. + (TARGET_ASM_OUT): Add it. + * varasm.c (default_function_rodata_section, + default_no_function_rodata_section): New functions. + * final.c (final_scan_insn): Call + targetm.asm_out.function_rodata_section instead of + readonly_data_section. + * config/darwin.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define. + * config/mcore/mcore.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise. + * config/ip2k/ip2k.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise. + * config/rs6000/xcoff.h (TARGET_ASM_FUNCTION_RODATA_SECTION): + Likewise. + * config/alpha/alpha.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise. + * config/i386/cygming.h (TARGET_ASM_FUNCTION_RODATA_SECTION): + Likewise. + * config/i386/i386-interix.h (TARGET_ASM_FUNCTION_RODATA_SECTION): + Likewise. + * config/arm/pe.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise. + * config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise. + * doc/tm.texi (TARGET_ASM_FUNCTION_RODATA_SECTION): Document. + +2004-08-12 Paul Brook + + * dwarf2out.h (dwarf2out_frame_finish): Conditionalize outputting eh + frame info. + * doc/tm.texi: Document interaction between TARGET_UNWIND_INFO and + DWARF2_UNWIND_INFO. + +2004-08-12 Ben Elliston + + PR target/16286 + * config/rs6000/altivec.h: Change vector to __vector throughout. + (Except for the `vector' macro itself). + +2004-08-12 Zack Weinberg + + * genpreds.c: Add capability to generate predicate bodies as + well as function prototypes. Write function prototypes for + the generic predicates too. + (process_define_predicate, write_tm_preds_h, write_insn_preds_c) + (write_predicate_subfunction, mark_mode_tests, add_mode_tests) + (write_match_code, write_predicate_expr, write_one_predicate_function) + (parse_option): New functions. + (output_predicate_decls): Delete. + (main): Read the machine description, process DEFINE_PREDICATE or + DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c + as appropriate. + + * genrecog.c (struct decision_test): Replace index with + struct pred_data pointer. + (next_index): Remove, unused. + (pred_table, preds, special_mode_pred_table): Delete. + (compute_predicate_codes, process_define_predicate): New functions. + (validate_pattern, add_to_sequence, write_switch): Update for + new data structures. + (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. + Check both error_count and have_error. + + * gensupport.c (in_fname, first_predicate): New globals. + (define_pred_queue, define_pred_tail): New RTL-pattern queue. + (predicate_table, last_predicate, old_pred_table) + (old_special_pred_table): New statics. + (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) + (add_predicate, init_predicate_table): New functions. + (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. + (init_md_reader_args_cb): Use the global in_fname. No need to zero + it or max_include_len. Call init_predicate_table. + (read_rtx): Run the predicate queue after the attribute queue + but before all the others. + * gensupport.h (in_fname, struct pred_data, first_predicate) + (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. + * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) + (DEFINE_SPECIAL_PREDICATE): New RTL codes. + * dummy-conditions.c: Don't include bconfig.h, system.h, + coretypes.h, tm.h, or system.h. Do include stddef.h. + Duplicate declaration of struct c_test from gensupport.h. + + * Makefile.in (OBJS-common): Add insn-preds.o. + (STAGESTUFF, .PRECIOUS): Add insn-preds.c. + (insn-preds.c, insn-preds.o): New rules. + (s-preds): Also generate insn-preds.c. + (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): + Update dependencies. + (print-rtl.o, print-rtl1.o): Correct dependencies. + + * recog.h: Delete prototypes of predicate functions. + + * doc/md.texi (Predicates): New section with complete + documentation of operand/operator predicates. Remove some + incomplete documentation of predicates from other places. + * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to + PREDICATE_CODES; indicate that both are deprecated in favor + of define_predicate/define_special_predicate. + + * config/ia64/ia64.c: All predicate function definitions moved + to ia64.md, except + (small_addr_symbolic_operand, tls_symbolic_operand): Delete. + (ia64_expand_load_address, ia64_expand_move): + Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. + + * config/ia64/ia64.md: All predicates now defined here. + (symbolic_operand): Is now a special predicate. + + * config/ia64/ia64.h: Declare ia64_section_threshold. + (PREDICATE_CODES): Delete. + +2004-08-12 Richard Henderson + + * c-common.h (STATEMENT_LIST_HAS_LABEL): New. + * c-semantics.c (add_stmt): Set it. + * c-decl.c (finish_decl): Use it to create a new BIND_EXPR + before instantiating a variable sized type. + +2004-08-12 Richard Henderson + + * stor-layout.c (round_up, round_down): Move ... + * fold-const.c (round_up, round_down): ... here. Use + multiple_of_p to avoid any arithmetic at all. + +2004-08-12 Richard Henderson + + * gimplify.c (struct gimplify_init_ctor_preeval_data): New. + (gimplify_init_ctor_preeval_1): New. + (gimplify_init_ctor_preeval): New. + (gimplify_init_ctor_eval): New. + (gimplify_init_constructor): Use them. Always gimplify the LHS + object first. + +2004-08-12 Ziemowit Laski + + (This patch is part of merge of objc-improvements-branch + into mainline.) + + * doc/frontends.texi: Mention Objective-C++ in addition to + Objective-C. + * doc/install.texi: Add 'obj-c++' to list of configurable + languages. + * doc/invoke.texi: Rename Objective-C option headings to + indicate they also apply to Objective-C++. List file + extensions for Objective-C++ sources. Mention that + ObjC and ObjC++ compilations may also use C and C++ options, + respectively. Point users to doc/standards.texi for + further info on ObjC and ObjC++. + * doc/sourcebuild.texi: Mention the objcp/ directory and + the Objective-C++ sources it contains. + * doc/standards.texi: Update link to Apple ObjC site; + add link to gcc readings.html WWW doc. + +2004-08-12 Alan Modra + + * config/rs6000/rs6000.c (function_arg_padding): Revert 2004-07-28 + and 2004-07-14 changes. + +2004-08-12 Paul Brook + + * doc/invoke.texi: Fix typo. + +2004-08-11 Devang Patel + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -dead_strip + and -no_dead_strip_inits_and_terms. + (LINK_SPEC): Same. + * doc/invoke.texi (Darwin Options): Document -dead_strip and + -no_dead_strip_inits_and_terms. + +2004-08-11 Paul Brook + + * config/arm/arm-protos.h (arm_finalize_pic) Rename ... + (arm_load_pic_register): ... to this. + * config/arm/arm.c (arm_finalize_pic): Rename ... + (arm_load_pic_register): ... to this. Always output insns at the + current location. Load via low reg in thumb mode. + (arm_expand_prologue): Call arm_load_pic_register. + (thumb_expand_prologue): Ditto. + * config/arm/arm.h (FINALIZE_PIC): Remove. + * config/arm/arm.md (builtin_setjmp_receiver): Call + arm_load_pic_register. + +2004-08-11 Paul Brook + + * arm.c (thumb_force_lr_save): Add prototype. + (thumb_compute_save_reg_mask): New function. + (thumb_find_work_register): New function. + (arm_get_frame_offsets): Use thumb_compute_save_reg_mask. + (thumb_unexpanded_epilogue): Ditto. Remove redundant code. + Don't clobber r3 when removing pretend args. + (thumb_expand_prologue): Use thumb_compute_save_reg_mask. + (thumb_output_function_prologue): Use new functions. + (thumb_set_return_address): Use thumb_compute_save_reg_mask. + * arm.h (THUMB_REG_PUSHED_P): Remove. + +2004-08-11 James E Wilson + + PR rtl-optimization/16490 + * cfgrtl.c (cfg_layout_split_edge): Set global_live_at_start and + global_live_at_end for new basic block if already set for other blocks. + +2004-08-11 David Edelsohn + + * config/rs6000/rs6000.h (MAX_FIXED_MODE_SIZE): Define. + + * config/rs6000/rs6000.md (mfcr rlwinm patterns): Set length to 8. + (mfcr rlwinm rlwinm patterns): Set length to 12. + +2004-08-11 Andrew MacLeod + + * tree-flow-inline.h (get_def_ops, get_use_ops, get_v_may_def_ops, + get_vuse_ops,get_v_must_def_ops): Add operand structure reference. + (get_v_may_def_result_ptr, get_v_may_def_op_ptr): New access struct. + (start_ssa_stmt_operands): Delete. + * tree-flow.h (struct stmt_ann_d): Replace operand vectors with new + struct stmt_operands_d. + (build_ssa_operands): New extern entry point. + * tree-ssa-dom.c (record_equivalences_from_stmt): Remove operand + building code, replace with create_ssa_artficial_load_stmt(). + * tree-ssa-operands.c (struct voperands_d): Delete. + (allocate_v_may_def_optype): Allocate v_may_def_operand_type_t vector. + (allocate_v_must_def_optype): Use sizeof (tree), not sizeof (tree *). + (free_uses, free_defs, free_vuses, free_v_may_defs, + free_v_must_defs): Remove dealloc parameter. + (remove_vuses, remove_v_may_def, remove_v_must_defs): Delete. + (finalize_ssa_defs, finalize_ssa_uses, finalize_ssa_v_may_defs, + finalize_ssa_vuses, finalize_ssa_v_must_defs): Perform all operand + vector comparisons, ssa_name reuse, and allocations here. + (verify_start_operands): Delete. + (finalize_ssa_stmt_operands): Set new operands by calling finalize + routines. + (start_ssa_stmt_operands): Move from tree-flow-inline.h. + (append_def, append_usei): Simplify to simple accumulation. + (append_v_may_def, append_vuse, append_v_must_def): Simplify to avoiding + duplicates and simple accumulation. + (free_ssa_operands): Free vectors in a stmt_operand structure. + (build_ssa_operands): New. Create a new stmt_operand structure from + a stmt and an old set of stmt_operands. + (get_stmt_operands): Simplify and call build_ssa_operands. + (get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands, + get_call_expr_operands, add_stmt_operand, add_call_clobber_ops, + add_call_read_ops): Don't pass prev_vops around anymore. + (note_addressable): Return if no stmt annotation. + (copy_virtual_operands): Access v_may_def operands through a struct. + (create_ssa_artficial_load_stmt): New. Create a load stmt for DOM's + hash tables without treating the stmt as a real stmt. + * tree-ssa-operands.h (struct v_may_def_operand_type): New. Access + v_may_def def and use through a struct instead of 2 array elements. + (struct v_may_def_optype_d): Use v_may_def_operand_type. + (struct stmt_operands_d): New. Struct for storing all operand vectors. + +2004-08-11 Nick Clifton + + * config/arm/arm.c (arm_is_longcall_p): Update comment describing + this funciton's behaviour. Return true when the current function + has a section attribute and -mlong-calls is in effect. + * config/arm/arm.h (ARM_DECLARE_FUNCTION_SIZE): Do not set the + short-call marker when -mlong-calls is in effect and the function + has a section attribute. + +2004-08-10 Zack Weinberg + + * stmt.c (expand_return): If asked to return the RESULT_DECL, + just call expand_value_return on result_rtl. + +2004-08-10 Richard Henderson + + * builtins.def (BUILT_IN_STACK_ALLOC): Remove. + * builtins.c (expand_builtin) : Remove. + * dwarf2out.c (loc_descriptor): Handle PARALLEL here ... + (add_location_or_const_value_attribute): ... not here. Use + loc_descriptor_from_tree if possible. + (loc_descriptor_from_tree_1): Rename from loc_descriptor_from_tree. + Simplify address handling. Handle DECL_VALUE_EXPR. Handle register + values specially. + (loc_descriptor_from_tree): New. Update callers. + * expr.c (expand_var): Ignore DECL_VALUE_EXPR variables. + * gimplify.c (gimplify_decl_expr): Lower variable sized types to + pointer plus dereference. Set DECL_VALUE_EXPR. Set save_stack. + (gimplify_call_expr): Do not recognize BUILT_IN_STACK_ALLOC + and BUILT_IN_STACK_RESTORE. + (gimplify_expr): Lower DECL_VALUE_EXPR decls. + * stmt.c (expand_stack_alloc): Remove. + * tree-mudflap.c (mx_register_decls): Don't look for + BUILT_IN_STACK_ALLOC. + * tree-nested.c (convert_local_reference): Likewise. + * tree.h (DECL_VALUE_EXPR): New. + +2004-08-10 Richard Henderson + + * stor-layout.c (round_up): Check for 0/1 before dividing. + (round_down): Likewise. + + * tree-tailcall.c (suitable_for_tail_opt_p): Also check DECL_EXTERNAL. + +2004-08-09 Mark Mitchell + + * config.gcc (arm*-*-eabi*): New target. + * defaults.h (TARGET_LIBGCC_FUNCS): New macro. + (TARGET_LIB_INT_CMP_BIASED): Likewise. + * expmed.c (expand_divmod): Try a two-valued divmod function as a + last resort. + * gthr.h: Remove bogus tokens at end of #pragma. + * optabs.c (expand_twoval_binop_libfunc): New function. + (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. + (prepare_float_lib_cmp): Try reversing the condition. + (debug_optab_libfuncs): New function. + * optabs.h (expand_twoval_binop_libfunc): Declare. + * config/arm/arm.c (arm_init_libfuncs): New function. + (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. + (TARGET_INIT_LIBFUNCS): Define it. + * config/arm/arm.h (TARGET_BPABI): New macro. + * config/arm/arm-protos.h + (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. + * config/arm/bpabi.S: New file. + * config/arm/bpabi.c: Likewise. + * config/arm/bpabi.h: Likewise. + * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. + (__aeabi_drsub): Likewise. + (__aeabi_dsub): Likewise. + (__aeabi_dadd): Likewise. + (__aeabi_ui2d): Likewise. + (__aeabi_i2d): Likewise. + (__aeabi_f2d): Likewise. + (__aeabi_dmul): Likewise. + (__aeabi_ddiv): Likewise. + (__aeabi_cdrcmple): Likewise. + (__aeabi_cdcmpeq): Likewise. + (__aeabi_cdcmple): Likewise. + (__aeabi_dcmpeq): Likewise. + (__aeabi_dcmplt): Likewise. + (__aeabi_dcmple): Likewise. + (__aeabi_dcmpge): Likewise. + (__aeabi_dcmpgt): Likewise. + (__aeabi_dcmpun): Likewise. + (__aeabi_d2iz): Likewise. + (__aeabi_d2uiz): Likewise. + (__aeabi_d2f): Likewise. + * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. + (__aeabi_frsub): Likewise. + (__aeabi_fsub): Likewise. + (__aeabi_fadd): Likewise. + (__aeabi_ui2f): Likewise. + (__aeabi_i2f): Likewise. + (__aeabi_fmul): Likewise. + (__aeabi_fdiv): Likewise. + (__aeabi_cfrcmple): Likewise. + (__aeabi_cfcmpeq): Likewise. + (__aeabi_cfcmple): Likewise. + (__aeabi_fcmpeq): Likewise. + (__aeabi_fcmplt): Likewise. + (__aeabi_fcmple): Likewise. + (__aeabi_fcmpge): Likewise. + (__aeabi_fcmpgt): Likewise. + (__aeabi_fcmpun): Likewise. + (__aeabi_f2iz): Likewise. + (__aeabi_f2uiz): Likewise. + * config/arm/lib1funcs.asm (ARM_CALL): New macro. + (__aeabi_uidivmod): New function or alias. + (__aeabi_idivmod): Likewise. + (__aeabi_idiv0): Likewise. + (__aeabi_ldiv0): Likewise. + (__aeabi_llsr): Likewise. + (__aeabi_lasr): Likewise. + (__aeabi_llsl): Likewise. + (bpabi.S): Include it. + * config/arm/libgcc-bpabi.ver: New file. + * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. + (LINK_SPEC): Remove. + * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and + __aeabi_ulcmp. + * config/arm/t-bpabi: New file. + * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. + (TARGET_LIB_INT_CMP_BIASED): Likewise. + +2004-08-10 David Edelsohn + + * config/rs6000/rs6000-protos.h (expand_block_clear): Declare. + * config/rs6000/rs6000.md (clrmemsi): New pattern. + * config/rs6000/rs6000.c (expand_block_clear): New function. + (expand_block_move): Convert alignment to bits. Use SImode and + HImode for unaligned addresses if not STRICT_ALIGNMENT. + +2004-08-10 Caroline Tice + + * varasm.c (unlikely_section_label): New global variable. + (unlikely_text_section_name): New global variable. + (text_section): Remove alignment statement. + (unlikely_text_section): Remove alignment statement; use + unlikely_section_label rather than hard-coded string. + (assemble_start_function): Initialize unlikely_section_label and + unlikely_text_section_name; make sure cold section is properly + aligned at start of function; output unlikely_section_label if + appropriate. + +2004-08-10 Ulrich Weigand + + * config/s390/s390-protos.h (s390_canonicalize_comparison): Declare. + * config/s390/s390.c (s390_canonicalize_comparison): New function. + * config/s390/s390.h (CANONICALIZE_COMPARISON): Define. + * config/s390/s390.md ("*tmdi_ext", "*tmsi_ext", "*tmqisi_ext", + "*tmqidi_ext", "*tmdi_mem", "*tmsi_mem", "*tmhi_mem"): Remove. + ("*tmqi_mem"): Remove SUBREG from pattern. + ("*anddi3_cconly"): Prevent accidentally matching TM pattern. + ("*andsi3_cconly"): Likewise. + +2004-08-10 H.J. Lu + + PR target/16909 + * config/i386/i386.md (*strsetdi_rex_1): Use DI instead of SI. + +2004-08-10 Janis Johnson + + * doc/sourcebuild.texi (compat testing): Document available test + framework commands. Use the preferred spelling of DejaGnu. + +2004-08-10 Daniel Berlin + + * lambda.h: Add matrix type, and prototypes for remainder of + matrix and vector functions. + (lambda_vector_mult_const): New function. + (lambda_vector_negate): Ditto. + (lambda_vector_add): Ditto. + (lambda_vector_add_mc): Ditto. + (lambda_vector_copy): Ditto. + (lambda_vector_zerop): Ditto. + (lambda_vector_equal): Ditto. + (lambda_vector_min_nz): Ditto. + (lambda_vector_first_nz): Ditto. + (lambda_vector_matrix_mult): Ditto. + * lambda-mat.c: New file. + * Makefile.in (lambda-mat.o): New. + +2004-08-10 Andrew MacLeod + + * tree-cfg.c (bsi_insert_before, bsi_insert_after): Call modify_stmt + after linking stmt into the program. + (bsi_remove): Don't call modify_stmt. + * tree-complex.c (update_complex_assignment, + expand_complex_comparison): Call modify_stmt after changing the stmt. + * tree-outof-ssa.c (rewrite_trees): Call modify_stmt only if not + removing the stmt. + * tree-ssa-ccp.c (substitute_and_fold): Call modify_stmt after changing + the stmt, and only if needed. + * tree-ssa-dom.c (thread_across_edge): Pass no annotation for a dummy + expression. + (simplify_rhs_and_lookup_avail_expr): Don't take an annotation param. + (simplify_cond_and_lookup_avail_expr): Use modify_stmt. + (simplify_switch_and_lookup_avail_expr): Don't take an annotation param. + (eliminate_redundant_computations): Don't pass an annotation. Call + modify_stmt rather than setting the annotation directly. + (record_equivalences_from_stmt): Remove unused local 'j'. + (cprop_operand): Take a stmt rather than an annotation as a parameter. + Call modify_stmt. + (cprop_into_stmt): Pass stmt rather than annotation. + (update_rhs_and_lookup_avail_expr): Call modify_stmt. + * tree-ssa-loop-im.c (schedule_sm): Call get_stmt_ann rather than + modify_stmt. + * tree-ssa.c (propagate_into_addr): Dont call modify_stmt. + +2004-08-10 Jason Merrill + + PR middle-end/16948 + * function.c (expand_function_start): Handle DECL_BY_REFERENCE on + the RESULT_DECL. + +2004-08-10 Geoffrey Keating + + * tree-vn.c (val_expr_pair_expr_eq): Compare vuses, to match the + hash function. + +2004-08-10 Roger Sayle + + * config/mips/mips.md: New reciprocal square root patterns that + match sqrt(1.0/x) in addition to the existing 1.0/sqrt(x) insns. + +2004-08-10 Paul Brook + + * config/arm/arm-protos.h (arm_set_return_address, + thumb_set_return_address): Add prototypes. + * config/arm/arm.h (ARM_FT_EXCEPTION_HANDLER): Remove. + * config/arm/arm.c (arm_compute_func_type, + use_return_insn, arm_compute_save_reg0_reg12_mask, + arm_compute_save_reg_mask, arm_output_function_prologue, + arm_output_epilogue): Replace ARM_FT_EXCEPTION_HANDLER with + current_function_calls_eh_return. + (thumb_exit, thumb_pushpop, thumb_unexpanded_epilogue): Replace + old eh code. + (arm_set_return_address, thumb_set_return_address): New functions. + * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS, DWARF2_UNWIND_INFO, + ARM_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX): Define. + * config/arm/arm.md (VUNSPEC_EH_RETURN): Add. + (epilogue): Use the stackadj register. + (eh_return, arm_eh_return, thumb_eh_return): New pattern. + +2004-08-10 Jakub Jelinek + + PR target/3144 + * expr.c (move_by_pieces_ninsns): Add max_size argument. + (MOVE_BY_PIECES_P): Pass MOVE_MAX_PIECES + 1 to it. + (CLEAR_BY_PIECES_P): Pass STORE_MAX_PIECES + 1 to it. + (STORE_BY_PIECES_P): Define similarly to CLEAR_BY_PIECES_P, + but using MOVE_RATIO. + (move_by_pieces): Pass max_size to move_by_pieces_ninsns. + (can_store_by_pieces): Change max_size type to unsigned int. + (store_by_pieces_1): Likewise. Pass max_size to + move_by_pieces_ninsns. + * config/s390/s390.h (STORE_BY_PIECES_P): Define. + * config/sh/sh.c (MOVE_BY_PIECES_P): Pass MOVE_MAX_PIECES + 1 + to move_by_pieces_ninsns. + (STORE_BY_PIECES_P): Define. + * config/ns32k/ns32k.h (STORE_BY_PIECES_P): Pass STORE_MAX_PIECES + 1 + to move_by_pieces_ninsns. + * doc/tm.texi (STORE_BY_PIECES_P): Document changed default. + + * config/i386/i386.h (CLEAR_RATIO): Define. + +2004-08-09 Paolo Bonzini + + * expr.c (expand_expr_real_1): Add back code that was not dead. + +2004-08-09 Andrew Pinski + + * c-common.c (c_common_get_alias_set): Set the aliasing set of the type + which is found to be compatible before returning the aliasing set. + +2004-08-09 Daniel Jacobowitz + + * ggc-zone.c (struct alloc_zone): Add statistics counters. + (always_collect): New flag. + (ggc_alloc_zone_1): Update statistics support. Don't include + overhead in allocated counter. + (sweep_pages): Update allocated counter for large pages. Don'y + include overhead. + (ggc_collect_1): Always collect. + (ggc_collect): Honor always_collect flag. Sum all zones to decide + whether to collect. + (SCALE, LABEL): New macros. + (ggc_print_statistics): Add statistics support. + +2004-08-09 Roger Sayle + + * expmed.c (sdiv_pow2_cheap, smod_pow2_cheap): Change type to bool. + (init_expmed): Fix potential overrun problem with "all.reg". + (expand_sdiv2_pow2): Add an alternate implementation for signed + division, if the target provides a suitable conditional move insn. + +2004-08-09 Paul Brook + Richard Henderson + + * unwind-dw2.c (uw_install_context_1): Update target saved stack + pointer. + +2004-08-09 Geoffrey Keating + + * ggc-common.c (ggc_rlimit_bound): Don't check RSS limit. + Check DATA limit only if there's no AS limit. Ignore insanely + low DATA limits. + (ggc_min_heapsize_heuristic): Don't divide AS or RSS limits by 8, + but take care that the AS limit isn't overrun. + * doc/invoke.texi: Update documentation of min-heapsize parameter. + +2004-08-09 Jeff Law + + * Makefile.in (OBJC-common): Add tree-ssa-threadupdate.c + (tree-ssa-threadupdate.o): Add dependencies. + * tree-ssa-threadupdate.c: New file. + * tree-flow.h (incoming_edge_threaded): New flag in block annotation. + (rewrite_vars_out_of_ssa): Remove prototype. + (cleanup_tree_cfg): Returns a bool. + * tree.h (thread_through_all_blocks): Prototype. + * tree-outof-ssa.c (SSANORM_*): Move into here. + (remove_ssa_form): Now static. + (rewrite_vars_out_of_ssa): Kill. + * tree-ssa-live.c (register_ssa_partitions_for_vars): Kill. + * tree-ssa-live.h (SSANORM_*): Moved into tree-outof-ssa.c. + (remove_ssa_form, register_partitions_for_vars): Kill declarations. + * tree-cfg.c (cleanup_tree_cfg): Return a value indicating if + anything was changed. + * tree-phinodes.c (add_phi_arg): Get the block for the PHI + from the PHI's annotation rather than the edge associated with + the new argument. + * tree-ssa-dom.c (redirection_edges): Kill. + (redirect_edges_and_update_ssa_graph): Kill. + (tree_ssa_dominator_optimize): Do not reset forwardable flag + for blocks anymore. Do not initialize redirection_edges. + Call thread_through_all_blocks. Simplify code for cleanup + of the CFG and iterating. No longer call cleanup_tree_cfg + outside the iteration loop. + (thread_across_edge): No longer mess with forwardable blocks. + +2004-08-09 Zack Weinberg + + * explow.c (memory_address): Use memory_address_p. + * recog.c (general_operand): Likewise. + * regrename.c: No need to define REG_OK_STRICT. + +2004-08-09 Steven Bosscher + + * timevar.def (TV_CPROP1, TV_CPROP2, TV_PRE, TV_HOIST, TV_LSM): + New timers. + * gcse.c: Include timevar.h. + (const_prop_count, copy_prop_count): Rename to global_const_prop_count + and global_copy_prop_count. + (local_const_prop_count, local_copy_prop_count): New static globals. + (gcse_main): Set the right timevar for each pass. + (cprop_jump): Increment global_const_prop_count when a constant is + propagated. Add "GLOBAL" to dump output. + (cprop_insn): Increment global_const_prop_count when a constant is + propagated, or global_copy_prop_count when a copy is propagated. + (do_local_cprop): Likewise for local_const_prop_count and + local_copy_prop_count. + (one_cprop_pass): Initialize const/cprop counters to zero. + Print out results of local and global const/cprop separately. + (bypass_block): Break over-length line. + * Makefile.in (gcse.o): Add TIMEVAR_H dependency. Fix dependencies + for bb-reorder.o and tracer.o. + +2004-08-09 Paolo Bonzini + + * Makefile.in (GTFILES): Remove stmt.c + (stmt.o): Do not depend on gt-stmt.h. + * emit-rtl.c (emit_line_note): Do not call + set_file_and_line_for_stmt. + * expr.c (expand_expr_real_1) : Let expand_case + do everything. + * function.c (free_after_parsing): Do not free STMT field. + (allocate_struct_function): Do not call init_stmt_for_function. + (assign_stack_temp_for_type): Do not accept values of keep + other than 0 or 1. + (init_temp_slots): Do not initialize removed variables. + * function.h (struct function): Remove STMT, X_TARGET_TEMP_SLOT_LEVEL + and X_VAR_TEMP_SLOT_LEVEL fields. + * rtl.h (set_file_and_line_for_stmt): Remove. + * stmt.c (struct nesting, ALLOC_NESTING, POPSTACK, + struct stmt_status, cond_stack, case_stack, nesting_stack, + nesting_depth, emit_locus, set_file_and_line_for_stmt, + same_case_target_p, init_stmt_for_function, emit_nop, + expand_start_cond, expand_start_elseif, expand_start_else, + expand_elseif, expand_end_cond): Remove. + (preserve_subexpressions_p): Remove references to CFUN->STMT. + (expand_start_case, expand_end_case_type): Remove, merge into... + (expand_case): ... this one, including other bits from + expand_expr_real_1. Inline same_case_target_p. Turn members + of CASE_STACK into local variables. + (emit_case_bit_tests): Inline same_case_target_p. + (add_case_node): Add HEAD argument, return new head of the list, + do not handle default label here. + * tree.h (expand_start_cond, expand_end_cond, expand_start_else, + expand_start_elseif, current_nesting_level, expand_start_case, + expand_end_case_type, expand_end_case, add_case_node, + init_stmt_for_function, expand_elseif): Remove prototypes. + (expand_case): Add prototype. + +2004-08-09 Paolo Bonzini + + * expr.c (expand_expr_real_1): Use optab_for_tree_code. + +2004-08-09 Paolo Bonzini + + * expr.c (var_rtx): Remove. + (expand_expr_real_1) : + Abort. + (expand_expr_real_1) : Remove most special cases. + * optabs.c (emit_clr_insn, emit_0_to_1_insn): Remove. + * optabs.h (emit_clr_insn, emit_0_to_1_insn): Remove. + +2004-08-08 Mostafa Hagog + Ayal Zaks + + * common.opt (freschedule-modulo-scheduled-loops): New flag. + * final.c (final_scan_insn): Handle NOTE_DISABLE_SCHED_OF_BLOCK. + * modulo-sched.c (sms_schedule): Emit a note to disable scheduling + when -freschedule-modulo-scheduled-loops flag is not specified. + (sms_schedule_by_order, ps_insn_advance_column, add_node_to_ps, + add_node_to_ps, ps_has_conflicts, ps_add_node_check_conflicts): + More accurate placing of insn in row of partial schedule. + (ps_insn_find_column): New function. + * rtl.h (NOTE_DISABLE_SCHED_OF_BLOCK): New note. + * sched-rgn.c (sched_is_disabled_for_current_region_p): New. + (schedule_region): Use sched_is_disabled_for_current_region_p. + * docs/invoke.texi: Document -freschedule-modulo-scheduled-loops. + +2004-08-07 H.J. Lu + + * config/i386/i386.c (ix86_expand_clrmem): Revert the last + change. + +2004-08-07 H.J. Lu + + * config/i386/i386.c (ix86_expand_clrmem): Properly call + gen_strset for 64bit target. + +2004-08-07 Olivier Hainque + + * config/vxworks.h (HANDLE_SYSV_PRAGMA): Remove definition. + +2004-08-07 Jason Merrill + + Make return in memory explicit. + * function.c (aggregate_value_p): Check DECL_BY_REFERENCE. + (assign_parm_find_data_types): Remove code for old front end + invisible reference handling. + (assign_parms): Handle DECL_BY_REFERENCE on the RESULT_DECL. + (expand_function_end): Likewise. + * gimplify.c (gimplify_return_expr): Handle a dereferenced + RESULT_DECL. + * tree-inline.c (copy_body_r): Don't bother looking for &* anymore. + (declare_return_variable): Handle DECL_BY_REFERENCE. + * cp/cp-gimplify.c (is_invisiref_parm): Also handle RESULT_DECL. + (cp_genericize_r): Use convert_from_reference. + Don't dereference a RESULT_DECL directly inside a RETURN_EXPR. + (cp_genericize): Handle the RESULT_DECL. Unset TREE_ADDRESSABLE. + + * c-common.c (c_warn_unused_result): Check TREE_USED before + warning about a CALL_EXPR with an unused value. + +2004-08-06 Mark Mitchell + + * config/arm/symbian.h (CC1_SPEC): Avoid passing duplicate options + to the compiler. Use -fshort-wchar by default. + +2004-08-06 Pat Haugen + + * params.def (PARAM_MIN_CROSSJUMP_INSNS): New. + * cfgcleanup.c (try_crossjump_to_edge): Add minimum insn match + threshhold. + * doc/invoke.texi (param): Document min-crossjump-insns. + +2004-08-06 Richard Sandiford + + PR c/13282 + * c.opt (Wmissing-field-initializers): New option. + * c-opts.c (c_common_post_options): Make -Wextra turn it on by default. + * c-typeck.c (pop_init_level): Guard the missing field warning with + warn_missing_field_initializers rather than extra_warnings. + * doc/invoke.texi (-Wmissing-field-initializers): Document, moving + some of the explanation from... + (-Wextra): ...here. Say that the missing field warning can be + seperately controlled by -Wmissing-field-initializers. + +2004-08-06 Paolo Bonzini + + * expr.c (expand_expr_real_1) : Remove. + * tree-inline.c (estimate_num_insns_1) : Remove. + * tree-pretty-print.c (dump_generic_node) : Remove. + * tree.def (ENTRY_VALUE_EXPR): Remove. + +2004-08-06 Jakub Jelinek + + * config/i386/i386.c (ix86_expand_clrmem): Move gen_cld down to + the places where it is actually needed. Don't use repz; stosb + for -Os with sufficiently small constant sizes. + For sufficiently small repz; stos{l,q} repeat counts use a sequence + of stos{l,q} instructions instead. + +2004-08-06 Zdenek Dvorak + + PR tree-optimization/16807 + * loop-iv.c (dump_iv_info): Dump invariants correctly. + (iv_subreg, iv_extend): Express value of invariant purely in + base field. + +2004-08-06 Mark Mitchell + + * config/arm/symbian.h (CC1_SPEC): Add -fno-short-enums. + (CC1PLUS_SPEC): Define it to be the same as CC1_SPEC. + +2004-08-06 Roman Zippel + + * config/m68k/m68k.c (post_inc_operand,pre_dec_operand): New. + * config/m68k/m68k.h (PREDICATE_CODES): add post_inc_operand, + pre_dec_operand. + * config/m68k/m68k.md (zero_extend*2): delay the splitting of the + pattern until reload is finished to allow better code generation + and split them completely into separate instrunctions. + (*andsi3_split): New pattern. + +2004-08-05 Mark Mitchell + + * tree.c (handle_dll_attribute): Move here from i383/winnt.c. + Replace use of DECL_INLINE with DECL_DECLARED_INLINE_P. Set + DECL_VISIBLITY. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. + * tree.h (handle_dll_attribute): Declare. Test + TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. + * c-common.h (c_determine_visibility): Declare. + * c-common.c (c_determine_visibility): New function. + * c-decl.c (finish_decl): Use it. + (finish_function): Likewise. + * defaults.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define it to + zero, by default. Use #if, not #ifdef, to test it. + * config/arm/arm.c (arm_attribute_table): Use + handle_dll_attribute. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with + #if. + * config/arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define to 1. + * config/i386/cygming.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define + to 1. + * config/i386/i386-protos.h (ix86_handle_dll_attribute): Remove. + * config/i386/i386.c (ix86_attribute_table): Use + handle_dll_attribute for dllimport/dllexport. Test + TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. + * config/i386/winnt.c (ix86_handle_dll_attribute): Remove. + * config/mcore/mcore.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define + it to 1. + * config/mcore/mcore.c (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Test it + with #if. + * config/sh/symbian-pre.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define + it to 1. + * doc/extend.texi (dllexport): Clarify and correct documentation. + (dllimport): Likewise. + * doc/tm.texi (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Mention + handle_dll_attribute. + +2004-08-05 Zdenek Dvorak + + * tree-ssa-loop-manip.c: New file. + * Makefile.in (tree-ssa-loop-manip.o): Add. + * tree-flow.h (rewrite_into_loop_closed_ssa, verify_loop_closed_ssa): + Declare. + * tree-ssa-loop.c (tree_loop_optimizer_init): Create loop closed ssa + form. + (tree_ssa_loop_done): Verify loop closed ssa form. + * tree-ssa-loop-im.c (move_computations): Update loop closed ssa form. + +2004-08-05 John David Anglin + + * pa.c (pa_asm_output_aligned_bss, pa_asm_output_aligned_common, + pa_asm_output_aligned_local): New functions. + * pa-protos.h: Add prototypes for pa_asm_output_aligned_bss, + pa_asm_output_aligned_common and pa_asm_output_aligned_local. + * pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON): Use + pa_asm_output_aligned_common. + (ASM_OUTPUT_ALIGNED_LOCAL): Use pa_asm_output_aligned_local. + * pa.h (ASM_OUTPUT_ALIGNED_BSS): New macro. + (ASM_OUTPUT_ALIGNED_COMMON): Use pa_asm_output_aligned_common. + (ASM_OUTPUT_ALIGNED_LOCAL): Use pa_asm_output_aligned_local. + * pa64-hpux.h (MAX_OFILE_ALIGNMENT): New macro. + (ASM_OUTPUT_ALIGNED_COMMON): Use pa_asm_output_aligned_common. + (ASM_OUTPUT_ALIGNED_LOCAL): Use pa_asm_output_aligned_local. + * som.h (MAX_OFILE_ALIGNMENT): Provide maximum alignment of global + common data. + +2004-08-05 Andrew Pinski + + * objc/objc-act.c (build_objc_string_object): Mark the address + expression as constant. + +2004-08-05 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Fix mask_operand + and mask64_operand thinkos. Handle ZERO_EXTRACT. Handle + SIGN_EXTEND / ZERO_EXTEND of MEM. Handle rlwinm patterns. + +2004-08-05 Joseph S. Myers + + * config/linux.h, config/i386/linux.h, config/sparc/linux.h: + Remove definitions conditioned on USE_GNULIBC_1 or conditioned + out, and associated obsolete comments. + +2004-08-05 Nathan Sidwell + + * tree.h (force_fit_type): Return a tree, take three flags. + * fold-const.c (force_fit_type): Set TREE_OVERFLOW and + TREE_CONSTANT_OVERFLOW here. + (int_const_binop, const_binop): Adjust. + (size_int_type): Do sign extension here. + (fold_convert_const, optimize_bit_field_compare, + decode_field_reference, all_ones_mask_p, fold_div_compare, fold, + fold_negate_const, fold_abs_const, fold_not_const): Adjust. + * tree.c (size_in_bytes, int_fits_type_p): Adjust. + +2004-08-05 Zdenek Dvorak + + PR tree-optimization/16864 + * tree-tailcall.c (eliminate_tail_call): Do not create phi nodes + for ssa names without default_def. + +2004-08-05 Richard Sandiford + + * config/i386/i386.c (ix86_expand_prologue): If the function uses a + frame pointer, restore eax with an ebp-relative address. + +2004-08-04 Geoffrey Keating + + PR 14516 + * c-common.c (c_expand_decl): Don't special-case static VAR_DECLs. + * c-common.h (make_rtl_for_local_static): Delete. + * c-decl.c (shadow_tag_warned): Clean up comment. + (finish_decl): Clean up spacing. Use set_user_assembler_name when + appropriate. Don't pass asmspec to rest_of_decl_compilation. + * c-semantics.c (make_rtl_for_local_static): Delete. + * expr.c (init_block_move_fn): Use set_user_assembler_name. + (init_block_clear_fn): Likewise. + * passes.c (rest_of_decl_compilation): Remove asmspec parameter, + expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files. + * toplev.h (rest_of_decl_compilation): Remove asmspec parameter. + * tree.h (make_decl_rtl): Remove second parameter. + (set_user_assembler_name): New. + * varasm.c (set_user_assembler_name): New. + (make_decl_rtl): Remove second parameter. Update callers in many + files. + +2004-08-05 Adam Nemet + + * config.gcc (case i[34567]86-*-lynxos*): Update to LynxOS 4.0. + (case rs6000-*-lynxos*): Rename it to powerpc-*-lynxos*. Update + to LynxOS 4.0. + * gthr-lynx.h: New file. + * config/lynx-ng.h: Remove file. + * config/lynx.h: Update to LynxOS 4.0. + * config/t-lynx: New file. + * config/i386/lynx-ng.h: Remove file. + * config/i386/lynx.h: Update to LynxOS 4.0. + * config/rs6000/lynxbase.h: Remove file. + * config/rs6000/lynx.h: Update to LynxOS 4.0. + * config/rs6000/t-lynx: New file. + * doc/install.texi (Options specification): Remove reference to + LynxOS from systems where --with-gnu-as makes a difference. + +2004-08-05 Joseph S. Myers + + * c-common.c (c_stddef_cpp_builtins): Define __INTMAX_TYPE__ and + __UINTMAX_TYPE__. + * c-cppbuiltin.c (builtin_define_stdint_macros): New. Define + __INTMAX_MAX__. + (c_cpp_builtins): Call it. + * doc/cpp.texi: Update. + +2004-08-04 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_rtx_costs): LABEL_REFs are zero + cost. + +2004-08-04 Jan Hubicka + + * basic-block.h (profile_staus): New global variable. + * cfg.c (profile_status): Declare. + (check_bb_profile): Break out from ....; use profile_status + (dump_flow_info): ... here. + * cfgbuild.c (find_basic_blocks): Set profile_status. + * cfgexpand.c (tree_expand_cfg): Likewise. + * predict.c (estimate_probability): Likewise. + * profile.c (branch_prob): Likewise. + * tree-cfg.c (build_tree_cfg): Likewise. + (dump_function_to_file): Use check_bb_profile. + * tree-pretty-print (dump_bb_header): Likewise. + * tree-profile.c (do_tree_profiling): Cleanup. + +2004-08-04 Zack Weinberg + + * Makefile.in (RTL_BASE_H, RTL_H): Correct. + (BUILD_RTL): Remove $(BUILD_PREFIX) from ggc-none.o. + (genobjs): Add errors.o, ggc-none.o, and min-insn-modes.o. + (read-rtl.o, gensupport.o, genconfig.o, genflags.o, gencodes.o) + (genconstants.o, genemit.o, genopinit.o, genrecog.o, genextract.o) + (genpeep.o, genattr.o, genattrtab.o, genautomata.o, genoutput.o) + (genconditions.o): Depend on $(RTL_BASE_H) not $(RTL_H). + (ggc-none.o, errors.o): Move rule to generators section; + correct dependencies. + (min-insn-modes.o): Move rule to generators section; remove + unnecessary explicit command; correct dependencies. + (print-rtl.o, print-rtl1.o): Correct dependencies. + ($(BUILD_PREFIX_1)errors.o. $(BUILD_PREFIX_1)ggc-none.o): Delete rule. + (mostlyclean): Update. + + * errors.c: Include bconfig.h not config.h. Correct comment. + * gengtype.c, genpreds.c: Don't define NO_GENRTL_H. + * ggc-none.c: Include bconfig.h; not config.h or tm.h. + * print-rtl.c: Don't include tm_p.h. + + * rtl.h: Move forward-decl of struct function down where it's + needed. Include genrtl.h #ifndef GENERATOR_FILE, not + #ifndef NO_GENRTL_H. Remove unnecessary #ifdef BUFSIZ statements. + +2004-08-04 Zdenek Dvorak + Jeff Law + + * tree-cfg.c (tree_duplicate_bb): Mark duplicated definitions. + * tree-flow.h (rewrite_ssa_into_ssa): Declaration changed. + * tree-into-ssa.c (rewrite_ssa_into_ssa): Use new interface to + manipulate the duplicated ssa names. + * tree-ssanames.c (ssa_names_to_rewrite): New variable. + (marked_for_rewrite_p, any_marked_for_rewrite_p, mark_for_rewrite, + unmark_all_for_rewrite, marked_ssa_names, release_ssa_name_force): + New functions. + (release_ssa_name): Do not release ssa names that may have multiple + definitions. + * tree.h (release_ssa_name_force, mark_for_rewrite, + unmark_all_for_rewrite, marked_for_rewrite_p, any_marked_for_rewrite_p, + marked_ssa_names): Declare. + * tree-ssa-loop-ch.c (mark_defs_for_rewrite): Remove. + (duplicate_blocks): Remove call to mark_defs_for_rewrite. + Update call to rewrite_ssa_into_ssa. + +2004-08-04 Mark Mitchell + + * defaults.h (TARGET_DECLSPEC): New macro. + * c-cppbuiltin.c (c_cpp_builtins): Handle TARGET_DECLSPEC. + * config/arm/pe.h (SUBTARGET_CPP_SPEC): Remove __declspec support. + * config/arm/symbian.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. + * config/i386/beof-elf.h (TARGET_OS_CPP_BUILTINS): Remove + __declspec support. + (TARGET_DECLSPEC): Define. + * config/i386/cygming.h (TARGET_OS_CPP_BUILTINS): Remove + __declspec support. + * config/i386/i386-interix.h (TARGET_OS_CPP_BUILTINS): Remove + __declspec support. + (TARGET_DECLSPEC): Define. + * config/mcore/mcore.h (TARGET_CPU_CPP_BUILTINS): Remove + __declspec support. + * config/sh/symbian-pre.h (SUBTARGET_CPP_SPEC): Remove __declspec + support. + * doc/tm.texi (TARGET_DECLSPEC): Document. + + * doc/extend.texi: Fix typo in comment. + +2004-08-04 Paul Brook + + * target-def.h (TARGET_CXX_CDTOR_RETURNS_THIS): Define. + (TARGET_CXX): Use it. + * target.h (struct gcc_target): Add cdtor_returns_this. + * config/arm/arm.c (arm_cxx_cdtor_returns_this): New function. + (TARGET_CXX_CDTOR_RETURNS_THIS): Define. + * doc/tm.texi: Document TARGET_CXX_CDTOR_RETURNS_THIS. + +2004-08-03 Nathan Sidwell + + * c-lex.c (narrowest_unsigned_type, narrowest_signed_type): Take + low/high pair. Do range checking directly. + (interpret_integer): Adjust. + +2004-08-04 Nick Clifton + + * config/sh/sh.h (TARGET_SWITCHES): Add no-renesas to select the + GCC ABI. + * doc/invoke.texi: Document this new switch and also the -mrenesas + switch. + +2004-08-04 Nathan Sidwell + + * cfglayout.c (insn_locators_initialize): Update the current + location before initializing a location. + +2004-08-03 Zack Weinberg + + * dbxout.c (dbxout_function_decl): Always call dbxout_function_end. + (dbxout_function_end): Return after emitting the "Lscope" symbol + under the same conditions that this function formerly wasn't called. + Add explanatory comments. + + PR 14860 + * c-decl.c (record_builtin_type): Call debug_hooks->type_decl + on the new decl. + + PR 13956 + * dbxout.c (dbx_output_lbrac, dbx_output_rbrac): New + functions, broken out of dbxout_block. + (dbxout_block): The block at depth 0 should get LBRAC/RBRAC + stabs too, if it contains symbols. Use the begin_label and + the Lscope label (emitted by dbxout_function_end) for the + range of this block. + +2004-08-03 Nathanael Nerode + + * doc/install.texi: Update autoconf version requirements. + +2004-08-03 Zack Weinberg + + * defaults.h (LEGITIMATE_PIC_OPERAND_P): Provide default definition. + * recog.c (general_operand, immediate_operand, nonmemory_operand) + (asm_operand_ok): Remove #ifdefs on LEGITIMATE_PICOPERAND_P. + * regclass.c (record_reg_classes): Likewise. + * reload.c (find_reloads): Likewise. + * reload1.c (reload): Likewise. + +2004-08-03 Zack Weinberg + + * gensupport.c (init_md_reader_args_cb): Renamed from + init_md_reader_args. Add third option, callback function for + parsing program-specific options. Add diagnosis of incorrect + number of input files. + (init_md_reader): Fold into init_md_reader_args_cb. + (init_md_reader_args): Now a thin wrapper around + init_md_reader_args_cb. + * gensupport.h: Update prototypes. + + * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c + * genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c + * genrecog.c: No need to diagnose lack of an input file; + init_md_reader_args will handle it. + * genconditions.c: Likewise, and use init_md_reader_args. + * genconstants.c: Likewise, and no need to call read_md_rtx. + +2004-08-03 Joseph S. Myers + + * c-decl.c (implicitly_declare): Diagnose incompatible implicit + declarations. + +2004-08-03 Mike Stump + + * config/darwin-c.c: Don't search in "/Local/Library/Frameworks" + for frameworks. + * doc/invoke.texi (Darwin Options): Update to reflect above. + +2004-08-03 Roger Sayle + + PR middle-end/16790 + * fold-const.c (extract_muldiv_1) : Disallow local + truncations, not just global truncations. + +2004-08-03 Andrew Pinski + + PR bootstrap/16865 + * loop-iv.c (simplify_using_assignment): Initialize lhs. + +2004-08-03 Paul Brook + + * doc/install.texi: Document MPFR requirement. + +2004-08-03 Maciej W. Rozycki + + * aclocal.m4 (gcc_AC_FUNC_MMAP_BLACKLIST): Check for + and mmap() explicitly instead of relying on preset autoconf cache + variables. + * configure: Regenerate. + +2004-08-03 H.J. Lu + + PR target/16570 + * config.gcc (i[34567]86-*-* | x86_64-*-*): Add i386/t-gmm_malloc + to tmake_file. + (i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1): Likewise. + (i[34567]86-*-linux* | x86_64-*-linux*): Add i386/t-pmm_malloc + to tmake_file. + + * config/i386/t-gmm_malloc: New file. + * config/i386/t-pmm_malloc: Likewise. + + * config/i386/xmmintrin.h: Include . + +2004-08-03 H.J. Lu + Tanguy Fautrà + + * config/i386/pmm_malloc.h: New file. + +2004-08-03 Danny Smith + + * config/i386/gmm_malloc.h: New file. + +2004-08-03 Dale Johannesen + + * config/rs6000/rs6000.c (machopic_output_stub): Align Darwin stubs. + * c-common.c: Include opts.h. + (c_common_get_alias_set): Fix check for a single input file. + * toplev.c: Remove current_file_decl. + * tree.h: Ditto. + +2004-08-03 Mark Mitchell + + * config.gcc (arm*-*-symbianelf*): New target. + * config/arm/symbian.h: New file. + + * gthr-gnat.c: Add visibility #pragmas. + * gthr-gnat.h : Likewise. + * gthr.h: Likewise. + * libgcc2.c (__ffsSI2): Move prototype to libgcc2.h. + (__ffsDI2): Likewise. + (__clzSI2): Likewise. + (__ctzSI2): Likewise. + (__ctzDI2): Likewise. + (__popcountSI2): Likewise. + (__popcountDI2): Likewise. + (__paritySI2): Likewise. + (__parityDI2): Likewise. + * libgcc2.h: Add visibility #pragmas. + (__clzDI2): Add prototype. + (__clzSI2): Likewise. + (__ctzSI2): Likewise. + (__ffsDI2): Likewise. + (__ffsSI2): Likewise. + (__ctzDI2): Likewise. + (__popcountSI2): Likewise. + (__popcountDI2): Likewise. + (__paritySI2): Likewise. + (__parityDI2): Likewise. + * unwind-dw2-fde.h: Add visibility #pragmas. + * unwind.h: Likewise. + +2004-08-03 David Edelsohn + Dale Johannesen + Roger Sayle + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Calculate cost of + constants more accurately. Adjust costs for FMA instructions. + Add cases for most logical and float operations. Recurse into + most operands. + +2004-08-03 Richard Earnshaw + + * config.gcc (strongarm-*, xscale-*): Add t-arm to tmake_files. + +2004-08-03 Pat Haugen + + * ra-build.c (conflicts_between_webs): For webs that cross a call add + conflicts to regs_invalidated_by_call. + +2004-08-03 Paul Brook + + * config/arm/arm.c (emit_sfm): Only emit a single frame adjustment. + +2004-08-03 Jan Hubicka + + * coverage.c (tree_coverage_counter_ref): Fix computation of the new + ARRAY_REF argument. + +2004-08-03 Richard Earnshaw + + * arm-cores.def: Sort by architecture. Add arm946es, arm966es, + arm968es, arm10e, arm1020e, arm1022e. + * invoke.texi: Update list of ARM cores. + * arm-tune.md: Regenerate. + +2004-08-03 Richard Earnshaw + + * arm/gentune.sh: New file. + * arm/t-arm: New file. + * arm/arm-tune.md: New file (autogenerated). + * config.gcc (arm*-*-*): Add t-arm to tmake_file for all variants. + * arm.md (attribute tune): Delete. Include arm-tune.md. + +2004-08-03 Paolo Bonzini + + * gcc.c (add_prefix, add_sysrooted_prefix): Remove + penultimate parameter. All callers adjusted. + (struct prefix_list): Remove used_flag_ptr. + (find_a_file): Do not set *pl->used_flag_ptr. + (warn_B, warn_std_ptr): Remove. + +2004-08-03 Yossi Markovich + Mostafa Hagog + + * config/rs6000/altivec.md (altivec_vnmsubfp): Fix wrong pattern. + +2004-08-02 Geoffrey Keating + + * dwarf2out.c (output_call_frame_info): Don't change data format + due to TARGET_USES_WEAK_UNWIND_INFO. Always refer to the local + label. Use 'true' not '1'. + * doc/install.texi (powerpc-*-darwin*): Mention cctools version + required. + +2004-08-02 Gabriel Dos Reis + + * gdbinit.in: Reflect previous changes to rtunion_def. + +2004-08-02 Roger Sayle + + * fold-const.c (fold) : The transformation "X % -Y" + -> "X % Y" is only valid for TRUNC_MOD_EXPR. + +2004-08-02 Gabriel Dos Reis + + * vec.h (DEF_VEC_P): Add proper cast to uses of vec_o_reserve and + vec_p_reserve. + * langhooks.h (lang_hooks::builtin_function): Rename parameter + from "class" to "bt_class". + +2004-08-02 Paul Brook + + PR rtl-optimization/15068 + * flow.c (init_propagate_block_info): Check condition is reversible. + +2004-08-02 Gabriel Dos Reis + + * gengtype.h (options::info): Change type to const char *. + (enum gc_used_enum): Move out of struct type scope. + * gengtype.c (create_option): Convert initializer for option::info to + appropiate type. + (adjust_field_type, walk_type, write_func_for_structure, + write_root, write_roots): Remove pointless cast. + +2004-08-02 J"orn Rennecke + + * genopinit.c (gen_insn): Check for MODE_COMPLEX_FLOAT patterns for $F. + +2004-08-02 Gabriel Dos Reis + + * rtl.h (union rtunion_def): Have all members start with the + prefix "rt_". + (XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE, XBBDEF, XTMPL, + X0INT, X0UINT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE, + X0MEMATTR, X0BBDEF, X0REGATTR, XCINT, XCUINT, XCSTR, XCEXP, + XCVEC, XCMODE, XCBITMAP, XCTREE, XCBBDEF, XC2EXP): Adjust members + access. + * gengtype.c (adjust_field_rtx_def): Likewise. + * rtlanal.c (loc_mentioned_in_p): Likewise. + +2004-08-02 Richard Sandiford + + * config.gcc (mips*-*-elf*, mips*-*-rtems*): Add elfos.h to tm_file. + Replace uses of mips/elf64.h with mips/elf.h + * config/mips/elf.h (MAX_OFILE_ALIGNMENT, TARGET_ASM_NAMED_SECTION) + (TYPE_OPERAND_FMT, TYPE_ASM_OP, SIZE_ASM_OP, BSS_SECTION_ASM_OP) + (ASM_OUTPUT_ALIGNED_BSS, ASM_WEAKEN_LABEL, ASM_OUTPUT_WEAK_ALIAS) + (MAKE_DECL_ONE_ONLY, INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP) + (HANDLE_SYSV_PRAGMA): Delete. + (ASM_OUTPUT_DEF): Fix formatting. + * config/mips/elf64.h: Delete. + +2004-08-01 Zack Weinberg + + * config/ia64/ia64.c (got_symbolic_operand): Do require a + symbol+offset operand to have its offset be zero mod 0x3fff + when GOT entries are in use. Clarify logic in SYMBOL_REF + case. Clarify comments. + (ia64_expand_load_address): Split a symbol+offset load when + the offset is nonzero mod 0x3fff, not 0x1fff. + +2004-08-01 Geoffrey Keating + + * config/rs6000/rs6000.c (rs6000_split_multireg_move): Just abort + if trying to *store* to a non-offsettable address. + * config/rs6000/rs6000.md (movtf_internal): Don't move GPRs to + a nonoffsettable address. + (movdi_internal32): Don't move GPRs to a nonoffsettable address. + Clean up. + (movti_string): Don't move GPRs to a nonoffsettable address. + (movti_ppc64): Don't move GPRs to a nonoffsettable address. Clean up. + +2004-08-02 Ben Elliston + + PR target/16155 + * config/rs6000/altivec.h: Replace typeof with __typeof__. + +2004-08-01 Richard Henderson + + * expr.c (expand_expr_real_1) : Fix crash with + variable sized types. + +2004-08-01 Richard Sandiford + + * doc/invoke.texi: In the MIPS options section, remove the passage + saying that -mexplicit-relocs is usually disabled for -mabicalls + -fno-unit-at-a-time. + * config/mips/mips.c (override_options): Remove the code that enforced + this rule. + +2004-08-01 Richard Sandiford + + * config/mips/mips.md (cprestore): Provide two alternatives, one for + an in-range offset and one for an out-of-range offset. Wrap the latter + in .set macro/.set nomacro if it's inside a .set nomacro block. + +2004-08-01 Richard Sandiford + + * config/mips/mips-protos.h (mips_gp_save_slot): Remove. + (mips_restore_gp): Declare. + * config/mips/mips.c (mips_add_offset): Add a scratch register + argument. Reimplement in rtl only, reusing MIPS16 logic from + mips_output_mi_thunk. + (mips_legitimize_address, mips_legitimize_const_move): Adjust calls + to mips_add_offset. + (mips_gp_save_slot): Delete. + (mips_restore_gp): New function. + (mips_set_return_address, mips_output_mi_thunk): Use mips_add_offset. + * config/mips/mips.md (exception_receiver): Turn into a + define_insn_and_split. Use mips_restore_gp to do the split. + (call_internal, call_value_internal, call_value_multiple_internal): Use + mips_restore_gp to restore $gp. + +2004-07-31 Andrew Pinski + + PR other/16842 + * mkheaders.in (libsubdir): s/gcc-lib/gcc/. + +2004-07-31 Joseph S. Myers + + * c-decl.c (diagnose_mismatched_decls): Give error for external + redeclaration of identifier declared with no linkage, not just + warning with -Wtraditional. Do not check DECL_CONTEXT to give + error for redeclaration with no linkage. + +2004-07-30 Geoffrey Keating + Fariborz Jahanian + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Permit + non-offsettable addresses even for DImode. + (rs6000_split_multireg_move): Cope with non-offsettable addresses + being moved into multiple GPRs. + + * config/rs6000/rs6000.c (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Default + to 64. + (rs6000_override_options): Use RS6000_DEFAULT_LONG_DOUBLE_SIZE. + * config/rs6000/darwin.h (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define + to 128. + * config/rs6000/darwin-ldouble.c (isless): New macro. + (inf): New macro. + (nonfinite): New macro. + (FPKINF): Delete. + (_xlqadd): Completely rewrite. + (_xlqmul): Correct overflow handling. + (_xlqdiv): Correct overflow handling. + * config/rs6000/darwin-ldouble-format: New file. + +2004-07-30 Roger Sayle + Richard Henderson + + * config/i386/i386.md: New peephole2's to convert imul by 3, 5 or + 9 into the equivalent lea instruction. + +2004-07-30 Richard Henderson + + * gimplify.c (gimplify_expr) : Don't replace + with DECL_INITIAL if fb_lvalue. + * tree-gimple.c (is_gimple_id): Add CONST_DECL. + * tree-pretty-print.c (dump_decl_name): Dump unnamed CONST_DECL + with . + * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Fold CONST_DECL. + +2004-07-30 Diego Novillo + + * tree-ssa-alias.c (compute_points_to_and_addr_escape): If a + pointer escapes through a function call, assume that the + callee will dereference it. + (add_pointed_to_var): Assume that VALUE is always an + ADDR_EXPR. + (collect_points_to_info_r): Only call add_pointed_to_var if + the value is an ADDR_EXPR. + +2004-07-30 Diego Novillo + + * tree-ssa-alias.c (create_alias_map_for): Do not get the + alias set of the inner type of ARRAY_TYPEs. + +2004-07-29 Diego Novillo + + * tree-ssa-ccp.c (visit_assignment): Move code to prevent + setting a non-register to UNDEFINED right before the call to + set_lattice_value. + +2004-07-29 Kaz Kojima + + * config/sh/lib1funcs.asm: Make aliases movstr* for movmem*. + +2004-07-29 Diego Novillo + + * tree-ssa.c (verify_flow_sensitive_alias_info): When + comparing points-to sets of different pointers, make sure the + second pointer is actually referenced in the code. + +2004-07-29 Zack Weinberg + + * config/ia64/ia64.c (setjmp_operand): Delete, unused. + (got_symbolic_operand): Remove unreachable code. + * config/ia64/ia64.h (PREDICATE_CODES): Remove entry for + setjmp_operand; add entry for tls_symbolic_operand. + * config/ia64/ia64-protos.h: Remove all prototypes of + predicate functions. + +2004-07-29 Mark Mitchell + + * c-common.h (lang_post_pch_load): New variable. + * c-pch.c (lang_post_pch_load): Define it. + (c_common_read_pch): Use it. + * cgraphunit.c (record_call_1): Give the front end a chance to + record additional needed entities when a variable is marked as + needed. + * tlink.c (recompile_files): Robustify. + (scan_linker_output): If a symbol is assigned to a file, + but after recompilation is not present there, issue an error + message. + +2004-07-29 Zdenek Dvorak + + * tree-ssa-loop-im.c (force_move_till_expr, force_move_till): + Take orig_loop argument and pass it to set_level. + (schedule_sm): Pass the correct orig_loop to force_move_till. + +2004-07-29 Zdenek Dvorak + + * cfgloop.c (update_latch_info): Update dominator of the new block. + (canonicalize_loop_headers, flow_loops_find): Do not free dominance + info. + * dominance.c (verify_dominators): Check that the dominance tree is + connected. + (recount_dominator): Ignore unreachable blocks. + (iterate_fix_dominators): Cleanup old dominance information before + recomputing it. + +2004-07-29 Diego Novillo + + * tree-ssa-operands.c (get_expr_operands): Revert changes + to ADDR_EXPR processing introduced by: + 2004-06-21 Richard Kenner + * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. + +2004-07-29 Joseph S. Myers + + * doc/implement-c.texi: Add C90 subclause references. Point to + preprocessor documentation instead of duplicating it. Add points + only present in C90. Fill in documentation for all points. + +2004-07-29 John David Anglin + + * pa.c (output_movb): Correct typo. + +2004-07-29 Pat Haugen + + * ra.h (single_reg_in_regclass): Declare. + * ra.c (single_reg_in_regclass): Define. + (first_hard_reg): New. + (init_ra): Initialize single_reg_in_regclass. + * ra-colorize.c (ok_class): New. + (coalesce, aggressive_coalesce, extended_coalesce_2): Use it. + +2004-07-29 Nathan Sidwell + + * gcov-io.h: Allow zero tag as EOF indicator. + (gcov_is_eof): Remove. + (gcov_truncate): Remove. + * gcov-io.c (gcov_seek): Always SEEK_SET. + * libgcov.c (gcov_exit): Don't use gcov_truncate. Write explicit + EOF tag. + * coverage.c (read_counts_file): Don't use gcov_is_eof. + * gcov-dump.c (dump_file): Likewise. + * gcov.c (read_graph_file, read_count_file): Likewise. + + * c-decl.c (complete_array_type): Don't gratuitously copy + maxindex. Check it always has a type. + +2004-07-29 Steven Bosscher + + * rtl.c (currently_expanding_to_rtl): New. + * rtl.h (currently_expanding_to_rtl): Export it. + * cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit. + + * config/alpha/alpha.c (alpha_expand_mov): Remove old RTL + inliner hack. + * config/sh/sh.c: Replace rtx_equal_function_value_matters + with currently_expanding_to_rtl. + * config/sh/sh.md: Likewise. + * config/ia64/ia64.c (got_symbolic_operand): Likewise. + +2004-07-29 Alexandre Oliva + + Introduce sh2a support. + 2004-07-29 Alexandre Oliva + * config.gcc: Build multilibs for sh2a and sh2a-single by + default. + * config/sh/sh.h (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Define by + default. Split their tests out of the corresponding SH4 + multilibs. + * config/sh/t-sh (MULTILIB_MATCHES): Don't ever use SH4 or SH4a + multilibs for SH2a. + 2004-07-28 Alexandre Oliva + * config.gcc: Handle sh2a multilibs and cpu selection. + * config/sh/sh.h: Likewise. Handle sh2a command line flags. + * config/sh/t-mlib-sh2a: New. + * config/sh/t-mlib-sh2a-nofpu: New. + * config/sh/t-mlib-sh2a-single: New. + * config/sh/t-mlib-sh2a-single-only: New. + 2004-07-09 Nick Clifton + Issue 43400 + * config/sh/sh.h (DRIVER_SELF_SPECS): Issue an error message if + -ml and -m2a are used together. + 2004-03-23 DJ Delorie + * config/sh/sh.c (sh_builtin_saveregs): Use the double code only + when we have a double-sized FPU. + 2004-02-24 Corinna Vinschen + * config/sh/lib1funcs.asm (set_fpscr): Don't build if __SH2A_NOFPU__ + is set. + * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Add cases for -msh2a-nofpu, + -msh2a-single and -msh2a-single-only + 2004-02-24 Corinna Vinschen + * config/sh/crt1.asm: Don't generate FPU instructions if __SH2A_NOFPU__ + is set. + 2004-02-20 DJ Delorie + * config/sh/sh.md (movsf_i, movsf_ie, movsf, ble, bge): Disable for sh2a-nofpu. + 2004-02-20 Fred Fish , + Corinna Vinschen + * config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu. + (MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a. + 2004-02-18 DJ Delorie + * config/sh/sh.c (broken_move): Add support for movi20. + * config/sh/sh.h: Likewise. + (SHIFT_COUNT_TRUNCATED): Set for sh2a. + * config/sh/sh.md (udivsi3_sh2a): New. + (udivsi3): Call it. + (divsi3_sh2a): New. + (divsi3): Call it. + (mul_r): New. + (ashlsi3_sh2a): New. + (ashrsi3_sh2a): New. + (lshrsi3_sh2a): New. + (movsi_i): Disable for sh2a. + (movsi_ie): Add movi20. + (movsf_i, movsf_ie, movsf, ble, untyped_call): Explicitly enable + sh2a, for -m2a-nofpu mode. + 2004-02-13 DJ Delorie + * config/sh/lib1funcs.asm: Handle double vs single better. + * config/sh/sh.h: Likewise. + 2004-02-09 DJ Delorie + * config/sh/crt1.asm: Add support for sh2a. + * config/sh/elf.h: Likewise. + * config/sh/lib1funcs.asm: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.md: Likewise. + * config/sh/sh.h: Likewise. + * config/sh/t-sh: Likewise. + +2004-07-28 Alexandre Oliva + + * config/frv/frv.md (movqi_internal, movhi_internal, + movsi_internal): Add backup alternatives for memory inputs. + +2004-07-28 Matt Austern + + * config/darwin.c (darwin_one_byte_bool): New global variable. + * config/darwin.h (darwin_one_byte_bool): Declare. + (SUBTARGET_OPTIONS): Define macro. (for -mone-byte-bool flag.) + * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Conditionalize on + value of darwin_one_byte_bool. + * doc/invoke.texi: Document -mone-byte-bool flag. + +2004-07-28 Eric Christopher + + * c-common.c (c_common_unsafe_for_reeval): Delete. + * c-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete use. + * c-pretty-print.c (pp_c_expression): Delete UNSAVE_EXPR case. + * calls.c (fix_unsafe_tree): Delete. + (expand_call): Delete code which used above. + * dojump.c (do_jump): Delete UNSAVE_EXPR case. + * expr.c (expand_expr_real_1): Ditto. + * fold-const.c (non_lvalue): Ditto. + * langhooks-def.h (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete. + (lhd_unsafe_for_reeval): Ditto. + * langhooks.c (lhd_unsafe_for_reeval): Ditto. + * langhooks.h (unsafe_for_reeval): Ditto. + (unsave_expr_now): Adjust comment. + * tree-inline.c (copy_body_r): Delete UNSAVE_EXPR bits. + (estimate_num_insns_1): Ditto. + * tree-pretty-print.c (dump_generic_node): Ditto. + * tree.c (expr_align): Ditto. + (unsave_expr): Delete. + (unsafe_for_reeval): Ditto. + * tree.h (unsafe_for_reeval, unsave_expr): Ditto. + * tree.def (UNSAVE_EXPR): Delete. + * objc/objc-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete. + +2004-07-28 Zack Weinberg + + * tree.h (enum tls_model): Move ... + * coretypes.h: ... here. + +2004-07-28 Richard Sandiford + + * config/frv/frv.h (EPILOGUE_USES): New. Use LR. + +2004-07-28 Richard Sandiford + + * cse.c (validate_canon_reg): New function, split out from... + (canon_reg): ...here. Use validate_canon_reg for both 'e' and 'E'. + +2004-07-28 Diego Novillo + + * tree-ssa-alias.c (maybe_create_global_var): Don't just + return if .GLOBAL_VAR has been created. + +2004-07-28 Diego Novillo + + * tree-ssa.c (verify_flow_insensitive_alias_info): Process + every variable that may have aliases, not just tags. + +2004-07-28 Aldy Hernandez + + * config/rs6000/rs6000.md ("move_from_CR_gt_bit"): Rename to + move_from_CR_eq_bit. + Rename UNSPEC_MV_CR_GT to UNSPEC_MV_CR_EQ. + + + * config/rs6000/spe.md ("e500_flip_gt_bit"): Rename to + e500_flip_eq_bit. + + * config/rs6000/rs6000-protos.h: Rename output_e500_flip_gt_bit to + output_e500_flip_eq_bit. + + * config/rs6000/rs6000.c (output_e500_flip_gt_bit): Rename to + output_e500_flip_eq_bit. + (rs6000_emit_sCOND): Rename call to output_e500_flip_gt_bit to + output_e500_flip_eq_bit. + Rename gen_move_from_CR_gt_bit to gen_move_from_CR_eq_bit. + (print_operand): case D. Get to EQ bit. + +2004-07-28 Richard Sandiford + + * gcov.c (function_summary): Add missing \n. + +2004-07-28 Alexandre Oliva + + Introduce sh4a support. + * config.gcc: Handle sh4a multilibs and cpu selection. + * config/sh/sh.h: Likewise. Handle sh4a command line flags. + * config/sh/t-mlib-sh4a: New. + * config/sh/t-mlib-sh4al: New. + * config/sh/t-mlib-sh4a-nofpu: New. + * config/sh/t-mlib-sh4a-single: New. + * config/sh/t-mlib-sh4a-single-only: New. + 2004-02-20 DJ Delorie + * config/sh/sh.md ("movua"): Change constraint from "m" to "Sua". + * config/sh/sh.h (EXTRA_CONSTRAINT_S): Add "Sua" support. + 2003-08-22 Eric Christopher + * config/sh/sh4a.md: Update for chip errata. + 2003-08-07 Eric Christopher + * config/sh/sh4a.md: New file. sh4a processor description. + 2003-07-08 Alexandre Oliva + * config/sh/sh.h (TARGET_SWITCHES): Added 4al. Adjust description + of -m4a-nofpu. + (SH_ASM_SPEC): Pass -dsp for -m4al, not -m4a-nofpu. + * config/sh/t-sh (MULTILIB_MATCHES): Map -m4al to -m4a-nofpu. + * doc/invoke.texi (SH Options): Document -m4al. + 2003-07-03 Alexandre Oliva + * config/sh/sh.c (expand_block_move): Remove commented-out code + checked in by mistake. + (sh_cannot_change_mode_class): Enable SUBREGs to be used to select + single elements from SFmode vectors. + * config/sh/sh.md (fsca): Use VEC_CONCAT to initialize the output + register. + (sinsf2, cossf2, sindf2, cosdf2): Don't emit CLOBBER. + 2003-07-01 Alexandre Oliva + * config/sh/sh.h (sh_fsca_sf2int, sh_fsca_df2int, + sh_fsca_int2sf): Remove variable declarations. + * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, + sh_fsca_int2sf): New functions. + (sh_fsca_sf2int_rtx, sh_fsca_df2int_rtx, + sh_fsca_int2sf_rtx): New static variables. + * config/sh/sh-protos.h (sh_fsca_sf2int, sh_fsca_df2int, + sh_fsca_int2sf): Declare. + * config/sh/sh.md: Adjust. + * doc/invoke.texi (SH Options): Document new options. + * config/sh/lib1funcs.asm (ic_invalidate): Remove SH4a forward + compatibility from SH4 code. + 2003-06-27 Alexandre Oliva + * config/sh/sh.c (expand_block_move): Don't emit POST_INC too + early. + (memory_movsrc_operand): Renamed to... + (unaligned_load_operand): ... this. Simplified. + * config/sh/sh.h (PREDICATE_CODES): Adjust. + * config/sh/sh.md (movua, extv, extzv): Likewise. Change movua's + input operand to SImode, and adjust the others. Introduce + post-increment by peephole. + * config/sh/sh.c (expand_block_move): Give the target address the + same mode as the temp reg. + * config/sh/sh.c (expand_block_move): Use a temp reg for unaligned + copying. + 2003-06-26 Alexandre Oliva + Introduce support for SH4a. + * config/sh/lib1funcs.asm (ic_invalidate): Use icbi if + __SH4A__. Emit 4 4kb blocks and touch all of them otherwise. + * config/sh/sh.c (sh_fsca_sf2int, sh_fsca_df2int, + sh_fsca_int2sf): New. + (sh_init_builtins): Initialize them. + (print_operand): Support `d'. + (expand_block_move): Use movua if src is misaligned. + (memory_movsrc_operand): New. + * config/sh/sh.h (TARGET_CPU_CPP_BUILTINS): Define __SH4A__ + and one of the SH4 macros. + (SH4A_BIT, TARGET_SH4A_ARCH, TARGET_SH4A_FP, + SELECT_SH4A_NOFPU, SELECT_SH4A_SINGLE_ONLY, SELECT_SH4A, + SELECT_SH4A_SINGLE): New. + (TARGET_NONE): Add SH4A_BIT. + (TARGET_SWITCHES): Add 4a-single-only, 4a-single, 4a-nofpu and 4a. + (SH_ASM_SPEC): Pass -dsp if -m4a-nofpu. + (sh_fsca_sf2int, sh_fsca_df2int, sh_fsca_int2sf): Declare. + (OVERRIDE_OPTIONS): Set cpu to CPU_SH4A when appropriate. + (enum processor_type): Added PROCESSOR_SH4A. + (PREDICATE_CODES): Add memory_movsrc_operand. + * config/sh/sh.md: Removed unused variables. + (attr cpu): Add sh4a. + (attr type): Add movua, fsrra and fsca. + (prefetch): New, for SH4. + (ic_invalidate_line, ic_invalidate_line_sh4a): Use icbi. + (toggle_sz): Set type to fp. + (toggle_pr, rsqrtsf2, fsca, sinsf2, cossf2, sindf2, cosdf2): New. + (movua, extv, extzv): New. + * config/sh/t-sh: Add multilibs for 4a, 4a-nofpu, 4a-single + and 4a-single-only. + +2004-07-28 Diego Novillo + + * tree-optimize.c (init_tree_optimization_passes): Schedule + pass_may_alias right after the program is renamed into SSA. + * tree-pass.h (PROP_alias): Define. + * tree-outof-ssa.c (pass_del_ssa): Require PROP_alias. + * tree-sra.c (pass_sra): Likewise. + * tree-ssa-ccp.c (pass_ccp): Likewise. + * tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise. + * tree-ssa-dce.c (pass_dce): Likewise. + * tree-ssa-dom.c (pass_dominator): Likewise. + * tree-ssa-dse.c (pass_dse): Likewise. + * tree-ssa-forwprop.c (pass_forwprop): Likewise. + * tree-ssa-loop-ch.c (pass_ch): Likewise. + * tree-ssa-phiopt.c (pass_phiopt): Likewise. + * tree-ssa-pre.c (pass_pre): Likewise. + * tree-tailcall.c (pass_tail_recursion): Likewise. + * tree-ssa.c (pass_redundant_phi): Likewise. + * tree-ssa-alias.c (aliases_computed_p): Remove. + Update all users. + (init_alias_info): Do not mark all type tags for renaming + unconditionally. + Clear may_aliases from every symbol. + (setup_pointers_and_addressables): If a pointer has not been + dereferenced and it had a type tag, clear it and mark the old + tag for renaming. + +2004-07-28 Diego Novillo + + PR tree-optimization/16705 + * tree-ssa-alias.c (create_global_var): Set DECL_EXTERNAL on + .GLOBAL_VAR. + +2004-07-27 Richard Kenner + + * expr.c (expand_expr_real_1, case PARM_DECL): Remove obsolete error + check. + + * gimplify.c (maybe_with_size_expr): If already have WITH_SIZE_EXPR, + don't make another one. + + PR optimization/15077 + * function.h (struct function): Add field saved_static_chain_decl. + Fix comment for static_chain_decl. + * tree-inline.c (save_body): Add new arg and handle static_chain_decl. + * tree-inline.h (save_body): Add new arg. + * tree-optimize.c (tree_rest_of_compilation): Handle saving + static_chain_decl. + +2004-07-27 Richard Henderson + + * gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove. + (gimplify_modify_expr, gimplify_addr_expr, gimplify_expr): Use + is_gimple_addressable. + * tree-gimple.c (is_gimple_addressable): Rename from + is_gimple_addr_expr_arg; accept INDIRECT_REF. + (is_gimple_lvalue): Don't test INDIRECT_REF directly. + * tree-gimple.h, tree-sra.c, tree-ssa-loop-im.c: Update for + rename to is_gimple_addressable. + +2004-07-28 Alan Modra + + * config/rs6000/rs6000.c (function_arg_padding): Pad SFmode upwards. + +2004-07-27 Richard Henderson + + * function.c (assign_stack_local_1): Widen alignment to HOST_WIDE_INT + before rounding. + +2004-07-27 Zack Weinberg + + * libgcc2.c: Change all conditionals testing + LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 96 to == 80. + * libgcc2.h: Likewise. + * config/i386/i386.c (ix86_init_mmx_sse_builtins): Set + TYPE_PRECISION of float80_type to 80. + * config/ia64/ia64.c (ia64_init_builtins): Set TYPE_PRECISION + of fpreg_type and float80_type to 80. + * config/i386/i386.h, config/ia64/ia64.h, config/m68k/m68k.h + * config/m68k/netbsd-elf.h: + Change LONG_DOUBLE_TYPE_SIZE and possibly LIBGCC2_LONG_DOUBLE_TYPE_SIZE + to evaluate to 80 whenever they would formerly have evaluated to 96. + * config/i386/sco5.h: Remove unnecessary redefinition of + LONG_DOUBLE_TYPE_SIZE. + * doc/rtl.texi: Clarify uses of XFmode and TFmode. + * config/i386/i386-modes.def: Use FRACTIONAL_FLOAT_MODE for + XFmode, with a bitsize of 80. Update commentary. + * config/ia64/ia64-modes.def: Likewise. + * config/m68k/m68k-modes.def: Likewise. + +2004-07-27 Steven Bosscher + + * cfgexpand.c (tree_expand_cfg): Fix comment. + + * calls.c (expand_call): Ignore rtx_equal_function_value_matters. + * function.c (purge_single_hard_subreg_set, purge_hard_subreg_sets): + Remove. + (prepare_function_start): Don't set rtx_equal_function_value_matters. + * integrate.c (copy_rtx_and_substitute): Don't test for it. + * passes.c (rest_of_compilation): Don't call purge_hard_subreg_sets. + Don't set rtx_equal_function_value_matters. Don't register RTL hooks + here again. Update leading comment. + * rtl.c (rtx_equal_function_value_matters): Remove. + (rtx_equal_p): Don't test for it. + * simplify-rtx.c (simplify_binary_operation, simplify_subreg): + Likewise. + + * rtl.h (enum insn_note): Remove NOTE_INSN_LOOP_END_TOP_COND. + * rtl.c (note_insn_name): Likewise. + * emit-rtl.c (remove_unnecessary_notes): Don't handle it. + * final.c (final_scan_insn): Likewise. + + * except.c (finish_eh_generation): Don't call cfg_cleanup from here. + * passes.c (rest_of_handle_eh): Do it here. + + * stmt.c (struct nesting): Remove struct nesting block member. + (struct stmt_status): Remove x_block_start_count field. + (current_block_start_count): Remove. + +2004-07-27 Brian Booth + + * tree-optimize.c (register_one_dump_file): Update condition that uses + static_pass_number. + (dup_pass_1): Replace with... + (next_pass_1): This. + (NEXT_PASS): Call next_pass_1. + (DUP_PASS): Remove. + (init_tree_optimization_passes): Remove uses of DUP_PASS. + (execute_one_pass): Update condition that uses + static_pass_number. + * tree-pass.h (tree_opt_pass): Declare static_pass_number as a signed + integer. + +2004-07-27 Nick Clifton + + * config/m32r/m32r.c: Include integrate.h in order to get the + prototype for get_hard_reg_initial_val(). + + * config/m32r/m32r.md (m32rpipeline): Remove unused value "m32r" + and tidy up indentation. + (final_presence_set): Use absence_set instead, so that if there is + nothing in the "o" pipe the "s" pipe can be scheduled. + +2004-07-27 Diego Novillo + + * tree-ssa-alias.c (create_name_tags): Ignore pointers that + don't have PT_VARS nor PT_MALLOC set. + Clear name tag from pointers that have not been dereferenced. + (set_pt_anything, set_pt_malloc): Forward declare. + * tree-ssa-copy.c (may_propagate_copy): Compare alias sets, + not type compatibility when determining if a pointer can be + copy propagated. + +2004-07-27 Richard Sandiford + + * expr.h (canonicalize_condition, get_condition): Add an int argument. + * gcse.c (fis_get_condition): Reimplement using get_condition, leaving + it to check whether the condition is still valid at the jump insn. + * ifcvt.c (noce_get_condition): Likewise. + (noce_get_alt_condition): Update call to canonicalize_condition. + * loop-iv.c (simplify_using_initial_values): Update call to + get_condition. Remove FIXME. + (check_simple_exit): Update call to get_condition. + * loop-unswitch.c (may_unswitch_on): Likewise. + * loop.c (check_dbra_loop): Likewise. + (canonicalize_condition, get_condition): Add an argument to say whether + the condition must still be valid at INSN. + (get_condition_for_loop): Update call to get_condition. Require that + the condition be valid at INSN. + * predict.c (estimate_probability): Update call to get_condition. + Remove unused earliest parameter. + (expected_value_to_br_prob): Update call to canonicalize_condition. + +2004-07-26 Eric Christopher + + * tree-dfa.c (add_referenced_var): Register initializers of global + variables. + +2004-07-26 Paolo Bonzini + + * config/i386/i386.c (function_arg): Always treat 8- + and 16-byte wide vectors the same, even if MMX/SSE + are disabled. + (contains_128bit_aligned_vector_p): Add comment. + +2004-07-26 J"orn Rennecke + + * ra.h (enum node_type): Rename to: + (enum ra_node_type). + * ra-colorize.c: Likewise. + +2004-07-26 Richard Sandiford + + * cfgcleanup.c (try_simplify_condjump): Call update_forwarder_flag + after simplifying the jump. + +2004-06-26 Richard Henderson + + * calls.c (combine_pending_stack_adjustment_and_call): Make + preferred_unit_stack_boundary argument unsigned. Make + unadjusted_alignment unsigned. + (expand_call): Make preferred_stack_boundary and + preferred_unit_stack_boundary variables unsigned. + * function.c (assign_stack_local_1): Make alignment unsigned. + * function.h (struct function): Make stack_alignment_needed, + preferred_stack_boundary unsigned. + * config/i386/i386.c (ix86_preferred_stack_boundary): Make unsigned. + (ix86_compute_frame_layout): Make stack_alignment_needed, + preferred_alignment variables unsigned. + * config/i386/i386.h (ix86_preferred_stack_boundary): Make unsigned. + +2004-07-26 Tom Tromey + + * tree.h: Fix typo in comment. + +2004-07-26 Daniel Jacobowitz + + PR bootstrap/12804 + * ggc-zone.c (struct alloc_chunk): Remove attribute packed. + (MAX_FREE_BIN_SIZE): Increase on 64-bit targets. + (ggc_free): Remove incorrect freeing. + (sweep_pages): Advance PP for large pages. Fix indentation. + +2004-07-26 Richard Sandiford + + PR rtl-optimization/16643 + * cfglayout.h (cfg_layout_initialize): Add a flags parameter. + * cfglayout.c (cfg_layout_initialize): Pass it to cleanup_cfg. + * basic-block.h (reorder_basic_blocks): Add a flags parameter. + * cfglayout.c (reorder_basic_blocks): Pass it to cfg_layout_initialize. + (partition_hot_cold_basic_blocks): Pass 0 to cfg_layout_initialize. + * function.c (thread_prologue_and_epilogue_insns): Likewise. + * rtl.h (tracer): Add a flags parameter. + * tracer.c (tracer): Pass it to cfg_layout_initialise. + * passes.c (rest_of_handle_stack_regs): Pass 0 to reorder_basic_blocks. + (rest_of_handle_reorder_blocks): Update calls to tracer and + reorder_basic_blocks, passing CLEANUP_UPDATE_LIFE if appropriate. + (rest_of_handle_tracer): Pass 0 to tracer. + (rest_of_handle_loop2): Pass 0 to cfg_layout_initialize. + +2004-07-25 David Edelsohn + + PR target/16239 + * config/rs6000/rs6000.md (movdi_internal64): Further disparage + f->f. + +2004-07-24 Nathan Sidwell + + * tree.h (BINFO_BASE_ACCESSES): Accesses are a VEC(tree). + (BINFO_BASE_ACCESS): Adjust. + (BINFO_BASE_ACCESS_APPEND): New. + (struct tree_binfo): Make base_accesses a VEC(tree) pointer. + * dbxout.c (dbxout_type): Adjust binfo access accessing. + * dwarf2out.c (gen_member_die): Likewise. + * tree-dump.c (deque_and_dump): Likewise. + +2004-07-26 Falk Hueffner + + * config/alpha/alpha.c (alpha_rtx_cost_data): Tweak int_div + costs. + +2004-07-25 Roger Sayle + + * config/i386/i386.c (output_fp_compare): Use ffreep to pop top + value off of the stack if TARGET_USE_FFREEP. + +2004-07-26 Bernardo Innocenti + + * gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC (). + * gengtype-yacc.y: Likewise. Replace free() with XDELETE (). + * c-typeck.c (PUSH_SPELLING): Remove redundant NULL-pointer + check on invocation of XRESIZEVEC (). + +2004-07-26 Bernardo Innocenti + + * c-common.c (disable_builtin_function): Rename variable n to + new_disabled_builtin. + * c-decl.c (duplicate_decls): Rename parameter decl to new_decl. + Rename local variable old to old_decl. + * gensupport.c (shift_output_template): Rename parameter old to src. + * simplify-rtx.c (simplify_replace_rtx): Rename parameter oldx to + old_rtx and newx to new_rtx. + +2004-07-26 Bernardo Innocenti + + * Makefile.in (C_PRAGMA_H): New variable to track dependencies + of c-pragma.h. + * c-pragma.h (c_lex, c_lex_with_flags): Change returntype to + enum cpp_ttype. + * c-lex.c: Likewise. + +2004-07-25 Roger Sayle + + * fold-const.c (constant_boolean_node): Make extern. + (make_range): Wrap long lines. + (fold_cond_expr_with_comparison): Remove unnecessary call to + pedantic_non_lvalue. Add missing calls to fold_convert. + (fold_truthop): Add missing calls to fold_convert. + (fold): Likewise. + * tree.h (constant_boolean_node): Add prototype here. + * builtins.c (expand_builtin_strncmp): Add missing calls to + fold_convert. + * tree-ssa-dom.c (record_equivalences_from_incoming_edge): + Call fold_convert and constant_boolean_node to correct types. + * tree-ssa-forwprop.c (substitute_single_use_vars): Add + missing call to fold_convert to correct types. + +2004-07-26 Niall Douglas + Brian Ryner + + PR c++/9283 + PR c++/15000 + * c-common.c (c_common_attribute_table): Allow + handle_visibility_attribute to be called for types. + (handle_visibility_attribute) When given a type, set the visibility + bits on the TYPE_NAME. When given a decl, don't set no_add_attrs + so that we can check later whether the attribute was present. Added + warning if attribute applied to non class type. + * c-decl.c (diagnose_mismatched_decls): Updated rules for merging + decls and checking that they are consistent. + * common.opt: Added -fvisibility. + * c.opt, c-opts.c: Added -fvisibility-inlines-hidden. + * c-pragma.h, c-pragma.c: Added handle_pragma_visibility(). + * flags.h, tree.h: Added assorted support defines for overall patch + * opts.c: Added parsing support for -fvisibility. + * tree.c (build_decl): Set visibility for all decls to be whatever + is in force at that time. + * varasm.c (default_binds_local_p_1): Reworked logic determining + when to make a symbol locally bound. + * doc/invoke.texi: Added documentation for -fvisibility and + -fvisibility-inlines-hidden. + +2004-07-25 Bernardo Innocenti + + * basic-block.h (reorder_block_def): Rename to reorder_block_def_p. + * c-common.c: Add missing casts from void * to other types. + * c-decl.c: Likewise. + * c-format.c: Likewise. + * c-lex.c: Likewise. + * c-pragma.c: Likewise. + * c-typeck.c: Likewise. + * defaults.h: Likewise. + * genconstants.c: Likewise. + * gengtype-lex.l: Likewise. + * genmodes.c: Likewise. + * read-rtl.c: Likewise. + * rtl.c: Likewise. + +2004-07-25 Bernardo Innocenti + + * bitmap.c: Use type-safe memory allocation macros from libiberty. + * c-common.c: Likewise. + * c-decl.c: Likewise. + * c-lang.c: Likewise. + * c-lex.c: Likewise. + * c-opts.c: Likewise. + * c-parse.in: Likewise. + * c-typeck.c: Likewise. + * genconditions.c: Likewise. + * gengtype-lex.l: Likewise. + * gengtype-yacc.y: Likewise. + * gengtype.c: Likewise. + * genmodes.c: Likewise. + * gensupport.c: Likewise. + * read-rtl.c: Likewise. + * read-rtl.c (read_constants): Use INSERT instead of TRUE in call to + htab_find_slot(). + +2004-07-25 Bernardo Innocenti + + * c-decl.c (groktypename, groktypename_in_param_context): Rename + variable typename to type_name. + * c-lex.c (interpret_float): Likewise. + +2004-07-25 Roger Sayle + + * convert.c (convert_to_real, convert_to_integer, + convert_to_complex): Replace calls to build with calls to buildN. + * coverage.c (tree_coverage_counter_ref): Likewise. + * dojump.c (do_jump): Likewise. + * dwarf2out.c (loc_descriptor_from_tree): Likewise. + * emit-rtl.c (component_ref_for_mem_expr, + set_mem_attributes_minus_bitpos): Likewise. + * explow.c (update_nonlocal_goto_save_area): Likewise. + * expmed.c (expand_shift, make_tree, const_mult_add_overflow_p, + expand_mult_add): Likewise. + * expr.c (emit_block_move_via_libcall, clear_storage_via_libcall, + store_constructor, get_inner_reference, expand_expr_real_1, + try_casesi, try_tablejump): Likewise. + * function.c (expand_function_start): Likewise. + * stmt.c (emit_case_bit_tests, expand_end_case_type, + node_has_low_bound, node_has_high_bound, emit_case_nodes): Likewise. + * stor-layout.c (place_union_field, layout_type): Likewise. + * tree.c (substitute_in_expr, tree_fold_gcd): Likewise. + * varasm.c (copy_constant): Likewise. + +2004-07-25 Bernardo Innocenti + + * c-common.c: Rename all identifiers named `new'. + * c-decl.c: Likewise. + * gensupport.c: Likewise. + * simplify-rtx.c: Likewise. + * c-common.c (disable_builtin_function): Replace a call to xmalloc() + with XNEW(). + * gensupport.c (alter_output_for_insn): Replace two calls to xmalloc() + with XNEWVEC(). + +2004-07-25 Joseph S. Myers + + PR c/15360 + * c-decl.c (start_decl): Do not set DECL_EXTERNAL for initialized + declarations until after calling pushdecl. + (grokdeclarator): Set DECL_EXTERNAL for variables based on use of + "extern" and not on whether the declaration is initialized. + +2004-07-25 Daniel Jacobowitz + + * config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*) + (sparc-*-solaris2*): Include sol2.o and sol2-protos.h. + * config/sol2-c.c: Include "tm.h", "tm_p.h", "toplev.h", + "cpplib.h", "c-pragma.h", "c-common.h". + (solaris_pragma_align, solaris_pragma_init, solaris_pragma_fini) + (solaris_register_pragmas): New functions. + * config/sol2-protos.h: New file. + * config/sol2.c: New file. + * config/sol2.h (SOLARIS_ATTRIBUTE_TABLE, ASM_DECLARE_FUNCTION_SIZE) + (REGISTER_TARGET_PRAGMAS): New macros. + (solaris_pending_aligns, solaris_pending_inits) + (solaris_pending_finis): New variables. + * config/t-sol2 (sol2-c.o): Update dependencies. + (sol2.o): New rule. + * config/i386/i386.c (TARGET_INSERT_ATTRIBUTES): Define in terms of + SUBTARGET_INSERT_ATTRIBUTES. + (ix86_attribute_table): Include SUBTARGET_ATTRIBUTE_TABLE. + * config/i386/sol2.h (SUBTARGET_INSERT_ATTRIBUTES) + (SUBTARGET_ATTRIBUTE_TABLE, ASM_OUTPUT_CALL): Define. + * config/sparc/elf.h (ASM_DECLARE_FUNCTION_SIZE): Redefine. + * config/sparc/sp64-elf.h (ASM_DECLARE_FUNCTION_SIZE): Redefine. + * config/sparc/sol2.h (SUBTARGET_INSERT_ATTRIBUTES) + (SUBTARGET_ATTRIBUTE_TABLE, ASM_OUTPUT_CALL): Define. + * config/sparc/sparc.c (sparc_attribute_table): New. + (TARGET_INSERT_ATTRIBUTES): Define in terms of + SUBTARGET_INSERT_ATTRIBUTES. + (TARGET_ATTRIBUTE_TABLE): Define if SUBTARGET_ATTRIBUTE_TABLE + is defined. + * doc/extend.texi (Solaris Pragmas): New section. + +2004-07-25 Bernardo Innocenti + + * c-common.c: Rename all identifiers named `class' to `cl'. + * c-common.h: Likewise. + * c-parse.in: Likewise. + * c-typeck.c: Likewise. + * genmodes.c: Likewise. + * real.c: Likewise. + * real.h: Likewise. + * recog.c: Likewise. + * recog.h: Likewise. + * regrename.c: Likewise. + * tree.h: Likewise. + * c-common.c (builtin_function_2): Change type of 5th parameter from + int to enum built_in_function. Change type of 8th parameter from int + to bool. + * c-decl (builtin_function): Replace call to ggc_alloc_cleared () + with GGC_CNEW(). + * c-typeck.c (convert_arguments): Change type of formal_prec from + int to unsigned int. + * genmodes.c (blank_mode): Make a few negative constants unsigned. + (complete_all_modes, calc_wider_mode, emit_insn_modes_h, + emit_mode_name, emit_mode_class, emit_mode_precision, emit_mode_size, + emit_mode_nunits, emit_mode_wider, emit_mode_mask, emit_mode_inner, + emit_mode_base_align, emit_class_narrowest_mode): Pass an integer + iterator to for_all_modes () instead of an enum because enums can't + be incremented in C++. + + +2004-07-25 Daniel Jacobowitz + + * regmove.c (optimize_reg_copy_1): Don't try to replace call-used + hard registers. + +2004-07-25 Richard Kenner + + * tree-ssa-operands.c (get_stmt_operands, get_expr_operands): + Handle ARRAY_RANGE_REF like ARRAY_REF. + +2004-07-25 Joseph S. Myers + + * c-typeck.c (digest_init): Don't allow arrays of signed or + unsigned variants of wchar_t to be initialized by wide string + constants. Do allow arrays of enumerated types compatible with + wchar_t to be initialized by wide string constants. Refine tests + distinguishing wide and narrow strings and arrays. Give specific + error for arrays of other integer types initialized by string + constants. + (output_init_element, process_init_element): Check for + INTEGRAL_TYPE_P rather than just for INTEGER_TYPE when + initializing with string constants. + +2004-07-25 Richard Henderson + + * c-decl.c (start_function): Set DECL_ARTIFICIAL and DECL_IGNORED_P + on the RESULT_DECL. + * cgraphunit.c (cgraph_build_static_cdtor): Likewise. + * integrate.c (copy_decl_for_inlining): Copy DECL_ARTIFICIAL and + DECL_IGNORED_P to new decl. + +2004-07-24 Zack Weinberg + + * config/ia64/ia64.c (general_xfmode_operand) + (destination_xfmode_operand): Delete. + * config/ia64/ia64.h (PREDICATE_CODES): Remove them. + * config/ia64/ia64.md (*movxf_internal): Use general_operand + and destination_operand. + +2004-07-24 Alexander Kabaev + + * config/ia64/ia64.h (SUBTARGET_EXTRA_SPECS): Default to nothing. + (EXTRA_SPECS): Use SUBTARGET_EXTRA_SPECS. + +2004-07-24 Alexander Kabaev + Zack Weinberg + + * tree.h (staticp): Change return type to bool. + +2004-07-25 Bernardo Innocenti + + * c-common.c (c_staticp): Last episode of the staticp saga. + +2004-07-25 Bernardo Innocenti + + * c-common.h (c_staticp): Change return type from int to bool. + * tree.c (staticp): Likewise. + * langhooks.h (staticp): Likewise. + +2004-07-25 Bernardo Innocenti + + * langhooks-def.h (lhd_staticp): Change return type from int to + bool in prototype to match definition. + +2004-07-25 Bernardo Innocenti + + * system.h (bool, true, false): Don't redefine as preprocessor macros + in C++. + +2004-07-24 Roger Sayle + + * expmed.c (init_expmed): A signed modulus by a power of two is + considered cheap if its less than or equal to four instructions. + +2004-07-25 Bernardo Innocenti + + * ggc.h (GGC_NEW, GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, + GGC_CNEWVAR): New macros. + +2004-07-25 Bernardo Innocenti + + * c-common.c: Convert ATTRIBUTE_UNUSED to ARG_UNUSED in parameter + lists. + * c-decl.c: Likewise. + * c-format.c: Likewise. + * c-lex.c: Likewise. + * c-opts.c: Likewise. + * c-pragma.c: Likewise. + * c-typeck.c: Likewise. + * gencheck.c: Likewise. + * genconditions.c: Likewise. + * genconfig.c: Likewise. + * genflags.c: Likewise. + * gengtype.c: Likewise. + * gensupport.c: Likewise. + * ggc-none.c: Likewise. + * langhooks.c: Likewise. + * statistics.h: Likewise. + * stub-objc.c: Likewise. + * java/decl.c: Likewise. + +2004-07-24 Roman Zippel + + * config/m68k/m68k.c (output_scc_di): Fix coding style. + (symbolic_operand): Fix prototype. + * config/m68k/m68k.h (PREDICATE_CODES): Add symbolic_operand. + * config/m68k/m68k.md: Add constants for registers a0 and sp and + use them, change from the "{...}" syntax to the simpler {...} + syntax. + (*cfv4_extendqisi2): Fix destination predicate. + * config/m68k/m68k-protos.h: Remove various declarations also + generated via PREDICATE_CODES. + +2004-07-23 Mike Stump + + * c-typeck.c (convert_for_assignment): Tightened up pointer + converstions that differ in signedness. + +2004-07-23 Zack Weinberg + + * genmodes.c (make_vector_modes): Mark with ATTRIBUTE_UNUSED. + +2004-07-23 Richard Kenner + + * tree.def (VIEW_CONVERT_EXPR): Change to class 'r'. + * tree-ssa-operands.c (get_expr_operands, case VIEW_CONVERT_EXPR): New. + + * gimplify.c (gimplify_compound_lval): Check for no handled + operations, rather than checking for explicit list of nodes. + (is_gimple_addr_expr_arg_or_indirect): New function. + (gimplify_addr_expr): Call it and handle INDIRECT_REF; remove + redundant setting of TREE_INVARIANT. + (gimplify_expr, case VIEW_CONVERT_EXPR): Call gimplify_compound_lval. + * tree-gimple.c (is_gimple_addr_expr_arg): Call handled_component_p. + +2004-07-23 Diego Novillo + + PR tree-optimization/16688 + PR tree-optimization/16689 + * tree-ssa-alias.c (setup_pointers_and_addressables): Remove + unnecessary initialization of 'tag'. + (get_tmt_for): Check that the new type tag has the same alias + set as the pointed-to type. + (group_aliases): Only regular variables need to be removed + from the alias set of a name tag. + * tree-ssa-copy.c (may_propagate_copy): Do not allow copy + propagation if the two types are not compatible. + (merge_alias_info): Rename from replace_ssa_names_ann. + Add more checking. + (replace_exp_1): If both arguments are SSA_NAMEs, check that + the propagation can be done. + Only call merge_alias_info on pointers. + (propagate_value): Likewise. + * tree-ssa-copyrename.c: Include langhooks.h. + (copy_rename_partition_coalesce): Call replace_ssa_name_symbol + to do the merging. + Do not coalesce variables with incompatible types. + (rename_ssa_copies): Call replace_ssa_name_symbol. + * tree-ssa.c (verify_ssa_name): Verify that the SSA_NAME has + the same type as the underlying _DECL. + * tree-ssanames.c (replace_ssa_name_symbol): New function. + * tree.h (replace_ssa_name_symbol): Declare. + +2004-07-23 Richard Henderson + + PR c++/16277 + * gimplify.c (gimplify_cond_expr): Gimplify TARGET to a min_lval; + unshare it properly. + (gimplify_modify_expr_rhs): Push assignment from a conditional into + the conditional for all non-register types. + +2004-07-23 Richard Henderson + + * expr.c (expand_expr_real_1): Don't handle non-local variables. + * expr.h (fix_lexical_addr): Remove. + * function.c (NEED_SEPARATE_AP): Remove. + (fix_lexical_addr): Remove. + * tree-alias-common.c (get_alias_var_decl): Check TREE_STATIC, + not null decl_function_context. + (create_alias_vars): Likewise. + * tree-cfg.c (make_ctrl_stmt_edges): Don't check for non-local labels. + (simple_goto_p): Likewise. + * tree-dfa.c (add_referenced_var): Don't check for non-local variables. + * tree-ssa-ccp.c (get_default_value): Likewise. + * tree-tailcall.c (suitable_for_tail_opt_p): Likewise. + * tree.c (needs_to_live_in_memory): Likewise. + * tree-flow-inline.h (may_be_aliased): Move... + * tree-ssa-alias.c (may_be_aliased): ... here. Enhance check for + when TREE_STATIC variables may be addressable. + +2004-07-24 Jakub Jelinek + + * Makefile.in (site.exp): Add HOSTCC and HOSTCFLAGS to site.exp. + +2004-07-23 Zack Weinberg + + * print-rtl.c (print_rtx ): Don't attempt to print + bitmap contents if GENERATOR_FILE is defined. + * Makefile.in (BUILD_RTL): Remove $(BUILD_PREFIX)bitmap.o. + ($(BUILD_PREFIX_1)bitmap.o): Delete rule. + +2004-07-23 Joseph S. Myers + + * c-decl.c (start_function): Form composite type of function types + rather than copying type from previous prototype declaration. + +2004-07-23 Janis Johnson + + * config/rs6000/altivec.h (vec_lvewx, vec_lvehx, vec_lvwbx): Remove + the const qualifier for the second argument in the C++ functions. + + * config/rs6000/altivec.h (vec_stvewx, vec_stvehx, vec_stvebx): Use + specific pointer types. + + * config/rs6000/altivec.h (vec_vadduwm): (vec_vadduwm, vec_vadduhm, + vec_vaddubm, vec_vsubuwm, vec_vsubuhm, vec_vsububm): Fix types used + for vector bool and/or vector pixel, add C++ and C missing support. + (vec_vaddsws, vec_vaddshs, vec_vaddsbs, vec_vmaxsw, vec_vmaxsh, + vec_vmaxsb, vec_vmrghw, vec_vmrghh, vec_vmrghb, vec_vmrglw, vec_vmrglh, + vec_vmrglb, vec_vminsw, vec_vminsh, vec_vminsb, vec_vpkuwum, + vec_vpkuhum, vec_vspltw, vec_vsplth, vec_vspltb, vec_vsubsws, + vec_vsubshs, vec_vsubsbs, vec_vupklsh, vec_vupkhsh, vec_vupklsb): Add + missing C++ and C support for vector bool and/or vector pixel. + (vec_vadduws, vec_vadduhs, vec_vaddubs, vec_vcmpeqfp, vec_vcmpequw, + vec_vcmpequh, vec_vcmpequb, vec_vcmpgtfp, vec_vcmpgtsw, vec_vcmpgtuw, + vec_vcmpgtsh, vec_vcmpgtuh, vec_vcmpgtsb, vec_vcmpgtub, vec_vmaxuw, + vec_vmaxuh, vec_vmaxub, vec_vminuw, vec_vminuh, vec_vminub, + vec_vsubuws, vec_vsubuhs, vec_vsububs, vec_vupkhpx, vec_vupklpx): Fix + C++ and C types used for vector bool and/or vector pixel. + (vec_st, vec_stl): Add C++ support for vector pixel. + (vec_unpackh, vec_unpackl, vec_any_ge): Fix C++ support for vector bool. + (vec_all_ne): Add C++ support for vector pixel. + + * config/rs6000/altivec.h (vec_vcmpgtsh): Fix C++ function name. + (vec_vmulesb): Add missing C++ function. + (vec_perm): Fix type of third argument in C++ function. + (vec_vsum4shs): Fix C++ function name. + (vec_any_ge): Remove C++ functions for unsupported arg combinations. + (vec_vcmpgtsw, vec_vcmpgtuw, vec_minsb, vec_vmsummbm): Fix the + argument passed to the error handler in C macro. + (vec_nmsub): Remove extra parens around argument names in C macro. + (vec_packpx): Add missing parens in C macro. + +2004-07-22 Paolo Bonzini + + * machmode.def: Remove vector modes. + * config/alpha/alpha-modes.def: Add supported vector modes. + * config/arm/arm-modes.def: Likewise. + * config/frv/frv-modes.def: Likewise. + * config/i386/i386-modes.def: Likewise. + * config/rs6000/rs6000-modes.def: Likewise. + * config/sh/sh-modes.def: Likewise. + +2004-07-23 Matthias Klose + + * intl.c (gcc_init_libintl): Use PACKAGE for the text domain. + * configure.ac: Add AC_DEFINE_UNQUOTED for PACKAGE. + * config.h: Regenerate. + * configure: Likewise. + +2004-07-22 Mark Mitchell + + * dwarf2out.c (output_call_frame_info): Set SYMBOL_FLAG_LOCAL on + generated SYMBOL_REFs for labels. + * config/darwin-protos.h (machopic_validate_stub_or_non_lazy_ptr): + Change prototype. + (machopic_stub_name): Remove. + (machopic_indirection_name): New function. + (machopic_mcount_stub_name): Likewise. + (machopic_classify_name): Remove. + (machopic_function_base_sym): New function. + (machpoic_classify_symbol): Likewise. + (machopic_classify_ident): Remove. + (machopic_define_ident): Likewise. + (machopic_define_name): Likewise. + (machopic_name_defined_p): Likewise. + (machopic_ident_defined_p): Likewise. + (darwin_strip_name_encoding): Likewise. + (machopic_define_symbol): New function. + * config/darwin.c (hashtab.h): Include. + (machopic_defined_list): Remove. + (machopic_classify_ident): Likewise. + (machopic_classify_name): Likewise. + (machopic_ident_defined_p): Likewise. + (machopic_define_ident): Likewise. + (machopic_define_name): Likewise. + (machopic_symbol_defined_p): New function. + (machopic_classify_symbol): Likewise. + (machopic_data_defined_p): Use machopic_classify_symbol. + (machopic_define_symbol): New function. + (machopic_function_base_sym): New function. + (machopic_non_lazy_pointers): Remove. + (machopic_non_lazy_ptr_name): Likewise. + (machopic_stubs): Likewise. + (machopic_stub_name): Likewise. + (NON_LAZY_POINTER_SUFFIX): New macro. + (STUB_SUFFIX): Likewise. + (machopic_indirection): New structure. + (machopic_indirections): New variable. + (machopic_indirection_hash): New function. + (machopic_indirection_eq): Likewise. + (machopic_indirection_name): Likewise. + (machopic_mcount_stub_name): New function. + (machopic_validate_stub_or_non_lazy_pointer): Reimplement to use + hash table. + (machopic_indirect_data_reference): Rework to use new functions. + (machopic_indirect_call_target): Likewise. + (machopic_legitimize_pic_address): Likewise. + (machopic_output_indirection): New function. + (machopic_finish): Use it. + (machopic_operand_p): Rework to use new functions. + (darwin_encode_seciton_info): Use SYMBOL_REF_FLAGS. + (darwin_strip_name_encoding): Remove. + (update_non_lazy_ptrs): Remove. + (update_stubs): Likewise. + (darwin_non_lazy_pcrel): Use new functions. + * config/darwin.h (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_OUTPUT_LABELREF): Likewise. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. + (MACHO_SYMBOL_FLAG_VARIABLE): New macro. + (MACHO_SYMBOL_FLAG_DEFINED): Likewise. + (TARGET_STRIP_NAME_ENCODING): Do not use + darwin_strip_name_encoding. + (GEN_LAZY_PTR_NAME_FOR_SYMBOL): Do not use + darwin_strip_name_encoding. + * config/i386/darwin.h (FUNCTION_PROFILER): Use + machopic_mcount_stub_name. + * config/i386/i386.c (x86_output_mi_thunk): Use + machopic_indirection_name, not machopic_stub_name. + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Use + machopic_function_base_sym. + (print_operand): Use machopic_classify_symbol. + (rs6000_emit_prologue): Use machopic_function_base_sym. + (output_profile_hook): Do not use machopic_stub_name. + (macho_branch_isalnds): Do not use darwin_strip_name_encoding. + +2004-07-22 Joseph S. Myers + + PR c/7284 + * fold-const.c (extract_muldiv_1): Do not treat signed left shift + as multiplication. + +2004-07-22 Joseph S. Myers + + * doc/implement-c.texi: New file. + * doc/extend.texi (C Implementation): Move to there. + * doc/gcc.texi: Include implement-c.texi. + * Makefile.in (TEXI_GCC_FILES): Add implement-c.texi. + +2004-07-22 Jason Merrill + + * integrate.c (copy_decl_for_inlining): Remove invisible reference + handling. + * tree-inline.c (setup_one_parameter): Likewise. + +2004-07-22 Brian Booth + + * tree-ssa-ccp.c (latticevalue): Add UNKNOWN_VAL. + (substitute_and_fold): Propigate into VUSE operands when possible. + (visit_phi_node): Handle UNKNOWN_VAL latticevalue. + (cp_lattice_meet): Handle merging of latticevalues when + UNKNOWN_VAL is present. + (visit_stmt): Visit assignments with V_MUST_DEFs. + (visit_assignment): Gather ccp information for V_MUST_DEF operands. + (ccp_fold): Deal with RHS' that are constant and virtual. + (evaluate_stmt): Handle UNKNOWN_VAL likely values. + (dump_lattice_value): Dump UNKNOWN_VAL latticevalues. + (initialize): Mark statements with V_MUST_DEFs as VARYING only if the + V_MUST_DEF operand is VARYING. Fix comment and include VOPS when + computing immediate uses. + (set_lattice_value): Disallow a UNKNOWN_VAL->UNDEFINED state + transition. + (replace_vuse_in): New function. + (likely_value): Add check of vuse operands. + (get_default_value): Set the default value of virtually defined + variables to UKNOWN_VAL instead of VARYING. + +2004-07-22 Richard Henderson + + * expr.c (emit_push_insn): Don't use set_mem_attributes. + +2004-07-22 Richard Henderson + + * tree-ssa-live.c (create_ssa_var_map): Avoid defined-but-not-used + variables due to conditional compilation. + +2004-07-22 Diego Novillo + + * tree-into-ssa.c (set_livein_block): Fix typo in comment. + (rewrite_ssa_into_ssa): Start iterating over SSA names at 1. + Release SSA names that have been re-renamed. + * tree-phinodes.c (make_phi_node): Set same TREE_TYPE as the + variable. + * tree-ssa-alias.c (init_alias_info): If aliases have been + computed before, clear existing alias information. + (create_name_tags): Do no fixup PT_ANYTHING pointers. + If the new name tag for a pointer is different than the one it + had before, mark the old tag for renaming. + (replace_may_alias): New function. + (group_aliases): Call it. + (setup_pointers_and_addressables): Always call get_tmt_for. + (maybe_create_global_var): Don't create .GLOBAL_VAR more than + once. + (set_pt_anything): New local function. + (set_pt_malloc): New local function. + (merge_pointed_to_info): Don't merge pointed-to variables from + the original pointer if the destination is pointing to an + unknown location. + (add_pointed_to_expr): Call set_pt_anything and set_pt_malloc. + (add_pointed_to_var): Do not add a variable to the points-to + set if the pointer is already pointing to anywhere. + (collect_points_to_info_r): If the defining statement is a PHI + node, only merge pointed-to information if the argument has + already been visited. + (get_tmt_for): Only create a new tag if the pointer didn't + have one already. + (dump_alias_info): Emit more information. + (dump_points_to_info_for): Likewise. + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't + try to get the annotation of an SSA_NAME. + * tree-ssa-operands.c (add_stmt_operand): Only check for empty + alias sets when checking is enabled. + * tree-ssa-pre.c (need_eh_cleanup): New local variable. + (eliminate): Mark basic blocks that will need + EH information cleaned up. + (init_pre): Split ENTRY_BLOCK->0 if block 0 has more than one + predecessor. + Initialize need_eh_cleanup. + (fini_pre): Call tree_purge_all_dead_eh_edges and + cleanup_tree_cfg if needed. + Free need_eh_cleanup. + * tree-ssa.c (verify_ssa_name): New function. + (verify_def): Call it. + Re-arrange to avoid printing too many error messages. + (verify_use): Likewise. + (verify_phi_args): Likewise. + (verify_flow_insensitive_alias_info): New function. + (verify_flow_sensitive_alias_info): New function. + (verify_alias_info): New function. + (verify_ssa): Call verify_alias_info. + Clear TREE_VISITED on all the SSA_NAMEs before scanning the + program. + Re-arrange to avoid printing too many error messages. + * tree-ssanames.c (make_ssa_name): Clear + SSA_NAME_IN_FREE_LIST. + (release_ssa_name): Never release a default definition. + (release_defs): New function. + * tree.h: Declare it. + * tree-ssa-dce.c (remove_dead_stmt): Call it. + +2004-07-22 Diego Novillo + + * tree-ssa.c (walk_use_def_chains_1): Add new argument IS_DFS. + If true, do a depth-first search. Do a breadht-first search, + otherwise. + (walk_use_def_chains): Add new argument IS_DFS. + Update all users. + * tree-flow.h (walk_use_def_chains): Update prototype. + +2004-07-22 Hans-Peter Nilsson + + * config/cris/cris.md: Tweak formatting. + (asrandb, asrandw, lsrandb, lsrandw, moversideqi, movemsideqi) + (mover2side, moverside, movemside, movei, op3, andu): Replace + live define_peephole:s with define_peephole2 near-equivalents. + Delete the rest. + ("*mov_sidesisf_biap"): Rename from "*mov_sidesi_biap". Match all + word-size modes. + ("*mov_sidesisf", "*mov_sidesisf_biap_mem", "*mov_sidesisf_mem"): + Similar for "*mov_sidesi", "*mov_sidesi_biap_mem" and + "*mov_sidesi_mem" respectively. + +2004-07-22 Paolo Bonzini + + * tree-cfg.c (gimplify_val): Move from tree-complex.c. + (gimplify_build1): Move from tree-complex.c do_unop. + (gimplify_build2): Move from tree-complex.c do_binop. + (gimplify_build3): New. + * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. + Adjust throughout to call the functions above. + * tree-flow.h: Declare the functions above. + * tree-nested.c (gimplify_val): Rename to... + (tsi_gimplify_val): ... this. + + * Makefile.in (tree_complex.o): Update dependencies. + (stor-layout.o): Depend on regs.h. + * c-common.c (handle_vector_size_attribute): Update for + vector types without corresponding vector modes. + * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if + a corresponding vector mode is not available. + * print-tree.c (print_node): Print nunits for vector types + * regclass.c (have_regs_of_mode): New. + (init_reg_sets_1): Initialize it and use it instead + of allocatable_regs_of_mode. + * regs.h (have_regs_of_mode): Declare it. + * stor-layout.c (layout_type): Pick a mode for vector types. + * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, + build_replicated_const, do_unop, do_binop, do_plus_minus, + do_negate, expand_vector_piecewise, expand_vector_parallel, + expand_vector_addition, expand_vector_operations_1, + expand_vector_operations, tree_lower_operations, + pass_lower_vector_ssa, pass_pre_expand): New. + (expand_complex_operations, pass_lower_complex): Remove. + * tree-optimize.c (init_tree_optimization_passes): Adjust + pass ordering for changes in tree-complex.c. + * tree-pass.h: Declare new passes. + * tree.c (finish_vector_type): Remove. + (make_vector_type): New. + (build_vector_type_for_mode, build_vector_type): Rewritten. + * tree.def (VECTOR_TYPE): Document where the number of + subparts is stored. + * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. + (make_vector): Remove declaration. + +2004-07-21 Richard Henderson + + * gimple-low.c (expand_var_p): Don't look at TREE_ADDRESSABLE, + TREE_THIS_VOLATILE, may_aliases, or optimization level. + (remove_useless_vars): Dump debugging info. + (expand_used_vars): Move ... + * cfgexpand.c (expand_used_vars): ... here. Make static. + * tree-flow-inline.h (set_is_used): New. + (set_default_def): Use get_var_ann. + * tree-flow.h: Update decls. + * tree-ssa-live.c (mark_all_vars_used_1, mark_all_vars_used): New. + (create_ssa_var_map): Use it. + * tree-ssa.c (set_is_used): Remove. + +2004-07-22 Ben Elliston + + * gdbinit.in: Set a breakpoint on internal_error. + +2004-07-21 Richard Henderson + + * cfgexpand.c (expand_gimple_tailcall): Fix case where we need + to create a new basic block. + +2004-07-22 Joseph S. Myers + + PR c/15052 + * c-decl.c (grokdeclarator): Only pedwarn for qualified void + return type on function definitions. Move other warnings for + qualified return type to -Wreturn-type. Do not condition any such + warnings on -pedantic. Update comments. + (start_function): Only copy function type from previous prototype + declaration if return types are compatible. + * c-typeck.c (function_types_compatible_p): Don't condition + warning for incompatibility of volatile qualifiers on the return + type on -pedantic. Update comment. + * doc/invoke.texi (-Wreturn-type, -Wextra): Update. + +2004-07-22 Joseph S. Myers + + * c-typeck.c (set_init_index): Require designator to be of integer + type. + +2004-07-22 Joseph S. Myers + + PR c/11250 + * c-parse.in (init): Change to exprtype. + (primary): Set original_code for STRING to STRING_CST. + Call maybe_warn_string_init for compound literals. + (initdcl, notype_initdcl): Call maybe_warn_string_init. + (initval): Update. + * c-tree.h (maybe_warn_string_init): New. + (pop_init_level, process_init_element): Use struct c_expr. + (struct c_expr): Update comment. + * c-typeck.c (maybe_warn_string_init): New function. + (digest_init): Call it. Additional parameter strict_string. All + callers changed. + (output_init_element): Likewise. + (struct constructor_stack): Use struct c_expr for + replacement_value. + (really_start_incremental_init, push_init_level): Update. + (pop_init_level): Update. Return struct c_expr. + (process_init_level): Update. Take struct c_expr argument. + +2004-07-21 David S. Miller + + * config/sparc/sparc.c (sparc_rtx_costs): Fix typo in previous + commit. + +2004-07-21 Eric Christopher + + * builtins.c (expand_builtin_setjmp_receiver): Fix comment for code + removal. + * c-decl.c (pop_scope): Ditto. + * calls.c (expand_call): Remove call to current_nesting_level, + update comment accordingly. Remove calls to expand_start_target_temps + and expand_end_target_temps. + * cfgexpand.c (construct_init_block): Remove call to + expand_start_bindings_and_block. + (construct_exit_block): Remove call to expand_end_bindings. + * expr.c (safe_from_p): Remove BIND_EXPR handling. + (expand_expr_real_1): Ditto. Fix formatting. + (expand_vars): Delete. + * stmt.c (POPSTACK): Remove block_stack. + (stmt_status): Remove x_block_stack. + (block_stack): Delete. + (expand_start_bindings_and_block): Ditto. + (expand_start_target_temps): Ditto. + (expand_end_target_temps): Ditto. + (current_nesting_level): Ditto. + (warn_about_unused_variables): Ditto. + (expand_end_bindings): Ditto. + * tree.h: Remove declarations for above. + +2004-07-21 Steven Bosscher + + * rtl.h (insn_note): Remove NOTE_INSN_PREDICTION. + * rtl.c (note_insn_name): Likewise. + * print-rtl.c (print_rtx): Don't print it. + * cfgrtl.h (can_delete_note_p): Don't handle it. + (rtl_delete_block): Likewise. + * passes.c (rest_of_handle_guess_branch_prob): Remove. + (rest_of_compilation): Don't call it. + * predict.c (process_note_predictions, process_note_prediction, + note_prediction_to_br_prob): Remove. + * basic-block.c (note_prediction_to_br_prob): Remove prototype. + * stmt.c (return_prediction): Remove. + (expand_value_return): Don't call it. Don't add prediction + notes for return statements. + +2004-07-21 Josef Zlomek + + * var-tracking.c (vt_find_locations): Set the in_pending bitmap at + once. + +2004-07-21 Paolo Bonzini + + * c-common.c (vector_types_convertible_p): Use vector types' + TYPE_SIZE and TREE_TYPE instead of their mode. + * convert.c (convert_to_integer): Likewise. + (convert_to_vector): Likewise. + * fold-const.c (fold_convert): Likewise. + * varasm.c (output_constant): Likewise. + * expr.c (store_constructor): Split ARRAY_TYPE and VECTOR_TYPE. + Allow a VECTOR_TYPE initializer to be made of several vectors. + For ARRAY_TYPEs and VECTOR_TYPES, simplify a bit the handling + of cleared and need_to_clear, and use fold_convert. + * c-typeck.c (build_binary_op): Do not use RDIV_EXPR for + integer vectors. + +2004-07-20 Richard Henderson + + * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Split, + (expand_gimple_basic_block): out from here. Renamed from expand_block. + +2004-07-20 David S. Miller + + * config/sparc/sparc.c (sparc_rtx_costs case MULT): Emit + enormous cost if not TARGET_HARD_MUL. + +2004-07-20 Andrew Pinski + + PR target/16557 + * config/i386/darwin.h (CC1_SPEC): Move the -g SPECs from ... + (ASM_SPEC): here. + +2004-07-21 Paul brook + + * config/arm/arm.c (thumb_expand_prologue): Remove bogus GEN_INT. + +2004-07-20 Richard Kenner + + * fold-const.c (operand_equal_p): Temporarily support NULL args. + (operand_equal_p, case ARRAY_REF): Compare args 2 and 3. + (operand_equal_p, case COMPONENT_REF): Likewise, for arg 2. + +2004-07-20 Zack Weinberg + + * rtl.h (plus_constant): Delete. + (plus_constant_wide): Rename to plus_constant. + (plus_constant_for_output_wide): Delete vestigial prototype. + (GEN_INT): Remove unnecessary cast. + * tree.h (build_int_2, size_int_type): Delete. + (build_int_2_wide): Rename to build_int_2. + (size_int_wide): Rename to size_int_kind. + (size_int_type_wide): Rename to size_int_type. + (size_int, ssize_int, bitsize_int, sbitsize_int): Use size_int_kind. + Remove unnecessary cast. + * tree.c (build_int_2_wide): Rename build_int_2; update comment. + * explow.c (plus_constant_wide): Rename plus_constant; update comment. + * fold-const.c (size_int_wide): Rename size_int_kind. Use size_int_type. + (size_int_type_wide): Rename size_int_type. + (int_const_binop): Use size_int_type. + * c-lex.c (interpret_integer): Use build_int_2. + * final.c (split_double): Remove unnecessary casts. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use build_int_2. + +2004-07-20 Richard Henderson + + * gimplify.c (is_gimple_tmp_var): Move to tree-gimple.c. + (gimplify_compound_lval): Use is_gimple_tmp_reg. + * tree-gimple.c (is_gimple_tmp_var): Move from gimplify.c. + (is_gimple_tmp_reg): New. + * tree-gimple.h (is_gimple_tmp_reg): Declare. + +2004-07-20 Richard Henderson + + * tree-pretty-print.c (dump_generic_node): Dump + CALL_EXPR_HAS_RETURN_SLOT_ADDR. + +2004-07-20 Frank Ch. Eigler + + * tree-mudflap.c (mf_set_options_fndecl): New tree. + (mudflap_init): Set it. + (mudflap_register_call): Remove __mf_init call. + (mudflap_finish_file): Emit call to __mf_init here. Emit a call to + to pass "-ignore-reads" option to libmudflap if needed. + +2004-07-20 John David Anglin + + PR c++/14607 + * config/pa/pa-hpux10.h (SUPPORTS_ONE_ONLY): Define. + (MAKE_DECL_ONE_ONLY): Undefine. + * pa-protos.h (som_text_section_asm_op, one_only_readonly_data_section, + readonly_data, one_only_data_section, forget_section): New prototypes. + * pa.c (pa_init_machine_status, som_text_section_asm_op): New + functions. + (pa_select_section): Add one-only (COMDAT) support. + * pa.h (struct machine_function): Define. + * som.h (ASM_OUTPUT_FUNCTION_PREFIX): Delete. + (TEXT_SECTION_ASM_OP): Call som_text_section_asm_op. + (DEFAULT_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP, + ONE_ONLY_TEXT_SECTION_ASM_OP, ONE_ONLY_READONLY_DATA_SECTION_ASM_OP, + ONE_ONLY_DATA_SECTION_ASM_OP): New defines. + (EXTRA_SECTIONS): Add in_one_only_readonly_data and in_one_only_data. + (EXTRA_SECTION_FUNCTIONS): Rework to use individual function macros. + (READONLY_DATA_FUNCTION, ONE_ONLY_READONLY_DATA_SECTION_FUNCTION, + ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): New defines + for EXTRA_SECTION_FUNCTIONS. + * doc/install.texi: Update binutils requirements. + +2004-07-20 Nathan Sidwell + + * vec.h (VEC_T_length, VEC_T_index, VEC_T_iterate, VEC_T_truncate, + VEC_T_replace, VEC_T_quick_insert, VEC_T_safe_insert, + VEC_T_ordered_remove, VEC_T_unordered_remove): Use unsigned, not + size_t. + (struct VEC): Use unsigned for num and alloc. + * vec.c (struct vec_prefix): Likewise. + (vec_o_reserve): Adjust. + + * dbxout.c (dbxout_type): Fix printf format. + + * tree.h (binfo_member): Remove. + * tree.c (binfo_member): Remove. + +2004-07-20 Nathan Sidwell + + * tree.h: Include vec.h + (DEF_VEC_P(tree)): New type. + (BINFO_BASE_BINFOS, BINFO_N_BASE_BINFOS, BINFO_BASE_BINFO): Adjust. + (BINFO_BASE_APPEND, BINFO_BASE_ITERATE): New. + (BINFO_LANG_SLOT): Remove. + (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): New. + (struct tree_binfo): Turn base_binfos into a trailing + VEC(tree). Add vtt_subvtt, vtt_vptr, primary fields. + (binfo_lang_slots): Remove. + * tree.c (binfo_lang_slots): Remove. + (make_tree_binfo_stat): Take a base binfo count, not a + lang slot count. Adjust. + * Makefile.in (TREE_H): Add vec.h + * alias.c (record_component_aliases): Adjust BINFO access. + * dbxout.c (dbxout_type): Likewise. + * dwarf2out.c (gen_member_die): Likewise. + * sdbout.c (sdbout_one_type): Likewise. + * tree-dump.c (deque_and_dump): Likewise. + * config/i386/i386.c (classify_argument, + contains_128bit_aligned_vector_p): Likewise. + * config/sh/symbian.c (symbian_export_vtable_and_rtti_p): Likewise. + * doc/c-tree.texi (Classes): Update BINFO documentation. + +2004-07-20 Steven Bosscher + + * c-common.h (check_case_value): Remove prototype. + (c_add_case_label): Adjust prototype. + * c-common.c (check_case_value): Make static. + (check_case_bounds): New function. + (c_add_case_label): Use it. Take new argument orig_type. + * c-typeck.c (struct c_switch): New orig_type field. + (c_start_case): Set it. + (do_case): Pass it to c_add_case_label. + * expr.c (expand_expr_real_1): Don't warn for out-of-bounds + cases from here. Add the labels in reverse order. + * stmt.c (struct case_node): Adjust comment. Remove balance field. + (add_case_node): Return nothing, don't check for duplicate cases. + Insert new case nodes in a list, not in an AVL tree. + (expand_end_case_type): Don't turn a case tree into a case list. + (case_tree2list): Remove. + * tree.h (add_case_node): Adjust prototype. + +2004-07-19 Paolo Bonzini + + * genattr.c (struct range, struct function_unit, + write_units, extend_range, init_range): Remove them. + (main): Remove code dealing with DEFINE_FUNCTION_UNIT. + Output "#define INSN_SCHEDULING" here. + * genattrtab.c (struct range, struct function_unit_op, + struct function_unit, struct dimension, enum operator, + operate_exp, expand_units, simplify_knowing, + encode_units_mask, simplify_by_exploding, + find_and_mark_used_attributes, unmark_used_attributes, + add_values_to_cover, increment_current_value, + test_for_current_value, simplify_with_current_value, + simplify_with_current_value_aux, gen_unit, + write_unit_name, write_function_unit_info, + write_complex_function, write_toplevel_expr, + find_single_value, extend_range): Remove. + (write_attr_get): Do not handle common_av->value + being an FFS. + (struct attr_desc): Remove func_units_p and blockage_p. + (write_attr_valueq): Do not handle them. + (find_attr): Do not clear them. + (make_internal_attr): Do not initialize them. + (main): Remove code dealing with DEFINE_FUNCTION_UNIT. + * sched-vis.c (init_target_units, insn_print_units, + init_block_visualization, print_block_visualization, + visualize_scheduled_insns, visualize_no_unit, + visualize_stall_cycles, visualize_alloc, + visualize_free, target_units, get_visual_tbl_length, + MAX_VISUAL_LINES, INSN_LEN, n_visual_lines, + visual_tbl_line_length, visual_tbl, n_vis_no_unit, + MAX_VISUAL_NO_UNIT, vis_no_unit): Remove. + * haifa-sched.c (blockage_range, clear_units, + schedule_unit, actual_hazard, potential_hazard, + insn_unit, unit_last_insn, unit_tick, + actual_hazard_this_instance, potential_hazard, + schedule_unit, max_insn_queue_index_value): Remove. + (MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to + max_insn_queue_index. + * rtl.def (DEFINE_FUNCTION_UNIT): Remove. + * doc/md.texi (Processor pipeline description): Remove + references to old pipeline descriptions. + (Automaton pipeline description): Merge with the above. + (Old pipeline description, Comparison of the two descriptions): + Remove. + + * bt-load.c (migrate_btr_def): Remove references to + use_pipeline_interface. + * haifa-sched.c (insn_cost, schedule_insn, + schedule_block, advance_one_cycle, sched_init, + queue_to_ready, sched_finish): Likewise. + * modulo-sched.c (sms_schedule, advance_one_cycle, + ps_has_conflicts): Likewise. + * sched-rgn.c (init_ready): Likewise. + (debug_dependencies): Likewise, and remove an "if (1)". + * target.h (use_dfa_pipeline_interface): Remove. + * config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + * doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. + +2004-07-19 Roger Sayle + + * rtlanal.c (reg_set_p): Add check for regs_invalidated_by_call. + +2004-07-19 Jeff Law + + * tree-ssa-dom.c (single_incoming_edge_ignoring_loop_edges): New. + (get_eq_expr_value): Use it. Simplify slightly. + +2004-07-19 Maciej W. Rozycki + + * config/mips/mips.md (mulsidi3_32bit_r4000): Fix the clobber list. + (umulsidi3_32bit_r4000): Likewise. + +2004-07-19 Nathan Sidwell + + * vec.h: Propagate location information properly. + (VEC_T_iterate): Add result pointer parameter. + (VEC_T_space): New. + (VEC_T_reserve): Use it. + +2004-07-19 Daniel Jacobowitz + + * Makefile.in (c-format.o): Depend on c-format.h. + * c-format.h: New file. + (struct format_char_info): Add CHAIN member. + * c-format.c: Move some types and constants to c-format.h. + (format_type_error): Set to -1. + (struct function_format_info): Use an int for format_type. + (decode_format_type): Return an int. Return format_type_error + on error. + (print_char_table, asm_fprintf_char_table, gcc_diag_char_table) + (gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table) + (scan_char_table, time_char_table, monetary_char_table): Initialize + CHAIN to NULL. + (n_format_types): New variable. + (check_format_info_main): Handle CHAIN in format_char_info. + (handle_format_attribute): Handle TARGET_FORMAT_TYPES and + TARGET_N_FORMAT_TYPES. + * config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*) + (sparc-*-solaris2*): Include config/t-sol2 and config/sol2-c.c. + * config/sol2-c.c: New file. + * config/t-sol2: New file. + * config/sol2.h (TARGET_N_FORMAT_TYPES, TARGET_FORMAT_TYPES): Define. + * config/sparc/elf.h, config/sparc/sp64-elf.h: Undefine + TARGET_N_FORMAT_TYPES and TARGET_FORMAT_TYPES. + + * doc/extend.texi (Target Format Checks): New section. + (Function Attributes): Mention it. + * doc/invoke.texi: Mention target format checks. + * doc/sourcebuild.texi: Mention target format checks. + * dc/tm.texi (Misc): Document TARGET_N_FORMAT_TYPES and + TARGET_FORMAT_TYPES. + +2004-07-19 Andreas Krebbel + + * config/s390/s390-protos.h (s390_return_address_offset): Prototype + added. + * config/s390/s390.c (regclass_map initializer): Register 35 added to + ADDR_REGS. + (load_multiple_operation, store_multiple_operation): Removed + pointless sanity check. + (s390_decompose_address): Added check for return_address_pointer_rtx. + (s390_return_addr_rtx): Use return_address_pointer_rtx for count == 0. + (s390_return_address_offset): New function. + * config/s390/s390.h (FIRST_PSEUDO_REGISTER): Increased to 36. + (FRAME_REGNO_P): Added check for register 35. + (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, + REG_ALLOC_ORDER): Appended entry for register 35. + (REG_CLASS_CONTENTS): Adjusted class masks for register 35. + (EH_RETURN_HANDLER_RTX): Use return_address_pointer_rtx. + (RETURN_ADDRESS_POINTER_REGNUM): New macro. + (ELIMINABLE_REGS, INITIAL_ELIMINATION_OFFSET): Return address pointer + is eliminable using stack pointer or hard frame pointer. + (REGISTER_NAMES): Added name for register 35. + * config/s390/s390.md ("load_multiple", "store_multiple"): Removed + pointless sanity check. + +2004-07-19 Roger Sayle + + * fold-const.c (tree_expr_nonzero_p): Add function prototype. + (fold) : Move tree_expr_nonzero_p optimization from + fold_relational_const to here, i.e. "(x | 5) == 0" -> false. + (fold) (UNEQ_EXPR>: Add optimizations for unordered comparisons + of the form "x op x" where op is UNLE, UNGE, UNEQ or LTGT. + (fold_relational_const): Tidy up handling of floating point + comparisons by calling real_compare. Remove tree_expr_nonzero_p + transformation; fold_relational_const assumes constant operands. + +2004-07-19 Gabriel Dos Reis + + * doc/sourcebuild.texi: Add libcpp, now that CPP has its own + directory. + +2004-07-19 Joseph S. Myers + + * c-tree.h (struct c_expr): Define. + (C_SET_EXP_ORIGINAL_CODE): Remove. + (parser_build_binary_op, build_compound_expr): Update prototypes. + * c-parse.in (%union): Add exprtype. + (FUNC_NAME): Mark as ttype. + (expr, expr_no_commas, cast_expr, unary_expr, primary): Change to + exprtype. + (expr): Update. Define directly in terms of expr_no_commas + instead of using nonnull_exprlist. + (nonnull_exprlist, unary_expr, cast_expr, expr_no_commas, primary, + offsetof_member_designator, typespec_nonreserved_nonattr, init, + initval, designator, component_declarator, + component_notype_declarator, enumerator, array_declarator, + condition, exexpr, switch_statement, stmt_nocomp, stmt, + nonnull_asm_operands, ivar_declarator, receiver): Update. Don't + set C_EXP_ORIGINAL_CODE. Use TREE_NO_WARNING for assignments + where appropriate. + * c-common.h (C_EXP_ORIGINAL_CODE): Remove. + * c-common.c (c_common_truthvalue_conversion): Don't check + C_EXP_ORIGINAL_CODE. + * c-typeck.c (parser_build_binary_op): Use c_expr structures. + Don't use C_EXP_ORIGINAL_CODE. + (default_conversion, default_function_array_conversion): Don't use + C_EXP_ORIGINAL_CODE. Preserve TREE_NO_WARNING. + (internal_build_compound_expr): Merge into build_compound_expr. + (build_compound_expr): Take two operands instead of a TREE_LIST. + * objc/objc-act.c (get_super_receiver): Update calls to + build_compound_expr. + +2004-07-18 Paolo Bonzini + + * config/sh/sh.c (sh_use_dfa_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Set to + hook_int_void_1. + * config/sh/sh.md: Extract pipeline descriptions + into separate files. + * config/sh/sh1.md: New file, extracted from sh.md. + * config/sh/sh4.md: New file, extracted from sh.md. + * config/sh/shmedia.md: New file, extracted from sh.md + and rewritten using new-style pipeline description. + +2004-07-18 Zack Weinberg + + * config/pa/pa.md: Delete the two remaining define_peephole + patterns. + +2004-07-18 Steven Bosscher + Joseph S. Myers + + * c-common.c (c_common_truthvalue_conversion): Don't warn if + TREE_NO_WARNING is set. + +2004-07-18 Roger Sayle + + * builtins.c (simplify_builtin_memcmp, simplify_builtin_strcmp, + simplify_builtin_strncmp): Delete. + (fold_builtin_memcmp, fold_builtin_strcmp, fold_builtin_strncmp): + Change argument to accept an arglist instead of an "exp". Assume + that the return type is always integer_type_node. Copy missing + transformations from their now obsolete simplify_builtin_* + equivalents. + (fold_builtin_1): Pass arglist instead of exp to fold_builtin_memcmp, + fold_builtin_strcmp and fold_builtin_strncmp. + (simplify_builtin): Call fold_builtin_memcmp, fold_builtin_strcmp + and fold_builtin_strncmp instead of simplify_builtin_memcmp, + simplify_builtin_strcmp and simplify_builtin_strncmp respectively. + +2004-07-18 Daniel Jacobowitz + + * Makefile.in (tree-alias-common.o): Update dependencies. + +2004-07-17 Sebastian Pop + + * cfgloop.c (flow_loop_nested_p): Fix comment. + +2004-07-17 Jason Merrill + + PR c++/16115 + * stor-layout.c (relayout_decl): New fn. + * tree.h: Declare it. + (DECL_BY_REFERENCE): New macro. + +2004-07-17 Eric Botcazou + + * libgcc2.c (__enable_execute_stack): New symbol. + * libgcc-std.ver (GCC_3.4.2): New version. Inherit from GCC_3.4 + and declare __enable_execute_stack. + * mklibgcc.in (lib2funcs): Add _enable_execute_stack. + * config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): ANSIfy. + * config/sol2.h (TRANSFER_FROM_TRAMPOLINE): Rename into + ENABLE_EXECUTE_STACK. + * config/alpha/alpha.c (alpha_initialize_trampoline): Conditionalize + on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. + * config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Rename into + ENABLE_EXECUTE_STACK. + * config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. + * config/i386/i386.c (x86_initialize_trampoline): Conditionalize + on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. + * config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Rename into + ENABLE_EXECUTE_STACK. + * config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. + * config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Likewise. + * config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise. + * config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Likewise. + * config/sparc/sparc.c (sparc_initialize_trampoline): Conditionalize + on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE. + (sparc64_initialize_trampoline): Likewise. + * doc/tm.texi (trampolines): Add ENABLE_EXECUTE_STACK macro. + +2004-07-17 Joseph S. Myers + + * langhooks.h (builtin_function): New langhook. + * langhooks-def.h (LANG_HOOKS_BUILTIN_FUNCTION): New. + (LANG_HOOKS_INITIALIZER): Update. + * tree.h (builtin_function): Remove. + * doc/tm.texi: Update. + * c-tree.h (builtin_function): Declare. + * c-common.c, config/alpha/alpha.c, config/arm/arm.c, + config/c4x/c4x.c, config/frv/frv.c, config/i386/i386.c, + config/ia64/ia64.c, config/iq2000/iq2000.c, + config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, + config/stormy16/stormy16.c: All callers of builtin_function + changed. + +2004-07-17 Andrew Pinski + + PR target/16556 + * config/i386/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): + Remove white space after the backslash. + +2004-07-17 Eric Botcazou + + PR rtl-optimization/16294 + * resource.c (return_insn_p): New predicate. + (mark_target_live_regs): Use it. Special-case return insns. + (init_resource_info): Use it. Don't scan the epilogue past + a return. + +2004-07-17 Zdenek Dvorak + + * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Do not + destroy dominance information. + * passes.c (rest_of_handle_loop2): Free dominance information. + * tree-cfg.c (cleanup_tree_cfg): Remove unreachable blocks before + jump threading. + (thread_jumps): Update dominance information and remove unreachable + blocks. + * tree-ssa-phiopt.c (replace_phi_with_stmt): Update dominance + information and remove the unreachable block. + +2004-07-17 Graham Stott + + * emit-rtl.c (reorder_insns): Don't set BB for a BARRIER insn. + +2004-07-17 Toon Moene + + * doc/sourcebuild.texi: Remove libf2c entry. + +2004-07-17 Paolo Bonzini + + * config/i386/i386.md (movv16qi_internal): Fix typo. + +2004-07-17 Steven Bosscher + + * final.c (final_scan_insn): Fix broken commit from previous + patch. + +2004-07-17 Joseph S. Myers + + * c-typeck.c (parser_build_binary_op): Condition warnings for + X<=Y<=Z on -Wparentheses instead of -Wextra. + * doc/invoke.texi: Update. Document that most of -Wparentheses is + supported for C only. + +2004-07-17 Steven Bosscher + + * cfgcleanup.c (try_simplify_condjump): Don't remove line + notes to avoid unreachable code warnings. + * toplev.c (backend_init): Don't emit line notes for + unreachable code warnings. + + * combine.c (distribute_notes): Don't distribute a + REG_VTABLE_REF note. + * final.c (final_scan_insn): Don't handle it. + * rtl.c (reg_note_name): Remove it. + * rtl.h (enum reg_node): Dito. + + * emit-rtl.c (force_line_numbers, restore_line_number_status): + Remove. + * rtl.h (force_line_numbers, restore_line_number_status): + Remove prototypes. + + * stmt.c (using_eh_for_cleanups_p, using_eh_for_cleanups): Move... + * tree-eh.c (using_eh_for_cleanups_p): ...here. Make static. + (using_eh_for_cleanups): Also moved here. + + * expr.c (expand_expr_real_1) : Die if we see one. + : Die if we have a non-NULL SWITCH_BODY. Update calls + to expand_start_case and add_case_node. + * stmt.c (struct nesting): Cleanup unused fields condition_code, + last_unconditional_cleanup, nominal_type, printname, and + line_number_status. + (struct fixup_goto): Remove. + (struct stmt_status): Remove x_goto_fixup_chain field. + (goto_fixup_chain): Remove. + (strip_default_case_nodes, group_case_nodes, emit_jump_if_reachable, + pushcase, pushcase_range): Remove. + (expand_start_bindings_and_block): Don't set unused fields in + the nesting stack. + (expand_start_case, add_case_node): Cleanup unused formal arguments. + (expand_end_case_type): Don't simplify the case-list. Use emit_jump + instead of emit_jump_if_reachable. + (emit_case_nodes): Likewise. + * tree-cfg.c (group_case_labels, cleanup_dead_labels): No longer + static. + (update_eh_label): Work around left-over exception handing regions. + * tree-flow.h (group_case_labels, cleanup_dead_labels): Add protos. + * tree-optimize.c (execute_cleanup_cfg_post_optimizing): New function. + (pass_cleanup_cfg_post_optimizing): New pass. + (init_tree_optimization_passes): Run the new pass after all + optimizations. + * tree.h (pushcase, pushcase_range): Remove prototypes. + (expand_start_case, add_case_node): Update prototypes. + +2004-07-16 Krister Walfridsson + + * tree-inline.c (estimate_num_insns_1): Correct increase of count. + +2004-07-16 Richard Henderson + + * builtins.c (std_expand_builtin_va_arg): Remove. + (expand_builtin_va_arg): Remove. + * expr.h: Don't declare them. + * gimplify.c (mark_decls_volatile_r): Remove. + (copy_if_shared_r): Don't call it. + * target-def.h: Don't test EXPAND_BUILTIN_VA_ARG. + * expr.c (expand_expr_real_1): Don't handle VA_ARG_EXPR. + * gimple-low.c (lower_stmt): Likewise. + * tree-cfg.c (cfg_remove_useless_stmts_bb): Likewise. + * tree-gimple.c (is_gimple_tmp_rhs, is_gimple_stmt): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * doc/tm.texi (TARGET_GIMPLIFY_VA_ARG_EXPR): Don't mention + EXPAND_BUILTIN_VA_ARG. + * system.h (EXPAND_BUILTIN_VA_ARG): Poison. + * config/alpha/alpha.h, config/alpha/unicosmk.h, config/i386/i386.h, + config/ia64/ia64.h, config/rs6000/rs6000.h, config/s390/s390.h, + config/sparc/sparc.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-16 Daniel Berlin + + * tree-ssa-pre.c (insert_aux): Break out if we hit + a critical edge. + +2004-07-16 Richard Henderson + + * basic-block.h (remove_fake_exit_edges): Declare. + * cfganal.c (remove_fake_predecessors): Rename from + remove_fake_successors; iterate over predecessors. + (remove_fake_exit_edges): New. + * cfgcleanup.c (try_optimize_cfg): Use it. + * gcse.c (one_pre_gcse_pass, store_motion): Likewise. + * predict.c (estimate_probability): Likewise. + (tree_estimate_probability, note_prediction_to_br_prob): Likewise. + * tree-cfg.c (make_edges): Likewise. + * tree-ssa-pre.c (fini_pre): Likewise. + * profile.c (instrument_edges): Don't remove_fake_edges. + (branch_prob): Do it earlier here. + +2004-07-16 Richard Henderson + + * tree-ssa-operands.c (get_expr_operands): Fix 2004-07-15 + switchification wrt CONSTRUCTOR. Document the reason. + +2004-07-16 Frank Ch. Eigler + + * tree-mudflap.c (mf_file_function_line_tree): Correct typo + that prevented descriptive __mf_check source location strings. + +2004-07-16 Richard Henderson + + * tree-def (WITH_SIZE_EXPR): New. + * explow.c (expr_size, int_expr_size): Handle WITH_SIZE_EXPR. + * expr.c (expand_expr_real_1): Likewise. + * gimplify.c (maybe_with_size_expr): New. + (gimplify_arg, gimplify_modify_expr): Use it. + (gimplify_modify_expr_to_memcpy): Take size parameter. + (gimplify_modify_expr_to_memset): Likewise. + (gimplify_expr): Handle WITH_SIZE_EXPR. + * tree-alias-common.c (find_func_aliases): Likewise. + * tree-eh.c (tree_could_trap_p): Likewise. + (tree_could_throw_p): Likewise. + * tree-gimple.c (is_gimple_lvalue): Likewise. + (get_call_expr_in): Likewise. + * tree-inline.c (estimate_num_insns_1): Likewise. + (expand_calls_inline): Likewise. + * tree-nested.c (convert_call_expr): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-sra.c (sra_walk_expr): Likewise. + * tree-ssa-alias.c (add_pointed_to_expr): Likewise. + * tree-ssa-ccp.c (get_rhs, set_rhs): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree-tailcall.c (find_tail_calls): Likewise. + + * calls.c (expand_call): Reset old_stack_allocated after + calling emit_stack_restore. + +2004-07-16 Richard Henderson + + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, + lhd_tree_inlining_copy_res_decl_for_inlining): Remove. + * langhooks.c (lhd_tree_inlining_copy_res_decl_for_inlining): Remove. + * langhooks.h (struct lang_hooks_for_tree_inlining): Remove + copy_res_decl_for_inlining. + + * tree-inline.c (declare_return_variable): New modify_dest argument. + Use it as the return value, when possible or manditory. Handle + TREE_ADDRESSABLE types. + (expand_call_inline): Extract MODIFY_EXPR lhs for call. Simplify + replacement of CALL_EXPR. + +2004-07-16 Richard Henderson + + * tree-flow.h (struct var_ann_d): Remove has_hidden_use. + * gimple-low.c (expand_var_p): Don't check it. + * tree-ssa-alias.c (setup_pointers_and_addressables): Likewise. + * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. + * tree-ssa-operands.c (add_stmt_operand): Likewise. + * tree-dfa.c (find_hidden_use_vars, find_hidden_use_vars_r): Kill. + (find_referenced_vars): Don't call them. + * tree-flow-inline.h (has_hidden_use, set_has_hidden_use): Kill. + +2004-07-16 Richard Henderson + + * function.c (pass_by_reference): True for all variable sized types. + +2004-07-16 Sebastian Pop + + * Makefile.in (tree-pretty-print.o): Depend on tree-chrec.h. + * tree-pretty-print.c: Include tree-chrec.h. + (dump_generic_node): Pretty print SCEV_KNOWN, SCEV_NOT_KNOWN + and POLYNOMIAL_CHREC nodes. + +2004-07-16 Steve Ellcey + + * builtins.c (expand_builtin_stpcpy): Do not create temporary + reg with VOIDmode. + +2004-07-16 Segher Boessenkool + + * config/rs6000/eabi.asm (__eabi_convert): Fix typo (cmpi vs. cmpwi). + +2004-07-16 Andreas Krebbel + + * config/s390/s390.md: Changed every occurence of BASE_REGISTER + to BASE_REGNUM. + * config/s390/s390.c: Likewise. + * config/s390/s390.h: Likewise. + +2004-07-16 Richard Sandiford + + * config/mips/mips.md (addsi3, adddi3): Remove special handling + of $sp adds. Remove REGNO checks from mips16 patterns. + +2004-07-16 Richard Sandiford + + * config/mips/mips.md: Delete outdated comment. + +2004-07-16 Richard Sandiford + + * config/mips/mips.c (get_float_compare_codes): Delete. + (mips_emit_compare): New function, mostly extracted from + get_float_compare_codes and gen_conditional_branch. + (gen_conditional_branch, gen_conditional_move): Use it. + +2004-07-16 Segher Boessenkool + + * genautomata.c (add_vect): Speedup by using integers as + bit-vectors for walking through the comb_vect and finding + a match. + +2004-07-16 Richard Sandiford + + * config/mips/mips.c (mips_zero_if_equal): Only use XORs if the second + operand is an uns_arith_operand; use subtraction otherwise. + * config/mips/mips.md (cmpsi, cmpdi): Allow any nonmemory_operand, + not just arith_operands. + +2004-07-16 Richard Sandiford + + * config/mips/mips-protos.h (gen_int_relational): Delete. + (mips_emit_scc): Declare. + * config/mips/mips.c (internal_test): Delete. + (sle_operand, sleu_operand): New functions. + (map_test_to_internal_test, gen_int_relational): Delete. + (mips_emit_binary, mips_relational_operand_ok_p) + (mips_emit_int_relational, mips_zero_if_equal) + (mips_emit_scc): New functions. + (gen_conditional_branch): Rework to use mips_emit_int_relational. + * config/mips/mips.h (PREDICATE_CODES): Add sle_operand and + sleu_operand. + * config/mips/mips.md (seq, sne, sgt, sge, slt, sle, sgtu, sgeu) + (sltu, sleu): Use mips_emit_scc. + (*sge_[sd]i, *sgeu_[sd]i): New patterns. + (*sle_[sd]i, *sle_[sd]i_mips16): Use sle_operand. + (*sleu_[sd]i, *sleu_[sd]i_mips16): Use sleu_operand. + +2004-07-16 Richard Sandiford + + * config/mips/mips.md (*sgt_di_mips16): Fix destination constraint. + +2004-07-16 Richard Sandiford + + * config/mips/mips.md (*seq_[sd]i): Renamed from seq_[sd]i_zero. + (*sne_[sd]i): Likewise sne_[sd]i_zero. + (*sgt_[sd]i): ...and sgt_[sd]i. + (*slt_[sd]i): ...and slt_[sd]i. + (*sgtu_[sd]i): ...and sgtu_[sd]i. + (*sltu_[sd]i): ...and sltu_[sd]i. + (*sleu_[sd]i): ...and sleu_[sd]i_const. + Name previously unnamed mips16 patterns. Formatting fixes. + +2004-07-16 Richard Sandiford + + * config/mips/mips.c (cmp_operands): Renamed from branch_cmp. + (branch_type): Delete. + (gen_conditional_branch, gen_conditional_move) + (mips_gen_conditional_trap): Update after name change. Get the + comparison mode from cmp_operands[0]. + * config/mips/mips.h (cmp_type, branch_type): Delete. + (cmp_operands): Renamed from branch_cmp. + * config/mips/mips.md (cmpsi, cmpdi, cmpsf, cmpdf): Update after + name change. Don't set branch_type. + (seq, sne, sgt, sge, slt, sle, sgtu, sgeu, sltu, sleu): Check the + mode class of cmp_operands[0] rather than branch_type. Update after + name change. + +2004-07-16 Richard Sandiford + + * config/mips/mips.c (mips_rtx_costs): In mips16 code, set the cost + of 0...255 to 0 when inside a SET. + +2004-07-16 Richard Sandiford + + * config/mips/mips.md: Remove mips16 define_peepholes. + +2004-07-16 Daniel Berlin + + * tree-ssa-pre.c (init_pre): Connect infinite loops to exit. + (fini_pre): Remove fake edges. + +2004-07-15 Richard Henderson + + * tree-ssa-operands.c (get_expr_operands): Use a switch. Split out... + (get_indirect_ref_operands, get_call_expr_operands): ... these. + +2004-07-15 Nathan Sidwell + + * vec.h (VEC_address): New function. + +2004-07-14 Jason Merrill + + PR middle-end/15885 + * gimplify.c (gimplify_arg): New fn, split out from... + (gimplify_call_expr): Here. Special-case BUILT_IN_VA_START. + +2004-07-15 Roman Zippel + + * config/m68k/m68k.c (output_move_qimode): Abort on an attempt to + generate code which is generated by pushqi1 now + * config/m68k/m68k.h (MOVE_BY_PIECES_P): Remove. + +2004-07-15 Roman Zippel + + * combine.c (simplify_set): match the mode of the constant 0 with + the tested operand to match the compare behaviour and the + simplify_relational_operation() expectation. + +2004-07-15 Aldy Hernandez + + * config/rs6000/rs6000.md ("bunordered"): Disable for e500. + ("bordered"): Same. + +2004-07-15 Aldy Hernandez + + * config/rs6000/rs6000.md ("*cceq_ior_compare"): Allow + unconditionally. + * config/rs6000/spe.md ("e500_cceq_ior_compare"): Remove. + +2004-07-15 Richard Sandiford + + * config/mips/mips.c (mips_adjust_insn_length): Fix handling of + calls in mips16 code. + +2004-07-15 Richard Sandiford + + * config/mips/mips.md: In the mips16 li/neg splitter, use SImode for + the destination of the li as well as for the neg. + +2004-07-15 Frank Ch. Eigler + + g++/15861 + * cgraphunit.c (cgraph_build_static_cdtor): Add priority argument. + * cgraph.h: Update declaration. + * c-decl.c (build_cdtor): Update call with default priority. + * coverage.c (create_coverage): Ditto. + * tree-mudflap.c (mf_init_fndecl): New tree. + (mudflap_init): Set it. + (mudflap_register_call): Arrange to call __mf_init before the first + __mf_register call. + (mudflap_finish_file): Mark the mudflap static initializer as extra + high priority, to beat all C++ static constructors. + +2004-07-15 Jeff Law + + * loop.c (check_insn_for_givs): Restore check for code labels that was + accidentally deleted by a recent checkin. + +2004-07-15 Nathan Sidwell + + * vec.h (VEC_T_truncate): Allow truncation of an empty vector. + (VEC_T_quick_insert, VEC_T_ordered_remove): Fix sizeof(T) thinko. + +2004-07-14 Richard Henderson + + * print-tree.c (print_node): Fix casts last change. + +2004-07-15 Paul Brook + + * dwarf2out.c (dwarf2out_begin_prologue): Rename IA64_UNWIND_INFO + to TARGET_UNWIND_INFO. + * except.c (output_function_exception_table): Ditto. + * except.h: Ditto. + * opts.c (decode_options): Ditto. + * passes.c (rest_of_handle_final): Ditto. + * final.c (final_start_function): Ditto. + (final_scan_insn, final_scan_insn): Replace IA64_UNWIND_EMIT with + target hook. + * targhooks.h (default_unwind_emit): Declare. + * targhooks.c (default_unwind_emit): New function. + * target-def.h: Define and use TARGET_UNWIND_EMIT. + * target.h (struct gcc_target): Add unwind_emit. + * config/ia64/ia64.c (TARGET_UNWIND_EMIT): Define. + * config/ia64/ia64.h: Rename IA64_UNWIND_INFO to TARGET_UNWIND_INFO. + Remove IA64_UNWIND_EMIT. + * doc/tm.texi: Document TARGET_UNWIND_EMIT and TARGET_UNWIND_INFO. + +2004-07-14 Richard Henderson + + * print-tree.c (print_node): Handle SSA_NAME. + +2004-07-14 James E Wilson + + PR target/16325 + * config/mips/mips.h (STARTING_FRAME_OFFSET): When flag_profile_value + and ! TARGET_64BIT, include REG_PARM_STACK_SPACE. + +2004-07-15 Jakub Jelinek + + * expr.c (expand_assignment): Reenable bitfield += optimizations. + Use alias set 0 for memory, do proper mode calculations and adjust + address for memories. + +2004-07-14 Per Bothner + + * input.h: If USE_MAPPED_LOCATION, define separate expanded_location + structure with extra column field. + * tree.c (expand_location): Also fill in column field. + * gengtype-lex.l: Ignore expanded_location typedef, sinze gengtype + gets confused by the two conditionally-compiled definitions. + +2004-07-14 Eric Christopher + + * calls.c (expand_call): Fix typo in comment. + +2004-07-14 Steve Ellcey + + * config/ia64/ia64.c (ia64_expand_compare): Allow ORDERED + comparision of TFmode. + +2004-07-14 Richard Henderson + + * config/alpha/alpha.c (alpha_gimplify_va_arg_1): Move indirect ... + (alpha_gimplify_va_arg): ... handling here. Use pass_by_reference. + * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Use pass_by_reference. + * config/i386/i386.c (ix86_gimplify_va_arg): Likewise. + * config/i860/i860.c (i860_gimplify_va_arg_expr): Likewise. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. + * config/sh/sh.c (sh_gimplify_va_arg_expr): Likewise. + * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise. + +2004-07-14 Mike Stump + + * config/darwin.h (WINT_TYPE): Define to be int to match + system header files. + +2004-07-14 Bob Wilson + + * config/xtensa/xtensa.c (function_arg_advance): Check for args + that must be passed in the stack. + (xtensa_gimplify_va_arg_expr): Skip special-case padding for small + arguments if the size is not a constant. + +2004-07-14 Per Bothner + + * c-typeck.c (emit_side_effect_warnings): Use EXPR_HAS_LOCATION + instead of EXPR_LOCUS in a boolean context, which is always true + if --enable-mapped-location. + * stmt.c (warn_if_unused_value): Likewise. Also use EXPR_LOCATION. + +2004-07-14 Richard Henderson + + * dominance.c (struct dom_info): Add fake_exit_edge. + (init_dom_info): Allocate it. + (free_dom_info): Free it. + (calc_dfs_tree): Set it. Handle noreturn and infinite loops + in two passes. + (calc_idoms): Honor fake_exit_edge. + +2004-07-13 Jason Merrill + + * tree-gimple.c (is_gimple_reg_rhs, is_gimple_mem_rhs): New fns. + (rhs_test_for): New fn. + (is_gimple_tmp_rhs): Rename from is_gimple_rhs. + * tree-gimple.h: Declare them. + * gimplify.c (gimplify_modify_expr): Use the new fns. + +2004-07-14 Richard Henderson + + * config/arm/arm-protos.h (arm_va_arg): Remove. + * config/arm/arm.c (arm_va_arg): Remove. + (arm_init_expanders): Fix alignment of arg_pointer_rtx. + * config/arm/arm.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-14 John David Anglin + + * pa.c (fix_range): New function to mark a range(s) of registers as + fixed registers. + (override_options): Call fix_range if the -mfixed-range option string + is not empty. + * pa.h (TARGET_OPTIONS): Add -mfixed-range option. + * doc/invoke.texi (-mfixed-range): Document new option. + +2004-07-14 David Edelsohn + + * config/rs6000/rs6000.c (function_arg_padding): Do not pad SFmode + for TARGET_64BIT. + (rs6000_gimplify_va_arg): Use size_int instead of build_int_2. + +2004-07-14 Roger Sayle + + * expmed.c (expand_sdiv_pow2): New function to expand signed division + by a positive power of two, split out from expand_divmod. Provide + an alternate implementation when shifts are expensive. Lower the + threshold for using a branchless implementation to BRANCH_COST >= 2. + (expand_divmod): Call expand_sdiv_pow2 for suitable divisions. + +2004-07-14 Paolo Bonzini + + * tree-dfa.c (make_rename_temp): *Really* work just + like create_tmp_var if called while outside SSA form. + +2004-07-14 Ulrich Weigand + + * config/s390/s390.md ("udivsi3"): Ensure trap is generated + for division by zero. + ("umodsi3"): Likewise. + +2004-07-14 Richard Sandiford + + * config/mips/mips.c (mips_output_move): When generating mips16 code, + force loads of negative constants to be split. + * config/mips/mips.md (*movhi_mips16, *movqi_mips16): Likewise. + Generalize SImode li/neg splitter to cope with other modes. + +2004-07-14 Paolo Bonzini + + * expmed.c: Remove more references to QUEUED in the comments. + * expr.c: Likewise. + +2004-07-14 Richard Sandiford + + Revert: + 2004-07-13 Richard Henderson + * config/mips/mips.c (mips_pass_by_reference): Handle mode sizes + correctly. + +2004-07-14 Paolo Bonzini + + * tree-dfa.c (make_rename_temp): Work just like + create_tmp_var if called while outside SSA form. + +2004-07-14 Paolo Bonzini + + * expr.c (enqueue_insn, finish_expr_for_function, + protect_from_queue, queued_subexp_p, mark_queue, + emit_insns_enqueued_after_mark, emit_queue, + expand_increment): Remove. + (store_constructor): Expand increment as an assignment. + (expand_expr_real_1 ): Abort. + * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, + QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, + protect_from_queue, emit_queue, queued_subexp_p): Remove. + * function.h (pending_chain, x_pending_chain): Remove. + * rtl.def (QUEUED): Remove. + + * emit-rtl.c (copy_insn_1, copy_most_rtx, + set_used_flags, verify_rtx_sharing): Remove references to QUEUED. + * genattrtab.c (attr_copy_rtx, clear_struct_flag, + encode_units_mask): Likewise. + * local-alloc.c (equiv_init_varies_p): Likewise. + * rtl.c (copy_rtx): Likewise. + * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. + * simplify-rtx.c (simplify_gen_subreg): Likewise. + * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. + + * builtins.c (expand_builtin, expand_builtin_apply, + expand_builtin_mathfn, expand_builtin_mathfn_2, + expand_builtin_mathfn_3, expand_builtin_setjmp_setup): + Remove calls to emit_queue and protect_from_queue. + * calls.c (expand_call, precompute_arguments, + precompute_register_parameters, rtx_for_function_call, + store_one_arg): Likewise. + * dojump.c (do_compare_and_jump, do_jump): Likewise. + * explow.c (memory_address): Likewise. + * expmed.c (clear_by_pieces_1, clear_storage, + clear_storage_via_libcall, emit_group_load, + emit_group_store, emit_store_flag, + expand_expr_real_1, store_by_pieces, + store_constructor, store_expr, try_casesi, + try_tablejump): Likewise. + * function.c (expand_pending_sizes): Likewise. + * optabs.c (emit_cmp_and_jump_insns, + emit_conditional_add, emit_conditional_move, + expand_fix, expand_float, prepare_cmp_insn): Likewise. + * stmt.c (emit_case_bit_tests, + expand_asm_expr, expand_computed_goto, + expand_decl_init, expand_end_case_type, + expand_end_stmt_expr, expand_expr_stmt_value, + expand_return, expand_start_case, + optimize_tail_recursion): Likewise. + * config/c4x/c4x.c (c4x_expand_builtin): Likewise. + * config/s390/s390.c (s390_expand_cmpmem): Likewise. + +2004-07-14 Ben Elliston + + * vec.h: Comment fix. + +2004-07-13 Richard Henderson + + * target.h (struct gcc_target): Add calls.pass_by_reference. + * target-def.h (TARGET_PASS_BY_REFERENCE): New. + * function.c (pass_by_reference): Use the hook. + * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. + * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. + (hook_pass_by_reference_must_pass_in_stack): New. + * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. + (alpha_pass_by_reference): New. + (TARGET_PASS_BY_REFERENCE): New. + * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/arc/arc.c (arc_pass_by_reference): New. + (TARGET_PASS_BY_REFERENCE): New. + * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): True. + * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. + * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. + (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. + * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/cris/cris.c (cris_pass_by_reference): New. + (TARGET_PASS_BY_REFERENCE): New. + * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. + (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. + (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. + * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. + * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. + (frv_function_arg_pass_by_reference): Remove. + * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. + * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. + (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. + * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. + * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. + (ia64_pass_by_reference): Rename from + ia64_function_arg_pass_by_reference. + * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. + * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. + (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. + * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. + * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. + * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. + (m32r_pass_by_reference): Adjust prototype. Make static. + Handle mode sizes correctly. + * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c + (m68hc11_function_arg_pass_by_reference): Remove. + * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. + * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. + * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. + * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. + (mips_va_arg): Use pass_by_reference. + (mips_pass_by_reference): Rename from function_arg_pass_by_reference. + Handle mode sizes correctly. + * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. + * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. + * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. + (mmix_pass_by_reference): Rename from + mmix_function_arg_pass_by_reference. + * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): True. + * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. + (mn10300_pass_by_reference): New. + * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): True. + * config/pa/pa.c (pa_pass_by_reference): New. + (TARGET_PASS_BY_REFERENCE): New. + * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): True. + * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. + * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. + (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. + * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. + * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. + (s390_pass_by_reference): Rename from + s390_function_arg_pass_by_reference. + (s390_function_arg_advance): Don't query pass-by-ref. + (s390_function_arg): Likewise. + (s390_gimplify_va_arg): Use pass_by_reference. + (s390_call_saved_register_used): Likewise. + * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. + (shcompact_byref, sh_pass_by_reference): New. + * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (SHCOMPACT_BYREF): Remove. + * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. + * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. + (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. + (sparc_gimplify_va_arg): Use pass_by_reference. + * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. + (v850_pass_by_reference): New. + * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + (FUNCTION_ARG_CALLEE_COPIES): True. + * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from + FUNCTION_ARG_PASS_BY_REFERENCE docs. + +2004-07-14 Richard Henderson + Richard Sandiford + + * config/mips/mips-protos.h (mips_va_arg): Delete. + * config/mips/mips.h (EXPAND_BUILTIN_VA_ARG): Delete. + * config/mips/mips.c: Include tree-gimple.h. + (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + (mips_arg_info): Remove special handling of must_pass_in_stck args. + (mips_gimplify_va_arg_expr): Rewritten from mips_va_arg. + (function_arg_pass_by_reference): Return true if must_pass_in_stack. + +2004-07-13 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Swap + arguments for COND_EXPR in big-endian adjustment code. + +2004-07-13 John David Anglin + + * pa-64.h (ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Delete. + * pa.h (ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Modify for hppa64. + * pa32-regs.h (REG_ALLOC_ORDER): Reorder caller-saved registers. + * pa64-regs.h (REG_ALLOC_ORDER): Likewise. + +2004-07-13 Diego Novillo + + PR tree-optimization/16443 + * tree-ssa-alias.c: Add more description for + CALL_CLOBBERED_VARS and ADDRESSABLE_VARS. + * tree-ssa-operands.c (get_asm_expr_operands): Re-order the + clobbering of call-clobbered and addressable variables. If + there are any before aliases have been computed, add them. + +2004-07-13 Diego Novillo + + * tree-optimize.c (execute_todo): Flush DUMP_FILE before + verification. + +2004-07-13 Ulrich Weigand + + * config/s390/s390.c (s390_gimplify_va_arg): Use size_int instead + of build_int_2. Convert both operands of PLUS_EXPR and MULT_EXPR + to the same type. + +2004-07-13 Per Bothner + + * collect2.c (main): Handle --no-demangle and --demangle flags. + +2004-07-13 Sebastian Pop + + * Makefile.in (OBJS-common): Add tree-data-ref.o. + (tree-scalar-evolution.o): Add missing dependences on tree-pass.h flags.h. + (tree-data-ref.o): New rule. + * lambda.h: New file. + * tree-data-ref.c: New file. + * tree-data-ref.h: New file. + * tree.c (int_cst_value, tree_fold_gcd): New functions. + * tree.h (int_cst_value, tree_fold_gcd): Declared here. + +2004-07-13 Eric Botcazou + + PR target/13926 + * config/sparc/sparc-protos.h (output_ubranch): New prototype. + * config/sparc/sparc.c (output_ubranch): New function. + * config/sparc/sparc.md (jump pattern): Use it. + +2004-07-13 Eric Botcazou + + PR target/16494 + * config/sparc/sparc.c (output_cbranch): Properly guard + the code handling far branches with TARGET_V9. + * config/sparc/sparc.md (length attribute): Document the + side-effect of having a length greater or equal to 3. + +2004-07-13 Eric Botcazou + Lloyd Parkes + + PR target/15186 + * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC_BASE): Pass + /usr/ucblib/sparcv9 as -R path when -compat-bsd is specified. + +2004-07-13 Eric Botcazou + Martin Sebor + + PR target/12602 + * doc/invoke.texi (SPARC options): Document -threads + and -pthreads on Solaris. + +2004-07-13 Richard Henderson + + * builtins.c (std_gimplify_va_arg_expr): Handle types passed + by reference. + (ind_gimplify_va_arg_expr): Remove. + * tree.h (ind_gimplify_va_arg_expr): Remove. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Don't use it. + * config/mmix/mmix.c (mmix_function_arg_pass_by_reference): Allow + argsp to be null. + + * config/arc/arc.c (arc_gimplify_va_arg_expr): Remove. + (TARGET_GIMPLIFY_VA_ARG_EXPR): Remove. + * config/cris/cris.c, config/fr30/fr30.c, config/frv/frv.c, + config/iq2000/iq2000.c, config/m32r/m32r.c, config/mmix/mmix.c, + config/mn10300/mn10300.c, config/v850/v850.c: Similarly. + +2004-07-13 Richard Henderson + + * function.c (pass_by_reference): New. + (assign_parm_find_data_types): Use it. + * calls.c (initialize_argument_information): Likewise. + (emit_library_call_value_1): Likewise. + * expr.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. + * function.h (pass_by_reference): Declare. + +2004-07-13 Richard Henderson + + * target-def.h (TARGET_MUST_PASS_IN_STACK): New. + * target.h (struct gcc_target): Add calls.must_pass_in_stack. + * expr.h (MUST_PASS_IN_STACK): Remove. + * system.h (MUST_PASS_IN_STACK): Poison. + * tree.h (must_pass_in_stack_var_size): Declare. + (must_pass_in_stack_var_size_or_pad): Declare. + * calls.c (must_pass_in_stack_var_size): New. + (must_pass_in_stack_var_size_or_pad): Rename from + default_must_pass_in_stack. + * config/alpha/alpha.c (unicosmk_must_pass_in_stack): New. + (TARGET_MUST_PASS_IN_STACK): New. + * config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove. + * config/fr30/fr30.c (fr30_must_pass_in_stack): New. + (TARGET_MUST_PASS_IN_STACK): New. + * config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove. + * config/frv/frv.c (frv_must_pass_in_stack): New. + (TARGET_MUST_PASS_IN_STACK): New. + * config/frv/frv.h (MUST_PASS_IN_STACK): Remove. + * config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove. + * config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New. + (ix86_must_pass_in_stack): Make static. + * config/i386/i386.h (MUST_PASS_IN_STACK): Remove. + * config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New. + * config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove. + * config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New. + * config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove. + * config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove. + * config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New. + (mcore_must_pass_on_stack): Remove. + * config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove. + * config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New. + * config/mips/mips.h (MUST_PASS_IN_STACK): Remove. + * config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New. + * config/pa/pa.h (MUST_PASS_IN_STACK): Remove. + * config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove. + * config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove. + * config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New. + (TARGET_MUST_PASS_IN_STACK): New. + * config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New. + * config/sh/sh.h (MUST_PASS_IN_STACK): Remove. + * config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New. + * config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove. + * config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New. + * config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove. + * doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from + MUST_PASS_IN_STACK. + + * calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h, + config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c, + config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h, + config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c, + config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, + config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, + config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, + config/xtensa/xtensa.c: Use target hook. + +2004-07-13 Anthony Heading + + * configure.ac (gcc_cv_as_offsetable_lo10): Fix a typo. + * configure: Rebuilt. + +2004-07-13 Richard Sandiford + + * doc/invoke.texi: Remove documentation for MIPS -mrnames option. + * config/mips/mips.h (mips_reg_names): Don't declare. + (MASK_NAME_REGS): Delete. Shuffle other MASK_* values down. + (TARGET_NAME_REGS): Delete. + (TARGET_SWITCHES): Remove -mrnames. + (REGISTER_NAMES): Initialise with the old contents of mips_reg_names[]. + (ADDITIONAL_REGISTER_NAMES): Remove entries for names mentioned + in REGISTER_NAMES. + * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Delete. + (override_options): Remove handling of TARGET_NAME_REGS. + +2004-07-13 Richard Sandiford + + * config/mips/mips.h (TARGET_*): Boolify. + +2004-07-12 Nick Clifton + + * config.gcc: Add sh-*-symbianelf target. + * config/sh/sh.c: Add new target macros: + TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING, + TARGET_CXX_IMPORT_EXPORT_CLASS. + (sh_file_start): Create a definition of the .directive section. + (sh_attribute): Add dllimport and dllexport attributes. + * config/sh/symbian-pre.h: New file. + * config/sh/symbian-post.h: New file. + * config/sh/symbian.c: New file. Contains Symbian specific + functions. + * config/sh/sh-protos.h: Add prototypes for new functions + provided by symbian.c. + * config/sh/t-symbian: New file. + * doc/extend.texi: Document support for dllimport and dllexport + attributes by the sh-symbianelf target. + +2004-07-12 James E Wilson + + * Makefile.in (AR): Use @AR@ not ar. + (NM): New. + (AR_FOR_TARGET): Use $(AR) not ar for native. + (NM_FOR_TARGET): Use $(NM) not nm for native. + * configure.ac: Add AC_CHECK_PROG calls for NM and AR. + * configure: Regenerate. + +2004-07-12 David S. Miller + + * config/sparc/sparc.md (ashlsi3): Eliminate const 1 + special case. + (ashldi3_sp64): Likewise. + +2004-07-12 John David Anglin + + PR target/16477 + * pa.c (function_arg): Update comment. + * pa.h (BLOCK_REG_PADDING): Define. + +2004-07-12 Zdenek Dvorak + + PR tree-optimization/16461 + * tree-tailcall.c (independent_of_stmt_p): Handle non-SSA name + arguments of phi nodes. + +2004-07-12 Devang Patel + + * doc/invoke.texi (Darwin Options): Document -gused and -gfull. + +2004-07-12 Steve Ellcey + + * function.c (expand_function_start): Ensure r_save is in Pmode. + * calls.c (prepare_call_address): Ensure static_chain_value is + in Pmode. + * builtins.c (expand_builtin_nonlocal_goto): Ensure r_label and + r_save_area are in Pmode. + * config/ia64/ia64.c (ia64_initialize_trampoline): Ensure addr, + fnaddr, and static_chain are in Pmode. + +2004-07-12 Vladimir Makarov + + PR target/16445 + * config/ia64/ia64.c (bundling): Don't count ignored insns. + +2004-07-12 Richard Henderson + + * target.h (struct gcc_target): Move gimplify_va_arg_expr + next to build_builtin_va_list. + * target-def.h (TARGET_GIMPLIFY_VA_ARG_EXPR): Update to match. + * builtins.c (gimplify_va_arg_expr): Likewise. + * gimplify.c (copy_if_shared_r): Likewise. + +2004-07-12 Alexandre Oliva + + * passes.c (rest_of_decl_compilation): Don't defer call of + assemble_variable if its DECL_RTL is already set. + +2004-07-12 Sebastian Pop + + * cfgloop.h (struct loop): Add nb_iterations field. + (current_loops): Declare. + * tree-chrec.c (chrec_not_analyzed_yet, + chrec_dont_know, chrec_known, count_ev_in_wider_type, + chrec_contains_symbols_defined_in_loop): Remove the temporary + hooks. + * tree-flow-inline.h (loop_containing_stmt): New function. + * tree-scalar-evolution.c: Add implementation. + * tree-scalar-evolution.h: Add declarations. + +2004-07-12 Vladimir Makarov + + PR rtl-optimization/15921 + * Makefile.in (global.o): Add recog.h. + + * global.c (recog.h): Add the include-clause. + (bb_info): New member earlyclobber. + (allocate_bb_info, free_bb_info): Initialize/finish the new + member. + (earlyclobber_regclass, earlyclobber_regclass_length): The new + global variables. + (check_earlyclobber, regclass_intersect, + mark_reg_use_for_earlyclobber, mark_reg_use_for_earlyclobber_1): + New functions. + (calculate_local_reg_bb_info): Calculate value of earlyclobber. + (make_accurate_live_analysis): Modify pavin. + +2004-07-12 Diego Novillo + + * tree-cfg.c (find_taken_edge): Statically compute the truth + value of a predicate comparing an SSA_NAME to itself. + +2004-07-12 Roger Sayle + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Indicate that the + rs6000 doesn't have shift-and-add or shift-and-sub instructions + by returning the cost of a multiplication plus an addition. + +2004-07-12 Paolo Bonzini + + PR tree-optimization/14107 + * gimplify.c (gimplify_return_expr): Accept a + RETURN_EXPR with an error argument. + * tree-optimize.c (init_tree_optimization_passes): + Run pass_warn_function_return at -O0. + +2004-07-12 Roger Sayle + + * doc/invoke.texi: Correct -fasynchronous-unwind-tables option + index entry. + +2004-07-12 Richard Sandiford + + * config/mips/mips.c (mips_use_dfa_pipeline_interface): Delete. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/mips/3000.md: Add copyright notice. Remove automota and + function units; use generic ones instead. Only define reservations + for things that are different from generic.md. Extend each clause + to include r3900. + * config/mips/{4000,4100,4300,4600,5000,6000,generic}.md: New files. + * config/mips/mips.md: Include them. Remove define_function_units. + (alu, imuldiv): New automata and units. + +2004-07-12 Ben Elliston + + * doc/invoke.texi (Optimize Options): Document -frename-registers + not being enabled by default at -O3. + +2004-07-11 Roger Sayle + + * fold-const.c (fold) : Canonicalize X + -C as X - C for + floating point additions, to keep real immediate constant positive. + : For floating point subtractions, only transform X - -C + into X + C, and leave positive real constants as X - C. + +2004-07-11 John David Anglin + + * pa.c (hppa_gimplify_va_arg_expr): Remove comment. + +2004-07-11 Zdenek Dvorak + + PR tree-optimization/15654 + * tree-tailcall.c (eliminate_tail_call): Remove unreachable code. + +2004-07-11 Roger Sayle + + * builtins.c (fold_builtin_fputs): Don't bother converting the + return type to integer_type_node, as we've already checked that + the result will be ignored. + + * tree-eh.c (tree_could_trap_p): Add support for -ftrapv such + that signed addition, subtraction, multiplication, division, + remainder, negation and absolute value may potentially trap. + + * fold-const.c (fold_ignored_result): New function to strip + non-side-effecting tree nodes from an expression whose result + is ignored. + (fold_convert): Call fold_ignored_result when casting a value + to VOID_TYPE. + (omit_one_operand): Call fold_ignored_result on the "omitted" + operand when building a COMPOUND_EXPR. + (pedantic_omit_one_operand): Likewise. + * tree.h (fold_ignored_result): Prototype here. + * tree-ssa-ccp.c (ccp_fold_builtin): Call fold_ignored_result + when we're going to ignore the result. + +2004-07-11 Richard Henderson + + PR tree-opt/16383 + * tree-ssa-ccp.c (fold_stmt_r): Split out... + * tree.c (fields_compatible_p, find_compatible_field): ... new. + * tree.h (fields_compatible_p, find_compatible_field): Declare. + * tree-sra.c (sra_hash_tree): Hash fields by offset. + (sra_elt_eq): Use fields_compatible_p. + (generate_one_element_ref): Use find_compatible_field. + +2004-07-11 Richard Henderson + + PR tree-opt/16422 + * tree-sra.c (generate_one_element_init): New. + (generate_element_init): Use it. + (scalarize_init): Push/pop gimplify context around it. + (find_new_referenced_vars_1, find_new_referenced_vars): New. + * gimplify.c (gimplify_expr): Allow SSA_NAME. + +2004-07-11 Roger Sayle + + * rtlanal.c (insn_rtx_cost): New function, moved and renamed from + combine.c's combine_insn_cost. + * rtl.h (insn_rtx_cost): Prototype here. + * combine.c (combine_insn_cost): Delete function. + (combine_validate_cost): Update callers of combine_insn_cost to + call insn_rtx_cost instead. + (combine_instructions): Likewise. Use NONJUMP_INSN_P to avoid + requesting the rtx_cost of call and/or jump instructions. + + * ifcvt.c (total_bb_rtx_cost): Use insn_rtx_cost instead of calling + rtx_cost directly. Don't request/use the cost of call or jump + instructions. Return -1 if the cost of any instruction can't be + determined (or the BB contains a function call). + (find_if_case_1): Abort transformation if total_bb_rtx_cost returns + -1 (i.e. can't determine the cost of any instruction or the basic + block contains a subroutine call). + (find_if_case_2): Likewise. + +2004-07-11 Roger Sayle + + * rs6000.c (struct processor_costs): Change semantics of fields to + include the COST_N_INSNS scaling, and update all initializers. + (rs6000_rtx_costs): Don't use COSTS_N_INSNS on rs6000_cost fields. + Use COSTS_N_INSNS(1) for NOT, SIGN_EXTEND, ZERO_EXTEND and COMPARE. + Use rs6000_cost->fp for both FLOAT_TRUNCATE and UNSPEC_FRSP. When + optimizing for size, use COSTS_N_INSNS(1) for CALL and IF_THEN_ELSE. + +2004-07-11 Joseph S. Myers + + * LANGUAGES: Remove obsolete information. + +2004-07-11 Ulrich Weigand + + * config/s390/linux.h (MD_FALLBACK_FRAME_STATE_FOR): For SIGSEGV and + SIGBUS signal frames, the PSW address points *to* the faulting + instruction, not after it. + +2004-07-11 Ulrich Weigand + + * config/s390/s390.c (legitimize_tls_address): Handle constant offsets + added to TLS symbol addresses. + +2004-07-11 Richard Henderson + + * expmed.c (init_expmed): Use stack-local structures for + temporary rtl. Don't recognize shifts. + +2004-07-11 Richard Henderson + + * expr.c (store_expr): Don't fiddle subreg promotion for types + with precision smaller than the mode. + +2004-07-11 Joseph S. Myers + + * tree.h (all_types_permanent): Remove. + +2004-07-11 Joseph S. Myers + + * langhooks.h (estimate_num_insns, pushlevel, poplevel, set_block, + maybe_build_cleanup, update_decl_after_saving): Remove hooks. + * langhooks.c (lhd_clear_binding_stack): Remove. + * langhooks-def.h (lhd_clear_binding_stack, + LANG_HOOKS_MAYBE_BUILD_CLEANUP, + LANG_HOOKS_UPDATE_DECL_AFTER_SAVING, + LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, LANG_HOOKS_PUSHLEVEL, + LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove. + (LANG_HOOKS_CLEAR_BINDING_STACK): Define to lhd_do_nothing. + * system.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, + LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_SET_BLOCK, + LANG_HOOKS_MAYBE_BUILD_CLEANUP, + LANG_HOOKS_UPDATE_DECL_AFTER_SAVING, LANG_HOOKS_POPLEVEL): Poison. + * tree.h (poplevel): Don't declare. + * c-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL, + LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove. + * objc/objc-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, + LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): + Remove. + +2004-07-11 Joseph S. Myers + + PR tree-optimization/16437 + * c-common.c (shorten_compare): Don't mark result of conversion to + narrower signed type as overflowing. + * fold-const.c (decode_field_reference): Determine whether + signedness comes from outer type using precision rather than size. + +2004-07-11 Phil Edwards + + * configure.ac: Alphabetize --enable-checking list, add + missing valgrind entry. + * configure: Regenerate. + +2004-07-11 Phil Edwards + + * doc/install.texi (Testing): Fix syntax in "make check" example. + +2004-07-10 James E Wilson + + * config/gofast.h (gofast_maybe_init_libfuncs): Use SImode for litodp. + +2004-07-10 Zdenek Dvorak + + PR rtl-optimization/16001 + * loop-iv.c (iv_number_of_iterations): Prevent copy propagation in + niter_expr. + +2004-07-10 Geoffrey Keating + + * config/darwin.h (LINK_COMMAND_SPEC): Don't call c++filt. + +2004-07-10 Steve Kargl + James Morrison + + * doc/contrib.texi (Contributors): Add gfortran contributors and + fix a couple of typos. + +2004-07-10 Zdenek Dvorak + + PR rtl-optimization/15387 + * calls.c (check_sibcall_argument_overlap_1): Handle pointers + to incoming args space correctly. + +2004-07-10 John David Anglin + + * pa.c (output_indirect_call): Only use %r2 as the link register in + indirect calls with the long PA 2.0 pc-relative branch. + +2004-07-10 Daniel Jacobowitz + + * config/i386/i386.c (override_options): Pick a 64-bit CPU + for the default tuning if TARGET_64BIT. + +2004-07-10 Richard Henderson + + * builtins.c (std_gimplify_va_arg_expr): Widen align/boundary + to HOST_WIDE_INT. Fold pad-args-down arithmetic. + +2004-07-10 Jakub Jelinek + + * expr.h (store_bit_field, extract_bit_field): Remove last argument. + * expmed.c (store_bit_field, extract_bit_field): Remove last + argument. + * builtins.c (expand_builtin_signbit): Adjust callers. + * optabs.c (expand_vector_binop, expand_vector_unop): Likewise. + * calls.c (store_unaligned_arguments_into_pseudos): Likewise. + * ifcvt.c (noce_emit_move_insn): Likewise. + * stmt.c (expand_return): Likewise. + * expr.c (emit_group_load, emit_group_store, copy_blkmode_from_reg, + store_field, expand_expr_real_1): Likewise. + +2004-07-10 Richard Henderson + + * builtins.c (std_gimplify_va_arg_expr): Fix borked BIT_AND_EXPR. + +2004-07-09 Mike Stump + + * config/darwin.c (no_dead_strip): Add. + (HAVE_DEAD_STRIP): Add. + (darwin_emit_unwind_label): Ensure that we don't dead code strip + the .eh label. + +2004-07-09 Zdenek Dvorak + + * tree-ssa-loop-im.c: New file. + * Makefile.in (tree-ssa-loop-im.o): Add. + * cfgloop.c (superloop_at_depth): New function. + * cfgloop.h (superloop_at_depth): Declare. + * common.opt (ftree-lim): New flag. + * expr.c (array_ref_up_bound): New function. + * params.def (PARAM_LIM_EXPENSIVE): New parameter. + * timevar.def (TV_LIM): New timevar. + * tree-dfa.c (compute_immediate_uses): Respect TDFA_USE flags when + computing immediate uses of a phi node. + * tree-flow.h (struct tree_ann_common_d): Add aux field. + (loop_commit_inserts, for_each_index, tree_ssa_lim): Declare. + * tree-optimize.c (init_tree_optimization_passes): Add pass_lim. + * tree-pass.h (pass_lim): Declare. + * tree-ssa-loop.c (tree_ssa_loop_im, gate_tree_ssa_loop_im): New + functions. + (pass_lim): New pass structure. + * tree-eh.c (tree_could_trap_p): Handle ARRAY_REFs correctly. + * tree.c (in_array_bounds_p): New function. + * tree.h (TREE_THIS_NOTRAP): Define also for ARRAY_REFs. + (in_array_bounds_p, array_ref_up_bound): Declare. + * doc/invoke.texi (-ftree-lim, --param lim-expensive): Document. + * doc/passes.texi (tree-ssa-loop-im.c): Document. + +2004-07-09 Richard Henderson + + * builtins.c (expand_builtin_stpcpy): Don't modify len. + + * tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs + with prejudice. + +2004-07-10 Kelley Cook + + * flags.h: Delete redundant prototypes that are being generated + in options.h from common.opt. + * common.opt: Add in the expository comments formerly in flags.h. + +2004-07-09 Jan Beulich + + * config/i386/i386.c (init_cumulative_args): Set mmx/sse registers + available for use only when TARGET_MMX/_SSE is set, and check for + variable argument function if any register count is non-zero. + (function_arg): Correctly suppress repeated warnings for passing SSE + vectors are arguments without SSE enabled. + (ix86_function_arg_boundary): Without SSE enabled, the use of what + would be SSE register modes does no longer influence the alignment. + +2004-07-09 Richard Henderson + + * builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD. + Always align upward to arg boundary. Use size_in_bytes/round_up. + Maintain type-correctness of constants. + * stor-layout.c (round_up, round_down): Special-case powers of 2. + +2004-07-09 David S. Miller + + * config/sparc/sparc.c (*_costs): Scale instruction costs + by COSTS_N_INSNS. + (sparc_rtx_costs): Adjust as appropriate. + +2004-07-09 Jan Beulich + + * config/i386/mm3dnow.h: New. + * config.gcc: Add mm3dnow.h to extra_headers for i?86 and x86-64. + +2004-07-09 Richard Henderson + + * simplify-rtx.c (simplify_const_relational_operation): Only + look at bounds of scalar integers. + +2004-07-09 Jan Beulich + + * config/i386/i386.md (sse2_clflush): Use correct operand for clflush. + +2004-07-09 Andrew Pinski + + * objc/objc-act.c (build_module_descriptor): Mark UOBJC_MODULES_decl as + always referenced. + (synth_forward_declarations): Likewise for UOBJC_CLASS_decl and + UOBJC_METACLASS_decl. + +2004-07-09 James E Wilson + + PR target/16364 + * config/ia64/ia64.c (ia64_function_arg): For a single element HFA, + do return a parallel if hfa_mode == XFmode and mode == TImode. + +2004-07-09 Jan Beulich + + * c-typeck.c (build_unary_op): include VECTOR_TYPE in set of codes + permissible for unary plus. + +2004-07-09 Jan Beulich + + * builtin-types.def (BT_UINT): Rename from BT_UNSIGNED. + (BT_FN_UINT): Rename from BT_FN_UNSIGNED. + (BT_FN_PTR_UINT): Rename from BT_FN_PTR_UNSIGNED. + (BT_ULONG, BT_ULONGLONG, BT_UINTMAX, BT_FN_INT_UINT, BT_FN_INT_ULONG, + BT_FN_INT_ULONGLONG, BT_FN_INT_INTMAX, BT_FN_INT_UINTMAX): New. + * builtins.def (BUILTIN_CLZxxx, BUILTIN_CTXxxx, BUILTIN_PARITYxxx, + BUILTIN_POPCOUNTxxx): Arguments are unsigned. + (BUILTIN_xxxIMAX): New. + * builtins.c (expand_builtin): Handle BUILT_IN_FFSIMAX, + BUILT_IN_CLZIMAX, BUILT_IN_CTZIMAX, BUILT_IN_POPCOUNIMAX, and + BUILT_IN_PARITYIMAX. + +2004-07-09 David S. Miller + + * config/sparc/sparc.h (processor_costs): Define. + (sparc_costs): Declare. + * config/sparc/sparc.c (cypress_costs, supersparc_costs, + hypersparc_costs, sparclet_costs, ultrasparc_costs, + ultrasparc3_costs): New. + (sparc_override_options): Set sparc_costs as appropriate. + (sparc_rtx_costs): Use sparc_costs instead of messy + conditionals. + +2004-07-09 Steven Bosscher + + * doc/md.texi (Processor pipeline description): Mention that + the old pipeline description is deprecated. + + * config/rs6000/7450.md (automaton ppc7450): Split up, move + mciu_7450 function unit to... + (automaton ppc7450mciu): ...new automaton. + + * haifa-sched.c (insert_schedule_bubbles_p): Remove. + (schedule_block): Don't consider inserting bubbles. + (sched_init): Don't initialize DFA bubbles. + * target-def.h (TARGET_SCHED_INIT_DFA_BUBBLES, + TARGET_SCHED_DFA_BUBBLE): Remove. + * target.h (init_dfa_bubbles, dfa_bubble): Remove hooks. + * doc/tm.texi (TARGET_SCHED_INIT_DFA_BUBBLES, + TARGET_SCHED_DFA_BUBBLE): Remove documentation. + + * stmt.c (conditional_context): Remove prototype. + * tree.h (conditional_context): Remove. + * tree-cfg.c (pre_insert_on_edge): Remove. + + * c-common.h (c_expand_asm_operands): Remove prototype. + * c-typeck.c (c_expand_asm_operands): Remove. + +2004-07-09 Jan Beulich + + * config/i386/i386.c (classify_argument): Treat V1xx modes the same as + their base modes. CTImode, TCmode, and XCmode must be passed in memory. + TFmode (__float128) must be is an SSE/SSEUP pair. V2SImode, V4HImode, + and V8QI are class SSE. All sufficiently small remaining vector modes + must be passed in one or two integer registers. + (ix86_libcall_value): TFmode must be returned in xmm0, XCmode must be + returned in memory. + (bdesc_2arg, ix86_init_mmx_sse_builtins): __builtin_ia32_pmuludq and + __builtin_ia32_pmuludq128 have non-uniform argument and return types + and must thus be handled explicitly. + * config/i386/i386.md (*movdi_1_rex64): Add cases for moving between + MMX and XMM regs. + (movv8qi_internal, movv4hi_internal, movv2si_internal, + movv2sf_internal): Permit moving between MMX and XMM registers (since + MMX areguments and return values are passed in XMM registers). + (sse2_umulsidi3): Correct type and mode. + +2004-07-09 Richard Henderson + + * tree-cfg.c (dump_cfg_stats): Fix 64-bit format mismatch errors. + +2004-07-09 Eric Christopher + + * config/rs6000/40x.md: Split into two automatons. + +2004-07-09 Zack Weinberg + Andrew Pinski + + * c-opts.c (c_common_post_options): Force unit-at-a-time mode + on when we have more than one input file. + (c_common_parse_file): Restore loop over all input files. + Clarify diagnostic for -dy when YYDEBUG wasn't defined. + + * c-decl.c (set_type_context): New function. + (pop_scope): Use it to set context of types. When we + encounter a TYPE_DECL, set the context of the attached type too. + (pop_file_scope): Don't call cpp_undef_all here. + (diagnose_mismatched_decls): Do not complain about a second + definition of an 'extern inline' function if it's not in the + same translation unit. Do not complain about inline + declaration after use if the use was in a different + translation unit. + (merge_decls): Don't clobber olddecl's DECL_CONTEXT. + (pushdecl): Do not put DECL_EXTERNAL, !TREE_PUBLIC decls in + the external scope. + (pushdecl_top_level): Likewise. + (grokdeclarator): Clarify what is going on with setting + DECL_EXTERNAL on function types, a little. + (c_write_global_declarations): Don't do anything if + -fsyntax-only or errors have been encountered. + +2004-07-09 Zack Weinberg + + * vec.c, vec.h (vec_assert_fail): Use unsigned int for LINE argument. + +2004-07-09 John David Anglin + + PR target/16459 + * pa.c (output_indirect_call): Use %r2 as the link register when + calling $$dyncall with a pc-relative branch. + +2004-07-08 Gerald Pfeifer + + * doc/install.texi (Binaries): Mention OpenPKG. + +2004-07-09 Diego Novillo + + Fix PR tree-optimization/15555 + * tree-dfa.c (dump_variable): If the variable is a pointer + SSA_NAME, also dump its points-to information. + * tree-flow.h (struct ptr_info_def): Add field + is_dereferenced. + (dump_points_to_info_for): Declare. + (debug_points_to_info_for): Declare. + * tree-optimize.c (init_tree_optimization_passes): Add a + second alias analysis pass after DOM2. + Move pass_del_pta to a later spot. + * tree-ssa-alias.c (compute_points_to_and_addr_escape): Do not + create a name tags when we find a dereferenced pointer. Just + mark the pointer dereferenced. + (collect_points_to_info_for): Move code to clear points-to + information to create_name_tags. + (create_name_tags): New function. + (compute_flow_sensitive_aliasing): Call it. + (setup_pointers_and_addressables): Mark type tags for renaming + here instead of ... + (create_memory_tag): ... here. + (merge_pointed_to_info): Do not merge PT_MALLOC attributes. + (dump_points_to_info_for): Declare extern. + (debug_points_to_info_for): New function. + +2004-07-09 Paolo Bonzini + + * config/arc/arc.md: Switch to DFA-based scheduler description. + * config/arc/arc.c: Switch to DFA-based scheduler description. + +2004-07-09 Richard Earnshaw + + * arm/unknown-elf.h (TARGET_DEFAULT): Don't require an APCS frame + pointer. + +2004-07-09 Richard Henderson + + * config/xtensa/xtensa-protos.h (xtensa_va_arg): Remove. + * config/xtensa/xtensa.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (xtensa_gimplify_va_arg_expr): Rewrite from xtensa_va_arg. + * config/xtensa/xtensa.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/v850/v850-protos.h (v850_va_arg): Remove. + * config/v850/v850.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (v850_gimplify_va_arg_expr): Rewrite from v850_va_arg. + * config/v850/v850.h (EXPAND_BUILTIN_VA_ARG): Remove. + (FUNCTION_ARG_PASS_BY_REFERENCE): Handle variable size types. + (FUNCTION_ARG_CALLEE_COPIES): Use FUNCTION_ARG_PASS_BY_REFERENCE. + +2004-07-09 Richard Earnshaw + + PR target/12133 + * arm.c (arm_legitimate_index_p) Allow DFmode for soft-float + and DImode to use +/-4k offset. + +2004-07-09 Richard Henderson + + * config/stormy16/stormy16-protos.h (xstormy16_expand_builtin_va_arg): + Remove. + * config/stormy16/stormy16.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (xstormy16_gimplify_va_arg_expr): Rewrite from + xstormy16_expand_builtin_va_arg. + * config/stormy16/stormy16.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/sparc/sparc-protos.h (sparc_va_arg): Remove. + * config/sparc/sparc.c (sparc_gimplify_va_arg): Mark static. + + * config/sh/sh-protos.h (sh_va_arg): Remove. + * config/sh/sh.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (sh_gimplify_va_arg_expr): Rewrite from sh_va_arg. + * config/sh/sh.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/pa/pa-protos.h (hppa_va_arg): Remove. + * config/pa/pa.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (hppa_gimplify_va_arg_expr): Rewrite from hppa_va_arg. + * config/pa/pa.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/mn10300/mn10300-protos.h (mn10300_va_arg): Remove. + * config/mn10300/mn10300.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (mn10300_gimplify_va_arg_expr): Rewrite from mn10300_va_arg. + * config/mn10300/mn10300.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-09 Eric Botcazou + + * config/sparc/sparc.md (return): Rewrite length formula. + * config/sparc/sparc.c (output_return): Pass 1 as 5th + argument to final_scan_insn when in a delay slot. + (output_sibcall): Likewise. + +2004-07-09 Richard Earnshaw + + * arm.c (arm_cpp_interwork): New variable. + (arm_override_options): Set it if TARGET_INTERWORK was on the command + line. + * arm.h (arm_cpp_interwork): Declare it. + (TARGET_CPU_CPP_BUILTINS): Use it to control definition of + __THUMB_INTERWORK__ in the preprocessor. + +2004-07-09 Nathan Sidwell + + * vec.h (VEC_T_alloc): Fix MEM_STAT_DECL pasto. + +2004-07-09 Eric Botcazou + + PR target/16416 + * config/sparc/sol2-bi.h (OPTION_DEFAULT_SPECS): New macro. + Override default settings to account for -m32 and -m64. + +2004-07-08 Randolph Chung + + * pa32-linux.h (MD_FALLBACK_FRAME_STATE_FOR): Define. + +2004-07-09 Alexandre Oliva + + * builtins.c (fold_builtin_strncpy): Make sure len is a constant + before comparing it as such. + +2004-07-08 Richard Henderson + + * builtins.c (std_gimplify_va_arg_expr): Hoist valist into a + temporary. Use bit arithmetic to align. + +2004-07-08 Jerry Quinn + + * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, + nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, + NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. + * bb-reorder.c (mark_bb_for_unlikely_executed_section, + add_labels_and_missing_jumps, find_jump_block, + fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): + Likewise. + * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, + link_btr_uses, move_btr_def): Likewise. + * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, + expand_builtin_expect_jump): Likewise. + * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. + * calls.c (expand_call, emit_library_call_value_1): Likewise. + * cfganal.c (forwarder_block_p): Likewise. + * cfgbuild.c (inside_basic_block_p, count_basic_blocks, + make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, + find_bb_boundaries): Likewise. + * cfgcleanup.c (try_simplify_condjump, try_forward_edges, + merge_blocks_move_predecessor_nojumps, + merge_blocks_move_successor_nojumps, insns_match_p, + flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, + try_optimize_cfg): Likewise. + * cfgexpand.c (expand_block, construct_exit_block): Likewise. + * cfglayout.c (skip_insns_after_block, label_for_bb, + record_effective_endpoints, insn_locators_initialize, + fixup_reorder_chain, update_unlikely_executed_notes): Likewise. + * cfgmainloop.c (create_loop_notes): Likewise. + * cfgrtl.c (delete_insn, delete_insn_chain, + create_basic_block_structure, rtl_delete_block, free_bb_for_insn, + update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, + block_label, try_redirect_by_replacing_jump, last_loop_beg_note, + redirect_branch_edge, force_nonfallthru_and_redirect, + rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, + rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, + update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, + purge_dead_edges, cfg_layout_redirect_edge_and_branch, + cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, + cfg_layout_merge_blocks, rtl_block_ends_with_call_p, + need_fake_edge_p, rtl_flow_call_edges_add): Likewise. + * combine.c (combine_instructions, can_combine_p, try_combine, + find_split_point, record_dead_and_set_regs, reg_dead_at_p, + distribute_notes, distribute_links, insn_cuid): Likewise. + * cse.c (fold_rtx, cse_insn, cse_around_loop, + invalidate_skipped_block, cse_set_around_loop, + cse_end_of_basic_block, cse_main, cse_basic_block, + cse_condition_code_reg): Likewise. + * cselib.c (cselib_process_insn): Likewise. + * ddg.c (create_ddg): Likewise. + * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): + Likewise. + * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, + gen_label_die, dwarf2out_var_location): Likewise. + * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, + next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, + last_call_insn, active_insn_p, next_label, prev_label, + link_cc0_insns, next_cc0_user, try_split, add_insn_after, + add_insn_before, remove_insn, add_function_usage_to, + reorder_insns, find_line_note, remove_unnecessary_notes, + emit_insn_after_1, classify_insn): Likewise. + * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, + connect_post_landing_pads, sjlj_mark_call_sites, + sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, + can_throw_internal, can_throw_external, set_nothrow_function_flags, + convert_to_eh_region_ranges): Likewise. + * explow.c (optimize_save_area_alloca): Likewise. + * expr.c (expand_expr_real): Likewise. + * final.c (insn_current_reference_address, compute_alignments, + shorten_branches, final, scan_ahead_for_unlikely_executed_note, + final_scan_insn, output_asm_label, leaf_function_p): Likewise. + * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, + propagate_block_delete_insn, propagate_one_insn, + init_propagate_block_info, propagate_block, libcall_dead_p, + mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): + Likewise. + * function.c (instantiate_virtual_regs, reorder_blocks_1, + expand_function_start, expand_function_end, contains, + thread_prologue_and_epilogue_insns, + reposition_prologue_and_epilogue_notes): Likewise. + * gcse.c (constprop_register, bypass_conditional_jumps, + insert_insn_end_bb, gcse_after_reload): Likewise. + * genemit.c (gen_expand, gen_split): Likewise. + * genpeep.c (gen_peephole, main): Likewise. + * global.c (build_insn_chain): Likewise. + * graph.c (node_data, print_rtl_graph_with_bb): Likewise. + * haifa-sched.c (unlink_other_notes, unlink_line_notes, + get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, + restore_line_notes, rm_redundant_line_notes, rm_other_notes, + ok_for_early_queue_removal, set_priorities, sched_init): Likewise. + * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, + cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, + merge_if_block, block_jumps_and_fallthru_p, find_if_block, + dead_or_predicable): Likewise. + * integrate.c (try_constants): Likewise. + * jump.c (rebuild_jump_labels, cleanup_barriers, + purge_line_number_notes, init_label_info, mark_all_labels, + squeeze_notes, get_label_before, get_label_after, + reversed_comparison_code_parts, simplejump_p, pc_set, + returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, + delete_barrier, delete_prior_computation, delete_computation, + delete_related_insns, delete_for_peephole, redirect_jump): + Likewise. + * lcm.c (optimize_mode_switching): Likewise. + * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): + Likewise. + * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. + * loop-invariant.c (find_exits, find_invariants_bb): Likewise. + * loop-iv.c (simplify_using_assignment): Likewise. + * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, + libcall_benefit, skip_consec_insns, move_movables, prescan_loop, + find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, + loop_bivs_init_find, strength_reduce, check_insn_for_bivs, + check_insn_for_givs, check_final_value, update_giv_derive, + basic_induction_var, product_cheap_p, check_dbra_loop, + loop_insn_first_p, last_use_this_basic_block, + canonicalize_condition, get_condition, loop_regs_scan, load_mems, + try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. + * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, + sms_schedule_by_order): Likewise. + * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. + * postreload.c (reload_cse_simplify_operands, reload_combine, + reload_cse_move2add): Likewise. + * predict.c (can_predict_insn_p, estimate_probability, + expected_value_to_br_prob, process_note_predictions): Likewise. + * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. + * profile.c (branch_prob): Likewise. + * ra-build.c (live_out_1, livethrough_conflicts_bb, + detect_webs_set_in_cond_jump): Likewise. + * ra-debug.c (ra_print_rtx_object, ra_debug_insns, + ra_print_rtl_with_bb): Likewise. + * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. + * recog.c (next_insn_tests_no_inequality, find_single_use, + split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. + * reg-stack.c (next_flags_user, record_label_references, + emit_swap_insn, swap_rtx_condition, subst_stack_regs, + compensate_edge, convert_regs_1): Likewise. + * regclass.c (scan_one_insn): Likewise. + * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, + regmove_optimize, fixup_match_1, single_set_for_csa, + combine_stack_adjustments_for_block): Likewise. + * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. + * reload.c (find_reloads, find_reloads_address_1, subst_reloads, + find_equiv_reg): Likewise. + * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, + reload_as_needed, emit_input_reload_insns, do_output_reload, + delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): + Likewise. + * reorg.c (find_end_label, emit_delay_sequence, + delete_from_delay_slot, delete_scheduled_jump, optimize_skip, + get_jump_flags, rare_destination, mostly_true_jump, + try_merge_delay_insns, redundant_insn, own_thread_p, + fill_simple_delay_slots, fill_slots_from_thread, + fill_eager_delay_slots, relax_delay_slots, make_return_insns, + dbr_schedule): Likewise. + * resource.c (find_basic_block, next_insn_no_annul, + find_dead_or_set_registers, mark_target_live_regs): Likewise. + * rtl.h (RTX_PREV): Likewise. + * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, + no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, + reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, + find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, + tablejump_p, computed_jump_p, insns_safe_to_move_p, + find_first_parameter_load, can_hoist_insn_p): Likewise. + * sched-deps.c (get_condition, add_dependence, sched_analyze_2, + sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. + * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, + schedule_ebbs): Likewise. + * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, + is_conditionally_protected, can_schedule_ready_p, + add_branch_dependences, debug_dependencies): Likewise. + * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): + Likewise. + * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, + reg_dead_after_loop, loop_find_equiv_value, loop_iterations, + set_dominates_use, ujump_to_loop_cont): Likewise. + * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. + * varasm.c (output_constant_pool_1): Likewise. + +2004-07-08 Zdenek Dvorak + + * tree-scalar-evolution.c: New file. + * tree-scalar-evolution.h: New file. + * tree-ssa-loop-niter.c: New file. + * Makefile.in (SCEV_H): New. + (tree-scalar-evolution.o, tree-ssa-loop-niter.o): Add new files. + * cfgloop.h (struct loop): Add bounds field. + * tree-flow.h (struct tree_niter_desc): New type. + (number_of_iterations_cond, number_of_iterations_exit, + loop_niter_by_eval, find_loop_niter_by_eval, + estimate_numbers_of_iterations, can_count_iv_in_wider_type, + free_numbers_of_iterations_estimates): Declare. + * tree.h (lower_bound_in_type, upper_bound_in_type): Declare. + * params.def (PARAM_MAX_ITERATIONS_TO_TRACK): New parameter. + * doc/invoke.texi (max-iterations-to-track): Document. + +2004-07-08 Kaz Kojima + + * config/sh/sh.c (sh_va_arg): Initinalize lab_over. + * config/sh/sh.h (CONST_OK_FOR_J16): Use parentheses. + (MODE_AFTER): Add cast appropriately. + * config/sh/sh.md (movdi splitter): Likewise. + (casesi_worker_2): Add const qualifier appropriately. + (eh_return): Remove unused variable. + (insv): Initialize v; + +2004-07-08 Richard Henderson + + * config/mmix/mmix-protos.h (mmix_expand_builtin_va_arg): Remove. + * config/mmix/mmix.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (mmix_gimplify_va_arg_expr): Rewrite from mmix_expand_builtin_va_arg. + * config/mmix/mmix.h (EXPAND_BUILTIN_VA_ARG): Remove. + (FRAME_POINTER_REQUIRED): Use current_function_has_nonlocal_label. + + * config/m32r/m32r-protos.h (m32r_va_arg): Remove. + * config/m32r/m32r.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (m32r_gimplify_va_arg_expr): Rewrite from m32r_va_arg. + * config/m32r/m32r.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/iq2000/iq2000-protos.h (iq2000_va_arg): Remove. + * config/iq2000/iq2000.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (iq2000_gimplify_va_arg_expr): Rewrite from iq2000_va_arg. + * config/iq2000/iq2000.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/frv/frv-protos.h (frv_expand_builtin_va_arg): Remove. + * config/frv/frv.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (frv_gimplify_va_arg_expr): Rewrite from frv_expand_builtin_va_arg. + * config/frv/frv.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/i860/i860-protos.h (i860_va_arg): Remove. + * config/i860/i860.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (i860_gimplify_va_arg_expr): Rewrite from i860_va_arg. + * config/i860/i860.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-05-31 Aaron W. LaFramboise + + * system.h: Prototype getpagesize if missing. + * configure.ac: Add getpagesize to gcc_AC_CHECK_DECLS. + * configure: Regenerate. + * config.in: Regenerate. + +2004-07-08 Richard Henderson + + * config/fr30/fr30-protos.h (fr30_va_arg): Remove. + * config/fr30/fr30.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (fr30_gimplify_va_arg_expr): New. + (fr30_pass_by_reference, fr30_pass_by_value, fr30_va_arg): Remove. + * config/fr30/fr30.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-08 Vladimir Makarov + + PR target/16414 + * config/ia64/ia64.c (ia64_dfa_new_cycle): Fix typo in comparison + of asm_noperands result. + +2004-07-08 Richard Henderson + + * config/cris/cris-protos.h (cris_expand_builtin_va_arg): Remove. + * config/cris/cris.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (cris_gimplify_va_arg_expr): Rewrite from cris_expand_builtin_va_arg. + * config/cris/cris.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-08 Richard Henderson + + * builtins.c (ind_gimplify_va_arg_expr): New. + * tree.h (ind_gimplify_va_arg_expr): Declare. + * config/arc/arc.c (arc_gimplify_va_arg_expr): Use it. + +2004-07-08 Jan Beulich + + * expmed.c (extract_bit_field): Correct condition to use vec_extract + patterns also on vector elements other than the first one. + * config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add missing + break statements. + +2004-07-08 Geoffrey Keating + + * config/rs6000/darwin-ldouble.c: Correct reference + to the Linnainmaa paper. + +2004-07-08 Richard Henderson + + * config/arc/arc-protos.h (arc_va_arg): Remove. + * config/arc/arc.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (arc_gimplify_va_arg_expr): Rewrite from arc_va_arg. + * config/arc/arc.h (EXPAND_BUILTIN_VA_ARG): Remove. + + * config/c4x/c4x-protos.h (c4x_va_arg): Remove. + * config/c4x/c4x.c (TARGET_GIMPLIFY_VA_ARG_EXPR): New. + (c4x_gimplify_va_arg_expr): Rewrite from c4x_va_arg. + * config/c4x/c4x.h (EXPAND_BUILTIN_VA_ARG): Remove. + +2004-07-08 John David Anglin + + * pa.md (prefetch_32, prefetch_64): Simplify constraint checks. + +2004-07-08 Zack Weinberg + + * c-decl.c (static_ctors, static_dtors): Make static. + (pop_file_scope): Call c_common_write_pch and + cgraph_finalize_compilation_unit here. + (build_cdtor): Moved here from c-objc-common.c; simplify. + (c_write_global_declarations_1): Clarify comment. + (c_write_global_declarations): Close the external scope before + doing anything else. Call build_cdtor, cgraph_optimize, and + mudflap_finish_file here. + * c-lang.c (finish_file): Don't call c_objc_common_finish_file. + Clarify comment. + * c-objc-common.c: No need to include cgraph.h. + (build_cdtor): Moved to c-decl.c. + (c_objc_common_finish_file): Delete. + * c-tree.h: Update to match. + * objc/objc-act.c (finish_file): Don't call c_objc_common_finish_file. + (generate_static_references): Set TREE_USED before calling finish_decl. + Eliminate unnecessary dummy declaration. Call rest_of_decl_compilation + on the static_instances_decl. + +2004-07-08 Zack Weinberg + + * c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope + decls when there is only one input translation unit. + * langhooks.c (lhd_set_decl_assembler_name): Partially revert + change of 2004-07-05; do not treat declarations with + DECL_CONTEXT a TRANSLATION_UNIT_DECL specially. + * opts.c (cur_in_fname): Delete. + * opts.h: Likewise. + * tree.c: Revert changes of 2004-07-05; no special treatment + for TRANSLATION_UNIT_DECLs. + * Makefile.in (tree.o): Update dependencies. + +2004-07-08 Roger Sayle + + * builtins.c (fold_builtin_strcpy): Merge functionality from + simplify_builtin_strcpy. Add additional len argument. No longer + static. Remove function prototype. + (fold_builtin_strncpy): Likewise integrate functionality from + simplify_builtin_strncpy. Add additional slen argument. No + longer static. Remove function prototype. + (simplify_builtin_strcy, simplify_builtin_strncpy): Delete. + (simplify_builtin_fputs): Rename to fold_builtin_fputs. Change + types of "ignore" and "unlocked" parameters to bool. + (fold_builtin_1): Add additional ignore argument. Call renamed + fold_builtin_fputs to simplify GCC "fputs" and "fputs_unlocked" + builtins. Update arguments to fold_builtin_strncpy and + fold_builtin_strcpy. Add function prototype. + (fold_builtin): Add additional Boolean ignore argument to pass + to fold_builtin_1. + (simplify_builtin): Call fold_builtin_fputs, fold_builtin_strcpy + and fold_builtin_strncpy instead of simplify_builtin_fputs, + simplify_builtin_strcpy and simplify_builtin_strncpy respectively. + + * expr.h (simplify_builtin_fputs, simplify_builtin_strcpy, + simplify_builtin_strncpy): Delete function prototypes. + * tree.h (fold_builtin_fputs, fold_builtin_strcpy, + fold_builtin_strncpy): Add function prototypes here. + (fold_builtin): Update function prototype with new "bool ignore". + + * tree-ssa-ccp.c (ccp_fold): Update call to fold_builtin. + (ccp_fold_builtin): Update call to fold_builtin. Call + fold_builtin_fputs, fold_builtin_strcpy and fold_builtin_strncpy + instead of simplify_builtin_fputs, simplify_builtin_strcpy and + simplify_builtin_strncpy respectively. + * fold-const.c (fold): Update call to fold_builtin. + +2004-07-08 Alexandre Oliva + + * builtins.c (expand_builtin_stpcpy): Un-simplify decay of stpcpy + to strcpy. + + * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Default to 0. + (FUNCTION_ARG_PASS_BY_REFERENCE): Likewise. + (FUNCTION_ARG_CALLEE_COPIES): Likewise. + * calls.c: Remove ifdefs of macros above. + * functions.c: Likewise. + * expr.c: Likewise. + +2004-07-08 Eric Botcazou + + * config/sparc/sparc.md (UNSPECV_GOTO_V9): Delete. + (arch attribute): Delete. + (current_function_calls_alloca attribute): Rename into calls_alloca. + (calls_eh_return): New attribute. + (leaf_function): Likewise. + (length attribute): Fix formula for sibcalls. + (return insn): Correctly compute the 'length' attribute. + (do_builtin_setjmp_setup): Adjust use of current_function_calls_alloca. + +2004-07-08 Richard Henderson + + * tree-cfg.c (make_exit_edges): Use get_call_expr_in. + (remove_useless_stmts_1, is_ctrl_altering_stmt): Likewise. + (tree_block_ends_with_call_p, need_fake_edge_p): Likewise. + * tree-eh.c (lower_eh_constructs_1): Likewise. + * tree-sra.c (sra_walk_modify_expr): Likewise. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. + (eliminate_unnecessary_stmts): Likewise. + * tree-ssa-dse.c (dse_optimize_stmt): Likewise. + * tree-tailcall.c (optimize_tail_call): Likewise. + * tree-ssa-ccp.c (get_rhs, set_rhs): Reorg to use switch. + +2004-07-08 Paolo Bonzini + Jakub Jelinek + + * config/i386/i386.c (override_options): Enable + SSE prefetches with -mtune, as long as we are + compiling for i686 or higher. All i686 processors + accept SSE prefetches as NOPS, some i586's don't. + +2004-07-08 Eric Botcazou + + PR target/10567 + * config/sparc/sparc.md (update_return): Honor flag_delayed_branch. + +2004-07-08 Diego Novillo + + * tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in + the handling of clobbering ASM_EXPRs. + +2004-07-08 Eric Botcazou + + PR target/16430 + * config/sparc/sparc.c (function_value): In 64-bit mode, + return the aggregates larger than 16 bytes like unions. + +2004-07-08 Eric Botcazou + + PR target/16199 + * config/sparc/sparc.c (sparc_emit_set_symbolic_const64): When + 'temp' is zero, generate new pseudos as needed and emit the + sequence of insns in single-assignment form. Resync comments + with code. + (sparc_emit_set_const64): Pass zero as 'temp' argument to above + function before reload. + +2004-07-08 Nathan Sidwell + + * vec.c (vec_assert_fail): Remove duplicate 'function'. + + * vec.c (vec_p_reserve, vec_o_reserve): Allocation is signed. + + * vec.h (VEC_alloc, VEC_embedded_size, VEC_embedded_init): + Allocation is signed. + (VEC_reserve): Return flag, allocation is signed. + +2004-07-08 Richard Henderson + + * tree-ssa-ccp.c (fold_stmt): Get type directly from + OBJ_TYPE_REF_OBJECT. + +2004-07-08 Joseph S. Myers + Neil Booth + + PR c/2511 + PR c/3325 + * c-decl.c (finish_struct): Ensure bit-fields are given the + correct type. + * c-common.c (c_common_signed_or_unsigned_type): For C, require + the precision to match as well as the mode. + * expr.c (reduce_to_bit_field_precision): New function. + (expand_expr_real_1): Reduce expressions of bit-field type to + proper precision. + * langhooks.h (reduce_bit_field_operations): New hook. + * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): + Define. + * c-lang.c, objc/objc-lang.c + (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define. + * objc/objc-act.c (check_ivars): Convert types to bit-field types + before checking. + * tree.c (build_nonstandard_integer_type): New function. + * tree.h (build_nonstandard_integer_type): New prototype. + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't treat + conversions between integer and boolean types as useless. + +2004-07-08 Paolo Bonzini + + * c-common.c (c_common_nodes_and_builtins): Do not + create __builtin_ptrdiff_t and __builtin_size_t. + +2004-07-08 Andrew Pinski + + * Makefile.in (libbackend.o): Add -combine to the gcc + command line. + +2004-07-08 Nick Clifton + + * config/stormy16/t-stormy16 (TARGET_LIBGCC2_CFLAGS): Define. + Set to -Os. + +2004-07-08 Richard Henderson + + * except.c (expand_eh_region_start, expand_eh_region_end, + expand_eh_handler, expand_eh_region_end_cleanup, + expand_start_all_catch, expand_start_catch, expand_end_catch, + expand_end_all_catch, expand_eh_region_end_allowed, + expand_eh_region_end_must_not_throw, expand_eh_region_end_throw, + expand_eh_region_end_fixup): Remove. + * stmt.c (struct nesting): Remove stack_level, innermost_stack_block, + cleanups, outer_cleanups, label_chain, exception_region. + (struct goto_fixup): Remove stack_level, cleanup_list_list. + (struct label_chain): Remove. + (struct stmt_status): Remove x_stack_block_stack. + (stack_block_stack, expand_goto_internal, expand_fixup, expand_fixups, + fixup_gotos, save_stack_pointer, expand_decl_cleanup, + expand_decl_cleanup_eh, expand_cleanups, start_cleanup_deferral, + end_cleanup_deferral, last_cleanup_this_contour, + containing_blocks_have_cleanups_or_stack_level, + any_pending_cleanups): Remove. + (expand_null_return_1): Take no arguments. + (expand_label, expand_naked_return, expand_return, + expand_start_bindings_and_block, expand_end_bindings, expand_decl, + expand_anon_union_decl, expand_start_case, pushcase, pushcase_range, + expand_end_case_type): Don't use any of them. + * calls.c (expand_call): Likewise. + * dojump.c (do_jump): Likewise. + * function.c (expand_function_end): Likewise. + * expr.c (store_expr, expand_expr_real_1): Likewise. + (safe_from_p): Don't handle WITH_CLEANUP_EXPR, CLEANUP_POINT_EXPR. + (expand_expr_real_1): Don't handle WITH_CLEANUP_EXPR, + CLEANUP_POINT_EXPR, TARGET_EXPR, TRY_CATCH_EXPR, CATCH_EXPR, + EH_FILTER_EXPR, TRY_FINALLY_EXPR, GOTO_SUBROUTINE_EXPR. + * fold-const.c (fold_checksum_tree): Use first_rtl_op. + * gengtype.c (adjust_field_tree_exp): Remove rtl op handling. + * gimplify.c (gimplify_cleanup_point_expr): Renumber operands + for WITH_CLEANUP_EXPR. + (gimple_push_cleanup): Likewise. + * integrate.c (copy_decl_for_inlining): Don't DECL_TOO_LATE. + * print-tree.c (print_node): Likewise. + * tree-pretty-print.c (dump_generic_node): Remove GOTO_SUBROUTINE_EXPR. + * tree.c (first_rtl_op): Always just TREE_CODE_LENGTH. + (has_cleanups): Remove GOTO_SUBROUTINE_EXPR. + * tree.def (WITH_CLEANUP_EXPR): Remove op1 and op2. + (GOTO_SUBROUTINE_EXPR): Remove. + * tree.h (WITH_CLEANUP_EXPR_RTL): Remove. + (DECL_TOO_LATE): Remove. + * except.h, tree.h: Update decls. + +2004-07-08 Paolo Bonzini + + * explow.c (optimize_save_area_alloca): Do not accept parameters. + * passes.c (rest_of_handle_final): Handle symout. + (rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): + Push timevar here. + (rest_of_handle_sched): Break out SMS. Remove ifs for + flag_schedule_insns and flag_modulo_sched. + (rest_of_handle_addressof, rest_of_handle_cse2): Garbage + collect at the end. + (rest_of_handle_gcse2): Put under timevar TV_RELOAD_CSE_REGS. + (rest_of_handle_partition_blocks, rest_of_handle_sms, + rest_of_handle_if_after_reload, rest_of_handle_peephole2, + rest_of_handle_mode_switching, rest_of_handle_jump, + rest_of_handle_guess_branch_prob, rest_of_handle_eh, + rest_of_handle_jump2, rest_of_handle_postreload, + rest_of_handle_flow2, rest_of_clean_state, + rest_of_handle_shorten_branches, + rest_of_handle_prologue_epilogue, + rest_of_handle_branch_target_load_optimize): New. + (rest_of_compilation): Call the above. Remove ggc_collect + calls moved to rest_of_handle_*. + * rtl.h (optimize_save_area_alloca): Do not accept parameters. + + * dwarf2out.c (dwarf2out_begin_prologue): Use TREE_NOTHROW. + * except.c (set_nothrow_function_flags): Set TREE_NOTHROW. + * except.h (set_nothrow_function_flags): Update comment. + * function.c (current_function_nothrow): Remove. + * output.h (current_function_nothrow): Remove. + * passes.c (rest_of_compilation): Do not set TREE_NOTHROW. + * config/arm/arm.c (arm_compute_func_type): Use TREE_NOTHROW. + +2004-07-08 Eric Botcazou + + PR bootstrap/16326 + * reorg.c: Revert 2004-06-30 change. + (find_end_label): If HAVE_epilogue and !HAVE_return, + return 0 instead of creating a label at the end of the insn chain. + (optimize_skip): Account for the failure mode of find_end_label. + (fill_simple_delay_slots): Likewise. + (fill_slots_from_thread): Likewise. + (relax_delay_slots): Likewise. + +2004-07-08 Diego Novillo + + * tree-flow.h (addressable_vars): Declare. + * tree-ssa-alias.c (addressable_vars): Define. + (setup_pointers_and_addressables): Add addressable variables + to addressable_vars. + * tree-ssa-operands.c (get_stmt_operands): Move + handling of ASM_EXPRs ... + (get_asm_expr_operands): ... here. + When the ASM_EXPR clobbers memory, also clobber addressable + variables. + * tree-ssa.c (init_tree_ssa): Initialize addressable_vars. + (delete_tree_ssa): Reset addressable_vars. + +2004-07-07 Jan Beulich + Richard Henderson + + * varasm.c (assemble_variable): Use assemble_zeros for + zero-initialized variables. + (categorize_decl_for_section): Honor flag_zero_initialized_in_bss + for SECCAT_BSS and SECCAT_TBSS. + +2004-07-07 Jan Beulich + + * varasm.c (asm_output_bss): Don't declare unless BSS_SECTION_ASM_OP. + + * expmed.c (emit_store_flag): Also special-case double-word + (in-)equality comparison against -1. + + * config/i386/i386.c (ix86_gimplify_va_arg): Don't need temporary for + passing arguments the containers for which are registers. + + * calls.c (emit_library_call_value_1): Use mode of function parameter + rather than that of argument since constants have none. + +2004-07-08 Alexandre Oliva + + Introduce H8SX support. + * expr.c (expand_strcpy): Renamed and moved to... + * builtins.c (expand_movstr): ... here. Tweak. + (expand_builtin_strcpy): Adjust. Use movstr if len can't be + computed or has side effects. + (expand_builtin_stpcpy): Likewise. Use strcpy if return value is + unused, or if mempcpy fails. Adjust the return value in the + latter case. Use movstr if everything else fails. + * doc/md.texi (movstr): Document. + (movmemM, clrmemM): Fix explanation of memory block operands. + * config/h8300/h8300.md (stpcpy): Renamed to... + (movstr): ... this. Adjust. + 2004-07-07 Alexandre Oliva + * config/h8300/h8300.md: Rename movstr*, except for movstrict*, to + movmem* and clrstr* to clrmem*. + 2004-06-27 Alexandre Oliva + * config/h8300/h8300.c (h8300_reg_class_from_letter): Map 'D' to + GENERAL_REGS, always. + (h8300_swap_into_er6, h8300_swap_into_er6): Handle the case of + getting the stack pointer as addr. + * config/h8300/h8300.h (PREDICATE_CODES): Remove constant rtxes + from general_operand_dst. + * config/h8300/h8300.md (movmd_internal_normal): New, normal-mode + variant of... + (movmd_internal): ... this. Add modes to operands. Disparage `D' + instead of requiring it to match only before reload. + (stpcpy_internal_normal): New, normal-mode variant of... + (stpcpy_internal): ... this. Add modes to operands. Disparage + `D' instead of requiring it to match only before reload. + * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Add + mode argument. + * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Pass it to... + * config/h8300/h8300.c (h8300_legitimate_address_p): Pass it to + h8300_get_index. + * config/h8300/h8300.md (attr type): Add call. + (attr can_delay): If type is call, set it no. + (call, call_value): Set type to call. + 2004-06-21 Alexandre Oliva + * config/h8300/h8300.md (logicalhi3_sn, logicalsi3_sn): New. + 2004-06-16 Alexandre Oliva + * tree.c (get_narrower): Don't narrow integral types into + non-integral types. + * config/h8300/h8300.c (h8300_expand_epilogue): Initialize + frame_size *before* the first use. + * config/h8300/h8300.md (movstrictqi): Reintroduce post-increment + on input. + (peephole2): Don't widen instructions that push SP. Move + decrement of SP to the end of all stm-generating peepholes. + 2003-07-24 Richard Sandiford + * config/h8300/h8300.md (insv): Prefer to use AND to clear a bitfield + and OR to set it to all ones. + 2003-07-24 Richard Sandiford + * config/h8300/h8300.md (can_delay): Default to "no" for bit branches. + (call, call_value): Set can_delay to "no". + 2003-07-22 Richard Sandiford + * config/h8300/h8300.md (extzv): Make subreg check more robust. + 2003-07-21 Richard Sandiford + * config/h8300/h8300.md (*brabit): Remove. + * config/h8300/h8300.md (*brabc, *brabs): Remove mode from + zero_extract. Use bit_memory_operand as the predicate for + operand 1 and 'WU' as the constraint. Check the difference + between the base length and the final one when deciding which + type of branch to use. + 2003-07-21 Richard Sandiford + * config/h8300/h8300.md (extzv): Remove mode from operands 0 and 1. + Use convert_move to extend the result for TARGET_H8300SX. Check + for QImode memory references. Optimize the case where the + destination is a paradoxical subreg. + 2003-07-21 Richard Sandiford + * config/h8300/h8300.md (*movsf_h8sx): Add an r <- G alternative. + * config/h8300/h8300.md (andqi): Remove bclr from h8sx version. + 2003-07-21 Richard Sandiford + * config/h8300/h8300.md: Include mova.md + (length_table): Add mova and mova_zero. + * config/h8300/h8300.c (print_operand): Handle '%o'. Print a length + after all constant addresses for '%R', '%X', '%T' and '%S'. + (h8300_mova_length): New function. + (h8300_insn_length_from_table): Use it to handle mova and mova_zero. + * config/h8300/t-h8300 (mova.md): Generate from genmova.sh. Add to + dependencies for s-config, etc. + * config/h8300/gemova.sh: New file. + * config/h8300/mova.md: Generated. + 2003-07-20 Alexandre Oliva + * config/h8300/h8300.c (h8300_bitfield_length): New. + (nibble_operand): Adjust. + (h8300_binary_length): Handle conditional binary op. + (h8300_insn_length_from_table): Handle bitfield and bitbranch. + * config/h8300/h8300.h: Change constraints W# and Y# to P#>X and + P#X. Introduced P#>0 + and P#<0, unused so far. W and Y are now prefixes to multi-letter + constraints. WU is introduced as a variant of U that requires a + mem, and is therefore considered an EXTRA_MEMORY_CONSTRAINT. + * config/h8300/h8300.md (attr type): Added bitbranch. + (attr length_table): Added bitfield and bitbranch. + (attr length): Compute bitbranch length. + (andqi): Separate pattern for H8300SX. Use bfld for loading the + least-significant bit of a byte. + (brabit, brabc, brabs): New. + (insv, extzv): Emit bfst and bfld on H8300SX. + (bfld, bfst, seq, sne): New. + (bstzhireg, cmpstz, bstz, bistz): New. + (cmpcondbset, condbset, cmpcondbclr, condbclr): New. + (cmpcondbsetreg, condbsetreg, cmpcondbclrreg, condbclrreg): New. + 2003-07-11 Richard Sandiford + * config/h8300/h8300.c (h8sx_binary_memory_operator): New function. + (h8sx_unary_memory_operator): New function. + * config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Disable. + (PREDICATE_CODES): Add h8sx_{unary,binary}_memory_operator. + * config/h8300/h8300.md: Add peepholes to combine reloads and + arithmetic insns. + 2003-07-10 Richard Sandiford + * config/h8300/h830.md (cmpqi): Use 'i' rather than 'n' in constraints. + (*cmphi_h8300hs, *addqi3, *addhi3_h8sx, subhi3): Likewise. + (and?i, ior?i, xor?i): Likewise. + 2003-07-10 Richard Sandiford + * config/h8300/h8300.c: Move enums and prototypes to head of file. + Various whitespace fixes. + (h8300_constant_length): New function, split out from... + (h8300_displacement_size): ...here. Rename h8300_displacement_length. + (h8300_classify_operand): Use IN_RANGE. + (h8300_classify_operand): Use h8300_constant_length. + (h8300_short_move_mem_p): Tighten size check. + (h8sx_mergeable_memrefs_p): Tighten equality check. + 2003-06-30 Richard Sandiford + * config/h8300/h8300.h (TARGET_CPU_CPP_BUILTINS): Define __H8300SX__ + for -msx. + * config/h8300/crti.asm: Use .h8300sx or .h8300sxn for -msx code. + * config/h8300/crtn.asm: Likewise. + * config/h8300/lib1funcs.asm: Likewise. Use 32-bit pointers + if __H8300SX__ is defined. + 2003-06-27 Richard Sandiford + * config/h8300/h8300-protos.h (h8300_get_index): Add mode parameter. + * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Update accordingly. + (GO_IF_MODE_DEPENDENT_ADDRESS): Treat POST_DEC, PRE_INC and indexed + addresses as mode-dependent. + * config/h8300/h8300.c (print_operand_address): Update call to + h8300_get_index. + (h8300_get_index): Take a mode argument. Rework to fix an + earlier misunderstanding. + 2003-06-26 Richard Sandiford + * config/h8300/h8300.c (zero_extendqisi2): Force the source operand + into a register if TARGET_H8300SX. + (*zero_extendqisi2_h8300hs, *extendqisi2_h8300): Disable for + TARGET_H8300SX. Also disable related define_splits. + (*zero_extendqisi2_h8sx, *extendqisi2_h8sx): New patterns. + 2003-06-23 Richard Sandiford + * config/h8300/h8300.c (h8300_rtx_costs): Add h8sx handling. + 2003-06-20 Richard Sandiford + * config/h8300/h8300.h (OK_FOR_Z): New macro. + (EXTRA_CONSTRAINT_STR): Check it. + * config/h8300/h8300.c (h8300_classify_operand): Accept null + class arguments. + (h8300_insn_length_from_table): Handle LENGTH_TABLE_MOV_IMM4. + * config/h8300/h8300.md (length_table): Add mov_imm4. + (movqi, movhi): Add Z <- W4 alternatives to h8sx patterns. + 2003-06-20 Richard Sandiford + * genattrtab.c (write_eligible_delay): Allow candidate_insn to + be a label. + * config/h8300/h8300.h (DELAY_SLOT_LENGTH): New macro. + * config/h8300/h8300.c (h8300_reorg): New function. + (TARGET_MACHINE_DEPENDENT_REORG): Define. + * config/h8300/h8300.md (length): Subtract the length of the + delay slot from (pc) when checking the range of forward branches. + (delay_slot, can_delay): New attributes. + (define_delay): Add bra/s handling. + (movmd_internal, return_h8sx, *return_1): Set can_delay to no. + (jump): Add delayed-branch handling. + 2003-06-17 Richard Sandiford + * expr.c (expand_strcpy): New function. + * builtins.c (expand_builtin_strcpy): Fall back on expand_strcpy. + (expand_builtin_stpcpy): Likewise. + * config/h8300/h8300-protos.h (h8sx_split_movmd): Remove. + (h8300_swap_into_er6, h8300_swap_out_of_er6): Declare. + * config/h8300/h8300.c (h8300_reg_class_from_letter): Tweak 'd' + handling to improve register allocation for -fno-omit-frame-pointer. + (h8sx_split_movmd): Delete, moving er6 handling into... + (h8300_swap_into_er6, h8300_swap_out_of_er6): ...these new functions. + * config/h8300/h8300.md (UNSPEC_STPCPY): New unspec constant. + (movmd): Add calls to copy_rtx. + (movmd_internal): In the second alternative, allow the initial and + final destination registers to be different . Update the splitter + accordingly. Call h8300_swap_into_er6 and h8300_swap_out_of_er6 + instead of h8sx_split_movmd. + (stpcpy, movsd): New expanders. + (movsd_internal): New define_insn. + 2003-06-13 Richard Sandiford + * config/h8300/h8300-protos.h (h8300_reg_class_from_letter): Declare. + (h8sx_emit_movmd, h8sx_split_movmd): Declare. + * config/h8300/h8300.h (reg_class): Add COUNTER_REGS, SOURCE_REGS + and DESTINATION_REGS. + (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly. + (REGNO_REG_CLASS): Map er4, er5 and er6 to the new classes. + (REG_CLASS_FROM_LETTER): Use h8300_reg_class_from_letter. + (h8300_move_ratio): Declare. + (MOVE_RATIO): Use it. + * config/h8300/h8300.c (h8300_move_ratio): New variable. + (h8300_init_once): Initialize it. + (h8300_reg_class_from_letter): New function. + (print_operand): Add an 'm' prefix for printing ".b", ".w" or ".l". + (h8sx_emit_movmd, h8sx_split_movmd): New functions. + * config/h8300/h8300.md (UNSPEC_MOVMD): New unspec constant. + (COUNTER_REG, SOURCE_REG, DESTINATION_REG): New register constants. + (movstrsi, movmd): New expanders. + (movmd_internal): New insn. + 2003-06-06 Richard Sandiford + * config/h8300/h8300.h (EXTRA_MEMORY_CONSTRAINT): Define. + 2003-06-04 Richard Sandiford + * config/h8300/elf.h (LINK_SPEC): Use -m h8300sxnelf for -msx -mn. + * config/h8300/h8300.c (asm_file_start): Use .h8300sxn likewise. + 2003-06-03 Richard Sandiford + * config/h8300/h8300.c (nibble_operand): Fix warning. + * config/h8300/h8300.md (movstricthi): Set adjust_length to no. + (movsi_h8sx): Likewise here and the normal h8sx movhi pattern. + (movsf_h8300h): Disable for TARGET_H8300SX. + 2003-06-03 Richard Sandiford + * config/h8300/h8300.h (PREDICATE_CODES): Add h8300_ldm_parallel, + h8300_stm_parallel and h8300_return_parallel. + * config/h8300/h8300.c (h8300_push_pop, h8300_stack_offset_p, + h8300_ldm_stm_regno, h8300_ldm_stm_parallel, h8300_ldm_parallel, + h8300_stm_parallel, h8300_return_parallel): New functions. + (h8300_expand_prologue): Don't enforce ldm/stm register alignment + if TARGET_H8300SX. Use h8300_push_pop. + (h8300_expand_epilogue): Likewise. Try to merge the return insn + and final pop when generating h8sx code. Always emit some form + of return insn. + * config/h8300/h8300.md: Don't enforce register alignment in + stm peepholes if TARGET_H8300SX. + (ldm_h8300s, stm_h8300s, return_h8sx): New patterns. + (ldm_h8300s_[234], stm_h8300_[234]): Disable. + (epilogue): Expect h8300_expand_epilogue to emit a return insn. + 2003-06-03 Richard Sandiford + * config/h8300/t-h8300 (MULTILIB_OPTIONS): Add a -msx multilib. + (MULTILIB_DIRNAMES): Add a directory for it. + (MULTILIB_MATCHES): Delete. + 2003-05-28 Richard Sandiford + * final.c (walk_alter_subreg): Handle addresses with subregs + inside a ZERO_EXTEND or AND. + * config/h8300/h8300-protos.h (h8300_get_index): Declare. + * config/h8300/h8300.h (INDEX_REG_CLASS): Set to GENERAL_REGS + if TARGET_H8300SX. + (GO_IF_LEGITIMATE_ADDRESS): Use h8300_get_index. + * config/h8300/h8300.c (print_operand_address): Handle @(dd,RnL.b), + @(dd,Rn.w) and @(dd,ERn.L). + (h8300_displacement_size): Take the whole address as argument. + (h8300_classify_operand, h8300_short_move_mem_p): Adjust accordingly. + 2003-05-28 Richard Sandiford + * config/mips/mips-protos.h (h8300_operands_match_p): Declare. + (h8sx_mergeable_memrefs_p): Declare. + * config/h8300/h8300.h (HAVE_POST_DECREMENT): Define to TARGET_H8300SX. + (HAVE_PRE_INCREMENT): Likewise. + (GO_IF_LEGITIMATE_ADDRESS): Accept pre/post increment/decrement + addresses for TARGET_H8300SX, + * config/h8300/h8300.c (print_operand_address): Deal with PRE_INC + and POST_DEC. + (movb_length_table, movl_length_table): New tables. + (movw_length_table): Define to movb_length_table. + (h8300_displacement_size): New, split out from... + (h8300_classify_address): ...here. Handle pre/post inc/dec. + (h8300_short_immediate_length): Allow H8OP_MEM_COMPLEX operands. + (h8300_insn_length_from_table): Add cases for movb, movw and movl. + (h8sx_mergeable_memrefs_p, h8300_operands_match_p): New functions. + (output_plussi): Use add.l #xx:3,Rn and sub.l #xx:3,Rn for h8sx. + (compute_plussi_length, compute_plussi_cc): Update accordingly. + (h8sx_unary_shift_operator): Get the mode from the operator. + (binary_shift_operator): Likewise. + * config/h8300/h8300.md: If a peephole2 applies gen_lowpart to + a memory reference, check whether the reference is offsettable. + (length_table): Add movb, movw and movl. + (movqi): Add new h8sx pattern. Don't force one operand to be a + register when generating h8sx code. + (movhi, movsi, movsf): Likewise. + (movstrictqi): Use the length_table attribute. + (movstricthi): Likewise. Add h8sx alternative for mov.w #xx:3,Rn. + (addqi3): Split into a define_expand and define_insn. Don't accept + memory operands in the expander. Use h8300_operands_match_p to + check for matching operands in the define_insn. + (subqi3, negqi2, one_cmplqi2): Likewise. + (add[hs]i3): Don't accept memory operands in the expander. Likewise + in any patterns that are unused in h8sx code. In the h8sx patterns, + use h8300_operands_match_p to check whether operands match. + (sub[hs]i3, and[hi]3, ior[hs]i3, xor[hs]i3, neg[hsi]3, + one_cmpl[hs]i3): Likewise. + (andqi3, iorqi3, xorqi3): Likewise. Don't call fix_bit_operand + in the expander. + 2003-05-23 Richard Sandiford + * config/h8300/h8300-protos.h (expand_a_shift): Return a bool. + (h8300_insn_length_from_table): Add a second parameter. + (output_h8sx_shift): Declare. + * config/h8300/h8300.h (OK_FOR_W, OK_FOR_Y): New macros. + (EXTRA_CONSTRAINT): Replace with... + (EXTRA_CONSTRAINT_STR): ...this. Use OK_FOR_W and OK_FOR_Y. + (CONSTRAINT_LEN): Define, returning 2 for 'W' and 'Y'. + (PREDICATE_CODES): Add entries for h8sx_unary_shift_operator + and h8sx_binary_shift_operator. + * config/h8300/h8300.c (two_insn_adds_subs_operand): Return false + for TARGET_H8300SX. + (bit_operand): Replace use of EXTRA_CONSTRAINT with OK_FOR_U. + (bit_memory_operand, fix_bit_operand): Likewise. + (h8300_length_table_for_insn): Remove. + (h8300_classify_operand): Fix check for 16-bit operands in 32-bit + instructions. + (h8300_short_immediate_length, h8300_binary_length): New functions. + (h8300_insn_length_from_table): Add an opcodes parameter. Rework. + (output_plussi): Use sub to add negative constants. + (compute_plussi_length): Adjust accordingly. + (h8sx_single_shift_type): New enum. + (h8sx_single_shift, h8sx_unary_shift_operator, + h8sx_binary_shift_operator, output_h8sx_shift): New functions. + (expand_a_shift, expand_a_rotate): Emit nothing if the shift is a + single h8sx instruction. Return false in this case. + * config/h8300/h8300.md (length_table): Add short_immediate. + (length): Pass the operand array to h8300_insn_length_from_table. + (adjust_length): Assume "no" for insns with a length_table attribute. + (*cmphi_h8300hs, cmpsi): Add alternatives for #xx:3. + (*addhi3_h8300hs): Don't use for h8sx. + (*addhi3_h8sx): New pattern, with alternatives for add.w #xx:3 + and sub.w #xx:3. + (ashl[qhs]i3, lshr[qhs]i3, ashr[qhs]i3, rotl[qhs]i3): Change operand + 1's predicate to nonimmediate_operand. Only skip default expansion + if expand_a_shift or expand_a_rotate returns true. Add new patterns + for single h8sx shift instructions. + 2003-05-22 Alexandre Oliva + * config/h8300/h8300.c (nibble_operand): Split out of... + (reg_or_nibble_operand): ... this. + * config/h8300/h8300.h (PREDICATE_CODES): Added nibble_operand. + * config/h8300/h8300.md: (mulqihi3, mulhisi3, umulqihi3, + umulhisi3): Introduce expand, and introduce separate insns for + sign- or zero-extended REG and already-extended CONST_INT. + 2003-05-20 Richard Sandiford + * config/h8300/h8300.c (h8300_unary_length): Fix miscounting. + * config/h8300/h8300.md (subqi3): Generalize for h8sx. + (subhi3): Likewise. Don't accept immediates for operand 1. + Remove the early clobber from second alternative of the h8300s pattern. + (subsi3): Generalize for h8sx. Force operand 2 into a register + on plain h8300 targets. + (subsi3_h8300): Use h8300_dst_operand for consistency with expander. + (subsi3_h8300h): Generalize for h8sx. + (one_cmplqi2, one_cmplhi2, one_cmplsi2): Likewise. + 2003-05-19 Alexandre Oliva + * config/h8300/h8300.c (reg_or_nibble_operand): New. + * config/h8300/h8300.h (PREDICATE_CODES): Adjust. + (TARGET_H8300SXMUL): New. + (CONST_OK_FOR_P): New. + (CONST_OK_FOR_LETTER_P): Adjust. + * config/h8300/h8300.md (mulqihi3, mulhisi3, umulqihi3, + umulhisi3): Accept 4-bit immediate on H8SX. + (mulhi3, mulsi3, smulsi3_highpart, umulsi3_highpart): New. + (udivsi3, divhi3, udivsi3, divsi3): New. + 2003-05-19 Richard Sandiford + * config/h8300/h8300-protos.h (h8300_insn_length_from_table): Declare. + * config/h8300/h8300.h (OK_FOR_Q): New macro. + (EXTRA_CONSTRAINT): Use it to check the 'Q' constraint. + (PREDICATE_CODES): Add h8300_src_operand and h8300_dst_operand. + Add ADDRESSOF to the bit_operand entry. + * config/h8300/h8300.c (h8300_dst_operand): New predicate. + (h8300_src_operand): Likewise. + (bit_operand): Check nonimmediate_operand rather than general_operand. + Accept any nonimmediate_operand in h8sx code. + (h8300_and_costs): Initialize operands[1]. + (h8300_rtx_costs) : Return false if the operands aren't valid. + (h8300_operand_class): New enum. + (h8300_length_table): New typedef. + (addb_length_table, addw_length_table, addl_length_table, + logicl_length_table): New tables. + (logicb_length_table, logicw_length_table): New macros. + (h8300_classify_operand, h8300_length_from_table, + h8300_length_table_for_insn, h8300_unary_length, + h8300_insn_length_from_table): New functions. + (output_plussi): Only use adds and subs for register destinations. + Disable redundant clause. + (compute_plussi_cc): Likewise. + (compute_plussi_length): Likewise. Use h8300_length_from_table + to work out the length of an insn. + (output_logical_op): Only use narrower immediate instructions + if the destination is a register. + (compute_logical_op_cc): Likewise. + (compute_logical_op_length): Likewise. Use h8300_length_from_table. + (h8300_adjust_insn_length): Tighten check for reg<->mem moves. + * config/h8300/h8300.md (length_table): New attribute. + (length): When an instruction has a length_table attribute, use + h8300_insn_length_from_table to calculate its default length. + (cmpqi): Use h8300_dst_operand for the first operand and + h8300_src_operand for the second. + (cmphi, *cmphi_h8300hs, cmpsi, negqi2, neghi2, neghi2_h8300h, negsi2, + negsi2_h8300h, addqi3, addhi3, *addhi3_h8300, *addhi3_h8300hs, addsi3, + addsi_h8300, addsi_h8300h, andhi3, andsi3, iorhi3, + iorsi3, xorhi3, xorsi3): Likewise. + (andqi3): Use h8300_src_operand for operand 2. Adjust the condition + so that it allows any combination of operands for TARGET_H8300SX. + (iorqi3, xorqi3): Likewise. + (cmpqi): Use the length_table attribute. + (*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, andqi3, iorqi3, + xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise. + (cmpqi): Add 'Q' constraint. + (*cmphi_h8300hs, cmpsi, addqi, *addhi3_h8300hs, addsi_h8300h, andqi3, + iorqi3, xorqi3, negqi2, neghi2_h8300h, negsi2_h8300h): Likewise. + 2003-05-14 Richard Sandiford + * config/h8300/h8300.h (MASK_H8300SX): New macro. + (TARGET_H8300S): True for both -ms and -msx. + (TARGET_H8300SX): New macro. + (TARGET_SWITCHES): Add entries for -msx and -mno-sx. + * config/h8300/h8300.c (asm_file_start): Write .h8300sx for -msx. + * config/h8300/elf.h (LINK_SPEC): Use -m h8300sxelf for -msx. + * config/h8300/t-h8300 (MULTILIB_MATCHES): Use -ms multilibs for -msx. + [Temporary change.] + 2003-02-28 Alexandre Oliva + * config/h8300/h8300.h (SIZE_TYPE, PTRDIFF_TYPE): Use short with + 16-bit pointers and 32-bit ints. + * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Accept + CONST_DOUBLE with mode no wider than SImode. + * config/h8300/h8300.md (extendqisi2_h8300): Add constraints for + output operand. + 2003-02-27 Alexandre Oliva + * config/h8300/h8300.c (general_operand_src): Match CONSTANT_P_RTX + or SUBREG thereof. + * config/h8300/h8300.h (PREDICATE_CODES): Adjust. + 2003-02-22 Alexandre Oliva + * config/h8300/h8300.c (dosize): Truncate sign * size to Pmode. + +2004-05-28 Aaron W. LaFramboise + + * config.gcc (i[34567]86-*-mingw32*): Enable threads by default. + +2004-07-07 Per Bothner + + * flow.c (attempt_auto_inc): Remove now-redundant PUT_CODE. + +2004-07-07 Mike Stump + + * darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore. + * darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name) + (machopic_finish): Likewise. + +2004-07-07 Richard Henderson + + * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Look + through any value-preserving cast. + +2004-07-07 Alexandre Oliva + + * function.c (assign_parm_find_data_types): Call + FUNCTION_ARG_PASS_BY_REFERENCE only if it's defined. + +2004-07-07 Steven Bosscher + + * tree-cfg.c (group_case_labels): Remove case labels that have + the same target as the default case. + +2004-07-07 Steven Bosscher + + * tree-inline.c (optimize_inline_calls): Set DECL_INLINED_FNS + regardless of DECL_LANG_SPECIFIC being present or not. + * tree.h (DECL_NUM_STMTS): Purge. + +2004-07-07 Andrew Pinski + + * configure: Regenerate with the right autoconf. + +2004-07-07 David Edelsohn + + * ifcvt.c (total_bb_rtx_cost): New function. + (find_if_case_1): Compare rtx_cost of basic block to cost of + BRANCH_COST insns. + (find_if_case_2): Same. + +2004-07-07 Eric Botcazou + + PR target/10567 + * config/sparc/sparc.c (load_pic_register): Honor flag_delayed_branch. + (output_return): Likewise. + (output_sibcall): Abort if !flag_delayed_branch. + (sparc_function_ok_for_sibcall): Return 0 if !flag_delayed_branch. + (emit_and_preserve): New function. + (sparc_output_mi_thunk): Use it. Honor flag_delayed_branch. Emit an + indirect jump to the thunked-to function if !flag_delayed_branch. + * config/sparc/sparc.md (delayed_branch): New attribute. + (load_pcrel_sym): Honor flag_delayed_branch. Use above + attribute to compute the length of the insn. + (goto_handler_and_restore): Likewise. + +2004-07-07 Andrew Pinski + + PR tree-optimization/15777 + * fold-const.c (fold_single_bit_test): Fold the x^1 expression. + + * expr.c (expand_expr_real_1): Fix formating. + BUFFER_REF and IN_EXPR are dead. + * fold-const.c (non_lvalue): BUFFER_REF is dead. + * tree-inline.c (estimate_num_insns_1): Likewise. + * tree-pretty-print.c (dump_generic_node): BUFFER_REF, + IN_EXPR, SET_LE_EXPR, and CARD_EXPR are dead. + * tree.def (BUFFER_REF, IN_EXPR, SET_LE_EXPR, CARD_EXPR): Kill. + +2004-07-07 H.J. Lu + + * collect2.c (dump_file): Don't call cplus_demangle if + HAVE_LD_DEMANGLE is defined. + (main): Pass "--demangle" to ld if no_demangle is not 0 and + HAVE_LD_DEMANGLE is defined. Don't set current_demangling_style + if HAVE_LD_DEMANGLE is defined. + + * configure.ac (--with-demangler-in-ld): Added + (HAVE_LD_DEMANGLE): Define if ld supports --demangle when + --with-demangler-in-ld is used. + * config.in: Regenerated. + * configure: Likewise. + +2004-07-07 Roger Sayle + + * config/rs6000/rs6000.c (struct processor_costs): Add new fields + for simple floating point operations "fp", double precision + multiplication "dmul", and single and double precision division + "sdiv" and "ddiv". Update all CPU variant tables as appropriate. + (ppc630_cost): New table split from ppc620_cost, to distinguish + differences in floating point latencies. + (rs6000_override_options): Use ppc630_cost for PROCESSOR_PPC630. + (rs6000_rtx_costs): Add support for single and double precision + floating point addition, subtraction, multiplication, division, + fused-multiply-add, fused-multiply-sub, negation, absolute value + and negative absolute value. Tweak MEM case to use prefered idiom. + +2004-07-07 Richard Henderson + + * tree-flow-inline.h (may_propagate_copy): Move... + * tree-ssa-copy.c (may_propagate_copy): ... here. Fail if we + attempt to copy between types requiring conversion. + * tree-flow.h (may_propagate_copy): Update decl. + * tree-ssa-dom.c (cprop_operand): Tidy redundant tests. + +2004-07-07 Jakub Jelinek + + * config/i386/i386.c (override_options): Don't set x86_prefetch_sse + from -mtune= option. + +2004-07-07 Alexandre Oliva + + * builtins.c: Rename movstr*, except for movstrict*, to + movmem* and clrstr* to clrmem*. + * expr.c: Likewise. + * expr.h: Likewise. + * genopinit.c: Likewise. + * integrate.c: Likewise. + * local-alloc.c: Likewise. + * optabs.c: Likewise. + * optabs.h: Likewise. + * config/alpha/alpha.h: Likewise. + * config/alpha/alpha.md: Likewise. + * config/arm/arm-protos.h: Likewise. + * config/arm/arm.c: Likewise. + * config/arm/arm.md: Likewise. + * config/avr/avr.md: Likewise. + * config/c4x/c4x.c: Likewise. + * config/c4x/c4x.md: Likewise. + * config/frv/frv.md: Likewise. + * config/i386/i386-protos.h: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/i386.md: Likewise. + * config/i860/i860.c: Likewise. + * config/i860/i860.md: Likewise. + * config/ip2k/ip2k.md: Likewise. + * config/ip2k/libgcc.S: Likewise. + * config/ip2k/t-ip2k: Likewise. + * config/m32r/m32r.c: Likewise. + * config/m32r/m32r.md: Likewise. + * config/mcore/mcore.md: Likewise. + * config/mips/mips.c: Likewise. + * config/mips/mips.md: Likewise. + * config/ns32k/ns32k.c: Likewise. + * config/ns32k/ns32k.h: Likewise. + * config/ns32k/ns32k.md: Likewise. + * config/pa/pa.c: Likewise. + * config/pa/pa.md: Likewise. + * config/pdp11/pdp11.h: Likewise. + * config/pdp11/pdp11.md: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.md: Likewise. + * config/s390/s390-protos.h: Likewise. + * config/s390/s390.c: Likewise. + * config/s390/s390.md: Likewise. + * config/sh/lib1funcs.asm: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.md: Likewise. + * config/sh/t-sh: Likewise. + * config/sparc/sparc.h: Likewise. + * config/vax/vax.md: Likewise. + * config/xtensa/xtensa.c: Likewise. + * config/xtensa/xtensa.md: Likewise. + * doc/invoke.texi: Likewise. + * doc/md.texi: Likewise. + * doc/rtl.texi: Likewise. + +2004-07-07 Richard Sandiford + + PR target/16407 + * config/mips/mips-protos.h (mips_declare_common_object): Declare. + * config/mips/mips.c (mips_declare_common_object): New function, + mostly split out from... + (mips_output_aligned_decl_common): ...here. + * config/mips/mips.h (ASM_OUTPUT_LOCAL): Remove in favor of... + (ASM_OUTPUT_ALIGNED_LOCAL): ...this new definition. + * config/mips/iris6.h (ASM_OUTPUT_ALIGNED_LOCAL): Undefine this + rather than ASM_OUTPUT_LOCAL. Call mips_declare_common_object. + +2004-07-07 John David Anglin + + PR c/16392 + * function.c (assign_parms): Fix typo from previous change. + +2004-07-07 Jason Merrill + + PR c++/15815 + * doc/extend.texi (C++ Interface): Correct information and + discourage use. + +2004-07-07 Vladimir Makarov + + PR target/16130 + PR target/16142 + PR target/16143 + * config/ia64/ia64.c (ia64_dfa_new_cycle): Reset DFA state for asm + insn. + +2004-07-06 Kazuhiro Inaoka + + PR target/1679. + * config/m32r/m32r.c (m32r_function_symbol): New function: + Generate a symbol name RTX with the correct m32r specific flags + set. + (block_move_call): Use new function to generate correct symbol. + * config/m32r/m32r-protos.h: Add prototype for new funcion. + * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Use the new + function. + +2004-07-07 Nathan Sidwell + + * tree.h (TYPE_BINFO_OFFSET, TYPE_BINFO_VTABLE, + TYPE_BINFO_VIRTUALS, TYPE_BINFO_BASETYPES, + TYPE_BINFO_BASETYPE): Remove. + (BINFO_BASETYPES, BINFO_N_BASETYPES, BINFO_BASETYPE): Rename + to ... + (BINFO_BASE_BINFOS, BINFO_N_BASE_BINFOS, BINFO_BASE_BINFO): ... + here. + (BINFO_BASEACCESSES, BINFO_BASEACCESS): Rename to ... + (BINFO_BASE_ACCESSES, BINFO_BASE_ACCESS): ... here. + (BINFO_INHERITANCE_CHAIN): Redocument as it is actually used. + (struct tree_binfo): Rename base_types to base_binfos. + * alias.c (record_component_aliases): Adjust BINFO macros. + * dbxout.c (dbxout_type): Likewise. + * dwarf2out.c (gen_member_die): Likewise. + * sdbout.c (sdbout_one_type): Likewise. + * tree-dump.c (deque_and_dump): Likewise. + * config/i386/i386.c (classify_argument, + contains_128bit_aligned_vector_p): Likewise. + +2004-07-07 Nick Clifton + + * config/fr30/fr30.c (fr30_setup_incoming_varargs): Change + arguments to match TARGET_SETUP_INCOMING_VARARGS prototype. + +2004-07-07 Nathan Sidwell + + * vec.h: Fix the example use. + +2004-07-06 Richard Henderson + + * langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Remove. + * langhooks.h (struct lang_hooks): Remove gimple_before_inlining. + * tree-inline.c (copy_body_r, setup_one_parameter, + initialize_inlined_parameters, expand_call_inline, + declare_inline_vars): Don't check it. + (expand_calls_inline): Remove old version, rename new version + from gimple_expand_calls_inline. + * tree-optimize.c (execute_gimple): Remove. + (pass_gimple): Don't run anything. + +2004-07-06 Joseph S. Myers + + * doc/sourcebuild.texi: Use semicolons instead of commas in + section title. + +2004-07-06 Richard Henderson + + * tree-sra.c (struct sra_walk_fns): Revert 2004-07-05 change. + (sra_walk_modify_expr, scan_init): Likewise. + (generate_element_zero): Check visited before scanning children. + (generate_element_init): Set visited on error. + (scalarize_init): Handle generate_element_init failure similar + to use_block_copy. + +2004-07-06 Joseph S. Myers + + * toplev.h (NO_FRONT_END_DIAG, ATTRIBUTE_GCC_FE_DIAG): Define. + (warning, error, pedwarn, sorry): Use ATTRIBUTE_GCC_FE_DIAG. + +2004-07-06 Richard Henderson + + * config/i386/i386.c (legitimize_pic_address): Make static. + (legitimize_address): Handle CONST with TLS operand. + (ix86_expand_move): Don't call legitimize_pic_address directly. + * config/i386/i386-protos.h (legitimize_pic_address): Remove. + +2004-07-06 Roger Sayle + + * ifcvt.c (struct noce_if_info): Add a Boolean b_unconditional field. + (noce_try_sign_mask): Tweak rtx_cost check if t is evaluated anyway. + (noce_process_if_block): Initialize if_info.b_unconditional if insn_b + is currently executed unconditionally, i.e. not in "else_bb". + +2004-07-06 Steven Bosscher + + * config/alpha/alpha.c (alpha_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/arm/arm.c (arm_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/frv/frv.c (frv_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/i386/i386.c (ia32_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/ia64/ia64.c (ia64_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/pa/pa.c (hhpa_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/sparc/sparc.c (sparc_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + * config/v850/v850.c (v850_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. + +2004-07-06 Daniel Berlin + + * dojump.c (do_jump): REFERENCE_EXPR is dead. + * expr.c (expand_expr_real_1): Ditto. + * tree-inline.c (estimate_num_insns_1): Ditto. + * tree-pretty-print.c (dump_generic_node): Ditto. + (op_symbol): Ditto. + * tree.def: Ditto. + +2004-07-06 Daniel Berlin + + * tree-ssa-pre.c (reference_node_pool): New pool. + (find_or_generate_expression): Class 'r' is okay too. + (create_value_expr_from): Ditto. + (add_to_sets): LHS should not include vuses. + (eliminate): Ditto. + (compute_avail): Reverse ordering of tests. + Valuize INDIRECT_REF as well. + +2004-07-06 Richard Sandiford + + PR rtl-optimization/16380 + * loop.c (check_dbra_loop): Sink comparison instructions if they + do something other than set cc0. + +2004-07-06 James E Wilson + + * doc/interface.texi (longjmp and automatic variables): Delete + paragraph recommending taking the address of a variable. + +2004-07-06 Nathan Sidwell + + * vec.h (VEC_embedded_alloc): Remove. + (VEC_embedded_size, VEC_embedded_init): New. + (VEC_alloc, VEC_reserve, VEC_safe_push, VEC_safe_insert): Add + MEM_STAT_INFO. + (VEC_truncate): New. + (vec_p_reserve, vec_o_reserve): Add MEM_STAT_DECL. + (vec_embedded_alloc): Remove. + * vec.c (vec_p_reserve, vec_o_reserve): Add MEM_STAT_DECL, adjust. + (vec_embedded_alloc): Remove. + +2004-07-06 Mark Mitchell + + * Makefile.in (langhooks.o): Do not depend on gt-langhooks.h. + (gt-langhooks.h): Remove. + +2004-07-06 George Helffrich + + * xcoffout.h (DBX_FINISH_SYMBOL): Fix typo. + +2004-07-06 Eric Botcazou + + * config/sparc/sparc.c (get_pc_symbol): Rename into + add_pc_to_pic_symbol. + (get_pc_symbol_name): Rename into add_pc_to_pic_symbol_name. + (load_pic_register): Account for previous changes. + Use reg_names. Don't create the label twice. + * config/sparc/sparc.md (UNSPEC_GET_PC): Rename into + UNSPEC_LOAD_PCREL_SYM. + (get_pc): Rename into load_pcrel_sym. Add predicate to + operands. Remove condition. + +2004-07-06 Nathan Sidwell + + * dbxout.c (dbxout_type): Don't test whether the binfo slot of + RECORD, UNION & QUAL_UNION is actually a binfo. + + * tree.h (TREE_VIA_VIRTUAL): Rename to ... + (BINFO_VIRTUAL_P): ... here. Require TREE_BINFO only. + (BINFO_MARKED, BINFO_FLAG_[16]): New binfo flags. + * dbxout.c (dbxout_type): Use BINFO_VIRTUAL_P. + * dwarf2out.c (add_data_member_location_attribute): Likewise. + (gen_inheritance_die): Likewise. + * tree-dump.c (deque_and_dump): Likewise. + * doc/c-tree.texi (Binfos): Add under reconstruction note. + +2004-07-06 Steven Bosscher + + * config/mcore/mcore.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): + Define. + * config/mcore/mcore.md: Model memory latency with a simple DFA + pipeline description instead of a define_function_unit. + +2004-07-05 Richard Kenner + + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Extra arg. + * langhooks.h (var_mod_type_p): Likewise. + * c-decl.c (finish_decl): Add extra arg to variably_modified_type_p. + * expr.c (count_type_elements): Properly handle return from + array_type_nelts and properly test for overflow. + * gimplify.c (gimplify_init_constructor): Properly handle return + from array_type_nelts. + (gimplify_addr_expr): Remove redundant clear of TREE_SIDE_EFFECTS. + * integrate.c (copy_decl_for_inlining): Correct comments. + * tree-inline.c (remap_decl): Update comments, remove dead code, + and copy DECL_FIELD_OFFSET and DECL_QUALIFIER, if they exist. + (remap_type): Only remap if variably modified by vars in function + being inlined. + (copy_body_r): Use compatible_type langhooks to see when can fold. + (setup_one_parameter): Don't remap type. + (inline_forbidden_p_1): Add arg to variably_modified_type_p. + * tree.c (recompute_tree_invarant_for_addr_expr): Properly + compute TREE_INVARIANT for decl case. + (find_var_from_fn): New function. + (variably_modified_type_p): Add arg and call new function. + * tree.h (variably_modified_type_p): Add extra arg. + +2004-07-05 Eric Botcazou + + * config/sparc/sparc.md (nonlocal_goto): Remove disabled code. + (goto_handler_and_restore_v9): Delete disabled insn. + (goto_handler_and_restore_v9_sp64): Likewise. + +2004-07-05 Roger Sayle + + * calls.c (load_register_parameters): Call expand_shift instead + of expand_binop with ashl_optab (or other shift optab) directly. + * expr.c (emit_group_load, emit_group_store): Likewise. + * function.c (assign_parm_setup_block): Likewise. + * stmt.c (shift_return_value): Likewise. + +2004-07-05 Jakub Jelinek + + * expr.c (expand_assignment): Disable the bitfield += optimizations. + +2004-07-05 Joseph S. Myers + + * doc/sourcebuild.texi: Revert previous patch. + +2004-07-05 Joseph S. Myers + + * c-decl.c, config/m32r/m32r.c, expr.c, optabs.c: Don't check + TARGET_MEM_FUNCTIONS. + * system.h: Poison TARGET_MEM_FUNCTIONS. + * libfuncs.h (LTI_bcopy, LTI_bcmp, LTI_bzero, bcopy_libfunc, + bcmp_libfunc, bzero_libfunc): Remove. + * optabs.c (init_obtabs): Don't set bcopy_libfunc, bcmp_libfunc or + bzero_libfunc. + * doc/tm.texi (TARGET_MEM_FUNCTIONS): Remove. + * doc/standards.texi: Don't mention calling BSD string functions. + * doc/invoke.texi: Likewise. Mention that memmove may be called. + * config/vax/t-memfuncs: New. + * config/memcmp.c, config/memcpy.c, config/memmove.c, + config/memset.c: New. + * config/pdp11/t-pdp11 (LIB2FUNCS_EXTRA): Use these files. + * config.gcc (vax-*-bsd*, vax-*-sysv*, vax-*-ultrix*): Use + vax/t-memfuncs. + * config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, + config/avr/avr.h, config/c4x/c4x.h, config/cris/aout.h, + config/elfos.h, config/gnu.h, config/h8300/h8300.h, + config/i386/gas.h, config/ia64/ia64.h, config/interix.h, + config/ip2k/ip2k.h, config/lynx-ng.h, config/m32r/m32r.h, + config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, + config/netbsd.h, config/openbsd.h, config/pa/pa.h, + config/rs6000/rs6000.h, config/rtems.h, config/s390/s390.h, + config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, + config/svr3.h: Don't define TARGET_MEM_FUNCTIONS. + +2004-07-05 Richard Henderson + + * function.c (assign_parm_setup_reg): Properly rename variables in + FUNCTION_ARG_CALLEE_COPIES section. + +2004-07-05 Zack Weinberg + + * tree-mudflap.c: Include cgraph.h. + (mf_init_extern_trees): Rename to mudflap_init. Export. + Rewrite to create synthetic declarations instead of looking + up declarations from mf-runtime.h. + (mf_make_builtin, mf_make_cache_struct_type): New functions. + (mf_cache_shift_decl, mf_cache_mask_decl, mf_unregister_fndecl): + Correct commentary. + (execute_mudflap_function_decls, mudflap_register_call): + Don't call mf_init_extern_trees. + (mudflap_finish_file): Use cgraph_build_static_cdtor. + + * tree-mudflap.h: Update prototypes. + * c-mudflap.c: Delete file. + * c-common.c: Include tree-mudflap.h. + (c_common_nodes_and_builtins): Call mudflap_init if appropriate. + * Makefile.in: Remove all references to c-mudflap.o. + Update dependencies. + +2004-07-05 John David Anglin + + * pa.md (prefetch, prefetch_32, prefetch_64): Only allow short + displacements with the spatial-locality cache-control completer. + +2004-07-05 Zack Weinberg + + * langhooks.c: Don't include gt-langhooks.h. + (var_labelno): Delete. + (lhd_set_decl_assembler_name): Do not append a distinguishing + number to file-scope internal-linkage declarations for the first + input file, even if they have DECL_CONTEXT set. Use DECL_UID of + the declaration itself (if at block scope), or its containing + TRANSLATION_UNIT_DECL (if at file scope) for the distinguishing + number. + + * opts.c (cur_in_fname): New global. + * opts.h: Declare it. + * tree.c: Include opts.h. + (make_node_stat): If creating a TRANSLATION_UNIT_DECL, give it + DECL_UID equal to cur_in_fname. + (copy_node_stat): Do not change DECL_UID when copying a + TRANSLATION_UNIT_DECL. + (build_common_tree_nodes): Adjust next_decl_uid to reserve the + range 0 .. num_in_fnames-1 for TRANSLATION_UNIT_DECLs. + + * c-decl.c (c_static_assembler_name): Delete. + * c-tree.h (c_static_assembler_name): Delete prototype. + * c-lang.c, objc/objc-lang.c: Don't override + LANG_HOOKS_SET_DECL_ASSEMBLER_NAME. + + * Makefile.in (tree.o): Update dependencies. + (GTFILES): Remove langhooks.c. + +2004-07-05 Roger Sayle + + * fold-const.c (fold) : Optimize unsigned modulus + by a power of two into a bit-wise AND, i.e. "X % C" as "X & (C-1)". + Normalize "X % C" as "X % -C" for signed modulus and negative C. + Optimize "X % -Y" as "X % Y" for signed modulus. + : Recursively call "fold" when transforming "(X % Y) == 0" + into "((unsigned) X % Y) == 0". + +2004-07-05 Joseph S. Myers + + * sourcebuild.texi (Config Fragments): Use @comma{} in + cross-reference to section title. + +2004-07-05 Richard Kenner + + * tree.h (DECL_SEEN_IN_BIND_EXPR_P): New macro. + * gimplify.c (gimple_add_tmp_var, gimplify_bind_expr): Use it. + (gimplify_target_expr, gimplify_expr): Likewise. + (copy_if_shared_r): No longer need special case for BIND_EXPR. + (unshare_body, unvisit_body): Only look at nested if BODY_P is + whole function. + (gimplify_compound_lval): See if we can strip any useless conversion. + (gimplify_modify_expr, gimplify_modify_expr_to_memcpy): Take size + from RHS, not LHS. + (gimplify_modify_expr_to_memset): Likewise. + (gimplify_expr, case CONSTRUCTOR): Handle use as statement. + * tree-inline.c (setup_one_parameter): Use DECL_SEEN_IN_BIND_EXPR_P. + (declare_inline_vars): Likewise. + (walk_type_fields): New function. + (walk_tree): Use it. + * tree-nested.c (create_tmp_var_for): Show seen in BIND_EXPR. + + * tree-sra.c (struct sra_walk_fns): Init function now returns bool. + (sra_walk_modify_expr): Allow init function to fail. + (scan_init): Now returns bool. + (generate_element_init): If can't understand INIT, return false. + (scalarize_init): Return false if generate_element_init does. + + * tree-pretty-print.c (dump_generic_node, case ARRAY_TYPE): Properly + print bounds. + + * expr.c (expand_expr_real_1, case SWITCH_EXPR): Don't check against + bounds if bounds aren't constant. + + * tree-cfg.c (verify_expr): Use CHECK_OP in binary case. + + * function.c, langhooks-def.h, langhooks.h: Move max_size hook + to type hooks; remove bogus PARAMS. + +2004-07-05 Nathan Sidwell + + * c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1. + * dwarf2out.c (add_data_member_location_attribute): Check for + TREE_BINFO. + * tree.c (tree_node_kinds): Add "binfos". + (binfo_lang_slots): New. + (make_node_stat): Add TREE_BINFO. + (make_tree_binfo_stat): New. + (tree_node_structure): Add TREE_BINFO. + * tree.def (TREE_BINFO): New. + * tree.h (REC_OR_UNION_CHECK): Rename to ... + (RECORD_OR_UNION_CHECK): ... here. + (NOT_RECORD_OR_UNION_CHECK): New. + (TRE_VIA_VIRTUAL): Allow TREE_LIST or TREE_BINFO. + (TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD): Adjust for + RECORD_OR_UNION_CHECK. + (TYPE_BINFO): Use RECORD_OR_UNION_CHECK. + (TYPE_LANG_SLOT_1): New. + (BINFO_TYPE, BINFO_OFFSET, BINFO_VTABLE, BINFO_VIRTUALS, + BINFO_BASETYPES, TYPE_BINFO_BASETYPES, BINFO_VPTR_FIELD, + BINFO_BASEACCESSES, BINFO_INHERITANCE_CHAIN): Adjust. + (BINFO_ELTS): Remove. + (BINFO_LANG_SLOT): New. + (struct tree_binfo): New. + (binfo_lang_slots): Declare. + (enum tree_node_structure_enum): Add TS_BINFO. + (union tree_node): Add binfo. + (make_tree_binfo_stat): Declare. + (make_tree_binfo): New. + (enum tree_node_kind): Add binfo_kind. + + * objc/objc-act.c (start_class, objc_declare_protocols, + start_protocols): Use TYPE_LANG_SLOT_1. + * objc/objc-act.h (CLASS_BINFO_ELTS, PROTOCOL_BINFO_ELTS): Rename + to ... + (CLASS_LANG_SLOT_ELTS, PROTOCOL_LANG_SLOT_ELTS): ... here. + (CLASS_IVARS, CLASS_RAW_IVARS, CLASS_STATIC_TEMPLATE, + CLASS_CATEGORY_LIST, CLASS_PROTOCOL_LIST, CLASS_OWN_IVARS, + PROTOCOL_LIST, PROTOCOL_FORWARD_DECL): Use TYPE_LANG_SLOT_1. + +2004-07-05 Steven Bosscher + + * rtl.h (struct rtx_def): Remove the integrated flag. + Use the return_val flag for MEM_SCALAR_P. + Reshuffle and update flags in CLEAR_RTX_FLAGS. + +2004-07-05 Richard Sandiford + + PR target/16357 + * config/mips/mips.c (mips_block_move_straight): Pass BLKmode memrefs + to mips_expand_unaligned_load, mips_expand_unaligned_store, and + move_by_pieces. + +2004-07-05 Josef Zlomek + + * var-tracking.c: Fix some comments. + (frame_stack_adjust): New. + (vt_stack_adjustments): Init stack_adjust of entry block to + minus stack adjustment of function prologue. + (adjust_stack_reference): Do not adjust if adjustment == 0. + (compute_bb_dataflow): Use plus_constant instead of gen_rtx_PLUS. + (emit_notes_in_bb): Likewise. + (vt_add_function_parameters): Do not adjust locations of + function arguments. + (vt_initialize): Compute the stack adjustment of function + prologue and offset the initial "location" of frame_base_decl + from the stack pointer after prologue. + +2004-07-04 Richard Henderson + + * function.c (struct assign_parm_data_all): New. + (struct assign_parm_data_one): New. + (assign_parms_initialize_all, assign_parms_augmented_arg_list, + assign_parm_find_data_types, assign_parms_setup_varargs, + assign_parm_find_entry_rtl, assign_parm_is_stack_parm, + assign_parm_find_stack_rtl, assign_parm_adjust_entry_rtl, + assign_parm_adjust_stack_rtl, assign_parm_setup_block_p, + assign_parm_setup_block, assign_parm_setup_reg, + assign_parm_setup_stack, assign_parms_unsplit_complex): Split from ... + (assign_parms): ... here. + +2004-07-04 Daniel Berlin + + * tree-ssa-pre.c (bb_value_sets): phi_gen, tmp_gen, new_sets + now are bitmap_set_t's. + (bitmap_insert_into_set): No point in inserting the value if + it's invariant. + (bitmap_set_contains): New function. + (bitmap_set_replace_value): Add comment on why we do it + this way. + (set_contains): Removed. + (bitmap_set_subtract_from_value_set): New name of + set_subtract now that it's arguments are two different + types of sets. + Update callers. + (bitmap_find_leader): Change algorithm used. + (find_or_generate_expression): Update use of functions for new + bitmap sets. + (create_expression_by_pieces): Ditto. + (insert_aux): Ditto. + (insert): Ditto. + (add_to_sets): Ditto. + (init_pre): Ditto. + (execute_pre): Ditto. + (compute_avail): Ditto. + Also ignore virtual phis. + +2004-07-04 Richard Sandiford + + * combine.c (simplify_comparison): Fix comment typo. + +2004-07-04 Eric Botcazou + + * config/sparc/sparc.c (SIBCALL_SLOT_EMPTY_P): Rename + into LEAF_SIBCALL_SLOT_RESERVED_P after negation. + (eligible_for_sibcall_delay): Adjust use of SIBCALL_SLOT_EMPTY_P. + (output_restore): Change parameter from 'insn' to 'pat'. + (output_return): Adjust call to output_restore. + (output_sibcall): Adjust use of SIBCALL_SLOT_EMPTY_P. + Adjust call to output_restore. + +2004-07-04 Neil Booth + + * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_COMMON): Define __unix__ + and assert system is bsd. + +2004-07-04 Richard Sandiford + + * config/mips/mips.h (MASK_DEBUG_C, TARGET_DEBUG_C_MODE): Delete. + (TARGET_SWITCHES): Remove -mdebugc. + * config/mips/mips.md (seq, sne, sgt, sge, slt, sle, sgtu, sgeu) + (sltu, sleu): Remove TARGET_DEBUG_C_MODE handling. + (seq_[sd]i, sne_[sd]i, sge_[sd]i, sle_[sd]i_reg, sgeu_[sd]i) + (sle_[sd]i_reg): Delete. + +2004-07-04 Steven Bosscher + + * config/iq2000/iq2000.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): + Define. + * config/iq2000/iq2000.md: Translate old pipeline description to an + equivalent new one. + +2004-07-04 Roger Sayle + + * tree-ssa-ccp.c (set_rhs): Change function to return a bool. + Ensure the replacement rhs is valid gimple before performing + the substitution. Return false if these sanity checks fail. + (fold_stmt): Only set changed to true, if set_rhs returns true. + (execute_fold_all_builtins): Only call modify_stmt if set_rhs + succeeds. + +2004-07-04 Richard Henderson + + PR c/16348 + * c-typeck.c (c_finish_loop): Don't clear cond for cond_is_first loops. + +2004-07-04 Mark Mitchell + + * configure.ac (ranlib_flags): New variable. + * Makefile.in (RANLIB_FLAGS): New variable. + (libbackend.a): Use it. + * configure: Regenerated. + +2004-07-04 Roger Sayle + + * ifcvt.c (noce_try_sign_mask): Call emit_store_flag to generate + a "sign mask" instead of using ashr_optab directly. + +2004-07-04 Neil Booth + + * doc/cpp.texi: Don't document what we do for ill-formed expressions. + * doc/cppopts.texi: Clarify processing of command-line defines. + +2004-07-04 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Adjust link for GNU Classpath. + +2004-07-04 Richard Henderson + + * rtl.def (ADDRESSOF): Remove. + * alias.c (rtx_equal_for_memref_p): Don't handle addressof. + (find_base_term, memrefs_conflict_p): Likewise. + * cse.c (fixed_base_plus_p, find_best_addr: Likewise. + (fold_rtx, cse_insn, set_live_p): Likewise. + * dwarf2out.c (mem_loc_descriptor): Likewise. + (add_location_or_const_value_attribute): Likewise. + * emit-rtl.c (copy_insn_1): Likewise. + * explow.c (memory_address): Likewise. + * expmed.c (store_split_bit_field): Likewise. + * expr.c (expand_expr_real_1): Likewise. + * function.c (instantiate_decl + (instantiate_virtual_regs_1, fix_lexical_addr): Likewise. + * genrecog.c (preds, validate_pattern): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * recog.c (general_operand, register_operand): Likewise. + (memory_address_p): Likwise. + * reload1.c (eliminate_regs, elimination_effects): Likewise. + * rtl.c (copy_rtx): Likewise. + * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. + (rtx_addr_can_trap_p, nonzero_address_p, address_cost): Likewise. + * rtlhooks.c (gen_lowpart_general): Likewise. + * stmt.c (expand_asm_operands): Likewise. + * web.c (entry_register, replace_ref, web_main): Likewise. + * config/alpha/alpha.c (input_operand, alpha_legitimate_address_p, + alpha_expand_block_move, alpha_expand_block_clear): Likewise. + * config/arm/arm.c (thumb_rtx_costs): Likewise. + * config/c4x/c4x.c (c4x_valid_operands): Likewise. + * config/frv/frv.c (move_destination_operand, move_source_operand, + condexec_dest_operand, condexec_source_operand, + condexec_memory_operand): Likewise. + * config/h8300/h8300.h (PREDICATE_CODES): Likewise. + * config/ia64/ia64.c (general_xfmode_operand): Likewise. + (destination_xfmode_operand): Likewise. + * config/mips/mips.h (PREDICATE_CODES): Likewise. + * config/mn10300/mn10300.c (mn10300_address_cost_1): Likewise. + * config/s390/s390.c (general_s_operand): Likewise. + * config/s390/s390.md (mov*): Likewise. + * config/sparc/sparc.h (PREDICATE_CODES): Likewise. + + * c-typeck.c (c_mark_addressable): Don't put_var_into_stack. + * expr.c (expand_expr_real_1): Likewise. + * stmt.c (expand_decl): Likewise. + * config/c4x/c4x.c (c4x_expand_builtin): Likewise. + + * function.c (struct fixup_replacement, struct insns_for_mem_entry, + postponed_insns, put_var_into_stack, put_reg_into_stack, + schedule_fixup_var_refs, fixup_var_refs, find_fixup_replacement, + fixup_var_refs_insns, fixup_var_refs_insns_with_hash, + fixup_var_refs_insn, fixup_var_refs_1, fixup_memory_subreg, + walk_fixup_memory_subreg, fixup_stack_1, optimize_bit_field, + gen_mem_addressof, flush_addressof, put_addressof_into_stack, + purge_bitfield_addressof_replacements, purge_addressof_replacements, + purge_addressof_1, insns_for_mem_hash, insns_for_mem_comp, + struct insns_for_mem_walk_info, insns_for_mem_walk, + compute_insns_for_mem, is_addressof, purge_addressof, setjmp_protect, + setjmp_protect_args): Remove. + (push_function_context_to): Don't handle var_refs_queue. + (pop_function_context_from, free_after_compilation): Likewise. + (instantiate_virtual_regs): Don't handle parm_reg_stack_loc. + (assign_parms, allocate_struct_function): Likewise. + (use_register_for_decl): New. + (expand_function_end): Don't setjmp_protect. + * function.h (struct emit_status): Update commentary. + (struct function): Remove x_max_parm_reg, x_parm_reg_stack_loc. + (max_parm_reg, parm_reg_stack_loc): Remove. + * passes.c (DFI_addressof): Remove. + (dump_file_info): Remove addressof. + (rest_of_handle_addressof): Remove. + (rest_of_compilation): Don't call it. + * rtl.h (ADDRESSOF_REGNO, ADDRESSOF_DECL): Remove. + * stmt.c (expand_decl): Use use_register_for_decl. + * tree.h: Update decls. + * web.c (mark_addressof): Remove. + * doc/invoke.texi (-dF): Remove. + +2004-07-03 Richard Henderson + + * config/ia64/ia64.c (spill_xfmode_operand): Use assign_stack_temp + instead of gen_mem_addressof. + * config/ia64/ia64.md (movxf): Use assign_stack_temp to handle + TImode output register. + +2004-07-03 Richard Henderson + + PR tree-optimization/16341 + * tree-sra.c (sra_walk_function): Increment to next stmt before + processing the current stmt. + (sra_insert_after): Always use BSI_SAME_STMT. + +2004-07-03 Richard Henderson + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Don't fold + fp plus with minus. + +2004-07-03 Joseph S. Myers + + * tree.c (type_hash_eq): Allow TYPE_MIN_VALUE which compares equal + with tree_int_cst_equal. + +2004-07-03 Andreas Schwab + + * config/ia64/ia64.md: Define new attribute "empty". + (prologue_use, nop_x, insn_group_barrier): Set it. + + * config/ia64/ia64.c (ia64_reorg): When looking for trailing call + skip over "empty" insns. + +2004-07-03 Richard Kenner + + * tree-inline.c (initialize_inlined_parameters): Pass proper function + context to gimplify_body. + (walk_tree): Don't walk into types twice. + (walk_tree, case POINTER_TYPE): Deal with mutually recursive pointers. + + * tree-sra.c (generate_element_init): Remove any useless conversions. + + * gimplify.c (gimplify_conversion): Remove stripping useless + conversions from here. + (gimplify_expr): Put it here, in place of call to STRIP_MAIN_TYPE_NOPS. + (gimplify_modify_expr_to_memcpy, gimplify_variable_sized_compare): + Unshare before substituting PLACEHOLDER_EXPR. + (gimplify_modify_expr_to_memset): Likewise. + Pass address of TO to memset, not TO itself. + (gimplify_init_constructor): Make copy of OBJECT so we have it each + time we make an expression (to match a PLACEHOLDER_EXPR). + + * tree-ssa.c (tree_ssa_useless_type_conversion): Also look at + VIEW_CONVERT_EXPR and NON_LVALUE_EXPR. + * tree-ssa-ccp.c (fold_stmt): Call just STRIP_USELESS_TYPE_CONVERSION. + * tree-ssa-dom.c (local_fold): Likewise. + + * langhooks-def.h (LANG_HOOKS_TYPE_MAX_SIZE): New langhook. + * langhooks.h (strct lang_hooks): New field type_max_size. + * function.c (assign_temp): Call it. + +2004-07-03 Steven Bosscher + + * config/sh/sh.c (sh_use_dfa_interface): Add TARGET_SH1. + * config/sh/sh.md: Convert the SH1 pipeline description to + a DFA model. + +2004-07-02 Zack Weinberg + + * c-decl.c (struct c_binding): Remove contour field; add + depth, invisible, nested fields. + (B_IN_SCOPE, B_IN_CURRENT_SCOPE, B_IN_FILE_SCOPE) + (B_IN_EXTERNAL_SCOPE): New convenience macros. + (bind): Add invisible and nested arguments. Initialize + new fields of struct c_binding; adjust loop scanning for + insertion point. + (free_binding_and_advance): Clear structure with memset. + (pop_scope): Adjust to match. Set DECL_CONTEXT on everything + in file scope, even if it's in external scope too. + (pushdecl): Adjust to match. Create invisible file-scope + declarations for block-scope forward declarations of static functions. + (pushtag, warn_if_shadowing, pushdecl_top_level, implicitly_declare) + (undeclared_variable, lookup_label, declare_label, define_label) + (lookup_tag, lookup_name, lookup_name_in_scope, builtin_function) + (c_make_fname_decl, store_parm_decls_newstyle, identifier_global_value) + (store_parm_decls_oldstyle): Adjust to match. + (diagnose_mismatched_decls): Correct handling of linkage clashes. + (merge_decls): No need to copy C_DECL_IN_EXTERNAL_SCOPE. + + * c-tree.h (C_DECL_IN_EXTERNAL_SCOPE): Delete. + (C_DECL_DECLARED_BUILTIN, C_DECL_REGISTER): Slide down one. + +2004-07-02 Richard Henderson + + * c-decl.c (grokdeclarator): Don't frob current_function_decl + around variable_size. + (set_decl_nonlocal): Remove. + (store_parm_decls): Add stmts for pending sizes. + * calls.c (calls_function, calls_function_1): Remove. + (precompute_arguments): Don't call it. + * cfgexpand.c (set_save_expr_context): Remove. + (tree_expand_cfg): Don't call it. + * dwarf2out.c (add_bound_info): Don't handle SAVE_EXPR. + (dwarf2out_finish): Likewise. + * expr.c (emit_block_move): Adjust addresses to BLKmode. + (store_constructor): Don't pre-evaluate SAVE_EXPR. + (safe_from_p): Don't queue SAVE_EXPRs. + (expand_expr_real_1 ): Rewrite to expect, + or build plain VAR_DECLs. + * fold-const.c (twoval_comparison_p): Don't look at SAVE_EXPR_RTL. + (fold): Likewise. + (fold_checksum_tree): Don't special-case SAVE_EXPR. + * function.c (free_after_compilation): Don't clear x_save_expr_regs. + (put_var_into_stack): Don't handle SAVE_EXPR. + (gen_mem_addressof): Likewise. + * function.h (struct function): Remove x_save_expr_regs. + (save_expr_regs): Remove. + * gengtype.c (adjust_field_tree_exp): Don't special-case SAVE_EXPR. + * print-tree.c (print_node): Don't dump SAVE_EXPR_NOPLACEHOLDER. + * stor-layout.c (variable_size): Don't set it. + (force_type_save_exprs, force_type_save_exprs_1): Remove. + * tree-inline.c (remap_save_expr): Remove fn argument. Update + all callers. Don't set SAVE_EXPR_CONTEXT. + * tree-inline.h (remap_save_expr): Update decl. + * tree.c (save_expr): Update build size. + (first_rtl_op): Don't handle SAVE_EXPR. + (unsave_expr_1, contains_placeholder_p): Likewise. + (decl_function_context): Likewise. + * tree.def (SAVE_EXPR): Remove args 1 and 2. + * tree.h (SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL): Remove. + (SAVE_EXPR_NOPLACEHOLDER, SAVE_EXPR_PERSISTENT_P): Remove. + +2004-07-03 Joseph S. Myers + + * doc/bugreport.texi, doc/configterms.texi, doc/contrib.texi, + doc/contribute.texi, doc/cpp.texi, doc/cppinternals.texi, + doc/extend.texi, doc/install.texi, doc/invoke.texi, doc/md.texi, + doc/portability.texi, doc/tree-ssa.texi, doc/trouble.texi: Avoid + some first-person references and patronizing comments. Based on + printed manual. + * doc/invoke.texi: Don't reference fortran@gnu.org. + * doc/trouble.texi (Warning when a non-void function value is + ignored): Rewrite. From Russ Allbery and Chris Devers. + +2004-07-02 Daniel Berlin + + * config/rs6000/rs6000.c (struct processor_costs): New structure + used to hold instruction latencies/sizes for processor types. + (rs6000_cost): New global variable pointing to current CPU's costs. + (rs6000_override_options): Initialize rs6000_cost to point to the + appropriate cost table based upon rs6000_cpu and optimize_size. + (rs6000_rtx_costs): Use rs6000_cost to avoid hardcoding processor + timings inline. + +2004-07-02 Richard Henderson + + * expmed.c (make_tree): Don't use SET_DECL_RTL. + +2004-07-02 Steven Bosscher + + * tree-flow.h (bb_ann_d): Remove ephi_nodes field. + +2004-07-01 Richard Henderson + + * config/alpha/alpha.c (struct machine_function): Add gp_save_rtx. + (alpha_gp_save_rtx): Use assign_stack_local instead of + gen_mem_addressof. + +2004-07-01 Richard Henderson + + * config/alpha/alpha.c (struct alpha_rtx_cost_data): Add int_div. + (alpha_rtx_cost_data): Update to match. + (alpha_rtx_cost_size): New. + (alpha_rtx_costs): Honor optimize_size. + +2004-07-01 Richard Henderson + + * gimple-low.c (lower_function_body): Don't reset_block_changes here. + * cfgexpand.c (tree_expand_cfg): Do it here. + * config/alpha/alpha.c (alpha_output_mi_thunk_osf): And here. + * config/ia64/ia64.c (ia64_output_mi_thunk): And here. + * config/mips/mips.c (mips_output_mi_thunk): And here. + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): And here. + * config/sh/sh.c (sh_output_mi_thunk): And here. + * config/sparc/sparc.c (sparc_output_mi_thunk): And here. + +2004-07-01 Richard Henderson + + * tree.def (RTL_EXPR): Remove. + * c-typeck.c (lvalue_p): Don't handle it. + * expr.c (safe_from_p): Likewise. + (expand_expr_real_1): Likewise. + * fold-const.c (non_lvalue, operand_equal_p, fold): Likewise. + (fold_checksum_tree, tree_expr_nonnegative_p): Likewise. + * gengtype.c (adjust_field_tree_exp): Likewise. + * stmt.c (warn_if_unused_value): Likewise. + * tree-gimple.c (recalculate_side_effects): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree.c (make_node_stat, first_rtl_op, unsave_expr_1): Likewise. + (unsafe_for_reeval, stabilize_reference, build1_stat): Likewise. + * tree.h (RTL_EXPR_SEQUENCE, RTL_EXPR_RTL, RTL_EXPR_ALT_RTL): Remove. + + * stmt.c (struct stmt_status): Remove x_last_expr_type, + x_last_expr_value, x_last_expr_alt_rtl, x_expr_stmts_for_value. + (last_expr_type, last_expr_value, last_expr_alt_rtl): Remove. + (expand_expr_stmt): Merge with expand_expr_stmt_value. Remove + all the bits that tracked last_expr. + (expand_end_bindings): Don't track last_expr. + (expand_start_stmt_expr, expand_end_stmt_expr): Remove. + (clear_last_expr): Remove. + (expand_asm): Don't call it. + (expand_asm_operands, expand_end_cond): Likewise. + (expand_naked_return, expand_null_return_1): Likewise. + * c-typeck.c (c_begin_compound_stmt): Likewise. + * cfgexpand.c (expand_block): Use expand_expr_stmt. + * expr.c (expand_expr_real_1): Likewise. + * tree.h: Update prototypes. + + * function.h (struct sequence_stack): Remove sequence_rtl_expr. + (struct emit_status): Remove sequence_rtl_expr. + (struct function): Remove x_rtl_expr_chain. + (seq_rtl_expr, rtl_expr_chain): Remove. + * function.c (struct temp_slot): Remove rtl_expr. + (assign_stack_temp_for_type): Don't set it. + (free_temp_slots, pop_temp_slots): Don't check it. + (free_after_compilation): Don't clear x_rtl_expr_chain. + (fixup_var_refs): Don't search it. + (preserve_rtl_expr_result, free_temps_for_rtl_expr): Remove. + * emit-rtl.c (start_sequence): Don't use sequence_rtl_expr + or seq_rtl_expr. + (push_topmost_sequence): Likewise. + (end_sequence, init_emit): Likewise. + (start_sequence_for_rtl_expr): Remove. + * expmed.c (make_tree): Build a VAR_DECL instead of an RTL_EXPR. + * rtl.h (preserve_rtl_expr_result): Remove. + +2004-07-02 Kazu Hirata + + * ifcvt.c, modulo-sched.c, tree-alias-common.c, tree-sra.c, + tree-ssa-copy.c, tree-ssa-dom.c, tree-ssa-pre.c: Fix comment + typos. + +2004-07-02 Aaron W. LaFramboise + + * gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. + (STANDARD_STARTFILE_PREFIX_2): Define. + (standard_startfile_prefix_1): Initialize to + STANDARD_STARTFILE_PREFIX_1. + (standard_startfile_prefix_2): Initialize to + STANDARD_STARTFILE_PREFIX_2. + * config/i386/mingw32.h (MD_STARTFILE_PREFIX): Remove. + (STANDARD_STARTFILE_PREFIX_1): Define. + (STANDARD_STARTFILE_PREFIX_2): Define. + * doc/tm.texi (STANDARD_STARTFILE_PREFIX_1): Document. + (STANDARD_STARTFILE_PREFIX_2): Document. + +2004-07-01 Richard Henderson + + * tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr + in order to disable scalarization. Instead set a flag and wait + for a candidate decl. + +2004-07-01 Joseph S. Myers + + * doc/cppinternals.texi, doc/install.texi, doc/invoke.texi, + doc/md.texi, doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: + Use terminology "testsuite" and "enumerated". + +2004-07-01 Richard Henderson + + * dwarf2out.c (reg_save): Use INVALID_REGNUM. + (dwarf2out_reg_save, dwarf2out_return_save): Likewise. + (initial_return_save): Likewise. + (flush_queued_reg_saves): Remap register numbers. + (dwarf2out_return_reg): Likewise. + +2004-07-01 Richard Kenner + + * gimplify.c (gimplify_one_sizepos): Don't do anything if any VAR_DECL. + + * tree-pretty-print.c (dump_generic_node, case ARRAY_REF): Use + access functions for lower bound and element size and only output + if lower bound nonzero or element size not same as that of type. + (dump_generic_node, case COMPONENT_REF): Use access func. for offset. + +2004-07-01 Paolo Bonzini + + * c-pretty-print.c (pp_c_postfix_expression): Fix pasto. + +2004-07-01 Per Bothner + + * final.c (final): Fix typo reported by Aaron W. LaFramboise. + +2004-07-01 Jakub Jelinek + + * expr.c (expand_assignment): Optimize bitfld += cst for 1 bit + bitfields as well. STRIP_NOPS from src operand and PLUS_EXPR's + first operand. Don't optimize if the bitfield is volatile. + +2004-07-01 Paolo Bonzini + + * c-pretty-print.c (pp_c_postfix_expression): Handle + floating-point comparison operators. + (pp_c_expression): Pass floating-point comparison + operators to pp_c_postfix_expression. + +2004-07-01 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation) : Use + rtx_cost instead of "had_mult" to determine whether the transformed + expression is cheaper than the original. + +2004-07-01 Jerry Quinn + + * alias.c (get_alias_set, canon_rtx, get_addr, + nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): + Use MEM_P. + * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, + expand_builtin): Likewise. + * calls.c (expand_call, emit_library_call_value_1, store_one_arg): + Likewise. + * combine.c (can_combine_p, combinable_i3pat, try_combine, + find_split_point, combine_simplify_rtx, simplify_set, make_extraction, + rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, + record_dead_and_set_regs_1, get_last_value_validate, + mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. + * cse.c (check_dependence, canon_hash, equiv_constant, + gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, + cse_around_loop, cse_check_loop_start, cse_set_around_loop, + count_reg_usage): Likewise. + * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, + cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, + cselib_record_sets): Likewise. + * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, + dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. + * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. + * df.c (df_uses_record): Likewise. + * dojump (do_jump): Likewise. + * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, + loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, + decl_start_label): Likewise. + * emit-rtl.c (gen_complex_constant_part, gen_highpart, + operand_subword, change_address_1, make_safe_from): Likewise. + * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, + stabilize, force_not_mem): Likewise. + * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, + expand_mult_const, expand_divmod, emit_store_flag): Likewise. + * expr.c (convert_move, convert_modes, emit_block_move, + emit_group_load, emit_group_store, clear_storage, emit_move_insn, + emit_move_insn_1, expand_assignment, store_expr, + store_constructor_field, store_constructor, store_field, + force_operand, safe_from_p, expand_expr_real_1, expand_increment): + Likewise. + * final.c (cleanup_subreg_operands, alter_subreg, + get_mem_expr_from_op): Likewise. + * flow.c (notice_stack_pointer_modification_1, + init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): + Likewise. + * function.c (mark_temp_addr_taken, preserve_temp_slots, + preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, + optimize_bit_field, flush_addressof, purge_addressof_1, + instantiate_decl, instantiate_virtual_regs_1, assign_parms, + setjmp_protect, setjmp_protect_args, fix_lexical_addr, + keep_stack_depressed): Likewise. + * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, + noce_process_if_block, find_memory): Likewise. + * integrate.c (subst_constants, allocate_initial_values): Likewise. + * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, + update_equiv_regs): Likewise. + * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, + maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. + * optabs.c (expand_abs, emit_unop_insn): Likewise. + * passes.c (rest_of_handle_final): Likewise. + * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, + move2add_note_store): Likewise. + * ra-build.c (detect_remat_webs): Likewise. + * ra-debug.c (dump_static_insn_cost): Likewise. + * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. + * recog.c (validate_change, apply_change_group, cancel_changes, + validate_replace_rtx_1, general_operand, register_operand, + nonmemory_operand, push_operand, pop_operand, memory_operand, + indirect_operand, asm_operand_ok, offsettable_memref_p, + offsettable_nonstrict_memref_p, constrain_operands, + store_data_bypass_p): Likewise. + * reg-stack.c (subst_stack_regs_pat): Likewise. + * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, + copy_cost, reg_scan_mark_refs): Likewise. + * regmove.c (optimize_reg_copy_3, stack_memref_p, + combine_stack_adjustments_for_block): Likewise. + * regrename.c (copyprop_hardreg_forward_1): Likewise. + * reload.c (can_reload_into, push_reload, decompose, immune_p, + find_reloads, find_reloads_address, find_reloads_address_1, + reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, + find_equiv_reg): Likewise. + * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, + reload_as_needed, choose_reload_regs, emit_input_reload_insns, + do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, + delete_address_reloads): Likewise. + * resource.c (mark_referenced_resources): Likewise. + * rtlanal.c (get_jump_table_offset, count_occurrences, + reg_referenced_p, reg_set_p, set_of_1, set_noop_p, + reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, + num_sign_bit_copies1): Likewise. + * rtlhooks.c (gen_lowpart_general): Likewise. + * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. + * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, + sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, + sdbout_global_decl): Likewise. + * simplify-rtx.c (simplify_subreg): Likewise. + * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, + expand_anon_union_decl, expand_end_case_type): Likewise. + * unroll.c (calculate_giv_inc): Likewise. + * var-tracking.c (stack_adjust_offset_pre_post, + bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, + add_stores, compute_bb_dataflow, vt_get_decl_and_offset, + vt_add_function_parameters): Likewise. + * varasm.c (make_var_volatile, notice_global_symbol, + assemble_external, decode_addr_const, mark_weak, + default_encode_section_info): Likewise. + +2004-07-01 Steven Bosscher + + * stmt.c (check_seenlabel): Remove. + (pushcase, pushcase_range, expand_end_case_type): Don't call it. + +2004-07-01 Richard Henderson + + * function.h (struct function): Remove x_function_call_count. + (function_call_count): Remove. + * calls.c (expand_call): Don't set it. + * integrate.c (copy_rtx_and_substitute): Likewise. + + * function.h (struct function): Remove x_cleanup_label. + (cleanup_label): Remove. + * stmt.c (expand_value_return): Don't use it. + * function.c (free_after_compilation): Don't set it. + (expand_function_start): Likewise. Remove parms_have_cleanups arg. + * cfgexpand.c (tree_expand_cfg): Update call. + * tree.h (expand_function_start): Update decl. + +2004-07-01 Joseph S. Myers + + PR c/1027 + * c-lang.c (c_initialize_diagnostics): Move from here ... + * c-objc-common.c: ... to here. Include "c-pretty-print.h". + (c_tree_printer): Use pretty-printer to format %T. + * c-pretty-print.c (pp_c_specifier_qualifier_list): Include space + before '*' if not C++. + (pp_c_direct_abstract_declarator): Don't try to print array upper + bound for flexible array members. + * c-tree.h: Include "diagnostic.h". + (c_initialize_diagnostics): Declare. + * objc/objc-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Define. + * c-format.c (format_type_warning): New function. Improve + diagnostics for incorrect format argument types. + (check_format_types): Use it. Add two parameters. Use the + TYPE_MAIN_VARIANT of wanted_type. + (check_format_info_main): Pass new parameters to + check_format_types. + (struct format_wanted_type): Update comment. + +2004-07-01 Nick Clifton + + * target.h (struct gcc_target): Add new field to struct cxx: + import_export_class. + * target-def.h (TARGET_CXX): Initialise the new field. + (TARGET_CXX_IMPORT_EXPORT_CLASS): Provide a default value for + the new field. + * doc/tm.texi: Document the new target hook. + +2004-07-01 Paolo Bonzini + + * builtins.c (fold_builtin_classify): Fix typo. + +2004-07-01 Richard Henderson + + * function.c (identify_blocks, identify_blocks_1): Remove. + * function.h (identify_blocks): Remove. + * rtl.h (NOTE_INSN_BLOCK_BEG): Update comment. + +2004-07-01 Paolo Bonzini + + * builtins.c (fold_builtin_classify): New. + (fold_builtin_unordered_cmp): Fix commentary. + (fold_builtin): Use it. + * builtins.def: Define builtins for isnan, + isnanf, isnanl, finite, finitef, finitel, + isinf, isinff, isinfl. + +2004-07-01 Richard Henderson + + * function.h (struct function): Remove dont_emit_block_notes. + * gimple-low.c (lower_function_body): Don't set it. + * cfgexpand.c (expand_block): Don't check it. + * cfglayout.c (insn_locators_initialize): Likewise. + * expr.c (expand_expr_real, expand_expr_real_1): Likewise. + * passes.c (rest_of_compilation): Likewise. + * stmt.c (expand_start_bindings_and_block): Likewise. + (expand_end_bindings): Likewise. + +2004-07-01 Richard Henderson + + * cgraph.h (cgraph_build_static_cdtor): Declare. + * cgraphunit.c (cgraph_build_static_cdtor): New. + * c-objc-common.c (build_cdtor): Use it. + * coverage.c (create_coverage): Likewise. + * libfuncs.h (LTI_gcov_init, gcov_init_libfunc): Remove. + * optabs.c (init_optabs): Don't set gcov_init_libfunc. + +2004-06-30 Roger Sayle + + * expmed.c (expand_shift): Consider expanding LSHIFT_EXPR by a + constant as a sequence of additions depending upon the rtx_costs. + (synth_mult): Update the "observed" cost of a shift, based upon + the above optimization. + +2004-06-28 Geoffrey Keating + Andreas Tobler + + PR 15813 + * dwarf2out.c (reg_save): Output DW_CFA_same_value when a + register is saved in itself. + (initial_return_save): If the return address is a register, + it's already there, don't bother to mention it in the CFI. + (struct queued_reg_save): Add field saved_reg. + (struct reg_saved_in_data): New. + (regs_saved_in_regs): New. + (num_regs_saved_in_regs): New. + (queue_reg_save): Add extra parameter to specify register saved + in register. Remove duplicate entries from queue. Add comment + for function. + (flush_queued_reg_saves): Handle registers saved in registers. + Update regs_saved_in_regs. Add comment for function. + (clobbers_queued_reg_save): Add comment for function. Allow + for regs_saved_in_regs. + (reg_saved_in): New. + (dwarf2out_frame_debug_expr): Handle saving registers in other + registers. + (dwarf2out_frame_debug): Reset regs_saved_in_regs. + * unwind-dw2.c (execute_cfa_program): Correct handling of + DW_CFA_same_value. Add FIXME comment about incorrect implementation + of DW_CFA_restore_extended. + * config/rs6000/rs6000.c (rs6000_emit_prologue): Let + dwarf2out_frame_debug_expr see instructions that save registers + in other registers or save those other registers in memory. + + * unwind-dw2.c (DWARF_FRAME_REGISTERS): Move to unwind-dw2.h. + (_Unwind_FrameState): Likewise. + * unwind-dw2.h: New. + * Makefile.in (LIB2ADDEHDEP): Add unwind-dw2.h. + * config/rs6000/darwin-fallback.c: New file. + * config/rs6000/darwin.h (MD_FALLBACK_FRAME_STATE_FOR): Define. + * config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Add darwin-fallback.o. + +2004-07-01 Alan Modra + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Rewrite. + (function_arg): Use rs6000_arg_size rather than CLASS_MAX_NREGS in + calculating gpr size for altivec. Simplify and correct + rs6000_mixed_function_arg calls. Call rs6000_mixed_function_arg + for ABI_V4 gpr case too. Fix off-by-one error in long double + reg test. Generate the correct PARALLEL to handle long double + for ABI_AIX 32-bit. Use this for -m32 -mpowerpc64 fpr case too. + (function_arg_partial_nregs): Align before calculating regs left. + Don't return info on partial fprs when we need info on gprs. + Correct long double fpr off-by-one error. + +2004-06-30 John David Anglin + + * pa-protos.h (prefetch_operand): Add prototype. + * pa.c (prefetch_operand): New function. + * pa.h (prefetch_operand): Add to PREDICATE_CODES. + * pa.md (prefetch, prefetch_32, prefetch_64): New prefetch patterns. + +2004-06-30 Richard Henderson + + * function.h (struct function): Remove x_whole_function_mode_p. + * c-decl.c (store_parm_decls): Don't set it. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * passes.c (rest_of_compilation): Don't check it. + * stmt.c (expand_fixup): Likewise. + * function.c (fixup_var_refs_insn): Remove unused variable. + +2004-06-30 Richard Henderson + + * tree.h (immediate_size_expand): Delete. + * stor-layout.c (immediate_size_expand): Delete. + (variable_size): Don't look at it. + * c-decl.c (push_parm_decl): Don't frob immediate_size_expand. + (start_function): Likewise. + * cfgexpand.c (construct_exit_block): Likewise. + * function.c (init_function_start, expand_function_end): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + +2004-06-30 Richard Henderson + + * gimplify.c (gimplify_compound_lval): Take fallback argument + instead of want_lvalue. + (gimplify_call_expr): Take want_value argument instead of test + function. Gimplify arguments to val only if reg_type; otherwise + allow lvalue forms. + (gimplify_expr): Update gimplify_compound_lval and gimplify_call_expr + calls. + * tree-gimple.c: Update GIMPLE grammer. Use true/false not 1/0. + Tidy commentary globally. + (get_call_expr_in): Remove RETURN_EXPR handling. Tidy. + * tree-gimple.h (is_gimple_call_addr): Mark extern. + + * gimplify.c (gimplify_modify_expr_to_memcpy): Fix typo. + +2004-06-30 Richard Henderson + + * tree-gimple.c (right_assocify_expr): Kill + (rationalize_compound_expr): Kill. + * tree-gimple.h: Likewise. + * tree-inline.c (expand_call_inline): Don't call it. + + * function.h (struct function): Remove x_last_parm_insn, + inl_last_parm_insn. + (last_parm_insn): Remove. + * function.c (free_after_compilation): Don't clear them. + (fixup_var_refs_insn, assign_parms): Don't set them. + + * function.c, rtl.h (get_first_nonparm_insn): Remove. + +2004-06-30 Joseph S. Myers + + * c-common.h (check_function_format): Remove first parameter. + * c-format.c (format_check_context): Remove status. + (check_format_info, check_format_info_main, + maybe_read_dollar_number, avoid_dollar_number, + finish_dollar_format_checking, check_format_types, + check_function_format): Remove first parameter. Don't use + status_warning. + (check_format_arg): Don't use status_warning. + (status_warning): Remove. + * c-common.c (check_function_arguments): Update call to + check_function_format. + +2004-06-30 Eric Botcazou + + * config/sparc/sparc-protos.h (output_cbranch): Constify return + value. + (output_v9branch): Likewise. + (sparc_v8plus_shift): Likewise. Rename into output_v8plus_shift. + * config/sparc/sparc.c (output_cbranch): Constify return value. + Prettify output for delay slots. + (output_v9branch): Likewise. + (sparc_v8plus_shift): Constify return value. Rename into + output_v8plus_shift. + * config/sparc/sparc.md (ashldi3_v8plus): Adjust call to + sparc_v8plus_shift. + (ashrdi3_v8plus): Likewise. + (lshrdi3_v8plus): Likewise. + (call_address_struct_value_sp32): Prettify output for delay slots. + (call_symbolic_struct_value_sp32): Likewise. + (call_address_untyped_struct_value_sp32): Likewise. + (call_symbolic_untyped_struct_value_sp32): Likewise. + +2004-06-30 Zdenek Dvorak + + * common.opt (ftree-loop-optimize): New flag. + * tree-flow.h (kill_redundant_phi_nodes): Declare. + * tree-optimize.c (init_tree_optimization_passes): Add pass_loop. + * tree-pass.h (pass_loop_init, pass_loop_done): Declare. + * tree-ssa-loop.c (current_loops): New variable. + (tree_loop_optimizer_init, gate_loop, tree_ssa_loop_init, + tree_ssa_loop_done): New functions. + (pass_loop, pass_loop_init, pass_loop_done): New passes. + * tree-ssa.c (kill_redundant_phi_nodes): Export. + * doc/invoke.texi (-ftree-loop-optimize): Document. + +2004-06-30 Zdenek Dvorak + + * tree-ssa-loop-ch.c: New file. + * Makefile.in (tree-ssa-loop-ch.o): Add. + (tree-into-ssa.o): Add GGC_H dependency. + * tree-cfg.c (tree_duplicate_bb): Copy virtual arguments. + * tree-flow.h (rewrite_into_ssa): Declaration changed. + (rewrite_ssa_into_ssa, compute_global_livein, duplicate_ssa_name): + Declare. + * tree-into-ssa.c: Include ggc.h. + (struct def_blocks_d): Add phi_blocks field. + (struct mark_def_sites_global_data): Add names_to_rename field. + (struct ssa_name_info): New. + (compute_global_livein): Export. + (set_def_block, insert_phi_nodes, mark_def_sites, set_livein_block, + insert_phi_nodes_1, rewrite_finalize_block, insert_phi_nodes_for, + register_new_def, get_reaching_def, def_blocks_free, + get_def_blocks_for, rewrite_into_ssa): Modified to work with + rewrite_ssa_into_ssa. + (get_ssa_name_ann, get_phi_state, set_phi_state, get_current_def, + set_current_def, ssa_mark_def_sites_initialize_block, + ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name, + ssa_register_new_def, ssa_rewrite_initialize_block, + ssa_rewrite_phi_arguments, ssa_rewrite_finalize_block, + ssa_rewrite_stmt, rewrite_ssa_into_ssa, rewrite_all_into_ssa): New + functions. + (pass_build_ssa): Call rewrite_all_into_ssa. + * tree-optimize.c (execute_todo, execute_one_pass, + tree_rest_of_compilation): Allocate vars_to_rename only once. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Provide parameter + to rewrite_into_ssa. + * tree-ssa-loop.c (should_duplicate_loop_header_p, + mark_defs_for_rewrite, duplicate_blocks, do_while_loop_p, + copy_loop_headers, gate_ch, pass_ch): Moved to tree-ssa-loop-ch.c. + Use rewrite_ssa_into_ssa. + * tree-ssa-operands.c (copy_virtual_operands): New function. + * tree-ssa-operands.h (copy_virtual_operands): Declare. + * tree.h (struct tree_ssa_name): Add aux field. + (SSA_NAME_AUX): New macro to access it. + +2004-05-28 Aaron W. LaFramboise + + * prefix.c (lookup_key): Cast buffer to LPBYTE. + +2004-06-30 Per Bothner + + Conditionally compile support for --enable-mapped_location. + * input.h: #include line-map.h for source_location typedef. + (BUILTINS_LOCATION, UNKNOWN_LOCATION, expand_location, + LOCATION_FILE, LOCATION_LINE): New macros and functions. + (expanded_location, source_locus): New typedefs. + (push_srcloc): Change parameter list if USE_MAPPED_LOCATION. + * rtl.def (NOTE, ASM_OPERANDS): Modify specifcation, if + USE_MAPPED_LOCATION. + * rtl.h (NOTE_DELETED_LABEL_NAME): New macro. + (NOTE_SOURCE_LOCATION, NOTE_EXPNDED_LOCATION, SET_INSN_DELETED): + New conditional macros. + (ASM_OPERANDS_SOURCE_FILE, ASM_OPERANDS_SOURCE_LINE): Replace + by ASM_OPERANDS_SOURCE_LOCATION if USE_MAPPED_LOCATION. + * tree.h (EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_HAS_LOCATION, + EXPR_LOCUS, SET_EXPR_LOCUS, EXPR_FILENAME, EXPR_LINENO, + DECL_IS_BUILTIN): New macros, most depending on USE_MAPPED__LOCATION. + (tree_exp): Change type of locus to use new source_locus typedef. + * tree.c (build1_stat): Use SET_EXPR_LOCATION. + (annotate_with_locus, annotate_with_file_line): Conditionalize. + (expand_location): New function. + * toplev.c (unknown_location): New static, when USE_MAPPED_LOCATION. + (push_srcloc, pop_loc): Adjust parameter handling. + (process_options): Don't set input_filename by itself. + (lang_dependent_init): Save, set input_location to . + (warn_deprecated_use): Use expand_location. + + * basic-block.h (struct edge_def): Use new source_locus typedef. + * c-common.c (fname_decl): Update save/clear/store of input_location. + (c_do_switch_warnings): Update for USE_MAPPED_LOCATION case. + * c-decl.c: Likewise. + * c-dump.c (dump_stmt): Likewise. + * c-gimplify.c (c-gimplify.c): Generalize using SET_EXPR_LOCATION. + * c-lex.c (cb_line_change): If USE_MAPPED_LOCATION use token's src_loc + to set input_location direction, rather than using linemap_lookup. + (fe_file_change, cb_def_pragma): Again use source_location directly. + * c-opts.c (saved_lineno): Remove static variable. + (c_common_post_options, c_common_init): Don't bothner to save, + clear and restore input_Location - now handled by lang_dependent_init. + * function.c (init_function_start): Use new DECL_IS_BUILTIN macro. + * xcoffout.c (xcoff_assign_fundamental_type_number): Likewise. + * tree-mudflap.c (mf_file_function_line_tree): Take a location_t + rather than a pointer to one. Use expand_location. + (mf_varname_tree): Use expand_location. + * tree-dump.c: Use expand_location on DECL_SOURCE_LOCATION. + * coverage.c: Likewise. + * print-tree.c: Likewise. + * c-aux-info.c (gen_aux_info_record): Likewise. + * c-parse.in: Use SET_EXPR_LOCATION macro. + * gimple-low.c: Likewise. + * tree-mudflap.c: Likewise. + * gimplify.c: Likewise. Also use EXPR_LOCATION and EXPR_HAS_LOCATION. + * c-ppoutput.c: Use new source_location typedef instead of fileline. + * c-semantics.c: Use new macros. + * c-typeck.c: Likewise. + * cfgexpand.c: Handle USE_MAPPED_LOCATION case for function_end_locus. + * cfglayout.c (insn_locators_initialize): Const cleanup. New macros. + * cfgrtl.c (delete_insn): Use new NOTE_DELETED_LABEL_NAME macro. + * print-rtl.c (print_rtx): Likewise. + * emit-rtl.c: Don't clear NOTE_SOURCE_FILE if USE_MAPPED_LOCATION. + * combine.c: Use new SET_INSN_DELETED macro. + * flow.c: Likewise. + * haifa-sched.c: Likewise. + * ifcvt.c: Likewise. + * recog.c: Likewise. + * reload1.c: Likewise. + * diagnostic.c: Use expand_location macro. + * pretty-print.c (pp_base_format_text): Likewise. + * profile.c: Likewise. + * dwarf2out.c: Likewise. Also use expand_location, DECL_IS_BUILTIN. + * dwarf2out.c (dwarf2out_decl: Use BUILTINS_LOCATION. + * emit-rtl.c (emit_line_note): Simplify if USE_MAPPED_LOCATION. + (force_next_line_note, insn_emit): Handle USE_MAPPED_LOCATION case. + * final.c (final): Likewise. + * haifa-sched.c: Likewise. + * integrate.c: Likewise. + * jump.c: Likewise. + * rtl-error.c: Likewise. + * stmt.c (check_seenlabel): Likewise. + * tree-pretty-print.c: Likewise. + * gengtype-lex.l: Temporary kludge to avoid duplicate typedef. + * gengtype.c: Update for now typdefs in input.h. More kludges. + * modulo-sched.c (sms_schedule): Use NOTE_EXPANDED_LOCATION macro. + * ra-debug.c (ra_print_rtl): Likewise. + * sched-rgn.c: Likewise. + * sched-vis.c: Likewise. + * rtl.h (gen_rtx_ASM_OPERANDS): Redefine if USE_MAPPED_LOCATION. + * stmt.c (expand_asm_operands): Adjust calls to gen_rtx_ASM_OPERANDS. + * tree-cfg.c: Use new macros and typedefs. + * tree-flow-inline.h: Likewise. + +2004-06-30 Richard Sandiford + Eric Christopher + + * config/mips/3000.md: Improve description. + +2004-06-30 Paul Brook + + * config/arm/cirrus.md (cirrus_arm_movdi, cirrus_movsf_hard_insn, + cirrus_movdf_hard_insn): Set pool ranges for coprocessor loads. + +2004-06-30 Sebastian Pop + + * Makefile.in (OBJS-common): Add tree-chrec.o. + (tree-chrec.o): New rule. + (GTFILES): Add tree-chrec.h. + * gengtype.c (open_base_files): Add tree-chrec.h. + * tree-chrec.c: New file. + * tree-chrec.h: New file. + * tree.def (SCEV_KNOWN, SCEV_NOT_KNOWN, POLYNOMIAL_CHREC): New nodes. + +2004-06-30 Roger Sayle + + * combine.c: Include "output.h" to define dump_file. + (uid_insn_cost, last_insn_cost): New global variables. + (combine_insn_cost): New function to estimate cost of an insn. + (combine_validate_cost): New function to determine whether a + try_combine replacement sequence is cheaper than the original. + (combine_instructions): Allocate and populate uid_insn_cost + array at the start of the combine pass, and deallocate it after. + (try_combine): Check combine_validate_cost to determine whether + a "recombination" should be rejected as being more expensive. + * Makefile.in (combine.o): Add dependency upon output.h. + +2004-06-30 Roger Sayle + + * config/rs6000/rs6000.c (rs6000_rtx_costs) : Handle + subtractions identically to additions, always COSTS_N_INSNS (1). + +2004-06-30 J"orn Rennecke + + * expmed.c (expand_smod_pow2): Fix sign of mask. + +2004-06-29 Diego Novillo + + * tree-ssa-pre.c (phi_trans_add): Use is_gimple_min_invariant + to check for constants. + (set_remove): Likewise. + (value_replace_in_set): Likewise. + (find_leader): Likewise. + * tree-vn.c (set_value_handle): Likewise. + (vn_lookup): Likewise. + (vn_lookup_or_add): Likewise. + +2004-06-30 Eric Botcazou + + RTL prologue/epilogue for SPARC + * config/sparc/sparc-protos.h (sparc_emitting_epilogue): Delete. + (sparc_skip_caller_unimp): Likewise. + (load_pic_register): Likewise. + (leaf_return_peephole_ok): Likewise. + (compute_frame_size): Rename into sparc_compute_frame_size. + (sparc_expand_prologue): New prototype. + (sparc_expand_epilogue): Likewise. + (output_return): Likewise. + (eligible_for_epilogue_delay): Rename into eligible_for_return_delay. + * config/sparc/sparc.h (INITIAL_ELIMINATION_OFFSET): Adjust call to + compute_frame_size. Move comment up. + (DELAY_SLOTS_FOR_EPILOGUE): Delete. + (ELIGIBLE_FOR_EPILOGUE_DELAY): Likewise. + (EPILOGUE_USES): Return true for %g1 if the function uses EH return. + * config/sparc/sparc.md (UNSPECV_SAVEW): New constant. + (type attribute): Add 'return' and 'savew'. + (eligible_for_return_delay): New attribute. + (return): New delay_slot. + (sibcall_epilogue): Call sparc_expand_epilogue. + (prologue): Likewise. Move up. + (save_register_window): New expander. + (save_register_windowsi): New pattern. + (save_register_windowdi): Likewise. + (epilogue): New expander. + (return_internal): New pattern. + (Return peepholes): Delete. + * config/sparc/sparc.c (SIBCALL_SLOT_EMPTY_P): New macro. + (sparc_emitting_epilogue): Delete. + (sparc_skip_caller_unimp): Likewise. + (sparc_sr_alias_set): New global variable. + (frame_base_name): Delete. + (frame_base_reg): New global variable. + (sparc_override_options): Get new alias set for save/restore. + (leaf_return_peephole_ok): Delete. + (eligible_for_epilogue_delay): Rename into eligible_for_return_delay. + Factor out code into eligible_for_restore_insn_delay. + (eligible_for_restore_insn_delay): New function extraced from above. + Use IN_UNCOND_BRANCH_DELAY_TRUE instead of IN_BRANCH_DELAY_TRUE. + (eligible_for_sibcall_delay): Use SIBCALL_SLOT_EMPTY_P. + Factor out code into eligible_for_restore_insn_delay. + (load_pic_register): Make static. Remove check. + (save_regs): Delete. + (restore_regs): Likewise. + (compute_frame_size): Rename into sparc_compute_frame_size. + Rename leaf_function into leaf_function_p. + (build_big_number): Delete. + (save_or_restore_regs): New function. + (emit_save_regs): Likewise. + (emit_restore_regs): Likewise. + (emit_stack_pointer_increment ): Likewise. + (emit_stack_pointer_decrement): Likewise. + (sparc_expand_prologue): Likewise. + (sparc_function_prologue): Rename into sparc_asm_function_prologue. + Remove all code to emit instructions. + (sparc_expand_epilogue): New function. + (sparc_function_epilogue): Rename into sparc_asm_function_epilogue. + Remove all code to emit instructions. + (output_restore): New function. + (output_return): Likewise. + (output_sibcall): Factor out code into output_restore. + (print_operand): Adjust for frame_base_reg. + * target.h (struct gcc_target): New field 'late_rtl_prologue_epilogue'. + * target-def.h (TARGET_LATE_RTL_PROLOGUE_EPILOGUE): New define. + (TARGET_INITIALIZER): Add it. + * passes.c (rest_of_compilation): Set the conditional predicate + 'current_function_uses_only_leaf_regs' before sched2. If target + has 'late_rtl_prologue_epilogue', emit RTL prologue/epilogue right + before sched2. + * reorg.c (return_insn_p): New predicate. + (find_end_label): Use it. + (relax_delay_slots): Do not thread an unconditional jump that points + to the end return label. + * doc/tm.texi (Registers) : Clarify the validity + domain of 'current_function_uses_only_leaf_regs'. + (Stack and Calling) : Document new target hook + TARGET_LATE_RTL_PROLOGUE_EPILOGUE. + +2004-06-30 Jakub Jelinek + + * simplify-rtx.c (simplify_binary_operation): Simplify + ((A & N) + B) & M -> (A + B) & M if M is pow2 minus 1 constant and + N has at least all bits in M set as well. + + PR tree-optimization/15310 + * expr.c (expand_assignment): Optimize += or -= on a bit field in + most significant bits. + +2004-06-30 Steven Bosscher + + * config/c4x/c4x.md: Fix comment. + +2004-06-30 Akos Kiss + + * arm.md (cond_return_inverted): Add "length" attribute. + +2004-06-29 Per Bothner + + * config/i386/winnt.c (i386_pe_encode_section_info): Smash rtlname's + XSTR in place, so we don't lose SYMBOL_REF_DECL info. + +2004-06-29 Zack Weinberg + + * config/ia64/hpux.h: Target does too support thread-local storage. + +2004-06-29 Zack Weinberg + + * combine.c (distribute_notes): Don't look at global_regs for + pseudos. + +2004-06-29 Richard Henderson + + * gimplify.c (gimplify_modify_expr_rhs): Move immediately before + gimplify_modify_expr. + (gimplify_init_constructor): Likewise. Gimplify the null + CONSTRUCTOR assignment. + (gimplify_modify_expr_to_memcpy): New. + (gimplify_modify_expr_to_memset): New. + (gimplify_modify_expr): Use them. + +2004-06-29 Roman Zippel + + * web.c (union_defs): use all defs of an instruction to create a + union with a read/write use + +2004-06-29 Richard Henderson + + PR middle-end/16216 + * builtins.c (gimplify_va_arg_expr): Check for valist being + an error_mark_node. + +2004-06-29 Jakub Jelinek + + PR target/16195 + * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make + r30 fixed if TARGET_TOC && TARGET_MINIMAL_TOC. + (first_reg_to_save): Pretend call_used_regs[30] is 0 if + TARGET_TOC && TARGET_MINIMAL_TOC. + (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise. + +2004-06-29 J"orn Rennecke + + Fix gcc.dg/builtin-apply2.c failures: + * sh.h (TARGET_VARARGS_PRETEND_ARGS): Define. + * sh.c (extra_push): Delete. + (sh_expand_prologue): Don't do extra stack adjustment for + current_function_pretend_args_size if it comes from varargs setup. + Use TARGET_VARARGS_PRETEND_ARGS. Don't set extra_push. + (sh_expand_epilogue): Don't use extra_push. + (sh_setup_incoming_varargs): Set pretend_arg_size when necessary. + +2004-06-29 Roger Sayle + + * expmed.c (expand_smod_pow2): Provide alternate implementations + that avoid conditional jumps, and choose between them based upon + the target's rtx_costs. + +2004-06-29 Andrew Pinski + + * tree-sra.c: Include expr.h for definition of MOVE_RATIO. + * Makefile.in (tree-sra.c): Update dependencies. + +2004-06-29 Richard Henderson + + * tree-sra.c: Rewrite from scratch. Handle nested aggregates. + +2004-06-29 Nathan Sidwell + + * vec.h (VEC_T_safe_push, VEC_T_safe_insert): Tweak for when + size_t is bigger than int. + +2004-06-29 Paul Brook + + * target-def.h (TARGET_CXX_GET_COOKIE_SIZE, + TARGET_CXX_COOKIE_HAS_SIZE): Define. + (TARGET_CXX): Use them. + * target.h (struct gcc_target): Add cxx.get_cookie_size and + cxx.cookie_has_size. + * targhooks.c (default_cxx_get_cookie_size): New fucntion. + * targhooks.h (default_cxx_get_cookie_size): Add prototype. + * config/arm/arm.c (TARGET_CXX_GET_COOKIE_SIZE, + TARGET_CXX_COOKIE_HAS_SIZE): Define. + (arm_get_cookie_size, arm_cookie_has_size): New functions. + * Make-lang.in (cp/init.o): Add dependency on $(TARGET_H). + * doc/tm.texi: Document TARGET_CXX_GET_COOKIE_SIZE and + TARGET_CXX_COOKIE_HAS_SIZE. + +2004-06-29 J"orn Rennecke + + * cfglayout.c (fixup_reorder_chain): Don't do anything for + e_fall->dest == EXIT_BLOCK_PTR. + +2004-06-28 Richard Henderson + + * tree-cfg.c (verify_stmt): Add last_in_block parameter. Verify + that eh stmts can throw. + (verify_stmts): Update verify_stmt call. + (tree_purge_dead_eh_edges, tree_purge_all_dead_eh_edges): New. + * tree-eh.c (remove_stmt_from_eh_region): New. + (lower_eh_constructs): Fix throw_stmt_table delete routine. + (tree_could_trap_p): Match may_trap_p. + (maybe_clean_eh_stmt): New. + * tree-flow.h: Update decls. + * tree-ssa-ccp.c (pass_ccp): Add TODO_verify_stmts. + (substitute_and_fold): Clean eh edges. + * tree-ssa-dce.c (mark_control_dependent_edges_necessary): Handle + empty basic blocks. + * tree-ssa-dom.c (need_eh_cleanup): New. + (tree_ssa_dominator_optimize): Allocate it. Cleanup eh edges. + (optimize_stmt): Cleanup eh stmts; set need_eh_cleanup. + +2004-06-29 Alan Modra + + * function.c (assign_parms): Don't abort with zero size stack + parm failing the PARM_BOUNDARY check. + +2004-06-28 Diego Novillo + + * common.opt (ftree-fre): New flag. + * flags.h (flag_tree_fre): Declare. + * opts.c (decode_options): Set. + * timevar.def (TV_TREE_FRE): Define. + * tree-flow-inline.h (may_propagate_copy): Re-arrange for + readability. Handle destinations that are not SSA_NAMEs. + * tree-flow.h (struct ptr_info_def): Move from tree.h + (cprop_into_stmt, cprop_into_successor_phis): Remove. + (vn_compute, vn_lookup_or_add, vn_add, vn_lookup): Add + vuse_optype parameter. + * tree-pass.h (pass_fre): Declare. + * tree-ssa-copy.c (cprop_operand): Move to tree-ssa-dom.c + (cprop_into_stmt): Likewise. + (cprop_into_successor_phis): Likewise. + * tree-ssa-dom.c (eliminate_redundant_computations): Fix + argument ordering in call to may_propagate_copy. + * tree-ssa-pre.c (is_undefined_value): Assume hard registers + to be always defined. + (add_to_sets): New local function. + (create_value_expr_from): New local function. + (compute_avail): Call them. + (eliminate): Don't ignore statements with virtual operands. + (init_pre): New local function. + (fini_pre): New local function. + (execute_pre): Call them. + Add argument DO_FRE. Don't do insertion if DO_FRE is true. + (do_pre): New function. + (do_fre): New function. + (gate_fre): New function. + (pass_fre): Declare. + * tree-ssa.c (init_tree_ssa): Don't call vn_init. + (delete_tree_ssa): Don't call vn_delete. + * tree-vn.c (val_expr_pair_d): Add documentation. + (vn_compute): Add VUSES argument to incorporate in computing + hash values. Update all callers. + (expressions_equal_p): Call operand_equal_p with + OEP_PURE_SAME. + (vn_add): Add VUSES argument. Update all callers. + (vn_lookup): Likewise. + (vn_lookup_or_add): Likewise. + * doc/invoke.texi: Document -ftree-fre and -fdump-tree-fre. + +2004-06-28 Steven Bosscher + + * config/m32r/m32r.c (m32r_sched_odd_word_p, m32r_adjust_cost, + m32r_sched_init, m32r_sched_reorder, m32r_variable_issue): Remove. + (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_VARIABLE_ISSUE, + TARGET_SCHED_INIT, TARGET_SCHED_REORDER): Don't define. + * config/m32r/m32r.md: Rewrite the pipeline description as a DFA. + +2004-06-28 Richard Henderson + + * tree.def (REALPART_EXPR, IMAGPART_EXPR): Change class to 'r'. + * fold-const.c (operand_equal_p ): Add REALPART_EXPR, + IMAGPART_EXPR. + * tree-dump.c (dequeue_and_dump): Handle REALPART_EXPR and + IMAGPART_EXPR explicitly. + * tree-inline.c (estimate_num_insns_1): Don't handle REALPART_EXPR + and IMAGPART_EXPR specially. + * tree.c (build1_stat): Copy TREE_THIS_VOLATILE into class 'r'. + +2004-06-28 J"orn Rennecke + + * config.gcc (sh*-*elf*): Remove dead assignment of sh_multilibs. + +2004-06-28 Joseph S. Myers + + * builtins.def (execl, execlp, execle, execv, execvp, execve, + fork): Change to DEF_EXT_LIB_BUILTIN. + +2004-06-28 Roger Sayle + + * expmed.c (expand_smod_pow2): New function to expand signed + remainder by a constant power of 2, such as "x % 16". + (expand_divmod): Call new expand_smod_pow2 when appropriate. + Minor corrections to comments, e.g. wrapping long lines. + +2004-06-28 Ulrich Weigand + + * Makefile.in (vec.o): Fix dependencies. + +2004-06-28 Andreas Tobler + + * Makefile.in: Fix parallel make dependency problem on vec.o. + +2004-06-28 Dhananjay Deshpande + + PR target/14041 + * config/h8300/h8300.h (ASM_OUTPUT_ALIGNED_BSS): Define. + +2004-06-28 Nathan Sidwell + + * tree.h (tree_check_failed): Make varadic. + (tree_not_check_failed): New prototype. + (tree_check2_failed, tree_check3_failed, + tree_check4_failed, tree_check5_failed): Remove. + (TREE_CHECK, TREE_CHECK2, TREE_CHECK3, TREE_CHECK4, + TREE_CHECK5): Adjust. + (TREE_NOT_CHECK, TREE_NOT_CHECK2, TREE_NOT_CHECK3, TREE_NOT_CHECK4, + TREE_NOT_CHECK5): New. + (TREE_VEC_ELT_CHECK, PHI_NODE_ELT_CHECK, TREE_OPERAND_CHECK_CODE, + TREE_RTL_OPERAND_CHECK): Adjust. + * tree.c (tree_check_failed): Make varadic. + (tree_not_check_failed): New. + (tree_check2_failed, tree_check3_failed, + tree_check4_failed, tree_check5_failed): Remove. + +2004-06-28 Ulrich Weigand + + * combine.c (can_combine_p): Do not prevent building insns that use + and clobber the same fixed hard register. + (reg_dead_at_p): Likewise. + +2004-06-28 Richard Kenner + + * tree-sra.c (is_sra_candidate_ref): Remove second arg; all callers + changed. + (is_sra_candidate_complex_ref): New function. + (scalarize_modify_expr): Call it and check for LHS also. + + * tree-pretty-print.c (dump_function_declaration): New. + (dump_generic_node, case FUNCTION_TYPE): Call it. + (dump_generic_node, case RECORD_TYPE): Don't output dup semicolon. + (dump_generic_node, case DECL_EXPR): New case. + (dump_generic_node, case PLACEHOLDER_EXPR): Handle. + (print_declaration): Handle type and function declarations. + + * tree-nested.c (create_tmp_var_for): Allow ARRAY_TYPE. + (convert_nonlocal_reference, convert_local_reference): Properly + convert nest of handled component references. + +2004-06-28 Nathan Sidwell + + * vec.h, vec.c: New, type safe vector API. + * Makefile.in (OBJS-common): Add vec.o. + (vec.o): New target. + (gengtype-lex.o): Depend on vec.h. + +2004-06-28 Paolo Bonzini + + * fold-const.c (fold_cond_expr_with_comparison): Add ARG1 + parameter. Use it instead of ARG00 to produce the result. + +2004-06-28 Alexandre Oliva + + * config/mn10300/mn10300-protos.h (legitimate_address_p): Declare. + * config/mn10300/mn10300.c (legitimate_address_p): New. Test that + index is legitimate, compared with code moved from... + * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): here. + (REG_STRICT): Define, according to REG_OK_STRICT. + (REGNO_IN_RANGE_P, REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_SP_P, + REGNO_EXTENDED_P, REGNO_AM33_P, REGNO_FP_P): Introduce strict + argument. + (REGNO_STRICT_OK_FOR_BASE_P, REGNO_STRICT_OK_FOR_BIT_BASE_P, + REGNO_STRICT_OK_FOR_INDEX_P): New. + (REGNO_OK_FOR_BASE_P, REG_OK_FOR_BASE_P, REGNO_OK_FOR_BIT_BASE_P, + REG_OK_FOR_BIT_BASE_P, REGNO_OK_FOR_INDEX_P, REG_OK_FOR_INDEX_P, + RTX_OK_FOR_BASE_P): Use them. + +2004-06-28 Ben Elliston + + * doc/cfg.texi (Basic Blocks): Define dominators. + +2004-06-27 Andrew Pinski + + PR c++/16205 + * c-common.c (warn_for_collisions_1): Warn for only decls which + have a name. + + PR c++/15145 + * c.opt (Wsequence-point): Enable for C++ and ObjC++. + + PR c/14963 + * c-decl.c (start_decl): Check for null types. + +2004-06-27 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_legitimate_offset_address_p): + Accept TOC addresses. + +2004-06-27 Ulrich Weigand + + * config/s390/s390-protos.h (s390_load_got): Update prototype. + * config/s390/s390.c (struct machine_function): Add member base_reg. + (s390_decompose_address): Accept UNSPEC_LTREF. Simplify logic. + (s390_split_branches): Annotate late pool references. + (annotate_constant_pool_refs): New function. + (find_constant_pool_ref): Work on annotated pool references. + (replace_constant_pool_ref): Likewise. Use explicit base. + (replace_ltrel_base): Use explicit base. + (s390_mainpool_start): Reflect main_pool pattern change. + (s390_mainpool_finish): Use base register from main_pool. + Update calls to replace_ltrel_base and replace_constant_pool_ref. + (s390_chunkify_start): Use base_reg from struct machine_function. + (s390_chunkify_finish): Remove base_reg argument. Update calls + to replace_ltrel_base and replace_constant_pool_ref. + (s390_reorg): Don't decide upon base register. Update calls. + (s390_load_got): Remove MAYBE_DEAD handling. Do not emit insns + but return sequence instead. + (s390_emit_prologue): Decide upon base register to use. Annotate + all literal pool references. Adapt to main_pool pattern change. + Update s390_load_got call; move MAYBE_DEAD handling here. + (s390_emit_epilogue): Annotate late literal pool references. + Remove barrier before register restore instruction. + * config/s390/s390.md (UNSPEC_LTREF): New constant. + ("builtin_setjmp_receiver"): Update s390_load_got call. + ("main_pool"): Explicitly reference base register. + +2004-06-27 Roger Sayle + + * fold-const.c (fold) : Optimize ~X|X and X|~X as -1. + : Optimize ~X|X and X|~X as -1. + : Optimize ~X&X and X&~X as 0. + : Optimize !X&&X and X&&!X as false. + : Optimize !X||X and !X||X as true. + : Optimize !X^X and X^X! as true. Now that + TRUTH_XOR_EXPR is a commutative tree code, don't test whether arg0 + is a constant. + +2004-06-26 Richard Kenner + + * c-common.c (c_safe_from_p, c_walk_subtrees): Deleted. + * c-common.def (DECL_STMT): Remove. + * c-common.h (DECL_STMT_DECL): Deleted. + (COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL. + (c_safe_from_p, c_walk_subtrees): Deleted. + * c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR. + * c-dump.c (c_dump_tree, case DECL_STMT): Deleted. + * c-gimplify.c (gimplify_decl_stmt): Deleted. + (gimplify_compound_literal_expr): Use DECL_EXPR_DECL + and gimplify_and_add. + (c_gimplify_expr, case DECL_EXPR): New case. + (c_gimplify_expr, case DECL_STMT): Deleted. + * c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise. + (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise. + * expr.c (safe_from_p, case 's'): New case. + * gimplify.c (gimplify_decl_expr): New function. + (gimplify_expr, case DECL_EXPR): New case. + * tree-inline.c (walk_tree): Walk into all fields of a type and + decl only if they are in a DECL_EXPR. + (mark_local_for_remap_r): Minor code cleanup. + * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else. + * tree.c (has_cleanups, case DECL_EXPR): New case. + * tree.def (DECL_EXPR): New code. + * tree.h (DECL_EXPR_DECL): New macro. + + * objc/objc-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted. + +2004-06-26 Andrew Pinski + + PR 13334 + * doc/install.texi: Document non-standard CFLAGS and bootstrap + failures and warnings. + +2004-06-26 Andrew Haley + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Check + TREE_THIS_NOTRAP when setting MEM_NOTRAP_P. + * tree-eh.c (tree_could_trap_p): Check TREE_THIS_NOTRAP. + * tree.h (TREE_THIS_NOTRAP): New. + +2004-06-26 Kaz Kojima + + * genattrtab.c (write_test_expr): Put a unsigned cast before + the first operand for GEU, GTU, LEU and LTU. + +2004-06-26 Kazu Hirata + + * c-typeck.c, cfgexpand.c, ddg.c, ddg.h, df.c, fold-const.c, + gcov.c, gimplify.c, modulo-sched.c, passes.c, tree-cfg.c, + tree-mudflap.c, tree-nrv.c, tree-outof-ssa.c, tree-ssa-dom.c, + tree-ssa-dse.c, tree-ssa-operands.c, tree-ssa-pre.c, + tree-tailcall.c: Fix comment typos. Follow spelling + conventions. + +2004-06-25 Eric Christopher + + * config/mips/mips.md: Add back scheduling exclusion info. + +2004-06-25 Roger Sayle + + * ifcvt.c (seq_contains_jump): Delete function. + (end_ifcvt_sequence): Replace call to seq_contains_jump with an + inline test for a jump instruction in the existing "insn" loop. + (block_fallthru): Document function. + +2004-06-25 Philip Blundell + + PR wrong-code/15089 + * loop.c (scan_loop): Do not move user-specified register + assignments. + +2004-06-25 DJ Delorie + + * c-common.h (warn_cast_qual, warn_missing_format_attribute, + warn_pointer_arith, warn_missing_prototypes, warn_parentheses, + warn_missing_braces, warn_sign_compare, warn_long_long, + warn_redundant_decls, warn_float_equal, warn_char_subscripts, + warn_conversion, warn_format_y2k, warn_format_extra_args, + warn_format_zero_length, warn_format_nonliteral, + warn_format_security, mesg_implicit_function_declaration, + warn_bad_function_cast, warn_traditional, + warn_declaration_after_statement, warn_strict_prototypes, + warn_missing_declarations, warn_nested_externs, + warn_sequence_point, warn_init_self, warn_div_by_zero, + warn_implicit_int, warn_nonnull, warn_old_style_definition, + warn_selector, warn_undeclared_selector, warn_protocol, + warn_abi, warn_invalid_offsetof, warn_ctor_dtor_privacy, + warn_overloaded_virtual, warn_nonvdtor, warn_reorder, + warn_synth, warn_pmf2ptr, warn_ecpp, warn_sign_promo, + warn_old_style_cast, warn_nontemplate_friend, + warn_deprecated): Remove explicit declarations. + * c-common.c: Likewise, remove explicit definitions. + * c-opts.c: Likewise, remove explicit assignments. + * c.opts: Likewise, add implicit declare/define/assign. + +2004-06-25 Richard Kenner + + * gimplify.c (lookup_tmp_var): Set TREE_READONLY in is_formal case. + (build_addr_expr_with_type): Deleted. + (build_addr_expr): Deleted; callers changed to build_fold_addr_expr. + (gimplify_compound_lval): Make two passes over reference nest. + + * tree-nested.c (build_addr): Merge real/imagpart with + handled_component_p. + (convert_nonlocal_reference, convert_local_reference): Process extra + args to COMPONENT_REF and ARRAY_REF. + * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Check for + lower bound and field offset being constant. + +2004-06-25 Mark Mitchell + + PR wrong-code/16129 + * alias.c (get_alias_set): Adjust setting of + DECL_POINTER_ALIAS_SET for pointers to aggregates. + +2004-06-24 Richard Kenner + + * tree-inline.c (remap_type): Arrange to have just one pointer type + for each type, mode, and 'can alias' value. + (setup_one_parameter): Remap type when making VAR_DECL for PARM_DECL. + (estimate_num_insns_1): Minor code reformatting. + (inline_forbidden_p_1): Likewise; add; missing return statement. + +2004-06-25 Roger Sayle + + PR middle-end/15825 + * ifcvt.c (unshare_ifcvt_sequence): Rename to end_ifcvt_sequence. + Use get_isns and end_sequence instead of accepting a seq argument. + Scan the instruction sequence for unrecognizable or jump insns. + (noce_try_move, noce_try_store_flag, noce_try_store_flag_constants, + noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove, + noce_try_cmove_arith, noce_try_minmax, noce_try_abs, + noce_try_sign_mask): Use end_ifcvt_sequence to factor common code. + +2004-06-24 Jeff Law + + * gimplify.c (gimplify_compound_lval): Reset TREE_SIDE_EFFECTS + after gimplifying the innermost component. + +2004-06-25 Richard Sandiford + + PR target/16176 + * config/mips/mips.c (mips_expand_unaligned_load): Use a temporary + register for the destination of the lwl or ldl. + +2004-06-25 Richard Kenner + + * tree-dfa.c (get_virtual_var): Merge real/imaginary parts with + handled_component_p handling. + * tree-gimple.c (get_base_address): Likewise and fix typo that + caused both recursion and looping. + + * tree-cfg.c (verify_expr): Add macro CHECK_OK. + Properly test for nest of handled_components in LHS context. + +2004-06-25 Devang Patel + + * doc/tree-ssa.texi: Document info about MODIFY_EXPR's type + +2004-06-25 Paul Brook + + * target-def.h (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT, + TARGET_CXX): Define. + (TARGET_INITIALIZER): Use TARGET_CXX. + * target.h (struct gcc_target): Add struct cxx. + * targhooks.h (default_cxx_guard_type): Add prototype. + * targhooks.c (default_cxx_guard_type): New function. + * config/arm/arm.c (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT): + Define. + (arm_cxx_guard_type, arm_cxx_guard_mask_bit): New functions. + * doc/tm.texi: Document TARGET_CXX_GUARD_TYPE and + TARGET_CXX_GUARD_MASK_BIT. + +2004-06-25 Devang Patel + + * config/rs6000/darwin.h (CC1_SPEC): Handle -gused and -gfull. + * config/i386/darwin.h (CC1_SPEC): Same. + +2004-06-25 Mark G. Adams + + * dbxout.h: Add include guards + +2004-06-25 Paul Brook + + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_EABI__. + +2004-06-25 Richard Earnshaw + + * arm.c (arm_arch4t): New variable. + (arm_override_options): Initialize it. If compiling for armv5 or + higher clear TARGET_INTERWORK. + (output_call): Abort if called for armv5. Use BX if it's available. + (output_call_mem): Use BLX if available and ensure that all armv5 + code is interworking safe. + (output_return_instruction): Always use BX in preference to MOV if + it's available. + (arm_output_epilogue): Likewise. + (arm_final_prescan_insn): Never conditionally call a subroutine + on armv5. + * arm.h (arm_arch4t): Declare. + * arm.md (call_reg_armv5, call_value_reg_armv5): New. + (call_reg_arm, call_value_reg_arm): Renamed from call_reg and + call_value_reg respectively. + (call_reg_thumb_v5, call_value_reg_thumb_v5): New. + (call_reg_thumb, call_value_reg_thumb): Renamed from call_indirect + and call_value_indirect respectively. + +2004-06-25 Richard Sandiford + + * config/mips/mips.c (reg_or_const_float_1_operand): Reimplement + in terms of const_float_1_operand. + +2004-06-25 Richard Sandiford + + PR target/16144 + * config/mips/mips.md (divsf, divdf): Don't FAIL if the first operand + is 1.0; force it into a register instead. + +2004-06-25 Bernardo Innocenti + + * config/m68k/m68k.h: Restore valid comment removed by mistake with + the recent m68k comments cleanup. + +2004-06-24 Richard Kenner + + * c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add. + * gimplify.c (internal_get_tmp_var, gimplify_return_expr): Likewise. + (gimplify_loop_expr, gimplify_init_constructor): Likewise. + (gimplify_self_mod_expr, gimplify_cond_expr): Likewise. + + PR/16131 + * gimplify.c (voidify_wrapper_expr): Allow TARGET_EXPR. + + * gimplify.c: Remove unneeded forward declarations. + + * gimplify.c (append_to_compound_expr): Deleted. + * tree-gimple.h (append_to_compound_expr): Deleted. + + * fold-const.c (fold_addr_expr_with_type): Look through all + valid LHS modifiers to find a base to mark addressable. + + * tree.h (debug_find_tree): Add declaration. + * tree-inline.c (debug_find_tree): Remove extern declaration. + +2004-06-24 Eric Christopher + + * config/rs6000/rs6000.md: Apply change mistakenly + deleted with 2004-06-22 patch. + +2004-06-24 Richard Henderson + + * c-decl.c (c_in_iteration_stmt, c_in_case_stmt): Remove. + (c_break_label, c_cont_label): New. + (start_function): Update initializations. + (c_push_function_context): Update saves. + (c_pop_function_context): Update restores. + * c-parse.in: Update expected conflicts. + (stmt_count, compstmt_count): Remove. Remove all updates. + (if_prefix, simple_if, do_stmt_start): Remove. + (lineno_labeled_stmt): Remove. + (lineno_labels): New. + (c99_block_lineno_labeled_stmt): Use it. + (lineno_stmt, lineno_label): Don't clear EXPR_LOCUS before calling + annotate_with_locus. + (select_or_iter_stmt): Replace by ... + (condition, if_statement_1, if_statement_2, if_statement, + start_break, start_continue, while_statement, do_statement, + for_cond_expr, for_incr_expr, for_statement, switch_statement): New. + (stmt): Split out ... + (stmt_nocomp): ... this. Use c_finish_bc_stmt, c_finish_goto_label, + c_finish_goto_ptr. + * c-semantics.c (add_stmt): Don't add line numbers to labels. + * c-tree.h: Update prototypes. + (struct language_function): Remove x_in_iteration_stmt, x_in_case_stmt; + add x_break_label, x_cont_label, x_switch_stack. + (c_switch_stack): Declare. + * c-typeck.c (c_finish_goto_label, c_finish_goto_ptr): New. + (c_finish_return): Return the statement. + (c_switch_stack): Rename from switch_stack; export. + (if_elt, if_stack, if_stack_space, if_stack_pointer): Remove. + (c_begin_if_stmt, c_finish_if_cond, c_finish_then, c_begin_else, + c_finish_else): Remove. + (c_finish_if_stmt): Rewrite to perform the entire operation. + (c_begin_while_stmt, c_finish_while_stmt_cond, c_finish_while_stmt, + c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond, + c_finish_for_stmt_incr, c_finish_for_stmt): Remove. + (c_finish_loop): New. + (c_finish_bc_stmt): New. + (c_finish_expr_stmt): Return the statement. Split out... + (c_process_expr_stmt): ... this. Don't add locus to error marks. + * gimplify.c (gimplify_cond_expr): Accept NULL type statements. + * tree-gimple.c (is_gimple_stmt): Likewise. + * tree-pretty-print.c (dump_generic_node ): Likewise. + (print_struct_decl): Delete empty compound statement. + * objc/objc-act.c (objc_build_throw_stmt): Return the statement. + * objc/objc-act.h: Update decl. + +2004-06-24 Richard Kenner + + * tree-pretty-print.c (dump_generic_node, case TYPE_DECL): + Don't look at TYPE_METHODS unless RECORD_TYPE or UNION_TYPE. + +2004-06-24 Andrew Pinski + + * objc-act.c (build_objc_method_call): Save the lookup_object + so we do not call it twice. + +2004-06-24 Richard Henderson + + * tree-ssa-dom.c (real_avail_expr_hash): New. + (tree_ssa_dominator_optimize): Use it in the htab. + +2004-06-24 Frank Ch. Eigler + + * tree-mudflap.c (mx_register_decls): Add third (type) argument + to synthesized __mf_unregister call. + +2004-06-24 Roger Sayle + + PR middle-end/15239 + * expmed.c (expand_mult): Remove artificial restriction on the + maximum cost of a synthetic multiplication sequence. + +2004-06-24 Eric Christopher + + * combine.c (distribute_notes): Don't delete sets to + global register variables. + +2004-06-24 Jakub Jelinek + + * config/i386/i386.md (ffsdi2, clzdi2): New expanders. + (ffs_rex64): New splitter. + (ffsdi_1, ctzdi2, bsr_rex64): New instructions. + +2004-06-24 Andrew Pinski + + * config/darwin7.h (MATH_LIBRARY): Remove. + (LIB_SPEC): Define. + * config/darwin.h (MATH_LIBRARY): Define always to empty. + (LIB_SPEC): Only define if not already defined. + +2004-06-24 Revital Eres + + * loop-iv.c (iv_analyze, simple_set_p): Support for identifying + shifts of induction variable. + (iv_shift): New function. + +2004-06-24 Richard Henderson + + * gimplify.c (gimplify_body): Watch for body vanishing. + +2004-06-24 Jeff Law + + * tree-ssa-dom.c (record_dominating_conditions): New function. + (dom_opt_finalize_block, get_eq_expr_value): Use it. + +2004-06-24 Richard Sandiford + + * calls.c (shift_returned_value): Fix handling of non-integer + TYPE_MODEs. + +2004-06-24 Ulrich Weigand + + * c-decl.c (finish_function): Do not check for DEFAULT_MAIN_RETURN. + * system.h (DEFAULT_MAIN_RETURN): Poison. + * doc/tm.texi (DEFAULT_MAIN_RETURN): Remove documentation. + +2004-06-24 Ben Elliston + + * doc/cfg.texi (Edges): Fix typo. + +2004-06-24 Paul Brook + + * config/arm/arm.c (arm_output_epilogue): Remove excess checks. + +2004-06-23 Andrew Pinski + + PR middle-end/15988 + * fold-const.c (fold_convert): Types which are compatible + can be converted with only a NOP_EXPR. + +2004-06-24 Alan Modra + + * calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and + pass raw n_named_args to it. + * targhooks.c: Formatting. + (hook_bool_CUMULATIVE_ARGS_false): Correct comment. + +2004-06-23 Richard Henderson + + * c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside + non-constant size check. Gimplify the type too. Tidy building + BUILT_IN_STACK_ALLOC call. + +2004-06-23 Roger Sayle + + * c-common.c (expand_unordered_cmp): Delete. + (expand_tree_builtin): Delete. + * c-common.h (expand_tree_builtin): Delete function prototype. + * c-typeck.c (build_function_call): Don't call expand_tree_builtin. + +2004-06-23 Richard Henderson + + * gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or + COMPONENT_REF variable fields unless they're non-constant. + +2004-06-23 Robert Millan + + * config.gcc: Merge kfreebsd*-gnu with linux* and add knetbsd*-gnu. + * config/i386/linux.h: Allow overriding of LINK_EMULATION, + DYNAMIC_LINKER and register names in sc_ structure. + * config/kfreebsd-gnu.h: New. kfreebsd-gnu followup for linux.h. + * config/i386/kfreebsd-gnu.h: New. Ditto for i386-kfreebsd-gnu. + * config/knetbsd-gnu.h: New. Ditto for knetbsd-gnu. + * config/i386/knetbsd-gnu.h: New. Ditto for i386-knetbsd-gnu. + + * config/kfreebsdgnu.h: Remove. + * config/t-kfreebsd-gnu: Likewise. + * config/i386/kfreebsdgnu.h: Likewise. + +2004-06-23 Eric Christopher + + * fold-const.c (make_range): Cleanup type checking through function. + Remove orig_type. Replace with checks to exp_type and arg0_type. + Clarify comment when converting from unsigned to signed. + +2004-06-23 Eric Christopher + + * config/mips/mips.c (mips_use_dfa_pipeline_interface): Add R3000. + * config/mips/mips.md: Remove R3000 scheduling description. + * config/mips/3000.md: New file. + +2004-06-23 Ulrich Weigand + + * config/s390/s390-protos.h (s390_emit_compare): Add prototype. + (s390_emit_jump): Likewise. + * config/s390/s390.c (s390_emit_compare): New function. + (s390_emit_jump): Likewise. + * config/s390/s390.md ("beq", "bne", "bgt", "bgtu", "blt", "bltu", + "bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq", + "bungt", "bunlt", "bunge", "bunle", "bltgt"): Use s390_emit_compare + and s390_emit_jump. + ("cjump"): Remove, replace by ... + ("*cjump_64", "*cjump_31"): ... these insns. Improve length default. + ("icjump", "*icjump_64", "*icjump_31"): Likewise. + ("trap"): Fix type attribute. + ("conditional_trap"): Use s390_emit_compare. + ("doloop_si"): Remove, replace by ... + ("doloop_si64", "doloop_si31"): ... these new insn_and_split. + Merge existing splitter into insn_and_split. Improve length default. + ("doloop_di"): Merge with existing splitter into insn_and_split. + ("doloop"): Adapt. + ("jump"): Convert to expander. Use s390_emit_jump. + ("*jump_64", "*jump_31"): New insns. Improve length default. + +2004-06-23 Wu Yongwei + + * gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. + (__gthr_i486_lock_cmp_xchg): New inline assembly function. + (__GTHR_W32_InterlockedCompareExchange): New macro to choose a + suitable function for interlocked compare-and-exchange. + (__gthread_mutex_trylock): Use + __GTHR_W32_InterlockedCompareExchange. + (__gthread_mutex_init_function, __gthread_mutex_lock, + __gthread_mutex_trylock, __gthread_mutex_unlock): Adjust the + initial counter value to work correctly under Windows 95. + * config/i386/gthr-win32.c: Adjust include order. + Define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES before including + gthr-win32.h. + (__gthr_win32_mutex_init_function, __gthr_win32_mutex_lock, + __gthr_win32_mutex_trylock, __gthr_win32_mutex_unlock): Adjust + to match inline versions in gthr-win32.h. + +2004-06-23 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_use_dfa_pipeline_interface): Delete. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Redefine a hook_int_void_1. + (insvdi_rshift_rlwimi_p): New function. + * config/rs6000/rs6000.md (insvdi_internal2/3): New patterns. + (extendsfdf2): Convert to define_insn_and_split. + * config/rs6000/rs6000-protos.h (insvdi_rshift_rlwimi_p): Prototype. + +2004-06-23 Andrew Pinski + + * c-typeck.c (composite_type, ): Abort if we have + type qualifiers at all. + If both of the type domains are null and the new element type is + the same as one of the, return the one which the element type. + matches. + Do not call qualify_type on the new type. + +2004-06-23 Ulrich Weigand + + * config/s390/s390.h (DEFAULT_MAIN_RETURN): Remove. + +2004-06-23 Roger Sayle + + * convert.c (strip_float_extension): Skip both NOP_EXPR and + CONVERT_EXPR floating point extensions. + +2004-06-23 Diego Novillo + + * Makefile.in (tree-vn.o): New. + (tree-ssa-pre.o): Don't depend on RTL_H. + * tree-dfa.c (find_referenced_vars): Don't call init_tree_ssa. + * tree-flow.h (struct var_ann_d): Remove field expr_set. + (add_to_value, expressions_equal_p, get_value_handle, vn_compute, + vn_lookup_or_add, vn_add, vn_lookup, vn_init, vn_delete): Declare. + * tree-optimize.c (execute_init_datastructures): New local function. + (pass_init_datastructures): New local variable. + (init_tree_optimization_passes): Sequence pass_init_datastructures. + * tree-pretty-print.c (MASK_POINTER): Remove. + (dump_generic_node): Handle VALUE_HANDLE. + * tree-ssa-pre.c: Move all value numbering routines to tree-vn.c. + Update callers to use new function names. + Use VALUE_HANDLE_ID and VALUE_HANDLE_EXPR_SET instead of + variable annotations. + * tree-ssa.c (init_tree_ssa): Call vn_init. + (delete_tree_ssa): Call vn_delete. + * tree-vn.c: New file. + * tree.c (tree_size): Handle VALUE_HANDLE. + (tree_node_structure): Likewise. + (iterative_hash_expr): Likewise. + * tree.def (VALUE_HANDLE): New code. + * tree.h (struct tree_value_handle): New. + (VALUE_HANDLE_ID): Define. + (VALUE_HANDLE_EXPR_SET): Define. + (enum tree_node_structure_enum): Add TS_VALUE_HANDLE. + (union tree_node): Add struct tree_value_handle. + +2004-06-23 Andrew Pinski + + * c-typeck.c (composite_type): + : Build a qualified type of + the new type. + : Likewise. + : Likewise. + +2004-06-23 Pat Haugen + + PR optimization/15633 + * value-prof.c (divmod_fixed_value_transform): Compute probability + of taking optimal path and pass along to gen_ routine. + (mod_pow2_value_transform): Same. + (mod_subtract_transform): Same. + (gen_divmod_fixed_value): Add new probability parameter. + Add probability to newly created jump. + (gen_mod_pow2): Same. + (gen_mod_subtract): Same. + +2004-06-23 Richard Earnshaw + + * PR target/15948 + * arm.md (bicsi3_cbranch): Add alternative to handle tying operands + one and two. + +2004-06-23 Richard Earnshaw + + PR target/15927 + * arm.h (THUMB_SECONDARY_OUTPUT_RELOAD_CLASS): Don't need a secondary + reload if CLASS is BASE_REGS. + +2004-06-23 Richard Sandiford + + * gengtype-yacc.y (option): Avoid use of non-constant struct + initializer. + +2004-06-23 Nathan Sidwell + + * doc/extend.texi (Function Attributes): Alphabetize. + +2004-06-23 Richard Henderson + + * c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call. + Use gimplify_and_add. + * c-typeck.c (c_finish_if_stmt): Use NULL instead of empty stmt. + * gimplify.c (build_and_jump, gimplify_exit_expr, + gimplify_init_constructor, gimplify_save_expr, gimple_push_cleanup, + gimplify_stmt, gimplify_expr): Likewise. + (shortcut_cond_expr): Handle NULL arms of COND_EXPR. + (gimplify_statement_list): Remove NULL entries. + (gimplify_to_stmt_list): Handle NULL results. + (gimplify_type_sizes): Add list_p argument. + (gimplify_one_sizepos): Don't use internal pre/post queue. + * tree-gimple.h (gimplify_type_sizes): Update. + +2004-06-22 Eric Christopher + + * config/rs6000/rs6000.md (*insvsi_internal5/6): New patterns. + +2004-06-22 Pat Haugen + + * cfghooks.c (make_forwarder_block): Decrement count on fallthru edge + when redirecting back edges. + + * cfghooks.c (split_block): Call make_single_succ_edge so that edge + count/probability are set correctly. + +2004-06-22 Richard Henderson + + * c-typeck.c (emit_side_effect_warnings): Ignore error marks. + (c_finish_stmt_expr): Likewise. + + * config/i386/i386.c (TARGET_STRUCT_VALUE_RTX): New. + (ix86_return_in_memory): Move SSE vector return warning ... + (ix86_struct_value_rtx): ... here. New. + +2004-06-22 Richard Henderson + + * tree.def (VTABLE_REF): Remove. + (OBJ_TYPE_REF): New. + (TRY_CATCH_EXPR, TRY_FINALLY_EXPR): Set type 's'. + * expr.c (expand_expr_real_1): Replace VTABLE_REF with OBJ_TYPE_REF. + * fold-const.c (non_lvalue): Likewise. + * gimplify.c (gimplify_expr): Likewise. + (gimplify_call_expr): Use is_gimple_call_addr. + * langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New. + * langhooks.h (fold_obj_type_ref): New. + * tree-gimple.c (is_gimple_call_addr): New. + * tree-gimple.h (is_gimple_call_addr): Declare. + * tree-inline.c (inlinable_function_p): Fix merge error. + (estimate_num_insns_1): Replace VTABLE_REF with OBJ_TYPE_REF. + * tree-pretty-print.c (dump_generic_node): Likewise. + (print_call_name): Handle OBJ_TYPE_REF. + * tree-ssa-ccp.c (fold_stmt): Fold OBJ_TYPE_REF. + * tree-ssa-operands.c (get_expr_operands): Handle OBJ_TYPE_REF. + * tree.h (OBJ_TYPE_REF_EXPR): New. + (OBJ_TYPE_REF_OBJECT, OBJ_TYPE_REF_TOKEN): New. + * doc/c-tree.texi (VTABLE_REF): Remove. + * objc/objc-act.c (build_objc_method_call): Build an OBJ_TYPE_REF. + +2004-06-22 Richard Henderson + + PR middle-end/16026 + * function.c (assign_parms): Don't abort for overaligned PARALLEL. + +2004-06-22 Joseph S. Myers + + * Makefile.in (distclean): Don't try to remove empty directories. + +2004-06-22 Richard Sandiford + + PR target/15869 + * config/mips/mips.c (mips_avoid_hazards): Call split_all_insns_noflow. + +2004-06-22 Alexandre Oliva + + * config/mn10300/mn10300.md (movdi, movdf): Use high/low for movu + operands. + +2004-06-22 Dale Johannesen + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Make + global, rename rs6000_legitimate_offset_address_p. + (rs6000_legitimate_address_p): Adjust calls to it. + (lmw_operation): Ditto. + (stmw_operation): Ditto. + * config/rs6000/rs6000-protos.h: Declare it. + * config/rs6000/rs6000.md (*movdf_hardfloat32): Use it + instead of offsettable_memref_p. + +2004-06-22 Dale Johannesen + + * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow + [reg+reg] mode for TFmode memory accesses. + (rs6000_eliminate_indexed_memrefs): New. + (rs6000_emit_move): Call preceding for TImode and TFmode. + +2004-06-22 Paolo Bonzini + + * tree-cfg.c (pass_warn_function_return): It needs + CFG, not SSA. + +2004-06-22 Nathan Sidwell + + * doc/invoke.texi (Machine Dependent Options): Alphabetize. + (Submodel Options): Likewise. + +2004-06-21 Andrew Pinski + + Radar #: 3701874 + * c-decl.c (push_file_scope): Return early if we already + have a file scope. + +2004-06-21 Geoffrey Keating + + * c-opts.c (c_common_handle_option): Handle -fpch-preprocess. + * c-common.h (flag_pch_preprocess): Declare. + (c_common_pch_pragma): Likewise. + * c-common.c (flag_pch_preprocess): New. + * c-pch.c (c_common_read_pch): Support -fpreprocess-only. + (c_common_pch_pragma): New. + * c-ppoutput.c (cb_read_pch): New. + (init_pp_output): Support -fpch-preprocess. + * c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess. + * c.opt (fpch-preprocess): New. + * gcc.c (cpp_options): When save-temps, pass -fpch-preprocess. + * doc/cppopts.texi: Document -fpch-preprocess. + * doc/invoke.texi (Precompiled Headers): Mention that + -fpreprocessed is safe for PCH. Mention that if an option is + listed as safe that doesn't mean it does what you expect. + +2004-06-22 Ben Elliston + + * tree-ssa.c (ssa_redirect_edge): Correct leading comment. + +2004-06-21 Richard Kenner + + * Makefile.in (gimplify.o): Add cgraph.h. + * alias.c (adjust_offset_for_component_ref): Use + component_ref_field_offset. + * c-decl.c (build_array_declarator): Add news args for ARRAY_REF. + * c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list. + (gimplify_decl_stmt): Call gimplify_type_sizes for type. + For decl, call gimplify_one_sizepos and use statement list. + (gimplify_compound_literal_expr): New arg PRE_P. + Add statement to PRE_P list and return DECL. + (c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to + gimplify_compound_literal_expr. + * c-tree.h (getdecls): Deleted. + * c-typeck.c (build_component_ref): Add operand for COMPONENT_REF. + (build_array_ref): Add two operands for ARRAY_REF. + (build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for + COMPOUND_LITERAL_EXPR. + * coverage.c (tree_coverage_counter_ref): Add new operands + for ARRAY_REF. + * emit-rtl.c (component_ref_for_mem_expr): Add new operand + for COMPONENT_REF. + (set_mem_attributes_minus_bitpos): Use array_ref_low_bound + and array_ref_element_size. + (widen_memory_access):Use component_ref_field_offset. + * explow.c (update_nonlocal_goto_save_area): Add two operands + for ARRAY_REF. + * expr.c (array_ref_element_size, array_ref_low_bound): New functions. + (component_ref_field_offset): Likewise. + (get_inner_reference): Use them. + (expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound. + * fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE. + (fold_read_from_constant_string): Use array_ref_low_bound. + Verify that result is a character type. + (build_fold_indirect_ref): Add two operands for ARRAY_REF. + * function.c (expand_function_start): Likewise. + * gimple-low.c (expand_var_p): Delete duplicated line. + * gimplify.c: Add static decls for local functions. + (cgraph.h): Now included. + (create_tmp_var): Remove check for ARRAY_TYPE. + (copy_if_shared_r): Look at bounds and sizes of types. + (build_and_jump): Return alloc_stmt_list instead of build_empty_stmt. + (gimplify_exit_expr, shortcut_cond_expr): Likewise. + (gimplify_save_expr, gimple_push_cleanup): Likewise. + (gimplify_init_constructor): Likewise. + WANT_VALUE now bool. + If empty list with no result wanted, return GS_UNHANDLED. + Add additional operands for ARRAY_REF and COMPONENT_REF. + (canonicalize_component_ref): Convert to &array[L]. + (gimplify_array_ref_to_plus): Use array_ref_element_size and + array_ref_lower_bound. + (build_addr_expr_with_type, build_addr_expr): New functions. + (gimplify_compound_lval): WANT_LVALUE now bool. + Major rework to allow handle_component_p and initialize and + gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and + COMPONENT_REF. + (gimplify_array_ref): Deleted. + (gimplify_self_mod_expr): WANT_VALUE now bool. + (gimplify_modify_expr): Gimplify to_p and from_p later. + Factor out code into gimplify_modify_expr_rhs and call twice. + Move variable-size code earlier and handle PLACEHOLDER_EXPR. + (gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns. + (gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case. + (gimplify_expr, case ARRAY_REF): Delete special case. + Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF, + IMAGPART, and REALPART the same way. + (gimplify_expr, case VIEW_CONVERT_EXPR): New case. + (gimplify_expr): Call gimplify_variable_sized_compare if applicable. + Call alloc_stmt_list instead of build_empty_stmt. + Deal with _REF that's volatile. + (gimplify_type_sizes, gimplify_one_sizepos): New functions. + (unshare_body, unvisit_body): New functions. + (gimplify_body): Call them. + * stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE. + * stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT. + * tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF. + * tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF + like ARRAY_REF. + (verify_expr, case ADDR_EXPR): Use handled_component_p. + * tree-dfa.c (get_virtual_var): Likewise. + * tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF): + New cases to dump new operands; likewise for ARRAY_RANGE_REF. + * tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF. + * tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF + and INDIRECT_REF. + (get_base_address): Use handled_component_p. + * tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New. + * tree-inline.c (walk_tree): Walk more things for types and decls. + * tree-mudflap.c (mf_build_check_statement_for): Add new operands + for ARRAY_REF and COMPONENT_REF. + (mx_xform_derefs_1): Clean up usage of decl sizes. + * tree-nested.c (build_addr): Use handled_component_p. + (walk_stmts, case CATCH_EXPR): Add missing "break". + (get_static_chain, get_frame_field): Add new operand for COMPONENT_REF. + (finalize_nesting_tree_1): Likewise. + (convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF + and process additional operands. + (convert_local_reference): Likewise. + * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat + ARRAY_RANGE_REF similarly to ARRAY_REF. + * tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle + like RECORD_TYPE. + (dump_generic_node, case COMPONENT_REF): Print offset operand. + (dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF + and print lower bound and element size for both. + (op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF. + * tree-sra.c (csc_build_component_ref): Add new operand. + (scalarize_call_expr): Use get_base_address. + * tree-ssa-ccp.c (widen_bitfield): Clean up size handling. + (maybe_fold_offset_to_array_ref): Rework to handle input having an + ARRAY_REF, refine handling of lower bound, and add new operands + for ARRAY_REF. + (maybe_fold_to_component_ref): Add new operand for COMPONENT_REF. + (maybe_fold_stmt_indirect): Only fold *&B to B if types match. + (maybe_fold_stmt_addition): Only handle constant lower bound. + * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. + Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands. + Look at new offset operand of COMPONENT_REF. + * tree-ssa.c (set_is_used): Use handled_component_p. + * tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand. + (stabilize_reference, case COMPONENT_REF): Likewise. + (stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly. + (recompute_tree_invariant_for_addr_expr): Completely rework to + be more precise. Also set TREE_SIDE_EFFECTS. + (build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here. + (build2_stat, build3_stat, build4_stat): For references, + propagate TREE_THIS_VOLATILE. + (get_unwidened): Add new operand for COMPONENT_REF. + (get_narrower): Likewise; use host_integerp for DECL_SIZE. + * tree.def (COMPONENT_REF): Add new operand. + (ARRAY_REF, ARRAY_RANGE_REF): Add two new operands. + * tree.h (array_ref_element_size, array_ref_low_bound): New decls. + (component_ref_field_offset): Likewise. + * config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF. + (alpha_gimplify_va_arg): Likewise. + * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. + * config/i860/i860.c (i860_va_start, i860_va_arg): Likewise. + * config/iq2000/iq2000.c (iq2000_va_arg): Likewise. + * config/mips/mips.c (mips_va_start, mips_va_arg): Likewise. + * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg): + Likewise. + * config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise. + * config/sh/sh.c (sh_va_start, sh_va_arg): Likewise. + * config/stormy16/stormy16.c (xstormy1_expand_builin_va_start): + Likewise. + (xstormy16_expand_builtin_va_arg): Likewise. + * config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise. + * objc/objc-act.c (generate_static_references): Likewise. + (generate_strings, build_method_prototype_list_template): Likewise. + (generate_protocol_list): Likewise. + +2004-06-21 John David Anglin + + PR rtl-optimization/14782 + * pa.c (emit_move_sequence): Use SFmode for 4-byte modes when doing + the address checks for secondary reloads for loads from and stores + to floating-point registers. + * pa.h (EXTRA_CONSTRAINT, case T): Use SFmode for 4-byte modes + in the address check. Move work around for ELF32 targets to + GO_IF_LEGITIMATE_ADDRESS. + (GO_IF_LEGITIMATE_ADDRESS): Require constant offsets to be + correctly aligned for DImode loads and stores. Don't allow long + SFmode displacements on ELF32. + +2004-06-21 Richard Henderson + + PR rtl-opt/16114 + * cse.c (merge_equiv_classes): Also rehash in response to + delete_reg_equiv changes. + (rehash_using_reg): Don't exclude REGs from rehashing. + +2004-06-21 Richard Henderson + + * c-common.def (RETURN_STMT): Remove. + * c-common.h (RETURN_STMT_EXPR): Remove. + (c_expand_return, build_return_stmt): Remove. + (c_common_stmt_codes): Remove RETURN_STMT. + * c-dump.c (dump_next_stmt): Remove. + (c_dump_tree): Remove RETURN_STMT. + * c-decl.c (finish_function): Use c_finish_return. + * c-parse.in (stmt): Likewise. + * c-gimplify.c (gimplify_return_stmt): Remove. + (c_gimplify_expr): Remove RETURN_STMT. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-semantics.c (build_return_stmt): Remove. + * c-tree.h (c_finish_return): Declare. + * c-typeck.c (c_finish_return): Rename from c_expand_return. + Return void. Build RETURN_EXPR directly. + * tree-dump.h (dump_next_stmt): Remove. + +2004-06-21 Zack Weinberg + + * c-decl.c (start_function): Don't call make_decl_rtl. Don't + look at TREE_ADDRESSABLE of symbol name. + +2004-06-21 Kelley Cook + + PR target/15551 + * config/i386/i386.md: Change UNSPEC_STACK_PROBE to UNSPECV_STACK_PROBE. + (allocate_stack_worker): Make unspec_volatile. + (allocate_stack_worker_rex64): Likewise. + (allocate_stack_worker_postreload): Likewise. + (allocate_stack_worker_rex64_postreload): Likewise. + +2004-06-21 Daniel Berlin + + Fix PR optimization/15982 + * tree-ssa-pre.c: Update a few comments and todos to + reflect constants change. + (get_value_handle): Constants now value number to themselves. + (lookup): Constants lookup to themselves. + (add_to_value): Adjust to always be on. + (set_contains_value): Adjust for constants change. + (find_leader): Ditto. + (phi_translate): 'r' nodes are never ANTIC right now. + (valid_in_set): Ditto. + (get_expr_set): New function. + (find_or_generate_expression): New function, broken out from + insert_aux. + (create_expression_by_pieces): Ditto, plus additional + machinery to handle complex values. + (compute_avail): Remove dead RETURN_EXPR handling. + +2004-06-21 Steven Bosscher + + * config/i386/i386.c: Include insn-codes.h + * config/i386/i386.h (FLAGS_REG, FPSR_REG, DIRFLAG_REG): Don't + define here. + * config/i386/i386.md (BP_REG, SP_REG, FLAGS_REG, FPSR_REG, + DIRFLAG_REG): New define_constants. Use them everywhere. + +2004-06-21 Kaz Kojima + + * config/sh/t-linux (MULTILIB_OPTIONS): Remove. + +2004-06-21 J"orn Rennecke + + * sh.h (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4): Conditionally define. + (SUPPORT_SH4_SINGLE): Likewise. + (TARGET_SWITCHES): Break out switches for cpu subtargets: + (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E): Define. + (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E): Likewise. + (TARGET_SWITCH_SH4_SINGLE_ONLY, TARGET_SWITCH_SH4_SINGLE): Likewise. + (TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4): Likewise. + (TARGET_SWITCH_SH5_64MEDIA, TARGET_SWITCH_SH5_64MEDIA_NOFPU): Likewise. + (TARGET_SWITCHES_SH5_32MEDIA): Likewise. + (TARGET_SWITCHES_SH5_32MEDIA_NOFPU): Likewise. + (SELECT_SH5_64, SELECT_SH5_64_NOFPU): Rename to: + (SELECT_SH5_64MEDIA, SELECT_SH5_64MEDIA_NOFPU) + (SELECT_SH5_32, SELECT_SH5_32_NOFPU): Rename to: + (SELECT_SH5_32MEDIA, SELECT_SH5_32MEDIA_NOFPU). + (SH_MULTILIB_CPU_DEFAULT, MULTILIB_DEFAULTS): Define. + (ASM_ISA_SPEC_DEFAULT, ASM_ISA_DEFAULT_SPEC): Likewise. + * sh64.h (ASM_SPEC, LINK_DEFAULT_CPU_EMUL): Don't redefine. + (TARGET_DEFAULT): Likewise. + * config/sh/t-elf: Amend comment. + * config/sh/t-1e, config/sh/t-mlib-sh1: New files. + * config/sh/t-mlib-sh2, config/sh/t-mlib-sh2e: Likewise. + * config/sh/t-mlib-sh3, config/sh/t-mlib-sh3e: Likewise. + * config/sh/t-mlib-sh4, config/sh/t-mlib-sh4-nofpu: Likewise. + * config/sh/t-mlib-sh4-single: Likewise. + * config/sh/t-mlib-sh4-single-only: Likewise. + * config/sh/t-mlib-sh5-32media: Likewise. + * config/sh/t-mlib-sh5-32media-nofpu: Likewise. + * config/sh/t-mlib-sh5-64media: Likewise. + * config/sh/t-mlib-sh5-64media-nofpu: Likewise. + * config/sh/t-mlib-sh5-compact: Likewise. + * config/sh/t-mlib-sh5-compact-nofpu: Likewise. + * config/sh/t-sh: (MULTILIB_ENDIAN): Add mb. + (MULTILIB_CPUS): Define. + (MULTILIB_OPTIONS): Use MULTILIB_CPUS. + (MULTILIB_MATCHES): Use some shell code to calculate it. + (MULTILIB_EXCEPTIONS): Change to ml/m1. + * config/sh/elf.h (SUBTARGET_ASM_ISA_SPEC): Use ASM_ISA_DEFAULT_SPEC. + * config/sh/netbsd-elf.h: Update code which sets TARGET_VERSION_CPU. + (LINK_DEFAULT_CPU_EMUL): Don't redefine. + (NO_PROFILE_COUNTERS): Define to 1. + * config/sh/t-netbsd (MULTILIB_OPTIONS): Don't append to. + (MULTILIB_DIRNAMES, MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Don't zap. + * config/sh/t-netbsd-sh5-64 (MULTILIB_OPTIONS): Don't redefine. + (MULTILIB_MATCHES): Don't zap. + (MULTILIB_DIRNAMES): Use MULTILIB_RAW_DIRNAMES. + * config/sh/t-sh64 (MULTILIB_OPTIONS): Don't redefine. + (MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Don't zap. + (MULTILIB_RAW_DIRNAMES): Define. + (MULTILIB_DIRNAMES): Use it. + * config.gcc: Also set cpu_type / need_64bit_hwint for sh[be]*-*-*. + (sh*linux configurations): Merge into: + (sh*elf / sh*kaos configurations). Support --with-endian, --with-cpu, + --with-multilib-list options. Support sh-superh-elf configuration. + (sh*-netbsd*): Use SELECT_SH* macros. + (supported_defaults): sh[123456ble]-*-* | sh-*-* support "cpu". + Merge sh*-*-netbsd* configurations into sh-elf configurations. + * config/sh/t-netbsd-sh5, config/sh/t-be, config/sh/t-le: Delete. + * config/sh/t-monolib: Likewise. + +2004-06-21 Paul Brook + + * config/arm/arm.h (ARM_LEGITIMIZE_RELOAD_ADDRESS): Soft-float need + not imply FPA. + +2004-06-21 Roger Sayle + + * fold-const.c (operand_equal_p): Pass flags in recursive calls for + binary and relational operations. Add support for TRUTH_ANDIF_EXPR, + TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR. + * tree.c (commutative_tree_code): Also list UNORDERED_EXPR, + ORDERED_EXPR, UNEQ_EXPR, LTGT_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR + and TRUTH_XOR_EXPR. + +2004-06-21 Paolo Bonzini + + * rtlanal.c (may_trap_p): Mark LTGT as trapping. + +2004-06-21 Joseph S. Myers + + * tree-alias-common.h (struct tree_alias_ops): Change ip and + ip_partial to unsigned int. + +2004-06-21 Richard Henderson + + * c-common.c (verify_sequence_points): Export. + (c_expand_expr_stmt): Move to c-typeck.c. + * c-common.h (c_expand_expr_stmt): Remove. + (verify_sequence_points): Declare. + * c-mudflap.c (mflang_flush_calls): Use c_finish_expr_stmt. + * c-parse.in (for_init_stmt, stmt): Likewise. + * c-tree.h (c_finish_expr_stmt): Declare. + (c_tree_expr_nonnegative_p): Remove. + * c-typeck.c (c_tree_expr_nonnegative_p): Remove. + (build_conditional_expr, build_binary_op): Use tree_expr_nonnegative_p. + (emit_side_effect_warnings): New. + (c_finish_expr_stmt): Rename from c_expand_expr_stmt. Use it. + (c_finish_stmt_expr): Work without EXPR_STMT. Handle eh regions. + Use emit_side_effect_warnings. + (push_cleanup): Copy STATEMENT_LIST_STMT_EXPR. + * fold-const.c (tree_expr_nonnegative_p): Handle TARGET_EXPR. + * gimplify.c (gimplify_modify_expr): Don't discard TARGET_EXPR + with void initializer. + (gimplify_target_expr): Handle void BIND_EXPR initializer. + * tree-inline.c (estimate_num_insns_1): Fix type lookup for + INIT_EXPR and MODIFY_EXPR. + * objc/objc-act.c (build_module_descriptor): Use add_stmt + instead of c_expand_expr_stmt. + +2004-06-21 Paolo Bonzini + + * fold-const.c (fold_cond_expr_with_comparison): + New function, extracted from fold. + (fold): Extract code to fold A op B ? A : C, use + it to fold A op B ? C : A. Really optimize + A & N ? N : 0 where N is a power of two. Avoid + relying on canonicalization and recursion for + foldings of COND_EXPR to happen. + +2004-06-20 David Ayers + + * objc/objc-act.h (get_object_reference): Rename to + get_protocol_reference. + (super_type): Rename to objc_super_type. + (selector_type): Rename to objc_selector_type. + (id_type): Rename to objc_id_type. + (instance_type): Rename to objc_instance_type. + (protocol_type): Rename to objc_protocol_type. + (IS_ID): Update reference to id_type. + * objc/objc-act.c (get_object_reference): Rename to + get_protocol_reference; add documentation; update references to + id_type. + (lookup_method_in_protocol_list): Rename class_meth to + is_class; add documentation. + (finish_message_expr): Rename is_class to class_tree. + (synth_module_prologue, objc_is_object_ptr, objc_build_exc_ptr, + next_sjlj_build_try_catch_finally, objc_begin_catch_clause, + build_next_objc_exception_stuff, get_arg_type_list, + build_objc_method_call): Update references to id_type. + (synth_module_prologue, build_objc_symtab_template, + build_selector_reference_decl, build_selector, + build_selector_translation_table, build_typed_selector_reference, + get_arg_type_list, synth_self_and_ucmd_args, get_arg_type_list, + synth_self_and_ucmd_args): Update references to selector_type. + (build_private_template, build_ivar_reference): Update references + to instance_type. + (synth_module_prologue, build_protocol_reference, + build_protocol_expr, start_protocol): Update references to + protocol_type. + (synth_module_prologue, get_arg_type_list, build_objc_method_call): + Update references to super_type. + * c-parse.in: (typespec_nonreserved_nonattr): Update + references to get_object_reference. + * objc/objc-tree.def: Add C mode identifier sequence. + +2004-06-20 Zdenek Dvorak + + * loop-invariant.c: New file. + * Makefile.in (loop-invariant.o): New. + * cfgloop.h (global_cost_for_size, init_set_costs, + move_loop_invariants): Declare. + * cfgloopanal.c (seq_cost, init_set_costs, global_cost_for_size): New + functions. + (avail_regs, res_regs, small_cost, pres_cost, spill_cost): New + variables. + * common.opt (floop-optimize2, fmove-loop-invariants): New options. + * loop-init.c (loop_optimizer_init): Call init_set_costs. + * passes.c (rest_of_handle_loop2): Call move_loop_invariants. + (rest_of_compilation): Check flag_loop_optimize2. + * toplev.c (process_options): Handle flag_loop_optimize2. + * doc/invoke.texi (-floop-optimize2, -fmove-loop-invariants): Document. + * doc/passes.texi (loop-invariant.c): Document. + +2004-06-20 Zdenek Dvorak + + * tree-ssa-pre.c (compute_antic): Keep BB_VISITED flag zeroed. + +2004-06-20 Richard Henderson + + * stmt.c (warn_if_unused_value): Add locus argument. + * tree.h (warn_if_unused_value): Update decl. + * c-typeck.c (internal_build_compound_expr): Update call. + * c-gimplify.c (gimplify_expr_stmt): Likewise. + +2004-06-20 Andrew Pinski + + PR middle-end/16089 + * builtins.c (entry_of_function): Move to ... + * cfgrtl.c (entry_of_function): Here and make non-static. + * integrate.c (emit_initial_value_sets): Use entry_of_function. + * rtl.h (entry_of_function): Prototype. + +2004-06-20 Roger Sayle + + * config/i386/i386.c (pentium4_cost): Increase "lea" cost from 1 to 3. + (ix86_rtx_costs) : Consider ix86_cost->lea even when + TARGET_DECOMPOSE_LEA. + +2004-06-20 Richard Henderson + + * c-common.h (add_decl_stmt): Move to cp-tree.h. + * c-decl.c (finish_decl): Don't use add_decl_stmt. + * c-parse.in: Likewise. + * c-gimplify.c (gimplify_expr_stmt): Don't build CLEANUP_POINT_EXPR. + (gimplify_c_loop, gimplify_return_stmt, gimplify_decl_stmt): Likewise. + * c-semantics.c (add_decl_stmt): Move to cp/semantics.c. + +2004-06-20 Richard Henderson + + * c-common.def (IF_STMT, CLEANUP_STMT): Move to cp-tree.def. + * c-common.h (IF_COND, THEN_CLAUSE, ELSE_CLAUSE, CLEANUP_BODY, + CLEANUP_EXPR, CLEANUP_DECL): Move to cp-tree.h. + (c_common_stmt_codes): Remove IF_STMT, CLEANUP_STMT. + * c-dump.c (c_dump_tree): Move IF_STMT, CLEANUP_STMT to cp_dump_tree. + * c-pretty-print.c (pp_c_statement): Similarly. + * c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts, + gimplify_if_stmt): Move to cp-gimplify.c. + (c_genericize, c_gimplify_expr): Don't call them. + * c-semantics.c (push_cleanup): Move to cp/semantics.c. + * c-typeck.c (push_cleanup): New. + (c_begin_if_stmt, c_finish_if_cond, c_finish_then, c_finish_else, + c_finish_if_stmt): Use COND_EXPR. + * tree.h (CLEANUP_EH_ONLY): Update documentation. + +2004-06-20 Zack Weinberg + + * c-common.h (has_c_linkage): New interface. + * c-cppbuiltin.c: Include target.h. + (c_cpp_builtins): Define __PRAGMA_REDEFINE_EXTNAME and + __PRAGMA_EXTERN_PREFIX when appropriate. + * c-pragma.c: Include target.h. + Document clarified semantics of symbol-renaming #pragmas. + (handle_pragma_redefine_extname, handle_pragma_extern_prefix) + (maybe_apply_renaming_pragma): Rewrite according to clarified + semantics. Always recognize, but do not necessarily execute. + (init_pragma): Unconditionally register symbol-renaming pragmas. + * system.h: Poison HANDLE_PRAGMA_REDEFINE_EXTNAME + and HANDLE_PRAGMA_EXTERN_PREFIX. + * target.h (struct gcc_target): Add handle_pragma_redefine_extname + and handle_pragma_extern_prefix flags. + * target-def.h: Add defaults for TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME + and TARGET_HANDLE_PRAGMA_EXTERN_PREFIX. + * Makefile.in (c-pragma.o, c-cppbuiltin.o): Update dependencies. + * config/sol2.h: Define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME, + not HANDLE_PRAGMA_REDEFINE_EXTNAME. + (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_REDEFINE_EXTNAME. + (TRANSFER_FROM_TRAMPOLINE): Prototype mprotect. + * config/alpha/osf.h: Define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX, + not HANDLE_PRAGMA_EXTERN_PREFIX. + (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_EXTERN_PREFIX. + * doc/extend.texi (Solaris Pragmas, Tru64 Pragmas): Combine + into one section "Symbol-Renaming Pragmas"; clarify; document + adjusted semantics. + + * builtins.c (expand_builtin): Do not issue error for a builtin + with no special case code and no DECL_ASSEMBLER_NAME; just do the + library call. + * c-decl.c (builtin_function): Don't call make_decl_rtl. + * c-objc-common.c (has_c_linkage): Stub implementation. + * cgraphunit.c (cgraph_expand_function) + (cgraph_remove_unreachable_nodes): Don't clear DECL_ARGUMENTS. + +2004-06-19 Roger Sayle + + * builtins.c (fold_builtin_unordered_cmp): Take an EXP argument + instead of both an ARGLIST and a result TYPE. Handle these C99 + comparison functions as "polymorphic" builtins. Also handle + lowering of BUILT_IN_ISUNORDERED to an UNORDERED_EXPR tree node. + (fold_builtin_1): Update calls to fold_builtin_unordered_cmp. + Move handling of BUILT_IN_ISUNORDERED from here to there. + +2004-06-19 Richard Henderson + + * c-common.c, c-common.h (lang_gimplify_stmt): Remove. + * c-gimplify.c: Remove unnecessary prototypes. + (c_gimplify_stmt): Merge into ... + (c_gimplify_expr): ... here. Don't play with prep_stmt. + * c-semantics.c (prep_stmt): Remove. + * gimplify.c (annotate_one_with_locus): Break out from ... + (annotate_all_with_locus): ... here. + (gimplify_expr): Add locus to expressions even if pre/post queues + are not present. + +2004-06-19 Richard Henderson + + PR target/15941 + * function.c (assign_parms): If not padding upward or intentionally + forcing upward padding, take offset_rtx into account when determining + the alignment for stack_parm. + +2004-06-19 Richard Henderson + + PR target/15550 + * ifcvt.c (noce_try_move): Recognize all generated instructions. + +2004-06-19 Jan Hubicka + + * function.c (free_after_compilation): Do not free computed_goto_common*. + * function.h (struct function): Kill computed_goto_common*. + * stmt.c (expand_computed_goto): Do not commonize the computed gotos. + * tree-cfg.c (disband_implicit_edges): Do not forward across the + commonized computed goto. + +2004-06-19 John David Anglin + + * doc/invoke.texi: Remove obsolete comment regarding PA 2.0 support + in binutils. + +2004-06-19 Andrew Pinski + + PR c++/15721 + * toplev.c (wrapup_global_declarations): Do not check + TREE_SYMBOL_REFERENCED of the DECL_ASSEMBLER_NAME but check + cgraph_varpool_node's needed field. + +2004-06-19 Jan Hubicka + Steven Bosscher + + CFG transparent RTL expansion: + * Makefile.in (cfgexpand.o): New object file. + (builtins.o): Add dependency on basic-block.h + * builtins.c: Include basic-block.h + (entry_of_function): New function. + (expand_builtin_apply_args, expand_builtin_saveargs): Use it. + * cfgexpand.c: New file. + * expr.c (execute_expand, pass_expand): Kill. + * pass.c (rest_of_compilation): Do not build CFG unless called from + coverage code. + * tree-cfg.c (delete_tree_cfg): Rename to.. + (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. + * tree-flow.h (delete_tree_cfg_annotations): Declare. + (dleete_tree_cfg): Kill. + * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. + (execute_del_cfg): Rename to... + (execute_free_datastructures): This one... + (pass_del_cfg): Rename to... + (pass_free_datastructures): ... this one; Do not kill PROP_cfg. + (init_tree_optimization_passes): Make cfg build and profiling to happen + unconditionally. + +2004-06-19 Steven Bosscher + + * tree-mudflap.c (mf_decl_cache_locals): Skip labels before + inserting the cache variables. + + * tree-mudflap.c: Include headers to make basic_block available. + Move functions around such that related functions are near each + other. Add prototypes for all static functions. Add comments + briefly explaining what IR the mudflap1 and mudflap2 work on and + what they do. + (mudflap_function_decls): Rename to execute_mudflap_function_decls. + (mudflap_function_ops): Rename to execute_mudflap_function_ops. + (pass_mudflap_1, pass_mudflap_2): Update. + (mf_decl_cache_locals): Make it work on the CFG instead of the saved + function tree. + (mf_build_check_statement_for): Make it work on the CFG. + (mf_xform_derefs_1): Likewise. Cleanup code style. + (mf_xform_derefs): Likewise. + +2004-06-19 Jan Hubicka + + * tree-cfg.c (label_to_block): Invent the label destination for + undefined labels. + (cleanup_dead_labels): Update table in the case label_to_block added + new label. + +2004-06-18 Richard Henderson + + PR c++/16036 + * gimple-low.c (lower_function_body): Generate return statement for + fall off the end of the function here ... + * tree-cfg.c (make_edges): ... instead of here. + * gimplify.c (gimplify_return_expr): Mark return temp TREE_NO_WARNING. + +2004-06-18 Zdenek Dvorak + + * tree-ssa.c (raise_value): Removed. + (get_eq_name, check_phi_redundancy): New functions. + (kill_redundant_phi_nodes): Use standard ssa minimalization algorithm. + +2004-06-18 Roger Sayle + + * fold-const.c (fold) : Add + constant folding for unordered comparison tree nodes. If both + operands are real constants, call fold_relational_const. If either + operand is a NaN, evaluate the other for side-effects and return a + constant. Optimize (double)float1 CMP (double)float2 into the + equivalent float1 CMP float2. + (nondestructive_fold_binary_to_constant) : Call fold_relational_const for constant operands. + (fold_relational_const): Add support for unordered comparison tree + nodes. Don't constant fold "ordered" floating point comparisons + against NaN if when flag_trapping_math is set. + +2004-06-19 Jakub Jelinek + + * fold-const.c (build_range_check): If !in_p and recursive call + fails, exit immediately. If high - low overflows and etype is + a signed type, retry with unsigned etype. + (merge_ranges): If !in0_p and !in1_p, handle even range2 adjacent + to range1 at TYPE_MAX_VALUE and TYPE_MIN_VALUE. + +2004-06-18 Richard Henderson + + * c-gimplify.c (gimplify_condition): Remove. + (gimplify_c_loop, gimplify_if_stmt, gimplify_switch_stmt): Don't + call it. + +2004-06-18 Richard Henderson + + * tree-eh.c (decide_copy_try_finally): Fix scaling of copy and + switch estimates. + +2004-06-18 Andrew Pinski + + * config/i386/darwin.h (HOT_TEXT_SECTION_NAME): Define. + (NORMAL_TEXT_SECTION_NAME): Define. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Define. + (SECTION_FORMAT_STRING): Define. + +2004-06-18 Steven Bosscher + + * config/xtensa/xtensa.c + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define. + * xtensa.md: Replace the old pipeline description with a DFA model. + +2004-06-18 Steven Bosscher + Ulrich Weigand + + * config/s390/s390.md: Remove the generic pipeline description. + * config/s390/2064.md: Make all insn reservations apply to + the z900, g5 and g6. + * config/s390/s390.c (s390_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): + Define to hook_int_void_1. + (s390_adjust_cost): Cleanup. Don't check address dependency here. + (s390_first_cycle_multipass_dfa_lookahead): Always return 4. + +2004-06-18 Daniel Berlin + Diego Novillo + + * tree-dfa.c (create_var_ann): tree_ann -> tree_ann_t. + (create_stmt_ann): Ditto. + (create_tree_ann): New function. + (create_cst_ann): Remove. + (create_expr_ann): Ditto. + + * tree-flow-inline.h (cst_ann): Remove. + (get_cst_ann): Ditto. + (get_expr_ann): Ditto. + (expr_ann): Ditto. + (get_tree_ann): New function. + (tree_ann): Ditto. + (ann_type): tree_ann -> tree_ann_t. + * tree-flow.h (tree_ann_type): CST_ANN, EXPR_ANN removed. + (struct cst_ann_d): Removed. + (struct expr_ann_d): Ditto. + (union tree_ann_d): Removed cst and expr. + (tree_ann): Renamed to tree_ann_t. + * tree-ssa-ccp.c (set_rhs): tree_ann -> tree_ann_t. + * tree-ssa-pre.c (get_value_handle): Rewrite for single common + annotation. + (set_value_handle): Ditto. + (phi_translate): Ditto. + * tree-tailcall.c (adjust_return_value): tree_ann -> tree_ann_t. + +2004-06-18 Kaz Kojima + + * config/sh/t-linux64: New file. + * config.gcc: Add it to tmake_file for sh64*-*-linux*. + +2004-06-18 Paolo Bonzini + + * emit-rtl.c (unshare_all_rtl_1): New name of unshare_all_rtl. + (unshare_all_rtl_again): Call unshare_all_rtl_1. + (unshare_all_rtl): New. + * function.c (instantiate_virtual_regs): Remove parameters. + * function.h (instantiate_virtual_regs): Add prototype. + * rtl.h (unshare_all_rtl): Add prototype. + * tree.h (instantiate_virtual_regs, unshare_all_rtl): Remove + prototype. + * passes.c: Remove assertions on the parameters to + rest_of_handle_* functions. Remove the parameters to + the functions, replacing decl with current_function_decl + and insns with get_insns (). + +2004-06-17 Roger Sayle + + * fold-const.c (constant_boolean_node): Handle boolean_type_node + directly, return either boolean_true_node or boolean_false_node. + +2004-06-18 Kelley Cook + + * opts.sh: Delete. Break out generated code to next four files. + * opt-gather.awk: New file. + * optc-gen.awk: New file. + * opth-gen.awk: New file. + * opt-functions.awk: New common file. + * Makefile.in: Update for above. + * configure.ac: Update comment. + * configure: Regenerate. + +2004-06-17 Richard Henderson + + * c-common.c (flag_objc_sjlj_exceptions): New. + * c-common.h (flag_objc_sjlj_exceptions): Declare. + * c-opts.c (c_common_handle_option): Set it. + (c_common_post_options): Handle interation of different + objective-c exception and runtime switches. + * c-decl.c (c_eh_initialized_p): New. + (finish_decl): Use it instead of local eh_initialized_p. + * c-parse.in (nested_function, notype_nested_function): Record + the result of compstmt. + (compstmt_or_error): Likewise. + (compstmt): Don't add_stmt the result. + (stmt): Don't return anything. Rewrite objc try and sync rules. + (objc_try_stmt, objc_catch_list): Remove. + (objc_catch_block, objc_finally_block): Remove. + (objc_catch_prefix, objc_catch_clause, objc_opt_catch_list): New. + (objc_try_catch_clause, objc_finally_clause): New. + (objc_try_catch_stmt): Rewrite. + * c-tree.h (c_eh_initialized_p): Declare. + * c-opt (fobjc-sjlj-exceptions): New. + * except.c (output_function_exception_table): Don't call cgraph + on non-decls. + * objc/objc-act.c (UTAG_EXCDATA_VAR, UTAG_CAUGHTEXC_VAR, + UTAG_RETHROWEXC_VAR, UTAG_EVALONCE_VAR, struct val_stack, + catch_count_stack, exc_binding_stack, if_nesting_count, + blk_nesting_count, objc_enter_block, objc_exit_block, + objc_declare_variable, val_stack_push, val_stack_pop, + objc_build_try_enter_fragment, objc_build_extract_expr, + objc_build_try_exit_fragment, objc_build_extract_fragment, + objc_build_try_prologue, objc_build_try_epilogue, + objc_build_catch_stmt, objc_build_catch_epilogue, + objc_build_finally_prologue, objc_build_finally_epilogue, + objc_build_try_catch_finally_stmt, objc_build_synchronized_prologue, + objc_build_synchronized_epilogue): Remove. + (objc_create_temporary_var, struct objc_try_context, cur_try_context, + objc_eh_runtime_type, objc_init_exceptions, objc_build_exc_ptr, + next_sjlj_build_try_exit, next_sjlj_build_enter_and_setjmp, + next_sjlj_build_exc_extract, next_sjlj_build_catch_list, + next_sjlj_build_try_catch_finally, objc_begin_try_stmt, + objc_begin_catch_clause, objc_finish_catch_clause, + objc_build_finally_clause, objc_finish_try_stmt, + objc_build_synchronized): New. + (objc_is_object_id, objc_is_class_id): New. + (objc_comptypes): Use them. + (build_next_objc_exception_stuff): Break NeXT sjlj out from + build_objc_exception_stuff. + (synth_module_prologue): Update to match. + (objc_build_throw_stmt): Use cur_try_context to decide if + we're in a @catch. + * objc/objc-act.h: Update prototypes. + (OCTI_EXCEPTION_BLK_STACK, objc_exception_block_stack): Remove. + +2004-06-17 Andrew Pinski + + * c-typeck.c (tagged_types_tu_compatible_p ): + Use TYPE_FIELDS instead of TYPE_VALUES. + +2004-06-17 Jason Merrill + + PR c++/16015 + * gimplify.c (gimplify_target_expr): Handle void initializer. + * expr.c (expand_expr_real_1) [TARGET_EXPR]: Likewise. + * doc/c-tree.texi (Expression trees): Update TARGET_EXPR + and AGGR_INIT_EXPR. + +2004-06-17 Roger Sayle + + * fold-const.c (fold_relational_const): Use constant_boolean_node. + +2004-06-17 Jan Hubicka + + PR target/15433 + * i386.md (SSE SF cmov 0 splitter): The conditional is VOIDmode; fix + operand numbering in the output template. + (SSE DF cmov 0 splitter): The conditional is VOIDmode. + +2004-06-17 Jan Hubicka + + * except.c (can_throw_internal): Recognize RESX expresisons. + +2004-06-17 Jan Hubicka + + * cfgbuild.c (make_edges): Do not use label_value_list. + (find_basic_blocks_1): Do not collect label_value_list. + (find_sub_basic_blocks): Update call of make_edges. + +2004-06-17 Andrew MacLeod + + * tree-cfg.c (tree_make_forwarder_block): Use SET_PHI_RESULT. + * tree-flow-inline.h (get_use_op_ptr): Return a use_operand_p. + (get_use_from_ptr, get_def_from_ptr): New. Return operand pointers. + (get_def_op_ptr): Return a def_operand_p instead of a 'tree *'. + (get_v_may_def_result_ptr): Return a def_operand_p. + (get_v_may_def_op_ptr, get_vuse_op_ptr): Return a use_operand_p. + (get_v_must_def_op_ptr): Return a def_operand_p. + (get_phi_result_ptr): New. Return a pointer to the result of a PHI. + (get_phi_arg_def_ptr): New. Return a pointer to an argument of a PHI. + (phi_element_for_edge): Remove. + * tree-flow.h (propagate_value, replace_exp): Change prototype. + (propagate_tree_value): Add new prototype. + (phi_element_for_edge): Remove prototype. + * tree-into-ssa.c (mark_def_sites): Use new operand types. + (prepare_operand_for_rename): Split into two functions. + (prepare_use_operand_for_rename): Prepare use operands. + (prepare_def_operand_for_rename): Prepare def operands. + (rewrite_stmt): Use new operand types. + (rewrite_operand): Use new operand types, change parameter type. + * tree-outof-ssa.c (replace_variable): Split into two functions. + (replace_use_variable): Rewrite uses. + (replace_def_variable): Rewrite defs. + (rewrite_trees, rewrite_vars_out_of_ssa): Use new operand types. + * tree-phinodes.c (make_phi_node, resize_phi_node): Use new types. + (add_phi_arg, remove_phi_arg_num): Use new operand types. + * tree-ssa-ccp.c (substitute_and_fold): Use new operand types. + (ccp_fold, replace_uses_in): Use new operand types. + * tree-ssa-copy.c (replace_ssa_names): Rename to replace_ssa_names_ann + and no longer set the value, change parameter type. + (replace_exp_1): Use new operand types. + (propagate_value): Change parameter type, use new operand types. + (propagate_tree_value): Propagate_value without SSA operands. + (replace_exp, cprop_operand, cprop_into_stmt): Use new operand types. + (cprop_into_successor_phis): Use new operand types. + * tree-ssa-dom.c (thread_across_edge): Use new operand types. + (eliminate_redundant_computations): Use new operand types. + * tree-ssa-dse.c (fix_phi_uses): Use new operand_types. + (fix_stmt_v_may_defs): Use new operand_types. + * tree-ssa-live.c (create_ssa_var_map): Use new operand_types. + (build_tree_conflict_graph): Use new operand_types. + * tree-ssa-loop.c (duplicate_blocks): Use PHI_ARG_DEF_FROM_EDGE. + * tree-ssa-operands.c (struct freelist_d): Remove. + (check_optype_freelist, add_optype_freelist): Remove. + (allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype, + allocate_vuse_optype, allocate_v_must_def_optype): Call ggc_alloc. + (free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs): + Call ggc_free instead of add_optype_freelist. + (init_ssa_operands, fini_ssa_operands): Remove free list code. + (finalize_ssa_defs, finalize_ssa_uses): Set new use/def operands. + * tree-ssa-operands.h (struct def_optype_d): Change underlying type. + (struct use_optype_d): Change underlying type. + (def_operand_p, use_operand_p): New types for pointers to operands. + (USE_OP, DEF_OP, V_MAY_DEF_RESULT, V_MAY_DEF_OP, VUSE_OP, + V_MUST_DEF_OP): Use new pointer type instead of dereferencing directly. + (USE_FROM_PTR, DEF_FROM_PTR): New macros to "dereference" operand + pointer types. + (SET_USE, SET_DEF): New macros to set operands from their pointer. + (SET_USE_OP, SET_DEF_OP, SET_V_MAY_DEF_RESULT, SET_V_MAY_DEF_OP, + SET_VUSE_OP, SET_V_MUST_DEF_OP): New SET routines for operands. + (PHI_RESULT_PTR, PHI_RESULT, SET_PHI_RESULT): Macros to manage the + PHI result as an operand. + (PHI_ARG_DEF_PTR, PHI_ARG_DEF, SET_PHI_ARG_DEF, PHI_ARG_DEF_FROM_EDGE, + PHI_ARG_DEF_PTR_FROM_EDGE): Macros to manage the PHI arguments. + * tree-ssa-pre.c (eliminate): Call propagate_tree_value. + * tree-tailcall.c (independent_of_stmt_p, propagate_through_phis): Use + PHI_ARG_DEF_FROM_EDGE. + * tree.h (PHI_RESULT): Renamed to PHI_RESULT_TREE. + (PHI_ARG_DEF): Renamed to PHI_ARG_DEF_TREE. + +2004-06-17 Zdenek Dvorak + + PR tree-optimization/15991 + * tree-cfg.c (tree_block_label): Export. + * tree-flow-inline.h (bsi_after_labels): New function. + * tree-flow.h (bsi_after_labels, tree_block_label): Declare. + * tree-ssa.c (propagate_into_addr): New function. + (replace_immediate_uses): Handle propagation of pointer constants. + (raise_value): Do not restrict propagation of pointer constants. + * tree-ssanames.c (duplicate_ssa_name): New function. + * tree.h (duplicate_ssa_name): Declare. + +2004-06-17 David Ayers + + * c-parse.in: Unify Objective-C token names. + +2004-06-17 Zack Weinberg + + Bug 14610 + * Makefile.in (min-insn-modes.o): Correct dependencies. + * real.c (encode_ieee_extended, decode_ieee_extended): Always + produce/consume 12-byte little-endian Intel format. + (encode_ieee_extended_128, decode_ieee_extended_128): Delete. + (encode_ieee_extended_motorola, decode_ieee_extended_motorola) + (encode_ieee_extended_intel_96, decode_ieee_extended_intel_96) + (encode_ieee_extended_intel_128, decode_ieee_extended_intel_128): + New functions which convert between 12-byte little-endian Intel + format and the desired format. + (ieee_extended_motorola_format, ieee_extended_intel_96_round_53_format) + (ieee_extended_intel_96_format, ieee_extended_intel_128_format): + Update. + +2004-06-17 Zack Weinberg + + * expmed.c (expand_mult_const): In sanity check, compare only + the bits of val and val_so_far that are significant in the + result mode. + +2004-06-17 Daniel Berlin + + * tree-ssa-pre.c: Update comments. + (val_expr_pair_eq): Factor code from here. + (expr_pred_trans_eq): and here. + (expressions_equal_p): To here. + (print_value_set): Print value for expression. + (phi_trans_lookup): Rename some variables. + (lookup): Ditto. + (value_exists_in_set_bitmap): Ditto. + (value_remove_from_set_bitmap): Ditto. + (value_insert_into_set_bitmap): Ditto. + +2004-06-17 Ulrich Weigand + + * config/s390/s390-modes.def (CCL3mode): New machine mode. + * config/s390/s390.c (s390_match_ccmode_set): Support CCL3mode. + (s390_alc_comparison, s390_slb_comparison): Likewise. + (s390_branch_condition_mask): Likewise. + * config/s390/s390.md ("*subdi3_cc2", "*subdi3_cconly2"): New. + ("*subsi3_cc2", "*subsi3_cconly2"): New. + + * config/s390/s390.h (PREDICATE_CODE): Accept SIGN_EXTEND and + ZERO_EXTEND for s390_alc_comparison and s390_slb_comparison. + * config/s390/s390.c (s390_alc_comparison, s390_slb_comparison): + Handle SIGN_EXTEND and ZERO_EXTEND. + + * config/s390/s390-protos.h (s390_expand_addcc): New prototype. + * config/s390/s390.c (s390_expand_addcc): New function. + * config/s390/s390.md ("adddicc", "addsicc"): New expanders. + ("*sconddi", "*scondsi", "*sconddi_neg", "*scondsi_neg"): New insns. + ("sltu", "sgtu", "sleu", "sgeu"): New expanders. + +2004-06-17 Ben Elliston + + * tree-alias-common.c: Add whitespace. + * tree-inline.c: Correct comment about this file's purpose. + * tree-optimize.c: Likewise. + * tree-tailcall.c: Likewise. + + * tree-alias-ander.h: Add standard top-of-file comment. + * tree-alias-common.h: Likewise. + * tree-alias-type.h: Likewise. + +2004-06-16 Daniel Berlin + + * tree-ssa-pre.c (compute_avail): Value number uses as well. + Strip useless type conversions. + Casts have to be treated slightly different than normal unaries. + +2004-06-16 Richard Henderson + + * c-common.def (COMPOUND_STMT): Remove. + * c-common.c (finish_fname_decls): Don't look through it. + * c-typeck.c (c_tree_expr_nonnegative_p): Likewise. + * c-common.h (COMPOUND_BODY): Remove. + (c_common_stmt_codes): Remove COMPOUND_STMT. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * tree.h (DECL_SAVED_TREE): Update commentary. + * doc/c-tree.texi (ASM_EXPR): Rename from ASM_STMT. + (CASE_LABEL_EXPR): Rename from CASE_LABEL. + (GOTO_EXPR): Rename from GOTO_STMT. + (GOTO_FAKE_P): Remove. + (COMPOUND_STMT): Remove. + (HANDLER): Update wrt COMPOUND_STMT. + (STMT_EXPR): Likewise. + (LABEL_EXPR): Rename from LABEL_STMT. + (SCOPE_STMT): Remove. + * objc/objc-act.c (objc_build_try_catch_finally_stmt): Don't look + through COMPOUND_STMT. + +2004-06-16 Richard Henderson + + * c-common.h (c_begin_if_stmt, c_begin_while_stmt, + c_finish_while_stmt_cond): Remove decls. + * c-parse.in (if_prefix): Don't save c_begin_if_stmt result. + * c-typeck.c (c_begin_if_stmt): Return void. + (c_begin_else): Tidy. Save stmt_count. + * c-tree.h (c_begin_if_stmt): Update decl. + + * objc/objc-act.c (objc_build_try_enter_fragment, + objc_build_extract_fragment, objc_build_try_epilogue, + objc_build_catch_stmt, objc_build_catch_epilogue, + objc_build_finally_prologue, objc_build_finally_epilogue): Update + for if builder function changes. + +2004-06-16 Ulrich Weigand + + * config/s390/s390.c (struct machine_function): New member + last_restore_gpr. + (s390_frame_info): Add BASE_USED and RETURN_ADDR_USED parameters. + Do not modify machine->save_return_addr_p or regs_ever_live. + Fill in machine->last_restore_gpr. + (s390_optimize_prolog): Use s390_frame_info to compute registers + to save/restore, remove duplicated code. + (s390_arg_frame_offset): Use s390_frame_info to compute frame + size, remove duplicated code. + (s390_emit_prologue): Adapt s390_frame_info call. Update + machine->save_return_addr_p and regs_ever_live. + (s390_emit_epilogue): Use machine->last_restore_gpr instead of + machine->last_save_gpr. + +2004-06-16 Richard Henderson + + * c-parse.in (if_stmt_locus): Remove. + (if_prefix): Increment stmt_count; pass it to c_finish_if_cond. + (select_or_iter_stmt): Move empty if warnings to c-typeck.c. + * c-typeck.c (if_elt): Sort by expected size. Rename locus to + empty_locus. Add stmt_count, saw_else. + (c_begin_if_stmt): Push if_stack here. + (c_finish_if_cond): Rename from c_expand_end_cond. Record stmt_count. + (c_finish_then, c_finish_else): Record empty_locus. + (c_begin_else): Rename from c_expand_start_else. Record stmt_count. + (c_finish_if_stmt): Rename from c_expand_end_cond. Warn for empty + if or else body. + * c-tree.h: Update prototypes. + +2004-06-16 Steven Bosscher + + * tree.h (PHI_CHAIN): New. + * (tree-cfg.c, tree-dfa.c, tree-flow-inline.h, tree-into-ssa.c, + tree-outof-ssa.c, tree-phinodes.c, tree-pretty-print.c, + tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-dse.c, + tree-ssa-live.c, tree-ssa-loop.c, tree-ssa-phiopt.c, tree-ssa-pre.c, + tree-ssa.c, tree-tailcall.c): Use PHI_CHAIN instead of TREE_CHAIN + when traversing a list of PHI_NODEs. + +2004-06-16 Bernardo Innocenti + + PR target/13292 + * config/m68k/m68k.h (TARGET_SWITCHES): Don't remove MASK_68040_ONLY + on -msoft-float. + (TARGET_FLT_EVAL_METHOD): Don't advertise extended precision for + 68040 and soft-float. + * config/m68k/m68k.md (truncdfsf2): Explicitly require TARGET_68881 + in the TARGET_68040_ONLY case. + +2004-06-16 Peter Barada + + * config/m68k/m68k.md (movsi_cfv4): New pattern to allow mov3q. + (movsi_cf): Make named, don't match TARGET_CFV4. + (pushexthisi_const): Use mov3q if possible. + (extendhisi2, cvf4_extendhisi2): Split extendhisi2 pattern + to special case mvz.w for ColdFire V4. + (extendqisi2, cvf4_extendqisi2): Split extendhisi2 pattern + to special case mvz.b for ColdFire V4. + (udivmodhi4, divmodhi4): Use mvz to zero extend arg for + divide. + (iorsi3, xorsi3, andsi3): Use bitfield instructions if possible. + * config/m68k/m68k.c(valid_mov3q_const): New function. + (const_method): SWAP is valid for ColdFire. + (MULL_COST, MULW_COST): Fix costs for ColdFire V3/V4. + * config/m68k/m68k-protos.h (valid_mov3q_const): Prototype here. + +2004-06-16 Richard Henderson + + * c-common.def (CASE_LABEL): Remove. + * c-common.c (c_add_case_label): Use CASE_LABEL, not CASE_LABEL_DECL. + (match_case_to_enum_1): Likewise. + * c-common.h (c_common_stmt_codes): Remove CASE_LABEL. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-semantics.c (build_case_label): Use CASE_LABEL_EXPR. + * tree.h (CASE_LOW): Update commentary. + +2004-06-16 Richard Henderson + + * c-common.def (ASM_STMT): Remove. + * c-common.h (c_common_stmt_codes): Remove ASM_STMT. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-typeck.c (build_asm_expr): Use ASM_EXPR. + * tree.h: Fix commentary. + +2004-06-16 Richard Henderson + + * c-common.def (GOTO_STMT, LABEL_STMT): Remove. + * c-common.c (c_add_case_label): Use LABEL_EXPR. + * c-common.h (GOTO_FAKE_P, LABEL_STMT_LABEL): Remove. + (c_common_stmt_codes): Remove GOTO_STMT, LABEL_STMT. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (c_gimplify_stmt): Likewise. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-parse.in (stmt): Use GOTO_EXPR. + (label): Use LABEL_EXPR. + * c-semantics.c (build_stmt): Set TREE_TYPE to void. + * tree-inline.c (copy_body_r): Don't build empty BLOCKs. + +2004-06-16 J"orn Rennecke + + * cfgcleanup.c (try_simplify_condjump): Update test to make + sure we have a conditional branch around am unconditional branch. + +2004-06-16 Daniel Berlin + + * tree-cfg.c (pass_split_crit_edge): Give it a name and a dump file. + +2004-06-16 Dale Johannesen + + * loop.c (loop_givs_reduce): Avoid miscompilation of + loops entered at bottom. + +2004-06-16 J"orn Rennecke + + * cfglayout.c (fixup_reorder_chain): Handle case where the + destination of E_FALL is EXIT_BLOCK_PTR. + +2004-06-16 Vladimir Makarov + + PR target/15653 + * config/ia64/ia64.c (ia64_dfa_new_cycle): Do not insert nops + after shifts before asm. + +2004-06-16 Zdenek Dvorak + + PR tree-optimization/15993 + * tree-ssa-dom.c (thread_across_edge): Do not thread edge if its + destination is unchanged. + +2004-06-16 Andreas Jaeger + + * doc/install.texi (Configuration): Update description for + --enable-version-specific-runtime-libs. + +2004-06-16 Paolo Bonzini + + * doc/install.texi: boehm-gc now uses automake 1.8.5. + +2004-06-16 Paolo Bonzini + + * toplev.h (rest_of_compilation): Adjust prototype. + +2004-06-16 Paolo Bonzini + + * coverage.c: Remove argument to rest_of_compilation. + * expr.c (execute_expand, set_save_expr_context, pass_expand): New. + * passes.c (rest_of_compilation): Remove argument. + (pass_rest_of_compilation): New. + (rest_of_handle_final, rest_of_handle_delay_slots, + rest_of_handle_stack_regs, rest_of_handle_variable_tracking + rest_of_handle_machine_reorg, rest_of_handle_regrename + rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_gcse2 + rest_of_handle_regmove, rest_of_handle_tracer + rest_of_handle_if_conversion, rest_of_handle_if_after_combine + rest_of_handle_web, rest_of_handle_branch_prob + rest_of_handle_value_profile_transformations, rest_of_handle_cfg + rest_of_handle_addressof, rest_of_handle_jump_bypass + rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2): + Check that the two arguments are actually superfluous. + * tree-optimize.c (register_dump_files): Add properties argument. + Track validity of passes. Only initialize dump files for + tree-based passes. Store the full set of provided passes in + the pass. + (init_tree_optimization_passes): Register pass_expand and + pass_rest_of_compilation. + (execute_one_pass): Do not track the presence of required properties + here. Set in_gimple_form. Do not update current_properties. + (current_properties): Remove. + (set_save_expr_context): Remove. + (tree_rest_of_compilation): Do not set in_gimple_form. Do not + expand to RTL here, and do not call rest_of_compilation. Push + GGC context even before gimplification. + * tree-pass.h (PROP_rtl, PROP_trees): New flags. + (pass_expand, pass_rest_of_compilation): Declare. + +2004-06-15 Jeff Law + + * fold-const.c (swap_tree_comparison): No longer static. + (tree_swap_operands_p): Similarly. Return true if both operands + are SSA_NAMEs and the first operand has a higher version number than + the second operand. + * tree.h (swap_tree_comparison): Prototype. + (tree_swap_operands_p): Prototype. + * tree-ssa-operands.c (get_expr_operands): For commutative + operators and relational comparisons, canonicalize the + order of the operands. + +2004-06-15 Richard Henderson + + * c-common.c (lang_gimplify_stmt): Remove next_p argument. + (if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then, + c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt, + c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c. + (finish_fname_decls, fname_decl): Use statement_lists. + (c_expand_expr_stmt): Don't set last_expr_type. + (c_type_hash): Fix indentation. + (c_safe_from_p): Don't follow TREE_CHAIN. + (c_tree_chain_matters_p): Remove. + * c-common.def (SCOPE_STMT): Remove. + (CLEANUP_STMT): Redefine to contain its own body. + * c-common.h (struct stmt_tree_s): Remove x_last_stmt, + x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack. + Add x_cur_stmt_list. + (last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove. + (cur_stmt_list): New. + (STATEMENT_LIST_STMT_EXPR): New. + (SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P, + SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove. + (CLEANUP_BODY): New. + (CLEANUP_DECL): Move to operand 2. + (c_common_stmt_codes): Remove SCOPE_STMT. + (COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove. + * c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove. + (c_push_function_context, c_pop_function_context): Don't save it. + (finish_decl): Set TREE_USED on the decl for a cleanup. + Use push_cleanup. + (store_parm_decls): Use statement lists. + (finish_function): Remove compstmt rule workaround. Use statement + lists. Call finish_fname_decls after finalizing the body. + (c_begin_compound_stmt): Move to c-typeck.c. + * c-dump.c (c_dump_tree): Remove SCOPE_STMT. + * c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New. + (c_genericize): Invoke them. + (c_gimplify_stmt): Don't look through TREE_CHAIN. Kill SCOPE_STMT. + (c_build_bind_expr): Export. + (gimplify_block, gimplify_cleanup): Remove. + (gimplify_condition): Use gimplify_stmt. + (gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack. + (gimplify_if_stmt): Remove recursion hack. + (c_gimplify_expr): Remove STMT_EXPR handling. + (stmt_expr_last_stmt, gimplify_stmt_expr): Remove. + (is_last_stmt_of_scope): Remove. + * c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. + * c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt, + c_end_compound_stmt. + * c-objc-common.c (build_cdtor): Likewise. + * c-parse.in (primary): Use c_finish_stmt_expr. + (push_scope, pop_scope): Remove. + (c99_block_start, compstmt_start): Use c_begin_compound_stmt. + (c99_block_end, compstmt): Use c_end_compound_stmt. + (c99_block_lineno_labeled_stmt): Likewise. + (compstmt_primary_start): Use c_begin_stmt_expr. + (simple_if, select_or_iter_stmt): Update calls to stmt builders. + (do_stmt_start): Fill in body directly. + (lineno_stmt): Avoid setting lineno on constants. + * c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST. + Remove SCOPE_STMT. + * c-semantics.c (begin_stmt_tree): Remove. + (push_stmt_list, re_push_stmt_list, pop_stmt_list): New. + (add_stmt): Use statement lists. + (add_scope_stmt, finish_stmt_tree): Remove. + (push_cleanup): New. + * c-tree.h: Move some decls from c-common.h. + * c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists. + (do_case, c_finish_case): Likewise. + (c_finish_then): Take body for then as argument. + (c_finish_else): Similarly. + (c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond, + c_finish_for_stmt_incr, c_finish_for_stmt): New. + (c_begin_stmt_expr, c_finish_stmt_expr): New. + (c_begin_compound_stmt): Do scope management. + (c_end_compound_stmt): New. + * fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR. + * gimplify.c (voidify_wrapper_expr): Accept temporary argument. + Look through exception handling constructs. + (gimplify_bind_expr): Accept temporary argument. + (gimplify_target_expr): Special case BIND_EXPR bodies. + (gimplify_expr): Handle fallback == fb_none like a statement. + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill. + * langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove. + * langhooks.h (tree_chain_matters_p): Remove. + * stub-objc.c (objc_clear_super_receiver): New. + * tree-gimple.h (voidify_wrapper_expr): Update decl. + (append_to_statement_list, append_to_statement_list_force): Move + to tree-iterator.h. + * tree-inline.c (expand_call_inline): Update call. + (clone_body): Use statement lists. + (walk_tree): Don't check tree_chain_matters_p. + (copy_tree_r): Likewise. + * tree-iterator.c (alloc_stmt_list): Clear lang bits. + (tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly. + * tree-iterator.h (append_to_statement_list, + append_to_statement_list_force): Moved from tree-gimple.h. + * tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump. + * objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt. + (objc_enter_block): Likewise. + (objc_exit_block): Use c_end_compound_stmt. + (objc_build_try_enter_fragment): Add #error and comment for + rewriting for OBJCPLUS. + (objc_build_extract_fragment, objc_build_try_epilogue, + objc_build_catch_stmt, objc_build_finally_prologue, + objc_build_finally_epilogue): Update for C statement builders. + * objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): + Remove. + +2004-06-15 Zdenek Dvorak + + * df.c (df_reg_clobber_gen): Removed. + (df_bb_rd_local_compute, df_insn_refs_record, df_rd_local_compute): + Make more effective for hard regs. + * ra-build.c (livethrough_conflicts_bb): Check contains_call. + +2004-06-15 Alexandre Oliva + + * c-pragma.h (c_lex_string_translate): Change type to int. + * c-parse.in: Change all assignments of c_lex_string_translate + to true and false to 1 and 0. + * c-lex.c (c_lex_string_translate): Likewise. + (lex_string): Convert string without translation in the -1 + case. + +2004-06-15 Mark G. Adams + + * convert.h: Add include guards + +2004-06-15 Daniel Berlin + + * tree-flow-inline.h: Document all functions. + +2004-06-15 Daniel Berlin + + * tree-flow-inline.h (stmt_ann): Remove use of is_essa_node. + * tree-dfa.c (create_stmt_ann): Ditto. + * tree-pretty-print.c (dump_generic_node): Remove E* node handling. + * tree-inline.c (estimate_num_insns_1): Ditto. + * tree.c (tree_size): Ditto. + (make_node_stat): Ditto. + (tree_node_structure): Ditto. + (ephi_node_elt_check_failed): Remove. + (is_essa_node): Ditto. + * tree.def (EPHI_NODE): Ditto. + (EEXIT_NODE): Ditto. + (EUSE_NODE): Ditto. + (EKILL_NODE): Ditto. + * tree.h (EREF_NODE_CHECK): Remove. + (EPHI_NODE_ELT_CHECK): Ditto. + (struct tree_eref_common): Ditto. + (struct tree_euse_node): Ditto. + (struct ephi_arg_d): Ditto. + (struct tree_ephi_node): Ditto. + (ephi_node_elt_check_failed): Remove prototype. + (is_essa_node): Ditto. + (enum tree_node_structure_enum): Remove TS_E*_NODE. + (union tree_node): Remove E*_NODE uses. + +2004-06-15 Jerry Quinn + + * alias.c (record_set, record_base_value, canon_rtx, get_addr, + nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. + * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): + Likewise. + * builtins.c (expand_builtin_setjmp, expand_builtin_apply, + expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, + expand_builtin_strcmp, expand_builtin_strncmp, + expand_builtin_frame_address): Likewise. + * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, + insert_one_insn): Likewise. + * calls.c (prepare_call_address, precompute_register_parameters, + precompute_arguments, expand_call, emit_library_call_value_1): Likewise. + * cfganal.c (flow_active_insn_p): Likewise. + * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, + combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, + subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, + make_extraction, recog_for_combine, gen_lowpart_for_combine, + simplify_comparison, record_dead_and_set_regs_1, + record_dead_and_set_regs, record_promoted_value, + check_promoted_subreg, get_last_value_validate, get_last_value, + reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, + unmentioned_reg_p_1): Likewise. + * conflict.c (mark_reg): Likewise. + * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, + mention_regs, insert_regs, lookup, lookup_for_remove, insert, + merge_equiv_classes, flush_hash_table, invalidate, + remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, + invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, + cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, + record_jump_cond, cse_insn, addr_affects_sp_p, + invalidate_from_clobbers, cse_process_notes, cse_around_loop, + cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, + cse_cc_succs, cse_condition_code_reg): Likewise. + * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, + cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, + cselib_record_set, cselib_record_sets): Likewise. + * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, + dbxout_block): Likewise. + * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. + * dojump.c (do_jump): Likewise. + * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, + is_based_loc, rtl_for_decl_location): Likewise. + * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, + set_decl_incoming_rtl, mark_user_reg): Likewise. + * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, + copy_to_suggested_reg, allocate_dynamic_stack_space, + probe_stack_range, hard_function_value): Likewise. + * expmed.c (store_bit_field, store_fixed_bit_field, + store_split_bit_field, extract_bit_field, extract_fixed_bit_field, + extract_split_bit_field, expand_divmod, emit_store_flag_force): + Likewise. + * expr.c (convert_move, convert_modes, + block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, + use_group_regs, emit_move_insn, emit_move_insn_1, + compress_float_constant, push_block, emit_single_push_insn, + emit_push_insn, get_subtarget, expand_assignment, store_expr, + store_constructor, store_field, force_operand, safe_from_p, + expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): + Likewise. + * final.c (profile_function, final_scan_insn, alter_subreg, + get_mem_expr_from_op, output_asm_operand_names, output_operand, + only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. + * flow.c (verify_wide_reg_1, mark_regs_live_at_end, + find_regno_partial, propagate_one_insn, init_propagate_block_info, + insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, + attempt_auto_inc, find_auto_inc, mark_used_regs, + count_or_remove_death_notes_bb): Likewise. + * function.c (find_temp_slot_from_address, update_temp_slot_address, + preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, + fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, + put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, + purge_single_hard_subreg_set, instantiate_decl, + instantiate_virtual_regs_1, aggregate_value_p, assign_parms, + promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, + setjmp_protect, setjmp_protect_args, fix_lexical_addr, + expand_function_start, diddle_return_value, clobber_return_register, + expand_function_end, keep_stack_depressed, handle_epilogue_set, + update_epilogue_consts): Likewise. + * genemit.c (gen_exp, gen_insn): Likewise. + * genrecog.c (make_insn_sequence): Likewise. + * global.c (global_conflicts, expand_preferences, mark_reg_store, + mark_reg_conflicts, set_preference, reg_becomes_live, + build_insn_chain, mark_reg_change): Likewise. + * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): + Likewise. + * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): + Likewise. + * integrate.c (copy_rtx_and_substitute, try_constants, + subst_constants, mark_stores, allocate_initial_values): Likewise. + * jump.c (reversed_comparison_code_parts, delete_prior_computation, + delete_computation, rtx_renumbered_equal_p, true_regnum, + reg_or_subregno): Likewise. + * lcm.c (reg_dies, reg_becomes_live): Likewise. + * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, + update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, + wipe_dead_reg, no_conflict_p): Likewise. + * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, + iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, + simple_rhs_p, simplify_using_assignment, implies_p): Likewise. + * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, + move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, + find_single_use_in_loop, count_one_set, loop_bivs_init_find, + loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, + valid_initial_value_p, simplify_giv_expr, consec_sets_giv, + loop_regs_update, check_dbra_loop, maybe_eliminate_biv, + maybe_eliminate_biv_1, record_initial, update_reg_last_use, + canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, + try_swap_copy_prop): Likewise. + * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, + expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): + Likewise. + * postreload.c (reload_cse_simplify, reload_cse_simplify_set, + reload_cse_simplify_operands, reload_combine, + reload_combine_note_store, reload_combine_note_use, + reload_cse_move2add, move2add_note_store): Likewise. + * print-rtl.c (print_rtx): Likewise. + * ra-build.c (copy_insn_p, remember_move, init_one_web_common, + contains_pseudo, handle_asm_insn): Likewise. + * ra-debug.c (ra_print_rtx_object, dump_constraints, + dump_static_insn_cost): Likewise. + * ra-rewrite.c (slots_overlap_p, emit_colors, + remove_suspicious_death_notes): Likewise. + * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, + register_operand, scratch_operand, nonmemory_operand, + constrain_operands): Likewise. + * reg-stack (check_asm_stack_operands, remove_regno_note, + emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, + subst_asm_stack_regs): Likewise. + * regclass.c (scan_one_insn, record_reg_classes, copy_cost, + record_address_regs, reg_scan_mark_refs): Likewise. + * regmove.c (discover_flags_reg, replacement_quality, + copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, + fixup_match_1): Likewise. + * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, + kill_set_value, copyprop_hardreg_forward_1): Likewise. + * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, + reload_inner_reg_of_subreg, can_reload_into, push_reload, + combine_reloads, find_dummy_reload, hard_reg_set_here_p, + operands_match_p, decompose, find_reloads, find_reloads_toplev, + find_reloads_address, subst_indexed_address, find_reloads_address_1, + find_reloads_subreg_address, find_replacement, + refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, + refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. + * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, + find_reg, delete_dead_insn, alter_reg, eliminate_regs, + elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, + forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, + emit_input_reload_insns, emit_output_reload_insns, do_input_reload, + do_output_reload, emit_reload_insns, gen_reload, + delete_address_reloads_1, inc_for_reload): Likewise. + * reorg.c (update_reg_dead_notes, fix_reg_dead_note, + update_reg_unused_notes, fill_slots_from_thread): Likewise. + * resource.c (update_live_status, mark_referenced_resources, + mark_set_resources, mark_target_live_regs): Likewise. + * rtlanal.c (nonzero_address_p, get_jump_table_offset, + global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, + reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, + note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, + find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, + parms_set, find_first_parameter_load, keep_with_call_p, + hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, + num_sign_bit_copies1): Likewise. + * rtlhooks.c (gen_lowpart_general): Likewise. + * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, + sched_analyze): Likewise. + * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): + Likewise. + * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. + * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, + simplify_binary_operation, simplify_const_relational_operation, + simplify_subreg): Likewise. + * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, + expand_end_stmt_expr, expand_return, expand_decl, + expand_anon_union_decl): Likewise. + * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, + find_splittable_regs, find_splittable_givs, find_common_reg_term, + loop_iterations): Likewise. + * var-tracking.c (variable_union, variable_part_different_p, + variable_different_p, count_uses, add_uses, add_stores, + compute_bb_dataflow, set_variable_part, delete_variable_part, + emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): + Likewise. + * varasm.c (assemble_variable): Likewise. + +2004-06-15 Chris Demetriou + + * config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove + definition. + * config/mips/linux64.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove + #undef and #if 0'd definition. + +2004-06-15 J"orn Rennecke + + * combine.c (distribute_notes): Comment typo fix. + +2004-06-15 Roger Sayle + + * expmed.c (synth_mult): Mask bits of the multiplier to the + machine mode of the multiplication. Don't consider shifts + by more than (or equal to) the width of the operation's mode. + +2004-06-15 Paolo Bonzini + + * doc/install.texi: Yet another update for autoconf + and automake versions. + +2004-06-15 Paolo Bonzini + + * function.h (struct function): Remove cannot_inline field. + (current_function_cannot_inline): Remove. + * passes.c (rest_of_compilation): Reset DECL_DEFER_OUTPUT. + Simplify conditionals to ignore warn_return_type. + * tree-optimize.c (tree_rest_of_compilation): Do not reset + DECL_DEFER_OUTPUT. + * objc/objc-act.c (build_module_descriptor, finish_method_def): + Do not set current_function_cannot_inline. + +2004-06-15 J"orn Rennecke + + * cfglayout.c (fixup_reorder_chain): Handle case where the + destination of E_TAKEN is EXIT_BLOCK_PTR. + +2004-06-15 Diego Novillo + + * tree-ssa-copy.c (cprop_into_successor_phis): Fix typo. + +2004-06-15 Paolo Bonzini + + * fold-const.c (operand_equal_p): Update comment. + +2004-06-15 Kazuhiro Inaoka + + * config/m32r/m32r.h (RETURN_ADDR_RTX): Define. + (INCOMING_RETURN_ADDR_RTX): Define. + * config/m32r/m32r-protos.h (m32r_return_addr): Added. + * config/m32r/m32r.c (m32r_exppand_prologue): Changed for + __builtin_return_address(0). + (m32r_return_addr): Added for __builtin_return_address(0). + (m32r_reload_lr): Ditto. + + * longlong.h: Fix macros for m32r add_ssaaaa and sub_ddmmss. + +2004-06-15 Paolo Bonzini + + * doc/install.texi (Prerequisites): Update libbanshee, + fastjar, libcpp, libjava/libltdl entries to + automake 1.8.5. + +2004-06-15 Eric Botcazou + Olivier Hainque + + * function.c (fixup_var_refs): Also adjust the start of sequence + after fixing up the insns. + +2004-06-15 Giovanni Bajo + + * gccbug.in: Update optimization -> tree-optimization/rtl-optimization. + +2004-06-14 Benjamin Kosnik + + * doc/install.texi (Prerequisites): Update libstdc++ entry to + automake 1.8.5. + +2004-06-14 Eric Christopher + + * config/s390/s390.h (TARGET_SWITCHES): Change -mtpf (-mno-tpf) + to -mtpf-trace (-mno-tpf-trace). + * doc/invoke.texi (S/390 and zSeries Options): Add tpf option + documentation. + +2004-06-14 Eric Botcazou + + * real.c: Fix bit count in head comment. + +2004-06-14 Jeff Law + + * tree-ssa.c (kill_redundant_phi_nodes): More correctly handle + PHIs where the destination or an argument is marked with + SSA_NAME_OCCURS_IN_ABNORMAL_PHI. + +2004-06-14 Jakub Jelinek + + PR middle-end/15945 + * simplify-rtx.c (simplify_binary_operation): Don't optimize out + Inf + -Inf, Inf - Inf, Inf / Inf and 0 * Inf if flag_trapping_math. + +2004-06-14 Zdenek Dvorak + + * opts.sh (var_args): Fix regexp. + +2004-06-14 Jakub Jelinek + + PR target/15178 + * config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Define. + +2004-06-14 Paul Brook + + * dwarf2out.c (output_call_frame_info): Support dwarf3 cie entries. + +2004-06-14 Zdenek Dvorak + + * Makefile.in (FLAGS_H): New. + (flags.h): Replace by FLAGS_H. + * c.opt: Document Var, VarExists, Init and Report attributes. + * common.opt: Fill the values of the attributes. + * diagnostic.c (flag_fatal_errors): Do not define. + * except.c (flag_non_call_exceptions): Do not define. + * flags.h: Include options.h. Remove declarations conflicting with + the automatically defined ones. + * opts.c: Remove automatically defined variables. + (handle_option): Perform default initialization. + (common_handle_option): Do not handle options covered by the + default initialization. + * opts.h (struct cl_option): Add flag_var, has_set_value and set_value + fields. + (CL_REPORT): New. + * opts.sh: Generate variable declarations, handle CL_REPORT. + * toplev.c: Remove automatically defined variables. + (f_options): Removed. + (print_switch_values): Use cl_options instead of f_options. + * toplev.h (version_flag): Declaration removed. + +2004-06-14 Ian Lance Taylor + + * config/sparc/sparc.h: Correct comment about availability of + little endian option. + + * config.gcc: Remove sparc64-*-aout*. + * config/sparc/sparc.c (sparc_aout_select_rtx_section): Remove. + * config/sparc/sp64-aout.h: Remove. + * config/sparc/aout.h: Remove. + +2004-06-14 Ulrich Weigand + + * config/s390/s390.c: Include "tree-gimple.h". + (s390_gimplify_va_arg): New function. + (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + (s390_va_arg): Remove. + * config/s390/s390-protos.h (s390_va_arg): Remove. + * config/s390/s390.h (EXPAND_BUILTIN_VA_ARG): Call abort (). + +2004-06-14 J"orn Rennecke + + * basic-block.h (could_fall_through): Declare. + * cfganal.c (can_fallthru): Succeed if the target is EXIT_BLOCK_PTR. + Fail if the source already has a fallthrough edge to the exit + block pointer. + (could_fall_through): New function. + * cfgbuild.c (make_edges): Check if we already have a fallthrough + edge to the exit block pointer. + * cfglayout.c (fixup_fallthru_exit_predecessor): Check that it is + not called before reload has completed. + Handle special case of first block having a fall-through exit edge. + (cfg_layout_finalize): Don't call it before reload or if we have + rtl epilogues. + (fixup_reorder_chain): A fall through to the exit block does not + require the block to come last. Add sanity checks. + * cfgrtl.c (rtl_split_edge): Add special handling of fall through + edges to the exit block. + * function.c (cfglayout.h): #include. + (thread_prologue_and_epilogue_insns): If we have neither return nor + epilogue, but a fall through to the exit block from mid-function, + force a non-fall-through exit. + * Makefile.in (function.o): Depend on CFGLAYOUT_H. + +2004-06-14 Alan Modra + + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Handle -mpowerpc64 and -mcpu + for power5 and rs64a. Correct condition for default. Correct power3, + 620, 630, 7400, 7450, G4, 970 and G5 -mcpu entries. Add -many. + +2004-06-13 Steven Bosscher + + * gcse.c (hash_scan_set, hash_scan_insn, mark_set, mark_oprs_set): + Revert previous change, don't use CALL_P. + +2004-06-13 Jason Merrill + + * tree.h: Move std_gimplify_va_arg_expr protoype here. + * tree-gimple.h: From here. + +2004-06-13 Daniel Berlin + + Fix PR tree-optimization/15979 + Fix PR tree-optimization/15981 + * tree-ssa-pre.c (insert_aux): Fix faulty logic so that we don't + try to insert values undefined along some path. + +2004-06-13 Daniel Berlin + + * tree-ssa-pre.c (add_to_value): is_gimple_min_invariant things + are available everywhere too. + +2004-06-13 Andrew Pinski + + * fold-const.c (fold_checksum_tree ): Only + look at TREE_VALUES if the EXPR is an ENUMERAL_TYPE. + Only look at TYPE_MIN_VALUE and TYPE_MAX_VALUE if + EXPR is an INTEGERAL_TYPE or a scalar float type. + +2004-06-13 Diego Novillo + + * tree-sra.c (tree_sra): Update documentation. + +2004-06-13 Joseph S. Myers + + * c-typeck.c (comptypes, tagged_types_tu_compatible_p, + function_types_compatible_p, type_lists_compatible_p): Remove + flags parameter. + * c-tree.h (comptypes): Likewise. + (COMPARE_STRICT): Remove. + * c-decl.c, c-lang.c, c-parse.in, c-typeck.c, objc/objc-act.c: All + callers changed. + +2004-06-13 Eric Christopher + + * c-decl.c (diagnose_mismatched_decls): Improve error message. + Remove unused code. + * c-typeck.c (comptypes): Add location in standard we're checking. + +2004-06-13 Kaz Kojima + + * config/sh/libgcc-std.ver: Add __unorddf2 and __unordsf2 with + version 3.3.4. + +2004-06-12 Roger Sayle + + * expmed.c (shift_cost, shiftadd_cost, shiftsub_cost): Additionally + index by machine mode. + (init_expmed): Initialize shift_cost, shiftadd_cost and shiftsub_cost + tables inside the loop over machine modes. + (synth_mult, expand_mult_highpart_optab, expand_mult_highpart, + expand_divmod): Index shift*_cost by the appropriate machine mode. + +2004-06-12 Eric Christopher + + * config/s390/s390.h: Rename TARGET_TPF to TARGET_TPF_PROFILING. + * config/s390/s390.md: Ditto. + * config/s390/s390.c: Ditto. + (s390_frame_info): Conditionalize frame and setup info on + TARGET_TPF_PROFILING. + (s390_arg_frame_offset): Ditto. + +2004-06-12 Roger Sayle + + * fold-const.c (omit_two_operands): New function. + * tree.h (omit_two_operands): Prototype here. + * builtins.c (fold_builtin_unordered_cmp): New function to lower + C99 unordered comparison builtins to the appropriate tree nodes. + (fold_builtin_1): Use fold_builtin_unordered_cmp to lower + BUILT_IN_ISGREATER, BUILT_IN_ISGREATEREQUAL, BUILT_IN_ISLESS, + BUILT_IN_ISLESSEQUAL and BUILT_IN_ISLESSGREATER. Manually lower + BUILT_IN_ISUNORDERED comparisons to an UNORDERED_EXPR tree node. + (simplify_builtin_memcmp, simplify_builtin_strncmp, + simplify_builtin_strncat, simplify_builtin_strspn): Use the new + omit_two_operands function to build the required COMPOUND_EXPRs. + +2004-06-12 Steven Bosscher , + Andreas Jaeger + + * gcse.c (record_set_info): Use predicates like REG_P. + (mems_conflict_for_gcse_p): Likewise. + (load_killed_in_block_p): Likewise. + (hash_expr_1): Likewise. + (insert_set_in_table): Likewise. + (gcse_constant_p): Likewise. + (hash_scan_set): Likewise. + (hash_scan_insn): Likewise. + (canon_list_insert): Likewise. + (record_last_mem_set_info): Likewise. + (record_last_set_info): Likewise. + (compute_hash_table_work): Likewise. + (mark_set): Likewise. + (mark_clobber): Likewise. + (mark_oprs_set): Likewise. + (compute_transp): Likewise. + (find_avail_set): Likewise. + (cprop_insn): Likewise. + (do_local_cprop): Likewise. + (cprop): Likewise. + (find_implicit_sets): Likewise. + (find_bypass_set): Likewise. + (bypass_conditional_jumps): Likewise. + (insert_insn_end_bb): Likewise. + (pre_insert_copy_insn): Likewise. + (compute_transpout): Likewise. + (next_ls_expr): Likewise. + (invalidate_any_buried_refs): Likewise. + (compute_ld_motion_mems): Likewise. + (reg_set_info): Likewise. + (reg_clear_last_set): Likewise. + (find_moveable_store): Likewise. + (compute_store_table): Likewise. + (find_loads): Likewise. + (store_killed_in_insn): Likewise. + (insert_insn_start_bb): Likewise. + (reg_set_between_after_reload_p): Likewise. + (reg_used_between_after_reload_p): Likewise. + (is_jump_table_basic_block): Likewise. + (gcse_after_reload): Likewise. + (hash_scan_set_after_reload): Likewise. + (compute_hash_table_after_reload): Likewise. + +2004-06-12 Steven Bosscher + + * rtl.h (MEM_P, NONJUMP_INSN_P, CALL_INSN_P): New predicates. + (INSN_P): Don't look at the rtx code class, just explicitly + check for one of the tree RTX_INSN codes. + +2004-06-11 Zack Weinberg + + * c-typeck.c (default_function_array_conversion): Use + build_pointer_type not TYPE_POINTER_TO. + +2004-06-11 Zack Weinberg + + * configure.ac: Don't invoke ACX_HEADER_STDBOOL. + * configure, config.in: Regenerate. + * system.h: Unconditionally define bool as unsigned char, + BOOL_BITFIELD as unsigned int. + * domwalk.h: Use BOOL_BITFIELD. + +2004-06-12 Andreas Jaeger + + * libgcc-std.ver: Add __unorddf2 and __unordsf2 with version 3.3.4. + * libgcc-darwin.ver: Likewise. + +2004-06-12 Peter Jakubek + + * reload.c (find_reloads): Force reload for pseudo registers on big + endian machines. + +2004-06-11 Steven Bosscher + + * tree-ssa-dce.c (mark_control_dependent_edges_necessary): + Don't try to mark anything control dependent on the entry or + exit blocks. + +2004-06-11 Daniel Berlin + + Fix Bug 15899 + Fix Bug 15460 + * tree.h (SSA_NAME_VALUE): New macro. + (struct tree_ssa_name): Add value_handle member. + * tree-ssa-pre.c: Replaced. + * tree-flow.h (tree_ann_type): Add CST_ANN, EXPR_ANN. + (struct cst_ann_d): New. + (struct expr_ann_d): New. + (union tree_ann_d): Add cst_ann, expr_ann. + * tree-dfa.c (create_cst_ann): New function. + (create_expr_ann): Ditto. + * tree-flow-inline.h (cst_ann): New function. + (expr_ann): Ditto. + (get_cst_ann): Ditto. + (get_expr_ann): Ditto.. + +2004-06-11 John David Anglin + + * pa.c (pa_hpux_init_libfunc): Add support for unord_optab. + * pa/quadlib.c (enum qfcmp_magic): Define magic values for call to + _U_Qfcmp library function. + (_U_Qfltgt, _U_Qfunle, _U_Qfunlt, _U_Qfunge, _U_Qfungt, _U_Qfuneq, + _U_Qfunord, _U_Qford): Add more TFmode builtin compare functions. + + * pa.c (legitimize_pic_address): Use UNSPEC_DLTIND14R to identify + unspec used for loading address from DLT. + * pa.md: Define constants for the uses of UNSPEC and UNSPEC_VOLATILE. + Change all users of UNSPEC and UNSPEC_VOLATILE to use new constants. + Don't use short code sequence when loading the address of a nonlocal + label. + (nonlocal_goto): New expander. + (indirect_goto): New jump pattern for nonlocal gotos. + (short_jump): Remove extra whitespace. + (builtin_longjmp): Clobber memory and hard frame pointer. Restore + frame pointer via virtual_stack_vars_rtx when we have a nonlocal goto + pattern. + +2004-06-11 Roger Sayle + + * expmed.c (synth_mult): Add an additional MODE argument for the + machine mode of the multiplication. Update recursive calls. Use + mode instead of word_mode for determining operation costs. + (choose_mult_variant): Update calls to synth_mult with "mode". + +2004-06-11 Richard Henderson + + * tree-ssa-operands.c (get_stmt_operands): Clear makes_aliased_loads + and makes_aliased_stores. + +2004-06-11 Andrew Pinski + + * doc/install.text (--enable-shared): Fix typo. + +2004-06-11 Richard Henderson + + * config/alpha/alpha.c (alpha_gimplify_va_arg_1): Remove post_p + argument. Use internal post for call to gimplify_expr. Tidy + rounded type size computation. + (alpha_gimplify_va_arg): Use get_formal_tmp_var and + get_initialized_tmp_var. + +2004-06-11 Andrew Pinski + + * doc/install.texi (--enable-shared): Update libobjc's shared library + status. Remove reference to libf2c. + +2004-06-11 Jason Merrill + + * config/i386/i386.h (EXPAND_BUILTIN_VA_ARG): Just abort. + * config/i386/i386.c (ix86_va_arg): Remove. + * config/rs6000/rs6000.h (EXPAND_BUILTIN_VA_ARG): Just abort. + * config/rs6000/rs6000.c (rs6000_va_arg): Remove. + * config/alpha/alpha.h (EXPAND_BUILTIN_VA_ARG): Just abort. + * config/alpha/alpha.c (alpha_va_arg): Remove. + * config/sparc/sparc.h (EXPAND_BUILTIN_VA_ARG): Just abort. + * config/sparc/sparc.c (sparc_va_arg): Remove. + + * tree-ssa-operands.c (get_stmt_operands): Use a V_MAY_DEF if the + assignment might throw. + * tree-eh.c (tree_could_throw_p): Support non-call exceptions in + expressions. + +2004-06-11 J"orn Rennecke + + PR 15886: + * sh.h (ALLOCATE_INITIAL_VALUE): Use return_address_pointer_rtx. + +2004-06-11 Joseph S. Myers + + * doc/install.texi (Prerequisites): Update documentation of + required versions of autoconf and automake. Remove mention of + libf2c. + +2004-06-11 Jason Merrill + + * config/sparc/sparc.c (sparc_gimplify_va_arg): New fn. + (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + +2004-06-11 Jerry Quinn + + * typeclass.h: Add GPL plus exception license. Add include + guard. + +2004-06-10 Jason Merrill + + * gimplify.c (gimplify_modify_expr): Don't force a temporary + of an aggregate_value_p type. + +2004-06-10 Jeff Law + + * fold-const.c (fold_inf_compare): Avoid creating non-gimple + code when we are in gimple form. + +2004-06-10 Diego Novillo + + * Makefile.in (tree-ssanames.o): Depend on TREE_FLOW_H. + * tree-flow.h (ssa_names, num_ssa_names, ssa_name): Declare. + (highest_ssa_version): Remove. + * tree-outof-ssa.c (new_temp_expr_table): Replace + highest_ssa_version with num_ssa_names. + (dump_replaceable_exprs): Likewise. + (rewrite_vars_out_of_ssa): Likewise. + * tree-ssa-ccp.c (initialize): Likewise + * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. + * tree-ssa-dce.c (tree_dce_init): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. + * tree-ssa-live.c (create_ssa_var_map): Likewise. + (dump_var_map): Likewise. + * tree-ssa.c (verify_ssa): Likewise. + (kill_redundant_phi_nodes): Likewise. + Do not build a local array of SSA_NAMEs. Use the ssa_names table. + * tree-ssanames.c: Include tree-flow.h + (ssa_names): New varray. + (init_ssa_names): Initialize ssa_names. + Reserve the first slot of the ssa_names table. + (make_ssa_name): Push the newly created SSA_NAME into ssa_names. + Assign version numbers using num_ssa_names. + +2004-06-10 Joseph S. Myers + + * doc/sourcebuild.texi (Front End): Add details of more + installation documentation required. + +2004-06-10 Brian Booth + + * doc/tree-ssa.texi: Remove references to VDEF and add descriptions + of V_MAY_DEF and V_MUST_DEF. + * tree-dfa.c (dfa_stats_d): Add num_v_must_defs and rename + num_vdefs to num_v_may_defs. + (compute_immediate_uses_for_stmt): Rename occurences of vdef + to v_may_def. + (redirect_immediate_uses): Ditto. + (dump_dfa_stats): Ditto. Also added code to dump num_v_must_defs. + (collect_dfa_stats_r): Rename occurences of vdef to v_may_def. + Also add code to sum up the number of v_must_defs. + (vdefs_disappeared_p): Replace with... + (v_may_defs_disappeared_p): This. + (v_must_defs_disappeared_p): New function. + (mark_new_vars_to_rename): Rename occurences of vdef to v_may_def. + Also add code to mark new variables found in V_MUST_DEFs for + renameing. + * tree-flow.h (stmt_ann_d): Add v_must_def_ops and replace + vdef_ops to v_may_def_ops. + (get_vdef_ops): Replace with... + (get_v_may_def_ops): This. + * tree-flow-inline.h (get_vdef_ops): Replace with... + (get_v_may_def_ops): This. + (get_v_must_def_ops): New function. + (get_vdef_result_ptr): Replace with... + (get_v_may_def_result_ptr): This. + (get_vdef_op_ptr): Ditto with... + (get_v_may_def_op_ptr); This. + (get_v_must_def_op_ptr): New function. + * tree-into-ssa.c (mark_def_sites): Rename occurences of vdef + to v_may_def. Also add code to mark statements with + V_MUST_DEFs as definition sites. + (rewrite_stmt): Rename occurences of vdef to v_may_def. Also + add code to register new V_MUST_DEFs made by the statement. + * tree-outof-ssa.c (VIRTUAL_PARTITION): Update comments. + (check_replaceable): Rename occurences of vdef to v_may_def. Also + add check for V_MUST_DEFs. + (find_replaceable_in_bb): Ditto. + * tree-pretty-print.c (dump_vops): Rename occurences of vdef + to v_may_def. Also add code to dump V_MUST_DEFs. + * tree-sra.c (mark_all_vdefs): Replace with... + (mark_all_v_may_defs): This. + (mark_all_v_must_defs): New function. + (create_scalar_copies): Replace call to mark_all_vdefs with + calls to mark_all_v_may_defs and mark_all_v_must_defs. + (scalarize_structures): Rename occurences of vdef to v_may_def. + Also add a check for V_MUST_DEFs. + (scalarize_modify_expr): Rename occurences of vdef to v_may_def. + * tree-ssa-alias.c (global_var): Update comment. + (compute_may_aliases): Ditto. + (compute_points_to_and_addr_escape): Rename occurences of vdef + to v_may_def. Also add code to mark variables in V_MUST_DEF + operands as being written to. + (group_aliases): Update comment. + (maybe_create_global_var): Ditto. + * tree-ssa.c (verify_ssa): Rename occurences of vdef to v_may_def. + Also add a check for V_MUST_DEFs on GIMPLE registers. + (replace_immediate_uses): Rename occurences of vdef to v_may_def. + * tree-ssa-ccp.c (visit_stmt): Rename occurences of vdef + to v_may_def. Also add code to mark all V_MUST_DEF operands + VARYING. + (initialize): Ditto. + (set_rhs): Rename occurences of vdef to v_may_def. Also add + code to update SSA_NAMEs in V_MUST_DEFs. + * tree-ssa-copy.c (cprop_into_stmt): Rename occurences of vdef + to v_may_def. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Rename + occurences of vdef to v_may_def. Also add code to mark statements + with V_MUST_DEFs as necessary. + (propagate_necessity): Rename occurences of vdef to v_may_def. + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Rename + occurences of vdef to v_may_def. Also add code to mark operands + in V_MUST_DEFs for renaming. + (eliminate_redundant_computations): Rename occurences of vdef + to v_may_def. + (record_equivalences_from_stmt): Rename occurences of vdef + to v_may_def. Also add code to record VUSEs for V_MUST_DEFs. + (optimize_stmt): Remove unnesessary variable vdefs. Update + comment. + (register_definitions_for_stmt): Rename occurences of vdef + to v_may_def. Also add code to register definitions made with + V_MUST_DEFs. + * tree-ssa-dse.c (fix_stmt_vdefs): Replace with... + (fix_stmt_v_may_defs): This. + (fix_phi_uses): Rename occurences of vdef to v_may_def. + (dse_optimize_stmt): Ditto. + * tree-ssa-live.c (create_ssa_var_map): Rename occurences of vdef + to v_may_def. Also add code to mark V_MUST_DEF operands as being + used in virtual operators. + * tree-ssa-loop.c (mark_defs_for_rewrite): Rename occurences of + vdef to v_may_def. Also add code to mark V_MUST_DEF operands for + renaming. + * tree-ssa-operands.c (opf_kill_def): New flag for killing + definitions. + (build_vdefs): Renamed to... + (build_v_may_defs): This. + (build_v_must_defs): New variable. + (voperands_d): Add v_must_def_ops and replace vdef_ops with + v_may_def_ops. + (append_vdef): Replace with... + (append_v_may_def): This. + (append_v_must_def): New function. + (NUM_FREE): Increment for V_MUST_DEF + (optype_freelist): Increment its size for V_MUST_DEF + (allocate_vdef_optype): Replace with... + (allocate_v_may_def_optype): This. + (allocate_v_must_def_optype): New function. + (free_vdefs): Replace with... + (free_v_may_defs): This. + (free_v_must_defs): New function. + (remove_vdefs): Replace with... + (remove_v_may_defs): This. + (remove_v_must_defs): New function. + (init_ssa_operands): Rename occurences of vdef to v_may_def. Also + add code to initialize build_v_must_defs. + (finalize_ssa_vdefs): Replace with... + (finalize_ssa_v_may_defs): This. + (finalize_ssa_vuses): Rename occurences of vdef to v_may_def. + (finalize_ssa_v_must_defs): New function. + (finalize_ssa_stmt_operands): Replace call to finalize_ssa_vdefs + with calls to finalize_ssa_v_may_defs and finalize_ssa_v_must_defs. + (verify_start_operands): Rename occurences of vdef to v_may_def. + Also add check for build_v_must_defs. + (get_stmt_operands): Rename occurences of vdef to v_may_def. + Also add code to handle V_MUST_DEFs and to use opf_kill_def for + killing definitions. + (get_expr_operands): Update comment and use opf_kill_def for + killing definitions. + (add_stmt_operand): Replace code that appends VDEFs with code + that appends V_MUST_DEFs when opf_kill_def is set and V_MAY_DEFs + otherwise. + (add_call_clobber_ops): Update comments. + * tree-ssa-operands.h (vdef_optype_d): Replace with... + (v_may_def_optype_d): This. + (v_must_def_optype_d): New structure. + (VDEF_OPS): Replace with... + (V_MAY_DEF_OPS): This. + (STMT_VDEF_OPS): Same with... + (STMT_V_MAY_DEF_OPS): This. + (NUM_VDEFS): And... + (NUM_V_MAY_DEFS): This. + (VDEF_RESULT_PTR): As well as... + (V_MAY_DEF_RESULT_PTR): This. + (VDEF_RESULT): Same goes for... + (V_MAY_DEF_RESULT): This. + (VDEF_OP_PTR): And... + (V_MAY_DEF_OP_PTR): This. + (VDEF_OP): And... + (V_MAY_DEF_OP): This. + (V_MUST_DEF_OPS): New macro. + (STMT_V_MUST_DEF_OPS): Ditto. + (NUM_V_MUST_DEFS): Ditto. + (V_MUST_DEF_OP_PTR): Ditto. + (V_MUST_DEF_OP): Ditto. + (remove_vdefs): Replace signature with... + (remove_v_may_defs): This. + (remove_v_must_defs): New function signature. + * tree-ssa-pre.c (subst_phis): Replace call to remove_vdefs + with calls to remove_v_may_defs and remove_v_must_defs. + (process_left_occs_and_kills): Rename occurences of vdef to v_may_def. + Also add code that marks left occurences of operands in V_MUST_DEFs. + * tree-tailcall.c (find_tail_calls): Rename occurences of vdef + to v_may_def. Also add check for V_MUST_DEFs. + (eliminate_tail_call):Rename occurences of vdef to v_may_def. + +2004-06-10 Vladimir Makarov + + PR target/15653 + * haifa-sched.c (schedule_block): Finish cycle after issuing asm + insn. + +2004-06-10 Volker Reichelt + + PR web/15263 + * doc/install.texi: Remove superfluous linebreak. + +2004-06-10 Roger Sayle + + * builtins.c (expand_builtin): Fall back to library function call for + conj, conjf, conjl, creal, crealf, creall, cimag, cimagf and cimagl. + (fold_builtin_1): Lower built-ins BUILT_IN_CONJ{,F,L} to CONJ_EXPR, + BUILT_IN_CREAL{,F,L} to REALPART_EXPR, and BUILT_IN_CIMAG{,F,L} to + IMAGPART_EXPR respectively. + +2004-06-10 J"orn Rennecke + + * sh.c (dump_table): New argument start. Changed caller. + (fixup_mova): New function. + (find_barrier): Use it. + (sh_reorg): Likewise. Check for CODE_FOR_casesi_worker_2. + If the label a mova refers to is above the mova itself, change + the mova into a load. + * sh.md (*casesi_worker): Rename to: + (casesi_worker_1). + (casesi_worker_2): New insn. + +2004-06-10 Jason Merrill + + * target.h (struct gcc_target): Change gimplify_va_arg_expr + hook signature. + * tree-gimple.h: Adjust. + * config/alpha/alpha.c (alpha_gimplify_va_arg): Adjust. + * config/i386/i386.c (ix86_gimplify_va_arg): Adjust. + Use fold_convert. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Adjust. + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust. + Use COMPLEX_EXPR for complex numbers. Use fold_convert. + * builtins.c (std_gimplify_va_arg_expr): Adjust. Use fold_convert. + (gimplify_va_arg_expr): Return GS_ERROR in error case. + Gimplify valist rather than calling stabilize_va_list. + +2004-06-10 Zdenek Dvorak + + * Makefile.in (df.o): Remove fibheap dependency. + * df.h: Do not include sbitmap.h. + (struct ref): New field "data". + (DF_REF_DATA): New accessor macro. + (struct df): Field "dom" removed. + (df_analyze_subcfg): New function. + (transfer_function_sbitmap, transfer_function_bitmap): Replaced by ... + (transfer_function): ... new type. + (iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ... + (iterative_dataflow): ... new function. + (enum set_representation, struct dataflow): New. + * df.c: Do not include fibheap.h. + + (df_reg_def_chain_clean, df_reg_use_chain_clean, + (df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain, + prune_to_subcfg, df_bb_modify): New functions. + (df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create, + df_refs_update, df_reg_table_realloc, df_ref_create, + df_bb_reg_def_chain_create, df_bb_reg_use_chain_create, + df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute, + df_analyse_1, df_insn_modify): Support analysing only a part of the cfg. + + (dataflow_set_a_op_b, dataflow_set_copy): New functions. + (df_rd_transfer_function, df_ru_transfer_function, + df_lr_transfer_function): Type of bitmaps changed to void *. + (hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ... + (hybrid_search): ... new function. + (iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ... + (iterative_dataflow): ... new function. Avoid use of fibheaps for + a worklist. Do not process basic blocks unnecessarily. + +2004-06-10 Roger Sayle + + * fold-const.c (fold_abs_const): Make extern. + * tree.h (fold_abs_const): Prototype here. + * builtins.c (fold_builtin_fabs): New function to transform + fabs, fabsf and fabsl builtins into ABS_EXPR tree nodes. + (fold_builtin_abs): New function to transform abs, labs, llabs + and imaxabs builtins into ABS_EXPR tree nodes. + (expand_builtin): Fall back to a function call for abs, labs, + llabs and imaxabs builtins that survive constant folding. + (fold_builtin_1): Call fold_builtin_fabs for FABS, FABSF and + FABSL, and fold_builtin_abs for ABS, LABS, LLABS and IMAXABS. + +2004-06-10 Jakub Jelinek + + * config/ia64/unwind-ia64.c (uw_frame_state_for): Don't assume a + leaf function without unwind info at RP 0. + +2004-06-10 Jakub Jelinek + + PR c++/14791 + * tree.h (enum tree_index): Add TI_FILEPTR_TYPE. + (fileptr_type_node): Define. + * tree.c (build_common_tree_nodes_2): Initialize + fileptr_type_node to ptr_type_node. + * c-common.c (c_common_nodes_and_builtins): For C++, make + fileptr_type_node a distinct type copy. + * builtin-types.def (BT_FILEPTR, BT_FN_INT_CONST_STRING_FILEPTR, + BT_FN_INT_INT_FILEPTR, BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, + BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, + BT_FN_INT_FILEPTR_CONST_STRING_VAR): Add. + (BT_FN_INT_CONST_STRING_PTR, BT_FN_INT_INT_PTR, + BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, BT_FN_INT_PTR_CONST_STRING_VAR, + BT_FN_INT_PTR_CONST_STRING_VALIST_ARG): Remove. + * builtins.def (BUILT_IN_FPRINTF, BUILT_IN_FPRINTF_UNLOCKED, + BUILT_IN_FPUTC, BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS, + BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FSCANF, BUILT_IN_FWRITE, + BUILT_IN_FWRITE_UNLOCKED, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): Use + the above *FILEPTR* types instead of *PTR*. + +2004-06-09 Daniel Berlin + + * tree-ssa.c (verify_ssa): Verify that vdefs/makes_aliased_stores + match. + +2004-06-09 Roger Sayle + + * fold-const.c (fold_not_const): New function. + (fold) : Don't bother testing wins. + (fold) : Call fold_not_const. + (nondestructive_fold_unary_to_constant) : Likewise. + +2004-06-09 Richard Henderson + + PR middle-end/15228 + * function.c (assign_parms): Always set_mem_align with the computed + FUNCTION_ARG_BOUNDARY. Don't clear stack_parm if !STRICT_ALIGNMENT. + +2004-06-09 Richard Henderson + + PR opt/15108 + * tree-tailcall.c (find_tail_calls): Don't check early for + tail_recursion failure. + +2004-06-09 Diego Novillo + + Move SSA_NAME annotations into tree_ssa_name. + + * tree-dfa.c (create_ssa_name_ann): Remove. + * tree-flow-inline.h (ssa_name_ann, get_ssa_name_ann): Remove. + * tree-flow.h (enum tree_ann_type): Remove SSA_NAME_ANN. + (struct ssa_name_ann_d): Remove. + (union tree_ann_d): Update. + (ssa_name_ann_t): Remove. + * tree-ssa-alias.c: (get_ptr_info): New local function. + Replace references to ssa_name_ann_t with struct ptr_info_def. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree.h (SSA_NAME_PTR_INFO): Define. + (struct ptr_info_def): Declare. + (struct tree_ssa_name): Add field 'ptr_info'. + +2004-06-09 Danny Smith + + * config/i386/winnt.c (i386_pe_output_labelref): Correct + misplaced ')'. + +2004-06-09 Steven Bosscher + + * config/i386/k6.md: Rewrite using the DFA model. + * config/i386/i386.c (ix86_adjust_cost): Don't increase the + cost of load-operation insns for the K6. + (ia32_use_dfa_pipeline_interface): Add TARGET_K6. + (ia32_multipass_dfa_lookahead): Likewise. + +2004-06-09 Richard Henderson + + * config/alpha/alpha.c (alpha_gimplify_va_arg_1, + alpha_gimplify_va_arg, TARGET_GIMPLIFY_VA_ARG_EXPR): New. + +2004-06-09 Richard Henderson + + * expmed.c (emit_store_flag): Cope with FLOAT_STORE_FLAG_VALUE. + +2004-06-09 Geoffrey Keating + + * Makefile.in (CPPLIB_H): Put files in order of inclusion. + (CPP_ID_DATA_H): New. + (gtype-desc.o): Update dependencies. + (GTFILES): Use CPP_ID_DATA_H. + +2004-06-09 Mark Mitchell + + Revert: + PR c++/15815 + 2004-06-07 Mark Mitchell + * doc/extend.texi: Deprecate #pragma interface and #pragma + implementation. + +2004-06-09 David S. Miller + + * config/sparc/sparc.h (MOVE_RATIO): New definition. + +2004-06-09 Richard Henderson + + * basic-block.h (struct edge_def): Add goto_locus. + * tree-cfg.c (make_goto_expr_edges): Set it. + (disband_implicit_edges): Use it. + * tree-pretty-print.c (dump_implicit_edges): Print it. + +2004-06-08 Anil Paranjpe + + * h8300.md (ldm_h8300s_4): Fix condition for expander. + +2004-06-08 Jason Merrill + + Gimplify VA_ARG_EXPR into simpler forms. + * target.h: Add gimplify_va_arg_expr hook. + * target-def.h: Add TARGET_GIMPLIFY_VA_ARG_EXPR. + * fold-const.c (build_fold_addr_expr) + (build_fold_addr_expr_with_type): Move from gimplify.c. + * tree.h: Declare them. + * gimplify.c (gimplify_and_add): New fn. + (build_addr_expr, build_addr_expr_with_type): Move to fold-const.c. + (gimplify_array_ref_to_plus, gimplify_modify_expr) + (gimplify_expr): Use build_fold_*. + (copy_if_shared_r): Only mark VA_ARG_EXPR volatile if we + don't know how to gimplify it. + * builtins.c (std_gimplify_va_arg_expr): New fn. + (dummy_object): New static fn. + (gimplify_va_arg_expr): New fn. + (stabilize_va_list): Use build_fold_*. + * tree-gimple.h: Declare new fns. + * config/i386/i386.c (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + (ix86_gimplify_va_arg): New fn. + * config/ia64/ia64.c (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + (ia64_gimplify_va_arg): New fn. + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): New fn. + (TARGET_GIMPLIFY_VA_ARG_EXPR): Define. + * alias.c (get_varargs_alias_set): Just return 0 for now. + + * c-objc-common.c (c_tree_printer): Improve handling of %T. + +2004-06-09 Andrew Pinski + + * tree-complex.c (expand_complex_comparison): Use fold_convert instead + of convert. + * tree-inline.c (setup_one_parameter): Likewise. + * tree-sra.c (csc_build_component_ref): Likewise. + * tree-ssa-ccp.c (ccp_fold): Likewise. + * tree-ssa-copy.c (cprop_operand): Likewise. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + * tree-tailcall.c (tree_optimize_tail_calls_1): Likewise. + +2004-06-09 J"orn Rennecke + + PR rtl-optimization/15521: + * sched-int.h (in_post_call_group_p): Change type to enum. + * sched-deps.c (sched_analyze_insn): + (sched_analyze): When in_post_call_group_p is post_call_initial, + don't add a dependency, but still set SCHED_GROUP_P and CANT_MOVE, + and also reset in_post_call_group_p to post_call. + (sched_analyze): When the previous basic block ended in a CALL_INSN, + initialize in_post_call_group_p as post_call_initial. + (init_deps): initialize in_post_call_group_p to not_post_call. + +2004-06-09 Arnaud Charlet + + PR ada/6637 + * doc/install.texi: List ada, libada as options to --enable-shared + +2004-06-09 Paolo Bonzini + + * aclocal.m4 (gcc_AC_PROG_LN): Remove. + (gcc_AC_CHECK_DECLS): Use AH_TEMPLATE to generate + config.in entries. + * configure.ac: Call ACX_PROG_LN, falling back to $LN_S + if hard links are not available. + * configure: Regenerate. + * config.in: Regenerate. + +2004-06-08 Per Bothner + + * configure.ac: New --enable-mapped-location sets USE_MAPPED_LOCATION. + +2004-06-08 Richard Kenner + + * toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. + Correct formatting. + +2004-06-08 James E Wilson + + PR target/15790 + * config/i386/i386-coff.h (ASM_OUTPUT_ALIGN): Define. + +2004-06-08 Andrew Pinski + + * fold-const.c (fold_convert): Treat OFFSET_TYPE like + POINTER_TYPE and INTEGER_TYPE. + +2004-06-08 Bernardo Innocenti + + * modulo-sched.c: Compile only when INSN_SCHEDULING is + defined. + +2004-06-08 Jeff Law + + * doc/contrib.texi: Add entries for Stefan Olsson and + Ola Ronnerup. + +2004-06-08 DJ Delorie + + * toplev.c (floor_log2_wide): Replace loop with faster bit + operations. + (exact_log2_wide): Define in terms of the above. + * toplev.h (floor_log2): Use _builtin_clz family of builtins if + available. + +2004-06-08 Andrew Pinski + + * config/rs6000/rs6000.c (print_operand, ): + Make sure that we are in INDIRECT mode when getting the + stub name. + +2004-06-08 Anil Paranjpe + + * h8300.md (extendqisi2_h8300): Add constraints. + (ldm_h8300s_4_normal): Fix typo. + +2004-06-08 Richard Henderson + + * gimple-low.c (struct lower_data): Replace the_return_label and + one_return_stmt with return_statements. + (lower_function_body): Process the entire list of return_statements. + (lower_return_expr): Check source value before unifying return_exprs. + * gimplify.c (gimplify_return_expr): Force the use of a temporary + for !aggregate_value_p. + * tree-gimple.c: Update RETURN_EXPR grammer. + +2004-06-08 Vladimir Makarov + + PR target/15598 + * config/ia64/ia64.c (bundling): Add missed TYPE_A. + +2004-06-08 Zdenek Dvorak + + PR rtl-optimization/15717 + * config/i386/i386.c (legitimate_constant_p): Do not allow + x - symbol_ref. + +2004-06-08 Alexandre Oliva + + * gimplify.c (copy_if_shared_r): Revert: + 2004-05-21 Richard Henderson + * gimplify.c [...] Don't mark VA_ARG_EXPRs volatile here. + +2004-06-07 Roger Sayle + + * expmed.c (add_cost, neg_cost, sdiv_pow2_cheap, smod_pow2_cheap): + Make arrays indexed by machine mode. Rename negate_cost to neg_cost. + (init_expmed): Initialize these cost arrays as appropriate. + (store_bit_field, extract_bit_field): Correct whitespace. + (synth_mult, choose_mult_variant, expand_mult, expand_mult_highpart, + expand_mult_highpart_optab, expand_divmod): Update uses of add_cost, + neg_cost, sdiv_pow2_cheap, smod_pow2_cheap to index with mode, + word_mode or compute_mode as appropriate. + +2004-06-07 Eric Botcazou + + PR target/15783 + * config/sparc/sparc.c (function_arg_union_value): Add 'mode' + parameter. Enumerate the registers inside the PARALLEL. + (function_arg): Adjust call to function_arg_union_value. + (function_value): Likewise. + + * config/sparc/sparc.c (sparc_function_epilogue): Properly format. + +2004-06-07 Roger Sayle + + * real.c (real_copysign): New function to implement libm's copysign. + * real.h (real_copysign): Prototype here. + * fold-const.c (tree_expr_nonnegative_p): The result of sqrt, sqrtf + and sqrtl can be negative, as sqrt(-0.0) = -0.0. Correct whitespace. + * builtins.c (fold_builtin_isascii, fold_builtin_toascii, + fold_builtin_isdigit): Add function prototypes. + (fold_builtin_copysign): New function to fold copysign, copysignf + and copysignl. Optimize copysign(x,x) as x. Evaluate copysign of + constant arguments at compile-time using real_copysign. Fold + copysign(X,Y) as fabs(X) if Y is always non-negative. + (fold_builtin_1): Correct minor whitespace/style issues. Call + fold_builtin_copysign for BUILT_IN_COPYSIGN{,F,L}. + +2004-06-07 J"orn Rennecke + + * tree.c (iterative_hash_expr): Use real_hash. + +2004-06-07 Joseph S. Myers + + PR c/14765 + * c-parse.in (compstmt_primary_start): Set last_expr_type to + NULL_TREE. + +2004-06-07 Mark Mitchell + + PR c++/15815 + * doc/extend.texi: Deprecate #pragma interface and #pragma + implementation. + +2004-06-07 Alexandre Oliva + + PR middle-end/15666 + * c-decl.c (finish_decl): Use change_decl_assembler_name for the + builtin decl as well. + +2004-06-07 Roger Sayle + + PR c/14649 + * c-typeck.c (require_constant_value, require_constant_elements): + Move declarations to the top of the file. + (build_function_call): If we require a constant value, fold with + fold_initializer. If the result is a constant, and the function + wasn't called using __builtin_foo, issue a pedantic warning. + (build_unary_op): If we require a constant value, fold tree with + fold_initializer. + (build_binary_op): Use require_constant_value to determine whether + to call fold or fold_initializer. + +2004-06-07 Richard Henderson + + * gimple-low.c (struct lower_data): Add the_return_label and + one_return_stmt. + (lower_function_body): Initialize and use them. + (lower_return_expr): New. + (lower_stmt): Call it. + * gimplify.c (gimplify_return_expr): Force the argument to be either + null or a result_decl. + * tree-gimple.c: Update gimple grammer to match. + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Deny + coalescing of result_decls. + +2004-06-07 Richard Henderson + + PR rtl-opt/15193 + * expmed.c (extract_bit_field): Fix vector_extract return. + + * config/i386/i386.md (negv4sf2): New pattern. + +2004-06-07 Mark Mitchell + + PR c++/15337 + * c-common.c (c_sizeof_or_alignof_type): Use more detailed error + message. + +2004-06-06 Paolo Bonzini + + * config.in: Regenerate. + +2004-06-06 Steven Bosscher + + * tree-cfg.c (tree_verify_flow_info): Make sure that labels in + SWITCH_LABELS are always sorted. + +2004-06-06 Steven Bosscher + + * hooks.c (hook_int_void_1): New generic hook. + * hooks.h (hook_int_void_1): Add prototype. + * config/c4x/c4x.c (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): + Define to hook_int_void_1. + * config/c4x/c4x.md: Replace dummies for the old pipeline model + with dummies for the new one. + +2004-06-06 Roger Sayle + + * tree.h (lvalue_or_else): Delete function prototype. + * c-typeck.c (lvalue_or_else): Make static. Add static prototype. + +2004-06-06 Stephane Carrez + + PR target/14542 + * config/m68hc11/m68hc11.md (move peephole2): Emit a use note to avoid + a live change of a register after peephole replacement. + +2004-06-06 Joseph S. Myers + + PR c/13519 + * c-typeck.c (composite_type, common_pointer_type): New functions. + (common_type): Split parts into composite_type and + common_pointer_type. Ensure that arithmetic operations return + unqualified types without attributes. Don't make composite type + of signed enum and compatible integer be unsigned. + (build_conditional_expr, build_binary_op): Use + common_pointer_type. + * c-decl.c (merge_decls): Use composite_type. + * c-tree.h (composite_type): Declare. + +2004-06-06 Stephane Carrez + + PR target/14457 + * config/m68hc11/m68hc11.c (splitable_operand): New predicate. + * config/m68hc11/m68hc11-protos.h (splitable_operand): Declare. + * config/m68hc11/m68hc11.h (PREDICATE_CODES): Register it. + (inhibit_libc): Must define. + * config/m68hc11/m68hc11.md ("movhi_const0"): Use splitable_operand. + ("*andhi3_gen", "iorhi3", "*iorhi3_gen"): Likewise. + ("xorhi3"): Likewise. + +2004-06-06 Eric Botcazou + + * cgraphunit.c (cgraph_decide_inlining): Adjust dump lines in + always_inline pass. + +2004-06-05 David S. Miller + + * config/sparc/linux.h (TARGET_C99_FUNCTIONS): Set. + * config/sparc/linux64.h (TARGET_C99_FUNCTIONS): Likewise. + +2004-06-05 Bernardo Innocenti + + * regclass.c (init_reg_sets): Check for missing registers in target + initializer macros FIXED_REGISTERS and CALL_USED_REGISTERS. + +2004-06-05 Zack Weinberg + + * Makefile.in (MKDEPS_H): New shorthand. + (c-opts.o): Update dependencies. + * c-opts.c: Include mkdeps.h. + (handle_deferred_opts): Use cpp_get_deps and deps_add_target, + not cpp_add_dependency_target. + +2004-06-05 Steven Bosscher + + * config/v850/v850.c (v850_use_dfa_pipeline_interface): New. + * config/v850/v850.md: Convert to DFA scheduler description. + +2004-06-05 Tobias Schlueter + + PR fortran/15478 + * doc/install.texi: Document GMP as prerequisite. Document + --with-gmp and --with-gmp-dir configure options. + * fortran/gfortran.texi: Remove section "Compiling and testing", + remove TOC reference to it. + +2004-06-05 Graham Stott + + * combine.c(simplify_shift_const): Check shift amount is a + CONST_INT. + +2004-06-05 Danny Smith + + * toplev.c (init_asm_output): Add explicit 'b' to mode when + opening asm_out_file. + * c-pch.c (c_common_write_pch): Remove unnecessary fflush before + reading asm_out_file. Replace fflush after reading asm_out_file + with fseek. + * hosthooks-def.h (HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY): Define + default and add to HOST_HOOKS_INITIALIZER. + * hosthooks.h (gt_pch_alloc_granularity): Declare hook function. + * ggc-common.c (default_gt_pch_alloc_granularity): New function. + (gt_pch_save): Use host_hooks.gt_pch_alloc_granularity + to set mmi.offset padding. + * config.gcc (i[34567]86-*-mingw32*): Set target_gtfiles to + $(srcdir)/config/i386/winnt.c. + (i[34567]86-*-pe | i[34567]86-*-cygwin*): Likewise. + (i[34567]86-*-uwin*): Likewise. + *i[34567]86-*-interix3*): Likewise. + * config.host (i[34567]86-*-mingw32*): Set out_host_hook_obj. + * config/i386/host-mingw32.c: New file. + * config/i386/x-mingw32: Add rule for host-mingw32.o. + * config/i386/winnt.c: (struct extern_list) Tag as GTY. + (extern_head): Likewise. + (struct export_list) Likewise. + (export_head): Likewise. + (i386_pe_record_external_function): Use ggc_alloc. + (i386_pe_record_exported_symbol): Likewise. + Include "gt-winnt.h" at end. + * doc/hostconfig.texi: Document + HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY. + +2004-06-04 Bernardo Innocenti + + * config/m68k/m68k.h: Remove comments copied over from tm.texi. + Rename 68000 and 68k to m68k for consistency in comments. Remove + trailing whitespace before EOLs and before TABs. + (MAX_CODE_ALIGN): Remove unused macro. + (CALL_USED_REGISTERS): Reformat and add comments. + +2004-06-04 Frank Ch. Eigler + + * gcc.c (MFLIB_SPEC): Remove library references, to require users + to enumerate -lmudflap* and dependencies when linking. + +2004-06-04 Paolo Bonzini + + PR target/15822 + * dojump.c (do_jump): Fix uninitialized variable tcode1. + +2004-06-04 Jerry Quinn + + * Makefile.in (insn-conditions.o): Back out removal of reload.h. + * genconditions.c (write_header): Back out removal of reload.h. + +2004-06-04 Jan Hubicka + + Re-apply hopefully fixed patch: + * i386.md (UNSPECV_EH_RETURN): Kill. + (eh_return): Use jump_insn. + (eh_return_si, eh_return_di): Change pattern to jump instruction. + +2004-06-04 Jeff Law + + * cfgrtl.c (try_redirect_by_replacing_jump): Fix return value. + +2004-06-04 Steven Bosscher + + * except.c (for_each_eh_region): New function. + * except.h (for_each_eh_region): Add a prototype for it. + * tree-cfg.c (update_eh_labels): New function, callback for + for_each_eh_region. + (label_for_bb): Make global static, unfortunately. + (cleanup_dead_labels): Also update label references for + exception regions. + +2004-06-03 Chris Demetriou + + * config/mips/mips.c (struct irix_section_align_entry): Fix + GTY marker. + +2004-06-03 Geoffrey Keating + + * toplev.c (check_global_declarations): Don't ask for + DECL_ASSEMBLER_NAME unless the function really is declared + static and not defined. + +2004-06-03 Matt Austern + + PR c++/15428 + * default.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): New name + for TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, with reversed sense. + * config/darwin.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Likewise. + * doc/tm.texi (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Rewrite + documentation to reflect the new macro name and to clarify its + meaning. + +2004-06-03 Steven Bosscher + + * rtl.def (VAR_LOCATION): Make RTX_EXTRA. + +2004-06-03 Andrew Pinski + + * config/darwin.c (machopic_indirect_data_reference): Copy + the SYMBOL_REF_DECL from the original RTX for the new + non-lazy pointer RTX. + +2004-06-03 Mark G. Adams + + * tree.h: Remove include of version.h + * c-cppbuiltin.c: Include version.h + * diagnostic.c: Include version.h + * dwarf2out.c: Include version.h + * toplev.c: Include version.h + * vmsdbgout.c: Include version.h + * Makefile.in: Remove dependency on version.h from TREE_H, and + add dependencies to required .o targets + +2004-06-03 Jerry Quinn + + * Makefile.in (RA_H, RESOURCE_H, SCHED_INT_H, CFGLAYOUT_H, + CFGLOOP_H, DF_H, DDG_H, TREE_SSA_LIVE_H): New. + (TARGET_H): Add insn-modes.h. + (tree-ssa.o, tree-cfg.o, tree-ssa-loop.o, toplev.o, passes.o, + loop.o, loop-doloop.o, unroll.o, cfgloop.o, cfgloopanal.o, + loop-iv.o, cfgloopmanip.o, loop-init.o, loop-unswitch.o, + loop-unroll.o, ddg.o, modulo-sched.o, predict.o, + cfglayout.o, ifcvt.o): Replace cfgloop.h with CFGLOOP_H. + (toplev.o, passes.o, cfghooks.o, cfgloopmanip.o, loop-init.o, + loop-unswitch.o, loop-unroll.o, ddg.o, modulo-sched.o, + bb-reorder.o, tracer.o, cfglayout.o): Replace cfglayout.h with + CFGLAYOUT_H. + (ra.o, ra-build.o, ra-colorize.o, ra-debug.o, ra-rewrite.o): + Replace ra.h with RA_H. + (resource.o, regrename.o, insn-conditions.o, insn-emit.o, + insn-recog.o): Replace resource.h with RESOURCE_H. + (ddg.o, modulo-sched.o, haifa-sched.o, sched-deps.o, sched-rgn.o, + sched-ebb.o, sched-vis.o, out_object_file): Replace sched-int.h + with SCHED_INT_H. + (web.o, lcm.o, df.o, ra.o, ra-build.o, ra-colorize.o, ra-debug.o, + ra-rewrite.o): Replace df.h with DF_H. + (ddg.o, modulo-sched.o): Replace ddf.h with DDG_H. + (tree-outof-ssa.o, tree-ssa-live.o, tree-ssa-copyrename.o): + Replace tree-ssa-live.h with TREE_SSA_LIVE_H. + (insn-conditions.o): Remove unused reload.h. + * cfglayout.h: Add include guard. Include basic-block.h. + * cfgloop.h: Add include guard. Include basic-block.h, rtl.h. + * ddg.h: Include sbitmap.h, basic-block.h, df.h. + * df.h: Add include guard. Include bitmap.h, sbitmap.h, + basic-block.h. + * genconditions.c: Remove reload.h. + * ra.h: Add include guard. Include bitmap.h, sbitmap.h, + hard-reg-set.h, insn-modes.h. + * resource.h: Add include guard. Include hard-reg-set.h. + * sched-int.h: Add include guard. Include insn-attr.h, + basic-block.h, rtl.h. + * target.h: Add include guard. Include insn-modes.h. + * tree-ssa-live.h: Include partition.h. + +2004-06-03 Daniel Berlin + Kenneth Zadeck + + * tree-ssa-ccp.c (varying_ssa_edges): New worklist. + (add_var_to_ssa_edges_worklist): Add value argument. + Update callers. + Use new worklist. + (process_ssa_edge_worklist): New function. + (tree_ssa_ccp): Move worklist processing core to + process_ssa_edge_worklist, and just call that for the two worklists. + +2004-06-03 Steven Bosscher + + * basic-block.c (tail_recursion_label_list): Don't declare. + (CLEANUP_PRE_SIBCALL): Remove. Renumber the other CLEANUP_* + accordingly. + * cfgbuild.c (find_label_refs): Remove. + (find_basic_blocks_1): Don't handle CALL_PLACEHOLDER insns. + * cfgcleanup.c (tail_recursion_label_p): Remove. + (merge_blocks_move): Do not check for tail recursion. + (try_optimize_cfg): Likewise. + (cleanup_cfg): Never handle CLEANUP_PRE_SIBCALL. + * cfgrtl.c (tail_recursion_label_list): Remove. + * except.c (remove_unreachable_regions): Don't handle + CALL_PLACEHOLDER insns. + (convert_from_eh_region_ranges_1, can_throw_internal, + can_throw_external): Likewise. + * function.c (free_after_compilation): Don't clear + x_tail_recursion_label. + (fixup_var_refs_insns): Don't handle CALL_PLACEHOLDER insns. + (identify_blocks_1): Don't recurse for CALL_PLACEHOLDER insns. + (reorder_blocks_1): Likewise. + * function.h (struct function): Remove x_tail_recursion_label + member. Don't define tail_recursion_label. + * jump.c (mark_all_labels): Don't handle CALL_PLACEHOLDER insns. + * print-rtl.c (print_rtx): Likewise. + * rtl.def (CALL_PLACEHOLDER): Remove. + * rtl.h (sibcall_use_t): Remove enum. + (optimize_sibling_and_tail_recursive_calls, + replace_call_placeholder): Remove function prototypes. + * stmt.c (tail_recursion_args): Remove. + (optimize_tail_recursion): Remove. + (expand_return): Don't check for possible tail recursion. + * tree.h (optimize_tail_recursion): Remove prototype. + +2004-06-02 Jan Hubicka + + * tree-cfg.c (tree_find_edge_insert_loc): Allow inserting before + return_stmt. + +2004-06-02 Jason Merrill + + * Makefile.in (TAGS): Don't mess with c-parse.[ch]. + Do include c-parse.in. + +2004-06-02 Eric Christopher + + * c-typeck.c (common_type): Don't lose type qualifiers + when creating new variants. + +2004-06-02 Andrew Pinski + + PR tree-optimization/14042 + PR tree-optimization/14729 + PR tree-optimization/14736 + * tree-ssa.c (tree_ssa_useless_type_conversion_1): + Check the type which the pointer points to + instead of the pointer types. + +2004-06-02 Kazu Hirata + + PR tree-optimization/15738. + * builtins.c (fold_builtin_strchr): Transform + strrchr (s, '\0') to strchr (s, '\0'). + +2004-06-02 Steven Bosscher + + * i386.c (ix86_adjust_cost): Don't increase the cost for + load+operation for PROCESSOR_PENTIUMPRO, it is already + modelled in the DFA description + +2004-06-01 Jerry Quinn + + * Makefile.in (EXPR_H): Add insn-config.h, function.h, + $(RTL_H), flags.h, $(TREE_H), $(MACHMODE_H), $(EXPR_H). + (ALIAS_H, EMIT_RTL_H): New. + (cselib.o): Replace EXPR_H with EMIT_RTL_H. + (cfgcleanup.o): Add EMIT_RTL_H. + (alias.o): Replace EXPR_H with EMIT_RTL_H and ALIAS_H. + * alias.c: Replace expr.h with emit-rtl.h and alias.h. + * attribs.c, c-lex.c, c-obj-common.c, c-semantics.c: Remove expr.h. + * cfgcleanup.c, cselib.c: Replace expr.h with emit-rtl.h. + * expr.h: Add include guard. Include function.h, rtl.h, flags.h, + tree.h, machmode.h, insn-config.h, alias.h, emit-rtl.h. + (get_varargs_alias_set, get_frame_alias_set, record_base_value, + record_alias_subset, new_alias_set, can_address_p): Move to alias.h. + (set_mem_alias_set, set_mem_align, set_mem_expr, set_mem_offset, + set_mem_size): Move to emit-rtl.h. + * emit-rtl.h: New. + * alias.h: New. + +2004-06-01 Eric Botcazou + + * function.c (walk_fixup_memory_subreg): New parameter 'var'. + Call fixup_memory_subreg only if the MEM is equal to 'var'. + Adjust recursive calls to self. + (fixup_var_refs_insn): Pass 'var' to walk_fixup_memory_subreg. + +2004-06-01 Richard Henderson + Andrew Pinski + + * c-parse.in (OFFSETOF, offsetof_member_designator): New. + (primary): Handle offsetof. Add error productions for faux functions. + Move component_ref objc checking to build_component_ref. + (reswords): Add offsetof. + (rid_to_yy): Add offsetof. + * c-tree.h (build_offsetof): Declare. + * c-common.h (objc_is_public): Declare. + * c-typeck.c (build_component_ref): Check objc_is_public. + (build_offsetof): New. + * stub-objc.c (objc_is_public): New. + * objc/objc-act.c, objc/objc-act.h (objc_is_public): Rename + from is_public. + * ginclude/stddef.h (offsetof): Use __builtin_offsetof. + * doc/extend.texi (Offsetof): Move from C++ section to C section + and rewrite for __builtin_offsetof. + +2004-06-01 Peter Barada + Peter Jakubek + + * config/m68k/m68k.c(m68k_output_mi_thunk): For ColdFire, use %d0 as + a scratch to perform an add to memory. + +2004-06-01 Bernardo Innocenti + + PR target/14018 + * config/m68k/m68k.c (m68k_align_loops_string, m68k_align_jumps_string, + m68k_align_funcs_string, m68k_align_loops, m68k_align_jumps, + m68k_align_funcs): Remove. + (override_options): Remove code to handle -malign-* options. + * config/m68k/m68k.h (TARGET_OPTIONS): Remove -malign-* options. + (FUNCTION_BOUNDARY, LOOP_ALIGN, LOOP_ALIGN_AFTER_BARRIER): Remove. + (m68k_align_loops_string, m68k_align_jumps_string, + m68k_align_funcs_string, m68k_align_loops, m68k_align_jumps, + m68k_align_funcs): Remove definitions. + +2004-06-01 Paul Eggert + + PR target/15626 + * doc/install.texi (sparc-sun-solaris2*): Document messages issued + by the Sun linker in conjunction with the Sun assembler. + (sparc-sun-solaris2.7): Update revision info for Sun patch 106950. + +2004-06-01 Jeff Law + + * stmt.c (expand_decl): Be more selective about calling + mark_reg_pointer. + +2004-06-01 Nicola Pero + + PR objc/7993 + * objc-act.c (is_private): Do not emit the 'instance variable %s + is declared private' error. + (is_public): Emit the error after calling is_private. + (lookup_objc_ivar): If the instance variable is private, return 0 + - the instance variable is invisible here. + +2004-06-01 Eric Botcazou + + * doc/invoke.texi (-static-libgcc): Explicitly mention + non-GNU linkers. + +2004-06-01 Bernardo Innocenti + + PR target/12968 + * doc/invoke.texi: Document stack alignment side-effect of -mshort. + +2004-05-31 Joseph S. Myers + + PR c/15749 + * c-decl.c (grokdeclarator, finish_struct): Don't pedwarn for + misuses of structures with flexible array members if + in_system_header. + +2004-05-31 Eric Botcazou + + PR target/15693 + * config/sparc/sparc.c (compare_operand): New predicate. + * config/sparc/sparc.h (PREDICATE_CODES): Add it. + * config/sparc/sparc.md (cmpsi expander): Use it. If the first + operand is a ZERO_EXTRACT and the second operand is not zero, + force the former to a register. + (cmpdi expander): Likewise. + +2004-05-31 Geoffrey Keating + + * gengtype-lex.l: Catch stray GTY markers in the files gengtype + looks at. + * alias.c (alias_invariant_size): Make alias_invariant_size + static, fix GTY marker. + +2004-05-31 Kazu Hirata + + PR tree-optimization/15743. + * builtins.c (fold_builtin_1): Fold index() and rindex(). + +2004-05-31 Roger Sayle + + PR middle-end/15069 + * fold-const.c (fold_single_bit_test): Only perform "(X & C) != 0" + into "X < 0" (where C is the signbit) if X's type is a full mode. + +2004-05-31 John David Anglin + + * pa.md: Disable the peephole2 patterns that generate indexed + floating-point stores when indexing is disabled. + +2004-05-31 Gabriel Dos Reis + + * c-pretty-print.c (pp_c_left_bracket): Make a function. + (pp_c_right_bracket): Likewise. + (pp_c_star): Likewise. + (pp_c_ampersand): Define. + * c-pretty-print.h (pp_c_left_bracket): Declare. + (pp_c_right_bracket): Likewise. + (pp_c_star): Likewise. + (pp_c_ampersand): Likewise. + +2004-05-31 Eric Botcazou + + * config/sol2.h (__enable_execute_stack): ANSIfy function + definition. + +2004-05-31 Danny Smith + + * c-incpath.c (add_path): Canonicalize paths to use '/' if + HAVE_DOS_BASED_FILESYSTEM. + +2004-05-31 Steven Bosscher + + * tree-ssa-dom.c (record_equivalences_from_incoming_edge): + Only look at case labels if the immediate dominator is also + the only predecessor. Don't look for more case labels if the + first seen is a case range. + +2004-05-31 Kazu Hirata + + * builtins.c: Add a prototype for fold_builtin_strchr(). + +2004-05-31 Paolo Bonzini + + Revert this patch: + 2004-05-27 Paolo Bonzini + + * combine.c (gen_binary): Remove. + (known_cond, simplify_shift_const + find_split_point, combine_simplify_rtx, + simplify_if_then_else, simplify_set, + simplify_logical, expand_field_assignment, + extract_left_shift, force_to_mode, + if_then_else_cond, apply_distributive_law, + simplify_and_const_int, simplify_shift_const, + gen_lowpart_for_combine, simplify_comparison, + reversed_comparison): Replace with + simplify_gen_binary, simplify_gen_relational or + distribute_and_simplify_rtx. + (distribute_and_simplify_rtx): New function. + +2004-05-30 John David Anglin + + * pa.c (emit_move_sequence): Fix loading of non 14-bit CONST operands + when generating PIC code. + +2004-05-30 Andrew Pinski + + * c-decl.c (c_expand_body_1): Remove and fold back into ... + (c_expand_body): here. + (c_expand_decl): Move to ... + * c-common.c (c_expand_decl): Here and remove check for nested + functions. + * c-common.h (c_expand_decl): Add prototype. + * c-tree.h (c_expand_decl): Remove. + +2004-05-30 Roger Sayle + + * fold-const.c (combine_comparisons, optimize_bit_field_compare, + range_binop, fold_truthop, fold_binary_op_with_conditional_arg, + fold_mathfn_compare, fold_inf_compare, fold, + fold_relational_hi_lo, nondestructive_fold_binary_to_constant): + Use constant_boolean_node where appropriate. Don't bother using + fold_convert on the second argument to omit_one_operand. + +2004-05-30 Roger Sayle + + * doc/c-tree.texi (Expressions): Document FLOOR_DIV_EXPR, + CEIL_DIV_EXPR, ROUND_DIV_EXPR, FLOOR_MOD_EXPR, CEIL_MOD_EXPR, + ROUND_MOD_EXPR, EXACT_DIV_EXPR. Improve documentation of + TRUNC_DIV_EXPR, TRUNC_MOD_EXPR and comparison operations. + Add missing (but documented) tree nodes to the index. + +2004-05-30 Steven Bosscher + + PR tree-optimization/14819 + * builtins.c (fold_builtin_strchr): New. + (fold_builtin_1): Handle BUILT_IN_STRCHR and BUILT_IN_STRRCHR + with fold_builtin_strchr(). + +2004-05-30 Kazu Hirata + + * bb-reorder.c, builtins.c, c-common.c, c-gimplify.c, + c-incpath.c, cgraphunit.c, ddg.c, defaults.h, dwarf2out.c, + expmed.c, flags.h, gcc.c, gensupport.c, gimplify.c, global.c, + passes.c, reg-stack.c, target.h, toplev.c, tree-alias-ander.c, + tree-alias-common.c, tree-cfg.c, tree-complex.c, tree-dfa.c, + tree-eh.c, tree-mudflap.c, tree-mudflap.h, tree-outof-ssa.c, + tree-phinodes.c, tree-pretty-print.c, tree-ssa-alias.c, + tree-ssa-ccp.c, tree-ssa-live.c, tree-ssa-live.h, + tree-ssa-pre.c, tree.h, value-prof.h, varasm.c: Fix comment + formatting. + +2004-05-30 Steven Bosscher + + * gimplify.c (sort_case_labels): New. Split out from... + (gimplify_switch_expr): ...here. Use it. + * tree-eh.c (lower_try_finally_switch): Sort the labels of + the SWITCH_EXPR created here before leaving the function. + * tree.c (sort_case_labels): Add prototype. + +2004-05-30 Andrew Pinski + + * fold-const.c (fold) [case TRUTH_NOT_EXPR]: Make sure the type is + of BOOLEAN_TYPE. + +2004-05-30 Kazu Hirata + + * c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c, + ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h, + fold-const.c, gcc.c, gimplify.c, haifa-sched.c, + modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c, + tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c, + tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix + comment typos. Follow spelling conventions. + +2004-05-29 Geoffrey Keating + + * gengtype-yacc.y: Add NESTED_PTR token. + (option): Record `nested_ptr' option. + * gengtype-lex.l: Handle `nested_ptr' keyword. + * gengtype.c (walk_type): Process `nested_ptr' option. + * gengtype.h (struct nested_ptr_data): New. + * doc/gty.texi (GTY Options): Document `nested_ptr' option. + * stringpool.c (struct string_pool_data): Make 'entries' point to + ht_identifier instead of tree. + (gt_pch_save_stringpool): Don't adjust pointers. + (gt_pch_restore_stringpool): Call ht_load. + +2004-05-29 Jason Merrill + + * gimplify.c (gimplify_expr): Don't build a statement list + if no gimplification was necessary. + +2004-05-29 Joseph S. Myers + + * pretty-print.c (pp_base_format_text): Support %< instead of %` + and %> as well as %'. + * c-format.c: Use %< and %>. + (gcc_diag_char_table, gcc_cdiag_char_table, + gcc_cxxdiag_char_table): Update. + +2004-05-29 Joseph S. Myers + + * c-typeck.c (common_type): Correct comment. + +2004-05-29 Peter Barada + + * config/m68k/m68k.c (CONST_METHOD): Add MVZ, MVS. + * config/m68k/m68k.c (const_method): Likewise. + * config/m68k/m68k.c (const_int_cost): Likewise. + * config/m68k/m68k.c (const_int_cost): Likewise. + * config/m68k/m68k.c (output_move_const_into_data_reg): Likewise. + +2004-05-29 Peter Barada + + * config/m68k/m68k.h (EXTRA_CONSTRAINT): add 'U' for register offset + addressing. + * config/m68k/m68k.md: Add 'U,U' alternative to ColdFire variants of + movsi,movhi,movqi insn patterns. + +2004-05-28 Andrew Pinski + + * c-semantics.c (emit_local_var): Remove code for DECL_INITIAL. + + PR target/15720 + * config/darwin.c (machopic_indirect_call_target): Copy + the SYMBOL_REF_DECL from the original RTX for the new + stub RTX. + +2004-05-28 DJ Delorie + + * stor-layout.c (place_field): Revert erroneous commit. + +2004-05-28 Ziemowit Laski + + * config/rs6000/altivec.h (vec_ctf, vec_vcfsx, vec_vcfux, vec_cts, + vec_ctu, vec_dss, vec_dst, vec_dstst, vec_dststt, vec_dstt, vec_ld, + vec_ldl, vec_lvsl, vec_lvsr, vec_sld, vec_splat, vec_vspltw, + vec_vsplth, vec_vspltb, vec_splat_s8, vec_splat_s16, vec_splat_s32, + vec_splat_u8, vec_splat_u16, vec_splat_u32, vec_st, vec_stl, + vec_ste): Remove type checks for integral parameters and literals + from '..._args_eq' macros. + +2004-05-28 Aldy Hernandez + + * c-common.c (fname_as_string): Fix xcalloc to xmalloc. + +2004-05-28 Aldy Hernandez + + * testsuite/g++.dg/charset/function.cc: New. + + * testsuite/gcc.dg/charset/function.c: New. + + * c-decl.c (c_make_fname_decl): Free return value from + fname_as_string. + + * cp/decl.c (cp_make_fname_decl): Free return value from + fname_as_string. + + * c-common.c (fname_as_string): Translate if necessary. + +2004-05-28 Geoffrey Keating + + * stringpool.c: Add comments to PCH saving/restoring routines. + +2004-05-28 Andrew Pinski + + * c-common.c (c_estimate_num_insns_1): Kill. + (c_estimate_num_insns): Kill. + * c-common.h (c_estimate_num_insns): Kill. + + * gthr-posix.h: Check for _POSIX_PRIORITY_SCHEDULING + when checking for _POSIX_THREAD_PRIORITY_SCHEDULING. + Remove comment about not checking for + _POSIX_PRIORITY_SCHEDULING. + * gthr-posix.c: Likewise. + +2004-05-28 Paolo Bonzini + Roger Sayle + + PR rtl-optimization/15649 + Add LTGT_EXPR and improve pretty-printing of unordered + comparisons. + * c-common.c (c_common_truthvalue_conversion): + Handle LTGT_EXPR. + * c-typeck.c (build_binary_op): Likewise. + * dojump.c (do_jump): Likewise. + * expr.c (expand_expr_real_1, do_store_flag): Likewise. + * predict.c (tree_predict_by_opcode): Likewise. + * real.c (real_compare): Likewise. + * tree-cfg.c (verify_expr): Likewise. + * tree-inline.c (estimate_num_insns_1): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + Handle ORDERED_EXPR, UNORDERED_EXPR. + (op_symbol): Print unordered comparisons differently + than ordered ones. + * tree.def (LTGT_EXPR): New '<' tree code. + * doc/c-tree.texi (Expressions): Document floating-point + comparison nodes. + + Fold comparisons between floating point values. + * fold-const.c (enum comparison_code): New, from + #define'd constants. Define compcodes for unordered + comparisons and for invalid transformations. + (invert_tree_comparison): Add "honor_nans" parameter. + (fold_truthop): Revamp to work on floating-point types too. + (comparison_to_compcode): Support unordered comparisons. + Use new enum comparison_code. + (compcode_to_comparison): Likewise. + (combine_compcodes): New function. + (invert_truthvalue): Let invert_tree_comparison decide + whether it is valid to fold the comparison. Fold ORDERED + and UNORDERED even if flag_unsafe_math_optimizations is off, + and the remaining even if flag_unsafe_math_optimizations + is off but we are under -fno-trapping-math. + (fold_relational_const): Integer modes do not honor NaNs. + +2004-05-28 Paul Brook + + * config/arm/arm.c (arm_output_epilogue): Remove redundant code. + +2004-05-28 Paul Brook + + * config/arm/arm.c (thumb_force_lr_save): New function. + (arm_get_frame_offsets, thumb_unexpanded_epilogue, + thumb_output_function_prologue): Use it. + (thumb_expand_prologue): Set lr_save_eliminated. + +2004-05-28 Richard Sandiford + + * config/mips/mips.md (extendsidi2): Tie the source and destination + of the register alternative. Split it into nothing. + +2004-05-28 Richard Sandiford + + * rtl.h (skip_consecutive_labels): Declare. + * emit-rtl.c (skip_consecutive_labels): New function. + * reorg.c (relax_delay_slots, dbr_schedule): Use it. + * jump.c (follow_jumps): Say what null return values mean. + +2004-05-28 Kaz Kojima + + PR target/13250 + * config/sh/sh.md (rotlsi3): Use emit_move_insn. + +2004-05-27 Kaz Kojima + + * config/sh/t-linux (SHLIB_MAPFILES): Use sh specific + libgcc-std.ver. + * config/sh/libgcc-std.ver: New file. + +2004-05-27 Bryce McKinlay + + * except.c: Revert change of 2004-05-26. + * config/i386/i386.md: Revert change of 2004-05-27. + +2004-05-27 Bryce McKinlay + + * configure.ac: Remove --enable-tree-browser option. + Define TREEBROWSER when ac_tree_checking is defined. + * configure: Rebuilt. + +2004-05-27 Olivier Hainque + + * expr.c (store_constructor): Restore sanity check on + the size of the type before clearing. + +2004-05-27 Jan Hubicka + + * cfgbuild.c (control_flow_insn_p): Notice noreturn call + +2004-05-27 Paolo Bonzini + + * combine.c (gen_binary): Remove. + (known_cond, simplify_shift_const + find_split_point, combine_simplify_rtx, + simplify_if_then_else, simplify_set, + simplify_logical, expand_field_assignment, + extract_left_shift, force_to_mode, + if_then_else_cond, apply_distributive_law, + simplify_and_const_int, simplify_shift_const, + gen_lowpart_for_combine, simplify_comparison, + reversed_comparison): Replace with + simplify_gen_binary, simplify_gen_relational or + distribute_and_simplify_rtx. + (distribute_and_simplify_rtx): New function. + * simplify-rtx.c (simplify_binary_operation): + Use nonzero_bits to simplify ANDs where we are + turning off bits already known to be off in OP0. + +2004-05-27 Alan Modra + + PR target/14478 + * config/rs6000/rs6000.c (reg_or_neg_short_operand): Don't allow zero. + +2004-05-27 Josef Zlomek + + PR middle-end/14084 + * emit-rtl.c (gen_rtx_REG_offset): Adjust the offset according + to size of decl. + +2004-05-26 Aldy Hernandez + + PR/14924 + * config/rs6000/rs6000.c (spe_expand_stv_builtin): New. + +2004-05-26 Roger Sayle + + * tree.h: Fix comment typo. + +2004-05-27 Steven Bosscher + + * gimplify.c (compare_case_labels): New function. + (gimplify_switch_expr): Sort case labels, and make sure the + last label in the label vector is the default case. + * tree-cfg.c (group_case_labels): New function. + (build_tree_cfg): Cleanup redundant labels and group case labels + before creating edges. + (cleanup_dead_labels): Handle GOTO_EXPRs. + (find_case_label_for_value): Use a binary search to find the + case label for the given value. + * tree-gimple.c: Mention that labels are sorted, and that the + last label must be the default. + +2004-05-27 Jan Hubicka + + * cfgcleanup.c (try_optimize_cfg): Do not merge across jumptables. + +2004-05-27 Jan Hubicka + + * i386.md (UNSPECV_EH_RETURN): Kill. + (eh_return): Use jump_insn. + (eh_return_si, eh_return_di): Change pattern to jump instruction. + +2004-05-26 Jan Hubicka + + * cfgcleanup.c (try_forward_edges): Do not check loop structure when + not loop optimizing. + +2004-05-26 Jan Hubicka + + * except.c (can_throw_internal): Notice RESX instructions. + +2004-05-26 Eric Botcazou + + * varasm.c (output_constant) : Pass the minimum + of the two sizes to assemble_integer. + +2004-05-25 Paul Brook + + * config/arm/arm.c (thumb_exit, thumb_unexpanded_epilogue): Remove + pointless #ifdef. + +2004-04-25 Paolo Bonzini + + * Makefile.in (top_builddir): Define to . + +2004-05-25 Alexandre Oliva + + * configure.ac (gcc_cv_ld): Prefer in-tree ld over whatever the + top-level detects, except when in-tree ld is being cross-built. + (gcc_cv_as): Likewise for as. Use AS_FOR_TARGET otherwise, and + then AS only if target is host. + * configure: Rebuilt. + +2004-05-25 Vladimir Makarov + + * global.c (global_alloc): Call make_accurate_live_analysis. + (record_one_conflict): Remove dead code. + (mark_reg_clobber): Remove ATTRIBUTE_UNUSED for parameter data. + (bb_info): New structure. + (BB_INFO, BB_INFO_BY_INDEX): New macros. + (allocate_bb_info, free_bb_info, mark_reg_change, + calculate_local_reg_bb_info, set_up_bb_rts_numbers, rpost_cmp, + modify_bb_reg_pav, calculate_reg_pav, + make_accurate_live_analysis): New functions. + +2004-05-25 Devang Patel + + * alias.c (init_alias_analysis): Use ggc_calloc instead of + xrealloc. + (end_alias_analysis): Use ggc_free instead fo free. + +2004-05-25 Andrew Pinski + + PR target/15546 + * config/ia64/ia64.h (ASM_OUTPUT_FDESC): Mark the DECL + as needed to be outputted. + +2004-05-25 Jan Hubicka + + * builtins.def (__builtin_expect): Mark the function as const¬hrow. + +2004-05-25 Ayal Zaks + Mostafa Hagog + + * Makefile.in (modulo-sched.o, ddg.o): New. + * ddg.h, ddg.c, modulo-sched.c: New files. + * cfglayout.c (duplicate_insn_chain): Remove "static" and push + internals to "dupicate_insn". + (duplicate_insn): New function. + * cfglayout.h (duplicate_insn_chain, duplicate_insn): New + declarations. + * common.opt (fmodulo-sched): New flag. + * df.c (df_bb_regno_last_use_find, df_bb_regno_first_def_find): + Remove static and forward declaration. + (df_find_def, df_reg_used, df_bb_regno_last_def_find): New + functions. + * df.h (df_bb_regno_last_use_find, df_bb_regno_first_def_find, + df_bb_regno_last_def_find, df_find_def, df_reg_used): New + declarations. + * flags.h (flag_modulo_sched): New flag. + * opts.c (common_handle_option): Handle modulo-sched flag. + * params.def (max-sms-loop-number, sms-max-ii-factor, + sms-dfa-history, sms-loop-average-count-threshold): New + parameters. + * params.h (MAX_SMS_LOOP_NUMBER, SMS_MAX_II_FACTOR, + SMS_DFA_HISTORY, SMS_LOOP_AVERAGE_COUNT_THRESHOLD): New + parameters. + * passes.c ("sms", "sms-vcg"): New dumps. + (rest_of_handle_sched): Call sms_schedule. + * rtl.h (sms_schedule): New declaration. + * timevar.def (TV_SMS): New. + * toplev.c (flag_modulo_sched): Initialize. + (f_options): Handle -fmodulo-sched option. + * docs/invoke.texi: Document -fmodulo-sched & -dm options. + * docs/passes.texi: Document new SMS pass. + +2004-05-25 Paolo Bonzini + + * Makefile.in (OBJS): Add rtlhooks.o. + (rtlanal.o): Depend on function.h. + (cse.o): Depend on rtlhooks-def.h. + (combine.o): Depend on rtlhooks-def.h. + (rtlhooks.o): New rule. + * combine.c: Include rtlhooks-def.h. + (nonzero_bits, cached_nonzero_bits, nonzero_bits1, + num_sign_bit_copies, cached_num_sign_bit_copies, + num_sign_bit_copies1): Move most of the code to rtlanal.c. + (reg_nonzero_bits_for_combine, + reg_num_sign_bit_copies_for_combine): New functions holding + the remnants of the above. + (combine_rtl_hooks): New. + (combine_instructions): Set rtl_hooks instead of gen_lowpart. + * cse.c: Include rtlhooks-def.h. + (cse_rtl_hooks): New. + (cse_main): Set rtl_hooks instead of gen_lowpart. + * emit-rtl.c (gen_lowpart): Remove. + (gen_lowpart_general): Move to rtlhooks.c. + * rtl.h (nonzero_bits, num_sign_bit_copies, + struct rtl_hooks, rtl_hooks, general_rtl_hooks): New. + (gen_lowpart_general): Remove. + (gen_lowpart): Temporarily redefine as a macro. + * rtlanal.c: Include function.h. + (nonzero_bits, cached_nonzero_bits, nonzero_bits1, + num_sign_bit_copies, cached_num_sign_bit_copies, + num_sign_bit_copies1): New, from combine.c. + * rtlhooks.c: New file. + * rtlhooks-def.h: New file. + +2004-05-25 Svein E. Seldal + + * config/avr/avr.h (LONG_LONG_TYPE_SIZE): Changed long long type + to support 32-bit -mint8 mode. + + * doc/invoke.texi (-mint8): Added documentation for the -mint8 + option in the AVR architecture. + +2004-05-24 Mike Stump + + * doc/install.texi: Document that dejagnu 1.4.4 is required. + +2004-05-24 Joseph S. Myers + + * intl.h (open_quote, close_quote): New. + * intl.c (open_quote, close_quote): New. + (gcc_init_libintl): Set them. + * pretty-print.c: Include "intl.h". + (pp_base_format_text): Support 'q' format flag and %` and %' + formats. Use ' instead of ` in comments. + * c-format.c (gcc_diag_flag_specs, gcc_cxxdiag_flag_specs, + gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table, + foramt_types_orig): Describe these new formats. + (decode_format_attr, check_function_format, + check_format_info_main): Use these new formats. + (status_warning): Use ATTRIBUTE_GCC_DIAG. + * toplev.c (ATTRIBUTE_GCC_DIAG): Increase required GCC version to + check these formats to 3.5. + +2004-05-24 Rainer Orth + + * Makefile.in (CPPLIBS): Renamed to CPPLIB. + (BACKEND): Reflect this. + (LIBDEPS): Move CPPLIB before LIBIBERTY. + (LIBS): Likewise. + +2004-05-24 Ulrich Weigand + + PR tree-optimization/14197 + * builtins.c: Include "tree-gimple.h" + (readonly_data_expr): Use get_base_address. Make sure to call + decl_readonly_section only on trees it can handle. + * tree-gimple.c (get_base_address): Accept STRING_CST and + CONSTRUCTOR expressions. + * Makefile.in: Update dependencies. + +2004-05-23 Paolo Bonzini + + Move libcpp to the toplevel. + * Makefile.in: Remove references to libcpp files, + use CPPLIBS instead of libcpp.a. Define SYMTAB_H + and change hashtable.h to that. + * aclocal.m4 (gcc_AC_HEADER_STDBOOL, + gcc_AC_HEADER_STRING, gcc_AC_C__BOOL): Remove. + * configure.ac (gcc_AC_C__BOOL, HAVE_UCHAR): Remove tests. + * configure: Regenerate. + * config.in: Regenerate. + * c-ppoutput.c: Include ../libcpp/internal.h instead of cpphash.h. + * cppcharset.c: Removed. + * cpperror.c: Removed. + * cppexp.c: Removed. + * cppfiles.c: Removed. + * cpphash.c: Removed. + * cpphash.h: Removed. + * cppinit.c: Removed. + * cpplex.c: Removed. + * cpplib.c: Removed. + * cpplib.h: Removed. + * cppmacro.c: Removed. + * cpppch.c: Removed. + * cpptrad.c: Removed. + * cppucnid.h: Removed. + * cppucnid.pl: Removed. + * cppucnid.tab: Removed. + * hashtable.c: Removed. + * hashtable.h: Removed. + * line-map.c: Removed. + * line-map.h: Removed. + * mkdeps.c: Removed. + * mkdeps.h: Removed. + * stringpool.h: Include symtab.h instead of hashtable.h. + * tree.h: Include symtab.h instead of hashtable.h. + * system.h (O_NONBLOCK, O_NOCTTY): Do not define. + +2004-05-23 Paolo Bonzini + + * gcc.c (struct prefix_list): Add forward declaration. + (do_spec_path): New function, extracted from... + (do_spec_1) <'D'>: ... here. Drop support for + SPACE_AFTER_L_OPTION. + (do_spec_1) <'I'>: Use do_spec_path. + (process_command): Do not store the 'include' suffix + in include_prefixes. + * system.h: Poison SPACE_AFTER_L_OPTION. + +2002-05-23 Roger Sayle + + * fold-const.c (non_lvalue): Explicitly list the tree codes that + need to be wrapped by NON_LVALUE_EXPR, instead of those that don't. + +2004-05-23 Joseph S. Myers + + * doc/gcc.texi, doc/gccint.texi, doc/include/gcc-common.texi: + Update based on printed manual. Enable setting of offsets for + FSFPRINT and move it to gcc-common.texi. + * doc/gcc.texi: Update FSF printing details. + * doc/gccint.texi: Remove FSF printing details. + +2004-05-23 Andrew Pinski + + * config/rs6000/t-rs6000: Remove the disabling -Werror. + +2004-05-22 Roger Sayle + + * builtins.c (expand_builtin_strstr, expand_builtin_strchr, + expand_builtin_strrchr, expand_builtin_strpbrk, + expand_builtin_mempcpy, expand_builtin_memcmp, + expand_builtin_strcmp, expand_builtin_strncmp, + expand_builtin_strcat, std_expand_builtin_va_start, + std_expand_builtin_va_arg, expand_builtin_va_copy, + expand_builtin_signbit, fold_builtin_cabs, + fold_builtin_logarithm, fold_builtin_mempcpy, + fold_builtin_signbit, fold_builtin_isascii, + fold_builtin_toascii, fold_builtin_isdigit, + fold_builtin_1, build_function_call_expr, + simplify_builtin_strchr, simplify_builtin_strrchr, + simplify_builtin_strpbrk, simplify_builtin_strncpy, + simplify_builtin_memcmp, simplify_builtin_strcmp, + simplify_builtin_strncmp, simplify_builtin_strncat, + simplify_builtin_strspn, simplify_builtin_strcspn, + simplify_builtin_fputs, simplify_builtin_sprintf): Replace calls + to build with calls to build2, build3 or omit_one_operand. + +2004-05-22 Richard Sandiford + + * config/mips/mips.c (mips_file_start): Emit a .gcc_compiled_longXX + section when generating EABI code. + +2004-05-22 Andrew Pinski + + PR 15546 + * config/i386/i386.c (output_pic_addr_const ): + Call mark_decl_referenced on the SYMBOL_REF_DECL. + +2004-05-22 Andrew Pinski + + * c-common.c (c_common_truthvalue_conversion): Handle + UNEQ_EXPR, UNLE_EXPR, UNGE_EXPR, UNLT_EXPR, UNGT_EXPR, + ORDERED_EXPR, and UNORDERED_EXPR as comparison operators, + i.e. set the type to truthvalue_type_node and return. + +2004-05-22 Zack Weinberg + + * tree.h (struct tree_decl): Add possibly_inlined bit. + (DECL_POSSIBLY_INLINED): New accessor macro. + * cgraph.h: Remove declaration of cgraph_inline_hash. + * cgraph.c: Remove definition of cgraph_inline_hash. + (hash_node): Revert to hashing DECL_UID. + (eq_node): Take two pointers to cgraph_node structures. + Compare DECL_UIDs. + (cgraph_remove_node): Pass the node directly to htab_find_slot. + (cgraph_varpool_hash_node): Rename hash_varpool_node; + hash on DECL_UID. + (eq_cgraph_varpool_node): Rename eq_varpool_node; take two + pointers to cgraph_varpool_node structures; compare DECL_UIDs. + (cgraph_node): Allocate a temporary node on the stack, fill in + its DECL field, and pass that to htab_find_slot. + (cgraph_varpool_node): Likewise. + (cgraph_function_possibly_inlined_p): If global info is ready, + return the DECL_POSSIBLY_INLINED bit. + * cgraphunit.c (cgraph_mark_inline_edge): Set DECL_POSSIBLY_INLINED + instead of mucking with cgraph_inline_hash. + +2004-05-22 Joseph S. Myers + + * doc/contrib.texi: Add g77 contributors. + +2004-05-22 Richard Sandiford + + * calls.c (initialize_argument_information): Forbid sibcalls if a + callee-copied argument is stored in the current function's frame. + +2004-05-22 Eric Christopher + + * fix-header.c (read_scan_file): Update for add_path change. + +2004-05-22 Ben Elliston + + * c.opt (Wmissing-include-dirs): New. + * c-opts.c (c_common_handle_option): Pass true for user_supplied_p + to add_path () for -I, but false for OPT_idirafter, OPT_iquote and + OPT_isystem. Handle case OPT_Wmissing_include_dirs. + * c-incpath.h (add_path): Add fourth (bool) argument. + * c-incpath.c (add_env_var_paths): Pass false to add_path (). + (add_standard_paths): Likewise. + (remove_duplicates) [REASON_NOENT]: Warn if -Wmissing-include-dirs + is used and the directory was user-supplied via -I. + (add_path): Set p->user_supplied_p. Remove duplicated code by + using add_cpp_dir_path (). + * cpplib.h (struct cpp_options): Add warn_missing_include_dirs. + (struct cpp_dir): Add user_supplied_p. + * doc/invoke.texi (Warning Options): Document new option. + +2004-05-21 Ulrich Weigand + + * fold-const.c (fold_read_from_constant_string): Convert result to + requested type. + +2004-05-21 Richard Henderson + + * gimplify.c (mostly_copy_tree_r): Don't attempt to copy decls. + (copy_if_shared_r): Don't copy decls, types, constants, BINDs. + Don't mark VA_ARG_EXPRs volatile here. + (gimplify_modify_expr): Unshare TYPE_SIZE_UNIT. + +2004-05-21 Richard Henderson + + * Makefile.in (tree-dump.o): Depend on tree-iterator.h. + * tree-dump.c (dequeue_and_dump): Dump STATEMENT_LISTs. + +2004-05-21 Roger Sayle + + * fold-const.c (fold, fold_relational_hi_lo, + nondestructive_fold_binary_to_constant, + fold_read_from_constant_string): Use fold_convert instead of convert. + * builtins.c (simplify_builtin, simplify_builtin_strstr, + simplify_builtin_strchr, simplify_builtin_strrchr, + simplify_builtin_strpbrk): Use fold_convert instead of convert. + +2004-05-21 Diego Novillo + + * tree-flow-inline.h (num_immediate_uses): Don't abort if DF + is NULL. + +2004-05-21 Jakub Jelinek + + * config/sparc/linux64.h (OPTION_DEFAULT_SPECS): If SPARC_BI_ARCH, + override sparc.h definition. + +2004-05-20 Roger Sayle + + * tree.c (array_type_nelts, save_expr, substitute_in_expr, + get_unwidened, get_narrower): Replace build with build2. + * fold-const.c (negate_expr, associate_trees, size_binop, + fold_convert, eval_subst, omit_one_operand, invert_truthvalue, + pedantic_omit_one_operand, distribute_bit_expr, + make_bit_field_ref, optimize_bit_field_compare, + decode_field_reference, range_binop, make_range, + build_range_check, fold_range_test, fold_truthop, + optimize_minmax_comparison, extract_muldiv_1, + fold_binary_op_with_conditional_arg, fold_mathfn_compare, + fold_inf_compare, fold_single_bit_test, fold, + fold_relational_hi_lo, nondestructive_fold_binary_to_constant): + Likewise replace build with either build2 or build3. + +2004-05-20 Ian Lance Taylor + + * system.h: Poison NO_RECURSIVE_FUNCTION_CSE. + * calls.c (prepare_call_address): Don't test + NO_RECURSIVE_FUNCTION_CSE. + * config/arc/arc.h (NO_RECURSIVE_FUNCTION_CSE): Don't define. + * config/arm/arm.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/avr/avr.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/frv/frv.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/i386/i386.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/ip2k/ip2k.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/iq2000/iq2000.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/m32r/m32r.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/m68k/m68k.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/mcore/mcore.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/mips/mips.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/stormy16/stormy16.h (NO_RECURSIVE_FUNCTION_CSE): + Likewise. + * config/xtensa/xtensa.h (NO_RECURSIVE_FUNCTION_CSE): Likewise. + * config/sh/sh.h: Remove NO_RECURSIVE_FUNCTION_CSE comment. + * doc/tm.texi (Costs): Remove documentation for + NO_RECURSIVE_FUNCTION_CSE. + +2004-05-20 Paul Brook + + * unwind-dw2-fde.c (get_cie_encoding): Handle dwarf3 CIE format. + * unwind-dw2.c (extract_cie_info): Ditto. + (_Unwind_FrameState): Change retaddr_column to word type. + +2004-05-20 Roger Sayle + + PR middle-end/3074 + * fold-const.c (strip_compound_expr): Delete function. + (count_cond): Delete function. + (fold_binary_op_with_conditional_arg): Only perform transformations + "a + (b?c:d) -> b ? a+c : a+d" and "(b?c:d) + a -> b ? c+a : d+a" + when a is constant. This greatly simplifies this routine. + + * tree.c (saved_expr_p): Delete function. + * tree.h (saved_expr_p): Delete function prototype. + +2004-05-20 Andrew Pinski + + * common.opt (ftree-loop-optimize): Remove. + +2004-05-20 Daniel Jacobowitz + + * Makefile.in (AR_FOR_TARGET, RANLIB_FOR_TARGET) + (NM_FOR_TARGET): Use := and $(shell). + (mainversion): Remove unused variable. + +2004-05-20 John David Anglin + + * reorg.c (delete_from_delay_slot): If we have a barrier after the + sequence containing the insn to be deleted, always reemit it. + +2004-05-20 Richard Henderson + + PR 15454 + * tree-nested.c (get_chain_decl): Create a PARM_DECL by hand. + * function.c (expand_function_start): Expand static_chain_decl by hand. + * gimplify.c (create_tmp_var_name): Export. + * tree-gimple.h (create_tmp_var_name): Declare. + +2004-05-20 Andrew Pinski + + * rs6000.c (print_operand) : Call + mark_decl_referenced before assemble_name. + +2004-05-20 Zack Weinberg + + * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node) + (cgraph_varpool_hash_node, eq_cgraph_varpool_node) + (cgraph_varpool_node): Hash on the pointer to the decl, not + the DECL_UID. Fixes 64-bit bootstrap failure. + +2004-05-20 Richard Earnshaw + + * arm.md (ite_ne_zeroextractsi, ite_ne_zeroextractsi_shifted): Ensure + we don't earlyclobber operands used in the second insn. + +2004-05-20 Steven Bosscher + + * tree-mudflap.c: Formatting fixes. + +2004-05-20 J"orn Rennecke + + * Makefile.in (GTFILES): Add $(srcdir)/reload.h. + * gengtype.c (open_base_files): Include reload.h in ifiles. + * reload.h (reg_equiv_memory_loc_varray): Declare. + * reload1.c (reg_equiv_memory_loc_varray): New variable. + (init_reload): Initialize it. + (reload): Instead of freeing reg_equiv_memory_loc, 'grow' + reg_equiv_memory_loc_varray to size 0. + * ra.c (reg_alloc): Allocate reg_equiv_memory_loc by + growing reg_equiv_memory_loc_varray to the desired size. + * passes.c (rest_of_handle_old_regalloc): Likewise. + * reload.c: Amend comment on calling init_reload. + +2004-05-20 Nick Clifton + + * config/c4x/c4x.h (INITIALIZE_TRAMPOLINE): Replace 'tramp' + with 'TRAMP' in the body of the macro definition. + +2004-05-19 H.J. Lu + + PR target/15383 + * config/ia64/ia64.c (ia64_expand_compare): Don't check + TARGET_HPUX for TFmode compare. Abort if op0 is in TFmode and + cmptf_libfunc isn't set. + (ia64_init_libfuncs): Rename TFmode libfuncs using the HPUX + conventions. + (ia64_sysv4_init_libfuncs): New. + + * config/ia64/sysv4.h (TARGET_INIT_LIBFUNCS): New. Defined as + ia64_sysv4_init_libfuncs. + +2004-05-20 Falk Hueffner + + PR other/15526 + * libgcc2.c (__mulvsi3): Fix overflow test. + +2004-05-19 Andrew Pinski + + PR c/14171 + * reg-stack.c (nan): Rename to ... + (not_a_num): Here. + (reg_to_stack): Rename nan to not_a_num. + (subst_stack_regs_pat): Likewise. + (convert_regs_entry): Likewise. + (convert_regs_1): Likewise. + + * tree-cfg.c (find_case_label_for_value): Replace call to + simple_cst_equal with tree_int_cst_equal. + +2004-05-19 Jeff Law + + * tree-into-ssa.c (prepare_operand_for_rename): New argument is_use. + If the operand is for a use, then strip away the SSA_NAME, do not + strip away the SSA_NAME for a set. Never call release_ssa_name. + (mark_def_sites): Appropriately pass additional argument to + prepare_operand_for_rename. If a VDEF_RESULT is not an SSA_NAME, + then set the VDEF_RESULT to the VDEF_OP. + (set_def_block): Strip away any SSA_NAME to get to the real + underlying variable. + + * tree-ssa-phiopt.c (value_replacement): Handle the case where + the desired edge out of COND_BLOCK reaches OTHER_BLOCK rather than + BB directly. + +2004-05-19 Zdenek Dvorak + + PR c++/15463 + * loop-iv.c (iv_number_of_iterations): Use trunc_int_for_mode on + result of inverse. + + PR rtl-optimization/15274 + * loop-iv.c (determine_max_iter, shorten_into_mode, + iv_number_of_iterations): Handle constants correctly. + * rtl.h (get_mode_bounds): Declaration changed. + * stor-layout.c (get_mode_bounds): Return a constant suitable for + the target mode. + + PR rtl-optimization/14692 + * loop-unswitch.c (may_unswitch_on): Try folding the result. + (unswitch_single_loop): Work correctly when may_unswitch_on + returns a folded constant. + + * loop-iv.c (implies_p): Handle A < B ==> A + 1 <= B. + * simplify-rtx.c (simplify_const_relational_operation): Optimize + comparisons with mode bounds. + + * function.c (struct temp_slot): Add new field prev. + (free_after_compilation, init_temp_slots): Free new fields. + (cut_slot_from_list, insert_slot_to_list, + temp_slots_at_level, max_slot_level, move_slot_to_level, + make_slot_available): New functions. + (assign_stack_temp_for_type, combine_temp_slots, + find_temp_slot_from_address, preserve_temp_slots, + preserve_rtl_expr_result, free_temp_slots, + free_temps_for_rtl_expr, pop_temp_slots): Work with + the new structure of lists. + (mark_all_temps_used): Removed. + * function.h (struct function): Field x_temp_slots + replaced by x_used_temp_slots and x_avail_temp_slots. + (temp_slots): Replaced by ... + (used_temp_slots, avail_temp_slots): New. + * tree.h (mark_all_temps_used): Declaration removed. + + * loop-iv.c (mark_single_set, get_biv_step_1, iv_analyze, + simplify_using_assignment): Take the expression out of + the expr_list wrapper. + + * loop-iv.c (iv_number_of_iterations): Improve clasification of + infinite loops. + +2004-05-19 Roger Sayle + + * doc/tm.texi (TARGET_RTX_COSTS): Document that instruction + costs should be based on code size when optimizing for size. + +2004-05-19 Paolo Bonzini + + * fold-const.c: Remove non-printable character 160. + +2004-05-19 Nick Clifton + + * doc/invoke.texi (ARM Options): Fix typo. + Remove descrption of -mshort-load-bytes and + -mno-short-load-bytes. + + * config/ip2k/ip2k.c (ip2k_composite_xexp_not_uses_reg_p): Add + missing parenthesis. + * config/ip2k/ip2k.c (ip2k_unary_operator): Likewise. + * config/ip2k/ip2k.c (ip2k_binary_operator): Likewise. + +2004-05-19 Steven Bosscher + + * expr.c (store_constructor): Build loop start and end by hand + instead of via loop functions from stmt.c. + (expand_expr_real_1): Abort if we see an EXIT_EXPR or a LOOP_EXPR. + Remove the code to expand them. + + * stmt.c (loop_stack): Remove this and everything related. + (struct nesting, enum nesting_desc): Update. + (expand_fixup): Likewise. + (expand_loop_start, expand_start_loop_continue_elsewhere, + expand_start_null_loop, expand_loop_continue_here, expand_end_loop, + expand_end_null_loop, expand_continue_loop, expand_exit_loop, + expand_exit_loop_if_false, expand_exit_loop_top_cond, + expand_exit_something): Remove. + * tree.h: Remove prototypes. + +2004-05-18 Mike Stump + Devang Patel + + * doc/tm.texi (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument to indicate + if this label is for eh. + * config/darwin-protos.h (darwin_emit_unwind_label): Likewise. + * config/darwin.c (darwin_emit_unwind_label): Likewise. + * dwarf2out.c (output_call_frame_info): Likewise. + * output.h (default_emit_unwind_label): Likewise. + * target.h (unwind_label): Likewise. + * varasm.c (default_emit_unwind_label): Likewise. + + * config/darwin.h (DWARF2_DEBUGGING_INFO, PREFERRED_DEBUGGING_TYPE, + DEBUG_FRAME_SECTION, DEBUG_INFO_SECTION, DEBUG_ABBREV_SECTION, + DEBUG_ARANGES_SECTION, DEBUG_MACINFO_SECTION, DEBUG_LINE_SECTION, + DEBUG_LOC_SECTION, DEBUG_PUBNAMES_SECTION, DEBUG_STR_SECTION, + DEBUG_RANGES_SECTION): Define. + +2004-05-18 Zack Weinberg + + * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node) + (cgraph_varpool_hash_node, eq_cgraph_varpool_node) + (cgraph_varpool_node): + Use DECL_UID for the key, not DECL_ASSEMBLER_NAME. + (cgraph_function_possibly_inlined_p): Use the decl itself for + the key, not DECL_ASSEMBLER_NAME. + (change_decl_assembler_name): No need to muck with the hash tables. + (cgraph_node_for_identifier, cgraph_varpool_node_for_identifier): + Delete. + * cgraphunit.c (cgraph_mark_inline_edge): Use the decl itself + for the key, not DECL_ASSEMBLER_NAME. + * cgraph.h: Remove prototypes of deleted functions. + * varasm.c (mark_referenced): Just set TREE_SYMBOL_REFERENCED. + (mark_decl_referenced): New function. + * tree.h: Prototype mark_decl_referenced. + * final.c (output_addr_const) : Call + mark_decl_referenced before assemble_name. + * c-decl.c (finish_decl): Use mark_decl_referenced. + +2004-05-18 Andrew Pinski + Jeff Law + + * tree-ssa-phiopt.c (abs_replacement): New function. + (empty_block_p): New function extracted from... + (candidate_bb_for_phi_optimization): Break out empty block test. + (conditional_replacement): Use empty_block_p. + (value_replacement): Similarly. + + * Makefile.in (tree-ssa-phiopt.o): Depends on flags.h. + * tree-ssa-phiopt.c: Include flags.h. + (conditional_replacement): Remove argument names from prototype. + Minor formatting and comment fixes. + (tree_ssa_phiopt): If conditional_replacement returns false, then + call value_replacement. + (value_replacement): New function. + +2004-05-18 Jeff Law + + * tree-ssa-phiopt.c (replace_phi_with_stmt): New function extracted + from conditional_replacement. + (candidate_bb_for_phi_optimization): Similarly. + (conditional_replacement): Use replace_phi_with_stmt and + candidate_bb_for_phi_optimization. + + * tree-ssa-phiopt.c: Fix various formatting issues. + +2004-05-18 Steven Bosscher + + * config/s390/s390.c (s390_expand_movstr, s390_expand_clrstr, + s390_expand_cmpmem): Do not use expand_start_loop and + expand_end_loop, instead build the loop manually. + +2004-05-18 Alan Modra + + * config/rs6000/rs6000.md (ctrsi_internal3): Delete. + (ctrsi_internal4, ctrdi_internal3, ctrdi_internal4): Delete. + +2004-05-17 Jeff Law + + * toplev.h (flag_delete_null_pointer_checks): Move from here to... + * flags.h (flag_delete_null_pointer_checks): Here. + * tree-flow.h (cprop_into_successor_phis): Add argument to prototype. + * tree-phinodes.c (resize_phi_node): Initialize PHI_ARG_NONZERO. + (add_phi_arg, remove_phi_arg_num): Similarly. + * tree-ssa-copy.c (cprop_into_successor_phis): Propagate nonzero + property into PHI nodes. + * tree-ssa-dom.c: Remove redundant inclusion of flags.h. + (record_equivalences_from_phis): If all PHI arguments are known to be + nonzero, then the result must be nonzero as well. + (cprop_into_phis): Pass nonzero_vars bitmap to cprop_into_successor_phis. + (record_equivalences_from_stmt): Check flag_delete_null_pointer_checks + appropriately. Walk the USE-DEF chains and propagate nonzero property + as appropriate. + * tree.h (PHI_ARG_NONZERO): Define. + (phi_arg_d): Add nonzero flag. + +2004-05-17 Zack Weinberg + + * f: Entire directory removed + + * c-common.h (CTI_G77_INTEGER_TYPE, CTI_G77_UINTEGER_TYPE) + (CTI_G77_LONGINT_TYPE, CTI_G77_ULONGINT_TYPE) + (g77_integer_type_node, g77_uinteger_type_node) + (g77_longint_type_node, or g77_ulongint_type_node): Delete. + * c-common.c (c_common_nodes_and_builtins): Do not initialize + the above set of variables. + + * config/i386/uwin.h: No need to define WIN32_UWIN_TARGET. + * doc/invoke.texi, doc/standards.texi: Remove cross-references + to g77 manual. + +2004-05-17 Steven Bosscher + + PR tree-optimization/15438 + * tree-ssa-operands.c (get_expr_operands): Do not treat malloc + attributed functions as pure or const. + +2004-05-17 Frank Ch. Eigler + + * tree-mudflap.c (mx_register_decls): Tolerate decl trees resulting + from source code with errors. + +2004-05-17 Ranjit Mathew + + Enable tree browser for all front ends. + * Makefile.in (cc1): Moved @TREEBROWSER@ from here... + (BACKEND): ...to here. + +2004-05-17 Jan Hubicka + + * i386.c (construct_container): Do not produce BLKmode registers. + (classify_argument): Properly compute alignment of complex types. + +2004-05-17 H.J. Lu + + PR target/15084 + * config/i386/i386.md (*movsi_insv_1_rex64): Changed to DImode + and renamed to movdi_insv_1_rex64. + (insv): Support SImode for 32bit and DImode for 64bit. + +2004-05-17 Richard Sandiford + + * config/mips/mips.h (MASK_DEBUG_G, TARGET_DEBUG_G_MODE): Delete. + (TARGET_SWITCHES): Remove debugg. + * config/mips/mips.md (adddi3, ashldi3, ashrdi3, lshrdi3): Only handle + TARGET_64BIT. + (subdi3): Replace the define_expand with a define_insn, the latter + renamed from subdi3_internal_3. + (negdi2): Likewise negdi2_internal_2. + (adddi3_internal_[12], subdi3_internal, ashldi3_internal{,2,3}) + (ashrdi3_internal{,2,3}, lshrdi3_internal{,2,3}): Remove patterns + and associated define_splits. + (adddi3_internal): Renamed from adddi3_internal_3. + (ashldi3_internal): Likewise ashldi3_internal4. + (ashrdi3_internal): Likewise ashrdi3_internal4. + (lshrdi3_internal): Likewise lshrdi3_internal4. + +2004-05-17 Richard Sandiford + + * optabs.c (expand_unop): Try implementing negation using subtraction + from zero. + +2004-05-16 John David Anglin + + * pa.md: Fix typo from last change. Remove DFmode move to and from + SAR register. + +2004-05-16 Richard Earnshaw + + PR target/10982 + * arm.md (ne_zeroextractsi): Convert to insn-and-split. + (ne_zeroextractsi_shifted): New pattern. + (ite_ne_zeroextractsi): New pattern. + (ite_ne_zeroextractsi_shifted): New pattern. + +2004-05-15 Steven Bosscher + + * c-gimplify.c (c_genericize): + Replace calls via (*lang_hooks.foo) with lang_hooks.foo. + * c-parse.in : Likewise. + : Likewise. + : Likewise. + * expr.c (expand_var, expand_expr_real_1): Likewise. + * expr.h (expand_expr): Make it a static inline function. + Move prototype for expand_expr_real up before this. + * fold-const.c (fold_relational_hi_lo, fold_relational_const): + Likewise. + * gimplify.c (gimple_boolify, gimplify_addr_expr, + gimplify_asm_expr, gimplify_expr): Likewise. + * tree-cfg.c (dump_tree_cfg, dump_cfg_stats, tree_cfg2vcg, + dump_function_to_file): Likewise. + * tree-dfa.c (dump_immediate_uses, dump_dfa_stats): Likewise. + * tree-inline.c (remap_block, save_body, walk_tree): Likewise. + * tree-into-ssa.c (dump_tree_ssa): Likewise. + * tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree): + Likewise. + * tree-optimize.c (execute_one_pass): Likewise. + * tree-pretty-print.c (dump_generic_bb_buff): Likewise. + * tree-ssa-alias.c (dump_alias_stats, dump_alias_info): Likewise. + + * objc/objc-act.c (objc_build_try_enter_fragment, + objc_build_try_epilogue, objc_build_catch_stmt, + objc_build_finally_prologue): Replace calls via (*lang_hooks.foo) + with lang_hooks.foo (). + +2004-05-15 Roger Sayle + + * builtins.c (simplify_builtin_strcpy): Avoid use of chainon, so + that simplify_builtin doesn't destructively modify its argument. + +2004-05-15 Richard Earnshaw + + * arm/lib1funcs.asm (_lshrdi3, _ashrdi3, _ashldi3): Add ASM + implementations for ARM and Thumb. + * arm/t-arm-elf (LIB1ASMFUNCS): Use them. + +2004-05-15 Thomas Quinot + + * prefix.c (update_path): Replace PREFIX with KEY only + when it matches a full directory name in PATH. + +2004-05-15 Richard Earnshaw + + * arm.h (TARGET_APCS_32): Delete. + (TARGET_MMU_TRAPS): Delete. + (TARGET_CPU_CPP_BUILTINS): Unconditionally define __APCS_32__. Never + define __APCS_26__. + (CPP_SPEC): Remove checking of -mapcs-{26,32}. + (ARM_FLAG_APCS_32, ARM_FLAG_MMU_TRAPS): Delete. + (TARGET_SWITCHES): Remove alignment_traps and apcs-{26,32} switches. + (prog_mode_type): Delete. + (PROMOTE_MODE): Always promote unsigned for HImode. + (SECONDARY_INPUT_RELOAD_CLASS): Simplify. + (MASK_RETURN_ADDR): Simplify. + * arm.c (arm_prgmode): Delete. + (arm_override_options, arm_gen_rotated_half_load): Simplify. + (print_multi_reg, output_return_instruction): Simplify. + (arm_output_epilogue, arm_final_prescan_insn): Simplify. + (arm_return_addr): Simplify. + * arm.md (prog_mode): Delete. + (conds): Simplify. + (zero_extendhisi2, extendhisi2, movhi, movhi_bytes): Simplify. + (rotated_loadsi, movhi_insn_littleend, movhi_insn_bigend): Delete. + (loadhi_si_bigend, loadhi_preinc, loadhi_shiftpreinc): Delete. + (loadhi_shiftpredec): Delete. + (peephole for post-increment on HImode load): Delete. + * arm/crtn.asm: (FUNC_END): Simplify. + * arm/lib1funcs.asm: Remove APCS-26 return macros. + * arm/aof.h, arm/coff.h arm/elf.h arm/linux-elf.h arm/netbsd-elf.h + * arm/netbsd.h arm/pe.h arm/semi.h arm/semiaof.h arm/unknown-elf.h + * arm/vxworks.h arm/wince-pe.h: Tidy TARGET_DEFAULTS and + MULTILIB_DEFAULTS as required. + * arm/t-arm-elf arm/t-linux arm/t-pe arm/t-semi arm/t-wince-pe + * arm/t-xscale-coff arm/t-xscale-elf arm/uclinux-elf: Tidy MULTILIB + variables as required. + * doc/invoke.texi (ARM Options): Remove obsolete flags. + +2004-05-15 Alan Modra + + * config/rs6000/rs6000.c (rs6000_va_arg ): Don't use + UNITS_PER_WORD to calculate gpr size. Re-instate code to set reg + count to 8 to handle n_reg > 2. + +2004-05-15 Joseph S. Myers + + * doc/extend.texi: Update WG14 URL. + +2004-05-15 Steven Bosscher + + * basic-block.h (life_analysis, delete_noop_moves): + Update prototypes. + * bt-load.c (branch_target_load_optimize): Don't take the + insns stream as an argument. Update the life_analysis calls. + * combine.c (combine_instructions): Update delete_noop_moves + calls. + * flow.c (notice_stack_pointer_modification): Don't take the + insns stream as an argument. Work on the flow graph. + (life_analysis): Likewise. + (delete_noop_moves): Likewise. + * passes.c (rest_of_handle_stack_regs): Update reg_to_stack call. + (rest_of_handle_life): Update life_analysis call. + (rest_of_compilation): Likewise, and also update + branch_target_load_optimize call. + * ra.c (reg_alloc): Update life_analysis call. + * reg-stack.c (reg_to_stack): Likewise. Also, don't take + the insns stream as an argument. + * regrename.c (copyprop_hardreg_forward): Update delete_noop_moves + call. + * rtl.c (branch_target_load_optimize, reg_to_stack): Update + prototypes. + * value-profile.c (branch_prob): Update life_analysis call. + * web.c (web_main): Work on the CFG, not on the insns stream. + + * config/ip2k/ip2k.c (ip2k_reorg): Update life_analysis calls. + * config/m68hc11/m68hc11.c (m68hc11_reorg): Likewise. + * config/sh/sh.c (sh_output_mi_thunk): Likewise. + +2004-05-15 Joseph S. Myers + + PR c/15444 + * c-format.c (avoid_dollar_number): New function. + (check_format_info_main): Call avoid_dollar_number when operand + numbers might occur but has_operand_number == 0. + +2004-05-14 Richard Earnshaw + + * arm.md (all peephole2 patterns): Use predicates that validate + register classes as appropriate. + +2004-05-14 Steven Bosscher + + PR opt/14472 + * tree-tailcall.c (process_assignment): Use STRIP_NOPS to + ignore type conversions that do not inhibit tail calling. + (find_tail_calls): Likewise. + +2004-05-14 Jeff Law + + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even + bother marking bypassed virtuals for out-of-ssa. Instead merge + bypassed virtuals into vars_to_rename just before into-ssa pass. + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Reorganize + so that it picks up more opportunities to eliminate ABS expressions + or turn them into negations. + +2004-05-14 Steven Bosscher + + * passes.c (rest_of_handle_null_pointer): Remove. + (rest_of_handle_cse): Don't call rest_of_handle_null_pointer. + (rest_of_compilation): Likewise. + * rtl.h (delete_null_pointer_checks): Remove prototype. + * gcse.c (rd_kill, rd_gen, reaching_defs, rd_out, ae_in, ae_out): + Remove declarations. + (get_bitmap_width, alloc_rd_mem, free_rd_mem, handle_rd_kill_set, + compute_kill_rd, compute_rd, alloc_avail_expr_mem, + free_avail_expr_mem, compute_ae_gen, expr_killed_p, compute_ae_kill, + expr_reaches_here_p, computing_insn, def_reaches_here_p, + can_disregard_other_sets, handle_avail_expr, classic_gcse, + one_classic_gcse_pass, invalidate_nonnull_info, + delete_null_pointer_checks_1, delete_null_pointer_checks, + expr_reached_here_p_work): Remove. + (gcse_main): Do not perform classic GCSE when optimizing for size. + (alloc_pre_mem, free_pre_mem): Don't touch ae_in and ae_out, they + are never used. + +2004-05-14 Andrew Pinski + + PR optimization/14466 + * tree-complex.c (make_temp): Remove. + (gimplify_val): Replace make_temp with make_rename_temp + and add NULL as the second argument. + (expand_complex_div_wide): Likewise. + * tree-dfa.c (make_rename_temp): New function. + * tree-flow.h (make_rename_temp): Declare. + * tree-sra.c (make_temp): Remove. + (lookup_scalar): Replace make_temp with make_rename_temp. + (create_scalar_copies): Likewise. + * tree-ssa-phiopt.c (conditional_replacement): When we + get non gimple create a temporary variable to hold the + casted expression. + +2004-05-14 Paul Brook + + * stor-layout.c (update_alignment_for_field): Use + targetm.align_anon_bitfield. + * target-def.h (TARGET_ALIGN_ANON_BITFIELD): Define. + (TARGET_INITIALIZER): Use it. + * target.h (struct gcc_target): Add align_anon_bitfield. + * config/arm/arm.c (arm_align_anon_bitfield): New function. + (TARGET_ALIGN_ANON_BITFIELD): Define. + * doc/tm.texi: Document TARGET_ALIGN_ANON_BITFIELD. + +2004-05-13 Zack Weinberg + + * tree.def (documentation): Remove mention of class 'b'. + (BLOCK): Now in class 'x'. + * c-common.c (verify_tree): Remove case 'b'. + * c-typeck.c (same_translation_unit_p): Change 'b' to 'x'. + * calls.c (calls_function_1): Control cannot get past the switch + when exp is a BLOCK. + * print-tree.c (print_node): Move code for class 'b' to the class + 'c'/'x' switch, as case BLOCK. + * tree.c (tree_size, make_node_stat, tree_node_structure): Likewise. + (unsafe_for_reeval, substitute_placeholder_in_expr) + (stabilize_reference_1): Remove case 'b'. + * tree-browser.c (browse_tree): Change all tests for TREE_CODE_CLASS + of something being 'b' to tests for TREE_CODE of something being + BLOCK. + * tree-ssa-operands.c (get_expr_operands): Likewise. + +2004-05-13 Diego Novillo + + * tree-gimple.c: Rename from tree-simple.c. + * tree-gimple.h: Rename from tree-simple.h. + * c-gimplify.c: Rename from c-simplify.c + * Makefile.in, c-decl.c, gimple-low.c, gimplify.c, + langhooks.c, tree-alias-ander.c, tree-alias-common.c, + tree-complex.c, tree-dfa.c, tree-flow.h, tree-inline.c, + tree-into-ssa.c, tree-iterator.c, tree-mudflap.c, + tree-nested.c, tree-nomudflap.c, tree-outof-ssa.c, tree-sra.c, + tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-copyrename.c, + tree-ssa-dce.c, tree-ssa-live.c, tree-ssa-pre.c, tree-ssa.c: + Update. + +2004-05-14 Ranjit Mathew + + * doc/sourcebuild.texi: Mention libbanshee and libmudflap. + +2004-05-13 Andrew Pinski + + * tree-ssa.c (delete_tree_ssa): XFREE + bitmaps allocated with BITMAP_XMALLOC. + + * tree-ssa-pre.c (execute_pre): Free ephi_use_pool and + idfs_cache at the end of the function. + + * tree-ssa-live.c (calculate_live_on_entry): Free saw_def + at the end of the function. + + * tree-ssa-dce.c (perform_tree_ssa_dce): Free + el at the end of the function. + + * tree-into-ssa.c (insert_phi_nodes_for): XFREE + bitmaps allocated with BITMAP_XMALLOC. + + * loop-unswitch.c (unswitch_single_loop): Free bbs at + the end. + + * final.c (shorten_branches): Free uid_shuid before + reallocating it. + + * bb-reoder.c (connect_traces): Free cold_traces at the end. + +2004-05-13 Jeff Law + + * tree-ssa-live.c (calculate_live_on_entry): Ignore virtual + variables. Simplify slightly by using USE_OP/DEF_OP instead + of USE_OP_PTR/DEF_OP_PTR and dereferencing the result. + + * tree-into-ssa.c (compute_global_livein): Use EXECUTE_IF_SET_IN_BITMAP + rather than iterating through the blocks testing each bit in + livein to initialize the worklist. + (mark_def_sites): Remove useless checks of KILLS for virtual + operands. + + * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Accept + new parameters for the statement and variable worklist as well + as a bitmap of interesting SSA_NAMEs. Walk over the statement + worklist recording interesting variables in the variable worklist + and bitmap. Handle casts between integral and boolean types. + (substitute_single_use_vars): Accept new parameters for the statement + and variable worklist. When a substitution is made add a new + entry to the statement worklist. Handle casts between integral + and boolean types. + (tree_ssa_forward_propagate_single_use_vars): Rework to pass + worklists to children. Iterate until the statement worklist + is empty. + +2004-05-13 Andrew Pinski + + * tree-outof-ssa.c (rewrite_vars_out_of_ssa): Free map at + the end of the block. + + * tree-into-ssa.c (def_blocks_free): XFREE bitmaps allocated + with BITMAP_XMALLOC. + + * tree-ssa-alias.c (delete_alias_info): XFREE bitmaps allocated + with BITMAP_XMALLOC. + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): + Free nonzero_vars at the end of the function. + + * convert.c (convert_to_integer): Make a CONVERT_EXPR when there is a + need to generate code instead of a NOP_EXPR. + +2004-05-13 Ian Lance Taylor + + * gcc.c (default_compilers): Fill out initializers for new Fortran + entries. + +2004-05-13 Paul Brook + + * config/arm/arm.h (PCC_BITFIELD_TYPE_MATTERS): Define. + +2004-05-13 Paul Brook + + * config/arm/arm.c (arm_default_short_enums): New function. + (TARGET_DEFAULT_SHORT_ENUMS): Define. + +2004-05-13 Diego Novillo + + Merge from tree-ssa-20020619-branch. + + * Makefile.in (reload1.o-warn): Add. + (tree-alias-ander.o-warn): Add. + (GMPLIBS): Define. + (GMPINC): Define. + (BANSHEELIB): Define. + (BANSHEEINC): Define. + (TREE_DUMP_H): Define. + (TREE_SIMPLE_H): Define. + (TREE_FLOW_H): Define. + (LIBDEPS): Add BANSHEELIB. + (INCLUDES): Add BANSHEEINC and GMPINC. + (C_AND_OBJC_OBJS): Add c-simplify.o, tree-mudflap.o, + c-mudflap.o and c-pretty-print.o. + (C_OBJS): Remove c-pretty-print.o. + (OBJS-common): Remove sibcall.o. + Add tree-cfg.o, tree-dfa.o, tree-eh.o, + tree-ssa.o, tree-optimize.o, tree-simple.o, + tree-alias-type.o, gimplify.o, tree-pretty-print.o, + tree-into-ssa.o, tree-outof-ssa.o, tree-alias-common.o, + tree-ssa-ccp.o, @ANDER@, tree-ssa-dce.o, tree-ssa-copy.o, + tree-nrv.o, tree-ssa-copyrename.o, tree-ssa-pre.o, + tree-ssa-live.o, tree-ssa-operands.o, tree-ssa-alias.o, + tree-ssa-phiopt.o, tree-ssa-forwprop.o, tree-nested.o, + tree-ssa-dse.o, tree-ssa-dom.o, domwalk.o, + tree-tailcall.o, gimple-low.o, tree-iterator.o, + tree-phinodes.o, tree-ssanames.o, tree-sra.o, + tree-complex.o, tree-ssa-loop.o, rtl-profile.o and + tree-profile.o. + (OBJC-archive): Add tree-nomudflap.o. + (cc1): Add dependency on @TREEBROWSER@. + (c-decl.o): Add dependency on TREE_DUMP_H. + (c-dump.o): Likewise. + (c-common.o): Add dependency on tree-iterator.h + (c-pretty-print.o): Add dependency on DIAGNOSTIC_H. + (gtype-desc.o): Add dependency on TREE_FLOW_H. + (tree.o): Add dependency on tree-iterator.h, + BASIC_BLOCK_H and TREE_FLOW_H. + (tree-dump.o): Depend on TREE_DUMP_H instead of tree-dump.h. + (langhooks.o): Add dependency on TREE_SIMPLE_H. + (tree-alias-type.o, tree-alias-ander.o, + tree-alias-common.o, tree-ssa.o, tree-into-ssa.o, + tree-outof-ssa.o, tree-ssa-dse.o, tree-ssa-forwprop.o, + tree-ssa-phiopt.o, tree-nrv.o, tree-ssa-copy.o, + tree-ssa-dom.o, tree-ssanames.o, tree-phinodes.o, + domwalk.o, tree-ssa-live.o, tree-ssa-copyrename.o, + tree-ssa-pre.o, tree-cfg.o, tree-tailcall.o, + tree-nested.o, tree-iterator.o, tree-dfa.o, + tree-ssa-operands.o, tree-eh.o, tree-ssa-loop.o, + tree-ssa-alias.o, tree-optimize.o, c-simplify.o, + gimplify.o, gimple-low.o, tree-browser.o, tree-simple.o, + tree-mudflap.o, c-mudflap.o, tree-nomudflap.o, + tree-pretty-print.o, tree-ssa-dce.o, tree-ssa-ccp.o, + tree-sra.o, tree-complex.o, tree-profile.o, + rtl-profile.o): New rules. + (function.o): Add dependency on basic-block.h + (expr.o): Add dependency on tree-iterator.h. + (sibcall.o): Remove. + (profile.o): Depend on TREE_FLOW_H instead of TREE_H. + (cfg.o): Add dependency on TIMEVAR_H. + (cfghooks.o): Add dependency on TREE_FLOW_H. + (reg-stack.o): Add dependency on basic-block.h. + (GTFILES): Add hwint.h, tree-mudflaph.c, tree-flow.h, + c-objc-common.c, c-common.c, c-parse.in, tree-ssanames.c, + tree-eh.c, tree-phinodes.c, tree-cfg.c, tree-dfa.c, + tree-ssa-ccp.c, tree-iterator.c, gimplify.c, + tree-alias-type.h, tree-alias-common.h, + tree-alias-type.c, tree-alias-common.c, + tree-ssa-operands.h, tree-ssa-operands.c, tree-profile.c, + rtl-profile.c and tree-nested.c. + (gt-tree-alias-common.h, gt-tree-mudflap.h, + gt-tree-ssa-ccp.h, gt-tree-eh.h, gt-tree-ssanames.h, + gt-tree-iterator.h, gt-gimplify.h, gt-tree-phinodes.h, + gt-tree-cfg.h, gt-tree-nested.h): New rules. + (TEXI_GCCINT_FILES): Add cfg.texi and tree-ssa.texi. + * basic-block.h: Include predict.h + (struct edge_def): Add GTY marker. + Change field 'insns' to be a union of tree and rtx. + (EDGE_TRUE_VALUE): Define. + (EDGE_FALSE_VALUE): Define. + (EDGE_EXECUTABLE): Define. + (struct bb_ann_d): Forward declare. + (struct basic_block_def): Add GTY marker. + Remove fields head_tree and end_tree. + Add fields stmt_list, rbi and tree_annotations. + (struct reorder_block_def): Define. + (basic_block_info): Add GTY marker. + (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Change to global + variables instead of macros. + (flow_call_edges_add): Remove declaration. + (make_eh_edge): Remove declaration. + (brief_dump_cfg, find_edge, tree_predicted_by_p, + rtl_predicted_by_p, tree_predict_edge, rtl_predict_edge, + predict_edge_def, rtl_make_eh_edge, find_basic_blocks, + cleanup_cfg, delete_unreachable_blocks, merge_seq_blocks, + alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): Declare. + (try_redirect_by_replacing_jump): Modfiy return type to + edge instead of bool. + * bb-reorder.c (copy_bb): Call duplicate_block + instead of cfg_layout_duplicate_bb. + (copy_bb_p): Call can_duplicate_block_p instead of + cfg_layout_can_duplicate_bb_p. + * bitmap.c (bitmap_first_set_bit): Abort if word + wasn't found. + (bitmap_last_set_bit): Likewise. + * builtin-types.def (DEF_FUNCTION_TYPE_2): Add + (DEF_FUNCTION_TYPE_3): Add. + * builtins.c (c_strlen): Make extern. + (builtin_save_expr): New. + (expand_builtin_nonlocal_goto): New. + (expand_builtin_constant_p): Remove. + (expand_builtin_mathfn): Call builtin_save_expr instead + of save_expr. + (expand_builtin_mathfn_2): Likewise. + (expand_builtin_strcmp): Likewise. + (expand_builtin_strncmp): Likewise. + (expand_builtin_strcat): Likewise. + (fold_builtin_cabs): Likewise. + (expand_builtin_alloca): Don't trigger if -fmudflap is + given. + (build_string_literal): Set TREE_INVARIANT on new node. + (expand_builtin_profile_fun): New. + (round_trampoline_addr): New. + (expand_builtin_init_trampoline): New. + (expand_builtin_adjust_trampoline): New. + (expand_builtin) : Call simplify_builtin_next_arg. + : Return const0_rtx; + : + Handle. + (fold_builtin_expect): New. + (fold_builtin_isascii): Don't return non-constant results + in GIMPLE form. + (fold_builtin_isdigit): Likewise. + (fold_builtin_1): New. + (fold_builtin): Call it. + (build_function_call_expr): Update call to build a new + CALL_EXPR. + (purge_builtin_constant_p): Remove. + (simplify_builtin, simplify_builtin_memcmp, + simplify_builtin_strcmp, simplify_builtin_strncmp, + simplify_builtin_strpbrk, simplify_builtin_strstr, + simplify_builtin_strchr, simplify_builtin_strrchr, + simplify_builtin_strcat, simplify_builtin_strncat, + simplify_builtin_strspn, simplify_builtin_strcspn, + simplify_builtin_next_arg, simplify_builtin_va_start, + simplify_builtin_sprintf): New. + * builtins.def (BUILT_IN_STACK_ALLOC, + BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE, + BUILT_IN_INIT_TRAMPOLINE, BUILT_IN_ADJUST_TRAMPOLINE, + BUILT_IN_NONLOCAL_GOTO, BUILT_IN_PROFILE_FUNC_ENTER, + BUILT_IN_PROFILE_FUNC_EXIT): Define. + * c-common.c: Include tree-iterator.h and hashtab.h. + (lang_statement_code_p): Declare. + (lang_gimplify_stmt): Declare. + (fix_string_type): Set TREE_INVARIANT for value. + (pointer_int_sum): Rely on build to set TREE_CONSTANT. + (c_type_hash): New. + (c_common_get_alias_set): Handle multiple type nodes + referring to "the same" type, currently for C90 only. + (c_add_case_label): Use create_artificial_label. + (finish_label_address_expr): Don't set TREE_CONSTANT on + result. + (c_expand_expr): Don't handle STMT_EXPR. + (handle_alias_attribute): Marke aliased variables to be + TREE_STATIC. + (handle_nonnull_attribute): Initialize arg_num. + (check_function_nonnull): Likewise. + (c_walk_subtrees): New. + (c_estimate_num_insns_1): Don't handle + EXPR_WITH_FILE_LOCATION nor FILE_STMT. + (c_decl_uninit_1): Remove. + (c_decl_uninit): Remove. + (c_warn_unused_result): New. + * c-common.def (ASM_STMT): Change number of operands + to 4. + (FILE_STMT): Remove. + * c-common.h (lang_expand_stmt, lang_expand_decl_stmt): + Remove. + (lang_gimplify_stmt): Add. + (expand_stmt): Remove. + (ASM_CV_QUAL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS, + ASM_CLOBBERS, STMT_EXPR_WARN_UNUSED_RESULT, + ASM_VOLATILE_P, FILE_STMT_FILENAME_NODE, + FILE_STMT_FILENAME, STMT_LINENO, STMT_LINENO_FOR_FN_P, + ASM_INPUT_P, DECL_C_HARD_REGISTER): Remove. + (genrtl_do_pushlevel, genrtl_goto_stmt, genrtl_expr_stmt, + genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, + genrtl_while_stmt, genrtl_do_stmt, genrtl_return_stmt, + genrtl_for_stmt, genrtl_break_stmt, genrtl_continue_stmt, + genrtl_scope_stmt, genrtl_switch_stmt, genrtl_case_label, + genrtl_compound_stmt, genrtl_asm_stmt, + genrtl_cleanup_stmt, c_decl_uninit): Remove. + (c_do_switch_warnings, c_gimplify_expr, c_walk_subtrees, + c_tree_chain_matters_p, c_warn_unused_result, + c_genericize, c_gimplify_stmt, stmt_expr_last_stmt): + Declare. + * c-convert.c (convert): Make convert work when + converting to compatible types across translation unit. + * c-decl.c: Include langhooks.h, tree-mudflap.h, + tree-simple.h, diagnostic.h and tree-dump.h + (merge_decls): Initialize oldtype to NULL. + (finish_decl): Use DECL_HARD_REGISTER instead of + DECL_C_HARD_REGISTER. + (check_bitfield_type_and_width): Check for null + lang_type_specific when check the precision of an enum. + (grokdeclarator): Immediately layout an ARRAY_TYPE used + in a pointer-to-array declarator. + (finish_struct): Clear allocated struct lang_type. + (finish_enum): Set enum_min and enum_max. Set + TYPE_MIN/MAX_VALUE to the limits of the compatible type, + not to the enumerators. + (set_decl_nonlocal): New. + (store_parm_decls): Use it via walk_tree. + (c_finalize): New. + (finish_function): When !targetm.have_ctors_dtors, + record static constructors and destructors here... + (c_expand_body_1): ... not here. + (c_expand_decl): Rename from c_expand_decl_stmt. + Handle all C-specific expansion semantics. + * c-dump.c (dump_stmt): Use EXPR_LOCUS instead of + STMT_LINENO. + * c-format.c (handle_format_arg_attribute): Initialize + format_num. + * c-lang.c: Include tree-inline.h + (LANG_HOOKS_EXPAND_DECL, + LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, + LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, + LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, + LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_TYPES_COMPATIBLE_P): Define. + (LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT, + LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Remove. + (c_types_compatible_p): New. + * c-mudflap.c: New file. + * c-objc-common.c: Include tree-mudflap.h + (start_cdtor, finish_cdtor): Collapse + together into + (build_cdtor): ...here. Update to construct a complete tree + for the function. No need to call push_scope, pop_scope, or + clear_last_expr, or set current_function_cannot_inline. + (c_missing_noreturn_ok_p): Change prototype to return + bool. + (c_objc_common_init): Don't set lang_missing_noreturn_ok_p. + * c-opts.c (c_common_handle_option): Move handling of -fdump- to + opts.c. + (c_common_post_options): Don't ever use rtl inlining. + * c-parse.in: Use EXPR_LOCUS instead of STMT_LINENO. + * c-pragma.c (handle_pragma_redefine_extname): Define + always. + (init_pragma): Activate #pragma redefine_extname for mudflap. + * c-pretty-print.c (pp_c_statement): Remove FILE_STMT. + (pp_c_initializer): Accept any type CONSTRUCTOR. + (pp_c_initializer_list): Fix code expectations for VECTOR_TYPE and + COMPLEX_TYPE. + (decl_name_str): New local function. + (pp_c_direct_declarator): Call it. + (pp_c_primary_expression): Call it. + (pp_c_id_expression): Call it. + (pp_c_statement): Call it. + (print_c_tree): Create new pp object. + * c-pretty-print.h (pp_c_tree_decl_identifier, + print_c_tree): Declare. + * c-semantics.c: Include langhooks.h + (lang_expand_stmt, lang_expand_decl_stmt, + find_reachable_label_1, find_reachable_label, + expand_unreachable_if_stmt, expand_unreachable_stmt, + genrtl_do_stmt_1): Remove. + (begin_stmt_tree): Don't check for changed filename. + Call annotate_with_locus. + (finish_stmt_tree): Don't set line for end of function. + (build_stmt): Don't check type nodes for + side effects. + (build_stmt): Set TREE_SIDE_EFFECTS. + Set EXPR_LOCUS instead of STMT_LINENO. + (lang_expand_stmt, lang_expand_decl_stmt, + expand_cond, genrtl_do_pushlevel, genrtl_goto_stmt, genrtl_expr_stmt, + genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, + genrtl_while_stmt, genrtl_do_stmt_1, genrtl_do_stmt, + genrtl_return_stmt, genrtl_for_stmt, genrtl_break_stmt, + genrtl_continue_stmt, genrtl_scope_stmt, genrtl_switch_stmt, + genrtl_case_label, genrtl_compound_stmt, genrtl_asm_stmt, + genrtl_cleanup_stmt, expand_stmt, find_reachable_label, + find_reachable_label_1, expand_unreachable_if_stmt, + expand_unreachable_stmt): Remove. + (prep_stmt): Use EXPR_LOCUS instead of STMT_LINENO. + * c-simplify.c: New file. + * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): Define. + (struct lang_type): Add fields enum_min and enum_max. + (c_expand_decl_stmt, c_missing_noreturn_ok_p): Remove. + (c_expand_decl, c_missing_noreturn_ok_p, + c_types_compatible_p): Declare. + * c-typeck.c (tagged_types_tu_compatible_p): Allow for + compiler-generated TYPE_DECLs without a DECL_ORIGINAL_TYPE. + (default_function_array_conversion): Rely on build to + set TREE_CONSTANT. + (parser_build_binary_op, pointer_diff): Likewise. + (build_unary_op, build_binary_op): Likewise. + (build_array_ref): + (build_external_ref): Set TREE_INVARIANT. + (build_c_cast, pop_init_level): Likewise. + (process_init_element): Use ASM_VOLATILE_P. + (build_asm_expr): Adapt to GENERIC/GIMPLE syntax. + (c_finish_case): Call c_do_switch_warnings. + * c.opt (fdump-): Remove. + * calls.c (try_to_integrate): Remove. + (prepare_call_address): Replace fndecl arg with a + precomputed static chain value. + (emit_call_1): New argument for full call expr. + (flags_from_decl_or_type): Call special_function_p. + (initialize_argument_information): Add argument + may_tailcall. + (purge_reg_equiv_notes): New. + (expand_call): Do not try to expand calls inline. + (fixup_tail_calls): New. + * cfg.c: Include timevar.h and ggc.h. + (bb_pool, edge_pool): Remove. + (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Declare. + (entry_exit_blocks): Remove. + (rbi_pool): Declare. + (init_flow): Do not create pools. + Allocate entry/exit block. + (free_edge, alloc_block, expunge_block, unchecked_make_edge): Use GGC. + (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New. + (unlink_block): Clear b->prev_bb and b->next_bb. + (compact_blocks): Clear all slots of BASIC_BLOCK array. + (dump_flow_info): Work on trees too. + (dump_cfg_bb_info): New. + (brief_dump_cfg): New. + * cfganal.c (need_fake_edge_p, flow_call_edges_add): Remove. + (find_edge): New. + * cfgbuild.c (rtl_make_eh_edge): Rename from + make_eh_edge. Update all users. + (find_basic_blocks): Don't call VARRAY_FREE on + basic_block_info. + * cfgcleanup.c (outgoing_edges_match): Initialize newpos1 + and newpos2. + (delete_unreachable_blocks): Return changed status. + (merge_seq_blocks): New. + * cfghooks.c: Include tree-flow.h + (tree_register_cfg_hooks, ir_type): New. + (redirect_edge_and_branch): Change return type to edge. + (predict_edge, predicted_by_p, can_duplicate_block_p, + duplicate_block, block_ends_with_call_p, + block_ends_with_condjump_p, flow_call_edges_add): New. + * cfghooks.h (redirect_edge_and_branch): Change return + type to edge. + (predict_edge, predicted_by_p, can_duplicate_block_p, + duplicate_block, block_ends_with_call_p, + block_ends_with_condjump_p, flow_call_edges_add): Declare. + (redirect_edge_and_branch): Change return type to edge. + (struct cfg_hooks): Add fields block_ends_with_call_p, + block_ends_with_condjump_p, flow_call_edges_add, + predict_edge, predicted_by_p, can_duplicate_block_p and + duplicate_block. + (tree_cfg_hooks, ir_type, tree_register_cfg_hooks): Declare. + * cfglayout.c (cfg_layout_pool, cfg_layout_initialize_rbi): Removed. + (fixup_reorder_chain): Use initialize_bb_rbi. + (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Hookized. + (cfg_layout_initialize): Use cfg.c rbi pool manipulation functions. + (can_copy_bbs_p, copy_bbs): Use cfghooks for bb duplication. + (insn_locators_initialize): Use new info about blocks. + * cfglayout.h (typedef struct reorder_block_def): Moved to + basic_block.h. + (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Declaration + removed. + * cfgloop.c: Include tree.h and tree-flow.h. + * cfgloop.h (create_loop_notes): Declare. + * cfgloopmanip.c (create_loop_notes): New. + * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Fill in can_duplicate_block_p + and duplicate_block fields. + (create_basic_block_structure): Don't look at + RTX_INTEGRATED_P. + (rtl_block_ends_with_call_p): New. + (rtl_block_ends_with_condjump_p): New. + (need_fake_edge_p): Moved from cfganal.c. + (rtl_flow_call_edges_add): Moved from cfganal.c (flow_call_edges_add). + (rtl_cfg_hooks): Add rtl_block_ends_with_call_p, + rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add. + (cfg_layout_rtl_cfg_hooks): Ditto. + * cgraph.c (cgraph_mark_reachable_node): Don't force nested + functions to be reachable. + * cgraphunit.c (decide_is_function_needed): + * cgraphunit.c (decide_is_function_needed): Nested functions of extern + inline functions don't need to be output. + (cgraph_assemble_pending_functions): Don't do anything + special for nested functions. + (cgraph_mark_functions_to_output): Likewise. + (cgraph_finalize_function): Don't zap DECL_STRUCT_FUNCTION. + (cgraph_analyze_function): Use estimate_num_insns. + (cgraph_mark_functions_to_output): Likewise. + (cgraph_estimate_growth, cgraph_clone_inlined_nodes): Likewise. + (cgraph_expand_function): Allow functions to not be + emitted. + (cgraph_remove_unreachable_nodes): + (cgraph_recursive_inlining_p): Simplify. + (lookup_recursive_calls, + cgraph_decide_recursive_inlining): New. + (cgraph_decide_inlining_*): Update calls of + cgraph_mark_inline. + * combine.c (get_pos_from_mask): Always set *plen. + * common.opt (fdump-, fmudflap, fmudflapth, fmudflapir, + ftree-based-profiling, ftree-ccp, ftree-ch, + ftree-combine-temps, ftree-copyrename, ftree-dce, + ftree-dominator-opts, ftree-dse, ftree-loop-optimize, + ftree-points-to, ftree-pre, ftree-sra, ftree-ter, + ftree-lrs): Add. + * config.in (HAVE_LD_PIE, HAVE_BANSHEE, PREFIX_INCLUDE_DIR): + Undefine. + * configure.ac: Add --enable-tree-browser option. + Add --with-libbanshee option. + Add GMPLIBS and GMPINC. + * configure: Regenerate. + * coverage.c (tree_ctr_tables): New. + (coverage_counter_alloc): Use it. + (build_ctr_info_value): Ditto. + (coverage_counter_ref): Ditto. Rename to rtl_coverage_counter_ref. + (tree_coverage_counter_ref): New. + * coverage.h (coverage_counter_ref): Remove declaration. + (rtl_coverage_counter_ref): Declare. + (tree_coverage_counter_ref): Declare. + * cppexp.c (append_digit): Rearrange unsignedp/overflow setting. + (eval_token, num_binary_op, num_part_mul, num_div_op): Likewise. + * cse.c (fold_rtx): Do not handle CONSTANT_P_RTX. + (struct cse_basic_block_data): Rename enum values to not + conflict with profile.h; update all uses. + * dbxout.c (dbxout_symbol_location): Don't mention integrate.c + in comments. + * defaults.h (TRAMPOLINE_ALIGNMENT): Move from function.c. + * diagnostic.h (debug_output_buffer, dump_generic_node, + print_generic_stmt, print_generic_stmt_indented, + print_generic_expr, print_generic_decl, + debug_generic_expr, debug_generic_stmt, debug_c_tree): + Declare. + * dominance.c: Cache immediate dominators. + * domwalk.c: New file. + * domwalk.h: New file. + * dwarf2out.c (is_fortran): Support DW_LANG_Fortran95. + (gen_subprogram_die): Generate a DIE for a named + return value. + (loc_descriptor_from_tree): Treat RESULT_DECL like VAR_DECL. + (add_location_or_const_value_attribute): Likewise. + (add_bound_info): Likewise. + (gen_decl_die): Likewise. + * emit-rtl.c (maybe_set_first_label_num): New. + (copy_most_rtx): Don't copy the integrated flag. + Copy the new return_val flag. + * et-forest.c (MAX_NODES): Define. + (record_path_before_1): Abort if len is greater than + MAX_NODES. + * except.c (gen_eh_region, gen_eh_region_cleanup, gen_eh_region_try, + gen_eh_region_catch, gen_eh_region_allowed, + gen_eh_region_must_not_throw, get_eh_region_number, + get_eh_region_may_contain_throw, get_eh_region_tree_label, + set_eh_region_tree_label, expand_resx_expr): New. + (expand_eh_region_start, expand_start_catch): Use them. + (expand_end_catch): Tidy. + (note_eh_region_may_contain_throw): Take region argument. + (note_current_region_may_contain_throw): New. + (get_exception_filter): Export. + (collect_eh_region_array): Export. + (remove_unreachable_regions): Check ERT_TRY based on reachability + of catches, not reachability of continue_label. Never remove + ERT_MUST_NOT_THROW regions. + (collect_rtl_labels_from_trees): New. + (convert_from_eh_region_ranges): Use it. + (connect_post_landing_pads): Handle dying cleanups. + (struct reachable_info): Add callback data. + (add_reachable_handler): Invoke the callback. + (foreach_reachable_handler): New. + (reachable_handlers): Use it. + (arh_to_landing_pad, arh_to_label): New. + (can_throw_internal_1): Split out from can_throw_internal. + (can_throw_external_1): Similarly. + * except.h: Update. + * explow.c (emit_stack_save): Remove savearea mode check. + (update_nonlocal_goto_save_area): New. + (allocate_dynamic_stack_space): Use it. + (probe_stack_range): Never emit loop notes. + * expmed.c (extract_fixed_bit_field): Always propagate the + target for the shift if it is a REG. + * expr.c: Include tree-iterator.h + (is_zeros_p): Remove. + (categorize_ctor_elements_1, categorize_ctor_elements): New. + (count_type_elements): New. + (mostly_zeros_p): Use them. + (expr_wfl_stack): Remove. + (convert_move): Do nothing if to and from are the same. + (emit_block_move_via_loop): Don't emit LOOP notes. + (emit_move_insn): Don't handle CONSTANT_P_RTX. + (emit_move_insn_1): Don't generate inline warnings. + (expand_vars, expand_var): Split from ... + (expand_expr_1): ... here. + (expand_expr_real, expand_expr_real_1): Use new macros + EXPR_LOCATION and EXPR_HAS_LOCATION. + * expr.h (simplify_builtin_fputs, + simplify_builtin_strcpy, simplify_builtin_strncpy, + expand_var, fixup_tail_calls, + update_nonlocal_goto_save_area): Declare. + (lookup_static_chain, expand_inline_function, + mark_seen_cases): Remove. + (prepare_call_address): Change type of 2nd argument to + rtx. + * final.c (profile_function): Update static chain test. + (final): Don't look at RTX_INTEGRATED_P. + * flags.h (flag_mudflap, flag_mudflap_threads, + flag_mudflap_ignore_reads, flag_tree_pre, flag_tree_ccp, + flag_tree_dce, flag_tree_combine_temps, + flag_tree_live_range_split, flag_tree_dom, flag_tree_ch, + flag_tree_dse, flag_tree_sra, flag_tree_copyrename, + flag_tree_points_to): Declare. + (enum pta_type): Declare. + * flow.c (lang_missing_noreturn_ok_p): Remove. + (check_function_return_warnings): Remove. + (update_life_info): Update comments. + (free_basic_block_vars): Don't call VARRAY_FREE for + basic_block_info. + (regno_uninitialized): Remove. + * fold-const.c (int_const_binop): Make extern. + (non_lvalue): Rely on build to set TREE_CONSTANT. + (operand_equal_p): Replace only_const argument with + flags. Allow pure functions if OEP_PURE_SAME. + (fold): Use OEP_ONLY_CONST. + (invert_truthvalue) Break if argument is of + boolean type. + (fold_relational_hi_lo, + nondestructive_fold_binary_to_constant, + nondestructive_fold_unary_to_constant, + fold_read_from_constant_string): New. + * function.c (struct function): Remove calls_constant_p. + (current_function_calls_constant_p): Remove. + (inline_function_decl): Remove. + (put_var_into_stack): Don't use it. + (fix_lexical_addr): Likewise. + (inline_function_decl): Remove extern declaration. + (TRAMPOLINE_ALIGNMENT): Move to defaults.h. + (trampolines_created): Move to varasm.c. + (free_after_compilation): Update for removed fields. + (allocate_struct_function): Likewise. + (delete_handlers, lookup_static_chain): Remove. + (fix_lexical_addr): Don't consider non-local variable refs. + (trampoline_address): Remove. + (round_trampoline_addr): Move to builtins.c. + (adjust_trampoline_addr): Remove. + (expand_function_start): Update for changes to static chain + and nonlocal goto handling. + (initial_trampoline): Move to varasm.c. + (expand_function_end): Don't build trampolines or kill + unreferenced nonlocal goto labels. + (free_after_compilation): Don't set it. + (expand_function_end): Likewise. + (setjmp_vars_warning): Rename from + uninitialized_vars_warning, remove uninitialized vars warning. + (uninitialized_vars_warning): Remove old comment + and check for DECL_INITIAL, replace with a check of TREE_NO_WARNING + and do not call the langhook. + (expand_function_start, expand_function_end): Don't do + function instrumentation here. + (clear_block_marks): Rename from reorder_blocks_0, export. + (blocks_nreverse): Export. + (uninitialized_vars_warning): Use DECL_RTL_SET_P to test for presence + of rtl. + (reset_block_changes, record_block_change, finalize_block_changes, + check_block_change, free_block_changes): New functions. + (assign_parms): Setting of current_function_stdarg + moved ... + (allocate_struct_function): ... here. + * function.h (struct function): Remove x_nonlocal_labels, + x_nonlocal_goto_handler_slots, x_nonlocal_goto_stack_level, + x_context_display, x_trampoline_list, needs_context. + Add static_chain_decl, nonlocal_goto_save_area. + (struct function): Remove x_clobber_return_insn. + Add tail_call_emit field, last_label_uid, + unexpanded_var_list, dont_emit_block_notes, + ib_boundaries_block, function_end_locus and saved_tree/saved_args. + (clear_block_marks): Declare. + * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): Add -fmudflapth support. + (mfwrap_spec, mflib_spec): Declare. + (cpp_unique_options, cc1_options): Ditto. + (default_compilers): Add .F and .f90. + (static_specs): Add mfwrap and mflib. + * gcse.c (want_to_gcse_p, gcse_constant_p): Don't handle + CONSTANT_RTX_P. + (reg_used_on_edge, reg_killed_on_edge, bypass_block): + Update to match insns field in struct edge_def. + * gdbinit.in (pgs, pge): Define. + * genattrtab.c (ATTR_PERMANENT_P): Use the return_val flag + instead of the integrated flag. + * gengtype-lex.l (IWOrD): Add HOST_WIDEST_INT + * gengtype-yacc.y (bitfieldlen): Add empty action. + (struct_fields): Accept unnamed bitfields. + (bitfieldlen): Split from ... + (bitfieldopt): ... here. + * gengtype.c (ifiles): Add tree-alias-type.h and + tree-flow.h. + * genrecog.c (validate_pattern): Do not handle + CONSTANT_P_RTX. + * gimple-low.c: New file. + * gimplify.c: New file. + * haifa-sched.c (priority): Do not handle CONSTANT_P_RTX. + (restore_line_notes): Do not set RTX_INTEGRATED_P. + * ifcvt.c (dead_or_predicable): Initialize local variable + 'earliest'. + * input.h (expr_wfl_stack): Remove. + * integrate.c (INTEGRATE_THRESHOLD): Remove. + (setup_initial_hard_reg_value_integration): Likewise. + (initialize_for_inline): Likewise. + (note_modified_parmregs): Likewise. + (integrate_parm_decls): Likewise. + (process_reg_param): Likewise. + (save_parm_insns): Likewise. + (copy_insn_list): Likewise. + (copy_insn_notes): Likewise. + (compare_blocks): Likewise. + (find_block): Likewise. + (inlining): Likewise. + (function_cannot_inline_p): Likewise. + (parmdecl_map): Likewise. + (in_nonparam_insns): Likewise. + (save_for_inline): Likewise. + (FIXED_BASE_PLUS): Likewise. + (expand_inline_function): Likewise. + (copy_rtx_and_substitute): Don't look at map->integrating, + map->inline_target, and inlining, since we are never copying + for integrating. + Don't abort on RTX_INTEGRATED_P. + (old_fun): Remove. + (output_inline_function): Remove. + * integrate.h (struct inline_map): Remove fields integrating, + block_map, leaf_reg_map, inline_target, and local_return_label. + * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test, + copy_loop_headers, never_reached_warning): Removed. + (any_uncondjump_p): Reject nonlocal goto. + * langhooks-def.h (lhd_types_compatible_p, + lhd_expand_decl, lhd_gimplify_expr): Declare. + (LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_TYPES_COMPATIBLE_P, + LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, + LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, + LANG_HOOKS_GIMPLIFY_EXPR, + LANG_HOOKS_GIMPLE_BEFORE_INLINING, + LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_TYPES_COMPATIBLE_P, + LANG_HOOKS_GIMPLIFY_EXPR, + LANG_HOOKS_GIMPLE_BEFORE_INLINING): Define. + (LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_START, + LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END, + LANG_HOOKS_FUNCTION_LEAVE_NESTED, + LANG_HOOKS_RTL_EXPAND_INITIALIZER, + LANG_HOOKS_DECL_UNINIT, + LANG_HOOKS_RTL_EXPAND_INITIALIZER): Remove. + * langhooks.c: Include tree-simple.h. + (lhd_expand_decl): New. + (lhd_types_compatible_p): New. + (lhd_decl_uninit): Remove. + (lhd_gimplify_expr): New. + * langhooks.h (struct lang_hooks_for_rtl_expansion): + Remove. + (struct lang_hooks_for_functions): Add field + missing_noreturn_ok_p. + (struct lang_hooks): Add field expand_decl, + types_compatible_p, gimplify_expr and + gimple_before_inlining. + Remove fields decl_uninit and rtl_expand + * opts.c (decode_options): Set flag_tree_ccp, + flag_tree_dce, flag_tree_dom, flag_tree_dse, + flag_tree_pre, flag_tree_ter, + flag_tree_live_range_split, flag_tree_sra, + flag_tree_copyrename and flag_tree_ch at -O1 and higher. + (common_handle_option): Handle OPT_fdump_, OPT_fmudflap, + OPT_fmudflapth, OPT_fmudflapir, + OPT_ftree_based_profiling, OPT_ftree_ccp, OPT_ftree_dce, + OPT_ftree_combine_temps, OPT_ftree_ter, OPT_ftree_lrs, + OPT_ftree_dominator_opts, OPT_ftree_copyrename, + OPT_ftree_ch, OPT_ftree_dse, OPT_ftree_sra, + OPT_ftree_points_to_ and OPT_ftree_pre. + * output.h (regno_uninitialized, find_basic_blocks, + cleanup_cfg, delete_unreachable_blocks, + check_function_return_warnings): Remove. + * params.def (PARAM_MAX_INLINE_INSNS_RECURSIVE, + PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO, + PARAM_MAX_INLINE_RECURSIVE_DEPTH, + PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO, + PARAM_GLOBAL_VAR_THRESHOLD, PARAM_MAX_ALIASED_VOPS): + * params.h (GLOBAL_VAR_THRESHOLD, MAX_ALIASED_VOPS): + Define. + * passes.c (rest_of_decl_compilation): + (rest_of_handle_sibling_calls): Remove. + (rest_of_handle_inlining): Remove. + (rest_of_handle_gcse): Do not run + purge_builtin_constant_p. + (rest_of_compilation): Update. + Do not call copy_loop_headers. + Do rtl-based profiling only when + !flag_tree_based_profiling. Register rtl-based profiling + hooks. + * predict.c: Include tree-flow.h, ggc.h, tree-dump.h + (predicted_by_p): Rename to ... + (rtl_predicted_by_p): .. this one; make global + (tree_predicted_by_p): New. + (dump_prediction): Add FILE argument. + (predict_edge): Rename to ... + (rtl_predict_edge): .. this one. + (tree_predict_edge): New. + (combine_predictions_for_insn): Update calls of predict_edge. + (predict_loops): Break out from ... + (estimate_probability): ... here; update comments; move updating + of unknown probabilities from ... + (estimate_bb_frequencies): ... here. + (combine_predictions_for_bb): New. + (tree_predict_by_opcode): New. + (tree_estimate_probability): New. + * predict.def (PRED_TREE_POINTER, PRED_TREE_OPCODE_POSITIVE, + PRED_TREE_OPCODE_NONEQUAL, PRED_TREE_FPOPCODE): New predictors. + * predict.h: Add include guard. + (predict_edge, predict_edge_def): Move prototypes to basic_block.h + * pretty-print.c (pp_write_text_to_stream): Make extern. + * pretty-print.h (pp_write_text_to_stream): Declare. + * print-rtl.c (print_rtx): Don't print the integrated flag. + Print the return_val flag. + * print-tree.c: Use TREE_FILENAME and TREE_LINENO instead + of DECL_SOURCE_FILE and DECL_SOURCE_LINE respectively. + Remove support for EXPR_WITH_FILE_LOCATION nodes. + (print_node): Print TREE_INVARIANT and TREE_VISITED. + * profile.c: Include cfghooks.h, tree-flow.h. + (profile_hooks): New. + (profile_dump_file): New. + (instrument_edges): Use hooks instead of RTL-specific code. + (instrument_values): Ditto. + (get_exec_counts): Ditto. + (compute_branch_probabilities): Ditto. + (compute_value_histograms): Ditto. + (branch_prob): Ditto. + (find_spanning_tree): Ditto. + (end_branch_prob): Ditto. + (gen_edge_profiler): Move to rtl-profile.c (rtl_gen_edge_profiler). + (gen_interval_profiler): Ditto (rtl_gen_interval_profiler). + (gen_pow2_profiler): Ditto (rtl_gen_pow2_profiler). + (gen_one_value_profiler): Ditto (rtl_gen_one_value_profiler). + (tree_register_profile_hooks): New. + (rtl_register_profile_hooks): New. + * ra-rewrite.c (rewrite_program): Clear variable info. + * recog.c (immediate_operand): Do not handle CONSTANT_P_RTX. + * regs.h: Add include guards. + * reload.c (decompose): Clear val using memset. + * rtl.def (CONSTANT_P_RTX): Remove. + * rtl.h (CONSTANT_P): Do not handle CONSTANT_P_RTX. + (copy_loop_headers): Remove. + (struct rtx_def): Replace the integrated flag with the + return_val flag. + (maybe_set_first_label_num): Declare. + (init_branch_prob): Move declaration to value-prof.h. + (end_branch_prob): Ditto. + (branch_prob): Ditto. + (never_reached_warning): Don't declare it. + * rtlanal.c (get_related_value): Initialize get_jump_table_offset + (hoist_insn_to_edge): Update to match field insns in + struct edge_def. + * sbitmap.c (sbitmap_realloc): New. + * sbitmap.h (sbitmap_realloc): Declare. + * sibcall.c: Remove file. + * simplify-rtx.c (simplify_rtx): Do not handle + CONSTANT_P_RTX. + * stmt.c (parse_output_constraint): Don't warn for read-write + memory operand. + (tail_recursion_args): Use types_compatible_p langhook. + (force_label_rtx): Don't look at inline_function_decl. + (label_rtx): Set LABEL_PRESERVE_P appropriately. + (expand_label): Handle DECL_NONLOCAL and FORCED_LABEL. + (declare_nonlocal_label): Remove. + (expand_goto): Don't handle nonlocal gotos. + (expand_nl_handler_label): Remove. + (expand_nl_goto_receivers): Remove. + (expand_end_bindings): Don't expand_nl_goto_receivers. Use + update_nonlocal_goto_save_area. + (expand_expr_stmt_value): Check TREE_NO_WARNING. + (warn_if_unused_value): Likewise. + (expand_start_loop, expand_loop_continue_here, + expand_end_loop): Don't create loop notes. + (all_cases_count, BITARRAY_TEST, BITARRAY_SET, + mark_seen_cases, check_for_full_enumeration_handling): Remove. + (expand_end_case_type): Don't do warn_switch handling. + (pushcase, pushcase_range) Update add_case_node calls. + (add_case_node): Add dont_expand_label argument. + (same_case_target_p): Don't search rtl. + (expand_start_bindings_and_block, expand_end_bindings): + Don't emit block notes when dont_emit_block_notes. + (using_eh_for_cleanups_p): Export. + (expand_return): Allow any typed rhs. + (expand_stack_alloc): New. + (expand_stack_save, expand_stack_restore): New. + (containing_blocks_have_cleanups_or_stack_level): New + function. + (asm_op_is_mem_input): New fn. + (expand_asm_expr): New fn. + (warn_if_unused_value): Check operand 0 of SAVE_EXPR + nodes. + * stor-layout.c (layout_type): Just return if type is + error_mark_node. + (update_alignment_for_field): Export. + (variable_size): We don't care about global_bindings_p if + the frontend doesn't want a list of the expressions. + * system.h: Poison INTEGRATE_THRESHOLD. + * timevar.def (TV_TREE_GIMPLIFY, TV_TREE_EH, TV_TREE_CFG, + TV_TREE_CLEANUP_CFG, TV_TREE_PTA, TV_TREE_MAY_ALIAS, + TV_TREE_INSERT_PHI_NODES, TV_TREE_SSA_REWRITE_BLOCKS, + TV_TREE_SSA_OTHER, TV_TREE_OPS, + TV_TREE_SSA_DOMINATOR_OPTS, TV_TREE_SRA, TV_TREE_CCP, + TV_TREE_SPLIT_EDGES, TV_TREE_PRE, TV_TREE_PHIOPT, + TV_TREE_FORWPROP, TV_TREE_DCE, TV_TREE_CD_DCE, + TV_TREE_DSE, TV_TREE_LOOP, TV_TREE_CH, + TV_TREE_SSA_TO_NORMAL, TV_TREE_SSA_TO_NORMAL, + TV_TREE_NRV, TV_TREE_COPY_RENAME, TV_TREE_SSA_VERIFY, + TV_TREE_STMT_VERIFY, TV_DOM_FRONTIERS, + TV_CONTROL_DEPENDENCES): Define. + * toplev.c: Include tree-alias-common.h + (current_file_decl, flag_mudflap, flag_mudflap_threads, + flag_mudflap_ignore_reads, flag_tree_based_profiling, + flag_tree_gvn, flag_tree_points_to, flag_tree_ccp, + flag_tree_dce, flag_tree_ch, flag_tree_sra, + flag_tree_combine_temps, flag_tree_ter, + flag_tree_live_range_split, flag_tree_dom, + flag_tree_copyrename, flag_tree_dse): Declare. + (f_options): Add tree-based-profiling, tree-gvn, + tree-pre, tree-ccp, tree-dce, + tree-dominator-opts, tree-copyrename, tree-dse, + tree-combine-temps, tree-ter, tree-lrs and tree-ch. + (wrapup_global_declarations): Don't output nested inlined functions. + (general_init): Call init_tree_optimization_passes. + (process_options): Sorry for -ftree-based-profiling plus + -ftest-coverage or -fprofile-values. + * toplev.h (init_tree_optimization_passes, + flag_tree_based_profiling): Declare. + * tracer.c (tail_duplicate): Use cfghooks for bb duplication. + * tree-alias-ander.c: New file. + * tree-alias-ander.h: New file. + * tree-alias-common.c: New file. + * tree-alias-common.h: New file. + * tree-alias-type.c: New file. + * tree-alias-type.h: New file. + * tree-browser.c: New file. + * tree-browser.def: New file. + * tree-cfg.c: New file. + * tree-complex.c: New file. + * tree-dfa.c: New file. + * tree-dump.c (dump_enable_all): New. + (dequeue_and_dump): Do not handle EXPR_WITH_FILE_LOCATION. + (dump_node): Remove const from field suffix and swtch. + (dump_files): Add null entry, .generic, .nested, .vcg, + .xml and a match-all entry. + (extra_dump_files, extra_dump_files_in_use, + extra_dump_files_alloced): Declare + (dump_option_value_info): Add raw, details, stats, + blocks, vops, lineno, uid and all. + (dump_register): New. + (get_dump_file_info): New. + (dump_begin): Call it. + Do nothing for TDI_none. + (dump_begin): Include phase number in dump filename. + (dump_enable_all): New. + (dump_switch_p_1): Split out from dump_switch_p. + (dump_switch_p): Handle extra_dump_files. + Start our scan at TDI_none + 1. + If -fdump-tree-all was given, call dump_enable_all. + * tree-dump.h: Include splay-tree.h. + (dump_function, dump_function_to_file, dump_register): + Declare. + * tree-eh.c: New file. + * tree-flow-inline.h: New file. + * tree-flow.h: New file. + * tree-inline.c: Re-write to handle inlining on GIMPLE. + * tree-inline.h (walk_tree, + walk_tree_without_duplicates): Move to tree.h. + (estimate_num_insns): Declare. + * tree-into-ssa.c: New file. + * tree-iterator.c: New file. + * tree-iterator.h: New file. + * tree-mudflap.c: New file. + * tree-mudflap.h: New file. + * tree-nested.c: New file. + * tree-nomudflap.c: New file. + * tree-nrv.c: New file. + * tree-optimize.c (dump_flags, vars_to_rename, + in_gimple_form, all_passes, pass_gimple, + pass_rebuild_bind, pass_all_optimizations, pass_del_cfg): Declare. + (execute_gimple, execute_rebuild_bind, + gate_all_optimizations, execute_del_cfg, + register_one_dump_file, register_dump_files, dup_pass_1, + init_tree_optimization_passes, execute_todo, + execute_one_pass, execute_pass_list): New. + (clear_decl_rtl): Remove. + (tree_rest_of_compilation): Update to use tree + optimizers. + * tree-outof-ssa.c: New file. + * tree-pass.h: New file. + * tree-phinodes.c: New file. + * tree-pretty-print.c: New file. + * tree-profile.c: New file. + * tree-simple.c: New file. + * tree-simple.h: New file. + * tree-sra.c: New file. + * tree-ssa-alias.c: New file. + * tree-ssa-ccp.c: New file. + * tree-ssa-copy.c: New file. + * tree-ssa-copyrename.c: New file. + * tree-ssa-dce.c: New file. + * tree-ssa-dom.c: New file. + * tree-ssa-dse.c: New file. + * tree-ssa-forwprop.c: New file. + * tree-ssa-live.c: New file. + * tree-ssa-live.h: New file. + * tree-ssa-loop.c: New file. + * tree-ssa-operands.c: New file. + * tree-ssa-operands.h: New file. + * tree-ssa-phiopt.c: New file. + * tree-ssa-pre.c: New file. + * tree-ssa.c: New file. + * tree-ssanames.c: New file. + * tree-tailcall.c: New file. + * tree.c: Include tree-iterator.h, basic-block.h and + tree-flow.h. + (tree_node_kind): Add phi_nodes and ssa names. + (tree_size): Handle PHI_NODE, EPHI_NODE, SSA_NAME, + EUSE_NODE, EKILL_NODE, EEXIT_NODE and STATEMENT_LIST. + (make_node_stat): Handle PHI_NODE and SSA_NAME. + <'c'> Set TREE_INVARIANT. + (copy_node_stat): Abort if trying to copy a + STATEMENT_LIST. + Clear TREE_VISITED. + Clear annotation field. + (build_constructor): Copy TREE_INVARIANT from vals. + Don't clear TREE_CONSTANT. + (expr_first, expr_last, expr_length): Remove. + (staticp): Pass unknown component references to the language. + (save_expr): Check TREE_INVARIANT instead of TREE_CONSTANT. + (skip_simple_arithmetic): Likewise. + (stabilize_reference_1): Likewise. + (tree_node_structure): Handle PHI_NODE, EPHI_NODE, + EUSE_NODE, EKILL_NODE, EEXIT_NODE, SSA_NAME and + STATEMENT_LIST. + (lhd_unsave_expr_now): Remove. + (unsafe_for_reeval): Handle LABEL_EXPR and BIND_EXPR. + (recompute_tree_invarant_for_addr_expr): New. + (build1_stat): Clear EXPR_LOCUS and TREE_BLOCK. + Call recompute_tree_invarant_for_addr_expr. + Set TREE_INVARIANT accordingly. + (build2_stat): Don't handle CALL_EXPR. + (build3_stat): Don't call build2_stat for CALL_EXPRs. + (build_expr_wfl): Remove. + (annotate_with_file_line, annotate_with_locus): New. + (simple_cst_equal): Call simple_cst_list_equal to compare + CONSTRUCTOR_ELTS pointers. + (iterative_hash_expr): Don't hash types associated + with conversions. Instead hash on the signedness of the + toplevel object and the operand of the conversion. + (dump_tree_statistics): Call ssanames_print_statistics + and phinodes_print_statistics. + (ephi_node_elt_check_failed, phi_node_elt_check_failed, + add_var_to_bind_expr, build_empty_stmt, is_essa_node, + needs_to_live_in_memory): New. + (initializer_zerop): Handle VECTOR_CST. Don't check + AGGREGATE_TYPE_P for CONSTRUCTOR. + * tree.def (FILTER_EXPR, CASE_LABEL_EXPR, RESX_EXPR, + SSA_NAME, EUSE_NODE, EKILL_NODE, EPHI_NODE, EEXIT_NODE, + PHI_NODE, CATCH_EXPR, EH_FILTER_EXPR, STATEMENT_LIST): Define. + (GOTO_SUBROUTINE_EXPR): Change type to 's'. + (CALL_EXPR): Add another operand. + (EXPR_WITH_FILE_LOCATION): Remove. + (SWITCH_EXPR): Add another operand. + * tree.h: Update various comments. + (union tree_ann_d): Forward declare. + (struct tree_common): Add fields nowarning_flag, + invariant_flag and visited. + (EREF_NODE_CHECK, EPHI_NODE_ELT_CHECK, + PHI_NODE_ELT_CHECK, EREF_NODE_CHECK, PHI_NODE_ELT_CHECK, + EPHI_NODE_ELT_CHECK, TREE_BLOCK, + STRIP_USELESS_TYPE_CONVERSION, CALL_EXPR_TAILCALL, + TREE_NO_WARNING, FORCED_LABEL, TREE_INVARIANT, + IS_EMPTY_STMT, EXPR_LOCUS, SET_EXPR_LOCUS, EXPR_FILENAME, + EXPR_LINENO, EXPR_LOCATION, EXPR_HAS_LOCATION, + EXIT_EXPR_COND, SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, + CASE_LOW, CASE_HIGH, CASE_LABEL, BIND_EXPR_VARS, + BIND_EXPR_BODY, BIND_EXPR_BLOCK, GOTO_DESTINATION, + ASM_STRING, ASM_OUTPUTS, ASM_INPUTS, ASM_CLOBBERS, + ASM_INPUT_P, ASM_VOLATILE_P, COND_EXPR_COND, + COND_EXPR_THEN, COND_EXPR_ELSE, LABEL_EXPR_LABEL, + CATCH_TYPES, CATCH_BODY, EH_FILTER_TYPES, + EH_FILTER_FAILURE, EH_FILTER_MUST_NOT_THROW, + SSA_NAME_VAR, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, + SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_IN_FREE_LIST, + PHI_RESULT, PHI_REWRITTEN, PHI_NUM_ARGS, + PHI_ARG_CAPACITY, PHI_ARG_ELT, PHI_ARG_EDGE, PHI_ARG_DEF, + EREF_PROCESSED, EREF_ID, EREF_NAME, EREF_STMT, + EREF_RELOAD, EREF_SAVE, EREF_CLASS, EREF_INJURED, + EREF_TEMP, EUSE_DEF, EUSE_PHIOP, EUSE_INSERTED, + EUSE_LVAL, EPHI_NUM_ARGS, EPHI_ARG_CAPACITY, + EPHI_ARG_ELT, EPHI_ARG_EDGE, EPHI_ARG_PRED, EPHI_ARG_DEF, + EPHI_ARG_INJURED, EPHI_ARG_DELAYED_RENAME, + EPHI_ARG_HAS_REAL_USE, EPHI_ARG_STOPS, + EPHI_ARG_PROCESSED2, EPHI_IDENTITY, EPHI_IDENT_INJURED, + EPHI_REP_OCCUR_KNOWN, EPHI_IDENTICAL_TO, EPHI_DOWNSAFE, + EPHI_CANT_BE_AVAIL, EPHI_DEAD, EPHI_USES, EPHI_STOPS, + TREE_VISITED, SSA_VAR_P, DECL_NUM_STMTS, + DECL_HARD_REGISTER, DECL_PTA_ALIASVAR, LABEL_DECL_UID, + DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL, + STATEMENT_LIST_HEAD, STATEMENT_LIST_TAIL, TDF_RAW, + TDF_DETAILS, TDF_STATS, TDF_BLOCKS, TDF_VOPS, TDF_LINENO, + TDF_UID,): Define. + (TREE_NO_UNUSED_WARNING, EXPR_WFL_EMIT_LINE_NOTE, + EXPR_WFL_NODE, EXPR_WFL_FILENAME_NODE, EXPR_WFL_FILENAME, + EXPR_WFL_LINECOL, EXPR_WFL_LINENO, EXPR_WFL_COLNO, + EXPR_WFL_SET_LINECOL): Remove. + (phi_node_elt_check_failed, ephi_node_elt_check_failed, + make_phi_node, init_phinodes, fini_phinodes, + release_phi_node, phinodes_print_statistics, + init_ssanames, fini_ssanames, make_ssa_name, + release_ssa_name, ssanames_print_statistics, + annotate_with_file_line, build_empty_stmt, + annotate_with_locus, expr_only, categorize_ctor_elements, + count_type_elements, add_var_to_bind_expr, is_essa_node, + expand_stack_alloc, expand_stack_save, + expand_stack_restore, add_case_node, operand_equal_p, + nondestructive_fold_unary_to_constant, + nondestructive_fold_binary_to_constant, + fold_read_from_constant_string, int_const_binop, + strip_float_extensions, simplify_builtin, c_strlen, + recompute_tree_invarant_for_addr_expr, + needs_to_live_in_memory, make_vector, + setjmp_vars_warning, update_alignment_for_field, + expand_asm_expr, asm_op_is_mem_input, + containing_blocks_have_cleanups_or_stack_level, + create_artificial_label, gimplify_function_tree, + get_name, unshare_expr, walk_tree, + walk_tree_without_duplicates, in_gimple_form): Declare. + (struct tree_exp): Add fields locus and block. + (struct tree_ssa_name, struct edge_def, struct + tree_phi_node, struct tree_eref_common, struct + tree_euse_node, struct ephi_arg_d, struct tree_ephi_node, + union alias_var_def, struct tree_statement_list_node, + struct tree_statement_list, enum operand_equal_flag): Declare. + (enum tree_node_structure_enum): Add TS_SSA_NAME, + TS_PHI_NODE, TS_EPHI_NODE, TS_EUSE_NODE, TS_EREF_NODE, + TS_STATEMENT_LIST. + (union tree_node): Add fields ssa_name, phi, eref, ephi, + euse and stmt_list. + (function_cannot_inline_p, uninitialized_vars_warning, + save_for_inline, output_inline_function, all_cases_count, + check_for_full_enumeration_handling, + declare_nonlocal_label): Remove. + (enum tree_dump_index): Add TDI_none, TDI_tu, + TDI_generic, TDI_nested, TDI_vcg, TDI_xml. + * unroll.c (unroll_loop): Don't clear map->inline_target. + * unwind-sjlj.c (uw_install_context): Make a proper static inline + function. + * value-prof.c (value_prof_hooks): New. + (find_values_to_profile): Rename to rtl_find_values_to_profile. + Move rtl-specific bits in from branch_prob. + (value_profile_transformations): Rename to + rtl_value_profile_transformations. + (struct value_prof_hooks): New. + (rtl_value_prof_hooks): New. + (rtl_register_value_prof_hooks): New. + (tree_find_values_to_profile): New stub. + (tree_value_profile_transformations): New stub. + (tree_value_prof_hooks): New stub. + (tree_register_value_prof_hooks): New stub. + (find_values_to_profile): New. + (value_profile_transformations): New. + * value-prof.h: Add multiple inclusion guard. + (struct histogram_value): Change rtx fields to void *. + (rtl_register_value_prof_hooks): New declaration. + (tree_register_value_prof_hooks): New declaration. + (find_values_to_profile): New declaration. + (free_profiled_values): New declaration. + (value_profile_transformations): New declaration. + (struct profile_hooks): New declaration. + (init_branch_prob): Declaration moved from rtl.h. + (branch_prob): Declaration moved from rtl.h. + (end_branch_prob): Declaration mooved from rtl.h. + (tree_register_profile_hooks): New declaration. + (rtl_register_profile_hooks): New declaration. + (tree_profile_hooks): New declaration. + (rtl_profile_hooks): New declaration. + * varasm.c: Include tree-mudflap.h. + (TRAMPOLINE_ALIGNMENT): Remove. + (make_decl_rtl): Call mudflap_enqueue_decl. + (assemble_static_space): + (assemble_trampoline_template): Set and return + TRAMPOLINE_ALIGNMENT. + * varray.c (element): Add GENERIC_PTR_NOGC entry. + Add entry for 'tree *'. + Add entry for struct edge_def *. + (varray_copy): New. + * varray.h (enum varray_data_enum): Add + VARRAY_DATA_GENERIC_NOGC, VARRAY_DATA_EDGE and + VARRAY_DATA_TREE_PTR. + (union varray_data_tag): Corresponding changes. + (VARRAY_GENERIC_PTR_NOGC_INIT, VARRAY_EDGE_INIT, + VARRAY_TREE_PTR_INIT, VARRAY_GENERIC_PTR_NOGC, + VARRAY_EDGE, VARRAY_TREE_PTR, + VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_PUSH_EDGE, + VARRAY_PUSH_TREE_PTR, VARRAY_TOP_GENERIC_PTR_NOGC, + VARRAY_TOP_EDGE, VARRAY_TOP_TREE_PTR): Define. + + * config/*/*: Various updates for changed macros, tree + codes, etc. Check ChangeLog.tree-ssa. + + * doc/cfg.texi: New file. + * doc/tree-ssa.texi: New file. + * doc/c-tree.texi: Document new codes. + * doc/gccint.texi: Include new files. + * doc/install.texi: Document new features. + * doc/invoke.texi: Document new switches. + * doc/passes.texi: Document new passes. + * doc/rtl.texi: Update changed RTL codes. + * doc/sourcebuild.texi: Update build instructions. + * doc/standards.texi: Document Fortran changes. + * doc/tm.texi: Update. + +2004-05-12 Paolo Bonzini + + Replace several arrays with a struct of arrays. + * combine.c (struct reg_stat): New. + (init_reg_last_arrays): Renamed to... + (init_reg_last): ...this. Callers adjusted. + (reg_stat): New. + (combine_instructions): Allocate it and use it. + (reg_last_death, reg_last_set, reg_last_set_value, + reg_last_set_label, reg_last_set_table_tick, + reg_last_set_invalid, reg_nonzero_bits, reg_sign_bit_copies, + reg_last_set_mode, reg_last_set_nonzero_bits, + reg_last_set_sign_bit_copies): Replace throughout + with items of reg_stat. + +2004-05-11 Kaz Kojima + + PR optimization/15100 + * combine.c (distribute_notes): Don't create a dangling + REG_LIBCALL/REG_RETVAL note. + +2004-05-11 Aldy Hernandez + + * config/rs6000/spe.md (spe_evneg): Rename to negv2si2. + + * config/rs6000/rs6000.c (bdesc_1arg): Change spe_evneg to + negv2si2. + +2004-05-11 Aldy Hernandez + + * doc/md.texi (Standard Names): Fix typo in vec_init description. + +2004-05-11 Geoffrey Keating + + * doc/gty.texi (GTY Options): Clarify example. + +2004-05-11 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): + Add const qualifier to altivec vector type if one is needed. + +2004-05-11 Paul Brook + + * flags.h (flag_short_enums): Update comment. + * opts.c (decode_options): Set flag_short_enums to 2. + * toplev.c (flag_short_enums): Update comment. + (process_options): Call default_short_enums target hook. + +2004-05-11 Andrew Pinski + + PR target/14063 + * config/rs6000/altivec.md (altivec_dssall): + Change to unspec_volatile. + (altivec_dss): Likewise. + +2004-05-10 Aldy Hernandez + + * config/rs6000/altivec.md ("one_cmplv16qi2"): Change vnot to + vnor. + ("one_cmplv8hi2"): Same. + ("one_cmplv4si2"): Same. + +2004-05-10 Kaz Kojima + + PR target/15130 + * config/sh/sh-protos.h (sh_expand_epilogue): Change prototype. + * config/sh/sh.c (output_stack_adjust): Take the sibcall epilogue + into account. Compute the correct number of general registers + for the return value. Generate a special push/pop sequence when + failing to get a temporary register for non SHmedia epilogue. + (sh_expand_epilogue): Add an argument to show whether it's for + sibcall or not. Set the 3rd argument of output_stack_adjust to + -1 if needed. + (sh_need_epilogue): Call sh_expand_epilogue with 0. + * config/sh/sh.md (sibcall_epilogue): Call sh_expand_epilogue + with 1. + (epilogue): Call sh_expand_epilogue with 0. + +2004-05-10 Andrew Pinski + + * gcse.c (eliminate_partially_redundant_loads): Instead of returning early, + goto a cleanup label. After the cleanup, free the allocated memory. + +2004-05-10 Ziemowit Laski + + * config/rs6000/altivec.h (vec_sld): Add overloads for + argument/return types of 'vector bool int', 'vector bool short' + and 'vector bool char'. + +2004-05-10 Zack Weinberg + + * c-decl.c (store_parm_decls_newstyle): Correct test for a + nested function. + +2004-05-10 Richard Sandiford + + * read-rtl.c (read_rtx): Allow 's' and 'T' strings to be omitted, + treating missing ones as "". + * config/mips/mips.md: Remove constraints from match_operands and + match_scratches if they appear in define_expands (except reload*), + define_peephole2s, define_splits or attribute specifications. + * config/mips/7000.md, config/mips/sb1.md: Remove match_operand + constraint strings. + +2004-05-10 Alan Modra + + * config/rs6000/rs6000.c (function_arg_boundary): Always align + AltiVec vectors. + (function_arg_advance): Pass TARGET_32BIT -mabi=no-altivec AltiVec + vectors by refererence. Align the same for TARGET_64BIT to a 16 + byte boundary. Remove useless code. Add function comment. + (function_arg): Similarly. Move gpr rs6000_mixed_function_arg + call to where it belongs. + (function_arg_partial_nregs): Return true for all TARGET_32BIT + -mabi=no-altivec AltiVec vectors. Fix debug output. + (rs6000_va_arg): Adjust for AltiVec change. + +2004-05-10 Paul Brook + + * config/arm/arm.c (arm_promote_prototypes): Use TARGET_AAPCS_BASED. + * config/arm/arm.h (TARGET_AAPCS_BASED): Define. + (TARGET_DOUBLEWORD_ALIGN): Use it. + (WCHAR_TYPE): Define. + (WCHAR_SIZE_TYPE): Define. + (SIZE_TYPE): Define. + +2004-05-10 Alan Modra + + * config/rs6000/rs6000.c (function_arg_boundary): Align for ABI_V4 + when size is 8 bytes. + (function_arg_advance): Account for stack space used by AltiVec + args when -mabi=altivec. Simplify alignment calculations. For + ABI_V4, pass AltiVec vectors by reference when -mabi=no-altivec. + (function_arg): Similarly. + (function_arg_pass_by_reference): True for ABI_V4 AltiVec when + not AltiVec ABI. + (rs6000_va_arg): Correct fp arg test. Adjust for AltiVec change. + Correct alignment, and align before testing reg count. Remove + TREE_THIS_VOLATILE from reg. Don't emit unused labels. + (rs6000_complex_function_value): Check TARGET_HARD_FLOAT and + TARGET_FPRS here.. + (rs6000_function_value): .. not here before call. + +2004-05-09 Aldy Hernandez + + * config/rs6000/spe.md ("tstsflt_gpr"): Fix typo in unspec. + +2004-05-09 Zack Weinberg + + PR 15007 + * c-decl.c (current_file_decl): Rename to all_translation_units, + adjust comment. + (pop_scope): If popping file_scope, construct a + TRANSLATION_UNIT_DECL and make it the context of all the + symbols in the scope. + (push_file_scope): Don't construct a TRANSLATION_UNIT_DECL here. + (pushdecl): Clarify comment. Do not set DECL_CONTEXT of + anything to current_file_decl. + (pushdecl_top_level): Likewise. + (store_parm_decls_newstyle): Adjust check for nested function. + (c_write_global_declarations): Update for renamed variable. + +2004-05-09 Aldy Hernandez + + * config/rs6000/rs6000-protos.h + (rs6000_conditional_register_usage): Protoize. + + * config/rs6000/rs6000.c (rs6000_conditional_register_usage): New. + + * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Call + function. + +2004-05-08 Roger Sayle + + * fold-const.c (fold_div_compare): New function to optimize X/C1 op C2 + where op is a comparison operator and C1 and C2 are integer constants + into a range check. + (fold): Call fold_div_compare. + +2004-05-08 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Document bootstrap + problems with earlier versions of the GNU compiler. + +2004-05-07 Aldy Hernandez + + * config/rs6000/rs6000-protos.h (rs6000_hard_regno_mode_ok_p): + Declare. + + * config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok_p): New. + (rs6000_hard_regno_mode_ok): New. + (rs6000_init_hard_regno_mode_ok): New. + (rs6000_override_options): Call rs6000_init_hard_regno_mode_ok. + + * config/rs6000/rs6000.h (HARD_REGNO_NREGS): Use precomputed + result. + +2004-05-07 Ziemowit Laski + + * config/rs6000/altivec.h (vector, pixel, bool): Do not + define as macros #ifdef __APPLE_ALTIVEC__. + +2004-05-07 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): + Generate appropriate parallels for vector arguments + passed to vararg functions. (function_arg): make the call + to rs6000_mixed_function_arg for vector args as needed. + +2004-05-07 Richard Sandiford + + * config/mips/mips.c (mips_va_arg): Fix calculation of osize for + EABI_FLOAT_VARARGS_P. + +2004-05-07 Richard Sandiford + + * config/mips/mips.h (ISA_HAS_BRANCHLIKELY): Remove TARGET_MIPS5500. + * config/mips/mips.c (override_options): Disable branch likely + instructions if TUNE_MIPS5500. + +2004-05-07 Richard Sandiford + + * config/mips/mips.c (override_options): Allow the hi and lo registers + to store any integral mode, not just MODE_INTs. + +2004-05-07 Paul Brook + + * config/arm/arm.c (arm_promote_prototypes): Use TARGET_AAPCS_BASED. + * config/arm/arm.h (TARGET_AAPCS_BASED): Define. + (TARGET_DOUBLEWORD_ALIGN): Use it. + (WCHAR_TYPE): Define. + (WCHAR_SIZE_TYPE): Define. + (SIZE_TYPE): Define. + +2004-05-07 Uros Bizjak + + * config/i386/i386.c (ix86_emit_fp_unordered_jump): Use + testb $4, %ah insn instead of sahf insn if !TARGET_USE_SAHF. + +2004-05-07 Andrew Pinski + + * loop-doloop.c (doloop_valid_p): Make sure that body + gets freed. + +2004-05-07 Eric Botcazou + + * config/sparc/sparc-protos.h (sparc_skip_caller_unimp): New + declaration. + * config/sparc/sparc.c (SKIP_CALLERS_UNIMP_P): Delete. + (sparc_skip_caller_unimp): New global variable. + (sparc_function_epilogue): Set 'sparc_skip_caller_unimp'. + Use it instead of SKIP_CALLERS_UNIMP_P. + * config/sparc/sparc.md (call expander): Add sanity check. + (call_address_struct_value_sp32): Re-sync with expander. + (call_symbolic_struct_value_sp32): Likewise. + (return peepholes): Use 'sparc_skip_caller_unimp' instead + of custom predicate. + +2004-05-07 Eric Botcazou + + PR c++/14962 + * c-pragma.c (handle_pragma_redefine_extname): Only change + the assembler name of FUNCTION_DECLs and VAR_DECLs. + +2004-05-07 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_log1p. + (log1p_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize log1p_optab. + * genopinit.c (optabs): Implement log1p_optab using log1p?f2 + patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG1P{,F,L} + using log1p_optab. + (expand_builtin): Expand BUILT_IN_LOG1P{,F,L} using + expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FYL2XP1. + + * config/i386/i386.c (ix86_emit_i387_log1p): New function. + * config/i386/i386-protos.h (ix86_emit_i387_log1p): + Prototype here. + * config/i386/i386.md (UNSPEC_FYL2XP1): New unspec to represent + x87's fyl2xp1 instruction. + (*fyl2x_xf3): Rename insn definition to fyl2x_xf3. + (fyl2xp1_xf3): New pattern to implement fyl2xp1 x87 instruction. + (log1psf2, log1pdf2, log1pxf2): New expanders to implement log1pf, + log1p and log1pl built-ins as inline x87 intrinsics. + +2004-05-07 Loren James Rittle + + * config/alpha/freebsd.h (SUBTARGET_EXTRA_SPECS): Proper redefinition. + * config/arm/freebsd.h: Likewise. + * config/ia64/freebsd.h: Likewise. + * config/sparc/freebsd.h: Likewise. + +2004-05-07 Hans-Peter Nilsson + + PR optimization/15296 + * reorg.c (fill_simple_delay_slots): Use next_real_insn when + getting last consecutive label at a branch. + (relax_delay_slots): Similar, near top of loop. + +2004-05-06 John David Anglin + + PR target/15202 + * pa.md (movdi, movsi, movhi, movqi): Support move from shift amount + register to general register. + +2004-05-07 Alan Modra + + * config/rs6000/rs6000.h (STACK_BOUNDARY): Use 128 bit for either + TARGET_ALTIVEC or TARGET_ALTIVEC_ABI. + * config/rs6000/sysv4.h (ABI_STACK_BOUNDARY): Likewise. + (STACK_BOUNDARY): Delete. + +2004-05-06 Stuart Hastings + + * doc/invoke.texi: Restore -fgcse-after-reload doc from 1.421, + mistakenly clobbered by 1.423. + +2004-05-06 Richard Sandiford + + * doc/invoke.texi: Document -mvr4130-align. + * config/mips/mips.h (MASK_VR4130_ALIGN, TARGET_VR4130_ALIGN) + (TUNE_MIPS4120, TUNE_MIPS4130): New macros. + (TUNE_MACC_CHAINS): Include TUNE_MIPS4120 and TUNE_MIPS4130. + (TARGET_SWITCHES): Add -mvr4130-align and -mno-vr4130-align. + * config/mips/mips.md: Include sched-int.h. + (USEFUL_INSN_P, SEQ_BEGIN, SEQ_END, FOR_EACH_SUBINSN): New macros. + (mips_rtx_costs): Set integer multiplication costs for TUNE_MIPS4130. + (override_options): Enable -mvr4130-align at -O3 and above. + (mips_sim_insn): New variable. + (mips_sim): New structure. + (mips_sim_reset, mips_sim_init, mips_sim_next_cycle, mips_sim_wait_reg) + (mips_sim_wait_regs_2, mips_sim_wait_regs_1, mips_sim_wait_regs) + (mips_sim_wait_units, mips_sim_wait_insn, mips_sim_record_set) + (mips_sim_issue_insn, mips_sim_issue_nop, mips_sim_finish_insn) + (vr4130_avoid_branch_rt_conflict, vr4130_align_insns): New functions. + (mips_reorg): Call vr4130_align_insns. + (vr4130_last_insn): New variable. + (vr4130_true_reg_dependence_p_1, vr4130_true_reg_dependence_p) + (vr4130_swap_insns_p, vr4130_reorder): New functions. + (mips_sched_reorder, mips_variable_issue): Hook in vr4130 code. + (mips_issue_rate): Return 2 for PROCESSOR_R4130. + (mips_use_dfa_pipeline_interface): Return true for the same. + * config/mips/4130.md: New file. + * config/mips/mips.md: Include it. Add a peephole2 to convert + "mult;mflo" into "mtlo;macc". + (*macc, *umul_acc_di, *smul_acc_di): Use $1 rather than $0 as the + target of maccs. + (*msac_using_macc): New pattern. + +2004-05-06 Richard Sandiford + + * config/mips/5500.md (ir_vr55_store): Set latency to 0. + (ir_vr55_hilo): Split into... + (ir_vr55_mfhilo, ir_vr55_mthilo): ...these new reservations. + (ir_vr55_imul_si, ir_vr55_imadd): Change latency to 5. + (ir_vr55_imul_di): Change latency to 9. Reserve vr55_mac for 4 cycles. + Add various multiplication bypasses. + * config/mips/mips.c (mips_rtx_costs): Adjust VR5500 costs for integer + multiplication. + +2004-05-06 Uros Bizjak + + * config/i386/i386.md (*fscalexf4): Correct insn "mode" + attribute to "XF". + +2004-05-05 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_fmod and OTI_drem. + (fmod_optab, drem_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize fmod_optab and drem_optab. + * genopinit.c (optabs): Implement fmod_optab and drem_optab + using fmod?f3 and drem?f3 patterns. + * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_FMOD{,F,L} + using fmod_optab and BUILT_IN_DREM{,F,L} using drem_optab. + (expand_builtin): Expand BUILT_IN_FMOD{,F,L} and + BUILT_IN_DREM{,F,L} using expand_builtin_mathfn_2 if + flag_unsafe_math_optimizations is set. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_FPREM_F, + UNSPEC_FPREM_U, UNSPEC_FPREM1_F and UNSPEC_FPREM1_U. + + * config/i386/i386.c (ix86_emit_fp_unordered_jump): New function. + * config/i386/i386-protos.h (ix86_emit_fp_unordered_jump): + Prototype here. + * config/i386/i386.md (UNSPEC_FPREM_F, UNSPEC_FPREM_U, + UNSPEC_FPREM1_F, UNSPEC_FPREM1_U): New unspecs to represent x87's + fprem and fprem1 instructions. + (*x86_fnstsw_1): Change input parameter to (reg:CCFP 18). + Rename insn definition to x86_fnstsw_1. + (fpremxf4, fprem1xf4): New patterns to implement fprem and fprem1 + x87 instructions. + (fmodsf3, fmoddf3, fmodxf3): New expanders to implement fmodf, fmod + and fmodl built-ins as inline x87 intrinsics. + (dremsf3, dremdf3, dremxf3): New expanders to implement dremf, drem + and dreml built-ins as inline x87 intrinsics. + +2004-05-05 Roger Sayle + + * reload1.c (inherit_piecemeal_p): Mark parameters potentially unused. + +2004-05-05 Ian Lance Taylor + + PR driver/9822 + * doc/invoke.texi (Spec Files): Remove documentation of %c. + +2004-05-05 Chris Demetriou + + * config/mips/mips.md: Update the msub define_split for new mflo/mfhi + representation. + +2004-05-06 Paul Brook + + * config/arm/arm-protots.h (vfp_mem_operand): Rename ... + (arm_coproc_mem_operand): ... To this. + * config/arm/arm.c (arm_legitimate_address_p): Allow ldrd modes. + (arm_legitimate_index_p): Ditto. + (vfp_mem_operand): Rename ... + (arm_coproc_mem_operand): ... To this. Handle writeback modes. + (vfp_secondary_reload_class): Use it. + (output_move_double): Use doubleword load/store instructions. + (arm_hard_regno_mode_ok): Only allow even reg pairs for ldrd. + * config/arm/arm.h (TARGET_LDRD): Define. + (EXTRA_CONSTRAINT_STR_ARM): Add 'Uy'. + * config/arm/arm.md (arm_movdi): Allow all valid memory operands. + New splitter for invalid doubleword loads. + * config/arm/iwmmxt.md (iwmmxt_arm_movdi): Use Uy constraint. + * config/arm/vfp.md (arm_movdi_vfp): Allow all valid memory operands. + * doc/md.texi: Document Uy constraint. + +2004-05-05 Jan Hubicka + + PR opt/14980 + * cgraphunit.c (cgraph_remove_unreachable_nodes): Deal properly with + inline clones. + +2004-05-05 H.J. Lu + + PR target/15290 + * config/i386/i386.c (ix86_split_to_parts): Use real_to_target + instead of REAL_VALUE_TO_TARGET_LONG_DOUBLE. + +2004-05-05 Mike Stump + + * config/darwin-c.c (add_framework): Copy the directory name as it + can be freed later. Also, ensure we always allocate enough room + for the cached framework information. + (find_subframework_header): Keep track of the directory where the + subframework header was found. + (framework_construct_pathname): Speed up by not trying to re-add a + framework. + * cppfiles.c (search_path_exhausted): Arrange for the missing + header callback to be able to set the directory where the header + was found. + (cpp_get_dir): Add. + * cpplib.h (missing_header_cb): Add a parameter. + (cpp_get_dir): Add. + +2004-05-03 Mike Stump + + * doc/invoke.texi (Directory Options): Document -iquote. + * doc/cpp.texi: Likewise. + * doc/cppopts.texi: Likewise. + * c-opts.c (c_common_missing_argument): Add -iquote processing. + (c_common_handle_option): Likewise. + * c.opt (iquote): Add. + * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -iquote. + * c-incpath.c (merge_include_chains): Update comment to use -iquote. + + * c-opts.c (case OPT_I): Deprecate -I- support. + * doc/invoke.texi: Likewise. + * doc/cpp.texi: Likewise. + * doc/cppopts.texi: Likewise. + +2004-05-05 Steven Bosscher + + * basic-block.h (free_basic_block_vars): Update prototype. + * flow.c (free_basic_block_vars): Remove the keep_head_end_p + argument. + (life_analysis): Update call. + * ifcvt.c (if_convert): Likewise. + * sibcall.c (optimize_sibling_and_tail_recursive_call): Likewise. + * passes.c (rest_of_handle_final): Likewise. + (rest_of_compilation): Likewise. + * config/sh/sh.c (sh_output_mi_thunk): Likewise. + + * emit-rtl.c (next_real_insn): Use INSN_P. + (prev_real_insn): Likewise. + +2004-05-05 Eric Christopher + + * config/mips/mips.md: Update the madd define_split for new mflo/mfhi + representation. + +2004-05-05 Paolo Bonzini + + * config/rs6000/rs6000.c (build_opaque_vector_type): + New function. + (rs6000_init_builtins): Use it. + +2004-05-04 Bernard Giroud + + * vmsdbgout.c (vms_func_node, vms_func_ref): New. + (func_table): Change type from char ** to vms_func_ref. + (write_rtnbeg): Update to reflect func_table change. Use + fde->funcdef_number instead of rtnnum in output. + (write_rtnend, vmxdbgout_begin_function, vmsdbgout_init): Likewise. + +2004-05-04 Paolo Bonzini + Richard Henderson + + PR target/14899 + + * c-common.c (vector_types_convertible_p): New function. + * c-typeck.c (comptypes): Recurse on vector types. + (convert_for_assignment): Use vector_types_convertible_p. + (digest_init): Use vector_types_convertible_p to check + validness of constant vector initializers; otherwise treat + them as scalars. + * tree.c (make_or_reuse_type): New. + (build_common_tree_nodes): Use it. + * cp/call.c (standard_conversion): Likewise. + * cp/typeck.c (comptypes): Recurse on vector types. + (convert_for_assignment): Use vector_types_convertible_p. + +2004-05-04 Chris Demetriou + + * config/mips/mips.c (override_options): Default to no + generation of branch-likely operations when tuning for + CPUs where they tend to have a negative performance impact + (e.g., SB-1). + +2004-05-04 Richard Kenner + + * expr.c (store_constructor_field): Don't call store_constructor + if bitsize is not a multiple of a byte. + +2004-05-04 Richard Sandiford + + * reload1.c (inherit_piecemeal_p): New function. + (emit_reload_insns): When reloading a group of hard registers, use + inherit_piecemeal_p to decide whether the values of individual hard + registers can be inherited. + +2004-05-04 H.J. Lu + + * config/ia64/t-ia64 (LIB2ADDEH): Remove gthr-gnat.c. + * config/s390/t-tpf (LIB2ADDEHDEP): Likewise. + * config/t-linux (LIB2ADDEHDEP): Likewise. + +2004-05-04 Paul Brook + + * config/arm/crti.asm: Push an even number of registers. + * config/arm/crtn.asm: And restore them. Load via sp. + +2004-05-04 Paolo Bonzini + + * ggc-zone.c (ggc_alloc_zone_1): Add MEM_STAT_DECL parameter. + Collect overhead information. + (ggc_alloc_stat): New name of ggc_alloc. Add MEM_STAT_DECL + parameter and pass it through. + (ggc_alloc_typed_stat): New name of ggc_alloc_typed. Add + MEM_STAT_DECL parameter and pass it through. + (ggc_alloc_zone_stat): New name of ggc_alloc_zone. Add + MEM_STAT_DECL parameter and pass it through. + +2004-05-03 Aldy Hernandez + + * config/rs6000/rs6000-protos.h: Protoize rs6000_hard_regno_nregs. + + * config/rs6000/rs6000.c (rs6000_hard_regno_nregs): New. + + * config/rs6000/rs6000.h (HARD_REGNO_NREGS): Call + rs6000_hard_regno_nregs. + +2004-05-03 Eric Christopher + + * config/s390/s390.c (s390_emit_prologue): Call unspec tpf + prologue insn instead of setting up call. + (s390_emit_epilogue): Ditto. + * config/s390/s390.md (prologue_tpf, epilogue_tpf): New patterns. + (define_constants): Add numbers for above patterns. + +2004-05-03 Eric Christopher + + * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Move body... + * config/s390/s390.c (s390_conditional_register_usage): ...here. + * config/s390/s390-protos.h: Prototype. + +2004-05-03 Joe Buck + + * cppfiles.c (pchf_adder): Eliminate use of |= in d->have_once_only + assignment. + +2004-05-03 Eric Christopher + + * config/mips/mips.md: Fix branch length attribute definition. + +2004-05-03 Aldy Hernandez + + * config.gcc: Remove --enable-altivec support. + + * config/rs6000/altivec-defs.h: Remove. + +2004-05-03 Rainer Orth + + * fixinc/inclhack.def (svr4_profil): Don't apply on IRIX 5/6. + * fixinc/fixincl.x: Regenerate. + +2004-05-03 Uros Bizjak + + * config/i386/i386.md (*fyl2x_sfxf3, *fyl2x_dfxf3): Remove insn + definition. + (log?f2, log10?f2, log2?f2): Reimplement expanders with + float_truncate insn. + (*fxtractsf3, *fxtractdf3): Remove insn definition. + (logb?f2): Reimplement expanders with float_truncate insn. + +2004-05-03 Graham Stott + + PR 14718 + * dwarf2out.c (dwarf2out_imported_module_or_decl): Use + force_type_die for CONST_DECL. + +2004-05-03 Eric Botcazou + Rainer Orth + + * config.gcc (sparc64-*-solaris2*, sparcv9-*-solaris2*): Add + tm-dwarf2.h to tm_file. + (sparc-*-solaris2*): Add tm-dwarf2.h to tm_file for Solaris 7+. + * config/sparc/sol2-bi.h (PREFERRED_DEBUGGING_TYPE): Delete. + (ASM_DEBUG_SPEC): Delete. + +2004-05-03 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_expm1. + (expm1_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize expm1_optab. + * genopinit.c (optabs): Implement expm1_optab using expm1?f2 + patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXPM1{,F,L} + using expm1_optab. + (expand_builtin): Expand BUILT_IN_EXPM1{,F,L} using + expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * config/i386/i386.md (expm1df2, expm1sf2, expm1xf2): New expanders + to implement expm1, expm1f and expm1l built-ins as inline x87 + intrinsics. + +2004-05-02 Alexandre Oliva + + 2003-11-19 Richard Sandiford + * config/frv/frv.md (*return_true, *return_false): New patterns. + +2004-05-02 Kazu Hirata + + * rtl.h (PHI_NODE_P): Remove. + +2004-05-02 Eric Botcazou + + PR middle-end/14988 + * function.c (assign_stack_local_1): Use BITS_PER_UNIT alignment + when passed -2 as 'align'. + (put_var_into_stack): Use 'bool' as the type for the three local + predicates. Adjust calls to put_reg_into_stack. + When passed a CONCAT, instruct put_reg_into_stack to use + a consecutive stack slot for the second part. + (put_reg_into_stack): Remove 'promoted_mode' parameter, add + 'consecutive_p' parameter. Turn the three predicates into 'bool' + parameters. Retrieve the register mode from 'reg'. + When consecutive_p is true, instruct assign_stack_local_1 to use + BITS_PER_UNIT alignment. + (put_addressof_into_stack): Use 'bool' as the type for the two + local predicates. Adjust call to put_reg_into_stack. + +2004-05-02 Kaveh R. Ghazi + + * fold-const.c (fold_convert_const, fold): Add missing + FIX_ROUND_EXPR case. + +2004-05-02 Alexandre Oliva + + * configure.ac (FLEX, BISON): Only use tools from the build tree + if build equals host. + * configure: Rebuilt. + + * config/frv/frv-protos.h (frv_expand_epilogue, + frv_expand_fdpic_call): Add bool argument. + * config/frv/frv.c (frv_function_ok_for_sibcall): New. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Define to it. + (frv_expand_epilogue): Use new argument to decide whether to emit + return instruction or copy the return address to LR. + (frv_expand_fdpic_call): Inline PLT entry when emitting direct + sibcalls. + (sibcall_operand): New. + * config/frv/frv.h (PREDICATE_CODES): call_operand doesn't match + PLUS nor LABEL_REF. Add sibcall_operand. + * config/frv/frv.md (call, call_value): Pass false to + frv_expand_fdpic_call. + (call_fdpicdi, call_value_fdpicdi): Insert %i0 in calll. + (sibcall, sibcall_internal, sibcall_fdpicdi, sibcall_value, + sibcall_value_internal, sibcall_value_fdpicdi): New. + (return_unsigned_true, return_unsigned_false): New. + (epilogue): Adjust call to frv_expand_epilogue. + (sibcall_epilogue): New. + + * config/frv/frv.h (ASM_SPEC): Pass -mno-fdpic as -mnopic. + (CPP_SPEC, CPP_SIMPLE_SPEC): Undefine __FRV_ACC__ and __FRV_FPR__ + before redefining them. + +2004-05-01 Kaveh R. Ghazi + + * builtins.c (fold_fixed_mathfn): New function. + (fold_builtin_lround, fold_builtin): Use it. + +2004-05-01 Jakub Jelinek + + * config/sparc/linux64.h (TARGET_DEFAULT): Make 64-bit by default + also for TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3. + +2004-05-01 Kazu Hirata + + * config/cris/cris.h: Revert my "fix comment typos" patch. + +2004-05-01 Richard Sandiford + + * config/mips/mips.h (TUNE_MACC_CHAINS): Fix comment. + +2004-05-01 Falk Hueffner + + * config/alpha/alpha.md (builtin_insbl, builtin_inswl, + builtin_insll): Disallow 0 as first input operand. + +2004-05-01 Falk Hueffner + + * config/alpha/alpha.c (alpha_rtx_costs): Fix shiftadd costs. + +2004-05-01 Ulrich Weigand + + PR middle-end/15054 + * expr.c (expand_expr_real): Do not call preserve_temp_slots + on a TARGET_EXPR temp. + * function.c (assign_stack_temp_for_type): Set 'keep' flag for + TARGET_EXPR temp slots. + +2004-05-01 Paolo Bonzini + + * simplify-rtx.c (simplify_ternary_operation): When + converting an IF_THEN_ELSE to a relational op, return + correct mode. + +2004-04-30 Kaveh R. Ghazi + + * builtins.c (fold_builtin_round): Fix comment typo. + (fold_builtin_lround): New function. + (fold_builtin): Use it. + +2004-04-20 Andrew Pinski + + PR target/11608 + * config/sh/elf.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Update and make it + more like the one in config/dbxelf.h. + +2004-04-30 Zack Weinberg + + * tree.h (SET_ARRAY_OR_VECTOR_CHECK): Rename to SET_OR_ARRAY_CHECK + and adjust definition accordingly. + (TYPE_DOMAIN): Allow only SET_TYPE and ARRAY_TYPE. + (TYPE_DEBUG_REPRESENTATION_TYPE): Allow only VECTOR_TYPE. + * expr.c (store_constructor): Do not access TYPE_DOMAIN of a + VECTOR_TYPE. + +2004-04-30 Jason Merrill + + PR c++/14587 + * config/i386/winnt.c (associated_type): Look for attributes on + the TYPE_MAIN_VARIANT of *this. + * attribs.c (decl_attributes): If ATTR_FLAG_TYPE_IN_PLACE, also + apply the attributes to the variants. + +2004-04-30 Paul Brook + + * config.gcc: Simplify arm --with-{cpu,tune} test. + * config/arm/arm-cores.def: Document whitespace restrictions. + +2004-04-30 Rainer Orth + + PR other/1963 + * config/alpha/osf.h (SWITCHES_NEED_SPACES): Define. + +2004-04-30 Brian Ford + DJ Delorie + + * config/i386/cygming.h [HAVE_GAS_PE_SECREL32_RELOC] + (DWARF2_DEBUGGING_INFO): Define to enable. + (DBX_REGISTER_NUMBER): Define to use the svr4 register map for + DWARF2. + * configure.ac (Target-specific assembler checks) + : New test for .secrel32 + relocs. + * configure: Regenerate. + * config.in: Likewise. + + * config/i386/cygming.h [HAVE_GAS_PE_SECREL32_RELOC] + (ASM_OUPUT_DWARF_OFFSET): Define. + +2004-04-29 Andreas Krebbel + + * config/s390/s390-protos.h (s390_emit_epilogue): Parameter added. + (s390_emit_call): New function prototype added. + (s390_tls_get_offset): Function removed. + * config/s390/s390.c (s390_function_ok_for_sibcall, + s390_call_saved_register_used_p): New functions. + (TARGET_FUNCTION_OK_FOR_SIBCALL): Definition of target macro added. + (s390_tls_get_offset): Function merged into s390_emit_tls_call_insn. + (s390_emit_tls_call_insn): New function. + (legitimize_tls_address): Call s390_emit_tls_call_insn instead of + emit_call_insn. + (s390_emit_prologue): Use s390_emit_call instead of emit_call_insn. + (s390_emit_epilogue): Like s390_emit_prologue. Parameter for sibcalls + added. + * config/s390/s390.h (SIBCALL_REGNUM): New macro representing the + register number used to hold the target address for sibcalls. + * config/s390/s390.md ("sibcall", "sibcall_value", "sibcall_epilogue"): + New expanders. + ("*sibcall_br", "*sibcall_brc", "*sibcall_brcl", "*sibcall_value_br", + "*sibcall_value_brc", "*sibcall_value_brcl"): New insns. + ("call_exp", "call_value_exp", "call_value_tls", "call_value_tls_exp"): + Expanders removed. + ("call", "call_value"): Call s390_emit_call to emit the call patterns. + ("*bras", "*brasl", "*bras_r", "*brasl_r", "*bras_tls", "*brasl_tls", + "*basr", "*basr_r", "*basr_tls"): Added constraint: !SIBLING_CALL_P. + ("epilogue"): Changed the call to s390_emit_epilogue to use the + new parameter. + +2004-04-30 Kazu Hirata + + * bb-reorder.c, c-opts.c, cfglayout.c, cgraph.c, cgraphunit.c, + cppfiles.c, fold-const.c, ggc-zone.c, loop-doloop.c, optabs.c, + reg-stack.c, varasm.c, config/alpha/ev4.md, + config/alpha/ev5.md, config/alpha/ev6.md, config/arm/arm.c, + config/c4x/c4x.c, config/c4x/c4x.md, config/cris/cris.c, + config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.c, + config/frv/frv.h, config/frv/frv.md, config/h8300/h8300.c, + config/i386/i386.c, config/i386/i386.md, config/i386/winnt.c, + config/ia64/itanium2.md, config/ip2k/ip2k.c, + config/mips/mips.c, config/mips/mips.h, config/mips/sr71k.md, + config/pa/pa.c, config/s390/s390.c, config/sh/sh.c: Fix + comment typos. + +2004-04-30 Paul Brook + + * config.gcc: Default ep9312 to hard-float. + * config/arm/arm-cores.def: Add ARCH field. + * config/arm/arm.c (FL_FOR_ARCH*): Define. + (arm_arch_cirrus): New variable. + (all_cores): Set and use arch. + (all_architectures): Ditto. + (arm_arch_name): New variable. + (arm_override_options): Set it. Use [SUB]TARGET_CPU_DEFAULT. + Set and use arm_arch_cirrus. + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Set arch defines. + (enum processor_type): Update ARM_CORE define. + (enum target_cpus): Add. Replaces TARGET_CPU_* defines. + (CPP_SPEC): Remove %(cpp_cpu_arch). + (CPP_ARCH_DEFAULT_SPEC): Remove. + (CPP_CPU_ARCH_SPEC): Remove. + (EXTRA_SPECS): Don't use CPP_*ARCH*_SPEC. + (FPUTYPE_DEFAULT): Don't define here. + +2004-04-30 J"orn Rennecke + + * flow.c (propagate_one_insn): Call mark_set_regs for stack pointer + updates too. + +2004-04-30 Paul Brook + + * arm.c (arm_needs_doubleword_align): Use mode alignment. + +2004-04-30 Paolo Bonzini + + * config/altivec/altivec.h [__cplusplus] (vec_subsubs): Rename to + vec_sububs. + [__cplusplus] (vec_subsuhs): Rename to vec_subuhs, without + duplicates. + +2004-04-30 Uros Bizjak + + * config/i386/i386.md (atansf2, atandf2, atanxf2): Move near + atan2?f3 expanders. + +2004-04-29 Nick Clifton + + Bug 14093 + * config/sh/sh-protos.h (sh_promote_prototypes): Declare. + * config/sh/sh.c (sh_promote_prototypes): Remove declaration. + Delete static from definition. + * config/sh/sh.h (FUNCTION_VALUE): Add sh_promote_prototypes call. + +2004-04-30 Uros Bizjak + + * reg-stack.c (subst_stack_regs_pat): : abort() if src1 dies. + : Same. + : Same. + +2004-04-29 Richard Guenther + + * commom.opt (Wfatal-errors): Add it. + * diagnostic.c (flag_fatal_errors): Define it. + (diagnostic_action_after_output): Check for flag_fatal_errors. + * flags.h (flag_fatal_errors): Declare it. + * opts.c (common_handle_option): Add OPT_Wfatal_errors. + * doc/invoke.texi (Warning Options): Document -Wfatal-errors. + +2004-04-30 Josef Zlomek + + * gcse.c (remove_reachable_equiv_notes): Delete notes also in + blocks which have kill flag set. + +2004-04-29 Ben Elliston + + * configure.ac (--with-as): Abort if user-supplied assembler + cannot be executed. + (--with-ld): Likewise for the linker. + * configure: Regenerate. + +2004-04-29 Kaveh R. Ghazi + + * convert.c (convert_to_integer): Ensure `long_integer_type_node' + isn't NULL before using it. + +2004-04-29 Richard Sandiford + + PR target/15189 + * config/mips/mips.md (load_df_low): Use default length. + (load_df_high, store_df_high): Likewise. + +2004-04-29 Kazu Hirata + + * config/mips/mips.md, config/mips/sb1.md, + config/rs6000/rs6000.c: Fix comment typos. + +2004-04-29 Kazu Hirata + + * builtins.c, cgraph.c, cgraphunit.c, final.c, fold-const.c: + Fix comment typos. + +2004-04-29 Douglas B Rupp + + * gcc.c (DELETE_IF_ORDINARY): New macro default definition. + (delete_if_ordinary): Use above macro. + * config/alpha/xm-vms.h (DELETE_IF_ORDINARY): New macro VMS definition. + Update copyright. + * doc/hostconfig.texi (DELETE_IF_ORDINARY): Document new macro. + +2004-04-29 Richard Earnshaw + + * c-decl.c (get_parm_info): Use the correct tag keywords when + warning about type declarations in prototypes. + +2004-04-29 Paul Brook + + * config.gcc: Pull list of cores from arm-cores.def. + +2004-04-29 Paolo Bonzini + + * combine.c (combine_simplify_rtx): Adjust call to use + simplify_relational_operation. Do not use SELECT_CC_MODE + when a comparison already has a MODE_CC mode. + +2004-04-29 Paolo Bonzini + + (simplify_set): simplify_relational_operation may now + return another relational expression. + * cse.c (fold_rtx): simplify_relational_operation now + takes of computing the comparison mode. + * dojump.c (compare_from_rtx): Use simplify_relational_operation, + remove dead code. + (do_compare_rtx_and_jump): Likewise. + * integrate.c (subst_constants): simplify_relational_operation + may now return another relational expression. + * simplify-rtx.c (simplify_gen_relational): Move most code to + the new simplify_relational_operation and + simplify_relational_operation_1 functions. + (simplify_relational_operation): Rewritten. + (simplify_relational_operation_1): New function. + (simplify_ternary_operation): simplify_relational_operation + may now return another relational expression. + (simplify_rtx): Remove unnecessary temp variable. + +2004-04-29 Uros Bizjak + + * reg-stack.c (swap_to_top): New function. + (subst_stack_regs_pat): UNSPEC_FPATAN, UNSPEC_FYL2X: Use + swap_to_top(). + (subst_stack_regs_pat): UNSPEC_FSCALE: Remove. + (subst_stack_regs_pat): Handle UNSPEC_FSCALE_FRACT and + UNSPEC_FSCALE_EXP. + + * config/i386/i386.md (UNSPEC_FSCALE): Remove. + (*fscale_sfxf3, *fscale_dfxf3, *fscale_xf3): Remove insn pattern. + (UNSPEC_FSCALE_FRACT, UNSPEC_FSCALE_EXP): New unspecs to represent + x87's fscale insn. + (*fscalexf4: Define new insn pattern to implement x87 fscale insn. + (exp?f2, exp10?f2, exp2?f2): Use *fscalexf4 and float_truncate + patterns. + +2004-04-28 Serge Belyshev <1319@bot.ru> + + PR 14944 + * coverage.c (read_counts_file): Fix usage of warning () call. + * pretty-print.c (pp_base_format_text): Fix typo in the comment. + +2004-04-28 Ben Elliston + + * doc/invoke.texi (Objective-C Dialect Options): Don't prefix + options with "-" in the option index. + (SPARC Options): Likewise. + (M32R/D Options): Likewise. + +2004-04-28 Kaveh R. Ghazi + + * convert.c (convert_to_integer): Convert (long)round -> lround, + etc. + +2004-04-28 Andrew Pinski + + * config/rs6000/rs6000.c (registers_ok_for_quad_peep): + Return false if we do not have fp register. + (addrs_ok_for_quad_peep): Rename to ... + (mems_ok_for_quad_peep): this. + Add check for volatile memory. + * config/rs6000/rs6000-protos.h (addrs_ok_for_quad_peep): + Rename to ... + (mems_ok_for_quad_peep): this. + * config/rs6000/rs6000.md: Change peephole's for lfq/stq + to peephole2's. + (lfq_power2): New instruction. + (stfq_power2): Likewise. + +2004-04-28 Jan Hubicka + + PR c/15004 + * function.c (do_warn_unused_parameter): Break out form ... + (expand_function_end): ... here; warn only when not using cgraphunit. + * function.h (do_warn_unused_parameter): Declare. + * cgraphunit.c: Include function.h. + (cgraph_finalize_function): Do unused parameter warning. + * Makefile.in (cgraphunit.o): Depend on function.h + +2004-04-28 Joseph S. Myers + + * Makefile.in ($(DESTDIR)$(infodir)/%.info): Don't condition + calling install-info on $(DESTDIR)$(infodir)/dir already being + present. + +2004-04-28 Paul Brook + + * dwarf2out.c (mem_loc_descriptor): Handle shifts. + +2004-04-28 Ulrich Weigand + + * gcse.c (find_moveable_store): Do not accept store insns with + REG_EH_REGION note. + +2004-04-28 Paul Brook + + * calls.c (precompute_arguments): Remove PROMOTE_FOR_CALL_ONLY. + * function.c (assign_temp): Ditto. + * system.h (PROMOTE_FOR_CALL_ONLY): Poison. + +2004-04-28 Paul Brook + + * config/arm/lib1funcs.asm: Recognize armv5tej and armv6. + +2004-04-28 Josef Zlomek + + * var-tracking.c (variable_different_p): Add a parameter + compare_current_location, compare current location of variable parts + if it is true. + (dataflow_set_different_1): Pass compare_current_location == false. + (dataflow_set_different_2): Pass compare_current_location == false. + (emit_notes_for_differences_1): Pass compare_current_location == true. + +2004-04-28 Ulrich Weigand + + * config/s390/s390.md ("casesi"): Mark jump table access as + non-trapping and unchanging. + +2004-04-27 John David Anglin + + PR debug/14829 + * dwarf2out.c (reg_number): Rename to dbx_reg_number. Adjust all + callers. + (multiple_reg_loc_descriptor, reg_loc_descriptor): Use gcc register + number for indexing hard_regno_nregs array. + +2004-04-27 Geoffrey Keating + + * config/darwin.h (STARTFILE_SPEC): Use %s to find crt2.o. + * config/darwin-crt2.c: Only have contents on __ppc__. + +2004-04-27 Bob Wilson + + * config/xtensa/xtensa.c (call_insn_operand): Check + SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_LOCAL_P. + * config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND): Likewise. + * config/xtensa/xtensa.md (call, call_value): Likewise. + +2004-04-27 Wu Yongwei + + * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure. + (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust. + (__gthread_mutex_init_function): Replace CreateMutex with + initialization of custom mutex using CreateSemaphore. + (__gthread_mutex_lock): Use InterlockedIncrement. + (__gthread_mutex_trylock): Use InterlockedCompareExchange. + (__gthread_mutex_unlock): Use InterlockedDecrement and + ReleaseSemaphore to unlock + * config/i386/gthr-win32.c (__gthread_mutex_init_function, + __gthread_mutex_lock, __gthread_mutex_trylock, + __gthread_mutex_unlock): Adjust to match inline versions in + gthr-win32.h. + +2004-04-27 Paul Brook + + * config/arm/arm.c (arm_promote_prototypes): New function. + (TARGET_PROMOTE_PROTOTYPES): Use it. + +2004-04-27 Paul Brook + + * config/arm/arm.c (arm_expand_epilogue): Count blocks of 4 regs. + +2004-04-26 Bernard Giroud + + * config/alpha.c (alpha_end_function): For OpenVMS gas, + correctly output .pdesc directive before .end. + +2004-04-26 James E Wilson + + Bug 14927 + * config/ia64/ia64.md (movxf): New local op0. Handle case where + operands[0] is a SUBREG. Handle case where operands[1] is a GR reg. + +2004-04-26 Zack Weinberg + + * config/ia64/hpux.h: Predefine __STDCPP__ when compiling C++. + * config/pa/pa-hpux10.h: Likewise. + * config/pa/pa-hpux11.h: Likewise. + +2004-04-26 Geoffrey Keating + + * doc/invoke.texi (Overall Options): Document default for -o + for PCH files. + +2004-04-26 Richard Kenner + + * builtins.c (expand_builtin_update_setjmp_buf): New function. + (expand_builtin, case BUILT_IN_UPDATE_SETJMP_BUF): New case. + * builtins.def (BUILT_IN_UPDATE_SETJMP_BUF): New code. + +2004-04-26 Paul Brook + + * config/arm/arm.c (arm_legitimate_index_p): Correct iwmmxt offsets. + +2004-04-26 Paul Brook + + * config/arm/arm.c (arm_legitimate_index_p): Correct maverick offsets. + +2004-04-25 Roger Sayle + + * fold-const.c (fold): Prefer fold_convert (negate_expr (...)) to + fold (build1 (NEGATE_EXPR, ...)). Optimize X / -1 as -X and + X % -1 as 0. + +2004-04-26 Hans-Peter Nilsson + + PR bootstrap/15141 + * except.c (connect_post_landing_pads): Delete insns after the + barrier when generating a unwind_resume_libfunc call. + +2004-04-25 Richard Kenner + + PR/c++ 15119 + * tree.c (substitute_placeholder_in_expr, case 4): New case, + for TARGET_EXPR. + +2004-04-25 Zdenek Dvorak + + * gcov-io.h (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, + __gcov_execv, __gcov_execvp, __gcov_execve): Do not declare when + inhibit_libc is defined. + +2004-04-25 Richard Sandiford + + * config/mips/mips-protos.h (mips_linked_macc_p): Declare. + * config/mips/mips.h (TUNE_MACC_CHAINS): New macro. + * config/mips/mips.c (TARGET_SCHED_REORDER): Define. + (TARGET_SCHED_VARIABLE_ISSUE): Define. + (mips_adjust_cost): Move later in file, next to other sched hooks. + (mips_macc_chains_last_hilo): New variable. + (mips_linked_madd_p, mips_macc_chains_record, mips_macc_chains_reorder) + (mips_promote_ready, mips_sched_reorder, mips_variable_issue): New. + * config/mips/mips.md (may_clobber_hilo): New attribute. + +2004-04-24 Roger Sayle + Bruce Korb + + * fixinc/inclhack.def (aix_syswait_2): New fix. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/sys/wait.h: Update for new test. + +2004-04-24 Alan Modra + + PR target/14960 + * config/rs6000/rs6000.c (rs6000_stack_info): Rename total_raw_size + to non_fixed_size, and leave out fixed_size from the sum. + (generate_set_vrsave): Correct clobbers. + (rs6000_emit_epilogue): Test TARGET_ALTIVEC with TARGET_ALTIVEC_SAVE. + (rs6000_function_value): Test TARGET_ALTIVEC and TARGET_ALTIVEC_ABI. + (rs6000_libcall_value): Likewise. + * config/rs6000/rs6000.h (FUNCTION_VALUE_REGNO_P): Likewise. + (FUNCTION_ARG_REGNO_P): Likewise. + +2004-04-24 Ulrich Weigand + + * expmed.c (expand_mult_highpart_adjust): Do not assume OP1 + is a CONST_INT. + (expand_mult_highpart_optab): Call expand_mult_highpart_adjust + with NARROW_OP1 instead of OP1. + +2004-04-24 Ulrich Weigand + + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __s390__ + and __s390x__ hosts. + +2004-03-23 Zdenek Dvorak + + * Makefile.in (LIBGCOV): Add _gcov_fork, _gcov_execl, _gcov_execlp, + _gcov_execle, _gcov_execv, _gcov_execvp, _gcov_execve. + * builtin-types.def (BT_PID, BT_PTR_CONST_STRING, BT_FN_PID, + BT_FN_INT_CONST_STRING_PTR_CONST_STRING, + BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING): New. + * builtins.c (expand_builtin_fork_or_exec): New. + (expand_builtin): Call it. + * builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP,BUILT_IN_EXECLE, + BUILT_IN_EXECV, BUILT_IN_EXECVP, BUILT_IN_EXECVE, BUILT_IN_FORK): New. + * c-common.c (PID_TYPE): New macro. + (c_common_nodes_and_builtins): Initialize pid_type_node. + * calls.c (special_function_p): Do not handle fork and exec. + (expand_call): Do not handle ECF_FORK_OR_EXEC. + * gcov-io.h (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, + __gcov_execv, __gcov_execvp, __gcov_execve): Declare. + * libgcov.c (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, + __gcov_execv, __gcov_execvp, __gcov_execve): New. + * tree.h (enum tree_index): Add TI_PID_TYPE. + (pid_type_node): New macro. + (ECF_FORK_OR_EXEC): Removed. + +2004-04-23 Eric Botcazou + + PR optimization/13985 + * cfgloopmanip.c (fix_loop_placements): New prototype. + Call fix_bb_placements on the preheader of loops that have + been reparented. + (remove_path): Adjust call to fix_loop_placements. + +2004-04-23 Andrew Pinski + + * config/darwin7.h: New file. + * config.gcc (*-*-darwin*): Add darwin7.h if the + version is greater than 6. + * config/darwin.h (TARGET_C99_FUNCTIONS): Define. + (MATH_LIBRARY): Wrap in ifdefs. + +2004-04-23 Daniel Jacobowitz + + * config/arm/arm.c (arm_output_epilogue): Reverse the order of + loading iWMMXt registers with a frame pointer. Use post-increment + without a frame pointer. + (arm_expand_prologue): Reverse the order of saving iWMMXt registers. + +2004-04-23 Paolo Bonzini + + * doc/invoke.texi (Optimize Options): Refer to "unit-at-a-time + mode" rather than "-funit-at-a-time" since -O2 enables it + without requiring -f* options. Refer to -fprofile-generate and + -fprofile-use correctly. Move -funit-at-a-time among options + enabled by -O. Add information about unit-at-a-time caveats. + +2004-04-22 Per Bothner + + * line-map.h (struct line_maps): New field highest_line. + (linemap_position_for_column): Make non-inline function. + (LINEMAP_POSITION_FOR_COLUMN): New macro. + * line-map.c (linemap_init): Clear highest_line field. + (linemap_add): Set highest_line field. + (linemap_line_start): Minor optimization - use highest_line field. + Reduce maximum column hint to 10000. Update highest_line field. + (linemap_position_for_column): Moved from line-map.h. Optimize a bit. + * cpphash.h (struct cpp_reader): Remove line field - instead use + line_table->highest_line. + (saved_line): Remove unused field. + (CPP_INCREMENT_FILE): Don't do linemap_lookup - just use newest map. + Use line_table's highest_line field instead of cpp_reader's line. + * cpplib.c (start_directive): Likewise use highest_line field. + (do_line, do_linemarker): Likewise just use newest map. + (_cpp_do_file_change): Don't need to set cpp_reader's line field. + * cpperror.c (cpp_error): Likewise use highest_line field. + * cppfiles.c (open_file_failed: Likewise. + (cpp_make_system_header): Likewise use newest map and highest_line. + * cppinit.c (cpp_create_reader): Don't initialize removed field. + * cpplex.c (_cpp_process_line_notes, _cpp_skip_block_comment, + skip_line_comment, skip_whitespace, _cpp_get_fresh_line, + _cpp_lex_direct): Likewise use highest_line. + (_cpp_lex_direct): Use new LINEMAP_POSITION_FOR_COLUMN macro. + * cppmacro.c (_cpp_builtin_macro_text): Likewise use highest_line, + and use newest map. + * cpppch.c (cpp_read_state): Don't save+restore cpp_reader's line. + * cpptrad.c (_cpp_overlay_buffer): Don't save cpp_reader's line. + (copy_comment, _cpp_scan_out_logical_line): Likewise use highest_line. + +2004-04-23 Alan Modra + + PR bootstrap/14992 + * gcc.c (init_gcc_specs): Test USE_LD_AS_NEEDED, not HAVE_LD_AS_NEEDED. + * config/linux.h (USE_LD_AS_NEEDED): Define. + * config/alpha/linux.h (USE_LD_AS_NEEDED): Define. + * config/arm/linux-elf.h (USE_LD_AS_NEEDED): Define. + * config/rs6000/linux.h (USE_LD_AS_NEEDED): Define. + * config/rs6000/linux64.h (USE_LD_AS_NEEDED): Define. + * config/sh/linux.h (USE_LD_AS_NEEDED): Define. + * config/sparc/linux.h (USE_LD_AS_NEEDED): Define. + * config/sparc/linux64.h (USE_LD_AS_NEEDED): Define. + +2004-04-22 Per Bothner + + * cppinit.c (cpp_read_main_file): Return NULL rather than false. + Fixes PR preprocessor/15067. + +2004-04-23 Andreas Schwab + + * config/ia64/ia64intrin.h: Add intermediate cast to void * to + avoid aliasing warning. + +2004-04-22 Jan Hubicka + Mostafa Hagog + + * cfgloopmanip.c (scale_bbs_frequencies): Use RDIV macro + * cfgloopanal.c (expected_loop_iterations): Change the return value + +2004-04-22 Jakub Jelinek + + * cselib.h (struct elt_loc_list): Remove canon_loc field. + * cselib.c (new_elt_loc_list): Remove canon_loc initialization. + (cselib_invalidate_mem): Remove all canon_loc and canon_x + traces. + +2004-04-22 Josef Zlomek + + Revert + 2004-04-20 Josef Zlomek + + * var-tracking.c (variable_part_different_p): Variable parts + differ when the most recent locations differ. + +2004-04-22 Richard Sandiford + + * doc/invoke.texi: Remove the MIPS -membedded-pic option. + * config/mips/mips-protos.h (embedded_pic_fnaddr_reg): Delete. + (embedded_pic_offset): Delete. + * config/mips/mips.h (MASK_EMBEDDED_PIC): Delete. Shuffle other + MASK_* constants. + (TARGET_EMBEDDED_PIC): Delete. + (TARGET_SWITCHES): Remove -m{no-,}embedded-pic. + (ASM_SPEC): Remove -membedded-pic. + (ASM_OUTPUT_ADDR_DIFF_ELT): Remove embedded-pic handling. + (ASM_OUTPUT_CASE_LABEL): Likewise. + * config/mips/vxworks.h (ASM_SPEC): Remove -membedded-pic. + * config/mips/windiss.h (ASM_SPEC): Likewise. + * config/mips/mips.c (struct machine_function): Remove + embedded_pic_fnaddr_rtx. + (TARGET_ENCODE_SECTION_INFO): Remove override. + (embedded_pic_fnaddr_reg, embedded_pic_offset): Delete. + (override_options): Remove -membedded-pic handling. + (print_operand): Remove handling of '%S'. + (mips_select_section: Remove -membedded-pic handling. + (mips_encode_section_info): Delete. + (mips_output_conditional_branch): Remove mention of -membedded-pic. + * config/mips/mips.md (define_attr length, movsi, movdi, jump): Remove + -membedded-pic handling. + (casesi, casesi_internal, casesi_internal_di, get_fnaddr): Delete. + +2004-04-22 Alan Modra + + * var-tracking.c (frame_base_decl): Remove useless GTY. + +2004-04-21 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_override_options): Error when + user wants altivec and e500 instructions. + +2004-04-21 H.J. Lu + + PR target/14813 + * config/ia64/crtend.asm: Move pointer to __do_global_ctors_aux + in .init_array section to ... + * config/ia64/crtbegin.asm: Here. + + * config/ia64/crtend.asm: Mark __do_global_ctors_aux global + and hidden if HAVE_INITFINI_ARRAY is defined. + +2004-04-21 James E Wilson + + * config/mips/mips-protos.h (fp_register_operand, lo_operand): Declare. + * config/mips/mips.c (mips_multipass_dfa_lookahead): Declare. + (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD): New. + (fp_register_operand, lo_operand): New. + (mips_rtx_costs): Add TUNE_SB1 support. + (mips_issue_rate): Add comment. Add PROCESSOR_SB1 support. + (mips_use_dfa_pipeline_interface): Add PROCESSOR_SB1 support. + (mips_multipass_dfa_lookahead): New. + * config/mips/mips.h (MASK_FP_EXCEPTIONS, TARGET_FP_EXCEPTIONS, + TUNE_SB1): New. + (TARGET_SWITCHES): Add -mfp-exceptions support. + (TARGET_FP_EXCEPTIONS_DEFAULT): New. + (BRANCH_COST): Fix whitespace. + * config/mips/mips.md: Include sb1.md. + * config/mips/sb1.md: New file. + * doc/invoke.texi: Document -mfp-exceptions. + + * Makefile.in (fixinc.sh): Don't set or export WARN_CFLAGS. Fix + comment. + * fixinc/Makefile.in (FL_LIST): Don't mention WARN_CFLAGS. + (fixincl.o-warn): Delete. + +2004-04-21 Andrew Pinski + + * config/rs6000/rs6000 (print_operand) ['z']: + Change ifdef of TARGET_MACHO to if TARGET_MACHO. + +2004-04-21 Daniel Jacobowitz + + * config.gcc: Support --with-arch=iwmmxt for ARM. + +2004-04-21 Richard Kenner + + * expmed.c (expand_mult_highpart_optab): Use narrower version of OP1 + in two more places; remove unneeded force_reg + +2004-04-21 Andrew Pinski + + * config/rs6000/rs6000.c (symbol_ref_operand): Remove hack + for TARGET_MACHO. + (print_operand): For TARGET_MACHO check to see if we need a stub + and output one if we need it. + + PR debug/15033 + * dwarf2out.c (rtl_for_decl_location): Check for NULL + rtl. + +2004-04-20 James E Wilson + + * config/ia64/ia64.md (call_value_nogp): Add constraints for op0. + (vall_value_gp): Likewise. + +2004-04-20 DJ Delorie + + * dwarf2out.c (rtl_for_decl_location): Adjust rtl for byte + variables stored in word registers, then in memory. + +2004-04-20 Eric Christopher + + * cp/parser.c (cp_parser_declaration): Move translate + up before tokens are lexed. + +2004-04-20 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_asin and OTI_acos. + (asin_optab, acos_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize asin_optab and acos_optab. + * genopinit.c (optabs): Implement asin_optab and acos_optab + using asin?f2 and acos?f2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_ASIN{,F,L} + using asin_optab, and BUILT_IN_ACOS{,F,L} using acos_optab. + (expand_builtin): Expand BUILT_IN_ASIN{,F,L} and BUILT_IN_ACOS{,F,L} + using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * config/i386/i386.md (asindf2, asinsf2, asinxf2, acosdf2, + acossf2, acosxf2): New expanders to implement asin, asinf, asinl, + acos, acosf and acosl built-ins as inline x87 intrinsics. + +2004-04-20 Paul Brook + + * config/arm/arm.c (arm_legitimate_address_p): Use rtx_equal_p. + +2004-04-20 Paul Brook + + * config/arm/arm.c (arm_expand_prologue): Fix size calculation. + +2004-04-20 Paolo Bonzini + + Revert part of 2004-04-17 change that moved -frename-registers + to -O1. -frename-registers is buggy. + + * toplev.c (flag_rename_registers): Initialize to 0. + * doc/invoke.texi (Optimize options): Move -frename-registers + to "Not triggered by any -O level" section. Adjust commentary + accordingly. + +2004-04-20 Anil Paranjpe + + * toplev.c (compile_file): Move targetm.asm_out.file_end call to end. + +2004-04-20 Richard Sandiford + + * config/mips/mips.c (mips_legitimize_move): Generate special patterns + for mflo and mfhi instructions. + (mips_output_move): Remove mflo and mfhi handling. + * config/mips/mips.md (UNSPEC_MFHILO): New unspec. + (*mulsidi3_64bit): Update for new mfhi/mflo representation. + Likewise various define_peephole2s. + (*movdi_32bit, *movdi_64bit, *movsi_internal): Merge x<-J and x<-d + alternatives. + (*movdi_64bit, *movdi_64bit_mips16, *mov[shq]i_internal) + (*mov[shq]i_mips16): Remove mflo and mfhi alternatives. + (mfhilo_di, mfhilo_si): New patterns. + +2004-04-20 Josef Zlomek + + * function.c (assign_parms): Force + MEM_EXPR (DECL_INCOMING_RTL (parm)) == parm. + +2004-04-20 Josef Zlomek + + * var-tracking.c (variable_part_different_p): Variable parts differ + when the most recent locations differ. + +2004-04-19 James E Wilson + + * rtl.h (reg_set_last): Delete declaration. + * rtlanal.c (reg_set_last): Delete. + +2004-04-19 Roger Sayle + + * fold-const.c (fold_convert): Make function extern/public. + * tree.h (fold_convert): Prototype here. + * builtins.c (expand_builtin_strstr, expand_builtin_strchr, + expand_builtin_strrchr, expand_builtin_strpbrk, + expand_builtin_mempcpy, expand_builtin_bcopy, + expand_builtin_bzero, expand_builtin_memcmp, + expand_builtin_strcmp, expand_builtin_strncmp, + stabilize_va_list, expand_builtin_sprintf, + fold_trunc_transparent_mathfn, fold_builtin_logarithm, + fold_builtin_exponent, fold_builtin_mempcpy, + fold_builtin_strcpy, fold_builtin_strcmp, fold_builtin_strncmp, + fold_builtin_signbit, fold_builtin_isdigit, fold_builtin): Prefer + fold_convert to "convert" or "fold (build1 (NOP_EXPR, ...))". + +2004-04-19 Aldy Hernandez + + * config/rs6000/rs6000.md (UNSPEC_MV_CR_GT): New constant. + (move_from_CR_gt_bit): New. + (cceq_ior_compare): Name previously unnamed pattern. Disable for + E500. + (cceq_rev_compare): Name previously unnamed pattern. Allow for + E500. + + * config/rs6000/spe.md (cmpsfeq_gpr): Rewrite as unspec. + (tstsfeq_gpr): Same. + (cmpsfgt_gpr): Same. + (tstsfgt_gpr): Same. + (cmpsflt_gpr): Same. + (tstsflt_gpr): Same. + (e500_cceq_ior_compare): New. + (e500_flip_gt_bit): New. + + * config/rs6000/rs6000.c (ccr_bit): Remove E500 specific code. + (print_operand): Add 'c' and 'D'. + (rs6000_generate_compare): Rewrite to generate correct rtl. + (rs6000_emit_sCOND): Handle E500. + (output_cbranch): Adjust for changes in rs6000_generate_compare. + (output_e500_flip_gt_bit): New. + + * config/rs6000/rs6000-protos.h (output_e500_flip_gt_bit): + Protoize. + +2004-04-19 Eric Christopher + + * config/mips/mips.h (DWARF2_ADDR_SIZE): New. + +2004-04-19 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Add AIX 5.1 assembler and archiver + fix information. + +2004-04-19 Rainer Orth + + * doc/install.texi (Specific, mips-sgi-irix5): Fix IRIX 5.3 IDO + download URL. + +2004-04-19 Daniel Jacobowitz + + * stor-layout.c (layout_decl): Check DECL_PACKED before calling + ADJUST_FIELD_ALIGN. Check maximum_field_alignment after. + +2004-04-19 Andrew PInski + + * builtins.c (fold_builtin_cabs): Remove fndecl parameter. + (fold_builtin): Update caller to match. + + PR bootstrap/15009 + * bb-reorder.c (fix_up_fall_thru_edges): Init cond_jump. + + PR bootstrap/14999 + * builtins.c (fold_builtin_cabs): Mark fndecl as unused. + +2004-04-19 Richard Kenner + + * varasm.c (compare_constant, case VIEW_CONVERT_EXPR): Add case. + + * expmed.c (expand_mult_highpart_adjust): Make OP1 valid for MODE. + (expand_mult_highpart_optab): Likewise. + (expand_mult_highpart): Make OP1 valid for WIDER_MODE, not MODE. + +2004-04-19 Paul Brook + + * config/arm/arm.md (fixuns_truncsfsi2, fixuns_truncdfsi2, + floatunssisf2, floatunssidf2): New patterns. + +2004-04-18 Mark Mitchell + + PR other/14918 + * doc/invoke.texi (-fprofile-generate): Document requirement to + use -fprofile-generate when linking. + + * doc/extend.texi (Strong Using): Warn users against using this + feature. + +2004-04-18 Richard Sandiford + + * config/mips/mips-protos.h (m16_usym8_4, m16_usym5_4): Delete. + * config/mips/mips.h (mips_entry, mips_string_length): Delete. + (CONSTANT_POOL_BEFORE_FUNCTION, ASM_OUTPUT_POOL_EPILOGUE): Undefine. + * config/mips/mips.c (struct mips16_constant): Renamed from struct + constant. Propogate change throughout file. + (struct machine_function): Remove insns_len. + (mips_string_length, mips16_strings, string_constants): Delete. + (mips_classify_symbol): Return SYMBOL_CONSTANT_POOL for LABEL_REFs + when generating mips16 code. Remove special mips16 treatment of + string constants. + (mips_symbolic_constant_p): Allow mips16 constant pool accesses + to have the form LABEL+CONSTANT. + (mips_symbolic_address_p): Fix comment. + (m16_usym8_4, m16_usym5_4): Delete. + (mips_output_function_epilogue): Remove mips16 string handling. + (mips_output_mi_thunk): Call mips16_lay_out_constants. + (mips_select_section, mips_encode_section_info): Remove mips16 + string handling. + (struct mips16_constant_pool): New. + (add_constant): Take a mips16_constant_pool structure. Keep pool + sorted into order of ascending mode size. Keep track of the highest + possible start address, taking padding and the masking of the base PC + value into account. + (dump_constants_1): New function, split out from dump_constants. + Handle vector constants. Use gen_consttable_{int,float} rather than + separate functions for each mode. + (dump_constants): Simplify. Use GET_MODE_ALIGNMENT. Use gen_align + rather than separate functions for each alignment. + (mips_find_symbol): Delete. + (mips16_insn_length): New function, split out from + mips16_lay_out_constants. + (mips16_rewrite_pool_refs): New function. + (mips16_lay_out_constants): Rework. Remove string handling. + Always create an inline constant pool. + * config/mips/mips.md (UNSPEC_CONSTTABLE_INT, UNSPEC_CONSTTABLE_FLOAT) + (UNSPEC_ALIGN): New constants. + (UNSPEC_CONSTTABLE_[QHSD]I, UNSPEC_CONSTTABLE_[SD]F): Delete. + (UNSPEC_ALIGN_[248]): Delete. + (consttable_int, consttable_float, align): New patterns. + (consttable_[qhsd]i, consttable_[sd]f, align_[248]): Delete. + +2004-04-17 Aldy Hernandez + + * config/rs6000/altivec.h (vec_any_numeric): Correct typo in + __unn_args_eq. + +2004-04-17 Alan Modra + + PR target/14715 + * config/rs6000/rs6000.c (rs6000_stack_info): Make parm_size agree + with STARTING_FRAME_OFFSET. + +2004-04-17 Richard Sandiford + + * config/mips/mips.h (PREDICATE_CODES): Add macc_msac_operand. + * config/mips/mips.c (macc_msac_operand): New function. + * config/mips/mips.md (*msac): Move after *macc. + (*msac2): New. Generalize macc-related peepholes so that they apply + to msac too. + +2004-04-17 Paolo Bonzini + + * opts.c (decode_options): Do not enable flag_rename_registers + and flag_web at -O3. + * toplev.c (flag_rename_registers): Initialize + flag_rename_registers and flag_web to + AUTODETECT_FLAG_VAR_TRACKING. + (default_debug_hooks): New global. + (process_options): Initialize default_debug_hooks. Warn if + -fvar-tracking specified but not supported by the current + debug format. Do not run var tracking at -O0 or if not + supported by the current debug format, even if + -fvar-tracking was given. If -fno-rename-registers + is not specified, always run register renaming if var + tracking is supported by the default debugging information + format for the target, and we are at -O1 or higher; similarly + for -fweb, but only at -O2 or higher. + * doc/invoke.texi (Optimize Options): Document this. + +2004-04-17 Richard Sandiford + + * configure.ac (gcc_cv_ld_as_needed): Use AC_CACHE_CHECK. + * configure: Regenerate. + +2004-04-17 Richard Sandiford + + * gcc.c (used_arg): Check whether an option has been removed. + +2004-04-17 Rainer Orth + + * config.gcc (i[34567]86-*-solaris2*): Default to DWARF-2 + debugging on Solaris 7 and up. + +2004-04-16 Rainer Orth + + * doc/install.texi (Specific, mips-sgi-irix5): Reflect working + IRIX 5 port. + Remove -save-temps workaround, handled automatically. + Require GNU binutils 2.15 for debugging. + Remove SGI make warnings since GNU make is now required. + (Specific, mips-sgi-irix6): Some markup fixes. + Describe MIPSpro C problems and workarounds. + Mention working O32 ABI support. + Recommend GNU as 2.15 for O32 with debugging. + Remove description of fixed structure pass/return bug. + +2004-04-16 DJ Delorie + + * sdbout.c (sdbout_one_type): Use TYPE_VALUES for enums, not + TYPE_FIELDS. + (sdbout_finish): Don't free deferred_global_decls; it's GC'd. + +2004-04-16 John David Anglin + + * pa.md: Remove unnecessary declarations for asm_out_file. + + * pa64-regs.h (DBX_REGISTER_NUMBER): Simplify and correct mapping of + SAR register. Fix comment. + (ADDITIONAL_REGISTER_NAMES): Correct register number of SAR register + (%cr11). + + * pa64-hpux.h (LIB_SPEC): Fix library specification used with GNU ld. + +2004-04-16 Nick Clifton + + * config/arm/arm.c (arm_override_options): Revert previous patch. + * config/arm/t-xscale-elf: Disable iwmmxt multilibs until they can + be safely built. + +2004-04-16 Kazuhiro Inaoka + + * config/m32r/m32r.h (BIG_ENDIAN_BIT): Deleted to fix endian + bug. + (TARGET_LITTLE_ENDIAN, TARGET_BIG_ENDIAN, + TARGET_DEFAULT): Changed. Ditto. + (LITTLE_ENDIAN_BIT, TARGET_CPU_DEFAULT, + TARGET_ENDIAN_DEFAULT): Added. Ditto. + * config/m32r/little.h (TARGET_LITTLE_ENDIAN): Deleted. + (TARGET_ENDIAN_DEFAULT): Added. + +2004-04-15 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_ISDIGIT, BUILT_IN_ISXDIGIT): Mark with + ATTR_CONST_NOTHROW_LIST. + +2004-04-15 Kaveh R. Ghazi + + PR/middle-end 14915 + * builtins.c (expand_builtin_signbit): Test BYTES_BIG_ENDIAN, not + BITS_BIG_ENDIAN. + +2004-04-15 Pat Haugen + + * ra-debug.c (ra_print_rtx): Add break's to case legs. + +2004-04-14 James E Wilson + + * Makefile.in (fixinc.sh): Set WARN_CFLAGS to empty string. + +2004-04-14 Nathanael Nerode + + * libada-mk.in: New file. + * configure.ac: Create libada-mk from libada-mk.in. + * configure: Regenerate. + +2004-04-14 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_logb and OTI_ilogb. + (logb_optab, ilogb_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize logb_optab and ilogb_optab. + * genopinit.c (optabs): Implement logb_optab and ilogb_optab + using logb?f2 and ilogb?i2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOGB{,F,L} + using logb_optab, and BUILT_IN_ILOGB{,F,L} using ilogb_optab. + (expand_builtin): Expand BUILT_IN_LOGB{,F,L} and BUILT_IN_ILOGB{,F,L} + using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_XTRACT_FRACT + and UNSPEC_XTRACT_EXP. + + * config/i386/i386.md (*fxtractdf3, *fxtractsf3, *fxtractxf3): New + patterns to implement fxtract x87 instruction. + (logbdf2, logbsf2, logbxf2, ilogbsi2): New expanders to implement + logb, logbf, logbl, ilogb, ilogbf and ilogbl built-ins as inline x87 + intrinsics. + (UNSPEC_XTRACT_FRACT, UNSPEC_XTRACT_EXP): New unspecs to represent + x87's fxtract insn. + +2004-04-14 Eric Christopher + + * config/mips/t-elf: Enable multilibs by default. + +2004-04-14 Andreas Tobler + + * bb-reorder.c (fix_crossing_conditional_branches): Adjust the + previous fix to check HAVE_return at runtime too. + +2004-04-14 Nick Clifton + + * config/arm/arm.c (arm_override_options): If the user has not + specified an ABI, then default to AAPCS for the iWMMXt processor. + * config/arm/t-xscale-elf: Remove redundant multilib specifications. + * config/arm/t-xscale-coff: Likewise. + +2004-04-14 Kaveh R. Ghazi + + * builtins.c (fold_builtin_isdigit): New. + (fold_builtin): Handle BUILT_IN_ISDIGIT. + * defaults.h: Add TARGET_DIGIT0 and sort. + * doc/tm.texi: Add TARGET_BS and TARGET_DIGIT0. + +2004-04-14 Kaveh R. Ghazi + + * builtins.c (fold_builtin_cabs, fold_builtin): Use + `mathfn_built_in' to determine the new builtin. + * fold-const.c (fold): Likewise. + +2004-04-14 Richard Sandiford + + * doc/invoke.texi: Rename MIPS's -mfix-vr4122-bugs to -mfix-vr4120. + * config/mips/mips.h (MASK_FIX_VR4120): Renamed from MASK_FIX_VR4122. + (TARGET_FIX_VR4120): Likewise TARGET_FIX_VR4122. + (TARGET_SWITCHES): Replace -mfix-vr4122-bugs with -mfix-vr4120. + (ASM_SPEC): Update accordingly. + * config/mips/mips.c: Update after above renaming. + * config/mips/mips.md, config/mips/t-vr, config/mips/vr.h: Likewise. + * config/mips/vr4120-div.S: Renamed from vr4122-div.S. + +2004-04-13 James E Wilson + + * c-opt.c (c_common_post_options): If this_input_filename is NULL, + increment errorcount and return false instead of true. + +2004-04-13 Uros Bizjak : + + * optabs.c (expand_twoval_unop): Reorder function arguments. + * builtins.c (expand_builtin_mathfn_3): Update calls to + expand_twoval_unop. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_TAN_ONE + and UNSPEC_TAN_TAN. Add missing comment. + + * config/i386/i386.md (*tandf3_1, *tansf3_1, *tanxf3_1): New + patterns to implement fptan x87 instruction. + (tandf2, tansf2, tanxf2): New expanders to implement tan, tanf + and tanl built-ins as inline x87 intrinsics. Define corresponding + peephole2 optimizers for 'fptan; fstp %st(0); fld1' sequence. + (UNSPEC_TAN_ONE, UNSPEC_TAN_TAN): New unspecs to represent + x87's fptan insn. + +2004-03-13 Richard Henderson + + * bb-reorder.c (fix_crossing_unconditional_branches): Use Pmode + for LABEL_REFs. + + * defaults.h (HOT_TEXT_SECTION_NAME): Add leading dot. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Likewise. + * doc/invoke.texi: Update to match. + + * varasm.c (unlikely_text_section): Use assemble_align instead of + ASM_OUTPUT_ALIGN. Use it in the correct place with an approximately + correct alignment argument. + +2004-04-13 Ulrich Weigand + + * reload1.c (emit_reload_insns): Set reg_has_output_reload to one + after setting reg_last_reload_reg for optional output reloads. + +2004-04-12 Fariborz Jahanian + + * config/rs6000/altivec.h (vec_mergeh, vec_mergel): + Definition of these two macros are corrected by adding + matchine right paren. + +2004-04-12 Jonathan Larmour + + * fix-header.c: kill(), putenv() and tzset() are POSIX not ANSI. + +2004-04-12 Roger Sayle + + * config/i386/i386.c (output_387_reg_move): New function. + * config/i386/i386-protos.h (output_387_reg_move): Prototype here. + * config/i386/i386.md (*movsf_1, *movsf1_nointerunit, + *movdf_nointeger, *movdf_integer, *movxf_nointeger, *movxf_integer, + *extendsfdf2_1, *extendsfxf2_1, *extenddfxf2_1, truncdfsf2_noop, + truncxfsf2_noop, truncxfdf2_noop): Call output_387_reg_move. + +2004-04-12 Richard Kenner + + * c-decl.c (finish_decl): Make a decl_stmt for a variable-sized + TYPE_DECL. + * c-semantics.c (genrtl_decl_stmt): Handle TYPE_DECL. + * stmt.c (expand_decl): Remove redundant expansion of TYPE_DOMAIN. + * stor-layout.c (variable_size): Don't check for MINUS_EXPR. + Use skip_simple_arithmetic to find SAVE_EXPR. + (force_type_save_exprs, force_type_save_exprs_1): New functions. + * tree-inline.c (remap_type, case POINTER_TYPE, case REFERENCE_TYPE): + Properly chain multiple pointers. + (copy_tree_r): Copy a TYPE_DECL. + * tree.c (variably_modified_type_p): Add some missing tests and + make some other minor changes. + * tree.h (force_type_save_exprs): New declaration. + +2004-04-12 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation) : + Remove fall throughs. Convert 0/x and 0%x into x&0 when x has + side-effects. Don't convert x/1.0 into x if we honor signaling NaNs. + Convert x/-1.0 into -x if we don't honor signaling NaNs. Convert + x/-1 into -x. Optimize x%1 into x&0 if x has side-effects. Optimize + x%-1 into 0 (or x&0 if x has side-effects). + +2004-04-11 Aldy Hernandez + + * config/rs6000/rs6000.md: Document why a pattern is not + available. + + * config/rs6000/rs6000.c (rs6000_emit_cmove): Disable comparisons + of floats on the E500. + (branch_positive_comparison_operator): Do not allow NE even on the + E500. + +2004-04-11 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_assemble_integer): Change + in_text_unlikely_section to in_unlikely_text_section. + +2004-04-11 Roger Sayle + + * fold-const.c (fold_binary_op_with_conditional_arg): Tweak + calling convention to allow a NULL_TREE to be returned. Factor + sanity checks from callers, return NULL_TREE when appropriate. + (fold): Handle COMPOUND_EXPR operands of binary expressions + before COND_EXPR operands. Use reorder_operands_p(a,b) to check + whether a op (b,c) can be rewritten as (b, a op c). Simplify + calls to fold_binary_op_with_conditional_arg. + +2004-04-11 Kaveh R. Ghazi + + * config/mips/iris5.h (current_section_flags): Add + in_unlikely_executed_text and default case. + +2004-04-11 Andreas Tobler + + * bb-reorder.c (fix_crossing_conditional_branches): Fix bootstrap + failure on solaris. Place ifdef HAVE_return around gen_ret call. + * cfgrtl.c (force_nonfallthru_and_redirect): Remove ifdef + HAVE_return and place it around the place where it is needed. + +2004-04-11 Andrew Pinski + + * varasm.c (text_section): Use TEXT_SECTION_ASM_OP and + ASM_OUTPUT_ALIGN instead of SECTION_FORMAT_STRING + and NORMAL_TEXT_SECTION_NAME. + (unlikely_text_section): Check targetm.have_named_sections + instead of TARGET_ASM_NAMED_SECTION and use TEXT_SECTION_ASM_OP + instead of SECTION_FORMAT_STRING. + * config/mips/iris5.h (current_section_name): Add + in_unlikely_executed_text case and move the abort into the switch. + * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME): Remove. + (NORMAL_TEXT_SECTION_NAME): Remove. + (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. + (SECTION_FORMAT_STRING): Remove. + * defaults.h (SECTION_FORMAT_STRING): Remove. + * tm.texi (NORMAL_TEXT_SECTION_NAME): Remove. + (SECTION_FORMAT_STRING): Remove. + +2004-04-10 Joseph S. Myers + + * c-typeck.c (common_type): Prefer long long to long when same + precision. + +2004-04-09 Zack Weinberg + + PR 14887 + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Look only at + mode argument. + * config/ia64/ia64.c (ia64_hpux_file_end): Check + TREE_SYMBOL_REFERENCED on DECL_ASSEMBLER_NAME, not DECL_NAME. + +2004-04-09 Roger Sayle + + * simplify-rtx.c (mode_signbit_p): New function to check whether + an RTX is an immediate constant that represents the most significant + bit of a given machine mode. + (simplify_unary_operation) : Optimize ~(X+C) as X ^ ~C, where + C is the sign bit. + (simplify_binary_operation) : Optimize (X^C1) + C2 as X^(C1^C2) + when C2 is the sign bit. + (simplify_binary_operation) : Canonicalize X^C as X+C when C + is the sign bit. Optimize (X+C1) ^ C2 as X^(C1^C2) when C1 is the + sign bit. + +2004-04-09 Kaveh R. Ghazi + + * builtins.c (mathfn_built_in): Check TYPE_MAIN_VARIANT, not + TYPE_MODE. + +2004-04-09 Andrew Pinski + + * c-common.c (handle_noreturn_attribute): Use TYPE_READONLY instead + of TREE_READONLY for types. + +2004-04-09 Caroline Tice + + * basic-block.h (struct edge_def): Add new field, crossing_edge. + (struct basic_block_def): Add new field, partition. + (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro + definitions. + (partition_hot_cold_basic_blocks): Add extern function + declaration. + * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new + include statements. + (N_ROUNDS): Increase the maximum number of rounds by 1. + (branch_threshold): Add array value for new round. + (exec_threshold): Add array value for new round. + (push_to_next_round_p): New function. + (add_unlikely_executed_notes): New function. + (find_rarely_executed_basic_blocks_and_crossing_edges): New function. + (mark_bb_for_unlikely_executed_section): New function. + (add_labels_and_missing_jumps): New function. + (add_reg_crossing_jump_notes): New function. + (fix_up_fall_thru_edges): New function. + (find_jump_block): New function. + (fix_crossing_conditional_branches): New function. + (fix_crossing_unconditional_branches): New function. + (fix_edges_for_rarely_executed_code): New function. + (partition_hot_cold_basic_blocks): New function. + (find_traces): Add an extra round for partitioning hot/cold + basic blocks. + (find_traces_1_round): Add a parameter. Modify to push all cold blocks, + and only cold blocks, into the last (extra) round of collecting traces. + (better_edge_p): Add a parameter. Modify to favor non-crossing edges + over crossing edges. + (bb_to_key): Add code to correctly identify cold blocks when + doing partitioning. + (connect_traces): Modify to connect all the non-cold traces first, then + go back and connect up all the cold traces. + (reorder_basic_blocks): Add call to add_unlikely_executed_notes. + * cfg.c (entry_exit_blocks): Add initialization for partition field in + entry and exit blocks. + * cfgbuild.c (make_edges): Update current_function_has_computed_jump + if we are doing hot/cold partitioning. + * cfgcleanup.c (cfglayout.h): Add new include statement. + (try_simplify_condjump): Modify to not attempt on blocks with jumps + that cross section boundaries. + (try_forward_edges): Likewise. + (merge_blocks_move_predecessor_nojumps): Likewise. + (merge_blocks_move_successor_nojumps): Likewise. + (merge_blocks_move): Likewise. + (try_crossjump_to_edge): Modify to not attempt after we have done + the block partitioning. + (try_crossjump_bb): Modify to not attempt on blocks with jumps that + cross section boundaries. + (try_optimize_cfg): Likewise. + * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect + jumps that cross section boundaries. + * cfglayout.c (flags.h): Add new include statement. + (update_unlikely_executed_notes): New function. + (fixup_reorder_chain): Add code so when a new jumping basic block is + added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are + updated appropriately. + (duplicate_insn_chain): Add code to duplicate the new NOTE insn + introduced by this optimization. + * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new + extern function declaration. + * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to + list of notes that can be deleted. + (create_basic_block_structure): Add initialization for partition field. + (rtl_can_merge_blocks): Modify to test blocks for jumps that cross + section boundaries. + (try_redirect_by_replacing_jump): Modify to not attempt on jumps that + cross section boundaries. + (commit_one_edge_insertion): Add code so newly created basic block + ends up in correct (hot or cold) section. Modify to disallow + insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. + (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge + crosses section boundaries. + (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that + cross section boundaries. + (force_nonfallthru_and_redirect): Modify to make sure new basic block + ends up in correct section, with correct notes attached. + * common.opt (freorder-blocks-and-partition): Add new flag for this + optimization. + * dbxout.c (dbx_function_end): Add code to make sure scope labels at + the end of functions are written into the correct (hot or cold) + section. + (dbx_source_file): Add code so writing debug file information + doesn't incorrectly change sections. + * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use + in partitioning hot/cold basic blocks into separate sections. + (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold + section partitioning. + (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not + conditional branches can span all of memory. + (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not + unconditional branches can span all of memory. + * final.c (scan_ahead_for_unlikely_executed_note): New function. + (final_scan_insn): Add code to check for NOTE instruction indicating + whether basic block belongs in hot or cold section, and to make sure + the current basic block is being written to the appropriate section. + Also added code to ensure that jump table basic blocks end up in the + correct section. + * flags.h (flag_reorder_blocks_and_partition): New flag. + * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if + one of the branches has a jump that crosses between sections. + (find_if_case_2): Likewise. + (ifcvt): Modify to not attempt to mark loop exit edges after + hot/cold partitioning has occurred. + * opts.c (decode_options): Code to handle new flag, + flag_reorder_blocks_and_partition; also to turn it off if + flag_exceptions is on. + (common_handle_option): Code to handle new flag, + flag_reorder_blocks_and_partition. + * output.h (unlikely_text_section): New extern function declaration. + (in_unlikely_text_section): New extern function declaration. + * passes.c (rest_of_handle_stack_regs): Add + flag_reorder_blocks_and_partition as an 'or' condition for calling + reorder_basic_blocks. + (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition + as an 'or' condition for calling reorder_basic_blocks. + (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. + * print-rtl.c (print_rtx): Add code for handling new note, + NOTE_INSN_UNLIKELY_EXECUTED_CODE + * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). + (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that + cross between section boundaries. + * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, + indicating the basic block containing it belongs in the cold section. + (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross + between hot and cold sections. + * toplev.c (flag_reorder_blocks_and_partition): Add code to + initialize this flag, and to tie it to the command-line option + freorder-blocks-and-partition. + * varasm.c (cfglayout.h): Add new include statement. + (unlikely_section_label_printed): New global variable, used for + determining when to output section name labels for cold sections. + (in_section): Add in_unlikely_executed_text to enum data structure. + (text_section): Modify code to use SECTION_FORMAT_STRING and + NORMAL_TEXT_SECTION_NAME macros. + (unlikely_text_section): New function. + (in_unlikely_text_section): New function. + (function_section): Add code to make sure beginning of function is + written into correct section (hot or cold). + (assemble_start_function): Add code to make sure stuff is written to + the correct section. + (assemble_zeros): Add in_unlikely_text_section as an 'or' condition + to an if statement that was checking 'in_text_section'. + (assemble_variable): Add 'in_unlikely_text_section' as an 'or' + condition to an if statement that was checking 'in_text_section'. + (default_section_type_flags_1): Add check: if in cold section + flags = SECTION_CODE. + * config/darwin.c (darwin_asm_named_section): Modify to use + SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. + * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro + specifically for the i386. + (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. + * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change + text string to something more informative. + (NORMAL_TEXT_SECTION_NAME): Add new definition. + (SECTION_FORMAT_STRING): Add new definition. + * config/rs6000/rs6000.c (rs6000_assemble_integer): Add + '!in_unlikely_text_section' as an 'and' condition to an if statement + that was already checking '!in_text_section'. + * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, + UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make + sure these are properly defined for linux on ppc. + * doc/invoke.texi (freorder-blocks-and-partition): Add documentation + for this new flag. + * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new + reg_note. + * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, + HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for + these new macros. + +2004-04-08 Roger Sayle + + * function.c (gen_mem_addressof): When changing the RTX from a REG + to a MEM, clear MEM_VOLATILE_P which was formerly REG_USERVAR_P. + +2004-04-08 Roger Sayle + + PR target/14888 + * config/i386/i386.md (truncdfsf2_noop, truncxfsf2_noop, + truncxfdf2_noop): Provide dummy "fmov" implementations. + +2004-04-08 Ian Lance Taylor + + * gcc.c (default_compilers): Add missing initializers. + + * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): + Return 1 if file was successfully mapped. + +2004-04-08 Geoffrey Keating + + PR pch/13419 + PR pch/14137 + Radar #: 3315288 + * doc/invoke.texi (Precompiled Headers): Suggest -o + to put an output file in a particular place. Be more detailed + about which options affect PCH validity and which options + might not work. + * c-pch.c (pch_matching): New. + (MATCH_SIZE): New. + (struct c_pch_validity): New field 'match'. + (pch_init): Handle pch_matching. + (c_common_valid_pch): Check pch_matching. + + * explow.c: Fix typo defining default of PROMOTE_FUNCTION_MODE. + +2004-04-08 Mark Mitchell + + * doc/invoke.texi (Precompiled Headers): Warn about known + problems. + +2004-04-08 Danny Smith + + PR c++/14808 + * defaults.h (TARGET_USE_LOCAL_THUNK_ALIAS_P): New macro. Default + to 1 if ASM_OUTPUT_DEF is defined. + * doc/tm.texi (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document. + * config/i386/cygming.h (TARGET_USE_LOCAL_THUNK_ALIAS_P): Define. + Set to non-zero iff not a one_only decl. + +2004-04-08 Paul Brook + + * arm.h (CLASS_LIKELY_SPILLED_P): Define. + +2004-04-08 Paul Brook + + * explow.c (promote_mode): Use PROMOTE_FUNCTION_MODE instead of + PROMOTE_FOR_CALL_ONLY. + * config/arm/arm-protos.h (arm_function_value): Declare. + * config/arm/arm.h (TARGET_PROMOTE_FUNCTION_ARGS): Define. + (TARGET_PROMOTE_PROTOTYPES): Return false. + (arm_function_value): New function. + * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Define. + (FUNCTION_VALUE): Call arm_function_value. + * config/cris/cris.h (PROMOTE_MODE): Rename ... + (PROMOTE_FUNCTION_MODE): ... to this. + (PROMOTE_FOR_CALL_ONLY): Remove. + * config/mmix/mmix.h: Likewise. + * config/s390/s390.h: Likewise. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.c: Update comments about PROMOTE_MODE. + * doc/tm.texi (PROMOTE_FUNCTION_MODE): Document. + (TARGET_PROMOTE_FUNCTION_MODE, TARGET_PROMOTE_FUNCTION_RETURN): Update. + (PROMOTE_FOR_CALL_ONLY): Remove. + +2004-04-08 Joel Sherrill + + PR ada/14538 + * ada/5rosinte.adb: Remove fake mprotect() body. + * ada/5rosinte.ads: Add SA_SIGINFO. + * ada/5rtpopsp.adb: Rewrite to use new interface. + * ada/init.c: Reorder so the simple single OS conditional __rtems__ + is tested before more complex ones which mix UNIX and embedded + systems in the conditional. + +2004-04-08 Joel Sherrill + + PR ada/14665 + * ada/osint.adb (Find_Program_Name): Rework to properly handle + filenames which end in .exe or have versioning suffixes like VMS. + +2004-04-08 Andrew Pinski + + PR target/10129 + * config/darwin.c (darwin_encode_section_info): When the decl has + a DECL_INITIAL, it is only defined also when it is not a common. + +2004-04-08 Kaveh R. Ghazi + + * builtins.c (fold_builtin_isascii, fold_builtin_toascii): New. + (fold_builtin): Handle BUILT_IN_ISASCII and BUILT_IN_TOASCII. + +2004-04-07 H.J. Lu + + * config/ia64/ia64.c (ia64_encode_section_info): Don't prod + global register variables. + +2004-04-07 Joseph S. Myers + + * fixinc/inclhack.def (rpc_xdr_lvalue_cast_a, + rpc_xdr_lvalue_cast_b): New fixes. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/rpc/xdr.h: Add new tests. + +2004-04-07 David Edelsohn + + * config/rs6000/rs6000.c (processor_target_table): Add MASK_MFCRF + to power4 and power5 entries. + +2004-04-06 Geoffrey Keating + + * c-common.h (pending_lang_change): Mark for PCH. + +2004-04-07 Caroline Tice + + * gcc.c (main): Move 'break' in main loops (on an error) + to wait until error processing has occurred. + +2004-04-06 Nathanael Nerode + + * config.gcc: Stop changing enable_threads midstream. + Replace uses of enable_threads_flag with enable_threads. + * configure.ac: Replace uses of enable_threads_flag with + enable_threads. Improve autoconf quotation in one place. + * configure: Regenerate. + +2004-04-06 Uros Bizjak + + * builtins.c: Implement support for sincos function. + (expand_builtin_mathfn): Remove BUILT_IN_SIN{,F,L} and + BUILT_IN_COS{,F,L}. + (expand_builtin_mathfn_3): New function. + (expand_builtin): Expand BUILT_IN_SIN{,F,L} and + BUILT_IN_COS{,F,L} using expand_builtin_mathfn_3 if + flag_unsafe_math_optimization is set. + + * optabs.h (enum optab_index): Add new OTI_sincos. + (sincos_optab): Define corresponding macro. + + * optabs.c (init_optabs): Initialize sincos_optab. + (expand_twoval_unop): New function. + + * genopinit.c (optabs): Implement sincos_optab using sincos?f3 + patterns. + + * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_SINCOS_COS + and UNSPEC_SINCOS_SIN. + + * config/i386/i386.md (sincosdf3, sincossf3, *sincosextendsfdf3, + sincosxf3): New patterns to implement sincos, sincosf and sincosl + built-ins as inline x87 intrinsics. Define splits for + sindf2, sinsf2, *sinextendsfdf2, sinxf2, cosdf2, + cossf2, *cosextendsfdf2 and cosxf2 patterns from corresponding + sincos patterns. + (sindf2, sinsf2, sinxf2): Rename to *sindf2, *sinsf2, *sinxf2. + (cosdf2, cossf2, cosxf2): Rename to *cosdf2, *cossf2, *cosxf2. + + (UNSPEC_SINCOS_SIN, UNSPEC_SINCOS_COS): New unspecs to represent + x87's fsincos insn. + +2004-04-06 Devang Patel + + PR 14467 + * config/darwin.h (LINK_COMMAND_SPEC): Use c++filt instead of c++filt3. + +2004-04-06 John David Anglin + + * doc/install.texi: Update HP-UX 11 installation procedure. + +2004-04-06 Paul Brook + + * doc/sourcebuild.texi: Remove obsolete contraint on testcases. + +2004-04-05 Kaz Kojima + + * config/sh/sh.c (prepare_move_operands): Use emit_call_insn + when the TLS address is generated by a function call. + * config/sh/sh.md (tls_global_dynamic): Use a call expression. + (tls_local_dynamic): Likewise. + +2004-04-05 Andrew Pinski + + * tree.c (reconstruct_complex_type): Use TYPE_READONLY + and TYPE_VOLATILE. + +2004-04-05 Caroline Tice + + * gcc.c (combine_flag): New global variable, for new driver option. + (struct compiler): Add two new fields, to be used when + combining multiple input files in a single pass (IMA). + (default_compilers): Add values for the new fields to all + compiler entries. Modify the "@c" compiler entry for doing IMA + properly with "-save-temps" and the "combine" flag. + (option_map): Add new driver option, "--combine", to tell driver + to pass multiple input files to compiler at one time. + (have_o_argbuf_index): New global variable. + (store_arg): Modify to assign value to have_o_argbuf_index. + (struct infile): Add three new fields, to help with IMA. + (display_help): Add help for new "combine" option. + (process_command): Remove local variable have_o; add code to check + for new "combine" option; remove assignment to combine_inputs. + (do_spec_1): Modify to deal with IMA better. + (main): Make variable 'lang_n_infiles' local to entire function + rather than to a single block. Use flag combine_flag to + determine whether to do IMA or not; Modify loop initializing + infiles to deal properly with linker files. + Add code for doing preprocessing in presence of + IMA with "-save-temps" flag. Modify "main" loop to handle + multiple input files, in multiple languages, with or without + preprocessing, gracefully. + * toplev.c (set_src_pwd): Modify to not complain if attempting to + re-set it to same directory it's previously been set to (avoid + irritating, meaningless warning messages when doing IMA with + save-temps). + * doc/invoke.texi: Add "-combine" to list of Overall Options; + remove documentation about IMA that is no longer accurate; Add + documentation explaining what "-combine" does. + * ada/lang-specs.h: Add initialization values for new fields in + "struct compiler". + * cp/lang-specs.h: Likewise. + * f/lang-specs.h: Likewise. + * java/lang-specs.h: Likewise. + * objc/lang-specs.h: Likewise. + * treelang/lang-specs.h: Likewise. + +2004-04-05 David Edelsohn + + * config/rs6000/rs6000.c (VTABLE_NAME_P): Add _ZTI to special + symbol handling. + +2004-04-05 Jakub Jelinek + John David Anglin + + PR optimization/13424 (hppa), bootstrap/14462, c/14828 + * pa.md: Use replace_equiv_address to retain the attributes of the + memory operands used in the split and peephole2 patterns for optimizing + the pre-reload movstrsi, movstrdi, clrstrsi and clrstrdi patterns. + +2004-04-05 Richard Kenner + + * c-decl.c (build_compound_literal): Use TYPE_READONLY. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. + * objc/objc-act.c (adorn_decl, gen_declspecs): Likewise. + * c-typeck.c (decl_constant_value): Don't access DECL_INITIAL of a + PARM_DECL. + * calls.c (flags_from_decl_or_type): Use TYPE_READONLY and do so only + for a type. + * print-tree.c (print_node): Properly handle side-effects, readonly, + and constant flags. + * tree.c (build1_stat, build_expr_wfl): Only look at TREE_SIDE_EFFECTS + and TREE_CONSTANT if not a type. + * tree.h (IS_NON_TYPE_CODE_CLASS): New macro. + (IS_EXPR_CODE_CLASS): Write 'E', not 'e'. + (NON_TYPE_CHECK): New macro. + (TREE_SIDE_EFFECT, TREE_READONLY, TREE_CONSTANT: Add check. + +2004-04-05 Eric Botcazou + + * config/sparc/sol2-bi.h (PREFERRED_DEBUGGING_TYPE): Set + to DWARF2_DEBUG unconditionally. + (ASM_DEBUG_SPEC): Set the default to --gdwarf2 unconditionally. + +2004-04-04 Ian Lance Taylor + Nathanael Nerode + + PR target/14548 + * config.host: Set the shell variable host_can_use_collect2. + Set it to yes by default, and to no for alpha*-dec-*vms*, + i[34567]86-*-mingw32*, and powerpc-*-beos*. + * configure.ac: Set and substitute the shell variable collect2. + Give an error if use_collect2 is yes and host_can_use_collect2 is + no. + * Makefile.in (COLLECT2): Rename from USE_COLLECT2. Change all + uses. Initialize to @collect2@. + (STAGESTUFF): Remove $(USE_COLLECT2). + * config/alpha/x-vms (USE_COLLECT2): Don't set. + * config/i386/t-mingw32 (USE_COLLECT2): Likewise. + * config/rs6000/t-beos (USE_COLLECT2): Likewise. + * config/pa/t-pa64: Remove commented out USE_COLLECT2. + * configure: Regenerate. + +2004-04-04 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation): Constant fold + DIV, MOD, UDIV and UMOD using div_and_round_double. + +2004-04-04 Mark Mitchell + + PR c++/14804 + * varasm.c (initializer_constant_valid_p): Allow NOP_EXPRs to + RECORD_TYPEs. + +2004-04-04 Mark Mitchell + + * doc/invoke.texi (-mabi=o64): Create link to O64 ABI + documentation. + +2004-04-04 Roger Sayle + + * cse.c (cse_insn): Correct usage of simplify_replace_rtx when + updating the REG_EQUAL note on an insn's libcall_insn. + +2004-04-04 Roger Sayle + + * df.h: Tidy up whitespace in the definitions of the DF_ flags. + +2004-04-03 Roger Sayle + + * fold-const.c (fold) : Guard (-A)+B -> B-A transformation + with reorder_operands_p. + +2004-04-03 Jan Hubicka + + * md.texi (vec_set, vec_extract, vec_init): Document. + +2004-04-02 Gabor Loki + + * opts.c (decode_options): Do function inlining with very small + max-inline-insns-* parameters when optimizing for size. + +2004-04-02 Vladimir Makarov + + * config/i386/i386.h (TARGET_NOCONA): New macro. + (TARGET_CPU_CPP_BUILTINS): Add code for Nocona. + (processor_type): Add PROCESSOR_NOCONA. + + * config/i386/i386.md (cpu): Add nocona to the attribute values. + + * config/i386/i386.c (nocona_cost): New variable. + (m_NOCONA): New macro. + (x86_push_memory, x86_movx, x86_cmove, x86_deep_branch, + x86_branch_hints, x86_use_sahf, x86_single_stringop, + x86_sub_esp_4, x86_sub_esp_8, x86_add_esp_4, x86_add_esp_8, + x86_integer_DFmode_moves, x86_partial_reg_dependency, + x86_memory_mismatch_stall, x86_accumulate_outgoing_args, + x86_decompose_lea, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_sse_load0_by_pxor, + x86_ext_80387_constants, x86_four_jump_limit): + (override_options): Add nocona_cost to processor_target_table. + Set up PROCESSOR_NOCONA for Nocona entry in processor_alias_table. + (incdec_operand): Prevent inc/dec generation for Nocona too. + (ix86_issue_rate): Add PROCESSOR_NOCONA. + +2004-04-01 Andrew Pinski + + * rtlanal.c (find_reg_note): Manually + unswitch the loop. + +2004-04-01 Mark Mitchell + + * genemit.c (gen_split): Change prototype of generated code. + * genrecog.c (write_action): Adjust prototype for and calls to + gen_split_*. + * gensupport.c (struct queue_elem): Add split field. + (queue_pattern): Return a value. Clear the split field. + (process_rtx): Maintain an association between an insn and the + split generated from it for a define_insn_and_split. + (process_one_cond_exec): Generate a new split for a + define_insn_and_split. + * config/arm/arm-protos.h (arm_split_constant): Add insn + parameter. + (emit_constant_insn): New function. + (arm_gen_constant): Use it. + * config/arm/arm.md: Adjust calls to arm_split_constant. + +2004-04-02 Jan Hubicka + + * cgraph.c: Add overall comment. + (cgraph_inline_hash): New global variable. + (cgraph_create_node): Break out from ... + (cgraph_node): ... here. + (cgraph_edge): New function. + (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. + (cgraph_remove_edge): Accept edge, intead of source and destination. + (cgraph_redirect_edge_callee): New. + (cgraph_remove_node): Update all new datastructures. + (cgraph_record_call, cgraph_remove_call): Kill. + (dump_cgraph_node): Break out from ... ; dump new datastructures. + (dump_cgraph): ... here. + (cgraph_function_possibly_inlined_p): Use new hashtable. + (cgraph_clone_edge, cgraph_clone_node): New. + * cgraph.h: Include hashtab.h + (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output + fields, add inlined_to pointer. + (cgraph_node): Add pointer to next_clone. + (cgraph_remove_edge, cgraph_create_edge): Update prototype. + (cgraph_remove_call, cgraph_record_call): Kill. + (cgraph_inline_hash): Declare. + (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, + cgraph_redirect_edge_callee): Declare. + (cgraph_create_edges, cgraph_inline_p): Update prorotype. + (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, + cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. + * cgraphunit.c: Add overall comment. + (cgraph_optimize_function): Kill. + (cgraph_assemble_pending_functions): Do not assemble inline clones. + (cgraph_finalize_function): Update call of cgraph_remove_node + (record_call_1): Record call sites. + (cgraph_create_edges): Accept node instead of decl argument. + (error_found): New static variable. + (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. + (cgraph_analyze_function): Update for new datastructures. + (cgraph_finalize_compilation_unit): Plug memory leak. + (cgraph_optimize_function): Kill. + (cgraph_expand_function): Do not use cgraph_optimize_function. + (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, + cgraph_inlined_callees): Kill. + (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of + clones. + (estimate_growth): Simplify. + (cgraph_clone_inlined_nodes): New function. + (cgraph_mark_inline_edge): Re-implement. + (cgraph_mark_inline): Likewise. + (cgraph_check_inline_limits): Simplify. + (cgraph_recursive_inlining_p): New. + (update_callee_keys): Break out from ... + (cgraph_decide_inlining_of_small_functions): ... here; simplify. + (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): + Likewise. + (cgraph_expand_all_functions): Remove inline clones from the ordered + list. + (cgraph_preserve_function_body_p): New predicate. + (cgraph_optimize): Verify cgraph. + * function.h (struct function): Add fields saved_tree/saved_args. + * timevar.def (TV_CGRAPH_VERIFY): Use verifier. + * toplev.c (rest_of_compilation): Do not free cfun. + * tree-inline.c: Include function.h + (struct inline_data): Add saving_p field; replace decl/current_decl by + node/current_node. + (insert_decl_map): New function. + (copy_body_r): Handle saving; update cgraph datastructure. + (copy_body): Handle recursive inlining. + (initialize_inlined_parameters): Likewise. + (expand_call_inline): Propagate node attributes; update cgraph. + (optimize_inline_calls): Verify that datastructure still match. + (save_body): New function. + * tree-inline.h (save_body): New. + * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. + * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. + * langhooks.c (lang_hooks): Add update_decl_after_saving. + +2004-04-01 Serge Belyshev <1319@bot.ru> + + PR target/14702 + * config/i386/i386.md: fix source operand constraints in + mmx_pshufw, sse2_pshufd, sse2_pshuflw, sse2_pshufhw + +2004-04-01 Waldek Hebisch + + * fold-const.c (folda): Preserve types of comparisons. + +2004-04-01 Richard Henderson + + * toplev.c (backend_init): Move init_optimization_passes call ... + (lang_dependent_init): ... here. + +2004-04-01 Alan Modra + Jakub Jelinek + + * gcc.c (init_gcc_specs): If HAVE_LD_AS_NEEDED, link with + -lgcc --as-needed -lgcc_s --no-as-needed by default. + * configure.ac (HAVE_LD_AS_NEEDED): Check for ld --as-needed. + * configure: Rebuilt. + * config.in: Rebuilt. + * Makefile.in (stage1-start): Copy also libgcc_s*$(SHLIB_EXT). + (stage2-start, stage3-start, stage4-start): Likewise. + (stageprofile-start, stagefeedback-start): Likewise. + +2004-04-01 Jakub Jelinek + + * config/sparc/sparc.h (DITF_CONVERSION_LIBFUNCS): Define to 0. + * config/sparc/linux.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. + * config/sparc/linux64.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. + * config/sparc/sol2.h (DITF_CONVERSION_LIBFUNCS): Redefine to 1. + (SOLARIS_CONVERSION_LIBFUNCS): Rename to SUN_CONVERSION_LIBFUNCS. + * config/sparc/sparc.c (sparc_init_libfuncs): Initialize optabs + with _Q_qtoll, _Q_qtoull and _Q_lltoq if DITF_CONVERSION_LIBFUNCS. + * config.gcc (sparc-*-linux*): Revert 2004-03-23 change. + * config/sparc/t-linux64 (TARGET_LIBGCC2_CFLAGS): Likewise. + * config/sparc/t-linux: Removed. + +2004-04-01 Jakub Jelinek + + PR c++/14755 + * fold-const.c (fold) : Properly compute newconst in + "bitfld++ == const" to "++bitfld == const + incr" transformations. + +2004-04-01 Richard Kenner + + * expr.c (get_inner_reference): Use DECL_UNSIGNED, not TREE_UNSIGNED. + * stor-layout.c (layout_decl): Likewise. + * tree.c (get_narrower): Likewise and also use BIT_FIELD_REF_UNSIGNED. + * fold-const.c (make_bit_field_ref): Use BIT_FIELD_REF_UNSIGNED. + * print-tree.c (print_node): Handle various used of unsigned_flag. + * tree.def (BIT_FIELD_REF): Update comment. + * tree.h (TREE_UNSIGNED): Deleted. + (DECL_UNSIGNED, BIT_FIELD_REF_UNSIGNED): New macros. + +2004-03-31 Richard Kenner + + * builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c: + Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED. + * c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise. + * calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise. + * expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise. + * optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise. + * tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise. + * config/mips/mips.c, config/rs6000/rs6000.c: Likewise. + * config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise. + * stor-layout.c (layout_type, case COMPLEX_TYPE): Test for + REAL_TYPE, not INTEGER_TYPE. + (layout_type, case VECTOR_TYPE): Simplify code. + * tree.c (build_vector_type_for_mode): Remove dup unsigned setting. + * tree.h: Update comments. + (STRIP_NOPS): Use TYPE_UNSIGNED. + (TYPE_UNSIGNED): New macro. + (TYPE_TRAP_SIGNED): Remove now redundant check. + (SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED. + +2004-03-31 Richard Kenner + + * function.c (put_var_into_stack): Properly set orig_reg for indirect. + +2004-03-31 Andrew Pinski + + * config/rs6000/t-darwin (LIB2FUNCS_STATIC_EXTRA): + Add darwin-fpsave.asm, darwin-vecsave.asm, + and darwin-world.asm. + (TARGET_LIBGCC2_CFLAGS): Add -Wa,-force_cpusubtype_ALL + as the asm files contain altivec instructions. + * config/rs6000/darwin-fpsave.asm: New file. + * config/rs6000/darwin-vecsave.asm: New file. + * config/rs6000/darwin-world.asm: New file. + +2004-03-31 Zack Weinberg + + * gengtype-yacc.y (option, stringseq): Add missing + terminating semicolon. + +2004-03-30 David Edelsohn + + * config/rs6000/rs6000.md (tls_gd_32, tls_gd_64, + tls_ld_32, tls_ld_64, tls_dtprel_32, tls_dtprel_64, + tls_dtprel_ha_32, tls_dtprel_ha_64, + tls_dtprel_lo_32, tls_dtprel_lo_64, + tls_got_dtprel_64, tls_tprel_32, tls_tprel_64, + tls_tprel_ha_32, tls_tprel_ha_64, + tls_tprel_lo_32, tls_tprel_lo_64, + tls_got_tprel_32, tls_got_tprel_64, + tls_tls_32, tls_tls_64): Replace register_operand with + gpc_reg_operand. + +2004-03-30 Mostafa Hagog + + * config/rs6000/rs6000.md (*ctrsi_internal1, *ctrsi_internal2, + *ctrdi_internal1, *ctrdi_internal2, *ctrsi_internal3, + *ctrsi_internal4, *ctrdi_internal3, *ctrdi_internal4, + *ctrsi_internal5, *ctrsi_internal6, *ctrdi_internal5, + *ctrdi_internal6): Replace register_operand with + nonimmediate_operand. + +2004-03-29 Fariborz Jahanian + + * fold-const.c (fold): Reassociate multiply expression + with an adjacent non-multiply expression to use + architecture's multiply-add instruction. + +2004-03-30 Zack Weinberg + + * gengtype.c (create_option): New function. + * gengtype.h: Prototype it. + * gengtype-yacc.y (stringseq): New rule. + (option): Use create_option. Add new bare ID production. Use + stringseq, not STRING directly. + + * alias.c, bitmap.c, c-decl.c, cgraph.h, cpplib.h, cselib.h + * dwarf2out.c, emit-rtl.c, function.h, lists.c, tree.h + * varray.h, config/alpha/alpha.c: + Use new shorter form of GTY markers. + + * doc/gty.texi: Rewrite. + +2004-03-30 Andrew Pinski + + * config/darwin.c (machopic_function_base_name): + Remove current_name and getting the name of the + current function. + +2004-03-30 Nick Clifton + + * config/arm/arm.md (thumb_jump): Reduce the backward branch + range, and increase the forward branch range, to allow for + the fact that the PC will be off by 4. + +2004-03-30 Alan Modra + + * .cvsignore: Add GPATH, GRTAGS, GSYMS and GTAGS (GNU GLOBAL) + +2004-03-30 Hartmut Penner + + * config/rs6000/rs6000.c (output_vec_const_move): + Find all cases of EASY_VECTOR_15_ADD_SELF. + (easy_vector_constant_add_self): Accept + all vector constant loadable by vsplt* and vadd*. + (easy_vector_same): Use easy_vector_splat_const. + (easy_vector_const): Use easy_vector_splat_const. + (easy_vector_splat_const): New function. + (gen_easy_vector_constant_add_self): New function. + + * config/rs6000/rs6000-protos.c (gen_easy_vector_constant_add_self): + New prototype. + + * config/rs6000/altivec.md (movv4si splitter): Change to + emit move insn with halfed vector constant. + (*movv8hi splitter): Likewise. + (*movv16qi splitter): Likewise. + +2004-03-30 Hartmut Penner + + PR 11591 + * config/rs6000/rs6000.c (rs6000_legitimate_address): + Allow any offset to argument pointer in no-strict case. + +2004-03-30 Jan Hubicka + + * toplev.c (backend_init): Add missing call to inint_optimization_passes. + * passes.c (init_optimization_passes, finish_optimization_passes): Output cgraph + dump file in non-unit-at-a-time mode. + +2004-03-29 Hans-Peter Nilsson + + * config/cris/cris.h: Correct #ifdef to test for + HAVE_AS_NO_MUL_BUG_ABORT_OPTION, not + HAVE_AS_MUL_BUG_ABORT_OPTION. + +2004-03-29 Richard Kenner + + * function.c (put_var_into_stack): If old RTL was ADDRESSOF, update + the address inside the old RTL. + +2004-03-28 Zack Weinberg + + * c-decl.c: Verify that C_SIZEOF_STRUCT_LANG_IDENTIFIER is correct. + (struct c_binding, struct c_scope): Add chain_next + attributes to GTY markers. + (struct lang_identifier, struct lang_tree_node): Define + here... + * c-tree.h: ... not here. No longer need to declare struct + c_binding either. Do define C_SIZEOF_STRUCT_LANG_IDENTIFIER. + * c-lang.c, objc/objc-lang.c: Set LANG_HOOKS_IDENTIFIER_SIZE + to C_SIZEOF_STRUCT_LANG_IDENTIFIER. + + PR 14734, 11944 + * c-decl.c (get_parm_info): If error_mark_node is encountered + in the bindings chain, unbind and discard it; don't abort. + +2004-03-28 Olga Golovonevsky + Dorit Naishlos + + * config/rs6000/altivec.md: (andvv16qi3, andv8hi3, one_cmplv16qi2, + one_cmplv8hi2, one_cmplv4si2, iorv16qi3, iorv8hi3,): New modelling. + +2004-03-28 Stephane Carrez + + * config/m68hc11/m68hc11-protos.h (m68hc11_page0_symbol_p): Declare. + + * config/m68hc11/m68hc11.c (m68hc11_handle_page0_attribute): New. + (m68hc11_attribute_table): New attribute "page0" to mark a global + variable as being allocated from within page0 section. + (m68hc11_encode_label): New function. + (m68hc11_strip_name_encoding): New function. + (m68hc11_page0_symbol_p): New function. + (m68hc11_indirect_p): Accept global variables marked in page0. + (m68hc11_encode_section_info): Lookup "page0" attribute. + + * config/m68hc11/m68hc11.h (EXTRA_CONSTRAINT): 'R' constraint also + represents access to page0 variables. + + * config/m68hc11/m68hc11.md ("*logicalsi3_zexthi"): Use gen_rtx_REG. + ("*logicalsi3_silshl16_zext"): Likewise. + ("*ashldi3_const32"): Likewise. + (peephole2 ashift): Likewise. + +2004-03-28 Joseph S. Myers + + * c-tree.h (C_DECL_REGISTER): New. + * c-aux-info.c (gen_decl), c-decl.c (objc_mark_locals_volatile, + finish_decl, grokdeclarator, get_parm_info), c-typeck.c + (build_array_ref, c_mark_addressable): Set and use it. + * c-decl.c (grokdeclarator), c-typeck.c (c_mark_addressable): + Allow structures with volatile fields to be declared register. + Don't check TREE_ADDRESSABLE before warning about taking address + of register. + * c-decl.c (finish_decl): Don't allow structures with volatile + fields to be placed in named register. + * doc/trouble.texi: Remove reference to structures with volatile + fields in registers. + +2004-03-27 Ulrich Weigand + + * function.c (thread_prologue_and_epilogue): Move + NOTE_INSN_FUNCTION_END and NOTE_INSN_FUNCTION_BEG notes + before the epilogue. + +2004-03-27 Ulrich Weigand + + * expr.c (store_constructor): Use gen_int_mode to correctly + sign-extend CONST_INT value. + +2004-03-27 Kaveh R. Ghazi + + * builtin-types.def (BT_WINT, BT_FN_INT_WINT, BT_FN_WINT_WINT): New. + * builtins.def (DEF_C94_BUILTIN): New. Add wctype builtins. + * doc/extend.texi: Likewise. + +2004-03-26 Diego Novillo + + * c-typeck.c (comptypes): Replace calls to TYPE_DOMAIN + with TYPE_ORIG_SIZE_TYPE. + +2004-03-25 Aldy Hernandez + + PR 14219 + * c-typeck.c (build_binary_op): Do not allow comparisons of + vectors. + +2004-03-26 James A. Morrison + + * config.gcc: Remove sparc-tti-*. + * config/sparc/pbd.h: Delete. + + * config/sparc/sol2.h: Remove note about Sun OS 4.x. + * config/sparc/aout.h: Likewise. + + * config/sparc/sparc.h: Remove if 0'd code. + * config/sparc/sparc.md (call): Remove if 0'd code. + (call_value): Likewise. + (nonlocal_goto): Likewise. + (unimp_insn): Delete. + +2004-03-25 Roger Sayle + + * fold-const.c (tree_expr_nonnegative_p): Handle BIT_XOR_EXPR like + BIT_IOR_EXPR; A^B is nonnegative when A and B are nonnegative. + +2004-03-25 Richard Henderson + + PR 11527 + * c-typeck.c (pop_init_level): Emit pending init elements earlier + rather than later. + +2004-03-25 Kaveh R. Ghazi + + * builtins.c (fold_builtin): Fix error in last change. + +2004-03-25 Richard Sandiford + + * config/mips/mips.h: Formatting fix. + +2004-03-25 Kaveh R. Ghazi + + * builtins.def: Add ctype builtins. + * doc/extend.texi: Likewise. + +2004-03-25 Kaveh R. Ghazi + + * builtins.c (fold_builtin): Add new builtin optimizations for + sqrt and/or cbrt. + * fold-const.c (fold): Likewise. + +2004-03-25 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_always_hint): New variable. + (rs6000_sched_groups): New variable. + (processor_target_table): Add power5. + (rs6000_override_options): Set rs6000_sched_insert_nops, + rs6000_sched_costly_dep and rs6000_sched_restricted_insns_priority + from rs6000_sched_groups. + (output_cbranch): Use rs6000_always_hint. + (rs6000_variable_issue): Use rs6000_sched_groups. + (rs6000_adjust_cost): Add CPU_POWER5. + (is_microcoded_insn): Use rs6000_sched_groups. + (is_dispatch_slot_restricted): Use rs6000_sched_groups. + Return 2 for POWER5 cracked instructions. + (is_cracked_insn): Use rs6000_sched_groups. + (is_branch_slot_insn): Use rs6000_sched_groups. + (rs6000_issue_rate): Add CPU_POWER5. + (rs6000_sched_finish): Use rs6000_sched_groups. + (rs6000_rtx_costs): Add PROCESSOR_POWER5. + * config/rs6000/rs6000.h (processor_type): Add PROCESSOR_POWER5. + (DEFAULT_SCHED_COSTLY_DEP): Delete. + (DEFAULT_RESTRICTED_INSNS_PRIORITY): Delete. + (DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME): Delete. + * config/rs6000/rs6000.md (define_attr "cpu"): Add power5. + * config/rs6000/power5.md: New file. + * doc/invoke.texi: Add power5 option. + +2004-03-25 Kazu Hirata + + * cfgrtl.c, dbxout.c, tree.def, config/darwin.h, + config/arm/arm.c, objc/objc-act.c: Fix comment typos. + * doc/invoke.texi: Fix a typo. + +2004-03-25 Kazu Hirata + + PR optimization/9707. + * stmt.c (emit_case_nodes): Emit equality comparisons instead + of recursing if both children are single-valued cases with no + children. + +2004-03-25 Paul Brook + + * config/arm/arm.c (vfp_print_multi): Remove. + (arm_output_fldmx): New function. + (vfp_emit_fstmx): Return block size, not insn. Add ARM10 VFPr1 bugfix. + (arm_expand_prologue): Update to match. + (arm_get_vfp_saved_size): New Function. + (arm_get_frame_offsets): Use it. + (arm_output_epilogue): Use new functions. + +2004-03-24 Richard Henderson + + * alias.c (alias_invariant, alias_invariant_size): Mark GTY. + (reg_known_value, reg_known_value_size): Likewise; make static. + (reg_known_equiv_p): Make static. + (clear_reg_alias_info): Update for new indexing. + (get_reg_known_value, set_reg_known_value): New. + (get_reg_known_equiv_p, set_reg_known_equiv_p): New. + (canon_rtx): Use them. + (init_alias_analysis): Likewise. Allocate reg_known_value with gc. + Don't play queer offsetting games with reg_known_value and + reg_known_equiv_p. + (end_alias_analysis): Free reg_known_value with gc. + * rtl.h (get_reg_known_value, get_reg_known_equiv_p): Declare. + * sched-deps.c (reg_known_equiv_p, reg_known_value): Remove. + (deps_may_trap_p, sched_analyze_1, sched_analyze_2): Use the new + functions instead. + +2004-03-24 Kazu Hirata + + * dwarf2asm.c, loop.h, pretty-print.c, pretty-print.h, + config/i386/mmintrin.h: Update copyright. + +2004-03-24 Nathanael Nerode + + * configure.ac: Add --enable-werror-always (for top level bootstrap + support). + * configure: Regenerate. + +2004-03-24 Ziemowit Laski + + * objc/objc-act.c (objc_comptypes): Treat comparisons + between 'Class' and ' *' as explicitly invalid. + +2004-03-24 David Edelsohn + + * doc/invoke.texi (-frename-registers): Add enabled at -O3. + (-fprofile-values): Add enabled with profile-{generate,use}. + (-fvpt): Same. + (-ftracer): Add enabled with profile-use. + (-funit-at-a-time): Add enabled at -O2,-O3. + (-funroll-loops): Add enabled with profile-use. + (-funswitch-loops): Add enabled with profile-use. Remove duplicates. + (max-gcse-passes): Mention default. + (max-cse-path-length): Mention default. + +2004-03-24 Nathanael Nerode + + * Makefile.in (STRICT2_WARN): Reorder. + * configure.ac: Check for -Wold-style-definition, and use it + in strict1_warn if it's available. + * configure: Regnerate. + +2004-03-24 Paul Brook + + * config.gcc : Add --with-abi= + * config/arm/arm-protos.h (arm_get_frame_size, thumb_get_frame_size, + thumb_far_jump_used): Remove prototypes. + (arm_needs_doubleword_align): Add prototype. + (thumb_compute_initial_elimination_offset): Ditto. + * config/arm/arm.c (arm_get_frame_offsets): New function. + (use_return_insn, output_return_instruction, arm_output_epilogue, + arm_output_function_epilogue, arm_compute_initial_elimination_offset, + arm_expand_prologue, thumb_expand_epilogue): Use it. + (arm_abi, target_abi_name, all_arm_abis): New variables. + (arm_override_options): Set them. Set structure padding for AAPCS. + (arm_return_in_memory): Update ABI check. + (arm_init_cumulative_args): Initialize can_split. + (arm_needs_doubleword_align): New function. + (arm_function_arg): Don't split args after pushing to stack. Handle + doubleword/even reg alignment. + (arm_va_arg): Handle all doubleword aligned args. + (add_minpoolforward ref, dump_minpool, push_minpool_fix): Align based + on ABI, not CPU. + (arm_compute_save_reg0_reg12_mask): Fix comment. + (thumb_get_frame_size, thumb_get_frame_size): Remove. + (thumb_jump_far_used_p): Remove superfluous argument. Return save + value for alignment. + (thumb_unexpanded_epilogue, thumb_output_function_prologue): Change + to match. + (thumb_compute_initial_elimination_offset): New function. + (thumb_expand_prologue): Use arm_get_frame_offsets. Remove + unneccessary rounding. + * config/arm/arm.h (target_abi_name): Declare. + (ARM_DOUBLEWORD_ALIGN, DOUBLEWORD_ALIGNMENT, TARGET_IWMMXT_ABI, + arm_abi_type, ARM_DEFAULT_ABI): Define. + (ARM_FLAG_ATPCS): Remove. + (TARGET_OPTIONS, OPTION_DEFAULT_SPECS): Add -mabi=. + (BIGGEST_ALIGNMENT, PREFERRED_STACK_BOUNDARY, STACK_BOUNDARY): Use it. + (ADJUST_FIELD_ALIGN, DATA_ALIGNMENT, LOCAL_ALIGNMENT, + TYPE_NEEDS_IWMMXT_ALIGNMENT): Remove. + (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, FUNCTION_ARG_REGNO_P): + Contitionalize on ABI, not CPU. + (struct arm_stack_offsets): Define. + (struct machine_function): Add stack_offsets. Remove frame_size. + (FUNCTION_ARG_PARTIAL_NREGS): Don't split if previous args have been + pushed. + (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_BOUNDARY): Handle general + doubleword alignment. + (THUMB_INITIAL_ELIMINATION_OFFSET, + ARM_INITIAL_ELIMINATION_OFFSET): Remove. + (INITIAL_ELIMINATION_OFFSET): Call functions directly. + * config/arm/arm.md (align_8): Enable for all targets. + * config/arm/netbsd-elf.h (TARGET_DEFAULT): Remove TARGET_ATPCS. + (ARM_DEFAULT_ABI): Define. + * doc/invoke.texi : Document -mabi=. Update documentation for + -mstructure-size-boundary. + +2004-03-24 Nathanael Nerode + + * configure.ac: Check for -Wno-variadic-macros; don't use + -pedantic (in stage 1 or a simple 'make all') unless it's available, + and if it's available, use it. Also, clean up check for + -Wno-long-long. + * configure: Regenerate. + +2004-03-24 Richard Sandiford + + * config.gcc (mips64vr-*-elf*, mips64vrel-*-elf*): Remove tm_defines. + * config/mips/vr.h (DEFAULT_VR_ARCH): New macro, defined to vr4130. + (MULTILIB_DEFAULTS): Use it. + (MIPS_CPU_STRING_DEFAULT): Remove. + (MIPS_ABI_DEFAULT, MIPS_MARCH_CONTROLS_SOFT_FLOAT): Define. + (DRIVER_SELF_SPECS): Make -mfix-vr4122-bugs imply -march=vr4120. Make + EABI64 -mlong32 the default ABI. Enforce the default architecture. + * config/mips/t-vr (MULTILIB_OPTIONS): Add mfix-vr4122-bugs, + march=vr4130, march=vr4300, march=vr5000 and march=vr5500. + (MULTILIB_MATCHES): Use -mfix-vr4122-bugs multilibs for -march=vr4120. + (MULTILIB_EXCEPTIONS): Change choice of multilibs. Update comments + accordingly. + +2004-03-24 DJ Delorie + Richard Sandiford + + * config/mips/mips.h (MASK_FIX_VR4122, TARGET_FIX_VR4122): New macros. + (TARGET_SWITCHES): Add -mfix-vr4122-bugs and -mno-fix-vr4122-bugs. + (ASM_SPEC): Pass down -mfix-vr4122-bugs. + * config/mips/mips.c (mips_avoid_hazards): Don't emit whole functions + in .set noreorder and .set nomacro if TARGET_FIX_VR4122. + (mips_init_libfuncs): Use special functions for divsi3 and modsi3 + if TARGET_FIX_VR4122. + * config/mips/mips.md (define_attr length): Account for nops inserted + after macc and dmult when using -mfix-vr4122-bugs. + (umuldi3_highpart, divmodsi4, divmoddi4): Disable if TARGET_FIX_VR4122. + * config/mips/t-vr (LIB2FUNCS_STATIC_EXTRA): Define instead of + LIB2FUNCS_EXTRA. Add config/mips/vr4122-div.S. + * config/mips/vr4122-div.S: New file. + * doc/invoke.texi: Document -mfix-vr4122-bugs. + +2004-03-24 Richard Sandiford + + * config/mips/mips.h (PROCESSOR_R4130): New processor_type. + (TARGET_MIPS4130): New macro. + (ISA_HAS_MACC): Return true if TARGET_MIPS4130 && !TARGET_MIPS16. + * config/mips/mips.c (mips_cpu_info_table): Add a vr4130 entry. + (override_options): Extend MIPS_MARCH_CONTROLS_SOFT_FLOAT to deal + with PROCESSOR_R4130. + * config/mips/mips.md (define_attr cpu): Add r4130. + * doc/invoke.texi: Document vr4130 as a supported MIPS architecture. + +2004-03-24 Maciej W. Rozycki + Richard Sandiford + + * doc/invoke.texi: Apply missed hunk from 2004-03-03 change. + +2004-03-24 Alexandre Oliva + + PR preprocessor/14438 + * cpplib.c (do_pragma): Remove line_change call after pragma + handler. + +2004-03-23 Ian Lance Taylor + + * doc/extend.texi (ARM Built-in Functions): Replace with correct + declarations. + +2004-03-23 Roger Sayle + + * reg-stack.c (get_true_reg): Handle FLOAT_TRUNCATE like FLOAT_EXTEND + if flag_unsafe_math_optimizations. + * config/i386/i386.md (truncdfsf2): If flag_unsafe_math_optimizations + and TARGET_80387 expand using truncdfsf2_noop pattern. + (truncxfsf2): Likewise using truncxfsf2_noop. + (truncxfdf2): Likewise using truncxfdf2_noop. + (truncdfsf2_noop, truncxfsf2_noop, truncxfdf2_noop): New patterns. + +2004-03-23 Ziemowit Laski + + * hooks.c (hook_constcharptr_tree_null): New hook. + * hooks.h (hook_constcharptr_tree_null): New prototype. + * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): New target hook. + * target.h (mangle_fundamental_type): New target hook. + * config/rs6000/rs6000.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Point + target hook at rs6000_mangle_fundamental_type. + (rs6000_mangle_fundamental_type): New function. + * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Document. + +2004-03-23 Zack Weinberg + + PR 12267, 12391, 12560, 13129, 14114, 14133 + * c-tree.h: Forward declare struct c_binding. Declare + c_override_bindings_to_false. Update prototypes. + (struct lang_identifier): Update comments. Change fields to be + struct c_binding *. + (IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE) + (IDENTIFIER_LABEL_VALUE, C_DECL_INVISIBLE) + (KEEP_NO, KEEP_YES, KEEP_MAYBE): Delete. + (C_DECL_IN_EXTERNAL_SCOPE, C_DECL_DECLARED_BUILTIN): New. + * c-common.h: Update prototypes. + * c-decl.c (struct c_scope): Update commentary. Remove names, + names_last, parms, parms_last, tags, and shadowed fields. Add + bindings and depth fields. + (scope_freelist): Move to more appropriate location. + (c_print_identifier): Update for changes to struct lang_identifier. + (objc_mark_locals_volatile): Update for new bindings structures. + (global_bindings_p): Honor c_override_global_bindings_to_false. + (pushlevel): Rename to push_scope; take no arguments; use the + scope_freelist; initialize scope->depth and check for overflow. + (poplevel): Rename to pop_scope; totally rewritten for new bindings + structures. + (diagnose_mismatched_decls): Use C_DECL_DECLARED_BUILTIN, not + C_DECL_INVISIBLE, for certain decisions. Adjust some diagnostics. + Improve some commentary. Adjust handling of forward parm decls. + (merge_decls): Set C_DECL_DECLARED_BUILTIN when appropriate. + Preserve C_DECL_IN_EXTERNAL_SCOPE. + (warn_if_shadowing): Correct indentation. Improve diagnostics. + (pushdecl): Remove unnecessary assertion. Short-circuit anonymous + decls. Rewrite for new bindings structures. Improve commentary. + Eliminate the copy_node call. + (implicit_decl_warning): Use the "diag" idiom (as seen in + locate_old_decl) to reduce code duplication; call locate_old_decl + if appropriate. Relocate to remove need for forward declaration. + (implicitly_declare): Adjust for new bindings structures. Kludge + around Objective-C not-really-builtin functions. + (undeclared_variable): Improve diagnostics. If current_function_decl + is nonnull but current_function_scope is null, use current_scope. + Use bind. + (lookup_tag): Adjust for new bindings structures. Kludge around + Objective-C's tag declarations that wind up in the external scope. + (lookup_name): Adjust for new bindings structures. Kludge around + c-common.c's pseudo-typedefs that wind up in the external scope. + (lookup_name_current_level): Rename lookup_name_in_scope; take a + second argument indicating the scope to examine; rewrite for + new bindings structures. + (c_init_decl_processing): Adjust for renamed functions. Do not + initialize current_file_decl, first_builtin_decl, last_builtin_decl. + First scope pushed is the external scope, not the global scope. + (builtin_function): Use bind, not pushdecl. Adjust other bits + for new data structures. Keep track of builtins that should be + made visible automatically. + (start_decl): Adjust diagnostics. Remove unnecessary call to + expand_decl. + (grokparms): Return 0 if arg_types is error_mark_node. + (get_parm_info): Rename "void_at_end" argument to "ellipsis", with + reversed sense. Rewrite for new bindings structures. Do not + leave any decls in the scope, to prevent pop_scope from doing + contradictory things with them. + (finish_struct, finish_enum): Remove redundant diagnostics. + (build_enumerator): Don't cascade diagnostics for error_mark_node. + Mark location where -pedantic changes the meaning of the program. + (store_parm_decls_newstyle, store_parm_decls_oldstyle): Load the + parameter decls into the function's scope structure using bind. + Warn here about function definitions in the wrong style. + Adjust diagnostics. + (store_parm_decls): Correct the determination of whether a + function was defined with a prototype. + (c_write_global_declarations): Operate on all file decls and on + the external scope. Split body of the loop to... + (c_write_global_declarations_1): ... this new function, to avoid + code duplication. + (truly_local_externals, first_builtin_decl, last_builtin_decl) + (make_scope, pop_scope, in_parm_level_p, set_block) + (any_external_decl, record_external_decl, bind_label, getdecls) + (link_hash_hash, link_hash_eq, merge_translation_unit_decls) + (c_reset_state): Delete. + (visible_builtins, c_override_global_bindings_to_false) + (c_binding, I_SYMBOL_BINDING, I_SYMBOL_DECL, I_TAG_BINDING) + (I_TAG_DECL, I_LABEL_BINDING, I_LABEL_DECL, file_scope) + (external_scope, binding_freelist, bind, free_binding_and_advance) + (push_file_scope, pop_file_scope): New. + (pushtag, pushdecl_top_level, lookup_label, declare_label) + (define_label, c_make_fname_decl, finish_decl) + (mark_forward_parm_decls, build_compound_literal) + (grokdeclarator, start_function, check_for_loop_decls) + (identifier_global_value, record_builtin_type): Minor adjustments + for new bindings structures. Improve diagnostics and commentary. + * c-objc-common.c (start_cdtor, finish_cdtor): Adjust calls to + pushlevel/poplevel respectively. + (c_objc_common_finish_file): Don't call merge_translation_unit_decls. + * c-opts.c (c_common_parse_file): Remove spurious ATTRIBUTE_UNUSED. + Warn about YYDEBUG not being defined only if -dy. Remove no-longer- + correct loop over multiple translation units; call fatal_error if + requested to compile more than one file at once. (This disables + IMA temporarily - an up-front error being preferable to a crash.) + * c-parse.in (pushlevel, poplevel rules): Rename push_scope, pop_scope. + (all actions): Adjust calls to pushlevel/poplevel. + (parsing_iso_function_signature): Delete. + (extdef_1): Fold into extdef. + (old_style_parm_decls_1): Fold into old_style_parm_decls. Don't + warn here about function definitions in the wrong style. + (after_tyle_declarator, parm_declarator_starttypename) + (parm_declarator_nostarttypename, notype_declarator): Remove + commented-out productions. + (parmlist_1, parmlist_2): Use make_node, not tree_cons, to create + an empty TREE_LIST node. Adjust calls to get_parm_info. + (parmlist_2 : ELLIPSIS): Tag the arg-info block with error_mark_node + to suppress -Wold-style-definition after this error. + (c_parse_file): Don't clear the binding stack or call + finish_fname_decls here. Correct comment. + * c-typeck.c (same_translation_unit_p): Export. + (common_type): Use c_override_global_bindings_to_false, not + pushlevel/poplevel/declare_parm_level. + * c-lang.c: Override LANG_HOOKS_CLEAR_BINDING_STACK, + LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK, + and LANG_HOOKS_GETDECLS with do-nothing stubs. + * objc/objc-lang.c: Likewise. + * objc/objc-act.c: Adjust all calls to pushlevel, poplevel, + get_parm_info. + (OBJC_VOID_AT_END): Delete; replace all uses + with void_list_node. + (generate_forward_declaration_to_string_table): Delete. + * objc/objc-act.h (OCTI_STRG_DECL, UOBJC_STRINGS_decl): Delete. + + * coverage.c (create_coverage): Don't pushdecl anything. + * langhooks.c (lhd_clear_binding_stack): Call + lang_hooks.decls.poplevel, not poplevel. + * tree.c (list_length): If ENABLE_TREE_CHECKING, abort on a + circular list rather than going into an infinite loop. + +2004-03-23 Olivier Hainque + + * optabs.c (expand_binop): When synthesizing double word rotates + from single word shifts, use a new register target if the provided + target is not a REG already. + +2004-03-23 Richard Kenner + + * alias.c (get_alias_set): Add support for TYPE_REF_CAN_ALIAS_ALL. + * c-common.c (handle_mode_attribute): Add extra arg to + build_pointer_type_for_mode and build_reference_type_for_mode. + * c-typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW + for INTEGER_CST. + * tree.c (build_pointer_type_for_mode): Add arg CAN_ALIAS_ALL. + Chain pointers via TYPE_NEXT_PTR_TO. + (build_reference_type_for_mode): Similarly. + (build_type_no_quals): Add extra arg to build_pointer_type_for_mode + and build_reference_type_for_mode. + (tree_check4_failed): New function. + * tree.h (TREE_CHECK4, PTR_OR_REF_CHECK): New macros. + (TYPE_REF_CAN_ALIAS_ALL, TYPE_NEXT_PTR_TO, TYPE_NEXT_REF_TO): Likewise. + (TREE_NO_UNSUED_WARNING, TREE_VIA_VIRTUAL, TREE_CONSTANT_OVERFLOW): + Add check. + +2004-03-23 Roger Sayle + + * fold-const.c (tree_expr_nonnegative_p): A&B is nonnegative when + A is nonnegative or B is nonnegative. Similarly A|B is nonnegative + when both A and B are nonnegative. + (tree_expr_nonzero_p): A|B is nonzero when A is nonzero or B is + nonzero. + +2004-03-23 Kazu Hirata + + * fold-const.c (fold): Remove cases for INTEGER_CST, REAL_CST, + VECTOR_CST, STRING_CST, COMPLEX_CST, and CONSTRUCTOR. + +2004-03-23 Kazu Hirata + + PR optimization/14669 + * fold-const.c (fold): Only unwiden integer comparisons for equality + and inequality operators, or when the signedness doesn't change. + +2004-03-23 Jakub Jelinek + + * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file. + * config/sparc/t-linux64 (TARGET_LIBGCC2_CFLAGS): Set. + * config/sparc/t-linux: New file. + +2004-03-23 Richard Sandiford + + * gcse.c (can_assign_to_reg_p): New function, split out from... + (want_to_gcse_p): ...here. + (compute_ld_motion_mems): Use can_assign_to_reg_p to validate + the rhs of a store. + +2004-03-22 Diego Novillo + + * c-typeck.c (same_translation_unit_p): Fix pasto. + +2004-03-22 David Edelsohn + + * params.def (PARAM_MAX_SCHED_REGION_BLOCKS): New. + (PARAM_MAX_SCHED_REGION_INSNS): New. + * sched-rgn.c: Include params.h + (MAX_RGN_BLOCKS): Delete. + (MAX_RGN_INSNS): Delete. + (too_large): Return bool. Convert to PARAM_VALUE. + * Makefile.in (sched-rgn.o): Depend on $(PARAMS_H). + * doc/invoke.texi (param): Document max-sched-region-blocks and + max-sched-region-insns. + +2004-03-22 Joel Brobecker + + * dwarf2out.c (is_subrange_type): Do not emit a subrange_type DIE + for base types. + +2004-03-22 Joel Brobecker + + * dwarf2out.c (is_subrange_type): Minor code rework. No behavior + change. + +2004-03-22 Jakub Jelinek + + PR c/14069 + * c-decl.c (finish_struct): Change type of incorrect flexible array + field into error_mark_node. + +2004-03-22 Andrew Pinski + + PR target/14580 + * config/rs6000/rs6000.c (symbol_ref_operand): Reject symbols + who are not local for Darwin PIC. + +2004-03-22 Ulrich Weigand + + * regrename.c (regrename_optimize): Set regs_ever_live for all + registers introduced as replacement. + +2004-03-22 Eric Botcazou + + PR middle-end/14470 + * expr.c (mark_queue): New function. + (emit_insns_enqueued_after_mark): New function replacing + emit_queue. Clear the body of emitted queued insns. + (emit_queue): Call emit_insns_enqueued_after_mark. + (store_expr): Mark the increment queue on entry. Emit + only the incrementations queued when expanding the source. + +2004-03-22 Nathanael Nerode + + * configure.ac: Allow --disable-coverage-flags (for the future benefit + of top level bootstrap, and consistency). Reindent. + * configure: Regenerate. + +2004-03-21 Kazu Hirata + + * bt-load.c, builtins.c, cfghooks.c, cfgrtl.c, gcse.c, + ggc-page.c, integrate.c, var-tracking.c, web.c: Remove + unnecessary casts. + +2004-03-22 Danny Smith + + PR target/14291 + * gcov-io.h (gcov_truncate): Define ftruncate as _chsize for + __MINGW32__. + +2004-03-21 Ulrich Weigand + + * config/s390/s390.md ("*doloop_si"): Change predicate for operand 2 + to nonimmediate_operand. + ("*doloop_di"): Likewise. + +2004-03-21 Alexandre Oliva + + * real.h (struct real_value): Use the same type for all + bitfields. Rename exp to uexp. + (REAL_EXP, SET_REAL_EXP): New accessor macros for uexp. + Adjust all uses of exp... + * builtins.c: ... here, ... + * emit-rtl.c: ... here, and ... + * real.c: ... and here. + +2004-03-21 Gabriel Dos Reis + + * pretty-print.c (pp_base_maybe_space): New function. + * pretty-print.h (pp_base_maybe_space): Declare. + (pp_maybe_space): New macro. + +2004-03-21 Ulrich Weigand + + * config/s390/s390.md ("addti3", "subti3"): New insns and splitters. + +2004-03-21 Ulrich Weigand + + * expmed.c (choose_mult_variant): Pass MULT_COST as argument instead + of using register multiplication cost. + (expand_mult): Adapt choose_mult_variant call. + (expand_mult_highpart): Call choose_mult_variant with WIDER_MODE + of MODE; pass appropriate cost bound. Adjust result when + performing signed multiplication by a negative constant. + Don't use intermediate modes larger than word_mode. + +2004-03-21 Richard Kenner + + * alias.c (get_alias_set): Remove handling of PLACEHOLDER_EXPR. + * emit-rtl.c (component_ref_for_mem_expr): Likewise. + (set_mem_attributes_minus_bitpos): Call SUBSTITUTE_PLACEHOLDER_IN_EXPR. + * explow.c (expr_size): Likewise. + * expr.h (placeholder_list, find_placeholder): Deleted. + * expr.c (store_constructor): Likewise. + (get_inner_reference): Likewise. Also don't call find_placeholder. + (placeholder_list, find_placeholder): Deleted. + (is_aligning_offset): Don't handle WITH_RECORD_EXPR, PLACEHOLDER_EXPR. + (expand_expr_real, cases PLACEHOLDER_EXPR, WITH_RECORD_EXPR): Likewise. + (highest_pow2_factor, case WITH_RECORD_EXPR): Remove. + * dojump.c (do_jump, case WITH_RECORD_EXPR): Likewise. + * dwarf2out.c (loc_descriptor_from_tree, case WITH_RECORD_EXPR): + Likewise. + * fold-const.c (invert_truthvalue, case WITH_RECORD_EXPR): Likewise. + (extract_muldiv, case WITH_RECORD_EXPR): Likewise. + * tree.c (expr_align, case WITH_RECORD_EXPR): Likewise. + (contains_placeholder_p): Don't handle WITH_RECORD_EXPR. + Clean up by using first_rtl_op. + (substitute_in_expr): Use SUBSTITUTE_IN_EXPR for recursive call. + (substitute_placeholder_in_expr): New function. + * tree.def (WITH_RECORD_EXPR): Deleted. + * tree.h (SUBSTITUTE_IN_EXPR, SUBSTITUTE_PLACEHOLDER_IN_EXPR): New. + (substitute_placeholder_in_expr): New. + +2004-03-21 Andrew Pinski + + * dojump.c (prefer_and_bit_test): Fix which part of + the and_test is replaced. + +2004-03-21 Joseph S. Myers + + * frontends.texi: Add missing line. + +2004-03-21 Zack Weinberg + Chris Devers + Joseph S. Myers + + * doc/frontends.texi: Rewrite. + * doc/gcc.texi: Update last modification date. + +2004-03-21 Josef Zlomek + + * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Print the debug + message before redirecting the edge. + +2004-03-20 Zdenek Dvorak + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Set MEM_POINTER + flag. + * explow.c (force_not_mem): Set REG_POINTER flag according to + MEM_POINTER one. + * rtl.h (MEM_POINTER): New macro. + (struct rtx_def): Use integrated for MEM_SCALAR_P and frame_related + for MEM_POINTER. + +2004-03-20 Roger Sayle + + PR target/13889 + * cse.c (fold_rtx): Avoid substituting constants into unary + conversion operations. + +2004-03-20 Kazu Hirata + + * fold-const.c (fold): Replace "expr" with "t". + +2004-03-20 Ian Lance Taylor + + PR c/12373 + * c-typeck.c (tagged_types_tu_compatible_p): Don't use + DECL_ORIGINAL_TYPE if there isn't one. + +2004-03-20 Kazu Hirata + + * fold-const.c (fold): Replace "final_type" with "type". + Remove variable "final_type". + +2004-03-20 Kazu Hirata + + * fold-const.c (fold): Constify "type". + Replace "TREE_TYPE (t)" with "type". + +2004-03-20 Kazu Hirata + + * bb-reorder.c, bt-load.c, c-decl.c, cfgcleanup.c, coverage.c, + dwarf2asm.c, ifcvt.c, stor-layout.c, varasm.c: Replace calls + via (*targetm.foo) () with targetm.foo (). + +2004-03-20 Joseph S. Myers + + PR other/14630 + * doc/install.texi: Add info directory category and entry. + +2004-03-20 Kazu Hirata + + * fold-const.c (fold): Replace "t" with "tem" where it is used + as a temporary variable. Remove "orig_t" and all of its uses. + +2004-03-20 Kazu Hirata + + * fold-const.c (fold): Remove variable "invert". + Move the handling of relational expressions that can be folded + to a constant ... + (fold_relational_const): ... here. + (tree_expr_nonzero_p): New. + +2004-03-20 Joseph S. Myers + + PR c/14635 + * builtins.def (nan, nanf, nanl, nans, nansf, nansl): Change to + DEF_GCC_BUILTIN. + +2004-03-20 Richard Sandiford + + * Makefile.in (dojump.o): Depend on $(GGC_H) and dojump.h. + (GTFILES): Add $(srcdir)/dojump.h. + (gt-dojump.h): New dependency. + * dojump.c (and_reg, and_test, shift_test): New static variables. + (prefer_and_bit_test): New function. + (do_jump): Use it to choose between (X & (1 << C)) and (X >> C) & 1. + +2004-03-20 Kazu Hirata + + * c-common.c, cfgcleanup.c, cgraphunit.c, c-pretty-print.c, + expmed.c, ggc-common.c, jump.c, passes.c, recog.c, regmove.c, + reorg.c, tree.h: Fix comment typos. + +2004-03-19 Kazu Hirata + + * alias.c, attribs.c, bt-load.c, builtins.c, c-common.c, + c-decl.c, c-objc-common.c, c-typeck.c, calls.c, cfglayout.c, + cse.c, dbxout.c, dwarf2out.c, except.c, final.c, + haifa-sched.c, integrate.c, passes.c, rtlanal.c, sched-rgn.c, + sched-vis.c, simplify-rtx.c, stor-layout.c, tree.c, varasm.c, + vmsdbgout.c: Replace calls via (*targetm.foo) () with + targetm.foo (). + +2004-03-19 Ziemowit Laski + + * config/rs6000/altivec.h (vec_dst, vec_dstst, vec_dststt, + vec_dstt, vec_sld, vec_splat): Add prototypes, marked with + always_inline attribute. + * config/rs6000/rs6000.c (altivec_expand_dst_builtin): + Treat expansion as completed even if literal argument is + invalid (so that other expansions are not tried in vain). + +2004-03-19 Kazu Hirata + + * loop-doloop.c (add_test): Replace GEN_INT (0) with + const0_rtx. + +2004-03-19 Kazu Hirata + + * fold-const.c (fold) : Move the handling of constants + ... + (fold_abs_const): ... here. + +2004-03-19 Richard Kenner + + * tree.h (TYPE_ARRAY_MAX_SIZE): Use type.maxval directly. + +2004-03-19 Denis Chertykov + + PR target/11520 + * config/avr/avr.md ("call_insn"): Handle explicit integer + specially. + (call_value_insn): Likewise. + +2004-03-19 Richard Kenner + + * tree.c (substitute_in_expr): Rewrite to simplify and be more generic. + +2004-03-19 Kazu Hirata + + * fold-const.c (negate_expr): Move the handling of constants + ... + (fold_negate_const): ... here. + +2004-03-19 Richard Kenner + + * langhooks-def.h (LANG_HOOKS_HASH_TYPES): New macro and hook. + * langhooks.h (struct lang_hooks_for_types): New field hash_types. + * tree.c (debug_no_type_hash): Deleted. + (type_hash_canon): Abort if passed a variant. + Check lang_hooks.types.hash_types. + (build_type_no_quals): Copy mode of POINTER_TYPE and REFERENCE_TYPE. + (build_array_type): Remove unnecessary allocation of pointer type. + (build_complex_type): Properly qualify resulting type. + +2004-03-19 Paolo Bonzini + + * config/rs6000/rs6000.c (rs6000_init_builtins): Fix typo. + +2004-03-19 Richard Sandiford + + * expmed.c (choose_mult_variant, expand_mult_const): New, split from... + (expand_mult): ...here. + (extract_high_half): New, split out from expand_mult_highpart. + (expand_highpart_optab): Likewise. Don't clobber target prematurely. + (expand_highpart): Evaluate the cost of a shift/add sequence, + then see if any of the specialized optabs are cheaper. + +2004-03-18 Ian Lance Taylor + + * mklibgcc.in: Remove obsolete MAYBE_USE_COLLECT2. + +2004-03-18 Kaveh R. Ghazi + + * convert.c (convert_to_real): Add more math builtins. + +2004-03-18 Kaveh R. Ghazi + + * convert.c (convert_to_real): Reformat using switch stmt. + +2004-03-18 Mark Mitchell + + * c-common.c (pointer_int_sum): Do not complain about using + pointers to pointers-to-members. + +2004-03-18 Kazu Hirata + + * system.h (MD_ASM_CLOBBERS): Move to "Old target macros that + have moved to the target hooks structure". + +2004-03-18 James E Wilson + + * config/mips/mips.md (type): Split move into arith and fmove. Split + hilo into mthilo and mfhilo. Add trap. Delete icmp. Fix all uses. + * config/mips/5400.md (ir_vr54_hilo, ir_vr54_arith, ir_vr54_fabs): + Likewise. + * config/mips/5500.md (ir_vr55_hilo, ir_vr55_arith, ir_vr55_fabs): + Likewise. + * config/mips/7000.md (rm7_int_other, rm7_mthilo, rm7_mfhilo, + rm7_fp_quick): Likewise. + * config/mips/9000.md (rm9k_int, rm9k_mfhilo, rm9k_mthilo, + rm9k_fquick): Likewise. + * config/mips/sr71k.md (ir_sr70_hilo, ir_sr70_arith, ir_sr70_fabs): + Likewise. + (ir_sr70_icmp): Delete. + +2004-03-18 Richard Kenner + + * tree.h (TREE_CHECK2, TREE_CHECK3, TREE_CHECK5): New macros. + (tree_check2_failed, tree_check3_failed, tree_check5_failed): New decl. + (FUNC_OR_METHOD_CHECK, SET_ARRAY_OR_VECTOR_CHECK): New macros. + (REC_OR_UNION_CHECK, NUMERICAL_TYPE_CHECK): Likewise. + (TYPE_VALUES, TYPE_DOMAIN, TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD): + Protect with proper check. + (TYPE_ARG_TYPES, TYPE_METHOD_BASETYPE, TYPE_OFFSET_BASETYPE): Likewise. + (TYPE_MIN_VALUE, TYPE_MAX_VALUE): Likewise. + * tree.c (type_hash_eq): Rewrite to access proper fields for each type. + (tree_check2_failed, tree_check3_failed, tree_check5_failed): New. + * c-typeck.c (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES. + * dwarf2out.c (gen_enumeration_type_die): Use TYPE_VALUES, + not TYPE_FIELDS. + * stor-layout.c (set_sizetype): Use TYPE_ORIG_SIZE_TYPE. + +2004-03-18 Mostafa Hagog + + * gcse.c (eliminate_partially_redundant_loads): Reject change if + dest is set between beginning and current insn. + +2004-03-18 Mark Mitchell + + * c-decl.c (grokdeclarator): Do not complain about redeclaring + visible "static" identifiers "extern" in a local scope. + * dwarf2out.c (loc_descriptor_from_tree): Handle pre- and + post-increments/decrements. + +2004-03-18 Bob Wilson + + * config/xtensa/xtensa.c (current_function_arg_words): Delete. + (xtensa_builtin_saveregs): Use current_function_args_info.arg_words. + (xtensa_va_start): Remove assignment to current_function_arg_words. + +2004-03-18 Richard Sandiford + + * alias.c (record_set): Detect the case where a register is assigned + a new value that has the same base term as the old one. + +2004-03-18 Zdenek Dvorak + + * doloop.c: Removed. + * loop-doloop.c: New file. + * Makefile.in (doloop.o): Remove. + (loop-doloop.o): New. + * cfgloop.h (get_loop_level, doloop_optimize_loops): Declare. + * cfgloopanal.c (get_loop_level): New function. + * loop-iv.c (iv_number_of_iterations): Handle case when loop + is leaved immediatelly. + * loop.c (strength_reduce): Do not call doloop optimization. + * loop.h (LOOP_BCT): Removed. + * passes.c (rest_of_handle_loop_optimize): Do not use LOOP_BCT. + (rest_of_handle_loop2): Call doloop_optimize_loops. + (rest_of_compilation): Test for optimizations moved to + rest_of_handle_loop2. + +2004-03-17 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_stack_info): correct reg_size + for mixed mode. + (rs6000_emit_prologue): Ditto. + (rs6000_emit_epilogue): Ditto. + * config/rs6000/rs6000.h: Definition of DWARF_CIE_DATA_ALIGNMENT + macro for mixed mode. + +2004-03-18 Jan Hubicka + + * predict.c (propagate_freq): Compute correctly frequency of + EXIT_BLOCK. + +2004-03-17 Eric Christopher + + * builtins.c (apply_args_size): Use reg_raw_mode. + (apply_result_size): Ditto. + +2004-03-17 Ralf Corsepius + + PR target/14620 + * config/rtems.h: Add STD_LIB_SPEC and LIB_SPEC. + +2004-03-17 Jakub Jelinek + + * config/rs6000/t-linux64 (bispecs): Don't add -mlong-double-128 for + 32-bit builds when defaulting to 32-bit. + +2004-03-17 Jan Hubicka + + * cfgrtl.c (rtl_create_basic_block): Pre-allocate basic_block_info + array. + +2004-03-17 James E Wilson + + * config/mips/mips.md (zero_extendsidi2): Add length attribute. + (hazard_nop): Change type to nop. + (type): Split arith into arith, shift, slt, clz. Delete darith. + Fix all uses. Change arith to multi if more than one insn emitted. + * config/mips/5400.md (ir_vr54_arith): Likewise. + * config/mips/5500.md (ir_vr55_arith): Likewise. + * config/mips/7000.md (rm7_int_other): Likewise. + * config/mips/9000.md (rm9k_int): Likewise. + * config/mips/sr71k.md (ir_sr70_arith): Likewise. + +2004-03-17 Joel Brobecker + + * dwarf2out.c (subrange_type_die): Define new variable "subtype" + to hold the subtype tree instead of recomputing it several times. + +2004-03-17 Kazu Hirata + + * config/mn10300/mn10300.c (notice_update_cc): Don't handle + CC_INVERT. + * config/mn10300/mn10300.md (cc): Remove "invert". + +2004-03-16 Kaveh R. Ghazi + + * builtins.c (integer_valued_real_p): Add builtin rint. + (fold_builtin): Likewise. + * convert.c (convert_to_real): Likewise. + + * convert.c (convert_to_real): Fix typos in `long double' + builtins. + +2004-03-16 Mark Mitchell + + PR c++/14481 + * fold-const.c (fold): Set TREE_NO_UNUSED_WARNING on implicitly + generated COMPOUND_EXPRs. + +2004-03-16 Ralf Corsepius + + * config/h8300/t-rtems (h8300-*-rtems*): New. + +2004-03-16 Eric Christopher + + * doc/cppopts.texi(fwide-exec-charset): Fix typo. + +2004-03-16 Kazu Hirata + + * config/i386/i386-protos.h: Add a prototype for + ix86_reverse_condition. + * config/i386/i386.c (ix86_reverse_condition): New. + * config/i386/i386.h (REVERSE_CONDITION): Use + ix86_reverse_condition. + * config/i386/i386.md: Use ix86_reverse_condition instead of + REVERSE_CONDITION. + +2004-03-16 J. Brobecker + + * dwarf2out.c (loc_descriptor_from_tree): Add handling for MIN_EXPR. + +2004-03-16 Nathanael Nerode + + PR bootstrap/12974 + * Makefile.in: Pass $(INCLUDES) down to libgcc.mk explicitly. + +2004-03-16 Paolo Bonzini + + * c-common.c (c_common_type_for_mode): Build vector types on + demand. + (handle_mode_attribute): Deprecate using the mode attribute + to create vector types. Fix indentation. + (vector_type_node_list): Remove. + (handle_vector_size_attribute): Create vector types on demand. + Strip a NON_LVALUE_EXPR from the attribute if there is one. + * c-typeck.c (comptypes): Make vector types compatible if they + have the same underlying mode. + (convert_for_assignment): Use comptypes to convert between + vector types. + * tree.c (build_common_tree_nodes_2): Do not create vector types. + * config/arm/arm.c (arm_init_iwmmxt_builtins): Create necessary + vector types. + * tree.h: Remove vector types. + * config/i386/i386.c (i386_init_mmx_sse_builtins): Likewise. + * config/rs6000/rs6000.c (rs6000_init_builtins): Likewise. + (V16QI_type_node, V2SI_type_node, V2SF_type_node, V4HI_type_node, + V4SI_type_node, V4SF_type_node, V8HI_type_node): New globals. + * doc/extend.texi (Vector Types): Document how to use the + vector_size attribute to create vectors, rather than mode. + + * config/arm/mmintrin.h: Use vector_size attribute, not mode. + * config/i386/emmintrin.h: Likewise. + * config/i386/mmintrin.h: Likewise. + * config/i386/xmmintrin.h: Likewise. + * config/sh/ushmedia.h: Likewise. + +2004-03-16 Kazu Hirata + + * config/freebsd-spec.h, config/arc/arc-protos.h, + config/arm/aout.h, config/arm/elf.h, config/arm/freebsd.h, + config/arm/linux-gas.h, config/arm/semi.h, + config/cris/cris-protos.h, config/i386/xm-djgpp.h, + config/ia64/freebsd.h, config/mips/7000.md, + config/mips/9000.md, config/ns32k/ns32k-protos.h, + config/sparc/pbd.h: Update copyright. + +2004-03-16 Ralf Corsepius + + PR target/14577 + * config.gcc: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff. + +2004-03-16 Paolo Bonzini + + * combine.c (combine_simplify_rtx): Remove the "last" + parameter and its documentation. Adjust recursive calls. + (simplify_logical): Always perform the only simplification + controlled by "last", if the simplified expression is + actually different. + (try_combine): Do not pass the "last" parameter to + combine_simplify_rtx. + +2004-03-16 Richard Sandiford + + PR target/14599 + * config/mips/mips.md (UNSPEC_GP): New constant. + * config/mips/mips.c (CONST_GP_P): Expect the CONST to contain + an UNSPEC instead of (reg $gp). + (mips16_gp_pseudo_reg): Change accordingly. + (print_operand): Print $gp directly when handling CONST_GP_P. + +2004-03-16 Richard Zidlicky + + * config.gcc, config/m68k/linux.h: Implement with-cpu for m68k-linux. + * longlong.h: Make code 68060 clean when compiling for m68060. + +2004-03-16 Richard Zidlicky + + * config/m68k/m68k.md: Fix constraints for bitfield instructions. + * doc/md.texi: Clarify description of "i" constraint. + +2004-03-15 James E Wilson + + * config/mips/mips.md (type): Split load into load, fpload, fpidxload. + Split store into store, fpstore, fpidxstore. Fix all uses. + * config/mips/5400.md (ir_vr54_load, ir_vr54_store, ir_vr54_fstore): + Likewise. + * config/mips/5500.md (ir_vr55_load, i5_vr55_store): Likewise. + * config/mips/7000.md (rm7_ld, rm7_st): Likewise. + * config/mips/9000.md (rm9k_load, rm9k_store): Likewise. + * config/mips/sr71k.md (ir_sr70_load, ir_sr70_store, ir_sr70_fload, + ir_sr70_fstore): Likewise. + +2004-03-15 Richard Henderson + + PR middle-end/14535 + * except.c (collect_one_action_chain): Record action for cleanup + outer of exception spec. + +2004-03-15 Ian Lance Taylor + + * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): + Fix the check for abort and only do the mmap if we can. + +2004-03-15 Eric Botcazou + + * config/sparc/sparc.h: Rework comments about the code model + in 64-bit environment and the mode 'Pmode'. + * doc/invoke.texi (SPARC options): Rework description of the + different code models supported in 64-bit environment. + +2004-03-15 Kazu Hirata + + * defaults.h (REVERSIBLE_CC_MODE): Define. + * jump.c (reversed_comparison_code_parts): Don't check if + REVERSIBLE_CC_MODE is defined. + +2004-03-15 Kazu Hirata + + * c-incpath.c, c-incpath.h, c-pch.c, c.opt, cppexp.c, + et-forest.h, genattr.c, ggc-none.c, hosthooks-def.h, + hosthooks.h, params.h, ra-colorize.c, web.c, + config/darwin-c.c, config/alpha/freebsd.h, config/arm/pe.c, + config/avr/avr-protos.h, config/avr/avr.md, + config/fr30/fr30-protos.h, config/fr30/fr30.md, + config/h8300/fixunssfsi.c, config/i386/darwin.h, + config/i386/freebsd.h, config/i386/freebsd64.h, + config/ia64/hpux.h, config/ia64/unwind-ia64.c, + config/ip2k/libgcc.S, config/m32r/xm-m32r.h, + config/mmix/mmix-modes.def, config/ns32k/netbsd.h, + config/ns32k/ns32k.md, config/pa/pa64-hpux.h, + config/pa/pa64-regs.h, config/rs6000/aix41.h, + config/rs6000/aix43.h, config/rs6000/host-darwin.c, + config/sparc/aout.h, config/sparc/freebsd.h, + config/sparc/litecoff.h, config/vax/vax-protos.h, + doc/hostconfig.texi, doc/include/gcc-common.texi: Update + copyright. + +2004-03-15 Paul Brook + + * config/arm/arm.c (thumb_expand_prologue): Tie prologue insns to fp. + +2004-03-15 Gabriel Dos Reis + + * c-pretty-print.c (pp_c_semicolon): Fix formatting. + (pp_c_cv_qualifier): Document. + (pp_c_space_for_pointer_operator): Likewise. + (pp_c_integer_constant): Likewise. + (pp_c_identifier): Likewise. + (pp_c_init_declarator): Don't print function body. + +2004-03-14 Joseph S. Myers + + * doc/contrib.texi, doc/extend.texi, doc/gcov.texi, + doc/install.texi, doc/invoke.texi, doc/makefile.texi, + doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: Capitalize + "gcc", "g++" and "g77" or mark up with appropriate markup. Adjust + wording and grammar. + +2004-03-14 Roger Sayle + + * alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) () + with lang_hooks.foo (). + * builtins.c (expand_builtin_va_arg): Likewise. + * c-common.c (fname_as_string, c_common_truthvalue_conversion, + c_common_type_for_mode, c_common_nodes_and_builtins, + handle_mode_attribute, handle_vector_size_attribute): Likewise. + * c-convert.c (convert): Likewise. + * c-format.c (check_format_types): Likewise. + * c-objc-common.c (c_tree_printer): Likewise. + * c-typeck.c (build_unary_op, build_conditional_expr, + build_binary_op): Likewise. + * calls.c (try_to_integrate, expand_call, + emit_library_call_value_1): Likewise. + * cgraph.c (cgraph_node_name, cgraph_function_possibly_inlined_p): + Likewise. + * cgraphunit.c (record_call_1, cgraph_analyze_function, + cgraph_expand_function): Likewise. + * convert.c (convert_to_pointer, convert_to_integer): Likewise. + * coverage.c (build_fn_info_type, build_ctr_info_type, + build_gcov_info, create_coverage): Likewise. + * dbxout.c (dbxout_init): Likewise. + * diagnostic.c (diagnostic_report_current_function): Likewise. + * dojump.c (do_jump): Likewise. + * dwarf2out.c (dwarf2_name): Likewise. + * except.c (init_eh): Likewise. + * explow.c (expr_size, int_expr_size): Likewise. + * expmed.c (make_tree, const_mult_add_overflow_p, expand_mult_add): + Likewise. + * expr.c (store_expr, store_constructor, safe_from_p, + expand_expr_real, do_store_flag, try_casesi): Likewise. + * function.c (push_function_context_to, pop_function_context_from, + free_after_parsing, assign_stack_local_1, assign_stack_temp_for_type, + put_var_into_stack, allocate_struct_function, current_function_name): + Likewise. + * integrate.c (copy_decl_for_inlining, expand_inline_function): + Likewise. + * langhooks.c (lhd_clear_binding_stack, write_global_declarations, + lhd_print_error_function): Likewise. + * opts.c (handle_option, decode_options): Likewise. + * passes.c (open_dump_file): Likewise. + * print-tree.c (print_node): Likewise. + * stmt.c (expand_fixup, fixup_gotos, expand_asm_operands, + expand_decl_cleanup, emit_case_nodes): Likewise. + * stor-layout.c (variable_size): Likewise. + * toplev.c (announce_function, wrapup_global_declarations, + check_global_declarations, compile_file, default_tree_printer, + process_options, lang_dependent_init, finalize): Likewise. + * tree-dump.c (dequeue_and_dump): Likewise. + * tree-inline.c (remap_decl, remap_block, copy_body_r, + initialize_inlined_parameters, declare_return_variable, + inlinable_function_p, expand_call_inline, optimize_inline_calls, + walk_tree, copy_tree_r): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree.c (decl_assembler_name, tree_size, size_in_bytes, staticp, + unsafe_for_reeval, get_unwidened, get_narrower, get_callee_fndecl, + variably_modified_type_p, dump_tree_statistics): Likewise. + * varasm.c (assemble_variable, compare_constant, copy_constant, + force_const_mem, compute_reloc_for_constant, output_constant, + output_addressed_constants, initializer_constant_valid_p): Likewise. + +2004-03-14 Kelley Cook + + * doc/install.texi: Make autoconf 2.13 the exception, not the rule. + +2004-03-14 Andreas Tobler + + * doc/install.texi: Reflect autoconf and automake version for + libffi. Update autoconf version to 2.59. + +2004-03-13 Roger Sayle + + * fold-const.c (negate_expr, operand_equal_for_comparison_p, + optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, + make_range, build_range_check, fold_range_test, unextend, + constant_boolean_node, fold_binary_op_with_conditional_arg, + fold_truthop, fold_mathfn_compare, fold_inf_compare, + fold_single_bit_test, fold): Replace calls via (*lang_hooks.foo) () + with lang_hooks.foo (). + +2004-03-14 Richard Earnshaw + + * arm.h (EXTRA_CONSTRAINT_STR_ARM): Update comment. + +2004-03-13 Dara Hazeghi + + * doc/install.texi: Note status of -fnew-ra. + +2004-03-13 Eric Botcazou + + PR middle-end/14470 + * expr.c (store_expr): Call emit_queue before generating the move + from the temporary to the original target. Protect the temporary + from emit_queue. + +2004-03-13 Jakub Jelinek + + PR target/14533 + * config/s390/s390.c (legitimize_pic_address): Don't abort on UNSPEC + other than UNSPEC_GOTOFF. + +2004-03-13 Richard Earnshaw + + * arm.c (arm_legitimate_address_p): New argument, OUTER. Pass through + to arm_legitimate_index_p. Update all callers with SET as default + value. + (arm_legitimate_index_p): New argument, OUTER. Restrict the index + range if OUTER is a sign-extend operation on QImode. Correctly + reject shift operations on sign-extended QImode addresses. + (bad_signed_byte_operand): Delete. + (arm_extendqisi_mem_op): New function. + * arm.h (EXTRA_CONSTRAINT_ARM): Delete. Replace with... + (EXTRA_CONSTRAINT_STR_ARM): ... this. Handle extended address + constraints. + (CONSTRAINT_LEN): New. + (EXTRA_CONSTRAINT): Delete. Replace with... + (EXTRA_CONSTRAINT_STR): ... this. + (PREDICATE_CODES): Remove bad_signed_byte_operand. + * arm.md (extendqihi_insn): Use new constraint Uq. Rework. Length + is now always default. + (define_splits for bad sign-extend loads): Delete. + (arm_extendqisi, arm_extendqisi_v5): Likewise. + * arm/vfp.md (arm_movsi_vfp, arm_movdi_vfp, movsf_vfp, movdf_vfp): + Rework 'U' constraint to 'Uv'. + * arm-protos.h: Remove bad_signed_byte_operand. Add + arm_extendqisi_mem_op. + * doc/md.texi (ARM constraints): Rename VFP constraint (now Uv). + Add Uq constraint. + +2004-03-13 Alan Modra + + * config/rs6000/rs6000.c (rs6000_va_arg): Replace SPLIT_COMPLEX_ARGS + with targetm version. + + PR target/14567 + * config/rs6000/rs6000.h (UNITS_PER_ARG, RS6000_ARG_SIZE): Delete. + (HARD_REGNO_MODE_OK): Disallow TFmode for fp31. + * config/rs6000/rs6000.c (rs6000_arg_size): New function. + Update all users of RS6000_ARG_SIZE. + (function_arg_advance): Count fregno using mode size. + (function_arg): Handle long double split over regs and memory. + (function_arg_partial_nregs): Likewise. + (rs6000_va_arg): Repackage complex args. + +2004-03-13 Dean Ferreyra + + PR target/14047 + * config/avr/avr.c (avr_progmem_p): Add "attributes" parameter. + (avr_insert_attributes): Pass "attributes" to avr_progmem_p. + * config/avr/avr-protos.h (avr_progmem_p): Change prototype. + +2004-03-12 Jakub Jelinek + + * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Add + prototype. + * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): New. + * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Define. + +2004-03-12 Andrew Pinski + + * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): + Use ret instead of result. Use addr instead of base. + +2004-03-12 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Document assembler and achiver + fixes required by libstdc++ and update installation instructions + for libstdc++.a. + +2004-03-12 Danny Smith + + * config/i386/winnt.c (i386_pe_strip_name_encoding_full): Strip + leading '@' on fastcall symbols before stripping suffix. + +2004-03-12 Roger Sayle + + * combine.c (unmentioned_reg_p): New function to check whether an + expression is a "specialization" of another, i.e. that there are + no registers or memory references mentioned in the first that don't + appear in the second. + (unmentioned_reg_p_1): New helper subroutine of unmentioned_reg_p. + (combine_instructions): Also try combining instructions using the + REG_EQUAL note from a preceding log-linked instruction. + +2004-03-12 Roger Sayle + + * config/i386/i386.c (ix86_split_ashrdi): Optimize shift by 63. + +2004-03-12 Matt Austern + + * target.h (struct gcc_target): New target hook, unwind_label. + * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. + * output.h (default_emit_unwind_label): New function. + * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. + (TARGET_USES_WEAK_UNWIND_INFO): New target macro. + (TARGET_SUPPORTS_HIDDEN): New target macro. + * dwarf2out.c (struct dw_fde_struct): Add field for function decl + that corresponds to this FDE. + (FRAME_BEGIN_LABEL): Allow target to override default label. + (output_call_frame_info): If FDEs are linknonce, then use extra + indirection for FDE encoding, output a label for each FDE, and + output an empty label for each function without an FDE. + (dwarf2out_begin_prologue): Set up decl field when creating an FDE. + * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for + decls with DECL_ONE_ONLY set, if that macro is defined. + (make_decl_one_only): Don't use DECL_COMMON if we're compiling + for a SUPPORTS_ONE_ONLY target. + * config/darwin-protos.h (darwin_unique_section): Declare. + (darwin_asm_named_section): Likewise. + (darwin_section_type_flags): Likewise. + (darwin_non_lazy_pcrel): Likewise. + (darwin_emit_unwind_label): Likewise. + (darwin_make_decl_one_only): Likewise. + * config/darwin.c (machopic_finish): Get rid of tweak that + eliminate stubs for symbols that are defined. + (darwin_encode_section_info): Don't treat weak functions as defined. + (darwin_make_decl_one_only): Define. + (darwin_asm_named_section): Likewise. + (darwin_section_type_flags): Likewise. + (darwin_unique_section): Likewise. + (darwin_emit_unwind_label): Likewise. + (darwin_non_lazy_pcrel): Likewise. + (darwin_asm_output_dwarf_delta): Difference between two labels is + local only if both labels are local. + * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. + (ASM_MAKE_LABEL_LINKONCE): Likewise. + (TARGET_SUPPORTS_HIDDEN): Likewise. + (TARGET_USES_WEAK_UNWIND_INFO): Likewise. + (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. + (FRAME_BEGIN_LABEL): Likewise. + (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. + (ASM_DECLARE_FUNCTION_NAME): Likewise. + (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. + (TARGET_ASM_UNIQUE_SECTION): Define. + (EH_FRAME_SECTION_NAME): Define. + (EH_FRAME_SECTION_ATTR): Likewise. + (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. + (TARGET_ASM_NAMED_SECTION): Likewise. + (TARGET_SECTION_TYPE_FLAGS): Likewise. + * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, + TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, + TARGET_ASM_EMIT_UNWIND_LABEL. + +2004-03-12 Kaveh R. Ghazi + + * builtins.c (expand_builtin_mathfn): Add pow10* to the + existing exp10* case. + (expand_builtin): Likewise. + +2004-03-12 Eric Botcazou + + * doc/tm.texi (registers) : Add + entry for REGMODE_NATURAL_SIZE. + +2004-03-12 Richard Henderson + + PR target/14547 + * target.h (struct gcc_target): Move calls substructure before + booleans. Add split_complex_arg. + * function.c (assign_parms, split_complex_args): Use it. + * calls.c (expand_call): Likewise. + (split_complex_values): Likewise. Check for splittable types + before allocating memory. + (split_complex_types): Likewise. + * system.h (SPLIT_COMPLEX_ARGS): Poison. + * expr.h (SPLIT_COMPLEX_ARGS): Remove. + * target-def.h (TARGET_SPLIT_COMPLEX_ARG): New. + * config/alpha/alpha.c (alpha_split_complex_arg): New. + (TARGET_SPLIT_COMPLEX_ARG): New. + * config/alpha/alpha.h (SPLIT_COMPLEX_ARGS): Remove. + * config/rs6000/rs6000.c (TARGET_SPLIT_COMPLEX_ARG): New. + (rs6000_override_options): Zap it for non-AIX. + (rs6000_function_value): Use targetm.calls.split_complex_arg. + * config/rs6000/rs6000.h (SPLIT_COMPLEX_ARGS): Remove. + * config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): New. + * config/xtensa/xtensa.h (SPLIT_COMPLEX_ARGS): Remove. + * doc/tm.texi (TARGET_SPLIT_COMPLEX_ARG): Modify from old + SPLIT_COMPLEX_ARGS entry. + +2004-03-11 Richard Henderson + + * config/alpha/alpha.c (xfloating_ops, vax_cvt_ops): New. + (alpha_lookup_xfloating_lib_func): Use them, return rtx. + (alpha_emit_xfloating_arith): Update to match. + (alpha_emit_xfloating_compare): Likewise. + (alpha_emit_xfloating_cvt): Likewise. + (alpha_emit_xfloating_libcall): Take already built symbol, + mark call const. + * config/alpha/alpha.md (extendsftf2, extenddftf2): Take + op1 in a register. + +2004-03-11 Richard Henderson + + PR target/14539 + * config/alpha/alpha.h (STACK_BOUNDARY): Set to 128. + + * simplify-rtx.c (simplify_relational_operation): Fix typo. + +2004-03-11 Richard Henderson + + PR middle-end/14477 + * except.c (remove_unreachable_regions): Look thru CALL_PLACEHOLDER. + +2004-03-11 Ulrich Weigand + + PR target/14262 + * calls.c (load_register_parameters): If BLOCK_REG_PADDING is not + defined, pass small BLKmode values in registers in the low-order part. + +2004-03-11 Ulrich Weigand + + * combine.c (if_then_else_cond): Check for NULL return value of + simplify_gen_subreg. + +2004-03-11 Richard Sandiford + + PR target/14496 + * config/mips/mips.h (UNITS_PER_FPVALUE): Fix value for + TARGET_SINGLE_FLOAT. + +2004-03-11 Steve Ellcey + + * config/ia64/hpux.h (TARGET_INIT_LIBFUNCS): Add undef. + * config/ia64/ia64.h (TARGET_INIT_LIBFUNCS): Add define. + * config/ia64/ia64.c (ia64_init_libfuncs): New. + (ia64_hpux_init_libfuncs): Add call to ia64_init_libfuncs. + +2004-03-11 Roger Sayle + + * fold-const.c (negate_expr_p) : We can optimize + -((int)X>>C) where C is an integer constant one bit less than the + size of X into (unsigned)X>>C. Similarly for unsigned->signed. + (negate_expr) : Implement the above transformations. + + * simplify-rtx.c (simplify_unary_operation): Also implement the + above transformations at the RTL level. + +2004-03-11 Alan Modra + + * real.c (encode_ibm_extended): Do round low word. + +2004-03-11 Ben Elliston + + * config/arm/arm.md (is_xscale): Comment this attribute and move + it a bit further up in the file, closer to related attributes. + +2004-03-11 Eric Botcazou + + * config/host-solaris.c (sol_gt_pch_use_address): Add + missing terminating marker to comment. + +2004-03-11 Richard Sandiford + + * config/mips/mips.md: Use move_operand in splitters for 64-bit moves. + (movdi, movsi, movhi, movqi, movsf, movdf): Remove predicates. + (*movdi_32bit_mips16, *movsi_mips16, *movhi_mips16, *movqi_mips16) + (*movsf_mips16, *movdf_mips16): Name unnamed patterns. Use + move_operand as source predicate in all cases. + (*movdi_32bit): Renamed from movdi_internal. Remove 'F' constraint. + Test reg_or_0_operand. Use move_operand as source predicate. + (*movdi_64bit): Renamed from movdi_internal2. Test reg_or_0_operand. + (*movdi_64bit_mips16): Renamed from movdi_internal2_mips16. + (*movsi_internal): Renamed from movsi_internal. Test reg_or_0_operand. + (movhi, movqi, movsf, movdf): Use mips_legitimize_move. + (*movhi_internal): Renamed from movhi_internal. Test reg_or_0_operand. + Use move_operand as source predicate. Remove 'K' constraint. + (*movqi_internal): Likewise movqi_internal. + (*movsf_hardfloat): Renamed from movsf_internal1. Test + reg_or_0_operand. Use move_operand as source predicate. + (*movsf_softfloat): Likewise movsf_internal2. + (*movdf_hardfloat_64bit): Likewise movsf_internal1a. + (*movdf_hardfloat_32bit): Likewise movsf_internal1b. + (*movdf_softfloat): Likewise movdf_internal2. + * config/mips/mips.c (move_operand): Match arbitrary CONST_INTs + for DImode if !TARGET_64BIT. + (mips_legitimize_move): Simplify accordingly. + +2004-03-11 Josef Zlomek + + PR/14362 + * var-tracking.c (struct variable_def): Added field refcount. + (variable_htab_free): Decrease the refcount and delete variable + only if there are no more references. + (unshare_variable): New function. + (vars_copy_1): Increase refcount instead of copying the variable. + (variable_union): Share the variables where possible, unshare + the variables if needed. + (variable_different_p): Return false if var1 and var2 are + the same structure. + (variable_was_changed): Init the refcount of new variable. + (set_frame_base_location): Unshare variable if needed. + (set_variable_part): Init the refcount of new variable. + Unshare the variables if needed. + (delete_variable_part): Unshare the variables if needed. + (emit_notes_for_differences_1): Init the refcount of new variable. + (vt_add_function_parameters): Do not add function parameters to + IN set of ENTRY_BLOCK_PTR because it is unused anyway. + (vt_initialize): Do not add frame_base_decl to IN set of + ENTRY_BLOCK_PTR because it is unused anyway. + +2004-03-11 Josef Zlomek + + * var-tracking.c (vars_copy_1): Cleanup and speedup chain operations. + (vars_copy): Likewise. + (variable_union): Likewise. + (set_variable_part): Likewise. + (delete_variable_part): Likewise. + +2004-03-11 Kazu Hirata + + * c-typeck.c, combine.c, cse.c, dominance.c, et-forest.h, + ggc-page.c, var-tracking.c, config/fp-bit.c, config/c4x/c4x.c, + config/cris/cris.c, config/i386/ppro.md, config/i860/i860.c, + config/i860/i860.h, config/m32r/m32r.h, config/m32r/xm-m32r.h, + config/m68hc11/m68hc11.h, config/m68hc11/m68hc11.md, + config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.h, + config/pa/pa.c, config/pa/pa32-regs.h, config/pa/pa64-regs.h, + config/pdp11/pdp11.h, config/rs6000/rs6000.c, + config/stormy16/stormy16.c: Fix comment typos and formatting. + +2004-03-11 Nathanael Nerode + + * configure: Regenerate, since I forgot to while committing Paolo's + changes. + +2004-03-08 Paolo Bonzini + + PR ada/14131 + Move language detection to the top level. + * configure.ac: Remove code to detect languages, + it now lives exclusively in the top level. + * aclocal.m4 (gcc_AC_PROG_GNAT): Moved to the + top level, renamed to ACX_PROG_GNAT. + +2004-03-10 Richard Henderson + + * c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address + extra arguments. + * config.host (*-*-solaris2*, *-*-linux*): Add out_host_hook_obj + and host_xmake_file fragments. + * ggc-common.c (gt_pch_save): Update for gt_pch_get_address change. + (gt_pch_restore): Similarly for gt_pch_use_address. + (default_gt_pch_get_address): New. + (mmap_gt_pch_get_address): Split out of gt_pch_save. + (default_gt_pch_use_address): Split out of gt_pch_restore. + (mmap_gt_pch_use_address): Likewise. + * hooks.c (hook_voidp_size_t_null): Remove. + (hook_bool_voidp_size_t_false): Remove. + * hooks.h: Likewise. + * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): Use one of the + default_ or mmap_ definitions. + (HOST_HOOKS_GT_PCH_USE_ADDRESS): Likewise. + * hosthooks.h (struct host_hooks): Update gt_pch_get_address + and gt_pch_use_address. + * config/host-linux.c, config/host-solaris.c: New files. + * config/x-linux, config/x-solaris: New files. + * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_get_address): + Update for changed definition. + (darwin_rs6000_gt_pch_use_address): Likewise. + * doc/hostconfig.texi: Update docs. + +2004-03-10 Richard Henderson + + PR c/14517 + * c-decl.c (grokdeclarator): Don't warn for duplicate qualifiers + except for pedantic c90 mode. + +2004-03-10 Kelley Cook + + * configure.ac: Bump AC_PREREQ to 2.59. + * configure: Regenerate. + +2004-03-10 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_exp10 and OTI_exp2. + (exp10_optab, exp2_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize exp10_optab and exp2_optab. + * genopinit.c (optabs): Implement exp10_optab and exp2_optab + using exp10?f2 and exp2?f2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXP10{,F,L} + using exp10_optab, and BUILT_IN_EXP2{,F,L} using exp2_optab. + (expand_builtin): Expand BUILT_IN_EXP10{,F,L} and BUILT_IN_EXP2{,F,L} + using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * config/i386/i386.md (exp10sf2, exp10df2, exp10xf2, exp2sf2, + exp2df2, exp2xf2): New patterns to implement exp10, exp10f, exp10l, + exp2, exp2f and exp2l built-ins as inline x87 intrinsics. + +2004-03-10 Anthony Green + + * doc/invoke.texi (ARM Options): Fix -mpfu typo. + +2004-03-10 David Edelsohn + + * config/rs6000/aix.h (TARGET_OS_CPP_BUILTINS): Rename to ... + (TARGET_OS_AIX_CPP_BUILTINS): this. Conditionally define + __LONGDOUBLE128. + * config/rs6000/aix41.h (TARGET_OS_CPP_BUILTINS): Use + TARGET_OS_AIX_CPP_BUILTINS. + * config/rs6000/aix43.h (TARGET_OS_CPP_BUILTINS): Same. + * config/rs6000/aix51.h (TARGET_OS_CPP_BUILTINS): Same. + * config/rs6000/aix52.h (TARGET_OS_CPP_BUILTINS): Same. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Revert + previous change. + +2004-03-10 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_p): Add more builtin cases. + +2004-03-10 David Edelsohn + + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define + __LONGDOUBLE128 on AIX. + +2004-03-10 Andrew Haley + + PR optimization/14381 + * function.c (expand_function_end): Emit a blockage insn before + the epilogue when -fnon-call-exceptions is used. + + * except.c (expand_start_all_catch): Make comment more accurate. + +2004-03-08 Joel Sherrill + + PR target/14480 + * config/rs6000/t-rtems: Add missing file on branch. + +2004-03-10 Ulrich Weigand + + * dbxout.c (dbxout_symbol_location): Do not output references + to optimized-out constant pool symbols. + +2004-03-10 Andreas Schwab + + * config/ia64/ia64.md (divsi3, udivsi3): Remove unused variable + twon34_r. + +2004-03-09 James E Wilson + + * alias.c (alias_sets_might_conflict_p): New. + * c-typeck.c (build_c_cast): Call it if warn_strict_aliasing > 1. + * common.opt (Wstrict-aliasing=): New. + * flags.h (warn_strict_aliasing): Change type to int. + * opts.c (warn_strict_aliasing): Change type to int. + (common_handle_option): Handle OPT_Wstrict_aliasing_. + * tree.h (alias_sets_might_conflict_p): Declare it. + * doc/invoke.tex (-Wstrict-aliasing=2): Document it. + +2004-03-10 Roman Zippel + + PR bootstrap/12371 + * config/m68k/m68k.h (FIXED_REGISTERS): Add arg pointer. + (CALL_USED_REGISTERS): Likewise. + (REG_CLASS_CONTENTS): Likewise. + (REG_ALLOC_ORDER): New. + (REGNO_REG_CLASS): Use regno_reg_class. + * config/m68k/m68k.c: Add regno_reg_class array. + +2004-03-09 Steve Ellcey + + * config/ia64/ia64.md (divsi3): Fix algorithm. + (udivsi3): Ditto. + (setf_exp_xf): Remove '*' from name. + * testsuite/gcc.dg/20040309-1.c: New test. + +2004-03-09 Ian Lance Taylor + + * system.h (SUNOS4_SHARED_LIBRARIES): Poison. + * collect2.c: Remove SUNOS4_SHARED_LIBRARIES code. + * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): Don't define. + * config/sparc/sparc.c (sparc_aout_select_section): Remove. + (sparc_aout_select_rtx_section): Don't check + SUNOS4_SHARED_LIBRARIES. + * config/sparc/sparc.h (SUNOS4_SHARED_LIBRARIES): Don't define. + +2004-03-10 Hans-Peter Nilsson + + PR other/14474 + * doc/md.texi (Pattern Ordering, Dependent Patterns) + (Jump Patterns, Looping Patterns): Wrap in separate "@ifset + INTERNALS". + +2004-03-09 Zack Weinberg + + * config/ia64/hpux.h (MULTILIB_DEFAULTS): Define. + (LIBGCC_SPEC): Update to match. + +2004-03-09 Zack Weinberg + + * c-decl.c (last_function_parms, last_function_parm_tags) + (last_function_parm_others, current_function_parms) + (current_function_parm_tags, current_function_parm_others): + Delete. + (ARG_INFO_PARMS, ARG_INFO_TAGS, ARG_INFO_TYPES, ARG_INFO_OTHERS): + New macros. + (grokdeclarator): For function definitions, save the arg-info + block from the declarator in DECL_ARGUMENTS. + (grokparms): Do not write to last_function_parm*. Use ARG_INFO_* + macros to operate on arg-info block. Can assume ARG_INFO_PARMS + contains only PARM_DECLs. Improve diagnostics. + (get_parm_info): Use ARG_INFO_* macros. Improve comments and + diagnostics. Disable some expensive checks if not ENABLE_CHECKING. + (store_parm_decls_newstyle): Take the function to operate on, + and an arg-info block, as arguments; don't get anything from + current_function_* globals. + (store_parm_decls_oldstyle): Likewise. + (store_parm_decls): Pass fndecl and its arg-info block down to + store_parm_decls_newstyle/oldstyle. Send functions with empty + argument lists through store_parm_decls_newstyle to reduce + overhead. + (pushdecl): Comment on the problems with the call to copy_node. + Clear DECL_ARGUMENTS of the old node after copying it, if it + is an arg-info block instead of a chain of decls. + (start_function): Do not manipulate current_function_parm* or + last_function_parm*. + +2004-03-09 Roger Sayle + Andrew Pinski + + * ifcvt.c (noce_try_sign_mask): New function to transform + "x = (y < 0) ? z : 0" into the equivalent "x = (y >> C) & z". + (noce_process_if_block): Call noce_try_sign_mask. + +2004-03-09 Andrew Pinski + + * c-typeck.c (tagged_types_tu_compatible_p): + Fix typo. + +2004-03-09 Roger Sayle + + * simplify-rtx.c (simplify_const_relational_operation): New function + renamed from simplify_relational_operation. + (simplify_relational_operation): Change prototype to accept an + additional mode argument. Call simplify_const_relational_operation. + (simplify_gen_relational): Update simplify_relational_operation call. + (simplify_ternary_operation): Update simplify_relational_operation + subroutine call to use simplify_const_relational_operation instead. + + * rtl.h (simplify_const_relational_operation): Prototype here. + (simplify_relational_operation): Add addtional mode argument. + + * combine.c (combine_simplify_rtx): Update calls to + simplify_relational_operation. + (simplify_set): Likewise. + (gen_binary): Likewise. + * cse.c (fold_rtx): Likewise. + * dojump.c (compare_from_rtx): Likewise. + (do_compare_rtx_and_jump): Likewise. + * integrate.c (subst_constants): Likewise. + * unroll.c (simplify_cmp_and_jump_insns): Likewise. + +2004-03-09 Kazu Hirata + + * config/m32r/m32r.md: Remove all define_peephole's. + +2004-03-09 Alan Modra + + * config/rs6000/rs6000.md: Remove trailing whitespace. + +2004-03-08 Eric Christopher + + * Makefile.in (site.exp): Add libiconv variable definition. + +2004-03-09 Hans-Peter Nilsson + + * configure: Regenerate for config/accross.m4 correction. + +2004-03-08 Joel Sherrill + + PR target/14480 + * config/rs6000/t-rtems: Add missing file on branch. + +2004-03-08 Roger Sayle + + PR middle-end/14289 + * c-typeck.c (c_mark_addressable): A register variable should + be considered global if its not automatic, i.e. TREE_PUBLIC, + TREE_STATIC or DECL_EXTERNAL. + * function.c (put_var_into_stack): Call abort when placing a + hard register into the stack, if x_parm_reg_stack_loc is NULL. + +2004-03-08 Ulrich Weigand + + * config/s390/s390.md ("*extendqidi2_short_displ"): Add CC clobber. + ("*extendqisi2_short_displ"): Likewise. + +2004-03-08 Kazu Hirata + + * config/pdp11/pdp11.c (comparison_operator_index): Remove. + (comp_operator): Likewise. + * config/pdp11/pdp11-protos.h: Remove corresponding + prototypes. + +2004-03-08 Eric Botcazou + + * expr.c (highest_pow2_factor_for_type): Rename into + highest_pow2_factor_for_target. Use DECL_ALIGN instead of + TYPE_ALIGN when the target is a COMPONENT_REF. + (expand_assignment): Ajust call to highest_pow2_factor_for_type. + +2004-03-08 Alan Modra + + * config/rs6000/rs6000.c: Formatting fix. + (legitimate_offset_address_p): Correct offset range check. + + * config/rs6000/rs6000.c (rs6000_override_options): Don't override + -msoft-float by -mcpu. Consolidate similar code for MASK_MULTIPLE + and MASK_STRING. + +2004-03-07 Aldy Hernandez + + * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power + for little endian. + ("ashrdi3_no_power"): Disable for little endian. + (ashrdi3): Same. + +2004-03-07 Kaveh R. Ghazi + + * fold-const.c (tree_expr_nonnegative_p): Reformat checks for + builtins. + +2004-03-08 Hans-Peter Nilsson + + PR target/14471 + * configure.ac (Target-specific assembler checks) : New + case, checking for -no-mul-bug-abort option. + * configure, config.in: Regenerate. + * doc/invoke.texi (CRIS Options): Document -mmul-bug-workaround + and -mno-mul-bug-workaround. + * config/cris/cris.md ("smulsi3_highpart", "umulsi3_highpart") + ("mulsidi3", "umulsidi3"): Prefix output template with "%!". + ("umulhisi3", "umulqihi3", "mulsi3", "mulqihi3", "mulhisi3"): + Ditto. Make attribute "slottable" dependent on TARGET_MUL_BUG. + * config/cris/mulsi3.asm (__Mul) [__CRIS_arch_version >= 10]: Make + sure mulu.d is not last on cache-line. + * config/cris/cris.h (ASM_SPEC): Translate -mno-mul-bug-workaround + into -no-mul-bug-abort depending on HAVE_AS_MUL_BUG_ABORT_OPTION. + (TARGET_MASK_MUL_BUG, TARGET_MUL_BUG): New macros. + (TARGET_SWITCHES): New options -mmul-bug-workaround and + -mno-mul-bug-workaround. + (TARGET_DEFAULT): Include TARGET_MASK_MUL_BUG. + (PRINT_OPERAND_PUNCT_VALID_P): Include '!'. + * config/cris/cris.c (cris_operand_extend_operator): Clarify + relation to MULT in head comment. + (cris_op_str): Abort for MULT. + (cris_print_operand) : New case. + +2004-03-08 Alan Modra + + PR debug/11983 + * dwarf2out.c (enum dw_val_class): Rename dw_val_class_float to + dw_val_class_vec. Replace use throughout file. + (dw_float_const): Delete. + (dw_vec_const): New. + (dw_val_struct_union): Rename val_float to val_vec. Replace use + throughout file. + (add_AT_vec): Rename from add_AT_float. Add elt_size param. + (same_dw_val_p): Adjust vec comparison. Use memcmp. + (size_of_die): Adjust dw_val_class_vec sizing. + (output_die): Output dw_val_class_vec. + (insert_int, extract_int, insert_float): New functions. + (add_const_value_attribute): Use insert_float for CONST_DOUBLE. + Handle CONST_VECTOR. + (add_location_or_const_value_attribute): Handle CONST_VECTOR. + +2004-03-07 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_parse_abi_options): SPE and + AltiVec abi cannot co-exist. + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Same. + +2004-03-07 Jan Hubicka + + * except.c (emit_to_new_bb_before): Break fallthru edges. + +2004-03-07 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*lshrsi3_const"): Disable for 68HC12. + ("*lshrsi3"): Also accept an immediate for 68HC12. + ("*ashrsi3_const"): Likewise. + ("*ashrsi3"): Likewise. + ("*ashlsi3_const"): Likewise. + ("*ashlsi3"): Likewise. + ("cmphi_1_hc12"): Compare two hard register by pushing them and + comparing with a pop; don't use a split for that. + ("cmphi split"): Disable compare split for 68HC12. + + * config/m68hc11/m68hc11.c (m68hc11_notice_update_cc): Invalidate + the status operands if they have side effects. + +2004-03-07 Kazu Hirata + + * defaults.h (LEGITIMIZE_ADDRESS): Provide a default + definition. + * config/arc/arc.h, config/fr30/fr30.h, config/frv/frv.h, + config/h8300/h8300.h, config/ia64/ia64.h, + config/mcore/mcore.h, config/mmix/mmix.h, + config/ns32k/ns32k.h, config/pdp11/pdp11.h, + config/stormy16/stormy16.h, config/v850/v850.h, + config/vax/vax.h (LEGITIMIZE_ADDRESS): Remove. + * doc/tm.texi (LEGITIMIZE_ADDRESS): Mention the default + definition. + +2004-03-07 Roger Sayle + + * fold-const.c (fold) : Fold x | x as x. + : Fold x ^ x as zero. + : Fold x & x as x. + +2004-03-07 Roger Sayle + + * fold-const.c (fold) : Rewrite optimization to transform + "foo++ == const" into "++foo == const+incr". + +2004-03-07 Richard Sandiford + + * config/mips/mips.c (mips_in_small_data_p): Return false if + TARGET_ABICALLS. + +2004-03-06 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Use 2,-sp to push + the stack register. + (expand_prologue): Don't make an interrupt or a trap handler a far + symbol. + (m68hc11_initial_elimination_offset): Likewise. + +2004-03-06 Richard Henderson + + * config/alpha/alpha.c (alpha_in_small_data_p): False for functions. + +2004-03-06 Kazu Hirata + + * config/ns32k/ns32k-protos.h: Add a prototype for + ns32k_notice_update_cc. + * config/ns32k/ns32k.c (ns32k_notice_update_cc): New. + * config/ns32k/ns32k.h (NOTICE_UPDATE_CC): Call + ns32k_notice_update_cc. + +2004-03-06 Ulrich Weigand + + * config/s390/s390.md ("load_multiple", "*load_multiple_di", + "*load_multiple_si"): Allow only if reload_completed. + ("store_multiple", "*store_multiple_di", "*store_multiple_si"): + Likewise. + +2004-03-06 Kazu Hirata + + * config/vax/vax-protos.h: Add a prototype for + vax_notice_update_cc. + * config/vax/vax.c (vax_notice_update_cc): New. + * config/vax/vax.h (NOTICE_UPDATE_CC): Call + vax_notice_update_cc. + +2004-03-06 David Edelsohn + + * collect2.c (main): Only export initfunc and finifunc if + LD_INIT_SWITCH not defined. + (scan_prog_file): Only export constructors and destructors if + LD_INIT_SWITCH not defined. Only export symbols not found in + shared objects. + +2004-03-06 John David Anglin + + * pa.md (icacheflush): Reorder operands to make match_scratch operand + last. + * pa.h (INITIALIZE_TRAMPOLINE): Remove unnecessary scratch argument + from calls to gen_icacheflush. + +2004-03-06 Richard Henderson + + * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. + (TARGET_LONG_DOUBLE_128): New. + (TARGET_SWITCHES): Add long-double-{128,64}. + (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. + (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. + (WIDEST_HARDWARE_FP_SIZE): New. + (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. + * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 + if TARGET_VAX_FLOAT. + * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. + (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. + +2004-03-06 Richard Henderson + + * config/alpha/alpha.c (alpha_swapped_comparison_operator): Fix + botched rtx class conversion. + +2004-03-06 Kaveh R. Ghazi + + * tree.h (BUILTIN_EXP10_P, BUILTIN_EXPONENT_P, BUILTIN_SQRT_P, + BUILTIN_CBRT_P, BUILTIN_ROOT_P): New macros. + + * builtins.c (fold_builtin_logarithm, fold_builtin): Use new + macros. + * fold-const.c (fold_mathfn_compare, fold): Likewise. + +2004-03-06 Eric Botcazou + + PR target/14343 + * config/i386/i386.md (movv2di_internal): Conditionalize on + TARGET_SSE, not TARGET_SSE2. + +2004-03-05 Chris Demetriou + + * config.gcc (mips64orion-*-elf*, mips64orionel-*-elf*): Delete + duplicated line. + +2004-03-05 Kaveh R. Ghazi + + * builtins.c: Consistently use logN not log* in comments. + +2004-03-05 Andreas Krebbel + + * rtl.h (mem_expr_equal_p): Function prototype added. + * cfgcleanup.c (merge_memattrs): New function. + (flow_find_cross_jump): Call merge_memattrs for matching insns. + * emit-rtl.c (mem_expr_equal_p): New function. + +2004-03-05 Ziemowit Laski + + * objc/objc-act.c (synth_module_prologue): Const-qualify + objc_selector type if using the GNU runtime; fix generated + signatures for objc_msg_lookup and objc_msg_lookup_super + to match what GNU ObjC headers provide; reformat and clean up. + (synth_self_and_ucmd_args): Use previously constructed (and + hence possibly const-qualified) objc_selector type. + +2004-03-05 Kazu Hirata + + * doc/tm.texi (HARD_REGNO_RENAME_OK): Document. + +2004-03-05 Jason Merrill + + * tree.h (TYPE_HASH): Use TYPE_UID. + (TREE_HASH): New macro with old definition of TYPE_HASH. + * tree.c (build_type_attribute_variant): Use iterative_hash_object. + (build_array_type, build_function_type): Likewise. + (build_method_type_directly): Likewise. + (build_offset_type, build_complex_type): Likewise. + (type_hash_list, attribute_hash_list): Likewise. Now static. + * except.c: s/TYPE_HASH/TREE_HASH/. + +2004-03-05 Bob Wilson + + * config/xtensa/xtensa.c (function_arg): Handle 16-byte aligned args. + (xtensa_va_start): Initialize __va_stk to ($arg_ptr - 32). Adjust + __va_ndx by 2 words when referencing an argument on the stack. + (xtensa_va_arg): Handle 16-byte aligned args. Adjust __va_ndx by 2 + words when an arg on the stack is first seen. + +2004-03-05 Paul Brook + + * arm.h (ARM_FLAG_VFP): Remove. + (ARM_FLAG_ATPCS, CIRRUS_FIX_INVALID_INSNS): Renumber. + * netbsd-elf.h (ARM_FLAG_VFP): Remove. + +2004-03-05 Paul Brook + + * function.c (assign_parms): Include pretend alignment offset. + +2004-03-05 Richard Kenner + + * stor-layout.c (layout_type, case FUNCTION_TYPE): Make size + FUNCTION_BOUNDARY, not POINTER_SIZE * 2. + +2004-03-05 Ian Lance Taylor + + * configure.ac: When passing --enable-languages to subdir + configure when host != build, make sure we don't pass an empty + value. + * configure: Regenerate. + +2004-03-05 Nathan Sidwell + + PR 13577 + * gcc.c (cc1_options): Robustify -auxbase-strip from multiple -o + options. + +2004-03-05 Paolo Bonzini + + * simplify-rtx.c (simplify_relational_operation): If + flag_wrapv is set, do not move terms between the two + side of a relational operator. + +2004-03-05 Paolo Bonzini + + * rtlanal.c: Include target.h and output.h + (rtx_cost, address_cost, default_address_cost): Move from... + * cse.c (rtx_cost, address_cost, default_address_cost): + ... this file. + * rtl.h (rtx_cost, address_cost): Move under rtlanal.c. + * Makefile.in: Adjust dependencies. + +2004-03-05 Paolo Bonzini + + * cse.c (cse_end_of_basic_block): Make static. + * local-alloc.c (function_invariant_p): Move to + reload1.c. + * loop.c (libcall_other_reg, record_excess_regs): + Make static. + * reload1.c (function_invariant_p): Moved here + from local-alloc.c, made static. + * rtl.h (cse_end_of_basic_block, function_invariant_p, + libcall_other_reg, record_excess_regs): Remove + declarations. + +2004-03-05 Kazu Hirata + + * config/m32r/m32r.c (signed_comparison_operator): Add a + missing parenthesis. + +2004-03-04 Ian Lance Taylor + + * ggc-common.c (gt_pch_restore): Don't unmap addr unless we are + going to call mmap again. Read the file into the right place. + Give a fatal error if we have to relocate. + +2004-03-04 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_return_in_msb): New function. + (TARGET_RETURN_IN_MSB): Define to xtensa_return_in_msb. + +2004-03-05 Hans-Peter Nilsson + + PR other/14354 + * config/fp-bit.c (_fpdiv_parts): Do not round when pack_d would + round the same. When rounding, clear bits that would cause a + second rounding in pack_d. + (_fpmul_parts): Ditto. Remove #if 0:d code. + +2004-03-04 Ziemowit Laski + + PR c++/14425, c++/14426 + * config/rs6000/altivec.h (vec_splat_s8, vec_splat_s16, + vec_splat_s32, vec_splat_u8, vec_splat_u16, vec_splat_u32): + Change C++ definitions to accept a 'const int' argument; + the prototypes already do. + * config/rs6000/rs6000.c (rs6000_common_init_builtins): + Rename v4si_ftype_char, v8hi_ftype_char, v16qi_ftype_char, + v4sf_ftype_v4si_char, v4si_ftype_v4sf_char, v4si_ftype_v4si_char, + v8hi_ftype_v8hi_char, v16qi_ftype_v16qi_char, + v16qi_ftype_v16qi_v16qi_char, v8hi_ftype_v8hi_v8hi_char, + v4si_ftype_v4si_v4si_char and v4sf_ftype_v4sf_v4sf_char to + end in ..._int; change them to accept an int instead of a char + as the last parameter. + +2004-03-04 Phil Edwards + + * genmultilib: Change '=' to '-' when translating option names + to directory names. + +2004-03-04 Richard Kenner + + * expr.c (expand_expr_real, case COMPONENT_REF): Get proper type of + stack slot for temp used for result of BLKmode but in integral mode. + +2004-03-04 Jan Hubicka + + * reload.c (find_reloads): Reorganize if seqeunce to switch. + + * cfgrtl.c (rtl_redirect_edge_and_branch): Set the source BB as dirty. + (cfglayout_redirect_edge_and_branch): Set the source BB as dirty. + +2004-03-04 Steve Ellcey + + * config/ia64/ia64.md (divdf3_internal_thr): Fix algorithm. + * testsuite/gcc.dg/20040303-1.c: New test. + +2004-03-04 Steven Bosscher + + * ppro.md: Rewrite as a DFA pipeline description. + * i386.md: Remove all uses of the ppro_uops attribute. + * i386.c: (ix86_safe_ppro_uops, ix86_dump_ppro_packet, + ix86_reorder_insn, ix86_sched_reorder_ppro, ix86_sched_init, + ix86_sched_reorder, ix86_variable_issue, + struct ix86_sched_data, TARGET_SCHED_VARIABLE_ISSUE, + TARGET_SCHED_INIT, TARGET_SCHED_REORDER): Remove. + (ia32_use_dfa_pipeline_interface): Add TARGET_PENTIUMPRO. + (ia32_multipass_dfa_lookahead): Add TARGET_PENTIUMPRO. + * athlon.md (athlon_ssecmp_load): Fix comment + +2004-03-04 Stuart Hastings + + * doc/invoke.texi: Document -mlongcall for Darwin/PPC. + +2004-03-04 Stuart Hastings + + * config/i386/darwin.h: Darwin/x86 doesn't support CPUs before + 686, tell Darwin assembler to allow prefetch insns, non-empty def + of SUBTARGET_OPTION_TRANSLATE_TABLE. + +2004-03-04 DJ Delorie + + PR optimization/14282 + * sched-deps.c (sched_analyze_insn): Allow a stack adjustment + between a call and the assignment of its return value. + +2004-03-04 Kazu Hirata + + * config/h8300/h8300.c: Put a comment for every function. + +2004-03-04 Kazu Hirata + + * config/h8300/h8300.md: Add comments about peephole2's. + +2004-03-04 Steven Bosscher + + * i386.h (TARGET_CPU_DEFAULT_nocona): Fix value. + +2004-03-04 Jan Hubicka + + * cfgcleanup.c (thread_jump): Update call of cselib_init. + * cselib.c (cselib_record_memory): New static variable. + (cselib_lookup_mem, cselib_record_set, cselib_record_sets): + Give up on memories when asked for. + (cselib_init): Accept new argument. + * cselib.h (cselib_init): Update prototype. + * gcse.c (local_cprop_pass): Update call of cselib_init. + * loop.c (load_mems): Update call of cselib_init. + * postreload.c (reload_cse_regs_1): Update call of cselib_init. + * sched-deps.c (sched_analyze): Update call of cselib_init. + +2004-03-04 David Edelsohn + GP + + * config/rs6000/rs6000.c (output_function_profiler): Append @plt + when compiling PIC. + +2004-03-04 Josef Zlomek + + PR/14362 + * var-tracking.c (track_expr_p): Do not track variables which + should be ignored for debugging purposes. + +2004-03-04 Alan Modra + + * real.c (encode_ibm_extended): Don't bother rounding low double. + * c-cppbuiltin.c (builtin_define_float_constants): Tweak MAX + when fmt->pnan < fmt->p. + +2004-03-04 Eric Christopher + + * config/mips/mips.h (FUNCTION_ARG_REGNO_P): Fix to check + only range of valid arg registers and fixed_regs. + +2004-03-04 Alan Modra + + PR target/14406 + * config/rs6000/rs6000.md (abstf2, abstf2+1): Delete define_insn. + (abstf2, abstf2_internal): New define_expand. + +2004-03-04 Eric Botcazou + + PR optimization/14235 + * expr.c (convert_move): Copy the source to a new pseudo + when converting from a sub-word source to a larger-than-word + register which conflicts with the source. + +2004-03-03 Zack Weinberg + + PR 13728 + * c-decl.c (diagnose_mismatched_decls): Issue an error for two + parameters with the same name, unless one is a forward decl. + Do not issue a redundant-redeclaration warning for forward + decls of parameters. + +2004-03-04 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Document use of Bash to speed up + configuration. + +2004-03-03 Ian Lance Taylor + + * ggc-zone.c (ggc_pch_write_object): Don't align file pointer. + +2004-03-04 Alan Modra + + * target-def.h (TARGET_OPTF): Delete. + * c-opts.c (TARGET_OPTF): Define. + +2004-03-04 Jan Hubicka + + * cselib.c (cselib_finish): Fix another miss-application of my previous + patch. + +2004-03-03 Mike Stump + + Add framework support for darwin. + + * c-incpath.c: Include target.h and machmode.h. + (add_path): Use a consistent style for cpp_dir. Initialize + p->construct to 0. + (add_cpp_dir_path): New. + (register_include_chains): Add use of extra_includes callback. + (hook_void_int): Add. + (target_c_incpath): Add. + * c-incpath.h (add_cpp_dir_path): New. + (target_c_incpath_s): Add. + (target_c_incpath): Add. + (C_INCPATH_INIT): Add. + * c-opts.c (c_common_missing_argument, + c_common_handle_option): Add -F argument processing. + * c.opt: Add -F argument processing. + * gcc.c (trad_capable_cpp): Add -F argument processing. + * cppfiles.c (find_file_in_dir): Update to use construct + callback. + (search_path_exhausted, cpp_get_path, cpp_get_buffer, + cpp_get_prev): New. + (_cpp_find_file): Use search_path_exhausted. + (make_cpp_dir): Initialize construct to 0. + * cpplib.h (missing_header_cb + cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. + (cpp_callbacks): Add missing_header + (cpp_dir): Add construct. + * target-def.h: (TARGET_OPTF): New. + * hooks.c (hook_void_int, hook_void_charptr): Add. + * hooks.h (hook_void_int, hook_void_charptr): Add. + * Makefile.in (c-incpath.o) : Add $(TARGET_H) and + $(MACHMODE_H) dependencies. + * doc/invoke.texi (Darwin Options): Document -F. + * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. + (TARGET_OPTF): Add. + * fix-header.c (target_c_incpath): Add. + + * config/darwin-c.c: Add c-incpath.h include. + (using_frameworks, find_subframework_file, + find_subframework_header, add_system_framework_path, + frameworks_in_use, num_frameworks, max_frameworks, + add_framework, find_framework, struct framework_header, + framework_header_dirs, framework_construct_pathname, + find_subframework_file, add_system_framework_path, + add_framework_path, framework_defaults, + darwin_register_frameworks, find_subframework_header): Add. + * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. + (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. + (CPP_SPEC): Add __APPLE_CC__ support. + * t-darwin (darwin-c.o): Add c-incpath.h dependency. + +2004-03-04 Jan Hubicka + + * cselib.c (cselib_finish): Fix miss-application of my previous + patch. + +2004-03-03 Kazu Hirata + + * hooks.c (hook_tree_tree_identity): New. + * hooks.h: Add a prototype for hook_tree_tree_identity. + * stmt.c (expand_asm_operands): Use targetm.md_asm_clobbers + instead of MD_ASM_CLOBBERS. + * system.h (MD_ASM_CLOBBERS): Poison. + * target-def.h (TARGET_MD_ASM_CLOBBERS): New. + (TARGET_INITIALIZER): Add TARGET_MD_ASM_CLOBBERS. + * target.h (gcc_target): Add md_asm_clobbers. + * config/i386/i386.c (TARGET_MD_ASM_CLOBBERS): New. + (ix86_md_asm_clobbers): New. + * config/i386/i386.h (MD_ASM_CLOBBERS): Remove. + * doc/tm.texi (MD_ASM_CLOBBERS): Change to + TARGET_MD_ASM_CLOBBERS. + +2004-03-03 Stuart Hastings + + * config.gcc: Arrange for Darwin/x86 to build libgcc_eh.a. + +2004-03-03 Eric Botcazou + + * config/sparc/sparc.c (noov_compare64_op): Fix typo. + + * config/sparc/sparc.h (ASM_FLOAT): Delete. + (ASM_DOUBLE): Likewise. + (ASM_LONGDOUBLE): Likewise. + * config/sparc/pbd.h (ASM_INT_OP): Delete. + +2004-03-03 Richard Henderson + + PR opt/13862 + * cselib.c (cselib_record_sets): Don't record multiple sets in + asm insns. + +2004-03-03 Mostafa Hagog + + * common.opt: Add description of the new -fgcse-after-reload flag. + + * flags.h (flag_gcse_after_reload): Declaration of global variable. + + * gcse.c (reg_used_on_edge ,reg_set_between_after_reload_p, + reg_used_between_after_reload_p, rtx get_avail_load_store_reg, + is_jump_table_basic_block, bb_has_well_behaved_predecessors, + get_bb_avail_insn, hash_scan_set_after_reload, + compute_hash_table_after_reload, eliminate_partially_redundant_loads, + gcse_after_reload, get_bb_avail_insn): New functions to implement + gcse-after-reload. + (gcse_after_reload_main): New function, the main entry point to + gcse-after-reload. + + * rtl.h (gcse_after_reload_main): Declaration of the new function. + + * opts.c (common_handle_option): Handle the -fgcse-after-reload flag. + + * toplev.c (flag_gcse_after_reload): Initialization. + + * passes.c (rest_of_handl_gcse2): Call gcse_after_reload_main. + + * params.def (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION, + PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION): New parameters for tuning + the gcse after reload optimization. + + * params.h (GCSE_AFTER_RELOAD_PARTIAL_FRACTION, + GCSE_AFTER_RELOAD_CRITICAL_FRACTION): Two macros to access the tuning + parameters. + + * doc/invoke.texi: Documentation for the new flag gcse-after-reload. + +2004-03-03 Nicolas Pitre + + * config/arm/ieee754-df.S (muldf3, divdf3): Fix denormalization of + small negative values. + +2004-03-03 Jan Hubicka + + * cselib.c (hash_table): Remove GTY marker. + (reg_values): Turn into array. + (used_regs): Likewise. + (n_used_regs): New static variable. + (reg_values_old): Kill. + (clear_table): Update uses of arrays. + (cselib_lookup): Likewise. + (cselib_record_set): Likewise. + (cselib_init): Likewise. + (cselib_finish): Likewise. + (cselib_udpate_varray_sizes): Kill. + * cselib.h (cselib_update_varray_sizes): Kill. + +2004-03-03 Paul Brook + + * flow.c (ior_reg_cond, and_reg_cond): Remove stray ")". + +2004-03-03 Jan Hubicka + + * ggc-common.c (ggc_alloc_cleared_stat, ggc_realloc_stat): + Rename from ...; make statistics transparent. + (ggc_alloc_cleared, ggc_realloc_stat): ... these. + (loc_descriptor): New structure. + (hash_descriptor, eq_descriptor, loc_descriptor, cmp_statistics, + add_statistics): + New static function. + (ggc_record_overhead, dump_statistics): New global function. + * ggc-none.c (ggc_alloc_types_stat, ggc_alloc_stat, ggc_alloc_zone_stat, + ggc_alloc_cleared_stat, ggc_realloc_stat, ggc_alloc_typed_stat): Rename + from ...; accept locations + (ggc_alloc_types, ggc_alloc, ggc_alloc_zone, ggc_alloc_cleared, + ggc_realloc, ggc_alloc_typed): ... this one. + from ...; accept locations + * ggc-page.c (ggc_alloc_typed_stat, ggc_alloc_zone_stat, + ggc_alloc_stat): Rename from ... ; pass locations + * ggc-page.c (ggc_alloc_typed, ggc_alloc_zone, ggc_alloc): + ... this one. + (ggc_alloc_stat): Record overehead. + * ggc.h (ggc_alloc_types, ggc_alloc, ggc_alloc_zone, ggc_alloc_cleared, + ggc_realloc, ggc_alloc_typed): Turn to macros + (ggc_alloc_types_stat, ggc_alloc_stat, ggc_alloc_zone_stat, + ggc_alloc_cleared_stat, ggc_realloc_stat, ggc_alloc_typed_stat): Declare. + (dump_ggc_loc_satistics, ggc_record_overehead): Declare. + * langhooks.h (lhd_make_node): Declare. + (LANG_HOOKS_MAKE_TYPE): Default to new function, + * langhooks.c (lhd_make_node): New. + * rtl.c (rtx_alloc_stat, swallow_copy_rtx_stat): Rename from ... ; pass + locations. + (rtx_alloc, swallow_copy_rtx): ... this one. + * rtl.h (rtx_alloc, swallow_copy_rtx): Turn to macros. + * rtl.c (rtx_alloc_stat, swallow_copy_rtx_stat): Declare. + * toplpev.c (finalize): Dump stats. + * tree.c (make_node_stat, copy_node_stat, make_tree_vec_stat, + build_tree_list_stat, tree_cons_stat, build?_stat, build_decl_stat): + Rename from ... ; pass locators. + (make_node, copy_node, make_tree_vec, build_tree_list, tree_cons, + build?, build_decl): Declare. + * tree.h (make_node_stat, copy_node_stat, make_tree_vec_stat, + build_tree_list_stat, tree_cons_stat, build?_stat, build_decl_stat): + Declare. + (make_node, copy_node, make_tree_vec, build_tree_list, tree_cons, + build?, build_decl): New macros. + * Makefile.in (RTL_H, TREE_H): Add statistics.h dependency. + * statistics.h: New file. + +2004-03-03 Maciej W. Rozycki + Richard Sandiford + + * config/mips/mips.h (MASK_FIX_SB1): Bump. + (MASK_FIX_R4400, TARGET_FIX_R4400): New macros. + (TARGET_SWITCHES): Add -mfix-r4400 and -mno-fix-r4400. + * config/mips/mips.c (mips_output_division): Fill the branch delay + slot with a nop if TARGET_FIX_R4000. Extend R4000 workarounds to + TARGET_FIX_R4400. + (mips_output_division): Adjust accordingly. + (override_options): Make -march=r4400 imply -mfix-r4400 by default. + * doc/invoke.texi: Document -mfix-r4400 and new errata workarounds. + +2004-03-03 Paolo Bonzini + + * alias.c (rtx_equal_for_memref_p): Use predicates + to test rtx classes and new rtx class codes, possibly + splitting conditionals that tested against '<' and 'o'. + * caller-save.c (save_call_clobbered_regs): Likewise. + * combine.c (contains_muldiv, find_split_point, subst, + combine_simplify_rtx, simplify_if_then_else, + simplify_set, simplify_logical, expand_compound_operation, + make_compound_operation, if_then_else_cond, known_cond, + apply_distributive_law, cached_nonzero_bits, + cached_num_sign_bit_copies, simplify_shift_const, + gen_binary, simplify_comparison, update_table_tick, + record_value_for_reg, get_lsat_value_validate): Likewise. + * cse.c (mention_regs, find_best_addr, find_comparison_args, + fold_rtx, cse_insn, invalidate_memory, cse_basic_block): + Likewise. + * emit-rtl.c (copy_insn_1): Likewise. + * expr.c (force_operand): Likewise. + * final.c (final_scan_insn, get_mem_expr_from_op): Likewise. + * flow.c (notice_stack_pointer_modification_1, + invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond, + and_reg_cond, elim_reg_cond): Likewise. + * function.c (update_epilogue_consts): Likewise. + * genattrtab.c (attr_rtx_1): Likewise. + * genopinit.c (gen_insn): Likewise. + * integrate.c (subst_constants): Likewise. + * jump.c (reversed_comparison_code_parts, + reversed_comparison_code, delete_related_insns, + rtx_renumbered_equal_p): Likewise. + * local-alloc.c (block_alloc): Likewise. + * loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv, + canonicalize_condition): Likewise. + * loop-iv.c (simplify_using_conditions, iv_number_of_iterations): + Likewise. + * optabs.c (add_equal_node, expand_binop): Likewise. + * predict.c (estimate_probability): Likewise. + * ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise. + * recog.c (validate_replace_rtx_1, comparison_operator, + offsettable_address_p, constrain_operands): Likewise. + * reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat): + Likewise. + * regclass.c (scan_one_insn): Likewise. + * regmove.c (stable_and_no_regs_but_for_p): Likewise. + * regrename.c (kill_autoinc_value): Likewise. + * reload.c (find_reusable_reload, find_reloads, + reg_overlap_mentioned_for_reload_p): Likewise. + * reload1.c (gen_reload, delete_address_reloads_1): Likewise. + * rtl.c (copy_rtx): Likewise. + * rtl.h (CONSTANT_P, INSN_P): Likewise. + * rtlanal.c (commutative_operand_precedence): Likewise. + * sched-deps.c (conditions_mutex_p): Likewise. + * sched-rgn.c (is_cfg_nonregular): Likewise. + * simplify-rtx.c (simplify_gen_binary, + simplify_gen_relational, simplify_replace_rtx, + simplify_unary_operation, simplify_binary_operation, + simplify_ternary_operation, simplify_rtx): Likewise. + * unroll.c (reg_dead_after_loop): Likewise. + * config/alpha/alpha.c (alpha_swapped_comparison_operator, + print_operand): Likewise. + * config/arc/arc.c (proper_comparison_operator): Likewise. + * config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode): + Likewise. + * config/avr/avr.c (_reg_unused_after): Likewise. + * config/frv/frv.c (frv_ifcvt_modify_tests, + frv_ifcvt_modify_insn, frv_pack_insn): Likewise. + * config/i386/i386.c (ix86_comparison_operator, + ix86_carry_flag_operator, fcmov_comparison_operator, + arith_or_logical_operator, print_operand, + ix86_expand_binary_operator, ix86_binary_operator_ok): + Likewise. + * config/i386/i386.md: Likewise. + * config/ia64/ia64.c (not_postinc_memory_operand, + ia64_print_operand, update_set_flags, errata_emit_nops): + Likewise. + * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS, + CONSTRAINT_OK_FOR_S): Likewise. + * config/ip2k/ip2k.c (mdr_resequence_xy_yx, + mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, + ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p, + ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator): + Likewise. + * config/iq2000/iq2000.c (cmp_op, symbolic_expression_p, + eqne_comparison_operator, signed_comparison_operator): + Likewise. + * config/mips/mips.c (cmp_op, symbolic_expression_p): + Likewise. + * config/mmix/mmix (mmix_foldable_comparison_operator, + mmix_comparison_operator): Likewise. + * config/pa/pa.c (hppa_legitimize_address): Likewise. + * config/rs6000/rs6000.c (stmw_operation, + branch_comparison_operator, trap_comparison_operator, + ccr_bit): Likewise. + * config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise. + * config/s390/s390.c (s390_alc_comparison, + s390_slb_comparison):L Likewise. + * config/sh/sh.c (gen_block_redirect, reg_unused_after): + Likewise. + * config/sparc/sparc.c (eq_or_neq, normal_comp_operator, + noov_compare_op, noov_compare64_op, v9_regcmp_op, + emit_hard_tfmode_operation, reg_unused_after) + * doc/md.texi, doc/rtl.texi: Likewise. + + * ra-debug.c: Add 2004 to list of copyright years. + * unroll.c: Likewise. + + * combine.c (simplify_logical): Remove dummy test, + (apply_distributive_law): Fix typo in comment. + GET_CODE (x) == AND so x is a commutative binary op. + * jump.c (delete_related_insns): simplify loop + condition, move testing of RTX codes inside the loop. + (rtx_renumbered_equal_p): do not use RTX_CODE. + * rtl.c (rtx_class): Declare as enum rtx_class. + * rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED): + Move to RTX_COMM_COMPARE class. + (HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE): + Move to RTX_CONST_OBJ class. + * rtl.h (enum rtx_class): New declaration, + (RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK, + RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT, + RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK, + RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT, + RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P, + ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P, + SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P, + OBJECT_P): New macros. + * config/sparc/sparc.c (noov_compare_op): Remove register + from parameter. + +2004-03-03 Kazu Hirata + + * target.h: Remove texi jargons in comments. + +2004-03-02 Kazu Hirata + + * config/h8300/lib1funcs.asm (___fixunssfsi): Change the + threshold to 0x4f. + + Revert: + 2004-02-27 Kazu Hirata + * config/h8300/fixunssfsi.c (__fixunssfsi): Enable on H8/300 + as well. + * config/h8300/lib1funcs.asm (___fixunssfsi): Remove. + * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _fixunssfsi_asm. + +2004-03-02 Kazu Hirata + + * doc/md.texi (cbranchmode4): New. + +2004-03-02 Eric Christopher + + * config/mips/mips16.S: Change fixsfsi and fixdfsi to + fix_trunc. + * config/mips/mips.c (mips_init_libfuncs): Change accordingly. + * config/mips/t-elf (LIB1ASMFUNCS): Ditto. + * config/mips/t-isa3264 (LIB1ASMFUNCS): Ditto. + * config/mips/t-r3900 (LIB1ASMFUNCS): Ditto. + +2004-03-02 Richard Henderson + + PR middle-end/11767 + * coverage.c (coverage_counter_ref): Set MEM_NOTRAP_P. + * optabs.c (prepare_cmp_insn): Force trapping memories to registers + before the compare, if flag_non_call_exceptions. + +2004-03-02 Richard Henderson + + PR middle-end/14327 + * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before + emitting the label, not after. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_addr_mode): New variable. + (m68hc11_mov_addr_mode): Likewise. + (m68hc11_override_options): Initialize them based on target. + (register_indirect_p): Allow a MEM for indirect addressing modes and + use flags to control what is allowed. + (m68hc11_small_indexed_indirect_p): Use m68hc11_mov_addr_mode for + supported addressing modes. + (m68hc11_register_indirect_p): Use m68hc11_addr_mode. + (go_if_legitimate_address_internal): Likewise. + (m68hc11_indirect_p): Likewise and check the mode. + (print_operand): Allow a (MEM (MEM)) and generate indirect addressing. + +2004-03-02 Kazu Hirata + + * builtins.c (BUILTIN_SETJMP_FRAME_VALUE): Remove. + (expand_builtin_setjmp_setup): Use + targetm.builtin_setjmp_frame_value instead of + BUILTIN_SETJMP_FRAME_VALUE. + * system.h (BUILTIN_SETJMP_FRAME_VALUE): Poison. + * target-def.h (TARGET_BUILTIN_SETJMP_FRAME_VALUE): New. + (TARGET_INITIALIZER): Add TARGET_BUILTIN_SETJMP_FRAME_VALUE. + * target.h (gcc_target): Add builtin_setjmp_frame_value. + * targhooks.c (default_builtin_setjmp_frame_value): New. + * targhooks.h: Add a prototype for + default_builtin_setjmp_frame_value. + * doc/tm.texi (BUILTIN_SETJMP_FRAME_VALUE): Change to + TARGET_BUILTIN_SETJMP_FRAME_VALUE. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.md (move peephole2): New peepholes to optimize + sequences of moves. + (add peepholes): New peepholes to optimize sequences adding small + constants. + (bset peepholes): New peepholes to transform an OR in a bset form + (bclr peepholes): Likewise for bclr form. + (cmp peepholes): New peepholes to avoid register copies when comparing. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.md ("*pushdi_internal"): New insn and split + to separate push from moves. + ("*pushdf_internal"): Likewise. + ("*pushsf_internal"): Likewise. + ("*pushsi_internal"): Likewise. + ("movdi_internal"): Use define_insn_and_split; non push operand. + ("movdf_internal"): Likewise. + ("movsf_internal"): Likewise. + ("movsi_internal"): Likewise. + ("*movhi_68hc12", "*addhi3_68hc12"): Fix and tune constraints + ("*addhi3", "*subhi3", "*andhi3_mem", "*iorhi3_mem"): Likewise. + ("*ashlsi3_const1", "*lshrsi3_const1"): Likewise. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.md ("tstqi_z_used"): Use define_insn_and_split. + ("cmphi_z_used", "cmpqi_z_used"): Likewise. + ("movstrictsi", "movstricthi", "movstrictqi"): Likewise. + ("anddi3", "andsi3", "iordi3", "iorsi3"): Likewise. + ("xordi3", "xorsi3", "*logicalsi3_zexthi"): Likewise. + ("*logicalsi3_zextqi", "*logicalhi3_zexthi_ashift8"): Likewise. + ("logicalhi3_zexthi", "*logicalsi3_silshr16"): Likewise. + ("*logicalsi3_silshl16", "*logicalsi3_silshl16_zext"): Likewise. + ("*ashldi3_const32", "*ashldi3_const1", "addsi_silshr16"): Likewise. + ("addsi_andshr16", "*ashlsi3_const16_zexthi"): Likewise. + ("*lshrdi3_const32", "*lshrdi_const1"): Likewise. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.md (SOFT_TMP_REGNUM): Define. + (SOFT_XY_REGNUM): Define. + (cmp split): Use the above instead of hard coded numbers. + (8-bit op split): No need to check the mode; allow Q_REG. + (ashift split): Adjust the first operand if it uses the SP and we + are pushing the shifted value. + (plus shift split): Fix when a source is in register D+X. + ("doloop_end"): Pass dummy arguments to gen_rtx_NE. + +2004-03-02 Stephane Carrez + + * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix when + comparing with Z register. + +2004-03-02 Zdenek Dvorak + + * cfgloop.h (struct loop_desc): Removed. + (struct loop): Fields simple, desc and has_desc removed. + (simple_loop_p, count_loop_iterations): Declaration removed. + * cfgloopanal.c (struct unmark_altered_insn_data): Removed. + (unmark_altered, blocks_invariant_registers, unmark_altered_insn + blocks_single_set_registers, invariant_rtx_wrto_regs_p_helper, + invariant_rtx_wrto_regs_p, test_for_iteration, constant_iterations, + simple_loop_exit_p, variable_initial_value, variable_initial_values, + simple_condition_p, simple_increment, count_strange_loop_iterations, + inverse, fits_in_mode_p, simple_loop_p, count_loop_iterations): + Removed. + * loop-iv.c (check_simple_exit, find_simple_exit): Update comments. + +2004-03-02 Kazu Hirata + + * genattrtab.c: Don't handle MATCH_INSN. + * genrecog.c: Likewise. + * gensupport.c: Likewise. + * rtl.def (match_insn): Remove. + * doc/md.texi (match_insn, match_insn2): Remove. + +2004-03-02 Mark Mitchell + + * doc/c-tree.texi (DECL_ASSEMBLER_NAME): Mention that using this + macro results in memory allocation. + +2004-03-02 David O'Brien + + * config/freebsd-spec.h (FBSD_DYNAMIC_LINKER): Add. + * config/alpha/freebsd.h (SUBTARGET_EXTRA_SPECS): Define + %(fbsd_dynamic_linker), + (LINK_SPEC): Use %(fbsd_dynamic_linker), and sync style with + config/i386/freebsd.h + * config/arm/freebsd.h: Ditto. + * config/i386/freebsd.h: Ditto. + * config/i386/freebsd64.h: Ditto. + * config/ia64/freebsd.h: Ditto. + * config/rs6000/sysv4.h: Ditto. + * config/sparc/freebsd.h: Ditto. + +2004-03-02 Loren James Rittle + + * doc/install.texi (*-*-freebsd*): Update target information. + +2004-03-02 Kazu Hirata + + * rtl.def (define_combine): Remove. + +2004-03-02 Kazu Hirata + + * config/h8300/h8300.md: Tweak formatting. + +2004-03-02 Kazu Hirata + + * config/h8300/h8300.md (*cmphi_h8300): Rename to + *cmphi_h8300_znvc. + (*cmphi_h8300hs): Rename to *cmphi_h8300hs_znvc. + +2004-03-01 Mark Mitchell + + PR bootstrap/14356 + * gcc.c (process_command): Remove const-qualification from argv. + (main): Likewise. + +2004-03-02 Kazu Hirata + + * config/h8300/h8300.md (pushqi1_h8300hs): Rename to + pushqi1_h8300hs_advanced. Adjust its caller. + (pushhi1_h8300hs): Rename to pushhi1_h8300hs_advanced. + Adjust its caller. + +2004-03-02 Nicolas Roche + + * Makefile.in (install-libgcc, install-multilib): Pass + mkinstalldirs var to libgcc.mk. + +2004-03-01 Kazu Hirata + + * system.h (DBX_OUTPUT_STANDARD_TYPES): Poison. + * doc/tm.texi (DBX_OUTPUT_STANDARD_TYPES): Remove. + +2004-03-01 Kazu Hirata + + * config/h8300/h8300.c (gtle_operator): Accept GT and LE. + * config/h8300/h8300.md: Split several peephole2's, each into + two. + +2004-03-02 Zdenek Dvorak + + * dominance.c (recount_dominator): Handle postdominators. + +2004-03-01 Richard Sandiford + + * config/mips/mips-protos.h (enum mips_symbol_type): Move from mips.h. + (NUM_SYMBOL_TYPES): Likewise. + (SYMBOL_64_HIGH, SYMBOL_64_MID, SYMBOL_64_LOW): New symbol types. + (mips_unspec_address): Declare. + (mips_gotoff_page, mips_gotoff_global): Delete. + * config/mips/mips.h (PREDICATE_CODES): Add general_symbolic_operand. + * config/mips/mips.c (enum mips_symbol_type, NUM_SYMBOL_TYPES): Delete. + (mips_symbolic_constant_p, mips_symbolic_address_p) + (mips_symbol_insns): Handle new symbol types. + (general_symbolic_operand): New predicate. + (mips_unspec_address): Make extern. + (mips_gotoff_page, mips_gotoff_global): Delete. + (override_options): Allow -mabi=64 -mno-abicalls -mexplicit-relocs. + Handle new symbol types. + * config/mips/mips.md (*lea_high64, *lea64): New patterns. + (*xgot_hi[sd]i, *xgot_lo[sd]i, *got_disp[sd]i, *got_disp[sd]i): Call + mips_unspec_address directly. + * doc/invoke.texi: Remove the -mabi=64 -mno-abicalls exception from + the documentation of -mexplicit-relocs. + +2004-03-01 Jeff Law + + * fold-const.c (fold): An equality comparison of a non-weak object + against zero has a known result. Similarly an equality comparison + of the address of two non-weak, unaliased symbols has a known result. + + * ggc-page.c (struct page_entry): New field PREV. + (ggc_alloc): Update PREV field appropriately. + (sweep_pages): Likewise. + (ggc_free): Likewise. Use PREV field rather than loop to + improve ggc_free performance. + +2004-03-01 Richard Sandiford + + * config/mips/mips.c (mips_output_division): Use the division + instruction to fill the delay slot of a zero check. + (mips_idiv_insns): Adjust accordingly. + +2004-03-01 Nathanael Nerode + + * config.gcc: Create a default tmake_file for linux, and use + it in all but two linux clauses. Comment those two. + +2004-03-01 Paolo Bonzini + + * combine.c (try_combine): Do not refer to is_replaced. + (gen_lowpart_for_combine): Perverse subregs now have a + more politically correct name. + * cse.c (cse_insn): Likewise. + * jump.c: Fix bogus reference to delete_insn. + +2004-02-29 Mark Mitchell + + PR debug/14328 + * dwarf2out.c (gen_enumeration_type_die): Output all enumeration + constants as signed values. + + PR middle-end/13448 + * c-tree.h (readonly_warning): Rename to ... + (readonly_error): ... this. + * c-typeck.c (build_unary_op): Adjust accordingly. + (readonly_warning): Rename to ... + (readonly_error): ... this and issue errors, not warnings. + (build_modify_expr): Call readonly_error, not readonly_warning. + (c_expand_asm_operands): Likewise. + * tree-inline.c (optimize_inline_calls): Do not inline functions + after errors have occurred. + +2004-02-29 Nathanael Nerode + + * configure.ac: Rearrange some threading code for clarity; + add section comment. + * configure: Regenerate. + +2004-02-29 Kazu Hirata + + * passes.c, config/frv/frv.c, config/sh/sh.c: Fix comment + typos. + * doc/cppopts.texi: Fix a typo. + +2004-02-29 Kazu Hirata + + * config/i386/i386.md: Fix formatting. + +2004-02-29 Nathanael Nerode + + * configure.ac: Add some comments delineating sections of code. + + * doc/install.texi: Note that libada uses autoconf 2.57 also. + + * doc/install.texi: Fix idiot typo in previous commit. + + * doc/install.texi: Update for conversion of intl to autoconf 2.57. + +2004-02-29 Kazu Hirata + + * config/h8300/h8300.md: Add comments about peephole2's. + +2004-02-29 Kazu Hirata + + * config/h8300/h8300.md: Tweak operand numbers of some + peephole2's. + +2004-02-29 Kazu Hirata + + * config/h8300/h8300.md: Tweak comments about peephole2's. + +2004-02-29 Waldek Hebisch + + PR middle-end/14203 + * function.c (uninitialized_vars_warning): Use DECL_RTL_SET_P + instead of testing whether DECL_RTL is not NULL. + +2004-02-28 Kazu Hirata + + * config/sh/sh.c: Fix formatting. + +2004-02-28 Kazu Hirata + + * config/sh/sh.c: Convert to ISO-C. + +2004-02-28 Andrew Pinski + + * c-typeck.c (tagged_types_tu_compatible_p): Fix pasto in + my previous patch. + + * config/darwin.h (machopic_finish): Output stub even if the + symbol is already defined. + +2004-02-28 John David Anglin + + * pa64-hpux.h (LIB_SPEC): Fix linking under HP-UX 11.00 with -p and -pg. + +2004-02-28 Kazu Hirata + + * genattr.c (main): Don't define + TRADITIONAL_PIPELINE_INTERFACE or DFA_PIPELINE_INTERFACE. + * system.h (TRADITIONAL_PIPELINE_INTERFACE): Poison. + (DFA_PIPELINE_INTERFACE): Likewise. + * doc/tm.texi (TRADITIONAL_PIPELINE_INTERFACE): Remove. + (DFA_PIPELINE_INTERFACE): Likewise. + +2004-02-28 Richard Sandiford + + * config/mips/mips.md (tstsi, tstdi): Delete. + +2004-02-28 Maciej W. Rozycki + + * config/mips/mips.c (override_options): Remove an obsolete + duplicate definition of the "e" constraint. + * config/mips/mips.h: Update a comment accordingly. + +2004-02-28 Maciej W. Rozycki + + * config/mips/mips.md: Complete the unfinished R4000 + multiply/shift errata workaround. Improve documentation. + (hazard): Use TARGET_FIX_R4000 to decide whether an "imul" instruction + has a hilo hazard. + (mulsi3, mulsi3_internal, mulsi3_r4000): Use TARGET_FIX_R4000. + (muldi3, muldi3_internal): Likewise. + (muldi3_internal2): Remove, replacing with... + (muldi3_mult3, muldi3_r4000): ...these new patterns. + (mulsidi3): Take the errata into account. + (mulsidi3_32bit): Remove, replacing with... + (mulsidi3_32bit_internal, mulsidi3_32bit_r4000): ...these new patterns. + (mulsidi3_64bit, mulsidi3_64bit_parts): Disable if TARGET_FIX_R4000. + (umulsidi3): Take the errata into account. + (umulsidi3_32bit): Remove, replacing with.. + (umulsidi3_32bit_internal, umulsidi3_32bit_r4000): ...these patterns. + (umulsi3_highpart, umulsi3_highpart_internal): Disable if + TARGET_FIX_R4000. + (smulsi3_highpart, smulsi3_highpart_internal): Likewise. + (smuldi3_highpart, umuldi3_highpart): Likewise. + * doc/invoke.texi: Document the errata workaround. + +2004-02-28 Maciej W. Rozycki + + * config/mips/mips-protos.h (mips_idiv_insns): Declare. + * config/mips/mips.h (MASK_FIX_SB1): Bump. + (MASK_FIX_R4000, TARGET_FIX_R4000): New macros. + (TARGET_SWITCHES): Add -mfix-r4000 and -mno-fix-r4000. + * config/mips/mips.c (mips_idiv_insns): New function. + (override_options): Make -march=r4000 imply -mfix-r4000 by default. + (mips_output_division): Add a workaround for the R4000 divide/shift + errata. + * config/mips/mips.md (length): Use mips_idiv_insns() to calculate + the length of an "idiv" instruction. + * doc/invoke.texi: Document the new switches. + +2004-02-28 Kazu Hirata + + * doc/tm.texi (IS_COSTLY_DEPENDENCE): Change to + TARGET_SCHED_IS_COSTLY_DEPENDENCE. + +2004-02-28 Zdenek Dvorak + + PR optimization/14229 + * cfgrtl.c (rtl_tidy_fallthru_edge): Do not fail for !onlyjump jump. + +2004-02-28 Eric Botcazou + + * fold-const.c (fold): Strip NOPs that change the signedness + for RSHIFT too. Expand comment. + +2004-02-27 Ian Lance Taylor + + PR optimization/7871 + * flow.c (mark_set_1): Don't add LOG_LINKS for global registers + from or to call insns. + +2004-02-27 Eric Botcazou + + PR optimization/7871 + * flow.c (propagate_one_insn): Interpret calls as setting global + registers, not merely clobbering them. + +2004-02-27 Dale Johannesen + + * config/darwin.c (machopic_output_possible_stub_label): Remove. + config/darwin-protos.h: Ditto. + config/darwin.h: Remove call to it. + * combine.c (distribute_notes): Do not place a REG_DEAD note + when value is both set and used. + +2004-02-27 Kazu Hirata + + * config/h8300/fixunssfsi.c (__fixunssfsi): Enable on H8/300 + as well. + * config/h8300/lib1funcs.asm (___fixunssfsi): Remove. + * config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _fixunssfsi_asm. + +2004-02-27 Andrew Pinski + + * c-typeck.c (tagged_types_tu_compatible_p) : + Speedup common case of the type values being in the same order. + +2004-02-27 Steve Ellcey + + * config/ia64/ia64.h (no-inline-float-divide): New option. + * config/ia64/ia64.h (no-inline-int-divide): New option. + * config/ia64/ia64.h (no-inline-sqrt): New option. + (TARGET_DEFAULT): Add MASK_INLINE_FLOAT_DIV_THR to define. + * config/ia64/hpux.h (TARGET_DEFAULT): Ditto. + * config/ia64/ia64.c (ia64_override_options): Modify error + checking for inlined division/sqrt. + +2004-02-27 Kazu Hirata + + * bb-reorder.c, cfgbuild.c, diagnostic.c, explow.c, profile.c, + ra-build.c, read-rtl.c, tracer.c, unwind-dw2-fde-glibc.c, + value-prof.c, config/darwin-protos.h, config/frv/frv-abi.h, + config/i386/pmmintrin.h, config/pa/pa-hpux.h: Update + copyright. + +2004-02-27 Paul Brook + + * function.c (assign_parms): Don't count pretend args for alignment. + +2004-02-27 Richard Henderson + + * passes.c: New file. + * Makefile.in (OBJS-common): Add it. + * diagnostic.c (rtl_dump_and_exit): Move decl ... + * flags.h (rtl_dump_and_exit): ... here. + * output.h (size_directive_output, last_assemble_variable_decl): + Move from toplev.c. + * rtl.h (reg_alloc): Move from toplev.c. + * toplev.c (HAVE_conditional_execution, DUMPFILE_FORMAT, + struct dump_file_info, enum dump_file_index, dump_file_tbl, + open_dump_file, close_dump_file, rest_of_decl_compilation, + rest_of_type_compilation, rest_of_handle_final, + rest_of_handle_delay_slots, rest_of_handle_stack_regs, + rest_of_handle_variable_tracking, rest_of_handle_machine_reorg, + rest_of_handle_new_regalloc, rest_of_handle_old_regalloc, + rest_of_handle_regrename, rest_of_handle_reorder_blocks, + rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_regmove, + rest_of_handle_tracer, rest_of_handle_if_conversion, + rest_of_handle_if_after_combine, rest_of_handle_web, + rest_of_handle_branch_prob, + rest_of_handle_value_profile_transformations, rest_of_handle_cfg, + rest_of_handle_addressof, rest_of_handle_sibling_calls, + rest_of_handle_jump_bypass, rest_of_handle_inlining, + rest_of_handle_null_pointer, rest_of_handle_combine, + rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, + rest_of_handle_gcse, rest_of_handle_loop_optimize, + rest_of_handle_loop2, rest_of_compilation): Move to passes.c. + (decode_d_option): Use enable_rtl_dump_file. + (compile_file, finalize, do_compile): Move profile+combine+graph + cleanup to finish_optimization_passes. + * toplev.h (init_optimization_passes, finish_optimization_passes, + enable_rtl_dump_file): Declare. + +2004-02-27 Eric Botcazou + Roger Sayle + + * fold-const.c (fold): Revert 2004-02-25 change. Use the original + operands to build a tree with swapped operands. + * expr.c (expand_expr_real) : Consistently use the + 'unsignedp' predicate to specify the signedness. + +2004-02-27 Kazu Hirata + + * c-decl.c, c-ppoutput.c, combine.c, cppfiles.c, dwarf2out.c, + expr.c, fold-const.c, gcc.c, haifa-sched.c, loop-iv.c, + params.def, read-rtl.c, rtl.c, rtlanal.c, toplev.c: Fix + comment typos and formatting. Follow spelling conventions. + +2004-02-26 Aldy Hernandez + + * config/rs6000/rs6000.md: Add fixuns_truncsfsi2 and + fix_truncsfsi2. + + * config/rs6000/spe.md: Delete spe_efsctuiz. + Add spe_fixuns_truncsfsi2. + Add spe_fix_truncsfsi2. + +2004-02-26 Eric Christopher + + * c-lex.c (c_lex_string_translate): New variable. + (lex_string): Use to determine string translation. + * c-pragma.h: Prototype. + * c-parse.in (start_string_translation): New. Set above. + (stop_string_translation): Ditto. + (attribute, attribute_list, asm_def, asm_stmt, + asm_operand): Use above functions. + * cp/parser.c (cp_parser_declaration): Translate strings + unless token is RID_EXTERN. Set c_lex_string_translate + for recursive use. + (cp_parser_asm_definition): Only translate argument strings + to asms. + (cp_parser_asm_operand_list): Ditto. + (cp_parser_attribute_list): Do not translate attribute strings. + +2004-02-26 Kazu Hirata + + * stmt.c (expand_start_case_dummy): Remove. + * tree.h: Remove the corresponding prototype. + +2004-02-26 Kazu Hirata + + * builtins.c (apply_args_register_offset): Remove. + * tree.h: Remove the corresponding prototype. + +2004-02-26 Kazu Hirata + + * stor-layout.c (is_pending_size): Remove. + * tree.h: Remove the corresponding prototype. + +2004-02-26 Kazu Hirata + + * recog.c (validate_replace_src): Remove. + * recog.h: Remove the corresponding prototype. + +2004-02-26 Kazu Hirata + + * calls.c: Don't reference FINAL_REG_PARM_STACK_SPACE or + MAYBE_REG_PARM_STACK_SPACE. + * function.c: Likewise. + * system.h (FINAL_REG_PARM_STACK_SPACE): Poison. + (MAYBE_REG_PARM_STACK_SPACE): Likewise. + * doc/tm.texi (FINAL_REG_PARM_STACK_SPACE): Remove. + (MAYBE_REG_PARM_STACK_SPACE): Likewise. + +2004-02-26 Kazu Hirata + + * c-decl.c (c_expand_deferred_function): Remove. + * c-tree.h: Remove the corresponding prototype. + +2004-02-26 Kazu Hirata + + * postreload.c (reload_cse_move2add): Generate just a PLUS + instead of an entire SET. + +2004-02-26 Jan Hubicka + + * config.gcc: Add support for nocoma/prescott/pentium-m/pentium3m + /pentium4m. + * i386.c (override_options): Add support for new CPUs. + * i386.h (TARGET_CPU_DEFAULT_NAMES): New names. + (TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_pentium4e): New + constants. + * invoke.texi: Extend documentation of -mtune/-march for new CPUs. + +2004-02-26 Bob Wilson + + * config/xtensa/xtensa.h (TARGET_CPU_CPP_BUILTINS): Define __xtensa__. + +2004-02-26 Eric Botcazou + + * config/sparc/sparc-protos.h (sparc_emit_floatunsdi): Add 'mode'. + (sparc_emit_fixunsdi): New prototype. + * config/sparc/sparc.c (sparc_emit_floatunsdi): Use 'mode' argument. + (sparc_emit_fixunsdi): New function. + * config/sparc/sparc.md (floatunsdisf2): Use 'general_operand' for + operand 1. Pass SFmode to sparc_emit_floatunsdi. + (floatunsdidf2): Use 'general_operand' for operand 1. Pass DFmode + to sparc_emit_floatunsdi. + (fixuns_truncsfdi2): New expander. + (fixuns_truncdfdi2): Likewise. + +2004-02-26 Alan Modra + + * gcse.c (delete_null_pointer_checks_1): Do not delete CC setter + unless HAVE_cc0. + +2004-02-25 Richard Henderson + + * explow.c (force_reg): Call mark_reg_pointer as appropriate. + * config/alpha/alpha.c (alpha_emit_conditional_branch): Don't + use (op0-op1) == 0 if op0 is a pointer. + * config/alpha/alpha.md (cmpdi): Use some_operand. + (three comparison combine splits): Remove. + +2004-02-25 Richard Henderson + + PR c/12794 + * c-common.c (handle_alias_attribute): Reject the attribute if + current_function_decl is set. + +2004-02-25 Kelley Cook + + * config.gcc: Add comment describing extra_gcc_objs. + i[34567]86-*-cygwin*): Replace host_extra_gcc_objs with extra_gcc_objs. + * configure.ac (extra_gcc_objs): New substitution variable. + (host_extra_gcc_objs): Don't substitute. + * configure: Regenerate. + * Makefile.in: Use extra_gcc_objs. + +2004-02-25 Kelley Cook + + * doc/contrib.texi: Add an entry for myself. + +2004-02-25 Jan Hubicka + + * basic-block.h (make_eh_edge, break_superblocks): Declare. + * cfgbuild.c (make_eh_edge): Make global. + * cfglayout.c (break_superblocks): Likewise; fix memory leak. + * except.c (build_post_landing_pads, connect_post_landing_pads, + dw2_build_landing_pads, sjlj_emit_function_enter, + sjlj_emit_function_exit, sjlj_emit_dispatch_table, + sjlj_build_landing_pads): Update CFG. + (emit_to_new_bb_before): New function. + (finish_eh_generation): Do not rebuild the CFG. + +2004-02-25 John David Anglin + + * config.gcc (hppa*-*-*, parisc*-*-*): Add MASK_BIG_SWITCH to all + target_cpu_default defines. + * pa-hpux.h (TARGET_DEFAULT): Add MASK_BIG_SWITCH to define. + * pa.h (TARGET_DEFAULT): Likewise. + +2004-02-25 Eric Botcazou + + * fold-const.c (fold): Treat MAX_EXPR and MIN_EXPR like + comparisons with regard to signedness. + +2004-02-25 Richard Earnshaw + + * arm.c (thumb_legitimize_address): New function. + * arm-protos.h: Prototype it. + * arm.h (THUMB_LEGITIMIZE_ADDRESS): Define. + (LEGITIMIZE_ADDRESS): Use it. + +2004-02-25 J"orn Rennecke + + * reload1.c (reload): Only spill eliminable register with multiple + adjacent elimination alternatives if all alternatives fail. + +2004-02-25 Richard Earnshaw + + * arm.c (arm_legitimate_index_p): For QImode the range of an offset + is -4095...+4095 inclusive. + +2004-02-25 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2* specific notes): Document + the bootstrap failure with Sun CC 5.4 and 5.5. + +2004-02-24 Kazu Hirata + + * cse.c (cse_change_cc_mode_insns): Stop at any instruction + which modifies NEWREG. + (cse_condition_code_reg): Update the mode of CC_REG in + CC_SRC_INSN on our own. + +2004-02-24 Michael Matz + + * config/i386/i386.c (ix86_comp_type_attributes): Check for + regparm attributes. + +2004-02-24 Richard Henderson + + * toplev.c (dump_file_tbl): Rename from dump_file. + * bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c, + cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c, + config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c, + config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c, + loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c, + ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c, + toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c: + s/rtl_dump_file/dump_file/g. + +2004-02-24 Aldy Hernandez + + * config/rs6000/spe.md (spe_fix_truncsfsi2): Delete. + (spe_fixuns_truncsfsi2): Delete. + + * config/rs6000/rs6000.md (fix_truncsfsi2): Delete. + (fixuns_truncsfsi2): Delete. + +2004-02-24 Josef Zlomek + + PR/14240 + * rtlanal.c (replace_label): Fix replacing labels in constant pool. + +2004-02-24 Geoffrey Keating + + * config/darwin.h (TARGET_HAS_F_SETLKW): Define. + +2004-02-24 Jason Merrill + + * tree.c (check_qualified_type): New fn. + (get_qualified_type): Use it. If type already has the desired + quals, just return it. + * tree.h: Declare it. + +2004-02-24 Sanjiv Kumar Gupta + + * target-def.h (TARGET_SCHED_INIT_GLOBAL, + TARGET_SCHED_FINISH_GLOBAL): New macros. + + * target.h (md_init_global, md_finish_global): Function + declarations corresponding to new target macros. + + * haifa-sched.c (sched_init, sched_finish): Allow target to + call the new schedular hooks. + + * flow.c (recompute_reg_usage): Add PROP_DEATH_NOTES flag in + call to update_life_info. + + * config/sh/sh.h (OVERRIDE_OPTIONS): Re-enable + flag_schedule_insns for SH4. + + * config/sh/sh.c (sh_md_init_global, sh_md_finish_global, + find_set_regmode_weight, find_insn_regmode_weight, + find_regmode_weight), sh_md_init, sh_dfa_new_cycle, + sh_variable_issue, high_pressure, ready_reorder, + rank_for_reorder, swap_reorder, sh_reorder, sh_reorder2): New + functions used to throttle the insn movement in first + scheduling pass for SH. + + * doc/tm.texi: Document TARGET_SCHED_INIT_GLOBAL and + TARGET_SCHED_FINISH_GLOBAL. + +2004-02-24 Alexandre Oliva + + Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux. + 2004-02-05 Alexandre Oliva + * config/frv/frv.c (frv_emit_movsi): Use GOT relocations for + symbols in sections named by the user. + 2004-01-30 Alexandre Oliva + * config/frv/linux.h (TARGET_OS_CPP_BUILTINS): New. + 2004-01-27 Alexandre Oliva + * config.gcc (frv-*-*linux*): Handle like *-*-linux*. + * config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove, obviated by + the above. + 2004-01-20 Alexandre Oliva + * config/frv/frv.md (symGOT2reg_hilo, symGOTOFF2reg_hilo): Add + one more pseudo to further improve code generation. + 2004-01-19 Alexandre Oliva + * config/frv/frv.md (movdi_ldd): Introduce explicit indirection + inside UNSPEC. + 2004-01-16 Alexandre Oliva + * config/frv/frv.c (frv_legitimate_address_p): Added + allow_double_reg_p argument. Adjust all callers. Use it to + decide whether to enable double-register indirect addressing. + (frv_funcdesc_alias_set): Remove. + (frv_expand_fdpic_call): Force non-SYMBOL_REF operand into + register. Emit movdi_ldd. + (ldd_address_operand): New. + * config/frv/frv-protos.h (frv_legitimate_address_p): Adjust. + * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Likewise. + (PREDICATE_CODES): Add ldd_address_operand. + * config/frv/frv.md (movdi_ldd): New. + (symGOT2reg_hilo, symGOTOFF2reg_hilo): Use separate pseudo for + intermediate computations if possible. + (symGOTOFF2reg_i): Fix harmless typo. + 2003-12-18 Alexandre Oliva + * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Cast + relocated p_vaddr to vaddr type. + * config/frv/frv-protos.h (frv_expand_fdpic_call): Return void. + * config/frv/frv.c (frv_get_funcdesc_alias_set): New. + (frv_expand_fdpic_call): Propagate incoming MEM's expr to funcdesc + MEM, or use a funcdesc alias set. Use regular move instead of + ldd. + (dbl_memory_one_insn_operand): Recognize function descriptors by + type or by alias set, and don't split them. + * config/frv/frv.md (call, call_value): Never use call_internal + for fdpic. + (call_internal, call_value_internal): Never match for FDPIC. + (call_fdpicdi, call_fdpicsi, call_value_fdpicdi, + call_value_fdpicsi): Require FDPIC. + (ldd): Removed. + 2003-12-17 Alexandre Oliva + * config/frv/frv.h (CRT_GET_RFIB_DATA): Define for __FRV_FDPIC__. + * unwind-dw2-fde-glibc.c: Don't include elf-fdpic.h any more. + (_Unwind_IteratePhdrCallback): Adjust type of load_base for FRV + FDPIC. Compute data base address. + * config/frv/linux.h (SUBTARGET_DRIVER_SELF_SPECS): Enable -mfdpic + before the other self-specs are processed. + * config/frv/t-linux (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS): + Build with -fPIC. + 2003-12-15 Alexandre Oliva + * unwind-dw2-fde-glibc.c: Don't include bits/elf-fdpic.h if + inhibit_libc is defined. + 2003-12-12 Alexandre Oliva + * unwind-dw2-fde-glibc.c: Include bits/elf-fdpic.h for + __FRV_FDPIC__. + (__RELOC_POINTER): Define. + (_Unwind_IteratePhdrCallback): Use it. + * config/frv/frv.h (Twrite): Define. + (TRANSFER_FROM_TRAMPOLINE): Use it. + * config/frv/linux.h (INVOKE__main): Undefine. + (Twrite): Override. + 2003-12-05 Richard Sandiford + * doc/invoke.texi (-mlong-calls, -mlinked-fp): Document FRV options. + (-mlibrary-pic): Emphasize that this option generates EABI code. + (-mcpu): Add fr550. + (-mpack): Remove. + 2003-11-30 Alexandre Oliva + * config/frv/frv.c (int_2word_operand): Reject LABELs, SYMBOL_REFs + and CONSTs in FDPIC mode. + * config.gcc (with_cpu): Default to fr400 on frv-*-*linux*. + 2003-11-29 Richard Sandiford + * config/frv/frv.c (move_source_operand): Don't accept symbolic + constants. + * config/frv/frv.md (*movhi_internal, *movsi_internal): Use an 'n' + rather than 'i' constraint for the 2-instruction alternative. + (*movsi_2word): New, incorporating existing int_2word_operand splitter. + 2003-11-29 Richard Sandiford + * config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Q): Renamed from + EXTRA_CONSTRAINT_FOR_Y. + (EXTRA_CONSTRAINT): Remove handling of 'Y'. + * config/frv/frv.md (*movsi_internal): Remove 'Q' constraint. + (addsi3): Change 'Y' constraint to 'Q'. + 2003-11-27 Richard Sandiford + * reload.c (CONST_POOL_OK_P): New macro. + (find_reloads): Use it to decide whether a constant can be forced + into memory. + * config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Return true if the + constant satisfies got12_operand. + (frv_cannot_force_const_mem): Always return true for TARGET_FDPIC. + (frv_legitimate_address_p): Check for valid unspec offsets using + got12_operand rather than frv_legitimate_fdpic_operand_p. + (frv_legitimate_fdpic_operand_p): Delete. + (frv_emit_movsi): Abort if we try to use the FDPIC register during + or after reload. + (frv_legitimate_constant_p): Return LEGITIMATE_PIC_OPERAND_P if + TARGET_FDPIC. + * config/frv/frv.md (*movdf_double): Add alternatives for CONST_DOUBLE. + 2003-11-19 Richard Sandiford + * config/frv/frv-protos.h (fdpic_operand, fdpic_got12_operand) + (frv_fdpic_fptr_operand): Don't declare here. + * config/frv/frv.h (EXTRA_CONSTRAINT_FOR_Y): Call got12_operand + rather than fdpic_got12_operand. + (PREDICATE_CODES): Remove symbolic_operand entry. Add entries for + got12_operand and const_unspec_operand. + * config/frv/frv.c (got12_operand): Renamed from fdpic_got12_operand. + (gpr_or_int12_operand, dbl_memory_one_insn_operand): Update calls. + (symbolic_operand): Remove. + (const_unspec_operand): New predicate. + * config/frv/frv.md (*movsi_got): Use got12_operand. + (*movsi_high_got, *movsi_lo_sum_got): Use const_unspec_operand. + 2003-11-18 Richard Sandiford + * config/frv/frv-protos.h (frv_output_addr_const_extra): Remove. + * config/frv/frv.h (OUTPUT_ADDR_CONST_EXTRA): Remove definition. + * config/frv/frv.c (frv_unspec): New structure. + (frv_small_data_reloc_p, frv_const_unspec_p): New functions. + (frv_print_operand_memory_reference): Use frv_const_unspec_p to + validate CONST indices. Use frv_output_const_unspec to print them. + (frv_print_operand): Update call to unspec_got_name. Use + frv_output_const_unspec to print constant unspecs. + (frv_legitimate_fdpic_operand_p): Return true if frv_const_unspec_p. + Reject UNSPECs otherwise. + (unspec_got_name): Take the relocation number as argument, not an + rtx containing it. + (frv_output_addr_const_extra): Remove, replacing with... + (frv_output_const_unspec): ...this new function. + (frv_find_base_term): Use frv_const_unspec_p & frv_small_data_reloc_p. + (gpr_or_int12_operand): Use fdpic_got12_operand. + (dbl_memory_one_insn_operand): Likewise. + (fdpic_got12_operand): Use frv_const_unspec_p. + (frv_emit_movsi): Use frv_const_unspec_p to check for CONSTs that + are already legitimate. Use frv_small_data_reloc_p when deciding + whether to use HIGH/LO_SUM for R_FRV_GOTOFF12 and R_FRV_GPREL12. + 2003-11-18 Alexandre Oliva + * config/frv/t-linux (SHLIB_MAPFILES): Override so as to export... + * config/frv/libgcc-frv.ver: ... frv-specific symbols. New file. + * config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local + label, for real this time. + * config/frv/frv.c (frv_local_funcdesc_p): Update to new + representation of visibility. + (fdpic_got12_operand, symbolic_operand): Mark unused arguments as + such. + 2003-11-17 Richard Sandiford + * config/frv/frv.h (MASK_LINKED_FP, TARGET_LINKED_FP): New macros. + (TARGET_SWITCHES): Add -mlinked-fp and -mno-linked-fp. + * config/frv/frv.c (frv_override_options): Set MASK_LINKED_FP unless + it was explicitly disabled. + (frv_stack_info): There is no need to save the link register in every + frame unless TARGET_LINKED_FP is true. + (frv_frame_pointer_required): If !TARGET_LINKED_FP, only require a + frame pointer if the stack pointer might change value. + (frv_return_addr_rtx): Check and process "count" argument. + 2003-11-14 Richard Sandiford + * config/frv/frv-protos.h (frv_legitimize_address): Remove. + (frv_find_base_term): Declare. + * config/frv/frv.h (LEGITIMIZE_ADDRESS): Do nothing. + (FIND_BASE_TERM): Define. + (PREDICATE_CODES): Remove pic_register_operand, pic_symbolic_operand, + small_data_register_operand, small_data_symbolic_operand. Add + symbolic_operand. + * config/frv/frv.c (const_small_data_p, plus_small_data_p): Delete. + (frv_print_operand_memory_reference, output_move_single): Remove + special handling for unlegitimized sdata addresses. + (frv_legitimate_address_p): Don't allow sums of SDA_BASE_REG + and symbolic addresses. + (frv_legitimize_address, frv_legitimize_fdpic_address): Delete. + (frv_find_base_term): New function. + (int_2word_operand): Check specifically for symbolic address constants. + (pic_register_operand, pic_symbolic_operand): Delete. + (small_data_register_operand, small_data_symbolic_operand): Delete. + (dbl_memory_one_insn_operand): Don't call plus_small_data_p. + Allow UNSPEC_GOT constants if !TARGET_FDPIC. + (move_source_operand): Only accept CONSTs if they're a two-insn + symbolic constant. + (fdpic_got12_operand): Don't require TARGET_FDPIC. + (frv_emit_movsi): Legitimize sdata and -mlibrary-pic addresses + using gen_symGOTOFF2reg*. + (frv_ifcvt_rewrite_mem): Remove (plus gr16 ...) special cases. + (frv_rtx_costs): Give all MEM addresses a cost of 0. Give MEMs + themselves a cost of 3 insns. + * config/mips/mips.md (*movsi_got): Allow for !TARGET_FDPIC too. + Change predicate to symbolic_operand. + (*movsi_high_got, *movsi_lo_sum_got): Likewise. + (*movsi_lda_sdata): Delete. + (*movsi_pic, movsi_high_pic, movsi_lo_sum_pic): Delete. + 2003-11-05 Alexandre Oliva + * config.gcc: Add t-slibgcc-elf-ver and support --with-cpu for + frv-*-*linux*. + * config/frv/frv-abi.h (CREATE_DOUBLE_SHIFT): Use branch to local + label. + * config/frv/frv.h (DRIVER_SELF_SPECS): Add blank before + -multilib-library-pic. + (LINK_SPEC): Add -z text for -mfdpic. + * config/frv/frvbegin.c (__ROFIXUP_LIST__): Don't define on FDPIC. + * config/frv/frvend.c (__ROFIXUP_END__): Likewise. + * config/frv/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): + Override. + (OPTION_DEFAULT_SPECS, HAS_INIT_SECTION, INIT_SECTION_ASM_OP, + FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): Define. + * config/frv/t-linux (EXTRA_MULTILIB_PARTS): Use + crtstuff-generated files. + 2003-10-31 Alexandre Oliva + * config.gcc: Add frv-*-*linux*. + * config/frv/linux.h, config/frv/t-linux: New. + 2003-10-06 Alexandre Oliva + * config/frv/frv.h (LINK_SPEC): Pass -melf32frvfd to the linker + when -mfdpic even if a linker script is explicitly listed. + 2003-10-02 Alexandre Oliva + * config/frv/frv.c (frv_override_options): Clear asm_out + unaligned_op for SImode on FDPIC. + (frv_emit_movsi): Use compute_reloc_for_constant to compute the + argument passed to decl_readonly_section. + (frv_assemble_integer): Revert 2003-09-30's change, but make the + whole block run with FDPIC even with -fno-PIC. + 2003-10-02 Alexandre Oliva + * config/frv/frv.c (frv_cannot_force_const_mem): Don't force + symbol or label plus offset to memory. + (frv_emit_movsi): Emit GPREL only if -mgprel-ro. Emit 32-bit + GOTOFF and GPREL for LABEL_REF. + * config/frv/frv.h (DRIVER_SELF_SPECS): Add -mgprel-ro with + -mfdpic unless -mno-gprel-ro, -fpic or -fpie. + (MASK_GPREL_RO, TARGET_GPREL_RO): New. + (TARGET_SWITCHES): Added gprel-ro and no-gprel-ro. + * doc/invoke.texi: Document them. + 2003-09-30 Alexandre Oliva + * config/frv/frv-protos.h (frv_gen_GPsym2reg): Declare. + (frv_splittable_got_operand): Removed. + * config/frv/frv.c (frv_cannot_force_const_mem): Reject HIGH and + LO_SUM. Add comments. + (frv_override_options): Moved enabling of FDPIC to + DRIVER_SELF_SPECS. Don't enable MASK_DWORD. + (frv_local_funcdesc_p): Remove unnecessary heck for flag_pie. + (frv_legitimize_fdpic_address): Don't duplicate logic in + frv_emit_movsi. + (frv_gen_GPsym2reg): New. + (unspec_got_name): Added gprel. + (frv_expand_fdpic_call): Add support for inlining PLTs. + (fdpic_fptr_operand): Renamed from frv_fdpic_fptr_operand. + (gpr_or_int12_operand): Added GPREL12. + (pic_symbolic_operand): Match even if !flag_pic for FDPIC. + (small_data_symbolic_operand): Fail if FDPIC. + (fdpic_splittable_got_operand): Removed. + (fdpic_got12_operand): Added GPREL12. + (frv_emit_movsi): Reorganize to avoid duplication. Emit GPREL + when appropriate. Fix sdata GOTOFF. + (frv_legitimate_constant_p): Require legitimate PIC operand for + FDPIC with pic, but only a legitimate fdpic operand for non-pic. + (frv_assemble_integer): Move FDPIC funcdesc handling out of + flag_pic case. + (frv_asm_out_constructor, frv_asm_out_destructor): Abort if + frv_assemble_integer fails. + * config/frv/frv.h (DRIVER_SELF_SPECS): New. + (SUBTARGET_DRIVER_SELF_SPECS): New. + (ASM_SPEC): Don't pass -mno-fdpic. + (LINK_SPEC): Pass -melf32frvfd for FDPIC. + (MASK_INLINE_PLT, TARGET_INLINE_PLT): New. + (TARGET_SWITCHES): Add -minline-plt, -mno-inline-plt and + -multilib-library-pic. + (PREDICATE_CODES): Added fdpic_operand, fdpic_fptr_operand, + condexec_si_media_operator, condexec_sf_add_operator and + condexec_sf_conv_operator. Removed condexec_sf_binary_operator + and condexec_sf_unary_operator. + * config/frv/frv.md (R_FRV_GPREL12, R_FRV_GPRELHI, R_FRV_GPRELLO): + New. + (movsi_got, movsi_high_got, movsi_lo_sum_got): Move before + movsi_internal. Give them internal names. movsi_got has type + int. + (fdpic got splitters): Remove. + (symGPREL2reg, symGPREL2reg_hilo): New. + * config/frv/t-frv (MULTILIB_MATCHES): Don't map -fpic and -fPIC + to -mlibrary-pic. Map -multilib-library-pic to it. + * doc/invoke.texi: -mfdpic, -minline-plt, -multilib-library-pic: + Document. + 2003-09-28 Alexandre Oliva + * config/frv/frv.c (frv_function_symbol_referenced_p): Declare. + (TARGET_CANNOT_FORCE_CONST_MEM): Define to... + (frv_cannot_force_const_mem): New function. + (const_small_data_p, plus_small_data_p): Update comments on sdata + on FDPIC. + (frv_override_options): Set flag_pie for FDPIC too. + (frv_conditional_register_usage): Mark gr16 and gr17 as non-fixed, + call-saved registers on FDPIC. + (frv_stack_info): Don't preserve the PIC register on FDPIC, and + don't force LR to be preserved. + (frv_expand_prologue): Likewise. + (frv_asm_output_mi_thunk): Use 12-bit funcdesc gotoff for -fpic. + (frv_frame_pointer_required): Don't force it just because the + FDPIC register is used. + (frv_legitimate_address_p) : Accept a legitimate FDPIC + operand only if !condexec_p. + (frv_legitimize_address): Return the FDPIC-legitimized address. + Don't match small data here on FDPIC. + (frv_legitimate_fdpic_operand_p): Don't accept unadorned function + symbols. Use TRUE/FALSE instead of 1/0. + (frv_local_funcdesc_p): New. + (frv_legitimize_fdpic_address): Rewrite to use GOTOFF and 12-bit + immediates when possible. + (pic_symbolic_operand): Accept SYMBOL_REFs and CONSTs in FDPIC. + (dbl_memory_one_insn_operand): Accept addresses that add a REG and + an UNSPEC_GOT. + (frv_emit_movsi): Handle FDPIC before small data. Use GOTOFF and + 12-bit immediates when possible. + (frv_legitimate_constant_p): In FDPIC, reject SImode operands that + are not legitimate pic operands. + (frv_in_small_data_p): Re-enable for FDPIC. + * config/frv/frv.h (SDA_BASE_REG): Remove comment about FDPIC. + (FRV_GLOBAL_P): Removed. + * config/frv/frv.md: Add modes to CONSTs. + (movsi_got): New. + (movsi_lo_sum_got): Use separate matches instead of match_dup. + (movsi_high_pic, movsi_lo_sum_pic): Match on non-FDPIC only. + (fdpic splittable operations): Match on flag_pic != 1. + 2003-09-22 Alexandre Oliva + * config/frv/frv.c (frv_asm_out_constructor, + frv_asm_out_destructor): Pass to frv_assemble_integer the size in + bytes, not bits. + 2003-09-19 Alexandre Oliva + * config/frv/frv.c (frv_assemble_integer): Reject complex + expressions referencing function SYMBOL_REFs. + * config/frv/frv.c (frv_function_symbol_referenced_p): New. + (move_source_operand): Reject CONSTs that reference function + SYMBOL_REFs on FDPIC. + (frv_emit_movsi): If we get such a CONST, break it up. + * config/frv/frv.h (CPP_SPEC): Define __FRV_FDPIC__ for -mfdpic. + (TRANSFER_FROM_TRAMPOLINE): Use different definitions for FDPIC. + * config/frv/frv.c (frv_print_operand) : Recognize PLUS without + MEM. + (frv_assemble_integer): Don't use funcdesc for LABEL_REFs. + (frv_trampoline_size): Increase for FDPIC. + * config/frv/frv.h (TRAMPOLINE_ALIGNMENT): Bump to 64 for FDPIC. + (TRANSFER_FROM_TRAMPOLINE): Handle FDPIC trampolines. + * config/frv/frv.c (frv_legitimize_fdpic_address, frv_emit_movsi): + Disable use of GOTOFF for now. + (const_small_data_p, plus_small_data_p, frv_in_small_data_p): + Disable use of small data in FDPIC for now. + (frv_asm_output_mi_thunk): Implement for FDPIC. + * config/frv/frv.h (SDA_BASE_REG): Set to -1 with FDPIC. + * config/frv/frv.c (frv_asm_out_constructor): Use + frv_assemble_integer for FDPIC pointers. + (frv_asm_out_destructor): Likewise. + * config/frv/frv.md (ldd): Fix order of operands. Use + address_operand for input. + 2003-09-18 DJ Delorie + * config/frv/frv.c (frv_legitimate_fdpic_operand_p): Remove UNSPEC_PIC. + (unspec_got_name): Correct typo. + (frv_emit_movsi): Pre-expand splittable GOTs. + (frv_expand_fdpic_call): Rename gen_lddi to gen_ldd. + * config/frv/frv.md (lddi): Fix syntax error, rename to ldd. + (symGOT2reg_hilo, symGOTOFF2reg_hilo): New. + * config/frv/t-frv: Add -mfdpic multilibs. + * config/frv/frv.h (ASM_SPEC): Pass -mfdpic/-mno-fdpic. + (TARGET_SWITCHES): Add -mno-fdpic, fix documentation. + * config/frv/frv.c (frv_override_options): -mfdpic assumes + flag_pic, default to 32-bit pics, require DWORD ops. + (frv_override_options): Add W and Z constraints. + (frv_expand_prologue): No pic prologue for -mfdpic. + (frv_asm_output_mi_thunk): Support -mfdpic (soon). + (frv_print_operand_memory_reference): Handle GOT constants. + (frv_legitimate_address_p): Allow GOT constants. + (frv_legitimize_address): Handle GOT addresses too. + (frv_legitimate_fdpic_operand_p): New. + (frv_legitimize_fdpic_address): New. + (unspec_got_name): New. + (frv_output_addr_const_extra): New. + (frv_expand_fdpic_call): New. + (frv_fdpic_fptr_operand): New. + (gpr_or_int12_operand): Handle GOT operands. + (int_2word_operand): Handle GOT operands. + (fdpic_operand): New. + (fdpic_splittable_got_operand): New. + (fdpic_got12_operand): New. + (frv_emit_movsi): Handle GOT operands. + (frv_assemble_integer): -mfdpic doesn't use rofixups. + (frv_print_operand): Support 'g' code for GOT operands. + * config/frv/frv-protos.h: Add prototypes as needed. + * config/frv/frv.md (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO, + R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI, + R_FRV_FUNCDESC_GOTLO, R_FRV_FUNCDESC_VALUE, + R_FRV_FUNCDESC_GOTOFF12, R_FRV_FUNCDESC_GOTOFFHI, + R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, R_FRV_GOTOFFHI, + R_FRV_GOTOFFLO): New. + (movsi_high_got, movsi_lo_sum_got): New. + (*movsi_pic): Don't use this splitter for -mfdpic. + (addsi3): Allow GOT references also. + (call, call_value): Handle -mfdpic separately. + (call_fdpicdi, call_fdpicsi, lddi, call_value_fdpicdi, + call_value_fdpicsi): New. + (symGOT2reg, symGOT2reg_i, got splitters, symGOTOFF2reg, + symGOTOFF2reg_i): New. + * config/frv/frv.h (MASK_FDPIC): New. + (TARGET_FDPIC): New. + (TARGET_SWITCHES): Add -mfdpic. + (FDPIC_FPTR_REGNO): New. + (FDPIC_REGNO): New. + (OUR_FDPIC_REG): New. + (enum reg_class): Add FDPIC_REGS, FDPIC_FPTR_REGS, and + FDPIC_CALL_REGS. + (REG_CLASS_NAMES): Likewise. + (REG_CLASS_CONTENTS): Likewise. + (EXTRA_CONSTRAINT_FOR_Y): New, for 12-bit GOTs. + (EXTRA_CONSTRAINT): Add it here. + (FRV_GLOBAL_P): New. + (OUTPUT_ADDR_CONST_EXTRA): New. + +2004-02-24 Kazu Hirata + + * config/sparc/sparc.h: Remove commented-out definitions of + TARGET_EDOM and GEN_ERRNO_RTX. + +2004-02-24 Kazu Hirata + + * df.c, df.h, ra-build.c, ra-rewrite.c, ra.c, web.c: Replace + df_analyse with df_analyze. + +2004-02-24 Alan Modra + + * gcse.c (delete_null_pointer_checks_1): Set stop_insn to end, not + beginning of block. + +2004-02-23 James E Wilson + + * calls.c (precompute_arguments): Update comment. + +2004-02-23 Kazu Hirata + + * et-forest.c: Replace et_occurences with et_occurrences. + +2004-02-23 Kazu Hirata + + * cfgloop.h, loop-iv.c, loop-unswitch.c: Replace iv_analyse + with iv_analyze. + +2004-02-23 Kelley Cook + + * config/i386/i386.c: Rename pni to sse3. + * config/i386/i386.h: Likewise. + * config/i386/i386.md: Likewise. + * config/i386/pmmintrin.h: Likewise. + * doc/extend.texi: Likewise. + * doc/invoke.texi: Likewise. + +2004-02-23 Zack Weinberg + Kazu Hirata + + Remove -fwritable-strings. + * c-common.c (fix_string_type): Don't check + flag_writable_strings. + (fix_string_type): Likewise. + * c-opts.c (set_std_c89): Don't initialize + flag_writable_strings. + (set_std_c99): Likewise. + * common.opt (fwritable-strings): Remove. + * flags.h: Remove the external declaration of + flag_writable_strings. + * opts.c (common_handle_option) : + Remove. + * toplev.c (flag_writable_strings): Remove. + (f_options): Remove an entry for writable-strings. + * varasm.c (const_hash_1) : Don't check + flag_writable_strings. + (compare_constant) : Likewise. + (build_constant_desc): Likewise. + * config/darwin.c (machopic_select_section): Likewise. + * config/arm/arm.c (AOF_ASSEMBLER): Likewise. + * config/arm/pe.c (arm_pe_encode_section_info): Likewise. + * config/iq2000/iq2000.c (iq2000_select_section): Likewise. + * config/mips/mips.c (mips_select_section): Likewise. + (mips_encode_section_info): Likewise. + * config/pa/pa.c (pa_select_section): Likewise. + * config/pa/pa.h (TEXT_SPACE_P): Likewise. + * config/v850/v850.c (v850_select_section): Likewise. + * doc/invoke.texi (-fwritable-strings): Remove. + (-fno-const-strings): Don't mention -fwritable-strings. + * doc/trouble.texi: Don't mention -fwritable-strings. + +2004-02-23 Nathanael Nerode + + * doc/install.texi: Update for switch of boehm-gc to autoconf 2.57. + +2004-02-23 Dale Johannesen + + * config/rs6000.md (movsf_hardfloat): Add POWER form of nop. + (movdf_hardfloat64): Ditto. + (movdf_softfloat64): Ditto. + +2004-02-23 Fariborz Jahanian + * config/rs6000/rs6000.c (function_arg): call to + rs6000_mixed_function_arg for DFmode moved to allow + normal DFmode incoming register assignment. + +2004-02-23 Dale Johannesen + + * config/rs6000.md (movsf_hardfloat): Accept CTR-to-CTR copy. + (movdf_hardfloat64): Ditto. + +2004-02-23 Kazu Hirata + + * convert.c, gcov-io.c, libgcov.c, sched-int.h, sibcall.c, + config/rs6000/linux.h, config/rs6000/rs6000-c.c: Update + copyright. + +2004-02-23 Andrew Pinski + + PR c/14156 + * c-typeck.c (c_expand_return): Change check for VAR_DECL + to use DECL_P instead. + + * config/rs6000/linux.h (OS_MISSING_POWERPC64): Define. + * config/rs6000/linux64.h (OS_MISSING_POWERPC64): Define. + +2004-02-23 Kazu Hirata + + * Makefile.in (opts.o): Depend on target.h. + * opts.c (decode_options): Use targetm.default_short_enums + instead of DEFAULT_SHORT_ENUMS. + * system.h (DEFAULT_SHORT_ENUMS): Poison. + * target-def.h (TARGET_DEFAULT_SHORT_ENUMS): New. + (TARGET_INITIALIZER): Add TARGET_DEFAULT_SHORT_ENUMS. + * target.h (gcc_target): Add default_short_enums. + * config/cris/cris.h: Remove a comment about + DEFAULT_SHORT_ENUMS. + * config/ip2k/ip2k.h: Likewise. + * doc/tm.texi (DEFAULT_SHORT_ENUMS): Change to + TARGET_DEFAULT_SHORT_ENUMS. Update the description. + +2004-02-23 Eric Botcazou + Falk Hueffner + + PR c/14188 + * builtins.c (expand_builtin_va_arg): Emit an informative message + if a trap is generated. + * c-typeck.c (build_function_call): Likewise. + +2004-02-22 Jakub Jelinek + + * gcov-io.c (gcov_open) [GCOV_LOCKED]: Use open + fdopen instead of + fopen. + * libgcov.c: Include sys/stat.h. + * config/rs6000/linux.h (TARGET_HAS_F_SETLKW): Define. + * config/rs6000/linux64.h (TARGET_HAS_F_SETLKW): Define. + * config/sparc/linux.h (TARGET_HAS_F_SETLKW): Define. + * config/sparc/linux64.h (TARGET_HAS_F_SETLKW): Define. + +2004-02-22 Kazu Hirata + + * reorg.c: Remove comments about dead ports. + +2004-02-22 Christopher Faylor + + * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): *Really* specify + extra host object file when targetting cygwin rather than generic + object files. + +2004-02-22 Josef Zlomek + + Merge from tree-ssa: + 2003-11-20 Richard Henderson + + * tree-inline.c (insert_decl_map): New. + (remap_decl, remap_type, remap_block, copy_body_r, + initialize_inlined_parameters, declare_return_variable, + remap_save_expr): Use it. + + * function.c (copy_body_r): Add mapping from id->ret_label to + id->ret_label. Revert test for ret_label. + +2004-02-22 Jakub Jelinek + + * genoutput.c (process_template): Strip trailing whitespace in @ + templates and issue a warning if there was any. + +2004-02-21 Christopher Faylor + + * config.gcc (i[34567]86-*-pe|i[34567]86-*-cygwin*): Specify extra host + object file when targetting cygwin. + * config/i386/t-cygwin (EXTRA_GCC_OBJS): Remove definition since it is + overridden by top-level Makefile. + +2004-02-21 Roger Sayle + + * config/i386/i386.c (standard_80387_constant_p): Also prefer + the x87's load constant instructions when optimizing for size. + +2004-02-21 Kazu Hirata + + * combine.c (SHIFT_COUNT_TRUNCATED): Remove. + * defaults.h (SHIFT_COUNT_TRUNCATED): Provide the default. + * expmed.c: Assume SHIFT_COUNT_TRUNCATED is always defined. + * fold-const.c: Likewise. + * simplify-rtx.c: Likewise. + +2004-02-21 Alan Modra + + * combine.c (can_combine_p): Don't ignore SETs marked with + REG_EH_REGION notes. + (try_combine): When attemting to fix unrecognized insns, don't + split a PARALLEL that contains the original i2. + +2004-02-21 Ziemowit Laski + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Refer to + SUBTARGET_OPTION_TRANSLATE_TABLE for architecture-specific options. + * config/i386/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): Define it. + * config/rs6000/altivec.h: #error out if '-maltivec' not specified. + (vector, pixel, bool): #define to __vector, __pixel and __bool. + (__un_args_eq, __bin_args_eq, __tern_args_eq): Move to C-specific + portion of header. + (__altivec_link_error_invalid_argument): Remove prototype; will use + __builtin_altivec_compiletime_error("vec_*") instead. + (vec_*): Fix/complete set of available operation overloads given the + existence of distinct 'vector bool ...' and 'vector pixel' types; tighten + cv-correctness of pointer arguments; in C, always check for correct + argument types before macro expansion. + * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): New macro + defining Darwin/PowerPC-specific '-f[no-]altivec' and + '-W[no-]altivec-long-deprecated' switches. + * config/rs6000/rs6000-c (rs6000_cpu_cpp_builtins): Pre-define + '__vector', '__pixel' and '__bool' macros using + '__attribute__((altivec(...)))' types. + * config/rs6000/rs6000.c (bool_char_type_node, bool_short_type_node, + bool_int_type_node, pixel_type_node, bool_V16QI_type_node, + bool_V8HI_type_node, bool_V4SI_type_node, pixel_V8HI_type_node): + New type nodes. + (rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch): New, for + handling '-W[no-]altivec-long-deprecated'. + (rs6000_override_options): Handle '-W[no-]altivec-long-deprecated'. + (rs6000_expand_binop_builtin, rs6000_expand_ternop_builtin, + altivec_expand_dst_builtin): Remove casts from integer literals. + (altivec_expand_builtin): Likewise; handle expansion of new + '__builtin_altivec_compiletime_error' function. + (rs6000_init_builtins): Initialize 'vector bool ...' and 'vector pixel' + types, and make them distinct from other vector types; register + '__builtin_altivec_compiletime_error' function. + (print_operand): For 'P', print a full target register name instead of + merely its number. + (rs6000_attribute_table): Add "altivec" attribute. + (rs6000_handle_altivec_attribute): New function. + * config/rs6000/rs6000.h (TARGET_OPTIONS): Describe + '-m[no-]-warn-altivec-long' (which '-W[no-]altivec-long-deprecated' + maps to). + (rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch): Forward + declare. + (ALTIVEC_BUILTIN_COMPILETIME_ERROR): New built-in enumeration. + +2004-02-20 James E Wilson + + * config/ia64/ia64.md (shift_mix4left+1): Delete reload_completed + check. + (shift_mix4left+2): Delete redundant pattern. + +2004-02-20 Kazu Hirata + + * alias.c (OUTGOING_REGNO): Don't define the default. + * builtins.c (OUTGOING_REGNO): Likewise. + (INCOMING_REGNO): Likewise. + (apply_args_register_offset): Always use OUTGOING_REGNO. + * combine.c (OUTGOING_REGNO): Likewise. + * sibcall.c (OUTGOING_REGNO): Likewise. + * defaults.h (INCOMING_REGNO): Provide the default. + (OUTGOING_REGNO): Likewise. + +2004-02-21 Jan Hubicka + + * params.def (max-peeled-insns, max-completely-peeled-insns, + max-once-peeled-insns): Set to 400. + +2004-02-20 John David Anglin + + PR c++/12007 + * dbxout.c (dbxout_parms): Check that DECL_RTL and DECL_INCOMING_RTL + are set for parameters before outputing debugging information. + +2004-02-20 Falk Hueffner + + PR target/14201 + * config/alpha/alpha.md (*fix_truncsfsi_ieee): Fix typoed operand + numbers. + +2004-02-20 Per Bothner + + * input.h: Don't #include line-map.h. It may cause link problems + with undefined linemap_line_start when line-map.h is included but + line-map.o is not linked, as currently happens with gengtype on + compilers that don't support inline. + * toplev.c: So we do have to explicitly #include line-map.h here. + +2004-02-20 Richard Henderson + + * doc/invoke.texi: Add -Wvariadic-macros. + +2004-02-20 Kazu Hirata + + * haifa-sched.c (sched_emit_insn): Remove. + * sched-int.h: Remove the corresponding prototype. + +2004-02-20 Kazu Hirata + + Revert: + 2004-02-19 Kazu Hirata + * opts.c (decode_options): Don't use DEFAULT_SHORT_ENUMS. + * system.h (DEFAULT_SHORT_ENUMS): Poison. + * config/cris/cris.h: Remove a comment about + DEFAULT_SHORT_ENUMS. + * config/ip2k/ip2k.h: Likewise. + * doc/tm.texi (DEFAULT_SHORT_ENUMS): Remove. + +2004-02-20 Mohan Embar + Tom Tromey + + * doc/install.texi: Moved --disable-libgcj and + --with-system-zlib documentation to new section for + Java-specific options. + Added explicit Cross-Compiler-Specific Options subheading. + Added section for Java-specific options. + +2004-02-20 Matt Kraai + + * doc/install.texi (Building the Ada compiler): Remove + example. + +2004-02-20 James E Wilson + + * toplev.c (dump_file_index, dump_file): Put ce3 before rnreg. + +2004-02-20 Kazu Hirata + + * gcc.c (process_command): Allow translation of the copyright + symbol but not the rest of the copyright message. + * gcov.c (print_version): Likewise. Allow translation of the + message about warranty. + +2004-02-20 Hans-Peter Nilsson + + * config/cris/cris.md ("*andsi_movu"): Correct parentheses in + predicate. + ("*andsi_clear"): Tweak constraints to not match postincrement. + Adjust the predicate to exclude a volatile memory reference. + ("*andhi_clear"): Ditto. Rename from "*andhi_clear_signed". + ("*andhi_clear_unsigned"): Remove, non-matching pattern. + +2004-02-19 Matt Kraai + + * move-if-change: Remove. + * Makefile.in (s-mlib, c-parse.y, s-check, s-gencheck) + (s-specs, s-options, s-config, s-conditions, s-flags, s-codes) + (s-constants, s-emit, s-recog, s-opinit, s-extract, s-peep) + (s-attr, s-attrtab, s-output, s-genrtl, s-modes, s-preds) + (s-gtyp-gen, s-iov): Use the top level move-if-change. + * objc/Make-lang.in (objc/objc-parse.y): Likewise. + +2004-02-19 James E Wilson + + * config/i386/i386.md (doloop_end_internal): Use nonimmediate_operand + for operand2. Add condition that requires register_operand operand2 + before reload. + +2004-02-19 Richard Sandiford + Maciej W. Rozycki + + * config/mips/mips.c (mips_address_insns): Treat BLKmode specially. + * config/mips/mips.md: Expand comment above unaligned loads and stores. + +2004-02-19 Richard Henderson + + * Makefile.in (STRICT2_WARN): Add -Wno-variadic-macros. + * tree.c (build0, build1, build2, build3, build4): Split out from... + (build): ... here. Call them. + * tree.h (build, _buildN1, _buildN2, _buildC1, _buildC2): New. + + * convert.c (convert_to_integer): Remove extra build argument. + * tree-inline.c (expand_call_inline): Likewise. + +2004-02-19 Richard Henderson + + * c-opts.c (warn_variadic_macros): New. + (c_common_handle_option): Set it. + (sanitize_cpp_opts): Copy it to cpp_opts. + * c.opt (Wvariadic-macros): New. + * cpplib.h (struct cpp_options): Add warn_variadic_macros. + * cppinit.c (cpp_create_reader): Initialize it. + * cppmacro.c (parse_params): Check it. + +2004-02-19 David Daney + + PR preprocessor/14198 + * config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Add + builtin_assert ("machine=mips") + +2004-02-19 Kazu Hirata + + * opts.c (decode_options): Don't use DEFAULT_SHORT_ENUMS. + * system.h (DEFAULT_SHORT_ENUMS): Poison. + * config/cris/cris.h: Remove a comment about + DEFAULT_SHORT_ENUMS. + * config/ip2k/ip2k.h: Likewise. + * doc/tm.texi (DEFAULT_SHORT_ENUMS): Remove. + +2004-02-19 Zack Weinberg + + * config/ia64/ia64.c (ia64_function_arg): In big-endian mode, + when passing single SFmode quantities in general registers, + put them in the high half. + +2004-02-19 Aldy Hernandez + + * doc/md.texi (Standard Names): Document additional dependency on + fix pattern. + + * optabs.c (ftruncify): Remove. + (expand_fix): Manually inline ftruncify above. + (can_fix_p): Add FIXME note. + +2004-02-19 Aldy Hernandez + + * config/rs6000/spe.md (spe_fixunssfsi2): Rename to + spe_fixuns_truncsfsi2. + + * config/rs6000/rs6000.md (fixunssfsi2): Rename to + fixuns_truncsfsi2. + +2004-02-19 Steve Ellcey + + * config/ia64/ia64.h (HARD_REGNO_CALLER_SAVE_MODE): New macro. + * testsuite/gcc.dg/20040219-1.c: New test. + +2004-02-19 Ulrich Weigand + + * config/s390/s390.md ("*subdf3_cc", "*subdf3_cconly", "*subsf3_cc", + "*subsf3_cconly"): Subtraction is not commutative. + +2004-02-19 Zack Weinberg + + * sdbout.c (preinit_symbols, sdbout_initialized): New statics. + (sdbout_symbol): If called before sdbout_init, queue DECL for + later and return. + (sdbout_init): Set sdbout_initialized true, process decls + queued earlier by sdbout_symbol. + (sdbout_finish): Use size_t for index variable. + +2004-02-19 Jeff Law + + * fold-const.c (invert_truthvalue): Do not call invert_tree_comparison + for unordered comparison codes. + +2004-02-19 Ian Lance Taylor + + * reload1.c (reload): Correct comment. + (scan_paradoxical_subregs): Remove #if 0 and old comment. + * doc/extend.texi (Local Reg Vars): Remove obsolete comment that + register variables are not used by reload. + +2004-02-19 Hans-Peter Nilsson + + PR target/14209 + * config/cris/cris.md ("*andsi_movu", "*andhi_movu"): Tweak + constraints to not match postincrement. Adjust the predicate to + exclude a volatile memory reference. + +2004-02-19 Kazu Hirata + + * config/mcore/mcore.h (ASM_OUTPUT_EXTERNAL): Remove. + +2004-02-19 Kazu Hirata + + * hooks.c (hook_void_tree_int): Remove. + (hook_void_constcharptr): Likewise. + (hook_int_void_0): Likewise. + * hooks.h: Remove the prototypes for the above three + functions. + * targhooks.c (hook_bool_machine_mode_true): Remove. + * targhooks.h: Remove the prototype for + hook_bool_machine_mode_true. + +2004-02-19 Kazu Hirata + + * emit-rtl.c (subreg_realpart_p): Remove. + (reorder_insns_with_line_notes): Likewise. + (end_full_sequence): Likewise. + * rtl.h: Remove the prototype for the above functions. + +2004-02-19 Kazu Hirata + + * config/arc/arc.h, config/arm/arm.h, config/frv/frv.h, + config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, + config/iq2000/iq2000.h, config/m32r/m32r.h, + config/pdp11/pdp11.h, config/sparc/sparc.h, + config/xtensa/xtensa.h: Remove commented-out or useless + definitions of CASE_VECTOR_PC_RELATIVE. + +2004-02-19 Kazu Hirata + + * loop.c (all_sets_invariant_p): Remove. + +2004-02-19 Eric Botcazou + + PR target/12916 + * config/sparc/sparc.h (NPARM_REGS): Delete. + (BASE_RETURN_VALUE_REG): Likewise. + (BASE_OUTGOING_VALUE_REG): Likewise. + (BASE_PASSING_ARG_REG): Likewise. + (BASE_INCOMING_ARG_REG): Likewise. + * config/sparc/sparc.c (sparc_strict_argument_naming): Test + TARGET_ARCH64, not TARGET_V9. + (function_arg_slotno): Dispatch based on the mode class. + Handle vector modes like floating-point modes. + (function_arg_record_value_1): Handle vector types like + floating-point types. + (function_arg_record_value_2): Likewise. + Calculate regno after mode transformation. + (function_arg): Handle vector modes like floating-point modes. + (function_arg_partial_nregs): Replace NPARM_REGS by SPARC_INT_ARG_MAX. + If ARCH64, do not recheck alignment. + (function_arg_pass_by_reference): Reorder the conditions. + (sparc_return_in_memory): Move after function_arg_padding. + Implement calling conventions for vector modes. + (sparc_struct_value_rtx): Move after sparc_return_in_memory. + (function_value): Move scope of 'regbase'. + Implement calling conventions for vector modes. + (sparc_builtin_saveregs): Replace NPARM_REGS by SPARC_INT_ARG_MAX + and BASE_INCOMING_ARG_REG by SPARC_INCOMING_INT_ARG_FIRST. + (sparc_va_arg): Use function_arg_pass_by_reference to test whether + the argument is passed by reference. + (sparc_type_code): Handle vector types. + +2004-02-19 Alan Modra + + * function.c (assign_parms): When building decl_rtl for + SPLIT_COMPLEX_ARGS, ensure inner modes of concat match outer. + +2004-02-19 Olivier Hainque + + * expr.c (is_aligning_offset): Check if we are aligning the + expressions's address over BIGGEST_ALIGNMENT in bytes, not + in bits. + +2004-02-18 Matt Austern + + * gcc.c (LIBGCC_SPEC): If REAL_LIBGCC_SPEC is defined, and + LIBGCC_SPEC isn't, set LIBGCC_SPEC to REAL_LIBGCC_SPEC. + (init_gcc_spec): Don't define or call if REAL_LIBGCC_SPEC is + defined. Instead use REAL_LIBGCC_SPEC, unmodifed, as the libgcc + spec string. + * doc/tm.texi (REAL_LIBGCC_SPEC): Document. + +2004-02-18 Zack Weinberg + + * dwarf2out.c (loclabel_num): Move outside #ifdef + DWARF2_DEBUGGING_INFO and mark with GTY(()). + * config/ia64/ia64.c (struct extern_func_list,extern_func_head): + Mark with GTY(()). + (ia64_hpux_add_extern_decl): Save the decl, not the name string. + Allocate memory with ggc_alloc. No need to copy anything. + (ia64_hpux_file_end): Update to match. + +2004-02-18 Jakub Jelinek + + * config/i386/i386.c (override_options): Don't imply 3DNow! for -m64 + by default. + +2004-02-18 Ulrich Weigand + + * config/s390/s390.md ("divmodtidi3"): Use canonical RTL. + ("divmodtisi3"): Likewise. + ("udivmoddi4", "udivmodtidi3"): Likewise. + ("divmodsi4", "divmoddisi3"): Likewise. + ("udivmodsi4", "udivmoddisi3"): Likewise. + ("udivsi3", "umodsi3"): Likewise. + +2004-02-18 Ulrich Weigand + + * config/s390/s390.c (s390_mainpool_start): Delete the main pool + placeholder insn when chunkifying the pool. + +2004-02-18 John David Anglin + + * pa.h (PIC_OFFSET_TABLE_REGNUM): Define to INVALID_REGNUM when not + generating PIC code. + +2004-02-18 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + h8300_expand_branch. + * config/h8300/h8300.c (h8300_expand_branch): New. + * config/h8300/h8300.md (ble, bleu, bge, bgeu, blt, bltu, bgt, + bgtu, beq, bne): Call h8300_expand_branch(). + +2004-02-18 Kazu Hirata + + * config/h8300/h8300-protos.h: Add prototypes for + h8300_hard_regno_nregs and h8300_hard_regno_mode_ok. + * config/h8300/h8300.c (h8300_hard_regno_nregs): New. + (h8300_hard_regno_mode_ok): Likewise. + * config/h8300/h8300.h (HARD_REGNO_NREGS): Call + h8300_hard_regno_nregs(). + (HARD_REGNO_MODE_OK): Call h8300_hard_regno_mode_ok(). + +2004-02-18 Per Bothner + + * cpphash.h (struct cpp_buffer): Restore return_at_eof field. This + partly reverts my 2003-10-01 change, because we're back to logically + including inside the main line. + * cpplex.c (_cpp_get_fresh_line): Check return_at_eof field. + * cppmacro.c (cpp_scan_nooutput): Set return_at_eof of current buffer. + Fixes PR preprocessor/14103. + + * cppfiles.c (_cpp_stack_include): When appropriate decrement + line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION. + (cpp_push_include): Don't need to increment pfile's line field. + * line-map.h (LAST_SOURCE_LINE_LOCATION): Only decrement by 1. + + * c-ppoutput.c (print struct): New first_time field. + (init_pp_output): Set print.first_time. + (pp_file_change): Use print.first_time, rather than MAIN_FILE_P, + which is set also for (say) . Clear print.first_time. + + * cppfiles.c (struct _cpp_file): Comment and type for pch field + does not match the code, so fix both. + (should_stack_file): Inline include_pch_p function. + (include_pch_p): Remove pointless function. + + * cpphash.h (struct cpp_buffer): Remove unused search_cached field. + +2004-02-18 Kazu Hirata + + * config/h8300/h8300.md (four define_peephole2's): Use + h8300_regs_ok_for_stm(). + +2004-02-18 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + expand_a_rotate(). + * config/h8300/h8300.c (expand_a_rotate): Remove the first + argument. + * config/h8300/h8300.md: Update all callers. + +2004-02-18 Jan Hubicka + + * simplify-rtx.c (simplify_unary_operation): Deal with logicals on + floats. + (simplify_binary_operation): Deal with logicals on floats. + + * i386.md (SSE fabs splitters): Emit new patterns. + (SSE cmov splitters): Likewise. + (sse_andv4sf3, sse_nandv4sf3, sse_iorv4sf3, sse_xorv4sf3 + (sse_andv2df3, sse_nandv2df3, sse_iorv2df3, sse_xorv2df3): Do not use + subregs. + (sse_andsf3, sse_nandsf3, sse_xorsf3): Kill. + (sse_anddf3, sse_nanddf3, sse_xordf3): Kill. + +2004-02-18 Kazu Hirata + + * config/h8300/h8300.c (expand_a_rotate): Don't generate insns + by hand. + (output_a_rotate): Tweak a comment. + * config/h8300/h8300.md (*rotlqi3_1): Change to rotlqi3_1. + (*rotlhi3_1): Change to rotlhi3_1. + (*rotlsi3_1): Change to rotlsi3_1. + +2004-02-18 Richard Earnshaw + + PR target/13866 + * arm.c (load_multiple_operation): Don't insist that the source reg + of a post-increment component is the same as the destination. + (store_multiple_operation): Likewise. + +2004-02-18 Kazu Hirata + + * config/h8300/h8300.md: Move movsf patterns into one section + of the file. + +2004-02-18 Kazu Hirata + + * cfgloop.h, cfgloopanal.c, cpplex.c, except.h, loop-init.c, + loop-unroll.c, scan-decls.c, scan.h, stor-layout.c, + xcoffout.c, xcoffout.h, config/arm/mmintrin.h, + config/mips/linux64.h, config/pa/pa-64.h, + config/rs6000/aix51.h, config/rs6000/aix52.h, + config/rs6000/spe.md, config/sparc/linux.h, + config/sparc/linux64.h: Update copyright. + +2004-02-18 Kazu Hirata + + * config/h8300/h8300.md: Move push patterns into one + section of the file. + +2004-02-18 Mark Mitchell + + PR c++/11326 + * config/ia64/ia64.c (ia64_struct_value_rtx): Cope with NULL + fntype. + +2004-02-18 Paul Brook + + * rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX + +2004-02-18 Paul Brook + + PR debug/12934 + * dwarf2out.c (loc_descriptor_from_tree): Handle + EXPR_WITH_FILE_LOCATION. + +2004-02-18 Jakub Jelinek + + * config/i386/i386.md (zero_extendqidi2, zero_extendqidi2, + testdi_1_rex64, anddi_2, xordi_1_rex64, xordi_2_rex64): Remove + trailing whitespace from instructions. + +2004-02-17 Geoffrey Keating + + * configure.ac: When generating auto-build.h, pass + --enable-languages to the sub-configure. + Put quotes around ${program_transform_name} when generating + name of as, ld, nm, objdump. + * configure: Regenerate. + +2004-02-17 Matt Kraai + + * Makefile.in (s-check, s-config, s-conditions, s-flags) + (s-codes, s-constants, s-emit, s-recog, s-opinit, s-extract) + (s-peep, s-attr, s-attrtab, s-output, s-genrtl, s-modes) + (s-preds, s-iov): Do not depend on move-if-change. + +2004-02-17 James E Wilson + + * caller-save.c (insert_restore): Pass mem through copy_rtx. + (insert_save): Likewise. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c (h8300_emit_stack_adjustment): Fix a + warning. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.md (*one_complsi2_h8300): Change to + *one_cmplsi2_h8300. + (*one_complsi2_h8300hs): Change to *one_cmplsi2_h8300hs. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype of + fix_bit_operand(). + * config/h8300/h8300.c (fix_bit_operand): Remove the second + argument "what". + * config/h8300/h8300.md: Update all callers. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c (fix_bit_operand): Change the name of + the last argument to "code" from "type". + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c: Remove an extern declaration of + rtx_equal_function_value_matters. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c (fix_bit_operand): Don't generate insns + by hand. + * config/h8300/h8300.md (*andqi3_1): Change to andqi3_1. + (*iorqi3_1): Change to iorqi3_1. + (*xorqi3_1): Change to xorqi3_1. + +2004-02-17 Kazu Hirata + + * c-common.c, cfghooks.c, rtlanal.c, varasm.c: Fix comment + typos. + +2004-02-17 Jan Hubicka + + * i386.c (x86_prologue_using_move, x86_epilogue_using_move): Disable for P4. + +2004-02-18 Alan Modra + + PR optimization/14119 + * combine.c (try_combine): When attemting to fix unrecognized insns, + don't delete SETs marked with REG_EH_REGION notes. + +2004-02-17 Ulrich Weigand + + * combine.c (simplify_if_then_else): Do not replace + (if_then_else (ne reg 0) (0) (const_int)) by (reg) if the + modes differ. + +2004-02-17 Steven Bosscher + + * (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c, + function.c, integrate.c, print-tree.c, toplev.c, tree-optimize.c, + tree.h): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION. + * ada/utils.c: Likewise. + * cp/decl.c: Likewise. + * f/com.c: Likewise. + * java/class.c: Likewise. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.md: Fix comment typos. + +2004-02-17 Rainer Orth + + * config/mips/t-iris6gld: Renamed to ... + * config/mips/t-irix-gld: ... this. + * config.gcc (mips-sgi-irix6*): Reflect this + (mips-sgi-irix5*): Use it with GNU ld. + + * config/mips/irix6-crti.asm, config/mips/irix6-crtn.asm: Renamed + to ... + * config/mips/irix-crti.asm, config/mips/irix-crtn.asm: ... this. + * config/mips/t-irix-gld: Reflect this. + * config/mips/iris6gld.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + + * config/mips/iris5gld.h: New file. + * config.gcc (mips-sgi-irix5*): Use it with GNU ld. + Only use collect2 without gas. + + * config/mips/iris6.h (IRIX6_STARTFILE_SPEC, IRIX6_ENDFILE_SPEC): + Renamed to IRIX_STARTFILE_SPEC, IRIX_ENDFILE_SPEC. + (STARTFILE_SPEC, ENDFILE_SPEC, SUBTARGET_EXTRA_SPECS): Reflect this. + * config/mips/iris6gld.h (STARTFILE_SPEC, ENDFILE_SPEC): Likewise. + + * config/mips/iris6.h (SUBTARGET_EXTRA_SPECS): Moved ... + * config/mips/iris5.h: ... here. + + * config/mips/iris5.h (STARTFILE_SPEC, ENDFILE_SPEC): Renamed to + IRIX_STARTFILE_SPEC, IRIX_ENDFILE_SPEC. + (STARTFILE_SPEC, ENDFILE_SPEC): Define. + + * config/mips/iris5gas.h (STARTFILE_SPEC, ENDFILE_SPEC): Simplify + using irix_startfile_spec, irix_endfile_spec. + +2004-02-16 Gunther Nikl + + * config/m68k/m68k.c: Remove obsolete support for HPUX_ASM. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c (h8300_expand_prologue): Don't generate + insns by hand. + +2004-02-17 Zdenek Dvorak + + * cfghooks.c (split_edge): Speed up updating of dominators. + +2004-02-17 Mark Mitchell + + PR c++/11326 + * c-common.c (flag_abi_version): Remove. + * c-common.h (flag_abi_version): Likewise. + * c-opts.c (c_common_handle_option): Remove OPT_fabi_version case. + * c.opt (fabi-version): Remove. + * calls.c (expand_call): Always pass a function type to + struct_value_rtx. Use convert_memory_address. + * common.opt (fabi-version): Add it. + * flags.h (flag_abi_version): Likewise. + (abi_version_at_least): New macro. + * opts.c (common_handle_option): Add OPT_fabi_version. + * toplev.c (flag_abi_version): Define it. + * config/ia64/ia64.c (ia64_struct_retval_addr_is_first_parm_p): + New function. + (ia64_output_mi_thunk): Use it. + (ia64_struct_value_rtx): Likewise. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.c (h8300_emit_stack_adjustment): + Don't generate insns by hand. + +2004-02-17 Andrew Pinski + + PR c++/14178 + * doc/invoke.texi (fabi-version): The default is 2 now. + +2004-02-17 Zdenek Dvorak + + * loop-iv.c: New file. + * Makefile.in (loop-iv.o): New. + * basic_block.h (FOR_BB_INSNS, FOR_BB_INSNS_REVERSE): New macros. + * cfgloop.c (fill_sons_in_loop, get_loop_body_in_dom_order, + num_loop_branches): New functions. + * cfgloop.h (get_loop_body_in_dom_order, num_loop_branches, + iv_analysis_loop_init, iv_get_reaching_def, iv_analyse, get_iv_value, + find_simple_exit, iv_number_of_iterations, iv_analysis_done, + get_simple_loop_desc, free_simple_loop_desc): Declare. + (simple_loop_desc): New inline function. + (struct rtx_iv, struct niter_desc): New. + * cfgloopmanip.c (loopify): Specify semantics more precisely. + * expr.c (force_operand): Handle subregs of expressions created by + loop unroller. + * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Move + parts of the initialization to toplev.c + * loop-unroll.c (loop_exit_at_end_p): New. + (unroll_and_peel_loops): Call iv_analysis_done. + (decide_peel_once_rolling, decide_peel_completely, + decide_unroll_stupid, decide_unroll_constant_iterations, + decide_unroll_runtime_iterations, decide_peel_simple, + peel_loop_simple, unroll_loop_stupid, unroll_loop_constant_iterations, + unroll_loop_runtime_iterations): Use new simple loop analysis. + * loop-unswitch.c (compare_and_jump_seq): New. + (may_unswitch_on_p): Renamed to ... + (may_unswitch_on): Use new iv analysis. + (reversed_condition): Export. + (unswitch_single_loop, unswitch_loop): Use new iv analysis. + * predict.c (estimate_probability): Use new simple loop analysis. + * rtl.h (get_mode_bounds, reversed_condition,compare_and_jump_seq, + canon_condition, simplify_using_condition): Declare. + * stor-layout.c (get_mode_bounds): New. + * toplev.c (rest_of_handle_loop2): Some parts of + initialization/finalization moved here from loop-init.c. + +2004-02-17 Kazu Hirata + + * config/h8300/h8300.h (FIXED_REGISTERS): Add the soft frame + pointer. + (CALL_USED_REGISTERS): Likewise. + (REG_ALLOC_ORDER): Likewise. + (REG_CLASS) : Likewise. + +2004-02-16 Geoffrey Keating + + * doc/md.texi (Insn Canonicalizations): Document left-chaining + in associative operators. + * rtlanal.c (commutative_operand_precedence): Create some new + variables. Prefer a commutative operand on the left, then + binary expressions, then NEG and NOT. + +2004-02-16 Matthias Klose + + * config/t-slibgcc-elf-ver: Define SHLIB_NAME and SHLIB_SONAME + in terms of SHLIB_SOVERSION. + * config/m68k/t-slibgcc-elf-ver: New file. + * config/pa/t-slibgcc-elf-ver: New file. + * config.gcc (m68k-linux, parisc-linux): Use them when not + sjlj exceptions are not configured. + +2004-02-16 Eric Botcazou + + * config/sparc/sparc.c (get_pc_symbol_name): Mark with GTY(()). + +2004-02-16 Zack Weinberg + + * sdbout.c (sdb_debug_hooks): Correct the type_decl entry. + +2004-02-16 Joseph S. Myers + + * doc/sourcebuild.texi: Mention backends.html. + +2004-02-16 Kazu Hirata + + * c-decl.c, c-ppoutput.c, cpphash.h, cpplib.h, dbxout.c, + line-map.c, line-map.h, var-tracking.c: Fix comment + formatting. + +2004-02-16 Richard Henderson + + * cse.c (cse_insn): Don't lose REG_NON_LOCAL_GOTO note. + + * fold-const.c (operand_equal_p): Fix VECTOR_CST comparison. + +2004-02-15 Kazu Hirata + + * config/h8300/h8300.md: Remove unnecessary parallels from + all define_insn and define_split patterns. + +2004-02-15 Kazu Hirata + + * config/h8300/h8300.md: Remove explicit (set_attr "cc" + "clobber"). + +2004-02-15 Bernardo Innocenti + + * config/m68k/m68k.h (PRINT_OPERAND_PUNCT_VALID_P): Restore support for + '%#'. + +2004-02-15 Kazu Hirata + + * config/ia64/ia64.c, config/mips/mips.c, + config/mmix/mmix-modes.def: Fix comment typos. + +2004-02-15 Roger Sayle + + * c-common.h (GET_DIRECTIVE_LINE): Remove unused macro. + (get_directive_line): Remove unused function prototype. + +2004-02-14 Josef Zlomek + + * tree-inline.c (copy_body_r): Do not replace ret_label. + +2004-02-14 Jan Hubicka + + * i386.c (x86_four_jump_limit): New variable. + (k8_avoid_jump_misspredicts): Rename to ... + (ix86_avoid_jump_misspredicts): .. this one. + (ix86_pad_returns): Break out from ... + (ix86_reorg): ... this one; do ix86_avoid_jump_misspredicts when asked + to. + * i386.h (TARGET_FOUR_JUMP_LIMIT): New macro. + +2004-02-14 Josef Zlomek + + * emit-rtl.c (set_decl_incoming_rtl): Check whether the 0th element of + PARALLEL is NULL. + +2004-02-14 Per Bothner + + * fix-header.c (line_table): Move local variable in main to global. + * scan.h (line_table): Use it. + * scan-decls.c (scan_decls): Need to call linemap_lookup on token's + line (recently renamed to src_loc) before calling recognized_function. + +2004-02-14 Matt Kraai + + * Makefile.in: Fix comment typos. + +2004-02-14 Olivier Hainque + + * loop.c (check_dbra_loop): Use gen_int_mode instead of GEN_INT + for start_value when it is directly moved into reg, and factorize + the retrieval of GET_MODE (reg). + +2004-02-14 Richard Sandiford + + * config/mips/mips-protos.h (mips_load_got_page): Delete. + (mips_load_got_global): Delete. + (mips_gotoff_page): Declare. + * config/mips/mips.md (UNSPEC_LOAD_GOT): New constant. + (*xgot_lo[sd]i, *got_disp[sd]i, *got_page[sd]i): Build an + UNSPEC_LOAD_GOT pattern rather than a MEM. + (*load_got[sd]i): New patterns. + * config/mips/mips.c (mips_got_alias_set, mips_load_got): Delete. + (mips_load_got_page, mips_load_got_global): Delete. + (mips_gotoff_page): New function. + (override_options): Don't initialize mips_got_alias_set. + +2004-02-14 Richard Sandiford + + * config/mips/mips.h (MASK_DEBUG_[ABEFI], TARGET_DEBUG_[ABEFI]_MODE) + (TARGET_MIPS4100, TARGET_MIPS4300, TARGET_MIPS4KC, TARGET_MIPS5KC) + (TARGET_SB1, TUNE_SB1, TUNE_SR71K, BIGGEST_MAX_ARGS_IN_REGISTERS) + (GO_PRINTF, GO_PRINTF2, GO_DEBUG_RTX, DFMODE_NAN, SFMODE_NAN): Delete. + (TARGET_SWITCHES): Remove MASK_DEBUG_[ABEFI]. + * config/mips/mips.c: Fix some overly-long lines. + (SINGLE_WORD_MODE_P, PIC_OFFSET_TABLE_MASK): Delete. + (init_cumulative_args): Remove TARGET_DEBUG_E_MODE handling. + +2004-02-13 Rainer Orth + + * configure.ac: Search for as, ld below libexec/gcc. + * configure: Regenerate. + +2004-02-14 Ben Elliston + + * config/arm/mmintrin.h (_mm_setwcx): Reverse arguments in call to + __builtin_arm_setwcx (). + * config/arm/arm.c (arm_expand_builtin): Generate operands + correctly and reverse their order in call to gen_iwmmxt_tmcr (). + +2004-02-14 Ben Elliston + + * config/arm/arm.c (bdesc_2arg): Correct builtin names "wmulsh" + and "wmuluh" to "wmulsm" and "wmulum", respectively. + * config/arm/arm.h (enum arm_builtins): Rename enumerators to + ARM_BUILTIN_WMULSM and ARM_BUILTIN_WMULUM. + * config/arm/mmintrin.h (_mm_mulhi_pi16): Update intrinsic call. + (_mm_mulhi_pu16): Likewise. + +2004-02-13 Zack Weinberg + + * xcoffout.c (xcoff_assign_fundamental_type_number): Check + DECL_NAME != 0 before dereferencing. + +2004-02-13 Ulrich Weigand + + * config/s390/s390-protos.h (s390_output_symbolic_const): Remove. + (s390_output_addr_const_extra): Declare. + (s390_output_pool_entry): Remove FILE * argument. + * config/s390/s390.c (s390_output_symbolic_const): Remove. + (s390_output_addr_const_extra): New function. + (print_operand_address): Call output_addr_const instead of + s390_output_symbolic_const. + (print_operand): Likewise. + (s390_output_pool_entry): Use assemble_integer for symbolic constants. + Remove FILE * argument. + * config/s390/s390.h (OUTPUT_ADDR_CONST_EXTRA): Define. + * config/s390/s390.md ("*pool_entry"): Adapt s390_output_pool_entry + call. + +2004-02-13 Zdenek Dvorak + + * cfgloopanal.c (mark_irreducible_loops): Rewriten. + (struct edge, struct vertex, struct graph): New. + (dump_graph, new_graph, add_edge, dfs, check_irred, for_each_edge, + free_graph): New functions. + +2004-02-12 Chris Demetriou + + * config/mips/mips.md (casesi_internal, casesi_internal_di): + Use ".set macro" to avoid warnings about multi-instruction + macros, since they're intentional. + +2004-02-12 Geoffrey Keating + + * config/darwin.h: Add include guards. Remove old, now incorrect, + comment about STANDARD_EXEC_PREFIX. + + * Makefile.in (install-man): Use $(CPP_INSTALL_NAME) and + $(GCOV_INSTALL_NAME) to install manpages. Remove generic rule + for installing .1 manpages. Add rules for installing cpp + and gcov manpages under their installed names. + +2004-02-12 Alexandre Oliva + + * configure.ac (gcc_cv_ld): Don't set to LD if target is not + host, but try LD_FOR_TARGET first. + * configure: Rebuilt. + +2004-02-12 Zack Weinberg + + * dbxout.c: Move declaration of dbxout_type_decl outside + #ifdef DBX_DEBUGGING_INFO. + * c-parse.in: Don't give the asmdef production a type. + +2004-02-12 Zack Weinberg + + * debug.h (struct gcc_debug_hooks): Add type_decl field. + (debug_nothing_tree_int): Prototype. + (dwarf_debug_hooks): Delete, unused. + * debug.c (do_nothing_debug_hooks): Update. + (debug_nothing_tree_int): New function. + * langhooks.h (struct lang_hooks_for_decls): + Remove builtin_type_decls field. + * langhooks-def.h (LANG_HOOKS_BUILTIN_TYPE_DECLS): Delete. + (LANG_HOOKS_DECLS): Update. + * toplev.c (rest_of_decl_compilation, rest_of_type_compilation): + Use debug_hooks->type_decl. + * dbxout.c (preinit_symbols): New static. + (dbx_debug_hooks, xcoff_debug_hooks): Update. + (dbxout_init): Don't call DBX_OUTPUT_STANDARD_TYPES or + lang_hooks.decls.builtin_type_decls. Do scan preinit_symbols + for symbols to output. + (dbxout_type_decl): New function. + (dbxout_symbol): If called before dbxout_init has run, queue + the symbol for later. Apply DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER + to TYPE_DECLs before emitting them. + * xcoffout.c (assign_type_number): Delete. + (xcoff_type_numbers): New static table. + (xcoff_assign_fundamental_type_number): New function. + * xcoffout.h: Define DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER, not + DBX_OUTPUT_STANDARD_TYPES. Remove unnecessary #ifdefs. + * sdbout.c: Include varray.h. + (deferred_global_decls): New static. + (sdb_debug_hooks): Update. + (sdbout_global_decl): If we can't emit something right now, + remember it in deferred_global_decls. + (sdbout_finish): Just scan deferred_global_decls; don't call getdecls. + (sdbout_init): Initialize deferred_global_decls. + * Makefile.in: Update dependencies of sdbout.o. + * dwarf2out.c (dwarf2out_type_decl): New function. + (dwarf2_debug_hooks): Update. + * vmsdbgout.c (vmsdbg_debug_hooks): Update. + * c-decl.c (getdecls): Just return 0. + (check_for_loop_decls): Don't use getdecls. + (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL. + * c-objc-common.c (c_objc_common_finish_file): Don't use getdecls. + +2004-02-12 Ulrich Weigand + + * config/s390/s390.c (s390_sched_reorder2): Remove. + (TARGET_SCHED_REORDER2): Do not redefine. + +2004-02-12 Zack Weinberg + + * c-parse.in (maybe_type_qual): Delete. + (maybe_volatile, simple_asm_expr, asmdef, asm_stmt) + (asm_argument): New grammar rules. + (extdef_1): Use asmdef. + (maybeasm): Move down with other asm rules; use simple_asm_expr. + (xexpr): Move up with other expression rules. + (stmt): Use asm_stmt. + + * c-typeck.c (build_asm_expr): New function - body mostly + pulled from build_asm_stmt. + (build_asm_stmt): Just handle tacking on the volatile qualifier. + * c-tree.h (build_asm_expr, build_asm_stmt): Update prototypes. + +2004-02-12 Richard Sandiford + + PR bootstrap/13617 + * config/mips/mips-protos.h (mips_output_aligned_decl_common): Declare. + (mips_declare_object): Make variadic. + * config/mips/mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use + mips_output_aligned_decl_common. + * config/mips/mips.c (mips_output_aligned_decl_common): New function. + (mips_declare_object): Make variadic. + +2004-02-12 Richard Kenner + + * function.c (update_epilogue_consts): Teach about binary operations. + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill + previous MEM_VOLATILE in REF. + * function.c (fixup_var_refs): Save volatile_ok and set to 1. + * expr.c (emit_block_move_via_movstr): Save and restore volatile_ok. + +2004-02-12 Gunther Nikl + + * config.gcc: Restore support for m68k-openbsd. + +2004-02-12 Jan Hubicka + + * tree-optimize.c (tree_rest_of_compilation): Do not release + DECL_ARGUMENTS. + +2004-02-11 Matt Kraai + + * doc/install.texi: Fix the spelling of "explicitly". + +2004-02-11 Eric Christopher + + * cppcharset.c (_cpp_interpret_string_notranslate): Rename and + duplicate argument structure of cpp_interpret_string. + * cpphash.h: Move prototype... + * cpplib.h: Here. + * cpplib.c: Fix calls to match new function signature. + +2004-02-11 Joseph S. Myers + + PR c/456 + * cppexp.c (num_binary_op): Don't allow comma operators in #if + constant expressions at all outside C99 mode if pedantic. + +2004-02-11 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_log10 and OTI_log2. + (log10_optab, log2_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize log10_optab and log2_optab. + * genopinit.c (optabs): Implement log10_optab and log2_optab + using log10?f2 and log2?f2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOG10{,F,L} + using log10_optab, and BUILT_IN_LOG2{,F,L} using log2_optab. + (expand_builtin): Expand BUILT_IN_LOG10{,F,L} and BUILT_IN_LOG2{,F,L} + using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. + + * config/i386/i386.md (log10sf2, log10df2, log10xf2, log2sf2, + log2df2, log2xf2): New patterns to implement log10, log10f, log10l, + log2, log2f and log2l built-ins as inline x87 intrinsics. + +2004-02-11 Richard Henderson + + PR target/1532 + * flow.c (insn_dead_p): A clobber of a dead hard register is a + dead insn after reload. + +2004-02-11 Ulrich Weigand + + * tree.h (frame_base_decl): Add GTY marker. + * var-tracking.c (frame_base_decl): Likewise. + +2004-02-11 Daniel Berlin + + * dwarf2out.c (output_loc_list): Remove no longer necessary, and now + incorrect, hunk. + (add_location_or_const_value_attribute): Use text_section_label, + not TEXT_SECTION_NAME. + +2004-02-11 Per Bothner + + Represent column numbers using line-map's source_location. + The "next available source_location" is now managed internally by + line-maps.c rather than by clients. + * line-map.h (struct line_map): New field column_bits. + : Rename field to start_location. + (struct line_maps): New fields highest_location and max_column_hint. + (linemap_check_files_exited): New declaration. + (linemap_line_start): New declaration. + (linemap_add): Remove from_line parameter; use highest_location field. + (SOURCE_LINE, LAST_SOURCE_LINE): Modify to use column_bits. + (SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION): New macros. + (CURRENT_LINE_MAP): Remove macro. + (linemap_position_for_column): New inline function. + * line-map.c (linemap_init): Clear new fields. + (linemap_check_files_exited): New function, extracted from ... + (linemap_free): Use linemap_check_files_exited. + (linemap_add): Remove from_line parameter. Various updates. + (linemap_line_start): New function. + (linemap_lookeup): Update for new field names. + * cpphash.h (struct cpp_reader) : Field removed. Because + linemap_position_for_column may unpredictably change the current map, + it is cleaner and simpler for us to not cache it in cpp_reader. + (struct cpp_buffer): New sysp field. + Changed warned_cplusplus_comments and from_stage3 to bitfields. + * cppinit.c (cpp_read_min_file): pfile->map no longer exists. + * cpplib.c (do_line, do_linemarker, _cpp_do_file_change): Get + current map using linemap_lookup. + (do_linemarker): Also set buffer's sysp field. + (destringize_and_run): No longer need to decrement current line. + * cppfiles.c (_cpp_stack_file): Set sysp from and in buffer. + (search_path_head, open_file_failed): Use buffer's sysp. + (cpp_make_system_header): Get current map using linemap_lookup. + Also set buffer's sysp flag. + * cppmacro.c (_cpp_builtin_macro_text): Likewise use linemap_lookup. + * cpphash.h (CPP_INCREMENT_LINE): New macro. + (struct cpp_buffer): Moved fields saved_cur, saved_rlimit to ... + (struct cpp_reader): ... and adding saved_line_base field. + * cpptrad.c (_cpp_overlay_buffer, _cpp_remove_overlay): + Update accordingly. Don't adjust line. + (_cpp_scan_out_logical_line): Use CPP_INCREMENT_LINE. + * cpphash.c (CPP_IN_SYSTEM_HEADER): Replaced macro by ... + (cpp_in_system_header): ... new inline function, using buffer's sysp. + * cpperror.c (_cpp_begin_message): Update to use cpp_in_system_header. + * cpplex.c (_cpp_lex_direct): Likewise. + * cppmacro.c (_cpp_builtin_macro_text): Likewise. + * cppmacro.c (_cpp_create_definition): Use buffer's sysp field. + * cpplib.h (struct cpp_token): Rename line field to src_loc. + Remove col field as it is now subsumed by src_loc. + * cpperror.c: Update various field, parameter, and macro names. + (print_location): If col==0, try SOURCE_COLUMN of line. + (cpp_error): Use cur_token's src_loc field, rather than line+col. + * cpplib.c (do_diagnostic): Token's src_loc fields replaces line+col. + * cpplex.c (_cpp_process_line_notes, _cpp_lex_direct, + _cpp_skip_block_comment): Use CPP_INCREMENT_LINE. + (_cpp_temp_token): Replace cpp_token's line+col fields by src_loc. + (_cpp_get_fresh_line): Don't need to adjust line for missing newline. + (_cpp_lex_direct): Use linemap_position_for_column. + * c-ppoutput.c (maybe_print_line, print_line): Don't take map + parameter. Instead get it from the line_table global. Adjust callers. + (print): Remove map field. Replace line field to src_line. + (init_pp_output, account_for_newlines, maybe_print_line): Adjust. + (cb_line_change): Use SOURCE_COLUMN. Minor optimizations. + (pp_file_change): Use MAIN_FILE_P since we cannot checked print.map. + Use LAST_SOURCE_LINE_LOCATION to "catch up" after #include. + * cpptrad.c (copy_comment): Rename variable. + * c-lex.c (map): Remove static variable, for same reason we removed + cpp_reader's map field. + (cb_line_change, cb_def_pragma, cb_define, cb_undef): Hence we need + to call linemap_lookup. + (cb_line_change): Token's line field replaced by src_loc. + (fe_file_change): Use MAINFILE_P and LAST_SOURCE_LINE macros. + Don't save new_map. + + * cpphash.h, cpperror.c, cpplib.h: Some renames of fileline to + source_location. + +2004-02-11 Hartmut Penner + + * config/rs6000/altivec.md (*movv4si_internal): At least one + operand must be register_operand. + (*movv8hi_internal1): Likewise. + (*movv16qi_internal1): Likewise. + (*movv4sf_internal1): Likewise. + +2004-02-10 Aldy Hernandez + + * config/rs6000/spe.md ("*movv2si_internal"): Check for register + operand. + (movv4hi_internal): Same. + (movv2sf_internal): Same. + (movv1di_internal): Same. + +2004-02-11 Thiemo Seufer + + * config/mips/mips.h (TARGET_OLDABI): Define. Use TARGET_NEWABI and + TARGET_OLDABI consistently. + * config/mips/mips.c (function_arg,mips_setup_incoming_varargs, + mips_va_arg,override_options,compute_frame_size, + mips_initial_elimination_offset,mips16_fp_args,build_mips16_call_stub + ,mips_return_in_memory,mips_strict_argument_naming): Use TARGET_NEWABI + and TARGET_OLDABI consistently. + * config/mips/mips.md (exception_receiver): Likewise. + * config/mips/linux64.h: Likewise. + +2004-02-11 Hartmut Penner + + * config/rs6000/rs6000.c (rs6000_override_options) + Set AltiVec ABI and vrsave as default for ppc64 linux. + (init_cumulative_args): Post error, if try to return + value in AltiVec register without enable AltiVec. + (function_arg_advance): Ditto for passing arguments. + +2004-02-11 Richard Sandiford + + * emit-rtl.c (mark_label_nuses): Check that a LABEL_REF refers to + a label before updating its usage count. + +2004-02-10 Matt Kraai + + * doc/install.texi: Remove extra cd. + +2004-02-10 Ziemowit Laski + + * c-common.c (vector_size_helper): Remove; call + reconstruct_complex_type() instead. + * tree.c (reconstruct_complex_type): New function + (formerly vector_size_helper() in c-common.c). + (make_vector): Make externally visible. + * tree.h (reconstruct_complex_type, make_vector): Add prototypes. + +2004-02-10 Kazu Hirata + + * config/h8300/h8300-protos.h: Add a prototype for + h8300_regs_ok_for_stm. + * config/h8300/h8300.c (h8300_regs_ok_for_stm): New. + * config/h8300/h8300.md (stm_h8300s_2_advanced, + stm_h8300s_2_normal, stm_h8300s_2, stm_h8300s_3_advanced, + stm_h8300s_3_normal, stm_h8300s_3, stm_h8300s_4_advanced, + stm_h8300s_4_normal, stm_h8300s_4, ldm_h8300s_2_advanced, + ldm_h8300s_2_normal, ldm_h8300s_2, ldm_h8300s_3_advanced, + ldm_h8300s_3_normal, ldm_h8300s_3, ldm_h8300s_4_advanced, + ldm_h8300s_4_normal, ldm_h8300s_4): Use + h8300_regs_ok_for_stm(). + +2004-02-10 Danny Smith + + PR c/14088 + * real.c (real_from_string): Look for 'X' as well as 'x' in + hexfloat strings. + +2004-02-10 Kazu Hirata + + * config/h8300/h8300.md: Remove an incorrect comment about + peephole2. Add comments. + +2004-02-10 Josef Zlomek + + PR/14058 + * emit-rtl.c (set_decl_incoming_rtl): New. + * tree.h (set_decl_incoming_rtl): New. + * function.c (assign_parms): Use set_decl_incoming_rtl for setting + DECL_INCOMING_RTL. + * ada/misc.c (adjust_decl_rtl): Likewise. + +2004-02-10 Per Bothner + + * c-opts.c (c_common_post_options): Don't emit working directory + in cpp output if -P was specified. + +2004-02-10 Paolo Bonzini + + PR c/14092 + * fold-const.c (fold) : Convert result of + negate_expr back to the original type. + +2004-02-10 Alan Modra + + * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Don't + bump retaddr here. + +2004-02-10 Paolo Bonzini + + * rtl.h (schedule_insns, schedule_ebbs, fix_sched_param, + gen_lowpart_SUBREG): Move under the file in which they + are actually declared. + +2004-02-10 Arnaud Charlet + + * doc/sourcebuild.texi: Add libada documentation. + + * doc/install.texi: Update documentation on Ada build, now + that the GNAT lib and tools are built automatically. + +2004-02-10 Richard Sandiford + + * config/mips/mips.h (TARGET_GPWORD): Return false for TARGET_NEWABI + && TARGET_IRIX. + +2004-02-09 Ziemowit Laski + + * objc/objc-act.c (get_super_receiver): Move '#ifdef OBJCPLUS' + boundaries outside build_component_ref() call (a macro in ObjC++). + +2004-02-09 Bob Wilson + + * config/xtensa/xtensa-protos.h (xtensa_copy_incoming_a7): Update. + (init_cumulative_args): Likewise. + (a7_overlap_mentioned_p): Delete prototype. + * config/xtensa/xtensa.c (struct machine_function): Replace + incoming_a7_copied field with need_a7_copy and vararg_a7 flags. + Add set_frame_ptr_insn field. + (xtensa_emit_move_sequence): Update call to xtensa_copy_incoming_a7. + (xtensa_copy_incoming_a7): Rewrite to check need_a7_copy flag and check + if the operand is an argument in a7. If so, copy a7 to a new pseudo + at the function entry and replace the operand with the pseudo. + (init_cumulative_args): Remove unused arguments. Add new "incoming" + argument and record this flag in CUMULATIVE_ARGS. + (function_arg): Remove result_mode and special-case code to handle + arguments in a7. Instead, set need_a7_copy flag when there is an + incoming argument in a7. + (xtensa_expand_prologue): Remove code to search for set_frame_ptr insn + and use the value recorded in cfun->machine->set_frame_ptr_insn. + (xtensa_builtin_saveregs): Check for negative gp_left value. Set + need_a7_copy and vararg_a7 flags. Use move_block_from_reg instead of + special-case code. + (a7_overlap_mentioned_p): Delete. + * config/xtensa/xtensa.h (CUMULATIVE_ARGS): Add "incoming" flag. + (INIT_CUMULATIVE_ARGS, INIT_CUMULATIVE_INCOMING_ARGS): Remove useless + arguments to init_cumulative_args and pass "incoming" flag instead. + (BLOCK_REG_PADDING): Delete. + * config/xtensa/xtensa.md (movdi, movsf, movdf): Remove unnecessary + checks for reload_in_progress and reload_completed. Update calls to + xtensa_copy_incoming_a7. + (ashlsi3): Rename existing insn to ashlsi3_internal. Add expander + to call xtensa_copy_incoming_a7. + +2004-02-09 DJ Delorie + + * config/i386/xm-djgpp.h (GCC_DRIVER_HOST_INITIALIZATION): No + longer modify standard_exec_prefix, standard_bindir_prefix, or + standard_startfile_prefix. + +2004-02-09 James E Wilson + + PR c++/11295 + * c-common.c (c_expand_expr, case STMT_EXPR): Change expand_expr call + to expand_expr_real call, and pass in alt_rtl as last argument. + + PR libstdc++/5625 + * builtin-types.def (BT_WORD, BT_FN_WORD_PTR): New. + * builtins.c (expand_builtin): Handle BUILT_IN_EXTEND_POINTER. + * builtins.def (BUILT_IN_EXTEND_POINTER): New. + * except.c (expand_builtin_extend_pointer): New. + * except.h (expand_builtin_extend_pointer): Declare. + +2004-02-09 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_move): Remove splitting slow + unaligned loads and stores. + +2004-02-09 Rainer Orth + + * config/mips/iris5.h (BSS_SECTION_ASM_OP): Define. + * config/mips/iris6.h (BSS_SECTION_ASM_OP): Undef. + + * config/mips/iris6.h (TARGET_ASM_NAMED_SECTION): Moved ... + * config/mips/iris5.h: ... here. + * config/mips/iris5gas.h (TARGET_ASM_NAMED_SECTION): Remove. + + * config/mips/iris6.h (EXTRA_SECTION_FUNCTIONS): Move ... + * config/mips/iris5.h: ... here. + +2004-02-09 Rainer Orth + + * configure.ac: Remove default executable files before AC_PROG_CC. + * configure: Regenerate. + +2004-02-09 Kazu Hirata + + PR target/13721 + * config/h8300/h8300.c (byte_reg): Call abort() if asked to + print a operand other than a register. + +2004-02-09 Roger Sayle + + * fold-const.c (fold) : Use the original type conversion + tree code rather than call fold_convert, which doesn't specify a + default floating point to integer conversion. + +2004-02-08 Bernardo Innocenti + + * config/m68k/m68k.c, config/m68k/m68k.md (SGS, SGS_CMP_ORDER): Remove + code to support SGS assembler. Reformat adjacent code where possible. + * config/m68k/m68k.c (switch_table_difference_label_flag): Remove + definition. + * config/m68k/m68k.h (PRINT_OPERAND_PUNCT_VALID_P): Remove support + for '%#'. + * config/m68k/linux.h, config/m68k/m68k.c, + * config/m68k/math-68881.h: Replace `%#' with `#' in inline asm + macros and asm_printf() format strings. + * config/m68k/m68kelf.h (ASM_OUTPUT_CASE_END): Remove macro definition. + * config/m68k/linux.h: Update copyright. + * config/m68k/linux.h, config/m68k/m68k.c: Remove traling whitespace. + +2004-02-08 Andreas Schwab + Bernardo Innocenti + + * config/m68k/m68k.h (REGISTER_NAMES): Prefix each name with + REGISTER_PREFIX. + * (M68K_FP_REG_NAME): New macro to specify an alternate name for the + frame pointer register, overridable by OS targets. + * (M68K_REGNAME): Macro to obtain register name for asm output, + eventually replacing %a6 with M68K_FP_REG_NAME. + * config/m68k/coff.h (REGISTER_NAMES): Don't redefine. + * config/m68k/linux.h (REGISTER_NAMES): Likewise. + * config/m68k/m68kelf.h (REGISTER_NAMES): Likewise. + * config/m68k/netbsd-elf.h (REGISTER_NAMES): Likewise. + * config/m68k/m68k.c: Use M68K_REGNAME(x) in place of reg_names[x]. + +2004-02-08 Kazu Hirata + + * target-def.h (TARGET_STRUCT_VALUE_RTX): Define as + hook_rtx_tree_int_null. + * targhooks.c (default_struct_value_rtx): Remove. + * targhooks.h: Remove the prototype for + default_struct_value_rtx. + * config/alpha/alpha.c, config/arc/arc.c, config/avr/avr.c, + config/fr30/fr30.c, config/h8300/h8300.c, config/i386/i386.c, + config/ip2k/ip2k.c, config/iq2000/iq2000.c, + config/m32r/m32r.c, config/mcore/mcore.c, config/mips/mips.c, + config/mn10300/mn10300.c, config/pdp11/pdp11.c, + config/rs6000/rs6000.c, config/s390/s390.c, + config/stormy16/stormy16.c, config/v850/v850.c, + config/xtensa/xtensa.c (TARGET_STRUCT_VALUE_RTX): Remove. + * doc/tm.texi (TARGET_STRUCT_VALUE_RTX): Document the default. + +2004-02-08 Joseph S. Myers + + * README.Portability: Change "ISO C89" to "ISO C90". + * c-parse.in (primary, initelt): Likewise. + +2004-02-08 Richard Sandiford + + * real.c (encode_ibm_extended): Normalize the input value before + converting it to a double. Handle the case where a normal value + rounds to infinity. + +2004-02-08 Kazu Hirata + + * c-objc-common.c (c_cannot_inline_tree_fn): Fix a typo in a + warning. + * cse.c (preferrable): Change to preferable. Update all of its + callers. + * genautomata.c (ainsn): Change + first_ainsn_with_given_equialence_num to + first_ainsn_with_given_equivalence_num. Update all of its + references. + +2004-02-08 Jan Hubicka + + * schedule-ebb.c (schedule_ebbs): Do not allocate reg life data. + +2004-02-07 David Edelsohn + + * function.c (assign_parms): Fix formatting. + +2004-02-07 Kazu Hirata + + * default.h (PROMOTE_PROTOTYPES): Remove. + * system.h (PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, + STRUCT_VALUE_REGNUM, SETUP_INCOMING_VARARGS, + EXPAND_BUILTIN_SAVEREGS): Poison. + * target-def.h (TARGET_PROMOTE_FUNCTION_RETURN): Define as + hook_bool_tree_false. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + * target.h: Replace SETUP_INCOMING_VARARGS with + targetm.calls.setup_incoming_varargs(). + * targhooks.c (default_promote_function_return): Remove. + (default_promote_prototypes): Likewise. + (default_struct_value_rtx): Always abort(). + (default_expand_builtin_saveregs): Always print an error + message. + (default_setup_incoming_varargs): Do nothing. + (default_pretend_outgoing_varargs_named): Don't depend on + SETUP_INCOMING_VARARGS. + * targhooks.h: Remove the prototype for + default_promote_function_return and + default_promote_prototypes. + +2004-02-07 Kazu Hirata + + * system.h (SHARED_SECTION_ASM_OP): Poison. + * varasm.c (data_section): Don't use SHARED_SECTION_ASM_OP. + * doc/tm.texi (SHARED_SECTION_ASM_OP): Remove. + +2004-02-07 Zack Weinberg + + Bug 13856 + * c-decl.c (diagnose_mismatched_decls): Only give special + treatment when olddecl is DECL_BUILT_IN, if C_DECL_INVISIBLE + is also true. + (merge_decls): Don't clear DECL_BUILT_IN_CLASS and + DECL_FUNCTION_CODE when defining a built-in function. + Don't update DECL_ESTIMATED_INSNS. + * dwarf2out.c (dwarf2out_decl): Don't ignore built-in + FUNCTION_DECLs. + * tree.h: Delete DECL_ESTIMATED_INSNS. + * tree-inline.c (struct inline_data): Delete inlined_insns field. + (expand_call_inline, optimize_inline_calls): Don't update + DECL_ESTIMATED_INSNS nor inlined_insns. + * cgraphunit.c (cgraph_analyze_function): Don't update + DECL_ESTIMATED_INSNS. + +2004-02-07 Zack Weinberg + + * c-common.c (shadow_warning): Delete. + * c-common.h (free_parser_stacks, shadow_warning, sw_kind): Delete. + * c-decl.c (warn_if_shadowing): Issue shadow warnings directly. + * c-opts.c (c_common_parse_file): Don't call free_parser_stacks. + * c-parse.in (free_parser_stacks): Delete. + +2004-02-07 Nathanael Nerode + + * Makefile.in, config/t-slibgcc-darwin, config/t-slibgcc-elf-ver, + config/t-slibgcc-sld, config/mips/t-iris5-6, config/sh/t-linux: + Use the top level mkinstalldirs, not the one in the gcc subdir. + * mkinstalldirs: Remove (from the gcc subdir). + +2004-02-07 Roger Sayle + + PR middle-end/13696 + * fold-const.c (fold_convert): New function to provide type + conversion to the middle-end without using convert. + (negate_expr, associate_trees, size_diffop, omit_one_operand, + operand_equal_for_comparison_p, pedantic_omit_one_operand, + invert_truthvalue, optimize_bit_field_compare, range_binop, + decode_field_reference, make_range, build_range_check, unextend, + fold_truthop, extract_muldiv_1, fold_mathfn_compare, + fold_binary_op_with_conditional_arg, fold_inf_compare, + fold_single_bit_test, fold, multiple_of_p): Replace all calls to + convert with calls to fold_convert. + +2004-02-07 Jan Hubicka + + * genrecog.c (find_operand): add extra argument stop. + (validate_pattern): Verify that mach_dup is duplicating operand + defined lexically earlier. + +2004-02-07 Kazu Hirata + + * config.gcc: Don't mention MAX_LONG_TYPE_SIZE. + * system.h (MAX_LONG_TYPE_SIZE, MAX_LONG_DOUBLE_TYPE_SIZE, + MAX_WCHAR_TYPE_SIZE, GCOV_TYPE_SIZE): Poison. + * config/avr/avr.h, config/h8300/h8300.h, config/i386/i386.h, + config/ia64/ia64.h, config/ip2k/ip2k.h, + config/iq2000/iq2000.h, config/mips/iris5.h, + config/mips/mips.h, config/pa/pa-64.h, config/pa/pa.h, + config/rs6000/aix51.h, config/rs6000/aix52.h, + config/rs6000/darwin.h, config/rs6000/rs6000.h, + config/s390/s390.h, config/sh/sh.h, config/sparc/freebsd.h, + config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/netbsd-elf.h, config/sparc/sparc.h, + config/xtensa/xtensa.h: Remove the definitions of + MAX_LONG_TYPE_SIZE, MAX_LONG_DOUBLE_TYPE_SIZE, and/or + MAX_WCHAR_TYPE_SIZE. + * doc/tm.texi (MAX_LONG_TYPE_SIZE, MAX_LONG_DOUBLE_TYPE_SIZE, + MAX_WCHAR_TYPE_SIZE, GCOV_TYPE_SIZE): Remove. + +2004-02-07 Stephane Carrez + + PR bootstrap/13990 + * config/m68hc11/m68hc11.md ("doloop_end"): Pass dummy arguments to + gen_rtx_NE. + +2004-02-07 Josef Zlomek + + * var-tracking.c (vt_add_function_parameters): Surround checkings by + #ifdef ENABLE_CHECKING and #endif. + +2004-02-07 Roger Sayle + + * fold-const.c (negate_expr_p, negate_expr): Optimize -(A+B) into + either (-A)-B or (-B)-A, if A or B is easily negated respectively. + (fold) : Optimize (A*C) - (B*C) -> (A-B)*C for both + integer types and floating point with unsafe_math_optimizations. + Add similar optimization for (A*C1) - (A*C2) -> A*(C1-C2). + Optimize A - B as A + (-B), if B is easily negated. + +2004-02-07 Kazu Hirata + + * c-ppoutput.c, cfganal.c, diagnostic.h, print-rtl.c, + config/darwin.c, config/darwin.h, config/ia64/ia64-c.c, + config/m32r/linux.h, config/rs6000/ppc64-fp.c, + config/sparc/openbsd.h, doc/makefile.texi, doc/passes.texi: + Update copyright. + +2004-02-07 Kazu Hirata + + * c-ppoutput.c, var-tracking.c: Fix comment typos. + +2004-02-06 James E Wilson + + * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Only define for + glibc 2.3 or better. + +2004-02-06 Kazu Hirata + + * doc/tm.texi (TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL): Change + to FLOAT_LIB_COMPARE_RETURNS_BOOL. + +2004-02-07 Alan Modra + + * config/rs6000/t-linux64 (LIB2FUNCS_EXTRA): Add darwin-ldouble.c. + (SHLIB_MAPFILES): Add libgcc-ppc64.ver. + (SHLIB_MKMAP_OPTS): Delete. + (TARGET_LIBGCC2_CFLAGS): Add -specs. + (bispecs): Add rule. + * config/rs6000/libgcc-ppc64.ver: New file. + * config/rs6000/ppc64-fp.c (__fixtfdi, __floatditf): New functions. + (__floatdidf, __floatdisf): Optimize multiply. + (__fixunstfdi): New function. + * config/rs6000/rs6000.c (rs6000_complex_function_value): Allow for + real and imag parts larger than one register. + (function_arg): Correct type of reg used when fp arg split partially + to stack. + * config/rs6000/darwin-ldouble.c: Protect with #if !_SOFT_FLOAT + and __MACH__ or __powerpc64__. + +2004-02-06 Roger Sayle + Ulrich Weigand + + * builtins.c (expand_builtin_signbit): Use extract_bit_field instead + of gen_highpart or gen_lowpart when the floating point format is + wider than the result mode. + +2004-02-06 Andrew Pinski + + * dwarf2out.c (loclabel_num): Move into #ifdef + DWARF2_DEBUGGING_INFO. + +2004-02-06 Ziemowit Laski + + * objc/objc-act.c (build_super_template) the 'class' field of + 'struct _objc_super' shall be named 'super_class' #ifdef OBJCPLUS. + (get_super_receiver): Likewise. + +2004-02-06 Kazu Hirata + + * reload1.c (check_eliminable_occurrences): Optimize the reset + of can_eliminate. + (eliminate_regs_in_insn): Likewise. + +2004-02-06 Daniel Berlin + Josef Zlomek + + * dwarf2out.c (struct gcc_debug_hooks): Call dwarf2out_begin_function + at the beginning of function, call dwarf2out_var_location for + NOTE_INSN_VAR_LOCATION note. + (struct var_loc_node, struct var_loc_list_def, loclabel_num, + decl_loc_table): New. + (lookup_decl_loc): New function. + (add_var_loc_to_decl): New function. + (based_loc_descr): Added parameter can_use_fbreg, DW_OP_fbreg is used + only if can_use_fbreg. + (mem_loc_descriptor): Added parameter can_use_fbreg, pass it to other + functions. + (loc_descriptor): Likewise. Process VAR_LOCATION. + (concat_loc_descriptor): Call loc_descriptor with can_use_fbreg == true. + (loc_descriptor_from_tree): Call mem_loc_descriptor with + can_use_fbreg == true. + (add_location_or_const_value_attribute): Added parameter enum + dwarf_attribute attr, generate attribute ATTR. Create the location list. + (add_bound_info): Call loc_descriptor with can_use_fbreg == true. + (gen_formal_parameter_die): Call add_location_or_const_value_attribute + with attr == DW_AT_location. + (gen_subprogram_die): Generate the location list for DW_AT_frame_base + if frame_base_decl is defined and has a location list. + (gen_variable_die): Call add_location_or_const_value_attribute with + attr == DW_AT_location. + (dwarf2out_var_location): New function. + (dwarf2out_begin_function): New function. + (dwarf2out_init): Create decl_loc_table. + +2004-02-06 Ulrich Weigand + + * loop.c (force_movables): Transitively increase the priorities of + all insns forces by an insn, not just the first one. + +2004-02-06 Josef Zlomek + Daniel Berlin + + Josef Zlomek + * Makefile.in (var-tracking.o): New. + * common.opt (fvar-tracking): New. + * flags.h (flag_var_tracking): New. + * gengtype.c (adjust_field_rtx_def): NOTE_INSN_VAR_LOCATION was added. + * opts.c (common_handle_option): Add OPT_fvar_tracking. + * print-rtl.c (print_rtx): NOTE_INSN_VAR_LOCATION was added. + * rtl.c (note_insn_name): Likewise. + * rtl.def (VAR_LOCATION): New. + * rtl.h (NOTE_VAR_LOCATION): New. + (NOTE_VAR_LOCATION_DECL): New. + (NOTE_VAR_LOCATION_LOC): New. + (enum insn_note): NOTE_INSN_VAR_LOCATION was added. + (variable_tracking_main): New exported function. + * timevar.def (TV_VAR_TRACKING): New. + * toplev.c (enum dump_file_index): Added DFI_vartrack. + (dump_file): "vartrack" was added (-dV). + (flag_var_tracking): New. + (f_options): "var-tracking" was added. + (rest_of_handle_variable_tracking): New function. + (rest_of_compilation): Run variable tracking. + (process_options): If user has not specified flag_var_tracking set it + according to optimize, debug_info_level and debug_hooks. + * tree.h (frame_base_decl): New. + * var-tracking.c: New file. + * config/ia64/ia64.c (ia64_flag_var_tracking): New variable. + (ia64_override_options): Set flags to run variable tracking in machine + dependent reorg instead of toplev.c. + (ia64_reorg): Run variable tracking if wanted. + * doc/invoke.texi: Mention variable tracking in -dV, + add and -fvar-tracking. + * doc/passes.texi: Added variable tracking pass. + + Daniel Berlin + * debug.h (struct gcc_debug_hooks): Added var_location debug hook. + * dbxout.c (dbx_debug_hooks): Likewise. + (xcoff_debug): Likewise. + * debug.c (do_nothing_debug_hooks): Likewise. + * dwarf2out.c (dwarf2_debug_hooks): Likewise. + * dwarfout.c (dwarf_debug_hooks): Likewise. + * sdbout.c (sdb_debug_hooks): Likewise. + * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. + * final.c (final_scan_insn): Call var_location debug hook for each + NOTE_INSN_VAR_LOCATION. + +2004-02-06 Jan Hubicka + + * flow.c (update_life_info): Allocate reg_deaths when called from + scheudler. + (attempt_auto_inc): Update life ranges accordingly. + +2004-02-06 Ulrich Weigand + + PR debug/11816 + * dwarf2out.c (gen_decl_die): Handle anonymous struct members. + +2004-02-06 Ulrich Weigand + + * cfganal.c (flow_call_edges_add): Never split a libcall block. + +2004-02-06 Daniel Berlin + + * dwarf2out.c (output_loc_list): Don't use deltas if we have + a separate line info table in use. + Use the correct size for terminators. + (output_die): Use offset, not delta. + +2004-02-06 H.J. Lu + + * doc/invoke.texi: Remove the pni option from -mfpmath=. + +2004-02-06 Jan Hubicka + + * recog.c (split_all_insns): Do not update reg info. + * regrename.c (regrename_optimize): Likewise. + * toplev.c (rest_of_handle_reorder_blocks): Likewise. + * flow.c (struct propagate_block_info): Add insn_num field. + (reg_deaths): New array. + (life_analysis): Free reg_deaths info. + (allocate_reg_life_data): Allocate reg_deaths array. + (propagate_one_insn): Use new array. + (init_propagate_block): Initialize it. + (free_propagate_block_info): Finish compuation of + REG_LIVE_LENGTH + (attempt_auto_inc): Sanity check that REG_INFO is not + computed at same time. + (mark_used_regs): Update new array. + + * reg-stack.c (subst_stack_regs): Unshare clobbers before + substitution. + +2004-02-06 Kazu Hirata + + * config/s390/s390.md (*extendsiqi2_short_displ): Change to + *extendqisi2_short_displ. + +2004-02-06 Alan Modra + + * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. + * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. + (emit_library_call_value_1): Likewise pass nargs. + * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. + * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. + * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args + parameter instead of scanning TYPE_ARGS_TYPES to count args. + * config/rs6000/rs6000-protos.h (init_cumulative_args): Update + prototype. + * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. + (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. + (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. + * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to + INIT_CUMULATIVE_ARGS. + * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. + * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, + config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, + config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h, + config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, + config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h, + config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h, + config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h, + config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h, + config/pa/pa.h, config/pdp11/pdp11.h, config/s390/s390.h, + config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, + config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise. + +2004-02-06 Kazu Hirata + + * genemit.c (gen_exp) [CONST_INT]: Use const_int_rtx whenever + possible. + +2004-02-06 Kazu Hirata + + * reload1.c (eliminate_regs_in_insn): If a set has a REG_EQUAL + note containing (plus (reg) (const_int)), where reg is an + eliminable reg, then perform the register elimination without + depending on eliminate_regs(). + +2004-02-06 Kazu Hirata + + * config/arc/arc.c (arc_return_in_memory): Check the return + value of int_size_in_bytes against -1. Don't check + TREE_ADDRESSABLE. + * config/avr/avr.c (avr_return_in_memory): Check the return + value of int_size_in_bytes against -1. + * config/ip2k/ip2k.c (ip2k_return_in_memory): Likewise. + * config/m68hc11/m68hc11.c (m68hc11_return_in_memory): + Likewise. + * config/mcore/mcore.c (mcore_return_in_memory): Likewise. + * config/stormy16/stormy16.c (xstormy16_return_in_memory): + Likewise. + +2004-02-06 Kazu Hirata + + * config/frv/frv-protos.h: Remove the prototype for + frv_setup_incoming_varargs. + * config/frv/frv.c (TARGET_SETUP_INCOMING_VARARGS): New. + (frv_setup_incoming_varargs): Make it static. + * config/frv/frv.h (SETUP_INCOMING_VARARGS): Remove. + +2004-02-06 Kazu Hirata + + * config/fr30/fr30-protos.h: Remove the prototype for + fr30_setup_incoming_varargs. + Update the prototypes for fr30_num_arg_regs and + fr30_function_arg_partial_nregs. + * config/fr30/fr30.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (fr30_setup_incoming_varargs): Make it static. + Add argument second_time. Don't do anything when second_time + is nonzero. + (fr30_num_arg_regs): Change the type of the first argument to + enum machine_mode. + (fr30_function_arg_partial_nregs): Change the type of the + second argument to enum machine_mode. + * config/fr30/fr30.h (STRUCT_VALUE): Remove. + (SETUP_INCOMING_VARARGS): Remove. + +2004-02-06 Kazu Hirata + + * config/arc/arc-protos.h: Remove the prototype for + arc_setup_incoming_varargs. + * config/arc/arc.c (TARGET_ASM_EXTERNAL_LIBCALL): New. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (arc_setup_incoming_varargs): Make it static. + (arc_external_libcall): Likewise. + * config/arc/arc.h (SETUP_INCOMING_VARARGS): Remove. + Remove the commented-out definition of + ASM_OUTPUT_EXTERNAL_LIBCALL. + +2004-02-05 SUGIOKA Toshinobu + + * config/sh/t-linux (SHLIB_INSTALL): Prepend $$(DESTDIR) + to $$(slibdir) in the installation commands. + +2004-02-05 David Edelsohn + + * reload.c (refers_to_regno_for_reload_p): Index hard_regno_nregs + with inner_regno, not regno. + * rtlanal.c (refers_to_regno_p): Same. + +2004-02-05 Kazu Hirata + + * config.gcc: Remove i370 support. + +2004-02-05 Kelley Cook + + * doc/install.texi: Update automake and autoconf version + requirements. Note where to find gcj automake version. + +2004-02-05 Kelley Cook + + * Makefile.in (generate-manpages): Move dependencies to ... + (man): here. + * doc/makefile.texi: Document new targets. + * doc/sourcebuild.texi (Make-lang.in): Document new langhooks. + +2004-02-05 Kelley Cook + + PR/13485 + Makefile.in (srcextra): Add a level of indirection to ... + (gcc.srcextra): ... here. + (po-generated): Delete. + (po/$(PACKAGE).pot: Use srcextra instead of po-generated. Depend on + options.c. + (start.encap): Remove superfluous lang.srcextra dependency. + objc/Make-lang.in (po-generated): Delete. + +2004-02-05 Kazu Hirata + + * config/ia64/ia64.c (REG_GP): Remove. + +2004-02-05 Rainer Orth + + * config/mips/iris5gas.h (PREFERRED_DEBUGGING_TYPE): Define. + +2004-02-05 Devang Patel + + * dwarf2out.c (force_type_die): Look up input type itself + instead of root_type() of type. + +2004-02-05 Andreas Krebbel + + * config/s390/s390.md ("*tmqidi_ext"): New insn. + ("*extendqidi2_short_displ", "*extendsiqi2_short_displ"): Old + pre-reload splitters are transformed to post-reload + define_insn_and_split patterns. + ("*tmqisi_ext"): Renamed old "*tmqi_ext". + +2004-02-05 Kazu Hirata + + * config/cris/cris.h: Replace PROMOTE_PROTOTYPES with + TARGET_PROMOTE_PROTOTYPES. + +2004-02-05 Rainer Orth + + PR middle-end/13750 + Revert: + 2004-01-15 Geoffrey Keating + PR pch/13361 + * c-typeck.c (constructor_asmspec): Delete. + (struct initializer_stack): Delete field 'asmspec'. + (start_init): Delete saving of asmspec. + (finish_init): Don't update constructor_asmspec. + * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. + * stmt.c (expand_asm): Duplicate strings from tree. + (expand_asm_operands): Likewise. + * tree.c (tree_size): Update computation of size of STRING_CST. + (make_node): Don't make STRING_CST nodes. + (build_string): Allocate string with tree node. + * tree.def (STRING_CST): Update comment. + * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. + (tree_string): Place contents of string in tree node. + * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string + from tree. + +2004-02-05 Joseph S. Myers + + * diagnostic.h (DEFINE_DIAGNOSTIC_KIND): Change parameter M to + msgid. + +2004-02-05 Dorit Naishlos + + * config/rs6000/altivec.md (*movv4si_internal): At least one + operand must be altivec_register_operand. + (*movv8hi_internal1): Likewise. + (*movv16qi_internal1): Likewise. + (*movv4sf_internal1): Likewise. + +2004-02-05 David Edelsohn + + * configure.ac (gcc_cv_as_powerpc_mfcrf): Correct test for mfcr. + * configure: Regenerate. + +2004-02-05 Jonathan Wakely + + * doc/install.texi: Update description of --gxx-include-dir to + give correct default value. + +2004-02-05 Kazu Hirata + + * config/h8300/h8300.h (REG_OK_FOR_BASE_NONSTRICT_P): Replace + 8 with MAC_REG. + +2004-02-05 Kazu Hirata + + * config/pa/pa.c (emit_hpdiv_const): Replace gen_rtx with + gen_rtx_PARALLEL. + +2004-02-05 Kazu Hirata + + * emit-rtl.c: Update the comment about the file. + +2004-02-05 Joseph S. Myers + + * sourcebuild.texi (Test Idioms): Update testcase naming + conventions. + +2004-02-04 Per Bothner + + Partially revert/redo 2003-10-01 change; fix -fworking-directory. + * c-ppoutput.c (pp_dir_change): New function. + * c-common.h (pp_dir_change): New declaration. + * cpplib.h (struct cpp_options): Remove working_directory field. + * cppinit.c (cpp_find_main_file, cpp_push_main_file): Merge back to + (cpp_read_main_file): as before 10-01. Call _cpp_stack_file. + Don't handle -fworking_directory here, but in c_common_post_options. + (read_original_directory): Don't back up when done. + Don't clear no-longer used working_directory flag. + * cpplib.h: Update declarations to match. + * c-lex.c (cb_dir_change): Move to c-opts.c. + (init_c_lex): Don't set dir_change callback here, since we want + to set it even if flag_preprocess_only. + * c-opts.c (cb_dir_change): Function moved from c-lex.c. + (c_common_post_options): Set dir_change callback. + Call pp_dir_change if approporiate. + (finish_options): Don't call cpp_find_main_file here. Hence remove + unneeded parameter and result. Do LC_RENAME for . + (c_common_post_options): Call cpp_read_main_file here instead. + (c_common_init): Update accordingly. + (push_command_line_include): Don't cpp_push_main_file. + Do LC_RENAME rather than LC_LEASE to get back to main file. + Compared to pre-10-01 version, inline cpp_rename_to_main_file. + (c_common_parse_file): Call cpp_read_main_file for subsequent main + files, but call finish_options for all files. + * c-opts.c (sanitize_cpp_opts): Don't set cpp_opts->working_directory. + * fix-header.c (read_scan_file): Call cpp_read_main_file instead of + cpp_find_main_file + cpp_push_main_file. + * c-lex.c (fe_file_change): Don't set main_input_filename here. + * opts.c (handle_options): Only set main_input_filename first time. + +2004-02-05 Ian Lance Taylor + + * config/arm/arm.h (REG_CLASS_NAMES): Add missing comma. + +2004-02-04 Geoffrey Keating + + * reload.c (find_equiv_reg): When checking for register overlap, + don't index hard_regno_nregs with a pseudo-reg. + +2004-02-04 Ulrich Weigand + + * config/s390/s390.c (s390_trampoline_template): Remove gen_rtx(). + +2004-02-04 David Edelsohn + + * reload.c (refers_to_regno_for_reload_p): Test regno, not inner_regno, + against FIRST_PSEUDO_REGISTER. + +2004-02-04 Rainer Orth + + * Makefile.in: Move target, host overrides after per-language + fragments. + + * config/mips/t-iris5-as (FORCE_DEBUG_ADAFLAGS): Clear. + (GNATLIBCFLAGS): Remove -g. + +2004-02-04 Kazu Hirata + + * config/alpha/alpha.c, config/arc/arc.c, config/avr/avr.c, + config/i386/i386.c, config/i386/i386.h, config/i386/i386.md, + config/ia64/ia64.c, config/ia64/unwind-ia64.c, + config/m32r/m32r.c, config/ns32k/ns32k.c, config/pa/pa.c, + config/pdp11/pdp11.c, config/rs6000/rs6000.c, + config/sparc/sparc.c, config/vax/vax.c: Revert the + replacements of "FALLTHRU" with "Fall through" done in the + previous patch. + +2004-02-04 Kazu Hirata + + * config/darwin.c, config/darwin.h, config/freebsd-spec.h, + config/arm/arm.c, config/arm/arm.md, + config/cris/cris-protos.h, config/fr30/fr30.c, + config/fr30/fr30.h, config/h8300/h8300.c, config/i386/i386.h, + config/i860/i860.c, config/i860/i860.h, config/ia64/ia64-c.c, + config/ia64/ia64.c, config/ia64/ia64.h, config/ip2k/ip2k.h, + config/ip2k/ip2k.md, config/ip2k/libgcc.S, + config/m32r/linux.h, config/m32r/m32r.c, config/m32r/m32r.h, + config/m68k/m68k.c, config/m68k/netbsd-elf.h, + config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.md, + config/ns32k/netbsd.h, config/ns32k/ns32k.c, + config/ns32k/ns32k.h, config/pdp11/pdp11.h, + config/rs6000/darwin-ldouble.c, config/s390/s390.h, + config/s390/s390.md, config/sparc/netbsd-elf.h, + config/sparc/openbsd.h, config/sparc/sparc.c, + config/xtensa/lib2funcs.S: Fix comment formatting. + +2004-02-04 Kazu Hirata + + * config/alpha/alpha.c, config/arc/arc.c, + config/arm/arm-cores.def, config/arm/arm.c, config/arm/arm.h, + config/arm/arm1026ejs.md, config/arm/arm1136jfs.md, + config/arm/arm926ejs.md, config/arm/vfp.md, config/avr/avr.c, + config/c4x/c4x.c, config/cris/cris.c, config/frv/frv.md, + config/i386/i386.c, config/i386/i386.h, config/i386/i386.md, + config/ia64/ia64.c, config/ia64/unwind-ia64.c, + config/iq2000/iq2000.c, config/m32r/m32r.c, + config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, + config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, + config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c, + config/rs6000/rs6000.h, config/sparc/sparc.c, + config/vax/vax.c: Fix comment typos. Follow spelling + conventions. + +2004-02-04 Kazu Hirata + + * alloc-pool.h, c-convert.c, c-lang.c, c-tree.h, + caller-save.c, df.h, genconfig.c, global.c, lcm.c, + ra-rewrite.c, ra.c, regclass.c, regs.h, resource.c, + sched-rgn.c, config/arm/aof.h, config/arm/cirrus.md, + config/arm/fpa.md, config/arm/iwmmxt.md, + config/arm/netbsd-elf.h, config/arm/netbsd.h, + config/m68hc11/m68hc11.md, config/mips/iris5.h, + config/mn10300/mn10300.md, config/rs6000/altivec.md, + config/sparc/netbsd-elf.h: Update copyright. + +2004-02-04 Eric Botcazou + + * config/sparc/sparc.c (function_arg_pass_by_reference): Return 1 + for all modes whose size is greater than 8 bytes if ARCH32. + (sparc_va_arg): Handle all modes whose size is greater than 8 bytes + by reference if ARCH32. + +2004-02-04 Aldy Hernandez + + * cgraphunit.c (cgraph_postorder): Fix typo in comment. + +2004-02-04 Ulrich Weigand + + * config/s390/s390.md ("*la_64" + peepholes, "reload_indi"): Move + to before adddi3 insn patterns. + ("*la_31" + peepholes, "*la_31_and", "*la_31_and_cc", "force_la_31", + "reload_insi"): Move to before addsi3 insn patterns. + +2004-02-04 Mark Mitchell + + * calls.c (initialize_argument_information): Add CALL_FROM_THUNK_P + parameter. Use it instead of current_function_is_thunk. + * function.h (struct function): Update documentation for is_thunk. + * tree.h (CALL_FROM_THUNK_P): New macro. + * config/alpha/alpha.c (alpha_sa_mask): Do not check + no_new_pseudos when testing current_function_is_thunk. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likeiwse. + +2004-02-04 Kazu Hirata + + * doc/tm.texi: Replace SETUP_INCOMING_VARARGS with + TARGET_SETUP_INCOMING_VARARGS. + +2004-02-04 Kazu Hirata + + * emit-rtl.c (gen_rtx): Remove. + * genattrtab.c: Don't mention gen_rtx in a comment. + * rtl.h: Remove the prototype for gen_rtx. + * doc/md.texi: Replace gen_rtx with gen_rtx_REG. + +2004-02-04 Kazu Hirata + + * config/arc/arc.h, config/fr30/fr30.h + (SETUP_INCOMING_VARARGS): Remove the target-independent + comments. + * doc/tm.texi: Don't mention deprecated target macros. + +2004-02-04 Kazu Hirata + + * config/fr30/fr30.h (FUNCTION_VALUE): Remove the + target-independent comment. + +2004-02-04 Kazu Hirata + + * doc/interface.texi, doc/tm.texi, doc/trouble.texi: Don't + mention deprecated target macros. + +2004-02-04 Kazu Hirata + + * config.gcc: Remove obsolete ports and configurations. + * config/linux-aout.h, config/netware.h, + config/t-linux-gnulibc1, config/d30v/abi, + config/d30v/d30v-protos.h, config/d30v/d30v.c, + config/d30v/d30v.h, config/d30v/d30v.md, + config/d30v/libgcc1.asm, config/d30v/t-d30v, + config/dsp16xx/dsp16xx-modes.def, + config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, + config/dsp16xx/dsp16xx.h, config/dsp16xx/dsp16xx.md, + config/i370/README, config/i370/i370-c.c, + config/i370/i370-protos.h, config/i370/i370.c, + config/i370/i370.h, config/i370/i370.md, config/i370/linux.h, + config/i370/mvs.h, config/i370/oe.h, config/i370/t-i370, + config/i386/freebsd-aout.h, config/i386/linux-aout.h, + config/i386/moss.h, config/i386/netware.h, + config/i386/svr3.ifile, config/i386/svr3dbx.h, + config/i386/svr3gas.h, config/i386/svr3z.ifile, + config/i386/t-udk, config/i386/udk.h, config/i386/vsta.h, + config/i960/i960-c.c, config/i960/i960-coff.h, + config/i960/i960-modes.def, config/i960/i960-protos.h, + config/i960/i960.c, config/i960/i960.h, config/i960/i960.md, + config/i960/rtems.h, config/i960/t-960bare, + config/m68k/hp310.h, config/m68k/hp320.h, + config/m68k/hp320base.h, config/m68k/m68kv4.h, + config/m68k/netbsd.h, config/m68k/sgs.h, config/m68k/t-hp320: + Remove. + * doc/extend.texi, doc/install.texi, doc/invoke.texi, + doc/md.texi: Remove mentions of obsolete ports. + +2004-02-04 Jan Hubicka + + * alias.c (find_base_term, get_addr): Do not dereference NULL + pointer when all VALUE's locations has been invalidated. + (rtx_equal_for_memref_p): Simplify checking of VALUEs. + +2004-02-03 Wolfgang Bangerth + + * doc/invoke.texi (x86 options): Fix spelling/wording. + +2004-02-03 Richard Sandiford + + * config/mips/iris5.h (ASM_OUTPUT_ASCII): Use mips_output_ascii to + put the original string in a comment. + * config/mips/mips-protos.h (mips_output_ascii): Add prefix argument. + * config/mips/mips.c (mips_output_ascii): Likewise. + * config/mips/mips.h (ASM_OUTPUT_ASCII): Adjust accordingly. + +2004-02-03 Kazu Hirata + + * system.h (GIV_SORT_CRITERION): Poison. + * config/avr/avr.h (GIV_SORT_CRITERION): Remove. + * config/ip2k/ip2k.h (GIV_SORT_CRITERION): Likewise. + +2004-02-03 Roger Sayle + + PR target/9348 + * expr.c (expand_expr_real) : When performing widening + multiplies with a multiplication of the wrong signedness, its the + signedness of the multiplication that we've performed that needs to + be passed to expand_mult_highpart_adjust. Avoid emitting a nop-move + if expand_mult_highpart_adjust places the result in target. + +2004-02-03 Richard Henderson + + * varasm.c (const_desc_rtx_sym_eq): Compare symbol strings. + +2004-02-03 J"orn Rennecke + + * config.gcc (sh[234]l): Use little endian fragments. + +2004-02-03 Paul Koning + + * config/pdp11/pdp11-modes.def: Add RESET_FLOAT_FORMAT calls. + * config/pdp11/pdp11-protos.h (legitimate_const_double_p): Add. + * config/pdp11/pdp11.c (encode_pdp11_f, decode_pdp11_f, + encode_pdp11_d, decode_pdp11_d): New functions to handle PDP11 + floating point format. + (pdp11_f_format, pdp11_d_format): New real_format descriptors for + the above functions. + (output_move_quad): Output float values in correct target format. + (legitimate_const_double_p): New function. + * config/pdp11/pdp11.h: Fix typos. + (FLOAT_WORDS_BIG_ENDIAN): Add definition. + (TARGET_FLOAT_FORMAT): Ditto. + (pdp11_f_format, pdp11_d_format): Add external declarations. + (MAX_REGS_PER_ADDRESS): Corrected. + (LEGITIMATE_CONSTANT_P): Use legitimate_const_double_p(). + (PRINT_OPERAND): Output float literals in target format. + +2004-02-03 Mark Mitchell + + PR c++/13975 + * tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and + TI_PRIVATE. + (access_public_node): Redefine. + (access_protected_node): Likewise. + (access_private_node): Likewise. + * tree.c (build_common_tree_nodes): Create access_public_node, + access_protected_node, and access_private_node. + +2004-02-03 Steve Ellcey + + * config/ia64/ia64.h (MASK_INLINE_INT_DIV_LAT): Change value. + (MASK_INLINE_INT_DIV_THR): Ditto. + (MASK_INLINE_SQRT_LAT): Ditto. + (MASK_INLINE_SQRT_THR): Ditto. + (MASK_DWARF2_ASM): Ditto. + (MASK_EARLY_STOP_BITS): Ditto. + +2004-02-02 Paul Brook + + Merge from csl-arm-branch. + + 2004-01-30 Paul Brook + + * aof.h (REGISTER_NAMES): Add vfp reg names + (ADDITIONAL_REGISTER_NAMES): Ditto. + * aout.h (REGISTER_NAMES): Ditto. + (ADDITIONAL_REGISTER_NAMES): Ditto. + * arm-protos.h: Update/Add Prototypes. + * arm.c (init_fp_table): Rename from init_fpa_table. Update users. + Only allow 0.0 for VFP. + (fp_consts_inited): Rename from fpa_consts_inited. Update users. + (values_fp): Rename from values_fpa. Update Users. + (arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa. + Update users. Only check valid constants for this hardware. + (arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users. + Only allow consts for FPA. + (arm_float_add_operand): Rename from fpa_add_operand. Update users. + Only allow consts for FPA. + (use_return_insn): Check for saved VFP regs. + (arm_legitimate_address_p): Handle VFP DFmode addressing. + (arm_legitimize_address): Ditto. + (arm_general_register_operand): New function. + (vfp_mem_operand): New function. + (vfp_compare_operand): New function. + (vfp_secondary_reload_class): New function. + (arm_float_compare_operand): New function. + (vfp_print_multi): New function. + (vfp_output_fstmx): New function. + (vfp_emit_fstm): New function. + (arm_output_epilogue): Output VPF reg restore code. + (arm_expand_prologue): Output VFP reg save code. + (arm_print_operand): Add 'P'. + (arm_hard_regno_mode_ok): Return modes for VFP regs. + (arm_regno_class): Return classes for VFP regs. + (arm_compute_initial_elimination_offset): Include space for VFP regs. + (arm_get_frame_size): Ditto. + * arm.h (FIXED_REGISTERS): Add VFP regs. + (CALL_USED_REGISTERS): Ditto. + (CONDITIONAL_REGISTER_USAGE): Enable VFP regs. + (FIRST_VFP_REGNUM): Define. + (LAST_VFP_REGNUM): Define. + (IS_VFP_REGNUM): Define. + (FIRST_PSEUDO_REGISTER): Include VFP regs. + (HARD_REGNO_NREGS): Handle VFP regs. + (REG_ALLOC_ORDER): Add VFP regs. + (enum reg_class): Add VFP_REGS. + (REG_CLASS_NAMES): Ditto. + (REG_CLASS_CONTENTS): Ditto. + (CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs. + (REG_CLASS_FROM_LETTER): Add 'w'. + (EXTRA_CONSTRAINT_ARM): Add 'U'. + (EXTRA_MEMORY_CONSTRAINT): Define. + (SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs. + (SECONDARY_INPUT_RELOAD_CLASS): Ditto. + (REGISTER_MOVE_COST): Ditto. + (PREDICATE_CODES): Add arm_general_register_operand, + arm_float_compare_operand and vfp_compare_operand. + * arm.md (various): Rename as above. + (divsf3): Enable when TARGET_VFP. + (divdf3): Ditto. + (movdfcc): Ditto. + (sqrtsf2): Ditto. + (sqrtdf2): Ditto. + (arm_movdi): Disable when TARGET_VFP. + (arm_movsi_insn): Ditto. + (movsi): Only split with general regs. + (cmpsf): Use arm_float_compare_operand. + (push_fp_multi): Restrict to TARGET_FPA. + (vfp.md): Include. + * vfp.md: New file. + * fpa.md (various): Rename as above. + * doc/md.texi: Document ARM w and U constraints. + + 2004-01-15 Paul Brook + + * config.gcc: Add with_fpu. Allow with-float=softfp. + * config/arm/arm.c (arm_override_options): Rename *-s to *s. + Break out of loop when we find a float-abi. Fix typo. + * config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu". + Set -mfloat-abi=. + * doc/install.texi: Document --with-fpu. + + 2003-01-14 Paul Brook + + * config.gcc (with_arch): Add armv6. + * config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s. + * config/arm/arm.c (arm_overrride_options): Ditto. + + 2004-01-08 Richard Earnshaw + + * arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT. + (FL_ARCH6): Renamed from FL_ARCH6J. + (arm_arch3m): Renamed from arm_fast_multiply. + (arm_arch6): Renamed from arm_arch6j. + * arm.h: Update all uses of above. + * arm-cores.def: Likewise. + * arm.md: Likewise. + + * arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j, + not arm6j. Add entry for arch armv6. + + 2004-01-07 Richard Earnshaw + + * arm.c (arm_emit_extendsi): Delete. + * arm-protos.h (arm_emit_extendsi): Delete. + * arm.md (zero_extendhisi2): Also handle zero-extension of + non-subregs. + (zero_extendqisi2, extendhisi2, extendqisi2): Likewise. + (thumb_zero_extendhisi2): Only match if not v6. + (arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2) + (thumb_extendhisi2, arm_extendhisi2, arm_extendqisi) + (thumb_extendqisi2): Likewise. + (thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns. + (thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns. + (thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns. + (thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns. + (arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete. + (arm_extendhisi2_reg, arm_extendqisi2_reg): Delete. + (arm_zero_extendhisi2addsi): Remove subreg. Add attributes. + (arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise. + (arm_extendqisi2addsi): Likewise. + + 2003-12-31 Mark Mitchell + + Revert this change: + * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG + + REG addressing modes. + + * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG + + REG addressing modes. + + 2003-12-30 Mark Mitchell + + * config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept + CONSTANT_P_RTX. + + 2003-30-12 Paul Brook + + * longlong.h: protect arm inlines with !defined (__thumb__) + + 2003-30-12 Paul Brook + + * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__. + + 2003-12-30 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Fix typo in previous + change. + + 2003-12-29 Nathan Sidwell + + * builtins.c (expand_builtin_apply_args_1): Add pretend args size + to the virtual incoming args pointer for downward stacks. + + 2003-12-29 Paul Brook + + * config/arm/arm-cores.def: Add cost function. + * config/arm/arm.c (arm_*_rtx_costs): New functions. + (arm_rtx_costs): Remove + (struct processors): Add rtx_costs field. + (all_cores, all_architectures): Ditto. + (arm_override_options): Set targetm.rtx_costs. + (thumb_rtx_costs): New function. + (arm_rtx_costs_1): Remove cases handled elsewhere. + * config/arm/arm.h (processor_type): Add COSTS parameter. + + 2003-12-29 Nathan Sidwell + + * config/arm/arm.md (generic_sched): arm926 has its own scheduler. + (arm926ejs.md): Include it. + * config/arm/arm926ejs.md: New pipeline description. + + 2003-12-24 Paul Brook + + * config/arm/arm.c (arm_arch6j): New variable. + (arm_override_options): Set it. + (arm_emit_extendsi): New function. + * config/arm/arm-protos.h (arm_emit_extendsi): Add prototype. + * config/arm/arm.h (arm_arch6j): Declare. + * config/arm/arm.md: Add sign/zero extend insns. + + 2003-12-23 Paul Brook + + * config/arm/arm.c (all_architectures): Add armv6. + * doc/invoke.texi: Document it. + + 2003-12-19 Paul Brook + + * config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify + insn patterns to match. + * config/arm/arm-generic.md: Ditto. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/amm/iwmmxt.md: Ditto. + * config/arm/arm1026ejs.md: Ditto. + * config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses + for 11_loadb. + + 2003-12-18 Nathan Sidwell + + * config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare. + * config/arm/arm.c (arm_adjust_cost): Check shift cost for + TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG. + (arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep, + arm_no_early_mul_dep): Correctly deal with conditional execution, + parallels and single shift operations. + (arm_no_early_alu_shift_value_dep): Define. + * arm.md (attr type): Replace 'normal' with 'alu', + 'alu_shift' and 'alu_shift_reg'. + (attr core_cycles): Adjust. + (*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3, + *shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0, + *not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp, + *cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0, + *arith_shiftsi_compare0_scratch, *sub_shiftsi, + *sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch, + *if_shift_move, *if_move_shift, *if_shift_shift): Set type + attribute appropriately. + * config/arm/arm1026ejs.md (alu_op): Adjust. + (alu_shift_op, alu_shift_reg_op): New. + * config/arm/arm1136.md: Add better bypasses for early + registers. Remove load[234] and store[234] bypasses. + (11_alu_op): Adjust. + (11_alu_shift_op, 11_alu_shift_reg_op): New. + + 2003-12-15 Nathan Sidwell + + * config/arm/arm-protos.h (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare. + * config/arm/arm.c (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define. + * config/arm/arm1026ejs.md: Add load-store bypass. + * config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles. + Add bypasses between instructions. + + 2003-12-10 Paul Brook + + * config/arm/arm.c (arm_fpu_model): New variable. + (arm_fload_abi): New variable. + (target_fpe_name): Rename from target_fp_name. + (target_fpu_name): New variable. + (arm_is_cirrus): Remove. + (fpu_desc): New struct. + (all_fpus): Define. + (pf_model_for_fpu): Define. + (all_loat_abis): Define. + (arm_override_options): Set fp arch flags based on -mfpu= + and -float-abi=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (*): Use new TARGET_* flags. + * config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove. + (TARGET_HARD_FLOAT): No longer implies TARGET_FPA. + (TARGET_SOFT_FLOAT): Ditto. + (TARGET_SOFT_FLOAT_ABI): New. + (TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies + TARGET_HARD_FLOAT. + (TARGET_VFP): No longer implies TARGET_HARD_FLOAT. + (TARGET_OPTIONS): Add -mfpu=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (arm_pf_model): Define. + (arm_float_abi_type): Define. + (fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE + * config/arm/arm.md: Use new TARGET_* flags. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=. + * config/arm/semi.h (ASM_SPEC): Ditto. + * config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp. + (FPUTYPE_DEFAULT): Set to VFP. + * doc/invoke.texi: Document -mfpu= and -mfloat-abi=. + + 2003-11-22 Phil Edwards + + PR target/12476 + * config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use + 'bx' instead of 'b' to avoid branch range restrictions. Output + the thunk immediately before the thunked-to function. + * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit + .thumb_func if a thunk is being generated. Emit .code 16 along + with .thumb_func if a thunk is not being generated. + + 2003-11-15 Nicolas Pitre + + * config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3, + arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns. + * config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3. + (lshrdi3_iwmmxt): Renamed from lshrdi3. + * config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly. + + 2003-11-12 Steve Woodford + Ian Lance Taylor + + * config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new + code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__). + + 2003-11-05 Phil Edwards + + * config/arm/arm.md (insn): Add new V6 instruction names. + (generic_sched): New attr. + * config/arm/arm-generic.md: Use generic_sched here. + * config/arm/arm1026ejs.md: Do not model fetch/issue/decode + stages of pipeline. Adjust latency counts accordingly. + * config/arm/arm1136jfs.md: New file. + + 2003-10-28 Mark Mitchell + + * config/arm/arm.h (processor_type): New enumeration type. + (CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S, + ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores. + (CPP_CPU_ARCH_SPEC): Likewise. + * config/arm/arm.c (arm_tune): New variable. + (all_cores): Use cores.def. + (all_architectures): Add representative processor. + (arm_override_options): Restructure way in which tuning + information is deduced. + * arm.md: Update "insn" and "type" attributes throughout. + (insn): New attribute. + (type): Compute "mult" from "insn" attribute. Add load2, + load3, load4 alternatives. + (arm automaton): Move to arm-generic.md. + * config/arm/arm-cores.def: New file. + * config/arm/arm-generic.md: Likewise. + * config/arm/arm1026ejs.md: Likewise. + +2004-02-03 Eric Botcazou + + * doc/invoke.texi (SPARC options): Remove -mflat and + all -mxxx (xxx:chip) options. + * config/sparc/aout.h (DBX_REGISTER_NUMBER): Delete. + * config/sparc/litecoff.h (DBX_REGISTER_NUMBER): Likewise. + * config/sparc/netbsd-elf.h (DBX_REGISTER_NUMBER): Likewise. + * config/sparc/sol2.h (DBX_REGISTER_NUMBER): Likewise. + * config/sparc/sparc-protos.h: Delete sparc_flat_* prototypes. + * config/sparc/sparc.c: Likewise. + (sparc_output_function_prologue): Remove TARGET_FLAT handling. + (sparc_nonflat_function_prologue): Rename into sparc_function_prologue. + (sparc_output_function_epilogue): Remove TARGET_FLAT handling. + (sparc_nonflat_function_epilogue): Rename into sparc_function_epilogue. + (struct sparc_frame_info, current_frame_info, zero_frame_info): Delete. + (sparc_flat_must_save_register_p): Likewise. + (sparc_flat_compute_frame_size): Likewise. + (sparc_flat_save_restore): Likewise. + (sparc_flat_function_prologue): Likewise. + (sparc_flat_function_epilogue): Likewise. + (sparc_flat_epilogue_delay_slots): Likewise. + (sparc_flat_eligible_for_epilogue_delay): Likewise. + (sparc_function_ok_for_sibcall): Remove TARGET_FLAT handling. + * config/sparc/sparc.h (MASK_FLAT, TARGET_FLAT): Delete. + (TARGET_SWITCHES): Remove -mflat and all -mxxx (xxx:chip) options. + (SPARC_INCOMING_INT_ARG_FIRST): Remove TARGET_FLAT handling. + (CONDITIONAL_REGISTER_USAGE): Likewise. + (FRAME_POINTER_REQUIRED): Likewise. + (INITIAL_ELIMINATION_OFFSET): Likewise. + (BASE_RETURN_VALUE_REG): Likewise. + (BASE_OUTGOING_VALUE_REG): Likewise. + (BASE_PASSING_ARG_REG): Likewise. + (BASE_INCOMING_ARG_REG): Likewise. + (INCOMING_REGNO): Likewise. + (OUTGOING_REGNO): Likewise. + (LOCAL_REGNO): Likewise. + (DELAY_SLOTS_FOR_EPILOGUE): Likewise. + (ELIGIBLE_FOR_EPILOGUE_DELAY): Likewise. + (EPILOGUE_USES): Likewise. + * config/sparc/sparc.md ("isa" attribute): Change "v6" into "v7". + ("flat" attribute): Delete. + (do_builtin_setjmp_setup): Remove TARGET_FLAT and "flat" attribute + handling. + (call followed by jump define_peephole's): Delete. + (exception_receiver): Likewise. + (builtin_setjmp_receiver): Likewise. + * config/sparc/t-sparclite (MULTILIB_OPTIONS): Remove -mflat. + +2004-02-03 Paolo Bonzini + + PR c/11658 + PR c/13994 + * Makefile.in (c-parse.o, c-convert.o, c-typeck.o): Depend + on langhooks.h. + * objc/Make-lang.in (objc-parse.o): Depend on langhooks.h. + * c-parse.in, c-convert.c, c-typeck.c, objc/objc-act.c: + Include langhooks.h. Replace c_common_truthvalue_conversion + with the truthvalue_conversion language hook throughout. + (expr_no_commas): Call default_conversion before save_expr + for the first term of the production 'x ? : y'. + * c-common.c (c_common_truthvalue_conversion): Remove + obsolete block. Invoke recursively the hook instead + of this function. + * c-convert.c (convert): handle ERROR_MARK_NODE. + * c-typeck.c (build_binary_op): handle ERROR_MARK_NODE + returned by the truthvalue_conversion language hook. + * c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use + c_objc_common_truthvalue_conversion. + * c-objc-common.c (c_objc_common_truthvalue_conversion): + New function. + * c-tree.h (c_objc_common_truthvalue_conversion): Declare it. + * objc/objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use + c_objc_common_truthvalue_conversion. + +2004-02-03 Kazu Hirata + + * config/c4x/c4x.h (FUNCTION_VALUE): Use gen_rtx_REG instead + of gen_rtx. + (LIBCALL_VALUE): Likewise. + * config/ip2k/ip2k.c (mdr_try_propagate_clr_sequence): Use + gen_rtx_CC0 instead of gen_rtx. + * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Use + gen_rtx_fmt_e and gen_rtx_fmt_ee instead of gen_rtx. + (m68hc11_expand_compare): Use gen_rtx_fmt_ee instead of + gen_rtx. + (m68hc11_emit_logical): Likewise. + +2004-02-03 Kazu Hirata + + * config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, + config/fr30/fr30.md, config/frv/frv.c, config/frv/frv.md, + config/h8300/h8300.c, config/ia64/ia64.c, config/ip2k/ip2k.md, + config/m32r/m32r.md, config/m68hc11/m68hc11.c, + config/mips/mips.md, config/mmix/mmix.c, + config/mn10300/mn10300.c, config/mn10300/mn10300.md, + config/ns32k/ns32k.c, config/pa/pa.md, config/pdp11/pdp11.c, + config/rs6000/altivec.md, config/s390/s390.c, + config/s390/s390.h, config/s390/s390.md, config/sh/sh.c, + config/sh/sh.h, config/sh/sh.md, config/stormy16/stormy16.c: + Use const0_rtx instead of GEN_INT (0). Do the same for other + constants that are readily available. + +2004-02-03 Kazu Hirata + + * doloop.c, optabs.c, regmove.c, sched-deps.c, + config/i386/i386.c, config/i386/i386.md: Use const0_rtx + instead of GEN_INT (0). Do the same for other constants that + are readily available. + +2004-02-03 Kazu Hirata + + * combine.c (simplify_set): Use gen_rtx_fmt_e instead of + gen_rtx. + * emit-rtl.c (init_emit_once): Use gen_rtx_PC and gen_rtx_CC0 + instead of gen_rtx. + * reload1.c (init_elim_table): Use gen_rtx_fmt_e instead of + gen_rtx. + * config/ns32k/ns32k.md (udivmodhi4): Use gen_rtx_IOR and + gen_rtx_ASHIFT instead of gen_rtx. + (udivmodqi4): Likewise. + +2004-02-02 Richard Henderson + + PR target/13789 + * expr.c (store_expr): Use force_operand before emit_move_insn. + +2004-02-02 Jeff Law + Roger Sayle + + * tree.c (commutative_tree_code, associative_tree_code): New + functions. + (iterative_hash_expr): Use commutative_tree_code. + * tree.h (commutative_tree_code, associative_tree_code): Declare. + * fold-const.c (operand_equal_p): Use commutative_tree_code + rather than inlining the commutativity check. + (fold): Likewise. + +2004-02-02 Kazu Hirata + + * system.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Poison. + * config/frv/frv-protos.h: Remove the prototype for + frv_function_arg_keep_as_reference. + * config/frv/frv.c (frv_function_arg_keep_as_reference): + Remove. + * config/frv/frv.h (FUNCTION_ARG_KEEP_AS_REFERENCE): Likewise. + * config/stormy16/stormy16.h: Remove the commented-out + definition of FUNCTION_ARG_KEEP_AS_REFERENCE. + +2004-02-03 Alan Modra + + PR target/13914 + * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Use ap + for retaddr_column. + +2004-02-02 Kazu Hirata + + * genemit.c (gen_exp): Generate gen_rtx_fmt_e* instead of + gen_rtx. + +2004-02-02 Eric Christopher + Zack Weinberg + + * c-opts.c (c_common_handle_option): Add -finput-charset. + * c.opt: Ditto. + * cppcharset.c (one_iso88591_to_utf8): Remove. + (convert_iso88591_utf8): Ditto. + (conversion_tab): Remove 8859-1 converter. + (_cpp_input_to_utf8): Remove. + (_cpp_init_iconv_buffer): Ditto. + (_cpp_close_iconv_buffer): Ditto. + (_cpp_convert_input): New function. + (_cpp_default_encoding): Ditto. + * cpphash.h: Add/remove prototypes for above. + * cppfiles.c (read_file_guts): Use _cpp_convert_input. + * cppinit.c (cpp_create_reader): Use _cpp_default_encoding + for narrow execution and input character sets. + * cpplib.c (cpp_push_buffer): Delete uses of removed functions. + * doc/cppopts.texi: Document -finput-charset. + +2004-02-02 David Edelsohn + + * rtlanal.c (refers_to_regno_p): Test regno, not inner_regno, + against FIRST_PSEUDO_REGISTER. + +2004-02-02 Eric Botcazou + + * doc/invoke.texi (SPARC options): Further improve. + +2004-02-02 Kazu Hirata + + * config/arm/arm.md, config/c4x/c4x.md, config/cris/cris.md, + config/h8300/h8300.c, config/ip2k/ip2k.md, + config/iq2000/iq2000.c, config/mips/mips.c, + config/rs6000/rs6000.c, config/rs6000/rs6000.md, + config/sh/sh.c, config/sh/sh.md, config/stormy16/stormy16.c, + config/v850/v850.md: Fix indentation. + +2004-02-02 Eric Botcazou + + * config/sparc/sparc.c (function_arg_slotno): Align TImode + arguments on a 16-byte boundary in the parameter array if ARCH64. + Split handling of TFmode. + +2004-02-02 Paolo Bonzini + + * rtlanal.c (reg_overlap_mentioned_p) [!ENABLE_CHECKING]: + Don't test CONSTANT_P (x). + (reg_overlap_mentioned_p): Merge check for STRICT_LOWPART, + ZERO_EXTRACT, SIGN_EXTRACT with the switch statement. + Fix misindentation. + +2004-02-02 Eric Botcazou + + * doc/invoke.texi (SPARC options): Document that -mflat is deprecated. + +2004-02-02 Kazu Hirata + + * config/arc/arc.md, config/arm/arm.c, config/arm/arm.md, + config/c4x/c4x.c, config/c4x/c4x.md, config/cris/cris.md, + config/frv/frv.c, config/h8300/h8300.c, config/ip2k/ip2k.md, + config/iq2000/iq2000.c, config/m32r/m32r.c, + config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.md, + config/mn10300/mn10300.c, config/rs6000/rs6000.c, + config/rs6000/rs6000.md, config/sh/sh.c, config/sh/sh.md, + config/stormy16/stormy16.c, config/v850/v850.md, + config/xtensa/xtensa.c: Replace gen_rtx with gen_rtx_fmt_e*. + +2004-02-01 Kazu Hirata + + * config/mcore/mcore.c (block_move_sequence): Replace + gen_rtx_CONST_INT with GEN_INT. + +2004-02-02 Jan Hubicka + + * alias.c (record_set): Use hard_regno_nregs. + * bt-load.c (find_btr_reference, note_btr_set): Likewise. + * builtins.c (apply_args_size): Likewise. + * caller-save.c (setup_save_areas, save_call_clobbered_regs, + mark_set_regs, add_stored_regs, mark_referenced_regs, + insert_restore, insert_save, insert_one_insn): Likewise. + * cfgcleanup.c: Include regs.h + (mark_effect, mentions_nonequal_regs): Likewise. + * cfgrtl.c (mark_killed_regs): Likewise + * combine.c (update_table_tick, record_value_for_reg, + record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, + reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, + reg_bitfield_target_p, distribute_notes): Likewise. + * cse.c (mention_regs, insert, invalidate, invalidate_for_call, + exp_equiv_p, cse_insn): Likewise. + * cselib.c (cselib_lookup): Likewise. + (cselib_invalidate_regno, cselib_record_set): Likewise. + * df.c (df_ref_record): Likewise. + * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): + Likewise. + * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, + count_or_remove_death_notes_bb): Likewise. + * function.c (aggregate_value_p, keep_stack_depressed): Likewise. + * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, + mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. + * integrate.c (mark_stores): Likewise. + * jump.c (delete_prior_computation): Likewise. + * lcm.c (reg_dies, reg_becomes_live): Likewise. + * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. + * loop.c (LOOP_REGNO_NREGS): Likewise. + * postreload.c (reload_combine, reload_combine_note_store, + reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. + * ra-colorize.c (combine, color_usable_p, get_free_reg, + calculate_dont_begin, calculate_dont_begin, colorize_one_web, + try_recolor_web, insert_coalesced_conflicts, check_colors, + break_precolored_alias): Likewise. + * ra-debug.c: Include regs.h + (ra_print_rtx_object): Likewise. + * ra-rewrite (choose_spill_colors): Likewise. + (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. + * ra.c (init_ra): Likewise. + * recog.c (reg_fits_class_p, peep2_reg_dead_p, + peep2_find_free_register): Likewise. + * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. + * regclass.c (hard_regno_nregs): New array. + (init_reg_modes_once): Initialize it. + (choose_hard_reg_mode): Use it. + (record_reg_classes): Likewise. + * regmove.c (mark_flags_life_zones): Likewise. + * regrename.c (note_sets, clear_dead_regs, regrename_optimize, + scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, + copy_value, maybe_mode_change, find_oldest_value_reg, + copyprop_hardreg_forward_1): + * regs.h (hard_regno_nregs): Declare. + * realod.c (reload_inner_reg_of_subreg): Use it. + (push_reload, combine_reloads, find_dummy_reload, + hard_reg_set_here_p, operands_match_p, decompose, find_reloads, + refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, + reload_adjust_reg_for_mode): Likewise. + * reload1.c (compute_use_by_pseudos, count_pseudo, + count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, + spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, + clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p + allocate_reload_reg, choose_reload_regs, emit_reload_insns, + delete_output_reload): Likewise. + * resource.c (update_live_status, mark_referenced_resources, + mark_set_resources, mark_target_live_regs): Likewise. + * rtlanal.c: Include regs.h + (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, + dead_or_set_regno_p, find_regno_note, find_reg_fusage, + subreg_regno_offset, subreg_offset_representable_p, + hoist_test_store): Likewise. + * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. + * sched-rgn.c (check_live_1, update_live_1): Likewise. + * stmt.c: Include regs.h + (decl_conflicts_with_clobbers_p): Likewise. + * varasm.c (make_decl_rtl): Likewise. + * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. + +2004-02-01 Kazu Hirata + + * config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, + config/arm/linux-gas.h, config/arm/netbsd-elf.h, + config/arm/netbsd.h, config/arm/pe.c, config/avr/avr.c, + config/avr/avr.h, config/avr/avr.md, config/c4x/c4x.h, + config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.c, + config/frv/frv.h, config/ip2k/ip2k.c, config/iq2000/iq2000.c, + config/iq2000/iq2000.h, config/m32r/m32r.c, + config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, + config/m68hc11/m68hc11.md, config/m68k/m68k.md, + config/mcore/mcore.c, config/mcore/mcore.h, + config/mcore/mcore.md, config/mips/mips.c, + config/ns32k/ns32k.h, config/ns32k/ns32k.md, + config/rs6000/rs6000.c, config/s390/s390.c, + config/s390/s390.md, config/sparc/sparc.c, config/v850/v850.c, + config/xtensa/xtensa.h, config/xtensa/xtensa.md: Replace + "gen_rtx (FOO, " with "gen_rtx_FOO (". + +2004-02-01 Kazu Hirata + + * config/h8300/h8300.md (two peephole2's): New. + +2004-02-01 Eric Botcazou + + * config/sparc/sol2-bi.h: Handle TARGET_CPU_ultrasparc3. + (CPP_CPU_SPEC): Handle -mcpu=ultrasparc3. + (ASM_CPU_SPEC): Likewise + * config/sparc/sol2.h: Handle TARGET_CPU_ultrasparc3. + (ASM_CPU_SPEC): Remove -mcpu=v8plus. Handle -mcpu=ultrasparc3. + +2004-02-01 Roger Sayle + + * builtins.c (expand_builtin_pow): If flag_unsafe_math_optimizations + isn't set, don't call expand_builtin_mathfn_2 to use the pow optab. + (expand_builtin): Always call expand_builtin_pow. + +2004-02-01 Roger Sayle + + * builtins.def (BUILT_IN_SIGNBIT, BUILT_IN_SIGNBITF, + BUILT_IN_SIGNBITL): New GCC builtins. + * builtins.c (expand_builtin_signbit): New function to RTL expand + calls to signbit, signbitf and signbitl as inline intrinsics. + (expand_builtin): Call expand_builtin_signbit for BUILT_IN_SIGNBIT*. + (fold_builtin_signbit): New function to perform constant folding + of signbit, signbitf and signbitl. + (fold_builtin): Call fold_builtin_signbit for BUILT_IN_SIGNBIT*. + + * doc/extend.texi: Document new signbit{,f,l} builtins. + +2004-02-01 Richard Sandiford + + * config/mips/mips.md (adddi3_internal_2): Remove superfluous %s. + +2004-02-01 Chris Demetriou + + * config/mips/mips.h (PREDICATE_CODES): Remove entries for + "mips_const_double_ok" and "simple_memory_operand", which were + removed from the MIPS port with the mips-3_4-rewrite branch merge. + * config/mips/mips.c (mips16_lay_out_constants): Update comment + for removal of simple_memory_operand. + +2004-01-31 Kazu Hirata + + * config/c4x/c4x.md: Use GEN_INT instead of + gen_rtx (CONST_INT, ...). + +2004-01-31 Richard Henderson + + * varasm.c (output_constant_pool): Don't zap the pool. + +2004-01-31 Kazu Hirata + + * genrecog.c (decision_type): Add DT_const_int. + (write_cond) [DT_const_int]: Print a comparison against small + constant. + (write_node): Simplify comparisons against small constants + before printing tests. + +2004-01-31 Kazu Hirata + + * config/m32r/m32r.c (m32r_load_pic_register): Use GEN_INT + instead of gen_rtx_CONST_INT. + +2004-01-31 Kazu Hirata + + * config/xtensa/xtensa.h (DYNAMIC_CHAIN_ADDRESS): Use GEN_INT + instead of gen_rtx_CONST_INT. + +2004-01-31 Kazu Hirata + + * target-def.h (TARGET_STRICT_ARGUMENT_NAMING): Define as + hook_bool_CUMULATIVE_ARGS_false. + * targhooks.c (default_strict_argument_naming): Rename to + hook_bool_CUMULATIVE_ARGS_false. + * targhooks.h: Update the prototype for + default_strict_argument_naming. + +2004-01-31 Kazu Hirata + + * config/sh/sh.c: Replace "gen_rtx (FOO, " with "gen_rtx_FOO (". + * config/sh/sh.h: Likewise. + * config/sh/sh.md: Likewise. + +2004-01-31 Eric Botcazou + + * doc/invoke.texi (SPARC options): Restructure and update. + +2004-01-31 Kazu Hirata + + * system.h (PROMOTE_FUNCTION_ARGS, STRUCT_VALUE_INCOMING, and + STRICT_ARGUMENT_NAMING): Poison. + * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS): Define as + hook_bool_tree_false. + * targhooks.c (default_promote_function_args): Remove. + (default_struct_value_rtx): Don't use STRUCT_VALUE_INCOMING. + Don't check incoming. + (default_strict_argument_naming): Don't use + STRICT_ARGUMENT_NAMING. + * targhooks.h: Remove the prototype for + default_promote_function_args. + +2004-01-31 Kazu Hirata + + * config/i386/i386-protos.h: Remove the prototype for + ix86_setup_incoming_varargs. + * config/i386/i386.c (TARGET_SETUP_INCOMING_VARARGS): New. + (ix86_setup_incoming_varargs): Make it static. + * config/i386/i386.h (SETUP_INCOMING_VARARGS): Remove. + +2004-01-31 Kazu Hirata + + * alloc-pool.c: Fix comment typos. + * builtin-types.def: Likewise. + * builtins.def: Likewise. + * c-pretty-print.c: Likewise. + * df.h: Likewise. + * reload1.c: Likewise. + +2004-01-31 Kazu Hirata + + * doc/invoke.texi: Follow spelling conventions. + * doc/tm.texi: Likewise. + +2004-01-31 Kazu Hirata + + * doc/install.texi: Fix typos. + * doc/invoke.texi: Likewise. + +2004-01-31 Ulrich Weigand + + * config/s390/s390.c (s390_decompose_address): Do not treat virtual + registers as pointers. + * config/s390/s390.md ("*la_31" second peephole2): Fix incorrect mode. + +2004-01-31 Paolo Bonzini + + * combine.c (cse_main): Set gen_lowpart to gen_lowpart_for_combine + and restore it to gen_lowpart_general on exit. + (gen_lowpart_for_combine): Adjust all callers to go through + gen_lowpart. + * cse.c (cse_main): Set gen_lowpart to gen_lowpart_if_possible + and restore it to gen_lowpart_general on exit. + (gen_lowpart_if_possible): Adjust all callers to go through + gen_lowpart. + * emit-rtl.c (gen_lowpart_general): New name of gen_lowpart. + (gen_lowpart): Declare as pointer to function, initialized to + gen_lowpart_general. + * rtl.h (gen_lowpart): Declare as pointer to function. + +2004-01-31 Kazu Hirata + + * bt-load.c: Replace "gen_rtx (FOO, " with "gen_rtx_FOO (". + * calls.c: Likewise. + * emit-rtl.c: Likewise. + * function.c: Likewise. + * reload1.c: Likewise. + * config/i386/cygming.h: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/winnt.c: Likewise. + +2004-01-30 Dara Hazeghi + + PR bootstrap/9249 + * doc/install.texi: document --enable-__cxa_atexit option. + * configure.ac: Disable __cxa_atexit if not supported. + * configure: Regenerate. + +2004-01-30 Daniel Berlin + + * ggc-zone.c (ggc_free): New function. + +2004-01-30 Kazu Hirata + + alloc-pool.c, c-lex.c, c-pragma.h, c-semantics.c, cfghooks.c, + cfghooks.h, cfglayout.c, cfgloopmanip.c, debug.c, debug.h, + flow.c, genextract.c, ggc-common.c, ggc-page.c, ggc.h, + ifcvt.c, jump.c, loop-unswitch.c, timevar.c, timevar.def, + tree-optimize.c, vmsdbgout.c, config/fp-bit.c, + config/alpha/alpha.c, config/alpha/alpha.h, + config/alpha/alpha.md, config/alpha/unicosmk.h, + config/alpha/vms.h, config/arm/linux-elf.h, config/avr/avr.c, + config/c4x/c4x-protos.h, config/c4x/c4x.md, + config/d30v/d30v.h, config/frv/frv.md, config/frv/frvbegin.c, + config/frv/frvend.c, config/i386/cygming.h, + config/i386/djgpp.h, config/i386/emmintrin.h, + config/i386/gthr-win32.c, config/i386/i386-interix.h, + config/i386/i386-protos.h, config/i386/openbsd.h, + config/i386/winnt.c, config/i386/xm-mingw32.h, + config/i386/xmmintrin.h, config/ia64/ia64.md, + config/iq2000/iq2000.md, config/m32r/m32r.md, + config/m68k/m68k.md, config/mcore/mcore-elf.h, + config/mcore/mcore.md, config/mips/elf.h, config/mips/elf64.h, + config/mips/iris5gas.h, config/mips/iris6.h, + config/mips/iris6gas.h, config/mips/linux.h, + config/mips/mips.md, config/mips/netbsd.h, + config/mips/openbsd.h, config/mips/windiss.h, + config/pa/fptr.c, config/rs6000/aix.h, + config/rs6000/altivec.h, config/rs6000/darwin.h, + config/rs6000/xcoff.h, config/s390/s390-protos.h, + config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, + config/sh/netbsd-elf.h, config/sh/sh.h, config/sh/vxworks.h, + config/sparc/sol2.h: Update copyright. + +2004-01-30 Kelley Cook + + * Makefile.in (abs_docdir, abs_srcdir): Define. + (doc/%.dvi, doc/gccinstall.dvi): Use $(abs_docdir). + +2004-01-30 Kazu Hirata + + * genconfig.c (main): Have CC0_P check its operand even on a + target without cc0. + +2004-01-30 Kazu Hirata + + * config/alpha/alpha.c: Remove mentions of deprecates macros + in comments, remove some target-independent comments about target + macros, and/or add minimal function comments for target hook + implementations. + * config/avr/avr.c: Likewise. + * config/ia64/ia64.h: Likewise. + * config/ip2k/ip2k.c: Likewise. + * config/iq2000/iq2000.c: Likewise. + * config/m32r/m32r.h: Likewise. + * config/m68hc11/m68hc11.c: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mmix/mmix.c: Likewise. + * config/mn10300/mn10300.c: Likewise. + * config/pa/pa.c: Likewise. + * config/pdp11/pdp11.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + * config/sparc/sparc.c: Likewise. + * config/sparc/sparc.h: Likewise. + * config/stormy16/stormy16.c: Likewise. + * config/xtensa/xtensa.c: Likewise. + +2004-01-30 Ulrich Weigand + + PR optimization/12147 + * reload1.c (reload_reg_free_p): RELOAD_OTHER conflicts with + RELOAD_FOR_OPADDR_ADDR. + (reload_reg_reaches_end_p): RELOAD_FOR_OTHER_ADDRESS register + might be reused as RELOAD_FOR_OPADDR_ADDR register. + +2004-01-30 Jan Hubicka + + * reload.c (get_secondary_mem): Fix updating of + secondary_memlocs_elim_used. + +2004-01-30 Richard Henderson + + * varasm.c (struct rtx_const, struct pool_constant): Remove. + (MAX_RTX_HASH_TABLE): Remove. + (const_rtx_hash_table, const_rtx_sym_hash_table): Remove. + (first_pool, last_pool, pool_offset): Remove. + (struct rtx_constant_pool): Split out from ... + (struct varasm_status): ... here. Reference one via pointer. + (struct constant_descriptor_rtx): Merge struct pool_constant. + (SYMHASH): Remove. + (decode_rtx_const): Remove. + (const_hash_rtx, compare_constant_rtx): Remove. + (record_constant_rtx): Remove. + (const_desc_rtx_hash, const_desc_rtx_eq): New. + (const_desc_rtx_sym_hash, const_desc_rtx_sym_eq): New. + (const_rtx_hash_1, const_rtx_hash): New. + (init_varasm_status): Allocate a rtx_constant_pool, and its hashes. + (simplify_subtraction): Use simplify_rtx. + (force_const_mem): Rewrite to use new data structures. + (find_pool_constant): Likewise. + (get_pool_constant, get_pool_constant_mark, + get_pool_constant_for_function, get_pool_mode, + get_pool_mode_for_function, get_pool_offset, get_pool_size): Likewise. + (output_constant_pool_2): Split out from output_constant_pool. + (output_constant_pool_1): Likewise. Use new pool datastructures. + (output_constant_pool): Zap entire pool datastructure. + (mark_constant): Use new pool datastructures. + (mark_constants): Use for_each_rtx. + (mark_constant_pool): Use new pool datastructures. + +2004-01-30 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_emit_move): Remove #if 0. + Copy operands[1] to pseudo for simplify_gen_subreg. + +2004-01-30 Kazu Hirata + + * gcse.c (bypass_block): Fix a typo in the previous check-in + to the file. + +2004-01-30 Andrew Pinski + + * toplev.c: Include alloc-pool.h. + * Makefile.in (toplev.c): Update dependencies. + +2004-01-30 Richard Kenner + + * combine.c (simplify_shift_const, case XOR): Be careful when + commuting XOR with ASHIFTRT. + +2004-01-30 Kazu Hirata + Eric Botcazou + + * config/sparc/sparc-protos.h: Remove the prototype for + sparc_builtin_saveregs. + * config/sparc/sparc.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + (TARGET_STRICT_ARGUMENT_NAMING): Likewise. + (sparc_builtin_saveregs): Make it static. + (sparc_promote_prototypes): New. + (sparc_struct_value_rtx): Likewise. + (sparc_return_in_memory): Likewise. + * config/sparc/sparc.h: (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Likewise. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + (STRUCT_VALUE_INCOMING): Likewise. + (EXPAND_BUILTIN_SAVEREGS): Likewise. + (STRICT_ARGUMENT_NAMING): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + + * config/sparc/sparc.h (PROMOTE_MODE): Use word_mode. + +2004-01-30 Eric Botcazou + + PR c/12818 + * varasm.c (const_hash_1) : Use the + address to compute the hash value if flag_writable_strings. + (compare_constant) : Compare the addresses + if flag_writable_strings. + (build_constant_desc): Do not copy the expression for a + STRING_CST if flag_writable_strings. + +2004-01-30 Jan Hubicka + + * alloc-pool.c: Include hashtab.h + (alloc_pool_descriptor): New structure + (alloc_pool_hash): New global variable. + (hash_descriptor, eq_descriptor, alloc_pool_descriptor): New. + (create_alloc_pool): Update statistics. + (free_alloc_pool): Likewise. + (pool_alloc): Likewise. + (output_info): New structure + (print_statistics, dump_alloc_pool_statistics): New function. + * alloc-pool.h (alloc_pool_def): Turn name to be constant. + (dump_alloc_pool_statistics): Declare. + * toplev.c (finalize): Dump statistics. + + * reload.c (secondary_memlocs_elim_used): New static variable. + (get_secondary_mem): Update it. + (find_reloads): Use it. + +2004-01-30 Steven Bosscher + + * toplev.c: Fix broken checkin of 2003-12-30, again. + +2004-01-30 Ulrich Weigand + + * configure.ac (gcc_cv_as_dwarf2_debug_line): Enable test for + s390*-*-* targets by specifying a 'nop' insn. + * configure: Regenerate. + +2004-01-30 Eric Botcazou + + PR target/11475 + * config/sparc/sparc.md (movhi_lo_sum): Tighten predicates. + +2004-01-29 Jakub Jelinek + + * emit-rtl.c (change_address): Use XEXP (memref, 0) instead + of addr when creating MEM copy. + +2004-01-29 Devang Patel + + * dwarf2out.c (gen_field_die): Do not equate decl number to die. + +2004-01-28 Ian Lance Taylor + + PR inline-asm/6162 + * reload.c (find_reloads): Only support one pair of commutative + operands. + +2004-01-29 Roger Sayle + + PR java/13824 + * tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially + as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded + recursion. + +2004-01-29 Kazu Hirata + + * config/frv/frv.c: Don't mention deprecated macros in + comments. Remove some target-independent comments about + target macros. + * config/frv/frv.h: Likewise. + +2004-01-29 Zdenek Dvorak + + * cfghooks.c (split_block): Set probability and count of the + new edge. + +2004-01-29 Josef Zlomek + + * dwarf2out.c (struct die_struct): Added field decl_id. + (decl_die_table): Changed to hash table. + (decl_die_table_allocated): Deleted. + (decl_die_table_in_use): Deleted. + (DECL_DIE_TABLE_INCREMENT): Deleted. + (decl_die_table_hash): New function. + (decl_die_table_eq): New function. + (lookup_decl_die): Lookup in a hash table. + (equate_decl_number_to_die): Insert into a hash table. + (dwarf2out_init): Init hash table decl_die_table. + +2004-01-29 Jakub Jelinek + + PR optimization/13424 + * expr.c (store_constructor): Revert 2003-12-03 change. + + * emit-rtl.c (change_address): Check also if MEM_ATTRS is set as + expected before returning early. Avoid sharing RTL if they + need to be changed. + + * config/i386/i386.c (ix86_expand_movstr): Rework rep_mov and strmov + handling so that memory attributes are preserved. Don't call + ix86_set_move_mem_attrs. + (ix86_set_move_mem_attrs_1, ix86_set_move_mem_attrs): Removed. + (ix86_expand_clrstr): Rename src argument to + dst. Rework rep_stos and strset handling so that memory attributes + are preserved. + (ix86_expand_strlen): Pass src argument to + ix86_expand_strlensi_unroll_1. Rework strlenqi_1 handling so that + memory attributes are preserved. + (ix86_expand_strlensi_unroll_1): Add src argument. Use + change_address instead of gen_rtx_MEM. + * config/i386/i386.md (strmov, strmov_singleop, rep_mov): New + expanders. + (strmovdi_rex64, strmovsi, strmovsi_rex64, strmovhi, strmovhi_rex64, + strmovqi, strmovqi_rex64): Remove. + (rep_mov*, strmov*): Prefix insn names with *. + (strset, strset_singleop, rep_stos): New expanders. + (strsetdi_rex64, strsetsi, strsetsi_rex64, strsethi, strsethi_rex64, + strsetqi, strsetqi_rex64): Remove. + (rep_stos*, strset*): Prefix insn names with *. + (rep_stosqi_rex64): Likewise. Fix mode of dirflag reg from DImode + to SImode. + (cmpstrsi): Rework cmpstrqi_1 handling so that memory attributes + are preserved. + (cmpstrqi_nz_1, cmpstrqi_nz_rex_1, cmpstrqi_1, cmpstrqi_rex_1): + Prefix insn names with *. + (cmpstrqi_nz_1, cmpstrqi_1): New expanders. + (strlenqi_1, strlenqi_rex_1): Prefix insn names with *. + (strlenqi_1): New expander. + * config/i386/i386.h (ix86_set_move_mem_attrs): Remove prototype. + +2004-01-29 Zdenek Dvorak + + * Makefile.in (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. + * basic-block.h (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, + verify_flow_info): Declaration removed. + * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. + (debug_bb, debug_bb_n): Add argument to dump_bb call. + * cfgcleanup.c (try_simplify_condjump, try_crossjump_to_edge, + try_optimize_cfg, delete_unreachable_blocks): Use delete_basic_block + instead of delete_block. + * cfghooks.c: Include timevar.h and toplev.h. + (cfg_hooks): Define here. + (verify_flow_info, dump_bb): Moved from cfg.c. + (redirect_edge_and_branch, redirect_edge_and_branch_force, + split_block, split_block_after_labels, move_block_after, + delete_basic_block, split_edge, create_basic_block, + create_empty_bb, can_merge_blocks_p, merge_blocks, + make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): + New functions. + * cfghooks.h (struct cfg_hooks): Added fields name, + make_forwarder_block, tidy_fallthru_edge and + move_block_after. Changed type of verify_flow_info, dump_bb, + split_block fields. Renamed cfgh_split_edge and delete_block + fields. + (redirect_edge_and_branch, redirect_edge_and_branch_force, + split_block, delete_block, split_edge, create_basic_block, + can_merge_blocks_p, merge_blocks): Macros removed. + (cfg_hooks): Do not export. + (verify_flow_info, dump_bb, redirect_edge_and_branch, + redirect_edge_and_branch_force, split_block, split_block_after_labels, + move_block_after, delete_basic_block, split_edge, create_basic_block, + create_empty_bb, can_merge_blocks_p, merge_blocks, + make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): + Declare. + (cfg_layout_rtl_cfg_hooks): Declare. + * cfgloop.c (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): + New functions. + (canonicalize_loop_headers): Use new semantics of make_forwarder_block. + (redirect_edge_with_latch_update): Removed. + (make_forwarder_block): Moved to cfghooks.c, semantics changed. + * cfgloopmanip.c (remove_bbs): Do not update dominators here. + * cfgrtl.c (cfg_layout_split_block, rtl_split_block, rtl_dump_bb, + rtl_delete_block, rtl_split_block, rtl_merge_blocks, + tidy_fallthru_edge, rtl_split_edge, cfg_layout_delete_block, + cfg_layout_merge_blocks, cfg_layout_split_edge): Partly moved to + cfghooks.c. + (rtl_create_basic_block): Coding style fix. + (rtl_tidy_fallthru_edge, rtl_move_block_after, + rtl_make_forwarder_block): New functions. + (update_cfg_after_block_merging): Removed. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Fill in new entries. + * flow.c (verify_wide_reg, verify_local_live_at_start): Add argument + to dump_bb. + * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, + find_if_case_2): Don't update dominators. + * timevar.def (TV_CFG_VERIFY): New. + * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. + * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. + * cfgloopmanip.c (split_loop_bb): Don't update dominators. + (remove_bbs): Don't call remove_bbs. + (create_preheader): Use make_forwarder_block. + (mfb_keep_just, mfb_update_loops): New static functions. + +2004-01-29 Kazu Hirata + + * config/avr/avr.h: Remove target-independent comments about + target macros. + +2004-01-28 Daniel Berlin + + * timevar.c (timevar_print): Mention when checking is enabled. + +2004-01-28 Giovanni Bajo + + * c-lex.c (c_lex): Rename to... + (c_lex_with_flags): Add new parameter to get CPP flags. + (c_lex): Thunk to c_lex_with_flags while keeping the old interface. + * c-pragma.h (c_lex_with_flags): Declare. + +2004-01-28 Kazu Hirata + + * config/mcore/mcore.c (mcore_external_libcall): Add a + comment. + (mcore_return_in_memory): Likewise. + +2004-01-28 Kazu Hirata + + * config/mcore/mcore-protos.h: Remove the prototype for + mcore_setup_incoming_varargs. + * config/mcore/mcore.c (TARGET_ASM_EXTERNAL_LIBCALL): New. + (TARGET_PROMOTE_FUNCTION_ARGS): Likewise. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (mcore_setup_incoming_varargs): Make it static. Receive the + first argument by reference. Add argument second_time. + (mcore_external_libcall): New. + (mcore_return_in_memory): Likewise. + * config/mcore/mcore.h (PROMOTE_FUNCTION_ARGS): New. + (PROMOTE_FUNCTION_RETURN): Likewise. + (STRUCT_VALUE): Likewise. + (RETURN_IN_MEMORY): Likewise. + (SETUP_INCOMING_VARARGS): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. + +2004-01-28 Kazu Hirata + + * config/m32r/m32r-protos.h: Remove the prototype for + m32r_setup_incoming_varargs. + * config/m32r/m32r.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (m32r_return_in_memory): New. + (m32r_setup_incoming_varargs): Make it static. + * config/m32r/m32r.h: Remove #undef of + ASM_OUTPUT_EXTERNAL_LIBCALL. Remove the commented-out + definitions of PROMOTE_FUNCTION_ARGS and + PROMOTE_FUNCTION_RETURN. + (PROMOTE_PROTOTYPES): Remove. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + +2004-01-28 Kazu Hirata + + * config/m68k/m68k.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (m68k_struct_value_rtx): Likewise. + * config/m68k/m68k.h (STRUCT_VALUE_REGNUM): Rename to + STRUCT_VALUE_REGNUM. + (PROMOTE_PROTOTYPES): Remove. + * config/m68k/m68kelf.h (STRUCT_VALUE_REGNUM): Rename to + STRUCT_VALUE_REGNUM. + * config/m68k/m68kv4.h (STRUCT_VALUE_REGNUM): Likewise. + * config/m68k/netbsd-elf.h (STRUCT_VALUE_REGNUM): Likewise. + +2004-01-28 Kazu Hirata + + * config/stormy16/stormy16.c + (TARGET_BUILD_BUILTIN_VA_LIST_TYPE): Rename to + TARGET_BUILD_BUILTIN_VA_LIST. + +2004-01-28 Kazu Hirata + + * config/v850/v850.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (v850_return_in_memory): Likewise. + (v850_setup_incoming_varargs): Likewise. + * config/v850/v850.h (PROMOTE_PROTOTYPES): Remove. + (SETUP_INCOMING_VARARGS): Likewise. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + +2004-01-28 Kazu Hirata + + * config/fr30/fr30.c (TARGET_PROMOTE_PROTOTYPES): New. + (fr30_setup_incoming_varargs): Don't use + STRICT_ARGUMENT_NAMING. + * config/fr30/fr30.h (PROMOTE_PROTOTYPES): Remove. + (STRICT_ARGUMENT_NAMING): Likewise. + +2004-01-28 Kazu Hirata + + * config/frv/frv-protos.h: Remove the prototype for + frv_expand_builtin_saveregs. + * config/frv/frv.c (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + (frv_stack_info): Use FRV_STRUCT_VALUE_REGNUM instead of + STRUCT_VALUE_REGNUM. + (frv_expand_builtin_saveregs): Make it static. + (frv_struct_value_rtx): New. + * config/frv/frv.h (EXPAND_BUILTIN_SAVEREGS): Remove. + +2004-01-29 Jan Hubicka + + PR c++/12850 + * cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and + initial pointers. + * cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS + for functions that will be only inlined. + (cgraph_mark_function_to_output): Likewise. + (cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear; + do not clear function body. + * tree-optimize.c (clear_decl_rtl): Use decl_function_context. + (tree_rest_of_compilation): Reorganize the logic releasing function + body to use callgraph datastructure. + +2004-01-28 John David Anglin + + * pa.md: Change predicate of a peephole2 pattern from reg_or_0_operand + to register_operand. + +2004-01-28 Zack Weinberg + + * config/ia64/ia64.md (fetchadd_acq_si, fetchadd_acq_di) + (cmpxchg_acq_si, cmpxchg_acq_di): Exchange match_dup and + match_operand expressions so that all match_dups appear + lexically after their corresponding match_operands. + +2004-01-28 Kazu Hirata + + * config/h8300/h8300.c (WORD_REG_USED): Use + HARD_FRAME_POINTER_REGNUM instead of FRAME_POINTER_REGNUM. + (compute_saved_regs): Likewise. + (h8300_expand_prologue): Likewise. Allocate locals after + saving registers. + (h8300_expand_epilogue): Use HARD_FRAME_POINTER_REGNUM instead + of FRAME_POINTER_REGNUM. Deallocate locals before saving + registers. + (h8300_initial_elimination_offset): Adjust for the new frame + layout, which swaps flips the order of locals and saved + registers. + * config/h8300/h8300.h (FIRST_PSEUDO_REGISTER): Change to 12. + (HARD_FRAME_POINTER_REGNUM): New. + (ELIMINABLE_REGS): Add an elimination rule from + FRAME_POINTER_REGNUM to HARD_FRAME_POINTER_REGNUM. + (REGISTER_NAMES): Add fp. + * config/h8300/h8300.md (FP_REG): Change to 11. + (HFP_REG): New. + +2004-01-28 Kazu Hirata + + * genrecog.c (write_node): Remove a useless local variable. + +2004-01-28 Ian Lance Taylor + + * Makefile.in (options.c options.h): Use stamp file s-options to + avoid unnecessary rebuilds. + (options.o): New target listing dependencies. + (gtyp-gen.h): Use stamp file s-gtyp-gen. + (STAGESTUFF): Add s-gtyp-gen. + +2004-01-28 Richard Henderson + + * ggc.h (ggc_free): Declare. + * ggc-common.c (ggc_realloc): Use it. + * ggc-page.c: Remove lots of inline markers. + (globals): Add free_object_list. + (ggc_alloc): Tidy. + (ggc_free, validate_free_objects): New. + (poison_pages): Provide default. + (ggc_collect): Call validate_free_objects; emit markers to + the debug file. + +2004-01-28 Zack Weinberg + Jim Wilson + + * config/ia64/ia64.c (ia64_split_tmode, ia64_split_tmode_move): + Rewrite to use POST_INC/POST_DEC/POST_MODIFY instead of a + scratch pointer. + (ia64_secondary_reload_class): Delete case GR_REGS. + * config/ia64/ia64.md (movti, *movti_internal, movtf, *movtf_internal): + Do not allocate a scratch register. + (reload_inti, reload_outti, reload_intf, reload_outtf): Delete. + +2004-01-28 Jan Hubicka + + * gcse.c (bypass_block): Prevent edges to be unified when we are + about to emit compenstation code. + +2004-01-28 Nick Clifton + + * config/arm/arm.c (arm_expand_builtin): Force second argument of + the setcwx insn into a register. + +2004-01-28 Richard Sandiford + + * config/fp-bit.c (pack_d): When using paired doubles to implement + a long double, round the high part separately. + (unpack_d): Fix the case in which the high part is a power of two + and the low part is a nonzero value of the opposite sign. + +2004-01-28 Kazu Hirata + + * config/c4x/c4x.c (TARGET_ASM_EXTERNAL_LIBCALL): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (c4x_external_libcall): Likewise. + (c4x_struct_value_rtx): Likewise. + * config/c4x/c4x.h: Remove. + (STRUCT_VALUE_REGNUM): Likewise. + (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. + +2004-01-28 Kazu Hirata + + * config/i386/i386.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + * config/i386/i386.h (STRUCT_VALUE_INCOMING): Remove. + (STRUCT_VALUE): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + +2004-01-27 Roger Sayle + + * config/pa/pa.c (emit_move_sequence): Check that operand1 is a + CONST_INT before using INTVAL. + +2004-01-27 Ulrich Weigand + + * config/s390/s390.h (TARGET_DEFAULT): Default to !TARGET_BACKCHAIN. + * config/s390/s390.c (s390_return_addr_rtx): Fail for all but current + frame if !TARGET_BACKCHAIN. + * config/s390/s390.md ("allocate_stack"): Use pattern only if + TARGET_BACKCHAIN. + * doc/invoke.texi (-mbackchain/-mno-backchain): Document new default. + +2004-01-27 Zack Weinberg + + * ia64.c (ia64_function_arg): When placing HFAs in integer + registers, do not special case the mode used for complex + types. Do not advance int_regs until the current register + is full. + +2004-01-27 Richard Sandiford + + PR target/7297 + * except.c (init_eh): Use a 5-word __jbuf for __builtin_setjmp(). + +2004-01-27 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_move): #if 0 splitting + slow, unaligned loads and stores while debugging. Fix formatting. + +2004-01-27 David Edelsohn + + * config/rs6000/rs6000.md (save_stack_nonlocal): Use Pmode instead + of computing wmode. + (restore_stack_nonlocal): Same. + +2004-01-27 Devang Patel + + * Makefile.in (dwarf2out.o): Depend on input.h + * dbxout.c (dbx_debug_hooks): Add new empty hook for + imported_module_or_decl. + (xcoff_debug_hooks): Same. + * sdbout.c (sdb_debug_hooks): Same. + * vmsdbgout.c (vmsdbg_debug_hooks): Same. + * debug.c (do_nothing_debug_hooks): Same. + (debug_nothing_tree_tree): New function. + * debug.h (gcc_debug_hooks): New hook, imported_module_or_decl. + * dwarf2out.c: Include input.h. + (dwarf2_debug_hooks): Add new hook for imported_module_or_decl. + (remove_child_TAG): New function. + (dwarf_tag_name): Handle DW_TAG_imported_module. + (gen_subprogram_die): Equate decl number to declaration die. Do not + remove all children dies while reusing declaration die for definition. + Instead, selectively remove only formal parameters. + (gen_variable_die): Equate variable decl to declaration die. + (gen_field_die): Equate field decl to line number. + (force_namespace_die): Replace it with ... + (force_decl_die): ... this. + (force_type_die): New function. + (setup_namespace_context): Replace use of force_namespace_die() with + force_decl_die(). + (gen_namespace_die): Same. + (dwarf2out_imported_module_or_decl): New function. + +2004-01-27 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Remove SUBREG + on CQImode and CHImode incoming arguments in register a7. + (function_arg): Wrap BLKmode argument in register a7 in a PARALLEL. + * config/xtensa/xtensa.h (BLOCK_REG_PADDING): Define. + * config/xtensa/xtensa.md (movdi, movdf): Only call force_reg or + xtensa_copy_incoming_a7 before reload. + +2004-01-27 J"orn Rennecke + + * coverage.c (get_coverage_counts): Give a different message + if flag_guess_branch_prob is set. + * predict.c (counts_to_freqs): Return an int. + (estimate_bb_frequencies): If counts_to_freqs returns zero, + calculate estimates. + +2004-01-27 Kazu Hirata + + * config/iq2000/iq2000-protos.h: Remove the prototype for + iq2000_setup_incoming_varargs. + * config/iq2000/iq2000.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (TARGET_STRICT_ARGUMENT_NAMING): Likewise. + (iq2000_return_in_memory): Likewise. + (iq2000_setup_incoming_varargs): Make it static. Receive the + first argument by reference. + * config/iq2000/iq2000.h (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + (SETUP_INCOMING_VARARGS): Likewise. + (STRICT_ARGUMENT_NAMING): Likewise. + +2004-01-24 James A. Morrison + + * fixinc/fixinc.c (test_test): Initialize res. + (start_flexer): Initialize pz_cmd_save. + +2004-01-27 Zack Weinberg + + * doc/rtl.texi (Arithmetic): Rewrite entries for PLUS, + SS_PLUS, US_PLUS, LO_SUM, MINUS, SS_MINUS, US_MINUS. + +2004-01-27 Zack Weinberg + + PR 7198 + * config/ia64/ia64.md (*nmaddsf4, *nmadddf4, *nmadddf4_alts) + (*nmadddf4_trunc, *nmaddxf4, *nmaddxf4_truncsf, *nmaddxf4_truncdf) + (*nmaddxf4_alts, *nmaddxf4_truncdf_alts): + Rewrite pattern as (minus (op 3) (mult (op 1) (op 2))). + Possibly rename pattern for consistency. + Remove ??? comments suggesting that this be done. + (*nmaddsf4_alts, *nmadddf4_truncsf_alts, *nmaddxf4_truncsf_alts): + New patterns. + (divsi3_internal, divdi3_internal_lat, divdi3_internal_thr) + (divsf3_internal_lat, divsf3_internal_thr, sqrtsf2_internal_thr) + (divdf3_internal_lat, divdf3_internal_thr, sqrtdf2_internal_thr) + (divxf3_internal_lat, divxf3_internal_thr, sqrtxf2_internal_thr): + Update to match. + +2004-01-27 Ian Lance Taylor + + * config/arm/arm.c (output_return_instruction): Only restore IP + into SP if frame_pointer_needed. + +2004-01-27 Eric Botcazou + + * config/sparc/sparc.c (function_arg_pass_by_reference): Return 1 + for SCmode and DCmode if ARCH32. + (sparc_va_arg): Handle SCmode and DCmode by reference if ARCH32. + * config/sparc/sparc.h (RETURN_IN_MEMORY): Return 0 for TCmode + if ARCH32. + (BASE_RETURN_VALUE_REG): Return 32 for all FP modes except TFmode + if ARCH32. + (BASE_OUTGOING_VALUE_REG): Likewise. + +2004-01-27 Eric Botcazou + + PR target/10904 + PR target/13058 + * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New. + Forbid mode changes from SImode for lower FP regs if ARCH64. + +2004-01-27 J"orn Rennecke + + * Makefile.in (bt-load.o): Depend on except.h. + * bt-load.c (except.h): #include. + (compute_defs_uses_and_gen): If insn at end of BB can throw + within this function, consider registers used by it unavailable for + btr migration. + (move_btr_def): If insn at end of BB can throw, insert before rather + than after. + + * flags.h (flag_btr_bb_exclusive): Declare. + * toplev.c (flag_btr_bb_exclusive): New variable. + (f_options): Add btr-bb-exclusive. + * bt-load.c (augment_live_range): Restore old behaviour if + flag_btr_bb_exclusive is set. + * common.opt: Add entry for -fbtr-bb-exclusive. + * opts.c (common_handle_options): Same. + * doc/invoke.texi: Document -fbtr-bb-exclusive. + + * bt-load.c (btrs_live_at_end): New variable. + (compute_defs_uses_and_gen): Compute its pointed-to array. + (clear_btr_from_live_range, add_btr_to_live_range): Update it. + (augment_live_range): When augmenting with a new dominator, + use only its btrs_live_at_end set, but also add in the full set + of the old dominator. + (btr_def_live_range): Use btrs_live_at_end. + (move_btr_def): Set other_btr_uses_before_def, and move new set + to the end of the basic block, if appropriate. + (migrate_btr_defs): Allocate and free btrs_live_at_end. + + * bt-load.c (basic_block_freq): Remove outdated comment. + +2004-01-27 Alan Modra + + * config/rs6000/rs6000.h: Correct target_flags free bits comment. + (PREDICATE_CODES): Remove duplicate. + * config/rs6000/linux64.h (CPP_SYSV_SPEC): Don't define. + (SUBSUBTARGET_OVERRIDE_OPTIONS): Disallow 32 bit TARGET_PROFILE_KERNEL. + (MASK_PROFILE_KERNEL): Adjust define. + +2004-01-27 Jakub Jelinek + + * config/i386/i386.c (ix86_constant_alignment): Decrease alignment + of long string literals from 32 bytes to sizeof (void *) when !-Os + and to 1 with -Os. + +2004-01-26 Kazu Hirata + + * config/h8300/h8300.c (h8300_tiny_constant_address_p): Accept + constant addresses in the normal mode. + +2004-01-26 Kaveh R. Ghazi + + * system.h (CHAR_BITFIELD): Delete. + (BOOL_BITFIELD): New. + * c-decl.c (c_scope): Use BOOL_BITFIELD. + * gengtype-lex.l: Recognize BOOL_BITFIELD instead of CHAR_BITFIELD. + +2004-01-26 Kazu Hirata + + * config/arc/arc.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (arc_return_in_memory): Likewise. + * config/arc/arc.h (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Likewise. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + +2004-01-26 Richard Henderson + + * c-parse.in (extension): Use itype. + (SAVE_EXT_FLAGS): Don't allocate a tree. + (RESTORE_EXT_FLAGS): Don't read a tree. + +2004-01-26 Jan Hubicka + + * cselib.c (discard_useless_values): Clear out value pointer pointing + to datastructure to be recycled. + +2004-01-25 Jan Hubicka + + * genextract.c (main): Do not output the memset when not checking. + +2004-01-26 Kazu Hirata + + * config/h8300/h8300.c (h8300_tiny_constant_address_p): Use a + switch statement instead of a chain of if statements. + +2004-01-26 Jeff Law + + * doc/contrib.texi: Minor cleanup for Paolo Carlini's entry. Add + acute accents for Petur Runolfsson's entry. + +2004-01-26 Kazu Hirata + + * config/pdp11/pdp11.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_RETURN_IN_MEMORY): Likewise. + * config/pdp11/pdp11.h (STRUCT_VALUE): Remove. + (RETURN_IN_MEMORY): Likewise. + +2004-01-26 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_emit_move): split slow + unaligned load/store into smaller loads and stores. + +2004-01-26 Fariborz Jahanian + + * function.c (assign_parms): Do not assign + long long argument to memory in prologue if + is it loaded into register. + +2004-01-26 Fariborz Jahanian + + PR middle-end/13779 + * expr.c (emit_group_load): split constant + correctly into register components of PARALLEL insn. + +2004-01-26 Fariborz Jahanian + + * config/rs6000/rs6000.md (save_stack_nonlocal): + Use adjust_address_nv directly with appropriate mode. + (restore_stack_nonlocal): Ditto. + +2004-01-26 Kazu Hirata + + * config/xtensa/xtensa-protos.h: Remove the prototype for + xtensa_builtin_saveregs. + * config/xtensa/xtensa.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + (xtensa_builtin_saveregs): Make it static. + (xtensa_return_in_memory): New. + * config/xtensa/xtensa.h (PROMOTE_FUNCTION_ARGS: Remove. + (PROMOTE_FUNCTION_RETURN): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + (STRUCT_VALUE): Likewise. + (RETURN_IN_MEMORY): Likewise. + (EXPAND_BUILTIN_SAVEREGS): Likewise. + +2004-01-26 Kazu Hirata + + * config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New. + (arm_setup_incoming_varargs): Likewise. + * config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove. + +2004-01-26 Kazu Hirata + + * config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New. + (cris_setup_incoming_varargs): Likewise. + * config/cris/cris.h (SETUP_INCOMING_VARARGS): Remove. + +2004-01-26 Kazu Hirata + + * config/ns32k/ns32k.c (TARGET_STRUCT_VALUE_RTX): New. + (ns32k_struct_value_rtx): Likewise. + * config/ns32k/ns32k.h (STRUCT_VALUE_REGNUM): Rename to + NS32K_STRUCT_VALUE_REGNUM. + +2004-01-26 Kazu Hirata + + * config/arm/arm.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (arm_struct_value_rtx): Likewise. + * config/arm/arm.h (PROMOTE_FUNCTION_ARGS): Remove. + (STRUCT_VALUE): Likewise. + (STRUCT_VALUE_REGNUM): Likewise. + (PROMOTE_PROTOTYPES): Likewise. + +2004-01-26 Kazu Hirata + + * config/ia64/ia64-protos.h: Remove the prototype for + ia64_setup_incoming_varargs and ia64_return_in_memory. + * config/ia64/ia64.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (TARGET_STRICT_ARGUMENT_NAMING): Likewise. + (ia64_setup_incoming_varargs): Adjust the arguments to meet + the requirement of TARGET_SETUP_INCOMING_VARARGS. + (ia64_return_in_memory): Make it static. Change the return + type to bool from int. Add an argument. + (ia64_struct_value_rtx): New. + * config/ia64/ia64.h: Remove commented-out definitions of + PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, and + PROMOTE_PROTOTYPES. + (RETURN_IN_MEMORY): Remove. + (STRUCT_VALUE_REGNUM): Likewise. + (STRICT_ARGUMENT_NAMING): Likewise. + +2004-01-26 Eric Botcazou + + PR target/13666 + * config/sparc/sparc.c (function_arg_union_value): New function. + (function_arg): Use it to deal with unions. + (function_value): Likewise. Define 'regbase' only for ARCH64. + Replace a conditional statement by a simpler one. + +2004-01-26 Richard Sandiford + + * config/mips/mips.c (mips16_optimize_gp): Delete. + (mips_reorg): Don't call it. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.md (addqi3_noclobber): Move up pecking order. + (floatunsqihf2): Remove operand 6. + (fixhfqi_set, fix_trunchfqi2, fixuns_trunchfqi2): Group with other + fix patterns. + (ldi_conditional, ldf_conditional): Validate operands. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.h (BCT_CHECK_LOOP_ITERATIONS): Remove. + (HAVE_GAS_HIDDEN): Undefine as interim measure. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.c (c4x_legitimate_address_p): Invalidate direct + memory references if TARGET_EXPOSE_LDP nonzero. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.c (legitimize_operands): Truncate invalid shift counts. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.c (c4x_valid_operands): More aggressively reject + invalid operand combinations. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.c (c4x_check_legit_addr): Rename to + c4x_legitimate_address_p. Fix post_modify check. + + * config/c4x/c4x-protos.h (c4x_check_legit_addr): Adjust. + * config/c4x/c4x.h (c4x_check_legit_addr): Adjust. + +2004-01-25 Kazu Hirata + + * config/pa/pa-protos.h: Remove the prototype for + hppa_builtin_saveregs. Add a prototype for + pa_return_in_memory. + * config/pa/pa.c (TARGET_PROMOTE_FUNCTION_RETURN): New. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + (pa_struct_value_rtx): Likewise. + (pa_return_in_memory): Likewise. + * config/pa/pa.h (STRUCT_VALUE_REGNUM): Rename to + PA_STRUCT_VALUE_REGNUM. + (INIT_CUMULATIVE_ARGS): Use pa_return_in_memory. + (EXPAND_BUILTIN_SAVEREGS): Remove. + (PROMOTE_PROTOTYPES): Likewise. + (PROMOTE_FUNCTION_RETURN): Likewise. + +2004-01-25 Kazu Hirata + + * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (vax_struct_value_rtx): Likewise. + * config/vax/vax.h (STRUCT_VALUE_REGNUM): Rename to + VAX_STRUCT_VALUE_REGNUM. + (PROMOTE_PROTOTYPES): Remove. + +2004-01-26 Michael Hayes + + * config/c4x/c4x.h (LEGITIMIZE_RELOAD_ADDRESS): Handle symref. + +2004-01-25 Chris Demetriou + + * config/mips/mips.h (ISA_HAS_HILO_INTERLOCKS): MIPS32, MIPS32r2, + and MIPS64 have HI/LO interlocks. Update comment. + +2004-01-25 Kazu Hirata + + * config/stormy16/stormy16-protos.h: Remove the prototype for + xstormy16_setup_incoming_varargs. + * config/stormy16/stormy16.c + (xstormy16_setup_incoming_varargs): Remove. + (xstormy16_return_in_memory): New. + (TARGET_PROMOTE_FUNCTION_ARGS): Likewise. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + * config/stormy16/stormy16.h (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Likewise + (PROMOTE_PROTOTYPES): Likewise + (RETURN_IN_MEMORY): Likewise + (STRUCT_VALUE): Likewise + (SETUP_INCOMING_VARARGS): Likewise + +2004-01-25 Richard Sandiford + + * config/mips/mips.c (mips_offset_within_object_p): New function. + (mips_symbolic_constant_p): Use it in the SYMBOL_SMALL_DATA and + SYMBOL_CONSTANT_POOL cases. Also use it for SYMBOL_GENERAL if the + ABI has 64-bit pointers and the object file only allows 32-bit symbols. + +2004-01-25 Kazu Hirata + + * config/sh/sh.h (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Likewise. + +2004-01-25 Kazu Hirata + + * config/mn10300/mn10300-protos.h: Remove the prototype for + mn10300_builtin_saveregs. + * config/mn10300/mn10300.c (TARGET_PROMOTE_PROTOTYPES): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + (mn10300_return_in_memory): Likewise. + (mn10300_builtin_saveregs): Make it static. + * config/mn10300/mn10300.h (PROMOTE_PROTOTYPES): Remove. + (RETURN_IN_MEMORY): Likewise. + (STRUCT_VALUE): Likewise. + (EXPAND_BUILTIN_SAVEREGS): Likewise. + +2004-01-25 Eric Botcazou + + PR bootstrap/13853 + * cfgcleanup.c (try_optimize_cfg): Explicitly test against 0. + +2004-01-25 Kazu Hirata + + * config/h8300/lib1funcs.asm (divnorm, modnorm): Optimize by + using ccr. + +2004-01-25 Kazu Hirata + + * config/i860/i860-protos.h: Remove the prototype for + i860_saveregs. + * config/i860/i860.c (i860_saveregs): Make it static. + (i860_struct_value_rtx): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. + * config/i860/i860.h (STRUCT_VALUE_REGNUM): Rename to + I860_STRUCT_VALUE_REGNUM. + (EXPAND_BUILTIN_SAVEREGS): Remove. + +2004-01-25 Kazu Hirata + + * config/m68hc11/m68hc11.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_RETURN_IN_MEMORY): Likewise. + (m68hc11_struct_value_rtx): Likewise. + (m68hc11_return_in_memory): Likewise. + * config/m68hc11/m68hc11.h: Remove a commented-out definition + of PROMOTE_PROTOTYPES. + (RETURN_IN_MEMORY): Remove. + (STRUCT_VALUE_REGNUM): Likewise. + +2004-01-25 Kazu Hirata + + * config/mmix/mmix-protos.h: Remove the prototype for + mmix_setup_incoming_varargs. + * config/mmix/mmix.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (mmix_setup_incoming_varargs): Make it static. + (mmix_struct_value_rtx): New. + * config/mmix/mmix.h (PROMOTE_FUNCTION_ARGS): Remove. + Remove a commented-out definition of PROMOTE_FUNCTION_RETURN. + (STRUCT_VALUE_REGNUM): Remove. + (SETUP_INCOMING_VARARGS): Likewise. + +2004-01-25 Kazu Hirata + + * config/mips/mips-protos.h: Remove the prototypes for + mips_setup_incoming_varargs and mips_return_in_memory. + * config/mips/mips.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_PROMOTE_PROTOTYPES): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (TARGET_STRICT_ARGUMENT_NAMING): Likewise. + (mips_setup_incoming_varargs): Match the prototype for + TARGET_SETUP_INCOMING_VARARGS. + (mips_return_in_memory): Make it static. Add argument fntype. + (mips_strict_argument_naming): New. + * config/mips/mips.h (PROMOTE_PROTOTYPES): Remove. + (PROMOTE_FUNCTION_ARGS): Likewise. + (PROMOTE_FUNCTION_RETURN): Likewise. + (STRUCT_VALUE): Likewise. + (RETURN_IN_MEMORY): Likewise. + (SETUP_INCOMING_VARARGS): Likewise. + (STRICT_ARGUMENT_NAMING): Likewise. + +2004-01-25 Kazu Hirata + + * config/ip2k/ip2k.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_SETUP_INCOMING_VARARGS): Likewise. + (ip2k_return_in_memory): Likewise. + (ip2k_setup_incoming_varargs): Likewise. + * config/ip2k/ip2k.h (RETURN_IN_MEMORY): Remove. + (STRUCT_VALUE): Likewise. + (STRUCT_VALUE_INCOMING): Likewise. + (SETUP_INCOMING_VARARGS): Likewise. + +2004-01-25 Kazu Hirata + + * config/avr/avr.c (TARGET_STRUCT_VALUE_RTX): New. + (TARGET_RETURN_IN_MEMORY): Likewise. + (TARGET_STRICT_ARGUMENT_NAMING): Likewise. + (avr_return_in_memory): Remove. + * config/avr/avr.h (RETURN_IN_MEMORY): Remove. + (STRUCT_VALUE): Likewise. + (STRUCT_VALUE_INCOMING): Likewise. + (STRICT_ARGUMENT_NAMING): Likewise. + +2004-01-25 Jan Hubicka + + * combine.c (recog_for_combine): Avoid allocating unnecesary RTX. + +2004-01-25 Richard Sandiford + + * config/mips/mips-protos.h (mips_reg_mode_ok_for_base_p): Delete. + (mips_regno_mode_ok_for_base_p): Declare. + * config/mips/mips.h (ARG_POINTER_REGNUM): Renumber to 77. + (FRAME_POINTER_REGNUM): Renumber to 78. + (FIRST_PSEUDO_REGISTER): Update comment accordingly. + (BASE_REG_P, GP_REG_OR_PSEUDO_STRICT_P): Delete. + (GP_REG_OR_PSEUDO_NONSTRICT_P): Delete. + (REGNO_MODE_OK_FOR_BASE_P): Use mips_regno_mode_ok_for_base_p. + (REG_MODE_OK_FOR_BASE_P): Likewise. + * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Change + entry for 77 to "$arg" and entry for 78 to "$frame". + (mips_regno_to_class): Map 77 and 78 to ALL_REGS. + (mips_reg_mode_ok_for_base_p): Remove. + (mips_regno_mode_ok_for_base_p): New function, derived from old + BASE_REG_P macro. Don't enforce the mips16 stack pointer + restrictions unless we're being strict. + (mips_valid_base_register_p): Use mips_regno_mode_ok_for_base_p. + +2004-01-24 Kazu Hirata + + * c-common.h: Fix comment typos. + * c-decl.c: Likewise. + * cgraphunit.c: Likewise. + * combine.c: Likewise. + * et-forest.c: Likewise. + * flow.c: Likewise. + * function.c: Likewise. + * ifcvt.c: Likewise. + * integrate.c: Likewise. + * jump.c: Likewise. + * postreload.c: Likewise. + * varray.c: Likewise. + +2004-01-24 Kazu Hirata + + * doc/frontends.texi: Update copyright. + * doc/gcov.texi: Likewise. + * doc/gty.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/standards.texi: Likewise. + +2004-01-24 Herman A.J. ten Brugge + + PR target/12978 + * c4x.md: (movstrqi*) Use match_scratch instead of match_dup. + Remove movstrqi_small because it conflicts with movstrqi_large. + +2004-01-24 Kazu Hirata + + * config/cris/cris.c (TARGET_PROMOTE_FUNCTION_ARGS): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (cris_struct_value_rtx): Likewise. + * config/cris/cris.h (PROMOTE_FUNCTION_ARGS): Remove. + (CRIS_STACKADJ_REG): Use CRIS_STRUCT_VALUE_REGNUM instead of + STRUCT_VALUE_REGNUM. + (STRUCT_VALUE_REGNUM): Rename to CRIS_STRUCT_VALUE_REGNUM. + +2004-01-24 Ian Lance Taylor + + PR bootstrap/13848 + * cse.c (cse_cc_succs): Change the mode of the source expression + as soon as decide we need a new mode. Don't permit changing modes + if we found a match in a successor block. + (cse_condition_code_reg): Save original mode of source expression + so that we know whether we have to change the mode in other + insns. + +2004-01-24 Jan Hubicka + + * emit-rtl.c (change_address, adjust_address_1, offset_address, + widen_memory_access): Return early when there is nothing to change. + +2004-01-24 Jakub Jelinek + + * simplify-rtx.c (simplify_relational_operation): Don't + simplify address == constant into address + -constant == 0. + +2004-01-24 Kazu Hirata + + * gcc.c (process_command): Don't internationalize the + Copyright message. + * mips-tfile.c (main): Likewise. + +2004-01-24 Andreas Tobler + + * cse.c: (cse_cc_succs) Fix comparison warning. + +2004-01-24 Kazu Hirata + + * config/h8300/h8300.md: Remove extraneous USE in expanders. + +2004-01-24 Kazu Hirata + + * config/h8300/h8300-protos.h: Provide prototypes for + h8300_legitimate_constant_p and h8300_legitimate_address_p. + * config/h8300/h8300.c (h8300_legitimate_constant_p): New. + (h8300_rtx_ok_for_base_p): Likewise. + (h8300_legitimate_address_p): Likewise. + * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Use + h8300_legitimate_constant_p. + (RTX_OK_FOR_BASE_P): Remove. + (GO_IF_LEGITIMATE_ADDRESS): Use h8300_legitimate_address_p. + +2004-01-24 Kazu Hirata + + * config/h8300/h8300.h (REG_OK_FOR_INDEX_NONSTRICT_P): New. + (REG_OK_FOR_BASE_NONSTRICT_P): Likewise. + (REG_OK_FOR_INDEX_STRICT_P): Likewise. + (REG_OK_FOR_BASE_STRICT_P): Likewise. + (REG_OK_FOR_INDEX_STRICT_P): Use REGNO_OK_FOR_INDEX_P. + (REG_OK_FOR_BASE_STRICT_P): Use REGNO_OK_FOR_BASE_P. + (REG_OK_FOR_INDEX_P): Use REG_OK_FOR_INDEX_STRICT_P. + (REG_OK_FOR_BASE_P): Use REG_OK_FOR_BASE_STRICT_P. + +2004-01-24 Jan Hubicka + + * cselib.c (remove_useless_values): Do not access discarded values. + +2004-01-24 Joseph S. Myers + + * c-typeck.c (build_conditional_expr): Do not allow non-lvalue + arrays. + +2004-01-23 Kazu Hirata + + * recog.c: Fix a typo in copyright. + +2004-01-23 Andrew Pinski + + * config/rs6000/rs6000.md (call): Fix misappiled patch. + (call_value): Likewise. + +2004-01-23 Richard Henderson + + PR opt/12941 + * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value. + (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0) + if SHIFT_COUNT_TRUNCATED is set. + +2004-01-23 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_va_arg): Handle complex values as + separate real and imaginary parts. + * config/xtensa/xtensa.h (SPLIT_COMPLEX_ARGS): Define. + +2004-01-23 Hartmut Penner + + PR target/13674 + * config/rs6000/rs6000.md (movdf_hardfloat64): Do not disparage + loading into GPR. + +2004-01-23 Jan Hubicka + + * emit-rtl.c (change_address_1): Do not re-generate the RTX if nothing + change. + + * alloc-pool.c (align_four): Kill. + (create_alloc_pool): Align size to eight. + (free_alloc_pool, free_pool): Invalidate deallocated data. + +2004-01-23 Ian Lance Taylor + + PR gcc/1532 + * cse.c (cse_change_cc_mode): New static function. + (cse_change_cc_mode_insns, cse_cc_succs): Likewise. + (cse_condition_code_reg): New function. + * rtl.h (cse_condition_code_reg): Declare. + * toplev.c (rest_of_handle_cse2): Call cse_condition_code_reg. + * target.h (struct gcc_target): Add fixed_condition_code_regs and + cc_modes_compatible. + * target-def.h (TARGET_FIXED_CONDITION_CODE_REGS): Define. + (TARGET_CC_MODES_COMPATIBLE): Define. + (TARGET_INITIALIZER): Add new initializers. + * targhooks.c (default_cc_modes_compatible): New function. + * targhooks.c (default_cc_modes_compatible): Declare. + * hooks.c (hook_bool_intp_intp_false): New function. + * hooks.h (hook_bool_intp_intp_false): Declare. + * config/i386/i386.c (TARGET_FIXED_CONDITION_CODE_REGS): Define. + (TARGET_CC_MODES_COMPATIBLE): Define. + (ix86_fixed_condition_code_regs): New static function. + (ix86_cc_modes_compatible): Likewise. + * doc/tm.texi (Condition Code): Document new hooks. + +2004-01-23 Rainer Orth + + * fixinc/inclhack.def (bad_lval): Renamed to ... + (alpha_bad_lval): ... this. + Removed file list. + Restrict to alpha*-dec-osf*. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/dirent.h: Remove, moving test ... + * fixinc/tests/base/testing.h: ... here, reflecting new name. + +2004-01-23 Zack Weinberg + + PR c/13814 + * c-decl.c (diagnose_mismatched_decls): Also discard a + built-in if we encounter an old-style definition with the + same name. + +2004-01-23 Jakub Jelinek + + * config.gcc (powerpc*-*): Clear $with_cpu or $with_tune if it was + set to default{32,64}. + +2004-01-21 Jakub Jelinek + + * config/rs6000/linux64.h (MD_FALLBACK_FRAME_STATE_FOR) + [!__powerpc64__]: Corrected to handle kernels with changed ucontext. + +2004-01-23 Eric Botcazou + Olivier Hainque + + * fold-const.c (fold_binary_op_with_conditional_arg): Only + build a COMPOUND_EXPR if 'arg' is really a SAVE_EXPR. + +2004-01-23 Daniel Jacobowitz + + * config/arm/arm.c (arm_legitimate_address_p): Don't check the mode + size for minipool references. + +2004-01-23 Roger Sayle + + * real.c (real_floor, real_ceil): Tweak to allow input and output + arguments to overlap. + (real_round): New function to implement round(3m) semantics. + * real.h (real_round): Prototype here. + * builtins.c (fold_builtin_round): New function to constant fold + round, roundf and roundl. + (fold_builtin): Call fold_builtin_round for BUILT_IN_ROUND{,F,L}. + +2004-01-23 Alexandre Oliva + + PR optimization/13819 + * config/sh/sh.c (sh_reorg): Compensate for sharing of CLOBBERs + introduced by 2004-01-20's Jan Hubicka's copy_insn change. + (sh_handle_sp_switch_attribute): Remove warning. + +2004-01-23 Jan Hubicka + + * i386.c (ix86_emit_restore_regs_using_mov): Deal with large offsets. + +2004-01-23 J"orn Rennecke + + * doc/tm.texi: Insert some weasel words when LOAD_EXTEND_OP + may or may not return non-NIL. + * postreload.c (reload_cse_simplify_operands): In LOAD_EXTEND_OP code, + check CANNOT_CHANGE_MODE_CLASS + +2004-01-23 Jan Hubicka + + * basic-block.h (PROP_POSTRELOAD): New macro. + (CLEANUP_LOG_LINKS): New. + * cfgcleanup.c (cleanup_cfg): Only PROP_LOG_LINKS when asked to. + * toplev.c (rest_of_handle_life): Preserve LOG_LINKS trought cleanup_cfg. + + * cselib.c (value_pool): New. + (new_cselib_val): Use pool. + (cselib_init): Initialize value_pool + (cselib_finish): Free pool. + +2004-01-23 Eric Botcazou + + * config/sparc/sparc.c (scan_record_type): New function. + (function_arg_slotno): Use it to determine which kinds of + registers the record can be passed in. + +2004-01-22 James A. Mmorrison + + * config/pa/fptr.c: Fix old-style definition. + +2004-01-22 Paolo Bonzini + + PR optimization/13724 + * cse.c (fold_rtx) : Fold a SUBREG to zero if it + represents the zero bits produced by a ZERO_EXTEND operation. + +2004-01-22 Roger Sayle + + PR optimization/13821 + * simplify-rtx.c (simplify_subreg): Use subreg_lowpart_offset to + correctly calculate the lowpart offset of the contracted subreg. + +2004-01-22 Ian Lance Taylor + + * doc/invoke.texi (Optimize Options): Note that --param arguments + are subject to change without notice. + +2004-01-22 Rainer Orth + + * config.gcc (mips-sgi-irix6*o32): Removed. + * config/mips/iris6-o32-as.h: Likewise. + * config/mips/iris6-o32-gas.h: Likewise. + * config/mips/iris6-o32.h: Likewise. + +2004-01-22 Jan Hubicka + + * cfgcleanup.c (first_pass): New static variable. + (try_forward_edges): Add work limiting check for threading. + (try_crossjump_bb): Add work limiting check for crossjumping. + (try_optimize_cfg): Maintain first pass variable. + +2004-01-22 Bob Wilson + + * config/xtensa/xtensa.c (function_arg): Generalize logic so that it + handles complex and vector modes. + +2004-01-22 Kazu Hirata + + * config/h8300/h8300.h (REG_OK_FOR_INDEX_P_STRICT): Remove. + (REG_OK_FOR_BASE_P_STRICT): Likewise. + (STRICT): Likewise. + +2004-01-22 Daniel Jacobowitz + + * c-semantics.c (genrtl_while_stmt, genrtl_do_stmt_1) + (genrtl_for_stmt): Remove emit_nop calls. + +2004-01-22 John David Anglin + + PR target/13713 + PR target/13324 + * pa.md (movstrsi_prereload, movstrsi_postreload, movstrdi_prereload, + movstrdi_postreload, clrstrsi_prereload, clrstrsi_postreload, + clrstrdi_prereload, clrstrdi_postreload): Fix constraints. + +2004-01-22 Daniel Jacobowitz + + * config/arm/arm.c: Include "debug.h". + (thumb_pushpop): Take two new arguments. Add some commentary. + Output frame information when pushing. + (thumb_exit, thumb_unexpanded_epilogue): Update calls to + thumb_pushpop. + (thumb_output_function_prologue): Likewise. Accumulate a CFA + offset, and pass it to thumb_pushpop. Output CFI information. + (thumb_expand_prologue): Add some frame-related markers and notes. + +2004-01-22 Ulrich Weigand + + * config/s390/s390.c (s390_frame_info): Allow large frame sizes + for TARGET_64BIT. + (s390_arg_frame_offset): Change return type to HOST_WIDE_INT. + * config/s390/s390-protos.h (s390_arg_frame_offset): Likewise. + +2004-01-22 Roger Sayle + Paolo Bonzini + + * rtlanal.c (subreg_lsb_1): New function split out from subreg_lsb. + (subreg_lsb): Change to call new subreg_lsb_1 helper function. + * rtl.h (subreg_lsb_1): Prototype here. + * simplify-rtx.c (simplify_subreg): Optimize subregs of zero and + sign extensions. + +2004-01-22 Kazu Hirata + + * doc/tm.texi (CASE_VECTOR_PC_RELATIVE): Mention that the + macro need not be defined if jump-tables should contain + relative addresses only when -fPIC or -fPIC is in effect. + +2004-01-22 Jan Hubicka + + * alias.c (reg_base_value): Turn into varray. + (reg_base_value_size): Kill. + (old_reg_base_value): New deletable varray. + (alias_invariant_size): New variable. + (REG_BASE_VALUE): Update to use varray. + (find_base_value): Likewise. + (record_set): Likewise. + (record_base_value): Likewise. + (memrefs_conflict_p): Likewise. + (record_set): Likewise + (record_base_value): Likewise. + (memrefs_conflict_p): Use alias_invariant_size. + (init_alias_analysis): Use varray; set alias_invariant_size; + rescale other arrays to be sized by maxreg. + (end_alias_analysis): Save reg_base_value; clear alias_invariant_size. + +2004-01-22 Eric Botcazou + + * config/sparc/sparc.c (function_arg_slotno): Use + FLOAT_TYPE_P to detect FP fields in structures. + (function_arg_record_value_1): Likewise. + (function_arg_record_value_2): Likewise. + +2004-01-22 Jan Hubicka + + * function.c (allocate_struct_function): Do not initialize expr, emit + and varasm. + (prepare_function_start): Do it here. + * c-parse.in (maybe_type_qual): Do not produce line number notes. + +2004-01-22 Eric Botcazou + + PR target/13559 + * config/sparc/sparc.c (function_arg_record_value_3): Revert + to 'word_mode' once the first slot has been filled. + +2004-01-22 Olivier Hainque + + * config/sparc/sparc.c (function_arg_record_value_1): Fix + computation of the number of integer registers required. + +2004-01-21 Kazu Hirata + + * config/i386/i386.md: Simplify certain comparisons of + const_int. + +2004-01-21 Andrew Pinski + + PR target/13785 + * config/rs6000/rs6000.md (call_value): Force operand + 1 not operand 0 into a register. + +2004-01-21 Kazu Hirata + + * cpperror.c, cpptrad.c, longlong.h, params.def, rtl.def, + unwind-dw2-fde.h: Update copyright. + +2004-01-21 John David Anglin + + * pa-protos.h: Update copyright. + * pa.h: Likewise. + * pa.md: Likewise. + +2004-01-21 Caroline Tice + + PR target/12308 + * config/i386/i386.md (fix_truncxfdi2): Add clause to clobber + flags register. + (fix_truncdfdi2): Likewise. + (fix_truncsfdi2): Likewise. + (*fix_truncdi_1): Likewise. + (fix_truncxfsi2): Likewise. + (fix_truncdfsi2): Likewise. + (fix_truncsfsi2): Likewise. + (*fix_truncsi_1): Likewise. + (fix_truncxfhi2): Likewise. + (fix_truncdfhi2): Likewise. + (fix_truncsfhi2): Likewise. + (*fix_trunchi_1): Likewise. + +2004-01-21 Kazu Hirata + + * alias.c, basic-block.h, c-common.c, c-common.h, + c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c, + calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c, + combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c, + cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h, + defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c, + expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c, + genautomata.c, genconditions.c, genemit.c, genflags.c, + gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c, + ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c, + langhooks-def.h, langhooks.c, langhooks.h, line-map.c, + line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c, + ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c, + rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h, + target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h, + unwind.h, varray.c, varray.h: Update copyright. + +2004-01-21 Kazu Hirata + + * config/h8300/coff.h: Update copyright. + * config/h8300/elf.h: Likewise. + * config/h8300/h8300-protos.h: Likewise. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + +2004-01-21 John David Anglin + + * fixinc/inclhack.def (hpux10_stdio_declarations, ultrix_const3, + ultrix_locale, ultrix_stdlib, ultrix_strings, ultrix_sys_time, + ultrix_unistd): New hacks. + * fixinc/tests/base/stdio.h (HPUX10_STDIO_DECLARATIONS_CHECK, + ULTRIX_CONST2_CHECK): Add checks. + * fixinc/tests/base/stdlib.h (ULTRIX_STDLIB_CHECK): Likewise. + * fixinc/tests/base/strings.h (ULTRIX_STRINGS2_CHECK): Likewise. + * fixinc/tests/base/unistd.h (ULTRIX_UNISTD_CHECK): Likewise. + * fixinc/tests/base/sys/time.h (ULTRIX_SYS_TIME_CHECK): Likewise. + * fixinc/tests/base/locale.h: New file. + * fixinc/fixincl.x: Rebuilt. + +2004-01-21 Andreas Jaeger + Michael Matz + + * doc/extend.texi (Extended Asm): Clarify memory clobber. + +2004-01-21 Jakub Jelinek + + * crtstuff.c (frame_dummy, __do_global_ctors_1): Call + _Jv_RegisterClasses through a function pointer. + +2004-01-21 Falk Hueffner + + PR target/12898 + * config/alpha/alpha.c (alpha_emit_set_const_1): If + no_new_pseudos, use gen_rtx_SET directly for SImode constants + which need multiple instructions to emit. + +2004-01-21 Inaoka Kazuhiro + + * config/m32r/m32r.h (CPP_SPEC): Define. + +2004-01-21 Zack Weinberg + + * c-decl.c (merge_decls): Kill different_binding_level and + different_tu arguments; simplify throughout. + (duplicate_decls): Likewise. + (pushdecl, merge_translation_unit_decls): Update calls to + duplicate_decls. + +2004-01-20 Kaveh R. Ghazi + + * Makefile.in (pretty-print.o): Depend on $(CONFIG_H) and + $(SYSTEM_H). + (print-rtl1.o): Depend on $(SYSTEM_H). + +2004-01-20 Kelley Cook + + PR bootstrap/12730 + * configure.ac: Delete definition and subsitution of docdir. + Add info, man, srcman and srcinfo to target hooks. Create doc/ + directory. + * configure: Regenerate. + * Makefile.in: Don't substitute docdir and delete all references + throughout. + (MAKEINFOFLAGS): Define. + (stmp-docobjdir): Delete. + (INFOFILES, MANFILES): Define. + (info): Call lang.info, srcinfo and lang.srcinfo. + (generated-manpages): Call lang.man, srcman and lang.srcman. + (srcinfo, srcman): New rules to copy back files to source directory. + (doc/%.info, doc/%.dvi, doc/%.1, doc/%.7): New implict rule. + (install-man): Revamp rule. + (clean): Update dvi directory. + (distclean): Delete TAGS from front end directorys. + (maintainer-clean): Delete all document files in source directory. + + objc/Make-lang.in (objc.man, objc.info): Dummy entries. + (objc.srcman, objc.srcinfo): Likewise. + +2004-01-20 Bruce Korb + + * fixinc/inclhack.def(math_exception): bypass only for glibc. + (matherr_decl): rename & relocate as exception_structure. + This fix must precede the math_exception fix. + +2004-01-20 Roger Sayle + + * fold-const.c (fold_convert): Rename to fold_convert_const. + (fold_convert_const): Change arguments to take a tree_code, + a type and the operand/expression to be converted. Return + NULL_TREE if no simplification is possible. Add support for + FIX_CEIL_EXPR and FIX_FLOOR_EXPR in addition to FIX_TRUNC_EXPR. + (fold): Handle FIX_CEIL_EXPR and FIX_FLOOR_EXPR. + Adjust call to fold_convert to match new fold_convert_const. + Avoid modifying the tree passed to fold in-place. + +2004-01-21 Alan Modra + + * config/rs6000/sysv4.h (DWARF2_FRAME_REG_OUT): Define. + * dwarf2out.c (output_cfi): Map regs using DWARF2_FRAME_REG_OUT. + * doc/tm.texi (DWARF_FRAME_REGNUM, DWARF2_FRAME_REG_OUT): Document. + +2004-01-20 John David Anglin + + * pa-protos.h (compute_frame_size): Use HOST_WIDE_INT for frame sizes. + * pa.c (store_reg, store_reg_modify, load_reg, set_reg_plus_d): + Likewise. Handle frames larger than 0x7fffffff on 64-bit ports. + (emit_move_sequence): Check scratch_reg first in various if statements. + Extend source simplification to handle all 64-bit CONST_INTs. + (pa_output_function_prologue): Use HOST_WIDE_INT_PRINT_DEC for printing + frame size. + (hppa_expand_prologue, hppa_expand_epilogue): Use HOST_WIDE_INT for + frame offset calculations. + * pa.h (NEW_HP_ASSEMBLER): Add comment. + (MAX_LEGIT_64BIT_CONST_INT, MIN_LEGIT_64BIT_CONST_INT, + LEGITIMATE_64BIT_CONST_INT_P): Define. + (LEGITIMATE_CONSTANT_P): Use LEGITIMATE_64BIT_CONST_INT_P. Treat + any CONST_INT as legitimate during and after reload. + (VAL_32_BITS_P, INT_32_BITS): Define. + (LEGITIMIZE_RELOAD_ADDRESS): Handle large frame offsets. + +2004-01-20 Jan Hubicka + + * emit-rtl.c (verify_rtx_sharing, copy_insn_1, + emit_copy_of_insn_after, emit_copy_of_insn_after): Clobbers + containing hard regs are shared. + (gen_hard_reg_clobber): New function. + (hard_reg_clobbers): New array. + * genemit.c (gen_exp): Use gen_hard_reg_clobber. + (copy_rtx): Do not copy clobbers containing hard regs. + * rtl.h (gen_hard_reg_clobber): Declare. + +2004-01-20 Jan Hubicka + + * varray.c: Include hashtab.h + (varray_descriptor): New structure. + (hash_descriptor, eq_descriptor, varray_descriptor, + print_statistics): New static functions + (varray_init, varray_grow): Update statistics + (dump_varray_statistics): New function. + * varray.h (dump_varray_statistics): Declare. + * toplev.c (finalize): Call it. + * Makefile.in (varray.o): Add dependency. + +2004-01-20 Jan Hubicka + + * cselib.c: Include alloc-pool.h + (empty_vals, empty_elt_lists, empty_elt_loc_lists): Kill. + (elt_loc_list_pool, elt_list_pool, cselib_val_pool): Declare. + (new_elt_list, new_elt_loc_list, unchain_one_elt_list, + unchain_one_elt_loc_list_pool, unchain_one_value, + new_cselib_val): Simplify using allocpool. + (cselib_init): Initialize allocpools. + (cselib_finish): Finish allocpools. + * Makefile.in (cselib.o): Depend on alloc-pool.h + +2004-01-20 Richard Sandiford + + * config/mips/mips.c (mips_load_call_address): Make the call insn + use $gp if it could be calling a lazy binding stub. + +2004-01-20 Kazu Hirata + + * config/s390/s390.c (TARGET_PROMOTE_FUNCTION_ARGS): Define. + (TARGET_PROMOTE_FUNCTION_RETURN): Likewise. + (TARGET_STRUCT_VALUE_RTX): Likewise. + * config/s390/s390.h (PROMOTE_FUNCTION_ARGS): Remove. + (PROMOTE_FUNCTION_RETURN): Remove. + (STRUCT_VALUE): Remove. + +2004-01-20 Denis Chertykov + + PR bootstrap/13735 + * config/avr/avr.h (BASE_REG_CLASS): Don't permit to use X + register as pointer after reload. + +2004-01-20 Zdenek Dvorak + + PR optimization/12440 + * loop.c: Include ggc.h. + (loop_optimize): Run garbage collector between optimization of loops. + * Makefile.in (loop.o): Add GGC_H dependency. + +2004-01-20 Hartmut Penner + + * config/rs6000/rs6000.c (function_arg) Handle + vector register special in function without prototype. + (function_arg_advance): Vector parameters get always + GPRs allocated for the linux64 target. + +2004-01-20 Kazuhiro Inaoka + + * config/m32r/m32r.h (TARGET_M32R2). Test for TARGET_M32R2_MASK + not TARGET_M32RX_MASK. + +2004-01-20 Eric Botcazou + + PR target/13557 + * config/sparc/sparc.c (function_arg): Reorder the cases. + +2004-01-19 Per Bothner + + Move cpp_reader's line_maps field to a shared global. + * cpphash.h (cpp_reader): Rename line_maps field to line_table + and change the type to a pointer rather than a struct. + * cppinit.c (cpp_push_main_field): Adjust accordingly. + * cpplib.c (do_include_common, _cpp_do_file_change, cpp_get_callbacks): + Likewise. + * cppfiles.c (validate_pch): Likewise. + * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_builtin_macro_text): + Likewise. + * cpperror.c (print_location): Likewise. + * cpplib.h (cpp_create_reader): New line_maps pointer parameter. + * cppinit.c (cpp_create_reader): Handle new parameter. + (cpp_destroy): Don't free line_maps - that's no longer our job. + * input.h (line_table): New variable. + * toplev.c (line_table): Declare variable. + (general_init): Initialize line_table. + * c-opts.c (c_common_init_options): Pass line_table to + cpp_create_reader. + * fix-header.c (read_scan_file): New local variable line_table. + Initialize, and pass it to cpp_create_reader. + * Makefile.in (LIBS, LIBDEPS): Add libcpp.a. + (C_AND_OBJC_OBJS, fix-header): Remove redundant libcpp.a. + +2004-01-19 Per Bothner + + Implement a cache for linemap_lookup. + * line-map.h (struct_line_maps): Add cache field. + * line-map.c (linemap_init): Zero cache field. + (linemap_add): Set cache field to offset of newly allocated map. + (linemap_lookup): Use and set cache field. + +2004-01-20 Kaz Kojima + + PR optimization/13567 + * cse.c (cse_basic_block): Call cse_insn with a non-null + libcall_insn for the last SET insn of a no-confilict block. + +2004-01-20 Kelley Cook + + * Makefile.in (target_noncanonical, program_transform_name): Use + immediate define instead of deferred. + (GCC_INSTALL_NAME, GCC_TARGET_INSTALL_NAME, CPP_INSTALL_NAME, + PROTOIZE_INSTALL_NAME, UNPROTOIZE_INSTALL_NAME, GCOV_INSTALL_NAME, + GCCBUG_INSTALL_NAME): Define via a immediate $(shell) instead of + deferred backquote. + +2004-01-20 Joseph S. Myers + + * c-decl.c (c_init_decl_processing): Set pedantic_lvalues to + true unconditionally. + * c-typeck.c (unary_complex_lvalue, pedantic_lvalue_warning): + Remove. + (build_unary_op, build_modify_expr): Don't handle extended + lvalues. + (build_component_ref, build_conditional_expr): Call non_lvalue + instead of pedantic_non_lvalue. + (build_c_cast): Don't condition use of non_lvalue on pedantic. + * fold-const.c (fold): Don't check pedantic directly for + COMPOUND_EXPR. Ensure that results for COMPOUND_EXPR are + passed to pedantic_non_lvalue. + * doc/extend.texi: Remove documentation of extended lvalues. + +2004-01-19 Roger Sayle + + PR optimization/5263 + * simplify-rtx.c (associative_constant_p): Delete. + (simplify_associative_operation): Rewrite to linearize terms, and + attempt to simplify new term against both left and right subterms. + (simplify_binary_operation): Call swap_commutative_operands_p on + op0 and op1, not trueop0 and trueop1. Move the initialization of + trueop0 and trueop1 down to where first needed. + (simplify_relational_operation): Likewise. + * rtlanal.c (commutative_operand_precedence): Also order constant + operands using avoid_constant_pool_reference. + +2004-01-19 Richard Henderson + + * config/alpha/alpha.c (aligned_memory_operand): Check MEM_ALIGN, + don't check memory mode. + (unaligned_memory_operand): Likewise. + (reload_inqi, reload_inhi, reload_outqi, reload_outhi): Don't + abort for op0 not MEM. + + * config/alpha/alpha.c (alpha_expand_mov_nobwx): If the destination + is not a reg, copy to a scratch first. + (aligned_loadqi, aligned_loadhi, unaligned_loadqi, unaligned_loadhi, + unaligned_loadqi_le, unaligned_loadqi_be, unaligned_loadhi_le, + unaligned_loadhi_be): Expect op0 in DImode; don't SUBREG. + (reload_inqi, reload_inhi): Fix mode of op0. + (reload_inqi_help, reload_inhi_help, reload_outqi_help, + reload_outhi_help): Likewise. Use define_insn_and_split. + + * config/alpha/alpha.md (call peepholes): Check for REG_NORETURN + as well as $29 dead. + +2004-01-19 Eric Botcazou + + * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): New. Emit + "tls_object" for thread-local objects. + * config/sparc/sparc.c (sparc_elf_asm_named_section): Emit + "#tls" for thread-local sections. + * configure.ac (thread-local checks): Specify --fatal-warnings in + every binutils-specific checks. For sparc*-*-*, test whether the + OS is Solaris and the tools are native and act accordingly. + * configure: Rebuild. + +2004-01-19 Jeff Law + + * contrib.texi: Update Paolo Carlini's entry. New entries for + Jerry Quinn and Petur Runolfsson. + +2004-01-19 Roger Sayle + + * config/i386/i386.md (*movhi_1, *movqi_1): When optimizing for + size, don't use the larger zero-extending loads. + +2004-01-19 Richard Henderson + + * alpha.h (HARD_REGNO_MODE_OK): Disallow SImode in FP regs. + * alpha.md (UNSPEC_NT_LDA): Remove. + (UNSPEC_CVTLQ, cvtlq): New. + (extendsidi2_1): Rename from extendsidi2_nofix; remove f/f. + (extendsidi2_fix): Remove. + (extendsidi2 splitter): Use cvtlq. + (extendsidi2 fp peepholes): Remove. + (cvtql): Use SFmode instead of SImode. + (fix_trunc?fsi): Update to match. + (floatsisf2_ieee, floatsisf2, floatsidf2_ieee, floatsidf2): New. + (movsi): Rename from movsi_nofix, remove f alternatives. + (movsi_nt_vms): Similarly. + (movsi_fix, movsi_nt_vms_fix): Remove. + (nt_lda): Remove. + * alpha.c (alpha_expand_prologue): Use adddi3, not nt_lda. + +2004-01-19 Jan Hubicka + + * cgraph.c (cgraph_remove_node): Fix removal from linked list. + * cgraphunit.c (cgraph_finalize_compilation_unit): Clear next_needed + list. + (cgraph_remove_unreachable_nodes): New function + (cgraph_decide_inlining_of_small_function): Fix pasto. + (cgraph_decide_inlining_incrementally): Fix pasto. + (cgrpah_decide_inlining): Likewise; remove unreachable nodes. + +2004-01-19 Steven Bosscher + + * gengtype.c (header_file): Make it static. + (write_types_process_field, write_enum_defn): Minor whitespace fixes. + * gengtype.h (header_file): No longer extern. + +2004-01-18 Kazu Hirata + + * defaults.h (CASE_VECTOR_PC_RELATIVE): Provide the default. + * expr.c (CASE_VECTOR_PC_RELATIVE): Remove. + * stmt.c (CASE_VECTOR_PC_RELATIVE): Likewise. + +2004-01-18 Kazu Hirata + + * stmt.c (HAVE_casesi): Define it not already defined. + (HAVE_tablejump): Likewise. + (expand_end_case_type): Resort to the binary tree method if + neither casesi or tablejump is available. + +2004-01-18 Daniel Jacobowitz + + * final.c (final_scan_insn): Make non-static again. + * output.h (final_scan_insn): Re-add prototype. + * config/arc/arc.c (arc_output_function_epilogue): Add NULL + to final_scan_insn call. + * config/cris/cris.c (cris_target_asm_function_epilogue): Likewise. + * config/mips/mips.c (mips_output_conditional_branch): Likewise. + * config/pa/pa.c (output_lbranch, output_call): Likewise. + * config/sh/sh.c (print_slot): Likewise. + * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Likewise. + (output_sibcall, sparc_flat_function_epilogue): Likewise. + +2004-01-18 Jan Hubicka + + * basic-block.h (try_redirect_by_replacing_jump): Declare. + * cfgcleanup.c (try_optimize_cfg): Use it. + * cfgrtl.c (try_redirect_by_replacing_jump): Export. + (rtl_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch): + Kill hack. + (cfg_layout_merge_blocks): Use try_redirect_by_replacing_jump. + + Revert: + 2004-01-16 Geoffrey Keating + + * cfgrtl.c (try_redirect_by_replacing_jump): Optimize tablejumps + even after reload, just don't remove the actual jump tables. + +2004-01-18 Kazu Hirata + + * config/rs6000/rs6000.h (STRICT_ARGUMENT_NAMING): Remove. + +2004-01-18 Kazu Hirata + + * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Fix the computation of + the size of a pointer in bytes. + +2004-01-18 Roger Sayle + + * builtins.c (expand_builtin_expect_jump): Fix thinko of reusing + live "next" variable, which could lead to an infinite loop. + +2004-01-18 Andrew Pinski + + * config/rs6000/altivec.h: Wrap C++ functions in extern "C++" + block. + + * config/rs6000/rs6000.c (rs6000_special_round_type_align): + Check for NULL in the chain and remove repeated code. + +2004-01-18 Jan Hubicka + + * coverage.c (checksum_string): Rename to ... + (coverage_checksum_string): ... this one, Use crc32_string; recognize + names containing random number and zero the number out in order to get + match. + +2004-01-18 Richard Sandiford + + * config/mips/mips.c (mips_got_alias_set): Mark for PCH. + +2004-01-18 Joseph S. Myers + + * doc/c-tree.texi, doc/cpp.texi, doc/extend.texi, + doc/frontends.texi, doc/gcov.texi, doc/gty.texi, doc/install.texi, + doc/invoke.texi, doc/libgcc.texi, doc/md.texi, doc/rtl.texi, + doc/sourcebuild.texi, doc/standards.texi, doc/tm.texi, + doc/trouble.texi: Remove trailing whitespace. + +2004-01-18 Richard Sandiford + + PR target/7618 + * config/mips/mips.c: Include cfglayout.h. + (TARGET_ASM_OUTPUT_MI_THUNK, TARGET_ASM_CAN_OUTPUT_MI_THUNK): Define. + (mips_unspec_offset_high): Add temporary register argument. + (mips_load_call_address): New function, split out from... + (mips_expand_call): ...here. + (mips_output_cplocal): New function. + (mips_output_function_prologue, mips_output_function_epilogue): Use it. + (mips_emit_loadgp): New function, split out from... + (mips_expand_prologue): ...here. + (mips_output_mi_thunk): New function. + +2004-01-17 Bernardo Innocenti + + * longlong.h (mc68020, __mc68030__, mc68030, __mc68040__, mc68040, + mcpu32): Remove redundant checks for implied target predefines. + +2004-1-17 Andrew Pinski + + * config/rs6000/rs6000.c (rs6000_special_round_type_align): + Return type is unsigned int not int. + * config/rs6000/rs6000-protos.h (rs6000_special_round_type_align): + Likewise. + +2004-01-18 Joseph S. Myers + + * doc/contrib.texi, doc/cppenv.texi, doc/extend.texi, + doc/install.texi, doc/invoke.texi, doc/tm.texi: Consistently use + "GNU/Linux" and "Microsoft Windows" terminology. + +2004-01-18 Joseph S. Myers + + * doc/c-tree.texi, doc/compat.texi, doc/cpp.texi, + doc/cppopts.texi, doc/extend.texi, doc/install.texi, + doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi, + doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use + @smallexample instead of @example. + +2004-01-17 Ziemowit Laski + + * objc/objc-act.c (build_objc_method_call): Use target + hooks instead of macros to determine if ..._stret + dispatchers should be used (NeXT runtime only). + +2004-01-17 Roger Sayle + + * builtins.c (expand_builtin_expect_jump): Fix mistake in my + last patch. Use XEXP (x, 0) to get a LABEL_REF's CODE_LABEL. + +2004-01-17 Daniel Jacobowitz + + * rtl.h (emit_insn_before_sameloc, emit_jump_insn_before_sameloc) + (emit_call_insn_before_sameloc, emit_insn_after_sameloc) + (emit_jump_insn_after_sameloc, emit_call_insn_after_sameloc): New + macros. + * reload1.c (emit_reload_insns): Use them. + * emit-rtl.c (emit_insn_before_sameloc, emit_insn_after_sameloc) + (emit_jump_insn_after_sameloc, emit_call_insn_after_sameloc): Check + for NULL PATTERN. + +2004-01-17 Daniel Jacobowitz + + * final.c (SEEN_BB, SEEN_NOTE, SEEN_EMITTED): Define. + (final_scan_insn): Update to take an additional SEEN argument. Emit + a line note after the prologue. Make static. + (line_note_exists): Remove. + (final): Don't initialize line_note_exists. Update call to + final_scan_insn. + * output.h (final_scan_insn): Remove prologue. + * function.c (set_insn_locators): Update comment. + (thread_prologue_and_epilogue_insns): Add a comment. + +2004-01-17 Andrew Pinski + + PR target/10781 + * config/rs6000/rs6000-protos.h (rs6000_special_round_type_align): + Prototype. + * config/rs6000/rs6000.c (rs6000_special_round_type_align): + New function. + * config/rs6000/linux64.h (ROUND_TYPE_ALIGN): Use it. + * config/rs6000/aix.h (ROUND_TYPE_ALIGN): Likewise. + * config/rs6000/darwin.h (ROUND_TYPE_ALIGN): Likewise. + +2004-01-17 Jan Hubicka + + * toplev.c (rest_of_handle_reorder_blocks): Fix pasto in previous + commit. + + * toplev.c (HAVE_conditional_execution): Provide default. + (rest_of_handle_reorder_blocks): For conditional_execution target + update liveness once after all transformations + (rest_of_compilation): Do crossjumping before ce3. + +2004-01-17 Geoffrey Keating + + * alias.c (new_alias_set): Mark last_alias_set for PCH. + (get_varargs_alias_set): Rename 'set' to 'varargs_set' and mark it + for PCH. + (get_frame_alias_set): Likewise, except rename it to 'frame_set'. + * config/rs6000/rs6000.c (rs6000_sr_alias_set): Mark for PCH. + (get_TOC_alias_set): Mark 'set' for PCH. + +2004-01-16 Geoffrey Keating + + * cfgrtl.c (try_redirect_by_replacing_jump): Optimize tablejumps + even after reload, just don't remove the actual jump tables. + +2004-01-17 J. Brobecker + + * dwarf2out.c (is_subrange_type): Renamed from is_ada_subrange_type(). + Remove checks for is_ada() and TREE_UNSIGNED. + (subrange_type_die): Emit a byte_size attribute if the subrange + type size is different from the base type size. + (modified_type_die): Replace call to is_ada_subrange_type() by + call to is_subrange_type(). + +2004-01-16 Andrew Pinski + + * config/sh/sh.c: Include ggc.h. + +2004-01-16 Geoffrey Keating + + * Makefile.in (MD5_H): New. + (fold-const.o): Depend on md5.h. + (dwarf2out.o): Likewise. + (cppfiles.o): Likewise. + * cppfiles.c: Include md5.h. + (should_stack_file): Check against list read from PCH file. + (struct pchf_data): New. + (pchf): New variable. + (struct pchf_adder_info): New. + (pchf_adder): New. + (pchf_save_compare): New. + (_cpp_save_file_entries): New. + (_cpp_read_file_entries): New. + (struct pchf_compare_data): New. + (pchf_compare): New. + (check_file_against_entries): New. + * cpphash.h (_cpp_save_file_entries): Prototype. + (_cpp_read_file_entries): Prototype. + * cpppch.c (cpp_write_pch_state): Write the list of headers. + (cpp_read_state): Read the list of headers. + +2004-01-17 Jan Hubicka + + * c-common.c (c_estimate_num_insns_1): Handle builtin_constant_p and + builtin_expect specially. + * params.def (PARAM_MAX_INLINE_INSNS_AUTO): Set to 100. + (PARAM_LARGE_FUNCTION_INSNS): Set to 3000. + * invoke.texi (max-inline-insns-single): Set to 100. + (large-function-insns): Set to 3000. + +2004-01-16 Eric Christopher + Chandrakala Chavva + + * cppcharset.c (one_iso88591_to_utf8): New function. + (convert_iso88591_utf8): Ditto. Use. + (conversion_tab): Use. + (_cpp_input_to_utf8): New function. + (_cpp_init_iconv_buffer): Ditto. + (_cpp_close_iconv_buffer): Ditto. + * cpphash.h: Prototype new functions. + (cpp_buffer): Add input_cset_desc. + * cppinit.c: Add input_charset default. + * cpplib.c (cpp_push_buffer): Support init and + close of iconv. + * cpplib.h (cpp_options): Add input_charset. + +2004-01-16 Kazu Hirata + + * system.h (ASM_OUTPUT_SECTION_NAME): Poison. + * config/alpha/unicosmk.h: Remove a commented-out definition + of ASM_OUTPUT_SECTION_NAME. + * config/stormy16/stormy16.h: Likewise. + +2004-01-16 Rainer Orth + + * fixinc/inclhack.def (alpha___extern_prefix): Renamed to ... + (alpha___extern_prefix_sys_stat): ... this. + Apply to , too. + Tweak to match more variations. + * fixinc/tests/base/sys/stat.h: Adapt for new hackname. + + * fixinc/inclhack.def (alpha___extern_prefix, + alpha___extern_prefix_standards): New hacks to obey + __PRAGMA_EXTERN_PREFIX. + * fixinc/tests/base/testing.h [ALPHA___EXTERN_PREFIX_CHECK]: New + test. + * fixinc/tests/base/standards.h: Likewise. + + * fixincl/inclhack.def (alpha_pthread): Tweak to match more + variations. + New testcase. + * fixinc/tests/base/pthread.h: Handle it. + + * fixincl/inclhack.def (bad_lval): Sort file list. + Add many missing files up to Tru64 UNIX V5.1B. + * fixinc/tests/base/libgen.h: Renamed to ... + * fixinc/tests/base/dirent.h: ... this to match new file list + order. + + * fixinc/fixincl.x: Regenerate. + +2004-01-16 Mark Mitchell + + * version.c (version_string): Change to 3.5.0. + * doc/include/gcc-common.texi (version-GCC): Likewise. + +2004-01-16 Jan Hubicka + + * i386.md (load_tp_di): Fix pasto. + + PR opt/13608 + * i386.c (ix86_compute_frame_layout): Fix for alloca on leaf function. + + * c-pretty-print.c (pp_c_type_cast, pp_c_abstract_declarator, + pp_c_character_constant, pp_c_floating_constant, + pp_c_additive_expression, pp_c_shift_expression, + pp_c_equality_expression, pp_c_and_expression, + pp_c_exclusive_or_expression, pp_c_inclusive_or_expression, + pp_c_logical_and_expression): Remove inline modifier. + * dwarf2out.c (get_AT): Likewise. + * et-forest.c (et_splay): Likewise. + * ra.h (ra_alloc, ra_calloc): Likewise + +2004-01-16 Kazu Hirata + + * config/frv/frv-protos.h: Fix comment formatting. + * config/frv/frv.c: Likewise. + * config/frv/frv.h: Likewise. + * config/frv/frv.md: Likewise. + * config/frv/frvbegin.c: Likewise. + * config/frv/frvend.c: Likewise. + +2004-01-16 Kazu Hirata + + * system.h (LINKER_DOES_NOT_WORK_WITH_DWARF2): Poison. + * doc/tm.texi (PREFERRED_DEBUGGING_TYPE): Don't mention + LINKER_DOES_NOT_WORK_WITH_DWARF2. + (LINKER_DOES_NOT_WORK_WITH_DWARF2): Remove. + +2004-01-16 J"orn Rennecke + + PR 11864 + * postreload.c (reload_cse_simplify_operands): Don't remove + implicit extension from LOAD_EXTEND_OP. + +2004-01-16 Jan Hubicka + + PR opt/11350 + * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal + after reload. + * cfgrtl.c (rtl_can_merge_blocks, cfglayout_can_merge_blocks, + rtl_try_redirect_by_replacing_branch): Likewise. + +2004-01-15 Geoffrey Keating + + PR pch/13689 + * alias.c (struct alias_set_entry): Mark for GC. + (alias_sets): Make static, mark for GC. + (record_alias_subset): Use GC to allocate alias structures. + * varray.c (element): Make generic varrays GCed. + + PR pch/13361 + * c-typeck.c (constructor_asmspec): Delete. + (struct initializer_stack): Delete field 'asmspec'. + (start_init): Delete saving of asmspec. + (finish_init): Don't update constructor_asmspec. + * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. + * stmt.c (expand_asm): Duplicate strings from tree. + (expand_asm_operands): Likewise. + * tree.c (tree_size): Update computation of size of STRING_CST. + (make_node): Don't make STRING_CST nodes. + (build_string): Allocate string with tree node. + * tree.def (STRING_CST): Update comment. + * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. + (tree_string): Place contents of string in tree node. + * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string + from tree. + + * config/rs6000/rs6000.c (rs6000_va_arg): No need to special-case + altivec operands. + +2004-01-15 Kazu Hirata + + * c-common.h: Fix comment formatting. + * c-cppbuiltin.c: Likewise. + * c-pragma.c: Likewise. + * calls.c: Likewise. + * collect2.c: Likewise. + * cppcharset.c: Likewise. + * cpptrad.c: Likewise. + * dbxout.c: Likewise. + * defaults.h: Likewise. + * dwarf2out.c: Likewise. + * fold-const.c: Likewise. + * genautomata.c: Likewise. + * genconditions.c: Likewise. + * genflags.c: Likewise. + * gengtype.c: Likewise. + * integrate.c: Likewise. + * loop.c: Likewise. + * predict.c: Likewise. + * sdbout.c: Likewise. + +2004-01-15 Zack Weinberg + + * config/ia64/ia64.md (*movti_internal): C output template + extracted to ia64.c. + (*movti_internal_reg): Delete. + (reload_inti, reload_outti): Use the correct mode on operand 2 + in the first place, don't fix it up in the output template. + (movtf, reload_ointf, reload_outtf): New expanders. + (*movtf_internal): New define_insn_and_split. + * config/ia64/ia64.c (ia64_split_timode): Rename to ia64_split_tmode; + make static; do not hand TFmode CONST_DOUBLEs to split_double. + (ia64_split_tmode_move): New function, body mostly pulled + from ia64.md:*movti_internal. + (ia64_function_arg_words): New function, extracted common + logic from ia64_function_arg et seq. + (ia64_function_arg_offset): Likewise. Handle correctly the + case of a scalar quantity 16 bytes wide with only 8-byte alignment. + (ia64_function_arg, ia64_function_arg_partial_nregs) + (ia64_function_arg_advance): Use ia64_function_arg_words and + ia64_function_arg_offset. + (ia64_function_value): TCmode does not go in float regs. + (ia64_secondary_reload_class): Also handle TFmode. + * config/ia64/ia64-protos.h: Remove prototype for + ia64_split_timode; add prototype for ia64_split_tmode_move. + +2004-01-15 Kelley Cook + + * Makefile.in (MAINT): Make it an immediate assignment. + +2004-01-15 Kazu Hirata + + * config/m32r/m32r.md: Remove useless calls to gen_lowpart. + +2004-01-15 Kazu Hirata + + * config/h8300/coff.h: Replace Hitachi with Renesas. + * config/h8300/elf.h: Likewise. + * config/h8300/h8300-protos.h: Likewise. + * config/h8300/h8300.c: Likewise. + * config/h8300/h8300.h: Likewise. + * config/h8300/h8300.md: Likewise. + * config/h8300/lib1funcs.asm: Likewise. + +2004-01-15 Andrew Pinski + + * config/rs6000/rs6000.c (uses_TOC): Wrap #if TARGET_ELF + around it. + +2004-01-15 Kazu Hirata + + * config/h8300/h8300.c (h8300_return_in_memory): New. + (TARGET_STRUCT_VALUE_RTX): Likewise. + (TARGET_RETURN_IN_MEMORY): Likewise. + * config/h8300/h8300.h (STRUCT_VALUE): Remove. + (RETURN_IN_MEMORY): Likewise. + +2004-01-15 Richard Earnshaw + + PR optimization/13375 + * gcse.c (handle_avail_expr): Just return if the source is not a + single set. + +2004-01-15 Richard Earnshaw + Daniel Jacobowitz + + * arm/lib1funcs.asm (ARM_FUNC_START): Correct interworking case. + (EQUIV): Define. + (ARM_FUNC_ALIAS): New macro. + * arm/ieee754-df.S (gedf2, ledf2, nedf2, eqdf2): Use it. + * arm/ieee754-sf.S (gesf2, lesf2, nesf2, eqsf2): Use it. + +2004-01-15 John David Anglin + + PR optimization/12372 + * calls.c (expand_call): Add call_fusage data for stack arguments in + constant calls. + +2004-01-15 Alan Modra + + * config/rs6000/rs6000.c (uses_TOC): Correct comment. Make static. + (rs6000_elf_declare_function_name): Formatting. + * config/rs6000/rs6000-protos.h (uses_TOC): Remove declaration. + +2004-01-15 Jan Hubicka + + PR bootstrap/13692 + * sched-deps.c (sched_analyze_1, sched_analyze_2): Fix thinko in + previous patch. + +2004-01-15 Richard Henderson + + * config/alpha/alpha.h (REG_ALLOC_ORDER): Reorder fp regs after + integer regs of the same call-savedness. + +2004-01-15 Andreas Schwab + + PR bootstrap/13562 + * config/m68k/m68k.c (output_move_const_into_data_reg): Clear cc + status for NOTB/NOTW/NEGW methods. + +2004-01-15 Kazu Hirata + + * doc/invoke.texi: Update dump file names. Fix a typo. + +2004-01-15 Kazu Hirata + + * builtins.c (expand_builtin_va_end): Don't use + EXPAND_BUILTIN_VA_END. + * system.h (EXPAND_BUILTIN_VA_END): Poison. + * config/d30v/d30v.h: Remove a commented-out definition of + EXPAND_BUILTIN_VA_END. + * config/stormy16/stormy16.h: Likewise. + +2004-01-15 Kazu Hirata + + * system.h (STRUCT_VALUE_INCOMING_REGNUM): Poison. + * targhooks.c (default_struct_value_rtx): Don't use + STRUCT_VALUE_INCOMING_REGNUM. + +2004-01-15 Kelley Cook + + PR bootstrap/12744 + * configure.in: Revamp enable-generated-files-in-srcdir rule to define + GENINSRC and not parsedir. Define srcextra as a langhook. + * configure: Regenerate. + * Makefile.in: Suppress default .l.c rule. Don't substitute + parsedir and delete all references throughout. Conditionally define + rule for srcextra dependent on GENINSRC. + (stmp-docobjdir): Delete. + (c-parse.o, gengtype-lex.o, gengtype-yacc.o): Use implicit build rule. + (srcextra): Copy c-parse.y, c-parse.c, gengtype-lex.c, gengtype-yacc.c, + and gengtype-yacc.h back to source directory. + (maintainer-clean): Delete all parse files in source directory. + (distclean): Delete generated files. + + * objc/Make-lang.in (objc-parse.o): Use implicit build rule. + (objc-parse.c, objc-parse.y): Don't use parsedir. + (objc.srcextra): Copy objc-parse.y and objc-parse.c back to source + directory if requested. + (po-generated): Don't use parsedir. + (objc.maintainer-clean): Delete above files from source directory. + +2004-01-14 Kazu Hirata + + * doc/tm.texi (FUNCTION_VALUE): Fix a typo. + +2004-01-14 Kazu Hirata + + * doc/tm.texi: Replace RETURN_IN_MEMORY with + TARGET_RETURN_IN_MEMORY. + +2004-01-15 Jan Hubicka + + * builtins.c (std_expand_builtin_va_arg): Align operand when needed. + * i386.c (init_cumulative_args): Set warn_sse; fix handling of variadic + functions accepting SSE arguments + (function_arg): Warn only when asked to warn. + * i386.h (ix86_args): Add warn_sse/warn_mmx fiels. + +2004-01-14 Joseph S. Myers + + * c-parse.in (stmts_and_decls): Make label at end of compound + statement a hard error. + +2004-01-14 Jan Hubicka + + * cgraph.c (create_edge): Use local.redefined_extern_inline. + * cgraph.h (cgraph_local_info): Sort fields by size; add + redefined_extern_inline + (cgraph_global_info): Sort fields by size. + (cgraph_node): Likewise. + * cgraphunit.c (cgraph_finalize_function): Se + local.redefined_extern_inline on redefinition. + (cgraph_analyze_function): Use it; fix formating. + +2004-01-14 Jan Hubicka + + PR c++/10776 + * sched-deps.c (trye_dependency_cache, anti_dependency_cache, + outptu_dependency_cache, forward_dependency_cahe): Trun to vectors of + bitmaps + (cache_size): New variable + (add_dependence): Update use; canonize early memory locations + (sched_analyze_1): Likewise. + (sched_analyze_2): Likewise. + (init_dependency_caches): Initialize bitmaps. + (free_dependency_caches): Free bitmaps + +2004-01-14 Kazu Hirata + + * calls.c: Replace STRICT_ARGUMENT_NAMING in comments with + targetm.calls.strict_argument_naming(). + * target.h: Likewise. + +2004-01-14 Richard Henderson + + PR debug/13231 + * dwarf2out.c (dwarf2out_stack_adjust): Skip prologue and epilogue + instructions. + +2004-01-14 Richard Henderson + + PR c++/12491 + * except.c (struct eh_region): Add u.fixup.resolved. + (resolve_one_fixup_region): Split out from ... + (resolve_fixup_regions): ... here. + +2004-01-14 Kazu Hirata + + * config/mn10300/mn10300.h (STRUCT_VALUE): Change to 0. + +2004-01-14 Kazu Hirata + + * config/alpha/alpha.h (STRUCT_VALUE): Remove. + * config/alpha/vms.h (STRUCT_VALUE_REGNUM): Remove #undef. + (STRUCT_VALUE): Remove. + +2004-01-14 Steven Bosscher + + * system.h: Poison PROMOTED_MODE + * integrate.c (expand_inline_function): Don't mention the + PROMOTED_MODE. + * loop.c (update_giv_derive): Same. + * tree.h (DECL_RTL): Same. + +2004-01-14 J"orn Rennecke + + PR target/9365 + * sh.c (gen_block_redirect): Add special handling of RETURN. + (gen_far_branch) Don't call gen_stuff_delay_slot if there is no + far branch target (i.e. it's a return). + +2004-01-14 Kazu Hirata + + * regrename.c (find_oldest_value_reg): Fix a warning. + +2004-01-14 Richard Earnshaw + + PR bootstrap/12527 + * config.gcc (arm*-*-linux*): Don't include unknown-elf.h in tm_file. + Move linux-gas.h and linux-elf.h before aout.h. + * arm/arm.h (INITIALIZE_TRAMPOLINE): Only define if not already. + * arm/linux-elf.h (SUBTARGET_CPU_DEFAULT): Define. + +2004-01-14 Kazu Hirata + + * config/m32r/m32r.md: Use GEN_INT instead of gen_rtx + (CONST_INT, VOIDmode, ...). + +2004-01-14 Richard Earnshaw + + * regrename.c (find_oldest_value_reg): If the replacement uses + multiple hard registers, check that all of them are in CLASS. + +2004-01-14 Jan Hubicka + + * alias.c (get_alias_set): Initialize alias set to 0 when subset is + impossible. + +2004-01-14 Kelley Cook + + * Makefile.in: Define MAINT from --enable-maintainer-mode. + +2004-01-14 Hartmut Penner + + * config/rs6000/rs6000.c (rs6000_stack_info) + Calculate always vrsave_mask if TARGET_ALTIVEC. + (rs6000_emit_prologue): Emit code for vrsave + only if TARGET_ALTIVEC_VRSAVE. + (rs6000_emit_epilogue): Likewise. + +2004-01-14 Eric Botcazou + + * config/sparc/sparc.md (tie_add32): Fix pasto. + (tie_add64): Likewise. + +2004-01-14 Zdenek Dvorak + + * config/i386/i386.md (*addqi_1_slp): Do not access operands[2]. + +2004-01-13 Kazu Hirata + + * config/iq2000/iq2000-protos.h: Fix comment formatting. + * config/iq2000/iq2000.c: Likewise. + * config/iq2000/iq2000.md: Likewise. + +2004-01-14 J. Brobecker + + * dwarf2out.c (is_ada_subrange_type): No longer check the TYPE_NAME. + (subrange_type_die): Add handle for nameless subrange types. + +2004-01-13 Kazu Hirata + + * config/h8300/h8300-protos.h: Replace do_movsi with + h8300_expand_movsi. + * config/h8300/h8300.c (do_movsi): Change to + h8300_expand_movsi. + * config/h8300/h8300.md (movsi): Replace do_movsi with + h8300_expand_movsi. + (movsf): Likewise. + +2004-01-13 Kazu Hirata + + * config/h8300/h8300.c (dosize): Change to + h8300_emit_stack_adjustment. Update callers. + +2004-01-13 Kazu Hirata + + * config/h8300/h8300.md (movstrictqi): Add an alternative with + the source being post_inc. Tighten the predicate for the + destination to register_operand. + (movstricthi): Likewise. + +2004-01-13 Kazu Hirata + + * system.h (SHARED_BSS_SECTION_ASM_OP): Poison. + * varasm.c (bss_section): Don't use SHARED_BSS_SECTION_ASM_OP. + * doc/tm.texi (SHARED_BSS_SECTION_ASM_OP): Remove. + +2004-01-14 Jan Hubicka + + Partial fix PR c++/12850 + * cgraphunit.c (cgraph_finalize_function): Always ggc_collect when + at zero nest level. + +2004-01-13 Bernardo Innocenti + + * config/m68k/netbsd-elf.h (REGISTER_NAMES): Add missing "argptr" + pseudo-register. + +2004-01-13 Devang Patel + + PR c++/12709 + * c-common.c (finish_fname_decls): Use the chain only if the + tree is an expr_stmt. + +2004-01-13 Vladimir Makarov + + * rtl.def: Add comment about new option in automata_option. + + * genautomata.c (PROGRESS_OPTION): New macro. + (progress_flag): New global variable. + (gen_automata_option): Process `progress'. + (transform_insn_regexps, check_unit_distributions_to_automata, + make_automaton, NDFA_to_DFA, build_automaton, create_automata, + expand_automata, write_automata): Print about the progress only if + progress_flag. Remove fflush. + (initiate_automaton_gen): Process command line flag `-progress'. + + * doc/md.texi: Describe the new option. + +2004-01-13 Zdenek Dvorak + + * cfg.c (dump_bb): Dump entry edges. + +2004-01-13 Richard Earnshaw + + * arm.c (thumb_legitimate_address_p): Only allow constant pool + references from SImode. + * arm.md (thumb_movhi_insn): Don't allow minipool references. + +2004-01-13 Kazu Hirata + + * system.h (TEXT_SECTION): Poison. + * varasm.c (text_section): Don't use TEXT_SECTION. + * config/sh/sh.c (sh_file_start): Fix a comment typo. + * doc/tm.texi (TEXT_SECTION): Remove. + +2004-01-13 Ben Elliston + + * doc/rtl.texi (Vector Operations): Remove defunct vec_const item. + +2004-01-12 James E Wilson + + * unwind-libunwind.c: Delete. + +2004-01-12 Zack Weinberg + + PR 13656 + * c-decl.c (diagnose_mismatched_decls): Whenever newtype or + oldtype is set, set *newtypep or *oldtypep too. Do not set + them at the very end. + (validate_proto_after_old_defn): Restructure for comprehensibility; + make error messages clearer. + +2004-01-12 Zack Weinberg + + * varray.h (VARRAY_POP): Add checking variant, aborts on underflow. + (VARRAY_TOP): Use VARRAY_CHECK so the access is bounds-checked. + * varray.c: No need to prototype error. + (varray_check_failed): Wrap long string onto two lines. + (varray_underflow): New function. + +2004-01-13 Steven Bosscher + + PR c++/13376 + * function.h (struct function): Kill `name' field. + (current_function_name): Make it an extern function. + * function.c (current_function_name): New function. + * graph.c: Update all uses of current_function_name. + * gcse.c: Likewise. + * config/alpha/alpha.c, config/avr/avr.c, config/c4x/c4x.c, + config/mips/mips.c, config/pdp11/pdp11.c: Likewise. + * config/ip2k/ip2k.c (function_prologue): Use MAIN_NAME_P + instead of a strcmp with "main". + +2004-01-13 Jan Hubicka + + * c-decl.c (diagnose_mismatched_decls): Fix warning calls. + + * cgraphunit.c (cgraph_optimize_function): Always do + optimize_inline_calls when there is always_inline callee. + (cgraph_decide_inlining): Fix formating. + * tree-inline.c (inlinable_function_p): Do sorry for alwaysinline + functions. + (expand_call_inline): Likewise. + * toplev.h (sorry): Fix prototype. + +2004-01-12 Roger Sayle + + * builtins.c (expand_builtin_expect_jump): Simplify logic. Handle + conditional jumps that drop through to unconditional jumps or the + end of the sequence. + +2004-01-13 Jan Hubicka + + * alias.c (new_alias_set): Construct the alias_set varray. + (init_alias_once): Don't do it here. + +2004-01-12 Marc Espie + + * system.h: handle YYBYACC like YYBISON. + +2004-01-12 Jonathan Merriman + + PR target/10847 + * config.gcc: No longer includes conflicting header sparc/sol2.h when + building on sparc64-*-openbsd*. + +2004-01-12 Andrew Pinski + + PR debug/13539 + * dbxout.c (dbxout_type): Protected inheritance is not + private but protected. + +2004-01-12 Richard Sandiford + + * config/mips/mips.c (mips_symbolic_constant_p): Revert last patch. + +2004-01-12 Kazu Hirata + + PR optimization/12508. + * combine.c (try_combine): Remove a dead set in a parallel + even if its destination is a subreg. + + Revert: + 2003-06-03 Kazu Hirata + * combine.c (simplify_set): Don't move a subreg in SET_SRC to + SET_DEST if WORD_REGISTER_OPERATIONS is not defined. + +2004-01-12 Geoffrey Keating + + * real.c: Update copyright date. + * emit-rtl.c: Likewise. + * rtl.h: Likewise. + * dwarf2out.c: Likewise. + * config/rs6000/darwin-ldouble.c: Likewise. + * config/rs6000/rs6000.md: Likewise. + +2004-01-12 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Add AIX + TFmode to SImode libfuncs. + +2004-01-12 Roger Sayle + + PR middle-end/11397 + * varasm.c (assemble_alias): Remove weak aliases from weak_decls. + +2004-01-12 Jan Hubicka + + PR opt/12826 + * loop.c (insert_loop_mem): Preffer VOLATILE memory references to be + stored. + + PR opt/12863 + * cfgcleanup.c (label_is_jump_target_p): Move to... + * rtlanal.c (label_is_jump_target_p): ... here. + * cfgrtl.c (cfg_layout_redirect_edge_and_branch): Fix redirecting of fallthru + edges unified with branch edges. + +2004-01-12 Richard Earnshaw + + * simplify-rtx.c (simplify_immed_subreg): Correctly extract the + high word of an integral CONST_DOUBLE. + +2004-01-12 Paul Brook + + * simplify-rtx.c (simplify_plus_minus): Always generate canonical form. + +2004-01-12 J"orn Rennecke + + PR target/13585 + * sh-protos.h (check_use_sfunc_addr): Declare. + * sh.c (extract_sfunc_addr, check_use_sfunc_addr): New functions. + * sh.md (use_sfunc_addr): Use check_use_sfunc_addr in insn predicate. + +2004-01-12 Jan Hubicka + + * alias.c: Invlude varray.h + (alias_sets): Turn into varray. + (get_alias_set_entry): Use VARRAY; mark inline. + (mems_in_disjoint_alias_sets_p): Mark inline. + (record_alias_subset): Use varray. + (init_alias_once): Initialize varray. + (new_alias_set): Grow array. + * varray.c: Make VARRAY_GENERIC_PTR non GTYized. + +2004-01-12 Jan Hubicka + + Partial fix for PR opt/10776 II + * cselib.c: Include params.h + (cselib_invalidate_mem): Limit amount of nonconflicting memory + locations. + * params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New. + * Makefile.in (cselib.o): Depend on params.h + +2004-01-12 Richard Sandiford + + * combine.c (combine_simplify_rtx): Don't pass VOIDmode to + simplify_unary_operation if the operand has a known mode. + +2004-01-12 Hartmut Penner + + PR target/13534 + * config/rs6000/rs6000.c (word_offset_memref_operand): New + predicate to handle 'ld' conform addresses. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): New 'Y' + contraint. + (EXTRA_MEMORY_CONSTRAINT): Tell reload which constraint + are memory contraints. + * config/rs6000/rs6000-protos.h (word_offset_memref_operand): + New prototype. + * config/rs6000/rs6000.md (*movdf_hardfloat64): + Change 'o' to 'Y' constraint. + (*movdf_softfloat64): Ditto. + +2004-01-12 Bernardo Innocenti + + * config/m68k/m68k.md: Switch from the "*..." syntax to the + brace-enclosed syntax in all C output statements. + +2004-01-12 David Edelsohn + + PR target/13401 + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): + Objective-C language type value is 14. + +2004-01-12 Markus F.X.J. Oberhumer + + PR c/12148 + * config/m68k/fpgnulib.c: Fix `-mshort' bugs: Use `long' instead of + `int' in a number of places to make sure we always have a SImode + and not a HImode. Add a 'L' suffix to a number of constants. + +2004-01-11 John David Anglin + + * pa.c: Don't include obstack.h. + + * pa.md: Correct constraint in pattern for loading PIC label address. + +2004-01-11 Kaz Kojima + + * config/sh/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): Undefine + before defining. + +2004-01-11 Steven Bosscher + + PR fortran/9972 + * toplev.c (rest_of_handle_inline): Also consider functions + for deferral if the language is GNU F77. + +2004-01-11 Zack Weinberg + + * c-decl.c (diagnose_arglist_conflict): Add missing space to + diagnostic messages. + +2004-01-11 Jakub Jelinek + + PR middle-end/13392 + * builtins.c (expand_builtin_expect_jump): Handle conditional jumps + to drop through label. Don't fall back to SCC even when conditional + jump has not been found. + +2004-01-11 Jan Hubicka + + * invoke.texi: Fix syntax error in previous patch. + + Partial fix for PR opt/10776 + * Makefile.in (reload.o): Include param.h + * params.def (PARAM_MAX_RELOAD_SEARCH_INSNS): New parameter. + * reload.c: Include params.h. + (find_equiv_reg): Work limiting check. + * invoke.texi: Document. + +2004-01-11 Richard Sandiford + + * config/mips/mips.c (mips_symbolic_constant_p): Don't allow + out-of-bounds accesses to string constants. Simplify mips16 + case accordingly. + +2004-01-11 Richard Sandiford + + PR optimization/13469 + * toplev.c (rest_of_compilation): Call purge_all_dead_edges after + reload_cse_regs (-fnon-call-exceptions only). + +2004-01-11 Kazu Hirata + + * config/mcore/lib1.asm: Fix comment formatting. + * config/mcore/mcore-elf.h: Likewise. + * config/mcore/mcore.c: Likewise. + * config/mcore/mcore.h: Likewise. + * config/mcore/mcore.md: Likewise. + +2004-01-10 Zack Weinberg + + * c-decl.c (duplicate_decls): Break apart into... + (diagnose_arglist_conflict, validate_proto_after_old_defn) + (locate_old_defn, diagnose_mismatched_decls, merge_decls): + ... these new functions. Restructure for comprehensibility. + Remove various archaic special cases. Always report the + location of the previous declaration when a diagnostic is issued. + (redeclaration_error_message): Fold into diagnose_mismatched_decls. + (match_builtin_function_types): Delete unnecessary forward declaration. + +2004-01-10 Zack Weinberg + + * genautomata.c (make_automaton, NDFA_to_DFA): + Print progress bars with '.' characters instead of '*'. + (build_automaton): Change notes to match. + +2004-01-10 Kazu Hirata + + * config/m32r/m32r.md: Use define_constants for unspec and + unspec_volatile. + +2004-01-10 Jan Hubicka + + PR opt/11635 + * expr.c (expand_expr_real): More curefully expand union casts. + +2004-01-10 Kazu Hirata + + * config/m32r/m32r.md (flush_icache): Use 1 for + unspec_volatile. + +2004-01-10 David Edelsohn + James E Wilson + + PR debug/12860 + * dbxout.c (dbxout_symbol): Remove initialization of + current_sym_code, current_sym_value, and current_sym_addr. + (dbxout_symbol_location): Same. + (dbxout_prepare_symbol): Zero current_sym_code, + current_sym_value, and current_sym_addr. + +2004-01-10 Richard Sandiford + + * tree.c (get_unwidened): Reorder conditions so that the null pointer + check is done first. + +2004-01-09 Eric Christopher + + * toplev.c (rest_of_handle_cfg): Add reg_scan pass + if we're running mark_constant_function. + +2004-01-09 Jeff Bailey + + PR target/12561 + * config/t-gnu: Rename SYSTEM_HEADER_DIR to NATIVE_SYSTEM_HEADER_DIR. + +2004-01-09 Andrew Pinski + + PR debug/11231 + * dbxout.c (dbxout_type_fields): Return if any item is + error_mark_node or the type is error_mark_node. + +2004-01-09 Geoffrey Keating + + * config/rs6000/darwin-ldouble.c: Add big comment explaining + exactly what is expected as a 'long double'. + (_xlqadd): When a value to be returned is representable as a + 'double', just return it directly, do not construct it using a union. + Also, correct final fixup. + (_xlqmul): Likewise. + (_xlqdiv): Likewise. + * real.c (encode_ibm_extended): Make consistent with darwin-ldouble.c. + + * config/rs6000/rs6000.md (fix_trunctfdi2): Delete. + +2004-01-09 Richard Henderson + + * recog.c (constrain_operands): Validate mem operands. + +2004-01-09 James E Wilson + + * gcc.c (init_spec): Remove -lunwind from shared case. + * conifg/ia64/t-hpux (SHLIB_LINK): Add -lunwind. + +2004-01-09 Steve Ellcey + + * configure.ac: (gcc_cv_ld_hidden) Set to true for ia64*-*-hpux*. + * configure: Regenerate + +2004-01-09 Joseph S. Myers + + PR c/11234 + * c-typeck.c (build_c_cast): If pedantic, warn for conversions + between function and object pointers. + (digest_init): When comparing a pointer to function type to the + target type, only apply TREE_TYPE once to the pointer to function + type. + * except.c (for_each_eh_label_1): Treat data as a pointer to a + function pointer rather than casting it to a function pointer. + (for_each_eh_label): Update caller. + * recog.h (struct insn_data): Use a struct or union for output. + * genoutput.c (output_insn_data): Update. + * final.c (get_insn_template): Update. + +2004-01-09 Mark Mitchell + + * expr.h (expand_expr): Make it a macro, not a function. + (expand_expr_real): New function. + * expr.c (store_expr): Adjust logic for deciding whether or not to + copy the value returned by expand_expr. + (expand_expr): Rename to ... + (expand_expr_real): ... this. Add alt_rtl parameter. Adjust + calls to language hooks. + * c-common.h (c_expand_expr): Adjust prototype. + * c-common.c (c_expand_expr): Add alt_rtl parameter. + * langhooks-def.h (lhd_expand_expr): Change prototype. + * langhooks.c (lhd_expand_expr): Add all_rtl parameter. + * langhooks.h (lang_hooks): Change type of expand_expr. + * stmt.c (stmt_status): Add x_last_expr_alt_rtl. + (last_expr_alt_rtl): Likewise. + (expand_expr_stmt_value): Set last_expr_alt_rtl. + (clear_last_expr): Clear it. + (expand_end_stmt_expr): Set RTL_EXPR_ATL_RTL. + (expand_end_bindings): Save and restor last_expr_alt_rtl. + * tree.def (RTL_EXPR): Give it an additional operand. + * tree.h (RTL_EXPR_ALT_RTL): New macro. + +2004-01-09 Kazuhiro Inaoka + + * config/m32r/m32r.h (TARGET_CPU_CPP_BUILTINS): Add __m32r__. + * config/m32r/m32r.c (call26_operand): Allow in PIC mode. + +2004-01-09 Kazu Hirata + + PR target/13380. + * config/m32r/m32r.md: Replace (reg:SI 17) with (reg:CC 17) + or (ne:SI (reg:CC 17) (const_int 0)). + Be specific about modes wherever possible. + +2004-01-09 Kazu Hirata + + * config/m32r/m32r.c (m32r_expand_block_move): Call + gen_movestrsi_internal with two more arguments. + (m32r_output_block_move): Adjust operand numbers. + Properly update the source and destination pointers. + * config/m32r/m32r.md (movstrsi_internal): Use 'r' instead of + 'r+'. Change the set detinations to match_operand. + +2004-01-09 Kazu Hirata + + * final.c (FIRST_INSN_ADDRESS): Remove. + (shorten_branches): Don't use FIRST_INSN_ADDRESS. + * system.h (FIRST_INSN_ADDRESS): Poison. + * config/avr/avr.h: Remove a comment about FIRST_INSN_ADDRESS. + * config/m32r/m32r-protos.h: Remove the prototype for + m32r_first_insn_address. + * config/m32r/m32r.c (m32r_first_insn_address): Remove. + * config/m32r/m32r.h (FIRST_INSN_ADDRESS): Likewise. + * doc/md.texi (FIRST_INSN_ADDRESS): Likewise. + +2004-01-09 J. Brobecker + + * dwarf2out.c (gen_enumeration_type_die): Return the DIE that + we just created. + (is_ada_subrange_type): DIEs for enumeration subtypes should be + emitted as subrange types too. + (subrange_type_die): Add handling of enumeration subtypes. + +2004-01-08 Richard Henderson + + PR opt/12441 + Revert: Sat Mar 30 14:08:55 CET 2002 Jan Hubicka + * i386.c (aligned_operand): Be prepared for SUBREGed registers. + (ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG. + (ix86_address_cost): Be prepared for SUBREGed registers. + (legitimate_address_p): Accept SUBREGed registers. + +2004-01-08 Kelley Cook + + * Makefile.in: Rename configure.in to configure.ac + * doc/sourcebuild.texi: Likewise. + * configure: Regenerate. + * config.in: Regenerate. + +2004-01-08 Stuart Hastings + + * config/i386/i386.md: Typos in MMX/SSE immediate shifts. + +2004-01-08 Jan Hubicka + + * cgraphunit.c (cgraph_decide_inlining): Fix typo. + +2004-01-08 Geoffrey Keating + + * config/rs6000/rs6000.md (cmptf_internal1): Correct branch offset. + (UNSPEC_FIX_TRUNC_TF): New constant. + (movtf_internal): Make splitter active only when insn is active. + (extenddftf2): Rewrite to properly load zero into low part. + (extenddftf2_internal): New. + (extendsftf2): Rewrite. + (truncdftf2): Correct length. + (floatditf2): Delete. + (fix_trunc_helper): New. + (fix_trunctfdi2): Use fix_trunc_helper. + (fix_trunctfsi2): Likewise.fix_trunc + (fix_trunctfsi2_internal): New. + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): lo_sum + addresses are legitimate on Darwin even when flag_pic. + (rs6000_legitimize_reload_address) [TARGET_MACHO]: Don't create + non-offsettable addresses for loads of TFmode constants. + +2004-01-08 Kazuhiro Inaoka + + * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Actually emit + variables in the appropriate bss section. + +2004-01-09 Alan Modra + + * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Ensure + target_flags has MASK_POWERPC64 when -m64. + * config/rs6000/rs6000.c (processor_target_table): Add MASK_POWERPC64 + to 620, 630, power3, power4 and rs64a entries. + * config/rs6000/rs6000.h (MASK_64BIT): Expand comment. + +2004-01-08 Richard Sandiford + + * simplify-rtx.c (simplify_immed_subreg): Fix construction of + floating-point constants. + +2004-01-08 J. Brobecker + + * dwarf2out.c (subrange_type_die): Add context_die parameter. + Create the subrange_type DIE using the given context DIE. + (modified_type_die): Update call to subrange_type_die. + +2004-01-08 Zack Weinberg + + * dwarf2.h, unwind-dw2-fde.h, unwind-pe.h, unwind.h: + Add multiple-include guard. + +2004-01-08 Hartmut Penner + + * config/rs6000/rs6000.c (easy_vector_constant): Accept + all vector constant loadable by vsplt*. + (output_vec_const_move): Likewise. + +2004-01-07 Joseph S. Myers + + PR c/6024 + * c-typeck.c (comptypes): Only treat enumerated types in the same + translation unit as compatible with each other when they are the + same type. + * doc/extend.texi: Update. + +2004-01-07 Joseph S. Myers + + PR c/12165 + * c-decl.c (grokdeclarator): Take type qualifiers of typedefed + array type from the array element type. + +2004-01-07 Alan Modra + + * config/rs6000/rs6000.c (rs6000_dbx_register_number): New function. + * config/rs6000/rs6000-protos.h (rs6000_dbx_register_number): Declare. + * config/rs6000/rs6000.h (DWARF_FRAME_REGNUM): Define. + (DWARF_REG_TO_UNWIND_COLUMN): Correct column adjustment and comment. + * config/rs6000/sysv4.h (DBX_REGISTER_NUMBER): Define. + +2004-01-06 Eric Christopher + + * config/mips/mips.h (MDEBUG_ASM_SPEC): Change for dwarf2 default. + (DWARF2_DEBUGGING_INFO): Define. + (PREFERRED_DEBUGGING_TYPE): Set to dwarf2. + * config/mips/openbsd.h (PREFERRED_DEBUGGING_TYPE): Remove. + * config/mips/iris6.h (SUBTARGET_ASM_DEBUGGING_SPEC): Only pass -g0 + for irix as. + (SUBTARGET_ASM_OPTIMIZING_SPEC): Only pass O0 for irix as. + * config/mips/iris6gas.h (MDEBUG_ASM_SPEC): Remove. + * config/mips/iris5gas.h: Ditto. + (DBX_DEBUGGING_INFO): Remove. + (DWARF2_DEBUGGING_INFO): Ditto. + (MIPS_DEBUGGING_INFO): Ditto. + (PREFERRED_DEBUGGING_TYPE): Ditto. + * config/mips/elf.h (DWARF2_DEBUGGING_INFO): Remove. + (PREFERRED_DEBUGGING_TYPE): Ditto. + (SUBTARGET_ASM_DEBUGGING_SPEC): Ditto. + * config/mips/elf64.h: Ditto. + +2004-01-06 Jan Hubicka + + * Makefile.in (STAGEPROFILE_FLAGS_TO_PASS): Use -fprofile-generate. + (STAGEFEEDBACK_FLAGS_TO_PASS): Use -fprofile-use. + +2004-01-06 Geoffrey Keating + + * config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Compile darwin-ldouble.c. + (TARGET_LIBGCC2_CFLAGS): Use -mlong-double-128. + * config/rs6000/darwin-ldouble.c: New. + + * emit-rtl.c (gen_lowpart_common): Use simplify_gen_subreg + for constants. + (constant_subword): Delete. + * rtl.h (constant_subword): Delete prototype. + (immed_double_const): Is not in varasm.c. + * simplify-rtx.c (simplify_immed_subreg): New. + (simplify_subreg): Use simplify_immed_subreg. + + * config/rs6000/rs6000.md (floatsitf2): Use expand_float rather + than trying to generate RTL directly. + (fix_trunctfsi2): Use expand_fix rather than trying to generate + RTL directly. + + * dwarf2out.c (add_const_value_attribute): Remove incorrect comment. + +2004-01-06 David Edelsohn + + * config/rs6000/xcoff.h (EXTRA_SECTION_FUNCTIONS): Split each + function into a separate macro. + (read_only_data_section): Add void argument. + (private_data_section): Same. + (read_only_private_data_section): Same. + (toc_section): Same. + +2004-01-06 Jan Hubicka + + * invoke.texi: Remove typo in last change. + + PR target/10301 + * config.gcc: Accept opteron and athlon-64 as variants + of k8. + * i386.c (override_options): Likewise. + * invoke.texi (i386 -mtune): Expand documentation. + +2004-01-06 Kazu Hirata + + * alias.c: Fix comment typos. + * builtins.c: Likewise. + * cfg.c: Likewise. + * df.c: Likewise. + * dominance.c: Likewise. + * dwarf2out.c: Likewise. + * emit-rtl.c: Likewise. + * expr.c: Likewise. + * final.c: Likewise. + * fold-const.c: Likewise. + * gcse.c: Likewise. + * genattrtab.c: Likewise. + * genrecog.c: Likewise. + * gensupport.c: Likewise. + * ggc-zone.c: Likewise. + * integrate.c: Likewise. + * local-alloc.c: Likewise. + * loop.c: Likewise. + * recog.c: Likewise. + * regmove.c: Likewise. + * reg-stack.c: Likewise. + * reorg.c: Likewise. + * rtlanal.c: Likewise. + * rtl.h: Likewise. + * sched-ebb.c: Likewise. + * simplify-rtx.c: Likewise. + * toplev.c: Likewise. + * varasm.c: Likewise. + +2004-01-06 Kazu Hirata + + * doc/install.texi: Fix typos. + * doc/invoke.texi: Likewise. + * doc/md.texi: Likewise. + +2004-01-06 Kazuhiro Inaoka + + * config/m32r/m32r.h (TRAMPOLINE_LINE_SIZE): Changed + +2004-01-06 Jan Hubicka + + * i386.c (init_cumulative_args): Add handling of MMX_REGPARM. + (function_arg_advance): Do not pass aggregates in SSE; deal handling + of MMX_REGPARM. + (function_arg): Add new warnings about ABI changes; fix SSE_REGPARM; + add MMX_REGPARM. + * i386.h (ix86_args): Add mmx_words/mmx_regs/mmx_regno fields. + (SSE_REGPARM_MAX): Default to 3 on i386 -msse ABI. + (MMX_REGPARM_MAX): Similarly for -mmmx. + +2004-01-05 Kazu Hirata + + * config/sh/linux.h: Fix comment formatting. + * config/sh/netbsd-elf.h: Likewise. + * config/sh/sh.c: Likewise. + * config/sh/sh.h: Likewise. + * config/sh/vxworks.h: Likewise. + +2004-01-05 Kazu Hirata + + * system.h (ASM_OUTPUT_MAIN_SOURCE_FILENAME): Poison. + * toplev.c (output_file_directive): Don't use + ASM_OUTPUT_MAIN_SOURCE_FILENAME. + +2004-01-05 Steven Bosscher + + * toplev.c: Fix broken checkin of 2003-12-30. + +2004-01-05 Daniel Berlin + + * ggc-zone.c: Remove everything in #ifdef USING_MALLOC_PAGE_GROUPS + (USING_MMAP): We don't support non-mmap. + (struct alloc_chunk): Steal 1 bit from typecode, use it to mark + large objects. + (struct page_entry): Remove bytes_free. + (struct page_table_chain): Remove. + (struct globals): Remove page_table member. + (loookup_page_table_entry): Function deleted. + (set_page_table_entry): Ditto. + (ggc_allocated_p): No longer need page table lookups. + (ggc_marked_p): Ditto. + (alloc_small_page): Don't care about bytes_free anymore. + (alloc_large_page): Round up size. + (ggc_alloc_zone_1): Mark large objects as such, and calculate + their size the new way. + Remove page table lookups and setting. + (ggc_get_size): Calculate large object size the new way. + (sweep_pages): Redo to account for fact that we no longer have + bytes_free. + (ggc_collect): No longer need to reincrement bytes_free. + (ggc_pch_alloc_object): Handle new large objects properly. + (ggc_pch_read): Put PCH stuff into it's own uncollected zone. + +2004-01-05 Kazu Hirata + + * doc/invoke.texi: Remove a page break. + +2004-01-05 Kazu Hirata + + * config/avr/avr.c (avr_output_function_prologue): Remove an + extra pair of curly braces. + +2004-01-05 Kazu Hirata + + * config/mn10300/mn10300.c: Fix comment formatting. + * config/mn10300/mn10300.h: Likewise. + +2004-01-05 Richard Kenner + + * tree.h: Update documentation on nothrow_flag. + * print-tree.c (print_node): Print TREE_NOTHROW as "align-ok" for + types. + +2004-01-05 Kazu Hirata + + * doc/invoke.texi: Remove traces of dead ports. + +2004-01-05 Richard Sandiford + + * doc/invoke.texi: Add documentation for the MIPS -mexplicit-relocs + option. + +2004-01-05 Richard Sandiford + + PR target/12945 + * coverage.c (coverage_counter_alloc): Set SYMBOL_FLAG_LOCAL for + counter labels. + * config/mips/mips.c (INTERNAL_SYMBOL_P): Delete. + (mips_classify_symbol): Always treat SYMBOL_REF_FLAG as indicating + string constants if TARGET_MIPS16. Use SYMBOL_REF_DECL to check + the binding of decl symbols, otherwise check SYMBOL_REF_LOCAL_P. + (mips_symbol_insns): Don't trust the local/global classification. + (m16_usym8_4, m16_usym5_4): Same mips16 change as mips_classify_symbol. + (override_options): Make -mabicalls -fno-unit-at-a-time imply + -mno-explicit-relocs. + (mips_encode_section_info): Don't use SYMBOL_REF_FLAG to distinguish + between local and global symbols. + +2004-01-05 Richard Sandiford + + * config/mips/mips-protos.h (mips_dangerous_for_la25_p): Declare. + (mips_preferred_reload_class): Declare. + * config/mips/mips.h (DANGEROUS_FOR_LA25_P): Replace with function. + (EXTRA_CONSTRAINT): Update accordingly. + (PREFERRED_RELOAD_CLASS): Use mips_preferred_reload_class. + * config/mips/mips.c (mips_dangerous_for_la25_p): New function. + (mips_preferred_reload_class): New function. Prefer LEA_REGS if + mips_dangerous_for_la25_p. + (mips_secondary_reload_class): Use LEA_REGS rather than GR_REGS + if mips_dangerous_for_la25_p. + +2004-01-05 Bernardo Innocenti + + * config/m68k/m68k.c (output_andsi3): Fix signed/unsigned comparison + warning. + +2004-01-04 Nathanael Nerode + + * configure.ac: Use AC_PROG_CPP_WERROR. + * configure: Regenerate. + +2004-01-04 Zack Weinberg + + * .cvsignore: Add autom4te.cache. + +2004-01-04 Richard Sandiford + + * doc/invoke.texi: Revamp documentation of MIPS options. Remove + -mabi=meabi, -mabi-fake-default, -mmips-as, -mgas, -mmips-tfile, + -m4650, -mfix7000 and -(m)no-crt0. Put endianness options first, + then architecture options, then ABI options. General rewording. + +2004-01-04 Joseph S. Myers + + PR c/3414 + * doc/extend.texi: Clarify definition of malloc attribute. + +2004-01-04 Jan Hubicka + + * Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency. + * cgraph.c (create_edge, dump_cgraph): Update to use inline_failed + * cgraph.h (cgraph_edge): Replace inline_call by inline_failed + (cgraph_inline_p): Add extra argument reason. + * cgraphunit.c: Minor formating fixes. + cgraph_first_inlined_callee): New functions. + (record_call_1): Record builtins too. + (cgraph_analyze_function): Update inline_failed messages. + (cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into, + cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed. + (cgraph_check_inline_limits): Likewise; Add argument reason. + (cgraph_set_inline_failed): New static function. + (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set + reasons. + (cgraph_inline_p): Add new argument reason. + * tree-inline.c (expand_call_inline): Update warning. + +2004-01-03 Nathanael Nerode + + * configure.ac: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM + with modern equivalents. + * configure: Regenerate. + + * configure.ac: Replace gcc_AC_CHECK_TYPE with AC_CHECK_TYPE. + * aclocal.m4 (gcc_AC_CHECK_TYPE): Remove. + * configure: Regenerate. + + * doc/install.texi: Note that 'gcc' is now a 2.57 directory. + + * configure.in: Rename to configure.ac. + * configure.ac: Renamed from configure.in; make minimum necessary + changes for autoconf 2.5x. + * aclocal.m4: Make minimum necessary changes for autoconf 2.5x. + * configure: Regenerate with autoconf 2.57. + +2004-01-03 Kazu Hirata + + * config/mips/linux.h: Fix comment formatting. + * config/mips/mips.c: Likewise. + * config/mips/mips.h: Likewise. + * config/mips/mips.md: Likewise. + * config/mips/netbsd.h: Likewise. + * config/mips/windiss.h: Likewise. + +2004-01-02 Richard Henderson + + * config/i386/i386.md (fp constant pool splitter): Reorg suppression + for sse and 387; add suppression for mmx. + +2004-01-02 Andrew Pinski + + * loop.c (loop_optimize): Free all loops_info's mems. + + * c-typeck.c (finish_init): Free spelling_base before + setting it again. + + * cfgloop.c (flow_loops_find): Always free the sbitmap + headers. + + * predict.c (estimate_probability): Free bbs after being + done with it. + +2004-01-02 Kazu Hirata + + * config/mn10300/mn10300.h (PREDICATE_CODES): Add + const_8bit_operand and call_address_operand. + +2004-01-02 Jan Hubicka + + * cgraphunit.c (cgraph_optimize_function): Call optimize_inline_calls + when there is nothing to inline but warnings are requested. + (cgraph_decide_inlining): Fix memory leak. + +2004-01-02 Jan Hubicka + + * expr.c (store_constructor): Fix pasto in previous patch. + +2004-01-02 Kazu Hirata + + * config/i386/cygming.h: Fix comment formatting. + * config/i386/djgpp.h: Likewise. + * config/i386/gthr-win32.c: Likewise. + * config/i386/i386-interix.h: Likewise. + * config/i386/i386.c: Likewise. + * config/i386/i386.h: Likewise. + * config/i386/openbsd.h: Likewise. + * config/i386/winnt.c: Likewise. + * config/i386/xm-mingw32.h: Likewise. + +2004-01-02 Joseph S. Myers + + * doc/gcc.texi, doc/invoke.texi, doc/install.texi: Update + copyright and last modification dates. + +2004-01-02 Andreas Jaeger , Gerald Pfeifer + + * doc/install.texi (Specific): Mention x86_64. + +2004-01-01 Hans-Peter Nilsson + + * builtins.c (expand_builtin_apply_args_1) [STACK_GROWS_DOWNWARD]: + Call force_operand on plus_constant result. + +2004-01-01 Jan Hubicka + + * expmed.c (store_bit_field, extract_bit_field): Use new named patterns + * expr.c (store_constructor): Use vec_init pattern. + * genopinit.c (optabs): Initailize vec_set/vec_extract/vec_init. + * optabs.h (optab_index): ADD OTI_vec_set/OTI_vec_extract/OTI_vec_init + (vec_set_optab, vec_extract_optab, vec_init_optab): New. + * i386.md (vec_setv2df, vec_extractv2df, vec_setv4sf, vec_extractv4sf): + New patterns. + (sse2_unpc?pd): Fix pattern. + (sse2_movlpd): Kill. + (sse2_movsd): Deal with movlpd too. + * i386.c (ix86_expand_builtin): Use sse2_movsd instead of sse2_movlpd. + (ix86_expand_vector_init): New. + * emmintrin.h (__mm_set_pd, __mm_set_ps): Use vector extensions. + * md.texi (vec_set, vec_extract): Document diff --git a/contrib/gcc/ChangeLog-2005 b/contrib/gcc/ChangeLog-2005 new file mode 100644 index 00000000000..325812c5207 --- /dev/null +++ b/contrib/gcc/ChangeLog-2005 @@ -0,0 +1,35909 @@ +2005-12-31 Andrew Pinski + + PR tree-opt/25612 + * tree-ssa-pre.c (compute_avail): Treat the static chain decl as a + parameter and pretend that it is defined in the entry basic block. + +2005-12-30 Kazu Hirata + + * tree-outof-ssa.c (_elim_graph): Change the type of STACK to + VEC(int,heap). + (new_elim_graph, delete_elim_graph, elim_forward, + eliminate_phi): Use the VEC API on STACK. + +2005-12-29 Daniel Berlin + + * tree.h (VALUE_HANDLE_VUSES): New. + (struct tree_value_handle): Add vuses. + + * tree-vn.c (struct val_expr_pair_d): Remove stmt, add vuses. + (vn_compute): Remove stmt argument. + Don't use vuses in hash value computation. + (val_expr_pair_eq): Compare vuse lists. + (copy_vuses_from_stmt): New function. + (shared_vuses_from_stmt): Ditto. + (vn_add): Rewrite in terms of vn_add_with_vuses. + (vn_add_with_vuses): New function. + (vn_lookup): Rewrite in terms of vn_lookup_with_vuses. + (vn_lookup_with_vuses): New function. + (vuses_compare): New function. + (print_creation_to_file): Ditto. + (vn_lookup_or_add): Rewrite to handle vuses. + (sort_vuses): New function. + (vn_lookup_or_add_with_vuses): Ditto. + (vn_init): Initialize shared_lookup_vuses. + (vn_delete): Free shared_lookup_vuses. + + * tree-ssa-pre.c: Update todo list. + (bb_value_sets_t): Add rvuse_in, rvuse_out, rvuse_gen, and + rvuse_kill. + (RVUSE_IN): New macro. + (RVUSE_GEN): Ditto. + (RVUSE_KILL): Ditto. + (RVUSE_OUT): Ditto. + (modify_expr_node_pool): New function. + (pretemp): New. + (storetemp): Ditto. + (mergephitemp): Ditto. + (prephitemp): Ditto. + (struct expr_pred_trans_d): Add vuses member. + (expr_pred_trans_eq): Compare vuses. + (phi_trans_lookup): Add vuses argument. + (phi_trans_add): Ditto. + (translate_vuses_through_block): New function. + (phi_translate): Use vuses to ask about those expressions that can + have vuses. + Properly translate virtual uses through phis, and use + vn_lookup_or_add_with vuses. Handle tcc_reference. + (phi_translate_set): Don't add pointless translations to the + cache. + (get_representative): New function. + (vuses_dies_in_block_x): Ditto. + (valid_in_set): Add block argument. Check virtual use validity. + (clean): Add block argument. Update call to valid_in_set + (compute_antic_aux): Update call to clean. + (dump_bitmap_of_names): New function. + (compute_vuse_representatives): Ditto. + (compute_rvuse): Ditto. + (can_value_number_call): Modified to accept calls with vuses. + (can_value_number_operation): New function. + (can_PRE_operation): Ditto. + (need_creation): New vector of stores that may need creation. + (find_or_generate_expression): use can_PRE_operation. + (create_expression_by_pieces): Handle INDIRECT_REF. + Only create one temp until we have to change types. + Mark new vars for renaming. + (insert_into_preds_of_block): Ignore loopiness of loads. + Use can_PRE_operation. + Only create one temp until we have to chnge types. + (insert_aux): Use can_PRE_operation. + Don't pass name to insert_into_preds_of_block. + (insert_extra_phis): Only use one temp until we have to change + types. + (poolify_tree): New function. + (modify_expr_template): New var. + (poolify_modify_expr): New function. + (insert_fake_stores): Ditto. + (realify_fake_stores): Ditto. + (compute_avail): Use can_value_number_operation. + (mark_operand_necessary): Return NULL for non-SSA names. + (remove_dead_inserted_code): Update comment. + (init_pre): Initialize pretemp, need_creation, storetemp, + mergephitemp, prephitemp. + Create modify_expr_node_pool. + (fini_pre): Free modify_expr_node_pool and need_creation array. + (execute_pre): Call insert_fake_stores, compute_rvuse, and + realify_fake_stores. + * tree-flow.h (vn_compute): Fix prototype. + (vn_add): Ditto. + (vn_lookup): Ditto. + (sort_vuses): New. + (vn_lookup_or_add_with_vuses): Ditto. + (vn_add_with_vuses): Ditto. + (vn_lookup_with_vuses): Ditto. + * passes.c (pass_may_alias): Add. + +2005-12-30 Gabriel Dos Reis + + * c-pretty-print.h (struct c_pretty_print_info): Add new member + "constant". + (pp_constant): New macro. + * c-pretty-print.c (pp_c_pretty_printer_init): Set pp->constant. + +2005-12-30 John David Anglin + + PR fortran/25586 + * pa.md: Remove REG_POINTER check from REG+REG peephole2 floating-point + store patterns. + +2005-12-29 Kenneth Zadeck + + * bitmap.c (bitmap_element_free, bitmap_element_link, + bitmap_elt_insert_after, bitmap_and, bitmap_and_compl, + bitmap_and_compl, bitmap_ior, bitmap_ior_into, bitmap_xor, + bitmap_xor_into): Added code to properly maintain the variants + associated with the CURRENT and HEAD fields. + (bitmap_popcount, bitmap_clear_range, bitmap_compl_and_into): New + functions. + * bitmap.h: Added defs for bitmap_popcount, bitmap_clear_range, + and bitmap_compl_and_into. + + +2005-12-29 Mike Stump + + * doc/invoke.texi (Objective-C and Objective-C++ Dialect Options + -fobjc-exceptions): Don't imply this doesn't work with the GNU + runtime. + +2005-12-29 Nathan Sidwell + + * varasm.c (get_section): Use gcc_assert. + +2005-12-29 Paul Brook + + * config/m68k/m68k.h (RETURN_ADDR_RTX): Define. + * config/m68k/m68k.c (m68k_initial_elimination_offset): Remove FIXME. + Include offset due to FIRST_PARM_OFFSET. + +2005-12-29 Paul Brook + + * config/m68k/lb1sf68.asm (__cmpdf2): Fix typo in immediate mask. + Create wrapper and rename body... + (__cmpdf2_internal): ... to this. Return correct value for unordered + result. + (__cmpsf2): Create wrapper and rename body... + (__cmpsf2_internal): ... to this. Return corerct value for unordered + result. + (__eqdf2, __nedf2, __gtdf2, __gedf2, __ltdf2, __ledf2): Use + __cmpdf2_internal. + (__eqsf2, __nesf2, __gtsf2, __gesf2, __ltsf2, __lesf2): Use + __cmpsf2_internal. + +2005-12-29 Paul Brook + + * config/m68k/fpgnulib.c (__extendsfdf2): Handle negative zero. + (__truncdfsf2): Ditto. + (__extenddfxf2): Ditto. + (__truncxfdf2): Ditto. + * config/m68k/lb1sf68.asm (__addsf3): Return -0.0 for -0.0 + -0.0. + (__adddf3): Ditto. + +2005-12-29 Daniel Jacobowitz + Paul Brook + + * config/m68k/m68k.c (m68k_output_pic_call): Don't use bsr.l for + !TARGET_68020. + * config/m68k/t-m68kelf (EXTRA_PARTS): Remove. + (EXTRA_MULTILIB_PARTS): Set. + * config/m68k/t-uclinux (EXTRA_PARTS): Remove. + (EXTRA_MULTILIB_PARTS): Set. + +2005-12-29 Alan Modra + + PR target/25572 + * config/rs6000/rs6000.c (create_TOC_reference): Set regs_ever_live. + +2005-12-28 Nathan Sidwell + + * config.gcc (mt-*-*): Add --with-arch support. + (--with): Print accepted options on error. + * config/mt/mt.h (OPTION_DEFAULT_SPECS): Define. + + * config/mt/mt.c (DEF_VEC_P(basic_block), + DEF_VEC_ALLOC_P(basic_bloc,heap)): Remove from here. + +2005-12-28 Daniel Berlin + + Fix PR tree-optimization/25394 + * fold-const.c (fold_checksum_tree): Guard + portions of checksumming with correct structure checks. + +2005-12-27 Kazu Hirata + + * global.c, tree-ssa-pre.c: Move DEF_VEC_P(basic_block) and + DEF_VEC_ALLOC_P(basic_block,{gc,heap}) to ... + * basic-block.h: ... here. + +2005-12-27 Roger Sayle + + * fold-const.c (int_const_binop): Return NULL_TREE when an expression + can't be evaluated at compile-time (instead of calling abort). + Return NULL_TREE for division (and modulus) by zero. + (const_binop): Return NULL_TREE for floating point operators that + aren't handled by real_arithmetic. + (fold_binary): Eliminate "wins" variable, and "binary" label, by + folding operators with constant operands early. Assert that + operands are non-NULL. + +2005-12-27 Kazu Hirata + + * tree-vrp.c (extract_range_from_binary_expr): Use + build_int_cst instead of fold_convert. + +2005-12-26 Mark Mitchell + + PR c++/23171, c++/23172, c++/25417. + * c-decl.c (compound_literal_number): Remove. + (build_compound_literal): Use set_compound_literal_name. + * c-common.c (compound_literal_number): New variable. + (set_compound_literal_name): New function. + * c-common.h (set_compound_literal_name): Declare. + +2005-12-26 Kazu Hirata + + PR tree-optimization/25125 + * convert.c (convert_to_integer): Don't narrow the type of a + PLUS_EXPR or MINUS_EXPR if !flag_wrapv and the unwidened type + is signed. + +2005-12-26 Graham Stott + + PR middle-end/25568 + * combine.c (simplify_shift_const_1 ):Fix enable-checking + rtl bootstrap failure. + +2005-12-25 Kazu Hirata + + * final.c (compute_alignments): Make it static. + * gcse.c (gcse_main, bypass_jumps): Likewise. + * web.c (web_main): Likewise. + * output.h: Remove the prototype for compute_alignments. + * rtl.h: Remove the prototypes for web_main, gcse_main, and + bypass_jumps. + +2005-12-24 Roger Sayle + + * expr.c (force_operand): Use expand_fix and expand_float to + implement integer <-> FP conversions instead of convert_to_mode. + +2005-12-24 Mark Mitchell + + PR c++/23171 + * varasm.c (initializer_constant_valid_p): An ADDR_EXPR of a + CONSTRUCTOR is invalid. + +2005-12-23 Daniel Berlin + + * tree-pass.h (pass_eliminate_useless_stores): Remove. + * tree-ssa-pre.c (is_copy_stmt): Ditto. + (follow_copies_till_vuse): Ditto. + (do_eustore): Ditto. + (gate_eustores): Ditto. + (pass_eliminate_useless_stores): Ditto. + * passes.c (init_optimization_passes): Ditto. + +2005-12-23 Paolo Bonzini + + * combine.c (simplify_shift_const): Fix typo. Use, whenever + applicable, simplify_const_binary_operation. + + (simplify_shift_const): Leave only the fallback + case when no simplification is possible. Extract to... + (simplify_shift_const_1): ... here. Always create a new + RTX instead of substituting. Remove the signed_count variable. + Return NULL_RTX if no substitution is possible. + + (simplify_and_const_int): Leave only the fallback + case when no simplification is possible. Extract to... + (simplify_and_const_int_1): ... here. Always create a new + RTX instead of substituting. Return NULL_RTX if no substitution + is possible. + + (force_to_mode, simplify_comparison): Don't pass a non-NULL first + parameter to simplify_and_const_int and simplify_shift_const, + unless it is equal to the expected non-simplified result. + +2005-12-23 Jakub Jelinek + + PR target/25005 + * regrename.c (replace_oldest_value_reg): Use validate_change with + IN_GROUP set to 1 instead of doing direct modifications. + (copyprop_hardreg_forward_1): Likewise. If any replace_oldest_* + replacements have been performed on an instruction, use + apply_change_group (). + +2005-12-23 Hans-Peter Nilsson + + * config/cris/arit.c (do_31div): Clarify what "31" refers to. + [L_divsi3] (__Udiv): Don't use as inline function. + [L_modsi3] (__Umod): Ditto. + (__Div): Rearrange to call do_31div directly instead of __Udiv. + (__Mod): Similarly regarding __Umod. + + PR target/24342 + * config/cris/cris.c (cris_split_movdx): Add REG_INC notes for + emitted insns with post-increments. + (cris_expand_epilogue): Ditto. + +2005-12-22 Jakub Jelinek + Richard Henderson + + Merge from gomp-branch. + * builtins.def: Move all DEF_SYNC_BUILTIN to ... + * sync-builtins.def: ... new file. + (BUILT_IN_FETCH_AND_ADD_16, + BUILT_IN_FETCH_AND_SUB_16, BUILT_IN_FETCH_AND_OR_16, + BUILT_IN_FETCH_AND_AND_16, BUILT_IN_FETCH_AND_XOR_16, + BUILT_IN_FETCH_AND_NAND_16, BUILT_IN_ADD_AND_FETCH_16, + BUILT_IN_SUB_AND_FETCH_16, BUILT_IN_OR_AND_FETCH_16, + BUILT_IN_AND_AND_FETCH_16, BUILT_IN_XOR_AND_FETCH_16, + BUILT_IN_NAND_AND_FETCH_16, BUILT_IN_BOOL_COMPARE_AND_SWAP_16, + BUILT_IN_VAL_COMPARE_AND_SWAP_16, BUILT_IN_LOCK_TEST_AND_SET_16, + BUILT_IN_LOCK_RELEASE_16): New builtins. + * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, + BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. + * builtins.c (expand_builtin): Handle sync BUILT_IN_*_16 builtins. + * c-common.c (enum c_builtin_type): Move to top-level from + c_common_nodes_and_builtins enum builtin_type. + (builtin_types): Move from c_common_nodes_and_builtins. + (def_fn_type): New. + (c_common_nodes_and_builtins): Use it. + (def_builtin_1): Check for error_mark_node. + (sync_resolve_size): Handle also 128 bit sync builtins. + * Makefile.in (BUILTINS_DEF): New. Use it instead of builtins.def. + + * config/i386/i386.h (x86_cmpxchg8b, x86_cmpxchg16b): New decls. + (TARGET_CMPXCHG8B, TARGET_CMPXCHG16B): Define. + * config/i386/i386.c (x86_cmpxchg8b, x86_cmpxchg16b): New variables. + * config/i386/sync.md (CASMODE, DCASMODE): New mode macros. + (doublemodesuffix, DCASHMODE): New mode attrs. + (sync_compare_and_swap): Change into expand, use CASMODE + instead of IMODE, if mode is wider than a word, expand into + sync_double_compare_and_swap*. + (*sync_compare_and_swap): New insn. + (sync_double_compare_and_swap): Likewise. + (*sync_double_compare_and_swapdi_pic): Likewise. + (sync_compare_and_swap_cc): Use CASMODE instead of IMODE, if + mode is wider than a word, expand into + sync_double_compare_and_swap_cc*. + (sync_double_compare_and_swap_cc): New insn. + (*sync_double_compare_and_swap_ccdi_pic): Likewise. + +2005-12-22 Richard Henderson + + * config/i386/mmintrin.h (_mm_add_si64): Only define for SSE2. + (_mm_sub_si64): Likewise. + * config/i386/xmmintrin.h (_mm_shuffle_pi16, _m_pshufw): Likewise. + +2005-12-23 Alan Modra + + PR rtl-optimization/25432 + * reload1.c (eliminate_regs_in_insn): Update insn code on + successfully re-recognizing modified insn. + +2005-12-22 Richard Guenther + + * tree.c (tree_fold_gcd): Use build_int_cst where appropriate. + * tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise. + * varasm.c (array_size_for_constructor): Likewise. + * fold-const.c (size_diffop, invert_truthvalue, + optimize_bit_field_compare, make_range, build_range_check, + fold_cond_expr_with_comparison, fold_truthop, + fold_single_bit_test_into_sign_test, fold_binary): Likewise. + +2005-12-22 Dale Johannesen + + * config/i386/sse.md (sse_movhlps): Reverse operands for + 2nd and 3rd alternatives. + +2005-12-22 Andrew Pinski + + PR tree-opt/25513 + * tree-dfa.c (make_rename_temp): Set DECL_COMPLEX_GIMPLE_REG_P complex + variables. + +2005-12-22 Zdenek Dvorak + Steven Bosscher + + * df.c (df_bitmaps_free): Only work for bbs for that structures are + allocated. + (df_bb_modify): Realloc tables to the new index. + (df_find_use): New function. + (df_find_def, df_reg_used): Handle subregs. + * df.h (df_find_use): Declare. + + * loop-invariant.c: Include hashtab.h. + (struct invariant): Remove processed field, add eqto and reg fields. + (struct invariant_expr_entry): New. + (invariant_for_use, hash_invariant_expr_1, invariant_expr_equal_p, + hash_invariant_expr, eq_invariant_expr, find_or_insert_inv, + find_identical_invariants, merge_identical_invariants): New functions. + (create_new_invariant): Return the new invariant. Initialize new + fields. + (find_invariants): Call merge_identical_invariants. + (get_inv_cost, best_gain_for_invariant, set_move_mark, + move_invariant_reg): Handle equivalent invariants. + * Makefile.in (loop-invariant.o): Add HASHTAB_H dependency. + +2005-12-22 Volker Reichelt + + PR c++/23333 + * c-lex.c (c_lex_with_flags): Add PURE_ZERO to cpp_flags if + number is a single digit '0'. + +2005-12-22 Kazu Hirata + + PR tree-optimization/23518 + * fold-const.c (make_range): Don't move a constant to the + other side of the comparison if the type is signed and -fwrapv + is given. + +2005-12-22 Kazu Hirata + + * tree-vrp.c (extract_range_from_binary_expr): Clean up uses + of vr0.type. + +2005-12-21 Joseph S. Myers + + PR middle-end/24998 + * config/arm/t-arm-elf (LIB1ASMFUNCS): Add _floatundidf and + _floatundisf. + +2005-12-21 Andrew Haley + + PR middle-end/25121 + * recog.c (peephole2_optimize): Don't peephole any + RTX_FRAME_RELATED_P insns. + +2005-12-21 Kazu Hirata + + * tree-data-ref.c (estimate_niter_from_size_of_data): Replace + fold_build2 with fold_binary. + * tree-ssa-ccp.c (visit_assignment, maybe_fold_stmt_addition): + Replace fold_build1 with fold_unary. + * tree-ssa-reassoc.c (optimize_ops_list): Replace fold_build2 + with fold_binary. + +2005-12-21 Steven Bosscher + + PR rtl-optimization/25196 + * postreload-gcse.c (record_last_set_info): Notice stack pointer + changes in push insns without REG_INC notes. + +2005-12-21 Kazu Hirata + + PR tree-optimization/25382. + * tree-vrp.c (extract_range_from_binary_expr): Extract a range + from BIT_AND_EXPR. + +2005-12-21 Janis Johnson + Ben Elliston + + * configure.ac: Enable C extension for decimal float if invoked + with --enable-decimal-float. + * doc/install.texi (Configuration): Document it. + * configure, config.in: Regenerate. + +2005-12-20 Mike Stump + + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Handle the + ambiguity between -seg_addr_table and -seg_addr_table_filename. + (WORD_SWITCH_TAKES_ARG): Likewise. + (LINK_SPEC): Likewise. + +2005-12-20 Kenneth Zadeck + + * cfganal.c (flow_reverse_top_sort_order_compute): + Renamed to post_order_compute and additional parameter added which + allows the inclusion of entry and exit blocks into list. + (mark_dfs_back_edges): Fixed comment. + (flow_depth_first_order_compute): Renamed to + pre_and_rev_post_order_compute additional parameter added which + allows the inclusion of entry and exit blocks into list. + * global.c (set_up_bb_rts_numbers): Call to + flow_reverse_top_sort_order_compute renamed to + post_order_compute. + * var-tracking.c (vt_stack_adjustments): Fixed comment. + (vt_find_locations): Call to + flow_depth_first_order_compute renamed to + pre_and_rev_post_order_compute. + * cfgloop.c (flow_find_loops): Ditto. + * tree-ssa-reassoc.c (init_reassoc): Ditto. + * df.c (df_analyze_1, df_analyze_subcfg): Calls to + flow_reverse_top_sort_order_compute renamed to post_order_compute + and calls to flow_reverse_top_sort_order_compute renamed to + post_order_compute. + * basic_block.h: Ditto. + + +2005-12-20 Roger Sayle + Paolo Bonzini + + PR rtl-optimization/25115 + * gcse.c (pre_insert_copy_insn): Fall back to the sole + SET in the insn if there is no SET for an + expression that is equivalent to EXPR. + +2005-12-20 Richard Guenther + + PR middle-end/24306 + * builtins.c (std_gimplify_va_arg_expr): Do not align + va frame for zero sized types. + * config/i386/i386.c (ix86_gimplify_va_arg): Likewise. + +2005-12-20 Kazu Hirata + + PR tree-optimization/25501 + * tree-cfgcleanup.c (merge_phi_nodes): Check that RESULT is + used in the PHI argument corresponding to the edge from BB to + DEST. + +2005-12-20 Richard Guenther + + Revert + 2005-12-02 Richard Guenther + + * tree-cfg.c (mark_used_vars): New function. + (dump_function_to_file): Dump only used VAR_DECLs. + +2005-12-19 Roger Sayle + + * combine.c (try_combine): Improve splitting of binary operators + by taking advantage of reassociative transformations. + +2005-12-19 Jeff Law + + * tree-ssa-dom.c (thread_across_edge): Do not use local_fold. + Strip away all type conversions after simplifying the + condition. + + * tree-cfgcleanup.c (merge_phi_nodes): Allow merging in some + cases the forwarder block dominates the destination. + +2005-12-19 DJ Delorie + + * reload1.c (spill_failure): Dump reload data to dump file. + (find_reload_regs): Likewise. + +2005-12-19 Zdenek Dvorak + + PR tree-optimization/24793 + * tree-ssa-loop-ivopts.c (get_ref_tag): Remember the + original reference if there are subvars. + * tree-ssa-operands.c (get_tmr_operands): Handle subvars. + +2005-12-19 Kenneth Zadeck + + * df.c (df_analyze_1, df_analyze_subcfg, iterative_dataflow): + Corrected basic block number calculations for changes in entry and + exit numbering. + +2005-12-19 Zdenek Dvorak + + * tree-flow.h (struct var_ann_d): Change type of + may_aliases field to VEC(tree, gc) *. + (may_aliases): Declaration changed. + * tree-ssa-alias.c (group_aliases, add_may_alias, + replace_may_alias, dump_may_aliases_for, + is_aliased_with, add_type_alias, new_type_alias): + Work with VEC(tree, gc) * instead of varray. + * tree-flow-inline.h (may_aliases): Ditto. + * tree-ssa.c (verify_flow_insensitive_alias_info, + verify_name_tags): Ditto. + * tree-ssa-operands.c (add_stmt_operand): Ditto. + +2005-12-19 J"orn Rennecke + + * cfgcleanup.c: Temporarily revert patches for PR 20070 till Bernd + comes back. + +2005-12-19 J"orn Rennecke + + * struct-equiv.c (struct_equiv_improve_checkpoint): Fix sets_cc0_p + check. + +2005-12-19 Ben Elliston + + * doc/install.texi (Configuration): Typo in Fortran subheading. + +2005-12-19 Nathan Sidwell + + * config/mt/mt.md (decrement_and_branch_until_zero): Add another + scratch. Correct its reload split. Adjust its peephole. + (doloop_end): Add additional scratch. + (nop): Use 'nop'. + * config/mt/mt.c (MT_INT_ARG_FIRST): Remove. + (mt_asm_output_opcode, mt_print_operand): Use 'nop'. + (mt_function_arg_slotno): Use FIRST_ARG_REGNUM. + (mt_builtin_saveregs): Replace with ... + (mt_setup_incoming_varargs): ... here. Save just the varadic + args. + (mt_va_start): Remove. + (mt_reorg_hazard): Ignore USE insns. Don't call set_noop_p. + (mt_machine_reorg): Split all insns here. + (TARGET_SETUP_INCOMING_VARARGS): Override. + * config/mt/mt.h (TARGET_CPU_CPP_BUILTINS): Define __mt__ only. + Set to CPU type. + (EXPAND_BUILTIN_VA_START): Remove. + +2005-12-17 Kenneth Zadeck + + * flow.c (update_life_info, count_or_remove_death_notes): Fixed + latent bug that could happen if update_life_info was called with a + blocks parameter and the call to cleanup_cfg actually deleted one + of those blocks. + +2005-12-19 Zdenek Dvorak + + * tree-ssa-structalias.c (update_alias_info): Remove handling + of may_be_aliased (SSA_NAME_VAR (op)) case. + +2005-12-19 Zdenek Dvorak + + * tree-flow.h (struct stmt_ann_d): Remove + makes_aliased_loads and makes_aliased_stores fields. + * tree-ssa-ccp.c (likely_value): Do not use makes_aliased_stores + and makes_aliased_loads fields. + * tree-ssa-dom.c (eliminate_redundant_computations): Do not + use makes_aliased_stores. + * tree-ssa-operands.c (clobbered_aliased_loads, + clobbered_aliased_stores, ro_call_aliased_loads): Removed. + (build_ssa_operands, add_stmt_operand, add_call_clobber_ops, + add_call_read_ops): Do not set makes_aliased_stores and + makes_aliased_loads fields. + * tree-ssa.c (verify_ssa): Do not verify makes_aliased_stores + field. + +2005-12-18 Geoffrey Keating + + * config/darwin.h: Don't include darwin-sections.def to declare + global variables; instead create darwin_section_enum. + (darwin_section_enum): New. + (darwin_sections): New. + * config/darwin.c: Don't include darwin-sections.def to define + global variables. + (darwin_sections): New. + (output_objc_section_asm_op): Rewrite to take advantage of + darwin_sections. + (darwin_init_sections): Rewrite to use darwin_sections. + (machopic_output_indirection): Update for darwin_sections array. + (machopic_select_section): Likewise. + (machopic_select_rtx_section): Likewise. + (machopic_asm_out_constructor): Likewise. + (machopic_asm_out_destructor): Likewise. + (darwin_file_end): Likewise. + * config/rs6000/rs6000.c (machopic_output_stub): Likewise. + * config/i386/i386.c (machopic_output_stub): Likewise. + +2005-12-18 Richard Guenther + + PR tree-optimization/25481 + * tree-ssa-structalias.c (handle_ptr_arith): Handle accesses we + don't have a varinfo for. + +2005-12-18 Jon Grimm + Janis Johnson + Ben Elliston + + * optabs.c (init_floating_libfuncs): Handle decimal float modes. + (init_optabs): Handle libfuncs for decimal float. + * genopinit.c (gen_insn): Handle MODE_DECIMAL_FLOAT. + * stor-layout.c (int_mode_for_mode): Likewise. + * simplify-rtx.c (simplify_immed_subreg): Likewise. + (simplify_unary_operation_1): Skip optimisations for decimal float + modes. + * varasm.c (output_constant_pool_2): Handle MODE_DECIMAL_FLOAT. + * emit-rtl.c (gen_const_vector): Add assertion check. + (init_emit_once): Populate const_tiny_rtx with constants in each + decimal float mode. + * expmed.c (extract_high_half, expand_mult_highpart_optab, + expand_mult_highpart): Assert that mode is not a scalar float + mode. + * expr.c (convert_move): Handle conversion between decimal and + binary floats of the same size. + * convert.c (convert_to_real): Consider decimal float types when + folding. + * dwarf2out.c (base_type_die): Use DW_ATE_decimal_float to + describe decimal floating point types. + +2005-12-18 Ulrich Weigand + + PR rtl-optimization/21041 + * reload.c (find_reloads_subreg_address): Replace paradoxical + subreg of MEM by widened access only if the resulting memory + is properly aligned, even on !STRICT_ALIGNMENT targets. + +2005-12-18 Andreas Krebbel + + * tree-cfg.c (tree_flow_call_edges_add): Check for empty basic blocks. + +2005-12-18 Steven Bosscher + + * gcse.c (gcse_main, bypass_jumps): Fix non-GNU-isms from + the 2005-12-17 patch to renumber the entry and exit blocks. + +2005-12-18 Gabriel Dos Reis + + * doc/objc.texi (Type encoding): Fix typo. + +2005-12-17 Gabriel Dos Reis + + * tree-tailcall.c (find_tail_calls): Use XNEW. + * tree-ssa-dom.c (allocate_edge_info): Use XCNEW. + (free_all_edge_infos): Use explicit cast to convert from void *. + (vrp_free): Likewise. + (dom_opt_finalize_block): Likewise. + (record_equivalences_from_incoming_edge): Likewise. + (thread_across_edge): Likewise. Use XCNEWVEC. + (record_cond): Use XCNEW. + (record_conditions): Use XNEWVEC. + (record_edge_info): Use XCNEWVEC. + (lookup_avail_expr): Use XNEW. + (record_range): Likewise. Use GGC_NEW. + * tree-nested.c (var_map_hash): Use explicit cast to convert from + void *. + (var_map_eq): Likewise. + (lookup_field_for_decl): Likewise. + (convert_nonlocal_reference): Likewise. + (convert_local_reference): Likewise. + (convert_nl_goto_reference): Likewise. + (convert_nl_goto_receiver): Likewise. + (convert_call_expr): Likewise. + (convert_tramp_reference): Likewise. + (lookup_tramp_for_decl): Likewise.Use GGC_NEW. + (convert_nl_goto_reference): Likewise. + (lookup_field_for_decl): Use GGC_NEW. + (create_nesting_tree): Use GGC_CNEW. + * tree-ssa-phiopt.c (blocks_in_phiopt_order): Use XNEWVEC. + * tree-ssa-alias.c (init_alias_info): Use XCNEW. + (create_alias_map_for): Likewise. + (setup_pointers_and_addressables): Use XCNEWVEC. + (get_ptr_info): Use GGC_NEW. + (used_part_map_eq): Use explicit cast to convert from void *. + (up_lookup): Likewise. + (up_insert): Use XNEW. + (get_or_create_used_part_for): Use XCNEW. + (get_tmt_for): Likewise. + * tree-ssa-operands.c (ssa_operand_alloc): Use GGC_NEW. + * tree-ssa-pre.c (phi_trans_add): Use XNEW. + (bitmap_set_new): Use explicit cast to convert from void *. + (set_new): Likewise. + (insert_into_set): Likewise. + (pool_copy_list): Likewise. + (phi_translate): Likewise. + (create_value_expr_from): Likewise. + (insert_aux): Use XCNEWVEC. + (compute_avail): Use XNEWVEC. + * tree-ssa-live.c (calculate_live_on_entry): Likewise. + (sort_coalesce_list): Likewise. + (build_tree_conflict_graph): Use XCNEWVEC. + * tree-ssa-dce.c (tree_dce_init): Use XNEWVEC. + * tree-ssa-copy.c (init_copy_prop): Likewise. + (fini_copy_prop): Likewise. + * tree-ssa-uncprop.c (associate_equivalences_with_edges): Use XNEW + and XCNEWVEC. + (record_equiv): Use XNEW. + (uncprop_into_successor_phis): Use explicit cast to convert from + void *. + (uncprop_initialize_block): Likewise. + +2005-12-18 Dorit Nuzman + + PR tree-optimization/24378 + * tree-vect-transform.c (vect_transform_loop): Create single-predecessor + basic-block after loop-versioning. + +2005-12-18 Jeff Law + + * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Code + to simplify SWITCH_EXPR_CODE moved from here to ... + * tree-ssa-forwprop.c (simplify_switch_expr): Here. + (tree-ssa-forward_propagate_single_use_vars): Call + simplify_switch_expr when appropriate. + +2005-12-17 Andrew Pinski + + * doc/objc.texi (Type encoding): Add documentation about encoding + complex types and _Bool. + +2005-12-17 Paul Brook + + * config/m68k/m68k.md (m68k_output_function_prologue): Always call + dwarf2out_def_cfa. Only add space for frame pointer to cfa_offset + when frame_pointer_needed. + +2005-12-17 Gabriel Dos Reis + + * tree-vn.c (vn_add): Use XNEW. + * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC. + (ccp_fold): Likewise. + (fold_stmt_r): Use explicit cast to convert from void *. + * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC. + (new_temp_expr_table): Likewise. + * gimplify.c (lookup_tmp_var): Use XNEW. + (gimplify_asm_expr): Use explcit cast to convert from void *. + * tree-into-ssa.c (get_ssa_name_ann): Likewise. + (get_def_blocks_for): Use XNEW. + (add_to_repl_tbl): Likewise. + (mark_def_sites): Use explicit cast to convert from void *. + (def_blocks_free): Likewise. + (mark_def_sites_initialize_block): Likewise. + (update_ssa): Use XNEWVEC. + * tree-dfa.c (create_var_ann): Use GGC_NEW. + (create_stmt_ann): Likewise. + (create_tree_ann): Likewise. + (referenced_var_insert): Likewise. + (set_default_def): Likewise. + (referenced_var_lookup_if_exists): Use explicit cast to convert + from void *. + (referenced_var_lookup): Likewise. + (default_def): Likewise. + (set_default_def): Likewise. + * tree-cfg.c (create_bb): Likewise. + (edge_to_cases_cleanup): Likewise. + (verify_node_sharing): Likewise. + (record_switch_edge): Use XNEW. + (cleanup_dead_labels): Use XCNEWVEC. + (tree_duplicate_sese_region): Use XNEWVEC. + * tree-scalar-evolution.c (get_instantiated_value): Likewise. + * tree-ssa.c (verify_ssa): Use XCNEWVEC. + (int_tree_map_eq): Use explicit cast to convert from void *. + * libgcov.c (gcov_exit): Use explicit cast to convert from void *. + (__gcov_execl): Likewise. + (__gcov_execlp): Likewise. + (__gcov_execle): Likewise. + * tree-eh.c (struct_ptr_eq): Likewise. + (struct_ptr_hash): Likewise. + (lookup_stmt_eh_region_fn): Likewise. + (outside_finally_tree): Likewise. + (find_goto_replacement): Likewise. + (make_eh_edge): Likewise. + (mark_eh_edge): Likewise. + (add_stmt_to_eh_region_fn): Use GGC_NEW. + (record_in_finally_tree): Use XNEW. + (maybe_record_in_goto_queue): Use XRESIZEVEC. + (lower_try_finally_copy): Use XCNEWVEC. + +2005-12-17 Gabriel Dos Reis + + * tree-inline.c (copy_body_r): Use explicit cast when converting + from void *. + (copy_bb): Likewise. + (copy_edges_for_bb): Likewise. + (remap_decl_1): Likewise. + (estimate_num_insns_1): Likewise. + * cgraph.c (hash_node): Use explicit cast when converting from + void *. + (eq_node): Likewise. + (cgraph_create_node): Use GGC_CNEW. + (cgraph_create_edge): Use GGC_NEW. + (cgraph_remove_node): Use explicit cast when converting from void *. + (hash_varpool_node): Likewise. + (eq_varpool_node): Likewise. + (cgraph_varpool_node): Use GGC_CNEW. + * lambda.h (lambda_vector_new): Use GGC_CNEWVEC. + * tree-scalar-evolution.c (new_scev_info_str): Use XNEW. + (eq_scev_info): Use explicit cast when converting from void *. + (find_var_scev_info): Likewise. + (set_instantiated_value): Likewise. + (gather_stats_on_scev_database_1): Likewise. + * cfgloop.h (simple_loop_desc): Use explicit cast when converting + from void *. + * c-pch.c (c_common_write_pch): Use XNEWVEC. + (c_common_read_pch): Likewise. + * prefix.c (save_string): Use XNEWVEC. + (translate_name): Use explicit cast when converting from void *. + * c-ppoutput.c (print_line): Use explicit cast when converting + from void *. + (pp_dir_change): Likewise. + * c-cppbuiltin.c (builtin_define_std): Likewise. + (builtin_define_with_value): Likewise. + (builtin_define_with_value_n): Likewise. + (builtin_define_with_int_value): Likewise. + (builtin_define_type_max): Likewise. + * c-incpath.c (add_env_var_paths): Use XNEWVEC. + (add_path): Use XNEW. + * c-format.c (check_format_info_main): Use GGC_NEW. + (format_type_warning): Use explicit cast when converting from void *. + * c-typeck.c (alloc_tagged_tu_seen_cache): Use XNEW instead of + xmalloc. + (start_init): Likewise. + * tree-flow-inline.h (first_referenced_var): Use explicit cast + when converting from void *. + (next_referenced_var): Likewise. + * c-pragma.c (push_alignment): Use GGC_NEW instead of ggc_alloc. + * gensupport.c (lookup_predicate): Use explicit cast to convert + from void *. + (init_predicate_table): Use XCNEW instead of xcalloc. + * genpreds.c (process_define_predicate): Likewise. + +2005-12-17 Danny Berlin + Kenneth Zadeck + + * basic-block.h: Changed basic block numbering so that the entry + block is 0 and the exit block is 1. Changed insn iterators so + that they are tolerant of blocks with no insns. + * regrename.c (copyprop_hardreg_forward): Changed basic block + numbering so that the entry block is 0 and the exit block is 1. + * sched-ebb.c (sehedule_ebbs): Ditto. + * tracer.c (branch_ratio_cutoff): Ditto. + * cfgloopmanip.c (fix_loop_structure): Ditto. + * cfghooks.c (verify_flow_info): Ditto. + * cfg.c (compact_blocks): Ditto. + * reorg.c (dbr_schedule): Ditto. + * flow.c (calculate_global_regs_live, libcall_dead_p): Ditto. + * dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree, + calculate_dominance_info): Ditto. + * cfganal.c (create_edge_list, print_edge_list, + flow_depth_first_order_compute, flow_dfs_compute_reverse_init, + flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute, + dfs_enumerate_from): Ditto. + * global.c (global_alloc, set_up_bb_rts_numbers): Ditto. + * ifcvt.c (find_if_case_2): Ditto. + * cfgbuild.c (control_flow_insn_p, count_basic_blocks, + find_basic_blocks): Ditto. + * predict.c (predict_loops, tree_bb_level_predictions, + predict_paths_leading_to, propagate_freq): Ditto. + * lcm.c (compute_antinout_edge, compute_laterin, + compute_available): Ditto. + * function.c (thread_prologue_and_epilogue_insns): Ditto. + * gcse.c (gcse_main, bypass_jumps): Ditto. + * profile.c (compute_branch_probabilities, + compute_value_histograms, branch_prob): Ditto. + * tree-flow-inline.h (bsi_start, bsi_after_labels, + bsi_last): Ditto. + * tree-ssa-phiopt.c (tree_ssa_phiopt, + blocks_in_phiopt_order): Ditto. + * bt-load.c (compute_defs_uses_and_gen, compute_kill, + compute_out, link_btr_uses, migrate_btr_defs): Ditto. + * tree-dfa.c (collect_dfa_stats): Ditto. + * cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto. + * cfglayout.c (fixup_reorder_chain): Ditto. + * bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos, + partition_hot_cold_basic_blocks): Ditto. + * var-tracking.c (vt_find_locations): Ditto. + * cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto. + * sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto. + * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges + label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto. + * tree-ssa-reassoc.c (init_reassoc): Ditto. + * cfgrtl.c (entry_of_function, rtl_verify_flow_info, + rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto. + * df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto + and removed unused reverse orders. + * df.h (): Ditto. + * combine.c: Fix document typo. + +2005-12-17 Jan Hubicka + + * tree-flow-inline.h (set_default_def, default_def): Kill. + * tree-dfa.c (default_defs): New global variable. + (default_def, set_default_def): New functions. + * tree-ssa.c (init_tree_ssa, delete_tree_ssa): Add default_def hash. + * tree-flow.h (struct var_ann_d): Kill default_def field. + (set_default_def, default_def): Update prototype. + (default_defs): Declare. + +2005-12-16 Jeff Law + + * tree-ssa-dom.c (update_rhs_and_lookup_avail_expr): Kill. + (simplify_rhs_and_lookup_avail_expr): Kill. Remnants moved + into tree-ssa-forwprop.c. + (eliminate_redundant_computations): Do not call + simplify_rhs_and_lookup_avail_expr anymore. + * tree-ssa-forwprop.c (simplify_not_neg_expr): New function + extracted from remnants of simplify_rhs_and_lookup_avail_expr. + (tree_ssa_forward_propagate_single_use_vars): Call + simplify_not_neg_expr appropriately. + +2005-12-16 Bernd Trog + + PR target/20016 + * config/avr/t-avr: Add -Os to TARGET_LIBGCC2_CFLAGS. + +2005-12-17 Kazu Hirata + + PR rtl-optimization/25456 + * struct-equiv.c (struct_equiv_improve_checkpoint): Replace + info->x_start with p->x_start. + +2005-12-17 Alan Modra + + * simplify-rtx.c (simplify_binary_operation_1 ): Correct bug + introduced 2005-12-16. + +2005-12-16 Steven Bosscher + + PR rtl-optimization/23837 + * optabs.c (expand_binop): For a multi-word rotate, never emit + a REG_NO_CONFLICT block. + +2005-12-16 John David Anglin + + PR middle-end/25457 + * reorg.c (mostly_true_jump): Remove unused variable 'insn'. + + PR target/25447 + * config/pa/pa.c (pa_scalar_mode_supported_p): Handle + MODE_DECIMAL_FLOAT. + +2005-12-16 Steven Bosscher + + * loop-invariant.c (move_loop_invariants): Add missing hunk from + the previous patch, to nullify df. + +2005-12-16 Steven Bosscher + + * reorg.c (mostly_true_jump): Clean up code depending on + LABEL_OUTSIDE_LOOP_P and loop notes. Remove code doing + poor man's branch prediction, instead rely on REG_BR_PROB + notes to be available. + +2005-12-16 Jakub Jelinek + + PR rtl-optimization/24899 + * loop.c (strength_reduce): Don't reduce giv that is not always + computable and where add_val or mult_val can trap. + + * doc/invoke.texi (-fdump-tree-*): Remove note about C/C++ only. + +2005-12-16 Nathan Sidwell + + * config/mt/mt.h (LIB_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Correct + names of ms1-16-002 files. + +2005-12-16 Alan Modra + + PR driver/20425 + * gcc.c (for_each_path): New function. + (add_to_obstack, file_at_path): New functions. + (struct file_at_path_info, struct add_to_obstack_info): New. + (build_search_list): Rewrite using for_each_path. Constify struct + path_prefix pointer. Add do_multi param. Adjust all callers. + (find_a_file): Similarly, but just change existing param to bool. + (putenv_from_prefixes): Add do_multi param, make "paths" const. + (do_spec_path): Delete. + (struct spec_path_info): New. + (spec_path): New function. + (do_spec_1): Use for_each_path for %D and %I. + (find_file): Adjust for find_a_file changes. + (main): Search multilibs for specs. Print multilib lib path for + -print-search-dirs. Likewise add multilibs to LIBRARY_PATH_ENV. + (read_specs): Search multilibs for %include and %include_noerr. + (is_directory): Remove second string param. Change last param + to a bool. Don't use concat. Remove SMALL_ARG_MAX test, always + check path is a dir. Update all callers. + * doc/hostconfig.texi (SMALL_ARG_MAX): Remove mention. + * system.h (SMALL_ARG_MAX): Poison. + * config.gcc: Don't define SMALL_ARG_MAX. + * config.host: Likewise. + * config.build: Likewise. + +2005-12-16 Paolo Bonzini + + * combine.c (combine_simplify_rtx , + simplify_logical): Move simplifications that do not require + additional infrastructure... + * simplify-rtx.c (simplify_unary_operation_1, + simplify_binary_operation_1): ... here. + +2005-12-16 Andreas Krebbel + + PR 24823 + * flow.c (mark_used_dest_regs): New function. + (mark_used_regs): Call mark_used_dest_regs. + +2005-12-16 Jeff Law + + * tree-ssa-dse.c (dse_optimize_stmt): Correctly handle PHI nodes which + represent a use and definition of the same SSA_NAME. + +2005-12-16 Jon Grimm + Janis Johnson + Ben Elliston + + * target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New. + (TARGET_INITIALIZER): Add TARGET_DECIMAL_FLOAT_P. + * target.h (struct gcc_target): Add decimal_float_supported_p. + * targhooks.c (default_scalar_mode_supported_p): Handle + MODE_DECIMAL_FLOAT. + * builtins.def: Add new builtins for 32, 64 and 128 bit variants + of inf, nan, finite, isinf and isnan. + * builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128, + BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR, + BT_FN_DFLOAT32, BT_FN_DFLOAT64, BT_FN_DFLOAT128, + BT_FN_INT_DFLOAT32, BT_FN_INT_DFLOAT64, BT_FN_INT_DFLOAT128, + BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT64_CONST_STRING, + BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT32_DFLOAT32, + BT_FN_DFLOAT64_DFLOAT64, BT_FN_DFLOAT128_DFLOAT128): New. + * c-decl.c (declspecs_add_type): Verify combos on type qualifiers. + Pedwarn if decimal floating point types are used. Error if + decimal floating point is not supported by the target. + (finish_declspecs): Return type from DFP typespec_word. + * c-typeck.c (c_common_type): Choose the decimal floating point + type with the greater precision when determining a common type. + (convert_arguments): Warn if there is a mismatch between argument + and prototype for decimal float types. Warn of conversions with + binary float types and of precision narrowing due to prototype. + * c-parser.c (reswords): Add _Decimal32, _Decimal64, _Decimal128. + (c_token_starts_typename): Handle RID_DFLOAT32/64/128. + (c_token_starts_declspecs): Likewise. + (c_parser_attributes): Likewise. + * c-common.h (enum rid): Add new enumeration values RID_DFLOAT32, + RID_DFLOAT64, RID_DFLOAT128. + (T_D32, TEX_D32, T_D64, TEX_D64, T_D128, TEX_D128): New macros. + * c-common.c (c_common_type_for_mode): Handle decimal float modes. + (shorten_compare): Convert DFP/BFP operands to a common type. + (c_common_modes_and_builtins): Register built-in decimal float + types if the target supports them. + (handle_mode_addtribute): Handle MODE_DECIMAL_FLOAT. + * builtins.c (fold_builtin_1): Handle 32, 64 and 128 bit cases of + inf, nan, finite, isinf and isnan builtins. + * c-cppbuiltin.c (builtin_define_decimal_float_constants): New. + (builtin_define_float_constants): Assert non-decimal radix. + (c_cpp_builtins): Register built-in __DEC_EVAL_METHOD__ define. + Call builtin_define_decimal_float_constants for each type. + * c-lex.c (interpret_float): Decode decimal float types from CPP_N + flags. Use real_from_string3, which can handle binary or decimal + floats. + * c-tree.h (enum c_typespec_keyword): Add cts_dfloat32, + cts_dfloat64, cts_dfloat128. + * tree.c (build_common_tree_nodes_2): Add decimal float types. + * tree.h (enum tree_index): Add new enumeration values + TI_DFLOAT32_TYPE, TI_DFLOAT64_TYPE, TI_DFLOAT128_TYPE, + TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE, TI_DFLOAT128_PTR_TYPE. + (dfloat32_type_node): New macro. + (dfloat64_type_node, dfloat128_type_node): Likewise. + (dfloat32_ptr_type_node, dfloat64_ptr_type_node): Likewise. + (dfloat128_ptr_type_node): Likewise. + * c-pretty-print.c (pp_c_floating_constant): Append 32, 64 and 128 + bit decimal floating point types with "df", "dd" and "dl". + * c-format.h (enum format_lengths): Add new enumeration values + FMT_LEN_H, FMT_LEN_D and FMT_LEN_DD. + * c-format.c (printf_length_specs, scanf_length_specs): Add + entries for H, D, DD. + (print_char_table, scan_char_table): Use new entries. + (asm_fprintf_char_table, gcc_diag_char_table, + gcc_cdiag_char_table, gcc_cxxdiag_char_table): Adjust for longer + length arrays. + * defaults.h (DECIMAL32_TYPE_SIZE): Define. + (DECIMAL64_TYPE_SIZE): Likewise. + (DECIMAL128_TYPE_SIZE): Likewise. + (TARGET_DEC_EVAL_METHOD): Likewise. + * doc/extend.texi (Decimal Float): New node. + (Constructing Calls): Document decimal float built-ins. + * doc/tm.texi: Document TARGET_DECIMAL_FLOAT_SUPPORTED_P hook. + * Makefile.in (USER_H): Add $(srcdir)/ginclude/decfloat.h. + * ginclude/decfloat.h: New file. + +2005-12-16 Alan Modra + + * reload.c (find_reloads): Fix comment typo. + * recog.h (recog_memoized): Correct comment. + +2005-12-16 Kazu Hirata + + * basic-block.h, config/i386/winnt.c, config/pa/pa.c, + config/s390/s390.c, dfp.c, expr.c, fold-const.c, params.def, + reload.c, struct-equiv.c, tree-ssa-ccp.c, tree-ssa-pre.c, + tree-ssa-reassoc.c, tree-ssa-structalias.c: Fix comment typos. + * doc/invoke.texi, doc/tm.texi: Fix typos. + +2005-12-16 Ben Elliston + + * real.c (decimal_quad_format): Correct values for emin, emax. + +2005-12-15 DJ Delorie + + * config/m32c/predicates.md (m32c_psi_scale): New. + * config/m32c/m32c.c (m32c_expand_neg_mulpsi3): New. + * config/m32c/muldiv.md (mulpsi3): Support negative constants. + +2005-12-16 Jan Hubicka + + PR rtl-optimization/25224 + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Free copy + tables. + +2005-12-15 Zdenek Dvorak + Steven Bosscher + + * loop-invariant.c (df): New global variable. + (find_defs, check_dependencies, find_invariant_insn, record_uses, + find_invariants_bb, find_invariants_body, find_invariants, + find_invariants_to_move, move_invariants, free_inv_motion_data, + move_single_loop_invariants, move_loop_invariants): Do not pass df in + arguments. + +2005-12-15 Jakub Jelinek + + * varasm.c (default_unique_section_1): Use special section + names for SECCAT_DATA_REL{,_RO}{,_LOCAL}. + +2005-12-16 Ben Elliston + + * doc/invoke.texi (Warning Options): Document -Walways-true being + enabled by -Wall. + +2005-12-15 Joseph S. Myers + + PR other/25028 + * libgcc2.h (SF_SIZE, DF_SIZE, XF_SIZE, TF_SIZE): Define. + * libgcc2.c (__floatdixf, __floatundixf, __floatditf, + __floatunditf): Use #error if type sizes don't match requirements + of implementation. + (__floatdisf, __floatdidf): Unify. Possibly use XFmode or TFmode + as wider floating-point type. Use #error if type sizes don't + match requirements of implementation. Avoid overflow in computing + Wtype_MAXp1_F * Wtype_MAXp1_F. When special casing conversion, + shift one more bit. Cast 1 to DWtype or UDWtype for shifting. + (__floatundisf, __floatundidf): Likewise. + * config/ia64/hpux.h (XF_SIZE, TF_SIZE): Define. + * config/ia64/ia64.c (ia64_init_libfuncs): Use + _U_Qfcnvfxt_quad_to_quad and _U_Qfcnvxf_quad_to_quad for + TFmode-TImode conversions. + * doc/tm.texi (SF_SIZE, DF_SIZE, XF_SIZE, TF_SIZE): Document. + +2005-12-14 Craig Rodrigues + + * freebsd-spec.h (FBSD_TARGET_OS_CPP_BUILTINS): + Use builtin_define_with_int_value() instead of + adding a new check for every new major FreeBSD version. + +2005-12-14 Andrew Pinski + + * config/t-darwin (darwin-c.o): Depend on $(TREE_H) instead of tree.h. + +2005-12-15 Richard Sandiford + + * config/arm/predicates.md (call_memory_operand): New. + * config/arm/arm.md (*call_mem, *call_value_mem): Use it. + +2005-12-15 Andrew Haley + + * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Guard + against prev_cache_entry == NULL when moving a cache entry to the + head of the list. + +2005-12-15 Nathan Sidwell + + * config/mt/mt.c (mt_override_options): Require lower case + architectures. Revert accidental default to ms2. + * config/mt/mt.h (ASM_SPEC, LIBSPEC, STARTFILE_SPEC, + ENDFILE_SPEC): Require lower case architectures. Revert default + to ms2. + + * doc/invoke.texi (MT Options): Rename and update. + * doc/md.texi (MorphoTech family): Rename and update. + +2005-12-15 Olivier Hainque + + * stor-layout.c (layout_type): Don't complain about a too small + an array element type size compared to its alignment when the + size overflows. + +2005-12-15 Jan Hubicka + + PR target/24969 + * i386.c (classify_argument): Properly adjust offset of bitfield for + substructures. + +2005-12-15 Richard Sandiford + + * final.c (final_scan_insn): Flip in_cold_section_p when changing + between the hot and cold sections. Use current_function_section + to get the new section. + * dwarf2out.c (output_line_info): Use in_cold_section_p to + determine whether we are assembling hot or cold code. + (secname_for_decl, dwarf2out_var_location): Likewise. + (dwarf2out_init, dwarf2out_finish): Use switch_to_section. + * varasm.c (last_text_section): Delete. + (in_cold_section_p): New variable. + (hot_function_section): New function. + (current_function_section): Pass in_cold_section_p as the + reloc argument to select_section. Use it to decide between + unlikely_function_section and hot_function_section. + (assemble_start_function): Use switch_to_section. Set + in_cold_section_p instead of last_text_section. + (assemble_end_function): Use switch_to_section. + (switch_to_section): Don't set last_text_section. + * config/darwin/darwin.c (machopic_select_section): Trust the reloc + argument to make the right choice between hot and cold sections. + +2005-12-15 Nathan Sidwell + + Second part of MS1->MT renaming + * config/mt/mt.md (doloop_end): Call mt_add_loop. + (movqi, movhi): Call mt_set_memflags. + (*movdf_internal): Call mt_split_words. + (reload_inqi, reload_outqi, reload_inhi, reload_outhi): Call + mt_set_memflags. + (cmpsi): Store to mt_compare_op[01]. + (beq, bne, bge, bgt, ble, blt, bgeu, bgtu, bleu, bltu, bunge, + bungt, bunle, bunlt): Call mt_emit_cbranch. + (prologue): Call mt_expand_prologue. + (epilogu): Call mt_expend_epilogue. + (eh_return): Call mt_expand_eh_return. + (eh_epilogue): Call me_emit_eh_epilogue. + (conditional_trap): Store to mt_compare_op[01]. + * config/mt/crti.asm: Adjust comment. + * config/mt/crtn.asm: Adjust comment. + * config/mt/mt.c (MT_INT_ARG_FIRST): Renamed. + (mt_compare_op0, mt_compare_op1): Renamed. + (current_frame_info, zero_frame_info): Adjust type. + (mt_ucmpsi3_libcall): Renamed. + (mt_flag_delayed_branch): Renamed. + (mt_struct_value_rtx, mt_return_addr_rtx): Renamed. + (mt_nops_required, mt_nop_reasons): Renamed. + (mt_asm_output_opcode, mt_get_attr_type, mt_final_prescan_insn, + mt_debug_stack, mt_print_operand_simple_address, + mt_print_operand_address, mt_print_operand): Renamed, adjusted. + (mt_init_cumulative_args, mt_function_arg_slotno, mt_function_arg, + mt_function_arg_advance, mt_arg_partial_bytes, + mt_pass_by_reference, mt_function_arg_boundary, + mt_reg_ok_for_base_p, mt_legitimate_simple_address_p, + mt_legitimate_address_p): Renamed, adjusted. + (mt_cpu): Renamed. + (mt_init_machine_status, mt_override_options, mt_builtin_saveregs, + mt_va_start, mt_compute_frame_size, mt_emit_save_restore, + mt_emit_save_fp, mt_emit_save_regs, mt_interrupt_function_p, + mt_expand_prologue, mt_epilogue_uses, mt_expand_epilogue, + mt_expand_eh_return, mt_emit_eh_prologue, + mt_handl_interrupt_attribute): Renamed, adjusted. + (mt_attribute_table): Renamed, adjusted. + (mt_initial_elimination_offset, mt_generate_compare, + mt_emit_cbranch, mt_set_memflags_1, mt_set_memflags, + mt_secondary_reload_class, mt_function_value, mt_split_words, + mt_pass_in_stack, mt_add_loop, mt_loop_nesting, mt_block_length, + mt_scan_loop, mt_reorg_loops): Renamed, adjusted. + (mt_labels): Renamed. + (mt_add_branches, mt_check_delay_slot, mt_reorg_hazard, + mt_machine_reorg): Renamed, adjusted. + (mt_attribute_table: Renamed. + (TARGET_ATTRIBUTE_TABLE, TARGET_STRUCT_VALUE_RTX, + TARGET_PASS_BY_REFERENCE, TARGET_MUST_PASS_IN_STACK, + TARGET_ARG_PARTIAL_BYTES, TARGET_MACHINE_DEPENDENT_REORG): Adjust. + * config/mt/mt.opt (march): Set mt_cpu_string. + * config/mt/mt.h (mt_ucmpsi3_libcall, mt_cpu): Renamed. + (TARGET_CPU_CPP_BUILTINS): Adjust. + (TARGET_MS1_64_001, TARGET_MS1_16_002, TARGET_MS1_16_003, + TARGET_MS2): Adjust. + (TARGET_VERSION, OVERRIDE_OPTIONS, SECONDARY_RELOAD_CLASS): Adjust. + (MT_MIN_INT): Renamed. + (RETURN_ADDR_RTX): Adjust. + (struct mt_frame_info): Renamed. + (current_frame_info): Adjust type. + (INITIAL_ELIMINATION_OFFSET): Adjust. + (MT_NUM_ARG_REGS): Renamed. + (REG_PARM_STACK_SPACE, FUNCTION_ARG, INIT_CUMULATVE_ARGS, + FUNCTION_ARG_ADVANCE, FUNCTION_ARG_BOUNDARY, FUNCTION_VALUE, + LIBCALL_VALUE, EPILOGUE_USES, EXPAND_BUILTIN_VA_START, + GO_IF_LEGITIMATE_ADDRESS, REG_OK_FOR_BASE_P, ASM_OUTPUT_OPCODE, + FINAL_REPSCAN_INSN, PRINT_OPERAND, PRINT_OPERAND_ADDRESS): Adjust. + (mt_compare_op0, mt_compare_op1): Renamed. + * config/mt/mt-protos.h: Rename prototypes. + +2005-12-15 Richard Guenther + + * tree-flow.h (okay_component_ref_for_subvars): Remove. + (get_ref_base_and_extent): Declare. + * tree-dfa.c (okay_component_ref_for_subvars): Remove. + (get_ref_base_and_extent): New function. + * tree-ssa-alias.c (find_used_portions): Use it. + * tree-ssa-structalias.c (get_constraint_for_component_ref): + Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + +2005-12-15 Paolo Bonzini + + * combine.c: Remove force_to_mode's fourth parameter. + (force_to_mode): Do not handle REG. + (canon_reg_for_combine): New. + (make_field_assignment): Use it where the removed argument was non-NULL. + +2005-12-15 Alan Modra + + PR target/25406 + * config/rs6000/rs6000.c (rs6000_special_round_type_align): Handle + error_mark_node. Make alignment params unsigned. + * config/rs6000/rs6000-protos.h + (rs6000_special_round_type_align): Update prototype. + (rs6000_machopic_legitimize_pic_address): Remove arg names. + +2005-12-14 Ulrich Weigand + + PR rtl-optimization/25310 + * reload1.c (eliminate_regs_in_insn): Handle lowpart SUBREGs + of the eliminable register when substituting into a PLUS. + +2005-12-14 Jakub Jelinek + + PR debug/25023 + * config/i386/i386.c (ix86_force_to_memory): Always use + SImode push for HImode in -m32. + (ix86_free_from_memory): Likewise. + +2005-12-14 Richard Sandiford + + * config/arm/arm.md: Provide a big-endian version of the + (zero_extend:SI (subreg:QI ...)) splitter. + +2005-12-14 J"orn Rennecke + + * struct-equiv.c (note_local_live): Handle hard regs with different + hard_regno_nregs. + +2005-12-14 Jeff Law + + * tree-ssa-ccp.c (fold_stmt_r): DATA argument is now a pointer + to a structure containing state rather than a pointer to bool. + (case ARRAY_REF): New code to handle folding some array references. + (case ADDR_EXPR): Note when we are processing expressions found + within an ADDRE_EXPR. + (fold_stmt, fold_stmt_inplace): Pass in a structure to fold_stmt_r + for state variables rather than just a pointer to a boolean. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove + handling of constant string references. + +2005-12-14 Adrian Straetling + + * config/s390/s390.md ("*tstdi_extimm", "*tstsi_extimm"): Merge. + ("*tstdi_cconly_extimm", "*tstsi_cconly_extimm"): Merge. + ("*tstdi_cconly2", "*tstsi_cconly2"): Merge. + Move other tst* patterns to retain partial order. + +2005-12-14 Adrian Straetling + + * config/s390/s390.md ("d0", "1"): New mode attributes. + ("di3", "si3"): Merge. + ("*di3_and", "*si3_and"): Merge. + ("ashrdi3", "ashrsi3"): Merge. + ("*ashrdi3_cc", "*ashrsi3_cc"): Merge. + ("*ashrdi3_cc_and", "*ashrsi3_cc_and"): Merge. + ("*ashrdi3_cconly", "*ashrsi3_cconly"): Merge. + ("*ashrdi3_cconly_and", "*ashrsi3_cconly_and"): Merge. + ("*ashrdi3", "*ashrsi3"): Merge. + ("*ashrdi3_and", "*ashrsi3_and"): Merge. + +2005-12-14 Adrian Straetling + + * config/s390/s390.md ("extenddi2", "extendsi2"): Merge. + ("*extendqidi2_extimm", "*extendqisi2_extimm"): Merge. + ("*extendqidi2", "*extendqisi2") Merge. + ("*extendqidi2_short_displ", "*extendqisi2_short_displ"): Merge. + ("zero_extendhidi2", "zero_extendqidi2"): Merge. + ("*zero_extenddi2_extimm", "*zero_extendsi2_extimm"): Merge. + Move some patterns to retain partial ordering. + +2005-12-14 Adrian Straetling + + * config/s390/s390.md ("atype", "length"): Rewrite. + ("*insv_reg_imm", "*insv_reg_extimm"): Add mode. + +2005-12-14 Sebastian Pop + + * tree-ssa-operands.c (build_ssa_operands): Update leading comment. + +2005-12-14 J"orn Rennecke + + * struct-equiv.c (rtx_equiv_p): Allow arbitrary RVALUE values for + PARALLELs with a mode. + +2005-12-14 Sebastian Pop + + * cfgloopmanip.c (lv_adjust_loop_entry_edge): Adjust the type of + cond_expr parameter. + +2005-12-14 Sebastian Pop + + * loop-unswitch.c (unswitch_loop): Free zero_bitmap before returning. + +2005-12-14 J"orn Rennecke + + PR bootstrap/25397: + + * struct-equiv.c (struct_equiv_init): Fix off-by-one error in clearing + of STACK_REGS bits. + + * struct-euiv.c (rtx_equiv_p): Remove SUBREG case. + +2005-12-14 Jakub Jelinek + + PR target/25254 + PR target/24188 + * config/i386/i386.c (x86_64_elf_select_section): If DECL is not + DECL_P, call get_section rather than get_named_section. Supply + section flags to it. + +2005-12-14 Ben Elliston + + * c-common.c (c_common_truthvalue_conversion): Generalise warning + for addresses converted to booleans; not just function addresses. + * c-typeck.c (build_binary_op): Warn for address comparisons which + can never be NULL (eg. func == NULL or &var == NULL). + * common.opt (Walways-true): New option. + * c-opts.c (c_common_handle_option): Set it with -Wall. + * doc/invoke.texi: Document it. + +2005-12-13 Paul Brook + + * config/m68k/fpgnulib.c (__unordsf2, __unorddf2, __unordxf2, + __floatunsidf, __floatunsisf, __floatunsixf): New functions. + +2005-12-13 Nathan Sidwell + + * config/mt/t-mt (crti.o, crtn.o): Add multilib options. + (EXTRA_MULTILIB_PARTS): Define. + +2005-12-13 J"orn Rennecke + + PR rtl-optimization/20070 / part1 + * flow.c (update_life_info): If PROP_POST_REGSTACK is set, call + count_or_remove_death_notes with kill == -1. + (mark_set_1): Don't add REG_DEAD / REG_UNUSED notes for stack + registers if PROP_POST_REGSTACK is set. + (mark_used_reg): Likewise. + (count_or_remove_death_notes): If kill is -1, don't remove REG_DEAD / + REG_UNUSED notes for stack regs. + * cfgcleanup.c (condjump_equiv_p): Change parameters and processing + to match rtx_equiv_p machinery. Change caller. + (outgoing_edges_match): Likewise. + (try_crossjump_to_edge): Use struct_equiv_block_eq + instead of flow_find_cross_jump. + * basic-block.h (PROP_POST_REGSTACK, STRUCT_EQUIV_START): Define. + (STRUCT_EQUIV_RERUN, STRUCT_EQUIV_FINAL): Likewise. + (STRUCT_EQUIV_NEED_FULL_BLOCK, STRUCT_EQUIV_MATCH_JUMPS): Likewise. + (STRUCT_EQUIV_MAX_LOCAL): Likewise. + (struct struct_equiv_checkpoint, struct equiv_info): Likewise. + (insns_match_p): Update prototype. + (flow_find_cross_jump): Remove prototype. + (struct_equiv_block_eq, struct_equiv_init): Declare. + (rtx_equiv_p, condjump_equiv_p): Likewise. + * struct-equiv.c: Include reload.h. + (IMPOSSIBLE_MOVE_FACTOR): Define. + (assign_reg_reg_set, struct_equiv_make_checkpoint): New functions. + (struct_equiv_improve_checkpoint): Likewise. + (struct_equiv_restore_checkpoint, rtx_equiv_p): Likewise. + (set_dest_equiv_p, set_dest_addr_equiv_p, struct_equiv_init): Likewise. + (struct_equiv_merge, find_dying_input): Likewise. + (resolve_input_conflict, note_local_live): Likewise. + (death_notes_match_p): Change parameters and processing + to match rtx_equiv_p machinery. Change caller. + (insns_match_p): Likewise. + (flow_find_cross_jump): Replace with: + (struct_equiv_block_eq). + + Back out this change: + 2005-03-07 Kazu Hirata + * recog.c (verify_changes): Make it static. + * recog.h: Remove the corresponding prototype. + +2005-12-13 J"orn Rennecke + + * rtlhooks.c (gen_lowpart_general): Handle SUBREGs of floating point + values. + +2005-12-13 Nathan Sidwell + + * config/mt/t-mt (MULTILIB_OPTIONS): Add ms2 + (MULTILIB_DIRNAMES): Add ms2. Prefix ms1 dirs with 'ms1'. + * config/mt/mt.c (ms1_final_prescan): Use TARGET_MS2, + TARGET_MS1_64_001 appropriately. + (ms1_machine_reorg): Use TARGET_MS2. + +2005-12-13 Jakub Jelinek + + PR debug/25023 + PR target/25293 + * expr.c (emit_move_resolve_push): Handle PRE_MODIFY + and POST_MODIFY with CONST_INT adjustment equal to PUSH_ROUNDING. + Fix POST_INC/POST_DEC handling if PUSH_ROUNDING is not identity. + * config/i386/i386.md (pushhi2, pushqi2): Use pushl instead of pushw. + Set mode to SI, adjust constraints. + (pushhi2_rex64, pushqi2_rex64): Set mode to DI. + * config/i386/i386.h (PUSH_ROUNDING): Round up to 4 instead of 2 for + 32-bit code. + +2005-12-13 Carlos O'Donell + + * c-cppbuiltin.c (builtin_define_float_constants): Add + fp_cast parameter, pass to builtin_define_with_hex_fp_value. + Define __FLT_HAS_DENORM__, __DBL_HAS_DENORM__, __LDBL_HAS_DENORM__. + (builtin_define_with_hex_fp_value): Use fp_cast when building macro. + (c_cpp_builtins): If flag_single_precision_constant then set fp_cast + to "((double)%sL)" otherwise "%s". + +2005-12-13 Paul Brook + + * config/arm/bpabi.h (SUBTARGET_EXTRA_ASM_SPEC): Pass -meabi=gnu for + apcs/atpcs. + +2005-12-11 Rafael vila de Espndola + + * tree-flow.h: Allow compilation with a C++ compiler. + (struct edge_prediction): Prefix all field names with "ep_". + * predict.c (tree_predicted_by_p): Likewise for struct edge_prediction. + (tree_predict_edge, combine_predictions_for_bb): Likewise. + (remove_predictions_associated_with_edge): Likewise. + +2005-12-12 Jeff Law + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove + reassociation code. + * passes.c (init_optimization_passes): Run reassociation again + after loop optimizations. + +2005-12-12 Daniel Berlin + + * tree-ssa-dom.c (thread_across_edge): Canonicalize condition + if necessary. + (optimize_stmt): Ditto. + (canonicalize_comparison): New function. + * tree-ssa-operands.c (swap_tree_operands): Make external. + (get_expr_operands): Stop auto-canonicalization. + * tree-ssa-reassoc.c: Rewrite. + (init_optimization_passes): + * tree-flow.h (swap_tree_operands): Prototype. + * Makefile.in (tree-ssa-reassoc.o): Update dependencies. + +2005-12-12 John David Anglin + + * pa.c (pa_output_function_epilogue): Set cfun->machine->in_nsubspa to + indicate function epilogue has been output. + (pa_asm_output_mi_thunk): Likewise. + (output_deferred_plabels): Put plabels in readonly data section when + not generating PIC code. + (som_output_text_section_asm_op): Use .NSUBSPA to output debug + information. Add assert. + (som_output_comdat_data_section_asm_op): New function. + (pa_som_asm_init_sections): Use som_output_comdat_data_section_asm_op + instead of output_section_asm_op for COMDAT sections. + +2005-12-12 J"orn Rennecke + + * cfgcleanup.c (condjump_equiv_p, try_crossjump_to_edge): + Fix whitespace in vincinity of to-be-installed changes. + * struct-equiv.c (merge_memattrs, death_notes_match_p): Fix whitespace. + (insns_match_p): Likewise. + +2005-12-12 Nathan Sidwell + + * config.gcc (ms1): Replace with ... + (mt): ... this. + * config/ms1: Rename to ... + * config/mt: ... here. Rename ms1 files to mt. + * config/mt/mt.c: Adjust gt-mt.h #include. + * config/mt/t-mt (LIB1ASMSRCS, LIB2FUNCS_EXTRA): Adjust. + (crti.o, crtn.o): Adjust file names. + +2005-12-12 Gabriel Dos Reis + + * varray.h: Allow compilation with a C++ compiler. + (union varray_data_tag): Prefix all field names with "vdt_". + (VARRAY_CHAR, VARRAY_UCHAR, VARRAY_SHORT, VARRAY_USHORT, + VARRAY_INT, VARRAY_UINT, VARRAY_LONG, VARRAY_ULONG, + VARRAY_WIDE_INT, VARRAY_UWIDE_INT, VARRAY_GENERIC_PTR, + VARRAY_GENERIC_PTR_NOGC, VARRAY_CHAR_PTR, VARRAY_RTX, + VARRAY_RTVEC, VARRAY_TREE, VARRAY_BITMAP, VARRAY_REG, VARRAY_BB, + VARRAY_ELT_LIST, VARRAY_EDGE, VARRAY_TREE_PTR): Adjust definition. + (VARRAY_PUSH_CHAR, VARRAY_PUSH_UCHAR, VARRAY_PUSH_SHORT, + VARRAY_PUSH_USHORT, VARRAY_PUSH_INT, VARRAY_PUSH_UINT, + VARRAY_PUSH_LONG, VARRAY_PUSH_ULONG, VARRAY_PUSH_WIDE_INT, + VARRAY_PUSH_UWIDE_INT, VARRAY_PUSH_GENERIC_PTR, + VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_PUSH_CHAR_PTR, + VARRAY_PUSH_RTX, VARRAY_PUSH_RTVEC, VARRAY_PUSH_TREE, + VARRAY_PUSH_BITMAP, VARRAY_PUSH_REG, VARRAY_PUSH_BB, + VARRAY_PUSH_EDGE, VARRAY_PUSH_TREE_PTR): Likewise. + (VARRAY_TOP_CHAR, VARRAY_TOP_UCHAR, VARRAY_TOP_SHORT, + VARRAY_TOP_USHORT, VARRAY_TOP_INT, VARRAY_TOP_UINT, + VARRAY_TOP_LONG, VARRAY_TOP_ULONG, VARRAY_TOP_WIDE_INT, + VARRAY_TOP_UWIDE_INT, VARRAY_TOP_GENERIC_PTR, + VARRAY_TOP_GENERIC_PTR_NOGC, VARRAY_TOP_CHAR_PTR, VARRAY_TOP_RTX, + VARRAY_TOP_RTVEC, VARRAY_TOP_TREE, VARRAY_TOP_BITMAP, + VARRAY_TOP_REG, VARRAY_TOP_BB, VARRAY_TOP_EDGE, + VARRAY_TOP_TREE_PTR): Likewise. + * varray.c (varray_grow): Likewise. + (varray_clear): Likewise. + +2005-12-12 Alan Modra + + PR target/25299 + * config/rs6000/rs6000.c (rs6000_special_round_type_align): Increase + alignment to doubleword if the first field is a double array. + * config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define. + +2005-12-11 Daniel Berlin + + * tree-ssa-structalias.c (process_constraint): Remove code to + transform addressofs into scalar. + (create_variable_info_for): In whole-program IPA, globals don't + point to ANYTHING by default. + +2005-12-11 Daniel Berlin + + * timevar.def (TV_IPA_PTA): New. + * tree-pass.h (pass_ipa_pta): New + * tree-ssa-structalias.c: Include cgraph.h + (in_ipa_mode): New. + (predbitmap_obstack): New. + (EXECUTE_IF_IN_NONNULL_BITMAP): New. + (struct constraint_stats): Add num_edges. + (new_var_info): Don't call bitmap_clear. + (struct constraint_edge): Update docs. + (new_constraint_edge): Remove src param. + (struct constraint_graph): Add zero_weight_succs, + zero_weight_preds. Update docs. + (constraint_expr_equal): Reformat. + (constraint_edge_equal): Update for removal of src. + (constraint_edge_less): Ditto. + (constraint_edge_vec_find): Ditto. + (erase_graph_self_edge): Update for removal of src and and zero + weight bitmap. + (clear_edges_for_node): Ditto. + (add_graph_edge): Ditto. + (get_graph_weights): Ditto. + (allocate_graph_weights): Ditto. + (merge_graph_nodes): Ditto. + (int_add_graph_edge): Ditto. + (valid_graph_edge): Ditto. + (valid_weighted_graph_edge): Ditto. + (build_constraint_graph): Ditto. + (scc_visit): Ditto. + (collapse_nodes): Ditto. + (process_unification_queue): Ditto. + (topo_visit): Ditto. + (solve_graph): Ditto. + (do_structure_copy): Ditto. + (perform_var_substitution): Ditto. + Init and release obstack. + (handle_ptr_arith): Try to resolve directly. + (find_func_aliases): Don't call update_alias_info here + Handle RETURN_EXPR, and CALL_EXPR's in IPA mode. + (do_sd_constraint): Add code for propagating faster. + Update. + (do_ds_constraint): Ditto. + (count_num_arguments): New function. + (create_function_info_for): Ditto. + (create_variable_info_for): Handle FUNCTION_DECL. + (intra_create_variable_infos): Use make_constraint_to_anything. + (init_alias_vars): Init obstacks here. + (need_to_solve): Handle zero weight graph changes. + (compute_points_to_sets): Call update_alias_info here. + (delete_points_to_sets): Free zero weight preds/succs here. + (gate_ipa_pta): New. + (ipa_pta_execute): New + +2005-12-11 Daniel Berlin + + * tree-ssa-structalias.c (var_anyoffset): Removed. + (anyoffset_tree): Ditto. + (anyoffset_id): Ditto. + (do_deref): Take vector of constraints, no return value. + Update to work on vector. + (get_constraint_for): Ditto. + (get_constraint_for_component_ref): Ditto. + (do_structure_copy): Ditto. + (handle_ptr_arith): Ditto. + (find_func_aliases): Ditto. + (set_uids_in_ptset): Remove anyoffset handling. + (init_base_vars): Ditto. + +2005-12-10 Mark Mitchell + + PR c++/25010 + * ipa-inline.c (cgraph_clone_inlined_nodes): Do not assume that + DECL_EXTERNAL functions have no bodies. Tidy. + +2005-12-10 Andreas Schwab + + * except.c (switch_to_exception_section): Only define if + TARGET_UNWIND_INFO is not defined. + +2005-12-10 Richard Sandiford + + * config/darwin.h (HAS_INIT_SECTION): Remove definition. + (INIT_SECTION_ASM_OP): Restore empty definition from before 2005-12-07. + +2005-12-10 Richard Sandiford + + * output.h (init_section, fini_section): Delete. + * varasm.c (init_section, fini_section): Delete. + (init_varasm_once): Don't initialize them. + * doc/tm.texi (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Say that + there are no corresponding varasm.c variables. + +2005-12-10 Richard Sandiford + + * dwarf2out.c (default_eh_frame_section): Delete, moving handling + of EH_FRAME_SECTION_NAME into... + (switch_to_eh_frame_section): ...here. Try to set eh_frame_section + if it is still null. + * except.c (default_exception_section): Delete, moving most + of the code to... + (switch_to_exception_section): ...this new function. Set + exception_section if it is still null, then switch to it. + (output_function_exception_table): Use switch_to_exception_section. + * varasm.c (exception_section, eh_frame_section): Update comments. + (get_section): Hoist use of SECTION_NAMED. + (init_varasm_once): Don't set exception_section and eh_frame_section. + * output.h (default_exception_section): Delete. + (default_eh_frame_section): Delete. + +2005-12-09 Bernd Schmidt + + * config/bfin/bfin.c: Include "cgraph.h". + (bfin_load_pic_reg): Omit loading pic reg if in a local function. + Return the reg that holds the pointer to the GOT. + (bfin_expand_prologue): Use return value of bfin_load_pic_reg when + doing stack checking. + +2005-12-09 Diego Novillo + + * tree.c (recompute_tree_invariant_for_addr_expr): Rename from + recompute_tree_invarant_for_addr_expr. + Update uses everywhere. + +2005-12-09 Aldy Hernandez + + * config/ms1/t-ms1 (MULTILIB_OPTIONS): Define. + (MULTILIB_DIRNAMES): Define. + +2005-12-09 Ulrich Weigand + + PR target/25311 + * config/s390/s390.c (struct s390_address): New field literal_pool. + (s390_decompose_address): Compute literal_pool field. Do not + assume register %r13 is always (and solely) used as pool base. + (s390_extra_constraint_str): Use literal_pool field. + +2005-12-09 Thiemo Seufer + + * config/mips/mips.c (override_options): Don't allow too small + integers in FP registers. + +2005-12-09 Ulrich Weigand + + * config/s390/s390.c (s390_function_ok_for_sibcall): Use + targetm.binds_local_p to check for local function calls. + +2005-12-09 Alan Modra + + PR debug/24908 + * dwarf2out.c (dwarf2out_frame_debug_expr): Don't assert that + call_used_regs can't be used to save reg in another reg. + +2005-12-08 Volker Reichelt + Christophe Jaillet + + * ipa-type-escape.c (analyze_variable): Use gcc_assert instead of + abort. + * except.c (output_ttype): Likewise. + * tree-object-size.c (collect_object_sizes_for): Likewise. + (check_for_plus_in_loops_1): Likewise. + (check_for_plus_in_loops): Likewise. + (compute_object_sizes): Use gcc_unreachable instead of abort. + +2005-12-08 Nathan Sidwell + + * config/ms1/ms1.md (UNSPEC_LOOP): New constant. + (loop_end, loop_init, doloop_end): New insns. + * config/ms1/ms1.h (LOOP_FIRST, LOOP_LAST): New. + (SPECIAL_REG_FIRST, FIRST_PSEUDO_REGISTER): Adjust. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Adjust. + (REG_CLASS_CONTENTS, REGISTER_NAMES): Adjust. + * config/ms1/ms1.c: #include basic-block.h + (struct machine_function): Add has_loops field. + (ms1_add_loop): New. + (MAX_LOOP_DEPTH, MAX_LOO_LENGTH): New. + (struct loop_info, struct loop_work): New. + (ms1_loop_nesting, ms1_block_length, ms1_scan_loop): New workers. + (ms1_reorg_loops): New loop optimization. + (ms1_machine_reorg): Call it. + * config/ms1/ms1-protos.h (ms1_add_loop): Declare. + +2005-12-08 Zdenek Dvorak + + PR tree-optimization/25248 + * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use + evolution_of_loop from the failed attempt. Remove handling + of MULT_EXPR. + +2005-12-08 Gabriel Dos Reis + + * tree.h (DECL_EXTERNAL): Clarify documentation. + +2005-12-08 Andreas Krebbel + Jakub Jelinek + + PR target/25268 + * config/s390/s390.c (s390_decompose_shift_count): Remove BITS + argument. Don't drop outer ANDs. + (s390_extra_constraint_str, print_shift_count_operand): Adjust callers. + * config/s390/s390-protos.h (s390_decompose_shift_count): Adjust + prototype. + * config/s390/predicates.md (setmem_operand): Remove. + (shift_count_operand): Rename to... + (shift_count_or_setmem_operand): ... this. Adjust + s390_decompose_shift_count caller. + * config/s390/s390.md (di3_31_and, di3_64_and, + ashrdi3_cc_31_and, ashrdi3_cconly_31_and, ashrdi3_31_and, + ashrdi3_cc_64_and, ashrdi3_cconly_64_and, ashrdi3_64_and, + si3_and, ashrsi3_cc_and, ashrsi3_cconly_and, ashrsi3_and, + rotl3_and, setmem_long_and): New insns. + (di3_31, di3_64, ashrdi3_cc_31, ashrdi3_cconly_31, + ashrdi3_31, ashrdi3_cc_64, ashrdi3_cconly_64, ashrdi3_64, + si3, ashrsi3_cc, ashrsi3_cconly, ashrsi3, rotl3, + di3, ashrdi3): Use shift_count_or_setmem_operand instead + of shift_count_operand. + (setmem_long): Use shift_count_or_setmem_operand instead of + setmem_operand. + +2005-12-08 Daniel Jacobowitz + Andreas Tobler + + * Makefile.in (ALL_GTFILES_H): Replace sed statement with more portable + tr expression. + +2005-12-07 J"orn Rennecke + + * expr.c (force_operand): Use convert_to_mode for conversions. + +2005-12-07 J"orn Rennecke + + * reload.h (reg_equiv_invariant): Declare. + * reload.c (refers_to_regno_for_reload_p): Allow R to be a pseudo + register also when reg_equiv_invariant[R] is set. + +2005-12-07 Richard Sandiford + Andreas Tobler + + * config/darwin.h: Guard section variables with #ifndef USED_FOR_TARGET. + +2005-12-07 Daniel Berlin + + * tree-ssa-pre.c (bitmap_set_and): New function. + (bitmap_set_and_compl): New function. + (bitmap_set_empty_p): New function. + (insert_extra_phis): New function. + (compute_avail): Use insert_extra_phis. + +2005-12-07 Adrian Straetling + + * config/s390/s390.c (s390_expand_atomic): New function. + Adjust comment of helper functions. + * config/s390/s390-protos.h (s390_expand_atomic): Declare. + * config/s390/s390.md ("ATOMIC"): New code macro. + ("atomic"): Corresponding new code attribute. + ("sync_lock_test_and_set[hq]i", + "sync_{new_,old_,}{and,ior,xor,add,sub,nand}[hq]i"): New pattern. + +2005-12-07 Adrian Straetling + + * config/s390/s390.c (s390_expand_mask_and_shift, + struct alignment_context, init_alignment_context, + s390_expand_cs_hqi): New. + * config/s390/s390-protos.h (s390_expand_cs_hqi): Declare. + * config/s390/s390.md ("sync_compare_and_swaphi", + "sync_compare_and_swapqi"): New pattern. + +2005-12-07 Daniel Berlin + + Fix PR tree-optimization/25291 + * tree-ssa-operands.c (add_call_clobber_ops): Remove + redundant and crashing check. + +2005-12-08 Alan Modra + + PR target/25212 + * config/rs6000/rs6000.c (legitimate_indexed_address_p): Relax + tests further when !strict && reload_in_progress. + (print_operand): Check that both operands of indexed address are regs. + (print_operand_address): Likewise. + * config/rs6000/rs6000.h (INT_REG_OK_FOR_INDEX_P): Simplify. + (INT_REG_OK_FOR_BASE_P): Correct. + +2005-12-07 J"orn Rennecke + + Preparation for PR rtl-optimization/20070 / part1 + * basic-block.h (insns_match_p, flow_find_cross_jump): Declare. + * cfgcleanup.c (condjump_equiv_p): New function, broken out of + outgoing_edges_match. + (outgoing_edges_match): Use condjump_equiv_p. + (merge_memattrs, insns_match_p, flow_find_cross_jump): Move from here + into.. + * struct-equiv.c: New file. + (death_notes_match_p) New function, broken out of insns_match_p. + * Makefile.in (OBJS-common): Add struct-equiv.o. + (struct-equiv.o): New target. + +2005-12-07 Richard Sandiford + + * coretypes.h: Revert previous change. + * config/darwin.h: Revert previous reversion. + * config/avr/avr.h (progmem_section): Guard with #ifndef IN_LIBGCC2. + +2005-12-07 Richard Sandiford + + * coretypes.h (section): Provide dummy definition for target files. + * config/darwin.h: Revert previous change. + +2005-12-07 Rafael vila de Espndola + + * doc/sourcebuild.texi (all.build, install-normal): Remove. + * configure.ac: Remove all.build and install-normal from target_list + * configure: Regenerate. + * Makefile.in (install): Don't depend on install-normal. + +2005-12-07 Rafael vila de Espndola + + * Makefile.in: Document the use of stamps. + +2005-12-07 Rafael vila de Espndola + + * doc/gty.texi: Remove instructions for adding a dependency on s-gtype. + * Makefile.in: Add code to compute some dependencies on s-gtype + automatically. Remove the declaration of those dependencies. + +2005-12-07 Richard Sandiford + + * reload.c (push_secondary_reload): Fix typo: + s/insn_constraint/scratch_constraint/. + +2005-12-07 Richard Sandiford + + * config/darwin.h: Guard section variables with #ifndef IN_LIBGCC2. + +2005-12-07 Richard Sandiford + + * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. + (alpha_elf_select_rtx_section): Return the selected section rather + than emitting assembly code. + (alpha_write_linkage): Emit a ".link" directive directly and then + set in_section to NULL. + (vms_asm_out_constructor): Use switch_to_section. + (vms_asm_out_destructor): Likewise. + (unicosmk_output_common): Set in_section to NULL instead of calling + the dummy common_section function. + (unicosmk_text_section): Delete in favor of... + (unicosmk_output_text_section_asm_op): ...this new function. + (unicosmk_data_section): Delete in favor of... + (unicosmk_output_data_section_asm_op): ...this new function. + (unicosmk_init_sections): New function. + (unicosmk_output_deferred_case_vectors): Use switch_to_section. + (unicosmk_output_ssib): Set in_section to NULL instead of calling + the dummy ssib_section function. + (unicosmk_section_buf): Delete. + * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. + (unicosmk_data_section): Delete. + * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) + (SECTION_FUNCTION_TEMPLATE): Delete. + * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) + (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. + (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. + (TARGET_ASM_INIT_SECTIONS): Define. + * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (link_section, literals_section): Delete. + (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then + set in_section to NULL. + + * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. + (COMMON_SECTION): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling + the dummy common_section function. + * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. + * config/arm/arm.c (get_jump_table_size): Use pointer comparison + between readonly_data_section and text_section to check whether + read-only data is being put in the text section. + (arm_output_function_epilogue): Use switch_to_section. + (arm_elf_asm_constructor): Likewise. + (thumb_call_via_reg): Replace call to in_text_section with + a comparison between in_section and text_section. + (arm_file_end): Use switch_to_section. + (aof_text_section): Delete in favor of... + (aof_output_text_section_asm_op): ...this new function. + (aof_data_section): Delete in favor of... + (aof_output_data_section_asm_op): ...this new function. + (aof_asm_init_sections): New function. + (zero_init_section): Moved from config/arm/aof.h. + (aof_dump_imports, aof_file_start): Use switch_to_section. + * config/arm/arm.h (thumb_call_via_label): Update comment. + * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. + (common_section): Delete. + * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. + (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the + global switch_to_section function instead of the old port-local one. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) + (SWITCH_TO_SECTION_FUNCTION): Delete. + (drectve_section): Redefine as a macro. + * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and + switch_to_section. + + * config/avr/avr.c (progmem_section): New variable. + (avr_output_progmem_section_asm_op): New function. + (avr_asm_init_sections): New function. + (avr_output_addr_vec_elt): Use switch_to_section. + * config/avr/avr.h (progmem_section): Declare. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (READONLY_DATA_SECTION): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. + * config/avr/avr-protos.h (progmem_section): Delete. + + * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. + + * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. + + * config/darwin-sections.def: New file. + * config/darwin.c: Define all sections in darwin-sections.def. + (output_objc_section_asm_op, darwin_init_sections): New functions. + (machopic_output_indirection): Use switch_to_section. + (machopic_select_section): Return the selected section rather than + emitting assembly code. Replace the static function table with + inline conditional expressions. Update the tests of last_text_section + and move them into the FUNCTION_DECL block. + (machopic_select_rtx_section): Return the selected section rather than + emitting assembly code. + (machopic_asm_out_constructor, machopic_asm_out_destructor) + (darwin_file_end): Use switch_to_section. + * config/darwin.h: Use darwin-sections.def to declare sections. + (INIT_SECTION_ASM_OP): Remove empty definition. + (HAS_INIT_SECTION): Define this instead. + (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. + (TARGET_ASM_EH_FRAME_SECTION): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + * config/darwin-protos.h (darwin_init_sections): Declare. + (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) + (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. + (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) + (constructor_section, destructor_section, mod_init_section): Delete. + (mod_term_section): Delete. + (darwin_exception_section, darwin_eh_frame_section): Delete. + (machopic_select_section): Return a section. + (machopic_select_rtx_section): Likewise. + (text_coal_section, text_unlikely_section, text_unlikely_coal_section) + (const_section, const_coal_section, const_data_section): Delete. + (const_data_coal_section, data_coal_section, cstring_section): Delete. + (literal4_section, literal8_section, constructor_section): Delete. + (mod_init_section, mod_term_section, destructor_section): Delete. + (objc_class_section, objc_meta_class_section, objc_category_section) + (objc_class_vars_section, objc_instance_vars_section): Delete. + (objc_cls_meth_section, objc_inst_meth_section): Delete. + (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. + (objc_selector_refs_section, objc_selector_fixup_section): Delete. + (objc_symbols_section, objc_module_info_section): Delete. + (objc_image_info_section, objc_protocol_section): Delete. + (objc_string_object_section, objc_constant_string_object_section) + (objc_class_names_section, objc_meth_var_names_section): Delete. + (objc_meth_var_types_section, objc_cls_refs_section): Delete. + (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) + (machopic_symbol_stub_section, machopic_picsymbol_stub_section) + (darwin_exception_section, darwin_eh_frame_section): Delete. + * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. + + * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. + (frv_asm_out_destructor): Likewise. + * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and + get_named_section. + (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. + * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) + (data_section): Delete. + + * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (DRECTVE_SECTION_FUNCTION): Delete. + (drectve_section): Redefine as a macro that sets in_section after + emitting the directive. + (SWITCH_TO_SECTION_FUNCTION): Delete. + * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to + in_text_section with comparison between in_section and text_section. + * config/i386/i386.c (x86_64_elf_select_section): Return the section + rather than emitting assembly code. Use get_named_section. + (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and + get_named_section. + (machopic_output_stub): Use switch_to_section. + * config/i386/nwld.c (nwld_named_section_asm_out_constructor) + (nwld_named_section_asm_out_destructor): Use get_section and + switch_to_section. + + * config/ia64/ia64.c (ia64_select_rtx_section): Return the section + rather than emitting assembly code. + (ia64_rwreloc_select_section): Likewise. + (ia64_rwreloc_select_rtx_section): Likewise. + * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. + * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use + switch_to_section. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. + + * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the + section rather than emitting assembly code. + (iq2000_select_section): Likewise. + * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. + (sbss_section): Delete. + + * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section + and get_named_section. + * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. + + * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. + (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. + (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. + (MCORE_EXPORT_NAME): Emit the exports directive directly, then set + in_section to NULL. + (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. + (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the + global switch_to_section function instead of the old port-local one. + * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (SWITCH_SECTION_FUNCTION): Delete. + * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. + (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. + (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. + (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set + in_section to NULL. + (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the + global switch_to_section function instead of the old port-local one. + (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. + + * config/mips/mips.c (mips_file_start): Update comment. + (mips_output_aligned_bss): Use switch_to_section and get_named_section. + (mips_output_aligned_decl_common): Use switch_to_section. + (mips_select_rtx_section): Return the section rather than emitting + assembly code. Use get_named_section. + (mips_function_rodata_section: Likewise get_section. + (build_mips16_function_stub): Use switch_to_section. + * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. + (SDATA_SECTION_ASM_OP): Delete. + * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. + (EXTRA_SECTION_FUNCTIONS): Delete. + + * config/mmix/mmix.c (mmix_file_start, mmix_file_end) + (mmix_asm_output_aligned_local): Use switch_to_section. + + * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) + (som_one_only_readonly_data_section): New variables. + (pa_output_function_epilogue): Set in_section to NULL instead of + calling forget_section. + (output_deferred_plabels): Use select_section. + (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead + of calling forget_section. + (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) + (pa_asm_output_aligned_local): Use select_section. + (som_text_section_asm_op): Delete in favor of... + (som_output_text_section_asm_op): ...this new function. + (pa_som_asm_init_sections): New function. + (pa_select_section): Return the section rather than emitting + assembly code. + * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. + (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. + (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. + * config/pa/pa-protos.h (som_text_section_asm_op): Delete. + (som_readonly_data_section, som_one_only_readonly_data_section) + (som_one_only_data_section, forget_section): Delete. + * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. + + * config/rs6000/rs6000.c (read_only_data_section): New variable. + (private_data_section, read_only_private_data_section): New variables. + (sdata2_section, toc_section): New variables. + (rs6000_file_start): Use switch_to_section. + (rs6000_assemble_integer): Use comparisons against in_section + instead of calling in_toc_section and in_text_section. Use + unlikely_text_section_p. + (rs6000_elf_output_toc_section_asm_op): New function, derived + from the old rs6000/sysv4.h toc_section function. + (rs6000_elf_asm_init_sections): New function. + (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return + the section rather than emitting assembly code. + (machopic_output_stub): Use switch_to_section. + (toc_section): Delete dummy function. + (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use + switch_to_section and get_section. + (rs6000_xcoff_output_readonly_section_asm_op): New function. + (rs6000_xcoff_output_readwrite_section_asm_op): New function. + (rs6000_xcoff_output_toc_section_asm_op): New function, derived from + the old rs6000/xcoff.h toc_section function. + (rs6000_xcoff_asm_init_sections): New function. + (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return + the section rather than emitting assembly code. + (rs6000_xcoff_file_start): Use switch_to_section. + (rs6000_xcoff_file_end): Likewise. + * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. + (sdata2_section, sbss_section, private_data_section): Delete. + (read_only_data_section, read_only_private_data_section): Delete. + * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) + (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. + (FINI_SECTION_FUNCTION): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. + * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) + (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) + (READONLY_DATA_SECTION): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section + to NULL rather than no_section. + (TARGET_ASM_EXCEPTION_SECTION): Delete. + + * config/sh/sh.c (sh_file_start): Use switch_to_section. + + * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. + (sparc_output_deferred_case_vectors): Likewise. Remove argument + from call to current_function_section. + + * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. + (bss100_section): New variable. + (xstormy16_asm_output_aligned_common): Use switch_to_section. + (xstormy16_asm_init_sections): New function. + (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use + switch_to_section and get_section. + (xstormy16_output_addr_vec): Use switch_to_section. Remove argument + from calls to current_function_section. + * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. + (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + * config/stormy16/stormy16-protos.h (bss100_section): Delete. + + * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) + (FINI_SECTION_FUNCTION): Delete. + + * config/v850/v850.c: Include gt-v850.h. + (rosdata_section, rozdata_section, tdata_section, zdata_section) + (zbss_section): New variables. + (v850_output_aligned_bss): Use switch_to_section. + (v850_asm_init_sections): New function. + (v850_select_section): Return the section rather than emitting + assembly code. + * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) + (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) + (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. + (TARGET_ASM_INIT_SECTIONS): Define. + * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. + (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. + (zbss_section): Delete. + + * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. + + * config/vx-common.h (vxworks_exception_section): Delete. + (TARGET_ASM_EXCEPTION_SECTION): Delete. + + * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the + section rather than emitting assembly code. + * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use + switch_to_section. + + * Makefile.in (GTFILES): Add $(srcdir)/output.h. + * coretypes.h (section): New union and typedef. + * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument + from call to current_function_section. + (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) + (dbxout_symbol_location): Use switch_to_section. + * dwarf2out.c (named_section_eh_frame_section): Delete, moving + most of the code into... + (default_eh_frame_section): ...here. Return a section. + (collect2_eh_frame_section): Delete, moving most of the code into.. + (switch_to_eh_frame_section): ...this new function. + (debug_info_section, debug_abbrev_section, debug_aranges_section) + (debug_macinfo_section, debug_line_section, debug_loc_section) + (debug_pubnames_section, debug_str_section, debug_ranges_section): New + variables. + (output_call_frame_info): Call switch_to_eh_frame_section instead of + eh_frame_section. Use switch_to_section and get_section. + (dwarf2out_begin_prologue): Use switch_to_section. + (AT_string_form): Check the flags in debug_str_section instead of + DEBUG_STR_SECTION_FLAGS. + (output_comp_unit): Use switch_to_section, get_section, and + debug_info_section. + (output_line_info, secname_for_decl): Use unlikely_text_section_p. + (dwarf2out_begin_block): Use switch_to_section. Remove argument + from call to current_function_section. + (dwarf2out_var_location): Use unlikely_text_section_p. + (dwarf2out_source_line): Use switch_to_section. Remove argument + from call to current_function_section. + (dwarf2out_start_source_file, dwarf2out_end_source_file) + (dwarf2out_define, dwarf2out_undef: Use switch_to_section and + debug_macinfo_section. + (dwarf2out_init): Initialize the new section variables. Use them + instead of calls to named_section_flags. Use switch_to_section. + (output_indirect_string): Use switch_to_section and debug_str_section. + (dwarf2out_finish): Use switch_to_section and the new section + variables. + * except.c (default_exception_section): Return the section instead + of emitting assembly code. + (output_function_exception_table): Use the global exception_section + variable instead of the target hook. Use switch_to_section. Remove + argument from call to current_function_section. + * final.c (HAVE_READONLY_DATA_SECTION): Delete. + (shorten_branches): Use pointer comparisons to detect whether the + text section is the same as readonly_data_section. + (profile_function): Use switch_to_section. Remove argument from + call to current_function_section. + (final_scan_insn): Likewise. Update use of last_text_section. + * gengtype.c (open_base_files): Add an include of output.h. + * output.h (text_section, data_section, readonly_data_section) + (ctors_section, dtors_section, bss_section, init_section) + (fini_section, sdata_section): Turn into section pointers. + (in_text_section, in_unlikely_text_section, exports_section) + (drectve_section, named_section, mergeable_string_section) + (last_text_section_name): Delete. + (default_exception_section, default_eh_frame_section): Return sections. + (SECTION_DECLARED, SECTION_NAMED): New macros. + (SECTION_MACH_DEP): Bump value. + (section_common, named_section, unnamed_section): New structures. + (unnamed_section_callback): New typedef. + (section): New union. + (sbss_section, exception_section, eh_frame_section): New variables. + (in_section, last_text_section): Turn into section pointers. + (get_unnamed_section, get_section, get_named_section): New functions. + (mergeable_constant_section, function_section): Return a section. + (unlikely_text_section): Likewise. + (current_function_section): Likewise. Remove the decl argument. + (unlikely_text_section_p, switch_to_section): New functions. + (output_section_asm_op): New function. + (set_named_section_flags, named_section_flags, named_section_real) + (named_section_first_declaration): Delete. + (default_select_section, default_elf_select_section): Return a section. + (default_elf_select_section_1, default_function_rodata_section) + (default_no_function_rodata_section, default_select_rtx_section) + (default_elf_select_rtx_section): Likewise. + * rtl.h (in_data_section): Delete. + * sdbout.c (sdbout_one_type): Use switch_to_section. + * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. + (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. + (TARGET_ASM_EH_FRAME_SECTION): Poison. + * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. + (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. + (TARGET_ASM_OUT): Update after above changes. + * target.h (init_sections): New hook. + (exception_section, eh_frame_section): Delete. + (select_section, select_rtx_section, function_rodata_section): Return + a section rather than emitting assembly code. + * varasm.c (text_section, data_section, readonly_data_section) + (ctors_section, dtors_section, bss_section, init_section) + (fini_section): Turn into section pointers. + (sdata_section, sbss_section, exception_section): New variables. + (eh_frame_section): New variable. + (in_section): Make global and turn into a section pointer. + (last_text_section): Turn into a section pointer. + (unnamed_sections): New variable. + (in_named_name, last_text_section_name): Delete. + (EXTRA_SECTION_FUNCTIONS): Delete. + (in_named_entry): Delete. + (section_htab): New variable, replacing... + (in_named_htab): ...this deleted variable. + (section_entry_eq, section_entry_hash): New functions, based on... + (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. + (get_unnamed_section, get_section): New functions. + (unlikely_text_section): Return a section instead of emitting + assembly code. + (in_text_section, in_unlikely_text_section, in_data_section): Delete. + (get_named_section_flags, named_section_first_declaration): Delete. + (unlikely_text_section_p): New function. + (named_section_real, named_section): Delete. + (get_named_section): New function. + (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. + (function_section): Return a section rather than emitting + assembly code. + (current_function_section): Likewise. Remove argument. Use + last_text_section if nonnull, otherwise use function_section. + (default_function_rodata_section): Return a section rather than + emitting assembly code. Use get_section. + (default_no_function_rodata_section): Return a section rather than + emitting assembly code. + (variable_section): Use switch_to_section and get_named_section. + (mergeable_string_section): Return a section rather than emitting + assembly code. Use get_section. Make static. Don't take special + countermeasures for empty strings. + (mergeable_constant_section): Return a section rather than emitting + assembly code. Use get_section. + (default_named_section_asm_out_destructor): Use switch_to_section + and get_section. + (default_dtor_section_asm_out_destructor): Use switch_to_section. + (default_named_section_asm_out_constructor): Use switch_to_section + and get_section. + (default_ctor_section_asm_out_constructor): Use switch_to_section. + (assemble_start_function): Likewise. Set last_text_section to + NULL rather than no_section. Change the type of save_section. + (assemble_zeros, assemble_variable): Use the section flags to detect + whether or not a section is text. + (assemble_static_space): Use switch_to_section. + (assemble_trampoline_template): Likewise. + (output_constant_def_contents): Use switch_to_section and + get_named_section. + (output_constant_pool_1): Use switch_to_section. Use the section + flags to see whether sections contain mergeable data. + (init_varasm_once): Initialize section_htab instead of in_named_htab. + Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. + (default_elf_asm_named_section): Use SECTION_DECLARED to detect + whether a section has already been declared. + (default_select_section, default_elf_select_section): Return a + section rather than emitting assembly code. + (default_elf_select_section_1): Likewise. Use bss_section for + SECCAT_BSS if nonnull. Use get_named_section. + (default_select_rtx_section): Return a section rather than + emitting assembly code. + (default_elf_select_rtx_section): Likewise. Use get_named_section. + (file_end_indicate_exec_stack): Use switch_to_section and get_section. + (output_section_asm_op, switch_to_section): New functions. + * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and + get_named_section. + + * doc/tm.texi: Expand the introduction to the sections documentation. + (TRAMPOLINE_SECTION): Document new interface. + (SDATA_SECTION_ASM_OP): Document new macro. + (READONLY_DATA_SECTION): Delete. + (SDATA_SECTION_ASM_OP): Document new macro. + (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. + (TARGET_ASM_INIT_SECTIONS): Document new hook. + (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) + (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. + (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. + +2005-12-07 Alan Modra + + * gcc.c (init_gcc_specs): Match braces inside conditionally + compiled strings. + +2005-12-06 Geoffrey Keating + + * config/darwin.h (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): New. + +2005-12-06 Aldy Hernandez + + PR C++/24138 + * tree.c (integer_all_onesp): Always return true if all bits on. + + * testsuite/g++.dg/init/array0.C: New. + +2005-12-06 Adrian Straetling + + * doc/md.texi: Adapt to implementation. + +2005-12-06 Andreas Schwab + + * opts.c (decode_options): Fix typo in message. + +2005-12-06 Alan Modra + + PR other/13873 + * longlong.h: Merge PPC tests from upstream. + +2005-12-06 Richard Guenther + + * fold-const.c (fold_convert): Do not build and fold + CONVERT_EXPR, but always use NOP_EXPR. + +2005-12-06 Jan Beulich + + * config/i386/i386.c (builtin_description): Use MASK_SSE2 for + __builtin_ia32_paddq and __builtin_ia32_psubq. + (ix86_init_mmx_sse_builtins): Use MASK_SSE|MASK_3DNOW_A for + __builtin_ia32_pshufw. + * config/i386/i386.md (mmx_adddi3, mmx_subdi3): Depend on TARGET_SSE2. + +2005-12-05 James E Wilson + + PR target/24934 + * opts.c (decode_options): Turn off partitioning if flag_unwind_tables + is set. + +2005-12-05 Daniel Berlin + + * print-tree.c (print_node): Ditto. + * tree-dfa.c (add_referenced_var): Tag's don't have DECL_INITIAL. + * tree-dump.c (dequeue_and_dump): Check for decl_common structure + before accessing DECL_ARTIFICIAL. + Handle new tag tree codes. + * tree-flow-inline.h (clear_call_clobbered): Update for tag + changes. + (unmodifiable_var_p): Ditto. + * tree-flow.h (mem_tag_kind): Remove. + (struct var_ann_d): Remove mem_tag_kind member. + * tree-gimple.c (is_gimple_reg): Tags are not gimple registers. + * tree-pretty-print.c (dump_generic_node): Handle memory tags. + * tree-ssa-alias.c (init_alias_info): Update for memory tag changes. + (group_aliases): Ditto. + (setup_pointers_and_addressables): Ditto. + (is_escape_site): Ditto. + (may_alias_p): Ditto. + (create_tag_raw): New function. + (create_memory_tag): Use it. + (dump_alias_info): Update for tags. + (may_be_aliased): Ditto. + (add_type_alias): Ditto. + (new_type_alias): Ditto. + (create_sft): Ditto. + (create_structure_vars): Ditto. + * tree-ssa-ccp.c (get_default_value): Ditto. + * tree-ssa-operands.c (get_expr_operands): Ditto. + (add_stmt_operand): Ditto. + (add_call_clobber_ops): Remove duplicated condition. + * tree-ssa.c (verify_flow_insensitive_alias_info): Update for + tags. + * tree-tailcall.c (suitable_for_tail_opt_p): Ditto. + * tree-vect-transform.c (vect_create_data_ref_ptr): Ditto. + * tree.c (init_ttree): Update structures for new tree codes. + (tree_code_size): Update sizes for new tree codes. + (make_node_stat): Don't try to set common things on minimal + structures. + (tree_node_structure): Update for tags. + (is_global_var): Ditto. + * tree.def: Add new tree codes. + * tree.h (MTAG_P): New macro. + (TREE_MEMORY_TAG_CHECK): Ditto. + (SSA_VAR_P): Update for tags. + (struct tree_memory_tag): New structure. + (MTAG_GLOBAL): New macro. + (union tree_node): Add memory tag member. + * treestruct.def (TS_MEMORY_TAG): New. + +2005-12-05 Dale Johannesen + + * config/i386/xmmintrin.h (_MM_TRANSPOSE4_PS): Fix to match + what was approved (PR 24323). + +2005-12-05 Gabriel Dos Reis + + * doc/c-tree.texi (Function Bodies): Remove description of + RETURN_INIT. + +2005-12-05 Joseph S. Myers + + * doc/libgcc.texi (__floatunsisf, __floatunsidf, __floatunsitf, + __floatunsixf, __floatundisf, __floatundidf, __floatunditf, + __floatundixf, __floatuntisf, __floatuntidf, __floatuntitf, + __floatuntixf, __powisf2, __powidf2, __powixf2, __mulsc3, + __muldc3, __multc3, __mulxc3, __divsc3, __divdc3, __divtc3, + __divxc3): Document. + +2005-12-05 Geoffrey Keating + + * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Preserve + previous behaviour. + * config/darwin.h (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Define to + hook_bool_void_false. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define. + * config/darwin.c (darwin_cxx_determine_class_data_visibility): New. + + * config/darwin.c (machopic_select_section): It's not defined + as weak if it's only marked as weak_import. + + * config/darwin-protos.h (darwin_cxx_determine_class_data_visibility): + Prototype. + + * varasm.c (default_binds_local_p_1): Weakrefs don't bind locally. + A hidden weak object does bind locally. Strong linkonce data + counts like any other strong symbol for binding. + (weak_finish_1): Don't specially handle weakrefs, they no longer + arrive here. + (assemble_alias): Weakrefs can't be TREE_PUBLIC yet. + * c-common.c (handle_alias_attribute): Allow static aliases + of variables. + (handle_weakref_attribute): Don't call declare_weak on weakrefs. + * gthr-dce.h: Make weakrefs static. + * gthr-tpf.h: Likewise. + * gthr-solaris.h: Likewise. + * gthr-posix.h: Likewise. + * gthr-posix95.h: Likewise. + * config/darwin.c (darwin_encode_section_info): static weakref + variables are not necessarily defined in this translation unit. + * doc/extend.texi (Function Attributes): Mention that an alias + attribute creates a definition for the thing it's attached to. + Change the documentation for weakref to say that the thing + it's attached to must be static. + + * config/rs6000/host-darwin.c (segv_handler): Unblock SEGV so + we don't go into an infinite loop. + +2005-12-05 Paolo Bonzini + + * config/rs6000/predicates.md (logical_const_operand): Split + out of logical_operand. + (logical_operand): Use it. + * config/rs6000/rs6000.md (cmp -> xor peephole2): Use + logical_const_operand. + +2005-12-05 Jan Beulich + + * config/i386/i386.c (enum ix86_builtins): Remove IX86_BUILTIN_CMPNEPS + and IX86_BUILTIN_CMPNESS. + (ix86_init_mmx_sse_builtins): Remove ti_ftype_ti_ti. + * config/i386/i386.h (ALIGN_MODE_128): Don't check TFmode explicitly. + * config/i386/i386.md (movti_internal): Correct type attribute. + Simplify mode attribute. + (movti_rex64, movsf_1, movdf_nointeger, movdf_integer, movtf_internal): + Correct type attribute. + (absxf2): Correct operator. + * config/i386/mmx.md (mov_internal_rex64, mov_internal, + movv2sf_internal_rex64, movv2sf_internal): Correct type attribute. + * config/i386/sse.md (mov_internal, movv2df_internal): Simplify + mode attribute. + (sse2_vmsqrtv2df2): Correct mode attribute. + +2005-12-05 Jan Beulich + + * config/ia64/ia64.md (rotlsi3_internal): Don't split if rotating by + 16 bits. Provide insn pattern for this case. + +2005-12-05 Jan Beulich + + * libgcc2.c (__popcountSI2): Don't use wide type for iterator and + result. + (__popcountDI2): Likewise. + +2005-12-04 John David Anglin + + PR target/25166 + * pa/pa.c (pa_hpux_init_libfuncs): Add _U_Qfcnvxf_usgl_to_quad and + _U_Qfcnvxf_udbl_to_quad to set of initialized libfuncs. + * pa/quadlib.c (_U_Qfcnvxf_usgl_to_quad, _U_Qfcnvxf_udbl_to_quad): New + functions. + +2005-12-04 Joseph S. Myers + + * c-typeck.c (null_pointer_constant_p): New function. + (build_conditional_expr, build_c_cast, convert_for_assignment, + build_binary_op): Use it. + +2005-12-04 Joseph S. Myers + + * c-common.c (binary_op_error): Do not allow NOP_EXPR. + (c_common_truthvalue_conversion): Handle NOP_EXPR the same as + CONVERT_EXPR. + (check_function_arguments_recurse): Allow both NOP_EXPR and + CONVERT_EXPR but check conversions preserve precision. + * c-typeck.c (pointer_diff): Allow both NOP_EXPR and CONVERT_EXPR + but check conversions preserve precision. + (build_unary_op): Don't allow NOP_EXPR. Use gcc_unreachable () in + default case. + +2005-12-04 Roger Sayle + + PR c/7776 + * common.opt (Wstring-literal-comparison): New command line option. + * c-opts.c (c_common_handle_option): Set it with -Wall. + * c-typeck.c (parser_build_binary_op): Issue warning if either + operand of a comparison operator is a string literal, except for + testing equality or inequality against NULL. + + * doc/invoke.texi: Document new -Wstring-literal-comparison option. + +2005-12-03 Joseph S. Myers + + * c-common.c (c_sizeof_or_alignof_type): Use fold_convert instead + of building a NOP_EXPR. + (c_alignof_expr): Likewise. Handle CONVERT_EXPR the same as + NOP_EXPR. + * c-convert.c (convert): Use fold_convert instead of building + NOP_EXPRs and CONVERT_EXPRs directly. Don't special case + c_objc_common_truthvalue_conversion returning a NOP_EXPR. Remove + #if 0 code. + * c-pretty-print.c (pp_c_cast_expression, pp_c_expression): Handle + NOP_EXPR the same as CONVERT_EXPR. + * c-typeck.c (build_function_call): Use fold_convert instead of + building a NOP_EXPR directly. + (build_compound_expr): Handle NOP_EXPR the same as CONVERT_EXPR. + +2005-12-03 Alan Modra + + PR rtl-optimization/25197 + * dwarf2out.c (dwarf2out_frame_debug_expr ): Assert we + have a reg. + +2005-12-02 Stuart Hastings + + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Remove -fpic + warning. + +2005-12-03 Joseph S. Myers + + * c-typeck.c (default_function_array_conversion, + build_function_call): Allow for CONVERT_EXPR as well as NOP_EXPR. + (build_conditional_expr): Apply integer_zerop to orig_op1 and + orig_op2. Don't check them for NOP_EXPR. + (build_c_cast, convert_for_assignment): Don't check for NOP_EXPR + around integer zero. + +2005-12-03 Alan Modra + + * config/rs6000/rs6000.c (rs6000_stack_t): Remove toc_save_p, + toc_save_offset, toc_size, lr_size. + (rs6000_stack_info): Use memset rather than bss struct copy to init. + Test rs6000_ra_ever_killed last in condition setting lr_save_p. + Adjust for removal of unused rs6000_stack_t fields. + (debug_stack_info): Adjust. + (rs6000_ra_ever_killed): Expand FIND_REG_INC_NOTE. Test for calls + first, and don't bother checking for set/inc of lr on sibcalls. + (rs6000_emit_epilogue): Tidy code restoring stack pointer. + +2005-12-02 Jakub Jelinek + + PR target/25199 + * config/i386/i386.md (movqi_1): Only force imovx for alternative + 5 if operand 1 is not aligned. Undo previous constraint change. + * config/i386/predicates.md (aligned_operand): Use MEM_ALIGN. + +2005-12-02 Richard Guenther + + * tree.h (build): Remove prototype. + (build, _buildN1, _buildN2, _buildC1, _buildC2): Remove macros. + * tree.c (build): Remove. + (build0_stat): Update comment. + +2005-12-02 Richard Guenther + + * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. + * tree-complex.c (update_complex_assignment, expand_complex_div_wide): + Likewise. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, + maybe_fold_offset_to_component_ref): Likewise. + * tree-ssa-dom.c (thread_across_edge, + simplify_rhs_and_lookup_avail_expr, + find_equivalent_equality_comparison, record_equivalences_from_stmt): + Likewise. + * gimple-low.c (lower_function_body, lower_return_expr): Likewise. + * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, + lower_try_finally_switch): Likewise. + * tree-if-conv.c (add_to_dst_predicate_list, + replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. + * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, + voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, + gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, + gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, + shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, + gimplify_init_ctor_eval, gimplify_init_constructor, + gimplify_variable_sized_compare, gimplify_boolean_expr, + gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, + gimplify_expr, gimplify_body, gimplify_function_tree, + force_gimple_operand): Likewise. + * tree-ssa-pre.c (create_expression_by_pieces): Likewise. + * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, + mx_register_decls): Likewise. + * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, + get_frame_field, finalize_nesting_tree_1): Likewise. + * tree-inline.c (setup_one_parameter): Likewise. + * tree-vect-transform.c (vectorizable_condition): Likewise. + * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): + Likewise. + * tree-profile.c (tree_gen_edge_profiler): Likewise. + * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. + * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. + * tree-chrec.h (build_polynomial_chrec): Likewise. + +2005-12-02 Richard Guenther + + * config/alpha/alpha.c (alpha_va_start, alpha_gimplify_va_arg_1i, + alpha_gimplify_va_arg): Use buildN and fold_buildN where applicable. + * config/frv/frv.c (frv_expand_builtin_va_start): Likewise. + * config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise. + * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. + * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. + * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg): + Likewise. + * config/sh/sh.c (sh_va_start, sh_gimplify_va_arg_expr, + sh_adjust_unroll_max): Likewise. + * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. + * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): + Likewise. + * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): + Likewise. + * config/mips/mips.c (mips_va_start, mips_gimplify_va_arg_expr): + Likewise. + +2005-12-02 Richard Guenther + + * tree-vrp.c (build_assert_expr_for, process_assert_insertions_for, + simplify_cond_using_ranges): Use buildN instead of build. + * tree-tailcall.c (adjust_accumulator_values, + adjust_return_value): Likewise. + * tree-sra.c (generate_one_element_ref, generate_copy_inout, + generate_element_copy, generate_element_zero, + generate_one_element_init): Likewise. + * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Likewise. + * lambda-code.c (gcc_loop_to_lambda_loop, lbv_to_gcc_expression, + lle_to_gcc_expression, lambda_loopnest_to_gcc_loopnest, + perfect_nestify): Likewise. + +2005-12-02 John David Anglin + + * pa.c (pa_secondary_reload): Revise initialization of variable regno. + +2005-12-02 Gabriel Dos Reis + + * ggc.h (GGC_RESIZEVEC): New. + +2005-12-02 Volker Reichelt + + * gcc.c (execute): Improve readability. + +2005-12-02 Richard Guenther + + * tree-cfg.c (mark_used_vars): New function. + (dump_function_to_file): Dump only used VAR_DECLs. + +2005-12-02 Richard Guenther + + * convert.c (convert_to_integer): Fix compare for nonpositive + constant to use tree_int_cst_sgn <= 0. + +2005-12-02 Richard Guenther + + * convert.c (convert_to_integer): Use fold_convert instead + of fold_build1 (NOP_EXPR, ...). Use tree_int_cst_sgn < 0 + instead of comparing against 0. Use build_int_cst instead + of converting integer_zero_node. + +2005-12-02 Richard Guenther + + * tree-pretty-print.c (op_symbol): Handle LROTATE_EXPR + and RROTATE_EXPR. + +2005-12-02 Alan Modra + + PR target/21017 + * combine.c (simplify_logical ): Simplify more patterns to + rotates. + +2005-12-02 Alan Modra + + PR middle-end/25176 + * function.c (expand_function_end): Emit blockage for unwinder + after return label. + +2005-12-01 Roger Sayle + + * tree.h (TREE_OVERFLOW): Make this flag/predicate specific to + constant nodes, i.e. INTEGER_CST, REAL_CST, etc... + * tree-vrp.c (compare_values): Only check TREE_OVERFLOW for + integer constant comparisons. + +2005-12-02 Jon Grimm + Janis Johnson + David Edelsohn + Ben Elliston + + * dfp.h, dfp.c: New files. + * Makefile.in (DECNUM, DECNUMINC, LIBDECNUMBER): New variables. + (DECNUM_H): Likewise. + (LIBDEPS, LIBS, BACKEND): Append $(LIBDECNUMBER). + (INCLUDES): Append $(DECNUMINC). + (OBJS-common): Add dfp.o. + (dfp.o): New rule. + * real.h (EXP_BITS): Pinch one bit to .. + (struct real_value): Add decimal field. + (real_format): Change table size, update documentation. + (REAL_MODE_FORMAT): Update for to handle float, decimal float. + (real_from_string3): Declare. + (decimal_single_format): Declare. + (decimal_double_format): Declare. + (decimal_quad_format): Declare. + (REAL_VALUE_TO_TARGET_DECIMAL32): New. + (REAL_VALUE_TO_TARGET_DECIMAL64): New. + (REAL_VALUE_TO_TARGET_DECIMAL128): New. + * real.c: Include dfp.h. + (normalize): Early return for decimal floats. + (do_add): Zero decimal field. + (do_compare): Call do_decimal_compare for decimal floats. + (do_fix_trunc): Likewise, call decimal_do_fix_trunc. + (real_arithmetic): Call decimal_real_arithmetic for decimal + floating point operands. + (real_identical): If a and b are of differing radix, return false. + (real_to_integer): Call decimal_real_to_integer if the value is a + decimal float. + (real_to_integer2): Likewise, call decimal_real_to_integer2. + (real_to_decimal): Likewise, call decimal_real_to_decimal. + (real_to_hexadecimal): Place "N/A" in the return string for + decimal float. + (real_from_string3): New variant, given a mode. + (real_maxval): Use decimal_real_maxval for decimal floats. + (round_for_format): Use decimal_round_for_format for decimals. + (real_convert): Use decimal_real_convert where appropriate. + (significand_size): Handle base 10. + (encode_decimal_single, decode_decimal_single, + encode_decimal_double, decode_decimal_double, encode_decimal_quad, + decode_decimal_quad): New functions. + (decimal_single_format): New. + (decimal_double_format): New. + (decimal_quad_format): New. + * machmode.def: Add SD, DD and TD decimal floating point modes. + * machmode.h (FLOAT_MODE_P, SCALAR_FLOAT_MODE_P, MODES_WIDEN_P): + Include MODE_DECIMAL_FLOAT. + (DECIMAL_FLOAT_MODE_P): New. + * mode-classes.def (MODE_DECIMAL_FLOAT): New mode class. + * genmodes.c (struct mode_data): Add counter field. + (struct mode_data): Update comment for format. + (blank_mode): Initialise counter field. + (new_mode): Increment counter field for each mode defined. + (complete_mode): Handle MODE_DECIMAL_FLOAT, update check for mode + using a format. + (make_complex_modes): Handle modes containing `D'. + (DECIMAL_FLOAT_MODE, FRACTIONAL_DECIMAL_FLOAT_MODE): New. + (make_decimal_float_mode): New. + (reset_float_format): Handle MODE_DECIMAL_FLOAT. + (cmp_modes): Compare counter field if other characteristics + similar. + (emit_real_format_for_mode): Support formats for decimal floats. + * doc/rtl.texi (Machine Modes): Document SD, DD and TDmodes. + Document MODE_DECIMAL_FLOAT. + +2005-12-02 Alan Modra + + * simplify-rtx.c (simplify_plus_minus): Do simplify constants. + Delete dead code. + +2005-12-01 Richard Henderson + + * optabs.c (expand_vec_cond_expr): Use EXPAND_NORMAL. + +2005-12-01 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_PUTC, BUILT_IN_PUTC_UNLOCKED): New. + + * config/pa/pa.c (pa_init_builtins): If we detect + DONT_HAVE_FPUTC_UNLOCKED, set builtin fputc_unlocked to + putc_unlocked. + +2005-12-01 Richard Guenther + + * fold-const.c (fold_binary): Use fold_build2, not + fold (build (...)). + +2005-12-01 Nathan Sidwell + + * config/ms1/ms1.c (ms1_reorg_hazard): Don't count noop moves. + + * vec.h (VEC_block_remove): New. + +2005-12-01 Gabriel Dos Reis + + PR c/13384 + * c-common.c (lvalue_error): Fix wording. + +2005-12-01 Richard Guenther + + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Fix + thinko in last patch. + +2005-12-01 Geoffrey Keating + + * config/t-slibgcc-darwin (SHLIB_LINK): Use -single_module rather + than -flat_namespace. + +2005-12-01 Ben Elliston + + * mklibgcc.in: Parameterise the script to build soft float + functions by iterating over each type, rather than cloning the + code for each type. + +2005-11-30 Kaveh R. Ghazi + + PR middle-end/25158 + * builtins.c (fold_builtin_fputs): Defer check for missing + replacement functions. + +2005-11-30 Kean Johnston + + * config/i386/i386.c: Check the value of SUPPORTS_ONE_ONLY, not + simply its presense in case targets #define SUPPORTS_ONE_ONLY 0. + +2005-11-30 Richard Guenther + + PR tree-optimization/22501 + * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): New + function split out from ... + (forward_propagate_addr_expr): ... here. Use it to propagate + ADDR_EXPRs to all uses. + +2005-11-30 Volker Reichelt + + * tree.h (CASE_FLT_FN, CASE_INT_FN): New macros. + * builtins.c (expand_builtin_mathfn): Use them. + (expand_builtin_mathfn_2): Likewise. + (expand_builtin_mathfn_3): Likewise. + (expand_builtin_int_roundingfn): Likewise. + (expand_builtin): Likewise. + (integer_valued_real_p): Likewise. + (fold_builtin_int_roundingfn): Likewise. + (fold_builtin_bitop): Likewise. + (fold_builtin_logarithm): Likewise. + (fold_builtin_1): Likewise. + * convert.c (convert_to_integer): Likewise. + * fold-const.c (negate_mathfn_p): Likewise. + (tree_expr_nonnegative_p): Likewise. + +2005-11-30 Dale Johannesen + Andrew Pinski + + * combine.c (find_split_point): Sign extend bitmask + when changing bitfield assignment to IOR of AND. + +2005-11-30 Nathan Sidwell + + * config/ms1/ms1.md (decrement_and_branch_until_zero): Add early + clobber to scratch reg. + (*decrement_and_branch_until_zero_no_clobber): Remove. + (decrement_and_branch peephole): Add dummy scratch reg to pattern. + (mulhish3): Use TARGET_MS1_16_003, TARGET_MS2. + * config/ms1/ms1.opt (mmul): Remove. + * config/ms1/ms1.h (ASM_SPEC): Cope with uppercase arch names. + (LINK_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Default to 16-002. + +2005-11-30 John David Anglin + Bernd Schmidt + + * pa/predicates.md (symbolic_operand): Add comment. + * pa/pa.md (reload_insi_r1, reload_indi_r1): New reload expanders. + * pa/pa-protos.h (pa_secondary_reload_class): Delete. + * pa/pa.c (TARGET_SECONDARY_RELOAD): Define. + (pa_secondary_reload_class): Delete. + (pa_secondary_reload): New function derived from SECONDARY_RELOAD_CLASS + and pa_secondary_reload_class. Reorder some checks. Update inline + copy of symbolic operand. + * pa/pa.h (SECONDARY_RELOAD_CLASS): Delete. + +2005-11-30 Nathan Sidwell + + * loop-doloop.c (add_test): Only add jump notes if we did emit a + jump. + +2005-11-30 Jeff Law + + * tree-ssa-uncprop.c (associate_equivalences_with_edges): Properly + handle SSA_NAME_OCCURS_IN_ABNORMAL_PHI. + +2005-11-30 Jakub Jelinek + + * config/ia64/ia64.c (ia64_expand_tls_address): Add ORIG_OP1 argument. + Move ADDEND_{HI,LO} computation into TLS_MODEL_INITIAL_EXEC case. + (ia64_expand_move): Adjust caller. + + * config/ia64/ia64.c (ia64_expand_atomic_op): Only use + fetchadd{4,8}.acq instruction if CODE is PLUS or MINUS, for MINUS + negate VAL. + +2005-11-30 Paolo Bonzini + + * simplify-rtx.c (simplify_plus_minus): Remove final parameter. + Always produce an output if we can remove NEGs or canonicalize + (minus (minus ...)) expressions. Provide a fast path for the + two-operand case. + (simplify_gen_binary): Do not call simplify_plus_minus. + (simplify_binary_operation_1): Reassociate at the end of the + function. + +2005-11-29 Evan Cheng + + * config/i386/xmmintrin.h (_MM_TRANSPOSE4_PS): Rewrite using high/low + moves and unpack to speed up. + +2005-11-29 David S. Miller + + * config/sparc/sparc.c (gen_compare_reg): Kill 2nd and 3rd + argument, they are always sparc_compare_op0 and sparc_compare_op1. + (gen_v9_scc): Update callers. + * config/sparc/sparc.md: Likewise. + * config/sparc/sparc-protos.h: Update extern declaration. + + * tree-into-ssa.c (rewrite_into_ssa): Fix comment typo. + +2005-11-29 Andrew Pinski + + * fold-const.c (negate_expr) : Add break after + the if. + +2005-11-29 Andrew Pinski + + * fold-const.c (negate_expr_p): Return true for BIT_NOT_EXPR. + (fold_unary) : Move -(~a) transformation to ... + (negate_expr): Here. + +2005-11-29 Ben Elliston + + * config/i386/i386.h (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): + Fix typo in comment. + +2005-11-29 Ben Elliston + + * Makefile.in (clean-target): Depend on clean-target-libgcc. + (clean-target-libgcc): Import rule from the top-level Makefile.in. + +2005-11-29 Kaveh R. Ghazi + + PR middle-end/20109 + PR middle-end/25120 + * builtins.c (init_target_chars): New. + (expand_builtin_printf, expand_builtin_fprintf, + expand_builtin_sprintf, fold_builtin_sprintf, + maybe_emit_sprintf_chk_warning, fold_builtin_sprintf_chk, + fold_builtin_snprintf_chk, fold_builtin_printf, + fold_builtin_fprintf): Check for matching format strings using + the target charset. + +2005-11-29 Paul Brook + + * config.gcc: Do not use fixproto on m68k-elf. + +2005-11-28 Roger Sayle + + * expmed.c (div_cost): Replace with... + (sdiv_cost, udiv_cost): New. + (init_expmed): Initialize sdiv_cost and udiv_cost, not div_cost. + Rename the div and mod fields, used to initialize sdiv_pow2_cheap + and smod_pow2_cheap, to sdiv_32 and smod_32 to avoid confusion. + (expand_divmod): Replace use of div_cost with either sdiv_cost + or udiv_cost depending upon the signedness of the operation. + +2005-11-28 Alexandre Oliva + + PR libfortran/24991 + * config/darwin.c (machopic_indirection_name, + machopic_output_indirection): Follow transparent alias chain. + +2005-11-28 Alexandre Oliva + + * varasm.c (ultimate_transparent_alias_target): Add comment. + +2005-11-28 Kazu Hirata + + * config/m68k/m68k.c (notice_update_cc): Use SET_DEST and + SET_SRC instead of XEXP where appropriate. + +2005-11-28 Joseph S. Myers + + * config/fp-bit.c (isnan, isinf, pack_d, unpack_d): Use + __builtin_expect. + +2005-11-28 Joseph S. Myers + + * config/fp-bit.h (LSHIFT): Take shift count parameter. + * config/fp-bit.c (_fpadd_parts): Shift in one go instead of one + bit at a time. + +2005-11-28 Bernd Schmidt + + * config/bfin/bfin.c (bfin_secondary_reload): Renamed from + secondary_input_reload_class, made static. Adapt to new + infrastructure. + (secondary_output_reload_class): Delete. + (TARGET_SECONDARY_RELOAD): New macro. + * config/bfin/bfin.h (SECONDARY_INPUT_RELOAD_CLASS, + SECONDARY_OUTPUT_RELOAD_CLASS): Delete. + +2005-11-28 Nathan Sidwell + + PR c++/21166 + * c-decl.c (finish_struct): Only set DECL_PACKED on a field + when its natural alignment is > BITS_PER_UNIT. + * stor-layout.c (finalize_type_size): Revert my patch of 2005-08-08. + * c-common.c (handle_packed_attribute): Ignore packing on a field + whose type is naturally char aligned. + +2005-11-28 Richard Guenther + + * c-common.c (strict_aliasing_warning): Handle all + component-ref like accesses. + +2005-11-28 Roger Sayle + Uros Bizjak + + PR middle-end/20219 + * fold-const.c (fold binary) : Optimize + sin(x)/tan(x) as cos(x) and tan(x)/sin(x) as 1.0/cos(x) + when flag_unsafe_math_optimizations is set and + we don't care about NaNs or Infinities. + + Move x/expN(y) and x/pow(y,z) transformation into common + flag_unsafe_math_optimizations section. + +2005-11-27 Mark Mitchell + + * gcc.c (main): Change type of argv to "char **". + +2005-11-28 Alan Modra + + * doc/invoke.texi (powerpc msdata-data): Static data doesn't go in + small data sections. + * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Make global. + * config/rs6000/rs6000-protos.h: (rs6000_elf_in_small_data_p): Declare. + * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Rename to.. + (ASM_OUTPUT_ALIGNED_DECL_LOCAL): ..this, adding extra parm. Don't + output locals to sbss if !rs6000_elf_in_small_data_p. + (ASM_OUTPUT_ALIGNED_BSS): Adjust for above. + +2005-11-28 Alan Modra + + PR target/24997 + * config/rs6000/rs6000.c (legitimate_indexed_address_p): Allow pattern + generated by reload. + * config/rs6000/predicates.md (indexed_or_indirect_operand): Use + indexed_or_indirect_address. + (indexed_or_indirect_address): Don't test for base reg. Call + address_operand last. Make it a special predicate. + +2005-11-27 Kazu Hirata + + * config/m68k/m68k.c (notice_update_cc): Remove useless code. + +2005-11-27 Andrew Pinski + + PR middle-end/24575 + * fold-const.c (negate_expr_p): Add case for signed divides if overflow + is undefined. + (negate_expr): Likewise. + +2005-11-27 Andreas Schwab + + * config/m68k/m68k.c: Reindent and fix whitespace, remove + redundant parens. + +2005-11-27 Steven Bosscher + + * cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it + has EH predecessor edges. + +2005-11-26 Eric Christopher + + * config/i386/i386.md (*zero_extendqihi2_movzbw): Avoid partial + register stalls by zero extending to the full register. + +2005-11-27 Joseph S. Myers + + * config/floatunsisf.c, config/floatunsidf.c, + config/floatunsixf.c, config/floatunsitf.c: New files. + * config/ia64/t-hpux: Add floatunsitf.c. + * config/ia64/ia64.c (ia64_init_libfuncs): Use + _U_Qfcnvxuf_dbl_to_quad for unsigned DImode-to-TFmode conversion. + +2005-11-26 Richard Henderson + + * c-lex.c (pragma_lex): Rename from c_lex. + * c-pch.c: Update for pragma_lex rename. + * c-pragma.c, c-pragma.h, config/ia64/ia64-c.c: Likewise. + * config/m32c/m32c-pragma.c, config/darwin-c.c: Likewise. + * config/rs6000/rs6000-c.c, config/c4x/c4x-c.c: Likewise. + * config/sol2-c.c, config/v850/v850-c.c: Likewise. + * doc/tm.texi: Likewise. + +2005-11-26 Andrew Pinski + + PR middle-end/23669 + * fold-const.c (fold_binary): Convert -A/-B to A/B for signed types + when overflow is undefined. + +2005-11-26 Hans-Peter Nilsson + + * doc/md.texi (Insn Canonicalizations): Refer to the + function commutative_operand_precedence for further rules. + +2005-11-25 Roger Sayle + + PR middle-end/21309 + * expmed.c (choose_mult_variant): Return immediately when mult_cost + is less than zero. Limit mult_cost to a reasonable upper bound for + the synthetic multiplication sequence. + +2005-11-25 Kaveh R. Ghazi + + PR middle-end/25022 + * builtins.c (expand_builtin_printf, expand_builtin_fprintf, + fold_builtin_fputs, fold_builtin_printf, fold_builtin_fprintf): + Lookup the explicit replacement functions for any unlocked + stdio builtin transformations. + +2005-11-25 Hans-Peter Nilsson + + * config/cris/cris.md ("reload_out"): Mark operand 2 as + earlyclobber. + * targhooks.c (default_secondary_reload): Don't require operand 2 + for an input reload to be earlyclobber. + +2005-11-25 Volker Reichelt + + * fold-const.c (negate_mathfn_p): Fix comment and add support + for BUILT_IN_CBRT, BUILT_IN_SINH, BUILT_IN_TANH, BUILT_IN_ASINH, + BUILT_IN_ATANH. + +2005-11-25 Joseph S. Myers + + PR middle-end/24998 + * config/sparc/sparc.c (sparc_init_libfuncs): Use _Q_utoq and + _Q_ulltoq for unsigned conversions from SImode and DImode to + TFmode. + +2005-11-25 Alan Modra + + * config/rs6000/ppc64-fp.c (__floatunditf): New function. + (__floatundidf, __floatundisf): Likewise. + +2005-11-25 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_sr_alias_set): Delete. + (rs6000_override_options): Remove initialization of + rs6000_sr_alias_set. + (rs6000_emit_eh_reg_restore): Use gen_frame_mem. + (rs6000_emit_stack_tie): Same. + (emit_frame_save): Same. + (gen_frame_mem_offset): Same. + (rs6000_emit_prologue): Same. + (rs6000_emit_epilogue): Same. + +2005-11-25 Andrew Pinski + + PR middle-end/24989 + * fold-const.c (fold_build): Convert bool_var != 1 and + bool_var == 0 to !bool_var. + +2005-11-25 Andrew Pinski + + PR middle-end/24990 + * fold-const.c (fold_binary): Fold (~a) == C to a == ~C + for C being INTEGER_CST. Likewise for !=. + +2005-11-25 Joseph S. Myers + + PR middle-end/24998 + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Use _q_utoq for + unsigned conversions from SImode to TFmode. + +2005-11-24 Bernd Schmidt + + * expr.c (expand_expr_real_1): Fix error in last change. + +2005-11-24 J"orn Rennecke + + * caller-save.c: (this_insn_sets): Move into: + (save_call_clobbered_regs). + (mark_set_regs): Get this_insn_sets from data. + + (save_call_clobbered_regs): Take sets of the return value by + sibcalls into account. + +2005-11-24 J"orn Rennecke + PR target/21623: + + * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove + SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. + (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. + (memory_move_secondary_cost, init_reg_autoinc): Remove + SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. + Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with + secondary_reload_class call. + (copy_cost): Likewise. Add new parameter prev_sri. Changed all + callers. + * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. + (push_secondary_reload): Use secondary_reload target hook. + (secondary_reload_class, scratch_reload_class): New functions. + (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and + SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace + SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. + * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. + (secondary_reload_class, scratch_reload_class): Declare. + * reload1.c: Include target.h. + (reload_adjust_reg_for_temp): New function. + (reload_adjust_reg_for_icode): Likewise. + (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. + Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class + call. + (emit_input_reload_insns): Likewise. Rewrite secondary reload checks + for inheritance. Support case when both secondary & tertiary reloads + are for intermediate registers. + (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use + with secondary_reload_class call. Support case when both secondary + & tertiary reloads are for intermediate registers. + * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. + (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. + * target.h (secondary_reload_info): New struct / typedef. + (struct gcc_target): New member secondary_reload. + * targhooks.c Include reload.h, optabs.h and recog.h. + (default_secondary_reload): New function. + * targhooks.h (default_secondary_reload): Declare. + * doc/tm.texi: Document secondary_reload target hook. Update + description of SECONDARY_*RELOAD_CLASS and reload_{in,out}. + * doc/md.texi: Likewise. + + * sh-protos.h (sh_secondary_reload): Declare. + * sh.c (TARGET_SECONDARY_RELOAD): Override. + (sh_secondary_reload): New function. + * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. + (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. + (SECONDARY_INPUT_RELOAD_CLASS): Likewise. + (HAVE_SECONDARY_RELOADS): Define. + * sh.md (reload_indf): Rename to: + (reload_indf__frn). + (reload_outdf): Rename to: + (reload_outdf__RnFRm). + (reload_insf): Rename to: + (reload_insf__frn). + (reload_insi): Rename to: + (reload_insi__i_fpul). + +2005-11-24 Uros Bizjak + + * configure.ac: Require at least texinfo 4.4. + * configure: Regenerate. + + * doc/install.texi (Tools/packages necessary for building GCC): + Update required version of texinfo to at least 4.4. + (Installing GCC: Building): Update required version of texinfo + to at least 4.4. + (Installing GCC: Final installation): Update required version + of texi2dvi to at least 4.4. + (Host/target specific installation notes for GCC): Update required + version of texinfo to at least 4.4. + +2005-11-24 Richard Guenther + Dirk Mueller + + PR c++/14024 + * c-common.h (strict_aliasing_warning): Declare. + * c-common.c (strict_aliasing_warning): New function, + split out from ... + * c-typeck.c (build_c_cast): ... here. + +2005-11-24 Paolo Bonzini + + * optabs.c (expand_binop): Use swap_commutative_operands_with_target + to order operands. + (swap_commutative_operands_with_target): New. + +2005-11-24 Paolo Bonzini + + * gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes + also when doing PRE, rather than only for global CPROP. + +2005-11-24 Ben Elliston + + * machmode.h (CLASS_HAS_WIDER_MODES_P): New macro. + * optabs.c (expand_binop): Use CLASS_HAS_WIDER_MODES_P, improve + formatting. + (expand_twoval_unop): Likewise. + (widen_clz): Likewise. + (expand_parity): Likewise. + (expand_unop): Likewise. + (emit_cmp_and_jmp_insn_1): Likewise. + (prepare_float_lib_cmp): Likewise. + +2005-11-24 Ben Elliston + + * optabs.c (prepare_cmp_insn): Use SCALAR_FLOAT_MODE_P. + Remove unused `class' variable. + +2005-11-23 Gabriel Dos Reis + + PR c++/21667 + * c-typeck.c (build_array_ref): Avoid code duplicate. Use common + C/C++ diagnostic function warn_array_subscript_with_type_char. + * c-common.h (warn_array_subscript_with_type_char): Declare. + * c-common.c (warn_array_subscript_with_type_char): Define. + +2005-11-23 Gabriel Dos Reis + + PR c/21668 + * c-decl.c (grokdeclarator): Don't warn for 'extern const' when + compiling at the intersection of C and C++. + +2005-11-23 Mark Mitchell + + * doc/invoke.texi: For man pages, include gcc-vers.texi. + List @file in the option summary. Include the libiberty + documentation for @file. + * gcc.c (main): Call expandargv. + * Makefile.in (gcc-vers.texi): Define srcdir. + +2005-11-23 Diego Novillo + + * passes.c (init_optimization_passes): Document + sequencing of passes. + +2005-11-23 Kazu Hirata + + * config/m68k/predicates.md (pcrel_address, extend_operator, + post_inc_operand, pre_dec_operand): Remove redundant + conditionals. + (const_uint32_operand, const_sint32_operand): Use gcc_assert + instead of abort. + (valid_dbcc_comparison_p): Rewrite in the lisp style. + +2005-11-23 Ben Elliston + + * dwarf2.h (enum dwarf_type): Add DW_ATE_decimal_float. + +2005-11-22 J"orn Rennecke + + Preparatory work for PR target/21623: + * alpha.c (secondary_reload_class): Rename to: + (alpha_secondary_reload_class). + * alpha.h, alpha-protos.h: Likewise. + * mn10300.c (secondary_reload_class): Rename to: + (mn10300_secondary_reload_class). + * mn10300.h, mn10300-protos.h: Likewise. + * pa.c (secondary_reload_class): Rename to: + (pa_secondary_reload_class). + * pa.h, pa-protos.h: Likewise. + * rs6000.c (secondary_reload_class): Rename to: + rs6000_secondary_reload_class. + * rs6000.h, rs6000-protos.h: Likewise. + +2005-11-22 Eric Botcazou + + PR middle-end/22561 + * tree-ssa-structalias.c (get_constraint_for): Handle ARRAY_RANGE_REF. + +2005-11-22 Ian Lance Taylor + + * optabs.c (expand_unop): Call SCALAR_FLOAT_MODE_P on a mode, not + a mode_class. + (prepare_cmp_insn): Likewise. + +2005-11-22 Kazu Hirata + + PR target/23435 + * m68k.md (zero_extendsidi2): Force operands[1] to a register + if both operands[0] and operands[1] are memory. + +2005-11-22 Andrew Pinski + + PR middle-end/23606 + * fold-const.c (fold_unary) : For + COMPARISON_CLASS_P and an integral types create create a new + expression with the new type and fold that. + +2005-11-22 Andrew Pinski + + PR target/24988 + * config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Remove call + to SUBTARGET_OS_CPP_BUILTINS. + +2005-11-22 Richard Earnshaw + + * arm.c (emit_set_insn): New function. + (arm_split_constant): Call it. + (arm_gen_compare_reg, arm_reload_in_hi, arm_reload_out_hi): Likewise. + (arm_legitimize_address): Likewise. Use plus_constant. + (arm_expand_prologue): Likewise. Use VOIDmode in SET. + (thumb_expand_prologue): Likewise. + (arm_gen_load_multiple): Use VOIDmode in SET. + (arm_gen_store_multiple): Likewise. + (vfp_emit_fstmx): Likewise. Use plus_constant. + (emit_multi_reg_push): Likewise. + (emit_sfm): Use plus_constant. + +2005-11-23 Alan Modra + + PR target/24954 + * config/rs6000/predicates.md (easy_vector_constant_add_self): Fix + typo last change. + +2005-11-22 Alan Modra + + PR middle-end/24950 + * expmed.c (store_bit_field): Don't attempt to insv a field + larger than the reg. + +2005-11-22 Alan Modra + + PR target/24954 + * config/rs6000/predicated.md (easy_vector_constant_add_self): Use + explicit sign extension, not a (char) cast. + +2005-11-22 Ben Elliston + + * optabs.c: Use SCALAR_FLOAT_MODE_P instead of explicitly testing + GET_MODE_CLASS (x) == MODE_FLOAT. + * config/i386/i386.c: Likewise. + * config/rs6000/xcoff.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/rs6000.c: Likewise. + * config/rs6000/rs6000.h: Likewise. + * config/rs6000/predicates.md: Likewise. + * config/rs6000/sysv4.h: Likewise. + +2005-11-21 Kaveh R. Ghazi + + * c-cppbuiltin.c (c_cpp_builtins): Define __pic__ and __PIC__ when + flag_pic is set. + + * config/alpha/freebsd.h, config/alpha/linux.h, + config/arm/linux-elf.h, config/bfin/bfin.h, + config/cris/linux.h, config/darwin.h, config/freebsd-spec.h, + config/i386/beos-elf.h, config/i386/gnu.h, + config/i386/linux.h, config/i386/linux64.h, config/i386/nto.h, + config/i386/sco5.h, config/m32r/m32r.h, config/m68k/linux.h, + config/m68k/m68k.h, config/mips/linux.h, config/pa/pa-linux.h, + config/rs6000/linux64.h, config/rs6000/sysv4.h, + config/rs6000/vxworks.h, config/s390/linux.h, config/s390/tpf.h, + config/sh/linux.h, config/sh/sh.h, config/sol2.h, + config/sparc/linux.h, config/sparc/linux64.h, + config/xtensa/xtensa.h: Don't define __pic__ or __PIC__. + + * doc/invoke.texi: Document that the macros __pic__ and __PIC__ + are both defined when either flag -fpic or -fPIC are used. + +2005-11-22 Joseph S. Myers + + * config/fp-bit.c (clzusi): New function. + (si_to_float, usi_to_float): Use it to compute proper shift. + (usi_to_float): Preserve guard bits when shifting right. + * libgcc-std.ver (GCC_4.2.0): New version. + * libgcc2.c (__floatundixf, __floatunditf, __floatundidf, + __floatundisf): New functions. + * libgcc2.h (__floatundixf, __floatunditf, __floatundidf, + __floatundisf): Declare. + * mklibgcc.in (lib2funcs): Add _floatundidf, _floatundisf, + _floatundixf, and _floatunditf. + * optabs.c (expand_float): If target does not define a pattern for + signed or unsigned conversion, use an unsigned libcall instead of + a signed one. + (init_optabs): Initialize ufloat_optab. + +2005-11-22 Joseph S. Myers + + * config/rs6000/rs6000.opt (mmulhw): New option. + * doc/invoke.texi (-mmulhw): Document. + * config/rs6000/rs6000.c (rs6000_override_options): Enable -mmulhw + for 405 and 440. + * config/rs6000/rs6000.md: Add half-word multiply and + multiply-accumulate instructions for 405 and 440. + +2005-11-21 Joel Sherrill + + * config/arm/rtems-elf.h: Added definition of LINK_GCC_C_SEQUENCE_SPEC + which matches behavior of gcc 4.0 and older for RTEMS targets. The + default now includes a linker group which makes the RTEMS one nest. + +2005-11-22 Ben Elliston + + * cse.c (fold_rtx): Typo fix. + (find_comparison_args): Pass the mode of arg1, not arg1 itself. + +2005-11-21 Richard Henderson + + * c-common.c, config/darwin-c.c, c-decl.c, c-tree.h, c-objc-common.h, + langhooks-def.h, langhooks.h: Revert 2005-11-18 lookup_name patch. + + * c-tree.h (lookup_name): Move declaration ... + * c-common.h (lookup_name): ... here. + * config/darwin-c.c: Include c-common.h. + * config/t-darwin: Update dependencies. + +2005-11-22 Ben Elliston + + * optabs.c (expand_abs_nojump): Use SCALAR_FLOAT_MODE_P instead of + explicitly testing GET_MODE_CLASS (x) == MODE_FLOAT. + * genopinit.c (gen_insn): Likewise. + * reload.c (find_equiv_reg): Likewise. + * loop.c (load_mems): Likewise. + * rtlanal.c (may_trap_p_1, canonicalize_condition): Likewise. + * cse.c (find_comparison_args, fold_rtx): Likewise. + * dwarf2out.c (add_const_value_attribute): Likewise. + * expr.c (convert_move): Likewise. + * recog.c (general_operand, register_operand): Likewise. + * reg-stack.c (replace_reg): Likewise. + * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. + * c-common.c (handle_vector_size_attribute): Likewise. + * simplify-rtx.c (simplify_const_unary_operation): Likewise. + (simplify_binary_operation_1): Likewise. + (simplify_const_binary_operation): Likewise. + (simplify_relational_operation): Likewise. + (simplify_const_relational_operation): Likewise. + (simplify_immed_subreg): Likewise. + * emit-rtl.c (gen_lowpart_common): Likewise. + * expmed.c (expand_mult): Likewise. + * stor-layout.c (layout_type): Likewise. + +2005-11-21 Paolo Bonzini + + PR target/24951 + * config/rs6000/rs6000.c (output_vec_const_move): Load cst and + cst2 only for SPE vectors. + +2005-11-21 David Edelsohn + + PR target/24953 + * config/rs6000/predicates.md (vrsave_operation): Check + UNSPEC_VOLATILE value. + +2005-11-21 Jan Hubicka + + PR tree-optimization/24653 + * tree-ssa-ccp.c (ccp_fold): Strip down useless conversions. + +2005-11-21 Uros Bizjak + + * config/i386/predicates.md (ax_reg_operand): New predicate. + (memory_displacement_only_operand): New predicate. + * config/i386/i386.md ("modrm" attribute): Return 0 if one + operand is AX register and the other operand is memory operand + with displacement only. + +2005-11-21 Uros Bizjak + + * fold-const.c (fold_binary) : Optimize A / A to 1.0 + if we don't care about NaNs or Infinities. + +2005-11-20 Ian Lance Taylor + + PR rtl-optimization/24883 + * combine.c (combinable_i3pat): When checking whether the + destination of i3 is used in i3, consider paradoxical subregs. + +2005-11-21 Kazu Hirata + + PR middle-end/20583 + * cse.c (cse_insn): Reject invalid forms of CONST earlier. + +2005-11-20 Joseph S. Myers + + * combine.c (try_combine): Do not run subst on i1src and i2src in + the case of generating a PARALLEL for a comparison. + +2005-11-20 Richard Henderson + + PR 24931 + * tree-sra.c (struct sra_elt): Add all_no_warning. + (struct sra_walk_fns) : Add use_all argument. + (sra_walk_expr): Pass it. + (sra_walk_modify_expr): Likewise. + (scalarize_ldst): Likewise. + (scan_use): Update for new argument. + (mark_no_warning): New. + (scalarize_use): Use it. + +2005-11-20 Bernd Schmidt + + * expr.c (expand_expr_real): Use usmul_optab for widening + signed * unsigned multiplies. + * genopinit.c (optabs): Add usmul_widen_optab. + * optabs.c (init_optabs): Likewise. + * optabs.h (enum optab_index): Add OTI_usmul_widen. + (usmul_widen_optab): Define. + * config/bfin/bfin.md (usmulhisi3): New pattern. + + * doc/md.texi (usmulqihi3, usmulhisi3, usmulsidi3): Document. + +2005-11-20 Graham Stott + + * gensupport.c (std_preds): Fixed extraneous `false` in last change. + +2005-11-20 Andreas Schwab + + PR target/24757 + * config/ia64/ia64.c (ia64_expand_atomic_op): Fix condition of cmp + insn. + +2005-11-19 Richard Henderson + + PR tree-opt/24665 + * tree-gimple.c (is_gimple_id): Export. + * tree-gimple.h (is_gimple_id): Declare. + * tree-ssa-ccp.c (ccp_decl_initial_min_invariant): New. + (get_default_value): Use it. + (maybe_fold_stmt_indirect): Likewise. + +2005-11-19 James A. Morrison + + * tree-vrp.c (compare_ranges): Return false for EQ_EXPR if VR0 is less + than VR1 or vice-versa. + +2005-11-19 Hans-Peter Nilsson + + PR middle-end/24912 + PR middle-end/24750 + * reload.c (find_reloads_address_1): Mention dependency on + gen_reload. + * reload1.c (gen_reload): For IN with an unary operation, try + moving inner expression to OUT if trivial SET is not valid. + Confirm that the result is valid. Move common code block into... + (emit_insn_if_valid_for_reload): New function. + +2005-11-19 Richard Guenther + + * fold-const.c (fold_indirect_ref_1): Make sure we fold + ARRAY_REFs of constant strings. + +2005-11-19 Jakub Jelinek + + * gcc.c (version_compare_spec_function): Use '%s' rather than %qs in + fatal format string. + +2005-11-19 Joseph S. Myers + + * combine.c (make_compound_operation): Swap operands of + commutative operation if necessary before returning. + +2005-11-19 Richard Guenther + + PR middle-end/23294 + * fold-const.c (fold_plusminus_mult_expr): New function. + (fold_binary): Use to canonicalize PLUS_EXPR and MINUS_EXPR + cases, remove now unnecessary code. + +2005-11-19 Paolo Bonzini + + * gensupport.c (old_preds): Rename to std_preds, add special field. + (struct old_pred_table): Rename to struct std_pred_table, add special + field. + (NUM_KNOWN_OLD_PREDS): Rename to NUM_KNOWN_STD_PREDS. + (NUM_OLD_SPECIAL_MODE_PREDS): Remove. + (init_predicate_table): Adjust, and set along the way whether a + predicate is special. + +2005-11-18 Mark Mitchell + + * BASE-VER: Change to 4.2.0. + +2005-11-18 James E Wilson + + * builtins.c (fold_builtin_strstr): Pass s1 through fold_convert before + returning it. + +2005-11-18 Mike Stump + + * c-common.c (handle_cleanup_attribute): Use a lang hook for lookup_name. + * config/darwin-c.c (darwin_pragma_unused): Likewise. + * c-decl.c (lookup_name_two) Remove. + * c-tree.h (lookup_name_two): Remove. + * c-objc-common.h (LANG_HOOKS_LOOKUP_NAME): Add. + * langhooks-def.h (LANG_HOOKS_LOOKUP_NAME): Add. + (LANG_HOOKS_DECLS): Add initializer for LANG_HOOKS_LOOKUP_NAME. + * langhooks.h (lang_hooks_for_decls): Add lookup_name. + +2005-11-18 Richard Earnshaw + + PR target/24914 + * arm.c (arm_hard_regno_mode_ok): Co-processor registers aren't ok + when not generating code to use that co-processor. + +2005-11-18 James A. Morrison + + * tree-flow.h (reserve_phi_args_for_new_edge, create_phi_node, + add_phi_arg, remove_phi_args, remove_phi_node phi_reverse): Mention that + these functions are now in tree-phinodes.c. + +2005-11-18 Jie Zhang + + * config/bfin/bfin.md (trap): New pattern. + +2005-11-18 Richard Kenner + + * tree-ssa-dom.c (extract_range_from_cond): Deal with variable bounds + on types. + + * expr.c (expand_expr_real): Don't call record_block_change unless + ib_boundaries_block is non-null + + * postreload.c (reload_cse_move2add): Don't try to work with BImode. + + * fold-const.c (build_range_check): Use proper type for subtraction + when merging lower bound. + +2005-11-18 Zdenek Dvorak + + PR rtl-optimization/24497 + * loop-unroll.c (apply_opt_in_copies): Do not verify equality of + the copied insn. + +2005-11-18 Zdenek Dvorak + + * tree-scalar-evolution.c (expression_expensive_p): New function. + (scev_const_prop): Use compute_overall_effect_of_inner_loop. + +2005-11-18 Bernd Schmidt + + * config/bfin/crtlibid.s: New file. + +2005-11-17 John David Anglin + + PR target/24348 + * config.gcc (hppa*-*-hpux*): Add pa/t-slibgcc-elf-ver to tmake config + when not using sjlj exceptions. + * config/pa/pa64-hpux.h (LIB_SPEC): Add -lpthread in static links. + * config/pa/pa-hpux11.h (LIB_SPEC): Likewise. + * config/pa/som.h (ASM_PREFERRED_EH_DATA_FORMAT): Delete define. + * config/pa/linux-unwind.h (pa32_fallback_frame_state): Use + DWARF_ALT_FRAME_RETURN_COLUMN instead of column 0 as return column. + * config/pa/pa-hpux.h (MD_UNWIND_SUPPORT): New define. + * config/pa/pa-linux.h (INCOMING_RETURN_ADDR_RTX, + DWARF_FRAME_RETURN_COLUMN, ASM_PREFERRED_EH_DATA_FORMAT, + ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Delete defines. + * config/pa/pa.h (ARG_POINTER_CFA_OFFSET): Delete. + (FRAME_POINTER_CFA_OFFSET, INCOMING_RETURN_ADDR_RTX, + DWARF_FRAME_RETURN_COLUMN, DWARF_ALT_FRAME_RETURN_COLUMN, + ASM_PREFERRED_EH_DATA_FORMAT, ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New + defines. + * config/pa/hpux-unwind.h: New file. + +2005-11-17 Alexandre Oliva + + * config/rs6000/rs6000.h (ASM_OUTPUT_WEAKREF): Define. + * defaults.h (ASM_OUTPUT_WEAKREF): Add decl argument. + * varasm.c (do_assemble_alias): Adjust call. + (weak_finish): Don't use ASM_WEAKEN_LABEL if ASM_WEAKEN_DECL + is defined. + * doc/tm.texi (ASM_OUTPUT_WEAKREF): Document it. + +2005-11-17 James E Wilson + + * tree.def (FUNCTION_DECL): Correct typo in comment. + +2005-11-17 Richard Henderson + + * dwarf2out.c (dw_cfi_oprnd_struct): Reduce dw_cfi_reg_num to int. + (lookup_cfa_1): Apply data alignment to DW_CFA_def_cfa_offset_sf + and DW_CFA_def_cfa_sf. + (def_cfa_1): Use DW_CFA_def_cfa_offset_sf with negative values. + (dbx_reg_number): Don't assert particular registers here. + (based_loc_descr): ... do it here instead. Fold in ... + (eliminate_reg_to_offset): ... this function. + (compute_frame_pointer_to_cfa_displacement): Fold in the effects + of eliminate_reg_to_offset; use FRAME_POINTER_CFA_OFFSET. + * unwind-dw2.c (execute_cfa_program): Apply data align factor + to DW_CFA_def_cfa_offset_sf and DW_CFA_def_cfa_sf. + * function.c (instantiate_new_reg): Use FRAME_POINTER_CFA_OFFSET. + (instantiate_virtual_regs): Likewise. + * var-tracking.c (adjust_stack_reference): Likewise. + * doc/tm.texi (FRAME_POINTER_CFA_OFFSET): New. + +2005-11-17 Bernd Schmidt + + * config/bfin/elf.h (STARTFILE_SPEC): Add "crtlibid%O%s" + * config/bfin/uclinux.h (STARFILE_SPEC): Likewise. + * config/bfin/t-bfin-elf (EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Add + crtlibid.o. + ($(T)crtlibid.o): New rule. + +2005-11-16 Richard Guenther + + PR middle-end/24851 + * fold-const.c (extract_array_ref): Return byte offset + in all cases. + (fold_binary): Fold &x[a] CMP &x[b] to + a*sizeof(*x) CMP b*sizeof(*x) to get correct overflow + behavior. + +2005-11-16 Richard Henderson + + PR middle-end/23497 + * tree-ssa.c (warn_uninitialized_var): Skip real and imaginary + parts of an SSA_NAME. + +2005-11-16 Richard Earnshaw + + PR target/24861 + * arm.md (split for movsf with immediate): Restrict split to insns + that set a general register. + +2005-11-16 Daniel Jacobowitz + + * config/ia64/unwind-ia64.c (uw_advance_context): New. Call + uw_update_context. + * unwind-dw2.c (uw_advance_context): Likewise. + * unwind-sjlj.c (uw_advance_context): Likewise. Also call + _Unwind_SjLj_Unregister. + * unwind.inc (_Unwind_ForcedUnwind_Phase2): Call uw_advance_context. + +2005-11-16 Daniel Jacobowitz + + * unwind-sjlj.c (_Unwind_GetCFA): Handle the builtin_setjmp case. + +2005-11-16 Eric Botcazou + + * config/alpha/alpha.c (alpha_init_builtins): Use type_for_mode + langhook to get a DImode integer type. + +2005-11-16 Richard Henderson + J"orn Rennecke + Ulrich Weigand + + PR rtl-opt/24160 + PR target/24621 + * reload1.c (reg_equiv_invariant): New. + (reload): Allocate, initialize, and free it. + (calculate_needs_all_insns): Check it when skipping equivalence + setting insns. + (alter_reg): Likewise. + (eliminate_regs_1): Rename from eliminate_regs. Add new + may_use_invariant argument; only use reg_equiv_invariant when true. + (eliminate_regs): New. + (eliminate_regs_in_insn): Use eliminate_regs_1; track when we're in + a context for which may_use_invariant may be true. + +2005-11-16 Eric Botcazou + + * fold-const.c (const_binop): Don't constant fold the operation + if the result has overflowed and flag_trapping_math. + * simplify-rtx.c (simplify_const_binary_operation): Likewise. + +2005-11-16 Daniel Jacobowitz + + * config/arm/unwind-arm.c (abort): Add prototype here. + (UCB_FORCED_STOP_ARG): Correct typo in macro argument. + (struct phase1_vrs): Add prev_sp. + (unwind_phase2_forced): Save the original core registers instead of + modifying entry_vrs. Take a new flag argument for resuming unwinding + and set action flags accordingly. Always set _US_END_OF_STACK when + get_eit_entry fails. Unwind before calling the stop function. + (_Unwind_GetCFA): New function. + (__gnu_Unwind_ForcedUnwind): Update call to unwind_phase2_forced. + (__gnu_Unwind_Resume_or_Rethrow): Likewise. + (__gnu_Unwind_Resume): Do not unwind here for forced unwinding; + just call unwind_phase2_forced. + (_Unwind_GetDataRelBase, _Unwind_GetTextRelBase): Move to here. + * config/arm/unwind-arm.h (abort): Remove prototype. + (_Unwind_GetDataRelBase, _Unwind_GetTextRelBase): Change to + prototypes. + (_Unwind_GetCFA): New prototype. + * config/arm/pr-support.c (abort): Add prototype here. + * unwind-c.c (PERSONALITY_FUNCTION) [__ARM_EABI_UNWINDER__]: Handle + forced unwinding. + * config/arm/arm.c (arm_expand_prologue, thumb_expand_prologue): Do + not schedule the prologue with non-call exceptions and EABI. + +2005-11-16 Nathan Sidwell + + * config/arm/unwind-arm.h: Reorder interface function declarations. + (_URC_END_OF_STACK): New enumeration value. + (_US_UNWIND_ACTION_MASK, _US_FORCE_UNWIND, _US_END_OF_STACK): Likewise. + (struct _Unwind_Control_Block): Document reserved field use. + (_Unwind_Stop_Fn): New typedef. + (_Unwind_ForcedUnwind): Declare. + (_Unwind_Resume_or_Rethrow): Declare. + * config/arm/libunwind.S (UNWIND_WRAPER): Add nargs + argument. Adjust. + (_Unwind_Resume_or_Rethrow, _Unwind_ForcedUnwind): New. + * config/arm/unwind-arm.c (UCB_FORCED_STOP_FN) + (UCB_FORCED_STOP_ARG): New. + (search_EIT_table): Update boundary condition checks. + (get_eit_entry): Return _URC_END_OF_STACK when cannot unwind. + (unwind_phase2): Replace for with do..while. + (unwind_phase2_forced): New. + (__gnu_Unwind_RaiseException): Replace for with do..while. + (__gnu_Unwind_ForcedUnwind): New. + (__gnu_Unwind_Resume): Set FORCE_UNWIND flag, if forced unwinding. + Use appropriate phase2 unwinder. + (__gnu_Unwind_Resume_or_Rethrow): New. + (__gnu_unwind_pr_common): Cope with forced unwinding. + +2005-11-16 David Edelsohn + + PR target/24772 + * config/rs6000/predicates.md (vrsave_operation): SET_SRC is a VEC. + + * config/rs6000/rs6000.md (btruncsf2, ceilsf2, floorsf2, + roundsf2): Remove "s" from mnemonic. + +2005-11-16 Bernd Schmidt + + * config/bfin/crti.s (__init, __fini): Use appropriate prologue if + __PIC__ is defined. + * config/bfin/crtn.s: Change epilogues to match. + * config/bfin/t-bfin-elf (EXTRA_MULTILIB_PARTS): Define. + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): If flag_pic, define + __PIC__ and __pic__. + +2005-11-16 Tobias Schl"uter + + PR 24357 + * doc/invoke.texi: Distinguish between free and fixed form instead of + Fortran and Fortran 90/95. Remove ratfor from the list of supported + languages. + * gcc.c (default_compilers): Remove double entries, add entries for + suffixes '.F90' and '.F95'. + +2005-11-16 Eric Botcazou + + * config/alpha/alpha.c (alpha_expand_prologue): Fix off-by-one bug + in the stack probing loop. + +2005-11-15 David Edelsohn + + * configure.ac: Use .machine power5 not power5x. + * configure: Regenerate. + +2005-11-15 Mike Stump + + * c-decl.c (lookup_name_two): Add. + * c-tree.h (lookup_name_two): Likewise. + * c-common.c (handle_cleanup_attribute): Use lookup_name_two instead. + * config/darwin-c.c (darwin_pragma_unused): Likewise. + +2005-11-16 Alan Modra + + PR rtl-optimization/23392 + * regrename.c (enum scan_actions) Add mark_access. + (scan_actions_name): Ditto. + (scan_rtx_reg): Handle mark_access. + (scan_rtx_address): Do nothing for mark_access. + (build_def_use): Mark source registers in REG_FRAME_RELATED_EXPR + and regs in REG_INC notes before closing chains for dead regs. + Mark destination regs in REG_FRAME_RELATED_EXPR notes after + opening chains for new writes. + +2005-11-15 David Edelsohn + + * c.opt (ffixed-line-length-none): New. + +2005-11-15 Steve Ellcey + + * mklibgcc.in: Change contents of eh_dummy.c. + +2005-11-15 Daniel Jacobowitz + + * loop.c (scan_loop): Do not insert temporaries for hard registers. + +2005-11-15 Daniel Jacobowitz + + * config/arm/lib1funcs.asm (div0) [L_dvmd_lnx]: Call raise instead + of making syscalls. + * config/arm/linux-eabi.h (CLEAR_INSN_CACHE): Define. Set r7 also. + +2005-11-15 Jan Hubicka + + * invoke.texi (large-unit-insns): Document. + * ipa-inline.c (cgraph_decide_inlining): Use large-unit-insns param. + * params.def (large-unit-insns): New param. + +2005-11-15 Hans-Peter Nilsson + + PR target/24869 + * config/cris/cris.md ("*mov_sidesisf_mem"): Do not match + special register for operand 3. Reindent constraints to align + them vertically. + +2005-11-14 David Edelsohn + + * doc/invoke.texi (RS/6000 and PowerPC Options): Add -mmfcrf, + -mpopcntb, -mfprnd. Add -mcpu=power5+. + * configure.ac: Add test for FP rounding instructions. + * configure: Regenerate. + * config.in: Regenerate. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define + _ARCH_PPCSQ, _ARCH_PPCGR, _ARCH_PWR4, _ARCH_PWR5, _ARCH_PWR5X if + features enabled. + * config/rs6000/rs6000.opt (mfprnd): New. + * config/rs6000/rs6000.c (processor_target_table): Add power5+. + (POWERPC_MASKS): Add MASK_POPCNTB and MASK_FPRND. + * config/rs6000/aix52.h (ASM_CPU_SPEC): Add -mpower5+. + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add -mpower5+. + (TARGET_FPRND): New. + * config/rs6000/rs6000.md (UNSPEC_FRIM, UNSPEC_FRIN, UNSPEC_FRIP, + UNSPEC_FRIZ): New. + (btrunc2): New. + (ceil2): New. + (floor2): New. + (round2): New. + +2005-11-14 Geoffrey Keating + + * gcc.c (version_compare_spec_function): Use fatal() rather than + abort(). + + * config/rs6000/darwin.h (DARWIN_CRT2_SPEC): New. + (SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2). + * config/i386/darwin.h (SUBTARGET_EXTRA_SPECS): Define %(darwin_crt2) + as empty. + * config/darwin.h (STARTFILE_SPEC): Use %(darwin_crt2) to possibly + link in crt2.o. + + * config/darwin.h (REAL_LIBGCC_SPEC): Link in shared libgcc depending + on -mmacosx-version-min setting. + +2005-11-14 Diego Novillo + + PR 24840 + * tree-vrp.c (infer_value_range): Return false if STMT is a + block terminator and its basic block has no successors. + +2005-11-14 Mike Stump + + * config/i386/i386.c (override_options): -masm=intel isn't + supported on darwin. + * doc/invoke.texi (i386 and x86-64 Options): Likewise. + +2005-11-15 Joseph S. Myers + + * crtstuff.c: Undefine gid_t, pid_t, rlim_t, ssize_t, uid_t and + vfork after including auto-host.h. + +2005-11-15 Alan Modra + + PR rtl-optimization/22002 + * combine.c (distribute_notes): Detect cases where a reg dies + two or more times in a bb, including on the insn we are combining, + and place the death note on the correct range. + +2005-11-14 Dale Johannesen + + * expmed.c (store_bit_field): Add offset unconditionally for + memory targets. + (extract_bit_field): Don't force extzv or extv operand into + a register if field is too big. + +2005-11-14 Daniel Jacobowitz + + * config/arm/arm.c (pic_labelno): New. + (arm_load_pic_register): Use an UNSPEC_PIC_LABEL instead of a + LABEL_REF. Pass only the labelno to PIC insns. + (arm_call_tls_get_addr, legitimize_tls_address): Likewise. + (arm_output_addr_const_extra): Handle UNSPEC_PIC_LABEL. + * arm.md (UNSPEC_PIC_LABEL): New constant. + (pic_add_dot_plus_four, pic_add_dot_plus_eight) + (tls_load_dot_plus_eight): Expect a labelno instead of a LABEL_REF. + Use the correct label prefix. + +2005-11-14 Daniel Jacobowitz + + * config/arm/arm.c (legitimize_tls_address): Use correct rtx for + REQ_EQUIV note. + +2005-11-14 Richard Earnshaw + + * loop-invariant.c: Include tm_p.h. + * Makefile.in: Updated. + +2005-11-13 John David Anglin + + * pa.c (store_reg): Revise generation of frame notes in large frames. + (set_reg_plus_d): Likewise. + +2005-11-13 Andrew MacLeod + + PR tree-optimization/24709 + * tree-ssa-operands.c (verify_imm_links): Increase limit for infinite + loop check. + +2005-11-13 Eric Botcazou + + * gthr-posix95.h: Remove declaration of pthread_mutexattr_settype + and duplicate declaration of pthread_self. + +2005-11-13 Eric Botcazou + Ian Lance Taylor + + PR middle-end/24003 + * calls.c (expand_call): If TARGET is a MEM and some part of the + argument area has been saved, force TARGET to a register. + +2005-11-13 Razya Ladelsky + + * ipa-prop.c (ipa_callsite_compute_param ): Removed obsolete type + checking. + +2005-11-13 Jason Merrill + + PR c++/22489 + * dwarf2out.c (gen_subprogram_die): Force a declaration die for + lazily declared methods. + (force_decl_die): Stop if forcing out the context already make a + DIE for the decl. + (force_type_die): Likewise. + +2005-11-13 Andrew Pinski + + PR middle-end/24820 + * builtins.c (integer_valued_real_p): Add break in + REAL_CST having TREE_OVERFLOW set. + +2005-11-13 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (get_address_cost): Prevent splitting + addressing modes during calculation of costs. + +2005-11-12 Eric Botcazou + + * function.c (assign_stack_local_1): Restrict sanity check + on frame size overflow to 32-bit and above platforms. + +2005-11-12 Hans-Peter Nilsson + + * config/cris/cris.h (LEGITIMIZE_RELOAD_ADDRESS): Define. + * config/cris/cris.c: Include reload.h. + (cris_initial_elimination_offset): New function. + * config/cris/cris-protos.h: (cris_initial_elimination_offset): + Prototype. + +2005-11-12 Richard Guenther + + * gcse.c (find_rtx_in_ldst): Handle NULL pre_ldst_table. + +2005-11-12 Jan Hubicka + + * expr.c (expand_expr_real_1): : Canonicalize + to compare against 0 when possible. + +2005-11-12 Jie Zhang + + * config/bfin/bfin.h (REGISTER_NAMES, SHORT_REGISTER_NAMES, + HIGH_REGISTER_NAMES, FIXED_REGISTERS, CALL_USED_REGISTERS, + REG_ALLOC_ORDER, enum reg_class): Rearrange I/B/L registers. + * config/bfin/bfin.md: Redefine REG_ constants for I/B/L registers + in the new order. + +2005-11-12 Hans-Peter Nilsson + + * recog.c (constrain_operands) : For a match, require + that a non-register matches general_operand when strict >= 0. + +2005-11-11 Steven Bosscher + + * loop-invariant.c (move_loop_invariants): Fix a thinko in the + previous checkin. + +2005-11-11 Daniel Jacobowitz + + * tree-ssa-dse.c (struct address_walk_data, memory_ssa_name_same) + (memory_address_same): New. + (dse_optimize_stmt): Call memory_address_same. + +2005-11-12 Hans-Peter Nilsson + + PR middle-end/24750 + * reload.c (find_reloads_address_1) : New cases. + +2005-11-11 Daniel Jacobowitz + + * longlong.h (__clz_tab): Always provide. + +2005-11-11 Steven Bosscher + + PR 24265 + * loop-invariant.c (may_assign_reg_p): Make sure a hard register + can be assigned to. + (find_invariant_insn): Do the cheapest check, may_assign_reg_p, + before check_maybe_invariant. + (move_invariant_reg): Use gen_move_insn instead of replacing + SET_DEST with the temporary for the invariant. + (move_loop_invariants): If checking is enabled, do internal + consistency checks after completing the pass. + +2005-11-11 David Edelsohn + + PR 24644 + * common.opt (Wvolatile-register-var): New. + * varasm.c (make_decl_rtl): Only emit warning when option + specified. Clarify warning message. + * doc/invoke.texi (Wvolatile-register-var): Document new option. + + * doc/md.texi (copysign): Document standard named pattern. + +2005-11-11 Jie Zhang + + * config/bfin/bfin.c (bfin_expand_strmov): Correctly move the trailing + bytes when align is 2. + * config/bfin/bfin.md (rep_movsi, rep_movhi): Make LSETUP be followed + by the first instruction of the loop. + +2005-11-11 Jason Merrill + + PR c++/24686 + * gimplify.c (gimplify_cleanup_point_expr): Also save and restore + the cleanup list. + +2005-11-11 Zdenek Dvorak + + PR rtl-optimization/22509 + * local-alloc.c (memref_used_between_p): Check whether a function call + could not reference the memref. + +2005-11-11 Ulrich Weigand + + * postreload.c (reload_cse_simplify_operands): Fix bug in sorting + algorithm so as to choose the best, not the worst, alternative. + Reset accumulated register class before processing next alternative. + +2005-11-11 Kaz Kojima + + PR target/24445 + * calls.c (expand_call): Copy a return value to a plain register + if needed. + +2005-11-10 Alexandre Oliva + + PR target/24778 + * varasm.c (assemble_name): Recompute name only for transparent + aliases. + +2005-11-10 Hans-Peter Nilsson + + * tree-ssa-structalias.c (heapvar_lookup): Fix typo: stmt to from. + +2005-11-04 Jeff Law + + PR middle-end/23181 + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Do not + perform reassociation if the parent statement will not die as + a result of the optimization. + +2005-11-10 Daniel Berlin + + * tree-ssa-alias.c (compute_may_aliases): Remove call to + delete_old_heap_vars. + * tree-dfa.c (referenced_var_remove): Remove function. + * tree-ssa.c (init_tree_ssa): Call init_alias_heapvars. + (delete_tree_ssa): Remove call to delete_old_heapvars. + Add call to delete_alias_heapvars. + * tree-flow.h (referenced_var_remove): Remove prototype + (init_alias_heapvars): New prototype. + (delete_alias_heapvars): Ditto. + * Makefile.in (tree-ssa-structalias.o): Add + gt-tree-ssa-structalias.o + (GTFILES): Add tree-ssa-structalias.h and + tree-ssa-structalias.c. + (s-gtype): Add gt-tree-ssa-structalias.h. + * tree-ssa-structalias.c (heapvars): Remove. + (oldheapvars): Remove. + (heapvar_for_stmt): New variable. + (heapvar_lookup): New function. + (heapvar_insert): Ditto. + (get_constraint_for): See if we have an old heapvar + to reuse. + (init_alias_heapvars): New function. + (delete_alias_heapvars): Ditto. + Add include of gt-tree-ssa-structalias.h. + +2005-11-10 Eric Botcazou + + PR middle-end/22127 + * calls.c (special_function_p): Set ECF_RETURNS_TWICE for getcontext. + +2005-11-10 Eric Botcazou + + * tree.c (int_fits_type_p): Only look at the base type + if it has the same precision as the original type. + +2005-11-10 Jakub Jelinek + + PR other/4372 + * varasm.c (assemble_alias): Use %q+D in the error + message instead of %J and %qD. + +2005-11-10 Richard Guenther + + * gcse.c (free_ldst_entry): Only free hashtable if + it exists. + +2005-11-09 Eric Botcazou + + * function.c (assign_stack_local_1): Issue an error message if + the frame size overflows in the signed target arithmetics. + +2005-11-09 Eric Botcazou + + * tree.c (build_qualified_type): Chain the new type to the original + type's TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO linked lists if it is + a POINTER_TYPE or a REFERENCE_TYPE respectively. + (build_pointer_type_for_mode): Only return unqualified types. + (build_reference_type_for_mode): Likewise. + +2005-11-09 Jakub Jelinek + + * Makefile.in (gnucompare): Do comparison of all files using one of + the chosen methods and only afterwards decide if just warning should + be issued or comparison failure raised. + +2005-11-09 Eric Botcazou + + * ifcvt.c (noce_get_alt_condition): Use prev_nonnote_insn. + (noce_try_abs): Negate if the comparison is reversed. + Look only one instruction backwards for a REG_EQUAL note. + +2005-11-09 Alexandre Oliva + + PR other/4372 + * gthr-dce.h, gthr-posix.h, gthr-posix95.h, gthr-solaris.h, + gthr-tpf.h: Define __gthrw. For all identifiers that might + be weak, introduce weakrefs or non-weak aliases with __gthrw, + and prefix all uses with __ghtrw. + +2005-11-09 Alexandre Oliva + + PR other/4372 + * tree.h (IDENTIFIER_TRANSPARENT_ALIAS): New. + (TREE_DEPRECATED): Adjust comment. Check for a DECL. + * c-common.c (handle_weakref_attribute): New. + (c_common_attribute_table): Add weakref. + * configure.ac (HAVE_GAS_WEAKREF): Check for weakref support + in the assembler. + * configure, config.in: Rebuilt. + * defaults.h (ASM_OUTPUT_WEAKREF): Define if HAVE_GAS_WEAKREF. + * doc/extend.texi: Document weakref attribute. + * varasm.c (ultimate_transparent_alias_target): New + (assemble_name): Use it. + (weak_finish_1): Split out of... + (weak_finish): ... and deal with weakrefs in... + (weakref_targets): ... new list. + (globalize_decl): Clean up weakref_targets. + (do_assemble_alias): Handle weakrefs. + (finish_aliases_1): Do not reject weakrefs to external symbols. + (assemble_alias): Handle weakrefs. + +2005-11-09 Richard Guenther + + PR tree-optimization/24716 + * tree-scalar-evolution.c (analyze_evolution_in_loop): Use + t_bool to track results from follow_ssa_edge. + +2005-11-09 Eric Botcazou + + * final.c (force_source_line): New global variable. + (final_scan_insn): Set it to true instead of clearing last_filename. + (notice_source_line): Return true if force_source_line is true, + unless source info is absent. + +2005-11-09 Andrew Pinski + + PR c/24644 + * dwarf2-out.c (add_name_and_src_coords_attributes): Don't add + a linkage name for a variable if it a register variable. + * c-decl.c (grokdeclarator): Global register variables + should be set as PUBLIC. + +2005-11-09 Andreas Krebbel + + PR 24624 + * config/s390/s390.c (struct s390_frame_layout): New fields + first_save_gpr_slot and last_save_gpr_slot. + (cfun_grps_save_area_size, s390_frame_info, s390_emit_prologue, + s390_emit_epilogue, s390_initial_elimination_offset): Replaced + first_save_gpr and last_save_gpr with the _slot variants. + (s390_register_info): Calculate first_save_gpr_slot and + last_save_gpr_slot using regs_ever_live. + +2005-11-09 Andreas Krebbel + + PR 24623 + * config/s390/s390.c (s390_regs_ever_clobbered): Only save live eh regs + for a function containing a landing pad. + +2005-11-09 Andreas Krebbel + + PR 24034 + * flow.c (mark_set_1): Handle CLOBBERs like SETs if the register + is live afterwards. + +2005-11-08 Bernd Schmidt + + * config/bfin/t-bfin-elf (MULTILIB_OPTIONS, MULTILIB_DEFAULTS, + MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): New. + +2005-11-09 Nathan Sidwell + + Add ms2 support + * config/ms1/ms1.md (UNSPEC_BLOCKAGE, UNSPEC_EI, UNSPEC_DI): New + constants. + (call,load,store): New insn types. + (mem_access, branch_access): Adjust reservation conditions. + (define_delay): Adjust condition. + (decrement_and_branch_until_zero): Allow for ms2. Set branch + type. + (*decrement_and_rbanch_until_zero_no_clobber): Allow for ms2. + (*movqi_internal,*movsi_internal,*movsf_internal): Use load,store + insn type. + (call_internal, call_value_internal, return_internal, + return_interrupt_internal, eh_return_internal, indirect_jump, + tablejump): Set call insn type. + (blockage, ei, di): Use appropriate unspec const. + * config/ms1/ms1.c (ms1_flag_delayed_branch): New. + (ms1_get_attr_type): Adjust to give load & store types. + (ms1_final_prescan_insn): Adjust for new insn types. Don't look + backwards past a barrier. + (ms1_override_options): Accept ms2 arch. Copy and reset delayed + branch scheduling. + (struct branch_info, struct label_info): New. + (ms1_labels): New. + (ms1_add_branches, ms1_check_delay_slot, ms1_reorg_hazard): New. + (ms1_machine_reorg): New. + (TARGET_MACHINE_DEPENDENT_REORG): Override. + * config/ms1/crtn.asm: Add nop for ms2 JAL hazard. + * config/ms1/ms1.h (processor_type): Add PROCESSOR_MS2. + (ASM_SPEC, LIB_SPEC, STARTFILE_SPEC, ENDFILE_SPEC): Add ms2. + (TARGET_MS2): New. + +2005-11-09 Per Bothner + Uros Bizjak + + PR c/24101 + * toplev.c (process_options): Initialize debug_hooks early + in case lang_hooks.post_options ends up calling a debug_hook. + +2005-11-08 Jakub Jelinek + + * dwarf2out.c (multiple_reg_loc_descriptor): Don't assume + DBX_REGISTER_NUMBER being contiguous. + +2005-11-08 James A. Morrison + Diego Novillo + + PR 23046 + * tree-vrp.c (register_edge_assert_for): Do not register + always-false predicates. + +2005-11-08 Devang Patel + + PR tree-optimization/23115 + * tree-if-conv.c (find_phi_replacement_condition): Check domninated_by + relation. + +2005-11-08 Joseph S. Myers + + * config/rs6000/t-fprules (MULTILIB_MATCHES_FLOAT): Include + -mcpu=440. + +2005-11-08 Daniel Berlin + + Fix PR tree-optimization/23382 + + * tree-ssa-alias.c (compute_may_aliases): Call + delete_old_heap_vars. + * tree-dfa.c (referenced_var_remove): New function. + * tree-ssa.c (delete_tree_ssa): Call delete_old_heap_vars. + * tree-flow.h (referenced_var_remove): Add prototype. + (delete_old_heap_vars): Ditto. + * tree-ssa-structalias.c (heapvars): New variable. + (oldheapvars): Ditto. + (get_constraint_for): Put heap vars on heapvars list. + (delete_old_heap_vars): New function. + +2005-11-08 Jason Merrill + + * tree.h (CALL_FROM_THUNK_P): Add CALL_EXPR_CHECK. + +2005-11-08 Uros Bizjak + + PR target/19340 + * reg-stack.c (reg_to_stack): Update register liveness also + for flag_sched2_use_traces. + +2005-11-08 Alan Modra + + PR target/23704 + * config/rs6000/rs6000.c (rs6000_handle_option ): Don't + override prior explicit -mno-powerpc-gfxopt. + +2005-11-07 Eric Botcazou + + * expmed.c (extract_bit_field): Do not use insv/extv/extzv patterns + if the bitsize is zero. + * doc/md.texi (Standard Pattern Names): Document it. + + * config/ia64/ia64.c (ia64_pass_by_reference): Delete. + (TARGET_PASS_BY_REFERENCE): Likewise. + +2005-11-07 Ian Lance Taylor + + PR rtl-optimization/24683 + * config/i386/i386.c (legitimize_pic_address): If constant operand + to PLUS is too large, put it in a register. + +2005-11-07 Jie Zhang + + * configure.ac: Enable checking assembler dwarf2 support for bfin + target. + * configure: Regenerate. + +2005-11-07 Paolo Bonzini + + PR target/24230 + + * config/rs6000/rs6000.c (easy_vector_splat_const, easy_vector_same, + gen_easy_vector_constant_add_self): Delete. + (vspltis_constant, easy_altivec_constant, gen_easy_altivec_constant): + New. + (output_vec_const_move): Use gen_easy_altivec_constant. + (rs6000_expand_vector_init): Do not emit a set of a VEC_DUPLICATE. + * config/rs6000/predicates.md (easy_vector_constant): Reorganize tests. + (easy_vector_constant_add_self): Rewritten. + * config/rs6000/rs6000-protos.h (easy_vector_splat_const, + easy_vector_same, gen_easy_vector_constant_add_self): Remove prototype. + (easy_altivec_constant, gen_easy_altivec_constant): Add prototype. + * config/rs6000/altivec.md (easy_vector_constant_add_self splitters): + Macroize and adjust for the other changes. + +2005-11-07 Paolo Bonzini + + PR c/24599 + + * c-typeck.c (build_c_cast): Try using a shared constant, and see + if TREE_OVERFLOW or TREE_CONSTANT_OVERFLOW really changed. + +2005-11-07 Jakub Jelinek + + PR rtl-optimization/23567 + * ifcvt.c (noce_mem_write_may_trap_or_fault_p): New function. + (noce_process_if_block): Don't do any optimizations except + if (cond) x = x; if !set_b and write into orig_x may trap + or fault. Remove the MEM_READONLY_P check. + +2005-11-06 Diego Novillo + + PR 24670 + * tree-vrp.c (fix_equivalence_set): New. + (extract_range_from_assert): Call it. + +2005-11-05 Ian Lance Taylor + + PR target/22432 + * combine.c (apply_distributive_law): Don't distribute across a + vector mode subreg. + +2005-11-05 Kazu Hirata + + * c-typeck.c, config/i386/netware.h, config/m32c/cond.md, + config/ms1/ms1.h, config/rs6000/predicates.md, + config/s390/s390.c, params.def, postreload-gcse.c, + tree-flow-inline.h, tree-ssa-operands.c, tree-vectorizer.c, + tree-vrp.c, tree.c: Fix comment typos. + * doc/invoke.texi: Fix typos. + +2005-11-05 Sebastian Pop + + * lambda-code.c (lambda_transform_legal_p): Use DDR_NUM_DIST_VECTS + for testing whether the data_dependence_relation contains distance + vectors. Iterate over all distance vectors of the ddr. + * lambda.h: Define a vec of lambda_vector pointers. + * tree-data-ref.c (dump_data_dependence_relation, + dump_data_dependence_direction): Iterate over all distance and + direction vectors of the ddr. + (initialize_data_dependence_relation): Initialize DDR_DIR_VECTS and + DDR_DIST_VECTS. + (build_classic_dist_vector, build_classic_dir_vector): Push a set + of distance/direction vectors instead of a single one. + * tree-data-ref.h (dir_vects, dist_vects): Replace dir/dist + lambda_vectors with a vec of lambda_vectors. + (DDR_DIR_VECT, DDR_DIST_VECT): Redefined as operations on vec. + (DDR_DIR_VECTS, DDR_DIST_VECTS, DDR_NUM_DIR_VECTS, + DDR_NUM_DIST_VECTS): New. + * tree-loop-linear.c (gather_interchange_stats): Test for the + existence of distance vectors only after having checked that there + is a dependence. Iterate over all distance vectors of the ddr. + (linear_transform_loops): Use dump_data_dependence_relation. + * tree-vect-analyze.c (vect_analyze_data_ref_dependence): Test for + distance vectors using DDR_NUM_DIST_VECTS. Iterate over all the + distance vectors of the ddr. + +2005-11-05 Bernd Schmidt + + * config/bfin/bfin.c (n_dregs_to_save, n_pregs_to_save, + expand_prologue_reg_save, expand_epilogue_reg_restore): New argument + IS_INTHANDLER; all callers changed. + (n_regs_saved_by_prologue): Take interrupt handler attributes into + account. + (do_link, do_unlink): New argument ALL; all callers changed. + (expand_interrupt_handler_prologue, expand_interrupt_handler_epilogue): + If function isn't leaf, save and restore all registers. + (bfin_function_ok_for_sibcall): Only true if not an interrupt or + exception handler. + +2005-11-05 Jan Hubicka + + PR rtl-optimization/23490 + * doc/invoke.texi (max-predicted-iterations, max-cse-insns, + max-flow-memory-location): Document. + * flow.c: Include params.h + (MAX_MEM_SET_LIST_LEN): Kill. + (add_to_mem_set_list): Use new param. + * cse.c (cse_basic_block): Replace 1000 by new param. + * params.def (PARAM_MAX_PREDICTED_ITERATIONS, PARAM_MAX_CSE_INSNS, + PARAM_MAX_FLOW_MEMORY_LOCATIONS): New. + * predict.c (predict_loops): Use new param. + * predict.def (MAX_PRED_LOOP_ITERATIONS): Remove. + + * ipa-inline.c (cgraph_decide_inlining_of_small_function, + cgraph_decide_inlining, cgraph_decide_inlining_incrementally): + Do not hold memory returned by cgraph_node_name across other call. + +2005-11-04 Hans-Peter Nilsson + + PR target/23424 + * config/cris/predicates.md ("cris_bdap_sign_extend_operand"): + Disable. + +2005-11-04 Jeff Law + + PR/21883 + * doc/invoke.texi: Document max-jump-thread-duplication-stmts PARAM. + * tree-ssa-dom.c: Include params.h. + (thread_across_edge): If there are too many statements in the + target block, then do not thread through it. + * Makefile.in (tree-ssa-dom.o): Depend on $(PARAMS_H). + * params.def (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS): New PARAM. + +2005-11-03 Diego Novillo + + PR 24627 + * tree-ssa-dce.c (pass_dce, pass_dce_loop, pass_cd_dce): Use + TODO_update_ssa instead of TODO_update_ssa_no_phi. + +2005-11-04 Sebastian Pop + + PR/18595 + * tree-scalar-evolution.c (instantiate_parameters_1, + instantiate_parameters, resolve_mixers): Compute the size of an + expression to be instantiated and give up the instantiation if the + size exceeds PARAM_SCEV_MAX_EXPR_SIZE. + +2005-11-04 Richard Guenther + + * tree-flow.h (ref_contains_indirect_ref): Rename to + array_ref_contains_indirect_ref. + * tree-flow-inline.h (ref_contains_indirect_ref): Likewise. + (array_ref_contains_indirect_ref): Make comment match the code + and vice-versa. + (ref_contains_array_ref): Likewise. + * tree-ssa-structalias.c (find_func_aliases): Remove call to + ref_contains_indirect_ref. + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): + Rename calls to ref_contains_indirect_ref. + +2005-11-04 Paul Brook + + * config/arm/arm.c (arm_load_pic_register): Pass extra reg to + gen_pic_add_dot_plus_four and gen_pic_add_dot_plus_eight. + (arm_call_tls_get_addr, legitimize_tls_address): Likewise. + * config/arm/arm.md: Use match_operand in peephole input templates + and match_dup in peephole output templates. + +2005-11-04 Daniel Jacobowitz + + * config/arm/arm.c (arm_init_libfuncs): Use __aeabi_idiv and + __aeabi_uidiv. + +2005-11-04 Mark Mitchell + Daniel Jacobowitz + + * longlong.h (add_ssaaaa): Clobber condition code register + in ARM version. + (sub_ddmmss): Likewise. + (umul_ppmm): Likewise. + +2005-11-04 Daniel Jacobowitz + Paul Brook + Phil Blundell + + * configure.ac: Add test for ARM TLS support. + * configure: Regenerated. + * config/arm/arm-protos.h (legitimize_tls_address) + (arm_tls_referenced_p, tls_mentioned_p) + (arm_output_addr_const_extra): New prototypes. + (thumb_legitimize_pic_address): Delete. + * config/arm/arm.c: Include "gt-arm.h". + (enum tls_reloc): New. + (arm_cannot_copy_insn_p, arm_tls_symbol_p, load_tls_operand) + (pcrel_constant_p, get_tls_get_addr, arm_load_tp) + (arm_call_tls_get_addr, legitimize_tls_address) + (arm_tls_referenced_p, arm_tls_operand_p_1, tls_mentioned_p) + (arm_init_tls_builtins, arm_emit_tls_decoration) + (arm_output_addr_const_extra): New functions. + (TARGET_CANNOT_COPY_INSN_P, TARGET_CANNOT_FORCE_CONST_MEM) + (TARGET_HAVE_TLS): Define. + (target_thread_pointer): New. + (arm_override_options): Handle -mtp=. + (legitimize_pic_address): Ignore UNSPECs. + (arm_legitimate_address_p, thumb_legitimate_address_p): Handle PC + relative symbols. + (arm_legitimize_address, thumb_legitimize_address): Handle TLS. + (tls_get_addr_libfunc): New variable. + (symbol_mentioned_p, label_mentioned_p): Ignore UNSPEC_TLS. + (arm_init_builtins): Call arm_init_tls_builtins. + (arm_expand_builtin): Handle ARM_BUILTIN_THREAD_POINTER. + (arm_encode_section_info): Call default_encode_section_info. + * config/arm/arm.h (TARGET_HARD_TP, TARGET_SOFT_TP): Define. + (enum arm_tp_type): New. + (target_thread_pointer): Add declaration. + (LEGITIMATE_CONSTANT_P): Handle TLS. + (LEGITIMATE_PIC_OPERAND_P): Handle TLS. + (OUTPUT_ADDR_CONST_EXTRA): Call arm_output_addr_const_extra. + (enum arm_builtins): Add ARM_BUILTIN_THREAD_POINTER. + * config/arm/arm.md: Add UNSPEC_TLS. + (movsi): Handle TLS. + (pic_add_dot_plus_four, pic_add_dot_plus_eight): Allow for + non-PIC. + (tls_load_dot_plus_eight): New insn and a peephole to create it. + (load_tp_hard, load_tp_soft): New insns. + * arm.opt: Add -mtp=. + * doc/invoke.texi (ARM Options): Document -mtp. + +2005-11-04 Daniel Jacobowitz + + * config/arm/lib1funcs.asm: Don't include "libunwind.S". + * config/arm/libunwind.S: Include "lib1funcs.asm". + * config/arm/t-bpabi (LIB1ASMFUNCS): Remove _unwind. + (LIB2ADDEH): Add libunwind.S. + (LIB2ADDEHDEP): Add lib1funcs.asm. + * mklibgcc.in: Handle asm files in libgcc_eh.a. + +2005-11-04 Francois-Xavier Coudert + + PR fortran/18452 + * c.opt: Add a -lang-fortran option. + * c-opts.c: Add a lang_fortran flag. + (c_common_init_options): Handling the -lang-fortran option. + (c_common_handle_option): Add a case for Fortran options in + preprocessing. Remove cases for -ffixed-form and + -ffixed-line-length. Add a case for -lang-fortran. + +2005-11-03 David Edelsohn + + * config/rs6000/rs6000.c: Include params.h + (optimization_options): Set max-grow-copy-bb-insns default to 16. + (bdesc_2arg): Delete vpkuhss and vpkuwss. + * config/rs6000/altivec.md (UNSPEC_VPKUHSS): Delete. + (UNSPEC_VPKUWSS): Delete. + (altivec_vpkuhss): Delete. + (altivec_vpkuwss): Delete. + * config/rs6000/rs6000.md (plus_eqsi): Remove optimize_size from + final condition. + (neg_eq0): Remove final condition. + (neg_eq): Remove condition and split-condition. + +2005-11-04 Alan Modra + + * config/rs6000/rs6000.c (output_toc): Make "offset" HOST_WIDE_INT. + Use associated print macros. + +2005-11-03 Joseph S. Myers + + PR c++/17964 + * diagnostic.c (diagnostic_set_info_translated): New function. + (diagnostic_set_info): Use it. Add comment. + * diagnostic.h (diagnostic_set_info_translated): Declare. + +2005-11-03 Eric Botcazou + + * dwarf2asm.c (dw2_force_const_mem): Add new parameter 'public'. + On USE_LINKONCE_INDIRECT platforms, build a DECL_ONE_ONLY indirect + reference only if 'public' is true. + (dw2_output_indirect_constant_1): On USE_LINKONCE_INDIRECT platforms, + emit the .hidden directive only if the indirect reference is public. + (dw2_asm_output_encoded_addr_rtx): Add new parameter 'public'. + Pass it to dw2_force_const_mem. + * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): New param 'public'. + * dwarf2out.c (output_cfi): Adjust calls to above function. + (output_call_frame_info): Likewise. + * except.c (output_ttype): Pass TREE_PUBLIC of the type_info object + as 'public' argument to dw2_asm_output_encoded_addr_rtx. + +2005-11-03 Zdenek Dvorak + + PR tree-optimization/24483 + * tree-ssa-loop-ivopts.c (aff_combination_add_elt): Move rest + field to elts if possible. + +2005-11-03 Andrew Pinski + + PR middle-end/23155 + * gimplifier.c (gimplify_expr): Create a temporary for lvalue + CONSTRUCTOR. + +2005-11-03 Daniel Berlin + + Fix PR tree-optimization/24351 + + * tree-ssa-structalias.c (struct variable_info): Add + collapsed_into. + (get_varinfo_fc): New function to follow collapsing. + (new_var_info): Set collapsed_to to NULL. + (dump_constraint): Follow collapsing. + (build_constraint_graph): Handle collapsing. + (do_simple_structure_copy): Return false if something bad + happened. + (collapse_rest_of_var): New function. + (do_structure_copy): Collapse if do_simple_structure_copy returns + false. + +2005-11-03 Andrew Pinski + + PR middle-end/24589 + * gimplify.c (gimplify_expr) : Add the + expressions to a statement list instead of gimplifying them. + +2005-11-03 Eric Botcazou + + PR rtl-optimization/23585 + * rtlanal.c (rtx_addr_can_trap_p_1) : Return 0 for an address + that can't trap plus a constant integer, if the mode has zero size. + +2005-11-03 Ulrich Weigand + + PR target/24620 + * config/s390/s390.md ("*insv_reg_imm"): Accept any CONST_INT + as operand 2. + ("*insv_reg_extimm"): Likewise. + +2005-11-03 Joseph S. Myers + + PR c/24329 + * c-pretty-print.c (pp_c_type_specifier): Do not recurse if + c_common_type_for_mode returns an unnamed type. + +2005-11-02 Richard Henderson + + PR target/9350 + PR target/24374 + * dwarf2out.c (dwarf2out_reg_save_reg): New. + (dwarf2out_frame_debug_expr): Return after dwarf_handle_frame_unspec. + * function.c (assign_parms): Use calls.internal_arg_pointer. + (expand_main_function): Remove FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN + code. + * target-def.h (TARGET_INTERNAL_ARG_POINTER): New. + (TARGET_CALLS): Add it. + * target.h (struct gcc_target): Add calls.internal_arg_pointer. + * targhooks.c (default_internal_arg_pointer): New. + * targhooks.h (default_internal_arg_pointer): Declare. + * tree.h (dwarf2out_reg_save_reg): Declare. + * doc/tm.texi (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Remove. + * config/i386/i386.c (dbx_register_map): Add return column. + (dbx64_register_map, svr4_dbx_register_map): Likewise. + (TARGET_INTERNAL_ARG_POINTER, ix86_internal_arg_pointer): New. + (TARGET_DWARF_HANDLE_FRAME_UNSPEC, ix86_dwarf_handle_frame_unspec): New. + (ix86_function_ok_for_sibcall): Disable if force_align_arg_pointer. + (ix86_save_reg): Save force_align_arg_pointer. + (ix86_emit_save_regs): Make regno unsigned. + (ix86_emit_save_regs_using_mov): Likewise. + (ix86_expand_prologue): Handle force_align_arg_pointer. + (ix86_expand_epilogue): Likewise. + * config/i386/i386.h: (dbx_register_map): Update. + (dbx64_register_map, svr4_dbx_register_map): Update. + (struct machine_function): Add force_align_arg_pointer. + * config/i386/i386.md (UNSPEC_REG_SAVE, UNSPEC_DEF_CFA): New. + (UNSPEC_TP, UNSPEC_TLS_GD, UNSPEC_TLS_LD_BASE): Renumber. + (TARGET_PUSH_MEMORY peepholes): Disable if RTX_FRAME_RELATED_P. + +2005-11-02 Jan Hubicka + + PR target/23303 + * i386.md: Add peep2 for simplyfing array accesses. + +2005-11-02 Ulrich Weigand + + PR target/24615 + * config/s390/s390-protos.h (s390_decompose_shift_count): Declare. + * config/s390/s390.c (s390_decompose_shift_count): New function. + (s390_extra_constraint_str) ['Y']: Use s390_decompose_shift_count. + (print_shift_count_operand): Use s390_decompose_shift_count. + * config/s390/predicates.md ("setmem_operand", "shift_count_operand"): + Use s390_decompose_shift_count. Do not accept any non-base hard regs. + +2005-11-02 Ulrich Weigand + + PR target/24600 + * loop.c (loop_givs_rescan): Use force_operand to expand + complex GIVs. + +2005-11-02 Andrew Pinski + + PR 22429 + * fold-const.c (build_range_check): Use unsigned when signed + overflow is undefined also. If etype is subtype, make sure that + the subtraction is in the supertype. + +2005-11-02 Richard Henderson + + PR target/24178 + * config/alpha/alpha.c (get_aligned_mem): Honor alignment given + by MEM_ALIGN. + +2005-11-01 Richard Henderson + + PR 21518 + * loop.c (scan_loop): Do not propagate computations to a hard + register destination with SMALL_REGISTER_CLASSES. + +2005-11-01 Joseph S. Myers + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Do not add extra + costs for MULT inside PLUS or MINUS. + +2005-11-01 Bob Wilson + + * config/xtensa/xtensa.h (TRAMPOLINE_TEMPLATE): Add a byte of padding. + (TRAMPOLINE_SIZE): Round up to 60. + * config/xtensa/lib2funcs.S (TRAMPOLINE_SIZE): Likewise. + +2005-10-31 James E. Wilson + + PR debug/24444 + * dwarf2out.c (convert_cfa_to_loc_list): Put inside DWARF2_UNWIND_INFO + ifdef. Put ifdefs around call in gen_subprogram_die. + (compute_frame_pointer_to_cfa_displacement): Likewise. + (gen_subprogram_die): Restore old code for when DWARF2_UNWIND_INFO is + not defined. + + PR rtl-optimization/17356 + * cfgrtl.c (purge_dead_edges): Undo last change. In EDGE_EH code, + add check for CALL_INSN if EDGE_ABRNOMAL_CALL true. + +2005-10-31 Jan Hubicka + + PR middle-end/24093 + * cgraph.c (cgraph_clone_edge, cgraph_clone_node): Watch negative + + PR target/20928 + * i386.c (legitimize_pic_address): Deal with large immediates. + + PR profile/20815 + * coverage.c (coverage_checksum_string): Fix code to stip random seeds + from symbol names while computing checkup. + + PR profile/24487 + * predict.c (predict_loops): Do not estimate more than + MAX_PRED_LOOP_ITERATIONS in PRED_LOOP_ITERATIONS heuristic. + * predict.def (MAX_PRED_LOOP_ITERATIONS): Define. + +2005-10-31 Andrew MacLeod + + PR tree-optimization/19097 + * tree-ssa-operands.c (correct_use_link): Don't look for modified stmts. + +2005-10-31 J"orn Rennecke + + * optabs.c (expand_unop): Take TRULY_NOOP_TRUNCATION into account. + +2005-10-31 Andrew Pinski + + PR middle-end/23492 + * tree-inline.c (setup_one_parameter): If the init_stmt + is NULL, don't insert the statement. + +2005-10-30 Jan Hubicka + + PR tree-optimization/24172 + * tree-inline.c (copy_body_r): Unshare the substituted value first. + +2005-10-30 Hans-Peter Nilsson + + * config/mmix/mmix.c (mmix_intval): Correct handling of DFmode + constants for hosts with long != 32 bits. + +2005-10-28 Andreas Krebbel + + PR middle-end/24093 + * ipa-inline.c (craph_decide_recursive_inlining): Fix return value. + +2005-10-28 Aldy Hernandez + + * config/ms1/ms1.h (TARGET_MS1_64_001): New. + (TARGET_MS1_16_002): New. + (TARGET_MS1_16_003): New. + + * config/ms1/ms1.md ("decrement_and_branch_until_zero"): Rewrite. + ("*decrement_and_branch_until_zero_no_clobber"): New. + Add corresponding splitter for decrement_and_branch_until_zero + instruction. + Key all decrement_and_branch_until_zero patterns off of + TARGET_MS1_16_003. + +2005-10-28 Andrew Pinski + + PR middle-end/24362 + * tree-complex.c (extract_component): Treat RESULT_DECL + like the rest of the decls. + +2005-10-25 Eric Botcazou + + * config/ia64/ia64.c (ia64_output_function_profiler): Emit an + indirect call to _mcount if the function needs a static chain. + +2005-10-25 Eric Botcazou + Caroline Tice + + PR rtl-optimization/24460 + * dwarf2out.c (have_switched_text_sections): New boolean variable. + (dwarf2out_switch_text_section): Set it to true instead of + incrementing separate_line_info_table_in_use. + (output_loc_list): Additionally test have_switched_text_sections. + (output_ranges): Likewise. + (dwarf2out_finish): Likewise. + * varasm.c (assemble_start_function): Do not call + insert_section_boundary_note. + (assemble_end_function): If flag_reorder_blocks_and_partition, + switch to the function's section before emitting the .size directive. + * bb-reorder.c (insert_section_boundary_note): Staticify. + (rest_of_handle_reorder_blocks): Call insert_section_boundary_note. + * output.h (insert_section_boundary_note): Delete. + +2005-10-24 Andrew Pinski + + PR c/23103 + * c-format.c (check_format_types): Use lang_hooks.types_compatible_p + instead of pointer equality when comparing types. + +2005-10-24 James E. Wilson + + * sched-deps.c (flush_pending_lists): Pass 1 not 0 in first two + add_dependence_list_and_free calls. + +2005-10-24 Steven Bosscher + + * contrib.texi: Add the names of the LLNL folks who donated + Cray pointer support for gfortran. + +2005-10-24 Steven Bosscher + + PR tree-optimization/24225 + * profile.c (branch_prob): Look from end to start through a + basic block when looking for a locus. + +2005-10-24 Richard Henderson + + * pa.c (store_reg_modify): Set RTX_FRAME_RELATED_P on each set in + parallel. + (hppa_expand_prologue): Likewise. + +2005-10-24 John David Anglin + + * pa-linux.h (NO_PROFILE_COUNTERS): Delete define. + (NO_DEFERRED_PROFILE_COUNTERS): Define. + * pa.h (NO_PROFILE_COUNTERS): Define. + * pa.c (NO_DEFERRED_PROFILE_COUNTERS): Define if not defined. + (funcdef_nos): New vector to hold label numbers of deferred profile + counters. + (output_deferred_profile_counters): New function. + (hppa_profile_hook): Push label number onto funcdef_nos. + (pa_hpux_file_end): Call output_deferred_profile_counters if + NO_DEFERRED_PROFILE_COUNTERS is false. + + * pa-protos.h (get_deferred_plabel): New prototype. + * pa.c (get_plabel): Rename to get_deferred_plabel. Return plabel. + Make global. + (output_call): Adjust calls. + +2005-10-24 Alan Modra + + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Explain + peculiarity of GOT/TOC section usage. + +2005-10-23 Andrew Pinski + + PR objc/24435 + * c-common.c (constant_string_class_name): Add documentation. + +2005-10-23 Kaz Kojima + + PR target/23832 + * recog.c (peephole2_optimize): Increment peep2_current_count + only when the slot is empty. + +2005-10-23 John David Anglin + + PR ada/23957 + * except.c (output_function_exception_table): Call + assemble_external_libcall if we need a personality function. + +2005-10-21 Eric Botcazou + + PR rtl-optimization/24460 + * bb-reorder.c (fix_crossing_unconditional_branches): Do not + set the basic block for barriers. + +2005-10-21 Janis Johnson + + * var-tracking.c (vt_initialize): Initialize post. + +2005-10-21 Devang Patel + + PR/24220 + * c-common.c (vector_types_convertible_p): Check vector element type. + +2005-10-21 Kaz Kojima + + * config/sh/sh.c (prepare_move_operands): Handle the address + constant which is a tls symbolic address plus a constant. + +2005-10-21 Andrew Pinski + + PR driver/24473 + * gcc.c (main): Use the correct counter for erroring out + about mulitple files. + +2005-10-21 Alan Modra + + PR target/24465 + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Always + use r2 for 64-bit tls .got access. + +2005-10-21 Paolo Bonzini + + * dojump.c (do_jump): Handle side-effecting TRUTH_AND_EXPR and + TRUTH_OR_EXPR. + +2005-10-20 Steven Bosscher + + PR tree-optimization/24307 + * tree-cfg.c (tree_find_edge_insert_loc): Handle naked RETURN_EXPR. + +2005-10-20 Alexandre Oliva + + PR middle-end/24295 + * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Mark + alias targets. + * varasm.c (find_decl_and_mark_needed): After cgraph global info + is ready, stop marking functions, but still mark variables. + +2005-10-20 Richard Guenther + + PR c++/24439 + * fold-const.c (invert_truthvalue): Handle COND_EXPR with + void type operands. + +2005-10-20 Eric Botcazou + + PR rtl-optimization/23585 + * rtlanal.c (rtx_addr_can_trap_p_1): New predicate extracted from... + (rtx_addr_can_trap_p): ... here. Invoke rtx_addr_can_trap_p_1. + (may_trap_p_1): New predicate extracted from... + (may_trap_p): ... here. Invoke may_trap_p_1. + (may_trap_or_fault_p): New predicate. + * rtl.h (may_trap_or_fault_p): Declare it. + * reorg.c (steal_delay_list_from_target): Use may_trap_or_fault_p + instead of may_trap_p. + (steal_delay_list_from_fallthrough): Likewise. + (fill_simple_delay_slots): Likewise. + (fill_slots_from_thread): Likewise. + * function.c (pad_to_arg_alignment): Rework comment about + SPARC_STACK_BOUNDARY_HACK. + * config/sparc/sparc.h: Likewise. + +2005-10-19 Adrian Straetling + + * config/s390/s390.c (s390_expand_insv): New. + * config/s390/s390-protos.h (s390_expand_insv): Declare. + * config/s390/s390.md ("UNSPEC_SETHIGH"): Rename to "UNSPEC_ICM". + ("icm_hi"): Remove mode attribute. + ("*sethigh"): Rewrite to "sethighpart". + Adjust all uses. + ("*extracthi", "*extractqi"): Remove. + (extv", "*extzv"): New. + ("insv", "*insv_mem_reg", "*insvdi_mem_reghigh", + "*insv_reg_imm", "*insv_reg_extimm"): New. + +2005-10-19 Ulrich Weigand + + * cfgexpand.c (discover_nonconstant_array_refs_r, + discover_nonconstant_array_refs): Move here from tree-outof-ssa.c + (tree_expand_cfg): Call discover_nonconstant_array_refs. + * tree-outof-ssa.c (rewrite_out_of_ssa): Remove call to + discover_nonconstant_array_refs. + +2005-10-19 Steven Bosscher + + PR c/23228 + * c-decl.c (pop_scope): Don't warn about an unused variable + if it is marked with TREE_NO_WARNING. + (duplicate_decls): Set TREE_NO_WARNING if olddecl and newdecl + somenow mismatch and olddecl is to be replaced. + +2005-10-19 Eric Botcazou + + PR middle-end/23199 + * cfgrtl.c (safe_insert_insn_on_edge): Use can_copy_p to detect + whether registers live on the edge can be saved/restored. + +2005-10-19 Kaz Kojima + + * config/sh/sh.c (fixup_mova): Skip notes. + +2005-10-19 Ulrich Weigand + + * config/s390/s390-protos.h (s390_hard_regno_rename_ok): Add prototype. + * config/s390/s390.c (s390_hard_regno_rename_ok): New function. + (s390_can_eliminate): Handle BASE_REGNUM elimination. + (s390_initial_elimination_offset): Likewise. + (s390_conditional_register_usage): BASE_REGNUM is no longer a fixed + register on TARGET_ZARCH targets. + * config/s390/s390.h (HARD_REGNO_RENAME_OK): Define + (INITIAL_FRAME_POINTER_OFFSET): Remove. + (REG_ALLOC_ORDER): Move BASE_REGNUM lower. + (ELIMINABLE_REGS): Add BASE_REGNUM elimination rule. + +2005-10-19 Andreas Krebbel + + * config/s390/s390.md: Comment describing output modifiers updated. + * config/s390/s390.c (print_operand): Likewise. + +2005-10-19 Andreas Krebbel + + * config/s390/s390.c (override_options): Added check for -mstack-size + 64k limitation. + * doc/invoke.texi: Mention that limit in the documenation. + +2005-10-18 Paolo Bonzini + + PR #19672 + * dojump.c (do_jump): Handle TRUTH_AND_EXPR and TRUTH_OR_EXPR here. + +2005-10-18 Daniel Berlin + + Fix PR tree-optimization/24231 + + * tree-ssa-pre.c (try_look_through_load): Skip abnormal phi names + (compute_avail): Ditto. + +2005-10-18 Richard Henderson + + PR target/24428 + * config/i386/i386.c (legitimate_constant_p): Check + SYMBOL_REF_TLS_MODEL directly. Don't fallthru to SYMBOL_REF + if LABEL_REF. + (legitimate_pic_operand_p): Test SYMBOL_REF_TLS_MODEL directly. + (legitimate_pic_address_disp_p): Reorg CONST checking to make + sure SYMBOL_REF_TLS_MODEL is tested. Test SYMBOL_REF_TLS_MODEL + directly. + (print_operand_address): Likewise. + * config/i386/predicates.md (x86_64_immediate_operand): Test + SYMBOL_REF_TLS_MODEL properly inside CONST. + (x86_64_zext_immediate_operand): Likewise. + (global_dynamic_symbolic_operand, local_dynamic_symbolic_operand, + initial_exec_symbolic_operand, local_exec_symbolic_operand): Remove. + * config/i386/i386-protos.h: Remove predicates.md entries. + +2005-10-18 Danny Smith + + * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition): + Check that elements of TYPE_METHODS are FUNCTION_DECLs. + +2005-10-17 Alexey Starovoytov + Ian Lance Taylor + + PR middle-end/23522 + * fold-const.c (fold_widened_comparison): Do not allow range based + constant folding when right operand cannot be unwidened. + +2005-10-17 Richard Henderson + + * builtins.c (expand_builtin_synchronize): Build a new-style asm + with a memory clobber. + +2005-10-17 James E Wilson + + PR rtl-optimization/17356 + * cfgrtl.c (purge_dead_edges): Check for EDGE_ABNORMAL_CALL before + checking for EDGE_EH. + +2005-10-17 Eric Botcazou + + * config/sparc/sparc.c (function_arg_slotno): In 64-bit mode, align + the slot on an even boundary for any type with 16-byte alignment. + +2005-10-17 Hans-Peter Nilsson + + PR target/23424 + * md.texi (Modifiers) <%>: Clarify that % doesn't work + after register allocation. + +2005-10-17 DJ Delorie + + * config/m32c/m32c.c (m32c_pushm_popm): Don't mark epilogue insns + as frame related. + +2005-10-17 Nathan Sidwell + + PR c++/22551 + * c-common.c (c_add_case_label): Revert my 2005-10-14 clearing of + overflow flags. + +2005-10-17 Kaz Kojima + + * config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_schedule_insns + to 2 if it's already non-zero. + (OVERRIDE_OPTIONS): Clear flag_schedule_insns if flag_exceptions + is set and warn about it if flag_schedule_insns is 1. + +2005-10-17 Paul Woegerer + + * config/crx/crx.md: Compare-and-branch instructions need to + invalidate CC. + +2005-10-17 Uros Bizjak + + PR target/24315 + * config/i386/i386.md (*pushdi2_rex64 splitter) + (*movdi_1_rex64 splitter, *ashldi3_1 splitter) + (*ashrdi3_1 splitter, *lshrdi3_1 splitter): Delay splitting after + flow2 pass only when (optimize > 0 && flag_peephole2). + +2005-10-16 Andrew Pinski + + PR driver/22544 + * gcc.c (have_c): New static variable. + (have_o): Likewise. + (process_command): Remove declation of have_c. + Set have_o to 1 when handling -o. + (main): Add a fatel error if there are multiple + files specified and -o and -c/-S is passed witout + -combine or multiple languages. + +2005-10-16 Daniel Berlin + + Fix PR tree-optimization/22444 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): + Assert that we don't hit something with subvars. + (setup_pointers_and_addressables): Don't add things with subvars, + because we'll already process the subvars for aliasing purposes. + +2005-10-16 Hans-Peter Nilsson + + PR target/23424 + * config/cris/cris.md ("*mov_side", "*mov_sidesisf") + ("*mov_side_mem", "*mov_sidesisf_mem", "*clear_side") + ("*ext_sideqihi", "*ext_sidesi", "*op_side") + ("*op_swap_side", "*extopqihi_side", "*extopsi_side") + ("*extopqihi_swap_side", "*extopsi_swap_side"): Have separate, + swapped, alternatives for the R constraint. + + PR middle-end/24341 + * builtins.c (get_builtin_sync_mode): Make unlimited + mode_for_size request. + +2005-10-15 Richard Henderson + + * gimplify.c (gimplify_var_or_parm_decl): Split out from ... + (gimplify_expr): ... here. + (gimplify_compound_lval): Use it in initial scan loop. Allow + fb_lvalue in base expression. + +2005-10-15 Richard Henderson + + PR 23714 + * builtins.c (expand_builtin_trap): Export. + * expr.h (expand_builtin_trap): Declare. + * expr.c (expand_assignment): Emit a trap for integral offsets + from registers that weren't reduced to bitpos. + + * tree-cfg.c (mark_array_ref_addressable_1): Remove. + (mark_array_ref_addressable): Remove. + * tree-flow.h (mark_array_ref_addressable): Remove. + * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Don't call it. + +2005-10-15 James E Wilson + + PR target/24232 + * sched-deps.c (add_dependence_list): New arg UNCOND. Fix all callers. + (add_dependence_list_and_free): Likewise. + (sched_analyze_2, case MEM): Delete sched_insns_conditions_mutex_p + call. + +2005-10-15 Diego Novillo + + PR 23141 + PR 23142 + * tree-vrp.c (vrp_meet): Fix the intersection of equivalence + sets VR0->EQUIV and VR1->EQUIV when meeting a range and an + anti-range. + (vrp_visit_phi_node): Only prevent infinite iterations when + the previous result and the new result are both VR_RANGEs. + +2005-10-15 Ranjit Mathew + + * tree-into-ssa.c (mark_def_sites): Correct minor typo in + function comment. + +2005-10-14 Volker Reichelt + + PR c/23439 + * c-parser.c (c_parser_for_statement): Use location of RID_FOR + to initialize loc. + +2005-10-14 Per Bothner + + PR preprocessor/21250 + * c-ppoutput.c (print_line): Print internal line 0 as 1. + +2005-10-14 Nathan Sidwell + + PR c++/22551 + * c-common.c (c_add_case_label): Clear LOW_VALUE and HIGH_VALUE's + overflow flags. Refactor some conditionals. + +2005-10-13 Andrew Pinski + + PR tree-opt/21304 + * tree-dfa.c (add_referenced_var): Only look at decls which + have TREE_CONSTANT or TREE_READONLY set instead of if + !TREE_PUBLIC or !TREE_CONSTANT. + +2005-10-13 James E Wilson + + * doc/invoke.texi: For -x, add f95-cpp-input. + * doc/install.texi: For --enable-languages doc, change f95 to fortran. + +2005-10-12 Sebastian Pop + + PR tree-optimization/24262 + * tree-data-ref.c (analyze_offset_expr): Check that init is invariant + in loop all the time. + +2005-10-12 Richard Henderson + + PR c/24255 + * tree.h (DECL_TRANSPARENT_UNION): Remove. + * function.c (assign_parm_find_data_types): Don't support it. + * print-tree.c (print_node): Likewise. + * c-common.c (handle_transparent_union_attribute): Likewise. + Use build_duplicate_type. + * tree-inline.c (remap_type_1): Split out of remap_type; + properly remap aggregate fields. + (build_duplicate_type): New. + * doc/extend.texi (Variable Attributes): Remove documentation + for transparent_union. + +2005-10-12 Eric Botcazou + + PR target/24284 + * config/sparc/sparc.c (gen_stack_pointer_inc): Build by hand. + (gen_stack_pointer_dec): Likewise. + +2005-10-12 Danny Smith + + PR middle-end/21275 + PR middle-end/21766 + * target.h (struct gcc_target): Add valid_dllimport_attribute_p + target hook. + (struct cxx): Add adjust_class_at_definition target hook. + * target-def.h: (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): New define, + defaulting to hook_bool_tree_true. Add to TARGET_INITIALIZER + (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): New define, defaulting to + hook_void_tree. Add to TARGET_CXX. + * tree.h (struct decl_with_vis): Rename non_addr_const_p field to + dllimport_flag. + (DECL_NON_ADDR_CONSTANT_P): Replace with DECL_DLLIMPORT_P macro. + * tree.c (merge_dllimport_decl_attributes): Check DECL_DLLIMPORT_P + instead of attribute. Check for dllexport override. Warn if + inconsistent dll linkage. Don't lose old dllimport if decl has + had address referenced. Tweak lookup of dllimport atribute. + (handle_dll_attribute): Check targetm.valid_dllimport_attribute_p + for target specific rules. Don't add dllimport attribute if + DECL_DECLARED_INLINE_P. Set DECL_DLLIMPORT_P when adding + dllimport attribute. + (staticp): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P. + * varasm.c (initializer_constant_valid_p): Replace + DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P + + PR target/21801 + PR target/23589 + * config.gcc (i[34567]86-*-cygwin*): Add winnt-cxx.o to + 'cxx_target_objs', winnt-stubs,o to 'extra_objs'. + (i[34567]86-*-mingw32*): Likewise. + + * doc/tm.texi (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Document. + (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Document. + + * config/i386/winnt.c (i386_pe_dllimport_p): Factor out + C++-specific code. Change return value to bool. + (i386_pe_dllimport_p): Likewise. + (associated_type): Simplify and make language-independent + (i386_pe_encode_section_info): Replace override of ambiguous + dllimport symbol refs with a gcc_assert. + (i386_pe_valid_dllimport_attribute_p): Define. + * config/i386/winnt-cxx.c: New file. Define C++ versions of + i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, + i386_pe_adjust_class_at_definition. + * config/i386/winnt-stubs.c: New file. Define stub versions of + lang-specific functions. + * config/i386/i386-protos.h: Declare winnt-[cxx|stubs].c functions + i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, + i386_pe_adjust_class_at_definition. + (i386_pe_valid_dllimport_attribute_p): Declare. + * config/i386/cygming.h (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Define. + (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Define. + * config/i386/t-cygming: Add rules for winnt-cxx.o, winnt-stubs.o. + + PR target/19704 + * config/i386/i386.c (ix86_function_ok_for_sibcall): Replace test for + dllimport attribute with test of DECL_DLLIMPORT_P. + +2005-10-12 Adrian Straetling + + * combine.c (make_extraction): Correct offset computation. + +2005-10-12 Hans-Peter Nilsson + + * config/cris/t-linux (LIMITS_H_TEST): Define. + +2005-10-12 Richard Henderson + + PR rtl-opt/23324 + * cfgexpand.c (add_alias_set_conflicts): Use objects_must_conflict_p. + +2005-10-12 Richard Guenther + + * Makefile.in (CGRAPH_H): Depend on $(TREE_H). + +2005-10-12 Nathan Sidwell + + PR c++/19964 + * stor-layout.c (place_field): Set DECL_FIELD_OFFSET and + DECL_FIELD_BIT_OFFSET of FIELD_DECLs, even if they have an invalid + type. + +2005-10-12 Richard Guenther + + PR c++/23799 + * varasm.c (output_constant): Correct typo from previous + patch by DJ. + +2005-10-11 Ian Lance Taylor + + PR rtl-optimization/13931 + * combine.c: Revert patch of 2003-05-14, and: + (try_combine): Only set elim_i1 and elim_i2 if the destination is + completely killed in the appropriate insn. + (distribute_notes): Don't skip multiple hard register test for + elim_i1 and elim_i2. + +2005-10-11 Richard Henderson + + PR c/24255 + * c-typeck.c (convert_for_assignment): Use build_constructor_single + to initialize a transparent union instead of a nop_expr. + +2005-10-11 Richard Henderson + + * Makefile.in (tree-ssa-dce.o): Depend on SCEV_H. + * tree-ssa-dce.c: Include tree-scalar-evolution.h. + (tree_ssa_dce_loop): Call scev_reset. + + PR tree-opt/24300 + * Makefile.in (tree-ssa-dce.o): Depend on CFGLOOP_H. + * tree-ssa-dce.c: Include cfgloop.h. + (tree_ssa_dce_loop, pass_dce_loop): New. + * tree-pass.h (pass_dce_loop): Declare it. + * passes.c (init_optimization_passes): Use it. + +2005-10-11 Eric Botcazou + + PR middle-end/24263 + * convert.c (convert_to_real): Revert 2005-10-05 patch. + Only apply the optimization for rounding builtins if the inner + cast is also an extension. + +2005-10-11 Andrew Pinski + + PR tree-opt/23946 + * tree-ssa-ccp.c (execute_fold_all_builtins): Call + mark_new_vars_to_rename instead of update_stmt. + +2005-10-11 Bernd Schmidt + + * config/bfin/crti.s (__init, __fini): Renamed from _init, _fini. + +2005-10-11 Jakub Jelinek + + * config/i386/i386.md (movsi_1, movdi_1_rex64): Use mmxadd type + for setting MMX register to 0 rather than mmx. + +2005-10-10 Mark Mitchell + + * toplev.c (check_global_declaration_1): Robustify. + +2005-10-10 Steve Ellcey + + PR target/12098 + * configure.ac: Move gas check from mips specific case to common case. + Do check for GNU as for mips*-*-* and *-*-hpux* targets. + * configure: Regenerate + * doc/install.texi: Update. + +2005-10-10 Eric Botcazou + + PR target/24284 + * config/sparc/sparc.c (sparc_expand_prologue): Remove bogus PATTERN. + +2005-10-10 Maciej W. Rozycki + + * gcc.c (do_spec_1): Accept numeric characters in file name + suffixes. + +2005-10-10 Nick Clifton + + * config/arm/arm.c: Remove extraneous whitespace. Remove comment + describing the deleted arm_gen_rotated_half_load function. + +2005-10-09 Kaz Kojima + + * config/sh/sh.c (emit_fpu_switch): Set TREE_PUBLIC for + __fpscr_values. + +2005-10-09 Daniel Jacobowitz + + * config.gcc (arm*-*-linux*): Remove redundant extra_parts and + gnu_ld assignments. + * config/arm/t-linux-eabi (LIB1ASMFUNCS) + (EXTRA_MULTILIB_PARTS): Define. + * config/arm/linux-elf.h (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC) + (STARTFILE_SPEC, ENDFILE_SPEC, CC1_SPEC) + (LINK_GCC_C_SEQUENCE_SPEC, USE_LD_AS_NEEDED): Move to... + * config/arm/uclinux-elf.h (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC) + (STARTFILE_SPEC, ENDFILE_SPEC, CC1_SPEC) + (LINK_GCC_C_SEQUENCE_SPEC, USE_LD_AS_NEEDED): ... here. + +2005-10-09 Zdenek Dvorak + + PR tree-optimization/24226 + * tree-cfg.c (remove_bb): Clean up unreachable loops. + * tree-flow.h (free_numbers_of_iterations_estimates_loop): Declare. + * tree-ssa-loop-niter.c (free_numbers_of_iterations_estimates_loop): + Export. + +2005-10-09 Eric Botcazou + + * config/sparc/gmon-sol2.c (internal_mcount): Mark as used. + +2005-10-08 Andrew Pinski + + PR target/24136 + * config/rs6000/darwin.md (movdf_low_si): Remove early clobber. + Rewrite for no need for the early clobber. + +2005-10-08 Kazu Hirata + + Merge from csl-arm-branch: + 2005-09-07 Paul Brook + * config/arm/linux-eabi.h (SUBTARGET_EXTRA_LINK_SPEC): Prepend a + space to string. + + 2005-04-30 Paul Brook + * config/arm/bpabi.h (TARGET_DEFAULT): Define. + * config/arm/linux-eabi.h (SUBTARGET_CPU_DEFAULT): Define. + + 2005-03-07 Daniel Jacobowitz + * config/arm/arm.c (arm_all_abis): Add aapcs-linux. + (arm_override_options): Use TARGET_AAPCS_BASED. + * config/arm/arm.h (enum arm_abi_type): Add ARM_ABI_AAPCS_LINUX. + (PTRDIFF_TYPE): Use int for AAPCS. + (DEFAULT_SHORT_ENUMS): Use false for aapcs-linux. + * config/arm/linux-eabi.h (ARM_DEFAULT_ABI, WCHAR_TYPE): Define. + (DEFAULT_SHORT_ENUMS): Delete. + * doc/invoke.texi (ARM Options): Document -mabi=aapcs-linux. + + 2004-12-15 Daniel Jacobowitz + * config/arm/arm.h (DEFAULT_SHORT_ENUMS): Wrap in #ifndef. + * config/arm/linux-eabi.h (DEFAULT_SHORT_ENUMS): Define to 0. + * config/arm/t-linux-eabi (TARGET_LIBGCC2_CFLAGS): Set to -fPIC. + + 2004-12-03 Mark Mitchell + * config/arm/linux-eabi.h (LIBGCC_SPEC): Do not define. + + 2004-11-22 Mark Mitchell + * config.gcc (arm*-*-linux-gnueabi): Use __cxa_atexit. + + 2004-11-19 Mark Mitchell + * config.gcc (arm*-*-linux-gnueabi): Add it. + * config/arm/bpabi.h (FPUTYPE_DEFAULT): Undefine it before + redefining it. + (TARGET_OS_CPP_BUILTINS): Likeiwse. + * config/arm/linux-eabi.h: New file. + * config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): New macro. + (LINUX_TARET_LINK_SPEC): Likewise. + (LINK_SPEC): Use it. + * config/arm/t-linux-eabi: New file. + +2005-10-08 Steven Bosscher + + PR other/22202 + * params.def (PARAM_MAX_VARIABLE_EXPANSIONS): Remove superfluous + spaces. + (PARAM_SMS_DFA_HISTORY): Likewise. + +2005-10-08 Kazu Hirata + + PR middle-end/23150 + * calls.c (mem_overlaps_already_clobbered_arg_p): New. + (load_register_parameters): Call it. + (check_sibcall_argument_overlap_1): Likewise. + (store_one_arg): Likewise. + +2005-10-07 James E. Wilson + + * config/ia64/vect.md (ashl3, ashr3, lshr3): Use + DImode not VECINT24 for operand 2. + + PR target/23644 + * doc/invoke.texi (IA-64 Options, item -mtune): Renamed from + -mtune-arch. + + PR target/24193 + * config/ia64/ia64.md (movbi, movti_internal, gr_spill_internal, + fr_spill): Use destination_operand for operand 0. + +2005-10-07 DJ Delorie + + * varasm.c (output_constant): Limit error to expanding + conversions. + +2005-10-07 Richard Guenther + + PR middle-end/24227 + * fold-const.c (fold_binary): Fix operand types during folding + of X op (A, Y). Evaluation order of the side-effects of + X and A are frontend-defined, so ensure we honour that even for + tcc_comparison class operands; eased by removing duplicate code. + +2005-10-07 Steve Ellcey + + * stor-layout.c (layout_type): Do not allow alignment of array + elements to be greater than their size. + +2005-10-07 Steve Ellcey + + * config.host (hppa*-*-hpux*): Change out_host_hook_obj and + host_xmake_file. + (hppa*-*-linux*): Ditto. + (ia64-*-hpux*): Add out_host_hook_obj and host_xmake_file. + * config/host-hpux.c: New. + * config/x-hpux: New. + * config/pa/x-hpux: Remove. + * config/pa/x-linux: Remove. + * config/pa/pa-host.c: Remove. + +2005-10-07 Jeff Law + + * tree-ssa-dom.c (dom_opt_finalize_block): Fix conditions to + determine whether or not to try and thread outgoing edges. + +2005-10-07 David Edelsohn + + * config/rs6000/rs6000.md (eqsi_power): New. + (neg_eq0si): Add TARGET_POWER to final condition. + (neg_eqsi): Same. + +2005-10-06 Richard Henderson + + * config/rs6000/rs6000.c: Revert last change. + +2005-10-06 Richard Henderson + + * config/rs6000/rs6000.c (rs6000_cannot_force_const_mem): New. + (TARGET_CANNOT_FORCE_CONST_MEM): Use it. + +2005-10-06 Andrew Pinski + + PR middle-end/22216 + PR middle-end/23651 + * cfgexpand.c (tree_expand_cfg): After expanding the functions, clear + out return_label and naked_return_label. + +2005-10-06 Daniel Berlin + + * tree-ssa-structalias.c (check_for_overlaps): Fix bug in last + change. + +2005-10-06 Richard Henderson + + PR tree-opt/22237 + * tree-inline.c (declare_return_variable): Handle modify_dest not + being a DECL. + +2005-10-06 Daniel Berlin + + Fix PR tree-optimization/22488 + * tree-ssa-structalias.c (check_for_overlaps): New function. + (create_variable_info_for): Use it. + +2005-10-06 Richard Henderson + + PR debug/24070 + * dwarf2out.c (lookup_filename): Return the result of maybe_emit_file. + (dwarf2out_start_source_file): Print it. + +2005-10-06 Geoffrey Keating + + * config/t-slibgcc-darwin (SHLIB_MAPFILES): Use '+='. + +2005-10-06 Richard Henderson + + PR 23706 + * mode-switching.c (optimize_mode_switching): Clear transp bit + for block with incomming abnormal edges. + + * config/sh/sh.c (fpscr_values, emit_fpu_switch): New. + (fpscr_set_from_mem): Use them. + * config/sh/sh.md (fpu_switch0, fpu_switch1): Remove. + (fpscr postinc splitters): Rewrite as peephole2+split. + +2005-10-06 David Edelsohn + + * config/rs6000/rs6000.md (eq): Add !TARGET_POWER. + (eq_compare): Same. + +2005-10-06 Richard Guenther + + PR tree-optimization/24238 + * tree-ssa-alias.c (find_used_portions): Handle RESULT_DECL. + +2005-10-06 Daniel Jacobowitz + + * acinclude.m4 (gcc_AC_CHECK_TOOL): Handle environment variables + here. Use AC_PATH_PROG for environment variables instead of + test -x. + * configure.ac: Update calls to gcc_AC_CHECK_TOOL. Use it for + objdump also. + * configure: Regenerated. + +2005-10-06 Richard Earnshaw + + PR target/23783 + * arm.md (call): If the address isn't a SYMBOL_REF or a register, + then force it into a register. + (call_value): Likewise. + +2005-10-06 Richard Henderson + + PR 24049 + * passes.c (init_optimization_passes): Move pass_lower_vector_ssa + under pass_vectorize. Clear TODO_ggc_collect from the dce pass + under pass_vectorize. + +2005-10-05 Devang Patel + + PR Debug/23205 + * dbxout.c (dbxout_symbol): Check DECL_RTL_SET_P, after + handling constants. Check NAMESPACE_DECL context for constants. + +2005-10-05 Eric Christopher + + * doc/md.texi (Standard Names): Fix name of pushm1 pattern. + +2005-10-05 Richard Henderson + + PR 23714 + * tree-cfg.c (mark_array_ref_addressable_1): New. + (mark_array_ref_addressable): New. + * tree-flow.h (mark_array_ref_addressable): Declare. + * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Use it. + +2005-10-05 Andrew Pinski + + PR middle-end/20606 + PR middle-end/24069 + * reload.c (subst_reloads): When adding a REG_LABEL to a + jump instruction, also update JUMP_LABEL. + +2005-10-05 David Edelsohn + + * params.def (PARAM_MAX_GROW_COPY_BB_INSNS): New. + * bb-reorder.c (copy_bb_p): Use it. + * doc/invoke.texi (param table): Add max-grow-copy-bb-insn. + +2005-10-05 Richard Henderson + + PR target/23602 + * toplev.c (process_options): Warn about unsupported combinations + of unwind tables and omit-frame-pointer. + * config/i386/i386.c (override_options): Similarly. Enable + accumulate-outgoing-args if not explicitly disabled. + +2005-10-05 Steve Ellcey + + * vect.md (vec_initv2si): Fix typo of V2SF to V2SI. + Handle big endian vs. small endian. + (vec_initv2sf): Handle big endian vs. small endian. + (*vec_extractv2sf_1): Ditto. + +2005-10-05 Dale Johannesen + + * convert.c (convert_to_real): Don't convert + (float)floor(double d) to floorf((float)d). + +2005-10-05 Daniel Jacobowitz + + * config/arm/arm.md (insv): Use gen_int_mode in more places. + +2005-10-05 Andrew MacLeod + + PR tree-optimization/18587 + * tree-ssa-operands.c (struct opbuild_list_d, OPBUILD_LAST): Delete. + (build_defs, build_uses, build_v_may_defs, build_v_must_defs, + build_vuses): Change to VEC type. + (opbuild_initialize_virtual, opbuild_initialize_real, opbuild_free, + opbuild_num_elems, opbuild_append_real, opbuild_append_virtual, + opbuild_first, opbuild_next, opbuild_elem_real, opbuild_elem_virtual, + opbuild_elem_uid, opbuild_clear, opbuild_remove_elem): Delete. + (get_name_decl): New. Return DECL_UID of base variable. + (operand_build_cmp): New. qsort comparison routine. + (operand_build_sort_virtual): New. Sort virtual build vector. + (init_ssa_operands, fini_ssa_operands): Use VEC routines. + (FINALIZE_OPBUILD_BASE, FINALIZE_OPBUILD_ELEM): Use VEC_Index. + (FINALIZE_BASE): Use get_name_decl. + (finalize_ssa_defs, finalize_ssa_uses, cleanup_v_may_defs, + finalize_ssa_v_may_defs, finalize_ssa_vuses, finalize_ssa_v_must_defs, + (start_ssa_stmt_operands, append_def, append_use, append_vuse, + append_v_may_def, append_v_must_def): Replace opbuild_* routines with + direct VEC_* manipulations. + (build_ssa_operands): Call operand_build_sort_virtual. + (copy_virtual_operand, create_ssa_artficial_load_stmt, + add_call_clobber_ops, add_call_read_ops): Replace opbuild_* routines + with direct VEC_* manipulations. + * tree-ssa-opfinalize.h (FINALIZE_FUNC): Replace opbuild_* routines + with direct VEC manipulations. + +2005-10-05 Paolo Bonzini + + PR tree-optimization/21419 + PR tree-optimization/24146 + PR tree-optimization/24151 + + * c-typeck.c (readonly_error): Handle USE being lv_asm. + (build_asm_expr): Call it if outputs are read-only. + * gimplify.c (gimplify_asm_expr): Remove former fix to PR 21419. + +2005-10-05 Billy Biggs + Paolo Bonzini + + PR target/23809 + + * doc/extend.texi (x86 Built-ins): Document that -msse and friends + enable the instructions and not just the built-ins. + * doc/invoke.texi (x86 Options): Likewise. + +2005-10-04 Geoffrey Keating + + * config/i386/t-darwin (SHLIB_VERPFX): Fix typo. + + * doc/invoke.texi (Option Summary): Correct spelling + of -mmacosx-version-min. + +2005-10-04 Devang Patel + + * c-common.c (vector_types_convertible_p): Check TYPE_PRECISION for + real types. + +2005-10-04 Steve Ellcey + + * tree-vect-transform.c (vect_create_epilog_for_reduction): + Use BYTES_BIG_ENDIAN instead of BITS_BIG_ENDIAN. + +2005-10-04 Adrian Straetling + + * config/s390/s390.md ("TDSI","DP"): New mode macros. + ("TE","tg"): New mode attributes. + ("sync_compare_and_swap"): Replace with a define_expand. + ("sync_compare_and_swap_cc"): Replace GPR with TDSI. + ("*sync_compare_and_swap_cc"): Replace with one pattern for + dword_mode and one for GPRmode. + +2005-10-04 Ian Lance Taylor + + PR preprocessor/13726 + * c-ppoutput.c (cb_include): Add comments parameter, and print out + any comments passed in. + +2005-10-04 Andrew Pinski + + * tree.c (annotate_with_file_line): Fix typo. + +2005-10-04 Ulrich Weigand + + PR ada/19382 + * builtins.c (fold_builtin_memcmp): When constructing the pointer + type used to access data in the inlined length == 1 case, use + build_pointer_type_for_mode with CAN_ALIAS_ALL set to true. + (fold_builtin_strcmp, fold_builtin_strncmp): Likewise. + +2005-10-04 Uros Bizjak + + * config/i386/i386.h (TARGET_FISTTP): Enable also for + TARGET_SSE3 and only for TARGET_80387. + * config/i386/i386.md (fix_trunc_fisttp_i387_1, + (fix_trunc_i387_fisttp, fix_trunc_i387_fisttp_with_temp): + Do not depend on TARGET_80387. + +2005-10-04 Andrew Pinski + + * tree.c (last_annotated_node): Change type to location_t*. + (annotate_with_file_line): Reflect the change of + last_annotated_node type. + +2005-10-04 Richard Guenther + + PR c/23576 + * c-decl.c (grokdeclarator): Don't write to fields + of error_mark_node. + +2005-10-04 Andrew Pinski + + PR middle-end/23125 + * c-decl.c (finish_decl): Use set_user_assembler_name even for + register variables. + * varasm.c (make_decl_rtl): If a register variable does not + have a set user assmbler name, error out. + Decode the asmspec is now name+1 bypassing '*'. + +2005-10-04 Steven Bosscher + + PR tree-optimization/23049 + * tree-ssa-dom.c (thread_across_edge): Make sure that the condition + of a COND_EXPR is folded before calling fold on the whole rhs of a + conditional assignment. + * doc/tree-ssa.texi: Update the GIMPLE grammar for a valid rhs to + document that a COND_EXPR may appear there. + +2005-10-03 Diego Novillo + + PR 23445 + * tree-vrp.c (extract_range_from_assert): If the new numeric + range created out of the assertion contradicts the existing + numeric range of the ASSERT_EXPR variable, make the new range + varying. + +2005-10-03 Kaz Kojima + + * config/sh/sh.c (sh_register_move_cost): Add case for moving + from T_REGS to FP register class. + +2005-10-03 Richard Henderson + + PR 24135 + * tree-nested.c (convert_nl_goto_reference): Lookup a translation + before creating a new one. + +2005-10-03 David Edelsohn + + * config/rs6000/t-aix43 (LDFLAGS): New. + * config/rs6000/t-aix52 (LDFLAGS): New. + +2005-10-03 Ian Lance Taylor + + * gimplify.c (find_single_pointer_decl_1): New static function. + (find_single_pointer_decl): New static function. + (internal_get_tmp_var): For a formal variable, set restrict base + information if appropriate. + * alias.c (find_base_decl): If a VAR_DECL has a restrict base, + return it. + * tree.h (DECL_BASED_ON_RESTRICT_P): Define. + (DECL_GET_RESTRICT_BASE): Define. + (SET_DECL_RESTRICT_BASE): Define. + (decl_restrict_base_lookup): Declare. + (decl_restrict_base_insert): Declare. + (struct tree_decl_with_vis): Add based_on_restrict_p field. + * tree.c (restrict_base_for_decl): New static variable. + (init_ttree): Initialize restrict_base_for_decl. + (copy_node_stat): Copy restrict base information. + (decl_restrict_base_lookup): New function. + (decl_restrict_base_insert): New function. + (print_restrict_base_statistics): New static function. + (dump_tree_statistics): Call print_restrict_base_statistics. + +2005-10-02 Diego Novillo + + PR 24142 + * tree-vrp.c (vrp_meet): Fix call to range_includes_zero_p in + case of anti-ranges. + +2005-10-02 Andrew Pinski + + PR c/18851 + * c-typeck.c (tagged_tu_seen): Rename to ... + (tagged_tu_seen_cache): this and add val field. + (comptypes): Move functional to comptypes_internal + and free tagged_tu_seen. + (comptypes_internal): New function and call comptypes_internal + instead of comptypes. Speed up by sibcalling + tagged_types_tu_compatible_p. + (alloc_tagged_tu_seen): New function + (free_all_tagged_tu_seen_up_to): New function. + (tagged_types_tu_compatible_p): Return the val of the seen two + types. + Add that the two types are the same to tagged_tu_seen_base + if they are and call comptypes_internal instead of comptypes. + : Speed up common type where the fields are + in the same order. + (function_types_compatible_p): Call comptypes_internal instead of + comptypes. + (type_lists_compatible_p): Likewise. + (all functions): s/tagged_tu_seen/tagged_tu_seen_cache/. + +2005-10-02 Matthias Klose + + * doc/invoke.texi: Fix typo and speling error. + +2005-10-01 Richard Henderson + + * tree-stdarg.c (execute_optimize_stdarg): Process PHI nodes too. + +2005-10-01 Mark Mitchell + + * config/arm/unknown-elf.h (LINK_GCC_C_SEQUENCE_SPEC): Define + using --start-group and --end-group. + +2005-10-01 Diego Novillo + + * tree-vrp.c (value_inside_range, range_includes_zero_p): Add + FIXME note regarding quirky semantics. + +2005-10-01 Diego Novillo + + PR 24141 + * tree-vrp.c (vrp_meet): Clear VR0->EQUIV when building a + non-null range as a last resort. + +2005-10-01 James A. Morrison + Diego Novillo + + PR 23604 + * tree-vrp.c (extract_range_from_assert): For != + assertions, only build an anti-range if LIMIT is a + single-valued range. + +2005-09-30 Richard Earnshaw + + * arm.md (movqi): On thumb when optimizing, handle loading from + memory by describing this as taking a subreg of a zero-extended load + into an SImode register. + (movhi): Likewise. + +2005-09-30 Daniel Jacobowitz + + * reload1.c (merge_assigned_reloads): Do not change any + RELOAD_FOR_OUTPUT_ADDRESS reloads. + +2005-09-30 Geoffrey Keating + + * Makefile.in (LIPO_FOR_TARGET): Define. + (STRIP_FOR_TARGET): Define. + + * config/t-slibgcc-darwin (libgcc_s_%.dylib): Remove old symlinks + before creating new ones. Do symlinks before creating the actual + targets. + + * config/t-slibgcc-darwin (libgcc_s_%.dylib): Use --print-multi-lib + to work out which multilibs are actually being built. + +2005-09-30 Kazu Hirata + + * tree-vect-transform.c, config/ms1/ms1.md, + config/s390/s390.c, config/v850/v850.md: Fix comment typos. + Follow spelling conventions. + * doc/invoke.texi, doc/md.texi: Fix typos. + +2005-09-30 Andrew Macleod + + PR tree-optimization/21430 + * tree-ssa-operands.c (set_virtual_use_link): New. Link new virtual + use operands, and set stmt pointer if need be. + (FINALIZE_CORRECT_USE: New. Macro to call appropriate use fixup routine. + tree-ssa-opfinalize.h (FINALIZE_FUNC): Call FINALIZE_CORRECT_USE if + present. + +2005-09-29 Richard Kenner + + PR middle-end/24053 + * stor-layout.c (set_sizetype): Set TYPE_MAIN_VARIANT of bitsizetype. + +2005-09-29 Mark Mitchell + + * optabs.c (expand_binop): Initialize first_pass_p. + +2005-09-29 Jakub Jelinek + + PR middle-end/24109 + * c-decl.c (c_write_global_declarations_1): If any + wrapup_global_declaration_2 call returned true, restart the loop. + +2005-09-29 Daniel Berlin + + Fix PR tree-optimization/24117 + * tree-ssa-structalias.c (find_func_aliases): Strip nops + before considering whether to use anyoffset. + +2005-09-29 Paolo Bonzini + + Revert this patch: + + 2005-09-15 Paolo Bonzini + + * optabs.c (expand_binop): Use swap_commutative_operands_with_target + to order operands. + (swap_commutative_operands_with_target): New. + +2005-09-29 Paolo Bonzini + + PR c/21419 + * gimplify.c (gimplify_asm_expr): Raise an error if an output is + read-only. + +2005-09-29 Steven Bosscher + + PR tree-optimization/23911 + * tree-ssa-ccp.c (fold_const_aggregate_ref): Handle REALPART_EXPR + and IMAGPART_EXPR too. + +2005-09-28 Mark Mitchell + + PR 17886 + * expmed.c (expand_shift): Move logic to reverse rotation + direction when rotating by constants ... + * optabs.c (expand_binop): ... here. + * config/i386/i386.md (rotrdi3): Handle 32-bit mode. + (ix86_rotrdi3): New pattern. + (rotldi3): Handle 32-bit mode. + (ix86_rotldi3): New pattern. + +2005-09-29 Alan Modra + + PR target/24102 + * config/rs6000/rs6000.md (floatdisf2_internal2): Correct range + check for numbers that need no bit twiddle. + +2005-09-28 Geoffrey Keating + + * config/rs6000/t-darwin8: Uncomment contents, allow -m64 + multilib to be built. + + * Makefile.in: Export LIPO_FOR_TARGET, STRIP_FOR_TARGET. + (stage1-start): Delete old libgcc and libunwind before moving + anything into the stage directory. + (stage2-start): Likewise. + (stage3-start): Likewise. + (stage4-start): Likewise. + (stageprofile-start): Likewise. + (stagefeedback-start): Likewise. + * config.gcc (*-*-darwin*): Automatically use CPU-specific darwin.h + header in tm_file and CPU-specific t-darwin in tmake_file. + (i[34567]86-*-darwin*): Don't change tm_file. + (powerpc-*-darwin*): Don't change tm_file or tmake_file. + * config/darwin.h (REAL_LIBGCC_SPEC): Rewrite to use proper libgcc + shared library stub for target OS version. + * config/t-slibgcc-darwin (SHLIB_SOLINK): Delete. + (SHLIB_LINK): Don't make SHLIB_SOLINK. + (SHLIB_INSTALL): Don't install SHLIB_SOLINK. + (libgcc_s.%.dylib): New. + (LIBGCC): Define. + (install-darwin-libgcc-stubs): New. + (INSTALL_LIBGCC): New append. + * config/i386/darwin-libgcc.10.4.ver: New. + * config/i386/darwin-libgcc.10.5.ver: New. + * config/i386/t-darwin: New. + * config/rs6000/darwin-libgcc.10.4.ver: New. + * config/rs6000/darwin-libgcc.10.5.ver: New. + * config/rs6000/darwin.h (REAL_LIBGCC_SPEC): Delete. + * config/rs6000/t-darwin (SHLIB_VERPFX): Define. + +2005-09-28 Paul Brook + + * config/m68k/fpgnulib.c (__extendsfdf2, __truncdfsf2): Handle + denormals. + +2005-09-28 Richard Guenther + + PR tree-optimization/23853 + * tree-vect-analyze.c (vect_compute_data_ref_alignment): Use + host_integerp to verify misalignment value. + +2005-09-28 Richard Henderson + + * builtins.c (get_builtin_sync_mode): New. + (expand_builtin_sync_operation): Pass in mode argument. + (expand_builtin_compare_and_swap): Likewise. + (expand_builtin_lock_test_and_set): Likewise. + (expand_builtin_lock_release): Likewise. + (expand_builtin): Update to match. + +2005-09-28 Nick Clifton + + * config/v850/v850.h (GO_IF_LEGITIMATE_ADDRESS): Tidy up + formatting. Add check to PLUS case to ensure that the offset is + within an acceptable range. + + * config/v850/v850.md (casesi): Disable the generation of the + switch pattern as it is not being handled properly at the moment. + + * config/v850/lib1funcs.asm (___ucmpdi2): Correct jump instruction + for when the high words are identical. + +2005-09-27 Richard Henderson + + * pretty-print.c (pp_base_format): Fix typo for %>. + +2005-09-27 Daniel Berlin + Devang Patel + + PR tree-optimization/23625 + * tree-flow-inline.h (bsi_after_labels): Remove, first statement is + LABEL_EXPR, assertion check. + +2005-09-27 J"orn Rennecke + + * optabs.c (no_conflict_move_test): Check if a result of a + to-be-moved insn would be clobbered by an originally + preceding insn. + +2005-09-27 Jeff Law + + * passes.c (init_optimization_passes): Replace copy propagation + passes immediately after DOM with phi-only copy propagation + pases. Add phi-only copy propagation pass after first DOM pass. + * tree-pass.h (pass_phi_only_copy_prop): Declare. + * tree-ssa-copy.c (init_copy_prop): Accept new PHI_ONLY argument. + If true, then mark all non-control statements with DONT_SIMULATE_AGAIN. + (execute_copy_prop): Accept new PHI_ONLY argument. Pass it along + to init_copy_prop. Callers updated. + (do_phi_only_copy_prop): New function. + (pass_phi_only_copy_prop): New pass descriptor. + +2005-09-27 Nick Clifton + + * libgcc2.c (__popcount_tab): Remove redundant prototype. + +2005-09-26 Jason Merrill + + PR c++/13764 + * c-common.c (finish_fname_decls): Use append_to_statement_list_force. + + * doc/invoke.texi: Clarify documentation of -fno-enforce-eh-specs. + +2005-09-26 James E Wilson + + * config/ia64/crtbegin.asm, config/ia64/crtend.asm: Remove glibc + copyright. Add gcc copyright plus libgcc exception. + * config/ia64/crtfastmath.asm: Remove glibc copyright. Add gcc + copyright. + * config/ia64/lib1funcs.asm: Add gcc copyright plus libgcc exception. + +2005-09-26 Jeff Law + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Be more selective + about when to iterate. + +2005-09-23 Fariborz Jahanian + + PR target/23847 + * config/rs6000/rs6000.c (rs6000_function_value): Parallel pattern + for __complex__ double in -mcpu=G5 mode. + +2005-09-26 Sebastian Pop + + PR tree-optimization/23942 + * Makefile.in (SCEV_H): Depends on PARAMS_H. + * tree-scalar-evolution.c: Include params.h. + (t_bool): New enum. + (follow_ssa_edge, follow_ssa_edge_in_rhs, + follow_ssa_edge_in_condition_phi_branch, + follow_ssa_edge_in_condition_phi, follow_ssa_edge_inner_loop_phi): + Change return type to t_bool. Use a parameter to limit the size of + trees that are walked before stopping + (analyze_evolution_in_loop): Initialize the limit to 0. + (follow_ssa_edge): Give up by returning t_dont_know if the limit + exceeds PARAM_SCEV_MAX_EXPR_SIZE. + +2005-09-26 Uros Bizjak + + PR middle-end/23831 + * simplify-rtx.c (simplify_immed_subreg) [MODE_INT]: Skip + simplification if elem_bitsize > 2 * HOST_BITS_PER_WIDE_INT. + +2005-09-26 Fariborz Jahanian + + * combine.c (make_extraction): Check for valid use of subreg. + +2005-09-26 Uros Bizjak + + PR target/24055 + * config/i386/i386.md ("*fistdi2_1"): New pattern. + ("*fist2_1"): Use only HImode and SImode register operands. + ("fist2_with_temp"): Use only register operands. + +2005-09-26 J"orn Rennecke + + * rtlanal.c (reg_used_between_p): Don't check for CLOBBERs in + CALL_INSN_FUNCTION_USAGE. + +2005-09-26 Richard Guenther + + PR middle-end/15855 + * gcse.c: Include hashtab.h, define ldst entry hashtable. + (pre_ldst_expr_hash, pre_ldst_expr_eq): New functions. + (ldst_entry): Use the hashtable instead of list-walking. + (find_rtx_in_ldst): Likewise. + (free_ldst_entry): Free the hashtable. + (compute_ld_motion_mems): Create the hashtable. + (trim_ld_motion_mems): Remove entry from hashtable if + removing it from list. + (compute_store_table): Likewise^2. + (store_motion): Free hashtable in case we did not see + any stores. + +2005-09-25 Kazu Hirata + + * fold-const.c (fold_binary): Use op0 and op1 instead of arg0 + and arg1 if we are passing them to fold_build2. + +2005-09-25 Dan Nicolaescu + + PR 23828 + * config/i386/i386.c (ix86_function_regparm): Fix the test for + a nested function. + +2005-09-25 Richard Henderson + + * config/alpha/alpha.c (tls_symbolic_operand_1): Trust + SYMBOL_REF_TLS_MODEL to be correct. + +2005-09-24 Richard Henderson + + * ipa-type-escape.c (discover_unique_type): Remove dead code at + end of function. Reindent. + +2005-09-24 Ian Lance Taylor + + * convert.c (convert_to_integer): Don't test for ENUMERAL_TYPE in + NEGATE_EXPR/BIT_NOT_EXPR case. + +2005-09-24 Richard Henderson + + * c-common.c (handle_mode_attribute): When not modifying in place, + create subtypes for enumerations. + (sync_resolve_return): Use TYPE_MAIN_VARIANT. + * gimplify.c (create_tmp_from_val): Likewise. + +2005-09-24 Alexandre Oliva + + * config/i386/i386.md (*tls_global_dynamic_64, + *tls_local_dynamic_base_64): Add missing mode to call. + (tls_global_dynamic_64, tls_local_dynamic_base_64): Likewise. + +2005-09-24 Jan Hubicka + + * cgraph.c (cgraph_clone_edge): Make the scale gcov_type. + (cgraph_clone_node): Likewise. + * cgraph.h (cgraph_clone_edge): Update prototype. + (cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Remove + duplicated prototypes; add updating argument. + * cgraphunit.c (verify_cgraph_node): Verify that counts are non-negative. + * ipa-inline.c (cgraph_clone_inlined_nodes): Allow clonning without + updating profile. + (cgraph_mark_inline_edge): Likewise. + (cgraph_mark_inline): Update use of cgraph_mark_inline_edge. + (cgraph_flatten_node): Likewise. + (cgraph_decide_recursive_inlining): Likewise. + (cgraph_decide_inlining_of_small_function): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + +2005-09-23 David Edelsohn + Pete Steinmetz + + * config/rs6000/rs6000.md (neg-minus-mult): Set type to dmul. + (rldic.): Set type to "compare". + (rldicr.): Same. + (movsf_hardfloat): Set type to mtjmpr for MTCTR/MTLR. Set type to + mfjmpr for MFCTR/MFLR. + (movdf_hardfloat64): Same. + (movdf_softfloat64): Same. Correct order of store and move types. + (movti_string): Set type to store_ux/load_ux. + (load_multiple): Set type to load_ux. + (store_multiple): Set type to store_ux. + (movmemsi): Set type to store_ux. + (output_cbranch direct_return): Set type to jmpreg. + (stmw): Set type to store_ux. + (lmw): Set type to load_ux. + * config/rs6000/40x.md (ppc403-store): Increase latency to 2. + * config/rs6000/440.md (ppc440-store): Increase latency to 6. + * config/rs6000/603.md (ppc603-store): Occupy LSU for 2 cycles. + * config/rs6000/6xx.md (ppc604-store): Increase latency to 3. + * config/rs6000/mpc.md (mpccore-store): Increase latency to 2. + * config/rs6000/rios1.md (rios1-store): Increase latency to 2. + (rios1-fpstore): Increase latency to 3. + * config/rs6000/rios2.md (rios2-store): Increase latency to 2. + * config/rs6000/rs64.md (rs64a-store): Increase latency to 2. + +2005-09-23 David Edelsohn + Andrew Pinski + + * config/rs6000/sync.md (sync_si_internal): Change + operand2 constraint to "b". + (sync_di_internal): Same. + (sync_old_si_internal): Change operand3 constraint + to "b". + (sync_old_di_internal): Same. + (sync_new_si_internal): Same. + (sync_new_di_internal): Same. + +2005-09-23 J"orn Rennecke + + PR middle-end/23991 + * final.c (insn_default_length, insn_min_length): In !HAVE_ATTR_length + case, define as macros. + + PR rtl-optimization/23837 + * optabs.c (no_conflict_move_test): Don't set must_stay for a + clobber / clobber match between dest and p->first. + + * optabs.c (emit_libcall_block): Use no_conflict_move_test. + (no_conflict_move_test): Update comments. + +2005-09-22 Ranjit Mathew + + * doc/install.texi: Update URL for Jacks. + * doc/sourcebuild.texi: Likewise. + +2005-09-22 David Edelsohn + + PR target/24007 + * config/rs6000/rs6000.md (movsf_hardfloat): Ignore special + registers when choosing register preferences. + (movdf_hardfloat64): Same. + +2005-09-22 Andreas Krebbel + + * expmed.c (expand_shift): Don't use the target of the rotate as + target for the first expanded shift insn. + * testsuite/gcc.dg/20050922-1.c: Testcase added. + +2005-09-21 Zdenek Dvorak + + PR tree-optimization/22438 + * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Handle all + preserved iv rhs rewriting specially. + +2005-09-21 Daniel Berlin + + * tree-data-ref.c (analyze_array_indexes): Only estimate when + estimate_only is true. + * tree-flow.h (ref_contains_indirect_ref): New prototype. + * tree-flow-inline.h (ref_contains_indirect_ref): Moved from + tree-ssa-structalias.c + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Use + ref_contains_indirect_ref. + * tree-ssa-structalias.c (ref_contains_indirect_ref): Moved. + +2005-09-21 DJ Delorie + + * config/mn10300/mn10300.c (TARGET_DEFAULT_TARGET_FLAGS): Add + MASK_PTR_A0D0. + (mn10300_return_in_memory): Support variable size types also. + (mn10300_pass_by_reference): Likewise. + (mn10300_function_value): New. + * config/mn10300/mn10300.h (FUNCTION_VALUE): Call the above. + (FUNCTION_OUTGOING_VALUE): Likewise. + * config/mn10300/mn10300.opt: Add -mreturn-pointer-on-d0. + * doc/invoke.texi: Document it. + +2005-09-21 Uros Bizjak + + PR target/22585 + * config/i386/i386.c (ix86_prepare_fp_compare_args): Do not + force integer op1 into register for XFmode compares. + +2005-09-21 Kazu Hirata + + PR middle-end/23971 + * expmed.c (alg_code): Add alg_impossible. + (alg_hash_entry): Add cost. + (synth_mult): Record alg_impossible in the hash table if + multiplication by a given integer is impossble within the + limit. Speed up using alg_impossible. + +2005-09-20 Daniel Berlin + + * tree-ssa-structalias.c (get_constraint_for_component_ref): Add + argument. Allow and set any offset if needs_anyoffset is passed + in. + (get_constraint_for): Add argument here too. + Pass it down. + (do_structure_copy): Pass NULL to get_constraint_for. + (handle_ptr_arith): Ditto. + (find_func_aliases): Ditto. + +2005-09-20 J"orn Rennecke + + PR rtl-optimization/23898 + * output.h (get_attr_min_length): Declare. + * final.c (get_attr_length_1): New function, broken out of: + (get_attr_length). + (get_attr_min_length): New function. + * bb-reorder.c (copy_bb_p, get_uncond_jump_length): Use it. + (duplicate_computed_gotos): Likewise. + * genattr.c (insn_min_length): Generate declaration. + * genattrtab.c (min_fn, min_attr_value): New functions. + (make_length_attrs): Generate insn_min_length. + +2005-09-20 Steve Ellcey + + * config/pa/pa.c (output_cbranch): Check for zero in operands[2]. + +2005-09-20 Richard Henderson + + PR tree-optimization/24059 + * expr.c (expand_expr_real_1) : Allow modifier + EXPAND_STACK_PARM. + +2005-09-20 Joseph S. Myers + + * c.opt (fextended-identifiers): New. + * c-opts.c (c_common_handle_option): Handle + -fextended-identifiers. + * doc/cpp.texi: Update documentation of extended identifiers. + * doc/cppopts.texi (-fextended-identifiers): Document. + +2005-09-20 Jakub Jelinek + + PR tree-optimization/23929 + * tree-ssa-loop-niter.c (expand_simple_operations): Return immediately + if expr is NULL. + + PR tree-optimization/23818 + * tree-stdarg.c (execute_optimize_stdarg): Call + calculate_dominance_info. + +2005-09-20 Daniel Berlin + + * tree-data-ref.c (get_number_of_iters_for_loop): New function. + (analyze_siv_subscript_cst_affine): Add weak SIV test. + (compute_overlap_steps_for_affine_1_2): Use + get_number_of_iters_for_loop. + (analyze_subscript_affine_affine): Check whether difference is + zero first. + Use get_number_of_iters_for_loop. + Check whether overlap occurs outside of bounds. + (analyze_miv_subscript): Use get_number_of_iters_for_loop. + +2005-09-20 Andreas Krebbel + + * tree-ssa-address.c (create_mem_ref): Put the symbol reference into the + base register if possible. + +2005-09-20 Zdenek Dvorak + + PR tree-optimization/18463 + * tree-chrec.c (chrec_convert): Return fold_converted chrec if + converting it directly is not possible. + (chrec_convert_aggressive): New function. + * tree-chrec.h (chrec_convert_aggressive): Declare. + * tree-scalar-evolution.c (instantiate_parameters_1, resolve_mixers): + Fold chrec conversions aggressively if asked to. + (instantiate_parameters): Modified because of changes in + instantiate_parameters_1. + +2005-09-19 Richard Henderson + + * config/i386/sse.md (reduc_splus_v4sf): Rename from reduc_plus_v4sf. + (reduc_splus_v2df): New. + +2005-09-19 Richard Sandiford + + * config/arm/aof.h (REGISTER_NAMES): Add missing backslash. + (ADDITIONAL_REGISTER_NAMES): Add missing comma. Remove final comma. + +2005-09-19 Richard Henderson + + * config/i386/sse.md (vcondu): Rename from + vcondu. + +2005-09-19 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_widen_sum): New. + (ia64_expand_dot_prod_v8qi): New. + * config/ia64/ia64-protos.h: Update. + * config/ia64/vect.md (pmpy2_r, pmpy2_l, widen_usumv8qi3, + widen_usumv4hi3, widen_ssumv8qi3, widen_ssumv4hi3, udot_prodv8qi, + sdot_prodv8qi, sdot_prodv4hi): New. + (reduc_splus_v2sf): Rename from reduc_plus_v2sf. + +2005-09-19 Richard Henderson + + PR 23941 + * real.c (exact_real_truncate): Return false if the format cannot + represent the number as a normal. + + * config/alpha/alpha.c (alpha_rtx_costs) : Cost 0 + for a memory source. + +2005-09-19 Dorit Nuzman + + * tree-ssa-operands.c (swap_tree_operands): Export. + * tree.h (swap_tree_operands): Declare. + * tree-vectorizer.c (vect_is_simple_reduction): Remove ATTRIBUTE_UNUSED. + Call swap_tree_operands. + +2005-09-19 Richard Henderson + + * tree-flow.h (merge_alias_info): Declare. + * tree-ssa-copy.c (merge_alias_info): Export. + * tree-vect-transform.c (vect_create_index_for_vector_ref): Remove. + (vect_create_data_ref_ptr): Use create_iv directly. + (vectorizable_load): Use correct types for integer constants. + (vect_generate_tmps_on_preheader): Likewise. + (vect_gen_niters_for_prolog_loop): Likewise. + +2005-09-19 Steven Bosscher + + PR rtl-optimization/23943 + * cse.c (find_best_addr): Never propagate an EXPR_LIST rtx. + +2005-09-18 Jan Hubicka + + * calls.c (flags_from_decl_or_type): Do not set ECF_LIBCALL_BLOCK. + +2005-09-18 Eric Botcazou + + * varasm.c (output_constant): Do not abort on conversions to union + types between different sizes. + +2005-09-18 Richard Guenther + + PR middle-end/23944 + * gimplify.c (fold_indirect_ref_rhs): Fix thinko in + fallback. + +2005-09-18 Paul Brook + + * config/m68k/fpgnuib.c (__floatsidf): Don't rely on signed overflow. + +2005-09-17 Richard Henderson + + * tree-pass.h, tree-flow.h, tree-ssa-dce.c: Revert last change. + * tree-ssa-loop.c (pass_vect_dce): Remove. + * passes.c (init_optimization_passes): Add pass_dce as a sub-pass + of pass_vectorize. + +2005-09-17 Richard Henderson + + * tree-pass.h (pass_vect_dce): Declare. + * passes.c (init_optimization_passes): Add it. + * tree-flow.h (tree_ssa_dce): Declare. + * tree-ssa-dce.c (tree_ssa_dce): Export. + * tree-ssa-loop.c (tree_vectorize): Move current_loops check ... + (gate_tree_vectorize): ... here. + (pass_vect_dce): New. + +2005-09-17 Jan Hubicka + + * except.c (struct eh_status): Turn region_array into vec. + (expand_resx_expr, collect_eh_region_array, remove_unreachable_regions, + convert_from_eh_region_ranges, find_exception_handler_labels, + current_function_has_exception_handlers, assign_filter_values, + build_post_landing_pads, dw2_build_landing_pads, + sjlj_find_directly_reachable_regions, sjlj_mark_call_sites, + sjlj_emit_dispatch_table, remove_eh_handler, for_each_eh_region, + foreach_reachable_handler, can_throw_internal_1, + convert_to_eh_region_ranges, verify_eh_tree): Update uses of + region_array. + (duplicate_eh_region_1): Update region_array. + (duplicate_eh_regions): Resize region_array and avoid recomputing. + +2005-09-17 David Edelsohn + + PR middle-end/22067 + * expmed.c (expand_mult): Substitute simple register for op0 when + computing max_cost. + +2005-09-17 Richard Henderson + + * expr.c (emit_move_via_integer): Add force argument, pass it on + to emit_move_change_mode. Update callers. + (emit_move_complex): Pass true to new force argument. + * function.c (expand_function_end): Move expand_eh_return call + earlier. Merge sub-word complex values into a pseudo before + copying to the return hard register. + +2005-09-17 Eric Botcazou + + * varasm.c (output_constant): Do not abort on VIEW_CONVERT_EXPRs + between different sizes. + +2005-09-16 Paolo Bonzini + + PR 23903 + + * passes.c (init_optimization_passes): Register dump files for + IPA passes first. + +2005-09-16 Andreas Krebbel + + * config/s390/s390-protos.h (s390_overlap_p): Prototype added. + * config/s390/s390.c (s390_overlap_p): New function. + * config/s390/s390.md ("*mvc" peephole2, "*nc" peephole2, "*oc" + peephole2, "*xc" peephole2): Added overlap check to the peephole2 + condition. + +2005-09-16 Richard Guenther + + * ipa-pure-const.c (static_execute): Free auxiliar information. + * ipa-type-escape.c (discover_unique_type): Free temporary key. + * tree-vrp.c (remove_range_assertions): Free blocks_visited sbitmap. + +2005-09-15 DJ Delorie + + * config/m32c/m32c-lib1.S (__m32c_eh_return): Fix typo. + +2005-09-15 Paolo Bonzini + + * optabs.c (expand_binop): Use swap_commutative_operands_with_target + to order operands. + (swap_commutative_operands_with_target): New. + +2005-09-15 Daniel Berlin + + * tree-data-ref.c (analyze_array_indexes): Add estimate_only + parameter. + Update callers. + (estimate_iters_using_array): New function. + * tree-data-ref.h (estimate_iters_using_array): Prototype + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): + Use estimate_iters_using_array instead of analyze_array. + +2005-09-15 Eric Botcazou + + * tree-nested.c (get_frame_type): Mark the "non-local frame structure" + as addressable. + +2005-09-15 Michael Matz + + * tree-vrp.c (vrp_int_const_binop ): Handle 0 - -INF. + +2005-09-14 Daniel Berlin + + PR tree-optimization/23835 + * tree-ssa-alias.c (sort_pointers_by_pt_vars): New function. + (create_name_tags): Rewrite to be not O(num_ssa_names^2). + +2005-09-14 Richard Henderson + + * config/ia64/vect.md (addv2sf3, subv2sf3): Rewrite as expand. + (addv2sf3_1, addv2sf3_2, subv2sf3_1, subv2sf3_2): New. + +2005-09-14 Andrew Pinski + + * config/i386/i386.c (contains_128bit_aligned_vector_p): Add break + in the ARRAY_TYPE case. + +2005-09-14 Eric Botcazou + + * tree.c (substitute_in_expr, case 4): New case, for ARRAY_REF. + +2005-09-14 Uros Bizjak + + PR middle-end/22480 + * tree-vect-transform.c (vectorizable_operation): Return false for + scalar shift operations and for vector shift operations with + non-invariant shift arguments. Use scalar tree operand op1 as + a shift operand when vector shift insn pattern uses scalar shift + operand. + * Makefile.in (tree-vect-transform.o): Depend on recog.h. + +2005-09-14 Olivier Hainque + + * gimplify.c (gimplify_init_ctor_eval): Don't discard a zero-sized + value if it has side-effects. + +2005-09-14 David Edelsohn + + PR target/22068 + * config/rs6000/rs6000.md (muldi3): Add mulli alternative. + +2005-09-14 Alan Modra + + * config/rs6000/linux64.h (DBX_OUTPUT_BRAC): Treat function name + passed as NAME as if it were label at start of function code. + +2005-09-13 Kaz Kojima + + * config/sh/sh.md (*movv4sf_i): Add general register cases to + the constraints. + +2005-09-13 Andrew Pinski + + * config/rs6000/darwin.md (movdf_low_si): Mark the outgoing r constraint + as early clobber. Rewrite so the PIC register is not implicitly used. + +2005-09-13 Volker Reichelt + + * tree.c (annotate_with_file_line): Compare line numbers before + file names. + +2005-09-13 Uros Bizjak + + PR target/23816 + * config/i386/sse.md (*ieee_sminv4sf3, *ieee_smaxv4sf3) + (*ieee_sminv2df3, *ieee_smaxv2df3): New insn patterns. + +2005-09-13 Ian Lance Taylor + + * loop-doloop.c (doloop_modify): Use GEN_INT to pass an rtx rather + than a HOST_WIDEST_INT to gen_doloop_begin. + +2005-09-13 Diego Novillo + + * tree-dfa.c (dump_variable): Guard against NULL annotations. + +2005-09-13 Zdenek Dvorak + + PR tree-optimize/23817 + * tree-cfg.c (tree_merge_blocks): Preserve loop closed ssa. + +2005-09-13 Alan Modra + + PR target/23774 + * config/rs6000/rs6000.md (restore_stack_block): Write the backchain + word before changing the stack pointer. Use gen_frame_mem for MEMs. + Use UNSPEC_TIE to prevent insn scheduling reordering the insns. + (restore_stack_nonlocal): Likewise. + (save_stack_nonlocal): Use template to emit insns, and gen_frame_mem. + +2005-09-12 Ian Lance Taylor + + PR g++/7874 + * c.opt (ffriend-injection): New C++ option. + * doc/invoke.texi (Option Summary): Mention -ffriend-injection. + (C++ Dialect Options): Document -ffriend-injection. + +2005-09-12 Josh Conner + + PR middle-end/23237 + * ipa-reference.c (static_execute): Don't mark variables in + named sections TREE_READONLY. + +2005-09-12 Alan Modra + + * config/rs6000/rs6000.c (get_next_active_insn): Simplify test for + stack_tie. + +2005-09-12 Andrew Pinski + + * tree-ssa-dse.c (dse_optimize_stmt): Fix up all of V_MAY_DEF and + V_MUST_DEF instead of just the first_use_p. + Don't mark the virtual variables for renaming on the statement which + is being removed. + (pass_dse): Remove TODO_update_ssa. + +2005-09-12 J"orn Rennecke + + PR middle-end/23290 + * stor-layout.c (compute_record_mode): For records with a single + field, actually check the field's mode size against the type size. + + * sh.h (HARD_REGNO_MODE_OK): Allow V4SFmode in general purpose + registers for TARGET_SHMEDIA. + (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Rename + GENERAL_FP_REGS to GENERAL_DF_REGS. Add GENERAL_FP_REGS as union + of GENERAL_REGS and FP_REGS. + +2005-09-12 Bernd Schmidt + + * config/bfin/bfin.c (legimitize_pic_address): Use gen_const_mem. + +2005-09-12 Alan Modra + + * config/rs6000/rs6000.c (get_next_active_insn): Rewrite using + CALL_P, JUMP_P and NONJUMP_INSN_P, so that barriers and labels + are omitted. Exclude stack_tie insn too. + +2005-09-11 David Edelsohn + + PR rtl-optimization/23098 + * config/rs6000/predicates.md (easy_fp_constant): SFmode constant + 0.0f is easy. + * config/rs6000/rs6000.md (movdf splitter): Use + const_double_operand predicate for TARGET_POWERPC64. + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Expand + SYMBOL_REF method to ABI_V4. + + * config/rs6000/altivec.md (build_vector_mask_for_load): Use + replace_equiv_address. + * config/rs6000/rs6000.c (rs6000_emit_eh_reg_restore): Mark MEM as + rs6000_sr_alias_set and MEM_NOTRAP. + (rs6000_aix_emit_builtin_unwind_init): Use gen_frame_mem(). + +2005-09-11 Eric Botcazou + + * tree.c (contains_placeholder_p) : Properly + handle CALL_EXPR again. + +2005-09-11 Richard Earnshaw + + * arm/predicates.md (alignable_memory_operand): Delete. + +2005-09-10 Richard Henderson + + PR debug/23806 + * dbxout.c (dbxout_expand_expr): New. + (dbxout_symbol): Use it. + +2005-09-10 Richard Earnshaw + + * arm.c (arm_gen_rotated_half_load): Delete. + (vfp_emit_fstmx, arm_set_return_address): Use gen_frame_mem. + (emit_multi_reg_push, emit_sfm, arm_expand_prologue) + (thumb_set_return_address): Likewise. + (thumb_load_double_from_address): Use adjust_address. + * arm.md (splits calling arm_gen_rotated_half_load): Delete. + (extendhsisi2_mem, movhi_bytes): Use change_address. + (movhi): Use widen_memory_access. + (reload_out_df): Use replace_equiv_address. + * arm-protos.h (arm_gen_rotated_half_load): Delete prototype. + +2005-09-09 Richard Henderson + + PR debug/20998 + * dbxout.c: Include expr.h. + (dbxout_global_decl): Don't suppress for DECL_RTL unset. + (dbxout_symbol): Handle DECL_VALUE_EXPR. + * Makefile.in (dbxout.o): Add EXPR_H. + +2005-09-09 Zdenek Dvorak + + PR tree-optimization/23509 + * tree-cfg.c (replace_uses_by): Use replace_exp. + * tree-ssa-loop-ivopts.c (get_ref_tag): Assert that dereferenced + pointers have name_mem_tag or type_mem_tag set. + +2005-09-09 Sebastian Pop + + * tree-chrec.c (evolution_function_is_invariant_rec_p): Use + CHREC_LEFT and CHREC_RIGHT for accessing chrec components instead + of wrongly accessing operands. + +2005-09-09 Sebastian Pop + + * Makefile.in (tree-chrec.o): Depends on SCEV_H. + * tree-chrec.c: Include tree-scalar-evolution.h. + (chrec_convert): Instantiate the base and step before calling + scev_probably_wraps_p that would fail on parametric evolutions. + Collect all the fails into a single section failed_to_convert, + print a diagnostic, and return chrec_dont_know instead of calling + fold_convert. + * tree-scalar-evolution.c (loop_closed_phi_def): New. + (instantiate_parameters_1): Avoid instantiation of loop closed ssa + phi nodes. + (scev_const_prop): Don't replace the definition of a loop closed ssa + phi node by itself, or by another loop closed ssa phi node. + * tree-ssa-loop-niter.c (scev_probably_wraps_p, convert_step): Check + that base and step are defined. + +2005-09-09 Richard Guenther + + PR c++/23624 + * fold-const.c (fold_ternary): Check truth_value_p before + calling invert_truthvalue. + +2005-09-09 Nick Clifton + + * Makefile.in (LIBGCC_DEPS): Add libgcc2.h. + * libgcc2.c (__clz_tab[], __popcount_tab[]): Set the fixed + dimension of these arrays. + * libgcc2.h (__clz_tab[], __popcount_tab[]): Add exports of + these arrays. + * longlong.h: Only provide a prototype for the __clz_tab[] array + if this header has not been included from libgcc2.h. + * config/stormy16/stormy16-lib2.c: Include libgcc2.h rather than + defining own types. + Provide prototypes for exported functions. + Use the __clz_tab[] and __popcount_tab[] arrays provided by + libgcc2.c. + +2005-09-08 Josh Conner + + PR c++/21135 + PR c++/23180 + * expr.c (expand_expr_addr_expr_1): Don't invoke + expand_simple_binop for EXPAND_INITIALIZER. + +2005-09-08 Richard Henderson + + PR debug/23190 + * toplev.c (wrapup_global_declaration_1): Split out ... + (wrapup_global_declaration_2): ... from ... + (wrapup_global_declarations): ... here. Return bool. + (check_global_declaration_1): Split out ... + (check_global_declarations): from here. + (emit_debug_global_declarations): New. + * toplev.h (wrapup_global_declaration_1, wrapup_global_declaration_2, + check_global_declaration_1, emit_debug_global_declarations): Declare. + * c-decl.c (c_write_global_declarations_1): Don't create a vector + of decls. Call wrapup_global_declaration_1, + wrapup_global_declaration_2, check_global_declaration_1 directly. + (c_write_global_declarations_2): New. + (ext_block): New. + (c_write_global_declarations): Call c_write_global_declarations_2. + * langhooks.c (write_global_declarations): Call + emit_debug_global_declarations. + + * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Don't + remove decls that have DECL_RTL_SET_P. + * passes.c (rest_of_decl_compilation): Invoke + cgraph_varpool_finalize_decl for all but functions. + +2005-09-08 Eric Botcazou + + * tree-vrp.c (extract_range_from_unary_expr): Do not set the range for + the result of a conversion if the new min and max cannot be compared. + +2005-09-08 Andreas Krebbel + + * config/s390/s390.c (s390_sr_alias_set): Variable removed. + (override_options): Setting s390_sr_alias_set removed. + (save_fpr, save_gprs): Set alias set to vararg or frame. + (restore_fpr, restore_gprs, s390_emit_prologue): Replace + s390_sr_alias_set with get_frame_alias_set (). + (s390_gimplify_va_arg): Replace s390_sr_alias_set with + get_varargs_alias_set (). + +2005-09-08 Andrew Pinski + + PR objc/20574 + PR objc/19324 + * c-parser.c (c_parser_objc_method_definition): If the next + token is not "{", error out and don't start the function. + +2005-09-08 Andrew Pinski + + * tree-vrp.c (extract_range_from_expr): Move the check for non + nullness after the check for gimple invariant. + +2005-09-08 Richard Kenner + + * tree.c (host_integerp, tree_low_cst): Correct function comment. + +2005-09-08 Kazuhiro Inaoka + + PR target/23747 + * config/m32r.md (movmemsi_internal): Canonicalize order of + operands in PLUS component of template. + +2005-09-07 Andreas Krebbel + + * reload1.c (fixup_eh_region_note): Remove assertion. + (fixup_abnormal_edges): Reverted removal of call to + find_many_sub_basic_blocks made on 2005-08-31. + +2005-09-07 Richard Henderson + + * function.c (ARG_POINTER_CFA_OFFSET): Move ... + * defaults.h (ARG_POINTER_CFA_OFFSET): ... here. + (INCOMING_FRAME_SP_OFFSET): Move from dwarf2out.c. + * dwarf2out.c (struct cfa_loc): Change reg to unsigned int, + rearrange for better packing. + (INCOMING_FRAME_SP_OFFSET): Move to defaults.h. + (lookup_cfa_1): Remove inline marker. + (cfa_equal_p): Split out of ... + (def_cfa_1): ... here. Use INVALID_REGNUM. + (build_cfa_loc): Handle !cfa->indirect. + (frame_pointer_cfa_offset): New. + (dbx_reg_number): Assert register elimination performed; do + leaf register remapping. + (reg_loc_descriptor): Avoid calling dbx_reg_number when unused. + (eliminate_reg_to_offset): New. + (based_loc_descr): Remove can_use_fbreg argument. Use fbreg only + for verifiably local stack frame addresses; re-base to CFA. + (mem_loc_descriptor): Remove can_use_fbreg argument. + (concat_loc_descriptor, loc_descriptor): Likewise. + (containing_function_has_frame_base): Remove. + (rtl_for_decl_location): Don't do register elimination or + leaf register remapping here. + (secname_for_decl): Split out from .. + (add_location_or_const_value_attribute): ... here. + (convert_cfa_to_loc_list): New. + (compute_frame_pointer_to_cfa_displacement): New. + (gen_subprogram_die): Use them. + * tree.h (frame_base_decl): Remove. + * var-tracking.c (frame_base_decl, frame_stack_adjust): Remove. + (prologue_stack_adjust): Remove. + (vt_stack_adjustments): Use INCOMING_FRAME_SP_OFFSET. + (adjust_stack_reference): Re-base memories to arg_pointer_rtx. + (set_frame_base_location): Remove. + (compute_bb_dataflow, emit_notes_in_bb): Don't call it. + (dump_attrs_list, dump_dataflow_set): Use string concatenation. + (vt_add_function_parameters): Don't eliminate_regs. + (vt_initialize): Don't create frame_base_decl. + +2005-09-07 Eric Botcazou + + * doc/install.texi (*-*-solaris2*): Clarify wording on the recommended + version of GNU binutils for 4.x and later. + +2005-09-06 Mark Mitchell + + * ggc-page.c (ggc_push_context): Remove. + (ggc_pop_context): Likewise. + * ggc.h (ggc_push_context): Remove. + (ggc_pop_context): Likewise. + +2005-09-06 Saurabh Verma + + PR target/8973 + * config/arc/arc.c (arc_output_function_epilogue): Update flags while + returning from an interrupt handler. + +2005-09-06 Saurabh Verma + + PR target/8972 + * config/arc/arc.c (output_shift): Add check for loop count when + optimizing. + +2005-09-06 Steven Bosscher + + * tree-ssa-phiopt.c (conditional_replacement): Construct proper SSA + form manually. + (abs_replacement): Likewise. + (pass_phiopt): Remove TODO_update_ssa. + +2005-09-06 Jakub Jelinek + + PR c/23075 + * c-typeck.c (c_finish_return): Set TREE_NO_WARNING on RETURN_EXPR + if "return with no value, in function returning non-void" warning + has been issued. + * tree-cfg.c (execute_warn_function_return): Don't look at + RETURN_EXPRs with TREE_NO_WARNING set. + + PR target/22362 + * config/i386/i386.c (ix86_function_regparm): Make sure automatic regparm + for internal functions doesn't use registers used by global registers + variables. Use fewer register parameters if there are global register + variables. + +2005-09-06 Olivier Hainque + Eric Botcazou + + PR middle-end/14997 + * expr.c (expand_expr_real) : Force op0 to mem + when we would be extracting outside its bit span (bitpos+bitsize + larger than its mode), possible with some VIEW_CONVERT_EXPRs from + Ada unchecked conversions. + +2005-09-06 Steven Bosscher + + * tree-ssa-pre.c (try_look_through_load): New function. + (compute_avail): Use it to try to look through loads for some + more useful expressions. + +2005-09-06 Saurabh Verma + + * simplify-rtx.c (simplify_binary_operation_1): Correct the + condition for detecting cases like (a&a) and (a^a). + +2005-09-06 Keith Besaw + + * common.opt: Add option ftree-vect-loop-version. + * params.def: Add --param vect-max-version-checks. + * doc/invoke.texi: Document ftree-vect-loop-version and + --param vect-max-version-checks. + * tree-vectorizer.h (_loop_vec_info): Add ptr_mask and + may_misalign_stmts and defines for accessors. + * tree-vectorizer.c : (new_loop_vec_info): VEC_alloc for + LOOP_VINFO_MAY_MISALIGN_STMTS. + (destroy_loop_vec_info): VEC_free for + LOOP_VINFO_MAY_MISALIGN_STMTS. + * tree-vect-analyze.c (vect_compute_data_ref_alignment): + Update documentation. + (vect_update_misalignment_for_peel): New. + (vect_enhance_data_refs_alignment): Update to choose loop + peeling or loop versioning if appropriate for the (potentially) + unaligned data references in the loop. + (vect_analyze_data_refs_alignment): Remove call to + vect_enhance_data_refs_alignment so the checks can be done + earlier. + (vect_analyze_loop): Add call to vect_enhance_data_refs_alignment + and move up call to vect_analyze_data_refs_alignment. + * tree-vect-transform.c (vect_create_cond_for_align_checks): New. + (vect_transform_loop): Add call to loop_version. + +2005-09-06 Jakub Jelinek + + PR rtl-optimization/23098 + * cse.c (fold_rtx_mem): Call delegitimize_address target hook. + * simplify-rtx.c (constant_pool_reference_p): New function. + * rtl.h (constant_pool_reference_p): New prototype. + * config/i386/i386.md (pushf split, mov[sdx]f split): Use + constant_pool_reference_p in condition and + avoid_constant_pool_reference in preparation statements. + +2005-09-06 Andreas Krebbel + + * gcse.c (try_replace_reg): Disallow REG_EQUAL notes for + STRICT_LOW_PART SETs. + +2005-09-06 Alan Modra + + PR middle-end/21460 + * except.c (sjlj_emit_function_enter): Find the function begin + note even when it's not in first basic block. + +2005-09-06 Kelley Cook + + * acinclude.m4: Renamed from aclocal.m4. Delete AM_LANGINFO_CODESET, + AM_PROG_CC_C_O, and AM_AUX_DIR_EXPAND. + * aclocal.m4: Regenerate. + +2005-09-05 DJ Delorie + + * config/m32c/m32c.h (TRAMPOLINE_ALIGNMENT): Correct misspelling + of macro. + +2005-09-06 Kazu Hirata + + * gimplify.c, ipa-prop.h, varasm.c, config/vxlib.c, + config/vxworks.h, config/crx/crx.c, config/ms1/ms1.c, + config/ms1/ms1.md, config/rs6000/rs6000.c: Fix comment typos. + Follow spelling conventions. + * doc/invoke.texi: Follow spelling conventions. + +2005-09-05 J"orn Rennecke + + * rtl.h (gen_frame_mem, gen_tmp_stack_mem): Declare. + * emit-rtl.c (gen_frame_mem, gen_tmp_stack_mem): New functions. + * builtins.c (expand_builtin_return_addr): Use gen_frame_mem. + +2005-09-05 J"orn Rennecke + + PR target/23683 + * sh.c (sh_reorg, emit_load_ptr): Use gen_const_mem. + (output_stack_adjust): Use gen_tmp_stack_mem. + (sh_expand_prologue, sh_expand_epilogue): Use gen_frame_mem. + (sh_set_return_address, sh_allocate_initial_value): Likewise. + (sh_get_pr_initial_val): Likewise. + (sh_builtin_saveregs): Use gen_frame_mem and change_address. + (sh_initialize_trampoline): Likewise. Also use adjust_address. + * sh.md (divsi_inv_m0): Use gen_const_mem. + (push_fpscr, pop_fpscr, load_ra): Use gen_frame_mem. + (movdf_i4+1): Use gen_tmp_stack_mem. + (reload_outdf+3, reload_outdf+4, fpu_switch+1): Use change_address. + (fpu_switch+2): Likewise. + (movv4sf_i, movv16sf_i): Use adjust_address. + (symGOT_load): Set MEM_NOTRAP_P bit. + +2005-09-04 John David Anglin + + PR target/23721 + * pa.c (emit_move_sequence): Fix typo in last change. + +2005-09-03 Jakub Jelinek + + PR rtl-optimization/23454 + * reorg.c (relax_delay_slots): Only call invert_jump if any_condjump_p + is true. + +2005-09-03 Richard Henderson + John David Anglin + + PR middle-end/23671 + * pa.c (emit_move_sequence): Use replace_equiv_address instead of + gen_rtx_MEM. + +2005-09-02 Nicolas Pitre + + * config/arm/arm.c (arm_legitimize_address): Limit the value passed + to bit_count to 32 bits. + +2005-08-31 Mark Mitchell + + PR c++/23167 + * gimplify.c (gimplify_expr): Handle TREE_ADDRESSABLE types when + generating synthetic loads from volatile lvalues. + +005-09-02 Nick Clifton + + * config/stormy16/stormy16-lib2.c (__popcounthi2, __parityhi2, + __ctzhi2, __clzhi2): New functions. + +2005-09-02 Andrew Pinski + + PR middle-end/23547 + * tree-nested.c (struct var_map_elt): Mark with GTY. + (struct nesting_info): Mark with GTY. Mark var_map's param is struct + var_map_elt. + (lookup_field_for_decl): Allocate new element in GC memory. + (lookup_tramp_for_decl): Likewise. + (convert_nl_goto_reference): Likewise + (create_nesting_tree): Allocate info in GC memory. Likewise for + info->var_map. + (free_nesting_tree): Free with ggc_free instead of free. + (root): New static variable. + (lower_nested_functions): Remove root as local variable. And zero out + root at the end of the function. + +2005-09-02 J"orn Rennecke + + PR rtl-optimization/20365 + * simplify-rtx.c (simplify_plus_minus_op_data): Change type of neg + to short. New member ix. + (simplify_plus_minus_op_data_cmp): Break ties using ix member. + (simplify_plus_minus): Initialize ix members before calling qsort. + +2005-09-02 Zdenek Dvorak + + PR tree-optimization/23626 + * tree-cfg.c (replace_uses_by): Clean up eh info. + +2005-09-01 DJ Delorie + + * config/m32c/m32c.c (m32c_valid_pointer_mode): Remove stray debug + fprintf. + +2005-09-01 David Edelsohn + + * config/rs6000/rs6000.c (setup_incoming_varargs): Set MEM_NOTRAP_P. + (rs6000_split_multireg_move): Use replace_equiv_address instead of + gen_rtx_MEM. + +2005-09-01 Craig Rodrigues + + * c-decl.c (diagnose_mismatched_decls): With -Wredundant-decls, + do not issue warning for a variable definition following + a declaration. + +2005-09-01 Richard Henderson + + PR 23668 + * config/i386/i386.c (ix86_expand_vector_init_one_var): Restore + conversion to CONST_VECTOR. + +2005-09-01 Richard Henderson + + PR 23676 + * reload1.c (reload_as_needed): Check !CALL_P before calling + fixup_eh_region_note. + * rtlanal.c (may_trap_p): SUBREG by itself cannot trap. + +2005-09-01 DJ Delorie + + * varasm.c (output_constant): Let the target resolve + conversions of addresses to non-default pointer sizes. + +2005-09-01 Nicolas Pitre + + * config/arm/arm.c (arm_legitimize_address): Split absolute addresses + to alow matching ARM pre-indexed addressing mode. + (arm_override_options): Remove now irrelevant comment. + +2005-09-01 Phil Edwards + + * config.gcc (i*86-wrs-vxworks): Update. Split out vxworksae target. + * config/i386/t-vxworks: Update multilibs for VxWorks 6 and RTP mode. + * config/i386/vxworks.h: Likewise. + * config/i386/t-vxworksae: New file, for VxWorks AE. + * config/i386/vxworksae.h: Likewise. + +2005-09-01 Sebastian Pop + + PR tree-optimization/23410 + * tree-ssa-loop-niter.c (scev_probably_wraps_p): Check that the + sequence is not wrapping during the first step. + +2005-09-01 Jakub Jelinek + + PR debug/7241 + * dwarf2out.c (base_type_die): Compare char_type_node with + TYPE_MAIN_VARIANT (type), not type. + +2005-09-01 Richard Guenther + + PR tree-optimization/15366 + * common.opt: Add -finline-functions-called-once. + Put -fearly-inlining in alphabetically ordered place. + * doc/invoke.texi: Document new option. + * ipa-inline.c (cgraph_decide_inlining): Honour + flag_inline_functions_called_once. + +2005-09-01 Jakub Jelinek + + PR rtl-optimization/23478 + * local-alloc.c (struct qty): Add n_throwing_calls_crossed field. + (alloc_qty): Initialize it. + (update_equiv_regs): Clear REG_N_THROWING_CALLS_CROSSED. + (combine_regs): Combine also n_throwing_calls_crossed fields. + (find_free_reg): Don't attempt to caller-save pseudos crossing + calls that might throw. + * global.c (struct allocno): Add throwing_calls_crossed field. + (global_alloc): Revert 2005-08-22 change. Initialize + throwing_calls_crossed. + (find_reg): Don't attempt to caller-save pseudos crossing calls that + might throw. + +2005-09-01 Alan Modra + + PR target/23649 + * config/rs6000/predicates.md (mask_operand): Only handle rlwinm masks. + (mask64_operand): Reinstate code prior to 2005-06-11 change. + (mask64_2_operand): Reinstate code prior to 2004-11-11 change. + (and64_2_operand): Tweak to use predicate. + (and_operand): Adjust for mask_operand changes. + * config/rs6000/rs6000.c (num_insns_constant): Revert 2005-06-11. + (print_operand): Likewise. + (rs6000_rtx_costs): Pass mode to mask_operand and use mask64_operand. + (mask64_1or2_operand): Delete. + * rs6000/rs6000-protos.h (mask64_1or2_operand): Delete. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT ): Revert 2005-06-11. + (EXTRA_CONSTRAINT ): Pass operand mode to predicate. + (EXTRA_CONSTRAINT ): Disallow mask64_operand matches. + * config/rs6000/rs6000.md (andsi3_internal3 split): Revert 2005-06-11. + (rotldi3_internal4): Likewise. + (rotldi3_internal5, rotldi3_internal5 split): Likewise. + (rotldi3_internal6, rotldi3_internal6 split): Likewise. + (ashldi3_internal7): Likewise. + (ashldi3_internal8, ashldi3_internal8 split): Likewise. + (ashldi3_internal, ashldi3_internal9 split): Likewise. + (anddi3 split): Don't match mask64_operand. + (anddi3_internal2): Add rlwinm. Modify 't' splitter predicate. + (anddi3_internal3): Add rlwinm. Use and64_2_operand in non-cr0 + splitter and match TARGET_64BIT not TARGET_POWERPC64. Modify + 't' splitter predicate. + (movdi_internal64 + 2): Revert 2005-06-11 change. + +2005-08-31 DJ Delorie + + * config/m32c/m32c.c (m32c_valid_pointer_mode): New. + (m32c_asm_integer): Add support for 32 bit pointers. + +2005-08-31 Richard Henderson + + * emit-rtl.c (set_mem_attributes_minus_bitpos): Look through + component-like references for setting MEM_NOTRAP_P. + + * config/i386/i386.c (ix86_setup_incoming_varargs): Set MEM_NOTRAP_P. + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Likewise. + +2005-08-31 Richard Henderson + + * expr.c (expand_expr_real_1) : Force subregs + into a pseudo before applying gen_lowpart. + +2005-08-31 Geoffrey Keating + + * doc/install.texi (Specific): Update cctools version required + for full functionality. + * config/darwin.h (LINK_SPEC): Pass -mmacosx-version-min to the + linkers as -macosx_version_min. + +2005-08-31 J"orn Rennecke + + PR target/21255 + * sh.c (print_operand, %R and %S): Add handling of floating point + registers, memory, constants and invalid operands. + +2005-08-31 Daniel Berlin + + * ipa-pure-const.c: Change dump name. + +2005-08-31 Uros Bizjak + + PR target/23570 + * config/i386/sse.md (*sse_concatv2sf): Change operand 2 constraint + to "reg_or_0_operand". + (sse2_loadld): Change operand 1 constraint to "reg_or_0_operand". + +2005-08-31 Dale Johannesen + + * loop-iv.c (iv_number_of_iterations): Fix overflow check for + loops that count down. + +2005-08-31 Richard Henderson + + PR rtl-opt/23601 + * reload1.c (reload): Set MEM_NOTRAP_P in spill slots. + (fixup_eh_region_note): New. + (reload_as_needed): Call it. + (fixup_abnormal_edges): Allow all throwing insns to be deleted; + don't call find_many_sub_basic_blocks; call verify_flow_info. + * function.c (assign_stack_local_1): Set MEM_NOTRAP_P. + (keep_stack_depressed): Likewise. + (assign_stack_temp_for_type): Likewise; use adjust_address_nv. + +2005-08-31 Richard Henderson + + * config/i386/i386.c (ix86_function_ok_for_sibcall): Fix test for + fp return matching. + +2005-08-31 Fariborz Jahanian + + * expr.c (expand_expr_real_1): Compare size of address + mode to target's address mode size in deciding expansion of + the constant address. + +2005-08-31 Richard Guenther + + PR middle-end/23477 + * expr.c (all_zeros_p): New function. + (expand_expr_real_1): Handle the case of an all-zero + non-addressable constructor separately. + +2005-08-31 Adrian Straetling + + * builtins.c: (expand_builtin_strcpy, expand_builtin_strcat): Change + arguments, adjust all callers. + (expand_builtin_strcat): Rewrite to call strcpy instead of mempcpy. + +2005-08-30 Richard Henderson + + PR target/23630 + * expr.c (expand_expr_real_1) : Use gen_lowpart + whenever the mode sizes match. + +2005-08-31 Alan Modra + + * calls.c (load_register_parameters): Fix comment typo. + * expr.c (emit_push_insn): Comment formatting. + +2005-08-30 Ian Lance Taylor + + * config/i386/x-cygwin (host-cygwin): Change dependency from + hosthooks-def.h to $(HOSTHOOKS_DEF_H). + +2005-08-29 Geoffrey Keating + + * config/i386/i386.c (ix86_expand_vector_init_one_var): Don't modify + parts of 'vals'. + +2005-08-29 Andrew Pinski + + PR middle-end/23408 + * ipa-inline.c (cgraph_decide_inlining_incrementally): Remove the + call to ggc_collect. + +2005-08-29 Paolo Bonzini + + PR bootstrap/21268 + * Makefile.in (ALL_CPPFLAGS): Include $(INCLUDES) at the + beginning. Remove $(INCLUDES) from all the rules, if following + $(ALL_CPPFLAGS) or $(BUILD_CPPFLAGS). + +2005-08-29 Jakub Jelinek + + PR middle-end/23484 + * builtins.c (fold_builtin_memory_chk, fold_builtin_stxcpy_chk, + fold_builtin_strncpy_chk, fold_builtin_snprintf_chk): If len is + not constant, but maxlen is, don't set len to maxlen, rather + set maxlen to len if len is a constant. + +2005-08-29 Zdenek Dvorak + + PR tree-optimization/23475 + * tree-ssa-loop-ivcanon.c (remove_empty_loop): Update frequencies + and counts. + +2005-08-28 Daniel Berlin + + Fix PR middle-end/22455 + + * fold-const.c (fold_checksum_tree): Adjust for now-largest tree size. + Checksum only the parts of the tree that exist for the tree code. + +2005-08-28 Dale Johannesen + + * config/i386/i386.c (nocona_cost): Increase MOVE_RATIO. + +2005-08-28 Andrew Pinski + + * tree-vrp.c: Remove obsolete comment in front of vrp_initialize. + +2005-08-28 Richard Henderson + + * stor-layout.c (finalize_type_size): Revert workaround from 08-26. + * tree.c (make_node_stat): Use BITS_PER_UNIT instead of alignment + of char_type_node. + +2005-08-28 Jakub Jelinek + + PR ada/23593 + * builtins.c (get_memory_rtx): Don't strip nops + in between COMPONENT_REFs. + +2005-08-27 Andrew Pinski + + PR middle-end/23463 + * gimplify.c (gimplify_modify_expr_rhs): Remove check for zero sized + types. + (gimplify_modify_expr): Check for zero sized types and gimplify the + rhs and lhs as statements. + +2005-08-27 John David Anglin + + PR libgcj/23508 + * pa/linux-unwind.h (pa32_fallback_frame_state): Use r0 slot in frame + state for return address column of signal frames. + +2005-08-27 David Edelsohn + + PR target/23539 + * config/rs6000/rs6000.c (expand_block_clear): Use HImode when + bytes >= 2 not bytes == 2. + (expand_block_move): Same. + +2005-08-27 Richard Guenther + + PR target/23575 + * config/i386/sse.md (sse2_movsd): Add missing closing + braces. + +2005-08-27 Paul Brook + + * genrecog.c (enum decision_type): Add DT_num_insns. + (struct decision_test): Add u.num_insns. + (add_to_sequence): Add DT_num_insns test. + (maybe_both_true_2, nodes_identical_1): Handle DT_num_insns. + (write_cond, debug_decision_2): Ditto. + (change_state): Assume peep2_next_insn never fails. + Remove "afterward" argument. + (write afterward, write_tree): Update to match. + * recog.c (peep2_current_count): New variable. + (peep2_next_insn): Check it. + (peephole2_optimize): Set peep2_current_count. + * recog.h (peep2_current_count): Declare. + +2005-08-26 Josh Conner + + PR middle-end/23584 + * ipa-pure-const.c (check_tree): Check for volatile-ness + when considering a dereference. + +2005-08-27 Jakub Jelinek + + * rtl.h (MEM_IN_STRUCT_P): Fix comment typo. + +2005-08-26 Jakub Jelinek + + PR rtl-optimization/23561 + * builtins.c (get_memory_rtx): Add LEN argument. If MEM_EXPR is + a COMPONENT_REF, remove all COMPONENT_REF from MEM_EXPR unless + at most LEN bytes long memory fits into the field. + (expand_builtin_memcpy, expand_builtin_mempcpy, expand_movstr, + expand_builtin_strncpy, expand_builtin_memset, expand_builtin_memcmp, + expand_builtin_strcmp, expand_builtin_strncmp): Adjust callers. + +2005-08-26 Richard Henderson + + PR rtl-opt/23560 + * loop.c (biased_biv_may_wrap_p): New. + (maybe_eliminate_biv_1): Use it to suppress non-equality + comparison transformations. Delete disabled code. + +2005-08-26 Ian Lance Taylor + + * combine.c (make_extraction): Avoid reference outside object. + +2005-08-26 J"orn Rennecke + + * stor-layout.c (finalize_type_size): Restore behaviour for + non-aggregate types to the status quo ante of the patch for + pr 23467. Document why it matters. + +2005-08-26 Jakub Jelinek + + PR c/23506 + * c-common.c (c_common_nodes_and_builtins): Increase builtin_types + array by one element, initialize the BT_LAST element with NULL. + +2005-08-26 David Edelsohn + + * config/rs6000/rs6000.md (eq_compare): Only enable when + optimizing for size. + (plus_eqsi): Same. + (compare_plus_eqsi): Same. + (plus_eqsi_compare): Same. + (neg_eq0): Same. + (neg_eq): Same. + + * config/rs6000/aix52.h (PROCESSOR_DEFAULT): Change to + PROCESSOR_POWER4. + +2005-08-26 Nick Clifton + + * config/v850/v850.c (ep_memory_operand): Return FALSE if + TARGET_EP is not defined. + * config/v850/c850.h (TARGET_CPU_CPP_BUILTINS): Define __EP__ if + TARGET_EP is enabled. + (OPTIMIZATION_OPTIONS): Do not define MASK_EP when optimizing. + * config/v850/v850.md (save_all_interrupt): Only use the EP + register if TARGET_EP is defined. + (restore_all_interrupt): Likewise. + * config/v850/lib1funcs.asm: Update functions so that the EP + register is only used if __EP__ is defined. + +2005-08-26 David Ung + + * config/mips/mips.c (mips_expand_prologue): Handle case when + generating for MIPS16 and the outgoing argument area is more than + SMALL_OPERAND. Use the frame pointer as temporary to generate the + add instruction. + +2005-08-26 Paul Woegerer + + * config/crx/crx.md: Make doloop_end pattern usage controllable + via mloop-nesting= command line switch. Make sure + the combiner cannot use doloop_end_ in an illegal way. + * config/crx/crx.c: Use regs up to r6 for argument passing. + Refine crx_address_cost (non cst4 displacements are expensive). + * config/crx/crx.opt: Add switch for mloop-nesting=. + +2005-08-26 Adrian Straetling + + * config/s390/s390.md: ("movstr", "*movstr"): Add patterns. + (UNSPEC_MVST): New constant. + +2005-08-26 Andreas Krebbel + + * config/s390/predicates.md ("shift_count_operand", "setmem_operand"): + Reject operands containing eliminable registers. + * testsuite/gcc.dg/20050825-1.c: New testcase. + +2005-08-24 Paolo Bonzini + Jan Hubicka + + * regmove.c (reg_is_remote_constant_p): Reorganize to not use log links. + +2005-08-24 Paolo Bonzini + + PR tree-optimization/23546 + * tree-ssa-loop-im.c (for_each_index): Handle INTEGER_CST + and REAL_CST nodes. + +2005-08-24 Pete Steinmetz + + * params.def (PARAM_MIN_SPEC_PROB): New. + * sched-rgn.c (MIN_PROBABILITY): Delete. + (compute_trg_info): Convert to PARAM_VALUE. + * doc/invoke.texi (param): Document min-spec-prob. + +2005-08-24 Fariborz Jahanian + + * config/darwin.h: define __PIC__ + * config/rs6000/darwin.h: Add SUBTARGET_OS_CPP_BUILTINS to + TARGET_OS_CPP_BUILTINS macro. + +2005-08-24 Paolo Bonzini + + * config/rs6000/rs6000.md: Fix thinko in the peephole2 I added + yesterday. + +2005-08-24 Zdenek Dvorak + + * bb-reorder.c (copy_bb, duplicate_computed_gotos): Add argument + to duplicate_block. + * cfghooks.c (duplicate_block): Added position where to place + new block as argument. + * cfghooks.h (duplicate_block): Declaration changed. + * cfglayout.c (copy_bbs): Add argument after. Pass it to + duplicate_block. + * cfglayout.h (copy_bbs): Declaration changed. + * cfgloop.h (loop_version): Declaration changed. + * cfgloopmanip.c (duplicate_loop_to_header_edge): Pass + position to copy_bbs. + (loop_version): Pass position to duplicate_loop_to_header_edge. + Add place_after argument and position new blocks according to + it. + * modulo-sched.c (sms_schedule): Pass place_after argument + to loop_version. + * tracer.c (tail_duplicate): Pass argument to duplicate_block. + * tree-cfg.c (split_edge_bb_loc): New function. + (tree_split_edge, tree_duplicate_sese_region): Use split_edge_bb_loc + to determine position of new blocks. + * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Pass argument + to loop_version. + * tree-ssa-threadupdate.c (create_block_for_threading): Pass + argument to duplicate_block. + * tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg): + Pass position to copy_bbs. + +2005-08-24 Zdenek Dvorak + + * fold-const.c (ptr_difference_const): Use + cst_and_fits_in_hwi instead of host_integerp. + +2005-08-24 Paolo Bonzini + + * config/darwin.c (gen_pic_offset): New. + (machopic_indirect_data_reference, machopic_legitimize_pic_address): + Use it. + +2005-08-23 Zdenek Dvorak + + PR tree-optimization/23486 + * tree-ssa-loop.c (pass_scev_cprop): Add TODO_update_ssa_only_virtuals. + +2005-08-23 Phil Edwards + + * config.gcc (*-*-vxworks*): Update tm_file, add extra_options, + remove use_collect2. + (powerpc-wrs-vxworks): Update, split out *-*-vxworksae target. + + * target-def.h (TARGET_HAVE_CTORS_DTORS): Allow target + configuration files to override the default value. + + * config/t-vxworks: Remove INSTALL_ASSERT_H. Define STMP_FIXPROTO, + EXTRA_HEADERS, and EXTRA_MULTILIB_PARTS. + * config/vx-common.h: New file, split out from... + * config/vxworks.h: here. Update for VxWorks 6.x and RTP mode. + * config/vxworksae.h: New file, for VxWorks AE. + * config/vxworks.opt: New file. + * config/vxlib.c: Update for VxWorks 6. + + * config/rs6000/t-vxworks (MULTILIB_OPTIONS): New list. Adjust + other MULTILIB_* variables appropriately. + (LIB2FUNCS_EXTRA, EXTRA_MULTILIB_PARTS): Correct from t-ppccomm. + * config/rs6000/t-vxworksae: New file, adjust multilibs for AE. + * config/rs6000/vxworks.h: Update for VxWorks 6. + * config/rs6000/vxworksae.h: New file, mostly placeholder for now. + +2005-08-23 Andrew Pinski + + PR target/20799 + * config/darwin.c (machopic_select_section): Remove the hack to + mark "::operator new" and "::operator delete" for coalescing + even though they are not weak. + +2005-08-24 Alan Modra + + * configure.ac (HAVE_LD_NO_DOT_SYMS): Set for powerpc-linux biarch. + * configure: Regenerate. + +2005-08-23 Paolo Bonzini + + PR middle-end/23517 + * fold-const.c (fold_convert): Use VIEW_CONVERT_EXPR to convert + between vectors. + * convert.c (convert_to_integer, convert_to_vector): Likewise. + * tree-vect-generic.c (tree_vec_extract, expand_vector_operations_1): + Likewise. + +2005-08-23 Paolo Bonzini + + * config/rs6000/predicates.md (equality_operator): New. + * config/rs6000/rs6000.md: Rewrite as a peephole2 the split for + comparison with a large constant. + +2005-08-23 Mark Mitchell + + * hwint.h (HOST_WIDE_INT_PRINT): Use HOST_LONG_LONG_FORMAT. + +2005-08-23 J"orn Rennecke + + * sh.c (sh_builtin_saveregs): If the number of to-be-saved fp + registers is even, and we have a hardware double precision fp, + align the buffer. + (sh_gimplify_va_arg_expr): For floating point arguments, consider + size of current argument when checking if argument was passed in + registers. + + * sh.c (sh_attr_renesas_p): Handle error_mark_node. + + PR middle-end/23467 + * stor-layout.c (finalize_type_size): Dont override + existing alignment with a smaller alignment from the mode. + +2005-08-23 Sebastian Pop + + * lambda-code.c (lambda_vector_lexico_pos): Moved... + * lambda.h (lambda_vector_lexico_pos): ... here. + * tree-data-ref.c (build_classic_dist_vector): Return false when + the distance vector is lexicographically negative. + +2005-08-23 Sebastian Pop + + PR tree-optimization/23511 + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Don't + handle cases where TYPE_MIN_VALUE or TYPE_MAX_VALUE are NULL_TREE. + +2005-08-23 Jakub Jelinek + + PR tree-optimization/22043 + * tree.h (count_type_elements): Add ALLOW_FLEXARR argument. + * expr.c (count_type_elements): Add ALLOW_FLEXARR argument. + If ALLOW_FLEXARR, handle types ending with flexible array member. + Pass false as second argument to recursive count_type_elements calls. + (categorize_ctor_elements_1, mostly_zeros_p): Pass false as second + argument to count_type_elements call. + * tree-sra.c (decide_block_copy): Likewise. + * gimplify.c (gimplify_init_constructor): If num_type_elements < 0 + for a constant-sized object, set cleared as well. Pass true as + second argument to count_type_elements call. + +2005-08-23 Alan Modra + + PR target/21571 + * config/rs6000/rs6000.c (rs6000_legitimate_small_data_p): Rename + from legitimate_small_data_p, and make global. Update use. + Remove forward declaration. + * config/rs6000/rs6000-protos.h (rs6000_legitimate_small_data_p): + Declare. + * config/rs6000/rs6000.md (movdf_hardfloat32): Allow small data mems. + +2005-08-23 David Edelsohn + + * config/rs6000/rs6000.md (eq): Use output operand instead + of scratch intermediates. + (eq_compare): Same. + (neg_eq0): New. + (neg_eq): Convert to define_insn_and_split. + +2005-08-23 Alan Modra + + PR target/23070 + * config/rs6000/rs6000.c (function_arg): For ABI_V4 calls to + stdarg functions, set/clear the fp marker even when no variable + args are passed. + * config/rs6000/sysv4.opt (mprototype): Describe. + +2005-08-22 Jakub Jelinek + + PR rtl-optimization/23478 + * regs.h (reg_info): Add throw_calls_crossed. + (REG_N_THROWING_CALLS_CROSSED): Define. + * flow.c (allocate_reg_life_data): Initialize + REG_N_THROWING_CALLS_CROSSED. + (propagate_one_insn, attempt_auto_inc): Update + REG_N_THROWING_CALLS_CROSSED. + * global.c (global_alloc): Don't allocate pseudos across + calls that may throw. + +2005-08-22 Andrew Pinski + + PR c/18715 + * c-common.c (c_do_switch_warnings): Look for a node where the enum's + value is inbetween the range if we did not find an exact match. + +2005-08-22 Aldy Hernandez + + * doc/invoke.texi (Option Summary): Add ms1 options. + * doc/extend.texi: Document interrupt handler attribute for ms1. + * doc/md.texi: Document ms1 constraints. + * config.gcc: Add ms1-*-elf. + * config/ms1/ms1.h: New. + * config/ms1/ms1.c: New. + * config/ms1/ms1.md: New. + * config/ms1/ms1-protos.h: New. + * config/ms1/ABI.txt: New. + * config/ms1/crti.asm: New. + * config/ms1/crtn.asm: New. + * config/ms1/lib2extra-funcs.c: New. + * config/ms1/t-ms1: New. + * config/ms1/ms1.opt: New. + +2005-08-22 Ira Rosen + + * config/rs6000/altivec.md (xorv4sf3): New. + (negv4sf2, neg2): Likewise. + +2005-08-21 H.J. Lu + + PR target/23485 + * config/ia64/ia64.md (divsi3): Check divide by zero. + (udivsi3): Likewise. + (divdi3): Likewise. + (udivdi3): Likewise. + +2005-08-21 Jakub Jelinek + + * simplify-rtx.c (simplify_immed_subreg) : Only clear + up to elem_bitsize bits, not max_bitsize. + +2005-08-21 Sebastian Pop + + PR tree-optimization/23433 + * tree-chrec.c (chrec_apply): Translate INTEGER_CST to a + REAL_CST when the type is SCALAR_FLOAT_TYPE_P. + +2005-08-21 Sebastian Pop + + PR tree-optimization/23434 + * tree-ssa-loop-niter.c (proved_non_wrapping_p): Give up when + the iteration bound is not an INTEGER_CST. + +2005-08-21 Dorit Nuzman + + * tree-vect-transform.c (get_initial_def_for_reduction): Set + need_epilog_adjust back to false for MIN/MAX case. Set *scalar_def to + NULL if need_epilog_adjust is false. + (vect_create_epilog_for_reduction): Variable adjust_in_epilog removed. + Case 3 always peels first itration, not just for PLUS case, and no need + to use scalar_initial_def here. Create an epilog adjustment only if + scalar_initial_def is not NULL. + + (vectorizable_reduction): Remove assert. + +2005-08-20 H.J. Lu + + PR target/23485 + * config/ia64/lib1funcs.asm (__divdi3): Check divide by zero. + (__moddi3): Likewise. + (__udivdi3): Likewise. + (__umoddi3): Likewise. + (__divsi3): Likewise. + (__modsi3): Likewise. + (__udivsi3): Likewise. + (__umodsi3): Likewise. + +2005-08-20 Jakub Jelinek + + * tree-pass.h (TDF_GRAPH): Define. + * tree-dump.c (dump_options): Don't set TDF_GRAPH in "all". + * passes.c (finish_optimization_passes): Only call + finish_graph_dump_file if TDF_GRAPH is set. + (execute_one_pass): Only call clean_graph_dump_file if dump_file != + NULL. Set TDF_GRAPH bit. + (execute_todo): Call print_rtl_graph_with_bb if TDF_GRAPH is set. + +2005-08-20 Richard Earnshaw + + * arm.h (arm_stack_offsets): Add locals_base field. + * arm.c (arm_get_frame_offsets): Compute it. + (thumb_compute_initial_elimination offset): Make the Thumb frame + pointer point to the base of the local variables. + (thumb_expand_prologue): Update accordingly. + (thumb_expand_epilogue): Likewise. + + * arm.md (thumb_movhi_clobber): Make this insn a define_expand. Change + mode of clobbered scratch to DImode. Handle a case that's known to + need this. + +2005-08-19 David Edelsohn + + * config/rs6000/rs6000.md (gt0): Delete. + (gt0_compare): Delete. + (neg_gt0): Delete. + +2005-08-19 Eric Christopher + + * optabs.h: Change CTI_ to COI_. + * optabs.c: Ditto. + +2005-08-19 James E Wilson + + * builtins.c (expand_builtin_return_addr): Set + current_function_accesses_prior_frames when count != 0. Use + frame_pointer_rtx when count == 0. + * function.h (struct function): Add accesses_prior_frames field. + (current_function_accesses_prior_frames): Define. + * reload1.c (init_elim_table): Check + current_function_accesses_prior_frames. + * doc/tm.texi (INITIAL_FRAME_ADDRESS_RTX): Update docs. + +2005-08-19 Diego Novillo + + * tree-cfgcleanup.c (cleanup_tree_cfg): Fix flowgraph change + indicator. Return true if the flowgraph changed during + cleanup. + +2005-08-19 Diego Novillo + + PR 23476 + * tree-cfgcleanup.c (cleanup_control_expr_graph): Fold the + conditional expression before testing its value. + +2005-08-19 Diego Novillo + + * doc/invoke.texi: Fix documentation for -ftree-dominator-opts. + +2005-08-19 Devang Patel + + PR tree-optimization/23048 + * tree-if-conv.c (if_convertible_bb_p): Supply basic_block as + third parameter. Check whether latch is dominated by exit + block or not. + (if_convertible_loop_p): Supply exit block itself to + if_convertible_bb_p. + +2005-08-19 Richard Earnshaw + + PR target/23473 + * arm.md (arm_load_pic_register): Change argument to the mask of + saved registers. Call thumb_find_work_register if we need a + scratch register on Thumb. + (arm_expand_prologue): Pass empty register set to + arm_load_pic_register. + (thumb_expand_prologue): Pass live_regs_mask directly to + arm_load_pic_register. + * arm-protos.h (arm_load_pic_register): Update prototype. + +2005-08-19 J"orn Rennecke + + * sh.c (find_sole_member): New function. + (sh_gimplify_va_arg_expr): Use it. Allow RECORD_TYPE mode mismatch + if the record's alignment is larger than the size of its only member. + +2005-08-19 Richard Earnshaw + + PR target/23436 + * arm.c (thumb_legitimize_reload_address): New function. + * arm-protos.h (thumb_legitimize_reload_address): Add prototype. + * arm.h (THUMB_LEGITIMIZE_RELOAD_ADDRESS): Call it. + +2005-08-19 Paul Woegerer + + * config/crx/crx.c: Implement crx_decompose_address. Reject + symbolic displacements since CRX register relative adressing + mode can't handle unsigned 32-bit values as displacements. + * config/crx/crx.h: Simplify definitions, remove redundant + parenthesis and obsolete macros. + * config/crx/crx.opt: Add new switch for debugging addresses. + * config/crx/crx-protos.h: Add new declarations for above. + +2005-08-19 Andrew Pinski + + PR middle-end/20624 + * gimple-low.c (block_may_fallthru): Handle CLEANUP_POINT_EXPR by + looking past it. + +2005-08-18 Kaveh R. Ghazi + + * collect2.c (dup2): Delete. + * configure.ac: Don't check for dup2. + + * config.in, configure: Regenerate. + +2005-08-18 J"orn Rennecke + + * sh.c (sh_gimplify_va_arg_expr): Loop to substitute a RECORD_TYPE + record with the type of its only member. + +2005-08-18 David Edelsohn + + * config/rs6000/rs6000.md (ltu_compare): Convert to + define_insn_and_split. + (plus_ltu_compare): Same. + (gtu_compare): Same. + (plus_gtu_compare): Same. + +2005-08-18 Dorit Nuzman + + PR tree-optimization/22228 + * tree-ssa-loop (pass_vectorize): Add TODO_verify_loops to + todo_flags_start. + * tree-vect-transform.c (vect_transform_loop): Mark the variables that + are recorded in vect_vnames_to_rename for renaming. + * tree-vectorizer.c (vect_vnames_to_rename): New global bitmap. + (slpeel_update_phi_nodes_for_guard1): Record virtual vars for renaming + in vect_vnames_to_rename. + (vectorize_loops): Allocate and free the vect_vnames_to_rename bitmap. + * tree-vectorizer.h (vect_vnames_to_rename): New extern variable. + +2005-08-18 Jan Hubicka + + PR c++/22034 + * cgraphunit.c (cgraph_varpool_assemble_pending_decls): Emit debug + info only for local statics, not for member variables. + +2005-08-18 Volker Reichelt + + * tree-data-ref.c (analyze_siv_subscript_cst_affine): Fix comment typo. + +2005-08-18 Volker Reichelt + + * c-typeck.c (designator_errorneous): Rename to designator_erroneous. + +2005-08-18 Andrew Pinski + + PR middle-end/16045 + * builtins.c (fold_builtin): Create a new NOP_EXPR all the time. + +2005-08-17 James E Wilson + + * c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in + array size check. + +2005-08-17 David Edelsohn + + * config/rs6000/rs6000.md (leu): Convert to mode macro. + (leu_compare): Same. + (plus_leu): Same. + (neg_leu): Same. + (and_neg_leu_compare): Same. + (plus_ltu): Same. + (geu): Same. + (geu_compare): Same. + (plus_geu): Same. + (neg_geu): Same. + (and_neg_geu): Same. + (plus_gt): Same. + (gtu_compare): Same. + (plus_gtu): Same. + +2005-08-17 Erik Christiansen + + * config/v850/lib1funcs.asm (callt_save_interrupt): Fix comment typos. + Move call_table_data to end. Delete spurious .text. + (callt_save_all_interrupt): Fix comment typo. + +2005-08-17 James E Wilson + Kevin Winchester + + PR target/21684 + * config/mcore/mcore.h (SHIFT_COUNT_TRUNCATED): Define to 0. + +2005-08-17 Uros Bizjak + + PR target/23268 + * config/i386/i386.md ("*fist2_1"): New pattern. + ("lrint2"): Change expander to use "*fist2_1" pattern. + +2005-08-17 J"orn Rennecke + + * sh.c (sh_gimplify_va_arg_expr): Don't substitute a RECORD_TYPE + record with the type of its only member if the modes don't match. + + * varasm.c (decode_reg_name): Skip empty additional register names. + +2005-08-16 Zdenek Dvorak + + * tree-ssa-loop-im.c (MAX_LSM_NAME_LENGTH, lsm_tmp_name, + lsm_tmp_name_length): New. + (lsm_tmp_name_add, gen_lsm_tmp_name, get_lsm_tmp_name): New functions. + (schedule_sm): Use get_lsm_tmp_name instead of "lsm_tmp". + +2005-08-16 Ulrich Weigand + Andreas Krebbel + + * config.gcc: Added z9-109 switch. + * config/s390/2084.md ("x_int", "x_agen", "x_lr", "x_la", "x_larl", + "x_load", "x_store", "x_branch", "x_call", "x_mul_hi", "x_mul_sidi", + "x_div", "x_sem", "x_cs", "x_vs", "x_stm", "x_lm", "x_other", + "x_fsimpdf", "x_fsimpsf", "x_fdivdf", "x_fdivsf", "x_floaddf", + "x_floadsf", "x_fstore_df", "x_fstoresf", "x_ftoi", "x_itof"): Enable + for "z9_109" cpu attribute. + * config/s390/s390.c (z9_109_cost): New processor cost structure. + (CONST_OK_FOR_Os, CONST_OK_FOR_Op, CONST_OK_FOR_On): New macros. + (s390_handle_arch_option): Added z9-109 switch. + (override_options): Set respective cost function for z9-109. + (s390_const_ok_for_constraint_p): New constraints Os, Op, On. + (legitimate_reload_constant_p): Accept extended immediates. + (print_operand): Three new output modifiers added: k, m and o. + (s390_adjust_priority, s390_issue_rate): Handle Z9_109 like Z990. + (s390_output_mi_thunk): Use extended immediate when possible. + * config/s390/s390.h (processor_flags): Added PF_EXTIMM. + (TARGET_CPU_EXTIMM, TARGET_EXTIMM): New macros. + (CONSTRAINT_LEN): Added length of O constraint. + (CLZ_DEFINED_VALUE_AT_ZERO): Definition added. + * config/s390/s390.md ("cpu"): New value z9_109 added. + ("*tstdi_extimm", "*tstdi_ccconly_extimm", "*tstsi_extimm", + "*tstsi_cconly_extimm", "*movdi_64extimm", "*extendhidi2_extimm", + "*extendqidi2_extimm", "*extendhisi2_extimm", "*extendqisi2_extimm", + "*zero_extendsi2_extimm", "*anddi3_extimm", "*iordi3_extimm", + "*xordi3_extimm", "clzdi2", "clztidi2"): New patterns. + ("*tstdi", "*tstsi", "*movdi_64", "*extendhisi2", "*extendqisi2", + "*zero_extendsi2_64", "zero_extendqihi2", "*zero_extendqihi2_64", + "*anddi3", "*iordi3", "*xordi3"): Disable for TARGET_EXTIMM. + ("*cmpdi_cct", "*cmpsi_cct", "*cmpdi_ccs", "*cmpsi_ccs", "*cmpdi_ccu", + "*cmpsi_ccu", "*movsi_zarch", "*adddi3_imm_cc", "*adddi3_carry1_cc", + "*adddi3_carry2_cc", "*adddi3_cc", "*adddi3_64", "*addsi3_imm_cc", + "*addsi3_carry1_cc", "*addsi3_carry2_cc", "*addsi3_cc", "addsi3", + "*andsi3_cc", "*andsi3_cconly", "*andsi3_zarch", "*iorsi3_cc", + "*iorsi3_cconly", "*iorsi3_zarch", "*xorsi3_cc", "*xorsi3_cconly", + "*xorsi3", "*xorhi3", "*xorqi3"): Added instruction using extended + immediates. + ("extenddi2", "extendsi2", "zero_extenddi2", + "zero_extendsi2"): Allow memory operands and don't manually emit + insns for TARGET_EXTIMM. + +2005-08-17 Andreas Krebbel + + * testsuite/gcc.dg/20020926-1.c: Added "-mesa" to dg-options. + +2005-08-17 Nick Clifton + + * config/stormy16/stormy16.c (xstormy16_encode_section_info): + Call default_encode_section_info. + +2005-08-17 Steven Bosscher + + PR tree-optimization/21574 + * tree-ssa-ccp.c (likely_value): If the right hand side is a + constant, return CONSTANT. + (ccp_lattice_meet): Use operand_equal_p instead of simple_cst_equal. + (ccp_fold, visit_assignment): Likewise. + (evaluate_stmt): Handle UNDEFINED and UNKNOWN_VAL the same way. + +2005-08-16 James A. Morrison + + * c-typeck.c (build_function_call): Call fold_buildN_initializer or + fold_buildN instead of buildN then fold_initializer or fold. + (build_unary_op): Likewise. + (build_binary_op): Likewise. + * fold-const.c (fold_initializer): Remove. + (fold_build1_initializer): New function. + (fold_build2_initializer): New function. + (fold_build3_initializer): New function. + * tree.h (fold_initializer): Remove. + (fold_build1_initializer): New function. + (fold_build2_initializer): New function. + (fold_build3_initializer): New function. + +2005-08-16 James A. Morrison + + * fold-const.c (optimize_bit_field_compare): Remove extra fold call. + (try_move_mult_to_index): Call fold_build2 instead of build2. + (fold_binary): Don't call fold after calls to try_move_mult_to_index. + * tree-ssa-loop-niter.c (inverse): Call int_const_binop instead of + fold_binary_to_constant. + (infer_loop_bounds_from_undefined): Call fold_build2 instead of + fold (build. + * tree-data-ref.c (tree_fold_divides_p): Use tree_int_cst_equal to + check if A == gcd (A, B). Remove TYPE argument. + (analyze_offset) Use fold_build2 instead of fold (build. + (create_data_ref): Likewise. + (analyze_siv_subscript_cst_affine): Update calls to tree_fold_divides_p. + * tree-ssa-ccp.c (widen_bitfield): Call fold_build2 instead of build2 + then fold. + +2005-08-17 Kelley Cook + + * config/arm/unaligned-funcs.c,config/i386/crtfastmath.c, + ipa-cp.c,ipa-prop.c,ipa-prop.h: Update FSF address. + +2005-08-16 Andrew Pinski + + PR tree-opt/23402 + * gimplify.c (zero_sized_type): New function. + (gimplify_modify_expr_rhs): If we have a zero sized type, + replace the statement with an empty statement. + +2005-08-16 H.J. Lu + + * config/i386/crtfastmath.c (set_fast_math): Add "=m" for + fxsave. + +2005-08-16 Ian Lance Taylor + + * doc/tm.texi (Label Output): Correct typo. + +2005-08-16 Steven Bosscher + + PR target/23376 + * loop-unroll.c (analyze_insn_to_expand_var): Make sure that + force_operand will work later on using have_insn_for. + +2005-08-16 Volker Reichelt + + * fold-const.c (tree_expr_nonnegative_p): Regroup cases. + +2005-08-16 Ian Lance Taylor + + PR c++/23337 + * gimplify.c (gimplify_init_ctor_eval): If we see an element of + vector type, don't try to construct it element by element. Add an + assertion that we use a FIELD_DECL when building a COMPONENT_REF. + +2005-08-16 Volker Reichelt + + * fold-const.c (fold_ternary): Simplify folding of a CALL_EXPR. + +2005-08-16 Geoffrey Keating + + * doc/invoke.texi (Precompiled Headers): Document some more options + which are known to be safe. + +2005-08-16 James E Wilson + + PR tree-optimization/21105 + * c-decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE in + TREE_OVERFLOW check. + +2005-08-16 David Edelsohn + + * config/rs6000/rs6000.md (ltu): Convert to mode macro. + (neg_ltu): Same. + (gtu): Same. + (neg_gtu): Same. + +2005-08-16 Volker Reichelt + + * builtins.c (expand_builtin_strcat): Remove superfluous call to fold. + (fold_builtin_isdigit): Use fold_buildN. + (build_function_call_expr): Likewise. + * c-typeck.c (c_finish_loop): Likewise. + +2005-08-16 J"orn Rennecke + Richard Shann + + PR middle-end/20396: + * optabs.c (expand_binop): Take TRULY_NOOP_TRUNCATION into account. + +2005-08-16 Sebastian Pop + + * tree-ssa-loop-niter.c (scev_probably_wraps_p): Reword a comment. + +2005-08-15 Richard Earnshaw + + PR target/23355 + * arm.c (thumb_compute_save_reg_mask): Use similar logic to + arm_compure_save_reg0_reg12_mask to determine when the PIC register + must be saved. + +2005-08-15 John David Anglin + + PR middle-end/23369 + * fold-const.c (build_range_check): Disable optimization for function + pointer expressions on targets that require function pointer + canonicalization. + +2005-08-15 Ulrich Weigand + + * simplify-rtx.c (simplify_const_relational_operation): When + extracting arguments of a COMPARE, recompute the mode as well. + +2005-08-15 Ian Lance Taylor + + * tree.c (build_string): Mark tree CONSTANT and INVARIANT. + +2005-08-15 DJ Delorie + + * config/m32c/mov.md (movqi_op): Immediates can't be moved to + the stack. + (movsi_splittable): Allow, but split, moves to the stack. + * config/m32c/m32c.c (m32c_split_move): Always split moves to the + stack. + +2005-08-15 Kaveh R. Ghazi + + * aclocal.m4 (gcc_AC_FUNC_PRINTF_PTR): Delete. + * configure.ac: Don't call gcc_AC_FUNC_PRINTF_PTR. + * system.h (HOST_PTR_PRINTF): Don't define, poison it. + + * bitmap.c, c-decl.c, config/i386/i386-interix.h, + config/iq2000/iq2000.c, mips-tfile.c, print-rtl.c, print-tree.c: + Delete HOST_PTR_PRINTF. + + * configure, config.in: Regenerate. + +2005-08-15 David Edelsohn + + * config/rs6000/rs6000.md (QHSI): New mode macro. + (wd): Extend mode attr for QImode and HImode + (dbits): New mode attr. + (zero_extenddi2): Convert to mode macro. + +2005-08-15 Steve Ellcey + + PR target/21841 + * doc/invoke.texi (-mgnu-ld): Update description. + (-mhp-ld): Ditto. + +2005-08-15 Sebastian Pop + + PR 23391 + * Makefile.in (tree-chrec.o): Depends on real.h. + * tree-chrec.c: Include real.h. + (chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly, + chrec_fold_plus_1): Use build_real for SCALAR_FLOAT_TYPE_P. + * tree-scalar-evolution.c (add_to_evolution_1, + interpret_rhs_modify_expr): Ditto. + +2005-08-15 Sebastian Pop + + PR 23386 + * tree-data-ref.c (estimate_niter_from_size_of_data): When + step is negative compute the estimation from init downwards to zero. + +2005-08-14 James A. Morrison + + * fold-const (fold_binary): Call fold_build2 instead of fold (build. + +2005-08-14 Ulrich Weigand + + * config/s390/s390.c (s390_const_ok_for_constraint_p): Add 'P' + constraint. + (legitimate_reload_constant_p): Fix handling of lliXX operands. + Accept double-word constants that can be split. + * config/s390/s390.md ("movti"): Use 'P' constraint. + ("*movdi_31", "*movdf_31"): Likewise. + +2005-08-14 Daniel Berlin + + Fix PR tree-optimization/22615 + + * tree-ssa-structalias.c (solution_set_add): Handle + first_vi_for_offset returning NULL. + (do_da_constraint): Ditto. + (do_sd_constraint): Ditto. + (do_ds_constraint): Ditto + (find_func_aliases): Ditto. + (build_constraint_graph): RHS is allowed be ANYTHING. + (first_vi_for_offset): Return NULL if we couldn't find anything at + the offset. + +2005-08-14 Ulrich Weigand + + * config/s390/s390.c (s390_canonicalize_comparison): Prefer register + over memory as first operand. + +2005-08-14 H.J. Lu + + PR target/23360 + * config/i386/crtfastmath.c (set_fast_math): Check if DAZ is + available for setting it. + +2005-08-14 Ira Rosen + + PR tree-optimization/23320 + * tree-data-ref.c (base_addr_differ_p): Add comment. Check + data-refs' types instead of base object nullness. Add check for + pointer type data-refs before first location comparison. Remove + assert. + +2005-08-14 Andreas Schwab + + * doc/md.texi (Machine Constraints): Fix misplaced @end table. + +2005-08-13 James E Wilson + + * doc/cpp.texi (__SSP__, __SSP_ALL__): Document. + * doc/invoke.texi (-Wstack-protector, -fstack-protector, + -fstack-protector-all, --param ssp-buffer-size): Document. + (-Wvariadic-macros): Alphabetize. + (-fsched-stalled-insns-dep): Add missing 'f'. + + * c-cppbuiltin.c (c_cpp_builtins): Add comment for flag_stack_protect + macros. + +2005-08-13 David Edelsohn + + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'a' for indexed + or indirect address operand. + (EXTRA_ADDRESS_CONSTRAINT): New. + * config/rs6000/rs6000.md (prefetch): Change constraint "p" to "a". + +2005-08-13 Sebastian Pop + + PR tree-optimization/22236 + * tree-cfg.c (print_pred_bbs, print_succ_bbs): Correctly print + successors and predecessors. + * tree-chrec.c (chrec_convert): Before converting, check that + sequences don't wrap. + * tree-data-ref.c (compute_estimated_nb_iterations): Moved ... + (analyze_array): Extern. + (find_data_references_in_loop): Remove call to + compute_estimated_nb_iterations. + * tree-data-ref.h (analyze_array): Declared. + * tree-flow-inline.h (single_ssa_tree_operand, single_ssa_use_operand, + single_ssa_def_operand, zero_ssa_operands): Fix documentation. + * tree-flow.h (scev_probably_wraps_p): Declare with an extra parameter. + * tree-scalar-evolution.c (instantiate_parameters_1): Factor entry + condition. + * tree-ssa-loop-ivcanon.c: Fix documentation. + * tree-ssa-loop-ivopts.c (idx_find_step): Add a fixme note. + * tree-ssa-loop-niter.c (compute_estimated_nb_iterations): ... here. + (infer_loop_bounds_from_undefined): New. + (estimate_numbers_of_iterations_loop): Use + infer_loop_bounds_from_undefined. + (used_in_pointer_arithmetic_p): New. + (scev_probably_wraps_p): Pass an extra parameter. Call + used_in_pointer_arithmetic_p. Check that AT_STMT is not null. + (convert_step): Fix documentation. + * tree-vrp.c (adjust_range_with_scev): Call instantiate_parameters. + Use initial_condition_in_loop_num and evolution_part_in_loop_num + instead of CHREC_LEFT and CHREC_RIGHT. Adjust the call to + scev_probably_wraps_p. + +2005-08-13 Ulrich Weigand + + * config/s390/s390.c (s390_split_branches): Revert 2005-08-12 change. + (s390_register_info): Ignore clobbered_regs information for fixed + registers, and only fixed registers. + (s390_init_frame_layout): Remove redundant call. + +2005-08-12 Gerald Pfeifer + + * doc/invoke.texi (C++ Dialect Options): Add dynamic_cast to + description of -Wold-style-casts. + +2005-08-12 Andreas Krebbel + Jakub Jelinek + + * config/s390/linux.h (TARGET_THREAD_SSP_OFFSET): Define. + * config/s390/s390-protos.h (s390_get_thread_pointer): Prototype added. + * config/s390/s390.c (print_operand): New output modifier 'G' added. + (get_thread_pointer): Renamed to s390_get_thread_pointer. + * config/s390/s390.md (stack_protect_set, stack_protect_test): If + TARGET_THREAD_SSP_OFFSET is defined, change operands[1] to + (MEM:P (PLUS:P (tp, TARGET_THREAD_SSP_OFFSET))). + (UNSPEC_SP_SET, UNSPEC_SP_TEST): New constants. + ("stack_protect_set", "stack_protect_test"): New expanders. + ("stack_protect_setsi", "stack_protect_setdi", "stack_protect_testsi", + "stack_protect_testdi"): New insn definitions. + +2005-08-12 Andreas Krebbel + + * config/s390/s390.md ("*movdf_31"): Changed constraint from P to K. + +2005-08-12 Paul Brook + + * config/arm/lib1funcs.asm: Error if __ARM_ARCH__ not set. + +2005-08-12 Andreas Krebbel + + * config/s390/predicates.md (setmem_operand): New predicate. + (shift_count_operand): Accept ANDs with special constants as + operand. + * config/s390/s390.c (print_shift_count_operand): Skip ANDs + with special constants. + * config/s390/s390.md ("setmem_long", "*setmem_long"): Replaced + shift_count_operand with setmem_operand. + +2005-08-12 Andreas Krebbel + + * config/s390/s390.c (s390_extract_part, s390_single_part): + Type cast added. + (s390_const_ok_for_constraint_p): Added SImode to the N constraint. + (s390_output_mi_thunk): Don't use lg on 31 bit. + * config/s390/s390.md ("*movdi_31", "*movdf_31"): Added lmy and stmy. + ("*llgt_sisi" and splitter): Replaced TARGET_64BIT with TARGET_ZARCH. + +2005-08-12 Andreas Krebbel + + * config/s390/s390.c (CONST_OK_FOR_J, CONST_OK_FOR_K): New macros. + (s390_select_ccmode, s390_rtx_costs, legitimate_reload_constant_p, + s390_init_frame_layout, s390_emit_prologue, s390_emit_epilogue, + s390_output_mi_thunk): Replaced uses of CONST_OK_FOR_CONSTRAINT_P + with one of the new macros. + +2005-08-12 Andreas Krebbel + + * config/s390/s390.c (s390_split_branches, s390_init_frame_layout): + Don't set save_return_addr_p. + (s390_register_info): Make clobbered_regs not depending on + save_return_addr_p. + +2005-08-12 Kaz Kojima + + * gcc.c (LINK_SSP_SPEC): Remove space before a trailing }. + (LINK_COMMAND_SPEC): Add space after %(link_ssp). + +2005-08-11 James E. Wilson + + * config/ia64/ia64.h (EXTRA_MEMORY_CONSTRAINT): New. + +2005-08-11 Jakub Jelinek + + * dwarf2out.c (add_location_or_const_value_attribute): Prefer + locations gathered by var-tracking in single entry loc_list + over loc_descriptor_from_tree. + + * dwarf2out.c (concat_loc_descriptor): Add can_use_fbreg argument, + pass it down to loc_descriptor. + (loc_descriptor): Pass can_use_fbreg to concat_loc_descriptor. + (containing_function_has_frame_base): Move earlier in the file. + (loc_descriptor_from_tree_1): Use containing_function_has_frame_base + instead of always assuming fbreg can't be used. + +2005-08-11 David Edelsohn + + * config/rs6000/altivec.md: Change constraint "m" to "Z". + * config/rs6000/predicates.md (indexed_or_indirect_operand): + Accept address wrapped in AND for Altivec. + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): + Strip AND wrapping offset address for Altivec. + +2005-08-11 Richard Henderson + + PR middle-end/23312 + * gimplify.c (gimplify_one_sizepos): Check for INTEGER_TYPE + before using TYPE_IS_SIZETYPE. + +2005-08-11 Richard Henderson + + PR target/22225 + * config/alpha/alpha.c (alphaev4_insn_pipe): Add take pipes for + insn types not present on ev4. + (alphaev5_insn_pipe): Similarly. + +2005-08-11 Richard Earnshaw + + PR target/23250 + * arm.c (arm_override_options): If the user has selected callee-super- + interworking, then enable normal interworking. + +2005-08-11 Rainer Orth + + * config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_BSS): Undef before + redefinition. + +2005-08-11 Wu Zhou + + * doc/rtl.texi: Fix two typos. + +2005-08-11 Richard Guenther + + PR target/23289 + * config/i386/i386.c (ix86_function_ok_for_sibcall): Handle + cases where we call to/from functions returning void. + +2005-08-10 James A. Morrison + + PR c++/23225 + * tree.c (build_pointer_type_for_mode): Robustify. + +2005-08-10 James E Wilson + + * defaults.h, config/alpha/alpha.h, config/ia64/ia64.h + (ASM_OUTPUT_ADDR_VEC_ELT): Delete. + + * config/alpha/alpha.c (alpha_arg_partial_bytes): Change "(CUM)." to + "cum->". + +2005-08-10 Eric Christopher + + * config/rs6000/rs6000.c (mems_ok_for_quad_peep): Rewrite. + * config/rs6000/rs6000.md (*lfq_power2, *stfq_power2): Use + V2DFmode. + +2005-08-10 Andrew Pinski + + PR target/21887 + * config/darwin.c (machopic_indirect_data_reference): Use a new register + for the high part when generating dynamic-no-pic code. + +2005-08-10 H.J. Lu + + * config.gcc (i[34567]86-*-linux*): Add i386/t-crtfm to tm-file. + (x86_64-*-linux*): Likewise. + + * config/i386/crtfastmath.c: New file. + * config/i386/t-crtfm: Likewise. + + * config/i386/linux.h (ENDFILE_SPEC): New. + * config/i386/linux64.h (ENDFILE_SPEC): Likewise. + + * config/i386/t-linux64 (EXTRA_MULTILIB_PARTS): Add + crtfastmath.o. + +2005-08-10 Dorit Nuzman + + * doc/md.texi: (reduc_smin, reduc_umin, reduc_splus, reduc_uplus): + (vec_shl, vec_shr): Document new operations. + * tree.def (VEC_RSHIFT_EXPR, VEC_LSHIFT_EXPR): Fix comment. + +2005-08-10 David Edelsohn + + * config/rs6000/predicates.md (indexed_or_indirect_address): New. + * config/rs6000/rs6000.md (prefetch): Remove operand 0 mode and + change predicate to indexed_or_indirect_address. + +2005-08-10 Richard Sandiford + + * config/arm/lib1funcs.asm (__aeabi_uidiv, __aeabi_idiv): New aliases. + * config/arm/libgcc-bpabi.ver (GCC_3.5): Add __aeabi_idiv, + __aeabi_uidiv, __aeabi_uread4, __aeabi_uread8, __aeabi_uwrite4 + and __aeabi_uwrite8. + * config/arm/unaligned-funcs.c: New file. + * config/arm/t-bpabi (LIB2FUNCS_EXTRA): Add unaligned-funcs.c. + +2005-08-09 Paolo Bonzini + + * bb-reorder.c (pass_duplicate_computed_gotos, pass_partition_blocks): + Add dump. + * cfglayout.c (pass_insn_locators_initialize): Add dump. + * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): + Add dump. + * except.c (pass_convert_to_eh_region_ranges): Add dump. + * final.c (pass_shorten_branches): Add dump. + * flow.c (pass_recompute_reg_usage, pass_remove_death_notes): Add dump. + (pass_life): Rename dump. + (rest_of_handle_flow2): Remove initial verify_flow_info. + * function.c (pass_instantiate_virtual_regs): Add dump. + * integrate.c (pass_initial_value_sets): Add dump. + * jump.c (pass_cleanup_barriers, pass_purge_lineno_notes): Add dump. + * loop-init.c (pass_rtl_loop_init, pass_rtl_loop_done): Rename dump. + (pass_rtl_move_loop_invariants, pass_rtl_unswitch, pass_rtl_doloop, + pass_rtl_unroll_and_peel_loops): Rename dump and add gate. + (gate_rtl_move_loop_invariants, gate_rtl_unswitch, gate_rtl_doloop, + gate_rtl_unrool_and_peel_loops): New. + (rtl_move_loop_invariants, rtl_unswitch, rtl_unrool_and_peel_loops, + rtl_doloop): Do not look at flags. + * mode-switching.c (pass_mode_switching): Add dump. + * recog.c (pass_split_all_insns, pass_split_for_shorten_branches, + pass_split_before_regstack): Add dump. + * regmove.c (pass_stack_adjustments): Add dump. + * tree-optimize.c (pass_fixup_cfg): Add dump. + +2005-08-10 Kazuhiro Inaoka + + PR 23309 + * config/m32r/m32r.c (m32r_reload_lr): Fix off by one error when + deciding which instruction sequence to use. + +2005-08-09 Dorit Nuzman + + * tree-vect-transform.c (vect_create_epilog_for_reduction): Set + BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs. + +2005-08-09 Richard Guenther + + * c-common.c (builtin_function_2): Remove. + (def_builtin_1): New function. + (c_common_nodes_and_builtins): Use def_builtin_1 to + build builtin functions. + +2005-08-09 Jie Zhang + + * config/bfin/uclinux.h (NO_IMPLICIT_EXTERN_C): Define. + * config/bfin/elf.h (NO_IMPLICIT_EXTERN_C): Define. + * config/bfin/bfin.c (bfin_return_in_memory): Update to really match + Visual DSP. + +2005-08-09 James A. Morrison + + * tree-ssa-loop-niter.c (tree_simplify_using_condition_1): Use + fold_binary instead of fold_build2 since we don't care about the + resulting tree. + (loop_niter_by_eval): Likewise. + (compare_trees): Likewise. + (proved_non_wrapping_p): Likewise. + +2005-08-09 James A. Morrison + + PR c/23161 + PR c/23165 + * c-typeck.c (c_finish_if_stmt): Look into STATEMENT_LISTs to see + if the if is really empty. + +2005-08-09 Steven Bosscher + + PR tree-optimization/23234 + * tree-ssa-math-opts.c (place_reciprocal): New enum. + (execute_cse_reciprocals_1): Replace the 'phi' argument with an + argument of the new enum. + (execute_cse_reciprocals): Add reciprocals for function arguments + on the unique successor edge of the entry block. Update other calls + to execute_cse_reciprocals_1. + +2005-08-08 Richard Henderson + + PR 22439 + * gimplify.c (gimplify_one_sizepos): Preserve the original type. + +2005-08-08 Bob Wilson + + * expr.c (write_complex_part): Return after handling MEM. + +2005-08-08 Josh Conner + + PR rtl-optimization/23241 + * combine.c (simplify_comparison): Fix error in determining + whether to lift a subreg from comparison. + +2005-08-08 David Edelsohn + + PR target/18506 + * config/rs6000/altivec.md (vec_init): New. + (vec_set): New. + (vec_extract): New. + * config/rs6000/rs6000.c (rs6000_expand_vector_init): New. + (rs6000_expand_vector_set): New. + (rs6000_expand_vector_extract): New. + (rs6000_legitimate_offset_address_p): Offset addresses are valid + for Altivec modes before reload. + (altivec_expand_vec_init_builtin): New. + (get_element_number): New. + (altivec_expand_vec_set_builtin): New. + (altivec_expand_vec_ext_builtin): New. + (altivec_expand_builtin): Expand vec_init, vec_set, and vec_ext + builtins. + (altivec_init_builtins): Init vec_init, vec_set, and vec_ext + builtins. + * config/rs6000/rs6000.h (rs6000_builtins): Add + ALTIVEC_BUILTIN_VEC_INIT_, ALTIVEC_BUILTIN_VEC_SET_, + ALTIVEC_BUILTIN_VEC_EXT_. + * config/rs6000/rs6000-protos.h: Declare new functions. + +2005-08-08 Jan Hubicka + + * i386.c (legitimate_pic_address_disp_p): Refuse GOTOFF in 64bit mode. + (legitimate_address_p): Refuse GOT and GOTOFF in 64bit mode. + * i386.md (movdi*): Use pic_32bit_operand. + * predicates.md (pic_32bit_operand): New. + +2005-08-08 Nathan Sidwell + + PR c++/21166 + * stor-layout.c (finalize_type_size): Undo DECL_PACKED when possible. + +2005-08-07 James A. Morrison + + * tree-vrp.c (simplify_div_or_mod_using_range): Use build2. + (test_for_singularity): Use fold_build2. + +2005-08-07 John David Anglin + + * pa64-regs.h (CONDITIONAL_REGISTER_USAGE): Fix loop upper bound. + +2005-08-07 Danny Smith + + * config/i386/cygming.h (SUBTARGET_ENCODE_SECTION_INFO): Define. + (COMMON_ASM_OP) Define. + * config/i386/i386.c (ix86_in_large_data_p): Add ATTRIBUTE_UNUSED + (ix86_encode_section_info): Likewise. + (TARGET_ENCODE_SECTION_INFO): Conditionally define as + SUBTARGET_ENCODE_SECTION_INFO. + +2005-08-06 Richard Henderson + + PR 21894 + * tree-nested.c (convert_local_reference): Save and restore val_only + around component_ref and friends. Clear walk_subtrees by default. + +2005-08-06 Peter O'Gorman + + PR 21366 + * gcc.c (process_command): Check the argument to -b has a dash. + * doc/invoke.texi: Update -b and -V docs. + +2005-08-06 James E Wilson + + * config/mips/cross64.h, config/mips/t-cross64: Delete. + +2005-08-06 Michael Matz + + * genattrtab.c (write_attr_get, write_attr_case): Use insn_code + member only if only one insn is associated with the value. + +2005-08-06 Nick Clifton + + * config/stormy16/stormy16.h (SYMBOL_FLAG_XSTORMY16_BELOW100): + New define. + (ASM_OUTPUT_LABELREF): Delete - it is no longer needed. + * config/stormy16/stormy16.c (xstormy16_below100_symbol): + Check symbol flags instead of symbol name mangling. + (xstormy16_asm_output_aligned_common): Likewise. Also + simplify code since the bss100_section cass is the only case + where the below100 code will be triggered. + (xstormy16_encode_section_info): Encode below100 attribute + using the SYMBOL_FLAG_XSTORMY16_BELOW100 instead of mangling + the name. + (xstormy16_strip_name_encoding): Delete - this function is no + longer needed. + (TARGET_STRIP_NAME_ENCODING): Undefine. + * config/stormy16/stormy16-protos.h: Delete prototype for + xstormy16_strip_name_encoding. + +2005-08-06 Kazu Hirata + + * Makefile.in, cfgexpand.c, cfgloop.h, cfgloopmanip.c, + config.gcc, ipa-cp.c, ipa-prop.c, ipa-prop.h, reg-stack.c, + tree-ssa-structalias.c, tree-vrp.c, value-prof.c, vec.h, + config/linux.h, config/alpha/alpha.h, config/alpha/linux.h, + config/alpha/predicates.md, config/arc/arc.h, + config/arm/arm.h, config/arm/ieee754-df.S, + config/arm/ieee754-sf.S, config/bfin/bfin.c, + config/bfin/bfin.h, config/c4x/c4x.h, config/crx/crx.c, + config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, + config/i386/i386.h, config/ia64/ia64.c, config/ia64/ia64.h, + config/m68hc11/m68hc11.h, config/mips/mips.c, + config/mips/mips.h, config/mips/openbsd.h, + config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.h, + config/pdp11/pdp11.h, config/rs6000/linux-unwind.h, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, + config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, + config/sparc/linux.h, config/sparc/linux64.h, + config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h, + doc/extend.texi, doc/gcov.texi, doc/install.texi, + doc/invoke.texi, doc/rtl.texi, doc/tm.texi: Fix comment/doc + typos. Follow spelling conventions. + +2005-08-06 Joseph S. Myers + + PR c/23113 + * stmt.c (warn_if_unused_value): Check TREE_NO_WARNING at start. + Don't handle NOP_EXPR, CONVERT_EXPR and NON_LVALUE_EXPR + specially. Check for side effects only for COND_EXPR. + * c-typeck.c (c_finish_stmt_expr): Mark statement expression + return with TREE_NO_WARNING. + +2005-08-06 Richard Sandiford + + PR rtl-optimization/23233 + * loop.c (combine_movables): Require the modes to be the same. + (move_movables): Remove handling of cases where the replacement + had a different mode to the original. + +2005-08-05 James A. Morrison + + PR tree-optimization/23128 + * tree-vrp.c (vrp_int_const_binop): Check if unsigned addition or + subtraction wrap, and set TREE_OVERFLOW if they do. + +2005-08-05 Richard Henderson + + PR 21728 + * tree-cfg.c (remove_bb): Transmute DECL_NONLOCAL labels into + FORCED_LABEL labels. + +2005-08-05 J"orn Rennecke + + PR middle-end/23135 + * reload.c (find_reloads_subreg_address): Pass down TYPE + unchanged. Change all callers except find_reloads_toplev. + +2005-08-05 Michael Matz + + * genattrtab.c (current_alternative_string): Remove. + (SIMPLIFY_ALTERNATIVE): Ditto. + (attr_alt_bit_p): Ditto. + (alternative_name): Make const char *. + (evaluate_eq_attr): Remove use of above things. + (simplify_test_exp): Ditto. + (simplify_test_exp ): Guard for insn_code < 0 . + (simplify_test_exp ): Correct typo (test 'right' not 'left'). + +2005-08-04 James E Wilson + + * config/ptx4.h, config/sol2.h, config/arm/freebsd.h, + config/arm/linux-elf.h, config/frv/frv.h, config/i386/freebsd.h, + config/i386/freebsd64.h, config/i386/netware.h, config/i386/sco5.h, + config/ia64/freebsd.h, config/rs6000/sysv4.h, config/sparc/freebsd.h + (LINK_SPEC): Delete useless %{Wl,*:%*} item. + +2005-08-04 Richard Henderson + + PR 21529 + * params.def (PARAM_SRA_MAX_STRUCTURE_COUNT): New. + * params.h (SRA_MAX_STRUCTURE_COUNT): New. + * tree-sra.c (decide_block_copy): Use it. Disable element copy + if we'd have to instantiate too many members. + +2005-08-04 Richard Henderson + + PR 21291 + * tree-outof-ssa.c (coalesce_asm_operands): New. + (coalesce_ssa_name): Use it. Split out ... + (coalesce_phi_operands, coalesce_result_decls): ... these. + +2005-08-04 Paul Brook + + * read-rtl.c (read_quoted_string): Break if EOF. + +2005-08-04 Andrew Pinski + + * tree.h (fold_build1): Change to macro and call fold_build1_stat. + (fold_build2): Likewise. + (fold_build3): Likewise. + (fold_build1_stat): New function prototype. + (fold_build2_stat): Likewise. + (fold_build3_stat): Likewise. + * fold-const.c (fold_build1): Rename to .. + (fold_build1_stat): this. Add MEM_STAT_DECL. Pass the mem stats + through to build1_stat. + (fold_build2): Rename to .. + (fold_build2_stat): this. Add MEM_STAT_DECL. Pass the mem stats + through to build2_stat. + (fold_build3): Rename to .. + (fold_build3_stat): this. Add MEM_STAT_DECL. Pass the mem stats + through to build3_stat. + +2005-08-04 David Edelsohn + Ian Lance Taylor + + * function.c (assign_stack_local_1): Do not correct stack slot + address if allocation size is smaller than mode size. + +2005-08-04 Diego Novillo + + PR 22037 + * tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename. + (tree_merge_blocks): Propagate anything allowed by + may_propagate_copy. + Clarify documentation. + * passes.c (execute_todo): If cleanup_tree_cfg invalidated the + SSA form, schedule an update if necessary. + +2005-08-04 Gerald Pfeifer + + * doc/install.texi (Binaries): Remove broken link to + Sinix/Reliant Unix binaries. + +2005-08-03 Richard Henderson + + PR 23221 + * function.c (stack_protect_epilogue): Export. + * tree.h (stack_protect_epilogue): Declare. + * calls.c (expand_call): Call it. + +2005-08-03 Eric Christopher + + * gcc.c (LINK_SSP_SPEC): Add fstack-protector-all. + * config/darwin.h (LINK_COMMAND_SPEC): Add link_ssp + spec. + +2005-08-04 Jan Hubicka + + * profile.c (branch_prob): Split edges with goto locus on them + to get proper line counts. + * tree-cfg.c (make_cond_expr_edges): Record user goto locuses, if any. + +2005-08-03 Paul Brook + + * function.c (assign_parms): Round current_function_args_size + to PARM_BOUNDARY, not STACK_BOUNDARY. + +2005-08-03 Geoffrey Keating + + * config/i386/i386.c (x86_elf_aligned_common) + (x86_output_aligned_bss): Don't try to use symbols that aren't defined. + +2005-08-03 Zdenek Dvorak + + PR tree-optimization/23157 + * tree-scalar-evolution.c (scev_const_prop): Unshare trees + before emitting them. + +2005-08-03 Volker Reichelt + + PR tree-optimization/19899 + * Makefile.in (tree-scalar-evolution.o): Add real.h. + * tree-scalar-evolution.c: Include real.h. + (add_to_evolution): Build constant -1 of correct type. + +2005-08-03 Jan Hubicka + + * cfgloop.h (DLTHE_FLAG_COMPLETTE_PEEL): New flag. + * cfgloopmanip.c (duplicate_loop_to_header_edge): Special case + profile updating for complette unrolling. + * loop-unroll.c (peel_loop_completely): Use it. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. + (tree_unroll_loops_completely): Disable code growing unrolling of cold + loops. + +2005-08-03 Paul Brook + + * combine.c (can_change_dest_mode): New function. + (try_combine, simplify_set): Use it. + +2005-08-03 Eric Botcazou + + * config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Only force + TFmode to BLKmode. + +2005-08-03 Gerald Pfeifer + + * doc/install.texi (Specific): Adjust link to openavr.org. + (Specific): Remove broken reference to GCC 2.8.1 for OS/2. + (Binaries): Adjust HP-UX Porting Center link. + (Binaries): Adjust Free Software Foundation ordering link. + +2005-08-03 Andrew Pinski + + * convert.c (convert_to_integer): Use fold_build1 instead of + build1 when converting an integer to an integer. + +2005-08-02 Richard Henderson + + * combine.c (combine_instructions): Don't use reg_equal/equiv + results if the mode doesn't match. + +2005-08-02 Mark Mitchell + + * config/i386/t-mingw32 (NATIVE_SYSTEM_HEADER_DIR): Set it. + * doc/fragments.texi (NATIVE_SYSTEM_HEADER_DIR): Document it. + +2005-08-02 Richard Henderson + + PR 23196 + * explow.c (memory_address): Remove special-case for + virtual_stack_vars_rtx and virtual_incoming_args_rtx. + +2005-08-02 Diego Novillo + + PR 23164 + * tree-cfgcleanup.c (cleanup_tree_cfg): Do not limit the + number of calls to cleanup_tree_cfg_1. + +2005-08-02 Martin Reinecke + + * doc/invoke.texi: document file extensions .F90 and .F95 + +2005-08-02 Richard Guenther + + * fold-const.c (tree_expr_nonnegative_p): frexp(x, &e) is + positive if its first argument is positive. + +2005-08-02 Richard Guenther + + PR tree-optimization/23177 + * tree-ssa-operands.c (get_tmr_operands): Use get_expr_operands + on TMR_TAG. + +2005-08-02 James A. Morrison + + PR tree-optimization/23129 + * tree-vrp.c (extract_range_from_binary_expr): Set value range to + varying for divisions with anti-ranges. + +2005-08-02 Jan Hubicka + + * tree-ssa-dom.c (thread_across_edge): Remove updating here. + * tree-ssa-threadupdate.c (thread_block): Add it here. + +2005-08-01 James E Wilson + + * config/mips/mips.c (mips_encode_section_info, mips_attribute_table, + TARGET_ENCODE_SECTION_INFO, TARGET_ATTRIBUTE_TABLE): New. + * config/mips/mips.h (SYMBOL_FLAG_LONG_CALL, SYMBOL_REF_LONG_CALL_P): + New. + * config/mips/predicates.md (const_call_insn_operand): Add check for + SYMBOL_REF_LONG_CALL_P. + * doc/extend.texi (long_call): Document the new attribute. + +2005-08-01 Ian Lance Taylor + Richard Henderson + + * Makefile.in (RTL_BASE_H): Add real.h. + * real.h (REAL_VALUE_FROM_CONST_DOUBLE): Use structure copy + instead of memcpy. + * emit-rtl.c (const_double_from_real_value): Likewise; use rtx.u.rv + directly. + * rtl.c (rtl_check_failed_code_mode): New. + * rtl.h (struct rtx_def): Add u.rv. + (XCMWINT, XCNMPRV): New. + (CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH): Use XCMWINT. + (CONST_DOUBLE_REAL_VALUE): Use XCNMPRV; constify. + +2005-08-01 Richard Henderson + + * dwarf2out.c (mem_loc_descriptor): Use XEXP, not SUBREG_REG, + with auto-inc codes. + + * config/alpha/predicates.md (and_operand): Test mode of CONST_DOUBLE. + +2005-08-01 Jan Hubicka + + * i386-protos.h (asm_preferred_eh_data_format): Declare. + * i386.c: Include dwarf2.h + (asm_preferred_eh_data_format): New. + * i386.h (ASM_PREFERRED_EH_DATA_FORMAT): Move offline. + +2005-08-01 Ian Lance Taylor + + * config/host-linux.c (linux_gt_pch_get_address): Add new name + randomize_va_space for virtual address randomization control. + +2005-08-01 Steven Bosscher + + * common.opt (flag_ipa_cp): Put in right place to maintain + alphabetic sort. + +2005-08-01 Jan Hubicka + + * profile.c (compute_value_histograms): Fix thinko. + * value-prof.c: Include toplev.h + (check_counter): New function. + (tree_divmod_fixed_value_transform, tree_mod_pow2_value_transform, + tree_mod_subtract_transform): Add sanity check. + +2005-08-01 Richard Guenther + + PR tree-optimization/23133 + * tree-ssa-math-opts.c (execute_cse_reciprocals): Walk + current functions parameter decls to find defs to cse + reciprocals of. + +2005-08-01 Richard Guenther + + PR tree-optimization/23109 + * tree-ssa-math-opts.c (execute_cse_reciprocals_1): + If trapping math is in effect, use post-dominator information + to check if we'd in any case reach a trapping point before + doing the reciprocal insertion. + (execute_cse_reciprocals): Compute post-dominators, if necessary. + * tree-ssa-loop-im.c (determine_invariantness_stmt): RDIV + expressions are invariant only if trapping math is not in effect. + +2005-08-01 Razya Ladelsky + + * cgraph.h (update_call_expr, cgraph_copy_node_for_versioning, + cgraph_function_versioning): New declarations. + * cgraphunit.c: Add include to ipa-prop.h. + (update_call_expr, cgraph_copy_node_for_versioning, + cgraph_function_versioning): New functions. + * integrate.c (copy_decl_for_inlining): Remove. + * ipa-prop.h (ipa_replace_map): New struct. + (struct ipa_node): Add ipcp_orig_node, count_scale, new fields. + * ipa-cp.c (ipcp_method_orig_node, ipcp_method_is_cloned, + ipcp_method_set_orig_node, ipcp_cloned_create, ipcp_method_get_scale, + ipcp_method_set_scale, ipcp_method_compute_scale, ipcp_after_propagate, + ipcp_iterate_stage, ipcp_method_scale_print, + ipcp_profile_mt_count_print, ipcp_profile_cs_count_print, + ipcp_profile_edge_print, ipcp_profile_bb_print , ipcp_profile_print, + ipcp_replace_map_create, ipcp_redirect, ipcp_update_callgraph, + ipcp_update_bb_counts, ipcp_update_profiling, + ipcp_update_edges_counts): New functions. + (ipcp_method_cval_init): Remove restriction regarding local methods. + (ipcp_init_stage): Add ipcp_method_compute_scale. + (ipcp_insert_stage): Add versioning. + (ipcp_structures_print): Add ipcp_method_scale_print. + (ipcp_driver): Dump profiling info. + * Makefile.in: Remove integrate.h dependency from tree-inline.o. + Add ipa-prop.h dependency to tree-inline.o and cgraphunit.o. + * tree-inline.c: Remove include to integrate.h, Add include ipa-prop.h. + (struct inline_data): Add versioning_p, ipa_info, new fields. + (remap_decl, mark_local_for_remap_r, setup_one_parameter, + declare_return_variable): Replace calls to copy_decl_for_inlining with + copy_decl_for_dup. + (copy_body_r, copy_bb, copy_cfg_body, copy_tree_r, inlining_p): Add + versioning support. + (copy_decl_for_dup): Rename from copy_decl_for_inlining. + Add argument VERSIONING. + (copy_arguments_for_versioning, copy_static_chain, + function_versionable_p, tree_versionable_function_p, + tree_function_versioning, replace_ref_tree): New functions. + * tree-inline.h: Include varray.h. + (tree_versionable_function_p, tree_function_versioning, + tree copy_decl_for_dup): New declarations. + +2005-08-01 Razya Ladelsky + + * ipa-cp.c: New file. Contains IPCP specific functionality. + * ipa-prop.h: New file. Contains structures/definitions that can be + used by several interprocedural data flow optimizations (and also IPCP). + * ipa-prop.c: New file. + * Makefile.in: Add ipa-cp.c, ipa-prop.h, ipa-prop.c. + * common.opt: Add ipa-cp flag. + * timevar.def: Add IPCP optimization. + * tree-optimize.c (init_tree_optimization_passes): Schedule + pass_ipa_cp. + * tree-pass.h (pass_ipa_cp): Declare. + +2005-08-01 Kazu Hirata + + * dwarf2out.c, fold-const.c, ipa-type-escape.c, + loop-invariant.c, predict.c, predict.def, reload1.c, reorg.c, + tree-sra.c, config/arm/arm.c, config/crx/crx.c, + config/i386/i386.c, config/mips/mips.h, + config/rs6000/rs6000.h, config/sh/sh.c, + config/stormy16/stormy16.c: Fix comment typos. + +2005-08-01 Joseph S. Myers + + PR c/22311 + * c-typeck.c (build_binary_op): Use common_type wrapper on + shortened types. + (common_type): Update comment. + +2005-07-31 Steven Bosscher + + PR target/23095 + * common.opt (flag_gcse_after_reload): Don't initialize to 2. + (flag_rerun_cse_after_loop): Initialize this to 2 instead. + * postreload-gcse.c (hash_scan_set): Do not consider stack regs. + +2005-07-31 Jan Hubicka + + * pretty-print.h (pp_widest_integer): New macro. + * tree-pretty-print.c (dump_bb_header): Print BB frequencies and + counts. + +2005-07-31 Jan Hubicka + + * output.h (enum section_category): Export from varasm.c + (categorize_decl_for_section): Likewise. + * varasm.c (enum section_category): Kill. + (categorize_decl_for_section): Make global. + * i386-protos.h (x86_output_aligned_bss, x86_elf_aligned_common): + Declare. + * i386.c (ix86_section_threshold): New static variable. + (ix86_in_large_data_p, ix86_encode_section_info, + x86_64_elf_unique_section, + x86_64_elf_select_section): New functions. + (TARGET_ENCODE_SECTION_INFO): Define + (override_options): Enable medium model for PIC. + (ix86_expand_prologue): Expand gen_set_got_rex64. + (legitimate_constant_p): Handle new UNSPECs. + (legitimate_pic_address_disp_p): Likewise. + (legitimize_pic_address): Lower MEDIUM model addressing. + * i386.h (PIC_OFFSET_TABLE_REGNUM): Set for medium model PIC. + (enum cmodel): Add MEDIUM_PIC. + (SYMBOL_REF_FAR_ADDR_P): New macro. + (SYMBOL_FLAG_FAR_ADDR): New flag. + * i386.md (movdi): Support medium model. + (set_got_rex64): New pattern. + * i386.opt (mlarge-data-threshold): New flag. + * predicates.md (zext_operand/sext_operand): Deal with medium model. + * x86-64.h (ASM_OUTPUT_ALIGNED_BSS): Use x86_output_aligned_bss. + (ASM_OUTPUT_ALIGNED_COMMON, TARGET_ASM_SELECT_SECTION, + TARGET_ASM_UNIQUE_SECTION): New. + + * invoke.texi (-mlarge_data_threshold): Document + +2005-07-31 Jan Hubicka + + * tree-outof-ssa.c (coalesce_ssa_name): Use coalesce_cost. + (coalesce_vars): Likewise. + * tree-ssa-live.c (coalesce_cost): New. + (build_tree_conflict_graph): Use coalesce_cost. + * tree-ssa-live.h (coalesce_cost): Declare. + +2005-07-30 Richard Earnshaw + + * arm.md (all peepholes for post-increment operations): Delete. + (strqi_preinc, strqi_predec, loadqi_preinc, loadqi_predec) + (loadqisi_preinc, loadqisi_predec, strsi_preinc, strsi_predec) + (loadsi_preinc, loadsi_predec, strqi_shiftpreinc, strqi_shiftpredec) + (loadqi_shiftpreinc, loadqi_shiftpredec, strsi_shiftpreinc) + (strsishift_predec, loadsi_shiftpreinc, loadsi_shiftpredec): Delete. + +2005-07-30 James A. Morrison + + * fold-const.c (tree_expr_nonnegative_p): Always return true for + non-integral types. + +2005-07-29 Wolfgang Bangerth + + PR target/22582 + * doc/invoke.texi: Document -rdynamic. + +2005-07-30 Joseph S. Myers + + PR c/23143 + * c-parser.c (c_parser_parms_list_declarator): Call + mark_forward_parm_decls. + * c-decl.c (merge_decls): Only check DECL_IN_SYSTEM_HEADER for + decls with visibility structure. + +2005-07-30 Paul Brook + + * config/arm/arm.c (arm_coproc_mem_operand): Fix inaccurate comment. + +2005-07-30 Paul Brook + + * config/arm/arm-protos.h (arm_canonicalize_comparison): Update + prototype. + * config/arm/arm.c (arm_canonicalize_comparison): Use correct limit + value for mode. + * config/arm/arm.h (CANONICALIZE_COMPARISON): Pass mode argument. + +2005-07-29 Joseph S. Myers + + PR c/529 + * c-decl.c (warn_if_shadowing): Don't check for PARM_DECL in + nested function declarators. + (pushdecl): Don't call warn_if_shadowing for PARM_DECL. + (grokparms): Call warn_if_shadowing for parameters used within the + parameter list. + (store_parm_decls_newstyle): Call warn_if_shadowing for parameters + not used within the parameter list. + (store_parm_decls_oldstyle): Call warn_if_shadowing for parameters. + +2005-07-30 Jan Hubicka + + * expr.c (expand_expr_real_1): Do not load mem targets into register. + * i386.c (ix86_fixup_binary_operands): Likewise. + (ix86_expand_unary_operator): Likewise. + (ix86_expand_fp_absneg_operator): Likewise. + * optabs.c (expand_vec_cond_expr): Validate dest. + +2005-07-29 Joseph S. Myers + + PR c/21720 + * real.c (real_from_string): Also set last bit if there is a + nonzero hex digit beyond GCC's internal precision after ".". + +2005-07-29 David Edelsohn + + * config/rs6000/altivec.md: Convert UNSPEC numerical values to + define_constants. Change duplicate values to unassigned numbers. + Change UNSPEC_SUBS to UNSPEC_VSUBS. + (*altivec_vspltsf): New. + (altivec_vperm_v4sf): Delete. + (altivec_vperm_): Use mode macro V. + (altivec_vsldoi_): Convert to mode macro pattern. + (altivec_predicate_v4sf): Delete. + (altivec_predicate_): Use mode macro V. + (*altivec_lvesfx): New. + (*altivec_stvesfx): New. + (vec_realign_load_v4sf): Delete. + (vec_realign_load_): Use mode macro V. + * config/rs6000/rs6000.c (generate_set_vrsave): Use + UNSPECV_SET_VRSAVE. + +2005-07-29 Mark Mitchell + + PR bootstrap/23131 + * configure.ac (SYSTEM_HEADER_DIR): Avoid setting to empty + string. + * configure: Regenerated. + +2005-07-29 Paul Brook + + * doc/install.texi: Add link to GFortran binaries wiki page. + +2005-07-29 David Ung + + * config/mips/mips.c (mips_cpu_info_table): Add 5kf to the table. + (mips_rtx_cost_data): Add costs for 5kc and 5kf. + * config/mips/mips.h (processor_type): Add PROCESSOR_5KF. + * config/mips/mips.md (cpu): Add 5kf name. + (includes): Includes 5k.md. + * config/mips/5k.md: New DFA pipeline for the 5kc/5kf. + * doc/invoke.texi (MIPS Options): Updated cpu name supported with + -march flag. + +2005-07-29 Diego Novillo + + PR 22550 + * tree-cfgcleanup.c (cleanup_tree_cfg_1): Extract from ... + (cleanup_tree_cfg): ... here. + Call cleanup_tree_cfg_1 until there are no more cleanups to + do. + +2005-07-29 James A. Morrison + + * tree-vrp.c (compare_range_with_value): Return true or false + for ~[VAL_1, VAL_2] OP VAL if VAL_1 <= VAL <= VAL_2 for NE_EXPR and + EQ_EXPR respectively. + +2005-07-29 Kazu Hirata + + * cfg.c, tree-complex.c, config/frv/frv.c, config/i386/i386.c: + Fix comment typos. + +2005-07-29 Diego Novillo + + * tree-ssa-dom.c (struct opt_stats_d): Add field num_iterations. + (tree_ssa_dominator_optimize): Increment it. + (dump_dominator_optimization_stats): Print it. + +2005-07-29 Richard Earnshaw + Steven Bosscher + + PR rtl-optimization/23117 + * sched-rgn.c (add_branch_dependences): Handle COND_EXEC correctly + when head == tail. Tidy comment. + +2005-07-28 Richard Henderson + + * cse.c (exp_equiv_p): Special case CONST_DOUBLE. + * cselib.c (rtx_equal_for_cselib_p): Likewise. + * jump.c (rtx_renumbered_equal_p): Likewise. + * loop.c (rtx_equal_for_loop_p): Tidy and special case PC, CC0, + CONST_INT and CONST_DOUBLE. + (rtx_equal_for_prefetch_p): Likewise, plus LABEL_REF. + * reload.c (operands_match_p): Special case CONST_INT and + CONST_DOUBLE; check mode earlier. + +2005-07-29 Joseph S. Myers + + PR c/22240 + * c-typeck.c (convert_for_assignment): Do not check + DECL_IN_SYSTEM_HEADER on NULL fundecl. + +2005-07-29 Joseph S. Myers + + PR c/22192 + * c-typeck.c (composite_type): Prefer constant size arrays to + VLAs. + +2005-07-29 Joseph S. Myers + + PR c/21720 + * real.c (real_from_string): Set last bit if there is a nonzero + hex digit beyond GCC's internal precision. + +2005-07-28 Richard Henderson + + PR rtl-opt/22619 + * cfgcleanup.c (try_forward_edges): Watch out for end of + insn chain. + +2005-07-28 James E Wilson + + PR c/23106 + * doc/invoke.texi (Wstrict-aliasing=2): Fix misleading wording. + +2005-07-28 Jan Hubicka + + * Makefile.in (rtl-profile.o): Kill all traces of it. + * common.opt (fspeculative-prefetching, ftree-based-profiling): Kill. + * coverage.h (rtl_coverage_counter_ref): Kill. + * opts.c (flag_speculative_prefetching_set): Kill. + (flag_loop_optimize_set): New. + (common_handle_option): Disable loop optimizer when profiling; + do not handle speculative prefetching. + * passes.c (init_optimization_passes): Replace pass_profiling combo + by branch_prob pass. + * profile.c (compute_value_histograms): Update for simplified value + profiles. + (rtl_register_profile_hooks): Kill. + (pass_profiling): Kill. + (rest_of_handle_branch_prob): Do not profile. + * toplev.c (process_options): Remove speculative prefetching. + * toplev.h (flag_tree_based_profiling): Kill. + * tree-profile.c (prepare_instrumented_value, + tree_gen_interval_profiler, tree_gen_pow2_profiler, + tree_gen_one_value_profiler, do_tree_profiling): Update for + simplified datastructures. + * value-prof.c: Add comment that speculative prefetching was dropped; + update rest of file for simplified datastructures. + (NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX, + rtl_divmod_values_to_profile, insn_prefetch_values_to_profile, + find_mem_reference_1, find_mem_reference_2, find_mem_reference, + rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2, + rtl_mod_subtract, gen_speculative_prefetch, + rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform, + rtl_mod_subtract_transform, speculative_prefetching_transform): Kill. + (gate_handle_value_profile_transformations, + rest_of_handle_value_profile_transformations, + pass_value_profile_transformations): Kill. + * value-prof.h (histogram_value_t): Remove IL based unions. + (rtl_register_value_prof_hooks, rtl_register_profile_hooks, + rtl_profile_hooks): Remove hooks. + + * invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill. + + * cgraph.c (cgraph_clone_edge): New UPDATE_ORIGINAL argument. + (cgraph_clone_node): Likewise. + * cgraph.h (cgraph_clone_edge): Update prototype. + (cgraph_clone_node): Likewise. + * ipa-inline.c (cgraph_clone_inlined_nodes): Update call of + cgraph_clone_node. + (lookup_recursive_calls): Consider profile. + (cgraph_decide_recursive_inlining): Fix updating; use new + probability argument; use profile. + * params.def (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY): New. + * tree-inline.c (copy_bb): Update clal of clone_edge. + * tree-optimize.c (tree_rest_of_compilation): UPdate cal of clone_node. + + * invoke.texi (min-inline-recursive-probability): Document. + +2005-07-28 Gerald Pfeifer + + * doc/install.texi (Configuration): Update Valgrind homepage. + +2005-07-28 Richard Henderson + + PR middle-end/21362 + * cfgrtl.c (rtl_merge_blocks): Call maybe_remove_eh_handler on + labels we want to delete. + (cfg_layout_merge_blocks): Likewise. + +2005-07-28 Richard Henderson + + PR target/17692 + * config/i386/i386.c (ix86_split_sse_movcc): Emit DELETED note + when expanding to nothing. + +2005-07-28 Josh Conner + + * ipa-inline.c (update_caller_keys): Fix estimated_growth caching. + (cgraph_decide_inlining_of_small_functions): Likewise. + +2005-07-28 Josh Conner + + * ipa-inline.c (cgraph_edge_badness): Update comments. Invert shift + direction of badness if negative. + (cgraph_default_inline_p): Add reason to parameters, and assign it + a value. + (cgraph_decide_inlining_of_small_functions): New parameter in call + to cgraph_default_inline_p. + (cgraph_decide_inlining_incrementally): Likewise. + * cgraphunit.c (decide_is_function_needed): Likewise. + * cgraph.h (cgraph_default_inline_p): Likewise. + +2005-07-28 Volker Reichelt + + * builtins.c: Fix comment typo(s). + * genautomata.c: Likewise. + * gimplify.c: Likewise. + * tree-dfa.c: Likewise. + * tree-flow-inline.h: Likewise. + * tree-into-ssa.c: Likewise. + * tree-ssa-alias.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-copy.c: Likewise. + * tree-ssa-dce.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa-operands.c: Likewise. + * tree-tailcall.c: Likewise. + * tree-vectorizer.c: Likewise. + * tree-vrp.c: Likewise. + * tree.c: Likewise. + +2005-07-28 Jeff Law + + * tree-vrp.c (test_for_singularity): Extracted from ... + (simplify_cond_using_ranges): Attempt to simplify a relational + test to NE_EXPR. Dump information when a COND_EXPR is simplified. + +2005-07-28 Dorit Nuzman + + PR tree-optimization/22506 + * tree-vectorizer.c (update_phi_nodes_for_guard2): Skip loop-closed + phis whose argument is constant. + +2005-07-28 J"orn Rennecke + + PR rtl-optimization/18992 + Back out this patch: + 2003-10-08 John David Anglin + PR optimization/12142 + * cse.c (count_reg_usage): In a SET with a REG SET_DEST, count the + uses of the register in the SET_SRC. Remove unnecessary argument. + + Replace it with this: + * cse.c (count_reg_usage): In INSN, JUMP_INSN and CALL_INSN cases, + if flag_non_call_exceptions is set and the insn may trap, pass + pc_rtx as dest for recursion. + In SET_SRC part of SET case, if dest is already set, pass it down + unchanged. + +2005-07-28 Jan Hubicka + + * cfg.c (update_bb_profile_for_threading): Use RDIV. + (scale_bbs_frequencies_int): Likewise, assert for possible overflow. + (scale_bbs_frequencies_gcov_type): Be more curefull about overflows and + roundoff errors. + * tree-cfg.c (tree_duplicate_sese_region): Use counts for updating + profile when available. + +2005-07-28 Jan Beulich + + * config/ia64/ia64.c (ia64_load_pair_ok): New. + (ia64_print_operand): Describe and handle 'X'. + (ia64_register_move_cost): Also handle FP_REGS. + (ia64_preferred_reload_class): Likewise. + (ia64_secondary_reload_class): Likewise. + (ia64_dependencies_evaluation_hook): New local variable c. Initialize + it. Also check for ITANIUM_CLASS_FLDP. + * config/ia64/ia64.h (FP_REGNO_P): New. + (HARD_REGNO_MODE_OK): Remove explusion of TImode. + (reg_class): Add FP_REGS. + (REG_CLASS_NAMES): Adjust for it. + (REG_CLASS_CONTENTS): Likewise. + (REGNO_REG_CLASS): Use FP_REGS where appropriate. + (REG_CLASS_FROM_LETTER): Handle 'x'. + (CLASS_MAX_NREGS): Handle FP_REGS. + (MEMORY_MOVE_COST): Likewise. + * config/ia64/ia64.md (itanium_class): Add fldp. + (type): Handle fldp. + (movti_internal): More allowable operand combinations. Use ldfp8 when + splitting unnecessary. Remove predicable attribute. Adjust + itanium_class attribute. + (smuldi3_highpart): Remove outdated comment. + (mulditi3, umulditi3, rotlti3): New expanders. + (addti3, subti3, mulditi3_internal, umulditi3_internal, negti2, rotlti3_internal): New insns. + (absti2): Disabled new insn for future reference. + Respective new splitters. + * config/ia64/itanium1.md (1_fldp, 1b_fldp): New insn reservations. + * config/ia64/itanium2.md (2_fldp, 2b_fldp): Likewise. + * config/ia64/ia64-protos.h (ia64_load_pair_ok): New. + +2005-07-25 James A. Morrison + + PR rtl-optimization/23047 + * simplify-rtx.c (simplify_const_relational_operation): Respect + flag_wrapv for comparisons with ABS. + +2005-07-27 James A. Morrison + + PR tree-optimization/22493 + * tree-vrp.c (extract_range_from_unary_expr): Deal with -fwrapv and + VR_ANTI_RANGEs properly for NEGATE_EXPRs and ABS_EXPRs. + +2005-07-27 Aldy Hernandez + + * config/frv/frv.opt (moptimize-membar): New. + + * doc/invoke.texi: Document -moptimize-membar and its inverse. + + * config/frv/frv.h: Remove machine_function definition. + + * config/frv/frv.c (struct frv_io): New. + (struct machine_function): Moved from frv.h. Add has_membar_p. + (frv_same_doubleword_p, frv_io_fixed_order_p, frv_io_union) + (frv_extract_membar, frv_io_check_address, frv_io_handle_set) + (frv_io_handle_use_1, frv_io_handle_use, frv_optimize_membar_local) + (frv_optimize_membar_global, frv_optimize_membar): New functions. + (frv_reorg): Call frv_optimize_membar when appropriate. + (bdesc_loads, bdesc_stores): Use the membar code as the icode field. + (frv_expand_builtin): Adjust calls accordingly. + (frv_io_address_cookie): New function. + (frv_expand_load_builtin, frv_expand_store_builtin): Emit a normal + load or store rather than a special insn. Add ccnstant address and + io-type operands to the membar. + (frv_ifcvt_modify_tests): Unsign regno. + (frv_ifcvt_modify_tests): Same. + + * config/frv/frv.md: Remove UNSPEC_BUILTIN_{LOAD,STORE}. Change + UNSPEC_OPTIONAL_MEMBAR constant. + (builtin_read_): Delete. + (builtin_write_): Delete. + ("optional_membar_"): Add operand. + + * testsuite/gcc.target/frv/all-builtin-read8.c: Delete. + * testsuite/gcc.target/frv/all-builtin-read16.c: Delete. + * testsuite/gcc.target/frv/all-builtin-read32.c: Delete. + * testsuite/gcc.target/frv/all-builtin-read64.c: Delete. + * testsuite/gcc.target/frv/all-builtin-write8.c: Delete. + * testsuite/gcc.target/frv/all-builtin-write16.c: Delete. + * testsuite/gcc.target/frv/all-builtin-write32.c: Delete. + * testsuite/gcc.target/frv/all-builtin-write64.c: Delete. + * testsuite/gcc.target/frv/all-read-write-1.c: New. + +2005-07-28 Kaz Kojima + + * df.c (df_uses_record): Handle SCRATCH. + +2005-07-28 Steven Bosscher + + PR debug/20161 + * passes.c (rest_of_decl_compilation): If decl is a type and + we have encountered errors, don't emit debug information. + +2005-07-27 Kenneth Zadeck + + * params.def: Fixed comment. + +2005-07-27 Bjoern Haase + + PR target/19885 + * config/avr/avr.c (TARGET_ASM_ALIGNED_SI_OP): Add. + (TARGET_ASM_UNALIGNED_HI_OP): Add. + (TARGET_ASM_UNALIGNED_SI_OP): Add. + +2005-07-27 Steven Bosscher + + PR c++/22003 + * varasm.c (assemble_start_function): Don't do anything that may + require a CFG if the current function is a thunk. + +2005-07-25 Geoffrey Keating + + * doc/install.texi (Prerequisites): Mention that perl is needed + to do export control in libstdc++ targetting Darwin. + +2005-07-27 Steven Bosscher + + PR rtl-optimization/17808 + * sched-deps.c (sched_get_condition): Enable #if 0'ed code. + (sched_insns_conditions_mutex_p): Split out from... + (add_dependence): ...here. But don't call it from here. + (add_dependence_list): Check sched_insns_conditions_mutex_p + before calling add_dependence. + (add_dependence_list_and_free): Likewise. + (fixup_sched_groups): Likewise. + (sched_analyze_1): Likewise. + (sched_analyze_2): Likewise (and replace a "0" with REG_DEP_TRUE). + (sched_analyze): Likewise. + (sched_analyze_insn): Likewise. + * sched-ebb.c (add_deps_for_risky_insns): Likewise. + * sched-rgn.c (add_branch_dependences): Likewise. Also, add + dependencies on all COND_EXEC insns to jumps ending basic blocks + when doing intrablock scheduling. + * sched-int.h (sched_insns_conditions_mutex_p): Add prototype. + +2005-07-27 Jeff Law + + * tree-vrp.c (vrp_meet): Intersect the equivalency sets when + meeting a VR_ANTI_RANGE with a VR_RANGE. When intersecting + equivalency sets, correctly handle the case were vr0 has an + equivalency set, but vr1 does not. + +2005-07-27 Dorit Nuzman + + PR tree-optimization/23073 + * tree-vect-analyze.c (vect_analyze_data_refs_alignment): Call + vect_print_dump_info before fprintf. + +2005-07-27 Zdenek Dvorak + + PR tree-optimize/22348 + * tree-ssa-loop-niter.c (number_of_iterations_cond): + Fold the partial computation. + +2005-07-27 Zdenek Dvorak + + PR tree-optimization/22325 + * tree-flow.h (compute_phi_arg_on_exit, force_expr_to_var_cost): + Declare. + * tree-scalar-evolution.c (scev_const_prop): Add generic final + value replacement. + * tree-ssa-loop-ivopts.c (force_expr_to_var_cost): Split from ... + (force_var_cost): ... this function. + (compute_phi_arg_on_exit): Export. + +2005-07-27 Zdenek Dvorak + + PR tree-optimization/20773 + * tree-ssa-loop-ch.c (copy_loop_headers): Select the correct latch + edge. + +2005-07-27 Richard Guenther + + * tree-ssa-structalias.c (push_fields_onto_fieldstack): + Avoid pushing again if current struct contains only + fields we decomposed. + +2005-07-27 Jan Hubicka + + PR tree-optimization/22574 + * cgraph.c (cgraph_function_body_availability): Unanalyzed bodies are + not available. + + * tree-tailcall.c (decrease_profile): New function. + (eliminate_tail_call): Use it. + + * cgraphunit.c (cgraph_function_and_variable_visibility): Set + visibility flags correctly in whole program mode. + +2005-07-26 Steve Ellcey + + PR rtl-optimization/22472 + * config/pa/pa.h (HARD_REGNO_RENAME_OK): Define. + +2005-07-26 Steven Bosscher + + PR tree-optimization/22504 + * tree-complex.c (expand_complex_addition): Use 'code' instead + of MINUS_EXPR for (VARYING, ONLY_IMAG) and (ONLY_IMAG, VARYING). + +2005-07-26 Aldy Hernandez + + * config.gcc (cpu_type): Add frv case. + (with_cpu): Add frv400-*-*linux* and frv550-*-*linux* cases. + (supported_defaults): Add fr550 case. + +2005-07-26 Diego Novillo + + PR 22591 + * tree-ssa-alias.c (may_alias_p): Remove shortcut that tests + whether a pointer of type T * may point to objects of type T *. + +2005-07-26 DJ Delorie + + * configure: Regenerate. + +2005-07-26 Dale Johannesen + + * postreload-gcse.c (alloc_mem): Start CUID numbering at 1. + +2005-07-26 Mark Mitchell + + * doc/install.texi (--with-build-sysroot): Fix grammatical error. + Clarify use of "build" in name. + +2005-07-26 Aldy Hernandez + + * doc/extend.texi (Raw read/write Functions): New section. + * testsuite/gcc.target/frv/all-builtin-read8.c: New. + * testsuite/gcc.target/frv/all-builtin-read16.c: New. + * testsuite/gcc.target/frv/all-builtin-read32.c: New. + * testsuite/gcc.target/frv/all-builtin-read64.c: New. + * testsuite/gcc.target/frv/all-builtin-write8.c: New. + * testsuite/gcc.target/frv/all-builtin-write16.c: New. + * testsuite/gcc.target/frv/all-builtin-write32.c: New. + * testsuite/gcc.target/frv/all-builtin-write64.c: New. + * config/frv/frv.c: Add bdesc_loads global. + Add bdesc_stores global. + (frv_init_builtins): Add support for __builtin_{read/write}*. + (frv_volatile_memref): New. + (frv_expand_load_builtin): New. + (frv_expand_store_builtin): New. + * config/frv/frv.h (frv_builtins): Add FRV_BUILTIN_SCAN, + FRV_BUILTIN_READ8, FRV_BUILTIN_READ16, FRV_BUILTIN_READ32, + FRV_BUILTIN_READ64, FRV_BUILTIN_WRITE8, FRV_BUILTIN_WRITE16, + FRV_BUILTIN_WRITE32, FRV_BUILTIN_WRITE64. + * config/frv/frv.md (unspecs): Add UNSPEC_BUILTIN_LOAD, + UNSPEC_BUILTIN_STORE, UNSPEC_OPTIONAL_MEMBAR. + (builtin_read_): New. + (builtin_write_): New. + (builtin_write64): New. + (optional_membar_): New. + +2005-07-26 J"orn Rennecke + + * emit-rtl.c (gen_lowpart_common): Compare size of MODE in bits + (rather than units) against HOST_BITS_PER_WIDE_INT. + +2005-07-26 Kazu Hirata + + * ipa-pure-const.c, ipa-reference.c, ipa-reference.h, + ipa-type-escape.c, ipa-type-escape.h, ipa-utils.c, + ipa-utils.h, treestruct.def, config/crx/crx-protos.h, + config/crx/crx.c, config/crx/crx.h, config/crx/crx.md: Update + FSF address. + + * calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c, + tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h, + config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix + comment typos. + * doc/c-tree.texi, doc/tree-ssa.texi: Fix typos. + +2005-07-26 Richard Guenther + + PR tree-optimization/22486 + * fold-const.c (fold_unary): Fold away useless component + references of the form (T *)&T.x, if the address + doesn't change. + +2005-07-25 James E Wilson + + * dwarf2out.c (add_call_src_coords_attributes): New. + (gen_inlined_subroutine_die): Call it. + (maybe_emit_file, init_file_table): Add comments. + (prune_unused_types_walk_attribs): Pass DW_AT_call_file through + maybe_emit_file. + * tree-inline.c (remap_block): Copy BLOCK_SOURCE_LOCATION. + (expand_call_inline): Set BLOCK_SOURCE_LOCATION. + * tree.h (BLOCK_SOURCE_LOCATION): New. + (struct tree_block): New field locus. + +2005-07-26 Andreas Schwab + + PR rtl-optimization/23043 + * postreload-gcse.c (eliminate_partially_redundant_load): Fix typo + when allocating a struct unoccr. + +2005-07-25 Richard Henderson + + PR 22626 + * tree-complex.c (gate_no_optimization): True if errors. + * Makefile.in (tree-complex.o): Update dependencies. + +2005-07-25 Aldy Hernandez + + * config/frv/predicates.md (integer_register_operand): Use + GPR_AP_OR_PSEUDO_P. + +2005-07-25 Andrew Pinski + + PR tree-opt/22484 + * tree-ssa-ccp.c (fold_stmt_inplace): Strip useless type conversions + after fold. + * tree-ssa-propagate.c (set_rhs): Reject invalid conditional operands. + +2005-07-25 Andrew Pinski + + * tree-ssa-reassoc.c (reassociate_expr): Allow scaler floating point + types when flag_unsafe_math_optimizations is true. + +2005-07-25 Mark Mitchell + + * gcc.c (option_map): Add --sysroot. + (process_command): Handle --sysroot. + (display_help): Document it. + * doc/cppopts.tex (-isysroot): Document. + * doc/invoke.texi (--sysroot): Document. + * doc/install.texi (--with-build-sysroot): Document. + + * Makefile.in (inhibit_libc): New variable. + (INHIBIT_LIBC_CFLAGS): Likewise. + (LIBGCC2_CFLAGS): Include + $(INHIBIT_LIBC_CFLAGS). + (CRTSTUFF_CFLAGS): Include $(INHIBIT_LIBC_CFLAGS). + ($(T)crtbegin.o): Do not use @inhibit_libc@. + ($(T)crtend.o): Likewise. + ($(T)crtbeginS.o): Do not use @inhibit_libc@. + ($(T)crtendS.o): Likewise. + ($(T)crtbeginT.o): Do not use @inhibit_libc@. + ($(T)crtendT.o): Likewise. + (stmp-fixinc): Do not complain about missing headers if + inhibit_libc. + * configure.ac (inhibit_libc): Set it to true/false. + (--with-build-sysroot): New option. Use it to set + SYSTEM_HEADER_DIR. + * configure: Regenerated. + +2005-07-25 Manfred Hollstein + + * calls.c (store_one_arg): Fix unsigned comparison warning. + +2005-07-25 Serge Belyshev + + PR other/22337 + * ggc-zone.c (ggc_alloc_zone_stat): Do not use CHUNK_OVERHEAD. + (ggc_print_statistics): Initialize variable before use. + +2005-07-25 Richard Guenther + + * tree-dfa.c (mark_new_vars_to_rename): Protect against + calling with a PHI_NODE argument. + + * tree-flow-inline.h (overlap_subvar): Protect against + possible overflow. + +2005-07-25 Paolo Bonzini + + * aclocal.m4 (gcc_AC_CHECK_TOOL): Add /bin to default directory. + * configure: Regenerate. + +2005-07-25 Ira Rosen + + * expr.c (highest_pow2_factor): Make extern. + * tree-data-ref.c (ptr_decl_may_alias_p): New function. + (ptr_ptr_may_alias_p, may_alias_p, record_ptr_differ_p, + record_array_differ_p, array_ptr_differ_p): Likewise. + (base_object_differ_p): Rename (from array_base_name_differ_p). Support + additional cases. Call the above functions. + (base_addr_differ_p): Moved from tree-vect-analyze.c. Call + base_object_differ_p when there are two base objects. Otherwise, compare + base address and offset. Call may_alias_p. + (dump_data_reference): Use a correct field name. + (analyze_array): Make static. Initialize new data-ref fields. + (analyze_indirect_ref): New function. + (init_data_ref): Initialize new data-ref fields. + (strip_conversion): Moved from tree-vect-analyze.c. + (analyze_offset_expr, get_ptr_offset, address_analysis, + object_analysis): Likewise. + (analyze_offset): New function. + (create_data_ref): Likewise. + (initialize_data_dependence_relation): Call base_addr_differ_p. Compare + dimensions for ARRAY_REFs only. + (build_classic_dist_vector): Make static. + (access_functions_are_affine_or_constant_p): Call macro to get the + address of access functions. + (compute_all_dependences): Add new parameter + compute_self_and_read_read_dependences. Compute self and read-read + dependences if it is true. + (find_data_references_in_loop): Call create_data_ref. Initialize new + data-ref fields. + (compute_data_dependences_for_loop): Add new parameter + compute_self_and_read_read_dependences. Remove parameter nb_loops, + compute nb_loops. Call compute_all_dependences, + build_classic_dist_vector and build_classic_dir_vector with correct + parameters. + (analyze_all_data_dependences): Call compute_data_dependences_for_loop + with correct parameters. Compare dimensions for ARRAY_REFs only. + (free_data_refs): Call macro to free access functions. + * tree-data-ref.h (struct first_location_in_loop): New structure. Move + fields from stmt_vinfo. + (struct base_object_info): New structure. + (struct data_reference): Move fields to base_object_info. Add fields + first_location and object_info for above structures. Move fields from + stmt_info: memtag, ptr_info, subvars, misalignment. Add new field + aligned_to. Add macros to access the new fields. + Update functions declarations. + * tree-flow.h (is_aliased_with): Declare. + * tree-loop-linear.c (linear_transform_loops): Call + compute_data_dependences_for_loop with correct parameters. + * tree-ssa-alias.c (is_aliased_with): New function. + * tree-vect-analyze.c (vect_get_ptr_offset): Remove. + (vect_analyze_offset_expr, vect_base_addr_differ_p): Likewise. + (vect_analyze_data_ref_dependence): Get ddr. Remove call to + vect_base_addr_differ_p, compute_subscript_distance and + build_classic_dist_vector. Add printings. Check absolute value of + distance. + (vect_analyze_data_ref_dependences): Go through ddrs instead of + data-refs. + (vect_compute_data_ref_alignment): Get the fields of data-ref instead of + stmt. Check aligned_to. Check if the base is aligned. Remove conversion + to bytes. Add printing. + (vect_compute_data_refs_alignment): Go through loads and stores in one + loop. + (vect_enhance_data_refs_alignment, vect_analyze_data_refs_alignment, + vect_analyze_data_ref_access): Likewise. + (vect_analyze_pointer_ref_access): Remove. + (vect_address_analysis, vect_object_analysis): Likewise. + (vect_analyze_data_refs): Call compute_data_dependences_for_loop to find + and analyze data-refs in the loop. + * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Get the + fields of data-ref instead of stmt. Add init to the offset from the + base. + (vect_create_data_ref_ptr): Get the fields of data-ref instead of stmt. + (vect_update_init_of_dr): Likewise. + (vect_update_inits_of_drs): Go through loads and stores in one loop. + * tree-vectorizer.c (new_stmt_vec_info): Remove initialization of + removed fields. + (new_loop_vec_info): Initialize new fields. + (destroy_loop_vec_info): Free new fields. + (vect_strip_conversion): Remove. + * tree-vectorizer.h (enum verbosity_levels): Add new verbosity level. + (struct _loop_vec_info): Unify data_ref_writes and data_ref_reads into + datarefs. Add new field ddrs. + Add macros for the new fields access. + (struct _stmt_vec_info): Remove: base_address, initial_offset, step, + base_aligned_p, misalignment, memtag, ptr_info and subvars. + Remove their macros. + * tree.h (highest_pow2_factor): Declare. + +2005-07-25 Jakub Jelinek + + * calls.c (store_one_arg): Check for sibling call MEM arguments + from already clobbered incoming argument area. + +2005-07-24 Kaveh R. Ghazi + + * c-common.c (check_missing_format_attribute): New. + * c-common.h (check_missing_format_attribute): Likewise. + * c-typeck.c (convert_for_assignment): Use it. + +2005-07-24 Andreas Schwab + + * config/m68k/m68k.md ("extendqidi2"): When source is an address + register use a word move. Correct operand of ext.w in 68000 code. + +2005-07-23 Mark Mitchell + + * dwarf2out.c (gen_variable_die): Treat un-emitted COMDAT + variables as declarations, rather than definitions. + +2005-07-24 Ira Rosen + + PR tree-optimization/22526 + * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Match the type + of the zero node. + +2005-07-24 Francois-Xavier Coudert + + * builtins.def: Add DEF_EXT_C99RES_BUILTIN to define builtins + that C99 reserve for future use. Use it to define clog10, + clog10f and clog10l. + +2005-07-23 Kaveh R. Ghazi + + * Makefile.in (STRICT2_WARN): Add -Wmissing-format-attribute. + * configure.ac: Check for -Wmissing-format-attribute. + + * configure: Regenerate. + +2005-07-23 Richard Henderson + + PR tree-optimization/22623 + * tree-complex.c (set_component_ssa_name): Use replace_ssa_name_symbol. + +2005-07-23 Giovanni Bajo + + PR target/22577 + * config/pa/pa.c (reloc_needed): Updated for VECs inside CONSTRUCTOR. + +2005-07-23 Kaveh R. Ghazi + + * Makefile.in (C_TREE_H): Update dependencies. + * c-tree.h: Include toplev.h. + * diagnostic.h (diagnostic_set_info): Add format attribute. + * rtl-error.c (diagnostic_for_asm): Likewise. + +2005-07-23 Chao-ying Fu + + * config/mips/mips-dsp.md: New file. + * config/mips/mips-modes.def (V4QI, V2HI, CCDSP): New modes. + * config/mips/mips.c (mips_function_type): Add types for DSP builtin + functions. + (mips_builtin_type): Add MIPS_BUILTIN_DIRECT_NO_TARGET and + MIPS_BUILTIN_BPOSGE32. + (mips_expand_builtin_direct): Add one parameter to indicate that + builtin functions need to return a value. + (mips_expand_builtin_bposge): New for expanding "bposge" builtin + functions. + (mips_regno_to_class): Add classes for 12 new DSP registers. + (mips_subword): Change to check four HI registers. + (mips_output_move): Output move to and from 6 new DSP accumulators. + (override_options): Make sure -mdsp and -mips16 are not used together. + Map 'A' to DSP_ACC_REGS and 'a' to ACC_REGS. Enable DSP accumulators + for machine modes. + (mips_conditional_register_usage): Disable 6 new DSP accumulators + when !TARGET_DSP. + (print_operand): Add 'q' for printing DSP accumulators. + (mips_cannot_change_mode_class): Check ACC_REGS. + (mips_secondary_reload_class): Check ACC_REGS. + (mips_vector_mode_supported_p): Enable V2HI and V4QI when TARGET_DSP. + (mips_register_move_cost): Check ACC_REGS. + (CODE_FOR_mips_addq_ph, CODE_FOR_mips_addu_qb, CODE_FOR_mips_subq_ph) + (CODE_FOR_mips_subu_qb): New code-aliasing macros. + (DIRECT_NO_TARGET_BUILTIN, BPOSGE_BUILTIN): New macros. + (dsp_bdesc): New array. + (bdesc_arrays): Add DSP builtin function table. + (mips_prepare_builtin_arg): Check predicate again after + copy_to_mode_reg. + (mips_expand_builtin): Add one more parameter to + mips_expand_builtin_direct. Expand MIPS_BUILTIN_DIRECT_NO_TARGET and + MIPS_BUILTIN_BPOSGE32. + (mips_init_builtins): Initialize new function types. + (mips_expand_builtin_direct): Check if builtin functions need to + return a value and pass operands properly. + (mips_expand_builtin_bposge): New function. + * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Add __mips_dsp. + (ASM_SPEC): Map -mdsp to -mdsp in GAS. + (FIRST_PSEUDO_REGISTER): Increase to 188. + (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS): + Update for 12 new DSP registers. + (DSP_ACC_REG_FIRST, DSP_ACC_REG_LAST, DSP_ACC_REG_NUM, AC1HI_REGNUM) + (AC1LO_REGNUM, AC2HI_REGNUM, AC2LO_REGNUM, AC3HI_REGNUM, AC3LO_REGNUM): + (DSP_ACC_REG_P, ACC_REG_P, ACC_HI_REG_P): New macros. + (reg_class): Add DSP_ACC_REGS and ACC_REGS. + (REG_CLASS_NAMES): Add names for DSP_ACC_REGS and ACC_REGS. + (REG_CLASS_CONTENTS): Update for DSP_ACC_REGS, ACC_REGS and ALL_REGS. + (REG_ALLOC_ORDER): Update for 12 new DSP registers. + (mips_char_to_class): Add 'A' for DSP_ACC_REGS and 'a' for ACC_REGS. + (UIMM6_OPERAND, IMM10_OPERAND): New macros. + (EXTRA_CONSTRAINT_Y): Add YA and YB extra constraints. + (REGISTER_NAMES): Add names for 12 new DSP registers. + * config/mips/mips.md: Include mips-dsp.md. + (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC) + (UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S) + (UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W) + (UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR) + (UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA) + (UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR) + (UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL) + (UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R) + (UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH) + (UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL) + (UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR) + (UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH) + (UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL) + (UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR) + (UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH) + (UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB) + (UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH) + (UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H) + (UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP) + (UNSPEC_RDDSP): New constants. + (*movdi_32bit): Change 'x' to 'a' for ACC_REGS. + (*movsi_internal): Change 'x' to 'a' for ACC_REGS. Add an + A<-d alternative. + * config/mips/mips.opt (-mdsp): New option. + * config/mips/predicates.md (const_uimm6_operand, const_imm10_operand) + (reg_imm10_operand): New predicates. + * doc/extend.texi (MIPS DSP Built-in Functions): New section. + * doc/invoke.texi (-mdsp): Document new option. + +2005-07-22 DJ Delorie + + * c-objc-common.c (c_cannot_inline_tree_fn): Add warning control + to warning calls. + * tree-inline.c (inlinable_function_p): Likewise. + +2005-07-22 Mark Mitchell + + PR debug/21828 + * toplev.c (check_global_declarations): Do not mark undefined + variables as DECL_IGNORED_P. + * varasm.c (first_global_object_name): GTY it. + (weak_global_object_name): Likewise. + (notice_global_symbol): Use ggc_strdup, not xstrdup, when creating + a string to go into {weak,first}_global_object_name. + +2005-07-22 DJ Delorie + + * c-format.c (check_function_format): Change warning control + option from OPT_Wattribute to OPT_Wmissing_format_attribute. + +2005-07-22 Diego Novillo + + * tree-ssa-alias.c (count_ptr_derefs): Do not consider + &PTR->FLD a dereference of PTR. + * tree-ssa-structalias.c (update_alias_info): Consider &PTR->FLD + a potential dereference of PTR. + +2005-07-22 J"orn Rennecke + + PR rtl-optimization/20370 + * ifcvt.c (dead_or_predicable): Before calling propagate_block, + call allocate_reg_info if necessary. + + PR rtl-optimization/21848 + * calls.c (emit_library_call_value_1): For const functions, add + USEs of the stack slots to CALL_INSN_FUNCTION_USAGE. + + PR rtl-optimization/22445 + * cselib.c (target.h): Include. + (rtx_equal_for_cselib_p): Allow commutative matches. + (cselib_hash_rtx): Don't use MODE for CONST_INT hashing. + Remove MODE parameter. Changed all callers. + + PR rtl-optimization/22258 + * combine.c (likely_spilled_retval_1, likely_spilled_retval_p): + New functions. + (try_combine): Use likely_spilled_retval_p. + +2005-07-22 Paul Woegerer + + * config.gcc: Add crx-elf support. + + * doc/contrib.texi: Mention crx. + * doc/extend.texi: Document crx extensions. + * doc/install.texi: Document crx install. + * doc/invoke.texi: Document crx options. + * doc/md.texi: Document crx constraints. + + * config/crx/crx-protos.h: New file. + * config/crx/crx.c: New file. + * config/crx/crx.h: New file. + * config/crx/crx.md: New file. + * config/crx/crx.opt: New file. + * config/crx/t-crx: New file. + +2005-07-22 Manfred Hollstein + + * tree-ssa-structalias.c (merge_graph_nodes): Fix uninitialised + warnings. + (int_add_graph_edge): Likewise. + (collapse_nodes): Likewise. + (process_unification_queue): Likewise. + +2005-07-22 Richard Kenner + Laurent GUERBY + + PR tree-optimization/22336 + * function.c (record_block_change): Check for + cfun->ib_boundaries_block. + +2005-07-21 James A. Morrison + + * fold-const.c (fold_unary): Don't strip signed nops from ABS_EXPRs. + (tree_expr_nonnegative_p): Return try for TYPE_UNSIGNED. + +2005-07-21 DJ Delorie + + * toplev.c (warn_deprecated_use): Add warning control to warning + call. + * c-typeck.c (parser_build_binary_op): Likewise. + (c_finish_if_stmt): Likewise. + * c-common.c (check_function_sentinel): Likewise. + (check_nonnull_arg): Likewise. + +2005-07-21 Richard Henderson + + PR tree-opt/22504 + * tree-complex.c (complex_ssa_name_components): New. + (cvc_lookup): Allow entry not found. + (create_components): Remove. + (create_one_component_var, get_component_var): New. + (get_component_ssa_name, set_component_ssa_name): New. + (extract_component): Use get_component_ssa_name. + (update_complex_components): Use set_component_ssa_name. + (update_complex_components_on_edge): Likewise. + (update_phi_components): Create new PHI nodes directly, instead + of adding insns to edges. + (tree_lower_complex): Allocate and free complex_variable_components + and complex_ssa_name_components here. + +2005-07-20 Daniel Berlin + + * alias.c (nonoverlapping_component_refs_p): Use TYPE_MAIN_VARIANT, + revert to returning false. + +2005-07-21 Uros Bizjak + + PR target/21149 + * config/i386/i386.md (sse_movhlps): Fix vec_select values. + +2005-07-21 Uros Bizjak + + PR target/22576 + * config/i386/i386.md (cmpxf): Change operand constraints + to "nonmemory_operand". + +2005-07-21 Andrew Pinski + + * config/i386/i386.md (trap): Use "".word/t0x0b0f" instead of ud2. + +2005-07-21 Andrew Pinski + + PR middle-end/21180 + * fold-const.c (fold_build1): Add checksum for the operands. + (fold_build2): Likewise. + (fold_build3): Likewise. + +2005-07-21 Andrew Pinski + + PR middle-end/19055 + * fold-const.c (fold_binary): Transform "(X | Y) ^ X" to "Y & ~ X". + +2005-07-21 Paolo Bonzini + + * common.opt (-fforward-propagate): Committed by mistake, + removed. + +2005-07-21 Volker Reichelt + + * reg-stack.c: Fix comment typo(s). + * tree-ssa-operands.c: Likewise. + * tree-vectorizer: Likewise. + +2005-07-21 Nick Clifton + + * config/sh/symbian.c: Replace C++ style line comments with C + style line comments. + (symbian_add_attribute): Do not use a ? operator on the LHS of + an assignment. + (sh_symbian_handle_dll_attribute): Change the type of the + method vector to "VEC(tree,gc)*" and use vector accessor + macros to walk over the elements. + (symbian_export_vtable_and_rtti_p): Likewise. + (symbian_class_needs_attribute_p): Likewise. + +2005-07-21 Paolo Bonzini + + PR target/22085 + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Do not + initialize targetm.resolve_overloaded_builtin here. + (altivec_expand_overloaded_builtin): Make it non-static. + * config/rs6000/rs6000-protos.h + (altivec_expand_overloaded_builtin): New prototype. + * config/rs6000/rs6000.h (REGISTER_TARGET_PRAGMAS): Initialize + targetm.resolve_overloaded_builtin here. + * config/rs6000/darwin.h (REGISTER_TARGET_PRAGMAS): Likewise. + +2005-07-21 Paolo Bonzini + Zdenek Dvorak + + PR tree-optimization/19210 + * common.opt (Wunsafe-loop-optimizations, funsafe-loop-optimizations): + New. + * Makefile.in (tree-ssa-loop-niter.o): Depend intl.o. + * loop-iv.c (get_simple_loop_desc): If -funsafe-loop-optimizations, + rely on unproven assumptions. + * predict.c (predict_loops): Adjust call to number_of_iterations_exit. + * tree-flow.h (number_of_iterations_exit): Add final parameter. + * tree-scalar-evolution.c (number_of_iterations_in_loop): Adjust call + to number_of_iterations_exit. + * tree-ssa-loop-ivcanon.c (empty_loop_p): Likewise. + * tree-ssa-loop-ivopts.c (niter_for_exit): Likewise. + * tree-ssa-loop-niter.c (find_loop_niter, + estimate_numbers_of_iterations_loop): Likewise. + (number_of_iterations_exit): Honor the new options. + * doc/invoke.texi (Wunsafe-loop-optimizations, + funsafe-loop-optimizations): Document them. + +2005-07-21 Richard Sandiford + + PR rtl-optimization/22167 + * gcse.c (hoist_code): Fix hoist_exprs[] check. + +2005-07-20 Adam Nemet + + * config/rs6000/lynx.h: Mark __do_global_ctors_aux and + __do_global_dtors_aux longcall. + +2005-07-20 Kazu Hirata + + * gensupport.c (old_preds): Don't reference PREDICATE_CODES. + (old_special_pred_table): Don't reference + SPECIAL_MODE_PREDICATES. + * system.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Poison. + * config/arc/arc.h: Don't mention PREDICATE_CODES. + * config/sh/predicates.h: Don't mention + SPECIAL_MODE_PREDICATES. + * doc/tm.texi (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): + Remove. + +2005-07-20 DJ Delorie + + * config.gcc: Add m32c-elf support. + + * doc/contrib.texi: Mention m32c. + * doc/extend.texi: Document m32c extensions. + * doc/install.texi: Mention m32c. + * doc/invoke.texi: Document m32c options. + * doc/md.texi: Document m32c constraints. + + * config/m32c/addsub.md: New file. + * config/m32c/bitops.md: New file. + * config/m32c/cond.md: New file. + * config/m32c/jump.md: New file. + * config/m32c/m32c-lib1.S: New file. + * config/m32c/m32c-lib2.c: New file. + * config/m32c/m32c-modes.def: New file. + * config/m32c/m32c-pragma.c: New file. + * config/m32c/m32c-protos.h: New file. + * config/m32c/m32c.abi: New file. + * config/m32c/m32c.c: New file. + * config/m32c/m32c.h: New file. + * config/m32c/m32c.md: New file. + * config/m32c/m32c.opt: New file. + * config/m32c/minmax.md: New file. + * config/m32c/mov.md: New file. + * config/m32c/muldiv.md: New file. + * config/m32c/predicates.md: New file. + * config/m32c/prologue.md: New file. + * config/m32c/shift.md: New file. + * config/m32c/t-m32c: New file. + +2005-07-20 Kaz Kojima + + * config/sh/sh.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New constants. + (stack_protect_set, stack_protect_test): New expanders. + (stack_protect_set_si, stack_protect_set_si_media, + stack_protect_set_di_media, stack_protect_test_si, + stack_protect_test_si_media, stack_protect_test_di_media): + New insns. + +2005-07-20 Andrew Pinski + + * c-typeck.c (output_init_element): Don't copy the INTEGER_CST. + +2005-07-20 James A. Morrison + + * tree.h (tree_expr_nonzero_p): Export. + * fold-const.c (tree_expr_nonzero_p): Likewise. + Return true for CALL_EXPRs that are alloca calls. + (fold_binary): Use omit_one_operand when checking EQ_EXPRs or NE_EXPRs + against zero. + * tree-flow.h (expr_computes_nonzero): Remove. + * tree-vrp.c (expr_computes_nonzero): Remove. + (vrp_expr_computes_nonzero): Use tree_expr_nonzero_p. + (extract_range_from_unary_expr): Likewise. + * tree-ssa-dom.c (record_equivalences_from_stmt): Use + tree_expr_nonzero_p. + +2005-07-20 Bernd Schmidt + + * config/bfin/bfin-protos.h (legitimize_pic_address): Don't declare. + * config/bfin/bfin.c (legitimize_pic_address): Now static. Take + extra arg "picreg" and use it instead of pic_offset_table_rtx. + All callers changed. + (frame_related_constant_load): New arg "related" which controls + setting of RTX_FRAME_RELATED_P. All callers changed. + (bfin_load_pic_reg): New function, broken out of bfin_expand_prologue. + (bfin_expand_prologue): Add stack limit checking. + * config/bfin/bfin.md (trapifcc): New pattern. + + * config/bfin/bfin.c: Include "langhooks.h". + (def_builtin): Go through lang_hooks to call builtin_function. + + * config/bfin/bfin-protos.h (bfin_longcall_p): Declare. + * config/bfin/predicates.md (symbol_ref_operand): New. + (call_insn_operand): Delete. All callers changed to use + register_no_elim_operand. + * config/bfin/bfin.c (init_cumulative_args): Initialize the new + call_cookie field. + (function_arg): Use it to generate the call's operand 2. + (bfin_longcall_p): New function. + (bfin_expand_call): Extra arg "cookie". All callers and declaration + changed. Emit extra USE in the pattern. Use bfin_longcall_p to + determine if the address needs to be in a REG. + (bfin_handle_longcall_attribute): New function. + (bfin_attribute_table): Add "longcall" and "shortcall". + * config/bfin/bfin.h (CALL_NORMAL, CALL_LONG, CALL_SHORT): New macros. + (CUMULATIVE_ARGS): New member call_cookie. + (PREDICATE_CODES): Add symbol_ref_operand. + * config/bfin/bfin.md (call, call_value, sibcall, sibcall_value): Add + extra USE to the pattern. + (call_symbol, sibcall_symbol, call_value_symbol, sibcall_value_symbol): + New patterns, split off call_insn, sibcall_insn, call_value_insn and + sibcall_value_insn; now the new patterns handle direct calls and the + old ones indirect calls. + * doc/extend.texi: Mention Blackfin in longcall/shortcall docs. + +2005-07-20 Zdenek Dvorak + + * doc/trouble.texi: Update section on handling of empty loops. + +2005-07-20 Kazu Hirata + + * config.gcc: Remove support for sparc-*-openbsd*, + i860-*-sysv4*, ip2k-*-elf, ns32k-*-netbsdelf*, + ns32k-*-netbsd*. + * config.host: Remove support for i860-*-sysv4* as a host. + * config/i860/*, config/ip2k/*, config/ns32k/*, + config/sparc/openbsd.h, config/sparc/t-openbsd: Remove. + * doc/install.texi, doc/invoke.texi, doc/md.texi: Don't + mention obsolete ports. + +2005-07-20 Kaz Kojima + + * config/sh/sh.c (regno_reg_class): Add GENERAL_REGS for + soft frame pointer. + (sh_expand_prologue): Use hard_frame_pointer_rtx instead + of frame_pointer_rtx. + (sh_expand_epilogue): Likewise. + (sh_set_return_address): Likewise. + (initial_elimination_offset): Use HARD_FRAME_POINTER_REGNUM + instead of FRAME_POINTER_REGNUM if needed. Add elimination + offsets from FRAME_POINTER_REGNUM. + * config/sh/sh.h (SH_REGISTER_NAMES_INITIALIZER): Add sfp. + (sh_register_names): Add initializer for sfp. + (GENERAL_OR_AP_REGISTER_P): Permit FRAME_POINTER_REGNUM. + (VALID_REGISTER_P): Likewise. + (FIRST_PSEUDO_REGISTER): Update. + (DWARF_FRAME_REGISTERS): Define. + (FIXED_REGISTERS, CALL_USED_REGISTERS): Add sfp. + (HARD_FRAME_POINTER_REGNUM): Define. + (FRAME_POINTER_REGNUM): Redefine. + (ELIMINABLE_REGS): Never eliminate to FRAME_POINTER_REGNUM, + but HARD_FRAME_POINTER_REGNUM instead. Add eliminations + from FRAME_POINTER_REGNUM. + (CAN_ELIMINATE): Use HARD_FRAME_POINTER_REGNUM instead of + FRAME_POINTER_REGNUM. + (REG_CLASS_CONTENTS): Add sfp. + (REG_ALLOC_ORDER): Likewise. + (FRAME_GROWS_DOWNWARD): Set to 1. Update comment. + (GO_IF_LEGITIMATE_ADDRESS): Use hard_frame_pointer_rtx instead + of frame_pointer_rtx. + (LEGITIMIZE_RELOAD_ADDRESS): Likewise. + +2005-07-19 James A. Morrison + + * fold-const.c (tree_expr_nonnegative_p): Only return true for + ABS_EXPR when flag_wrapv is false because of INT_MIN. + (tree_expr_nonzero_p): Always call tree_expr_nonzero_p on the argument + of an ABS_EXPR. + (fold_unary): Always fold ABS_EXPR> into + ABS_EXPR. + +2005-07-20 Giovanni Bajo + + Make CONSTRUCTOR use VEC to store initializers. + * c-common.c (complete_array_type): Update to cope with VEC in + CONSTRUCTOR_ELTS. + * c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts. + (pp_c_constructor_elts): New function. + * c-pretty-print.h (pp_c_constructor_elts): Declare. + * c-typeck.c (build_function_call, build_c_cast, digest_init, + struct constructor_stack, struct initializer_stack, + constructor_elements, push_init_level, pop_init_level, + add_pending_init, find_init_member, output_init_element): Update to + cope with VEC in CONSTRUCTOR_ELTS. + * coverage.c (build_fn_info_value, build_ctr_info_value, + build_gcov_info): Likewise. + * expr.c (categorize_ctor_elements_1, store_constructor, + expand_expr_real_1): Likewise. + * fold-const.c (fold_ternary): Likewise. + * gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl, + gimplify_init_constructor, gimplify_expr): Likewise. + * tree-dump.c (dequeue_and_dump): Likewise. + * tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR + node. + * tree-pretty-print.c (dump_generic_node): Update to cope with VEC in + CONSTRUCTOR_ELTS. + * tree-sra.c (generate_element_init_1): Likewise. + * tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree-vect-generic.c (expand_vector_piecewise): Likewise. + * tree-vect-transform.c (vect_get_vec_def_for_operand): + (get_initial_def_for_reduction): Likewise. + * tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses + value handle in annotations. + * tree.c (tree_node_kind, tree_code_size, make_node_stat, + tree_node_structure): Add support for constr_kind. + (build_vector_from_ctor, build_constructor_single, + build_constructor_from_list): New functions. + (build_constructor): Update to take a VEC instead of a TREE_LIST. + (simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree): + Update to cope with VEC in CONSTRUCTOR_ELTS. + * tree.def (CONSTRUCTOR): Make it a tcc_exceptional node. + * tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT, + CONSTRUCTOR_APPEND_ELT): New macros. + (struct constructor_elt, struct tree_constructor): New data types. + (union tree_node): Add tree_constructor field. + * treestruct.def: Define TS_CONSTRUCTOR. + * varasm.c (const_hash_1, compare_constant, copy_constant, + compute_reloc_for_constant, output_addressed_constants, + initializer_constant_valid_p, output_constant, + array_size_for_constructor, output_constructor): Update to cope with + VEC in CONSTRUCTOR_ELTS. + * vec.h (VEC_empty, VEC_copy): New macros. + +2005-07-19 Devang Patel + + * dbxout.c (dbxout_type): Check Objective-C++ lang. + +2005-07-19 Richard Henderson + + PR tree-opt/22278 + * gimplify.c (gimplify_expr): Use main variant type for the temp + destination for a discarded volatile read. + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't elide + casts between non-void types that change volatility. + +2005-07-15 DJ Delorie + + * toplev.h: Add comment about the first parameter for warning(). + * errors.h: Likewise. + + * c.opt (Wpragmas): New. + * doc/invoke.texi: Document it. + + * function.c (do_warn_unused_parameter): Add warning control to + warning call. + * c-decl.c (warn_if_shadowing): Likewise. + * c-lex.c (cb_def_pragma): Likewise. + * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. + (pop_alignment): Likewise. + (handle_pragma_pack): Likewise. + (apply_pragma_weak): Likewise. + (handle_pragma_weak): Likewise. + (handle_pragma_redefine_extname): Likewise. + (add_to_renaming_pragma_list): Likewise. + (handle_pragma_extern_prefix): Likewise. + (maybe_apply_renaming_pragma): Likewise. + (handle_pragma_visibility): Likewise. + + * config/c4x/c4x-c.c (BAD): Likewise. + (c4x_parse_pragma): Likewise. + * config/ia64/ia64-c.c (ia64_hpux_handle_builtin_pragma): Likewise. + * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. + (rs6000_pragma_longcall): Likewise. + * config/v850/v850-c.c (pop_data_area): Likewise. + (ghs_pragma_section): Likewise. + (ghs_pragma_section): Likewise. + (ghs_pragma_interrupt): Likewise. + (ghs_pragma_starttda): Likewise. + (ghs_pragma_startsda): Likewise. + (ghs_pragma_startzda): Likewise. + (ghs_pragma_endtda): Likewise. + (ghs_pragma_endsda): Likewise. + (ghs_pragma_endzda): Likewise. + +2005-07-19 Danny Berlin + Kenneth Zadeck + + * Makefile.in: Removed tree-promote-statics.c + * tree-promote-statics.c: Removed. + * common.opt: Removed flag-promote-statics. + * opts.c: Ditto. + * passes.c: Removed tree-promote-statics pass. + * tree-pass.h: Ditto. + * timevar.def: Removed TV_PROMOTE_STATICS. + + +2005-07-19 Gerald Pfeifer + + * config.gcc: Add support for *-*-freebsd7, *-*-freebsd8, + and *-*-freebsd9. + * config/freebsd-spec.h (FBSD_TARGET_OS_CPP_BUILTINS): Ditto. + +2005-07-19 Kaveh R. Ghazi + + PR c/22476 + * c-common.c (check_function_arguments): Call + 'check_function_format' if either -Wformat or + -Wmissing-format-attribute are specified. + * c-format.c (check_function_format): Check -Wformat before + calling 'check_format_info'. + * c-opts.c (c_common_post_options): Don't warn for + -Wmissing-format-attribute without -Wformat. + * c-typeck.c (convert_for_assignment): Detect additional cases for + -Wmissing-format-attribute. + * doc/invoke.texi (-Wmissing-format-attribute): Document new + behavior. + +2005-07-19 Richard Guenther + + * config/i386/i386.md (lrint2): Use temporary + instead of clobbering non-existent memory. + +2005-07-19 Nick Clifton + + * config/avr/avr.c (legitimate_address_p): Fix debugging print + statement to avoid displaying ASCII control characters. + +2005-07-19 Ben Elliston + + * bt-load.c (link_btr_uses): Fix uninitialised warnings. + * cfganal.c (find_edge_index): Ditto. + * combine.c (combine_instructions): Ditto. + * ddg.c (create_scc): Ditto. + (find_successors): Ditto. + (find_predecessors): Ditto. + (find_nodes_on_paths): Ditto. + (longest_simple_path): Ditto. + * flow.c (update_life_info): Ditto. + (count_or_remove_death_notes): Ditto. + (clear_log_links): Ditto. + * modulo-sched.c (generate_reg_moves): Ditto. + (find_max_asap): Ditto. + (find_max_hv_min_mob): Ditto. + (find_max_dv_min_mob): Ditto. + * sbitmap.c (sbitmap_first_set_bit): Ditto. + * sched-rgn.c (extract_edgelst): Ditto. + * tree-into-ssa.c (prepare_names_to_update): Ditto. + (dump_update_ssa): Ditto. + (ssa_names_to_replace) Ditto. + (switch_virtuals_to_full_rewrite): Ditto. + (update_ssa): Ditto. + * tree-vect-transform.c (vect_create_epilog_for_reduction): Ditto. + +2005-07-18 Daniel Berlin + + Fix PR tree-optimization/22483 + + * tree-complex.c (create_components): Use + safe_referenced_var_iterator and FOR_EACH_REFERENCED_VAR_SAFE. + * tree-flow-inline.h (fill_referenced_var_vec): New function. + * tree-flow.h (safe_referenced_var_iterator): New structure. + (FOR_EACH_REFERENCED_VAR_SAFE): New macro. + * tree-ssa-alias.c (setup_pointers_and_addressables): Use + safe_referenced_var iterator. + (add_type_alias): Ditto. + +2005-07-19 Steven Bosscher + + * loop-init.c (rest_of_handle_loop2): Remove. + (rtl_loop_init, rtl_loop_done, rtl_move_loop_invariants, + rtl_unswitch, rtl_unroll_and_peel_loops, rtl_doloop): New functions. + (pass_rtl_loop_init, pass_rtl_loop_done, + pass_rtl_move_loop_invariants, pass_rtl_unswitch, + pass_rtl_unroll_and_peel_loops, pass_rtl_doloop): New passes. + * tree-ssa-loop.c (pass_loop, pass_loop_init, pass_loop_done, + pass_unswitch): Rename to pass_tree_loop, pass_tree_loop_init, + pass_tree_loop_done, and pass_tree_unswitch. + (gate_loop): Rename to gate_tree_loop. + * passes.c (init_optimization_passes): Update for renamed tree + loop passes. Add the new loop2 passes as subpasses of loop2. + * tree-pass.h: Add extern declarations for the new loop2 subpasses. + Update for the renamed tree loop passes. + +2005-07-18 Ian Lance Taylor + + PR middle-end/22057 + * tree-cfgcleanup.c (cleanup_tree_cfg): Only remove forwarder + blocks when optimizing. + +2005-07-18 Steve Ellcey + + * common.opt (frename-registers): Initialize to 2. + (fweb): Ditto. + (fgcse-after-reload): Ditto. + * toplev.c (AUTODETECT_FLAG_VAR_TRACKING): Rename to AUTODETECT_VALUE. + (process_options): Only change flag_web, flag_rename_registers, + and flag_rerun_cse_after_loop if not explicitly set by user. + +2005-07-18 Jan Beulich + + * config/i386/i386.c (ix86_expand_branch, ix86_expand_setcc, + ix86_expand_carry_flag_compare, ix86_expand_int_movcc): Handle TImode + in 64-bit mode the same as DImode in 32-bit mode. + (ix86_expand_ashl_const, ix86_split_ashl, ix86_split_ashr, + ix86_split_lshr): Likewise. Rename to no longer refer to a specific + mode. Add new mode parameter. + * config/i386/i386.h (CONST_OK_FOR_LETTER_P): Describe and handle 'O'. + * config/i386/i386.md (cmpti, addti3, subti3, negti2, ashlti3, ashrti3, + x86_64_shift_adj): New expanders. + (*addti3_1, *subti3_1, *negti2_1, ashlti3_1, *ashlti3_2, ashrti3_1, + *ashrti3_2, lshrti3_1, *lshrti3_2, x86_64_shld, x86_64_shrd): New + insns. + Respective new splitters. Use renamed shift splitter helpers in 32-bit + DImode shift splitters. + * config/i386/i386-protos.h (ix86_split_ashl, ix86_split_ashr, + ix86_split_lshr): Renamed from ix86_split_[al]sh[rl]di. Added new + mode parameter. + +2005-07-18 Jan Beulich + + * i386.md (movdi_extzv_1): New. + (zero_extendhidi2): Combine alternatives and never force use of + REX64 prefix. + (zero_extendqidi2): Likewise. Don't restrict input selection. + +2005-07-17 Daniel Berlin + + Fix PR tree-optimization/22531 + * tree-ssa-pre.c (do_eustores): Make sure LHS is a decl for the + moment. + +2005-07-17 Daniel Berlin + + * tree-promote-statics.c (pass_promote_statics): Change dump file + name. + +2005-07-17 Daniel Berlin + + * tree-optimize.c (init_tree_optimization_passes): Add + pass_eliminate_useless_stores pass. + * tree-pass.h (pass_eliminate_useless_stores): New pass structure. + * tree-ssa-pre.c (is_copy_stmt): New function. + (follow_copies_till_vuse): Ditto. + (do_eustores): Ditto. + (gate_eustores): Ditto. + +2005-07-16 Richard Henderson + + * gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit. + +2005-07-16 Danny Berlin + Kenneth Zadeck + + * Makefile.in: Added rules for ipa-pure-const.c, ipa-reference.c, + ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c, + ipa-type-escape.h, tree-promote-statics.c + * ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c, + ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h, + tree-promote-statics.c: new files. + * alias.c: (nonlocal_mentioned_p_1, nonlocal_mentioned_p, + nonlocal_referenced_p_1, nonlocal_referenced_p, nonlocal_set_p_1, + int nonlocal_set_p, mark_constant_function): Deleted. + (rest_of_handle_cfg): Removed call to mark_constant_function. + (nonoverlapping_component_refs_p): Added calls to support + type based aliasing. + * tree-ssa-alias.c (may_alias_p, + compute_flow_insensitive_aliasing): Ditto. + * calls.c (flags_from_decl_or_type): Removed reference to + cgraph_rtl_info. + * c-typeck.c (convert_arguments): Make builtins tolerant of having + too many arguments. This is necessary for Spec 2000. + * cgraph.h (const_function, pure_function): Removed. + * common.opt: Added "fipa-pure-const", "fipa-reference", + "fipa-type-escape", and "ftree-promote-static". + * opts.c: Ditto. + * passes.c: Added ipa and tree-promote-statics passes. + * timevar.def: Added TV_IPA_PURE_CONST, TV_IPA_REFERENCE, + TV_IPA_TYPE_ESCAPE, and TV_PROMOTE_STATICS. + * tree-dfa.c (referenced_var_lookup_if_exists): New function. + * tree-flow.h: Added exposed sra calls and addition of + reference_vars_info field for FUNCTION_DECLS. + * tree-pass.h: Added passes. + * tree-sra.c: (sra_init_cache): New function. + (sra_insert_before, sra_insert_after) Made public. + (type_can_be_decomposed_p): Renamed from type_can_be_decomposed_p + and made public. + * tree-ssa-alias.c (dump_alias_stats): Added stats for type based + aliasing. (may_alias_p): Added code to use type escape analysis to + improve alias sets. + * tree-ssa-operands.c (add_call_clobber_ops): Added parameter and + code to prune clobbers of static variables based on information + produced in ipa-reference pass. Changed call clobbering so that + statics are not marked as clobbered if the call does not clobber + them. + +2005-07-16 Daniel Berlin + + * tree-ssa-structalias.c (need_to_solve): Need to check for preds, + too. + +2005-07-16 Eric Botcazou + + * doc/install.texi (*-*-solaris2*): Document recommended version + of GNU binutils and mention GNU linker problem on Solaris 10. + +2005-07-16 Joseph S. Myers + + PR c/22421 + * c-decl.c (c_build_bitfield_integer_type): New function. + (finish_struct): Call it. + * c-pretty-print.c (pp_c_type_specifier): Handle bit-field types. + +2005-07-16 Kaveh R. Ghazi + + * c-typeck.c (digest_init): Call 'convert_for_assignment' + before returning. + +2005-07-16 Jan Hubicka + + * cfg.c (update_bb_profile_for_threading): Fix profile updating. + (scale_bbs_frequencies_int): Watch roundoff errors. + * predict.c (return_prediction): Initialize return_stmt. + +2005-07-16 Jan Hubicka + + * profile.c (rest_of_handle_branch_prob): Fix handling of estimation + after RTL profiling. + +2005-07-11 Andrew Pinski + + PR middle-end/22398 + * fold-const.c (build_range_check): Convert high/low to etype + if we are only comparing against exp. + +2005-07-13 Daniel Berlin + + Fix PR tree-optimization/22376 + * tree-ssa-structalias.c (build_constraint_graph): We really meant + special var here. + (need_to_solve): New function. + (compute_points_to_sets): Use it. + +2005-07-15 Jan Hubicka + + * cfg.c (update_bb_profile_for_threading): More diagnostic. + * tree-ssa-threadupdate.c (redirect_edges): Update profile of dup_block. + +2005-07-15 Richard Guenther + + * c-common.c (handle_flatten_attribute): New function. + Add flatten function attribute. + * doc/extend.texi: Document flatten function attribute. + * Makefile.in (ipa-inline.o): Depend on hashtab.h. + * ipa-inline.c (cgraph_find_cycles, cgraph_flatten_node): + New functions. + (cgraph_decide_inlining): Handle functions with flatten + attribute. + +2005-07-14 David Edelsohn + + * config/rs6000/rs6000.md (UNSPEC_SYNC, UNSPEC_LWSYNC, + UNSPEC_ISYNC, UNSPEC_SYNC_OP, UNSPEC_ATOMIC, UNSPEC_CMPXCHG, + UNSPEC_XCHG, UNSPEC_AND): New. + (UNSPECV_ATOMIC, UNSPECV_SYNC, UNSPECV_SYNC_OP, UNSPECV_CMPXCHG, + UNSPECV_LWSYNC, UNSPECV_ISYNC): Delete. + * config/rs6000/sync.md (FETCHOP): New code macro. + (fetchop_name, fetchop_pred, fetchopsi_constr, fetchopdi_constr): + New code attrs. + (memory_barrier, sync_internal): Use unspec instead of unspec_volatile. + (sync_compare_and_swap): Same. + (sync_lock_test_and_set): Same. + (sync_, sync_nand): Only use rs6000_emit_sync + for QImode and HImode, and not PPC405. + (sync_old_, sync_old_nand): Same. + (sync_new_, sync_new_nand): Same. + (sync_{si,di}_internal): New. + (sync_nand{si,di}_internal): New. + (sync_old_{si,di}_internal): New. + (sync_old_nand{si,di}_internal): New + (sync_new_{si,di}_internal): New. + (sync_new_nand{si,di}_internal): New. + (atomic_and{si,di}): New. + (sync_new_nand{si,di}_internal): New. + (atomic_and{si,di}): New. + (sync_add_internal): Delete. + (sync_addshort_internal): Use unspec instead of unspec_volatile. + (sync_sub_internal): Delte. + (sync_subshort_internal): New. + (sync_andsi_internal): Use unspec instead of unspec_volatile. + (sync_anddi_internal): Delete. + (sync_boolsi_internal): Use unspec instead of unspec_volatile. + (sync_booldi_internal): Delete. + (sync_boolc_internal): Delete. + (sync_boolcshort_internal): Use unspec instead of unspec_volatile. + (sync_boolc_internal2): Delete. + (sync_boolcc_internal): Delete. + (isync, lwsync): Use unspec instead of unspec_volatile. + * config/rs6000/rs6000.c (rs6000_emit_sync): Implement MINUS. + Revert UNSPEC_VOLATILE. + (rs6000_split_atomic_op): New. + * config/rs6000/rs6000-protos.h (rs6000_split_atomic_op): Declare. + +2005-07-14 Eric Christopher + + * config/mips/mips.c (mips_canonicalize_comparison): Cast + argument of trunc_int_for_mode to unsigned HOST_WIDE_INT. + +2005-07-14 Eric Christopher + + * config/s390/t-tpf (SHLIB_MAPFILES): Remove. + +2005-07-14 Steven Bosscher + + PR tree-optimization/22230 + * tree-vrp.c (extract_range_from_binary_expr): Fix logics thinko in + the computation of the four cross productions for "range op range". + +2005-07-14 Alexandre Oliva + Ulrich Weigand + + PR target/20126 + * loop.c (loop_givs_rescan): Do not ICE if unable to reduce an IV + in some insn. + +2005-07-14 Ulrich Weigand + + * config/s390/s390.h (TARGET_TPF_PROFILING): Add default definition. + +2005-07-14 Steve Ellcey + + * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Support ILP32 mode. + +2005-07-14 Richard Guenther + + PR middle-end/22347 + * config/i386/i386-protos.h (ix86_function_value): Change + prototype to match new target hook. + * config/i386/i386.c (ix86_value_regno): Change prototype + to take extra type argument. + (TARGET_FUNCTION_VALUE): Define. + (ix86_function_ok_for_sibcall): Pass extra argument to + ix86_value_regno, check return slot rtx for exact match. + (ix86_function_value): Take extra parameter. Dispatch to + ix86_value_regno with fndecl/fntype as provided. + (ix86_value_regno): Handle extra type argument. + * config/i386/i386.h (FUNCTION_VALUE): No longer define. + + * testsuite/gcc.target/i386/sseregparm-3.c: New testcase. + * testsuite/gcc.target/i386/sseregparm-4.c: New testcase. + * testsuite/gcc.target/i386/sseregparm-5.c: New testcase. + * testsuite/gcc.target/i386/sseregparm-6.c: New testcase. + * testsuite/gcc.target/i386/sseregparm-7.c: New testcase. + +2005-07-14 Richard Guenther + + * Makefile.in (explow.o, reg-stack.o): Depend on target.h. + * calls.c (expand_call): Pass fntype to hard_function_value. + (emit_library_call_value_1): Likewise. + * explow.c: Include target.h. + (hard_function_value): Take extra argument, the fntype. + Use new target hook for function_value. + * expr.h (hard_function_value): Change prototype. + * function.c (aggregate_value_p): Pass 0 as fntype to + hard_function_value. + (assign_parms): Use new target hook for function_value. + Pass 0 as fntype to hard_function_value. + (expand_function_end): Likewise. + * reg-stack.c: Include target.h. + (stack_result): Use new target hook for function_value. + * target-def.h: New target hook function_value. + * target.h: Likewise. + * targhooks.c (default_function_value): New function. + * targhooks.h (default_function_value): Declare. + +2005-07-13 Ian Lance Taylor + + * config/mips/mips.h (CLZ_DEFINED_VALUE_AT_ZERO): Define. + +2005-07-14 Jan Hubicka + + * tree-dfa.c (dump_variable): Use default_def function. + * tree-ssa-alias.c (dump_points_to_info): Likewise. + * tree-ssa.c (verify_use): Likewise. + * tree-ssanames.c (release_ssa_name): Likewise. + * tree-tailcall.c (eliminate_tail_call): Likewise. + (tree_optimize_tail_calls_1): Likewise. + * tree-vrp.c (get_value_range): Likewise. + +2005-07-14 Ben Elliston + + * gcc.c (main): Compare language[0] with '*' when iterating over + the infiles. + +2005-07-13 Adrian Straetling + + * config/s390/s390.c: (s390_cc_modes_compatible): Move before + "s390_emit_compare". Add handling of CCZ1mode. + (s390_canonicalize_comparison): Simplify cascaded EQ, NE. + (390_emit_compare): Use "s390_cc_modes_compatible" for mode + checking. + (s390_branch_condition_mask): Add CCZ1mode handling. + * config/s390/s390.md: ("seq", "*seq"): New pattern. + ("sync_compare_and_swap_cc", "*sync_compare_and_swap_cc"): + Use CCZ1mode instead of CCZmode. + * config/s390/s390-modes.def: Add CCZ1mode. Comment new mode. + +2005-07-13 Adrian Straetling + + * config/s390/s390.md: ("cmpstrsi", "*cmpstr"): New + pattern. + ("strlen", "*strlen"): Use hard reg 0 in SImode. + +2005-07-13 Eric Christopher + + * config/mips/mips.c (mips_canonicalize_comparison): New. + (mips_emit_int_relational): Use. + +2005-07-13 Eric Christopher + + * config.gcc (s390x-ibm-tpf*): Add extra_options. Remove + static extra parts. + * config/s390/s390.md: Include tpf.md. Move tpf specific + patterns... + * config/s390/tpf.md: To here. + * config/s390/s390.opt: Move tpf specific options... + * config/s390/tpf.opt: to here. Add mmain option. + * config/s390/tpf-unwind.h: Remove unnecessary defines. + * config/s390/tpf.h: Rewrite. + +2005-07-13 H.J. Lu + + * doc/tm.texi: Remove @xref{Cross-profiling}. + +2005-07-13 Jeff Law + + * fold-const.c (fold_binary): When comparing two simple ADDR_EXPR + expressions, test their _DECL operands for pointer equality rather + than using operand_equal_p. + +2005-07-13 H.J. Lu + + * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Renamed to ... + (TARGET_POSIX_IO): This. + * config/darwin.h: Likewise. + * config/freebsd.h: Likewise. + * config/linux.h: Likewise. + * config/lynx.h: Likewise. + * config/netbsd.h: Likewise. + * config/rs6000/linux64.h: Likewise. + * config/rs6000/linux.h: Likewise. + * config/s390/tpf.h: Likewise. + * config/sh/embed-elf.h: Likewise. + * config/sparc/linux64.h: Likewise. + * config/sparc/linux.h: Likewise. + * config/svr4.h: Likewise. + * gcov-io.h: Likewise. + + * doc/tm.texi: Updated. + + * libgcov.c (create_file_directory): Defined only if + TARGET_POSIX_IO is defined. + (gcov_exit): Call create_file_directory only if TARGET_POSIX_IO + is defined. + +2005-07-13 Jan Hubicka + + * tree-ssa-operands.c (get_expr_operands): Fix typo in previous patch. + +2005-07-13 David Edelsohn + + * tree-ssa-dom.c (lookup_avail_expr): Do not pass member in freed + structure as argument. + +2005-07-13 Paolo Bonzini + + PR tree-optimization/21921 + * tree-iterator.c (tsi_link_before): Support the case when + tsi_end_p (tsi) == true. + +2005-07-12 Zdenek Dvorak + + PR tree-optimization/22442 + * tree-chrec.c (chrec_fold_multiply_poly_poly): Associate chrecs + correctly. + +2005-07-12 Zdenek Dvorak + + PR rtl-optimization/20376 + * toplev.c (process_options): Enable -fweb and -frename-registers when + unrolling. + * doc/invoke.texi: Update the information about when -fweb and + -frename-registers are enabled. + +2005-07-12 Andrew Pinski + + PR tree-opt/21840 + * tree-ssa-pre.c (eliminate): Convert the sprime to the correct type + if *rhs_p is not a SSA_NAME. + +2005-07-12 Daniel Berlin + + Fix PR tree-optimization/22422 + * tree-ssa-structalias.c (struct variable_info): Add flag for + special vars. + (get_varinfo): Now a static function. + (new_varinfo): init has_union and is_special_var to false. + (solution_set_add): Check has_union. + (do_da_constraint): Move temporary variable so it gets reset + properly. + Also check for special variable. + (do_ds_constraint): Ditto. + (do_sd_constraint): Ditto. + (do_structure_copy): Check for special variable. + (find_func_aliases): Ditto. + (init_base_vars): Set special vars properly. + +2005-07-13 Jan Hubicka + + * cfgexpand.c (expand_one_stack_var): Do not expand variables when we + do unit-at-a-time. + + * tree-ssa-operands.c (parse_ssa_operands): Fix formatting. + (get_expr_operands): Fix thinko wrt flags and subvars. + + PR tree-optimize/22379 + * tree-inline.c (expand_call_inline): Do not output sorry in early + inlining. + +2005-07-12 Dale Johannesen + + * config/rs6000.c (rs6000_rtx_cost): Move FLOAT_EXTEND. + +2005-07-12 Andrew Pinski + + PR bootstrap/21704 + * host-linux.h: Include limits.h. + +2005-07-12 Dale Johannesen + + * expr.c (compress_float_constant): Add cost check. + * config/rs6000.c (rs6000_rtx_cost): Adjust FLOAT_EXTEND cost. + +2005-07-12 Dale Johannesen + + * gcc.target/i386/compress-float-sse.c: New. + * gcc.target/i386/compress-float-sse-pic.c: New. + * gcc.target/i386/compress-float-387.c: New. + * gcc.target/i386/compress-float-387-pic.c: New. + * gcc.dg/compress-float-ppc.c: New. + * gcc.dg/compress-float-ppc-pic.c: New. + +2005-07-12 Eric Christopher + + * config.gcc (s390x-ibm-tpf*): Add extra_options. Remove + static extra parts. + * config/s390/s390.md: Include tpf.md. Move tpf specific + patterns... + * config/s390/tpf.md: To here. + * config/s390/s390.opt: Move tpf specific options... + * config/s390/tpf.opt: to here. Add mmain option. + * config/s390/tpf-unwind.h: Remove unnecessary defines. + * config/s390/tpf.h: Rewrite. + +2005-07-12 Eric Christopher + + * gcc.c (struct infile): Update comment for language. + (main): Rewrite input file resetting code. + +2005-07-12 Andrew Pinski + + PR tree-opt/22335 + * tree-ssa-dom.c (eliminate_redundant_computations): Reject the prop if + requiring a cast in a non RHS of modify_expr. Add a cast when required. + (lookup_avail_expr): Use constant_boolean_node instead + of boolean_false_node/boolean_true_node. + +2005-07-12 Ben Elliston + + * tree-cfg.c (dump_cfg_stats): Add a new fmt_str_2 format string + and use it when printing num_edges. + +2005-07-12 Bernd Schmidt + + * doc/extend.texi (Blackfin Built-in Functions): New section. + * doc/invoke.texi (mcsync-anomaly, mno-csync-anomaly): Fix the + @opindex. + +2005-07-12 Adrian Straetling + + * builtins.c: (expand_builtin_memcmp, expand_builtin_strncmp): + s/cmpstrsi/cmpstrnsi + (expand_builtin_strcmp): Rewrite to support both 'cmpstrsi' and + 'cmpstrnsi'. + * optabs.c: (prepare_cmp_insn): Add availability of 'cmpstrn'. + (init_optabs): Initialize cmpstrn_optab. + * optabs.h: (enum insn_code cmpstrn_optab): Declare. + * genopinit.c: (optabs[]): Add 'cmpstrn' to initialisation. + * expr.c: (enum insn_code cmpstrn_optab): Declare. + * config/i386/i386.md: s/cmpstr/cmpstrn + * config/c4x/c4x.md: s/cmpstr/cmpstrn + * doc/md.texi: Update documentation. + +2005-07-11 Richard Henderson + + * config/alpha/alpha.c (alpha_gimplify_va_arg_1): Use + build_va_arg_indirect_ref. + (alpha_gimplify_va_arg): Likewise. + * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. + * config/i860/i860.c (i860_gimplify_va_arg_expr): Likewise. + * config/mips/mips.c (mips_gimplify_va_arg_expr): Likewise. + * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. + * config/sh/sh.c (sh_gimplify_va_arg_expr): Likewise. + * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_arg): + Likewise. + * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise. + +2005-07-12 Zdenek Dvorak + + * tree-flow.h (remove_empty_loops, single_dom_exit): Declare. + * passes.c (init_optimization_passes): Add pass_empty_loop. + * tree-pass.h (pass_empty_loop): Declare. + * tree-ssa-loop-ivcanon.c (empty_loop_p, remove_empty_loop, + try_remove_empty_loop, remove_empty_loops): New functions. + * tree-ssa-loop-ivopts.c (single_dom_exit): Export. + * tree-ssa-loop.c (tree_ssa_empty_loop, pass_empty_loop): New. + +2005-07-12 Peter Barada + + PR middle-end/16719 + PR middle-end/18421 + * config/m68k/m68k.h (HARD_REGNO_MODE_OK): Disallow bytes + in address registers. + * config/m68k/m68k.c (hard_regno_mode_ok): Likewise. + * config/m68k/m68k.md: Replace 's' with 'i' in 4th + alternative of addsi3_5200. + +2005-07-11 Ian Lance Taylor + + * config/mips/mips.md (ffs2): Remove. + +2005-07-11 Ian Lance Taylor + + * doc/tree-ssa.texi (Cleanups): Improve description of + TRY_FINALLY_EXPR. + (GIMPLE Exception Handling): Clarify TRY_CATCH_EXPR cases. + +2005-07-11 Daniel Berlin + + * print-tree.c (print_node): Use DECL_ARGUMENT_FLD. + * tree.h (DECL_ARGUMENT_FLD): New macro. + +2005-07-11 Daniel Berlin + + Fix PR tree-optimization/22404 + + * tree-ssa-structalias.c (create_variable_info_for): Use + correct offset. + +2005-07-11 Bernd Schmidt + + * config/bfin/bfin.md (cmpsi, compare_eq, compare_ne, compare_lt, + compare_le, compare_leu, compare_ltu): Use reg_or_const_int_operand + for second comparison operand. + * config/bfin/predicates.md (reg_or_const_int_operand): New. + + * config/bfin/bfin.md (define_attr "type"): Add "sync". + (define_insn_reservation "alu"): Likewise. + (csync, ssync): Now of type sync. + * config/bfin/bfin.h (TARGET_DEFAULT): Defaults to + -mcsync-anomaly -mspecld-anomaly. + * config/bfin/bfin.opt (mcsync): Remove. + (mcsync-anomaly, mspecld-anomaly): Add. + * config/bfin/bfin.c: Include "insn-codes.h". + (bfin_reorg): Extend to handle the CSYNC anomaly as well. + (TARGET_DEFAULT_TARGET_FLAGS): New. + * doc/invoke.texi: Document -mcsync-anomaly, -mspecld-anomaly. + +2005-07-11 Steven Bosscher + + * basic-block.h: Give the BB flags enum a name, bb_flags. + Add new flags BB_FORWARDER_BLOCK, and BB_NONTHREADABLE_BLOCK. + * cfgcleanup.c (enum bb_flags): Remove here. + (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG): Remove. + (notice_new_block): Set/test bb->flags instead of aux via BB_FLAGS. + (update_forwarder_flag): Likewise. + (thread_jump): Likewise. + (try_forward_edges): Likewise. + (try_optimize_cfg): Likewise. Clear bb->flags before updating the + forwarder flags. Don't clear bb->aux for all basic blocks. Only + reset the BB_FORWARDER_BLOCK and BB_NONTHREADABLE_BLOCK flags. + +2005-07-11 Richard Guenther + + * config/i386/i386.opt: New target option -msseregparm. + * config/i386/i386.c (override_options): Error out for + -msseregparm but no SSE support. + (ix86_function_sseregparm): Check for global sseregparm. + * doc/invoke.texi: Document -msseregparm. + +2005-07-11 Kazuhiro Inaoka + + * config.gcc (m32r-*-linux*): Use the default extra_parts. + (m32rle-*-linux*): Ditto. + +2005-07-11 Jakub Jelinek + + * cfgexpand.c (stack_protect_classify_type): Use TYPE_SIZE_UNIT (type) + instead of TYPE_MAX_VALUE (TYPE_DOMAIN (type)) to get array size in + bytes. + +2005-07-10 John David Anglin + + PR middle-end/22239 + PR target/20126 + * loop.c (loop_givs_rescan): Use expand_simple_binop instead of + gen_rtx_MINUS to handle non-replaceable (plus ((x) (const)). + +2005-07-07 Daniel Berlin + + * tree-ssa-structalias.c (struct variable_info): Heapify complex. + (varmap): Heapify varmap. + (constraints): Heapify constraints. + (struct constraint_graph): Heapify succs and preds. + (constraint_vec_find): Update for heapification. + (constraint_set_union): Ditto. + (insert_into_complex): Ditto. + (constraint_edge_vec_find): Ditto. + (erase_graph_self_edge): Ditto. + (add_graph_edge): Ditto. + (get_graph_weights): Ditto. + (merge_graph_nodes): Ditto. + (build_constraint_graph): Ditto. + (topo_visit): Ditto. + (solve_graph): Ditto. + (create_variable_info_for): Ditto. + (init_base_vars): Ditto. + (delete_points_to_sets): Free graph, varmap, and complex constraints. + (condese_varmap_nodes): Free complex vector. + (clear_edges_for_node): Clear succs and preds vector. + +2005-07-10 Daniel Berlin + + * tree-ssa-structalias.c (update_alias_info): Change counting of + references to not include vdefs. + +2005-07-10 Daniel Berlin + + * tree-ssa-alias.c (free_used_part_map): Add missing free. + (up_insert): Ditto. + +2005-07-10 John David Anglin + + * pa.c (pa_commutative_p): Make PLUS commutative when + TARGET_NO_SPACE_REGS is true. + +2005-07-09 Diego Novillo + + * Makefile.in (tree-ssa-alias.o): Depend on tree-ssa-structalias.h + * tree-cfg.c (CHECK_OP): Only test for is_gimple_val. + * tree-dfa.c (dump_subvars_for): New. + (debug_subvars_for): New. + (dump_variable): Show subvariables if VAR has them. + * tree-flow-inline.h (get_subvar_at): New. + (overlap_subvar): Change offset and size to unsigned HOST_WIDE_INT. + * tree-flow.h (struct ptr_info_def): Remove field pt_malloc. + Update all users. + (struct subvar): Change fields offset and size to unsigned + HOST_WIDE_INT. + (dump_subvars_for): Declare. + (debug_subvars_for): Declare. + (get_subvar_at): Declare. + (okay_component_ref_for_subvars): Change 2nd and 3rd argument + to unsigned HOST_WIDE_INT *. + (overlap_subvar): Likewise. + * tree-gimple.c (is_gimple_reg): Always return false for + SFTs and memory tags. + * tree-pass.h (pass_build_pta, pass_del_pta): Remove. + Update all callers. + * tree-ssa-alias.c: Include tree-ssa-structalias.h. + (compute_may_aliases): Call compute_points_to_sets. + (collect_points_to_info_for): Remove. + (compute_points_to_and_addr_escape): Remove. + (delete_alias_info): Call delete_points_to_sets. + (compute_flow_sensitive_aliasing): If the call to + find_what_p_points_to returns false, call set_pt_anything. + (add_may_alias): Set TREE_ADDRESSABLE when adding a new alias. + (set_pt_anything): Clear pi->pt_vars. + (set_pt_malloc): Remove. + (merge_pointed_to_info): Remove. + (add_pointed_to_expr): Remove. + (add_pointed_to_var): Remove. + (collect_points_to_info_r): Remove. + (is_escape_site): Make extern. + (create_sft): New. + (create_overlap_variables_for): Call it. + * tree-ssa-copy.c (merge_alias_info): Never merge + flow-sensitive alias information. + * tree-ssa-operands.c (get_expr_operands): Adjust variables + offset and size to be unsigned HOST_WIDE_INT. + (add_to_addressable_set): Rename from note_addressable. + Set TREE_ADDRESSABLE as the variables are added to the set. + Update all users. + (add_stmt_operand): Do not try to micro-optimize unmodifiable + operands into VUSEs when adding V_MAY_DEFs for members in an + alias set. + * tree-ssa-operands.h (add_to_addressable_set): Declare. + * tree-ssa-structalias.c: Include tree-ssa-structalias.h last. + (struct variable_info): Add bitfield is_heap_var. + (var_anyoffset, anyoffset_tree, anyoffset_id): Declare. + (new_var_info): Initialize is_heap_var. + (get_constraint_for): Add HEAP variables to the symbol table. + Mark them with is_heap_var. + (update_alias_info): New. Taken mostly from the old + compute_points_to_and_addr_escape. + (handle_ptr_arith): New. + (find_func_aliases): Call update_alias_info. + Call handle_ptr_info for tcc_binary expressions. + Call mark_stmt_modified. + (create_variable_info_for): If DECL has subvars, do not create + variables for its subvars. Always add all the fields. + (set_uids_in_ptset): If the solution includes ANYOFFSET and + SFTs, then add all the SFTs of the structure. + If VI->DECL is an aggregate with subvariables, add the SFT at + VI->OFFSET. + (find_what_p_points_to): If VI is an artificial variable, + translate to bitfields in SSA_NAME_PTR_INFO. + If the solution is empty, set pi->pt_vars to NULL + (init_base_vars): Create ANYOFFSET. + (compute_points_to_sets): Rename from create_alias_vars. + Make extern. + (pass_build_pta): Remove. + (delete_points_to_sets): Rename from delete_alias_vars. + (pass_del_pta): Remove. + * tree-ssa-structalias.h (struct alias_info): Move from + tree-ssa-alias.h. + (NUM_REFERENCES, NUM_REFERENCES_CLEAR, NUM_REFERENCES_INC, + NUM_REFERENCES_SET): Likewise. + (compute_points_to_sets, delete_points_to_sets): Declare. + +2005-07-09 Richard Henderson + + * config/alpha/alpha.c (emit_insxl, alpha_expand_compare_and_swap_12, + alpha_split_compare_and_swap_12, alpha_expand_lock_test_and_set_12, + alpha_split_lock_test_and_set_12): New functions. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (UNSPEC_MB, UNSPEC_ATOMIC, + UNSPEC_CMPXCHG, UNSPEC_XCHG): Rename from UNSPECV_FOO. + * config/alpha/sync.md (I12MODE): New. + (memory_barrier, mb_internal): Use unspec instead of unspec_volatile. + (sync_): Likewise. + (sync_nand): Likewise. + (sync_old_): Likewise. + (sync_new_): Likewise. + (sync_old_nand, sync_new_nand): Likewise. + (sync_compare_and_swap): Likewise. + (sync_lock_test_and_set): Likewise. + (sync_compare_and_swap): New. + (sync_compare_and_swap_1): New. + (sync_lock_test_and_set): New. + (sync_lock_test_and_set_1): New. + +2005-07-09 Diego Novillo + + PR 21356 + PR 22332 + * passes.c (execute_todo): Cleanup the CFG before updating SSA. + +2005-07-09 Jakub Jelinek + + * config/i386/i386.c (output_set_got): Don't omit OFFSET FLAT: + in Intel syntax add %reg, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_+(.-.Lx). + +2005-07-09 Richard SAndiford + + PR target/21656 + * config/mips/elf.h (NO_IMPLICIT_EXTERN_C): Define. + +2005-07-08 David Edelsohn + + * config/rs6000/sync.md (load_locked_): Use Z for + memory_operand constraint. + (store_conditional_): Same. + (sync_compare_and_swap): Same. + (sync_lock_test_and_set): Same. + +2005-07-08 Hans-Peter Nilsson + + Rewrite PIC support to more closely model actual instructions. + * config/cris/cris-protos.h (cris_gotless_symbol, cris_got_symbol) + (cris_symbol): Remove prototypes for removed functions. + (cris_pic_symbol_type_of, cris_valid_pic_const) + (cris_expand_pic_call_address): Prototypes for new functions. + * config/cris/cris/cris.c (cris_pic_sympart_only): Remove unused + variable. + (cris_print_operand) : Remove cases for unused + modifiers. + : Add case for new punctuation character. + : Temporarily set flag_pic = 2 instead of incorrectly + emitting (extra) PIC modifier. + : Do not assert for PLT. + (cris_initial_frame_pointer_offset, cris_simple_epilogue) + (cris_expand_prologue, cris_expand_epilogue): Check + for pic_offset_table_rtx usage instead of taking + current_function_uses_pic_offset_table as the final word. + (cris_rtx_costs, cris_address_cost, cris_side_effect_mode_ok): + Remove flag_pic difference. + (cris_valid_pic_const, cris_pic_symbol_type_of): New functions, + the moral equivalents of... + (cris_symbol, cris_gotless_symbol, cris_got_symbol): Remove + functions. + (cris_legitimate_pic_operand): Just call cris_valid_pic_const. + (cris_handle_option): Mark ARG as unused. + (cris_expand_pic_call_address): New worker function for "call", + "call_value". + (cris_asm_output_symbol_ref, cris_asm_output_label_ref): Do not + output PIC constructs here. + (cris_output_addr_const_extra): Changes for emitting PIC modifiers + as symbol-specific modifers, not whole or part of operands. + * config/cris/cris/cris.h (EXTRA_CONSTRAINT): Remove 'U' case. + (EXTRA_CONSTRAINT_S): Changed semantics: allow only CONST-wrapped + constants and flag_pic. + (CONSTANT_INDEX_P): Adjust for new functions. + (enum cris_pic_symbol_type): New helper type. + (PRINT_OPERAND_PUNCT_VALID_P): Add ':'. + * config/cris/cris/cris.md (CRIS_UNSPEC_GOTREL) + (CRIS_UNSPEC_GOTREAD, CRIS_UNSPEC_PLTGOTREAD): New + define_constants. + ("movsi"): Emit actual instructions for GOT and relative access. + ("*movsi_got_load"): New pattern to set up the register holding + the GOT pointer. + ("*movsi_internal"): Operand 1 is not a plain general_operand. + Adjust FIXME for 'S'. + : Sanity-check UNSPEC types for PIC. + Use "movs" for -fpic cases. + ("addsi3"): Add alternative for 'S'; use adds.w when possible. + ("uminsi3","*expanded_call_value"): Remove 'S' alternative. + ("call", "call_value"): Just call cris_expand_pic_call_address for + PIC addresses. + ("*expanded_call_no_gotplt", "*expanded_call_value_no_gotplt"): + Remove special pattern. + ("*expanded_call_side", "*expanded_call_value_side"): New + patterns. + (gotplt-to-plt, gotplt-to-plt-side-call) + (gotplt-to-plt-side-call-value, gotplt-to-plt-side): New + peephole2:s. + * config/cris/cris/predicates.md + ("cris_general_operand_or_gotless_symbol"): Remove unused + predicate. + ("cris_general_operand_or_symbol"): Adjust for new functions. + +2005-07-08 Andrew Pinski + + * config/darwin.h (TARGET_C99_FUNCTIONS): Define to 1. + +2005-07-08 Daniel Berlin + + * Makefile.in (TREE_H): Add treestruct.def. + (c-decl.o): Add pointer-set.h + * c-decl.c (diagnose_mismatched_decls): Don't attempt to look at + visibility on regular DECL's. + (merge_decls): Fix the copying of decl nodes of various types for + the new structures. Don't update RTL, section name, weak status, + etc, on DECL's without RTL. + (grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone. + Don't check volatile on non-variable types. + (store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK + to check whether we have seen arguments. + * c-objc-common.c (c_tree_printer): Reverse order of tests so that + flag is checked before field (flag is common, field is not). + * dwarf2out.c (decl_ultimate_origin): Only DECL's with + TS_DECL_COMMON could have an origin. + (add_location_or_const_value_attribute): Don't check section name + on non-var/function decls. + (dwarf2out_var_location): Reverse order of tests. + * emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace + with DECL_WRTL_CHECK. + * expmed.c (make_tree): rtl is now in decl_with_rtl. + * fold-const.c (fold_binary): Don't check weakness on + non-var/function decls. + (tree_expr_nonzero_p): Ditto. + (fold_checksum_tree): Use tree_decl_extra as sizeof + buffer. + * ggc-page.c (extra_order_size_table): Add sizes for + tree_decl_non_common, tree_parm_decl, tree_var_decl, and + tree_field_decl. + * gimplify.c (gimplify_bind_expr): Only set + DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL. + * integrate.c (copy_decl_for_inlining): Don't set RTL on decl's + without RTL. + * langhooks-def.h (LANG_HOOK_INIT_TS): New. + * langhooks.h (init_ts). New langhook. + * passes.c (rest_of_decl_compilation): Reverse order of tests. + * print-tree.c (print_node): Update to only print fields that + exist in the structures the passed decl has. + * toplev.c (wrapup_global_declarations): Don't reset + DECL_DEFER_OUTPUT on DECL's that don't contain it. + * tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed. + * tree-inline.c (remap_decl): Ditto. + * tree-outof-ssa.c (create_temp): Reverse order of tests. + * tree-pretty-print.c (print_declaration): Don't print + DECL_REGISTER on things that don't contain it. + * tree-vrp.c (expr_computes_nonzero): Don't check weakness on + non-var/function decls. + * tree.c (tree_contains_struct): New structure. + (init_priority_for_decl): New hashtable. + (tree_int_map): New structure. + (tree_int_map_eq): New function. + (tree_int_map_marked_p): Ditto. + (tree_int_map_hash): Ditto. + (tree_map): Move to tree.h. + (tree_map_eq): Externalize. + (tree_map_hash): Ditto. + (tree_map_marked_p): Ditto. + (init_ttree): Set up tree_contains_struct and call langhook. + (decl_assembler_name): Use DECL_NON_COMMON_CHECK.. + (tree_code_size): Update for new structures. + (tree_node_structure): Update for new structures. + (make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls + without the field. + (copy_node_stat): Copy init priority. + (build_decl_stat): Ditto for visibility. + (ts_enum_names): New. + (tree_contains_struct_check_failed): New function. + (decl_init_priority_lookup): Ditto. + (decl_init_priority_insert): Ditto. + * treestruct.def: New file. + * tree.h (CODE_CONTAINS_STRUCT): New macro. + (CONTAINS_STRUCT_CHECK): Ditto. + (tree_contains_struct_check_failed): New prototype. + (DECL_CHECK): Removed. + (DECL_MINIMAL_CHECK): New. + (DECL_COMMON_CHECK): Ditto. + (DECL_WRTL_CHECK): Ditto. + (DECL_NON_COMMON_CHECK): Ditto. + (DECL_WITH_VIS_CHECK): Ditto. + (VAR_OR_FUNCTION_DECL_P): Ditto + (struct tree_decl_minimal): New structure. + (struct tree_decl_common): Ditto. + (struct tree_decl_with_rtl): Ditto. + (struct tree_decl_with_vis): Ditto. + (struct tree_decl_non_common): Ditto. + (struct tree_field_decl): Ditto. + (struct tree_parm_decl): Ditto. + (struct tree_var_decl): Ditto. + (struct tree_function_decl): Ditto. + (struct tree_const_decl): Ditto. + (struct tree_result_decl): Ditto. + (union tree_node): Add new structures. + * var-tracking.c (track_expr_p): Reverse order of tests. + + * doc/c-tree.texi: Add documentation on DECL node internal structure. + +2005-07-08 Kazu Hirata + + * cfgexpand.c (tree_expand_cfg): Don't use FINALIZE_PIC. + * system.h: Poison FINALIZE_PIC. + * doc/tm.texi (FINALIZE_PIC): Remove. + +2005-07-08 Andrew Pinski + + PR tree-opt/22329 + * tree-ssa-propagate.c (fold_predicate_in): Convert the value + to the correct type if we have a MODIFY_EXPR. + +2005-07-08 Kazu Hirata + + PR tree-optimization/22360 + * tree.c (upper_bound_in_type): Fix calculations for casting + to a non-wider signed type and casting a signed value to a + wider unsigned type. + (lower_bound_in_type): Fix calculations for casting to a + non-wider signed type. + + PR tree-optimization/20139 + * tree-cfg.c (remove_bb): Check in_ssa_p before calling + release_defs. + * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Call + fold_cond_expr_cond. + * tree-ssanames.c (release_defs): Assert in_ssa_p. + * tree.c (upper_bound_in_type, lower_bound_in_type): Rewrite. + +2005-07-08 Andrew Pinski + + PR tree-opt/22356 + * tree-complex.c (expand_complex_libcall): Produce + REALPART_EXPR/IMAGPART_EXPR with the correct type. + +2005-07-08 Kenneth Zadeck + + * bitmap.c (bitmap_and, bitmap_and_into, bitmap_and_compl, + bitmap_and_compl_into, bitmap_xor, bitmap_xor_into): Removed "a != + b" assert and inserted fastpath code for this case. + (bitmap_ior): Removed "a != b" assert. + +2005-07-08 Kazuhiro Inaoka + + * config/m32r/linux.h (STARTFILE_SPEC): Support PIE. + (ENDFILE_SPEC): Likewise. + * config/m32r/m32r.h (ASM_SPEC): Likewise. + + * config/m32r/m32r.c (m32r_output_function_epilogue): Care for + a large stack frame at epilogue. + +2005-07-08 David Billinghurst + + * final.c: Include sdbout.h when required. + +2005-07-07 Geoffrey Keating + + * config.gcc (*-*-darwin*): Only one target-specific header file + for generic darwin. + (powerpc-*-darwin*): Add version-specific header files. + * configure.in (gcc_AC_CHECK_DECLS): Add strverscmp. + * config.in: Regenerate. + * configure: Regenerate. + * gcc.c: Include xregex.h. + (version_compare_spec_function): New. + (spec_function): Add version-compare. + (replace_outfile_spec_function): Reformat comment. + (compare_version_strings): New. + * config/darwin-c.c (version_as_macro): New. + (builtin_define): New. + (darwin_cpp_builtins): New. + * config/darwin-protos.h (darwin_cpp_builtins): New. + * config/darwin.h (CPP_SPEC): Don't define APPLE_CC here. + (LIB_SPEC): Make unconditional, update comment. + (TARGET_C99_FUNCTIONS): Define. + * config/darwin.opt: Sort. + (mmacosx-version-min=): New. + * config/darwin7.h: Delete. + * config/darwin8.h: Delete. + * config/i386/darwin.h (): Call darwin_cpp_builtins. + * config/rs6000/darwin.h (): Call darwin_cpp_builtins. + (TARGET_C99_FUNCTIONS): Define. + * config/rs6000/darwin7.h: New. + * config/rs6000/darwin8.h: New. + * doc/invoke.texi (Darwin Options): Add -mmacosx-version-min= + (-mmacosx-version-min): Document. + +2005-07-07 Ian Lance Taylor + + * config/mips/mips.md (abs2) [GPR]: Remove. + +2005-07-07 John David Anglin + + PR middle-end/22239 + * loop.c (loop_givs_rescan): Check that v->new_reg is a REG. + +2005-07-07 Khem Raj + + * config/arm/arm.c (thumb_output_function_prologue): Calculate offset + in bytes, not words. + +2005-07-07 Paul Brook + + * config/arm/arm.c (arm_pad_arg_upward): Compare return value of + DEFAULT_FUNCTION_ARG_PADDING to upward. + +2005-07-07 Richard Henderson + + * function.c (locate_and_pad_parm): Record parameter alignment in + stack_alignment_needed. + +2005-07-07 David Edelsohn + + * config/rs6000/rs6000.md (UNSPEC_SYNC, UNSPEC_SYNC_OP, + UNSPEC_SYNC_SWAP, UNSPEC_LWSYNC, UNSPEC_ISYNC): Delete. + (UNSPECV_LL, UNSPECV_SC, UNSPECV_ATOMIC, UNSPECV_SYNC, + UNSPECV_SYNC_OP, UNSPECV_CMPXCHG, UNSPECV_LWSYNC, UNSPECV_ISYNC): New. + (define_attr "type"): Add isync, sync, load_l, store_c. + * config/rs6000/sync.md (memory_barrier): Change to define_expand. + Create scratch volatile MEM. + (sync_internal): New. POWER mnemonic is dcs, not ics. Attribute + sync. + (load_locked_): New. + (store_conditional_): New. + (sync_compare_and_swap): Replace with splitter. + (sync_lock_test_and_set): Replace with splitter. + (sync_): Change to unspec_volatile UNSPECV_SYNC_OP + and UNSPECV_ISYNC. + (isync): Change to unspec_volatile UNSPECV_ISYNC. POWER mnemonic + is ics. Attribute isync. + (lwsync): Change to unspec_volatile UNSPECV_LWSYNC. Attribute + lwsync. + * config/rs6000/rs6000.c (rs6000_emit_sync): Use UNSPEC_VOLATILE + and UNSPECV_SYNC_OP. + (emit_unlikely_jump): New. + (emit_load_locked): New. + (emit_store_conditional): New. + (rs6000_split_compare_and_swap): New. + (rs6000_split_lock_test_and_set): New. + (is_dispatch_slot_restricted): Return 4 for TYPE_LOAD_L, + TYPE_STORE_C, TYPE_ISYNC, TYPE_SYNC. + * config/rs6000/rs6000-protos.h (rs6000_split_compare_and_swap, + rs6000_split_lock_test_and_set): Declare. + * config/rs6000/{40x.md,440.md,603.md,6xx.md,7450.md,7xx.md,8540.md, + mpc.md,power4.md,power5.md,rios1.md,rios2.md,rs64.md): Add load_l, + store_c, isync, sync. + +2005-07-07 Kelley Cook + + * Makefile.in (echo_quoted_to_gtyp): New template for outputing + filenames to gtyp-gen.h. + (s-typ-gen): Use it in place of for loops. + +2005-07-07 J"orn Rennecke + + * hooks.c (hook_bool_rtx_int_false): New function. + * hooks.h (hook_bool_rtx_int_false): Declare. + * target-def.h (TARGET_COMMUTATIVE_P): Define. + (TARGET_INITIALIZER): Add TARGET_COMMUTATIVE_P. + * target.h (struct gcc_target): Add commutative_p member. + * targhooks.c (hook_bool_rtx_commutative_p): New function. + * targhooks.h (hook_bool_rtx_commutative_p): Declare. + * pa.c (TARGET_COMMUTATIVE_P): Redefine. + (pa_commutative_p): New function. + * jump.c (target.h): Include. + (rtx_renumbered_equal_p): Use targetm.commutative_p. + * doc/tm.texi: Document TARGET_COMMUTATIVE_P. + +2005-07-07 Adrian Straetling + + * config/s390/s390-protos.h (s390_expand_clrmem): Delete. + (s390_expand_setmem): New. + * config/s390/s390.c: Likewise. + (print_shift_count_operand): Truncate to 12 bits instead of 6. + Adapt comments. + * config/s390/s390.md: ("setmem"): Accept character as + general_operand. Call new function "s390_expand_setmem". + ("clrmem_long", "*clrmem_long"): Rewrite to ... + ("setmem_long", "*setmem_long"): ... this. + +2005-07-07 Adrian Straetling + + * config/s390/s390.c: (optimization_options): Enable + TARGET_MVCLE at -Os. + * doc/invoke.texi: Document changes in default behaviour. + * config/s390/s390.opt: ("mvcle"): Fix typo: is "mmvcle". + +2005-07-07 Adrian Straetling + + * expr.c: (set_storage_via_setmem): Convert opchar to mode + defined by back-end. + +2005-07-07 Jakub Jelinek + + * config/sparc/sparc.md (stack_protect_testsi): Put clobbers after + all sets in the pattern. + * config/rs6000/rs6000.md (stack_protect_testsi, + stack_protect_testdi): Likewise. + +2005-07-06 Jeff Law + + * tree-vrp.c (simplify_using_ranges): Kill. + (vrp_finalize): Remove call to simplify_using_ranges. + (simplify_stmt_using_ranges): New function extracted from + simplify_using_ranges. + (simplify_div_or_mod_using_ranges): Likewise. + (simplify_abs_using_ranges): Likewise. + (simplify_cond_using_ranges): New function. + * tree-flow.h (simplify_stmt_using_ranges): Prototype. + * tree-ssa-propagate.c (substitute_and_fold): Call + simplify_stmt_using_ranges if we have range information. + +2005-07-06 James E. Wilson + + * config/ia64/ia64.c (ia64_reorg): Check optimize before + ia64_flag_schedule_isns2. + + * config/ia64/ia64.c (ia64_expand_movxf_movrf): Don't word swap when + reading/writing general registers. + (ia64_function_arg): Revert 2005-06-18 change. + +2005-07-06 John David Anglin + + * pa.c (legitimize_pic_address): Use gcc_assert instead of abort. + (legitimize_tls_address): Use gcc_unreachable instead of abort. + +2005-07-06 Kaz Kojima + + * function.c (expand_function_end): Revert part of 2005-06-27 + patch. Do sjlj_emit_function_exit_after after return_label. + +2005-07-06 Kazu Hirata + + * doc/install.texi (--disable-libssp): New. + +2005-07-06 Fariborz Jahanian + + * doc/invoke.texi: Update -fforce-mem documentation. + * dojump.c (compare_from_rtx,do_compare_rtx_and_jump): Remove + code for -fforce-mem. + * expmed.c: (store_bit_field,store_fixed_bit_field, + extract_bit_field): Ditto. + * expr.c: (convert_move): Ditto. + * optabs.c: (expand_binop,expand_twoval_unop,expand_twoval_binop, + expand_unop,emit_unop_insn,prepare_cmp_insn,emit_conditional_move, + emit_conditional_add,expand_float,expand_fix): Ditto. + * opts.c: (decode_options): Remove setting of flag_force_mem flag. + (common_handle_option): Issue warning when -fforce-mem specified. + +2005-07-06 Paul Brook + + * aclocal.m4: Work around a bug in AC_PATH_PROGS when its last + argument is empty. + * configure: Regenerate. + +2005-07-06 J"orn Rennecke + + * sh.c (final_prescan_insn): Undo bogus change from 2005-05-09. + +2005-07-06 Daniel Berlin + + Fix PR tree-optimization/22319 + Fix PR tree-optimization/22140 + Fix PR tree-optimization/22310 + + * tree-ssa-structalias.c (do_structure_copy): Give up earlier on + variable sized types. + Use correct type for intermediate structure on *a = *b structure + copies. + +2005-07-06 Jakub Jelinek + + * config/rs6000/rs6000.h (RS6000_VARARGS_AREA, RS6000_VARARGS_SIZE): + Remove. + (STARTING_FRAME_OFFSET): Don't add RS6000_VARARGS_AREA. + (machine_function): Move typedef to... + * config/rs6000/rs6000.c (machine_function): ... here. Add + varargs_save_offset field. + (rs6000_stack_t): Remove varargs_size field. + (setup_incoming_varargs): Allocate varargs save area using + assign_stack_local, try to make it as small as possible. + Save offset from virtual_stack_vars_rtx to the save area + in cfun->machine->varargs_save_offset. Use UNITS_PER_FP_WORD + instead of magic 8 when fp word byte size is used. + (rs6000_va_start): Use cfun->machine->varargs_save_offset + instead of -RS6000_VARARGS_SIZE. + (rs6000_stack_info, debug_stack_info, + rs6000_initial_elimination_offset): Remove all traces of + varargs_size. + * config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Remove. + * config/rs6000/darwin.h (STARTING_FRAME_OFFSET): Don't add + RS6000_VARARGS_AREA. + +2005-07-06 Zdenek Dvorak + + PR tree-optimization/21963 + * tree-ssa-loop-ivopts.c (get_computation_aff): Use + constant_multiple_of in the same way get_computation_cost_at does. + +2005-07-06 Jakub Jelinek + + * config/sparc/sparc.h (sparc_compare_emitted): New extern. + * config/sparc/sparc.c (sparc_compare_emitted): New variable. + (gen_compare_reg): If sparc_compare_emitted is set, clear it + and return its previous value. + (emit_v9_brxx_insn): Assert sparc_compare_emitted is NULL. + * config/sparc/sparc.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New + constants. + (stack_protect_set, stack_protect_test): New expanders. + (stack_protect_setsi, stack_protect_setdi, stack_protect_testsi, + stack_protect_testdi): New insns. + * config/sparc/linux.h (TARGET_THREAD_SSP_OFFSET): Define. + * config/sparc/linux64.h (TARGET_THREAD_SSP_OFFSET): Define. + +2005-07-06 Jeff Law + + * tree-ssa-dce.c (cfg_altered): New global. + (tree_dce_init): Initialize cfg_altered. + (remove_dead_stmt): If we remove an edge in the CFG, then set + CFG_ALTERED. + (perform_tree_ssa_dce): If we altered the CFG, then invalidate + the dominators. + +2005-07-06 Kazu Hirata + + * Makefile.in (stamp-collect-ld): Use + $(ORIGINAL_LD_FOR_TARGET) instead of $<. Don't remove + ./collect-ld if it already exists. + (stamp-nm): Use $(ORIGINAL_NM_FOR_TARGET) instead of $<. + Don't remove ./nm if it already exists. + +2005-07-05 Devang Patel + + * tree-vectorizer.h (struct _loop_vec_info): Remove loop_line_number. + (LOOP_VINFO_LOC, LOOP_LOC): Remove. + * tree-vectorizer.c (vect_loop_location): New. + (vect_print_dump_info): Use vect_loop_location. + (new_loop_vec_info): Do not set LOOP_VINFO_LOC. + (vectorize_loops): Set vect_loop_location. + * tree-vect-analyze.c (vect_analyze_offset_expr, + vect_determin_vectorization_factor, vect_analyze_operations, + vect_analyze_scalar_cycles, vect_analyze_data_ref_dependence, + vect_analyze_data_ref_dependences, vect_compute_data_ref_alignment, + vect_analyze_data_refs_alignment, vect_analyze_data_ref_access, + vect_analyze_data_ref_accesses, vect_analyze_pointer_ref_access, + vect_object_analysis, vect_analyze_data_refs, vect_mark_relevant, + vect_stmt_relevant_p, vect_mark_stmts_to_be_vectorized, + vect_can_advance_ivs_p, vect_get_loop_niters, vect_analyze_loop_form, + vect_analyze_loop): Adjust vect_print_dump_info API. + * tree-vect-transform.c (vect_create_addr_base_for_vector_ref, + vect_create_data_ref_ptr, vect_init_vector, vect_get_vec_def_for_operand, + vect_finish_stmt_generation, vectorizable_assignment, + vectorizable_operation, vectorizable_store, vectorizable_load, + vectorizable_live_operation, vectorizable_condition, vect_transform_stmt, + vect_update_ivs_after_vectorizer, vect_do_peeling_for_loop_bound, + vect_gen_ninters_for_prolog_loop, vect_do_peeling_for_alignment, + vect_transform_loop): Same. + * tree-vectorizer.c (get_vectype_for_scalar_type, vect_is_simple_use, + vect_is_simple_reduction, vect_is_simple_iv_evolution, vectorize_loops): + Same. + +2005-07-05 Randolph Chung + + * configure.ac (hppa*-*-linux*: Check for a TLS capable gas. + * configure: Regenerate. + * config/pa/pa-protos.h (tls_symbolic_operand): Declare. + (pa_tls_referenced_p): Declare. + * config/pa/pa.c (legitimize_pic_address): Reject TLS operands. + (gen_tls_tga, gen_tls_get_addr, hppa_tls_call): New. + (legitimize_tls_address): New. + (hppa_legitimize_address): Handle TLS addresses. + (pa_tls_symbol_ref_1, pa_tls_referenced_p): New. + (TARGET_CANNOT_FORCE_CONST_MEM): Define. + (emit_move_sequence): Handle TLS addresses. + (pa_encode_section_info): Call default handler to handle common + sections. + * config/pa/pa.h (PA_SYMBOL_REF_TLS_P): New. + (CONSTANT_ADDRESS_P): Reject TLS operands. + (TARGET_HAVE_TLS) [HAVE_AS_TLS]: Define. + * config/pa/pa.md (UNSPEC_TP, UNSPEC_TLSGD, UNSPEC_TLSLDM) + (UNSPEC_TLSLDO, UNSPEC_TLSLDBASE, UNSPEC_TLSIE) + (UNSPEC_TLSLE): Define new constants. + (tgd_load, tld_load, tld_offset_load, tp_load, tie_load, tle_load): New. + * config/pa/predicates.md (symbolic_operand): Reject TLS operands. + (tls_symbolic_operand, tgd_symbolic_operand, tld_symbolic_operand) + (tie_symbolic_operand, tle_symbolic_operand): New + +2005-07-06 Kelley Cook + + * aclocal.m4: Update macros for autoconf 2.59 style. + * configure.ac: Likewise. + +2005-07-05 John David Anglin + + * pa.c (function_value): Handle small aggregates on 32-bit targets. + (function_arg): Pass small aggregates in general registers on 32-bit + targets. + * som.h (MEMBER_TYPE_FORCES_BLK): Delete define. + +2005-07-05 Andrew Pinski + + * Makefile.in (final.o): Fix dependencies. + +2005-07-05 Joseph S. Myers + + PR c/22013 + PR c/22098 + * langhooks.h (struct lang_hooks): Add expr_to_decl. + * langhooks.c (lhd_expr_to_decl): New. + * langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL): + New. + (LANG_HOOKS_INITIALIZER): Update. + * tree.c (recompute_tree_invarant_for_addr_expr): Call + expr_to_decl langhook. + * c-tree.h (c_expr_to_decl): Declare. + * c-typeck.c (c_expr_to_decl): New. + (build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR + specially. + * c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define. + +2005-07-05 Joseph S. Myers + + PR c/22308 + * c-decl.c (finish_struct): Also copy C_TYPE_FIELDS_READONLY, + C_TYPE_FIELDS_VOLATILE and C_TYPE_VARIABLE_SIZE to type variants. + +2005-07-05 Paolo Bonzini + + * Makefile.in: Adjust dependencies. + * tree-pass.h: Add new passes and passes formerly in tree-optimize.c. + * basic-block.h (duplicate_computed_gotos): Remove, it is now static. + * alias.c (rest_of_handle_cfg, pass_cfg): New. + * bb-reorder.c (duplicate_computed_gotos): Make it static. + * cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of + rest_of_compilation. + + * bb-reorder.c (gate_duplicate_computed_gotos, + pass_duplicate_computed_gotos, gate_handle_reorder_blocks, + rest_of_handle_reorder_blocks, pass_reorder_blocks, + gate_handle_partition_blocks, rest_of_handle_partition_blocks, + pass_partition_blocks): New. + * bt-load.c (gate_handle_branch_target_load_optimize, + rest_of_handle_branch_target_load_optimize, + pass_branch_target_load_optimize): New. + * cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2, + pass_jump2): New. + * cfglayout.c (pass_insn_locators_initialize): New. + * cfgrtl.c (pass_free_cfg): New. + * combine.c (gate_handle_combine, rest_of_handle_combine, + pass_combine): New. + * cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse, + gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New. + * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New. + * except.c (pass_set_nothrow_function_flags, + pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh, + pass_rtl_eh): New. + * final.c (pass_compute_alignments, rest_of_handle_final, pass_final, + rest_of_handle_shorten_branches, pass_shorten_branches, + rest_of_clean_state, pass_clean_state): New. + * flow.c (pass_recompute_reg_usage, gate_remove_death_notes, + rest_of_handle_remove_death_notes, pass_remove_death_notes, + rest_of_handle_life, pass_life, rest_of_handle_flow2, + pass_flow2): New. + * function.c (pass_instantiate_virtual_regs, pass_init_function, + rest_of_handle_check_leaf_regs, pass_leaf_regs): New. + * gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass, + pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse, + pass_gcse): New. + * global.c (rest_of_handle_global_alloc, pass_global_alloc): New. + * ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion, + pass_rtl_ifcvt, gate_handle_if_after_combine, + rest_of_handle_if_after_combine, pass_if_after_combine, + gate_handle_if_after_reload, rest_of_handle_if_after_reload, + pass_if_after_reload): New. + * integrate.c (pass_initial_value_sets): New. + * jump.c (pass_cleanup_barriers, purge_line_number_notes, + pass_purge_lineno_notes): New. + * mode-switching.c (rest_of_handle_mode_switching, + pass_mode_switching): New. + * local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New. + * loop-init.c (gate_handle_loop2, rest_of_handle_loop2, + pass_loop2): New. + * loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize, + pass_loop_optimize): New. + * modulo-sched.c (gate_handle_sms, rest_of_handle_sms, + pass_sms): New. + * postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2, + pass_gcse2): New. + * postreload.c (gate_handle_postreload, rest_of_handle_postreload, + pass_postreload_cse): New. + * profile.c (gate_handle_profiling, pass_profiling, + rest_of_handle_branch_prob, pass_branch_prob): New. + * recog.c (pass pass_split_for_shorten_branches, gate_do_final_split, + pass_split_before_regstack, gate_handle_split_before_regstack, + gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2, + rest_of_handle_split_all_insns, pass_split_all_insns): New. + * reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs, + pass_stack_regs): New. + * regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove, + gate_handle_stack_adjustments, rest_of_handle_stack_adjustments, + pass_stack_adjustments): New. + * regrename.c (gate_handle_regrename, rest_of_handle_regrename, + pass_regrename): New. + * reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots, + pass_delay_slots, gate_handle_machine_reorg, + rest_of_handle_machine_reorg, pass_machine_reorg): New. + * rtl.h (extern void purge_line_number_notes): New. + * sched-rgn.c (gate_handle_sched, rest_of_handle_sched, + gate_handle_sched2, rest_of_handle_sched2, pass_sched, + pass_sched2): New. + * tracer.c (gate_handle_tracer, rest_of_handle_tracer, + pass_tracer): New. + * value-prof.c (gate_handle_value_profile_transformations, + rest_of_handle_value_profile_transformations, + pass_value_profile_transformations): New. + * var-tracking.c (gate_handle_var_tracking, + pass_variable_tracking): New. + * web.c (gate_handle_web, rest_of_handle_web, pass_web): New. + + * passes.c (open_dump_file, close_dump_file, rest_of_handle_final, + rest_of_handle_delay_slots, rest_of_handle_stack_regs, + rest_of_handle_variable_tracking, rest_of_handle_machine_reorg, + rest_of_handle_old_regalloc, rest_of_handle_regrename, + rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks, + rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2, + rest_of_handle_gcse2, rest_of_handle_regmove, + rest_of_handle_tracer, rest_of_handle_if_conversion, + rest_of_handle_if_after_combine, rest_of_handle_if_after_reload, + rest_of_handle_web, rest_of_handle_branch_prob, + rest_of_handle_value_profile_transformations, rest_of_handle_cfg, + rest_of_handle_jump_bypass, rest_of_handle_combine, + rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, + rest_of_handle_gcse, rest_of_handle_loop_optimize, + rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize, + rest_of_handle_mode_switching, rest_of_handle_jump, + rest_of_handle_eh, rest_of_handle_stack_adjustments, + rest_of_handle_flow2, rest_of_handle_jump2, + rest_of_handle_peephole2, rest_of_handle_postreload, + rest_of_handle_shorten_branches, rest_of_clean_state, + rest_of_compilation): Remove. + + * cgraphunit.c (ipa_passes): Moved from tree-optimize.c. + * passes.c (dump_flags, in_gimple_form, all_passes, + all_ipa_passes, all_lowering_passes, register_one_dump_file, + register_dump_files, next_pass_1, last_verified, execute_todo, + execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved + from tree-optimize.c. + (init_optimization_passes): Moved from tree-optimize.c, + adding the RTL optimizations. + * tree-dump.h (dump_info_p, dump_flag): Moved from tree.h. + * tree-optimize.c (dump_flags, in_gimple_form, all_passes, + all_ipa_passes, all_lowering_passes, register_one_dump_file, + register_dump_files, next_pass_1, last_verified, execute_todo, + execute_one_pass, execute_pass_list, execute_ipa_pass_list, + init_tree_optimization_passes, ipa_passes): Delete. + * tree-pass.h (enum tree_dump_index): Moved from tree.h, removing + the RTL dumps. + (TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, + dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved + from tree.h. + (ipa_passes): Remove. + (all_passes, all_ipa_passes, all_lowering_passes): Now extern. + * tree.h (enum tree_dump_index, TDF_*, get_dump_file_name, + dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, + dump_switch_p, dump_flag_name): Moved to tree-pass.h. + (dump_info_p, dump_flag): Moved to tree-dump.h. + + * Makefile.in: Adjust dependencies for tree-pretty-print.c, + cgraph.c, opts.c. + * passes.c (finish_optimization_passes): Use dump_begin + and dump_end, TDI_end. + (gate_rest_of_compilation): New. + (pass_rest_of_compilation): Use it. + (gate_postreload, pass_postreload): New. + * toplev.c (general_init): Rename init_tree_optimization_passes. + * toplev.h (init_tree_optimization_passes): Rename to + init_optimizations_passes. + * tree-dump.c (dump_flag): Make static. + (dump_files): Remove RTL dumps. + * tree-optimize.c (pass_all_optimizations, pass_early_local_passes, + pass_cleanup_cfg, pass_free_cfg_annotations, + pass_cleanup_cfg_post_optimizing, pass_free_datastructures, + pass_init_datastructures, pass_fixup_cfg): Make non-static. + * tree-pretty-print.c: Include tree-pass.h. + * cgraph.c: Include tree-dump.h. + +2005-07-04 Daniel Berlin + + * tree-ssa-structalias.c (get_constraint_exp_from_ssa_var): + Only fall back to saying it points to readonly memory if + we can't do better. + +2005-07-05 Kazuhiro Inaoka + + * config/m32r/m32r-protos.h: Remove m32r_finalize_pic. + * config/m32r/m32r.c (m32r_compute_frame_size, + m32r_expand_prologue): Take current_function_profile into + account whenever we reference + current_function_uses_pic_offset_table. + (m32r_finalize_pic): Remove. + * config/m32r/m32r.h (FINALIZE_PIC): Likewise. + +2005-07-05 Kazu Hirata + + * Makefile.in (stamp-as): Use $(ORIGINAL_AS_FOR_TARGET) + instead of $<. Don't remove ./as if it already exists. + +2005-07-04 John David Anglin + + PR target/21723 + * pa.md: Remove fcpy alternative from movhi and movqi patterns. + * pa32-regs.h (HARD_REGNO_NREGS): Return two floating point registers + for complex modes when generating code for PA 1.0. + (VALID_FP_MODE_P): New macro. + (HARD_REGNO_MODE_OK): Use VALID_FP_MODE_P. Use non-overlapping register + sets for all general and floating point modes. Align wide floating + point modes to even register boundaries to comply with architectural + requirements. + (CLASS_MAX_NREGS): Update to align with change to HARD_REGNO_NREGS. + * pa64-regs.h (HARD_REGNO_NREGS): Update comment and formatting. + (VALID_FP_MODE_P): New macro. + (HARD_REGNO_MODE_OK): Use VALID_FP_MODE_P. Use non-overlapping register + sets for all general and floating point modes. Align wide floating + point modes to even register boundaries to comply with architectural + requirements. + +2005-07-04 Diego Novillo + + * tree-dump.c (dump_files): Initialize dump number for .cgraph + to 0. + +2005-07-04 Diego Novillo + + * tree-ssa-structalias.c: Don't include expr.h. + +2005-07-04 Diego Novillo + + * tree-iterator.h (TSI_NEW_STMT, TSI_SAME_STMT): Fix + comments. + +2005-07-04 Daniel Berlin + + Fix PR tree-optimization/22279 + + * tree-ssa-structalias.c (offset_overlaps_with_access): Use + correct operator. + +2005-07-04 J"orn Rennecke + + * sh.c (output_ieee_ccmpeq): Replace "\\;" with "\n\t". + +2005-07-03 Joseph S. Myers + + * bb-reorder.c, c-pch.c, c-pragma.c, c.opt, cfghooks.c, cfgloop.c, + cfgrtl.c, cgraphunit.c, config/c4x/c4x.c, config/cris/cris.c, + config/frv/frv.c, config/host-darwin.c, config/iq2000/iq2000.c, + config/lynx.h, config/m68k/m68k.c, config/pa/pa.c, config/sh/sh.h, + config/stormy16/stormy16.c, config/v850/v850.c, + config/vax/netbsd-elf.h, coverage.c, dwarf2out.c, emit-rtl.c, + except.c, gcc.c, tree-cfg.c, tree-eh.c, tree-ssa.c, xcoffout.c: + Avoid "." or "\n" at end of diagnostics and capital letters at + start of diagnostics. + * combine.c, cse.c: Don't translate dump file output. + * toplev.c (print_version): Only translate output if going to + stderr. + +2005-07-03 Kazu Hirata + + * c-decl.c, tree-object-size.c, tree-vectorizer.c, + config/arm/unwind-arm.c, config/arm/unwind-arm.h: Fix comment + typos. + +2005-07-03 John David Anglin + + * pa.c (fix_range): Fix typo in comment. + +2005-07-03 Kazu Hirata + + * tree-vrp.c (extract_range_from_assert): Replace + fold (build (...)) with fold_build2. + +2005-07-03 Kaveh R. Ghazi + + * c-format.c (gcc_gfc_format_type, gcc_gfc_flag_pairs, + gcc_gfc_char_table, init_dynamic_gfc_info): New. + (format_types_orig, handle_format_attribute): Add support for + format "gcc_gfc". + +2005-07-03 Gabriel Dos Reis + + * varasm.c (assemble_variable): Fix format specifier thinko. + +2005-07-03 Ira Rosen + + PR tree-optimization/22029 (and 22135) + * tree-pretty-print.c (dump_generic_node): Check that the node is not + a phi node before calling dump_vops. + +2005-07-02 Gabriel Dos Reis + + * tree-dump.h (dump_string_field): Declare. + * tree-dump.c: Use it instead of dump_string. + (dump_string_field): Make non-static. + +2005-07-03 Kaz Kojima + + * config/sh/sh.c (sh_output_mi_thunk): Initialize and clean + up the minimal CFG stuff always when optimize > 0. Call + split_all_insns_noflow in PIC case if needed. + +2005-07-02 Gabriel Dos Reis + Christian Ehrhardt + + PR c++/18279 + * c-decl.c (c_write_global_declarations): Dump contents of + external scope to. + * tree-dump.c (dequeue_and_dump): Dump abstract origin of a decl. + , , , , + , : Add. + (dump_enabled_p): Return TRUE if PHASE is TDI_all and any dump + is enabled. + +2005-07-03 Joseph S. Myers + + * c-common.h (GCC_DIAG_STYLE): Define. + * c-tree.h (GCC_DIAG_STYLE): Do not define. Change minimum GCC + version for format checking to 4.1. + * c-format.c: Include toplev.h after c-common.h. + (enum format_type): Add gcc_tdiag_format_type. + (gcc_tdiag_length_specs, gcc_tdiag_flag_pairs, + gcc_tdiag_flag_specs, gcc_tdiag_char_table): New. + (format_types_orig): Add gcc_tdiag. + (init_dynamic_diag_info): Support gcc_tdiag formats. + (handle_format_attribute): Likewise. + * toplev.h (NO_FRONT_END_DIAG, ATTRIBUTE_GCC_FE_DIAG): Remove. + (GCC_DIAG_STYLE): Default to __gcc_tdiag__. Change minimum GCC + version for format checking to 4.1. + (warning0, warning, error, pedwarn, sorry): Use + ATTRIBUTE_GCC_DIAG. + * config/rs6000/rs6000.c (altivec_expand_builtin), varasm.c + (finish_aliases_1): Do not use %qE. + * config/arm/arm.c, config/i386/i386.c, config/mmix/mmix.c, + config/pdp11/pdp11.c, stor-layout.c, tree-eh.c, tree-ssa.c: + Correct format bugs. + * config/v850/v850-protos.h (v850_output_aligned_bss): Change size + parameter to unsigned HOST_WIDE_INT. + * config/v850/v850.c (v850_output_aligned_bss): Likewise. + +2005-07-02 David Edelsohn + + PR middle-end/21742 + * expr.c (write_complex_part): Use adjust_address for MEM. + (read_complex_part): Same. + +2005-07-02 Daniel Berlin + + Fix PR tree-optimization/22280 + + * tree-sra.c (generate_element_init): Remove useless loop. + +2005-07-02 Richard Henderson + + * config/alpha/alpha.c (alpha_legitimize_address): Check for + TLS_MODEL_NONE. + (alpha_stdarg_optimize_hook): Use DECL_UID with va_list_vars. + +2005-07-02 Andrew Pinski + + PR middle-end/14490 + * fold-const.c (fold_binary): Handle the return value of + fold_to_nonsharp_ineq_using_bound if we get back the same operand back. + Implement "X +- C1 CMP C2" folding to "X CMP C2 -+ C1". + +2005-07-02 Jeff Law + + * tree-ssa-dom.c (find_equivalent_equality_comparison): Do not + a eliminate type conversion which feeds an equality comparison + if the original type or either operand in the comparison is a + function pointer. + +2005-07-02 Joseph S. Myers + + * c.opt, common.opt, config/bfin/bfin.opt, config/pa/pa.opt, + config/rs6000/rs6000.opt, params.def: Remove "." from end of help + texts. + * config/avr/avr.c: Do not use '`' as left quote. + * config/rs6000/rs6000.c, config/s390/s390.c, opts.c, tree.c: + Remove "." from end of diagnostics. Make diagnostics start with + lowercase letter. + +2005-07-02 Zack Weinberg + Joseph S. Myers + + * toplev.c (default_tree_printer): Handle setting location with + '+' flag. + * c-objc.common.c (c_tree_printer): Likewise. + * c-format.c (gcc_diag_flag_specs): Add '+'. + (gcc_cdiag_char_table): Allow '+' flag for tree formats. + (format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag + formats. + * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, + config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, + config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c, + config/v850/v850.c, function.c, stor-layout.c, toplev.c, + tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag + instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end + of diagnostics. Use %q+D not %s for a decl. Do not pass excess + format arguments where %J is used without %D. + +2005-07-02 Jakub Jelinek + + * gcc.c (LINK_SSP_SPEC): Define. + (link_ssp_spec): New variable. + (LINK_COMMAND_SPEC): Add %(link_ssp). + (static_specs): Add link_ssp_spec. + * configure.ac (TARGET_LIBC_PROVIDES_SSP): New test. + * configure: Rebuilt. + * config.in: Rebuilt. + + * config/rs6000/linux.h (TARGET_THREAD_SSP_OFFSET): Define. + * config/rs6000/linux64.h (TARGET_THREAD_SSP_OFFSET): Likewise. + * config/i386/linux.h (TARGET_THREAD_SSP_OFFSET): Likewise. + * config/i386/linux64.h (TARGET_THREAD_SSP_OFFSET): Likewise. + * config/rs6000/rs6000.md (stack_protect_set, stack_protect_test): + If TARGET_THREAD_SSP_OFFSET is defined, use -0x7010(13) resp. + -0x7008(2) instead of reading __stack_chk_guard variable. + * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): Change + number. + (UNSPEC_SP_TLS_SET, UNSPEC_SP_TLS_TEST): New constants. + (stack_protect_set, stack_protect_test): Use *_tls* patterns + if TARGET_THREAD_SSP_OFFSET is defined. + (stack_tls_protect_set_si, stack_tls_protect_set_di, + stack_tls_protect_test_si, stack_tls_protect_test_di): New insns. + + Revert: + 2005-06-27 Richard Henderson + * libgcc-std.ver (GCC_4.1.0): New. + * libgcc.h (__stack_chk_guard): Declare. + (__stack_chk_fail, __stack_chk_fail_local): Declare. + * libgcc2.c (L_stack_chk, L_stack_chk_local): New. + * mklibgcc.in (lib2funcs): Add them. + +2005-07-01 Richard Henderson + + * config/i386/linux-unwind.h (x86_64_fallback_frame_state): Cast to + void * before struct sigcontext *. + (x86_fallback_frame_state): Likewise. + +2005-07-01 James E. Wilson + + * doc/invoke.texi (-funit-at-a-time): Correct grammar in second bullet. + +2005-07-01 Andrew Pinski + + PR tree-opt/22269 + * tree-ssa-reassoc.c (should_transpose): Fix which operand + we check for SSA_NAME for. + +2005-07-01 Daniel Berlin + + Fix PR tree-optimization/22071 + + * tree-ssa-structalias.c (offset_overlaps_with_access): New + function. + (get_constraint_for_component_ref): Use it. + +2005-07-01 Andrew Pinski + + PR other/22264 + * diagnostic.c (diagnostic_report_current_module): Use pp_newline to + print out the last new line. + +2005-07-01 Hans-Peter Nilsson + + * config/cris/cris.md (CRIS_CC0_REGNUM): New constant. + Swap numbers for CRIS_AP_REGNUM and CRIS_MOF_REGNUM. + * config/cris/cris.c (cris_conditional_register_usage): Adjust + reg_names[CRIS_CC0_REGNUM] for early CRIS versions. + (cris_print_operand) : Handle CRIS_CC0_REGNUM. + (cris_md_asm_clobbers): Clobber CRIS_CC0_REGNUM for all asms. + * config/cris/cris.h (CRIS_CANONICAL_CC0_REGNUM): New macro. + (enum reg_class): New member CC0_REGS. + (REG_CLASS_FROM_LETTER): Add 'c' for CC0_REGS. + (FIRST_PSEUDO_REGISTER, CALL_USED_REGISTERS, REG_ALLOC_ORDER) + (HARD_REGNO_MODE_OK, MODES_TIEABLE_P, REG_CLASS_NAMES) + (CRIS_SPECIAL_REGS_CONTENTS, REG_CLASS_CONTENTS, REGNO_REG_CLASS) + (PREFERRED_RELOAD_CLASS, REGISTER_NAMES, DBX_REGISTER_NUMBER): + Adjust for register now described. + +2005-07-01 Jakub Jelinek + + PR target/22262 + * config/i386/i386.md (stack_protect_test_si, + stack_protect_test_di): Add earlyclobber for scratch 3. + * config/rs6000/rs6000.md (stack_protect_testsi, + stack_protect_testdi): Add earlyclobber for scratch 3, + remove earlyclobber from scratch 4. + +Older entries for 2005 can be found in ChangeLog-2005. +2005-06-30 Diego Novillo + + PR 21584 + PR 22219 + * tree-ssa-alias.c (create_name_tags): Also process + non-dereferenced pointers. + Remove argument 'ai'. Update all callers. + +2005-06-30 Andrew Pinski + + * config/rs6000/darwin.h (STARTING_FRAME_OFFSET): + Set to 0 for FRAME_GROWS_DOWNWARD. + (REGISTER_NAMES): Add sfp. + +2005-07-01 Kelley Cook + + * config/arm/libunwind.S, config/arm/pr-support.c, + config/arm/unwind-arm.c, config/arm/unwind-arm.h, + config/c4x/predicates.md, tree-object-size.c: Update FSF address. + +2005-06-30 Eric Botcazou + + PR target/22260 + * config/sparc/sparc.c (emit_and_preserve): Add 2nd register. + Preserve the 2nd register too, if present. + (sparc_output_mi_thunk) : Preserve the PIC register too. + Adjust call to emit_and_preserve. + +2005-06-30 Zack Weinberg + Jakub Jelinek + + * pretty-print.h (PP_NL_ARGMAX): New. + (text_info): Add locus. + (struct chunk_info): New. + (output_buffer): Add formatted_obstack, chunk_obstack, and + cur_chunk_array. Change obstack to a pointer. + (pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New. + (struct pretty_print_info): Replace ideal_maximum_length and + prefixing_rule with wrapping. + (pp_line_cutoff, pp_prefixing_rule): Update to match. + Update prototypes and wrapper macros throughout. + * pretty-print.c (pp_formatted_text_data, pp_append_r) + (pp_base_clear_output_area, pp_construct, pp_base_formatted_text) + (pp_base_last_position_in_text, pp_base_newline, pp_base_character): + Update for changes to pp structure. + (pp_base_prepare_to_format, pp_base_format_text): Delete. + (pp_base_format, pp_base_output_formatted_text): New functions. + (pp_base_format_verbatim): Use pp_set_verbatim_wrapping. + (pp_verbatim): Clear text.locus. + (pp_printf): Likewise. Use pp_format and pp_output_formatted_text. + * c-objc-common.c (c_tree_printer): Update function signature. + * diagnostic.c (diagnostic_initialize): Update for changes to + pp structure. + (diagnostic_report_diagnostic): Call pp_format and then + pp_output_formatted_text. + (verbatim): Clear text.locus. + * diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff): + Update for changes to pp structure. + + * c-lang.c: No need to include c-pretty-print.h. + * Makefile.in: Remove bogus line containing only a tab. + (c-lang.o): Update dependencies. + * toplev.c (announce_function): Don't use verbatim. + (default_tree_printer): Update signature. + + * objc/objc-lang.c: No need to include c-pretty-print.h. + * objc/Make-lang.in: Update dependencies. + +2005-06-29 Daniel Berlin + + * tree-complex.c (complex_variable_components): Now a hashtable. + (cvc_lookup): Ditto. + (cvc_insert): Ditto. + (create_components): Use referenced var iterator. + Initialize hashtable. Use cvc_insert/lookup. + (extract_components): Use cvc_insert/lookup. + (update_complex_components): Ditto. + (update_complex_components_on_edge): Ditto. + * tree-dfa.c (referenced_vars): Now a hashtable. + (dump_referenced_vars): Use iterator. + (referenced_var_lookup): New function. + (referenced_var_insert): Ditto. + (add_referenced_var): Use referenced_var_insert. + (mark_new_vars_to_rename): Use DECL_UID. + * tree-flow-inline.h (first_htab_element): New function. + (end_htab_p): Ditto. + (next_htab_element): Ditto. + (first_referenced_var): Ditto. + (end_referenced_vars_p): Ditto. + (next_referenced_var): Ditto. + (is_call_clobbered): Use DECL_UID. + (mark_call_clobbered): Ditto. + (clear_call_clobbered): Ditto. + (mark_non_addressable): Ditto. + * tree-flow.h (htab_iterator): New struct. + (FOR_EACH_HTAB_ELEMENT): New macro. + (struct int_tree_map): New struct. + (int_tree_map_hash): Prototype. + (int_tree_map_eq): Ditto. + (referenced_var_iterator): Ditto. + (FOR_EACH_REFERENCED_VAR): New macro. + (referenced_vars): Now a hashtable. + * tree-into-ssa.c (symbol_marked_for_renaming): Use DECL_UID. + (add_new_name_mapping): Ditto. + (mark_def_sites): Ditto. + (insert_phi_nodes): Use referenced_var iterator. + (mark_def_site_blocks): Ditto. + (mark_sym_for_renaming): Use DECL_UID. + * tree-sra.c (is_sra_candidate_decl): Use DECL_UID. + (lookup_element): Ditto. + (find_candidates_for_sra): Use referenced_vars iterator. + Use DECL_UID. + * tree-ssa-alias.c (NUM_REFERENCES): New macro. + (NUM_REFERENCES_CLEAR): Ditto. + (NUM_REFERENCES_INC): Ditto. + (NUM_REFERENCES_SET): Ditto. + (alias_obstack): New bitmap obstack. + (struct alias_map_d): Use bitmap, not sbitmap. + (struct alias_info): Remove num_references. + (init_alias_info): Use referenced_var iterator. + Initialize bitmap obstack. + (delete_alias_info): Use referenced_var iterator. + Free bitmap obstack. + (compute_points_to_and_addr_escape): Use DECL_UID. + Use new NUM_REFERENCES macros. + (compute_flow_sensitive_aliasing): may_aliases is now a bitmap. + Use new NUM_REFERENCES macros. + (group_aliases_into): Update prototype to use bitmap. + (setup_pointers_and_addressables): Use referenced_vars iterator. + Use DECL_UID. Use new NUM_REFERENCES macros. + (add_pointed_to_var): Use DECL_UID. + (dump_alias_info): Use referenced_var iterator. + (add_type_alias): Ditto. + (used_portions): Now a hashtable. + (used_part_map_eq): New function. + (used_part_map_hash): Ditto. + (free_used_part_map): Ditto. + (up_lookup): Ditto. + (up_insert): Ditto. + (get_or_create_used_part_for): Use up_lookup. + (create_overlap_variables_for): Ditto. + (find_used_portions): Use up_insert. + Use DECL_UID. + (create_structure_vars): Init used_portions hashtable, use + referenced_vars iterator. + * tree-ssa-live.c (create_ssa_var_map): sbitmaps became bitmaps. + Use DECL_UID. + * tree-ssa-loop-im.c (gather_mem_refs_stmt): Use DECL_UID. + * tree-ssa-operands.c (get_asm_expr_operands): Ditto. + (note_addressable): Ditto. + * tree-ssa-structalias.c (set_uids_in_ptset): Ditto. + * tree-ssa.c (verify_flow_insensitive_alias_info): Use + referenced_var iterator. + Use DECL_UID. + (delete_tree_ssa): Ditto. + (int_tree_map_eq): New function. + (int_tree_map_hash): Ditto. + * tree-stdarg.c (find_va_list_reference): Use DECL_UID. + (va_list_ptr_read): Ditto. + (va_list_counter_struct_op): Ditto. + (va_list_ptr_write): Ditto. + (check_va_list_escapes): Ditto. + (check_all_va_list_escapes): Ditto. + (execute_optimize_stdarg): Ditto. + * tree-tailcall.c (suitable_for_tail_opt_p): Used referenced_var + iterator. + +2005-06-30 Andrew Pinski + + * config/rs6000/darwin.h (FRAME_POINTER_REGNUM): Rename to ... + (HARD_FRAME_POINTER_REGNUM): this. + +2005-06-30 Jan Hubicka + + * ipa-inline.c (cgraph_clone_inlined_nodes): Revert previous patch. + +2005-06-30 Francois-Xavier Coudert + + PR middle-end/22247 + * tree-ssa-structalias.c (build_constraint_graph, scc_visit, + process_unification_queue, init_topo_info, topo_visit, + init_scc_info, free_scc_info, perform_var_substitution, + solve_graph): Use unsigned instead of uint. + +2005-06-30 Jakub Jelinek + + * function.c (gen_stack_protect_test): Add third argument. + +2005-06-30 J. D. Johnston + + * gthr-tpf.h (CE2THRCPTR): Change field offset to 16. + +2005-06-30 Kazu Hirata + + * config/c4x/c4x-protos.h: Remove the prototypes for those + functions removed from c4x.c. Add prototypes for those + functions exported in c4x.c. + * config/c4x/c4x.c (any_operand, fp_zero_operand, + const_operand, stik_const_operand, not_const_operand, + reg_operand, r0r1_reg_operand, r2r3_reg_operand, + ext_low_reg_operand, ext_reg_operand, std_reg_operand, + std_or_reg_operand, addr_reg_operand, index_reg_operand, + dp_reg_operand, sp_reg_operand, st_reg_operand, + rc_reg_operand, call_address_operand, + symbolic_address_operand, dst_operand, src_operand, + src_hi_operand, lsrc_operand, tsrc_operand, + nonimmediate_src_operand, nonimmediate_lsrc_operand, + reg_or_const_operand, par_ind_operand, parallel_operand): + Remove. + (c4x_immed_float_p, c4x_a_register, c4x_x_register, + c4x_K_constant, c4x_N_constant, c4x_O_constant, + c4x_S_indirect): Export. + * config/c4x/c4x.h (PREDICATE_CODES): Remove. + * config/c4x/c4x.md: Include predicates.md. + * config/c4x/predicates.md: New. + +2005-06-30 Jakub Jelinek + + * function.c (stack_protect_epilogue): Pass label to + stack_protect_test, assume it emitted also the conditional + branch. + * doc/md.texi (stack_protect_test): Adjust documentation. + * config/i386/i386.md (stack_protect_test): Add third argument, + emit beq with operands[2]. + * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Define to + flag_stack_protect != 0. + * config/rs6000/rs6000.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New + constants. + (stack_protect_set, stack_protect_test): New expanders. + (stack_protect_setsi, stack_protect_setdi, stack_protect_testsi, + stack_protect_testdi): New insns. + * config/rs6000/rs6000.c (rs6000_stack_protect_fail): New function. + (TARGET_STACK_PROTECT_FAIL): Define. + (rs6000_generate_compare): Handle UNSPEC_SP_TEST. + + * config/rs6000/rs6000.h (FIRST_PSEUDO_REGISTER): Increment. + (DWARF_FRAME_REGISTERS, DWARF_REG_TO_UNWIND_COLUMN): Adjust, so + that addition of sfp doesn't change these. + (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, + REG_ALLOC_ORDER): Add sfp. + (INT_REGNO_P): Include FRAME_POINTER_REGNUM. + (FRAME_POINTER_REGNUM): Define to 113. + (HARD_FRAME_POINTER_REGNUM): Define to 31. + (REG_CLASS_CONTENTS, REGNO_REG_CLASS): Add sfp. + (STARTING_FRAME_OFFSET): Set to 0 for FRAME_GROWS_DOWNWARD. + (ELIMINABLE_REGS): Never eliminate to + FRAME_POINTER_REGNUM, but HARD_FRAME_POINTER_REGNUM + instead. Add eliminations from FRAME_POINTER_REGNUM. + (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): + Include FRAME_POINTER_REGNUM. + (REGISTER_NAMES): Add sfp. + * config/rs6000/rs6000.c (rs6000_reg_names): Add sfp. + (alt_reg_names): Likewise. + (rs6000_stack_info): Handle FRAME_GROWS_DOWNWARD. + (rs6000_emit_prologue): Use HARD_FRAME_POINTER_REGNUM + instead of FRAME_POINTER_REGNUM. + (rs6000_initial_elimination_offset): Never eliminate to + FRAME_POINTER_REGNUM, but HARD_FRAME_POINTER_REGNUM + instead. Add elimination offsets from FRAME_POINTER_REGNUM. + + * config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Only return non-zero + if DEFAULT_ABI == ABI_V4. + +2005-06-30 Steven Bosscher + + * coretypes.h (tls_model): Add TLS_MODEL_NONE as 0. + * tree.h (struct tree_decl): New field `tls_model'. + (DECL_TLS_MODEL): New. + (DECL_THREAD_LOCAL_P): Rename from DECL_THREAD_LOCAL, make it + a predicate. + * rtl.h (decl_default_tls_model): Add prototype for it. + * varasm.c (decl_tls_model): Rewritten and renamed to ... + (decl_default_tls_model): ... this. + (default_encode_section_info): Use DECL_TLS_MODEL instead of + decl_tls_model. + (assemble_variable): Replace DECL_THREAD_LOCAL with + DECL_THREAD_LOCAL_P. + (default_section_type_flags_1): Likewise. + (categorize_decl_for_section): Likewise. + * tree.c (staticp): Likewise. + (recompute_tree_invarant_for_addr_expr): Likewise. + * drawf2out (loc_descriptor_from_tree_1): Likewise. + * c-decl.c (diagnose_mismatched_decls): Likewise. + with DECL_THREAD_LOCAL_P. + (start_decl): Likewise. + * print-tree.c (print_node): Likewise. Print the TLS model. + (grokdeclarator): Set the default DECL_TLS_MODEL here. + * c-common.c (handle_tls_model_attribute): Rewrite to set the + TLS model up based on the attribute. Never add the attribute + to the decl's attributes list. + * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Replace + DECL_THREAD_LOCAL with DECL_THREAD_LOCAL_P. + +2005-06-30 Zdenek Dvorak + + PR testsuite/21967 + * tree-ssa-live.c (mark_all_vars_used_1): Ignore variables in + TMR_ORIGINAL. + +2005-06-30 Bernd Schmidt + + * config/bfin/bfin.md (addv2hi3, subv2hi3, sminv2hi3, smaxv2hi3, + mulv2hi3, negv2hi2, absv2hi2): Pattern names fixed by appending the + necessary digit. + +2005-06-29 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_file_start): Use PPC405_ERRATUM77. + +2005-06-29 Diego Novillo + + PR 22234 + * tree-ssa-copy.c (fini_copy_prop): Do not overwrite copy_of + when following copy-of chains. + +2005-06-30 Jan Hubicka + + * function.h (struct function): Add saved blocks/unexpanded var list. + * gimple-low.c (record_vars): Insert only VAR_DECLs. + * tree-inline.c (add_lexical_block): Declare; do not clear sublocks. + (remap_decl): Do not declare vars. + (remap_block): Do not care inserting blocks. + (remap_blocks): New function. + (copy_body_r): Update debug info. + (expand_call_inline): Duplicate callee block tree into caller; + copy all the unexpanded_var_list. + (save_body): Save unexpanded_var_list and blocks. + * tree-optimize.c (tree_rest_of_optimization): Restore + blocks/unexpanded_var_list. + +2005-06-29 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_vecint_minmax): Use us_minus and + plus for V4HImode UMAX. + +2005-06-29 Joseph S. Myers + + * c-tree.h (default_function_array_conversion): Take and return + struct c_expr. + * c-typeck.c (default_function_array_conversion): Split into + array_to_pointer_conversion and function_to_pointer_conversion. + Take and return struct c_expr. + (array_to_pointer_conversion): Do not handle type qualifiers or + COMPOUND_EXPRs specially. + (build_function_call): Call function_to_pointer_conversion for + function designators. + (build_unary_op): Call array_to_pointer_conversion, not + default_function_array_conversion. + (digest_init, output_init_element): Likewise. + * c-parser.c: All callers of default_function_array_conversion + changed. + +2005-06-29 Ziemowit Laski + + * config/darwin.c (machopic_select_section): constant ObjC string + objects now always have type "__builtin_ObjCString". + +2005-06-29 Richard Henderson + + * config/alpha/alpha.md (vec_shl_, vec_shr_): New. + +2005-06-29 Richard Henderson + + * tree-vect-transform.c (vect_min_worthwhile_factor): Declare. + (vect_create_epilog_for_reduction): Don't use vec_shr if the + operation is emulated. + (vectorizable_reduction): Duplicate vect_min_worthwhile_factor + tests from vectorizable_operation. + +2005-06-29 Caroline Tice + + Fix PR 21956 + * varasm.c (assemble_start_function): Add "L" to beginning of + local labels, so assembler & linker treat them as local. + +2005-06-29 Richard Henderson + + * config/i386/i386.c (ix86_expand_int_vcond): Remove unsignedp + argument. Simplify canonicalization of condition. Use unsigned + saturating subtraction for QI and HImode unsigned compares. Use + bit arithmetic tricks for SImode unsigned compares. + * config/i386/i386-protos.h (ix86_expand_int_vcond): Update decl. + * config/i386/sse.md (SSEMODE14): New. + (umaxv8hi3): Use us_minus+plus to avoid vcond. + (umaxv4si3): New. + (smax3): Rename from smaxv16qi3 and macroize. + (smin3): Similarly with sminv16qi3. + (umin3): Similarly with uminv8hi3. + +2005-06-29 Ian Lance Taylor + + * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Change + GEN_INT to gen_int_for_mode when storing register size to memory. + +2005-06-29 Stuart Hastings + + * config/i386/mmintrin.h: Mark vector intrinsics always_inline. + * config/i386/emmintrin.h: Likewise. + * config/i386/pmmintrin.h: Likewise. + * config/i386/xmmintrin.h: Likewise. + +2005-06-29 Steve Ellcey + + PR middle-end/21969 + * tree.h (TYPE_VECTOR_SUBPARTS): Change to shift expression. + (SET_TYPE_VECTOR_SUBPARTS): New. + * tree.c (make_vector_type): Replace TYPE_VECTOR_SUBPARTS with + SET_TYPE_VECTOR_SUBPARTS. + * tree-vect-transform.c (vect_transform_loop): Add cast. + +2005-06-29 Andreas Krebbel + + * config/s390/s390.c (s390_decompose_address): Accept invalid + displacements for addresses containing frame_pointer_rtx or + virtual_stack_vars_rtx. + (s390_frame_info): Replaced use of STARTING_FRAME_OFFSET. + (s390_initial_elimination_offset): New offset when eliminating the + soft frame pointer. + * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Defined as 1. + (STARTING_FRAME_OFFSET, STACK_DYNAMIC_OFFSET): Definitions changed. + +2005-06-28 Ziemowit Laski + + * c-common.c (flag_next_runtime): Move... + * toplev.c (flag_next_runtime): ... here. + * c-common.h (flag_next_runtime): Move... + * flags.h (flag_next_runtime): ... here. + * config/darwin-c.c: Include flags.h. + * config/t-darwin (darwin-c.o): Depend on flags.h. + +2005-06-29 Kaz Kojima + + * config/sh/linux-unwind.h (shmedia_fallback_frame_state): + Disable aliasing warning with void * cast. + (sh_fallback_frame_state): Likewise. + +2005-06-29 Kaz Kojima + + * target.h (gcc_target): New field allocate_initial_value. + * target-def.h (TARGET_ALLOCATE_INITIAL_VALUE): New macro. + (TARGET_INITIALIZER): Include it. + * integrate.c (allocate_initial_values): Use + targetm.allocate_initial_value. + * system.h: Poison ALLOCATE_INITIAL_VALUE. + * config/sh/sh-protos.h (sh_pr_n_sets): Delete. + * config/sh/sh.c (sh_pr_n_sets): Make it static. + (sh_allocate_initila_value): New function. + (TARGET_ALLOCATE_INITIAL_VALUE): Override default. + * config/sh/sh.h (ALLOCATE_INITIAL_VALUE): Delete. + * doc/tm.texi (TARGET_ALLOCATE_INITIAL_VALUE): Rename and + update from ALLOCATE_INITIAL_VALUE. + +2005-06-28 Richard Henderson + + * tree-vectorizer.c (vect_is_simple_reduction): Compare types + using TYPE_MAIN_VARIANT. + +2005-06-28 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_vecint_compare): Decompose to EQ + when using psubN.uuu. + +2005-06-29 Kelley Cook + + * doc/gcc.texi: Update FSF address. + +2005-06-28 Eric Christopher + + PR c/22052 + PR c/21975 + * c-decl.c (diagnose_mismatched_decls): Define DECL_EXTERN_INLINE. + Use. Fix detection of invalid extern inline redefinition. + +2005-06-28 Diego Novillo + + * tree-optimize.c (init_tree_optimization_passes): Fix typo. + +2005-06-28 Andrew Pinski + + * config/rs6000/rs6000.md (setmemsi): s/operand/operands/. + +2005-06-28 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_vecint_compare): Use unsigned + saturating subtraction for QI and HImode unsigned compares. Use + bit arithmetic tricks for SImode unsigned compares. + (ia64_expand_vcondu_v2si): Remove. + (ia64_expand_vecint_cmov): Don't call it. + +2005-06-28 Richard Henderson + + * rtlanal.c (nonzero_bits1): Use the mode of the value for + determining integral-ness for comparisons. + +2005-06-28 Andrew Pinski + + * config/rs6000/rs6000.md (setmemsi): Fix operand 2. + +2005-06-28 Joseph S. Myers + + * target.h (invalid_conversion, invalid_unary_op, + invalid_binary_op): New hooks. + * target-def.h (TARGET_INVALID_CONVERSION, + TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, + TARGET_INITIALIZER): Likewise. + * hooks.h (hook_constcharptr_tree_tree_null, + hook_constcharptr_int_tree_null, + hook_constcharptr_int_tree_tree_null): New. + * hooks.c (hook_constcharptr_tree_tree_null, + hook_constcharptr_int_tree_null, + hook_constcharptr_int_tree_tree_null): Likewise. + * doc/tm.texi (TARGET_INVALID_CONVERSION, + TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. + * c-convert.c (convert): Use invalid_conversion hook. + * c-typeck.c (build_unary_op): Use invalid_unary_op hook. + (build_binary_op): Use invalid_binary_op hook. + * config/ia64/ia64-modes.def: Define RFmode. + * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. + (ia64_expand_movxf_movrf): New. + * config/ia64/ia64.md (movxf): Move code to + ia64_expand_movxf_movrf. + (movrf, movrf_internal): New. + * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, + ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, + TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. + (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. + Add mode parameter. Make static. + (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode + as well as XFmode. + (ia64_function_arg, ia64_function_value, ia64_register_move_cost, + ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. + (ia64_init_builtins): Set up __fpreg as RFmode. + (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. + +2005-06-28 Adrian Straetling + + * builtins.c: (expand_builtin_memset): Rewrite to support + 'set_storage_via_setmem'. + * expr.c: (enum insn_code setmem_optab): Define. + (enum insn_code clrmem_optab): Remove. + (set_storage_via_setmem): New function. + (clear_storage_via_setmem): Remove. + (clear_storage): Replace call to "clear_storage_via_clrmem" with + "set_storage_via_setmem". + * expr.h: (set_storage_via_setmem): Declare. + (CLEAR_RATIO): Redefine using HAVE_setmemM. + * optabs.h: (enum insn_code setmem_optab): Declare. + (enum insn_code clrmem_optab): Remove. + * optabs.c: (init_optabs): Initialize setmem_optab. + (enum insn_code clrmem_optab): Remove. + * genopinit.c: (otabs): Likewise. + * doc/md.texi: Document new standard pattern 'setmem'. Remove + 'clrmem'. + * config/alpha/alpha.c: (alpha_expand_block_clear): Adjust + 'operands' ordering. + * config/frv/frv.c: (frv_expand_block_clear): Likewise. + * config/rs6000/rs6000.c: (expand_block_clear): Likewise. + * config/alpha/alpha.md: ("clrmemqi", "clrmemdi"): Rename to "setmemM". + FAIL on operands[2]!=const0_rtx. Adjust 'operands' ordering. + * config/avr/avr.md: ("clrmemhi"): Likewise. + * config/frv/frv.md: ("clrmemsi"): Likewise. + * config/i386/i386.md: ("clrmemsi", "clrmemdi"): Likewise. + * config/pa/pa.md: ("clrmemsi", "clrmemdi"): Likewise. + * config/rs6000/rs6000.md: ("clrmemsi"): Likewise. + * config/s390/s390.md: ("clrmem"): Likewise. + +2005-06-28 Paul Brook + + * Makefile.in: Set and use UNWIND_H. Install as unwind.h. + * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. + * except.c (add_ehspec_entry): Generate arm eabi filter lists. + (assign_filter_values): Ditto. + (output_ttype): New function. + (output_function_exception_table): Use output_ttype. Generate arm + eabi filter lists. + (default_init_unwind_resume_libfunc): New function. + * except.h (default_init_unwind_resume_libfunc): Add prototype. + * optabs.c (init_optabs): Don't set unwind_resume_libfunc. + * opts.c (decode_options): Use targetm.unwind_tables_default. + * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. + (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. + * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default + and arm_eabi_unwinder. + * unwind-c.c: Support Arm EABI unwinder. + * unwind.h: Rename ... + * unwind-generic.h: ... To this. + * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. + (TARGET_UNWID_TABLES_DEFAULT): Document. + + * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. + * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. + (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): + Define. + (thumb_pushpop, thumb_output_function_prologue): Output unwinding + directives. + (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. + * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when + !TARGET_UNWIND_INFO. + (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. + * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. + * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, + ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. + * config/arm/lib1funcs.asm: Include libunwind.S. + * config/arm/libgcc-bpabi.ver: Add unwinding routines. + * config/arm/libunwind.S: New file. + * config/arm/pr-support.c: New file. + * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. + (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. + * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. + * config/arm/unwind-arm.c: New file. + * config/arm/unwind-arm.h: New file. + * config/i386/t-netware (USER_H): Remove unwind.h. + * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. + +2005-06-28 DJ Delorie + + * c-decl.c (pop_scope): Move warning control into warning call. + (diagnose_mismatched_decls): Likewise. + (pushdecl): Likewise. + (start_decl): Likewise. + (grokparms): Likewise. + (start_function): Likewise. + (store_parm_decls_newstyle): Likewise. + (store_parm_decls_oldstyle): Likewise. + (finish_function): Likewise. + (declspecs_add_scspec): Likewise. + * c-format.c (decode_format_attr): Likewise. + (maybe_read_dollar_number): Likewise. + (avoid_dollar_number): Likewise. + (finish_dollar_format_checking): Likewise. + (check_format_info): Likewise. + (check_format_info_main): Likewise. + (check_format_types): Likewise. + (format_type_warning): Likewise. + * c-typeck.c (function_types_compatible_p): Likewise. + (build_array_ref): Likewise. + (convert_arguments): Likewise. + (build_c_cast): Likewise. + (store_init_value): Likewise. + (process_init_element): Likewise. + (c_start_case): Likewise. + * stor-layout.c (finalize_record_size): Likewise. + * tree-cfg.c (execute_warn_function_noreturn): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + +2005-06-28 Uros Bizjak + + PR target/22134 + * config/i386/i386.md (fist2_with_temp splitter): + Clobber memory operand, not scratch register. + +2005-06-28 Andreas Krebbel + + * config/s390/s390.c (machine_function): New field has_landing_pad_p. + (s390_set_has_landing_pad_p, s390_reg_clobbered_rtx, + s390_regs_ever_clobbered): New functions. + (s390_return_addr_rtx): Use get_hard_reg_initial_value. + (s390_register_info, s390_init_frame_layout, s390_update_frame_layout): + Use s390_regs_ever_clobbered. + (s390_emit_prologue): Don't use r14 as temp reg if its content is used + for builtin_return_address. + * config/s390/s390.md ("exception_receiver"): New expander. + * config/s390/s390-protos.h (s390_set_has_landing_pad_p): Prototype + added. + +2005-06-28 Andreas Krebbel + + * except.c (current_function_has_exception_handlers): Function + description added and if statements merged. + +2005-06-28 Richard Henderson + + * config/i386/sse.md (smaxv16qi3): Fix buffer overflow. + (sminv16qi3, umaxv8hi3, uminv8hi3): Likewise. + +2005-06-27 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_vcondu_v2si): Generate proper + comparison operations. + (ia64_expand_vecint_minmax): Fix size of xops. + * config/ia64/vect.md (umax3): Fix fallback pattern typo. + (vec_shl_, vec_shr_): New. + +2005-06-27 Richard Henderson + + * tree-vect-transform.c (get_initial_def_for_reduction): Use correct + type for DEF and INIT_VAL. Pretend MIN/MAX need epilogue adjustment. + +2005-06-27 Richard Henderson + + * config/i386/sse.md (vec_shl_, vec_shr_): New. + (smaxv16qi3, umaxv8hi3, sminv16qi3, uminv8hi3): New. + +2005-06-27 Richard Henderson + + * tree-vect-transform.c (vect_create_epilog_for_reduction): Remove + duplicate little-endian adjustment. + +2005-06-28 Kelley Cook + + * doc/include/texinfo.tex: Import from upstream CVS. + +2005-06-28 Jan Hubicka + + * cgraph.c (cgraph_remove_node): Do not release function bodies until + full cgraph is built. + * cgraph.h (cgraph_decide_inlining_incrementally): Add early argument. + * cgraphunit.c (cgraph_finalize_function): Update call of + cgraph_decide_inlining_incrementally. + (initialize_inline_failed): Break out of ... + (cgraph_analyze_function): ... here. + (rebuild_cgraph_edges): New function. + (pass_rebuild_cgraph_edges): New pass. + * common.opt (fearly-inlining): New flag. + * ipa-inline.c: Include ggc.h + (cgraph_clone_inlined_nodes): Avoid re-using of original copy + when cgraph is not fully built. + (cgraph_decide_inlining_incrementally): Add early mode. + (cgraph_early_inlining): New function. + (cgraph_gate_early_inlining): Likewise. + (pass_early_ipa_inline): New pass. + * ipa.c (cgraph_postorder): NULLify aux pointer. + * tree-inline.c (expand_call_inline): Avoid warning early. + * tree-optimize.c (pass_early_local_passes): New. + (execute_cleanup_cfg_pre_ipa): New. + (pass_cleanup_cfg): New. + (register_dump_files): Fix handling subpasses of IPA pass. + (init_tree_optimization_passes): Add early passes. + (execute_ipa_pass_list): Fix handling of subpasses of IPA pass. + * passes.h (pass_early_tree_profile, pass_rebuild_cgraph_edges, + pass_early_ipa_inline): New passes. + * tree-profile.c (do_early_tree_profiling, pass_early_tree_profile): New. + + * invoke.texi: Document early-inlining. + +2005-06-28 Kelley Cook + + * doc/include/fdl.texi: Merge in changes from upstream. + * doc/include/gpl.texi: Likewise. + +2005-06-27 Diego Novillo + + PR 21959 + * tree-ssa-loop-niter.c (scev_probably_wraps_p): Handle type + casts between unsigned and signed types with different size + or precision. + +2005-06-28 Jan Hubicka + + * tree-optimize.c (exercute_free_datastructures): + Do not disband implicit edges; do not attempt to build insn list; + do not free cfg annotations. + (execute_free_cfg_annotations); Disband implicit edges here; + free cfg annotations here too. + (pass_free_cfg_annotations); New pass. + (init_tree_optimization_passes); Add pass_free_cfg_annotations. + * tree-ssa-operands.c (free_ssa_operands); Recover; export. + * tree-ssa-operands.h (free_ssa_operands); declare. + * tree-ssa.c (delete_tree_ssa); Free SSA operand; mark stmt modified; + kill PHI nodes. + * tree-ssanames.c (release_defs): Kill addresses_taken. + + * basic-block.h (basic_block_def): Kill rbi. + (reorder_block_def): Kill; Remove next field (replaced by aux); + move other fields to ... + (rtl_bb_info): ... here. + * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, + copy_bb, connect_traces, add_labels_and_missing_jumps + fix_up_fall_thru_edges, fix_crossing_conditional_branches, + duplicate_computed_gotos, partition_hot_cold_basic-blocks): + Update to new fields. + * cfg.c (initialize_bb_rbi): Kill. + * cfglayout.c (record_effective_endpoints, fixup_reorder_chain, + fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update. + * cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi. + (try_redirect_by_replacing_jump): Update rbi references. + (cfg_layout_split_block): Likewise. + (cfg_layout_delete_block): Likewise. + (cfg_layout_merge_blocks): Likewise. + * function.c (thread_prologue_and_epilogue_insns): Likewise. + * passes.c (rest_of_handle_sms): Likewise. + * tracer.c (seen, tail_duplicate, layout_superblocks): Likewise. + +2005-06-27 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_file_start): Note PPC405 erratum + in verbose_asm output. + * config/rs6000/rs6000.h (PPC405_ERRATUM77): Bracket with + CONFIG_PPC405CR. + * config.gcc (powerpc with_which): Define CONFIG_PPC405CR for + 405cr. + +2005-06-27 Jakub Jelinek + + * builtin-attrs.def (DEF_ATTR_FOR_INT): Add for 5 and 6. + (DEF_LIST_INT_INT): Add for 4,0, 4,5, 5,0, 5,6. + (ATTR_NOTHROW_NONNULL_4, ATTR_NOTHROW_NONNULL_5): Define. + (ATTR_FORMAT_PRINTF_4_0, ATTR_FORMAT_PRINTF_4_5, + ATTR_FORMAT_PRINTF_5_0, ATTR_FORMAT_PRINTF_5_6): Define. + * builtins.c: Include tree-flow.h. + (expand_builtin_mempcpy, expand_builtin_memmove): Comment fixes. + (expand_builtin_object_size, expand_builtin_memory_chk, + maybe_emit_chk_warning, maybe_emit_sprintf_chk_warning, + compute_object_offset, compute_builtin_object_size, + fold_builtin_object_size): New functions. + (expand_builtin): Handle BUILT_IN_OBJECT_SIZE and BUILT_IN_*_CHK. + (fold_builtin_1): Likewise. Handle BUILT_IN_{,V}{,F}PRINTF + and BUILT_IN_{,F}PRINTF_UNLOCKED. + (fold_builtin_memory_chk, fold_builtin_stxcpy_chk, + fold_builtin_strncpy_chk, fold_builtin_strcat_chk, + fold_builtin_strncat_chk, fold_builtin_sprintf_chk, + fold_builtin_snprintf_chk, fold_builtin_printf, fold_builtin_fprintf): + New functions. + * builtins.def (BUILT_IN_OBJECT_SIZE, BUILT_IN_MEMCPY_CHK, + BUILT_IN_MEMMOVE_CHK, BUILT_IN_MEMPCPY_CHK, BUILT_IN_MEMSET_CHK, + BUILT_IN_STPCPY_CHK, BUILT_IN_STRCAT_CHK, BUILT_IN_STRCPY_CHK, + BUILT_IN_STRNCAT_CHK, BUILT_IN_STRNCPY_CHK, BUILT_IN_SNPRINTF_CHK, + BUILT_IN_SPRINTF_CHK, BUILT_IN_VSNPRINTF_CHK, BUILT_IN_VSPRINTF_CHK, + BUILT_IN_FPRINTF_CHK, BUILT_IN_PRINTF_CHK, BUILT_IN_VFPRINTF_CHK, + BUILT_IN_VPRINTF_CHK): New builtins. + * builtin-types.def (DEF_FUNCTION_TYPE_5, DEF_FUNCTION_TYPE_VAR_4): + Document. + (BT_FN_SIZE_CONST_PTR_INT, BT_FN_INT_INT_CONST_STRING_VALIST_ARG, + BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, BT_FN_PTR_PTR_INT_SIZE_SIZE, + BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, + BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG, + BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG, + BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG, + BT_FN_INT_INT_CONST_STRING_VAR, BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR, + BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, + BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR): New types. + * c-common.c (DEF_FUNCTION_TYPE_5, DEF_FUNCTION_TYPE_6, + DEF_FUNCTION_TYPE_VAR_4, DEF_FUNCTION_TYPE_VAR_5): Define. + * Makefile.in (OBJS-common): Add tree-object-size.o. + (tree-object-size.o): Add dependencies. + * tree-pass.h (pass_object_sizes): Add. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_object_sizes. + * tree-object-size.c: New file. + * tree.h (fold_builtin_memory_chk, fold_builtin_stxcpy_chk, + fold_builtin_strncpy_chk, fold_builtin_snprintf_chk, + compute_builtin_object_size, init_object_sizes, fini_object_sizes): + New prototypes. + * tree-ssa-ccp.c (get_strlen): Rename to ... + (get_maxval_strlen): ...this function. Handle also computing of maximum + string length and maximum integral value. + (ccp_fold_builtin): Handle BUILT_IN_*_CHK. Use get_maxval_strlen + instead of get_strlen. Pass CALLEE and ARGLIST variables to the + folding functions instead of computing them again. + (execute_fold_all_builtins): Retry ccp_fold_builtin if a builtin changed + into some other builtin. + * doc/extend.texi (Object Size Checking): Document. + + * regrename.c (copy_value): Fix comment. + + * toplev.c (process_options): Use if (FRAME_GROWS_DOWNWARD) + instead of preprocessor conditionals. + + * targhooks.c (default_hidden_stack_protect_fail): Fall back to + default_external_stack_protect_fail if visibility is not supported + or not flag_pic. + * config/i386/i386.c (ix86_stack_protect_fail): New function. + (TARGET_STACK_PROTECT_FAIL): Define. + * config/i386/i386.md (stack_protect_si): Change CLOBBER into + SET to zero. + (stack_protect_di): Likewise. Use %k2 instead of %2 to avoid + invalid instruction xorl %rax, %rax. + +2005-06-27 Richard Henderson + + * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. + * cfgexpand.c: Include params.h. + (has_protected_decls, has_short_buffer): New. + (expand_stack_vars): Take a predicate to determine what to expand. + (defer_stack_allocation): True when flag_stack_protect on. + (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. + (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. + (stack_protect_classify_type, stack_protect_decl_phase): New. + (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. + (add_stack_protection_conflicts, create_stack_guard): New. + (expand_used_vars): Add stack protection logic. + (tree_expand_cfg): Likewise. + * common.opt (Wstack-protector): New. + (fstack-protector, fstack-protector-all): New. + * function.c: Include predict.h. + (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect + wants to copy the parameter into the stack frame. + (stack_protect_prologue, stack_protect_epilogue): New. + (expand_function_end): Call stack_protect_epilogue. Do + sjlj_emit_function_exit_after after naked_return_label. + * function.h (struct function): Add stack_protect_guard. + * params.def (PARAM_SSP_BUFFER_SIZE): New. + * toplev.c (process_options): Disable flag_stack_protect and/or + warn_stack_protect based on FRAME_GROWS_DOWNWARD. + * tree.h (stack_protect_prologue): Declare. + + * target-def.h (TARGET_STACK_PROTECT_GUARD): New. + (TARGET_STACK_PROTECT_FAIL): New. + (TARGET_INITIALIZER): Add them. + * target.h (struct gcc_target): Add stack_protect_guard and + stack_protect_fail. + * targhooks.c: Include ggc.h, gty header. + (stack_chk_guard_decl, default_stack_protect_guard): New. + (stack_chk_fail_decl, default_external_stack_protect_fail): New. + (default_hidden_stack_protect_fail): New. + * targhooks.h (default_stack_protect_guard): Declare. + (default_external_stack_protect_fail): Declare. + (default_hidden_stack_protect_fail): Declare. + * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. + * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. + (trap): Use ud2. + (conditional_trap, conditional_trap_1): Remove. + (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. + (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. + * doc/md.texi (stack_protect_set, stack_protect_test): New. + * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. + (TARGET_STACK_PROTECT_FAIL): New. + + * libgcc-std.ver (GCC_4.1.0): New. + * libgcc.h (__stack_chk_guard): Declare. + (__stack_chk_fail, __stack_chk_fail_local): Declare. + * libgcc2.c (L_stack_chk, L_stack_chk_local): New. + * mklibgcc.in (lib2funcs): Add them. + +2005-06-26 Kaveh R. Ghazi + + PR c/21911 + * c-common.c (check_function_sentinel): Pass in named argument + list, skip over named arguments before looking for a sentinel. + (check_function_arguments): Pass in named argument list. + * c-common.h (check_function_arguments): Likewise. + * c-typeck.c (build_function_call): Likewise. + +2005-06-26 Kaveh R. Ghazi + + * genautomata.c (decl_mode_check_failed, + regexp_mode_check_failed): Add noreturn attribute. + +2005-06-26 Kazu Hirata + + * cfg.c, tree-vect-transform.c, tree.def: Fix comment typos. + * doc/invoke.texi: Fix typos. + + * builtins.c, c-common.c, c-convert.c, c-decl.c, c-typeck.c, + convert.c, lambda-code.c, predict.c, tree-cfg.c, + tree-complex.c, tree-data-ref.c, tree-if-conv.c, + tree-mudflap.c, tree-scalar-evolution.c, tree-ssa-ccp.c, + tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, + tree-ssa-loop-manip.c, tree-ssa-phiopt.c, tree-ssa-pre.c, + tree-vect-analyze.c, tree-vect-transform.c, tree-vectorizer.c, + tree.c: Use fold_buildN instead of fold (buildN (...)). + +2005-06-26 Gerald Pfeifer + + * doc/install.texi (Specific): Do not specify the concrete + versions of GCC provided by Cygwin. Simplify the part on + building on Cygwin. + +2005-06-26 Kazu Hirata + + * config/arc/arc-protos.c: Remove the prototype for + arc_finalize_pic. + * config/arc/arc.c (arc_finalize_pic): Remove. + * config/arc/arc.h (FINALIZE_PIC): Likewise. + * config/bfin/bfin.h (FINALIZE_PIC): Likewise. + * config/rs6000/rs6000.h (FINALIZE_PIC): Likewise. + +2005-06-26 Jakub Jelinek + + PR middle-end/17965 + * calls.c (expand_call, emit_library_call_value_1): Use xmalloc/free + instead of alloca for really big argument sizes. + + PR middle-end/22028 + * gimplify.c (gimplify_type_sizes): Check for type == error_mark_node + earlier in the function. + + * regrename.c (copy_value): Don't replace fixed or global + regs with older regs. + + * defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined. + * function.c (get_func_frame_size): Use if (FRAME_GROWS_DOWNWARD) + instead of preprocessor conditionals. + (assign_stack_local_1, assign_stack_temp_for_type): Likewise. + * cfgexpand.c (FRAME_GROWS_DOWNWARD): Don't redefine to 1 or 0 + depending on if it was or was not defined previously. + * doc/rtl.texi (VIRTUAL_STACK_VARS_REGNUM): Mention that only non-zero + definition of FRAME_GROWS_DOWNWARD means frame grows downward. + * doc/tm.texi (FRAME_GROWS_DOWNWARD): Likewise. + * config/m68hc11/m68hc11.h (FRAME_GROWS_DOWNWARD): Define to 0. Update + comment. + * config/pa/pa.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/stormy16/stormy16.h (FRAME_GROWS_DOWNWARD): Define to 0. + * config/c4x/c4x.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/sh/sh.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/iq2000/iq2000.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/pdp11/pdp11.h (FRAME_GROWS_DOWNWARD): Define to 1. Update + comment. + * config/i860/i860.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/h8300/h8300.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/arc/arc.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/vax/vax.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/sparc/sparc.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/i386/i386.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/fr30/fr30.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/frv/frv.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/mn10300/mn10300.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/bfin/bfin.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/ns32k/ns32k.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/v850/v850.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/alpha/alpha.h (FRAME_GROWS_DOWNWARD): Update comment. + * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/arm/arm.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/alpha/unicosmk.h (FRAME_GROWS_DOWNWARD): Define to 1. + * config/cris/cris.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/m68k/m68k.h (FRAME_GROWS_DOWNWARD): Likewise. + * config/mmix/mmix.h (FRAME_GROWS_DOWNWARD): Likewise. + +2005-06-26 Kazu Hirata + + PR tree-optimization/22026 + * tree-vrp.c (extract_range_from_binary_expr): Drop to + VR_VARYING if a binary expression involving VR_ANTI_RANGE is + PLUS_EXPR, MINUS_EXPR, or unsigned MULT_EXPR. + +2005-06-26 Kazu Hirata + + * Makefile.in (OBJS-common): Remove duplicate object file + names. + +2005-06-25 Jan Hubicka + + * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update profile. + * cfg.c (update_bb_profile_for_threading): Fix rescaling. + + * passes.c (rest_of_handle_branch_prob): Do not rebuild profiling info + when not neecesary + (rest_of_compilation): Fix conditional on branch prob pass. + * predict.c (tree_estimate_probability): Enable strip_builtin_expect + when not loop optimizing. + +2005-06-25 Bernd Schmidt + + * config/bfin/bfin.md (ror_one, rol_one, ashrdi3, ashldi3, lshrdi3): + New patterns. + (movbi): Add alternative to set CC to zero. + (compare_eq, compare_ne, compare_le, compare_lt, compare_leu, + compare_ltu): Now named patterns. + +2005-06-25 Kelley Cook + + * all files: Update FSF address in copyright headers. + +2005-06-25 Kelley Cook + + * gengtype.c: Update FSF address in copyright header. + (create_file): Update FSF in outputed copyright header. + +2005-06-24 Kazu Hirata + + * cfglayout.c (block_locators_locs, line_locators_locs, + line_locators_lines, file_locators_locs): Change the type to + VEC(int,heap)*. + (insn_locators_initialize, change_scope, insn_scope, + locator_line, insn_line, locator_file): Use VEC instead of + VARRAY. + +2005-06-24 Jason Merrill + + * tree-nrv.c (tree_nrv): Fix to check assignments to the + RESULT_DECL rather than just RETURN_EXPRs. + (finalize_nrv_r): Adjust. + +2005-06-24 Jan Hubicka + + * tree-optimize.c (init_tree_optimization_passes): Fix flags of + all_passes and all_ipa_passes. + + * c-common.c: Include cgraph.h + (handle_externally_visible_attribute): New function. + (c_common_att): Add "externally_visible" attribute. + * cgraph.c (decide_is_variable_needed): Obey externally + visible flag. + (cgraph_varpool_finalize_decl): Avoid redundant checking. + * cgraph.h (struct cgraph_node): New flag externally_visible. + (decide_is_function_needed): Obey externally visible flag. + (cgraph_finalize_function): Avoid redundant checks. + (cgraph_function_and_variable_visibility): Bring symbols local + when asked for. + * common.opt (fwhole-program): New flag. + + * doc/invoke.texi (-fwhole-program): Document. + +2005-06-24 Mark Mitchell + + PR 22171 + * tree-ssa-operands.c (get_expr_operands): Check s_ann for NULL + before use. + +2005-06-23 Mark Mitchell + + PR 22000 + * tree-ssa-operands.c (get_expr_operands): Check the volatility of + the FIELD_DECL and set s_ann->has_volatile_ops accordingly. + +2005-06-24 Jan Hubicka + + * opts.c (decode_options): Enable unit-at-a-time by default at -O1. + +2005-06-23 Jeff Law + + * tree-optimize.c (init_tree_optimization_passes): Move + copy prop pass to run just before VRP. + * tree-vrp.c (remove_range_assertions): Remove copies created + by ASSERT_EXPR removal. + +2005-06-23 Kazu Hirata + + PR tree-optimization/22117 + * tree-vrp.c (extract_range_from_binary_expr): Compute a + correct range when adding two pointers. + +2005-06-23 Jason Merrill + + PR c++/19317 + Leave the return slot target in the MODIFY_EXPR rather than making + it an argument, but only use it if the CALL_EXPR has a flag set. + * tree.h (CALL_EXPR_HAS_RETURN_SLOT_ADDR): Rename to + CALL_EXPR_RETURN_SLOT_OPT. + * calls.c (expand_call): Adjust. + * tree-inline.c (expand_call_inline): Adjust. + * tree-pretty-print.c (dump_generic_node): Adjust. + + And set the flag as appropriate. + * gimplify.c (gimplify_modify_expr_rhs): Set + CALL_EXPR_HAS_RETURN_SLOT_ADDR where the LHS is obviously safe. + * tree-nrv.c (execute_return_slot_opt): Set + CALL_EXPR_HAS_RETURN_SLOT_ADDR based on escape analysis. + * tree-pass.h: Declare pass_return_slot. + * tree-optimize.c (init_tree_optimization_passes): Add it. + +2005-06-23 David Edelsohn + + PR target/21760 + * config/rs6000/rs6000.h (PPC405_ERRATUM77): New. + * config/rs6000/rs6000.md: Move atomic instructions to ... + * config/rs6000/sync.md: Here. + Change sync_compare_and_swap to define_expand. All stwcx + patterns test PPC405_ERRATUM77. + +2005-06-23 Jan Hubicka + + * tree-inline.c (copy_body_r): Remap labels correctly. + +2005-06-22 Alan Modra + + * config/rs6000/sysv4.h (TARGET_ASM_EXCEPTION_SECTION): Delete. + +2005-06-22 Richard Kenner + + PR middle-end/20593 + * varasm.c (compute_reloc_for_constant): Treat VIEW_CONVER_EXPR + the same as the other cast operands. + (output_addressed_constants): Likewise. + +2005-06-21 Jeff Law + + * tree-vrp.c (extract_range_from_unary_expr): Handle type + conversions better. + +2005-06-21 Dorit Nuzman + + * genopinit.c (vec_shl_optab, vec_shr_optab): Initialize new optabs. + (reduc_plus_optab): Removed. Replcaed with... + (reduc_splus_optab, reduc_uplus_optab): Initialize new optabs. + * optabs.c (optab_for_tree_code): Return reduc_splus_optab or + reduc_uplus_optab instead of reduc_plus_optab. + (expand_vec_shift_expr): New function. + (init_optabs): Initialize new optabs. Remove initialization of + reduc_plus_optab. + (optab_for_tree_code): Return vec_shl_optab/vec_shr_optab + for VEC_LSHIFT_EXPR/VEC_RSHIFT_EXPR. + * optabs.h (OTI_reduc_plus): Removed. Replaced with... + (OTI_reduc_splus, OTI_reduc_uplus): New. + (reduc_plus_optab): Removed. Replcaed with... + (reduc_splus_optab, reduc_uplus_optab): New optabs. + (vec_shl_optab, vec_shr_optab): New optabs. + (expand_vec_shift_expr): New function declaration. + + * tree.def (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): New tree-codes. + * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. + * expr.c (expand_expr_real_1): Handle new tree-codes. + * tree-pretty-print.c (dump_generic_node, op_symbol, op_prio): Likewise. + * tree-vect-generic.c (expand_vector_operations_1): Add assert. + + * tree-vect-transform.c (vect_create_epilog_for_reduction): Add two + alternatives for generating reduction epilog code. + (vectorizable_reduction): Don't fail of direct reduction support is + not available. + (vectorizable_target_reduction_pattern): Likewise. + + * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, + reduc_umax_v4si, reduc_smin_v4si, reduc_smin_v4sf, reduc_umin_v4si, + reduc_plus_v4si, reduc_plus_v4sf): Removed. + (vec_shl_, vec_shr_, altivec_vsumsws_nomode, + reduc_splus_, reduc_uplus_v16qi): New. + +2005-06-20 Daniel Berlin + + * c-typeck.c (build_function_call): Set fundecl = function again. + * tree-ssa-alias.c (find_used_portions): Address taking causes the + entire variable to be used. + * tree-ssa-structalias.c (do_structure_copy): Fix handling of + unknown size variables, and structure copies from addressof + operations. Simplify how we do *a = *b type structure copies. + (init_base_vars): Add ANYTHING = &ANYTHING constraint the right + way. READONLY's address is not taken by default. + INTEGER dereference should point to anything. + (create_variable_info_for): It's okay for the first field to not start + at 0. + +2005-06-20 Kaz Kojima + + config/sh/linux.h (FUNCTION_PROFILER): Constify a char*. + +2005-06-20 Roger Sayle + Fariborz Jahanian + + * combine.c (simplify_set): Simplify setting of CC register + by removing redundant compare with 0 on RHS. + +2005-06-20 Jan Beulich + + * config/i386/netware-libgcc.def: Update copyright. + * config/i386/netware-libgcc.exp (__divdc3, __divsc3, __divxc3, + __muldc3, __mulsc3, __mulxc3, __powidf2, __powisf2, __powixf2): Add. + * config/i386/netware.c (gen_stdcall_decoration, + gen_fastd_decoration): Merge into ... + (gen_stdcall_or_fastcall_decoration): ... this. Adjust to match + WinNT's changes. + (gen_regparm_prefix): Adjust to match i386_nlm_encode_section_info. + (i386_nlm_encode_section_info): Adjust to match WinNT's changes. + * config/i386/t-nwld (SHLIB_LINK): Also create libgcc.imp alias of + libgcc_s.imp. Use 'expr' rather than $(()) shell expressions. + * gthr-nks.h (__gthread_objc_mutex_allocate): Kill another dubious + use of NX_MUTEX_RECURSIVE. + +2005-06-19 Roger Sayle + + * fold-const.c (swap_tree_comparison): Add support for unordered + floating point comparisons. + * tree-vrp.c (opposite_comparison): Delete. + (extract_range_from_assert): Replace calls to opposite_comparison + with calls to swap_tree_comparison. + (register_edge_assert_for): Likewise. + (vrp_evaluate_conditional): Likewise. + +2005-06-20 Kaz Kojima + + * integrate.c (allocate_initial_values): Update the references + to global_live_at_start and global_live_at_end. + +2005-06-20 Jan Hubicka + + * cfgloop.h (DLTHE_RECORD_COPY_NUMBER): New flag. + * cfgloopmanip.c (duplicate_loop_to_header_edge): Set aux flags only + when asked for. + * loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations, + unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid): + Update call of duplicate_loop_to_header_edge. + (apply_opt_in_copies): Clear out aux pointers. + +2005-06-19 Joseph S. Myers + + * config/i386/i386.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. + (ix86_mangle_fundamental_type): New. + * config/ia64/ia64.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. + (ia64_mangle_fundamental_type): New. + +2005-06-19 Roger Sayle + + * c-decl.c (grokdeclarator): Only check TREE_OVERFLOW on + INTEGER_CST nodes. + * c-typeck.c (build_c_cast): Only preserve TREE_OVERFLOW on + CONSTANT_CLASS_P nodes. + +2005-06-19 Richard Henderson + + * config/ia64/vect.md (vec_extractv2sf_1): Fix cut-and-paste error; + the shift is always required. + +2005-06-19 Richard Henderson + + * config/ia64/ia64-modes.def (V4SF): Add. + * config/ia64/ia64.c (ia64_legitimate_constant_p): Handle CONST_VECTOR. + * config/ia64/ia64.h (CANNOT_CHANGE_MODE_CLASS): Allow vector to + integer mode changes in fp regs. + * config/ia64/ia64.md (UNSPEC_VECT_EXTR): New. + * config/ia64/vect.md (smaxv2sf3, sminv2sf3): Fix typos in names. + (reduc_plus_v2sf, reduc_smax_v2sf, reduc_smin_v2sf): New. + (vcondv2sf): Use gen_fpack + (fpack): Remove * from name. + (fswap, fmix_l, fmix_r, fmix_lr): New. + (vec_setv2sf, vec_extractv2sf_0_le, vec_extractv2sf_0_be): New. + (vec_extractv2sf_1, vec_extractv2sf): New. + +2005-06-19 Andreas Krebbel + + * combine.c (make_compound_operation): Use simplify_subreg. Delete + a optimization already done by simplify_subreg. + +2005-06-19 Ulrich Weigand + + * loop.c (scan_loop): Do not consider insns setting the frame + pointer to be candidates for hoisting. + +2005-06-19 Uros Bizjak + + * config/i386/i386.md (*cmpfp_0_sf, *cmpfp_0_df, cmpfp_0_xf): + Remove instruction patterns. + (*cmpfp_0): New instruction pattern. Set "unit" attribute to "i387". + (*cmpfp_sf, *cmpfp_df, *cmpfp_xf, *cmpfp_u, *_cmpfp_): + Set "unit" attribute to "i387". + (*pushsf, *pushsf_rex64, *pushdf_nointeger, *pushdf_integer) + (*pushxf_nointeger, *pushxf_integer): Set "unit" attribute to "i387" + for alternative 0. + (*truncdfsf_mixed, *truncdfsf_i387, *truncxfsf2_mixed) + (*truncxfsf2_i387, *truncxfdf2_mixed, *truncxfdf2_i387): Set "unit" + attribute to "i387" when "type" attribute equals "multi". + (*floathisf2_i387, *floatsisf2_mixed, *floatsisf2_i387) + (*floatdisf2_mixed, *floatdisf2_i387, *floathidf2_i387) + (*floatsidf2_mixed, *floatsidf2_i387, *floatdidf2_mixed) + (*floatdidf2_i387, floathixf2, floatsixf2, floatdixf2): Set "unit" + attribute to "i387" when "type" attribute equals "multi". + * config/i386/mmx.md (*mov_internal_rex64) + (*mov_internal, *movv2sf_internal_rex64, *movv2sf_internal): + Set "unit" attribute to "mmx" when "type" attribute equals "ssecvt". + (mmx_pmovmskb): Correct wrong "type" and "mode" attributes. + * config/i386/sse.md (sse_cvtps2pi, sse_cvttps2pi, sse_cvtpd2di) + (sse_cvttpd2pi): Set "unit" attribute to "mmx". + (sse2_cvtpi2pd): Split register constraints. Set "unit" attribute + to "mmx" for "y" operand 1. + +2005-06-19 Uros Bizjak + + * config/i386/i386.c (ix86_function_arg_regno_p): Add MMX_REGNO_P + for TARGET_MMX. Use MMX_REGPARM_MAX and SSE_REGPARM_MAX for MMX + and SSE registers to determine if regno is valid. + (ix86_function_value_regno_p): Depend FIRST_FLOAT_REG on + TARGET_FLOAT_RETURNS_IN_80387 also for TARGET_64BIT. Clean up. + +2005-06-18 Richard Henderson + + * tree-complex.c (init_dont_simulate_again): Clear DONT_SIMULATE_AGAIN + for control-altering statements; set it again for returns. + (complex_visit_stmt): Return SSA_PROP_VARYING for stmts that are + not MODIFY_EXPR. + +2005-06-18 Richard Henderson + + PR tree-opt/22116 + * tree-ssa-pre.c (create_expression_by_pieces): Set + DECL_COMPLEX_GIMPLE_REG_P. + (insert_into_preds_of_block): Likewise. + +2005-06-18 Steven Bosscher + + * Makefile.in: Fix tree-cfgcleanup.c dependencies. + +2005-06-18 Richard Henderson + + * expr.c (store_constructor): Use store of 0 to indicate value + death instead of a clobber. + + * config/i386/i386.c (ix86_expand_reduc_v4sf): New. + * config/i386/i386-protos.h (ix86_expand_reduc_v4sf): Declare. + * config/i386/sse.md (reduc_plus_v4sf): New. + (reduc_smax_v4sf, reduc_smin_v4sf): New. + +2005-06-18 James A. Morrison + + * fold_const (fold_binary): Fold X % (2**N) to X & (2**N - 1) for + nonnegative values of X. + +2005-06-18 Uros Bizjak + + * doc/md.texi (Standard Names): Change insn pattern name + from truncM2 to btruncM2 for 'trunc' built-in description. + Add rintM2 insn pattern description. + +2005-06-18 Kaveh R. Ghazi + + * c-decl.c (locate_old_decl): Add format attribute. + (implicit_decl_warning): Likewise. + + * diagnostic.h (verbatim): Move ... + * toplev.h (verbatim): ... here. Add ATTRIBUTE_GCC_DIAG. + * pretty-print.h (pp_verbatim): Add ATTRIBUTE_GCC_PPDIAG. + +2005-06-18 Roger Sayle + + PR target/22083 + * config/rs6000/aix51.h (TARGET_C99_FUNCTIONS): Remove definition. + +2005-06-18 Dorit Nuzman + + * tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New + tree-codes. + * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, + OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. + (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, + reduc_plus_optab): New optabs for reduction. + * expr.c (expand_expr_real_1): Handle new tree-codes. + * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. + * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle + new tree-codes. + * optabs.c (optab_for_tree_code): Handle new tree-codes. + (init_optabs): Initialize new optabs. + * genopinit.c (optabs): Define handlers for new optabs. + + * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in + case of a phi that is marked as relevant. Call vectorizable_reduction. + (vect_mark_relevant): Phis may be marked as relevant. + (vect_mark_stmts_to_be_vectorized): The use corresponding to the + reduction variable in a reduction stmt does not mark its defining phi + as relevant. Update documentation accordingly. + (vect_can_advance_ivs_p): Skip reduction phis. + * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes + additional argument. Handle reduction. + (vect_create_destination_var): Update call to vect_get_new_vect_var. + Handle non-vector argument. + (get_initial_def_for_reduction): New function. + (vect_create_epilog_for_reduction): New function. + (vectorizable_reduction): New function. + (vect_get_new_vect_var): Handle new vect_var_kind. + (vectorizable_assignment, vectorizable_operation, vectorizable_store, + vectorizable_condition): Update call to vect_get_new_vect_var. + (vect_transform_stmt): Call vectorizable_reduction. + (vect_update_ivs_after_vectorizer): Skip reduction phis. + (vect_transform_loop): Skip if stmt is both not relevant and not live. + * tree-vectorizer.c (reduction_code_for_scalar_code): New function. + (vect_is_simple_reduction): Was empty - added implementation. + * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. + (reduc_vec_info_type): New enum vect_def_type value. + * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, + reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, + reduc_plus_v4si, reduc_plus_v4sf): New define_expands. + + * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove + ENABLE_CHECKING around gcc_assert. + * tree-vect-transform.c (vect_do_peeling_for_loop_bound, + (vect_do_peeling_for_alignment, vect_transform_loop, + vect_get_vec_def_for_operand): Likewise. + +2005-06-18 Joseph S. Myers + + * config/ia64/ia64.c (ia64_function_arg): Set up a PARALLEL for a + big-endian unnamed __float80 value. + +2005-06-18 Richard Henderson + + PR tree-opt/22103 + * tree-sra.c (generate_copy_inout): Handle SSA_NAME complex + destinations. + +2005-06-17 Richard Henderson + + * tree-vect-transform.c (vect_do_peeling_for_loop_bound): Use + initialize_original_copy_tables and free_original_copy_tables. + (vect_do_peeling_for_alignment): Likewise. + +2005-06-17 Pat Haugen + + * bb-reorder.c (find_traces_1_round): Use succ block frequency + instead of edge frequency for calls to better_edge_p. + +2005-06-17 Andrew Pinski + + PR tree-opt/22105 + * tree-ssa-loop-im.c (for_each_index): Handle COMPLEX_CST. + +2005-06-17 Steve Ellcey + + PR target/19889 + * config/ia64/hpux.h (FUNCTION_PROFILER): New (dummy). + (PROFILE_HOOK): New. + (PROFILE_BEFORE_PROLOGUE): Undef. + (NO_PROFILE_COUNTERS): New. + * config/ia64/ia64-protos.h (ia64_profile_hook): New. + * config/ia64/ia64.c (ia64_compute_frame_size): Add ifdef. + (gen_mcount_func_rtx): New. + (ia64_profile_hook): New. + * config/ia64/ia64.md (ip_value): New. + +2005-06-17 Devang Patel + + * config/rs6000/predicates.md (s5bit_cint_operand, + u5bit_cint_operand): New. + * config/rs6000/altivec.md (altivec_vspltb, altivec_vsplth, + altivec_vspltisw_v4sf): Use new 5 bit constant operand predicates. + * config/rs6000/rs6000.c (rs6000_expand_unop_builtin): Fix signed + 5 bit constant check. + +2005-06-17 Richard Henderson + + * local-alloc.c (update_equiv_regs): Update reg_equiv_init + properly when moving an initialization insn. + +2005-06-17 Paolo Bonzini + + * aclocal.m4 (gcc_AC_CHECK_TOOL): Do not overwrite the + passed variable. + * configure.ac: Regenerate. + +2005-06-17 Jan Hubicka + + * tree-optimize.c (execute_ipa_pass_list): New. + (ipa_passes): Use it. + +2005-06-16 Richard Henderson + + PR tree-opt/22022 + * tree-complex.c (update_phi_components): Avoid no-op moves. + +2005-06-16 Joseph S. Myers + + * Makefile.in (cc1-checksum.c): Use + build/genchecksum$(build_exeext), not build/genchecksum$(exeext). + +2005-06-16 Geoffrey Keating + + * gengtype.c (adjust_field_rtx_def): Don't add a skip to + basic_block types. + + * config/t-slibgcc-darwin (SHLIB_SOVERSION): Rename from + SHLIB_MINOR. + (SHLIB_REVISION): Delete. + (SHLIB_VERSTRING): Update to compensate. + (SHLIB_SONAME): Just use one '.' in the name. + +2005-06-16 Eric Botcazou + + PR tree-optimization/22018 + * tree-vrp.c (vrp_int_const_binop): Overhaul handling of overflow. + +2005-06-16 Richard Henderson + + PR tree-opt/22035 + * builtins.c (fold_builtin_complex_mul): Remove. + (fold_builtin_complex_div): Remove. + (fold_builtin_1): Don't call them. + * fold-const.c (fold_complex_add, fold_complex_mult_parts, + fold_complex_mult, fold_complex_div_parts, fold_complex_div): Remove. + (fold_binary): Don't call them. Don't expand complex comparisons to + elementary comparisons. + * tree-complex.c (init_dont_simulate_again): Enhance search for + stmts that require decomposition. + (complex_visit_stmt): Handle RETURN_EXPR properly. + (create_components): Handle no referenced variables properly. + * tree.h (fold_complex_mult_parts): Remove. + (fold_complex_div_parts): Remove. + +2005-06-16 Richard Guenther + + * doc/extend.texi: Document sseregparm target attribute. + Clarify fastcall and regparm documentation. + * config/i386/i386.h: Adjust float_in_sse documentation. + * config/i386/i386.c: Add new target attribute sseregparm. + (ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): + Merge into ... + (ix86_handle_cconv_attribute): ... here. Also handle + sseregparm attribute. + (ix86_comp_type_attributes): Compare sseregparm attributes. + (ix86_function_sseregparm): New function, split out from ... + (init_cumulative_args): ... here. Use to decide use + of SSE registers and error in case of missing support. + (ix86_value_regno): Likewise. + (function_arg_advance): Do not bail out for DFmode if we need + to pass doubles in registers. + (function_arg): Likewise. + +2005-06-16 Paolo Bonzini + Daniel Jacobowitz + Alan Modra + + * configure.ac (gcc_version): Set near the beginning. + (as, ld, nm): Do not link in-tree tools. Set gcc_cv_* if tools are + found in the tree. Use gcc_AC_PROG to find the tools in the system. + (objdump): Do not look for it. + * Makefile.in (NM_FOR_TARGET): Point to ./nm + (ORIGINAL_AS_FOR_TARGET, ORIGINAL_LD_FOR_TARGET, + ORIGINAL_NM_FOR_TARGET): Substitute from autoconf. + (as, ld, nm): New rules. + (libgcc.mk): Depend on them. + * aclocal.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL, + gcc_AC_BUILD_EXEEXT): New. + (gcc_AC_CHECK_PROG_VER): Use gcc_AC_BUILD_EXEEXT. + * configure: Regenerate. + +2005-06-16 Jan Hubicka + + * basic-block.h (rtl_bb_info): Break out head_, end_, + global_live_at_start, global_live_at_end from ... + (basic_block_def): ... here; update all references + (BB_RTL): New flag. + (init_rtl_bb_info): Declare. + * cfgexpand.c (expand_gimple_basic_block): Init bb info, set BB_RTL + flag. + * cfgrtl.c: Include ggc.h + (create_basic_block_structure): Init bb info. + (rtl_verify_flow_info_1): Check BB_RTL flag and rtl_bb_info pointer. + (init_rtl_bb_info): New function. + (rtl_merge_block, cfglayout_merge_block): Copy global_live_at_end here. + * cfghooks.c (merge_block): Do not copy global_live_at_end here. + * cfg.c (clear_bb_flags): Skip BB_RTL flag. + (dump_flow_info): Gueard global_live_* dumping. + + * Makefile.in (cfg.o): Add new dependencies. + * basic-block.h (reorder_block_def): Kill + original/copy/duplicated/copy_number fields. + (BB_DUPLICATED): New flag. + (initialize_original_copy_tables, free_original_copy_tables, + set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New. + * cfg.c: Include hashtab.h and alloc-pool.h + (bb_original, bb_copy, original_copy_bb_pool): New static vars. + (htab_bb_copy_original_entry): New struct. + (bb_copy_original_hash, bb_copy_original_eq): New static functions. + (initialize_original_copy_tables, free_original_copy_tables, + set_bb_original, get_bb_original, set_bb_copy, get_bb_copy): New + global functions. + * cfghooks.c (duplicate_block): Update original/copy handling. + * cfglayout.c (fixup_reorder_chain): Likewise. + (cfg_layout_initialize): Initialize orignal_copy tables. + (cfg_layout_finalize): FInalize original_copy tables. + (can_copy_bbs_p): Use BB_DUPLICATED flag. + (copy_bbs): Likewise. + * cfgloopmanip.c (update-single_exits_after_duplication): Likewise. + (duplicate_loop_to_header_edge): Likewise; update handling of + copy_number. + (loop_version): Likewise. + * dominance.c (get_dominated_by_region): Use BB_DUPLICATED_FLAG. + * except.c (expand_resx_expr): Check that reg->resume is not set. + * loop-unroll.c (unroll_loop_constant_iterations, + unroll_loop_runtime_iterations, apply_opt_in_copies): Update + copy/original handling. + * loop-unwitch.c (unswitch_loop): Likewise. + * tree-cfg.c (create_bb): Do not initialize RBI. + (disband_implicit_edges): Do not kill RBI. + (add_phi_args_after_copy_bb): Use new original/copy mapping. + (add_phi_args_after_copy): Use BB_DUPLICATED flag. + (tree_duplicate_sese_region): Update original/copy handling. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. + * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise. + +2005-06-15 Andrew Pinski + + PR tree-opt/21923 + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Conversions between + integer types whos ranges are different are not useless. + +2005-06-15 Andrew Pinski + + PR tree-opt/22024 + * tree-ssa-reassoc.c (init_reassoc): Also give chain decl a distint + rank. + +2005-06-15 Diego Novillo + + * tree-ssa-structalias.c (dump_solution_for_var): Reformat + output. + (dump_sa_points_to_info): Make extern. + (debug_sa_points_to_info): New. + * tree-ssa-structalias.h (TREE_SSA_STRUCTALIAS_H): Rename from + TREE_ALIAS_COMMON. + (dump_sa_points_to_info): Declare. + (debug_sa_points_to_info): Declare. + +2005-06-15 Joseph S. Myers + + * c-tree.h (default_function_array_conversion): Declare. + * c-typeck.c (default_function_array_conversion): Export. Correct + comment. + (default_conversion): Do not call + default_function_array_conversion. Do not allow FUNCTION_TYPE. + (build_function_call): Call default_function_array_conversion on + the function. + (convert_arguments): Do not call it on the function arguments. + (build_unary_op): Do not allow ARRAY_TYPE or FUNCTION_TYPE for + TRUTH_NOT_EXPR. Call default_function_array_conversion for taking + address of ARRAY_REF. + (build_compound_expr): Do not call + default_function_array_conversion. + (build_c_cast): Do not call default_function_array_conversion. + (convert_for_assignment): Do not call default_conversion. + (digest_init): Call default_function_array_conversion to convert + string constants and compound literals to pointers, but not + otherwise. + (output_init_element): Likewise. + (build_asm_expr): Do not call default_function_array_conversion. + (c_process_expr_stmt): Likewise. + (c_objc_common_truthvalue_conversion): Likewise. Do not allow + FUNCTION_TYPE. + * c-parser.c (c_parser_expression_conv): New. + (c_parser_asm_operands, c_parser_expr_list): Add convert_p + argument. All callers changed. Call + default_function_array_conversion if convert_p. + (c_parser_initializer, c_parser_initval): Call + default_function_array_conversion except for string constants and + compound literals. + (c_parser_initelt): Call default_function_array_conversion for + ObjC expression received. + (c_parser_statement_after_labels): Call c_parser_expression_conv + for return and expression statements. + (c_parser_paren_condition, c_parser_for_statement, + c_parser_conditional_expression): Call c_parser_expression_conv. + (c_parser_expr_no_commas, c_parser_conditional_expression, + c_parser_binary_expression, c_parser_cast_expression, + c_parser_unary_expression): Call + default_function_array_conversion. + +2005-06-15 Diego Novillo + + * tree-vrp.c (vrp_int_const_binop): Do not handle MAX_EXPR + when the result overflows. + +2005-06-15 David Ung + + * config/mips/mips.c (mips_rtx_cost_data): Add cost for 4kc, 4kp, + 24k and 24kx. + +2005-06-15 Richard Sandiford + + * doc/invoke.texi (-mips16): Fix typo. + +2005-06-15 David Ung + + * config/mips/mips.h (GENERATE_MIPS16E): New definition. + * config/mips/mips.md (zero_extend2): + Changed expand condition to exclude generating of "and" if + GENERATE_MIPS16E is true. + (*zero_extend2_mips16e): New pattern for + matching mips16e zeb/zeh. + (*extend2_mips16e): New pattern for matching + mips16e seb/seh. + (*extend2): Disable this pattern for + GENERATE_MIPS16E. + * doc/invoke.texi (MIPS Options): Add comment to -mips16 + indicating MIPS16e ASE is used if targetting for MIPS32 or MIPS64. + +2005-06-15 Diego Novillo + + PR 22018 + * tree-vrp.c (vrp_int_const_binop): New. + (extract_range_from_binary_expr): Call it. + Unify handling division and multiplication. + +2005-06-15 Aldy Hernandez + + * c-common.h (same_scalar_type_ignoring_signedness): Protoize. + + * c-common.c (same_scalar_type_ignoring_signedness): New. + + * c-typeck.c (build_binary_op): Check compatability of vector + types. Move error report after switch. + Do not clobber code[01] on *_DIV_EXPR case. + + * testsuite/gcc.dg/simd-1.c: Update error messages. + * testsuite/gcc.dg/simd-1b.c: Re-enable tests. Update error + messages. + * testsuite/gcc.dg/simd-2.c: Update error messages. + * testsuite/gcc.dg/simd-4.c: New. + +2005-06-15 Bernd Schmidt + + * Makefile.in (local-alloc.o): Depend on $(GGC_H) and reload.h. + * local-alloc.c: Include "ggc.h" and "reload.h". + (struct equivalence): New member is_arg_equivalence. + (local_alloc): Always call update_equiv_regs. + (update_equiv_regs): Allocate reg_equiv_init; set reg_equiv_init_size. + Detect equivalences made by stores to memory in a second pass. + Return early if not optimizing. + Initialize reg_equiv_init for all equivalences; treat equivalences for + REG_EQUIV notes existing before this pass specially. + (no_equiv): Don't clear reg_equiv_init or remove notes if the + is_arg_equivalence field is set. + * reload.h (reg_equiv_init, reg_equiv_init_size): Declare. + * reload1.c (reg_equiv_init): No longer static. + (reg_equiv_init_size): New variable. + (reload): Don't allocate reg_equiv_init; don't free it when done but + clear it. + Restructure equivalence set up code not to set reg_equiv_init, but to + clear it when we can't use an equivalence. + Undo change disabling equivalences for MEM_READONLY_P memrefs. + Dump equivalencing insns to dump_file. + +2005-06-14 Richard Sandiford + + * config/mips/mips.c (machine_function): Add varargs_size field. + (mips_setup_incoming_varargs): Store the amount of extra stack space + there rather than in *pretend_size. When saving registers, always + expect virtual_incoming_args_rtx to point to the start of the + pretend arguments. + (mips_va_start): Remove alignment hack. Handle all + !EABI_FLOAT_VARARGS_P cases in the same way. + (compute_frame_size): Handle varargs_size. Remove the redundant + !TARGET_OLDABI condition in the handling of pretend_args_size. + (mips_initial_elimination_offset): Remove the now-redundant check + of TARGET_NEWABI. + +2005-06-14 Jeff Law + + * tree-vrp.c (local_fold): Remove. + (simplify_using_ranges): Use fold_convert, not local_fold. Tweak + DIV/MOD case slightly for readability. + +2005-06-14 Frank Ch. Eigler + + PR mudflap/21023 + * tree-mudflap.c (mudflap_finish_file): Exclude non-public + rather than static objects (!) from libmudflap registration. + +2005-06-14 Richard Sandiford + + * opt-functions.awk (global_state_p, needs_state_p, static_var): New. + (var_ref): Take the option's flags as a second parameter. Check + static_var. + * optc-gen.awk: Declare local state variables. Pass flags to var_ref. + +2005-06-14 Eric Botcazou + + PR target/20301 + * config/sparc/sol2.h (ASM_GENERATE_INTERNAL_LABEL): Emit + unsigned index numbers. + +2005-06-13 Geoffrey Keating + + * Makefile.in (install-man): Doesn't really depend on installdirs. + (various rules for installing manpages): Do depend on installdirs. + +2005-06-14 Nathan Sidwell + + * unwind-dw2-fde-darwin.c (examine_objects): Fix aliasing in + read_encoded_value_with_base call. + * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. + * unwind-dw2-fde.c (_Unwind_Find_FDE): Likewise. + * unwind-dw2.c (extract_cie_info): Fix aliasing in + read_encoded_value call. + (execute_cfa_program, uw_frame_state_for): Likewise. + +2005-06-13 Roger Sayle + + PR rtl-optimization/22053 + * reg-stack.c (compensate_edge): Correct mistake in the assertion + checking of EDGE_ABNORMAL_CALL edges; complex return values can + result in the top two stack slots, st(0) and st(1), being live. + +2005-06-13 Jeff Law + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): No longer + simplify DIV, MOD or ABS expressions using VRP information. + Remove WALK_DATA parameter. Prototype and all callers updated. + (eliminate_redundant_computations): Remove WALK_DATA parameter. + Prototype and all callers updated. + (optimize_stmt): WALK_DATA parameter is now unused. + + * tree-vrp.c (local_fold): New function. Like fold, but + strips useless type conversions in the result. + (simplify_using_ranges): New function, largely cribbed from + tree-ssa-dom.c::simplify_rhs_and_lookup_avail_expr. + (vrp_finalize): Call simplify_using_ranges. + +2005-06-13 Mark Mitchell + + * config/i386/x86-64.h (ASM_SPEC): Explicitly pass --64 to the + assembler in 64-bit mode. + +2005-06-13 David Edelsohn + + Revert scc_operand patch. + * config/rs6000/predicates.md (scc_operand): Delete. + * config/rs6000/rs6000.md (scc_operand): Change to scc_eq_operand. + +2005-06-13 Zdenek Dvorak + + PR middle-end/21985 + * fold-const.c (split_address_to_core_and_offset): Always return + the address of the base object. + +2005-06-13 Bernd Schmidt + + * doc/invoke.texi (Blackfin Options): Document -mlong-calls. + +2005-06-12 Richard Henderson + + PR tree-opt/21994 + * tree-complex.c (update_complex_components_on_edge): New. + (update_parameter_components): Use it. + (update_phi_components): Likewise. + (expand_complex_move): Likewise for is_ctrl_altering_stmt. + +2005-06-12 James A. Morrison + + PR tree-optimization/14796 + * fold-const (fold_binary): Transform (X << C) >> C into X & (-1>>C) + for unsigned types. + +2005-06-12 Kazu Hirata + + * cgraphunit.c, tree-ssa-loop-ivopts.c, + tree-ssa-structalias.c, tree-vectorizer.c, tree-vectorizer.h, + config/sparc/sparc.c: Fix comment typos. + +2005-06-12 Richard Earnshaw + + * arm/ieee754-df.s (aeabi_dcmpeq, aeabi_dcmplt, aeabi_dcmple) + (aeabi_dcmpge, aeabi_dcmpgt): Maintain 8-byte stack alignment. + * arm/ieee754-sf.s (aeabi_l2f, aeabi_fcmpeq, aeabi_fcmplt) + (aeabi_fcmple, aeabi_fcmpge, aeabi_fcmpgt): Likewise. + +2005-06-12 James A. Morrison + + PR tree-optimization/14796 + * fold-const.c (fold_binary): Transform (A >> C) << C into + one BIT_AND_EXPR. + : Transform (A OP c1) OP c2 into A OP (c1 + c2). + +2005-06-11 Geoffrey Keating + + * config/rs6000/predicates.md (reg_or_arith_cint_operand): Delete. + (reg_or_add_cint_operand): Rename from reg_or_add_cint64_operand. + Handle SImode. + (reg_or_sub_cint_operand): Likewise. + (mask_operand): Handle DImode. + (mask64_operand): Delete. + (and64_operand): Delete. + * config/rs6000/rs6000.c (num_insns_constant): Use mask_operand + instead of mask64_operand. + (print_operand): Likewise. + (rs6000_rtx_costs): Use mask_operand and reg_or_add_cint_operand and + reg_or_sub_cint_operand instead of *64_* variants. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Use mask_operand + instead of mask64_operand. + * config/rs6000/rs6000.md: Use mask_operand and and_operand instead + of *64_* variants. + (FP): New. + (add_op2): Delete. + (add3): Use reg_or_add_cint_operand. + (sub_op2): Delete. + (sub3): Use reg_or_sub_cint_operand. + (udiv3, div3, div3_no_mq, mod3, + mov_internal2, mov, cmp, cmp, + cmp_internal1, indirect_jump, ctr, + ctr_internal1, ctr_internal2, ctr_internal5, + ctr_internal6, save_fpregs_, return_internal_, + return_and_restore_fpregs_, eh_set_lr_, + various unnamed patterns): New. + (udivsi3, divsi3, divsi3_no_mq, modsi3, movsi_internal2, movsi, + cmpsi, cmpsi_internal1, indirect_jumpsi, ctrsi, ctrsi_internal1, + ctrsi_internal2, ctrsi_internal5, ctrsi_internal6, save_fpregs_si, + return_internal_si, return_and_restore_fpregs_si, eh_set_lr_si, + udivdi3, divdi3, divdi3_no_mq, moddi3, movdi_internal2, movdi, + cmpdi, cmpdi_internal1, indirect_jumpdi, ctrdi, ctrdi_internal1, + ctrdi_internal2, ctrdi_internal5, ctrdi_internal6, save_fpregs_di, + return_internal_di, return_and_restore_fpregs_di, eh_set_lr_di, + movhi, movqi, cmpsf, cmpdf, cmptf, various unnamed patterns): + Delete. + +2005-06-11 Gabriel Dos Reis + + * rtl.h (to_rtx_code): Remove. + * machmode.h (to_machine_mode): Likewise. + * read-rtl.c (apply_mode_macro): Replace to_machine_mode with + explicit cast. + (apply_mode_maps): Likewise. + (read_rtx_1): Likewise. + (apply_code_macro): Replace to to_rtx_code with explicit cast. + (check_code_macro): Likewise. + (read_rtx_1): Likewise. + +2005-06-11 Gabriel Dos Reis + + * c-typeck.c (convert_for_assignment): Avoid checking + OPT_Wc___compat, as it is always true. + +2005-06-11 David Edelsohn + + * config/rs6000/rs6000.md (eq_compare): Restrict to Pmode. + +2005-06-11 Daniel Berlin + + Fix PR tree-optimization/22005 + Fix PR tree-optimization/22025 + + * tree-ssa-structalias.c (struct variable_info): Add has_union + member. + (create_variable_info_for): Mark variables containing unions. + Don't sort the field stack if notokay is true. + (find_what_p_points_to): Convert variables containing unions back + to their SFT's if necessary. + +2005-06-11 Daniel Berlin + + * lambda-code.c (replace_uses_equiv_to_x_with_y): Verify the step + is an INTEGER_CST before calling int_cst_value. + +2005-06-10 Uros Bizjak + + PR target/21981 + * config/i386/i386.c (ix86_function_value_regno_p): Return true + for FIRST_MMX_REG if TARGET_MMX. + (ix86_return_in_memory): Return 1 for MMX/3dNow vectors. Delete + wrong comment. + (ix86_struct_value_rtx): Emit warning for MMX ABI violations. + (ix86_value_regno): Return FIRST_MMX_REG for MMX vector modes. + +2005-06-10 Daniel Berlin + + * lambda-code.c (replace_uses_equiv_to_x_with_y): Check step + and access function against chrec_dont_know. + +2005-06-10 Daniel Berlin + + * lambda-code.c (replace_uses_of_x_with_y): Renamed and rewritten + slightly. + (exit_phi_for_loop_p): New function. + (can_put_in_inner_loop): Ditto. + (can_convert_to_perfect_nest): Ditto. + (perfect_nestify): Create iv with right type. + Rewrite statements in correct order. + +2005-06-10 Keith Besaw + + * tree-ssa-alias.c (new_type_alias): Use existing type + tag if VAR has just one in its may_aliases list. + +2005-06-10 Fariborz Jahanian + + * rs6000/predicates.md (scc_operand): New. + * rs6000/rs6000.md : Use scc_operand for eq:SI compares. + +2005-06-10 Dorit Nuzman + + * tree-vect-analyze.c (vect_analyze_data_ref_dependence): DRs whose + dependence-distance modulo VF is 0 are recorded in the + SAME_ALIGN_REFs VEC in each DR. + (vect_enhance_data_refs_alignment): Avoid 80 column overflow. The + alignment information of DRs that are in the SAME_ALIGN_REFs VEC of the + DR we want to peel for, is set to 0. + * tree-vect-transform.c (vect_do_peeling_for_loop_bound): Fix printout. + * tree-vectorizer.c (destroy_loop_vec_info): Free the SAME_ALIGN_REFs + VEC. + * tree-vectorizer.h (dr_p): New type. Defined to use the VEC API. + (_stmt_vec_info): Added new field same_align_refs. + (STMT_VINFO_SAME_ALIGN_REFS): New macro. + +2005-06-10 Nathan Sidwell + + * vec.h (VEC_safe_grow): Append MEM_STAT_INFO. + +2005-06-10 Alan Modra + + * config/rs6000/linux.h (NO_PROFILE_COUNTERS): Define. + * config/rs6000/linux64.h (NO_PROFILE_COUNTERS): Define as 1. + * config/rs6000/rs6000.c (output_function_profiler): Obey + NO_PROFILE_COUNTERS. Handle TARGET_SECURE_PLT. Use "bcl 20,31" + for -fPIC. Delete save_lr and substitute its value into strings. + +2005-06-09 Dale Johannesen + + * config/i386/i386.c (optimization_options): Make -fno-math-errno + the default on Darwin. + * config/rs6000/rs6000.c (optimization_options): Ditto. + * doc/invoke.texi (-fno-math-errno): Document. + +2005-06-09 Dale Johannesen + + * config/rs6000/rs6000.c (TARGET_INSN_VALID_WITHIN_DOLOOP): + Change to TARGET_INVALID_WITHIN_DOLOOP. + +2005-06-09 David Edelsohn + + * config/rs6000/rs6000.md (eq): Convert to define_insn_and_split. + * config/rs6000/predicates.md (scc_eq_operand): New. + +2005-06-09 Kaz Kojima + + * config/sh/sh.md (mextr_rl): Set buffer size properly. + (*mextr_lr): Likewise. + +2005-06-09 Gabriel Dos Reis + + PR c/21759 + * c.opt (Wc++-compat): New. + * doc/invoke.texi (-Wc++-compat): Document. + * c-typeck.c (convert_for_assignment): Check for implicit + conversion void* -> T*. + +2005-06-09 Gabriel Dos Reis + + * machmode.h (to_machine_mode): New. + * rtl.h (to_rtx_code): Likewise. + * read-rtl.c (apply_mode_macro): Convert mode to machine_mode. + (print_c_condition): Convert return value of htab_find(). + (apply_code_macro): Add explicit cast when convertin to enums. + (apply_mode_maps): Likewise. + (check_code_macro): Likewise. + (read_rtx_1): Likewise. + +2005-06-09 Richard Henderson + + * config/ia64/ia64.c (update_set_flags): Just return for IF_THEN_ELSE. + Use SCALAR_FLOAT_MODE_P. + * config/ia64/vect.md (vcondv2sf): Remove code check on comparison. + (fselect): Rename from fpcmp; use %F. + (fpcmp): New. + +2005-06-09 Jan Hubicka + + * cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize + local statics when doing unit-at-a-time. + (cgraph_varpool_assemble_pending_decls): Output debug info. + * dwarf2out.c (decls_for_scope): Skip local statics. + (dwarf2out_decl): Handle local statics. + * passes.c (rest_of_decl_compilation): Do not differentiate + local and global statics in unit-at-a-time. + * tree-inline.c (remap_decls): Put local static into + unexpanded_vars_list rather than introducing duplicated VAR_DECL + node. + +2005-06-09 Daniel Berlin + + * config/rs6000/rs6000.c: (rs6000_insn_valid_within_doloop): Fix + prototype. + +2005-06-08 Daniel Berlin + + * Makefile.in (OBJS-common): Add tree-ssa-structalias.o. + * tree-flow.h (find_what_p_points_to): Add prototype. + (push_fields_onto_fieldstack): Ditto. + (sort_fieldstack): Ditto. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_build_pta and pass_del_pta. + * tree-pass.h (pass_build_pta): New structure. + (pass_del_pta): Ditto. + * tree-ssa-alias.c (compute_flow_sensitive_aliasing): Disambiguate + using new alias analyzer. + (push_fields_onto_fieldstack): Removed from here. + (bitpos_of_field): Ditto. + (fieldoff_compare): Ditto. + * tree-ssa-structalias.c: New file. + * tree-ssa-structalias.h: Ditto. + +2005-06-09 Nathan Sidwell + + * c-typeck.c (build_c_cast): Check type punning on COMPONENT_REF + too. + +2005-06-09 Bernd Schmidt + + * config/bfin/bfin.c (enum bfin_builtins): Moved here from... + * config/bfin/bfin.h (enum bfin_builtins): ... here. + +2005-06-09 Adrian Straetling + + * target.h (insn_valid_within_doloop): Rename into + "invalid_within_doloop". Change return type to "const char *". + Update Comment. + * targhooks.h (default_insn_valid_within_doloop): Rename into + "default_invalid_within_doloop". + * targhooks.c (default_insn_valid_within_doloop): Likewise. + Update Comment. + * target-def.h (TARGET_INSN_VALID_WITHIN_DOLOOP): Rename target hook + into "TARGET_INVALID_WITHIN_DOLOOP". Default it to + "default_invalid_within_doloop". + * hooks.c (hook_constcharptr_rtx_null): New function. + (hook_bool_rtx_true): Remove. + * hooks.h (hook_constcharptr_rtx_null): Declare. + (hook_bool_rtx_true): Remove. + * loop-doloop.c (doloop_valid_p): Temporarily store return value of + "invalid_within_doloop" and print error message if non-null. + Update Comment. + * doc/tm.texi: Update documentation. + * config/s390/s390.c: Adjust to new hook name and new default hook. + * config/rs6000/rs6000.c: (rs6000_insn_valid_within_doloop): Rename + into "rs6000_invalid_within_doloop". + (rs6000_invalid_within_doloop): Change return type to "static const + char *" and replace return values. Update Comment. + +2005-06-09 Bernd Schmidt + + * config/bfin/bfin.opt (mlong-calls): New. + * config/bfin/predicates.md (call_insn_operand): Disallow SYMBOL_REF + if TARGET_LONG_CALLS. + +2005-06-09 Richard Henderson + + PR tree-opt/20610 + * tree.h (DECL_COMPLEX_GIMPLE_REG_P): New. + (struct tree_decl): Add gimple_reg_flag. + * integrate.c (copy_decl_for_inlining): Copy it. + * gimplify.c (internal_get_tmp_var): Set it. + (gimplify_bind_expr): Likewise. + (gimplify_function_tree): Likewise. + (gimplify_modify_expr_complex_part): New. + (gimplify_modify_expr): Use it. + * tree-gimple.c (is_gimple_reg_type): Allow complex. + (is_gimple_reg): Allow complex with DECL_COMPLEX_GIMPLE_REG_P set. + + * tree-complex.c (complex_lattice_t): New. + (complex_lattice_values, complex_variable_components): New. + (some_nonzerop, find_lattice_value, is_complex_reg, + init_parameter_lattice_values, init_dont_simulate_again, + complex_visit_stmt, complex_visit_phi, create_components, + update_complex_components, update_parameter_components, + update_phi_components, update_all_vops, expand_complex_move): New. + (extract_component): Handle INDIRECT_REF, COMPONENT_REF, ARRAY_REF, + SSA_NAME. + (update_complex_assignment): Use update_complex_components; + handle updates of return_expr properly. + (expand_complex_addition): Use complex lattice values. + (expand_complex_multiplication): Likewise. + (expand_complex_division): Likewise. + (expand_complex_libcall): Use update_complex_components. + (expand_complex_comparison): Use update_stmt. + (expand_complex_operations_1): Use expand_complex_move, retrieve + lattice values. + (tree_lower_complex): Compute lattice values. + (tree_lower_complex_O0): Duplicate from tree_lower_complex. + (pass_lower_complex_O0): Rename from pass_lower_complex. + (pass_lower_complex, gate_no_optimization): New. + * tree-optimize.c (init_tree_optimization_passes): Update for + complex pass changes. + * tree-pass.h (pass_lower_complex_O0): Declare. + +2005-06-08 Dale Johannesen + + * config/darwin.c (darwin_binds_local_p): New. + * config/darwin-protos.h (darwin_binds_local_p): Declare it. + * config/i386/i386.c (TARGET_BINDS_LOCAL_P): Use it for TARGET_MACHO. + * config/rs6000/rs6000.c (rs6000_binds_local_p): Remove. + (TARGET_BINDS_LOCAL_P): Change it to darwin_binds_local_p. + +2005-06-08 Aldy Hernandez + + * config/rs6000/rs6000.h: Remove rs6000_long_double_size_string, + rs6000_isel, rs6000_spe, rs6000_alignment_string, + rs6000_sched_restricted_insns_priority_str, + rs6000_sched_restricted_insns_priority, rs6000_abi_string. + +2005-06-08 Zdenek Dvorak + + * tree-ssa-address.c (addr_for_mem_ref): Use LAST_VIRTUAL_REGISTER + instead of FIRST_PSEUDO_REGISTER for creating pseudoregisters. + * tree-ssa-loop-ivopts.c (add_cost, multiply_by_cost, + multiplier_allowed_in_address_p, get_address_cost): Ditto. + +2005-06-08 Richard Henderson + + * config/ia64/ia64.h (NO_PROFILE_COUNTERS): New. + * config/ia64/ia64.c (ia64_output_function_profiler): Honor it. + Emit out3 load right after alloc. + +2005-06-08 Aldy Hernandez + + * config/rs6000/linuxspe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use + rs6000_explicit_options. + +2005-06-08 Richard Henderson + + * config/ia64/ia64.h (FUNCTION_PROFILER): Move implementation ... + * config/ia64/ia64.c (ia64_output_function_profiler): ... here; add + unwind markup. + * config/ia64/ia64-protos.h (ia64_output_function_profiler): Declare. + +2005-06-08 Joseph S. Myers + + * config/sol2-c.c (cmn_err_char_table): Allow width for %b + formats. + +2005-06-08 James A. Morrison + + PR target/20666 + * config/sparc/sparc.c (sparc_fold_builtin): New function + (sparc_vis_mul8x16): New function. + (sparc_handle_vis_mul8x16): New function. + (TARGET_FOLD_BUILTIN): Define to sparc_fold_builtin. + +2005-06-08 David Edelsohn + + * config/rs6000/rs6000.md (call_indirect_nonlocal_aix32): Prefer + CTR to LR. + (call_indirect_nonlocal_aix64): Same. + (call_value_indirect_nonlocal_aix32): Same. + (call_value_indirect_nonlocal_aix64): Same. + + PR target/10588 + (eq): Use CLZ splitter for compare with zero. + +2005-06-08 Bernd Schmidt + + * config/bfin/bfin.c (bfin_return_in_memory): Simplify; return + everything larger than 8 bytes in memory. + + * config/bfin/bfin.h (enum bfin_builtins): New. + * config/bfin/bfin.md (UNSPEC_VOLATILE_CSYNC, UNSPEC_VOLATILE_SSYNC): + New constants. + (csync, ssync): New insn patterns. + * config/bfin/bfin.c (bfin_init_builtins, bfin_expand_builtin): + New functions. + (def_builtin): New macro. + (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN): Define. + + From Jie Zhang + * config/bfin/bfin.h (ASM_OUTPUT_ALIGN): Gas now emulates the + behavior of the native assembler in VDSP. So change accordingly. + +2005-06-08 Sebastian Pop + + * tree-data-ref.c (compute_estimated_nb_iterations, + analyze_array_indexes, compute_overlap_steps_for_affine_1_2, + analyze_subscript_affine_affine, find_data_references_in_loop): + Fixed to use chrec_contains_undetermined to test the values of + loop->estimated_nb_iterations. + * tree-ssa-loop-niter.c (estimate_numbers_of_iterations_loop): + Compute the estimation only when loop->estimated_nb_iterations + has not yet been initialized. + (convert_step_widening, scev_probably_wraps_p): Add a call to + estimate_numbers_of_iterations_loop. + * tree-vrp.c (execute_vrp): Don't call estimate_numbers_of_iterations. + +2005-06-08 Eric Botcazou + + PR debug/21946 + * dwarf2out.c (add_loc_descr_op_piece): Move to the + DWARF2_DEBUGGING_INFO section. + +2005-06-08 Richard Henderson + + PR target/21721 + * config/ia64/ia64.c (emit_predicate_relation_info): Skip p0. + +2005-06-08 Eric Botcazou + + PR target/21889 + * target.h (gcc_target) : New field output_dwarf_dtprel. + * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. + (TARGET_ASM_OUT): Add it. + * doc/tm.texi (Debugging Info): Document it. + * dwarf2out.c (output_loc_operands) : + Test it instead of ASM_OUTPUT_DWARF_DTPREL. + (loc_descriptor_from_tree_1) : Likewise. + * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. + * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. + * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. + (gen_inlined_tls_plt): Remove unused variable MEM. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. + * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. + * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and + unused. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. + * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. + * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and + unused. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. + * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. + * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and + unused. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel + * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. + * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and + unused. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. + * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. + (TARGET_GNU_TLS): Define to 1. + * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. + * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and + unused. + (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel + if TARGET_GNU_TLS only. + * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. + + * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. + (sparc-*-solaris2*): Likewise on Solaris 7 and up. + +2005-06-07 Dale Johannesen + + * config/i386/i386.md (movqi_1): Fix case where source + is memory and destination EDI. + +2005-06-08 Kazu Hirata + + * config/c4x/c4x.h (PREDICATE_CODES): Remove mem_operand. + +2005-06-07 Eric Christopher + + * system.h: Poison EXTRA_CC_MODES. + * config/frv/frv.h (SELECT_CC_MODE): Rewrite comment. + * config/ia64/ia64.h (SELECT_CC_MODE): Ditto. + * doc/md.texi (Jump Patterns): Replace reference to + EXTRA_CC_MODES with machine-modes.def. + * doc/rtl.texi (Machine Modes): Ditto. + +2005-06-07 Richard Henderson + + * varasm.c (initialize_cold_section_name): Fix alloca buffer overflow. + (assemble_start_function): Fix strcmp confusion. + +2005-06-07 Uros Bizjak + + * config/i386/i386.h (enum ix86_entity): New. + (enum ix86_stack_slot): New. + (OPTIMIZE_MODE_SWITCHING): Redefine to use + ix86_optimize_mode_switching[] array. + (NUM_MODES_FOR_MODE_SWITCHING): Redefine for 4 entities. + (MODE_NEEDED): Use ix86_mode_needed() function. + (EMIT_MODE_SET): Redefine for changed emit_i387_cw_initialization () + function. + (struct machine_function): Use optimize_mode_switching[] array. + + * config/i386/i386.c (MAX_386_STACK_LOCALS): Remove. + (ix86_mode_needed): New function. + (emit_i387_cw_initialization): Cleanup. Use mode to calculate + correct stack positions for stored control words. + (assign_386_stack_local): Use enum ix86_stack_slot. Change assert. + (ix86_expand_builtin) [IX86_BUILTIN_LDMXCSR]: Change constant to + SLOT_TEMP. + [IX86_BUILTIN_STMXCSR]: Same. + + * config/i386/i386-protos.h (assign_stack_local): Change prototype. + (emit_i387_cw_initialization): Change prototype. + (ix86_mode_needed): New prototype. + + * config/i386/i386.md (i387_cw attribute): Change order of elements. + (truncdfsf2, truncxfsf2, truncxfdf2, fix_trunc_fisttp_i387_1) + (*fix_trunc_i387_1, lrint2, *fist2_floor_1) + (*fist2_ceil_1): Change constant in call to + assign_386_stack_local to SLOT_TEMP. + (*fix_trunc_i387_1): Change constant in call to + assign_386_stack_local to SLOT_CW_STORED and SLOT_CW_TRUNC. + Use new ix86_optimize_mode_switching[] array. + (frndintxf2_floor, *fist2_floor_1): Change constants in call to + assign_386_stack_local to SLOT_CW_STORED and SLOT_CW_FLOOR. + Use new ix86_optimize_mode_switching[] array. + (frndintxf2_ceil, *fist2_ceil_1): Change constants in call to + assign_386_stack_local to SLOT_CW_STORED and SLOT_CW_CEIL. + Use new ix86_optimize_mode_switching[] array. + (frndintxf2_trunc): Change constants in call to + assign_386_stack_local to SLOT_CW_STORED and SLOT_CW_TRUNC. + Use new ix86_optimize_mode_switching[] array. + (frndintxf2_mask_pm): Change constants in call to + assign_386_stack_local to SLOT_CW_STORED and SLOT_CW_MASK_PM. + Use new ix86_optimize_mode_switching[] array. + + (define_peephole2): Change constant from 17 to FLAGS_REG; + +2005-06-07 Richard Henderson + + PR rtl-opt/21528 + * rtlanal.c (reg_overlap_mentioned_p) : Handle 'E' formats. + +2005-06-07 Dale Johannesen + + * tree-nested.c (finalize_nesting_tree_1): Disable + warn_padded around layout_type call. + +2005-06-08 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (rewrite_use_outer): Unshare the expression + before emiting it. + +2005-06-07 Eric Christopher + + * config/mips/predicates.md: Revert previous patch. + +2005-06-07 Jakub Jelinek + + PR middle-end/21850 + * tree.c (get_unwidened): Stop at NOP_EXPR/CONVERT_EXPR that convert + from vector types. + +2005-06-07 Diego Novillo + + * tree-ssa-threadupdate.c (struct thread_stats_d): Declare. + (thread_stats): New local variable. + (redirect_edges): Increment count of threaded edges. + (thread_through_all_blocks): Initialize thread_stats. + Display number of threaded jumps if TDF_STATS is enabled. + +2005-06-07 Kazu Hirata + + * sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as + the current bit index with no modulo. + +2005-06-07 Sebastian Pop + + PR 18403 and meta PR 21861. + * Makefile.in (tree-chrec.o): Depend on CFGLOOP_H and TREE_FLOW_H. + * tree-chrec.c: Include cfgloop.h and tree-flow.h. + (evolution_function_is_invariant_rec_p, + evolution_function_is_invariant_p): New. + (chrec_convert): Use an extra parameter AT_STMT for refining the + information that is passed down to convert_step. Integrate the + code that was in count_ev_in_wider_type. + * tree-chrec.h (count_ev_in_wider_type): Removed. + (chrec_convert): Modify its declaration. + (evolution_function_is_invariant_p): Declared. + (evolution_function_is_affine_p): Use evolution_function_is_invariant_p. + * tree-flow.h (can_count_iv_in_wider_type): Renamed convert_step. + (scev_probably_wraps_p): Declared. + * tree-scalar-evolution.c (count_ev_in_wider_type): Removed. + (follow_ssa_edge_in_rhs, interpret_rhs_modify_expr): + Use an extra parameter AT_STMT for refining the information that is + passed down to convert_step. + (follow_ssa_edge_inner_loop_phi, follow_ssa_edge, + analyze_scalar_evolution_1): Initialize AT_STMT with the current + analyzed statement. + (instantiate_parameters_1): Don't know yet how to initialize AT_STMT. + * tree-ssa-loop-ivopts.c (idx_find_step): Update the use of + can_count_iv_in_wider_type to use convert_step. + * tree-ssa-loop-niter.c (can_count_iv_in_wider_type_bound): Move + code that is independent of the loop over the known iteration + bounds to convert_step_widening, the rest is moved to + proved_non_wrapping_p. + (scev_probably_wraps_p): New. + (can_count_iv_in_wider_type): Renamed convert_step. + * tree-vrp.c (adjust_range_with_scev): Take an extra AT_STMT parameter. + Use scev_probably_wraps_p for computing init_is_max. + (vrp_visit_assignment): Pass the current analyzed statement to + adjust_range_with_scev. + (execute_vrp): Call estimate_numbers_of_iterations for refining the + information provided by scev analyzer. + +2005-06-07 Eric Christopher + + * config/mips/predicates.md (sleu_operand): Use + IN_RANGE to specify range of operand. + +2005-06-07 Steven Bosscher + + PR tree-optimization/21847 + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): With + -fnon-call-exceptions, also mark statements inherently + necessary if they may throw. + +2005-06-07 Adrian Straetling + + * config/s390/s390.md: ("UNSPECV_MB", "UNSPECV_CAS"): New constants. + ("type"): Add "sem" to 'type' attribute. + ("memory_barrier", "*memory_barrier", "sync_compare_and_swapdi", + "sync_compare_and_swapsi", "sync_compare_and_swap_ccdi", + "sync_compare_and_swap_ccsi", "*sync_compare_and_swap_ccdi", + "*sync_compare_and_swap_ccsi"): New patterns. + * config/s390/2064.md: ("z_sem"): New insn_reservation. + * config/s390/2084.md: ("x_sem"): New insn_reservation. + * config/s390/s390.c: (s390_compare_emitted): New global variable. + (s390_emit_compare): Do not emit comparison again after cas. + * config/s390/s390.h (s390_compare_emitted): Declare. + +2005-06-07 Kazu Hirata + + * sbitmap.h (sbitmap_iterator, sbitmap_iter_init, + sbitmap_iter_cond, sbitmap_iter_next): New. + * bt-load.c, cfganal.c, combine.c, ddg.c, flow.c, + modulo-sched.c, sbitmap.c, sched-rgn.c, tree-into-ssa.c, + tree-outof-ssa.c, tree-ssa-alias.c, tree-ssa-live.c: Update + uses of EXECUTE_IF_SET_IN_SBITMAP to the new style. + +2005-06-07 Zdenek Dvorak + + * tree-ssa-address.c: New file. + * Makefile.in (tree-ssa-address.o): Add. + * expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on + INDIRECT_REFs. Handle TARGET_MEM_REFs. + * tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs. + * tree-flow.h (struct mem_address): New. + (struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c. + (create_mem_ref, addr_for_mem_ref, get_address_description, + maybe_fold_tmr, multiplier_allowed_in_address_p, + multiply_by_cost): Declare. + * tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs. + * tree-pretty-print.c (dump_generic_node): Ditto. + * tree-ssa-loop-im.c (for_each_index): Ditto. + * tree-ssa-loop-ivopts.c (may_be_unaligned_p, + find_interesting_uses_address): Ditto. + (rewrite_address_base, build_addr_strip_iref): Removed. + (struct affine_tree_combination): Moved to tree-flow.h. + (get_ref_tag, copy_ref_info): New functions. + (rewrite_use_address): Produce TARGET_MEM_REFs. + (tree_ssa_iv_optimize): Do not call update_ssa + and rewrite_into_loop_closed_ssa. + (tree_to_aff_combination): Use build_fold_addr_expr instead of + build_addr_strip_iref. + (unshare_aff_combination): New function. + (fold_affine_sum): Removed. + (get_computation_at): Use get_computation_aff. Unshare the result. + (get_computation_aff, multiplier_allowed_in_address_p): New function. + (multiply_by_cost): Exported. + (get_address_cost): Use multiplier_allowed_in_address_p. + * tree-ssa-operands.c (get_tmr_operands): New function. + (get_expr_operands): Handle TARGET_MEM_REFs. + * tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs. + (build): Handle 7 arguments. + (build7_stat): New function. + * tree.def (TARGET_MEM_DEF): New. + * tree.h (REF_ORIGINAL): Removed. + (TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL, + TMR_TAG, build7): New macros. + (build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare. + * tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr. + * doc/c-tree.texi: Document TARGET_MEM_REF. + * doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar. + +2005-06-07 Jakub Jelinek + + PR debug/21946 + * dwarf2out.c (add_loc_descr_op_piece): New function. + (multiple_reg_loc_descriptor, concat_loc_descriptor, + loc_descriptor): Use it. + * var-tracking.c: Include regs.h and expr.h. + (emit_note_insn_var_location): Skip over pieces where offset + is smaller than previous offset plus previous piece mode size. + Optimize adjacent hard registers or memory locations. + * Makefile.in (var-tracking.o): Depend on $(REGS_H) and $(EXPR_H). + +2005-06-07 Richard Guenther + + * c-typeck.c (c_finish_if_stmt): Use void_type_node as type + for COND_EXPR. + * gimplify.c (gimplify_cond_expr): No need to fix up the + type of COND_EXPRs. + +2005-06-07 Richard Guenther + + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Fix + comments. + +2005-06-07 Geoffrey Keating + + * config/rs6000/host-darwin.c (segv_handler): Widen the possible + 'stwux' instructions that are considered to be stack decrements. + + * rtlanal.c (subreg_offset_representable_p): Handle objects + with holes. + +2005-06-06 Uros Bizjak + + * mode-switching.c (optimize_mode_switching): Fix n_exprs parameter + in call to pre_edge_lcm. + +2005-06-06 Kaz Kojima + + * config/sh/linux-unwind.h (SH_DWARF_FRAME_XD0): Remove for SH5. + (SH_DWARF_FRAME_PR, SH_DWARF_FRAME_GBR, SH_DWARF_FRAME_MACL) + (SH_DWARF_FRAME_MACH, SH_DWARF_FRAME_PC, SH_DWARF_FRAME_FPUL): + Likewise. + (SH_DWARF_FRAME_FP0, SH_DWARF_FRAME_FPSCR): Define to the correct + dwarf register number for SHmedia. + (shmedia_fallback_frame_state): New. + (MD_FALLBACK_FRAME_STATE_FOR): Define to it for SH5. + + * config/sh/linux.h (FUNCTION_PROFILER): Provide SHMEDIA version. + +2005-06-06 Gabriel Dos Reis + + * c-lex.c (lex_string): Use XOBFINISH. + * collect2.c (extract_string, dump_file): Likewise. + * dbxout.c (dbxout_finish_complex_stabs): Likewise. + * gcc.c (init_spec, build_search_list, convert_filename, + set_collect_gcc_options, do_spec_2, do_spec_1, main): Likewise. + * genpreds.c (write_predicate_subfunction): Likewise. + * genflags.c (main): Likewise. + * read-rtl.c (mode_attr_index, apply_macro_to_string, + join_c_conditions, read_quoted_string, read_braced_string, + read_rtx_1): Likewise. + * stringpool.c (ggc_alloc_string): Likewise. + * tlink.c (obstack_fgets, recompile_files): Likewise. + +2005-06-06 Jakub Jelinek + + * intl.h (G_): New macro. + * rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid + instead of msgid for argument name. + * tree-ssa.c (warn_uninit): Likewise. + * c-parser.c (c_parser_error): Likewise. + * config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise. + * config/darwin-c.c (BAD): Likewise. + * config/c4x/c4x-c.c (BAD): Likewise. + * c-pragma.c (GCC_BAD, GCC_BAD2): Likewise. + * c-errors.c (pedwarn_c99, pedwarn_c90): Likewise. + * c-common.c (c_parse_error): Likewise. + * diagnostic.c (diagnostic_set_info, verbatim, inform, warning, + warning0, pedwarn, error, sorry, fatal_error, internal_error): + Likewise. + (fnotice): Use cmsgid instead of msgid for argument name. + * gcov.c (fnotice): Likewise. + * protoize.c (notice): Likewise. + * final.c (output_operand_lossage): Likewise. + * gcc.c (fatal, notice): Likewise. + (error): Use gmsgid instead of msgid for argument name. + * collect2.c (notice, fatal_perror, fatal): Use cmsgid instead + of msgid for argument name. + (error): Use gmsgid instead of msgid for argument name. + * c-decl.c (locate_old_decl, implicit_decl_warning): Use G_() + instead of N_(). + * c-typeck.c (readonly_error, convert_for_assignment): Likewise. + * tree-inline.c (inline_forbidden_p_1): Likewise. + * ABOUT-GCC-NLS: Require gettext 0.14.5 or later. Mention the new + conventions for marking translations. + * doc/install.texi: Mention gettext 0.14.5 or later requirement. + + * tree-chrec.c (reset_evolution_in_loop): Use build3 instead of + build2. + + * fold-const.c (operand_equal_p): Don't return 1, if element + chains for 2 VECTOR_CSTs are not the same length. + + PR regression/21897 + * fold-const.c (fold_ternary) : Don't crash if + not all VECTOR_CST elements are given. + + * combine.c (try_combine): Use hard_regno_nregs array instead of + HARD_REGNO_NREGS macro. + * config/rs6000/rs6000.c (rs6000_split_multireg_move, + rs6000_register_move_cost, rs6000_memory_move_cost): Likewise. + * config/ia64/ia64.c (mark_reg_gr_used_mask): Likewise. + +2005-06-06 Daniel Berlin + + * tree-ssa-reassoc.o: New. + (OBJS-common): Add tree-ssa-reassoc.o + * timevar.def: Add TV_TREE_REASSOC + * tree-optimize.c (pass_reassoc): Add call. + * tree-pass.h (pass_reassoc): Add. + * tree-ssa-reassoc.c: New file. + +2005-06-06 Eric Christopher + + target/21927 + * expr.c (do_store_flag): Remove check for non-negative BRANCH_COST. + +2005-06-06 Rainer Orth + + * config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Guard with + HAVE_GAS_MAX_SKIP_P2ALIGN. + (HAVE_AS_DWARF2_DEBUG_LINE): Remove. + +2005-06-06 Rainer Orth + + * Makefile.in (mips-tfile.o): Add $(srcdir)/../include prefix to + getopt.h dependency. + (mips-tdump.o): Likewise. + +2005-06-06 Jan Hubicka + + * predict.c (tree_predict_edge): Don't drop useless predictions; + check that it is not called too late in the game. + (gate_estimate_probability): New gate. + (pass_profile): Gate. + * tree-mudflap.c (mf_build_check_statement_for): Do not drop + predictions; update CFG instead. + * cfgrtl.c (rtl_verify_flow_info): Check that predcitions are consumed. + +2005-06-06 Jie Zhang + + * config.gcc (bfin*-uclinux*): New. + * config/bfin/uclinux.h: New file. + +2005-06-06 Ben Elliston + + * doc/md.texi (Insn Splitting): Fix some wording. + +2005-06-05 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_emit_swdivsf): New function. + (rs6000_emit_swdivdf): New function. + * config/rs6000/rs6000.md (fres): New pattern. + (divsf3): Add approximation through rs6000_emit_swdivsf. + (fred): New pattern. + (divdf3): Add approximation through rs6000_emit_swdivdf. + * config/rs6000/rs6000-protos.h (rs6000_emit_swdivsf): Declare. + (rs6000_emit_swdivdf): Declare. + * config/rs6000/rs6000.opt (mswdiv): New option. + * doc/invoke.texi (RS/6000 and PowerPC Options): Document mswdiv. + +2005-06-05 Zdenek Dvorak + + PR tree-optimization/21846 + * tree-cfg.c (replace_uses_by): Update information stored at loops. + * tree-flow.h (substitute_in_loop_info): Declare. + * tree-scalar-evolution.c (initialize_scalar_evolutions_analyzer): + Ensure that chrec_dont_know and chrec_known have a type. + * tree-ssa-loop-niter.c (substitute_in_loop_info): New function. + +2005-06-05 Steven Bosscher + + * config/i386/i386.c (x86_use_loop): Remove. + * config/i386/i386.h (x86_use_loop): Remove extern decl. + (TARGET_USE_LOOP): Remove. + * config/i386/i386.md (doloop_end, doloop_end_internal): Remove. + Also remove related define_splits. + +2005-06-05 Dorit Nuzman + + * tree-flow.h (stmt_ann_d): Move aux to ... + (tree_ann_common_d): ... here. + * tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt, + move_computations_stmt, schedule_sm): Update references to + aux. + * tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Likewise. + * tree-vect-transform.c (vect_create_index_for_vector_ref): Update + call to set_stmt_info. + (vect_transform_loop): Likewise. + * tree-vectorizer.c (new_loop_vec_info, destroy_loop_vec_info): + Likewise. + + * tree-vect-analyze.c (vect_analyze_scalar_cycles): Made void instead of + bool. + (vect_mark_relevant): Takes two additional arguments - live_p and + relevant_p. Set RELEVANT_P and LIVE_P according to these arguments. + (vect_stmt_relevant_p): Differentiate between a live stmt and a + relevant stmt. Return two values = live_p and relevant_p. + (vect_mark_stmts_to_be_vectorized): Call vect_mark_relevant and + vect_stmt_relevant_p with additional arguments. Phis are no longer + put into the worklist (analyzed seperately in analyze_scalar_cycles). + (vect_determine_vectorization_factor): Also check for LIVE_P, because a + stmt that is marked as irrelevant and live, cause it's only used out + side the loop, may need to be vectorized (e.g. reduction). + (vect_analyze_operations): Examine phis. Call + vectorizable_live_operation for for LIVE_P stmts. Check if + need_to_vectorize. + (vect_analyze_scalar_cycles): Update documentation. Don't fail + vectorization - just classify the scalar cycles created by the loop + phis. Call vect_is_simple_reduction. + (vect_analyze_loop): Call to analyze_scalar_cycles moved earlier. + * tree-vect-transform.c (vect_create_index_for_vector_ref): Update + call to set_stmt_info. + (vect_get_vec_def_for_operand): Code reorganized - the code that + classifies the type of use was factored out to vect_is_simple_use. + (vectorizable_store, vect_is_simple_cond): Call vect_is_simple_use with + additional arguments. + (vectorizable_assignment): Likewise. Also make sure the stmt is relevant + and computes a loop_vec_def. + (vectorizable_operation, vectorizable_load, vectorizable_condition): + Likewise. + (vectorizable_live_operation): New. + (vect_transform_stmt): Handle LIVE_P stmts. + * tree-vectorizer.c (new_stmt_vec_info): Initialize the new fields + STMT_VINFO_LIVE_P and STMT_VINFO_DEF_TYPE. + (new_loop_vec_info, destroy_loop_vec_info): Also handle phis. + (vect_is_simple_use): Determine the type of the def and return it + in a new function argument. Consider vect_reduction_def and + vect_induction_def, but for now these are not supported. + (vect_is_simple_reduction): New. Empty for now. + * tree-vectorizer.h (vect_def_type): New enum type. + (_stmt_vec_info): Added new fields - live and _stmt_vec_info. + (STMT_VINFO_LIVE_P, STMT_VINFO_DEF_TYPE): New accessor macros. + (vect_is_simple_use): New arguments added to function declaration. + (vect_is_simple_reduction): New function declaration. + (vectorizable_live_operation): New function declaration. + + * tree-vect-analyze.c (vect_can_advance_ivs_p): Add debug printout. + (vect_can_advance_ivs_p): Likewise. + * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Likewise. + +2005-06-05 Eric Christopher + + * config/mips/mips.c (mips_rtx_costs): Remove unused variable. + +2005-06-05 Hans-Peter Nilsson + + PR target/21914 + * config/mmix/mmix.md ("*movdicc_real_foldable") + ("*movdfcc_real_foldable", "*bCC_foldable") + ("*bCC_inverted_foldable"): Specify DImode for register being + compared. + +2005-06-04 Roger Sayle + + * reg-stack.c (struct block_info_def): Correct grammar typo. + (compensate_edge): Clean-up. Perform as little work as possible + when src and dest stacks match. Avoid modifying block_info. + Reorder and simplify assertion checks. Avoid unnecessary copying + of regstack structure. + (convert_regs_1): Set the done flag here... + (convert_regs_2): ... instead of here. + +2005-06-04 Dale Johannesen + + * config/rs6000/rs6000.c (no_global_regs_above): New. + (rs6000_emit_prologue): Use it; cosmetic formatting fixes. + (rs6000_emit_epilogue): Use it; cosmetic formatting fixes. + (rs6000_conditional_register_usage): Don't put Darwin PIC + register in global_regs. + (rs6000_stack_info): Don't set lr_save_p just because Darwin + PIC reg used. + (rs6000_emit_prologue): Save LR in R0 around Darwin PIC setup, + if not done by lr_save_p. + * config/rs6000/rs6000.md (insnv1_internal1): Back out 05-18 patch. + Use rotate instead of ashift. + (call_indirect_nonlocal_sysv): Prefer CTR to LR. + (call_value_indirect_nonlocal_sysv): Ditto. + +2005-06-04 Jan Hubicka + + * cgraphunit.c (cgraph_reset_node): Break out from ... + (cgraph_finalize_function): ... here. + (cgraph_finalize_compilation_unit): Reset nodes where backend + removed the body. + +2005-06-04 Richard Henderson + + PR target/21888 + * config/alpha/alpha.c (alpha_align_insns): Don't insert nops + until we've passed initial ldgp. + +2005-06-04 Daniel Berlin + + * cfgexpand.c (expand_one_var): Use DECL_HAS_VALUE_EXPR_P. + * dwarf2out.c (loc_descriptor_from_tree_1): Ditto. + * expr.c (expand_var): Ditto. + * function.c (gimplify_parameters): Use SET_DECL_VALUE_EXPR too. + * gimplify.c (gimplify_decl_expr): Ditto. + (gimplify_expr): Ditto. + * tree-mudflap.c (mf_decl_eligible_p): Use DECL_HAS_VALUE_EXPR_P. + * tree.c (value_expr_for_decl): New. + (print_value_expr_statistics): New. + (init_ttree): Init value_expr_for_decl. + (decl_value_expr_lookup): New. + (decl_value_expr_insert): Ditto. + (copy_node_stat): Copy DECL_VALUE_EXPR status. + * tree.h (DECL_VALUE_EXPR): Use hashtable. + (SET_DECL_VALUE_EXPR): New. + (DECL_HAS_VALUE_EXPR_P): New. + +2005-06-04 Steven Bosscher + + * lcm.c: Move all mode-switching related functions from here... + * mode-switching.c: ...to this new file. + * doc/passes.texi: Update accordingly. + + * basic-block.h (label_value_list): Remove extern decl. + * cfgrtl.c (label_value_list): Remove. + (can_delete_label_p): Don't look at it. + * cfgcleanup.c (cleanup_cfg): Don't free it. + + * common.opt: Don't refer to non-existing flag_alias_check. + +2005-06-04 David Edelsohn + + * config/rs6000/aix52.h (ASM_CPU_SPEC): Add power5. + +2005-06-04 Kazu Hirata + + * function.c (prologue, epilogue, sibcall_epilogue): Change + their types to VEC(int,heap)*. + (free_after_compilation): Free the three vectors above. + (init_function_for_compilation, record_insns, contains, + prologue_epilogue_contains, sibcall_epilogue_contains, + reposition_prologue_and_epilogue_notes): Use VEC instead of + VARRAY. (init_function_once): Remove. + * function.h: Remove the prototype for init_function_once. + * toplev.c (backend_init): Don't call init_function_once. + +2005-06-04 Jan Hubicka + + * predict.c (tree_predict_edge): Do not predict entry edge and + single succestor edge. + +2005-06-04 Joseph S. Myers + + PR c/21873 + * c-typeck.c (push_init_level): Don't pop levels without braces if + implicit == 1. + +2005-06-03 Sebastian Pop + + * tree-data-ref.c (compute_self_dependence): New function. + (compute_all_dependences): Use it. + +2005-06-03 Geoffrey Keating + + * c-parser.c (c_parser_parms_declarator): Don't use chainon(). + (c_parser_expr_list): Don't use chainon(). + + * config/darwin.h (LINK_SPEC): Pass -syslibroot to linker + when -isysroot passed. + +2005-06-03 Joseph S. Myers + + PR c/21879 + * c-decl.c (start_function): Restore label_context_stack_se and + label_context_stack_vm if returning with an error. + +2005-06-03 Gabriel Dos Reis + + * configure.ac: Check declaration for asprintf, needed by + libiberty.h. + * configure: Regenerate. + * config.in: Likewise. + +2005-06-03 Diego Novillo + + * tree-ssa-dom.c (record_edge_info): Use last_basic_block to + allocate info array. + * tree-vrp.c (extract_range_from_unary_expr): Set resulting + range to varying in cast expressions that change + TYPE_PRECISION. + +2005-06-03 Eric Christopher + + * config/mips/mips.opt: Add RejectNegative to divide-breaks and + divide-traps. + +2005-06-03 Jan Hubicka + + * basic-block.h (remove_predictions_associated_with_edge): Declare. + * cfg.c (remove_edge): Use it. + * predict.c (remove_predictions_associated_with_edge): New function. + +2005-06-03 Pat Haugen + + * config/rs6000/rs6000.c (rs6000_conditional_register_usage): + Clear call_realy_used_regs[r2] when ABI_AIX. + +2005-06-03 Richard Guenther + + PR middle-end/21858 + * fold-const.c (fold_binary): Fix type mismatches in folding + of comparisons. + +2005-06-03 Kazu Hirata + + * cgraph.c, cgraphunit.c, config/mips/mips.c: Fix comment + typos. + +2005-06-03 Joseph S. Myers + + * collect2.c (maybe_unlink): Use unlink_if_ordinary. + +2005-06-02 Bernd Schmidt + + * reload1.c (reload): Revert my previous patch. + +2005-06-03 Nick Clifton + + * config/arm/semi.h (ASM_SPEC): Fix typo passing -mfloat-abi to + assembler. + +2005-06-03 Kazu Hirata + + PR tree-optimization/21849 + * tree-ssa-copy.c (dump_copy_of): Call sbitmap_zero. + +2005-06-02 Richard Henderson + + * Makefile.in (tree-vect-generic.o): New. + (OBJS-common, GTFILES, s-gtype): Add it. + * tree-complex.c (build_replicated_const, vector_inner_type, + vector_last_type, vector_last_nunits, build_word_mode_vector_type, + elem_op_func, tree_vec_extract, do_unop, do_binop, do_plus_minus, + do_negate, expand_vector_piecewise, expand_vector_parallel, + expand_vector_addition, expand_vector_operation, + type_for_widest_vector_mode, expand_vector_operations_1, + gate_expand_vector_operations, expand_vector_operations, + pass_lower_vector_ssa): Move to tree-vect-generic.c. + (tree_lower_complex): Rename from tree_lower_operations. + (pass_lower_complex): Rename from pass_pre_expand. + * tree-vect-generic.c: New file. + * tree-pass.h (pass_lower_complex): Rename from pass_pre_expand. + (pass_lower_vector): New. + * tree-optimize.c (init_tree_optimization_passes): Update to match. + +2005-06-02 Richard Henderson + + * modulo-sched.c (doloop_register_get): Protect against + doloop_end not defined. + +2005-06-02 Kazu Hirata + + * config/sh/sh.c (general_movsrc_operand, + general_movdst_operand, arith_reg_operand, arith_reg_dest, + logical_reg_operand, int_gpr_dest, fp_arith_reg_operand, + fp_arith_reg_dest, arith_operand, arith_reg_or_0_operand, + xor_operand, cmp_operand, logical_operand, and_operand, + fpscr_operand, fpul_operand, symbol_ref_operand, + commutative_float_operator, noncommutative_float_operator, + unary_float_operator, binary_float_operator, + binary_logical_operator, equality_comparison_operator, + greater_comparison_operator, less_comparison_operator, + shift_operator, logical_operator, target_reg_operand, + target_operand, mextr_bit_offset, extend_reg_operand, + trunc_hi_operand, extend_reg_or_0_operand, minuend_operand, + general_extend_operand, ua_address_operand, + cache_address_operand, inqhi_operand, sh_rep_vec, sh_1el_vec, + sh_const_vec, ua_offset, sh_register_operand, cmpsi_operand, + shift_count_reg_operand, shift_count_operand, + unaligned_load_operand): Move to ... + * config/sh/predicates.md: ... here. + * config/sh/sh.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): + Remove. + +2005-06-02 Andrew Pinski + + * tree.c (build_common_builtin_nodes): Fix the return type on + __builtin_memcmp. + +2005-06-02 Richard Guenther + + * tree-ssa-loop-ivopts.c (build_addr_strip_iref): Remove. + (find_interesting_uses_address): Use build_fold_addr_expr instead. + (strip_offset_1): Likewise. + (tree_to_aff_combination): Likewise. + +2005-06-02 DJ Delorie + + * convert.c (convert_to_pointer): Avoid recursion if no conversion + is needed. + +2005-06-02 Richard Guenther + + * tree-chrec.c (chrec_fold_plus_1): Ensure we build + binary operations with the correct types. + * tree-ssa-loo-ivopts.c (idx_find_step): Use sizetype + for all computation. + +2005-06-02 Kazu Hirata + + * tree-vrp.c, config/arm/arm.md, config/arm/arm1020e.md, + config/rs6000/rs6000.md: Fix comment typos. Follow splling + conventions. + * doc/install.texi: Fix a typo. + +2005-06-02 Jan Hubicka + + * cgraphunit.c (cgraph_function_and_variable_visibility): Extern + inline functions are not local. + +2005-06-02 Kazu Hirata + + * gimplify.c (gimplify_ctx): Change the type of case_labels to + VEC from VARRAY. + (gimplify_switch_expr, gimplify_case_label_expr): Adjust uses + of case_labels. + +2005-06-02 Richard Guenther + + * c-typeck.c (build_indirect_ref): Build INDIRECT_REF + with correct type. + +2005-06-02 Ulrich Weigand + + * config/s390/s390.c (s390_add_execute): Do not handle out-of-pool + execute templates. + (s390_dump_pool): Likewise. + (s390_mainpool_start, s390_mainpool_finish): Likewise. + (s390_chunkify_start): Likewise. + (s390_dump_execute): Remove. + (s390_reorg): Handle out-of-pool execute templates. + +2005-06-02 Adrian Straetling + + * optabs.c: (expand_bool_compare_and_swap): Emit barrier after + unconditional jump. + +2005-06-02 Jan Hubicka + + * cgraph.c (cgraph_node): Maintain master clones. + (cgraph_remove_node): Likewise. + (availability_names): New static variable. + (dump_cgraph_node): Dump availability. + (dump_cgraph_varpool_node): Likewise. + (cgraph_is_master_clone, cgraph_master_clone, + cgraph_function_body_availability, + cgraph_variable_initializer_availability): New functions. + * cgraph.h (availability): New enum. + (struct cgraph_node): Add master_clone. + (cgraph_is_master_clone, cgraph_master_clone, + cgraph_function_body_availability, + cgraph_variable_initializer_availability): Declare. + * cgraphunit.c (cgraph_expand_function): Setcgraph_function_flags_ready. + (cgraph_remove_unreachable_nodes): Remove unreachable nodes. + * ipa-inline.c (cgraph_decide_inlining): Do not call + cgraph_remove_unreachable_nodes. + + * cgraphunit.c (cgraph_function_and_variable_visibility): Fix typo in + previous patch. + +2005-06-02 Diego Novillo + + PR 21582 + * tree-vrp.c (nonnull_arg_p): New. + (get_value_range): Call it. + +2005-06-02 Eric Christopher + + * config/mips/mips.h (processor_type): Remove PROCESSOR_DEFAULT, + add PROCESSOR_MAX. + (mips_rtx_cost_data): New datatype. + (MEMORY_MOVE_COST): Use data from structure. + (BRANCH_COST): Ditto. + (LOGICAL_OP_NON_SHORT_CIRCUIT): Define to zero. + * config/mips/mips.md (cpu): Rework for processor_type changes. + * config/mips/mips.c (mips_cost): New variable. + (DEFAULT_COSTS): Define. + (mips_rtx_cost_data): New. + (mips_rtx_costs): Use. Minor formatting changes. Use COSTS_N_INSNS + for NEG cost. Add support for FLOAT, UNSIGNED_FLOAT, FIX, + FLOAT_EXTEND, FLOAT_TRUNCATE, and SQRT. + (override_options): Set cost data. + (mips_register_move_cost): Formatting changes. + (bdesc_arrays): Use PROCESSOR_MAX. + (mips_init_builtins): Ditto. + +2005-06-02 Diego Novillo + + PR 21765 + * doc/invoke.texi: Document -ftree-vrp. + +2005-06-02 Dorit Nuzman + + PR tree-optimization/21734 + * tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop): Use the + phi_result when current_def is not available. + (slpeel_update_phi_nodes_for_guard1): Don't fail if current_def is not + available. + +2005-06-02 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_insn_valid_within_doloop): New. + (TARGET_INSN_VALID_WITHIN_DOLOOP): Define. + +2005-06-02 Diego Novillo + + * tree-vrp.c (has_assert_expr, maybe_add_assert_expr): Remove. + +2005-06-02 Jan Hubicka + + * cgraph.c (dump_cgraph_node): Print new flags. + (dump_cgraph_varpool_node): Likewise. + (decide_variable_is_needed): Initialize externally_visible flag. + * cgraph.h (cgraph_local_info): Add externally_visible flag. + (cgraph_varpool_node): Likewise. + (cgraph_function_flags_ready): Declare. + * cgraph.c (cgraph_mark_local_functions): Rename to ... + (cgraph_function_and_variable_visibility) ... this one; handle + externally_visible flags. + (decide_is_function_needed): Set externally_visible flag. + (cgraph_finalize_function): Deal properly with early cleanups. + (cgraph_optimize): Update call of + cgraph_function_and_variable_visibility. + +2005-06-02 Steven Bosscher + Mostafa Hagog + + * cfgloop.h (doloop_condition_get): Make external. + * loop-doloop.c (doloop_condition_get): Generalize to make it + usable in modulo-sched.c. + * modulo-sched.c (doloop_register_get): Use + doloop_condition_get instead of duplicating it. + +2005-06-02 Bernd Schmidt + + * reload1.c (reload): Undo 2005-04-20 change. Make sure we detect + the correct set of init_insns that need deletion. + * local-alloc.c (update_equiv_regs): When substituting sole definition + into sole use of a reg, delete it from liveness information. + +2005-06-02 Kaz Kojima + + * config/sh/sh.h (TARGET_FPU_DOUBLE): Use MASK_SH4. + +2005-06-01 Diego Novillo + + PR 14341, PR 21332, PR 20701, PR 21029, PR 21086, PR 21090 + PR 21289, PR 21348, PR 21367, PR 21368, PR 21458. + * fold-const.c (invert_tree_comparison): Make extern. + * tree-flow.h (enum value_range_type): Move to tree-ssa-propagate. + (struct value_range_def): Limewise. + (get_value_range): Remove. + (dump_value_range): Remove. + (dump_all_value_ranges): Remove. + (debug_all_value_ranges): Remove. + (vrp_evaluate_conditional): Declare. + * tree-ssa-propagate.c (struct prop_stats_d): Add field + num_pred_folded. + (substitute_and_fold): Add argument use_ranges_p. + Update all callers. + If use_ranges_p is true, call fold_predicate_in to fold + predicates using range information. + Ignore ASSERT_EXPRs. + Change debugging output to only show statements that have been + folded. + (replace_phi_args_in): Move debugging output code from + substitute and fold. + (fold_predicate_in): New local function. + * tree-ssa-propagate.h (enum value_range_type): Move from + tree-flow.h. + (struct value_range_d): Likewise. + Add field 'equiv'. + (value_range_t): Rename from value_range. + * tree-vrp.c (found_in_subgraph): Rename from found. + (get_opposite_operand): Remove. + (struct assert_locus_d): Declare. + (assert_locus_t): Declare. + (need_assert_for): Declare. + (asserts_for): Declare. + (blocks_visited): Declare. + (vr_value): Declare. + (set_value_range): Add argument 'equiv'. + Don't drop to VARYING ranges that cover all values in the + type. + Make deep copy of equivalence set 'equiv'. + (copy_value_range): New local function. + (set_value_range_to_undefined): New local function. + (compare_values): Return -2 if either value has overflowed. + (range_includes_zero_p): New local function. + (extract_range_from_assert): Flip the predicate code if the + name being asserted is on the RHS of the predicate. + Avoid creating unnecessary symbolic ranges if the comparison + includes another name with a known numeric range. + Update the equivalnce set of the new range when asserting + EQ_EXPR predicates. + (extract_range_from_ssa_name): Update the equivalence set of + the new range with VAR. + (extract_range_from_binary_expr): Also handle TRUTH_*_EXPR. + If -fwrapv is used, set the resulting range to VARYING if the + operation overflows. Otherwise, use TYPE_MIN_VALUE and + TYPE_MAX_VALUE to represent -INF and +INF. + Fix handling of *_DIV_EXPR. + (extract_range_from_unary_expr): Handle MINUS_EXPR and + ABS_EXPR properly by switching the range around if necessary. + (extract_range_from_comparison): New local function. + (extract_range_from_expr): Call it. + (adjust_range_with_scev): Do not adjust the range if using + wrapping arithmetic (-fwrapv). + (dump_value_range): Also show equivalence set. + Show -INF and +INF for TYPE_MIN_VALUE and TYPE_MAX_VALUE. + (build_assert_expr_for): Also build ASSERT_EXPR for EQ_EXPR. + (infer_value_range): Change return value to bool. + Add arguments 'comp_code_p' and 'val_p'. + Do not attempt to infer ranges from statements that may throw. + Store the comparison code in comp_code_p. + Store the other operand to be used in the predicate in val_p. + (dump_asserts_for): New. + (debug_asserts_for): New. + (dump_all_asserts): New. + (debug_all_asserts): New. + (register_new_assert_for): New. + (register_edge_assert_for): New. + (find_conditional_asserts): New. + (find_assert_locations): New. + (process_assert_insertions_for): New. + (process_assert_insertions): New. + (insert_range_assertions): Initialize found_in_subgraph, + blocks_visited, need_assert_for and asserts_for. + Call find_assert_locations and process_assert_insertions. + (remove_range_assertions): Add more documentation. + (vrp_initialize): Change return type to void. + Do not try to guess if running VRP is worth it. + (compare_name_with_value): New. + (compare_names): New. + (vrp_evaluate_conditional): Add argument 'use_equiv_p'. If + use_equiv_p is true, call compare_names and + compare_name_with_value to compare all the ranges for every + name in the equivalence set of the predicate operands. + Update all callers. + (vrp_meet): Try harder not to derive a VARYING range. + If two values meet, the resulting equivalence set is the + intersection of the two equivalence sets. + (vrp_visit_phi_node): Call copy_value_range to get the current + range information of the LHS. + (vrp_finalize): Create a value vector representing all the + names that ended up with exactly one value in their range. + Call substitute_and_fold. + (execute_vrp): Document equivalence sets in ranges. + * tree.h (SSA_NAME_VALUE_RANGE): Remove. + (struct tree_ssa_name): Remove field value_range. + (invert_tree_comparison): Declare. + +2005-06-01 Daniel Berlin + + Fix PR tree-optimization/21839 + + * gimplify.c (zero_sized_field_decl): New function. + (gimplify_init_ctor_eval): Use it. + +2005-06-01 Josh Conner + + PR 21478 + * gimplify.c (gimplify_init_constructor): Don't spill initializer + to read-only memory if it's sparse. + +2005-06-01 Ramana Radhakrishnan + + * doc/rtl.texi: Remove references to NOTE_INSN_SETJMP. + Add documentation for REG_SETJMP + +2005-06-01 Richard Guenther + + * stmt.c (expand_case): Use build_int_cst. + (node_has_low_bound): Likewise, and correct type mismatch. + (node_has_high_bound): Likewise. + * fold-const.c (fold_binary): Ensure we build trees + with the correct types - undo what STRIP_NOPS possibly did. + +2005-06-01 Richard Guenther + + * tree.h (fold_indirect_ref_1): Export from fold-const.c. + * fold-const.c (fold_indirect_ref_1): No longer static. + * tree-inline.c (copy_body_r): Use fold_indirect_ref_1 for + folding, if possible. + +2005-06-01 Joseph S. Myers + + * common.opt (fjump-tables): New. + * doc/invoke.texi (-fno-jump-tables): Document. + * stmt.c (expand_end_case_type): Do not emit jump tables unless + flag_jump_tables. + +2005-06-01 Richard Earnshaw + + * arm.md (bunordered, bordered, bungt, bunlt, bunge, bunle, buneq) + (bltgt, arm_buneq, arm_bltgt, sunordered, sordered, sungt, sunge) + (sunlt, sunle): Enable patterns on VFP. + + * arm.md (attribute 'type'): Add new types - f_loads floadd, f_stores, + f_stored, f_flag, f_cvt. + (generic_sched): No-longer used for the arm1020e and arm1022e cores. + Include arm1020e.md. + * vfp.md (fmstat): New cpu unit. Add an exclusion set between it and + the ds and fmac pipelines. Re-work all load and store patterns and + all conversion patterns to use new attributes. Adjust reservation + descriptions accordingly. + * arm1020e.md: New file. + * t-arm: Add dependency. + +2005-06-01 Jan Hubicka + + * except.c (struct eh_region): Kill unused fields. + * basic-block.h (struct basic_block_def): Likewise. + +2005-06-01 J"orn Rennecke + + PR rtl-optimization/21767 + * rtl.h (function_invariant_p): Re-add declaration. + * reload1.c (function_invariant_p): No longer static. + * ifcvt.c (dead_or_predicable): Remove REG_EQUAL notes that + might have become invalid. + +2005-06-01 Jakub Jelinek + + PR c/21536 + PR c/20760 + * gimplify.c (gimplify_decl_expr): Call gimplify_type_sizes + on variable sizes types if a decl is a pointer to a VLA. + (gimplify_type_sizes): Handle POINTER_TYPE and REFERENCE_TYPE. + Call gimplify_type_sizes on aggregate fields. Prevent infinite + recursion. + + * fold-const.c (fold_ternary): Optimize BIT_FIELD_REF of VECTOR_CST. + + * config/i386/xmmintrin.h (_mm_setzero_ps, _mm_set_ss, _mm_set1_ps, + _mm_set_ps, _mm_setr_ps): Add __extension__. + * config/i386/emmintrin.h (_mm_set_sd, _mm_set1_pd, _mm_set_pd, + _mm_setr_pd, _mm_setzero_pd, _mm_set_epi64x, _mm_set_epi64x, + _mm_set_epi32, _mm_set_epi16, _mm_set_epi8, _mm_setzero_si128): + Likewise. + (_mm_clflush): Don't use return in void function. + + * config/i386/emmintrin.h (_mm_castpd_ps, _mm_castpd_si128, + _mm_castps_pd, _mm_castps_si128, _mm_castsi128_ps, _mm_castsi128_pd): + Use __inline instead of inline. + +2005-06-01 Richard Guenther + + * fold-const.c (fold_binary): Fix types in strlen vs. + zero comparison folding. + +2005-06-01 Richard Henderson + + * configure.ac (HAVE_AS_JSRDIRECT_RELOCS): New. + * config.in, configure: Rebuild. + * config/alpha/alpha.c (print_operand): Add 'j'. + * alpha.md (divmodsi_internal_er_1): Use it. + (divmoddi_internal_er_1): Likewise. + +2005-06-01 Richard Sandiford + + * system.h (TARGET_OPTIONS, TARGET_SWITCHES): Poison. + * opts.h (print_filtered_help): Delete. + * opts.c (handle_option, decode_options): Remove calls to + set_target_switch. + (print_target_help): New function. + (common_option, print_help): Call print_target_help instead of + display_target_options. + (print_filtered_help): Make static. + * toplev.h (display_target_options, set_target_switch): Delete. + * toplev.c (target_switches, target_options, display_target_options) + (set_target_switch): Delete. + (print_switch_values): Remove handling of TARGET_SWITCHES and + TARGET_OPTIONS. + (default_get_pch_validity): Likewise. Only treat target_flags + specially if targetm.check_pch_target_flags is nonnull. + (pch_option_mismatch): New function. + (default_pch_valid_p): Use it. Remove handling of TARGET_SWITCHES + and TARGET_OPTIONS. Only treat target_flags specially if + targetm.check_pch_target_flags is nonnull. + * config/ia64/ia64.c (ia64_override_options): Don't mention + TARGET_OPTIONS in comment. + * config/m68k/m68k-none.h (CC1_SPEC): Likewise. + * doc/invoke.texi: Remove a reference to TARGET_SWITCHES. + * doc/tm.texi (TARGET_DEFAULT_TARGET_FLAGS): Don't mention the + interaction with TARGET_SWITCHES. + (TARGET_@var{featurename}, TARGET_SWITCHES, TARGET_OPTIONS): Delete. + +2005-06-01 Richard Sandiford + + * config/sh/sh.c (multcosts): Check sh_multcost rather than + sh_multcost_str. + (sh_register_move_cost): Likewise sh_gettrcost and sh_gettrcost_str. + (sh_multcost_str, sh_gettrcost_str, sh_div_str, sh_divsi3_libfunc) + (cut2_workaround_str): Delete. + * config/sh/sh.h (SUBTARGET_OPTIONS, TARGET_OPTIONS) + (TARGET_SH5_CUT2_WORKAROUND, sh_multcost_str, sh_gettrcost_str) + (sh_div_str, sh_divsi3_libfunc, cut2_workaround_str): Delete. + * config/sh/sh.opt (mcut2-workaround, mdiv=, mdivsi3_libfunc=) + (mgettrcost=, multcost=): New options. + +2005-06-01 Richard Sandiford + + * opts.h (cl_option_state): New structure. + (get_option_state): Declare. + * opts.c (get_option_state): New function. + * toplev.c (option_affects_pch_p): New function. + (default_get_pch_validity): Store the state of all options for which + option_affects_pch_p returns true. + (default_pch_valid_p): Check the state of those options here. + Only check target_flags separately if targetm.check_pch_target_Flags + is nonnull or if TARGET_SWITCHES is defined. + +2005-06-01 Richard Sandiford + + * config/mips/mips-protos.h (mips_use_ins_ext_p): Remove parameter + names. + +2005-06-01 Mostafa Hagog + + * modulo-sched.c (undo_generate_reg_moves ): Fix PR 21138. + +2005-06-01 Mostafa Hagog + + * gcse.c (compute_transp, load_killed_in_block): Use + MEM_READONLY_P. + +2005-06-01 David.Billinghurst + + PR target/21854 + * config/mips/mips-protos.h: Declare mips_use_ins_ext_p + +2005-05-31 Kaveh R. Ghazi + + * errors.h (warning, error, fatal, internal_error): Add printf + attribute. + * genmodes.c (make_vector_mode): Fix format arguments. + +2005-05-31 Kaveh R. Ghazi + + * basic-block.h, bb-reorder.c, c-gimplify.c, config/darwin.c, + config/rs6000/rs6000-c.c, dominance.c, gimple-low.c, gimplify.c, + lambda-code.c, lambda-trans.c, tree-browser.c, tree-cfg.c, + tree-chrec.c, tree-data-ref.c, tree-dfa.c, tree-eh.c, + tree-if-conv.c, tree-into-ssa.c, tree-loop-linear.c, + tree-mudflap.c, tree-nomudflap.c, tree-outof-ssa.c, + tree-pretty-print.c, tree-scalar-evolution.c, tree-sra.c, + tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, + tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-live.c, + tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c, + tree-ssa-propagate.c, tree-ssa-sink.c, tree-ssa-threadupdate.c, + tree-ssa-uncprop.c, tree-ssa.c, tree-vect-analyze.c, + tree-vect-transform.c, tree-vectorizer.c, vec.c: Don't include + errors.h and include toplev.h if necessary. + + * rtl.c, varray.c: If we're compiling as a GENERATOR_FILE, include + errors.h otherwise include toplev.h. + + * Makefile.in: Update dependencies. + +2005-06-01 Danny Smith + + * config/i386/cygming.h (NO_PROFILE_COUNTERS): Define. + +2005-05-31 Geoffrey Keating + + * config/rs6000/rs6000.md (sync_boolcshort_internal): New. + * config/rs6000/rs6000.c (rs6000_emit_sync): Shift count must + be complemented for big-endian. Mask for AND must be rotated, + not shifted. Handle short operands with NOT on the memory + operation. + +2005-05-30 Daniel Berlin + + * c-objc-common.c (c_tree_printer): Check flag before hashtable. + Use DECL_DEBUG_EXPR and SET_DECL_DEBUG_EXPR. + * dwarf2out.c (dwarf2out_var_location): Ditto. + * toplev.c (default_tree_printer): Ditto. + * tree-outof-ssa.c (create_temp): Ditto. + * tree-sra.c (instantiate_element): Ditto. + * var-tracking.c (track_expr_p): Ditto. + * tree.c (struct tree_map): New structure. + (debug_expr_for_decl): New. + (tree_map_eq): New function. + (tree_map_hash): Ditto. + (tree_map_marked_p): Ditto. + (print_debug_expr_statistics): Ditto. + (decl_debug_expr_lookup): Ditto. + (decl_debug_expr_insert): Ditto. + (dump_tree_statistics): Dump debug_expr hashtable stats. + * tree.h (DECL_DEBUG_EXPR): Change + (SET_DECL_DEBUG_EXPR): Add. + +2005-06-01 Alan Modra + + * configure.ac: Add --enable-secureplt. + (HAVE_AS_REL16): Test for R_PPC_REL16 relocs. + * config.in: Regenerate. + * configure: Regenerate. + * config.gcc (powerpc64-*-linux*, powerpc-*-linux*): Add + rs6000/secureplt.h to tm_file when enable_secureplt. + * doc/invoke.texi (msecure-plt, mbss-plt): Document. + * doc/install.texi: Document --enable-targets and --enable-secureplt. + Correct xrefs to "Using the GNU Compiler Collection (GCC)". + * config/rs6000/secureplt.h: New file. + * config/rs6000/sysv4.h (TARGET_SECURE_PLT): Define. + (SUBTARGET_OVERRIDE_OPTIONS): Error if -msecure-plt given without + assembler support. + (CC1_SECURE_PLT_DEFAULT_SPEC): Define. + (CC1_SPEC): Delete duplicate mno-sdata. Invoke cc1_secure_plt_default. + (SUBTARGET_EXTRA_SPECS): Add cc1_secure_plt_default. + * config/rs6000/sysv4.opt (msecure-plt, bss-plt): Add options. + * config/rs6000/rs6000.h (TARGET_SECURE_PLT): Define. + * config/rs6000/rs6000.c (rs6000_emit_load_toc_table): Handle + TARGET_SECURE_PLT got register load sequence. + (rs6000_emit_prologue): Call rs6000_emit_load_toc_table when + TARGET_SECURE_PLT. + (rs6000_elf_declare_function_name): Don't emit toc address offset + word when TARGET_SECURE_PLT. + * config/rs6000/rs6000.md (elf_high, elf_low): Move past load_toc_*. + (load_toc_v4_PIC_1) Enable for TARGET_SECURE_PLT. + (load_toc_v4_PIC_3b, load_toc_v4_PIC_3c): New insns. + (call, call_value): Mark pic_offset_table_rtx used for sysv pic and + TARGET_SECURE_PLT. + (call_nonlocal_sysv, call_value_nonlocal_sysv, sibcall_nonlocal_sysv, + sibcall_value_nonlocal_sysv): Add 32768 offset when TARGET_SECURE_PLT + and -fPIC. + * config/rs6000/tramp.asm (trampoline_initial): Use "bcl 20,31". + (__trampoline_setup): Likewise. Init r30 before plt call. + +2005-05-31 DJ Delorie + + * expr.c (convert_move): When a partial_int requires multiple + conversion steps, make sure successive steps convert the + intermediate value, not the original value. + + * expmed.c (expand_mult): Convert partial_int multiplies to + shift/add combinations too. + + * genmodes.c (mode_data): Add wider_2x. + (calc_wider_mode): Calculate twice-wider mode too. + (emit_mode_wider): Emit twice-wider mode too. + * machmode.h (mode_2xwider, GET_MODE_2XWIDER_MODE): New. + * expr.c (expand_expr_real_1): Use it for expanding + multiplies. + +2005-05-31 Zdenek Dvorak + + PR tree-optimization/21817 + * tree-ssa-loop-im.c (for_each_index): Handle VECTOR_CST. + +2005-05-31 Pat Haugen + + * loop.c (loop_invariant_p, valid_initial_value_p): Revert last + change. + +2005-05-31 Andrew Pinski + + PR middle-end/20931 + PR middle-end/20946 + * fold-const.c (fold_checksum_tree): Copy types also if + TYPE_CONTAINS_PLACEHOLDER_INTERNAL is set. + Don't call fold_checksum_tree for TREE_LIST's TREE_CHAIN + first. + Tail recurse TREE_LIST's TREE_CHAIN. + +2005-05-31 Andrew Pinski + + PR tree-opt/21732 + * tree-ssa-copy.c (dump_copy_of): Create a bitmap and don't visit a + SSA_NAME twice and cause the loop to become finite. Remove the test + for val. + +2005-05-31 Andrew Pinski + + * tree-cfg.c (verify_expr): Add checking for COND_EXPR's conditional + expression. + +2005-05-31 Richard Sandiford + + * doc/tm.texi (TARGET_GET_PCH_VALIDITY, TARGET_PCH_VALID_P): Tweak + the documentation to make it more future-proof. + (TARGET_CHECK_PCH_TARGET_FLAGS): Document this new hook. + * target.h (gcc_target): Add check_pch_target_flags. + * target-def.h (TARGET_CHECK_PCH_TARGET_FLAGS): New macro. + (TARGET_INITIALIZER): Include it. + * toplev.c (default_pch_valid_p): Use targetm.check_pch_target_flags. + * config/sh/sh-protos.h (sh_pch_valid_p): Delete. + * config/sh/sh.c (TARGET_PCH_VALID_P, sh_pch_valid_p): Delete. + (sh_check_pch_target_flags): New function. + (TARGET_CHECK_PCH_TARGET_FLAGS): Override default. + +2005-05-31 Richard Guenther + + * fold-const.c (extract_array_ref): Handle more cases, + do some useful canonicalization of the base. + (fold_binary): Explicitly deal with arrays of zero-sized + structures during folding of &a[i] == &a[j]. + +2005-05-31 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Update note + about Sun bug 4910101. + (sparc-sun-solaris2.7): Document bootstrap + failure with Sun WorkShop 6 99/08/18 as. + +2005-05-30 Pat Haugen + + * loop.c (loop_invariant_p, valid_initial_value_p): Use + regs_invalidated_by_call instead of call_used_regs. + +2005-05-30 Paolo Carlini + + PR middle-end/21743 + * builtins.def (BUILT_IN_CLOG, BUILT_IN_CLOGF, BUILT_IN_CLOGL): + Enable. + * doc/extend.texi: Add clog, clogf, clogl. + +2005-05-30 H.J. Lu + + PR middle-end/20303 + * c-pragma.c: Include "vec.h". + (handle_pragma_visibility): Use VEC. + + * doc/invoke.texi: Remove the nested visibility push limit. + +2005-05-30 Roger Sayle + + PR rtl-optimization/15422 + * reg-stack.c (starting_stack_p): New static global. + (straighten_stack): Delete prototype. Change to update the stack + before the current insn. + (subst_stack_regs): Update call to straighten stack. + (emit_swap_insn): Delete prototype. For the first insn in a + basic block, update stack_in instead of emitting a real swap. + (change_stack): When changing the stack before the first insn + in a basic block, update stack_in instead of emitting real code. + (compensate_edges): Clear starting_stack_p during compensation. + (convert_regs_1): Keep track of starting_stack_p whilst processing + a basic block. + +2005-05-30 Kazu Hirata + + * tree-ssa-ccp.c (const_val): Make it static. + +2005-05-29 Geoffrey Keating + + PR target/21761 + * config/rs6000/rs6000.md: Remove stray TARGET_32BIT from + pattern involving `:P'. + + * Makefile.in (install-cpp): Depend on installdirs. + +2005-05-30 Kazu Hirata + + * tree-outof-ssa.c (_elim_graph): Change the type of edge_list + to VEC(int,heap)*. + (new_elim_graph, clear_elim_graph, delete_elim_graph, + elim_graph_add_edge, elim_graph_remove_succ_edge, + FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED): Use VEC + instead of VARRAY. + +2005-05-29 Kazu Hirata + + * cgraphunit.c, ipa-inline.c, loop-iv.c, modulo-sched.c, + opts.c, postreload-gcse.c, tree-browser.def, tree-eh.c, + tree-ssa-copyrename.c, tree-vect-analyze.c: Fix typos and + follow spelling conventions in error/dump messages. + +2005-05-29 Roger Sayle + Richard Henderson + + * ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly + if the RHS isn't suitable for calling emit_move_insn. + +2005-05-29 Kazu Hirata + + * tree-ssa-ccp.c (ccp_fold): Return immediately after calling + fold_unary and fold_binary. + +2005-05-29 Roger Sayle + + * reg-stack.c (propagate_stack): Always copy the source stack to + the destination. This routine is now only called when this is safe. + (better_edge): New function split out from convert_regs_1 to + determine which of two edges is better to propagate across. + (convert_regs_1): We need only search for a best edge if the + stack layout hasn't been defined yet. Use better_edge to help + find beste. No longer traverse unnecessary edges. + +2005-05-29 Keith Besaw + + * tree-ssa-alias.c (new_type_alias): New procedure to + create a type memory tag for a pointer with a may-alias + set determined from a variable declaration. + * tree-flow.h: export declaration of new_type_alias + * tree-optimize.c (init_tree_optimization_passes): document + that pass_may_alias cannot be called after pass_vectorize. + * tree-vect-transform (vect_create_data_ref_ptr): Call + new_type_alias when an type memory tag isn't available + for a reference. + (vectorizable_store): Use copy_virtual_operands to update + virtual defs in place (so that loop_version can be called). + Call mark_for_renaming for the virtual defs in case peeling + is done and virtual uses outside the loop need to be updated. + +2005-05-29 Dorit Naishlos + + PR tree-optimization/21639 + * tree-complex.c (pass_lower_vector_s): Remove TODO_ggc_collect. + +2005-05-29 Jan Hubicka + + PR tree-optimization/21562 + * cfgexpand.c (construct_init_block): Deal properly with the case + of entry edge not pointing to very first basic block. + +2005-05-28 Kazu Hirata + + * tree-ssa-ccp.c (ccp_fold): Remove code that produces + non-gimple min invariant. + + * Makefile.in (OBJS-common): Add tree-cfgcleanup.o. + * tree-flow.h: Add prototypes for start_recording_case_labels + and end_recording_case_labels. + * tree-cfg.c (start_recording_case_labels, + end_recording_case_labels): Export. + (cleanup_tree_cfg_loop, modified_noreturn_calls, + cleanup_control_flow, cleanup_control_expr_graph, + remove_fallthru_edge, phi_alternatives_equal, + tree_forwarder_block_p, has_abnormal_incoming_edge_p, + remove_forwarder_block, cleanup_forwarder_blocks, + remove_forwarder_block_with_phi, merge_phi_nodes, + gate_merge_phi, pass_merge_phi): Move to ... + * tree-cfgcleanup.c: ... here. + + * basic-block.h: Remove forward declaration of bb_ann_d. + +2005-05-28 Jan Hubicka + + * tree-ssa-threadupdate.c: (create_edge_and_update_destination_phis): + Update profile. + * value-prof.c (tree_divmod_fixed_value_transform): Be more verbose in + debug output. + (tree_mod_subtract): Fix profile updating code. + (tree_divmod_values_to_profile): Do not produce useless value profilers + for divisions. + +2005-05-28 Kazu Hirata + + * tree-ssa-dom.c (vrp_element_p): Define. + (vrp_hash_elt): Change the type of records to + VEC(vrp_element_p,heap). + (vrp_free): New. + (tree_ssa_dominator_optimize): Pass vrp_free to htab_create. + Update uses of VRP records. + (simplify_cond_and_lookup_avail_expr, record_range): Update + uses of VRP records. + + * tree-inline.c (cfun_stack): Change the type to + VEC(function_p,heap). + (push_cfun, pop_cfun): Use VEC instead of VARRAY. + +2005-05-27 Ian Lance Taylor + + * c-decl.c (add_stmt): Add C frontend specific version. + (stmts_are_full_exprs_p): Remove. + * c-common.h (STMT_IS_FULL_EXPR_P): Remove. + (stmts_are_full_exprs_p): Don't declare. + * c-semantics.c (add_stmt): Remove. + +2005-05-27 Kaveh R. Ghazi + + * config/mips/mips-protos.h (mips_declare_object): Add printf + attribute. + * config/mips/mips.c (mips_declare_object_name): Fix format + argument. + +2005-05-27 Roger Sayle + + * reg-stack.c (compensate_edge): Remove original prototype. + (propagate_stack): New function to copy the stack layout + at the start of a basic block from the layout at the end of + one of its predecessors. + (compensate_edge): Assume that both source and destination + blocks have already had their stack layouts defined. + (compensate_edges): Traverse all non-entry edges in the CFG + and call compensate_edge on each in turn. + (convert_regs_1): Change return type to void. Call + propagate_stack instead of compensate_edge. + (convert_regs_2): Change return type to void. Update call + to convert_regs_1 to ignore the (now void) return value. + (convert_regs): Update calls to convert_regs_2 to ignore + the (now void) return value. After all the basic blocks have + been processed, call compensate_edges to actually emit new + insns. + (reg_to_stack): Initialize the aux info for each basic block + with FOR_EACH_BB instead of which FOR_EACH_BB_REVERSE. + +2005-05-28 Jan Hubicka + + * except.c (can_throw_internal_1, can_throw_external_1): Add + "is_resx" argument. + (can_throw_external, can_throw_internal): Bring into sync wrt + dealing resx. + * except.h (can_throw_internal_1, can_throw_external_1): Update + prototype. + * tree-eh.c (tree_can_throw_internal, tree_can_throw_external): + Deal properly with resx. + +2005-05-27 Kazu Hirata + + * basic-block.h (basic_block_def): Add phi_nodes and + predictions. Remove tree_annotations. + * predict.c (tree_predicted_by_p, tree_predict_edge, + combine_predictions_for_bb): Adjust references to predictions. + * tree-cfg.c (init_empty_tree_cfg, create_bb): Don't call + create_block_annotation. + (create_block_annotation, free_blocks_annotatios, + clear_blocks_annotations): Remove. + (dump_cfg_stats): Don't print out the memory spent on + bb_ann_d. + (delete_tree_cfg_annotations): Don't call free_blocks_annotations. + * tree-flow-inline.h (bb_ann): Remove. + (phi_nodes, set_phi_nodes): Update references to phi_nodes. + * tree-flow.h (bb_ann_d): Remove. + * tree-if-conv.c (process_phi_nodes): Update a reference to + phi_nodes. + * tree-phinodes.c (reserve_phi_args_for_new_edge, + create_phi_node, remove_phi_node): Likewise. + * tree-pretty-print.c (dump_generic_bb_buff): Don't call bb_ann. + * tree-ssa-dom.c (threaded_blocks): New. + (tree_ssa_dominator_optimize): Initialize, clear, and free + threaded_blocks. Update a call to thread_through_all_blocks. + (thread_across_edge): Use threaded_blocks instead of setting + incoming_edge_threaded. + * tree-ssa-threadupdate.c (threaded_through_all_blocks): Take + a bitmap of blocks that are threaded through. + * tree.h: Move the prototype of threaded_through_blocks to + tree-flow.h. + + * domwalk.c (walk_dominator_tree, init_walk_dominator_tree, + fini_walk_dominator_tree): Use VEC instead of VARRAY. + * domwalk.h (dom_walk_data): Change the type of + block_data_stack and free_block_data to VEC(void_p,heap)*. + * tree-ssa-dse.c (dse_initialize_block_local_data, + dse_optimize_stmt, dse_record_phis, dse_finalize_block): Use + VEC instead of VARRAY. + +2005-05-27 Jan Hubicka + + * cgraph.c: Include tree-gimple.h + (cgraph_edge): Rename expr to stmt. + (cgraph_create_edge): Likewise. + (cgraph_clone_node): Likewise. + * cgraph.h (cgraph_node): Use call_stmt instead of call_expr. + * cgraphunit.c (record_call_1): Rename to ... + (record_reference): ... this one; do not build edges. + (cgraph_varpool_analyze_pending_decls): Call record_reference directly. + (current_basic_block): Kill. + (cgraph_create_edges): Rewrite to work on gimple statements nicely. + (verify_cgraph_node): Likewise. + * tree-inline.c (copy_body_r): Do not mess up with cgraph edges. + (copy_bb): Mess up with cgraph edges here; simplify EH handling. + (copy_edges_for_bb): Simplify EH handling. + (expand_call_inline): Pass statement to cgraph_edge and + cgraph_create_edge. + +2005-05-27 Richard Guenther + + * tree-inline.c (copy_body_r): Manually fold *& to deal + with ADDR_EXPRs with mismatched types for now. + + * gimplify.c (fold_indirect_ref_rhs): New function. + (gimplify_modify_expr_rhs): Use it instead of pessimistic + fold_indirect_ref. + + * fold-const.c (fold_indirect_ref_1): Add type argument; + make sure the resulting expression is of this type. + (build_fold_indirect_ref, fold_indirect_ref): Adjust callers. + +2005-05-27 Kazu Hirata + + PR tree-optimization/21658 + * tree-ssa-ccp.c (ccp_fold): Call fold_binary instead of + fold_binary_to_constant. Likewise, call fold_unary instead of + fold_unary_to_constant. + +2005-05-27 Nathan Sidwell + + * vec.h: Implement integral type vector specialization. + (VEC_T): Define a non-GTY structure. + (VEC_T_GTY): Define a GTY structure. + (VEC_TA): Rename to ... + (VEC_TA_GTY): ... here. + (DEF_VEC_I, DEF_VEC_ALLOC_I): New. + (DEF_VEC_P, DEF_VEC_ALLOC_P): Adjust. + (DEF_VEC_FUNC_P, DEF_VEC_ALLOC_FUNC_P): New, broken out of + DEF_VEC_P and DEF_VEC_ALLOC_P. + (DEF_VEC_O, DEF_VEC_ALLOC_O): Adjust. + (DEF_VEC_FUNC_O, DEF_VEC_ALLOC_FUNC_O): New, broken out of + DEF_VEC_O and DEF_VEC_ALLOC_O. + * global.c: Use DEF_VEC_I, DEF_VEC_ALLOC_I. + * lambda-code.c: Likewise. + * tree-into-ssa.c: Likewise. + * tree-ssa-live.c: Likewise. + +2005-05-27 Kazu Hirata + + * tree-into-ssa.c (update_ssa): Ensure that the operand cache + is up-to-date. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call + update_stmt_if_modified before calling update_ssa. + +2005-05-27 Ralf Corsepius + + * config/rs6000/t-rtems: Remove roe multilib variant. + +2005-05-26 Roger Sayle + + PR tree-optimization/9814 + * ifcvt.c (noce_emit_move_insn): If we fail to recognize the move + instruction, add the necessary clobbers by re-expanding the RTL + for arithmetic operations via optab.c's expand_unop/expand_binop. + (noce_try_bitop): New function to optimize bit manipulation idioms + of the form "if (x & C) x = x op C" and "if (!(x & C) x = x op C". + (noce_process_if_block): Call noce_try_bitop. + +2005-05-26 Roger Sayle + + * reg-stack.c (convert_regs_entry, convert_regs_exit, + convert_regs_1, convert_regs_2, convert_regs): Delete prototypes. + (reg_to_stack): Move to end of the file. Initialize the per + basic block information here, instead of... + (convert_regs_entry): Here. + (convert_regs): Change unused return type to void. + +2005-05-27 Kazu Hirata + + * c-pch.c, timevar.c, timevar.h, unwind-compat.c, + unwind-dw2-fde-compat.c, unwind-dw2-fde.c, config/mmix/mmix.h, + config/rs6000/eabispe.h, config/rs6000/lynx.h, + config/sh/elf.h, config/sh/symbian-pre.h, + config/sparc/sparc-protos.h: Update copyright. + +2005-05-26 Mike Stump + + * darwin.h (ASM_OUTPUT_LABELREF): Handle quoted non-lazy pointers + for Objective-C++. + +2005-05-26 Richard Guenther + + * tree-ssa-forwprop.c (forward_propagate_addr_expr): + See through ADDR_EXPR in finding place to propagate into. + +2005-05-26 Kazu Hirata + + * c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h, + cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c, + ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c, + tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c, + tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, + tree-ssa-operands.c, tree-vect-analyze.c, + tree-vect-transform.c, tree-vectorizer.c, tree.c, + config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c, + config/frv/frv.md, config/i386/i386.c, config/i386/sse.md, + config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, + config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md, + config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c, + config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md, + config/sh/ushmedia.h, config/sparc/sparc.c, + config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment + typos. Follow spelling conventions. + * doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos. + Follow spelling conventions. + +2005-05-26 David Ung + + * config/mips/mips.c (mips_use_ins_ext_p): New helper function + that determines whether the MIPS32/64 R2 ext/ins should be used. + * config/mips/mips.h (ISA_HAS_EXT_INS): New macro. + * config/mips/mips.md (extzv): Changed predicate for operand to + nonimmediate_operand. Add code to generate insn patterns for + extzvsi and extzvdi. + (extzv): New pattern to match mips32/64 r2 ext insn. + (insv): Similarly for insertion. + (insv): Similarly. + +2005-05-26 Paolo Bonzini + + * simplify-rtx.c (avoid_constant_pool_reference): Support + offsetted addresses in the constant pool. + +2005-05-26 Paolo Bonzini + + * df.h (DF_SUBREGS, df_local_def_available_p, df_insn_modified_p): New. + * df.c (DF_SUBREGS, df_local_def_available_p, df_insn_modified_p): New. + +2005-05-26 Jakub Jelinek + + PR target/21716 + * reg-stack.c (swap_rtx_condition): Don't crash if %ax user was not + found in the basic block and last insn in the basic block is not + INSN_P. Remove explicit unspec numbers that are no longer valid + from comments. + +2005-05-26 Paolo Bonzini + + * tree-vect-transform.c (vectorizable_operation): Try word_mode + vectorization if UNITS_PER_WORD == UNITS_PER_SIMD_WORD, even + if a vector mode is available. + +2005-05-25 Roger Sayle + + PR middle-end/21709 + * fold-const.c (const_binop): Check for division by zero during + complex division. + +2005-05-26 Ian Lance Taylor + + * reload1.c (verify_initial_elim_offsets): Add braces to avoid + having a declaration after a statement. + +2005-05-26 Richard Sandiford + + * opt-functions.awk (var_type): New function. + (var_set): Use CLVC_STRING if var_type returns "const char *". + * opth-gen.awk: Use var_type to find out the types of variables. + Don't print comments above each "extern" definition. + * optc-gen.awk: Use var_type in the same way. + * opts.h (cl_var_cond): Rename to... + (cl_var_type): ...this. Add CLVC_STRING. + (cl_option): Make "flag_var" a "void *" pointer. Replace "var_cond" + with "var_type". + * opts.c (handle_option, option_enabled): Update after above name + change. Cast flag_var before using it. Handle CLVC_STRING. + + * config/alpha/alpha.h (alpha_tls_size): Delete. + * config/alpha/alpha.c (alpha_tls_size, alpha_cpu_string) + (alpha_tune_string, alpha_tp_string, alpha_fprm_string) + (alpha_fptm_string, alpha_mlat_string): Delete. + (alpha_handle_option): Don't set the above variables here. Use the + integer argument to check the validity of -mtls-size=. + * config/alpha/alpha.opt (mcpu=, mtune=, mfp-rounding-mode=) + (mfp-trap-mode=, mtrap-precision=, mmemory-latency=): Add Var()s. + (mtls-size=): Likewise. Convert to a UInteger and initialize the + variable to 32. + + * config/arc/arc.c (arc_cpu_string, arc_text_string) + (arc_data_string, arc_rodata_string): Delete. + (arc_handle_option): Don't set the above variables here. + * config/arc/arc.opt (mcpu=, mtext=, mdata=, mrodata=): Add Var()s + and initialize them. + + * config/arm/arm.c (target_fpu_name, target_fpe_name) + (target_float_abi_name, target_abi_name, structure_size_string) + (arm_pic_register_string): Delete. + (arm_handle_option): Don't set the above variables here, except + in the handling of -mhard-float and -msoft-float. + * config/arm/arm.opt (mabi=, mfloat-abi=, mfp=, mfpe=, mfpu=) + (mpic-register=, mstructure-size-boundary=): Add Var()s. + + * config/avr/avr.c (avr_init_stack, avr_mcu_name, TARGET_HANDLE_OPTION) + (avr_handle_option): Delete. + * config/avr/avr.opt (mmcu=, minit-stack=): Add Var()s and initialize + them. + + * config/bfin/bfin.c (bfin_library_id): Delete. + (bfin_handle_option): Don't set it. + * config/bfin/bfin.opt (mshared-library-id=): Add Var(). + + * config/c4x/c4x.h (c4x_rpts_cycles): Delete. + * config/c4x/c4x.c (c4x_rpts_cycles): Delete. + (c4x_handle_option): Don't set c4x_rpts_cycles here. + * config/c4x/c4x.opt (mrpts=): Add Var(). + + * config/cris/aout.h (CRIS_SUBTARGET_HANDLE_OPTION): Don't set + cris_elinux_stacksize_str here. + * config/cris/aout.opt (melinux-stacksize=): Add Var(). + * config/cris/cris.h (cris_max_stackframe_str, cris_cpu_str) + (cris_tune_str, cris_elinux_stacksize_str): Delete. + * config/cris/cris.c (cris_max_stackframe_str, cris_cpu_str) + (cris_tune_str, cris_elinux_stacksize_str): Delete. + (cris_handle_option): Don't set the above variables here. + * config/cris/cris.opt (mcpu=, march=, mtune=, mmax-stackframe=) + (max-stackframe=): Add Var()s. + + * config/i386/i386.h (ix86_tune_string, ix86_arch_string): Delete. + * config/i386/i386.c (ix86_cmodel_string, ix86_asm_string) + (ix86_tls_dialect_string, ix86_tune_string, ix86_arch_string) + (ix86_fpmath_string, ix86_regparm_string, ix86_align_loops_string) + (ix86_align_jumps_string, ix86_preferred_stack_boundary_string) + (ix86_branch_cost_string, ix86_align_funcs_string): Delete. + (ix86_handle_option): Don't set the above variables here. + * config/i386/i386.opt (malign-functions=, malign-jumps=) + (malign-loops=, march=, masm=, mbranch-cost=, mcmodel=, mfpmath=) + (mpreferred-stack-boundary=, mregparm=, mtls-dialect=, mtune=): Add + Var()s. + + * config/ia64/ia64.h (ia64_tls_size): Delete. + * config/ia64/ia64.c (ia64_tls_size): Delete. + (ia64_handle_option): Treat -mtls-size= as a UInteger option, + reading the integer argument from the "value" parameter. Don't + set ia64_tls_size here. + * config/ia64/ia64.opt (mtls-size=): Turn into a UInteger option. + Add Var() and Init(). + + * config/m32r/m32r.h (m32r_cache_flush_func): Delete. + (m32r_cache_flush_trap): Delete. + * config/m32r/m32r.c (m32r_cache_flush_func): Delete. + (m32r_cache_flush_trap): Delete. + (m32r_handle_option): Don't set the above variables when handling + -mflush-func= and -mflush-trap=. + * config/m32r/m32r.opt (-mflush-func=, -mflush-trap=): Add Var()s + and Init()s. + + * config/mips/mips.h (mips_cache_flush_func): Delete. + * config/mips/mips.c (mips_arch_string, mips_tune_string) + (mips_cache_flush_func): Delete. + (mips_handle_option): Don't set the above variables when handling + -march=, -mtune= and -mflush-func=. + * config/mips/mips.opt (march=, mflush-func=, mtune=): Add Var()s. + + * config/s390/s390.c (s390_arch_string): Delete. + (s390_handle_option): Don't set it here. + * config/s390/s390.opt (march=): Add Var(). + + * config/sparc/sparc.h (sparc_cmodel_string): Delete. + * config/sparc/sparc.c (sparc_cmodel_string): Delete. + (sparc_handle_option): Don't set it here. + * config/sparc/sparc.opt (mcmodel=): Add Var(). + +2005-05-25 Roger Sayle + + * convert.c (convert_to_integer) : Avoid recursive + call to convert_to_integer by building the NOP_EXPR directly. + +2005-05-25 Richard Sandiford + + * config/rs6000/rs6000.opt (mprioritize-restricted-insns=): Fix typo. + +2005-05-25 Daniel Berlin + Jeff Law + + * tree-cfg.c (verify_expr, case ADDR_EXPR): Verify invariant, + constant and side_effects of the ADDR_EXPR are consistent. + + * tree-nested.c (convert_local_reference): Set CURRENT_FUNCTION_DECL + appropriately around calls to recompute_tree_invarant_for_addr_expr. + +2005-05-25 Ulrich Weigand + + * config/s390/s390.c (GP_ARG_NUM_REG, FP_ARG_NUM_REG): New defines. + (s390_function_arg, s390_gimplify_va_arg): Use them. + (s390_register_info): Save only required subset of argument + registers into save area for va_list. + (s390_va_start): Initialize only required elements of va_list struct. + (s390_build_builtin_va_list): Set va_list_[gf]pr_counter_field. + +2005-05-25 Ulrich Weigand + + * reload1.c (verify_initial_elim_offsets): Return boolean status + instead of aborting. + (reload): Adapt verify_initial_elim_offsets call site. Restart + main loop if some initial elimination offsets changed. + +2005-05-25 Adam Nemet + + * config/rs6000/lynx.h (CC1_SPEC): Use -maix-struct-return instead + of -mno-svr4-struct-return. + +2005-05-25 Daniel Berlin + + Fix PR tree-optimization/21705 + + * tree-ssa-pre.c (in_fre): New static variable. + (create_value_expr_from): Recursively value number reference ops + in argument lists. + (can_value_number_call): Temporary restrict only exists for + PRE, not FRE. + +2005-05-25 Kazu Hirata + + * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Replace + sizeof (bitmap *) with sizeof (bitmap). + +2005-05-25 Daniel Berlin + + * lambda-code.c (perfect_nestify): Call update_stmt on the exit + condition. + +2005-05-25 Adrian Straetling + + * config/s390/s390.c (TARGET_INSN_VALID_WITHIN_DOLOOP): Set to + hook_bool_rtx_true. + +2005-05-25 Jan Hubicka + + * Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency. + * cgraph.c (cgraph_create_node): Reset estimated_growth. + * cgraph.h (cgraph_global_info): Add estimated_growth. + * ipa-inline.c: Include coverage.h + (max_insns, max_count): New static variables. + (cgraph_estimate_size_after_inlining): Cache the result. + (cgraph_estimate_growth): + * passes.c (rest_of_clean_state): Kill coverage_end_function. + * timevar.def (TV_INLINE_HEURISTICS): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Move profiling before + inlining. + (ipa_passes): Initialize bitmaps. + +2005-05-25 Adrian Straetling + + * loop-doloop.c: Include "target.h". + (doloop_valid_p): Move tests to function in targhooks.c. + * target.h (struct gcc_target): New target hook + "insn_valid_within_doloop". + * target-def.h: Define default value for "insn_valid_within_doloop". + (TARGET_INITIALIZER): Insert new target hook into initializer. + * targhooks.c (default_insn_valid_within_doloop): New function. + * targhooks.h (default_insn_valid_within_doloop): Declare. + * hooks.c (hook_bool_rtx_true): New function. + * hooks.h (hook_bool_rtx_true): Declare. + * doc/tm.texi: Add documentation for new target hook. + +2005-05-25 Eric Botcazou + + PR target/21412 + * config/sparc/sparc.h (SPARC_SYMBOL_REF_TLS_P): New macro + * config/sparc/sparc-protos.h (tls_symbolic_operand): Delete. + (sparc_tls_referenced_p): New prototype. + * config/sparc/sparc.c (tls_symbolic_operand): Delete. + (sparc_expand_move): Look for TLS addresses with constant offsets. + (legitimate_constant_p): Use SPARC_SYMBOL_REF_TLS_P instead of + tls_symbolic_operand. + (legitimate_pic_operand_p): Likewise. + (legitimate_address_p): Likewise. + (legitimize_address): Likewise. + (sparc_tls_symbol_ref_1): New function. + (sparc_tls_referenced_p): New function. + * config/sparc/predicates.md (tgd_symbolic_operand): Use + SYMBOL_REF_TLS_MODEL instead of tls_symbolic_operand. + (tld_symbolic_operand): Likewise. + (tie_symbolic_operand): Likewise. + (tle_symbolic_operand): Likewise. + +2005-05-24 DJ Delorie + + * common.opt (-Wattributes): New. Default true. + * doc/invoke.texi (-Wno-attributes): Document. + + * attribs.c (decl_attributes): Move warning control from if() to + warning(OPT_*). + * c-common.c (handle_packed_attribute): Likewise. + (handle_nocommon_attribute): Likewise. + (handle_common_attribute): Likewise. + (handle_noreturn_attribute): Likewise. + (handle_noinline_attribute): Likewise. + (handle_always_inline_attribute): Likewise. + (handle_used_attribute): Likewise. + (handle_unused_attribute): Likewise. + (handle_const_attribute): Likewise. + (handle_transparent_union_attribute): Likewise. + (handle_constructor_attribute): Likewise. + (handle_destructor_attribute): Likewise. + (handle_mode_attribute): Likewise. + (handle_alias_attribute): Likewise. + (handle_visibility_attribute): Likewise. + (handle_tls_model_attribute): Likewise. + (handle_malloc_attribute): Likewise. + (handle_returns_twice_attribute): Likewise. + (handle_pure_attribute): Likewise. + (handle_deprecated_attribute): Likewise. + (handle_vector_size_attribute): Likewise. + (handle_nothrow_attribute): Likewise. + (handle_cleanup_attribute): Likewise. + (handle_warn_unused_result_attribute): Likewise. + (handle_sentinel_attribute): Likewise. + * c-decl.c (diagnose_mismatched_decls): Likewise. + (start_decl): Likewise. + (grokdeclarator): Likewise. + (start_function): Likewise. + * c-format.c (check_function_format): Likewise. + * stor-layout.c (place_field): Likewise. + (finalize_record_size): Likewise. + * tree.c (handle_dll_attribute)): Likewise. + * varasm.c (default_assemble_visibility): Likewise. + * config/darwin.c (darwin_handle_weak_import_attribute): Likewise. + (darwin_assemble_visibility): Likewise. + * config/arc/arc.c (arc_handle_interrupt_attribute): Likewise. + * config/arm/arm.c (arm_handle_fndecl_attribute): Likewise. + (arm_handle_isr_attribute): Likewise. + * config/avr/avr.c (avr_handle_progmem_attribute): Likewise. + (avr_handle_fndecl_attribute): Likewise. + * config/bfin/bfin.c (handle_int_attribute): Likewise. + * config/c4x/c4x.c (c4x_handle_fntype_attribute): Likewise. + * config/h8300/h8300.c (h8300_handle_fndecl_attribute): Likewise. + (h8300_handle_eightbit_data_attribute): Likewise. + (h8300_handle_tiny_data_attribute): Likewise. + * config/i386/i386.c (ix86_handle_cdecl_attribute): Likewise. + (ix86_handle_regparm_attribute): Likewise. + (ix86_handle_struct_attribute): Likewise. + * config/i386/winnt.c (ix86_handle_shared_attribute): Likewise. + (i386_pe_encode_section_info): Likewise. + * config/ia64/ia64.c (ia64_handle_model_attribute): Likewise. + * config/ip2k/ip2k.c (ip2k_handle_progmem_attribute): Likewise. + (ip2k_handle_fndecl_attribute): Likewise. + * config/m32r/m32r.c (m32r_handle_model_attribute): Likewise. + * config/m68hc11/m68hc11 (m68hc11_handle_page0_attribute): Likewise. + (m68hc11_handle_fntype_attribute): Likewise. + (m68hc11_encode_section_info): Likewise. + * config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise. + * config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise. + * config/ns32k/ns32k.c (ns32k_handle_fntype_attribute): Likewise. + * config/rs6000/rs6000.c (rs6000_handle_longcall_attribute): Likewise. + * config/sh/sh.c (sh_handle_interrupt_handler_attribute): Likewise. + (sh_handle_sp_switch_attribute): Likewise. + (sh_handle_trap_exit_attribute): Likewise. + * config/sh/symbian.c (sh_symbian_dllimport_p): Likewise. + (sh_symbian_handle_dll_attribute): Likewise. + * config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise. + (xstormy16_handle_below100_attribute): Likewise. + * config/v850/v850.c (v850_handle_interrupt_attribute): Likewise. + + * c-common.c (unsigned_conversion_warning): Move warning control + from if() to warning(OPT_*). + (c_common_truthvalue_conversion): Likewise. + (c_do_switch_warnings): Likewise. + * c-decl.c (diagnose_mismatched_decls): Likewise. + (diagnose_mismatched_decls): Likewise. + (define_label): Likewise. + (grokdeclarator): Likewise. + * c-format.c (check_format_info): Likewise. + * c-lex.c (interpret_integer): Likwise. + (lex_string): Likewise. + * c-opts.c (c_common_post_options): Likewise. + * c-parser.c (c_parser_unary_expression): Likewise. + * c-pragma.c (handle_pragma_redefine_extname): Likewise. + (handle_pragma_extern_prefix): Likewise. + * c-typeck.c (build_binary_op): Likewise. + * gcse.c (is_too_expensive): Likewise. + * opts.c (decode_options): Likewise. + * stor-layout.c (place_field): Likewise. + * tree-cfg.c (remove_bb): Likewise. + + * c.opt (-Wreturn-type): Add Var(warn_return_type). + * flags.h (warn_return_type): Remove. + * toplev.c (warn_return_type): Likewise. + +2005-05-24 Kelley Cook + + * configure.ac: Don't use gcc_AC_C_LONG_LONG. Check for + existence of long long and __int64 before determining their size. + * aclocal.m4: Delete gcc_AC_C_LONG_LONG. + * configure, config.h.in: Regenerate. + +2005-05-24 Kelley Cook + + * configure: Regenerate. + +2005-05-24 Ziemowit Laski + + * c-common.h (objc_comptypes): Remove prototype. + (objc_compare_types): New prototype. + (objc_volatilized_decl): Likewise. + (objc_type_quals_match): Likewise. + * c-decl.c (objc_mark_locals_volatile): Streamline by calling + objc_volatilize_decl(). + * c-typeck.c (comp_target_types): Remove third parameter; do + not call objc_comptypes(). + (comptypes): Remove calls to objc_comptypes(). + (build_function_call): Extend compatible prototype check to ObjC. + (build_conditional_expr): Adjust call to comp_target_types(). + (convert_for_assignment): Call objc_compare_types() instead of + objc_comptypes(); adjust calls to comp_target_types(); call + objc_type_quals_match() before issuing qualifier mismatch + warnings. + (build_binary_op): Call objc_compare_types() before issuing + pointer mismatch warnings; adjust calls to + comp_target_types(). + * stub-objc.c (objc_comptypes): Remove stub. + (objc_compare_types): New stub. + (objc_volatilized_decl): Likewise. + (objc_type_quals_match): Likewise. + +2005-05-24 Paolo Carlini + + * config/ia64/ia64intrin.h: Define nothing for C++: + overloaded builtins have been ported to C++. + +2005-05-24 Jeff Law + + * tree-nested.c (build_addr): New "context" argument. Temporarily + set current_function_decl around the call to build the ADDR_EXPR. + (get_static_chain): Pass proper context to build_addr. + (convert_nl_goto_reference): Likewise. + (convert_tramp_reference): Likewise. + (final_nesting_tree_1): Likewise. + * tree-profile.c (tree_gen_interval_profiler): Likewise. + (tree_gen_pow2_profiler): Likewise. + (tree_gen_one_value_profiler): Likewise. + * tree-ssa-loop-ivopts.c (build_addr_strip_iref): Likewise. + * tree.h (build_addr): Update prototype. + +2005-05-24 Kazu Hirata + + * tree-flow.h (bb_ann_d): Remove has_escape_site. + * tree-ssa-alias.c (compute_points_to_addr_escape): Don't + write to has_escape_site. + +2005-05-24 Jeff Law + + * Makefile.in (tree-cfg.o): Depend on tree-ssa-propagate.h. + * tree-cfg.c: Include tree-ssa-propagate.h. + (replace_uses_by): Call recompute_tree_invarant_for_addr_expr as + needed. + +2005-05-24 Nick Clifton + + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define + __NO_FPRS__ when 'f' class registers will not be available. + +2005-05-24 Kazuhiro Inaoka + + * config/m32r/m32r.c (m32r_expand_block_move): Return 0 if + nothing was done. + * config/m32r/m32r.md (movmemsi): If m32r_expand_block_move did + nothing then FAIL. + * config/m32r/m32r/m32r-protos.h (m32r_expand_block_move): Update + prototype. + +2005-05-23 Jeff Law + + * tree-ssa-dom.c (cprop_into_stmt): Do not call + recompute_tree_invariant_for_addr_expr here. + (optimize_stmt): Call it here instead and do so if anything + at all has changed in the statement and the RHS is an ADDR_EXPR. + * tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): If + needed, call recompute_tree_invariant_for_addr_expr. + * tree-ssa-propagate.c (substitute_and_fold): Call + recompute_tree_invariant_for_addr_expr as needed. + +2005-05-23 Andreas Krebbel + + * config/s390/s390.c (s390_optimize_prologue): Don't replace an insn + saving less registers than the replacement. + +2005-05-23 Jan Hubicka + + * tree-flow.h (stmt_ann_d): Kill GTY ((skip)) mark on BB. + +2005-05-23 Eric Botcazou + + * config/sparc/sparc-protos.h (sparc_expand_move): New prototype. + * config/sparc/sparc.c (sparc_expand_move): New function. + (sparc_emit_set_const64): Rewrite assert condition on entry. + (legitimate_constant_p) : New case. + (legitimize_pic_address): Use TARGET_ARCH64 to select the mode. + * config/sparc/sparc.md (movqi, movhi, movsi, movdi, movV32, + movV64, movtf): Use nonimmediate_operand for the first operand. + Rewrite. Only invoke sparc_expand_move. + * config/sparc/predicates.md (input_operand): Reorder tests. + +2005-05-23 Jan Beulich + + * gthr-posix.h (__gthread_recursive_mutex_init_function): Add + missing return statement. + +2005-05-22 Eric Botcazou + + * config/sparc/sparc.c (sparc_emit_float_lib_cmp): Use + emit_move_insn for moves to TFmode stack slots. + +2005-05-21 Richard Guenther + + * tree-stdarg.c (execute_optimize_stdarg): Handle references + to va_list of the form &va[0]. + +2005-05-20 Jan Hubicka + + * Makefile.in (insn-emit.o): Add basic-block.h dependency. + * genemit.c (main): Make insn-emit to include basic-block.h too. + +2005-05-20 Jan Hubicka + + * cgraphunit.c (cgraph_expand_function): Force function being lowered. + +2005-05-19 Richard Henderson + + * config/alpha/alpha.c (emit_unlikely_jump, emit_load_locked, + emit_store_conditional): Split out from ... + (alpha_split_atomic_op): ... here. + (alpha_split_compare_and_swap): New; extract from .md file. + (alpha_split_lock_test_and_set): Likewise. + * config/alpha/alpha-protos.h: Update. + * config/alpha/sync.md (sync_compare_and_swap): Move + split code into alpha.c. + (sync_lock_test_and_set): Likewise. + +2005-05-19 Richard Henderson + + * unwind.h, unwind-pe.h: Revert gcc_unreachable change of 05-17. + +2005-05-19 Richard Henderson + + * config/i386/sse.md (mulv4si3): Use all register inputs. + (mulv2di3): Likewise. + +2005-05-19 Richard Guenther + + * tree-ssa-loop-ivopts.c (determine_base_object): Use + build_fold_addr_expr to generate trees of correct type. + Use fold_buildN if possible. + +2005-05-19 Jan Hubicka + + * basic-block.h (REG_BR_PROB_BASE): Define. + * cgraph.c (cgraph_create_edge): Initialize loop_nest and count. + (dump_cgraph_node): Dump count. + (cgraph_clone_edge): Rescale counts. + (cgraph_clone_node): Likewise. + * cgraph.h: Include basic-block.h + (cgraph_node): Add count. + (cgraph_edge): Add count and loop_nest. + (cgraph_node, cgraph_edge, cgraph_clone_edge, cgraph_clone_node): + Update prototypes. + * cgraphunit.c: Kill now redundant inlining comment. + (cgraph_create_edges): Make static, maintain current basic block; + fix pasto. + (record_call_1): Fill in new fields. + * ipa-inline.c (cgraph_clone_inlined_nodes): Update call of + cgraph_clone_node. + (cgraph_decide_recursive_inlining): Likewise. + * rtl.h (REG_BR_PROB_BASE): Kill. + * tree-inline.c (copy_body_r): Update call of cgraph_clone_edge. + (expand_call_inline): Update call of cgraph_create_edge. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + +2005-05-19 Nick Clifton + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use the + new rs6000_explicit_options structure. + +2005-05-19 Richard Henderson + + PR target/21390 + * config/alpha/alpha.c (alpha_emit_conditional_branch): Move + TFmode code swapping ... + (alpha_emit_xfloating_compare): ... here. + (alpha_emit_setcc): Update to match. + (alpha_lookup_xfloating_lib_func): Assert TARGET_HAS_XFLOATING_LIBS. + +2005-05-19 Richard Henderson + + PR target/21657 + * config/ia64/ia64.c (ia64_expand_tls_address): Remove extra + memory indirection in local-dynamic case. + +2005-05-18 Jie Zhang + Bernd Schmidt + + * config/bfin/bfin.c (branch_dest): Add comment why it's + necessary. + * config/bfin/bfin.md (attr "length" default): Change the offset of + forward conditional branch of length 4 from 4096 to 4092. + +2005-05-19 Jan Beulich + + * unwind-compat.c: Include tconfig.h and tsystem.h. + * unwind-dw2-fde-compat.c: Likewise. + +2005-05-18 Richard Henderson + + PR 21541 + * ifcvt.c (noce_process_if_block): Avoid conversion when the + memory destination is readonly. + +2005-05-18 Richard Henderson + + PR 21541 + * tree-ssa-operands.c (opf_non_specific): New. + (get_asm_expr_operands): Set it. + (add_call_clobber_ops, add_call_read_ops): Likewise. + (add_stmt_operand): Test it instead of opf_kill_def when + considering unmodifiable variables. + + * tree-ssa-operands.c (get_expr_operands): Fix exact test. + +2005-05-19 Kazu Hirata + + * cfgexpand.c, tree-cfg.c, tree-inline.c, tree-optimize.c, + tree-ssa-forwprop.c: Fix comment typos. + * doc/invoke.texi: Fix a typo. + +2005-05-18 Richard Henderson + + * config.gcc (powerpc-*-linux*): Include linux64.opt when + including linux64.h. + +2005-05-18 Richard Henderson + + * tree-cfg.c (pass_remove_useless): Revert last change. + * tree-optimize.c (init_tree_optimization_passes): Initialize + all_lowering_passes with PROP_gimple_any. + +2005-05-18 Devang Patel + + * config/rs6000/rs6000.md (insvsi_internal1): Subtract shift from + the mask end. + +2005-05-18 Richard Henderson + + * tree-ssa-forwprop.c (cfg_changed): New. + (tidy_after_forward_propagate_addr): New. + (forward_propagate_addr_expr): Use it, and fold_stmt_inplace. + (forward_propagate_addr_into_variable_array_index): Likewise. + (tree_ssa_forward_propagate_single_use_vars): Cleanup cfg if + edges were removed. + +2005-05-18 Geoffrey Keating + + * dummy-checksum.c: New. + * genchecksum.c: New. + * c.opt (print_pch_checksum): New flag. + * c-pch.c (struct c_pch_validity): Make much shorter. + (no_checksum): New. + (host_machine): Remove. + (target_machine): Remove. + (get_ident): Change PCH version number. + (pch_init): When -fverbose-asm, print out the compiler fingerprint. + Don't put triplets or version string in PCH validity data. + Do put the compiler checksum in the validity data. + (c_common_valid_pch): Don't check triplets or version string. Do + check checksum. + (c_common_print_pch_checksum): New. + * c-opts.c (c_common_handle_option): Add OPT_print_pch_checksum. + Print fingerprint with -v. + * c-common.h (c_common_print_pch_checksum): New. + (executable_checksum): New. + * Makefile.in (STAGEMOVESTUFF): Add cc1*-dummy, *-checksum.c. + (cc1-dummy): New rule. + (cc1-checksum.c): New rule. + (cc1-checksum.o): New rule. + (cc1): Add checksum support. + (build/genchecksum): New. + (build/genchecksum.o): New. + (dummy-checksum.o): New. + (genobjnames): Add genchecksum.o. + (mostlyclean): Remove *-checksum.c. + (gnucompare): Add libgcc to list of directories checked. + Make comparison problems in libgcc/ and with checksum files only + be warnings. + * doc/invoke.texi (Precompiled Headers): Remove caution. + Document that it must be the exact same binary. Add a few + known-safe flags to the list. + + * rs6000/predicates.md (fix_trunc_dest_operand): New. + * rs6000/rs6000.md (fix_truncdfsi2): Use fix_trunc_dest_operand. + Check that a memory operand is valid before trying to use it. + + * tree-cfg.c (pass_remove_useless): This pass works on trees. + +2005-05-18 Richard Guenther + + * tree.c (build1_stat): Don't try to handle two-operand + tree codes. + +2005-05-18 Richard Sandiford + + * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. + * config/sh/sh.h: Update mask names throughout. + (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) + (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) + (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) + (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) + (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) + (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) + (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) + (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) + (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) + (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) + (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) + (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) + (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) + (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) + (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) + (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) + (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) + (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) + (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) + (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) + (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) + (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) + (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) + (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) + (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) + (SUBTARGET_SWITCHES): Delete. + (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) + (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) + (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) + (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. + (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. + (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) + (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. + (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. + (SUPPORT_SH3): Likewise SUPPORT_SH2. + (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. + (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise + SUPPORT_SH4_NOFPU. + (SUPPORT_SH3E): Likewise SUPPORT_SH2E. + (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) + (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. + (SUPPORT_SH4A): Likewise SUPPORT_SH4. + (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. + (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. + (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. + (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) + (SUPPORT_ANY_SH5): New macros. + (TARGET_NONE): Replace with... + (MASK_ARCH): ...this new macro. + * config/sh/elf.h: Update mask names + * config/sh/linux.h: Likewise. + * config/sh/little.h: Likewise. + * config/sh/netbsd-elf.h: Likewise. + * config/sh/symbian-pre.h: Likewise. + * config/sh/sh.c (sh_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. + (sh_target_switches, target_switches): Delete. + (sh_pch_valid_p): Check for specific differences in the target_flags + settings. + (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. + * config/sh/sh.opt: New file. + +2005-05-18 Richard Henderson + + PR target/21632 + * config/ia64/ia64.c (ia64_extra_constraint) <'T'>: Use + small_addr_symbolic_operand. + +2005-05-18 Jeff Law + + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not + propagate an ADDR_EXPR if the definition and use sites are + in different EH regions. + +2005-05-18 Ian Lance Taylor + + * read-rtl.c (mode_attr_index): Use obstack_grow0, not + obstack_grow. + +2005-05-18 Daniel Berlin + + * cfgrtl.c (purge_dead_edges): Don't remove fake edges. + +2005-05-18 Daniel Berlin + + Fix PR tree-optimization/21407 + + * tree-ssa-operands.c (note_addressable): Change + COMPONENT_REF handling in response to aliasing + discussion. + +2005-05-18 Eric Botcazou + + * config/sparc/sol2.h (TARGET_DEFAULT): Add back MASK_APP_REGS. + * config/sparc/sol2-64.h (TARGET_DEFAULT): Likewise. + * config/sparc/sp-elf.h (TARGET_DEFAULT): Delete. + * doc/invoke.texi (SPARC options): Document that -mapp-regs is + the default on Solaris too. + +2005-05-17 Daniel Berlin + + * tree-ssa-pre.c (find_or_generate_expression): CALL_EXPR + is okay too. + +2005-05-17 Zdenek Dvorak + + * timevar.def (TV_SCEV_CONST): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_scev_cprop. + * tree-pass.h (pass_scev_cprop): Declare. + * tree-scalar-evolution.c (scev_const_prop): New function. + * tree-scalar-evolution.h (scev_const_prop): Declare. + * tree-ssa-loop.c (gate_scev_const_prop, pass_scev_cprop): + New. + * tree-cfg.c (replace_uses_by): Export. + * tree-flow.h (replace_uses_by): Declare. + +2005-05-17 Ziemowit Laski + Mike Stump + + Yet more Objective-C++... + + * c-common.h (objc_finish_try_stmt): Add. + (objc_build_synchronized): Add. + (objc_generate_write_barrier): Add. + * stub-objc.c (objc_build_synchronized): Add return value. + (objc_finish_try_stmt): Likewise. + (objc_generate_write_barrier): Add. + + * c-common.h (objc_rewrite_function_call): Add. + * c-typeck.c (build_function_call): Allow objc to rewrite + FUNCTION_DECLs. + (build_modify_expr): Allow objc to generate write barriers. + * c.opt (Wassign-intercept): Add. + (Wstrict-selector-match): Add. + (fobjc-call-cxx-cdtors): Add. + (fobjc-direct-dispatch): Add. + (fobjc-gc): Add. + * dbxout.c (get_lang_number): Add Objective-C++ support. + * doc/invoke.texi (-fobjc-call-cxx-cdtors): Likewise. + (-Wstrict-selector-match): Likewise. + (-fobjc-direct-dispatch): Likewise. + (-Wassign-intercept): Likewise. + (Overall Options): Likewise. + * gengtype.c (get_output_file_with_visibility): Likewise. + * stub-objc.c (objc_rewrite_function_call): Add. + * config/darwin.h (ASM_OUTPUT_LABELREF): Improved quoting support. + + * c-common.c (flag_objc_exceptions): Remove. + (flag_objc_sjlj_exceptions): Remove. + * c-decl.c (objc_mark_locals_volatile): Don't change decls + that are already ok. + * c-opts.c (c_common_handle_option, case + OPT_fobjc_exceptions): Remove. + (case OPT_fobjc_sjlj_exceptions): Remove + * c.opt (fobjc-call-cxx-cdtors): Have opt create the flag. + (fobjc-exceptions): Likewise. + (fobjc-sjlj-exceptions): Likewise. + * config/rs6000/darwin.h (OFFS_MSGSEND_FAST): Add. + (OFFS_ASSIGNIVAR_FAST): Add. + +2005-05-17 Eric Botcazou + + * config/sparc/sparc.md (movhi): Do not test constness + of operand #1 twice. + (movsi): Likewise. + (movdi): Unconditionally accept zero as second operand + when the first is memory. + (movdi_insn_sp32): Handle above case. + (DImode splitter): Use predicates. + (DImode splitter): Use const_zero_operand predicate. + (movsf_insn): Swap 2 alternatives. + +2005-05-17 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev): Apply + expand_simple_operations to bases of the ivs. + (tree_int_cst_sign_bit): Export. + * tree-flow.h (expand_simple_operations): Declare. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Use + tree_int_cst_sign_bit. + (expand_simple_operations): Export. + * tree.h (tree_int_cst_sign_bit): Declare. + +2005-05-17 Zdenek Dvorak + + * tree-cfg.c (tree_can_merge_blocks_p): Allow phi nodes in the + merged block. + (replace_uses_by): New function. + (tree_merge_blocks): Eliminate the phi nodes in the merged block. + * tree-flow.h (fold_stmt_inplace): Declare. + * tree-ssa-ccp.c (fold_stmt_inplace): New function. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Update dominance + info after cfg cleanup. + +2005-05-17 Zdenek Dvorak + + * cfgloop.h (just_once_each_iteration_p): Declaration changed. + * cfgloopanal.c (just_once_each_iteration_p): Make the loop argument + const. + +2005-05-17 Zdenek Dvorak + + * ggc-page.c (ggc_alloc_stat): Record amount of memory allocated. + * ggc-zone.c (ggc_alloc_zone_1): Ditto. + * timevar.c (timevar_ggc_mem_total): New variable. + (GGC_MEM_BOUND): New constant. + (get_time): Record ggc memory status. + (timevar_accumulate): Accumulate amount of ggc memory. + (timevar_print): Print consumption of ggc memory. + * timevar.def (TV_FIND_REFERENCED_VARS, TV_TREE_REDPHI, + TV_TREE_LOOP_BOUNDS, TV_TREE_LOOP_IVCANON, TV_TREE_VECTORIZATION, + TV_TREE_LINEAR_TRANSFORM): Shorten strings to fit in 22 characters. + * timevar.h (struct timevar_time_def): Add ggc_mem field. + (timevar_ggc_mem_total): Declare. + +2005-05-17 Kazu Hirata + + * tree-into-ssa.c (update_ssa): Clean up by shortening the + live range of DFS. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.md (ncond, ocode, rcond): Remove separate + define_code_attr. + ("b", "b", "b") + ("*b_reversed", "*b_reversed") + ("*b_reversed", "s", "s") + ("s"): Rename from respectively "b", + "b", "b", ("*b_reversed", + "*b_reversed", "*b_reversed", "s", + "s" and "s". + ("b", "*b_reversed") + ("*b_reversed"): Remove extraneous backslashes in + output statement section. + +2005-05-17 Roger Sayle + + * c-typeck.c (common_type): Also handle BOOLEAN_TYPEs. + +2005-05-17 Steven Bosscher + Stuart Hastings + Jan Hubicka + Dale Johannesen + + * cgraph.h (cgraph_node): Add 'lowered' state. + (cgraph_lower_function): Declare. + * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. + (cgraph_lower_function): New function. + (cgraph_create_edges): Deal with lowered function bodies. + (verify_cgraph_node): Likewise. + (cgraph_analyze_function): Do lowering job. + (cgraph_build_static_cdtor): Likewise. + * function.h (struct function): Add saved_eh and saved_cfg. + * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. + * tree-cfg.c (fold_cond_expr_cond): Export. + * tree-flow.h (fold_cond_expr_cond): Declare. + * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and + pointer-set. + (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, + in_target_cleanup_p, tree_pruner, tsi; add callee, caller and + callee_cfun, block, eh_region, eh_region_offset. + (inlining_p): New predicate. + (remap_decl): Update for new inline_data; declare newly created inline + vars in low gimple way. + (copy_body_r): Update for new datastructure, simplify some of handling + when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; + deal with RESX_EXPRs. + (copy_bb): New. + (copy_edges_for_bb): Likewise. + (remap_decl_1): New. + (copy_cfg_body): New. + (copy_generic_body): Rewrite to work on low gimple. + (copy_body): Turn into simple wrapper around copy_cfg_body. + (setup_one_parameter): Insert new statements into given basic block. + (initialize_initialized_parameters): Likewise, reorganize way things are + gimplified. + (declare_return_variable): Update for new inline data datastructure. + (inline_forbidden_p): Work on low gimple. + (estimate_num_insns): Likewise. + (expand_call_inline): Work on CFG. + (push_cfun, pop_cfun): New functions. + (cfun_stack): New stack. + (add_lexical_block): New function. + (gimple_expand_calls_inline): Work on basic block. + (optimize_inline_calls): Likewise. + (clone_body, save_body, unsave_ewpr_now): Update for new + datastructures. + (declare_inline_vars): Work on block instead of bind_expr. + (inlining_p): New predicate. + * tree-inline.h (push_cfun, pop_cfun): Declare. + * tree-optimize.c: Include except.h + (all_lowering_passes): New variable. + (execute_fixup_cfg, pass_fixup_cfg): New pass. + (init_tree_optimization_passes): Move some to all_lowering_passes. + (tree_lowering_passes): New function. + (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. + * tree-pass.h (tree_lowering_passes): Declare + +2005-05-17 Nathan Sidwell + + * unwind-dw2-fde-darwin.c: Include tsystem.h. + +2005-05-17 Jeff Law + + * Makefile.in (tree-ssa-forwprop.o): Depend on langhooks.h. + * tree-ssa-forwprop.c: Include langhooks.h. + (forward_propagate_addr_expr_into_variable_array_index): New. + (forward_propagate_addr_expr): New. + (tree_ssa_forward_propagate_single_use_vars): Loop over all + the statements in the block instead of just the last statement. + Call forward_propagate_addr_expr as needed. + (pass_forwprop): Update the SSA graph after forward propagation is + complete. + +2005-05-17 Nathan Sidwell + + * unwind-dw2-fde-glibc.c (base_from_cb_data, + _Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as + appropriate. + * unwind-dw2-fde.c (__deregister_frame_info_bases, + base_from_object, fde_split, end_fde_sort): Likewise. + * unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op, + execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1, + uw_init_context_1): Likewise. + * unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume, + _Unwind_Resume_or_Rethrow): Likewise. + * unwind-pe.h (__gxx_abort): Do not define. + (size_of_encoded_value, base_of_encoded_value, + read_encoded_value_with_base): Use gcc_unreachable. + * unwind.h (_Unwind_GetTextRelBase): Likewise. + +2005-05-17 Daniel Jacobowitz + + * config/arm/lib1funcs.asm (cfi_pop, cfi_push, cfi_start) + (cfi_end): New macros. + (RETLDM): Use cfi_pop. Expect an eight byte stack frame. + (ARM_LDIV0, THUMB_LDIV0, DIV_FUNC_END): Use CFI macros. Create + an eight byte stack frame. + (__NR_tkill): Define. + (__div0): Use gettid tkill on GNU/Linux. + (_arm_return): Add CFI. + (Lchange_\register, .Lchange_lr): Create an eight byte stack frame. + +2005-05-17 Daniel Jacobowitz + + * configure.ac: Remove spaces around assignment to + gcc_cv_ld_sysroot. + * configure: Regenerated. + +2005-05-17 David Edelsohn + + * config/rs6000/aix.h (TARGET_ALTIVEC_VRSAVE): Delete. + * config/rs6000/rs6000.c (rs6000_explicit_options): Add + aix_struct_ret. + (rs6000_override_options): Do not protect TARGET_ALTIVEC_VRSAVE. + Modify aix_struct_return variable, not target_flags. + (rs6000_handle_option): Do not protect TARGET_ALTIVEC_VRSAVE. + (rs6000_return_in_memory): Test aix_struct_return. + * config/rs6000/rs6000.opt (maix-struct-return): Convert to + independent variable. Report mxl-compat. + +2005-05-17 Bernd Schmidt + + * config/bfin/bfin.md (eh_return): Add missing DONE. + +2005-05-17 Ian Lance Taylor + + * 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. + +2005-05-17 Paolo Bonzini + + * tree-ssa-math-opts.c: New file. + +2005-05-17 Paolo Bonzini + + * Makefile.in: Add tree-ssa-math-opts.c. + * expr.c (expand_expr_real_1) : Never emit as a*(1/b). + * fold-const.c (distribute_real_division): New. + (fold_binary) : Use it. + * tree-pass.h (pass_cse_reciprocals): New. + * tree-optimize.c (init_tree_optimization_passes): Run it. + * doc/passes.texi: Document the new pass. + +2005-05-17 Richard Guenther + + PR middle-end/21595 + * builtins.c (fold_builtin_constant_p): Handle + &"string cst"[0] as constant. + +2005-05-17 Richard Henderson + + * config/i386/sse.md (mulv16qi3, mulv2di3): New. + +2005-05-17 Jakub Jelinek + + PR middle-end/21492 + * cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for + src2 if src2 has been split. + + PR tree-optimization/21610 + * c-typeck.c (decl_constant_value_for_broken_optimization): If not + returning DECL, call unshare_expr. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.md: Unquote preparation and output statements. + (BWD, WD, BW): New, mode-macros. + (S, s, m, mm, nbitsm1): New, mode-attrs. + (szext, shift, shiftrt, ncond, ocond, rcond): New, code-macros. + (u, su, shlr, slr, ncond, ocond, rcond, rCC, oCC, roCC): New, + code-attrs. + ("tst"): Replace "tstqi", "tsthi" and "tstsi". + ("*cmp_ext"): Replace "*cmp_extsi" and "*cmp_exthi". + ("*cmp_swapext"): Replace "*cmp_swapextqi" and + "*cmp_swapexthi". + ("cmp"): Replace "cmphi" and "cmpqi". + ("movdi"): Move misplaced head comment regarding necessity of + movdi from movsi to here. + ("*mov_side_biap"): Replace "*mov_sideqi_biap" and + "*mov_sidehi_biap". + ("*mov_side"): Replace "*mov_sideqi" and "*mov_sidehi". + ("*mov_side_biap_mem", "*mov_sidehi_biap_mem"): Replace + "*mov_sideqi_biap_mem". + ("*mov_side_mem"): Replace "*mov_sideqi_mem" and + "*mov_sidehi_mem". + ("*clear_side_biap"): Replace "*clear_sidesi_biap", + "*clear_sidehi_biap" and "*clear_sideqi_biap". + ("*clear_side"): Replace "*clear_sidesi", "*clear_sidehi" + and "*clear_sideqi". + ("*ext_sidesi_biap"): Replace "*ext_sideqisi_biap" and + "*ext_sidehisi_biap". + ("*ext_sidesi"): Replace "*ext_sideqisi" and + "*ext_sidehisi". + ("reload_in"): Replace "reload_inhi" and "reload_inqi". + ("reload_out"): Replace "reload_outhi" and "reload_outqi". + ("extenddi2"): Replace "extendhidi2" and "extendqidi2". + ("extendsi2"): Replace "extendhisi2" and "extendqisi2". + ("zero_extendsi2"): Replace "zero_extendhisi2" and + "zero_extendqisi2". + ("*op_side_biap"): Replace "*op_sideqi_biap", + "*op_sidehi_biap" and "*op_sidesi_biap". + ("*op_side"): Replace "*op_sideqi", "*op_sidehi" and + "*op_sidesi". + ("*op_swap_side_biap"): Replace "*op_swap_sideqi_biap", + "*op_swap_sidehi_biap" and "*op_swap_sidesi_biap". + ("*op_swap_side"): Replace "*op_swap_sideqi", + "*op_swap_sidehi" and "*op_swap_sidesi". + ("sub3"): Replace "subhi3" and "subqi3", correcting a typo + in the N alternative of "subqi3". + ("*extopsi_side_biap"): Replace "*extopqisi_side_biap" and + "*extophisi_side_biap". + ("*extopsi_side"): Replace "*extopqisi_side" and + "*extophisi_side". + ("*extopsi_swap_side_biap"): Replace + "*extopqisi_swap_side_biap" and "*extophisi_swap_side_biap". + ("*extopsi_swap_side"): Replace "*extopqisi_swap_side" and + "*extophisi_swap_side". + ("*extopsi"): Replace "*extopqisi" and "*extophisi". + ("*extopsi_swap"): Replace "*extopqisi_swap" and + "*extophisi_swap". + ("mul3"): Replace "umulhisi3", "umulqihi3", + "mulqihi3", "mulhisi3" and "mulhisi3". + ("mulsidi3"): Replace "mulsidi3" and "umulsidi3". + ("mulsi3_highpart"): Replace "smulsi3_highpart" and + "umulsi3_highpart". + ("xor3"): Replace "xorhi3" and "xorqi3". + ("neg2"): Replace "negsi2", "neghi2" and "negqi2". + ("one_cmpl2"): Replace "one_cmplhi2" and "one_cmplqi2". + ("si3"): Replace "ashrsi3", "lshrsi3" and "ashlsi3". + ("ashr3"): Replace "ashrhi3" and "ashrqi3". + ("*expanded_"): Replace "*expanded_ashrhi", + "*expanded_ashrqi", "*expanded_lshrhi" and "*expanded_lshrqi". + ("*_lowpart"): Replace "*ashrhi_lowpart", + "*ashrqi_lowpart", "*lshrhi_lowpart" and "*lshrqi_lowpart". + ("lshr3"): Replace "lshrhi3" and "lshrqi3". + ("ashl3"): Replace "ashlhi3" and "ashlqi3". + ("*ashl_lowpart"): Replace "*ashlqi_lowpart" and + "*ashlhi_lowpart". + ("abs2"): Replace "abshi2" and "absqi2". + ("b"): Replace "beq", "bne", "bgtu", "bltu", "bgeu" and + "bleu". + ("b"): Replace "bgt" and "ble". + ("b"): Replace "blt" and "bge". + ("*b_reversed"): Replace "*beq_reversed", "*bne_reversed", + "*bgtu_reversed", "*bltu_reversed", "*bgeu_reversed" and + "*bleu_reversed". + ("*b_reversed"): Replace "*bgt_reversed" and + "*ble_reversed". + ("*b_reversed"): Replace "*blt_reversed" and + "*blt_reversed". + ("s"): Replace "sgeu", "sltu", "seq", "sgtu", "sleu" and + "sne". + ("s"): Replace "sge" and "slt". + ("s"): Replace "sgt" and "sle". + ("clear.[bwd] [rx=rx+rz.S2]"): Replace split clear.d + [rx=rx+rz.S2], clear.w [rx=rx+rz.S2] and clear.b [rx=rx+rz.S2]. + ("clear.[bwd] [rx=rx+i]"): Replace splits clear.d [rx=rx+i], + clear.w [rx=rx+i] and clear.b [rx=rx+i]. + +2005-05-17 Jakub Jelinek + + * 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. + +2005-05-16 Richard Henderson + + * config/i386/sse.md (mulv4si3): New. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.h (EXTRA_CONSTRAINT_T): Remove FIXME and + tests for noncanonical versions of reg+constant and + reg+reg*{1,2,4}. + +2005-05-16 Richard Henderson + Steven Bosscher + + PR tree-opt/21399 + * tree-eh.c (maybe_clean_or_replace_eh_stmt): Rename from + maybe_clean_eh_stmt; take old stmt parameter. Update EH + region data structure to match replacement. + * tree-flow.h: Update to match. + * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. + * tree-ssa-dom.c (optimize_stmt): Likewise. + * tree-ssa-pre.c (eliminate): Likewise. + * tree-ssa-propagate.c (substitute_and_fold): Likewise. + +2005-05-16 Caroline Tice + + * 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. + +2005-05-16 Roger Sayle + + * 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. + +2005-05-16 Kazu Hirata + + * tree-ssa-pre.c: Fix a comment typo. + +2005-05-16 Richard Henderson + + PR target/21556 + * config/ia64/ia64.md (load_dtpmod, load_ltoff_dtpmod, load_dtprel, + load_dtprel64, load_dtprel22, load_dtprel_gd, load_ltoff_dtprel, + add_dtprel, add_dtprel14, add_dtprel22, load_tprel, load_tprel64, + load_tprel22, load_tprel_ie, load_ltoff_tprel, add_tprel, add_tprel14, + add_tprel22): Remove mode from symbolic operand. + +2005-05-16 Richard Sandiford + + * optc-gen.awk: Include intl.h after the externally-provided files. + +2005-05-16 Kazu Hirata + + * tree-ssa-copy.c (copy_prop_visit_assignment): Clean up by + folding a COND_EXPR_COND in a nondestructive manner. + +2005-05-16 Fariborz Jahanian + + * config/rs6000/altivec.md (altivec_vmrghb, altivec_vmrghh, + altivec_vmrghw, altivec_vmrglb, altivec_vmrglh, altivec_vmrglw): + New values for vec_select definitions and bitmask for element + selection. + +2005-05-16 Kazu Hirata + + * 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. + + * 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)*. + +2005-05-16 Richard Sandiford + + * 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. + +2005-05-16 Paolo Bonzini + + * tree-inline.c (estimate_num_insns_1): Handle VEC_COND_EXPR. + +2005-05-15 Roger Sayle + + * 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. + +2005-05-15 H.J. Lu + + PR target/21551 + * config/ia64/ia64.c (ia64_expand_move): Don't add addend twice. + +2005-05-15 Daniel Berlin + + 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. + +2005-05-15 Richard Earnshaw + + * arm.c (thumb_unexpanded_epilogue): Delete unused variable 'mode'. + +2005-05-15 Andreas Jaeger + + * gcc.c (pfatal_pexecute): Remove unused local function. + +2005-05-15 Richard Sandiford + + * optc-gen.awk: Remove excess indentation. + * opth-gen.awk: Likewise. + +2005-05-14 Kaz Kojima + + * 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. + +2005-05-14 Kazu Hirata + + * tree-optimize.c (init_tree_optimization_passes): Move + pass_cd_dce in place of the last pass_dce. + + 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. + +2005-05-14 Nathan Sidwell + Jan-Benedict Glaw + + * config/vax/vax.c: (print_operand_address) Use gcc_unreachable() and + gcc_assert(). + (rev_cond_name) Likewise. + (vax_float_literal) Likewise. + * config/vax/vax.md: Likewise. + +2005-05-14 Jan-Benedict Glaw + + * 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. + + * config/vax/vax.c: (override_options) Remove 'register' keyword. + (split_quadword_operands) Likewise. (rev_cond_name) Likewise. + (vax_float_literal) Likewise. (vax_rtx_costs) Remove trailing + whitespace. + * config/vax/vax.h: Remove 'register' keyword. Misc. whitespace fixes, + mostly removal of trailing spaces... + * config/vax/vax-modes.def: Remove trailing whitespace. + + * config/vax/elf.h: Update whitespace. + +2005-05-14 Richard Guenther + + Revert + 2005-05-11 Richard Guenther + * fold-const.c (fold_indirect_ref_1): Avoid removing + NOP_EXPRs with type qualifiers like const. + +2005-05-14 Jan Hubicka + + Patch by Richard Henderson: + * tree-eh.c (tree_can_throw_internal, tree_can_throw_external): + Handle RESX expressions properly. + + * tree-eh.c (record_stmt_eh_region): Use add_stmt_to_eh_region. + (add_stmt_to_eh_region_fn): Nest into CALL_EXPR. + (remove_stmt_from_eh_region_fn): Likewise. + + * 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. + +2005-05-14 Kazu Hirata + + * 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. + +2005-05-14 Richard Guenther + + * fold-const.c (div_if_zero_remainder): New function. + (try_move_mult_to_index): Use it. + +2005-05-14 Kazu Hirata + + * 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. + +2005-05-14 Hans-Peter Nilsson + + * config/cris/cris.h (Node: Register Classes): Remove obsoleted + comment regarding defined register classes. + (LEGITIMIZE_RELOAD_ADDRESS): Do not define. + +2005-05-14 Kazu Hirata + + * tree-optimize.c (init_tree_optimization_passes): Move + pass_merge_phi before the first pass_dominator. + +2005-05-13 Richard Earnshaw + + * arm.h (INITIALIZE_TRAMPOLINE): Make the call to __clear_cache + unconditional. + +2005-05-13 Josh Conner + + * 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. + +2005-05-11 Aldy Hernandez + + * config/rs6000/sysv4.opt (mlittle): Handle. + + * config/rs6000/rs6000.c (rs6000_handle_option): Set + target_flags_explicit when appropriate. + +2005-05-13 J"orn Rennecke + + PR middle-end/20714: + * optabs.c (no_conflict_data): New struct. + (no_conflict_move_test): New function. + (emit_no_conflict_block): Use it. + +2005-05-13 Adam Nemet + + * doc/invoke.texi (Debugging Options): Option + -fdump-translation-unit only works with C++ now. + +2005-05-13 Hans-Peter Nilsson + + Replace calls to abort in CRIS port. + * 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. + ("call", "call_value"): Ditto, but use gcc_assert where + appropriate. Tweak comments. + * config/cris/cris.c (ASSERT_PLT_UNSPEC): Define in terms of + CRIS_ASSERT. + (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. + +2005-05-13 J"orn Rennecke + + PR rtl-optimization/20769: + * bt-load.c (compute_defs_uses_and_gen): Check for the blockage + pattern emitted by expand_nl_goto_receiver. + + PR middle-end/20793: + * integrate.c (allocate_initial_values): Update register liveness + information. + +2005-05-13 Josh Conner + + * arm.c (arm_return_in_memory): Add handling for vector return types. + +2005-05-13 David Ung + + * config/mips/mips.h (processor_type): Add new PROCESSOR_4KP + name. + * config/mips/mips.c: Add 4km alias. + * config/mips/mips.md: Add 4kp to cpu attrib and include 4k.md. + * config/mips/4k.md: New file, add 4Kc/4Kp DFA pipeline + description. + +2005-05-13 Jan Hubicka + + * c-decl.c (finish_function): Suppress "control reaches end of + non-void function" when "no return statement in function + returning non-void" is issued. + + * tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs. + * tree-optimize.c (pass_gimple): Kill. + (init_tree_optimization_passes): Kill pass_gimple. + * tree-cfg.c (build_tree_cfg): Do verify_stmts to check that we are gimple. + * tree-dump.c (dump_files): Rename .generic to .gimple.* + +2005-05-13 J"orn Rennecke + + PR rtl-optimization/20756: + * basic-block.h (PROP_DEAD_INSN): Define. + * flow.c (propagate_one_insn): Set during mark_set_regs call + for a dead insn. + (mark_set_1): Emit a clobber when we are about to delete a dead insn + that kills a live register. + +2005-05-13 Adrian Straetling + + * config/s390/s390.md: ("DBL"): New mode attribute. + ("*movmem_long_64", "*movmem_long_31"): Merge to "*movmem_long". + ("*clrmem_long_64", "*clrmem_long_31"): Merge to "*clrmem_long". + ("*cmpmem_long_64", "*cmpmem_long_31"): Merge to "*cmpmem_long". + +2005-05-13 Richard Guenther + + * c-format.c (check_format_arg): Handle string literals of + the form &"string"[offset]. + + * g++.dg/warn/format4.C: New testcase. + +2005-05-13 Kazu Hirata + + * config/mips/3000.md, config/mips/4000.md, + config/mips/4100.md, config/mips/4300.md, config/mips/4600.md, + config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, + config/mips/generic.md, config/pdp11/pdp11.md, + config/sh/crt1.asm, config/sh/lib1funcs.asm, + config/sh/sh-modes.def, config/sh/sh-protos.h, + config/sh/shmedia.md, config/sh/ushmedia.h: Update copyright. + +2005-05-13 Richard Henderson + + * function.c (instantiate_virtual_regs_in_insn): Do not simplify + addition to move unless dest is a register. Do not skip + instantiation in dest on addition simplification. + +2005-05-13 Hans-Peter Nilsson + + * config/cris/cris.c (cris_print_operand) : Use operand_subword and HOST_WIDE_INT_PRINT_DEC for + output; don't have special case for HOST_BITS_PER_WIDE_INT == 32. + +2005-05-13 Jan Hubicka + + * basic-block.h (FOR_ALL_BB_FN): New macro. + (init_flow): Initialize cfg structure. + * function.c (allocate_struct_function): Do not initialize cfg structure. + * tree-cfg.c (init_empty_tree_cfg): Break out from ... + (build_tree_cfg): ... here. + * tree-flow.h (init_empty_tree_cfg): Declare. + +2005-05-12 Steven Bosscher + + Fix PR tree-optimization/21520 + * tree-ssa-pre.c (phi_translate): Use fully_constant_expression + to attempt to fold constants. + +2005-05-12 Kaz Kojima + + * config/sh/sh.c: Declare the prototype of sh_adjust_unroll_max + only when TARGET_ADJUST_UNROLL_MAX is defined. + (general_movsrc_operand): Use the C style comment. + (ua_offset): Use prototype. + +2005-05-12 Zdenek Dvorak + + * tree-ssa-loop-im.c (struct mem_ref): Add field "next". + (struct hmr_data, hoist_memory_reference, memref_del, + struct fmrv_data): Removed. + (hoist_memory_references, free_mem_ref, free_mem_refs): New functions. + (gather_mem_refs, gather_mem_refs_stmt): Add new references to the + list. + (find_more_ref_vops): Traverse the list of memory references. + (determine_lsm_loop): Work with the list of memory references instead + of traversing the hashtable. + +2005-05-12 Steven Bosscher + Stuart Hastings + Jan Hubicka + + * except.c (duplicate_eh_region_1, duplicate_eh_region_2, + duplicate_eh_regions): New functions, based on old + implementation removed with RTL inliner. + (reachable_next_level): Modify behaviour pre-inline. + * except.h (duplicate_eh_regions_map, duplicate_eh_regions): + Declare. + * function.h (struct function): Add after_inlining flag. + * tree-optimize.c (tree_rest_of_compilation): Set it. + * tree-eh.c (add_stmt_to_eh_region_fn): Initialize hashtable + when needed. + * tree-cfg.c (label_to_block_fn): Deal with cases where + label was never insterted into code. + +2005-05-12 Zack Weinberg + + * doc/cpp.texi: Document that #sccs is a synonym for #ident. + +2005-05-12 Daniel Berlin + + Fix PR tree-optimization/21532 + * tree-ssa-pre.c (create_expression_by_pieces): stmt + needs to go onto the inserted_exprs list. + +2005-05-12 Ian Lance Taylor + + * c-common.h (statement_code_p): Don't declare. + (STATEMENT_CODE_P): Don't define. + (INIT_STATEMENT_CODES): Don't define. + * c-common.c (statement_code_p): Don't define. + +2005-05-12 Eric Botcazou + + * config/sparc/sparc.h: Remove dead code. + * config/sparc/sparc.c (sparc_compute_frame_size): Use + FIRST_PARM_OFFSET for the size of the register window area. + (emit_save_regs): Rename into emit_save_or_restore_regs. + Add 'action' parameter. Use 4095 as upper bound for the offset. + Pass 'action' to save_or_restore_regs. + (emit_restore_regs): Delete. + (sparc_expand_prologue): Call emit_save_or_restore_regs. + (sparc_expand_epilogue): Likewise. + * config/sparc/sparc.md (mode macro P): Move. + (movdi_insn_sp32_v9, movdi_insn_sp32): Swap. + (mov expander): Move to the top of the V32 section. + (movdf_insn_sp32_v9_no_fpu, movdf_insn_sp32_v9): Swap. + (movtf_insn_sp64_hq, movtf_insn_sp64): Swap. + (sibcall_epilogue): Move. + +2005-05-12 Richard Earnshaw + + PR target/21501 + * arm.c (arm_gen_constant): Sign-extend intermediate values when + synthesizing a constant of the difference of two immediates. + +2005-05-12 Richard Earnshaw + + * arm/vfp.md (negsf2_vfp): Add alternative using integer registers. + (negdf2_vfp): Likewise. Convert to define_insn_and_split and split + the alternatives using integer registers into the appropriate + primitives. + +2005-05-11 Kenneth Zadeck + + * bitmap.c (bitmap_elmt_to_freelist, bitmap_element_allocate, + bitmap_elt_clear_from, bitmap_clear): Changed freelist structure. + * bitmap.h: Fixed comments. + +2005-05-11 Richard Henderson + + PR target/21412 + * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. + (ia64_cannot_force_const_mem): New. + (tls_symbolic_operand_type): New. + (ia64_legitimate_constant_p): New. + (ia64_expand_load_address): Return true on success. Improve + checks for when we should not split. + (ia64_expand_tls_address): New addend operand. Distribute it + as appropriate to the tls_kind. Delay referencing gp. + (ia64_expand_move): Split symbolic addend as necessary. Handle + tls symbols with addends. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, + p0, f0, f1, and r13. + (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. + * config/ia64/ia64.md (UNSPEC_DTPMOD): New. + (symbolic_operand splitter): Pass everything through + ia64_expand_load_address and FAIL or DONE as appropriate. + (load_fptr): Only accept after reload. + (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, + load_symptr_low, load_ltoff_dtpmod, + (load_dtpmod): New. + (load_dtprel): Only accept tls symbols. + (load_dtprel64, load_dtprel22): Likewise. + (load_tprel, load_tprel64, load_tprel22): Likewise. + (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. + (add_dtprel): Only accept tls symbols. Canonicalize PLUS. + (add_dtprel14, add_dtprel22): Likewise. + (add_tprel, add_tprel14, add_tprel22): Likewise. + * config/ia64/predicates.md (small_addr_symbolic_operand): New. + (any_offset_symbol_operand, aligned_offset_symbol_operand): New. + (got_symbolic_operand): Check CONST offsets. + (tls_symbolic_operand, ld_tls_symbolic_operand): New. + (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. + (move_operand): Don't handle tls here. Check CONST offsets. + +2005-05-11 Richard Sandiford + + * config/mips/7000.md (rm7_impy_si_mult): Just match imul and imadd. + Remove hilo_operand check. + (rm7_impy_si_mul): Just match imul3. Remove hilo_operand check. + * config/mips/predicates.md (hilo_operand): Delete. + +2005-05-11 Richard Sandiford + + * config/mips/sr71k.md, config/mips/7000.md: Reformat. + +2005-05-11 Kazu Hirata + + PR tree-optimizer/18472 + * tree-if-conv.c (tree_if_convert_stmt, + if_convertible_modify_expr_p): Don't handle GOTO_EXPR. + +2005-05-11 Jan Hubicka + + * Makefile.in (tree-eh.o: Kill gt-tree-eh.h dependency. + (GTFILES): add except.h. + * except.c (eh_status): Add throw_stmt_table. + (set_eh_throw_stmt_table, get_eh_throw_stmt_table): New functions. + * except.h (add_stmt_to_eh_region_fn, remove_stmt_from_eh_region_fn, + lookup_stmt_eh_region_fn): Declare. + (throw_stmt_node): New structure. + (set_eh_throw_stmt_table, get_eh_throw_stmt_table): New. + * gengtype.c (open_base_files): Add except.h to inlines. + * tree-eh.c (throw_stmt_node): Kill. + (record_stmt_eh_region): Update. + (add_stmt_to_eh_region_fn): Break out from ... + (add_stmt_to_eh_region): ... here. + (remove_stmt_from_eh_region_fn): Break out from ... + (remove_stmt_from_eh_region): ... here. + (lookup_stmt_eh_region_fn): Break out from ... + (lookup_stmt_eh_region): ... here. + (honor_protect_cleanup_actions): Use build_resx. + (lower_try_finally_onedest): Likewise. + (lower_try_finally_copy): Likewise. + (lower_try_finally_switch): Likewise. + (lower_eh_constructs): Update eh table construction. + * tree.c (build_resx): New. + * tree.h (build_resx): Declare. + +2005-05-11 H.J. Lu + + * libgcov.c (gcov_exit): Set prefix_length to 0 if no relocation + is needed. + +2005-05-11 Kazu Hirata + + * fold-const.c, libgcov.c: Fix comment typos. + + * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove + redundant code. + +2005-05-11 Daniel Jacobowitz + + * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Define. + * config/arm/arm.h (SUBTARGET_FRAME_POINTER_REQUIRED): Provide + default definition. + (FRAME_POINTER_REQUIRED): Use SUBTARGET_FRAME_POINTER_REQUIRED. + +2005-05-11 Nathan Sidwell + + PR bootstrap/21481 + * crtstuff.c: Include auto-host.h again, for now. + +2005-05-11 Richard Sandiford + + * config/mips/24k.md: Remove trailing whitespace. + +2005-05-11 David Ung + + * config/mips/mips.md (type): Add imul3. + (length, hazard, may_clobber_hilo): Check for imul3. + (mulsi3_mult3, muldi3_mult3, *muls, mulsi3_highpart_mulhi_internal) + (*mulsi3_highpart_neg_mulhi_internal): Set attr to imul3. + * config/mips/24k.md (r24k_int_mul3): Enable this reservation + for a 3 operand mul and its bypasses. + * config/mips/3000.md (r3k_imul): Add imul3 to reservations. + * config/mips/4000.md (r4k_imul): Likewise. + * config/mips/4100.md (r4100_imul_si, r4100_imul_di): Likewise. + * config/mips/4130.md (vr4130_class, vr4130_mulsi) + (vr4130_muldi): Likewise. + * config/mips/4300.md (r4300_imul_si, r4300_imul_di): Likewise. + * config/mips/4600.md (r4600_imul, r4650_imul): Likewise. + * config/mips/5000.md (r5k_imul_si, r5k_imul_di): Likewise. + * config/mips/5400.md (ir_vr54_imul_si, ir_vr54_imul_di) + (ir_vr54_imadd_si): Likewise. + * config/mips/5500.md (ir_vr55_imul_si, ir_vr55_imul_di): Likewise. + * config/mips/7000.md (rm7_impy_si_mult, rm7_impy_si_mul) + (rm7_impy_di): Likewise. + * config/mips/9000.md (rm9k_mulsi, rm9k_muldi): Likewise. + * config/mips/generic.md (generic_imul): Likewise. + * config/mips/sb1.md (ir_sb1_mulsi, ir_sb1_muldi): Likewise. + * config/mips/sr71k.md (ir_sr70_imul_si, ir_sr70_imul_di): Likewise. + +2005-05-11 J"orn Rennecke + + PR middle-end/20371: + * tree.h (record_layout_info_s): New member prev_packed. + * stor-layout.c (update_alignment_for_field): Fix comment about + KNOWN_ALIGN. For MS bitfields, if we start a new run, make sure + we start it properly aligned. + (place_field): At the beginning of a record, pass 0 as KNOWN_ALIGN + to update_alignment_for_field, and recompute it afterwards using + the alignment of the record. + When a packed bitfield precedes an MS bitfield, don't add padding + at the end of the packed bitfield on behalf of the base type of + the packed bit field. + Don't adjust rli->bitpos at the end + of an MS bitfield run if we already adjusted bitpos/offset for an + alignment as large or larger than the bitfield type size. + Take possible record alignment > BIGGEST_ALIGNMENT into account + when calculating actual_align. + Only put packed buit fields into rli->prev_field if they end up + suitably aligned. + Also set rli->remaining_in_alignment when we re-set rli->prev_field. + Update rli->remaining_in_alignment when we have already started a + run of bit fields and we process a packed bit field. + +2005-05-11 Sebastian Pop + + * tree-data-ref.c (find_data_references_in_loop): Give up when + the body of the loop contains a CALL_EXPR or an ASM_EXPR: they + may embed arbitrary side effects. + Remove the assumption that GIMPLE form contains a single array + access per statement. + When the statement contains virtual operands, fail if it is not + a MODIFY_EXPR or a CALL_EXPR. + Return after the dont know node is inserted. + +2005-05-11 Richard Earnshaw + + * arm.md (negsf2, negdf2): Permit these expands when compiling for VFP. + +2005-05-11 Richard Guenther + + PR middle-end/19807 + PR tree-optimization/19639 + * fold-const.c (try_move_mult_to_index): Handle INTEGER_CST + and generic summands for char* as s * delta, too, folding &a[i] + CODE x to &a[i CODE x/s]. Use tree_int_cst_equal + for comparison of steps. Convert types for index addition. + (fold_binary): Adjust the callers to always dispatch to + try_move_mult_to_index. + * tree-ssa-propagate.c (set_rhs): Avoid setting rhs to + expr with non-gimple ARRAY_REF offset. + +2005-05-11 Richard Guenther + + * fold-const.c (fold_indirect_ref_1): Avoid removing + NOP_EXPRs with type qualifiers like const. + +2005-05-11 Richard Henderson + + PR c/21502 + * c-decl.c (finish_decl): Propagate the completed array type of + a global variable into the binding. + +2005-05-10 Matt Kraai + + * Makefile.in (gtype-desc.o, build/genautomata.o) + (build/varray.o): Depend on $(VARRAY_H). + +2005-05-10 Diego Novillo + + * tree-optimize.c (init_tree_optimization_passes): Re-organize + optimization passes to do an initial batch of scalar cleanups. + +2005-05-10 Ian Lance Taylor + + * read-rtl.c (struct macro_traverse_data): Define. + (map_attr_string): New static function, broken out of + apply_macro_to_string. + (mode_attr_index, apply_mode_maps): New static functions. + (apply_macro_to_string): Call map_attr_string. + (apply_macro_to_rtx): Add mode_maps and infile parameters. Change + all callers. + (apply_macro_traverse): Expect data to point to a struct + macro_traverse_data. + (read_rtx): Add mode_maps local variable. Use mode_traverse_data + to pass data through htab_traverse. + (read_rtx_1): Add mode_maps parameter. Change all callers. + Handle mode names which are attribute strings. + * doc/md.texi (Substitutions): Rename from String Substitutions. + Change references. Document using attributes as modes. + +2005-05-10 Zdenek Dvorak + + * tree-cfg.c (tree_duplicate_sese_region): Update profile. + * tree-optimize.c (init_tree_optimization_passes) Swap + pass_ch and pass_profile. + * tree-ssa-loop-ch.c (copy_loop_headers): Do not update profile + here. Remove rewrite_into_loop_closed_ssa call. + +2005-05-10 Adrian Straetling + + * config/s390/s390.c: (s390_const_double_ok_for_constraint_p): New + function. + (legitimate_reload_constant_p): Add check for const double zero. + * config/s390/s390.md: Add comment for constraint letter 'G'. + ("*movdf_64", "*movdf_31", "movsf"): Add constraint and proper + attributes for new case. + * config/s390/s390.h: (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Define it as + s390_const_double_ok_for_constraint_p. + * config/s390/s390-protos.h (s390_const_double_ok_for_constraint_p): + Add prototype. + +2005-05-10 Kazu Hirata + + PR tree-optimization/21170 + * tree-ssa-dom.c, tree-ssa-threadupdate.c: Replace + rewrite_ssa_into_ssa in comments with update_ssa. + +2005-05-10 Zdenek Dvorak + + * tree-ssa-loop-im.c: Include hashtab.h. + (struct mem_ref_loc): New. + (struct mem_ref): Describe the set of references with the same + shape. + (max_stmt_uid, get_stmt_uid, record_mem_ref, free_mem_refs, + maybe_queue_var, fem_single_reachable_address, + for_each_memref, single_reachable_address, + is_call_clobbered_ref, determine_lsm_reg): Removed. + (record_mem_ref_loc, free_mem_ref_locs, determine_lsm_ref, + hoist_memory_reference, memref_hash, memref_eq, memref_del, + gather_mem_refs_stmt, gather_mem_refs, find_more_ref_vops): + New functions. + (rewrite_mem_refs, schedule_sm): Use mem_ref_loc list. + (determine_lsm_loop): Rewritten. + (determine_lsm): Do not set stmt uids. + +2005-05-10 Adrian Straetling + + * config/s390/s390.md: Add comment lines for 'f' and 't' constraint + letters. + +2005-05-10 Adrian Straetling + + * config/s390/s390.md: ("anddi3","andsi3","andhi3","andqi3"): Merge. + ("iordi3", "iorsi3", "iorhi3", "iorqi3"): Merge. + ("xordi3", "xorsi3", "xorhi3", "xorqi3"): Merge. + +2005-05-10 Jeff Law + + * tree-ssa-dom.c (dom_opt_finalize_block): Do not call + thread_across_edge for any abnormal edges. + +2005-05-10 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_atomic_op): New. + * config/ia64/ia64-protos.h: Declare it. + * config/ia64/sync.md (I124MODE, FETCHOP, fetchop_name): New. + (sync_add, sync_old_add): Remove. + (sync_, sync_nand): New. + (sync_old_, sync_old_nand): New. + (sync_new_, sync_new_nand): New. + (cmpxchg_rel_): Split from cmpxchg_acq_. Zero + extend result; use release semantics. + (cmpxchg_rel_di): Rename from cmpxchg_acq_; use release. + (sync_val_compare_and_swap_): Update to match. + +2005-05-10 Richard Henderson + + * optabs.c (expand_compare_and_swap_loop): Don't clobber old value + before comparing it for success. + +2005-05-10 Richard Henderson + + * config/ia64/sync.md (sync_add): Fix arguments for + no return value pattern. + +2005-05-10 Grigory Zagorodnev + H.J. Lu + + * libgcov.c (create_file_directory): New function. Create + directory for the given file name. + (gcov_max_filename): New static var. Keeps size of the longest + file name. + (gcov_exit): Always try to create directory for output + file. Relocate each filename basing on environment vars. + (__gcov_init): Remember the longest file name. + * tsystem.h: include filenames.h to get IS_DIR_SEPARATOR + * doc/gcov.texi (Cross-profiling): New node documenting + cross-profiling management. + * doc/invoke.texi (-fprofile-arcs): Add xref to cross-profiling. + +2005-05-10 Eric Botcazou + + * config/sparc/sparc.c (mem_min_alignment): Do not rely + on MEM_ALIGN if TARGET_UNALIGNED_DOUBLES. + +2005-05-10 Bob Wilson + + * config/xtensa/lib1funcs.asm (__udivsi3, __divsi3): Rearrange special + case code to avoid one move instruction. + (__umodsi3, __modsi3): Merge duplicated code sequences. + +2005-05-10 Kazu Hirata + + * config/mips/24k.md, config/sh/divtab.c, config/sh/sh.c, + config/sh/sh.md, config/sh/superh.h: Fix comment typos. + * doc/invoke.texi: Fix typos. + + * tree-data-ref.c (analyze_array_indexes, analyze_array, + init_data_ref, access_functions_are_affine_or_constant_p, + free_data_refs): Use VEC instead of VARRAY. + * tree-data-ref.h (data_reference): Change the type of + access_fns to VEC(tree,gc)*. + (DR_ACCESS_FN, DR_NUM_DIMENSIONS): Use VEC instead of VARRAY. + +2005-05-10 Gabor Loki + + PR c/17913 + * c-typeck.c (build_conditional_expr): Remove reducing cond_expr. + * fold-const.c (fold): Expand the condition of reducing cond_expr. + (contains_label_1, contains_label_p): New functions for checking + labels in a sub-tree. + +2005-05-10 Joseph S. Myers + + PR c/21342 + * c-decl.c (pushdecl): When there is a declaration in the current + scope and the declarations are external linkage, check for + compatibility with the type in the external scope and update the + type in the external scope with the composite type information. + Do not form a composite type of the new type and the visible type + if they are incompatible. + +2005-05-10 Nathan Sidwell + + * crtstuff.c: Revert part of 2005-05-08 Change. + (IN_LIBGCC2): Define. + +2005-05-10 Eric Botcazou + + * config/sparc/sparc.c (fp_sethi_p): Test !SPARC_SIMM13_P and + remove redundant test. + (fp_mov_p): Accept 0. + (fp_high_losum_p): Remove redundant test. + * config/sparc/predicates.md (const_high_operand): Explicitly test + (not small_int_operand). + (fp_const_high_losum_operand): New. + * config/sparc/sparc.md (movsi_insn): Do not emit 'clr'. Reorder. + (movdi_insn_sp32_v9): Use canonical predicates. + (movdi_insn_sp32): Test !TARGET_V9 instead of !TARGET_ARCH64. + (movdi_insn_sp64_novis): Delete. + (movdi_insn_sp64_vis): Rename into movdi_insn_sp64. + (movsf_insn_novis): Delete. + (movsf_insn_vis): Rename into movsf_insn. + (movsf_no_f_insn): Rename into movsf_insn_no_fpu. + (movsf_lo_sum): Use fp_const_high_losum_operand. + (movsf_high): Likewise. + (movsf_high_losum splitter): Likewise. + (mov expander): Use register_or_zero_operand. + (mov expander): Likewise. + (movdf_insn_sp32): Use register_or_zero_operand. + (movdf_no_e_insn_sp32): Use register_or_zero_operand. + Rename into movdf_insn_sp32_no_fpu. + (movdf_no_e_insn_v9_sp32): Use register_or_zero_operand. + Rename into movdf_insn_sp32_v9_no_fpu. + (movdf_insn_v9only_novis): Delete. + (movdf_insn_v9only_vis): Rename into movdf_insn_sp32_v9. + (movdf_insn_sp64_novis): Delete. + (movdf_insn_sp64_vis): Rename into movdf_insn_sp64. + (movdf_no_e_insn_sp64): Use register_or_zero_operand. + Rename into movdf_insn_sp64_no_fpu. + (movtf expander): Use register_or_zero_operand. + (movtf_insn_sp32): Delete. + (movtf_insn_vis_sp32): Use register_or_zero_operand. + Rename into movtf_insn_sp32. + (movtf_no_e_insn_sp32): Use register_or_zero_operand. + Rename into movtf_insn_sp32_no_fpu. + (movtf_insn_hq_sp64): Delete. + (movtf_insn_hq_vis_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64_hq. + (movtf_insn_sp64): Delete. + (movtf_insn_vis_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64. + (movtf_no_e_insn_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64_no_fpu. + +2005-05-10 Nathan Sidwell + + * config/stormy16/stormy16.c (xstormy16_emit_cbranch): Use + gcc_assert and gcc_unreachable as appropriate. + (xstormy16_split_cbranch, xstormy16_output_cbranch_hi, + xstormy16_output_cbranch_si, xstormy16_split_move, + xstormy16_initial_elimination_offset, + xstormy16_encode_section_info, xstormy16_print_operand_address, + xstormy16_expand_call, xstormy16_expand_arith, + xstormy16_output_shift, xstormy16_init_builtins): Likewise. + +2005-05-10 Kazu Hirata + + * tree-outof-ssa.c (_elim_graph): Change the type of nodes and + const_copies to VEC(tree,heap)*. + (new_elim_graph, delete_elim_graph, elim_graph_size, + elim_graph_add_node, eliminate_build, eliminate_phi): Use VEC + instead of VARRAY. + +2005-05-10 Joseph S. Myers + + PR other/21052 + * doc/extend.texi (Type Attributes): Correct example syntax. + +2005-05-09 Joseph S. Myers + + PR c/21160 + * doc/invoke.texi (-Wuninitialized): Update documentation. + +2005-05-09 Richard Earnshaw + + * arm.c (const_ok_for_arm): Use a faster algorithm. + +2005-05-09 David Edelsohn + + PR target/21477 + * config/rs6000/rs6000.md (add_op2): New. + (add3): Use it. + +2005-05-09 Richard Earnshaw + + * arm.c (arm_gen_constant): Add new heuristic for generating + constant integers that can be expressed as the difference of two + valid immediates. + +2005-05-09 Roger Sayle + + * c-tree.h (parser_build_unary_op): New prototype. + * c-typeck.c (parser_build_unary_op): New function to construct + a unary operation in the C parser. + * c-parser.c (c_parser_unary_expression): Use the new function + parser_build_unary_op when appropriate. + +2005-05-09 Mark Mitchell + + PR 18655 + * dwarf2out.c (output_call_frame_info): Use DWARF2_FRAME_REG_OUT + before outputting DWARF_FRAME_RETURN_COLUMN. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_branch_condition_mask, + s390_branch_condition_mnemonic, s390_extra_constraint_str, + s390_const_ok_for_constraint_p, s390_expand_plus_operand, + legitimize_pic_address, s390_emit_tls_call_insn, + legitimize_tls_address, legitimize_tls_address, + s390_expand_addcc, print_shift_count_operand, print_operand, + addr_generation_dependency_p, annotate_constant_pool_refs, + s390_split_branches, find_constant_pool_ref, + replace_constant_pool_ref, s390_add_constant, s390_find_constant, + s390_find_execute, s390_mainpool_start, s390_chunkify_start, + s390_output_pool_entry, s390_function_value, + s390_call_saved_register_used, s390_emit_call): Replace + conditional aborts by gcc_assert and unconditional by gcc_unreachable. + (s390_select_ccmode, s390_match_ccmode_set, s390_extract_part, + s390_cannot_force_const_mem, s390_output_dwarf_dtprel, + get_some_local_dynamic_name, s390_function_arg_size, + s390_function_arg_advance, s390_function_arg, + s390_expand_builtin, s390_gen_rtx_const_DI): Replace abort in + default case by gcc_unreachable. + * config/s390/s390.md: ("*cjump_31", "*icjump_31", "*jump31"): Replace + conditional abort by gcc_assert. + ("doloop_si31"): Replace abort in last else by gcc_unreachable. + ("main_pool", "pool"): Replace unconditional abort by gcc_unreachable. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_decompose_address, + tls_symbolic_operand, legitimate_pic_operand_p, + legitimate_constant_p, legitimate_reload_constant_p, + s390_expand_plus_operand, legitimate_address_p, + legitimate_la_operand_p, ): Remove 'register' from signature. + (symbolic_reference_mentioned_p, + tls_symbolic_reference_mentioned_p): Remove 'register' from local + variable declarations. + (legitimize_address): Remove 'register' from + signature and local variable declarations. + +2005-05-09 Adrian Straetling + + * config/s390/s390-protos.h: (s390_match_ccmode, + s390_match_ccmode_set, reg_used_in_mem_p, + symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p, + legitimate_la_operand_p, preferred_la_operand_p, + s390_short_displacement, addr_generation_dependency_p, + legitimate_reload_constant_p, legitimate_address_p): Change return type + into 'bool'. + (s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. + * config/s390/s390.c: (s390_match_ccmode, + symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p, + legitimate_reload_constant_p): Change return type into 'bool'. + (preferred_la_operand_p,legitimate_la_operand_p, legitimate_address_p): + Likewise. Additionally adapted comment. + (s390_extra_constraint_p): Change Comment to reflect 'int' return type. + (s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. + (s390_decompose_address): Change the type of the internal flags + "pointer", "base_ptr", "indx_ptr", and the return value into 'bool'. + (struct s390_address): Change type of "pointer" into bool. + * config/s390/s390.md: ("*tmdi_reg", "*tmsi_reg", "tm_full"): + Adapt calls for 's390_tm_ccmode' to the new signature. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_match_ccmode_set, + s390_branch_condition_mnemonic, s390_short_displacement, + s390_decompose_address, get_thread_pointer, legitimize_tls_address, + print_shift_count_operand, get_some_local_dynamic_name, + get_some_local_dynamic_name_1, reg_used_in_mem_p, + addr_generation_dependency_p, s390_split_branches, + annotate_constant_pool_refs, find_constant_pool_ref, + replace_constant_pool_ref, find_ltrel_base, replace_ltrel_base, + s390_optimize_prologue, find_unused_clobbered_reg, s390_frame_area, + s390_register_info, s390_frame_info, s390_init_frame_layout, + s390_update_frame_layout, save_fpr, restore_fpr, save_gprs, + restore_gprs, s390_function_arg_size, s390_function_arg_float, + s390_init_machine_status, s390_assemble_integer, s390_handle_option, + s390_encode_section_info, s390_cannot_force_const_mem, + s390_delegitimize_address, s390_return_in_memory, s390_init_builtins, + s390_expand_builtin, s390_output_mi_thunk, s390_safe_attr_type, + s390_adjust_priority, s390_issue_rate, + s390_first_cycle_multipass_dfa_lookahead, s390_cannot_copy_insn_p, + s390_rtx_costs, s390_address_cost, s390_reorg, s390_valid_pointer_mode, + s390_build_builtin_va_list, s390_gimplify_va_arg, + s390_function_ok_for_sibcall, s390_call_saved_register_used, + s390_pass_by_reference, s390_fixed_condition_code_regs, + s390_cc_modes_compatible s390_mainpool_start,, s390_mainpool_finish, + s390_mainpool_cancel, s390_chunkify_start, s390_chunkify_finish, + s390_chunkify_cancel, s390_start_pool, s390_end_pool, + s390_add_pool_insn, s390_find_pool, s390_add_constant, + s390_find_constant, s390_add_execute, s390_find_execute, + s390_execute_label, s390_execute_target, s390_dump_pool, + s390_dump_execute, s390_alloc_pool, s390_free_pool): Remove prototypes. + Move target macro definitions to the end of the file. Move several + functions within the file to assure correct compiling. + +2005-05-09 Steven Bosscher + + * calls.c (purge_reg_equiv_notes): Remove, fold into... + (fixup_tail_calls): ...here. Only look at insns between the + start of the function and the FUNCTION_BEG insn note. + + * gcse.c (one_cprop_pass): Fix typos in dumps. + + * tree-ssa-operands.h (FOR_EACH_PHI_ARG): Fix typos. + +2005-05-09 Adrian Straetling + + * config/s390/s390.h: Move xxx_REGNUM definitions to s390.md. + * config/s390/s390.md: ("SIBCALL_REGNUM", "BASE_REGNUM", + "RETURN_REGNUM", "CC_REGNUM", "TP_REGNUM"): New constants. + Replace every occurrence of '(reg: 33)' by '(reg: + CC_REGNUM)'. + ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): Replace + '(reg: 36)' by '(reg: TP_REGNUM)'. + ("*sibcall_br", "*sibcall_value_br"): Replace '(reg:DI 1)' by '(reg:DI + REG_SC)'. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("gf") New mode attribute. + ("fixuns_truncdfdi2", "fixuns_truncdfsi2", "fixuns_truncsfdi2", + "fixuns_truncsfsi2"): Merge. + ("fix_truncdfdi2", "fix_truncsfdi2"): Merge. + ("fix_truncdfdi2_ieee", "fix_truncdfsi2_ieee", "fix_truncsfdi2_ieee", + "fix_truncsfsi2_ieee"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("FPR") New mode macro. + ("de", "dee"): New mode attributes. + ("cmpdf", "cmpsf"): Merge. + ("*cmpdf_ccs_0", "*cmpsf_ccs_0"): Merge. + ("*cmpdf_ccs_0_ibm", "*cmpdf_ccs_0_ibm"): Merge. + ("*cmpdf_ccs", "*cmpsf_ccs"): Merge. + ("*cmpdf_ccs_ibm", "*cmpsf_ccs_ibm"): Merge. + ("floatdidf2", "floatdisf2"): Merge. + ("adddf3", "addsf3"): Merge. + ("*adddf3", "*addsf3"): Merge. + ("*adddf3_cc", "*addsf3_cc"): Merge. + ("*adddf3_cconly", "*addsf3_cconly"): Merge. + ("*adddf3_ibm", "*addsf3_ibm"): Merge. + ("subdf3", "subsf3"): Merge. + ("*subdf3", "*subsf3"): Merge. + ("*subdf3_cc", "*subsf3_cc"): Merge. + ("*subdf3_cconly", "*subsf3_cconly"): Merge. + ("*subdf3_ibm", "*subsf3_ibm"): Merge. + ("muldf3", "mulsf3"): Merge. + ("*muldf3", "*mulsf3" "): Merge. + ("*muldf3_ibm", "*mulsf3_ibm"): Merge. + ("*fmadddf", "*fmaddsf"): Merge. + ("*fmsubdf", "*fmsubsf"): Merge. + ("divdf3", "divsf3"): Merge. + ("*divdf3", "*divsf3"): Merge. + ("*divdf3_ibm", "*divsf3_ibm"): Merge. + ("negdf2", "negsf2"): Merge. + ("*negdf2_cc", "*negsf2_cc"): Merge. + ("*negdf2_cconly", "*negsf2_cconly"): Merge. + ("*negdf2", "*negsf2"): Merge. + ("*negdf2_ibm", "*negsf2_ibm"): Merge. + ("absdf2", "abssf2"): Merge. + ("*absdf2_cc", "*abssf2_cc"): Merge. + ("*absdf2_cconly", "*abssf2_cconly"): Merge. + ("*absdf2", "*abssf2"): Merge. + ("*absdf2_ibm", "*abssf2_ibm"): Merge. + ("*negabsdf2_cc", "*negabssf2_cc"): Merge. + ("*negabsdf2_cconly", "*negabssf2_cconly"): Merge. + ("*negabsdf2", "*negabssf2"): Merge. + ("sqrtdf2", "sqrtsf2"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_adjust_priority): Adapt to changed + attribute names. + * config/s390/2084.md: ("x_fsimpd", "x_fsimps", "x_fdivd", "x_fdivs", + "x_floadd", "x_floads", "x_fstored", "x_fstores"): Rename to + ("x_fsimpdf", "x_fsimpsf", "x_fdivdf", "x_fdivsf", "x_floaddf", + "x_floadsf", "x_fstoredf", "x_fstoresf") and replace 'type' + attribute names. + * config/s390/s390.md: ("type"): Rename "fsimpd, fsimps, floadd, floads, + fstored, fstores, fmuld, fmuls, fdivd, fdivs, fsqrtd, fsqrts" to + "fsimpdf, fsimpsf, floaddf, floadsf, fstoredf, fstoresf, fmuldf, + fmulsf, fdivdf, fdivsf, fsqrtdf, fsqrtsf". + ("*cmpdf_ccs_0", "*cmpdf_css_0_ibm", "*cmpdf_ccs", + "*cmpdf_ccs_ibm", "*cmpsf_ccs_0", "*cmpsf_css_0_ibm", + "*cmpsf_ccs", "*cmpsf_ccs_ibm", "*movdi_64", "*movdi_31", + "*movsi_zarch", "*movsi_esa", "*movdf_64", "*movdf_31", "movsf", + "*muldf3", "*muldf3_ibm", "*fmadddf", "*fmsubdf", "*mulsf3", + "mulsf3_ibm", "*fmaddsf", "fmsubsf", "*divdf3", "*divdf3_ibm", + "*negdf2_cc", "*negdf2_cconly", "*negdf2", "*negdf2_ibm", + "*negsf2_cc", "*negsf2_cconly", "*negsf2", "*absdf2_cc", + "*absdf2_cconly", "*absdf2", "*absdf2_ibm", "*abssf2_cc", + "*abssf2_cconly", "*abssf2", "*abssf2_ibm", "*negabsdf2_cc", + "*negabsdf2_cconly", "*negabsdf2", "*negabssf2_cc", + "*negabssf2_cconly", "*negabssf2", "sqrtdf2", "sqrtsf2"): Rename + 'type' value. + ("*divsf3"): Additionally rename second pattern to + "*divsf3_ibm". + ("truncdfsf2_ibm", "extendsfdf2_ieee", "extendsfdf2_ibm", + "*adddf3", "*adddf3_cc", "*adddf3_cconly", "*adddf3_ibm", + "*addsf3", "*addsf3_cc", "*addsf3_cconly", "*subdf3", + "subdf3_cc", "*subdf3_cconly", "*subdf3_ibm", "*subsf3", + "subsf3_cc", "*subsf3_cconly", "*subsf3_ibm"): Merge identical + 'type values' and rename 'type' value. + ("*addsf3"): Additionally rename second pattern to + "*addsf3_ibm". + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("SHIFT"): New mode macro. + ("lr", "shift"): New mode attributes. + ("ashldi3", "lshrdi3"): Merge. + ("*ashldi3_31", "*lshrdi3"_31): Merge. + ("*ashldi3_64", "*lshrdi3"_64): Merge. + ("ashlsi3", "lshrsi3"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("DSI", "SCOND"): New mode + macros. + ("E", "g"): New mode attributes. + ("*adddi3_alc_cc", "*addsi3_alc_cc"): Merge. + ("*adddi3_alc", "*addsi3_alc"): Merge. + ("*subdi3_slb_cc", "*subsi3_slb_cc"): Merge. + ("*subdi3_slb", "*subsi3_slb"): Merge. + ("adddicc", "addsicc"): Merge. + ("*sconddi", "*scondsi"): Merge. + ("*sconddi_neg", "*scondsi_neg"): Merge. + ("sltu", "sgtu", "sleu", "sgeu"): Merge. + ("negdi2", "negsi2"): Extract expander pattern from + "negsi2" and merge with "negdi2". + ("*negdi2"): Merge with instruction pattern of "negsi2". + ("*negdi2_cc", "*negsi2_cc"): Merge. + ("*negdi2_cconly", "*negsi2_cconly"): Merge. + ("rotldi3", "rotlsi3"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("hc"): New mode attribute. + ("extendhidi2", "extendqidi2"): Merge. + ("*extendhidi2", "*extendqidi2"): Merge. + ("extendhisi2", "extendqisi2"): Merge. + ("zero_extendhidi2", "zero_extendqidi2"): Merge. + ("*zero_extendhidi2", "*zero_extendqidi2"): Merge. + Merged 2 define_split. + ("*zero_extendhisi2", "*zero_extendqisi2"): Merge. + ("*zero_extendhisi2_64", "*zero_extendqisi2_64"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("COMPARE"): New mode macro. + ("beq", "bne", "bgt", "bgtu", "blt", "bltu", "bge", "bgeu", + "ble", "bleu", "bunordered", "bordered", "buneq", "bunlt", + "bungt", "bunle", "bunge", "bltgt"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("INT"): New mode macro. + ("one_cmpldi2", "one_cmplsi2", "one_cmplhi2", "one_cmplqi2"): + Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("GPR", "P"): New mode macros. + ("cmpdi", "cmpsi"): Merge. + ("strlendi", "strlensi"): Merge. + ("*strlendi", "*strlensi"): Merge. + ("movmemdi", "movmemsi"): Merge. + ("clrmemdi", "clrmemsi"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("HQI"): New mode macro. + ("icm_lo", "icm_hi", "max_uint"): New mode attributes. + ("*tmhi_full", "*tmqi_full"): Merge. + ("*tsthiCCT", "*tstqiCCT"): Merge. + ("*tsthi", "*tstqi"): Merge. + ("*tsthi_cconly", "tstqi_cconly"): Merge. + ("*sethighhisi", "*sethighqisi"): Merge. + +2005-05-09 Kazu Hirata + + * crtstuff.c, integrate.h, tree-scalar-evolution.h, + config/alpha/unicosmk.h, config/arc/arc.md, + config/arm/bpabi.h, config/arm/coff.h, config/arm/elf.h, + config/arm/ieee754-df.S, config/arm/ieee754-sf.S, + config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h, + config/arm/semi.h, config/arm/uclinux-elf.h, + config/arm/wince-pe.h, config/fr30/fr30.c, + config/rs6000/altivec.h: Update copyright. + +2005-05-09 Nathan Sidwell + + * config/pdp11/pdp11.c (pdp11_output_function_prologue): Use + gcc_assert and gcc_unreachable as appropriate. + (pdp11_output_function_epilogue, output_move_double, + output_move_quad, print_operand_address, output_jump, + output_addr_const_pdp11): Likewise. + * config/pdp11/pdp11.h (FUNCTION_PROFILER, + ASM_OUTPUT_ALIGN): Likewise. + * config/pdp11/pdp11.md: Likewise. + (extendhisi2, subhi3, subqi3): Likewise. + +2005-05-09 David Edelsohn + + PR middle-end/21237 + * dojump.c (do_jump, MINUS_EXPR): Build NE_EXPR and fall through + to NE_EXPR case. + +2005-05-09 Kazu Hirata + + * config/ia64/ia64.c: Fix a comment typo. + +2005-05-09 Richard Earnshaw + + PR target/21397 + * arm.c (ARM_OPT_SET_CPU, ARM_OPT_SET_ARCH, ARM_OPT_SET_TUNE): Define. + (arm_override_options): Use them instead of manifest constants. Don't + allow -march to override the -mtune setting. + +2005-05-09 Nathan Sidwell + + * config/iq2000/iq2000.c (abort_with_insn): Use fancy_abort. + (gen_int_relational): Use gcc_unreachable and gcc_assert as necessary. + (function_arg_advance, function_arg, save_restore_insns, + iq2000_expand_prologue, iq2000_output_conditional_branch, + expand_one_builtin, print_operand): + * config/iq2000/iq2000.md (tablejump): Likewise. + +2005-05-09 David Ung + + * config/mips/mips.h (processor_type): Add names for the 24K. + * config/mips/mips.c (mips_cpu_info_table): Add names for the 24K + processor family. + * config/mips/mips.md (cnv_mode): New attribute for recording the + conversion types of float convert insns. + (cpu): Add 24k and 24kx. + (include): Include 24k.md file. + (truncdfsf2, extendsfdf2, fix_truncdfsi2_insn, fix_truncdfsi2_macro) + (fix_truncdfdi2, fix_truncsfdi2, floatsidf2, floatdidf2, floatsisf2) + (floatdisf2): Setup cnv_mode. + (fix_truncsfsi2_insn, fix_truncsfsi2_macro): Changed mode to SF and + setup cnv_mode. + * config/mips/24k.md: New file, contains 24k DFA pipeline + description. + +2005-05-09 Nathan Sidwell + + * config/sh/sh.c (print_operand_address): Use gcc_assert and + gcc_unreachable as appropriate. + (print_operand, prepare_move_operands, prepare_scc_operands, + output_movedouble, output_branch, shift_insns_rtx, gen_shifty_op, + gen_shl_and, shl_sext_kind, gen_datalabel_ref, dump_table, + fixup_mova, gen_far_branch, sh_reorg, split_branches, + final_prescan_insn, output_stack_adjust, sh_expand_epilogue, + sh_set_return_address, sh_setup_incoming_varargs, + initial_elimination_offset, sh_pch_valid_p, get_free_reg, + sh_expand_builtin, sh_output_mi_thunk, extract_sfunc_addr, + check_use_sfunc_addr): Likewise. + * config/sh/netbsd-elf.h (FUNCTION_PROFILER): Likewise. + * config/sh/sh.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. + * config/sh/symbian.c (sh_symbian_mark_dllexport, + sh_symbian_mark_dllimport): Likewise. + * config/sh/sh.md: Likewise. + (movdicc, call_pop, call_value_pop, casesi_worker_1, + casesi_worker_2, casesi_shift_media, casesi_load_media, + return_media): Likewise. + +2005-05-08 Roger Sayle + + PR inline-asm/8788 + * stmt.c (expand_asm_operands): Avoid calling force_reg on BLKmode + operands. + +2005-05-08 Richard Henderson + + * config/alpha/alpha.c (adjust_address): Fix typo last change. + +2005-05-08 Stephane Carrez + + * config/m68hc11/m68hc11.h (REG_VALID_P): A regno must be >= 0 + and -1 can happen in reg_renumber when no hard register is assigned. + +2005-05-08 Steven Bosscher + Kazu Hirata + + PR tree-optimization/14841, tree-optimization/15838 + * tree-ssa-ccp.c (fold_const_aggregate_ref): New. + (evaluate_stmt): Call it. + +2005-05-08 Jakub Jelinek + + * config/ia64/ia64.c (ia64_override_options): Don't set + ia64_flag_var_tracking and clear flag_var_tracking here... + (ia64_file_start): ... but here. + +2005-05-08 Nathan Sidwell + + * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Use gcc_assert + and gcc_unreachable as appropriate. + (expand_prologue, expand_epilogue, m68hc11_gen_lowpart, + m68hc11_gen_highpart, print_operand, print_operand_address, + m68hc11_expand_compare, m68hc11_expand_compare_and_branch, + m68hc11_gen_movhi): Likewise. + * config/m68hc11/m68hc11.h (HARD_X_REGNUM): Reword comment. + * config/m68hc11/m68hc11.md: Reword comment. + +2005-05-08 Stephane Carrez + + PR target/21281 + * config/m68hc11/predicates.md (splitable_operand): An immediate is + allowed. + +2005-05-08 Stephane Carrez + + * config/m68hc11/predicates.md (reg_or_some_mem_operand): Do not allow + the 68HC12 address indirect addressing mode as it is not supported by + bset and bclr. + * config/m68hc11/m68hc11-protos.h + (m68hc11_valid_addressing_p): Declare. + (m68hc11_add_mode): Declare. + * config/m68hc11/m68hc11.c (m68hc11_valid_addressing_p): Rename from + register_indirect_p and export it. + (m68hc11_z_replacement): Use emit_insn_after when adding the save Z + instruction so that it is part of the good BB. + (m68hc11_gen_movhi): Fix invalid generation of indexed indirect + addressing with movw. + (m68hc11_gen_movqi): Use pula and pulb instead of lda and ldb for + 68HC12. + * config/m68hc11/m68hc11.h (ADDR_STRICT, ADDR_INCDEC, ADDR_INDEXED, + ADDR_OFFSET, ADDR_INDIRECT, ADDR__CONST): Moved from m68hc11.c. + * config/m68hc11/m68hc11.md ("movhi_const0"): Use this pattern only + for 68HC11. + ("*movhi_68hc12"): Handle movhi_const0. + ("*subhi3", "subqi3"): Use general_operand for operand 1. + ("*subhi3_zext"): Likewise. + +2005-05-08 Stephane Carrez + + PR target/19051 + * config/m68hc11/m68hc11.md ("mulqi3"): Use general_operand for + operand 1 and fix constraints. + ("mulqihi3"): Use general_operand for operand 2. + +2005-05-08 Julian Brown + H.J. Lu + Paul Brook + + * configure.ac: Set ld_vers_major, ld_vers_minor and ld_vers_patch for + GNU linker. Support linker version x.x.x.x.x. Require GNU linker + 20050308/2.16.0 or newer for comdat group. + * configure: Regenerated. + * config.in: Regenerated. + * varasm.c (default_function_rodata_section): Put .rodata section in + COMDAT group when necessary. + (default_elf_asm_named_section): Rename HAVE_GAS_COMDAT_GROUP to + HAVE_COMDAT_GROUP. + (default_unique_section_1): Don't use .gnu.linkonce when COMDAT is + available. + +2005-05-08 Kazu Hirata + + * tree-dfa.c (referenced_vars, add_referenced_var): Use VEC + instead of VARRAY. + * tree-flow.h (num_referenced_var, referenced_var): Likewise. + * tree-into-ssa.c (mark_def_site_blocks): Likewise. + * tree-ssa.c (init_tree_ssa, delete_tree_ssa): Likewise. + * tree-tailcall.c (suitable_for_tail_opt_p): Likewise. + +2005-05-08 Stephane Carrez + + PR target/16925 + * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Handle split of + 64-bit constants on 64-bit hosts. + (m68hc11_split_logical): Simplify. + (m68hc11_split_move): Likewise. + +2005-05-08 Nathan Sidwell + Paolo Bonzini + + * Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.sh + * aclocal.m4 (GCC_TARGET_TEMPLATE, AH_TEMPLATE): New. + * configure.ac (enable_checking): Fix typos in runtime_checking. + (ENABLE_RUNTIME_CHECKING): Mark as target template. + (xm_file): Prepend auto-host.h + (HAVE_GAS_HIDDEN, HAVE_LD_EH_FRAME_HDR): Mark as target template. + * mkconfig.sh: Do not automatically define USED_FOR_TARGET in + tconfig.h. + * crtstuff.c: Do not include auto-host.h. + (IN_LIBGCC2): Do not define. + * gcov-io.h: Include tconfig.h, not auto-host.h. + * libgcc2.c: Do not include auto-host.h. + (abort): Do not undefine. + * libgcov.c: Remove unneeded comment about config.h. + * unwind-dw2-fde-glibc.c: Do not inlude auto-host.h. + * config.in, configure: Regenerated. + +2005-05-08 Nathan Sidwell + Falk Hueffner + + * config/alpha/alpha.c (tls_symbolic_operand_1): Use gcc_assert + and gcc_unreachable as appropriate. + (get_aligned_mem, get_unaligned_address, + alpha_emit_set_long_const, alpha_emit_conditional_branch, + alpha_emit_setcc, alpha_emit_conditional_move, + alpha_lookup_xfloating_lib_func, alpha_compute_xfloating_mode_arg, + alpha_emit_xfloating_libcall, alpha_split_tfmode_pair, + alpha_expand_unaligned_load, alpha_expand_block_move, + alpha_expand_zap_mask, get_trap_mode_suffix, + get_round_mode_suffix, get_some_local_dynamic_name, + print_operand_address, function_arg, alpha_return_in_memory, + function_value, alpha_expand_builtin, + alpha_initial_elimination_offset, alpha_expand_epilogue, + summarize_insn, alpha_handle_trap_shadows, alphaev5_insn_pipe, + alphaev5_next_group, alpha_align_insns, + unicosmk_initial_elimination_offset, unicosmk_unique_section, + unicosmk_ssib_name): Likewise. + * config/alpha/alpha.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * config/alpha/unicosmk.h (TRAMPOLINE_TEMPLATE, + ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_DIFF_VEC): Likewise. + * config/alpha/vms.h (INITIAL_ELIMINATION_OFFSET, + ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + * config/alpha/alpha.md (*divmodsi_internal_er, + *divmoddi_internal_er, ashldi3, *insxl, sibcall, call_osf, + call_nt, call_umk, call_vms, call_value, sibcall_value, + call_value_osf, call_value_nt, call_value_vms, call_value_umk, + *call_vms_1, *movmemdi_1, *clrmemdi_1, *call_value_vms_1): Likewise. + * config/alpha/predicates.md (input_operand): Likewise. + +2005-05-08 Nathan Sidwell + + * config/frv/frv.c (frv_default_flags_for_cpu): Use gcc_assert and + gcc_unreachable, as appropriate. + (frv_function_prologue, frv_alloc_temp_reg, + frv_initial_elimination_offset, frv_expand_block_move, + frv_expand_block_clear, frv_print_operand_jump_hint, + frv_legitimize_tls_address, unspec_got_name, frv_emit_move, + frv_emit_movsi, frv_split_cond_move, frv_split_minmax, + frv_ifcvt_modify_insn, frv_ifcvt_modify_final, + frv_adjust_field_align, frv_insn_unit, frv_cond_flags, + frv_sort_insn_group, frv_reorder_packet, frv_matching_accg_mode, + frv_in_small_data_p, frv_asm_out_constructor, + frv_asm_out_destructor, frv_output_dwarf_dtprel): Likewise. + * config/frv/frv.md (reload_incc_fp, *cond_exec_si_binary1, + *cond_exec_si_binary2, *cond_exec_si_divide, *cond_exec_si_unary1, + *cond_exec_sf_conv, *cond_exec_sf_add, call, sibcall, call_value, + sibcall_value, casesi): Likewise. + + * config/mn10300/mn10300.c (print_operand): Use gcc_assert and + gcc_unreachable as appropriate. + (print_operand_address, mn10300_print_reg_list, expand_prologue, + expand_epilogue, notice_update_cc, initial_offset, + mn10300_address_cost_1): Likewise. + * config/mn10300/mn10300.md: Likewise. + (absdf2, abssf2, negdf2, negsf2): Likewise. + +2005-05-08 Richard Sandiford + + PR target/21416 + * config/mips/mips.c (mips_emit_compare): Don't reverse UNGE and UNGT + comparisons. + * config/mips/mips.md (swapped_fcond): New code macro and attribute. + (sgt_, sge_): Generalize to all members of swapped_fcond, + including sunge_ and sungt_. + +2005-05-08 Richard Sandiford + + * integrate.h (get_hard_reg_initial_val): Change type of register + parameter from int to unsigned int. + (has_hard_reg_initial_val): Likewise. + * integrate.c (get_hard_reg_initial_val): Likewise. + (has_hard_reg_initial_val): Likewise. Remove cast to unsigned int. + +2005-05-08 Kazu Hirata + + * except.c (eh_status): Change the type of ttype_data to + VEC(tree,gc)*. + (add_ttypes_entry, assign_filter_values, + output_function_exception_table): Use VEC instead of VARRAY. + +2005-05-07 David Edelsohn + + * config/rs6000/rs6000.md (popcount2): Fix non-C90 constant. + +2005-05-07 Paul Brook + + * Makefile.in: Fix dependencies. + (GCOV_IO_H, VARRAY_H): Set. + +2005-05-07 Anthony Green + + PR bootstrap/21403 + * configure.ac (STMP_FIXPROTO): Fix [ ] consumption problem in + x$STMP_FIXPROTO test. + * configure: Rebuilt. + +2005-05-07 Joseph S. Myers + + * config/pa/pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Do not define + inappropriate feature test macros if flag_iso. + +2005-05-07 Joseph S. Myers + + * config/ia64/hpux.h (NO_IMPLICIT_EXTERN_C): Define. + +2005-05-07 Hans-Peter Nilsson + + PR target/21441 + * config/cris/cris.md ("*movdi_insn", "*mov_sidesisf_biap") + ("*mov_sidesisf", "*mov_sidesisf_biap_mem", "*mov_sidesisf_mem"): + Handle moved operand being in special register. + ("smulsi3_highpart", "umulsi3_highpart"): Change .error into + presumed working insn. + (mover2side): Add FIXME. + +2005-05-07 Richard Sandiford + + * integrate.c (get_func_hard_reg_initial_val): Delete. + (has_func_hard_reg_initial_val): Delete. + (get_hard_reg_initial_val): Inline the old implementation of + get_func_hard_reg_initial_val. Use has_hard_reg_initial_val + instead of has_func_hard_reg_initial_val to test for an existing + pseudo. Only create an rtx if a new initial value entry is needed. + (has_hard_reg_initial_val): Scan the initial value list directly. + Don't create an rtx. + +2005-05-07 David Edelsohn + + * config.gcc ({powerpc,rs6000}-ibm-aix*): Remove rs6000/aix.opt + from extra_options. + * config.in (HAVE_AS_POPCNTB): New. + * configure.ac (HAVE_AS_MFCRF): Add .machine "pwr5" to AIX test. + (HAVE_AS_POPCNTB): New. + * configure: Regenerated. + * config/rs6000/aix.h (TARGET_XL_COMPAT): Delete. + * config/rs6000/rs6000.c (rs6000_override_options, power5): Add + MASK_POPCNTB. Uncomment rs6000_sched_restricted_insns_priority + and rs6000_sched_costly_dep. + * config/rs6000/rs6000.h (TARGET_POPCNTB): New. + (TARGET_XL_COMPAT): Delete. + * config/rs6000/rs6000.md (UNSPEC_POPCNTB): New. + (popcount2): New. + (popcntb2): New. + * config/rs6000/rs6000.opt (mpopcntb): New. + + * opt-functions.awk (var_set): Emit OPTION_MASK_ for InverseMask + if variable name exists. + +2005-05-07 Matt Kraai + + * Makefile.in (c-gimplify.o): Depend on $(RTL_H) instead of rtl.h. + +2005-05-07 Richard Henderson + + PR target/21412 + * config/rs6000/rs6000.c (rs6000_emit_move): Look for tls addresses + with constant offsets. + +2005-05-07 Nathan Sidwell + + * config/v850/v850.c (print_operand): Use gcc_assert and + gcc_unreachable, as appropriate. + (print_operand_address, v850_handle_data_area_attribute, + v850_encode_data_area, construct_restore_jr, construct_save_jarl, + v850_insert_attributes, construct_prepare_instruction): Likewise. + * config/v850/v850.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/v850/v850.md (movsicc, *sasf_1): Likewise. + +2005-05-07 Kazu Hirata + + * tree-ssa-loop-ivcanon.c, config/i386/i386.c, + config/rs6000/rs6000.h: Fix comment typos. + +2005-05-07 Richard Sandiford + + * doc/invoke.texi: Remove documentation for MIPS' -mint64 option. + * config/mips/mips.c (TARGET_SCALAR_MODE_SUPPORTED_P): Delete. + (mips_scalar_mode_supported_p): Delete. + +2005-05-06 Eric Christopher + + * config/mips/mips.opt: Remove -mint64 option. + * config/mips/mips.c (override_options): Remove -mint64 + handling. + * config/mips/mips.h (INT_TYPE_SIZE): Define to 32. + * config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Remove + 64-bit integer handling. + * doc/invoke.texi (Option Summary): Remove -mint64 for + mips. + +2005-05-06 Zdenek Dvorak + + PR tree-optimization/19401 + * tree-flow.h (tree_unroll_loops_completely): Declaration changed. + * tree-ssa-loop-ivcanon.c (enum unroll_level): New. + (estimated_unrolled_size): New function. + (try_unroll_loop_completely, canonicalize_loop_induction_variables, + tree_unroll_loops_completely): Always unroll loops if the code size + does not increase. + * tree-ssa-loop.c (tree_complete_unroll): Indicate whether all + loops should be unrolled completely. + (gate_tree_complete_unroll): Run complete unrolling unconditionally. + +2005-05-06 Zdenek Dvorak + + PR rtl-optimization/21254 + * loop-iv.c (iv_number_of_iterations): Simplify infiniteness + assumptions for loops that otherwise do not roll. + (find_simple_exit): Prefer # of iterations that is guaranteed + not to be infinite. + * loop-unroll.c (decide_peel_once_rolling, + decide_peel_completely): Check whether the loop is infinite. + +2005-05-06 Pat Haugen + + * config/rs6000/sysv4.opt: Fix typo. + +2005-05-06 Denis Vlasenko + Jakub Jelinek + + PR target/21329 + * config/i386/i386.c (ix86_expand_movmem): Don't use rep; movsb + for -Os if (movsl;)*(movsw;)?(movsb;)? sequence is shorter. + Don't use rep; movs{l,q} if the repetition count is really small, + instead use a sequence of movs{l,q} instructions. + +2005-05-06 Jeff Law + + PR tree-optimization/21380 + * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not + thread through a block with no preds. + +2005-05-06 Kazu Hirata + + * tree-ssa-operands.c (clobbered_v_may_defs, clobbered_vuses, + ro_call_vuse, fini_ssa_operands, add_call_clobber_ops, + add_call_read_ops): Use VEC instead of VARRAY. + +2005-05-06 Nathan Sidwell + + * config/mcore/mcore.c (mcore_print_operand_address): Use + gcc_assert and gcc_unreachable as appropriate. + (mcore_print_operand, mcore_gen_compare_reg, mcore_output_call, + mcore_output_andn, output_inline_const, mcore_output_move, + mcore_output_movedouble, mcore_expand_block_move, + layout_mcore_frame, mcore_initial_elimination_offset, + mcore_expand_prolog, mcore_mark_dllexport, + mcore_mark_dllimport): Likewise. + * config/mcore/mcore.h (switch_to_section): Likewise. + * config/mcore/mcore.md: Likewise. + +2005-05-06 Aldy Hernandez + + * config/rs6000/linux64.h: Remove MASK_PROFILE_KERNEL, and + TARGET_PROFILE_KERNEL. + + * config/rs6000/rs6000.c (output_profile_hook): Add comment to + TARGET_PROFILE_KERNEL use. + +2005-05-06 Nathan Sidwell + + * config/m32r/m32r.c (m32r_encode_section_info): Use gcc_assert + and gcc_unreachable, as appropriate. + (gen_compare, gen_split_move_double, m32r_setup_incoming_varargs, + m32r_expand_prologue, m32r_output_function_epilogue, + m32r_legitimize_pic_address, m32r_print_operand_address, + emit_cond_move, m32r_function_symbol, + m32r_output_block_move): Likewise. + * config/m32r/m32r.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/m32r/m32r.md ( *movsi_insn, *zero_branch_insn, + *rev_zero_branch_insn): Likewise. + +2005-05-06 Jakub Jelinek + + PR c++/20961 + * varasm.c (merge_weak): Remove NEWDECL from WEAK_DECLS chain + if both NEWDECL and OLDDECL are already weak. + +2005-05-06 Richard Sandiford + + * config/rs6000/sysv4.h (EXTRA_SUBTARGET_SWITCHES): Delete. + +2005-05-05 J"orn Rennecke + Kaz Kojima + + * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg + and plus_constant. + +2005-05-05 Aldy Hernandez + David Edelsohn + + * config.gcc: Add .opt magic for the rs6000 ports. + + * doc/invoke.texi: Document -mabi= option properly. Document + -misel and -mno-sel. Document -mspe and -mno-spe. Document + -mvrsave and -mno-vrsave. Document deprecation of -mspe= and + -misel=. + + * config/rs6000/aix.h: Remove XL_COMPAT stuff. Remove + SUBTARGET_SWITCHES and SUBSUBTARGET_SWITCHES. Define + TARGET_XL_COMPAT. + + * config/rs6000/aix.opt: New. + * config/rs6000/aix41.opt: New. + * config/rs6000/aix64.opt: New. + * config/rs6000/darwin.opt: New. + * config/rs6000/linux64.opt: New. + * config/rs6000/rs6000.opt: New. + * config/rs6000/sysv4.opt: New. + + * config/rs6000/sysv4.h: Delete definitions of MASK_* and + associated TARGET_*. Remove SUBTARGET_OPTIONS, + SUBTARGET_SWITCHES. + Define TARGET_USES_SYSV4_OPT. + * config/rs6000/aix41.h: Remove SUBSUBTARGET_SWITCHES. + * config/rs6000/aix43.h: Remove SUBSUBTARGET_SWITCHES. Define + TARGET_USES_AIX64_OPT. + * config/rs6000/aix51.h: Same. + * config/rs6000/aix52.h: Same. + * config/rs6000/darwin.h: Remove SUBTARGET_SWITCHES, + MASK_MACHO_DYNAMIC_NO_PIC, TARGET_MACHO_DYNAMIC_NO_PIC. + Use TARGET_ALTIVEC_VRSAVE instead of rs6000_altivec_vrsave. + Define TARGET_DYNAMIC_NO_PIC as TARGET_MACHO_DYNAMIC_NO_PIC. + * config/rs6000/linux64.h: Use + rs6000_explicit_options. Remove EXTRA_SUBTARGET_SWITCHES. + + * config/rs6000/rs6000.c: Remove definitions of + rs6000_sched_restricted_insns_priority, + rs6000_long_double_size_string, rs6000_altivec_vrsave, + rs6000_altivec_vrsave_string, rs6000_isel, rs6000_spe, + rs6000_float_gprs_string, rs6000_isel_string, rs6000_spe_string, + rs6000_abi_string, rs6000_warn_altivec_long, rs6000_longcall, + rs6000_alignment_string. Define rs6000_explicit_options. + (rs6000_parse_abi_options): Remove. + (rs6000_parse_alignment_option): Remove. + (rs6000_parse_float_gprs_option): Remove. + (rs6000_handle_option): New. Define TARGET_HANDLE_OPTION. Define + TARGET_DEFAULT_TARGET_FLAGS. + (rs6000_override_options): Revamp to use new .opt machinery. + + * config/rs6000/rs6000.h: Remove old MASK_* and TARGET_* in favor + of new .opt machinery. Remove target_flags. Redefine + TARGET_MFCRF and TARGET_POWERPC64. Remove TARGET_SWITCHES, + SUBTARGET_SWITCHES, TARGET_OPTIONS, SUBTARGET_OPTIONS, + rs6000_float_gprs_string, rs6000_isel_string, rs6000_spe_string, + rs6000_altivec_vrsave_string, rs6000_altivec_vrsave, + rs6000_longcall_switch, rs6000_default_long_calls, + rs6000_sched_costly_dep_str, rs6000_sched_costly_dep, + rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch, and + TARGET_ALTIVEC_VRSAVE. + +2005-05-05 Ralf Corsepius + + * config.gcc (hppa1.1-*-rtems*): Remove. + * config/pa/rtems.h: Remove. + +2005-05-05 Ralf Corsepius + + * config/rs6000/t-rtems (MULTILIB_NEW_EXCEPTIONS_ONLY): + Exclude roe/603e multilib variants. + +2005-05-04 Denis Chertykov + + PR target/21284 + * config/avr/avr.c (avr_output_addr_vec_elt): Use special section + for output. + +2005-05-05 Richard Sandiford + + * config.gcc (arm*-wince-pe*, arm-*-pe*, strongarm-*-pe): Add + arm/pe.opt to $extra_options. + * config/arm/arm.h (target_flags, target_fpu_name, target_fpe_name) + (target_float_abi_name, target_float_switch, target_abi_name) + (ARM_FLAG_APCS_FRAME, ARM_FLAG_POKE, ARM_FLAG_FPE, ARM_FLAG_APCS_STACK) + (ARM_FLAG_APCS_FLOAT, ARM_FLAG_APCS_REENT, ARM_FLAG_BIG_END) + (ARM_FLAG_INTERWORK, ARM_FLAG_LITTLE_WORDS, ARM_FLAG_NO_SCHED_PRO) + (ARM_FLAG_ABORT_NORETURN, ARM_FLAG_SINGLE_PIC_BASE) + (ARM_FLAG_LONG_CALLS, ARM_FLAG_THUMB, THUMB_FLAG_BACKTRACE) + (THUMB_FLAG_LEAF_BACKTRACE, THUMB_FLAG_CALLEE_SUPER_INTERWORKING) + (THUMB_FLAG_CALLER_SUPER_INTERWORKING, CIRRUS_FIX_INVALID_INSNS) + (TARGET_APCS_FRAME, TARGET_POKE_FUNCTION_NAME, TARGET_FPE) + (TARGET_APCS_STACK, TARGET_APCS_FLOAT, TARGET_APCS_REENT) + (TARGET_BIG_END, TARGET_INTERWORK, TARGET_LITTLE_WORDS) + (TARGET_NO_SCHED_PRO, TARGET_ABORT_NORETURN, TARGET_SINGLE_PIC_BASE) + (TARGET_LONG_CALLS, TARGET_THUMB, TARGET_CALLER_INTERWORKING) + (TARGET_CIRRUS_FIX_INVALID_INSNS, SUBTARGET_SWITCHES, TARGET_SWITCHES) + (TARGET_OPTIONS, arm_cpu_select, arm_select, structure_size_string) + (arm_pic_register_string): Delete. + (TARGET_BACKTRACE): Redefine using TARGET_TPCS_LEAF_FRAME and + TARGET_TPCS_FRAME. + (TARGET_DEFAULT, CONDITIONAL_REGISTER_USAGE): Update mask names. + * config/arm/coff.h (TARGET_DEFAULT): Likewise. + * config/arm/elf.h (TARGET_DEFAULT): Likewise. + * config/arm/netbsd-elf.h (TARGET_DEFAULT): Likewise. + * config/arm/netbsd.h (TARGET_DEFAULT): Likewise. + * config/arm/semi.h (TARGET_DEFAULT): Likewise. + * config/arm/uclinux-elf.h (TARGET_DEFAULT): Likewise. + * config/arm/wince-pe.h (TARGET_DEFAULT): Likewise. + * config/arm/pe.h (TARGET_DEFAULT): Likewise. + (TARGET_FLAG_NOP_FUN, TARGET_NOP_FUN_DLLIMPORT): Delete. + (SUBTARGET_SWITCHES): Delete. + * config/arm/arm.c (target_float_switch): Delete. + (arm_cpu_select): Moved from config/arm/arm.h. + (target_fpu_name, target_fpe_name, target_float_abi_name) + (target_abi_name, structure_size_string, arm_pic_register_string) + (arm_select): Make static. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (arm_handle_option): New function. + (arm_override_options): Update target_flags checks for new mask names. + Remove target_float_switch code. + (arm_expand_prologue, thumb_expand_prologue): Check + !TARGET_SCHED_PROLOG instead of TARGET_NO_SCHED_PRO. + * config/arm/arm.opt, config/arm/pe.opt: New files. + +2005-05-05 Nathan Sidwell + + * config/arc/arc.c (get_arc_condition_code): Use gcc_assert & + gcc_unreachable as appropriate. + (arc_double_limm_p, arc_setup_incoming_varargs, + arc_compute_function_type, arc_output_function_prologue, + arc_output_function_epilogue, arc_eligible_for_epilogue_delay, + output_shift, arc_print_operand, arc_print_operand_address, + arc_final_prescan_insn): Likewise. + * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. + +2005-05-04 Geoffrey Keating + + * config/rs6000/rs6000.md (P): Use TARGET_*BIT rather than + comparing Pmode. + (SDI): New. + (cmp): Delete. + (wd): New. + (add3, add3_internal1, add3_internal2, + add3_internal3, one_cmpl2, sub3, neg2, + clz2, ctz2, ffs2): New. + (addsi3, addsi3_internal1, addsi3_internal2, addsi3_internal3, + (one_cmplsi2, subsi3, negsi2, clzsi2, ctzsi2, ffssi2): Remove. + (adddi3, adddi3_internal1, adddi3_internal2, adddi3_internal3, + (one_cmpldi2, subdi3, negdi2, clzdi2, ctzdi2, ffsdi2): Remove. + (sync_compare_and_swap): Use rather than . + +2005-05-05 Paul Brook + + * Makefile.in: Replace dependencies on basic-block.h, c-pragma.h, + cfgloop.h, diagnostic.h, insn-attr.h, langhooks-def.h, params.h, + regs.h, system.h, tree-dump.h, tree-gimple.h, tree-scalar-evolution.h + and tree-data-ref.h with *_H variables. + +2005-05-05 Kelley Cook + + * config/m32r/xm-m32r.h, config/m32r/xm-linux.h: Delete files. + +2005-05-05 Kelley Cook + + * system.h: Poison BYTEORDER and HOST_WORDS_BIG_ENDIAN. + +2005-05-04 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Mostafa Hagog and Ayal Zaks. + +2005-05-04 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Emit + setting of vrsave register for current function after + call to save_world is emitted. + +2005-05-05 Hans-Peter Nilsson + + * config/mmix/predicates.md: New file. + * config/mmix/mmix.c (mmix_symbolic_or_address_operand) + (mmix_reg_or_constant_operand, mmix_reg_cc_operand) + (mmix_foldable_comparison_operator, mmix_comparison_operator) + (mmix_reg_or_0_operand, mmix_reg_or_8bit_operand): Remove. + * config/mmix/mmix.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): + Don't define. + * config/mmix/mmix.md: Include predicates.md. + ("call", "call_value"): Force address to register if it isn't a + mmix_symbolic_or_address_operand. + +2005-05-04 Andrew MacLeod + + * tree-flow-inline.h (op_iter_init_use, op_iter_init_def): Assert that + the flags are of appropriate types. + (num_ssa_operands): Generalize using the generic interface. + * tree-ssa-dce.c (remove_dead_stmt): Don't ask for kills on a DEF + iterator. + +2005-05-04 Richard Sandiford + + * protoize.c (version_flag, quiet_flag, nochange_flag, nosave_flag) + (keep_flag, local_flag, global_flag, cplusplus_flag): Make extern. + +2005-05-04 Kazu Hirata + + * tree-outof-ssa.c (edge_leader, stmt_list, + analyze_edges_for_bb): Use VEC instead of VARRAY. + (init_analayze_edges_for_bb, fini_analayze_edges_for_bb): New. + (perform_edge_inserts): Call init_analayze_edges_for_bb and + fini_analayze_edges_for_bb. + +2005-05-04 James E Wilson + + PR driver/21112 + * gcc.c (process_command): In the second argv scan loop, ignore + Xassembler and Xpreprocessor, along with their argument. + +2005-05-04 Kazu Hirata + + * tree-flow-inline.h, tree-ssa-operands.c, + tree-ssa-operands.h, tree-ssa-opfinalize.h: + Likewise. tree-vn.c: Fix comment typos. + * doc/passes.texi, doc/tree-ssa.texi: Fix typos. + +2005-05-04 Paolo Bonzini + + * doc/tm.texi (Target Hooks): Document + TARGET_RESOLVE_OVERLOADED_BUILTIN. + +2005-05-04 Paul Brook + + * Makefile.in: Change dependencies on target.h to $(TARGET_H). + +2005-05-04 Kazu Hirata + + * dwarf2out.c (incomplete_types, retry_incomplete_types, + gen_struct_or_union_type_die, dwarf2out_init): Use VEC instead + of VARRAY. + + * loop-unroll.c (var_to_expand, analyze_insn_to_expand_var, + get_expansion, expand_var_during_unrolling, + insert_var_expansion_initialization, + combine_var_copies_in_loop_exit, release_var_copies): Use VEC + instead of VARRAY. + + * tree-ssa-loop-ivopts.c (rewrite_address_base): Don't call + update_stmt. + +2004-05-03 Andrew Pinski + + PR middle-end/15618 + * fold-const.c (fold_widened_comparison): Treat BOOLEAN_TYPE + the same as INTEGER_TYPE. + (fold_binary): Fold "bool_var != 0" to bool_var. + Fold "bool_var == 1" to bool_var. + +2004-05-03 Richard Henderson + + PR middle-end/21318 + * function.c (instantiate_virtual_regs_in_insn): Use the mode + from recog_data instead of insn_data. + +2005-05-03 DJ Delorie + + * common.opt (fdiagnostics-show-option): No variable is needed. + * diagnostic.h (diagnostic_context): Add show_option_requested flag. + * diagnostic.c (diagnostic_initialize): Initialize show_option_requested. + (diagnostic_report_diagnostic): Test for enabled diagnostics here. + Save and restore original message format. Use flag in context + instead of global. + (warning): Don't test for enabled warnings here. + * opts.c (common_handle_option): Handle -fdiagnostics-show-option + here. + +2005-05-04 Kelley Cook + + * config/m32r/xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN. + * config/m32r/xm-linux.h: Don't undefine HOST_WORDS_BIG_ENDIAN. + * mips-tfile.c: Use WORDS_BIG_ENDIAN instead of HOST_WORDS_BIG_ENDIAN. + * aclocal.m4: Don't include accross.m4. + * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. + Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. + * configure, config.in: Regenerate. + +2005-05-04 Jakub Jelinek + + PR middle-end/21265 + * expr.h (enum block_op_methods): Add BLOCK_OP_TAILCALL. + (clear_storage): Add argument. + * expr.c (emit_block_move_via_libcall, clear_storage_via_libcall): + Add tailcall argument, set CALL_EXPR_TAILCALL of the CALL_EXPR to + tailcall. + (emit_block_move): Handle BLOCK_OP_TAILCALL method. + (clear_storage): Add method argument, handle BLOCK_OP_TAILCALL. + (store_expr, store_constructor): Adjust callers. + * builtins.c (expand_builtin_memcpy): Pass BLOCK_OP_TAILCALL + to emit_block_move if CALL_EXPR_TAILCALL (exp). + (expand_builtin_memmove): Add ORIG_EXP argument, copy + CALL_EXPR_TAILCALL from ORIG_EXP to the new CALL_EXPR. + (expand_builtin_bcopy): Replace ARGLIST and TYPE arguments + with EXP. Pass EXP to expand_builtin_memmove. + (expand_builtin_memset): Add ORIG_EXP argument, pass + BLOCK_OP_TAILCALL to clear_storage if CALL_EXPR_TAILCALL (orig_exp). + (expand_builtin_bzero): Replace ARGLIST argument with EXP. + Pass EXP to expand_builtin_memset. + (expand_builtin_strcmp): Copy CALL_EXPR_TAILCALL from EXP to + the new CALL_EXPR. + (expand_builtin_strncmp): Likewise. + (expand_builtin_printf): Replace ARGLIST argument with EXP. + Copy CALL_EXPR_TAILCALL from EXP to the new CALL_EXPR. + (expand_builtin_fprintf): Likewise. + (expand_builtin): Adjust calls to + expand_builtin_{memmove,bcopy,memset,bzero,{,f}printf}. + + * config/i386/i386.c (ix86_expand_vector_set): Fix setting 3rd and 4th + item in V4SF mode. + + PR rtl-optimization/21239 + * combine.c (combine_simplify_rtx) : Fix a typo. + +2005-05-03 Kazu Hirata + + * tree-flow.h (tree_ann_common_d): Move aux to ... + (stmt_ann_d): ... here. + * tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt, + move_computations_stmt, schedule_sm): Update references to + aux. + * tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Likewise. + + * tree-cfg.c (remove_bb): Remove a redundant call to + set_bb_for_stmt. + * tree-if-conv.c (replace_phi_with_cond_modify_expr): + Likewise. + +2005-05-03 Richard Henderson + + * config/rs6000/rs6000.c: Remove conflict markers. + + * cfg.c (dump_flow_info): Use max_reg_num, not max_regno. + +2005-05-03 James E Wilson + + * dwarf2out.c (lookup_filename): Call maybe_emit_file. + +2005-05-03 DJ Delorie + + * c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery + decide if the warning will be printed. + * calls.c (expand_call): Likewise. + * function.c (init-function_start): Likewise. + + * common.opt (-fdiagnostics-show-option): New. + * opts.c (option_enabled): Accept the option index instead of a + pointer to the option descriptor. + * opts.h (option_enabled): Likewise. + * toplev.c (print_switch_values): Pass option index, not option + descriptor. + * diagnostic.h (diagnostic_info): Add option_index. + * diagnostic.c: Include opts.h. + (diagnostic_set_info): Initialize option_index. + (diagnostic_report_diagnostic): Amend option name if appropriate. + (warning): Check to see if the specified warning is enabled. + Store option index. + * doc/invoke.texi (-fdiagnostics-show-options): Document. + +2005-05-03 Richard Henderson + + * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Fix ALL_REGS and + SPEC_OR_GEN_REGS definitions. + +2005-05-03 Alexandre Oliva + + PR target/16888 + * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Clear reg names + for unavailable registers. + +2005-05-03 Kazu Hirata + + * tree-cfg.c (tree_forwarder_block_p): Fix a typo. + + * cfglayout.c (block_locators_blocks, + insn_locators_initialize, insn_scope): Use VEC instead of + VARRAY. + + * tree-mudflap.c (deferred_static_decls, mudflap_enqueue_decl, + mudflap_finish_file, mudflap_finish_file): Use VEC instead of + VARRAY. + +2005-05-03 Eric Botcazou + + * config/sparc/predicates.md (const_compl_high_operand): New. + * config/sparc/sparc.c (sparc_emit_set_safe_HIGH64): Rename into + gen_safe_HIGH64. + (sparc_emit_set_const64_quick1): Adjust for above change. + (sparc_emit_set_const64_quick2): Likewise. + (sparc_emit_set_const64_longway): Likewise. + (sparc_emit_set_const64): Likewise. + * config/sparc/sparc.md (movhi_const64_special, movsi_const64_special, + movdi_const64_special): Delete. + (logical constant splitters): Use const_compl_high_operand. + +2005-05-03 Richard Guenther + + * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Use STRIP_TYPE_NOPS + rather than STRIP_NOPS. + +2005-05-03 Jakub Jelinek + + PR rtl-optimization/21330 + * loop-unswitch.c (may_unswitch_on): Set *cinsn only when + returning non-NULL. + (unswitch_single_loop): Clear cinsn when retrying. + + PR target/21297 + * config/i386/i386.c (legitimize_address): When canonicalizing + ASHIFT into MULT, multiply by 1 << shift_count instead of + 1 << log2 (shift_count). + +2005-05-03 Andrew MacLeod + + * lambda-code.c (gcc_loop_to_lambda_loop, + lambda_loopnest_to_gcc_loopnest, phi_loop_edge_uses_def, + stmt_is_bumper_for_loop, perfect_nest_p, replace_uses_of_x_with_y): Use + generic operand interface. + * tree-data-ref.c (find_data_references_in_loop): Use generic interface. + * tree-dfa.c (collect_dfa_stats_r, mark_new_vars_to_rename): Use + generic operand interface. + * tree-flow-inline.h (delink_imm_use, link_imm_use_to_list, + link_imm_use, link_imm_use_stmt, relink_imm_use, relink_imm_use_stmt, + next_safe_imm_use, has_zero_uses, has_single_use, single_imm_use, + num_imm_uses): Use ssa_use_operand_t. + (get_def_ops, get_use_ops, get_v_may_def_ops, get_vuse_ops, + get_v_must_def_ops): Delete. + (get_def_from_ptr, get_phi_result_ptr): Get def directly now. + (get_use_op_ptr, get_def_op_ptr, get_v_may_def_result_ptr, + get_v_may_def_op_ptr, get_vuse_op_ptr, get_v_must_def_result_ptr, + get_v_must_def_kill_ptr): Delete. + (delink_stmt_imm_use): Move and use new operand interface. + (op_iter_next_use, op_iter_next_def, op_iter_next_tree, op_iter_init, + op_iter_next_tree): Use new operand implementation. + (clear_and_done_ssa_iter): New. Initialize a blank operand iterator. + (op_iter_init_use, op_iter_init_def, op_iter_init_tree): Add iterator + type check. + (op_iter_next_mustdef, op_iter_next_maydef, + op_iter_next_must_and_may_def): Delete. Replace with... + (op_iter_next_maymustdef): New. Combine must and may next operations. + (op_iter_init_maydef, op_iter_init_mustdef, + op_iter_init_must_and_may_def): Use new interface. + (single_ssa_tree_operand ): New. Process single operands only as trees. + (single_ssa_use_operand): New. Process single operands only as uses. + (single_ssa_def_operand): New. Process single operands only as defs. + (zero_ssa_operands): New. Return TRUE if there are zero operands of the + specified types. + (num_ssa_operands): New. Count the number of specified operands. + (compare_ssa_operands_equal): New. Compare two statements' operands. + (single_phi_def): New. Return true if PHI has one def of the specified + operand type. + (op_iter_init_phiuse): New. Initialize the iterator for PHI arguments. + (op_iter_init_phidef): New. Initialize the iterator for the PHI def. + * tree-flow.h (struct immediate_use_iterator_d): Use ssa_use_operand_t. + (struct stmt_ann_d): Operands field no longer require GTY(). + (vn_compute, vn_lookup_or_add, vn_add, vn_lookup): Change prototype. + * tree-into-ssa.c (mark_def_sites): Use SSA_OP_VMUSTKILL. + * tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb, + dump_replaceable_exprs, rewrite_trees): Use generic interface. + * tree-phinodes.c (make_phi_node, release_phi_node, resize_phi_node): + Use use_operand_p instead of ssa_imm_use_t *. + * tree-pretty-print.c (dump_vops): check if operands are active before + dumping virtual operands. + * tree-sra.c (sra_walk_function): Use ZERO_SSA_OPERANDS. + * tree-ssa-ccp.c (likely_value): Use ZERO_SSA_OPERANDS. + (ccp_fold): Use new interface. + (ccp_visit_stmt): Remove unused variables and code. + (convert_to_gimple_builtin): Insert statements before calling + mark_new_vars_to_rename. + * tree-ssa-copy.c (stmt_may_generate_copy): Use ZERO_SSA_OPERANDS. + (copy_prop_visit_cond_stmt): Use generic interface. + * tree-ssa-dom.c (struct expr_hash_elt): Use stmt pointer, not the + annotation in table. + (thread_across_edge): Use generic interface. + (initialize_hash_element): Initialzie with stmt, not annotation. + (eliminate_redundant_computations): Use generic interface. + (record_equivalences_from_stmt): Pass stmt, not annotation. + (avail_expr_hash, real_avail_expr_hash, avail_expr_eq): Use generic + interface. + * tree-ssa-dse.c (dse_optimize_stmt): Use ZERO_SSA_OPERANDS. + * tree-ssa-loop-ivopts.c (find_invariants_stmt, + find_interesting_uses_stmt, protect_loop_closed_ssa_form_use): Use + generic operand interface. + * tree-ssa-loop-niter.c (chain_of_csts_start, get_val_for): Use generic + interface. + * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Use Generic operand + Interface. + * tree-ssa-operands.c (struct opbuild_list_d): New. Operand build type. + (build_defs, build_uses, build_v_may_defs, build_vuses, + build_v_must_defs): Change type to struct opbuild_list_d. + (ops_active): New. Operands active boolean. + (operand_memory, operand_memory_index): New. Operand memory managers. + (allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype, + allocate_vuse_optype, allocate_v_must_def_optype): Delete. + (free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs): + Change from functions to static variable list heads. + (opbuild_initialize_virtual): New. Initialize a virtual build list. + (opbuild_initialize_real): New. Initialize a virtual build list. + (opbuild_free): New. Free a build list. + (opbuild_num_elems): New. Number of items in a list. + (opbuild_append_real): New. Add a real (tree *) operand. + (opbuild_append_virtual): New. Add and sort a virtual (tree) operand. + (opbuild_first): New. Return first element index in a list. + (opbuild_next): New. Return next element in a list. + (opbuild_elem_real): New. Return real element. + (opbuild_elem_virtual): New. Return virtual element. + (opbuild_elem_uid): New. Return UID of virtual element. + (opbuild_clear): New. Reset an operand list. + (opbuild_remove_elem): New. Remove an element form a list. + (ssa_operands_active): New. Return true if operand cache is active. + (init_ssa_operands, fini_ssa_operands): Initialize new implementation. + (ssa_operand_alloc): New. Allocate memory from an operand chunk. + (correct_use_link): Use use_operand_p. + (finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_defs, + finalize_ssa_vuses, finalize_ssa_v_must_defs): New implmentation. + (cleanup_v_may_defs): Use new implmentation. + (finalize_ssa_stmt_operands, start_ssa_stmt_operands): New + implementation. + (append_def, append_use, append_v_may_def, append_vuse, + append_v_must_def): Call opbuild_append routine instead of using varray. + (build_ssa_operands): Simplify to simply use stmt, don't maintain a + global parse_old_ops variable. + (free_ssa_operands): New implementation. + (update_stmt_operands): Move. Change argument to build_ssa_operands. + (copy_virtual_operands): Move. New generic implementation. + (create_ssa_artficial_load_stmt): Move. New implementation. + (swap_tree_operands): Update for new implementation. + (get_expr_operands): Add stmt parameter to calls to swap_tree_operands. + (add_call_clobber_ops, add_call_read_ops): Initialize opbuild list + rather than a varray. + (verify_imm_links): Use use_operand_p. + (dump_immediate_uses_for): If the immediate use variable is a virtual + variable, show the virtual ops in the stmt. + * tree-ssa-operands.h (def_operand_p): No longer a structure. + (NULL_DEF_OPERAND_P): Now a #define. + (def_optype_d, use_optype_d, v_def_use_operand_type, v_may_def_optype_d, + vuse_operand_type, vuse_optype_d, v_must_def_optype_d): Delete. + (def_optype_d, use_optype_d, maydef_optype_d, vuse_optype_d, + mustdef_optype_d): New. Use Linked list representation. + (SSA_OPERAND_MEMORY_SIZE): New. Size of operand memory chunk. + (struct ssa_operand_memory_d): New. Allocated Chunk node. + (struct stmt_operands_d): Change to new pointers that are not GTY. + (STMT_USE_OPS, NUM_USES, SET_USE_OP, STMT_DEF_OPS, NUM_DEFS, SET_DEF_OP, + STMT_V_MAY_DEF_OPS, NUM_V_MAY_DEFS, SET_V_MAY_DEF_RESULT, + SET_V_MAY_DEF_OP, STMT_VUSE_OPS, NUM_VUSES, SET_VUSE_OP, + STMT_V_MUST_DEF_OPS, NUM_V_MUST_DEFS, SET_V_MUST_DEF_RESULT, + SET_V_MUST_DEF_KILL): Delete. + (V_MAY_DEF_OPS, V_MAY_DEF_RESULT_PTR, V_MAY_DEF_RESULT, + V_MAY_DEF_OP_PTR, V_MAY_DEF_OP): Rename to MAYDEF_*. + (V_MUST_DEF_OPS, V_MUST_DEF_RESULT_PTR, V_MUST_DEF_RESULT, + V_MUST_DEF_KILL_PTR, V_MUST_DEF_KILL): Rename to MUSTDEF_*. + (enum ssa_op_iter_type): Operand iterator typechecking values. + (struct ssa_operand_iterator_d): Use linked lists of operands. + (SSA_OP_VMUSTDEFKILL): Rename to SSA_OP_VMUSTKILL. + (FOR_EACH_SSA_MAYDEF_OPERAND, FOR_EACH_SSA_MUSTDEF_OPERAND, + FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): Use op_iter_next_maymustdef. + (FOR_EACH_PHI_ARG): New. Iterate over PHI arguments. + (FOR_EACH_PHI_OR_STMT_USE): New. Iterate over PHI or stmt uses. + (FOR_EACH_PHI_OR_STMT_DEF): New. Iterate over PHI or stmt defs. + (SINGLE_SSA_TREE_OPERAND, SINGLE_SSA_USE_OPERAND, + SINGLE_SSA_DEF_OPERAND, ZERO_SSA_OPERANDS, NUM_SSA_OPERANDS): New. + * tree-ssa-opfinalize.h: New. Function templates for expansion. + (FINALIZE_ALLOC): Expands into alloc_def, alloc_use, alloc_maydef, + alloc_vuse, and alloc_mustdef. + (FINALIZE_FUNC): Expands into finalize_ssa_def_ops, + finalize_ssa_use_ops, finalize_ssa_v_may_def_ops, finalize_ssa_vuse_ops, + and finalize_ssa_v_must_def_ops. + * tree-ssa-pre.c (add_to_sets): Pass tree to vn_add. + (create_value_expr_from): Use stmt not vuse_optype as a parameter. Pass + stmt around. + (compute_avail): Use generic iterator interface. + * tree-ssa-propagate.c (first_vdef): Use generic operand interface. + (stmt_makes_single_load, stmt_makes_single_store): Use + ZERO_SSA_OPERANDS. + * tree-ssa-sink.c (is_hidden_global_store): Use ZERO_SSA_OPERANDS. + (statement_sink_location): Use generic interface. + * tree-ssa.c (verify_ssa): Use %p in fprintf. Use generic interface. + (delete_tree_ssa): Don't call release_defs. Call release_ssa_name and + reset the immediate use link nodes. + (stmt_references_memory_p): Use ZERO_SSA_OPERANDS. + * tree-ssanames.c (make_ssa_name): Use use_operand_p. + * tree-tailcall.c (find_tail_calls): Use ZERO_SSA_OPERANDS. + (eliminate_tail_call): Use generic operand interface. + * tree-vect-analyze.c (vect_analyze_data_refs): Use ZERO_SSA_OPERANDS. + (vect_mark_relevant, vect_mark_stmts_to_be_vectorized): Use generic + interface. + * tree-vect-transform.c (update_vuses_to_preheader): Use generic + interface. + * tree-vectorizer.c (rename_variables_in_bb): Use generic interface. + * tree-vn.c (struct val_expr_pair_d): Cache statment pointer instead of + vuse_optype. + (vn_compute, val_expr_pair_hash, vn_add, vn_lookup, vn_lookup_or_add): + Use statement pointer instead of vuse_optype. Use generic interface. + * tree-vrp.c (maybe_add_assert_expr): Use generic interface. + (stmt_interesting_for_vrp, vrp_visit_stmt): Use ZERO_SSA_OPERANDS. + * tree.h (struct ssa_imm_use_d): Renamed to ssa_use_operand_d. + (tree_ssa_name, phi_arg_d): Use ssa_use_operand_d. + * doc/tree-ssa.texi: Update documentation for operand interface. + +2005-05-03 Nathan Sidwell + + * config/darwin.c (machopic_define_symbol): Use gcc_assert or + gcc_unreachable as appropriate. + (machopic_function_base_name, machopic_indirect_data_reference, + machopic_legitimize_pic_address, darwin_non_lazy_pcrel): Likewise. + * config/host-darwin.c (darwin_gt_pch_use_address): Likewise + * config/rs6000/altivec.md (*mov_internal, + build_vector_mask_for_load): Likewise. + * config/rs6000/darwin.md (movdf_low_si, movdf_low_di, + *call_nonlocal_darwin64, *call_value_nonlocal_darwin64, + *sibcall_symbolic_64, *sibcall_value_symbolic_64): Likewise. + * config/rs6000/predicates.md (easy_fp_constant, + logical_operand): Likewise. + * config/rs6000/rs6000.c (spe_expand_predicate_builtin, + compute_save_world_info, rs6000_emit_prologue, + rs6000_output_mi_thunk): Reword comments to avoid 'abort'. + * config/rs6000/host-darwin.c (segv_handler): Use fancy_abort + directly. + +2005-05-03 Uros Bizjak + + PR middle-end/21282 + * convert.c (convert_to_integer): Convert ceil and floor in + c99 mode only. + +2005-04-29 Geoffrey Keating + + PR target/20813 + * config/rs6000/rs6000.md (floatsidf2_internal): Merge to create + define_insn_and_split. Split only when memory operand is + offsettable. Use adjust_address rather than plus_constant. + (floatunssidf2_internal): Likewise. + (fix_truncdfsi2_internal): Split only when memory operand is + offsettable. Use adjust_address rather than plus_constant. + (fix_trunctfsi2_internal): Likewise. + (floatsidf2_internal): Likewise. + +2005-05-02 Diego Novillo + + * tree-vrp.c (set_value_range_to_nonnull): Declare inline. + (set_value_range_to_null): Likewise. + (set_value_range_to_varying): New function. Use it in all + call sites that used to call set_value_range (vr, VR_VARYING, ...). + (extract_range_from_assert): If the integral type has a + super-type, and LIMIT is not within MIN and MAX values of that + type, set the resulting range to VR_VARYING. + +2005-05-02 Hans-Peter Nilsson + + * config/mmix/mmix.opt: New file. + * config/mmix/mmix.h: Move options-related comments to mmix.opt. + (mmix_cc1_ignored_option): Don't declare. + (TARGET_OPTIONS, TARGET_MASK_LIBFUNCS, TARGET_MASK_ABI_GNU) + (TARGET_MASK_FCMP_EPSILON, TARGET_MASK_ZERO_EXTEND) + (TARGET_MASK_KNUTH_DIVISION, TARGET_MASK_TOPLEVEL_SYMBOLS) + (TARGET_MASK_BRANCH_PREDICT, TARGET_MASK_USE_RETURN_INSN) + (TARGET_MASK_BASE_ADDRESSES, TARGET_LIBFUNC, TARGET_ABI_GNU, + (TARGET_FCMP_EPSILON, TARGET_ZERO_EXTEND, TARGET_KNUTH_DIVISION) + (TARGET_TOPLEVEL_SYMBOLS, TARGET_BRANCH_PREDICT) + (TARGET_BASE_ADDRESSES, TARGET_USE_RETURN_INSN, TARGET_SWITCHES): + Don't define. + (TARGET_DEFAULT): Change TARGET_MASK_... to MASK_... + * config/mmix/mmix.c (mmix_cc1_ignored_option): Remove. + (TARGET_DEFAULT_TARGET_FLAGS): Override default. + +2005-05-02 Joseph S. Myers + + PR c/15698 + * c-tree.h (C_DECL_BUILTIN_PROTOTYPE): New. + * c-decl.c (current_function_prototype_built_in, + current_function_prototype_arg_types): New. + (merge_decls): Keep source location of prototype followed by + nonprototype declaration. Update C_DECL_BUILTIN_PROTOTYPE. + (builtin_function): Set C_DECL_BUILTIN_PROTOTYPE. + (start_function): Always set current_function_prototype_locus, + current_function_prototype_built_in and + current_function_prototype_arg_types. Check for external + prototype whether or not visible for external function and set + current_function_prototype_arg_types accordingly. + (store_parm_decls_oldstyle): Use + current_function_prototype_arg_types for checking old-style + definition against prototype. Give warnings only if + current_function_prototype_built_in). + +2005-05-02 Daniel Jacobowitz + + * ggc.h (ggc_alloc_zone_pass_stat): New macro. + (ggc_alloc_zone_stat): Don't define. + * ggc-zone.c (ggc_alloc_typed_stat, ggc_alloc_stat): Use + ggc_alloc_zone_pass_stat. + * rtl.c (rtx_alloc_stat, shallow_copy_rtx_stat): Likewise. + * tree.c (make_node_stat, copy_node_stat, make_tree_binfo_stat) + (make_tree_vec_stat, tree_cons_stat, build1_stat): Likewise. + +2005-05-02 Daniel Jacobowitz + + * calls.c (expand_call): Handle current_function_pretend_args_size + when checking for sibcalls. + +2005-05-02 Kazu Hirata + + PR tree-optimization/21294 + * tree-vrp.c (vrp_expr_computes_nonzero): New. + (extract_range_from_expr): Call vrp_expr_computes_nonzero. + +2005-05-02 Janis Johnson + + PR 19985 + * gcov-io.h: Declare gcov external functions hidden. + +2005-05-02 Kazu Hirata + + * tree-ssa-uncprop.c (equiv_hash_elt, remove_equivalence, + record_equiv, tree_ssa_uncprop, uncprop_into_successor_phis): + Use VEC instead of VARRAY. + (equiv_free): New. + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor + out common code. + +2005-05-02 Paolo Bonzini + + * c-common.c (resolve_overloaded_builtin): Forward to target + hook for BUILT_IN_MD built-ins. + * c-typeck.c (finish_call_expr): Call resolve_overloaded_builtin + for all types of built-in. + * target-def.h (TARGET_RESOLVE_OVERLOADED_BUILTIN): New. Use it + in the definition of the target hooks struct. + * target.h (struct gcc_target): Add resolve_overloaded_builtin. + * config/rs6000/altivec.h: Rewritten. + * config/rs6000/rs6000-c.c (struct altivec_builtin_types, + altivec_resolve_overloaded_builtin, altivec_build_resolved_builtin, + rs6000_builtin_type, rs6000_builtin_type_compatible, + altivec_overloaded_builtins, rs6000_builtin_type, + rs6000_builtin_type_compatible): New. + * config/rs6000/rs6000.c (rs6000_builtin_types, rs6000_builtin_decls): + New. + (def_builtin): Turn into a function. Check for duplicates and store + the builtin into rs6000_builtin_decls. + (bdesc_3arg, bdesc_dst, bdesc_altivec_preds, bdesc_2arg, + bdesc_1arg): Add overloaded builtins. + (altivec_expand_builtin): Check for unresolved overloaded builtins, + do not support ALTIVEC_COMPILETIME_ERROR. + (rs6000_init_builtins): Add opaque 128-bit vector, and internal + nodes to represent front-end types. + (altivec_init_builtins, rs6000_common_init_builtins): Create builtins + with opaque arguments and/or return values. + * config/rs6000/rs6000.h (enum rs6000_builtins): Remove + ALTIVEC_COMPILETIME_ERROR and add Altivec overloaded builtins. + (rs6000_builtin_type_index): New. + (is_ev64_opaque_type): Rename to... + (rs6000_is_opaque_type): ... this. + (rs6000_cpu_cpp_builtins): Install the resolve_overloaded_builtin + target hook. + +2005-05-02 Kazu Hirata + + * function.c (reorder_blocks, reorder_blocks_1): Use VEC + instead of VARRAY. + +2005-05-02 Nathan Sidwell + Bernd Schmidt + + * config/bfin/bfin.c (emit_link_insn, effective_address_32bit_p, + print_address_operand, print_operand, legitimize_pic_address, + asm_conditional_branch, bfin_gen_compare, output_push_multiple, + output_pop_multiple): Use gcc_assert or gcc_unreachable as + appropriate. + * config/bfin/bfin.md (movsf splitter, beq, bne): Likewise. + +2005-05-02 Dorit Naishlos + + * doc/passes.texi: Document vectorization pass. + +2005-05-02 Kazu Hirata + + * tree-scalar-evolution.c (get_exit_conditions_rec, + select_loops_exit_conditions, + number_of_iterations_for_all_loops, + analyze_scalar_evolution_for_all_loop_phi_nodes, + scev_analysis): Use VEC instead of VARRAY. + +2005-05-02 Michael Matz + + PR c++/19542 + * c-common.c (c_common_nodes_and_builtins): Create global null_node. + (warn_strict_null_sentinel): Define. + (check_function_sentinel): Check for null_node as valid sentinel too. + * c-common.h (c_tree_index): Added CTI_NULL. + (null_node) Define global_tree[CTI_NULL]. + (warn_strict_null_sentinel): Declare. + * c-opts.c: (c_common_handle_option): Handle -Wstrict-null-sentinel. + * c.opt: (Wstrict-null-sentinel): New C++ option. + * doc/invoke.texi (C++ Options): Document -Wstrict-null-sentinel. + +2005-05-01 Kazu Hirata + + * gimplify.c (gimplify_compound_lval): Use VEC instead of + VARRAY. + + * global.c (calculate_reg_pav): Use VEC instead of VARRAY. + + * dwarf2out.c (decl_scope_table, push_decl_scope, + pop_decl_scope, scope_die_for, dwarf2out_init): Use VEC + instead of VARRAY. + +2005-05-01 Mark Mitchell + + PR C++/14391 + * c-cppbuiltin.c (c_cpp_builtins): Do not define __GXX_WEAK__ to 1 + if !flag_weak. + * doc/cpp.texi (__DEPRECATED): Document. + (__EXCEPTIONS): Likewise. + (__GXX_WEAK__): Likewise. + + * function.c (INVOKE__main): Do not define. + (expand_main_function): Check HAS_INIT_SECTION when determining + whether or not to call __main. + +2005-05-01 Kazu Hirata + + * tree-ssa-loop-ivopts.c: Fix a comment typo. + +2005-01-05 Paul Brook + + * config/arm/arm.h (ARM_EMIT_TRAMPOLINE_CACHE_CLEAR): Define. + (INITIALIZE_TRAMPOLINE): Use it. + * config/arm/linux-gas.h (INITIALIZE_TRAMPOLINE): Remove. + * config/arm/netbsd.h (INITIALIZE_TRAMPOLINE): Remove. + * config/arm/netbsd-elf.h (INITIALIZE_TRAMPOLINE): Remove. + +2005-05-01 Gerald Pfeifer + + * doc/install.texi (Specific): Omit dots in the @anchors names + for i?86-*-sco3.2v5*, i?86-*-solaris2.10, and sparc-sun-solaris2.7. + Omit underscores for x86_64-*-* and the "all ELF targets" entry. + +2005-05-01 Zdenek Dvorak + + PR tree-optimization/18316 + PR tree-optimization/19126 + * tree.c (build_int_cst_type): Avoid shift by size of type. + * tree-scalar-evolution.c (simple_iv): Add allow_nonconstant_step + argument. + * tree-scalar-evolution.h (simple_iv): Declaration changed. + * tree-ssa-loop-ivopts.c (struct iv_cand): Add depends_on + field. + (dump_cand): Dump depends_on information. + (determine_biv_step): Add argument to simple_iv call. + (contains_abnormal_ssa_name_p): Handle case expr == NULL. + (find_bivs, find_givs_in_stmt_scev): Do not require step to be a + constant. + (add_candidate_1): Record depends_on for candidates. + (tree_int_cst_sign_bit, constant_multiple_of): New functions. + (get_computation_at, get_computation_cost_at, may_eliminate_iv): + Handle ivs with nonconstant step. + (iv_ca_set_remove_invariants, iv_ca_set_add_invariants): New functions. + (iv_ca_set_no_cp, iv_ca_set_cp): Handle cand->depends_on. + (create_new_iv): Unshare the step before passing it to create_iv. + (free_loop_data): Free cand->depends_on. + (build_addr_strip_iref): New function. + (find_interesting_uses_address): Use build_addr_strip_iref. + (strip_offset_1): Split the recursive part from strip_offset. + Strip constant offset component_refs and array_refs. + (strip_offset): Split the recursive part to strip_offset_1. + (add_address_candidates): Removed. + (add_derived_ivs_candidates): Do not use add_address_candidates. + (add_iv_value_candidates): Add candidates with stripped constant + offset. Consider all candidates with initial value 0 important. + (struct affine_tree_combination): New. + (aff_combination_const, aff_combination_elt, aff_combination_scale, + aff_combination_add_elt, aff_combination_add, + tree_to_aff_combination, add_elt_to_tree, aff_combination_to_tree, + fold_affine_sum): New functions. + (get_computation_at): Use fold_affine_sum. + * tree-ssa-loop-manip.c (create_iv): Handle ivs with nonconstant step. + * tree-ssa-loop-niter.c (number_of_iterations_exit): Add argument + to simple_iv call. + +2005-04-30 Michael Matz + + * config/i386/i386.md (movmemsi): Also active when + TARGET_INLINE_ALL_STRINGOPS. + +2005-04-30 Eric Botcazou + + PR bootstrap/20633 + * config/freebsd-spec.h (FBSD_CPP_SPEC): Add %(cpp_arch). + +2005-04-30 Paul Brook + + * config/arm/bpabi.h (RENAME_LIBRARY_SET): Always use .thumb_set in + thumb mode. + * config/arm/ieee754-df.S: Use __INTERWORKING_STUBS__. + * config/arm/ieee754-sf.S: Ditto. + * config/arm/lib1funcs.asm: Define and use __INTERWORKING_STUBS__. + (FUNC_ALIAS): Use .thumb_set for thumb routines. + +2005-04-30 Kazu Hirata + + * tree-ssanames.c: Fix a comment typo. + * doc/options.texi: Fix a typo. + +2005-04-30 Nathan Sidwell + + * config/h8300/h8300.c (byte_reg): Use gcc_assert and + gcc_unreachable as appropriate. + (split_adds_subs, cond_string, print_operand, + h8300_initial_elimination_offset, h8300_classify_operand, + h8300_unary_length, h8300_short_immediate_length, + h8300_bitfield_length, h8300_binary_length, + h8300_insn_length_from_table, compute_mov_length, output_plussi, + compute_plussi_length, compute_plussi_cc, output_logical_op, + compute_logical_op_length, compute_logical_op_cc, + output_h8sx_shift, get_shift_alg, h8300_shift_needs_scratch_p, + output_a_shift, compute_a_shift_length, compute_a_shift_cc, + output_a_rotate, compute_a_rotate_length, fix_bit_operand, + h8300_regs_ok_for_stm): Likewise. + * config/h8300/h8300.md (*movsi_h8300, *movsf_h8300, + monitor_prologue): Likewise. + +2005-04-30 Kazu Hirata + + * loop-invariant.c (invariants, create_new_invariant, + get_inv_cost, best_gain_for_invariant, + find_invariants_to_move, move_invariants, + init_inv_motion_data, free_inv_motion_data): Use VEC instead + of VARRAY. + +2005-04-29 Richard Henderson + + * function.c (instantiate_decls): Remove valid_only argument. + (instantiate_decls_1, instantiate_decl): Likewise. + (instantiate_virtual_regs_1): Delete. + (instantiate_virtual_regs_lossage): Delete. + (instantiate_virtual_regs_in_rtx): New. + (safe_insn_predicate): New. + (instantiate_virtual_regs_in_insn): New. + (instantiate_virtual_regs): Update to match all that. Only run + instantiate_decls once. + +2005-04-29 Richard Henderson + Daniel Jacobowitz + + * gengtype.c (write_func_for_structure): Split out ... + (output_type_enum): ... new function. Fix thinko accessing + TYPE_PARAM_STRUCT data. + +2005-04-29 Tom Tromey + + * tree.c (build_block): Removed unused 'tags' argument. + * tree.h (build_block): Removed argument. + +2005-04-29 Michael Matz + + PR rtl-optimization/21144 + * postreload.c (reload_cse_move2add): Check for VOIDmode. + +2005-04-29 Bob Wilson + + * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Define to disable + flag_reorder_blocks. + +2005-04-28 Kazu Hirata + + PR tree-optimization/21030 + * tree-vrp.c (adjust_range_with_scev): Do not create invalid + ranges where VR->MAX is smaller than VR->MIN. + +2005-04-29 Devang Patel + + PR tree-optimization/21272 + PR tree-optimization/21266 + * tree-if-conv.c (find_phi_replacement_condition): Fix think-o. + +2005-04-29 Kazu Hirata + + * tree-flow-inline.h: Fix a comment typo. + * doc/tree-ssa.texi: Fix a typo. + + * tree-flow-inline.h, tree-ssa-operands.c: Fix comment typos. + +2005-04-29 Nathan Sidwell + + * config/fr30/fr30.c (fr30_expand_prologue): Use gcc_assert and + gcc_unreachable as appropriate. + (fr30_expand_epilogue, fr30_setup_incoming_varargs, + fr30_print_operand, fr30_move_double): Likewise. + * config/fr30/fr30.md (*movsi_internal, *movsf_internal): Likewise. + +2005-04-29 Mark Mitchell + + * config/arm/arm.h (ARM_EABI_CTORS_SECTION_OP): Do not define if a + definition has already been provided. + (ARM_EABI_DTORS_SECTION_OP): Likewise. + * config/arm/symbian.h (ARM_EABI_CTORS_SECTION_OP): Define. + (ARM_EABI_DTORS_SECTION_OP): Likewise. + +2005-04-29 Jim Tison + + * config/s390/s390.md ("prologue_tpf", "epilogue_tpf"): Alter + trace hooks calls to improve performance. + +2005-04-29 Julian Brown + Mark Mitchell + Paul Brook + + * crtstuff.c: Handle targets that use .init_array. + * function.c (HAS_INIT_SECTION): Do not define. Instead, make sure + that INVOKE__main is set correctly. + (expand_main_function): Test INVOKE__main. + * libgcc2.c: Do not define __main when using .init_array. + * config/arm/arm.c (arm_elf_asm_constructor): New function. + * config/arm/arm.h (CTORS_SECTION_ASM_OP): Define, with specialized + libgcc version. + (DTORS_SECTION_ASM_OP): Likewise. + (CTOR_LIST_BEGIN): Define specially when in libgcc. + (CTOR_LIST_END): Likewise. + (DTOR_LIST_BEGIN): Likewise. + (DTOR_LIST_END): Likewise. + * config/arm/bpapi.h (INIT_SECTION_ASM_OP): Do not define it. + (FINI_SECTION_ASM_OP): Likewise. + (INIT_ARRAY_SECTION_ASM_OP): Define. + (FINI_ARRAY_SECTION_ASM_OP): Likewise. + * config/arm/elf.h (TARGET_ASM_CONSTRUCTOR): Define. + (SUPPORTS_INIT_PRIORITY): Evaluate to false for EABI based targets. + * doc/tm.texi (INIT_ARRAY_SECTION_ASM_OP): Document. + (FINI_ARRAY_SECTION_ASM_OP): Likewise. + +2005-04-29 Nathan Sidwell + + * config/m68k/m68k.c (m68k_initial_elimination_offset): Use + gcc_assert and gcc_unreachable as appropriate. + (output_dbcc_and_branch, output_scc_di, legitimize_pic_address, + const_int_cost, output_move_const_into_data_reg, + output_move_qimode, output_move_double, find_addr_reg, + print_operand, print_operand_address): Likewise. + * config/m68k/m68k.md (adddi3, subdi3, negsf2, negdf2, abssf2, + absdf2, sordered, sunordered, suneq, sunge, sungt, sunle, sunlt, + sltgt, bordered, bunordered, buneq, bunge, bungt, bunle, bunlt, + bltgt, *bordered_rev, *bunordered_rev, *buneq_rev, *bunge_rev, + *bunle_rev, *bunlt_rev, *bltgt_rev, negxf2, absxf2, + conditional_trap): Likewise. + * config/m68k/m68kelf.h (ASM_OUTPUT_ALIGN): Remove unreachable code. + +2005-04-29 Nathan Sidwell + + * config/xtensa/xtensa.c (gen_int_relational): Use gcc_assert and + gcc_unreachable as appropriate. + (gen_conditional_move, xtensa_split_operand_pair, + xtensa_split_operand_pair, xtensa_copy_incoming_a7, + xtensa_copy_incoming_a7, xtensa_copy_incoming_a7, + xtensa_copy_incoming_a7, xtensa_output_literal, + xtensa_output_literal, xtensa_output_literal): Likewise. + * config/xtensa/xtensa.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/xtensa/xtensa.md (*btrue, *bfalse, *ubtrue, *ubfalse, + *bittrue, *bitfalse, *masktrue, *maskfalse, movsicc_internal0, + movsicc_internal1, movsfcc_internal0, + movsfcc_internal1): Likewise. + +2005-04-28 James E Wilson + + * config/i386/i386.h (HI_REGISTER_NAMES): Fix typos in comment. + (ADDITIONAL_REGISTER_NAMES): Delete obsolete mmx register entries. + +2005-04-28 DJ Delorie + + * opt-functions.awk (var_set): Emit proper initializer for + non-target bitfields. + +2005-04-28 Devang Patel + + * dbxout.c (have_used_extensions): Remove. + (dbxout_type_fileds, dbxout_type, dbxout_symbol): Remove use of + have_used_extensions. + +2005-04-28 James E Wilson + + * doc/install.texi: Update -enable-languages info. Correct path to + html docs. + +2005-04-28 DJ Delorie + + * optc-gen.awk (END): Make sure no variable is defined more + than once. + * opth-gen.awk (END): Allocate bits on a per-variable basis. + Allow for bitfield variables other than target_flags. + * doc/options.text (Mask): Document that you may specify a + variable other than target_flags. + +2005-04-28 Martin Koegler + + PR rtl-optimization/18877 + * reload.c (decompose) : Handle pseudo reg + number in val.start. + +2005-04-28 David Edelsohn + + PR target/20813 + * config/rs6000/aix43.h (SUBSUBTARGET_SWITCHES, aix64): Add + MASK_PPC_GFXOPT. + * config/rs6000/aix51.h (SUBSUBTARGET_SWITCHES, aix64): Same. + * config/rs6000/aix52.h (SUBSUBTARGET_SWITCHES, aix64): Same. + * config/rs6000/sysv4.h (SUBTARGET_SWITCHES, 64): Same. + +2005-04-28 Richard Earnshaw + + * arm.c (legitimize_pic_address): Fix sense of assertion test for + creating pseudos when the base offset is too large. + +2005-04-28 Kazu Hirata + + * global.c (earlyclobber_regclass): Change the type to + VEC(int,heap). + (check_earlyclobber): Update uses of earlyclobber_regclass. + (mark_reg_use_for_earlyclobber): Likewise. + (calculate_local_reg_bb_info): Allocate and free + earlyclobber_regclass using the VEC API. + +2005-04-28 Nathan Sidwell + + * tree-ssa-alias.c (push_fields_onto_fieldstack): Remove bogus + assert. + +2005-04-28 Kazu Hirata + + * modulo-sched.c, tree-stdarg.c: Use targetm.foo instead of + (*targetm.foo). + + * config.gcc: Obsolete c4x-* and tic4x-*. + + * tree.h (edge_def): Remove. + + * bt-load.c, cfgexpand.c, dwarf2out.c, emit-rtl.c, expr.c, + function.c, global.c, lcm.c, loop-invariant.c, optabs.c, + reorg.c, resource.c, tree-ssa-loop-ivopts.c, value-prof.c: Use + JUMP_P, LABEL_P, REG_P, MEM_P, NONJUMP_INSN_P, and INSN_P + where appropriate. + + * attribs.c, c-pragma.c, caller-save.c, cfghooks.h, + coverage.c, cselib.h, domwalk.c, domwalk.h, errors.c, + errors.h, gcov-dump.c, gcov-io.c, gcov-io.h, gen-protos.c, + genattrtab.h, genextract.c, gthr-win32.h, insn-notes.def, + integrate.c, lambda-mat.c, lambda.h, libgcov.c, local-alloc.c, + machmode.def, mips-tfile.c, params.c, pretty-print.c, + print-rtl.c, protoize.c, regmove.c, sched-vis.c, tree-chrec.h, + tree-data-ref.h, vec.h, config/darwin-c.c, config/sol2-c.c, + config/sol2.c, config/arm/arm-cores.def, config/arm/cirrus.md, + config/arm/symbian.h, config/c4x/c4x.c, config/c4x/c4x.h, + config/i386/cygming.h, config/i386/djgpp.h, + config/i386/lynx.h, config/i386/netware.c, + config/i386/winnt.c, config/ia64/ia64-c.c, + config/iq2000/iq2000.c, config/m32r/little.h, + config/m68k/m68k-protos.h, config/m68k/m68k.h, + config/m68k/m68k.md, config/mcore/mcore.c, + config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.md, + config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, + config/mn10300/mn10300.h, config/ns32k/netbsd.h, + config/ns32k/ns32k.c, config/ns32k/ns32k.h, + config/pa/pa-hpux11.h, config/pdp11/pdp11.c, + config/pdp11/pdp11.h, config/rs6000/darwin.h, + config/rs6000/default64.h, config/rs6000/rs6000-c.c, + config/s390/2064.md, config/s390/2084.md, + config/s390/s390-modes.def, config/s390/s390-protos.h, + config/s390/tpf.h, config/sh/sh.h, config/sh/symbian.c, + config/stormy16/stormy16.c, config/vax/vax-protos.h, + config/vax/vax.c, config/vax/vax.h, + config/xtensa/lib1funcs.asm, config/xtensa/xtensa.md: Update + copyright. + +2005-04-28 Joseph S. Myers + + * c-typeck.c (build_compound_expr): Correct logic in last change. + +2005-04-27 James E. Wilson + + * config/ia64/ia64.c (update_set_flags): Delete ppred and pcond + parameters. Replace conditional move code with assert checking for + ar.lc. Delete obsolete comments. + (set_src_needs_barrier): Delete cond parameter, and code using it. + (rtx_needs_barrier): Delete initialization of cond. Fix typo in + assert checking for PR_REGS. Fix calls to update_set_flags and + set_src_needs_barrier. + (group_barrier_needed): Renamed from group_barrier_needed_p. Fix all + callers. Rewrite explanatory comment before the function. + (safe_group_barrier_needed): Renamed from safe_group_barrier_needed_p. + Fix all callers. + +2005-04-27 Mike Stump + + * doc/cpp.texi: gcc now implements universal character names. + +2005-04-27 Joseph S. Myers + + PR c/21159 + * c-typeck.c (build_compound_expr): Don't warn for left-hand side + being a compound expression whose right-hand side is cast to void. + +2005-04-27 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Remove targetm.have_named_sections test. + (fix_edges_for_rarely_executed_code): Likewise. + (insert_section_boundary_note): Likewise. + (reorder_basic_blocks): Check partitioning flag before calling + verify_hot_cold_block_grouping. + * dbxout.c (dbxout_function_end): Get hot/cold section labels from + the function struct rather than global variables. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro. + (COLD_END_LABEL): Likewise + (cold_text_section_label): New static global variable. + (cold_end_label): Likewise. + (dwarf2out_switch_text_section): Get hot/cold section labels from + the function struct rather than global variables; test to make sure + cfun is defined. + (output_aranges): Use cold_text_section_label and cold_end_label; + check partitioning flag before putting out delta. + (output_ranges): Remove incorrect code attempting to use + hot/cold labels. + (output_line_info): Get cold section label from function struct; test + to make sure cfun is defined. + (add_location_or_const_value_attribute): Likewise. + (dwarf2out_var_location): Likewise. + (dwarf2out_init): Generate cold_text_section_label and cold_end_label; + write out cold_text_section_label if partition flag is set. + (dwarf2out_finish): Write out cold_end_label if partition flag is set; + * function.h (struct function): Add new fields to point to hot/cold + section labels: hot_section_label, cold_section_label, + hot_section_end_label and cold_section_end_label; also add new field + for cold text section name, unlikely_text_section_name. + * opts.c (decode_options): Turn off partitioning flag if + !targetm.have_named_sections. + * output.h (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_section_label): Remove. + (unlikely_text_section_name): Remove. + * passes.c (rest_of_handle_final): Remove extra blank line. + * varasm.c (unlikely_section_label): Remove. + (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_text_section_name): Remove. + (initialize_cold_section_name): Modify to call + targetm.strip_name_encoding; to store cold section name in current + function struct, if it exists; and to only use the decl_section_name + if flag_named_sections is true. + (unlikely_text_section): Modify to get section name out of current + function struct, if there is one; otherwise build it from + UNLIKELY_EXECUTED_TEXT_SECTION_NAME. + (in_unlikely_text_section): Likewise. + (named_section): Modify to get/put cold section name in current function + struct, if there is one. + (function_section): Change 'bool unlikely' to 'int reloc'; check + targetm.have_named_sections before calling named_section. + (current_function_section): Likewise. + (assemble_start_function): Modify to get/put unlikely_text_section_name + in current function struct; modify to get hot/cold section labels + from function struct; initialize labels using + ASM_GENERATE_INTERNAL_LABEL; + test partitioning flag before writing out hot section label. + (assemble_end_function): Test partitioning flag before writing out + hot/cold section labels. + (default_section_type_flags_1): Get cold text section name from + function struct if there is one; Set flags correctly for + cold text section if there is not a current function struct. + +2005-04-27 Richard Guenther + + * tree-ssa-propagate.c (set_rhs): Revert last change. + +2005-04-27 Steve Ellcey + + * explow.c (convert_memory_address): Add gcc_assert. + +2005-04-27 Mark Mitchell + + * configure.ac: Check for ld --sysroot support. + * gcc.c: Document %R specifier for specs. + (SYSROOT_SPEC): New macro. + (sysroot_spec): New variable. + (static_specs): Add sysroot_spec. + (main): Pass the sysroot spec to the linker if appropriate. + * configure: Regenerated. + * config.in: Likewise. + +2005-04-27 Richard Guenther + + * fold-const.c (fold_binary): Use build_fold_addr_expr + for address calculation and INDIRECT_REF handling. + +2005-04-27 Andrew Haley + + * postreload-gcse.c (hash_scan_set): Remove bogus assertion. + +2005-04-27 Nathan Sidwell + + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Reserve arm frame + pointer when thumb backtracing is on. + + * config/fp-bit.c (abort): Revert change. + +2005-04-27 Ian Lance Taylor + + * c-semantics.c (add_stmt): Don't test STATEMENT_CODE_P. + +2005-04-27 Kazu Hirata + + * tree-ssa-dce.c: Fix a comment typo. + +2005-04-27 David S. Miller + + * explow.c (allocate_dynamic_stack_space SETJMP_VIA_SAVE_AREA): + Kill setjmpless_size. current_function_calls_setjmp is completely + computed when we are called, so just use the optimized size value + instead of using REG_SAVE_AREA notes. + (optimize_save_area_alloca): Delete.... + * rtl.h (optimize_save_area_alloca): Likewise... + * passes.c (rest_of_compilation): and don't call it any more. + * reg-notes.def (SAVE_AREA): Delete. + +2005-04-27 Nathan Sidwell + + * config/fp-bit.c (abort): Add noreturn attribute. + + * config/avr/avr.c (avr_naked_function_p): Use gcc_assert and + gcc_unreachable as appropriate. + (ptrreg_to_str, cond_string, avr_normalize_condition): Likewise. + * config/avr/avr.h (ASM_OUTPUT_REG_PUSH, + ASM_OUTPUT_REG_POP): Likewise. + +2005-04-27 Paolo Bonzini + + * tree-complex.c (expand_vector_operations_1): Do not build + VIEW_CONVERT_EXPR's for the lhs. + +2005-04-27 Nathan Sidwell + + * config/pa/pa.h (PRINT_OPERAND_ADDRESS): Use gcc_assert, remove + unnecessary noncanonical RTL handling. + * config/pa/pa64-linux.h (INITIAL_ELIMINATION_OFFSET): Use + gcc_assert and gcc_unreachable. + + * config/arm/arm.h (ARM_PRINT_OPERAND_ADDRESS): Use gcc_assert and + gcc_unreachable as appropriate. + (THUMB_PRINT_OPERAND_ADDRESS): Likewise. + * config/arm/arm.c (arm_override_options, arm_compute_func_type, + use_return_insn, const_ok_for_op, arm_gen_constant, + arm_canonicalize_comparison, legitimize_pic_address, + thumb_find_work_register, arm_load_pic_register, arm_rtx_costs_1, + arm_cirrus_insn_p, cirrus_reorg, minmax_code, + load_multiple_sequence, emit_ldm_seq, store_multiple_sequence, + emit_stm_seq, arm_gen_movmemqi, arm_select_dominance_cc_mode, + arm_select_cc_mode, arm_reload_in_hi, arm_reload_out_hi, + move_minipool_fix_forward_ref, move_minipool_fix_backward_ref, + dump_minipool, create_fix_barrier, push_minipool_fix, arm_reorg, + fp_immediate_constant, fp_const_from_val, vfp_output_fstmx, + output_call, output_mov_long_double_fpa_from_arm, + output_mov_long_double_arm_from_fpa, + output_mov_double_fpa_from_arm, output_mov_double_arm_from_fpa, + output_move_double, arithmetic_instr, shift_op, int_log2, + output_return_instruction, arm_output_function_prologue, + arm_output_epilogue, arm_output_function_epilogue, + emit_multi_reg_push, arm_get_frame_offsets, + arm_compute_initial_elimination_offset, arm_expand_prologue, + arm_print_operand, arm_assemble_integer, get_arm_condition_code, + arm_final_prescan_insn, arm_init_iwmmxt_builtins, + arm_expand_binop_builtin, thumb_pushpop, thumb_far_jump_used_p, + thumb_compute_initial_elimination_offset, + thumb_output_function_prologue, thumb_load_double_from_address, + thumb_output_move_mem_multiple, thumb_reload_out_hi, + arm_emit_vector_const, arm_dbx_register_number): Likewise. + * config/arm/pe.c (arm_mark_dllexport, arm_mark_dllimport): Likewise. + * config/arm/arm.md (thumb_extendhisi2, + *thumb_extendhisi2_insn_v6, *thumb_extendqisi2, + *thumb_extendqisi2_v6, movhi, *thumb_movhi_insn, + thumb_movhi_clobber, movqi, *arm_buneq, *arm_bltgt, + *arm_buneq_reversed, *arm_bltgt_reversed, suneq, sltgt): Likewise. + * config/arm/cirrus.md (*cirrus_arm_movdi, + *cirrus_movdf_hard_insn): Likewise. + * config/arm/vfp.md (*arm_movdi_vfp, *movdf_vfp): Likewise. + +2005-04-27 Kazu Hirata + + * tree-flow.h (ssa_names): Change the type to VEC(tree,gc). + (num_ssa_names): Use VEC_length. + (ssa_names): Use VEC_index. + * tree-ssanames.c (ssa_names): Change the type to + VEC(tree,gc). + (init_ssanames, fini_ssa_names, make_ssanames, + release_ssa_name): Update uses of ssa_names. + + * dojump.c, emit-rtl.c, expmed.c, expr.c, stmt.c, stor-layout.c: + Use fold_buildN instead of fold (buildN (...)). + +2005-04-27 Devang Patel + + * dbxout.c (dbxout_type): Check use_gnu_debug_info_extensions. + +2005-04-27 Matt Thomas + Jan-Benedict Glaw + + * config/vax/vax.c (vax_rtx_costs): Whitespace cleanup. + (vax_output_mi_thunk): Ditto. + (vax_notice_cc_update): Ditto. + (INDEX_REGISTER_P): Add trailing \. + (BASE_REGISTER_P): Add trailing \. + (legitimate_address_p): Whitespace cleanup. Remove trailing \. + +2005-04-27 Richard Guenther + + * tree-ssa-propagate.c (set_rhs): Check operand of + ADDR_EXPR for gimpliness, too. + +2005-04-27 Kazu Hirata + + * tree-ssa-pre.c: Fix a comment typo. + +2005-04-27 Zdenek Dvorak + + PR tree-optimization/21171 + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Do not + record address uses if the reference is volatile. + +2004-04-27 Paolo Bonzini + + * tree-complex.c (expand_vector_operation): New, extracted from + expand_vector_operations_1. + (tree_vec_extract): Build a NOP_EXPR. + (expand_vec_parallel): Do not care about returning the correct type. + (expand_vector_operations_1): Call expand_vector_operation. + Build the VIEW_CONVERT_EXPR on the left side of MODIFY_EXPRs. + + * tree-complex.c (gate_expand_vector_operations): New. + (pass_lower_vector_ssa): Use it. + * tree-optimize.c (init_tree_optimization_passes): Include + pass_lower_vector_ssa. + * tree-vect-transform.c (vect_min_worthwhile_factor): New. + (vectorizable_operation): Use it. + * tree-vectorizer.c (get_vectype_for_scalar_type): Accept + integer modes for the vector type. + + * defaults.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): + Do not cope with UNITS_PER_SIMD_WORD == 0. + * tree-vectorizer.c (get_vectype_for_scalar_type): Check + if the scalar type is not bigger than UNITS_PER_SIMD_WORD. + (vectorize_loops): Do not check that UNITS_PER_SIMD_WORD > 0. + * config/i386/i386.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. + * config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise. + * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise. + * config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise. + + * config/alpha/alpha.h (UNITS_PER_SIMD_WORD): Remove. + * config/bfin/bfin.h (UNITS_PER_SIMD_WORD): Remove. + * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): Remove. + + * doc/tm.texi (UNITS_PER_WORD): Rephrase more accurately. + (UNITS_PER_SIMD_WORD): New. + +2005-04-27 Nathan Sidwell + + * config/ia64/ia64.c (ia64_encode_addr_area): Use gcc_assert and + gcc_unreachable as appropriate. + (ia64_expand_load_address, ia64_expand_tls_address, + ia64_split_tmode, ia64_split_tmode_move, ia64_expand_compare, + ia64_expand_vecint_compare, ia64_expand_vecint_minmax, + next_scratch_gr_reg, ia64_initial_elimination_offset, + ia64_expand_prologue, ia64_expand_epilogue, + ia64_output_dwarf_dtprel, ia64_print_operand, + ia64_register_move_cost, first_instruction, rws_access_regno, + update_set_flags, rtx_needs_barrier, group_barrier_needed_p, + ia64_sched_init, ia64_variable_issue, + ia64_first_cycle_multipass_dfs_lookahead_guard, + ia64_dfa_new_cycle, issue_nops_and_insn, get_template, bundling, + ia64_st_address_bypass_p, ia64_ld_address_bypass_p, process_set, + process_for_unwind_directive, ia64_hpux_file_end): Likewise. + * config/ia64/ia64.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * config/ia64/ia64.md (*arm_movdi_vfp, *movdf_vfp): Likewise. + * config/ia64/predicates.md (got_symbolic_operand, + sdata_symbolic_operand): Likewise. + * config/ia64/vect.md (vcondv2sf): Likewise. + +2005-04-27 Matt Thomas + + * config/vax/vax.c (legitimate_constant_address_p): New. Formerly + CONSTANT_ADDRESS_P in config/vax/vax.h + (legitimate_constant_p): Added. Formerly CONSTANT_P in vax.h. + (INDEX_REGISTER_P): New. + (BASE_REGISTER_P): New. + (indirectable_constant_address_p): New. Adapted from + INDIRECTABLE_CONSTANT_ADDRESS_P in vax.h. Use SYMBOL_REF_LOCAL_P. + (indirectable_address_p): New. Adapted from + INDIRECTABLE_ADDRESS_P in vax.h. + (nonindexed_address_p): New. Adapted from + GO_IF_NONINDEXED_ADDRESS in vax.h. + (index_temp_p): New. Adapted from INDEX_TERM_P in vax.h. + (reg_plus_index_p): New. Adapted from GO_IF_REG_PLUS_INDEX in vax.h. + (legitimate_address_p): New. Adapted from + GO_IF_LEGITIMATE_ADDRESS in vax.h. + (vax_mode_dependent_address_p): New. Adapted from + GO_IF_MODE_DEPENDENT_ADDRESS in vax.h. + * config/vax/vax.h (CONSTANT_ADDRESS_P): Use + legitimate_constant_address_p. + (CONSTANT_P): Use legitimate_constant_p. + (INDIRECTABLE_CONSTANT_ADDRESS_P): Removed. + (INDIRECTABLE_ADDRESS_P): Removed. + (GO_IF_NONINDEXED_ADDRESS): Removed. + (INDEX_TEMP_P): Removed. + (GO_IF_REG_PLUS_INDEX): Removed. + (GO_IF_LEGITIMATE_ADDRESS): Use legitimate_address_p. Two + definitions, depending on whether REG_OK_STRICT is defined. + (GO_IF_MODE_DEPENDENT_ADDRESS): Use vax_mode_dependent_address_p. + Two definitions, depending on whether REG_OK_STRICT is defined. + * config/vax/vax-protos.h (legitimate_constant_address_p): Prototype + added. + (legitimate_constant_p): Prototype added. + (legitimate_address_p): Prototype added. + (vax_mode_dependent_address_p): Prototype added. + +2005-04-27 Kazu Hirata + + * tree.h (phi_arg_d): Expand a comment in phi_arg_d. + +2005-04-27 Joseph S. Myers + + PR c/21213 + * c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of + transparent union. + +2005-04-27 Joseph S. Myers + + PR c/20740 + * c-format.c (init_dynamic_asm_fprintf_info): Give errors, not + assertion failures, if __gcc_host_wide_int__ is not properly + defined. + (init_dynamic_diag_info): Give errors, not assertion failures, if + location_t, tree or __gcc_host_wide_int__ are not properly + defined. + +2005-04-26 Kazu Hirata + + * tree-ssa-loop-ivopts.c (ivopts_data, decl_rtl_to_reset, + n_iv_uses, iv_use, n_iv_cands, iv_cand, + tree_ssa_iv_optimize_init, record_use, add_candidate_1, + prepare_decl_rtl, free_loop_data, + tree_ssa_iv_optimize_finalize): Use the VEC API instead of + VARRAY. + + * tree.h (tree_phi_node): Add a comment about the order of PHI + arguments. + +2005-04-26 Paul Brook + + * config/arm/arm.md (thumb_mulsi3): Use two-operand assembly form. + +2005-04-26 Nathan Sidwell + + * config/mips.mips.c (mips_legitimize_tls_address): Use + gcc_unreachable. + + * config/mmix/mmix.c (mmix_assemble_integer): Use gcc_assert. + * config/mmix/crti.asm (_init): Reword comment to avoid 'abort'. + * config/mmix/mmix.md (nonlocal_goto_receiver): Likewise. + + * config/sparc/sparc.h (enum reg_class): Reword comment to avoid + 'abort'. + +2005-04-26 Jeff Law + + * tree-flow-inline.h (op_iter_next_must_and_may_def): New. + (op_iter_init_must_and_may_def): Likewise. + (unmodifiable_var_p): Move to a later point in the file. + * tree-ssa-operands.h (FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): New. + * tree-ssa-dse.c (need_imm_uses_for): Remove, no longer needed. + (dse_record_phis): Directly check for virtual operands rather than + using need_imm_uses_for. + (dse_optimize_stmt): Handle V_MUST_DEF operands. Handle case where + store has multiple V_{MAY,MUST}_DEF operands. + +2005-04-26 Andrew MacLeod + + * tree-cfg.c (bsi_replace): Delink immediate uses for the original + stmt. + +2005-04-26 Kazu Hirata + + * tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a + call to find_edge outside a loop to go through a PHI chain. + +2004-04-26 Richard Guenther + + PR tree-optimization/17598 + * fold-const.c (fold_binary): Fold comparisons of addresses + of COMPONENT_REFs which reference the same field to + comparisons of the addresses of the base objects. + +2005-04-26 Julian Brown + + * config/arm/arm.c (arm_return_in_msb): New function. + (arm_must_pass_in_stack): New function. + (TARGET_RETURN_IN_MSB): Define target hook. + (TARGET_MUST_PASS_IN_STACK): Define target hook. + (arm_function_value): Pad small aggregate return. + (arm_pad_arg_upward): New function. + (arm_pad_reg_upward): New function. + * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Include complex values. + (FUNCTION_ARG_PADDING): Define macro. + (BLOCK_REG_PADDING): Define macro. + (PAD_VARARGS_DOWN): Correct padding for AAPCS. + * config/arm/arm-protos.h (arm_pad_arg_upward): Declare function. + (arm_pad_reg_upward): Declare function. + +2005-04-26 Kazu Hirata + + * basic-block.h (ei_cond): New. + (FOR_EACH_EDGE): Call ei_cond. + + PR tree-optimization/21047 + * fold-const.c (fold_binary): Abort on ASSERT_EXPR. + (fold): Don't handle ASSERT_EXPR. + +2005-04-25 Roger Sayle + + * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat + all writes to any stack register as a read/write dependency on + FIRST_STACK_REG. + (sched_analyze_2): Likewise, for reads from any stack register. + +2005-04-25 Richard Henderson + + * final.c (output_addr_const): Revert 2005-04-09 change. + +2005-04-25 Mike Stump + + * config/darwin.c (darwin_encode_section_info): Always set + MACHO_SYMBOL_STATIC for all ! TREE_PUBLIC symbols. + +2005-04-25 Kaveh R. Ghazi + + * collect2.c, gcc.c, gcov-dump.c, gcov.c, gen-protos.c, + gensupport.c, protoize.c, toplev.c: Replace calls to + `unlock_stream' with `unlock_std_streams'. + +2005-04-25 Devang Patel + + * dbxout.c (dbxout_type): Emit attribute vector. + +2005-04-05 Paul Brook + + * target-def.h (TARGET_CXX_USE_AEABI_ATEXIT): Define. + * target.h (struct gcc_target): Add cxx.use_aeabi_atexit. + * config/arm/arm.c (arm_cxx_atexit_name): New function. + (TARGET_CXX_USE_AEABI_ATEXIT): New macro. + * cp/decl.c (get_atexit_node): Reorder arguments for __aeabi_atexit. + (register_dtor_fn): Likewise. + * doc/tm.texi: Document TARGET_CXX_USE_AEABI_ATEXIT. + +2005-04-25 Ian Lance Taylor + + * c-common.def (EXPR_STMT): Remove, moved to C++ frontend. + * c-common.h (EXPR_STMT_EXPR): Don't define. + (c_common_stmt_codes): Don't define. + * c-dump.c (c_dump_tree): Remove EXPR_STMT case. + * c-gimplify.c (gimplify_expr_stmt): Remove. + (c_gimplify_expr): Remove EXPR_STMT case. + * c-objc-common.c (c_objc_common_init): Remove stmt_codes and call + to INIT_STATEMENT_CODES. + * c-pretty-print.c (pp_c_statement): Just call dump_generic_node. + +2005-04-25 Jan Hubicka + + * tree-cfg.c (tree_duplicate_bb): Duplicate EH region too. + + * except.c: Include diagnostic.h + (dump_eh_tree, verify_eh_tree): New functions. + * except.h (verify_eh_tree, dump_eh_tree, verify_eh_edges): Declare. + * tree-cfg.c (tree_verify_flow_info): verify eh edges. + (dump_function_to_file): dump eh tree. + * tree-eh.c (mark_eh_edge): New function. + (mark_eh_edge_found_error): New static variable. + (verify_eh_edges): New function. + +2005-04-25 Nathan Sidwell + + * tree-ssa-alias.c (fieldoff_t): Remove. + (fieldoff_s): typedef the structure itself. Create a vector of + objects. + (push_fields_onto_fieldstack): Return count of fields pushed. + Remove peeling of first field. Adjust. + (fieldoff_compare): Adjust. + (create_overlap_variables_for): Adjust. + +2005-04-25 Joseph S. Myers + + * doc/invoke.texi (Blackfin Options): Avoid empty @opindex line. + +2005-04-25 Joseph S. Myers + + PR bootstrap/21215 + * doc/install.texi: Document correct assembler and linker to use + on i?86-*-solaris2.10. + +2005-04-25 Steven Bosscher + + Fix PR tree-optimization/21173 + + * tree-ssa-pre.c (create_expression_by_pieces): Simplify code. + Unshare expression we pass to force_gimple_operand. + +2005-04-25 J"orn Rennecke + Stephen Clarke + Roger Sayle + + PR rtl-optimization/20413 + * cfgrtl.c (redirect_edge_and_branch): Use Pmode instead of + VOIDmode for LABEL_REF. + * final.c (shorten_branches): Likewise. + * jump.c (mark_all_labels, redirect_exp_1): Likewise. + * loop.c (reg_dead_after_loop): Likewise. + * varasm.c (decode_addr_const): Likewise. + * doc/rtl.texi: Document mode requirement for LABEL_REF. + +2005-04-25 Ralf Corsepius + + * config.gcc (avr-*-*): Remove redundant "case". + +2005-04-25 Kazu Hirata + + * tree-vect-analyze.c (vect_mark_relevant): Take + VEC(tree,heap) instead of varray_type as an argument. + (vect_mark_stmts_to_be_vectorized): Change the type of + worklist to VEC(tree,heap). Adjust uses of worklist. + +2005-04-24 Devang Patel + + * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New. + +2005-04-24 Ian Lance Taylor + + * c-semantics.c (build_stmt): Remove test of specific tree codes + for TREE_SIDE_EFFECTS handling. + +2005-04-24 Per Bothner + + * c-opts.c (finish_options): Make the line-number of the + location 0, as assumed elsewhere, rather than 1. + +2005-04-24 Kazu Hirata + + * tree-ssa-uncprop.c (equiv_stack): Change the type o + VEC(tree,heap). + (tree_ssa_uncprop, uncprop_finalize_block, + uncprop_initialize_block): Update uses of equiv_stack. + +2005-04-24 Richard Henderson + + PR rtl-opt/21163 + * simplify-rtx.c (simplify_binary_operation) : Check + for SCALAR_INT_MODE_P instead of not MODE_CC before returning + constm1_rtx. + : Use CONST0_RTX. + : Use CONST0_RTX and CONST1_RTX. + : Likewise. + +2005-04-24 Kaveh R. Ghazi + + * collect2.c (main): Unlock the stdio streams. + * gcc.c (main): Likewise. + * gcov-dump.c (main): Likewise. + * gcov.c (main): Likewise. + * gen-protos.c (main): Likewise. + * gensupport.c (init_md_reader_args_cb): Likewise. + * protoize.c (main): Likewise. + * toplev.c (general_init): Likewise. + +2005-04-24 Jakub Jelinek + + PR middle-end/20991 + * cgraph.h (cgraph_local_info): Add vtable_method field. + * varasm.c (mark_decl_referenced): If cgraph_global_info_ready + and node is vtable_method, finalized and not reachable, don't do + anything. + +2005-04-24 Kazu Hirata + + * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Use + COMPARISON_CLASS_P. + * tree-ssa-pre.c (create_value_expr_from): Use + CONSTANT_CLASS_P and REFERENCE_CLASS_P. + * tree-ssa-propagate.c (stmt_makes_single_load, + stmt_makes_single_store): Use REFERENCE_CLASS_P. + * tree-vect-transform.c (vect_is_simple_cond): Use + COMPARISON_CLASS_P. + * tree-vrp.c (extract_range_from_assert, + build_assert_expr_for, fp_predicate, has_assert_expr): Use + COMPARISON_CLASS_P. + + * tree-ssa-live.c (build_tree_conflict_graph): Change the type + of tpa_to_clear to VEC(int,heap). Update uses of + tpa_to_clear. Free tpa_to_clear at the end. + +2005-04-24 Andrew Pinski + + * tree.h (TREE_THIS_VOLATILE): Document the effect on a + function decl. + +2005-04-24 Nathan Sidwell + + * config/rs6000/rs6000.c (rs6000_override_options): Use gcc_assert + and gcc_unreachable as appropriate. + (num_insns_constant, output_vec_const_move, + build_mask64_2_operands, rs6000_output_dwarf_dtprel, + rs6000_emit_set_const, rs6000_emit_move, + spe_build_register_parallel, function_arg, + rs6000_move_block_from_reg, altivec_expand_predicate_builtin, + spe_expand_predicate_builtin, spe_expand_evsel_builtin, + rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, + rs6000_common_init_builtins, expand_block_clear, + expand_block_move, validate_condition_mode, ccr_bit, extract_MB, + extract_ME, rs6000_get_some_local_dynamic_name, + rs6000_output_function_entry, print_operand, + print_operand_address, rs6000_generate_compare, rs6000_emit_sCOND, + output_cbranch, output_e500_flip_gt_bit, + rs6000_emit_vector_compare, rs6000_emit_vector_compare, + rs6000_emit_cmove, rs6000_emit_minmax, rs6000_split_multireg_move, + compute_save_world_info, rs6000_stack_info, + rs6000_emit_load_toc_table, rs6000_frame_related, + spe_synthesize_frame_save, rs6000_emit_epilogue, + rs6000_output_function_epilogue, rs6000_hash_constant, output_toc, + output_function_profiler, rs6000_trampoline_size, + rs6000_initialize_trampoline, find_addr_reg, + rs6000_machopic_legitimize_pic_address, + rs6000_initial_elimination_offset, + rs6000_dbx_register_number): Likewise. + * config/rs6000/rs6000.md (*fix_truncdfsi2_internal, + *movdf_hardfloat32, *movdf_softfloat32, *fix_trunctfsi2_internal, + *movti_power, *movti_string, call, call_value, sibcall, + sibcall_value): Likewise. + * config/rs6000/spe.md (*movdf_e500_double, + *movv2si_internal): Likewise. + * config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): Remove 'abort' + from comment. + +2005-04-24 Richard Henderson + + PR target/21101 + * config/i386/i386.h (CANNOT_CHANGE_MODE_CLASS): Move guts to ... + * config/i386/i386.c (ix86_cannot_change_mode_class): ... here. + Deny modes smaller than 4 bytes. + * config/i386/i386-protos.h: Update. + +2005-04-24 Ralf Corsepius + + * config.gcc (h8300-*-rtems*): Add h8300-*-rtemscoff*. + Switch h8300-*-rtems* to ELF. + +2005-04-24 Kazu Hirata + + * vec.h (VEC_safe_grow): Replace grow with safe_grow. + +2005-04-23 Kazu Hirata + + * ipa-inline.c, tree-ssa-operands.h: Fix comment typos. + +2005-04-23 Richard Guenther + + PR middle-end/21082 + * fold-const.c: Fold &a[i]-&a[j] to i-j. + +2005-04-23 Zdenek Dvorak + + * tree-ssa-loop-niter.c (tree_simplify_using_condition): Expand simple + definitions of ssa names in condition. Split recusive part to ... + (tree_simplify_using_condition_1): New function. + (expand_simple_operations): New function. + +2005-04-23 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (struct cost_pair): Add value field. + (find_interesting_uses_cond): Do not use integer_zerop and + integer_nonzerop to check for integer constants. + (set_use_iv_cost): Record the value field. + (determine_use_iv_cost_generic, determine_use_iv_cost_address, + determine_use_iv_cost_outer): Set the value field of the cost pair. + (may_eliminate_iv): Do not return the comparison code. + (iv_elimination_compare): New function. + (determine_use_iv_cost_condition): Set the value field. Record + noneliminable invariants correctly. + (rewrite_use_compare, rewrite_use_outer): Use the value field. + +2005-04-23 DJ Delorie + + * diagnostic.c (warning): Accept parameter to classify warning option. + (warning0): New, for when a pointer to an error() like function is needed. + * errors.c (warning): Likewise. + * errors.h (warning, warning0): Adjust prototypes. + * toplev.h (warning, warning0): Likewise. + + * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, + c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, + c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, + fold-const.c, fortran/trans-decl.c, function.c, gcse.c, + genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, + reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, + tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, + tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. + + * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, + config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, + config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, + config/darwin.c, config/darwin.h, config/h8300/h8300.c, + config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, + config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, + config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, + config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, + config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, + config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, + config/rs6000/aix52.h, config/rs6000/darwin.h, + config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, + config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, + config/sh/symbian.c, config/sol2-c.c, config/sol2.c, + config/stormy16/stormy16.c, config/v850/v850-c.c, + config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() + callers. + +2005-04-23 Richard Henderson + + PR rtl-opt/21102 + * simplify-rtx.c (simplify_binary_operation): Fix mode check before + performing some integral scalar simplifications. + +2005-04-23 Richard Henderson + + PR target/21099 + * config/i386/i386.c (ix86_split_to_parts): Use proper mode when + simplifying CONST_VECTOR. + +2005-04-23 Kazu Hirata + + * tree-ssa-live.c (live_worklist): Take a stack allocated on + heap as an argument. Update uses of stack. + (calculate_live_on_entry): Allocate stack on heap. + + * tree-ssa-live.c (build_tree_conflict_graph): Allocate + partition_link and tpa_nodes on heap. + + * tree-ssa-dce.c (worklist): Change to VEC(tree,heap). + (mark_stmt_necessary, propagate_necessity, + mark_really_necessary_kill_operand_phis): Update uses of + worklist. + (tree_dce_init): Allocate worklist using VEC_alloc. + (tree_dce_done): Free worklist using VEC_free. + +2005-04-23 Mike Stump + + * config/darwin.c (machopic_indirection_name): Don't use + quotes needlessly. + (darwin_emit_unwind_label): Use user_label_prefix instead of + "_". + +2005-04-23 Kazu Hirata + + * final.c, ipa-inline.c, varasm.c: Fix comment typos. + +2005-04-23 Hans-Peter Nilsson + + * config.gcc : Specify .opt files. + * config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, + config/cris/linux.opt: New files. + * config/cris/aout.h (CRIS_SUBTARGET_SWITCHES) + (CRIS_SUBTARGET_LONG_OPTIONS): Don't define. + (TARGET_ELF): Override to 0. + (CRIS_SUBTARGET_HANDLE_OPTION): Override to handle -melinux and + -melinux-stacksize=N. + * config/cris/cris.c: (cris_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS): Override. + (TARGET_HANDLE_OPTION): Override to cris_handle_option. + (cris_override_options): Use MASK_*, not TARGET_MASK_*. + * config/cris/cris.h (TARGET_MASK_SVINTO, TARGET_SVINTO, + (TARGET_MASK_CCINIT, TARGET_CCINIT, TARGET_MASK_PDEBUG) + (TARGET_PDEBUG, TARGET_MASK_SIDE_EFFECT_PREFIXES) + (TARGET_SIDE_EFFECT_PREFIXES, TARGET_MASK_EXPAND_MUL) + (TARGET_EXPAND_MUL, TARGET_MASK_STACK_ALIGN, TARGET_STACK_ALIGN) + (TARGET_MASK_CONST_ALIGN, TARGET_CONST_ALIGN) + (TARGET_MASK_DATA_ALIGN, TARGET_DATA_ALIGN) + (TARGET_MASK_PROLOGUE_EPILOGUE, TARGET_PROLOGUE_EPILOGUE) + (TARGET_MASK_ETRAX4_ADD, TARGET_ETRAX4_ADD) + (TARGET_MASK_ALIGN_BY_32, TARGET_ALIGN_BY_32, TARGET_MASK_ELF) + (TARGET_ELF, TARGET_MASK_LINUX, TARGET_LINUX) + (TARGET_MASK_AVOID_GOTPLT, TARGET_AVOID_GOTPLT) + (TARGET_MASK_MUL_BUG, TARGET_MUL_BUG, TARGET_SWITCHES) + (CRIS_SUBTARGET_SWITCHES, TARGET_OPTIONS) + (CRIS_SUBTARGET_LONG_OPTIONS): Don't define. + (TARGET_LINUX): Define 0. + (TARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*. + (CRIS_SUBTARGET_DEFAULT): Define to 0, not TARGET_MASK_ELF. + (CRIS_SUBTARGET_DEFAULT): New empty default macro. + * config/cris/linux.h (CRIS_SUBTARGET_SWITCHES): Don't define. + (TARGET_LINUX): Override to 1. + (CRIS_SUBTARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*. + +2005-04-23 Nathan Sidwell + + * haifa-sched.c (schedule_block): Fix thinko in previous + assertification patch. + +2005-04-23 Richard Sandiford + + * config.gcc (hppa[12]*-*-hpux10*): Add pa/pa-hpux.opt to + $extra_options. Also add pa/pa-hpux1010.opt for hpux10.[1-9]*. + (hppa*64*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add + pa/pa-hpux.opt, pa/pa-hpux1010.opt and pa/pa64-hpux.opt to + $extra_options. Also add pa/pa-hpux1111.opt for hpux11.[1-9]*. + (hppa[12]*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add + pa/pa-hpux.opt to $extra_options. Also add pa/pa-hpux1111.opt + for hpux11.[1-9]*. + * config/pa/pa.h (architecture_type, rtx_def, pa_arch_string, pa_arch) + (pa_fixed_range_string, pa_cpu_string, pa_unix_string, target_flags) + (MASK_PA_11, MASK_DISABLE_FPREGS, TARGET_DISABLE_FPREGS) + (MASK_NO_SPACE_REGS, TARGET_NO_SPACE_REGS, MASK_JUMP_IN_DELAY) + (TARGET_JUMP_IN_DELAY, MASK_DISABLE_INDEXING, TARGET_DISABLE_INDEXING) + (MASK_PORTABLE_RUNTIME, TARGET_PORTABLE_RUNTIME, MASK_GAS, TARGET_GAS) + (MASK_SOFT_FLOAT, TARGET_SOFT_FLOAT, MASK_LONG_LOAD_STORE) + (TARGET_LONG_LOAD_STORE, MASK_FAST_INDIRECT_CALLS) + (TARGET_FAST_INDIRECT_CALLS, MASK_BIG_SWITCH, TARGET_BIG_SWITCH) + (MASK_PA_20, MASK_SIO, TARGET_SIO, MASK_GNU_LD, TARGET_GNU_LD) + (MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_PA_11, TARGET_PA_20) + (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS) + (SUBTARGET_OPTIONS): Delete. + (TARGET_PA_10): Redefine in terms of TARGET_PA_11 and TARGET_PA_20. + (TARGET_SCHED_DEFAULT): Define to a PROCESSOR_* enum (PROCESSOR_8000) + instead of a string. + * config/pa/pa.c (pa_arch, pa_arch_string, pa_fixed_range_string) + (pa_cpu_string, pa_unix_string): Delete. + (pa_cpu): Initialize to TARGET_SCHED_DEFAULT. + (flag_pa_unix): Initialize based on TARGET_HPUX_11_11 and + TARGET_HPUX_10_10. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (pa_handle_option): New function. + (override_options): Remove handling of -march=, -mfixed-range=, + -mschedule= and -munix=. + * config/pa/pa-hpux.h (SUBTARGET_SWITCHES): Delete. + * config/pa/pa-hpux1010.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux10.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux1111.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux11.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa64-hpux.h (SUBTARGET_SWITCHES): Delete. + * config/pa/pa64-start.h (TARGET_PA_11, TARGET_PA_20): #undef before + redefining. + * config/pa/pa.opt: New file. + * config/pa/pa-hpux.opt: New file. + * config/pa/pa-hpux1010.opt: New file. + * config/pa/pa-hpux1111.opt: New file. + * config/pa/pa64-hpux.opt: New file. + +2005-04-22 David S. Miller + + * rtl.h (CONST_DOUBLE): Fix comment, a CONST_DOUBLE holds an + integer when it's mode is VOIDmode not DImode. + +2005-04-22 Geoffrey Keating + + * config/rs6000/rs6000.md (sync_add_internal, + sync_addshort_internal, sync_sub_internal, sync_andsi_internal, + sync_anddi_internal, sync_boolsi_internal, sync_booldi_internal, + sync_boolc_internal, sync_boolc_internal2, + sync_boolcc_internal, sync_lock_test_and_set): Use + "bne- $-xxx" rather than local labels. + (sync_lock_release): Add second operand. + (lwsync): Use .long rather than a more meaningful opcode. + * doc/md.texi (Standard Names): Add description of second + parameter to sync_lock_test_and_set. + +2005-04-23 Kazu Hirata + + PR tree-optimization/21088 + * fold-const.c (fold_unary, fold_binary, fold_ternary): + Export. + * tree-vrp.c (compare_values): Use fold_binary to compare + pointers. Use boolean_type_node as the type of a comparison + expression being folded. + * tree.h: Add prototypes for fold_unary, fold_binary, + fold_ternary. + + * tree-ssa-dom.c: Fix formatting. + +2005-04-22 Diego Novillo + + * Makefile.in (tree-into-ssa.o): Add dependency on PARAMS_H. + * lambda-code.c (perfect_nestify): Mark virtual operands in + the moved statement for renaming. + * params.def (PARAM_MIN_VIRTUAL_MAPPINGS): Define. + (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. + * params.h (MIN_VIRTUAL_MAPPINGS): Define. + (VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. + * tree-flow.h (struct var_ann_d): Update comments. + (rewrite_to_new_ssa_names_bb, rewrite_to_new_ssa_names, + allocate_ssa_names, find_phi_node_for, dump_tree_ssa, + debug_tree_ssa, debug_def_blocks, dump_tree_ssa_stats, + debug_tree_ssa_stats, rewrite_ssa_into_ssa, + dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by, + debug_names_replaced_by): Remove declarations. + (delete_update_ssa, get_current_def, set_current_def): Declare. + (rewrite_into_loop_closed_ssa): Add new argument. Update + all callers. + * tree-into-ssa.c: Include params.h. + (old_virtual_ssa_names): Remove. Update all users. + (need_to_replace_names_p): Remove. Update all users. + (struct update_ssa_stats_d): Declare. + (update_ssa_stats): New local. + (dump_tree_ssa, debug_tree_ssa, debug_def_blocks, + dump_tree_ssa_stats, debug_tree_ssa_stats, + dump_update_ssa, debug_update_ssa, + dump_names_replaced_by, debug_names_replaced_by): Declare. + (get_current_def, set current_def): Make extern. + (is_old_name, is_new_name): Protect against references + past the end of the sets. + (add_new_name_mapping): Assert that OLD and NEW are + different SSA names for the same symbol. + When adding a virtual mapping, update stats for virtual + mapping heuristic. + (insert_phi_nodes_for): If UPDATE_P is true, create the + LHS of the new PHI by duplicating SSA name VAR. + (insert_phi_nodes_1): Remove. Update all users. + (insert_phi_nodes): Remove second argument. Update all + users. + (maybe_replace_use, maybe_replace_def): New. + (rewrite_update_stmt): Call them. + (mark_def_interesting): Remove calls to is_gimple_reg. + (prepare_phi_args_for_update): Remove. Update all users. + (prepare_block_for_update): Only process virtual operands + and GIMPLE registers in normal form. + (prepare_use_sites_for): New. + (prepare_names_to_update): Rename from prepare_def_sites. + Call prepare_use_sites_for. + (dump_update_ssa): Rename from dump_repl_tbl. + Update all users. + Show statistics for virtual mapping heuristic. + (debug_update_ssa): Rename from debug_debug_repl_tbl. + (init_update_ssa): Initialize UPDATE_SSA_STATS. + (delete_update_ssa): Make extern. + (mark_set_for_renaming): If the set is empty, do nothing. + (release_ssa_name_after_update_ssa): Update comment. + (insert_updated_phi_nodes_for): Do not remove existing + PHI nodes for symbols. + (switch_virtuals_to_full_rewrite_p): New. + (switch_virtuals_to_full_rewrite): New. + (update_ssa): Call them. + Clear REWRITE_THIS_STMT and REGISTER_DEFS_IN_THIS_STMT + for every statement before updating. + If all the names in NEW_SSA_NAMES have been marked for + removal, do nothing. + Only start at the top of the CFG if there are symbols in + SYMS_TO_RENAME. + (ssa_rewrite_finalize_block): Remove. + (ssa_register_new_def): Remove. + (ssa_rewrite_stmt): Remove. + (ssa_rewrite_phi_arguments): Remove. + (ssa_rewrite_initialize_block): Remove. + (ssa_mark_def_sites): Remove. + (ssa_mark_def_sites_initialize_block): Remove. + (ssa_mark_phi_uses): Remove. + (rewrite_ssa_into_ssa): Remove. + * tree-phinodes.c (find_phi_node_for): Remove. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): + Call update_ssa. + * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): + Remove calls to verify_dominators and + verify_loop_structure. + (tree_unswitch_single_loop): Call update_ssa. + * tree-ssa.c (verify_ssa): Assert that need_ssa_update_p + returns false. + Call verify_stmts. + (delete_tree_ssa): Assert that need_ssa_update_p returns + false. + * tree-vect-transform.c (vect_transform_loop): Call update_ssa. + * tree-vectorizer.c (allocate_new_names, rename_def_op, + free_new_names): Remove. Update all users. + (rename_use_op): Call get_current_def. + (rename_variables_in_bb): Do not handle any real or + virtual definition. + (slpeel_update_phis_for_duplicate_loop): Call + get_current_def and set_current_def instead of using + SSA_NAME_AUX. + (slpeel_update_phi_nodes_for_guard2): Reformat comments. + (slpeel_can_duplicate_loop_p): Call need_ssa_update_p, + ssa_names_to_replace and delete_update_ssa. + * doc/invoke.texi: Document --param min-virtual-mappings + and --param virtual-mappings-ratio. + +2005-04-22 Diego Novillo + + * tree-cfg.c (tree_duplicate_bb): Call create_new_def_for + for newly created PHI nodes. + Call create_new_def_for for every new V_MAY_DEF and + V_MUST_DEF on the copied statement. + (struct ssa_name_map_entry): Remove. + (ssa_name_map_entry_hash): Remove. + (ssa_name_map_entry_eq): Remove. + (allocate_ssa_names): Remove. + (rewrite_to_new_ssa_names_def): Remove. + (rewrite_to_new_ssa_names_use): Remove. + (rewrite_to_new_ssa_names_bb): Remove. + (rewrite_to_new_ssa_names): Remove. + (tree_duplicate_sese_region): Remove variables ver, + definitions, phi, ssa_name_map and bi. + Call need_ssa_update_p instead of any_marked_for_rewrite_p. + Call update_ssa. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call + update_ssa instead of rewrite_ssa_into_ssa. + * tree-ssa-loop-manip.c (add_exit_phis_edge): Call + create_new_def_for. + (find_uses_to_rename_use): Add argument 'need_phis'. + (find_uses_to_rename_stmt): Do not scan virtual operands. + (find_uses_to_rename): Only scan PHI nodes for + non-virtual names. + (rewrite_into_loop_closed_ssa): Call update_ssa. + (check_loop_closed_ssa_use): Ignore virtual operands. + (check_loop_closed_ssa_stmt): Likewise. + (verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is + NULL. + (rename_variables, set_phi_def_stmts): Remove. + (tree_duplicate_loop_to_header_edge): Reformat comment. + Remove variables BB, I and DEFINITIONS. + Call need_ssa_update_p. + Call update_ssa. + (lv_adjust_loop_header_phi): Reformat comment. + * tree-ssanames.c (ssa_names_to_rewrite): Remove. + (marked_for_rewrite_p, any_marked_for_rewrite_p, + mark_for_rewrite, unmark_all_for_rewrite, + marked_ssa_names): Remove. Update all users. + (release_ssa_name): If VAR has been registered for SSA + updating, do nothing. + * tree-vrp.c (new_ssa_names, old_ssa_names): Remove. + (build_assert_expr_for): Call register_new_name_mapping. + (insert_range_assertions): Update call to update_ssa. + * tree.h (mark_for_rewrite, unmark_all_for_rewrite, + marked_for_rewrite_p, any_marked_for_rewrite_p, + marked_ssa_names): Remove. + +2005-04-22 Jeff Law + + * tree-ssa-dom.c (block_defs_stack): Remove, no longer needed. + (restore_currdefs_to_original_value): Likewise. + (register_definitions_for_stmt): Likewise. + (tree_ssa_dominator_optimize): No longer initialize CURRENT_DEF + for each variable. Do not allocate/free block_defs_stack either. + Do not iterate if we just thread jumps. Only iterate if the + tree_cleanup_cfg does useful work (temporary). + (dom_opt_initialize_block): No longer push a marker on + BLOCK_DEFS_STACK. + (dom_opt_finalize_block): Removal call to restore currdefs. + Relax restrictions for recording edge equivalences. + (record_equivalences_from_phis): No longer need to track + CURRENT_DEF. + (optimize_stmt): Similarly. + (thread_across_edge): Simplify by removing the requirement that + statements in the block we are threading through must be nops. + (initialize_hash_element): Handle GOTO_EXPR. + +2005-04-22 David S. Miller + + * sched-vis.c (print_value): Use CONST_DOUBLE_LOW and + CONST_DOUBLE_HIGH. + * config/sparc/sparc.c (sparc_rtx_costs): Likewise, and + fix check on CONST_DOUBLE mode. It should be VOIDmode + when it is representing an integer. + +2005-04-22 Nathan Sidwell + + * builtins.c (gimplify_va_arg_expr): Reword comments to avoid + 'abort'. Use gcc_assert and gcc_unreachable as appropriate. + * c-format.c (get_constant, decode_format_attr, get_flag_spec, + find_char_info_specifier_index, + find_length_info_modifier_index): Likewise. + * c-typeck.c (composite_type, pop_init_level): Likewise. + * combine.c (cant_combine_insn_p, try_combine): Likewise. + * cse.c (cse_insn): Likewise + * dominance.c (calc_dfs_tree): Likewise + dwarf2out.c (loc_descriptor_from_tree_1, + add_abstract_origin_attribute, force_decl_die, + force_type_die): Likewise + emit-rtl.c (operand_subword_force): Likewise + explow.c (hard_function_value): Likewise + expmed.c (store_bit_field, expand_divmod, + emit_store_flag_force): Likewise + expr.c (emit_move_multi_word, store_expr, + expand_expr_real_1): Likewise + final.c (this_is_asm_operands, shorten_branches, final_scan_insn, + output_operand): Likewise + flow.c (recompute_reg_usage): Likewise + * function.c (assign_stack_temp_for_type, assign_temp, + handle_epilogue_set): Likewise + * genextract.c (main): Likewise + * gimplify.c (mostly_copy_tree_r, gimplify_return_expr, + gimplify_modify_expr_rhs, gimplify_expr): Likewise + * haifa-sched.c (ready_lastpos, ready_remove_first, ready_element, + ready_remove, rm_line_notes, rm_other_notes, + schedule_block): Likewise + mips-tfile.c (copy_object, out_of_bounds): Likewise + +2005-04-22 David Edelsohn + + PR target/20813 + * config/rs6000/default64.h (TARGET_DEFAULT): Add MASK_PPC_GFXOPT. + * config/rs6000/rs6000.c (processor_target_table): Rename rs64a to + rs64. Add MASK_PPC_GFXOPT to powerpc64 and rs64. + (rs6000_init_libfuncs): Set TFmode optabs to xlq names if + TARGET_XL_COMPAT. + * doc/invoke.texi (PowerPC options): Change rs64a to rs64. + +2005-04-22 Nathan Sidwell + + * lambda-code.c: Define VEC(int,heap), VEC(lambda_loop,heap). + (gcc_tree_to_linear_expression): Convert to heap allocated + vectors. + (gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest, + lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, + perfect_nestify): Likewise. + lambda.h (gcc_loopnest_to_lambda_loopnest, + lambda_loopnest_to_gcc_loopnest): Likewise. + tree-loop-linear.c (linear_transform_loops): Likewise. + +2005-04-22 Eric Botcazou + + * config/sparc/predicates.md (arith_double_operand): Use + trunc_int_for_mode if HOST_BITS_PER_WIDE_INT >=64. + * config/sparc/sparc.md (movqi, movhi, movsi, movqi): Use gen_int_mode. + (DImode, DFmode constant splitters): Likewise. Remove code for + TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT < 64. + (logical constant splitters): Use const_int_operand predicate. + (lshrsi3_extend): Remove code for TARGET_ARCH64 && + HOST_BITS_PER_WIDE_INT < 64. + +2005-04-22 Nathan Sidwell + + * config/pa/pa.c (legitimize_pic_address): Use gcc_assert and + gcc_unreachable as appropriate. + (force_mode, emit_move_sequence, singlemove_string, + output_move_double, output_fp_move_double, find_addr_reg, + output_block_move, output_block_clear, output_and, + output_64bit_and, output_ior, output_64bit_ior, store_reg_modify, + pa_adjust_cost, pa_issue_rate, print_operand, + output_global_address, output_arg_descriptor, output_cbranch, + output_lbranch, output_bb, output_bvb, output_dbra, output_movb, + output_call): Likewise. + * config/pa/pa.md (call, call_value, sibcall, sibcall_value, + prefetch, prefetch_cc, prefetch_nocc): Likewise. + +2005-04-22 Zdenek Dvorak + + * Makefile.in (LIBGCOV): Add _gcov_interval_profiler, + _gcov_pow2_profiler and _gcov_one_value_profiler. + (tree-profile.o): Add GGC_H and gt-tree-profile.h dependency. + (GTFILES): Add $(srcdir)/tree-profile.c. + * gcov-io.h (__gcov_interval_profiler, __gcov_pow2_profiler, + __gcov_one_value_profiler): Declare. + * gimplify.c (force_gimple_operand): Check whether the statements + should be produced in ssa form. + (force_gimple_operand_bsi): New function. + * libgcov.c (__gcov_interval_profiler, __gcov_pow2_profiler, + __gcov_one_value_profiler): New functions. + * rtl-profile.c (rtl_gen_pow2_profiler): Only measure whether + the profiled value is a power of two or not. + * tree-cfg.c (tree_block_ends_with_condjump_p): Handle empty blocks. + * tree-flow.h (in_ssa_p): Declare. + (force_gimple_operand_bsi): Declare. + * tree-into-ssa.c (in_ssa_p): New variable. + (rewrite_into_ssa): Set in_ssa_p. + * tree-outof-ssa.c (rewrite_out_of_ssa): Set in_ssa_p. + * tree-profile.c: Include ggc.h and gt-tree-profile.h. + (gcov_type_node, tree_interval_profiler_fn, tree_pow2_profiler_fn, + tree_one_value_profiler_fn): New variables. + (tree_init_edge_profiler): Initialize the profiler function decls. + (tree_gen_edge_profiler): Use global gcov_type_node. + (prepare_instrumented_value): New function. + (tree_gen_interval_profiler, tree_gen_interval_profiler, + tree_gen_one_value_profiler): Call the library functions instead of + creating instrumentation code. + * tree.c (build_fn_decl): New function. + * tree.h (build_fn_decl): Declare. + * value-prof.c (rtl_divmod_values_to_profile, + rtl_find_values_to_profile, rtl_mod_pow2_value_transform, + tree_mod_pow2_value_transform, tree_find_values_to_profile): + Do not handle may_be_other and precise values of exponents at pow2 + profiler. + (tree_mod_subtract_transform): Reflect that value field of + histogram has changed meaning. + (tree_divmod_values_to_profile): Record the values correctly. + (tree_values_to_profile): Update comment. + * value-prof.h (struct histogram_value_t): Remove pow2 data. + +2005-04-22 Joseph S. Myers + + * varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN + (decl). + +2005-04-22 Nathan Sidwell + + * config/i386/i386.md (length_immediate): Use gcc_assert or + gcc_unreachable, as appropriate. + (*movsi_1, *movqi_1, reload_outqi, *movdi_1_rex64, *pushsf, + *pushsf_rex64, *truncxfsf2_mixed, *truncxfsf2_i387, + *truncxfdf2_mixed, *truncxfdf2_i387, *adddi_1_rex64, + *adddi_2_rex64, *adddi_3_rex64, *adddi_4_rex64, *adddi_5_rex64, + *addsi_1, addsi_1_zext, *addsi_2, *addsi_2_zext, *addsi_3, + *addsi_3_zext, *addsi_4, *addsi_5, *addhi_1_lea, *addhi_1, + *addhi_2, *addhi_3, *addhi_4, *addhi_5, *addqi_1_lea, *addqi_1, + *addqi_1_slp, *addqi_2, *addqi_3, *addqi_4, *addqi_5, addqi_ext_1, + *addqi_ext_1_rex64, *anddi_1_rex64, *andsi_1, *andhi_1, + *ashldi3_1_rex64, *ashldi3_cmp_rex64, *ashlsi3_1, *ashlsi3_1_zext, + *ashlsi3_cmp, *ashlsi3_cmp_zext, *ashlhi3_1_lea, *ashlhi3_1, + *ashlhi3_cmp, *ashlqi3_1_lea, *ashlqi3_1, *ashlqi3_cmp, + pro_epilogue_adjust_stack_1, pro_epilogue_adjust_stack_rex64, + pro_epilogue_adjust_stack_rex64_2, prefetch, *prefetch_sse, + *prefetch_sse_rex): Likewise. + * config/i386/predicates.md (x86_64_immediate_operand, + x86_64_zext_immediate_operand, symbolic_operand, + no_seg_address_operand, aligned_operand, + memory_displacement_operand): Likewise. + * config/i386/sse.md (*mov_internal, + *movv2df_internal): Likewise. + +2005-04-22 Jan Hubicka + + * Makefile.in (ipa.o, ipa-inline.o): New files. + * cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder, + cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes, + cgraph_mark_inline_edge, cgraph_default_inline_p): Declare. + * cgraphunit.c (cgraph_default_inline_p, + cgraph_decide_inlining_incrementally, ncalls_inlined, + nfunctions_inlined, initial_insns, overall_insns, + cgraph_estimate_size_after_inlining, cgraph_estimate_growth, + cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, + cgraph_mark_inline, cgraph_check_inline_limits, + cgraph_default_inline_p, cgraph_recursive_inlining_p, + update_callee_keys, lookup_recursive_calls, + cgraph_decide_recursive_inlining, cgraph_set_inline_failed, + cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining, + cgraph_decide_inlining_incrementally, cgraph_gate_inlining, + pass_ipa_inline): Move to ipa-inline.c + (cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c + * ipa.c: New file. + * ipa-inline.c: New file. + +2005-04-22 Eric Botcazou + + * doc/invoke.texi (SPARC options): Document that -mapp-regs + is turned off by default on Solaris. + +2005-04-21 Roger Sayle + + * c-common.h (objc_build_method_signature): Update prototype. + * stub-objc.c (objc_build_method_signature): Update the stub + implementation to accept and ignore additional parameter. + * c-parser.c (c_parser_objc_method_decl): Reorgnize to pass + the value of ellipsis to objc_build_method_signature instead + of setting TREE_OVERFLOW on the parms TREE_LIST node. + +2005-04-21 Geoffrey Keating + + * config/rs6000/rs6000-protos.h (rs6000_emit_sync): New. + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Use + gen_rtx_* not gen_rtx_fmt_*. + (rs6000_emit_vector_select): Likewise. + (rs6000_emit_sync): New. + * config/rs6000/rs6000.md (GPR, INT, INT1): New mode macros. + (larx, stcx, cmp): New mode substitutions. + (UNSPEC_SYNC, UNSPEC_SYNC_OP, UNSPEC_SYNC_SWAP, UNSPEC_LWSYNC, + UNSPEC_ISYNC): New constants. + (rlwinm): Give name. + (memory_barrier, isync, lwsync): New insns. + (sync_compare_and_swap, sync_lock_test_and_set): New insn. + (sync_lock_release): New expander. + (sync_add, sync_sub, sync_ior, sync_and, + sync_xor, sync_nand, sync_old_add, + sync_old_sub, sync_old_ior, sync_old_and, + sync_old_xor, sync_old_nand, sync_new_add, + sync_new_sub, sync_new_ior, sync_new_and, + sync_new_xor, sync_new_nand): New expanders. + (sync_add_internal, sync_addshort_internal, + sync_sub_internal, sync_andsi_internal, sync_anddi_internal, + sync_boolsi_internal, sync_booldi_internal, sync_boolc_internal, + sync_boolc_internal2, sync_boolcc_internal): New insns. + + * doc/md.texi (Standard Names): sync_compare_and_swap's operand 0 + is the memory before, not after, the operation. Clarify + barrier requirements. + +2005-04-21 Nathan Sidwell + + * cfghooks.h (struct cfg_hooks): Reword comments to avoid 'abort'. + * lambda.h (lambda_vector_min_nz): Likewise. + * langhooks.h (struct lang_hooks_for_types, + struct lang_hooks): Likewise. + * output.h (assemble_integer, this_is_asm_operands): Likewise. + * tree.h: Likewise. + * vec.h: Likewise. + * tree-flow-inline.h (relink_imm_use): Use gcc_assert. + + * optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword + comments to avoid 'abort'. Use gcc_assert as necessary. + * opts.c (common_handle_option): Likewise. + * pretty-print.c (pp_base_format_text): Likewise. + * print-rtl.c (print_rtx): Likewise. + * read-rtl.c (read_rtx_filename, read_rtx_1): Likewise. + * regmove.c (try_auto_increment): Likewise. + * reload.c (find_valid_class, find_reloads_toplev, + find_equiv_reg): Likewise. + * reload1.c (reload, forget_old_reloads_1, function_invariant_p, + merge_assigned_reloads): Likewise. + * tree-inline.c (inline_forbidden_p_1, + estimate_num_insns_1): Likewise. + * tree-optimize.c (execute_todo): Likewise. + * tree-outof-ssa.c (eliminate_phi): Likewise. + * tree-ssa-alias.c (add_pointed_to_expr): Likewise. + * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise. + * tree-ssa-operands.c (parse_ssa_operands, + get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise. + * tree-ssa-pre.c (find_or_generate_expression): Likewise. + * tree-ssanames.c (release_ssa_name): Likewise. + * tree.c (int_bit_position, int_byte_position, tree_low_cst, + walk_tree): Likewise. + + * tree-ssa-operands.c (verify_abort): Fold into .. + (verify_imm_links): ... here. + +2005-04-21 Richard Henderson + + * config/alpha/sync.md (sync_new_nand): Fix constraints + on non-memory operand for previous inversion. + +2005-04-21 Devang Patel + + PR optimization/20994 + * tree-if-conv.c (find_phi_replacement_condition): Avoid generating + x = !(a == b) : p , q;. + (pass_if_conversion): Verify stmts and flow. + +2005-04-21 Nathan Sidwell + + * optabs.c (gen_conditional_trap): Restore #define. + + * alias.c (true_dependence): Remove 'abort' from comments. Use + gcc_assert and gcc_unreachable as appropriate. + (canon_true_dependence): Likewise. + * bb-reorder.c (connect_traces): Likewise. + * c-common.c (c_add_case_label): Likewise. + * c-decl.c (finish_function): Likewise. + * caller-save.c (insert_restore, insert_save): Likewise. + * cfg.c (update_bb_profile_for_threading): Likewise. + * cfganal.c (flow_active_insn_p): Likewise. + * cfgexpand.c (add_reg_br_prob_note): Likewise. + * cfgrtl.c (rtl_redirect_edge_and_branch_force, rtl_split_edge, + cfg_layout_merge_blocks): Likewise. + * ifcvt.c (cond_exec_process_insns, merge_if_block, + find_if_block): Likewise. + * integrate.c (allocate_initial_values): Likewise. + * jump.c (reverse_condition, reverse_condition_maybe_unordered, + swap_condition, unsigned_condition, signed_condition, + mark_jump_label, invert_jump_1, rtx_renumbered_equal_p, + reg_or_subregno): Likewise. + * lambda-code.c (lambda_compute_auxillary_space, + lambda_transform_legal_p): Likewise. + * lambda-mat.c (lambda_matrix_inverse_hard): Likewise. + * langhooks.c (lhd_set_decl_assembler_name, lhd_type_promotes_to, + lhd_incomplete_type_error, lhd_expand_expr, + lhd_types_compatible_p, lhd_tree_size): Likewise. + * lcm.c (create_pre_exit, optimize_mode_switching): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * loop-unroll.c (peel_loop_completely + unroll_loop_constant_iterations, unroll_loop_runtime_iterations, + peel_loop_simple, unroll_loop_stupid, + analyze_iv_to_split_insn): Likewise. + * loop.c (gen_prefetch, find_and_verify_loops, + basic_induction_var): Likewise. + * modulo-sched.c (normalize_sched_times, check_nodes_order): Likewise. + * value-prof.c (tree_find_values_to_profile): Likewise. + * varasm.c (named_section, default_assemble_integer, + decode_addr_const): Likewise. + +2005-04-21 Alan Modra + Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Fix size of + portion of argument passed in fpr. + * expr.c (emit_push_insn): Fix computation of 'offset' used to + decide on partial argument save on stack. + +2005-04-21 Kazu Hirata + + * config/sparc/predicates.md, config/sparc/sparc.md: Fix + comment typos. + +2005-04-21 Jan Hubicka + + * cgraphunit.c: Include tree-pass.h + (cgraph_decide_recursive_inlining, + cgraph_decide_inlining_of_small_function, cgraph_set_inline_failed, + cgraph_decide_inlining): Dump goes to dump_file. + (cgraph_optimize): Call ipa passes instead of inliner. + (cgraph_gate_inlining, pass_ipa_inline): New. + * tree-optimize.c (all_ipa_passes): New static variable. + (register_one_dump_file): Dead with IPA passes. + (register_dump_files): Likewise. + (init_tree_optimization_passes): Initialize IPA passes. + (execute_todo): Do cgraph dump when asked to, do not dump function body + for IPA pass. + * tree-pass.h (TODO_dump_cgraph): New macro. + (ipa_passes): Declare. + * Makefile.in (cgraphunit.o): Add dependency on cgraphunit.h + +2005-04-21 Nathan Sidwell + + * config/i386/i386.c (type_natural_mode): Use gcc_unreachable and + gcc_assert instead of abort. + (classify_argument, examine_argument, construct_container, + contains_128bit_aligned_vector_p, ix86_check_movabs, + standard_80387_constant_opcode, standard_80387_constant_rtx, + ix86_initial_elimination_offset, ix86_compute_frame_layout, + pro_epilogue_adjust_stack, ix86_expand_epilogue, + ix86_address_cost, legitimate_address_p, legitimize_pic_address, + legitimize_tls_address, output_pic_addr_const, + i386_output_dwarf_dtprel, put_condition_code, print_reg, + get_some_local_dynamic_name, print_operand, print_operand_address, + output_387_binary_op, emit_i387_cw_initialization, + output_fix_trunc, output_fp_compare, ix86_output_addr_vec_elt, + ix86_expand_clear, ix86_expand_binary_operator, + ix86_expand_unary_operator, ix86_match_ccmode, ix86_cc_mode, + ix86_cc_modes_compatible, ix86_fp_comparison_codes, + ix86_fp_comparison_arithmetics_cost, ix86_expand_fp_compare, + ix86_expand_branch, ix86_expand_setcc, + ix86_expand_carry_flag_compare, ix86_expand_fp_movcc, + ix86_expand_int_addcc, ix86_split_to_parts, ix86_split_long_move, + ix86_expand_movmem, ix86_expand_call, assign_386_stack_local, + memory_address_length, ix86_attr_length_immediate_default, + ix86_attr_length_address_default, ix86_agi_dependant, + x86_initialize_trampoline, ix86_init_mmx_sse_builtins, + ix86_expand_binop_builtin, ix86_force_to_memory, + ix86_secondary_memory_needed, ix86_avoid_jump_misspredicts, + x86_emit_floatuns): Likewise. + * config/i386/netware.c (gen_regparm_prefix, + i386_nlm_strip_name_encoding): Likewise. + * config/i386/winnt.c (i386_pe_mark_dllexport): Likewise. + +2005-04-21 Nathan Sidwell + + * optabs.c (gen_condiational_trap): Remove #define. + (add_equal_note): Assertify. Remove explicit indirection from + call via function pointer. + (expand_ternary_op, expand_simple_binop, expand_binop, + expand_twoval_unop, expand_twoval_binop, + expand_twoval_binop_libfunc, expand_simple_unop expand_unop, + emit_unop_insn, emit_no_conflict_block, prepare_cmp_insn, + prepare_operand emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns, + prepare_float_lib_cmp, emit_conditional_move, + emit_conditional_add, gen_add2_insn, gen_add3_insn, + have_add2_insn, gen_sub2_insn, gen_sub3_insn, have_sub2_insn, + expand_float, expand_fix, debug_optab_libfuncs, gen_cond_trap, + vector_compare_rtx, expand_vec_cond_expr): Likewise. + +2005-04-21 Nathan Sidwell + + * vec.h: Update API to separate allocation mechanism from type. + (VEC_safe_grow): New. + * vec.c (calculate_allocation): New. + (vec_gc_o_reserve, vec_heap_o_reserve): Adjust. + (vec_gc_free, vec_heap_free): Remove. + * gengtype-lex.l (DEF_VEC_): Process mult-argument macros. Adjust. + (VEC): Likewise. + (mangle_macro_name): New. + (struct macro_def): New. + (struct macro): Add multiple argument values. + (macro_expans_end): New. + (push_macro_expansion): Chain on new macro. Process multiple + args, create follow on expansion. Return follow on argument. + (macro_input): Deal with multiple arguments. + + * tree.h: Define VEC(tree,heap) and VEC(tree,gc). + (struct tree_binfo): Adjust. + * basic-block.h: Define VEC(edge,gc). + (struct edge_def): Adjust. + (struct basic_block_def, struct edge_iterator): Likewise. + (ei_container, ei_start_1, ei_last_1): Likewise. + * cfg.c (connect_src, connect_dest): Likewise. + * cfgrtl.c (force_nonfallthru_and_redirect) + * dbxout.c (dbxout_type) + * dwarf2out.c (gen_member_die) + * lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc). + (gcc_tree_to_linear_expression): Adjust. + (gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest, + lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, + perfect_nestify): Likewise. + * lambda.h (gcc_loopnest_to_lambda_loopnest, + lambda_loopnest_to_gcc_loopnest): Adjust prototypes. + * profile.c (instrument_values): Adjust. + * tree-cfg.c (modified_noreturn_calls): Adjust. + (remove_fallthru_edge): Likewise. + * tree-dump.c (dequeue_and_dump): Adjust. + * tree-flow-inline.h (mark_stmt_modified): Adjust. + * tree-flow.h (modified_noreturn_calls): Adjust. + (tree_on_heap): Remove. (yay!) + (register_new_def): Adjust. + * tree-into-ssa.c: Define VEC(int,heap). + (block_defs_stack): Adjust. + (find_idf, insert_phi_nodes, register_new_def, + rewrite_initialize_block, rewrite_finalize_block, + register_new_update_single, rewrite_update_init_block, + rewrite_update_fini_block, rewrite_blocks, + ssa_rewrite_finalize_block, ssa_register_new_def, + ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise. + * tree-loop-linear.c (linear_transform_loops): Adjust. + * tree-ssa-alias.c: Define VEC(fieldoff_t,heap). + (push_fields_onto_fieldstack, create_overlap_variables_for): Adjust. + * tree-ssa-dom.c (avail_exprs_stack, block_defs_stack, + stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack, + vrp_variables_stack): Adjust declarations. + (tree_ssa_dominator_optimize): Adjust. + (dom_opt_initialize_block, remove_local_expressions_from_table, + restore_nonzero_vars_to_original_value, + restore_vars_to_original_value, + restore_currdefs_to_original_value, dom_opt_finalize_block, + record_var_is_nonzero, record_cond, record_const_or_copy_1, + optimize_stmt, update_rhs_and_lookup_avail_expr, + lookup_avail_expr, record_range): Likewise. + * tree-ssa-pre.c: Define VEC(basic_block,heap). + (compute_antic_aux): Adjust. + (inserted_exprs, create_expression_by_pieces, + insert_into_preds_of_block, eliminate, mark_operand_necessary, + remove_dead_inserted_code, fini_pre): Likewise. + * tree-ssa-propagate.c (interesting_ssa_edges): Adjust. + (varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist. + ssa_prop_init): Likewise. + * tree-ssa.c: Define VEC(bitmap,heap). + (verify_name_tags): Adjust. + * value-prof.c (rtl_divmod_values_to_profile): Adjust. + (insn_prefetch_values_to_profile, rtl_find_values_to_profile, + tree_divmod_values_to_profile, tree_find_values_to_profile, + value_profile_transformations): Likewise. + * value-prof.h: Define VEC(histogram_value,heap). + * varasm.c: Remove alias_pair pointer typedef, define + VEC(alias_pair,gc). + (finish_aliases_1, finish_aliases_2, assemble_alias): Adjust. + + * config/pa/pa.c (typedef extern_symbol): Typedef the structure, + not a pointer to it. Create an object vector. + (extern_symbols): Turn into an object vector. + (pa_hpux_asm_output_external, pa_hpux_file_end): Adjust. + +2005-04-21 Sebastian Pop + + PR/20742 + * Makefile.in (tree-chrec.o): Depend on params.h. + * params.def (PARAM_SCEV_MAX_EXPR_SIZE): New parameter with + default value 20. + * tree-chrec.c: Depend on params.h. Replace build with buildN, + and fold build with fold_buildN. + (chrec_fold_plus_1): Fail with a chrec_don_know when the size of + the expression exceeds PARAM_SCEV_MAX_EXPR_SIZE. + (tree_contains_chrecs): Compute an estimation of the size of the + given expression. + * tree-chrec.h (tree_contains_chrecs): Modify its declaration. + (tree_does_not_contain_chrecs): Update the use of tree_contains_chrecs. + * tree-scalar-evolution.c (simple_iv): Ditto. + * doc/invoke.texi (scev-max-expr-size): Documented. + +2005-04-21 Richard Sandiford + + * config.gcc (*-*-darwin*): Add darwin.opt to $extra_options. + (i[34567]86-pc-msdosdjgpp*): Likewise i386/djgpp.opt. + (i[34567]86-*-lynxos*, powerpc-*-lynxos*): Likewise lynx.opt. + (i[34567]86-*-sco3.2v5*): Likewise i386/sco5.opt. + (i[34567]86-*-pe, i[34567]86-*-cygwin*, i[34567]86-*-mingw32*) + (i[34567]86-*-uwin*): Likewise i386/cygming.opt. + * config/darwin.h (darwin_one_byte_bool, darwin_fix_and_continue) + (darwin_fix_and_continue_switch, SUBTARGET_OPTIONS): Delete. + * config/darwin.c (darwin_one_byte_bool, darwin_fix_and_continue) + (darwin_fix_and_continue_switch): Delete. + * config/lynx.h (SUBTARGET_OS_LYNX_SWITCHES): Delete. + (SUBTARGET_SWITCHES): Delete. + * config/i386/i386.h (target_flags, MASK_80387, MASK_RTD) + (MASK_ALIGN_DOUBLE, MASK_SVR3_SHLIB, MASK_IEEE_FP, MASK_FLOAT_RETURNS) + (MASK_NO_FANCY_MATH_387, MASK_OMIT_LEAF_FRAME_POINTER) + (MASK_STACK_PROBE, MASK_NO_ALIGN_STROPS, MASK_INLINE_ALL_STROPS) + (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS, MASK_MMX) + (MASK_SSE, MASK_SSE2, MASK_SSE3, MASK_3DNOW, MASK_3DNOW_A) + (MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT) + (MASK_TLS_DIRECT_SEG_REFS, MASK_NO_RED_ZONE, TARGET_80387) + (TARGET_RTD, TARGET_ALIGN_DOUBLE, TARGET_PUSH_ARGS) + (TARGET_ACCUMULATE_OUTGOING_ARGS, TARGET_SVR3_SHLIB, TARGET_IEEE_FP) + (TARGET_128BIT_LONG_DOUBLE, TARGET_NO_FANCY_MATH_387) + (TARGET_USE_FANCY_MATH_387, TARGET_OMIT_LEAF_FRAME_POINTER) + (TARGET_DEBUG_ADDR, TARGET_DEBUG_ARG): Delete. + (TARGET_FLOAT_RETURNS_IN_80387): Make an alias of TARGET_FLOAT_RETURNS. + (TARGET_64BIT): Undef before redefining. + (TARGET_TLS_DIRECT_SEG_REFS, TARGET_STACK_PROBE) + (TARGET_ALIGN_STRINGOPS, TARGET_INLINE_ALL_STRINGOPS, TARGET_SSE) + (TARGET_SSE2, TARGET_SSE3, TARGET_MMX, TARGET_3DNOW, TARGET_3DNOW_A) + (TARGET_RED_ZONE, TARGET_USE_MS_BITFIELD_LAYOUT, TARGET_SWITCHES) + (TARGET_OPTIONS, SUBTARGET_SWITCHES, SUBTARGET_OPTIONS) + (ix86_fpmath_string, ix86_tls_dialect_string, ix86_cmodel_string) + (ix86_asm_string, ix86_regparm, ix86_regparm_string) + (ix86_preferred_stack_boundary_string, ix86_branch_cost_string) + (ix86_debug_arg_string, ix86_debug_addr_string) + (ix86_align_loops_string, ix86_align_jumps_string) + (ix86_align_funcs_string): Delete. + * config/i386/cygming.h (MASK_NOP_FUN_DLLIMPORT) + (TARGET_NOP_FUN_DLLIMPORT, SUBTARGET_SWITCHES): Delete. + * config/i386/djgpp.h (MASK_BNU210, SUBTARGET_SWITCHES): Delete. + (SUBTARGET_OVERRIDE_OPTIONS): Check TARGET_BNU210. + * config/i386/lynx.h (SUBTARGET_SWITCHES): Delete. + * config/i386/sco5.h (MASK_COFF, TARGET_ELF) + (SUBTARGET_SWITCHES): Delete. + * config/i386/i386.c (ix86_debug_arg_string): Delete. + (ix86_debug_addr_string): Delete. + (ix86_cmodel_string, ix86_asm_string, ix86_tls_dialect_string) + (ix86_fpmath_string, ix86_regparm_string, ix86_regparm) + (ix86_align_loops_string, ix86_align_jumps_string) + (ix86_preferred_stack_boundary_string, ix86_branch_cost_string) + (ix86_align_funcs_string): Make static. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (ix86_handle_option): New function. + (TARGET_USE_MS_BITFIELD_LAYOUT): Delete. + (ix86_ms_bitfield_layout_p): Check TARGET_MS_BITFIELD_LAYOUT. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Remove handling + of darwin_fix_and_continue_switch. + (darwin_one_byte_bool): Delete. + * config/rs6000/lynx.h (EXTRA_SUBTARGET_SWITCHES): Delete. + * config/rs6000/rs6000.c (rs6000_override_options): Update assignment + to darwin_one_byte_bool. + * config/darwin.opt, config/lynx.opt, config/i386/cygming.opt, + * config/i386/djgpp.opt, config/i386/i386.opt, + * config/i386/sco5.opt: New files. + +2005-04-21 Eric Botcazou + + * config/sparc/sparc.c (reg_or_0_operand, const1_operand, + fp_zero_operand, fp_register_operand, intreg_operand, + fcc_reg_operand, fcc0_reg_operand, icc_or_fcc_reg_operand, + call_operand, call_operand_address, tgd_symbolic_operand, + tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand, + symbolic_operand, symbolic_memory_operand, label_ref_operand, + sp64_medium_pic_operand, data_segment_operand, + text_segment_operand, splittable_symbolic_memory_operand, + reg_or_nonsymb_mem_operand, splittable_immediate_memory_operand, + eq_or_neq, normal_comp_operator, noov_compare_op, + noov_compare64_op, v9_regcmp_op, extend_op, cc_arithop, + cc_arithopn, arith_operand, arith_4096_operand, arith_add_operand, + const64_operand, const64_high_operand, arith11_operand, + arith10_operand, arith_double_operand, arith_double_4096_operand, + arith_double_add_operand, arith11_double_operand, + arith10_double_operand, small_int, small_int_or_double, + uns_small_int, uns_arith_operand, clobbered_register, + input_operand, compare_operand): Delete. + (sparc_emit_set_const32): Use predicates in assertion. Remove special + code for TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT != 64. + (sparc_emit_set_const64): Call gcc_unreachable if H_B_P_W_I == 32. + (GEN_HIGHINT64, GEN_INT64): Delete. + (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, + gen_safe_XOR64): Adjust for above deletion. + (sparc_emit_set_const64): Support only H_B_P_W_I == 64 and CONST_INTs. + Use 'unsigned HOST_WIDE_INT' instead of 'long' for bitmask. + (legitimate_constant_p): Use const_zero_operand instead. + (sparc_extra_constraint_check): Likewise. + * config/sparc/sparc.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'O'. + (PREFERRED_RELOAD_CLASS): Use const_zero_operand. + (PREDICATE_CODES): Delete. + * config/sparc/sparc.md: Include predicates.md. + (All patterns): Adjust for new predicate names. + (cmpdi, cmpdi_sp64): Use arith_operand predicate. + (movhi_const64_special, movsi_const64_special): Add 'K' constraint. + (movdi): Use general_operand predicate. + (movdi_sp64_dbl): Delete. + (movdi_const64_special): Add 'N' constraint. + (movdicc): Use arith10_operand predicate. + (movdi_cc_sp64, movdi_cc_sp64_trunc): Use arith11_operand predicate. + (movdi_cc_reg_sp64): Use arith10_operand predicate. + (movdi_cc_reg_sp64_trunc): Delete. + (cmp_zero_extract, cmp_zero_extract_sp64): Use small_int_operand. + (adddi3_sp64, cmp_ccx_plus, cmp_ccx_plus_set): Use arith_operand. + (subdi3_sp32): Delete. + (subdi3_insn_sp32): Change to define_insn_and_split. + (subdi3_sp64, cmp_minus_ccx, cmp_minus_ccx_set): Use arith_operand. + (muldi3, muldi3_sp64, muldi3_v8plus): Likewise. + (smulsi3_highpart_v8plus, const_smulsi3_highpart_v8plus, + umulsi3_highpart_v8plus, const_umulsi3_highpart_v8plus): Use + small_int_operand predicate. + (divdi3, udivdi3): Use arith_operand predicate. + (udivsi3, udivsi3_sp32, udivsi3_sp64): Use nonimmediate_operand. + (and3_sp64, ior3_sp64, xor3_sp64, + xor_not__sp64) : Use arith_operand predicate. + (xordi3_sp64_dbl): Delete. + (cmp_ccx_arith_op, cmp_ccx_arith_op_set, cmp_ccx_xor_not, + cmp_ccx_xor_not_set, cmp_ccx_arith_op_not, cmp_ccx_arith_op_not_set, + cmp_ccx_neg, cmp_ccx_set_neg, one_cmpl2_sp64, cmp_ccx_not, + cmp_ccx_set_not): Use arith_operand predicate. + (ashrsi3_extend2, lshrsi3_extend2 et al.): Use small_int_operand. + * config/sparc/predicates.md: New file. + +2005-04-21 Kazu Hirata + + PR tree-optimization/14846 + * fold-const.c (fold_single_bit_test_into_sign_test): New, + split out from ... + (fold_single_bit_test): ... here. + (fold_binary): Call fold_single_bit_test_into_sign_test + instead of fold_single_bit_test. + +2005-04-20 James E Wilson + + PR c++/20805 + * dwarf2out.c (gen_variable_die): Don't emit a specification if this + is another declaration. + +2005-04-21 Hans-Peter Nilsson + + * config/cris/predicates.md: New file. + * config/cris/cris-protos.h (cris_store_multiple_op_p) + (cris_movem_load_rest_p): Declare. + * config/cris/cris.c (cris_store_multiple_op): Return bool, not int. + (cris_movem_load_rest_p): Ditto. Globalize. + (cris_bdap_operand, cris_bdap_biap_operand, + cris_orthogonal_operator, cris_commutative_orth_op, + cris_operand_extend_operator, + cris_additive_operand_extend_operator, cris_extend_operator, + cris_plus_or_bound_operator, cris_mem_op, + cris_general_operand_or_symbol, + cris_general_operand_or_gotless_symbol, + cris_general_operand_or_plt_symbol, cris_mem_call_operand, + cris_load_multiple_op): Remove predicate functions. + (cris_symbol, cris_gotless_symbol) : Return 0, don't + abort, for UNSPECs other than CRIS_UNSPEC_PLT. + * config/cris/cris.h (PREDICATE_CODES): Don't define. + * config/cris/cris.md: Include predicates.md. + ("call", "call_value"): Generate CONSTs of Pmode, not VOIDmode. + +2005-04-20 Ian Lance Taylor + + * c-common.def: Remove STMT_EXPR (moved to cp/cp-tree.def). + * c-common.h (STMT_EXPR_STMT): Don't define. + (STMT_EXPR_NO_SCOPE): Don't define. + * c-dump.c (c_dump_tree): Don't handle STMT_EXPR. + * c-pretty-print.c (pp_c_primary_expression): Likewise. + (pp_c_expression): Likewise. + +2005-04-20 Richard Henderson + + PR target/21100 + * config/i386/mmx.md (push1): Fix predicate thinko. + +2005-04-20 Jeff Law + + * reload1.c (reload): Ignore equivalences between pseudos and + read only memory. + +2005-04-20 Joseph S. Myers + + PR c/12913 + * c-tree.h (struct c_label_list): Update comment. + (struct c_label_context): Rename to struct c_label_context_se. + (label_context_stack): Rename to label_context_stack_se. + (C_DECL_UNJUMPABLE_VM, C_DECL_UNDEFINABLE_VM, struct + c_label_context_vm, label_context_stack_vm, c_begin_vm_scope, + c_end_vm_scope): New. + (C_DECL_DECLARED_BUILTIN, C_DECL_USED): Use FUNCTION_DECL_CHECK. + * c-decl.c (pop_scope): Call c_end_vm_scope. + (pushdecl): Call c_begin_vm_scope for variably modified + declarations. + (define_label): Check for jumping into scope of identifier with + variably modified type. Push label on stack for those defined at + current context of identifiers with variably modified type. + (start_function): Create stack level for context of identifiers + with variably modified type. + (finish_function): Pop stack level for context of identifiers with + variably modified type. + * c-typeck.c (label_context_stack): Rename to + label_context_stack_se. + (label_context_stack_vm, c_begin_vm_scope, c_end_vm_scope): New. + (c_finish_goto_label): Check for jumping into scope of identifier + with variably modified type. Push label on stack for those jumped + to from current context of identifiers with variably modified + type. + (struct c_switch): Add blocked_vm. + (c_start_case): Initialize blocked_vm. + (do_case): Check blocked_vm. + (c_finish_case): Add comment. + (c_begin_stmt_expr, c_finish_stmt_expr): Update for renamed + variable label_context_stack. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c (tree_ssa_phi_opt): Update calls to + conditional_replacement, value_replacement, abs_replacement, + minmax_replacement. + (replace_phi_edge_with_variable): Remove argument BB. + (conditional_replacement, value_replacement, + minmax_replacement, abs_replacement): Remove argument PHI_BB. + Update a call to replace_phi_edge_with_variable. + + * tree-ssa-phiopt.c: Fix comments. + +2005-04-20 Michael Matz + + PR20973 + * reload.c (push_reload, find_dummy_reload): Check for uninitialized + pseudos. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c: Fix comment typos. + + PR tree-optimization/21116 + * tree-ssa-phiopt.c: Fix a typo. + +2005-04-19 Richard Henderson + + * builtins.c (expand_builtin_sync_operation): Revert last change. + * optabs.c (expand_bool_compare_and_swap): Compare vs old value, + not vs new value. + (expand_compare_and_swap_loop): Likewise. + (expand_sync_operation): Remove fallback from NAND to AND; invert + memory operand when expanding from cmpxchg. + (expand_sync_fetch_operation): Likewise. + * doc/extend.texi (Atomic Builtins): Fix docs for nand and + compare-and-swap. + + * config/alpha/alpha.c (alpha_split_atomic_op): Invert memory operand + when implementing NAND. Fix double-add for AFTER. + * config/alpha/sync.md (sync_nand): Invert memory operand. + (sync_old_nand, sync_new_nand): Likewise. + (sync_compare_and_swap): Fix compare vs zero. Return old + memory value. + (sync_lock_test_and_set): Remove extra label and last + memory barrier. + + * config/i386/sync.md (sync_compare_and_swap): Fix pattern + to return old memory value. + (sync_compare_and_swap_cc): Likewise. + + * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Early + return pre-reload. Don't consider output or anti dependencies. + * config/ia64/sync.md (IMODE): New. + (modesuffix): Add QI and HI. + (memory_barrier): Simplify expansion. + (sync_compare_and_swap): Use IMODE, not I48MODE. + (cmpxchg_acq_): Likewise. + (sync_lock_test_and_set): Likewise. + (sync_lock_release): Likewise. + +2005-04-19 James A. Morrison + + * fold-const.c (fold_binary): Fold ~(X ^ Y) to ~X ^ Y or X ^ ~Y if + ~X or ~Y simplify. + +2005-04-19 James A. Morrison + + * fold-const (fold_binary): Fold ~X ^ ~ Y to X ^ Y. + +2005-04-20 Michael Pogue + Joseph S. Myers + + * c.opt (Wint-to-pointer-cast, Wpointer-to-int-cast): New options. + * c-typeck.c (build_c_cast): Check these options. + * doc/invoke.texi: Document these options. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c: Update a comment about the pass. + +2005-04-19 Kazu Hirata + + * tree-ssa-phiopt.c, config/arm/arm.c, config/fr30/fr30.md, + config/mcore/mcore.c: Fix comment typos. + +2005-04-19 Daniel Jacobowitz + + * Makefile.in (libgcc.mk): Pass GCC_FOR_TARGET. + * mklibgcc.in: Use $GCC_FOR_TARGET instead of ./xgcc. + +2005-04-19 Paul Brook + + * config/arm/arm.c (arm_init_libfuncs): Clear mod optabs. + +2005-04-19 Andrew Haley + + PR java/21022 + * dbxout.c (dbxout_type_fields): Check DECL_IGNORED_P before + looking at a field's bitpos. + +2005-04-19 Kaveh R. Ghazi + + * system.h (fopen, fdopen, freopen): Define these to the unlocked + libiberty functions. + +2005-04-19 Kazu Hirata + + PR tree-optimization/21096 + * tree-ssa-copy.c (fini_copy_prop): Free cached_last_copy_of. + +2005-04-19 Alan Modra + + PR target/21098 + * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. + * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. + +2005-04-19 Alexandre Oliva + + * tree-cfg.c (dump_function_to_file): Use cfun info only if it + refers to the function being dumped. + +2005-04-18 Daniel Jacobowitz + + * varasm.c (assemble_start_function): Remove reset of in_section. + +2005-04-18 James A. Morrison + + PR tree-optimization/21085 + * fold-const (fold_binary): Don't change X % -C to X % C if C has + overflowed. + +2005-04-19 Ben Elliston + + * doc/invoke.texi (Optimize Options): Refer to the correct + optimisation flag -ftree-dominator-opts, not -ftree-dom. + +2005-04-18 Christopher Jaillet + + * config/rs6000/rs6000.c (machopic_output_stub): Increase + alloca argument to be big enough. + +2005-04-18 Alexandre Oliva + + PR middle-end/21049 + * tree-cfg.c (dump_function_to_file): Do not crash if cfun or + cfun->cfg are NULL. + +2005-04-18 Tom Tromey + + * cgraphunit.c (cgraph_finalize_compilation_unit): Fix a comment + typo. + +2005-04-18 Richard Henderson + + * config/alpha/alpha.c (alpha_split_atomic_op): New. + (alphaev5_insn_pipe): Add LD_L, ST_C, MB types. + (alphaev4_insn_pipe): Likewise. Correct IST and LDSYM pipes. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (UNSPECV_MB, UNSPECV_LL, UNSPECV_SC): New. + (UNSPECV_ATOMIC, UNSPECV_CMPXCHG, UNSPECV_XCHG): New. + (attr type): Add ld_l, st_c, mb. + (andsi_internal, andnotsi3, iorsi_internal, one_cmplsi_internal, + iornotsi3, xorsi_internal, xornotsi3): New. + * config/alpha/ev4.md (ev4_ld): Add ld_l. + (ev4_ist_c, ev4_mb): New. + * config/alpha/ev5.md (ev5_st): Add st_c, mb. + (ev5_ld_l): New. + * config/alpha/ev6.md (ev6_ild): Add ld_l. + (ev6_ist): Add st_c. + (ev6_mb): New. + * config/alpha/sync.md: New file. + +2005-04-18 Richard Henderson + + * builtins.c (expand_builtin_sync_operation): Fold nand to and + for constants. + + * optabs.c (expand_sync_operation): Fix typo expanding nand to and. + +2005-04-18 Devang Patel + + * config/rs6000/atlivec.md (mulv4si3): New pattern. + +2005-04-18 James A. Morrison + + PR tree-optimization/20922 + * fold-const.c (fold_binary): Fold X - c > X and X + c < X to false. + Fold X + c >= X and fold X - c <= X to true. + +2005-04-18 James A. Morrison + + * config/ia64/unwind-ia64.c (emergency_reg_state_free): Make an + unsigned int. + (emergency_labeled_state_free): Likewise. + +2005-04-18 Nick Clifton + + * config/h8300/h8300.md (jump): Remove prescan parameter from + calls to final_scan_insn. + + * config/arc/arc.c (arc_output_function_epilogue): Remove prescan + parameter from calls to final_scan_insn. + + * config.gcc (m68hc12): Use the m68hc11.opt file for target + specific options. + (v850e, v850e1): Use the v850.opt file for target specific + options. + +2005-04-18 Kazu Hirata + + PR tree-optimization/21001 + * tree-optimize.c (init_tree_optimization_passes): Move the + first pass_forwprop immediately before pass_vrp. + +2005-04-17 Ian Lance Taylor + + * c-common.def (SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR): Remove. + * c-common.c (c_sizeof_or_alignof_type): Change second parameter + from enum tree_code op to bool is_sizeof. + * c-common.h (c_sizeof_or_alignof_type): Update declaration. + (c_sizeof, c_alignof): Update calls to c_sizeof_or_alignof_type. + * c-pretty-print.c (pp_c_postfix_expression): Remove ARROW_EXPR + case. + (pp_c_unary_expression): Remove SIZEOF_EXPR and ALIGNOF_EXPR + cases. + (pp_c_expression): Remove ARROW_EXPR, SIZEOF_EXPR, and + ALIGNOF_EXPR cases. + +2005-04-17 Ian Lance Taylor + + * system.h: Poison DONT_ACCESS_GBLS_AFTER_EPILOGUE. + +2005-04-17 Richard Henderson + + * config/alpha/alpha.c (va_list_skip_additions): Only define if + TARGET_ABI_OSF. + (TARGET_STDARG_OPTIMIZE_HOOK): Likewise. + (alpha_stdarg_optimize_hook): Likewise. Allow for one more round + of indirection through ssa names while looking for the gpr counter + field. + (alpha_setup_incoming_varargs) : Make use of the + saved va_list_gpr_size and va_list_fpr_size. + +2005-04-17 Kazu Hirata + + * tree-vrp.c (compare_values): Check that VAL1 and VAL2 are + both pointers or both integers. + + * tree-vrp.c (maybe_add_assert_expr): Don't assert + ASSERT_EXPRs for single-use variable. + + * tree-into-ssa.c: Fix a comment typo. + +2005-04-17 Richard Sandiford + + * config/mips/iris6.h (DRIVER_SELF_SPECS): Check -march as well as + -mipsN before forcing a default of -mips2. + +2005-04-17 Kazu Hirata + + * predict.h (IS_TAKEN): Remove. + * rtl.h (NOTE_PREDICTION): Likewise. + + * modulo-sched.c (CFG_HOOKS): Remove. + + * c-parser.c (N_C_TTYPES): Remove. + + * tree-flow-inline.h (get_stmt_operands): Remove. + * lambda-code.c, tree-ssa-loop-unswitch.c, + tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-propagate.c, + tree-ssa-sink.c, tree-ssa.c, tree-tailcall.c, + tree-vect-transform.c, tree-vectorizer.c, tree-vrp.c): Remove + calls to get_stmt_operands. + * doc/tree-ssa.texi: Don't mention get_stmt_operands. + +2005-04-17 Richard Henderson + + PR target/20375 + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Advance a copy + of CUMULATIVE_ARGS past the last named argument. + (alpha_va_start): Expect pretend_args_size only if strictly less than + 6 named arguments. + +2005-04-17 Kazu Hirata + + PR middle-end/21024 + * builtins.c (expand_builtin_strcat): Convert the result of + strlen to the right type. + * fold-const.c (fold_binary) : Use fold_convert to + avoid creating type mismatches. + : Pass op0 and op1 to fold_build2 to avoid creating + type mismatches. + + * c-lex.c (WCHAR_TYPE_SIZE, WCHAR_BYTES): Remove. + +2005-04-16 Richard Henderson + + PR target/21051 + * builtins.c (expand_builtin) : + Use the mode of boolean_type_node when the user doesn't provide one. + * config/ia64/sync.md (sync_lock_release): Use operand 1. + +2005-04-16 Alexandre Oliva + + PR target/20126 + * loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg) + (const)). + + * tree-scalar-evolution.c (interpret_rhs_modify_expr): Fix typo in + comment. + +2005-04-16 Roger Sayle + Steven Bosscher + + * fold-const.c (fold_binary_to_constant): Delete obsolete comment. + (fold_unary_to_constant): Likewise. + +2005-04-16 Kazu Hirata + + * basic-block.h: Adjust the value of PROP_SCAN_DEAD_STORES, + PROP_ASM_SCAN. + +2005-04-16 Gerald Pfeifer + + * doc/install.texi (Specific): Avoid using asterisks in @anchor + names related to target triplets. + Remove i?86-*-esix from platform directory. + Remove powerpc-*-eabiaix from platform directory. + +2005-04-16 Joseph S. Myers + + PR middle-end/20491 + * config/ia64/ia64.c (rtx_needs_barrier): Recurse instead of + falling through from SUBREG case to REG. + +2005-04-15 Roger Sayle + + * fold-const.c (fold_relational_hi_lo): Delete function and prototype. + (fold_binary): Update comment mentioning fold_relational_hi_lo. + (fold_binary_to_constant): Simplify using fold_binary. + (fold_unary_to_constant): Likewise, simplify using fold_unary. + +2005-04-15 Rainer Orth + + * gthr-posix.c (pthread_cancel): Define. + (pthread_mutexattr_init): Likewise. + (pthread_mutexattr_settype): Likewise. + (pthread_mutexattr_destroy): Likewise. + +2005-04-15 David S. Miller + + PR target/20673 + * config/sparc/sparc.h (sparc_hard_reg_printed): Mark as GTY(()). + +2005-04-15 Kazu Hirata + + PR tree-optimization/21031 + * tree-ssa-forwprop.c (ssa_name_defined_by_comparison_p): New. + (forward_propagate_into_cond_1): Call it. Forward propagate + integer-integer casts into COND_EXPRs. + +2005-04-15 Dave Korn + + * gcc.c (default_compilers): Clarify obscure error message when + reading from standard input. + +2005-04-15 Kazu Hirata + + * basic-block.h (PROP_EQUAL_NOTES): Remove. + * flow.c (propagate_one_insn): Don't use PROP_EQUAL_NOTES. + + * tree-ssa-alias.c (init_alias_info): Remove a call to + get_stmt_operands. + +2005-04-15 Andrew MacLeod + + * tree-vect-analyze.c (vect_stmt_relevant_p): Process immediate uses + of non-virtual PHI nodes like we use to. + +2005-05-15 Paolo Bonzini + + * genattrtab.c (ATTR_EQ_ATTR_P): Remove. + (attr_copy_rtx): Do not use it. + +2005-04-15 Andrew Macleod + + * doc/tree-ssa.texi: Grammer/abbreviation updates. + +2005-04-15 Diego Novillo + + * tree-vect-transform.c (vectorizable_store): Mark necessary + objects in the vectorized store needing renaming. Update the + SSA graph for V_MAY_DEF operands in the original store. + +2005-04-14 Daniel Berlin + + * tree-ssa-pre.c (compute_avail): It's okay to have + TREE_INVARIANT's here, and value number the resulting expressions. + (create_expression_by_pieces): Make sure operands that were + min_invariant when we started, stay that way. + +2005-04-15 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Add comment about system limits. + +2005-04-15 Kazu Hirata + + PR tree-optimization/20936. + * tree-ssa-ccp.c (visit_assignment): Fix a typo. + +2005-04-15 Volker Reichelt + + * doc/invoke.texi: Fix typos. + * doc/md.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/tm.texi: Likewise. + +2005-04-15 Uros Bizjak + + PR tree-optimization/21004 + * convert.c (convert_to_integer): Convert ceilf, ceill, floorf + and floorl in c99 mode only. + * builtins.c (expand_builtin_int_roundingfn): Assert that + fallback_fndecl is not NULL_TREE. + +2005-04-15 Kazu Hirata + + * cfgrtl.c (purge_all_dead_edge): Remove an unused argument. + * basic-block.h: Update the prototype for + purge_all_dead_edges. + * cfgexpand.c (tree_expand_cfg): Update a call to + purge_all_dead_edges. + * combine.c (combine_instructions): Likewise. + * passes.c (rest_of_handle_old_regalloc, rest_of_handle_cse, + rest_of_handle_cse2, rest_of_handle_gcse, + rest_of_handle_postreload): likewise. + +2005-04-15 Alexandre Oliva + + PR middle-end/20739 + * gimplify.c (gimplify_addr_expr): Compensate for removal of + e.g. cv-qualification conversions. + +2005-04-14 Mike Stump + + * config/darwin-c.c (framework_construct_pathname): We must + find all headers of a framework in the first instance of it + found in the seach path. + +2005-04-14 Kazu Hirata + + PR tree-optimization/21021 + * tree-vrp.c (compare_values): Work around a bug in the front + end that produces a comparison of mismatched types. + +2004-04-14 Richard Henderson + + * config/ia64/ia64.h (enum fetchop_code): Remove. + (enum ia64_builtins): Move ... + * config/ia64/ia64.c (enum ia64_builtins): ... here. Remove all + members except BSP and FLUSHRS. + (ia64_init_builtins): Remove __sync builtins. + (ia64_expand_builtin): Likewise. + (ia64_expand_fetch_and_op, ia64_expand_op_and_fetch): Remove. + (ia64_expand_compare_and_swap, ia64_expand_lock_test_and_set): Remove. + (ia64_expand_lock_release): Remove. + * config/ia64/ia64.md (mf): Move to sync.md. + (mf_internal, fetchadd_acq_si, fetchadd_acq_di, cmpxchg_acq_si, + cmpxchg_acq_di, xchgsi, xchgdi): Likewise. + * config/ia64/sync.md: New file. + (memory_barrier): Rename from mf. + (fetchadd_acq_): Macroize from _si/_di patterns. + (cmpxchg_acq_): Likewise. + (sync_lock_test_and_set): Likewise. + + * config/ia64/ia64intrin.h: Define nothing for C; limit #defines + to c++. Remove __sync* declarations. s/_si/_4/. s/_di/_8/. + +2004-04-14 Richard Henderson + + * config/i386/i386.c (x86_cmpxchg, x86_xadd): New. + (ix86_compare_emitted): New. + (ix86_expand_compare): Use ix86_compare_emitted if set. + (ix86_expand_setcc): Only emit REG_EQUAL if both ix86_compare_op0 + and ix86_compare_op0 are set. + * config/i386/i386.h (x86_cmpxchg, x86_xadd): Declare. + (TARGET_CMPXCHG, TARGET_XADD): New. + (ix86_compare_emitted): Declare. + * config/i386/i386.md: Include sync.md + (UNSPECV_CMPXCHG_1, UNSPECV_CMPXCHG_2): New. + (UNSPECV_XCHG, UNSPECV_LOCK): New. + * config/i386/sync.md: New file. + +2004-04-14 Richard Henderson + + PR middle-end/14311 + * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, + BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, + BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, + BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, + BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, + BT_FN_I8_VPTR_I8_I8): New. + * builtins.def (DEF_SYNC_BUILTIN): New. + (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, + BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, + BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, + BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, + BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, + BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, + BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, + BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, + BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, + BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, + BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, + BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, + BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, + BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, + BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, + BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, + BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, + BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, + BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, + BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, + BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, + BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, + BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, + BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, + BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, + BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, + BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, + BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, + BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, + BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, + BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, + BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, + BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, + BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, + BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, + BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, + BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, + BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, + BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, + BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, + BUILT_IN_SYNCHRONIZE: New. + * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN + as a function. Accept __sync_ as a prefix as well. + (expand_builtin_sync_operation, expand_builtin_compare_and_swap, + expand_builtin_lock_test_and_set, expand_builtin_synchronize, + expand_builtin_lock_release): New. + (expand_builtin): Call them. + * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if + neither BOTH_P nor FALLBACK_P are defined. + (builtin_type_for_size): New. + (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. + (resolve_overloaded_builtin): New. + * c-common.h (resolve_overloaded_builtin): Declare. + (builtin_type_for_size): Declare. + * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. + * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, + sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, + sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, + sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, + sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, + sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, + sync_compare_and_swap_cc, sync_lock_test_and_set, + sync_lock_release): New. + * optabs.h: Declare them. + * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, + expand_sync_operation, expand_sync_fetch_operation, + expand_sync_lock_test_and_set): Declare. + * genopinit.c (optabs): Add sync optabs. + * optabs.c (init_optabs): Initialize sync optabs. + (expand_val_compare_and_swap_1, expand_val_compare_and_swap, + expand_bool_compare_and_swap, expand_compare_and_swap_loop, + expand_sync_operation, expand_sync_fetch_operation, + expand_sync_lock_test_and_set): New. + * doc/extend.texi (Atomic Builtins): New section + * doc/md.texi (Standard Names): Add sync patterns. + +2005-04-14 Alexandre Oliva + + * tree-eh.c (lower_try_finally_copy): Generate new code in + response to goto_queue entries as if the queue was sorted by + index, not pointers. + (lower_try_finally_switch): Likewise. + +2005-04-14 Richard Henderson + + * config/i386/i386.c (ix86_expand_sse_cmp): Split out from ... + (ix86_expand_sse_movcc): ... here. Take cmp as a pre-computed + register. + (ix86_expand_fp_movcc): Update to match. + (ix86_expand_fp_vcond, ix86_expand_int_vcond): New. + * config/i386/i386-protos.h: Update. + * config/i386/sse.md (vcondv4sf, vcondv2df): New. + (vcond, vcondu): New. + +2005-04-14 Joseph S. Myers + + * doc/cpp.texi, doc/install.texi: Change references to GCC 3.5 to + refer to 4.0. + +2005-04-14 Julian Brown + + * Revert elfos.h part of my patch from 2005-04-13 for causing libstdc++ + link failures on ppc64 Linux. + +2005-04-14 Andreas Krebbel + + * config.gcc: Set cpu_type for s390. + +2005-04-14 Daniel Berlin + + Fix PR tree-optimization/20963 + * tree-ssa-pre.c (compute_avail): Remove special case for + TREE_INVARIANT. + (create_expression_by_pieces): Add value numbers for forced out + statements. + +2005-04-14 Hans-Peter Nilsson + + * config/cris/cris.md: Replace references to (reg:SI 16) with + (reg:SI CRIS_SRP_REGNUM). + +2005-04-14 Kazu Hirata + + PR tree-optimization/20657 + * tree-vrp.c (extract_range_from_expr): Notice INTEGER_CST to + create an appropriate range from it. + +2005-04-14 Uros Bizjak + + * reg-stack.c (subst_stack_regs_pat): Handle and + case. + + * config/i386/i386.md (UNSPEC_FIST_FLOOR, UNSPEC_FIST_CEIL): New. + (*fist2_floor_1, fistdi2_floor, fistdi2_floor_with_temp) + (fist2_floor, fist2_floor_with_temp): New isns patterns + to implement lfloor and llfloor built-ins as x87 intrinsic function. + (fistdi2_floor, fist2_floor splitters): New splitters. + (lfloor2): New expanders. + (*fist2_ceil_1, fistdi2_ceil, fistdi2_ceil_with_temp) + (fist2_ceil, fist2_ceil_with_temp): New isns patterns + to implement lceil and llceil built-ins as x87 intrinsic function. + (fistdi2_ceil, fist2_ceil splitters): New splitters. + (lceil2): New expanders. + +2005-04-14 Uros Bizjak + + * convert.c (convert_to_integer): Convert (long int)trunc{,f,l}, + and (long long int)ceil{,f,l} into FIX_TRUNC_EXPR. + +2005-04-14 Ulrich Weigand + + PR target/20927 + * config/s390/s390-modes.def: Define TFmode. + +2005-04-13 Richard Sandiford + + * config/mips/mips.h (ASM_OUTPUT_CASE_LABEL): Delete. + (JUMP_TABLES_IN_TEXT_SECTION): Define. + * config/mips/mips.c (mips16_insn_length): Remove reference to + JUMP_TABLES_IN_TEXT_SECTION. + +2005-04-13 Fariborz Jahanian + + * simplify-rtx.c (simplify_binary_operation_1): Return + scalar or vector of constant 0, depending on the xor's + mode. + +2005-04-13 Dale Johannesen + + * objc/Make-lang.in (objc-lang.o): Depend on tree-gimple.h. + (objc-act.o): Ditto. + * objc/objc-act.c (objc_gimplify_expr): New. + (objc_get_callee_fndecl): New. + * objc/objc-act.h: Include tree-gimple.h. Declare new functions. + * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Define. + (LANG_HOOKS_GET_CALLEE_FNDECL): Define. + +2005-04-13 Devang Patel + + * tree-if-conv.c (tree_if_convert_cond_expr): Do not create extra + temp variables. + +2005-04-13 Hans-Peter Nilsson + + CRIS prologue as RTL. + * config/cris/cris-protos.h (cris_emit_movem_store) + (cris_expand_prologue): Prototype. + * config/cris/cris.c (struct machine_function): New member + stdarg_regs. + (cfa_label_num, cris_target_asm_function_prologue): Remove. + (TARGET_ASM_FUNCTION_PROLOGUE): Don't override. + (cris_general_operand_or_gotless_symbol): Accept CRIS_UNSPEC_GOT. + (cris_load_multiple_op, cris_return_address_on_stack) + (cris_return_address_on_stack_for_return): ISO-Cify. + (cris_store_multiple_op): New predicate function. + (cris_expand_prologue, cris_emit_movem_store): New functions. + (cris_print_operand) : Handle modifications other than + post-increment. + (cris_symbol, cris_got_symbol): Return 0 for CRIS_UNSPEC_GOT. + (cris_gotless_symbol): Return 1 for CRIS_UNSPEC_GOT. + (cris_gen_movem_load): Rearrange slightly to make local variable + src a parameter, removing osrc. + (cris_setup_incoming_varargs): Set machine_function member + stdarg_regs to correspond to the number of registers that need to + be saved. + * config/cris/cris.h (EXTRA_CONSTRAINT_S): Accept + CRIS_UNSPEC_GOT. + (PREDICATE_CODES): Add cris_store_multiple_op. Make + cris_general_operand_or_gotless_symbol accept UNSPEC. + * config/cris/cris.md (CRIS_UNSPEC_GOT): New constant. + ("*movsi_internal") : Handle CRIS_UNSPEC_GOT. + ("*cris_store_multiple"): New pattern. Tweak common comment above + this and "*cris_load_multiple". + ("prologue"): New define_expand. + + * config/cris/cris.md ("epilogue"): Conditionalize on + TARGET_PROLOGUE_EPILOGUE. + +2005-04-13 Steve Ellcey + + PR target/20924 + * config/ia64/ia64.md (divsf3_internal_lat): Generate frcpa with + fpsr 0 instead of fpsr 1. + (divsf3_internal_thr): Ditto. + (divdf3_internal_lat): Ditto. + (divdf3_internal_thr): Ditto. + (divxf3_internal_lat): Ditto. + (divxf3_internal_thr): Ditto. + +2005-04-13 Kazu Hirata + + PR tree-optimization/20913 + * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Fold COND_EXPR. + + PR tree-optimization/20702 + * tree-vrp.c (maybe_add_assert_expr): Recurse into + dominator children that haven't been walked into. + +2005-04-13 Julian Brown + + * config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK from + being used for symbols with vague linkage when HAVE_GAS_COMDAT_GROUP + is true. + +2005-04-13 Kazu Hirata + + * basic-block.h, tree-ssa-uncprop.c, varasm.c, + config/i386/sse.md: Fix comment typos. + + * genattrtab.c (NULL_ATTR): Remove. + * ifcvt.c (NULL_EDGE): Likewise. + + * rtl.h (RTX_EXPR_FIRST, RTX_EXPR_LAST): Remove. + + * rtl.h (NOTE_PREDICTION_ALG, NOTE_PREDICTION_FLAGS, + NOTE_PREDICT): Remove. + +2005-04-13 Eric Botcazou + + * configure.ac (gcc_AC_CHECK_DECLS): Add vsnprintf. + * configure: Regenerate. + * config.in: Likewise. + * system.h: Declare vsnprintf if not already declared. + +2005-04-13 Eric Botcazou + + * optc-gen.awk: Handle stand-alone Mask records. + * opth-gen.awk: Likewise. + * doc/options.texi (Option file format): Document them. + * config.gcc (sparc-*-netbsdelf*, sparc-*-linux*, sparc64-*-freebsd*, + sparc64-*-linux*, sparc64-*-netbsd*): Add long-double-switch.opt. + (sparc64-*-openbsd*, sparc64-*-elf*): Add little-endian.opt. + * config/sparc/sparc.h (MASK_FPU, MASK_UNALIGNED_DOUBLES, + MASK_V8, MASK_SPARCLITE, MASK_SPARCLET, MASK_V9, + MASK_DEPRECATED_V8_INSNS, MASK_IMPURE_TEXT, MASK_APP_REGS, + MASK_HARD_QUAD, MASK_LITTLE_ENDIAN, MASK_PTR64, MASK_64BIT, + MASK_STACK_BIAS, MASK_FPU_SET, MASK_VIS, MASK_V8PLUS, + MASK_FASTER_STRUCTS, MASK_LONG_DOUBLE_128): Delete. + (TARGET_FPU, TARGET_UNALIGNED_DOUBLES, TARGET_V8, TARGET_SPARCLITE, + TARGET_SPARCLET, TARGET_V9, TARGET_DEPRECATED_V8_INSNS, + TARGET_IMPURE_TEXT, TARGET_APP_REGS, MASK_HARD_QUAD, + TARGET_LITTLE_ENDIAN, TARGET_PTR64, TARGET_64BIT, MASK_STACK_BIAS, + TARGET_FPU_SET, TARGET_VIS, TARGET_V8PLUS, TARGET_FASTER_STRUCTS, + TARGET_LONG_DOUBLE_128): Likewise. + (TARGET_SWITCHES, SUBTARGET_SWITCHES): Likewise. + (TARGET_OPTIONS, SUBTARGET_OPTIONS): Likewise. + * config/sparc/freebsd.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/linux.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/linux64.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/netbsd-elf.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/sp64-elf.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/sparc.c (fpu_option_set): New global. + (sparc_handle_option): New function. + (sparc_override_options): Test fpu_option_set. + (TARGET_DEFAULT_TARGET_FLAGS): Set to TARGET_DEFAULT. + (TARGET_HANDLE_OPTION): Set to sparc_handle_option. + * config/sparc/sparc.opt: New file. + * config/sparc/little-endian.opt: Likewise. + * config/sparc/long-double-switch.opt: Likewise. + +2005-04-13 Bernd Schmidt + + * config/bfin/bfin.c (bfin_lib_id_given): New static variable. + (bfin_handle_options): Set it if -mshared-library-id= is seen. + * config/bfin/bfin.opt (mshared-library-id=): Lose + Var(bfin_lib_id_given). + +2005-04-13 Matt Thomas + + * config/rs6000/sysv4.h (NO_IMPLICIT_EXTERN_C): undefine before + defining. + +2005-04-13 Kazu Hirata + + * rtl.h (CLEAR_RTX_FLAGS): Remove. + + * cgraphunit.c (INSNS_PER_CALL): Remove. + + * tree-ssa-forwprop.c (vars, + record_single_argument_cond_exprs, + substitute_single_use_vars): Remove. + (forward_propagate_into_cond_1, forward_propagate_into_cond): + New. + (tree_ssa_forward_propagate_single_use_vars): Call + forward_propagate_into_cond for each COND_EXPR. + + * tree-inline.c (INSNS_PER_STMT): Remove. + +2005-04-12 Richard Henderson + + * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): Split ... + (ix86_expand_sse_fp_minmax): ... from ... + (ix86_expand_fp_movcc): ... here. + (ix86_expand_sse_movcc): Rewrite from ix86_split_sse_movcc. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (UNSPEC_IEEE_MIN, UNSPEC_IEEE_MAX): New. + (sse_setccsf, sse_setccdf): Allow before reload. + (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): Remove. + (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): Remove. + (ieee_sminsf3, ieee_smaxsf3, ieee_smindf3, ieee_smaxdf3): New. + * config/i386/sse.md (andsf3, nandsf3, iorsf3, xorsf3): New. + (anddf3, nanddf3, iordf3, xordf3): New. + +2005-04-12 Jeff Law + + * Makefile.in (OBJS-common): Add tree-ssa-uncprop.o. + (tree-ssa-uncprop.o): Add dependencies. + * tree-cfg.c (remove_useless_stmts_bb, remove_useless_stmts): Remove. + * tree-flow.h (remove_useless_stmts): Remove prototype. + * tree-outof-ssa.c (rewrite_out_of_ssa): Remove call to + remove_useless_stmts. + * timevar.def (TV_TREE_SSA_UNCPROP): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Add uncprop pass. + * tree-pass.h (pass_uncprop): Declare. + * tree-ssa-uncprop.c: New file. + +2005-04-12 James E. Wilson + + PR target/20670 + * unwind-ia64.c (uw_intall_context): Add missing load of r27. + +2005-04-12 Caroline Tice + + Temporary fix for partitioning problems. + * passes.c (rest_of_handle_final): Remove code that + frees unlikely_text_section_name, + * varasm.c (assemble_start_function): Test for partitioning + flag before writing out section labels. + (assemble_end_function): Test for partitioning flag before + writing out section labels. + +2005-04-12 Steven Bosscher + Stuart Hastings + Jan Hubicka + + * Makefile.in: Add function.h to BASIC_BLOCK_H. Remove all + references to gt-tree-cfg.h. + * basic-block.h (struct basic_block_def): Don't skip rbi + for garbage collection. + (struct reorder_block_def): Make GTY-able. + (struct control_flow_graph): New structure. + (n_edges, n_basic_blocks, last_basic_block, basic_block_info, + BASIC_BLOCK, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR): No longer vars, + but instead defines to the control_flow_graph for cfun. + (label_to_block_map): New define, points to the label map of + the control_flow_graph for cfun. + (n_edges_for_function, n_basic_blocks_for_function, + last_basic_block_for_function, basic_block_info_for_function, + EXIT_BLOCK_PTR_FOR_FUNCTION, ENTRY_BLOCK_PTR_FOR_FUNCTION, + basic_block_info_for_function, label_to_block_map_for_function): + Counterparts for the above, taking a struct function as an extra + argument. + (alloc_rbi_pool, free_rbi_pool): Remove prototypes. + * cfg.c: (n_edges, n_basic_blocks, last_basic_block, + basic_block_info, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Remove. + (alloc_rbi_pool, free_rbi_pool): Remove. + (initialize_bb_rbi): Use ggc_alloc_cleared instead of pool_alloc. + * cfglayout.c: (cfg_layout_initialize): Don't allocate the rbi pool + here... + (cfg_layout_finalize) ... and don't free it here. + * cfgrtl.c (cfg_layout_delete_block): Zero out rbi so it gets + garbage collected. + * flow.c (free_basic_block_vars): Set label_to_block_map and + n_edges to zero too. + * function.h (struct function): Add cfg field. + * function.c (allocate_struct_function): Allocate the cfg. + * tree-cfg.c (label_to_block_map): Remove. + (build_tree_cfg): Don't allocate the rbi pool here... + (delete_tree_cfg_annotations): ...and don't free it here. + Also don't nullify label_to_block_map for cfun. + +2005-04-12 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Revert my patch from April 9. + (fix_edges_for_rarely_executed_code): Revert my patch from April 9. + (reorder_basic_blocks): Revert my patch from April 9. + (insert_section_boundary_note): Revert my patch from April 9. + * dbxout.c (dbxout_function_end): Revert my patch from April 9. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): Revert my patch from April 9. + (COLD_END_LABEL): Revert my patch from April 9. + (cold_text_section_label): Revert my patch from April 9. + (cold_end_label): Revert my patch from April 9. + (dwarf2out_switch_text_section): Revert my patch from April 9. + (output_aranges): Revert my patch from April 9. + (output_ranges): Revert my patch from April 9. + (output_line_info): Revert my patch from April 9. + (add_location_or_const_value_attribute): Revert my patch from April 9. + (dwarf2out_var_location): Revert my patch from April 9. + (dwarf2out_init): Revert my patch from April 9. + (dwarf2out_finish): Revert my patch from April 9. + * function.h (struct function): Revert my patch from April 9. + * opts.c (decode_options): Revert my patch from April 9. + * output.h (unlikely_section_label, hot_section_label, + hot_section_end_label, cold_section_end_label, + unlikely_text_section_name): Revert my patch from April 9. + * passes.c (rest_of_handle_final): Revert my patch from April 9. + * varasm.c (unlikely_section_label, hot_section_label, + hot_section_end_label, cold_section_end_label, + unlikely_text_section_name): Revert my patch from April 9. + (initialize_cold_section_name): Revert my patch from April 9. + (unlikely_text_section): Revert my patch from April 9. + (in_unlikely_text_section): Revert my patch from April 9. + (named_section): Revert my patch from April 9. + (function_section): Revert my patch from April 9. + (current_function_section): Revert my patch from April 9. + (assemble_start_function): Revert my patch from April 9. + (assemble_end_function): Revert my patch from April 9. + (default_section_type_flags_1): Revert my patch from April 9. + +2005-04-12 Eric Botcazou + + * config/sparc/sparc.h (APPLY_RESULT_SIZE): Set to 24 in 64-bit mode. + * config/sparc/sparc.md (untyped_call): Save the registers manually. + + * config/sparc/sparc.c (legitimate_address_p): Use TARGET_ARCH32. + +2005-04-12 Ulrich Weigand + + PR middle-end/20917 + * config/s390/s390.md ("*set_tp"): Use SET in pattern. + ("set_tp_64", "set_tp_31"): Adapt expanded pattern. + +2004-04-12 Richard Henderson + + * config/i386/i386.md (UNSPEC_FIX, UNSPEC_MOVA, UNSPEC_SHUFFLE, + UNSPEC_PSHUFLW, UNSPEC_PSHUFHW, UNSPEC_ADDSUB, UNSPEC_HADD, + UNSPEC_HSUB, UNSPEC_MOVSHDUP, UNSPEC_MOVSLDUP, UNSPEC_MOVDDUP): Remove. + (UNSPEC_*, UNSPECV_*): Renumber. + +2005-04-12 Frank Ch. Eigler + + PR mudflap/19266 + From Richard Henderson : + * tree-mudflap.c (mf_build_check_statement_for): Correct block + splitting logic. + +2005-04-12 Dorit Naishlos + + * tree-cfg.c (tree_verify_flow_info): Use LABEL_EXPR_LABEL. + +2005-04-12 Bernd Schmidt + + * config/bfin/bfin.c (bfin_library_id_string): Remove. + (bfin_library_id): New variable. + (bfin_expand_prologue): Use bfin_library_id and bfin_lib_id_given + instead of bfin_library_id_string. + (bfin_handle_option): New function. + (override_options): Remove most code to deal with shared library IDs, + just check they aren't used without -mid-shared-library. + (TARGET_HANDLE_OPTION): Define. + * config/bfin/bfin.h (TARGET_OPTIONS): Delete macro. + * config/bfin/bfin.opt (mshared-library-id=): New. + +2005-04-12 Kazu Hirata + + * tree-vect-transform.c: Fix comment typos. + +2005-04-12 Mostafa Hagog + + * postreload-gcse.c (eliminate_partially_redundant_load): Don't + split critical edges when not possible/profitable. + +2005-04-12 Richard Sandiford + + * config/ns32k/ns32k.h (target_flags, MASK_32081, MASK_RTD) + (MASK_REGPARM, MASK_32532, MASK_32332, MASK_NO_SB, MASK_NO_BITFIELD) + (MASK_HIMEM, MASK_32381, MASK_MULT_ADD, MASK_SRC, MASK_IEEE_COMPARE) + (TARGET_32081, TARGET_32381, TARGET_MULT_ADD, TARGET_RTD) + (TARGET_REGPARM, TARGET_32532, TARGET_32332, TARGET_SB, TARGET_HIMEM) + (TARGET_BITFIELD, TARGET_IEEE_COMPARE, TARGET_SWITCHES): Delete. + (OVERRIDE_OPTIONS): Clear MASK_SB instead of setting MASK_NO_SB. + * config/ns32k/netbsd.h (TARGET_DEFAULT): Remove MASK_NO_SB and + MASK_NO_BITFIELD. + * config/ns32k/ns32k.c (ns32k_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + * config/ns32k/ns32k.opt: New file. + +2005-04-12 Richard Sandiford + + * config.gcc (m68k-*-linux*): Add m68k/ieee.opt to $extra_options. + * config/m68k/m68k.h (target_flags, MASK_68020, TARGET_68020) + (MASK_68030, TARGET_68030, MASK_68040, TARGET_68040, MASK_68040_ONLY) + (TARGET_68040_ONLY, MASK_68060, TARGET_68060, MASK_5200, TARGET_5200) + (MASK_CFV3, TARGET_CFV3, MASK_CFV4, TARGET_CFV4, MASK_528x) + (TARGET_528x, MASK_CF_HWDIV, TARGET_CF_HWDIV, MASK_68881, TARGET_68881) + (MASK_BITFIELD, TARGET_BITFIELD, MASK_SHORT, TARGET_SHORT) + (MASK_ALIGN_INT, TARGET_ALIGN_INT, MASK_PCREL, TARGET_PCREL) + (MASK_NO_STRICT_ALIGNMENT, TARGET_STRICT_ALIGNMENT, MASK_RTD) + (TARGET_RTD, MASK_SEP_DATA, TARGET_SEP_DATA, MASK_ID_SHARED_LIBRARY) + (TARGET_ID_SHARED_LIBRARY, MASK_ALL_CF_BITS, TARGET_SWITCHES) + (TARGET_OPTIONS, SUBTARGET_SWITCHES, SUBTARGET_OPTIONS): Delete. + (MASK_COLDFIRE): Formatting fixes. + (TARGET_COLDFIRE): Turn into a boolean value for consistency. + * config/m68k/linux.h (SUBTARGET_SWITCHES): Delete. + * config/m68k/m68k.c (m68k_library_id_string): Initialize to + "_current_shared_library_a5_offset_". + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (MASK_ALL_CPU_BITS): New macro. + (m68k_handle_option): New function. + (override_options): Remove handling of m68k_library_id_string. + * config/m68k/m68k.opt: New file. + * config/m68k/ieee.opt: New file. + +2005-04-11 Mark Mitchell + + * target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + (TARGET_CXX): Adjust accordingly. + * target.h (struct gcc_target): Remove epxort_class_data. Add + determine_class_data_visibility and class_data_always_comdat. + * doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.c (arm_cxx_export_class_data): Remove. + (arm_cxx_determine_class_data_visibility): New. + (arm_cxx_class_data_always_comdat): Likewise. + (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define. + * config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): + Define. + +2005-04-11 Devang Patel + + * tree-data-ref.c (build_classic_dist_vector, + compute_subscript_distance): Make externally visible. + * tree-data-ref.h (build_classic_dist_vector, + compute_subscript_distance): Same. + * tree-vect-analyze.c (vect_analyze_data_ref_dependence): + Check distance vector against vectorization factor. + (vect_analyze_loop): Determine vectorizaion factor before + analyzing data dependences. + * tree-vectorizer.c (loops_num): Make it externally visible and + rename ... + * tree-vectorizer.c (vect_loops_num): ... new name. + * tree-vectorizer.h (vect_loops_num): New. + +2005-04-11 Devang Patel + + * tree-vect-analyze.c (vect_analyze_operations): Check + vectorizable codition. + * tree-vect-transform.c (vect_is_simple_cond): New function. + (vectorizable_condition): New function. + (vect_transform_stmt): Handle condition_vec_info_type. + * tree-vectorizer.h (enum stmt_vec_info_type): Add + condition_vec_info_type. + (vectorizable_condition): New. + +2005-04-11 Geoffrey Keating + + * config/i386/i386.h (TARGET_FPMATH_DEFAULT): New. + * config/i386/darwin.h (TARGET_FPMATH_DEFAULT): New. + * config/i386/i386.c (override_options): Use TARGET_FPMATH_DEFAULT. + + * config/i386/darwin.h (ASM_SPEC): Use -arch i386 not -arch i686. + (SUBTARGET_EXTRA_SPECS): Always 'i386'. + + * dwarf2out.c (output_line_info): Don't try to dereference + a NULL current_function_decl. + + * config/t-slibgcc-darwin: Don't put shared libraries in + directories other than $(slibdir). + * config/rs6000/darwin.h: Find -m64 libgcc under the name the + OS uses for it. + +2005-04-11 Diego Novillo + + PR tree-optimization/20933 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Move + logic to reject aliases between read-only and writable + variables ... + (may_alias_p): ... here. + (get_tmt_for): Do not associate read-only tags to pointers + whose pointed-to type is not read-only. + * tree-ssa.c (verify_ssa): Check that memory stores have at + least one V_MAY_DEF or V_MUST_DEF. + +2005-04-11 Kaveh R. Ghazi + + PR/17092 + * configure.ac (gcc_UNLOCKED_FUNCS): New. + (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS. + * system.h (putchar, getc, getchar, clearerr, feof, fileno, + fflush, fgetc, fgets, ferror, fread): Redefine to the associated + _unlocked function. + (fwrite_unlocked): Fix prototype. + + * configure, config.in: Regenerate. + +2005-04-11 David Edelsohn + + * tree-ssa-loop-im.c: Include real.h. + (determine_invariantness_stmt): If real division divisor is + invariant and flag_unsafe_math_optimizations enabled, generate + invariant reciprocal for hoisting. + * Makefile.in (tree-ssa-loop-im.o): Add real.h dependency. + +2005-04-11 Daniel Berlin + + Fix PR tree-optimization/20926 + + * tree-ssa-alias.c (add_type_alias): Handle subvars. + +2005-04-11 Devang Patel + + * config/rs6000.c (rs6000_emit_vector_select): Fix vector select + operand ordering. + +2005-04-11 Andrew Pinski + + * fold-const.c (fold_binary_op_with_conditional_arg): + use fold_buildN instead of "fold (buildN" in some + non obvious places. + (fold_unary): Likewise. + (fold_binary): Likewise. + +2005-04-11 Daniel Berlin + + Fix PR tree-optimization/20612 + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Fix increment + handling + (perfect_nestify): preheaderbb is *not* part of loop of the + old destination. + +2005-04-11 Andrew Pinski + + * tree-ssa-alias.c (may_alias_p): If the variable + is a global variable and the pointer is parameter + and -fargument-noalias-global is used, then + the pointer cannot alias the variable. + +2005-04-11 James A. Morrison + + * config/sparc/sparc.c: Use gcc_assert and gcc_unreachable. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + +2005-04-11 Kazu Hirata + + * tree-vrp.c (maybe_add_assert_expr): Move a comment. + + * tree-vrp.c: Fix a comment typo. + +2005-04-11 Diego Novillo + + PR tree-optimization/20920 + * tree-pretty-print.c (dump_generic_node): Show '(ab)' if an + SSA_NAME flows through an abnormal edge. + * tree-vrp.c (infer_value_range): Ignore SSA names that flow + through abnormal edges. + (maybe_add_assert_expr): Likewise. + +2005-04-11 Richard Sandiford + + * config/s390/s390.h (s390_tune_string, s390_arch_string) + (s390_warn_framesize_string, s390_warn_dynamicstack_string) + (s390_stack_size_string, s390_stack_guard_string, target_flags) + (MASK_HARD_FLOAT, MASK_SMALL_EXEC, MASK_DEBUG_ARG, MASK_64BIT) + (MASK_ZARCH, MASK_MVCLE, MASK_TPF_PROFILING, MASK_NO_FUSED_MADD) + (MASK_BACKCHAIN, MASK_PACKED_STACK, TARGET_HARD_FLOAT) + (TARGET_SOFT_FLOAT, TARGET_SMALL_EXEC, TARGET_DEBUG_ARG) + (TARGET_64BIT, TARGET_ZARCH, TARGET_MVCLE, TARGET_TPF_PROFILING) + (TARGET_NO_FUSED_MADD, TARGET_FUSED_MADD, TARGET_BACKCHAIN) + (TARGET_PACKED_STACK, TARGET_SWITCHES, TARGET_OPTIONS): Delete. + * config/s390/s390.c (TARGET_DEFAULT_TARGET_FLAGS): Override default. + (TARGET_HANDLE_OPTION): Likewise. + (s390_tune): Initialize to PROCESSOR_max. + (s390_arch_string): Make static. + (s390_tune_string, s390_warn_framesize_string): Delete. + (s390_warn_dynamicstack_string, s390_stack_size_string): Delete. + (s390_stack_guard_string, s390_warn_dynamicstack_p): Delete. + (s390_handle_arch_option, s390_handle_option): New functions. + (override_options): Remove parsing of option strings. + * config/s390/s390.opt: New file. + +2005-04-11 Paolo Bonzini + + * tree-complex.c (expand_vector_operations): Call + update_stmt_if_modified. + +2005-04-11 Paolo Bonzini + + * tree-vect-analyze (vect_determine_vectorization_factor): + Do not use GET_MODE_NUNITS. + * tree-vect-transform.c (vect_get_vec_def_for_operand, + (vectorizable_load, vect_transform_loop): Likewise. + +2005-04-11 Uros Bizjak + + * builtins.def (BUILT_IN_LCEIL, BUILT_IN_LCEILF, BUILT_IN_LCEILL) + (BUILT_IN_LLCEIL, BUILT_IN_LLCEILF, BUILT_IN_LLCEILL): New. + * optabs.h (enum optab_index): Add new OTI_lceil. + (lceil_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize lceil_optab. + * genopinit.c (optabs): Implement lceil_optab using lceilsi2 + and lceildi2 patterns. + * builtins.c (expand_builtin_int_roundingfn): Handle + BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. + (fold_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L}. + (fold_builtin_1): Fold BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L} using fold_builtin_int_roundingfn. + (mathfn_built_in): Handle BUILT_IN LCEIL and BUILT_IN_LLCEIL. + (expand_builtin): Expand BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L} using expand_builtin_int_roundingfn. + * convert.c (convert_to_integer): Convert (long int)ceil{,f,l}, + into lceil built-in function and (long long int)ceil{,f,l} into + llceil built-in function. + * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LCEIL and + BUILT_IN_LLCEIL. + +2005-04-10 John David Anglin + + * pa/quadlib.c (_U_Qfneg): Toggle sign bit instead of subtracting from + zero. + +2005-04-10 Kazu Hirata + + * config/arm/arm.c: Fix a comment typo. + * doc/tree-ssa.texi: Fix a typo. + +2005-04-10 Steven Bosscher + + * cselib.c (clear_table): Rename to cselib_clear_table. + * cselib.h (cselib_clear_table): Add prototype. + * gcse.c (gcse_main): Make 'f' argument unused. + (alloc_gcse_mem): Do not walk the insn chain, walk the contents + of each basic block instead. + (compute_sets, compute_hash_table_work): Likewise. + (constprop_register): Change int 'alter_jumps' argument to bool. + (do_local_cprop): Likewise. + (local_cprop_pass): Likewise. Also walk basic blocks instead of + the insn chain. Explicitly clear the cselib tables after finishing + one basic block. Make sure there are no unterminated libcall blocks. + Update compute_sets call. + (cprop): Walk basic blocks instead of the insn chain. + (one_cprop_pass, compute_ld_motion_mems, compute_store_table): + Likewise. + (bypass_jumps): Update alloc_gcse_mem, compute_sets, and + one_cprop_pass calls. + +2005-04-10 Richard Sandiford + + * combine.c (combine_simplify_rtx): Remove a transformation that + relies on an invalid assumption about rtl sign-extension semantics. + +2005-04-10 Richard Sandiford + + * value-prof.c (tree_divmod_fixed_value_transform): Fix arguments + to build_int_cst_wide. + +2005-04-09 Alexandre Oliva + + PR target/20126 + * loop.c (loop_givs_rescan): If replacement of DEST_ADDR failed, + set the original address pseudo to the correct value before the + original insn, if possible, and leave the insn alone, otherwise + create a new pseudo, set it and replace it in the insn. + * recog.c (validate_change_maybe_volatile): New. + * recog.h (validate_change_maybe_volatile): Declare. + +2005-04-09 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Remove targetm.have_named_sections test. + (fix_edges_for_rarely_executed_code): Likewise. + (insert_section_boundary_note): Likewise. + (reorder_basic_blocks): Check partitioning flag before calling + verify_hot_cold_block_grouping. + * dbxout.c (dbxout_function_end): Get hot/cold section labels from + the function struct rather than global variables. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro. + (COLD_END_LABEL): Likewise + (cold_text_section_label): New static global variable. + (cold_end_label): Likewise. + (dwarf2out_switch_text_section): Get hot/cold section labels from + the function struct rather than global variables. + (output_aranges): Use cold_text_section_label and cold_end_label; + check partitioning flag before putting out delta. + (output_ranges): Remove incorrect code attempting to use + hot/cold labels. + (output_line_info): Get cold section label from function struct. + (add_location_or_const_value_attribute): Likewise. + (get_subprogram_die): Get hot/cold section labels from function struct. + (dwarf2out_var_location): Likewise. + (dwarf2out_init): Generate cold_text_section_label and cold_end_label; + write out cold_text_section_label if partition flag is set. + (dwarf2out_finish): Write out cold_end_label if partition flag is set; + * function.h (struct function): Add new fields to point to hot/cold + section labels: hot_section_label, cold_section_label, + hot_section_end_label and cold_section_end_label; also add new field + for cold text section name, unlikely_text_section_name. + * opts.c (decode_options): Turn off partitioning flag if + !targetm.have_named_sections. + * output.h (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_section_label): Remove. + (unlikely_text_section_name): Remove. + * passes.c (rest_of_handle_final): Remove code that frees + unlikely_text_section_name. + * varasm.c (unlikely_section_label): Remove. + (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_text_section_name): Remove. + (initialize_cold_section_name): Modify to call + targetm.strip_name_encoding; to store cold section name in current + function struct, if it exists; and to only use the decl_section_name + if flag_named_sections is true. + (unlikely_text_section): Modify to get section name out of current + function struct, if there is one; otherwise build it from + UNLIKELY_EXECUTED_TEXT_SECTION_NAME. + (in_unlikely_text_section): Likewise. + (named_section): Modify to get/put cold section name in current function + struct, if there is one. + (function_section): Change 'bool unlikely' to 'int reloc'; check + targetm.have_named_sections before calling named_section. + (current_function_section): Likewise. + (assemble_start_function): Modify to get/put unlikely_text_section_name + in current function struct; modify to get hot/cold section labels + from function struct; initialize labels using + ASM_GENERATE_INTERNAL_LABEL; + test partitioning flag before writing out hot section label. + (assemble_end_function): Test partitioning flag before writing out + hot/cold section labels. + (default_section_type_flags_1): Modify to use array instead of + char* for unlikely_text_section_name; set flags correctly for + cold text section if there is not a current function decl. + +2005-04-09 Jakub Jelinek + + * tree.h (enum tree_index): Add TI_VA_LIST_GPR_COUNTER_FIELD + and TI_VA_LIST_FPR_COUNTER_FIELD. + (va_list_gpr_counter_field, va_list_fpr_counter_field): Define. + * tree-pass.h (pass_stdarg): Add. + * tree-optimize.c (init_tree_optimization_passes): Add pass_stdarg. + * tree-stdarg.c: New file. + * tree-stdarg.h: New file. + * Makefile.in (OBJS-common): Add tree-stdarg.o. + (tree-stdarg.o): Add dependencies. + * function.h (struct function): Add va_list_gpr_size and + va_list_fpr_size fields. + * function.c (allocate_struct_function): Initialize them. + * target.h (struct gcc_target): Add stdarg_optimize_hook. + * target-def.h (TARGET_STDARG_OPTIMIZE_HOOK): Define. + (TARGET_INITIALIZER): Add it. + + * config/i386/i386.c (ix86_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (ix86_setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (ix86_va_start): Don't set up fields that won't be used. + + * config/rs6000/rs6000.c (rs6000_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (rs6000_va_start): Don't set up fields that won't be used. + + * config/alpha/alpha.c: Include tree-flow.h and tree-stdarg.h. + (alpha_build_builtin_va_list): Initialize va_list_gpr_counter_field. + (va_list_skip_additions, alpha_stdarg_optimize_hook): New functions. + (TARGET_STDARG_OPTIMIZE_HOOK): Define. + +2005-04-09 Jakub Jelinek + + PR target/20795 + * config/i386/i386.c (construct_container): Pass empty aligned + struct, union or class in memory. + +2005-04-09 Kazu Hirata + + * dominance.c, gthr-win32.h, reg-stack.c, tree-ssa-copy.c, + tree-ssa-operands.c, tree-ssa.c, tree-vrp.c, varasm.c, + config/alpha/alpha.c, config/arm/arm.c, config/m32r/m32r.h, + config/rs6000/predicates.md: Fix comment typos. + + * sched-int.h (haifa_insn_data): Remove blockage and units. + (INSN_UNIT, INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, + ENCODE_BLOCKAGE, UNIT_BLOCKED, BLOCKAGE_RANGE, + MIN_BLOCKAGE_COST, MAX_BLOCKAGE_COST): Remove. + +2005-04-09 Jan Hubicka + Steven Bosscher + + * cfglayout.c (copy_bbs): Rename n_edges to num_edges. + * cfgloop.c (get_loop_exit_edges): Likewise. + * cfgloopmanip.c (fix_irreducible_loops): Likewise. + (unloop): Likewise. + * loop-unroll.c (analyze_insns_in_loop): Likewise. + * tree-cfg.c (dump_cfg_status): Likewise. + +2005-04-09 David Edelsohn + + * config/rs6000/predicates.md (altivec_register_operand): Remove + redundant match_code test. + (gpc_reg_operand): Same. + (cc_reg_operand): Same. + (cc_reg_not_cr0_operand): Same. + +2005-04-09 Jan Hubicka + + Forgotten hunk from my last merge patch: + * final.c (output_addr_const): Do not call mark_referenced. + +2005-04-09 Andrew MacLeod + + * doc/tree-ssa.texi: Add immediate use documentation. + +2005-04-09 Richard Earnshaw + + * arm.c (FL_WBUF): Define. + (arm_tune_strongarm): Renamed from arm_is_strong. All uses changed. + (arm_is_6_or_7): Delete. + (arm_tune_wbuf): New. + (arm_override_options): Set arm_tune_wbuf. + * arm.h (arm_tune_strongarm): Renamed from arm_is_strong. + (arm_is_6_or_7): Delete declaration. + (arm_tune_wbuf): New declartion. + * arm.md (is_strongarm): Derive from arm_tune_strongarm. + (model_wbuf): Derive from arm_tune_wbuf. + * arm-cores.def (arm600, arm610, arm620, arm700, arm700i, arm710) + (arm720, arm710c, arm7100, arm7500, arm7500fe, arm710t, arm720t) + (arm740t): Mark CPUs as having a write buffer. + +2005-04-09 Uros Bizjak + + * config/i386/i386.md (*fp_jcc_7_387): Use 'const0_operand' instead + of 'const_double_operand' in operand 2 constraints. Update enable + condition. + +2005-04-09 Uros Bizjak + + * builtins.def (BUILT_IN_LFLOOR, BUILT_IN_LFLOORF, BUILT_IN_LFLOORL) + (BUILT_IN_LLFLOOR, BUILT_IN_LLFLOORF, BUILT_IN_LLFLOORL): New. + * optabs.h (enum optab_index): Add new OTI_lfloor. + (lfloor_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize lfloor_optab. + * genopinit.c (optabs): Implement lfloor_optab using lfloorsi2 + and lfloordi2 patterns. + * builtins.c (expand_builtin_int_roundingfn): New prototype. + (expand_builtin_int_roundingfn): New function. + (fold_builtin_int_roundingfn): New prototype. + (fold_builtin_int_roundingfn): New function, renamed from + fold_builtin_lround. + Handle BUILT_IN_LROUND{,F,L}, BUILT_IN_LLROUND{,F,L} and + BUILT_IN_LFLOOR{,F,L}, BUILT_IN_LLFLOOR{,F,L}. + (fold_builtin_1): Fold BUILT_IN_LFLOOR{,F,L} and + BUILT_IN_LLFLOOR{,F,L} using fold_builtin_int_roundingfn. + (mathfn_built_in): Handle BUILT_IN LFLOOR and BUILT_IN_LLFLOOR. + (expand_builtin): Expand BUILT_IN_LFLOOR{,F,L} and + BUILT_IN_LLFLOOR{,F,L} using expand_builtin_int_roundingfn. + * convert.c (convert_to_integer): Convert (long int)floor{,f,l}, + into lfloor built-in function and (long long int)floor{,f,l} into + llfloor built-in function. + * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LFLOOR and + BUILT_IN_LLFLOOR. + +2005-04-08 Ian Lance Taylor + + * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, + CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. + * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. + (DO_COND, DO_BODY): Likewise. + (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. + (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. + (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, + BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. + (build_continue_stmt, build_break_stmt): Don't declare. + (c_do_switch_warnings): Update declaration. + * c-gimplify.c (enum bc_t): Remove. + (struct c_gimplify_ctx, ctxp): Remove. + (push_context, pop_context): Remove static functions. + (c_genericize): Don't call push_context or pop_context. + (begin_bc_block, finish_bc_block): Remove static functions. + (build_bc_goto): Likewise. + (gimplify_c_loop): Likewise. + (gimplify_for_stmt, gimplify_while_stmt): Likewise. + (gimplify_do_stmt, gimplify_switch_stmt): Likewise. + (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, + DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. + * c-common.c (c_do_switch_warnings): Rename from + c_do_switch_warnings_1. + (c_do_switch_warnings) [old version]: Remove. + (c_do_switch_expr_warnings): Remove. + * c-typeck.c (c_finish_case): Call new c_do_switch_warnings + function instead of c_do_switch_expr_warnings. + * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, + CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. + +2005-04-08 Devang Patel + + * tree-if-conv.c (find_phi_replacement_condition): New parameter, loop. + While selecting replacement condition pay attention to loop header. + +2005-04-08 Diego Novillo + + Merge from tree-cleanup-branch: VRP, store CCP, store + copy-prop, incremental SSA updating of FUD chains and + newly exposed symbols. + + * Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h. + (OBJS-common): Add tree-vrp.o. + (tree-vrp.o): New rule. + * basic-block.h (nearest_common_dominator_for_set): Declare. + * common.opt (ftree-store-ccp): New flag. + (ftree-copy-prop): New flag. + (ftree-vrp): New flag. + (ftree-store-copy-prop): New flag. + * dominance.c (nearest_common_dominator_for_set): New. + * domwalk.c (walk_dominator_tree): Only traverse + statements in blocks marked in walk_data->interesting_blocks. + * domwalk.h (struct dom_walk_data): Add field interesting_blocks. + * fold-const.c (fold): Handle ASSERT_EXPR. + * opts.c (decode_options): Set flag_tree_copy_prop at -O1. + Set flag_tree_store_ccp, flag_tree_store_copy_prop and + flag_tree_vrp at -O2. + * timevar.def (TV_TREE_VRP): Define. + (TV_TREE_COPY_PROP): Define. + (TV_TREE_STORE_COPY_PROP): Define. + (TV_TREE_SSA_INCREMENTAL): Define. + (TV_TREE_STORE_CCP): Define. + * tree-cfg.c (tree_can_merge_blocks_p): Remove reference + to kill_redundant_phi_nodes from comment. + (verify_expr): Handle ASSERT_EXPR. + * tree-dfa.c (mark_new_vars_to_rename): Remove second + argument. Update all users. + (mark_call_clobbered_vars_to_rename): Remove. Update all + users. + * tree-flow-inline.h (unmodifiable_var_p): New. + * tree-flow.h (enum value_range_type): Declare. + (struct value_range_def): Declare. + (value_range): Declare. + (remove_all_phi_nodes_for): Remove. Update all users. + (find_phi_node_for): Declare. + (add_type_alias): Declare. + (count_uses_and_derefs): Declare. + (kill_redundant_phi_nodes): Remove. + (rewrite_into_ssa): Remove. + (rewrite_def_def_chains): Remove. + (update_ssa, register_new_name_mapping, create_new_def_for, + need_ssa_update_p, name_registered_for_update_p, + release_ssa_name_after_update_ssa, dump_repl_tbl, + debug_repl_tbl, dump_names_replaced_by, + debug_names_replaced_by, mark_sym_for_renaming, + mark_set_for_renaming, get_current_def, set_current_def, + get_value_range, dump_value_range, debug_value_range, + dump_all_value_ranges, debug_all_value_ranges, + expr_computes_nonzero, loop_depth_of_name, + unmodifiable_var_p): Declare. + * tree-gimple.c (is_gimple_formal_tmp_rhs): Handle + ASSERT_EXPR. + * tree-into-ssa.c (block_defs_stack): Update comment. + (old_ssa_names, new_ssa_names, old_virtual_ssa_names, + syms_to_rename, names_to_release, repl_tbl, + need_to_initialize_update_ssa_p, need_to_update_vops_p, + need_to_replace_names_p): New locals. + (NAME_SETS_GROWTH_FACTOR): Define. + (struct repl_map_d): Declare. + (struct mark_def_sites_global_data): Add field + interesting_blocks. + (enum rewrite_mode): Declare. + (REGISTER_DEFS_IN_THIS_STMT): Define. + (compute_global_livein): Use last_basic_block instead of + n_basic_blocks. + (set_def_block): Remove last argument. Update all callers. + (prepare_use_operand_for_rename): Remove. Update all callers. + (prepare_def_operand_for_rename): Remove. Update all callers. + (symbol_marked_for_renaming): New. + (is_old_name): New. + (is_new_name): New. + (repl_map_hash): New. + (repl_map_eq): New. + (repl_map_free): New. + (names_replaced_by): New. + (add_to_repl_tbl): New. + (add_new_name_mapping): New. + (mark_def_sites): Assume that all the operands in the + statement are in normal form. + (find_idf): Assert that the block in the stack is valid. + (get_default_def_for): New. + (insert_phi_nodes_for): Add new argument 'update_p'. + Add documentation. + If update_p is true, add a new mapping between the LHS of + each new PHI and the name that it replaces. + (insert_phi_nodes_1): Only call find_idf if needed. + (get_reaching_def): Call get_default_def_for. + (rewrite_operand): Remove. + (rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT + and REWRITE_THIS_STMT are false. + Assume that all the operands in the statement are in + normal form. + (rewrite_add_phi_arguments): Don't use PHI_REWRITTEN. + (rewrite_virtual_phi_arguments): Remove. + (invalidate_name_tags): Remove. + (register_new_update_single, register_new_update_set, + rewrite_update_init_block, replace_use, + rewrite_update_fini_block, rewrite_update_stmt, + rewrite_update_phi_arguments): New. + rewrite_blocks): Remove argument 'fix_virtual_phis'. + Add arguments 'entry', 'what' and 'blocks'. + Initialize the dominator walker according to 'what' and + 'blocks'. + Start the dominator walk at 'entry'. + (mark_def_site_blocks): Add argument 'interesting_blocks'. + Use it to configure the dominator walker. + (rewrite_into_ssa): Remove argument 'all'. + Make internal. + (rewrite_all_into_ssa): Remove. + (rewrite_def_def_chains): Remove. + (mark_def_interesting, mark_use_interesting, + prepare_phi_args_for_update, prepare_block_for_update, + prepare_def_site_for, prepare_def_sites, + dump_names_replaced_by, debug_names_replaced_by, + dump_repl_tbl, debug_repl_tbl, init_update_ssa, + delete_update_ssa, create_new_def_for, + register_new_name_mapping, mark_sym_for_renaming, + mark_set_for_renaming, need_ssa_update_p, + name_registered_for_update_p, ssa_names_to_replace, + release_ssa_name_after_update_ssa, + insert_updated_phi_nodes_for, update_ssa): New. + * tree-loop-linear.c (linear_transform_loops): Call + update_ssa instead of rewrite_into_ssa. + * tree-optimize.c (vars_to_rename): Remove. + Update all users. + (init_tree_optimization_passes): Replace + pass_redundant_phi with pass_copy_prop. + Add pass_vrp. + Replace pass_ccp with pass_store_ccp. + Add pass_store_copy_prop after pass_store_ccp. + (execute_todo): If the TODO_ flags don't include updating + the SSA form, assert that it does not need to be updated. + Call update_ssa instead of rewrite_into_ssa and + rewrite_def_def_chains. + If TODO_verify_loops is set, call verify_loop_closed_ssa. + (tree_rest_of_compilation): + * tree-pass.h (TODO_dump_func, TODO_ggc_collect, + TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts, + TODO_cleanup_cfg): Renumber. + (TODO_verify_loops, TODO_update_ssa, + TODO_update_ssa_no_phi, TODO_update_ssa_full_phi, + TODO_update_ssa_only_virtuals): Define. + (pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp): + Declare. + * tree-phinodes.c (make_phi_node): Update documentation. + (remove_all_phi_nodes_for): Remove. + (find_phi_node_for): New. + * tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR. + * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise. + (interpret_rhs_modify_expr): Likewise. + * tree-sra.c (decide_instantiations): Mark all symbols in + SRA_CANDIDATES for renaming. + (mark_all_v_defs_1): Rename from mark_all_v_defs. + (mark_all_v_defs): New function. Update all users to call it + with the whole list of scalarized statements, not just the + first one. + * tree-ssa-alias.c (count_ptr_derefs): Make extern. + (compute_flow_insensitive_aliasing): If the tag is + unmodifiable and the variable isn't or vice-versa, don't + make them alias of each other. + (setup_pointers_and_addressables): If the type tag for + VAR is about to change, mark the old one for renaming. + (add_type_alias): New. + * tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP. + (ccp_lattice_t): Rename from latticevalue. + (value): Remove. Update all users. + (const_val): New local variable. + (do_store_ccp): New local variable. + (dump_lattice_value): Handle UNINITIALIZED. + (debug_lattice_value): New. + (get_default_value): Re-write. + (set_lattice_value): Re-write. + (def_to_varying): Remove. Update all users. + (likely_value): Return VARYING for statements that make + stores when STORE_CCP is false. + Return VARYING for any statement other than MODIFY_EXPR, + COND_EXPR and SWITCH_EXPR. + (ccp_initialize): Re-write. + (replace_uses_in, replace_vuse_in, substitute_and_fold): + Move to tree-ssa-propagate.c. + (ccp_lattice_meet): Handle memory stores when + DO_STORE_CCP is true. + (ccp_visit_phi_node): Likewise. + (ccp_fold): Likewise. + (evaluate_stmt): Likewise. + (visit_assignment): Likewise. + (ccp_visit_stmt): Likewise. + (execute_ssa_ccp): Add argument 'store_ccp'. Copy it + into DO_STORE_CCP. + (do_ssa_ccp): New. + (pass_ccp): Use it. + (do_ssa_store_ccp): New. + (gate_store_ccp): New. + (pass_store_ccp): Declare. + * tree-ssa-copy.c: Include tree-ssa-propagate.h. + (may_propagate_copy): Reformat. + Don't abort if ORIG is a virtual and DEST isn't. + If NEW does not have alias information but DEST does, + copy it. + (copy_of, cached_last_copy_of, do_store_copy_prop, enum + copy_prop_kind, which_copy_prop): Declare. + (stmt_may_generate_copy, get_copy_of_val, + get_last_copy_of, set_copy_of_val, dump_copy_of, + copy_prop_visit_assignment, copy_prop_visit_cond_stmt, + copy_prop_visit_stmt, copy_prop_visit_phi_node, + init_copy_prop, fini_copy_prop, execute_copy_prop, + gate_copy_prop, do_copy_prop, gate_store_copy_prop, + store_copy_prop): New. + (pass_copy_prop, pass_store_copy_prop): Declare. + * tree-ssa-dom.c (struct opt_stats_d): Add fields + 'num_const_prop' and 'num_copy_prop'. + (cprop_operand): Update them. + (dump_dominator_optimization_stats): Dump them. + (tree_ssa_dominator_optimize): Call update_ssa instead of + rewrite_into_ssa. + (loop_depth_of_name): Declare extern. + (simplify_cond_and_lookup_avail_expr): Guard against NULL + values for LOW or HIGH. + (cprop_into_successor_phis): Only propagate if NEW != ORIG. + (record_equivalences_from_stmt): Call expr_computes_nonzero. + (cprop_operand): Only propagate if VAL != OP. + * tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed + statement for renaming. + * tree-ssa-loop-im.c (move_computations): Call update_ssa. + * tree-ssa-loop-ivopts.c (rewrite_address_base): Call + add_type_alias if necessary. + Call mark_new_vars_to_rename. + (tree_ssa_iv_optimize): If new symbols need to be renamed, + mark every statement updated, call update_ssa and + rewrite_into_loop_closed_ssa. + * tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB + from LIVEIN if VAR is a virtual. + * tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa. + * tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR. + (get_call_expr_operands): Reformat statement. + (add_stmt_operand): Don't create V_MAY_DEFs for read-only + symbols. + * tree-ssa-propagate.c (ssa_prop_init): Initialize + SSA_NAME_VALUE for every name. + (first_vdef, stmt_makes_single_load, stmt_makes_single_store, + get_value_loaded_by): New. + (replace_uses_in, replace_vuses_in, replace_phi_args_in, + substitute_and_fold): Move from tree-ssa-ccp.c. + * tree-ssa-propagate.h (struct prop_value_d, prop_value_t, + first_vdef, stmt_makes_single_load, stmt_makes_single_store, + get_value_loaded_by, replace_uses_in, substitute_and_fold): + Declare. + * tree-ssa.c (verify_use): Fix error message. + (propagate_into_addr, replace_immediate_uses, get_eq_name, + check_phi_redundancy, kill_redundant_phi_nodes, + pass_redundant_phi): Remove. Update all users. + * tree-vect-transform.c (vect_create_data_ref_ptr): Call + add_type_alias, if necessary. + * tree-vectorizer.h (struct _stmt_vect_info): Update + documentation for field 'memtag'. + * tree-vrp.c: New file. + * tree.def (ASSERT_EXPR): Define. + * tree.h (ASSERT_EXPR_VAR): Define. + (ASSERT_EXPR_COND): Define. + (SSA_NAME_VALUE_RANGE): Define. + (struct tree_ssa_name): Add field 'value_range'. + (PHI_REWRITTEN): Remove. + (struct tree_phi_node): Remove field 'rewritten'. + * doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop, + -ftree-store-copy-prop): Document. + * doc/tree-ssa.texi: Remove broken link to McCAT's compiler. + Document usage of update_ssa. + +2005-04-08 David Edelsohn + + PR target/20814 + * config/rs6000/predicates.md (altivec_register_operand): Accept + SUBREG. + (and64_operand): Do not limit CONST_INT to mask64_operand. + (and64_2_operand): Do not limit CONST_INT to mask64_1or2_operand. + (and_operand): Do not limit CONST_INT to mask_operand. + +2005-04-09 Hans-Peter Nilsson + + PR rtl-optimization/20466 + * flow.c (invalidate_mems_from_set): Handle a MEM by checking it + for overlap of the address of each list member. + (mark_set_1): Call invalidate_mems_from_set for MEMs too. + +2005-04-08 Mike Stump + + * config/darwin.c (indirect_data): Fix typo in strncmp logic. + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Use 5 nops, + instead of 4. + +2005-04-08 Kazu Hirata + + * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): Remove. + + * function.c (push_function_context_to): Don't set + contains_functions. + * function.h (function): Remove contains_functions. + (current_function_contains_functions): Remove. + + * function.h (function): Remove instrument_entry_exit. + (current_function_instrument_entry_exit): Remove. + + * function.h (nonlocal_labels): Remove. + + * tree.h (STRIP_MAIN_TYPE_NOPS): Remove. + + * genattrtab.c (attr_desc): Remove negative_ok and unsigned_p. + (check_attr_value, write_attr_get, write_expr_attr_cache, + find_attr, make_internal_attr): Don't reference negative_ok or + unsigned_p. + * genattrtab.h (ATTR_NEGATIVE_OK, ATTR_UNSIGNED, + ATTR_FUNC_UNITS, ATTR_BLOCKAGE): Remove. + (ATTR_STATIC): Adjust the value. + + * c-common.h (C_ARTIFICIAL_STRING_P): Remove. + +2005-04-08 Ulrich Weigand + + * config/s390/tpf.h (ASM_SPEC): Define. + +2005-04-08 Kazu Hirata + + * tree-flow.h: Remove the prototype for + redirect_immediate_uses. + (TDFA_USE_OPS, TDFA_USE_VOPS): Remove. + +2005-04-08 Richard Earnshaw + + * arm.c (arm_const_double_by_parts): New function. + * arm-protos.h (arm_const_double_by_parts): Add prototype. + * arm.md (define_split for 64-bit constants): Add another one. + +2005-04-08 Andrew MacLeod + + * tree-ssa-operands.c (correct_use_link): Remove linear scan. + +2005-04-08 Kaveh R. Ghazi + + * system.h: Revert last change. + +2005-04-08 Richard Sandiford + + * config/xtensa/xtensa.h (target_flags, MASK_NO_FUSED_MADD) + (MASK_CONST16, TARGET_NO_FUSED_MADD, TARGET_CONST16) + (TARGET_SWITCHES): Delete. + * config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Define. + * config/xtensa/xtensa.md (muladdsf3, mulsubsf3): Check + TARGET_FUSED_MADD instead of !TARGET_NO_FUSED_MADD. + * config/xtensa/xtensa.opt: New file. + +2005-04-08 Ben Elliston + + * config/fp-bit.c: Include L_mul_tf in #endif comment. + * config/fp-bit.h: Tidy comments. + +2005-04-07 Kaveh R. Ghazi + + * system.h: Poison PARAMS. + +2005-04-07 Richard Sandiford + + * config/vax/vax.h (target_flags, MASK_UNIX_ASM, MASK_VAXC_ALIGNMENT) + (MASK_G_FLOAT, TARGET_UNIX_ASM, TARGET_VAXC_ALIGNMENT, TARGET_G_FLOAT) + (TARGET_SWITCHES): Delete. + * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Override default. + * config/vax/vax.opt: New file. + +2005-04-07 Daniel Berlin + + * tree-ssa-dse.c (dse_optimize_stmt): Fix incorrect comment. + +2005-04-07 Ian Lance Taylor + + * config/iq2000/iq2000.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Don't + define. + * config/mips/mips.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Likewise. + * config/sparc/sparc.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): + Likewise. + +2005-04-07 Kazu Hirata + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Consider + all immediate uses in PHI nodes. + +2005-04-07 Richard Earnshaw + + * arm.c (arm_const_double_inline_cost): Handle any constant by + using gen_lowpart and gen_highpart_mode. + (note_invalid_constants): All constants in an RTX with a constraint + that permits memory are now pushed to the constant pool. + (output_move_double): Delete code to handle reg to reg and + constant to reg moves. + (const_double_needs_minipool, output_mov_immediate): Delete. + * arm.h (EXTRA_CONSTRAINT_STR_ARM): All 'D' variants now handle + CONST_INT and CONST_VECTOR. + * arm.md (ANY64): New mode macro. + (arm_movdi): Split reg-reg and const-reg moves. Simplify constraints. + (movdf_soft_insn): Split reg-reg and const-reg moves. + (split patterns for 64-bit constant and register moves): New. + * cirrus.md (cirrus_arm_movdi): Split reg-reg and const-reg moves. + (cirrus_movdf_hard_insn): Likewise. + * fpa.md (movdf_fpa): Likewise. + * iwmmxt.md (iwmmxt_arm_movdi): Likewise. + (movv8qi_internal, movv4hi_internal, movv2si_internal): Fix + constraints. + (movv2si_internal_2): Likewise. + * vfp.md (arm_movdi_vfp): Split reg-reg and const-reg moves. + (movdf_vfp): Likewise. + * arm-protos.h (output_mov_immediate): Delete prototype. + +2005-04-07 Joseph S. Myers + + PR target/20093 + * simplify-rtx.c (simplify_unary_operation_1): Check + SUBREG_PROMOTED_UNSIGNED_P (op) > 0 for zero-extension. + +2005-04-06 James E Wilson + + PR target/20717 + * cgraphunit.c (record_call_1, case FDESC_EXPR): Handle same as + ADDR_EXPR. + +2004-04-06 Richard Sandiford + + * coverage.h (GCOV_TYPE_NODE): Delete. + * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref) + (build_ctr_info_type): Use get_gcov_type () instead of GCOV_TYPE_NODE. + * tree-profile.c (tree_gen_edge_profiler, tree_gen_interval_profiler) + (tree_gen_pow2_profiler, tree_gen_one_value_profiler): Likewise. + * value-prof.c (tree_divmod_fixed_value_transform): Delete. + +2004-04-06 Richard Sandiford + + PR other/20792 + * Makefile.in (gcc.pot): Remove options.c dependency. + * optc-gen.awk: Don't quote help strings with N_(). + +2005-04-06 James A. Morrison + + * c-common.c (handle_malloc_atttribute): Only set DECL_IS_MALLOC if + the function returns a pointer type. + +2005-04-06 Daniel Berlin + + * params.def (PARAM_SALIAS_MAX_IMPLICIT_FIELDS): New + * params.h (SALIAS_MAX_IMPLICIT_FIELDS): New + * doc/invoke.texi: Documnet salias-max-implicit-fields. + * tree-ssa-alias.c (struct used_part): Add implicit_uses and + explicit_uses members. + (get_or_create_used_part_for): Initialize new fields. + (fieldoff_compare): New function. + (create_overlap_variables_for): Count number of fields, use + heuristic to determine whether to create subvars for vars with + only implicit uses. + Sort the field list by offset and avoid creating duplicate SFT's. + +2005-04-06 Richard Sandiford + + * c.opt (-F): Remove trailing whitespace from help string. + (-finput-charset): Use a tab to separate the switch name and help + string. + * common.opt (-fsched-stalled-insns, -fsched-stalled-insns-dep) + (-ftree-vectorizer-verbose): Likewise. + +2005-04-06 Kazu Hirata + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at + a PHI argument where a use occurs instead of all PHI arguments. + +2005-04-06 Joseph S. Myers + + * c-decl.c (finish_decl): Apply pending #pragma weak regardless of + scope. + +2005-04-06 Kazu Hirata + + * cse.c, tree-flow-inline.h, tree-flow.h, tree-ssa-operands.c, + tree-ssa-sink.c, tree.h, config/bfin/bfin.c, + config/bfin/bfin.h: Fix comment typos. + +2005-04-06 Ranjit Mathew + + * doc/install.texi: Update the URL for Jacks. + * doc/sourcebuild.texi: Likewise. + +2005-04-06 Eric Botcazou + + PR target/17245 + * config/sparc/sparc.c (legitimate_address_p): Remove 'imm2'. + Revert 2004-10-08 patch. Reject TFmode LO_SUM in 32-bit mode. + +2005-04-06 Kelley Cook + + * Makefile.in (LIBGCC2_CFLAGS): Revert -pipe change. + +2005-04-06 Richard Sandiford + + * config/v850/v850-protos.h (override_options): Delete. + * config/v850/v850.h (target_flags, MASK_GHS, MASK_LONG_CALLS, MASK_EP) + (MASK_PROLOG_FUNCTION, MASK_DEBUG, MASK_V850, MASK_V850E) + (MASK_SMALL_SLD, MASK_BIG_SWITCH, MASK_NO_APP_REGS, MASK_DISABLE_CALLT) + (MASK_STRICT_ALIGN, MASK_US_BIT_SET, MASK_US_MASK_SET, TARGET_GHS) + (TARGET_LONG_CALLS, TARGET_EP, TARGET_PROLOG_FUNCTION, TARGET_V850) + (TARGET_BIG_SWITCH, TARGET_DEBUG, TARGET_V850E, TARGET_US_BIT_SET) + (TARGET_SMALL_SLD, TARGET_DISABLE_CALLT, TARGET_NO_APP_REGS) + (TARGET_STRICT_ALIGN, TARGET_SWITCHES, TARGET_OPTIONS) + (OVERRIDE_OPTIONS): Delete. + (MASK_CPU): Redefine as MASK_V850 | MASK_V850E. + (small_memory_info): Remove the value field. + (CONDITIONAL_REGISTER_USAGE): Check !TARGET_APP_REGS rather than + TARGET_NO_APP_REGS. + * config/v850/v850.c (small_memory): Remove the value field. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (override_options): Delete. + (v850_handle_memory_option, v850_handle_option): New functions. + * config/v850/v850.opt: New file. + +2005-04-06 Geoffrey Keating + + * config.host: Add a section for generic hosts, and a subsection + for Darwin. Add a case for x86-darwin. Update ppc-darwin case. + * config/host-darwin.c: New, split out of config/rs6000/host-darwin.c. + * config/host-darwin.h: New. + * config/x-darwin: New. + * config/i386/host-i386-darwin.c: New. + * config/i386/x-darwin: New. + * config/rs6000/host-darwin.c: Include host-darwin.h. + (darwin_rs6000_gt_pch_get_address): Move to config/host-darwin.c. + (darwin_rs6000_gt_pch_use_address): Likewise. + * config/rs6000/x-darwin: Change name of .o built, update + dependencies for changes to rs6000/host-darwin.c. + +2005-04-06 Ralf Corsepius + + PR target/17824 + * config/c4x/c4x.h (ASM_PROG, LD_PROG): Remove. + +2005-04-06 Dorit Naishlos + + * tree-vect-analyze.c (vect_analyze_loop_form): Call + split_loop_exit_edge instead of loop_split_edge_with. + +2005-04-06 Paolo Bonzini + + * config/rs6000/altivec.md (UNSPEC_VSLW, UNSPEC_SUBS, + UNSPEC_SET_VSCR): New constants, used throughout. + (*andc3_v4sf): New. + (altivec_vspltisb, altivec_vsplitish, altivec_vsplitisw): + Replace with... + (altivec_vspltis): ... this pattern, using + a QImode const_int_operand for the immediate. + (abs2, absv4sf2, altivec_abss_): Rewrite as + define_expands. + +2005-04-06 Ralf Corsepius + + PR target/17822 + * config/avr/t-avr (AR_FOR_TARGET,RANLIB_FOR_TARGET): Remove. + +2005-04-06 Kelley Cook + + * Makefile.in (LIBGCC2_CFLAGS): Compile with -pipe. + +2005-04-06 Ben Elliston + + * gcc.c: Correct comment about DEFAULT_SWITCH_TAKES_ARG and + DEFAULT_WORD_SWITCH_TAKES_ARG which incorrectly reported these + macros as living in "this file" and not gcc.h. + +2005-04-06 Ben Elliston + + * doc/invoke.texi (Optimize Options): Mention -ftree-lrs, not + -ftree-live_range_split. Perhaps renamed at some point? + +2005-04-06 Zdenek Dvorak + + PR target/20625 + * tree-ssa-loop-ivopts.c (generic_type_for): New function. + (add_candidate_1): Use generic_type_for instead of unsigned_type_for. + +2005-04-06 Zdenek Dvorak + + * tree-flow.h (number_of_iterations_cond): Declaration removed. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Made static. + (number_of_iterations_special): New function. + (number_of_iterations_exit): Use number_of_iterations_special. + Use simplify_using_outer_evolutions only at -O3. + (number_of_iterations_cond, tree_simplify_using_condition, + simplify_using_initial_conditions, loop_niter_by_eval, + compare_trees, can_count_iv_in_wider_type_bound, + simplify_using_outer_evolutions): Use fold_build. + +2005-04-05 Thomas Fitzsimmons + + * doc/install.texi (Configuration): Document --with-java-home. + +2005-04-05 Richard Henderson + + PR target/20342 + PR target/20447 + * config/i386/i386.c (print_operand): Handle vector zeros. + (ix86_split_to_parts): Handle CONST_VECTOR. + (ix86_hard_regno_mode_ok): Allow MMX modes in general regs. + (ix86_modes_tieable_p): Use ix86_hard_regno_mode_ok to decide + what modes to tie for MMX and SSE registers. + * config/i386/i386.h (MMX_REG_MODE_P): Remove. + * config/i386/i386.md: Extend move 0 -> xor peephole to apply + to vector modes as well. + * config/i386/predicates.md (const0_operand): Handle VOIDmode + properly as an input mode. + +2005-04-05 Andrew MacLeod + + * tree-ssa-operands.c (verify_abort): Use %p for pointers. + +2005-04-05 Andrew MacLeod + + * tree-pretty-print.c (dump_generic_node): Use %p for pointer. + +2005-04-05 Jakub Jelinek + + * config/i386/i386.c (init_cumulative_args): For -m32 -mfpmath=sse + and local functions, set sse_nregs to 8 and float_in_sse. + (function_arg_advance, function_arg): If float_in_sse, pass + SFmode and DFmode arguments in SSE registers. + * config/i386/i386.h (CUMULATIVE_ARGS): Add float_in_sse field. + + * config/i386/i386.c (ix86_value_regno): Only optimize local functions + of -funit-at-a-time. + +2005-04-05 Paolo Bonzini + + * config/i386/i386-protos.h (ix86_function_value): Accept two + arguments, like the target macro. + * config/i386/i386.h (FUNCTION_VALUE): Pass both arguments. + * config/i386/i386.c (ix86_function_value): Accept the second + argument of the target macro. + (ix86_function_ok_for_sibcall): Pass a function pointer to + ix86_function_value. + (ix86_function_value, ix86_libcall_value) [!TARGET_64BIT]: Adjust + call to ix86_value_regno). + (ix86_value_regno): Add support for returning floating point values + in SSE registers. + +2005-04-05 Jakub Jelinek + + PR tree-optimization/20076 + * tree-inline.c (inline_forbidden_p_1): Prevent inlining functions + that call __builtin_return or __builtin_apply_args. + +2005-04-05 Andrew MacLeod + + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt. + Use immediate use iterator. + (stmt_is_bumper_for_loop): Use immediate use iterator. + * predict.c (strip_builtin_expect): Use update_stmt. + * tree-cfg.c (update_modified_stmts): New. Call update_stmt_if_modified + on all elements of a STATEMENT_LIST. + (bsi_insert_before, bsi_insert_after): Call update_modified_stmts. + (bsi_remove): Remove imm_use links and mark the stmt as modified. + (bsi_replace): Mark stmt as modified and the update it. + * tree-complex.c (update_complex_assignment): Call mark_stmt_modified. + (expand_complex_libcal): Call update_stmt. + (expand_complex_comparison): Call mark_stmt_modified. + (expand_complex_operations_1): Call update_stmt_if_modified. + (expand_vector_operations_1): Call mark_stmt_modified. + * tree-dfa.c (compute_immediate_uses, free_df_for_stmt, free_df, + compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt, + add_immediate_use, redirect_immediate_use, + redirect_immediate_uses, dump_immediate_uses, debug_immediate_uses, + dump_immediate_uses_for, debug_immediate_uses_for): Delete. + (mark_new_vars_to_rename): Call update_stmt. + * tree-dump.c (dump_option_value_in): Add "stmtaddr". + * tree-flow-inline.h (modify_stmt): Rename to mark_stmt_modified. + Ignore PHI nodes. + (unmodify_stmt): Delete. + (update_stmt): New. Force an update of a stmt. + (update_stmt_if_modified): update a stmt if it is out of date. + (get_stmt_operands): Verify stmt is NOT modified. + (stmt_modified_p): Update comment. + (delink_imm_use): Remove a use node from its immuse list. + (link_imm_use_to_list): Link a use node to a specific list. + (link_imm_use): Link a node to the correct list. + (set_ssa_use_from_ptr): Set a use node to a specific value, and insert + it in the correct list, if appropriate. + (link_imm_use_stmt): Link a use node, and set the stmt pointer. + (relink_imm_use): Link a use node in place of another node in a list. + (relink_imm_use_stmt): LInk a node in place of another node, and set + the stmt pointer. + (end_safe_imm_use_traverse): New. Terminate a safe immuse iterator. + (end_safe_imm_use_p): New. Check for the end of a safe immuse iterator. + (first_safe_imm_use): New. Initialize a safe immuse iterator. + (next_safe_imm_use): New. Proceed to next safe immuse iterator value. + (end_readonly_imm_use_p): New. Check for end of a fast immuse iterator. + (first_readonly_imm_use): New. Initialize a fast immuse iterator. + (next_readonly_imm_use): New. Get the next fast immuse iterator value. + (has_zero_uses): New. Return true if there are no uses of a var. + (has_single_use): New. Return true if there is only a single use of a + variable. + (single_imm_use): New. Return the simgle immediate use. + (num_imm_uses): New. Return the number of immediate uses. + (get_v_must_def_ops): Use is now a pointer. + (use_operand_p, get_v_may_def_op_ptr, get_vuse_op_ptr, + get_v_must_def_kill_ptr, get_phi_arg_def_ptr): Return the address of + the use node. + (get_immediate_uses, num_immediate_uses, immediate_use): Delete. + (delink_stmt_imm_use): Delink all immuses from a stmt. + (phi_arg_index_from_use): New. Return a phi arg index for a use. + * tree-flow.h (struct dataflow_d): Delete. + (immediate_use_iterator_d): New. Immediate use iterator struct. + (FOR_EACH_IMM_USE_FAST): New. Macro for read only immuse iteration. + (FOR_EACH_IMM_USE_SAFE): New. Macro for write-safe immuse iteration. + (BREAK_FROM_SAFE_IMM_USE): New. Macro for earlyu exit from write-safe + iteration. + (struct stmt_ann_d): Remove dataflow_t from struct. + * tree-if-conv.c (tree_if_conversion). Don't call free_df. + (if_convertible_phi_p): Use FAST immuse iterator. + (if_convertible_loop_p): Don't call compute_immediate_uses. + (replace_phi_with_cond_modify_expr): Call update_stmt. + * tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites): Call + update_stmt_if_modified. + (rewrite_all_into_ssa): Initialize ssa operands. + * tree-loop-linear.c (linear_transform_loops): Don't call free_df or + compute_immediate_uses. + * tree-optimize.c (execute_todo): Call verify_ssa whenever the + ssa_property is available. + (execute_one_pass): Change parameters passed to execute_todo. + * tree-outof-ssa.c (rewrite_trees): Don't call modify_stmt. + (remove_ssa_form): Call fini_ssa_operands. + (insert_backedge_copies): Delete call to modify_stmt. + * tree-phinodes.c (make_phi_node): Initialize use nodes. + (release_phi_node): Delink any use nodes before releasing. + (resize_phi_node): Relink any use nodes. + (remove_phi_arg_num): Delink the use node. + (remove_phi_node): Release the ssa_name AFTER releasing the phi node. + (remove_all_phi_nodes_for): Release phi node first. + * tree-pretty-print.c (dump_generic_node): Print stmt address. + * tree-sra.c (mark_all_v_defs): Call update_stmt_if_modified. + (scalarize_use, scalarize_copy): Call update_stmt. + * tree-ssa-alias.c (compute_may_aliases): Update all modified stmts. + (compute_points_to_and_addr_escape): Call mark_stmt_modified. + * tree-ssa-cpp.c (need_imm_uses_for): Delete. + (ccp_initialize): Remove call to compute_immediate_uses. + (substitute_and_fold, execute_fold_all_builtins): Call update_stmt. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Update all modified + stmts. + (simplify_cond_and_lookup_avail_expr): Call mark_stmt_modified. + (simplify_switch_and_lookup_avail_expr): Call mark_stmt_modified. + (eliminate_redundant_computations): Call mark_stmt_modified. + (cprop_operand): Call mark_stmt_modified. + (optimize_stmt): Call update_stmt_if_modified and mark_stmt_modified. + * tree-ssa-dse.c (fix_phi_uses, fix_stmt_v_may_defs): Delete. + (dse_optimize_stmt): Use new immuse interface. + (tree_ssa_dse): Remove calls to compute_immediate_uses and free_df. + * tree-ssa-forwprop.c (need_imm_uses_for): Delete. + (substitute_single_use_vars): Use new immuse interface. + (tree_ssa_forward_propagate_single_use_vars): Remove calls to free_df + and compute_immediate_uses. + * tree-ssa-loop-im.c (single_reachable_address): Use new immuse + interface. + (rewrite_mem_refs): Call update_stmt. + (determine_lsm): Remove call to compute_imm_uses and free_df. + * tree-ssa-loop-ivcanon.c (create_canonical_iv): Call update_stmt. + (try_unroll_loop_completely): Call update_stmt. + * tree-ssa-loop-ivopts.c (rewrite_address_base): Call update_stmt. + (rewrite_use_compare): Call update_stmt. + (compute_phi_arg_on_exit): Insert each stmt before trying to process. + (rewrite_use) : Call update_stmt. + * tree-ssa-loop-manip.c (verify_loop_closed_ssa): Add arg to call. + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Call + update_stmt. + * tree-ssa-operands.c (NULL_USE_OPERAND_P): Remove declaration. + (allocate_use_optype, allocate_vuse_optype): Adjust allocation size. + (free_uses, free_vuses, free_v_may_defs, free_v_must_defs): Delink + use nodes. + (initialize_vuse_operand): New. Initialize a vuse operand. + (initialize_v_may_def_operand): New. Initialize a maydef operand. + (initialize_v_must_def_operand): New. Initialize a mustdef operand. + (finalize_ssa_defs): Use stmt parameter. + (correct_use_link): Ensure a use node is in the correct list, and has + the correct stmt pointer. + (finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_vuses, + finalize_ssa_v_must_defs): Also initialize use nodes. + (finalize_ssa_stmt_operands): Pass extra stmt operands. + (build_ssa_operands): Seperate parsing from final operand construction. + (parse_ssa_operands): New. Parse entry point for operand building. + (swap_tree_operands): New. Swap 2 tree operands. + (update_stmt_operands): Ranamed from get_stmt_operands. Always builds + operands. + (get_expr_operands): Call swap_tree_operands when needed. + (copy_virtual_operands): Use initialize routines for virtual use ops. + (create_ssa_artficial_load_stmt): Add extra stmt parameter. + (verify_abort): New. Issue imm_use error. + (verify_imm_links): New Verify imm_use links for a var. + (dump_immediate_uses_for): New. Dump imm_uses for a var to file. + (dump_immediate_uses): New. Dump imm_uses for all vars to file. + (debug_immediate_uses): New. Dump imm_uses for all vars to stderr. + (debug_immediate_uses_for): New. Dump imm_uses for a var to stderr. + * tree-ssa-operands.h (struct use_operand_ptr): Delete. + (NULL_USE_OPERAND_P) Define. + (use_optype_d, v_def_use_operand_type, vuse_optype_d): Add immediate + use node. + (struct vuse_operand_type): New struct. + (SET_USE): Call set_ssa_use_from_ptr. + (USE_STMT): Define. + (PHI_ARG_INDEX_FROM_USE): Define. + * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Set the phi + argument via SET_USE, not PHI_ARG_DEF_TREE. + * tree-ssa-pre.c (eliminate): Call update_stmt. + * tree-ssa-propagate.c (cfg_blocks_get): Use imm_use iterators. Don't + call free_df. + * tree-ssa-sink.c (all_immediate_uses_same_place): Use imm_use iterator. + (nearest_common_dominator_of_uses): Use imm_use iterator. + (statement_sink_location): Use imm_use iterator and interface. + (execute_sink_code): Don't call compute_immediate_uses or free-df. + * tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Use + PHI_ARG_DEF, not PHI_ARG_DEF_TREE. + * tree-ssa.c (verify_use, verify_phi_args): Verify some imm_use info. + (verify_ssa): Ensure no stmt is marked modify after optimization pass + if new parameter is true. + (init_tree_ssa): Don't initialize operand cache here. + (delete_tree_ssa): Don't destroy operand cache here. + (propagate_into_addr): Pass in a use pointer, return true if anything + was changed. + (replace_immediate_uses): Use imm_use iterator, call update_stmt. + (check_phi_redundancy): Use imm_use iterator. + (kill_redundant_phi_nodes): Don't call compute_immediate_uses or + free_df. + * tree-ssanames.c (make_ssa_name): Initialize imm_use node. + (release_ssa_name): Delink node and all elements in its imm_use list. + * tree-tailcall.c (adjust_return_value): Call update_stmt. + * tree-vect-analyze.c (vect_stmt_relevant_p): Use imm_use iterator. + * tree-vectorizer.c (need_imm_uses_for): Delete. + (vectorize_loops): Dont call compute_immediate_uses or free_df. + * tree.h (struct ssa_imm_use_d): Define. + (SSA_NAME_IMM_USE_NODE): Define. + (struct tree_ssa_name): Add imm_use node. + (PHI_DF): Delete. + (PHI_ARG_IMM_USE_NODE): Define. + (struct phi_arg_d): Add imm_use node. + (struct tree_phi_node): Remove struct dataflow_d element. + (TDF_STMTADDR): Define. + +2005-04-05 Dale Johannesen + + * doc/invoke.texi (Optimization Options): Remove + duplicate -fcse-follow-jumps. Add -fweb. + (-ftree-lim): Fix spelling (-ftree-loop-im, invariants). + (-fivcanon): Fix spelling (-ftree-loop-ivcanon). + +2005-04-05 Per Bothner + + * tree-ssa.c (execute_early_warn_uninitialized): Pass context node + to talk_tree as 'data' parameter, rather than EXPR_LOCUS. + (warn_uninit): Get EXPR_LOCUS from context now instead. + This fixes a USE_MAPPED_LOCATION testsuite failure. + + * tree-ssa.c (warn_uninitialized_var): Remove useless local. + +2005-04-05 Per Bothner + + * c-decl.c (finish_function): If USE_MAPPED_LOCATION set the location + of the artification 'return 0' in main() to BUILTINS_LOCATION. + * tree-cfg.c (remove_bb): Check that location isn't BUILTINS_LOCATION + before warning. + +2004-04-05 Devang Patel + + * config/rs600/altivec.md (altivec_vsr): Rename to .. + (lhsr3): ... new name. + (altivec_vsra): Rename to .. + (ashr3): ... new name. + * config/rs6000/rs6000.c (builtin_description): Rename shift + operations. + +2004-04-05 Paolo Bonzini + + * combine.c (RTL_HOOKS_GEN_LOWPART_NO_EMIT): Use + gen_lowpart_for_combine. + * cse.c (gen_lowpart_if_possible): Move... + * rtlhooks.c (gen_lowpart_if_possible): ... here. Also try + gen_lowpart_SUBREG. + (gen_lowpart_no_emit_general): Use it. + +2005-04-05 Eric Botcazou + + * config/sparc/sparc.c (TARGET_ASM_FILE_END): Undefine before + overriding. + +2005-04-05 Paolo Bonzini + + * system.h: Fix typo. + +2005-04-05 Bernd Schmidt + + * config/bfin/bfin-modes.def: New file. + * config/bfin/bfin-protos.h: New file. + * config/bfin/bfin.c: New file. + * config/bfin/bfin.h: New file. + * config/bfin/bfin.md: New file. + * config/bfin/bfin.opt: New file. + * config/bfin/crti.s: New file. + * config/bfin/crtn.s: New file. + * config/bfin/elf.h: New file. + * config/bfin/lib1funcs.asm: New file. + * config/bfin/predicates.md: New file. + * config/bfin/t-bfin: New file. + * config/bfin/t-bfin-elf: New file. + * doc/extend.texi (exception_handler, kspisusp, nesting, nmi_handler): + Document new attributes. + (interrupt, interrupt_handler, saveall): Update documentation for + these attributes. + * doc/install.texi (Specific): Add entry for the Blackfin. + * doc/invoke.texi (Blackfin Options): New section. + * doc/md.texi (Blackfin family): New section to document constraints. + * config.gcc: Add bfin*-* and bfin*-elf configurations. + +2005-04-05 Olivier Hainque + + * config/mips/iris6.h (DWARF_FRAME_RETURN_COLUMN): Redefine to + match what the system unwinder expects. + * config/mips/mips.c (mips_frame_set): If we're saving the return + address register and the dwarf return address column number differs + from the hard register number, adjust the note reg to refer to the + former. + +2004-04-05 Richard Sandiford + + * config/mn10300/mn10300-protos.h (mn10300_override_options): Declare. + * config/mn10300/mn10300.h (target_flags, TARGET_MULT_BUG) + (TARGET_SWITCHES, TARGET_DEFAULT): Delete. + (processor_type): New enum. + (mn10300_processor): New variable. + (TARGET_AM33, TARGET_AM33_2): Redefine in terms of mn10300_processor. + (PROCESSOR_DEFAULT, OVERRIDE_OPTIONS): New macros. + * config/mn10300/linux.h (TARGET_SWITCHES, TARGET_DEFAULT): Delete. + (PROCESSOR_DEFAULT): New macro. + * config/mn10300/mn10300.c (mn10300_processor): New variable. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (mn10300_handle_option, mn10300_override_options): New functions. + * config/mn10300/mn10300.opt: New file. + +2005-04-05 Eric Botcazou + Sebastian Pop + + PR tree-optimization/19903 + * tree-chrec.c (chrec_convert): Return chrec_dont_know for constants + that don't fit in their type after conversion. + +2005-04-05 Uros Bizjak + + PR target/20421 + * config/i386/i386.md (frndintxf2_floor, frndintxf2_ceil) + (frndintxf2_trunc, frndintxf2_mask_pm): Add FLAGS_REG clobber. + Allocate local stack slots here. Set ix86_optimize_mode_switching. + flag here. Implement using define_insn_and_split. + (frndintxf2_floor_i387, frndintxf2_ceil_i387, frndintxf2_trunc_i387) + (frndintxf2_mask_pm_i387): New insn patterns. + (floorsf2, floordf2, floorxf2): Remove local stack slot allocations. + Do not set ix86_optimize_mode_switching flag. + (ceilsf2, ceildf2, ceilxf2): Same. + (btruncsf2, btruncdf2, btruncxf2): Same. + (nearbyintsf2, nearbyintdf2, nearbyintxf2): Same. + +2005-04-05 Ian Lance Taylor + + PR debug/9963 + * config/i386/cygming.h (ASM_OUTPUT_EXTERNAL): Pass DECL to + i386_pe_record_external_function. + (i386_pe_record_external_function): Update declaration. + * config/i386/winnt.c (struct extern_list): Add decl field. + (i386_pe_record_external_function): Add decl parameter. + (i386_pe_file_end): Check TREE_ASM_WRITTEN on decl, not + identifier. + * config/i386/i386-protos.h (i386_pe_record_external_function): + Update declaration. + +2005-04-05 Kazu Hirata + + * config/m68k/m68k-protos.h: Add a prototype for + valid_dbcc_comparison_p_2. + * config/m68k/m68k.c (not_sp_operand, symbolic_operand, + extend_operator, const_uint32_operand, const_sint32_operand, + general_src_operand, nonimmediate_src_operand, + memory_src_operand, post_inc_operand, pre_dec_operand, + pcrel_address): Move to predicates to predicates.md. + * config/m68k/m68k.h (PREDICATE_CODES): Remove. + * config/m68k/m68k.md: Include predicates.md. + * config/m68k/predicates.md: New. + +2005-04-04 Roger Sayle + + * config/i386/i386.md (*truncdfsf2_i387_1): New pattern. + + * fold-const.c (maybe_lvalue_p): Delete orphaned comment. + +2005-04-04 Ian Lance Taylor + + * c-typeck.c (struct c_switch): Rename switch_stmt field to + switch_expr. + (c_start_case): Build SWITCH_EXPR, not SWITCH_STMT. + (do_case): Use SWITCH_COND rather than SWITCH_STMT_COND. + (c_finish_case): Use SWITCH_BODY rather than SWITCH_STMT_BODY. + Call c_do_switch_expr_warnings rather than c_do_switch_warnings. + * c-common.c (c_do_switch_warnings_1): New static function broken + out of c_do_switch_warnings. + (c_do_switch_warnings): Call c_do_switch_warnings_1. + (c_do_switch_expr_warnings): New function. + * c-common.h (c_do_switch_expr_warnings): Declare. + +2005-04-04 David Edelsohn + Daniel Jacobowitz + + * tree-eh.c (tree_could_trap_p): Allow non-constant floating point + trapping divide. + * rtlanal.c (may_trap_p): Same. + +2005-04-04 Dale Johannesen + + * ChangeLog: remove reference to ChangeLog.12. + +2005-04-05 Hans-Peter Nilsson + + CRIS epilogue as RTL. + * config/cris/cris.md: Change all 0 in unspec 0 to + CRIS_UNSPEC_PLT. + (CRIS_UNSPEC_PLT, CRIS_UNSPEC_FRAME_DEALLOC): New constants. + ("*cris_load_multiple", "cris_frame_deallocated_barrier"): New + patterns. + ("return"): Change to define_expand. Call cris_expand_return for + actual expansion. + ("*return_expanded"): New pattern. + ("epilogue"): New define_expand. + * config/cris/cris.h (PREDICATE_CODES): Add + cris_load_multiple_op. + * config/cris/cris.c (ASSERT_PLT_UNSPEC): Correct test for unspec + type. + (enum cris_retinsn_type): New. + (struct machine_function): New member return_type. + (TARGET_ASM_FUNCTION_EPILOGUE): Don't override. + (cris_target_asm_function_epilogue): Remove, moving RTLified + contents to... + (cris_expand_epilogue): New function. + (cris_reg_saved_in_regsave_area, cris_movem_load_rest_p, + (cris_gen_movem_load, cris_load_multiple_op) + (cris_return_address_on_stack_for_return, cris_expand_return): New + functions. + (cris_target_asm_function_prologue) + (cris_initial_frame_pointer_offset): Call + cris_reg_saved_in_regsave_area instead of complicated expression. + Call cris_return_address_on_stack instead of an expression. + (cris_print_operand) : New cases. + (cris_return_address_on_stack): Change return-type to bool. + (cris_simple_epilogue): Ditto. Return false if registers are + saved. + * config/cris/cris-protos.h (cris_simple_epilogue) + (cris_return_address_on_stack): Adjust prototype return type. + (cris_gen_movem_load, cris_expand_epilogue, cris_expand_return) + (cris_return_address_on_stack_for_return): New prototypes. + +2005-04-04 Kazu Hirata + + * config/frv/frv.h (PREDICATE_CODES): Add CONST to + gpr_or_int12_operand. + + * config/frv/frv-protos.h: Add a prototype to + frv_legitimate_memory_operand and frv_const_unspec_p. + (frv_unspec): Move from frv.c. + * config/frv/frv.c (frv_unspec): Move to frv-protos.h. + (frv_const_unspec_p, frv_legitimate_memory_operand_): Export. + (ldd_address_operand, fdpic_fptr_operand, frv_load_operand, + gpr_or_fpr_operand, gpr_or_int12_operand, + gpr_fpr_or_int12_operand, fpr_or_int6_operand, + gpr_or_int10_operand, gpr_or_int_operand, int12_operand, + int6_operand, int5_operand, uint5_operand, uint4_operand, + uint1_operand, int_2word_operand, uint16_operand, + upper_int16_operand, integer_register_operand, + gpr_no_subreg_operand, fpr_operand, even_reg_operand, + odd_reg_operand, even_gpr_operand, odd_gpr_operand, + quad_fpr_operand, even_fpr_operand, odd_fpr_operand, + dbl_memory_one_insn_operand, dbl_memory_two_insn_operand, + move_destination_operand, movcc_fp_destination_operand, + frv_function_symbol_referenced_p, move_source_operand, + condexec_dest_operand, condexec_source_operand, + reg_or_0_operand, lr_operand, fdpic_operand, got12_operand, + const_unspec_operand, gpr_or_memory_operand, + gpr_or_memory_operand_with_scratch, fpr_or_memory_operand, + icc_operand, fcc_operand, cc_operand, icr_operand, + fcr_operand, cr_operand, call_operand, sibcall_operand, + symbolic_operand, relational_operator, + integer_relational_operator, float_relational_operator, + ccr_eqne_operator, minmax_operator, + condexec_si_binary_operator, condexec_si_media_operator, + condexec_si_divide_operator, condexec_si_unary_operator, + condexec_sf_conv_operator, condexec_sf_add_operator, + condexec_memory_operand, intop_compare_operator, acc_operand, + even_acc_operand, quad_acc_operand, accg_operand: Move to + predicates.md. + * config/frv/frv.h (PREDICATE_CODES): Remove. + * config/frv/frv.md: Include predicates.md. + * config/frv/predicates.md: New. + +2004-04-04 Richard Sandiford + + PR target/19537 + * Makefile.in (tree-ssa-loop-ivopts.o): Depend on langhooks.h. + * tree-ssa-loop-ivopts.c: Include langhooks.h. + (add_standard_iv_candidates_for_size): New function, extracting code + from add_standard_iv_candidates and parameterizing it by type size. + (add_standard_iv_candidates): Use add_standard_iv_candidates_for_size. + +2004-04-04 Richard Sandiford + + * system.h (GCOV_SIZE_TYPE): Unposion. + * gcov-io.h (GCOV_TYPE_NODE): Delete, replacing with... + (GCOV_TYPE_SIZE): ...this new macro. + * coverage.h (get_gcov_type, GCOV_TYPE_NODE): Declare. + * coverage.c (get_gcov_type, get_gcov_unsigned_t): New functions. + (rtl_coverage_counter_ref): Use GCOV_TYPE_SIZE. + (build_fn_info_type, build_fn_info_value, build_ctr_info_type) + (build_ctr_info_value, build_gcov_info): Use get_gcov_unsigned_t + instead of unsigned_intSI_type_node. + * rtl-profile.c (rtl_gen_interval_profiler, rtl_gen_pow2_profiler) + (rtl_gen_one_value_profiler_no_edge_manipulation) + (rtl_gen_const_delta_profiler): Use GCOV_TYPE_SIZE. + * value-prof.c: Include coverage.h. + +2005-04-02 Daniel Berlin + Diego Novillo + + Fix PR tree-optimization/20703 + Fix PR tree-optimization/20725 + + * tree-ssa-pre.c (phi_translate): Handle tcc_comparison. + (create_expression_by_pieces): Ditto. + (valid_in_set): Ditto. Also handle tcc_declaration. + (find_or_generate_expression): Handle comparison class. + (insert_into_preds_of_block): Ditto. + (insert_aux): Ditto. + (create_value_expr_from): Handle comparison class, recursively + handle reference nodes. + (compute_avail): Handle comparison classes, rewrite a little cleaner. + (execute_pre): Fix spacing. + (do_fre): Renamed to execute_fre. + +2005-04-04 Eric Botcazou + + * doc/invoke.texi (SPARC options): Document that + -mlittle-endian is not supported on Linux either. + +2005-04-04 Eric Botcazou + + PR target/4198 + PR target/12027 + * config.gcc (Obsolete configurations): Remove + sparclite-*-coff*, sparclite-*-elf* and sparc86x-*-elf*. + (sparclite-*-coff*): Delete. + (sparclite-*-elf*): Likewise. + (sparc86x-*-elf*): Likewise. + (target_cpu_default) : Remove sparc86x. + * config/sparc/lite.h: Delete. + * config/sparc/litecoff.h: Likewise. + * config/sparc/liteelf.h: Likewise. + * config/sparc/sp86x-elf.h: Likewise. + * config/sparc/t-sparclite: Likewise. + * config/sparc/t-sp86x: Likewise. + +2005-04-04 Adrian Straetling + + * config/s390/s390-protos.h: (s390_comparison, + s390_alc_comparison, s390_slb_comparison, const0_operand, + consttable_operand, larl_operand, s_operand, + shift_count_operand, bras_sym_operand, load_multiple_operation, + store_multiple_operation, s390_plus_operand): Remove prototypes. + (s390_legitimate_address_without_index_p): New prototype. + * config/s390/s390.c: (SYMBOL_FLAG_ALIGN1, DISP_IN_RANGE): Move + to s390.h. + (s390_comparison, s390_alc_comparison, s390_slb_comparison, + const0_operand, consttable_operand, larl_operand, s_operand, + shift_count_operand, bras_sym_operand, load_multiple_operation, + store_multiple_operation, s390_plus_operand): Move to + predicates.md. + (check_mode): Remove. + (s390_branch_condition_mask): Remove 'static'. Move prototype to + s390-protos.h. + (s390_legitimate_address_without_index_p): New. + * config/s390/s390.h (PREDICATE_CODES): Remove. + * config/s390/s390.md: Include predicates.md. + * config/s390/predicates.md: New. + +2005-04-04 Eric Botcazou + + PR target/20446 + * config/sparc/sparc.h (NEED_INDICATE_EXEC_STACK): Define to 0. + * config/sparc/linux.h (TARGET_ASM_FILE_END): Delete. + (NEED_INDICATE_EXEC_STACK): Define to 1. + * config/sparc/linux64.h (TARGET_ASM_FILE_END): Delete. + (NEED_INDICATE_EXEC_STACK): Define to 1. + * config/sparc/sparc.c (TARGET_ASM_FILE_END): Set to sparc_file_end. + (add_pc_to_pic_symbol): Rename into pic_helper_symbol. + (add_pc_to_pic_symbol_name): Rename into pic_helper_symbol_name. + (pic_helper_emitted_p): New global. + (emit_pic_helper): New function extracted from... + (load_pic_register): ...here. Add 'delay_pic_helper' parameter. + Do not call emit_pic_helper if delay_pic_helper is true. + (sparc_expand_prologue): Pass 'false' to load_pic_register. + (sparc_output_mi_thunk): Pass 'true' to load_pic_register. + (sparc_file_end): New function. + +2005-04-04 Kazu Hirata + + * config/mcore/mcore-protos.h: Remove the prototypes for + mcore_arith_reg_operand, mcore_general_movsrc_operand, + mcore_general_movdst_operand, mcore_reload_operand, + mcore_arith_J_operand, mcore_arith_K_operand, + mcore_arith_K_operand_not_0, mcore_arith_M_operand, + mcore_arith_K_S_operand, mcore_arith_imm_operand, + mcore_arith_any_imm_operand, mcore_arith_O_operand, + mcore_literal_K_operand, mcore_addsub_operand, + mcore_compare_operand, mcore_load_multiple_operation, + mcore_store_multiple_operation, mcore_call_address_operand. + Add a prototype for const_ok_for_mcore. + * config/mcore/mcore.c (mcore_call_address_operand, + mcore_general_movsrc_operand, mcore_general_movdst_operand, + mcore_arith_reg_operand, mcore_reload_operand, + mcore_arith_J_operand, mcore_arith_K_operand, + mcore_arith_K_operand_not_0, mcore_arith_K_S_operand, + mcore_arith_M_operand, mcore_arith_imm_operand, + mcore_arith_any_imm_operand, mcore_arith_O_operand, + mcore_literal_K_operand, mcore_addsub_operand, + mcore_compare_operand, mcore_load_multiple_operation, + mcore_store_multiple_operation): Move to predicates.md. + (const_ok_for_mcore): Export. + * config/mcore/mcore.h (PREDICATE_CODES): Remove. + * config/mcore/mcore.md: Include predicates.md. + * config/mcore/predicates.md: New. + + * config/mcore/predicates.md: Fix a comment typo. + +2005-04-04 Andreas Krebbel + Adrian Straetling + + * config/s390/2064.md ("z_mul", "z_inf"): New insn reservations. + * config/s390/2084.md ("x_mul_hi", "x_mul_sidi", "x_div"): Likewise. + * config/s390/s390.md ("imulhi", "imulsi", "imuldi"): Added to "type" + attribute. + ("imul"): Removed from "type" attribute. + ("*muldi3_sign", "muldi3"): Changed type to imuldi. + ("mulsi3/1", "mulsi3/3", "mulsi/4", "mulsidi3", "umulsidi3"): + Changed type to imulsi. + ("*mulsi3_sign", "mulsi3/2"): Changed type to imulhi. + +2005-04-04 Richard Sandiford + + * config/mcore/mcore.h (target_flags, HARDLIT_BIT, ALIGN8_BIT, DIV_BIT) + (RELAX_IMM_BIT, W_FIELD_BIT, OVERALIGN_FUNC_BIT, CGDATA_BIT) + (SLOW_BYTES_BIT, LITTLE_END_BIT, M340_BIT, TARGET_HARDLIT) + (TARGET_DIV, TARGET_RELAX_IMM, TARGET_W_FIELD, TARGET_OVERALIGN_FUNC) + (TARGET_CG_DATA, TARGET_SLOW_BYTES, TARGET_LITTLE_END, TARGET_M340) + (TARGET_SWITCHES, mcore_stack_increment_string) + (TARGET_OPTIONS): Delete. + (TARGET_DEFAULT, OPTIMIZATION_OPTIONS): Use MASK_* constants rather + than *_BIT constants. + (TARGET_8ALIGN): #undef old definition before redefining to 1. + * config/mcore/mcore.c (mcore_stack_increment_string): Delete. + (TARGET_DEFAULT_TARGET_FLAGS): Override default to TARGET_DEFAULT. + (mcore_override_options): Delete mcore_stack_increment code. + Change use of M340_BIT to MASK_M340. + * config/mcore/mcore.opt: New file. + +2005-04-04 Ian Lance Taylor + + * config/arm/arm.c (replace_symbols_in_block): Remove static + function. + +2005-04-04 Kazu Hirata + + * config/fr30/fr30-protos.h: Remove the prototypes for + stack_add_operand, add_immediate_operand, + high_register_operand, low_register_operand, call_operand, + di_operand, and nonimmediate_di_operand. + * config/fr30/fr30.c (stack_add_operand, + add_immediate_operand, high_register_operand, + low_register_operand, call_operand, di_operand, + nonimmediate_di_operand): Move to predicates.md. + * config/fr30/fr30.h (PREDICATE_CODES): Remove. + * config/fr30/fr30.md: Include predicates.md. + * config/fr30/predicates.md: New. + + * config/mcore/mcore.h (PREDICATE_CODES): Add SYMBOL_REF and + LABEL_REF to mcore_general_movsrc_operand. Add SYMBOL_REF to + mcore_call_address_operand. + + * config/sh/sh.h (PREDICATE_CODES): Add CONST to + general_movsrc_operand. + +2005-04-04 Alan Modra + + * passes.c (rest_of_handle_final): NULL unlikely_text_section_name + after freeing. + +2005-04-04 Richard Earnshaw + + PR target/14812 + * arm.c (arm_select_cc_mode): Return CC_Zmode when comparing against + a negated value. + +2005-04-04 Richard Henderson + Jakub Jelinek + + PR rtl-optimization/16104 + * fold-const.c (fold_unary): Fix folding of vector conversions. + +2005-04-04 Richard Sandiford + + * config.gcc (xstormy16-*-elf): Set extra_options. + * config/stormy16/stormy16.h (target_flags, TARGET_SWITCHES): Delete. + * config/stormy16/stormy16.opt: New file. + +2005-04-04 Richard Sandiford + + * config/pdp11/pdp11.h (target_flags, TARGET_SWITCHES, TARGET_DEFAULT) + (TARGET_FPU, TARGET_SOFT_FLOAT, TARGET_AC0, TARGET_NO_AC0, TARGET_45) + (TARGET_BCOPY_BUILTIN, TARGET_INT16, TARGET_INT32, TARGET_FLOAT32) + (TARGET_FLOAT64, TARGET_ABSHI_BUILTIN, TARGET_BRANCH_EXPENSIVE) + (TARGET_BRANCH_CHEAP, TARGET_SPLIT, TARGET_NOSPLIT) + (TARGET_UNIX_ASM): Delete. + (TARGET_40_PLUS): Redefine in terms of TARGET_40 and TARGET_45. + * config/pdp11/2bsd.h (TARGET_UNIX_ASM_DEFAULT): Use MASK_UNIX_ASM. + * config/pdp11/pdp11.c (pdp11_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + * config/pdp11/pdp11.opt: New file. + +2005-04-03 Roger Sayle + Alexandre Oliva + + PR c++/19199 + * fold-const.c (non_lvalue): Split tests into... + (maybe_lvalue_p): New function. + (fold_cond_expr_with_comparison): Preserve lvalue-ness for the + C++ front-end prior to lowering into gimple form. + +2005-04-03 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_STPNCPY, BUILT_IN_STRCASECMP, + BUILT_IN_STRNCASECMP): New. + * doc/extend.texi: Document stpncpy, strcasecmp, strncasecmp + and strndup. + +2005-04-03 Richard Earnshaw + + PR target/14812 + * arm.md (addsi3_compare0_for_combiner): Delete. + (addsi3_compare0_scratch_for_combiner): Delete. + (cmpsi_neg_shiftsi): Delete. + (compare_negsi_si): New pattern. + (cmpsi_negshiftsi_si): New pattern. + (negated_cbranchsi4): Restrict to equality_operator. + + * arm.md (movhi_insn_arch4): delete trailing white space from assembler + template. + +2005-04-03 Kazu Hirata + + * cfghooks.c, cfgrtl.c, modulo-sched.c, config/i386/winnt.c: + Fix comment typos. + + * doc/install.texi: Fix a typo. + +2005-04-03 Steven Bosscher + + PR middle-end/20648 + * bb-reorder.c (duplicate_computed_gotos): Do not unfactor + a computed goto if the edge to the computed goto block has + incoming abnormal edges. Clarify how the function works. + +2005-04-03 Nathan Sidwell + + * params.c (set_param_value): Use gcc_assert & gcc_unreachable. + * passes.c (open_dump_file, rest_of_handle_final): Likewise. + * postreload-gcse.c (expr_equiv_p, oprs_unchanged_p, + hash_scan_set, reg_set_between_after_reload_p, + reg_used_between_after_reload_p, get_avail_load_store_reg, + eliminate_partially_redundant_load): Likewise. + * postreload.c (reload_cse_simplify_set, + reload_combine_note_use): Likewise. + * predict.c (predict_insn, expected_value_to_br_prob, + propagate_freq, expensive_function_p): Likewise. + * print-rtl.c (print_rtx): Likewise. + * profile.c (instrument_edges, instrument_values, + compute_branch_probabilities, branch_prob, union_groups, + tree_register_profile_hooks, rtl_register_profile_hooks): Likewise. + * protoize.c (in_system_include_dir, file_could_be_converted, + file_normally_convertible, gen_aux_info_file, seek_to_line, + do_cleaning): Likewise. + * tree-ssa-alias.c (collect_points_to_info_r): Likewise. + * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. + * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. + +2005-04-03 Mostafa Hagog + + * cfg.c (clear_bb_flags): Don't clear BB_DISABLE_SCHEDULE. + * modulo-sched.c (undo_replace_buff_elem): New structure. + (kernel_number_of_cycles, ps_unschedule_node, + undo_generate_reg_moves,free_undo_replace_buff, + undo_permute_partial_schedule, loop_single_full_bb_p, + SIMPLE_SMS_LOOP_P, loop_canon_p, canon_loop, + build_loops_structure, get_sched_window): New. + (generate_reg_moves): Return undo_replace_buff_elem and other + fixes. + (generate_prolog_epilog): Remove old loop versioning. + (sms_schedule): Use loop information and loop_version. + (sms_schedule_by_order): Split part of it to get_sched_window. + * passes.c (rest_of_handle_sms): call cfg_layout_initialize + cfg_layout_finalize and free_dominance_info before/after SMS. + +2005-04-03 Mostafa Hagog + + * cfghooks.c (lv_flush_pending_stmts, + cfg_hook_duplicate_loop_to_header_edge, extract_cond_bb_edges, + lv_adjust_loop_header_phi, lv_add_condition_to_bb): New. + * cfghooks.h (cfg_hook_duplicate_loop_to_header_edge, + lv_add_condition_to_bb, + lv_adjust_loop_header_phi, extract_cond_bb_edges, + flush_pending_stmts): New in cfg_hooks structure. + (cfg_hook_duplicate_loop_to_header_edge, lv_flush_pending_stmts, + extract_cond_bb_edges, lv_adjust_loop_header_phi, + lv_add_condition_to_bb): New declarations. + * cfgloop.h (duplicate_loop_to_header_edge): Change return type to + bool. + (loop_version): Declare. + * cfgloopmanip.c (cfghooks.h): Include. + (duplicate_loop_to_header_edge): Change return type to bool. + (loop_version, lv_adjust_loop_entry_edge): Move here. + * cfgrtl.c (cfgloop.h): Include. + (rtl_verify_flow_info_1): Fix. + (rtl_lv_add_condition_to_bb, rtl_extract_cond_bb_edges): New. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add hooks to + initialization. + * tree-cfg.c (tree_lv_adjust_loop_header_phi, + tree_lv_add_condition_to_bb): New. + (tree_cfg_hooks): Add new hooks to initialization. + * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi, + lv_adjust_loop_entry_edge, tree_ssa_loop_version): Remove. + +2005-04-03 Kazu Hirata + + * config/stormy16/stormy16.h (PREDICATE_CODES): Add SUBREG to + xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, and + nonimmediate_nonstack_operand. + + * config/stormy16/stormy16-protos.h: Remove the prototypes for + xstormy16_ineqsi_operator, equality_operator, + inequality_operator, shift_operator, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand. + * config/stormy16/stormy16.c (xstormy16_ineqsi_operator, + equality_operator, inequality_operator, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand, + nonimmediate_nonstack_operand, shift_operator): Move to + predicates.md. + * config/stormy16/stormy16.h (PREDICATE_CODES): Remove. + * config/stormy16/stormy16.md: Include predicates.md. + * config/stormy16/predicates.md: New. + +2005-04-02 Kazu Hirata + + * config/iq2000/iq2000.c (uns_arith_operand, arith_operand, + small_int, large_int, reg_or_0_operand, simple_memory_operand, + equality_op, cmp_op, pc_or_label_operand, call_insn_operand, + move_operand, power_of_2_operand): Move to predicates.md. + * config/iq2000/iq2000.h (SPECIAL_MODE_PREDICATES, + PREDICATE_CODE): Remove. + * config/iq2000/iq2000.md: Include predicates.md. + * config/iq2000/predicates.md: New. + +2005-04-02 Richard Sandiford + + * config/m68hc11/m68hc11.h (target_flags, MASK_SHORT) + (MASK_AUTO_INC_DEC, MASK_M6811, MASK_M6812, MASK_M68S12) + (MASK_NO_DIRECT_MODE, MASK_MIN_MAX, MASK_LONG_CALLS) + (TARGET_SHORT, TARGET_M6811, TARGET_M6812, TARGET_M68S12) + (TARGET_AUTO_INC_DEC, TARGET_MIN_MAX, TARGET_NO_DIRECT_MODE) + (TARGET_LONG_CALLS, TARGET_SWITCHES, TARGET_OPTIONS) + (SUBTARGET_SWITCHES, SUBTARGET_OPTIONS, m68hc11_regparm_string) + (m68hc11_reg_alloc_order, m68hc11_soft_reg_count) + (TARGET_M68HC11): Delete. + (TARGET_DEFAULT): Change the default setting from MASK_M6811 to 0. + * config/m68hc11/m68hc12.h (TARGET_M68HC12): Delete. + * config/m68hc11/m68hc11.c (m68hc11_regparm_string) + (m68hc11_reg_alloc_order, m68hc11_soft_reg_count) + (nb_soft_regs): Delete. + (TARGET_DEFAULT_TARGET_FLAGS): Override default with TARGET_DEFAULT. + (m68hc11_override_options): Remove the code that caters for MASK_M6811 + and MASK_M6812 being set simultaneously. Change the code that sets + the default m68hc11_soft_reg_count to use integers instead of strings. + (m68hc11_conditional_register_usage, hard_regno_mode_ok): Use + m68hc11_soft_reg_count (which now has an int type) as the number + of soft registers. + * config/m68hc11/m68hc11.opt: New file. + +2005-04-02 Kazu Hirata + + * config/fr30/fr30.h (PREDICATE_CODES): Remove + fp_displacement_operand, sp_displacement_operand. + + * config/m68hc11/m68hc11-protos.h: Add a prototype for + m68hcc_auto_inc_p. + Remove the prototypes for tst_operand, cmp_operand, + stack_register_operand, d_register_operand, + hard_addr_reg_operand, splitable_operand, + m68hc11_logical_operator, m68hc11_arith_operator, + m68hc11_non_shift_operator, m68hc11_shift_operator, + m68hc11_unary_operator, m68hc11_eq_compare_operator, + non_push_operand, hard_reg_operand, and + reg_or_some_mem_operand. + * config/m68hc11/m68hc11.c (m68hcc_auto_inc_p): Make it + extern. + (tst_operand, cmp_operand, non_push_operand, + splitable_operand, reg_or_some_mem_operand, + stack_register_operand, d_register_operand, + hard_addr_reg_operand, hard_reg_operand, + m68hc11_eq_compare_operator, m68hc11_logical_operator, + m68hc11_arith_operator, m68hc11_non_shift_operator, + m68hc11_shift_operator, m68hc11_unary_operator): Move to + predicates.md. + * config/m68hc11/m68hc11.h (PREDICATE_CODES): Remove. + * config/m68hc11/m68hc11.md: Include predicates.md. + * config/m68hc11/predicates.md: New. + +2005-04-02 Alexandre Oliva + + PR debug/19345 + * dwarf2out.c (add_abstract_origin_attribute): Revert accidental + change checked in along with 2005-03-03's patch for debug/20253. + * tree-inline.c (remap_type): Remap TYPE_STUB_DECL. + (remap_decl): Insert type decl in map earlier. + +2005-04-02 Alexandre Oliva + + PR tree-optimization/20640 + * tree-ssa-dce.c (remove_dead_stmt): Don't redirect edge to + post-dominator if it has phi nodes. + (eliminate_unnecessary_stmts): Remove dead phis in all blocks + before dead statements. + +2005-04-02 Alexandre Oliva + + PR middle-end/20491 + * final.c (alter_subreg): Don't call subreg_regno for a non-REG. + +2005-04-02 Alexandre Oliva + + PR rtl-optimization/20290 + * loop.c (for_each_insn_in_loop): Don't assume the loop body runs + in every iteration if the entry point is the exit test. + +2005-04-02 Hans-Peter Nilsson + + * config/cris/cris.md (attribute "length"): Define. + +2005-04-02 Geoffrey Keating + + * config/rs6000/predicates.md (indexed_or_indirect_operand): New. + (word_offset_memref_operand): New. + * config/rs6000/rs6000-protos.h (word_offset_memref_operand): Delete. + (indexed_or_indirect_operand): Delete. + * config/rs6000/rs6000.c (word_offset_memref_operand): Delete. + (indexed_or_indirect_operand): Delete. + + * config/rs6000/t-darwin8: Comment out ppc64 multilib. + + PR 20650 + * config/rs6000/rs6000.md (fix_truncdfsi2): Make destination + a register. + + * config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Add -pipe. + * config/t-darwin (TARGET_LIBGCC2_CFLAGS): Likewise. + +2005-04-01 Jan-Benedict Glaw + + * config/vax/vax.md: Spellcheck, fix whitespace. + +2005-04-01 Ian Lance Taylor + + * gcc.c: Don't include or declare getrusage. + (rus, prus): Remove static variables. + (execute): Use pex_run/pex_get_status rather than pexecute/pwait. + (process_command): Permit report_times and use_pipes together. + +2005-04-01 Joseph S. Myers + + * c-decl.c (validate_proto_after_old_defn): Look at + TYPE_MAIN_VARIANT of argument types. + +2005-04-01 Paul Brook + + * config/arm/arm.c (thumb_call_via_label): Include space for SP. + (arm_output_function_epilogue): Allow call_via_SP. + (thumb_call_via_reg, arm_file_end): Ditto. + * config/arm/arm.h (struct machine_function): Include space for SP. + (thumb_call_via_label): Update declaration. + +2005-04-01 Ian Lance Taylor + + * final.c (final_scan_insn): Revert part of 2005-03-30 patch: when + doing a peephole optimization, once again put any notes in the + proper position. + +2005-04-01 Kazu Hirata + + * bb-reorder.c, fold-const.c, varasm.c: Fix comment typos. + +2005-04-01 Nathan Sidwell + + * local-alloc.c (update_equiv_regs): Use gcc_assert, gcc_unreachable. + (block_alloc, find_free_reg): Likewise. + * loop-doloop.c (doloop_modify): Likewise. + * loop-invariant.c (record_use): Likewise. + * loop-iv.c (get_biv_step_1, get_biv_step, iv_analyze, + get_iv_value, canon_condition, eliminate_implied_condition, + eliminate_implied_condition, simplify_using_initial_values, + shorten_into_mode, canonicalize_iv_subregs, + iv_number_of_iterations): Likewise. + * loop-unroll.c (expand_var_during_unrolling): Likewise. + * loop-unswitch.c (compare_and_jump_seq, unswitch_single_loop, + unswitch_loop): Likewise. + * loop.c (INSN_LUID, loop_optimize, rtx_equal_for_loop_p, + move_movables, replace_call_address, find_and_verify_loops, + rtx_equal_for_prefetch_p, fold_rtx_mult_add, loop_iterations, + record_giv, final_giv_value, general_induction_var, + simplify_giv_expr, extension_within_bounds_p, try_copy_prop, + loop_giv_dump): Likewise. + + * gcov-io.h (GCOV_CHECK, GCOV_CHECK_READING, + GCOV_CHECK_WRITING): Remove. + (gcov_position, gcov_rewrite): Use gcc_assert. + * gcov-io.c (gcov_open, gcov_write_words, gcov_write_length, + gcov_read_words, gcov_sync, gcov_seek): Use gcc_assert. + * libgcov.c (__gcov_merge_single, __gcov_merge_delta): Use + gcc_assert. + +2005-04-01 Kazu Hirata + + * tree-inline.c: Fix a typo. + +2005-04-01 Nathan Sidwell + + * configure.ac (enable-checking): Explicitly set all variables for + collective switch values. Alphabetize variables. Rename + ac_checking_valgrind to ac_valgrind_checking. Allow 'none' as + synonym for 'no'. + * doc/install.texi (enable-checking): Update documentation. + * configure: Rebuilt. + +2005-04-01 Kazu Hirata + + * tree-inline.c (copy_body_r): Use CONSTANT_CLASS_P where + possible. + +2005-04-01 Richard Earnshaw + + * arm.c (adjacent_mem_locations): Reject volatile memory refs. + Also reject cases where this pattern will cause load delay stalls + unless optimizing for size and it will produce a shorter sequence. + * arm.md (arith_adjacent_mem): Make better use of ldm addressing + variants to avoid pre-adjusting the base when possible. + +2005-04-01 Richard Earnshaw + + * arm.md (minmax_arithsi): Reject all eliminable registers, not just + the frame and argument pointers. + (strqi_preinc, strqi_predec, loadqi_preinc, loadqi_predec): Likewise. + (loadqisi_preinc, loadqisi_predec, strsi_preinc): Likewise. + (strsi_predec, loadsi_preinc, loadsi_predec): Likewise. + (strqi_shiftpreinc, strqi_shiftpredec, loadqi_shiftpreinc): Likewise. + (loadqi_shiftpredec, strsi_shiftpreinc, strsi_shiftpredec): Likewise. + (loadsi_shiftpreinc, loadsi_shiftpredec): Likewise. + +2005-04-01 Danny Smith + + * config/i386/cygming.h (SUBTARGET_ATTRIBUTE_TABLE): Define, + with entry for selectany attribute. + * config/i386/i386-protos.h (ix86_handle_selectany_attribute): + Declare. + * config/i386/winnt.c (ix86_handle_selectany_attribute): Define. + (i386_pe_asm_named_section): Handle sections generated by + selectany attribute. + * doc/extend.texi (selectany): Document attribute. + +2005-04-01 Paolo Bonzini + Jan Hubicka + + * config/i386/i386.c (ix86_decompose_address): Look inside SUBREGs + to fix addresses involving EBP and ESP. + (aligned_operand, legitimate_address_p, ix86_address_cost): Be prepared + for SUBREGed registers. + (legitimate_address_p): Accept SUBREGed registers. + +2005-04-01 Jakub Jelinek + + PR c++/19406 + * dwarf2out.c (gen_type_die_for_member): Handle FIELD_DECL. + (dwarf2out_imported_module_or_decl): Use gen_type_die_for_member + for FIELD_DECLs. + +2005-04-01 Kazu Hirata + + * doc/contrib.texi, doc/invoke.texi, doc/tm.texi: Fix typos. + +2005-04-01 James E Wilson + + PR c++/20505 + * dwarf2out.c (rtl_for_decl_init): New function. + (rtl_for_decl_location): Extracted from here. + (tree_add_const_value_attribute): Call rtl_for_decl_init and + add_const_value_attribute. Delete initializer_constant_valid_p call. + +2005-04-01 Kazu Hirata + + * cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c, + lambda-code.c, loop.c, machmode.def, mips-tfile.c, + modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c, + tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h, + config/frv/frv.md, config/i386/i386.c, config/i386/i386.h, + config/i386/i386.md, config/rs6000/predicates.md, + config/rs6000/rs6000.c, config/s390/fixdfdi.h, + config/s390/s390.c, config/stormy16/stormy16.c, + config/stormy16/stormy16.md, config/vax/vax.md: Fix comment + typos. + +2005-04-01 Joseph S. Myers + + PR c/17855 + * gimplify.c (gimplify_expr): Create a temporary for lvalue + COND_EXPR and CALL_EXPR. + +2005-03-31 Vladimir Makarov + + PR target/20632 + * genautomata.c (first_cycle_unit_presence): Check all alternative + states for unit presence. + + * doc/md.texi: Remove remark about impossibility to query unit + presence in non nondeterministic automaton state. + + * config/ia64/ia64.c (get_template): Change order of unit querying. + +2005-03-31 Kazu Hirata + + * tree-ssa-dom.c (cprop_into_successor_phis): Remove an + obsolete comment. + +2005-03-31 Zdenek Dvorak + + * cfgloopanal.c (mark_loop_exit_edges): Clean EDGE_LOOP_EXIT + flag for edges outside any loops. + +2005-03-31 Janis Johnson + + * doc/sourcebuild.texi (Test Directives): Describe cleanup-* procs. + +2005-03-31 Kazu Hirata + + * tree-ssa-alias.c: Follow spelling conventions. + * doc/tree-ssa.texi: Fix a typo. + +2005-03-31 J"orn Rennecke + + * postreload-gcse.c: Include target.h. + (gcse_after_reload_main): Return early if we cannot modify jumps. + * Makefile.in (postreload-gcse.o): Depend on $(TARGET_H). + +2005-03-31 David Edelsohn + + * tree-ssa-loop-im.c (stmt_cost): Add RDIV_EXPR to list of + expensive operations. + +2005-03-31 Ian Lance Taylor + + * collect2.c (lderrout): New variable. + (collect_exit): Dump ldout to stdout. Dump and unlink lderrout, + if it is set, to stderr. + (handler): Unlink lderrout if it is set. + (dump_file): Add "to" parameter. Change all callers. + (main): Initialize lderrout. + (collect_execute): Add errname parameter. Change all callers. + Rename redir parameter to outname. Never pass + PEX_STDERR_TO_STDOUT to pex_run. + * collect2.h (collect_execute, dump_file): Update declarations. + * tlink.c (tlink_execute): Add errname parameter. Change all + callers. + (do_tlink): Check lderrout as well as ldout. + +2005-03-31 Caroline Tice + + * Makefile.in (varasm.o): Add basic-block.h to list of requirements. + (bb-reorder.o): Add errors.h to list of requirements. + (STAGEFEEDBACK_FLAGS_TO_PASS): Add -freorder-blocks-and-partition to + profiledbootstrap flags. + * bb-reorder.c (errors.h): Add new include. + (struct bbro_basic_block_data_def): Add new field, in_trace. + (add_unlikely_executed_notes): Remove function. + (mark_bb_for_unlikely_executed_section): Remove function. + (insert_section_boundary_note): New function. + (verify_hot_cold_block_grouping): New function. + (push_to_next_round_p): Remove variables and tests that push all + cold blocks to last round. + (find_traces): Remove code that added extra round of trace finding + when doing partitioning. + (find_traces_1_round) : Remove variable last_round; add code to + update new struct field, in_trace; correct trace_length where it was + incorrect before (after call to copy_bb); change code that pushed all + cold blocks to last round. Instead verify that all blocks going into + a trace belong in the same partition. + (connect_traces): Modify to connect the traces in two passes, if the + function contains both hot and cold blocks. The first pass connects + all the traces for blocks in the partition that the first block in + the function belongs to; the second pass connnects all the traces + containing blocks that belong in the other partition. + (find_rarely_executed_basic_blocks_and_crossing_edges): Remove + code that automatically put the first block in a function into the + hot partition if the function had any hot blocks. + (fix_crossing_unconditional_branches): Check number of succ edges + before attempting to get one. + (fix_edges_for_rarely_executed_code): Update comment describing + function. + (reorder_basic_blocks): Add code to initialize new field (in_trace); + remove call to add_unlikely_executed_notes; add call to + verify_hot_cold_block_grouping. + (duplicate_computed_gotos): Don't change computed goto if it's a + crossing edge. + (partition_hot_cold_basic_blocks): Update function comment. + * cfgcleanup.c (try_simplify_condjump): Remove redundacy from + condition. + (try_forward_edges): Likewise. + (merge_blocks_move_predecessor_nojumps): Likewise. + (merge_blocks_move_successor_nojumps): Likewise. + (merge_blocks_move): Likewise. + (try_crossjump_bb): Likewise. + * cfglayout.c (update_unlikely_executed_notes): Remove function. + (fixup_reorder_chain): Remove code for adding UNLIKELY_EXECUTED_CODE + notes to cold bb's; remove call to update_unlikely_executed_notes. + (duplicate_insn_chain): change NOTE_INSN_UNLIKELY_EXECUTED_CODE to + NOTE_INSN_SWITCH_TEXT_SECTIONS. + * cfglayout.h (scan_ahead_for_unlikely_executed_note): Remove + function declaration. + * cfgrtl.c (can_delete_note_p): Remove UNLIKELY_EXECUTED_CODE note + from consideration. + (rtl_can_merge_blocks): Remove redundancy from condition. + (try_redirect_by_replacing_jump): Likewise. + (force_nonfallthru_and_redirect): Remove code for adding + UNLIKELY_EXECUTED_CODE notes to cold bb's. + (commit_one_edge_insertion): Likewise. + (cfg_layout_can_merge_blocks_p): Remove redundancy from condition. + * dbxout.c (FORCE_TEXT): Replace function_section with + current_function_section. + (struct dbx_debug_h): Add do_nothing function for new debug_hooks + function, switch_text_section. + (struct xcoff_debug): Likewise. + (dbxout_function_end): Add code to put out label diffs for both + hot and cold sections. + * debug.c (struct do_nothing_debug_hooks): Add do_nothing function + for new debug_hooks funciton, switch_text_section.. + * debug.h (struct gcc_debug_hooks): Add new function to debug_hooks, + switch_text_section. + * dwarf2out.c (struct dw_fde_struct): Add five new fields: + dw_fde_hot_section_label, dw_fde_hot_section_end_label, + dw_fde_unlikely_section_label, dw_fde_unlikely_section_end_label and + dw_fde_switched_sections. + (output_call_frame_info): Add test to see if function switches text + sections in the middle; if so, use appropriate extra hot and cold + section labels to compute size deltas for the hot and cold sections. + (dwarf2out_begin_prologue): Add code to initialize new fields in + dw_fde_struct. + (dwarf2out_switch_text_section): New function (invoked through + debug_hook); updates new fields in dw_fde_struct appropriately and + increments separate_line_info_table_in_use. + (dwarf2_debug_hooks): Initialize switch_text_section function to be + dwarf2out_switch_text_section. + (struct var_loc_node): Add new field, section_label. + (output_aranges): Add code to check whether in hot or cold section and + use the appropriate label in calculating deltas. + (output_ranges): Likewise. + (output_line_info): Add code to check which section we're in and + use appropriate hot/cold label. + (add_location_or_constant_value_attribute): Likewise. + (gen_subprogam_die): Modify arange attributes to use correct labels. + (dwarf2out_begin_block): Change call to function_section into call to + current_function_section. + (dwarf2out_end_block): Likewise. + (dwarf2out_source_line): Likewise. + (dwarf2out_var_location): Add code to check whether in hot or cold + section and use the appropriate label. + * except.c (output_function_exception_table): Change call to + function_section into call to current_function_section. + * final.c (profile_function): Likewise. + (scan_ahead_for_unlikely_executed_note): Remove function. + (final_scan_insn): Remove calls to + scan_ahead_for_unlikely_executed_note, and related code for switching + to cold section, except for the single time + NOTE_INSN_SWITCH_TEXT_SECTIONS may be encountered; add calls to + debug_hooks->switch_text_sections; replace appropriate calls to + function_section with calls to current_function_section. + * ifcvt.c (find_if_case_1): Remove redundancy from condition, add + test_bb to condition. + (find_if_case_2): Likewise. + * insn-notes.def: Change NOTE_INSN_UNLIKELY_EXECUTED_CODE to + NOTE_INSN_SWITCH_TEXT_SECTIONS. Update comment appropriately. + * opts.c (decode_options): Change warning about hot/cold partitioning + with exceptionss to inform (so as not to cause bootstrap failures); + remove warning about partitioning with DWARF debug info. + * output.h (current_function_section): Add new function decl. + (insert_section_boundary_note): Likewise. + (enum in_section): Move this declaration here from varasm.c. + (unlikely_section_label): Likewise. + (unlikely_text_section_name): Likewise. + (last_text_section_name): New global variable. + (last_text_section): Likewise. + (hot_section_label): Likewise. + (hot_section_end_label): Likewise. + (cold_section_end_label): Likewise. + * passes.c (rest_of_handle_final): Free unlikely_text_section_name. + * print-rtl.c (print_rtx): Change NOTE_INSN_UNLIKELY_EXECUTED_CODE + to NOTE_INSN_SWITCH_TEXT_SECTIONS. + * reg-stack.c (emit_swap_insn): Remove UNLIKELY_EXECUTED_CODE note + insn from consideration. + * sdbout.c (sdb_debug_hooks): Add do_nothing for new function, + switch_text_section. + * varasm.c (basic-block.h): Add new include. + (unlikely_section_label_printed): Remove global variable. + (unlikely_section_label): Make global variable not be static any more. + (unlikely_text_section_name): Likewise. + (hot_section_end_label): New global variable (not static) + (first_function_block_is_cold): Likewise. + (hot_section_label): Likewise. + (cold_section_end_label): Likewise.. + (last_text_section): New global variable, not static. + (last_text_section_name): New global variable, not static. + (initialize_cold_section_name): New function. + (enum in_section): Move declaration to output.h. + (text_section): Update last_text_section. + (unlikely_text_section): Replace code to determine cold section name + with call to initialize_cold_section_name; Add code to update + last_text_section; remove code for printing out label. + (named_section_real): Add code to update last_text_section and + last_text_section_name as appropriate. + (function_section): Change test for 'unlikely' to depend on + first_function_block_is_cold (moved old test to + current_function_section). + (current_function_section): New function. + (assemble_start_function): Move code that frees + unlikely_text_section_name; initialize hot_section_end_label; + print hot and cold section labels at the start of the function; + set first_function_block_is_cold, if appropriate; initialize l + ast_text_section; add call to insert_section_boundary_note. + (assemble_end_function): Add code to write out hot and cold section + end labels. + *vmsdbgout.c (vmsdbg_debug_hooks): Add do_nothing for new function, + switch_text_section. + * config/darwin.c (machopic_select_section): Replace incorrect + function in base_funs; update reloc for cold sections if necessary. + * config/darwin.h (SECTION_FUNCTION): Add code to update + last_text_section if appropriate. + (text_unlikely_section): Remove. + * config/sparc/sparc.c (sparc_output_deferred_case_vectors): Likewise. + * config/stormy16/stormy16.c (stormy_16_output_addr_vec): Likewise. + * config/xtensa/xtensa.c (override_options): Turn off hot/cold + partitioning for this architecture. + +2005-03-31 Olivier Hainque + + * dwarf2out.c (dwarf2out_frame_finish): Honor DWARF2_FRAME_INFO + defined and non-zero. + +2005-03-31 Gabriel Dos Reis + + PR c++/18644 + * doc/invoke.texi (-Wsynth): Don't document, as it now is void of + semantics. + +2005-03-31 Alan Modra + + PR target/20611 + * config/rs6000/rs6000.md (load_toc_v4_PIC_1b): Remove inline + label operand. Remove (use (unspec..)). Don't emit a label on + the offset word. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Don't + generate inline label for load_toc_v4_PIC_1b. + (rs6000_emit_load_toc_table): Likewise. + +2005-03-31 Kazu Hirata + + * config.gcc: Obsolete i860-*-sysv4*, ip2k-*-elf, + ns32k-*-netbsdelf*, and ns32k-*-netbsd*. + +2005-03-29 Devang Patel + + * tree-sra.c (decide_block_copy): Disable scalarization of + sub-elements. + +2005-03-30 Stuart Hastings + Dale Johannesen + + * Makefile.in (print-tree.o): Depend on tree-iterator.h. + * print-tree.c (print_node): Add case STATEMENT_LIST. + +2005-03-31 Alan Modra + + * config.gcc (cpu_is_64bit): Set for 64-bit powerpc cpus. + (powerpc64-*-linux*): Use it. Rearrange tm_file assignment. + (powerpc-*-linux*): Build a biarch compiler when --enable-targets + is given with "powerpc64*" or "all", or when --with-cpu chooses + a 64-bit cpu. + +2005-03-30 James E. Wilson + + PR debug/20268 + * dwarf2out.c (add_high_low_attributes): New function, extracted from + gen_lexical_block_die. + (gen_lexical_block_die, gen_inlined_subroutine_die): Call it. + +2005-03-31 Jan Hubicka + + 2004-11-02 Jan Hubicka + + * cgraph.c (cgraph_varpool_node_name): New function. + (dump_cgraph_varpool_node): New function. + (dump_varpool): New function. + * cgraphunit.c (cgraph_optimize): Dump varpool. + + 2004-10-16 Jan Hubicka + + * cgraph.c (decide_is_variable_needed): New function. + (cgraph_varpool_finalize_decl): Use it. + * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing + unit-at-a-time. + * final.c (output_addr_const): Do not call mark_referenced. + * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; + always go via cgraph. + * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. + (check_global_declarations): Ifdef out code clearing DECL_RTL. + * tree-optimize.c (execute_inline): Mark functions called. + * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. + + 2004-10-11 Jan Hubicka + + * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable + (cgraph_varpool_last_needed_node): New static variable. + (enqueue_needed_varpool_node): Break out from ...; add items to the + end of queue; update first pointers. + (cgraph_varpool_mark_needed_node): ... here. + (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. + (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c + * cgraph.h (cgraph_varpool_node): Add analyzed field. + (cgraph_varpool_first_unanalyzed_node): Declare. + * cgraphunit.c: Include output.h. + (cgraph_varpool_analyze_pending_decls): New function. + (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out + for errors, analyze pending decls. + (cgraph_finalize_compilation_unit): Only analyze decls. + (cgraph_optimize): Assemble the decls after expanding. + +2005-03-30 Daniel Berlin + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Make sure + subvars get marked properly in tags for grouping. + (add_pointed_to_var): Mark only actual pointed to + variables/subvars in addresses needed. + (create_overlap_variables_for): Clear call clobbered on original + variable. + * tree-ssa-operands.c (get_asm_expr_operands): Don't let regular + addresable vars with subvars into list. + * tree-ssa.c (verify_ssa_name): Verify original is not used where + subvar should be. + +2005-03-30 Richard Henderson + + * cgraph.h (struct cgraph_node): Add alias. + * varasm.c (assemble_alias): Set it. + * cgraphunit.c (cgraph_assemble_pending_functions): Check it and + avoid calling cgraph_expand_function. + +2005-03-30 Tom Tromey + + * tree.def (FILE_TYPE): Removed. + * typeclass.h (enum type_class): Removed file_type_class. + * dwarf2out.c (is_base_type): Updated. + (gen_type_die): Likewise. + * dbxout.c (dbxout_type): Updated. + * builtins.c (type_to_class): Updated. + * tree.c (type_contains_placeholder_1): Updated. + * config/sparc/sparc.c (sparc_type_code): Updated. + * config/ia64/ia64.c (hfa_element_mode): Updated. + * expr.c (count_type_elements): Updated. + * stor-layout.c (layout_type): Updated. + * tree-inline.c (remap_type): Updated. + * tree-pretty-print.c (dump_generic_node): Updated. + +2005-03-30 Fariborz Jahanian + + * builtins.c (expand_builtin_powi): Fix mode of + 2nd argument to match int. + * libgcc2.h (__powisf2, __powidf2, __powixf2, __powitf2): Change + 2nd argument type to int. + * libgcc2.c: Change prototype of __powi* functions to use + int. + +2005-03-30 Dale Johannesen + + PR middle-end/19225 + * calls.c (expand_call): Flush pending deferrals before + throwing call. + +2005-03-30 Joseph S. Myers + + PR c/772 + PR c/17913 + * c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR, + C_DECL_UNDEFINABLE_STMT_EXPR, struct c_label_list, struct + c_label_context, label_context_stack): New. + * c-decl.c (define_label): Check for jumps into statement + expressions. Add label to list of defined labels. + (start_function): Push context on label_context_stack. + (finish_function): Pop context from label_context_stack. + * c-typeck.c (label_context_stack): New. + (c_finish_goto_label): Check for jumps into statement + expressions. Add label to list of jumped to labels. + (struct c_switch): Add blocked_stmt_expr. + (c_start_case): Initialize it. + (do_case): Check it. + (c_finish_case): Verify !blocked_stmt_expr. + (c_begin_stmt_expr): Push context on label_context_stack. + Increment blocked_stmt_expr. Mark labels jumped to from outside + as undefinable. + (c_finish_stmt_expr): December blocked_stmt_expr. Mark labels + defined in the statement expression and no longer jumpable to. + Mark labels jumped to from just outside the statement expression + as again definable. Pop context from label_context_stack. + * doc/extend.texi (Statement Exprs): Update. + +2005-03-30 Joseph S. Myers + + PR c/20368 + * c-decl.c (start_function): Check for old_decl being + error_mark_node. + +2005-03-30 Ian Lance Taylor + + * final.c (final): Remove prescan parameter. Change all callers. + (final_scan_insn): Remove prescan parameter. Change all callers. + +2005-03-30 Kazu Hirata + + * tree-vectorizer.c: Fix comment typos. + +2005-03-30 Sebastian Pop + + * tree-scalar-evolution.c (instantiate_parameters_1): Return + as soon as a chrec_dont_know is detected. + +2005-03-31 Danny Smith + + Merge from csl-arm-branch. + 2004-02-12 Mark Mitchell + + * tlink.c (recompile_files): Do not assume that "rename" can + overwrite an existing file. + +2005-03-31 Paolo Bonzini + + * configure.ac (TL_AC_GNU_MAKE_GCC_LIB_PATH): Remove. + * configure: Regenerate. + +2005-03-30 Alan Modra + + * doc/install.texi: Update binutils requirement for powerpc*-linux. + + * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Update comments. + + * calls.c (struct arg_data): Update "partial" comment. + (load_register_parameters): Update "nregs" comment. + +2005-03-30 Richard Sandiford + + * config/iq2000/iq2000.h (target_flags, MASK_GPOPT, MASK_EMBEDDED_DATA) + (MASK_UNINIT_CONST_IN_RODATA, TARGET_EMBEDDED_DATA, TARGET_SWITCHES) + (TARGET_DEFAULT, TARGET_CPU_DEFAULT, SUBTARGET_TARGET_OPTIONS) + (TARGET_OPTIONS, iq2000_cpu_string, iq2000_arch_string): Delete. + (TARGET_DEBUG_MODE, TARGET_DEBUG_A_MODE, TARGET_DEBUG_B_MODE) + (TARGET_DEBUG_C_MODE, TARGET_DEBUG_D_MODE): Define to 0 rather + than target_flags & 0. + * config/iq2000/iq2000.c (iq2000_cpu_string, iq2000_arch_string) + (iq2000_arch, iq2000_parse_cpu): Delete. + (TARGET_HANDLE_OPTION): Override default. + (iq2000_handle_option): New function. + (override_options): Remove -march= and -mcpu= handling. + * config/iq2000/iq2000.opt: New file. + +2005-03-30 Richard Sandiford + + * config/c4x/c4x-protos.h (c4x_rpts_cycles, c4x_cpu_version): Delete. + * config/c4x/c4x.h (SMALL_MEMORY_FLAG, MPYI_FLAG, FAST_FIX_FLAG) + (RPTS_FLAG, C3X_FLAG, TI_FLAG, PARANOID_FLAG, MEMPARM_FLAG, DEVEL_FLAG) + (RPTB_FLAG, BK_FLAG, DB_FLAG, DEBUG_FLAG, HOIST_FLAG) + (LOOP_UNSIGNED_FLAG, FORCE_FLAG, PRESERVE_FLOAT_FLAG) + (PARALLEL_INSN_FLAG, PARALLEL_MPY_FLAG, ALIASES_FLAG, C30_FLAG) + (C31_FLAG, C32_FLAG, C33_FLAG, C40_FLAG, C44_FLAG, TARGET_SWITCHES) + (TARGET_DEFAULT, TARGET_SMALL, TARGET_MPYI, TARGET_FAST_FIX) + (TARGET_RPTS, TARGET_TI, TARGET_PARANOID, TARGET_MEMPARM, TARGET_DEVEL) + (TARGET_RPTB, TARGET_BK, TARGET_DB, TARGET_DEBUG, TARGET_HOIST) + (TARGET_LOOP_UNSIGNED, TARGET_FORCE, TARGET_PRESERVE_FLOAT) + (TARGET_PARALLEL, TARGET_PARALLEL_MPY, TARGET_ALIASES) + (c4x_rpts_cycles_string, c4x_cpu_version_string) + (TARGET_OPTIONS): Delete. + (c4x_rpts_cycles, c4x_cpu_version): Declare. + (TARGET_C3X, TARGET_C30, TARGET_C31, TARGET_C32, TARGET_C33) + (TARGET_C40, TARGET_C44): Redefine in terms of c4x_cpu_version. + * config/c4x/c4x.c (c4x_rpts_cycles_string): Delete. + (c4x_cpu_version_string): Delete. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (c4x_handle_option): New function. Map -m3x and -m4x options to the + equivalent -mcpu= option. + (c4x_override_options): Remove -mrpts= and -mcpu= handling from here. + Deal with the extra conditions in the old TARGET_MPYI, TARGET_RPTB, + TARGET_DB, TARGET_PARALLEL and TARGET_PARALLEL_MPY macros by setting + or clearing the appropriate MASK_* bit. + (c4x_file_start): Use c4x_cpu_version. + * config/c4x/c4x.opt: New file. + +2005-03-30 Richard Sandiford + + * doc/options.texi: Document the new MaskExists flag. + * opth-gen.awk: Don't output MASK and TARGET macros for Mask(...) + if the option has the MaskExists flag. + +2005-03-30 Richard Sandiford + + * opt-functions.awk (flag_set_p, test_flag): New functions. + (switch_flags): Use them. + * opth-gen.awk: Use flag_set_p to check for flags. + * optc-gen.awk: Likewise. Use opt_args to check for Init(...) flags. + +2005-03-30 Ian Lance Taylor + + * config.host (i[34567]86-*-mingw32*): Don't set + host_can_use_collect2 to no. + +2005-03-30 Alan Modra + + PR target/20203 + * builtins.c (get_memory_rtx): Expand address exp using EXPAND_NORMAL. + Remove convert_memory_address call duplicating that in memory_address. + +2005-03-29 Richard Henderson + + PR c/20519 + * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call. + (build_compound_literal): Likewise. Propagate decl type into the + initializer. + (finish_decl): Likewise. Use new return value from complete_array_type + for zero sized arrays. + (complete_array_type): Move ... + * c-common.c (complete_array_type): ... here. Change first argument + to pointer-to-type-node. Consistently use sizetype for the index + except for zero sized arrays. Detect zero sized arrays for pedantic + mode diagnostics. Create a new type node instead of modifying the + old node in place. + * c-tree.h (complete_array_type): Move decl ... + * c-common.h (complete_array_type): ... here. + +2005-03-29 Richard Henderson + + PR tree-opt/19108 + * tree-sra.c (generate_element_init_1): Handle RANGE_EXPR. + +2005-03-29 Kazu Hirata + + * builtin-types.def, c-convert.c, c-format.c, ddg.c, debug.c, + debug.h, et-forest.c, et-forest.h, gcov.c, rtl-profile.c, + rtlhooks-def.h, rtlhooks.c, sdbout.c, tree-inline.h, + tree-profile.c, tsystem.h, value-prof.h: Update copyright. + +2005-03-29 Eric Christopher + + * config/mips/mips.c (mips_gimplify_va_arg_expr): Update for + truthvalue conversion removal. + +2005-03-29 Ian Lance Taylor + + PR bootstrap/14316 + * collect2.c: Never include . + (VFORK_STRING, vfork): Don't define. + (pid): Remove global variable. + (handler): Call raise instead of kill (getpid(), ...). + (collect_wait): Add pex parameter. Change all callers. Use + pex_get_status rather than pwait. + (do_wait): Add pex parameter. Change all callers. + (collect_execute): Return struct pex_obj * rather than void. Use + pex routines rather than pexecute. + (fork_execute): Get pex_obj from collect_execute, and pass it to + do_wait. + (scan_prog_file): Use pex routines rather than pipe/vfork/exec. + Only declare quit_handler if SIGQUIT is defined. + (scan_libraries): Likewise. + * collect2.h (collect_execute): Update declaration. + (collect_wait): Update declaration. + * tlink.c (tlink_execute): Get pex_obj from collect_execute, and + pass it to collect_wait. + +2005-03-29 Joseph S. Myers + + PR c/20672 + * c-parser.c (c_parser_compound_statement_nostart): Give error + message for EOF instead of just setting parser->error. + +2005-03-29 Dorit Naishlos + + * tree-vectorizer.c (slpeel_update_phi_nodes_for_guard): Removed. + (slpeel_update_phi_nodes_for_guard1): New function. + (slpeel_update_phi_nodes_for_guard2): New function. + (slpeel_tree_peel_loop_to_edge): Call above new functions instead + of slpeel_update_phi_nodes_for_guard. + (vectorize_loops): Remove call to loop_closed_rewrite. + * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Remove + assertion. + +2005-03-29 Richard Sandiford + + * config/m32r/little.h (TARGET_ENDIAN_DEFAULT): Delete. + (TARGET_LITTLE_ENDIAN): New macro. + * config/m32r/m32r.h (SUBTARGET_SWITCHES, target_flags) + (TARGET_RELAX_MASK, TARGET_DEBUG_MASK, TARGET_DEBUG) + (TARGET_ALIGN_LOOPS_MASK, TARGET_ALIGN_LOOPS) + (TARGET_LOW_ISSUE_RATE_MASK, TARGET_LOW_ISSUE_RATE) + (TARGET_BRANCH_COST_MASK, TARGET_BRANCH_COST, TARGET_M32RX_MASK) + (TARGET_M32RX, TARGET_M32R2_MASK, TARGET_M32R2, LITTLE_ENDIAN_BIT) + (TARGET_ENDIAN_DEFAULT, SUBTARGET_SWITCHES, TARGET_DEFAULT) + (TARGET_SWITCHES, m32r_model_string, m32r_sdata_string) + (m32r_cache_flush_trap_string, SUBTARGET_OPTIONS) + (TARGET_OPTIONS): Delete. + (M32R_MODEL_DEFAULT, M32R_SDATA_DEFAULT): Turn into enums. + (CACHE_FLUSH_TRAP): Turn into an integer. + (TARGET_LITTLE_ENDIAN): Define to 0 by default. + (INITIALIZE_TRAMPOLINE): Check m32r_cache_trap >= 0 to see if + -mflush-trap is in use. + * config/m32r/m32r.c (m32r_model_string, m32r_sdata_string) + (m32r_cache_flush_trap_string): Delete. + (m32r_model) Initialize to M32R_MODEL_DEFAULT. + (m32r_sdata): Likewise M32R_SDATA_DEFAULT. + (m32r_cache_trap): Likewise CACHE_FLUSH_TRAP. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (m32r_handle_option): New function. Move -mflush-trap=, -mflush-func=, + -mmodel= and -msdata= handling from... + (m32r_init): ...here. + * config/m32r/m32r.opt: New file. + +2005-03-29 Keith Besaw + + * tree-ssanames.c (duplicate_ssa_name_ptr_info): New function. + (duplicate_ssa_name): Call duplicate_ssa_name_ptr_info. + * tree-vect-analyze.c (vect_object_analysis): additional parm + pass back a "struct ptr_info_def *" with the points-to info. + (vect_analyze_data_refs): set the STMT_VINFO_PTR_INFO for the + statement using info returned from vect_object_analysis. + * tree-vect-transform.c (update_vuses_to_preheader): New function. + (vect_create_data_ref_ptr): Remove updates to vars_to_rename + for virtual uses and defs when creating a replacement vector + reference. Call duplicate_ssa_name_ptr_info to define points-to + info for vector pointer replacement using STMT_VINFO_PTR_INFO. + (vectorizable_store): copy_virtual_operands and update + definition statements. + (vectorizable_load): copy_virtual_operands. Remove call to + mark_call_clobbered_vars_to_rename for call to "const" builtin. + * tree-vectorizer.c (vectorize_loops): Remove calls to + rewrite_into_ssa and bitmap_clear (vars_to_rename). + (new_stmt_vec_info): initialize STMT_VINFO_PTR_INFO for stmt. + * tree-vectorizer.h (_stmt_vec_info): add field ptr_info and + define macro STMT_VINFO_PTR_INFO for use in accessing. + * tree.h add export of duplicate_ssa_name_ptr_info. + * rs6000.c (altivec_init_builtins): Declare builtin function + __builtin_altivec_mask_for_load to be "const". + +2005-03-29 Jakub Jelinek + + PR middle-end/20622 + * cgraph.h (struct cgraph_varpool_node): Add alias field. + * cgraph.c (cgraph_varpool_assemble_pending_decls): Don't call + assemble_variable on aliases. + * varasm.c (assemble_alias): Set node->alias. + * toplev.c (wrapup_global_declarations): Don't call + rest_of_decl_compilation on aliases again. + +2005-03-29 Paul Brook + + * config/arm/arm-protos.h (arm_dbx_register_number): Add prototype. + * config/arm/arm.c (arm_dbx_register_number): New function. + * config/arm/arm.h (IS_FPA_REGNUM, DBX_REGISTER_NUMBER): Define. + +2005-03-29 Eric Botcazou + + PR middle-end/20263 + * varasm.c (make_decl_rtl) [ASM_DECLARE_REGISTER_GLOBAL]: Use + the DECL_NAME, not the DECL_ASSEMBLER_NAME. + +2005-03-29 Dale Johannesen + + * Makefile.in (value-prof.o): New dependencies on $(DIAGNOSTIC_H) + $(TREE_H) and $(COVERAGE_H). + * coverage.c (compute_checksum): Use DECL_NAME not DECL_ASSEMBLER_NAME. + * opts.c (common_handle_option): Enable tree-based value transforms. + * toplev.c (process_options): Ditto. + * value-prof.h (struct histogram_value_t): Redefine. "Adjust" below + refers to references to this type. + * tree-flow.h: (struct stmt_ann_d): Add histograms field. + * rtl-profile.c (rtl_gen_interval_profiler): Adjust. Remove checks + for may_be_more, may_be_less. + (rtl_gen_pow2_profiler): Adjust. + (rtl_gen_one_value_profiler_no_edge_manip): Adjust. + (rtl_gen_one_value_profiler): Adjust. + (rtl_gen_const_delta_profiler): Adjust. + * tree-profile.c (tree_gen_interval_profiler): Implement. + (tree_gen_pow2_profiler): Ditto. + (tree_gen_one_value_profiler): Ditto. + (tree_profiling): New. + (pass_tree_profile): Reference it. + * value-prof.c: Include tree-flow.h, tree-flow-inline.h, diagnostic.h, + tree.h, gcov-io.h. + (insn_divmod_values_to_profile): Rename to + rtl_divmod_values_to_profile. Adjust. + (insn_values_to_profile): Rename to rtl_values_to_profile. Adjust. + (insn_prefetch_values_to_profile): Adjust. + (rtl_value_profile_transformations): Adjust. + (gen_divmod_fixed_value): Rename to rtl_divmod_fixed_value. + (gen_mod_pow2): Rename to rtl_mod_pow2. + (gen_mod_subtract): Rename to rtl_mod_subtract. + (divmod_fixed_value_transform): Rename to + rtl_divmod_fixed_value_transform. + (mod_pow2_value_transform): Rename to rtl_mod_pow2_value_transform. + (mod_subtract_transform): Rename to rtl_mod_subtract_transform. + (rtl_find_values_to_profile): Adjust. + (tree_value_profile_transformations): Implement. + (tree_divmod_values_to_profile): New. + (tree_values_to_profile): New. + (tree_divmod_fixed_value): New. + (tree_mod_pow2): New. + (tree_mod_subtract): New. + (tree_divmod_fixed_value_transform): New. + (tree_mod_pow2_value_transform): New. + (tree_mod_subtract_transform): New. + (tree_find_values_to_profile): Implement. + * profile.c (instrument_values): Free histograms. + (compute_value_histograms): Adjust. Implement tree version. + +2005-03-29 Uros Bizjak + + * reg-stack.c (subst_stack_regs_pat): Handle case. + * config/i386/i386.c (output_fix_trunc): Add new round_mode + variable. Output "fldcw" depending on round_mode. + * config/i386/i386.md (UNSPEC_FIST): New. + (fistdi2, fistdi2_with_temp, fist2, fist2_with_temp): + New isns patterns to implement lrint and llrint built-ins as x87 + intrinsic function. + (fistdi2, fist2 splitters): New splitters. + (lrint2): New expanders. + +2005-03-28 Ian Lance Taylor + + * config/arc/arc.c (arc_output_function_epilogue): Pass prescan as + 0 when calling final_scan_insn. + +2005-03-28 Jan Hubicka + + PR middle-end/20635 + * varasm.c (mark_decl_referenced): Do not mark extern inline functions + as needed. + + * tree-inline.c (estimate_num_insns_1): Use declaration to discover argument + types where possible. + +2005-03-26 Per Bothner + + Make -f[no-]show-column also control non-cpp diagnostics. + * c.opt (fshow-column): Move option from here ... + * common.opt (fshow-column): ... to here. + * diagnostic.c (diagnostic_build_prefix): Only print column number + if flag_show_column. + +2005-03-27 Steven Bosscher + + * vax-protos.h (vax_output_int_move, vax_output_int_add, + vax_output_conditional_branch): New prototypes. + * vax.c (vax_output_int_move, vax_output_int_add): New functions, + extracted from vax.md mov and add patterns. + (vax_output_conditional_branch): New function to output conditional + branch instructions. + * vax.md: Use mode macros for arithmetic and mov patterns. + Use code macros for the jump patterns. + +2005-03-26 Andrew Pinski + + * Makefile.in (libbackend.o): Depend on version files; + add custom generation command. + +2005-03-26 Andrew Pinski + + PR target/20636 + * config/rs6000/rs6000.md (extendsfdf2_fpr): Check to make + sure that we have a REG before getting its REGNO. + +2005-03-25 Kaveh R. Ghazi + + * builtin-types.def (BT_FN_STRING_CONST_STRING_SIZE): New. + * builtins.def (BUILT_IN_STRNDUP): New. + +2005-03-25 Pat Haugen + + PR tree-optimization/20470 + * fold-const.c (fold_cond_expr_with_comparison): Recognize/fold + ABS(x-y). + +2005-03-25 Mike Stump + + * config/darwin.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Don't allow 0 + sized objects. + +2005-03-25 Geoffrey Keating + + * config/rs6000/darwin-fallback.c: Don't include . + Use our own structure definitions. + + * config/rs6000/rs6000.md (UNSPEC constants): Add UNSPEC_STFIWX. + (fix_truncdfsi2): Allow registers or memory as destination. + When TARGET_PPC_GFXOPT, generate simplified pattern. + (fix_truncdfsi2_internal): Use define_insn_and_split. + (fix_truncdfsi2_internal_gfxopt): New. + (fctiwz): Don't confuse register allocation by giving it no choices. + (stfiwx): New. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'Z'. + (EXTRA_MEMORY_CONSTRAINT): Likewise. + * config/rs6000/rs6000.c (indexed_or_indirect_operand): New. + * config/rs6000/rs6000-protos.h (indexed_or_indirect_operand): New. + +2005-03-25 Kazu Hirata + + * dominance.c (free_dominance_info): Speed up by freeing et + data structures without maintaining other nodes. + * et-forest.c (et_free_tree_force): New. + * et-forest.h: Add a prototype for et_free_tree_force. + + * tree.c (get_set_constructor_bits, + get_set_constructor_bytes): Remove. + * tree.h: Remove the corresponding prototypes. + +2005-03-25 John David Anglin + + PR target/15491 + * vax.c (vax_rtx_costs_1): Merge with vax_rtx_costs. + (vax_rtx_costs): Return false when passed unsupported rtx's. Handle + FLOAT_EXTEND, FLOAT_TRUNCATE and TRUNCATE. Fix costs for POST_INC, + PRE_DEC, NEG and NOT. + +2005-03-25 Kazu Hirata + + * fold-const.c: Convert uses of fold (build (...)) to + fold_buildN. + +2005-03-25 Zdenek Dvorak + + PR rtl-optimization/20249 + * cse.c (insert_regs): Do not record equivalence of registers in + different modes. + +2005-03-24 Kazu Hirata + + * emit-rtl.c (reverse_comparison): Remove. + * rtl.h: Remove the corresponding prototype. + +2005-03-24 James E Wilson + + * doc/install.texi (--enable-altivec): Delete docs. + +2005-03-24 David Edelsohn + + * config/rs6000/predicates.md (easy_fp_constant): Return 0 for + SFmode and DFmode before reload when + flag_unsafe_math_optimizations not enabled. + +2005-03-24 Geoffrey Keating + + * c.opt (fvisibility-inlines-hidden): Allow for ObjC++. + + * config/i386/darwin.h (TARGET_SUBTARGET_DEFAULT): Add + MASK_128BIT_LONG_DOUBLE, MASK_ALIGN_DOUBLE. + +2005-03-24 Nathan Sidwell + + * configure.ac (enable-checking): Add 'runtime' option. + * doc/install.texi (enable-checking): Document 'runtime' checking. + * tsystem.h (gcc_assert, gcc_unreachable): Define. + * config.in: Regenerated. + * configure: Regenerated. + +2005-03-23 Uros Bizjak + + * optabs.h (enum optab_index): Remove OTI_llrint. + (llrint_optab): Remove macro. + * optabs.c (init_optabs): Remove llrint_optab initialization. + * genopinit.c (optabs): Remove llrint_optab implementation. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LLRINT{,F,L} + using lrint_optab. + +2005-03-24 Alexandre Oliva + + PR rtl-optimization/20532 + * simplify-rtx.c (simplify_binary_operation_1): Protect from + overflow when adding coefficients for PLUS or MINUS. + (simplify_binary_operation_1): Handle CONST_DOUBLE exact power of + two as multiplier. + +2005-03-23 Joseph S. Myers + + * langhooks.h (truthvalue_conversion): Remove. + * langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove + LANG_HOOKS_TRUTHVALUE_CONVERSION. + * system.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Poison. + * gimplify.c (gimple_boolify): Don't use truthvalue_conversion. + * c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-23 Kazu Hirata + + * params.def: Fix a typo. + * config/mips/mips.c: Follow the spelling convensions. + * doc/invoke.texi: Fix typos. + +2005-03-23 Daniel Berlin + + Fix PR tree-optimization/20601 + + * tree-ssa-pre.c (insert_aux): Add missing condition to + constification. + +2005-03-23 Ian Lance Taylor + + * final.c (final_scan_insn): Don't remove no-op instructions. + * reload1.c (reload): Remove simple no-op instructions even when + not optimizing. + +2005-03-23 Dorit Naishlos + + PR tree-optimization/20501 + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Debug print + reporting that peeling for alignment is applied moved to... + * (vect_analyze_data_refs_alignment): Here. + +2005-03-23 Ian Lance Taylor + + * reorg.c (dbr_schedule): Remove #if 0 code to call final. + +2005-03-23 Rainer Orth + + * config.gcc (alpha*-dec-osf[45]*): Remove target_cpu_default. + Define TARGET_SUPPORT_ARCH except on Tru64 UNIX V4.0A. + +2005-03-23 Hans-Peter Nilsson + + * doc/tm.texi (TARGET_MD_ASM_CLOBBERS): Adjust wording to not + imply that this is called once, independent of asms in code. + Adjust to now being pased output and input lists. Mention helper + function decl_overlaps_hard_reg_set_p. + * hooks.c (hook_tree_tree_tree_tree_3rd_identity): Rename from + hook_tree_tree_identity and to take three trees, returning third. + * hooks.h (hook_tree_tree_tree_tree_3rd_identity): Adjust the + prototype. + * stmt.c: include hard-reg-set.h before tree.h. + (decl_overlaps_hard_reg_set_p): New function, broken out from... + (decl_conflicts_with_clobbers_p): Call + decl_overlaps_hard_reg_set_p. + (expand_asm_operands): Pass output and input lists in call to + targetm.md_asm_clobbers. + * target-def.h (TARGET_MD_ASM_CLOBBERS): Define as + hook_tree_tree_tree_tree_3rd_identity. + * target.h (struct gcc_target.md_asm_clobbers): Take three tree + parameters. + * tree.h [HARD_CONST] (decl_overlaps_hard_reg_set_p): Prototype. + * config/i386/i386.c (ix86_md_asm_clobbers): Adjust to three + parameters, first two unused. + * config/cris/cris.c (cris_md_asm_clobbers): Adjust to added + parameters. Only add MOF to clobbers if there's no 'h' mentioned + in constraint letters and MOF is not mentioned as a asm-declared + register in neither of the input and output lists. + +2005-03-23 DJ Delorie + + * optabs.c (expand_binop): Make sure the first subword's result + gets stored. + +2005-03-23 Joseph S. Myers + + * c-common.c (c_common_truthvalue_conversion): Adjust comment. + Call c_common_truthvalue_conversion rather than + lang_hooks.truthvalue_conversion. + * c-convert.c (convert): Call c_objc_common_truthvalue_conversion. + * c-objc-common.c (c_objc_common_truthvalue_conversion): Move to + c-typeck.c. + * c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Change to + c_common_truthvalue_conversion. + * c-parser.c (c_parser_paren_condition, c_parser_for_statement, + c_parser_conditional_expression, c_parser_binary_expression): Call + c_objc_common_truthvalue_conversion. + * c-typeck.c (build_unary_op): Call + c_objc_common_truthvalue_conversion. + (build_conditional_expr): Do not call + lang_hooks.truthvalue_conversion. + (build_binary_op): Call c_common_truthvalue_conversion. + (c_objc_common_truthvalue_conversion): Moved from + c-objc-common.c. Call default_function_array_conversion instead + of default_conversion. + +2005-03-23 Joseph S. Myers + + * c-common.h (default_conversion): Remove. + (perform_integral_promotions): Add. + * c-tree.h (default_conversion): Add. + * c-typeck.c (perform_integral_promotions): New, split out from + default_conversion. + * c-common.c (check_case_value): Use perform_integral_promotions, + not default_conversion. + (c_add_case_label): Don't continue processing case label after + found to be pointer. + +2005-03-23 Mark Mitchell + + * gcc.c (do_spec_1): Do not add a -L path for a directory in + the prefix list if we have already added a multilib directory + based on that path. + (main): Do not add MD_EXEC_PREFIX to the list of directories to + search with -L. + +2005-03-22 Kazu Hirata + + * reload1.c (indirect_symref_ok, reload_obstack): Make them + static. + * reload.h: Remove the prototype for indirect_symref_ok. + + * reload1.c (indirect_symref_ok): Make it global. + * reload.h: Add a prototype for indirect_symref_ok. + +2005-03-22 Kaz Kojima + + * config/sh/sh.md (ashlhi3): Rename to *ashlhi3_n and add a new + ashlhi3 expander. + +2005-03-22 Tobias Schl"uter + + * tree.h (DECL_IGNORED_P, DECL_IN_SYSTEM_HEADER): Clarify comments. + +2005-03-22 Daniel Berlin + + * c-opts.c (c_common_parse_file): Only start/end main source file + if debug hooks says the writer wants it. + * dbxout.c (dbx_debug_hooks): Add start_end_main_source_file + member. + (xcoff_debug_hooks): Ditto. + * debug.c (do_nothing_hooks): Ditto. + * debug.h (gcc_debug_hooks): Ditto. + * dwarf2out.c (dwarf2_debug_hooks): Ditto. + * sdbout.c (sdb_debug_hooks): Ditto. + * vmsdbgout.c (vmsdbg_debug_hooks): Ditto. + +2005-03-22 Mark Mitchell + + * doc/extend.texi: Deprecate C++ min/max operators. + +2005-03-22 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (determine_iv_cost): Do not try to preserve + artificial original candidates. + +2005-03-22 Richard Guenther + Jan Hubicka + Steven Bosscher + + * cgraphunit.c (cgraph_estimate_size_after_inlining): Compute + call cost based on argument sizes. + (cgraph_mark_inline_edge): Avoid inline unit from shrinking by + inlining. + * params.def: (max-inline-inssn-single): Set to 450. + (max-inline-insns-auto): Set to 90. + (max-inline-insns-recursive): Set to 450 + (max-inline-insns-recursive-auto): Set to 450. + (large-function-insns): Set to 2700. + (inline-call-cost): New parameter. + * tree-inline.c (estimate_move_cost): New function. + (estimate_num_insns_1): Compute move sizes costs by estimate_move_cost + for non-gimple-regs, set cost to 0 for gimple-regs. Compute call size + based on arguments. + * tree-inline.h (estimate_move_cost): Declare. + * invoke.texi: (max-inline-inssn-single): Change default to 450. + (max-inline-insns-auto): Change default to 90. + (max-inline-insns-recursive): Change default to 450 + (max-inline-insns-recursive-auto): Change default to 450. + (large-function-insns): Change default to 2700. + (inline-call-cost): Document new parameter. + +2005-03-22 Richard Sandiford + + * config/i860/i860.h (target_flags, TARGET_XP, TARGET_SWITCHES) + (TARGET_DEFAULT): Delete. + * config/i860/i860.opt: New file. + +2005-03-22 Richard Sandiford + + * config/frv/frv-protos.h (frv_branch_cost_string, frv_branch_cost_int) + (frv_cpu_string, frv_condexec_insns_str, frv_condexec_insns) + (frv_condexec_temps_str, frv_condexec_temps, frv_sched_lookahead_str) + (frv_sched_lookahead): Delete. + * config/frv/frv.h (MASK_DEFAULT_ALLOC_CC): Move to frv.c. + (target_flags, MASK_GPR_32, MASK_FPR_32, MASK_SOFT_FLOAT) + (MASK_ALLOC_CC, MASK_DWORD, MASK_DOUBLE, MASK_MEDIA, MASK_MULADD) + (MASK_LIBPIC, MASK_ACC_4, MASK_PACK, MASK_LONG_CALLS) + (MASK_ALIGN_LABELS, MASK_LINKED_FP, MASK_BIG_TLS, MASK_DEBUG_ARG) + (MASK_DEBUG_ADDR, MASK_DEBUG_STACK, MASK_DEBUG, MASK_DEBUG_LOC) + (MASK_DEBUG_COND_EXEC, MASK_NO_COND_MOVE, MASK_NO_SCC) + (MASK_NO_COND_EXEC, MASK_NO_VLIW_BRANCH, MASK_NO_MULTI_CE) + (MASK_FDPIC, MASK_INLINE_PLT, MASK_GPREL_RO, MASK_DEFAULT) + (TARGET_GPR_32, TARGET_FPR_32, TARGET_SOFT_FLOAT, TARGET_ALLOC_CC) + (TARGET_DWORD, TARGET_DOUBLE, TARGET_MEDIA, TARGET_MULADD) + (TARGET_LIBPIC, TARGET_ACC_4, TARGET_DEBUG_ARG, TARGET_DEBUG_ADDR) + (TARGET_DEBUG_STACK, TARGET_DEBUG, TARGET_DEBUG_LOC) + (TARGET_DEBUG_COND_EXEC, TARGET_NO_COND_MOVE, TARGET_NO_SCC) + (TARGET_NO_COND_EXEC, TARGET_NO_VLIW_BRANCH, TARGET_NO_MULTI_CE) + (TARGET_NO_NESTED_CE, TARGET_FDPIC, TARGET_INLINE_PLT, TARGET_BIG_TLS) + (TARGET_GPREL_RO, TARGET_PACK, TARGET_LONG_CALLS, TARGET_ALIGN_LABELS) + (TARGET_LINKED_FP, TARGET_GPR_64, TARGET_FPR_64, TARGET_HARD_FLOAT) + (TARGET_FIXED_CC, TARGET_COND_MOVE, TARGET_SCC, TARGET_COND_EXEC) + (TARGET_VLIW_BRANCH, TARGET_MULTI_CE, TARGET_NESTED_CE, TARGET_ACC_8) + (TARGET_SWITCHES, TARGET_OPTIONS, DEFAULT_CONDEXEC_TEMPS) + (DEFAULT_BRANCH_COST, DEFAULT_CONDEXEC_INSNS): Delete. + * config/frv/frv.c (frv_branch_cost_string, frv_branch_cost_int) + (frv_cpu_string, frv_condexec_insns_str, frv_condexec_insns) + (frv_condexec_temps_str, frv_condexec_temps, frv_sched_lookahead_str) + (frv_sched_lookahead): Delete. + (MASK_DEFAULT_ALLOC_CC): Moved from frv.h. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (frv_handle_option): New function. Move -mcpu= handling from... + (frv_override_options): ...here. Remove handling of other + TARGET_OPTIONS. + (frv_ifcvt_modify_tests): Check !TARGET_COND_EXEC instead of + TARGET_NO_COND_EXEC and !TARGET_NESTED_CE to TARGET_NO_NESTED_CE. + (frv_ifcvt_modify_multiple_tests): Likewise !TARGET_MULTI_CE + and TARGET_NO_MULTI_CE. + (frv_for_each_packet): Likewise TARGET_NO_VLIW_BRANCH and + !TARGET_VLIW_BRANCH. + * config/frv/frv.opt: New file. + +2005-03-22 Kazu Hirata + + * fold-const.c (fold_ternary): Take decomposed arguments of + CALL_EXPR. + (fold): Update a call to fold_ternary. + + * fold-const.c (fold_build1, fold_build2, fold_build3): New. + * tree.h: Add corresponding prototypes. + +2005-03-22 Jakub Jelinek + + PR target/20561 + * cfglayout.c (reemit_insn_block_notes): Don't put block notes in + between jump table and its label. + * final.c (shorten_branches): Handle notes in between ADDR_VEC + resp. ADDR_DIFF_VEC and the label preceeding it. + (final_scan_insn): Likewise. Ensure ADDR_VEC resp. ADDR_DIFF_VEC + is emitted in the right section. + +2005-03-22 Kazu Hirata + + * fold-const.c (fold_unary, fold_binary): Update comments + about arguments. + +2005-03-22 Hans-Peter Nilsson + + PR rtl-optimization/20527 + * combine.c (can_combine_p) [AUTO_INC_DEC]: When INSN has an + REG_INC note, test that the register also isn't mentioned in PRED + or SUCC. + +2005-03-22 Ben Elliston + + * dwarf2out.c (dwarf_type_encoding_name): Remove unused prototype + and definition. + +2005-03-21 Mike Stump + + * varasm.c (default_assemble_visibility): Remove extra (). + +2005-03-21 Roger Sayle + + PR middle-end/20557 + * bb-reorder.c (duplicate_computed_gotos): Use can_duplicate_block_p + to determine whether a block can be duplicated, rather than test + whether the block contains noncopyable insns ourselves. + +2005-03-21 Kazu Hirata + + * config/i860/i860.h (PREDICATE_CODES): Remove nonexistent + predicates. + +2005-03-21 Richard Sandiford + + * config/ip2k/ip2k.h (target_flags, TARGET_SWITCHES): Delete. + +2005-03-21 Richard Sandiford + + * config/fr30/fr30.h (TARGET_SMALL_MODEL_MASK, TARGET_SMALL_MODEL) + (TARGET_DEFAULT, target_flags, TARGET_SWITCHES): Delete. + * config/fr30/fr30.opt: New file. + +2005-03-18 Daniel Berlin + + Fix PR tree-optimization/20542 + + * tree-flow-inline.h (overlap_subvar): Move to here. + * tree-ssa-operands.c: From here. + * tree-flow.h (overlap_subvar): Declare. + * tree-ssa-alias.c (add_pointed_to_var): Use overlap_subvar here. + * tree-ssa-loop-im.c (is_call_clobbered_ref): Return proper answer + for variables with subvars. + +2005-03-21 Mostafa Hagog + + PR middle-end/20177 + * ddg.c (create_ddg_dependence): Ignore reg-anti dependency. + * modulo-sched.c (const_iteration_count): Return on NULL + pre-header. + (print_node_sched_params): Return on NULL dump_file. + (generate_reg_moves): Handle reg-anti dependencies and disregard + closing branch when generating register moves. + (sms_schedule): Mark the SMSed block dirty. + * passes.c (rest_of_handle_sms): Call update_life_info for all + basic-blocks. + * testsuite/gcc.dg/20050321-1.c: New test. + +2005-03-21 Bob Wilson + + * config/xtensa/lib1funcs.asm (__mulsi3): Use symbolic name for ACCLO. + * config/xtensa/xtensa.md (movsi_internal, movhi_internal, + movqi_internal): Likewise. + +2005-03-21 Bob Wilson + + * config/xtensa/xtensa-protos.h: (xtensa_simm7, xtensa_uimm8, + xtensa_uimm8x2, xtensa_uimm8x4, xtensa_ai4const, xtensa_lsi4x4, + xtensa_b4const): Delete prototypes. + (xtensa_simm8, xtensa_simm8x256, xtensa_simm12b, xtensa_b4constu, + xtensa_mask_immediate, xtensa_mem_offset): Update prototypes. + (xtensa_b4const_or_zero, xtensa_const_ok_for_letter_p, + xtensa_extra_constraint): New prototypes. + (add_operand, arith_operand, nonimmed_operand, mem_operand, + mask_operand, extui_fldsz_operand, sext_operand, sext_fldsz_operand, + lsbitnum_operand, branch_operand, ubranch_operand, call_insn_operand, + move_operand, const_float_1_operand, fpmem_offset_operand, + branch_operator, ubranch_operator, boolean_operator): Delete prototypes. + * config/xtensa/xtensa.c (b4const_or_zero): Rename to ... + (xtensa_b4const_or_zero): ...this. Change return type to bool and + argument type to HOST_WIDE_INT. + (xtensa_simm8, xtensa_simm8x256, xtensa_simm12b, + xtensa_mask_immediate): Likewise. + (xtensa_uimm8, xtensa_uimm8x2, xtensa_uimm8x4, xtensa_b4const): + Likewise. Also make these functions static. + (xtensa_simm7, xtensa_ai4const, xtensa_lsi4x4): Delete. + (xtensa_const_ok_for_letter_p): New. + (add_operand, arith_operand, nonimmed_operand, mem_operand, + mask_operand, extui_fldsz_operand, sext_operand, sext_fldsz_operand, + lsbitnum_operand, branch_operand, ubranch_operand, call_insn_operand, + move_operand, const_float_1_operand, fpmem_offset_operand, + branch_operator, ubranch_operator, boolean_operator): Move to + predicates.md. + (smalloffset_mem_p): Inline code from xtensa_lsi4x4. + (xtensa_mem_offset): Change return type to bool. + (xtensa_extra_constraint): New. + (gen_int_relational): Update type of const_range_p function pointer. + Use xtensa_b4const_or_zero. + * config/xtensa/xtensa.h (CONST_OK_FOR_LETTER_P): Define to + xtensa_const_ok_for_letter_p. Update comments. + (EXTRA_CONSTRAINT): Define to xtensa_extra_constraint. + (PREDICATE_CODES): Delete. + * config/xtensa/xtensa.md: Include predicates.md. + * config/xtensa/predicates.md: New file. + +2005-03-21 Kazu Hirata + + * config/v850/v850-protos.h: Remove the prototypes for + reg_or_int9_operand, reg_or_const_operand, + pattern_is_ok_for_prepare, pattern_is_ok_for_dispose, + reg_or_0_operand, reg_or_int5_operand, call_address_operand, + movsi_source_operand, power_of_two_operand, + not_power_of_two_operand, special_symbolref_operand, + pattern_is_ok_for_prologue, pattern_is_ok_for_epilogue, and + register_is_ok_for_epilogue. + * config/v850/v850.c (reg_or_0_operand, reg_or_int5_operand, + reg_or_int9_operand, reg_or_const_operand, + call_address_operand, special_symbolref_operand, + movsi_source_operand, power_of_two_operand, + not_power_of_two_operand, register_is_ok_for_epilogue, + pattern_is_ok_for_epilogue, pattern_is_ok_for_prologue, + pattern_is_ok_for_dispose, pattern_is_ok_for_prepare): Move to + predicates.md. + * config/v850/v850.h (PREDICATE_CODES): Remove. + * config/v850/v850.md: Include predicates.md. + * config/v850/predicates.md: New. + +2005-03-21 Zack Weinberg + + * Makefile.in (BASEVER, DEVPHASE, DATESTAMP) + (BASEVER_c, DEVPHASE_c, DATESTAMP_c) + (BASEVER_s, DEVPHASE_s, DATESTAMP_s, version): Set with :=. + (itoolsdir, itoolsdatadir): Move definition above new first use. + (install-itoolsdirs): New rule. + (install-mkheaders): Depend on install-itoolsdirs, not + install-include-dir. + +2005-03-21 Kazu Hirata + + * tree-into-ssa.c: Remove obsolete comments. + +2005-03-21 Richard Guenther + + * tree-ssa-loop.c (gate_tree_complete_unroll): Run complete + unrolling if -fpeel-loops is specified, too. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): + Remove superfluous check for flag_unroll_loops. + +2005-03-21 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint. + (lrint_optab, llrint_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize lrint_optab and llrint_optab. + * genopinit.c (optabs): Implement lrint_optab using lrintsi2 + pattern and llrint_optab using llrintdi2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LRINT{,F,L} + using lrint_optab and BUILT_IN_LLRINT{,F,L} using llrint_optab. + (expand_builtin): Expand BUILT_IN_LRINT{,F,L} and + BUILT_IN_LLRINT{,F,L} using expand_builtin_mathfn if + flag_unsafe_math_optimizations is set. + +2005-03-21 Paolo Bonzini + + * combine.c (combine_simplify_rtx, simplify_if_then_else, + simplify_logical, if_then_else_cond, known_cond, + simplify_comparison): Adjust calls to reverse_comparison. + Don't use combine_reversed_comparison_code). + (combine_reversed_comparison_code): Remove. + (reversed_comparison): Using reversed_comparison_code, move it... + * jump.c (reversed_comparison): ... here. + * rtl.h (reversed_comparison): Add prototype. + +2005-03-21 Kazu Hirata + + * builtins.c (fold_builtin): Take decomposed arguments of + CALL_EXPR. + * fold-const.c (fold_ternary): Update a call to fold_builtin. + * gimplify.c (gimplify_call_expr): Likewise. + * tree-ssa-ccp.c (ccp_fold, ccp_fold_builtin): Likewise. + * tree.h: Update the prototype of fold_builtin. + +2005-03-21 Paolo Bonzini + + * rtl.h (struct rtx_hooks): Add gen_lowpart_no_emit. + * rtlhooks.c (gen_lowpart_no_emit_general): New. + * rtlhooks-def.h (gen_lowpart_no_emit_general): Declare. + (RTL_HOOKS_GEN_LOWPART_NO_EMIT): New. + * simplify-rtx.c (simplify_binary_operation_1): Use it. + +2005-03-21 Kazu Hirata + + * builtins.c (fold_builtin_1): Take decomposed arguments of + CALL_EXPR. + (fold_builtin): Update a call to fold_builtin_1. + +2005-03-21 Nathan Sidwell + + PR other/20564 + * gcov.c (output_lines): Only output function block summary when + outputting branch information. + * doc/gcov.texi: Document format of preamble and additional block + information lines. + +2005-03-21 Richard Sandiford + + * libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. + (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_TF_MODE, LIBGCC2_HAS_XF_MODE): Make + the defaults false if BITS_PER_UNIT != 8. + (SFtype, SCtype, __fixsfdi, __floatdisf, __fixunssfSI, __fixunssfDI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE rather + than BITS_PER_UNIT != 8. + (L_fixdfdi, L_fixsfdi, L_fixtfdi, L_fixunsdfdi, L_fixunsdfsi) + (L_fixunssfdi, L_fixunssfsi, L_fixunstfdi, L_fixunsxfdi, L_fixunsxfsi) + (L_fixxfdi, L_floatdidf, L_floatdisf, L_floatditf, L_floatdixf): Remove + #undefs. + * libgcc2.c (__fixunssfDI, __fixsfdi, __floatdisf, __fixunssfSI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE. + +2005-03-20 Roger Sayle + + PR middle-end/20539 + * fold-const.c (fold_binary): Fix type mismatch between + TRUTH_{AND,OR,XOR}_EXPR nodes an their operands' types. + (fold_binary) : Avoid calling invert_truthvalue + for non-truth-valued expressions. + + * c-common.c (c_common_truthvalue_conversion): Handle ERROR_MARK + and FUNCTION_DECL in the main switch. + : When changing the result type of these tree nodes, + we also need to convert their operands to match. + : Likewise. + +2005-03-21 Joseph S. Myers + + * c-common.c (lvalue_or_else): Replace by lvalue_error; only give + diagnostic without checking whether an lvalue. + * c-common.h (lvalue_p): Remove. + (enum lvalue_use): Update comment. + (lvalue_or_else): Replace by lvalue_error. + * c-typeck.c (lvalue_p): Make static. + (lvalue_or_else): New. Call lvalue_error. + +2005-03-21 Alan Modra + + * config/rs6000/rs6000.c (rs6000_parm_start): New function. + (function_arg_advance): Use rs6000_parm_start. + (function_arg, rs6000_arg_partial_bytes): Likewise. + +2005-03-20 Joseph S. Myers + + * c-common.c (check_case_value): Adjust comment about stripping + NOPs. + (handle_vector_size_attribute): Don't strip NON_LVALUE_EXPR. + * c-typeck.c (default_conversion, convert_arguments, + build_modify_expr, convert_for_assignment, store_init_value, + digest_init): Use STRIP_TYPE_NOPS instead of stripping nops + manually. Remove inaccurate comments. + +2005-03-20 Roger Sayle + Joseph S. Myers + + * varasm.c (do_assemble_alias): Restore comment describing function. + Annotate the target parameter as potentially unused. + +2005-03-20 Marek Michalkiewicz + + PR target/18551 + * config/avr/avr.c (avr_output_function_prologue): Do not use + current_function_name() in a label, use a local label instead. + +2005-03-20 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_generate_compare): Test + flag_finite_math_only, not flag_unsafe_math_optimizations. + +2005-03-20 Kazu Hirata + + * builtins.c (fold_builtin_1): Update a call to + targetm.fold_builtin. + * hooks.c (hook_tree_tree_bool_null): Rename to + hook_tree_tree_tree_bool_null. Take one more argument of type + tree. + * hooks.h: Update the prototype of hook_tree_tree_bool_null. + * target-def.h (TARGET_FOLD_BUILTIN): Define it as + hook_tree_tree_tree_bool_null. + * target.h (gcc_target): Update the prototype of fold_builtin. + * config/alpha/alpha.c (alpha_fold_builtin): Take decomposed + arguments of CALL_EXPR. + * doc/tm.texi (TARGET_FOLD_BUILTIN): Update. Mention the + new prototype. + +2005-03-20 Jan Hubicka + + * cgraph.h (cgraph_node): Add prev_clone pointer. + * cgraph.c (cgraph_remove_node): Remove from doubly linked chain. + (cgraph_clone_node): Produce doubly linked chain. + +2005-03-20 Joseph S. Myers + + * c-common.c (handle_aligned_attribute, check_function_sentinel, + get_nonnull_operand, handle_sentinel_attribute, + check_function_arguments_recurse): Do not strip NOPS from + INTEGER_CSTs. + * c-decl.c (check_bitfield_type_and_width, build_enumerator): + Likewise. + * c-format.c (get_constant): Likewise. + * c-parser.c (c_parser_postfix_expression): Likewise. + * c-typeck.c (set_init_index): Likewise. + (convert_arguments): Don't check for NOP_EXPR containing integer + constant. + +2005-03-20 Kazu Hirata + + * builtins.c (fold_fixed_mathfn, fold_builtin_trunc, + fold_builtin_floor, fold_builtin_ceil, fold_builtin_lround): + Take decomposed arguments of CALL_EXPR. + (fold_builtin_1): Update calls to the functions mentioned + above. + +2005-03-20 Joseph S. Myers + + * c-decl.c (check_bitfield_type_and_width): Require bit-field + width to have integer type. + (build_enumerator): Require enumerator value to have integer type. + +2005-03-19 Joseph S. Myers + + * doc/extend.texi (__builtin_inf): Move statement about INFINITY + to __builtin_inff. + +2005-03-19 Joseph S. Myers + + * c.opt (ansi, std=iso9899:1990, std=iso9899:1999, + std=iso9899:199x): Correct descriptions. + +2005-03-19 Joseph S. Myers + + * config.gcc: Consistently use solaris2.1[0-9]* instead of + solaris2.1[0-9]. + +2005-03-19 Kazu Hirata + + * builtins.c (fold_builtin_memcpy): Take decomposed arguments + of CALL_EXPR. + (expand_builtin_memcpy, fold_builtin_1): Update calls to + fold_builtin_memcpy. + + * builtins.c (fold_trunc_transparent_mathfn): Take decomposed + arguments of CALL_EXPR. + (fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil, + fold_builtin_found, fold_builtin_1): Update calls to + fold_trunc_transparent_mathfn. + +2005-03-19 John David Anglin + + PR middle-end/20493 + * fold-const.c (fold_widened_comparison): Don't optimize casts of + function pointers on targets that require function pointer + canonicalization. + (fold_sign_changed_comparison): Likewise. + +2005-03-19 Bernd Schmidt + + * combine.c (try_combine): When changing the mode of a hard reg, make + sure that doing so is valid. + +2005-03-19 Richard Sandiford + + * config/avr/avr.c (avr_init_stack, avr_mcu_name): Make static. + (TARGET_HANDLE_OPTION): Override default. + (avr_handle_option): New function. + * config/avr/avr.h (MASK_ALL_DEBUG, MASK_ORDER_1, MASK_INSN_SIZE_DUMP) + (MASK_ORDER_2, MASK_NO_TABLEJUMP, MASK_INT8, MASK_NO_INTERRUPTS) + (MASK_CALL_PROLOGUES, MASK_TINY_STACK, MASK_SHORT_CALLS) + (TARGET_ORDER_1, TARGET_ORDER_2, TARGET_INT8, TARGET_NO_INTERRUPTS) + (TARGET_INSN_SIZE_DUMP, TARGET_CALL_PROLOGUES, TARGET_TINY_STACK) + (TARGET_NO_TABLEJUMP, TARGET_SHORT_CALLS, TARGET_ALL_DEBUG) + (TARGET_SWITCHES, avr_init_stack, avr_mcu_name) + (TARGET_OPTIONS): Delete. + * config/avr/avr.opt: New file. + +2005-03-18 2005-03-18 Kazu Hirata + + * config/m32r/m32r-protos.h: Remove the prototypes for + call_address_operand, symbolic_operand, seth_add3_operand, + cmp_int16_operand, uint16_operand, reg_or_int16_operand, + reg_or_uint16_operand, reg_or_cmp_int16_operand, + two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + large_insn_p, conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand, extend_operand, + reg_or_eq_int16_operand, int8_operand, and + reg_or_zero_operand. + * config/m32r/m32r.c (call_address_operand, symbolic_operand, + seth_add3_operand, int8_operand, cmp_int16_operand, + uint16_operand, reg_or_int16_operand, reg_or_uint16_operand, + reg_or_eq_int16_operand, reg_or_cmp_int16_operand, + reg_or_zero_operand, two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + extend_operand, small_insn_p, large_insn_p, + conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand): Move to predicates.md. + (MAX_MOVE_BYTES): Move to m32r.h. + * config/m32r/m32r.h (PREDICATE_CODES): Remove. + * config/m32r/m32r.md: Include predicates.md. + * config/m32r/predicates.md: New. + +2005-03-18 James E Wilson + + PR c++/19769 + * dwarf2out.c (declare_in_namespace): Ignore decls with an abstract + origin. + +2005-03-18 Kazu Hirata + + * config/mn10300/mn10300-protos.h: Remove the prototypes for + call_address_operand, const_8bit_operand. + * config/mn10300/mn10300.c (call_address_operand, + const_8bit_operand, const_1f_operand): Move to predicates.md. + * config/mn10300/mn10300.h (PREDICATE_CODES): Remove. + * config/mn10300/mn10300.md: Include predicates.md. + * config/mn10300/predicates.md: New. + +2005-03-18 Joseph S. Myers + + * c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for + declarations in diagnostics and %E for identifiers, not %s. + +2005-03-18 Jan Hubicka + Dale Johannesen + + * basic-block.h (scale_bbs_frequencies_int, + scale_bbs_frequencies_gcov_type): Declare. + * cfg.c (RDIV): New macro. + (update_bb_frequency_for_threading): Fix. + * basic-block.h (scale_bbs_frequencies_int, + scale_bbs_frequencies_gcov_type): New. + * cfgloopmanip.c (scale_bbs_frequencies): Kill. + (scale_loop_frequencies, duplicate_loop_to_header_edge): Use + scale_bbs_frequencies_int. + * tree-ssa-loop-ch.c (copy_loop_headers): Fix profiling info. + +2005-03-18 Kazu Hirata + + * config/m32r/m32r-protos.h: Remove the prototypes for + call_address_operand, symbolic_operand, seth_add3_operand, + cmp_int16_operand, uint16_operand, reg_or_int16_operand, + reg_or_uint16_operand, reg_or_cmp_int16_operand, + two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + large_insn_p, conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand, extend_operand, + reg_or_eq_int16_operand, int8_operand, and + reg_or_zero_operand. + * config/m32r/m32r.c (call_address_operand, symbolic_operand, + seth_add3_operand, int8_operand, cmp_int16_operand, + uint16_operand, reg_or_int16_operand, reg_or_uint16_operand, + reg_or_eq_int16_operand, reg_or_cmp_int16_operand, + reg_or_zero_operand, two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + extend_operand, small_insn_p, large_insn_p, + conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand): Move to predicates.md. + (MAX_MOVE_BYTES): Move to m32r.h. + * config/m32r/m32r.h (PREDICATE_CODES): Remove. + * config/m32r/m32r.md: Include predicates.md. + * config/m32r/predicates.md: New. + + * config/pa/pa-protos.h: Add prototypes for magic_milli and + shadd_constant_p. + * config/pa/pa.c (reg_or_0_operand, call_operand_address, + symbolic_operand, symbolic_memory_operand, + reg_or_0_or_nonsymb_mem_operand, reg_before_reload_operand, + indexed_memory_operand, move_dest_operand, move_src_operand, + prefetch_cc_operand, prefetch_nocc_operand, + reg_or_cint_move_operand, pic_label_operand, fp_reg_operand, + arith_operand, arith11_operand, pre_cint_operand, + post_cint_operan, arith_double_operand, ireg_or_int5_operand, + ireg_operand, int5_operand, uint5_operand, int11_operand, + uint32_operand, arith5_operand, and_operand, ior_operand, + lhs_lshift_operand, lhs_lshift_cint_operand, arith32_operand, + pc_or_label_operand, div_operand, plus_xor_ior_operator, + shadd_operand, movb_comparison_operator, + cmpib_comparison_operator): Move to predicates.md. + (magic_milli, shadd_constant_p): Make it extern. + * config/pa/pa.h (PREDICATE_CODES): Remove. + * config/pa/pa.md: Include predicates.md. + * config/pa/predicates.md: New. + + * config/v850/v850.h (PREDICATE_CODES): Remove a nonexistent + predicate. + +2005-03-18 Kazu Hirata + + * hooks.c, hooks.h, intl.c, opts.h, prefix.c, tree-gimple.c, + config/alpha/ev4.md, config/alpha/ev5.md, config/alpha/ev6.md, + config/alpha/freebsd.h, config/alpha/linux.h, + config/alpha/netbsd.h, config/alpha/osf5.h, + config/alpha/vms.h, config/arc/arc.c, config/arc/arc.h, + config/h8300/h8300-protos.h, config/h8300/h8300.c, + config/h8300/h8300.h, config/ia64/unwind-ia64.c, + doc/cppopts.texi: Update copyright. + +2005-03-18 Jan Hubicka + + PR middle-end/20225 + * cgraph.c (cgraph_mark_reachable_node): Assert that it is not called + too late. + * varasm.c (find_decl_and_mark_needed): Mark needed only when not + called too late. + +2005-03-18 Kazu Hirata + + * tree-into-ssa.c (find_idf): Use VEC_quick_push instead of + VEC_safe_push. + +2005-03-18 Paolo Bonzini + + * combine.c (gen_binary): Remove. + (known_cond, simplify_shift_const, find_split_point, + combine_simplify_rtx, simplify_if_then_else, simplify_set, + simplify_logical, expand_field_assignment, extract_left_shift, + force_to_mode, if_then_else_cond, apply_distributive_law, + simplify_and_const_int, simplify_shift_const, gen_lowpart_for_combine, + simplify_comparison, reversed_comparison): Replace with + simplify_gen_binary, simplify_gen_relational or + distribute_and_simplify_rtx. + (distribute_and_simplify_rtx): New function. + +2005-03-18 Alexey Neyman + Paolo Bonzini + + * calls.c (setjmp_call_p, special_function_p): Update comments + at the head of the functions. + +2005-03-18 Jan Hubicka + + * tree-cfg.c (fold_cond_expr_cond): Use boolean types for condition. + + * cgraph.c (cgraph_remove_node): Avoid loop in code deciding whether + function body should be released; do not proactively release function + bodies in non-unit-at-a-time mode. + +2005-03-18 Ralf Corsepius + + * config/i386/t-rtems-i386 (MULTILIBS): Remove k6, athlon, + mno-fp-ret-in-387 multilib variants. + +2005-03-18 Richard Sandiford + + * common.opt (m): Remove. + * opts.c (handle_option): Pass 'm' options to set_target_switch if + table lookup fails. + (common_handle_option): Remove OPT_m case. + +2005-03-18 Kazu Hirata + + * builtins.c (fold_builtin_bitop): Take decomposed arguments + of CALL_EXPR. + (fold_builtin_1): Update a call to fold_builtin_bitop. + + * builtins.c (fold_builtin_signbit): Take decomposed arguments + of CALL_EXPR. + (fold_builtin_1): Update a call to fold_builtin_signbit. + +2005-03-17 Dorit Naishlos + + PR tree-optimization/20474 + * tree-vect-analyze.c (vect_analyze_pointer_ref_access): Check the + size_type of the relevant pointer. Check for COMPLETE_TYPE_P. + +2005-03-17 Kazu Hirata + + * config/h8300/h8300-protos.h: Remove prototypes for + general_operand_src, general_operand_dst, single_one_operand, + single_zero_operand, call_insn_operand, + two_insn_adds_subs_operand, small_call_insn_operand, + jump_address_operand, bit_operand, bit_memory_operand, + stack_pointer_operand, const_int_gt_2_operand, + const_int_ge_8_operand, const_int_qi_operand, + const_int_hi_operand, incdec_operand, bit_operator, + nshift_operator, eqne_operator, gtle_operator, + gtuleu_operator, iorxor_operator. + Add prototypes for h8sx_shift_type h8sx_classify_shift and + h8300_ldm_stm_parallel. + * config/h8300/h8300.c (h8sx_shift_type,): Move to + h8300-protos.h. + (SYMBOL_FLAG_FUNCVEC_FUNCTION, SYMBOL_FLAG_EIGHTBIT_DATA, + SYMBOL_FLAG_TINY_DATA): Move to h8300.h. + (h8300_ldm_stm_parallel): Make it extern. + (h8300_ldm_parallel, h8300_stm_parallel, + h8300_return_parallel, general_operand_src, + general_operand_dst, h8300_dst_operand, h8300_src_operand, + nibble_operand, reg_or_nibble_operand, single_one_operand, + single_zero_operand, call_insn_operand, + two_insn_adds_subs_operand, small_call_insn_operand, + jump_address_operand, bit_operand, bit_memory_operand, + stack_pointer_operand, const_int_gt_2_operand, + const_int_ge_8_operand, const_int_qi_operand, + const_int_hi_operand, incdec_operand, eqne_operator, + gtle_operator, gtuleu_operator, iorxor_operator, bit_operator, + h8sx_binary_memory_operator, h8sx_unary_memory_operator, + h8sx_unary_shift_operator, h8sx_binary_shift_operator, + nshift_operator): Move to predicates.md. + * config/h8300/h8300.h (PREDICATE_CODES): Remove. + * config/h8300/h8300.md: Include predicates.md. + * config/h8300/predicates.md: New. + +2005-03-17 Richard Henderson + + * config.gcc (ia64*-*-hpux*): Add extra_options. + * config/ia64/hpux.h (SUBTARGET_SWITCHES): Remove. + (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. + * config/ia64/ia64.c (ia64_fixed_range_string): Remove. + (ia64_tls_size_string, ia64_tune_string): Remove. + (ia64_tune): Init to PROCESSOR_ITANIUM2. + (TARGET_DEFAULT_TARGET_FLAGS): New. + (TARGET_HANDLE_OPTION): New. + (ia64_override_options): Move options parsing ... + (ia64_handle_option): ... here. New. + * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, + MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, + MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, + MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, + MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, + MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, + MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, + TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, + TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, + TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, + TARGET_INLINE_INT_DIV_LAT, TARGET_INLINE_INT_DIV_THR, + TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, TARGET_INLINE_SQRT_LAT, + TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT, TARGET_DWARF2_ASM, + TARGET_EARLY_STOP_BITS): Remove. + (TARGET_ILP32): Default false. + (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS): Remove. + (enum ia64_inline_type): New. + (TARGET_DEFAULT): Remove MASK_INLINE_FLOAT_DIV_THR. + * config/ia64/ia64.md: Update for new definitions of + TARGET_INLINE_INT_DIV, TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_SQRT. + * config/ia64/ia64.opt: New file. + * config/ia64/ilp32.opt: New file. + +2005-03-17 H.J. Lu + + PR target/18380 + * config/ia64/unwind-ia64.c (_Unwind_FindTableEntry): Removed. + +2005-03-17 Kazu Hirata + + * config/h8300/h8300.c (h8300_init_once): Use MASK_H8300S_1 + instead of MASK_H8300S. + * config/h8300/h8300.h (target_flags, MASK_H8300S, MASK_MAC, + MASK_INT32, MASK_ADDRESSES, MASK_QUICKCALL, MASK_SLOWBYTE, + MASK_NORMAL_MODE, MASK_RELAX, MASK_H8300H, MASK_ALIGN_300, + MASK_H8300SX, TARGET_INT32, TARGET_ADDRESSES, + TARGET_QUICKCALL, TARGET_SLOWBYTE, TARGET_H8300H, + TARGET_H8300XS, TARGET_NORMAL_MODE, TARGET_ALIGN_300, + TARGET_SWITCHES): Remove. + (TARGET_H8300S): Redefine interms of TARGET_H8300S_1 and + TARGET_H8300SX. + * config/h8300/h8300.opt: New. + + * config/alpha/alpha.opt, config/arc/arc.opt, + config/h8300/h8300.opt, config/mips/mips.opt: Add copyright + notices. + +2005-03-17 Ian Lance Taylor + + * gmon.c: Remove. + +2005-03-17 Richard Sandiford + + * config/arc/arc.c (arc_cpu_string): Make static. Default to "base" + (arc_text_string, arc_data_string, arc_rodata_string): Make static. + (TARGET_HANDLE_OPTION): Override default. + (arc_handle_option): New function. + (arc_init): Remove code to set arch_cpu_string. + * config/arc/arc.h (target_flags, TARGET_MASK_MANGLE_CPU) + (TARGET_MANGLE_CPU, TARGET_MASK_MANGLE_CPU_LIBGCC) + (TARGET_MANGLE_CPU_LIBGCC, TARGET_MASK_ALIGN_LOOPS, TARGET_ALIGN_LOOPS) + (TARGET_MASK_BIG_ENDIAN, TARGET_BIG_ENDIAN, TARGET_MASK_NO_COND_EXEC) + (TARGET_NO_COND_EXEC, TARGET_SWITCHES, TARGET_DEFAULT) + (SUBTARGET_SWITCHES, arc_cpu_string, arc_text_string, arc_data_string) + (arc_rodata_string, TARGET_OPTIONS): Delete. + * config/arc/arc.opt: New file. + +2005-03-17 Richard Henderson + + * doc/extend.texi (Weak Pragmas): New section. + (attribute alias): Clarify that target must be in the same + translation unit. + +2005-03-17 Richard Henderson + + * config/alpha/alpha.opt: New file. + * config/alpha/alpha.c (alpha_tune): New. Rename all existing uses + of alpha_cpu. + (alpha_cpu_string, alpha_tune_string, alpha_tp_string, + alpha_fprm_string, alpha_fptm_string): Make static. + (alpha_tls_size_string): Remove. + (alpha_handle_option): New. + (override_options): Update for alpha_cpu/alpha_tune split. + (alpha_file_start): Likewise. + (TARGET_DEFAULT_TARGET_FLAGS): New. + (TARGET_HANDLE_OPTION): New. + * config/alpha/alpha.h (alpha_tune): Declare. + (MASK_FP, MASK_FPREGS, TARGET_FPREGS, MASK_GAS, TARGET_GAS, + MASK_IEEE_CONFORMANT, TARGET_IEEE_CONFORMANT, MASK_IEEE, TARGET_IEEE, + MASK_IEEE_WITH_INEXACT, TARGET_IEEE_WITH_INEXACT, MASK_BUILD_CONSTANTS, + TARGET_BUILD_CONSTANTS, MASK_FLOAT_VAX, TARGET_FLOAT_VAX, MASK_BWX, + TARGET_BWX, MASK_MAX, TARGET_MAX, MASK_FIX, TARGET_FIX, MASK_CIX, + TARGET_CIX, MASK_EXPLICIT_RELOCS, TARGET_EXPLICIT_RELOCS, + MASK_SMALL_DATA, TARGET_SMALL_DATA, MASK_TLS_KERNEL, TARGET_TLS_KERNEL, + MASK_SMALL_TEXT, TARGET_SMALL_TEXT, MASK_LONG_DOUBLE_128, + TARGET_LONG_DOUBLE_128, MASK_CPU_EV5, TARGET_CPU_EV5, MASK_CPU_EV6, + TARGET_CPU_EV6, MASK_SUPPORT_ARCH): Remove. + (TARGET_SWITCHES, TARGET_OPTIONS): Remove. + (TARGET_DEFAULT): Remove MASK_FP. + (TARGET_FP): Redefined based on TARGET_SOFT_FP. + (TARGET_SUPPORT_ARCH): Default on if HAVE_AS_EXPLICIT_RELOCS. + (alpha_cpu_string, alpha_tune_string, alpha_fprm_string, + alpha_fptm_string, alpha_tp_string, alpha_mlat_string, + alpha_tls_size_string): Remove. + * config/alpha/alpha.md (prefetch): Use alpha_cpu. + (attribute tune): Rename from attribute cpu. + * config/alpha/ev4.md: Update to match. + * config/alpha/ev5.md, config/alpha/ev6.md: Likewise. + * config/alpha/freebsd.h (TARGET_DEFAULT): Remove MASK_FP. + * config/alpha/linux.h (TARGET_DEFAULT): Likewise. + * config/alpha/netbsd.h (TARGET_DEFAULT): Likewise. + * config/alpha/osf5.h (TARGET_DEFAULT): Likewise. + * config/alpha/vms.h (TARGET_DEFAULT): Likewise. + +2005-03-16 James E. Wilson + + * config/ia64/ia64.c (issue_nops_and_insn): Check first_insn attribute, + and return without creating new state if before_nops_num is nonzero. + * config/ia64/ia64.md (first_insn): New attribute. + (alloc): Set it to yes. + +2005-03-16 Daniel Berlin + + * tree-vectorizer.c (new_vec_stmt_info): Initialize + STMT_VINFO_SUBVARS to NULL. + * tree-vect-analyze.c (vect_analyze_data_refs): Ditto. + +2005-03-16 Dale Johannesen + + * rtlanal.c (find_first_parameter_load): Rewrite to + return actual first param load or the call if none, + instead of first in block, when not all loads exist. + +2005-03-16 Roger Sayle + + * optabs.c (expand_copysign_absneg): Make static. + * optabs.h (expand_copysign_absneg): Delete prototype. + * config/rs6000/rs6000.md (copysigntf3): Delete pattern. + +2005-03-16 Richard Henderson + + PR middle-end/15700 + * varasm.c (struct alias_pair): Rename from struct output_def_pair. + (alias_pairs): Rename from output_defs. + (find_decl_and_mark_needed): Split out from assemble_alias. + (do_assemble_alias): New. + (assemble_output_def): Remove. + (finish_aliases_1, finish_aliases_2): New. + (process_pending_assemble_output_defs): Remove. + (assemble_alias): Defer aliases for which we don't yet have a + non-external decl for the target symbol. + * passes.c (rest_of_decl_compilation): Register variables with cgraph. + * cgraphunit.c (cgraph_finalize_compilation_unit): Use finish_aliases_1. + * toplev.c (compile_file): Use finish_aliases_2 instead of + process_pending_assemble_output_defs. + * tree.h (finish_aliases_1, finish_aliases_2): Declare. + (process_pending_assemble_output_defs): Remove. + +2005-03-16 Daniel Berlin + + Fix PR tree-optimization/20489 + + * tree-ssa-alias.c (push_fields_onto_fieldstack): DTRT + for empty structures. + +2005-03-16 Daniel Berlin + + Fix PR tree-optimization/20490 + + * tree-ssa-pre.c (create_expression_by_pieces): Use + force_gimple_operand on result of fold. + +2005-03-16 Andrew Pinski + + * config/i386/emmintrin.h (_mm_extract_epi16): Correct the number + of closing parenthesis. + +2005-03-16 Kazu Hirata + + * builtins.c (expand_movstr): Update a call to + fold_builtin_strcpy. + (expand_builtin_strncpy): Update a call to + fold_builtin_strncpy. + (fold_builtin_strcpy, fold_builtin_strncpy): Take decomosed + arguments of CALL_EXPR. + (fold_builtin_1): Update calls to fold_builtin_strcpy and + fold_builtin_strncpy. + * tree-ssa-ccp.c (ccp_fold_builtin): Likewise. + * tree.h: Update the prototypes of fold_builtin_strcpy and + fold_builtin_strncpy. + +2005-03-16 Steven Bosscher + Dorit Naishlos + + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Copy + UNITS_PER_SIMD_WORD to a local variable to avoid a "division by zero" + error. + +2005-03-16 Steven Bosscher + + * tree-inline.c (walk_type_fields, walk_tree, + walk_tree_without_duplicates): Move from here... + * tree.c: ...to here. + +2005-03-15 Zack Weinberg + + * BASE-VER, DATESTAMP, DEV-PHASE: New files. + * Makefile.in (gcc_version, gcc_version_trigger, ): Delete. + (BASEVER, DEVPHASE, DATESTAMP, BASEVER_c, DEVPHASE_c, DATESTAMP_c) + (BASEVER_s, DEVPHASE_s, DATESTAMP_s): New variables. + (version): Define using $(BASEVER_c). + (Makefile, config.status, build/gcov-iov.o): No longer depends on + version.c. + (version.o): Depend on version files; add custom generation command. + (prefix.o): Define BASEVER on command line. + (s-iov): Depend on version files; adjust command. + (TEXI_CPP_FILES, TEX_IGCC_FILES, TEXI_GCCINT_FILES, TEXI_CPPINT_FILES): + Add gcc-vers.texi. + (gcc-vers.texi): New rule. + (doc/%.info, doc/%.dvi): Add -I . to command line. + (doc/gccinstall.dvi): Likewise. + (PACKAGE): Delete. All uses replaced with "gcc". + * aclocal.m4: Do not include gcc-version.m4. + * configure.ac: Do not invoke TL_AC_GCC_VERSION. + Do not AC_SUBST nor AC_DEFINE PACKAGE or VERSION. + Set is_release based on contents of DEV-PHASE. + Set gcc_version based on contents of BASE-VER. + Define WIN32_REGISTRY_KEY only if the user overrode the default. + * config.in, configure: Regenerate. + * gccbug.in: Determine version of GCC in use at runtime. + * gcov-iov.c: Get version number and development phase from + command line, not by including version.c. + * intl.c: Replace all uses of PACKAGE with "gcc". + * libada-mk.in: Delete unused "gcc_version" variable. + * prefix.c: Default WIN32_REGISTRY_KEY to BASEVER. + * version.c: (VERSUFFIX): New hook for redistributors; adjust + commentary to match. + (version_string): Put together from pieces. + * config/alpha/x-vms: Do not use $(gcc_version). + * config/i386/t-nwld: Likewise. + * doc/include/gcc-common.texi: Include gcc-vers.texi for + version-GCC and DEVELOPMENT. + +2005-03-15 Roger Sayle + + PR tree-optimization/17454 + * tree.c (tree_size): Add case for TREE_BINFO. + * fold-const.c (fold_checksum_tree): Only clear the overloaded + field TYPE_CACHED_VALUES if TYPE_CACHED_VALUES_P is set. + +2005-03-15 Roger Sayle + + * optabs.c (expand_doubleword_mult): Avoid clobbering op0 and + op1 whilst expanding the signed widenening multiply variant. + +2005-03-15 Richard Sandiford + + * toplev.c (display_target_options): Avoid unused variable warning if + TARGET_SWITCHES and TARGET_OPTIONS are both undefined. + * config/mips/mips.c (mips_arch_string, mips_tune_string): Make static. + (mips_isa_string, mips_abi_string, mips_fix_vr4130_string): Delete. + (mips_isa): Initialize to MIPS_ABI_DEFAULT. + (mips_isa_info): New variable. + (mips_parse_cpu): Remove the first argument and leave the caller + to report errors. + (TARGET_HANDLE_OPTION): Override default. + (mips_handle_option): New function. Move option validation code from... + (override_options): ...here. Update calls to mips_parse_cpu. + * config/mips/mips.h (mips_arch_string, mips_tune_string) + (mips_isa_string, mips_abi_string, TARGET_OPTIONS) + (SUBTARGET_TARGET_OPTIONS): Delete. + * config/mips/mips.opt (mabi=, march=, mflush-func=, mips) + (mno-flush-func, mtune=): New options. + +2005-03-15 Roger Sayle + Richard Henderson + + * real.c (c4x_single_format, c4x_extended_format): Provide values + for signbit_ro for c4x's single and extended floating point formats. + * optabs.c (expand_copysign): Use the floating point format's + signbit_ro for expanding via expand_copysign_absneg, and it's + signbit_rw field for expanding via expand_copysign_bit. + +2005-03-15 Dorit Naishlos + + * tree-vectorizer.h (unknown_alignment_for_access_p): Replaced by + known_alignment_for_access_p. + (known_alignment_for_access_p): New. + (do_peeling_for_alignment): Field made int instead of bool and renamed + to peeling_for_alignment. + (LOOP_DO_PEELING_FOR_ALIGNMENT): Renamed to LOOP_PEELING_FOR_ALIGNMENT. + * tree-vect-analyze.c (vect_determine_vectorization_factor): New. This + functionality used to be in vect_analyze_operations. + (vect_analyze_operations): Code to determine vectorization factor was + moved to vect_determine_vectorization_factor. + (vect_enhance_data_refs_alignment): Update to correct alignment when it + is known instead of -1. Set LOOP_PEELING_FOR_ALIGNMENT to peeling + factor. + (vect_analyze_loop): Call vect_determine_vectorization_factor (used to + be part of vect_analyze_operations). + * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Use fold when + creating the guard condition, as the number of iterations may be + constant. + (slpeel_tree_peel_loop_to_edge): Use new name of + LOOP_DO_PEELING_FOR_ALIGNMENT. Set it to 0 instead of false. + * tree-vect-transform.c (vect_gen_niters_for_prolog_loop): Handle known + alignment case more efficiently. Use LOOP_PEELING_FOR_ALIGNMENT. + (vect_do_peeling_for_alignment): Use fold. + (vect_transform_loop): Use new name of LOOP_DO_PEELING_FOR_ALIGNMENT. + + (vect_update_inits_of_dr): Renamed to + vect_update_init_of_dr. + (vect_update_inits_of_drs): Use new name of vect_update_inits_of_dr. + (vectorizable_store): Fix assertion to use == instead of =. + +2005-03-15 Daniel Jacobowitz + + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Don't clear + call_used_regs for wCG registers. + +2005-03-15 Ulrich Weigand + + * config/s390/s390.c (s390_secondary_output_reload_class): Adapt check + for non-offsettable memory references to cope with outstanding reload + replacements, take 2. + +2005-03-15 Uros Bizjak + + PR target/18668 + * config/i386/i386.h (x86_fisttp): New. + (TARGET_FISTTP): New macro. + * config/i386/i386.c (x86_fisttp): Set for NOCONA. + (output_fix_trunc): Add fisttp parameter. Generate fisttp x87 + instruction when fisttp flag is set. + * config/i386/i386-protos.h (output_fix_trunc): Change declaration. + + * config/i386/i386.md (type attribute): Add fisttp. + (unit attribute): Set to i387 for fisttp type. + (X87MODEF, X87MODEI, SSEMODEF, SSEMODEI24): New mode macros. + (fix_truncxfdi2, fix_truncxfsi2): Generate fisttp patterns for + TARGET_FISTTP. + (fix_truncdfdi2, fix_truncsfdi2, fix_truncdfsi2, fix_truncsfsi2): + Generate fisttp patterns for TARGET_FISTTP. Implement using mode + macros. + (fix_truncxfhi2, fix_truncdfhi2, fix_truncsfhi2): Generate fisttp + patterns for TARGET_FISTTP. Enable patterns for + (TARGET_FISTTP && !TARGET_SSE_MATH). Implement using mode macros. + (fix_trunc_i387_fisttp_1, fix_trunc_i387_fisttp, + fix_trunc_i387_fisttp_with_temp): New instruction patterns to + implement fisttp x87 insn. + (fix_trunc*_i387_fisttp splitters): New patterns. + (*fix_truncdi_i387, *fix_truncsi_i387, *fix_trunchi_i387): + Rename to *fix_trunc_i387_1. Implement using mode macros. + Disable patterns for TARGET_FISTTP. Add comment about FLAGS_REG + clobber. + (fix_truncdi_memory, fix_truncdi_nomemory, fix_trunchi_nomemory): + Rename to fix_trunc_i387 and fix_trunc_i387_with_temp. + Implement using mode macros. Disable patterns for TARGET_FISTTP. + (fix_truncsi_memory, fix_truncsi_nomemory, fix_trunchi_memory, + fix_trunchi_nomemory): Rename to fix_trunc_i387 and + fix_trunc_i387_with_temp. Implement using mode macros. + Disable patterns for TARGET_FISTTP. + (fix_trunc*_i387 splitters): Implement usign mode macros. + (fix_truncdfdi_sse, fix_truncsfdi_sse, fix_truncdfsi_sse, + fix_truncsfsi_sse): Disable for (TARGET_FISTTP && !TARGET_SSE_MATH). + (fix_trunx*_sse peephole2s): Implement using mode macros. + +2005-03-15 J"orn Rennecke + + PR rtl-optimization/20291 + * combine.c (try_combine): If splitting fails, re-try with + original combined pattern, i.e. before clobber stripping. + +2005-03-14 Eric Christopher + + * config/mips/mips.h (DWARF_CIE_DATA_ALIGNMENT): Change for + STACK_GROWS_DOWNWARD. + +2005-03-14 Roger Sayle + + * real.h (struct real_format): Split the signbit field into two + two fields, signbit_ro and signbit_rw. + * real.c (ieee_single_format, mips_single_format, ieee_double_format, + mips_double_format, ieee_extended_motorola_format, + ieee_extended_intel_96_format, ieee_extended_intel_96_round_53_format, + ieee_extended_intel_128_format, ibm_extended_format, + mips_extended_format, ieee_quad_format, mips_quad_format, + vax_f_format, vax_d_format, vax_g_format, i370_single_format, + i370_double_format, c4x_single_format, c4x_extended_format, + real_internal_format): Update initializers for new field. + * builtins.c (expand_builtin_signbit): Use signbit_ro field of the + real_format structure. + * optabs.c (expand_absneg_bit, expand_copysign): Use signbit_rw + field of the real_format structure. + +2005-03-14 Daniel Berlin + + Fix PR tree-optimization/20458 + + * tree-flow-inline.h (mark_call_clobbered): Don't fiddle + DECL_EXTERNAL on STRUCT_FIELD tags. + (clear_call_clobbered): Ditto. + * tree-ssa-operands.c (note_addressable): Make sure the original + variable doesn't slip into the addressable list if we have + subvars. + * tree-tailcall.c (suitable_for_tail_opt_p): Look at STRUCT_FIELD + tags too. + +2005-03-14 Geoffrey Keating + + * doc/cppopts.texi (-fexec-charset): Add concept index entry. + (-fwide-exec-charset): Likewise. + (-finput-charset): Likewise. + * doc/invoke.texi (Warning Options): Document -Wnormalized=. + * c-opts.c (c_common_handle_option): Handle -Wnormalized=. + * c.opt (Wnormalized): New. + +2005-03-14 Devang Patel + + * doc/invoke.texi: Add reference to Visibility document. + +2005-03-14 Richard Sandiford + + * config.gcc (mips*-*-*): Rename MASK_SPLIT_ADDRS to + MASK_SPLIT_ADDRESSES. + * config/mips/mips.h (target_flags, mips_fix_vr4130_string): Delete. + (MASK_INT64, MASK_LONG64, MASK_SPLIT_ADDR, MASK_NO_FUSED_MADD) + (MASK_EXPLICIT_RELOCS, MASK_MEMCPY, MASK_SOFT_FLOAT) + (MASK_FLOAT64, MASK_ABICALLS, MASK_XGOT, MASK_LONG_CALLS) + (MASK_64BIT, MASK_EMBEDDED_DATA, MASK_BIG_ENDIAN) + (MASK_SINGLE_FLOAT, MASK_MAD, MASK_4300_MUL_FIX, MASK_MIPS16) + (MASK_NO_CHECK_ZERO_DIV, MASK_BRANCHLIKELY) + (MASK_UNINIT_CONST_IN_RODATA, MASK_FIX_R4000, MASK_FIX_R4400) + (MASK_FIX_SB1, MASK_FIX_VR4120, MASK_VR4130_ALIGN) + (MASK_FP_EXCEPTIONS, MASK_DIVIDE_BREAKS, MASK_PAIRED_SINGLE) + (MASK_MIPS3D, MASK_SYM32, MASK_DEBUG, MASK_DEBUG_D) + (MASK_MIPS_TFILE, TARGET_INT64, TARGET_LONG64, TARGET_FLOAT64) + (TARGET_64BIT, TARGET_SPLIT_ADDRESSES, TARGET_DEBUG_MODE) + (TARGET_DEBUG_D_MODE, TARGET_MEMCPY, TARGET_ABICALLS) + (TARGET_XGOT, TARGET_SOFT_FLOAT, TARGET_HARD_FLOAT) + (TARGET_LONG_CALLS, TARGET_EMBEDDED_DATA) + (TARGET_UNINIT_CONST_IN_RODATA, TARGET_BIG_ENDIAN) + (TARGET_SINGLE_FLOAT, TARGET_DOUBLE_FLOAT, TARGET_MAD) + (TARGET_FUSED_MADD, TARGET_4300_MUL_FIX, TARGET_CHECK_ZERO_DIV) + (TARGET_DIVIDE_TRAPS, TARGET_BRANCHLIKELY, TARGET_FIX_SB1) + (TARGET_FIX_R4000, TARGET_FIX_R4400, TARGET_FIX_VR4120) + (TARGET_FIX_VR4130, TARGET_VR4130_ALIGN, TARGET_FP_EXCEPTIONS) + (TARGET_PAIRED_SINGLE_FLOAT, TARGET_MIPS3D, TARGET_SYM32) + (TARGET_EXPLICIT_RELOCS): Delete. + (TARGET_SWITCHES, SUBTARGET_TARGET_SWITCHES): Delete. + (TARGET_OPTIONS): Remove entry for -mfix-vr4130. + * config/mips/mips.c (TARGET_DEFAULT_TARGET_FLAGS): Define. + (override_options): Set MASK_LONG64 if -mint64 is given and no + -mlongXX option is. Complain about -mint64 -mlong32. + (override_options, CMP_BUILTINS, mips_bdesc, sb1_desc): Rename + MASK_PAIRED_SINGLE to MASK_PAIRED_SINGLE_FLOAT. + * config/mips/mips.opt: New file. + +2005-03-14 Richard Sandiford + + * config.gcc (extra_options): New variable for listing option files. + Add ${cpu_type}/${cpu_type}.opt to it if that file exists. + * configure.ac (extra_opt_files): New AC_SUBST variable. + (tm_file_list, tm_include_list): Include options.h first. + * configure: Regenerate. + * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. + (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) + (s-options-h): New rule. + (options.h): Depend on it. + (TEXI_GCCINT_FILES): Add options.texi. + * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. + * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. + * target.h (gcc_target): Add default_target_flags and handle_option. + * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) + (TARGET_HANDLE_OPTION): New macros. + (TARGET_INITIALIZER): Include them. + * opt-functions.awk (opt_args, nth_arg): New functions. + (switch_flags): Handle the "Target" flag. + (var_args): Delete. + (var_name): Use opt_args and nth_arg. + (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". + * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* + macros for the "Mask" and "InverseMask" options. + * opts.h (cl_var_cond): New enum. + (cl_option): Replace the "has_set_value" and "set_value" fields with + "var_cond" and "var_value". + (CL_TARGET): New macro. + (option_enabled, print_filtered_help): Declare. + (decode_options): Move definition. + * opts.c (handle_option): Search for the original option before + removing any "no-" prefix. Handle CL_TARGET. Adjust for the new + var_cond and var_value fields. Use targetm.handle_option to handle + target options. + (decode_options): Set target_flags to targetm.default_target_flags. + (print_filtered_help): Make global. Handle CL_TARGET. + (option_enabled): New function. + * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. + (display_target_options, set_target_switch, print_switch_values) + (default_pch_valid_p): Guard uses of target_switches with + #ifdef TARGET_SWITCHES. Also... + (display_target_options): Display the CL_TARGET entries in cl_options. + (set_target_option): Don't complain about the "" option when + TARGET_SWITCHES is undefined. + (print_switch_values): Use option_enabled. + (default_pch_valid_p): Check cl_options[] when looking for something + that has changed the value of target_flags. + * c.opt: Remove documentation from top of file. + * doc/gccint.texi: Add an "Options" chapter. Include options.texi. + * doc/sourecebuild.texi: Refer to the new options documentation + instead of c.opt. Document machine-specific .opt files. + * doc/tm.texi (target_flags): Say that this variable is declared + by options.h. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. + (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as + an alternative. + * doc/options.texi: New file. + +2005-03-14 Alexandre Oliva + + PR middle-end/18628 + * cse.c (fold_rtx_mem): Don't fold a load from a jumptable into a + register. + +2005-03-14 Alexandre Oliva + + PR c++/20280 + * gimplify.c (gimplify_cond_expr): Add fallback argument. Use a + temporary variable of pointer type if an lvalues is required. + (gimplify_modify_expr_rhs): Request an rvalue from it. + (gimplify_expr): Pass fallback on. + +2005-03-14 Kazu Hirata + + * cfgbuild.c: Update comments. + +2005-03-14 Roger Sayle + + PR rtl-optimization/17236 + * optabs.c (expand_doubleword_mult): New helper function split out + from expand_binop. Permute the order in which instructions are + emitted to minimize the number of simultaneously live registers. + (expand_binop): Call expand_doubleword_mult to synthesize a double + word multiplication. + +2005-03-14 Kazu Hirata + + * basic-block.h: Update the prototypes of cached_make_edge and + rtl_make_eh_edge. + * cfg.c (cached_make_edge): Take edge_cache representing one + row of the adjacency matrix of edges. + * cfgbuild.c (make_label_edge, rtl_make_eh_edge): Likewise. + (make_edges): Initialize edge_cache to represent one row of + the adjacency matrix of edges. + +2005-03-14 Zdenek Dvorak + + * tree-ssa-phiopt.c (minmax_replacement, blocks_in_phiopt_order): + New functions. + (tree_ssa_phiopt): Use blocks_in_phiopt_order and minmax_replacement. + Remove unused removed_phis variable. + (conditional_replacement): Use build1/build2. + (abs_replacement): Use last_and_only_stmt and build1/build2. + +2005-03-14 Zdenek Dvorak + + * builtin-attrs.def (ATTR_NOVOPS, ATTR_NOVOPS_LIST, + ATTR_PURE_NOTHROW_NOVOPS_LIST): New. + * builtins.def (ATTR_MATHFN_FPROUNDING): Use NOVOPS. + (BUILT_IN_PREFETCH): Set the NOVOPS attribute. + * c-common.c (handle_novops_attribute): New function. + (c_common_attribute_table): Add "no vops" entry. + * c-decl.c (merge_decls): Copy DECL_IS_NOVOPS. + * calls.c (flags_from_decl_or_type): Set ECF_NOVOPS. + * tree-ssa-operands.c (get_call_expr_operands): Do not + create virtual operands for calls with ECF_NOVOPS flag. + * tree.h (DECL_IS_NOVOPS): New macro. + (struct tree_decl): Add novops_flag. + (ECF_NOVOPS): New constant. + +2005-03-14 Uros Bizjak + + PR target/17688 + * config/i386/i386.c (x86_use_himode_fiop): New. + (x86_use_simode_fiop): Rename from x86_use_fiop. + * config/i386/i386.h (x86_use_himode_fiop): Declare. + (TARGET_USE_HIMODE_FIOP): New. + (x86_use_simode_fiop): Rename from x86_use_fiop. + (TARGET_USE_SIMODE_FIOP): Rename from TARGET_USE_FIOP. + + * config/i386/i386.md (X87MODEI12): New mode macro define. + (*cmpfp_): Rename from *cmpfp_si. Use X87MODEI12 mode macro + to implement x87 FP compare with HImode input operands. + (*fp_jcc_8_387, splitter): Rename from *fp_jcc_8_387. + Use X87MODEI12 mode macro to handle HImode input operands. + (*fop_sf_2_i387, *fop_sf_3_i387, *fop_df_2_i387, + *fop_df_3_i387, *fop_xf_2_i387, *fop_xf_3_i387): + Renamed from *fop_sf_2_i387, *fop_sf_3_i387, *fop_df_2_i387, + *fop_df_3_i387, *fop_xf_2_i387, *fop_xf_3_i387. Use X87MODEI12 mode + macro to implement x87 operators with HImode input operands. + (fop splitters): Use X87MODEI12 mode macro to handle HImode + input operands. + +2005-03-14 Zdenek Dvorak + + * tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of + integer_zerop. + * tree-gimple.c (is_gimple_min_invariant): Consider overflowed + constants invariant. + +2005-03-14 Zdenek Dvorak + + * basic-block.h (BB_VISITED): Removed. + * cfganal.c (dfs_enumerate_from): Do not use BB_VISITED flag. + +2005-03-14 Falk Hueffner + + PR bootstrap/20424 + * config/alpha/alpha.c (alpha_fold_builtin_cmpbge): Fix typo. + +2005-03-14 Kazu Hirata + + * ggc-zone.c: Fix comment typos. + + * alloc-pool.c, except.h, ggc-common.c, ggc-zone.c, ggc.h, + stringpool.c, config/mips/mips-protos.h: Update copyright. + +2005-03-14 Alan Modra + + * config/rs6000/rs6000-protos.h: Replace "struct rtx_def *" + throughout with its typedef, "rtx". + * config/rs6000/rs6000.c: Likewise. Formatting fixes. + (rs6000_tls_symbol_ref_1): Remove inline keyword. + * config/rs6000/rs6000.h (REG_ALLOC_ORDER): Formatting. Reorder + regs in comment to match code. + +2005-03-14 Kazu Hirata + + * except.c (check_handled): Make it static. + * except.h: Remove the corresponding prototype. + + * function.c (get_func_frame_size): Make it static. + * function.h: Remove the corresponding type. + + * regclass.c (reg_class_superclasses, reg_class_subclasses): + Make them static. + * hard-reg-set.h: Remove the corresponding declarations. + + * tree-cfg.c (verify_stmts): Check that + bb_for_stmt (stmt) == bb for every PHI node and statement. + +2005-03-14 Alan Modra + + * config.gcc: Remove excess indentation. + (powerpc*-*-*, rs6000-*-*): Accept --with-cpu/tune power5 and 8548. + +2005-03-13 Roger Sayle + + PR middle-end/19331 + * tree.c (get_unwidened): Treat CONVERT_EXPR and NOP_EXPR identically. + * fold-const.c (fold_sign_changed_comparison): Likewise. + (fold_binary): Optimize comparisons against widened operands if + the extension is represented by a CONVERT_EXPR, same as a NOP_EXPR. + +2005-03-13 Eric Botcazou + + * config/sparc/sparc.c (struct_value_alias_set): New global variable. + (sparc_override_options): Initialize it. + (sparc_struct_value_rtx): Set it on the MEM to be returned. + +2005-03-13 David Edelsohn + + * config/rs6000/predicates.md (mem_or_easy_const_operand): Delete. + (reg_or_none500mem_operand): New predicate. + (zero_reg_mem_operand): New predicate. + * config/rs6000/rs6000.md (extendsfdf2): Change operand1 predicate + to reg_or_none500mem_operand. + (extendsfdf2_fpr): Add MEM alternative. + (extenddftf2_internal): Change operand2 predicate to + zero_reg_mem_operand. + +2005-03-13 Daniel Jacobowitz + + * ggc-zone.c: Rewritten. + + * alloc-pool.c (dump_alloc_pool_statistics): Don't print statistics + if there are none. + * configure.ac: Define GGC_ZONE for --with-gc=zone. + * config.in: Regenerated. + * configure: Regenerated. + * gengtype.c (write_types_process_field, write_func_for_structure): + Pass new argument to gt_pch_note_object. + * ggc-common.c (struct ptr_data): Add TYPE. + (gt_pch_note_object): Take TYPE argument and save it. + (call_count): Update call to ggc_pch_count_object. + (call_alloc): Update call to ggc_pch_alloc_object. + (gt_pch_save): Call ggc_pch_prepare_write after paddng the PCH + file. + * ggc-none.c (rtl_zone, garbage_zone, ggc_alloc_zone_stat): Delete. + * ggc-page.c (rtl_zone, tree_zone, garbage_zone) + (ggc_alloc_zone_stat): Delete. + (ggc_pch_count_object, ggc_pch_alloc_object): Add TYPE argument. + * ggc.h (gt_pch_note_object, ggc_pch_count_object) + (ggc_pch_alloc_object): Update prototypes. + (garbage_zone): Delete. + (tree_zone, rtl_zone, ggc_alloc_zone_stat, ggc_alloc_zone): Move to + GGC_ZONE conditional. Update. Change tree_zone and rtl_zone into + pointers. + (tree_id_zone): New variable. + (ggc_alloc_cleared_zone): Remove unused. + (ggc_alloc_zone): Define. + (ggc_alloc_rtvec, ggc_alloc_tree): Update to use ggc_alloc_zone. + * rtl.c (rtx_alloc_stat, shallow_copy_rtx_stat): Use + ggc_alloc_zone_stat. + * stringpool.c (gt_pch_n_S): Update call to gt_pch_note_object. + * tree.c (copy_node_stat, make_tree_binfo_stat, make_tree_vec_stat) + (tree_cons_stat, build1_stat): Update call to ggc_alloc_zone_stat. + (make_node_stat): Likewise. Use tree_id_zone. + +2005-03-13 Daniel Jacobowitz + Joseph S. Myers + + * configure.ac: Check for MIPS TLS. + * configure: Regenerated. + * config/mips/mips-protos.h (enum mips_symbol_type): Add + SYMBOL_TLS, SYMBOL_TLSGD, SYMBOL_TLSLDM, SYMBOL_DTPREL, + SYMBOL_GOTTPREL, and SYMBOL_TPREL. + * config/mips/mips.c (mips_regno_to_class): Handle V1_REG. + (TARGET_HAVE_TLS, TARGET_CANNOT_FORCE_CONST_MEM): Define. + (mips_classify_symbol, mips_symbolic_constant_p) + (mips_symbolic_address_p, mips_symbol_insns): Handle TLS symbols. + (mips_tls_operand_p, mips_call_tls_get_addr) + (mips_legitimize_tls_address, mips_cannot_force_const_mem) + (mips_tls_symbol_ref_1): New functions. + (mips_legitimize_address, mips_legitimize_const_move): Call + mips_legitimize_tls_address. + (override_options): Handle V1_REG and TLS symbols. Disable TLS + for MIPS16. + * config/mips/mips.h (enum reg_class, REG_CLASS_NAMES) + (REG_CLASS_CONTENTS, GR_REG_CLASS_P): Include V1_REG. + (mips_char_to_class): Document V1_REG. + (HAVE_AS_TLS): Provide default. + * config/mips/mips.md (UNSPEC_TLS_LDM, UNSPEC_TLS_GET_TP): New + constants. + (load_got): Renamed from *load_got. Allow when + !TARGET_ABICALLS. + (tls_get_tp_): New instruction. + +2005-03-13 Daniel Jacobowitz + + * configure.ac: Update checks for target tools. + * configure: Regenerated. + +2005-03-13 Daniel Jacobowitz + + * varasm.c (decl_tls_model): Check flag_shlib instead of flag_pic. + +2005-03-13 Roger Sayle + + * expmed.c (expand_mult): Use synthetic multiplication sequences for + more classes of DImode multiplication by constant. Allow both + multiplication by small negative constants (by performing a + multiplication by a positive constant and negating the result) and + multiplications by large powers of two, by using a left shift. + +2005-03-13 Kazu Hirata + + * tree-into-ssa.c (find_idf): Speed up by putting the indexes + of basic blocks into work_stack. + + * builtin-attrs.def, c-lex.c, c-pragma.h, reg-stack.c, + config/mips/vr.h: Update copyright. + + * c-decl.c (c_init_decl_processing): Remove useless calls to + build_function_type. + + * builtins.c (fold_trunc_transparent_mathfn, + fold_fixed_mathfn, fold_builtin_atan, fold_builtin_trunc, + fold_builtin_floor, fold_builtin_ceil, fold_builtin_round, + fold_builtin_lround, fold_builtin_bitop, fold_builtin_memcpy, + fold_builtin_strcpy, fold_builtin_strncpy, + fold_builtin_signbit): Use TYPE (TYPE (fndecl)) instead of + TREE_TYPE (exp). + + * builtins.c (expand_builtin_mathfn_3): Remove local variable + before_call. + + * lambda-code.c (lambda_compute_auxillary_space): Remove local + variable determinant. + + * tree-cfg.c (group_case_labels): Remove local variable type. + + * tree-ssa-live.c (build_tree_conflict_graph): Remove local + variable ann. + + * tree-ssa-phiopt.c (value_replacement): Remove local variable + result. + +2005-03-13 Andy Hutchinson + + PR target/18251 + * config/avr/avr.md (movmemhi): Rewrite as RTL loop. + (*movmemqi_insn): Delete. + (*movmemhi): Delete. + +2005-03-13 Kazu Hirata + + * builtins.c (fold_builtin_classify): Take decomposed + arguments of CALL_EXPR. + (fold_builtin_1): Update a call to fold_builtin_classify. + +2005-03-13 Joseph S. Myers + + PR c/20402 + * c-parser.c (c_parser_struct_or_union_specifier): Don't fall + through into call to parser_xref_tag after parse error. + (c_parser_struct_declaration): Consistently return NULL_TREE on + error. + +2005-03-12 Daniel Berlin + + * tree-flow-inline.h (ref_contains_array_ref): New function. + (lookup_subvars_for_var): Ditto. + (get_subvars_for_var): Ditto. + (var_can_have_subvars): Ditto. + + * tree-flow.h (mem_tag_kind): Add STRUCT_FIELD. + (struct subvar): New type. + + * tree-dfa.c (okay_component_ref_for_subvars): New function. + + * tree-optimize.c (init_tree_optimization_passes): Call + pass_create_structure_vars. + + * tree-ssa-alias.c: Include vec.h. + (init_alias_info): Don't auto-clear call clobbered on struct-field + tags. + (compute_flow_insensitive_aliasing): Handle subvars. + (group_aliases): Handle STRUCT_FIELD aliases. + (setup_pointers_and_addressables): Ditto. + Don't mark variables non-addressable if they still have + addressable subvars. + Also mark subvars addressable when the real variable is marked + addressable. + (add_pointed_to_var): Try to prune the pointed-to set by only + pointing to subvars when possible. + Otherwise, make sure we set addresses_needed and pt_vars to + properly include subvars. + (bitpos_of_field): New function. + (push_fields_onto_fieldstack): Ditto. + (get_or_create_used_part_for): Ditto. + (create_overlap_variables_for): Ditto. + (find_used_portions): Ditto. + (create_structure_vars): Ditto. + (pass_create_structure_vars): New structure. + + * tree-ssa-operands.c (finalize_ssa_v_must_defs): Remove assert. + (get_expr_operands): Handle subvars. Also try to turn + COMPONENT_REF accesses into must-defs now that we can accurately + portray it. + (note_addressable): Try to only mark as addressable those subvars + we know a COMPONENT_REF touches. + (overlap_subvar): New function. + + * tree-vect-analyze.c (vect_object_analysis): Add new parameter. + Handle subvar storing. + (vect_address_analysis): Update caller of vect_object_analysis. + + * tree-vect-transform.c (vect_create_data_ref_ptr): Copy subvars. + + * tree-vectorizer.h (struct _stmt_vec_info): Add subvars member. + (STMT_VINFO_SUBVARS): New macro. + + * common.opts: add flag_tree_salias. + + * opts.c (decode_options): flag_tree_salias defaults to on. + + * doc/invoke.texi: Document fdump-tree-svars and -ftree-salias. + + * doc/tree-ssa.texi: Document structural alias analysis. + +2005-03-12 Steven Bosscher + + * tree-cfg.c (make_goto_expr_edges): Don't use error_mark_node. + * tree-ssa-dce.c (mark_stmt_necessary): Don't check for it. + * tree-ssa-operands.c (get_expr_operands): Likewise. + (get_expr_operands): Likewise for ERROR_MARK. + +2005-03-12 Kazu Hirata + + * tree-ssa.c (kill_redundant_phi_nodes): Remove local variable + var. + + * tree-ssa-phiopt.c (tree_ssa_phiopt): Remove local variable + removed_phis. + + * tree-ssa-pre.c (compute_avail): Remove local variable val. + (mark_operand_necessary): Remove local variable ver. + + * tree-vect-transform.c (vect_get_new_vect_var): Remove local + variable prefix_len. + + * value-prof.c (mod_subtract_transform): Remove local variable + value. + + * builtins.c (fold_builtin_exponent): Take decomposed + arguments of CALL_EXPR. + (fold_builtin_1): Update a call to fold_builtin_exponent. + + * builtins.c (fold_builtin_logarithm): Take decomposed + arguments of CALL_EXPR. + (fold_builtin_1): Update a call to fold_builtin_logarithm. + + * c-decl.c (c_init_decl_processing): Remove local variables + ptr_ftype_void and ptr_ftype_ptr. + + * gimplify.c (gimplify_expr): Remove local variables r0 and + r1. + + * reg-stack.c (move_for_stack_reg): Remove local variable + push_insn. + (compare_for_stack_reg): Remove local variable flags_user. + (convert_regs_1): Remove local variable deleted. + + * tree-if-conv.c (tree_if_convert_cond_expr): Remove local + variable new_cond. + (combine_blocks): Remove local variables exits and new_e. + + * tree-inline.c (expand_call_inline): Remove local variable + decl. + + * tree-ssa-live.c (create_ssa_var_map, + calculate_live_on_entry): Remove local variable snn. + +2005-03-12 Geoffrey Keating + + * c-lex.c (c_lex_with_flags): Add parameter to call to + cpp_spell_token. + +2005-03-11 Per Bothner + + * c-tree.h (struct c_declarator): New id_loc field. + * c-pragma.h (c_lex_with_flags): Take position reference. + * c-lex.c (c_lex_with_flags): Set passed-in location from cpp token, + iff USE_MAPPED_LOCATION. (Type doesn't match otherwise.) + (c_lex): Pass dummy location to c_lex_with_flags. + * c-parser.c (c_lex_one_token): Set c_token's location using + c_lex_with_flags, instead of input_location, which might be "ahead". + (c_parser_direct_declarator): Set declarator's id_loc from + c_token's id_loc. + * c-decl.c (grokdeclarator): Set DECL_SOURCE_LOCATION from + declarator's id_loc, rather than probably-imprecise input_location. + (build_id_declarator): Initialize c_declarator's id_loc field. + +2005-03-11 Roger Sayle + + PR middle-end/20419 + * builtins.c (expand_builtin_signbit): Force the signbit's word + into an integer register to avoid SUBREGs of floating point modes. + +2005-03-12 Kazu Hirata + + * cfglayout.c, loop-doloop.c, profile.c, target-def.h, + target.h, targhooks.c, tracer.c, tree-ssa-loop-ch.c, + tree-ssa-loop-unswitch.c, tree-ssa-loop.c, vec.c, vmsdbgout.c, + config/m32r/m32r.md, config/xtensa/xtensa.h: Update copyright. + +2005-03-11 David Edelsohn + + PR rtl-optimization/20306 + * expr.c (emit_move_complex): Set try_int false if mode is + MODE_COMPLEX_FLOAT and mov_optab exists for inner mode. Only try + emit_block_move if try_int is true. + +2005-03-11 Richard Henderson + + PR target/20415 + * config/i386/mmx.md (vec_dupv4hi): Fix predicate. + * config/i386/i386.c (ix86_expand_vector_init_duplicate): Update + to match. + +2005-03-11 Richard Sandiford + + * config/mips/mips.h (mips_fix_vr4130_string): Declare. + (TARGET_FIX_VR4130): New macro. + (TARGET_OPTIONS): Add -mfix-vr4130. + (ISA_HAS_MACCHI): New macro. + (ASM_SPEC): Add -mfix-vr4130. + * config/mips/mips.c (mips_fix_vr4130_string): New variable. + (override_options): Handle mips_fix_vr4130_string. + (mips_avoid_hazards): Clear all_noreorder_p + if we're working around VR4130 errata and the macc alternatives + are not available. + * config/mips/mips.md (mfhilo_): Turn into a define_expand. + (*mfhilo_, *mfhilo__macc): New insns. + * config/mips/vr.h (DEFAULT_VR_ARCH): Set to mfix-vr4130. + (MULTILIB_DEFAULTS): Remove leading "march=". + (DRIVER_SELF_SPECS): Likewise. Make -mfix-vr4130 imply -march=vr4130 + if no architecture option is given. + * config/mips/t-vr (MULTILIB_OPTIONS): Use -mfix-vr4130 for the + VR4130 multilibs. + (MULTILIB_MATCHES): Map -march=vr4130 to the -mfix-vr4130 multilibs. + * doc/invoke.texi: Document -mfix-vr4130. + +2005-03-11 Richard Sandiford + + * config/mips/mips.c (override_options): Only warn about -mint64 + deprecation if TARGET_INT64. + +2005-03-11 Kaveh R. Ghazi + + * builtin-attrs.def (ATTR_NONNULL_LIST, ATTR_NOTHROW_NONNULL, + ATTR_CONST_NOTHROW_NONNULL, ATTR_PURE_NOTHROW_NONNULL, + ATTR_MALLOC_NOTHROW_NONNULL): New "nonnull" attribute lists which + are non-specific regarding the nonnull parameter positions. + (ATTR_NONNULL_1_2, ATTR_NONNULL_1_4, ATTR_NOTHROW_NONNULL_1_2, + ATTR_NOTHROW_NONNULL_1_4, ATTR_CONST_NOTHROW_NONNULL_1, + ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1_2, + ATTR_MALLOC_NOTHROW_NONNULL_1): Delete. + + * builtins.def: Use the non-specific "nonnull" attibute lists. + +2005-03-11 Zdenek Dvorak + + * basic-block.h (single_succ_p, single_pred_p, single_succ_edge, + single_pred_edge, single_succ, single_pred): Improve comments. + +2005-03-11 Zdenek Dvorak + + * basic-block.h (single_succ_p, single_pred_p, single_succ_edge, + single_pred_edge, single_succ, single_pred): New inline functions. + * bb-reorder.c (rotate_loop, find_traces_1_round, + add_labels_and_missing_jumps, fix_up_fall_thru_edges, + duplicate_computed_gotos): Use the single_succ/pred functions. + * cfganal.c (forwarder_block_p): Ditto. + * cfgbuild.c (compute_outgoing_frequencies): Ditto. + * cfgcleanup.c (try_simplify_condjump, try_forward_edges, + outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg, + merge_seq_blocks): Ditto. + * cfghooks.c (split_edge, tidy_fallthru_edges): Ditto. + * cfglayout.c (fixup_reorder_chain): Ditto. + * cfgloop.c (mark_single_exit_loops, update_latch_info, + canonicalize_loop_headers, verify_loop_structure): Ditto. + * cfgloopmanip.c (remove_path, unloop, loop_delete_branch_edge, + mfb_update_loops, create_preheader, force_single_succ_latches, + create_loop_notes): Ditto. + * cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump, + force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, + commit_one_edge_insertion, purge_dead_edges, + cfg_layout_can_merge_blocks_p): Ditto. + * except.c (sjlj_emit_function_enter): Ditto. + * flow.c (init_propagate_block_info): Ditto. + * function.c (thread_prologue_and_epilogue_insns): Ditto. + * gcse.c (find_implicit_sets, bypass_conditional_jumps, + insert_insn_end_bb): Ditto. + * ifcvt.c (merge_if_block, find_if_block, find_if_case_1, + find_if_case_2): Ditto. + * lambda-code.c (perfect_nestify): Ditto. + * lcm.c (optimize_mode_switching): Ditto. + * loop-doloop.c (doloop_modify): Ditto. + * loop-init.c (loop_optimizer_init): Ditto. + * loop-iv.c (simplify_using_initial_values): Ditto. + * loop-unroll.c (unroll_loop_runtime_iterations): Ditto. + * loop-unswitch.c (unswitch_loop): Ditto. + * modulo-sched.c (generate_prolog_epilog): Ditto. + * predict.c (combine_predictions_for_insn, estimate_probability, + tree_estimate_probability, last_basic_block_p, + estimate_bb_frequencies): Ditto. + * profile.c (branch_prob): Ditto. + * regrename.c (copyprop_hardreg_forward): Ditto. + * sched-rgn.c (is_cfg_nonregular, find_rgns, update_live): Ditto. + * tracer.c (layout_superblocks): Ditto. + * tree-cfg.c (tree_can_merge_blocks_p, tree_merge_blocks, + cfg_remove_useless_stmts_bb, cleanup_control_flow, + cleanup_control_expr_graph, disband_implicit_edges, + tree_find_edge_insert_loc, bsi_commit_edge_inserts, + tree_verify_flow_info, tree_make_forwarder_block, + tree_forwarder_block_p, remove_forwarder_block, + remove_forwarder_block_with_phi, merge_phi_nodes): Ditto. + * tree-if-conv.c (tree_if_conversion): Ditto. + * tree-mudflap.c (mf_build_check_statement_for): Ditto. + * tree-ssa-dce.c (remove_dead_stmt): Ditto. + * tree-ssa-dom.c (dom_opt_finalize_block): Ditto. + * tree-ssa-loop-ch.c (should_duplicate_loop_header_p, + copy_loop_headers): Ditto. + * tree-ssa-loop-im.c (loop_commit_inserts): Ditto. + * tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Ditto. + * tree-ssa-loop-manip.c (split_loop_exit_edge, ip_normal_pos, + lv_adjust_loop_entry_edge, tree_ssa_loop_version): Ditto. + * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Ditto. + * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Ditto. + * tree-ssa-phiopt.c (tree_ssa_phiopt, value_replacement): Ditto. + * tree-ssa-pre.c (compute_antic_aux, insert_aux, init_pre): Ditto. + * tree-ssa-threadupdate.c (redirect_edges): Ditto. + * tree-tailcall.c (independent_of_stmt_p, find_tail_calls, + eliminate_tail_call, tree_optimize_tail_calls_1): Ditto. + * tree-vect-analyze.c (vect_analyze_loop_form): Ditto. + * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto. + * tree-vectorizer.c (slpeel_update_phi_nodes_for_guard, + slpeel_add_loop_guard): Ditto. + +2005-03-11 James A. Morrison + + PR tree-optimization/15784 + * fold-const.c (fold): Fold ~A + 1 to -A. Fold -A - 1 + and -1 - A to ~A. + + * stmt.c (expand_case): Don't change index_type. Convert minval + to the proper type. + + PR tree-optimization/20130 + * fold-const.c (fold): Fold x * -1 into -x. + +2005-03-11 Kaz Kojima + + PR rtl-optimization/20331 + * rtlanal.c (modified_between_p): Check its address first for MEM. + (modified_in_p): Likewise. + +2005-03-11 Joseph S. Myers + + * config.gcc (hppa*64*-*-hpux11*): Use pa/t-hpux-shlib. + +2005-03-10 Steven Bosscher + + * expr.c (expand_expr_real_1): If possible, use a conditional + move for expanding MIN_EXPR and MAX_EXPR. + Use temp for moving around rtx-en. + +2005-03-10 Andrew Pinski + + PR rtl-opt/20412 + * simplify-rtx.c (simplify_relational_operation_1): Fix typo - check the + correct mode. + +2005-03-10 Roger Sayle + + * builtins.c (expand_builtin_signbit): Extend to handle floating + point modes wider than the largest integer type, using the + operand_subword_force function to obtain the signbit's word. + +2005-03-10 Jakub Jelinek + + PR target/20322 + * combine.c (try_combine): If recog_for_combine added CLOBBERs + to NEWI2PAT, fail to combine if they are used by NEWPAT. + +2005-03-10 Aldy Hernandez + + * doc/invoke.texi: Add 8540 to list of cpus in rs6000 cpu section. + +2005-03-10 Kazu Hirata + + * tree-outof-ssa.c (analyze_edges_for_bb): Make the return + type void. + (perform_edge_inserts): Unconditionally call + free_dominator_info. + + * tree-outof-ssa.c (analyze_edges_for_bb): Update a comment. + +2005-03-10 Bob Wilson + + * config/xtensa/xtensa.h (MEMBER_TYPE_FORCES_BLK): Define. + +2005-03-10 Nathan Sidwell + + * bitmap.c (bitmap_copy): Remove manual loop unrolling. + + * value-prof.c (rtl_find_values_to_profile): Use gcc_assert and + gcc_unreachable. + (rtl_register_value_prof_hooks, + tree_value_profile_transformations, + tree_register_value_prof_hooks): Likewise. + * var-tracking.c (stack_adjust_offset_pre_post, + variable_htab_free, variable_union, dataflow_set_different_2, + count_uses, variable_was_changed, set_frame_base_location, + set_variable_part, emit_note_insn_var_location, vt_emit_notes, + vt_add_function_parameters): Likewise. + * varasm.c (named_section_real, named_section, make_decl_rtl, + asm_emit_uninitialised, assemble_integer, decode_addr_const, + const_hash_1, compare_constant, copy_constant, force_const_mem, + output_constant_pool_2, output_constant_pool_1, output_constant, + output_constructor, make_decl_one_only, decl_tls_model, + default_no_named_section, default_elf_select_section_1, + default_unique_section_1): Likewise. + * vec.c (vec_gc_o_reserve, vec_heap_o_reserve): Likewise. + * vmsdbgout.c (addr_const_to_string): Likewise. + + PR c++/20375 + * function.c (struct assign_parm_data_one): Remove last_named + field. + (assign_parm_find_data_types): Don't determine last_named. + Reorder named_parm determination. + (assign_parms): Only setup varargs on the last non-varadic + parameter. + +2005-03-10 Kazuhiro Inaoka + + * config/m32r/m32r.md (load_sda_base_32): New pattern. Loads + sda base address on medium model. + +2005-03-10 Zdenek Dvorak + + * Makefile.in (tree-optimize.o): Add CFGLOOP_H dependence. + * cfgloop.c (flow_loop_nodes_find): Export. + * cfgloop.h (flow_loop_nodes_find, fix_loop_structure): + Declare. + * cfgloopmanip.c (fix_loop_structure): New function. + * predict.c (predict_loops): Clean up the loops information. + * tree-cfg.c (cleanup_tree_cfg_loop): New function. + (tree_can_merge_blocks_p, remove_bb, tree_forwarder_block_p): Respect + loop structure. + * tree-flow.h (cleanup_tree_cfg_loop): Declare. + (rewrite_into_loop_closed_ssa): Declaration changed. + * tree-loop-linear.c (linear_transform_loops): Add argument to + rewrite_into_loop_closed_ssa call. + * tree-ssa-loop-ch.c (copy_loop_headers): Ditto. + * tree-ssa-loop-im.c (move_computations): Ditto. + * tree-ssa-loop.c (tree_loop_optimizer_init): Ditto. + * tree-vectorizer.c (vectorize_loops): Ditto. + * tree-optimize.c: Include cfgloop.h. + (execute_todo): Choose whether to call cleanup_tree_cfg or + cleanup_tree_cfg_loop. + * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables, + (tree_unroll_loops_completely): Enable cleanup_tree_cfg_loop call. + * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Enable + cleanup_tree_cfg_loop call. + * tree-ssa-loop-manip.c (find_uses_to_rename_bb): New function. + (find_uses_to_rename, rewrite_into_loop_closed_ssa): Support + work on part of cfg. + +2005-03-10 Jakub Jelinek + + PR inline-asm/20314 + * gimplify.c (gimplify_asm_expr): Handle input/output constraints + with multiple alternatives. + + * stmt.c (parse_output_constraint): Fix a typo. + +2005-03-09 Bob Wilson + + * config/xtensa/xtensa.h (TRAMPOLINE_TEMPLATE): Use "no-transform" + assembly directive instead of deprecated "no-generics". + +2005-03-09 Ulrich Weigand + + * config/s390/s390.c (s390_secondary_output_reload_class): Adapt check + for non-offsettable memory references to cope with outstanding reload + replacements. + * config/s390/s390.md ("reload_outti"): Call find_replacement to + avoid losing outstanding address reloads. + ("reload_outdi", "reload_outdf"): Likewise. + +2005-03-09 Kaveh R. Ghazi + + * builtins.c (fold_builtin_cbrt, fold_builtin_pow): Rearrange + code. Add more cbrt transformations. + +2005-03-09 Kaveh R. Ghazi + + * fold-const.c (fold_unary_to_constant): Add FIX_ROUND_EXPR case. + +2005-03-09 Kazu Hirata + + * fold-const.c (fold_unary, fold_binary, fold_ternary): Return + NULL_TREE when a given tree is not simplified. + (fold): Return the original tree when any of the functions + mentioned above NULL_TREE. + + * fold-const.c (fold_unary, fold_binary): Take decomposed + arguments, code, type, op0, and op1 in case of fold_binary. + (fold): Update calls to fold_unary and fold_binary. + +2005-03-09 Roger Sayle + + * builtins.c (fold_builtin_unordered_cmp): Change prototype to take + a fndecl and an arglist instead of a CALL_EXPR, exp. + +2005-03-09 Kazu Hirata + + * cfglayout.c (fixup_reorder_chain): Remove old_bb. + + * cfgrtl.c (cfg_layout_merge_blocks): Remove new_e. + + * expr.c (expand_assignment): Remove orig_to_rtx. + + * fold-const.c (int_const_binop): Remove no_overflow. + + * ifcvt.c (noce_emit_move_insn): Remove inmode. + + * loop-iv.c (get_biv_step_1): Remove lhs. + + * loop-unroll.c (analyze_insns_in_loop): Remove preheader. + + * real.c (real_nan): Remove neg. + + * function.c (thread_prologue_and_epilogue_insns): Remove i + and newinsn. + + * tree-data-ref.c (array_base_name_differ_p): Remove ta and + tb. + + * tree-eh.c (tree_could_trap_p): Remove idx. + + * tree-into-ssa.c (ann): Remove ann. + + * tree-outof-ssa.c (num_nodes): Remove num_nodes. + + * tree-sra.c (decide_block_copy): Remove inst_count. + + * tree-ssa-alias.c (may_alias_p): Remove v_ann. + + * tree-ssa-loop-im.c (lhs): Remove. + + * cfgbuild.c (state, STATE, SET_STATE, + BLOCK_USED_BY_TABLEJUMP, FULL_STATE): Move just before + make_edges. + (make_edges): Speed up by skipping blocks with BLOCK_ORIGINAL. + (find_basic_blocks): Set the state of each basic block to + BLOCK_NEW. + +2005-03-08 Jeff Law + + * tree-cfg.c (cleanup_control_flow): If removal of a computed + goto results in the removal of edges in the CFG, then we need + to recompute dominators. + +2005-03-09 Ben Elliston + + * c-common.c (c_do_switch_warnings): Comment fix. + +2005-03-08 Julian Brown + + * Patch from 2005-03-08 reverted for causing regressions and + ppc-darwin bootstrap failure. + +2005-03-08 Fariborz Jahanian + + * config/rs6000/rs6000.c (invalid_arg_for_unprototyped_fn): + Define the real function for ppc-darwin. + * c-typeck.c (convert_arguments): Check for target-specific + invalid argument call to unprototyped function. + * target-def.h (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): + New Macro. + * target.h (invalid_arg_for_unprototyped_fn): New field + in struct calls. + * targhooks.c (hook_invalid_arg_for_unprototyped_fn): New + default target hook. + * targhooks.h (hook_invalid_arg_for_unprototyped_fn): + Declare. + +2005-03-08 Kazu Hirata + + * c-typeck.c (constructor_stack, constructor_range_stack, + initializer_stack): Make them static. + + * cfg.c (rbi_pool): Make it static. + + * gimple-low.c (lower_stmt_body): Make it static. + * tree-flow.h: Remove the corresponding prototype. Don't + declare lower_data. + + * sched-deps.c (cache_size): Make it static. + + * stor-layout.c (lang_adjust_rli): Make it static. + +2005-03-08 Julian Brown + + * config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK + from being used for symbols with vague linkage when + HAVE_GAS_COMDAT_GROUP is true. + +2005-03-08 J"orn Rennecke + + * jump.c (invert_jump_1): Don't call redirect_jump_1 with + nlabel == JUMP_LABEL (jump). + +2005-03-08 Kazu Hirata + + * c-common.c, c-opts.c, combine.c, cse.c, dojump.c, + gimplify.c, tree-dfa.c, tree-ssa-loop-ivopts.c, + tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-sink.c, + tree-vect-analyze.c, tree.def, tree.h: Fix comment formatting. + +2005-03-08 Alexey Neyman + + PR c/14411 + * calls.c (flags_from_decl_or_type): Handle eturns_twice' attribute. + * c-common.c (handle_returns_twice): New function. + (c_common_attribute_table): Declare eturns_twice' attribute. + * doc/extend.texi: Document eturns_twice' attribute. + * tree.h (DECL_IS_RETURNS_TWICE): New macro. + (struct tree_decl): Add returns_twice_flag. + +2005-03-08 Kazu Hirata + + * tree-ssa-phiopt.c: Fix a comment typo. + + * c-semantics.c, cfghooks.c, diagnostic.h, loop-iv.c, + loop-unswitch.c, modulo-sched.c, stor-layout.c, tree-gimple.h, + config/i386/cygwin1.c, doc/cfg.texi, doc/objc.texi: Update + copyright. + +2005-03-08 Richard Henderson + + * config/alpha/alpha.c (code_for_builtin): Replace special-case + builtin codes with ctzdi2, clzdi2, popcountdi2. + (struct alpha_builtin_def): Add is_const. + (zero_arg_builtins, one_arg_builtins, two_arg_builtins): Init it. + (alpha_v8qi_u, alpha_v8qi_s, alpha_v4hi_u, alpha_v4hi_s): New. + (alpha_init_builtins): Init them. Set nothrow and const attributes + on builtins. + (alpha_fold_builtin_cmpbge, alpha_fold_builtin_zapnot, + alpha_fold_builtin_extxx, alpha_fold_builtin_insxx, + alpha_fold_builtin_mskxx, alpha_fold_builtin_umulh, + alpha_fold_vector_minmax, alpha_fold_builtin_perr, + alpha_fold_builtin_pklb, alpha_fold_builtin_pkwb, + alpha_fold_builtin_unpkbl, alpha_fold_builtin_unpkbw, + alpha_fold_builtin_cttz, alpha_fold_builtin_ctlz, + alpha_fold_builtin_ctpop, alpha_fold_builtin): New. + (TARGET_FOLD_BUILTIN): New. + * config/alpha/alpha.md (UNSPEC_CTTZ): Remove. + (UNSPEC_CTLZ, UNSPEC_CTPOP): Remove. + (ffsdi2): Use ctz. + (cttz, builtin_cttz, builtin_ctlz, builtin_ctpop): Remove. + +2005-03-08 Ira Rosen + + PR tree-optimization/20122 + * tree-vect-analyze.c (vect_object_analysis): Analyze initial + condition of access function instead of base. + +2005-03-07 Jeff Law + Steven Bosscher + + * tree-cfg.c (find_taken_edge_computed_goto): New function. + (find_taken_edge): Call find_taken_edge_computed_goto as + appropriate. Allow any gimple invariant rather than just + INTEGER_CST for VAL. + (cleanup_control_flow): Cleanup a computed goto which has turned + into a simple goto. + (tree_merge_blocks): If block B has any forced labels, move + them to the start of block A. + * tree-ssa-dom.c (thread_across_edge): Allow threading across + computed gotos as well. + * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Handle + removal of unnecessary computed gotos too. + (lookup_redirection_data): Fix type of INSERT argument. Callers + updated. + +2005-03-08 Kazu Hirata + + * tree-ssa-phiopt.c: Update copyright. Fix indentations. + Remove trailing spaces. + + * gimplify.c (gimple_push_bind_expr, gimple_pop_bind_expr, + unshare_all_trees): Make them static. + * tree-gimple.h: Remove the corresponding prototypes. + + * diagnostic.h: Remove unused prototype + debug_output_buffer. + * modulo-sched.c: Remove unused prototype + set_row_column_for_ps. + + * tree-ssa-phiopt.c (tree_ssa_phiopt, + replace_phi_edge_with_variable): Remove unused variable i. + +2005-03-07 Per Bothner + + * tree.h (DECL_IS_BUILTIN): Reverted my patch from earlier today. + +2005-03-06 Andrew Pinski + + PR tree-opt/17671 + * tree-ssa-phiopt.c (tree_ssa_phiopt): Rewrite so we base the + bbs on the COND_EXPR instead of the PHI_NODEs. + (candidate_bb_for_phi_optimization): Remove. + (replace_phi_with_stmt): Rename to ... + (replace_phi_edge_with_variable): this and change so that we + replace the phi argument instead of removing the PHI. + (conditional_replacement): Change so we deal with PHI with more + than two arguments. + (value_replacement): Likewise. + (abs_replacement): Likewise. + +2005-03-07 Aldy Hernandez + + * config/rs6000/rs6000-protos.h: Rename output_e500_flip_eq_bit to + output_e500_flip_gt_bit. + + * config/rs6000/rs6000.c (print_operand): case D: Print out bit 31 + as bit 31. + (rs6000_generate_compare): Fix logic to look at the correct bits. + (output_e500_flip_eq_bit): Rename to output_e500_flip_gt_bit. + Look at GT bit. + (rs6000_emit_sCOND): Rename gen_e500_flip_eq_bit to + gen_e500_flip_gt_bit. Rename gen_move_from_CR_eq_bit to + gen_move_from_CR_gt_bit. + + * config/rs6000/rs6000.md ("move_from_CR_eq_bit"): Change bit + ("move_from_CR_eq_bit"): Rename to move_from_CR_gt_bit. + (UNSPEC_MV_CR_EQ): Rename to UNSPEC_MV_CR_GT. + + * config/rs6000/spe.md ("e500_cr_ior_compare"): New. + (E500_CR_IOR_COMPARE): New constant. + +2005-03-08 Earl Chew + David Billinghurst + + * config/i386/host-cygwin.c: New file to support precompiled + headers on cygwin + * config/i386/x-cygwin: Use host-cygwin.c on cygwin host + * config.host: Use above files for cygwin host. + +2005-03-07 David Edelsohn + + * fold-const.c (fold_binary_op_with_conditional_arg): Fix typo + ordering ops from earlier change. + +2005-03-07 Per Bothner + + Various fixes to allow us to again build if --enable-mapped-location: + * c-decl.c (finish_function): Use SET_EXPR_LOCATION instead of + unavailable annotate_with_file_line, if USE_MAPPED_LOCATION. + * tree-cfg.c (remove_bb): If USE_MAPPED_LOCATION, change type of + local variable loc. Change logic appropriately. + * tree-vect-transform.c (vect_finish_stmt_generation): Use + EXPR_LOCATION rather than EXPR_LOCUS if USE_MAPPED_LOCATION. + * c-parser.c (c_parser_for_statement): Initialize loc variable. + * tree.h (DECL_IS_BUILTIN): Temporarily revert definition of + DECL_IS_BUILTIN in the USE_MAPPED_LOCATION because of jc1 issues. + +2005-03-07 Richard Sandiford + + PR rtl-optimization/19683 + * reload1.c (choose_reload_regs): Pass the number of bits, not the + number of bytes, to smallest_int_for_mode. Fix arguments to + REG_CANNOT_CHANGE_MODE_P. + +2005-03-07 Eric Botcazou + + * reorg.c (relax_delay_slots): Check that the jump is + conditional before trying to invert it. + +2005-03-07 Kazu Hirata + + * bb-reorder.c (max_entry_frequency, max_entry_frequency): + Make them static. + + * calls (stack_arg_under_construction): Make it static. + + * flow.c (regs_live_at_setjmp): Make it static. + * flow.h: Remove the corresponding prototype. + + * reload1.c (reload_startobj, reload_firstobj, + something_needs_operands_changed, reload_inherited, + reload_inheritance_insn, reload_override_in, + reload_spill_index): Make them static. + + * recog.c (verify_changes): Make it static. + * recog.h: Remove the corresponding prototype. + + * cfgbuild.c (find_sub_basic_blocks): Remove. + * basic-block.h: Remove the corresponding prototype. + * cfgexpand.c, cfgrtl.c: Don't mention find_sub_basic_blocks + in comments. + * doc/cfg.texi: Don't mention find_sub_basic_blocks. + + * tree-ssa-operands.c (check_build_stmt): Remove. + + * stor-layout.c (set_alignment): Remove. + * tree.h: Remove the corresponding prototype. + + * tree-ssa-pre.c (has_abnormal_preds): Make it static. + + * tree-ssa-dce.c (control_dependence_map, + visited_control_parents): Make them static. + + * cfghooks.c (verify_flow_info): Remove local variable + num_bb_notes. + + * cfgrtl.c (rtl_verify_flow_info_1): Remove local variable + last_bb_seen. + + * loop-unswitch.c (unswitch_loop): Remove local variable src. + +2005-03-07 David Billinghurst + + * config/i386/cygwin1.c(mingw_scan): Use xstrdup in calls to putenv. + +2005-03-07 Joseph S. Myers + + * config/ia64/hpux.h (LINK_SPEC): Add -z. + * config/ia64/ia64.c (ia64_function_value): Return a REG not a + PARALLEL for an empty structure. + +2005-03-07 Kazu Hirata + + * fold-const.c (fold_binary): Remove handling of RANGE_EXPR. + + * fold-const.c (fold_binary): Unroll the very first "for" + loop. + +2005-03-06 David Edelsohn + + * config/rs6000/predicates.md (branch_comparison_operator): Remove + redundant match_code test. + (scc_comparison_operator): Swap match_operand and match_code + tests. + (branch_positive_comparison_operator): Same. + (trap_comparison_operator): Use comparison_operator and swap with + match_code test. + +2005-03-06 Marek Michalkiewicz + + PR target/20288 + * config/avr/avr.c (print_operand): Add 'p' and 'r'. + (out_movhi_r_mr): Read low byte of volatile MEM first. + (out_movhi_mr_r): Write high byte of volatile MEM first. + +2005-03-05 Kazu Hirata + + * cselib.c (reg_values, reg_values_size): Make them static. + + * cse.c (cse_reg_info_table): Make it static. + + * fold-const.c (fold_unary): Use build1 instead of copy_node. + +2005-03-06 Zdenek Dvorak + + * cse.c (find_best_addr): Use canon_for_address. + +2005-03-06 Kazu Hirata + + * cse.c (fold_rtx_subreg, fold_rtx_mem): New. + (fold_rtx): Call fold_rtx_subreg and fold_rtx_mem to handle + SUBREG and MEM, respectively. + + * fold-const.c (fold_binary): Use code instead of t. + + * fold-const.c (optimize_minmax_comparison): Take decomposed + arguments code, type, op0, and op1 instead of t. + (fold_binary): Update a call to optimize_minmax_comparison. + + * fold-const.c (fold_range_test): Take decomposed arguments + code, type, op0, and op1 instead of t. + (fold_binary): Update a call to fold_range_test. + + * fold-const.c (fold_binary_op_with_conditional_arg): Take + decomposed arguments code, type, op0, and op1 instead of t. + (fold_binary): Update a call to fold_range_test. + +2005-03-06 Kazu Hirata + + * fold-const.c (fold_binary): Avoid directly using the original + expression t as much as possible. + +2005-03-05 Kazu Hirata + + * c-semantics.c (build_stmt): Use TYPE_P instead of + IS_NON_TYPE_CODE_CLASS. + * tree.h (IS_NON_TYPE_CODE_CLASS): Remove. + (NON_TYPE_CHECK): Use TYPE_P instead of + IS_NON_TYPE_CODE_CLASS. + + * fold-const.c (fold): Remove handling of binary expressions. + +2005-03-05 James A. Morrison + + * doc/c-tree.texi: Wrap comments in @r{}. + * doc/cpp.texi: Likewise. + * doc/cppinternals.texi: Likewise. + * doc/extend.texi: Likewise. + * doc/md.texi: Likewise. + * doc/objc.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/tm.texi: Likewise. + * doc/tree-ssa.texi + +2005-03-05 Kazu Hirata + + * predict.c (apply_return_prediction): Standardize PHI chain + walking. + * tree-ssa.c (ssa_redirect_edge): Likewise. + + * genattrtab.c, genemit.c, genoutput.c, genrecog.c, + gensupport.c, jump.c, tree-phinodes.c, unwind-dw2-fde-glibc.c: + Update copyright. + + * tree-phinodes.c (remove_phi_node): Drop the last argument. + * tree-flow.h: Adjust the prototype for remove_phi_node. + * lambda-code.c (perfect_nestify): Adjust a call to + remove_phi_node. + * tree-cfg.c + (remove_phi_nodes_and_edges_for_unreachable_block): Likewise. + * tree-outof-ssa.c (eliminate_virtual_phis, remove_ssa_form): + Likewise. + * tree-ssa-dce.c (remove_dead_phis): Likewise. + * tree-ssa-loop-ivopts.c (remove_statement): Likewise. + * tree-ssa-pre.c (remove_dead_inserted_code): Likewise. + * tree-ssa.c (kill_redundant_phi_nodes): Likewise. + + * combine.c (simplify_and_const_int): Use gen_int_mode instead + of GEN_INT (trunc_int_for_mode (...)). + * loop-iv.c (iv_number_of_iterations): Likewise. + * postreload.c (reload_cse_move2add): Likewise. + * simplify-rtx.c (simplify_const_unary_operation, + simplify_const_binary_operation): Likewise. + * stor-layout.c (get_mode_bounds): Likewise. + + * fold-const.c (fold_binary): New. + (fold): Call fold_binary on binary expressions. + +2005-03-05 Richard Sandiford + + * doc/invoke.texi: Document new MIPS -msym32 and -mno-sym32 options. + * config/mips/mips.h (MASK_SYM32, TARGET_SYM32): New macros. + (TARGET_SWITCHES): Add -msym32 and -mno-sym32. + (ABI_HAS_64BIT_SYMBOLS): Set to false if TARGET_SYM32. + (ASM_SPEC): Pass down -msym32 and -mno-sym32. + +2005-03-04 Devang Patel + + PR tree-optimization/18815 + * tree-if-conv.c (combine_blocks): Adjust loop header edges for + loops with zero exit edges. + +2005-03-04 Devang Patel + + * doc/invoke.texi: Remove reference to webpage that does not exist. + +2005-03-04 John David Anglin + Joseph S. Myers + + PR c++/19797 + * pa/elf.h, pa64-hpux.h, som.h (ASM_OUTPUT_EXTERNAL_REAL): Define. + (ASM_OUTPUT_EXTERNAL): Call pa_hpux_asm_output_external. + * pa-protos.h (pa_hpux_asm_output_external): Add prototype. + * pa.c (get_plabel): Change argument to symbol_ref. Call + maybe_get_identifier instead of get_identifier. + (pa_hpux_asm_output_external, pa_hpux_file_end): New functions. + (struct deferred_plabel): Replace name field with symbol field. + (TARGET_ASM_FILE_END): Define as pa_hpux_file_end if + ASM_OUTPUT_EXTERNAL_REAL is defined. + (output_global_address): Use output_addr_const for output of all + symbol_refs. + (output_deferred_plabels): Use symbol_ref instead of name for address + output. + * pa.h (SYMBOL_FLAG_REFERENCED, SYMBOL_REF_REFERENCED_P, + ASM_OUTPUT_SYMBOL_REF): New macros. + * som.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use assemble_name_raw. Update + comment. + (ASM_WEAKEN_LABEL): Use targetm.asm_out.globalize_label to globalize + label. + +2005-03-05 Joseph S. Myers + + * config.gcc (hppa*64*-*-hpux11*): Use pa/pa-hpux1111.h for + *-*-hpux11.[1-9]*, not just for *-*-hpux11.11. + +2005-03-04 Jeff Law + + * basic-block.h (rediscover_loops_after_threading): Declare. + * tree-ssa-dom.c: Include cfgloop.h. + (tree_ssa_dominator_optimize): Discover loops and some basic + properties. Remove forwarder blocks recreated by loop header + canonicalization. Also mark backedges in the CFG. + * tree-ssa-threadupdate.c: Include cfgloop.h + (rediscover_loops_after_threading): Define. + (struct local_info): New field, JUMP_THREADED. + (prune_undesirable_thread_requests): New function. + (redirect_edges): Clear EDGE_ABNORMAL. If edges were threaded + then record that fact for the callers of redirct_edges. + (thread_block): If BB has incoming backedges, then call + prune_undesirable_thraed_requests. Note when we are + going to have to rediscover loop information. Return a + boolean indicating if any jumps were threaded. + (thread_through_all_blocks): Bubble up boolean indicating + if any jumps were threaded. + * Makefile.in (tree-ssa-dom.o): Depend on cfgloop.h + (tree-ssa-threadupdate.o): Similarly. + +2005-03-04 Kazu Hirata + + * fold-const.c (fold_ternary): Unroll the "for" loop to + extract operands. + +2005-03-04 Andrew Haley + + * unwind-dw2-fde-glibc.c (struct + unw_eh_callback_data.check_cache): New field. + (frame_hdr_cache): New. + (_Unwind_IteratePhdrCallback): Add ext_dl_phdr_info. + Cache frame header info. + +2005-03-04 Richard Sandiford + + * rtl.h (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions) + (print_c_condition): Declare. + * read-rtl.c (ptr_loc): New structure. + (ptr_locs, ptr_loc_obstack, joined_conditions) + (joined_conditions_obstack): New variables. + (leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc) + (get_rtx_ptr_loc, copy_rtx_ptr_loc, print_rtx_ptr_loc) + (join_c_conditions, print_c_condition): New functions. + (apply_macro_to_string): Associate the new string with the same + source location as the old one. + (add_condition_to_string): Use join_c_conditions. + (read_string): Use set_rtx_ptr_loc to record a filename and line + number for the string. + (read_rtx): Initialize the new variables above. + * genattrtab.c (write_test_expr, write_attr_value): Use + print_c_condition. + * genconditions.c (write_header): Don't define MAYBE_EVAL. Move its + comment above the GCC_VERSION check. + (write_one_condition): Use print_rtx_ptr_loc and print_c_condition. + Inline the definition of MAYBE_EVAL. + * genemit.c (gen_expand, gen_split): Use print_rtx_ptr_loc. + * genoutput.c (process_template): Likewise. + * genpreds.c (write_predicate_subfunction): Likewise. + (write_predicate_expr): Use print_c_condition. + * genrecog.c (write_cond): Likewise. + * gensupport.c (process_rtx): Use join_c_conditions to join the + conditions of a define_insn_and_split. Record a source location + for the string after the "&&". + (alter_test_for_insn): Use join_c_conditions. + +2005-03-04 Andrew Pinski + + Revert for now: + 2005-03-03 James A. Morrison + PR tree-optimization/15784 + * fold-const.c (fold): Fold ~A + 1 to -A. Fold -A - 1 + and -1 - A to ~A. + +2005-03-04 Ben Elliston + + * gcc.c (option_map): Add --coverage. + (LINK_COMMAND_SPEC): Pass -lgcov for `coverage'. + (cc1_options): Pass -fprofile-arcs -ftest-coverage for `coverage'. + * config/darwin.h: Pass -lgcov for `coverage'. + * doc/invoke.texi (Debugging Options): Document --coverage. + +2005-03-04 Kazu Hirata + + * gcse.c (bypass_block): Use find_edge wherever possible. + +2005-03-03 Daniel Berlin + + Fix PR debug/20253 + + * c-opts.c (c_common_parse_file): Call start_source_file + and end_source_file at the approriate times. + + * dwarf2out.c (dwarf2out_finish): Don't auto-end + the main file, it will be done for us now. + +2005-03-04 Kazu Hirata + + * fold-const.c (fold_ternary): New. + (fold): Call fold_ternary on ternary expressions. Remove + handling of ternary expressions. + +2005-03-03 James A. Morrison + + PR tree-optimization/15784 + * fold-const.c (fold): Fold ~A + 1 to -A. Fold -A - 1 + and -1 - A to ~A. + +2005-03-03 David Edelsohn + + * config/rs6000/predicates.md (branch_comparison_operator): + Convert from C block to conditional format. + +2005-03-03 Jan Hubicka + + * tree-dfa.c (add_referenced_var): Don't walk initializer of external + and non-constant public variables. + +2005-03-03 Kazu Hirata + + * tree-cfg.c (stmt_starts_bb_p): Clean up by replacing code + with LABEL_EXPR. + + * cfgexpand.c (construct_exit_block): Use EDGE_PRED instead of + EDGE_I. + + * tree-phinodes.c (remove_phi_node): Clean up by factoring out + calls to release_ssa_name and release_phi_node. + + * fold-const.c (fold): Remove handling of unary expressions. + + * fold-const.c (fold_unary): Avoid directly using the original + expression t as much as possible. + +2005-03-03 Roger Sayle + Andrew Pinski + + * jump.c (redirect_exp_1): If nlabel is a NULL pointer create a + RETURN rtx, and not a LABEL_REF containing a NULL pointer. + +2005-03-03 Hans-Peter Nilsson + + Describe special registers SRP and MOF as allocatable registers. + * config/cris/cris.c (cris_md_asm_clobbers): New function. + (TARGET_MD_ASM_CLOBBERS): Define to cris_md_asm_clobbers. + (cris_conditional_register_usage): Enable CRIS_MOF_REGNUM if + TARGET_HAS_MUL_INSNS. + (cris_print_operand) : New case. + : Allow CRIS_MOF_REGNUM and CRIS_SRP_REGNUM. + * config/cris/cris.h (CRIS_PC_REGNUM, CRIS_SRP_REGNUM): Don't + define. + (FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS) + (REG_ALLOC_ORDER): Update for MOF. + (enum reg_class): New members MOF_REGS, GENERAL_REGS and + SPECIAL_REGS. + (GENERAL_REGS): No longer a define of ALL_REGS. + (REGNO_REG_CLASS, REG_CLASS_CONTENTS, REG_CLASS_NAMES) + (PREFERRED_RELOAD_CLASS, REGISTER_NAMES, DBX_REGISTER_NUMBER): + Adjust accordingly. + (CRIS_SPECIAL_REGS_CONTENTS): New macro. + (REG_CLASS_FROM_LETTER): Allocate 'h' and 'x'. + (SECONDARY_RELOAD_CLASS): Define. + (STACK_POINTER_REGNUM): Define as CRIS_SP_REGNUM. + (FRAME_POINTER_REGNUM): Define as CRIS_FP_REGNUM. + (ARG_POINTER_REGNUM): Define as CRIS_AP_REGNUM. + (STATIC_CHAIN_REGNUM): Define as CRIS_STATIC_CHAIN_REGNUM. + (REGISTER_MOVE_COST): Define. + (PIC_OFFSET_TABLE_REGNUM): Define in terms of CRIS_GOT_REGNUM. + * config/cris/cris.md (CRIS_GOT_REGNUM, CRIS_STATIC_CHAIN_REGNUM) + (CRIS_FP_REGNUM, CRIS_SP_REGNUM, CRIS_SRP_REGNUM, CRIS_AP_REGNUM) + (CRIS_MOF_REGNUM): New define_constants. + ("*movsi_internal", "movhi", "movqi", "movsf"): Add alternatives for + special registers. + ("reload_inhi", "reload_outhi", "reload_inqi", "reload_outqi"): + New patterns. + ("umulhisi3", "umulqihi3", "mulsi3", "mulqihi3", "mulhisi3") + ("mulsidi3", "umulsidi3", "smulsi3_highpart", "umulsi3_highpart"): + Adjust for MOF being properly described as a register. + (indir_to_reg_split): Name this split. Conditionalize on the + destination register being a general register. + (movei): Conditionalize on on operands 0 and 1 having the same + register class. + +2005-03-03 Alan Modra + + PR target/20277 + * config/rs6000/rs6000.c (rs6000_override_options): Don't allow + -mcpu to override any other explicitly given flags. + +2005-03-02 J"orn Rennecke + + * recog.c (verify_changes, confirm_change_group): New functions, + broken out of apply_change_group. + (apply_change_group): Use them. + * recog.h (verify_change, confirm_change_group): Declare. + * rtl.h (redirect_jump_2): Declare. + * jump.c (redirect_exp, invert_exp): Delete. + (invert_exp_1): Take second parameter. Return value. Changed caller. + (redirect_jump_2): New function, broken out of redirect_jump. + (redirect_jump): Use redirect_jump_1 and redirect_jump_2. + (invert_jump): Use invert_jump_1 and redirect_jump_2. + * ifcvt.c (dead_or_predicable): Use redirect_jump_2. + +2005-03-02 Geoffrey Keating + + * varasm.c (named_section): Use xstrdup rather than doing it by + hand. + + * config/darwin8.h (LIB_SPEC): Switch -lmx and -lSystem. + +2005-03-02 Devang Patel + + Undo PR tree-optimization/18815 fix. + +2005-03-02 Devang Patel + + PR tree-optimization/18815 + * tree-if-conv.c (combine_blocks): Adjust loop header edges for + loops with zero exit edges. + +2005-03-02 Kazu Hirata + + * cfg.c (connect_src, connect_dest, disconnect_src, + disconnct_dest): New. + (unchecked_make_edge, remove_edge, redirect_edge_succ, + redirect_edge_pred): Use the new functions. + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call + free_dominance_info only when needed. + +2005-03-02 David Edelsohn + + PR target/20276 + * config/rs6000/predicates.md (reg_or_cint64_operand): Fix typo. + (reg_or_sub_cint64_operand): Same. + +2005-03-02 Jeff Law + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Fix setting of + CFG_ALTERED in the main DOM iteration loop. + +2005-03-02 Mark Mitchell + + PR c++/19916 + * varasm.c (initializer_constant_valid_p): Allow conversions + between OFFSET_TYPEs. Tidy. + +2005-03-02 Hans-Peter Nilsson + + * config/cris/cris.md ("return"): Remove epilogue delay list + sanity check. + +2005-03-02 Daniel Jacobowitz + + * config/arm/linux-elf.h (ARM_FUNCTION_PROFILER): Do not use (PLT) + for Thumb. + * config/arm/netbsd-elf.h (ARM_FUNCTION_PROFILER): Likewise. + +2005-03-02 Kazu Hirata + + * cfgloop.h, cfgloopanal.c, cfgloopmanip.c, conflict.c, + loop-init.c, loop-unroll.c, print-tree.c, reg-notes.def, + config/m68k/m68k.c, config/mips/mips.h, + config/rs6000/rs6000-protos.h, doc/contrib.texi, + doc/include/gcc-common.texi: Update copyright. + + PR middle-end/18029 and PR middle-end/18030 + * expr.c (optimize_bitfield_assignment_op): Add a special case + to handle BIT_IOR_EXPR and BIT_XOR_EXPR. + + * fold-const.c (fold_unary): New. + (fold): Call fold_unary on unary expressions. + +2005-03-02 Richard Guenther + + * cgraph.h (struct cgraph_edge): Add prev_caller and + prev_callee fields. + (cgraph_node_remove_callees): Export. + * cgraph.c (cgraph_create_edge): Initialize prev_caller + and prev_callee. + (cgraph_edge_remove_callee): New function. + (cgraph_edge_remove_caller): Likewise. + (cgraph_remove_edge): Use. + (cgraph_redirect_edge_callee): Likewise. + (cgraph_node_remove_callees): New function. + (cgraph_node_remove_callers): Likewise. + (cgraph_remove_node): Use. + * tree-optimize.c (tree_rest_of_compilation): Use + cgraph_node_remove_callees instead of manual loop. + * cgraphunit.c (cgraph_finalize_function): Likewise. + (cgraph_expand_function): Likewise. + (cgraph_remove_unreachable_nodes): Likewise. + +2005-03-02 Joseph S. Myers + + PR c/8927 + * c-tree.h (undeclared_variable, build_external_ref): Add extra + argument. + * c-decl.c (undeclared_variable): Take location as argument. + * c-typeck.c (build_external_ref): Likewise. + * c-parser.c (c_parser_postfix_expression): Pass location of + identifier to build_external_ref. + +2005-03-01 David Edelsohn + + * config/rs6000/rs6000.md (cceq splitter): Use operand mode, not + CCEQ mode for branch_positive_comparison_operator test. + * config/rs6000/predicates (branch_comparison_operator): Revert to + define_predicate. + (scc_comparison_operator): Same. + (branch_positive_comparison_operator): Same. + +2005-03-01 Hans-Peter Nilsson + + * config/cris/cris.c (cris_eligible_for_epilogue_delay) + (cris_delay_slots_for_epilogue): Remove. + (save_last): Move into cris_target_asm_function_epilogue. + (cris_target_asm_function_epilogue): Remove tests for file being + NULL. + * config/cris/cris-protos.h (cris_eligible_for_epilogue_delay) + (cris_delay_slots_for_epilogue): Remove prototypes. + * config/cris/cris.h (DELAY_SLOTS_FOR_EPILOGUE) + (ELIGIBLE_FOR_EPILOGUE_DELAY): Do not define. + +2005-03-01 David Edelsohn + + * config/rs6000/predicates.md (branch_comparison_operator): Change + to define_special_predicate. + (scc_comparison_operator): Same. + (branch_positive_comparison_operator): Same. + +2005-03-01 Daniel Berlin + + * Makefile.in (tree-ssa-sink.o): New. + (OBJS-common): Add tree-ssa-sink.o. + * common.opt: Add -ftree-sink + * opts.c (decode_options): flag_tree_sink is set at O1 or higher. + * timevar.def (TV_TREE_SINK): new timevar. + * tree-flow.h (is_hidden_global_store): Prototype. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_sink_code. + * tree-pass.h (pass_sink_code): New. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Move checking + for non-obvious global store store to is_hidden_global_store, and + call that new function. + * tree-ssa-sink.c: New file. + * doc/invoke.texi: Document -fdump-tree-sink and -ftree-sink. + * doc/passes.texi: Document forward store motion. + * testsuite/gcc.dg/tree-ssa/ssa-sink-1.c: New test + * testsuite/gcc.dg/tree-ssa/ssa-sink-2.c: New test + * testsuite/gcc.dg/tree-ssa/ssa-sink-3.c: New test + * testsuite/gcc.dg/tree-ssa/ssa-sink-4.c: New test + +2005-03-01 Per Bothner + + * diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION + and we have a non-zero column-number, add it to the message. + Also factor out the diagnostic_kind_text. + +2005-03-01 Zdenek Dvorak + + * cfgloop.c (flow_loop_entry_edges_find, flow_loop_exit_edges_find, + flow_loop_pre_header_scan, flow_loop_pre_header_find, + flow_loop_scan): Removed. + (flow_loop_dump): Do not dump removed fields. + (flow_loop_free): Do not free removed fields. + (flow_loops_find): Flags argument removed. Do not call flow_loop_scan. + (loop_exit_edge_p): New function. + * cfgloop.h (struct loop): Removed fields pre_header, pre_header_edges, + num_pre_header_edges, entry_edges, num_entries, exit_edges, + num_exits, exits_doms. + (LOOP_TREE, LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES, + LOOP_EDGES, LOOP_ALL): Removed. + (flow_loop_scan): Declaration removed. + (loop_exit_edge_p, mark_loop_exit_edges): Declare. + * cfgloopmanip.c (create_loop_notes): Do not pass flags to + flow_loops_find. + * ifcvt.c (mark_loop_exit_edges): Moved to cfgloopanal.c. + (if_convert): Call flow_loops_find and flow_loops_free + when calling mark_loop_exit_edges. + * cfgloopanal.c (mark_loop_exit_edges): Moved from + ifcvt.c. Removed the flow_loops_find, flow_loops_free and + free_dominance_info calls. + * loop-init.c (flow_loops_find): Ditto. + * passes.c (rest_of_handle_branch_prob): Ditto. + * lambda-code.c (perfect_nestify): Do not call flow_loops_find. + * loop-unroll.c (analyze_insns_in_loop): Do not use + EDGE_LOOP_EXIT. + * predict.c (predict_loops): Do not call flow_loop_scan. + Use get_loop_exit_edges. + (tree_estimate_probability): Do not pass flags to flow_loops_find. + * tree-if-conv.c (bb_with_exit_edge_p): Take loop as argument. + Do not use EDGE_LOOP_EXIT. + (tree_if_convert_cond_expr, if_convertible_modify_expr_p): Pass loop + to bb_with_exit_edge_p. + (if_convertible_loop_p): Do not call flow_loop_scan. Use + loop->single_exit. Do not use EDGE_LOOP_EXIT. Pass loop + to bb_with_exit_edge_p. + (combine_blocks): Pass loop to bb_with_exit_edge_p. Do not use + EDGE_LOOP_EXIT. + * tree-loop-linear.c (linear_transform_loops): Do not call + flow_loop_scan. Use loop->single_exit. + * tree-vect-analyze.c (vect_analyze_operations): Use loop->single_exit. + (vect_analyze_loop_form): Do not call flow_loop_scan. + * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Use + loop->single_exit. + (vect_do_peeling_for_loop_bound): Use loop_preheader_edge and + loop->single_exit. + * tree-vectorizer.c (slpeel_update_phis_for_duplicate_loop, + slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p, + slpeel_tree_duplicate_loop_to_edge_cfg, + slpeel_verify_cfg_after_peeling, slpeel_tree_peel_loop_to_edge): + Use loop_preheader_edge and loop->single_exit. Do not call + flow_loop_scan. + +2005-03-01 Nick Clifton + + * config/arm/arm.c (thumb_find_work_register): Check all of the + argument registers to see if they are free, and a couple of + special cases where the last argument register but can be proved + to be available during the function's prologue. + (print_multi_reg, arm_compute_save_reg0_reg12_mask, + output_return_instruction, emit_multi_reg_push, thumb_pushpop, + thumb_unexpanded_epilogue): Use unsigned long as the type for the + register bit-mask. + (thumb_compute_save_reg_mask): Likewise. Also use + thumb_find_work_register() to ensure that there is agreement about + which work register is going to be used in the prologue. + (thumb_output_function_prologue): Use unsigned long as the type + for the register bit-mask. Also delay pushing the link register if + other high registers are going to be pushed. + (thumb_compute_save_reg_mask, emit_multi_reg_push, + print_multi-reg, number_of_first_bit_set, thumb_pushpop): Remove + redundant prototypes. + +2005-02-28 John David Anglin + + PR target/19819 + * pa.h (GO_IF_LEGITIMATE_ADDRESS): Allow allow hard registers during + and after reload in REG+REG indexed addresses without REG_POINTER + set in the base and not set in the index. + +2005-02-28 Kaz Kojima + + * config/sh/linux.h (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX): + Don't undefine here. + (HANDLE_PRAGMA_PACK_PUSH_POP): Delete. + (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC): Likewise. + (TARGET_OS_CPP_BUILTINS): Use LINUX_TARGET_OS_CPP_BUILTINS. + (LIB_SPEC, LINK_EH_SPEC, STARTFILE_SPEC, ENDFILE_SPEC, + LINK_GCC_C_SEQUENCE_SPEC, USE_LD_AS_NEEDED, TARGET_C99_FUNCTIONS): + Delete. + * config.gcc (sh*-*-linux*): Use config/linux.h. + +2005-02-28 Dale Johannesen + Stan Shebs + + Rewrite of 64-bit Darwin structure-by-value pass/return. + * config/rs6000/rs6000.h (CUMULATIVE_ARGS): New fields + intoffset, use_stack, named. + * config/rs6000/rs6000.c (rs6000_darwin64_function_arg): Remove. + (rs6000_darwin64_record_arg_advance_flush): New. + (rs6000_darwin64_record_arg_advance_recurse): New. + (rs6000_darwin64_record_arg_flush): New. + (rs6000_darwin64_record_arg_recurse): New. + (rs6000_darwin64_record_arg): New. + (rs6000_return_in_memory): Remove AGGREGATE_TYPE_P check. + (function_arg_boundary): Handle 128-bit aligned structs. + (function_arg_advance): Rewrite darwin64 struct handling. + (function_arg): Call rs6000_darwin64_record_arg. + (function_arg_partial_nregs): Handle darwin64 structs. + (rs6000_darwin64_function_value): Remove. + (rs6000_function_value): Call rs6000_darwin64_record_arg. + +2005-02-28 Roger Sayle + + PR tree-optimization/20216 + * tree-chrec.c (tree_fold_factorial): Delete. + (tree_fold_binomial): Change argument list to take a return type + and change the type of K to unsigned int. Rewrite to avoid explicit + evaluation of factorials, and (recursively) calling fold to perform + compile-time arithmetic. Return NULL on (internal) overflow. + (chrec_evaluate): Change type of K to an unsigned int. Avoid + calling tree_fold_binomial unnecessarily. Return chrec_dont_know + if any intermediate calculation overflows. + (chrec_apply): Update call to chrec_evaluate. + +2005-02-28 James E Wilson + + * config/mips/mips.h (NO_PROFILE_COUNTERS): Define. + +2005-02-28 Joseph S. Myers + + PR c/20245 + * c-parser.c (c_parser_compound_statement): Return error_mark_node + instead of NULL_TREE on error. + +2005-02-28 David Edelsohn + + * config/rs6000/rs6000.c (EASY_VECTOR_15): Remove. + (EASY_VECTOR_15_ADD_SELF): Remove. + (num_insns_constant_wide): Not static. + (validate_condition_mode): Not static. + (toc_relative_expr_p): Not static. + (legitimate_indirect_address_p): Not static. + (macho_lo_sum_memory_operand): Not static. + (invalid_e500_subreg): Not static. + (easy_vector_same): Not static. + (easy_vector_splat_const): Not static. + (RS6000_SYMBOL_REF_TLS_P): Remove. + (any_operand): Delete. + (any_parallel_operand): Delete. + (count_register_operand): Delete. + (altivec_register_operand): Delete. + (xer_operand): Delete. + (s8bit_cint_operand): Delete. + (short_cint_operand): Delete. + (u_short_cint_operand): Delete. + (non_short_cint_operand): Delete. + (exact_log2_cint_operand): Delete. + (gpc_reg_operand): Delete. + (cc_reg_operand): Delete. + (cc_reg_not_cr0_operand): Delete. + (reg_or_short_operand): Delete. + (reg_or_neg_short_operand): Delete. + (reg_or_aligned_short_operand): Delete. + (reg_or_u_short_operand): Delete. + (reg_or_cint_operand): Delete. + (reg_or_arith_cint_operand): Delete. + (reg_or_add_cint64_operand): Delete. + (reg_or_sub_cint64_operand): Delete. + (reg_or_logical_cint_operand): Delete. + (got_operand): Delete. + (got_no_const_operand): Delete. + (easy_fp_constant): Delete. + (easy_vector_constant): Delete. + (easy_vector_constant_add_self): Delete. + (zero_constant): Delete. + (zero_fp_constant): Delete. + (volatile_mem_operand): Delete. + (offsettable_mem_operand): Delete. + (mem_or_easy_const_operand): Delete. + (add_operand): Delete. + (non_add_cint_operand): Delete. + (logical_operand): Delete. + (non_logical_cint_operand): Delete. + (mask_operand): Delete. + (mask_operand_wrap): Delete. + (mask64_operand): Delete. + (mask64_2_operand): Delete. + (and64_operand): Delete. + (and64_2_operand): Delete. + (and_operand): Delete. + (reg_or_mem_operand): Delete. + (lwa_operand): Delete. + (symbol_ref_operand): Delete. + (call_operand): Delete. + (current_file_function_operand): Delete. + (input_operand): Delete. + (rs6000_nonimmediate_operand): Delete. + (rs6000_tls_symbol_ref): Delete. + (save_world_operation): Delete. + (restore_world_operation): Delete. + (load_multiple_operation): Delete. + (store_multiple_operation): Delete. + (vrsave_operation): Delete. + (mfcr_operation): Delete. + (mtcrf_operation): Delete. + (lmw_operation): Delete. + (stmw_operation): Delete. + (branch_comparison_operator): Delete. + (branch_positive_comparison_operator): Delete. + (scc_comparison_operator): Delete. + (trap_comparison_operator): Delete. + (boolean_operator): Delete. + (boolean_or_operator): Delete. + (min_max_operator): Delete. + * config/rs6000/rs6000.h (RS6000_SYMBOL_REF_TLS_P): Move to here. + (EASY_VECTOR_15): Moved to here. + (EASY_VECTOR_15_ADD_SELF): Move to here. + (PREDICATE_CODES): Delete. + * config/rs6000/rs6000-protos.h: Delete predicate functions. + Declare functions no longer static. + * config/rs6000/predicates.md: New. + * config/rs6000/rs6000.md: Include predicates.md + +2005-02-28 Kazu Hirata + + * calls.c (emit_call_1): Don't use REG_ALWAYS_RETURN. + (emit_library_call_value_1): Don't use LCT_ALWAYS_RETURN and + REG_ALWAYS_RETURN. + * cfgrtl.c (need_fake_edge_p): Likewise. + * combine.c (distribute_notes): Likewise. + * emit-rtl.c (try_split): Likewise. + * recog.c (peephole2_opimize): Likewise. + * reg-notes.def (ALWAYS_RETURN): Remove. + * rtl.h (LCT_ALWAYS_RETURN): Remove. + * tree-cfg.c (need_fake_edge_p): Don't use ECF_ALWAYS_RETURN. + * tree.h (ECF_ALWAYS_RETURN): Remove. + +2005-02-28 Roger Sayle + + PR middle-end/19874 + * tree-ssa.c (tree_ssa_useless_type_conversion_1): A conversion + between different machine modes is never a "useless" conversion. + +2005-02-28 Geert Bosch + + PR ada/15977 + * doc/contrib.texi: List contributors for Ada front end + +2005-02-28 Paolo Bonzini + + * simplify-rtx.c (simplify_unary_operation_1, + simplify_const_unary_operation): New, extracted from... + (simplify_unary_operation): ... this one. + (simplify_binary_operation_1, + simplify_const_binary_operation): New, extracted from... + (simplify_binary_operation): ... this one. + * rtl.h (simplify_const_unary_operation, + simplify_const_binary_operation): Add prototypes. + +2005-02-28 Julian Brown + + * config/elfos.h: Revert my patch from 2005-02-25 since it broke + building libjava and caused PR regression/20228. + +2005-02-28 Paolo Bonzini + + PR bootstrap/17383 + * Makefile.in (host_subdir): New. + (build_objdir): New. Replace ../$(build_subdir) with it throughout. + * configure: Regenerate. + +2005-02-27 Zack Weinberg + + * config/alpha/t-osf4, config/arm/t-netbsd, config/ia64/t-hpux + * config/pa/t-hpux-shlib (SHLIB_INSTALL): Create the + installation directory first. + +2005-02-28 Hans-Peter Nilsson + + PR target/19065. + * config/cris/cris.h (EXTRA_CONSTRAINT_Q): Accept only (mem (reg)), + not including (reg). Do not check for reg being CRIS_PC_REGNUM. + (EXTRA_MEMORY_CONSTRAINT): Define as 'Q'. + * config/cris/cris.md: Tweak comments referring to Q. + ("cmpsi", "cmphi", "cmpqi", "*movsi_internal", "movhi") + ("movstricthi", "movqi", "movstrictqi", "movsf", "addsi3") + ("addhi3", "addqi3", "subsi3", "subhi3", "subqi3") + ("*expanded_andsi", "*expanded_andhi", "*andhi_lowpart", "andqi3") + ("*andqi_lowpart", "iorsi3", "iorhi3", "iorqi3", "uminsi3"): + Insert spaces in constraints to align alternatives vertically for + readability. + ("cmphi"): Ditto. Add separate alternative for operand 0 "r", + operand 1: "M". + +2005-02-27 John David Anglin + + PR rtl-optimization/17728 + * pa.md (mulsi3, divsi3, udivsi3, modsi3): Change predicate for + operand 0 from general_operand to move_dest_operand. + +2005-02-26 John David Anglin + + * pa/elf.h, pa/som.h (ASM_OUTPUT_EXTERNAL): Use assemble_name_raw + instead of trying to save and restore TREE_SYMBOL_REFERENCED. + * pa/pa64-hpux.h (ASM_OUTPUT_TYPE_DIRECTIVE): Define. + (ASM_OUTPUT_EXTERNAL): Don't save and restore TREE_SYMBOL_REFERENCED. + +2005-02-26 Nathanael Nerode + + * configure.ac: Rename cc_for_cross_gnattools to host_cc_for_libada. + * configure: Regenerate. + * libada-mk.in: Remove CC; rename + cc_for_cross_gnattools / cc_set_by_configure to host_cc_for_libada. + +2005-02-26 Andrew Pinski + + PR tree-opt/20188 + * tree-ssa-alias.c (count_uses_and_derefs): If we have TREE_LIST + for the lhs, also walk over the tree. Likewise for rhs. + +2005-02-26 Zdenek Dvorak + + * tree-ssa-dom.c (simple_iv_increment_p): New function. + (simplify_rhs_and_lookup_avail_expr, eliminate_redundant_computations): + Do not propagate value of iv before increment over the increment. + +2005-02-25 Joseph S. Myers + + * c-parser.c: New file. + * c-parse.in: Remove. + * Makefile.in (c-parse.o-warn, c-parse.o, c-parse.c, c-parse.y): + Remove. + (c-parser.o): Add dependencies. + (C_AND_OBJC_OBJC, C_OBJS, gcc.srcextra, GTFILES, distclean, + maintainer-clean, TAGS): Update. + * c-config-lang.in (gtfiles): Update. + * gengtype-lex.l: Don't handle "@@". + * stub-objc.c (objc_get_class_ivars, objc_build_throw_stmt, + objc_build_synchronized, objc_begin_try_stmt, + objc_begin_catch_clause, objc_finish_catch_clause, + objc_build_finally_clause, objc_finish_try_stmt): New. + * c-tree.h (struct c_declspecs): Add declspecs_seen_p and + type_seen_p. + (c_parse_init): Update comment. + * c-decl.c (c_init_decl_processing): Update comment. + (build_null_declspecs, declspecs_add_qual, declspecs_add_type, + declspecs_add_scspec, declspecs_add_attrs): Initialize and update + new c_declspecs members. + +2005-02-25 Julian Brown + + * config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK + from being used for symbols with vague linkage when + HAVE_GAS_COMDAT_GROUP is true. + +2005-02-25 Mark Mitchell + + * doc/include/gcc-common.texi (version-GCC): Update to 4.1. + +2005-02-25 Steve Ellcey + + PR target/19930 + * doc/tm.texi (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Document. + (LIBGCC2_HAS_DF_MODE): New. + (LIBGCC2_HAS_XF_MODE): New. + (LIBGCC2_HAS_TF_MODE): New. + * libgcc2.h (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE. + (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE. + * libgcc2.c (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE. + (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE. + (LIBGCC2_HAS_DF_MODE): New name for HAVE_DFMODE. + * config/ia64/t-ia64 (LIB1ASMFUNCS): Remove __compat + and add _fixtfdi, _fixunstfdi, _floatditf + * lib1funcs.asm: Remove L__compat. Add L_fixtfdi, + L_fixunstfdi, L_floatditf. + * config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE): Define. + (LIBGCC2_HAS_TF_MODE): Define. + +2005-02-25 Diego Novillo + + PR tree-optimization/20204 + * tree-into-ssa.c (insert_phi_nodes_for): Do not use + REWRITE_THIS_STMT markers on PHI nodes. + (rewrite_initialize_block): Likewise. + +2005-02-25 Mark Mitchell + + * version.c (version_string): Update to 4.1. + +2005-02-25 Paolo Carlini + + * doc/extend.texi (5.24 Declaring Attributes of Functions): + Clarify that the alternative way doesn't work in GNU C++. + +2005-02-25 Zdenek Dvorak + + PR tree-optimization/19937 + * tree-ssa-loop-ivopts.c (rewrite_use_compare): Cast the final value + to the type of the induction variable. + +2005-02-25 Kaz Kojima + + PR rtl-optimization/20117 + * bb-reorder.c (duplicate_computed_gotos): Don't duplicate + the block including noncopyable insn. + +2005-02-24 Kazu Hirata + + * cse.c (delete_trivially_dead_insns): Speed up by minimizing + calls to find_reg_note. + +2005-02-24 Richard Henderson + + PR tree-opt/20127 + * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from + the type. + +2005-02-24 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Check for + vector types if to use base reg for misaligned non-word ld/std. + +2005-02-24 Hans-Peter Nilsson + + PR target/14619 + * config/cris/cris.c (cris_target_asm_function_prologue): Create + dwarf2 label manually and put it after, not before the prologue. + +2005-02-24 David Edelsohn + + PR target/19019 + * reload.c (operands_match_p): Only increment register number for + SCALAR_INT_MODE_P modes in multiple hard registers. + + * config/rs6000/rs6000.md (trunctfdf2): Remove register constraints. + Fix formatting. + +2005-02-24 Volker Reichelt + + * ChangeLog.5: Fix log message typo(s). + * ChangeLog.7: Likewise. + * ChangeLog.tree-ssa: Likewise. + * cfgexpand.c: Fix comment typo(s). + * conflict.c: Likewise. + * defaults.h: Likewise. + * dwarf2out.c: Likewise. + * gcse.c: Likewise. + * ggc-page.c: Likewise. + * tree-eh.c: Likewise. + * tree-ssa-dom.c: Likewise. + +2005-02-24 Jakub Jelinek + + PR target/19019 + * mklibgcc.in: Pass -DSHARED when compiling all *_s${objext} objects. + * config/rs6000/darwin-ldouble.c: Only use the .symver directives + if SHARED is defined. + + PR target/20196 + * config/rs6000/rs6000.md (LTU, GTU sCC splitters): Add earlyclobber, + allow splitting only if operands 0 and 3 don't overlap. + +2005-02-24 Richard Henderson + + PR middle-end/19953 + * builtins.c (fold_builtin_complex_mul, fold_builtin_complex_div): New. + (fold_builtin_1): Call them. + * fold-const.c (fold_complex_mult_parts): Split out from ... + (fold_complex_mult): ... here. Fix typo in both imaginary case. + (fold_complex_div_parts, fold_complex_div): New. + (fold): Use them. + * tree.h (fold_complex_mult_parts, fold_complex_div_parts): Declare. + +2005-02-24 Richard Kenner + + * tree-ssa-ccp.c (visit_assignment): Verify that result of + VIEW_CONVERT_EXPR is_gimple_min_invariant. + + * print-tree.c (print_node_brief): Print LABEL_DECL_UID. + (print_node): Likewise. + Print TYPE_SIZES_GIMPLIFIED. + +2005-02-24 Hans-Peter Nilsson + + * config/cris/cris.md ("umulhisi3", "umulqihi3", "mulsi3") + ("mulqihi3", "mulhisi3", "mulsidi3", "umulsidi3"): Mark input + operands as commutative in constraints. + +2005-02-24 Diego Novillo + + * tree-into-ssa.c: Re-organize internal functions. + +2005-02-24 Richard Henderson + + PR middle-end/18902 + * c-opts.c (c_common_post_options): Set flag_complex_method to 2 + for c99. + * common.opt (fcx-limited-range): New. + * opts.c (set_fast_math_flags): Set flag_cx_limited_range. + * toplev.c (flag_complex_method): Initialize to 1. + (process_options): Set flag_complex_method to 0 if + flag_cx_limited_range. + * doc/invoke.texi (-fcx-limited-range): New. + +2005-02-24 Kazu Hirata + + * cse.c (delete_trivially_dead_insns): Speed up by using + NEXT_INSN and PREV_INSN directly instead of next_real_insn and + prev_real_insn. + +2005-02-24 Andrea Tarani + + * config/m68k/m68k.c (m68k_save_reg): Also save A5 for non-leaf + functions when -mid-shared-library is being used. + +2005-02-23 Daniel Jacobowitz + + * doc/tm.texi (LINK_LIBGCC_SPECIAL): Remove. + (LINK_LIBGCC_SPECIAL_1): Don't mention it. + * gcc.c: Don't check for LINK_LIBGCC_SPECIAL. + * system.h: Poison LINK_LIBGCC_SPECIAL. + +2005-02-23 James E Wilson + + * gengtype.c (note_insn_name): Make 1 element larger. + +2005-02-23 Roger Sayle + + PR target/20018 + PR rtl-optimization/20097 + * simplify-rtx.c (simplify_relational_operation_1): Avoid creating + BImode SUBREGs of SImode registers which confuse the ia64 backend. + +2005-02-23 David Edelsohn + + * t-aix43 (SHLIB_INSTALL): Create directory for shared library. + * t-aix52 (SHLIB_INSTALL): Same. + +2005-02-23 Kazu Hirata + + * genpreds.c: Update copyright. + +2005-02-23 Michael Beach + + PR target/20159 + * config/sparc/t-elf (startup files): Assemble with CPP. + +2005-02-23 Paolo Bonzini + + * genpreds.c (mark_mode_tests): Handle non-VOIDmode match_operands. + (write_predicate_expr): Likewise. + +2005-02-22 Diego Novillo + + PR tree-optimization/20100 + PR tree-optimization/20115 + * tree-optimize.c (init_tree_optimization_passes): Remove + pass_maybe_create_global_var. + * tree-pass.h (pass_maybe_create_global_var): Remove. + * tree-ssa-alias.c (aliases_computed_p): Declare. + (struct alias_info): Add field NUM_PURE_CONST_CALLS_FOUND. + (count_calls_and_maybe_create_global_var): Remove. + (pass_maybe_create_global_var): Remove. + (init_alias_info): Do not declare aliases_computed_p. + (maybe_create_global_var): If the function contains no + call-clobbered variables and a mix of pure/const and regular + function calls, create .GLOBAL_VAR. + Mark all call-clobbered variables for renaming. + (merge_pointed_to_info): Update comment. + (add_pointed_to_var): Likewise. + (is_escape_site): Likewise. + Accept struct alias_info * instead of size_t *. + Update all users. + Update AI->NUM_CALLS_FOUND and AI->NUM_PURE_CONST_CALLS_FOUND + as necessary. + * tree-ssa-operands.c (get_call_expr_operands): If + ALIASES_COMPUTED_P is false, do not add call-clobbering + operands. + * tree-ssa.c (init_tree_ssa): Set ALIASES_COMPUTED_P to false. + (delete_tree_ssa): Likewise. + +2005-02-22 James E Wilson + + * toplev.c (backend_init): Don't call init_adjust_machine_modes here. + (do_compile): Do call it here. + +2005-02-22 Kazu Hirata + + PR rtl-optimization/20017. + * passes.c (rest_of_handle_combine, rest_of_handle_cse, + rest_of_handle_cse2, rest_of_handle_gcse): Call + delete_dead_jumptables immediately before calling cleanup_cfg. + +2005-02-22 Devang Patel + + PR 19952 + * tree-if-conv.c (process_phi_nodes): Use bsi_after_labels and skip + all labels + +2005-02-22 David Edelsohn + + * config/rs6000/aix.h (WINT_TYPE): Define. + +2005-02-22 Stan Shebs + + * config/rs6000/rs6000.c (rs6000_override_options): Default to + natural alignment for 64-bit Darwin. + (rs6000_parse_alignment_option): Warn about uses of -malign-power + on 64-bit Darwin. + * doc/invoke.texi: Document this. + +2005-02-22 DJ Delorie + + * c-common.c (c_common_type_for_mode): Pass the mode's precision + to make_[un]signed_type, not the mode itself. + +2005-02-22 Kazu Hirata + + * cfg.c (cached_make_edge): Call make_edge if edge cache is + not available. Use tail calls wherever possible. + (make_edge): Call unchecked_make_edge to create an edge. + + * tree-outof-ssa.c (SSANORM_USE_COALESCE_LIST): Remove. + (coalesce_ssa_name): Don't check for + SSANORM_USE_COALESCE_LIST. + (rewrite_out_of_ssa): Don't use SSANORM_USE_COALESCE_LIST. + +2005-02-22 Diego Novillo + + * tree-into-ssa.c (rewrite_blocks): Move debug dumps from ... + (rewrite_into_ssa): ... here. + +2005-02-21 Alexandre Oliva + + PR tree-optimization/19786 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Add one + tag to another's may-alias bitmap when adding to the other's list. + +2005-02-21 DJ Delorie + + * tree-ssa-loop-ivopts.c (computation_cost): Start register + numbering at LAST_VIRTUAL_REGISTER+1 to avoid possibly using hard + registers in unsupported ways. + * expmed.c (init_expmed): Likewise. + +2005-02-21 Stan Cox + + * config/iq2000/iq2000.h (DWARF_FRAME_RETURN_COLUMN): Change to 31. + +2005-02-21 Kazu Hirata + + * tree-cfg.c (fold_cond_expr_cond): New. + (make_edges): Call fold_cond_expr_cond. + (find_taken_edge): Accept nothing but INTEGER_CST. + (find_taken_edge_cond_expr): Reject INTEGER_CST other than 0 + and 1. + (find_taken_edge_switch_expr): Remove a check for INTEGER_CST. + + * flow.c (delete_dead_jumptables): Speed up by scanning insns + that do not belong to any basic block. + +2005-02-21 Jeff Law + + * cfganal.c (find_unreachable_blocks): Manually CSE load of + e->dest. + +2005-02-21 Kazu Hirata + + * tree-outof-ssa.c (SSANORM_REMOVE_ALL_PHIS): Remove. + (SSANORM_COALESCE_PARTITIONS, SSANORM_USE_COALESCE_LIST): + Adjust their definitions. + (remove_ssa_form): Don't check for SSANORM_REMOVE_ALL_PHIS. + (rewrite_out_of_ssa): Don't use SSANORM_REMOVE_ALL_PHIS. + + * c-objc-common.h, c-pretty-print.c, cgraphunit.c, except.c, + genautomata.c, langhooks.c, langhooks.h, system.h, + config/arm/lib1funcs.asm: Update copyright. + +2005-02-21 Ulrich Weigand + + * dbxout.c (dbxout_function_end): Emit Lscope label always. + +2005-02-21 Richard Guenther + + PR bootstrap/13770 + * doc/install.texi: Document --with-gc. + +2005-02-21 Paolo Bonzini + + * simplify-rtx.c (simplify_unary_operation): Add a missing + "break" statement. + +2005-02-21 Eric Botcazou + + PR tree-optimization/18663 + * tree-ssa-dom.c (extract_range_from_cond): Return 0 + if the type has variable bounds. + +2005-02-20 Kazu Hirata + + * gcse.c: Remove an obsolete comment. + + * cse.c (init_cse_reg_info): Use xmalloc instead of xrealloc. + +2005-02-20 Hans-Peter Nilsson + + * doc/extend.texi (Function Attributes) : The + attribute "pure" is below this text, not above. + +2005-02-20 John David Anglin + + * pa.c (pa_assemble_integer, get_plabel): Small cleanups. + (pa_asm_output_mi_thunk): Use asm_output_insn instead of fprintf. + * som.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Small cleanup. + +2005-02-20 Zack Weinberg + + PR 18785 + * langhooks.h (struct lang_hooks): Add to_target_charset. + * langhooks.c (lhd_to_target_charset): New function. + * langhooks-def.h: Declare lhd_to_target_charset. + (LANG_HOOKS_TO_TARGET_CHARSET): New macro. + (LANG_HOOKS_INITIALIZER): Update. + * c-common.c (c_common_to_target_charset): New function. + * c-common.h: Declare it. + * c-objc-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to + c_common_to_target_charset. + + * defaults.c (TARGET_BELL, TARGET_BS, TARGET_CR, TARGET_DIGIT0) + (TARGET_ESC, TARGET_FF, TARGET_NEWLINE, TARGET_TAB, TARGET_VT): + Delete definitions. + * system.h: Poison them. + * doc/tm.texi: Don't discuss them. + * builtins.c (fold_builtin_isdigit): Use lang_hooks.to_target_charset. + * c-pretty-print.c (pp_c_integer_constant): Don't use pp_c_char. + (pp_c_char): Do not attempt to generate letter escapes for + newline, tab, etc. + * config/arm/arm.c (output_ascii_pseudo_op): Likewise. + * config/mips/mips.c (mips_output_ascii): Likewise. + +2005-02-20 Dorit Naishlos + + PR tree-optimization/19951 + * tree-vect-analyze.c (vect_analyze_loop_form): Check if loop exit edge + is abnormal. + +2005-02-19 Steven Bosscher + + PR middle-end/19698 + * function.h (struct function): New field `max_loop_depth'. + * cfgloop.c (establish_preds): Update maximum loop depth seen so far. + (flow_loops_find): Reset the max loop depth count before finding loops. + * flow.c (MAX_LIVENESS_ROUNDS): New constant. + (update_life_info_in_dirty_blocks): Remove 2002-05-28 workaround. + (calculate_global_regs_live): Make sure the loop will terminate + when the initial sets are not empty. + +2005-02-19 Zack Weinberg + + * mklibgcc.in: If libgcc_eh.a would be empty, put a dummy + object inside. + * config/ia64/hpux.h: Don't define LIBGCC_SPEC. + +2005-02-19 Richard Sandiford + + PR other/19525 + * doc/invoke.texi: Remove documentation of %M spec. + * gcc.c: Likewise. + (init_spec): Remove %M suffix from -lgcc_s. + (do_spec_1): Remove 'M' case. + * mklibgcc.in: Remove SHLIB_MULTILIB handling. Expect SHLIB_LINK + to put shared libraries in the multilib directory. Remove the + shlib_so_soname substitution variable. Don't add a multilib encoding + to shlib_base_name. Set shlib_slibdir_qual to the full pathname + reported by -print-multi-os-directory. Pass @multilib_dir@ to + SHLIB_INSTALL as well as SHLIB_LINK. + * config/t-slibgcc-elf-ver (SHLIB_SONAME): Use @shlib_base_name@. + (SHLIB_NAME): Delete. + (SHLIB_DIR): New macro. + (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_SOLINK) in $(SHLIB_DIR). + (SHLIB_INSTALL): Adjust accordingly. + * config/t-slibgcc-darwin: As for t-slibgcc-elf-ver. + * config/t-slibgcc-sld: Likewise. + * config/t-libunwind-elf (SHLIBUNWIND_NAME): Delete. + (SHLIBUNWIND_SONAME): Use @shlib_base_name@. + (SHLIBUNWIND_LINK): Put $(SHLIBUNWIND_SONAME) and $(SHLIB_SOLINK) + in $(SHLIB_DIR). + (SHLIBUNWIND_INSTALL): Adjust accordingly. + * config/i386/t-nwld (SHLIB_SONAME): Delete. + (SHLIB_LINK, SHLIB_INSTALL): Use SHLIB_NAME instead of SHLIB_SONAME. + Use @shlib_base_name@ instead of @shlib_so_name@. + * config/ia64/t-hpux (SHLIB_LINK): Put @shlib_base_name@.so.0 + and @shlib_base_name@.so in @multilib_dir@. + (SHLIB_INSTALL): Adjust accordingly. Add @shlib_slibdir_qual@ + to the install path. + * config/mips/t-slibgcc-irix: As for t-slibgcc-elf-ver. + (SHLIB_LINK): Remove previous workaround. + * config/pa/t-hpux-shlib (SHLIB_DIR, SHLIB_SLIBDIR_QUAL): New macros. + (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_NAME) in $(SHLIB_DIR). + (SHLIB_INSTALL): Adjust accordingly. Add $(SHLIB_SLIBDIR_QUAL) to + the install path. + * config/rs6000/t-aix43 (SHLIB_LINK): Put @shlib_base_name@.a in + @multilib_dir@. Use @multilib_dir@ to check for threading libraries. + (SHLIB_INSTALL): Adjust accordingly. + (SHLIB_LIBS): Use @multilib_dir@ to check for threading libraries. + * config/rs6000/t-aix52: As for config/rs6000/t-aix43. + * config/sh/t-linux (SHLIB_LINK, SHLIB_INSTALL): As for + config/t-slibgcc-elf-ver. + +2005-02-19 Zdenek Dvorak + Jakub Jelinek + + PR tree-optimization/19828 + * tree-ssa-loop-im.c: Add a TODO comment. + (movement_possibility): Return MOVE_PRESERVE_EXECUTION for calls + without side-effects. + +2005-02-18 James A. Morrison + + * tree-ssa-ccp.c (widen_bitfield): Pass type to build_int_cst and don't + call fold_convert. + +2005-02-18 James E. Wilson + + * doc/invoke.texi (IA-64 Options): Delete -mb-step. + * config/ia64/ia64.c (last_group, group_idx): Delete variables. + (errata_find_address_regs, errata_emit_nops, fixup_errata): Delete + functions. + (ia64_reorg): Delete fixup_errata call. + * config/ia64/ia64.h (MASK_B_STEP, TARGET_B_STEP): Delete. + (TARGET_SWITCHES): Delete -mb-step entry. + +2005-02-19 Jakub Jelinek + + PR c/20043 + * c-typeck.c (composite_type): Handle quals in transparent unions. + (type_lists_compatible_p): Likewise. + +2005-02-18 Stan Shebs + + * config/darwin.c (machopic_select_rtx_section): Don't put relocatable + expressions in the .literal8 section. + +2005-02-18 Geoffrey Keating + + * config/rs6000/darwin-tramp.asm: Remove stray 'APPLE LOCAL' marker. + +2005-02-18 Roger Sayle + + * fold-const.c (constant_boolean_node): Always create values of the + specified type, don't bother calling truthvalue_conversion. + +2005-02-18 Joseph S. Myers + + * except.c (output_function_exception_table): Call + assemble_external_libcall (eh_personality_libfunc). + +2005-02-18 Joseph S. Myers + + PR target/19886 + * config/ia64/ia64.h (struct machine_function): Add state_num. + * config/ia64/ia64.c (process_epilogue, + process_for_unwind_directive): Use new unwind state numbers each + time rather than state 1. + +2005-02-18 Ulrich Weigand + + PR target/20054 + * config/s390/s390.md ("*llgt_sidi", "*llgt_sidi_split"): Move to + before the "*llgt_didi" pattern. + +2005-02-18 Jason Merrill + + * gimplify.c (gimplify_modify_expr_rhs) [CALL_EXPR]: Revert again. + +2005-02-18 Richard Earnshaw + + * arm/lib1funcs.asm (FUNC_ALIAS): New macro. + (div0): Use it in place of ARM_FUNC_ALIAS. + (lshrdi3, ashrdi3, ashlrdi3): Likewise. + +2005-02-18 Andrew Pinski + + PR middle-end/20030 + * fold-const.c (fold_indirect_ref_1): Use the correct index for zero + access, the lower bound of the array type if it exists. + +2005-02-18 Alexandre Oliva + + PR c++/20008 + * stmt.c (expand_case): Don't assume cleanup_tree_cfg will remove + cases that are out-of-range for the index type. + +2005-02-18 James A. Morrison + + * stmt.c (emit_case_bit_tests): Call fold_convert instead of convert. + (estimate_case_costs): Don't call convert. + * expmed.c (expand_shift): Likewise. + (make_tree): Call fold_convert instead of convert. + +2005-02-18 Jakub Jelinek + + PR c++/19813 + * emit-rtl.c (set_mem_attributes_minus_bitpos): Add assertion + that ref to be marked MEM_READONLY_P doesn't have base that needs + constructing. + +2005-02-18 Joseph S. Myers + + * genautomata.c (output_get_cpu_unit_code_func, + output_cpu_unit_reservation_p): Don't generate old-style function + definitions. + +2005-02-18 Jakub Jelinek + + PR c++/20023 + PR tree-optimization/20009 + * convert.c (convert_to_integer): Revert 2005-02-16 change. + + PR tree-optimization/18947 + * cgraphunit.c (cgraph_finalize_function): When redefining an extern + inline, remove all nodes that are inlined into the extern inline + being redefined. + +2005-02-17 Kazu Hirata + + * bt-load.c, cfgloop.c, convert.c, dominance.c, global.c, + loop-invariant.c, stmt.c, tree-ssa-forwprop.c, + tree-ssa-live.c, tree-ssanames.c, tree-vn.c, + config/host-linux.c, config/arm/fpa.md, config/avr/avr.h: + Update copyright. + +2005-02-17 Roger Sayle + + PR tree-optimization/19917 + * tree-eh.c (tree_could_trap_p): Consider calls to weak functions + to be potentially trapping. + +2005-02-17 Kazu Hirata + + * libgcc2.c, tree-vect-analyze.c: Fix comment typos. + +2005-02-17 Andreas Krebbel + + * builtins.c (expand_builtin_return_addr): Remove tem parameter. + tem becomes a local variable which is set to the value of the + back end defined INITIAL_FRAME_ADDRESS macro. + (expand_builtin_frame_address): Omit the base parameter to + expand_builtin_return_addr. + (expand_builtin_profile_func): Likewise. + * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Define new macro. + (DYNAMIC_CHAIN_ADDRESS): Remove the case for the initial frame. + * doc/tm.texi: Documentation for INITIAL_FRAME_ADDRESS_RTX added. + +2005-02-17 Jakub Jelinek + + * config/s390/s390.c (s390_alloc_pool, s390_free_pool, + s390_chunkify_start): Use BITMAP_ALLOC and BITMAP_FREE. + * config/frv/frv.c (frv_function_epilogue): Likewise. + +2005-02-17 Daniel Berlin + + * lambda-code (perfect_nestify): Remove mark/unmark + for rewriting hack. + * tree-loop-linear.c (linear_transform_loops): Add + rewrite_into_ssa call so that ssa is correct for + rewriting into loop closed. + +2005-02-17 Nathan Sidwell + + * bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove. + * bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and + BITMAP_FREE. + * bt-load.c (btr_def_live_range, combine_btr_defs, + migrate_btr_def, migrate_btr_defs): Likewise. + * cfgcleanup.c (thread_jump): Likewise. + * cfgloop.c (get_loop_body_in_bfs_order): Likewise. + * df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free, + df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute, + df_rd_local_compute, df_reg_info_compute): Likewise. + * dominance.c (init_dom_info, free_dom_info): Likewise. + * flow.c (init_propagate_block_info, + free_propagate_block_info): Likewise. + * gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise. + * global.c (allocate_bb_info, free_bb_info, calculate_reg_pav, + modify_reg_pav): Likewise. + * loop-invariant.c (find_defs, find_invariant_insn, + find_invariants, free_inv_motion_data): Likewise. + * predict.c (tree_predict_by_opcode, + estimate_bb_frequencies): Likewise. + * stmt.c (expand_case): Likewise. + * tree-cfg.c (tree_duplicate_sese_region): Likewise. + * tree-dfa.c (mark_new_vars_to_rename): Likewise. + * tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise. + * tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free, + get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa, + rewrite_ssa_into_ssa): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table, + analyze_edges_for_bb, perform_edge_inserts): Likewise. + * tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise. + * tree-sra.c (tree_sra): Likewise. + * tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise. + * tree-ssa-ccp.c (ccp_fold_builtin): Likewise. + * tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. + * tree-ssa-dse.c (tree_ssa_dse): Likewise. + * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var): + Likewise. + * tree-ssa-live.c (new_tree_live_info, delete_tree_live_info, + calculate_live_on_entry, calculate_live_on_exit, + build_tree_conflict_graph): Likewise. + * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use, + record_important_candidates, set_use_iv_cost, find_depends, + determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data, + tree_ssa_iv_optimize_finalize): Likewise. + * tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit, + find_uses_to_rename_use, rewrite_into_loop_closed_ssa, + tree_duplicate_loop_to_header_edge): Likewise. + * tree-ssa-pre.c (init_pre, fini_pre): Likewise. + * tree-ssa.c (verify_flow_insensitive_alias_info, + verify_name_tags, verify_ssa, init_tree_ssa, + delete_tree_ssa): Likewise. + * tree-ssanames.c (marked_ssa_names, init_ssanames, + fini_ssanames): Likewise. + * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise. + +2005-02-17 Ralf Corsepius + + * config/rs6000/t-rtems: Completely reworked. + +2005-02-17 Ira Rosen + + * tree-data-ref.c (array_base_name_differ_p): Remove gcc_assert. + +2005-02-17 Ira Rosen + + * tree-vect-analyze.c (vect_analyze_pointer_ref_access): Use + POINTER_TYPE_P when checking that type is a pointer. + (vect_get_memtag): Remove. + (vect_address_analysis): Use POINTER_TYPE_P. Call + vect_object_analysis with dummy parameter for memtag. + (vect_object_analysis): Extract memtag (functionality that + used to be in vect_get_memtag and moved here). Fix printings. + (vect_analyze_data_refs): Fix comment. Call vect_object_analysis + with correct parameters. Remove call to vect_get_memtag. + +2005-02-17 Dorit Naishlos + + * Makefile.in (tree-vect-analyze.o, tree-vect-transform.o): New. + (tree-vectorizer.o): Added missing dependencies. + + * tree-vectorizer.h (vect_dump, vect_verbosity_level): Added extern + decleration. + (slpeel_tree_peel_loop_to_edge): Function externalized (had a static + declaration in tree-vectorizer.c, now has an extern declaration in + tree-vectorizer.h). + (slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p, + slpeel_verify_cfg_after_peeling, vect_strip_conversion, + get_vectype_for_scalar_type, vect_is_simple_use, + vect_is_simple_iv_evolution, vect_can_force_dr_alignment_p, + vect_supportable_dr_alignment, new_loop_vec_info, destroy_loop_vec_info, + new_stmt_vec_info, vect_analyze_loop, vectorizable_load, + vectorizable_store, vectorizable_operation, vectorizable_assignment, + vect_transform_loop, vect_print_dump_info, vect_set_verbosity_level, + find_loop_location): Likewise. + + * tree-vectorizer.c (langhooks.h): #include removed. + (slpeel_tree_peel_loop_to_edge): Function externalized. Declaration + moved to tree-vectorized.h. + (slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p, + slpeel_verify_cfg_after_peeling, vect_strip_conversion, + get_vectype_for_scalar_type, vect_is_simple_use, + vect_is_simple_iv_evolution, vect_can_force_dr_alignment_p, + vect_supportable_dr_alignment, new_loop_vec_info, + destroy_loop_vec_info, new_stmt_vec_info, vect_print_dump_info, + vect_set_verbosity_level, find_loop_location): Likewise. + + (vect_analyze_loop): Function externalized. Declaration moved to + tree-vectorized.h. Function definition moved to tree-vect-analyze.c. + (vect_analyze_loop_form): Moved to tree-vect-analyze.c. + (vect_mark_stmts_to_be_vectorized, vect_analyze_scalar_cycles, + vect_analyze_data_ref_accesses, vect_analyze_data_ref_dependences, + vect_analyze_data_refs_alignment, vect_compute_data_refs_alignment, + vect_enhance_data_refs_alignment, vect_analyze_operations, + exist_non_indexing_operands_for_use_p, vect_mark_relevant, + vect_stmt_relevant_p, vect_get_loop_niters, + vect_analyze_data_ref_dependence, vect_compute_data_ref_alignment, + vect_analyze_data_ref_access, vect_analyze_pointer_ref_access, + vect_can_advance_ivs_p, vect_get_ptr_offset, vect_analyze_offset_expr, + vect_base_addr_differ_p, vect_object_analysis, vect_address_analysis, + vect_get_memtag): Likewise. + + (vectorizable_load): Function externalized. Declaration moved to + tree-vectorized.h. Function definition moved to tree-vect-transform.c. + (vectorizable_store, vectorizable_operation, vectorizable_assignment, + vect_transform_loop): Likewise. + (vect_transform_stmt): Moved to tree-vect-transform.c. + (vect_align_data_ref, vect_create_destination_var, + vect_create_data_ref_ptr, vect_create_index_for_vector_ref, + vect_create_addr_base_for_vector_ref, vect_get_new_vect_var, + vect_get_vec_def_for_operand, vect_init_vector, + vect_finish_stmt_generation, vect_generate_tmps_on_preheader, + vect_build_loop_niters, vect_update_ivs_after_vectorizer, + vect_gen_niters_for_prolog_loop, vect_update_inits_of_dr, + vect_update_inits_of_drs, vect_do_peeling_for_alignment, + vect_do_peeling_for_loop_bound): Likewise. + + * tree-vect-analyze.c: New file. + * tree-vect-transform.c: New file. + +2005-02-17 Jason Merrill + + PR mudflap/19319, c++/19317 + * gimplify.c (gimplify_modify_expr_rhs) [CALL_EXPR]: Make return + slot explicit. + +2005-02-17 Gerald Pfeifer + + * doc/install.texi (Specific): Update link for Darwin-specific + tool binary site. + +2005-02-16 James A. Morrison + + * fold-const.c (invert_truthvalue): : Call + constant_boolean_node. + +2005-02-16 David Edelsohn + + PR target/19019 + * config/rs6000/t-aix43 (SHLIB_MAPFILES): Add libgcc-ppc64.ver. + * config/rs6000/t-aix52 (SHLIB_MAPFILES): Same. + +2005-02-16 Richard Henderson + + PR 19920 + * libgcc2.c (WORD_SIZE): Remove all definitions; replace uses + with W_TYPE_SIZE. + (HIGH_WORD_COEFF, HIGH_HALFWORD_COEFF): Remove all definitions; + replace uses with Wtype_MAXp1_F. + (L_fixunstfdi, L_fixtfdi, L_floatditf, L_fixunsxfdi, L_fixxfdi, + L_floatdixf, L_fixunsxfsi, L_fixunsdfdi, L_floatdidf, L_fixunsdfsi, + L_powidf2, L_powixf2, L_powitf2, L_muldc3, L_divdc3, L_mulxc3, + L_divxc3, L_multc3, L_divtc3): Protect with HAVE_DFMODE, HAVE_XFMODE, + and HAVE_TFMODE as appropriate. + (__fixunssfDI): Provide an implementation that doesn't need DFmode. + (__floatdisf): Likewise. + * libgcc2.h (LIBGCC2_DOUBLE_TYPE_SIZE): New. + (HAVE_DFMODE, HAVE_XFMODE, HAVE_TFMODE): New. + (Wtype_MAXp1_F): New. + (DFtype, DCtype, __fixdfdi, __floatdidf, __fixunsdfSI, __fixunsdfDI, + __powidf2, __divdc3, __muldc3): Protect with HAVE_DFMODE. + +2005-02-16 Richard Earnshaw + + * PR target/19162 + * arm.c (arm_apply_result_size): New function. + * arm.h (APPLY_RESULT_SIZE): Define. + * arm-protos.h (arm_apply_result_size): Add prototype. + * arm.md (RO_REGNUM, FPA_F0_REGNUM, FPA_F7_REGNUM): New constants. + (movxf): New expand. + (ldmsi_postinc4_thumb, stmsi_postinc4_thumb): New patterns for Thumb. + (call_value_symbol): Remove predicate for operand 0. + (call_value_insn, sibcall_value, sibcall_value_insn): Likewise. + (untyped_call): Rework to correclty return values for any type. + (untyped_return): New expand. + * fpa.md (movxf_fpa): Simplify and use sfm/lfm when appropriate. + +2005-02-16 Stan Shebs + + * config.gcc (powerpc-*-darwin*): Use fragment for Darwin 8 or later. + * config/rs6000/t-darwin8: New, for 64-bit multilib. + +2005-02-16 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Document required GMP + configure settings on Solaris 7 and later. + +2005-02-16 Diego Novillo + + PR tree-optimization/19865 + * tree-optimize.c (init_tree_optimization_passes): Run + pass_may_alias after pass_sra. + +2005-02-16 Richard Henderson + Stuart Hastings + + PR debug/19521 + * dbxout.c (dbxout_function_end): Take decl parameter; update callers. + Do nothing if debug info suppressed for this function. + (dbxout_begin_function): Early exit if debug info suppressed for + this function. + +2005-02-16 Kazu Hirata + + PR target/20007 + * config/ip2k/ip2k.c (ip2k_reorg): Adjust calls to + find_basic_blocks. + * config/sh/sh.c (sh_output_mi_thunk): Likewise. + + PR tree-optimization/19967 + * builtins.c (expand_builtin_strstr, expand_builtin_strpbrk, + expand_builtin_strchr, expand_builtin_strrchr): Take a new + argument TYPE. Adjust calls to fold_builtin_XXX. + (expand_builtin, fold_builtin_1): Adjust calls to + expand_builtin_XXX. + (fold_builtin_strchr, fold_builtin_strpbrk, + fold_builtin_strstr, fold_builtin_strrchr): Convert the folded + result to a requested type TYPE. + +2005-02-16 Jakub Jelinek + + PR middle-end/19857 + * fold-const.c (fold): Don't optimize (T)(x & cst) to + (T)x & (T)cst if (T)cst overflows. + * convert.c (convert_to_integer) : Pass + TYPE_UNSIGNED (type) as type_for_size's UNSIGNEDP argument. + +2005-02-15 Jeff Law + + * gcse.c (blocks_with_calls): New bitmap. + (alloc_gcse_mem): Allocate it. + (free_gcse_mem): Free it. + (clear_modifY_mem_tables): Clear it. + (record_last_mem_set_info): Set the proper bit in BLOCK_WITH_CALLS + when we encounter CALL_INSNs. + (compute_transp, case MEM): Handle blocks with calls separate + from blocks without calls. Use bitmap iterators rather than + FOR_EACH_BB. + +2005-02-15 Peter O'Gorman + + PR bootstrap/18810 + * mklibgcc.in (vis_hide): Use a temporary object file, not + -o /dev/null. + +2005-02-15 Andy Hutchinson + + PR target/19924 + * config/avr/avr.h (MODES_TIEABLE_P): Define to 1 to allow subreg + access optimization. + +2005-02-15 David Edelsohn + Alan Modra + + PR target/19019 + * config/rs6000/darwin-ldouble.c (_xlqadd): Rename to __gcc_qadd. + (_xlqsub): Rename to __gcc_qsub. + (_xlqmul): Rename to __gcc_qmul. + (_xlqdiv): Rename to __gcc_qdiv. + Provide versioned symbol aliases with old names. + * config/rs6000/libgcc-ppc64.ver: Rename symbols. + * config/rs6000/rs6000.c (rs6000_init_libfuncs): Rename symbols. + * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): New. + * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): New. + * config/rs6000/t-newas (LIB2FUNCS_EXTRA): New. + +2005-02-15 James A. Morrison + + * fold-const.c (fold): Fold -(~A) to A + 1. Fold ~(-A) to A - 1. + Fold ~(A - 1) and ~(A + -1) to -A. + +2005-02-15 James A. Morrison + + PR pch/14940 + PR target/19300 + * config/host-linux.c (linux_gt_pch_use_address): Copy from + config/pa/pa-host.c:pa_gt_pch_use_address. + +2005-02-15 Daniel Berlin + + * tree-vn.c (get_value_handle): Make sure that given an + is_gimple_min_invariant expression, we always return it. + +2005-02-15 Kazu Hirata + + * passes.c (rest_of_handle_gcse): Fix a comment. + +2005-02-15 Jeff Law + + * gcse.c (canon_modify_mem_set_list_set): Kill unnecessary + bitmap. + (alloc_gcse_mem, free_gcse_mem): Corresponding changes. + (canon_list_insert, record_last_mem_set_info): Similarly. + (clear_modify_mem_tables): Similarly. + +2005-02-15 Kazu Hirata + + * bitmap.c, bitmap.h, lambda-code.c, tree-dfa.c, tree-dump.c, + tree-dump.h, tree-ssa-loop-manip.c, value-prof.c, + config/mips/mips.md, config/rs6000/aix.h, + config/rs6000/beos.h, config/rs6000/sysv4.h: Update copyright. + +2005-02-15 Richard Henderson + + * bb-reorder.c (find_traces_1_round): Force fallthru edge from a + call to be best_edge. + +2005-02-14 Kazu Hirata + + * basic-block.h: Adjust the prototype for find_basic_blocks. + * cfgbuild.c (find_basic_blocks): Remove unused arguments. + * passes.c (rest_of_handle_loop_optimize): Adjust the call to + find_basic_blocks. + + * flow.c (recompute_reg_usage): Remove all arguments. + * passes.c (rest_of_compilation): Adjust the call to + recompute_reg_usage. + * rtl.h: Adjust the prototype for recompute_reg_usage. + +2005-02-14 Daniel Berlin + + * tree-dump.c (dump_files): Update to reflect new member + of dump_file_info. + (dump_register): Add new argument. + Set glob name. + (dump_switch_p_1): Check against glob name if doglob was passed. + (dump_switch_p): Check against regular first, then glob if + we didn't have any hits on the dump name. + * tree-optimize.c (register_one_dump_file): + Pass in glob name as well. + * tree-pass.h (struct dump_file_info): Add glob + member. + +2005-02-14 Joseph S. Myers + + PR preprocessor/16323 + * doc/invoke.texi: Document that -Wendif-labels is on by default. + +2005-02-14 David Edelsohn + + PR target/19019 + * config/rs6000/rs6000.md (trunctfdf2): Change to define_expand. + (trunctfdf2_internal1): New. + (trunctfdf2_internal2): Renamed from trunctfdf2. + +2005-02-14 Diego Novillo + + PR tree-optimization/19853 + * tree-dfa.c (add_referenced_var): Always examine DECL_INITIAL. + +2005-02-14 Kazu Hirata + + * passes.c (rest_of_handle_loop_optimize): Remove calls to + delete_dead_jumptables and cleanup_cfg. + +2005-02-14 Ulrich Weigand + + * reload.c (find_reloads): Swap address_reloaded flags when + swapping commutative operands. + +2005-02-14 Sebastian Pop + + * lambda-code.c (lambda_loopnest_to_gcc_loopnest, perfect_nestify): + Use standard_iv_increment_position for computing the bsi position + for create_iv. + * tree-ssa-loop-manip.c (create_iv): Add a comment on how to compute + the bsi position. + +2005-02-13 Zdenek Dvorak + + PR target/17428 + * cfgrtl.c (safe_insert_insn_on_edge): Avoid extending + life range of hard registers. + * value-prof.c (insn_prefetch_values_to_profile): Only + scan normal insns. + + * value-prof.c (rtl_find_values_to_profile): Do not look for values to + profile in libcalls. + +2005-02-13 Nathan Sidwell + + * bitmap.h (bitmap_and_compl_into): Return bool. + * bitmap.c (bitmap_and_compl_into): Return changed flag. + +2005-02-13 James A. Morrison + + PR tree-optimization/19944 + * fold-const.c (fold): Re-add ABS_EXPR folding. + +2005-02-13 David Edelsohn + + PR target/19019 + * config/rs6000/aix.h ({TARGET,MASK}_XL_CALL): Rename to + {TARGET,MASK}_XL_COMPAT. + (SUBTARGET_SWITCHES): Rename xl-call to xl-compat. Use + MASK_XL_COMPAT. + * config/rs6000/beos.h ({TARGET,MASK}_XL_CALL): Remove. + * config/rs6000/rs6000.c (function_arg): Change TARGET_XL_CALL to + TARGET_XL_COMPAT. + (rs6000_arg_partial_bytes): Same. + (rs6000_generate_compare): Generate PARALLEL for compare if TFmode + and XL compatibility enabled. + * config/rs6000/rs6000.h (TARGET_XL_CALL): Rename to TARGET_XL_COMPAT. + * config/rs6000/rs6000.md (cmptf_internal1): Add !TARGET_XL_COMPAT + test to final condition. + (cmptf_internal2): New. + * doc/invoke.texi (RS/6000 Subtarget Options): Change xl-call to + xl-compat. Add TFmode information to description. + +2005-02-13 Kazu Hirata + + * flags.h, read-rtl.c, tree-ssa-live.h: Update copyright. + +2005-02-13 Jason Merrill + + PR c++/16405 + * fold-const.c (fold_indirect_ref_1): Split out from... + (build_fold_indirect_ref): Here. + (fold_indirect_ref): New fn. + * tree.h: Declare it. + * gimplify.c (gimplify_compound_lval): Call fold_indirect_ref. + (gimplify_modify_expr_rhs): Likewise. + (gimplify_expr): Likewise. + +2005-02-13 James A. Morrison + + PR tree-optimization/14303 + PR tree-optimization/15784 + * fold-const.c (fold): Fold ABS_EXPR >= 0 to true, when possible. + Fold ABS_EXPR < 0 to false. Fold ABS_EXPR == 0 to x == 0 and + ABS_EXPR != 0 to x != 0. + +2005-02-12 Kazu Hirata + + * c-tree.h, combine.c, expmed.c, flow.c, libgcc2.c, + simplify-rtx.c, tree-ssa-live.h: Fix comment typos. Follow + spelling conventions. + + * passes.c (rest_of_handle_gcse): Don't run cse_main and + delete_trivially_dead_insns too many times. + + * passes.c (rest_of_handle_gcse): Remove dead assignments to + tem and tem2. + +2005-02-12 Ira Rosen + + * tree-vectorizer.c (vect_get_base_and_offset): Remove. + (vect_is_simple_iv_evolution): Remove redundant parameter + and step check. + (vect_analyze_scalar_cycles): Call vect_is_simple_iv_evolution + without last parameter. + (vect_analyze_pointer_ref_access): Get access_fn as parameter. + Return pointer step. Call vect_is_simple_iv_evolution without + last parameter. Check only that the step is multiple of size + type. Remove stmt_vinfo updates. + (vect_get_memtag_and_dr): Remove. + (vect_get_memtag): New function. + (vect_address_analysis): New function. + (vect_object_analysis): New function. + (vect_analyze_data_refs): Call vect_object_analysis and + vect_get_memtag. Update stmt_vinfo fields. + +2005-02-12 Ira Rosen + + * tree-data-ref.c (array_base_name_differ_p): Check that the bases + exist and are objects. Remove checks for pointer. + * tree-vectorizer.c (vect_create_addr_base_for_vector_ref): Use + STMT_VINFO_VECT_DR_BASE_ADDRESS instead of DR_BASE_NAME. + (vect_create_data_ref_ptr): Likewise. + (vect_base_addr_differ_p): New function. + (vect_analyze_data_ref_dependence): Call vect_base_addr_differ_p. + (vect_analyze_pointer_ref_access): Add output parameter - ptr_init. + Don't set the DR_BASE_NAME field of data-ref. + (vect_get_memtag_and_dr): Use ptr_init instead of DR_BASE_NAME. + +2005-02-12 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_ldexp. + (ldexp_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize ldexp_optab. + * genopinit.c (optabs): Implement ldexp_optab using ldexp?f3 + patterns. + * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_LDEXP{,F,L} + using ldexp_optab. + (expand_builtin): Expand BUILT_IN_LDEXP{,F,L} using + expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set. + + * config/i386/i386.md (ldexpsf3, ldexpdf3, ldexpxf3): New expanders + to implement ldexpf, ldexp and ldexpl built-ins as inline x87 + intrinsics. + +2005-02-12 Ira Rosen + + * tree-vectorizer.h (struct _stmt_vec_info): Rename a field: base + to base_address. + * tree-vectorizer.c (new_stmt_vec_info): Rename the above field of + stmt_vec_info. + (vect_get_base_and_offset): Always return an address. + (vect_create_addr_base_for_vector_ref): Remove treatment for + different data reference types. + (vect_compute_data_ref_alignment): Rename base to base_address in + stmt_vec_info. Get the object in order to force its alignment. + (vect_get_memtag_and_dr): Rename base to base_address in + stmt_vec_info. Extract the object for memtag analysis. + +2005-02-12 Hans-Peter Nilsson + + PR regression/19898. + * config/cris/cris.c (cris_notice_update_cc): When testing if insn + changes cc_status, use apply modified_in_p to part of cc_status + and insn, not cris_reg_overlap_mentioned_p on SET_DEST of insn + body. + +2005-02-11 Richard Henderson + + * tree-complex.c (expand_complex_libcall): New. + (expand_complex_multiplication): Use it for c99 compliance. + (expand_complex_division): Likewise. + * fold-const.c (fold_complex_add, fold_complex_mult): New. + (fold): Call them. + * builtins.c (built_in_names): Remove const. + * tree.c (build_common_builtin_nodes): Build complex arithmetic + builtins. + * tree.h (BUILT_IN_COMPLEX_MUL_MIN, BUILT_IN_COMPLEX_MUL_MAX): New. + (BUILT_IN_COMPLEX_DIV_MIN, BUILT_IN_COMPLEX_DIV_MAX): New. + (built_in_names): Remove const. + * c-common.c (c_common_type_for_mode): Handle complex modes. + * flags.h, toplev.c (flag_complex_method): Rename from + flag_complex_divide_method. + * libgcc2.c (__divsc3, __divdc3, __divxc3, __divtc3, + __mulsc3, __muldc3, __mulxc3, __multc3): New. + * libgcc2.h: Declare them. + * libgcc-std.ver: Export them. + * mklibgcc.in (lib2funcs): Build them. + +2005-02-11 Steven Bosscher + + PR tree-optimization/19876 + Partially revert my change from 2005-01-14 + * tree-ssa-pre.c (compute_antic_aux): Make recursive once again... + (compute_antic): ...and remove the loop here. + +2005-02-11 Jakub Jelinek + + PR middle-end/19858 + * fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize + is number of inner's bits, avoid creating a BIT_FIELD_REF. + + * config/rs6000/sysv4.h (ENDFILE_LINUX_SPEC): Use crtendS.o instead of + crtend.o if -pie. Use %{x:a;:b} spec syntax. + +2005-02-11 Daniel Jacobowitz + + * config/mips/linux-unwind.h (mips_fallback_frame_state): Adjust + offsets for the big-endian 32-bit case. + +2005-02-11 Joseph S. Myers + + * config/ia64/hpux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Define. + +2005-02-11 Dale Johannesen + + * cselib.c (cselib_process_insn): Clear out regs where + HARD_REGNO_CALL_PART_CLOBBERED is true at a call. + * reload.c (find_equiv_reg): Ditto. + +2005-02-11 Ian Lance Taylor + + * read-rtl.c (read_rtx_1): Give fatal error if we see a vector + with no elements. + + * tree.c (build_function_type_list): Work correctly if there are + no arguments. + +2005-02-11 Ulrich Weigand + + * config/s390/s390.md ("*cmpdi_cct", "*cmpsi_cct", "*cmpdi_ccs", + "*cmpsi_ccs"): Use %h instead of %c to print immediate operand. + ("*zero_extendhisi2_64", "*zero_extendhisi2_31"): Choose based on + TARGET_ZARCH instead of TARGET_64BIT. + +2005-02-11 Ralf Corsepius + + * config/rs6000/t-rtems: + (MULTILIB_OPTIONS): Remove mcpu=602. + (MUTLILIB_DIRNAMES): Remove m602. + (MULTILIB_MATCHES): Add ${MULTILIB_MATCHES_FLOAT}. + Let mcpu=602 match mcpu=603. + (MULTILIB_NEW_EXCEPTIONS_ONLY): Add mcpu=601, mcpu=602, mcpu=m603. + +2005-02-10 John David Anglin + + * pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned + signal trampolines. + +2005-02-10 David Daney + + * config/alpha/linux-unwind.h: Add exception clause to copyright. + * config/i386/linux-unwind.h: Likewise. + * config/ia64/linux-unwind.h: Likewise. + * config/mips/linux-unwind.h: Likewise. + * config/pa/linux-unwind.h: Likewise. + * config/rs6000/linux-unwind.h: Likewise. + * config/s390/linux-unwind.h: Likewise. + * config/sh/linux-unwind.h: Likewise. + * config/sparc/linux-unwind.h: Likewise. + +2005-02-10 Steven Bosscher + + PR tree-optimization/17549 + * tree-outof-ssa.c (find_replaceable_in_bb): Do not allow + TER to replace a DEF with its expression if the DEF and the + rhs of the expression we replace into have the same root + variable. + +2005-02-10 Richard Sandiford + + * config/mips/mips.md: Fix the placement of the match_scratch in the + lea64 peephole2. + +2005-02-10 Kazu Hirata + + * cse.c, tree-ssa-loop-ivopts.c, config/rs6000/linux-unwind.h: + Fix comment typos. + +2005-02-10 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (determine_base_object): Ignore casts. + (strip_offset): Handle addresses. + (add_address_candidates): Use strip_offset. + (difference_cost): Reflect strip_offset change. + (force_var_cost, difference_cost): Strip nops. + +2005-02-10 Kazu Hirata + + * df.h (DF_REF_MODE_CHANGE, DF_REF_MEM_OK): Remove. + + * builtins.def, haifa-sched.c, libgcc2.c, libgcc2.h, + tree-ssa-loop-ivcanon.c, tree-ssa-loop-niter.c, + config/cris/cris-protos.h, config/cris/cris.c: Update + copyright. + +2005-02-10 Jeff Law + + * tree-ssa-dom.c (thread_across_edge): Use xmalloc, not xcalloc. + (lookup_avail_expr): Similarly. + +2005-02-10 Richard Guenther + + * builtins.c (fold_builtin_powi): New function. + (fold_builtin_1): Call it. + +2005-02-10 Steven Bosscher + + PR documentation/19309 + * doc/cpp.texi: The __GNUC__ and related predefined macros + are also defined for the "standalone" cpp. + Some non-GCC compilers may also define __GNUC__. + +2005-02-10 Jakub Jelinek + + PR c/19342 + * c-typeck.c (common_type): New routine. Old common_type renamed + to... + (c_common_type): ...this. + (build_conditional_expr, build_binary_op): Use c_common_type instead + of common_type. + +2005-02-10 Steven Bosscher + + * doc/md.texi: Replace @samp{length} with @code{length}. + +2005-02-09 Zdenek Dvorak + + PR tree-optimization/18687 + * tree-flow.h (find_loop_niter): Declare. + * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): + Try using scev even for loops with more than one exit. + * tree-ssa-loop-ivopts.c (struct loop_data): Removed niter field. + (struct ivopts_data): Added niters field. + (struct nfe_cache_elt): New. + (nfe_hash, nfe_eq, niter_for_exit, niter_for_single_dom_exit): New + functions. + (tree_ssa_iv_optimize_init): Initialize niters cache. + (determine_number_of_iterations): Removed. + (find_induction_variables): Do not call determine_number_of_iterations. + Access niters for single exit through niter_for_single_dom_exit. + (add_iv_outer_candidates): Access niters for single exit through + niter_for_single_dom_exit. + (may_eliminate_iv): Take data argument. Use niter_for_exit. Do not use + number_of_iterations_cond. + (iv_period): New function. + (determine_use_iv_cost_condition): Pass data to may_eliminate_iv. + (may_replace_final_value): Take data argument. Use + niter_for_single_dom_exit. + (determine_use_iv_cost_outer): Pass data to may_replace_final_value. + (rewrite_use_compare): Pass data to may_eliminate_iv. + (rewrite_use_outer): Pass data to may_replace_final_value. + (free_loop_data): Clean up the niters cache. + (tree_ssa_iv_optimize_finalize): Free the niters cache. + (tree_ssa_iv_optimize_loop): Do not call loop_commit_inserts. + * tree-ssa-loop-niter.c (find_loop_niter): New function. + (find_loop_niter_by_eval): Use tree_int_cst_lt. + (num_ending_zeros): Moved to tree.c. + * tree.h (num_ending_zeros): Declare. + * tree.c (num_ending_zeros): Moved from tree.c. + +2005-02-09 Richard Henderson + + * builtins.c (DEF_BUILTIN): Add COND argument. + * tree.h (DEF_BUILTIN): Likewise. + * builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN, DEF_EXT_LIB_BUILTIN, + DEF_C94_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN): Update to + match. + (DEF_BUILTIN_STUB): New. + (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE, BUILT_IN_INIT_TRAMPOLINE, + BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO, + BUILT_IN_PROFILE_FUNC_ENTER, BUILT_IN_PROFILE_FUNC_EXIT): Use it. + * c-common.c (DEF_BUILTIN): Add COND argument. + * tree.c (local_define_builtin): New. + (build_common_builtin_nodes): New. + +2005-02-09 Roger Sayle + + * fold-const.c (fold_strip_sign_ops): New function to simplify a + floating point expression ignoring the sign of the result. + (fold) : Use it to simplify fabs(x). + (fold) : Use it to simplify x*x. + * tree.h (fold_strip_sign_ops): Prototype here. + * builtins.c (fold_builtin_copysign): Take an additional FNDECL + argument. Use fold_strip_sign_ops to simplify the first argument. + (fold_builtin_pow): Use fold_strip_sign_ops to simplify the + first argument when the second argument is an even integer + constant, but only with -funsafe_math_optimizations. + (fold_builtin_1): Update call to fold_builtin_copysign. + +2005-02-09 Ian Lance Taylor + + PR middle-end/19583 + * gimple-low.c (try_catch_may_fallthru): In EH_FILTER_EXPR case, + just check whether EH_FILTER_FAILURE falls through. + +2005-02-09 Andreas Krebbel + + * haifa-sched.c (schedule_block): Make queued sched group + insns return to ready list in the next turn. + +2005-02-09 Richard Guenther + + PR middle-end/19402 + * builtins.def: New __builtin_powi[lf]. + * builtins.c (mathfn_built_in): Handle BUILT_IN_POWI. + (expand_builtin_powi): New function. + (expand_builtin): Dispatch to expand_builtin_powi. + * libgcc2.h: Add prototypes for __builtin_powi[lf]. + * libgcc2.c: Add __builtin_powi[lf] implementation. + * mklibgcc.in: Add __builtin_powi[lf] to lib2funcs. + * optabs.h: Add powi_optab. + * optabs.c (init_optabs): Initialize powi_optab. + * doc/extend.texi: Document __builtin_powi[lf]. + +2005-02-09 Dorit Naishlos + + * tree-vectorizer.c (vect_set_dump_settings): Check that dump_file + exists. + +2005-02-09 Richard Guenther + + PR middle-end/19854 + * fold-const.c (try_move_mult_to_index): Remove redundant + type argument. Create ADDR_EXPR with correct type. + (fold): Update callers of try_move_mult_to_index. Convert + result to the appropriate type. + +2005-02-09 Roger Sayle + + PR target/19597 + * config/avr/avr.c (default_rtx_costs): Delete. + (avr_operand_rtx_cost): New function. + (avr_rtx_costs): Completely rewrite. + +2005-02-08 Hans-Peter Nilsson + + PR target/19806 + * config/cris/cris.c (in_code): New variable. + (cris_output_addr_const): Now a static function, a wrapper for + output_addr_const. + (cris_asm_output_symbol_ref): New function, broken out SYMBOL_REF + case from old cris_output_addr_const. + (cris_asm_output_label_ref): Similar for LABEL_REF. + (cris_output_addr_const_extra): Similar for UNSPEC. + * config/cris/cris.h (OUTPUT_ADDR_CONST_EXTRA) + (ASM_OUTPUT_SYMBOL_REF, ASM_OUTPUT_LABEL_REF): Define. + * config/cris/cris-protos.h (cris_output_addr_const): Remove + declaration. + (cris_asm_output_symbol_ref, cris_output_addr_const_extra) + (cris_asm_output_label_ref): Declare. + +2005-02-08 Paolo Bonzini + + PR preprocessor/19801 + * doc/cppinternals.texi (Conventions, Lexer, Files): Adjust + filenames that changed when libcpp was moved to the toplevel. + +2005-02-07 Roger Sayle + + * simplify-rtx.c (simplify_relational_operation_1): Avoid creating + zero extensions of BImode operands. Call lowpart_subreg instead + of gen_lowpart_common and gen_lowpart_SUBREG. + +2005-02-07 Nathanael Nerode + + PR ada/19489 + * libada-mk.in: Use cc_for_cross_gnattools, not cc_set_by_configure. + * configure.ac: Set cc_for_cross_gnattools. + * configure: Regenerate. + +2005-02-08 Alan Modra + + PR target/19803 + * predict.c (PROB_VERY_UNLIKELY): Use 1% instead of 10%. + +2005-02-07 Eric Botcazou + + PR debug/19327 + * dbxout.c (dbxout_symbol) : Skip inline instance + of nested functions. + +2005-02-07 Jonathan Wakely + + * doc/extend.texi: Document deprecated extensions allowing + static floating-point members to have initializers and allowing + floating-point literals in integral constant expressions. + +2005-02-07 Kazu Hirata + + * cfgcleanup.c, df.h, diagnostic.c, rtl.c, tree-vectorizer.h, + config/darwin7.h, config/mips/mips.c, + config/rs6000/altivec.md, config/rs6000/darwin-tramp.asm: + Update copyright. + + * cse.c: Update comments. + +2005-02-07 Richard Guenther + + PR middle-end/19775 + * builtins.c (fold_builtin_sqrt): Transform + sqrt(pow(x,y)) to pow(fabs(x),y*0.5), not + pow(x,y*0.5). + +2005-02-07 Leehod Baruch + Dorit Naishlos + + * doc/invoke.texi (ftree-vectorizer-verbose): New. + * opts.c (OPT_ftree_vectorizer_verbose_): New case for switch. + * common.opt (ftree-vectorizer-verbose): New Flag for the vectorizer + was added. + * tree.h (vect_set_verbosity_level): New extern function declaration + added. + * tree-vectorizer.h (verbosity_levels): New enum type. + * tree-vectorizer.c (vect_debug_stats): Function removed. + (vect_debug_details): Likewise. + (vect_verbosity_level): Global variable was defined and initialized. + (vect_dump): Global variable definition. + (vect_print_dump_info): New function. + (vect_set_dump_settings): New function. + (vect_set_verbosity_level): New function. + (vectorize_loops): Add call to vect_set_dump_settings. + + (slpeel_make_loop_iterate_ntimes): Dump condition was changed. + (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. + (slpeel_tree_peel_loop_to_edge): Likewise. + + (vect_analyze_offset_expr): Call to vect_print_dump_info with + appropriate verbosity level instead of call to vect_debug_details + or vect_debug_stats. + (vect_get_base_and_offset): + (vect_create_addr_base_for_vector_ref): + (get_vectype_for_scalar_type): + (vect_create_data_ref_ptr): + (vect_init_vector): + (vect_get_vec_def_for_operand): + (vect_finish_stmt_generation): + (vectorizable_assignment): + (vectorizable_operation): + (vectorizable_store): + (vectorizable_load): + (vect_transform_stmt): + (vect_update_ivs_after_vectorizer): + (vect_do_peeling_for_loop_bound): + (vect_update_inits_of_drs): + (vect_do_peeling_for_alignment): + (vect_transform_loop): + (vect_is_simple_use): + (vect_analyze_operations): + (vect_is_simple_iv_evolution): + (vect_analyze_scalar_cycles): + (vect_analyze_data_ref_dependence): + (vect_analyze_data_ref_dependences): + (vect_compute_data_ref_alignment): + (vect_enhance_data_refs_alignment): + (vect_analyze_data_refs_alignment): + (vect_analyze_data_ref_access): + (vect_analyze_data_ref_accesses): + (vect_analyze_pointer_ref_access): + (vect_get_memtag_and_dr): + (vect_analyze_data_refs): + (vect_mark_relevant): + (vect_stmt_relevant_p): + (vect_mark_stmts_to_be_vectorized): + (vect_can_advance_ivs_p): + (vect_get_loop_niters): + (vect_analyze_loop_form): + (vect_analyze_loop): + (vectorize_loops): Likewise. + + (vect_do_peeling_for_loop_bound): Dump format slightly changed. + (vect_update_inits_of_drs): + (vect_do_peeling_for_alignment): + (vect_transform_loop): + (vect_analyze_operations): + (vect_analyze_scalar_cycles): + (vect_analyze_data_ref_dependences): + (vect_analyze_data_refs_alignment): + (vect_analyze_data_ref_accesses): + (vect_analyze_data_refs): + (vect_mark_stmts_to_be_vectorized): + (vect_get_loop_niters): + (vect_analyze_loop_form): + (vect_analyze_loop): Likewise. + (vect_mark_stmts_to_be_vectorized): Add call to print_generic_expr. + +2005-02-07 Richard Sandiford + + PR bootstrap/19796 + Revert: + 2005-01-26 Richard Sandiford + * config/mips/iris6.h (ENDFILE_SPEC): Don't link in irix-csr.o if + either -ffast-math or -funsafe-math-optimizations is in use. + + 2005-01-24 Richard Sandiford + * config/mips/irix-csr.c: New file. + * config/mips/t-iris6 (irix-csr.o): New rule to build it. + (EXTRA_MULTILIB_PARTS): Add irix-csr.o. + * config/mips/iris6.h (ENDFILE_SPEC): Include it in n32 and n64 + executables. + +2005-02-07 Alexandre Oliva + + * config/mn10300/linux.h (LIB_SPEC, STARTFILE_SPEC): Remove + redundant, incorrect definitions. + + * config/frv/frv.md ("tls_indirect_call"): Turn into libcall-like + expand. + ("*tls_indirect_call"): New, reference hard regs directly. + * config/frv/frv.c (gen_inlined_tls_plt): Adjust. + +2005-02-07 Ralf Corsepius + + * config/arm/rtems-elf.h (SUBTARGET_EXTRA_ASM_SPEC): + Let !-mhard-float !-msoft-float imply -mfpu=softfpa. + +2005-02-06 Roger Sayle + + PR rtl-optimization/19800 + * simplify_rtx.c (simplify_relational_operation_1): Explicitly + call gen_lowpart_common and gen_lowpart_SUBREG instead of calling + gen_lowpart. + +2005-02-07 Ralf Corsepius + + * config/m68k/t-rtems (MULTILIB_MATCHES): Let m528x match m5200. + +2005-02-07 Joseph S. Myers + + PR other/17135 + * doc/invoke.texi: Correct documentation of -freorder-functions. + +2005-02-06 Joseph S. Myers + + PR other/14402 + * doc/invoke.texi: Don't mention gccbug. + +2005-02-06 Roger Sayle + Andrew Pinski + Paolo Bonzini + + * simplify-rtx.c (simplify_relational_operation_1): Simplify + (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0)) + into just (zero_extract:SI FOO (const_int 1) BAR). + +2005-02-06 Joseph S. Myers + + * doc/cpp.texi: Include gcc-common.texi. Don't define gcctabopt + macro locally. Don't give last revision date. Use GCC version + number from gcc-common.texi. + * doc/cppinternals.texi: Include gcc-common.texi. Don't give last + revision date. Use GCC version number from gcc-common.texi. + Describe being a library as current state rather than as 3.x + history. + * doc/gcc.texi: Remove last update date. + * doc/gccint.texi: Likewise. Update copyright dates. + * doc/install.texi: Update copyright dates. + +2005-02-06 Joseph S. Myers + + PR other/7549 + * doc/invoke.texi: Mention for each option included in -Wall that + it is included in -Wall. + * doc/gcc.texi: Update copyright and last modification date. + +2005-02-06 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Do not add + unnecessary cast to original induction variable increments. + +2005-02-06 Zdenek Dvorak + + PR tree-optimization/18219 + * tree-ssa-loop-ivopts.c (get_computation_at): Produce computations + in distributed form. + +2005-02-06 Richard Sandiford + + * expmed.c (store_bit_field): Make the SUBREG code adjust bitnum. + Set bitpos and offset later in the function. Do nothing if the + target is a register and if the bitfield lies completely outside + that register. + (extract_bit_field): Make the same SUBREG, bitpos and offset changes + here. Return an uninitialised register if the source value is stored + in a register and the bitfield lies completely outside that register. + +2005-02-06 Steven Bosscher + + * df.c (df_insn_refs_record): Use XEXP to get the operand of a USE, + not SET_DEST. + +2005-02-06 Marcin Dalecki + + * diagnostic.c (default_diagnostic_finalizer): Fix use of attribute. + +2005-02-06 Geoffrey Keating + + * config.gcc (*-*-darwin*): Separate darwin7 and darwin8 configs. + * config/darwin8.h: New. + * config/darwin7.h: Update comment. + +2005-02-03 Leehod Baruch + Dorit Naishlos + + * tree-vectorizer.h (LOC): New type. + (UNKNOWN_LOC, EXPR_LOC, LOC_FILE, LOC_LINE): New macros. + (loop_line_number): New field in struct _loop_vec_info. + (LOOP_VINFO_LOC, LOOP_LOC): New macros. + + * tree-vectorizer.c (input.h): Included. + (find_loop_location): New function. + (vect_debug_stats): Argument changed from loop to LOC. Computation of + loop line number removed. + (vect_debug_details): Likewise. + (new_loop_vec_info): Initialize new field LOOP_VINFO_LOC. + + (slpeel_make_loop_iterate_ntimes): Call find_loop_location. Argument in + call to vect_debug_details/stats changed from loop to loop_loc. + (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. + (slpeel_tree_peel_loop_to_edge): Likewise. + + (vect_analyze_offset_expr): Argument in call to vect_debug_details/stats + changed from NULL to UNKNOWN_LOC. + (vect_get_base_and_offset): + (vect_create_addr_base_for_vector_ref): + (get_vectype_for_scalar_type): + (vect_create_data_ref_ptr): + (vect_init_vector): + (vect_get_vec_def_for_operand): + (vect_finish_stmt_generation): + (vectorizable_assignment): + (vectorizable_operation): + (vectorizable_store): + (vectorizable_load): + (vect_transform_stmt): + (vect_update_ivs_after_vectorizer): + (vect_do_peeling_for_loop_bound): + (vect_do_peeling_for_alignment): + (vect_transform_loop): + (vect_is_simple_use): + (vect_analyze_operations): + (vect_is_simple_iv_evolution): + (vect_analyze_scalar_cycles): + (vect_analyze_data_ref_dependences): + (vect_compute_data_ref_alignment): + (vect_enhance_data_refs_alignment): + (vect_analyze_data_ref_access): + (vect_analyze_data_ref_accesses): + (vect_analyze_pointer_ref_access): + (vect_get_memtag_and_dr): + (vect_analyze_data_refs): + (vect_mark_relevant): + (vect_stmt_relevant_p): + (vect_mark_stmts_to_be_vectorized): + (vect_can_advance_ivs_p): + (vect_get_loop_niters): + (vect_analyze_loop): + (vectorize_loops): Likewise. + + (vectorizable_load): Argument in call to vect_debug_details/stats + changed from loop to LOOP_LOC (loop_vinfo). + (vect_transform_loop): + (vect_analyze_operations): + (vect_analyze_scalar_cycles): + (vect_analyze_data_ref_dependence): + (vect_enhance_data_refs_alignment): + (vect_analyze_data_ref_accesses): + (vect_analyze_pointer_ref_access): + (vect_analyze_data_refs): + (vect_analyze_loop): Likewise. + + (vect_analyze_loop_form): Argument in call to vect_debug_details/stats + changed from loop to loop_loc. + + (vect_enhance_data_refs_alignment): Removed unused variable loop. + +2005-02-03 Leehod Baruch + Dorit Naishlos + + * tree-vectorizer.c (vect_analyze_data_ref_dependence): Function + declaration added. + (vect_analyze_data_ref_dependences): Likewise. + + (vect_is_simple_use): Argument changed from loop structure to + loop_vect_info structure. + (vect_can_advance_ivs_p): Likewise. + (vect_create_index_for_vector_ref): Likewise. + (vect_update_ivs_after_vectorizer): Likewise. + (new_stmt_vec_info): Likewise. + + (new_loop_vec_info): Second argument in call to new_stmt_vec_info was + changed from loop to loop_vinfo. + (vect_create_data_ref_ptr): First argument in call to + vect_create_index_for_vector_ref was changed from loop to loop_vinfo. + (vectorizable_assignment): Second argument in call to vect_is_simple_use + was changed from loop to loop_vinfo. + (vectorizable_operation): Likewise. + (vectorizable_store): Likewise. + (vect_mark_stmts_to_be_vectorized): Likewise. + (vect_do_peeling_for_loop_bound): First argument in call to + vect_update_ivs_after_vectorizer was changed from loop to loop_vinfo. + (vect_analyze_operations): Argument in call to vect_can_advance_ivs_p + was changed from loop to loop_vinfo. + (vect_analyze_data_ref_dependences): Third argument in call to + vect_analyze_data_ref_dependence was changed from loop to loop_vinfo. + + (vect_create_index_for_vector_ref): Get the loop from loop_vinfo. + (vect_create_data_ref_ptr): Likewise. + (vect_init_vector): Likewise. + (vect_get_vec_def_for_operand): Likewise. + (vectorizable_assignment): Likewise. + (vectorizable_operation): Likewise. + (vectorizable_store): Likewise. + (vectorizable_load): Likewise. + (vect_update_ivs_after_vectorizer): Likewise. + (vect_is_simple_use): Likewise. + (vect_analyze_data_ref_dependence): Likewise. + (vect_analyze_pointer_ref_access): Likewise. + (vect_can_advance_ivs_p): Likewise. + + * tree-vectorizer.h: (_loop_vec_info): Definition and macros moved + before _stmt_vec_info. + (_stmt_vec_info): Loop field replaced by loop_vec_info. + (STMT_VINFO_LOOP): Replaced with STMT_VINFO_LOOP_VINFO. + (new_stmt_vec_info): Argument changed from loop structure to + loop_vect_info structure + + (vect_analyze_data_ref_dependences): Unnecessary line was removed. + (vect_analyze_offset_expr): Avoid 80 columns overflow. + (vect_create_addr_base_for_vector_ref): Likewise. + (vect_analyze_pointer_ref_access): Likewise. + +2005-02-03 Andrew Pinski + + PR tree-opt/19768 + * tree-ssa-dse.c (fix_phi_uses): Update the occurs in abnormal + phi flag if the phi is abnormal. + +2005-02-03 Andrew Pinski + + PR tree-opt/19736 + * tree-ssa.c (replace_immediate_uses): Update the immediate_uses + information for the new statement. + +2005-02-03 Joseph S. Myers + + PR driver/19117 + * gcc.c (main): Include the target in -v output. + +2005-02-03 Alexandre Oliva + + * combine.c (simplify_comparison, case SIGN_EXTEND, ZERO_EXTEND): + Do not drop the extend if we'd have to add a paradoxical subreg + later. Include optabs.h and insn-codes.h. + * Makefile.in (combine.o): Depend on $(OPTABS_H). + +2005-02-02 Roger Sayle + + PR middle-end/19405 + * real.h (REAL_MODE_FORMAT_COMPOSITE_P): New macro. + * fold-const.c (const_binop): Avoid constant folding floating + point operations in modes that use composite representations. + * simplify-rtx.c (simplify_binary_operation): Likewise. + +2005-02-02 Geoffrey Keating + + * config/rs6000/altivec.md (altivec_dst): Make the first operand + a REG, not a MEM. + (altivec_dstt): Likewise. + (altivec_dstst): Likewise. + (altivec_dststt): Likewise. + * config/rs6000/rs6000.c (altivec_expand_dst_builtin): Adjust creation + of first operand. + +2005-02-03 Dorit Naishlos + + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Copy + EXPR_LOCUS from orig_cond to the new cond_stmt. + (vect_finish_stmt_generation): Copy EXPR_LOCUS from stmt to + the new vec_stmt. + +2005-02-03 Dorit Naishlos + + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Call + standard_iv_increment_position. Remove call to bsi_next + (no need to bump the iterator anymore). + (vect_create_index_for_vector_ref): Call + standard_iv_increment_position. Remove second function argument. + (vect_finish_stmt_generation): Remove call to bsi_next + (no need to bump the iterator anymore). + (vect_create_data_ref_ptr): Remove second argument (bsi) in call + to vect_create_index_for_vector_ref. + +2005-02-03 Dorit Naishlos + + * tree-vectorizer.c (vect_mark_stmts_to_be_vectorized): Check if + phis are used out of the loop. + +2005-02-03 Joseph S. Myers + + PR c/17807 + * c-decl.c (undef_nested_function): New variable. + (pop_scope): Diagnose undefined nested functions. + (finish_function): Don't attempt cgraph processing or genericizing + if current top-level function contained an undefined nested + function. Reset undef_nested_function at the end of a top-level + function. + +2005-02-02 Zdenek Dvorak + + * tree.c (build_int_cst_type): Take sign of the value into account + when deciding whether sign extend the value. + +2005-02-02 Joseph S. Myers + + PR c/18502 + * gcc.c (cpp_unique_options): Remove %{trigraphs}. + (cpp_options, cc1_options): Change %{std*&ansi} to + %{std*&ansi&trigraphs}. + +2005-02-02 Kazu Hirata + + * cse.c: Update comments. + +2005-02-02 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_spe_function_arg): Multi-reg + arguments go on the stack. Do not put complex doubles in odd/even + pairs. + +2005-02-02 Steven Bosscher + + * doc/invoke.texi: Update the options enabled at -O1, -O2, + and -O3. Update the documentation for -fgcse-sm, -fgcse-las, + -ftree-pre, and -fthread-jumps. + +2005-02-02 Richard Sandiford + + PR tree-optimization/19578 + * tree-flow.h (modified_noreturn_calls): Declare. + (noreturn_call_p): Declare. + * tree-flow-inline.h (noreturn_call_p): New function. + (modify_stmt): Add modified noreturn calls to modified_noreturn_calls. + * tree-cfg.c (modified_noreturn_calls): New variable. + (cleanup_control_flow): Use noreturn_call_p. Split basic blocks + that contain a mid-block noreturn call. + * tree-ssa.c (delete_tree_ssa): Clear modified_noreturn_calls. + +2005-02-02 Kazu Hirata + + * df.c (df_def_record_1, df_uses_record): Don't use + DF_FOR_REGALLOC. + * df.h (DF_FOR_REGALLOC): Remove. + +2005-02-02 Joseph S. Myers + + PR c/19435 + * c-typeck.c (really_start_incremental_init): Reset + constructor_max_index for arrays of incomplete type. + +2005-02-02 Jeff Law + + * gcse.c (struct reg_set): Store the block index where the register + was set rather than the setting insn. + (record_one_set, compute_transp): Corresponding changes. + (pre_insert_copy_insn): Do not call replace_one_set. + (replace_one_set): Remove. + +2005-02-02 Joseph S. Myers + + PR other/15514 + * doc/gcov.texi: Fix typo. + +2005-02-01 Richard Henderson + + PR tree-optimization/19217 + * tree-cfg.c (verify_expr): Use the data field to see if TP was + seen inside a PHI node. Do not do the ADDR_EXPR check if it was. + (verify_stmts): Pass (void*)1 as data to verify_expr to signal + that it is walking a PHI node. + +2005-02-01 Joseph S. Myers + + * doc/extend.texi (Nested Functions): Update. + +2005-02-01 Richard Henderson + + PR 19696 + * optabs.c (expand_copysign_absneg): Export. + * optabs.h (expand_copysign_absneg): Declare. + * config/rs6000/rs6000.md (copysigntf3): New. + +2005-02-01 Diego Novillo + + PR tree-optimization/19633 + * tree-flow.h (struct ptr_info_def): Add field 'pt_null'. + * tree-ssa-alias.c (init_alias_info): Initialize. + (merge_pointed_to_info): Set. + (add_pointed_to_expr): Set pt_null if EXPR is a NULL pointer. + (dump_points_to_info_for): Show value of pt_null. + (struct count_ptr_d): Declare. + (find_ptr_dereference): Remove. + (ptr_is_dereferenced_by): Remove. + (count_ptr_derefs): New local function. + (count_uses_and_derefs): New local function. + (compute_points_to_and_addr_escape): Call it. If the number + of dereferences is greater than zero, mark the pointer as + dereferenced. If there are fewer dereferences than uses of + the pointer, the pointer's value escapes. + +2005-02-01 Diego Novillo + + PR tree-optimization/19670 + * tree-ssa.c (verify_ssa_name): Don't set TREE_VISITED + here... + (verify_use): ... set it here, instead. + +2005-02-01 Janis Johnson + + * doc/sourcebuild.texi (Test directives): Fix formatting. + + * doc/sourcebuild.texi (Test directives): Describe selector + expressions. + +2005-02-01 Segher Boessenkool + + * config.gcc (powerpc64-*-linux*): Default to -m64 also for + specific 64-bit CPUs. + +2005-02-01 Richard Earnshaw + + PR target/16201 + * arm.c (arm_eliminable_register): New function. + (adjacent_mem_locations): Don't allow eliminable registers. Use + HOST_WIDE_INT for address offsets. + * arm-protos.h (arm_eliminable_register): Add prototype. + +2005-02-01 Steven Bosscher + + PR optimization/15242 + * params.def (PARAM_MAX_GOTO_DUPLICATION_INSNS): New param. + * basic-block.h (duplicate_computed_gotos): Add prototype. + * bb-reorder.c (duplicate_computed_gotos): New function to + duplicate sufficiently small blocks ending in a computed jump. + * passes.c (rest_of_compilation): Call duplicate_computed_gotos + if not optimizing for size. + * cfgcleanup.c (try_crossjump_bb): If not optimizing for size, + never do tail merging for blocks ending in a computed jump. + * doc/invoke.texi: Document the max-goto-duplication-insns param. + +2005-02-01 Eric Botcazou + + Patch from Richard Sandiford + * reload1.c (choose_reload_regs): Prevent the find_equiv_reg() code + from inheriting a subreg equivalence with a non-spill register. + + * tree.h (DECL_FUNCTION_CODE): Document that it is overloaded. + +2005-02-01 Alexandre Oliva + + * config/frv/frv.c (movcc_fp_destination_operand): New. + (gpr_or_memory_operand): Fix typo in comment. + (gpr_or_memory_operand_with_scratch): New. + * config/frv/frv.h (PREDICATE_CODES): Add the two new predicates. + * config/frv/frv.md (movcc_fp, movcc_fp_internal): Use + movcc_fp_destination_operand. + (reload_incc_fp): Use gpr_or_memory_operand_with_scratch. + Legitimize memory addresses using a scratch register. + +2005-01-31 Jeff Law + + * tree-into-ssa.c (mark_def_sites_global_data): Make KILLS + bitmap a sparse bitmap instead of a simple bitmap. + (mark_def_sites_initialize_block): Corresponding changes. + (ssa_mark_def_sites_initialize_block): Likewise. + (ssa_mark_phi_uses): Likewise. + (mark_def_site, ssa_mark_def_sites): Likewise. + (mark_def_site_blocks): Likewise. + (rewrite_ssa_into_ssa): Likewise. + + * tree-ssa-dom.c (record_cond): Pass correct variable type + for last argument to htab_find_slot_with_hash. + + * fold-const.c (fold, case CEIL_MOD_EXPR): Do not lose side + effects when optimizing 0 % X. Do not try to optimize X % 0. + +2005-01-31 James E. Wilson + + * config/ia64/itanium1.md (1_scall bypass): Change 2_mmalua to + 1_mmalua. + +2005-02-01 Eric Christopher + + * config/mips/mips.c (override_options): Warn if -mint64 + is used. + * doc/invoke.texi (MIPS Options): Document that -mint64 is + deprecated. + +2005-02-01 Kazu Hirata + + * cse.c (cse_reg_info): Remove hash_next, next, regno. Add + timestamp. + (cse_reg_info_list, cse_reg_info_list_free, REGHASH_SHIFT, + REGHASH_SIZE, REGHASH_MASK, reg_hash, REGHASH_FN, + cached_cse_reg_info, GET_CSE_REG_INFO): Remove. + (cached_regno): Initialize to INVALID_REGNUM. + (cse_reg_info_table_size, + cse_reg_info_table_first_uninitialized, + cse_reg_info_timestamp): New. + (REG_TICK, REG_IN_TABLE, SUBREG_TICKED, REG_QTY): Use + get_cse_reg_info. + (init_cse_reg_info, get_cse_reg_info_1): New. + (get_cse_reg_info): Cache the last look-up. + (new_basic_block): Update the code to clear mappings from + registers to cse_reg_info entries. + (cse_main): Call init_cse_reg_info. + + * cse.c (get_cse_reg_info): Update a comment. + +2005-01-31 Steven Bosscher + + PR c/19333 + * c-decl.c (start_decl): Do not warn about arrays of elements with + an incomplete type here. + (grokdeclarator): Do it here by making a pedwarn an error. + * c-typeck.c (push_init_level): If there were previous errors with + the constructor type, do not warn about braces for initializers. + (process_init_element): Likewise for excess initializer elements. + +2005-01-31 Kazu Hirata + + * cse.c (delete_trivially_dead_insn): Don't iterate. + +2005-01-31 Andrew Pinski + + * config/rs6000/rs6000.md (copysignsf3): New expand. + (copysigndf3): Likewise. + +2005-01-31 Steven Bosscher + + * recog.c (constrain_operands): Only look for earlyclobber operand + conflicts if an '&' constraint was seen. + +2005-01-31 Marc Espie + + * config.gcc: Don't include embedded systems fragment, switches default + debugging format to ELF. + * config/i386/openbsdelf.h: Add DBX_REGISTER_NUMBER since we no + longer pick it up there. + +2005-01-31 Dale Johannesen + + * doc/extend.texi (nested functions): Fix linkage description. + Clarify that static is not allowed. + +2005-01-31 Dale Johannesen + + * config/rs6000/darwin.md (movsf_low_di): Make work. + (movdf_low_di): Make work. + +2005-01-31 Dale Johannesen + + * config/rs6000/darwin-tramp.asm (__trampoline_setup): + Make work for 64 bit. + +2005-01-31 Roger Sayle + Dale Johannesen + + PR middle-end/19650 + * fold-const.c (fold_binary_op_with_conditional_arg): + Make types match original operands, before STRIP_NOPS. + +2005-01-31 Alan Modra + + * config/rs6000/linux-unwind.h (struct gcc_vregs): New. + (struct gcc_regs): Rename from gcc_pt_regs. Add more regs. + (struct gcc_sigcontext): Delete. Merge contents to.. + (struct gcc_ucontext): ..here. + (get_sigcontext): Delete. + (get_regs): New function, like get_sigcontext but return regs ptr. + 64-bit version finds regs from r1 to support vdso. + (ppc_linux_aux_vector): New function. + (ppc_fallback_frame_state): Modify for get_regs. Restore fprs + and vector regs. + +2005-01-31 Ira Rosen + + * tree-vectorizer.c (vect_analyze_offset_expr): Use ssizetype instead + sizetype. + (vect_get_base_and_offset): Use ssizetype instead sizetype. Remove + redundant fold. Fix misalignment for MINUS_EXPR. + (vect_compute_data_ref_alignment): Use ssizetype instead sizetype. + (vect_analyze_pointer_ref_access): Likewise. + (vect_get_memtag_and_dr): Likewise. + +2005-01-31 Richard Henderson + + * config/i386/i386.c (absnegsf2_mixed): Remove all of the # hackery. + (absnegsf2_sse, absnegsf2_i387, absnegdf2_mixed, absnegdf2_sse, + absnegdf2_i387, absnegxf2_i387): Likewise. + +2005-01-31 Richard Henderson + + PR 19696 + * optabs.c (expand_copysign_absneg): New. + (expand_copysign_bit): Split out from ... + (expand_copysign): ... here. Use expand_copysign_absneg. + +2005-01-30 Roger Sayle + + PR middle-end/19697 + * config/pa/pa.md (anddi3, iordi3): On HPPA64, disallow an integer + constant as the second operand and a register as the third. + +2005-01-31 Danny Smith + + PR target/19704 + * config/i386/i386.c (ix86_function_ok_for_sibcall): Also check + that dllimport'd functions do not use all call-clobbered registers + to pass parameters. + +2005-01-30 Richard Henderson + + PR 19696 + * optabs.c (expand_absneg_bit): Split out from expand_unop and + expand_abs_nojump and generalize. Use operand_subword and + emit_no_conflict_block. Support large modes. + (expand_abs_nojump): Use it. Use HONOR_SIGNED_ZEROS to fall + back to maximum. + (expand_unop): Likewise. Use HONOR_SIGNED_ZEROS to fall back + negation to subtraction. + (expand_copysign): Check that the format has signed zeros. + Use operand_subword and emit_no_conflict_block. Support large modes. + +2005-01-30 Daniel Berlin + + Fix PR tree-optimization/19624 + + * Makefile.in (tree-ssa-pre.o): Add CFGLOOP_H. + * tree-ssa-pre.c: Add cfgloop.h. + Update comment. + (pre_stats): New member, constified. + (inserted_exprs): New static variable. + (NECESSARY): New macro. + (create_expression_by_pieces): Fold the expression, and + mark it as defaulting to not necessary. Also put in + inserted_exprs. + (fully_constant_expression): New function. + (insert_into_preds_of_block): Modify to not insert phis when we + are playing with induction variables. + Push phis onto the inserted_exprs vector, and mark them as not + necessary by default. + (insert_aux): Call fully_constant_expression on eprime. + If all edges produce the same value, mark it constant. + (mark_operand_necessary): New function. + (remove_dead_inserted_code): New function. + (init_pre): Init loop optimizer to get loop info. + (fini_pre): Free loop_optimizer, and inserted_exprs vec. + (execute_pre): Commit edge inserts, then remove dead code. + +2005-01-30 Richard Henderson + + * rtl.c (rtx_equal_p): No early exit for CONST_VECTOR. + * varasm.c (const_rtx_hash_1): Handle CONST_VECTOR. + +2005-01-30 Richard Henderson + + PR target/19700 + * config/i386/i386.c (ix86_expand_copysign): New. + (ix86_split_copysign_const): New. + (ix86_split_copysign_var): Rename from ix86_split_copysign, + rearrange op1/nmask operands. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (copysignsf3): Use ix86_expand_copysign. + (copysigndf3): Likewise. + (copysignsf3_const, copysigndf3_const): New. + (copysignsf3_var): Rename from copysignsf3, split out splitter + and fix split predicate for X constraint. + (copysigndf3_var): Similarly. + +2005-01-30 Kazu Hirata + + * optabs.c, doc/c-tree.texi, doc/install.texi, doc/md.texi, + doc/passes.texi, doc/rtl.texi, doc/sourcebuild.texi, + doc/tm.texi, doc/tree-ssa.texi: Update copyright. + +2005-01-29 Richard Henderson + + PR target/19690 + * config/i386/i386.md (movdf_nointeger, movdf_integer): Fix ordering + of # and * in constraints. + +2005-01-29 Richard Henderson + + PR middle-end/19689 + * expr.c (store_field): Don't strip sub-mode cast when the input + data is even smaller. + +2005-01-29 Richard Henderson + + PR middle-end/19687 + * expr.c (categorize_ctor_elements_1): Check for CONSTRUCTOR of a + union being empty. + +2005-01-29 Richard Henderson + + * combine.c (make_field_assignment): Fix argument order + to gen_int_mode. + +2005-01-29 Richard Guenther + + PR tree-optimization/15791 + * fold-const.c (extract_array_ref): New function. + (fold): Fold comparisons between &a[i] and &a[j] or + semantically equivalent trees. + +2005-01-29 Jeff Law + + * gcse.c (insert_expr_in_table): Revamp handling of available + and anticipatable occurrence lists to avoid unnecessary list + walking. + (insert_set_in_table): Similarly. + +2005-01-29 Joseph S. Myers + + * c-common.c (fix_string_type): Just use c_build_qualified_type to + build string type. + (c_build_qualified_type): Build qualified array types with + TYPE_MAIN_VARIANT pointing to corresponding unqualified type. + * c-decl.c (c_make_fname_decl): Build unqualified array type + before qualified type. + (grokdeclarator): Use TYPE_MAIN_VARIANT of typedef type if element + type is qualified, not just if type itself is. Don't apply + qualifiers to array type when declarator is processed. Apply + qualifiers to field type whether or not it is an array type. + Don't handle array types specially for applying qualifiers to + variables. + * c-typeck.c (composite_type): Build unqualified element type and + array type when forming composite of array types. + (common_pointer_type, comptypes, comp_target_types, + type_lists_compatible_p, build_indirect_ref, build_array_ref, + convert_for_assignment): Don't apply TYPE_MAIN_VARIANT to array + types. + (type_lists_compatible_p): Cache TREE_VALUE (args1) and TREE_VALUE + (args2) in variables a1 and a2. + +2005-01-29 Kazu Hirata + + * cse.c (n_elements_made, max_elements_made): Remove. + (insert): Don't touch n_elements_made. + (cse_main): Don't touch n_elements_made or max_elements_made. + +2005-01-28 Stephane Carrez + + PR target/15384 + * config/m68hc11/t-m68hc11-gas (dp-bit.c): Fix typo causing a + configuration part of dp-bit.c to be lost. + +2005-01-28 Roger Sayle + + * expmed.c (expand_mult_highpart_optab): When attempting to use + a non-widening multiplication in a wider mode, the operands need + to be converted (zero or sign extended) to that mode. + +2005-01-28 Ian Lance Taylor + + PR middle-end/16558 + PR middle-end/19583 + * gimple-low.c (block_may_fallthru): TRY_FINALLY_EXPR only falls + through if both operands fall through. + +2005-01-28 Kazu Hirata + + * cse.c (fold_rtx) : Don't optimize. + +2005-01-28 Jeff Law + + * fold-const.c (fold, case CEIL_MOD_EXPR): Optimize 0 % X. + (case FLOOR_MOD_EXPR, ROUND_MOD_EXPR, TRUNC_MOD_EXPR): Similarly. + +2005-01-28 Kazu Hirata + + * cse.c (cse_reg_info_free_list, cse_reg_info_used_list, + cse_reg_info_used_list_end): Remove. + (cse_reg_info_list, cse_reg_info_list_free): New. + (get_cse_reg_info): When allocating an instance of + cse_reg_info, add it to the beginning of the cse_reg_info_list + list. Remove code to maintain cse_reg_info_used_list. + (new_basic_block): Reset the free list to the beginning of + cse_reg_info_list. + +2005-01-28 Richard Sandiford + + * config/frv/frv.c (bdesc_2arg): Remove __MDPACKH. + (frv_init_builtins): Change its prototype to take 4 uhalf arguments. + (frv_expand_mdpackh_builtin): New function. + (frv_expand_builtin): Use it to expand __MDPACKH. + * doc/extend.texi (__MDPACKH): Update documentation. + +2005-01-28 Uros Bizjak + + * config/i386/i386.c (ix86_expand_fp_absneg_operator): Use + SSE_FLOAT_MODE_P for use_sse computation. + +2005-01-28 Ralf Corsepius + + PR target/19663 + * config/sparc/rtemself.h (LINK_GCC_C_SEQUENCE_SPEC): undefine. + +2005-01-27 Richard Henderson + + * builtins.c (expand_builtin_copysign): New. + (expand_builtin): Call it. + * genopinit.c (optabs): Add copysign_optab. + * optabs.c (init_optabs): Initialize it. + (expand_copysign): New. + * optabs.h (OTI_copysign, copysign_optab): New. + (expand_copysign): Declare. + + * config/alpha/alpha.md (UNSPEC_COPYSIGN): New. + (copysignsf3, ncopysignsf3, copysigndf3, ncopysigndf3): New. + + * config/i386/i386.c (ix86_build_signbit_mask): Split from ... + (ix86_expand_fp_absneg_operator): ... here. + (ix86_split_copysign): New. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (UNSPEC_COPYSIGN): New. + (copysignsf3, copysigndf3): New. + + * config/ia64/ia64.md (UNSPEC_COPYSIGN): New. + (copysignsf3, ncopysignsf3): New. + (copysigndf3, ncopysigndf3): New. + (copysignxf3, ncopysignxf3): New. + * config/ia64/ia64.c (rtx_needs_barrier): Handle UNSPEC_COPYSIGN. + +2005-01-27 Arend Bayer + Kazu Hirata + + * cse.c: (find_best_addr): Don't call copy_rtx before calling + fold_rtx. Save cost recomputation if fold_rtx did nothing. + (fold_rtx) : Don't do anything if INSN is + NULL_RTX. + +2005-01-27 Jeff Law + + * tree-into-ssa.c (ssa_rewrite_initialize_block): Do not register + definitions of SSA_NAMEs which are not being rewritten. + (rewrite_ssa_into_ssa): Only initialize the current definition + of an SSA_NAME if that SSA_NAME has been marked for rewriting. + If checking is enabled, assert that SSA_NAME_AUX is clear for all + SSA_NAMEs before returning. + +2005-01-27 Kazu Hirata + + * c-common.def, c-dump.c, c-gimplify.c, c-objc-common.c, + cfgexpand.c, dbxout.c, function.h, opts.c, tree-flow-inline.h, + tree-ssa-operands.h, tree-ssa-threadupdate.c, tree-tailcall.c, + config/avr/avr.md, config/cris/aout.h, config/cris/cris.h, + config/mips/iris6.h, config/sh/sh.c: Update copyright. + +2005-01-27 Steven Bosscher + + PR middle-end/17278 + * opts.c (decode_options): Move flag_thread_jumps from -O1 and + higher to -O2 and higher. Likewise for tree PRE. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Only iterate at -O2 + and better. + +2005-01-27 Ian Lance Taylor + + PR middle-end/19583 + * gimple-low.c (try_catch_may_fallthru): New static function. + (block_may_fallthru): Handle TRY_CATCH_EXPR. + * tree-inline.c (expand_call_inline): Don't warn about reaching + the end of a non-void function being inlined if the function uses + a return slot. + +2005-01-27 Jakub Jelinek + + * config/i386/i386.h (CALL_USED_REGISTERS): Fix comment pastos. + + PR c/18946 + * c-decl.c (warn_if_shadowing): Handle old_decl error_mark_node. + (pushdecl): Only use DECL_FILE_SCOPE_P if DECL_P. + (implicitly_declare): Handle error_mark_node. + +2005-01-27 Richard Henderson + + PR tree-opt/14329 + * tree.h (struct tree_decl): Add debug_expr_is_from. + (DECL_DEBUG_EXPR_IS_FROM): New. + (DECL_DEBUG_EXPR): Rename from DECL_DEBUG_ALIAS_OF. + * dwarf2out.c (dwarf2out_var_location): Update to match. + * tree-outof-ssa.c (create_temp): Likewise. + * var-tracking.c (track_expr_p): Likewise. + * tree-sra.c (instantiate_element): Set DECL_DEBUG_EXPR. + * c-objc-common.c (c_tree_printer) <'D'>: Handle DECL_DEBUG_EXPR. + * toplev.c (default_tree_printer): Likewise. + +2005-01-27 Alexandre Oliva + + * config/frv/frv.c (frv_class_likely_spilled_p): Add GR8_REGS, + GR9_REGS, GR89_REGS, FDPIC_FPTR_REGS, FDPIC_REGS. + +2005-01-27 Steven Bosscher + + * tree.h (SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, CASE_LOW, + CASE_HIGH, CASE_LABEL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS, + ASM_CLOBBERS): Add tree checks. + + * c-common.h (SWITCH_TYPE): Rename to SWITCH_STMT_TYPE. + (SWITCH_STMT_COND, SWITCH_STMT_BODY): New. + * c-common.def (SWITCH_STMT): Update to match. + * c-common.c (c_do_switch_warnings): Use SWITCH_STMT accessor + macros instead of SWITCH_EXPR ones. + * c-dump.c (c_dump_tree): Likewise. + * c-gimplify.c (gimplify_switch_stmt): Likewise. + * c-typeck.c (c_start_case, do_case, c_finish_case): Likewise. + + * doc/c-tree.texi (SWITCH_STMT): Update accessor macro names. + +2005-01-27 Alan Modra + + * unwind-dw2.c (execute_stack_op): Add missing cases for + DW_OP_shl, DW_OP_shr, DW_OP_shra, DW_OP_xor. + +2005-01-27 Eric Botcazou + + * config.gcc (Obsolete configurations): Remove 'dummy', add + sparclite-*-coff*, sparclite-*-elf*, sparc86x-*-elf* and + sparc-*-openbsd*. + +2005-01-26 Diego Novillo + + PR tree-optimization/19633 + * tree-ssa-alias.c (ptr_is_dereferenced_by): Also handle + CALL_EXPRs. + (maybe_create_global_var): Do not create .GLOBAL_VAR if there + are no call-clobbered variables. + * tree-outof-ssa.c (check_replaceable): Return false for calls + with side-effects. + +2005-01-26 Ulrich Weigand + + * dbxout.c (dbxout_symbol_location): Resolve constant pool references + even for variables with NULL DECL_INITIAL. + +2005-01-26 Stuart Hastings + + * gimplify.c (shortcut_cond_expr): Re-compute side-effects. + +2005-01-26 Richard Henderson + + PR middle-end/18008 + * c-decl.c (finish_struct): Set DECL_MODE after resetting a + field's type. + * expr.c (store_field): Strip conversions to odd-bit-sized types + if the destination field width matches. + +2005-01-26 Richard Henderson + + * c-decl.c, expmed.c, expr.c: Revert last change. + +2005-01-26 Richard Henderson + + PR middle-end/18008 + * c-decl.c (finish_struct): Set DECL_MODE after resetting a + field's type. + * expmed.c (store_fixed_bit_field): Create a paradoxical subreg + if we don't need the bits above those present in the current mode. + * expr.c (store_field): Strip conversions to odd-bit-sized types + if the destination field width matches. + +2005-01-26 Richard Sandiford + + * config/mips/iris6.h (ENDFILE_SPEC): Don't link in irix-csr.o if + either -ffast-math or -funsafe-math-optimizations is in use. + +2005-01-26 Marek Michalkiewicz + + PR target/19293 + PR target/19329 + * config/avr/avr.c (notice_update_cc): Only set condition code for + ashrqi3 if shift count > 0. + (out_shift_with_cnt): Handle shift count <= 0 as a no-op. + (ashlqi3_out, ashlhi3_out, ashlsi3_out, ashrqi3_out, ashrhi3_out, + ashrsi3_out, lshrqi3_out, lshrhi3_out, lshrsi3_out): Handle shift + count <= 0 as a no-op, and shift count >= width by copying zero + or sign bit to all bits of the result. + * config/avr/avr.md (all shifts): Add alternatives for zero shift + count, with attribute "length" set to 0 and "cc" set to "none". + +2005-01-26 Aldy Hernandez + + * doc/invoke.texi: Document -mTLS. + + * testsuite/gcc.target/frv/all-tls-global-dynamic.c: New. + * testsuite/gcc.target/frv/all-tls-initial-exec.c: New. + * testsuite/gcc.target/frv/all-tls-initial-exec-pic.c: New. + * testsuite/gcc.target/frv/all-tls-local-dynamic.c: New. + * testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c: New. + * testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c: New. + * testsuite/gcc.target/frv/all-tls-local-exec.c: New. + * testsuite/gcc.target/frv/all-tls-local-exec-TLS.c: New. + + * configure.ac: Check for a TLS capable gas. + + * configure: Regenerate. + +2005-01-26 Richard Henderson + + PR middle-end/18008 + * combine.c (make_field_assignment): Simplify store to zero_extract + from a source with an overlapping mask. + +2005-01-26 Aldy Hernandez + + 2004-11-11 Eric Christopher + + * config/frv/frv.md: Add fr400_integer automaton. Don't + allow TYPE_MUL, TYPE_MACC, or TYPE_CUT to issue in parallel + to TYPE_MACC. + +2005-01-26 Steven Bosscher + + PR middle-end/16585 + * cfgbuild.c (make_edges): Do not clear or set + current_function_has_computed_jump. + * function.h (struct function): Remove the has_computed_jump field. + (current_function_has_computed_jump): Do not define. + * sched-rgn.c (is_cfg_nonregular): Return true if a basic block ends + in a computed jump. Ignore current_function_has_computed_jump. + +2005-01-26 Richard Henderson + + PR middle-end/19515 + * expr.c (categorize_ctor_elements): New argument p_must_clear. + (categorize_ctor_elements_1): Likewise. Detect a union that isn't + fully initialized. + (mostly_zeros_p): Update for new categorize_ctor_elements argument. + * gimplify.c (gimplify_init_constructor): Likewise. Only shove + objects into static storage if they have more than one non-zero value. + * tree.h (categorize_ctor_elements): Update decl. + +2005-01-26 Steven Bosscher + + PR middle-end/19616 + * tree.h (CALL_EXPR_TAILCALL): Add comment. + * calls.c (check_sibcall_argument_overlap_1): Revert the change + to this function from 2004-07-10. + * tree-tailcall.c (suitable_for_tail_opt_p): Do not consider the + the current function for tail call optimizations if the address + of one of it its arguments is taken. + +2005-01-26 Kazu Hirata + + * cse.c (fold_rtx): Call equiv_constant only when necessary. + +2005-01-26 Bernd Schmidt + + * function.c (expand_function_end): If current_function_calls_alloca, + emit stack restore in a place that is reached when the function falls + through at the end. + +2005-01-26 Alexandre Oliva + + * Makefile.in (../$(build_subdir)/fixincludes/fixincl): Add dummy + rule to avoid matching inappropriate suffix rule. + +2005-01-26 Jan Hubicka + + PR tree-optimization/19241 + * tree-inline.c (copy_body_r): Do not walk subtrees after substituting. + +2005-01-26 Hans-Peter Nilsson + + * config/cris/cris.h (LIB_SPEC) : Use -lsyslinux, not + -lsyssim. Wrap -lc -lsyssim in --start-group --end-group instead + of doubling. + (STARTFILE_SPEC): Add crti.o, before crtbegin.o. + : Always use crt1.o, regardless of N in simN. + : Drop support for -pg and -p variants; always use crt0.o. + (ENDFILE_SPEC): Add crtn.o, after crtend.o. + (CRT_CALL_STATIC_FUNCTION): Remove. + * config/cris/aout.h (STARTFILE_SPEC): : Always + use crt1.o, regardless of N in simN. + : Drop support for -pg and -p variants; always use crt0.o. + (LIB_SPEC): Do not define; default to the one in config/cris/cris.h. + (CRIS_CPP_SUBTARGET_SPEC) : Remove special + case isystem setting. + (MAX_OFILE_ALIGNMENT): Correct to 32, not 16. + +2005-01-25 Ian Lance Taylor + + * gimple-low.c (block_may_fallthru): Correct handling of + SWITCH_EXPR--may fall through if SWITCH_LABELS is NULL. + +2005-01-26 Hans-Peter Nilsson + + * config/cris/cris.h (CPP_SPEC): Adjust the various mtune= + handlers to match indentation; nested under the mtune=* handler. + Similar for mcpu= and march=. + +2005-01-25 Daniel Jacobowitz + + * config/mips/linux.h (LIB_SPEC): Remove -rpath-link. + * config/mips/linux64.h (LIB_SPEC): Likewise. + * config/mn10300/linux.h (LIB_SPEC): Likewise. + * config/sh/linux.h (LIB_SPEC): Likewise. + +2005-01-25 Aldy Hernandez + + * config/frv/frv.c (frv_legitimize_tls_address): New. + (TARGET_HAVE_TLS): Define. + (FRV_SYMBOL_REF_TLS_P): Define. + (frv_override_options): Handle new register classes. + (frv_legitimate_address_p): Reject tls addresses. + (frv_legitimize_address): Handle TLS addresses. + (gen_inlined_tls_plt): New. + (gen_tlsmoff): New. + (frv_legitimize_tls_address): New. + (unspec_got_name): Add TLS entries. + (got12_operand): Add R_FRV_TLSMOFF12 case. + (frv_emit_move): Fixup TLS addresses. + (frv_emit_movsi): Legitimize TLS addresses. + + * config/frv/frv.h (MASK_BIG_TLS): New. + (TARGET_BIG_TLS): New. + (HAVE_AS_TLS): Define. + (TARGET_SWITCHES): Add -mTLS and -mtls options. + (enum reg_class): Add GR8_REGS, GR9_REGS, GR89_REGS. + (REG_CLASS_NAMES): Same. + (REG_CLASS_CONTENTS): Same. + (CONSTRAINT_LEN): New. + (REG_CLASS_FROM_CONSTRAINT): New. + (PREDICATE_CODES): Add symbolic_operand. + + * config/frv/frv.md (define_constants): Add UNSPEC_GETTLSOFF, + UNSPEC_TLS_LOAD_GOTTLSOFF12, UNSPEC_TLS_INDIRECT_CALL, + UNSPEC_TLS_TLSDESC_LDD, UNSPEC_TLS_TLSDESC_LDD_AUX, + UNSPEC_TLS_TLSOFF_LD, UNSPEC_TLS_LDDI, UNSPEC_TLSOFF_HILO, + R_FRV_GOTTLSOFF_HI, R_FRV_GOTTLSOFF_LO, R_FRV_TLSMOFFHI, + R_FRV_TLSMOFFLO, R_FRV_TLSMOFF12, R_FRV_TLSDESCHI, + R_FRV_TLSDESCLO, R_FRV_GOTTLSDESCHI, R_FRV_GOTTLSDESCLO, GR8_REG, + GR9_REG, GR14_REG, LRREG. + (type): Add load_or_call attribute. + ("load_or_call"): New reservation. + ("call_gettlsoff"): New. + ("tls_indirect_call"): New. + ("tls_load_gottlsoff12"): New. + ("tlsoff_hilo"): New. + ("tls_tlsdesc_ldd"): New. + ("tls_tlsoff_ld"): New. + ("tls_lddi"): New. + + * config/frv/frv-protos.h (symbolic_operand): Protoize. + + 2005-01-25 Alexandre Oliva + + * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Define. + * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Declare. + * config/frv/frv.c (TLS_BIAS): Define. + (frv_output_dwarf_dtprel): New. + +2005-01-26 Jakub Jelinek + + PR rtl-optimization/19579 + * ifcvt.c (noce_try_cmove_arith): If emitting instructions to set up + both A and B, see if they don't clobber registers the other expr uses. + +2005-01-25 J"orn Rennecke + + * real.c (do_add): Initialize signalling and canonical members. + + * real.c (real_from_integer): Zero out destination. + +2005-01-18 Jan Hubicka + + PR tree-optimize/19337 + * tree-inline.c (initialize_inlined_parameters): Copy + saved_static_chain_decl only. + +2005-01-25 Richard Henderson + + PR target/19556 + PR target/19584 + * config/i386/i386.c (x86_inter_unit_moves): Zero. + (ix86_preferred_reload_class): Rewrite fp-constant section, with + 80387 enabled, to return a proper subclass. Return the subset that + overlaps with GENERAL_REGS for PLUS. + * config/i386/i386.md (movsi_1, movdi_2): Set type to "mmx" for pxor. + +2005-01-25 Richard Henderson + + PR middle-end/19609 + * tree-complex.c (expand_complex_div_wide): Use the correct formulae. + +2005-01-25 Roger Sayle + + * expmed.c (choose_multiplier): Change interface to return the + multiplier lowpart as an rtx instead of an unsigned HOST_WIDE_INT. + (expand_divmod): Update calls to choose_multiplier. + +2005-01-24 John David Anglin + + PR middle-end/19330 + * expmed.c (extract_bit_field): Use adjust_address instead of + gen_lowpart when op0 is a MEM. + +2005-01-24 Steven Bosscher + + * cfgexpand.c (expand_gimple_tailcall): Fix typo. + +2005-01-24 Richard Sandiford + + * config/mips/irix-csr.c: New file. + * config/mips/t-iris6 (irix-csr.o): New rule to build it. + (EXTRA_MULTILIB_PARTS): Add irix-csr.o. + * config/mips/iris6.h (ENDFILE_SPEC): Include it in n32 and n64 + executables. + +2005-01-24 Eric Botcazou + + PR bootstrap/19364 + * config.gcc (sparc-*-elf*): Remove sol2.h, sparc/sol2.h and + sparc/elf.h, add sparc/sp-elf.h. + (sparc-*-rtems*): Likewise. + (sparclite-*-elf*): Remove sol2.h, sparc/sol2.h, sparc/elf.h and + tm-dwarf2.h, add sparc/sp-elf.h. + (sparc86x-*-elf): Likewise. + (sparc64-*-elf*): Remove sol2.h, sparc/sol2.h and tm-dwarf2.h. + * config/sparc/liteelf.h (TARGET_SUB_OS_CPP_BUILTINS): Rename into + TARGET_OS_CPP_BUILTINS. + * config/sparc/sp86x-elf (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + * config/sparc/rtemself.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + Undefine it. + * config/sparc/openbsd64.h (NO_IMPLICIT_EXTERN_C): Undefine. + * config/sparc/sp64-elf.h (NO_IMPLICIT_EXTERN_C): New macro. + (SWITCH_TAKES_ARG): Likewise. + (LOCAL_LABEL_PREFIX): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (TARGET_N_FORMAT_TYPES): Delete. + (TARGET_FORMAT_TYPES): Likewise. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. + * config/sparc/elf.h: Delete. + * config/sparc/sp-elf.h: New file. + +2005-01-24 Kazu Hirata + + * tree-flow-inline.h (phi_arg_from_edge): Remove. + * tree-flow.h: Remove the corresponding prototype. + * tree-ssa-operands.h, tree-ssa-threadupdate.c, tree-ssa.c, + tree-vectorizer.c: Use dest_idx instead of phi_arg_from_edge. + +2005-01-24 Jakub Jelinek + + PR target/17751 + * config/rs6000/rs6000.c (rs6000_file_start): Create toc section + for AIX ABI or ELF -fPIC. + (rs6000_emit_load_toc_table): Don't create toc_section here. + (rs6000_xcoff_file_start): Nor here. + +2005-01-24 J"orn Rennecke + + * sh.c (ra.h): Don't #include. + (hard_regs_intersect_p): New function, resurrected from ra.c. + + * sh.c: Fix 1996 Copyright. + +2005-01-24 Richard Henderson + Aldy Hernandez + + * regrename.c (note_sets): Handle subregs. + +2005-01-24 Joseph S. Myers + + PR bootstrap/18058 + * genconditions.c (write_header, write_conditions): Elide file if + not GCC >= 3.0.1. + +2005-01-24 Kazu Hirata + + * c-opts.c, expmed.c, gengtype.c, tree-complex.c, + config/arm/iwmmxt.md, config/avr/avr.c, config/s390/s390.h: + Update copyright. + +2005-01-24 Jakub Jelinek + + * builtins.c (get_pointer_alignment, gimplify_va_arg_expr, + expand_builtin_printf, expand_builtin_fprintf, + expand_builtin_sprintf): Use POINTER_TYPE_P instead TREE_CODE + checking against POINTER_TYPE. + (validate_arglist): Handle POINTER_TYPE code by checking + POINTER_TYPE_P. + +2005-01-24 Paolo Bonzini + + * rtlanal.c (non_rtx_starting_operands, for_each_rtx_1, + init_rtlanal): New. + (for_each_rtx): Call for_each_rtx_1. + * rtl.h (init_rtlanal): Declare. + * toplev.c (backend_init): Call init_rtlanal. + +2005-01-24 Jakub Jelinek + + * flow.c (propagate_one_insn): Formatting. + + PR middle-end/19551 + * flow.c (libcall_dead_p): Be more conservative if unsure. + If there are any instructions between insn and call, see if they are + all dead before saying the libcall is dead. + +2005-01-24 Uros Bizjak + + * config/i386/i386.md (*extendsfdf2_sse): Use "nonimmediate_operand" + operand constraint for operand 0. + +2005-01-23 Richard Henderson + + PR 19486 + * tree-complex.c (expand_complex_div_wide): Set EDGE_FALLTHRU on + edges leading to join block. + +2005-01-23 Roger Sayle + + * expmed.c (expand_mult_highpart): Make static. Change type of + constant multiplier argument from unsigned HOST_WIDE_INT to rtx. + (expand_divmod): Updates calls to expand_mult_highpart by using + gen_int_mode to pass a CONST_INT rtx. + * rtl.h (expand_mult_highpart): Remove prototype. + +2005-01-23 Kazu Hirata + + * flow.c (regset_bytes, regset_size): Remove. + + * cfganal.c: Fix a reference to Harvey's paper. + +2005-01-23 Steven Bosscher + + PR rtl-optimization/19464 + * tree-optimize.c (init_tree_optimization_passes): Add one more + copyrename pass just before out-of-ssa. + +2005-01-23 Joseph S. Myers + + PR bootstrap/18058 + * recog.c (recog_memoized): Don't define if GENERATOR_FILE. + * ggc-none.c (ggc_free): Define. + +2005-01-23 Kazu Hirata + + * cse.c (max_reg, max_insn_uid): Remove. + (cse_main): Don't access max_reg or max_insn_uid. + + * c-common.c (explicit_flag_signed_bitfields, + lang_statement_code_p, lang_expand_function_end): Remove. + * c-common.h: Remove the corresponding declarations. + * c-opts.c (c_common_handle_option): Remove all write access + to explicit_flag_signed_bitfields. + + * cgraph.c (cgraph_varpool_n_nodes): Remove. + (cgraph_varpool_node): Don't access cgraph_varpool_n_nodes. + * cgraph.h: Remove the corresponding declaration. + + * gcse.c (null_pointer_info): Remove. + +2005-01-23 Roger Sayle + Eric Botcazou + + * combine.c (simplify_logical): Only simplify logical expressions + of the form ior(and(x,y),z) by the inverse distributive law if the + result is cheaper than the original. + +2005-01-23 Kazu Hirata + + * alias.c, c-common.h, c-incpath.c, c-incpath.h, expr.c, + fold-const.c, gimplify.c, params.h, tree-data-ref.c, + tree-if-conv.c, tree-nested.c, tree-outof-ssa.c, + tree-ssa-dom.c, tree-vectorizer.c, tree.def, config/darwin.c, + config/freebsd-spec.h, config/arm/arm.h, + config/h8300/h8300.md, config/i386/i386.md, + config/i386/predicates.md, config/i386/sse.md, + config/ia64/ia64.c, config/ip2k/ip2k.c, config/s390/s390.c, + config/vax/vax.md: Fix comment typos. Follow spelling + conventions. + +2005-01-23 Steven Bosscher + + * gengtype.c (walk_type): Produce `not equal to' compares for loop + tests, instead of `less than'. + +2005-01-23 Richard Sandiford + + * function.c (assign_parm_setup_block): When creating a new stack slot + for a parameter, get its alignment from the parameter's DECL_ALIGN + rather than the type's TYPE_ALIGN. Make sure that the parameter + is at least word aligned. + +2005-01-22 Roger Sayle + + PR middle-end/19378 + * config/avr/avr.c (avr_hard_regno_mode_ok): Rewrite. + +2005-01-22 Richard Henderson + + PR target/19506 + * config/i386/i386.md (movsfcc_1_sse_max): Use nonimmediate_operand + in both compare operands. + (movdfcc_1_sse_max): Likewise. + (movsfcc_1_sse): Likewise. Add earlyclobber for scratch. + (movdfcc_1_sse): Likewise. + * config/i386/i386.c (ix86_split_sse_movcc): Emit copies into the + scratch register as needed. + +2005-01-22 Richard Henderson + + * config/i386/i386.md (smaxsf3): Fix mnemonic typo. + + * config/i386/i386.c (ix86_prepare_fp_compare_args): Fix is_sse test. + +2005-01-22 Richard Henderson + + * genopinit.c (optabs): Use smin/smax for floating point too. + * doc/md.texi: Update to match. Clarify that floating point + results are undefined for +0/-0 and NaN. + * doc/rtl.texi: Likewise. + * rtl.def (SMIN, SMAX): Likewise + * tree.def (MIN_EXPR, MAX_EXPR): Likewise. + + * config/alpha/alpha.md (smaxdf3, smindf3, smaxsf3, sminsf3): Add + leading 's' to the name. + * config/ia64/ia64.md (smaxsf3, sminsf3, smaxdf3, smindf3, + smaxxf3, sminxf3): Likewise. + * config/rs6000/rs6000.md (smaxdf3, smindf3, smaxsf3, sminsf3): + Likewise. + +2005-01-22 Paul Brook + + * config/arm/arm.md: Use "Uy" constraint for wcgr load/stores. + +2005-01-21 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): New fields + dlgr, dlr, dr, dsgfr, dsgr. + (z900_cost, z990_cost): Values for new fields. + (s390_rtx_costs): New cases MEM und COMPARE in switch + statement. Modified handling of SIGN_EXTEND, ZERO_EXTEND, + DIV, MOD, UDIV, UMOD. + +2005-01-21 Ulrich Weigand + + * config/s390/s390.md ("doloop_si64"): Reload input value directly + into the register being decremented. + ("doloop_si31", "doloop_di"): Likewise. + ("*doloop_si_long"): Adapt pattern. + +2005-01-21 Ulrich Weigand + + * config/s390/s390.h (HARD_REGNO_NREGS): Fix computation for + access registers. + (CLASS_MAX_NREGS): Likewise. + +2005-01-21 Daniel Berlin + + * doc/tree-ssa.texi (Statement Operands): Add example for new + must-def macro. Note deprecation of old operands interface. + +2005-01-22 Richard Sandiford + + PR tree-optimization/19484 + * tree-cfg.c (remove_fallthru_edge): New function. + (cleanup_control_flow): Remove fallthru edges from calls that are + now known not to return. + +2005-01-20 Daniel Berlin + + Fix PR tree-optimization/19038 + * tree-ssa-dom.c (cprop_operand): Don't replace loop invaeriant + copies with loop variant ones. + +2005-01-22 Kazu Hirata + + * cfganal.c, real.h, reorg.c, timevar.def, tree-ssa-ccp.c, + config/alpha/alpha-protos.h, config/alpha/alpha.h, + config/alpha/alpha.md, config/alpha/predicates.md, + config/sparc/freebsd.h, config/sparc/netbsd-elf.h, + config/sparc/sol2.h: Update copyright. + + * tree-cfg.c (remove_forwarder_block_with_phi): Look at the + first label to see if it is a nonlocal label. + +2005-01-22 David Edelsohn + Andrew Pinski + + PR target/19491 + * config/rs6000/rs6000.c (rs6000_va_start): Saturate n_gpr at + maximum number of GPRs. Saturate n_fpr at maximum number of FPRs. + +2005-01-22 Ralf Corsepius + + * config/rs6000/rtems.h: Update copyright. + +2005-01-22 Ralf Corsepius + + PR target/19548 + * config/rs6000/rtems.h: Resurrect cpp_os_rtems_spec from gcc < 3.4. + (CPP_OS_RTEMS_SPEC): New (From gcc-3.3's config/rs6000/sys4.h). + (SUBSUBTARGET_EXTRA_SPECS): Use CPP_OS_RTEMS_SPEC. + +2005-01-22 Volker Reichelt + + PR c/18809 + * c-typeck.c (convert_arguments): Check for error_mark_node. + +2005-01-21 Ian Lance Taylor + + PR tree-optimization/13000 + * tree-inline.c: Include "tree-flow.h". + (expand_call_inline): If warn_return_type, warn if non-void inline + function falls through. + * tree-cfg.c (execute_warn_function_return): Don't warn about + control reaching end if TREE_NO_WARNING is set. Set + TREE_NO_WARNING. + * gimple-low.c (block_may_fallthru): Don't assume that SWITCH_EXPR + has been lowered. + * gimplify.c (shortcut_cond_expr): Don't emit a jump over the else + branch if we don't need one. + * c-typeck.c: Include "tree-flow.h" + (c_finish_bc_stmt): Don't add a goto if the current statement + list doesn't fall through to the current point. + +2005-01-21 Roger Sayle + + PR rtl-optimization/576 + * real.c (real_arithmetic): Change return type from void to bool + to return an indication that the result may be inexact. + * real.h (real_arithmeric): Update prototype. + * fold-const.c (const_binop): Don't constant fold floating + point expressions when the user specifies -frounding-math and + the result may depend upon the run-time rounding mode. + (fold_convert_const_real_from_real): Clean-up. + (fold_initializer): Ignore flag_rounding_math for initializers. + * simplify-rtx.c (simplify_binary_operation): Likewise, don't + constant fold FP operations with flag_rounding_math if the + result may depend upon the run-time rounding mode. + +2005-01-21 Tom Tromey + + * c-cppbuiltin.c (define__GNUC__): Correct assertion. + +2005-01-21 Kazu Hirata + + * tree-cfg.c: Fix comment typos. + +2005-01-21 J"orn Rennecke + + * passes.c (rest_of_handle_flow2): Close / open the flow2 dump file + around the call to rest_of_handle_branch_target_load_optimize. + +2005-01-21 Eric Botcazou + + * config.gcc (sparc-*-netbsdelf*): Include dbxelf.h + (sparc64-*-openbsd*): Likewise. + (sparclite-*-elf*): Include tm-dwarf2.h. + (sparc86x-*-elf*): Likewise. + (sparc64-*-elf*): Likewise. + * config/sparc/linux64.h (DWARF2_DEBUGGING_INFO): Delete. + (DBX_DEBUGGING_INFO): Likewise. + * config/sparc/liteelf.h (DWARF2_DEBUGGING_INFO): Likewise. + (PREFERRED_DEBUGGING_TYPE): Likewise. + * config/sparc/netbsd-elf.h (PREFERRED_DEBUGGING_TYPE): Likewise. + * config/sparc/sp64-elf.h (DBX_DEBUGGING_INFO): Likewise. + (PREFERRED_DEBUGGING_TYPE): Likewise. + * config/sparc/sp86x-elf.h (DWARF2_DEBUGGING_INFO): Likewise. + (PREFERRED_DEBUGGING_TYPE): Likewise. + * config/sparc/sparc.h (DBX_DEBUGGING_INFO): Likewise. + +2005-01-21 Hans-Peter Nilsson + + PR target/18701 + * combine.c (combine_simplify_rtx): Revert change of 2004-12-31. + +2005-01-20 Paul Brook + + * doc/rtl.texi: Document value extension requirements for CONST_INT. + +2005-01-20 Kazu Hirata + + * tree-cfg.c (tree_verify_flow_info): Check that a nonlocal + label is first in a sequence of labels. + + * tree-cfg.c (tree_verify_flow_info): Fix a typo. + +2005-01-20 Janis Johnson + Giovanni Bajo + + * doc/sourcebuild.texi (Test Directives): New. + +2005-01-20 Roger Sayle + + * real.c (real_floor): Don't leave the result uninitialized when + mode is VOIDMode, but return the unrounded intermediate value. + (real_ceil): Likewise. + +2005-01-20 Paul Brook + + * config/arm/arm.md (insv): Use gen_int_mode. + +2005-01-20 Eric Botcazou + + * config/sparc/freebsd.h (ASM_OUTPUT_INTERNAL_LABELREF): Delete. + * config/sparc/linux.h (ASM_OUTPUT_INTERNAL_LABELREF): Likewise. + * config/sparc/linux64.h (ASM_OUTPUT_INTERNAL_LABELREF): Likewise. + * config/sparc/netbsd-elf.h (ASM_OUTPUT_INTERNAL_LABELREF): Likewise. + * config/sparc/sol2.h (ASM_OUTPUT_INTERNAL_LABELREF): Likewise. + +2005-01-20 Daniel Berlin + + Fix PR debug/19124 + * dwarf2out.c (concat_loc_descriptor): We don't know we can use + fbreg, so we have to assume we can't. + (loc_descriptor_from_tree_1): Ditto. + (containing_function_has_frame_base): New function. + (add_location_or_const_value_attribute): Use it. + Also try to generate a frame_base from a single element location + list. + +2005-01-20 Kazu Hirata + + PR tree-optimization/15349 + * timevar.def (TV_TREE_MERGE_PHI): New. + * tree-cfg.c (tree_forwarder_block_p): Add a new argument + PHI_WANTED. + (remove_forwarder_block, cleanup_forwarder_blocks): Adjust the + calls to tree_forwarder_block_p. + (remove_forwarder_block_with_phi, merge_phi_nodes, + gate_merge_phi, pass_merge_phi): New. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_merge_phi. + * tree-pass.h: Add an extern for pass_merge_phi; + +2005-01-20 Richard Henderson + + PR target/19418 + * config/i386/emmintrin.h (_mm_castpd_ps, _mm_castpd_si128): New. + (_mm_castps_pd, _mm_castps_si128): New. + (_mm_castsi128_ps, _mm_castsi128_pd): New. + +2005-01-20 Richard Henderson + + PR target/19530 + * config/i386/mmintrin.h (_mm_cvtsi32_si64): Use + __builtin_ia32_vec_init_v2si. + (_mm_cvtsi64_si32): Use __builtin_ia32_vec_ext_v2si. + * config/i386/i386.c (IX86_BUILTIN_VEC_EXT_V2SI): New. + (ix86_init_mmx_sse_builtins): Create it. + (ix86_expand_builtin): Expand it. + (ix86_expand_vector_set): Handle V2SFmode and V2SImode. + * config/i386/mmx.md (vec_extractv2sf_0, vec_extractv2sf_1): New. + (vec_extractv2si_0, vec_extractv2si_1): New. + +2005-01-20 Richard Henderson + + PR target/16533 + * config/i386/i386.c (ix86_expand_push): New. + * config/i386/mmx.md (push1): New. + * config/i386/sse.md (push1): New. + * config/i386/i386-protos.h: Update. + +2005-01-20 Kazu Hirata + + * params.def, params.h, predict.c, tree-ssa-loop-im.c: Update + copyright. + +2005-01-20 Richard Henderson + + * rtl.def (CONST_VECTOR): Use RTX_CONST_OBJ. + * rtl.h (CONSTANT_P): Don't special case CONST_VECTOR. + +2005-01-19 Richard Henderson + + PR target/19350 + * config/i386/i386.c (ix86_expand_vector_move_misalign): Convert + to V4SFmode in SSE1 fallback load path. + +2005-01-19 Richard Henderson + + * config/i386/i386.c (ix86_expand_vector_init_one_var): Fix typo + in QImode expansion to ix86_expand_vector_set. + (ix86_expand_vector_init_general): Fix typo in V8HImode recursive call. + +2005-01-19 Richard Henderson + + PR target/19511 + * config/i386/i386.c (ix86_preferred_reload_class): Return a proper + subclass of the input class. + (ix86_secondary_memory_needed): Always true for cross-MMX classes. + Always true for cross-SSE1 classes. Rationalize conditionals. + * config/i386/i386.h (SSE_CLASS_P, MMX_CLASS_P): Use straight equality. + * config/i386/i386.md (movsi_1): Add MMX/SSE zeros. Fix alternatives + for SSE1. Don't check TARGET_INTER_UNIT_MOVES. + (movdi_2): Add MMX/SSE zeros. + (movdi_1_rex64): Likewise. Don't check TARGET_INTER_UNIT_MOVES. + (movsf_1): Don't check TARGET_INTER_UNIT_MOVES. + (zero_extendsidi2_32, zero_extendsidi2_rex64): Likewise. + (movsi_1_nointernunit, movdi_1_rex64_nointerunit): Remove. + (movsf_1_nointerunit, zero_extendsidi2_32_1): Remove. + (zero_extendsidi2_rex64_1): Remove. + (MOV0 peephole): Check GENERAL_REG_P. + +2005-01-19 Richard Henderson + + PR target/19427 + * config/i386/i386.c (ix86_expand_vector_set): Fix third and fourth + shufps elements. + (ix86_expand_vector_extract): Likewise. + +2005-01-19 Richard Henderson + + PR middle-end/19304 + * expr.c (emit_move_change_mode): New argument force; use + simplify_gen_subreg if true. + (emit_move_via_alt_mode): Merge into ... + (emit_move_via_integer): ... here. + (emit_move_ccmode): Use emit_move_change_mode directly. + +2005-01-19 Richard Henderson + + PR target/19518 + * config/alpha/alpha.c (alpha_rtx_costs): Handle HIGH. + (alpha_preferred_reload_class): Handle CONST_VECTOR. + (alpha_emit_set_const_1): Add no_output parameter; don't emit + rtl if true. + (alpha_emit_set_const): Likewise. Make static. + (alpha_emit_set_long_const): Make static. + (alpha_extract_integer): Split out from alpha_expand_mov. + (alpha_split_const_mov): Likewise. + (alpha_expand_mov): Use them. Handle CONST_VECTOR. + (alpha_legitimate_constant_p): New. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.h (REGISTER_MOVE_COST): Correct fp<->gp cost. + (LEGITIMATE_CONSTANT_P): Re-implement with a function. + * config/alpha/alpha.md (movsi): Add n alternative. + (movsi_nt_vms, movdi_er_nofix, movdi_er_fix, movdi_fix): Likewise. + (mov_fix, mov_nofix): Add i alternative. + (splitters for all of the above): Use alpha_split_const_mov. + * config/alpha/predicates.md (non_add_const_operand): New. + (non_zero_const_operand): New. + (input_operand): Use alpha_legitimate_constant_p after reload. + +2005-01-19 Zdenek Dvorak + + PR tree-optimization/19038 + * tree-ssa-loop-ivopts.c (allow_ip_end_pos_p): New function. + (add_candidate): Add ivs with increment in latch only if + allow_ip_end_pos_p is true. + (determine_iv_cost): Use empty_block_p. + +2005-01-19 Daniel Berlin + + * cfganal.c (compute_dominance_frontiers_1): Replace with new algorithm + (compute_dominance_frontiers): Ditto. + +2005-01-19 Ralf Corsepius + + PR target/19529 + * config/sh/t-rtems: New. + * config.gcc (sh-*-rtems*): Reflect having added config/sh/t-rtems. + +2005-01-19 Zdenek Dvorak + + * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Always subtract + the offset of the selected field. + +2005-01-19 Kazu Hirata + + * tree-cfg.c (remove_forwarder_block): Fix the check to + prevent a nonlocal label from appearing in the middle of a + basic block. + +2005-01-19 Hans-Peter Nilsson + + PR rtl-optimization/19462 + * reorg.c (find_end_label): Create return insn only if + current_function_epilogue_delay_list is empty. + +2005-01-19 Paolo Bonzini + + * doc/passes.texi: Remove paragraph mentioning new-ra. + +2005-01-19 Jakub Jelinek + + PR rtl-optimization/15139 + * combine.c: Include params.h. + (count_rtxs): New function. + (record_value_for_reg): If replace_rtx would replace at least + 2 occurrences of REG in VALUE and TEM is really large, replace REG with + (clobber (const_int 0)) instead of TEM. + * params.def (PARAM_MAX_LAST_VALUE_RTL): New. + * params.h (MAX_LAST_VALUE_RTL): New. + * Makefile.in (combine.o): Depend on $(PARAMS_H). + * doc/invoke.texi (--param max-last-value-rtl=N): Document. + + PR c/17297 + * c-typeck.c (digest_init): Only call build_vector if all constructor + elements are *_CST nodes. + * gimplify.c (gimplify_init_constructor): Likewise. + + PR middle-end/19164 + * c-typeck.c (digest_init): Only call build_vector if inside_init + is a CONSTRUCTOR. + +2005-01-18 Tobias Schl"uter + + * toplev.c (init_asm_output): Remove dead #ifdef. + +2005-01-18 Kaz Kojima + + * config/sh/linux.h (TARGET_C99_FUNCTIONS): Define. + +2005-01-18 Eric Botcazou + + * calls.c (expand_call): Check DECL_BUILT_IN_CLASS before + accessing DECL_FUNCTION_CODE. + * dojump.c (do_jump): Likewise. + * gimplify.c (gimplify_call_expr): Likewise. + * predict.c (expr_expected_value): Likewise. + (strip_builtin_expect): Likewise. + * tree-inline.c (estimate_num_insns_1): Likewise. + * tree-ssa-loop-im.c (stmt_cost): Likewise + * fold-const.c (fold): Test for BUILT_IN_NORMAL. + (tree_expr_nonnegative_p): Likewise. + +2005-01-18 Eric Botcazou + + * config/sparc/sparc.c (load_pic_register): Emit the appropriate + variant of the load_pcrel_sym pattern. + * config/sparc/sparc.md (P macro): Move to the top. + (load_pcrel_sym): Macroize using P. + (save_register_window): Likewise. + +2005-01-18 Aldy Hernandez + + * config/rs6000/rs6000.md ("sunordered"): Disable for e500. + ("sordered"): Same. + +2005-01-18 Andrew Pinski + + PR C/19472 + * c-typeck.c (build_asm_expr): Strip nops off + input memory operands. + +2005-01-18 David Edelsohn + + * config/rs6000/aix43.h (CPLUSPLUS_CPP_SPEC): Delete + _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, _LARGE_FILE_API. + * config/rs6000/aix51.h (CPLUSPLUS_CPP_SPEC): Same. + * config/rs6000/aix52.h (CPLUSPLUS_CPP_SPEC): Same. + +2005-01-18 Joel Sherrill + + PR target/19379 + * config/i386/i386.c (override_options): If the 80387 is disabled, + then do not return FP values using FP registers. + +2005-01-18 Kazu Hirata + + * basic-block.h, c-common.c, c-cppbuiltin.c, c-lang.c, + c-tree.h, cfgbuild.c, cgraph.c, cgraph.h, collect2.c, + combine.c, config.gcc, coverage.h, cse.c, cselib.c, + defaults.h, df.c, dwarf2asm.c, dwarf2out.c, explow.c, expr.c, + flow.c, fold-const.c, gcse.c, ggc-page.c, gimple-low.c, + gimplify.c, ifcvt.c, langhooks-def.h, lcm.c, optabs.h, + output.h, postreload-gcse.c, postreload.c, recog.c, + resource.c, rtl.def, rtlanal.c, sched-deps.c, sched-rgn.c, + targhooks.h, toplev.c, tree-data-ref.c, tree-eh.c, + tree-flow.h, tree-loop-linear.c, tree-mudflap.h, tree-nrv.c, + tree-optimize.c, tree-outof-ssa.c, tree-pass.h, + tree-scalar-evolution.c, tree-ssa-copy.c, tree-ssa-dce.c, + tree-ssa-dse.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c, + tree-ssa-pre.c, tree-ssa.c, tree-vectorizer.c, tree.def, + unwind-dw2-fde-darwin.c, var-tracking.c: Update copyright. + + * config/darwin.c, config/darwin.h, config/freebsd-spec.h, + config/alpha/alpha.c, config/arm/vfp.md, + config/i386/emmintrin.h, config/i386/i386-modes.def, + config/i386/i386-protos.h, config/i386/i386.h, + config/i386/pmmintrin.h, config/i386/ppro.md, + config/i386/predicates.md, config/i386/xmmintrin.h, + config/i860/i860.c, config/ia64/ia64-modes.def, + config/ia64/ia64-protos.h, config/ia64/ia64.h, + config/ia64/ia64.md, config/ia64/itanium1.md, + config/ia64/itanium2.md, config/ia64/predicates.md, + config/iq2000/iq2000.h, config/mips/linux64.h, + config/rs6000/aix41.h, config/rs6000/aix43.h, + config/rs6000/aix52.h, config/rs6000/darwin-fallback.c, + config/rs6000/rs6000.c, config/rs6000/rs6000.h, + config/rs6000/spe.md, config/sh/sh.md, config/sparc/linux.h, + config/sparc/linux64.h, config/sparc/litecoff.h, + config/sparc/sp64-elf.h, config/sparc/sparc.c, + config/sparc/sparc.h, config/sparc/sparc.md, + config/sparc/sysv4-only.h: Update copyright. + +2005-01-18 Richard Henderson + + PR target/19496 + * config/i386/i386.c (ix86_expand_fp_movcc): Fail for LTGT and UNEQ. + +2005-01-18 Marc Espie + * config/i386/openbsdelf.h: Typo. + +2005-01-18 Richard Henderson + + * config/i386/i386.c (ix86_expand_fp_movcc): Remove TARGET_IEEE_FP + special case for sse. + * config/i386/predicates.md (sse_comparison_operator): Likewise. + +2005-01-18 Dorit Naishlos + + * tree-inline.c (estimate_num_insns_1): Added cases for + ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF, and REALIGN_LOAD_EXPR. + +2005-01-18 Eric Botcazou + + PR rtl-optimization/19296 + * combine.c (simplify_comparison): Rewrite the condition under + which a non-paradoxical SUBREG of a PLUS can be lifted when + compared against a constant. + +2005-01-18 Andi Kleen + + * c-typeck.c: (convert_for_assignment): Check warn_pointer_sign. + * c.opt (-Wpointer-sign): Add. + * doc/invoke.texi: (-Wpointer-sign): Add. + +2005-01-18 Uros Bizjak + + * config/i386/i386.c (override_options): Revert 2004-11-24 change. + * config/i386/i386.md (fmodsf3, dremsf3, *sinsf2, *cossf2, sincossf3, + *tansf3_1, tansf2, atan2sf3_1, atan2sf3, atansf2, asinsf2, acossf2, + logsf2, log10sf2, log2sf2, log1psf2, logbsf2, ilogbsf2, expsf2, + exp10sf2, exp2sf2, expm1sf2, rintsf2, floorsf2, ceilsf2, btruncsf2, + nearbyintsf2): Disable for TARGET_SSE_MATH. Leave patterns enabled + for TARGET_MIX_SSE_I387. + (fmoddf3, dremdf3, *sindf2, *sinextendsfdf2, *cosdf2, *cosextendsfdf2, + sincosdf3, *sincosextendsfdf3, *tandf3_1, tandf2, atan2df3_1, + atan2df3, atandf2, asindf2, acosdf2, logdf2, log10df2, log2df2, + log1pdf2, logbdf2, expdf2, exp10df2, exp2df2, expm1df2, rintdf2, + floordf2, ceildf2, btruncdf2, nearbyintdf2): Disable for + (TARGET_SSE2 && TARGET_SSE_MATH). Leave patterns enabled for + TARGET_MIX_SSE_I387. + (atan2sf3, atan2df3, atan2xf3): Remove register constraints + from expander. + +2005-01-18 Uros Bizjak + + PR target/19424 + * config/i386/mmx.md (*movv2sf_internal_rex64, *movv2sf_internal): + Add movaps alternative for xmm reg->reg move. + +2005-01-17 Jeff Law + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Clear SSA_NAME_VALUE + at the end of the main DOM loop rather than just before DOM exits. + +2005-01-17 Diego Novillo + + PR tree-optimization/19121 + * tree-ssa-alias.c (compute_flow_sensitive_aliasing): When + adding aliases to a name tag, also add them to the pointer's + type tag. + * tree-ssa-copy.c (merge_alias_info): Do not merge flow + sensitive alias info at all. Only check that the two pointers + have compatible pointed-to sets. + * tree-ssa.c (verify_name_tags): Verify that the alias set of + a pointer's type tag is a superset of the alias set of the + pointer's name tag. + +2005-01-17 James E Wilson + + PR target/19357 + * config/ia64/ia64.md (movxf): Handle general register source. Adjust + comment to document why. + +2005-01-17 Richard Henderson + + * config/i386/sse.md (smaxv4sf3_finite, sse_vmsmaxv4sf3_finite, + sminv4sf3_finite, sse_vmsminv4sf3_finite, smaxv2df3_finite, + sse2_vmsmaxv2df3_finite, sminv2df3_finite, + sse2_vmsminv2df3_finite): New. + (smaxv4sf3, sse_vmsmaxv4sf3, sminv4sf3, sse_vmsminv4sf3, smaxv2df3, + sse2_vmsmaxv2df3, sminv2df3, sse2_vmsminv2df3): Remove commutative. + Force op1 into register. + +2005-01-17 Kelley Cook + + * Makefile.in (STAGEMOVESTUFF): Stage all the stamp files to prevent + bubblestrap from always rebuilding build directory. + +2005-01-17 Ulrich Weigand + + * config/s390/s390.md ("*clc"): Remove incorrect '='. + ("*cmpmem_short"): Likewise. + +2005-01-17 Steven Bosscher + + * basic-block.h: Document BB_* flags. + * regrename.c (copyprop_hardreg_forward): Don't use BB_VISITED, + use an sbitmap instead. + * sched-rgn.c (compute_trg_info): Likewise. + +2005-01-17 Richard Sandiford + + * config.gcc (mips64*-*-linux*): Set the default abi to n32. Remove + redundant target_cpu_default and extra_parts lines. Use the default + "from-abi" ISA. + * config/mips/linux64.h (DRIVER_DEFAULT_ABI_SELF_SPEC): Delete. + (SUBTARGET_EXTRA_SPECS): Delete. + (DRIVER_SELF_SPECS): Remove architecture lines. Set the ABI directly. + (SUBTARGET_ASM_SPEC): Remove -mabi=n32 and -mabi=64 mappings. + * config/mips/t-linux64 (MULTILIB_DIRNAMES): Use "32" for -mabi=32 + and "n32" for -mabi=n32. + +2005-01-17 Ian Lance Taylor + + PR c/5675 + * c-typeck.c (build_c_cast): Revert patch of 2003-02-16: don't + fold constant variables into initial values. + +2005-01-17 Kazu Hirata + + * tree-cfg.c (tree_can_merge_blocks_p): Reorder two checks. + + * tree-cfg.c (tree_forwarder_block_p): Speed up by walking + through the statements backward. + +2005-01-17 Ian Lance Taylor + + PR middle-end/13127: + * tree-inline.c (expand_call_inline): Set TREE_NO_WARNING on + a variable set to the return value of the inlined function. + +2005-01-17 Mark Dettinger + + * rtlanal.c (rtx_cost): Assign cost of 0 to a SUBREG + when modes are tieable. + +2005-01-17 Ranjit Mathew + + * gthr-posix.h (__gthread_active_p): Use pthread_cancel instead + of pthread_create to find out if threads are enabled. + * gthr-posix95.h (__gthread_active_p): Likewise. + +2005-01-17 Paolo Bonzini + + * common.opt (-fnew-ra): Remove. + * ra*.*: Remove. + * toplev.h (flag_new_regalloc): Remove. + * Makefile.in (ra*.*): Don't mention. + * passes.c (rest_of_handle_new_regalloc): Remove. + (rest_of_handle_combine, rest_of_compilation): Always consider + flag_new_regalloc as false. + * doc/invoke.texi: Don't document -fnew-ra. + +2005-01-17 Paolo Bonzini + + * bb-reorder.c (fix_edges_for_rarely_executed_code): Remove + last parameter to reg_scan. + * loop.c (loop_optimize): Likewise. + * passes.c (rest_of_handle_tracer, rest_of_handle_if_conversion, + rest_of_handle_web, rest_of_handle_cfg, rest_of_handle_jump_bypass, + rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, + rest_of_handle_gcse, rest_of_handle_loop_optimize, + rest_of_handle_loop2, rest_of_handle_jump2): Likewise. + * regclass.c (reg_scan): Likewise, for the declaration. + * rtl.h (reg_scan): Likewise, for the prototype. + +2005-01-17 Kazu Hirata + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Don't call + mark_dfs_back_edges. + +2005-01-16 Daniel Berlin + + * tree-ssa-pre.c (add_to_sets): s1 may be NULL. + (compute_avail): Uses don't go in tmp_gen. + +2005-01-16 Steven Bosscher + + * ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a + loop to look for a free slot in a page entry. + +2005-01-16 John David Anglin + + PR target/16304 + * defaults.h (TARGET_DEFERRED_OUTPUT_DEFS): Provide default. + * toplev.c (compile_file): Call process_pending_assemble_output_defs + just before targetm.asm_out.file_end. + * tree.h (process_pending_assemble_output_defs): Declare. + * varasm.c (assemble_output_def, process_pending_assemble_output_defs): + New functions. + (assemble_alias): Defer generation of assembly code for defines when + TARGET_DEFERRED_OUTPUT_DEFS is true. + * config/rs6000/aix41.h (TARGET_DEFERRED_OUTPUT_DEFS): Define. + * config/rs6000/aix43.h (TARGET_DEFERRED_OUTPUT_DEFS): Define. + * doc/tm.texi (TARGET_DEFERRED_OUTPUT_DEFS): document. + +2005-01-15 John David Anglin + + PR target/19336 + * pa.c (pa_scalar_mode_supported_p): New function. + (TARGET_SCALAR_MODE_SUPPORTED_P): Define. + * pa.h (MIN_UNITS_PER_WORD): Add comment. + + * pa-protos.h (prefetch_operand): Delete. + (prefetch_cc_operand, prefetch_nocc_operand): New declations. + * pa.c (prefetch_operand): Delete. + (prefetch_cc_operand, prefetch_nocc_operand): New functions. + * pa.h (EXTRA_CONSTRAINT): Add `W' constraint. + (PREDICATE_CODES): Delete prefetch_operand. Add prefetch_cc_operand + and prefetch_nocc_operand. + * pa.md (prefetch): Rework to avoid reload problems handling short + displacements when a cache control completer needs to be provided. + (prefetch_32, prefetch_64): Delete. + (prefetch_cc, prefetch_nocc): New patterns. + +2005-01-15 David Edelsohn + + * config/rs6000/aix52.h (CPLUSPLUS_CPP_SPEC): Revert previous change. + +2005-01-15 John David Anglin + + PR ada/19388 + * pa.c (pa_asm_output_aligned_common): Warn if specified alignment + exceeds maximum alignment for global common data. + * pa64-hpux.h (MAX_OFILE_ALIGNMENT): Define to 32768. + * som.h (MAX_OFILE_ALIGNMENT): Likewise. + +2004-01-15 Roger Sayle + + * tree-ssa-dom.c (extract_range_from_cond): Correct condition. + +2004-01-15 Roger Sayle + + * harg-reg-set.h (reg_class_names): Prototype global array. + * regclass.c (reg_class_names): Declare here and initialize to + REG_CLASS_NAMES. + (dump_regclass): Remove local declaration of reg_class_names. + (regclass): Likewise. + * cfg.c (dump_flow_info): Likewise. + * ra-debug.c (reg_class_names): Likewise. + * regrename.c (reg_class_names): Likewise. + * reload.c (reg_class_names): Likewise. + * reload1.c (spill_failure): Likewise. + * config/m68hc11/m68hc11.c (reg_class_names): Likewise. + +2005-01-15 Ulrich Weigand + + * config/s390/s390.md ("reload_outti"): Remove predicate for + output operand. Abort if operand is not a MEM. + ("reload_outdi", "reload_outdf"): Likewise. + +2005-01-15 Marc Espie + + * config.gcc (*-*-openbsd*): Set HAS_LIBC_R for OpenBSD <= 3.2. + (i[34567]86-*-openbsd*): Switch to ELF for OpenBSD >= 3.4. + * config/openbsd.h: Fix C++ includes for native configurations. + Add proper OS_CPP_BUILTINS. Fix libspec for recent OpenBSD. + Add trampoline support. + * config/i386/openbsdelf.h: New. + +2005-01-15 Marc Espie + + * collect2.c (main): Explicitly parse -dynamic-linker option. + +2005-01-15 Jakub Jelinek + + PR tree-optimization/19060 + * tree-ssa-dom.c (extract_range_from_cond) : + Return 0 if op1 <= TYPE_MIN_VALUE () resp. op1 >= TYPE_MAX_VALUE (). + (simplify_cond_and_lookup_avail_expr): Add assert for dummy == 0 + and handle extract_range_from_cond returning false. + * fold-const.c (fold): Optimize comparisons with min/max even for + width > HOST_BITS_PER_WIDE_INT. + +2005-01-15 Ralf Corsepius + + * config/mips/rtems.h (MIPS_DEFAULT_GVALUE): Set to 0. + * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS): + Remove little endian multilib variants. + Add mips32 multilib variant. + +2005-01-15 Kazu Hirata + + * explow.c (copy_all_reg, stabilize): Remove. + * expr.h: Remove the corresponding prototypes. + + * rtlanal.c (regs_set_between_p): Remove. + * rtl.h: Remove the corresponding prototype. + +2005-01-14 David Edelsohn + + * config/rs6000/rs6000.c (rs6k_nonimmediate_operand): Rename + to rs6000_nonimmediate_operand. + * config/rs6000/rs6000.h (PREDICATE_CODES): Rename + rs6k_nonimmediate_operand to rs6000_nonimmediate_operand. + * config/rs6000/rs6000.md (movsi_internal1): Rename predicate to + rs6000_nonimmediate_operand. + * config/rs6000/spe.md (movdf_e500_double): Rename predicate to + rs6000_nonimmediate_operand. + +2005-01-14 Andrew Pinski + + * tree-ssa-alias.c (pass_may_alias): Add TODO_verify_stmts. + +2005-01-14 Aldy Hernandez + + * config/rs6000/rs6000.h (CLASS_MAX_NREGS): DF goes in 1 register + on e500v2. + (CANNOT_CHANGE_MODE_CLASS): Restrict DI mode changes on e500v2. + (PREDICATE_CODES): Add rs6k_nonimmediate_operand. + + * config/rs6000/rs6000.c (invalid_e500_subreg): New. + (rs6k_nonimmediate_operand): New. + (rs6000_legitimate_offset_address_p): Handle DI modes on e500v2 + correctly. + (legitimate_lo_sum_address_p): Same. + (rs6000_legitimize_address): Same. + (rs6000_legitimize_reload_address): Same. + (rs6000_legitimate_address): Same. + (spe_build_register_parallel): Pass DF and DC modes in a DI + register. + + * config/rs6000/rs6000.md ("*movsi_internal1"): Change predicate + to rs6k_nonimmediate_operand. + + * config/rs6000/spe.md ("*frob_df_di"): New. + ("*frob_di_df"): New. + ("*frob_di_df_2"): New. + ("*mov_sidf_e500_subreg0"): New. + ("*mov_sidf_e500_subreg4"): New. + ("*movdf_e500_double"): Change predicate to + rs6k_nonimmediate_operand. + +2005-01-14 Aldy Hernandez + + * postreload.c (move2add_note_store): Only call + trunc_int_for_mode on scalar integers. + +2005-01-14 Steven Bosscher + + * tree-ssa-dce.c (visited_control_parents): New sbitmap to + replace BB_VISITED uses. + (find_obviously_necessary_stmts): Don't clear BB_VISITED. + (propagate_necessity): Check the bitmap instead of BB_VISITED. + (tree_dce_done): Free visited_control_parents. + (perform_tree_ssa_dce): Allocate and clear it. + * tree-ssa-pre.c (compute_antic_aux): Make non-recursive. + (compute_antic): Iterate from here using a DFS. Use an sbitmap + instead of BB_VISITED. + +2005-01-14 Kazu Hirata + + * c-tree.h, coverage.h, langhooks-def.h, optabs.h, output.h, + rtl.h, targhooks.h, tree-flow.h, tree-mudflap.h, tree.h: + Remove unused prototypes. + +2005-01-14 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_stack_info): Fix caching of SPE + 64-bit register usage. + (spe_func_has_64bit_regs_p): Add FIXME note. + +2005-01-14 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_generate_compare): Replace + flag_finite_math_only with flag_unsafe_math_optimizations. + +2005-01-14 J. D. Johnston + + * config/s390/tpf-unwind.h (s390_fallback_frame_state): Correct + end-of-stack check. + (__tpf_eh_return): Copy TPF private stack area from the module + boundary stack frame. Add check for when module addresses are + equal, but no stub address is found. + +2005-01-14 Richard Earnshaw + + PR target/7525 + * arm.h (struct machine_function): Add call_via field. + (thumb_call_via_label): Declare. + * arm.c (thumb_call_via_label): New variable. + (thumb_call_reg_needed): New variable. + (arm_output_function_epilogue): For Thumb code, output any per-function + call-indirect trampolines. + (thumb_call_via_reg): New function. + (arm_file_end): New function. + (TARGET_ASM_FILE_END): Call arm_file_end. + (aof_file_end): Likewise. + * arm-protos.h (thumb_call_via_reg): Declare. + * arm.md (call_reg_thumb, call_value_reg_thumb): Call + thumb_call_via_reg in normal case. + +2005-01-14 Jakub Jelinek + + PR middle-end/19084 + PR rtl-optimization/19348 + * recog.c (peephole2_optimize): Do global life update if some peephole + decides it doesn't need at least one of its inputs and that change + influences liveness at the start of the basic block. + + * basic-block.h (EXECUTE_IF_AND_COMPL_IN_REG_SET): Needs 2 REGSET + arguments instead of 1. + +2005-01-14 Eric Botcazou + + PR middle-end/18820 + * varasm.c (initializer_constant_valid_p) : Return + zero for nested functions needing a static chain or functions + with a non-constant address. + +2005-01-13 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation) : Optimize + (and (sign_extend X) C) into (zero_extend (and X C)). + +2005-01-13 David O'Brien + + * config/freebsd-spec.h: Make KSE pthread lib logic the default. + +2005-01-13 Richard Henderson + + PR target/19009 + PR target/19250 + PR target/19252 + * config/i386/i386.md (cmpdf, cmpsf, bunordered, bordered, buneq, + bunge, bungt, bunle, bunlt, bltgt): Enable for TARGET_SSE_MATH, + not just TARGET_SSE. + (cmpfp_i_387): Rename from cmpfp_i. Move after sse patterns. + (cmpfp_i_mixed): Rename from cmpfp_i_sse; use for TARGET_MIX_SSE_I387. + (cmpfp_i_sse): Rename from cmpfp_i_sse_only; use for TARGET_SSE_MATH. + (cmpfp_iu_mixed, cmpfp_iu_sse, cmpfp_iu_387): Similarly. + (fp_jcc_1_mixed, fp_jcc_1_sse, fp_jcc_1_387): Similarly. + (fp_jcc_2_mixed, fp_jcc_2_sse, fp_jcc_2_387): Similarly. + (fp_jcc_3_387, fp_jcc_4_387, fp_jcc_5_387, fp_jcc_6_387, + fp_jcc_7_387, fp_jcc_8_387): Rename from fp_jcc_N. + (movdicc_c_rex64): Rename with '*'. + (movsfcc, movdfcc): Add checks for 387 and sse math to condition. + (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): New. + (movsfcc_1_387): Rename from movsfcc_1. + (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): New. + (movdfcc_1, movdfcc_1_rex64): Add check for 387. + (sminsf3, smaxsf3, smindf3, smaxdf3): New. + (minsf3, minsf, minsf_nonieee, minsf_sse, mindf3, mindf, + mindf_nonieee, mindf_sse, maxsf3, maxsf, maxsf_nonieee, maxsf_sse, + maxdf3, maxdf, maxdf_nonieee, maxdf_sse, sse_movsfcc, sse_movsfcc_eq, + sse_movdfcc, sse_movdfcc_eq, sse_movsfcc_const0_1, + sse_movsfcc_const0_2, sse_movsfcc_const0_3, sse_movsfcc_const0_4, + sse_movdfcc_const0_1, sse_movdfcc_const0_2, sse_movdfcc_const0_3, + sse_movdfcc_const0_4): Remove. + * config/i386/i386.c (ix86_expand_fp_movcc): For TARGET_SSE_MATH, + recognize min/max early. Update for changed sse cmove patterns. + (ix86_split_sse_movcc): New. + * config/i386/i386-protos.h: Update. + +2005-01-13 Steven Bosscher + + * tree-ssa-dse.c (fix_phi_uses): Use SSA operand iterators. + (fix_stmt_v_may_defs): Likewise. + +2005-01-13 Richard Henderson + + * config/i386/i386.c (ix86_expand_fp_absneg_operator): Use elt_mode + for converting the mask. + +2005-01-13 David Edelsohn + + * config/rs6000/aix52.h (CPLUSPLUS_CPP_SPEC): Change _XOPEN_SOURCE + definition to 600. + +2005-01-13 Richard Henderson + + * config/i386/i386.c (IX86_BUILTIN_MOVQ, IX86_BUILTIN_LOADD, + IX86_BUILTIN_STORED, IX86_BUILTIN_MOVQ2DQ, + IX86_BUILTIN_MOVDQ2Q): Remove. + (IX86_BUILTIN_VEC_EXT_V4SI): New. + (ix86_init_mmx_sse_builtins, ix86_expand_builtin): Update to match. + (ix86_expand_vector_extract): For V4S[FI], extract element 0 after + shuffling. + * config/i386/sse.md (sse_concatv2sf): Accept zero operand 2. + (sse2_pextrw): Fix immediate constraint. + (sse2_loadq, sse2_loadq_rex64): Remove. + * config/i386/emmintrin.h (_mm_cvtsi128_si32, _mm_cvtsi128_si64x): + Use __builtin_ia32_vec_ext_. + (_mm_cvtsi32_si128, _mm_cvtsi64x_si128): Use _mm_set_epi. + +2005-01-13 Aldy Hernandez + + * function.c (assign_parm_setup_block): Look inside original + entry_parm when inspecting PARALLEL. + +2005-01-13 Ralf Corsepius + Joel Sherrill + + PR target/19399 + * gthr-rtems.h (__gthread_recursive_mutex_t): New type. + (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Define to + rtems_gxx_recursive_mutex_init. + (__gthread_recursive_mutex_lock): New function. + (__gthread_recursive_mutex_trylock): Likewise. + (__gthread_recursive_mutex_unlock): Likewise. + +2005-01-13 Ralf Corsepius + + * config/i386/t-rtems-i386: Multilib on -mtune instead of -mcpu. + +2005-01-13 Jan Beulich + + * config/ia64/ia64.md (ashlti3, ashlti3_internal): New. + (ashrti3_internal): Indicate output is early clobber. Generate result + into output rather than first input. Use move for low word of output + if shift count is exactly 64. + (lshrti3_internal): Likewise. + +2005-01-13 Hans-Peter Nilsson + + PR target/18329 + PR target/18330 + * reload1.c (delete_output_reload): Don't delete an output reload + if the pseudo lives longer than a single basic block. Adjust and + improve wording of comment. + +2005-01-12 Andrew Pinski + + PR target/19334 + * config/darwin.c (machopic_select_section): Use TYPE_SIZE_UNIT instead + of TYPE_SIZE where we mean the number of bytes. + +2005-01-12 Aldy Hernandez + + * function.c (assign_parm_setup_block): Relax condition on + multi-register optimization. + +2005-01-12 Nick Clifton + + * config/sh/sh.md (udivsi3_sh2a, divsi3_sh2a): Give these patterns + an "in_delay_slot" attribute of "no" to prevent them being used in + delay slots. This is forbidden because they might generate + exceptions. + +2005-01-12 Alan Modra + + PR target/19389 + * config/rs6000/rs6000.md (movtf_internal): Replace r->o and m->r + with r->Y and Y->r. + +2005-01-12 Nick Clifton + + * config/iq2000/iq2000.h (ASM_SPEC): Undefine (to stop -Qy being + passed on to GAS) but do not define, as GAS no longer supports or + needs the -m2000 option. + +2005-01-11 Roger Sayle + + * builtins.c (fold_builtin_fabs): Convert argument to the appropriate + type as args of unprototyped builtins aren't automatically promoted. + (fold_builtin_abs): Likewise. + +2005-01-11 Kaveh R. Ghazi + + * Makefile.in: Set a `build-warn' variable. + +2005-01-11 Zdenek Dvorak + + PR tree-optimization/17949 + * tree-ssa-loop-ivopts.c (may_be_unaligned_p): New function. + (find_interesting_uses_address): Use it. + +2005-01-11 Aldy Hernandez + + * regrename.c (kill_value): Handle subreg's that won't simplify. + +2005-01-11 Richard Henderson + + PR target/13366 + * config/i386/i386.h (enum ix86_builtins): Move ... + * config/i386/i386.c: ... here. + (IX86_BUILTIN_MOVDDUP, IX86_BUILTIN_MMX_ZERO, IX86_BUILTIN_PEXTRW, + IX86_BUILTIN_PINSRW, IX86_BUILTIN_LOADAPS, IX86_BUILTIN_LOADSS, + IX86_BUILTIN_STORESS, IX86_BUILTIN_SSE_ZERO, IX86_BUILTIN_PEXTRW128, + IX86_BUILTIN_PINSRW128, IX86_BUILTIN_LOADAPD, IX86_BUILTIN_LOADSD, + IX86_BUILTIN_STOREAPD, IX86_BUILTIN_STORESD, IX86_BUILTIN_STOREHPD, + IX86_BUILTIN_STORELPD, IX86_BUILTIN_SETPD1, IX86_BUILTIN_SETPD, + IX86_BUILTIN_CLRPD, IX86_BUILTIN_LOADPD1, IX86_BUILTIN_LOADRPD, + IX86_BUILTIN_STOREPD1, IX86_BUILTIN_STORERPD, IX86_BUILTIN_LOADDQA, + IX86_BUILTIN_STOREDQA, IX86_BUILTIN_CLRTI, + IX86_BUILTIN_LOADDDUP): Remove. + (IX86_BUILTIN_VEC_INIT_V2SI, IX86_BUILTIN_VEC_INIT_V4HI, + IX86_BUILTIN_VEC_INIT_V8QI, IX86_BUILTIN_VEC_EXT_V2DF, + IX86_BUILTIN_VEC_EXT_V2DI, IX86_BUILTIN_VEC_EXT_V4SF, + IX86_BUILTIN_VEC_EXT_V8HI, IX86_BUILTIN_VEC_EXT_V4HI, + IX86_BUILTIN_VEC_SET_V8HI, IX86_BUILTIN_VEC_SET_V4HI): New. + (ix86_init_builtins): Make static. + (ix86_init_mmx_sse_builtins): Update for changed builtins. + (ix86_expand_binop_builtin): Only use ix86_fixup_binary_operands + if all the modes match. Otherwise, fake it. + (get_element_number, ix86_expand_vec_init_builtin, + ix86_expand_vec_ext_builtin, ix86_expand_vec_set_builtin): New. + (ix86_expand_builtin): Make static. Update for changed builtins. + (ix86_expand_vector_move_misalign): Use sse2_loadlpd with zero + operand instead of sse2_loadsd. Cast sse1 fallback to V4SFmode. + (ix86_expand_vector_init_duplicate): New. + (ix86_expand_vector_init_low_nonzero): New. + (ix86_expand_vector_init_one_var, ix86_expand_vector_init_general): + Split out from ix86_expand_vector_init; handle integer modes. + (ix86_expand_vector_init): Use them. + (ix86_expand_vector_set, ix86_expand_vector_extract): New. + * config/i386/i386-protos.h: Update. + * config/i386/predicates.md (reg_or_0_operand): New. + * config/i386/mmx.md (mov_internal): Add 'r' variants. + (movv2sf_internal): Likewise. And a splitter to match them all. + (vec_dupv2sf, mmx_concatv2sf, vec_setv2sf, vec_extractv2sf, + vec_initv2sf, vec_dupv4hi, vec_dupv2si, mmx_concatv2si, vec_setv2si, + vec_extractv2si, vec_initv2si, vec_setv4hi, vec_extractv4hi, + vec_initv4hi, vec_setv8qi, vec_extractv8qi, vec_initv8qi): New. + (mmx_pinsrw): Fix operand ordering. + * config/i386/sse.md (movv4sf splitter): Use direct pattern, + rather than sse_loadss expander. + (movv2df splitter): Similarly. + (sse_loadss, sse_loadlss): Remove. + (vec_dupv4sf, sse_concatv2sf, sse_concatv4sf, vec_extractv4sf_0): New. + (vec_setv4sf, vec_setv2df): Use ix86_expand_vector_set. + (vec_extractv4sf, vec_extractv2df): Use ix86_expand_vector_extract. + (sse3_movddup): Rename with '*'. + (sse3_movddup splitter): Use gen_rtx_REG instead of gen_lowpart. + (sse2_loadsd): Remove. + (vec_dupv2df_sse3): Rename from sse3_loadddup. + (vec_dupv2df, vec_concatv2df_sse3, vec_concatv2df): New. + (sse2_pinsrw): Fix argument ordering. + (sse2_loadld, sse2_loadq): Add sse1 alternatives. + (sse2_stored): Remove 'r' destination. + (vec_dupv4si, vec_dupv2di, sse2_concatv2si, sse1_concatv2si, + vec_concatv4si_1, vec_concatv2di, vec_setv2di, vec_extractv2di, + vec_initv2di, vec_setv4si, vec_extractv4si, vec_initv4si, + vec_setv8hi, vec_extractv8hi, vec_initv8hi, vec_setv16qi, + vec_extractv16qi, vec_initv16qi): New. + + * config/i386/emmintrin.h (__m128i, __m128d): Use typedef, not define. + (_mm_set_sd, _mm_set1_pd, _mm_setzero_pd, _mm_set_epi64x, + _mm_set_epi32, _mm_set_epi16, _mm_set_epi8, _mm_setzero_si128): Use + constructor form. + (_mm_load_pd, _mm_store_pd): Use plain dereference. + (_mm_load_si128, _mm_store_si128): Likewise. + (_mm_load1_pd): Use _mm_set1_pd. + (_mm_load_sd): Use _mm_set_sd. + (_mm_store_sd, _mm_storeh_pd): Use __builtin_ia32_vec_ext_v2df. + (_mm_store1_pd, _mm_storer_pd): Use _mm_store_pd. + (_mm_set_epi64): Use _mm_set_epi64x. + (_mm_set1_epi64x, _mm_set1_epi64, _mm_set1_epi32, _mm_set_epi16, + _mm_set1_epi8, _mm_setr_epi64, _mm_setr_epi32, _mm_setr_epi16, + _mm_setr_epi8): Use _mm_set_foo form. + (_mm_loadl_epi64, _mm_movpi64_epi64, _mm_move_epi64): Use _mm_set_epi64. + (_mm_storel_epi64, _mm_movepi64_pi64): Use __builtin_ia32_vec_ext_v2di. + (_mm_extract_epi16): Use __builtin_ia32_vec_ext_v8hi. + (_mm_insert_epi16): Use __builtin_ia32_vec_set_v8hi. + * config/i386/mmintrin.h (_mm_setzero_si64): Use plain cast. + (_mm_set_pi32): Use __builtin_ia32_vec_init_v2si. + (_mm_set_pi16): Use __builtin_ia32_vec_init_v4hi. + (_mm_set_pi8): Use __builtin_ia32_vec_init_v8qi. + (_mm_set1_pi16, _mm_set1_pi8): Use _mm_set_piN variant. + * config/i386/pmmintrin.h (_mm_loaddup_pd): Use _mm_load1_pd. + (_mm_movedup_pd): Use _mm_shuffle_pd. + * config/i386/xmmintrin.h (_mm_setzero_ps, _mm_set_ss, + _mm_set1_ps, _mm_set_ps, _mm_setr_ps): Use constructor form. + (_mm_cvtpi16_ps, _mm_cvtpu16_ps, _mm_cvtpi8_ps, _mm_cvtpu8_ps, + _mm_cvtps_pi8, _mm_cvtpi32x2_ps): Avoid __builtin_ia32_mmx_zero; + Use _mm_setzero_ps. + (_mm_load_ss, _mm_load1_ps): Use _mm_set* form. + (_mm_load_ps, _mm_loadr_ps): Use raw dereference. + (_mm_store_ss): Use __builtin_ia32_vec_ext_v4sf. + (_mm_store_ps): Use raw dereference. + (_mm_store1_ps): Use _mm_storeu_ps. + (_mm_storer_ps): Use _mm_store_ps. + (_mm_extract_pi16): Use __builtin_ia32_vec_ext_v4hi. + (_mm_insert_pi16): Use __builtin_ia32_vec_set_v4hi. + +2005-01-11 Stan Shebs + + * config/rs6000/rs6000.c (machopic_output_stub): Issue + ldu instead of lwzu if 64-bit -mdynamic-no-pic. + +2005-01-11 Andrew Pinski + + PR target/18761 + * config/rs6000/rs6000.c (rs6000_special_round_type_align): + Skip all DECLs except for FIELD_DECLs. + +2005-01-11 Andreas Krebbel + + * config/s390/s390.c (override_options): Return error if + -mbackchain, -mpacked-stack and -mhard-float are used together. + (s390_va_start): Remove the backchain && packed-stack special case. + (s390_gimplify_va_arg): Likewise. + * doc/invoke.texi: Remove the ABI incompatibility note. + +2005-01-11 Andreas Krebbel + + * config/s390/s390.c (struct s390_frame_layout): Remove + save_backchain_p. + (s390_frame_info, s390_emit_prologue): Replace occurrences of + save_backchain_p with TARGET_BACKCHAIN. + +2005-01-11 Alan Modra + + PR target/18916 + * builtins.c (std_gimplify_va_arg_expr): Adjust alignment of *ap. + * expr.h (struct locate_and_pad_arg_data): Add "boundary". + * function.c (locate_and_pad_parm): Set new field. + (assign_parm_find_stack_rtl): Use it instead of FUNCTION_ARG_BOUNDARY. + Tweak where_pad test to include "none". Always set mem align for + stack_parm. + (assign_parm_adjust_stack_rtl): Discard stack_parm if alignment + not sufficient for type. + (assign_parm_setup_block): If stack_parm is zero on entry, always + make a new stack local. Block move old stack parm if necessary + to new aligned stack local. + (assign_parm_setup_stack): Use a block move to handle + potentially misaligned entry_parm. + (assign_parms_unsplit_complex): Specify required alignment when + creating stack local. + * calls.c (compute_argument_addresses): Override alignment of stack + arg calculated from its type with the alignment given by + FUNCTION_ARG_BOUNDARY. + (store_one_arg): Likewise. + +2005-01-11 Jan Beulich + + * config/ia64/ia64.md (zero_extendsidi2): Replace zxt4 by addp4. + Change respective itanium_class attribute to ialu. + (shladdp4_internal): New. + * config/ia64/predicates.md (shladd_log2_operand): New. + +2005-01-11 Richard Henderson + + * expr.c (store_constructor): Use rtvec_alloc instead of + alloca+gen_rtvec_v, and an incorrect number passed to alloca. + +2005-01-11 Kazu Hirata + + * config/alpha/alpha.c, config/i386/mmx.md: Fix comment typos. + +2005-01-11 Alan Modra + + * varasm.c (default_section_type_flags_1): Don't set SECTION_SMALL. + * config/ia64/ia64.c (TARGET_SECTION_TYPE_FLAGS): Define. + (TARGET_RWRELOC): Define. + (ia64_rwreloc_section_type_flags): Delete. + (ia64_section_type_flags): New function. + * config/ia64/hpux.h (TARGET_SECTION_TYPE_FLAGS): Don't define. + (TARGET_RWRELOC): Define. + +2005-01-10 David Mosberger + + PR target/18987 + * config/ia64/ia64.c (process_set): For alloc insn, only call + process_epilogue is !frame_pointer_needed. + +2005-01-10 Roger Sayle + + PR c++/19355 + * c-common.c (c_common_truthvalue_conversion): TRUTH_NOT_EXPR is a + unary operator and can't be treated as a binary/comparison operator. + +2005-01-10 Richard Henderson + + * config/i386/i386.c (ix86_function_value): Use type_natural_mode. + (ix86_return_in_memory): Likewise. + (function_arg_advance): Likewise. Mirror structure in function_arg + for choosing register to advance. + +2005-01-10 Kazu Hirata + + * tree-vectorizer.c, tree.def: Fix comment typos. + +2005-01-10 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): 4 new fields: + ddbr, ddr, debr, der. + (s390_rtx_costs): More precise handling of divide instructions. + +2005-01-10 David Edelsohn + + * config/rs6000/t-aix43 (BOOT_LDFLAGS): Define. + +2005-01-10 Jan Beulich + + * config/ia64/ia64.c (ia64_in_small_data_p): Also handle the section + names resulting from -ffunction-sections/-fdata-sections and linkonce + ones. + * varasm.c (default_section_type_flags_1): Also set SECTION_SMALL + based on the section name. Rearrange the section name comparison logic + slightly so that each section name is compared against at most once. + +2005-01-10 Ben Elliston + + * doc/invoke.texi (Code Gen Options): Add PowerPC to the list of + targets for which -fPIC reduces limitations on the GOT size. + +2005-01-09 Falk Hueffner + + * fold-const.c (fold): Also handle EXACT_DIV_EXPR when folding + X/C1 cmpop C2. + +2005-01-09 David Edelsohn + + PR target/18720 + * collect2.c (main): Set aixrtl_flag for -brtl option. + (resolve_lib_name): Search for .so file extension before .a + if aixrtl_flag set. + +2005-01-09 Dorit Naishlos + + * tree-vectorizer.c (vect_enhance_data_refs_alignment): Add dump prints. + (vect_analyze_data_refs_alignment): Add dump prints. + +2005-01-09 Ira Rosen + + * tree-vectorizer.c (vect_analyze_offset_expr): Use + expr_invariant_in_loop_p. + Initialize outputs first thing in the function. + (vect_update_ivs_after_vectorizer): Call initial_condition_in_loop_num. + (vect_is_simple_iv_evolution): Call initial_condition_in_loop_num. + (vect_analyze_pointer_ref_access): Check that the initial condition of + the access function is loop invariant. + +2005-01-09 Richard Henderson + + * config/i386/i386.c (bdesc_2arg): Update names for mmx_ prefixes. + (ix86_expand_builtin): Likewise. Frob MASKMOVQ wrt the input mem + just like MASKMOVDQU. Return plain zero for MMX_ZERO. + * config/i386/i386.md (MMXMODEI, mov, + mov_internal_rex64, mov_internal, movv2sf, + movv2sf_internal_rex64, movv2sf_internal, MMXMODE, + movmisalign, mmx_pmovmskb, mmx_maskmovq, mmx_maskmovq_rex, + sse_movntdi, addv8qi3, addv4hi3, addv2si3, mmx_adddi3, ssaddv8qi3, + ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, subv4hi3, subv2si3, + mmx_subdi3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3, + mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd, + sse2_umulsidi3, mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3, + mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pinsrw, + mmx_pextrw, mmx_pshufw, eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3, + gtv2si3, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3, + ashrv2si3, lshrv4hi3, lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3, + mmx_ashldi3, mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw, + mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd, + mmx_punpckldq, emms, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3, + eqv2sf3, pfmaxv2sf3, pfminv2sf3, mulv2sf3, femms, pf2id, pf2iw, + pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pfrcpv2sf2, pfrcpit1v2sf3, + pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, pmulhrwv4hi3, pswapdv2si2, + pswapdv2sf2): Move to mmx.md; rename as necessary with leading + mmx_ prefix. + (mmx_clrdi, pavgusb): Remove. + (ldmxcsr, stmxcsr, sfence, sfence_insn): Move to sse.md; rename + with leading sse_ prefix. + * config/i386/sse.md: Receive them. + * config/i386/mmx.md: New file. + (MMXMODE12, MMXMODE24, mmxvecsize): New. + (subrv2sf3): Turn into expander for normal subtraction. + (mmx_addv2sf3, mmx_mulv2sf3, mmx_smaxv2sf3, mmx_sminv2sf3, + mmx_eqv2sf3, mmx_mulv4hi3, mmx_smulv4hi3_highpart, + mmx_umulv4hi3_highpart, mmx_pmaddwd, mmx_pmulhrwv4hi3, sse2_umulsidi3, + mmx_umaxv8qi3, mmx_smaxv4hi3, mmx_uminv8qi3, mmx_sminv4hi3): Mark + commutative; use ix86_binary_operator_ok. + (mmx_add3, mmx_ssadd3, mmx_usadd3, + mmx_sub3, mmx_sssub3, mmx_ussub3 + mmx_ashr3, mmx_lshr3, mmx_ashl3 + mmx_eq3, mmx_gt3, mmx_and3, + mmx_nand3, mmx_ior3, mmx_xor3): + Macroize from existing patterns; use ix86_binary_operator_ok. + (mmx_packsswb, mmx_packssdw, mmx_packuswb): Add memory alternative. + (mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd, + mmx_punpckhdq, mmx_punpckhdq, mmx_punpckldq): Likewise. Model + with vec_select+vec_concat. + (mmx_pshufw, mmx_pshufw_1): Likewise. + (mmx_uavgv8qi3): Merge pavgusb. Model correcty. + (mmx_uavgv4hi3): Model correctly. + * config/i386/mmintrin.h (_mm_and_si64, _mm_andnot_si64, _mm_or_si64, + _mm_xor_si64): Remove casts. + +2005-01-09 Zdenek Dvorak + + PR tree-optimization/19224 + * tree-scalar-evolution.c (get_instantiated_value, + set_instantiated_value): New functions. + (instantiate_parameters_1): Cache the results. + (instantiate_parameters, resolve_mixers): Initialize and free + the cache. + +2005-01-08 David Edelsohn + + * config/i386/i386.md (addhi_4): Correct reference in comment. + (addqi_4): Same. + +2005-01-08 Richard Henderson + + * config/i386/emmintrin.h (_mm_cvtsi128_si32): Move earlier. + (_mm_cvtsi128_si64x): Likewise. + (_mm_srl_epi64, _mm_srl_epi32, _mm_srl_epi16, _mm_sra_epi32, + _mm_sra_epi16, _mm_sll_epi64, _mm_sll_epi32, _mm_sll_epi16): Use + the _mm_{srl,sll}i_foo counterpart, and _mm_cvtsi128_si32. + * config/i386/i386-modes.def: Add V16HI, V32QI, V4DF, V8SF. + * config/i386/i386-protos.h: Update. + * config/i386/i386.c (print_operand): Add 'H'. + (ix86_fixup_binary_operands): Split out from ... + (ix86_expand_binary_operator): ... here. + (ix86_fixup_binary_operands_no_copy): New. + (ix86_expand_fp_absneg_operator): Handle vector mode results. + (bdesc_2arg): Update names for sse{,2,3}_ prefixes. + (ix86_init_mmx_sse_builtins): Remove *maskncmp* special cases. + (safe_vector_operand): Use CONST0_RTX. + (ix86_expand_binop_builtin): Use ix86_fixup_binary_operands. + (ix86_expand_builtin): Merge CODE_FOR_sse2_maskmovdqu_rex64 and + CODE_FOR_sse2_maskmovdqu. Special case SSE version of MASKMOVDQU + expansion. Update names for sse{,2,3}_ prefixes. Remove *maskncmp* + special cases. + * config/i386/i386.h (IX86_BUILTIN_CMPNGTSS): New. + (IX86_BUILTIN_CMPNGESS): New. + * config/i386/i386.md (UNSPEC_FIX_NOTRUNC): New. + (attr type): Add sselog1. + (attr unit, attr memory): Handle it. + (movti, movti_internal, movti_rex64): Move near other integer moves. + (movtf, movtf_internal): Move near other fp moves. + (SSEMODE, SSEMODEI, vec_setv2df, vec_extractv2df, vec_initv2df, + vec_setv4sf, vec_extractv4sf, vec_initv4sf, movv4sf, movv4sf_internal, + movv2df, movv2df_internal, mov, mov_internal, + movmisalign, sse_movups_1, sse_movmskps, sse_movntv4sf, + sse_movhlps, sse_movlhps, sse_storehps, sse_loadhps, sse_storelps, + sse_loadlps, sse_loadss, sse_loadss_1, sse_movss, sse_storess, + sse_shufps, addv4sf3, vmaddv4sf3, subv4sf3, vmsubv4sf3, negv4sf2, + mulv4sf3, vmmulv4sf3, divv4sf3, vmdivv4sf3, rcpv4sf2, vmrcpv4sf2, + rsqrtv4sf2, vmrsqrtv4sf2, sqrtv4sf2, vmsqrtv4sf2, sse_andv4sf3, + sse_nandv4sf3, sse_iorv4sf3, sse_xorv4sf3, sse2_andv2df3, + sse2_nandv2df3, sse2_iorv2df3, sse2_xorv2df3, sse2_andv2di3, + sse2_nandv2di3, sse2_iorv2di3, sse2_xorv2di3, maskcmpv4sf3, + vmmaskcmpv4sf3, sse_comi, sse_ucomi, sse_unpckhps, sse_unpcklps, + smaxv4sf3, vmsmaxv4sf3, sminv4sf3, vmsminv4sf3, cvtpi2ps, cvtps2pi, + cvttps2pi, cvtsi2ss, cvtsi2ssq, cvtss2si, cvtss2siq, cvttss2si, + cvttss2siq, addv2df3, vmaddv2df3, subv2df3, vmsubv2df3, mulv2df3, + vmmulv2df3, divv2df3, vmdivv2df3, smaxv2df3, vmsmaxv2df3, sminv2df3, + vmsminv2df3, sqrtv2df2, vmsqrtv2df2, maskcmpv2df3, vmmaskcmpv2df3, + sse2_comi, sse2_ucomi, sse2_movmskpd, sse2_pmovmskb, sse2_maskmovdqu, + sse2_maskmovdqu_rex64, sse2_movntv2df, sse2_movntv2di, sse2_movntsi, + cvtdq2ps, cvtps2dq, cvttps2dq, cvtdq2pd, cvtpd2dq, cvttpd2dq, + cvtpd2pi, cvttpd2pi, cvtpi2pd, cvtsd2si, cvtsd2siq, cvttsd2si, + cvttsd2siq, cvtsi2sd, cvtsi2sdq, cvtsd2ss, cvtss2sd, cvtpd2ps, + cvtps2pd, addv16qi3, addv8hi3, addv4si3, addv2di3, ssaddv16qi3, + ssaddv8hi3, usaddv16qi3, usaddv8hi3, subv16qi3, subv8hi3, subv4si3, + subv2di3, sssubv16qi3, sssubv8hi3, ussubv16qi3, ussubv8hi3, mulv8hi3, + smulv8hi3_highpart, umulv8hi3_highpart, sse2_umulsidi3, + sse2_umulv2siv2di3, sse2_pmaddwd, sse2_uavgv16qi3, sse2_uavgv8hi3, + sse2_psadbw, sse2_pinsrw, sse2_pextrw, sse2_pshufd, sse2_pshuflw, + sse2_pshufhw, eqv16qi3, eqv8hi3, eqv4si3, gtv16qi3, gtv8hi3, + gtv4si3, umaxv16qi3, smaxv8hi3, uminv16qi3, sminv8hi3, ashrv8hi3, + ashrv4si3, lshrv8hi3, lshrv4si3, lshrv2di3, ashlv8hi3, ashlv4si3, + ashlv2di3, sse2_ashlti3, sse2_lshrti3, sse2_unpckhpd, sse2_unpcklpd, + sse2_packsswb, sse2_packssdw, sse2_packuswb, sse2_punpckhbw, + sse2_punpckhwd, sse2_punpckhdq, sse2_punpcklbw, sse2_punpcklwd, + sse2_punpckldq, sse2_punpcklqdq, sse2_punpckhqdq, sse2_movupd, + sse2_movdqu, sse2_movdq2q, sse2_movdq2q_rex64, sse2_movq2dq, + sse2_movq2dq_rex64, sse2_loadd, sse2_stored, sse2_storehpd, + sse2_loadhpd, sse2_storelpd, sse2_loadlpd, sse2_movsd, sse2_loadsd, + sse2_loadsd_1, sse2_storesd, sse2_shufpd, sse2_clflush, sse2_mfence, + mfence_insn, sse2_lfence, lfence_insn, mwait, monitor, addsubv4sf3, + addsubv2df3, haddv4sf3, haddv2df3, hsubv4sf3, hsubv2df3, movshdup, + movsldup, lddqu, loadddup, movddup): Move to sse.md. Any with + non-optabs meanings renamed with an "sse{,2,3}_" prefix at the + same time. + (SSEPUSH, push): Remove. + (MMXPUSH, push): Remove. + (sse_movaps, sse_movaps_1, sse_movups): Remove. + (sse2_movapd, sse2_movdqa, sse2_movq): Remove. + (sse2_andti3, sse2_nandti3, sse2_iorti3, sse2_xorti3): Remove. + (sse_clrv4sf, sse_clrv2df, sse2_clrti): Remove. + (maskncmpv4sf3, vmmaskncmpv4sf3): Remove. + (maskncmpv2df3, vmmaskncmpv2df3): Remove. + (ashrv8hi3_ti, ashrv4si3_ti, lshrv8hi3_ti, lshrv4si3_ti): Remove. + (lshrv2di3_ti, ashlv8hi3_ti, ashlv4si3_ti, ashlv2di3_ti): Remove. + * config/i386/athlon.md (athlon_sselog_load): Handle sselog1. + (athlon_sselog_load_k8, athlon_sselog, athlon_sselog_k8): Likewise. + * config/i386/ppro.md (ppro_sse_div_V4SF_load): Fix memory attr. + (ppro_sse_log_V4SF_load): Similarly. Handle sselog1. + (ppro_sse_log_V4SF): Handle sselog1. + * config/i386/predicates.md (const_0_to_1_operand): New. + (const_0_to_255_mul_8_operand): New. + (const_1_to_31_operand): Rename from const_int_1_31_operand. + (const_2_to_3_operand, const_4_to_7_operand): New. + * config/i386/sse.md: New file. + (SSEMODE12, SSEMODE24, SSEMODE124, SSEMODE248, ssevecsize): New. + (sse_movups): Rename from sse_movups_1. + (sse_loadlss): Rename from sse_loadss_1. + (andv4sf3, iorv4sf3, xorv4sf3, andv2df3): Remove the sse prefix + from the name. + (negv4sf2): Use ix86_expand_fp_absneg_operator. + (absv4sf2, negv2df, absv2df): New. + (addv4sf3): Add expander to call ix86_fixup_binary_operands_no_copy. + (subv4sf3, mulv4sf3, divv4sf3, smaxv4sf3, sminv4sf3, andv4sf3, + iorv4sf3, xorv4sf3, addv2df3, subv2df3, mulv2df3, divv2df3, + smaxv2df3, sminv2df3, andv2df3, iorv2df3, xorv2df3, mulv8hi3, + umaxv16qi3, smaxv8hi3, uminv16qi3, sminv8hi3): Likewise. + (sse3_addsubv4sf3): Model correctly. + sse3_haddv4sf3, sse3_hsubv4sf3, sse3_addsubv2df3, sse3_haddv2df3, + sse3_hsubv2df3, sse2_ashlti3, sse2_lshrti3): Likewise. + (sse_movhlps): Model with vec_select+vec_concat. + (sse_movlhps, sse_unpckhps, sse_unpcklps, sse3_movshdup, + sse3_movsldup, sse_shufps, sse_shufps_1, sse2_unpckhpd, sse3_movddup, + sse2_unpcklpd, sse2_shufpd, sse2_shufpd_1, sse2_punpckhbw, + sse2_punpcklbw, sse2_punpckhwd, sse2_punpcklwd, sse2_punpckhdq, + sse2_punpckldq, sse2_punpckhqdq, sse2_punpcklqdq, sse2_pshufd, + sse2_pshufd_1, sse2_pshuflw, sse2_pshuflw_1, sse2_pshufhw, + sse2_pshufhw_1): Likewise. + (neg2, one_cmpl2): New. + (add3, sse2_ssadd3, sse2_usadd3, + sub3, sse2_sssub3, sse2_ussub3, + ashr3, lshr3, sse2_eq3, + sse2_gt3, and3, sse_nand3, + ior3, xor3): Macroize from existing patterns. + (addv4sf3, sse_vmaddv4sf3, mulv4sf3, sse_vmmulv4sf3, smaxv4sf3, + sse_vmsmaxv4sf3, sminv4sf3, sse_vmsminv4sf3, addv2df3, sse2_vmaddv2df3, + mulv2df3, sse2_vmmulv2df3, smaxv2df3, sse2_vmsmaxv2df3, sminv2df3, + sse2_vmsminv2df3, umaxv16qi3, smaxv8hi3, uminv16qi3 + sminv8hi3): Mark commutative + operands. Use ix86_binary_operator_ok. + (sse_unpckhps, sse_unpcklps, sse2_packsswb, sse2_packssdw, + sse2_packuswb, sse2_punpckhbw, sse2_punpcklbw, sse2_punpckhwd, + sse2_punpcklwd, sse2_punpckhdq, sse2_punpckldq, sse2_punpckhqdq, + sse2_punpcklqdq): Allow operand2 in memory. + (sse_movhlps, sse_movlhps, sse2_unpckhpd, sse2_unpcklpd + sse2_movsd): Add memory alternatives. + (sse_storelps): Turn expander into an insn; split after reload. + (sse_storess, sse2_loadhpd, sse2_loadlpd): Add non-xmm inputs. + (sse2_storehpd, sse2_storelpd): Add non-xmm outputs. + +2005-01-08 Eric Botcazou + + * configure.ac (DWARF-2 debug_line): Use objdump. + * configure: Regenerate. + +2005-01-08 Jeff Law + Diego Novillo + + PR tree-optimization/18241 + * tree-nrv.c (tree_nrv): Ignore volatile return values. + * tree-ssa-dse.c (dse_optimize_stmt): Do not optimize + statements with volatile operands. + * tree-ssa-operands.c (add_stmt_operand): Do add volatile + operands after marking a statement with has_volatile_ops. + +2005-01-08 Roger Sayle + + * tree.c (int_fits_type_p): Always honor integer constant + TYPE_MIN_VALUE and TYPE_MAX_VALUE if they exist. + +2005-01-08 Roger Sayle + + * ifcvt.c (find_if_case_1): Reinstate 2005-01-04 change, now that + the latent bug in rtl_delete_block has been resolved. + +2005-01-08 Richard Sandiford + + * config/mips/t-iris6 (MULTILIB_DIRNAMES): Use -mabi argument values. + (MULTILIB_OSDIRNAMES): Use the standard lib, lib32 and lib64. + +2005-01-08 Richard Sandiford + + * config/mips/t-slibgcc-irix (SHLIB_LINK): Install a copy of the + library as @multilib_dir@/$(SHLIB_SONAME). + +2005-01-07 Eric Botcazou + + * configure.ac (HAVE_AS_OFFSETABLE_LO10): Fix typo. + * configure: Regenerate. + +2005-01-07 Jakub Jelinek + + * c-common.c (handle_mode_attribute): For ENUMERAL_TYPE, also copy + TYPE_MODE. + +2005-01-07 David Edelsohn + + PR target/13674 + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): + Convert non-word aligned offset address using ld/std into + indirect address. + +2005-01-07 Richard Henderson + + * config/i386/i386.md (sse_loadhps splitter): Fix operand number typo. + +2005-01-07 Richard SAndiford + + * tree.h (IS_EXPR_CODE_CLASS): Use a straight-forward range check. + +2005-01-07 Jakub Jelinek + + PR tree-optimization/19283 + * fold-const.c (fold_widened_comparison): Return NULL if shorter_type + is not shorter than the original type. + + PR rtl-optimization/19012 + * config/i386/i386.md (addqi_1_slp): Set memory attribute. + + PR rtl-optimization/18861 + * cfgbuild.c (BLOCK_USED_BY_TABLEJUMP): Define. + (FULL_STATE): Define. + (mark_tablejump_edge): New function. + (purge_dead_tablejump_edges): New function. + (find_bb_boundaries): Use it. + + PR tree-optimization/18828 + * builtins.c (expand_builtin_next_arg): Remove argument and all + the argument checking. + (expand_builtin): Adjust caller. + (expand_builtin_va_start): Likewise. Remove error for too many + arguments. + (fold_builtin_next_arg): Issue error for too many arguments. + After checking arguments, replace them with magic arguments that + prevent further checking of the args. + +2005-01-06 John David Anglin + + * pa64-hpux.h (STARTFILE_SPEC): Fix typo in spec. + +2005-01-06 Roger Sayle + + PR target/6077 + * gcc.c (input_suffix_matches): Tweak the semantics of %{.s:...} + and %{.S:...} (and their negative variants) to test whether the + input file is assembler or pre-processed-assembler independent of + the actual filename extension. + +2005-01-06 Roger Sayle + + * simplify-rtx.c (simplify_subreg): Simplify truncations of shifts + of sign or zero extended values. + +2005-01-06 Geoffrey Keating + + * c-cppbuiltin.c (builtin_define_float_constants): Set __*_EPSILON__ + for IBM long double format correctly. + +2005-01-06 Daniel Berlin + + Fix PR tree-optimization/18792 + + * tree-data-ref.c (build_classic_dist_vector): Change first_loop + to first_loop_depth, and use loop depth instead of loop number. + (build_classic_dir_vector): Ditto. + (compute_data_dependences_for_loop): Use depth, not loop number. + * tree-loop-linear.c (try_interchange_loops): Use loop depth, not loop + number. Pass in loops, instead of loop numbers. + (gather_interchange_stats): Ditto. + (linear_transform_loops): Ditto. + +2005-01-06 Richard Sandiford + + PR rtl-opt/13299 + * loop.c (get_monotonic_increment, biased_biv_fits_mode_p, + biv_fits_mode_p, extension_within_bounds_p): New functions. + (check_ext_dependent_givs): Use them. + +2005-01-06 Roger Sayle + + * cfgrtl.c (rtl_delete_block): A basic block may be followed by + more than one barrier, in which case we should delete them all. + +2005-01-06 Tobias Schlueter + + * gcc.c (process_command): Change year in 'gcc --version' to 2005. + +2005-01-05 Daniel Berlin + + Fix PR middle-end/19286 + Fix PR debug/19267 + * dwarf2out.c (gen_subprogram_die): If we've already tried to + output this subprogram, simply ignore this attempt to do it again. + (add_abstract_origin_attribute): Don't abort trying to add the abstract + origin attribute if it's not possible. + (gen_block_die): Don't ignore subblocks of "unused" blocks. + (decls_for_scope): Ditto. + * gimple-low.c (mark_blocks_with_used_subblocks): Remove. + (mark_used_blocks): Don't call mark_blocks_with_used_subblocks. + +2005-01-05 Richard Henderson + + PR target/11327 + * config/i386/i386.c (BUILTIN_DESC_SWAP_OPERANDS): New. + (bdesc_2arg): Use it. + (ix86_expand_binop_builtin): Force operands into registers + when optimizing. + (ix86_expand_unop_builtin, ix86_expand_unop1_builtin, + ix86_expand_sse_compare, ix86_expand_sse_comi, + ix86_expand_builtin): Likewise. + +2005-01-05 Richard Henderson + + * config/ia64/ia64.c (rtx_needs_barrier): Handle CONST_VECTOR + and VEC_SELECT. + * config/ia64/vect.md (mulv8qi3): Re-implement with mix_[rl]. + (mulv4hi3): Set itanium_class mmmul. + (fpack_sfxf, fpack_xfsf, fpack_xfxf): Remove. + (fpack): Rename from fpack_sfsf. + +2005-01-05 Richard Henderson + + PR rtl-opt/10692 + * reload1.c (do_input_reload): Restrict the optimization deleteing + a previous output reload to RELOAD_FOR_INPUT. + +2005-01-05 Steven Bosscher + + * combine.c (expand_compound_operation) : Add + comment that we fall through after case. + (mark_used_regs_combine): Don't expect a SIGN_EXTRACT in a SET_DEST. + (distribute_links): Likewise. + * cse.c (cse_insn): Likewise. + * cselib.c (cselib_invalidate_mem): Likewise. + * df.c: Update comments at the top of the file. + (read_modify_subreg_p): Update comments here too. + (df_def_record_1): Don't expect a SIGN_EXTRACT in a SET_DEST. + * flow.c (mark_set_1): Likewise. + (mark_used_regs): Likewise. + * gcse.c (mems_conflict_for_gcse_p): Likewise. + (canon_list_insert): Likewise. + (mark_set): Likewise. + (try_replace_reg): Likewise. + (store_killed_in_insn): Likewise. + * loop.c (count_one_set): Likewise. + (basic_induction_var): Likewise. + * postreload-gcse.c (find_mem_conflicts): Likewise. + * postreload.c (reload_combine_note_store): Likewise. + (move2add_note_store): Likewise. + * reload.c (find_equiv_reg): Likewise. + (mark_referenced_resources): Likewise. + * rtlanal.c (set_noop_p): Likewise. + (note_stores): Likewise. + (note_uses): Likewise. + * sched-deps.c (sched_analyze_1): Likewise. + * sched-rgn.c (check_live_1): Likewise. + (update_live_1): Likewise. + * config/i860/i860.c: Likewise. + + * rtl.dec (SIGN_EXTRACT): Document that this cannot appear as + an lvalue. + (ZERO_EXTRACT): Mention that this one can be an lvalue. + + * doc/rtl.texi: Update documentation for bit-fields and SET. + +2005-01-05 Roger Sayle + + * ifcvt.c (find_if_case_1): Revert 2005-01-04 change. + +2005-01-05 Jan Hubicka + Richard Henderson + + PR target/18910 + * config/i386/i386.c (ix86_expand_move): Handle tls symbols + with an offset. + +2005-01-05 Richard Henderson + + PR target/12902 + * config/i386/i386.md (sse_movhps, sse_movlps): Remove. + (sse_shufps): Change operand 3 to const_int_operand. + (sse2_storelps): Fix typo in template. + (sse_storehps, sse_loadhps, sse_storelps, sse_loadlps): New. + * config/i386/i386.c (ix86_expand_vector_move_misalign): Use them. + (ix86_expand_builtin): Likewise. + +2005-01-05 Julian Brown + + * config/arm/arm.c (arm_return_in_memory): Treat complex types + as aggregates for AAPCS ABIs. + +2005-01-05 Stan Shebs + + * unwind-dw2-fde-darwin.c (examine_objects): Use 64-bit + Mach-O getters if ppc64. + * config/darwin.c (darwin_asm_output_dwarf_delta): Obey + size argument. + * config/darwin.h (ASM_PREFERRED_EH_DATA_FORMAT): Use + signed four-byte field for global code case. + (STARTFILE_SPEC): Avoid crt2.o for 64-bit compilation. + +2005-01-05 Roger Sayle + + PR middle-end/19100 + * c-common.c: Include real.h. + (c_common_truthvalue_conversion): Avoid destructively modifying expr. + Correctly handle TREE_CONSTANT_OVERFLOW for INTEGER_CST. + Correctly handle TREE_CONSTANT_OVERFLOW and NaNs for REAL_CST. + * Makefile.in (c-common.o): Update dependencies. + +2005-01-05 Joseph S. Myers + + * c-parse.in (asm_string): Add trailing semicolon. + +2005-01-05 Joseph S. Myers + + * c-parse.in (asm_string): New. Don't allow wide strings in + 'asm'. + (simple_asm_expr, asm_argument, asm_operand, asm_clobbers): Use + asm_string instead of STRING. + +2005-01-05 Joseph S. Myers + + * c-typeck.c (constructor_no_implicit): Remove. + (set_designator, process_init_element): Don't check + constructor_no_implicit. + +2005-01-05 J"orn Rennecke + Kaz Kojima + + PR target/16482 + * lcm.c (create_pre_exit): New. + (optimize_mode_switching): In MODE_ENTRY / MODE_EXIT case, set + ENTRY_EXIT_EXTRA to 3. Use create_pre_exit. + +2004-01-05 Richard Earnshaw + + * arm.h (TARGET_OPTIONS): Correctly record -mhard-float and + -msoft-float in target_float_switch. + * arm.c (arm_override_options): Fix processing of target_float_switch. + +2004-01-05 Richard Earnshaw + + * arm/vfp.md (arm_movsi_vfp): Hide VFP register classes from register + preferencing. + +2004-01-05 Uros Bizjak + + * doc/invoke.texi (Intel 386 and AMD x86-64 Options): + Replace i387 with 'i386 compiler' in -mfpmath=sse option. + +2005-01-04 Roger Sayle + + * ifcvt.c (find_if_case_1): Avoid creating an empty forwarder block, + if deleting the then-block allows the test-block to fallthru to the + else-block. + +2005-01-04 Andrew Pinski + + PR c/19152 + * c-decl.c (diagnose_mismatched_decls): Accept "extern inline" declared + after the full declaration if the are in two different TUs. + +2005-01-04 Richard Henderson + + PR tree-opt/19158 + * tree-sra.c (generate_one_element_init): Just + call gimplify_and_add. + (generate_element_init): Record the + new referenced variables and mark them for renaming + and split out to ... + (generate_element_init_1): This. + (scalarize_init): Don't call push_gimplify_context/ + pop_gimplify_context. + +2005-01-04 Geoffrey Keating + + * toplev.c (get_src_pwd): Handle failure of getpwd(). + +2005-01-04 Roger Sayle + + * fold-const.c (fold_single_bit_test): Delete unreachable handling + of TRUTH_NOT_EXPR. + (fold): Don't call fold_single_bit_test with a TRUTH_NOT_EXPR, as + all the cases handled by it are inverted by invert_truthvalue. + +2005-01-04 Eric Botcazou + + * config/sparc/sparc.md (save_register_windowdi): Add missing mode. + (save_register_windowsi): Likewise. + +2005-01-04 Richard Henderson + + * tree-mudflap.c (mf_varname_tree): Fix thinko setting declname. + +2005-01-04 Uros Bizjak + + PR middle-end/17767 + * cse.c (fold_rtx) [RTX_COMPARE, RTX_COMM_COMPARE]: Don't attempt + any simplifications of vector mode comparison operators. + * simplify-rtx.c (simplify_relational_operation): Fix variable name. + +2005-01-04 Paolo Bonzini + Devang Patel + + PR tree-optimization/18308 + * tree-if-conv.c (add_to_dst_predicate_list): Gimplify + the operands before creating a new expression. + * dojump.c (do_jump): Make drop_through_label available + for all cases. Add expansion of COND_EXPR. + +2005-01-04 Ira Rosen + + * tree-vectorizer.c (vect_analyze_offset_expr): Test for + INTEGER_CST instead of TREE_CONSTANT. + (vect_gen_niters_for_prolog_loop): Test for INTEGER_CST + instead of TREE_CONSTANT. + (vect_analyze_pointer_ref_access): Test for INTEGER_CST + instead of TREE_CONSTANT. + +2005-01-04 Eric Botcazou + + * tree-eh.c (replace_goto_queue): Return early if the queue is empty. + +2005-01-04 Uros Bizjak + + PR target/19240 + * config/i386/i386.md (*fop_df_1_i387): Disable for TARGET_SSE_MATH. + (*fop_df_1_i387): Disable for (TARGET_SSE2 && TARGET_SSE_MATH). + +2005-01-03 Richard Henderson + + * fold-const.c (force_fit_type): Cope with types larger than 2 HWI. + (fold_convert_const_int_from_int, fold_convert_const_int_from_real, + fold_convert_const_real_from_real): Split out from ... + (fold_convert_const): ... here. + +2005-01-03 Richard Henderson + + PR target/19235 + * config/i386/i386.md (movdi_2): Separate SSE1 and SSE2 alternatives. + (mov_internal): Likewise. + (movdf_nointeger): Prefer Y while not preferring, but allowing, x. + Add V2SF case; use it for SSE1; don't use TI. + (movdf_integer): Likewise. + (mov_internal, movti_internal): Force V4SF for SSE1. + +2005-01-03 Ira Rosen + + * tree-vectorizer.c (vect_strip_conversions): New function. + (vect_analyze_offset_expr): Call vect_strip_conversions. Add + check for binary class. + +2005-01-03 Daniel Berlin + + Fix PR debug/17924 + Fix PR debug/19191 + * dwarf2out.c (block_ultimate_origin): Follow decl origin if origin + is a decl. + * gimple-low.c (mark_blocks_with_used_vars): New function. + (mark_blocks_with_used_subblocks): Ditto. + (mark_used_blocks): Ditto. + (pass_mark_used_blocks): New pass. + * tree-inline.c: Include debug.h. + (expand_call_inline): Call outlining_inline_function here. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_mark_used_blocks. + * tree-pass.h (pass_mark_used_blocks): New. + * Makefile.in (tree-inline.o): Add debug.h dependency. + +2005-01-03 Geoffrey Keating + + * config/darwin.c (darwin_handle_weak_import_attribute): Permit + VAR_DECLs to have weak_import attribute. + + * config/rs6000/darwin-fallback.c: Use 'ucontext_t' rather than + 'struct ucontext'. + +2004-01-03 Steven Bosscher + + * passes.c (rest_of_compilation): Don't run regmove if only + flag_expensive_optimizations, require flag_regmove instead. + +2005-01-03 Eric Botcazou + + * config/sparc/litecoff.h (TARGET_OS_CPP_BUILTINS): Do not + register "sparc". + * config/sparc/sysv4-only.h (TARGET_OS_CPP_BUILTINS): Likewise. + * config/sparc/rtemself.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + * config/sparc/sol2-64.h (TARGET_SUB_OS_CPP_BUILTINS): Delete. + * config/sparc/sp64-elf.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + +2005-01-03 Richard Henderson + + * config/ia64/ia64.c (TARGET_VECTOR_MODE_SUPPORTED_P): New. + (ia64_const_ok_for_letter_p): New. + (ia64_const_double_ok_for_letter_p): New. + (ia64_extra_constraint): New. + (ia64_expand_vecint_compare): New. + (ia64_expand_vcondu_v2si): New. + (ia64_expand_vecint_cmov): New. + (ia64_expand_vecint_minmax): New. + (ia64_print_operand): Add 'v'. + (ia64_preferred_reload_class): New. + (ia64_vector_mode_supported_p): New. + * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): New. + (PREFERRED_RELOAD_CLASS): Move to function. + (CONST_OK_FOR_LETTER_P): Move to function. + (CONST_DOUBLE_OK_FOR_LETTER_P): Move to function. + (CONSTRAINT_OK_FOR_Q, CONSTRAINT_OK_FOR_R): Remove. + (CONSTRAINT_OK_FOR_S, CONSTRAINT_OK_FOR_T): Remove. + (EXTRA_CONSTRAINT): Move to function. + * config/ia64/ia64.md: Include vect.md. + (itanium_class): Add mmalua. + (type): Handle it. + * config/ia64/itanium1.md (1_mmalua): New. Add it to bypasses. + (1b_mmalua): New. + * config/ia64/itanium2.md (2_mmalua, 2b_mmalua): Similarly. + * config/ia64/predicates.md (gr_reg_or_0_operand): Accept any + CONST0_RTX. + (const_int_2bit_operand): New. + (fr_reg_or_0_operand): New. + * config/ia64/ia64-modes.def: Add vector modes. + * config/ia64/ia64-protos.h: Update. + * config/ia64/vect.md: New file. + +2005-01-03 Richard Henderson + + * simplify-rtx.c (simplify_binary_operation): Handle VEC_CONCAT. + +2005-01-03 Uros Bizjak + + PR target/19236 + * config/i386/i386.c (log1psf2): Change mode of operands[0,1] + to SFmode. + (log1pdf2): Change mode of operands[0,1] to DFmode. + +2005-01-03 Eric Botcazou + + * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Define to false. + * config/sparc/linux.h (SPARC_RELAXED_ORDERING): Define to true. + * config/sparc/linux64.h (SPARC_RELAXED_ORDERING): Likewise. + * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define to + SPARC_RELAXED_ORDERING. + +2005-01-03 Richard Henderson + Uros Bizjak + + PR target/14631 + * config/i386/i386.c (ix86_expand_builtin): [IX86_BUILTIN_PINSRW, + IX86_BUILTIN_PINSRW128]: Fix wrong selector range in error message. + * config/i386/i386.md (mmx_pinsrw, sse2_pinsrw): Fix selector + handling. + (*mmx_pinsrw, *sse2_pinsrw): New patterns. + * config/i386/i386/predicates.md (const_pow2_1_to_8_operand, + const_pow2_1_to_128_operand): New predicates. + +2005-01-02 Greg McGary + + * tree-mudflap.c (mf_varname_tree): decl_printable_name handles + anonymous decls. + (mf_xform_derefs_1) [RESULT_DECL, STRING_CST]: Handle as innermost + object. [ptr_type]: Remove unused variable. + Remember nearest addressable array-element or record-component + when checking bitfield components. Tolerate empty BIND_EXPR. + +2005-01-01 Richard Henderson + + * tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions + that don't narrow the value. Fail for other conversions. + +2005-01-01 Richard Henderson + + PR c/19031 + * c-decl.c (pop_file_scope): Call maybe_apply_pending_pragma_weaks. + * c-lang.c (finish_file): Don't do it here. + * objc/objc-act.c (objc_finish_file): Likewise. + + * cgraph.c (decl_assembler_name_equal): New. + (cgraph_node_for_asm, cgraph_varpool_node_for_asm): New. + (cgraph_varpool_node): Actually link up cgraph_varpool_nodes. + * cgraph.h (struct cgraph_varpool_node): Add next. + (cgraph_node_for_asm, cgraph_varpool_node_for_asm): Declare. + * varasm.c (assemble_alias): Mark the target as needed. + +2005-01-01 Andrew Pinski + + PR middle-end/19221 + * function.c (get_arg_pointer_save_area): Use entry_of_function + instead of get_insns. + +2005-01-01 Roger Sayle + Andrew Pinski + James E. Wilson + + PR rtl-optimization/12092 + * loop.c (emit_prefetch_instructions): Do nothing if PREFETCH_BLOCK + is zero. + +2005-01-01 Roger Sayle + Olivier Hainque + + * tree.c (int_fits_type_p): A narrower type always fits in a + wider one, except for negative values into unsigned types. + +2005-01-01 Roger Sayle + + * tree.c (int_fits_type_p): Compare the result of force_fit_type + with the original constant rather than require TREE_OVERFLOW. + +2005-01-01 Steven Bosscher + + PR middle-end/17544 + * c-decl.c (finish_function): If compiling C99, annotate the + compiler generated return with the current file name and line 0. + * tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if + the source line is greater than 0. + (remove_bb): Likewise. diff --git a/contrib/gcc/ChangeLog-2006 b/contrib/gcc/ChangeLog-2006 new file mode 100644 index 00000000000..9419c0e38ab --- /dev/null +++ b/contrib/gcc/ChangeLog-2006 @@ -0,0 +1,16726 @@ +2006-12-29 Paolo Bonzini + + PR bootstrap/29544 + * gcc/Makefile.in (STAGE1_CHECKING): Rename to... + (STAGE1_CHECKING_CFLAGS): ... this. + +2006-12-28 H.J. Lu + + Backport from mainline: + 2006-12-02 H.J. Lu + + PR target/30040 + * config/i386/driver-i386.c: Include "coretypes.h" and "tm.h". + (host_detect_local_cpu): Check -mtune= vs. -march=. Rewrite + processor detection. + + * config/i386/i386.h (CC1_CPU_SPEC): Add -mtune=native for + -march=native if there is no -mtune=*. + + * config/i386/x-i386 (driver-i386.o): Also depend on $(TM_H) + coretypes.h. + +2006-12-27 Ian Lance Taylor + + PR debug/26964 + * dwarf2out.c (gen_type_die): Don't write out a DIE for + ENUMERAL_TYPE if it was already written out. + +2006-12-23 Eric Botcazou + + * dwarf2out.c (dbx_reg_number): Do leaf register remapping + only if the function is leaf. + (multiple_reg_loc_descriptor): Likewise. + +2006-12-21 Jakub Jelinek + + PR middle-end/30262 + PR middle-end/30263 + * tree-nested.c (walk_asm_expr): New function. + (walk_stmts): Use it for ASM_EXPR. + + PR target/30230 + * config/ia64/ia64.c (ia64_add_bundle_selector_before): New function. + (bundling): Use it. + +2006-12-17 Matthias Klose + + PR libstdc++/11953 + * gcc/config/mips/linux.h (SUBTARGET_CPP_SPEC): Extend. + +2006-12-16 Joseph Myers + David Edelsohn + + PR target/24036 + * doc/tm.texi (HARD_REGNO_NREGS_HAS_PADDING, + HARD_REGNO_NREGS_WITH_PADDING): Document new target macros. + * defaults.h (HARD_REGNO_NREGS_HAS_PADDING, + HARD_REGNO_NREGS_WITH_PADDING): Define. + * config/i386/i386.h (HARD_REGNO_NREGS_HAS_PADDING, + HARD_REGNO_NREGS_WITH_PADDING): Define. + * rtlanal.c (subreg_regno_offset, subreg_offset_representable_p): + Use new macros to detect modes with holes; do not look at integer + units. + (subreg_offset_representable_p): Check for and disallow cases + where the modes use different numbers of bits from registers. + * config/rs6000/rs6000.c (rs6000_emit_move): Handle TFmode + constant for soft-float. + (rs6000_hard_regno_nregs): Use UNITS_PER_FP_WORD for e500 GPRs + containing doubles. + (rs6000_split_multireg_move): Use DFmode reg_mode for TFmode moves + in E500 double case. + * config/rs6000/rs6000.md (movtf): Allow soft-float. + (movtf_softfloat): New. + +2006-12-15 Jakub Jelinek + + PR target/30185 + * config/rs6000/rs6000.md (div3): Use correct mode in + force_reg call. + +2006-12-13 Richard Guenther + + * ipa-inline.c (cgraph_flatten_node): Replace leafify with + flatten. + (cgraph_decide_inlining): Likewise. + +2006-12-13 Richard Guenther + + * ipa-reference.c (scan_for_static_refs): Also scan + tcc_comparison class trees. + +2006-12-12 Daniel Berlin + + * tree-ssa-structalias.c (handle_ptr_arith): Return false when we + can't handle the pointer arithmetic. + +2006-12-12 Jakub Jelinek + + PR libstdc++/11953 + * gthr-posix.h (_REENTRANT): Only define if __osf__ is defined. + + * config/ia64/linux.h (CPP_SPEC): Define. + * config/s390/linux.h (CPP_SPEC): Define. + +2006-12-12 Jim Wilson + Jakub Jelinek + + PR rtl-optimization/27761 + * combine.c (try_combine): Don't create a useless garbage SET + if PATTERN (i2) is a PARALLEL. If added_sets_1, save + PATTERN (i1) resp. SET from i1src to i1dest in i1pat + and use it to prevent accidental modification of i1src. + +2006-12-12 Richard Guenther + + PR middle-end/30147 + * fold-const.c (fold_read_from_constant_string): Only fold read + from constant string if the result type is integer. + +2006-12-09 Maxim Kuvyrkov + + * haifa-sched.c (schedule_block): Remove excessive sanity check. + +2006-12-08 Mike Stump + + * config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Build + libgcc with -mmacosx-version-min=10.4. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Default to + G4 for 10.5+ unless doing kernel builds. + +2006-12-08 John David Anglin + + PR target/30039 + * pa.md (high:DI and lo_sum:DI): Handle 64-bit CONST_INTs in 32-bit + patterns. Correct length of high:DI instruction sequence. + +2006-12-07 Maxim Kuvyrkov + + PR target/29794 + * sched-rgn.c (add_block1): Use correct initializer. + +2006-12-05 H.J. Lu + + PR driver/30074 + * config.host: Add driver-i386.o only if compiling for x86 or + x86_64. + +2006-12-04 Jakub Jelinek + + PR libgomp/29947 + * omp-low.c (expand_omp_for_static_nochunk, + expand_omp_for_static_chunk): Do all arithmetics in signed rather than + unsigned type. + + PR middle-end/29965 + * omp-low.c (determine_parallel_type): Don't try to optimize combined + parallels if region->exit or region->inner->exit is NULL. + (expand_omp_parallel): Handle NULL region->exit even if cfg is already + built. + (expand_omp_for_generic): Handle NULL region->cond and region->exit. + (expand_omp_for): Use expand_omp_for_generic if either region->cond + or region->exit is NULL. + (expand_omp_sections): Handle NULL region->cond or region->exit. + (expand_omp_synch): + +2006-12-03 Kaveh R. Ghazi + + * doc/install.texi: Update MPFR prerequisite to version 2.2.1. + +2006-12-02 Andrew Pinski + + PR tree-opt/29984 + * tree-ssa-reassoc.c (eliminate_duplicate_pair): Handle MAX_EXPR + and MIN_EXRP. + +2006-11-29 Joseph Myers + + * config/rs6000/predicates.md (gpc_reg_operand): Check + invalid_e500_subreg. + * config/rs6000/rs6000.c (invalid_e500_subreg): Don't allow any + SImode subregs of SPE vectors. + * config/rs6000/rs6000.md (insv): Fail for invalid E500 subregs. + * jump.c (true_regnum): Require subregs to satisfy + subreg_offset_representable_p. + +2006-11-29 Jie Zhang + + * doc/tm.texi (NO_PROFILE_COUNTERS): Document more accurately. + +2006-11-29 Jim Tison + + * gthr-tpf.h (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION, + __gthread_recursive_mutex_init): Define. + +2006-11-29 Joseph Myers + + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): If + STRICT_ALIGNMENT and the type is more aligned than the saved + registers, copy via a temporary. + +2006-11-28 Joseph Myers + + * function.c (instantiate_virtual_regs_in_insn): Call force_reg + inside start_sequence / end_sequence pair. + +2006-11-27 Michael Matz + Andreas Krebbel + + PR target/29319 + * config/s390/predicates.md (larl_operand): Check addend of larl + operand to be in range of -/+2GB. + * config/s390/s390.c (legitimize_pic_address): Likewise. + Changed type of variable even to HOST_WIDE_INT. + +2006-11-26 Kaveh R. Ghazi + + * doc/install.texi: Remove documentation for --with-mpfr-dir + and --with-gmp-dir, add documentation for --with-mpfr-include, + --with-mpfr-lib, --with-gmp-include and --with-gmp-lib. + +2006-11-25 Andrew Pinski + + PR tree-opt/29964 + * ipa-pure-const.c (check_tree): If the original tree + is volatile return early and say the function is not pure + nor const. Remove the volatile check for writes. + (analyze_function): Print out the result of the local + analysis pass. + +2006-11-24 Jakub Jelinek + + PR c/29955 + * c-tree.h (c_maybe_initialize_eh): New prototype. + * c-decl.c (finish_decl): Move EH initialization... + (c_maybe_initialize_eh): ... here. New function. + * c-parser.c (c_parser_omp_construct): Call c_maybe_initialize_eh + if not #pragma omp atomic. + + PR c/29736 + * c-common.c (handle_vector_size_attribute): Disallow VECTOR_TYPE + or UNION_TYPE inner types. + +2006-11-24 Joseph Myers + + * config/rs6000/eabispe.h (TARGET_DEFAULT): Include + MASK_STRICT_ALIGN. + * config/rs6000/linuxspe.h (TARGET_DEFAULT): Likewise. + * config/rs6000/rs6000.c (rs6000_override_options): Use + MASK_STRICT_ALIGN for 8540 and 8548. Add MASK_STRICT_ALIGN to + POWERPC_MASKS. + +2006-11-24 Andreas Krebbel + + * config/s390.c (s390_emit_compare_and_swap): New function. + (s390_expand_cs_hqi, s390_expand_atomic): Call + s390_emit_compare_and_swap. + +2006-11-23 John David Anglin + + * pa.c (return_addr_rtx): Change 0xe0400002 to -532676606. + +2006-11-22 Joseph Myers + + * config/rs6000/spe.md (SPE64): New mode macro. + (mov_sidf_e500_subreg0): Change to mov_si_e500_subreg0. Add + memory load. + (mov_si_e500_subreg0_2): New. + (mov_sidf_e500_subreg4): Change to mov_si_e500_subreg4. Add + memory load. + (mov_si_e500_subreg4_2): New. + * config/rs6000/predicates.md (input_operand): Do not allow + invalid E500 subregs. + (rs6000_nonimmediate_operand): Check for invalid E500 subregs also + if TARGET_SPE. + * config/rs6000/rs6000.c (invalid_e500_subreg): Check for subregs + involving DFmode if TARGET_E500_DOUBLE. Check for subregs + involving vector modes if TARGET_SPE. + +2006-11-20 Anatoly Sokolov + + PR target/18553 + PR target/29449 + * config/avr/avr.h (OBJECT_FORMAT_ELF): Define. + + * config/avr/avr.h (DWARF2_DEBUGGING_INFO): Define. + +2006-11-19 John David Anglin + + PR target/29114 + * pa.c (emit_move_sequence): Don't split constants with PLUS for modes + larger than BITS_PER_WORD. + +2006-11-19 Richard Guenther + + Backport from mainline: + 2006-11-15 Paolo Bonzini + + PR middle-end/29753 + * gimplify.c (fold_indirect_ref_rhs): Use + STRIP_USELESS_TYPE_CONVERSION rather than STRIP_NOPS. + +2006-11-18 John David Anglin + + PR fortran/27885 + PR middle-end/28176 + * stor-layout.c (set_sizetype): Limit precision of *bitsizetypes types + to MAX_FIXED_MODE_SIZE. + +2006-11-18 Aldy Hernandez + + * doc/invoke.texi: Fix mno-isel typo. + +2006-11-18 Joseph Myers + + * config/rs6000/spe.md (movv4hi_internal): Add alternative for + easy vector constant loads. + +2006-11-18 Joseph Myers + + * config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Define. + * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define + __NO_LWSYNC__ if TARGET_NO_LWSYNC. + * config/rs6000/sync.md (lwsync): Emit plain sync if + TARGET_NO_LWSYNC. + +2006-11-17 Jakub Jelinek + + PR middle-end/29584 + * tree-ssa-forwprop.c (simplify_switch_expr): Don't + optimize if DEF doesn't have integral type. + +2006-11-17 Uros Bizjak + + * config/i386/i386.c (ix86_function_sseregparm): Fix comment: + number of arguments passed to local functions in SSE registers is 3. + + * doc/invoke.texi (Function Attributes) [sseregparm]: Correct + number of arguments passed in SSE registers to 3. + +2006-11-16 Eric Botcazou + + PR middle-end/26306 + * gimplify.c (gimplify_expr): Only force a load for references to + non-BLKmode volatile values. + * doc/implement-c.texi (Qualifiers implementation): Document the + interpretation of what a volatile access is. + * doc/extend.texi (C++ Extensions): Rework same documentation. + +2006-11-16 Andrew Pinski + + PR tree-opt/29788 + * fold-const.c (fold_indirect_ref_1): Fold *&CONST_DECL down + to what is the const decl is a place holder for. + +2006-11-16 Maxim Kuvyrkov + + PR target/29201 + * cfgrtl.c (rtl_delete_block): Move the code for getting last insn of + bb to ... + (get_last_bb_insn): ... new global function. + (basic_block.h): Declare it. + * haifa-sched.c (create_recovery_block): Use it. + +2006-11-16 Joseph Myers + + * config/rs6000/spe.md (frob_di_df_2): Handle non-offsettable + memory operand. + +2006-11-15 Steve Ellcey + + * config/ia64/ia64.c (ia64_hpux_init_libfuncs): Use HP-UX millicode + routines for integer division. + +2006-11-15 Steve Ellcey + + PR other/25028 + * config/ia64/t-hpux (LIB1ASMFUNCS): Filter out _fixtfdi, + _fixunstfdi, and _floatditf + +2006-11-15 Jakub Jelinek + + PR tree-optimization/29581 + * lambda-code.c (replace_uses_equiv_to_x_with_y): Add YINIT, + REPLACEMENTS, FIRSTBSI arguments. If initial condition or + type is different between Y and USE, create a temporary + variable, initialize it at the beginning of the body bb + and use it as replacement instead of Y. + +2006-11-15 Richard Guenther + + Backport from mainline: + 2006-11-12 Michael Matz + Roger Sayle + + PR rtl-optimization/29797 + * ifcvt.c (noce_try_bitop): Correct calculation of bitnum on + BITS_BIG_ENDIAN targets. + +2006-11-14 Eric Christopher + + * configure: Regenerate with autoconf 2.59. + +2006-11-13 DJ Delorie + + * config/m32c/m32c.c (m32c_prepare_shift): Use a separate + temporary for intermediates. + +2006-11-13 Jakub Jelinek + + * configure.ac: Add changequote around __LONG_DOUBLE_MATH_OPTIONAL + test. + * configure: Rebuilt. + + * configure.ac (ld_vers): Parse GNU ld version 2.17.50.0.3-6 20060715 + style versions. + * configure: Rebuilt. + +2006-11-13 Andrew Pinski + + PR tree-opt/29439 + * tree-vrp.c (vrp_int_const_binop): Use the correct tree when + checking for overflow. + +2006-11-13 Richard Guenther + + Backport from mainline: + 2006-10-23 Richard Guenther + + PR middle-end/21032 + * convert.c (convert_to_real): Fold (float)-x to -(float)x + only if not flag_rounding_math. + +2006-11-12 Jason Merrill + Andrew Pinski + + PR middle-end/28915 + * gimplify.c (gimplify_init_constructor): Don't reduce TREE_CONSTANT + vector ctors. + * tree-cfg.c (verify_expr): Don't look into TREE_CONSTANT + vector ctors. + * expmed.c (make_tree): Handle CONST, SYMBOL_REF. + * tree.c (build_vector): Handle non-_CST elements. + +2006-11-12 Daniel Berlin + + Fix PR tree-optimization/29587 + * tree-ssa-structalias.c (process_constraint): Don't + mark address taken due only to escaped vars constraint. + +2006-11-12 Jie Zhang + + Revert + 2006-11-11 Jie Zhang + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __bfin__ + and __BFIN__. + + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Use builtin_define_std + instead of builtin_define for bfin and BFIN. + +2006-11-11 Jie Zhang + + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __bfin__ + and __BFIN__. + +2006-11-11 Richard Sandiford + + PR middle-end/27528 + * stmt.c (expand_asm_operands): Use EXPAND_INITIALIZER if the + constraints accept neither registers or memories. + +2006-11-11 Jie Zhang + + * config/bfin/bfin.h (FUNCTION_PROFILER): Don't use LABELNO. + (NO_PROFILE_COUNTERS): Define as 1. + +2006-11-09 Serge Belyshev + + PR middle-end/29726 + * fold-const.c (fold_binary) : Fix typo in variable name. + +2006-11-09 Eric Christopher + + PR bootstrap/26892 + PR bootstrap/27814 + PR other/28994 + * configure: Regenerate. + * configure.ac: Match powerpc*-*-darwin* for powerpc darwin checks. + * config.gcc (powerpc64-*-darwin*): New target. + * config.host: Ditto. + * config/rs6000/darwin64.h: New file. + * config/rs6000/x-darwin64: Ditto. + * config/rs6000/host-ppc64-darwin.c: Ditto. + +2006-11-08 Brooks Moses + + * doc/invoke.texi: Minor formatting fixes in option lists. + +2006-11-08 Eric Christopher + + Backport from mainline: + * config.gcc: Add x86_64-darwin host support. + * config.host: Ditto. + * config/i386/darwin64.h: New file. + * config/i386/t-darwin64: Ditto. + +2006-11-08 Janis Johnson + + * gcc/doc/sourcebuild.texi (Test Directives): Add output-exists + and output-exists-not. + +2006-11-07 Richard Guenther + + PR tree-optimization/29610 + * tree-cfgcleanup.c (cleanup_control_flow): Honor return value + of tree_purge_dead_eh_edges as it may free dominators. + + * g++.dg/other/pr29610.C: New testcase. + +2006-11-07 Jie Zhang + + * gcc.c (process_command): Treat -b as normal switch if its argument + has no dash. + +2006-11-06 Vladimir Prus + + Backport from mainline: + * config/arm/t-strongarm-pe: (TARGET_LIBGCC2_CFLAGS): Do not + set inhibit_libc. + * config/arm/t-strongarm-elf: Likewise. + * config/arm/t-pe: Likewise. + * config/arm/t-arm-elf: Likewise. + * config/arm/t-xscale-elf: Likewise. + * config/arm/t-arm-coff: Likewise. + * config/arm/t-xscale-coff: Likewise. + * config/arm/t-wince-pe: Likewise. + +2006-11-06 Richard Guenther + + Backport from mainline: + 2006-10-21 Richard Guenther + + PR target/19116 + * config/i386/i386.c (override_options): Do not set MASK_IEEE_FP + if flag_unsafe_math_optimizations is specified. We have + flag_finite_math_only for that. + * config/i386/i386.md (sqrtxf2): Do not require TARGET_IEEE_FP + or flag_unsafe_math_optimizations. + + PR middle-end/28796 + * simplify-rtx.c (simplify_const_relational_operation): + Do not constant-fold ORDERED and UNORDERED for + flag_unsafe_math_optimizations but only we do not need to + honor NaNs for the given mode. + +2006-11-05 Jakub Jelinek + + PR middle-end/29695 + * fold-const.c (fold_ternary): Fix A < 0 ? : 0 + simplification. + +2006-11-02 Brooks Moses + + * doc/invoke.texi: Fix mfp-trap-mode typo. + +2006-11-02 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Update GMP/MPFR build + instructions. + (sparc64-sun-solaris2*): Likewise. + +2006-11-02 Uros Bizjak + + PR target/29377 + * config/h8300/h8300.c (h8300_emit_stack_adjustment): Change "size" + argument to HOST_WIDE_INT. Update function prototype. + (round_frame_size): Change return type to HOST_WIDE_INT. Change + "size" argument to HOST_WIDE_INT. Update function prototype. + +2006-11-01 Chris Johns + + PR bootstrap/28400 + * Makefile.in (install-driver): Use exeext when installing + $target-gcc-$version. + +2006-11-01 Andrew Haley + + * fold-const.c (fold_unary): Don't fold (t1)(t2) to (t1) if this + is a Java program. + +2006-11-01 Kaveh R. Ghazi + + * builtins.def (gamma, lgamma): Use ATTR_MATHFN_FPROUNDING_STORE. + +2006-10-31 Eric Botcazou + + PR target/24071 + * gthr-posix.h (__gthread_active_p): New implementation on Solaris. + * gthr-posix95.h (__gthread_active_p): Likewise. + +2006-10-30 Jakub Jelinek + + PR tree-optimization/29637 + * tree.c (make_vector_type): Don't recurse if TYPE_MAIN_VARIANT + of the innertype is the innertype itself. + + * gcc.dg/pr29637.c: New test. + +2006-10-27 Mike Stump + + * config/darwin-c.c (darwin_cpp_builtins): Move __STATIC__ and + __DYNAMIC__ from here back to ... + * config/darwin.h (CPP_SPEC): ... here. + +2006-10-26 Andreas Krebbel + + * config/s390/s390.c (s390_init_frame_layout): Check positive + frame_size. + +2006-10-26 Ben Elliston + + * doc/extend.texi (Variable Attributes): Typo fix. + +2006-10-25 Steve Ellcey + + * config/ia64/hpux.h: Define _INCLUDE__STDC_A1_SOURCE in C++. + Add unix98.o to link line. + +2006-10-25 Richard Sandiford + David Daney + + PR middle-end/29519 + * rtlanal.c (nonzero_address_p): Remove check for values wrapping. + +2006-10-25 Daniel Berlin + + * tree-ssa-structalias.c (intra_create_variable_infos): + Don't recreate nonlocal_all if it already exists. + +2006-10-23 Ulrich Weigand + + * config/s390/predicates.md ("bras_sym_operand"): Do not accept + nonlocal function symbols if flag_pic. + +2006-10-22 Richard Sandiford + + * config/mips/mips.c (mips_split_const): Don't accept bare PLUS + expressions. + +2006-10-20 Mark Mitchell + + * DEV-PHASE: Mark as prerelease. + +2006-10-20 Daniel Berlin + + * tree.h (DECL_PTA_ARTIFICIAL): Remove. + (tree_decl_with_vis): Remove artificial_pta_var flag. + * tree-flow.h (referenced_var_check_and_insert): Expose. + (nonlocal_all): New prototype. + * tree-ssa-structalias.c (nonlocal_for_type): Remove. + (nonlocal_all): Make global. + (nonlocal_lookup): Remove. + (nonlocal_insert): Ditto. + (create_nonlocal_var): Do not call nonlocal_insert. + (get_nonlocal_id_for_type): Remove. + (find_global_initializers): Mark new vars we find for renaming. + (intra_create_variable_infos): Only create one nonlocal. + (expand_nonlocal_solutions): Remove. + (compute_points_to_sets): Don't call it. + (ipa_pta_execute): Ditto. + (init_alias_heapvars): Don't create nonlocal_for_type. + (delete_alias_heapvars): Don't remove it. + * tree-ssa-operands.c (access_can_touch_variable): Don't prune + nonlocal_all. + +2006-10-19 Brooks Moses + + * doc/install.texi (Downloading GCC): Clarify mention of + Fortran in the "full distribution" description. + +2006-10-19 Daniel Berlin + + Fix PR tree-optimization/28778 + Fix PR tree-optimization/29156 + Fix PR tree-optimization/29415 + * tree.h (DECL_PTA_ARTIFICIAL): New macro. + (tree_decl_with_vis): Add artificial_pta_var flag. + * tree-ssa-alias.c (is_escape_site): Remove alias info argument, + pushed into callers. + * tree-ssa-structalias.c (nonlocal_for_type): New variable. + (nonlocal_all): Ditto. + (struct variable_info): Add directly_dereferenced member. + (var_escaped_vars): New variable. + (escaped_vars_tree): Ditto. + (escaped_vars_id): Ditto. + (nonlocal_vars_id): Ditto. + (new_var_info): Set directly_dereferenced. + (graph_size): New variable + (build_constraint_graph): Use graph_size. + (solve_graph): Don't process constraints that cannot change the + solution, don't try to propagate an empty solution to our + successors. + (process_constraint): Set directly_dereferenced. + (could_have_pointers): New function. + (get_constraint_for_component_ref): Don't process STRING_CST. + (nonlocal_lookup): New function. + (nonlocal_insert): Ditto. + (create_nonlocal_var): Ditto. + (get_nonlocal_id_for_type): Ditto. + (get_constraint_for): Allow results vector to be empty in the case + of string constants. + Handle results of calls properly. + (update_alias_info): Update alias info stats on number and type of + calls. + (find_func_aliases): Use could_have_pointers. + (make_constraint_from_escaped): Renamed from + make_constraint_to_anything, and changed to make constraints from + escape variable. + (make_constraint_to_escaped): New function. + (find_global_initializers): Ditto. + (create_variable_info_for): Make constraint from escaped to any + global variable, and from any global variable to the set of + escaped vars. + (intra_create_variable_infos): Deal with escaped instead of + pointing to anything. + (set_uids_in_ptset): Do type pruning on directly dereferenced + variables. + (find_what_p_points_to): Adjust call to set_uids_with_ptset. + (init_base_vars): Fix comment, and initialize escaped_vars. + (need_to_solve): Removed. + (find_escape_constraints): New function. + (expand_nonlocal_solutions): Ditto. + (compute_points_to_sets): Call find_escape_constraints and + expand_nonlocal_solutions. + (delete_points_to_sets): Don't fall off the end of the graph. + (init_alias_heapvars): Initialize nonlocal_for_type and + nonlocal_all. + (delete_alias_heapvars): Free nonlocal_for_type and null out + nonlocal_all. + +2006-10-19 Eric Botcazou + + * fold-const.c (add_double): Rename to add_double_with_sign. + Add 'unsigned_p' parameter and take it into account for the overflow. + (mul_double): Rename to mul_double_with_sign. + Add 'unsigned_p' parameter and take it into account for the overflow. + (fold_div_compare): Call add_double_with_sign instead of add_double + and mul_double_with_sign instead of mul_double, passing them the + unsignedness of the type. + * tree.h (add_double): Macroize. + (add_double_with_sign): New prototype. + (mul_double): Macroize. + (mul_double_with_sign): New prototype. + +2006-10-19 Chen Liqin + + * config/score/crti.asm: New file. + * config/score/crtn.asm: New file. + * config/score/elf.h: New file. + * config/score/mac.md: New file. + * config/score/misc.md: New file. + * config/score/mul-div.S: New file. + * config/score/predicates.md: New file. + * config/score/score7.md: New file. + * config/score/score.c: New file. + * config/score/score-conv.h: New file. + * config/score/score.h: New file. + * config/score/score.md: New file. + * config/score/score-mdaux.c: New file. + * config/score/score-mdaux.h: New file. + * config/score/score-modes.def: New file. + * config/score/score.opt: New file. + * config/score/score-protos.h: New file. + * config/score/score-version.h: New file. + * config/score/t-score-elf: New file. + * config.gcc: Add score*-*-* configurations(Update before). + * doc/invoke.texi (Score Options): New section. + * doc/md.texi (Score family): New section to document constraints. + +2006-10-19 Nick Clifton + + * config/arm/arm.c: Fix spelling typo. + +2006-10-18 Tom Tromey + + * doc/install.texi (Prerequisites): Mention automake 1.9.6. + +2006-10-18 Jan Hubicka + + PR middle-end/29299 + * cfgexpand.c (expand_used_vars_for_block): Vars marked used by user + are used. + +2006-10-18 Marcin Dalecki + + * omp-low.c (expand_parallel_call): Use BSI_SAME_STMT instead of + TSI_SAME_STMT, since that's the desired entity. + +2006-10-17 Wolfgang Gellerich + + * config/s390/contraints.md: New file. + * config/s390/s390-protos.h (s390_mem_constraint, + s390_O_constraint_str, s390_N_constraint_str, + s390_float_const_zero_p): Function prototypes added. + * config/s390/s390.c (s390_extra_constraint_str, + s390_const_double_ok_for_constraint_p, + s390_const_ok_for_constraint_p): Functions removed. + (s390_mem_constraint, s390_O_constraint_str, s390_N_constraint_str, + s390_float_const_zero_p): New functions. + * config/s390/s390.h (REG_CLASS_FROM_LETTER, CONST_OK_FOR_CONSTRAINT_P, + CONST_DOUBLE_OK_FOR_CONSTRAINT_P, EXTRA_CONSTRAINT_STR, + EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT, CONSTRAINT_LEN): + Macro definitions removed. + (s390_const_ok_for_constraint_p, s390_const_double_ok_for_constraint_p, + s390_extra_constraint_str): Functions removed. + +2006-10-17 Andrew Pinsiki + Richard Sandiford + + PR target/29413 + * config/mips/linux.h (SUBTARGET_CC1_SPEC): Override. + * config/mips/mips.h (CC1_SPEC): Override any earlier definition. + +2006-10-16 Geoffrey Keating + + * config/rs6000/sysv4.h (DBX_REGISTER_NUMBER): Move to rs6000.h. + (DWARF2_FRAME_REG_OUT): Likewise. + * config/rs6000/rs6000.h (DBX_REGISTER_NUMBER): Move from sysv4.h. + (DWARF2_FRAME_REG_OUT): Likewise. + +2006-10-17 Paul Brook + + * config/arm/arm.c (arm_rtx_costs_1): Handle multiply-accumulate. + +2006-10-16 Brooks Moses + + * doc/contrib.texi, doc/install.texi, doc/standards.texi: + Standardize on "GNU Fortran" as the official name of the Fortran + compiler. + +2006-10-16 Mike Stump + + * doc/invoke.texi (Darwin Options): Document -mkernel. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Add + -mkernel support. + (C_COMMON_OVERRIDE_OPTIONS): Add -mkernel support. Add + SUBTARGET_C_COMMON_OVERRIDE_OPTIONS callout. + (CC1_SPEC): Don't turn on -fPIC when -mkernel is given. + (OS_MISSING_ALTIVEC): Add. + * config/i386/i386.c (override_options): Add + SUBSUBTARGET_OVERRIDE_OPTIONS callout. + * config/i386/darwin.h (CC1_SPEC): Don't turn on -fPIC when + -mkernel, -static or -mdynamic-no-pic is given. + (C_COMMON_OVERRIDE_OPTIONS): Add. + * config/darwin.opt (fapple-kext): Add. + (mkernel): Add. + * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add + -fapple-kext, -findirect-virtual-calls, -fterminated-vtables and + -mkernel support. + (SUBSUBTARGET_OVERRIDE_OPTIONS): Add. + (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): Add. + (CPP_SPEC): Move defines for __DYNAMIC__ and __STATIC__ from here... + (SUBTARGET_ATTRIBUTE_TABLE): Add apple_kext_compatibility. + (TARGET_CXX_CDTOR_RETURNS_THIS): Add. + (flag_mkernel): Add. + (flag_apple_kext): Add. + (TARGET_KEXTABI): Add. + * config/darwin.c (darwin_handle_kext_attribute): Add. + (DARWIN_VTABLE_P): Add. + (darwin_binds_local_p): Add partial support for rebinding vtables + in kexts. + (darwin_kextabi_p): Add. + (darwin_override_options): Add. + * config/darwin-protos.h (darwin_handle_kext_attribute): Add. + (darwin_kextabi_p): Add. + (darwin_override_options): Add. + * config/darwin-c.c (darwin_cpp_builtins): ... move defines for + __DYNAMIC__ and __STATIC__ here. + +2006-10-16 Brooks Moses + + * doc/sourcebuild.texi, doc/makefile.texi, doc/install.texi: + Added mention of "make pdf" target, and Texinfo requirements for + same. + +2006-10-16 DJ Delorie + + * config/s390/s390.c (s390_decompose_address): Allow symbol+offset + into the GOT in case we need a subreg of the address. + +2006-10-16 Richard Guenther + + PR target/25519 + * doc/extend.texi (X86 Built-in Functions): Fix typos in + SSE builtin documentation. Document SSE2 builtins. + +2006-10-15 John David Anglin + + * pa64-hpux.h (LINK_SPEC): Force __cxa_finalize to be an undefined + symbol in the output file for non-shared links when -nostdlib or + -nodefaultlibs isn't specified. + + * config.gcc (hppa*64*-*-hpux11*, hppa[12]*-*-hpux11*): Default to + posix thread support. + +2006-10-15 Jan Hubicka + + PR middle-end/29241 + * cgraphunit.c (cgraph_preserve_function_body_p): Preserve functions + declared always_inline even when not inlining. + +2006-10-15 Eric Botcazou + John David Anglin + Andrew Pinski + + PR middle-end/29111 + * builtins.c (get_pointer_alignment): Return 0 if TER is not run. + +2006-10-15 Jan Hubicka + Richard Guenther + + PR middle-end/29299 + * cgraphunit.c (cgraph_finalize_compilation_unit): Call + process_function_and_variable_attributes on all variables, including + those discovered during cgraph construction phase. + +2006-10-15 Bernhard Fischer + + * final.c: Update Copyright year. Commentary typo fix. Fix whitespace + +2006-10-14 Uros Bizjak + + * config/i386/athlon.md (athlon_fist): Add fisttp. + +2006-10-13 David Edelsohn + Ian Lance Taylor + + PR middle-end/29250 + * expr.c (expand_expr_real_1) : Change EXPAND_SUM modifier to EXPAND_NORMAL when + recursing. + +2006-10-14 Kazu Hirata + + * config/score/score.c, config/score/score.h: Fix comment + typos. + +2006-10-13 Kaveh R. Ghazi + + PR bootstrap/29402 + * Makefile.in (ALL_GTFILES_H): Use $(sort ...) instead of + shell pipeline. + +2006-10-13 Eric Christopher + + * config/darwin.h (HANDLE_PRAGMA_PACK_PUSH_POP): Define. + +2006-10-13 Carlos O'Donell + + Revert this change: + 2006-10-13 Carlos O'Donell + * config/elfos.h (MAX_OFILE_ALIGNMENT): Default to largest + alignment supported by 32-bit ELF. + +2006-10-13 Eric Christopher + + * config/darwin.c (darwin_emit_unwind_label): Strip + name encoding. Use DECL_ASSEMBLER_NAME_SET_P. + +2006-10-13 Richard Guenther + + PR tree-optimization/29446 + * tree-vrp.c (fix_equivalence_set): Remove. + (extract_range_from_assert): Do not call fix_equivalence_set. + (debug_value_range): Print a newline. + (compare_name_with_value): For equivalence sets with + inconsistent value ranges conservatively bail out. + (compare_names): Likewise. + +2006-10-13 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Add comment about 32-bit GMP + and MPFR for gfortran. + +2006-10-13 Carlos O'Donell + + * config/elfos.h (MAX_OFILE_ALIGNMENT): Default to largest + alignment supported by 32-bit ELF. + +2006-10-13 Paolo Bonzini + + PR c/29092 + + * c-typeck.c (digest_init): Always allow initializing vectors + that have static storage duration with compound literals. + * tree.c (build_type_attribute_qual_variant): New, based on + build_type_attribute_variant. + (build_type_attribute_variant): Rewrite using the former. + (make_vector_type): Use build_type_attribute_qual_variant to build + type variants. Use type_hash_canon on the others. + +2006-10-13 Daniel Berlin + Ramana Radhakrishnan + + * tree-flow-inline.h (zero_ssa_operands): Fix comment. + +2006-10-12 Jan Hubicka + + PR c/28419 + * c-decl.c (c_make_fname_decl): Do not segfault in case where + current_function_decl is set but current_function_scope is not. + +2006-10-12 Jie Zhang + + * config/bfin/bfin.md (eh_return): Call emit_jump_insn instead of + emit_insn to emit eh_return_internal instruction. + (eh_return_internal): Explicitly set pc. + +2006-10-11 Richard Guenther + + PR tree-optimization/28230 + * tree-vrp.c (vrp_int_const_binop): Move flag_wrapv handling + to the correct place. + +2006-10-11 Richard Guenther + + PR inline-asm/29119 + * gimplify.c (gimplify_asm_expr): Mark the gimplified lvalue + addressable. + +2006-10-10 Brooks Moses + + * configure.ac: Added pdf to "Make-hooks" + * Makefile.in: Added TEXI2PDF definition, and various pdf-file + targets and *.pdf file patterns in cleanup targets. + * configure: Regenerated. + +2006-10-10 Anatoly Sokolov + + * config/avr/predicates.md: New file. + * config/avr/avr.md: Include it. + (REG_SP): New constant. + (peepholes): Use predicates. + (sbrx_branch, sbrx_and_branchhi, sbrx_and_branchsi, branch, rvbranch, + difficult_branch, difficult_rvbranch, cbi, sbi, sbix_branch, + sbix_branch_bit7, sbix_branch_tmp, sbix_branch_tmp_bit7): Ditto. + +2006-10-10 Adam Nemet + + * config/mips/mips.c (mips_save_restore_reg): Use gen_frame_mem to + avoid alias set 0. + +2006-10-10 Jakub Jelinek + + PR middle-end/29272 + * builtins.c (var_decl_component_p): New function. + (fold_builtin_memset, fold_builtin_memory_op): Restrict + single entry optimization to variables and components thereof. + +2006-10-10 Richard Guenther + + PR rtl-optimization/29323 + * except.c (set_nothrow_function_flags): For functions + that do not bind local bail out early. + +2006-10-10 Ben Elliston + + * doc/invoke.texi (RS/6000 and PowerPC Options): Add -m to the + -mdlmzb option. + +2006-10-09 Richard Henderson + + Revert emutls patch. + +2006-10-09 Richard Guenther + + PR middle-end/29254 + * cgraphunit.c (verify_cgraph_node): Bail out on earlier + errors. + +2006-10-09 Steve Ellcey + + PR target/27880 + * unwind-c.c (PERSONALITY_FUNCTION): Ifdef use of _Unwind_GetIPInfo. + * configure.ac (HAVE_GETIPINFO): Check for _Unwind_GetIPInfo. + * configure: Regenerate. + * config.in: Regenerate. + +2006-10-09 Aldy Hernandez + + * tree-mudflap.c (mf_xform_derefs_1): Add parentheses around TREE_TYPE. + +2006-10-08 Richard Sandiford + + * config/mips/mips.c (mips_legitimize_tls_address): Implement + all TLS models in the same way as local exec if !TARGET_ABICALLS. + Remove stray newline. + +2006-10-08 Richard Sandiford + + * config/mips/mips.c (mips_classify_symbol): Do not return + SYMBOL_SMALL_DATA if SYMBOL_REF_WEAK. + (mips_in_small_data_p): Tweak comments. + +2006-10-08 Richard Sandiford + + * config/mips/elf.h (HANDLE_PRAGMA_PUSH_POP): Define. + +2006-10-07 Kazu Hirata + + * gimplify.c, sched-int.h: Fix comment typos. + + * sched-int.h: Fix comment typos. + +2006-10-06 Maxim Kuvyrkov + + * sched-int.h (IS_SPECULATION_CHECK_P, IS_SPECULATION_SIMPLE_CHECK_P): + New macros. + * sched-ebb.c (begin_schedule_ready): Use them. + * haifa-sched.c (schedule_insn, move_insn, try_ready, + add_to_speculative_block, create_check_block_twin, speculate_insn, + fix_jump_move, move_block_after_check): Ditto. + * sched-rgn.c (new_ready): Ditto. + +2006-10-06 Maxim Kuvyrkov + + PR rtl-optimization/29128 + * sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro. + * sched-ebb.c (advance_target_bb): Use it to fix condition to + allow interblock movement of speculation checks. + +2006-10-06 Zdenek Dvorak + + PR middle-end/29256 + * tree-ssa-loop-ivopts.c (determine_base_object): Handle pointers + casted to integer type. + (get_address_cost): Decrease cost of [symbol + index] addressing modes + if they are significantly more expensive than [reg + index] ones. + +2006-10-06 Jakub Jelinek + + PR tree-optimization/29330 + * tree-data-ref.c (free_data_ref): Use DR_FREE_ACCESS_FNS macro. + (initialize_data_dependence_relation): Clear DDR_LOOP_NEST pointer + on newly allocated ddrs. + (find_loop_nest_1, find_loop_nest): Change LOOP_NEST to a pointer + to VEC (loop_p, heap) pointer. + (compute_data_dependences_for_loop): Adjust caller. + (free_dependence_relations): Free DDR_LOOP_NEST. + + * tree-loop-linear.c (linear_transform_loops): Don't forget to + free DEPENDENCE_RELATIONS and DATAREFS. + + PR target/28924 + * builtins.c (expand_builtin_sync_operation, + expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set): + Use convert_to_mode to handle promoted arguments. + +2006-10-06 J"orn Rennecke + + * print-tree.c (print_node_brief, print_node): Print sign of Inf. + +2006-10-06 J"orn Rennecke + + * config/sh/sh.h (LIBGCC2_DOUBLE_TYPE_SIZE): Define. + +2006-10-05 Uros Bizjak + + * config/i386/sync.md ("sync_add", "sync_sub", + "sync_ior", "sync_and", "sync_xor"): + Use instead of "r" as operand 1 constraint. + +2006-10-06 Olivier Hainque + + * gimplify.c (gimplify_type_sizes) [POINTER_TYPE, REFERENCE_TYPE]: + Don't recurse on the pointed-to type. + * c-decl.c (grokdeclarator) [cdk_pointer]: If we are in a NORMAL or + DECL context, attach an artificial TYPE_DECL to anonymous pointed-to + types with components of variable size. + +2006-10-06 Danny Smith + + config/i386/mingw32.h (GOMP_SELF_SPECS): Add -mthreads for openmp. + +2006-10-06 Jakub Jelinek + + PR tree-optimization/29290 + * tree-loop-linear.c (linear_transform_loops): Bail if loop_nest has + multiple exits. + + PR target/29198 + * config/i386/i386.c (legitimize_pic_address): Reject TLS symbols. + * config/i386/predicates.md (local_symbolic_operand): Likewise. + + PR c/29091 + * varasm.c (output_constant): If TREE_VECTOR_CST_ELTS chain is shorter than + the number of vector elements fill the rest with zeros. + +2006-10-05 Richard Sandiford + + * config/mips/mips.c (mips_pass_by_reference): Do not return false + for EABI if type is NULL. Use a size check based on GET_MODE_SIZE + instead. + +2006-10-05 Bernd Schmidt + + * config/bfin/bfin.md (subsi3): Lose expander, change previously + unnamed pattern into subsi3. Use correct constraints/predicates. + * config/bfin/bfin.h (CONST_OK_FOR_K): Handle "KN7". + * config/bfin/predicates.md (reg_or_neg7bit_operand_p): New. + +2006-10-05 Ira Rosen + + * doc/loop.texi: Add data references analysis description. + +2006-10-04 Brooks Moses + + * doc/gcov.texi: Add formatting to "Invoking gcov" section head. + +2006-10-04 Richard Henderson + Jakub Jelinek + + * Makefile.in (libgcc.mk, LIBGCC_DEPS): Add emutls.c. + * builtin-types.def (BT_WORD): Make unsigned. + (BT_FN_VOID_PTR_WORD_WORD_PTR): New. + * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New. + (BUILT_IN_EMUTLS_REGISTER_COMMON): New. + * c-decl.c (grokdeclarator): Don't error if !have_tls. + * c-parser.c (c_parser_omp_threadprivate): Likewise. + * cgraph.c (decide_is_variable_needed): Look at force_output. + Recurse for emulated tls. + * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Remove + checks redundant with decide_is_variable_needed. + (cgraph_build_static_cdtor): Do cgraph_varpool_assemble_pending_decls. + * dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for + emulated tls. + * expr.c (emutls_var_address): New. + (expand_expr_real_1): Expand emulated tls. + (expand_expr_addr_expr_1): Likewise. + * libgcc-std.ver: Add __emutls_get_address, __emutls_register_common. + * output.h (emutls_finish): Declare. + * toplev.c (compile_file): Call it. + * tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the + address before wrapping in CONST. + * varasm.c (emutls_htab, emutls_object_type): New. + (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New. + (get_emutls_object_name, get_emutls_object_type): New. + (get_emutls_init_templ_addr, emutls_decl): New. + (emutls_common_1, emutls_finish): New. + (assemble_variable): When emulating tls, swap decls; generate + constructor for the emutls objects. + (do_assemble_alias): When emulating tls, swap decl and target name. + (default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT + for emulated tls. + * emutls.c: New file. + * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit + tls_object for real tls. + +2006-10-04 Zack Weinberg + + Fix bug in constraint-check generator, reported by Rask Ingemann + Lambertsen: + * genpreds.c (add_constraint): Don't remove anything from the + expression here. + (write_tm_constrs_h): Detect whether "op" argument is used, and + mark it ARG_UNUSED if it isn't. + (write_insn_const_int_ok_for_constraint): Skip the part of the + expression that would test whether "op" (which is not available + here) is a CONST_INT. + +2006-10-04 Ryan Mansfield + + PR c++/28448 + * doc/invoke.texi (fdiagnostics-show-option): Fix typos. + +2006-10-03 Geoffrey Keating + + * config/i386/darwin-libgcc.10.5.ver: Update to symbol list for + current Leopard versions. + * config/rs6000/darwin-libgcc.10.5.ver: Likewise. + +2006-10-03 Kazu Hirata + + * doc/install.texi: Fix typos. + +2006-10-03 Eric Botcazou + + * builtins.c (expand_builtin_return_addr): Deal with FRAME_ADDR_RTX. + * doc/tm.texi (Basic Stack Layout): Document FRAME_ADDR_RTX. + * config/sparc/sparc.h (FRAME_ADDR_RTX): Define. + +2006-10-02 Jack Howarth + + * unwind-dw2-fde-darwin.c (getsectdatafromheader_64): Fix first + arg to be struct mach_header_64* instead. + +2006-10-02 Jakub Jelinek + + PR c/29154 + * gimplify.c (gimplify_self_mod_expr): Run inner expression's post + side effects after the outer expression's post side effects. + +2006-10-01 Sandra Loosemore + + * tree.h (DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): Fix + comments to reflect actual behavior and relationship between + DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET, and DECL_OFFSET_ALIGN. + + * doc/c-tree.texi (Working with declarations): Fix documentation + of FIELD_DECL likewise. + +2006-10-01 Ryan Mansfield + + PR c/20533 + * doc/extend.texi: Add used variable attribute description. + +2006-09-30 Joseph S. Myers + + PR c/24010 + * c.opt (Woverride-init): New. + * c-opts.c (c_common_post_options): Default warn_override_init to + extra_warnings. + * c-typeck.c (add_pending_init, output_init_element): Warn for + overriding initializers without side effects. + * doc/invoke.texi (-Woverride-init): Document. + (-Wextra): Update. + +2006-09-30 Eric Botcazou + + PR rtl-optimization/28096 + * ifcvt.c (check_cond_move_block): Return FALSE if the source of an + assignment has already been used as a destination earlier in the block. + +2006-09-29 Eric Botcazou + + * builtins.c (expand_builtin_setjmp): Delete. + (expand_builtin) : Mark as unreachable. + : New case. + : Likewise. + : Likewise. + * builtins.def (BUILT_IN_SETJMP_SETUP): New built-in stub. + (BUILT_IN_SETJMP_DISPATCHER): Likewise. + (BUILT_IN_SETJMP_RECEIVER): Likewise. + * gimple-low.c (struct lower_data): New field calls_builtin_setjmp. + (lower_function_body): Initialize it to false. If it is set to true + at the end of the processing, emit the setjmp dispatcher. + (lower_stmt) : Invoke lower_builtin_setjmp if the callee + is __builtin_setjmp and set calls_builtin_setjmp to true as well. + : Fall through to above case if there is a CALL_EXPR + on the rhs of the assignment. + (lower_builtin_setjmp): New function. + * tree.c (build_common_builtin_nodes): Build BUILT_IN_SETJMP_SETUP, + BUILT_IN_SETJMP_DISPATCHER and BUILT_IN_SETJMP_RECEIVER nodes. + * tree-cfg.c (make_exit_edges) : Use specific predicate + to detect calls that can go to non-local labels. Use specific + helper to create the abnormal edges associated with them. + : Likewise. + (make_abnormal_goto_edges): New function extracted from... + (make_goto_expr_edges): ...here. Call it for computed gotos. + (simple_goto_p): Minor tweak. + (tree_can_make_abnormal_goto): New predicate. + (tree_redirect_edge_and_branch): Return zero on all abnormal edges. + (tree_purge_dead_abnormal_call_edges): New function. + * tree-flow.h (tree_can_make_abnormal_goto): Declare. + (tree_purge_dead_abnormal_call_edges): Likewise. + (make_abnormal_goto_edges): Likewise. + * tree-inline.c (expand_call_inline): Simplify statement frobbing. + Purge all dead abnormal edges if the call was in the last statement. + * tree-optimize.c (has_abnormal_outgoing_edge_p): New predicate. + (execute_fixup_cfg): If there are non-local labels in the function, + scan the basic blocks and split them at calls that can go to non-local + labels or add missing abnormal call edges. Write down the CFG in the + dump file. + (pass_fixup_cfg): Remove TODO_dump_func flag. + * unwind-sjlj.c: Poison setjmp. + * doc/install.texi (enable-sjlj-exceptions): Use more general wording. + * doc/tm.texi (DWARF2_UNWIND_INFO): Likewise. + (TARGET_UNWIND_TABLES_DEFAULT): Fix typo. + (DONT_USE_BUILTIN_SETJMP): Document it. + +2006-09-28 Geoffrey Keating + + PR target/28617 + * config/rs6000/rs6000.h [IN_LIBGCC2] (TARGET_POWERPC64): Define + to 1 when __ppc64__ is defined. + * config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Add ppc64-fp.c and + darwin-64.c. + * config/rs6000/ppc64-fp.c: Also compile when __ppc64__ is defined. + +2006-09-28 Steve Ellcey + + * config/ia64/t-hpux (LIB2FUNCS_EXTRA): Remove unwind-hpux.c. + * config/ia64/unwind-hpux.c: Delete. + +2006-09-28 Eric Botcazou + + * gimplify.c (gimplify_init_ctor_preeval): Call maybe_with_size_expr + on the element before gimplifying it, instead of punting if it is of + variable size. + +2006-09-28 Zdenek Dvorak + + * doc/loop.texi: New file. + * doc/gccint.texi: Reference loop.texi. + * Makefile.in (loop.texi): Add. + +2006-09-27 Geoffrey Keating + + * config/darwin.h (ENABLE_EXECUTE_STACK): New, use getpagesize not + __sysctl. + * config/rs6000/darwin.h (ENABLE_EXECUTE_STACK): Remove. + * config/i386/darwin.h (ENABLE_EXECUTE_STACK): Remove. + +2006-09-28 Kaz Kojima + + * config/sh/sh.md (divsi_inv_m0): Remove unused variable. + +2006-09-27 Steven G. Kargl + + * doc/install.texi: Document required versions of GMP and MPFR. + +2006-09-27 Paul Brook + + PR target/29230 + * config/arm/arm.md (arith_adjacentmem): Handle large offsets. + +2006-09-27 Richard Sandiford + + * reload1.c (alter_reg): Require the alignment of the stack slot to + be at least reg_max_ref_width bytes. + (scan_paradoxical_subregs): Record the largest width in + reg_max_ref_width. + +2006-09-26 Jakub Jelinek + + PR middle-end/25261 + PR middle-end/28790 + * tree-nested.c (struct nesting_info): Added static_chain_added. + (convert_call_expr): Set static_chain_added when adding static + chain. Handle OMP_PARALLEL and OMP_SECTION. + +2006-09-25 Matthias Klose + + * doc/invoke.texi: Add missing full stop. + +2006-09-25 Richard Henderson + + * cgraph.c (dump_cgraph_varpool_node): Don't crash if called + before cgraph_function_flags_ready. + +2006-09-24 Zdenek Dvorak + Adam Nemet + + * tree-ssa-loop-ivopts.c (aff_combination_convert, + determine_common_wider_type): New functions. + (get_computation_aff): Use them to simplify arithmetic between + UBASE and CBASE if they are shortened from the same type. + +2006-09-24 Kazu Hirata + + PR target/28911 + * config/m68k/m68k.md (negsf2, negdf2, negxf2): Use + -2147483647 - 1 instead of 0x80000000. + +2006-09-23 Revital1 Eres + + * flags.h (HONOR_NANS): Fix typo in comment. + +2006-09-23 Uros Bizjak + + * config/i386/driver-i386.c (host_detect_local_cpu): Add prototype. + +2006-09-23 Jakub Jelinek + + PR c/28706 + PR c/28712 + * tree.c (merge_attributes, attribute_list_contained): If both + TREE_VALUEs are TREE_LISTs, use simple_cst_list_equal instead of + simple_cst_equal. + * c-typeck.c (comptypes_internal): Don't consider aggregates + in different TUs as compatible if there one set of attributes is + not a subset of the other type's attributes. + (composite_type): Try harder not to create a new aggregate type. + +2006-09-22 Geoffrey Keating + + * config/i386/driver-i386.c: Always define host_detect_local_cpu. + * config/i386/i386.h: Define EXTRA_SPEC_FUNCTIONS on any i386 + or x86_64 host. Define HAVE_LOCAL_CPU_DETECT. + (CC1_CPU_SPEC): Make conditional on HAVE_LOCAL_CPU_DETECT rather + than replicating condition above. + * config.host (i[34567]86-*-*): Always use driver-i386.o. + + * config/darwin.h (LINK_SYSROOT_SPEC): New. + (LINK_SPEC): If TARGET_SYSTEM_ROOT is defined, pass it to + the linker by default. + +2006-09-22 Mike Stump + + * config/rs6000/darwin.h (PROFILE_HOOK): Reassociate comment with + code. + +2006-09-22 Richard Guenther + + PR middle-end/28964 + * cfgexpand.c (stack_var_size_cmp): Use DECL_UID to make + sort of stack variables stable. + +2006-09-22 Peter Bergner + + PR middle-end/28690 + * explow.c (force_reg): Set REG_POINTER flag according to + MEM_POINTER flag. + +2006-09-22 Zdenek Dvorak + + PR tree-optimization/28888 + * tree-if-conv.c (combine_blocks): Rewritten. + * tree-cfg.c (tree_verify_flow_info): Check that edges with + EDGE_TRUE/FALSE_VALUE follow COND_EXPR. + +2006-09-22 Jakub Jelinek + + * tree-ssa-propagate.c (set_rhs): Copy EXPR_LOCATION if + needed. + +2006-09-21 Richard Sandiford + + * varasm.c (copy_constant): Fix reversed gcc_assert check. + +2006-09-21 Janis Johnson + + * ginclude/decfloat.h (DEC*_DEN): Define using the correct builtins. + +2006-09-21 Roger Sayle + + PR debug/29132 + * dwarf2out.c (dwarf2out_begin_prologue): Initialise the current label, + dw_fde_current_label, to be the start of the function, i.e. the same + value as dw_fde_begin. + +2006-09-20 Richard Sandiford + + * config/mips/mips.c (CODE_FOR_mips_abs_ps): Delete. + * config/mips/mips.md (UNSPEC_ABS_PS): New constant. + (UNSPEC_RSQRT1, UNSPEC_RSQRT2, UNSPEC_RECIP1, UNSPEC_RECIP2) + (UNSPEC_SINGLE_CC, UNSPEC_SCC): Bump values by 1. + (*nmadd, *nmadd_fastmath): Require !HONOR_NANS. + (*nmsub, *nmsub_fastmath): Likewise. + (abs2, neg2): Likewise. + * config/mips/mips-ps-3d.md (mips_abs_ps): New define_expand. + (*mips_abs_ps): New define_insn. + +2006-09-20 Josh Conner + + PR middle-end/25505 + * calls.c (expand_call): Allow reuse of structure return stack + temp. + +2006-09-20 Paul Brook + + * config/arm/unwind-arm.c (selfrel_offset31): Clear top bit for + positive offsets. + +2006-09-20 Janis Johnson + + * doc/extend.texi (Decimal Float): Update for latest draft TR, + clean up terminology. + +2006-09-20 Steve Ellcey + + PR target/28574 + * ifcvt.c (dead_or_predicable): Don't predicate then blocks + with tablejumps in them. + +2006-09-20 Jakub Jelinek + + PR middle-end/28046 + * c-omp.c (c_finish_omp_atomic): If ADDR is not simple enough, + wrap it into TARGET_EXPR. + +2006-09-20 Eric Christopher + + * config/i386/i386.c (x86_fisttp): Remove. + * config/i386/i386.h (x86_fisttp): Ditto. + (TARGET_FISTTP): Ditto. + +2006-09-19 Eric Christopher + + * doc/tm.texi (OBJC_JBLEN): Describe. + * config/i386/darwin.h (OBJC_JBLEN): Define. + * config/rs6000/darwin.h: Ditto. + +2006-09-19 Steven Bosscher + + PR rtl-optimization/21299 + * reload1.c (reload): Purge invalid ASMs in the final pass. + +2006-09-19 Steve Ellcey + + PR 28490 + * config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function + pointers as legitimate constants. + +2006-09-19 Paul Brook + + PR target/28516 + * config/arm/arm.c (arm_unwind_emit_set): Handle reg = sp + const. + +2006-09-17 Zdenek Dvorak + + PR tree-optimization/28887 + * tree-ssa-loop-prefetch.c (analyze_ref): Strip nonaddressable + component parts from the reference. + (gather_memory_references_ref): Record the reference without the + nonaddressable component parts. + +2006-09-17 Steven Bosscher + + PR c/25993 + * c-opts.c (c_common_handle_option): Ignore the -std options + if the input language is assembly. + +2006-09-17 Ira Rosen + + PR tree-opt/21591 + * tree-data-ref.c (ptr_decl_may_alias_p): Look for the name memory + tag first. + (ptr_ptr_may_alias_p): Likewise. + (record_record_differ_p): New function. + (base_object_differ_p): Call record_record_differ_p. + +2006-09-16 Andrew Pinski + + PR tree-opt/29059 + * tree-ssa-propagate.c (set_rhs): Reject MODIFY_EXPR right + away for the expr argument. + +2006-09-16 Steven Bosscher + + PR tree-opt/27742 + * tree-vectorizer.c (vectorize_loops): Clear vect_loop_location + before using it for dumping after vectorizing loops. + +2006-09-16 Andrew Pinski + Jack Howarth + + PR target/29030 + * config/rs6000/rs6000.c (rs6000_darwin64_record_arg_advance_recurse) + skip on error_mark_node. + (rs6000_darwin64_record_arg_recurse): Likewise. + +2006-09-16 Steven Bosscher + + * rtl.h (LABEL_OUTSIDE_LOOP_P): Remove. + * doc/rtl.texi: Remove related documentation. + +2006-09-16 Bernd Schmidt + + * loop-doloop.c (doloop_optimize): Remove bogus arg from debugging + printf. + +2006-09-15 Jim Wilson + + * config/ia64/ia64.c (ia64_legitimate_constant_p, cast CONST): + Handle symbol offsets same as they are handled in ia64_expand_move + and move_operand. + +2006-09-16 Andreas Tobler + + * loop-doloop.c (doloop_optimize): Change type of max_cost to int. + Add forgotten parameter to the fprintf call. + +2006-09-15 Steve Ellcey + + * config/ia64/hpux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Add define. + +2006-09-15 Uros Bizjak + + * doc/contrib.texi: Add my entry. + +2006-09-15 Nick Clifton + + * doc/md.texi (Processor pipeline description): Fix typo in + example of how to use the absence_set directive and reword the + description to make it slightly easier to read. + +2006-09-15 Bernd Schmidt + + * params.def (PARAM_MAX_ITERATIONS_COMPUTATION_COST): New. + * loop-doloop.c (doloop_optimize): Use it to limit costs of + expanding the number of iterations. + * config/bfin/bfin.c (bfin_rtx_costs): Handle UDIV, UMOD. + + * cfgrtl.c (emit_insn_at_entry): New function. + * rtl.h (emit_insn_at_entry): Declare it. + * integrate.c (emit_initial_value_sets): Use it. + + * cfgrtl.c (emit_insn_at_entry): Use gcc_assert, not abort. + + * config/bfin/bfin.c (struct loop_info): New members block_bitmap and + bad. + (struct loop_work and related VEC declarations): Delete. + (bfin_dump_loops): Print out new member bad. + (bfin_bb_in_loop): Use plain bitmap test. Don't recurse. + (bfin_scan_loop): Don't recurse. + (bfin_optimize_loop): Don't use a loop depth of -1 to indicate bad + loops. No longer need to update outer loops if the current one is + found bad. Move some validitiy checks to bfin_discover_loop. + (bfin_discover_loop): New function, mostly split from bfin_reorg_loops, + but changed not to check for nesting. Also changed to use the new bad + flag. + (bfin_reorg_loops): Use bfin_discover_loop to find single loops one at a + time. Use bitmap based test to discover loop nesting. + +2006-09-15 Kazu Hirata + + * doc/tm.texi (TARGET_FUNCTION_VALUE): Put @deftypefn all in + one line. + +2006-09-14 Richard Guenther + Kazu Hirata + + PR middle-end/28884. + * doc/tm.texi (TARGET_FUNCTION_VALUE): Document. + (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE): Deprecate. + Replace mentions of FUNCTION_VALUE and FUNCTION_OUTGOING_VALUE + with TARGET_FUNCTION_VALUE. + +2006-09-14 Anatoly Sokolov + + PR target/26504 + * config/avr/avr.h (FRAME_POINTER_CFA_OFFSET): Define. + +2006-09-13 Aldy Hernandez + + * doc/tree-ssa.texi (Jumps): RESULT_DECL can also be an operand + of a RETURN_EXPR + +2006-09-13 Andrew Pinski + + PR debug/28980 + * dwarf2out.c (loc_descriptor_from_tree_1): Handle + FUNCTION_DECL. + +2006-09-13 Andreas Krebbel + + * basic_block.h (bb_has_eh_pred): Fix comment. + +2006-09-13 Andreas Krebbel + + * flow.c (calculate_global_regs_live): Invalidate eh registers + on eh edges. Renamed invalidated_by_call to invalidated_by_eh_edge. + (propagate_block): Handle eh registers as if they were set at basic + block start. + * except.c (dw2_build_landing_pads): Don't emit clobbers for eh + registers. + * global.c (global_conflicts): Make eh registers to conflict with + pseudos live at basic block begin. + * basic_block.h (bb_has_eh_pred): New function. + +2006-09-13 Richard Sandiford + + PR rtl-optimization/28982 + * reload.c (find_reloads_address_1): Use RELOAD_OTHER for the + index of a PRE_MODIFY or POST_MODIFY address. + * reload1.c (inc_for_reload): Use find_replacement on the original + base and index registers. + +2006-09-12 H.J. Lu + + * doc/invoke.texi (mpreferred-stack-boundary): Remove exception + for -Os. Update __m128 alignment requirement. + +2006-09-13 Jan Hubicka + + * cfganal.c (compute_dominance_frontiers_1): Don't be quadratic. + +2006-09-12 Eric Botcazou + + PR rtl-optimization/28243 + * combine.c (distribute_notes) : Do not consider SETs past + the insn to which the note was originally attached. + +2006-09-12 Andrew Pinski + Roger Sayle + + * dwarf2out.c (file_table_last_lookup): Move this GC'd declaration + outside of #ifdef DWARF2_DEBUGGING_INFO to fix bootstrap failure + on platforms that don't use dwarf for debug info. + +2006-09-12 Jason Merrill + + PR middle-end/28493 + * builtins.c (expand_builtin_setjmp_receiver): Clobber + hard_frame_pointer_rtx after using it to update the frame pointer. + +2006-09-12 Roger Sayle + + * target-def.h (TARGET_ASM_OPEN_PAREN): Guard with an #ifndef. + (TARGET_ASM_CLOSE_PAREN): Likewise. + * config/alpha/osf5.h (TARGET_ASM_OPEN_PAREN): Define. + (TARGET_ASM_CLOSE_PAREN): Likewise. + +2006-09-12 Roger Sayle + + PR target/22223 + * config/alpha/alpha.c (alpha_start_function): Don't emit stack + frame information for frames larger than 512 Kbytes on Tru64 when + using the native assembler. + +2006-09-12 Roger Sayle + + PR middle-end/4520 + PR bootstrap/28784 + * cselib.c (cselib_hash_rtx): Avoid hashing on the address of labels + and symbols. Instead use the implementation from cse.c's hash_rtx. + +2006-09-12 Jan Hubicka + + PR rtl-optimization/28071 + * tree-vect-transform.c (vect_create_data_ref_ptr): Kill cast. + (vect_transform_loop): Likewise. + * tree-vectorizer.c (new_loop_vec_info): Likewise. + (new_loop_vec_info): Likewise. + (destroy_loop_vec_info): Likewise. + * tree-dfa.c (create_var_ann): Use GCC_CNEW. + (create_stmt_ann): Likewise. + (create_tree_ann): Rename to ... + (create_tree_common_ann): ... this one; allocate only the common part + of annotations. + * tree-vn.c (set_value_handle): Use get_tree_common_ann. + (get_value_handle): Likewise. + * tree-ssa-pre.c (phi_translate): Delay annotation allocation for + get_tree_common_ann. + * tree-vectorizer.h (set_stmt_info): Take stmt annotation. + (vinfo_for_stmt): Use stmt annotations. + * tree-flow.h (tree_ann_common_t): New type. + (tree_common_ann, get_tree_common_ann, create_tree_common_ann): New. + (tree_ann, get_tree_ann, create_tree_ann): New. + * tree-flow-inline.h (get_function_ann): Do more type checking. + (stmt_ann): Likewise. + (tree_ann): Rename to ... + (tree_common_ann): ... this one; return ony common_ann + (get_tree_ann): Rename to ... + (tree_common_ann): This one; return only common_ann. + * tree-vect-patterns.c (vect_pattern_recog_1): Update call + of set_stmt_info. + +2006-09-11 Geoffrey Keating + + * config.gcc (i[34567]86-*-darwin*): Set with_arch and + with_cpu by default. + + * dwarf2out.c (dwarf_file_data): New. + (enum dw_val_class): Add dw_val_class_file. + (struct dw_val_struct): Add val_file. + (file_table): Change to a hash table. + (file_table_emitted): Delete. + (file_table_last_lookup_index): Delete. + (emitcount): Delete. + (last_emitted_file): New. + (lookup_filename): Change prototype to return a struct dwarf_file_data. + (init_file_table): Delete. + (maybe_emit_file): Change prototype to take a struct dwarf_file_data. + (AT_addr): Add comment. + (add_AT_file): New. + (AT_file): New. + (get_AT_file): New. + (print_die): Handle dw_val_class_file. + (print_dwarf_line_table): Update for new file table structure. + (attr_checksum): Do checksum a filename. + (same_dw_val_p, same_attr_p): Do compare a filename. + (size_of_die): Handle dw_val_class_file. + (value_format): Likewise. + (output_die): Likewise. Also, call maybe_emit_file here. + (struct file_info): Constify filenames. Make file_idx a pointer + to a struct dwarf_file_data. + (struct dir_info): Constify directory names. Remove 'used' field. + (struct file_name_acquire_data): New. + (file_name_acquire): New. + (output_file_names): Modify to handle new file data structures. + (add_src_coords_attributes): Use add_AT_file. + (add_call_src_coords_attributes): Likewise. + (dwarf2out_imported_module_or_decl): Likewise. + (gen_subprogram_die): Modify for new file data structures. + (gen_variable_die): Likewise. + (file_table_eq): New. + (file_table_hash): New. + (file_table_last_lookup): New. + (lookup_filename): Rewrite to handle new file data structures. + (maybe_emit_file): Rewrite to handle new file data structures. + (dwarf2out_source_line): Always call lookup_filename and + maybe_emit_file. + (dwarf2out_init): Create file_table here. + (prune_unused_types_walk_attribs): Don't call maybe_emit_file here. + (file_table_relative_p): New. + (dwarf2out_finish): Change detection of relative filenames + to work with new file data structures. Move output_line_info call + after debug_info output. + +2006-09-11 H.J. Lu + + PR target/13685 + PR target/27537 + PR target/28621 + * config/i386/i386.c (override_options): Always default to 16 + byte stack boundary. + +2006-09-11 Alexandre Oliva + + PR target/28672 + * var-tracking.c (dump_dataflow_set): Start dumping at + register zero. + (clobber_variable_part): Kill only the variable part in + registers holding it, leaving other variables alone. + +2006-09-11 Josh Triplett + + * doc/extend.texi (Other Builtins): Actually use the macro + argument in the documentation example for + __builtin_types_compatible_p. + +2006-09-11 Eric Botcazou + + PR rtl-optimization/28726 + * sched-deps.c (sched_analyze_reg): New function extracted from... + (sched_analyze_1): ...here. Call it to analyze references to + registers. Treat again writes to a stack register as writing to the + register. + (sched_analyze_2): ...and here. Call it to analyze references to + registers. Treat again reads of a stack register as reading the + register. + +2006-09-11 Guenter Roeck + David Edelsohn + + PR target/27287 + * config/rs6000/spe.md (frob_df_di): Remove %H. + (frob_di_df): Remove %H. Change evmergelo to mr. + (frob_di_df_2): Remove %H. Change evldd to two loads. + +2006-09-11 Hideki Iwamoto + + * doc/cpp.texi: Fix names of charset options. + +2006-09-10 Andrew Pinski + + PR target/29009 + * config/i386/i386.c (override_options): Use 128-bit + stack boundary always for 64bits. + +2006-09-10 Eric Botcazou + + PR rtl-optimization/28636 + * combine.c (force_to_mode): Test for side-effects before + substituting by zero. + (simplify_shift_const): Likewise for zero or other constants. + +2006-09-10 Steven Bosscher + + PR middle-end/26983 + * builtins.c (expand_builtin_setjmp): Force next_lab to be + preserved. + +2006-09-10 Richard Sandiford + + PR target/29006 + * config/mips/mips-protos.h (mips_mem_fits_mode_p): Declare. + * config/mips/mips.c (mips_expand_unaligned_store): Use the mode + returned by mode_for_size, rather than the mode of src itself, + to choose between 32-bit and 64-bit patterns. + (mips_mem_fits_mode_p): New function. + * config/mips/mips.md (mov_l, mov_r): Use it to check + that the size of the source matches the size of the destination. + (mov_l, mov_r): Likewise. + +2006-09-10 Eric Christopher + + * config/darwin.c (machopic_select_rtx_section): Add CONST_VECTOR + for literal16. + +2006-09-09 Eric Christopher + + PR target/28995 + * config/darwin.c (machopic_select_rtx_section): Add TARGET_64BIT + for literal16. + +2006-09-09 Roger Sayle + Nicolas Setton + + * dwarf2out.c (convert_cfa_to_fb_loc_list): Handle DW_CFA_set_loc. + +2006-09-10 Andreas Schwab + + * config/m68k/m68k.md (bungt_rev): New pattern. + +2006-09-09 Paolo Bonzini + Dale Johannesen + + PR target/26778 + * regclass.c (struct reg_pref): Update documentation. + (regclass): Set prefclass to NO_REGS if memory is the best option. + (record_reg_classes): Cope with a prefclass set to NO_REGS. + +2006-09-08 Eric Christopher + + * config.gcc (i?86-*-darwin): Add 64-bit HWI support. + * config/t-slibgcc-darwin: Support x86_64 multilib. + * config/i386/i386.h (JUMP_TABLES_IN_TEXT_SECTION): + Return 1 for x86_64-darwin. + * config/i386/t-darwin: Add m64 multilib. + (LIB2_SIDITI_CONV_FUNCS): Use. + (LIB2FUNCS_EXTRA): Ditto. + * config/i386/darwin.h: Support x86_64. + * config/i386/i386.c (override_options): Turn on flag_pic + for x86_64-darwin. Disable flag_omit_pointer. + (get_pc_thunk_name): Assert !TARGET_64BIT. + (legitimate_address_p): Disable machopic addressing for + x86_64. + (legitimize_pic_address): Ditto. + (ix86_expand_move): Ditto. + (ix86_expand_call): Ditto. + (machopic_output_stub): Ditto. + * config/darwin.c (machopic_select_section): Support literal16. + (machopic_select_rtx_section): Ditto. + * config/darwin-sections.def: Ditto. + * config/darwin-64.c: New. + +2006-09-08 Joseph S. Myers + + PR c/28504 + * c-tree.h (struct c_arg_info): Add pending_sizes. + * c-parser.c (c_parser_parms_declarator, + c_parser_parms_list_declarator): Initialize pending_sizes. + * c-decl.c (get_parm_info): Initialize pending_sizes. + (get_parm_info): Set pending_sizes. + (grokdeclarator): Call put_pending_sizes for parameters for + function definition only. + +2006-09-07 Jason Merrill + + PR middle-end/27724 + * varasm.c (output_constant): Only strip actual no-op conversions. + + PR target/13685 + * config/i386/i386.c (override_options): Use 128-bit + stack boundary if -msse. + +2006-09-07 Eric Christopher + + * config/darwin.h (MACHO_SYMBOL_FLAG_VARIABLE): Update + comment. + * config/i386/darwin.h (MACHO_SYMBOL_FLAG_VARIABLE): + Redefine. + +2006-09-07 Geoffrey Keating + + * dwarf2out.c: Remove strange characters from comment above + dwarf2out_frame_debug_expr. + +2006-09-07 Eric Christopher + + * config/rs6000/darwin.h (HANDLE_SYSV_PRAGMA): Move from here... + * config/darwin.h: ... to here. + +2006-09-07 H.J. Lu + + * config/i386/i386.c (x86_partial_flag_reg_stall): New. + + * config/i386/i386.h (x86_partial_flag_reg_stall): New. + (TARGET_PARTIAL_FLAG_REG_STALL): New. + + * config/i386/i386.md (*ashldi3_cmp_rex64): Disabled for + TARGET_PARTIAL_FLAG_REG_STALL. + (*ashldi3_cconly_rex64): Likewise. + (*ashlsi3_cmp): Likewise. + (*ashlsi3_cconly): Likewise. + (*ashlsi3_cmp_zext): Likewise. + (*ashlhi3_cmp): Likewise. + (*ashlhi3_cconly): Likewise. + (*ashlqi3_cmp): Likewise. + (*ashlqi3_cconly): Likewise. + (*ashrdi3_cmp_rex64): Likewise. + (*ashrdi3_cconly_rex64): Likewise. + (*ashrsi3_cmp): Likewise. + (*ashrsi3_cconly): Likewise. + (*ashrsi3_cmp_zext): Likewise. + (*ashrhi3_cmp): Likewise. + (*ashrhi3_cconly): Likewise. + (*ashrqi3_cmp): Likewise. + (*ashrqi3_cconly): Likewise. + (*lshrdi3_cmp_rex64): Likewise. + (*lshrdi3_cconly_rex64): Likewise. + (*lshrsi3_cmp): Likewise. + (*lshrsi3_cconly): Likewise. + (*lshrsi3_cmp_zext): Likewise. + (*lshrhi3_cmp): Likewise. + (*lshrhi3_cconly): Likewise. + (*lshrqi2_cmp): Likewise. + (*lshrqi2_cconly): Likewise. + +2006-09-07 Uros Bizjak + + PR target/28946 + * config/i386/i386.md ("*ashldi3_cconly_rex64", "*ashlsi3_cconly", + "*ashlhi3_cconly", "*ashlqi3_cconly", "*ashrdi3_one_bit_cconly_rex64", + "*ashrdi3_cconly_rex64", "*ashrsi3_one_bit_cconly", "*ashrsi3_cconly", + "*ashrhi3_one_bit_cconly", "*ashrhi3_cconly", + "*ashrqi3_one_bit_cconly", "*ashrqi3_cconly", + "*lshrdi3_cconly_one_bit_rex64", "*lshrdi3_cconly_rex64", + "*lshrsi3_one_bit_cconly", "*lshrsi3_cconly", + "*lshrhi3_one_bit_cconly", "*lshrhi3_cconly", + "*lshrqi2_one_bit_cconly", "*lshrqi2_cconly": New patterns to + implement only CC setting effects of shift instructions. + +2006-09-07 Martin Michlmayr + + * doc/contrib.texi: Add myself. + +2006-09-07 Andrew Pinski + + PR middle-end/28862 + * stor-layout.c (relayout_decl): Don't zero the alignment if it + was set by the user. + +2006-09-07 Paolo Bonzini + + PR target/27117 + * config/sh/sh.md (divsi_inv_qitable, divsi_inv_hitable): New patterns. + (divsi_inv_m1): Use them. + (UNSPEC_DIV_INV_TABLE): New constant. + +2006-09-06 James E Wilson + + PR rtl-opt/27883 + * flow.c (update_life_info): If UPDATE_LIFE_LOCAL and PROP_DEATH_NOTES + then call count_or_remove_death_notes. + +2006-09-06 Jason Merrill + + PR c++/27371 + * tree-inline.c (copy_result_decl_to_var): New fn. + (declare_return_variable): Use it. Call declare_inline_vars here. + (expand_call_inline): Not here. + +2006-09-06 Diego Novillo + + * doc/contrib.texi: Update my entry. + +2006-09-06 Nick Clifton + + * config/frv/frv.h (EXTRA_MEMORY_CONSTRAINT): Define. + +2006-09-05 Andrew Pinski + + PR tree-opt/28937 + * tree-flow.h (tree_ssa_unswitch_loops): Return unsigned int. + (canonicalize_induction_variables): Likewise. + (tree_unroll_loops_completely): Likewise. + (tree_ssa_prefetch_arrays): Likewise. + (remove_empty_loops): Likewise. + * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Return + TODO_cleanup_cfg instead of directly calling + cleanup_tree_cfg_loop. + * tree-ssa-loop-ivcanon.c (canonicalize_induction_variables): + Likewise. + (tree_unroll_loops_completely): Likewise. + (remove_empty_loops): Likewise. + * tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Likewise. + * tree-ssa-loop.c (tree_ssa_loop_unswitch): Use the return value + of tree_ssa_unswitch_loops. + (tree_ssa_loop_ivcanon): Use the return value of + canonicalize_induction_variables. + (tree_ssa_empty_loop): Use the return value of + remove_empty_loops. + (tree_complete_unroll): Use the return value of + tree_unroll_loops_completely. + (tree_ssa_loop_prefetch): Use the return value of + tree_ssa_prefetch_arrays. + * passes.c (execute_todo): Before Cleanup CFG, set + updating_used_alone and after cleanup CFG, call + recalculate_used_alone. + +2006-09-05 Andrew Pinski + + PR tree-opt/28952 + * tree-vect-transform.c (vectorizable_condition): Move the check + for the type after the check for simple condition. + +2006-09-05 J"orn Rennecke + Kaz Kojima + + PR target/28764 + * mode-switching.c (optimize_mode_switching): Make the destination + block of an abnormal edge have no anticipatable mode. Don't + insert mode switching code at the end of the source block of + an abnormal edge. + +2006-09-05 Paolo Bonzini + + PR rtl-optimization/26847 + * simplify-rtx.c (struct simplify_plus_minus_op_data): Remove ix. + (simplify_plus_minus_op_data_cmp): For REGs, break ties on the regno. + (simplify_plus_minus): Count n_constants while filling ops. Replace + qsort with insertion sort. Before going through the array to simplify + pairs, sort it. Delay early exit until after the first sort, exiting + only if no swaps occurred. Simplify pairs in reversed order, without + special-casing the first iteration. Pack ops after simplifying pairs. + +2006-09-05 Anatoly Sokolov + + * config/avr/avr.c (avr_mcu_types): Add support for at90pwm1 device. + * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.). + * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.). + (avr_rtx_costs): Mark 'outer_code' argument with ATTRIBUTE_UNUSED. + +2006-09-05 Richard Guenther + + PR tree-optimization/28900 + * tree-if-conv.c (find_phi_replacement_condition): Gimplify + compound conditional before creating COND_EXPR condition. + +2006-09-05 Richard Guenther + + PR tree-optimization/28905 + * tree-vrp.c (fix_equivalence_set): Manually implement + !value_ranges_intersect_p to also handle symbolic ranges. + +2006-09-05 Richard Guenther + + PR middle-end/28935 + * tree-ssa-ccp.c (fold_stmt_r): Make sure to fold the condition + of a COND_EXPR. + +2006-09-04 Eric Botcazou + + PR rtl-optimization/27616 + * cse.c (table_size): New static variable. + (new_basic_block): Initialize it to 0. + (remove_from_table): Decrement it. + (insert): Increment it. + (fold_rtx_mem_1): New function, renamed from fold_rtx_mem. + (fold_rtx_mem): Enforce a cap on the recursion depth. Call + fold_rtx_mem_1 if under the cap. + (fold_rtx) : In the associative case, delay a little + the lookup of the equivalent expression and test for equality of the + first operand of the equivalent expression before in turn looking up + an equivalent constant for the second operand. + +2006-09-02 Geoffrey Keating + + Revert this change: + 2006-03-17 Alexandre Oliva + * dwarf2out.c (dwarf2out_stack_adjust): Always track the stack + pointer, instead of assuming it is possible to derive the + correct args size from a call insn. + +2006-09-02 Jakub Jelinek + + PR middle-end/27567 + * builtins.c (fold_builtin_memcpy, fold_builtin_memmove): Remove. + (fold_builtin_mempcpy): Rename to... + (fold_builtin_memory_op): ... this. Optimize one element copy + into an assignment. + (fold_builtin_memset, fold_builtin_bzero, fold_builtin_bcopy): New + functions. + (expand_builtin_strcpy, expand_builtin_strncpy): Handle COMPOUND_EXPR. + (expand_builtin_memcpy, expand_builtin_mempcpy, + expand_builtin_memmove): Likewise. Use fold_builtin_memory_op. + (fold_builtin_1): Handle BUILT_IN_MEMSET, BUILT_IN_BZERO and + BUILT_IN_BCOPY. Use fold_builtin_memory_op for + BUILT_IN_MEM{CPY,PCPY,MOVE}. + +2006-09-01 DJ Delorie + + * config/m32c/cond.md (cbranch4): Defer splitting until after reload. + (stzx_16): Likewise. + ("stzx_24_"): Likewise. + ("stzx_reversed_"): Likewise, and make mode-specific. + ("cmp_op"): New. + (cmp): Change to expander; just save operands. + (b_op): New. + (b): Change to expander, emit compare here. + (s_op): Change to use split and expander. + (s_24_op): Likewise. + (s_): New. + (s__24): New. + (movqicc___): New. + (s): New. + (s_24): New. + * config/m32c/m32c.c (compare_op0, compare_op1): New. + (m32c_pend_compare): New. + (m32c_unpend_compare): New. + (m32c_expand_scc): New. + (m32c_expand_movcc): Emit the compare also. + * config/m32c/predicates.md (mra_nopp_operand): New. + +2006-09-01 J"orn Rennecke + Richard Guenther + Adam Nemet + + PR middle-end/27226 + * builtins.c (get_pointer_alignment): Handle more forms + of base addresses that can be used to derive more precise + information about alignment. + +2006-09-01 Jason Merrill + + PR c++/28899 + * gimplify.c (gimplify_modify_expr_rhs) [BIND_EXPR]: Handle + want_value. + + * gimplify.c (voidify_wrapper_expr): Handle null type. + +2006-09-01 Josh Conner + + PR c++/25505 + * tree-nrv.c (dest_safe_for_nrv_p): New function. + (execute_return_slot_opt): Use it. + +2006-08-31 Josh Conner + + PR c++/25505 + * tree-gimple.c (is_gimple_mem_rhs): Recognize functions + returning aggregates. + +2006-08-31 Zdenek Dvorak + + PR tree-optimization/28839 + * tree-into-ssa.c (prune_unused_phi_nodes): Take into account kills in + blocks in that phi arguments appear. + +2006-08-31 Roger Sayle + + PR other/22313 + * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is + NULL, otherwise use an advance_loc4 to adjust relative to the + current label. + (output_cfi) : Update the current label. + (dwarf2out_switch_text_section): Reset the current label to avoid + using advance_loc4 over section boundaries. + +2006-08-31 Andreas Krebbel + + PR target/24367 + * config/s390/s390.md ("movsi", "movdi" expander): Accept rtxes like + r12 + SYMBOLIC_CONST. + +2006-08-30 Richard Guenther + + * Makefile.in (see.o): Add $(EXPR_H) dependency. + +2006-08-30 Zdenek Dvorak + + PR rtl-optimization/27735 + * cfgloopmanip.c (fix_loop_placements, fix_bb_placements, unloop): + Add new argument to keep track of whether an irreducible region + was affected. All callers changed. + (fix_irreducible_loops): Removed. + (remove_path): Call mark_irreducible_loops if EDGE_IRREDUCIBLE_LOOP + flags were invalidated. + +2006-08-29 H.J. Lu + + * config/i386/i386.md (*fop_df_comm_mixed): Match DF operands + instead of SF operands. + (*fop_df_comm_sse): Likewise. + (*fop_df_comm_i387): Likewise. + (*fop_df_1_mixed): Likewise. + (*fop_df_1_sse): Likewise. + +2006-08-29 Andrew Pinski + J"orn Rennecke + + PR tree-optimization/17506 + * tree-ssa.c (warn_uninit): If warning about a location outside of + the current function, note where the variable was declared. + +2006-08-28 Zdenek Dvorak + + PR tree-optimization/28411 + * double-int.c (double_int_div): Use double_int_divmod. + (double_int_divmod, double_int_sdivmod, double_int_udivmod, + double_int_mod, double_int_smod, double_int_umod): New functions. + * double-int.h (double_int_divmod, double_int_sdivmod, + double_int_udivmod, double_int_mod, double_int_smod, double_int_umod): + Declare. + * tree-ssa-loop-ivopts.c (constant_multiple_of): Returns the result + in double_int. + (get_computation_aff, get_computation_cost_at): Handle double_int + return type of constant_multiple_of. + +2006-08-28 Kazu Hirata + + PR middle-end/26632 + * convert.c (convert_to_integer): Set TREE_NO_WARNING to 1 on + an implicit conversion. + +2006-08-28 Prafulla Thakare + + * config/h8300/h8300.c (TARGET_DEFAULT_TARGET_FLAGS): New. + +2006-08-27 Roger Sayle + + * ifcvt.c (cheap_bb_rtx_cost_p): Don't speculatively execute + x87 instructions. + +2006-08-27 Kazu Hirata + + * config/i386/crtfastmath.c: Fix a comment typo. + +2006-08-26 Roger Sayle + + * tree.h (CASE_LOW_SEEN, CASE_HIGH_SEEN): New macros for manipulating + temporary visit flags on CASE_LABEL_EXPRs. + * c-common.c (match_case_to_enum): Add function comment. Avoid + O(N) loop, by looking up both CASE_LOW_SEEN and CASE_HIGH_SEEN. + (c_do_switch_warnings): Reorganize to record CASE_LOW_SEEN and + CASE_HIGH_SEEN for enumerated types. If the switch expression is + a constant, only warn if that constant value isn't handled. + +2006-08-26 Joseph S. Myers + + PR c++/24009 + * input.h (restore_input_file_stack): Declare. + (INPUT_FILE_STACK_BITS): Define. + * toplev.c (fs_p, input_file_stack_history, + input_file_stack_restored, restore_input_file_stack): New. + (push_srcloc, pop_srcloc): Check for input_file_stack_tick + overflowing INPUT_FILE_STACK_BITS bits. Save new state of stack. + (pop_srcloc): Don't free old state of stack. + +2006-08-26 David Edelsohn + + PR target/27544 + * doc/extend.texi (PowerPC Variable Attributes): Mention altivec. + (PowerPC Type Attributes): New. + +2006-08-26 Bob Wilson + + * config/xtensa/xtensa.c (function_arg_boundary): New. + (function_arg, xtensa_gimplify_va_arg_expr): Limit alignment to + STACK_BOUNDARY. + * config/xtensa/xtensa.h (FUNCTION_ARG_BOUNDARY): Move code to new + function_arg_boundary function that limits alignment to STACK_BOUNDARY. + +2006-08-26 Jakub Jelinek + + PR middle-end/28683 + * cfgexpand.c (add_reg_br_prob_note): Check if last has exactly + 3 following insns. + +2006-08-25 Volker Reichelt + + * flow.c (verify_wide_reg): Use internal_error for consistency failure. + (verify_local_live_at_start): Likewise. + +2006-08-25 Joseph S. Myers + + PR c/27893 + * gimplify.c (gimplify_decl_expr, gimplify_init_ctor_preeval, + omp_add_variable): Treat sizes as variable whenever not + INTEGER_CST. + +2006-08-26 Richard Guenther + + PR middle-end/28814 + * fold-const.c (fold_binary): Fold temporary to correct + type before constructing new comparison. + +2006-08-25 Fariborz Jahanian + + PR c/28418 + * c-gimplify.c (gimplify_compound_literal_expr): Don't add + variable again if DECL_SEEN_IN_BIND_EXPR_P. + +2006-08-25 Joseph S. Myers + + PR c/28299 + * c-decl.c (start_function): Don't try to process prototype + information from old declaration that isn't a function. + +2006-08-25 Jan Hubicka + + PR target/28621 + * config/i386/crtfastmath.c (set_fast_math): Force stack alignment. + +2006-08-25 Alan Modra + + PR target/27075 + * config/rs6000/rs6000.c (print_operand): Only use e500 %y syntax + for 8 byte objects. + +2006-08-25 J"orn Rennecke + + PR tree-optimization/16876 + * c-typeck.c (c_convert_parm_for_inlining): Don't take early + exit if PARM doesn't match VALUE. + +2006-08-25 Bob Wilson + + * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Do not emit a + literal_prefix directive. + (XTENSA_DECLARE_FUNCTION_SIZE): Delete. + * config/xtensa/linux.h (ASM_DECLARE_FUNCTION_SIZE): Delete. + * config/xtensa/elf.h (ASM_DECLARE_FUNCTION_SIZE): Delete. + +2006-08-25 David Edelsohn + + PR target/28753 + * config/rs6000/rs6000.md (movcc_internal1): Change operand 1 + predicate to general_operand. Add 0->y and I->r alternatives. + +2006-08-25 Kazu Hirata + + * doc/tm.texi: Fix a typo. + * predict.c: Fix comment typos. + +2006-08-25 Nick Clifton + + * config/mn10300/mn10300.h (TARGET_CPU_CPP_BUILTINS): Add + assertions of "cpu" and "machine". + +2006-08-24 Andrew Pinski + + PR tree-opt/28807 + * tree-ssa-operands.c (access_can_touch_variable): Don't say + the access through a base which has an alias set of 0 cannot + touch the variable. + +2006-08-24 Bill Wendling + + * doc/tm.texi (TARGET_DEFAULT_PACK_STRUCT): Fixed English. + +2006-08-24 Jan Hubicka + + * reload1.c (emit_reload_insns): Fix yet another typo in my patch. + +2006-08-24 Jan Hubicka + + PR debug/26881 + * cgraph.c: Fix comments. + (cgraph_varpool_mark_needed_node): Mark only variables not already + output to file. + * cgraphunit.c: Update comments; include gt-cgraphunit.h + (cgraph_varpool_assembled_nodes_queue): New static variable. + (cgraph_varpool_assemble_decl): Record output decls for debug out code. + (cgraph_varpool_output_debug_info): New function. + (cgraph_finalize_compilation_unit, cgraph_optimize): Call it. + * Makefile.in: Add gt-cgraphunit.h + +2006-08-24 Jan Hubicka + + * predict.c (probability_reliable_p): New predicate. + (edge_probability_reliable_p, br_prob_note_reliable_p): Likewise. + (predict_loops): Do not predict loop exit with less than 2% + probability. + * basic-block.h (edge_probability_reliable_p, + br_prob_note_reliable_p): Declare. + * ia64.h (ia64_print_operand): Do not disable on-chip branch + prediction when static predictor is not reliable. + * rs6000.c (output_cbranch): Likewise. + +2006-08-23 Stuart Hastings + + PR 28825 + * gcc/config/i386/i386.c (ix86_expand_vector_init_duplicate, + ix86_expand_vector_init_one_nonzero): Remove TARGET_SSE test. + +2006-08-21 Geoffrey Keating + + PR debug/28692 + * dwarf2out.c (rtl_for_decl_init): Don't try to create RTL for + complex values, nor for generic vector values. + +2006-08-22 Richard Guenther + + PR middle-end/28776 + * tree-scalar-evolution.c (fold_used_pointer): Add at_stmt + parameter. Convert arguments to arithmetic expression to the + chrecs type. + (analyze_scalar_evolution_1): Adjust caller. + +2006-08-22 Jan Hubicka + + Patch by Paolo Bonzini + * reload1.c (emit_reload_insns): Fix incorrect bracketing introduced by + my previous patch. + +2006-08-22 Daniel Berlin + + PR tree-optimization/28003 + * tree-ssa-alias.c (compute_may_aliases): Compute call clobbered + before grouping aliases. + +2006-08-22 Roger Sayle + + * config/i386/i386.c (ix86_value_regno): Don't return FIRST_MMX_REG + if !TARGET_MMX, and don't return FIRST_SSE_REG if !TARGET_SSE. + +2006-08-21 Jason Merrill + + PR c++/27115 + * gimplify.c (voidify_wrapper_expr): Handle STATEMENT_LIST as a + wrapper. Loop to handle nested wrappers. + (gimplify_bind_expr): Remove temp parameter. + (gimplify_modify_expr_rhs): Handle CLEANUP_POINT_EXPR, BIND_EXPR + and STATEMENT_LIST on the rhs. + (gimplify_statement_list): Voidify the STATEMENT_LIST. + (gimplify_expr): Pass pre_p to gimplify_statement_list. + (gimplify_target_expr): Remove special BIND_EXPR handling. + +2006-08-21 J"orn Rennecke + + * config/sh/lib1funcs-Os-4-200.asm: Guard entire file with + #if !__SHMEDIA__ . + +2006-08-21 Olivier Hainque + + * gimplify.c (gimplify_init_constructor) : + Arrange for the temporary captures of components overlapping the lhs + to happen before the lhs is possibly cleared. + +2006-08-21 Mark Shinwell + + * config/arm/pr-support.c (__gnu_unwind_execute): Insert " + 1" in + necessary places to pass the correct "number of registers" values + to _Unwind_VRS_Pop. + +2006-08-20 Jan Hubicka + + * tree-ssa-alias.c (eq_ptr_info, ptr_info_hash): New function. + (create_name_tags): Instead of quadratic checking use hashtable. + * bitmap.h: Include hashtab.h. + (bitmap_hash): Declare. + * bitmap.c (bitmap_hash): New function. + +2006-08-20 Jan Hubicka + + PR rtl-optimization/28071 + * tree-optimize.c (tree_rest_of_compilation): Do not remove edges + twice. + * tree-inline.c (copy_bb): Use cgraph_set_call_stmt. + * ipa-inline.c (cgraph_check_inline_limits): Add one_only argument. + (cgraph_decide_inlining, cgraph_decide_inlining_of_small_function, + cgraph_decide_inlining_incrementally): Update use of + cgraph_check_inline_limits. + * cgraph.c (edge_hash, edge_eq): New function. + (cgraph_edge, cgraph_set_call_stmt, cgraph_create_edge, + cgraph_edge_remove_caller, cgraph_node_remove_callees, + cgraph_remove_node): Maintain call site hash. + * cgraph.h (struct cgraph_node): Add call_site_hash. + (cgraph_set_call_stmt): New function. + +2006-08-20 Jan Hubicka + + PR rtl-optimization/28071 + * reload1.c (reg_has_output_reload): Turn into regset. + (reload_as_needed, forget_old_reloads_1, forget_marked_reloads, + choose_reload_regs, emit_reload_insns): Update to new + reg_has_output_reload. + +2006-08-20 Jan Hubicka + + PR middle-end/28779 + * ipa-inline.c (cgraph_decide_inlining, cgraph_early_inlining): Compute + function body sizes. + * cgraphunit.c (cgraph_analyze_function): Don't do so. + +2006-08-20 Danny Smith + + PR target/28648 c: + * tree.c (handle_dll_attribute): Return early if not a + var or function decl. + +2006-08-18 Joseph Myers + + PR target/27565 + * config/rs6000/rs6000.h (LOCAL_ALIGNMENT): For SPE, only adjust + alignment of SPE vector types. + +2006-08-18 Christophe Jaillet + + * tree.c (is_attribute_with_length_p): Remove a duplicated assert. + +2006-08-17 Jakub Jelinek + + PR c/28744 + * cgraph.h (struct cgraph_node): Remove externally_visible + bitfield. + * cgraphunit.c (process_function_and_variable_attributes): Set + local.externally_visible rather than externally_visible. + + PR c/28744 + * c-common.c (handle_externally_visible_attribute): First look + at TREE_CODE and only if it is function or var decl, check for + non-public objects. Don't warn for DECL_EXTERNAL. + * cgraphunit.c (process_function_and_variable_attributes): Warn + if externally_visible attribute is used on non-public object. + +2006-08-17 Jan Hubicka + + PR tree-optimization/27865 + * reload1.c (forget_marked_reloads): New function. + (forget_old_reloads_1): When data are passed, just mark the registers + for later removal. + (reload_as_needed): Use the new mechanizm. + +2006-08-17 Alexandre Oliva + + PR target/28146 + * reload.h (reg_equiv_alt_mem_list): New declaration. + * reload1.c (reg_equiv_alt_mem_list): New definition. + (reload): Initialize it and release it. + (delete_output_reload): Use it. + * reload.c (push_reg_equiv_alt_mem): New function. + (find_reloads_toplev): Call it. + (find_reloads_address, find_reloads_address_1): Likewise. + (find_reloads_subreg_address): Likewise. + +2006-08-17 Maxim Kuvyrkov + + PR rtl-optimization/28489 + * sched-ebb.c (begin_schedule_ready): Create basic block + at the right place. + (advance_target_bb): Skip empty blocks. + * haifa-sched.c (bb_note): Make global. + * sched-int.h (bb_note): Add prototype. + +2006-08-16 Zdenek Dvorak + + PR tree-optimization/27865 + * tree-vrp.c (adjust_range_with_scev): Do not use TYPE_{MIN,MAX}_VALUE + for pointer types. + * tree-scalar-evolution.c (fold_used_pointer_cast, pointer_offset_p, + fold_used_pointer, pointer_used_p): New functions. + (analyze_scalar_evolution_1): Use fold_used_pointer. + * tree-chrec.c (convert_affine_scev): Convert no-op casts correctly. + * tree-ssa-loop-ivopts.c (generic_type_for): Return integral type + for pointers. + +2006-08-17 Paolo Bonzini + + PR c++/28573 + * c-common.c (fold_offsetof_1): Add an argument and recurse down to it + or the INTEGER_CST. Fail on a CALL_EXPR. + (fold_offsetof): Pass new argument to fold_offsetof_1. + * c-parser.c (c_parser_postfix_expression): Don't include a NULL + operand into an INDIRECT_REF. + * c-typeck.c (build_unary_op): Adjust call to fold_offsetof. + +2006-08-16 Zdenek Dvorak + + PR gcov/profile/26570 + * value-prof.c (static_values): Removed. + (tree_find_values_to_profile): Do not set static_values. + (find_values_to_profile): Do not free static_values. + * profile.c (instrument_values): Do not free the values. + (branch_prob): Free the values. + +2006-08-16 Naveen.H.S + + * config/m32c/m32c_lib1.S (__mulsi3): Use only registers for dest. + +2006-08-16 Joseph S. Myers + + PR c/27697 + * c-typeck.c (build_component_ref): Combine qualifiers of + structure or union and field. + +2006-08-16 Zdenek Dvorak + + PR rtl-optimization/28071 + * basic-block.h (bb_dom_dfs_in, bb_dom_dfs_out): Declare. + * dominance.c (bb_dom_dfs_in, bb_dom_dfs_out): New functions. + * tree-into-ssa.c (struct dom_dfsnum): New. + (cmp_dfsnum, find_dfsnum_interval, prune_unused_phi_nodes): New + functions. + (insert_phi_nodes_for): Use prune_unused_phi_nodes instead of + compute_global_livein. + (prepare_block_for_update, prepare_use_sites_for): Mark the uses + in phi nodes in the correct blocks. + +2006-08-16 Zdenek Dvorak + + PR tree-optimization/28364 + * tree-ssa-loop-ivopts.c (aff_combination_to_tree): Handle zero + correctly. + (fold_affine_expr): New function. + (may_eliminate_iv): Use fold_affine_expr. + +2006-08-16 Volker Reichelt + + PR c/27489 + * c-typeck.c (c_start_case): Handle invalid orig_type correctly. + Clean up. + +2006-08-16 Mike Stump + + * doc/invoke.texi (-Wno-deprecated-declarations): Fixup use of pxref. + * doc/cppopts.texi (-MD): Likewise. + +2006-08-15 Danny Smith + + PR c/28287 + * c-common.c (handle_weak_attribute): Ignore and warn if + not a FUNCTION_ or VAR_DECL. + +2006-07-15 Mike Stump + + PR c/28280 + * c-parser.c (c_parser_typeof_specifier): Don't use + c_finish_expr_stmt, open code desired semantics instead. + +2006-08-15 Nick Clifton + + * config.gcc (x86-mingw32): Add a gthr-win32.h including makefile + fragment to tmake_file only if threads are enabled. + * config/i386/t-mingw32 (LIB2FUNCS_EXTRA): Move to... + * config/i386/t-gthr-win32: New file. ... here. + +2006-08-15 Volker Reichelt + + PR c/28649 + * c-parser.c (c_parser_compound_statement_nostart): Reset + parser->error after each statement. + +2006-08-15 Jakub Jelinek + + PR middle-end/28713 + * omp-low.c (lower_omp_parallel): Convert t to + receiver_decl's type. + (expand_omp_parallel): STRIP_NOPS from the MODIFY_EXPR + source before comparison. + + PR middle-end/28724 + * gimplify.c (gimplify_omp_atomic_pipeline): Convert oldival + to itype in assignment to oldival2. + +2006-07-14 Andrew Pinski + + PR c/27490 + PR c/27489 + * c-typeck.c (build_compound_expr): If the second expression + is an error mark, then just return an error mark instead of + creating a COMPOUND_EXPR. + +2006-07-14 Mike Stump + + * Makefile.in (LIBGCC_DEPS): Don't depend on LANGUAGES. + +2006-08-14 Kazu Hirata + + * c-decl.c, var-tracking.c: Fix comment typos. + +2006-08-14 Richard Sandiford + + PR rtl-optimization/28634 + * reorg.c (fill_slots_from_thread): Do not assume A + X - X == A + for floating-point modes unless flag_unsafe_math_optimizations. + +2006-08-13 Alexandre Oliva + Andrew Pinski + + PR c/27184 + * tree.c (build_array_type): Unify array types with + unspecified index_type. + * c-decl.c (grokdeclarator): Make sure we do not modify a + unified incomplete array type. + * c-typeck.c (store_init_value): Create distinct type before + filling in the index type in an initializer from a compound + literal. + + * c-decl.c (grokdeclarator): Remove code where we copy the + array type over. + +2006-08-13 Andrew Pinski + + * tree-pass.h (TODO_update_ssa): Fix which bit is used to take + into account for TODO_dump_cgraph. + (TODO_update_ssa_no_phi): Likewise. + (TODO_update_ssa_full_phi): Likewise. + (TODO_update_ssa_only_virtuals): Likewise. + (TODO_remove_unused_locals): Likewise. + (TODO_set_props): Likewise. + (TODO_update_stmt_usage): Likewise. + +2006-08-13 Dirk Mueller + + * c-common.c (strict_aliasing_warning): Fix formatting. + +2006-08-13 Matthias Klose + + * doc/invoke.texi: Fix spelling errors. + +2006-08-11 Eric Botcazou + + PR rtl-optimization/23454 + * reorg.c (relax_delay_slots): Update comment. + +2006-08-11 Richard Guenther + + PR middle-end/28651 + * simplify-rtx.c (simplify_const_relational_operation): + Simplify A CMP B to A - B CMP 0 only for EQ and NE comparison + codes. + +2006-08-10 Eric Botcazou + + * tree.c (build1_stat): Also propagate the TREE_CONSTANT and + TREE_INVARIANT flags for a VIEW_CONVERT_EXPR. + +2006-08-10 Paul Brook + + * final.c (final_scan_insn): Clear current_insn_predicate before + outputting inline asm. + +2006-08-10 Dorit Nuzman + + PR tree-optimization/26197 + * tree-ssa-alias.c (new_type_alias): Takes additional argument. Calls + get_ref_base_and_extent and overlap_subvar to add only relevant + subvars as may-aliases. + (add_may_alias_for_new_tag): New function, factored out of + new_type_alias. + * tree-vect-transform.c (vect_create_data_ref_ptr): Call new_type_alias + with additional argument. + * tree-flow.h (new_type_alias): Takes additional argument. + +2006-08-09 Nathan Sidwell + + * gcov.c (no_data_file): New flag. + (read_count_file): Set it if data file not present. Assume counts + zero if not found. + (output_lines): Don't name the data file, if there wasn't one. + +2006-08-09 Eric Botcazou + + * config/rs6000/rs6000.c (print_operand) : Fix comment and adjust. + (rs6000_generate_compare): Tweak comments. + * config/rs6000/rs6000.md (UNSPEC_MV_CR_GT): Fix comment. + +2006-08-09 Alexandre Oliva + + * var-tracking.c (enum micro_operation_type): Add MO_COPY. + (var_debug_decl): New function. + (var_reg_set): Follow debug decl link. Add location even if + reg is already known to hold some other variable. + (var_mem_set): Follow debug decl link. + (var_reg_delete_and_set, var_mem_delete_and_set): Follow debug + decl link. Delete other known locations of the variable part + if requested. + (var_reg_delete, var_mem_delete): Delete other known locations + of the variable part if requested. + (same_variable_part_p): New function. + (add_stores): Select MO_COPY when appropriate. + (vt_initialize): Handle it. + (compute_bb_dataflow, emit_notes_in_bb): Likewise. Delete + known locations for MO_SET and MO_CLOBBER. + (find_variable_location_part): New function. + (set_variable_part, delete_variable_part): Use it. + (clobber_variable_part): New function. + * dwarf2out.c (dwarf2out_var_location): Do not follow debug + decl link. + +2006-08-07 Victor Kaplansky + + PR tree-optimization/26969 + * tree-vect-analyze.c (vect_analyze_loop_form): Add check of latch + with an empty list of PHIs. + +2006-08-06 Paolo Bonzini + + PR target/27827 + + * conffig/i386/i386.md: Add peephole2 to avoid "fld %st" + instructions. + +2006-08-06 Andreas Schwab + + * config/m68k/m68k.c (m68k_output_function_epilogue): Fix format + string. Whitespace and comment fixup. + +2006-08-05 Volker Reichelt + + PR c/28502 + * c-decl.c (validate_proto_after_old_defn): Return false on invalid + argument. + + PR c/27721 + * c-typeck.c (build_modify_expr): Test earlier for non-lvalues. + + PR c/28136 + * c-parser.c (c_parser_postfix_expression_after_paren_type): Robustify. + +2006-08-04 Jan Hubicka + + PR target/26655 + PR target/28270 + * reload.c (push_reload): Patch out the mismatching instruction; + return early. + (find_reload): Bail out if the instruction was patched out. + +2006-08-04 Jan Hubicka + + PR tree-optimization/24888 + * tree-inline.c (expand_call_inline): Do not re-record variables. + (declare_inline_vars): Add variable to unexpanded_var_list. + +2006-08-04 John David Anglin + Roger Sayle + + PR rtl-optimization/26244 + * cse.c (fold_rtx): Correctly associate shifts when const_arg1 and/or + inner_const are negative or greater than or equal to the bitsize of + MODE. If SHIFT_COUNT_TRUNCATED is false, the values aren't associated. + Otherwise, the values are masked using GET_MODE_BITSIZE (mode) - 1. + Simplify complicated if statement. For ASHIFT and LSHIFTRT, return + CONST0_RTX (mode) when the new shift count is greater than or equal to + to the bitsize of the object being shifted and XEXP (y, 0) has no side + effects. + +2006-08-04 Kazu Hirata + + * tree-cfg.c: Fix a comment typo. + +2006-08-03 Mark Mitchell + + PR c++/28148 + * varasm.c (output_constant): Give the front end another chance to + expand constants, after stripping NOPs. + +2006-08-03 Jan Hubicka + + * domwalk.c (walk_dominator_tree): Reorganize to non-recursive + implementation. + +2006-08-03 Dorit Nuzman + + PR tree-optimization/27770 + * tree-vectorizer.h (get_vectype_for_scalar_type): Function + declaration removed (moved to tree-flow.h). + (vect_can_force_dr_alignment_p): Likewise. + * tree-flow.h (get_vectype_for_scalar_type): New function declaration + (moved from tree-vectorizer.h). + (vect_can_force_dr_alignment_p): Likewise. + * tree-vectorizer.c (vect_print_dump_info): Allow calling this function + from outside the vectorizer - in particular from cgraph stage. + * tree-vect-analyze.c (vect_compute_data_ref_alignment): Don't increase + the alignment of global arrays when -fsection-anchors is enabled. + * cgraphunit.c (cgraph_increase_alignment): New function. + (cgraph_optimize): Call cgraph_increase_alignment. + +2006-08-03 David Edelsohn + + PR target/27566 + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Do + not reload a SPE symbol_ref into a lo_sum address. + +2006-08-02 Daniel Jacobowitz + + PR debug/28063 + * dwarf2out.c (prune_unused_types_prune): Move call to + prune_unused_types_update_strings to cover the parent DIE also. + +2006-08-02 Jan Hubicka + + PR gcov/profile/28480 + * tree-cfg.c (change_bb_for_stmt): New function. + (tree_merge_blocks, tree_split_blocks): Use it. + +2006-08-01 Volker Reichelt + + PR c++/28250 + PR c++/28257 + PR c++/28259 + PR c++/28267 + * toplev.c (compile_file): Return early on errorcount or sorrycount. + * cgraphunit.c (cgraph_finalize_compilation_unit): Likewise. + (cgraph_optimize): Likewise. + +2006-08-01 Stuart Hastings + + * rtl.h (UINTVAL) New. + * config/rs6000/rs6000.c (SMALL_INT) Use it. + * testsuite/gcc.dg/20060801-1.c: New. + +2006-08-01 Daniel Jacobowitz + + PR debug/23336 + * c-typeck.c (build_external_type): Mark used enum types. + * dwarf2out.c (dwarf2out_abstract_function): Save and restore + cfun also. + (gen_subprogram_die): Whitespace fix. + +2006-08-01 Jan Hubicka + + * tree-outof-ssa.c (check_replaceable): Do not allocate def_vars + bitmap when not needed. + * tree-ssa-pre.c (bitmap_set_and, bitmap_set_and_compl): Free temporary + bitmaps. + +2006-08-01 Dirk Mueller + + * tree-vrp.c (fix_equivalence_set): Avoid bitmap memory leak. + +2006-07-31 Volker Reichelt + + * Makefile.in: Revert part of previous patch: + Replace $(VARRAY_H) by varray.h in definition of BASIC_BLOCK_H + and REGS_H. + +2006-07-30 Eric Christopher + + PR target/27543 + * doc/extend.texi (i386 Variable Attributes): Add anchor. + (PowerPC Variable Attributes): New section. + +2006-07-30 Atsushi Nemoto + + PR target/28126 (partial fix) + * config/mips/mips.md (tls_get_tp_): Set can_delay to no. + +2006-07-28 Jan Hubicka + + PR rtl-optimization/28071 + * cfgrtl.c (rtl_delete_block): Free regsets. + * flow.c (allocate_bb_life_data): Re-use regsets if available. + +2006-07-28 Volker Reichelt + + * Makefile.in: Use $(HEADER_H) instead of header.h in dependencies + and variables used in dependencies. + +2006-07-27 Arjan van de Ven + + * config/i386/i386.md (stack_tls_protect_set_di) Use %gs rather than + %fs for -mcmodel=kernel. + (stack_tls_protect_test_di): Likewise. + +2006-07-27 Carlos O'Donell + + * Makefile.in: Use mkinstalldirs. + +2006-07-27 H.J. Lu + + PR driver/28437 + * opts-common.c (prune_options): Skip joined switches. + +2006-07-27 Jan Hubicka + + PR rtl-optimization/28071 + * cselib.c (cselib_process_insn): Don't remove useless values too + often for very large hashtables. + +2006-07-27 Jan Hubicka + + PR rtl-optimization/28071 + * global.c (greg_obstack): New obstack. + (allocate_bb_info): Use it. + (free_bb_info): Likewise. + (modify_reg_pav): Likewise. + +2006-07-27 Roger Sayle + + * builtins.c (fold_fixed_mathfn): When long and long long are the + same size, canonicalize llceil*, llfloor*, llround* and llrint* + functions to their lceil*, lfloor*, lround* and lrint* forms. + +2006-07-27 Kazuhiro Inaoka + + PR gcc/28508 + * config/m32r/m32r.md (branch_insn): Reduce pc range for short + branch. + (rev_branch_insn): Likewise. + +2006-07-27 Jan Hubicka + + PR rtl-optimization/28071 + * regmove.c (reg_is_remote_constant_p): Avoid quadratic behaviour. + (reg_set_in_bb, max_reg_computed): New static variables. + (regmove_optimize): Free the new array. + (fixup_match_1): Update call of reg_is_remote_constant_p. + +2006-07-26 Jan Hubicka + + PR tree-optimization/27882 + * cgraph.c (cgraph_remove_node): Clear needed, reachable, next, previous + and decl fields. + * cgraphunit.c (cgraph_reset_node): Expect cgraph_remove_node to kill + next pointer + (cgraph_analyze_compilation_unit): Likewise. + * ipa.c (cgraph_remove_unreachable_nodes): Likewise. + * ipa-inline.c (cgraph_decide_recursive_inlining): Likewise. + (cgraph_early_inlinine): Make order garbage collected. + * Makefile.in (gt-ipa-inline): New garbagecollected file. + +2006-07-26 Daniel Jacobowitz + + * dbxout.c (output_types_sort): Add a comment. + (output_used_types): Free the VEC. + +2006-07-26 Daniel Jacobowitz + + * function.c (reorder_fix_fragments): Delete. + (reorder_blocks): Don't call it. + (reorder_blocks_1): Put all subblocks under the origin block. + +2006-07-26 Zdenek Dvorak + + PR rtl-optimization/27907 + * expr.c (force_operand): Use convert_move to handle FLOAT_EXTEND and + FLOAT_TRUNCATE. + +2006-07-25 Roger Sayle + + PR middle-end/28473 + * convert.c (convert_to_integer): When transforming (T)foo(x) into + bar(x) check that bar's result type can represent all the values of T. + +2006-07-25 Zdenek Dvorak + + * tree-chrec.c (chrec_convert_aggressive): Return NULL on failure. + +2006-07-25 Nick Clifton + + * ggc-page.c (NUM_SIZE_LOOKUP): New constant - the length of the + size_lookup[] array. + (ggc_alloc_stat): Use NUM_SIZE_LOOKUP. + (ggc_pch_count_object): Likewise. + (ggc_pch_alloc_object): Likewise. + (ggc_pch_write_object): Likewise. + (init_ggc): Do not attempt to initialize entries in the + size_lookup[] array for objects whose size is greater than than + the length of the array. + +2006-07-25 Daniel Jacobowitz + + * dbxout.c (output_used_types_helper): Push queued types + on a VEC. + (output_types_sort): New. + (output_used_types): Collect used types on a VEC and sort them + before emission. + +2006-07-24 Richard Guenther + + PR middle-end/28463 + * cgraph.c (cgraph_remove_node): Do not check if dumps + are enabled. + * cgraphunit.c (cgraph_optimize): Likewise. + +2006-07-24 Jan Hubicka + + PR rtl-optimization/28071 + * tree-cfg.c (tree_split_block): Do not allocate new stmt_list nodes. + * tree-iterator.c (tsi_split_statement_list_before): Do not crash when + splitting before first stmt. + +2006-07-24 Jan Hubicka + + PR rtl-optimization/28071 + * ipa-inline.c (update_caller_keys): Remove edges that + are no longer inline candidates. + +2006-07-23 Daniel Jacobowitz + + PR debug/27473 + * dbxout.c (output_used_types_helper, output_used_types): New. + (dbxout_symbol): Call output_used_types. + +2006-07-23 Jan Hubicka + + PR c/25795 + PR c++/27369 + * cgraph.c (cgraph_varpool_nodes): Export. + (decide_is_variable_needed): Ignored "used" attribute in + unit-at-a-time mode. + * cgraph.h (cgraph_varpool_nodes): Declare. + * cgraphunit.c (decide_is_function_needed): Ignored "used" attribute in + unit-at-a-time mode. + +2006-07-23 Roger Sayle + + PR target/28247 + * gthr-solaris.h: Prototype __gthrw forms of thr_self, mutex_init and + mutex_destroy even when !_LIBOOBJC. Remove duplicate prototype of + the __gthrw form of thr_keycreate. + (__gthread_key_delete): Silence the unused argument warning. + +2006-07-23 Steven Bosscher + + PR debug/25468 + * config/elfos.h (ASM_OUTPUT_ASCII): Remove 'register' marks. + Cache the last found '\0' marker to avoid quadratic behavior. + +2006-07-23 Jan Hubicka + + * i386.md (subsi_3_zext): Fix output template. + +2006-07-21 Mike Stump + + * doc/invoke.texi (C++ Dialect Options): Note that + -fvisibility-inlines-hidden doesn't affect explicitly + instantiationed inline methods. + +2006-07-20 Roger Sayle + + * config.gcc (i[34567]86-*-solaris2*): Add usegas.h to $tm_file + if the target assembler is GNU binutils' gas. + * config/i386/sol2-10.h (ASM_SPEC): Check USE_GAS to determine + whether to pass GNU gas or native as command line options. + +2006-07-20 Jason Merrill + + * tree.c (remove_attribute): New fn. + * tree.h: Declare it. + +2006-07-20 Paul Brook + + PR 27363 + * cse.c (cse_insn): Add destination addresses to hash table. Check if + they are invalidated by this instruction. + +2006-07-21 Danny Smith + + PR target/28427 + * config/i386/cygming.h (MAX_OFILE_ALIGNMENT): Define. + +2006-07-20 Eric Christopher + + PR target/26877 + * config/i386/i386.h (OPTION_DEFAULT_SPECS): Reorder. + +2006-07-19 Eric Christopher + + * config/t-slibgcc-darwin (stmp-lipo): Remove. + Rewrite dependencies for libgcc_s.1.dylib. + +2006-07-19 Jakub Jelinek + + * except.c (duplicate_eh_regions_1): Clear next_peer. + +2006-07-17 Nathan Sidwell + + * doc/invoke.texi (RS/6000 and PowerPC Options): Document that + -mlongcall does not guarantee all calls will be long. + * doc/extend.texi (long_call/short_call): Document that longcall + does not guarantee a long call will be used. + (longcall/shortcall): Likewise. + +2006-07-18 Roger Sayle + + PR middle-end/28283 + * expmed.c (expand_shift): Additionally check that the shift_cost + is not MAX_COST and that INTVAL(op1) is less than MAX_BITS_PER_WORD + before implementing a LSHIFT_EXPR as a sequence of additions. + * config/sh/sh.c (shift_costs): Return MAX_COST to inform the + middle-end that DImode shifts need to be synthesized by expand. + +2006-07-18 Diego Novillo + + PR 28410 + * tree-ssa-operands.c (access_can_touch_variable): Update + comment. + Return true if ALIAS is .GLOBAL_VAR. + +2006-07-18 David Daney + + * gcc.c (display_help): Fix typo in help text. + +2006-07-18 Olivier Hainque + + * tree.h (categorize_ctor_elements): Adjust prototype and add + descriptive comment, both in accordance with the interface change + described below. + * varasm.c (constructor_static_from_elts_p): New function. + Whether a constructor node is a valid static constant initializer + if all its elements are. + (initializer_constant_valid_p) : Use it. + * output.h: Declare it. + * expr.c (categorize_ctor_elements_1): Return whether the constructor + is a valid constant initializer instead of computing the number of + non-constant elements. Use constructor_static_from_elts_p for this + purpose. Replace the head comment with an indication that this is a + helper for categorize_ctor_elements. + (categorize_ctor_elements): Same interface change as for the _1 + helper. Former head comment from this helper moved here, adjusted to + account for the interface changes. + (mostly_zeros_p): Adjust call to categorize_ctor_elements. + (all_zeros_p): Likewise. + * gimplify.c (gimplify_init_constructor): Decide whether we can make + static versions of the constructor from the categorize_ctor_elements + return value instead of the formerly computed number of non-constant + elements. + +2006-07-18 Paolo Bonzini + + * configure: Regenerate. + * Makefile.in (build_libsubdir): New configure substitution + (build_libobjdir): New variable. + (BUILD_LIBIBERTY): Use it. + +2006-07-18 Volker Reichelt + + PR c/28286 + * c-pragma.c (handle_pragma_pack): Handle invalid constants. + +2006-07-18 Alexandre Oliva + + PR c/26993 + * c-common.c (handle_weakref_attribute): Ignore attribute in + the same conditions the alias attribute is ignored. + +2006-07-17 Carlos O'Donell + + * dbxout.c (dbxout_function_end): Do not increment scope_labelno. + (dbxout_begin_prologue): Increment scope_labelno. + +2006-07-17 Richard Henderson + + PR 27889 + * tree-nested.c (create_tmp_var_for): Set DECL_COMPLEX_GIMPLE_REG_P + if needed. + +2006-07-17 Roger Sayle + Rainer Orth + + * config/i386/gmon-sol2.c: Silence compilation warnings by partially + synchronizing code with config/sparc/gmon-sol2.c. Remove #if 0 + blocks. #include "tconfig.h" and "tsystem.h" to prototype system + functions such as sbrk, write, etc.. Add function prototypes. + Convert function declarations from K&R to ISO C. Cast pointers + to "long" and "unsigned long" instead of "int" and "unsigned int". + Convert tokens following #endif into comments. + +2006-07-17 Toon Moene + + * invoke.texi: Remove mention of f77; Reformat table for + inline parameter options correctly; mention that -malign-double + is default on x86-64 targets. + +2006-07-17 Zdenek Dvorak + + * tree-chrec.c (avoid_arithmetics_in_type_p): New. + (convert_affine_scev, chrec_convert_aggressive): Use + avoid_arithmetics_in_type_p. Do not check for the subtypes + separately. + +2006-07-17 Richard Sandiford + + PR middle-end/28403 + * optabs.c (expand_doubleword_shift): Wrap the call to + do_compare_rtx_and_jump with NO_DEFER_POP and OK_DEFER_POP. + +2006-07-17 Richard Sandiford + + PR middle-end/28402 + * optabs.c (expand_binop): Pass next_methods rather than methods + to expand_doubleword_shift. + +2006-07-17 J"orn Rennecke + + PR other/28251 + * tree.h (dump_addr): Declare. + * print-tree.c (dump_addr): New function. + (print_node_brief, print_node): Use it. + * print-rtl.c (print_rtx): Likewise. + * common.opt (-fdump-noaddr): New option. + * doc/invoke.texi (-fdump-noaddr): Document. + * loop-unroll.c (si_info_hash): Make hash independent of addresses. + (ve_info_hash): Likewise. + +2006-07-13 Andrew Haley + + PR tree-optimization/19505 + * tree-cfgcleanup.c (tree_forwarder_block_p): If we have an EH + edge leaving this block, make sure that the destination of this + block has only one predecessor. + +2006-07-17 Richard Guenther + + PR tree-optimization/28238 + * tree-inline.c (copy_bb): Check if we produced valid + gimple copying and substituting a stmt. If not, gimplify + it. + +2006-07-16 Eric Botcazou + + * optabs.c (maybe_encapsulate_block): New function extracted from... + (emit_libcall_block): ...here. Invoke it on the block of insns to + maybe emit REG_LIBCALL/REG_RETVAL notes around the block. + (emit_no_conflict_block): Likewise. + +2006-07-16 Eric Botcazou + + * doc/install.texi (sparc-sun-solaris2*): Add GMP version number. + +2006-07-15 Roger Sayle + + * tree-gimple.c (is_gimple_stmt): Sink test of IS_EMPTY_STMT into + a new NOP_EXPR case of the switch statement. + +2006-07-15 Kaz Kojima + + PR middle-end/28160 + * stor-layout.c (place_field): Take the bit field with + an excessive size into account in the ms-bitfiled case. + + PR middle-end/28161 + * stor-layout.c (place_field): Use DECL_BIT_FIELD_TYPE of + the previous bit field. + +2006-07-14 Eliot Dresselhaus + + PR target/27287 + * config/rs6000/spe.md (frob_di_df_2): Add m->r alternative. + +2006-07-14 Ulrich Weigand + + * config/s390/linux-unwind.h (s390_fallback_frame_state): Detect + signal frames correctly even when the signal was installed with + sa_restorer set. + +2006-07-14 Carlos O'Donell + + * dbxout.c (dbxout_begin_prologue): Emit LFBB label at function start. + (dbxout_function_end): Use local label LFBB. Remove hook + DBX_OUTPUT_NFUN. + (dbxout_source_line): Use local label LFBB. + (dbxout_block): Likewise. + (dbx_output_lbrac): Remove hook DBX_OUTPUT_LBRAC. + (dbx_output_rbrac): Remove hook DBX_OUTPUT_RBRAC. + * config/rs6000/linux64.h: Remove DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC, + and DBX_OUTPUT_NFUN. + +2006-07-13 Janis Johnson + + * doc/sourcebuild.texi (Test Directives): Document dg-shouldfail. + +2006-07-13 Jan Hubicka + + * cgraphunit.c (cgraph_varpool_analyze_pending_decls): Call + align_variable. + * output.h (align_variable): Declare. + * varasm.c (align_variable): Export. + * value-prof.c (tree_value_profile_transformations): Recompute iterator + when basic block changed. + +2006-07-13 Nick Clifton + + * config/sh/sh.c (sh_reorg): Ignore deleted insns whilst + walking the LOG_LINKS chain. + +2006-07-12 Geoffrey Keating + + * doc/invoke.texi (C++ Dialect Options): Explain difference + between -fvisibility-inlines-hidden and setting hidden + visibility explicitly. + +2006-07-12 Eric Christopher + + * config/t-slibgcc-darwin (SHLIB_LINK): Don't munge stmp-lipo. + (stmp-lipo): Depend on libgcc.a. + +2006-07-12 Kazu Hirata + + * tree.c: Fix a comment typo. + +2006-07-12 Naveen.H.S + + * config/m32c/muldiv.md (umulhisi3_c): Use only registers for + dest. + (umulhisi3_r): Likewise. + +2006-07-12 Paolo Carlini + + PR libstdc++/27878 + * doc/install.texi (mips-sgi-irix6): Add note about IRIX 6.5.x, + x < 19, vs wchar_t support. + +2006-07-12 Nick Clifton + + * config/sh/sh.h (SUBTARGET_ASM_RELAX_SPEC): Use -isa=sh4-up + instead of -isa=sh4. + +2006-07-12 Mike Stump + + * protoize.c (edit_fn_definition): Add volatile to clean_text_p. + +2006-07-10 Eric Christopher + + * config/t-slibgcc-darwin: Rewrite. + +2006-07-10 Laurynas Biveinis + + PR bootstrap/20437 + * Makefile.in (configure): add missing aclocal.m4 and acinclude.m4 + dependencies. + +2006-07-08 Matthias Klose + + * doc/sourcebuild.texi: Fix typo. + +2006-07-07 Mike Stump + + * toplev.c (process_options): Don't give -ffunction-sections may + affect debugging warning for Mach-O. + +2006-07-07 James E Wilson + + * config/mips/mips.md (cpu): Add sb1a. + * config/mips/sb1.md: Modify almost all patterns to accept sb1a in + addition to sb1. Adjust comments to clarify SB-1A differences from + SB-1. + (ir_sb1a_load): New. Modify bypasses to use it. + (ir_sb1a_simple_alu): Likewise. + * config/mips/mips.c (mips_cpu_info_table): Add sb1a. + (mips_rtx_cost_data): Add PROCESSOR_SB1A support. + (mips_issue_rate): Add PROCESSOR_SB1A. + (mips_multipass_dfa_lookahead): Use TUNE_SB1 instead of PROCESSOR_SB1. + * config/mips/mips.h (processor_type): Add PROCESSOR_SB1A. + (TARGET_SB1): Add PROCESSOR_SB1A check. + (TUNE_SB1): Likewise. + + * config/mips/mips-protos.h (mips_store_data_bypass_p): New. + * config/mips/mips.c (mips_store_data_bypass_p): New. + * config/mips/sb1.md: Use mips_store_data_bypass_p instead of + store_data_bypass_p. + +2006-07-08 Paul Brook + + PR target/27991 + * config/m68k/m68k.md: Add r-m patterns for 68881 movxf. + +2006-07-07 Richard Guenther + + PR middle-end/28268 + * tree.h (build_one_cst): Declare. + * tree.c (build_one_cst): New function. + * tree-ssa-math-opts.c (get_constant_one): Remove. + (insert_reciprocals): Use build_one_cst. + * fold-const.c (fold_plusminus_mult): Likewise. + +2006-07-07 Roger Sayle + + * pointer-set.c (pointer_set_destroy): Correct whitespace. + * cfgloopanal.c (dump_graph): Likewise. + * dojump.c (discard_pending_stack_adjust): Likewise. + * fix-header.c (TARGET_EXTRA_INCLUDE, TARGET_EXTRA_PRE_INCLUDES): + Likewise. + * alloc-pool.c (dump_alloc_pool_statistics): Likewise. + * function.c (finalize_block_changes): Likewise. + * gcc-common.c (ggc_free_overhead, dump_gcc_loc_statistics): Likewise. + * tree-ssa-dce.c (clear_control_dependence_bitmap): Likewise. + * rtl.c (dump_rtx_statistics): Likewise. + * tree-ssa-structalias.c (sort_fieldstack, init_alias_heapvars): + Likewise. + * varray.c (dump_varray_statistics): Likewise. + * dfp.c (encode_decimal32, decode_decimal32, encode_decimal64, + decode_decimal64, encode_decimal128, decode_decimal128, + decimal_real_to_decimal): Likewise. + +2006-07-07 Richard Guenther + + PR tree-optimization/28187 + * tree-vrp.c (vrp_operand_equal_p): New function. + (vrp_bitmap_equal_p): Likewise. + (update_value_range): Use them to compare old and new + max and min values. + +2006-07-06 Roger Sayle + + * c-parser.c (c_parser_skip_to_end_of_block_or_statement): Add + a default case to switch statement to silence compiler warnings. + +2006-07-06 Roger Sayle + + PR target/27968 + * configure.ac (HAVE_AS_IX86_FFREEP): On x86 targets check whether + the configured assembler supports the x87's ffreep mnemonic. + * configure: Regenerate. + * config.in: Regenerate. + + * config/i386/i386.c (output_387_ffreep): New function. + (output_fp_compare): Use output_387_ffreep to emit ffreep insns. + (output_387_reg_move): Likewise. + +2006-07-06 Paul Eggert + + Port to hosts whose 'sort' and 'tail' implementations + treat operands with leading '+' as file names, as POSIX + has required since 2001. However, make sure the code still + works on pre-POSIX hosts. + * Makefile.in (slowcompare): Port to POSIX 1003.1-2001, + which says you should use "tail -c +N" rather than "tail +Nc". + Fix a bug: the old code incorrectly skipped 15 bytes, not 16. + +2006-07-06 Zdenek Dvorak + + * tree-ssa-loop-niter.c (scev_probably_wraps_p): Fix typo in + argument name. + +2006-07-06 David Edelsohn + + PR target/28150 + * config/rs6000/rs6000.c (rs6000_legitimate_address): Do not allow + PRE_{INC,DEC} of TFmode. + +2006-07-06 David Edelsohn + Alan Modra + + PR target/28170 + * config/rs6000/rs6000.c (insvdi_rshift_rlwimi_p): Correct shiftop + bounds. Simplify. + +2006-07-06 Rainer Orth + + PR target/28285 + * config/alpha/predicates.md (alpha_swapped_comparison_operator): + Remove duplicate gtu. + +2006-07-05 Jason Merrill + + PR c++/13983 + PR c++/17519 + * stor-layout.c (finish_record_layout): Copy TYPE_PACKED to variants. + * c-common.c (handle_packed_attribute): So don't copy it here. + * c-decl.c (finish_struct): Don't copy TYPE_ALIGN. + +2006-07-05 Mike Stump + + * doc/invoke.texi (Invoking G++): Clarify prose for g++. + +2006-07-05 H.J. Lu + + PR target/26146 + * config.gcc: Check with_cpu for i[34567]86--*-solaris2.1[0-9]*. + +2006-07-05 Richard Guenther + + PR target/28158 + * config/i386/i386.md (*negdf2_1): Restrict pattern to + TARGET_SSE2 targets if using SSE math. + (*absdf2_1): Likewise. + +2006-07-05 Richard Guenther + + PR tree-optimization/28162 + * fold-const.c (fold_binary): For (-A) * (-B) -> A * B + make sure to convert the operands to the correct type. + +2006-07-04 Paolo Bonzini + + PR tree-optimization/28218 + + * tree-ssa-math-opts.c (execute_cse_reciprocals): Fix calls + to calculate and free the dominator information. + +2006-07-04 Peter O'Gorman + + * mklibgcc.in: chmod 644 before ranlib during install. + +2006-07-04 Andrew Stubbs + J"orn Rennecke + + * configure.ac (.eh_frame data check): Use diff -b. + +2006-07-04 Eric Botcazou + + PR bootstrap/18058 + * Makefile.in (BUILD_RTL): Add build/vec.o. + (build/gencondmd.o): Filter out -fkeep-inline-functions. + (build/genextract): Delete. + (build/genautomata): Likewise. + +2006-07-04 Alan Modra + + PR target/28207 + * config/rs6000/rs6000.c (function_arg_boundary): Double-word align + 128-bit IBM long doubles for ABI_V4. + +2006-07-03 Eric Botcazou + + * tree.c (range_in_array_bounds_p): New predicate. + * tree.h (range_in_array_bounds_p): Declare it. + * tree-eh.c (tree_could_trap_p) : Use it to + return a less conservative answer. + * tree-sra.c (struct sra_elt): Add new pointer field 'groups' + and flag 'is_group'. + (IS_ELEMENT_FOR_GROUP): New macro. + (FOR_EACH_ACTUAL_CHILD): Likewise. + (next_child_for_group): New helper function. + (can_completely_scalarize_p): Take into account groups. + (sra_hash_tree): Handle RANGE_EXPR. + (sra_elt_eq): Likewise. + (lookup_element): Be prepared for handling groups. + (is_valid_const_index): Delete. + (maybe_lookup_element_for_expr) : Use in_array_bounds_p + instead of is_valid_const_index. + : New case. + (sra_walk_expr) : Use in_array_bounds_p instead of + is_valid_const_index. + : Do not unconditionally punt. + (scan_dump): Dump info for groups too. + (decide_instantiation_1): Likewise. + (decide_block_copy): Assert that the element is not a group. + Propagate decision to groups. + (generate_one_element_ref): Handle RANGE_EXPR. + (mark_no_warning): Iterate over actual childs. + (generate_copy_inout): Likewise. + (generate_element_copy): Likewise. + (generate_element_zero): Likewise. + (generate_element_init_1): Likewise. + (dump_sra_elt_name): Handle RANGE_EXPR. + +2006-07-03 Roger Sayle + + PR tree-optimization/26251 + * tree-ssa-threadupdate.c (redirection_block_p): New function. + (thread_block): When optimizing for size refuse to thread jumps + that would require duplication of blocks other than redirection + blocks. + +2006-07-03 Paolo Bonzini + + * configure.ac: Fix thinko in previous check-in. + * configure: Regenerate. + +2006-07-03 Paolo Bonzini + + PR other/27063 + * configure.ac (for lang...): Simplify nesting of conditionals. + Test subdir_requires for non-enabled languages. Move processing + of lang_opt_files and lang_tree_fiels below that test. + * configure: Regenerate. + * doc/sourcebuild.texi (Front End Config): Document subdir_requires. + +2006-07-01 Martin Michlmayr + + * doc/gcov.texi (Invoking Gcov): Add a missing word. + +2006-06-30 Kazu Hirata + + * cfgexpand.c, config/i386/i386.c, genpreds.c, tree-cfg.c: Fix + comment typos. + +2006-06-29 Jason Merrill + + PR c++/26905 + PR c++/26612 + PR c++/27000 + PR c++/26984 + PR c++/19134 + * tree.c (build_decl_stat): Don't hande #pragma visibility here. + * c-common.c (c_determine_visibility): Handle it here. + * c-decl.c (finish_decl): Call c_determine_visibility for + functions, too. + * flags.h (enum symbol_visibility): Sort from most to least visibility. + * tree.h: Likewise. + * varasm.c (default_assemble_visibility): Likewise. + * c-common.c (handle_visibility_attribute): Complain about trying + to give visibility to an already defined class, or trying to change + declared visibility. Always attach the attribute. + + PR c++/26905 + PR c++/21675 + PR c++/17470 + * attribs.c (decl_attributes): Ignore type-in-place attributes + once the type has been defined. + +2006-06-29 Roger Sayle + + PR middle-end/27428 + * c-lex.c (c_lex_with_flags) : Increment errorcount + to indicate the cpplib has issued an error message for us. + +2006-06-29 Asher Langton + + PR target/25765 + * config/i386/i386.c (ix86_output_function_epilogue): Don't + insert a label at the end of an function under Mach-O. + +2006-06-29 Eric Christopher + Evan Cheng + + * predicates.md (vector_all_ones_operand): New. + (nonimmediate_or_sse_const_operand): Ditto. + * config/i386/i386-protos.h (standard_sse_constant_opcode): Declare. + * config/i386/i386.c (standard_sse_constant_opcode): Define. + (standard_sse_mode_p): Ditto. + (standard_sse_constant_p): Add case for -1 vector. + (ix86_expand_vector_move): Try to use. + * sse.md (*mov_internal): Use nonimmediate_or_sse_const_operand. + Call standard_sse_constant_opcode. + (*movv4sf_internal): Ditto. + (*movv2df_internal): Ditto. + +2006-06-29 Roger Sayle + + * genpreds.c (write_match_code_switch): Correctly use XSTR instead + of XEXP to extract the operands of a MATCH_CODE rtx. + +2006-06-28 Andrew Pinski + + * tree.c (tree_size): Do not waste tail padding in + struct tree_string and make the size be the same as + build_string will generate. + +2006-06-28 Jason Merrill + + PR c++/27768 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Add + may_aliases already in the tag's annotations to the bitmap. + +2006-06-28 Roger Sayle + + * genpreds.c (write_predicate_stmts) : Add missing break. + +2006-06-28 Roger Sayle + + * genpreds.c (generate_switch_p): New function. + (add_mode_tests): Push the new mode test down inside an AND expr + if this allows the switch-suitable MATCH_CODE to be near the root. + (write_match_code_switch): New function to write a MATCH_CODE as + a switch statement. + (write_predicate_stmts): New function to write a predicate RTX + expression as a sequence of statements. + (write_one_predicate_function): Use write_predicate_stmts. + (write_tm_constrs_h): Likewise. + +2006-06-26 Fred Fish + + * config/mips/t-sb1: New file. + * config.gcc (mipsisa64sb1-*-elf*): Add mips/t-sb1 to + tmake_file list. + +2006-06-26 DJ Delorie + + * config/m32c/m32c.c (m32c_print_operand): Fix sign-merging logic. + +2006-06-26 Naveen H.S + Jayant Sonar + Jaydeep Vipradas + + * config/m32c/addsub.md (addsi3, addsi3_1, addsi3_2): New. + (subsi3, subsi3_1, subsi3_2): New. + * config/m32c/bitops.md (andsi3, iorsi3, xorsi3): New. + * config/m32c/mov.md (SI mov peephole): New. + * config/m32c/m32.c (m32c_immd_dbl_mov): New. + * config/m32c/m32c-protos.h (m32c_immd_dbl_mov): New. + +2006-06-26 Olivier Hainque + + * function.c (aggregate_value_p): Honor DECL_BY_REFERENCE on + a CALL_EXPR target function declaration. + +2006-06-26 Richard Guenther + + * tree.c (build_string): Do not waste tail padding in + struct tree_string. + +2006-06-26 Richard Guenther + + * ggc-page.c (init_ggc): Add missing element to size_lookup + table. + + Revert + 2006-06-23 Richard Guenther + + * ggc-page.c (init_ggc): Do not round up the extra_order_size_table + sizes to MAX_ALIGNMENT. Fix the size_lookup table to honour + alignment requests instead. Add verification code. + Add struct tree_function_decl and struct tree_binfo size to + extra_order_size_table. Add missing element to size_lookup + table. + +2006-06-25 Eric Botcazou + + PR middle-end/28151 + * fold-const.c (const_binop): Be prepared for self returning zero. + Simplify code handling complex values. + +2006-06-24 Olivier Hainque + + * gimplify.c (gimplify_scalar_mode_aggregate_compare): New function. + (gimplify_expr): Use it for tcc_comparison of operands of non BLKmode + aggregate types. + +2006-06-24 Olivier Hainque + + * tree-ssa-loop-im.c (for_each_index): Handle ARRAY_RANGE_REF as + ARRAY_REF, so have the callback called for the low bound expression. + +2006-06-23 Janis Johnson + + * tree.h (DECIMAL_FLOAT_TYPE_P): New. + * c-typeck.c (c_common_type): Disallow operations on decimal float + types and other float types. + * convert.c (convert_to_real): Don't ignore conversions involving + decimal float types. + +2006-06-23 Olivier Hainque + + * tree.c (max_int_size_in_bytes): New function, inspired from + code in function.c:assign_temp. + * tree.h (max_int_size_in_bytes): Declare. + * function.c (assign_temp): Use it. + * gimplify.c (create_tmp_var): Relax the assertions on the type + properties, not mandating constant size any more. + (force_constant_size): New static function. + (gimple_add_tmp_var): Use it, forcing variable size to a + constant upper bound if it is not constant on entry. + +2006-06-23 Danny Smith + + PR target/27789 + * config/i386/winnt.c (ix86_handle_selectany_attribute): Move check + for initialization and setting of one_only flag to ... + (i386_pe_encode_section_info): ...here. + (i386_pe_dllimport_p): Check for DECL_DLLIMPORT_P also. + Recheck that the symbol has not been defined. + +2006-06-23 Richard Guenther + + * ggc-page.c (init_ggc): Do not round up the extra_order_size_table + sizes to MAX_ALIGNMENT. Fix the size_lookup table to honour + alignment requests instead. Add verification code. + Add struct tree_function_decl and struct tree_binfo size to + extra_order_size_table. Add missing element to size_lookup + table. + +2006-06-22 Roger Sayle + John David Anglin + + PR middle-end/28131 + * expr.c (expand_expr_real_1) : Check whether the + call to lang_hooks.types.type_for_mode returned NULL_TREE. + +2006-06-23 Ben Elliston + + * dfp.c (decimal_to_decnumber): Do not use decNumberNegate to + negate dn -- manipulate it directly. + +2006-06-22 Roger Sayle + Steven Bosscher + + PR target/27531 + * reload1.c (gen_reload): Call mark_jump_label on the new insns + generated by gen_move_insn to add REG_LABEL notes if necessary. + +2006-06-22 Bob Wilson + + * config/xtensa/lib1funcs.asm (MIN_ESA): Delete. + (leaf_entry): Remove use of MIN_ESA. + +2006-06-22 Zdenek Dvorak + + PR rtl-optimization/28121 + * cfgexpand.c (tree_expand_cfg): Clean EDGE_EXECUTABLE flag from + the entry edge. + +2006-06-21 DJ Delorie + + * config/m32c/muldiv.md (mulhisi3_i): Only use registers for dest + (TN-16C-A156A/E). + (mulhisi3_r): Likewise. + +2006-06-21 Richard Sandiford + + PR middle-end/28034 + * coverage.c (coverage_counter_alloc): Leave the index type + unspecified. + (coverage_counter_alloc): Use null arguments for operands 2 and 3 + of the ARRAY_REF. + +2006-06-21 Andrew Pinski + + * doc/invoke.texi (-fopenmp) Move to "Options Controlling C Dialect" + section from the "Options for Code Generation Conventions". + +2006-06-21 Richard Henderson + + PR target/26347 + PR target/27082 + * config/alpha/predicates.md (small_symbolic_operand): Deny weak + symbols. + (global_symbolic_operand): Allow weak symbols, even if local_p. + +2006-06-21 Eric Botcazou + + * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): New function. + (find_interesting_uses_address): Punt if above function returns true. + +2006-06-21 Richard Guenther + + * configure: Regenerated. + +2006-06-21 Joseph Myers + + * config/mips/mips.c (function_arg): Where one part of a + complex argument is in registers and the other part in the stack, + return a REG not a PARALLEL. + +2006-06-21 Mark Mitchell + + * configure.ac: Set gcc_gxx_include_dir to $target/include/c++ + when cross-compiling. Do not substitute libstdcxx_incdir. + * configure: Regenerated. + +2006-06-21 Jakub Jelinek + + * varasm.c (mergeable_string_section): Check for embedded NULs and + NUL termination in the first int_size_in_bytes (TREE_TYPE (decl)) + rather than TREE_STRING_LENGTH bytes. + +2006-06-21 Richard Guenther + + * ggc-page.c (extra_order_size_table): Add var_ann_d, + tree_ssa_name, bitmap_element and phi_node with 4 arguments + sizes. + +2006-06-21 Richrad Guenther + + * tree-ssa-loop-niter.c (simplify_using_initial_conditions): + Limit iteration over the dominators. + +2006-06-20 Roger Sayle + + * config/mips/iris6.h (LIB_SPEC): Add support for -pthread. + (SUBTARGET_CPP_SPEC): Define _REENTERANT if -pthread specified. + +2006-06-20 Richard Guenther + Michael Matz + + * alloc-pool.h (free_alloc_pool_if_empty): Prototype new + function. + * alloc-pool.c (free_alloc_pool_if_empty): New function. + * et-forest.h (et_free_pools): Prototype new function. + * et-forest.c (et_free_tree_force): Free parent occurrence. + (et_free_pools): New function. + * dominance.c (free_dominance_info): Free et-forest alloc + pools. + +2006-06-20 Roger Sayle + + * expr.c (expand_expr_real_1) : For vector constants with + integer modes, attempt to directly construct an integer constant. + + * fold-const.c (native_encode_vector): Determine the size of each + element from the vector type instead of the first vector element. + + * tree.c (build_constructor_single): Mark a CONSTRUCTOR as constant, + if all of its elements/components are constant. + (build_constructor_from_list): Likewise. + +2006-06-20 Zdenek Dvorak + + PR tree-optimization/27331 + * tree-data-ref.c (free_data_ref): New function. + (create_data_ref): Fail if the data reference has unknown access + function. + (free_data_refs): Use free_data_ref. + +2006-06-19 Andrew Pinski + + PR middle-end/28075 + * tree-inline.c (setup_one_parameter): Strip useless + type conversion before adding it to the IR. + (declare_return_variable): Likewise. + +2006-06-19 Martin Michlmayr + + PR c/27149 + * c-common.c (c_common_truthvalue_conversion): Fix grammar in warning. + +2006-06-19 Mike Stump + + * tree.c (variably_modified_type_p): VM arguments don't make the + type a VM type. + +2006-06-19 Richard Guenther + + * tree-ssa-pre.c (try_combine_conversion): Strip useless + type conversions after folding. + +2006-06-19 Richard Guenther + + * ggc-page.c (extra_order_size_tab): Add entries with + size of struct function and basic_block. + (size_lookup): Extend to cover sizes up to 511. + (ggc_alloc_stat): Adjust user. + (ggc_pch_count_object): Likewise. + (ggc_pch_alloc_object): Likewise. + (ggc_pch_write_object): Likewise. + +2006-06-19 Zdenek Dvorak + + * tree-ssa-loop-niter.c (implies_ge_p): New function. + (derive_constant_upper_bound): Handle OP0 - CST in unsigned types + correctly. + +2006-06-19 Denis Chertykov + + * config/avr/libgcc.S : Correct my wrong previous commit. + +2006-06-19 Roger Sayle + + PR target/27861 + * expmed.c (expand_shift): On SHIFT_COUNT_TRUNCATED targets, we may + have stripped a SUBREG from the shift count, so we may need to + convert_to_mode back to the type's mode before calling make_tree. + Use new_amount instead of amount to avoid expanding a tree twice. + +2006-06-19 Richard Guenther + + PR middle-end/28045 + * fold-const.c (operand_equal_p): Check if the argument types + have the same precision before stripping NOPs. + +2006-06-19 Daniel Berlin + + Fix PR tree-optimization/27341 + * tree-cfg.c (gimplify_val): Call mark_new_vars_to_rename on the + statement we get. + * tree-complex.c (pass_lower_complex): Update SMT usage. + +2006-06-19 Andreas Krebbel + + * config/s390/s390.md ("doloop_si64", "doloop_si31", "doloop_di"): + Add a new alternative to the constraint strings. Add move of + operand 1 to 3 to the splitter definition. + ("doloop_si_long"): Second contraint alternative removed. + +2006-06-08 Anatoly Sokolov + + * config/avr/avr.h (avr_have_movw_lpmx_p): Declare. + (TARGET_CPU_CPP_BUILTINS): Add __AVR_HAVE_MOVW__ and + __AVR_HAVE_LPMX__. + (AVR_HAVE_MOVW) Define. + (ASSEMBLER_DIALECT): Use AVR_HAVE_MOVW. + (ASM_SPEC): Add avr25. + (LINK_SPEC): Add avr25. + * config/avr/avr.c (avr_have_movw_lpmx_p): Add. + (base_arch_s): Add new member 'have_movw_lpmx'. + (avr_arch_types): Init 'have_movw_lpmx'. + (avr_mcu_types): Add 'avr25'. Move attiny13, attiny2313, attiny24, + attiny44, attiny84, attiny25, attiny45, attiny85, attiny261, + attiny461, attiny861 and at86rf401 in 'avr25' arhitecture. + (avr_override_options): Init 'avr_have_movw_lpmx_p'. + (output_movhi, output_movsisf, ashlsi3_out, avr_rtx_costs): Use + AVR_HAVE_MOVW. + (avr_file_start): Do not output '.arh' derective. + * config/avr/libgcc.S (mov_l): Use __AVR_HAVE_MOVW__. + (__do_copy_data): Use __AVR_HAVE_LPMX__. + * config/avr/avr.md (mcu_enhanced): Delete. + (mcu_have_movw): Define. + (negsi2, extendhisi2, zero_extendhisi2): Use 'mcu_have_movw'. + (call_insn, call_value_insn): Use 'call_insn' and __AVR_HAVE_MOVW__. + * config/avr/t-avr(MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Add avr25. + (MULTILIB_MATCHES): Add attiny13, attiny2313, attiny24, attiny44, + attiny84, attiny25, attiny45, attiny85, attiny261, attiny461, + attiny861 and at86rf401 devices. + +2006-06-18 Jie Zhang + + * config/bfin/bfin.c (MAX_LOOP_LENGTH): Define to be 2042 instead + of 4096. + +2006-06-17 Karl Berry + + * doc/cpp.texi, doc/cppinternals.texi, doc/gcc.texi, + doc/gccint.texi, doc/install.texi (@dircategory): Use + "Software development" instead of "Programming", following + the Free Software Directory. + +2006-06-17 Alexandre Oliva + + * config/i386/i386.c (legitimate_tls_address) + : Add tp after DTPOFF. + * config/i386/i386.md (*tls_dynamic_gnu2_combine_32): Adjust. + (*tls_dynamic_gnu2_combine_64): Likewise. + +2006-06-16 Richard Guenther + + PR middle-end/27116 + * fold-const.c (negate_expr_p): Do not introduce undefined + overflow in negating INTEGER_CSTs. + (fold_negate_expr): Rename from negate_expr. Revert last + change for folding BIT_NOT_EXPR. Change semantics to + return NULL_TREE for non-simplified negations. Do not + strip type conversions and unify type handling. + (negate_expr): New function, wrap around fold_negate_expr + but ensure building a tree always. Strip type conversions + here, fold to result type. + (fold_unary): Use fold_negate_expr for folding NEGATE_EXPR. + +2006-06-16 Roger Sayle + + PR middle-end/27802 + * reg-stack.c (subst_stack_regs): Handle noreturn function calls + that (would) return their results in stack registers. + +2006-06-16 Michael Matz + Richard Guenther + + * fold-const.c (fold_truthop): Only return new tree node if + we canonicalized something. + +2006-06-16 Richard Guenther + + * function.h (enum function_frequency): Move declaration + out of struct function. + (struct function): Move bool fields and the enum to the bitfield + section. Reorder elements to avoid padding. Remove unused + fields left over from the RTL inliner removal. + * function.c (free_after_compilation): Do not zero removed fields. + * Makefile.in (ipa-reference.o): Add $(FUNCTION_H) dependency. + (ipa-type-escape.o): Likewise. + +2006-06-16 Richard Guenther + + * cgraph.h (struct cgraph_local_info): Turn bool elements + into a bitfield. + (struct cgraph_node): Likewise. + (struct cgraph_varpool_node): Likewise. + +2006-06-15 Richard Guenther + + * fold-const.c (fold_truth_not_expr): Rename from + invert_truthvalue. Give it fold_* semantics to avoid + generating garbage. + (invert_truthvalue): New function. Wrapper around + fold_truth_not_expr. + (optimize_minmax_comparison): Avoid creating garbage. + (fold_unary): Use fold_truth_not_expr for folding + TRUTH_NOT_EXPR. + (fold_ternary): Replace uses of invert_truthvalue with + fold_truth_not_expr where applicable. + * tree.h (fold_truth_not_expr): Prototype. + +2006-06-16 Richard Guenther + + PR tree-optimization/27781 + * Makefile.in (ipa-pure-const.o): Add $(TARGET_H) dependency. + * ipa-pure-const.c (target.h): Include. + (analyze_function): Do not analyze functions that do not + bind locally. + +2006-06-15 Andrew MacLeod + + PR middle-end/27793 + * tree-dfa.c (referenced_vars_dup_list): Remove. + (find_referenced_vars): Remove assert. + (referenced_var_check_and_insert): Replace dup list with assert. + * tree-ssa.c (delete_tree_ssa): Remove dup list processing. + * tree-flow.h (referenced_vars_dup_list): Remove extern decl. + +2006-06-15 Richard Guenther + + * tree-ssa-structalias.c (alias_get_name): Avoid creating + extra unused identifiers if not dumping. + (create_variable_info_for): Likewise. + +2006-06-15 Zdenek Dvorak + + * tree-ssa-loop-niter.c (implies_nonnegative_p): New function. + (derive_constant_upper_bound): Derive more precise upper bound in + common cases. Return type changed to double_int. + (record_estimate): Reflect the changed return type of + derive_constant_upper_bound. + * double-int.c (double_int_zext, double_int_sext): Fix. + +2006-06-15 Paolo Bonzini + + * configure.ac (CFLAGS): Get them from the toplevel or from the + configure invocation. + * configure: Regenerate. + * Makefile.in (CFLAGS): Substitute value provided by configure. + +2006-06-14 Mark Mitchell + + PR c++/26559 + * c-common.h (c_finish_omp_atomic): Adjust declaration. + * c-omp.c (c_finish_omp_atomic): Return the expression to perform, + rather than calling add_stmt on it. + * c-parser.c (c_parser_omp_atomic): Adjust accordingly. + +2006-06-14 Andreas Krebbel + + PR middle-end/27959 + * reload1.c (reload): Remove registers returned by update_eliminables + from used_spill_regs. + +2006-06-13 DJ Delorie + + * config/m32c/muldiv.md (mulpsi3): Expect arbitrary constants. + +2006-06-13 Carlos O'Donell + + * Makefile.in: Define HTMLS_BUILD, HTMLS_INSTALL, + html__strip_dir, html__mkdir_p. Enhance install-html target. + * configure.ac: AC_SUBST datarootdir, docdir and htmldir. + * configure: Regenerate. + +2006-06-13 Fariborz Jahanian + + * fold-const.c (fold_cond_expr_with_comparison): Check for + Objective-C++ as language in deciding COND_EXPR transformation. + +2006-06-06 J"orn Rennecke + + PR target/28014: + * config/sh/t-sh (LIB1ASMFUNCS): Add _udiv_qrnnd16 + * config/sh/sh.c (print_operand): Add !SHMEDIA functionality to 'M'. + * config/sh/lib1funcs.h (SL, SL1): Define. + * config/sh/lib1funcs.asm (__udiv_qrnnd16): New hidden function. + * longlong.h (__sh__): Define umul_ppmm, udiv_qrnnd and sub_ddmmss. + * config/sh/t-sh ($(T)unwind-dw2-Os-4-200.o): New rule. + (OBJS_Os_4_200): New variable. + ($(T)libgcc-Os-4-200.a): Use it. + * sh.md (udivsi3): For TARGET_DIVIDE_CALL_TABLE, avoid function call + when dividing 1 and/or by 0. + +2006-06-13 Roger Sayle + + * configure.ac (HAS_MCONTEXT_T_UNDERSCORES): Include + before to define sigset_t required by . + * configure: Regenerate. + +2006-06-13 Jie Zhang + + * config/bfin/bfin.c (bfin_reorg_loops): Only call recog_memoized () + for real instruction. + +2006-06-13 Maxim Kuvyrkov + + PR middle-end/26807 + * haifa-sched.c (check_cfg): Handle special case. + +2006-06-13 Eric Botcazou + + PR debug/26754 + * gimplify.c (declare_tmp_vars): Rename into declare_vars. + Add debug_info parameter. Chain the vars to the BLOCK instead + of the BIND_EXPR if debug info are requested for them. + (pop_gimplify_context): Adjust for above change. + (gimple_add_tmp_var): Likewise. + * tree-gimple.h (declare_tmp_vars): Rename into declare_vars. + Add bool parameter. + * tree-nested.c (convert_nonlocal_reference): Adjust for above change. + (convert_local_reference): Likewise. + (get_local_debug_decl): Set DECL_IGNORED_P on the original variable. + (finalize_nesting_tree_1): Request that debug info be emitted + for debug_var_chain. + +2006-06-13 Maxim Kuvyrkov + + * haifa-sched.c (unlink_other_notes, unlink_line_notes): Fix the patch + for PR target/27863. + +2006-06-13 Richard Guenther + + PR middle-end/27536 + * except.c (output_ttype): Expand type with EXPAND_INITIALIZER. + +2006-06-13 Richard Guenther + + PR tree-optimization/27830 + * tree-inline.c (copy_body_r): For copying the operand + of an ADDR_EXPR make sure to fold &* afterwards. + +2006-06-12 Eric Botcazou + + * gimplify.c (gimplify_expr): Treat VIEW_CONVERT_EXPR like other + lvalues in the fb_none case with side-effects. + +2006-06-12 Kazu Hirata + + * tree-flow.h: Remove the prototype for + compute_phi_arg_on_exit. + * tree-ssa-loop-ivopts.c (protect_loop_closed_ssa_form_use, + protect_loop_closed_ssa_form, compute_phi_arg_on_exit): + Remove. + +2006-06-12 Mark Shinwell + + * builtins.c (expand_builtin_return_addr): Only use + frame_pointer_rtx when count == 0 and we are expanding + __builtin_return_address. + +2006-06-12 Fred Fish + + * config/mips/mips.c (mips_file_start): Create special section + ".gcc_compiled_longXX" for o64 ABI as well as EABI. + +2006-06-11 Eric Christopher + + PR middle-end/27948 + * stor-layout.c (place_field): Remove check for + remaining_in_alignment when aligning at the end of a run. + +2006-06-11 Eric Christopher + + PR 27542 + * doc/extend.texi (Structure-Packing Pragmas): Document ms_struct + pragma. + +2006-06-11 Roger Sayle + + PR target/27858 + Revert incorrect fix for PR target/27158 + 2006-05-08 Roger Sayle + * reload.c (find_reloads_toplev): Only return the simplified SUBREG + of a reg_equiv_constant if the result is a legitimate constant. + +2006-06-11 Roger Sayle + + PR target/27158 + * config/rs6000/rs6000.c (const_vector_elt_as_int): New function to + extract a CONST_VECTOR element and interpret it as an integer. + (vspltis_constant): Use const_vector_elt_as_int instead of the + macro CONST_VECTOR_ELT in order to handle FP vector modes. + * config/rs6000/predicates.md (easy_vector_const): Consider + floating point ALTIVEC_VECTOR_MODEs via easy_altivec_constant. + +2006-06-11 Kaz Kojima + + PR middle-end/27942 + * stor-layout.c (update_alignment_for_field): Don't add extra + alignment for packed non-bitfield fields in ms_bitfield_layout_p + code. + +2006-06-09 Ralf Corsepius + + * config/mips/t-rtems: Add EL/EB multilib variants. + +2006-06-09 Mike Stump + + * c-typeck.c (c_begin_vm_scope): Fix file_scope processing. + +2006-06-09 David Daney + + * doc/install.texi: Add binutils version recommendation for mips-*-*. + +2006-06-09 Andreas Krebbel + + * reload.c (find_reloads): Unset force_reload for 'X' constraint. + +2006-06-09 Richard Guenther + + PR tree-optimization/26998 + * tree-vrp.c (extract_range_from_unary_expr): For NEGATE_EXPR + of signed types, only TYPE_MIN_VALUE is special, but for both, + minimum and maximum value. Likewise VR_ANTI_RANGE is special + in this case, as is -fwrapv. + +2006-06-08 Mike Stump + + PR target/26427 + * config/darwin.c (darwin_asm_output_anchor): Disable + -fsection-anchors on darwin for now. + * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Likewise. + * rs6000/rs6000.c (optimization_options): Likewise. + +2006-06-08 Volker Reichelt + + PR target/27421 + * config/i386/i386.c (classify_argument): Skip fields with invalid + types in unions. + +2006-06-08 Steven Bosscher + + * cse.c (flush_hash_table): Use VOIDmode to invalidate a REG. + (cse_insn): Likewise for the stack_pointer_rtx. + +2006-06-08 Roger Sayle + + * tree-ssa-dom.c (record_conditions): Only record "unordered" + conditions from floating point comparisons. + +2006-06-08 Paolo Bonzini + + PR middle-end/27733 + * expmed.c (struct alg_hash_entry): Fix type of field T + to match synth_mult argument. + (NUM_ALG_HASH_ENTRIES): Make it bigger for 64-bit HOST_WIDE_INT. + +2006-06-08 Maxim Kuvyrkov + + PR target/27863 + * haifa-sched.c (unlink_other_notes, unlink_line_notes): Update basic + block boundaries. + +2006-06-08 Richard Guenther + + PR middle-end/27116 + * fold-const.c (negate_expr_p): We can negate BIT_NOT_EXPR + only, if overflow is defined and not trapping. + (negate_expr): Likewise. + +2006-06-07 Zdenek Dvorak + + PR tree-optimization/27872 + * tree-ssa-loop-manip.c (tree_unroll_loop): Set EDGE_IRREDUCIBLE_LOOP + flag on the new exit edge of the unrolled loop. + +2006-06-07 Zdenek Dvorak + + PR rtl-optimization/26449 + * loop-invariant.c (move_invariant_reg): Fail if force_operand fails. + +2006-06-07 Andrew MacLeod + + PR middle-end/27793 + * tree-dfa.c (referenced_vars_dup_list): New. List of duplicate + referenced_variables with matching DECL_UID's. + (find_referenced_vars): Make sure duplicate list is empty to start. + (referenced_var_p): Remove. + (referenced_var_check_and_insert): Renamed from referenced_var_insert. + Check if var is in the list, and add if needed. Update the duplicate + list if a different var is in the list with the same DECL_UID. + (add_referenced_var): Call routine to check and insert. + * tree-ssa.c (delete_tree_ssa): Clear var_ann's on duplicates. + * tree-flow.h (referenced_vars_dup_list): External declaration. + +2006-06-07 Fred Fish + + * config/mips/t-elf (MULTILIB_MATCHES): Combine two entries + into single entry. + +2006-06-07 Paolo Bonzini + + PR target/27390 + * reg-stack.c (subst_stack_regs_pat): Reorder resetting of + the imaginary and real parts of a clobbered register. + Emit insn to set the imaginary part. + +2006-06-06 Peter Lemieszewski + + * config/s390/t-tpf (LIB2ADDEH): Include unwind-dw2-fde-glibc.c + in lieu of unwind-dw2-fde.c. + +2006-06-06 Francois-Xavier Coudert + + * config/i386/mingw32.h (GOMP_SELF_SPECS): Define. + +2006-06-06 Ulrich Weigand + + PR target/27842 + * config/rs6000/altivec.md (UNSPEC_VSLW): Remove. + ("altivec_vspltisw_v4sf", "altivec_vslw_v4sf"): Remove. + ("mulv4sf3", "absv4sf3", "negv4sf3"): Adapt users to use + V4SImode temporaries and operations instead. + +2006-06-06 Joseph S. Myers + + * config/mips/t-linux64 (tp-bit.c): Append to tp-bit.c, not + dp-bit.c. + +2006-06-06 Mike Stump + + * Makefile.in: Rename to htmldir to build_htmldir to avoid + installing during build. + +2006-06-06 Maxim Kuvyrkov + + * params.def (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS): Change default + value to 0. + * doc/invoke.texi (max-sched-extend-regions-iters): Document. + * config/ia64/ia64.c (params.h): New header. + (ia64_optimization_options): New function to adjust parameters. + * config/ia64/ia64-protos.h (ia64_optimization_options): New prototype. + * config/ia64/ia64.h (OPTIMIZATION_OPTIONS): New macro. + * config/ia64/t-ia64 (ia64.o): Add dependence from params.h . + +2006-06-05 Kazu Hirata + + * stor-layout.c (debug_rli): Fix a typo in a debug message. + +2006-06-05 Steve Ellcey + + PR target/27051 + * config/ia64/ia64.c (ia64_select_rtx_section): Check TARGET_NO_SDATA. + +2006-06-05 Dorit Nuzman + Victor Kaplansky + + PR tree-optimization/26360 + * tree-vectorizer.c (destroy_loop_vec_info): Remove (dead) pattern + stmts. + +2006-06-04 Roger Sayle + Andrew Pinski + + PR middle-end/27382 + * c-common.c (c_common_truthvalue_conversion): Explicitly check + for LABEL_DECL before calling DECL_WEAK. + + PR c/27150 + * c-typeck.c (build_binary_op): Likewise, explicitly check for + LABEL_DECL and PARM_DECL. + +2006-06-05 Joseph S. Myers + + PR c/25161 + PR c/27020 + * c-decl.c (grokdeclarator): Disallow variably modified types at + file scope. Avoid marking shared array type of constant size as + VLA. + +2006-06-04 Volker Reichelt + + PR c++/27601 + * c-common.c (fold_offsetof_1): Handle static members. + +2006-06-04 Eric Christopher + + * stor-layout.c (start_record_layout): Initialize remaining_in_alignment. + (debug_rli): Output value for remaining_in_alignment. + (update_alignment_for_field): Unconditionalize + ms_bitfield_layout_p code. Handle non-bitfield fields. Remove + extra alignment code. + (place_field): Don't realign if ms_bitfield_layout_p. Unconditionalize + ms_bitfield_layout_p code. Rewrite handling of structure fields. + * tree.h (record_layout_info_s): Remove prev_packed. + * doc/extend.texi (ms_struct): Add documentation of format. + +2006-06-04 Mark Shinwell + + * tree.h: Declare folding_initializer. + * builtins.c (fold_builtin_constant_p): Give definite answer + if folding inside an initializer. + * fold-const.c: Define folding_initializer. + (START_FOLD_INIT): Save and then set folding_initializer. + (END_FOLD_INIT): Restore folding_initializer. + +2006-06-04 Richard Guenther + + PR tree-optimization/27039 + * fold-const.c (fold_comparison): Handle pointer comparison + again for all comparison codes. Compare offsets in signed + size type. + (fold_binary): Move code from here. + +2006-06-03 Roger Sayle + + PR target/26223 + * config/i386/i386.c (construct_container): Split static issued_error + flag into issued_sse_arg_error, issued_sse_ret_error and + issued_x87_ret_error. Issue a daignostic if the x86-64 ABI + requires the use of x87 registers and the user explicitly + specified the -mno-80387 command line option. + +2006-06-02 Geoffrey Keating + + * config/rs6000/host-darwin.c (sigaltstack): Protect prototype with + HAVE_DECL_SIGALTSTACK. + (MC_FLD): New. + (segv_handler): Use MC_FLD. + * configure.ac: Check for a sigaltstack declaration. + Compute HAS_MCONTEXT_T_UNDERSCORES on Darwin. + * configure: Regenerate. + * config.in: Regenerate. + +2006-06-03 J"orn Rennecke + + PR other/27850 + * Makefile.in (stmp-fixinc): Fix typo. + +2006-06-02 Roger Sayle + + * fold-const.c (fold_unary) : Ensure folded expressions + are type correct. Clean-up. + : Likewise. Optimize creal(~z) as creal(z). + : Likewise. Optimize cimag(~z) as -cimag(z). + +2006-06-01 DJ Delorie + + * config/v850/v850.h (ASM_OUTPUT_ADDR_DIFF_ELT): Disabled the + shift, as we've disabled the "switch" insn that needs it. + +2006-06-01 Per Bothner + + Suppress extra '#1 or '#1 ' on -dD output. + * c-opts.c (finish_options): Use internal line 0 for . + * c-ppoutput.c (cb_define): Don't increment line 0. + +2006-06-01 Pete Steinmetz + + * doc/invoke.texi: Add cpu_type power6. + * config.gcc: Add cpu_type power6. + * config/rs6000/rs6000.c (rs6000_override_options): Alias power6 + to power5+ with Altivec. + * config/rs6000/aix52.h (ASM_CPU_SPEC): Add power6. + * config/rs6000/rs6000.h (ASM_CPU_SPEC): Add power6. + +2006-05-30 Anatoly Sokolov + + * config/avr/avr.h (SET_ASM_OP): Define. + +2006-06-01 Kazu Hirata + + * config/bfin/bfin.c: Fix comment typos. + +2006-06-01 Paolo Bonzini + + PR 25453 + * doc/install.texi: Document --enable-bootstrap and + --disable-bootstrap. + +2006-06-01 Paolo Bonzini + + * doc/install.texi: Document that InfoZIP can replace jar. + +2006-05-31 Roger Sayle + + * config/i386/i386.c (ix86_expand_fp_absneg_operator): When SSE + isn't available, directly generate the simpler x87 patterns without + the (use (const_int 0)). + * config/i386/i386.md (*negsf2_1): Enable pre-reload if the SSE + implementation isn't available. + (*negdf2_1): Likewise. + (*negxf2_1): XF mode negation is always done using the x87. + (*abssf2_1, *absdf2_1, *absxf2_1): Likewise^3 for fabs. + +2006-05-31 Roger Sayle + + * builtins.c (fold_builtin_cabs): Delete prototype. Require an + additional FNDECL argument. Optimize cabs(-z) and cabs(~z) as + cabs(z). + (fold_builtin_decl) : Update fold_builtin_cabs call. + +2006-05-31 Jie Zhang + + * config/bfin/bfin-protos.h (bfin_hardware_loop): Declare. + * config/bfin/bfin.c (basic-block.h): Include. + (struct machine_function): New. + (bfin_init_machine_status): New. + (override_options): Initialize init_machine_status. + (bfin_hardware_loop): New. + (MAX_LOOP_DEPTH, MAX_LOOP_LENGTH): Define. + (DEF_VEC_P (loop_info)): New. + (DEF_VEC_ALLOC_P (loop_info,heap)): New. + (struct loop_info): New. + (loop_info): New typedef. + (struct loop_work): New. + (loop_work): New typedef. + (DEF_VEC_O (loop_work)): New. + (DEF_VEC_ALLOC_O (loop_work,heap)): New. + (bfin_dump_loops): New. + (bfin_bb_in_loop): New. + (bfin_scan_loop): New. + (bfin_optimize_loop): New. + (bfin_reorg_loops): New. + (bfin_reorg): Use bfin_reorg_loops. + * config/bfin/bfin.h (FIRST_PSEUDO_REGISTER): Adjust for adding + loop registers. + (I_REGNO_P): Simplify. + (DP_REGNO_P, DPREG_P): New macros. + (REGISTER_NAMES, FIXED_REGISTERS, CALL_USED_REGISTERS, + REG_ALLOC_ORDER): Add LT0, LT1, LC0, LC1, LB0, LB1. + (enum reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): + Add LT_REGS, LC_REGS, LB_REGS. + (REG_CLASS_FROM_LETTER): Add 't' for LT_REGS, 'k' for LC_REGS, + 'l' for LB_REGS. + (REGNO_REG_CLASS): Deal with loop registers. + * config/bfin/bfin.md: Add comment for 't', 'k', 'l' constraint + letters. + (REG_LT0, REG_LT1, REG_LC0, REG_LC1, REG_LB0, REG_LB1): + New constants for loop registers. + (UNSPEC_LSETUP_END): New. + (seq_insns): New define_attr. Set it for appropriate insns. + (movsi_insn): Add alternatives for move from/to + loop count registers. + (doloop_end): New define_expand. + (loop_end): New define_insn. + (define_split for bad doloop_end): New. + (lsetup_with_autoinit): New define_insn. + (lsetup_without_autoinit): New define_insn. + (rep_movsi, rep_movhi): Clobber LT1, LC1, LB1. + * config/bfin/predicates.md (lc_register_operand): New. + (lt_register_operand): New. + (lb_register_operand): New. + (nondp_register_operand): New. + (nondp_reg_or_memory_operand): New. + * doc/md.texi: Document Blackfin new 't', 'k', 'l' constraint letters. + +2006-05-31 Jie Zhang + + * config/bfin/bfin.c (bfin_delegitimize_address): New. + (TARGET_DELEGITIMIZE_ADDRESS): Define. + +2006-05-31 Daniel Jacobowitz + + * Makefile.in (CATALOGS): Add po/ prefix. + * configure: Regenerated. + +2006-05-31 Richard Earnshaw + + PR target/27829 + * arm.c (arm_print_operand case 'S'): Validate that the operand is + a shift operand before calling shift_op. Avoid redundant call of + shift_op. + +2006-05-30 Naveen.H.S + DJ Delorie + + * config/m32c/m32c.c (m32c_expand_insv): Check that the value + we're inserting is a singlt-bit constant. + +2006-05-30 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation_1) : Cast + width to HOST_WIDE_INT to avoid comparison warnings on some targets. + +2006-05-30 Roger Sayle + + PR tree-optimization/23452 + * fold-const.c (fold_mult_zconjz): New subroutine of fold_binary, + to optimize z * conj(z) as realpart(z)^2 + imagpart(z)^2. + (fold_binary) : Call fold_mult_zconjz for integral + complex values and with -ffast-math for FP complex values. + +2006-05-30 Kazu Hirata + + * c-common.h: Remove the prototype for yyparse. + * rtl.h: Remove the prototype for init_loop. + +2006-05-30 Andreas Krebbel + + * cse.c (validate_canon_reg, cse_insn): Don't change insns without + calling recog. + +2006-05-30 Roger Sayle + + * simplify-rtx.c (simplify_binary_operation): Unfactor the shift + and rotate cases. + : Optimize (lshiftrt (clz X) C) as (eq X 0) where C is + log2(GET_MODE_BITSIZE(X)) on targets with the appropriate semantics. + +2006-05-30 Dirk Mueller + + PR c/27273 + * c-common.c (convert_and_check): Only track TREE_CONSTANT_OVERFLOW + for CONSTANT_CLASS_P expresisons. + +2006-05-30 Volker Reichelt + + PR c/27718 + * c-typeck.c (c_expr_sizeof_type): Handle invalid types. + +2006-05-30 Zdenek Dvorak + + PR tree-optimization/27779 + * tree-data-ref.c (analyze_siv_subscript_cst_affine): Use + initial_condition instead of CHREC_LEFT. + +2006-05-30 Steven Bosscher + + * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Fix type of begin_label. + * config/m32r/initfini.c (__do_global_dtors, __do_global_ctors): + Make prototypes ISO C90. + +2006-05-30 Mircea Namolaru + Leehod Baruch + + * see.c (see_analyze_one_def): Correct check. + (see_get_extension_data): Check if extension is parallel. + (see_get_extension_reg): Likewise. + +2006-05-30 Uros Bizjak + + PR target/27790 + * config/i386/i386.c (ix86_expand_int_vcond): Force cop0 + into register for (code == GTU). + +2006-05-29 Roger Sayle + + PR tree-optimization/24964 + * simplify-rtx.c (simplify_binary_operation_1): Add function comment. + : Minor clean-up. Don't convert x*-1.0 into -x if we honor + signaling NaNs. Optimize -x*-x as x*x for all float modes, and + abs(x)*abs(x) as x*x for scalar floating point modes. + +2006-05-29 Sebastian Pop + + PR middle-end/27745 + * lambda-code.c (perfect_nestify): Don't copy statements + in the inner loop: move them to the inner loop header. + +2006-05-29 Diego Novillo + + PR 26237 + * c-tree.texi: Document OpenMP directives and clauses. + +2006-05-29 Kazu Hirata + + * varasm.c (globalize_decl): Fix indentation. + +2006-05-29 Diego Novillo + + PR 26242 + * doc/passes.texi: Add documentation for pass_vrp, pass_ipa_pta, + pass_fre, pass_store_ccp, pass_copy_prop, + pass_store_copy_prop, pass_merge_phi, pass_nrv, + pass_return_slot, pass_object_size, pass_lim, + pass_linear_transform, pass_empty_loop, pass_complete_unroll, + pass_loop_prefetch and pass_stdarg. + +2005-05-29 Bernd Schmidt + + * config/bfin/bfin.opt (mfdpic): New option. + * config/bfin/t-bfin-elf (EXTRA_PARTS): Add crtbeginS.o and crtendS.o. + (EXTRA_MULTILIB_PARTS): Likewise. + (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS): Use -fpic. + (MULTILIB_OPTIONS, MULTILIB_EXCEPTIONS): Build one extra -mfdpic + multilib. + * config/bfin/elf.h (STARTFILE_SPEC): Don't link in crt0.o if -shared. + (CRT_CALL_STATIC_FUNCTION): New. + * config/bfin/uclinux.h (STARTFILE_SPEC): Don't link in crt0.o if + -shared. + (CRT_CALL_STATIC_FUNCTION): New. + * config/bfin/bfin.c (legitimize_pic_address): Now static. Handle + FD-PIC moves. + (n_pregs_to_save): PIC register doesn't need to be saved with FD-PIC. + (print_operand): Handle UNSPEC_MOVE_FDPIC and UNSPEC_FUNCDESC_GOT17M4. + (initialize_trampoline): Changed to handle FD-PIC code generation. + (expand_move): If TARGET_FDPIC, use emit_pic_move as needed. + (bfin_expand_call): Generate FD-PIC calls if TARGET_FDPIC. + (override_options): Disallow -mid-shared-library -mfdpic combination. + Can't do unaligned ops if FD-PIC. + Turn off flag_pic if trying to generate non-id-shared-library + non-fdpic code, since it's not supported. + (bfin_assemble_integer): New function. + (TARGET_ASM_INTEGER): Define. + * config/bfin/crti.s (__init, __fini): Save P3 on the stack if + __BFIN_FDPIC__. + * config/bfin/crtn.s: Restore them. + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define __BFIN_FDPIC__ + if TARGET_FDPIC. + (DRIVER_SELF_SPECS, SUBTARGET_DRIVER_SELF_SPECS, + LINK_GCC_C_SEQUENCE_SPEC, ASM_SPEC, LINK_SPEC): New macros. + (FDPIC_FPTR_REGNO, FDPIC_REGNO, OUR_FDPIC_REG): New macros. + (TRAMPOLINE_SIZE, TRAMPOLINE_TEMPLATE): Adjust for FD-PIC. + (CONDITIONAL_REGISTER_USAGE): If TARGET_FDPIC, FDPIC_REGNO is + call-used. + (enum reg_class, REG_CLASS_CONTENTS, REG_CLASS_NAMES): Add + FDPIC_REGS and FDPIC_FPTR_REGS. + (REG_CLASS_FROM_LETTER): Use 'Z' and 'Y' for them. + * config/bfin/bfin.md (UNSPEC_MOVE_FDPIC, UNSPEC_FUNCDESC_GOT17M4, + UNSPEC_VOLATILE_LOAD_FUNCDESC): New constants. + (load_funcdescsi): New pattern. + (call_symbol_fdpic, sibcall_symbol_fdpic, call_value_symbol_fdpic, + sibcall_value_symbol_fdpic, call_insn_fdpic, sibcall_insn_fdpic, + call_value_insn_fdpic, sibcall_value_insn_fdpic): New patterns. + +2006-05-29 Kazu Hirata + + * gcse.c, rtlanal.c: Remove obsolete comments associated with + loop.c. + + * config/bfin/bfin.h (PARM_BOUNDRY, STACK_BOUNDRY): Remove. + + * tree-flow.h: Remove the prototype for add_type_alias. + * tree-ssa-alias.c (add_type_alias): Remove. + +2006-05-28 Kazu Hirata + + * cfgcleanup.c, cfgexpand.c, cgraphunit.c, config/arm/arm.c, + config/fr30/fr30.md, config/i386/i386-interix.h, + config/i386/i386.c, config/i386/i386.md, config/sh/superh.h, + config/sh/superh64.h, config/v850/v850.c, df-core.c, + df-problems.c, df.h, except.c, final.c, haifa-sched.c, + lambda-code.c, libgcc2.h, omp-low.c, optabs.c, predict.c, + reload.c, tree-flow.h, tree-outof-ssa.c, tree-ssa-dce.c, + tree-ssa-pre.c, tree-vect-transform.c: Fix comment typos. + Follow spelling conventions. + * doc/invoke.texi, doc/rtl.texi, doc/tm.texi: Fix typos. + Follow spelling conventions. + +2006-05-27 Richard Guenther + + PR middle-end/27773 + * fold-const.c (fold_plusminus_mult_expr): Use fold_convert + to produce a constant of value 1 of generic type. + +2006-05-27 Dirk Mueller + + * cgraphunit.c (decide_is_function_needed): Fix wrong + PR reference. + +2006-05-26 Ulrich Weigand + + PR rtl-optimization/27661 + * reload.c (find_reloads): When reloading a VOIDmode constant + as address due to an EXTRA_MEMORY_CONSTRAINT or 'o' constraint, + use Pmode as mode of the reload register. + +2006-05-26 Eric Botcazou + + * doc/invoke.texi (Optimize Options): Document that -funit-at-a-time + is enabled at -O and above. + +2006-05-26 Steven Bosscher + + PR target/27571 + * config/alpha/alpha.c (alpha_does_function_need_gp): Skip jump + table data. + +2006-05-25 Mark Mitchell + + PR c++/20103 + * gimplify.c (gimplify_decl_expr): Do not call gimple_add_tmp_var + for anonymous variables explicitly declared by front ends. + +2006-05-25 Eric Botcazou + + * tree-ssa-structalias.h (PTR_IS_REF_ALL): New macro. + (struct alias_info): Add new field ref_all_symbol_mem_tag. + * tree-ssa-alias.c (compute_may_aliases): If the program contains + ref-all pointers, run a finalization pass for them. + (compute_flow_insensitive_aliasing): Skip ref-all pointers. + (finalize_ref_all_pointers): New function. + (is_escape_site): Return ESCAPE_BAD_CAST for conversion from a + regular pointer type to a ref-all pointer type. + (get_tmt_for): Return the special memory tag for ref-all pointers. + +2006-05-25 Richard Guenther + + PR middle-end/27743 + * fold-const.c (fold_binary): Do not look at the stripped + op0 for (a OP c1) OP c2 to a OP (c1+c2) shift optimization. + +2006-05-25 Eric Botcazou + + * tree-vrp.c (extract_range_from_assert): Set the range to VARYING + for LT and GT if the computed range is effectively empty. + +2006-05-24 John David Anglin + + PR target/27627 + * pa/pa-modes.def: Use mips_single_format, mips_double_format and + mips_quad_format formats instead of ieee_single_format, + ieee_double_format and ieee_quad_format formats, respectively. + +2006-05-24 Zdenek Dvorak + + PR tree-optimization/27639 + PR tree-optimization/26719 + * tree-vrp.c (adjust_range_with_scev): Use scev_direction and adjust + call to scev_probably_wraps_p. + * tree-ssa-loop-niter.c (compare_trees, convert_step_widening, + used_in_pointer_arithmetic_p, convert_step): Removed. + (nowrap_type_p): New function. + (scev_probably_wraps_p): Rewritten. + * tree-scalar-evolution.c (instantiate_parameters_1): Do not call + chrec_convert if chrec_convert_aggressive might have been used. + * tree-chrec.c (convert_affine_scev, chrec_convert_1, + scev_direction): New functions. + (chrec_convert): Changed to a wrapper over chrec_convert_1. + * tree-ssa-loop-ivopts.c (idx_find_step): Use convert_affine_scev + instead of convert_step. + * tree-flow.h (scev_probably_wraps_p): Declaration changed. + (convert_step): Declaration removed. + (convert_affine_scev, nowrap_type_p, scev_direction): Declare. + +2006-05-23 Kenneth Zadeck + + * df-core.c: Added to header comments. + * df.h (df_ru_bb_info, df_rd_bb_info, df_lr_bb_info, + df_ur_bb_info, df_urec_bb_info): Added comments. + * df-problems (df_ref_bitmap, ru, rd, lr, ur, + urec, ri problems): Fixed header comments. + (df_ru_transfer_function): Fixed in-out set dyslexia when copying + code from df_rd_transfer_function. + +2006-05-23 Richard Sandiford + + * libgcc2.c (LIBGCC2_MAX_UNITS_PER_WORD): New macro. + (LIBGCC2_UNITS_PER_WORD): Use LIBGCC2_MAX_UNITS_PER_WORD rather than + MIN_UNITS_PER_WORD to set the default. Also use it in the guard. + +2006-05-23 Joseph Myers + + * expr.c (undefined_operand_subword_p): New. + (emit_move_multi_word): Do not generate move from undefined bits + of a paradoxical subreg. + +2006-05-23 Richard Sandiford + + PR rtl-optimization/27736 + * combine.c (replaced_rhs_value): New variable. + (combine_instructions): Set it. + (distribute_notes): When distributing a note in replaced_rhs_insn, + check whether the value was used in replaced_rhs_value. + +2006-05-23 Andrew MacLeod + + PR c++/26757 + * tree-ssa-loop-im.c (determine_invariantness_stmt): Use + add_referenced_var instead of add_referenced_tmp_var. + * tree-complex.c (create_one_component_var): Use add_referenced_var. + * tree-ssa-loop-manip.c (create_iv, tree_unroll_loop): Use + add_referenced_var. + * tree-tailcall.c (adjust_accumulator_values, adjust_return_value, + tree_optimize_tail_calls_1): Use add_referenced_var. + * tree-ssa-loop-ivopts.c (create_new_iv): Use add_referenced_var. + * tree-ssa-alias.c (create_memory_tag, create_global_var, create_sft): + Use add_referenced_var. + * tree-if-conv.c (ifc_temp_var): Use add_referenced_var. + * gimplify.c (force_gimple_operand): Use add_referenced_var. + * tree-ssa-phiopt.c (conditional_replacement, abs_replacement): + Use add_referenced_var. + * tree-dfa.c (struct walk_state): Remove. + (find_referenced_vars): Remove walk state and vars_found hash table. + (make_rename_temp): Use add_referenced_var. + (find_vars_r): Pass less parameters to add_referenced_var. + (referenced_var_p): New. Is var in referenced_var hash table. + (referenced_var_insert): Assert var isn't already in hash table. + (add_referenced_var): Don't need walk_state parameter. Add var if it + isn't already in the hash table. + (add_referenced_tmp_var): Remove. + (find_new_referenced_vars_1): Use add_referenced_var. + * tree-ssa-pre.c (create_expression_by_pieces, + insert_into_preds_of_block, insert_extra_phis, realify_fake_stores): + Use add_referenced_var. + * tree-vect-patterns.c (vect_pattern_recog_1): Use add_referenced_var. + * lambda-code.c (lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, perfect_nestify): Use + add_referenced_var. + * tree-vect-transform.c (vect_create_addr_base_for_vector_ref, + vect_create_data_ref_ptr, vect_create_destination_var, + vect_init_vector, vect_build_loop_niters, + vect_generate_tmps_on_preheader, vect_update_ivs_after_vectorizer, + vect_gen_niters_for_prolog_loop, vect_create_cond_for_align_checks): + Use add_referenced_var. + * tree-outof-ssa.c (create_temp): Use add_referenced_var. + * tree-flow.h (add_referenced_tmp_var): Remove prototype + (add_referenced_var): Add prototype. + * tree-ssa-structalias.c (get_constraint_for, + intra_create_variable_infos): Use add_referenced_var. + +2006-05-23 Alexandre Oliva + + * simplify-rtx.c (simplify_subreg): Adjust REG_OFFSET for + big-endian paradoxical subregs. + * var-tracking.c (struct micro_operation_def): Document that, + for modify micro operations, insn is the subsequent instruction. + (var_reg_delete_and_set, var_mem_delete_and_set): Split into... + (var_reg_set, var_mem_set): ... new functions. + (add_stores): Record subsequent insn. + (compute_bb_dataflow): Use new functions for MO_USE. + (emit_notes_in_bb): Use new functions for MO_USE. Emit use + notes after the insn, and modify notes before the insn known + to be the subsequent one. + (vt_initialize): Invert sorting of MO_CLOBBERs and MO_SETs. + +2006-05-23 Kazu Hirata + + PR target/27696 + * config/i386/i386.c (ix86_expand_builtin): Use + gen_sse3_monitor64 for TARGET_64BIT. + +2006-05-22 Kenneth Zadeck + + PR rtl-optimization/26375 + PR rtl-optimization/26855 + * df-problems (df_ru_bb_local_compute_process_def): Removed update + to gen set. + (df_ru_bb_local_compute): Reversed statements and removed bogus + comment explaining why they should be in wrong order. + (df_ru_dump, df_rd_dump): Enhanced debug info. + * modulo-sched.c (sms_schedule, tree_opt_pass pass_sms): Enhanced + debug info. + * ddg.c (add_deps_for_def): Converted use of reaching defs to + reaching uses and fixed space problem. + +2006-05-23 Jan Hubicka + + * cgraphunit.c (decide_is_function_needed): Also nested functions + and functions declared inline can be optimized out at -O0. + +2006-05-22 Gerald Pfeifer + + * doc/install.texi (Configuration): Remove reference to CrossGCC + FAQ which was gone. + (Building): Ditto. + +2006-05-22 Kazu Hirata + + PR target/27266 + * config/i386/i386.c (ix86_expand_branch): Jump to simple if + ix86_compare_emitted is non-NULL. + +2006-05-22 Volker Reichelt + + PR c++/27451 + * stmt.c (expand_asm_operands): Skip asm statement with erroneous + clobbers. + +2006-05-22 Richard Sandiford + + PR rtl-optimization/25514 + * combine.c (replaced_rhs_insn): New variable. + (combine_instructions): Set replaced_rhs_insn when trying to replace + a SET_SRC with a REG_EQUAL note. + (distribute_notes): Use replaced_rhs_insn when determining the live + range of a REG_DEAD register. + +2006-18-05 Joerg Wunsch + Anatoly Sokolov + + * config/avr/avr.c (avr_mcu_types): Add support for attiny261, + attiny461, attiny861, attiny25, attiny45, attiny85, attiny24, + attiny44, attiny84, at90pwm2, at90pwm3, atmega165p, atmega169p, + atmega164p, atmega324p, atmega644p, atmega644, atmega329, + atmega3290, atmega649, atmega6490, atmega406, atmega640, + atmega1280, atmega1281, at90can32, at90can64, at90usb646, + at90usb647, at90usb1286 and at90usb1287 devices. + * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.). + * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.). + +2006-05-22 Richard Sandiford + + * mklibgcc.in (lib2funcs): Remove _floatdidf from initial assignment. + +2006-05-22 Richard Guenther + + Revert + 2006-01-31 Richard Guenther + Paolo Bonzini + + * doc/install.texi (--disable-libgcc-math): Document. + +2006-05-22 Richard Guenther + + Revert + 2006-01-31 Richard Guenther + + * doc/invoke.texi (-msselibm): Document. + * target.h (expand_library_builtin): New target hook. + * builtins.c (expand_builtin): Use expand_library_builtin. + (default_expand_library_builtin): New function. + * gcc.c (LINK_GCC_MATH_SPEC): Define. + (LINK_COMMAND_SPEC): Handle %(link_gcc_math). + (link_gcc_math_spec): Declare. + (static_specs): Add link_gcc_math_spec. + * expr.h (default_expand_library_builtin): Declare. + * target-def.h (TARGET_EXPAND_LIBRARY_BUILTIN): Define. + (TARGET_INITIALIZER): Add TARGET_EXPAND_LIBRARY_BUILTIN. + * config/i386/i386.h: Provide LINK_GCC_MATH_SPEC. + * config/i386/i386.opt (msselibm): New target option. + * config/i386/i386.c (ix86_builtin_function_variants): New array. + (ix86_init_sse_abi_builtins): New function. + (ix86_expand_library_builtin): Likewise. + (TARGET_EXPAND_LIBRARY_BUILTIN): Define. + (override_options): Handle error conditions wrt -msselibm. + (ix86_builtins): Add function codes for SSE2 ABI builtins. + (ix86_init_builtins): Call ix86_init_sse_abi_builtins. + * doc/extend.texi (__builtin_sse2_*): Document new target specific + builtins. + +2006-05-22 Volker Reichelt + + PR c/27420 + * c-common.c (self_promoting_args_p): Skip erroneous args. + + PR c/26818 + * c-decl.c (finish_struct): Skip erroneous fields. + +2006-05-22 Nick Clifton + + * config/cris/cris.opt (march): Remove VarExists attribute. + (max-stackframe=): Likewise. + +2006-05-22 Kazu Hirata + + * doc/rtl.texi: Fix a typo. + * see.c: Fix comment typos. + + * tree-ssa-structalias.h (alias_info): Remove num_references. + +2006-05-21 Mike Stump + + * config/darwin-c.c (BAD): Conditionalize on OPT_Wpragmas. + (BAD2): Add. + (darwin_pragma_options): Use BAD instead. + (darwin_pragma_unused): Likewise. + (darwin_pragma_ms_struct): Likewise. + +2006-05-21 David Edelsohn + + * config/rs6000/rs6000.md (floatsitf2): Remove constraints. + +2006-05-21 Kazu Hirata + + PR rtl-optimization/27671 + * simplify-rtx.c (simplify_relational_operation_1): Fix + simplifications of (eq/ne (xor x y) y) and + (eq/ne (xor x y) x). + + PR tree-optimization/26622. + * fold-const.c (fold_ternary) : Call fold_convert + on arg1. + +2006-05-21 Bernhard Fischer + + * tree-cfg.c: Prune whitespace. + (debug_tree_cfg): Point to correct header containing the + TDF_* defines. + +2006-05-21 Bernhard Fischer + + PR middle-end/25776 + * cgraphunit.c (verify_cgraph_node): Typo in error message. + +2006-05-20 Andrew Pinski + + PR middle-end/25776 + * cgraphunit.c (cgraph_optimize): Don't run ipa passes if error + or sorry count is non zero. + +2006-05-20 Andreas Schwab + + * config/pa/pa-linux.h (STRING_ASM_OP): Prepend and append a tab. + +2006-05-19 Daniel Berlin + Kenneth Zadeck + + PR rtl-optimization/26855 + + * df-scan.c (mw_reg_pool, mw_link_pool): New allocation pools for + multiword refs. + (df_scan_alloc): Added code to properly handle multiword hard + registers and add all_blocks parameter. + (df_scan_free_internal, df_insn_refs_delete, df_ref_record): Added + code to properly handle multiword hard registers. + (df_rescan_blocks): Added code to remove deleted blocks from + bitmap. + (df_ref_create_structure, df_ref_record): Added code to properly + handle subregs. + (df_ref_record_1): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER + and set DF_REF_PARTIAL. + (df_defs_record): Changed DF_REF_CLOBBER into DF_REF_MUST_CLOBBER. + (df_uses_record): Added DF_REF_PARTIAL for subreg. + (df_scan_add_problem): Added flags parameter. + (df_ref_create_structure): Changed switching structure. + (df_bb_refs_record): Fixed case where duplicate artificial refs + were created. Changed location of flags. + (df_record_entry_block_defs): Added code to make stack pointer + live in entry block. Refined cases where frame pointer is needed. + Changed location of flags. + (df_record_exit_block_uses, df_insn_refs_record): Changed location of flags. + (df_set_state): Removed function. + (df_grow_reg_info, df_reg_chain_unlink, df_ref_remove, + df_insn_create_insn_record, df_insn_refs_delete, + df_ref_create_structure): Formatting changes. + * df-core.c (df_mvs_dump, df_set_flags, df_clear_flags, + df_delete_basic_block): New function. + (df_init): Changed location of flags. + (df_add_problem): Added flags parameter and the way flags are + processed. + (df_insn_uid_debug, df_ref_debug, debug_df_defno, debug_df_ref, + debug_df_chain): Improved debugging output. + (df_insn_debug, df_insn_uid_debug): Added multiword reg support. + (df_refs_chain_dump): Removed df parameter. + (df_iterative_dataflow): Added consistency check. + (df_prune_to_subcfg): Made public. + (df_analyze_problem): Added blocks_to_init parameter and made + public. + (df_ref_record, df_bb_refs_record, df_mark_reg, + df_record_exit_block_uses): Whitespace changes. + (df_dump): Whitespace changes. + * df.h: Some reordering to remove forward references. + (df_ref_flags.DF_REF_MW_HARDREG, DF_REF_PARTIAL, + DF_REF_MUST_CLOBBER, DF_REF_MAY_CLOBBER): New fields. + (df_ref_flags.DF_REF_CLOBBER): Deleted field. + (dataflow.flags): New field. + (df.flag): Deleted field. + (df_alloc_function): Added additional bitmap parameter. + (df_dependent_problem_function): New type. + (df_problem.changeable_flags): New field. + (df_ref_flags.DF_REF_DIES_AFTER_THIS_USE, DF_SCAN_INITIAL, + DF_SCAN_GLOBAL, DF_SCAN_POST_ALLOC, df_state): Removed. + (df_mw_hardreg): New struct. + (DF_INSN_UID_MWS): New macro. + (df_refs_chain_dump, df_ref_debug, df_chain_dump): Removed df + parameter. + (df_add_problem, df_ru_add_problem, df_rd_add_problem, + df_lr_add_problem, df_ur_add_problem, df_urec_add_problem, + df_ri_add_problem, df_scan_add_problem): Added flags parameter. + (df_set_state): Removed function. + (df_set_flags, df_clear_flags, df_delete_basic_block) New functions. + * df-problems.c (df_chain_dump): Removed df parameter. + (df_ru_alloc, df_rd_alloc, df_lr_alloc, df_ur_alloc, + df_urec_alloc, df_chain_alloc, df_ri_alloc): Added all blocks + parameter. + (df_ru_alloc, df_rd_alloc): Now resets all blocks. + (df_rd_bb_local_compute_process_def, df_ur_bb_local_compute, + df_chain_create_bb, df_create_unused_note, df_ri_bb_compute): + Split DF_REF_CLOBBER into DF_REF_MAY_CLOBBER and + DF_REF_MUST_CLOBBER cases. + (df_ru_bb_local_compute_process_def, + df_rd_bb_local_compute_process_def, df_lr_bb_local_compute, + df_lr_bb_local_compute, df_ur_bb_local_compute, + df_chain_create_bb): Made subreg aware. + (df_ru_bb_local_compute, df_rd_bb_local_compute, + df_lr_bb_local_compute, df_lr_bb_local_compute, + df_chain_create_bb): Cleanup to use proper macros. + (df_ur_local_finalize, df_urec_local_finalize): Removed unnecessary + code to fixup bitvectors. + (df_ri_alloc): Cleared lifetime. + (df_ignore_stack_reg, df_kill_notes, df_set_notes_for_mw, + df_create_unused_note): New function. + (df_ri_bb_compute, df_ri_compute): Added code to create/update + REG_DEAD and REG_UNUSED notes as well as register information. + (df_ru_dump, df_rd_dump, df_lr_dump, df_ur_dump, df_urec_dump, + df_chains_dump): Fixed crash if problem was never run. + (df_ru_add_problem, df_rd_add_problem, df_lr_add_problem, + df_ur_add_problem, df_urec_add_problem, df_chain_add_problem, + df_ri_add_problem): Processes flags in uniform manner. + (df_ru_alloc, df_ru_local_compute, df_ru_confluence_n, df_ru_free, + df_ru_dump, df_rd_local_compute, df_rd_confluence_n, df_rd_free, + df_rd_dump, df_urec_free_bb_info): Formatting changes. + (df_ru_free_bb_info, df_ru_bb_local_compute, df_ru_dump, + df_rd_free_bb_info, df_rd_bb_local_compute_process_def, + df_rd_bb_local_compute, df_rd_dump, df_lr_free_bb_info, + df_lr_bb_local_compute, df_lr_local_compute, df_ur_free_bb_info, + df_ur_dump, df_urec_free_bb_info, df_urec_dump, + df_chain_create_bb, df_ri_bb_compute): Whitespace changes. + * modulo-sched.c (sms_schedule): Added flag parameter to calls. + * see.c (see_initialize_data): Ditto. + * final.c (rest_of_clean_state) Added regstack_completed. + * rtl.h (regstack_completed): Ditto. + * reg-stack.c (regstack_completed): Ditto. + +2006-05-19 Mike Stump + + * c-tree.h (default_conversion): Remove. + * c-common.h (default_conversion): Add. + +2006-05-19 Zdenek Dvorak + + * tree-vrp.c (valid_value_p): New function. + (adjust_range_with_scev): Fail if the value of bound is not + simple. + +2006-05-19 Richard Sandiford + + * config/mips/linux-unwind.h: Include + (mips_fallback_frame_state): Use syscall numbers to determine + the appropriate li instruction for the current ABI. Only use + __NR_sigreturn for o32. + +2006-05-19 Nicolas Setton + + * langhooks.h (struct lang_hooks): Add dwarf_name language hook. + * langhooks.c (lhd_dwarf_name): New function. + * langhooks-def.h (lhd_dwarf_name): Declare. + (LANG_HOOKS_DWARF_NAME): New macro, defaults to lhd_dwarf_name. + * dwarf2out.c (dwarf2_name): Use the dwarf_name language hook. + +2006-05-19 Richard Sandiford + + * libgcc2.c (MIN_UNITS_PER_WORD): Move default definition from + libgcc2.h. + (LIBGCC2_UNITS_PER_WORD): Provide default definition, using old + MIN_UNITS_PER_WORD logic from libgcc2.h. Do nothing if + LIBGCC2_UNITS_PER_WORD > MIN_UNITS_PER_WORD. + * libgcc2.h (MIN_UNITS_PER_WORD): Remove definition from here. + Use LIBGCC2_UNITS_PER_WORD rather than MIN_UNITS_PER_WORD to + determine the size of Wtype, etc. + * mklibgcc.in (LIB2_SIDITI_CONV_FUNCS): New argument. + (swfloatfuncs): New variable. + (dwfloatfuncs): Likewise. + (lib2funcs): Remove floating-point conversion functions from + initial assignment. Use LIB2_SIDITI_CONV_FUNCS to determine + the set of conversion routines needed. Allow entries to specify + an object name, filename and word size. Update users accordingly. + * Makefile.in (libgcc.mk): Pass LIB2_SIDITI_CONV_FUNCS. + * config/mips/t-mips (LIB2_SIDITI_CONV_FUNCS): Define. + + Revert: + + 2006-02-08 Roger Sayle + + PR target/22209 + * config/fixtfdi.c: New libgcc source file. + * config/fixunstfdi.c: New source file. + * config/floatditf.c: New source file. + * config/floatunditf.c: New souce file. + * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Include the new source + files above instead of config/mips/_tilib.c. + * config/mips/t-linux64 (LIB2FUNCS_EXTRA): Likewise. + +2006-05-18 John David Anglin + + * pa/t-hpux-shlib (SHLIB_LINK): Remove `-lc'. + * pa/pa-hpux11.h (LIB_SPEC): Update comment. + +2006-05-18 Mike Stump + + Fix up vla, vm and [*] sematics. + + PR c/18740 + PR c/7948 + PR c/25802 + PR c/27673 + * c-tree.h (struct c_arg_info): Add had_vla_unspec. + (c_vla_unspec_p): Add. + (c_vla_type_p): Add. + * c-decl.c (struct c_scope): Add had_vla_unspec. + (build_array_declarator): Add support for [*]. + (grokdeclarator): Likewise. + (grokparms): Likewise. + (get_parm_info): Likewise. + * c-objc-common.c (c_vla_unspec_p): Likewise. + * c-objc-common.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Likewise. + * c-parser.c (c_parser_typeof_specifier): Evaluate arguments to + typeof when argument is a variably modified type not inside sizeof or alignof. + (c_parser_direct_declarator_inner): Propagate errors. + (c_parser_sizeof_expression): Add support for [*]. + (c_parser_parms_declarator): Initialize had_vla_unspec. + (c_parser_parms_list_declarator): Likewise. + * c-typeck.c (c_vla_type_p): Add. + (composite_type): Add support for vla compositing. + (comptypes_internal): Add support for vla compatibility. + (c_expr_sizeof_expr): Evaluate vla arguments. + * tree.c (variably_modified_type_p): Update comment for [*]. + +2006-05-18 Michael Matz + + PR target/27599 + * config.host: Make assignments to host_xmake_file cumulative. + * config.host (*-darwin*): Test $host, not $target. + +2006-05-12 Stuart Hastings + + * config/i386/i386.opt (-mstackrealign): New flag. + * config/i386/i386.c (force_align_arg_pointer): New attribute. + (ix86_handle_cconv_attribute): Emit error when + force_align_arg_pointer attribute collides with too many regparms. + (ix86_function_regparm): Limit regparms when used with + force_align_arg_pointer attribute. (ix86_internal_arg_pointer): + Support stack-realigning prologue in non-main functions. Emit + warning for nested functions under -mstackrealign, emit error for + nested functions with force_align_arg_pointer attribute. + * doc/extend.texi (force_align_arg_pointer): Document it. + * doc/invoke.texi (-mstackrealign): Document it. + +2006-05-17 Kazu Hirata + + PR rtl-optimization/27477 + * combine.c (try_combine): Don't split a parallel consisting + of two sets into two individual sets if both sets reference + cc0. + +2006-05-17 H.J. Lu + + * config/arm/arm.opt (target_fpe_name): Remove VarExists. + * config/rs6000/rs6000.opt (TARGET_NO_FP_IN_TOC): Likewise. + + * doc/options.texi (VarExists): Updated. + +2006-05-17 John David Anglin + + * unwind-dw2.c: Add declarations for uw_update_context and + uw_frame_state_for. + * pa/hpux-unwind.h (pa_fallback_frame_state): When an export stub is + detected, advance frame state and context once to skip over stub. + +2006-05-17 Sebastian Pop + + PR middle-end/20256 + PR middle-end/26435 + * tree-loop-linear.c (linear_transform_loops): Don't test perfect_nest_p. + Call rewrite_into_loop_closed_ssa only when something changed. + * lambda.h (gcc_loopnest_to_lambda_loopnest): Update declaration. + * lambda-code.c (can_convert_to_perfect_nest): Declared. + (gcc_loopnest_to_lambda_loopnest): Removed need_perfect_nest parameter. + Test for perfect_nest_p here. Fix formating. + (replace_uses_equiv_to_x_with_y): Fix formating. + (stmt_uses_op): Removed. + (can_convert_to_perfect_nest): Removed loopivs parameter. + Complete the test by checking the scalar dependences. + (perfect_nestify): Remove the test for can_convert_to_perfect_nest. + Fix formating. + +2005-05-17 Bernd Schmidt + + PR bootstrap/22541 + From Dan Kegel : + * Makefile.in: Strip "dir/../" combinations from SYSTEM_INCLUDE_DIR. + +2006-05-17 Eric Botcazou + + * tree.c (variably_modified_type_p) : Return true + if the element type is variably modified without recursing. + +2006-05-17 Sebastian Pop + + PR middle-end/27332 + * tree-loop-linear.c (try_interchange_loops): Test for + no data dependences. + +2006-05-17 Zdenek Dvorak + + PR tree-optimization/27548 + * tree-scalar-evolution.c (scev_const_prop): Do not prolong life + range of ssa names that appear on abnormal edges. + * tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Export. + * tree-flow.h (contains_abnormal_ssa_name_p): Declare. + +2005-05-17 Bernd Schmidt + + PR middle-end/27620 + * expr.c (safe_from_p): Handle CONSTRUCTOR again. + +2006-05-17 Jakub Jelinek + + PR middle-end/27415 + * tree.h (OMP_PARALLEL_COMBINED): Define. + * gimplify.c (struct gimplify_omp_ctx): Add is_combined_parallel field. + (new_omp_context): Add is_combined_parallel argument. + (gimplify_scan_omp_clauses): Add in_combined_parallel argument, adjust + new_omp_context caller. + (gimplify_omp_parallel, gimplify_omp_for, gimplify_omp_workshare): + Adjust gimplify_scan_omp_clauses callers. + (omp_is_private): Issue errors if iteration variable is firstprivate + or reduction in the current context. + * c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED + on combined parallel workshare constructs. + +2006-05-16 H.J. Lu + + * Makefile.in (GCC_OBJS): Replace options.o with gcc-options.o. + (gcc-options.o): New rule. + + * optc-gen.awk: Protect variables for gcc-options.o with + #ifdef GCC_DRIVER/#endif. + +2006-05-16 Daniel Berlin + + Fix PR tree-optimization/27373 + * tree-ssa-forwprop.c: (forward_propagate_addr_expr_1): Add argument. + (forward_propagate_addr_expr): Update call. + +2006-05-16 H.J. Lu + + * doc/options.texi: Move the Negative option. + +2006-05-16 Richard Guenther + + PR tree-optimization/22303 + * tree-ssa-ccp.c (fold_const_aggregate_ref): Handle reads + from STRING_CSTs. + (evaluate_stmt): Fall back to fold_const_aggregate_ref, if + ccp_fold did not simplify the statement. + +2006-05-16 H.J. Lu + + PR driver/26885 + * Makefile.in (GCC_OBJS): New. + (OBJS-common): Add opts-common.o. + (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS). + (cpp$(exeext)): Likewise. + (gcc.o): Also depend on opts.h. + (opts-common.o): New. + + * common.opt (gcoff): Add Negative(gdwarf-2). + (gdwarf-2): Add Negative(gstabs). + (gstabs): Add Negative(gstabs+). + (gstabs+): Add Negative(gvms). + (gvms): Add Negative(gxcoff). + (gxcoff): Add Negative(gxcoff+). + (gxcoff+): Add Negative(gcoff). + * config/i386/i386.opt (m32): Add Negative(m64). + (m64): Add Negative(m32). + + * doc/options.texi: Document the Negative option. + + * gcc.c: Include "opts.h". + (main): Call prune_options after expandargv. + + * optc-gen.awk: Generate common declarations for all flag + variables in options.c. Output the neg_index field. + + * opts.c (find_opt): Moved to ... + * opts-common.c: Here. New file. + + * opts.h (cl_option): Add a neg_index field. + (find_opt): New. + (prune_options): Likewise. + +2006-05-16 Jakub Jelinek + + PR middle-end/27573 + * omp-low.c (expand_omp_parallel): Don't assert + .OMP_DATA_I = &.OMP_DATA_O is the first statement in the block, + instead search for it. + + PR c/27499 + * gimplify.c (gimplify_omp_for): Remove assertion that iteration var + is signed. + +2006-05-16 Andreas Schwab + + * doc/tm.texi (TARGET_LIBGCC_SDATA_SECTION): Add missing @end + defmac. + +2006-05-15 Roger Sayle + + PR target/26600 + * config/i386/i386.c (legitimate_constant_p) : TImode + integer constants other than zero are only legitimate on TARGET_64BIT. + Only zero vectors are legitimate. + (ix86_cannot_force_const_mem): Integral and vector constants can + always be put in the constant pool. + +2006-05-16 DJ Delorie + + * crtstuff.c (__dso_handle): Set section from + TARGET_LBIGCC_SDATA_SECTION if defined. + * doc/tm.texi (TARGET_LIBGCC_SDATA_SECTION): Document. + * config/mips/mips.h (TARGET_LIBGCC_SDATA_SECTION): Define. + +2006-05-16 Danny Smith + + PR target/27599 + * config.host (i[34567]86-*-mingw*): Append i386/x-mingw32 to + host_xmake_file. + +2006-05-16 Ben Elliston + + * tree-cfg.c (split_edge_bb_loc): Remove unused variable `src'. + +2006-05-15 Per Bothner + + * tree.c: (last_annotated_node): Use source_locus typedef. + This permits bootstrapping with --enable-mapped-location. + +2006-05-15 Zdenek Dvorak + + PR tree-optimization/26830 + * tree-into-ssa.c (struct ssa_name_info): Add age field. + (info_for_ssa_name, current_info_for_ssa_name_age, + blocks_to_update): New variables. + (get_ssa_name_ann): Use info_for_ssa_name instead of SSA_NAME_AUX. + (clear_ssa_name_info, initialize_flags_in_bb, + mark_block_for_update): New functions. + (mark_def_sites, rewrite_stmt): Assert that blocks_to_update is NULL. + (insert_phi_nodes_for, mark_use_interesting, prepare_block_for_update, + prepare_def_site_for): Use mark_block_for_update. + (mark_def_interesting): Assert that the processed block is marked in + blocks_to_update. Do not take blocks argument. + (prepare_use_sites_for, prepare_names_to_update): Do not take blocks + argument. + (rewrite_update_init_block, rewrite_update_stmt): Only process + blocks with statements to rewrite. + (delete_update_ssa): Do not clear SSA_NAME_AUX. + (update_ssa): Initialize and free blocks_to_update. Do not + clear flags on statements. Do not use blocks bitmap. + * tree.h (SSA_NAME_AUX): Removed. + (struct tree_ssa_name): Removed aux field. + * print-tree.c (print_node): Do not print SSA_NAME_AUX. + +2006-05-15 Richard Guenther + + PR tree-optimization/27603 + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): + Do computations in original type. + +2006-05-15 Mircea Namolaru + + * see.c: Code style changes such as redundant paranthesis, + redundant intialization of local variables etc. + (see_main): Declared now as static. + * doc/invoke.texi: Update that -fsee is not enabled by + default at -O3. + +2006-05-15 Jakub Jelinek + + * omp-low.c (check_omp_nesting_restrictions): New function. + (scan_omp_1): Call it. + + PR middle-end/27416 + * omp-low.c (build_outer_var_ref): If VAR is reference in orphaned + construct, return *VAR. + +2006-05-14 Kaz Kojima + + PR rtl-optimization/27406 + * bt-load.c (migrate_btr_def): Skip the block having abnormal + edges. + +2006-05-14 Roger Sayle + + PR rtl-optimization/27538 + * combine.c (expand_compound_operation): Call gen_lowpart + before calling simplify_shift_const. + +2006-05-14 Roger Sayle + + PR rtl-optimization/22563 + * expmed.c (store_fixed_bit_field): When using AND and IOR to store + a fixed width bitfield, always force the intermediates into psuedos. + +2006-05-14 Bernhard Fischer + + PR 27501 + * mkconfig.sh: Use operator = instead of == for test. + +2006-05-13 Nick Clifton + + * dwarf2out.c (dbx_reg_number): Check return value from + LEAF_REG_REMAP and only use it if it is valid. + (multiple_reg_loc_descriptor): Likewise. + +2006-05-13 Richard Guenther + + * config.host : Append i386/x-cygwin to + host_xmake_file. + +2006-05-13 Steven Bosscher + + * df-core.c (df_bb_regno_last_use_find): Do not look for dataflow + information attached to non-INSNs such as NOTEs. + (df_bb_regno_first_def_find, df_bb_regno_last_def_find): Likewise. + +2006-05-12 Andreas Krebbel + + * config/s390/s390.c (s390_const_ok_for_constraint_p): Disallow -4G for + On contraint. + * config/s390/s390.md: Adjust comment describing On constraint. + +2006-05-11 Jan Hubicka + + * cgraphunit.c (decide_is_function_needed): Don't force always_inline + to be output at -O0. + +2006-05-11 Volker Reichelt + + PR middle-end/27384 + * fold-const.c (size_binop): Move sanity check for arguments to + the beginning of the function. + + PR middle-end/27488 + * fold-const.c (tree_expr_nonnegative_p): Return early on invalid + expression. + +2006-05-11 Richard Guenther + + PR middle-end/27529 + * fold-const.c (fold_unary): Handle intermediate conversion + to a pointer type like intermediate conversion to an integer + type in folding of (T1)(T2)var to var. + Match the code to the comment in the final conversion for + (T1)(T2)var to (T1)var regarding to type precision. Rather + than disallow T1 being of pointer type, assert that both T1 + and var are of pointer type or not. Make sure not to fall + over the frontends lazyness wrt array to pointer decay though. + +2006-05-10 Richard Earnshaw + + * arm.c (arm_struct_value_rtx): Delete. + (TARGET_STRUCT_VALUE_RTX): Use the default definition. + (arm_init_cumulative_args): Always initialize nregs to zero. + +2006-05-10 Richard Guenther + + PR tree-optimization/27532 + * tree-object-size.c (plus_expr_object_size): Fix typo. + +2006-05-10 Kazu Hirata + + PR target/24949 + * config/m68k/m68k.md (ashrdi_const32, ashrdi_const32_mem, + ashrdi_const, ashrdi3): Use a scratch register. + +2006-05-10 Richard Guenther + + PR tree-optimization/27302 + * fold-const.c (operand_equal_p): For two comparisons, + try comparison of one comparison code swapped if that yields + the same code. + +2006-05-10 Ben Elliston + + * tree-pretty-print.c (pretty_print_string): No need to handle + '\0' as a special character. + + * tree.h: Include "hashtab.h". + (iterative_hash_expr): Use hashval_t in its prototype. + * Makefile.in (TREE_H): Add $(HASHTAB_H). + +2006-05-09 Steve Ellcey + + PR bootstrap/26872 + * config.gcc (hppa[12]*-*-hpux10*): Set gas to yes. + (hppa*64*-*-hpux11*): Ditto. + (hppa[12]*-*-hpux11*): Ditto. + +2006-05-09 David Edelsohn + + PR target/26545 + * config/rs6000/aix41.h (TARGET_64BIT): Define. + +2006-05-09 Michael Matz + + * config.host (): Set + host_extra_gcc_objs and host_xmake_file. + (<*-*-linux*>): Don't overwrite host_xmake_file. + * gcc.c (static_spec_functions): Add EXTRA_SPEC_FUNCTIONS. + * config/i386/i386.h (EXTRA_SPEC_FUNCTIONS): Define. + (host_detect_local_cpu): Declare. + (CC1_CPU_SPEC): Add -march=native and -mtune=native cases. + * config/i386/i386.c (override_options): Handle -mtune=native + as -mtune=generic. + * config/i386/x-i386: New file. + * config/i386/driver-i386.c: New file. + * doc/invoke.texi (): Describe + cpu-type "native". + +2006-05-09 Dirk Mueller + Richard Guenther + + PR middle-end/27498 + * fold-const.c (fold_read_from_constant_string): Relax check + for matching types to matching modes. + +2006-05-09 Zdenek Dvorak + + PR rtl-optimization/27335 + * loop-unroll.c (peel_loops_completely): Use loops->parray to walk the + loops. + +2006-05-08 Chao-ying Fu + Richard Sandiford + + * config/mips/mips-ps-3d.md (scc_ps, s_ps): New patterns. + (vcondv2sf, sminv2sf3, smaxv2sf3): Likewise. + * config/mips/mips.md (UNSPEC_SCC): New constant. + * config/mips/mips-protos.h (mips_expand_vcondv2sf): Declare. + * config/mips/mips.c (mips_reverse_fp_cond_p): New function. + (mips_emit_compare): Use it. + (mips_expand_vcondv2sf): New function. + +2006-05-08 Daniel Berlin + + Fix PR tree-optimization/27093 + * tree-ssa-alias.c (recalculate_used_alone): Mark variables for + renaming when they become not-used_alone. + +2006-05-08 John David Anglin + + * hpux-unwind.h (pa_fallback_frame_state): Handle return parameter + relocation and relocation stubs. + +2006-05-08 Eric Christopher + + * unwind-dw2-fde-darwin.c (examine_objects): Only check data + section for ppc. + +2006-05-08 Jan Hubicka + + PR middle-end/24561 + * cgraphunit.c (decide_is_function_needed): When not optimizing even + unused static functions are needed. + +2006-05-08 Roger Sayle + + PR target/27158 + * reload.c (find_reloads_toplev): Only return the simplified SUBREG + of a reg_equiv_constant if the result is a legitimate constant. + +2006-05-08 Uros Bizjak + + PR target/27277 + * config/i386/i386.c (ix86_rtx_costs) [FLOAT_EXTEND]: For + standard 80387 constants, raise the cost to prevent + compress_float_constant() to generate load from memory. + +2006-05-08 Kazu Hirata + + * config/arm/constraints.md (c): Fix a typo. + + * see.c, tree-flow-inline.h, tree-phinodes.c: Fix comment + typos. + +2006-05-07 H.J. Lu + + PR target/24879 + * config/i386/pmmintrin.h (_mm_monitor): Remove macro. Use + inline function. + (_mm_mwait): Likewise. + + * config/i386/sse.md (sse3_mwait): Replace "mwait\t%0, %1" with + "mwait". + (sse3_monitor): Make it 32bit only. + (sse3_monitor64): New. 64bit monitor. + +2006-05-07 Volker Reichelt + + PR target/27421 + * config/i386/i386.c (classify_argument): Skip fields with invalid + types. + +2006-05-07 Richard Guenther + + PR tree-optimization/27409 + * tree-ssa-structalias.c (get_constraint_for_component_ref): + Do not try to find zero-sized subvars. + +2006-05-07 Richard Guenther + + PR tree-optimization/27136 + * tree-ssa-loop-niter.c (get_val_for): Correct function + comment, assert requirements. + (loop_niter_by_eval): Stop processing if the iterated + value did not simplify. + +2006-05-07 Mircea Namolaru + + * opts.c (flag_see): remove its setting at -O3. + +2006-05-07 Richard Earnshaw + + * genpeep.c (main): Make insn-peep.c depend on flags.h. + * arm/constraints.md: New file. + * arm.h (REG_CLASS_FROM_LETTER_P): Delete. + (CONST_OK_FOR_ARM_LETTER, CONST_OK_FOR_THUMB_LETTER) + (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_ARM_LETTER) + (CONST_DOUBLE_OK_FOR_LETTER_P, EXTRA_CONSTRAINT_STR_ARM) + (CONSTRAINT_LEN, EXTRA_CONSTRAINT_THUMB, EXTRA_CONSTRAINT_STR) + (EXTRA_MEMORY_CONSTRAINT): Likewise. + * arm.md: Include constraints.md. + (thumb_movsi_insn): Use satisfies_constraint_J. + (movhi, movqi): Use satisfies_constraint_I. + +2006-04-29 Anatoly Sokolov + + * config/avr/avr.h (CRT_BINUTILS_SPECS): Fixed crt* file name + for atmeg a645 device. + +2006-05-06 Richard Guenther + + PR tree-optimization/27151 + * tree-vect-transform.c (vectorizable_condition): Punt on + values that have a different type than the condition. + +2006-05-03 Aldy Hernandez + + PR/21391 + * c-parser.c (c_parser_cast_expression): Only insert casts into + hash table if pointer. + * function.c (used_types_insert_helper): Rename from + used_types_insert. + (used_types_insert): Call used_types_insert_helper. + * function.h (used_types_insert): Accept only one argument. + +2006-05-05 David Edelsohn + + * config/rs6000/rs6000.md: Mark all "X" constraints for clobbered + scratch with output modifier. + +2006-05-04 David Edelsohn + + PR target/26481 + * config/rs6000/rs6000.md (stmsi_power): Mark clobber constraint + with output modifier. + +2006-05-04 Richard Sandiford + + PR target/26765 + * config/mips/mips.c (mips_symbolic_address_p): Return true + for SYMBOL_TLSGD, SYMBOL_TLSLDM, SYMBOL_DTPREL, SYMBOL_TPREL, + SYMBOL_GOTTPREL, and SYMBOL_TLS. + +2006-05-04 Richard Guenther + + PR tree-optimization/14287 + PR tree-optimization/14844 + PR tree-optimization/19792 + PR tree-optimization/21608 + PR tree-optimization/27090 + * tree-ssa-pre.c (try_combine_conversion): New function. + (compute_avail): After constructing the value-handle + expression, use try_combine_conversion to combine NOP_EXPRs + with previous value-handle expressions and use the result if it + is available. + +2006-05-04 Joseph S. Myers + + * config/mips/linux64.h (DWARF_OFFSET_SIZE): Remove. + +2006-05-04 Jan Hubicka + + PR middle-end/25962 + * cgraphunit.c (verify_cgraph_node): Fix cgraph_hash testing. + +2006-05-04 Bernd Schmidt + + * config/bfin/predicates.md (const01_rtx): Tell generator programs + that this only matches CONST_INTs. All users changed to VOIDmode + operands. + + * config/bfin/bfin.c: Include "optabs.h". + (bfin_rtx_costs): Some costs for vector operations, to allow combine + to do more work. + (enum bfin_builtins): Add a number of fractional and vector builtins. + (bfin_init_builtins): Likewise. + (struct builtin_description, bdesc_2arg, bdesc_1arg): New. + (safe_vector_operand, bfin_expand_binop_builtin, + bfin_expand_unop_builtin): New functions. + (bfin_expand_builtin): Handle the new builtins. + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): Define + __ADSPBLACKFIN__. + +2006-05-04 Leehod Baruch + + * see.c: New file. + * Makefile.in (OBJS-common): Add see.o. + (see.o): Add dependencies. + * common.opt (fsee): New flag for the see optimization was added. + * opts.c (flag_see): Initialized. + * passes.c (init_optimization_passes, pass_see): New pass. + * rtl.h (see_main): Declaration as extern. + * timevar.def (TV_SEE): New. + * tree-pass.h (pass_see): Declaration as extern. + * invoke.texi (-fsee): Document. + * recog.c (validate_simplify_insn): New function. + * recog.h (validate_simplify_insn): Declaration as extern. + * df-problems.c (df_chain_dump): Check for NULL. + +2006-05-04 Kenneth Zadeck + Daniel Berlin + + * cfgrtl.c (insert_insn_bb_end_new): New function. + * basic-block.h (insert_insn_bb_end_new): Declaration as extern. + +2006-05-04 Leehod Baruch + + * df.h (struct web_entry): Moved from web.c. + (union_defs): Declaration as extern. + (unionfind_root): Likewise. + (unionfind_union): Likewise. + * web.c (struct web_entry): Moved to df.h. + (unionfind_root): Remove static declaration. + (unionfind_union): Likewise. + (union_defs): Likewise and generalize to use callback function. + (web_main): Update arguments for union_defs function call. + +2006-05-04 Richard Guenther + + PR tree-optimization/26447 + * tree-ssa-pre.c (realify_fake_stores): For necessary loads + produce SSA_NAME copies before the store stmt to avoid + breaking exception handling. + +2006-05-04 Jakub Jelinek + + PR middle-end/27388 + * gimplify.c (omp_is_private): If var is shared in some outer context, + return false instead of true. Stop searching on parallel context + boundary. + +2006-05-03 Alexandre Oliva + + PR java/8260 + * coverage.c: Use get_gcov_unsigned_t() instead of + unsigned_type_node all over. + +2006-05-02 Andrew MacLeod + + PR tree-optimization/27381 + * tree-phinodes.c (remove_phi_arg_num): When moving a phi argument, + maintain the same immediate_use links. + * tree-ssa-operands.c (dump_immediate_uses_for): Show iteration marker + node rather than segfaulting. + +2006-05-03 Jakub Jelinek + + PR fortran/27395 + * gimplify.c (gimplify_scan_omp_clauses): Compare OMP_CLAUSE_CODE + rather than TREE_CODE to OMP_CLAUSE_REDUCTION. Set also GOVD_SEEN + bit for OMP_CLAUSE_REDUCTION_PLACEHOLDER. + +2006-05-02 Daniel Berlin + + Fix PR tree-optimization/26626 + * tree-ssa-structalias.c (compute_points_to_sets): For now, solve + always. + * tree-ssa-operands.c (access_can_touch_variable): Allow + typecasting through union pointers. + +2006-05-02 Jakub Jelinek + + PR c++/26943 + * omp-low.c (maybe_lookup_decl_in_outer_ctx): New function. + (build_outer_var_ref): Use maybe_lookup_decl_in_outer_ctx + to find if var will be a global variable even in the nested context. + (omp_copy_decl): Only check for global variable at the end, it might + be overridden in outer contexts. + (scan_sharing_clauses): For global variables don't create a field. + (lower_rec_input_clauses): Do nothing for global shared variables. + Emit a barrier at the end of ILIST if there were any decls in both + firstprivate and lastprivate clauses. + (lower_send_clauses): Do nothing for global variables except for + COPYIN. + +2006-05-02 Zdenek Dvorak + + * tree.c (unsigned_type_for, signed_type_for): Make sure a type + of the correct signedness is returned. + +2006-05-02 Jeff Law + + PR tree-optimization/27364 + * tree-vrp.c (vrp_int_const_binop): Fix detection of overflow from + multiply expressions. + +2006-05-02 Tom Tromey + + * tree-flow-inline.h (op_iter_init_phiuse): Fixed typo. + +2006-05-02 Kazu Hirata + + PR target/27387 + * arm.c (arm_output_mi_thunk): Use pc-relative addressing when + -mthumb -fPIC are used. + +2006-05-02 Stanislaw Skowronek + Joshua Kinard + + PR target/25871 + * config/mips/mips.h (TRAMPOLINE_TEMPLATE): Avoid 32-bit moves + with 64-bit pointers. + +2006-05-02 Paul Brook + + * config/arm/arm.c (add_minipool_forward_ref): Check if insn + and pool overlap. + (create_fix_barrier): Check that a suitable barrier location is + found. + (arm_reorg): Include ftmp->address in allowable range of addresses. + +2006-05-02 David Billinghurst + + PR ada/27366 + * ada/env.c (__gnat_clearenv): Use unsetenv() to clear environment + on Cygwin. + +2006-05-02 Jakub Jelinek + + PR middle-end/27337 + * gimplify.c (gimplify_scan_omp_clauses): Handle INDIRECT_REF + around RESULT_DECL for result passed by reference. + (gimplify_expr): Call omp_notice_variable when RESULT_DECL is seen. + * omp-low.c (use_pointer_for_field): Don't look at + DECL_HAS_VALUE_EXPR_P for RESULT_DECLs. + (scan_omp_1): Call remap_decl on RESULT_DECLs. + (lower_rec_input_clauses): Don't allocate VLA memory for the second + time or var for passing by reference for + OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses. Allow creation of + TREE_ADDRESSABLE variables when passing by reference. + + * omp-low.c (dump_omp_region): Fix output formatting. + + PR middle-end/27328 + * omp-low.c (remove_exit_barrier): Handle NULL exit_bb. + (expand_omp_parallel): Likewise. + * tree-cfg.c (move_sese_region_to_fn): Likewise. + + PR middle-end/27325 + * omp-low.c (lower_omp_sections): Call maybe_catch_exception + on statement list containing also constructors and destructors. + (lower_omp_single, lower_omp_for, lower_omp_parallel): Likewise. + + PR middle-end/27310 + * except.c (duplicate_eh_regions): Fix clearing of + cfun->eh->region_array entries. + +2006-05-01 DJ Delorie + + * configure.ac (gcc_cv_nm): Don't use an in-tree nm if + build!=host. + (gcc_cv_objdump): Likewise. + * configure: Regenerated. + +2006-05-01 Kazu Hirata + + PR target/27374 + * config/arm/vfp.md (*arm_movdi_vfp): Correct the output + templates for case 3 and 4. + +2006-05-01 DJ Delorie + + * vec.c: Include bconfig.h when appropriate. + * Makefile.in (build/vec.o): Adjust dependencies. + * mkconfig.sh: Make sure config.h isn't used for build machine + compiles. + +2006-05-01 Zdenek Dvorak + + * tree-into-ssa.c (phis_to_rewrite, blocks_with_phis_to_rewrite): New + variables. + (mark_phi_for_rewrite): New function. + (insert_phi_nodes_for, mark_use_interesting): Call + mark_phi_for_rewrite. + (rewrite_update_phi_arguments): Traverse only phis in phis_to_rewrite. + (update_ssa): Initialize and free phis_to_rewrite. + +2006-05-01 Zdenek Dvorak + + PR rtl-optimization/27291 + * loop-doloop.c (add_test, doloop_modify): Handle the case condition is + folded to a constant. + +2006-05-01 Zdenek Dvorak + + PR tree-optimization/27283 + * tree-ssa-loop-ivopts.c (struct nfe_cache_elt): Store just trees, + not whole # of iteration descriptions. + (niter_for_exit): Return just # of iterations. Fail if # of iterations + uses abnormal ssa name. + (niter_for_single_dom_exit): Ditto. + (find_induction_variables, may_eliminate_iv): Expect niter_for_exit to + return just the number of iterations. + +2006-05-01 Zdenek Dvorak + + PR tree-optimization/27144 + * tree-ssa-loop-niter.c (derive_constant_upper_bound): New function. + (record_estimate): Only record constant upper bound. + (infer_loop_bounds_from_undefined): Call + compute_estimated_nb_iterations just once. + (proved_non_wrapping_p): Renamed to ... + (n_of_executions_at_most): ... this. Expect bound to be a constant. + (convert_step_widening, scev_probably_wraps_p): Call + n_of_executions_at_most instead of proved_non_wrapping_p. + (substitute_in_loop_info): Do not replace values in bounds. + * cfgloop.h (struct nb_iter_bound): Remove "additional" field. Update + comments. + +2006-05-01 Richard Henderson + + PR c/27358 + * c-parser.c (c_parser_skip_to_end_of_block_or_statement): Move after + c_parser_skip_to_pragma_eol. Convert to switch statement. Handle + CPP_PRAGMA. + +2006-05-01 Roger Sayle + + * c-typeck.c (parser_build_binary_op): Don't call the function + unsigned_conversion_warning to spot operand/result type overflow. + (build_binary_op): Instead, call convert_and_check instead of + convert to report the problem when the operands are promoted. + * c-common.c (unsigned_conversion_warning): Make static. + * c-common.h (unsigned_conversion_warning): Delete prototype. + +2006-05-01 Richard Guenther + + PR tree-optimization/26726 + * tree-ssa-loop-ivopts.c (idx_find_step): Mark source of the + problem ... + (find_interesting_uses_address): ... we work around here + by folding INDIRECT_REFs in the substituted base. + +2006-05-01 Diego Novillo + + * omp-low.c (dump_omp_region): Add newlines. + +2006-04-30 Roger Sayle + + * common.opt (Woverflow): New command line option. + * c-common.c (constant_expression_warning): Check warn_overflow. + (overflow_waring): Pass OPT_Woverflow to warning. + (unsigned_conversion_warning): Likewise. + (convert_and_check): Likewise. + * doc/invoke.texi: Document new command line option. + +2006-04-30 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_override_options): Enable + TARGET_NO_FP_IN_TOC for section anchors. + (optimization_options): Enable section anchors for all + non-"Objective" languages. + +2006-04-28 Eric Christopher + + * config/darwin-c.c (darwin_ms_struct): Move this + (darwin_set_default_type_attributes): and this... + * config/darwin.c: ... here. + * config/darwin.h (darwin_ms_struct): Declare. + +2006-04-28 Andrew MacLeod + + * tree-ssa-dom.c (propagate_rhs_into_lhs): Fix assert clause. + +2006-04-28 Roger Sayle + + PR c/25309 + * c-typeck.c (struct spelling): Make I an unsigned HOST_WIDE_INT. + (push_array_bounds): Delete prototype. Change BOUNDS argument to + an unsigned HOST_WIDE_INT. + (print_spelling): Use HOST_WIDE_INT_PRINT_UNSIGNED to output the + array index. + (really_start_incremental_init): No need to call convert because + bitsize_zero_node is already of type bitsizetype. + (push_init_level): Extract the value of constructor_index as an + unsigned HOST_WIDE_INT quantity, using tree_low_cst. + (process_init_element): Likewise. + +2006-04-28 Joseph S. Myers + + * gcc.c (process_command): Add program name to GCC_EXEC_PREFIX + value before passing to make_relative_prefix. + +2006-04-28 Alan Modra + + PR middle-end/27260 + * builtins.c (expand_builtin_memset): Expand val in original mode. + +2006-04-27 Eric Christopher + + * target-def.h (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Bracket + with #ifndef/#endif. + * config/darwin-c.c (darwin_ms_struct): New. + (darwin_pragma_ms_struct): Ditto. + (darwin_set_default_type_attributes): Ditto. + * config/darwin-protos.h (darwin_pragma_ms_struct): Declare. + * config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): + Register ms_struct pragma. + * config/i386/darwin.h (REGISTER_TARGET_PRAGMAS): Declare. + (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Ditto. + * config/rs6000/rs6000.c (rs6000_set_default_type_attributes): Call + darwin_set_default_type_attributes if TARGET_MACHO. + +2006-04-27 Andrew MacLeod + + PR tree-optimization/26854 + * tree-vrp.c (remove_range_assertions): Use new Immuse iterator. + * doc/tree-ssa.texi: Update immuse iterator documentation. + * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Use new iterator. + * tree-ssa-dom.c (propagate_rhs_into_lhs): Use new iterator. + * tree-flow-inline.h (end_safe_imm_use_traverse, end_safe_imm_use_p, + first_safe_imm_use, next_safe_imm_use): Remove. + (end_imm_use_stmt_p): New. Check for end of immuse stmt traversal. + (end_imm_use_stmt_traverse): New. Terminate immuse stmt traversal. + (move_use_after_head): New. Helper function to sort immuses in a stmt. + (link_use_stmts_after): New. Link all immuses in a stmt consescutively. + (first_imm_use_stmt): New. Get first stmt in an immuse list. + (next_imm_use_stmt): New. Get next stmt in an immuse list. + (first_imm_use_on_stmt): New. Get first immuse on a stmt. + (end_imm_use_on_stmt_p): New. Check for end of immuses on a stmt. + (next_imm_use_on_stmt): New. Move to next immuse on a stmt. + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Use new iterator. + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use new iterator. + (perfect_nestify): Use new iterator. + * tree-vect-transform.c (vect_create_epilog_for_reduction): Use new + iterator. + * tree-flow.h (struct immediate_use_iterator_d): Add comments. + (next_imm_name): New field in struct immediate_use_iterator_d. + (FOR_EACH_IMM_USE_SAFE, BREAK_FROM_SAFE_IMM_USE): Remove. + (FOR_EACH_IMM_USE_STMT, BREAK_FROM_IMM_USE_STMT, + FOR_EACH_IMM_USE_ON_STMT): New immediate use iterator macros. + * tree-cfg.c (replace_uses_by): Use new iterator. + * tree-ssa-threadedge.c (lhs_of_dominating_assert): Use new iterator. + * tree-ssa-operands.c (correct_use_link): Remove. + (finalize_ssa_use_ops): No longer call correct_use_link. + +2006-04-27 Stuart Hastings + + * config/rs6000/t-darwin (DARWIN_EXTRA_CRT_BUILD_CFLAGS): New. + * config/t-darwin (crt3.o): Use it. + * config/rs6000/rs6000.c (rs6000_initialize_trampoline): Remove + 'pmode', use Pmode instead of SImode for SYMBOL_REF. + * config/rs6000/rs6000.md (call_indirect_nonlocal_sysv, + call_nonlocal_sysv, call_value_indirect_nonlocal_sysv, + call_value_nonlocal_sysv): Suffix with the "P" macro for 32/64 + support. + +2006-04-27 Roger Sayle + + * expmed.c (store_fixed_bit_field): If we're not optimizing for + size, force the intermediate into a new pseudo rather instead of + performing both a bitwise AND and a bitwise IOR in memory. + +2006-04-27 Richard Guenther + + PR rtl-optimization/26685 + * params.def (PARAM_MAX_CSE_INSNS): Correct typo that named + this one "max-flow-memory-locations". + +2006-04-27 Richard Guenther + + PR tree-optimization/25148 + * tree-vrp.c (compare_values): Remove code dealing with + comparisons against type min/max value. Honour overflow + and negative constants in code dealing with comparisons + of plus and minus expressions. + (value_inside_range): Use fold_binary with LE_EXPR and + GE_EXPR rather than compare_values. + +2006-04-27 Dirk Mueller + + * config/i386/xmmintrin.h (_mm_shuffle_pi16): Declare + prototype for SSE. + +2006-04-26 Kenneth Zadeck + + * basic-block.h (safe_insert_insn_on_edge): Removed. + * cfgrtl.c (mark_killed_regs, safe_insert_insn_on_edge): Removed. + +2006-04-26 David Edelsohn + Paolo Bonzini + + PR middle-end/27282 + * combine.c (simplify_and_const_int_1): Use gen_int_mode. + (simplify_and_const_int): Same. + +2006-04-26 Aldy Hernandez + + * tree-ssa-dse.c (dse_optimize_stmt): Remove unused variable USE. + +2006-04-26 Jakub Jelinek + + PR c/26171 + * cgraph.c (cgraph_varpool_finalize_decl): Don't call + cgraph_varpool_assemble_pending_decls if -fopenmp, unless + cgraph_global_info_ready. + + PR middle-end/26913 + * tree-cfg.c (find_outermost_region_in_block): Handle RESX_EXPR. + + PR c/25996 + * c-parser.c (c_parser_omp_for_loop): Don't call c_finish_omp_for if + either decl or init is error_mark_node. + + PR middle-end/25989 + * tree-flow.h (struct omp_region): Add sched_kind. + * omp-low.c (expand_parallel_call): Use region->inner->sched_kind + instead of extracting omp for data. + (expand_omp_for): Save extracted sched_kind. + +2006-04-25 Roger Sayle + + * expmed.c (store_bit_field): Also check whether the bitsize is + valid for the machine's "insv" instruction before moving the + target into a pseudo for use with the insv. + * config/i386/predicates.md (const8_operand): New predicate. + * config/i386/i386.md (extv, extzv, insv): Use the new + const8_operand predicate where appropriate. + +2006-04-25 DJ Delorie + + * doc/install.texi (Specific): Clarify that this is not a list of + supported hosts or targets. + +2006-04-25 Richard Sandiford + + PR rtl-optimization/26725 + * cfgrtl.c (rtl_redirect_edge_and_branch_force): Set the source + block's BB_DIRTY flag. + +2006-04-25 Geoffrey Keating + + * dwarf2out.c (size_of_locs): Don't fill dw_loc_addr if there + are no branches. + + * dwarf2asm.c (dw2_asm_output_data): Don't generate RTL just + to print an integer. + +2006-04-25 David Edelsohn + + * varasm.c (align_variable): New function. + (get_block_for_decl): Apply align_variable to DECL before + calculating section information. + (assemble_variable): Split out alignment computation. + +2006-04-25 Andreas Krebbel + + * expmed.c (store_bit_field): Handle paradoxical subregs on big endian + machines. + +2006-04-25 Bernd Schmidt + + * genmodes.c (make_vector_mode): Allow making VECTOR_MODE_INT of a + MODE_PARTIAL_INT mode. + * config/bfin/bfin-modes.def: Add V2PDI and V2SI. + * config/bfin/bfin.c (print_operand): Add macflag and mac/msu modifiers + for CONST_INTs. + (hard_regno_mode_ok): V2PDImode is ok for accumulators. + * config/bfin/bfin.h (CLASS_MAX_NREGS, HARD_REGNO_NREGS): Handle + V2PDImode. + * config/bfin/predicates.md (const01_operand, vec_shift_operand): + New predicates. + * config/bfin/bfin.md (UNSPEC_MUL_WITH_FLAG, UNSPEC_MAC_WITH_FLAG): + New constants. + (MACFLAG_NONE, MACFLAG_T, MACFLAG_FU, MACFLAG_TFU, MACFLAG_IS, + MACFLAG_IU, MACFLAG_W32, MACFLAG_M, MACFLAG_S2RND, MACFLAG_ISS2, + MACFLAG_IH): Likewise. + (movstricthi_1): Renamed from "*movstricthi". + (load_accumulator, load_accumulator_pair, movsi_insv, insv, + ssaddsi3, sssubsi3, ssnegsi2, signbitssi2, smaxhi3, sminhi3, + abshi2, neghi2, ssneghi2, signbitshi2, movhi_low2high, + movhi_high2high, movhi_low2low, movhi_high2low, movhiv2hi_low, + movhiv2hi_high, composev2hi, movv2hi_hi, movv2hi_hi_low, + movv2hi_hi_high, ssaddhi3, sssubhi3, ssaddv2hi3, sssubv2hi3, + addsubv2hi3, subaddv2hi3, ssaddsubv2hi3, sssubaddv2hi3, + sublohiv2hi3, subhilov2hi3, sssublohiv2hi3, sssubhilov2hi3, + addlohiv2hi3, addhilov2hi3, ssaddlohiv2hi3, ssaddhilov2hi3, + mulhisi_ll, mulhisi_lh, mulhisi_hl, mulhisi_hh, ssnegv2hi2, + ssashiftv2hi3, ssashifthi3, lshiftv2hi3, lshifthi3, packv2hi, + flag_mulhi, flag_mulhisi_parts, flag_machi, flag_machi_acconly, + flag_macinithi, flag_macinit1hi, flag_mulv2hi, flag_mulv2hi_parts, + flag_macv2hi_parts, flag_macv2hi_parts_acconly, + flag_macinitv2hi_parts, flag_macinit1v2hi_parts): New patterns. + + * doc/rtl.texi (ss_ashift): Improve wording. + +2006-04-24 Geoffrey Keating + + * dwarf2out.c (verify_marks_clear): New. + (prune_unused_types): Call verify_marks_clear initially, not + prune_unmark_dies. + +2006-04-24 Bernd Schmidt + + * rtl.def (SS_ASHIFT, SS_NEG): New codes. + * doc/rtl.texi: Document them. + * simplify-rtx.c (simplify_unary_operation, + simplify_binary_operation_1): Don't abort when we see them. + +2006-04-24 Mark Mitchell + + Revert: + 2006-04-23 Mark Mitchell + * configure.ac: Completely disregard languages that are not + enabled. + * configure: Regenerated. + +2006-04-24 Andrew Pinski + Richard Guenther + + PR tree-optimization/27236 + * tree-inline.c (copy_body_r): Make sure to copy + TREE_THIS_VOLATILE flag. + +2006-04-24 Richard Guenther + + PR middle-end/26869 + * tree-complex.c (update_parameter_components): Don't handle + unused parameters which have no default def. + +2006-04-24 Andrew Pinski + Richard Guenther + + PR tree-optimization/27218 + * tree-inline.c (expand_call_inline): Strip useless type + conversions for the return slot address. + +2006-04-24 Richard Guenther + + * cfgloop.h (struct loops): Remove unused field array. Reorder + state after num. + (LOOP_PREFETCH): Remove. + +2006-04-24 Richard Guenther + + PR tree-optimization/22525 + * value-prof.c (tree_mod_pow2): Remove unnecessary temporary + variable, adjust types of generated expressions. + +2006-04-23 H.J. Lu + + * Makefile.in (c-convert.o): Add dependency on $(TARGET_H) + (tree-vect-patterns.o): Likewise. + (jump.o): Likewise. + (cselib.o): Likewise. + (loop-doloop.o): Likewise. + (regclass.o): Likewise. + (reload1.o): Likewise. + (explow.o): Replace target.h with $(TARGET_H). + (ipa-prop.o): Likewise. + (ipa-cp.o): Likewise. + (ipa-inline.o): Likewise. + (reorg.o): Likewise. + (reg-stack.o): Likewise. + +2006-04-23 Eric Botcazou + + * tree-tailcall.c (pass_tail_recursion): Use gate_tail_calls too. + +2006-04-23 Mark Mitchell + + * print-tree.c (print_node): Print DECL_BIT_FIELD_TYPE. + + * configure.ac: Completely disregard languages that are not + enabled. + * configure: Regenerated. + + PR c++/26534 + * c-common.h (c_build_bitfield_integer_type): Declare. + * c-decl.c (c_build_bitfield_integer_type): Move to ... + * c-common.c (c_build_bitfield_integer_type): ... here. + +2006-04-23 Roger Sayle + + PR target/21283 + * config/fr30/fr30.md (define_split): Avoid calling gen_lowpart on + a SImode SUBREG of a floating point register after no_new_pseudos. + +2006-04-23 Roger Sayle + + * config/fr30/fr30.md (addsi_small_int): Use REGNO_PTR_FRAME_P to + identify potentially eliminable registers to additionally catch + VIRTUAL_INCOMING_ARGS_REGNUM. + (addsi3): Update the conditions on when to use addsi_small_int. + +2006-04-23 Roger Sayle + + PR target/16641 + * config/fr30/fr30.h (GO_IF_LEGITIMATE_ADDRESS): Check REGNO for + STACK_POINTER_RTX and FRAME_POINTER_RTX instead of comparing the + rtx to stack_pointer_rtx or frame_pointer_rtx directly. + +2006-04-23 Eric Botcazou + + * fold-const.c (range_predecessor): Use operand_equal_p + as the predicate for equality. + (range_successor): Likewise. + +2006-04-22 Kazu Hirata + + Revert: + * config/soft-fp/op-common.h: Fix a typo. + +2006-04-22 Frank Ch. Eigler + + PR libmudflap/26864 + * common.opt (flag_mudflap_threads): Overload flag_mudflap. + * tree-mudflap.c (flag_mudflap_threads): Derive from flag_mudflap. + +2006-04-22 Kazu Hirata + + * config/soft-fp/op-common.h, double-int.h, tree-ssa-dom.c: + Fix comment typos. + * doc/tm.texi: Fix a typo. + +2006-04-21 Geoffrey Keating + + * dwarf2out.c (struct die_struct): Document that die_sib makes + a circular linked list. + (FOR_EACH_CHILD): New. + (reverse_die_lists): Delete. + (reverse_all_dies): Delete. + (add_dwarf_attr): Correct documentation. + (remove_child_with_prev): New. + (remove_child_TAG): Update for change to die_struct, use + remove_child_with_prev. + (add_child_die): Update for change to die_struct. + (splice_child_die): Use remove_child_with_prev and add_child_die. + (print_die): Use FOR_EACH_CHILD. + (die_checksum): Likewise. + (assign_symbol_names): Likewise. + (output_location_lists): Likewise. + (build_abbrev_table): Likewise. + (calc_die_sizes): Likewise. + (mark_dies): Likewise. + (unmark_dies): Likewise. + (unmark_all_dies): Likewise. + (output_die): Likewise. + (prune_unused_types_mark): Likewise. + (prune_unused_types_walk): Likewise. + (same_die_p): Update for change to die_struct. + (break_out_includes): Likewise. + (prune_unused_types_prune): Likewise. + (add_sibling_attributes): Use FOR_EACH_CHILD, simplify logic. + (prune_unmark_dies): Use FOR_EACH_CHILD, don't clear die_mark if + it's already clear. + (dwarf2out_finish): Don't call reverse_all_dies. + +2006-04-21 Eric Christopher + + * df-core.c, tree-outof-ssa.c, config/i386/i386.c: Fix typos + in comments and function names. + +2006-04-21 Volker Reichelt + + PR c/25875 + * c-typeck.c (digest_init): Robustify. + + * c-typeck.c (pop_init_level): Simplify. + +2006-04-21 Steve Ellcey + + * config/pa/t-pa64: Add dependencies on $(GCC_PASSES). + +2006-04-21 Paul Brook + + * config/arm/arm.c (arm_override_options): Error on iWMMXt and + hardware floating point. + +2006-04-21 David Edelsohn + + * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Add sfp to + NON_FLOAT_REGS. + +2006-04-21 Nick Clifton + + * config/sh/t-elf (EXTRA_MULTILIB_PARTS): Include + OPT_EXTRA_PARTS. + +2006-04-21 Alan Modra + + PR target/27230 + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Use + C++ lang type in traceback table for Objective-C++. + + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Update comment. + +2006-04-20 H.J. Lu + + * config/i386/i386.c (asm_preferred_eh_data_format): Reformat. + +2006-04-20 Volker Reichelt + + PR mudflap/26789 + * tree-mudflap.c (mudflap_finish_file): Skip function when there + were errors. Remove check for erroneous objects. + +2006-04-20 Jeff Law + + PR tree-optimization/26854 + * tree-ssa-dse.c (dse_optimize_stmt): Avoid num_imm_uses when + checking for zero or one use. + * tree-ssa-dom.c (propagate_rhs_into_lhs): Similarly. + * tree-cfgcleanup.c (merge_phi_nodes): Similarly. + * tree-ssa-reassoc.c (negate_value): Similarly. + (reassociate_bb): Similarly. + +2006-04-20 Jakub Jelinek + + * c-pretty-print.c (pp_c_direct_abstract_declarator): Print + TYPE_MAX_VALUE (TYPE_DOMAIN (t)) + 1 for ARRAY_TYPE rather + than plain TYPE_MAX_VALUE (TYPE_DOMAIN (t)). + +2006-04-20 Alan Modra + + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Consume all + fp regs if the last fp arg doesn't fit in regs. + +2006-04-20 Kaz Kojima + + PR target/27182 + * config/sh/sh.md (movsicc_true+3): Tweak condition for the case + that the last insn has the REG_INC note. + +2006-04-19 Carlos O'Donell + Nathan Sidwell + + PR c/26774 + * stor-layout.c (update_alignment_for_field): Do not align + ERROR_MARK nodes. + (place_union_field): Place union field at the start of the union. + (place_field): Move ERROR_MARK check later, and use the current + allocation position to maintain monotonicity. + +2006-04-19 Zdenek Dvorak + + * dominance.c: Include timevar.h. + (calculate_dominance_info): Use TV_DOMINANCE. + * timevar.def (TV_DOMINANCE): New timevar. + * Makefile.in (dominance.o): Add TIMEVAR_H dependency. + +2006-04-19 Andreas Krebbel + + PR rtl-optimization/14261 + * ifcvt.c (noce_emit_move_insn): Call store_bit_field if the resulting + move would be an INSV insn. + (noce_process_if_block): Don't optimize if the destination is a + ZERO_EXTRACT which can't be handled by noce_emit_move_insn. + +2006-04-19 Andreas Krebbel + + * config/s390/s390.md: Add comments with the instructions emitted + by an insn pattern if macros are used. + +2006-04-19 Alan Modra + + PR rtl-optimization/26026 + * fold-const.c (fold_binary): Optimize div and mod where the divisor + is a known power of two shifted left a variable amount. + +2006-04-18 Geoffrey Keating + + * dwarf2out.c (prune_unused_types_update_strings): Don't add strings + to hash table twice when the debug_str section has SECTION_MERGE. + +2006-04-18 Joseph S. Myers + + * config/soft-fp: New directory. From glibc. + * config/soft-fp/t-softfp: New. + * config/soft-fp/README: New. + * mklibgcc.in: Handle LIB2FUNCS_EXCLUDE. + * Makefile.in (LIB2FUNCS_EXCLUDE, SFP_MACHINE): New. + (libgcc.mk): Pass LIB2FUNCS_EXCLUDE. + (LIBGCC_DEPS): Add $(SFP_MACHINE). + * config.gcc: Use rs6000/t-fprules-fpbit or + rs6000/t-fprules-softfp and soft-fp/t-softfp together with + rs6000/t-fprules. + * config/rs6000/sfp-machine.h: New. Based on glibc. + * config/rs6000/t-fprules-fpbit, config/rs6000/t-fprules-softfp: + New. + * config/rs6000/t-fprules: Remove fp-bit rules. + * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA): Use +=. + * config/rs6000/t-linux64: Likewise. Remove duplicates from + LIB2FUNCS_EXTRA. Remove fp-bit rules. + (softfp_wrap_start, softfp_wrap_end): New. + +2006-04-18 DJ Delorie + + * config/m32c/m32c.h (PTRDIFF_TYPE): Define. + +2006-04-18 Devang Patel + + * doc/invoke.texi (-Wuninitialized): Clarify -O connection. + +2006-04-18 Nick Clifton + + * config/sh/t-symbian: Add rule to build sh-c.o + * config/sh/symbian.c (sh_symbian_mark_dllexport): Replace use + of DECL_NON_ADDR_CONST_P with DECL_DLLIMPORT_P. + (sh_symbian_encode_section_info): Likewise. + +2006-04-18 Andreas Krebbel + + * builtins.c (expand_builtin_strcmp): Cover label definition of + do_libcall with HAVE_cmpstrnsi. + +2006-04-18 Kazu Hirata + + * function.c (temp_slots_at_level, max_slot_level): Use VEC + instead of VARRAY. + * function.h (temp_slot_p): New. + (function): Change the type of x_used_temp_slots to + VEC(temp_slot_p,gc) *. + +2006-04-18 Nick Clifton + + * config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove reference to + flag_strength_reduce. + + * doc/tm.texi (TARGET_SECTION_TYPE_FLAGS): Fix typo. + +2006-04-18 Paolo Bonzini + + PR target/27117 + + Partial revert of revision 112637 + 2006-04-03 Paolo Bonzini + Dale Johannesen + + PR target/19653 + * regclass.c (struct reg_pref): Update documentation. + (regclass): Set prefclass to NO_REGS if memory is the best option. + (record_reg_classes): Cope with a prefclass set to NO_REGS. + +2006-04-18 Paolo Bonzini + + PR tree-optimization/26821 + * tree-ssa-math-opts.c (get_constant_one): New. + (insert_reciprocals): Use it. + +2006-04-17 Geoffrey Keating + + * dwarf2out.c (free_AT): Delete. + (remove_AT): Update string ref counts. + (remove_child_TAG): Don't call free_die. + (free_die): Delete. + (break_out_includes): Don't call free_die on DW_TAG_GNU_BINCL + or DW_TAG_GNU_EINCL. + (prune_unused_types_walk_attribs): Reset string refcounts. + (prune_unused_types_update_strings): New. + (prune_unused_types_prune): Don't make unnecessary stores. Don't + call free_die. Do call prune_unused_types_update_strings. + (prune_unused_types): Empty debug_str_hash. + +2006-04-17 Roger Sayle + + * expr.c (expand_assignment): Optimize away no-op moves where the + source and destination are equal and have no side-effects. + +2006-04-17 Richard Guenther + + PR target/26826 + * reload.c (push_reload): Guard calls to get_secondary_mem + for memory subregs. + +2006-04-16 Kazu Hirata + + * alias.c (reg_base_value, old_reg_base_value): Change the + type to VEC(rtx,gc) *. + (REG_BASE_VALUE, find_base_value, record_set, + init_alias_analysis): Use VEC instead of VARRAY. + + * alias.c (alias_sets): Change the type to + VEC(alias_set_entry,gc) *. + (get_alias_set_entry, new_alias_set, record_alias_subset): Use + VEC instead of VARRAY. + (last_alias_set): Remove. + + * cgraph.h (cgraph_edge_p): New. + Update the prototype of cgraph_function_versioning. + * cgraphunit.c (cgraph_copy_node_for_versioning, + cgraph_function_versioning): Use VEC instead of VARRAY. + * ipa-cp.c (ipcp_insert_stage): Likewise. + +2006-04-16 Roger Sayle + + PR target/26961 + * fold-const.c (fold_ternary): When converting "A ? B : C" into either + "A op B" or "A op C", we may need to convert A to the type of B and C. + +2006-04-16 Adam Nemet + + * target.h (struct gcc_target): Add mode_rep_extended. + * rtlanal.c (num_sign_bit_copies_in_rep): New global. + (init_num_sign_bit_copies_in_rep): Initialize it using + mode_rep_extended. + (truncate_to_mode): Use it. + (init_rtlanal): Call init_num_sign_bit_copies_in_rep. + * targhooks.h (default_mode_rep_extended): Declare it. + * targhooks.c (default_mode_rep_extended): Define it. + * target-def.h (TARGET_MODE_REP_EXTENDED): New macro. Default to + default_mode_rep_extended. + (TARGET_INITIALIZER): Include it. + * doc/tm.texi (Misc): Document it. + * config/mips/mips.c (TARGET_TRUNCATED_TO_MODE): Override it. + (mips_truncated_to_mode): New function. + +2006-04-16 Roger Sayle + + PR middle-end/25474 + * expr.c (compress_float_constant): Copy the narrow constant into + a new pseudo before extending it to its final width. + +2006-04-16 Roger Sayle + Andrew Pinski + Dale Johannesen + + PR target/24076 + * config/i386/i386.c (ix86_expand_vector_init_duplicate): Add + special case code to implement V8HImode and V16QImode with SSE2. + +2006-04-15 Roger Sayle + + * config/i386/i386.c (ix86_va_start): Ensure all integer constant + trees are constructed with a suitable tree type. + +2006-04-15 Roger Sayle + + * tree.c (integer_zerop): Ignore TREE_CONSTANT_OVERFLOW. + (integer_onep): Likewise. + (integer_all_onesp): Likewise. + (integer_pow2p): Likewise. + (integer_nonzerop): Likewise. + (real_zerop): Likewise. + (real_onep): Likewise. + (real_twop): Likewise. + (real_minus_onep): Likewise. + (int_size_in_bytes): Likewise. + (host_integerp): Likewise. + +2006-04-15 Kazu Hirata + + * cfgcleanup.c, config/dfp-bit.c, expr.c, fold-const.c, + jump.c, mips-tfile.c, omp-low.c, sched-int.h, + tree-ssa-loop-prefetch.c, tree-vrp.c: Fix comment typos. + + * tree-ssa-structalias.h (alias_info): Remove num_references. + +2006-04-15 John David Anglin + + * pa.md (output_bb patterns): Shorten long branch alternatives by 4. + (output_bvb patterns): Likewise. + * pa.c (output_bb): Use 'bb' insn for long branch case. + (output_bvb): Likewise use '{bvb|bb}' for long branch case. + (output_dbra): Use '{comb|cmpb}' for long branch case for alternative + 1. Correct length operand for alternatives 1 and 2. + (output_movb): Use '{comb|cmpb}' for long branch case for alternatives + 1, 2 and 3. Correct length operand for alternatives 1, 2 and 3. + +2006-04-14 Roger Sayle + + * tree-cfg.c (make_edges, make_omp_sections_edges, move_stmt_r, + is_ctrl_altering_stmt): Reinstate RTH's changes from r112935 that + were accidentally reverted by r112959. + +2006-04-15 Jakub Jelinek + + PR middle-end/26823 + * except.h (eh_region_outermost): New prototype. + * except.c (eh_region_outermost): New function. + * tree-cfg.c (find_outermost_region_in_block): Use it. + +2006-04-14 Kazu Hirata + + * local-alloc.c (rest_of_handle_local_alloc): Use VEC instead + of VARRAY. + * reload1.c (reg_equiv_memory_loc_varray): Rename to + reg_equiv_memory_loc_vec. Change the type to VEC(rtx,gc) *. + (init_reload, reload): Use VEC instead of VARRAY. + * reload.h: Update the prototype for + reg_equiv_memory_loc_varray. + +2006-04-14 Alexey Starovoytov + Eric Botcazou + + * config/sparc/sparc.c (emit_and_preserve): Allocate space for the + register save area. + +2005-04-13 Uros Bizjak + + PR middle-end/27134 + * builtins.c (expand_builtin_int_roundingfn): Use expand_normal() + to expand fallback builtin function call. + +2006-04-14 Alan Modra + + PR middle-end/27095 + * builtins.c: (expand_builtin_memset): Stabilize args before expansion + and emit libcall here in case the builtin fails. + (expand_builtin_strcmp): Always emit the libcall here on failure. + +2006-04-14 Kazu Hirata + + * basic-block.h (REG_BASIC_BLOCK): Use VEC instead of VARRAY. + * flow.c (reg_n_info): Change the type to + VEC(reg_info_p,heap) *. + * regclass.c (allocate_reg_info, free_reg_info): Use VEC + instead of VARRAY. + * regs.h (reg_info_p): New. + (REG_N_REFS, REG_FREQ, REG_N_SETS, REG_N_DEATHS, + REG_N_CALLS_CROSSED, REG_N_THROWING_CALLS_CROSSED, + REG_LIVE_LENGTH, REGNO_FIRST_UID, REGNO_LAST_UID): Use VEC + instead of VARRAY. + +2006-04-13 Eric Botcazou + + * params.def (PARAM_MAX_SCHED_READY_INSNS): New parameter, + defaulting to 100. + * params.h (MAX_SCHED_READY_INSNS): New macro. + * haifa-sched.c: (queue_to_ready): Re-queue insns for the next cycle + past MAX_SCHED_READY_INSNS during the first scheduling pass. + (schedule_block): Delay insns past MAX_SCHED_READY_INSNS in + the ready list for 1 cycle during the first scheduling pass. + * doc/invoke.texi (--param): New parameter max-sched-ready-insns. + +2006-04-13 Richard Henderson + + PR libgomp/26651 + * gimple-low.c (lower_omp_directive): Remove dead code. + (lower_stmt): Do nothing except for openmp, except for OMP_PARALLEL. + * gimplify.c (gimplify_expr): Update for OMP_RETURN, OMP_CONTINUE. + * omp-low.c (struct omp_region): Move to tree-flow.h. + (root_omp_region): Export. + (omp_regions, lookup_omp_region): Remove. + (determine_parallel_type): Update for struct omp_region changes. + (dump_omp_region): Dump regions with block numbers. + (new_omp_region): Take type and block instead of stmt; malloc + instead of ggc. + (free_omp_region_1, free_omp_regions): New. + (expand_parallel_call): Take entry_stmt as argument; update for + changes to omp_region. + (remove_exit_barrier): Rewrite to update OMP_RETURN_NOWAIT. + (remove_exit_barriers): New. + (expand_omp_parallel): Update for struct omp_region changes. + (expand_omp_synch): Likewise. + (expand_omp): Likewise. + (expand_omp_for_static_nochunk): Likewise; update for OMP_CONTINUE. + (expand_omp_for_static_chunk): Likewise. + (expand_omp_for): Likewise. + (expand_omp_for_generic): Likewise; emit the proper GOMP_loop_end call. + (expand_omp_sections): Similarly, with GOMP_sections_end. + (expand_omp_single): New. + (build_omp_regions_1): Update for OMP_CONTINUE. + (execute_expand_omp): Call remove_exit_barriers, free_omp_regions. + (lower_omp_sections): Expand with OMP_CONTINUE, do not collect + OMP_SECTIONS_SECTIONS. + (lower_omp_single_simple): Don't emit barrier here. + (lower_omp_single_copy): Likewise. + (lower_omp_single): Fix bindings, and lower to straightline now. + (lower_omp_master, lower_omp_ordered): Likewise. + (lower_omp_critical): Likewise. + (lower_omp_for): Likewise. Emit OMP_CONTINUE. + * tree-cfg.c (make_edges): Collect an omp_region tree, use it for + omp edges, free it afterward. + (make_omp_sections_edges): Remove. + (is_ctrl_altering_stmt): Don't bother checking flag_openmp. + (move_stmt_r): Handle OMP_CONTINUE. + * tree-flow.h (struct omp_region): Move from omp-low.c. Switch + statement pointers to basic blocks. Add type member. + (root_omp_region, new_omp_region, free_omp_regions): Declare. + * tree-gimple.c (is_gimple_stmt): Handle OMP_RETURN, OMP_CONTINUE. + * tree-inline.c (estimate_num_insns_1): Likewise. + * tree-pretty-print.c (dump_generic_node): Likewise. + * tree-ssa-operands.c (get_expr_operands): Likewise. + * tree.def (OMP_SECTIONS): Remove OMP_SECTIONS_SECTIONS operand. + (OMP_RETURN): Rename from OMP_RETURN_EXPR. + (OMP_CONTINUE): New. + * tree.h (OMP_DIRECTIVE_P): Add OMP_CONTINUE. + (OMP_SECTIONS_SECTIONS): Remove. + (OMP_SECTION_LAST): New. + (OMP_RETURN_NOWAIT): New. + +2006-04-13 Roger Sayle + + * fold-const.c (native_encode_vector, native_interpret_real): + Correct obvious mistakes in the previous check-in. + +2006-04-13 Roger Sayle + + * fold-const.c (native_encode_expr): New function to encode + the target representation of an INTEGER_CST, REAL_CST, COMPLEX_CST + or VECTOR_CST into a specified buffer. + (native_encode_int): New function. + (native_encode_real): New function. + (native_encode_complex): New function. + (native_encode_vector): New function. + (native_interpret_expr): Inverse of native_encode_expr to convert + a target representation into an INTEGER_CST, REAL_CST etc... + (native_interpret_int): New function. + (native_interpret_real): New function. + (native_interpret_complex): New function. + (native_interpret_vector): New function. + (fold_view_convert_expr): New function to constant fold/evaluate + a VIEW_CONVERT_EXPR of a suitable constant expression. + (fold_unary) : Call fold_view_convert_expr. + Change call of build1 to fold_build1 when constructing a + VIEW_CONVERT_EXPR. + +2006-04-13 Paolo Bonzini + Ulrich Weigand + + PR target/27006 + * config/rs6000/rs6000.h (EASY_VECTOR_15_ADD_SELF): Require n + to be even. + +2006-04-13 Alan Modra + + PR target/26459 + * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Don't + optimize to lo_sum for DFmode if !TARGET_FPRS. + +2006-04-12 Kazu Hirata + + * tree-ssa-alias.c (set_initial_properties, init_alias_info, + delete_alias_info, compute_flow_sensitive_aliasing, + group_aliases): Use VEC instead of VARRAY. + * tree-ssa-structalias.c (update_alias_info): Likewise. + * tree-ssa-structalias.h (alias_info): Change the type of + processed_ptrs to VEC(tree,heap) *. + +2006-04-12 J"orn Rennecke + + PR target/27060 + * config/sh/lib1funcs.h: New file, broken out of: + * config/sh/lib1funcs.asm. + * config/sh/lib1funcs.h (DR00, DR01, DR20, DR21, DR40, DR41): + New macros. + * config/sh/lib1funcs.asm (udivsi3_i4): Use them. + * config/sh/lib1funcs-Os-4-200.asm: New file. + * config/sh/embed-elf.h (LIBGCC_SPEC): Use -lgcc-Os-4-200. + * config/sh/t-sh (OPT_EXTRA_PARTS): New variable. + (EXTRA_MULTILIB_PARTS): Include it. + ($(T)sdivsi3_i4i-Os-4-200.o): New rule. + ($(T)udivsi3_i4i-Os-4-200.o, $(T)libgcc-Os-4-200.a): Likewise. + * config/sh/t-superh (EXTRA_MULTILIB_PARTS): Include OPT_EXTRA_PARTS. + * config/sh/sh.h (OVERRIDE_OPTIONS): Recognize -mdiv=call-table for + TARGET_SH2. + +2006-04-12 Kazu Hirata + + * Makefile.in (TREE_SSA_LIVE_H): Add vecprim.h. + * tree-ssa-live.c (tpa_init, tpa_remove_partition, tpa_delete, + tpa_compact, root_var_init, type_var_init): Use VEC instead of + VARRAY. + * tree-ssa-live.h: Include vecprim.h. + (tree_partition_associator_d): Change the type of + first_partition to VEC(int,heap) *. + (tpa_first_partition): Use VEC instead of VARRAY. + + * Makefile.in (GTFILES): Move functions.h after tree.h. + * function.c (reset_block_changes, record_block_change, + check_block_change, free_block_changes): Use VEC instead of + VARRAY. + * function.h (function): Change the type of + ib_boundaries_block to VEC(tree,gc) *. + * tree-inline.c (copy_cfg_body): Initialize + ib_boundaries_block to NULL instead of (varray_type) 0. + +2006-04-12 Roger Sayle + + * expr.c (emit_group_store): Correct operand order in call to + subreg_lowpart_offset. Always create paradoxical SUBREGs with + a SUBREG_BYTE of zero. + +2006-04-12 Richard Guenther + + * profile.c (compute_branch_probabilities): Remove code + encapsulated in !ir_type (), which are remanents of the + removed RTL profiling code. + * rtl-profile.c: Remove. + +2006-04-12 Alan Modra + + * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Update + magic NULL_RTX comment. + (function_arg): Store entire fp arg to mem if any part should go + on stack. + (rs6000_arg_partial_bytes): Adjust for above change. + +2006-04-11 Roger Sayle + + * dwarf2out.c (output_call_frame_info): Create debug_frame_section + if it hasn't been initialized by dwarf2out_init. + +2006-04-11 John David Anglin + + * pa.md (MAX_12BIT_OFFSET, MAX_17BIT_OFFSET): Define and use new + symbolic constants in branch patterns. + +2006-04-11 Roger Sayle + + * caller-save.c: #include "addresses.h" after #include "tm_p.h". + +2006-04-11 Richard Sandiford + + PR rtl-optimization/27073 + * gcse.c (try_replace_reg): Revert last change. Continue to search + for both REG_EQUAL and REG_EQUIV notes, but only perform replacements + on the former. + +2006-04-11 Eric Botcazou + + * config/sparc/sparc.c (function_arg_slotno) : Handle + aggregate types other than record and union types. + (function_arg): Likewise. + (function_arg_pass_by_reference): In 64-bit mode, return 0 for + small arrays. + (function_value): In 64-bit mode, return objects that require it + in FP registers. + +2006-04-11 Roger Sayle + + * dwarf2out.c (premark_used_types): Remove problematic prototype. + +2006-04-11 Jakub Jelinek + + * gcc.c (LINK_COMMAND_SPEC): Move link_gomp after %o. + +2006-04-03 Jeff Law + + PR/27087 + * tree-ssa-copy.c (may_propagate_copy): Test flow sensitive + alias information too. + +2006-04-10 Mike Frysinger + + * Makefile.in (gcc-cross): Add $(exeext) to target name. + +2006-04-10 Aldy Hernandez + + PR/21391 + * dwarf2out.c (struct die_struct): Add die_perennial_p field. + (premark_used_types_helper): New. + (premark_used_types): New. + (gen_subprogram_die): Call premark_used_types. + (prune_unused_types_walk): Do not prune perennial dies. + * function.c (used_types_insert): New. + * function.h (struct function): Add used_types_hash field. + (used_types_insert): Add prototype. + * Makefile.in (FUNCTION_H): Depend on HASHTAB_H. + * c-parser.c (c_parser_cast_expression): Save casted types in used + types hash table. + +2006-04-11 Mark Mitchell + + PR target/26459 + * config/rs6000/e500-double.h (SUB3TARGET_OVERRIDE_OPTIONS): Test + rs6000_explicit_options.float_gprs. + +2006-04-10 Roger Sayle + + * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): Renamed + from ix86_expand_vector_init_low_nonzero. Take an additional + one_var argument indicating which element is non-zero. Support + one_var != 0 for V4SFmode and V4SImode by permuting the result. + (ix86_expand_vector_init): Call ix86_expand_vector_init_one_nonzero + with one_var instead of ix86_expand_vector_init_low_nonzero. + +2006-04-10 Kazu Hirata + + * Makefile.in (tree-into-ssa.o, tree-outof-ssa.o, + tree-ssa-live.o, tree-ssa-alias.o, function.o, df-problems.o, + global.o, cfglayout.o, lambda-code.o, reg-stack.o, + build/genextract.o): Depend on vecprim.h. + * cfglayout.c, df-problems.c, function.c, genextract.c, + global.c, lambda-code.c, reg-stack.c, tree-into-ssa.c, + tree-outof-ssa.c, tree-ssa-alias.c, tree-ssa-live.c: Include + vecprim.h. + * vecprim.h: New. + +2006-04-10 Geoffrey Keating + + * dwarf2out.c (struct dw_attr_struct): Remove dw_attr_next. + Declare VECs of this type. + (struct die_struct): Make field die_attr a VEC of dw_attr_struct. + (remove_children): Delete. + (add_dwarf_attr): Use VEC routines. + (add_AT_flag): Update for changes to add_dwarf_attr. + (add_AT_int): Likewise. + (add_AT_unsigned): Likewise. + (add_AT_long_long): Likewise. + (add_AT_vec): Likewise. + (add_AT_string): Likewise. + (add_AT_die_ref): Likewise. + (add_AT_fde_ref): Likewise. + (add_AT_loc): Likewise. + (add_AT_loc_list): Likewise. + (add_AT_addr): Likewise. + (add_AT_lbl_id): Likewise. + (add_AT_lineptr): Likewise. + (add_AT_macptr): Likewise. + (add_AT_offset): Likewise. + (add_AT_range_list): Likewise. + (get_AT): Use VEC_iterate. + (remove_AT): Use VEC_ordered_remove. + (free_die): Fold remove_children into here; have it use VEC_iterate. + (print_die): Use VEC_iterate on attrs. + (reverse_die_lists): Don't reverse attr lists. + (die_checksum): Use VEC_iterate on attrs. + (same_die_p): Likewise. + (output_location_lists): Likewise. + (build_abbrev_table): Likewise. + (size_of_die): Likewise. + (unmark_all_dies): Likewise. + (output_abbrev_section): Likewise. + (output_die): Likewise. + (prune_unused_types_walk_attribs): Likewise. + +2006-04-10 Eric Botcazou + + * doc/install.texi (*-*-solaris2*): Point to the configure page. + +2006-04-10 Jakub Jelinek + + PR debug/27057 + * dwarf2out.c (is_symbol_die): Return true also for namespaces. + +2006-04-09 Roger Sayle + + * expr.c (store_constructor): Don't bother clearing target if + we're about to assign a vector to it using vec_init_optab. + +2006-04-10 Daniel Berlin + + * tree-ssa-alias.c (lhs_may_store_to): New function. + (recalculate_used_alone): Handle LHS of calls. + +2006-04-09 John David Anglin + + PR target/27034 + PR target/26508 + * config.gcc (hppa*64*-*-hpux11*): Add 'libgcc_stub.a' to extra_parts. + * pa64-hpux.h (LIB_SPEC): Correct typo. Don't append milli.a. + (LINK_GCC_C_SEQUENCE_SPEC): Define. Append milli.a here. + (PA_CXA_FINALIZE_STUB, PA_JV_REGISTERCLASSES_STUB): Delete defines. + (PA_INIT_FINI_HACK): Rename to PA_CRTBEGIN_HACK. + (PA_CRTBEGIN_HACK): Ensure __do_global_ctors_aux is placed in text + section. Delete PA_CXA_FINALIZE_STUB and PA_JV_REGISTERCLASSES_STUB + stubs. Add ".align 8" directives before all ".dword" directives. + (GTHREAD_USE_WEAK): Revise comment. + (TARGET_ATTRIBUTE_WEAK): Define. + * pa/t-pa64 (LIBGCCSTUB_OBJS): Add new rules for stublib.c, rfi-stub.o, + dfi-stub.o, cxaf-stub.o and jvrc-stub.o. + * stublib.c: New file. + + PR target/26743 + PR target/11254 + PR target/10274 + * pa.md (cbranch patterns): Revise arguments used in calls to + output_cbranch, output_bb and output_bvd. Add long branch length + attributes. + (fbranch patterns): Handle long branches. + (jump): Revise length check. Revise arguments for output_lbranch call. + Add long branch length attributes. + (decrement_and_branch_until_zero): Add long branch length attributes. + (output_movb, output_parallel_addb and output_parallel_movb patterns): + Likewise. Revise arguments for output_parallel_addb and + output_parallel_movb calls. + * pa-protos.h (output_cbranch, output_lbranch, output_bb, output_bvb, + output_parallel_movb and output_parallel_addb): Update prototypes. + * pa.c (output_cbranch): Revise arguments. Correct handling of + nullification in long branches. + (output_lbranch): Add new argument to control extraction of delay + instruction. + (output_bb): Handle long branches. + (output_bvb, output_dbra, output_movb, output_parallel_movb, + output_parallel_addb): Likewise. + +2006-04-09 Richard Sandiford + + PR rtl-optimization/27073 + * gcse.c (try_replace_reg): Just propagate into REG_EQUAL notes, + not REG_EQUIVs. + +2006-04-08 Daniel Berlin + + * tree.h (tree_memory_tag): Add old_used_alone. + (SMT_OLD_USED_ALONE): New macro. + * tree-ssa-alias.c (recalculate_used_alone): Stop + marking things for renaming unnecessarily. + +2006-04-08 Kazu Hirata + + * builtins.c, config/arm/arm.c, config/i386/cygwin.h, + config/i386/i386.c, config/ia64/ia64.c, config/s390/fixdfdi.h, + config/sh/sh.c, config/sh/sh.h, df-scan.c, except.c, + haifa-sched.c, optabs.c, rtl.h, sched-deps.c, sched-int.h, + sched-rgn.c, tree-inline.h, tree-ssa-dom.c, + tree-ssa-loop-prefetch.c, tree-ssa-operands.c, + tree-vect-patterns.c, tree-vrp.c: Fix comment typos. Follow + spelling convensions. + * config/ia64/ia64.opt, doc/contrib.texi, doc/invoke.texi, + doc/passes.texi, doc/tm.texi, doc/tree-ssa.texi: Fix comment + typos. Follow spelling conventions. + +2006-04-07 DJ Delorie + + * config/m32c/m32c.c (m32c_function_arg): Structures are always + passed on the stack. + (m32c_init_cumulative_args): When a function returns a structure, + always pass the pointer to that return area on the stack. + (m32c_function_arg_advance): Don't increment the parameter number + if we're processing the returned structure pointer. + (pushm_info): Reverse order of registers. + +2006-04-07 Sebastian Pop + + * tree-ssa-loop-niter.c (inverse, number_of_iterations_ne, + assert_no_overflow_lt, assert_loop_rolls_lt, number_of_iterations_lt, + number_of_iterations_le, number_of_iterations_cond, find_loop_niter, + estimate_numbers_of_iterations_loop): Use build_int_cst instead of + build_int_cst_type. + * tree-chrec.c (chrec_fold_multiply_poly_poly, + chrec_fold_multiply): Same. + * tree-ssa-loop-ivopts.c (strip_offset_1, force_expr_to_var_cost, + force_expr_to_var_cost): Same. + * tree-mudflap.c (mf_xform_derefs_1): Same. + * tree-ssa-loop-prefetch.c (idx_analyze_ref): Same. + +2006-04-07 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_rtx_costs) : Do not + treat CONST_DOUBLE as INTVAL. and64_2_operands require an extra + insn. + +2006-04-07 Jan Hubicka + + * ipa-inline.c (cgraph_early_inlining): Collect garbage. + +2006-04-07 Richard Guenther + + PR tree-optimization/26135 + * tree-ssa-copy.c (stmt_may_generate_copy): Handle memory + loads for store copy-prop. + (copy_prop_visit_stmt): Likewise. + +2006-04-05 Robert Millan + + * config/i386/linux.h: Add a comment to mark macros that are + being overriden in config/k*bsd-gnu.h. + * config/kfreebsd-gnu.h: Redefine GLIBC_DYNAMIC_LINKER instead of + DYNAMIC_LINKER. + * config/knetbsd-gnu.h: Ditto. + +2006-04-06 Jan Hubicka + + PR profile/20815 + PR profile/26399 + * coverage.c (coverage_checksum_string): Reorganize loop to not read + after buffer. + +2006-04-06 Mike Stump + + * builtins.c (expand_builtin_longjmp):Use #ifdef instead of #if + for HAVE_nonlocal_goto to be consistent. + (expand_builtin_nonlocal_goto): Likewise. + (expand_builtin_strcmp): Use #ifdef instead of #if + for HAVE_cmpstrnsi to be consistent. + +2006-04-05 DJ Delorie + + * config/m32c/m32c.h (INCOMING_FRAME_SP_OFFSET): Adjust for m16c + vs m32c. + +2006-04-05 Bernd Schmidt + + * config/bfin/bfin.c (bfin_legitimate_address_p): Disallow + got-relative addressing for anything but SImode. + + * config/bfin/lib1funcs.asm (modsi): P1/P2 can be call-clobbered + even if the calling function doesn't modify them. + +2006-04-05 Richard Guenther + + PR tree-optimization/26919 + * ipa-inline.c (cgraph_decide_inlining_incrementally): Fix argument + to cgraph_estimate_size_after_inlining. + +2006-04-05 Alan Modra + + * reload.c (find_dummy_reload): Fix typo in 2006-04-03 change. + +2006-04-05 Sebastian Pop + + PR tree-optimization/26996 + * tree-scalar-evolution.c (analyze_scalar_evolution_1): Don't analyze + VECTOR_TYPE variables. + +2006-04-05 Richard Guenther + + PR tree-optimization/26763 + * fold-const.c (fold_comparison): Move folding of + PTR + CST CMP PTR + CST ... + (fold_binary): ... here. Fold only for EQ_EXPR and NE_EXPR. + +2006-04-05 Gerald Pfeifer + + * doc/install.texi (Prerequisites): Refine some wording on + bootstrapping and ksh. + Move the version numbers of DejaGnu here from the testing section + and fix casing of names. + Fix markup and clarify wording for autogen requirements. + Refer to GCJ instead of just java. + Refer to SVN instead of CVS. + Describe diffutils as useful instead of necessary. + (Downloading the source): Refer to SVN instead of CVS. + Adjust a link to our web site accordingly. + (Configuration): Fix casing of Bison. + (Building): Refer to SVN instead of CVS. + Fix a sentence on the use of Bison and remove duplicate (and + incorrect) version number of Bison requirement. + Remove one redundant list of packages needed for building. + (Specific): Avoid reference to CVS. + +2006-04-04 Eric Christopher + + * config/rs6000/rs6000.c (TARGET_MS_BITFIELD_LAYOUT_P): Define. + (TARGET_USE_MS_BITFIELD_LAYOUT): Ditto. + (rs6000_handle_struct_attribute): New. + (rs6000_ms_bitfield_layout_p): Ditto. + +2006-04-04 Geoffrey Keating + + * config/darwin-crt3.c (atexit): Pass &__dso_handle rather than + NULL for dso parameter to atexit_common. + +2006-04-04 Eric Christopher + + * config/i386/i386.c (machopic_output_stub): Output \t + between instructions and operands. + +2006-04-04 David Edelsohn + + * config/rs6000/rs6000.c (num_insns_constant_wide): Change + satisfies_constraint_[IL] to explicit tests on value. + +2006-04-04 Sebastian Pop + + * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, + set_nb_iterations_in_loop): Use build_int_cst instead of + build_int_cst_type. + * tree-data-ref.c (can_use_analyze_subscript_affine_affine): Use + build_int_cst instead of convert. + +2006-04-04 Carlos O'Donell + + * doc/tm.texi (TARGET_STRUCT_VALUE_RTX): Document + new value 2 for incoming. + * function.c (expand_function_start): Call struct_value_rtx + with incoming as 2. + * config/sparc/sparc.md: Comment updated_return. + * config/sparc/sparc.opt: Add -mstd-struct-return option. + * config/sparc/sparc.c (sparc_struct_value_rtx): Use standard + struct return if sparc_std_struct_return and incoming is 2. + (print_operand): Do not adjust return if + sparc_std_struct_return. + +2006-04-04 Roger Sayle + + * builtins.c (fold_builtin_sprintf): Use fold_convert instead of + convert in the middle-end. + * expr.c (store_expr, store_constructor, get_inner_reference, + expand_expr_real_1, string_constant, try_casesi, try_tablejump): + Likewise. + * tree.c (build_range_type): Likewise. + +2006-04-04 Tom Tromey + + * doc/install.texi (Prerequisites): Mention jar. + +2006-04-04 Daniel Berlin + + * doc/tree-ssa.texi (Preserving the virtual ssa form): New + subsection. + +2006-04-04 Matthias Klose + + * Makefile.in (unprotoize.o): Same dependencies as for protoize.o. + + PR bootstrap/26764 + PR bootstrap/27334 + * Makefile.in (s-macro_list): Conform to POSIX rules in single quoted + strings. + +2006-04-03 Geoffrey Keating + + * doc/extend.texi (Function Attributes): Rewrite visibility + attribute documentation. + * doc/invoke.texi (C++ Dialect Options): Rewrite + -fvisibility-inlines-hidden documentation to describe something + entirely different, although in practise compatible. + (Code Gen Options): Warn about system headers in -fvisibility= + documentation. + + * doc/extend.texi (Other Builtins): Document that + __builtin_nan is a compile-time constant only when its argument + is valid. + +2006-04-03 Adam Nemet + + * simplify-rtx.c (simplify_unary_operation_1) : When + trying to remove TRUNCATE check if all bits outside the new mode + are identical to the sign bit. + +2006-04-03 Jeff Law + + * tree-ssa-dom.c (propagate_rhs_into_lhs): Avoid useless folding + and operand scanning in some common cases. + +2006-04-03 Paolo Bonzini + Dale Johannesen + + PR target/19653 + * regclass.c (struct reg_pref): Update documentation. + (regclass): Set prefclass to NO_REGS if memory is the best option. + (record_reg_classes): Cope with a prefclass set to NO_REGS. + * reload.c (find_reloads): Take PREFERRED_OUTPUT_RELOAD_CLASS + into account. For non-registers, equate an empty preferred + reload class to a `!' in the constraint; move the if clause to + do so after those that reject the insn. + (push_reload): Allow PREFERRED_*_RELOAD_CLASS to liberally + return NO_REGS. + (find_dummy_reload): Likewise. + * doc/tm.texi (Register Classes): Document what it means + if PREFERRED_*_RELOAD_CLASS return NO_REGS. + * config/i386/i386.c (ix86_preferred_reload_class): Force + using SSE registers (and return NO_REGS for floating-point + constants) if math is done with SSE. + (ix86_preferred_output_reload_class): New. + * config/i386/i386-protos.h (ix86_preferred_output_reload_class): New. + * config/i386/i386.h (PREFERRED_OUTPUT_RELOAD_CLASS): New. + * config/i386/i386.md: Remove # register preferences. + +2006-04-02 Sebastian Pop + + PR bootstrap/26992 + * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, + chrec_is_positive, set_nb_iterations_in_loop): Use a variable for + the type of nb_iter. + (instantiate_parameters_1): Convert the operands before calling + chrec_fold_minus, chrec_fold_plus, or chrec_fold_multiply. + * tree-data-ref.c (can_use_analyze_subscript_affine_affine): Same. + +2006-04-02 Roger Sayle + + * builtins.c (dummy_object): Use build_int_cst instead of convert. + * tree-ssa-ccp.c (maybe_fold_stmt_addition): Use fold_convert + instead of convert. + * dojump.c (do_jump): Likewise. + * expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE): Likewise. + * gimplify.c (gimple_boolify, gimplify_init_constructor, + gimplify_boolean_expr): Likewise. + * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. + * varasm.c (array_size_for_constructor): Likewise. + * tree-object-size.c (compute_object_offset): Likewise. + +2006-04-02 Roger Sayle + + PR middle-end/26977 + * expr.c (emit_group_store): Check whether simplify_gen_subreg returns + NULL_RTX, indicating it couldn't create a valid paradoxical subreg. + +2006-04-02 Sebastian Pop + + PR tree-optimization/26939 + * tree-chrec.c (chrec_merge): Use eq_evolutions_p. + +2006-04-02 Sebastian Pop + + * tree-scalar-evolution.c (add_to_evolution_1): Pass an extra argument + at_stmt. Convert the type of operands before calling + build_polynomial_chrec. + (add_to_evolution): Pass an extra argument at_stmt. Adjust the call to + add_to_evolution_1. + (follow_ssa_edge_in_rhs): Adjust call to add_to_evolution. + (instantiate_parameters_1): Convert the type of operands before calling + build_polynomial_chrec. + * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly, + chrec_fold_multiply_poly_poly, chrec_replace_initial_condition, + reset_evolution_in_loop): Insert asserts to check the types of the + operands. + (chrec_type): Moved... + (eq_evolutions_p): Use operand_equal_p. + * tree-chrec.h (build_polynomial_chrec): Insert an assert to check + the types of the operands. + (chrec_type): ...here. + * tree-data-ref.c (create_data_ref): Convert the operands before + calling chrec_replace_initial_condition. + (same_access_functions, analyze_subscript_affine_affine, + analyze_miv_subscript, all_chrecs_equal_p): Use eq_evolutions_p. + (compute_subscript_distance, analyze_ziv_subscript, + analyze_siv_subscript_cst_affine, compute_overlap_steps_for_affine_1_2, + analyze_miv_subscript): Convert the operands before calling + chrec_fold_minus or chrec_fold_plus. + +2006-04-02 Sebastian Pop + + * tree-data-ref.c (compute_all_dependences): Use a pointer to + the dependence_relations vector. + (compute_data_dependences_for_loop): Adjust call to + compute_all_dependences. + +2006-04-01 Roger Sayle + Richard Henderson + + * gimplify.c (gimplify_scan_omp_clauses) : Call + gimple_boolify on the condition before calling gimplify_expr. + +2006-03-31 Bob Wilson + + * config/xtensa/lib1funcs.asm: Rename abi_entry/abi_return macros + to leaf_entry/leaf_return. Change leaf_entry to add 16 bytes to + the frame size. Update to use the new macros. + * config/xtensa/ieee754-sf.S: Use new leaf_entry/leaf_return macros. + * config/xtensa/ieee754-df.S: Likewise. + +2006-03-31 Richard Henderson + + * tree-cfg.c (make_ctrl_stmt_edges, make_exit_edges): Merge into... + (make_edges): ... here. Control fallthru creation with a local + variable. Do not play with fake edges. + (make_omp_sections_edges): Don't set EDGE_ABNORMAL. + (make_goto_expr_edges): Don't play with fake edges. Make for_call + a boolean. + +2006-04-01 Joseph S. Myers + + * dwarf2.h (DW64_CIE_ID): Define. + * dwarf2out.c (DWARF_CIE_ID): Define. + (output_call_frame_info): Output 0xffffffff before standard 8-byte + length header. Use DWARF_CIE_ID. + (value_format): Use DW_FORM_data4 or DW_FORM_data8 for + dw_val_class_loc_list depending on DWARF_OFFSET_SIZE. + +2006-03-31 Kaz Kojima + + * config/sh/linux-atomic.asm: New file. + * config/sh/t-linux (LIB2FUNCS_EXTRA): Add linux-atomic.asm. + +2006-03-31 DJ Delorie + + * config/m32c/cond.md: Set condition flags properly throughout. + * config/m32c/minmax.md: Likewise. + * config/m32c/prologue.md: Likewise. + * config/m32c/bitops.md: Likewise. + * config/m32c/muldiv.md: Likewise. + * config/m32c/mov.md: Likewise. + * config/m32c/addsub.md: Likewise. + * config/m32c/m32c.md: Likewise. + * config/m32c/jump.md: Likewise. + * config/m32c/shift.md: Likewise. + + * config/m32c/cond.md (cmp): Call m32c_output_compare to + conditionally output the pattern for this. + * config/m32c/m32c.c (flags_needed_for_conditional): New. + (m32c_compare_redundant): New. + (m32c_output_compare): New. + * config/m32c/m32c-protos.h (m32c_output_compare): New. + + * config/m32c/m32c.c (m32c_prepare_shift): Fix logic to clobber + dest, not src. Allow other 4-byte modes. + +2006-03-30 Denis Chertykov + + * doc/md.texi: Refer to avr/constraints.md instead of + avr/avr.h. + +2006-03-30 Roger Sayle + + * expr.c (emit_group_store): Make BYTEPOS a HOST_WIDE_INT to + signed vs. unsigned comparison failures on some hosts. + +2006-03-31 Alan Modra + + PR target/26459 + * config/rs6000/rs6000.h (CANNOT_CHANGE_MODE_CLASS): Limit 2003-12-08 + change to FLOAT_REGS. + + * config/rs6000/rs6000.c (rs6000_explicit_options): Add ieee. + (rs6000_override_options): Use it. + (rs6000_handle_option): Set it. Set rs6000_explicit_options.abi + only for -mabi=spe/no-spe and -mabi=altivec. + +2006-03-30 Geoffrey Keating + + * config/darwin.h (LINK_COMMAND_SPEC): Don't try to protect %S with + !Zdynamiclib. + +2006-03-30 Carlos O'Donell + + * Makefile.in: Rename docdir to gcc_docdir. + +2006-03-30 Roger Sayle + + PR target/17959 + * expr.c (emit_group_store): Optimize group stores into a pseudo + register by using a paradoxical subreg to initialize the destination + if the first or last member of the group specifies a "low part". + +2006-03-30 Maxim Kuvyrkov + + PR target/26734 + * rtl.def (DEPS_LIST): Change type of the second operand to 'int'. + * target.h (struct gcc_target.speculate_insn): Change type of the + second parameter to 'int'. + * lists.c (alloc_DEPS_LIST): Change signature. Update reference to + the second operand of the DEPS_LIST. + (copy_DEPS_LIST_list): Update reference to the second operand of the + DEPS_LIST. + * rtl.h (alloc_DEPS_LIST): Update signature. + * sched-int.h (ds_t): Change typedef to 'int'. + (DEP_STATUS, BITS_PER_DEP_STATUS): Update. + +2006-03-30 Maxim Kuvyrkov + + * haifa-sched.c (try_ready): Change condition to restore + non-speculative pattern of the instruction. + (process_insn_depend_be_in_spec): Code to keep probability of the + speculative dependence non-decreasing. + +2006-03-30 Jie Zhang + + * config/bfin/bfin.c (single_move_for_strmov): Renamed to... + (single_move_for_movmem): ... this. Also change all uses. + (bfin_expand_strmov): Renamed to... + (bfin_expand_movmem): ... this. Also change all uses. + * config/bfin/bfin.md (movstrsi): Renamed to... + (movstrsi): ...this. + +2006-03-30 Paolo Bonzini + + PR tree-optimization/26830 + + * tree-ssa-copy.c (copy_prop_visit_assignment): Do not check loop depth. + (copy_prop_visit_stmt): Remove write-only variable ann. + (init_copy_prop): Check variable loop depth here. Do not simulate + memory-tag and virtual operand PHIs except for store copy prop. + +2006-03-30 Richard Guenther + + * config/i386/i386.c: Remove builtins for SSE2 ABI intrinsic + variants with double arguments. + +2006-03-29 David Edelsohn + + * genpreds.c (write_tm_constrs_h): Delete variable p. + * genconditions.c (write_header): Add tm-constrs.h to included + headers. + * genpeep.c (main): Add toplev.h to included headers. + * Makefile.in (build/gencondmd.o): Add tm-constrs.h dependency. + (build/genpeep.o): Add toplev.h dependency. + * config/rs6000/constraints.md: Add "W" constraint. + +2006-03-29 Roger Sayle + + * stor-layout.c (mode_for_size_tree): Remove restiction on type + sizes by correctly testing whether the size fits a host integer. + (initialize_sizetypes): Use set_min_and_max_values_for_integral_type + to correctly set TYPE_MIN_VALUE and TYPE_MAX_VALUE to the full + SImode range for the default sizetype and bitsizetype. + +2006-03-29 Roger Sayle + + * convert.c (convert_to_pointer): Preserve the TREE_OVERFLOW + and TREE_CONSTANT_OVERFLOW bits of the argument. Return + quickly if the argument is already of the correct type. + Call fold_build1 instead of build1. Tidy up blank lines. + +2006-03-29 David Edelsohn + + * genemit.c (main): Add tm-constrs.h to included headers. + * genoutput.c (output_prologue): Add tm-constrs.h to included headers. + * genpeep.c (main): Add tm-constrs.h to included headers. + * genpreds.c (write_satisfies_constraint_fns): Rename to ... + (write_tm_constrs_h): this and write complete file. + (write_tm_preds_h): Do not emit satisfies_constraint fns. + (write_insn_preds_c): Add tm-constrs.h to included headers. + (gen_constrs): New variable. + (parse_option): Parse "-c". + (main): Invoke write_tm_constrs_h. + * genrecog.c (write_header): Add tm-constrs.h to included headers. + * Makefile.in (STAGECOPYSTUFF): Add tm-constrs.h. + (object_out_file): Add tm-constrs.h dependency. + (insn-emit.o): Same. + (insn-output.o): Same. + (insn-peep.o): Same. + (insn-preds.o): Same. + (insn-recog.o): Same. + (tm-constsr.h): New target. + (s-constrs-h): New target. + + * config/rs6000/constraints.md: New file. + * config/rs6000/rs6000.c: Include tm-constrs.h. + (num_insn_constant_wide): Convert to satisfies_constraint. + (rs6000_rtx_costs): Convert to satisfies_constraint. + * config/rs6000/rs6000.h (REG_CLASS_FROM_LETTER): Delete. + (CONST_OK_FOR_LETTER_P): Delete. + (CONST_DOUBLE_OK_FOR_LETTER_P): Delete. + (EXTRA_CONSTRAINT): Delete. + (EXTRA_MEMORY_CONSTRAINT): Delete. + (EXTRA_ADDRESS_CONSTRAINT): Delete. + * config/rs6000/predicates.md: Convert to satisfies_constraint. + * config/rs6000/rs6000.md: Include constraints.md. Convert to + satisfies_constraint. + + * config/i386/i386.c: Include tm-constrs.h. + +2006-03-29 Sebastian Pop + + * tree-loop-linear.c (compute_data_dependences_for_loop): Adjust calls. + * tree-data-ref.c (find_data_references_in_loop, + compute_data_dependences_for_loop): Use pointers to VEC. + (analyze_all_data_dependences): Adjust calls. + * tree-data-ref.h (find_data_references_in_loop, + compute_data_dependences_for_loop): Adjust declarations. + * tree-vect-analyze.c (vect_analyze_data_refs): Adjust call to + compute_data_dependences_for_loop. + +2006-03-29 Paul Brook + + * config/arm/vfp.md (movsf_vfp): Disparage w<->r alternatives. + (movdf_vfp): Ditto. + +2006-03-29 Sebastian Pop + + PR tree-optimization/26859 + * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Avoid + division by zero. + (convert_step): Remove TREE_OVERFLOW and TREE_CONSTANT_OVERFLOW flags + for the step after fold_convert. + +2006-03-29 Paul Brook + + * reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators. + (inc_for_reload): Handle PRE_MODIFY and POST_MODIFY addresses. + +2006-03-29 Paul Brook + + PR middle-end/23623 + * targhooks.c (default_narrow_bitfield): New fuction. + * targhooks.h (default_narrow_bitfield): add prototype. + * target.h (gcc_target): Add narrow_volatile_bitfield. + * target-def.h (TARGET_NARROW_VOLATILE_BITFIELD): Define. + * stor-layout.c (get_best_mode): Use targetm.narrow_volatile_bitfield. + * doc/tm.texi: Document TARGET_NARROW_VOLATILE_BITFIELDS. + * config/arm/arm.c (TARGET_NARROW_VOLATILE_BITFIELD): Define. + +2006-03-29 Andreas Krebbel + + * config.gcc (s390-*-linux-*, s390x-*-linux*): Add t-dfprules to + tmake_file. + * config/s390/s390.c (S390_scalar_mode_supported_p): New function. + (NR_C_MODES): Add TDmode, DDmode and SDmode. + (s390_output_pool_entry, ): Accept MODE_DECIMAL_FLOAT. + (s390_hard_regno_mode_ok): Disallow TDmode in integer regs. + (s390_function_arg_float): Allow SDmode and DDmode values to be + passed in floating point registers. + (s390_function_arg_integer, s390_function_value): Replace MODE_FLOAT + check with SCALAR_FLOAT_MODE_P. + (TARGET_SCALAR_MODE_SUPPORTED_P): Define target macro. + +2006-03-28 Zdenek Dvorak + + PR tree-optimization/25985 + * tree-ssa-loop-niter.c (number_of_iterations_le, + number_of_iterations_ne): Make comments more precise. + (number_of_iterations_cond): Add only_exit argument. Use the + fact that signed variables do not overflow only when only_exit + is true. + (loop_only_exit_p): New. + (number_of_iterations_exit): Pass result of loop_only_exit_p to + number_of_iterations_cond. + +2006-03-28 Zdenek Dvorak + + PR tree-optimization/26643 + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Do not handle + bit_field_refs. + +2006-03-28 Kaz Kojima + + * config/sh/sh.md (udivsi3_i4_int): Clobber MACH_REG and MACL_REG. + (divsi3_i4_int): Likewise. + +2006-03-28 Roger Sayle + + * expr.c (emit_group_store): Only create a new pseudo reg if the + quantity it needs to hold isn't already a suitable pseudo. + +2006-03-28 Jeff Law + + * timevar.def (TV_TREE_PHI_CPROP): New timevar. + * tree-ssa-dom.c (pass_phi_only_cprop): Use it. + +2006-03-28 Roger Sayle + + * fold-const.c (fold_binary) : Fold (X & Y) ^ Y as + the equivalent ~X & Y, and the symmetry related transformations. + (fold_binary) : Similarly, fold (X ^ Y) & Y as + ~X & Y, and symmetry related transforms. + +2006-03-28 Maxim Kuvyrkov + + Revert my 2006-03-27 patches. + +2006-03-28 Roger Sayle + + * fold-const.c (fold_unary) : Fold (T1)(~(T2)X) as + ~(T1)X, when T1 and T2 are integer types of the same precision + and (T2)X isn't an extension. + +2006-03-28 Jeff Law + + PR tree-optimization/26796 + * tree-ssa-dom.c (propagate_rhs_into_lhs): Queue blocks which + need EH edge cleanups rather than purging them immediately. + (eliminate_degenerate_phis): Handle queued EH cleanups. + +2006-03-28 Daniel Berlin + + * tree-ssa-alias.c (create_sft): Initially inherit TREE_ADDRESSABLE + from parent_var. + +2006-03-27 Roger Sayle + + PR middle-end/22524 + * fold-const.c (fold_binary) : Call fold_convert to + cast BIT_NOT_EXPR operand to the correct type. + +2006-03-27 Sebastian Pop + + * tree-loop-linear.c: Don't include varray.h. + (gather_interchange_stats, try_interchange_loops, + linear_transform_loops): Use VEC instead of VARRAY. + * lambda-mat.c: Don't include varray.h. + * tree-chrec.c: Same. + * lambda-trans.c: Same. + * tree-vectorizer.c (new_loop_vec_info, destroy_loop_vec_info): Use + VEC instead of VARRAY. + * tree-vectorizer.h: Idem. + * tree-data-ref.c (dump_data_references, + dump_data_dependence_relations, dump_dist_dir_vectors, dump_ddrs, + initialize_data_dependence_relation, finalize_ddr_dependent, + compute_all_dependences, find_data_references_in_loop, + compute_data_dependences_for_loop, analyze_all_data_dependences, + free_dependence_relation, free_dependence_relations, + free_data_refs): Idem. + * tree-data-ref.h (data_reference_p, subscript_p): New. + (data_dependence_relation, DDR_SUBSCRIPT, DDR_NUM_SUBSCRIPTS): Use + VEC instead of VARRAY. + (DDR_SUBSCRIPTS_VECTOR_INIT): Removed. + (find_data_references_in_loop, compute_data_dependences_for_loop, + dump_ddrs, dump_dist_dir_vectors, dump_data_references, + dump_data_dependence_relations, free_dependence_relations, + free_data_refs): Adjust declaration. + (lambda_transform_legal_p): Move declaration here... + * tree-vect-analyze.c (vect_analyze_data_ref_dependences, + vect_compute_data_refs_alignment, vect_verify_datarefs_alignment, + vect_enhance_data_refs_alignment, vect_analyze_data_ref_accesses, + vect_analyze_data_refs): Use VEC instead of VARRAY. + * lambda.h (lambda_transform_legal_p): ...from here. + * lambda-code.c (lambda_transform_legal_p): Use VEC instead of VARRAY. + * tree-vect-transform.c (vect_update_inits_of_drs): Idem. + * Makefile.in (tree-loop-linear.o, lambda-mat.o, lambda-trans.o, + tree-chrec.o): Don't depend on VARRAY_H. + +2006-03-27 Maxim Kuvyrkov + + * rtl.def (Copyright): Update date. + (DEPS_LIST): Change type of the second operand to 'int'. + * target.h (Copyright): Update date. + (struct gcc_target.speculate_insn): Change type of the second parameter + to 'int'. + * lists.c (Copyright): Update date. + (alloc_DEPS_LIST): Change signature. Update reference to the second + operand of the DEPS_LIST. + (copy_DEPS_LIST_list): Update reference to the second operand of the + DEPS_LIST. + * rtl.h (Copyright): Update date. + (alloc_DEPS_LIST): Update signature. + * sched-int.h (Copyright): Update date. + (ds_t): Change typedef to 'int'. + (DEP_STATUS, BITS_PER_DEP_STATUS): Update. + +2006-03-27 Maxim Kuvyrkov + + * haifa-sched.c (Copyright): Update date. + (try_ready): Change condition to restore non-speculative pattern + of the instruction. + (process_insn_depend_be_in_spec): Code to keep probability of the + speculative dependence non-decreasing. + +2006-03-27 Bernd Schmidt + + * regrename.c (replace_oldest_value_addr): Initialize a variable to + shut up the compiler. + +2006-03-27 J"orn Rennecke + + * config/sh/t-sh ($(T)libic_invalidate_array_4-100.a): Fix rule + to use lib prefix for target. + ($(T)libic_invalidate_array_4-200.a): Likewise. + ($(T)libic_invalidate_array_4a.a): Likewise. + +2006-03-27 Andrew Stubbs + J"orn Rennecke + + * superh.opt: New file. + * sh.c (boardtype, osruntime): Remove. + * superh.h (SUBTARGET_OPTIONS): Remove. + * config.gcc (sh*-superh-elf): Add sh/superh.opt to extra_options. + + * config.gcc (sh*-*-*): Don't use c-c ranges for tr. Quote sed + arguments with ^ and/or []. + + * config.gcc (sh-*-*): Add quoting to account for quirk of + Solaris /bin/sh. + Replace == with = in enable_incomplete_targets test. + + * config/sh/superh.h (SUBTARGET_LINK_SPEC): Replace LITTLE_ENDIAN_BIT + with MASK_LITTLE_ENDIAN. + + * config.gcc (sh*-superh-elf): Add sh/superh.h to tm_file. + * config/sh/sh.opt: Added to some comments. + * config/sh/superh.h: Removed some chaff. + + * config/sh/sh.opt: Add m4-[1234]00* options. + * config/sh/sh.c (sh_handle_option): Likewise. + * config/sh/t-sh (IC_EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Define. + (ic_invalidate_array_4-100.o): New rule. + ($(T)libic_invalidate_array_4-100.a): Likewise. + (ic_invalidate_array_4-200.o): Likewise. + ($(T)libic_invalidate_array_4-200.a): Likewise. + (ic_invalidate_array_4a.o): Likewise. + ($(T)libic_invalidate_array_4a.a): Likewise. + * config/sh/t-elf (EXTRA_MULTILIB_PARTS): Add IC_EXTRA_PARTS. + * config/sh/embed-elf.h (LIBGCC_SPEC): Add clauses for m4-100*, + m4-200*, and m4a*. + * config/sh/crt1.asm: Merged in profiling code. + * config/sh/superh.h (STARTFILE_SPEC): Override. + * config/sh/t-superh: Override EXTRA_MULTILIB_PARTS. + Add rules for $(T)crt1-mmu.o, $(T)gcrt1-mmu.o and $(T)gcrt1.o. + * config.gcc (sh*-superh-elf): Add t-superh to tmake_file. + + * t-sh (MULTILIB_MATCHES): Add sh4-[1245]00* variants. + * config/sh/t-superh: Removed now-redundant MULTILIB_OPTIONS / + MULTILIB_DIRNAMES / MULTILIB_MATCHES settings. + + * sh.opt (mpretend-cmove): New option. + * sh.h (OPERRIDE_OPTIONS): Switch it off if not TARGET_SH1. + * sh.md (movsicc_t_false, movsicc_t_tru): New patterns. + (movsicc): Add TARGET_PRETEND_CMOVE code. + +2006-03-27 Andreas Krebbel + + * config/s390/s390-protos.h (s390_hard_regno_mode_ok, + s390_class_max_nregs): New function prototypes. + * config/s390/s390.c (REGNO_PAIR_OK): New macro. + (s390_hard_regno_mode_ok, s390_class_max_nregs): New functions. + * config/s390/s390.h (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, + CLASS_MAX_NREGS): Macro bodies replaced by function calls. + +2006-03-26 Geoffrey Keating + + * dwarf2out.c (add_location_or_const_value_attribute): Call + tree_add_const_value_attribute if nothing else works. + (reference_to_unused): New. + (rtl_for_decl_init): Use reference_to_unused to decide whether + to output an initializer. + +2006-03-27 Alan Modra + + PR target/26459 + * config/rs6000/rs6000.md (DF reg move peephole): Prevent + peephole removing spe frob_di_df_2. + +2006-03-26 Sebastian Pop + + * tree-data-ref.c: Rename DDR_SIZE_VECT to DDR_NB_LOOPS. + (subscript_dependence_tester_1): Declared. + (print_dir_vectors, print_dist_vectors): New. + (debug_data_dependence_relation): New. + (dump_data_dependence_relation): Print more details. + (initialize_data_dependence_relation): Initialize DDR_LOOP_NEST. + (analyze_subscript_affine_affine): Don't ICE when gcd_alpha_beta is 0. + (save_dist_v, save_dir_v, add_outer_distances, + build_classic_dist_vector_1): New. + (build_classic_dist_vector): Rewrite to work on DDR_LOOP_NEST. + Don't test for lambda_vector_lexico_pos. + (same_access_functions, add_multivariate_self_dist, + add_other_self_distances, dir_from_dist): New. + (build_classic_dir_vector): Replace implementation almost identical to + build_classic_dist_vector with a walk of DDR_DIST_VECTS with a call to + dir_from_dist. + (subscript_dependence_tester_1): New. + (subscript_dependence_tester): Handle the lexicographically negative + distance vectors by recomputing the dependence relation. + (compute_affine_dependence): Remove parameter loop_nest_depth. + (compute_self_dependence): Don't call compute_subscript_distance. + (compute_all_dependences): Remove parameters nb_loops, loop_nest_depth. + Add a parameter for the loop_nest. + (find_loop_nest_1, find_loop_nest): New. + (compute_data_dependences_for_loop): Compute the loop nest, and give + up if the nest is not well formed. + * tree-data-ref.h (loop_p): New. + (struct data_dependence_relation): Replace size_vect field with + loop_nest, a vec of loops. + (DDR_SIZE_VECT): Renamed DDR_NB_LOOPS. + (DDR_LOOP_NEST): New. + (print_dir_vectors, print_dist_vectors, + debug_data_dependence_relation): Declared. + (index_in_loop_nest): New. + * tree-vect-analyze.c (vect_analyze_data_ref_dependence): Use + DDR_LOOP_NEST and index_in_loop_nest to determine the dependence + distance. + +2006-03-25 Adam Nemet + + * simplify-rtx.c (simplify_relational_operation): Call + simplify_relational_operation_1 even if mode is VOIDmode. + +2006-03-25 Daniel Berlin + + PR tree-optimization/26804 + * tree.h (DECL_CALL_CLOBBERED): New macro. + (tree_decl_common): Add call_clobbered_flag. + * tree-flow-inline.h (is_call_clobbered): Use DECL_CALL_CLOBBERED. + (mark_call_clobbered): Set DECL_CALL_CLOBBERED. + (clear_call_clobbered): Clear DECL_CALL_CLOBBERED. + (mark_non_addressable): Ditto. + * tree-ssa.c (verify_call_clobbered): New function. + (verify_alias_info): Use it. + * tree-pass.h (pass_reset_cc_flags): New prototype. + * tree-ssa-alias.c (pass_reset_cc_flags): New structure. + (reset_cc_flags): New function. + * passes.c (init_optimization_passes): Call reset_cc_flags after + initializing referenced_vars. + +2006-03-25 Uros Bizjak + Roger Sayle + + PR middle-end/26717 + * fold-const.c (fold_binary) [RDIV_EXPR]: Do not optimize A / A + to 1.0 for non-real operands. Implement A / A optimization for + complex operands. + +2006-03-25 H.J. Lu + + * config/i386/i386.c (size_cost): Correct the comment for + cost of storing fp registers. + (i386_cost): Likewise. + (i486_cost): Likewise. + (pentium_cost): Likewise. + (pentiumpro_cost): Likewise. + (k6_cost): Likewise. + (athlon_cost): Likewise. + (k8_cost): Likewise. + (pentium4_cost): Likewise. + (nocona_cost): Likewise. + (generic64_cost): Likewise. + (generic32_cost): Likewise. + +2006-03-24 Denis Chertykov + + * config/avr/avr-protos.h (extra_constraint): Delete. + (extra_constraint_Q): New declaration. + * config/avr/constraints.md: New file. + * config/avr/avr.md: Include it. + (REG_X, REG_Y, REG_Z, REG_W): New constants. + (TMP_REGNO, ZERO_REGNO): Likewise. + (UNSPEC_STRLEN, UNSPEC_INDEX_JMP): Likewise. + * config/avr/avr.c (avr_reg_class_from_letter): Delete. + (extra_constraint): Delete. + (extra_constraint_Q): Test for memory constraint 'Q'. + * config/avr/avr.h (REG_X,REG_Y,REG_Z,REG_W): Delete. + (REG_CLASS_FROM_LETTER): Delete. + (CONST_OK_FOR_LETTER_P): Delete. + (CONST_DOUBLE_OK_FOR_LETTER_P): Delete. + (EXTRA_CONSTRAINT): Delete. + (TMP_REGNO): Delete. + (ZERO_REGNO): Delete. + +2006-03-24 Jeff Law + + * tree-ssa-dom.c (propagate_rhs_into_lhs): Don't call update_stmt + directly. Call mark_new_vars_to_rename slightly earlier. + +2006-03-24 Geoffrey Keating + + * dwarf2out.c (is_c_family): Understand new DWARF3 language types. + (is_cxx): Likewise. + (gen_compile_unit_die): Use new language types for Objective-C and + Objective-C++. + (dwarf2out_decl): Use is_cxx rather than testing explicitly against + DW_LANG_C_plus_plus. + + PR 26793 + * config/t-darwin (crt3.o): Work around bug 26840. + * config/darwin-crt3.c: Rewrite. + * config/darwin.h (STARTFILE_SPEC): Don't use -l for crt3.o. + +2006-03-24 Carlos O'Donell + + * doc/invoke.texi: Document -femit-class-debug-always + * common.opt: Add -femit-class-debug-always. + +2006-03-24 Andreas Krebbel + + * config/s390/s390.c (s390_decompose_address): Allow SImode for + index and base register. + (s390_expand_plug_operand, legitimate_address_p, preferred_la_operand_p, + print_operand_address, print_operand): Replaced REG_OK_FOR_BASE_STRICT_P + with REGNO_OK_FOR_BASE_P and REG_OK_FOR_INDEX_STRICT_P with + REGNO_OK_FOR_INDEX_P. + * config/s390/s390.h (REGNO_OK_FOR_INDEX_P): Replaced check with + ADDR_REGNO_P. + (REG_OK_FOR_INDEX_NONSTRICT_P, REG_OK_FOR_BASE_NONSTRICT_P, + REG_OK_FOR_INDEX_STRICT_P, REG_OK_FOR_BASE_STRICT_P, REG_OK_FOR_INDEX_P, + REG_OK_FOR_BASE_P): Definitions removed. + +2006-03-24 Jakub Jelinek + + PR middle-end/26611 + * gimplify.c (gimplify_bind_expr): Only call omp_add_variable on + non-global variables that don't have DECL_SEEN_IN_BIND_EXPR_P bit + set yet or weren't marked as local yet. + +2006-03-24 Bernd Schmidt + + * regrename.c (scan_rtx_address): Initialize a variable to shut up + the compiler. + +2006-03-24 Eric Botcazou + + * config/rs6000/rs6000-protos.h (rs6000_offsettable_memref_p): Declare. + (rs6000_legitimate_small_data_p): Delete. + * config/rs6000/rs6000.c (rs6000_offsettable_memref_p): New predicate. + (rs6000_legitimate_small_data_p): Rename to legitimate_small_data_p + and make static. Add forward declaration. Update uses. + (rs6000_split_multireg_move): Use rs6000_offsettable_memref_p instead + of offsettable_memref_p. + * config/rs6000/rs6000.md (movdf_hardfloat32): Revert 2005-08-23 fix. + Use rs6000_offsettable_memref_p instead of a less accurate predicate. + +2006-03-24 Jeff Law + + * tree-ssa-dom.c (propagate_rhs_into_lhs): Temporarily work + around bug in immediate-use iterator. + +2006-03-24 Alan Modra + + PR target/26607 + * config/rs6000/darwin-ldouble.c: Don't compile when __NO_FPRS__ + or __LITTLE_ENDIAN__. + +2006-03-23 J"orn Rennecke + + * config/sh/divtab-sh4.c, config/sh/divcost-analysis: New files. + * config/sh/lib1funcs.asm (div_table): Add !__SH5__ variant. + * config/sh/t-sh (LIB1ASMFUNCS): Add _div_table. + * config/sh/sh.opt (mdiv=): Amend description. + * config/sh/sh.h (TARGET_DIVIDE_CALL_DIV1): New macro. + (TARGET_DIVIDE_CALL_FP, TARGET_DIVIDE_CALL_TABLE): Likewise. + (sh_divide_strategy_e): Add new members SH_DIV_CALL_DIV1, + SH_DIV_CALL_FP, SH_DIV_CALL_TABLE and SH_DIV_INTRINSIC. + (OVERRIDE_OPTIONS): Also process sh_div_str for TARGET_SH1. + Calculate sh_divsi3_libfunc using TARGET_DIVIDE_* macros. + * config/sh/sh.md (udivsi3_i4_int, divsi3_i4_int): New patterns. + (udivsi3, divsi3): Use them. Check TARGET_DIVIDE_CALL_TABLE / + TARGET_DIVIDE_CALL_FP. + +2006-03-23 Maxim Kuvyrkov + + * haifa-sched.c (choose_ready): Fix type of the local variable. + Move local variables. Add comment. + (check_reg_live): Change signature. Make callable from debugger. + * sched-int.h (check_reg_live): Update signature. + * sched-ebb.c (check_reg_live): Update parameters. + * sched-rgn.c (check_reg_live): Ditto. + (region_head_or_leaf_p): Check pointer before dereferencing. + * config/ia64/ia64.c (ia64_set_sched_flags): Disable data speculation + before reload on optimization levels below 1. + +2006-03-23 Richard Henderson + + * config/alpha/alpha.c (alpha_legitimate_constant_p): Reject + tls symbols. + + PR target/26347 + * config/alpha/predicates.md (local_symbolic_operand): Reject + weak symbols. + +2006-03-23 Andrew Pinski + + PR tree-opt/26795 + * tree-ssa-pre.c (create_value_expr_from): Don't reject + expressions which have overflowed constants. + +2006-03-23 Zdenek Dvorak + + * cse.c (cse_end_of_basic_block): Do not check for LOOP_END note. + +2006-03-23 Zdenek Dvorak + + * cfgloopmanip.c (create_loop_notes): Removed. + * final.c (final_scan_insn): Do not handle loop notes. + * jump.c (squeeze_notes): Ditto. + * cfglayout.c (skip_insns_after_block, + duplicate_insn_chain): Ditto. + * cfgcleanup.c (rest_of_handle_jump2): Do not call + create_loop_notes. + * cfgloop.h (create_loop_notes): Declaration removed. + +2006-03-23 Richard Sandiford + + * varasm.c (output_constant_pool): Restore fnname and fndecl + arguments. + (assemble_start_function): Adjust call accordingly. + (assemble_end_function): Likewise. + +2006-03-22 Volker Reichelt + + PR mudflap/26789 + * tree-mudflap.c (mudflap_finish_file): Skip erroneous objects. + + PR mudflap/26790 + * tree-mudflap.c (mf_xform_derefs_1): Return early on error_mark_node. + +2006-03-22 Volker Reichelt + + PR driver/22600 + * system.h (ICE_EXIT_CODE): New macro. + * diagnostic.c (diagnostic_count_diagnostic): Exit with ICE_EXIT_CODE. + (diagnostic_action_after_output): Likewise. + * gcc.c (fatal_ice): New function. + (execute): Use it instead of fatal. + (fancy_abort): Likewise. + * doc/invoke.texi (-pass-exit-codes): Document return code for ICEs. + +2006-03-22 Jeff Law + + * loop-unroll.c (analyze_iv_to_split_insn): Handle + iv_analyze_result returning false. + +2006-03-22 Jie Zhang + + * config/bfin/bfin.h (ASM_FORMAT_PRIVATE_NAME): Remove. + +2006-03-22 Richard Henderson + + PR middle-end/26084 + * except.c (duplicate_eh_regions_0): New. + (duplicate_eh_region_1): Duplicate the children of the node as + well as the node itself. Link them up properly. + (duplicate_eh_region_2): Merge into ... + (duplicate_eh_regions): ... here. Take copy_region argument, and + copy only a sub-tree if asked. Simplify copying and fixup. + (eh_region_outer_p): New. + * except.h (duplicate_eh_regions): Update decl. + (eh_region_outer_p): Declare. + * omp-low.c (lower_omp_single): Fix eh region placement wrt OMP_RETURN. + (lower_omp_master): Likewise. + (lower_omp_ordered): Likewise. + * tree-cfg.c (struct move_stmt_d): Add new_label_map. + (move_stmt_r): Use it to remap labels. Handle recursion vs + remap_decls_p properly. + (move_block_to_fn): Pass in new_label_map. Remap RESX_EXPR. + (find_outermost_region_in_block): New. + (new_label_mapper): New. + (move_sese_region_to_fn): Copy eh information to the new function + properly. + * tree-inline.c (copy_cfg_body): Update for new duplicate_eh_regions + argument. + * tree-pretty-print.c (dump_generic_node): Dump RESX_EXPR region + number. + +2006-03-22 Richard Sandiford + + * doc/md.texi (-mshared): Mention that -mshared code can be linked + into shared libraries. + +2006-03-22 Richard Sandiford + + * doc/md.texi: Refer to i386/constraints.md instead of + i386/predicates.md. + * config/i386/constraints.md: New file, extracted from... + * config/i386/predicates.md: ...here. + * config/i386/i386.md: Include constraints.md. + +2006-03-21 Jason Merrill + + * builtins.c (expand_builtin_fork_or_exec): Fix pasto. + + PR middle-end/20297 + * expr.c (init_block_move_fn): Force default visibility. + (init_block_clear_fn): Likewise. + * builtins.c (expand_builtin_fork_or_exec): Likewise. + * targhooks.c (default_external_stack_protect_fail): Likewise. + +2006-03-21 Richard Sandiford + + * config/mips/predicates.md (const_call_insn_operand): Allow direct + calls to locally-defined functions if TARGET_ABSOLUTE_ABICALLS. + * config/mips/mips.md (jal_macro): Test TARGET_ABSOLUTE_ABICALLS. + Use TARGET_OLDABI instead of !TARGET_NEWABI. + (loadgp): Use mips_current_loadgp_style. + (loadgp_noshared): New pattern. + (sibcall_internal): Use MIPS_CALL. + (sibcall_value_internal): Likewise. + (sibcall_value_multiple_internal): Likewise. + (call_internal): Likewise. + (call_value_internal): Likewise. + (call_value_multiple_internal): Likewise. + (call_split): Use MIPS_CALL and add an 'S' constraint. + (call_value_split): Likewise. + (call_value_multiple_split): Likewise. + * config/mips/mips.opt (-mabicalls): Tweak docstring. + (-mshared): New option. + * config/mips/mips-protos.h (mips_loadgp_style): New enum. + (mips_current_loadgp_style): Declare. + * config/mips/mips.c (mips_classify_symbol): Avoid using + SYMBOL_GOT_LOCAL if TARGET_ABSOLUTE_ABICALLS. Use SYMBOL_GENERAL + rather than SYMBOL_GOT_GLOBAL for locally-binding symbols if + TARGET_ABSOLUTE_ABICALLS. + (override_options): Adjust comments. Improve the warning that is + issued when -mabicalls and -G are used together. + (mips_file_start): Remove comment. + (mips_current_loadgp_style): New function. + (mips_gnu_local_gp): New variable. + (mips_emit_loadgp): Use mips_current_loadgp_style. Handle + LOADGP_ABSOLUTE. + (mips_output_function_prologue): Use mips_current_laodgp_style. + (mips_expand_prologue): Call mips_emit_loadgp before emitting + the cprestore instruction. + (mips_extra_live_on_entry): Fix reversed test. Don't make $25 + live for TARGET_ABSOLUTE_ABICALLS. + * config/mips/mips.h (TARGET_ABSOLUTE_ABICALLS): New macro. + (ASM_SPEC): Pass down -mshared and -mno-shared. + (MIPS_CALL): New macro. + * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove __ABICALLS__ + definition. + * doc/invoke.texi (-mabicalls): Update documentation. + (-mshared): Document. + +2006-03-21 Steve Ellcey + + * config/ia64/unwind-hpux.c: New file. + * config/ia64/t-hpux: Add unwind-hpux.c to libgcc. + +2006-03-21 Steve Ellcey + + PR libgomp/26384 + * config/pa/pa64-hpux.h (LIB_SPEC): Fix for -mt and -pthread options. + +2006-03-21 Jeff Law + + * tree-vrp.c (extract_range_from_unary_expr): Derive ranges for + type conversions of a VR_VARYING source to a wider type. + +2006-03-21 Eric Botcazou + + * config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to + tm_file on Solaris 10 and later. + (sparc64-*-solaris2*): Likewise. + (sparc-*-solaris2*): Likewise. + * config/sol26.h: Rename to config/sol2-6.h. + * config/sol2-10.h: New file. + +2006-03-21 Andrew Pinski + + PR tree-opt/26781 + * tree-ssa-pre.c (create_component_ref_by_pieces): + Handle STRING_CST. + +2006-03-21 Jakub Jelinek + + PR c++/26690 + * tree.c (get_callee_fndecl): If CALL is error_mark_node, + return it immediately. + +2006-03-21 Michael Matz + + * genautomata.c (, num_out_arcs, presence_signature): + New members. + (remove_arc, add_arc): Update num_out_arcs member. + (set_out_arc_insns_equiv_num): Returns nothing instead of number + of out arcs. + (cache_presence): New function. + (compare_states_for_equiv): New function. + (state_is_differed): Don't take number of outargs, adjust callers. + Use new invariant for speeding up. + (init_equiv_class): Create initial classes based on sorted + input. + (partition_equiv_class): Don't track out_arcs_num. + (evaluate_equiv_classes): Call cache_presence on all states and + sort them. + +2006-03-21 Bernd Schmidt + + * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. + * config/bfin/bfin.c (bfin_dsp_memref_p): New function. + (bfin_valid_reg_p): Test for pseudos explicitly and use only + REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all + callers changed. + * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. + (IREG_P, P_REGNO_P, I_REGNO_P): New macros. + (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. + (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, + REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete + macros. + (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, + REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. + (REGNO_REG_CLASS): ARGP is in PREGS. + * config/bfin/bfin.md (movhi_insn): Allow for addresses containing + IREGS. + (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split + to deal with those addresses. + * addresses.h: New file. + * caller-save.c: Include "addresses.h". + (init_caller_save): Use new base_reg_class function. + * rtl-factoring.c: Include "addresses.h". + (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. + * recog.c: Include "addresses.h". + (preprocess_constraints): Use new base_reg_class function. + * regrename.c: Include "addresses.h". + (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class + functions. Keep track of a new var INDEX_CODE to compute valid + classes. + (replace_oldest_value_addr): Likewise. + (replace_oldest_value_mem): Use base_reg_class. + * reload.c: Include "addresses.h". + (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. + (find_reloads): Use new base_reg_class function. + (find_reloads_address): Likewise; also use regno_ok_for_base_p. + (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; + all callers and prototype changed. + * reload1.c: Include "addresses.h". + (maybe_fix_stack_asms): Use base_reg_class. + * regclass.c: Include "addresses.h". + (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. + (init_reg_autoinc): Use new base_reg_class function. + (record_reg_classes): Likewise. + (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, + OUTER_CODE and INDEX_CODE. All callers and prototype changed. + Use new args to compute necessary class. + + * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, + regrename.o, rtl-factoring.o): Update dependencies. + * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. + (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. + (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, + REG_OK_FOR_INDEX_P): Delete documentation. + +2006-03-21 Alexey Starovoytov + + * config.gcc (sparc-*-solaris2*): Change the default CPU setting + from V7 to V9 for Solaris 7 and above. + +2006-03-21 Toon Moene + + * doc/invoke.texi: Document new flag -fargument-noalias-anything. + * tree-ssa-alias.c (may_alias_p): If flag_argument_noalias > 2, + argument pointers may not alias any other storage. + * common.opt: Define option -fargument-noalias-anything. + * tree-ssa-structalias.c (intra_create_variable_infos): Fortran + alias semantics is specified by flag_argument_noalias > 2. + +2006-03-20 Jeff Law + + * tree-pass.h (pass_phi_only_copy_prop): Delete. + (pass_phi_only_cprop): Declare. + * passes.c (init_optimization_passes): Replace pass_phi_only_copy_prop + with phi_only_cprop + * tree-ssa-dom.c (degenerate_phi_result): New function. + (remove_stmt_or_phi, get_lhs_or_phi_result): Likewise. + (get_rhs_or_phi_arg, propagate_rhs_into_lhs): Likewise. + (eliminate_const_or_copy, eliminate_degenerate_phis_1): Likewise. + (eliminate_degenerate_phis): Likewise. + (pass_phi_only_cprop): New pass descriptor. + * tree-ssa-copy.c (init_copy_prop): Lose PHIS_ONLY argument and + support code. Callers updated. + (execute_copy_prop, do_copy_prop): Likewise and corresponding changes. + (store_copy_prop): Likewise. + (do_phi_only_copy_prop, pass_phi_only_copy_prop): Remove. + +2006-03-20 Jason Merrill + + PR c++/21764 + * c-pragma.c (visstack): Move out of handle_pragma_visibility. + (push_visibility, pop_visibility): Likewise. + * c-pragma.h: Declare them. + +2006-03-20 Kaz Kojima + + * config/sh/sh.c (untangle_mova): Initialize n_addr and n_target. + + * config/sh/sh.c (find_regmode_weight): Change the type of the first + parameter and use get_ebb_head_tail. + (sh_md_init_global): Adjust uses of find_regmode_weight. + +2006-03-20 Steven Bosscher + + * function.h (struct function) : + Rename to x_stack_check_probe_note. + (tail_recursion_reentry): Rename to stack_check_probe_note. + * function.c: Replace tail_recursion_reentry with + stack_check_probe_note everywhere. + (expand_function_start): Only emit a note for + stack_check_probe_note with -fstack-protect. + * stmt.c (expand_case): Don't emit NOTE_INSN_DELETED notes. + + * emit-rtl.c (remove_unnecessary_notes): Remove. + (pass_remove_unnecessary_notes): Remove. + * rtl.h (remove_unnecessary_notes): Remove prototype. + * final.c (final_start_function): Don't call remove_unnecessary_notes. + * tree-pass.h (pass_remove_unnecessary_notes): Remove. + * passes.c (pass_remove_unnecessary_notes): Don't run it. + +2006-03-20 Andrew Pinski + + PR tree-opt/26629 + * tree-ssa-pre (phi_translate): Handle ARRAY_REF's operands. + (valid_in_set): Handle ARRAY_REF. + Change "if min_variant or VH" to asserts. + (create_component_ref_by_pieces): Handle ARRAY_REF. + (create_expression_by_pieces): Likewise. + (can_PRE_operation): ARRAY_REFs can now be PRE'd. + +2006-03-20 David Edelsohn + + * genpreds.c (write_insn_extra_address_constraint): Argument `c' + is operand of switch, not str[0]. + +2006-03-20 Alan Modra + + * config/rs6000/rs6000.c (rs6000_handle_option): Use + TARGET_NO_FP_IN_TOC inside #ifdef TARGET_USES_SYSV4_OPT too. + +2006-03-19 David Edelsohn + + * genpreds.c (write_tm_preds_h): Add semicolon and newline at + end of insn_extra_address_constraint declaration. + +2006-03-19 David Edelsohn + + * config/rs6000/rs6000.opt (no-fp-in-toc): Use Var not Mask. + (no-sum-in-toc): Same. + * config/rs6000/rs6000.c (rs6000_handle_option): Use new + variables. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Set + NO_FP_IN_TOC for -fPIC instead of mask. + + * config/rs6000/t-aix43 (T_ADAFLAGS): Delete. + (BOOT_LDFLAGS): Delete. + (LDFLAGS): Delete. + * config/rs6000/t-aix52: Same. + + * config/rs6000/rs6000.md (store_multiple_power): Delete. + (stmsi[345678]_power): New. + +2006-03-17 Steve Ellcey + + * config/ia64/ia64.opt: Add empty line to end of file. + +2006-03-17 Richard Guenther + + PR middle-end/26721 + * builtins.c (get_pointer_alignment): For component style references + adjust alignment to the component type alignment. Make sure + to adjust alignment for component access of constants. + +2006-03-17 David Edelsohn + + * config/rs6000/rs6000.md (strlensi): Emit barrier after + unconditional jump. + +2006-03-17 Paul Brook + + * doc/install.texi: Docuemnt --with-mode. + * config.gcc: Add --with-mode for arm*-*-*. + * config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "mode". + +2006-03-17 J"orn Rennecke + + * sh.c (max_labelno_before_reorg): New variable. + (sh_reorg): Initialize it. + (find_barrier): Check max_labelno_before_reorg before using + label_to_alignment. Take length of explicit alignment insns + into account. When seeing a UNSPECV_CONST_END, return it. + + * sh.c (fixup_mova): Set mode of affected label to QImode. + (untangle_mova): New function. + (find_barrier): Use it. Check mode of label before decrementing + num_mova. + (sh_reorg): Likewise. + Set mode of all insns back to VOIDmode. + + * sh.c (MOVA_LABELREF): New macro. + (mova_p, fixup_mova, sh_reorg): Use it. + (find_barrier, sh_reorg): Don't count num_mova back to 0 unless + ADDR_DIFF_VEC matches mova. + +2006-03-17 Steven Bosscher + + * dwarf2asm.c (dw2_asm_output_offset): Mark 'base' argument + with ATTRIBUTE_UNUSED. + +2006-03-17 Alexandre Oliva + + * dwarf2out.c (dwarf2out_stack_adjust): Always track the stack + pointer, instead of assuming it is possible to derive the + correct args size from a call insn. + +2006-03-16 Jan-Benedict Glaw + + * rtl.h (CONST_INT_P): Define. + * config/vax/vax.c (print_operand_address): Use CONST_INT_P() + instead of GET_CODE(x) == CONST_INT. + (vax_rtx_costs): Likewise. + (vax_output_int_move): Likewise. + (vax_output_int_add): Likewise. + (legitimate_constant_address_p): Likewise. + (index_term_p): Likewise. + * config/vax/vax.h (PRINT_OPERAND): Likewise. + * config/vax/vax.md (and3): Likewise. + (ashrsi3): Likewise. + (extv): Likewise. + (movstricthi): Likewise. + (movstrictqi): Likewise. + (rotrsi3): Likewise. + (five unnamed insns): Likewise. + +2006-03-16 Geoffrey Keating + + * doc/tm.texi (SDB and DWARF): Add extra parameter to + ASM_OUTPUT_DWARF_OFFSET. Use @var to indicate metavariables. + * dwarf2asm.h (dw2_asm_output_offset): Add section parameter. + * dwarf2asm.c (dw2_asm_output_offset): Add base section parameter. + Pass to ASM_OUTPUT_DWARF_OFFSET. + * dwarf2out.c (debug_frame_section): New. + (output_call_frame_info): Use debug_frame_section. Pass it to + dw2_asm_output_offset. + (output_die): Pass appropriate section to dw2_asm_output_offset. + (output_compilation_unit_header): Likewise. + (output_pubnames): Likewise. + (output_aranges): Likewise. + (enum dw_val_class): Break dw_val_class_lbl_offset into + dw_val_class_lineptr and dw_val_class_macptr. + (add_AT_lbl_offset): Delete. + (add_AT_lineptr): New. + (add_AT_macptr): New. + (AT_lbl): Expect a lineptr or macptr. + (print_die): Handle dw_val_class_lineptr and dw_val_class_macptr. + (attr_checksum): Likewise. + (same_dw_val_p): Likewise. + (size_of_die): Likewise. + (value_format): Likewise. + (output_die): Likewise. + (dwarf2out_finish): Call add_AT_lineptr and add_AT_macptr instead of + add_AT_lbl_offset. + * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. + * config/i386/i386.c (x86_file_start): Call darwin_file_start. + * config/darwin-protos.h (darwin_file_start): New. + (darwin_asm_output_dwarf_offset): New. + * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. + * config/rs6000/rs6000.c (rs6000_darwin_file_start): Call + darwin_file_start. + * config/darwin.c (darwin_emit_unwind_label): Don't output label + if not EH section; simplify. + (darwin_file_start): New. + (darwin_asm_output_dwarf_offset): New. + * config/darwin.h (DEBUG_FRAME_SECTION): In __DWARF segment, + mark as 'debug'. + (DEBUG_INFO_SECTION): Likewise. + (DEBUG_ABBREV_SECTION): Likewise. + (DEBUG_ARANGES_SECTION): Likewise. + (DEBUG_MACINFO_SECTION): Likewise. + (DEBUG_LINE_SECTION): Likewise. + (DEBUG_LOC_SECTION): Likewise. + (DEBUG_PUBNAMES_SECTION): Likewise. + (DEBUG_STR_SECTION): Likewise. + (DEBUG_RANGES_SECTION): Likewise. + (FRAME_BEGIN_LABEL): Must start with 'L' in debug section. + (ASM_OUTPUT_DWARF_OFFSET): New. + +2006-03-16 Joseph S. Myers + + * config.gcc (tm_defines): Always add to previous value rather + than replacing it. + +2006-03-16 Richard Sandiford + + * config/mips/predicates.md (splittable_const_int_operand): New, + split from move_operand. + (splittable_symbolic_operand): New. + (move_operand): Add commentary. Use splittable_const_int_operand. + Inline mips_atomic_symbolic_constant_p. + * config/mips/mips.md: Add combine splitters for handling moves + of splittable_const_int_operands and splittable_symbolic_operands. + * config/mips/mips-protos.h (mips_atomic_symbolic_constant_p): Delete. + (mips_split_symbol): Declare. + (mips_move_integer): Declare. + * config/mips/mips.c (mips_split_p): Make global. + (TARGET_MIN_ANCHOR_OFFSET): Override default. + (TARGET_MAX_ANCHOR_OFFSET): Likewise. + (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. + (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Likewise. + (mips_offset_within_object_p): Handle block symbols. + (mips_atomic_symbolic_constant_p): Delete. + (mips_cannot_force_const_mem): Return false for constants that + mips_legitimize_move can handle. + (mips_use_blocks_for_constant_p): New function. + (mips_split_symbol): Make global. + (mips_move_integer): Likewise. Add a temporary register argument. + (mips_legitimize_const_move): Use splittable_const_int_operand and + splittable_symbolic_operand. + (mips_use_anchors_for_symbol_p): New function. + * config/mips/mips.h: Protect externs with !USED_FOR_TARGET. + (mips_split_p): Declare. + +2006-03-16 Richard Sandiford + + * config.gcc (mips64*-*-linux*): Keep existing tm_defines. + (mips*-*-linux*): Likewise. + +2006-03-16 Roger Sayle + Daniel Speyer + + PR middle-end/18259 + * tree-dump.c (dump_real): New function. + (dequeue_and_dump) : Use it to dump FP constants. + * Makefile.in (REAL_H): New macro for dependencies on real.h. + (tree-dump.o): Add $(REAL_H) to the dependencies. + +2006-03-16 Roger Sayle + + PR middle-end/21781 + * real.c (real_from_string): If the mantissa is zero, don't bother + parsing the exponent as the result should always be zero. + +2006-03-16 Andreas Krebbel + + * simplify-rtx.c (simplify_plus_minus): Simplify within CONST terms. + +2006-03-16 Maxim Kuvyrkov + + * config/ia64/ia64.c (stops_p): Added explicit initialization. + (ia64_first_cycle_multipass_dfa_lookahead_guard_spec, + ia64_h_i_d_extended, ia64_set_sched_flags, ia64_speculate_insn, + ia64_needs_block_p, ia64_gen_check, ia64_sched_init_global, + ia64_sched_finish_global): New static functions to implement + hooks from gcc_target.sched. + (spec_check_no, max_uid, pending_data_specs): New static variables. + (ia64_mode_to_int, ia64_gen_spec_insn, ia64_spec_check_p, + ia64_spec_check_src_p): New static functions. + (ia64_adjust_cost): Renamed to ia64_adjust_cost_2. + (TARGET_SCHED_ADJUST_COST): Removed. + (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_INIT_GLOBAL, + TARGET_SCHED_FINISH_GLOBAL, TARGET_SCHED_H_I_D_EXTENDED, + TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, + TARGET_SCHED_GEN_CHECK, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, + TARGET_SCHED_SET_SCHED_FLAGS): New macros. + (update_set_flags, group_barrier_needed, set_src_needs_barrier): + Fixed to handle speculation checks. + (rtx_needs_barrier): Fixed to handle speculative loads and + their checks. + (ia64_variable_issue): Added code to count speculative loads and their + checks. + (ia64_first_cycle_multipass_dfa_lookahead_guard): Fixed to handle + speculative loads. + (enum SPEC_MODES, enum SPEC_GEN_LD_MAP, SPEC_GEN_CHECK_OFFSET): + New enumerations. + (SPEC_GEN_EXTEND_OFFSET, SPEC_N, SPEC_GEN_CHECK_MUTATION_OFFSET): + New constants. + (ia64_ld_address_bypass_p): Fixed to handle speculative loads. + (ia64_reorg): Reset stops_p to NULL after it is freed. + * config/ia64/ia64.md (UNSPEC_LDA, UNSPEC_LDS, UNSPEC_LDSA, + UNSPEC_LDCCLR, UNSPEC_CHKACLR, UNSPEC_CHKS): New constants. + (itanium_class): chk_s renamed to chk_s_i. New constants: chk_s_f, + chk_a. + (data_speculative, control_speculative, check_load): New attributes. + (mov_advanced, mov_speculative, + mov_speculative_advanced, zero_extenddi2_advanced, + zero_extenddi2_speculative, + zero_extenddi2_speculative_advanced): New patterns for + data and control speculative loads. + (mov_clr, zero_extenddi2_clr): New patterns for + check loads. + (advanced_load_check_clr_, speculation_check_): + New pattern for data and control speculation checks. + (MODE, MODE_FOR_EXTEND, output_a, output_s, output_sa, output_c_clr, + ld_reg_constr, ldc_reg_constr, chk_reg_constr, mem_constr, + reg_pred_prefix, ld_class, chka_class, chks_class, attr_yes): + Auxiliary definitions for the patterns. + * config/ia64/itanium1.md (1_fldc, 1_fldpc, 1_ldc, 1_chk_s_f, 1_chk_a, + 1b_fldc, 1b_fldpc, 1b_ldc, 1b_chk_s_f, 1b_chk_a): New resource + constraints. + (1_fld, 1_fldp, 1_ld, 1b_fld, 1b_fldp, 1b_ld): Add a condition + for speculation. + (1_chk_s, 1b_chk_s): Renamed to 1_chk_s_i, 1b_chk_s_i. + * config/ia64/itanium2.md (2_flda, 2_fldc, 2_fldpc, 2_ldc, 2_chk_s_f, + 2_chk_a, 2b_flda, 2b_fldc, 2b_fldpc, 2b_ldc, 2b_chk_s_f, 2b_chk_a): + New resource constraints. + (2_fld, 2_fldp, 2_ld, 2b_fld, 2b_fldp, 2b_ld): Add a condition + for speculation. + (2_chk_s, 2b_chk_s): Renamed to 2_chk_s_i, 2b_chk_s_i. + * config/ia64/ia64.opt (msched-br-data-spec, msched-ar-data-spec, + msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, + msched-in-control-spec, msched-ldc, msched-control-ldc, + msched-spec-verbose, msched-prefer-non-data-spec-insns, + msched-prefer-non-control-spec-insns, + msched-count-spec-in-critical-path): New flags to tune speculative + scheduling. + * doc/invoke.texi (msched-br-data-spec, msched-ar-data-spec, + msched-control-spec, msched-br-in-data-spec, msched-ar-in-data-spec, + msched-in-control-spec, msched-ldc, msched-control-ldc, + msched-spec-verbose, msched-prefer-non-data-spec-insns, + msched-prefer-non-control-spec-insns, + msched-count-spec-in-critical-path): Document new flags. + +2006-03-16 Maxim Kuvyrkov + + * target.h (struct spec_info_def): New opaque declaration. + (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, + speculate_insn, needs_block_p, gen_check, + first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. + * target-def.h (TARGET_SCHED_ADJUST_COST_2, + TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, + TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, + TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in + gcc_target.sched. + (TARGET_SCHED): Use new macros. + * rtl.h (copy_DEPS_LIST_list): New prototype. + * sched-int.h (struct sched_info): Change signature of new_ready field, + adjust all initializations. New fields: add_remove_insn, + begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, + region_head_or_leaf_p. + (struct spec_info_def): New structure declaration. + (spec_info_t): New typedef. + (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, + recovery_block, orig_pat. + (glat_start, glat_end): New variables declaraions. + (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): + New access macros. + (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, + DETACH_LIFE_INFO, USE_GLAT. + (enum SPEC_SCHED_FLAGS): New enumeration. + (NOTE_NOTE_BB_P): New macro. + (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, + attach_life_info, debug_spec_status, check_reg_live): New functions. + (get_block_head_tail): Change signature to get_ebb_head_tail, adjust + all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, + sched-ebb.c + (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . + * ddg.c (get_block_head_tail): Adjust all uses. + * modulo-sched.c (get_block_head_tail): Adjust all uses. + (sms_sched_info): Initialize new fields. + (contributes_to_priority): Removed. + * haifa-sched.c (params.h): New include. + (get_block_head_tail): Adjust all uses. + (ISSUE_POINTS): New macro. + (glat_start, glat_end): New global variables. + (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, + nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, + old_last_basic_block, before_recovery, current_sched_info_var, + rgn_n_insns, luid): New static variables. + (insn_cost1): New function. Move logic from insn_cost to here. + (find_insn_reg_weight1): New function. Move logic from + find_insn_reg_weight to here. + (reemit_notes, move_insn, max_issue): Change signature. + (move_insn1): Removed. + (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, + extend_bb): New static functions to support extension of scheduler's + data structures. + (generate_recovery_code, process_insn_depend_be_in_spec, + begin_speculative_block, add_to_speculative_block, + init_before_recovery, create_recovery_block, create_check_block_twin, + fix_recovery_deps): New static functions to support + generation of recovery code. + (fix_jump_move, find_fallthru_edge, dump_new_block_header, + restore_bb_notes, move_block_after_check, move_succs): New static + functions to support ebb scheduling. + (init_glat, init_glat1, attach_life_info1, free_glat): New static + functions to support handling of register live information. + (associate_line_notes_with_blocks, change_pattern, speculate_insn, + sched_remove_insn, clear_priorities, calc_priorities, bb_note, + add_jump_dependencies): New static functions. + (check_cfg, has_edge_p, check_sched_flags): New static functions for + consistancy checking. + (debug_spec_status): New function to call from debugger. + (priority): Added code to handle speculation checks. + (rank_for_schedule): Added code to distinguish speculative instructions. + (schedule_insn): Added code to handle speculation checks. + (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): + Fixed to handle ebbs. + (move_insn): Added code to handle ebb scheduling. + (max_issue): Added code to use ISSUE_POINTS of instructions. + (choose_ready): Added code to choose between speculative and + non-speculative instructions. + (schedule_block): Added code to handle ebb scheduling and scheduling of + speculative instructions. + (sched_init): Initialize new variables. + (sched_finish): Free new variables. Print statistics. + (try_ready): Added code to handle speculative instructions. + * lists.c (copy_DEPS_LIST_list): New function. + * sched-deps.c (extend_dependency_caches): New function. Move logic + from create_dependency_caches to here. + (get_dep_weak, ds_merge): Make global. + * genattr.c (main): Code to output prototype for + dfa_clear_single_insn_cache. + * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. + (output_dfa_clean_insn_cache_func): Code to output + dfa_clear_single_insn_cache function. + * sched-ebb.c (target_n_insns): Remove. Adjust all users to use + n_insns. + (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): + Removed. + (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): + New static variables. + (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, + fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from + struct sched_info. + (ebb_sched_info): Initialize new fields. + (get_block_head_tail): Adjust all uses. + (compute_jump_reg_dependencies): Fixed to use glat_start. + (schedule_ebb): Code to remove unreachable last block. + (schedule_ebbs): Added code to update register live information. + * sched-rgn.c (region_sched_info): Initialize new fields. + (get_block_head_tail): Adjust all uses. + (last_was_jump): Removed. Adjust users. + (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, + add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): + Implement new hooks. + (check_dead_notes1): New static function. + (struct region): New fields: dont_calc_deps, has_real_ebb. + (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. + (BB_TO_BLOCK): Fixed to handle EBBs. + (EBB_FIRST_BB, EBB_LAST_BB): New macros. + (ebb_head): New static variable. + (debug_regions, contributes_to_priority): Fixed to handle EBBs. + (find_single_block_regions, find_rgns, find_more_rgns): Initialize + new fields. + (compute_dom_prob_ps): New assertion. + (check_live_1, update_live_1): Fixed to work with glat_start instead of + global_live_at_start. + (init_ready_list): New assertions. + (can_schedule_ready_p): Split update code to begin_schedule_ready. + (new_ready): Add support for BEGIN_CONTROL speculation. + (schedule_insns): Fixed code that updates register live information + to handle EBBs. + (schedule_region): Fixed to handle EBBs. + (init_regions): Use extend_regions and check_dead_notes1. + * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, + PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. + * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, + TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, + TARGET_SCHED_GEN_CHECK, + TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, + TARGET_SCHED_SET_SCHED_FLAGS): Document. + * doc/invoke.texi (max-sched-insn-conflict-delay, + sched-spec-prob-cutoff): Document. + +2006-03-16 Maxim Kuvyrkov + + * sched-int.h (struct haifa_insn_data): New fields: resolved_deps, + inter_tick, queue_index. + (struct sched_info): Change signature of init_ready_list field. + Adjust all initializations. + (RESOLVED_DEPS): New access macro. + (ready_add): Remove prototype. + (try_ready): Add prototype. + * sched-rgn.c (init_ready_list): Use try_ready. + (schedule_region): Initialize + current_sched_info->{sched_max_insns_priority, queue_must_finish_empty}. + * sched-ebb.c (new_ready): Remove. Adjust ebb_sched_info. + (init_ready_list): Use try_ready. + (schedule_ebb): Initialize current_sched_info->sched_max_insns_priority. + * lists.c (remove_list_elem): Remove `static'. + (remove_free_INSN_LIST_elem): New function. + * rtl.h (remove_list_elem, remove_free_INSN_LIST_elem): Add prototypes. + * haifa-sched.c (INTER_TICK, QUEUE_INDEX): New macros. + (INVALID_TICK, MIN_TICK, QUEUE_SCHEDULED, QUEUE_NOWHERE, QUEUE_READY): + New constants. + (readyp): New variable. + (queue_remove, ready_remove_insn, fix_inter_tick, fix_tick_ready, + change_queue_index, resolve_dep): New static functions. + (try_ready): New function. Adjust callers in sched-rgn.c and + sched-ebb.c to use it instead of ready_add. + (clock_var): Move at the begining of file. + (rank_for_schedule): Fix typo. + (queue_insn): Add assertion. Handle QUEUE_INDEX. + (ready_lastpos): Enforce assertion. + (ready_add): Make it static. Handle QUEUE_INDEX. Add new argument, + update all callers. + (ready_remove_first, ready_remove): Handle QUEUE_INDEX. + (schedule_insn): Rewrite to use try_ready and resolve_dep. + (queue_to_ready): Use free_INSN_LIST_list. + (early_queue_to_ready): Fix typo. + (schedule_block): Init readyp. Move init_ready_list call after the + initialization of clock_var. Fix error in rejecting insn by + targetm.sched.dfa_new_cycle. Add call to fix_inter_tick. Remove code + that previously corrected INSN_TICKs. Add code for handling + QUEUE_INDEX. + (set_priorities): Fix typo. + (sched_init): Initialize INSN_TICK, INTER_TICK and QUEUE_INDEX. + Clarify comment and code that keeps current_sched_info->next_tail + non-null. + +2006-03-16 Maxim Kuvyrkov + + * sched-rgn.c (extend_rgns): New static function. + (find_rgns): Use it. + (gather_region_statistics, print_region_statistics): New static + functions. + * params.def (PARAM_MAX_SCHED_EXTEND_REGIONS_ITERS): New parameter. + * doc/invoke.texi (max-sched-extend-regions-iters): Document. + +2006-03-16 Maxim Kuvyrkov + Andrey Belevantsev + + * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. + * lists.c (unused_deps_list): New variable. + (free_list): Add assertions to verify the proper distinguishing + between INSN_LISTs and DEPS_LISTs. + (find_list_elem, remove_list_elem, remove_list_node): New static + functions. + (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, + remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, + remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. + (alloc_INSN_LIST): Assert that the list we're working on is indeed + an INSN_LIST. + (free_INSN_LIST_node): Likewise. + * modulo-sched.c (current_sched_info): Initialize flags field. + * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. + * rtl.def (DEPS_LIST): Define. + * rtl.h: Declare new functions from lists.c. + * sched-deps.c (spec_dependency_cache): New static variable. + (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. + (add_dependence): Change return type to void. Move the logic to ... + (add_or_update_back_dep_1): ... here. Handle speculative dependencies. + (delete_all_dependences): Add comment about forward_dependency_cache. + Handle spec_dependency_cache. Handle DEPS_LISTs. + (fixup_sched_groups): Clarify the change of priority of output + and anti dependencies. + (sched_analyze_2): Adjust add_dependence calls to create data + speculative dependence. + (add_forward_dependence): Renamed to add_forw_dep, change prototype. + Adjust all callers. Handle DEPS_LISTS. + (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in + presence of speculation. + (init_dependency_caches, free_dependency_caches): + Handle spec_dependency_cache. + (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, + estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): + New static functions. + (add_or_update_back_dep, add_or_update_back_forw_dep, + add_back_forw_dep, delete_back_forw_dep): New functions. + * sched-int.h (ds_t, dw_t): New typedefs. + (struct sched_info): Add new field flags. + (struct haifa_insn_data): Add new bitfield has_internal_dep. + Prototype new sched-deps.c functions. + (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. + (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, + MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, + BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, + SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, + SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): + New constants. + (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): + New enums. + * sched-rgn.c (current_sched_info): Initialize flags field. + (schedule_insns): Initialize current_sched_info before the sched_init + call. + * sched-ebb.c (current_sched_info): Initialize flags field. + (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. + Call add_or_update_back_dep instead of add_dependence. + Create control speculative dependencies. + (schedule_insns): Initialize current_sched_info before the sched_init + call. + +2006-03-16 Kaz Kojima + + * config/sh/linux-unwind.h (shmedia_fallback_frame_state): Set + fs->signal_frame. + (sh_fallback_frame_state): Likewise. + +2006-03-15 Geoffrey Keating + + * config.gcc (*-*-darwin*): Don't build crt2.o for all Darwin ports. + Do switch on default_use_cxa_atexit. + (powerpc*-*-darwin*): Build crt2.o on powerpc. + * config/darwin-crt3.o: New. + * config/darwin.h (LINK_SPEC): If -shared-libgcc, make linker default + to 10.3. Pass '-multiply_defined suppress' if crt3.o is in use. + (STARTFILE_SPEC): Add crt3.o when -shared-libgcc and appropriate + OS version. + * config/rs6000/t-darwin: Move crt2.o building to here. + * config/rs6000/darwin.h (C_COMMON_OVERRIDE_OPTIONS): Update + Mac OS version for using __cxa_get_exception_ptr. Don't test versions + of __cxa_atexit. + +2006-03-15 Jan-Benedict Glaw + + * config/vax/vax.c (nonindexed_address_p): Change logical negation + from '! xxx' to '!xxx' for coding-style conformance. + * config/vax/vax.h (PCC_BITFIELD_TYPE_MATTERS): Likewise. + (EXTRA_CONSTRAINT): Likewise. + * config/vax/vax.md (four unnamed insns): Likewise. + +2006-03-15 Paul Brook + + * config/arm/arm.c (minipool_pad): New. + (add_minipool_forward_ref): Include pool alignment padding in address + calculation. + (push_minipool_fix): Set minipool_pad. + (minipool_pad): Ditto. + +2006-03-15 Jan-Benedict Glaw + + * config/vax/vax.c (split_quadword_operands): Use MEM_P() + instead of GET_CODE() == MEM and REG_P() instead of + GET_CODE() == REG. + (print_operand_address): Likewise. + (vax_address_cost): Likewise. + (vax_rtx_costs): Likewise. + (vax_notice_update_cc): Likewise. + (vax_output_int_add): Likewise. + (INDEX_REGISTER_P): Likewise. + (BASE_REGISTER_P): Likewise. + (nonindexed_address_p): Likewise. + (vax_mode_dependent_address_p): Likewise. + * config/vax/vax.h (EXTRA_CONSTRAINT): Likewise. + (PRINT_OPERAND): Likewise. + * config/vax/vax.md (ashlsi3): Likewise. + (ashlsi3): Likewise. + (some more unnamed insns): Likewise. + +2006-03-15 Kazu Hirata + + * tree-ssa-dce.c (EXECUTE_IF_CONTROL_DEPENDENT): Make it an + iterator-style macro. + (mark_control_dependent_edges_necessary): Update the use of + EXECUTE_IF_CONTROL_DEPENDENT. + +2006-03-15 J"orn Rennecke + + * config/sh/predicates.md (cache_address_operand): Special. + (ua_address_operand): Likewise. + +2006-03-15 Zdenek Dvorak + + * haifa-sched.c (unlink_other_notes, reemit_notes): Do not handle + loop notes. + * sched-deps.c (sched_analyze_insn, sched_analyze): Ditto. + +2006-03-15 Andreas Schwab + + * gensupport.c (identify_predicable_attribute): Don't free p_false + when it is still in use. + +2006-03-15 Eric Botcazou + + * config.gcc (default with_cpu setting) : Do not modify + the default setting here. + +2006-03-14 Steven Bosscher + + * tree-pass.h (pass_cfg): Remove. + * alias.c (rest_of_handle_cfg, pass_cfg): Remove. + * passes.c (pass_cfg): Don't run it. + +2006-03-14 Kazu Hirata + + * Makefile.in (reg-stack.o): Don't depend on gt-reg-stack.h. + * reg-stack.c (stack_regs_mentioned_data): Change the type to + VEC(char,heap) *. + (stack_regs_mentioned): Update the uses of + stack_regs_mentioned_data. Don't access the array beyond its + end. + (reg_to_stack): Update the uses of stack_regs_mentioned_data. + Don't include gt-reg-stack.h. + + * config/bfin/bfin.h (UNALIGNED_WORD_ASM_OP): Remove. + * system.h (UNALIGNED_WORD_ASM_OP): Poison. + + * combine.c (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD): Remove. + + PR middle-end/26684 + * reg-stack.c (stack_regs_mentioned_data): Put it undef #ifdef + STACK_REGS. + +2006-03-14 John David Anglin + + * pa/pa32-linux.h (CRT_CALL_STATIC_FUNCTION): Fix typo. + +2006-03-14 Richard Guenther + + PR tree-optimization/26672 + * tree-ssa-propagate.c (set_rhs): Don't walk DEFs if not in + SSA form. + +2006-03-14 Richard Guenther + + PR tree-optimization/26667 + * ipa-inline.c (cgraph_check_inline_limits): Walk the correct + node for the callees. Always allow inlining if it will shrink + the function size. + +2006-03-14 Richard Guenther + + PR middle-end/26659 + * builtins.c (get_pointer_alignment): Prefer alignment + information from decls over that from types. + +2006-03-14 Andrew Pinski + + PR target/26657 + * config/darwin.h (LINK_COMMAND_SPEC): Handle -fopenmp. + +2006-03-14 Joseph S. Myers + + * config/rs6000/rs6000.opt (mdlmzb): New option. + (msched-prolog, msched-epilog): Use Var not Mask. + * doc/invoke.texi (-mdlmzb): Document. + * config/rs6000/rs6000.c (TARGET_DEFAULT_TARGET_FLAGS): Remove + MASK_SCHED_PROLOG. + (rs6000_override_options): Enable -mdlmzb for 405 and 440. + * config/rs6000/rs6000.md: Add dlmzb support for 405 and 440. + +2006-03-13 Uttam Pawar + + PR rtl-optimization/25739 + * bt-load.c (augment_live_range): Free tos pointer. + + * gensupport.c (identify_predicable_attribute): Free + p_false pointer. + * gcov.c (create_file_names): Free name pointer. + +2006-03-13 Roger Sayle + + PR middle-end/26557 + * stmt.c (emit_case_nodes): Handle the case where the index is a + CONST_INT, where the comparison mode is specified by the index type. + +2006-03-13 John David Anglin + + * pa/pa32-linux.h (CRT_CALL_STATIC_FUNCTION): Define when CRTSTUFFS_O + is defined. + +2006-03-13 Richard Sandiford + + * config/mips/mips.md (*branch_fp): Use %Z2 for the condition. + (*branch_fp_inverted): Likewise. + +2006-03-13 Jakub Jelinek + + PR middle-end/25989 + * omp-low.c (expand_omp_for_generic): Mark istart0 + and iend0 as addressable. + +2006-03-13 Jie Zhang + + * config/bfin/uclinux.h: Define _GNU_SOURCE in CPLUSPLUS_CPP_SPEC. + +2006-03-13 Jeff Law + + * tree-vrp.c (stmt_interesting_for_vrp): Some statements with + virtual operands are interesting. + (vrp_visit_stmt): Corresponding changes. + +2006-03-13 Bernd Schmidt + + * config/bfin/lib1funcs.asm (___umodsi3): Use stack to save contents + of RETS. + * config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): If + TARGET_ID_SHARED_LIBRARY, define __ID_SHARED_LIB__. + * config/bfin/crti.S: Use it instead of __PIC__. + * config/bfin/crtn.S: Likewise. + + * config/bfin/bfin.md (call_value_symbol, sibcall_value_symbol, + call_symbol, sibcall_symbol): Disallow if TARGET_ID_SHARED_LIBRARY, + not if flag_pic. + Lose 'G' modifier for call operand. + * config/bfin/bfin.c (print_operand) : Don't + recognize 'G' modifier. + +2006-03-13 Eric Botcazou + + PR middle-end/18859 + * gimplify.c (gimplify_switch_expr): Discard empty ranges. + * stmt.c (expand_case): Likewise. + +2006-03-13 Zdenek Dvorak + + PR rtl-optimization/26254 + * loop-invariant.c (seq_insns_valid_p): New function. + (move_invariant_reg): Only emit new code if it is valid. + +2006-03-13 Zdenek Dvorak + + * cfgrtl.c (last_loop_beg_note, back_edge_of_syntactic_loop_p): + Removed. + (force_nonfallthru_and_redirect): Do not use last_loop_beg_note. + (rtl_split_edge): Do not use back_edge_of_syntactic_loop_p. + (commit_one_edge_insertion): Do not look for loop notes. + +2006-03-13 Zdenek Dvorak + + * jump.c (follow_jumps): Do not check for loop notes. Move check for + flag_test_coverage out of loop. + +2006-03-13 Zdenek Dvorak + + * final.c (shorten_branches): Remove outdated comment, and turn + the if branch that guards it to continue. + +2006-03-13 Zdenek Dvorak + + * cfgloop.c (flow_loop_dump): Do not dump loop->invalid field. + * cfgloop.h (struct loop): Remove unused fields. + +2006-03-13 Kazu Hirata + + * doc/invoke.texi (-fdump-rtl-loop): Remove. + (-dL, -fdump-rtl-loop2): Update the dump file names + + * doc/invoke.texi: Update dump file names. + +2006-03-12 Steven Bosscher + + * predict.c (estimate_probability): Remove. + * profile.c (rest_of_handle_branch_prob, pass_branch_prob): Remove. + * basic-block.h (estimate_probability): Remove prototype. + * passes.c (finish_optimization_passes): Dump branch prediction or + profiling heuristics to the .profile tree dump. + (init_optimization_passes): Unqueue pass_branch_prob. + + * doc/invoke.texi (-fdump-rtl-bp): Remove. + +2006-03-11 Steven Bosscher + + * rtl.def (LABEL_REF): Remove the field for LABEL_NEXTREF. + * rtl.h (LABEL_NEXTREF): Remove field accessor. + +2006-03-11 Eric Botcazou + + * function.h (frame_offset_overflow): Declare. + * function.c (frame_offset_overflow): New function. + (assign_stack_local_1): Call it to detect that the offset overflows. + * cfgexpand.c (alloc_stack_frame_space): Likewise. + +2006-03-11 Steven Bosscher + + * config/sh/sh.c: Include alloc-pool.h. + (label_ref_list_pool): New alloc pool. + (label_ref_list_t): New type for lists of labels. + (struct pool_node): Make wend a label_ref_list_t. + (add_constant): Use the new type, eradicate LABEL_NEXTREF + references. + (dump_table): Likewise. + (sh_reorg): Set up the alloc pool before using add_constant and + dump_table, and destroy it when finishing. + +2006-03-11 Richard Sandiford + + * config/mips/mips.c: Remove redundant comment. + +2006-03-10 Jason Merrill + + PR c/26004 + * gimplify.c (gimplify_modify_expr_rhs): Don't do return slot opt if + the target was declared 'register'. + +2006-03-10 Adam Nemet + + * genpreds.c (write_insn_constraint_len): Change definition of + insn_constraint_len to return size_t to match the declaration. + +2006-03-10 DJ Delorie + + * config/m32c/m32c.c (m32c_const_ok_for_constraint_p): Bit numbers + start at zero. + (m32c_expand_insv): Fix test for an AND mask. + +2006-03-10 Richard Guenther + + PR middle-end/26565 + * builtins.c (get_pointer_alignment): Handle component + references for field alignment. + +2006-03-10 J"orn Rennecke + + * config.gcc (sh*-superh-elf, sh*elf (newlib)): Use newlib.h + when building with libgloss. + (sh*elf): Implement --without-fp option. + (sh64-superh-linux*): Don't multilib. + +2006-03-10 J"orn Rennecke + + * struct-equiv.c (rtx_equiv_p): Fix POST_MODIFY case. + +2006-03-09 Andrew Pinski + + * tree-ssa-phiopt.c (tree_ssa_phiopt): Add cfgchanged variable. + Set it when one of the replacement functions returned true. + Return TODO_cleanup_cfg if cfgchanged is true. + (pass_phiopt) : Remove TODO_cleanup_cfg. + +2006-03-09 Adam Nemet + + * combine.c (simplify_shift_const_1): Use gen_lowpart_or_truncate + instead of gen_lowpart. + +2006-03-09 Richard Sandiford + + * config/mips/mips-protos.h (mips_output_conditional_branch): Change + interface. + (mips_output_order_conditional_branch): Declare. + * config/mips/mips.h (MIPS_BRANCH): New macro. + * config/mips/mips.c (gen_conditional_branch): Use VOIDmode + for the comparison. Use gen_condjump. + (mips_output_conditional_branch): Rework interface to take the + asm templates for a direct branch and the inverse of a direct branch. + (mips_output_order_conditional_branch): New function. + (mips_builtin_branch_and_move): New function. + (mips_expand_builtin_compare): Use it. Use VOIDmode for the + branch condition. Use gen_single_cc as the condition for + __builtin_mips_upper_* or __builtin_mips_lower_*. + (mips_expand_builtin_bposge): Use mips_builtin_branch_and_move. + Use VOIDmode for the branch condition. + * config/mips/predicates.md (order_operator): New predicate. + * config/mips/mips.md (UNSPEC_SINGLE_CC): New constant. + (branch_fp): Rename to... + (*branch_fp): ...this. Remove mode from comparison operator. + Use new mips_output_conditional_branch interface. + (branch_fp_inverted): Rename to... + (*branch_fp_inverted): ...this and update as for *branch_fp. + (*branch_zero): Rename to... + (*branch_order): ...this. Remove mode from comparison operator. + Use mips_output_order_conditional_branch. Only accept ordered + comparisons. + (*branch_zero_inverted): Rename to... + (*branch_order_inverted): ...this and update as for + *branch_order. + (*branch_equality): Accept zero as the second operand to + the equality operator. Use the new mips_output_conditional_branch + interface. + (*branch_equality_inverted): Likewise. + (condjump): New expander. + * config/mips/mips-dsp.md (mips_bposge): Remove mode from comparison + operator. + * config/mips/mips-ps-3d.md (bc1any4t, bc1any4f): Likewise. + (bc1any2t, bc1any2f): Likewise. + (single_cc): New expander. + (*branch_upper_lower, *branch_upper_lower_inverted): New patterns. + +2006-03-09 Richard Sandiford + + * doc/md.texi: Update documentation of MIPS constraints. + * config/mips/constraints.md: New file. + * config/mips/mips.md: Include it. + * config/mips/mips.c (mips_char_to_class): Delete. + (override_options): Don't initialize mips_char_to_class. + * config/mips/mips.h (mips_char_to_class): Delete. + (REG_CLASS_FROM_LETTER): Delete. + (CONST_OK_FOR_LETTER_P): Delete. + (CONST_DOUBLE_OK_FOR_LETTER_P): Delete. + (EXTRA_CONSTRAINT_Y): Delete. + (EXTRA_CONSTRAINT_STR): Delete. + (CONSTRAINT_LEN): Delete. + (EXTRA_MEMORY_CONSTRAINT): Delete. + +2006-03-09 Diego Novillo + + * tree-cfg.c (move_block_to_fn): Remove the statements from the + original fn's eh regions. + +2006-03-09 Eric Botcazou + + * fold-const.c (build_range_check): Make sure to use a valid type to + apply the "(c>=low) && (c<=high) into (c-low>=0) && (c-low<=high-low)" + transformation. + + (range_predecessor): New static function. + (range_successor): Likewise. + (merge_ranges): Use them to compute predecessors and successors of + range bounds. + +2006-03-09 Roger Sayle + + PR middle-end/26561 + * fold-const.c (fold_div_compare): When optimizing X/C1 op C2 as + X op C3, consider whether C3 overflows towards +Inf or -Inf. + +2006-03-08 DJ Delorie + + * config/m32c/addsub.md (addqi3): Disparage a0/a1. + (addpsi3): Expand to include memory operands. Remove + reload-specific splits. + * config/m32c/bitops.md (bset_qi, bset_hi, bclr_qi): New. + (andqi3_16, andhi3_16, iorqi3_16, iorhi3_16): New. + (andqi3_24, andhi3_24, iorqi3_24, iorhi3_24): New. + (andqi3, andhi3, iorqi3, iorhi3): Convert to expanders. + (shift1_qi, shift1_hi, insv): New. + * config/m32c/cond.md (cbranchqi4, cbranchhi4): Remove. + (cbranch4, stzx_16, stzx_24_, stzx_reversed, + cmp, b, s, s_24, movqicc, movhicc, + cond_to_int): New. + * config/m32c/m32c-protos.h: Update as needed. + * config/m32c/m32c.c (m32c_reg_class_from_constraint): Don't + default the Rcr, Rcl, Raw, and Ral constraints. Add Ra0 and Ra1. + Fail for unrecognized R* constraints. + (m32c_cannot_change_mode_class): Be more picky about pseudos. + (m32c_const_ok_for_constraint_p): Add Imb, Imw, and I00. + (m32c_extra_constraint_p2): Allow (mem (plus (plus fb int) int)). + Add Sp constraint. + (m32c_init_libfuncs): New. + (m32c_legitimate_address_p): Add debug wrapper. + (m32c_rtx_costs): New. + (m32c_address_cost): New. + (conversions): Add 'B' prefix. + (m32c_print_operand): 'h' and 'H' pick lower and upper halves of + operands, or word regnames for QI operands. 'B' prints bit + position. + (m32c_expand_setmemhi): New. + (m32c_expand_movmemhi): New. + (m32c_expand_movstr): New. + (m32c_expand_cmpstr): New. + (m32c_prepare_shift): Shift counts are limited to 16 bits at a time. + (m32c_expand_neg_mulpsi3): Handle non-ints. + (m32c_cmp_flg_0): New. + (m32c_expand_movcc): New. + (m32c_expand_insv): New. + (m32c_scc_pattern): New. + * config/m32c/m32c.h (reg classes): Add AO_REGS and A1_REGS. Take + a0/a1 out of SIregs. + (STORE_FLAG_VALUE): New. + * config/m32c/m32c.md: Add unspecs for string moves. Define various mode and + code macros. + (no_insn): New. + * config/m32c/mov.md: Make constraints more liberal. + (zero_extendqihi2): Optimize r0/r1 case. + * config/m32c/muldiv.md (mulpsi3): Check for intvals. + * config/m32c/predicates.md (m32c_any_operand): New. + (m32c_nonimmediate_operand): New. + (m32c_hl_operand): New. + (m32c_r3_operand): New. + (ap_operand): New. + (ma_operand): New. + (memsym_operand): New. + (memimmed_operand): New. + (a_qi_operand): New. + (m32c_eqne_operator): New. + (m32c_1bit8_operand): New. + (m32c_1bit16_operand): New. + (m32c_1mask8_operand): New. + (m32c_1mask16_operand): New. + * config/m32c/blkmov.md: New file. + * config/m32c/t-m32c (MD_FILES): Add blkmov. + +2006-03-08 Andreas Tobler + + * dwarf2out.c (expand_builtin_dwarf_sp_column): Make dwarf_regnum + unsigned to fix signed/unsigned comparison issue in + DWARF2_FRAME_REG_OUT. + (expand_builtin_init_dwarf_reg_sizes): Make i unsigned to fix signed/ + unsigned comparison issue in DWARF2_FRAME_REG_OUT. + + * tree-ssa-operands.c (finalize_ssa_def_ops): Move the declaration + of ptr into the ENABLE_CHECKING section. + +2006-03-08 Jeff Law + + * tree-vrp.c (infer_value_range): Only count pointer uses + and dereferences if -fdelete-null-pointer-checks is enabled. + + * tree-vrp.c (find_assert_locations): Infer value ranges for + single use pointers, but do not create ASSERT_EXPRs for them. + When a non-null range is inferred for a pointer, backwards + propagate that range to other equivalent pointers through the + use-def chain. + +2006-03-08 Paolo Bonzini + + PR bootstrap/26500 + * Makefile.in (dvi, html, install-info): Invoke the corresponding + language hook targets. + * ada/Make-lang.in, cp/Make-lang.in, objc/Make-lang.in, + objcp/Make-lang.in: Create stub rules for dvi, html, install-info + if language hook targets were missing. + +2006-03-07 Zdenek Dvorak + + * tree-ssa-opfinalize.h: Removed. + * Makefile.in (tree-ssa-operands.o): Remove tree-ssa-opfinalize.h + dependency. + * tree-ssa-operands.c: Do not include tree-ssa-opfinalize.h. + (ALLOC_OPTYPE, APPEND_OP_AFTER, MOVE_HEAD_AFTER, MOVE_HEAD_TO_FREELIST, + INITIALIZE_USE, add_def_op, add_use_op, add_vuse_op, add_maydef_op, + add_mustdef_op, finalize_ssa_def_ops, finalize_ssa_use_ops, + finalize_ssa_v_may_def_ops, finalize_ssa_vuse_ops, + finalize_ssa_v_must_def_ops): New. + +2006-03-07 Kenneth Zadeck + + * df-scan.c: (df_bb_refs_record): Fix obvious typo with wrong + block as parameter. + +2006-03-07 Geoffrey Keating + + * varasm.c (assemble_end_function): Say that 'fnname' is unused. + + * config/i386/i386.c (ix86_delegitimize_address): Handle Darwin + addresses with offsets; reorganize. + + * dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file. + (expand_builtin_dwarf_sp_column): Call DWARF2_FRAME_REG_OUT. + (expand_builtin_init_dwarf_reg_sizes): Likewise. + +2006-03-08 David Billinghurst + + PR target/26588 + * config/i386/cygwin.h (GOMP_SELF_SPECS): Define. + +2006-03-08 Ben Elliston + + * config/fp-bit.h (CMPtype): Typedef to a word mode integer. + +2006-03-07 Aldy Hernandez + + PR gomp/26238 + * doc/passes.texi (Tree-SSA passes): Document omp lowering and + expansion. + +2006-03-07 Richard Guenther + + PR tree-optimization/26587 + * tree-ssa-structalias.c (handle_ptr_arith): Handle MINUS_EXPR. + +2006-03-07 Richard Sandiford + + * varasm.c (assemble_variable): Fix setting of DECL_IN_TEXT_SECTION. + +2006-03-07 Richard Sandiford + + * hooks.c (hook_bool_mode_rtx_true): New function. + * hooks.h (hook_bool_mode_rtx_true): Declare. + * toplev.c (compile_file): Call output_shared_constant_pool. + * varasm.c (shared_constant_pool): New variable. + (assemble_start_function, assemble_end_function): Remove arguments + from call to output_constant_pool. + (create_constant_pool): New function, split out from... + (init_varasm_status): ...here. + (force_const_mem): Choose between the shared and per-function constant + pools. Set current_function_uses_const_pool when reusing old entries + as well as when creating new ones. + (mark_constant): Ignore data argument. + (mark_constants): Remove pool argument. + (mark_constant_pool): Likewise. Use current_function_uses_const_pool + to decide whether the function uses a constant pool. + (output_constant_pool_contents): New function, split out from... + (output_constant_pool): ...here. + (output_shared_constant_pool): New function. + (init_varasm_once): Initialize shared_constant_pool. + * output.h (output_constant_pool): Delete. + (output_shared_constant_pool): Declare. + * config/s390/s390-protos.h (s390_output_constant_pool): Delete. + * config/i386/i386.c (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Override. + +2006-03-06 Nick Clifton + + * config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove reference to + flag_strength_reduce. + +2006-03-06 Ben Elliston + + * config.gcc: Add t-dfprules to $tmake_file for i*86-*-linux* and + x86_64-*-linux* configurations. + + * config/dfp-bit.h (CMPtype): Typedef to a word mode integer. + (LIBGCC2_WORDS_BIG_ENDIAN): Define. + +2006-03-05 Kazu Hirata + + * tree-ssa-threadupdate.c (rediscover_loops_after_threading): + Remove. + * basic-block.h: Remove the extern for + rediscover_loops_after_threading. + + * cfgloop.c (cancel_loop): Make it static. + * cfgloop.h: Remove the prototype for cancel_loop. + + * flow.c (recompute_reg_usage): Make it static. + * rtl.h: Remove the prototype for recompute_reg_usage. + + * function.c (use_return_register): Make it static. + * function.h: Remove the prototype. + +2006-03-05 Kazu Hirata + + * recog.c (volatile_mem_p, validate_change_maybe_volatile): + Remove. + * recog.h: Remove the prototype for + validate_change_maybe_volatile. + +2006-03-05 Kazu Hirata + + * rtlanal.c (replace_reg): Remove. + * rtl.h: Remove the prototype for replace_reg. + +2006-03-05 Kazu Hirata + + * regclass.c (reg_scan_update): Remove. + (reg_scan_mark_refs): Remove the last argument. + * rtl.h: Remove the prototype for reg_scan_update. + +2006-03-04 Kazu Hirata + + * builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c, + combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c, + config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c, + config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c, + df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c, + loop-invariant.c, omp-low.c, opts.c, passes.c, + rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c, + tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, + tree-ssa-structalias.c, tree-ssa-threadedge.c, + tree-ssa-threadupdate.c, tree-vect-patterns.c, + tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c, + unwind-dw2.c: Fix comment typos. Follow spelling conventions. + +2006-03-04 Kazu Hirata + + * dwarf2out.c (dwarf2out_add_library_unit_info): Remove. + * dwarf2out.h: Remove the prototype for + dwarf2out_add_library_unit_info. + +2006-03-04 Kazu Hirata + + * tree.c (add_var_to_bind_expr): Remove. + * tree.h: Remove the prototype for add_var_to_bind_expr. + +2006-03-04 Kazu Hirata + + * regclass.c (n_non_fixed_regs): Remove. + (init_reg_sets_1, globalize_reg): Remove all uses of + n_non_fixed_regs. + * hard-reg-set.h: Remove the extern for n_non_fixed_regs. + +2006-03-04 Kazu Hirata + + * rtlanal.c (insns_safe_to_move_p): Remove. + * rtl.h: Remove the prototype for insns_safe_to_move_p. + +2006-03-04 Kazu Hirata + + * expmed.c (expand_mult_add): Remove. + * expr.h: Remove the prototype for expand_mult_add. + +2006-03-04 Jakub Jelinek + + * unwind-dw2.h (_Unwind_FrameState): Add REG_SAVED_VAL_OFFSET + and REG_SAVED_VAL_EXP constants. + * unwind-dw2.c (struct _Unwind_Context): Add by_value array. + (_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr): + Handle regs stored by value. + (_Unwind_SetGRValue, _Unwind_GRByValue): New functions. + (execute_cfa_program): Handle DW_CFA_val_offset, + DW_CFA_val_offset_sf and DW_CFA_val_expression. + (uw_update_context_1): Handle REG_SAVED_REG with regs stored by + value specially. Handle REG_SAVED_VAL_OFFSET and REG_SAVED_VAL_EXP. + (uw_install_context_1): Handle target regs stored by value. + +2006-03-03 Daniel Berlin + + * tree-sra.c (tree_sra): Return todoflags; + (generate_one_element): Set TODO_update_smt_usage if needed. + (pass_sra): Remove TODO_update_smt_usage. + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Add some + parameter. + (tree_ssa_forward_propagate_single_use_vars): Return + TODO_update_smt_usage if we need to update SMT usage. + (pass_forwprop): Remove TODO_update_smt_usage. + +2006-03-03 Diego Novillo + + * tree-ssa-operands.c: Tidy whitespace. Fix spelling. + (correct_use_link): Remove reference to get_stmt_operands. + (update_stmt_operands): Likewise. + (get_modify_expr_operands): New function factored out of + parse_ssa_operands and get_expr_operands. + Try to create V_MUST_DEFs for LHS by default. + (get_expr_operands) : Call + get_modify_expr_operands. + : Handle together with ARRAY_REF. + : Clear opf_kill_def from FLAGS. + (parse_ssa_operands) : Call + get_modify_expr_operands. + +2006-03-03 Kazu Hirata + + * tree-dfa.c (referenced_var_lookup_if_exists): Remove. + * tree-flow.h: Remove the prototype for + referenced_var_lookup_if_exists. + +2006-03-03 Steve Ellcey + + PR rtl-optimization/26345 + PR target/19061 + * config/ia64/predicates.md (basereg_operand): Don't look in subregs. + +2006-03-03 Roger Sayle + + PR tree-optimization/26524 + * tree-scalar-evolution.c (interpret_rhs_modify_expr): Use + fold_convert to create a constant of the appropriate type. + +2006-03-03 Richard Sandiford + + * doc/tm.texi: Refer to SYMBOL_REF_HAS_BLOCK_INFO_P instead of + SYMBOL_REF_IN_BLOCK_P. + * doc/rtl.texi: Likewise. Refer to SYMBOL_FLAG_HAS_BLOCK_INFO instead + of SYMBOL_FLAG_IN_BLOCK. + * gengtype.c (adjust_field_rtx_def): Use SYMBOL_REF_HAS_BLOCK_INFO_P + instead of SYMBOL_REF_IN_BLOCK_P. + * explow.c (use_anchored_address): Likewise. + * rtl.c (rtx_size): Likewise. + * varasm.c (create_block_symbol): Set SYMBOL_FLAG_HAS_BLOCK_INFO + instead of SYMBOL_FLAG_IN_BLOCK. + (make_decl_rtl): Use SYMBOL_REF_HAS_BLOCK_INFO_P instead of + SYMBOL_REF_IN_BLOCK_P. + (assemble_variable): Likewise. + (output_constant_def_contents): Likewise. + (output_constant_pool): Likewise. + (default_encode_section_info): Preserve SYMBOL_FLAG_HAS_BLOCK_INFO + instead of SYMBOL_FLAG_IN_BLOCK. + * rtl.h (block_symbol): Refer to SYMBOL_REF_HAS_BLOCK_INFO_P instead of + SYMBOL_REF_IN_BLOCK_P. + (SYMBOL_REF_BLOCK): Likewise. + (SYMBOL_REF_OFFSET): Likewise. + (BLOCK_SYMBOL_CHECK): Use SYMBOL_REF_HAS_BLOCK_INFO_P instead of + SYMBOL_REF_IN_BLOCK_P. + (SYMBOL_FLAG_IN_BLOCK): Replace with... + (SYMBOL_FLAG_HAS_BLOCK_INFO): ...this. + (SYMBOL_REF_IN_BLOCK_P): Replace with... + (SYMBOL_REF_HAS_BLOCK_INFO_P): ...this. + +2006-03-03 Jakub Jelinek + + * config/arm/unwind-arm.h (_Unwind_GetIPInfo): Fix pasto. + +2006-03-02 Roger Sayle + + * simplify-rtx.c (simplify_unary_operation): When simplifying + (neg (lt X 0)) into (ashiftrt X C) or (lshiftrt X C), make sure + that we perform the right shift in the appropriate mode, and + then extend or truncate the result to requested mode. + +2006-03-03 Zdenek Dvorak + + * gengtype.c (main): Handle double_int type. + * tree.h (struct tree_int_cst): Make type of int_cst double_int. + * double-int.c: New file. + * double-int.h: New file. + * system.h: Include doubleint.h. + * Makefile.in (SYSTEM_H): Include double-int.h. + (double-int.o): Add. + +2006-03-03 Joseph S. Myers + + PR bootstrap/26478 + * Makefile.in (stmp-int-hdrs): Remove include/unwind.h before + copying over it. + +2006-03-02 Zdenek Dvorak + + * tree-vrp.c (remove_range_assertions): Do not update statements + unnecessarily. + +2006-03-02 Zdenek Dvorak + + * cse.c (rest_of_handle_cse): Do not pass CLEANUP_PRE_LOOP to cfg + cleanup. + * gcse.c (rest_of_handle_gcse): Ditto. + * except.c (gate_handle_eh): Ditto. + * cfgcleanup.c (rest_of_handle_jump2): Ditto. + * basic-block.h (CLEANUP_PRE_LOOP): Remove. + +2006-03-02 Eric Christopher + + * config/i386/i386.c (machopic_output_stub): Add indirection to + jump. + +2006-03-02 Zdenek Dvorak + + * loop.c: Removed. + +2006-03-02 David S. Miller + + Sun Niagara specific optimizations. + * config.gcc: Recognize niagara as target. + * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Mention Niagara. + (TARGET_CPU_niagara): Define. + (CPP_CPU64_DEFAULT_SPEC): Define __sparc_v9__ for Niagara. + (ASM_CPU64_DEFAULT_SPEC): Pass -Av9b for Niagara. + (CPP_CPU_SPEC): Handle -mcpu=niagara. + (ASM_CPU_SPEC): Likewise. + (PROCESSOR_NIAGARA): New enum entry. + (REGISTER_MOVE_COST): Handle Niagara. + (BRANCH_COST, PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Likewise. + * config/sparc/sparc.c (niagara_costs): New processor_costs entry. + (sparc_override_options): Recognize "niagara", set appropriate + default MASK_* values for it, and align functions to 32-bytes + by default just like ULTRASPARC/ULTRASPARC3. + (sparc_initialize_trampoline): Handle niagara like ultrasparc. + (sparc64_initialize_trampoline): Likewise. + (sparc_use_sched_lookahead): Use zero for niagara. + (sparc_issue_rate): Use one for niagara. + * config/sparc/niagara.md: New file. + * config/sparc/sparc.md: Include it. + * config/sparc/sol2-bi.h (CPP_CPU64_DEFAULT_SPEC, + ASM_CPU32_DEFAULT_SPEC, ASM_CPU64_DEFAULT_SPEC): Set appropriately + when default cpu is niagara. + (CPP_CPU_SPEC): Handle -mcpu=niagara. + (ASM_CPU_SPEC): Likewise. + * config/sparc/sol2.h (ASM_CPU_DEFAULT_SPEC): Set appropriately + when default cpu is niagara. + (ASM_CPU_SPEC): Handle -mcpu=niagara. + * config/sparc/linux64.h: Handle a default of TARGET_CPU_niagara + just like v9/ultrasparc/ultrasparc3. + * doc/invoke.texi: Add documentation for "niagara" and improve + existing documentation for ultrasparc variants. + +2006-03-02 Diego Novillo + + * tree-ssa-operands.c (update_stmt_operands): Update documentation. + +2006-03-02 Richard Sandiford + + * doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. + (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, + and say that only one is needed. + * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. + * target.h (have_switchable_bss_sections): New hook. + * explow.c (use_anchored_address): Check that the symbol is in a block. + * varasm.c (tls_comm_section, comm_section, lcomm_section) + (bss_noswitch_section): New variables. + (get_unnamed_section): Add SECTION_UNNAMED to the flags. + (get_noswitch_section): New function. + (get_block_for_section): Allow SECT to be null. + (unlikely_text_section_p): Use SECTION_STYLE. + (bss_initializer_p): New function. + (get_variable_section): Move earlier in file. Take a new argument, + prefer_noswitch_p. Move bss checks from assemble_variable to here. + Return one of the new *_sections in such cases. + (get_block_for_decl): New function, extracting some logic from + use_blocks_for_decl_p. + (change_symbol_section): Remove in favor of... + (change_symbol_block): ...this new function. + (use_blocks_for_decl_p): Remove checks now performed by + get_block_for_decl. + (make_decl_rtl): Use change_symbol_block and get_block_for_decl. + (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... + (emit_local, emit_bss, emit_common): ...these new functions. + Return true if the alignment was honored. + (emit_tls_common): New function. + (asm_emit_uninitialised): Delete. + (assemble_variable_noswitch): New function, split out from... + (assemble_variable): ...here. Don't make decisions about common + variables here. Globalize all public decls that go into non-common + sections. Check whether SYMBOL_REF_BLOCK is null. + (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. + (output_constant_pool): Likewise. + (init_varasm_once): Initialize the new section variables. + (have_global_bss_p): New function. + (categorize_decl_for_section): Use bss_initializer_p. + (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. + (place_block_symbol): Assert that the symbol must be in a block. + * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. + (TARGET_INITIALIZER): Include it. + * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. + * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. + (SECTION_MACH_DEP): Bump by two. + (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. + (unnamed_section): Mention SECTION_UNNAMED in comment. + (named_section): Likewise SECTION_NAMED. + (noswitch_section_callback): New type. + (noswitch_section): New structure. + (section): Add a noswitch_section alternative. + (SECTION_STYLE): New macro. + (tls_comm_section, comm_section, lcomm_section): Declare. + (bss_noswitch_section, have_global_bss_p): Declare. + * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. + * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): + Override. + * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. + * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): + Override. + +2006-03-02 Daniel Berlin + + * tree-vrp.c (execute_vrp): Return value. + * regrename.c (rest_of_handle_regrename): Ditto. + * tree-into-ssa.c (rewrite_into_ssa): Ditto. + * tree-complex.c (tree_lower_complex): Ditto. + (tree_lower_complex_O0): Ditto. + * tracer.c (rest_of_handle_tracer): Ditto. + * postreload-gcse.c (rest_of_handle_gcse2): Ditto. + * postreload.c (rest_of_handle_postreload): Ditto. + * tree-tailcall.c (execute_tail_recursion): Ditto. + (execute_tail_calls): Ditto. + * tree-ssa-loop-ch.c (copy_loop_headers): Ditto. + * tree.h (init_function_for_compilation): Ditto. + * ipa-cp.c (ipcp_driver): Ditto. + * tree-scalar-evolution.c (scev_const_prop): Ditto. + * tree-scalar-evolution.h (scev_const_prop): Ditto. + * final.c (compute_alignments): Ditto. + (rest_of_handle_final): Ditto. + (rest_of_handle_shorten_branches): Ditto. + (rest_of_clean_state): Ditto. + * omp-low.c (execute_expand_omp): Ditto. + (execute_lower_omp): Ditto. + * tree-ssa-dse.c (tree_ssa_dse): Ditto. + * ipa-reference.c (static_execute): Ditto. + * tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. + * reorg.c (rest_of_handle_delay_slots): Ditto. + (rest_of_handle_machine_reorg): Ditto. + * cgraphunit.c (rebuild_cgraph_edges): Ditto. + * flow.c (recompute_reg_usage): Ditto. + (rest_of_handle_remove_death_notes): Ditto. + (rest_of_handle_life): Ditto. + (rest_of_handle_flow2): Ditto. + * tree-ssa-copyrename.c (rename_ssa_copies): Ditto. + * tree-ssa-ccp.c (do_ssa_ccp): Ditto. + (do_ssa_store_ccp): Ditto. + (execute_fold_all_builtins): Ditto. + * mode-switching.c (rest_of_handle_mode_switching): Ditto. + * modulo-sched.c (rest_of_handle_sms): Ditto. + * ipa-pure-const.c (static_execute): Ditto. + * cse.c (rest_of_handle_cse): Ditto. + (rest_of_handle_cse2): Ditto. + * web.c (rest_of_handle_web): Ditto. + * tree-stdarg.c (execute_optimize_stdarg): Ditto. + * tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. + * tree-nrv.c (tree_nrv): Ditto. + (execute_return_slot_opt): Ditto. + * tree-ssa-alias.c (compute_may_aliases): Ditto. + (create_structure_vars): Ditto. + * loop-init.c (rtl_loop_init): Ditto. + (rtl_loop_done): Ditto. + (rtl_move_loop_invariants): Ditto. + (rtl_unswitch): Ditto. + (rtl_unroll_and_peel_loops): Ditto. + (rtl_doloop): Ditto. + * gimple-low.c (lower_function_body): Ditto. + (mark_used_blocks): Ditto. + * tree-ssa-sink.c (execute_sink_code): Ditto. + * ipa-inline.c (cgraph_decide_inlining): Ditto. + (cgraph_early_inlining): Ditto. + * global.c (rest_of_handle_global_alloc): Ditto. + * jump.c (cleanup_barriers): Ditto. + (purge_line_number_notes): Ditto. + * ifcvt.c (rest_of_handle_if_conversion): Ditto. + (rest_of_handle_if_after_reload): Ditto. + * tree-ssa-loop.c (tree_ssa_loop_init): Ditto. + (tree_ssa_loop_im): Ditto. + (tree_ssa_loop_unswitch): Ditto. + (tree_vectorize): Ditto. + (tree_linear_transform): Ditto. + (tree_ssa_loop_ivcanon): Ditto. + (tree_ssa_empty_loop): Ditto. + (tree_ssa_loop_bounds): Ditto. + (tree_complete_unroll): Ditto. + (tree_ssa_loop_prefetch): Ditto. + (tree_ssa_loop_ivopts): Ditto. + (tree_ssa_loop_done): Ditto. + * predict.c (tree_estimate_probability): Ditto. + * recog.c (split_all_insns_noflow): Ditto. + (rest_of_handle_peephole2): Ditto. + (rest_of_handle_split_all_insns): Ditto. + * tree-eh.c (lower_eh_constructs): Ditto. + * regmove.c (rest_of_handle_regmove): Ditto. + (rest_of_handle_stack_adjustments): Ditto. + * local-alloc.c (rest_of_handle_local_alloc): Ditto. + * function.c (instantiate_virtual_regs): Ditto. + (init_function_for_compilation): Ditto. + (rest_of_handle_check_leaf_regs): Ditto. + * gcse.c (rest_of_handle_jump_bypass): Ditto. + (rest_of_handle_gcse): Ditto. + * ipa-type-escape.c (type_escape_execute): Ditto. + * alias.c (rest_of_handle_cfg): Ditto. + * tree-if-conv.c (main_tree_if_conversion): Ditto. + * profile.c (rest_of_handle_branch_prob): Ditto. + * tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. + * rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. + * bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto + * tree-dfa.c (find_referenced_vars): Ditto. + * except.c (set_nothrow_function_flags): Ditto. + (convert_to_eh_region_ranges): Ditto. + (rest_of_handle_eh): Ditto. + * emit-rtl.c (unshare_all_rtl): Ditto. + (remove_unnecessary_notes): Ditto. + * except.h (set_nothrow_function_flags): Ditto. + (convert_to_eh_region_ranges): Ditto. + * cfgexpand.c (tree_expand_cfg): Ditto. + * tree-cfgcleanup.c (merge_phi_nodes): Ditto. + * tree-ssa-pre.c (do_pre): Ditto. + (execute_fre): Ditto. + * cfgcleanup.c (rest_of_handle_jump): Ditto. + (rest_of_handle_jump2): Ditto. + * tree-sra.c (tree_sra): Ditto. + * tree-mudflap.c (execute_mudflap_function_ops): Ditto. + (execute_mudflap_function_decls): Ditto. + * tree-ssa-copy.c (do_copy_prop): Ditto. + (do_store_copy_prop): Ditto. + * ipa-prop.h (ipcp_driver): Ditto. + * cfglayout.c (insn_locators_initialize): Ditto. + * tree-ssa-forwprop.c + (tree_ssa_forward_propagate_single_use_vars): Ditto. + * cfglayout.h (insn_locators_initialize): Ditto. + * tree-ssa-dce.c (tree_ssa_dce): Ditto. + * tree-ssa.c (execute_early_warn_uninitialized): Ditto. + (execute_late_warn_uninitialized): Ditto. + * rtl.h (cleanup_barriers): Ditto. + (split_all_insns_noflow): Ditto. + (purge_line_number_notes): Ditto. + (unshare_all_rtl): Ditto. + (remove_unnecessary_notes): Ditto. + (recompute_reg_usage): Ditto. + (variable_tracking_main): Ditto. + * integrate.c (emit_initial_value_sets): Ditto. + * integrate.h (emit_initial_value_sets): Ditto. + * tree-optimize.c (execute_free_datastructures): Ditto + (execute_free_cfg_annotations): Ditto. + (execute_fixup_cfg): Ditto. + (execute_cleanup_cfg_pre_ipa): Ditto. + (execute_cleanup_cfg_post_optimizing): Ditto. + (execute_init_datastructures): Ditto. + * tree-object-size.c (compute_object_sizes): Ditto. + * combine.c (rest_of_handle_combine): Ditto. + * tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. + * bb-reorder.c (duplicate_computed_gotos): Ditto. + (rest_of_handle_reorder_blocks): Ditto. + (rest_of_handle_partition_blocks): Ditto. + * var-tracking.c (variable_tracking_main): Ditto. + * tree-profile.c (tree_profiling): Ditto. + * tree-vect-generic.c (expand_vector_operations): Ditto. + * reg-stack.c (rest_of_handle_stack_regs): Ditto. + * sched-rgn.c (rest_of_handle_sched): Ditto. + (rest_of_handle_sched2): Ditto. + * basic-block.h (free_bb_insn): Ditto. + * tree-ssa-structalias.c (ipa_pta_execute): Ditto. + * tree-cfg.c (execute_build_cfg): Ditto. + (remove_useless_stmts): Ditto. + (split_critical_edges): Ditto. + (execute_warn_function_return): Ditto. + (execute_warn_function_noreturn): Ditto. + * tree-ssa-reassoc.c (execute_reassoc): Ditto. + * cfgrtl.c (free_bb_for_insn): Ditto. + * passes.c (execute_one_pass): Run additional + todos returned by execute function. + * tree-pass.h (struct tree_opt_pass): Make execute + return a value. + +2006-03-02 Richard Guenther + + * tree-ssa-alias.c (find_used_portions): Consider taking + the address as making the variable not write-only. + +2006-03-02 Nick Clifton + + * config.gcc (default_use_cxa_atexit): Extend the description of + this configure variable. Set its default value to "yes" for + Linux, NetBSD and ELF targets on the assumption that they will + use C libraries with the __cxa_atexit function. + +2006-03-02 Ben Elliston + + * config/rs6000/linux-unwind.h (frob_update_context): Mark `fs' + parameter as unused to suppress a build warning. + +2006-03-02 Ben Elliston + + * mklibgcc.in: Depend on config/dfp-bit.h in rules that compile + config/dfp-bit.c. + +2006-03-01 Roger Sayle + + PR other/26489 + * gthr-posix.h (__gthrw2): Define to take three parameters, the + declared name, the weak reference name, and the typeof name. + (__gthrw): Avoid expanding the declared name suffix. + (__gthrw3): New Tru64 specific macro to simplify the OSF/1 decls. + +2006-03-01 Jakub Jelinek + + * dwarf2.h (DW_TAG_condition, DW_TAG_shared_type): New constants + from DWARF 3. + (DW_AT_description, DW_AT_binary_scale, DW_AT_decimal_scale, + DW_AT_small, DW_AT_decimal_sign, DW_AT_digit_count, + DW_AT_picture_string, DW_AT_mutable, DW_AT_threads_scaled, + DW_AT_explicit, DW_AT_object_pointer, DW_AT_endianity, + DW_AT_elemental, DW_AT_pure, DW_AT_recursive): New. + (DW_OP_form_tls_address, DW_OP_call_frame_cfa, DW_OP_bit_piece): New. + (DW_ATE_packed_decimal, DW_ATE_numeric_string, DW_ATE_edited, + DW_ATE_signed_fixed, DW_ATE_unsigned_fixed): New. + (DW_DS_unsigned, DW_DS_leading_overpunch, DW_DS_trailing_overpunch, + DW_DS_leading_separate, DW_DS_trailing_separate): New. + (DW_END_default, DW_END_big, DW_END_little): New. + (DW_END_lo_user, DW_END_hi_user): Define. + (DW_LNE_lo_user, DW_LNE_hi_user): Define. + (DW_CFA_val_offset, DW_CFA_val_offset_sf, DW_CFA_val_expression): New. + (DW_LANG_PLI, DW_LANG_ObjC, DW_LANG_ObjC_plus_plus, DW_LANG_UPC, + DW_LANG_D): New. + +2006-03-01 Diego Novillo + + * tree.def (SYMBOL_MEMORY_TAG): Rename from TYPE_MEMORY_TAG. + Update all users. + * tree-pass.h (PROP_smt_usage): Rename from PROP_tmt_usage. + Update all users. + (TODO_update_smt_usage): Rename from TODO_update_tmt_usage. + Update all users. + * tree.h (SMT_USED_ALONE): Rename from TMT_USED_ALONE. + Update all users. + * tree-flow.h (struct var_ann_d): Rename field 'type_mem_tag' + to 'symbol_mem_tag'. + Update all users. + * doc/tree-ssa.texi: Update documentation to reflect TMT->SMT + rename. + +2006-03-01 Roger Sayle + + * builtins.c (fold_builtin_copysign): Delete unreachable code. + +2006-03-01 Andrew Pinski + + PR target/25761 + * config/darwin.h (MACHOPIC_JUST_INDIRECT): Check just + MACHO_DYNAMIC_NO_PIC_P. + (MACHOPIC_PURE): Check flag_pic and not MACHO_DYNAMIC_NO_PIC_P. + +2006-03-01 Andrew Pinski + + PR target/26389 + * config/darwin-protos.h (darwin_asm_output_anchor): + Declare. + * config/darwin-sections.def (cstring_section): + Add SECTION_MERGE to the flags. + (literal4_section): Likewise. + (literal8_section): Likewise. + (objc_selector_refs_section): Likewise. + (objc_cls_refs_section): Likewise. + * config/darwin.c (darwin_asm_output_anchor): New + function. + * config/darwin.h (TARGET_ASM_OUTPUT_ANCHOR): Define. + +2006-03-01 Daniel Berlin + + Fix PR tree-optimization/26443 + * tree-vrp.c (pass_vrp): Add TODO_update_tmt_usage + to todo and PROP_tmt_usage to properties_destroyed. + * tree-ssa-ccp.c (pass_ccp): Ditto. + (pass_store_ccp): Ditto. + * tree-ssa-dom.c (pass_dominator): Ditto. + +2006-03-01 Diego Novillo + + * tree-ssa-operands.c: Cleanup whitespace. + (get_asm_expr_operands): Move before first invocation. + (get_indirect_ref_operands): Likewise. + (get_tmr_operands): Likewise. + (get_call_expr_operands): Likewise. + (append_def): Likewise. + (append_use): Likewise. + (append_v_may_def): Likewise. + (append_v_must_def): Likewise. + (add_call_clobber_ops): Likewise. + (add_call_read_ops): Likewise. + (add_stmt_operand): Likewise. + (add_virtual_operand): Likewise. + (build_ssa_operands): Likewise. + +2006-03-01 Andrew Pinski + + PR middle-end/26022 + Revert: + PR middle-end/24437 + * tree-ssa-ccp.c (fold_stmt): Move folding of OBJ_TYPE_REF + with a call expr to ... + * fold-const.c (fold_ternary) : Here. + +2006-03-01 Diego Novillo + + * tree-vrp.c (extract_range_from_assert): Remove special + handling for types with super-types. + +2006-03-01 Ben Elliston + + * config.gcc: Add t-dfprules to $tmake_file for powerpc-*-linux* + and powerpc64-*-linux* configurations. + * config/t-dfprules: New file. + + * mklibgcc.in: Add logic to handle $DFP_ENABLE and $DFP_CFLAGS. + Compile dfp-bit.c from the source directory using -DWIDTH and + $DFP_CFLAGS to control the compilation of that file, rather than + generating width-specific versions in the build directory. + * Makefile.in (libgcc.mk): Pass down DFP_ENABLE and DFP_CFLAGS. + (LIBGCC_DEPS): Replace $(D32PBIT) et al with config/dfp-bit.[hc]. + +2006-02-28 Zack Weinberg + + * doc/md.texi: Avoid use of @headitem so that makeinfo <4.7 + continues to work. + +2006-02-28 Eric Christopher + + * config/rs6000/darwin.h (ENABLE_STACK_EXECUTE): Define. + Set up IN_LIBGCC definition of TARGET_64BIT. + * config/i386/darwin.h (ENABLE_STACK_EXECUTE): Define. + +2006-02-28 Roger Sayle + + PR middle-end/14752 + * c-common.c (c_common_truthvalue_conversion) : Delete. Let fold optimize these + cases via the construction of "expr != 0". + +2006-02-28 Steven Bosscher + + * alias.c (alias_invariant, alias_invariant_size): Remove. + (record_base_value): Remove. + (memrefs_conflict_p): Don't look at alias_invariant. + (end_alias_analysis): Don't free it. + * alias.h (record_base_value): Remove prototype. + +2006-02-28 Paolo Bonzini + Adam Nemet + + * 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. + +2006-02-28 Jeff Law + + * 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. + + * tree.h (strct phi_arg_d): Remove unused NONZERO field. + +2006-02-28 Dorit Nuzman + + PR tree-optimization/26419 + * doc/invoke.texi (ftree-vectorizer-verbose): Add information on + values of n. + +2006-02-27 Zack Weinberg + + * doc/md.texi: Fix typo in previous change. + +2006-02-27 Kenneth Zadeck + + * df.c: Remove. + +2006-02-27 Zack Weinberg + + * rtl.def (define_constraint, define_register_constraint) + (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_*. + +2006-02-27 Daniel Berlin + + * lambda-code.c (can_convert_to_perfect_nest): Allow any type of + scalar operation to be put back into the loop. + +2006-02-27 Jakub Jelinek + + PR other/26208 + * unwind-dw2.c (struct _Unwind_Context): Add signal_frame field. + (extract_cie_info): Handle S flag in augmentation string. + (execute_cfa_program): If context->signal_frame, execute also + fs->pc == context->ra instructions. + (uw_frame_state_for): If context->signal_frame, don't subtract one + from context->ra to find FDE. + (uw_update_context_1): Set context->signal_frame to + fs->signal_frame. + (_Unwind_GetIPInfo): New function. + * unwind-dw2.h (_Unwind_FrameState): Add signal_frame field. + * unwind-c.c (PERSONALITY_FUNCTION): Use _Unwind_GetIPInfo instead + of _Unwind_GetIP. + * unwind-sjlj.c (_Unwind_GetIPInfo): New function. + * unwind-generic.h (_Unwind_GetIPInfo): New prototype. + * unwind-compat.c (_Unwind_GetIPInfo): New function. + * libgcc-std.ver (_Unwind_GetIPInfo): Export @@GCC_4.2.0. + * config/ia64/unwind-ia64.c (_Unwind_GetIPInfo): New function. + * config/arm/unwind-arm.h (_Unwind_GetIPInfo): Define. + * config/i386/linux-unwind.h (x86_fallback_frame_state, + x86_64_fallback_frame_state): Set fs->signal_frame. + * config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Likewise. + (MD_FROB_UPDATE_CONTEXT): Define unconditionally. + (frob_update_context): Likewise. Workaround missing S flag in + Linux 2.6.12 - 2.6.16 kernel vDSOs. + * config/s390/linux-unwind.h (s390_fallback_frame_state): Likewise. + Remove the psw_addr + 1 hack. + +2006-02-27 Daniel Berlin + + * tree-ssa-structalias.c (get_constraint_for): Move code to deal + with aggregates here. + (find_func_aliases): Remove code for & from here. + +2006-02-26 Roger Sayle + + * fold-const.c (fold_binary) : 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. + +2006-02-26 Roger Sayle + + PR middle-end/19983 + * real.c (real_nan): Allow both 0x and 0X as hexadecimal prefixes. + +2006-02-26 Zdenek Dvorak + + * 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. + +2006-02-26 Richard Guenther + + 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. + +2006-02-26 Steven Bosscher + + * 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) : 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. + +2006-02-26 Zack Weinberg + + * doc/md.texi (Machine Constraints): Refer to all files with paths + relative to gcc directory (i.e. config/CPU/file). Add missing + @table @code ... @end table to M32C subsection. + +2006-02-26 Roger Sayle + + * fold-const.c (fold_binary) : Fold (X & 1) ^ 1 as + (X & 1) == 0. + : Fold (X ^ 1) & 1 and ~X & 1 as (X & 1) == 0. + +2006-02-26 Roger Sayle + James A. Morrison + + PR middle-end/21137 + * fold-const.c (fold_binary) : Fold ((X>>C1)&C2) eq/ne 0, + when C2 is a power of two, as either (X&(C2< + + PR tree-optimization/26359 + * tree-ssa-alias.c (new_type_alias): Set fields for new tag. + +2006-02-25 Roger Sayle + + * 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. + +2006-02-25 Roger Sayle + + PR middle-end/23673 + * fold-const.c (fold_binary) : 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). + +2006-02-25 Juergen Weigert + Richard Guenther + + * scan-decls.c (scan_decls): Don't fetch new statement after CPP_EOF. + +2006-02-24 Adam Nemet + + * combine.c (gen_lowpart_or_truncate): Call + simplify_gen_unary(TRUNCATE, ...) instead of gen_rtx_TRUNCATE. + +2006-02-24 Diego Novillo + + * doc/invoke.texi: Move -fopenmp description to "Options for + Code Generation". + Remove reference to -lgomp. + +2006-02-24 David Edelsohn + + * doc/install.texi: Require GNU tar version 1.14. + +2006-02-24 Geoffrey Keating + + * doc/tm.texi (Run-time Target): Document C_COMMON_OVERRIDE_OPTIONS. + * doc/invoke.texi (C++ Dialect Options): Document + -fno-use-cxa-get-exception-ptr. + * configure.ac: Define DEFAULT_USE_CXA_ATEXIT to 2 not 1. + * configure: Regenerate. + * c.opt (fuse-cxa-get-exception-ptr): New. + * c-opts.c (c_common_handle_option): Handle + OPT_fuse_cxa_get_exception_ptr. + * c-common.c (flag_use_cxa_atexit): Update documentation. + (flag_use_cxa_get_exception_ptr): New. + * c-common.h (flag_use_cxa_get_exception_ptr): New. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Improve + documentation. + (C_COMMON_OVERRIDE_OPTIONS): New. + +2006-02-24 Roger Sayle + + 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. + +2006-02-24 Roger Sayle + + * 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. + +2006-02-24 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_init_builtins): Change + decl libname for clog to __clog on AIX. + + * config/rs6000/xcoff.h (MAX_OFILE_ALIGNMENT): Define. + +2006-02-24 Alan Modra + + PR target/26453 + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't + output traceback table for thunks. Localise rs6000_stack_info call. + +2006-02-23 Roger Sayle + Rainer Orth + + * gthr-posix.h (__gthrw): Fix typo in comment. + +2006-02-23 Geoffrey Keating + + * doc/cpp.texi (Character sets): Document that we do support + input files to be in any character set. + +2006-02-23 Jeff Law + + * tree.h (PHI_ARG_NONZERO): Remove. + * tree-phinodes.c (add_phi_arg): No longer initialize PHI_ARG_NONZERO. + (remove_phi_arg_num): No longer copy PHI_ARG_NONZERO from the old + node to the new node. + + PR tree-optimization/26425 + * tree-vrp.c (vrp_visit_assignment): If the LHS's type has a NULL + min/max, then assume its varying. + +2006-02-23 Zdenek Dvorak + + PR rtl-optimization/26316 + * rtlanal.c (enum may_trap_p_flags): New. + (may_trap_p_1): Take flags instead of unaligned_mems argument. Ignore + MEM_NOTRAP_P if flags & MTP_AFTER_MOVE. + (may_trap_p, may_trap_or_fault_p): Pass flags to may_trap_p_1. + (may_trap_after_code_motion_p): New function. + * loop-invariant.c (find_identical_invariants): Fix dump formating. + (find_invariant_insn): Use may_trap_after_code_motion_p. + * rtl.h (may_trap_after_code_motion_p): Declare. + +2006-02-23 Zdenek Dvorak + + * emit-rtl.c (immed_double_const): Cleanup. + +2006-02-23 Daniel Berlin + + Fix PR tree-optimization/26376 + * tree-ssa-structalias.c (find_func_aliases): Use get_id_for_tree, + remove assert. + +2006-02-23 Jakub Jelinek + + PR middle-end/26412 + * gimplify.c (omp_add_variable): Guard variable size decl test with + DECL_SIZE (decl) check. + +2006-02-23 Richard Guenther + + PR middle-end/26439 + * tree-ssa-structalias.c (find_func_aliases): Handle complex types + like aggregate types. + +2006-02-23 Jakub Jelinek + + * configure.ac: Add --with{,out}-long-double-128 configure option. + (TARGET_DEFAULT_LONG_DOUBLE_128): New test. + * configure: Rebuilt. + * config.in: Rebuilt. + * doc/install.texi (Options specification): Document + --with-long-double-128. + + * config/rs6000/linux.h [TARGET_DEFAULT_LONG_DOUBLE_128] + (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128. + * config/rs6000/linux64.h [TARGET_DEFAULT_LONG_DOUBLE_128] + (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128. + +2006-02-23 Aldy Hernandez + + * config/s390/s390.c (override_options): Handle + TARGET_DEFAULT_LONG_DOUBLE_128. + + * config/alpha/alpha.c (override_options): Handle + TARGET_DEFAULT_LONG_DOUBLE_128. + + * config/sparc/sparc.c (sparc_override_options): Handle + TARGET_DEFAULT_LONG_DOUBLE_128. + +2006-02-22 Daniel Jacobowitz + + * Makefile.in (stmp-fixinc): Use real-$(INSTALL_HEADERS_DIR). + (real-install-headers-tar, real-install-headers-cpio) + (real-install-headers-cp): New targets. + +2006-02-22 Richard Sandiford + + * tree.h (variable_section): Delete. + * varasm.c (variable_section): Delete. + +2006-02-22 Paolo Bonzini + + * install.texi: Add notes on install.texi2html. + (Building in parallel): Do not use footnotes. + +2006-02-21 Aldy Hernandez + + PR libgomp/26234 + * doc/install.texi (Configuration): Document --disable-libgomp. + +2006-02-21 Geoffrey Keating + + * config/i386/darwin.h (DWARF2_FRAME_REG_OUT): New. + +2006-02-21 Alexandre Oliva + + * config/i386/sse.md (vec_extractv2df_1_sse): New. + (vec_extractv2df_0_sse): New. + +2006-02-21 Alexandre Oliva + + * defaults.h (CFA_FRAME_BASE_OFFSET): Define. + * config/ia64/ia64.h (CFA_FRAME_BASE_OFFSET): Override. + * doc/tm.texi (CFA_FRAME_BASE_OFFSET): Document. + * dwarf2out.c (build_cfa_loc): New offset parameter. Add it + to the result of the expression. + (def_cfa_1): Adjust. + (frame_pointer_cfa_offset): Rename to... + (frame_pointer_fb_offset): ... this. Adjust all uses. + (convert_cfa_to_loc_list): Rename to... + (convert_cfa_to_fb_loc_list): ... this. New offset parameter. + Pass it on to build_cfa_loc. + (compute_frame_pointer_to_cfa_displacement): Rename to... + (compute_frame_pointer_to_fb_displacement): ... this. New + offset parameter. Use it in computation. + (gen_subprogram_die): Compute cfa_fb_offset with the new + macro, and use it to compute the fb loc list and the + displacement. + +2006-02-21 Bernd Schmidt + + * config/bfin/predicates.md (cc_operand): Delete predicate. All uses + replaced with register_operand. + * config/bfin/bfin.c (bfin_register_move_cost): Moving CC to any + non-DREG is expensive. + * config/bfin/bfin.h (FIXED_REGISTERS): CC isn't fixed. + * config/bfin/bfin.md (movbi): Fix constraints and template for moves + involving memory. + +2006-02-21 Joseph S. Myers + + * doc/install.texi2html: Use set -e. + +2006-02-21 Richard Sandiford + + * doc/tm.texi (ASM_OUTPUT_SHARED_COMMON, ASM_OUTPUT_SHARED_BSS) + (ASM_OUTPUT_SHARED_LOCAL): Delete. + * doc/invoke.texi (-fshared-data): Delete. + * common.opt (fshared-data): Delete. + * varasm.c (asm_emit_uninitialised): Remove flag_shared_data handling. + (assemble_static_space): Remove #if 0 code. + * system.h (ASM_OUTPUT_SHARED_COMMON, ASM_OUTPUT_SHARED_BSS) + (ASM_OUTPUT_SHARED_LOCAL): Poison. + * config/cris/cris.h: Remove FIXME. + +2006-02-21 Paolo Bonzini + + * doc/sourcebuild.texi (Front End Directory): No more double-colon + hooks. + +2006-02-21 Jakub Jelinek + + PR middle-end/26379 + * combine.c (simplify_shift_const_1): Disable nested shifts + optimization for vector shifts. + +2006-02-20 Roger Sayle + + PR tree-optimization/26361 + * tree-vrp.c (extract_range_from_unary_expr): Handle NEGATE_EXPR + of unsigned integer types. + +2006-02-20 Sebastian Pop + + * tree-chrec.c (eq_evolutions_p): New. + * tree-chrec.h (eq_evolutions_p): Declared. + * tree-data-ref.c: Fix formatting. + (datadep_stats, dependence_stats): New. + (gcd): Moved... + (print_direction_vector): New. + (dump_data_dependence_relation): Use print_direction_vector. + (object_analysis, create_data_ref): Handle COMPONENT_REF. + (compute_subscript_distance): Static. + (initialize_data_dependence_relation): Static. Get the number + of loops surrounding the references from the callers, and initialize + DDR_SIZE_VECT to nb_loops. Use both base_addr_differ_p and + base_object_differ_p analyzers. + (analyze_ziv_subscript, analyze_siv_subscript_cst_affine, + compute_overlap_steps_for_affine_1_2, + analyze_subscript_affine_affine): Count the classified dependences. + Print a message when a test failed. + (can_use_analyze_subscript_affine_affine): New. + (analyze_siv_subscript): Compute the data dependences on symbolic + scevs that verify can_use_analyze_subscript_affine_affine. + (chrec_steps_divide_constant_p): Returns true, false, or unknown. + (analyze_miv_subscript): Update use of chrec_steps_divide_constant_p. + Handle symbolic scevs. + (analyze_overlapping_iterations): Let symbolic affine scevs to be + analyzed. + (subscript_dependence_tester): Moved... + (build_classic_dist_vector, build_classic_dir_vector): Don't use + lambda_vector_clear on newly allocated vectors. Get nb_loops from + DDR_SIZE_VECT instead of getting it in parameter. + (subscript_dependence_tester): ... here. Take as a parameter + loop_nest_depth. Call build_classic_dist_vector and + build_classic_dir_vector. + (compute_affine_dependence): Update subscript_dependence_tester + parameters. Update datadep_stats counters. Call + compute_subscript_distance. + (compute_self_dependence): Save the dist and dir vectors. Call + compute_subscript_distance. + (ddr_p, DEF_VEC_P(ddr_p), DEF_VEC_ALLOC_P(ddr_p,heap)): Moved... + (compute_all_dependences): Reorder parameters as they were before + conversion to VEC. Pass nb_loops and loop_nest_depth. Don't call + compute_subscript_distance. Update the use of + compute_affine_dependence and initialize_data_dependence_relation. + (find_data_references_in_loop): Handle COMPONENT_REF. + (compute_data_dependences_for_loop): Initialize dependence_stats. + Don't call build_classic_dist_vector and build_classic_dir_vector. + Update the parameters of initialize_data_dependence_relation and + compute_all_dependences. Print the statistics from datadep_stats. + (analyze_all_data_dependences): Static. Not used until the pass for + checking the data dependences is contributed. + * tree-data-ref.h (ddr_p, DEF_VEC_P(ddr_p), + DEF_VEC_ALLOC_P(ddr_p,heap)): ... here. + (initialize_data_dependence_relation, compute_affine_dependence, + analyze_all_data_dependences, compute_subscript_distance): Removed. + (print_direction_vector): New. + * lambda.h (gcd): ... here. + (lambda_vector_gcd): Moved here from gcd_vector. + * lambda-code.c (gcd, gcd_vector): Removed. + (lambda_compute_target_space): Use lambda_vector_gcd. Fix formatting. + * Makefile.in (tree-vect-patterns.o): Depends on TREE_DATA_REF_H. + +2006-02-20 Diego Novillo + + * ipa-type-escape.c: Tidy some comments and white space. + * tree-ssa-operands.c: Likewise. + +2006-02-20 Andrew Pinski + + PR tree-opt/25879 + * tree-pretty-print.c (debug_tree_chain): Walk the chains. + (dump_decl_name): Do not walk the decl tree chains. + * tree-pass.h (TDF_CHAIN): Remove. + +2006-02-20 Rafael Ávila de Espíndola + + * Makefile.in (C): Remove + (PROTO): Remove + (.PHONY): Remove C and PROTO + +2006-02-20 Roger Sayle + + PR middle-end/26236 + * doc/c-tree.texi (INTEGER_TYPE): Remove reference to the now + deprecated CHAR_TYPE tree code. + +2006-02-20 Paolo Bonzini + + * configure.ac (target_list): Add install-info, dvi, html. + * configure: Regenerate. + + * ada/Make-lang.in, cp/Make-lang.in, fortran/Make-lang.in, + java/Make-lang.in, objc/Make-lang.in, objcp/Make-lang.in, + treelang/Make-lang.in: Do not use double-colon rules. + +2006-02-20 Daniel Berlin + + * tree.h (struct tree_memory_tag): Add is_used_alone member. + (TMT_USED_ALONE): New macro. + * tree-pass.h (PROP_tmt_usage): New property. + (TODO_update_tmt_usage): New todo. + * tree-ssa-alias.c (updating_used_alone): New variable. + (recalculate_used_alone): New function. + (compute_may_aliases): Set updating_used_alone, call + recalculate_used_alone. + * tree-sra.c (pass_sra): Note that this pass destroys + PROP_tmt_usage, and add TODO_update_tmt_usage. + * tree-ssa-forwprop.c (pass_forwprop): Ditto. + * tree-flow.h (updating_used_alone): Prototype. + (recalculate_used_alone): Ditto. + * passes.c (execute_todo): Add code to set updating_used_alone, + and call recalculate. + * tree-ssa-operands.c (add_virtual_operand): Only append bare def + for clobber if used alone, and add assert to verify used_alone + status. + +2006-02-20 Angel Nunez Mencias + + * config/s390/s390.c (legitimize_pic_address): Assertions checking + for non tls symbols added. + (legitimize_address): Do nothing for PLUS expressions if one of the + addends is a tls symbol reference. + +2006-02-20 Paolo Bonzini + + PR bootstrap/25476 + + * Makefile.in (LDFLAGS): Define from autoconf substitution. + + * Makefile.in (BOOTSTRAPPING): New. + (quickstrap): New definition if BOOTSTRAPPING=yes. + + * Makefile.in (CONFIG_LANGUAGES): Substitute all_selected_languages. + * configure.ac: Substitute all_selected_languages with the languages + that were configured. For all the other variables except + lang_specs_files, include all the languages in the tree. + * configure: Regenerate. + + * Makefile.in (stmp-fixinc): Copy includes from the prev-gcc directory, + if there is one. Run the commands to run fixincludes in the same + subshell. + + * doc/makefile.texi: Document new makefile targets from toplevel bootstrap. + * doc/install.texi: Document exact conventions for searching target tools. + Document --with-build-time-tools. Document toplevel bootstrap. Document + something more about building an Ada cross-compiler. Don't list GNU Make + requirements which affect all platforms. + +2006-02-19 Roger Sayle + + PR middle-end/19543 + * varasm.c (compare_constant) : Integer constants are + only equivalent if the have both the same mode and precision. + +2006-02-20 Ben Elliston + + * doc/tree-ssa.texi (Interfaces): Describe low vs. high GIMPLE. + +2006-02-19 Roger Sayle + Steven Bosscher + + * gcse.c (want_to_gcse_p): On STACK_REGS targets, look through + constant pool references to identify stack mode constants. + * rtlanal.c (constant_pool_constant_p): New predicate to check + whether operand is a floating point constant in the pool. + * rtl.h (constant_pool_constant_p): Prototype here. + * loop.c (scan_loop): Avoid hoisting constants from the constant + pool on STACK_REGS targets. + (load_mems): Likewise. + * loop-invariant.c (get_inv_cost): Make hoisting constant pool + loads into x87 registers expensive in terms of register pressure. + +2006-02-19 Roger Sayle + + * gthr-posix.h: On Tru64, map __gthr_foo as a weak reference to + __foo and not foo when _PTHREAD_USE_MANGLED_NAMES_ is defined. + +2006-02-19 David Edelsohn + + * config/rs6000/xcoff.h (TARGET_ASM_OUTPUT_ANCHOR): Define. + * config/rs6000/rs6000.c (rs6000_xcoff_asm_output_anchor): Define. + +2006-02-19 Daniel Berlin + + * doc/invoke.texi: Document -fipa-pta. + * common.opt: Add ipa-pta option. + * tree-ssa-structalias.c (DONT_PROPAGATE_WITH_ANYTHING): Removed. + (do_sd_constraint): Enable DONT_PROPAGATE_WITH_ANYTHING code. + (do_ds_constraint): Ditto. + (get_constraint_for): Only add to referenced_vars if + referenced_vars exists. + (insert_into_field_list): Rewrite to do this unsorted. + (insert_into_field_list_sorted): Rename old insert_into_field_list + to this. + (create_function_info_for): Use insert_into_field_list_sorted. + (create_variable_info_for): Rewrite so it uses unsorted version, + since the field list is sorted. + (intra_create_variable_infos): Only add to referenced_vars if + referenced_vars exists. + (ipa_pta_execute): Init heapvars, and delete when done. + * passes.c (init_optimization_passes): Add call to pass_ipa_pta. + +2006-02-19 John David Anglin + + * doc/install.texi: Add missing `@samp'. + +2006-02-18 Andrew Pinski + + * config/rs6000/darwin.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): + Use the arguments. + +2006-02-18 Mark Wielaard + + * doc/contrib.texi (Contributors): Add classpath/libgcj hackers + who added new 4.1 features, bug fixes and integration support. + +2006-02-18 David Edelsohn + + PR target/26350 + * config/rs6000/rs6000.md (extenddftf2): Force 0.0 to validized + MEM for ABI_V4 pic. + +2006-02-18 Richard Sandiford + + * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. + * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. + (copy_insn_1): Likewise. Don't copy each field individually. + Reindent. + * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead + of RTX_SIZE. + * reload1.c (eliminate_regs): Use shallow_copy_rtx. + * rtl.c (rtx_size): Rename variable to... + (rtx_code_size): ...this. + (rtx_size): New function. + (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. + (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. + Reindent. + (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. + * rtl.h (rtx_code_size): New variable. + (rtx_size): Change from a variable to a function. + (RTX_SIZE): Rename to... + (RTX_CODE_SIZE): ...this. + + PR target/9703 + PR tree-optimization/17106 + * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. + (Anchored Addresses): New section. + * doc/invoke.texi (-fsection-anchors): Document. + * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. + (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. + (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. + * hooks.c (hook_bool_mode_rtx_false): New function. + * hooks.h (hook_bool_mode_rtx_false): Declare. + * gengtype.c (create_optional_field): New function. + (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when + SYMBOL_REF_IN_BLOCK_P is true. + * target.h (output_anchor, use_blocks_for_constant_p): New hooks. + (min_anchor_offset, max_anchor_offset): Likewise. + (use_anchors_for_symbol_p): New hook. + * toplev.c (compile_file): Call output_object_blocks. + (target_supports_section_anchors_p): New function. + (process_options): Check that -fsection-anchors is only used on + targets that support it and when -funit-at-a-time is in effect. + * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL + if the decl doesn't have one. + * dwarf2out.c: Remove instantiations of VEC(rtx,gc). + * expr.c (emit_move_multi_word, emit_move_insn): Pass the result + of force_const_mem through use_anchored_address. + (expand_expr_constant): New function. + (expand_expr_addr_expr_1): Call it. Use the same modifier when + calling expand_expr for INDIRECT_REF. + (expand_expr_real_1): Pass DECL_RTL through use_anchored_address + for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. + * expr.h (use_anchored_address): Declare. + * loop-unroll.c: Don't declare rtx vectors here. + * explow.c: Include output.h. + (validize_mem): Call use_anchored_address. + (use_anchored_address): New function. + * common.opt (-fsection-anchors): New switch. + * varasm.c (object_block_htab, anchor_labelno): New variables. + (hash_section, object_block_entry_eq, object_block_entry_hash) + (use_object_blocks_p, get_block_for_section, create_block_symbol) + (use_blocks_for_decl_p, change_symbol_section): New functions. + (get_variable_section): New function, split out from assemble_variable. + (make_decl_rtl): Create a block symbol if use_object_blocks_p and + use_blocks_for_decl_p say so. Use change_symbol_section if the + symbol has already been created. + (assemble_variable_contents): New function, split out from... + (assemble_variable): ...here. Don't output any code for + block symbols; just pass them to place_block_symbol. + Use get_variable_section and assemble_variable_contents. + (get_constant_alignment, get_constant_section, get_constant_size): New + functions, split from output_constant_def_contents. + (build_constant_desc): Create a block symbol if use_object_blocks_p + says so. Or into SYMBOL_REF_FLAGS. + (assemble_constant_contents): New function, split from... + (output_constant_def_contents): ...here. Don't output any code + for block symbols; just pass them to place_section_symbol. + Use get_constant_section and get_constant_alignment. + (force_const_mem): Create a block symbol if use_object_blocks_p and + use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. + (output_constant_pool_1): Add an explicit alignment argument. + Don't switch sections here. + (output_constant_pool): Adjust call to output_constant_pool_1. + Switch sections here instead. Don't output anything for block symbols; + just pass them to place_block_symbol. + (init_varasm_once): Initialize object_block_htab. + (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. + (default_asm_output_anchor, default_use_aenchors_for_symbol_p) + (place_block_symbol, get_section_anchor, output_object_block) + (output_object_block_htab, output_object_blocks): New functions. + * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. + (TARGET_ASM_OUT): Include it. + (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. + (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. + (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. + (TARGET_INITIALIZER): Include them. + * rtl.c (rtl_check_failed_block_symbol): New function. + * rtl.h: Include vec.h. Declare heap and gc rtx vectors. + (block_symbol, object_block): New structures. + (rtx_def): Add a block_symbol field to the union. + (BLOCK_SYMBOL_CHECK): New macro. + (rtl_check_failed_block_symbol): Declare. + (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. + (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. + (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. + (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. + * output.h (output_section_symbols): Declare. + (object_block): Name structure. + (place_section_symbol, get_section_anchor, default_asm_output_anchor) + (default_use_anchors_for_symbol_p): Declare. + * Makefile.in (RTL_BASE_H): Add vec.h. + (explow.o): Depend on output.h. + * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. + (TARGET_MAX_ANCHOR_OFFSET): Likewise. + (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. + (rs6000_use_blocks_for_constant_p): New function. + +2006-02-18 John David Anglin + + * doc/install.texi (hppa*-hp-hpux*): Update for 4.1.0. + +2006-02-18 Andrew Pinski + + PR tree-opt/25680 + * tree-ssa-ccp.c (ccp_fold): Handle store CCP of REALPART_EXPR and + IMAGPART_EXPR. + +2006-02-18 Diego Novillo + + * tree-flow.h (struct var_ann_d): Rename field is_alias_tag to + is_aliased. + Update all users. + +2006-02-18 Jakub Jelinek + + PR middle-end/26334 + * stmt.c (decl_overlaps_hard_reg_set_p): Use DECL_HARD_REGISTER + instead of DECL_REGISTER. + +2006-02-18 Olivier Hainque + + PR ada/13408 + * pa.h (WIDEST_HARDWARE_FP_SIZE): Define. + +2006-02-18 Joseph S. Myers + + PR target/24837 + * config.gcc: Define UCLIBC_DEFAULT to 0 or 1. + * opth-gen.awk: Handle Var and InverseMask together. + * config/linux.opt (muclibc, mglibc): Use Var(linux_uclibc). + * config/linux.h: Use #if not #ifdef for testing UCLIBC_DEFAULT. + (TARGET_C99_FUNCTIONS): Test OPTION_GLIBC not TARGET_GLIBC. + (CHOOSE_DYNAMIC_LINKER): Give an error for -mglibc and -muclibc + used together. + (UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64, + LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define. + * config/alpha/linux-elf.h (GLIBC_DYNAMIC_LINKER, + UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER): Define. + (ELF_DYNAMIC_LINKER): Define to LINUX_DYNAMIC_LINKER. + * config/alpha/linux.h (TARGET_C99_FUNCTIONS): Define to + TARGET_GLIBC. + * config/cris/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (CRIS_LINK_SUBTARGET_SPEC): Pass a -dynamic-linker option. + * config/frv/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + (TARGET_C99_FUNCTIONS): Don't define. + * config/i386/linux.h (DYNAMIC_LINKER): Rename to + GLIBC_DYNAMIC_LINKER. + (SUBTARGET_EXTRA_SPECS): Use LINUX_DYNAMIC_LINKER. + * config/i386/linux64.h (GLIBC_DYNAMIC_LINKER32, + GLIBC_DYNAMIC_LINKER64): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER32 and + LINUX_DYNAMIC_LINKER64. + * config/ia64/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/m32r/linux.h (GLIBC_DYNAMIC_LINKE): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/m68k/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/mips/linux64.h (GLIBC_DYNAMIC_LINKER32, + GLIBC_DYNAMIC_LINKER64, GLIBC_DYNAMIC_LINKERN32, + UCLIBC_DYNAMIC_LINKERN32, LINUX_DYNAMIC_LINKERN32): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKERN32, LINUX_DYNAMIC_LINKER64 + and LINUX_DYNAMIC_LINKER32. + * config/mn10300/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/pa/pa-linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/rs6000/linux.h (TARGET_C99_FUNCTIONS): Define to + TARGET_GLIBC. + * config/rs6000/linux64.h (TARGET_C99_FUNCTIONS): Likewise. + (GLIBC_DYNAMIC_LINKER32, GLIBC_DYNAMIC_LINKER64, + UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64, + CHOOSE_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define. + (LINK_OS_LINUX_SPEC32): Use LINUX_DYNAMIC_LINKER32. + (LINK_OS_LINUX_SPEC64): Use LINUX_DYNAMIC_LINKER64. + * config/rs6000/sysv4.h (GLIBC_DYNAMIC_LINKER, + UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER): Define. + (LINK_OS_LINUX_SPEC): Use LINUX_DYNAMIC_LINKE. + * config/s390/linux.h (GLIBC_DYNAMIC_LINKER32, + GLIBC_DYNAMIC_LINKER64): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER32 and + LINUX_DYNAMIC_LINKER64. + * config/sh/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (SUBTARGET_LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/sparc/linux.h (GLIBC_DYNAMIC_LINKER, + UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + (TARGET_C99_FUNCTIONS): Define to TARGET_GLIBC. + * config/sparc/linux64.h (GLIBC_DYNAMIC_LINKER32, + GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER32, + UCLIBC_DYNAMIC_LINKER64, CHOOSE_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define. + (LINK_ARCH32_SPEC): Use LINUX_DYNAMIC_LINKER32. + (LINK_ARCH64_SPEC, LINK_SPEC): Use LINUX_DYNAMIC_LINKER64. + (TARGET_C99_FUNCTIONS): Define to TARGET_GLIBC. + * config/xtensa/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * doc/invoke.texi (-muclibc): Remove caveat about supported + targets. + +2006-02-17 Grigory Zagorodnev + + * doc/cpp.texi (__TIMESTAMP__): Document. + +2006-02-17 Roger Sayle + + PR middle-end/25600 + * fold-const.c (fold_binary): Fold (X >> C) != 0 into X < 0 when + C is one less than the width of X (and related transformations). + * simplify-rtx.c (simplify_unary_operation_1): Transform + (neg (lt x 0)) into either (ashiftrt X C) or (lshiftrt X C) + depending on STORE_FLAG_VALUE, were C is one less then the + width of X. + +2006-02-17 Daniel Berlin + + Fix PR tree-optimization/26341 + * tree-ssa-operands.c (add_virtual_operand): Remove assert + about NAME_MEMORY_TAG's. + +2006-02-17 John David Anglin + + PR target/26255 + * pa.md: Create separate HI and QI move patterns for 32-bit and 64-bit + with hardware float support, and software float support. Add fcpy + alternative to hardware patterns. Add alternatives to copy between + general and floating-point registers to the 32-bit pattern. + * pa.c (pa_secondary_reload): Don't abort if reload tries to find a + secondary reload to load a QI or HI mode constant into a floating + point register. + * pa32-regs.h (VALID_FP_MODE_P): Allow QImode and HImode. + * pa64-regs.h (VALID_FP_MODE_P): Likewise. + +2006-02-17 Andrew Pinski + + PR target/26272 + * config/rs6000/darwin.md (load_macho_picbase_si): Add + pc to the pattern. + (load_macho_picbase_di): Likewise. + +2006-02-16 Jeff Law + + * tree-vrp.c (set_value_range_to_nonnegative): New function. + (vrp_expr_computes_nonnegative, ssa_name_nonnegative_p): Likewise. + (ssa_name_nonzero_p): Likewise. + (get_value_range): Return NULL if VRP is not running. + (extract_range_from_expr): Fallback to tree_expr_XXX_p if + VRP routines do not discover a range. + (vrp_finalize): Clear VR_VALUE to indicate VRP is not running. + * tree.h (ssa_name_nonzero_p, ssa_name_nonnegative_p): Prototype. + * fold-const.c (tree_expr_nonzero_p): For SSA_NAMEs, query VRP. + (tree_expr_nonnegative_p): Similarly. + * tree-ssa-dom.c (nonzero_vars, nonzero_vars_stack): Remove. + (restore_nonzero_vars_to_original_value): Remove. + (unsafe_associative_fp_binop): Remove. + (tree_ssa_dominator_optimize): Remove initialization and + finalization of nonzero_vars and nonzero_vars_stack. + (dom_opt_initialize_block): No longer push marker on + nonzero_vars_stack. + (dom_opt_finalize_block): No longer call + restore_nonzero_vars_to_original_value. + (record_equivalences_from_phis): No longer look for + nonzero PHI arguments. + (cprop_into_successor_phis): No longer propagate nonzero + property into PHI arguments. Lose unused argument. Caller + updated. + (record_equivalences_from_stmt): No longer record nonzero + values for SSA_NAMEs. + (lookup_avail_expr): No longer use nonzero_vars. + + * stor-layout.c (set_sizetype): Set TYPE_MAX_VALUE properly + for sizetype when sizetype is unsigned. + +2006-02-16 Denis Nagorny + + PR rtl-optimization/25603 + * reload.c (reg_inc_found_and_valid_p): New. Check REG_INC note. + (regno_clobbered_p): Use it. Reusing SETS argument for REG_INC case. + * reload1.c (choose_reload_regs): Added call of regno_clobbered_p + with new meaning of SETS. + +2006-02-16 Joseph S. Myers + + PR target/20353 + PR target/24578 + PR target/24837 + * config/linux.opt: New file. + * config/linux.h (CHOOSE_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, + LINUX_DYNAMIC_LINKER): Define. + (TARGET_C99_FUNCTIONS): Define depending on TARGET_GLIBC. + * config.gcc (*-*-linux*): Define extra_options. + (*-*-*uclibc*): Define UCLIBC_DEFAULT. + (arm*-*-linux-gnueabi): Change to arm*-*-linux-*eabi. + * config/arm/linux-eabi.h (LINUX_TARGET_INTERPRETER): Change to + GLIBC_DYNAMIC_LINKER. + * config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): Likewise. + (LINUX_TARGET_LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * config/mips/linux.h (GLIBC_DYNAMIC_LINKER): Define. + (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. + * doc/invoke.texi (GNU/Linux Options): New section. + +2006-02-16 Eric Botcazou + + * config/sparc/sparc.md (setjmp): Rewrite. + (setjmp_32): Delete. + (setjmp_64): Likewise. + +2006-02-16 Daniel Berlin + + * tree-ssa-operands.c (access_can_touch_variable): Fix typo in + previous change. + +2006-02-16 Zdenek Dvorak + + * loop-invariant.c (invariant_for_use, check_dependencies): Fail for + read-write uses. + +2006-02-16 Zdenek Dvorak + + PR rtl-optimization/26296 + * Makefile.in (loop-invariant.c): Add except.h dependency. + * loop-invariant.c: Include except.h. + (find_invariant_insn): Ignore insns satisfying can_throw_internal. + +2005-02-16 Paul Brook + + * reload1.c (emit_reload_insns): Invalidate dead input registers used + for reloads. + +2006-02-16 Bernd Schmidt + + PR rtl-optimization/25636 + * local-alloc.c (update_equiv_regs): Lose a bogus rtx_equal_p test + when deciding whether an insn is an initializing insn. + +2006-02-15 Daniel Berlin + + * tree.c (init_ttree): Add STRUCT_FIELD_TAG handling. + (tree_code_size): Ditto. + * tree.h (struct tree_memory_tag): Remove parent_var. + (struct tree_struct_field_tag): New. + (SFT_OFFSET): New. + (SFT_SIZE): New. + (union tree_node): Add sft member. + * tree-ssa-alias.c (get_tmt_for): Don't handle TYPE_READONLY + specially here. + (create_sft): Add size and offset argument, set SFT_OFFSET and + SFT_SIZE. + (create_overlap_variables_for): Update for SFT_OFFSET/SFT_SIZE. + * treestruct.def: Add TS_STRUCT_FIELD_TAG. + * tree-flow-inline.h (get_subvar_at): Update for + SFT_OFFSET/SFT_SIZE. + (var_can_have_subvars): Ditto. + (overlap_subvar): Ditto. + * print-tree.c (print_node): Print out interesting things for + SFT's. + * tree-flow.h (struct subvar): Remove offset and size members. + * tree-ssa-operands.c (get_expr_operands): Update for + get_indirect_ref_operands changes. + (get_indirect_ref_operands): Call add_virtual_operand instead of + add_stmt_operand. Only recurse on base var if requested. + (access_can_touch_variable): New function. + (add_stmt_operand): Split virtual operand handling into ... + (add_virtual_operand): Here. Add offset, size, and for_clobber + arguments. Prune alias sets. + (add_call_clobber_ops): Call add_virtual_operand. + +2006-02-15 Jakub Jelinek + + PR middle-end/26300 + * combine.c (make_extraction): Bail out if ORIG_POS is negative. + + * tree.h (struct tree_omp_clause): Use OMP_CLAUSE_CODE rather + than TREE_CODE as index into omp_clause_num_ops array. + +2006-02-15 Uttam Pawar + + PR rtl-optimization/26184 + * modulo-sched.c (generate_reg_moves): Free bitmap vector + uses_of_defs. + * modulo-sched.c (sms_schedule): Free g_arr pointer. + * modulo-sched.c (sms_schedule_by_order): Free bitmap pointers + must_precede, must_follow and tobe_scheduled. + + PR other/26147 + * opts.c (common_handle_option): Free new_option pointer. + * df-core.c (df_analyze): Free postorder pointer. + +2006-02-15 Rafael Ávila de Espíndola + + * Makefile.in: Fix the examples about the use of stamps + +2006-02-15 Michael Matz + + PR middle-end/22275 + + * stor-layout.c (layout_decl): Zero-width bitfields aren't + influenced by maximum_field_alignment or DECL_PACKED. + (update_alignment_for_field): Ditto. + (place_field): Ditto. + * doc/extend.texi (<#pragma pack>, ): Document + this behaviour. + +2006-02-15 Paolo Bonzini + + * cfg.c (dump_flow_info): Get dump flags as an additional parameter. + (debug_flow_info): Pass it. + * alias.c (rest_of_handle_cfg): Adjust calls to dump_flow_info. + * bb-reorder.c (reorder_basic_blocks): Likewise. + * cfgcleanup.c (rest_of_handle_jump2): Likewise. + * cse.c (rest_of_handle_cse, rest_of_handle_cse2): Likewise. + * flow.c (life_analysis, recompute_reg_usage): Likewise. + * gcse.c (gcse_main, bypass_jumps): Likewise. + * ifcvt.c (rest_of_handle_if_conversion): Likewise. + * local-alloc.c (rest_of_handle_local_alloc): Likewise. + * loop-init.c (rtl_loop_init, rtl_loop_done): Likewise. + * profile.c (compute_branch_probabilities, branch_prob): Likewise. + * rtl.h (dump_flow_info): Adjust prototype. + * tracer.c (rest_of_handle_tracer, tracer): Likewise. + * var-tracking.c (variable_tracking_main): Likewise. + * passes.c (execute_todo): Obey TDF_BLOCKS for RTL. + * tree-dump.c (enable_rtl_dump_file): Enable the details and blocks + options. + +2006-02-15 Marcin Dalecki + + * tree-ssa-dom.c (dom_thread_across_edge): fix tag expression + construction. + +2006-02-14 Zdenek Dvorak + + PR tree-optimization/26209 + * tree-ssa-loop.c (pass_scev_cprop): Add TODO_cleanup_cfg. + * tree-cfgcleanup.c (cleanup_control_flow): Remove dead + eh edges. + * tree-cfg.c (replace_uses_by): Do not alter cfg. + +2006-02-14 Roger Sayle + + PR middle-end/23670 + * fold-const.c (fold_binary) : Optimize (X&Y)|Y into + (X,Y) and the corresponding symmetry related transformations. + (fold_binary) : Likewise, optimize (X|Y)&Y into + (X,Y) and its symmetry related transformations. + +2006-02-14 Roger Sayle + + * dojump.c (do_compare_rtx_and_jump): Also handle multi-word GTU + and GEU. + +2006-02-14 Adam Nemet + + * simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE. + +2006-02-14 Rainer Orth + + PR bootstrap/26053 + * configure.ac (HAVE_COMDAT_GROUP): Don't assume non-GNU linkers + support COMDAT group. + * configure: Regenerate. + +2006-02-14 Roger Sayle + + PR middle-end/26279 + PR middle-end/26280 + PR middle-end/26283 + * dojump.c (do_compare_rtx_and_jump): Handle multi-word LE. + +2006-02-14 Daniel Berlin + + Fix PR tree-optimization/26260 + + * doc/invoke.texi (max-fields-for-field-sensitive): Document + param. + * params.h (MAX_FIELDS_FOR_FIELD_SENSITIVE): New. + * params.def (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE): Ditto. + * tree-ssa-structalias.c (create_variable_info_for): Use + MAX_FIELDS_FOR_FIELD_SENSITIVE. + +2006-02-14 Zdenek Dvorak + + * doc/invoke.texi (-fprefetch-loop-arrays, -fprefetch-loop-arrays-rtl): + Document. + * tree-ssa-loop-niter.c (number_of_iterations_ne, + number_of_iterations_lt, number_of_iterations_cond): Remember the shape + of the ending condition. + * tree-ssa-loop-manip.c: Include params.h. + (build_if_stmt, can_unroll_loop_p, determine_exit_conditions, + tree_unroll_loop): New functions. + * tree-pass.h (pass_loop_prefetch): Declare. + * loop.c (rest_of_handle_loop_optimize): Test for + -fprefetch-loop-arrays-rtl. + * tree-scalar-evolution.h (affine_iv): Moved to tree-flow.h. + * timevar.def (TV_TREE_PREFETCH): New timevar. + * tree-ssa-loop.c (tree_ssa_loop_prefetch, gate_tree_ssa_loop_prefetch, + pass_loop_prefetch): New. + * tree-cfgcleanup.c: Include tree-scalar-evolution.h. + (cleanup_tree_cfg_loop): Call scev_reset. + * common.opt (fprefetch-loop-arrays-rtl): Add. + * tree-ssa-loop-prefetch.c: New file. + * tree-outof-ssa.c (struct value_expr_d): Add expr_vars field. + (new_temp_expr_table): Initialize expr_vars. + (free_temp_expr_table): Cleanup expr_vars. + (check_replaceable, find_replaceable_in_bb): Prevent accumulating + expressions from being merged into one. + * tree-flow.h (affine_iv): Moved from tree-scalar-evolution.h. + (struct tree_niter_desc): Add control, bound and cmp fields. + (tree_ssa_prefetch_arrays, can_unroll_loop_p, tree_unroll_loop): + Declare. + * Makefile.in (tree-ssa-loop-prefetch.o): Add. + (tree-cfgcleanup.o): Add SCEV_H dependency. + (tree-ssa-loop-manip.o): Add PARAMS_H dependency. + * passes.c (init_optimization_passes): Add pass_loop_prefetch. + +2006-02-14 Richard Guenther + + PR tree-optimization/26258 + * tree-ssa-structalias.c (find_func_aliases): Handle aggregates + in PHI argument processing. + +2006-02-13 Adam Nemet + + * simplify-rtx.c (simplify_unary_operation_1) : Return + new expression in the requested machine mode. + +2006-02-13 Roger Sayle + + * optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx + directly, instead let do_compare_rtx_and_jump handle this for us. + * expr.c (expand_expr_real_1): Likewise. + * dojump.c (do_jump_by_parts_greater_rtx): Make static. Move + before do_jump_by_parts_greater. + (do_jump_by_parts_greater): Move after do_jump_by_parts_greater_rtx. + * expr.h (do_jump_by_parts_greater_rtx): Delete prototype. + +2006-02-13 John David Anglin + + * pa/quadlib.c: Use defines instead of enum qfcmp_magic. + +2006-02-13 Zdenek Dvorak + + PR rtl-optimization/26235 + * loop-invariant.c (hash_invariant_expr_1): Handle 'i' and 'n' formats. + (invariant_expr_equal_p): Handle 'i' and 'n' formats. Fail on unknown + format. + +2006-02-13 Jeff Law + + * tree-vrp.c (extract_range_from_binary_expr): Remove handling of + TRUTH_XOR_EPR. + +2006-02-13 Jakub Jelinek + + PR middle-end/26092 + * gimplify.c (gimplify_call_expr): Don't call get_callee_fndecl + twice if decl is a builtin. When trying again, call get_callee_fndecl + first to verify it is still a builtin. + +2006-02-13 Geoffrey Keating + + * dwarf2out.c (base_type_die): Don't add AT_name here. + (subrange_type_die): Don't add AT_name here. + (modified_type_die): Rearrange code flow. Do add AT_name here. + +2006-02-13 Zdenek Dvorak + + PR rtl-optimization/26247 + PR rtl-optimization/26248 + * loop-invariant.c (may_assign_reg_p): Do not allow VOIDmode. + +2006-02-13 Richard Sandiford + + * config/floatunditf.c: Use if __LDBL_MANT_DIG__ == 113. + * config/fixtfdi.c: Likewise. + * config/fixunstfdi.c: Likewise. + * config/floatditf.c: Likewise. + +2006-02-13 Roger Sayle + + PR middle-end/24427 + * fold-const.c (fold_binary) : Transform (X&C1)|C2 + into (X,C2) if C1 is a subset of the bits of C2. Transform + (X&C1)|C2 into X|C2 if C1|C2 == ~0. Canonicalize (X&C1)|C2 as + (X&(C1&~C2))|C2. + : Canonicalize (X|C1)&C2 as (X&C2)|(C1&C2). + +2006-02-13 Josh Conner + + PR target/25376 + * varasm.c (function_section): Check for section name before + calling select_section on targets that define + USE_SELECT_SECTION_FOR_FUNCTIONS. On other targets, use + unlikely_text_section instead of hot_function_section if + first_function_block_is_cold. + +2006-02-13 J"orn Rennecke + + PR middle-end/25335 + * reload1.c (gen_reload): Also use find_replacement in UNARY_P case. + +2006-02-12 Zdenek Dvorak + + PR rtl-optimization/26222 + * function.c (assign_stack_temp_for_type): Do not reuse stack slots + after tree->rtl expansion. + * loop-invariant.c (move_invariant_reg): Use force_operand on rhs + before passing it to emit_move_insn. + +2006-02-12 Gabriel Dos Reis + + * doc/invoke.texi (-Write-strings): Document that it is enabled by + default. + * c.opt (-Wwrite-strings): Declare variable warn_write_strings. + Clarify documentation. + * c-common.h (warn_write_strings): Remove. + * c-common.c (warn_write_strings): Likewise. + * c-opts.c (c_common_init_options): Enable -Wwrite-strings by + default for C++. + +2006-02-12 Roger Sayle + + PR middle-end/25724 + * dojump.c (do_jump): Call do_compare_rtx_and_jump. + (do_jump_parts_zero_rtx): New function renamed from + do_jump_parts_equality_rtx. Made static. Add a mode argument. + (do_jump_parts_equality_rtx): New function split out from + do_jump_parts_equality. Old implementation renamed as above. + Call do_jump_parts_zero_rtx if either operand is zero. + (do_jump_parts_equality): Call do_jump_parts_equality_rtx to + do all of the heavy lifting. + (do_compare_rtx_and_jump): Handle multi-word comparisons by + calling either do_jump_by_parts_greater_rtx or + do_jump_by_parts_equality_rtx. + * expr.h (do_jump_by_parts_equality_rtx): Remove prototype. + * expmed.c (do_cmp_and_jump): Now multi-word optimization has + moved to do_compare_rtx_and_jump, call it directly. + * stmt.c (do_jump_if_equal): Remove static prototype. Add a + mode argument. Call do_compare_rtx_and_jump. + (emit_case_nodes): Update calls to do_jump_if_equal. + +2006-02-12 Zdenek Dvorak + + PR rtl-optimization/26225 + * loop-invariant.c (may_assign_reg_p): Do not allow BLKmode operands. + +2006-02-12 Zdenek Dvorak + + PR rtl-optimization/26232 + * loop-invariant.c (find_invariant_insn): Ignore insns that set CC0. + +2006-02-11 Jason Merrill + + PR tree-opt/24365 + * tree-inline.c (declare_return_variable): Just don't use the + modify target if it's a gimple complex reg and the return slot + isn't. + +2006-02-11 Kaveh R. Ghazi + + * doc/contrib.texi: Update my entry. + +2006-02-10 Geoffrey Keating + + * config/i386/darwin.h (DBX_REGISTER_NUMBER): Define. + +2006-02-10 Diego Novillo + + * tree-inline.c (estimate_num_insns_1): Make OpenMP directives + expensive. + +2006-02-10 Zdenek Dvorak + + * doc/invoke.texi (-floop-optimize2): Removed. + * toplev.c (process_options): Remove handling of flag_loop_optimize2. + * loop-init.c (gate_handle_loop2): Do not test flag_loop_optimize2. + Test flag_branch_on_count_reg only if HAVE_doloop_end. + * common.opt (floop-optimize2): Removed. + (fmove-loop-invariants): Enabled by default. + +2006-02-10 Sebastian Pop + + * tree-if-conv.c (combine_blocks): Free the result of + get_loop_exit_edges. + +2006-02-10 Jeff Law + + * fold-const.c (tree_expr_nonzero_p): Fix thinko. + + PR tree-optimization/26213 + * tree-ssa-threadedge.c (simplify_control_stmt_condition): Do not + loop trying to follow SSA_NAME_VALUE chains. + +2006-02-10 Richard Guenther + + * tree-dfa.c (get_ref_base_and_extent): When computing maxsize + deal with structures that end in implicitly variable sized arrays. + +2006-02-09 Zdenek Dvorak + + PR rtl-optimization/24762 + * df-scan.c (df_bb_refs_record): Record correct registers defined on + eh edges. + +2006-02-09 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (struct loop_data, loop_data): Removed. + (struct ivopts_data): Add regs_used field. + (tree_ssa_iv_optimize_init): Do not allocate aux fields for loops. + (ivopts_global_cost_for_size, determine_set_costs): Use data->regs_used + instead of loop_data->regs_used; + (free_loop_data): Do not free aux fields for loops. + (tree_ssa_iv_optimize): Do not pass loops to tree_ssa_iv_optimize_init + and tree_ssa_iv_optimize_finalize. + +2006-02-09 Kaz Kojima + + * config/sh/sh.h (FUNCTION_VALUE): Don't handle CHAR_TYPE. + +2006-02-09 J"orn Rennecke + + PR target/26141 + * sh.c (sh_gimplify_va_arg_expr): Don't change the result type when + computing the effective result type. + +2006-02-09 J"orn Rennecke + + PR inline-asm/16194 + * tree.h (decl_overlaps_hard_reg_set_p) Don't declare. + (tree_overlaps_hard_reg_set): Declare. + * stmt.c (decl_overlaps_hard_reg_set_p): Now static. Change return + type and signature to match function type expected by walk_tree. + (tree_overlaps_hard_reg_set): New function. + (decl_conflicts_with_clobbers_p): Rename to: + (tree_conflicts_with_clobbers_p). Take HARD_REG_SET * argument. + Use tree_overlaps_hard_reg_set. Changed caller. + * doc/tm.texi (TARGET_MD_ASM_CLOBBERS): Replace + decl_overlaps_hard_reg_set_p with tree_overlaps_hard_reg_set. + * cris.c (cris_md_asm_clobbers): Likewise. + +2006-02-09 Bernd Schmidt + + * reload1.c (emit_input_reload_insns): Delete code that tries to + inherit using find_equiv_reg. + +2006-02-09 Gabriel Dos Reis + + * c-common.h (flag_const_strings): Don't declare. + * c-common.c (flag_const_strings): Remove. + * c.opt (fconst_strings): Remove. + * c-opts.c (c_common_handle_option): Remove . + : Don't set flag_const_strings. + (c_common_init_options): Don't set flag_const_strings. + * doc/invoke.texi (-fno-const-strings): Remove documentation. + +2006-02-09 Richard Earnshaw + + * arm.md (tlobits_cbranch): New pattern. + * arm.h (arm_select_cc_mode): For thumb, only return CC_Nmode if + testing a single bit. + +2006-02-09 Andrew Pinski + + PR tree-opt/26179 + * tree-ssa-pre.c (create_component_ref_by_pieces): + Handle RETURN_DECL like VAR_DECL. + +2006-02-09 Andrew Pinski + + PR middle-end/26134 + * fold-const.c (fold_indirect_ref_1): Fold + "*(foo *)&complexfoo" to "__real__ complexfoo" + and "((foo*)&complexfoo)[1]" to "__imag__ complexfoo". + +2006-02-09 Andrew Pinski + + * tree-flow-inline.h (var_can_have_subvars): + Volatile variables should not have subvariables. + +2006-02-09 Diego Novillo + + PR 26180 + * tree-vrp.c (vrp_int_const_binop): Detect overflow when + multiplying unsigned values. + Tidy comments. + +2006-02-09 Eric Botcazou + + * config/sparc/sparc.c (tls_call_delay): Fix oversight. + +2006-02-08 Jason Merrill + + PR c++/25979 + * tree.def: Elaborate on difference from MODIFY_EXPR. + * doc/c-tree.texi (INIT_EXPR): Likewise. + * gimplify.c (internal_get_tmp_var): Use INIT_EXPR. + (gimplify_decl_expr, gimplify_init_ctor_eval): Likewise. + (gimplify_target_expr): Likewise. + (gimplify_cond_expr): Remove target handling. + (gimplify_modify_expr): Don't clobber INIT_EXPR code here. + (gimplify_expr): Clobber it here. + (gimplify_modify_expr_rhs): Push assignment into COND_EXPR here. + Do return slot optimization if we have an INIT_EXPR. + + PR tree-opt/24365 + * tree-inline.c (declare_return_variable): Also clear + DECL_COMPLEX_GIMPLE_REG_P as needed in the modify_dest case. + + PR c++/16405 + * gimplify.c (gimplify_modify_expr_rhs): Re-enable *& handling. + + PR middle-end/22439 + * gimplify.c (gimplify_one_sizepos): Fix typo. + +2006-02-08 Jeff Law + + PR tree-optimization/21417 + * tree-ssa-threadedge.c (thread_across_edge): Reject threading + across a backedge if the control statement at the end of the + block is data dependent on other statements in the same block. + (record_temporary_equivalences_from_stmts): Remove over-conservative + test for threading across backedges. + + * tree-ssa-dce.c (remove_dead_statement): When removing a dead + control statement, handle all three special cases in the same + manner as they all have the same desired solution. No longer + special case edge flag updating when the post dominator is + the exit block. + +2006-02-08 Roger Sayle + + * tree.def (CHAR_TYPE): Remove. + * dbxout.c (dbxout_type): Delete dead handling of CHAR_TYPE. + * dwarf2out.c (base_type_die, is_base_type): Likewise. + (gen_type_die) : Remove handling of CHAR_TYPE arrays. + (gen_string_type_die): Delete unreachable function. + + * tree-pretty-print.c (dump_generic_node): Don't handle CHAR_TYPE. + * tree.c (build_int_cst_wide, type_contains_placeholder_1, + type_hash_eq, variably_modified_type_p, walk_type_fields): Likewise. + * tree.h (NUMERICAL_TYPE_CHECK, INTEGRAL_TYPE_P): Likewise. + * builtins.c (type_to_class): Likewise. + * fold-const.c (fold_convert, build_range_check, + merge_ranges): Likewise. + * expr.c (count_type_elements): Likewise. + * c-pretty-print.c (pp_c_type_specifier): Likewise. + * stor-layout.c (layout_type): Likewise. + * ipa-type-escape.c (type_to_consider): Likewise. + * gimplify.c (omp_firstprivatize_type_sizes, + gimplify_type_sizes): Likewise. + * explow.c (promote_mode): Likewise. + * tree-sra.c (is_sra_scalar_type): Likewise. + * varasm.c (output_constant): Likewise. + * tree-inline.c (remap_type_1): Likewise. + * convert.c (convert_to_pointer, convert_to_real, + convert_to_integer, convert_to_complex): Likewise. + +2006-02-08 Daniel Berlin + + * df-scan.c (df_def_record_1): A set destination may + be a parallel regardless of mode. + +2006-02-08 Roger Sayle + + PR target/22209 + * config/mips/mips.h (MIN_UNITS_PER_WORD): Don't define for libgcc. + * config/mips/_tilib.c: Remove. + * config/fixtfdi.c: New libgcc source file. + * config/fixunstfdi.c: New source file. + * config/floatditf.c: New source file. + * config/floatunditf.c: New souce file. + * config/mips/t-iris6 (LIB2FUNCS_EXTRA): Include the new source + files above instead of config/mips/_tilib.c. + * config/mips/t-linux64 (LIB2FUNCS_EXTRA): Likewise. + +2006-02-08 Jeff Law + + PR tree-optimization/26169 + * tree-vrp.c (execute_vrp): Perform any queued SSA updates before + threading jumps. + +2006-02-08 Zdenek Dvorak + + * df.h (DF_REG_SIZE): Return the length of the initialized + part of the array. + +2006-02-08 Nathan Sidwell + + * config/m68k/lb1sf68.asm (__divsf3, __divdf3, __mulsf3, + __muldf3): Return a correctly signed zero. + +2006-02-08 Paolo Bonzini + + * passes.c (register_one_dump_file): Accept the current properties + instead of pass number. Adjust call to dump_register. Remove + duplicated code. + (register_dump_files): Now a wrapper around... + (register_dump_files_1): ... this one. Do not modify the pass + structure. + (next_pass_1): Cosmetic fix. + (execute_todo): Keep second parameter only. Use curr_properties + instead of fetching it from the pass structure. Check and set + last_verified. + (execute_one_pass): Handle TODO_set_props. Use curr_properties + instead of fetching it from the pass structure. Fix calls to + execute_todo. Update curr_properties and initialize .vcg RTL dump + after running the pass. Reset last_verified. + * tree-dump.c (dump_files): Renumber consecutively. Put .cgraph dump + at the beginning. + (FIRST_AUTO_NUMBERED_DUMP): New. + (dump_register): Remove "num" parameter, assign it within the + function. + (get_dump_file_name): Modify template for dumps. + * tree-dump.h (dump_register): Adjust prototype. + * tree-pass.h (enum tree_dump_index): Move cgraph at the beginning. + (PROP_trees): Add PROP_gimple_lomp. + (TODO_set_props): New. + * gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf. + * tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh. + * cfgexpand.c (pass_expand): Destroy PROP_trees. + +2006-02-08 Jakub Jelinek + + * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file. + (sparc64-*-linux*): Likewise. + * config/sparc/t-linux64 (SHLIB_MAPFILES): Removed. + * config/sparc/t-linux: New file. + * config/sparc/libgcc-sparc-glibc.ver (__fixtfdi, __fixunstfdi, + __floatditf): Export at GCC_LDBL_3.0 if -m32 -mlong-double-128. + (__divtc3, __multc3, __powitf2): Export at GCC_LDBL_4.0.0 if + -m32 -mlong-double-128. + + * config.gcc (alpha*-*-linux*): Add alpha/t-linux to tmake_file. + * config/alpha/t-linux: New file. + * config/alpha/libgcc-alpha-ldbl.ver: New file. + + * config/sparc/linux.h (TARGET_OS_CPP_BUILTINS): Define + __LONG_DOUBLE_128__ if TARGET_LONG_DOUBLE_128. + (CPP_SUBTARGET_SPEC): Don't add -D__LONG_DOUBLE_128__ here. + * config/sparc/linux64.h (TARGET_OS_CPP_BUILTINS): Define + __LONG_DOUBLE_128__ if TARGET_LONG_DOUBLE_128 and TARGET_ARCH32. + (CPP_ARCH32_SPEC): Remove. + +2006-02-07 Uttam Pawar + + PR tree-optimization/26145 + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Free + bbs pointer. + +2006-02-07 John David Anglin + + PR target/26109 + * pa.c (attr_length_indirect_call): Don't return length 8 for distances + >= 240000 when generating code for SOM runtime. + (output_indirect_call): Don't use "b,l" instruction for indirect calls + to $$dyncall when generating code for SOM runtime.. + +2006-02-07 Dirk Mueller + + PR c++/18150 + * doc/invoke.texi (-Wsequence-point): Update documentation + that -Wsequence-point is implemented for C++ as well. + +2006-02-07 Eric Botcazou + + * config/sol26.h (CPP_SUBTARGET_SPEC): Accept -pthread. + * config/sol2.h (CPP_SUBTARGET_SPEC): Likewise. + (LIB_SPEC): Likewise. + * doc/invoke.texi (SPARC options): Document -pthread. + +2006-02-07 Geoffrey Keating + + * config/i386/i386.c (ix86_delegitimize_address): Support Darwin + PIC addresses. + +2006-02-07 Roger Sayle + + * config/sparc/sparc.c (sparc_type_code): Don't handle CHAR_TYPE. + Correct comment describing BOOLEAN_TYPE. + +2006-02-07 Dirk Mueller + + * c.opt: C++ frontend supports -Wdiv-by-zero. + * c-opts.c (c_common_handle_option): Remove dead case. + +2006-02-07 Eric Botcazou + + * configure.ac (TLS assembler check): Do not enable TLS by + default on SPARC/Solaris before version 10. + * configure: Regenerate. + +2006-02-07 David Edelsohn + + * doc/invoke.texi (xl-compat): Document conversion and support + routine names. + +2006-02-07 Jeff Law + + * tree-vrp.c (find_conditional_asserts): Update comments. + (simplify_stmt_for_jump_threading): New. + (identify_jump_threads, finalize_jump_threads): New. + (vrp_finalize): Call identify_jump_threads. + (execute_vrp): Call finalize_jump_threads. + * tree-ssa-dom.c (struct opt_stats_d): Remove num_iterations field. + (vrp_element, vrp_data, vrp_element_p): Remove. + (vrp_hash_elt, vrp_variables_stack): Remove. + (vrp_hash, vrp_eq, record_range): Remove. + (simplify_cond_and_lookup_avail_expr): Remove. + (extract_range_from_cond): Remove. + (thread_across_edge): Relocated into tree-ssa-threadedge.c. + (simplify_stmt_for_jump_threading): New. + (dom_thread_across_edge): New wrapper. + (tree_ssa_dominator_optimize): No longer initialize or + finalize any of the VRP datastructures. Remove iteration + step and simplify as a result of removal of iteration step. + (pass_dominator): Perform a cfg cleanup after DOM. + (dom_opt_finalize_block): Use the new common routines + for threading jumps. Simplify stack management slightly. + No longer need to unwind VRP state. + (record_equivalences_from_incoming_edge): No longer record + VRP information. + (eliminate_redundant_computations): No longer call + simplify_cond_and_lookup_avail_expr. + * tree-flow.h (potentially_threadable_block): Prototype. + (thread_across_edge): Likewise. + * Makefile.in (OBJS-common): Add tree-ssa-threadedge.o + (tree-ssa-threadedge.o): Add dependencies. + * tree-ssa-threadedge.c: New file. + * passes.c (init_optimization_passes): Merge PHIs before + calling VRP. Run VRP again late in the SSA optimization pipeline. + +2006-02-07 Eric Botcazou + + * df-core.c (df_set_blocks): Do not dereference function pointers. + (df_finish1): Likewise. + (df_hybrid_search_forward): Likewise. + (df_hybrid_search_backward): Likewise. + (df_iterative_dataflow): Likewise. + (df_analyze_problem): Likewise. + (df_compact_blocks): Likewise. + (df_dump): Likewise. + * df-scan.c (df_rescan_blocks): Likewise. + (df_record_entry_block_defs): Likewise. + + * genconditions.c (write_conditions): Guard the definition of + 'insn_conditions' with the check on GCC version. + (write_writer): Guard the traversal 'insn_conditions' with + the check on GCC version. + +2006-02-07 Richard Guenther + + PR c++/26140 + Revert + 2006-01-30 Richard Guenther + PR c++/23372 + * gimplify.c (gimplify_target_expr): Handle easy cases + without creating a temporary. + +2006-02-07 Pete Steinmetz + + * sched-rgn.c (compute_dom_prob_ps, compute_trg_info): Eradicate + use of float in probability computations. Use edge probabilities + in place of statically computed probabilities. + (min_spec_prob): New static variable. + (schedule_insns): Initialize it. + (GET_SRC_PROB): Removed. + * doc/invoke.texi (min-sched-prob): Renamed to min-spec-prob. + +2006-02-07 Alexandre Oliva + + PR debug/24444 + * config/ia64/unwind-ia64.c: Revert last change. + * config/ia64/ia64.h (ARG_POINTER_CFA_OFFSET): Removed. + (INCOMING_FRAME_SP_OFFSET): Define. + +2006-02-06 Roger Sayle + + * config/ia64/ia64.c (hfa_element_mode): Don't handle CHAR_TYPE. + +2006-02-07 Ben Elliston + + * config/i386/i386.c (ix86_scalar_mode_supported_p): New. + (TARGET_SCALAR_MODE_SUPPORTED_P): Define hook. + (classify_argument): Handle SDmode, DDmode, TDmode for 64-bit. + (ix86_return_in_memory): Handle TDmode. + (ix86_libcall_value): Handle SDmode, DDmode, TDmode. + (ix86_value_regno): Return non-TDmode decimal float modes in %eax. + +2006-02-06 Richard Sandiford + + * reorg.c (dbr_schedule): Use dump_file instead of file. + +2006-02-06 Steve Ellcey + + PR target/25917 + * config/ia64/predicates.md (extr_len_operand): New predicate. + * config/ia64/ia64.md (extv): Tighten constraints. + (extzv): Ditto. + (*tbit_and_2): Ditto. + (*tbit_and_3): Ditto. + (*tbit_or_2): Ditto. + (*tbit_or_3): Ditto. + (*bit_zero): Ditto. + (*bit_one): Ditto. + +2006-02-06 Andrew Pinski + + PR target/23359 + * config/i386/i386.md (trap): Use ASM_SHORT instead of .word. + +2006-02-06 Zdenek Dvorak + + * tree-vrp.c (execute_vrp): Do not pass dump argument to. + loop_optimizer_init and loop_optimizer_finalize + * tree-ssa-sink.c (execute_sink_code): Ditto. + * tree-ssa-loop-ch.c (copy_loop_headers): Ditto. + * tree-ssa-loop.c (tree_loop_optimizer_init, tree_ssa_loop_init, + tree_ssa_loop_done): Ditto. + * tree-ssa-pre.c (init_pre, fini_pre): Ditto. + * sched-ebb.c: Include output.h. + (schedule_ebbs): Do not use dump argument. + * value-prof.h (struct profile_hooks): Remove profile_dump_file. + * loop.c (loop_dump_stream): Removed. + (loop_optimize, rest_of_handle_loop_optimize): Do not use dump + argument. + (scan_loop, move_movables, find_and_verify_loops, mark_loop_jump, + emit_prefetch_instructions, loop_bivs_find, loop_bivs_check, + final_biv_value, loop_biv_eliminable_p, loop_givs_rescan, + loop_iterations, strength_reduce, record_biv, record_giv, + final_giv_value, check_final_value, check_ext_dependent_givs, + combine_givs, check_dbra_loop, maybe_eliminate_biv, load_mems, + try_copy_prop, loop_delete_insns, try_swap_copy_prop): Use + dump_file instead of loop_dump_stream. + * ddg.c (print_ddg_edge, print_ddg, vcg_print_ddg): Do not call + argument dump_file. + * reorg.c (dbr_schedule, rest_of_handle_delay_slots): Do not use + dump argument. + * flow.c (life_analysis, rest_of_handle_life): Ditto. + * haifa-sched.c: Include output.h + (schedule_insns, sched_init): Do not use dump argument. + * mode-switching.c (optimize_mode_switching): Ditto. + * modulo-sched.c (stats_file): Removed. + (print_node_sched_params): Do not call argument dump_file. + (sms_schedule_by_order, loop_canon_p, sms_schedule, + rest_of_handle_sms): Do not use dump argument. Use dump_file instead + of stats_file. + * cse.c (cse_main, rest_of_handle_cse, rest_of_handle_cse2): Do not + use dump argument. + * loop-init.c (loop_optimizer_init, loop_optimizer_finalize, + rtl_loop_init, rtl_loop_done): Ditto. + * global.c (global_alloc, rest_of_handle_global_alloc): Ditto. + * predict.c (combine_predictions_for_bb, tree_estimate_probability): + Ditto. + * recog.c (peephole2_optimize, rest_of_handle_peephole2): Ditto. + * lcm.c (pre_edge_lcm, pre_edge_rev_lcm): Ditto. + * regmove.c (fixup_match_1, fixup_match_2, regmove_optimize, + rest_of_handle_regmove, rest_of_handle_stack_adjustments): Ditto. + * emit-rtl.c (renumber_insns): Ditto. + * cfgexpand.c (add_reg_br_prob_note, expand_gimple_cond_expr, + expand_gimple_basic_block, tree_expand_cfg): Ditto. + * regclass.c (regclass): Ditto. + * tree-outof-ssa.c (analyze_edges_for_bb, perform_edge_inserts, + remove_ssa_form, rewrite_out_of_ssa): Ditto. + * reg-stack.c (compensate_edge, compensate_edges, convert_regs_1, + convert_regs_2, convert_regs, reg_to_stack, rest_of_handle_stack_regs): + Ditto. + * sched-rgn.c (schedule_insns, rest_of_handle_sched): Ditto. + * local-alloc.c (rest_of_handle_local_alloc): Do not pass dump_file + to regclass. + * gcse.c (gcse_file, debug_stderr): Removed. + (gcse_main, bypass_jumps, rest_of_handle_jump_bypass, + rest_of_handle_gcse): Do not use dump argument. + (cprop_jump, cprop_insn, do_local_cprop, cprop, find_implicit_sets, + one_cprop_pass, bypass_block, compute_pre_data, insert_insn_end_bb, + pre_edge_insert, pre_insert_copy_insn, pre_delete, one_pre_gcse_pass, + compute_code_hoist_vbeinout, compute_code_hoist_data, + one_code_hoisting_pass, trim_ld_motion_mems, update_ld_motion_stores, + compute_store_table, build_store_vectors, insert_insn_start_bb, + insert_store, remove_reachable_equiv_notes, replace_store_insn, + store_motion): Use dump_file instead of gcse_file. + * ipa-type-escape.c (type_escape_execute): Remove debugging comments. + * profile.c (profile_dump_file): Removed. + (branch_prob): Use dump_file instead of profile_dump_file. + * ipa.c (cgraph_remove_unreachable_nodes): Do not call argument + dump_file. + * tree-ssa-copy.c (dump_copy_of): Ditto. + * rtl-factoring.c (rtl_seqabstr, rest_of_rtl_seqabstr): Do not pass + dump file to life_analysis. + * bt-load.c (branch_target_load_optimize): Ditto. + * cfgcleanup.c (rest_of_handle_jump2): Do not pass dump_file to + renumber_insns. + * rtl.h (cse_main, renumber_insns, schedule_insns, schedule_ebbs, + regclass, dbr_schedule): Declaration changed. + * sched-int.h (sched_init): Declaration changed. + * tree-profile.c (tree_profile_dump_file): Removed. + (tree_profile_hooks): Removed profile_dump_file hook. + * rtl-profile (rtl_profile_dump_file): Removed. + (rtl_profile_hooks): emoved profile_dump_file hook. + * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Declaration + changed. + * c-gimplify.c (c_genericize): Do not call local variable dump_file. + * tree-cfg.c (build_tree_cfg): Ditto. + * Makefile.in (haifa-sched.o, sched-ebb.o): Add output.h dependency. + * basic-block.h (life_analysis, pre_edge_lcm, pre_edge_rev_lcm): + Declaration changed. + * config/sh/sh.c (sh_output_mi_thunk): Do not pass dump_file to + life_analysis and schedule_insns. + * config/m68hc11/m68hc11.c (m68hc11_reorg): Do not pass dump_file to + life_analysis. + * config/mt/mt.c (mt_machine_reorg): Do not pass dump_file to + dbr_schedule. + * config/mips/mips.c (mips_reorg): Ditto. + * config/ia64/ia64.c (ia64_reorg): Do not pass dump_file to + schedule_ebbs. + +2006-02-06 Aldy Hernandez + + * config/s390/s390.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. + (s390_mangle_fundamental_type): New. + * config/s390/linux.h (TARGET_ALTERNATE_LONG_DOUBLE_MANGLING): + Define. + + * config/alpha/alpha.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. + (alpha_mangle_fundamental_type): New. + * config/alpha/linux.h (TARGET_ALTERNATE_LONG_DOUBLE_MANGLING): + Define. + + * config/sparc/linux.h (TARGET_ALTERNATE_LONG_DOUBLE_MANGLING): + Define. + * config/sparc/linux64.h (TARGET_ALTERNATE_LONG_DOUBLE_MANGLING): + Define. + * config/sparc/sparc.c (TARGET_MANGLE_FUNDAMENTAL_TYPE): Define. + (sparc_mangle_fundamental_type): New. + +2006-02-06 Jakub Jelinek + + * config.gcc (s390-*-linux*): Add s390/t-linux to tmake_file. + (s390x-*-linux*): Likewise. + * config/s390/t-linux64 (SHLIB_MAPFILES): Removed. + * config/s390/t-linux: New file. + +2006-02-02 Bernd Schmidt + + * config/i386/sync.md (sync_add, sync_sub, sync_ior, + sync_and, sync_xor): Operand 0 is in-out. + +2006-02-06 Daniel Berlin + + * tree-ssa-pre.c (bb_value_sets_t): Add antic_safe_loads. + (ANTIC_SAFE_LOADS): New macro. + (find_or_generate_expression): Add prototype. + (set_contains_value): Allow null set for sake of not always having + to allocate ANTIC_SAFE_LOADS. + (phi_translate): Move placement of AGGREGATE_TYPE_P check. + Allow COMPONENT_REF too. + (valid_in_set): Allow COMPONENT_REF. + Check ANTIC_SAFE_LOADS too. + (compute_antic_aux): Print out ANTIC_SAFE_LOADS. + (compute_rvuse_and_antic_safe): Add ANTIC_SAFE computation, and + rename. + (can_PRE_operation): Add COMPONENT_REF. + (create_component_ref_by_pieces): New function. + (create_expression_by_pieces): Use create_component_ref_by_pieces. + (insert_aux): Move AGGREGATE_TYPE_P check here. + (compute_avail): Set bb local stmt uids. + (pass_pre): Use TODO_update_ssa_only_virtuals. + +2006-02-06 Ben Elliston + + * configure.ac: Unconditionally disable decimal float by default. + * configure: Regenerate. + +2006-02-06 Ben Elliston + + * read-rtl.c (read_name): Terminate reading on EOF. + +2006-02-06 Ben Elliston + + * dfp.c (decimal_real_arithmetic): Change second argument type + from int to enum tree_code. Do not always return true, but now + return result of any call to decimal_do helper functions. + * dfp.h (decimal_real_arithmetic): Update prototype. + +2006-02-05 Eric Botcazou + + * config/sparc/sol2-bi.h (SPARC_DEFAULT_CMODEL): Set to CM_MEDMID. + +2006-02-05 Andrew Pinski + + PR tree-opt/25251 + * tree-cfg.c (cleanup_dead_labels): Also don't remove + forced labels. + +2006-02-04 Zdenek Dvorak + + * tree-vrp.c (cfg_loops): Removed. + (adjust_range_with_scev, vrp_visit_assignment, execute_vrp): + Use current_loops instead of cfg_loops. Pass flags to + loop_optimizer_init. + * cfgloopmanip.c (fix_loop_structure): Update only available + information. + * tree-ssa-loop-ch.c (copy_loop_headers): Pass flags to + loop_optimizer_init. + * modulo-sched.c (build_loops_structure): Removed. + (sms_schedule): Use loop_optimizer_init. + * loop-init.c (loop_optimizer_init): Use flags to determine + which properties of loops to prepare. + (rtl_loop_init): Pass flags to loop_optimizer_init. + * tree-ssa-sink.c (execute_sink_code): Ditto. + * tree-ssa-loop.c (tree_loop_optimizer_init): Ditto. + * tree-ssa-pre.c (init_pre): Ditto. + * cfgloop.h (LOOPS_NORMAL): New. + (loop_optimizer_init): Declaration changed. + +2006-02-05 John David Anglin + + * pa/x-ada-hpux10, pa/t-pa-hpux10, pa/t-pa-hpux11: New files. + * config.gcc (hppa[12]*-*-hpux10*): Use pa/t-pa-hpux10 instead of + pa/t-pa. + * config.gcc (hppa[12]*-*-hpux11*): Use pa/t-pa-hpux11 instead of + pa/t-pa. + * config.host (hppa*-*-hpux10*): Use pa/x-ada-hpux10 instead of + pa/x-ada. + * pa/t-pa-hpux: Add lib2funcs.asm and quadlib.c rules. + * pa/t-pa64: Delete quadlib.c rule. + * pa/x-ada: Revert last change. + * pa/t-pa: Revert last change. Delete quadlib.c rule. + +2006-02-04 Zdenek Dvorak + + PR rtl-optimization/26087 + * rtlanal.c (canonicalize_condition): Do not cross basic block + boundaries. + +2006-02-04 Alexandre Oliva + + PR debug/24444 + * config/ia64/ia64.c: Include debug.h. + (MAX_ARTIFICIAL_LABEL_BYTES): New. + (ia64_label_after_insn, ia64_dwarf2out_def_steady_cfa): New. + (IA64_CHANGE_CFA_IN_EPILOGUE): Define to 0. + (process_epilogue, process_set, process_for_unwind_directive): + Output unwind info only if requested. Add CFA info if requested. + Add new arguments as needed. Adjust callers. + * config/ia64/ia64.h (ARG_POINTER_CFA_OFFSET): Override + incorrect default. + (DWARF2_FRAME_INFO): Define to zero. + * config/ia64/unwind-ia64.c: Remove code that compensated for + the CFA offset error fixed above. + * config/ia64/t-ia64 (ia64.o): Depend on debug.h. + * dwarf2out.c (DWARF2_FRAME_INFO): Define default. + (dwarf2out_do_frame): Require nonzero DWARF2_UNWIND_INFO for + -funwind-tables and -fexceptions to enable frame info. + (dwarf2out_frame_init): Define initial CFA even if + DWARF2_UNWIND_INFO is disabled. Call initial_return_save if + DWARF2_UNWIND_INFO is nonzero, not just defined. + (dwarf2out_frame_finish): Output non-EH call frame info only + if DWARF2_FRAME_INFO is nonzero. + (convert_cfa_to_loc_list, + compute_frame_pointer_to_cfa_displacement): Define even if + unwind info is not supported. + (gen_subprogram_die): Use the above unconditionally. Remove + legacy alternate code. + * toplev.c (compile_file): Compile in call to + dwarf2out_frame_finish if DWARF2_DEBUGGING_INFO is defined. + (lang_dependent_init): Ditto for dwarf2out_frame_init. + +2006-02-04 David Edelsohn + Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_mangle_fundamental_type): Mangle + IBM extended float format long double as "g" on powerpc*-linux. + +2006-02-03 John David Anglin + + PR target/25926 + * pa/x-ada (X_ADA_CFLAGS): Define _X_HPUX10 on HP-UX 10. + * pa/t-pa (TARGET_LIBGCC2_CFLAGS): Define _T_HPUX10 on HP-UX 10. + +2006-02-03 Jason Merrill + + PR c++/25979 + * gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for now. + + PR middle-end/25977 + * gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO + on the return slot if it's an NRV. + +2006-02-03 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (enum use_type): Remove USE_OUTER. + (dump_use, add_derived_ivs_candidates, determine_use_iv_cost, + rewrite_use): Do not handle USE_OUTER. + (find_interesting_uses_outer_or_nonlin, find_interesting_uses_outer, + add_iv_outer_candidates, may_replace_final_value, + determine_use_iv_cost_outer, rewrite_use_outer): Removed. + (find_interesting_uses_op): Functionality of + find_interesting_uses_outer_or_nonlin moved here. + (find_interesting_uses_outside): Use find_interesting_uses_op. + +2006-02-03 Alan Modra + + PR target/25960 + * config/rs6000/darwin-ldouble.c (__gcc_qadd): Preserve -0.0 result. + +2006-02-03 Andreas Krebbel + Ulrich Weigand + + PR target/25864 + * config/s390/2084.md ("x_fsimptf", "x_fmultf", "x_fdivtf", + "x_floadtf", "x_ftrunctf", "x_ftruncdf"): New insn reservations. + * config/s390/fixdfdi.h (__fixunstfdi, __fixtfdi): New functions. + * config/s390/s390.c (struct processor_costs): Add mxbr, sqxbr, dxbr + and dxr fields. + (z900_cost, z990_cost, z9_109_cost): Values for the new fields added. + (s390_rtx_costs): Use the new fields to calculate rtx costs. + (s390_secondary_input_reload_class, s390_secondary_output_reload_class): + Define secondary reloads for TFmode moves. + (constant_modes): Add TFmode. + (NR_C_MODES): Set to 8. + * config/s390/s390.h (TARGET_CPU_CPP_BUILTINS): Add __LONG_DOUBLE_128__ + builtin define. + (LONG_DOUBLE_TYPE_SIZE): Set to 128 or 64. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE, WIDEST_HARDWARE_FP_SIZE): Define. + (HARD_REGNO_NREGS, HARD_REGNO_MODE_OK, CLASS_MAX_NREGS, + CANNOT_CHANGE_MODE_CLASS): Consider TFmode. + * config/s390/s390.md ("type" attribute): Add fsimptf, floadtf, fmultf, + fdivtf, fsqrttf, ftrunctf, ftruncdf as possible values. + (FPR mode macro): Add TFmode. + (DSF mode macro): New. + (, mode attributes): Removed. + (, , , , mode attributes): New. + ("*cmp_ccs_0", "*cmp_ccs_0_ibm", "*cmp_ccs", + "*cmp_ccs_ibm", "fix_trunc2_ieee", + "floatdi2", "floatsi2_ieee", "*add3", + "*add3_cc", "*add3_cconly", "*add3_ibm", + "*sub3", "*sub3_cc", "*sub3_cconly", + "*sub3_ibm", "*mul3_ibm", "*fmadd", "*fmsub", + "*div3", "*div3_ibm", "*neg2_cc", + "*neg2_cconly", "*neg2", "*neg2_ibm", + "*abs2_cc", "*abs2_cconly", "*abs2", + "*abs2_ibm", "*negabs2_cc", "*negabs2_cconly", + "*negabs2", "sqrt2"): + Changed to . R constraint replaced by . + ("*mul3"): Changed to . R constraint replaced by + . + ("fix_truncdi2"): 'FPR:' removed. + ("*fmadd", "*fmsub"): FPR mode replaced by DSF. + ("*movtf_64", "*movtf_31"): New insn definitions followed by 5 + splitters. + ("movtf", "reload_outtf", "reload_intf", "trunctfdf2", "trunctfsf2", + "extenddftf2", "extendsftf2"): New expanders. + ("*trunctfdf2_ieee", "*trunctfdf2_ibm", "*trunctfsf2_ieee", + "*trunctfsf2_ibm", "*extenddftf2_ieee", "*extenddftf2_ibm", + "*extendsftf2_ieee", "*extendsftf2_ibm"): New insn patterns. + * config/s390/s390.opt (mlong-double-128, mlong-double-64): + New options. + * config/s390/t-crtstuff (TARGET_LIBGCC2_CFLAGS): Macro defined. + * config/s390/libgcc-glibc.ver (__divtc3, __multc3, __powitf2, + __fixtfti, __fixunstfti, __floattitf, __fixtfdi, __fixunstfdi, + __floatditf): Add a GCC_4.1.0 symbol version tag. + * doc/invoke.texi (-mlong-double-128, -mlong-double-64): Document + the new options. + +2006-02-02 Andrew Pinski + + PR target/25377 + * config/i386/i386.c (ix86_function_ok_for_sibcall): + Use targetm.binds_local_p instead of TREE_PUBLIC. + +2006-02-02 Roger Sayle + + * tree.h (TYPE_STRING_FLAG): Document that this field may be used + on INTEGER_TYPEs to indicate that it denotes a character type. + * tree.c (build_common_tree_nodes): Set TYPE_STRING_FLAG on + signed_char_type_node, unsigned_char_type_node and char_type_node. + * dwarf2out.c (base_type_die): Treat CHAR_TYPE identically to + INTEGER_TYPE. Use TYPE_STRING_FLAG to decide whether to emit + a DW_ATE_[un]signed_char instead of a DW_ATE_[un]signed. + +2006-02-02 Zdenek Dvorak + Daniel Berlin + + * tree-tailcall.c (arg_needs_copy_p): New function. + (eliminate_tail_call): Use arg_needs_copy_p. + (tree_optimize_tail_calls_1): Ditto. Also call add_virtual_phis. + (add_virtual_phis): New function. + +2006-02-02 Jakub Jelinek + + * config/sparc/sparc.c (sparc_output_scratch_registers): Use + #ignore instead of #scratch for %g7 .register directive. + +2006-02-02 Andreas Tobler + + * config/sparc/freebsd.h (ENDFILE_SPEC): Add space to separate + object files. + +2006-02-02 Bernd Schmidt + + * flow.c (calculate_global_regs_live): Assert that there aren't any + EDGE_FAKE edges. + +2006-02-02 Paolo Bonzini + + * tree-flow-inline.h (bsi_after_labels): Rewrite, return + what its name says. + * lambda-code.c (perfect_nestify): Use bsi_insert_before on + bsi_after_labels iterator. + * tree-if-conv.c (find_phi_replacement_condition, + replace_phi_with_cond_modify_expr): Likewise. + * tree-scalar-evolution.c (scev_const_prop): Likewise. + * tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Likewise. + +2006-02-02 Diego Novillo + + * tree-inline.c (copy_tree_r): Also copy OMP_CLAUSE nodes. + +2006-02-02 Diego Novillo + + PR 25990 + * tree-cfg.c (move_block_to_fn): Clear out the basic block + array after growing it. + +2006-02-01 Steve Ellcey + + PR middle-end/24901 + * fold-const.c (fold_checksum_tree): Change type of buf. + +2006-02-01 Bernd Schmidt + + * reload.c (push_secondary_reload): Initialize t_icode. + +2006-02-01 Jakub Jelinek + + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): For + -msoft-float -mlong-double-128 only issue a warning, but don't + swich to DFmode long double. + +2006-02-01 Hans-Peter Nilsson + + * cse.c (fold_rtx) : When arg1 + has a constant equivalent, iterate over equivalents for arg0, + calling simplify_relational_operation and if there's a result + cheaper than X, apply fold_rtx and return the result. + +2006-02-01 Jan Hubicka + + * opts.c (no_unit_at_a_time_default): New global variable. + (decode_options): Use it. + * opts.h (no_unit_at_a_time_default): Declare. + +2006-02-01 Paul Brook + + * function.c (assign_parm_setup_reg): Use function argument promotion + rules. + * expr.c (expand_expr_real_1): Use function argument promotion rules + for PARM_DECLs. + +2006-02-01 Steve Ellcey + + * gcc.c (process_command): Change j to 'unsigned int'. + +2006-01-31 Andrew Pinski + + PR middle-end/26001 + * expr.c (expand_expr_real_1) : + Use the corrected index for the character + out of the string constant. + +2006-01-31 Andrew Pinski + + * mode-switching.c (optimize_mode_switching): Fix size + allocated for bb_info[n_entities]. + +2006-01-31 Andrew Pinski + + * gcc.c (main): Correct type that is allocated for + explicit_link_files. + +2006-01-31 Jakub Jelinek + + * config/s390/s390.c (init_alignment_context): Set + ALIAS_SET_MEMORY_BARRIER on the MEM. + * config/sparc/sparc.c (sparc_expand_compare_and_swap_12): Likewise. + +2006-01-31 Uttam Pawar + + PR middle-end/25933 + * loop-unroll.c (unroll_loop_runtime_iterations): Free + dom_bbs pointer. + * tree-ssa-live.c (type_var_init): Allocate bitmap after + call to tpa_init. + +2006-01-31 Marcin Dalecki + + * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. + * regrename.c: Ditto. + * tree-ssa-loop-im.c: Ditto. + * tree-dump.c: Ditto. + * tree-complex.c: Ditto. + * genrecog.c: Ditto. + * tree-ssa-threadupdate.c: Ditto. + * tracer.c: Ditto. + * java/class.c: Ditto. + * java/jcf-parse.c: Ditto. + * java/resource.c: Ditto. + * java/except.c: Ditto. + * java/jvspec.c: Ditto. + * java/jcf-write.c: Ditto. + * java/jcf-path.c: Ditto. + * java/gjavah.c: Ditto. + * java/zextract.c: Ditto. + * java/jcf-io.c: Ditto. + * java/jcf.h: Ditto. + * java/buffer.c: Ditto. + * java/lang.c: Ditto. + * java/parse-scan.y: Ditto. + * java/lex.c: Ditto. + * java/lex.h: Ditto. + * cfgloopmanip.c: Ditto. + * postreload-gcse.c: Ditto. + * tree-ssa-loop-manip.c: Ditto. + * postreload.c: Ditto. + * tree-ssa-loop-ch.c: Ditto. + * loop.c: Ditto. + * ipa-cp.c: Ditto. + * cppspec.c: Ditto. + * diagnostic.c: Ditto. + * final.c: Ditto. + * genoutput.c: Ditto. + * gcc.c: Ditto. + * cfghooks.c: Ditto. + * cfgloopanal.c: Ditto. + * objc/objc-act.c: Ditto. + * gcov.c: Ditto. + * genextract.c: Ditto. + * genautomata.c: Ditto. + * pretty-print.c: Ditto. + * genemit.c: Ditto. + * cgraphunit.c: Ditto. + * flow.c: Ditto. + * df-scan.c: Ditto. + * haifa-sched.c: Ditto. + * dominance.c: Ditto. + * dbxout.c: Ditto. + * tree-ssa-loop-ivopts.c: Ditto. + * df-core.c: Ditto. + * mode-switching.c: Ditto. + * modulo-sched.c: Ditto. + * graph.c: Ditto. + * ipa-pure-const.c: Ditto. + * cse.c: Ditto. + * fix-header.c: Ditto. + * web.c: Ditto. + * tree-stdarg.c: Ditto. + * ipa-utils.c: Ditto. + * loop-init.c: Ditto. + * ipa-inline.c: Ditto. + * cfganal.c: Ditto. + * global.c: Ditto. + * alloc-pool.c: Ditto. + * dwarf2out.c: Ditto. + * opts.c: Ditto. + * genattrtab.c: Ditto. + * tree-ssa-loop-ivcanon.c: Ditto. + * predict.c: Ditto. + * timevar.c: Ditto. + * lcm.c: Ditto. + * fortran/gfortranspec.c: Ditto. + * regmove.c: Ditto. + * local-alloc.c: Ditto. + * langhooks.c: Ditto. + * function.c: Ditto. + * tree-vectorizer.c: Ditto. + * gcse.c: Ditto. + * ipa-type-escape.c: Ditto. + * alias.c: Ditto. + * tree-if-conv.c: Ditto. + * profile.c: Ditto. + * ipa.c: Ditto. + * tree-data-ref.c: Ditto. + * loop-unroll.c: Ditto. + * treelang/treetree.c: Ditto. + * calls.c: Ditto. + * bt-load.c: Ditto. + * ggc-common.c: Ditto. + * except.c: Ditto. + * coverage.c: Ditto. + * cselib.c: Ditto. + * tree-cfgcleanup.c: Ditto. + * tree-ssa-pre.c: Ditto. + * cfgcleanup.c: Ditto. + * loop-invariant.c: Ditto. + * loop-iv.c: Ditto. + * ipa-prop.c: Ditto. + * print-tree.c: Ditto. + * conflict.c: Ditto. + * ggc-page.c: Ditto. + * sched-deps.c: Ditto. + * regclass.c: Ditto. + * tree-object-size.c: Ditto. + * combine.c: Ditto. + * bb-reorder.c: Ditto. + * resource.c: Ditto. + * var-tracking.c: Ditto. + * cfgloop.c: Ditto. + * df-problems.c: Ditto. + * reg-stack.c: Ditto. + * tlink.c: Ditto. + * gccspec.c: Ditto. + * sched-rgn.c: Ditto. + * tree-ssa-structalias.c: Ditto. + * tree-ssa-reassoc.c: Ditto. + * config/darwin-c.c: Ditto. + * config/darwin.c: Ditto. + * config/arm/arm.c: Ditto. + * cfgrtl.c: Ditto. + * collect2.c: Ditto. + * reload1.c: Ditto. + +2006-01-31 Nicolas Pitre + + * arm.md (smaxsi3): Make aware of smax_m1. + (smax_m1): New. + +2006-01-31 Nathan Sidwell + + * config/m68k/lb1sf68.asm: Use moveq to load small constants. + +2006-01-31 Richard Guenther + + * doc/invoke.texi (-msselibm): Document. + * target.h (expand_library_builtin): New target hook. + * builtins.c (expand_builtin): Use expand_library_builtin. + (default_expand_library_builtin): New function. + * gcc.c (LINK_GCC_MATH_SPEC): Define. + (LINK_COMMAND_SPEC): Handle %(link_gcc_math). + (link_gcc_math_spec): Declare. + (static_specs): Add link_gcc_math_spec. + * expr.h (default_expand_library_builtin): Declare. + * target-def.h (TARGET_EXPAND_LIBRARY_BUILTIN): Define. + (TARGET_INITIALIZER): Add TARGET_EXPAND_LIBRARY_BUILTIN. + * config/i386/i386.h: Provide LINK_GCC_MATH_SPEC. + * config/i386/i386.opt (msselibm): New target option. + * config/i386/i386.c (ix86_builtin_function_variants): New array. + (ix86_init_sse_abi_builtins): New function. + (ix86_expand_library_builtin): Likewise. + (TARGET_EXPAND_LIBRARY_BUILTIN): Define. + (override_options): Handle error conditions wrt -msselibm. + (ix86_builtins): Add function codes for SSE2 ABI builtins. + (ix86_init_builtins): Call ix86_init_sse_abi_builtins. + * doc/extend.texi (__builtin_sse2_*): Document new target specific + builtins. + +2006-01-31 Richard Guenther + Paolo Bonzini + + * doc/install.texi (--disable-libgcc-math): Document. + +2006-01-30 Marcin Dalecki + + * expr.h (expand_normal): new inline function. + * builtins.c: use it, use EXPAND_NORMAL explicitely. + * dojump.c: use it. + * dwarf2out.c: use it. + * expr.c: use it. + * calls.c: use it. + * expmed.c: use it. + * except.c: use it. + * config/sparc/sparc.c: use it. + * config/i386/i386.c: use it. + * config/rs6000/rs6000.c: use it. + * config/arm/arm.c: use it. + * config/mips/mips.c: use it. + * stmt.c: use it, use EXPAND_NORMAL explicitely. + +2006-01-30 Roger Sayle + + * config/i386/cygwin.h (GCC_DRIVER_HOST_INITIALIZATION): Cast + argv to the appropriate type. + +2006-01-30 Zdenek Dvorak + + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Remove + unreachable code. + +2006-01-30 Ulrich Weigand + + PR target/26018 + * config/s390/s390.c (struct machine_function): New flag + decomposed_literal_pool_addresses_ok_p. + (s390_reorg): Set it before final stage of literal pool transforms. + (s390_decompose_address): Only accept displacements of the form + (minus (label_ref ...) (label_ref ...)) if that flag is set. + +2006-01-30 Carlos O'Donell + + * optabs.c (prepare_cmp_insn): If unbaised and unsigned then bias + the comparison routine return. + +2006-01-30 Michael Matz + + * global.c (find_reg): Only evict for global regs. + Take n_refs into account and dump more info. + +2006-01-30 J"orn Rennecke + + PR target/14798: + * sh.c (pragma_interrupt, trap_exit, sp_switch): Remove variable. + (pragma_trap, pragma_nosave_low_regs): Likewise. + (current_function_anonymous_args): Likewise. + (sh_deferred_function_attributes): New variable. + (sh_deferred_function_attributes_tail): Likewise. + (print_operand): For '@', look up trap_exit attribute. + (calc_live_regs): Look up trapa_handler attribute. For trapa + handlers, save/restore fpscr, but don't do any other + interrupt-specific saves. + Don't save r0..r7 if the nosave_low_regs attribute is in effect. + Fix check for partially saved registers to check for SHmedia. + (sh_expand_prologue, sh_expand_epilogue): Look up sp_switch attribute. + (sh_output_function_epilogue): Don't clear any of the removed + variables. + (sh_insert_attributes): Don't check pragma_interrupt. + Insert deferred attributes. Check that interrupt attribute is + present for other attributes that require its presence. + (sh_attribute_table): Add new attributes trapa_handler and + nosave_low_regs. + (sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): + Don't check for pragma_interrupt. Don't store argument. + * sh.h (pragma_interrupt, sp_switch): Don't declare. + (sh_deferred_function_attributes): Declare. + (sh_deferred_function_attributes_tail): Likewise. + * sh.md (sp_switch_1): Add operand. Change generator caller. + (sh_pr_interrupt, sh_pr_trapa, sh_pr_nosave_low_regs): Remove. + (*return_i): Don't use when trap_exit attribute is in effect. + (*return_trapa): New insn pattern. + * sh-c.c: New file. + * config.gcc (sh[123456ble]*-* | sh-*-*): New trailer stanza, + setting c_target_objs and cxx_target_objs. + * t-sh: Add rule for sh-c.o. + +2006-01-30 Richard Guenther + + PR c++/23372 + * gimplify.c (gimplify_target_expr): Handle easy cases + without creating a temporary. + +2006-01-30 Nathan Sidwell + + * vec.h (safe_grow): Remove duplicated line. + +2006-01-29 Diego Novillo + + PR 25874 + * omp-low.c (execute_expand_omp): Move CFG cleanup code ... + (expand_omp): ... here. + (expand_omp_parallel): Only remove barriers for combined + parallel+workshare constructs. + +2006-01-29 Eric Botcazou + + Revert + + 2005-11-09 Eric Botcazou + * tree.c (build_qualified_type): Chain the new type to the original + type's TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO linked lists if it is + a POINTER_TYPE or a REFERENCE_TYPE respectively. + (build_pointer_type_for_mode): Only return unqualified types. + (build_reference_type_for_mode): Likewise. + +2006-01-29 Gabriel Dos Reis + + * configure.ac (cxx_compat_warn): Set if -Wc++-compat is supported. + * Makefile.in (CXX_COMPAT_WARN): Define. + * configure: Regenerate. + +2006-01-29 Dorit Nuzman + + PR tree-opt/25911 + * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Change assert + to an if check. + +2006-01-29 Gabriel Dos Reis + + * toplev.c: Fix thinko. + +2006-01-29 Gabriel Dos Reis + Marcin Dalecki + + * toplev.c (floor_log2, exact_log2): Don't define if __cplusplus. + (push_srcloc): Use XNEW. + (init_asm_output, default_get_pch_validity): Use XNEWVEC. + +2006-01-29 Kenneth Zadeck + + * df-core.c (df_set_blocks): Deleted all variable. + +2006-01-28 Ian Lance Taylor + + * cgraphunit.c (cgraph_assemble_pending_functions): Call + cgraph_output_pending_asms. + +2006-01-28 Zack Weinberg + + * c.opt: Add -W(no-)overlength-strings. + * doc/invoke.texi: Document it. + * c-opts.c (c_common_handle_option): -pedantic implies + -Woverlength-strings, if not explicitly disabled already. + (c_common_post_options): -Woverlength-strings defaults to off, and + is always off for C++. + * c-common.c (fix_string_type): Issue warning about strings longer + than is portable only if warn_overlength_strings. Rearrange code + a little for clarity. + * configure.in: Check for -Wno-overlength-strings as well before + enabling -pedantic in stage 1. + * Makefile.in (STRICT2_WARN): Add -Wno-overlength-strings. + (gcc.o-warn, insn-automata.o-warn, build/gencondmd.o-warn): Delete. + + * genconditions.c (write_header, write_one_condition) + (write_conditions, write_writer): Consolidate very long strings + that were broken up to fit in C89 portable limit. Don't use + printf when fputs will do. + +2006-01-28 Adam Nemet + + * combine.c (simplify_comparison ): Check + TRULY_NOOP_TRUNCATION before start using a subreg. + + * config/mips/mips.md (*branch_zero, + *branch_zero_inverted, *branch_equality, + *branch_equality_inverted, *branch_equality_mips16): + Remove mode check from comparisons. + +2006-01-28 Kenneth Zadeck + + * config/mips/mips-protos.h (mips_set_live_on_entry): Deleted. + +2006-01-28 Kazu Hirata + + * expmed.c (const_mult_add_overflow_p): Remove. + * expr.h: Remove the prototype for const_mult_add_overflow_p. + + * recog.c (validate_replace_rtx_subexp): Remove. + * recog.h: Remove the prototype for + validate_replace_rtx_subexp. + + * integrate.h: Remove the prototype for + copy_decl_for_inlining. + * rtl.h: Remove the prototype for mark_constant_function. + * tree-vectorizer.h: Remove the prototype for + vect_strip_conversion. + + * modulo-sched.c (create_partial_schedule, + free_partial_schedule, reset_partial_schedule): Make them + static. + + * hooks.c (hook_bool_rtx_int_false): Remove. + * hooks.h: Remove the prototype for hook_bool_rtx_int_false. + +2006-01-28 David Edelsohn + + * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): -msoft-float + and -mlong-double-128 are incompatible. + * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Same. + * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): Add ppc64-fp.c. + (TARGET_LIBGCC2_CFLAGS): Define. + * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): Same. + (TARGET_LIBGCC2_CFLAGS): Same. + * config/rs6000/ppc64-fp.c: Compile for 64-bit AIX. + +2006-01-28 Kazu Hirata + + PR c/19606. + * c-typeck.c (build_binary_op): Perform implicit casts of + operands before shortening them. + + * cfgloopmanip.c (split_loop_bb): Remove. + * cfgloop.h: Remove the prototype for split_loop_bb. + + * cfgloop.c (flow_loop_outside_edge_p): Remove. + * cfgloop.h: Remove the prototype for + flow_loop_outside_edge_p. + + * emit-rtl.c (init_virtual_regs): Make it static. + * function.h: Remove the prototype for init_virtual_regs. + + * recog.c (peephole2_optimize): Make it static. + * recog.h: Remove the prototype for peephole2_optimize. + +2006-01-27 H.J. Lu + + * df-scan.c (df_record_entry_block_defs): Check if + INCOMING_RETURN_ADDR_RTX is defined. + +2006-01-27 Daniel Berlin + Kenneth Zadeck + + PR rtl-optimization/24762 + * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. + * targhooks.c (hook_void_bitmap): New hook prototype. + * targhoohs.h (hook_void_bitmap): Ditto. + * bitmap.h (bitmap_head_def): Moved to coretypes.h. + * coretypes.h (bitmap_head_def): Moved from bitmap.h. + * target.h (live_on_entry): New function pointer. + * df-scan.c (df_all_hard_regs): Removed. + (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. + (df_scan_free_internal): Added df->entry_block_defs. + (df_scan_alloc): Ditto. + (df_scan_dump): Ditto. + (df_uses_record): Plumbed flag field properly thru calls. + Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. + This part fixes PR24762. + (df_bb_refs_record): Added code to make the frame and arg + pointers live in EH blocks. + (df_refs_record): Added call to df_record_entry_block_defs. + (df_record_entry_block_defs): New function. + * df-core.c: Added comments to describe new artifical defs. + * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. + (entry_block_defs): New field in struct df. + (df_all_hard_regs): Deleted. + * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. + * df-problems.c (df_ru_bb_local_compute_process_def): + Added code to handle artifical defs in the entry to a function. + (df_ru_bb_local_compute): Ditto. + (df_rd_bb_local_compute_process_def): Ditto. + (df_rd_bb_local_compute): Ditto. + (df_lr_bb_local_compute): Ditto. + (df_ur_bb_local_compute): Ditto. + (df_urec_bb_local_compute): Ditto. + (df_chain_create_bb): Ditto. + (df_ur_local_finalize): Removed entry. + (df_urec_init): Ditto. + (df_urec_local_finalize): Ditto. + (df_ri_bb_compute): Added detection of last use of pseudos. + * Makefile.in (df-scan.o): Updated dependencies. + * config/mips/mips-protos.h (mips_set_live_on_entry): Added. + * config/mips/mips.c (mips_set_live_on_entry): Added. + * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value + for target hook. + * dce.c (marked_insn_p): Added code to handle artifical defs. + +2006-01-27 H.J. Lu + + * config/i386/emmintrin.h (_mm_cvtsd_f64): Add missing Intel + intrinsic. + (_mm_cvtsi128_si64): Likewise. + (_mm_cvtsd_si64): Likewise. + (_mm_cvttsd_si64): Likewise. + (_mm_cvtsi64_sd): Likewise. + (_mm_cvtsi64_si128): Likewise. + * config/i386/mmintrin.h (_m_from_int64): Likewise. + (_mm_cvtsi64_m64): Likewise. + (_m_to_int64): Likewise. + (_mm_cvtm64_si64): Likewise. + * config/i386/xmmintrin.h (_mm_cvtss_si64): Likewise. + (_mm_cvttss_si64): Likewise. + (_mm_cvtsi64_ss): Likewise. + (_mm_cvtss_f32): Likewise. + +2006-01-27 Carlos O'Donell + + * c-pragma.c (init_pragma) : Call c_register_pragma_with_expansion + for pragma redefine_extname. + +2006-01-27 Jakub Jelinek + + PR target/25864 + * libgcc-std.ver: Add GCC_4.1.0 symbol version. + * config/rs6000/t-linux64 (TARGET_LIBGCC2_CFLAGS): Only append + -mno-minimal-toc to previous content. + (bispecs): Remove goal. + * config/rs6000/ppc64-fp.c: Define TMODES before including fp-bit.h. + * config/rs6000/darwin-ldouble.c: Don't provide _xlq*@GCC_3.4 + compatibility aliases on powerpc-*-*gnu*. + * config/rs6000/libgcc-ppc-glibc.ver: New file. + * config/rs6000/t-ppccomm (SHLIB_MAPFILES): Append + libgcc-ppc-glibc.ver on powerpc*-*-*gnu*. + (TARGET_LIBGCC2_CFLAGS): Append -specs=ldblspecs. + (ldblspecs): New goal. + * config/rs6000/t-linux64 (SHLIB_MAPFILES): Removed. + * mklibgcc.in: If $TPBIT is empty, don't compile _sf_to_tf and + _df_to_tf. + * config/fp-bit.h (TMODES): Don't define if none of TFLOAT, + L_sf_to_tf or L_df_to_tf is defined. + +2006-01-27 David Edelsohn + Alan Modra + + PR target/25864 + * config/rs6000/linux.h (POWERPC_LINUX): Define. + * config/rs6000/linux64.h (POWERPC_LINUX): Define. + * config/rs6000/darwin-ldouble.c: Build on 32-bit PowerPC. + * config/rs6000/darwin.h (TARGET_IEEEQUAD): Define to zero. + * config/rs6000/aix.h (TARGET_IEEEQUAD): Define to zero. + * config/rs6000/rs6000.c (rs6000_ieeequad): New variable. + (rs6000_override_options): Initialize rs6000_ieeequad. + Initialize TFmode format to ibm_extended_format if not + TARGET_IEEEQUAD. + (rs6000_handle_option): Accept -mabi= ibmlongdouble and + ieeelongdouble. + (rs6000_emit_move): Move !TARGET_IEEEQUAD as two parts. + (rs6000_return_in_memory): Only return IEEEQUAD in memory. + (function_arg_advance): IBM long double passed in two FPRs, not + split. + (function_arg): IBM long double passed in FPRs. + (rs6000_pass_by_reference): Only IEEEQUAD passed by reference. + (rs6000_gimplify_va_arg): IBM long double passed in two FPRs. + Only multireg GPR aligned. + (rs6000_init_libfuncs): Enable IBM long double functions if not + IEEEQUAD. + (rs6000_generate_compare): Use IBM long double compare if not + TARGET_IEEEQUAD. + * config/rs6000/rs6000.h (rs6000_ieeequad): Declare. + (TARGET_IEEEQUAD): Define. + (CANNOT_CHANGE_MODE_CLASS): Any mode larger than doubleword if + not TARGET_IEEEQUAD. + * config/rs6000/rs6000.md: Enable TFmode patterns if + !TARGET_IEEEQUAD. + * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA): Add darwin-ldouble.c. + * config/rs6000/svr4.h (SUBTARGET_OVERRIDE_OPTIONS): -msoft-float + and -mlong-double-128 are incompatible. + * doc/invoke.texi (-mabi): Collect options together. Add + ibmlongdouble and ieeelongdouble. + +2006-01-27 Richard Sandiford + + * doc/rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new + opaque type. + * optabs.c (init_one_libfunc): Use SET_SYMBOL_REF_DECL. + * varasm.c (make_decl_rtl, build_constant_desc): Likewise. + (force_const_mem): Use SET_SYMBOL_REF_CONSTANT. + * rtl.h (rtunion_def): Remove rt_ptr. + (X0PTR): Delete. + (SYMBOL_REF_DATA): Use X0ANY instead of X0PTR. + (SET_SYMBOL_REF_DECL, SET_SYMBOL_REF_CONSTANT): New macros. + * config/i386/winnt.c (i386_pe_mark_dllexport) + (i386_pe_mark_dllimport): Use SET_SYMBOL_REF_DECL. + +2006-01-27 Gabor Loki + + * cfgcleanup.c (try_crossjump_to_edge): Fix comment typo. + +2006-01-26 Alexandre Oliva + + PR other/24829 + PR target/24831 + * gthr-dce.h: Do not gthrw-ify pthread_once_init, + pthread_key_delete. From John David Anglin. gthrw-ify + pthread_getunique_np only if it it's not a macro. Delete + UNUSED macro. + (__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate, + __gthread_objc_condition_wait, __gthread_objc_condition_broadcast, + __gthread_objc_condition_signal, __gthread_key_delete): Add + "__attribute__ ((__unused__))" to unused arguments. + (__gthread_recursive_mutex_init_function): Add missing return. + * gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h, + gthr-posix95.h: Use macro-based approach for name redirection + on targets missing weakref. + +2006-01-26 Zack Weinberg + + * genconditions.c (write_header): In generated code, #ifdef out + all includes and fake declarations, except includes of bconfig.h + and system.h, unless GCC_VERSION >= 3001. Do not include + gensupport.h in any case. + (write_conditions): Generate a definition of struct c_test. Add + a comment to the generated #endif. + (write_one_condition): Escape backslashes in string too. + (write_writer): Generated code must escape backslashes and quote + marks (but not newlines) in the strings it writes. + * Makefile.in (build/gencondmd.o): Update dependencies. + +2006-01-26 Steve Ellcey + + PR target/25961 + * Makefile.in (insn-automata.o): Add header file dependencies. + * genautomata.c: Add includes. + +2006-01-26 Steve Ellcey + + PR target/25961 + * Makefile.in (insn-automata.o): Add -Wno-error flag. + +2006-01-26 Paolo Bonzini + + * configure.ac: Expect target tools paths to be passed from the toplevel + and wrap the detection into AS_SET_VAR_IF. Extract side-effects out of + AS_SET_VAR_IF. + * acinclude.m4 (gcc_AC_TOOL_DIRS, gcc_AC_CHECK_TOOL): Remove. + +2006-01-26 Alexandre Oliva + + PR c/25892 + * c.opt (Wpointer-sign): Init to -1. + * c-opts.c (c_common_handle_option): Set to 1 on OPT_Wall and + OPT_pedantic, to 0 otherwise. + * doc/invoke.texi: Update. + +2006-01-26 Paolo Bonzini + + * config/i386/i386.md (extendsfdf2, extendsfxf2, extenddfxf2): Emit + constants provided by 80387 instructions in the destination mode. + +2006-01-26 Richard Guenther + Andrew Pinski + + PR tree-opt/21470 + partial PR tree-opt/17064 + * tree-ssa-structalias.c (intra_create_variable_infos): + Create heap variables for incoming parameters if + flag_argument_noalias > 1. + (find_what_p_points_to): Look through default defs of + parameter decls. + +2006-01-26 Jeff Law + + PR ada/25900 + * tree-vrp.c (extract_range_from_assert): When merging a VR_RANGE + with a VR_ANTI_RANGE and the VR_ANTI_RANGE is completely contained + within the VR_RANGE, use the VR_RANGE as the result, not the + VR_ANTI_RANGE. + (adjust_range_with_scev): Reject ranges from SCEV which are out of + bounds for the type. + +2006-01-26 Daniel Berlin + + * tree-ssa-alias.c (maybe_create_global_var): Change + subvar walking to an assertion that we don't have subvar'd variables. + +2006-01-26 Andrew Pinski + + PR C/25861 + * c-common.c (c_common_truthvalue_conversion) : + Use a new variable, inner. PARM_DECLs are always non-weak. + +2006-01-26 Shantonu Sen + + * tree.h (OMP_CLAUSE_SUBCODE_CHECK): Add definition for + --disable-checking. + +2006-01-26 Adam Nemet + + * config/mips/mips.md (*clear_upper32): New combiner pattern. + +2006-01-26 Richard Earnshaw + + * arm.md (smaxsi3, sminsi3): Convert to define_expand. + (smax_insn, smin_insn, smax_0, smin_0): New. + +2006-01-26 Hans-Peter Nilsson + + PR target/25947 + * config/cris/cris.c (cris_order_for_addsi3): New function. + * config/cris/cris-protos.h: Prototype it. + * config/cris/cris.md (split for "move.S1 [rx=rx+i],ry") + (split for "move.S1 ry,[rx=rx+i]", split for "clear.[bwd] [rx=rx+i]") + (split for "mov(s|u).S1 [rx=rx+i],ry", split for "op.S1 [rx=rx+i],ry") + (split for "op.S1 [rx=rx+i],ry (swapped)") + (split for "op(s|u).S1 [rx=rx+i],ry") + (split for "op(s|u).S1 [rx=rx+i],ry (swapped, plus or bound)"): + Apply cris_order_for_addsi3 when generating addsi3 insns. + +2006-01-25 Diego Novillo + + * tree.h (TREE_RANGE_CHECK): Fix range predicate. + (TREE_BLOCK): Add call to EXPR_CHECK. + +2006-01-25 Diego Novillo + + PR 25886 + * tree-dump.c (dequeue_and_dump): Handle OMP_CLAUSE. + * tree-pretty-print.c (dump_omp_clause): Extract from ... + (dump_omp_clauses): ... here. + (dump_generic_node): Handle OMP_CLAUSE. + * tree.c (omp_clause_num_ops): New. + (omp_clause_code_name): New. + (tree_code_size): Handle OMP_CLAUSE. + (tree_size): Likewise. + (make_node): Document handling of OMP_CLAUSE. + (tree_node_structure): Handle OMP_CLAUSE. + (omp_clause_check_failed): New. + (omp_clause_range_check_failed): New. + (omp_clause_operand_check_failed): New. + (build_omp_clause): New. + (walk_tree): Adjust handling of OMP_CLAUSE_* nodes. + * tree.h (enum omp_clause_code): Declare. + (OMP_CLAUSE_SUBCODE_CHECK): Define. + (OMP_CLAUSE_RANGE_CHECK): Define. + (OMP_CLAUSE_ELT_CHECK): Define. + (omp_clause_check_failed): Declare. + (omp_clause_operand_check_failed): Declare. + (omp_clause_range_check_failed): Declare. + (OMP_CLAUSE_CHAIN): Do not use TREE_RANGE_CHECK. + (OMP_CLAUSE_OPERAND): Use OMP_CLAUSE_RANGE_CHECK. + (OMP_CLAUSE_PRIVATE_DEBUG): Use OMP_CLAUSE_SUBCODE_CHECK. + (OMP_CLAUSE_LASTPRIVATE): Likewise. + (OMP_CLAUSE_IF_EXPR): Likewise. + (OMP_CLAUSE_NUM_THREADS_EXPR): Likewise. + (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR): Likewise. + (OMP_CLAUSE_REDUCTION_CODE): Likewise. + (OMP_CLAUSE_REDUCTION_INIT): Likewise. + (OMP_CLAUSE_REDUCTION_MERGE): Likewise. + (OMP_CLAUSE_REDUCTION_PLACEHOLDER): Likewise. + Use tree_node.omp_clause.subcode instead of TREE_COMPLEXITY. + (OMP_CLAUSE_SCHEDULE_KIND): Likewise. + (OMP_CLAUSE_DEFAULT_KIND): Likewise. + (OMP_CLAUSE_CODE): Define. + (OMP_CLAUSE_SET_CODE): Define. + (OMP_CLAUSE_CODE): Define. + (OMP_CLAUSE_OPERAND): Define. + (struct tree_omp_clause): Declare. + (union tree_node): Add field 'omp_clause'. + * treestruct.def (TS_OMP_CLAUSE): Define. + * tree.def (OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED + OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, + OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, + OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, + OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, + OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Remove. + (OMP_CLAUSE): Define. + * print-tree.c (print_node): Handle OMP_CLAUSE. + * omp-low.c: Adapt all uses of OMP_CLAUSE_* nodes. + * c-typeck.c: Likewise. + * gimplify.c: Likewise. + * c-omp.c: Likewise. + * tree-nested.c: Likewise. + * tree-inline.c: Likewise. + * c-parser.c: Likewise. + * gimple-low.c (lower_omp_directive): Do not set TREE_BLOCK on + clauses. + +2006-01-25 Roger Sayle + + PR rtl-optimization/25703 + * combine.c (try_combine): Handle zero_extract and strict_low_part + of non-lowpart SUBREGs for constant reg_subword_p set optimization. + +2006-01-25 Peter Bergner + + * global.c: Fix comment typos. + +2006-01-25 Andrew Pinski + + PR target/25758 + * config/i386/i386.c (output_pic_addr_const) : + Use output_addr_const instead of assemble_name. + +2006-01-25 Paolo Bonzini + + * Makefile.in (sched-vis.o): Update dependencies. + * haifa-sched.c (sched_finish): Clear current_sched_info. + * cfg.c (dump_bb_info): New, split from dump_flow_info. + (dump_flow_info): Call it. + * passes.c (execute_todo): Call print_rtl_slim_with_bb to make + a slim RTL dump. + * basic-block.h (dump_bb_info): Declare. + * tree-dump.c (dump_enable_all): OR the flags of a -fdump-tree-all + option, and apply options only for dump files whose TDF_RTL, + TDF_TREE, or TDF_IPA bits match. + * rtl.h: Declare new functions exported from sched-vis.c. + * sched-vis.c: Enable also if scheduling is not used. + (print_value): Print the mode of registers if not inside scheduling. + (print_insn): Make it work outside the scheduler. Beautify the output + a bit. + (dump_insn_slim, debug_insn_slim, print_rtl_slim_with_bb): New. + +2006-01-25 Richard Sandiford + + * doc/rtl.texi (SYMBOL_REF_CONSTANT, SYMBOL_REF_DATA): Document. + * gengtype.c (adjust_field_rtx_def): Garbage-collect field 2 of + a SYMBOL_REF as either a tree or a constant_descriptor_rtx, + depending on the value of CONSTANT_POOL_ADDRESS_P. + * optabs.c (init_one_libfunc): Nullify SYMBOL_REF_DATA rather than + SYMBOL_REF_DECL. + * varasm.c (make_decl_rtl, build_constant_desc): Set SYMBOL_REF_DATA + rather than SYMBOL_REF_DECL. + (rtx_constant_pool): Remove const_rtx_sym_htab. + (const_desc_rtx_sym_hash, const_desc_rtx_sym_eq): Delete. + (init_varasm_status): Don't initialize const_rtx_sym_htab. + (force_const_mem): Point SYMBOL_REF_DATA to the constant pool entry. + Remove handling of const_rtx_sym_htab. + (find_pool_constant): Delete. + (get_pool_constant, get_pool_constant_mark): Use SYMBOL_REF_CONSTANT + rather than find_pool_constant. + (get_pool_constant_for_function): Delete. + (get_pool_mode, mark_constant): Use SYMBOL_REF_CONSTANT rather than + find_pool_constant. + * rtl.h (rtunion_def): Add rt_constant and rt_ptr fields. + (X0CONSTANT, X0PTR, SYMBOL_REF_DATA): New macros. + (SYMBOL_REF_DECL): Return NULL if CONSTANT_POOL_ADDRESS_P. + (SYMBOL_REF_CONSTANT): New macro. + (get_pool_constant_for_function): Delete. + * config/i386/winnt.c (i386_pe_mark_dllexport): Set SYMBOL_REF_DATA + rather than SYMBOL_REF_DECL. + (i386_pe_mark_dllimport): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_move): Copy SYMBOL_REF_DATA + rather than SYMBOL_REF_DECL. + * config/darwin.c (machopic_indirect_data_reference): Likewise. + (machopic_indirect_call_target): Likewise. + +2006-01-25 Eric Botcazou + + * flow.c (delete_noop_moves): Add missing EOL to dump message. + +2006-01-25 Richard Sandiford + + * genattrtab.c (gen_bypass): Allow bypasses to contain whitespace. + +2006-01-25 Kaz Kojima + + * config/sh/predicates.md (sh_register_operand): Accept CONST_DOUBLE. + +2006-01-24 David Daney + + PR java/25816 + * configure.ac (enable_tls): New enable option. + (HAVE_AS_TLS): Don't do assembler check if enable_tls set. + * configure: Regenerate. + * doc/install.texi (--enable-tls): Document new option. + (--disable-tls): Ditto. + +2006-01-24 Richard Henderson + + * alias.h (ALIAS_SET_MEMORY_BARRIER): New. + * alias.c (true_dependence): Respect it. + (canon_true_dependence, write_dependence_p): Likewise. + * builtins.c (get_builtin_sync_mem): Set it. + +2006-01-25 Zdenek Dvorak + + * loop-iv.c (iv_analysis_loop_init): Use df analysis in a more + efficient way. + +2006-01-24 DJ Delorie + + * expmed.c (store_bit_field): Don't arbitrarily deny using insv + for storing constants in single-bit bitfields. + +2006-01-25 Ben Elliston + + * dfp.c (dfp_byte_swap): Use uint32_t and not unsigned long. + +2006-01-24 Andrew Pinski + + PR tree-opt/25860 + * tree-ssa-pre.c (phi_translate): Return NULL + for AGGREGATE_TYPE's. + +2006-01-24 Zack Weinberg + + * genautomata.c (process_state_for_insn_equiv_partition): + Use xcalloc for insn_arcs_array. + * vec.h (DEF_VEC_ALLOC_FUNC_I): New set of templates. + (DEF_VEC_ALLOC_I): Use it, not DEF_VEC_ALLOC_FUNC_P. + +2006-01-24 Richard Henderson + + * genextract.c (VEC_safe_set_locstr): Take VEC by reference; + update all callers. + +2006-01-23 Paolo Bonzini + + PR rtl-optimization/25890 + PR rtl-optimization/25905 + * combine.c (expand_compound_operation, expand_field_assignment): + Fail if the bitfield's final position is out of bounds. + +2006-01-24 Ian Lance Taylor + + PR middle-end/25930 + * cgraphunit.c (cgraph_output_in_order): Don't clear + cgraph_asm_nodes until after asm strings have been output. + +2006-01-23 Adam Nemet + + * fix-header.c (read_scan_file): Add new parameter imultilib when + calling register_include_chains. + +2006-01-23 Diego Novillo + + * omp-low.c: Update documentation. + +2006-01-23 Andrew Pinski + Daniel Berlin + + PR tree-opt/25315 + PR tree-opt/25857 + * tree-ssa-pre.c (insert_extra_phis): If an incomming edge is abnormal + return from the function. + +2006-01-22 Zack Weinberg + + * rtl.def (match_code): Add second argument. + * genpreds.c (write_extract_subexp): New function. + (write_match_code): Add path argument. Use write_extract_subexp. + (write_predicate_expr): Pass path to write_match_code. + (mark_mode_tests): MATCH_CODE applied to a subexpression does + not perform a mode test. + * genrecog.c (compute_predicate_codes): MATCH_CODE applied to + a subexpression does not constrain the top-level code set. + * read-rtl.c (read_rtx_variadic): New function. + (read_rtx_1): Use it; allow AND and IOR to be variadic. + * doc/md.texi: Document new notation. + * config/i386/predicates.md (cmpsi_operand_1): Fold into ... + (cmpsi_operand): ... here, using new notation. + +2006-01-22 Zack Weinberg + + * varray.c: Remove GENERATOR_FILE #ifdefs. + +2006-01-22 Zack Weinberg + + * genautomata.c (output_reserved_units_table): Emit nothing if + description->query_units_num is zero. Remove extra blank line. + (output_cpu_unit_reservation_p): Short circuit + if description->query_units_num is zero. + +2006-01-22 Zack Weinberg + + * genattrtab.c: Don't include genattrtab.h. Define ATTR_NONE + and ATTR_SPECIAL (from genattrtab.h). Don't define num_dfa_decls + nor any of the random handful of variables that used to be necessary + when this program was linked with rtlanal.o. Prune set of forward + function declarations. + (struct attr_desc): Remove static_p field. + (hash_obstack, temp_obstack, attr_hash_table, attr_printf) + (check_attr_test, make_internal_attr, make_numeric_value): Make static. + (attr_string): Do not read the character one past the length of + the string. + (write_attr_get, find_attr, make_internal_attr): Don't touch static_p. + (struct insn_reserv, all_insn_reservs, last_insn_reserv_p) + (n_insn_reservs, gen_insn_reserv, struct bypass_list, all_bypasses) + (n_bypasses, gen_bypass_1, gen_bypass, process_bypasses) + (make_automaton_attrs): New. + (main): Do not call into genautomata. Call local gen_bypass + and gen_insn_reserv as appropriate. Call make_automaton_attrs. + Remove special case for insn_alts. + * genautomata.c: Include gensupport.h; not genattrtab.h nor + varray.h (leftover from previous change). Prune set of forward + function declarations. Remove state_alts fields from all + structures. Remove state_alts_table from struct automaton. + Make everything except main static. Do not maintain num_dfa_decls. + Do not maintain state_alts fields of various structures. + (process_decls): Don't validate condexp for dm_insn_reserv decls. + (add_arc): Remove state_alts argument. All callers updated. + (output_reserved_units_table): Emit #ifdef here... + (output_tables): ...not here. Don't generate state_alts tables. + (expand_automata): Don't generate attributes. + (write_automata): Don't generate state_alts functions. + (main): New function. + (it_is_empty_reserv_sets, output_state_alts_full_vect_name) + (output_state_alts_comb_vect_name, output_state_alts_check_vect_name) + (AUTOMATON_STATE_ALTS_MACRO_NAME, INTERNAL_STATE_ALTS_FUNC_NAME) + (STATE_ALTS_FUNC_NAME, INSN_DEFAULT_LATENCY_FUNC_NAME) + (BYPASS_P_FUNC_NAME, output_state_alts_table) + (output_automata_list_state_alts_code, output_internal_state_alts_func) + (output_state_alts_func, make_insn_alts_attr, make_bypass_attr) + (make_internal_dfa_insn_code_attr, make_default_insn_latency_attr): + Delete. + * genattr.c: Declare internal_dfa_insn_code in insn-attr.h. + * genattrtab.h: Delete file. + * Makefile.in (OBJS-common): Add insn-automata.o. + (insn-automata.o): New rule. + (simple_generated_c): Add insn-automata.c. + (build/genattrtab.o, build/genautomata.o): Update dependencies. + (genprogmd): Add automata. + (build/genattrtab): Needs no extra objects nor libraries. + (build/genautomata): Needs build/vec.o and -lm. + +2006-01-22 Zack Weinberg + + * genautomata.c (process_state_longest_path, max_dfa_issue_rate) + (output_dfa_max_issue_rate, locked_states_num): Delete. + (struct automaton): Add locked_states field. + (output_dead_lock_vect): Save number of locked states in + automaton->locked_states. If it is zero, don't print anything. + (output_max_insn_queue_index_def): Define max_insn_queue_index const. + (output_internal_dead_lock_func): Only test the dead_lock_vect + for automata that have locked states. + (output_statistics): Always print the number of locked states for + each automaton. Calculate total number of locked states here. + (write_automata): Don't call output_dfa_max_issue_rate. + * genattrtab.c: Define length_unit_log as a const variable. + * genattr.c: Don't emit MAX_DFA_ISSUE_RATE. Declare + max_insn_queue_index const. + * final.c (length_unit_log): Declare const. + * doc/tm.texi: Remove all references to MAX_DFA_ISSUE_RATE. + +2006-01-22 Zack Weinberg + + * genautomata.c: Include vec.h, not varray.h. + Delete vla_ptr_t, all of the VLA_PTR_ macros, and all of the + VLA_HWINT_ macros. Change vla_hwint_t to a typedef for + VEC(vect_el_t,heap) *. Convert all uses of VLA_* macros to + VEC_* macros operating on appropriately typed vectors, or to + malloced arrays when the size is known in advance. Const-ify + many char* variables and function arguments. No functional changes. + * Makefile.in (build/varray.o): Delete rule. + (build/genattrtab): Depend on build/vec.o instead of build/varray.o. + (build/genautomata.o): Depend on vec.h instead of $(VARRAY_H). + +2006-01-22 Zack Weinberg + + * gensupport.c: Define get_insn_name and record_insn_name here. + (read_md_rtx): Call record_insn_name as appropriate. + * genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c + * genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c + * genpreds.c, genrecog.c: Don't define get_insn_name nor + record_insn_name. + * Makefile.in (BUILD_SUPPORT, BUILD_PRINT): Fold into BUILD_RTL. + (BUILD_VARRAY): Delete. + (genprognormal): Rename genprogmd. Fold in all programs from + genprognoprint; also attrtab. + (build/genattrtab): Just mention genautomata.o and varray.o. + Reorganize a bit, add comments to make the categories clearer. + +2006-01-22 Zack Weinberg + + * genconditions.c (condition_table, add_condition): Delete. + (write_conditions): Don't emit n_insn_conditions nor + insn_elision_unavailable. Issue the gcc version #ifdef here, + inside the table, with no #else clause ... + (write_header): ...not here. + (write_writer): New function. + (main): Don't initialize condition_table. Use add_c_test. + Call write_writer. + * gensupport.c (init_md_reader_args_cb): Handle multiple input + files on the command line. + (maybe_eval_c_test): Don't check insn_elision_unavailable. + Return -1 if there is no entry in the table, don't abort. + (add_c_test, traverse_c_tests): New functions. + * gensupport.h (insn_elision_unavailable, insn_conditions) + (n_insn_conditions): Delete declarations. + (add_c_test, traverse_c_tests): Declare. + * read-rtl.c: Include gensupport.h. + (read_conditions): New function. + (read_rtx): If read_rtx_1 returns 0, treat as EOF. + (read_rtx_1): If we get EOF when we were looking for an initial + open paren, return 0. Call read_conditions when appropriate. + * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to + dummy-conditions.o. Eliminate references to insn-conditions.o, + or change them to build/gencondmd.o, as appropriate. Remove + insn-constants.h from $(simple_generated_h) and insn-conditions.c + from $(simple_generated_c). For all files remaining in those + two lists, add insn-conditions.md to the generator command line. + Give insn-constants.h/s-constants their own rules. Add rules + for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. + (build/read-rtl.o): Depend on gensupport.h. + (genprognormal): Include preds. + (genprogearly): Rename genprognoprint; only difference is now that + they don't link with $(BUILD_PRINT). + * dummy-conditions.c: Delete. + +2006-01-22 Zack Weinberg + + * genextract.c: Don't include insn-config.h. Do include vec.h. + Declare vectors of int, char, and locstr. + (locstr): New typedef. + (struct extraction): Make all array fields into bare pointers. + (insn_name_ptr, insn_name_ptr_size): Move down by get_insn_name. + (insn_code_number): Delete. + (accum_extract): New struct. + (VEC_safe_set_locstr, VEC_char_to_string): New functions. + (gen_insn): Take insn_code_number as an argument. Use an + accum_extract structure instead of loading data directly into + a struct extraction, and having to know how big it might get. + (walk_rtx): Operate entirely on an accum_extract structure. + (print_path): Avoid unnecessary use of printf. + (print_header): New function, split out of main. Distinguish + more carefully between an unrecognizable insn and an insn that + has the code number of a define_expand. + (main): Pass insn_code_number to gen_insn. Call print_header + only after parsing. Avoid unnecessary use of printf. + * Makefile.in (build/vec.o): New rule. + (build/genextract): Depend on build/vec.o. + (build/genextract.o): Don't depend on insn-config.h. + +2006-01-22 Zack Weinberg + + * Makefile.in: Consolidate most rules that use $(CC_FOR_BUILD) and/or + $(RUN_GEN). Use pattern rules to factor out as much boilerplate as + practical. Eliminate per-generator-program link rules. + +2006-01-23 Andrew Pinski + + PR middle-end/24437 + * tree-ssa-ccp.c (fold_stmt): Move folding of OBJ_TYPE_REF + with a call expr to ... + * fold-const.c (fold_ternary) : Here. + +2006-01-23 Richard Guenther + + * cfgloopmanip.c (lv_adjust_loop_entry_edge): Add comment + before make_edge with conditional EDGE_TRUE_VALUE. + +2006-01-23 Steven Bosscher + Jan Hubicka + Richard Guenther + + PR rtl-optimization/25654 + * cfgexpand.c (aggregate_contains_union_type): New function. + (add_alias_set_conflicts): Call it. Make sure to add conflicts + for structure variables that contain a union type. + +2006-01-23 Richard Sandiford + + * gengtype.c (new_structure): Return the structure. + (create_option): Add an extra "next" argument. + (create_field): New function. + (adjust_field_rtx_def): Use create_option and create_field. + Remove a now-unnecessary call to find_structure. + (adjust_field_tree_def): Likewise. + (note_yacc_type): Remove an unnecessary call to find_structure. + * gengtype.h (new_structure): Return the structure. + (create_option): Add an extra argument. + * gengtype-yacc.y (type): Remove unnecessary calls to find_structure. + (option): Adjust calls to create_option. + +2006-01-22 David Edelsohn + + * config/rs6000/aix.h (STACK_BOUNDARY): Define. + +2006-01-22 Paul Brook + Peter Barada + + * config/m68k/m68k.md: Add Coldfire FPU support. + Define FP mode macro and associated attributes. + Use it for float mode patterns. + * config/m68k/linux.h (FUNCTION_VALUE): Use m68k_function_value. + (LIBCALL_VALUE): Use m68k_libcall_value. + * config/m68k/m68k-protos.h (m68k_libcall_value): Add prototype. + (m68k_function_value): Ditto. + (emit_move_sequence): Ditto. + * config/m68k/m68kemb.h (LIBCALL_VALUE): Use m68k_libcall_value. + * config/m68k/m68k-none.h (ASM_SPEC): Add mcfv4e. + * config/m68k/t-m68kelf (MULTILIB_OPTIONS): Add mcfv4e. + (MULTILIB_EXCEPTIONS): Ditto. + * config/m68k/m68k.opt: Add mcfv4e. + * config/m68k/m68k.c (m68k_handle_option): Handle OPT_mcfv4e. + (m68k_compute_frame_layout): Include space for ColdFire FPU regs. + (m68k_output_function_prologue): Save ColdFire FPU registers. + (m68k_output_function_epilogue): Restore ColdFire FPU registers. + (force_mode, fp_reg_operand, emit_move_sequence): New functions. + (m68k_regno_mode_ok): Don't allow types larget than 8 bytes in + ColdFire FPU registers. + (m68k_libcall_value, m68k_function_value): New functions. + * config/m68k/netbsd-elf.h (FUNCTION_VALUE): Use m68k_function_value. + (LIBCALL_VALUE): Use m68k_libcall_value. + * config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Define __mcfv4e__. + (MASK_COLDFIRE): Add MASK_CFV4E. + (TARGET_COLDFIRE_FPU, TARGET_HARD_FLOAT, TARGET_FP_REG_SIZE): New. + (MODES_TIEABLE_P): Use TARGET_HARD_FLOAT. + (REG_CLASS_FROM_LETTER, PREFERRED_RELOAD_CLASS): Ditto. + (GO_IF_COLDFIRE_FPU_LEGITIMATE_ADDRESS): Define. + (GO_IF_LEGITIMATE_ADDRESS): Use it. + (LEGITIMIZE_ADDRESS): Handle ColdFire FPU addresses. + * doc/invoke.tex: Document -mcfv4e on m68k. + +2006-01-22 Ranjit Mathew + + * doc/contribute.texi: Change CVS to SVN and update the corresponding + URL. + +2006-01-21 Gabriel Dos Reis + + PR c++/16190 + * c-opts.c (c_common_handle_option): Don't include + -Wnon-virtual-dtor in -Wall; enable if -Weffc++. + * doc/invoke.texi (C++ Dialect Options): Document that + -Wnon-virtual-dtor is no longer included in -Wall. + +2006-01-21 Joseph S. Myers + + * gcov.c (print_version), gcov-dump.c (print_version), + mips-tdump.c (main), mips-tfile.c (main): Update copyright notice + dates. + +2006-01-21 Kenneth Zadeck + + * df-scan.c (problem_SCAN): Added NULL reset function. + (df_scan_reset_blocks): Added code to call reset block function + (df_bb_refs_delete) Fixed comment. + (df_insn_refs_delete): Made tolerant of deleting non existent info + for dataflow problems that need to be reset. + * df-core.c (df_set_blocks): Ditto. + * df.h (struct df_problem): Added reset_fun. + * df-problems.c (problem_RU, problem_RD, problem_LR, problem_UR, + problem_UREC, problem_CHAIN, problem_RI): Initialized reset_fun field. + (df_chain_insn_reset, df_chain_bb_reset, df_chain_reset): New + functions to clear out all references to def-use or use-def chains. + +2006-01-21 Ben Elliston + + * varasm.c (assemble_real): Initialise data array. + +2006-01-20 Paul Brook + + Merge from csl-arm-branch. + 2005-09-21 Kazu Hirata + * config/arm/arm.md (movdi): Force operands[1] to a register + if we have a non-register source. + (*arm_movdi, *movdf_soft_insn): Require that one of the + operands be a register. + * config/arm/iwmmxt.md (*iwmmxt_arm_movdi): Likewise. + * config/arm/vfp.md (*arm_movdi_vfp, *movdf_vfp): Likewise. + +2006-01-20 DJ Delorie + + * varasm.c (initializer_constant_valid_p): Allow pointers + initialized from integer constants of lesser precision. + (output_constant): Allow non-int-sized pointer modes to be + initialized from integer constants. + +2006-01-20 Joseph S. Myers + + PR libstdc++/25524 + * cppdefault.h (struct default_include): Add multilib flag. + * cppdefault.c (cpp_include_defaults): Set it. + * c.opt (-imultilib): New option. + * c-opts.c (imultilib): New. + (c_common_handle_option): Handle -imultilib. + (c_common_post_options): Likewise. + * c-incpath.c (add_standard_paths, register_include_chains): + Likewise. + * c-incpath.h (register_include_chains): Add extra parameter. + * gcc.c (do_spec_1): Generate -imultilib option. + (The Specs Language): Update %I description. + (process_command): Update copyright notice. + * doc/cppopts.texi (-imultilib): Document. + * doc/invoke.texi (-imultilib): Include in option summary. + (%I): Update specs documentation. + +2006-01-20 Zdenek Dvorak + + * loop-iv.c (iv_analysis_loop_init): Use df in more conservative way. + +2006-01-20 Richard Sandiford + + * stmt.c (case_bit_test_cmp): Stabilize the sort using code + label numbers. + +2006-01-20 Richard Guenther + Steven Bosscher + + PR rtl-optimization/24626 + * cfgloopmanip.c (lv_adjust_loop_entry_edge): Don't set + EDGE_TRUE_VALUE if in RTL mode. + + Revert + 2005-03-30 Mostafa Hagog + * cfgrtl.c (rtl_verify_flow_info_1): Fix. + +2006-01-20 Dirk Mueller + + PR c++/5520 + * c-parser.c (c_parser_if_body): Use build_empty_stmt() + instead of a special NOP marker. + * c-typeck.c (c_finish_if_stmt): Remove obsoleted special + NOP marker handling. + * c-common.h (empty_body_warning): Add forward declaration. + * c-common.c (empty_body_warning): Add (from c_finish_if_stmt). + Now uses IS_EMPTY_STMT() instead of special NOP markers. + +2006-01-20 Paul Brook + + * Makefile.in (lang_checks): Keep going if mkdir fails. + +2006-01-19 Kenneth Zadeck + + * df-scan.c (df_scan_free_bb_info): Added basic block parameter to + be able to clean out basic block when not necessary. + (df_scan_free): Fixed to properly delete information if df is + unused before calling df_finish. + (df_scan_alloc, df_rescan_blocks, df_reg_chain_unlink, + df_insn_create_insn_record, df_bb_refs_record): Fixed formatting + or comment typos. + (df_bb_refs_delete): New function. + (df_refs_delete): Moved per block code to df_bb_refs_delete. + * df-core.c (df_set_blocks): Added code to properly clean out + unused blocks if they are not part of the blocks to consider. + Added additional null check. + (df_compact_blocks): Added basic block parameter to free_bb_fun to + be able to clean out basic block when not necessary + * df.h (df_free_bb_function): Ditto. + (df_bb_refs_delete): New function. + * df-problems.c (df_ru_free_bb_info, df_rd_set_bb_info, + df_lr_set_bb_info, df_ur_free_bb_info, df_urec_free_bb_info):Added + basic block parameter to be able to clean out basic block when not + necessary. + (df_ru_alloc, df_rd_alloc): Fixed dyslexic overflow test. + (df_ru_free, df_rd_free, df_lr_free, df_ur_free, df_urec_free): + Fixed to properly delete information if df is unused before + calling df_finish. + +2006-01-19 Kenneth Zadeck + + PR rtl-optimization/25799 + * df-problems.c (df_ru_confluence_n, df_rd_confluence_n): + Corrected confluence operator to remove bits from op2 before oring + with op1 rather than removing bits from op1. + (df_ru_transfer_function): Corrected test on wrong bitmap which + caused infinite loop. Both of these problems were introduced in + the dataflow rewrite. + +2006-01-19 DJ Delorie + + * reload1.c (find_reload_regs): Note the details of reload + failures in the dump file. + (spill_failure): Likewise. + +2006-01-20 Zdenek Dvorak + + * loop-iv.c: Include df.h and hashtab.h. + (enum iv_grd_result): New enum. + (DF_REF_IV, DF_REF_IV_SET): New macros. + (struct biv_entry): New. + (df, bivs): New global variables. + (struct insn_info, insn_info, last_def, bivs, max_insn_no, max_reg_no, + assign_luids, mark_sets, kill_sets, mark_single_set, simple_set_p): + Removed. + (clear_iv_info, latch_dominating_def, record_iv, iv_analyze_expr, + iv_analyze_result, iv_analyze_def, biv_hash, biv_eq, + analyzed_for_bivness_p, record_biv): New functions. + (iv_analysis_loop_init, iv_get_reaching_def, simple_reg_p, + get_biv_step_1, get_biv_step, iv_analyze_biv, iv_analyze_op, + iv_analyze, biv_p, iv_analysis_done): Work with df representation of + UD chains. + (iv_constant, iv_subreg, iv_extend, iv_mult, iv_shift): Do not set + analysed. + (iv_number_of_iterations): Use new interface to iv analysis. + * loop-unroll.c: Do not include varray.h. + (analyze_iv_to_split_insn): Use new interface to iv + analysis. + * loop-unswitch.c (may_unswitch_on): Ditto. + * df.c (df_bitmaps_free): Only work for bbs for that structures are + allocated. + (df_bb_modify): Realloc tables to the new index. + (df_find_use): New function. + * df.h (df_find_use): Declare. + * optabs.c (expand_unop): Make the mode of the REG_EQUAL node be + outmode. + * cfgloop.h (struct rtx_iv): Remove analysed field. + (iv_get_reaching_def): Removed. + (iv_analyze_result, iv_analyze_expr, iv_current_loop_df): Declare. + * Makefile.in (loop-unroll.o): Remove VARRAY_H dependency. + (loop-iv.o): Add df.h and hashtab.h dependency. + * df-problems.c (df_ru_alloc, df_rd_alloc): Fix memory reallocation. + +2006-01-20 Alan Modra + + PR target/25668 + * libgcc2.c (__floatdisf, __floatdidf): Don't use IBM Extended + Double TFmode. + (__floatundisf, __floatundidf): Likewise. + * libgcc2.h (IS_IBM_EXTENDED): Define. + +2006-01-19 DJ Delorie + + * config/m32c/m32c.h (REG_ALLOC_ORDER): Define. + +2006-01-19 Paul Brook + + * config/arm/arm.c (arm_compute_func_type): Treat all functions + as nothrow when unwinding tables are disabled. + +2006-01-19 John David Anglin + + PR testsuite/25171 + * c-decl.c (check_bitfield_type_and_width): Don't issue pedwarn "type + of bit-field" when in system header. + +2006-01-19 DJ Delorie + + * config/m32c/m32c.c (m32c_prepare_shift): Add code to deal with + the 16 bit shift limit of the m16c. + +2006-01-19 Andrew Pinski + + PR target/22099 + * config/i386/i386.md (builtin_setjmp_receiver): Don't emit the label. + * config/i386/i386.c (output_set_got): Output the label if we have one + for the TARGET_DEEP_BRANCH_PREDICTION case. + +2006-01-19 Jan Hubicka + H.J. Lu + Evandro Menezes + + * invoke.texi (generic): Document + (i686) Update. + * config.gcc: Make x86_64-* and i686-* default to generic tunning. + * i386.h (TARGET_GENERIC32, TARGET_GENERIC64, TARGET_GENERIC, + TARGET_USE_INCDEC, TARGET_PAD_RETURNS): New macros. + (x86_use_incdec, x86_pad_returns): New variables + (TARGET_CPU_DEFAULT_generic): New constant + (TARGET_CPU_DEFAULT_NAMES): Add generic. + (enum processor_type): Add generic32 and generic64. + * i386.md (cpu attribute): Add generic32/generic64 + (movhi splitter): Behave sanely when both partial_reg_dependency and + partial_reg_stall are set. + (K8 splitters): Enable for generic as well. + * predicates.md (incdec_operand): Use TARGET_INCDEC + (aligned_operand): Avoid memory mismatch stalls. + * athlon.md: Enable for generic64, new patterns for 128bit moves. + * ppro.md: Enable for generic32 + * i386.c (generic64_cost, generic32_cost): New. + (m_GENERIC32, m_GENERIC64, m_GENERIC): New macros. + (x86_use_leave): Enable for generic64. (x86_use_sahf, + x86_ext_80387_constants): Enable for generic32. (x86_push_memory, + x86_movx, x86_unroll_strlen, x86_deep_branch, x86_use_simode_fiop, + x86_use_cltd, x86_promote_QImode, x86_sub_esp_4, x86_sub_esp_8, + x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_accumulate_outgoing_args, x86_prologue_using_move, + x86_epilogue_using_move, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_four_jump_limit, x86_schedule): + Enable for generic. + (x86_use_incdec, x86_pad_returns): New. + (override_options): Add generic32 and generic64, translate "generic" + to generic32/generic64 and "i686" to "generic32", refuse + "generic32"/"generic64" as arch target. + (ix86_issue_rate, ix86_adjust_cost): Handle generic as athlon. + (ix86_reorg): Honor PAD_RETURNS. + +2006-01-19 Diego Novillo + + * tree-pretty-print.c (dump_generic_node): Handle + OMP_PARALLEL_FN, OMP_PARALLEL_DATA_ARG and OMP_RETURN_EXPR. + * cgraph.c (cgraph_expand_queue): Rename from + cgraph_analyze_queue. Update all users. + * cgraphunit.c (cgraph_assemble_pending_functions): Process + cgraph_expand_queue. + (cgraph_expand_all_functions): Likewise. + (cgraph_finalize_pending_functions): Remove. Update callers. + + * tree.h (OMP_DIRECTIVE_P): Define. + (OMP_PARALLEL_FN): Define. + (OMP_PARALLEL_DATA_ARG): Define. + (OMP_SECTIONS_SECTIONS): Define. + * tree-pass.h (pass_expand_omp): Declare. + * omp-low.c (struct omp_region): Declare. + (struct omp_context): Remove fields 'parallel_type', + 'parallel_start_ix' and 'parallel_start_additional_args'. + Update all users. + (struct omp_for_data): Rename from struct expand_omp_for_data. + (omp_regions): New static variable. + (root_omp_region): New static variable. + (find_omp_clause): Make static. + (is_in_combined_parallel_ctx): Remove. + (is_combined_parallel): New. + (extract_omp_for_data): Move earlier in the file. + (workshare_safe_to_combine_p): New. + (get_ws_args_for): New. + (determine_parallel_type): Move earlier in the file. + (omp_copy_decl_2): Do not set DECL_CONTEXT of new local to the + child function. + (omp_copy_decl): Likewise. + (create_omp_child_function): Likewise. + (lookup_omp_region): New. + (dump_omp_region): New. + (debug_omp_region): New. + (debug_all_omp_regions): New. + (new_omp_region): New. + (scan_omp_parallel): If parallel_nesting_level > 1, the + directive is nested within another parallel directive. + Set OMP_PARALLEL_FN. + (scan_omp_for): Do not try to handle combined parallel+for + cases. + Remove FIXME comment. + (scan_omp_nested): Remove. + (scan_omp_1): Do not call scan_omp_nested when + parallel_nesting_level is > 1. + Do not change the DECL_CONTEXT of local variables found. + (lookup_decl_in_outer_ctx): New. + (lower_rec_input_clauses): Rename from expand_rec_input_clauses. + (lower_lastprivate_clauses): Rename from expand_lastprivate_clauses. + (lower_reduction_clauses): Rename from expand_reduction_clauses. + (lower_copyprivate_clauses): Rename from expand_copyprivate_clauses. + If CTX is nested, lookup VAR in the outer context when + building copy assignment. + (lower_send_clauses): Rename from expand_send_clauses. + If CTX is nested, lookup VAR in the outer context when + building copy assignments. + (lower_send_shared_vars): Rename from expand_send_shared_vars. + If CTX is nested, lookup VAR in the outer context when + building copy assignments. + (expand_parallel_call): Rename from build_parallel_call. + Handle combined parallel+workshare cases. + Re-implement to emit code into the CFG. + (list2chain): New. + (expand_omp_parallel): Re-implement to emit code into the CFG. + Call move_sese_region_to_fn to outline the sub-graph + containing the parallel region. + (expand_omp_for_1): Remove. + (expand_omp_for_generic): Re-implement to emit code into the + CFG. + (expand_omp_for_static_nochunk): Likewise. + (expand_omp_for_static_chunk): Likewise. + (expand_omp_for): Likewise. + (expand_omp_sections): Likewise. + (remove_exit_barriers): New. + (expand_omp_synch): New. + (expand_omp): New. + (build_omp_regions_1): New. + (build_omp_regions): New. + (execute_expand_omp): New. + (gate_expand_omp): New. + (pass_expand_omp): Define. + (lower_omp_sections): Rename from expand_omp_sections. + Set OMP_SECTIONS_SECTIONS. + (lower_omp_single_simple): Rename from expand_omp_single_simple. + (lower_omp_single_copy): Rename from expand_omp_single_copy. + (lower_omp_single): Rename from expand_omp_simple. + (lower_omp_master): Rename from expand_omp_master. + (lower_omp_ordered): Rename from expand_omp_ordered. + (lower_omp_critical): Rename from expand_omp_critical. + (lower_omp_for_lastprivate): Rename from expand_omp_for_lastprivate. + (lower_omp_for): Re-implement. + (lower_omp_parallel): Re-implement. + (lower_regimplify): Rename from expand_regimplify. + (lower_omp_1): Rename from expand_omp_1. + If there are syntax errors in the program, replace every + OpenMP directive with NOP. + Call lower_omp_* instead of expand_omp_*. + (lower_omp): Rename from expand_omp. + + * tree-gimple.c (is_gimple_stmt): Handle OMP_RETURN_EXPR. + * tree-gimple.h (enum omp_parallel_type): Remove. + (gimple_boolify): Declare extern. + (find_omp_clause, determine_parallel_type): Remove. + + * gimple-low.c (lower_omp_directive): New. + (lower_stmt): Call it. + (record_vars_into): Move from ... + (record_vars): ... here. + Call record_vars_into with current_function_decl. + + * gimplify.c (struct gimplify_ctx): Remove fields + combined_pre_p and combined_ctxp. Update users. + (get_formal_tmp_var): Add documentation. + (gimple_boolify): Make extern. + (gimplify_expr_in_ctx): Remove. Update callers. + (gimplify_omp_parallel): Do not assume that OMP_PARALLEL_BODY + will always be a BIND_EXPR. + (gimplify_expr): Handle OMP_RETURN_EXPR. + * tree.def (BLOCK): Remove documentation about BLOCK_TYPE_TAGS. + (OMP_PARALLEL): Add 3 operands. + (OMP_SECTIONS): Add 1 operand. + (OMP_RETURN_EXPR): Define. + + * tree-inline.c (estimate_num_insns_1): Handle OpenMP directives. + (copy_tree_r): Restore TREE_CHAIN in OMP_CLAUSE_*. + * tree-iterator.c (alloc_stmt_list): Assert that we are not + creating a circular free list. + (free_stmt_list): Assert that we are not freeing stmt_list_cache. + + * tree-flow.h (move_sese_region_to_fn): Declare. + (record_vars_into): Declare. + * tree-cfg.c (make_omp_sections_edges): New. + (make_exit_edges): Handle OMP_PARALLEL, OMP_FOR, OMP_SINGLE, + OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_RETURN_EXPR, + OMP_SECTIONS and OMP_SECTION. + (is_ctrl_altering_stmt): Return true for OMP_DIRECTIVE_P. + (set_bb_for_stmt): Undo change to check currently_expanding_to_rtl. + (verify_stmt): Do not handle OMP_DIRECTIVE_P. + (gather_blocks_in_sese_region): New. + (struct move_stmt_d): Declare. + (move_stmt_r): New. + (move_block_to_fn): New. + (move_sese_region_to_fn): New. + + * passes.c (init_optimization_passes): Schedule + pass_expand_omp after pass_init_datastructures. + + * tree-ssa-operands.c (get_expr_operands): Handle + OMP_PARALLEL, OMP_SECTIONS, OMP_FOR, OMP_RETURN_EXPR, + OMP_SINGLE, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL. + +2006-01-19 Jeff Law + + * tree-vrp.c (extract_range_from_assert): Refine the result range + if the variable referenced by the ASSERT_EXPR has a range and + either the tentative result range or the previous range is a + VR_ANTI_RANGE. + +2006-01-19 Richard Sandiford + + * c-decl.c (add_flexible_array_elts_to_size): Simplify vector accesses. + +2006-01-19 Jan Hubicka + + * tree-vect-patterns.c (vect_pattern_recog_1): Prevent parse error. + +2006-01-19 Paolo Bonzini + + * combine.c (try_combine): Do not worry about MEMs wrapped by USEs. + (expand_compound_operation, expand_field_assignment): Fail if the + bit lengths of an extract operation are out of range. + (make_extraction): Compute wanted_inner_mode based on the position + and length of the extraction. Make it extraction_mode for non-constant + positions, and do not modify offset in that case. When generating a + new MEM, use a mode that can hold the extraction while keeping correct + alignment. Remove code that supported MEMs wrapped by USEs. + (simplify_shift_const_1, force_to_mode) : Remove. + +2006-01-19 Andreas Krebbel + + * config/s390/s390.md ("Y", "y"): New mode attribute. + ("*cmpdi_ccs", "*cmpsi_ccs", "*adddi3_imm_cc", "*adddi3_carry1_cc", + "*adddi3_carry1_cconly", "*adddi3_carry2_cc", "*adddi3_carry2_cconly", + "*adddi3_cc", "*adddi3_cconly", "*adddi3_cconly2", "*adddi3_64", + "*addsi3_imm_cc", "*addsi3_carry1_cc", + "*addsi3_carry1_cconly", "*addsi3_carry2_cc", "*addsi3_carr2_cconly", + "*addsi3_cc", "*addsi3_cconly", "*addsi3_cconly2", + "*subdi3_borrow_cc", "*subdi3_borrow_cconly", "*subdi3_cc", + "*subdi3_cc2", "*subdi3_cconly", "*subdi3_cconly2", "*subdi3_64", + "*subsi3_borrow_cc", "*subsi3_borrow_cconly", "*subsi3_cc", + "*subsi3_cc2", "*subsi3_cconly", "*subsi3_cconly", "*subsi3_cconly2", + "addsi3", "subsi3"): Insn patterns removed. + ("*add3_carry1_cc", "*add3_carry1_cconly", + "*add3_carry2_cc", "*add3_carry2_cconly", "*add3_cc", + "*add3_cconly", "*add3_cconly2", "*add3_imm_cc", + "*sub3_borrow_cc", "*sub3_borrow_cconly", + "*sub3_cc", "*sub3_cc2", "*sub3_cconly", + "*sub3_cconly2"): New insn patterns. + ("addsi3", "subsi3"): New expanders. + +2006-01-19 Dorit Nuzman + + * Makefile.in (tree-vect-patterns.o): Add rule for new file. + * tree-vect-analyze.c (vect_determine_vectorization_factor): Use + existing STMT_VINFO_VECTYPE if available. + (vect_mark_relevant): Add special handling for stmts that are + marked as STMT_VINFO_IN_PATTERN_P. + (vect_analyze_loop): Call vect_pattern_recog. + * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. + * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in + stmt_info. + (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. + (vect_recog_func_ptr): New function-pointer type. + * tree-vect-patterns.c: New file. + (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): + (vect_recog_dot_prod_pattern, vect_pattern_recog): + (vect_pattern_recog_1): New functions. + (vect_pattern_recog_funcs): New array of function pointers. + + * tree-vectorizer.h (ternary_op): New enum value. + * tree-vect-transform.c (vect_create_epilog_for_reduction): Added + declaration. Revised documentation. Removed redundant dump prints. + Removed redundant argument. Added support for reduction patterns. + (vectorizable_reduction): Added support for reduction patterns. + (vect_transform_stmt): Added support for patterns. + + * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. + * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. + * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. + (expand_widen_pattern_expr): New function. + (init_optabs): Initialize new optabs udot_prod_optab, + sdot_prod_optab. + * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. + (sdot_prod_optab, udot_prod_optab): Define new optabs. + (expand_widen_pattern_expr): New function declaration. + * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New + tree-codes. + * tree-inline.c (estimate_num_insns_1): Added cases for new + tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. + * tree-pretty-print.c (dump_generic_node): Likewise. + (op_prio): Likewise. + (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. + * tree-ssa-operands.c (get_expr_operands): Added case for + DOT_PROD_EXPR. + * tree-vect-patterns.c (widened_name_p): New function. + (vect_recog_dot_prod_pattern): Added function implementation. + * tree-vect-transform.c (get_initial_def_for_reduction): Added + cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. + * config/rs6000/altivec.md (udot_prod, sdot_prodv8hi): New. + * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. + + * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. + * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. + * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. + (init_optabs): Initialize new optabs widen_ssum_optab, + widen_usum_optab. + * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. + (widen_ssum_optab, widen_usum_optab): Define new optabs. + * tree-vect-generic.c: (expand_vector_operations_1): Check type of + use instead of type of def. + * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added + function implementation. + * config/rs6000/altivec.md (widen_usum, widen_ssumv16qi, + widen_ssumv8hi): New. + + * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New + patterns. + +2006-01-19 Richard Sandiford + + PR c/25805 + * c-decl.c (add_flexible_array_elts_to_size): New function. + (finish_decl): Use it. + +2006-01-18 Andrew Pinski + + * diagnostic.h: Include options.h. + * config/rs6000/x-darwin (host-ppc-darwin.o): Correct the + dependancies for diagnostic.h. + * Makefile.in (DIAGNOSTIC_H): Add options.h. + +2006-01-16 Daniel Berlin + + * tree-ssa-operands.h (ssa_call_clobbered_cache_valid): Remove. + (ssa_ro_call_cache_valid): Ditto. + * tree-ssa-alias.c (sort_tags_by_id): New function. + (init_transitive_clobber_worklist): Ditto. + (add_to_worklist): Ditto. + (mark_aliases_call_clobbered): Ditto. + (compute_tag_properties): Ditto. + (set_initial_properties): Ditto. + (compute_call_clobbered): Ditto. + (compute_may_aliases): Call compute_call_clobbered and grouping. + (compute_flow_sensitive_aliasing): Remove clobbering related code. + (compute_flow_insensitive_aliasing): Grouping now happens in our + caller. + (setup_pointers_and_addressables): Remove clobbering related code. + (add_may_alias): Ditto. + (replace_may_alias): Ditto. + (get_nmt_for): Ditto. + (create_global_var): + (is_escape_site): Return an escape_type enumeration. + * tree-flow-inline.h (is_call_clobbered): Global var does not + imply call clobbered. + (mark_call_clobbered): Take a reason for marking this. Remove + marking of globalness, and cache invalidation. + (clear_call_clobbered): Remove cache invalidation code. + * tree-dfa.c (dump_variable): If details is on, dump the reason + for escaping. + * tree-outof-ssa.c (create_temp): Copy escape mask from original + variable. + * tree-flow.h (struct ptr_info_def): Add escape mask member. + (struct var_ann_d): Ditto. + (enum escape_type): New. + (mark_call_clobbered): Adjust prototype. + * tree-ssa-structalias.c (update_alias_info): Unmodifiable vars + are never call clobbered. + Record reasons for escaping. + * tree-ssa-structalias.h (is_escape_site): Update prototype. + * tree-ssa-operands.c (ssa_call_clobbered_cache_valid): Remove. + (ssa_ro_call_cache_valid): Ditto. + (clobbered_v_may_defs): Ditto. + (clobbered_vuses): Ditto. + (ro_call_vuses): Ditto. + (clobber_stats): New. + (init_ssa_operands): Zero out clobber stats. + (fini_ssa_operands): Print out clobber stats. + (get_call_expr_operands): Pass callee fndecl to + add_call_read_ops). + (add_call_clobber_ops): Remove use of cache. + Add use of PURE_CONST information. + (add_call_read_ops): Remove use of cache. + Add use of static not_read information. + +2006-01-18 Alexandre Oliva + + Introduce TLS descriptors for i386 and x86_64. + * config/i386/i386.h (TARGET_GNU2_TLS): New macro. + (TARGET_ANY_GNU_TLS): New macro. + (enum tls_dialect): Added TLS_DIALECT_GNU2. + (struct machine_function): Add tls_descriptor_call_expanded_p. + (ix86_tls_descriptor_calls_expande_in_cfun): New macro. + (ix86_current_function_calls_tls_descriptor): Likewise. + * config/i386/i386.c (ix86_tls_dialect): Fix typo in comment. + (override_options): Introduce gnu2 tls dialect. + (ix86_frame_pointer_required): Functions containing TLSCALLs are + not leaves. + (ix86_select_alt_pic_regnum, ix86_compute_frame_layout): + Likewise. + (legitimize_tls_address): Adjust logic for GNU2 TLS. + (ix86_init_machine_status): Initialize new field. + (ix86_tls_get_addr): Use TARGET_ANY_GNU_TLS. + (ix86_tls_module_base): New. + * config/i386/i386-protos.h (ix86_tls_module_base): Declare it. + * config/i386/i386.md (UNSPEC_TLSDESC): New constant. + (tls_global_dynamic_32, tls_global_dynamic_64): Handle GNU2 TLS. + (tls_local_dynamic_base_32, tls_local_dynamic_base_64): Likewise. + (tls_dynamic_gnu2_32, *tls_dynamic_lea_32): New patterns. + (*tls_dynamic_call_32, *tls_dynamic_gnu2_combine_32): Likewise. + (tls_dynamic_gnu2_64, *tls_dynamic_lea_64): Likewise. + (*tls_dynamic_call_64, *tls_dynamic_gnu2_combine_64): Likewise. + * config/i386/predicates.md (tls_modbase_operand): New. + (tp_or_register_operand): New. + +2006-01-18 Daniel Berlin + + * ipa-reference.c (check_operand): Allow FUNCTION_DECL. + (look_for_address_of): Ditto. + (ipa_init): Walk the function decls. + (static_execute): Don't set readonly on FUNCTION_DECL's. + +2006-01-18 Roger Sayle + + * config/i386/i386.md (shift spliter): Fix a a typo in the splitter + for shifts where the source and destination registers are different. + +2006-01-18 Paul Brook + + Merge from csl-arm-branch. + 2005-03-14 Julian Brown + * config/arm/lib1funcs.asm (ashldi3): Don't define on SymbianOS. + (aeabi_llsl): Likewise. + (ashrdi3): Likewise. + (aeabi_lasr): Likewise. + (lshrdi3): Likewise. + (aeabi_llsr): Likewise. + 2005-03-10 Julian Brown + * config.gcc: Disable shared libgcc for SymbianOS. + * config/arm/t-symbian (LIB2ADDEH): Include config/arm/pr-support.c. + +2006-01-18 DJ Delorie + + * c-pragma.c (handle_pragma_diagnostic): New. + (init_pragma): Register it. + * doc/extend.texi: Document it. + + * diagnostic.def: Add DK_UNSPECIFIED and DK_IGNORED. + * diagnostic.h (diagnostic_classify_diagnostic): Declare. + (diagnostic_context): Add classify_diagnostic[]. + * diagnostic.c (diagnostic_count_diagnostic): Don't count warnings + as errors if they're overridden to DK_WARNING. + (diagnostic_initialize): Initialize classify_diagnostic[]. + (diagnostic_set_kind_override): New. + (diagnostic_report_diagnostic): Check for kind changes. + * opts.c (common_handle_option): Take lang_mask. Update callers. + Handle OPT_Werror_. + * common.opt (Werror=): New. + * doc/invoke.texi: Document -Werror=* + +2006-01-18 Jeff Law + + * tree-vrp.c (test_for_singularity): Correct test for new + min limit. Use operand_equal_p rather than pointer equality + for testing if new min/max values are equal. + + * tree-ssa-propagate.c (substitute_and_fold): Delay simplifications + using range information until after propagation and folding. + +2006-01-18 Richard Henderson + Aldy Hernandez + Jakub Jelinek + Diego Novillo + + * omp-low.c: New file. + * c-omp.c: New file. + +2006-01-18 Richard Henderson + Jakub Jelinek + Diego Novillo + + * doc/invoke.texi: Document -fopenmp. + * tree-dump.h (debug_function): Declare. + * hooks.c (hook_bool_tree_bool_false): New function. + (hook_tree_tree_null): Remove. + (hook_tree_tree_tree_null): New. + * hooks.h: Update to match. + * tree-pretty-print.c (debug_tree_chain): New. + (print_generic_expr): Handle TDF_CHAIN. + (dump_generic_node): Handle BLOCK. + Do not abort with incomplete SWITCH_EXPRs. + Do not dump body of an OpenMP directive if TDF_SLIM is given. + : Don't + print space after directive name. + : Handle printing OMP_FOR_PRE_BODY. + Handle OMP_MASTER and OMP_ORDERED. + Handle printing of OMP_BODY just in one place, goto + dump_omp_body in the rest of OMP_* nodes that have + OMP_BODY. + Don't handle clause nodes here. Update omp statements to + use dump_omp_clauses. + Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, + OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, + OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, + GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, + GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, + GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. + Adjust output for GOMP_PARALLEL. + (dump_omp_clauses): New. + (print_declaration): Dump DECL_VALUE_EXPR. + (op_symbol_1): Split out of op_symbol. + (dumping_stmts): Remove. Update all users. + * cgraph.c (cgraph_analyze_queue): New. + (cgraph_add_new_function): New. + * cgraph.h (cgraph_analyze_queue): Declare. + (cgraph_add_new_function): Declare. + (cgraph_lower_function): Remove. + * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* + nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS + and TYPE_P nodes in its default clause. + (empty_body_p): New. + (tree_range_check_failed): New. + (build5_stat): New. + * tree.h (OMP_CLAUSE_REDUCTION_INIT, + OMP_CLAUSE_REDUCTION_MERGE, + OMP_CLAUSE_REDUCTION_PLACEHOLDER, + OMP_CLAUSE_PRIVATE_DEBUG, + OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, + OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, + OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, + OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, + OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, + OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, + OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, + OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, + OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, + OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, + OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE + OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, + OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, + OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. + (TREE_RANGE_CHECK): New. + (empty_body_p): Declare. + (enum omp_clause_default_kind): New. + (build_string_literal): Declare. + (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. + (build5_stat, build5): Declare. + * tree-pass.h (TDF_CHAIN): Define. + * tree-pass.h (PROP_gimple_lomp): Define. + (pass_lower_omp): Declare. + * diagnostic.h (debug_tree_chain): Declare. + * builtins.c (get_builtin_sync_mode): Use 0 as last argument to + mode_for_size. + (expand_builtin): Handle sync BUILT_IN_*_16 builtins. + * builtins.c (build_string_literal): Make extern. + * gcc.c (include_spec_function): New. + (static_spec_functions): Add it. + (main): Move load of libgomp.spec ... + (LINK_COMMAND_SPEC): ... here. + (link_gomp_spec): New. + (static_specs): Include it. + (LINK_COMMAND_SPEC): Add link_gomp. + (GOMP_SELF_SPECS): New. + (driver_self_specs): Include it. + (switch_matches): Don't mark inline. + (main): Load libgomp.spec. + * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, + OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, + and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. + * tree-gimple.h (enum omp_parallel): Declare. + (determine_parallel_type): Declare. + (omp_firstprivatize_variable): Declare. + (omp_reduction_init): Declare. + (diagnose_omp_structured_block_errors): Declare. + (struct walk_stmt_info): Add want_return_expr. + (struct walk_stmt_info): Add want_bind_expr, want_locations. + (find_omp_clause): Declare. + (insert_field_into_struct): Declare. + (struct walk_stmt_info): Move from tree-nested.c + (walk_stmts): Declare. + * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP + to 200505. + * cgraphunit.c (cgraph_lower_function): Make static. + (cgraph_finalize_pending_functions): New. + (cgraph_finalize_function): Call it. + (cgraph_finalize_compilation_unit): Likewise. + * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, + BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. + (BT_FN_UINT_UINT): New. + (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, + DEF_FUNCTION_TYPE_VAR_4): Document. + (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, + BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, + BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, + BT_FN_VOID_OMPFN_PTR_UINT_UINT, + BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, + BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, + BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, + BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. + * builtins.def: Update DEF_BUILTIN comment to include COND argument. + Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins + into separate files. + (DEF_GOMP_BUILTIN): New. + (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, + BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, + BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, + BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, + BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, + BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, + BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, + BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, + BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, + BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, + BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, + BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, + BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, + BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, + BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, + BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, + BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, + BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, + BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, + BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, + BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, + BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, + BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, + BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, + BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, + BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. + * sync-builtins.def: New file, moved from builtins.def. + * omp-builtins.def: New file, moved from builtins.def. + * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. + * gimple-low.c (lower_function_body): Clear data. + (lower_stmt): Do not handle COMPOUND_EXPR. + Remove call to print_node_brief. + * c-tree.h (c_finish_omp_clauses): New prototype. + (C_DECL_THREADPRIVATE_P): Define. + (lookup_name_no_remap, c_omp_remap_private): Remove + (c_begin_omp_parallel, c_finish_omp_parallel): Update. + (check_for_loop_decls): Update decl. + (lookup_name_no_remap, c_omp_remap_private): Declare. + (build_indirect_ref, build_modify_expr, pushdecl, + pushdecl_top_level): Move to c-common.h. + * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp + before the switch, but just in the 2 places that need it. + * c-decl.c (diagnose_mismatched_decls): Do not check for + mismatched thread-local attributes when OLDDECL is marked + threadprivate and NEWDECL has no thread-local attributes. + (merge_decls): Merge C_DECL_THREADPRIVATE_P. + (c_gimple_diagnostics_recursively): Rename from + c_warn_unused_result_recursively. Invoke + diagnose_omp_structured_block_errors. + (check_for_loop_decls): Return a singular decl found. + * langhooks.c (lhd_omp_predetermined_sharing): Return + OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. + (lhd_omp_firstprivatize_type_sizes): New. + (lhd_omp_assignment): New. + (lhd_omp_predetermined_sharing): New. + * langhooks.h (struct gimplify_omp_ctx): Forward declare. + (struct lang_hooks_for_types): Add + omp_firstprivatize_type_sizes, omp_privatize_by_reference, + omp_predetermined_sharing, omp_disregard_value_expr, + omp_private_debug_clause, omp_clause_default_ctor, + omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. + (c_finish_omp_clauses): New. + (c_finish_bc_stmt): Diagnose break within omp for. + (c_begin_omp_parallel, c_finish_omp_parallel): New. + (build_unary_op): Return error_mark after reporting + a readonly_error. + (build_modify_expr): Likewise. + * gimplify.c: Include optabs.h and pointer-set.h. + (enum gimplify_omp_var_data): Declare. + (struct gimplify_omp_ctx): Declare. + (struct gimplify_ctx): Add fields prev_context, combined_pre_p + and combined_ctxp. + (gimplify_ctxp, gimplify_omp_ctxp): New local variables. + (push_gimplify_context, pop_gimplify_context): Allow nesting. + (splay_tree_compare_decl_uid): New. + (new_omp_context): New. + (delete_omp_context): New. + (gimple_add_tmp_var): Call omp_add_variable. + (gimplify_bind_expr): Likewise. + (gimplify_var_or_parm_decl): If omp_notice_variable returned + true, disregard DECL_VALUE_EXPR on the decl if any. + (gimplify_expr_in_ctx): New. + (omp_firstprivatize_variable, omp_firstprivatize_type_sizes + omp_add_variable, omp_notice_variable, omp_is_private + gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 + gimplify_adjust_omp_clauses, gimplify_omp_parallel + gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p + gimplify_omp_atomic_fetch_op, goa_stabilize_expr + gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex + gimplify_omp_atomic): New. + (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, + OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, + OMP_CRITICAL and OMP_ATOMIC. + (gimplify_body): Verify gimplify_ctxp is empty after gimplification. + * c-pragma.h (enum pragma_kind): Add + PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, + PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, + PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, + PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, + PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, + PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, + PRAGMA_OMP_THREADPRIVATE. + * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, + OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, + OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, + OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, + OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, + OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, + OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, + OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, + OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. + * print-tree.c (print_node): Dump DECL_VALUE_EXPR. + * tree-ssa-dce.c (find_control_dependence): Do not assume that + ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). + * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for + OpenMP directives. + (struct nesting_info): Add field_map, + suppress_expansion, debug_var_chain. + (create_nesting_tree): Initialize them. + (lookup_field_for_decl): Use field_map. + (get_nonlocal_debug_decl, get_local_debug_decl): New. + (convert_local_omp_clauses): New. + (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. + (walk_body): Split out of walk_function. + (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. + (convert_nonlocal_reference): Handle omp statements. + (convert_local_reference): Likewise. + (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. + (unnest_nesting_tree): New. + (lower_nested_functions): Call it. + (insert_field_into_struct): Make extern. + (struct walk_stmt_info): Move to tree-gimple.h. + (walk_stmts): Make extern. + * omp-builtins.def: New file. + * tree-iterator.c (expr_only): Clarify comment. + * c-common.h (pushdecl_top_level, pushdecl, + build_modify_expr, build_indirect_ref, + c_finish_omp_master, c_finish_omp_critical, + c_finish_omp_ordered, c_finish_omp_barrier, + c_finish_omp_atomic, c_finish_omp_flush, + c_finish_omp_for, c_split_parallel_clauses, + omp_clause_default_kind, c_omp_sharing_predetermined, + c_omp_remap_decl): Declare. + * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. + (OBJS-common): Add omp-low.o. + (c-omp.o, omp-low.o): Add. + (gimplify.o): Add dependency on $(OPTABS_H). + (GTFILES): Add omp-low.c. + (gt-stringpool.h): Add. + * tree-cfg.c (set_bb_for_stmt): Do not update the + block-to-labels map if we are currently expanding to RTL. + (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P + checks. + Handle IDENTIFIER_NODE. + (tree_verify_flow_info): Do not ICE when emitting error + messages about invalid labels. + (dump_function_to_file): Reset CFUN before emitting the body + of the function. + (debug_function): New. + * passes.c (init_optimization_passes): Schedule + pass_lower_omp. + * langhooks-def.h (lhd_omp_predetermined_sharing, + lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): + Declare. + (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. + (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, + LANG_HOOKS_OMP_PREDETERMINED_SHARING, + LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, + LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, + LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, + LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, + LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, + LANG_HOOKS_OMP_CLAUSE_DTOR): Define. + (LANG_HOOK_DECLS): Use them. + +2006-01-18 Dmitry Kurochkin + Richard Henderson + Jakub Jelinek + Diego Novillo + + * c-parser.c (pragma_omp_clause): Define. + (c_parser_declaration_or_fndef): Document OpenMP syntax. + (c_parser_compound_statement): Likewise. + (c_parser_statement): Likewise. + (c_parser_pragma): Handle omp pragmas. + (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, + OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. + (c_parser_omp_clause_name, check_no_duplicate_clause, + c_parser_omp_variable_list, + c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, + c_parser_omp_clause_copyprivate, + c_parser_omp_clause_default, + c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, + c_parser_omp_clause_lastprivate, + c_parser_omp_clause_nowait, + c_parser_omp_clause_num_threads, + c_parser_omp_clause_ordered, c_parser_omp_clause_private, + c_parser_omp_clause_reduction, + c_parser_omp_clause_schedule, c_parser_omp_clause_shared, + c_parser_omp_all_clauses, c_parser_omp_structured_block, + c_parser_omp_atomic, c_parser_omp_barrier, + c_parser_omp_critical, c_parser_omp_flush, + c_parser_omp_for_loop, c_parser_omp_for, + c_parser_omp_master, c_parser_omp_ordered, + c_parser_omp_sections_scope, c_parser_omp_sections, + c_parser_omp_parallel, c_parser_omp_single, + c_parser_omp_construct, c_parser_omp_threadprivate): New. + * c-pragma.c (init_pragma): Do omp pragma registration here. + * c.opt (fopenmp): New flag. + +2006-01-18 Eric Christopher + + * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. + * config/darwin.h (GOMP_SELF_SPECS): Define. + +2006-01-18 Kazu Hirata + + * rtl.h: Remove the prototype for reg_alloc. + +2006-01-18 John David Anglin + + PR target/25731 + * config.gcc (hppa*-*-linux*, hppa[12]*-*-hpux10*, hppa*64*-*-hpux11*, + hppa[12]*-*-hpux11*): Override default shared libgcc version for both + sjlj and dwarf2 exception handling. + * pa/t-hpux-shlib (SHLIB_SOVERSION): New make variable. + Rework to allow overriding SHLIB_EXT and SHLIB_SOVERSION. + * pa/pa.c (function_value): Treat complex and vector types as + aggregates. + (function_arg): Likewise. Only pass scalar floats in the floating + point argument registers. + * pa/t-slibgcc-dwarf-ver: New file. + * pa/t-slibgcc-sjlj-ver: New file. + * pa/t-slibgcc-elf-ver: Delete file. + +2006-01-19 Alan Modra + + * config/rs6000/rs6000.c (rs6000_assemble_integer): Correct + unlikely_test_section_p test. + +2006-01-18 Kazu Hirata + + * mode-switching.c (optimize_mode_switching): Make it static. + * basic-block.h: Remove the prototype for + optimize_mode_switching. + + * modulo-sched.c (sms_schedule): Make it static. + * rtl.h: Remove the prototype for sms_schedule. + + * postreload-gcse.c (gcse_after_reload_main): Make it static. + * rtl.h: Remove the prototype for gcse_after_reload_main. + + * reg-stack.c (reg_to_stack): Make it static. + * rtl.h: Remove the prototype for reg_to_stack. + + * regrename.c (regrename_optimize, copyprop_hardreg_forward): + Make them static. + * rtl.h: Remove the prototypes for regrename_optimize and + copyprop_hardreg_forward. + +2006-01-18 Eric Botcazou + + * config/alpha/alpha.c (alpha_split_tfmode_pair): Rename into + alpha_split_tmode_pair. Add 'mode' and 'fixup_overlap' arguments. + Test against the appropriate null constant for the mode. + If 'fixup_overlap' is true, swap the operands if they overlap. + (alpha_split_tfmode_frobsign): Adjust call to alpha_split_tfmode_pair. + * config/alpha/alpha-protos.h (alpha_split_tfmode_pair): Rename into + alpha_split_tmode_pair and adjust for above change. + * config/alpha/alpha.md (movtf_internal): Adjust call to + alpha_split_tfmode_pair and rely on it to swap the operands. + (movti_internal): New insn and post-reload splitter. + (movti): New expander. + +2006-01-18 Philippe De Muyter + + * config/m68k/m68k.md (*addsi3_5200): Allow addq/subq to memory + operands. + +2006-01-18 Kazu Hirata + + * rtlanal.c (global_reg_mentioned_p_1, + global_reg_mentioned_p): Remove. + * rtl.h: Remove the prototype for global_reg_mentioned_p. + + * flow.c (initialize_uninitialized_subregs): Make it static. + * rtl.h: Remove the prototype for + initialize_uninitialized_subregs. + + * function.c (instantiate_virtual_regs): Make it static. + * function.h: Remove the prototype for + instantiate_virtual_regs. + + * regmove.c (regmove_optimize, combine_stack_adjustments): + Make them static. + * rtl.h: Remove the prototypes for regmove_optimize and + combine_stack_adjustments. + +2006-01-17 Roger Sayle + + * config/i386/i386.c (COSTS_N_BYTES): New macro. + (size_cost): Encode costs in bytes so that a reg-reg addition is + equivalent to COSTS_N_INSNS(1). + (override_options): Use the size_cost.branch_cost as the default + ix86_branch_cost when optimizing for size. + +2006-01-18 Ben Elliston + + * Makefile.in (D32PBIT_FUNCS): New. + (D64PBIT_FUNCS, D128PBIT_FUNCS): Likewise. + (libgcc.mk): Set D32PBIT, D64PBIT, D128PBIT, D32PBIT_FUNCS, + D64PBIT_FUNCS and D128PBIT_FUNCS. + (LIBGCC_DEPS): Include $(D32PBIT), $(D64PBIT), $(D128PBIT). + * mklibgcc.in Bring in the DFP support code if D32PBIT, D64PBIT or + D128PBIT are set. + (decnumber_dep): Define. + * doc/libgcc.texi (Decimal float library routines): New node. + * config/dfp-bit.h, config/dfp-bit.c: New files. + +2006-01-18 Ben Elliston + + * expr.c (emit_move_change_mode): Always adjust addresses, not + just during reload. Copy replacements only during reload. + (emit_move_insn_1): Move MODE_DECIMAL_FLOAT modes by invoking + emit_move_via_integer. + +2006-01-17 Shantonu Sen + + * Makefile.in (check-%, check-consistency): Use $${srcdir} + instead of $(srcdir) and ${srcdir}. + +2006-01-17 Richard Earnshaw + + PR target/592 + PR middle-end/11135 + * arm.h (struct machine_function): Add pic_reg. + * arm.c (arm_pic_register): Make unsigned. + (arm_override_options): Only set arm_pic_register if + TARGET_SINGLE_PIC_BASE. + (use_return_insn): Only test for a pic register if it is fixed. + (arm_compute_save_reg0_reg12_mask): Likewise. + (thumb_compute_save_reg_mask): Likewise. + (legitimate_pic_operand): Factor out some known invariants. + (legitimize_pic_address): If we don't have a fixed pic register, + then set up a pseudo in the function entry sequence. Handle the + pic base being in a pseudo. + (arm_load_pic_register): Handle the pic register being in a pseudo. + (arm_expand_prologue): Only set up the pic register if it is fixed. + (thumb_expand_prologue): Likewise. + * arm.md (pic_load_addr_based): Handle the pic base being a pseudo. + (pic_load_addr_based_insn): Likewise. + (builtin_setjmp_receiver): Don't restore the pic base if it isn't + fixed. + +2006-01-18 Ben Elliston + + * config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok): Reject + decimal float modes for all floating point registers. + + * config/rs6000/predicates.md (reg_or_mem_operand): Pair up + match_code "mem" with match_test "macho_lo_sum_memory_operand". + +2006-01-17 Jakub Jelinek + + PR c/25682 + * c-typeck.c (build_unary_op): Fold offsetof-like expressions + even when the pointer is not NULL. + +2006-01-16 Ian Lance Taylor + + * common.opt (ftoplevel-reorder): New option. + * cgraph.c (cgraph_asm_nodes): New global variable. + (cgraph_asm_last_node): New static variable. + (cgraph_order): New global variable. + (cgraph_create_node): Set new order field. + (cgraph_varpool_node): Likewise. + (decide_is_variable_needed): Return true if not + flag_toplevel_reorder. + (cgraph_add_asm_node): New function. + * cgraph.h (struct cgraph_node): Add order field. + (struct cgraph_varpool_node): Add order field. + (struct cgraph_asm_node): Define. + (cgraph_asm_nodes, cgraph_order): Declare. + (cgraph_add_asm_node): Declare. + * cgraphunit.c (cgraph_varpool_assemble_decl): New static + function. + (cgraph_varpool_assemble_pending_decls): Call it. + (cgraph_output_pending_asms): New static function. + (cgraph_finalize_compilation_unit): Call it. + (struct cgraph_order_sort): Define. + (cgraph_output_in_order): New static function. + (cgraph_optimize): Call cgraph_output_pending_asms. Add code for + !flag_toplevel_reorder case. + * c-parser.c: Include "cgraph.h". + (c_parser_asm_definition): Call cgraph_add_asm_node rather than + assemble_asm. + * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather + than -fno-unit-at-a-time. + * doc/invoke.texi (Option Summary): Mention + -fno-toplevel-reorder. + (Optimize Options): Document -fno-toplevel-reorder. Mention it in + -funit-at-a-time documentation. + +2006-01-17 Hans-Peter Nilsson + Kazu Hirata + + * Makefile.in (FUNCTION_H, LAMBDA_H): Use $(TREE_H), not tree.h. + +2006-01-17 Kazu Hirata + + * Makefile.in (FUNCTION_H): New. Use it instead of + function.h throughout the file. + * function.h: Include tree.h. + +2006-01-17 Ben Elliston + + * recog.c: Separate some functions with whitespace. + +2006-01-16 Richard Henderson + + Merge from gomp branch: + * Makefile.in (TREE_INLINE_H): New. Use it as needed. + * tree-inline.h (struct copy_body_data): Move from tree-inline.c + and rename from struct inline_data. Rename callee* to dst*; + caller* to src*; add copy_decl hook, transform_call_graph_edges, + transform_new_cfg, transform_return_to_modify, and + transform_lang_insert_block flags; remove cloning_p, versioning_p, + update_clones_p. + (copy_body_r, insert_decl_map, remap_decl, remap_type): Declare. + (copy_decl_for_dup): Remove. + * tree-inline.c (struct inline_data): Move to header. + (insert_decl_map): Export. + (remap_decl): Update for member name changes. Use copy_decl hook. + Allow for replacement to be a non-decl. Remove dead code. + (remap_type_1): Check for existing mapping. + (remap_type): Export. + (remap_decls): Update for member name changes. + (remap_block, copy_bb, copy_cfg_body, copy_generic_body): Likewise. + (copy_body, setup_one_parameter, declare_return_variable): Likewise. + (expand_call_inline, optimize_inline_calls, clone_body): Likewise. + (copy_tree_r, mark_local_for_remap_r, unsave_expr_now): Likewise. + (tree_function_versioning, build_duplicate_type): Likewise. + (copy_body_r): Likewise. Export. + (copy_decl_for_dup): Split into ... + (copy_decl_for_dup_finish, copy_decl_to_var, + copy_decl_no_change, copy_decl_maybe_to_var): ... these. + (replace_ref_tree, inlining_p): Remove. + +2006-01-16 Kazu Hirata + + * ifcvt.c (if_convert): Make it static. + * rtl.h: Remove the prototype for if_convert. + + * local-alloc.c (local_alloc): Make it static. + * rtl.h: Remove the prototype for local_alloc. + + * loop.c (loop_optimize): Make it static. + * cfgloop.h: Remove the prototype for loop_optimize. + * rtl.h: Likewise. + +2006-01-16 DJ Delorie + + * reload.c (reg_overlap_mentioned_for_reload_p): Handle subregs of + mems. + +2006-01-16 John David Anglin + + * pa.md: Disparage copies between general and floating-point registers + in 32-bit move patterns. + +2006-01-16 H.J. Lu + + PR testsuite/25741 + * Makefile.in (check-%): Depend on site.exp instead of + $(TESTSUITEDIR)/site.exp. Run "runtest" in separate language + directories. + +2006-01-16 Kazu Hirata + + * global.c (global_alloc): Make it static. + * rtl.h: Remove the prototype for global_alloc. + +2006-01-16 Richard Guenther + + * tree-ssa-alias.c (struct used_part): Add write_only field. + (get_or_create_used_part_for): Initialize it to true. + (create_overlap_variables_for): Don't create structure variables + for structures that only are written to. + (find_used_portions): Handle MODIFY_EXPR to track whether a + structure is only written to. + +2006-01-16 Kazu Hirata + + * bb-reorder.c (partition_hot_cold_basic_blocks): Make it + static. + * basic-block.h: Remove the prototype for + partition_hot_cold_basic_blocks. + +2006-01-16 Rafael Ãvila de EspÃ�­ndola + + * cppspec.c (lang_specific_spec_functions): Remove. + * gcc.c (lookup_spec_function): Use static_spec_functions directly. + * gcc.h (lang_specific_spec_functions): Remove. + * gccspec.c (lang_specific_spec_functions): Remove. + +2006-01-16 Paolo Bonzini + + * combine.c (record_value_for_reg): Invalidate registers + if INSN is null. + (record_dead_and_set_regs_1): Likewise, by passing them to + record_value_for_reg. + (record_dead_and_set_regs): Invalidate stores made by a + call. We do not combine across a call, but we still + relied on equivalences. + +2006-01-16 Eric Botcazou + + * tree-vrp.c (extract_range_from_binary_expr): Cope with + vrp_int_const_binop returning non-constant nodes. + +2006-01-16 Paul Brook + + * config/m68k/m68k.c (output_move_const_into_data_reg): + Output correct mnemonic for mvz and mvs. + +2006-01-16 Gabor Loki + + * rtl-factoring.c: Add sequence abstraction algorithm. + * cfgcleanup.c (outgoing_edges_match): Extra checks. + (try_crossjump_to_edge): Avoid deleting preserve label when redirecting + ABNORMAL edges. + (block_has_preserve_label): New function. + * common.opt: Register new pass. + * Makefile.in: Ditto. + * passes.c: Ditto. + * timevar.def: Ditto. + * tree-pass.h: Ditto. + * emit-rtl.c (make_jump_insn_raw): Remove forward decl. + * rtl.h (make_jump_insn_raw): Add forward decl. + * doc/invoke.texi: Add documentation for -frtl-abstract-sequences. + +2006-01-16 Eric Botcazou + Roger Sayle + + * fold-const.c (fold_minmax): New static function. + (fold_binary) : Call it. + : Likewise. + * stor-layout.c (place_field): Use DECL_SIZE consistently + in the computation of the new record size. + +2006-01-16 Kazu Hirata + + * cse.c (cse_condition_code_reg): Make it static. + * rtl.h: Remove the prototype for cse_condition_code_reg. + + * combine.c (combine_instructions): Make it static. + * rtl.h: Remove the prototype for combine_instructions. + +2006-01-15 John David Anglin + + PR target/25168 + * tree.c (get_file_function_name_long): Concatenate the first global + object name with a string derived from the input filename of the object + for type "F". + +2006-01-16 Ben Elliston + + * config/i386/winnt-stubs.c: Update FSF address. + * config/xtensa/ieee754-df.S: Ditto. + * config/xtensa/ieee754-sf.S: Ditto. + +2006-01-14 Ian Lance Taylor + + * ifcvt.c (noce_init_if_info): New static function, broken out of + noce_process_if_block. + (noce_process_if_block): Call noce_init_if_info. + (check_cond_move_block): New static function. + (cond_move_process_if_block): New static function. + (process_if_block): Call cond_move_process_if_block. + +2006-01-15 Kazu Hirata + + * cselib.c (hash_table): Rename to cselib_hash_table. + (cselib_clear_table, discard_useless_values, + remove_useless_values, cselib_lookup_mem, cselib_lookup, + cselib_init, cselib_finish): Adjust uses of hash_table. + +2006-01-14 Kazu Hirata + + PR tree-optimization/25485 + * tree-vrp.c (extract_range_from_binary_expr): Handle cases + where one of the operands of TRUTH_AND_EXPR and TRUTH_OR_EXPR + is known to be false and true, respectively. + +2006-01-14 Richard Guenther + + PR tree-optimization/22548 + PR tree-optimization/22555 + PR tree-optimization/22501 + * Makefile.in (tree-ssa-structalias.o): Depend on $(PARAMS_H). + * params.def (salias-max-array-elements): New parameter. + * params.h (SALIAS_MAX_ARRAY_ELEMENTS): Define. + * doc/invoke.texi (salias-max-array-elements): Document. + * tree-flow-inline.h (var_can_have_subvars): We also handle + arrays now. + * tree-ssa-alias.c (find_used_portions): Handle ARRAY_REF like + COMPONENT_REF. + * tree-ssa-structalias.c (params.h): Include. + (push_fields_onto_fieldstack): Handle ARRAY_TYPE. + (find_func_aliases): Handle multiple constraints from ARRAY_REF. + (get_constraint_for): For ADDR_EXPR operating on something + containing an ARRAY_REF, add all subvars to the solution. + (handle_ptr_arith): Handle ARRAY_TYPE like RECORD_TYPE types. + * tree-ssa-operands.c (parse_ssa_operands): Handle ARRAY_REF + for creating MUST_DEFs. + (get_expr_operands): Treat ARRAY_REF like COMPONENT_REF wrt subvars. + +2006-01-14 Zdenek Dvorak + + * tree-ssa-loop-niter.c (number_of_iterations_cond): Split into several + functions. + (number_of_iterations_ne, number_of_iterations_lt_to_ne, + assert_no_overflow_lt, assert_loop_rolls_lt, number_of_iterations_lt, + number_of_iterations_le): New functions. + (number_of_iterations_special): Removed. + (number_of_iterations_exit): Do not use number_of_iterations_special. + * tree.c (unsigned_type_for): Always return integer type. + +2006-01-14 Steven Bosscher + Richard Guenther + + PR rtl-optimization/24257 + * gcse.c (find_moveable_store): Only consider a store movable + when the SET_SRC of the insn can be assigned to a register. + +2006-01-14 Ian Lance Taylor + + * tree.c (tree_not_class_check_failed): New function. + * tree.h (NON_TYPE_CHECK): Call tree_not_class_check_failed. + (tree_not_class_check_failed): Declare. + +2006-01-13 Ian Lance Taylor + + * reload1.c (do_output_reload): Add assertion rejecting a + CALL_INSN. + +2006-01-13 Adam Nemet + + * combine.c (struct reg_stat): Add new fields truncation_label and + truncated_to_mode. + (record_value_for_reg): Reset truncated_to_mode. + (record_truncated_value): New function. + (check_promoted_subreg): Call it. Rename to check_conversions. + (combine_instructions): Rename check_promoted_subreg to + check_conversions. + (reg_truncated_to_mode): New function. + (make_extraction): Use it. Check TRULY_NOOP_TRUNCATION. + (gen_lowpart_or_truncate): New function. + (force_to_mode): Use it instead of gen_lowpart. + +2006-01-13 Diego Novillo + + * tree-ssa-alias.c (add_type_alias): Fix typo. Test whether + VAR is a tag, not its type tag. + +2006-01-13 Alexandre Oliva + + * config/i386/sse.md (*vec_extractv2di_1_sse2): Reorder + alternatives to match style of other entries. + (*vec_extractv2di_1_sse): Likewise. Fix mode attr. + +2006-01-13 Daniel Berlin + + PR tree-optimization/25771 + * tree-ssa-pre.c (insert_extra_phis): Don't insert merges of abnormal + SSA_NAMES. + +2006-01-13 Andrew Pinski + + PR tree-opt/24365 + * tree-inline.c (declare_return_variable): If the return variable + was marked as a non gimple complex, set the return slot variable + to be a non gimple comple variable. + +2006-01-13 Richard Guenther + + * builtins.c (expand_builtin_sincos): New function. + (expand_builtin_mathfn_3): Remove dead code, sin and cos + do not set errno. + (expand_builtin): Expand sincos using expand_builtin_sincos. + +2006-01-12 DJ Delorie + + * config/m32c/shift.md: Rewrite: Allow arbitrary operands for + shift counts, separate SI shifts for m32c vs m16c, pass shift type + so that constant shifts can be split. + * config/m32c/m32c.c (m32c_const_ok_for_constraint_p): Add In6. + (m32c_valid_pointer_mode): Make static. + (shift_gen_func_for): New. + (m32c_prepare_shift): Use it. Split large const shifts into + multiple shifts. + * config/m32c/predicates.md (shiftcount_operand): Allow more + general operands. + (longshiftcount_operand): New. + * doc/md.texi (Machine Constraints): Document In6. + +2006-01-13 Ben Elliston + + * doc/tm.texi (Data Output): Add REAL_VALUE_TO_TARGET_DECIMAL32, + REAL_VALUE_TO_TARGET_DECIMAL64 and REAL_VALUE_TO_TARGET_DECIMAL128 + documentation. + +2006-01-12 Daniel Berlin + + * tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR + to try to avoid clobbering pieces of structures when we know + something about the whole structure. + * tree-ssa-alias.c (create_sft): Set SFT_PARENT_VAR + +2006-01-13 Ben Elliston + + * doc/rtl.texi (Insns): Remove statement that libcalls cannot + return in memory, as this is no limitation is no longer present. + +2006-01-12 DJ Delorie + + * config/m32c/addsub.md (addhi3): Add two more alternatives, for + mova with fb, and for fb+0 -> An. + + * config/m32c/mov.md (peephole2): Fix enabling logic. + + * config/m32c/m32c.h (CTOR_LIST_BEGIN, CTOR_LIST_END, + DTOR_LIST_BEGIN, DTOR_LIST_END, CTORS_SECTION_ASM_OP, + DTORS_SECTION_ASM_OP, INIT_ARRAY_SECTION_ASM_OP, + FINI_ARRAY_SECTION_ASM_OP): Define. + + * config/m32c/m32c.c (m32c_legitimize_address): Remove temporary + variable. + (m32c_legitimize_reload_address): New logic to reload FB to An. + (m32c_output_reg_push): Add newline. + (m32c_output_reg_pop): Likewise. + +2006-01-12 Ulrich Weigand + + * struct-equiv.c (find_dying_inputs): Fix off-by-one bug. + +2006-01-11 Andrew Pinski + + * config/i386/darwin.h (SUBTARGET_ENCODE_SECTION_INFO): Define. + +2006-01-11 Kazu Hirata + + * config/sh/predicates.md (sh_rep_vec): Add parallel to + match_code. + +2006-01-11 Ben Elliston + + * rtlanal.c (find_reg_note): Assert insn is not null. + +2006-01-11 Kenneth Zadeck + + * df-scan.c (df_hard_reg_init): Move declaration of i outside + ifdef. + +2006-01-11 Jeff Law + + * tree-ssa-threadupdate.c (threaded_edges): New VEC to + hold edge pairs. + (mark_threaded_blocks, register_jump_thread): New functions. + (thread_through_all_blocks): Remove unwanted argument. No + longer rely on e->aux to communicate thread target info. + Call mark_threaded_blocks. Release the threaded_blocks + bitmap and threaded_edges vector when complete. + * tree-ssa-dom.c (struct edge_info): Remove redirection_target field. + (threaded_blocks): Remove. + (tree_ssa_dominator_optimize): Remove initialization and + finalization of threaded_blocks. Simplify call to + thread_through_all_blocks. + (thread_across_edge): Call register_jump_thread rather than + storing thread information into e->aux. + (free_all_edge_infos): Simplify now that e->aux is no longer + used to communicate with thread_through_all_blocks. + * tree-flow.h (thread_through_all_blocks): Update prototype. + (register_jump_thread): Prototype. + +2006-01-11 Kazu Hirata + + * df-core.c (df_compact_blocks, df_bb_replace): Use + SET_BASIC_BLOCK instead of BASIC_BLOCK. + +2006-01-11 Richard Guenther + + PR tree-optimization/25734 + * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Do not + stop propagation after successful propagation to the LHS. + +2006-01-11 Kazu Hirata + + * basic-block.h (control_flow_graph): Change the type of + x_basic_block_info to VEC(basic_block,gc) *. + (BASIC_BLOCK_FOR_FUNCTION, BASIC_BLOCK): Adjust the uses of + basic_block_info. + (SET_BASIC_BLOCK): New. + * cfg.c (compact_blocks, expunge_block): Use SET_BASIC_BLOCK + instead of BASIC_BLOCK when assigning to BASIC_BLOCK. + * cfgbuild.c (find_basic_blocks): Likewise. + * cfglayout.c (fixup_reorder_chain): Likewise. + * cfgrtl.c (create_basic_block_structure, + rtl_create_basic_block): Likewise. + * ifcvt.c (find_if_case_1): Likewise. + * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, create_bb): + Likewise. + +2006-01-11 Kenneth Zadeck + + * Makefile.in: Removed rotted odf.c entry. + +2006-01-11 Hans-Peter Nilsson + + PR target/25706 + * config/cris/cris.md ("*extopqihi_side", "*extopsi_side") + ("*extopsi_swap_side_biap", "*extopsi_swap_side", + ("*extopqihi", "*extopsi", "*extopsi_swap"): Use %E + output pattern modifier, not %e. + * config/cris/cris.c (cris_op_str): Update comment about pattern + modifier. + (cris_print_operand) : Clear cris_output_insn_is_bound + before falling through into... + : Redefined from old 'e' case. + +2006-01-11 Jan Hubicka + + PR target/25042 + * i386.c (ix86_init_mmx_sse_builtins): Do not delcare float128 + +2006-01-11 Jan Hubicka + + * i386.h (TARGET_DECOMPOSE_LEA): Kill. + * i386.c (x86_decompose_lea): Kill. + (ix86_rtx_costs): Kill. + +2006-01-11 Jan Hubicka + + * cgraph.c (cgraph_insert_node_to_hashtable): New function. + * cgraph.h (cgraph_node): Add inline_decl. + (cgraph_insert_node_to_hashtable): Declare. + (save_inline_function_body): Declare. + * cgraphunit.c (verify_cgraph_node): Inline edges might point to inline + clones. + (cgraph_preserve_function_body_p): Do not presrve when dump is enabled. + (cgraph_function_versioning): Update call of tree_function_versioning. + (save_inline_function_body): New function. + * function.h (struct function): Kill saved_eh, saved_cfg, saved_args, + saved_static_chain_decl, saved_blocks and saved-unexpanded_var_list. + * ipa-inline.c (cgraph_mark_inline_edge): Look for inline clones. + (cgraph_default_inline_p): Likewise. + (cgraph_decide_inlining_incrementally): Likewise. + * tree-inline.c (inline_data): Kill saving_p add update_clones_p. + (copy_bb): Kill saving; do updating of clones. + (copy_cfg_body): Kill saving. + (initialize_inlined-parameters): Likewise. + (expand_call_inline): Likewise. + (save_body): Kill. + (tree_function_versioning): New parameter "update_clones". + (inlining_p): Kill saving. + * tree-inline.h (tree_function_versioning): Update prototype. + * tree-optimize.c (tree_rest_of_compilation): Use clonning instead of + saving. + +2006-01-11 Ian Lance Taylor + + * combine.c (struct undo): Remove is_int. Enumify types of undos. + Allow undoing set of machine mode. + (do_SUBST): Use enums instead of is_int. + (do_SUBST_MODE): New function. + (SUBST_MODE): New macro. + (try_combine): Use SUBST_MODE/PUT_MODE instead of generating a new + reg and trying to replace reg_regno_rtx with a new register. + (undo_all): Use new enums, handle undoing a PUT_MODE change. + (simplify_set): Use SUBST_MODE. + (distribute_notes): Remove code that tried to update reg notes + for regno_reg_rtx changes. + +2006-01-11 Paolo Bonzini + + PR tree-optimization/23109 + PR tree-optimization/23948 + PR tree-optimization/24123 + + * Makefile.in (tree-ssa-math-opts.o): Adjust dependencies. + * tree-cfg.c (single_noncomplex_succ): New. + * tree-flow.h (single_noncomplex_succ): Declare it. + * tree-ssa-math-opts.c (enum place_reciprocal): Remove. + * tree-ssa-math-opts.c (enum place_reciprocal): Remove. + (struct occurrence, occ_head, occ_pool, is_divide_by, compute_merit, + insert_bb, register_division_in, insert_reciprocals, + replace_reciprocal, free_bb): New. + (execute_cse_reciprocals_1): Rewritten. + (execute_cse_reciprocals): Adjust calls to execute_cse_reciprocals_1. + Do not commit any edge insertion. Always compute dominators and + create the allocation pool. + * target-def.h (TARGET_MIN_DIVISIONS_FOR_RECIP_MUL): New. + * target.h (struct gcc_target): Add min_divistions_for_recip_mul. + * targhooks.c (default_min_divistions_for_recip_mul): New. + * targhooks.h (default_min_divistions_for_recip_mul): New prototype. + * passes.c (init_optimization_passes): Run recip after tree loop + optimizations. + * doc/tm.texi (Misc): Document TARGET_MIN_DIVISIONS_FOR_RECIP_MUL. + +2006-01-11 Danny Berlin + Kenneth Zadeck + + * df.h (DF_SCAN, DF_RU, DF_RD, DF_LR, DF_UR, DF_UREC, DF_CHAIN, + DF_RI, DF_LAST_PROBLEM_PLUS1, DF_DU_CHAIN, DF_UD_CHAIN, + DF_REF_TYPE_NAMES, DF_HARD_REGS, DF_EQUIV_NOTES, DF_SUBREGS, + DF_SCAN_BB_INFO, DF_RU_BB_INFO, DF_RD_BB_INFO, DF_LR_BB_INFO, + DF_UR_BB_INFO, DF_UREC_BB_INFO, DF_LIVE_IN, DF_LIVE_OUT, + DF_RA_LIVE_IN, DF_RA_LIVE_OUT, DF_UPWARD_LIVE_IN, + DF_UPWARD_LIVE_OUT, DF_REF_REAL_REG, DF_REF_REGNO, + DF_REF_REAL_LOC, DF_REF_REG, DF_REF_LOC, DF_REF_BB, DF_REF_BBNO, + DF_REF_INSN, DF_REF_INSN_UID, DF_REF_TYPE, DF_REF_CHAIN, + DF_REF_ID, DF_REF_FLAGS, DF_REF_NEXT_REG, DF_REF_PREV_REG, + DF_REF_NEXT_REF, DF_REF_DATA, DF_REF_REG_DEF_P, DF_REF_REG_USE_P, + DF_REF_REG_MEM_STORE_P, DF_REF_REG_MEM_LOAD_P, DF_REF_REG_MEM_P, + DF_DEFS_SIZE, DF_DEFS_GET, DF_DEFS_SET, DF_USES_SIZE, DF_USES_GET, + DF_USES_SET, DF_REG_SIZE, DF_REG_DEF_GET, DF_REG_DEF_SET, + DF_REG_USE_GET, DF_REG_USE_SET, DF_REGNO_FIRST_DEF, + DF_REGNO_LAST_USE, DF_INSN_SIZE, DF_INSN_GET, DF_INSN_SET, + DF_INSN_CONTAINS_ASM, DF_INSN_LUID, DF_INSN_DEFS, DF_INSN_USES, + DF_INSN_UID_GET, DF_INSN_UID_LUID, DF_INSN_UID_DEFS, + DF_INSN_UID_USES, DF_SCAN_INITIAL, DF_SCAN_GLOBAL, + DF_SCAN_POST_ALLOC): New macros. + (df_flow_dir, df_ref_type, df_ref_flags, df_alloc_function, + df_free_bb_function, df_local_compute_function, df_init_function, + df_dataflow_function, df_confluence_function_0, + df_confluence_function_n, df_transfer_function, + df_finalizer_function, df_free_function, df_dump_problem_function, + df_problem, dataflow, df_insn_info, df_reg_info, df_ref, df_link, + df_ref_info, df, df_map, df_scan_bb_info, df_ru_bb_info, + df_ru_bb_info, df_rd_bb_info, df_lr_bb_info, df_ur_bb_info, + df_urec_bb_info, ) New types. + (df_invalidated_by_call, df_all_hard_regs, df_state) New public + variables. + (df_init, df_add_problem, df_set_blocks, df_finish, df_analyze, + df_analyze_simple_change_some_blocks, + df_analyze_simple_change_one_block, df_compact_blocks, + df_bb_replace, df_bb_regno_last_use_find, + df_bb_regno_first_def_find, df_bb_regno_last_def_find, + df_insn_regno_def_p, df_find_def, df_find_use, + df_iterative_dataflow, df_dump, df_chain_dump, df_refs_chain_dump, + df_regs_chain_dump, df_insn_debug, df_insn_debug_regno, + df_regno_debug, df_ref_debug, debug_df_insn, debug_df_regno, + debug_df_reg, debug_df_defno, debug_df_useno, debug_df_ref, + debug_df_chain, df_get_dependent_problem, df_chain_create, + df_chain_unlink, df_chain_copy, df_get_live_in, df_get_live_out, + df_grow_bb_info, df_chain_dump, df_print_bb_index, + df_ru_add_problem, df_ru_get_bb_info, df_rd_add_problem, + df_rd_get_bb_info, df_lr_add_problem, df_lr_get_bb_info, + df_ur_add_problem, df_ur_get_bb_info, df_urec_add_problem, + df_urec_get_bb_info, df_chain_add_problem, df_ri_add_problem, + df_reg_lifetime, df_scan_get_bb_info, df_scan_add_problem, + df_rescan_blocks, df_ref_create, df_get_artificial_defs, + df_get_artificial_uses, df_reg_chain_create, df_reg_chain_unlink, + df_ref_remove, df_insn_refs_delete, df_refs_delete, + df_reorganize_refs, df_set_state, df_hard_reg_init, + df_read_modify_subreg_p) New public functions. + * df-core.c: The core dataflow solver and glue routines for rtl + dataflow. + (df_init, df_add_problem, df_set_blocks, df_finish, + df_hybrid_search_forward, df_hybrid_search_backward, + df_iterative_dataflow, df_prune_to_subcfg, df_analyze_problem, + df_analyze, df_get_bb_info, df_set_bb_info, df_bb_replace, + df_bb_regno_last_use_find, df_bb_regno_first_def_find, + df_bb_regno_last_def_find, df_insn_regno_def_p, df_find_def, + df_reg_defined, df_find_use, df_reg_used, df_dump, + df_refs_chain_dump, df_regs_chain_dump, df_insn_debug, + df_insn_debug_regno, df_regno_debug, df_ref_debug, debug_df_insn, + debug_df_reg, debug_df_regno, debug_df_ref debug_df_defno, + debug_df_useno, reset_df_after_reload): New functions. + * df-scan.c: The scanning fuctions, once in df.c, completely + rewritten so that they now fully model the functionality of + register usage at the backend. + (df_scan_free_internal, df_scan_get_bb_info, df_scan_set_bb_info, + df_scan_free_bb_info, df_scan_alloc, df_scan_free, df_scan_dump, + df_scan_add_problem, df_grow_reg_info, df_grow_ref_info, + df_grow_insn_info, df_rescan_blocks, df_ref_create, + df_get_artificial_defs, df_get_artificial_uses, + df_reg_chain_create, df_ref_unlink, df_reg_chain_unlink, + df_ref_remove, df_insn_create_insn_record, df_insn_refs_delete, + df_refs_delete, df_reorganize_refs, df_set_state, + df_ref_create_structure, df_ref_record, df_read_modify_subreg_p, + df_def_record_1, df_defs_record, df_uses_record, + df_insn_contains_asm_1, df_insn_contains_asm, df_insn_refs_record, + df_has_eh_preds, df_bb_refs_record, df_refs_record, df_mark_reg, + df_record_exit_block_uses, df_hard_reg_init): New functions. + + * df-problems.c: Seven concrete dataflow problems that use the + scanning in df-scan.c and are solved by the engine in df-core.c. + (df_get_dependent_problem, df_chain_create, df_chain_unlink, + df_chain_copy, df_get_live_in, df_get_live_out, df_grow_bb_info, + df_chain_dump, df_print_bb_index, df_ref_bitmap, df_set_seen, + df_unset_seen, df_ru_get_bb_info, df_ru_set_bb_info, + df_ru_free_bb_info, df_ru_alloc, + df_ru_bb_local_compute_process_def, + df_ru_bb_local_compute_process_use, df_ru_bb_local_compute, + df_ru_local_compute, df_ru_init_solution, df_ru_confluence_n, + df_ru_transfer_function, df_ru_free, df_ru_dump, + df_ru_add_problem, df_rd_get_bb_info, df_rd_set_bb_info, + df_rd_free_bb_info, df_rd_alloc, + df_rd_bb_local_compute_process_def, df_rd_bb_local_compute, + df_rd_local_compute, df_rd_init_solution, df_rd_confluence_n, + df_rd_transfer_function, df_rd_free, df_rd_dump, + df_rd_add_problem, df_lr_get_bb_info, df_lr_set_bb_info, + df_lr_free_bb_info, df_lr_alloc, df_lr_bb_local_compute, + df_lr_local_compute, df_lr_init, df_lr_confluence_0, + df_lr_confluence_n, df_lr_transfer_function, df_lr_free, + df_lr_dump, df_lr_add_problem, df_ur_get_bb_info, + df_ur_set_bb_info, df_ur_free_bb_info, df_ur_alloc, + df_ur_bb_local_compute, df_ur_local_compute, df_ur_init, + df_ur_local_finalize, df_ur_confluence_n, df_ur_transfer_function, + df_ur_free, df_ur_dump, df_ur_add_problem, df_urec_get_bb_info, + df_urec_set_bb_info, df_urec_free_bb_info, df_urec_alloc, + df_urec_mark_reg_change, df_urec_check_earlyclobber, + df_urec_mark_reg_use_for_earlyclobber, + df_urec_mark_reg_use_for_earlyclobber_1, df_urec_bb_local_compute, + df_urec_local_compute, df_urec_init, df_urec_local_finalize, + df_urec_confluence_n, df_urec_transfer_function, df_urec_free, + df_urec_dump, df_urec_add_problem, df_chain_alloc, + df_chain_create_bb_process_use, df_chain_create_bb, + df_chain_finalize, df_chain_free, df_chains_dump, + df_chain_add_problem, df_ri_alloc, df_ri_bb_compute, + df_ri_compute, df_ri_free, df_ri_dump, df_ri_add_problem, + df_reg_lifetime): New functions. + * df.c: Deleted file. + * ddg.c (create_ddg_dep_no_link, build_inter_loop_deps): Made code + consistent with new df api. + * modulo-sched.c (sms_schedule, rest_of_handle_sms, + rest_of_handle_sms): Ditto. + * web.c (unionfind_union, union_defs, entry_register, web_main): + Ditto. + * loop_invariant.c (invariant_for_use, hash_invariant_expr_1, + invariant_expr_equal_p, find_defs, check_dependencies, + find_invariant_insn, find_invariants_to_move, move_invariant_reg, + free_inv_motion_data, move_loop_invariants): Ditto. + * Makefile.in (df.c, df-scan.c df-problems.c df-core.c): + Update dependencies. + (odf.c): Added defective entry that was deleted later in day. + * sched-deps.c (sched_analyze_1): Ditto. + +2006-01-11 Zdenek Dvorak + + * tree-ssa-operands.c (get_expr_operands): Record addressable + variables directly. Do not call add_stmt_operands for CONST_DECLs + and ARRAY_DECLs. + (get_indirect_ref_operands): Remove handling of *(&a + offset) case. + (add_stmt_operands): Handle only objects satisfying SSA_VAR_P. + +2006-01-11 Ben Elliston + + * config/i386/i386.c (ix86_return_in_memory): Fix comment: this + function returns true in the positive case. + +2006-01-10 John David Anglin + + PR target/20754 + * config/pa/pa.md: Create separate 32 and 64-bit move patterns + for SI, DI, SF and DF modes. Add alternatives to copy between + general and floating point registers to the 32-bit patterns. + * config/pa/pa-64.h (SECONDARY_MEMORY_NEEDED_RTX): Delete undefine. + * config/pa/pa.h (SECONDARY_MEMORY_NEEDED_RTX): Delete define. + (SECONDARY_MEMORY_NEEDED): Secondary memory is only needed when + generating 64-bit code. + * config/pa/pa.c (output_move_double): Handle copies between general + and floating registers. + +2006-01-10 Stuart Hastings + + * config/i386/i386.md (set_got): Update. + (set_got_labelled): New. (UNSPEC_LD_MPIC): New. + (builtin_setjmp_receiver): Mach-O support. + * config/i386/darwin.h (TARGET_ASM_FILE_END) Define. + (GOT_SYMBOL_NAME): Define. + (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): New. + (TARGET_DEEP_BRANCH_PREDICTION): Remove. + * config/i386/i386.c (override_options): Revise for Darwin. + (USE_HIDDEN_LINKONCE): Enable for Mach-O. (ix86_file_end): Mach-O + support. (darwin_x86_file_end): New. (output_set_got): Add label + parameter, revise for Mach-O. (x86_output_mi_thunk): Likewise. + * config/i386/i386-protos.h (output_set_got): Likewise. + * config/darwin.c (machopic_legitimize_pic_address): Update + regs_ever_live[]. + +2006-01-10 Kaz Kojima + + * config/sh/sh.h (SH5_WOULD_BE_PARTIAL_NREGS): Use GET_MODE_SIZE + when MODE isn't BLKmode. + +2006-01-10 Eric Botcazou + + PR rtl-optimization/25367 + * config/sparc/sparc.h (HARD_REGNO_RENAME_OK): New macro. + +2006-01-10 Hans-Peter Nilsson + + PR target/25718 + * config/cris/cris.md ("uminsi3"): Don't use 8- or 16-bit sizes + for a negative bound. + +2006-01-10 Richard Guenther + + * tree-ssa-structalias.c (get_constraint_for_component_ref): + Never override with anything constraint. + +2006-01-10 Jan Beulich + + * config/i386/i386.c (ix86_data_alignment): Don't force alignment to + 256 bits when optimize_size. + +2006-01-10 Jan Beulich + + * config/i386/netware.h (TARGET_SUBTARGET_DEFAULT): Include + MASK_ALIGN_DOUBLE. + * config/i386/nwld.h (LINK_SPEC): Add --extensions:GNU option. + * config/i386/t-nwld (SHLIB_LINK): Insert spaces between expr + arguments. + +2006-01-10 Ben Elliston + + * config/rs6000/predicates.md (easy_fp_constant): Discount decimal + float modes. + * config/rs6000/rs6000.c (rs6000_scalar_mode_supported_p): New. + (TARGET_SCALAR_MODE_SUPPORTED_P): Define. + (USE_FP_FOR_ARG): Reject decimal float modes. + (function_arg_advance): Likewise. + (output_toc): Handle emitting TDmode, DDmode and SDmode constants. + (rs6000_handle_altivec_attribute): Do not permit decimal floating + point types in AltiVec vectors. + (rs6000_function_value): Use GP_ARG_RETURN for decimal floats. + (rs6000_libcall_value): Likewise. + +2006-01-09 Bob Wilson + + * config/xtensa/ieee754-df.S: New file. + * config/xtensa/ieee754-sf.S: New file. + * config/xtensa/t-xtensa (LIB2FUNCS_EXTRA): Remove fp-bit.c & dp-bit.c. + (LIB1ASMFUNCS): Add SFmode and DFmode floating-point functions. + * config/xtensa/lib1funcs.asm: Include ieee754-df.S and ieee754-sf.S. + +2006-01-09 Kazu Hirata + + * config/sh/predicates.md (binary_float_operator, + binary_logical_operator, commutative_float_operator, + equality_comparison_operator, greater_comparison_operator, + less_comparison_operator, logical_operator, + noncommutative_float_operator, shift_operator, + symbol_ref_operand, unary_float_operator): Remove redundant + conditionals. + +2006-01-09 Jeff Law + + * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Remove + code to propagate the RHS of a cast into COND_EXPR_COND. Remove + now unused arguments. Callers updated. + (eliminate_redundant_computations): Remove now unused arguments, + callers updated. + (local_fold): Remove, no longer used. + (find_equivalent_equality_comparison): Removed from tree-ssa-dom.c + and moved to... + * tree-ssa-forwprop.c (find_equivalent_equality_comparison): Here. + (simplify_cond): New function. + (forward_propagate_into_cond): Call simplify_cond. + +2006-01-09 Alexandre Oliva + + * config/i386/sse.md (*vec_extractv2di_1_sse2): New. + (*vec_extractv2di_1_sse): New. + +2006-01-09 Ben Elliston + + * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Typo fix. + +2006-01-08 Richard Guenther + + * tree-ssa-structalias.c (get_constraint_for): Remove + anyoffset argument. + (get_constraint_for_component_ref): Likewise. + (do_deref): Likewise. + (get_constraint_for): Likewise. + (do_structure_copy): Likewise. + (handle_ptr_arith): Likewise. + (find_func_aliases): Likewise. Remove unused need_anyoffset + variable. + +2006-01-08 J"orn Rennecke + Kaz Kojima + + * config/sh/sh.h (CONST_OK_FOR_K16): Define. + (CONST_OK_FOR_K): Add CONST_OK_FOR_K16 case. + (EXTRA_CONSTRAINT_C16): Remove. + (EXTRA_CONSTRAINT_Css, EXTRA_CONSTRAINT_Csu): Define. + (EXTRA_CONSTRAINT_C): Remove EXTRA_CONSTRAINT_C16 case and add + EXTRA_CONSTRAINT_Css and EXTRA_CONSTRAINT_Csu cases. + * config/sh/sh.c (print_operand): Handle unsigned 16-bit symbolic + constants of SHmedia. Handle nested constant expressions of + SHmedia correctly. + (andcosts): Fix the costs for SHmedia constants. + (sh_rtx_costs): Take account of outer_code for SHmedia constants. + * config/sh/sh.md (*movsi_media): Use Css constraint instead of C16. + (*movsi_media_nofpu, *movqi_media, *movhi_media): Likewise. + (*movdi_media, *movdi_media_nofpu, movv8qi_i, movv2hi_i): Likewise. + (movv4hi_i, movv2si_i): Likewise. + (movsi_const): Adjust the second operand of ior so to match with + the Csu constraint. + (movdi_const, movdi_const_32bit): Likewise. + (movdi_const_16bit+1): Don't sign-extend LOW. + (movdi_const_16bit+2): Likewise. Remove the zero_extend and truncate + step. + (*double_shori): Fix the split condition. Use GEN_INT instead + of get_int_mode calls. Mask lower 16-bit of the argument of + the last GEN_INT. + (sym2GOTPLT): Remove. + (symGOTPLT2reg): Replace gen_sym2GOTPLT with gen_rtx_CONST and + gen_rtx_UNSPEC. + * config/sh/predicates.md (arith_operand): Use EXTRA_CONSTRAINT_Css + instead of EXTRA_CONSTRAINT_C16. + +2006-01-07 Ian Lance Taylor + David Edelsohn + + PR rtl-optimization/25662 + * optabs.c (simplify_expand_binop): Use simplify_binary_operation + for constant operands instead of simplify_gen_binary. + * simplify-rtx.c (simplify_gen_binary): Swap commutative operands + after trying simplify_binary_operation + +2006-01-06 Daniel Berlin + + * tree.c (iterative_hash_expr): Hash decls based on UID. + +2006-01-06 Eric Christopher + + * doc/tm.texi (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Document. + (TARGET_UNWIND_EMIT): Fix spelling. + * target.h (gcc_target): Add except_table_label. + * except.c (output_function_exception_table): Use. + * varasm.c (default_emit_except_table_label): New. + * target-def.h (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): New default + define. + (asm_out): Add here. + * output.h (default_emit_except_table_label): Prototype. + * config/darwin-protos.h (darwin_emit_except_table_label): Ditto. + * config/darwin.c (darwin_emit_except_table_label): Define. + * config/darwin.h (TARGET_ASM_EMIT_EXCEPT_TABLE): Ditto. + +2006-01-06 Zdenek Dvorak + + PR tree-optimization/18527 + * tree-ssa-loop-niter.c (number_of_iterations_cond, + number_of_iterations_special, number_of_iterations_exit): + Move base and step of an iv to a single structure. Add + no_overflow flag, and use it in # of iterations analysis. + * tree-scalar-evolution.c (analyze_scalar_evolution_in_loop): Add + folded_casts argument. + (simple_iv): Pass base and step in a structure. Set no_overflow + flag. + (scev_const_prop): Add argument to analyze_scalar_evolution_in_loop. + Evaluate expensiveness of computing # of iterations instead of + the final expression. + * tree-scalar-evolution.h (affine_iv): New structure. + (simple_iv): Declaration changed. + * tree-chrec.c (chrec_apply): Handle chrecs containing symbols. + * tree-ssa-loop-ivopts.c (determine_biv_step, find_givs_in_stmt_scev, + find_givs_in_stmt): Changed due to simple_iv change. + +2006-01-06 Jeff Law + + PR ada/24994 + * tree-cfg.c (bsi_replace): Rename final argument from + PRESERVE_EH_INFO to UPDATE_EH_INFO. Fix typo in last + change (stmt -> orig_stmt). + * tree-eh.c (verify_eh_throw_stmt_node): New function. + (bsi_remove): Add new argument. Remove EH information + if requested. + (verify_eh_throw_table_statements): New function. + (bsi_remove): Add new argument REMOVE_EH_INFO. All callers + updated. + * tree-optimize.c (execute_free_cfg_annotations): Verify + the EH throw statement table after removing annotations. + * except.h (verify_eh_throw_table_statements): Prototype. + * tree-flow.h (bsi_remove): Update prototype. + * tree-vrp.c (remove_range_assertions): Add new argument to + bsi_remove call. + * tree-ssa-loop-im.c (move_computations_stmt): Likewise. + * tree-complex.c (expand_complex_div_wide): Likewise. + * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges): Likewise + * tree-tailcall.c (eliminate_tailcall): Likewise. + * tree-ssa-dse.c (dse_optimize_stmt): Likewise. + * tree-ssa-loop-ivopts.c (remove_statement): Likewise. + * tree-nrv.c (tree_nrv): Likewise. + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Likewise. + * tree-if-conv.c (tree_if_convert_cond_expr): Likewise. + (combine_blocks): Likewise. + * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Likewise. + * tree-cfgcleanup.c (cleanup_ctrl_expr_graph): Likewise. + (cleanup_control_flow): Likewise. + (remove_forwarder_block): Likewise. + * tree-ssa-pre.c (remove_dead_inserted_code): Likewise. + * tree-sra.c (sra_replace): Likewise. + * tree-ssa-forwprop.c (forward_propagate_into_cond): Likewise. + (forward_propagate_single_use_vars): Likewise. + * tree-ssa-dce.c (remove_dead_stmt): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + * tree-vect-transform.c (vect_transform_loop): Likewise. + * tree-outof-ssa.c (rewrite_trees): Likewise. + * tree-cfg.c (make_goto_expr_edges): Likewise. + (cleanup_dead_labels): Likewise. + (tree_merge_blocks, remove_bb, disband_implicit_edges): Likewise. + (bsi_move_before, bsi_move_after): Likewise. + (bsi_move_to_bb_end, try_redirect_by_replacing_jump): Likewise + (tree_redirect_edge_and_branch, tree_split_block): Likewise. + +2006-01-06 Andrew Pinski + + PR tree-opt/25528 + * tree-ssa-alias.c (find_used_portions): Handle REALPART_EXPR + and IMAGPART_EXPR. + * tree-flow-inline.h (var_can_have_subvars): Handle complex types + on non gimple variables. Also add checks at the top for decls and + mtags. + * tree-ssa-structalias.c (push_fields_onto_fieldstack): Handle + complex types. + * tree-ssa-operands.c (parse_ssa_operands): Handle REALPART_EXPR + and IMAGPART_EXPR for creating MUST_DEFs. + (get_expr_operands): Handle SSA_NAME, STRUCT_FIELD_TAG, TYPE_MEMORY_TAG, + and NAME_MEMORY_TAG separately from the DECLs. + +2006-01-06 Richard Guenther + + * tree-dfa.c (mark_new_vars_to_rename): Create stmt + annotation, if necessary. + * tree-ssa-pre.c (create_expression_by_pieces): Remove + redundant calls to update_stmt. + * tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): + Likewise. + +2006-01-05 Richard Henderson + + * c-parser.c (c_parser_objc_methodprotolist): Handle CPP_PRAGMA. + +2006-01-05 Carlos O'Donell + + * c-typeck.c: Update copyright date. + +2006-01-05 Carlos O'Donell + + * c-typeck.c (build_c_cast): Always warn when casting + from a pointer to an integer of different size, even if + the node was constant. + +2006-01-05 Richard Guenther + + PR tree-optimization/22555 + * tree-ssa-alias.c (create_overlap_variables_for): Do not give up, + if one structure field is an array. + * tree-ssa-operands.c (get_expr_operands): Continue scanning + operands even if we found a subvar, but ignore VOPs in this + case. + * tree-ssa-loop-ivopts.c (rewrite_use): Mark new vars in stmt + for renaming. + * tree-ssa-loop.c (pass_iv_optimize): Schedule TODO_update_ssa. + +2006-01-05 Richard Earnshaw + + PR middle-end/24998 + * arm/t-netbsd (LIB2FUNCS_EXTRA): Define. + +2006-01-05 Richard Guenther + Diego Novillo + + * tree-pass.h (TODO_remove_unused_locals): Define. + * gimple-low.c (expand_var_p, remove_useless_vars, + pass_remove_useless_vars): Remove. Update all users. + * tree-ssa-live.c (mark_all_vars_used_1): Handle SSA names. + (remove_unused_locals): New function. + * tree-flow.h (remove_unused_locals): Declare. + * passes.c (execute_todo): Call remove_unused_locals if + TODO_remove_unused_locals is set. + * tree-into-ssa.c (pass_build_ssa): Add TODO_remove_unused_locals. + * tree-ssa-dce.c (pass_dce): Likewise. + * tree-outof-ssa.c (pass_del_ssa): Likewise. + +2006-01-05 Richard Guenther + + * tree-flow.h (struct fieldoff): Decompose field to + type, size and decl. + * tree-ssa-alias.c (create_sft): Take type as parameter. + (create_overlap_variables_for): Store type, size and decl + in the fieldoff structure. + * tree-ssa-structalias.c (fieldoff_compare): Adjust users + of struct fieldoff. + (push_fields_onto_fieldstack): Likewise. + (create_variable_info_for): Likewise. Use offset for the + SFT name if the decl is not available. + +2006-01-04 Paul Brook + + * config/m68k/m68k.c (m68k_output_mi_thunk): Use jmp, not jsr. + +2006-01-04 Daniel Berlin + + * lambda-code.c (can_put_in_inner_loop): Relax + restrictions. + (can_put_after_inner_loop): New function. + (can_convert_to_perfect_nest): Use can_put_after_inner_loop as well. + (perfect_nestify): Change to make copies and modify uses. + +2006-01-04 Richard Henderson + + Merge from gomp branch: + * c-lex.c (c_lex_with_flags) : Smuggle pragma id + via integer constant. + (pragma_lex): Remove. + * c-pch.c (c_common_pch_pragma): Accept the name as an argument, + rather than parsing it. + * c-pragma.c (handle_pragma_weak, handle_pragma_redefine_extname, + handle_pragma_extern_prefix): Add %< %> quotes. + (registered_pragmas): New. + (c_register_pragma_1): New. + (c_register_pragma): Use it. + (c_register_pragma_with_expansion): Likewise. + (c_invoke_pragma_handler): New. + (init_pragma): Use cpp_register_deferred_pragma directly for + pch_preprocess. + * c-pragma.h (enum pragma_kind): New. + (pragma_handler): New. + (c_invoke_pragma_handler): Declare. + * c-common.c (c_parse_error): Pretty print CPP_PRAGMA and + CPP_PRAGMA_EOL. + * c-common.h (c_common_pch_pragma): Update decl. + * Makefile.in (c-parser.o): Update dependencies. + (GTFILES): Add c-pragma.h. + * c-parser.c (struct c_token): Add pragma_kind. + (struct c_parser): Add in_pragma. + (c_lex_one_token): Always initialize keyword and pragma_kind. + Extract data for CPP_PRAGMA. + (c_parser_peek_2nd_token): Deny CPP_PRAGMA_EOL. + (c_parser_consume_token): Don't allow CPP_PRAGMA unless errors. + Don't allow CPP_PRAGMA_EOL if in_pragma. + (c_parser_consume_pragma): New. + (c_parser_skip_until_found): Stop on CPP_PRAGMA_EOL. + (c_parser_skip_to_end_of_parameter): Likewise. + (c_parser_skip_to_end_of_block_or_statement): Likewise. + (c_parser_skip_to_pragma_eol): New. + (c_parser_external_declaration): Handle CPP_PRAGMA. + (c_parser_compound_statement_nostart): Likewise. + (c_parser_statement_after_labels): Likewise. + (c_parser_pragma): New. + (pragma_lex): Likewise. + (c_parser_pragma_pch_preprocess): New. + (c_parser_new): Merge into ... + (c_parse_file): ... here. Call c_parser_pragma_pch_preprocess. + +2006-01-04 Jeff Law + + PR ada/24994 + * tree-cfg.c (bsi_replace): Remove the original statement + from the EH throw statement table. + +2006-01-04 Jakub Jelinek + + * config/i386/pmm_malloc.h (posix_memalign): If __cplusplus, + make the prototype extern "C" and add throw (). + + PR target/25554 + * config/i386/i386.md (testqi_ext_3): Ensure len is positive + and pos non-negative and pos + len <= 32. + (testqi_ext_3_rex64): Ensure len is positive and pos non-negative, + drop pos + len < HOST_BITS_PER_WIDE_INT test. + (testqi_ext_3* splitter): Handle pos + len == HOST_BITS_PER_WIDE_INT. + + PR c/25559 + * c-common.c (handle_vector_size_attribute): Reject zero vector size + as well as sizes not multiple of component size. + + PR debug/25562 + * function.c (instantiate_expr): New function. + (instantiate_decls_1, instantiate_decls): If DECL_HAS_VALUE_EXPR_P, + walk its DECL_VALUE_EXPR with instantiate_expr. + + * dwarf2out.c (loc_descriptor_from_tree_1): Don't add + DW_OP_deref{,_size} if address isn't going to be added. + +2006-01-04 Ben Elliston + + * config/fp-bit.h: Use top-of-file comment from libgcc2.c. + * config/fp-bit.c: Likewise. + +2006-01-03 Daniel Berlin + + * dominance.c: Add comment about why we use DFS numbering + of dominance tree. + +2006-01-03 Jakub Jelinek + Richard Henderson + + Merge from gomp-branch: + * varasm.c (assemble_variable): Handle thread-local COMMON data. + * defaults.h (ASM_OUTPUT_TLS_COMMON): Define. + +2006-01-03 Paolo Bonzini + + PR rtl-optimization/25578 + * combine.c (combine_simplify_rtx, force_to_mode): Don't + pass a parameter to simplify_shift_const if changing ASHIFTRT + to LSHIFTRT. + +2006-01-03 Adrian Straetling + + * builtins.c (get_builtin_sync_mem): New function. + (expand_builtin_sync_operation, expand_builtin_compare_and_swap, + expand_builtin_lock_test_and_set, expand_builtin_lock_release): + Call get_builtin_sync_mem to generate mem rtx. + +2006-01-03 Richard Guenther + + PR c/25183 + * stmt.c (add_case_node): Make sure to clear overflow flags + from ranges. + +2006-01-03 Jakub Jelinek + + Merge from gomp-branch. + * config/sparc/sync.md: New file. + * config/sparc/sparc.md (UNSPECV_MEMBAR, UNSPECV_CAS, UNSPECV_SWAP, + UNSPECV_LDSTUB): New constants. + * config/sparc/sparc.c (sparc_expand_compare_and_swap_12): New function. + * config/sparc/predicates.md (memory_reg_operand): New predicate. + * config/sparc/sparc-protos.h (sparc_expand_compare_and_swap_12): New + prototype. + +2006-01-03 Roger Sayle + + * combine.c (reg_subword_p): New predicate to test whether the + destination of a set refers to a subword/piece of a register. + (try_combine): Generalize the code to merge the setting of a + pseudo to a constant followed by a set of a subword of that + register to a constant. + +2006-01-03 Kazu Hirata + + * basic-block.h (control_flow_graph): Change the type of + x_label_to_block_map to VEC(basic_block,gc) *. + * tree-cfg.c (init_empty_tree_cfg, label_to_block_fn, + set_bb_for_stmt): Adjust the uses of x_label_to_block_map. + + * tree-ssa-propagate.c (cfg_blocks): Change the type to + VEC(basic_block,heap) *. + (cfg_blocks_add, cfg_blocks_get, ssa_prop_init, + ssa_prop_fini): Adjust the uses of cfg_blocks. + +2006-01-03 Steven Bosscher + + * fold-const.c (operand_equal_p): Accept a NULL operand 0 for + COMPONENT_REFs. + * emit-rtl.c (mem_attrs_htab_eq): Use iterative_hash_expr for + hashing trees instead of a pointer hash. + (mem_attrs_htab_eq): Do a deep compare instead of a pointer + compare for MEM_EXPR. + + PR rtl-optimization/25130 + * cse.c (exp_equiv_p): Compare MEM_ATTRS instead of MEM_ALIAS_SET + when comparing MEMs for GCSE + +2006-01-03 Ben Elliston + + * targhooks.h (default_decimal_float_supported_p): Declare. + * targhooks.c (default_decimal_float_supported_p): Define. + * target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Redefine to + `default_decimal_float_supported_p'. + * doc/tm.texi (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Update. + +2006-01-02 Adam Nemet + + * combine.c (apply_distributive_law ): Check + TRULY_NOOP_TRUNCATION. + +2006-01-02 Geoffrey Keating + + * dwarf2out.c (have_switched_text_section): Delete. + (have_multiple_function_sections): New. + (have_location_lists): Make 'bool'. + (add_AT_loc_list): Use 'true' not '1'. + (dwarf2out_switch_text_section): Set have_multiple_function_sections. + (output_loc_list): Use have_multiple_function_sections. + (output_ranges): Likewise. + (dwarf2out_begin_function): Set have_multiple_function_sections if + necessary. + (dwarf2out_source_line): Don't fake separate_line_info_table_in_use. + Check function_section rather than DECL_SECTION_NAME. + (dwarf2out_finish): Use have_multiple_function_sections. + Don't clear have_location_lists. + +2006-01-02 Eric Botcazou + Jan Hubicka + + * cfglayout.c (fixup_reorder_chain): Remove kludge for the + case of conditional jump jumping to the next instruction. + * cfgrtl.c (force_nonfallthru_and_redirect): Accept all + cases of conditional jump jumping to the next instruction. + +2006-01-02 Jan Hubicka + + * i386.c (*_cost): Add COSTS_N_INSNS. + (ix86_rtx_costs): Do not use COSTS_N_INSNS. + +2006-01-02 Paolo Bonzini + + PR target/25259 + * Makefile.in (DECNUMINC): Include libdecnumber's build directory. + +2006-01-02 Volker Reichelt + + * config/arm/arm.c (all_fpus): Fix comment typo. + * config/darwin.c: Likewise. + * config/frv/frv.h (FRV_STRUCT_VALUE_REGNUM): Likewise. + * config/h8300/h8300.md (extendqisi2_h8300hs): Likewise. + * config/m68hc11/m68hc11.c (m68hc11_reload_operands): Likewise. + +2006-01-01 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_expand_compare_and_swapqhi): New. + (rs6000_split_compare_and_swapqhi): New. + * config/rs6000/sync.md (sync_compare_and_swap{hi,qi}): New. + (sync_compare_and_swapqhi_internal): New. + * config/rs6000/rs6000-protos.h: Declare. + diff --git a/contrib/gcc/ChangeLog.tree-ssa b/contrib/gcc/ChangeLog.tree-ssa new file mode 100644 index 00000000000..ddb8979f23b --- /dev/null +++ b/contrib/gcc/ChangeLog.tree-ssa @@ -0,0 +1,19338 @@ +2004-05-11 Diego Novillo + + * tree-cfg.c (delete_tree_cfg): Update call to + free_basic_block_vars. + +2004-05-10 Diego Novillo + + * tree-ssa-live.h: Fix typo in #include guard. + +2004-05-08 Jeff Sturm + + * tree-eh.c (lower_catch): Lower catch body in context of + catch_region. + +2004-05-07 Richard Henderson + + * tree-eh.c (tree_could_trap_p): Use get_base_address on references. + +2004-05-07 Diego Novillo + + * doc/invoke.texi: Remove documentation for -ftree-copyprop. + Update documentation for -ftree-pre. + +2004-05-06 Richard Henderson + + * stmt.c (parse_output_constraint): Don't warn for read-write + memory operand. + * gimplify.c (gimplify_asm_expr): Force in-out memory operands + to minimal lvalues, then expand to non-matching constraints. + +2004-05-06 Zack Weinberg + + * c-decl.c (finish_function): When !targetm.have_ctors_dtors, + record static constructors and destructors here... + (c_expand_body_1): ... not here. + * c-objc-common.c (start_cdtor, finish_cdtor): Collapse + together into + (build_cdtor): ...here. Update to construct a complete tree + for the function. No need to call push_scope, pop_scope, or + clear_last_expr, or set current_function_cannot_inline. + (c_objc_common_finish_file): Just call build_cdtor for static + ctors/dtors, then clear the variables. Do this before calling + cgraph_finalize_compilation_unit and cgraph_optimize. + +2004-05-06 Richard Henderson + + * fold-const.c (fold): Don't build COND_EXPR from comparisons for + boolean and integer result types. Handle X ^ X for TRUTH_XOR_EXPR. + +2004-05-05 Richard Henderson + + * tree-nested.c (create_tmp_var_for): Disallow variable sized types. + (convert_nonlocal_reference): Set val_only false for the base of a + component or array reference. + (convert_local_reference): Likewise. + +2004-05-05 Richard Henderson + + * gimplify.c (create_tmp_var): Disallow variable sized objects. + (gimplify_modify_expr): Don't memcpy for VA_ARG_EXPR. + +2004-05-05 Richard Henderson + + * fold-const.c (operand_equal_p): Replace only_const argument with + flags. Allow pure functions if OEP_PURE_SAME. + (fold, nondestructive_fold_binary_to_constant): Use OEP_ONLY_CONST. + * tree-cfg.c (phi_alternatives_equal): Fix operand_equal_p flag type. + * tree-ssa-dom.c (avail_expr_eq): Use OEP_PURE_SAME. + * tree.h (enum operand_equal_flag): New. + (operand_equal_p): Update argument list. + +2004-05-05 Richard Henderson + + * tree-ssa-operands.c (get_call_flags): Remove. + (get_expr_operands): Use call_expr_flags. + * tree-alias-common.c (call_may_clobber): Likewise. + (call_may_return): Likewise. + +2004-04-05 Andrew Pinski + + PR c/15062 + * c-typeck.c (build_asm_expr): Mark the output operands + to an asm addressable, if necessary. + +2004-05-05 Steven Bosscher + + * Makefile.in (GTFILES): Remove duplicate basic-block.h. + +2004-05-04 Richard Henderson + + * gimplify.c (build_addr_expr_with_type): Set TREE_ADDRESSABLE. + (gimplify_modify_expr): Turn variable-width assignment into memcpy. + * tree-nested.c (convert_local_reference): Set val_only after default. + +2004-05-04 Diego Novillo + + * tree-cfg.c (tree_cfg2vcg): Rename from tree_cfg2dot. Update all + users. + Emit flowgraph using VCG syntax. + * tree-dump.c (dump_files): Rename -fdump-tree-dot to + -fdump-tree-vcg. + * tree.h (enum tree_dump_index): Rename TDI_dot to TDI_vcg. + * doc/invoke.texi: Update documentation to describe + -fdump-tree-vcg. + +2004-05-03 Andrew Pinski + + * objc/objc-act.c (build_objc_string_object): + Add the fields to the purpose of the list for + the constructor. + +2004-05-03 Richard Henderson + + * c-simplify.c (gimplify_if_stmt): Loop for else-if. + +2004-05-03 Andrew Pinski + + PR optimization/15245 + * tree-ssa-phiopt.c (conditional_replacement): Use fold_convert + instead of convert. + +2004-05-03 Diego Novillo + + * gimplify.c (gimplify_compound_lval): Gimplify non-constant + array indices into a temporary variable. + +2004-04-30 Richard Henderson + + * builtins.c (validate_arglist): Don't reject side effects. + (simplify_builtin_strcpy): Do reject side effects in length. + +2004-04-30 Jeff Law + + * tree-outof-ssa.c (eliminate_build): Move code which verifies + that all of a PHI's arguments do not have a partition if the + result does not have a partition from here to... + (rewrite_trees): Here. + +2004-04-24 Zdenek Dvorak + + * tree-cfg.c (factored_computed_goto_label, + factored_computed_goto): Removed. + (disband_implicit_edges): Unfactor computed gotos without + using them. + +2004-04-23 Per Bothner + + * expr.c (expr_wfl_stack): Remove unused global. + + Pre-patches for future source_location / location_t merge. + * tree.h (EXPR_LOCATION, EXPR_HAS_LOCATION): New macros. + * expr.c (expand_expr_real, expand_expr_real_1): Use new macros. + * gimple-low.c (lower_stmt): Likewise. + * gimplify.c (annotate_all_with_locus): Likewise. + * print-tree.c (print_node): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + * tree-pretty-print.c (tree-pretty-print.c): Likewise. + * tree-sra.c (scalarize_structure_assignment, emit_scalar_copies, + scalarize_call_expr): Likewise. + * tree-ssa-pre.c (code_motion): Likewise. + +2004-04-23 Andrew Pinski + + * c-simplify.c (gimplify_decl_stmt) [TYPE_DECL]: + Do not check the type. + +2004-04-22 Jeff Law + + * tree-into-ssa.c (rewrite_initialize_block_local_data): Mark all + arguments as potentially unused. Do not bother to VARRAY_CLEAR + the block_defs. Instead abort if we are presented with a block + which has a nonempty block_defs. Wrap entire thing inside + #ifdef ENABLE_CHECKING. + * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Similarly + + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Do not mark + arguments to bypassed PHIs as needing to be rewritten. + +2004-04-21 Richard Henderson + + PR middle-end/14978 + * tree-nested.c (convert_nonlocal_reference): Set val_only when + processing any otherwise unhandled expression. + +2004-04-21 Jeff Law + + * tree-ssa-copy.c (cprop_operand): Break out of cprop_into_stmt. + (cprop_into_stmt): Use cprop_operand. Rearrange slightly to avoid + switch statement inside a loop. + + * tree-flow.h (var_ann_d): Add "current_def" field. + (register_new_def): Lose last argument (currdefs table). + * tree-into-ssa.c (currdefs): Remove. + (rewrite_into_ssa): Initialize current_def field on each variable's + annotation. Remove initialization/clearing of currdefs. + (set_value_for, get_value_for): Kill. + (rewrite_initialize_block): Update call to register_new_def. + (rewrite_stmt): Similarly. + (rewrite_finalize_block): Get/set a _DECL node's current + definition from its annotation. + (get_reaching_def): Similarly. + (register_new_def): Similarly. Lose last argument. + * tree-ssa-dom.c (currdefs): Remove. + (get_value_for, set_value_for): Simplify. + (tree_ssa_dominator_optimize): Initialize current_def on each + variable's annotation. Remove initialization/clearing of currdefs. + (thread_across_edge): Lose unnecessary argument to register_new_def. + (record_equivalences_from_phis): Likewise. + (register_definitions_for_stmt): Likewise. + (restore_currdefs_to_original_value): Get/set a _DECL node's current + definition from its annotation. Lose unnecessary "table" argument. + (dom_opt_finalize_block): Corresponding changes. + + * tree-dfa.c (free_df_for_stmt): Release memory back to the GC + system immediately. + +2004-04-21 Ben Elliston + + PR middle-end/14730 + * expr.c (expand_expr_real_1) : Discard out of bounds + case label values and ranges. Saturate case range values that + exceed the minimum or maximum permitted value for the controlling + expression type to TYPE_MIN_VALUE or TYPE_MAX_VALUE. + +2004-04-20 Jeff Law + + * tree-into-ssa.c (register_new_def): Avoid pushing useless + information onto the block local definition stack. + + * tree-into-ssa.c (register_new_def): If there is no current + reaching definition for SSA_NAME_VAR (DEF), then just push + SSA_NAME_VAR (DEF) onto the stack. + (rewrite_finalize_block): If we pop a _DECL node from the stack, + then the _DECL node has no current reaching definition. + * tree-ssa-dom.c (restore_currdefs_to_original_value): Similarly. + +2004-04-19 Jeff Law + + * tree-ssa-dom.c: Reinstate all changes from 2004-04-12. + (lookup_avail_expr): Do not access a hash table object after + it has been freed. + +2004-04-19 Daniel Berlin + + * doc/passes.texi: Add blurb about PRE. + +2004-04-19 Andrew Pinski + + * tree-ssa-phiopt.c (conditional_replacement): + Catch some more non-gimple. + +2004-04-19 Jan Hubicka + + * predict.c (combine_predictions_for_bb): Fix pasto. + +2004-04-18 Jan Hubicka + + * tree-inline.c (estimate_num_insn_1): Deal properly with + builtin_constant_p and builtin_expect. + +2004-04-17 Andrew MacLeod + + * doc/invoke.texi (tree-ter, tree-lrs): Document options. + +2004-04-17 Paul Brook + + * Makefile.in: Set GMPLIBS and GMPINC. + * configure.ac: Add GMPLIBS and GMPINC. + * configure: Regenerate. + +2004-04-16 Andrew MacLeod + + * common.opt (ftree-lrs): New common option. + * flags.h (flag_tree_live_range_split): New flag. + * opts.c (decode_options): Turn on LRS by default. + (common_handle_option): Set LRS flag to specified value. + * toplev.c (flag_tree_live_range_split): Initialize. + (lang_independent_options f_): Add tree-lrs. + * tree-outof-ssa.c (rewrite_out_of_ssa): Use LRS flag. + * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't coalesce + variables if one is a hardware register. Coalesce inlined user vars. + (rename_ssa_copies): Scan blocks first, then PHI nodes. + +2004-04-15 Andrew Pinski + + * builtins.c (fold_builtin_isascii): Do not return non-gimple + code when we are in gimple form. + (fold_builtin_isdigit): Do not return non-gimple + code when we are in gimple form. + + * c-simplify.c (gimplify_decl_stmt): Handle TYPE_DECL. + +2004-04-14 Paul Brook + + * Makefile.in (GMPLIBS, GMPINC): Don't set. + * configure.ac: Remove checks for GMP. + * configure: Regenerate. + +2004-04-13 Diego Novillo + + * fold-const.c, tree-ssa-ccp.c, tree-ssa-dom.c, + tree-ssa.c, tree.c: Replace all uses of TREE_UNSIGNED with + TYPE_UNSIGNED or DECL_UNSIGNED. + + * c-semantics.c (build_stmt): Don't check type nodes for + side effects. + +2004-04-13 Jeff Law + + * tree-ssa-dom.c: Revert all changes from 2004-04-12. + +2004-04-12 Jeff Law + + * tree-ssa-dom.c (struct expr_hash_elt): Add new field for hash value. + (initialize_hash_element): New LHS argument. Callers changed. + Initialize the hash value field. + (remove_local_expressions_from_table): Use htab_remove_elt_with_hash. + (update_rhs_and_lookup_avail_expr): Similary. + (lookup_avail_expr): Use htab_find_slot_with_hash. Simplify slightly + and pass LHS to initialize_hash_element. + (record_cond): Also use htab_find_slot_with_hash. Initialize the + hash table entry with initialize_hash_element. + (avail_expr_eq): Use the saved hash value rather than calling into + the hash functions again. + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Slightly rearrange + code to clear tables before each iteration to be clearer. + + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Use + DEF_OPS and VDEF_OPS instead of STMT_DEF_OPS and STMT_VDEF_OPS. + +2004-04-12 Diego Novillo + + * flags.h (flag_tree_loop): Remove. Update all users. + * opts.c (common_handle_option) : Remove. + * toplev.c (f_options): Remove -ftree-loop-optimize. + * tree-optimize.c (init_tree_optimization_passes): Don't + schedule pass_loop. + * tree-ssa-loop.c (tree_ssa_loop_opt): Remove. + (gate_loop): Remove. + * doc/invoke.texi: Remove documentation for -ftree-loop-optimize. + +2004-04-12 Diego Novillo + + * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove. + * c-semantics.c (expand_stmt_toplev): Remove. + * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_INITIALIZER): Remove. + (LANG_HOOKS_RTL_EXPAND_START): Remove. + (LANG_HOOKS_RTL_EXPAND_STMT): Remove. + (LANG_HOOKS_RTL_EXPAND_END): Remove. + * langhooks.h (struct lang_hooks_for_rtl_expansion): Remove. + (struct lang_hooks): Update. + * tree-optimize.c (tree_rest_of_compilation): Don't call + lang_hooks.rtl_expand.start nor lang_hooks.rtl_expand.end. + Call expand_expr_stmt_value instead of + lang_hooks.rtl_expand.stmt. + * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove. + + +2004-04-12 Richard Henderson + + * c-common.c (c_do_switch_warnings): Use EXPR_LOCUS instead + of STMT_LINENO. + (c_walk_subtrees): Likewise. + (c_estimate_num_insns_1): Remove FILE_STMT. + * c-common.def (FILE_STMT): Remove. + * c-common.h (FILE_STMT_FILENAME_NODE): Remove. + (FILE_STMT_FILENAME, STMT_LINENO, STMT_LINENO_FOR_FN_P): Remove. + (c_common_stmt_codes): Remove FILE_STMT. + * c-dump.c (dump_stmt): Use EXPR_LOCUS instead of STMT_LINENO. + * c-parse.in (lineno_stmt, lineno_label): Likewise. + * c-pretty-print.c (pp_c_statement): Remove FILE_STMT. + * c-semantics.c (add_stmt): Don't emit FILE_STMT. Do set + EXPR_LOCUS if not yet set. + (finish_stmt_tree): Don't set line for end of function. + (build_stmt): Set EXPR_LOCUS instead of STMT_LINENO. + (prep_stmt): Use EXPR_LOCUS instead of STMT_LINENO. + * c-simplify.c (c_gimplify_stmt): Remove FILE_STMT. + (gimplify_block): Save and restore entire locus. + (stmt_expr_last_stmt): Use EXPR_LOCUS instead of STMT_LINENO. + * doc/c-tree.texi (FILE_STMT, FILE_STMT_FILENAME, STMT_LINENO): Remove. + +2004-04-12 Jeff Law + + * tree-ssa-dom.c (true_exprs, false_exprs): Kill. + (struct expr_hash_elt): New structure for the expression hash table. + (struct dom_walk_block_data): Kill block local true_exprs and + false_exprs. + (get_eq_expr_value): One less local varray argument. Fix prototype. + Use record_cond rather than record_cond_is_{true,false}. + (true_false_expr_hash, true_false_expr_eq): Kill. + (record_cond_is_true, record_cond_is_false): Collapse into ... + (record_cond): New function. + (tree_ssa_dominator_optimize): Kill references to true_exprs and + false_exprs. Use "free" as the free function for the avail_exprs + hash table. + (dom_opt_initialize_block_local_data): No longer initialize + block local true/false expressions. + (initialize_hash_element): New function. + (remove_local_expressions_from_table): Use initialize_hash_element. + (update_rhs_and_lookup_avail_expr): Similarly. + (dom_opt_finalize_block): Record true/false expressions into the + main avail_expr hash table. Unwind main hash table appropriately. + Use record_cond rather than record_cond_is_{true,false}. + (record_equivalences_from_incoming_edge): Pass block local avail_exprs + varray instead of block local true/false varrays to get_eq_expr_value. + (dump_dominator_optimization_stats): Update to reflect that the + true/false expression hash tables are gone. + (lookup_avail_expr): Simplify slightly now that we only have one + expression hash table. + (avail_expr_hash, avail_expr_eq): Generalize slightly to handle new + hash table entry structure and having true/false expression information + in the available expression hash table. + +2004-04-09 Jeff Law + + * tree-ssa_dom.c (register_definitions_for_stmt): Accept a statement + annotation rather than the statement itself. Callers changed. + Use [V]DEF_OPS rather than STMT_[V]DEF_OPS. + * tree-ssa-operands.c (get_stmt_operands): Slightly reorganize to + avoid unnecessary calls to stmt_ann. + * tree-ssa-pre.c (expr_phi_insertion): Get the statement's annotation + and use [V]USE_OPS rather than STMT_[V]USE_OPS. + (same_e_version_phi_result): Similarly + (process_left_occs_and_kills): Similarly for [V]DEF_OPS and + STMT_[V]DEF_OPS. + * tree-ssa.c (replace_immediate_uses): Similarly. + (verify_ssa): Similarly. Also verify that VDEF_OPs uses are dominated + by their sets. + + * tree-into-ssa.c (insert_phi_nodes_for): Use passed in worklist + varray instead of allocated one for every variable we rewrite into + SSA form. + (insert_phi_nodes_1): Pass worklist varray from caller to + insert_phi_nodes_for. + (insert_phi_nodes): Allocate a worklist for insert_phi_nodes_for + and pass it to insert_phi_nodes_1. + +2004-04-08 Jeff Law + + * tree-ssa-dom.c (nonzero_vars): Turn it into a bitmap. + (tree_ssa_dominator_optimize): Update initialization, clearing and + freeing of nonzero_vars. + (restore_nonzero_vars_to_original_value): New function. + (dom_opt_finalize_block): Use it. + (record_var_is_nonzero): Only record the variable into the block + local nonzero vars array if it did not already have a nonzero property. + (lookup_avail_expr): Lookup the nonzero property of an SSA_NAME with + a bitmap test. + + * fold-const.c (fold): Remove attempt to share code which + simplifies tests against the highest/lowest value of a + range between the main folder and the nondestructive folder. + +2004-04-08 Brian Booth + Diego Novillo + + * tree-into-ssa.c (invalidate_name_tags): New function. + Mark aliases of invalidated name tags for renaming. + (rewrite_into_ssa): Call invalidate_name_tags. + +2004-04-07 Diego Novillo + + * gimplify.c (gimplify_call_expr): Remove argument POST_P. + Update all callers. + Don't use POST_P when gimplifying the call expression. + +2004-04-07 Diego Novillo + + * doc/tree-ssa.texi: Add documentation for the dominator + walker. + +2004-04-07 Andrew MacLeod + + * tree-outof-ssa.c: Update comments and reformat for legibility. + * tree-ssa-copyrename.c: Update comments and reformat for legibility. + * tree-ssa-live.c: Update comments and reformat for legibility. + * tree-ssa-live.h: Update comments and reformat for legibility. + +2004-04-07 Diego Novillo + + * gimplify.c (gimplify_call_expr): Don't use POST_P when + gimplifying CALL_EXPR arguments. + +2004-04-06 Diego Novillo + + * tree-dfa.c: Update comments and reformat for legibility. + (find_vars_r): Remove special casing of MODIFY_EXPR and + simplify logic. + (compute_reached_uses, compute_reaching_defs, remove_decl, + find_decl_location): Remove. + (discover_nonconstat_array_refs_r, + discover_nonconstant_array_refs): Move ... + * tree-outof-ssa.c: ... here. + +2004-04-05 Richard Henderson + + * tree-simple.c (is_gimple_min_invariant): Disallow &a+i. + * tree-ssa-ccp.c (maybe_fold_stmt_addition): Rename from + maybe_fold_stmt_plus. Handle MINUS_EXPR. + (fold_stmt_r): Pass MINUS_EXPR to it. + +2004-04-05 Ben Elliston + + * Makefile.in (OBJS-common): Remove tree-browser.o. + (cc1): Depend on @TREEBROWSER@ and include in list of objects. + * configure.ac: Add --enable-tree-browser option. + * configure: Rebuild. + +2004-04-05 Andrew Pinski + + * tree-ssa-ccp.c (fold_stmt_r): Fix whitespace formatting. + (set_rhs): Likewise. + +2004-04-03 Paolo Bonzini + Diego Novillo + + * tree-alias-common.c (find_func_aliases): Support + assigning to BIT_FIELD_REFs. + * tree-cfg.c (verify_expr): Don't allow assign to + a register with BIT_FIELD_REF. + * tree-dfa.c (get_virtual_var): Add consistency check on + the shape of expected VARs. + (discover_nonconstant_array_refs_r): Go through BIT_FIELD_REFs. + * tree-simple.c: Document that BIT_FIELD_REFs are valid lvalues. + * tree-ssa.c (set_is_used): Go through BIT_FIELD_REFs. + * tree-ssa-operands.c (get_expr_operands): Mark VA_ARG_EXPR + nodes as making volatile references. + +2004-04-02 Fariborz Jahanian + + * c-convert.c (convert): Make convert work when converting + to compatible types across translation unit. + +2004-04-02 Andrew Pinski + + * Makefile.in (stage2_build): Remove support for + rebuilding libbanshee. + * configure.ac: Remove support for rebuilding + libbanshee. + * config.gcc (powerpc-*-darwin*): Do not rebuild + libbanshee. + +2004-04-01 Kazu Hirata + + * tree-ssa-forwprop.c: Add a comment about forward propagation + of TRUTH_NOT_EXPR. + +2004-04-01 Diego Novillo + + * tree-optimize.c (tree_rest_of_compilation): Fix typo in + setting of in_gimple_form. + +2004-04-01 Jeff Law + + * fold-const.c (fold_relational_hi_lo): Do not return non-gimple + code when we are in gimple form. + * tree-optimize.c (tree_rest_of_compilation): Note when we are in + gimple form. + * tree-ssa-ccp.c (ccp_fold): Tighten tests on return value from + nondestructive_fold_{unary,binary}_to_constant. + * tree.h (in_gimple_form): Declare. + + * tree-ssa.c (ssa_remove_edge): Correct looping structure. + (ssa_redirect_edge): Similarly + +2004-03-30 Brian Booth + + * tree-pretty-print.c (dump_vops): Add flags argument and + propagate it to dump_generic_node calls. + (dump_generic_node): Update dump_vops call. + +2004-03-29 Diego Novillo + + * configure.ac: Emit confirmation messages for libbanshee. + * configure: Regenerate. + +2004-03-29 Jan Hubicka + + PR 14756 + * cgraphunit.c (cgraph_decide_inlining): Rewrite handling of + always_inline functions. + +2004-03-28 Jan Hubicka + + * tree-inline.c (expand_call_inline): Remove fixme introduced by + nested function patch. + +2004-03-26 Diego Novillo + + * tree-ssa-operands.c (get_stmt_operands): Remove always-true + predicate. + + * tree-ssa-alias.c (maybe_create_global_var): Create + .GLOBAL_VAR if there are no call-clobbered variables. + * tree-ssa-operands.c (get_stmt_operands): Add call-clobbering + VDEFs for asm ("":::"memory") if there are call-clobbered + variables or if .GLOBAL_VAR has been created. + + +2004-03-26 Diego Novillo + + * passes.c (rest_of_compilation): Re-enable .01.rtl + dumps. + +2004-03-25 Diego Novillo + + * tree-pretty-print.c (dump_generic_node) : Remove. + * tree-inline.c (estimate_num_insns_1) : Remove. + * fold-const.c (fold_relational_hi_lo): Change type of argument + 'type_p' to const tree and rename it to 'type'. Update + all callers. + +2004-03-25 Diego Novillo + + * Makefile.in (C_AND_OBJC_OBJS): Remove c-call-graph.o + (c-call-graph.o): Remove. + * c-call-graph.c: Remove. + * c-tree.h (print_call_graph): Remove. + (debug_call_graph): Remove. + * tree-cfg.c: Update/add comments everywhere. + (pre_insert_on_edge): Rename from bsi_insert_on_edge_immediate. + * tree-flow.h (build_tree_cfg): Make static. + (tree_cfg2dot): Likewise. + (verify_stmt): Likewise. + * tree-ssa-pre.c (insert_one_operand): Call pre_insert_on_edge. + +2004-03-25 Diego Novillo + + * tree-ssa-alias.c (struct alias_info): Change type of field + 'num_references' to varray_type. Update all users. + +2004-03-24 Jeff Law + + * c-mudflap (mflang_flush_calls): Use push_scope/pop_scope instead + of pushlevel and poplevel. + +2004-03-23 Richard Henderson + + PR middle-end/14694 + * c-common.c (handle_alias_attribute): Mark aliased variables + to be TREE_STATIC. + +2004-03-23 Jeff Law + + * tree-into-ssa.c (register_new_def): Lose unnecessary VAR argument, + instead derive VAR from DEF argument. + (rewrite_initialize_block, rewrite_stmt, rewrite_operand): Corresponding + changes. + * tree-ssa-dom.c (register_definitions_for_stmt): Corresponding changes. + (record_equivalences_from_phis): Likewise. + (restore_currdefs_to_original_value): New, extracted from ... + (dom_opt_finalize_block): Use restore_currdefs_to_original_value. + Restore currdefs after threading across a true edge. + (thread_across_edge): Register new defintions when we walk through + a PHI node or real statement. + * tree-flow.h (register_new_def): Updated. + +2004-03-23 Zdenek Dvorak + + * tree-ssa-dce.c (find_obviously_necessary_stmts, + perform_tree_ssa_dce): Do not remove loops. + +2004-03-19 Diego Novillo + + PR optimization/14643 + * tree-ssa-alias.c (group_aliases_into): Don't add a variable + to its own may-alias set. + (create_alias_map_for): New. + (setup_pointers_and_addressables): Call it. + Fix allocation of AI->ADDRESSABLE_VARS and AI->POINTERS. + If there are no addressable variables and more than one + dereferenced pointers, add type tags to the ADDRESSABLE_VARS + array. + (get_tmt_for): Add comment about using alias set equality when + checking for existing tags. + +2004-03-19 Kazu Hirata + + * fold-const.c (fold_relational_const): Remove dead code. + +2004-03-19 Dale Johannesen + + * tree-ssa-dse.c (dse_optimize_stmt): Redirect uses feeding into + a deleted store correctly. + +2004-03-19 Jeff Law + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Fix typo. + Eliminate unnecessary test of VAL. + + * tree-dfa.c (find_hidden_use_vars): Also look inside the + PENDING_SIZES list for hidden uses. + * tree-optimize.c (tree_rest_of_compilation): Expand used variables + before setting up parameters. + * tree-ssa-copyrename.c (rename_ssa_copies): Do nothing for copies + where the LHS has a hidden use. + +2004-03-18 Diego Novillo + + * Makefile.in (TREE_FLOW_H): Reformat. + (OBJS-common): Add tree-into-ssa.o and tree-outof-ssa.o. + (tree-ssa.o): Remove dependency on domwalk.h and tree-ssa-live.h + (tree-into-ssa.o): New. + (tree-outof-ssa.o): New. + (GTFILES): Remove tree-ssa.c. + (gt-tree-ssa.h): Remove. + * tree-into-ssa.c: New file. + Move all the functions used to rename into SSA from tree-ssa.c. + Update/add comments. + Remove unused variables and structures. + Don't use GGC for memory allocation. + * tree-outof-ssa.c: New file. + Move all the functions used to rename out of SSA from + tree-ssa.c. + Update/add comments. + * tree-ssa-alias.c (compute_points_to_and_addr_escape): Add + bibliographic reference. + +2004-03-18 Jeff Law + + * Makefile.in (tree-tailcall.o): Depend on langhooks.h. + * tree-tailcall.c: Include langhooks.h. + (find_tail_calls): Use types_compatible_p langhook instead of + equality test of TYPE_MAIN_VARIANT. + + * tree-nested.c (get_chain_decl): Mark the chain decl with + TREE_NO_WARNING. + +2004-03-18 Devang Patel + + * tree-ssa-live.c (new_tree_live_info): Set num_blocks to + last_basic_block instead of n_basic_blocks. + (calculate_live_on_entry): Use last_basic_block instead of + n_basic_blocks. + (calculate_live_on_exit): Same. + +2004-03-17 Jeff Law + + * tree-tailcall.c (find_tail_calls): Tighten test for tail recursion. + +2004-03-17 Diego Novillo + + PR optimization/14511 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Do not + ignore read-only variables. + (may_alias_p): Fix pointer-to-var calculation when 'var' is an + array. + +2004-03-17 Jan Hubicka + + * tree-ssa.c (rewrite_into_ssa, compute_global_livein): Fix. + +2004-03-17 Paolo Bonzini + + * builtins.c (expand_builtin_constant_p, + purge_builtin_constant_p): Remove. + (expand_builtin): Expand __builtin_constant_p to zero. + * function.c (struct function): Remove calls_constant_p. + (current_function_calls_constant_p): Remove. + * passes.c (rest_of_handle_gcse): Do not run + purge_builtin_constant_p. + * rtl.def (CONSTANT_P_RTX): Die die die. + + * cse.c (fold_rtx): Do not handle CONSTANT_P_RTX. + * expr.c (emit_move_insn): Likewise. + * gcse.c (want_to_gcse_p, gcse_constant_p): Likewise. + * genrecog.c (validate_pattern): Likewise. + * recog.c (immediate_operand): Likewise. + * rtl.h (CONSTANT_P): Likewise. + * simplify-rtx.c (simplify_rtx): Likewise. + * config/alpha/alpha.c (input_operand): Likewise. + * config/arm/arm.c (THUMB_LEGITIMATE_CONSTANT_P): Likewise. + * config/c4x/c4x.c (const_operand): Likewise. + * config/cris/cris.c (cris_gotless_symbol, + cris_got_symbol): Likewise. + * config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Likewise. + * config/ia64/ia64.c (gr_reg_or_5bit_operand, + gr_reg_or_6bit_operand, gr_reg_or_8bit_operand, + gr_reg_or_8bit_adjusted_operand, + gr_reg_or_8bit_and_adjusted_operand, + gr_reg_or_14bit_operand, gr_reg_or_22bit_operand, + shift_count_operand, shift_32bit_count_operand): Likewise. + * config/m32r/m32r.c (move_src_operand): Likewise. + * config/mips/mips.c (mips_const_insns): Likewise. + * config/mmix/mmix.c (mmix_constant_address_p): Likewise. + * config/pa/pa.c (move_src_operand): Likewise. + * config/rs6000/rs6000.c (input_operand): Likewise. + * config/sparc/sparc.c (input_operand): Likewise. + * config/v850/v850.c (movsi_source_operand): Likewise. + * config/xtensa/xtensa.c (move_operand, + xtensa_emit_move_sequence): Likewise. + * config/ia64/ia64.h (PREDICATE_CODES): Do not mention CONSTANT_P_RTX. + * config/pa/pa.h (PREDICATE_CODES): Likewise. + +2004-03-16 Diego Novillo + + * tree-dump.c (struct dump_option_value_info): Add TDF_UID. + * tree.h (TDF_UID): Define. + * doc/invoke.texi: Document -ftree-dump-...-uid. + * tree-pretty-print.c (debug_generic_expr): Add TDF_UID. + (debug_generic_stmt): Likewise. + (dump_decl_name): New function. + (dump_generic_node): Call it. + (print_declaration): Add new argument 'flags'. Update all users. + (print_struct_decl): Likewise. + * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c, + tree-nrv.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-ccp.c, + tree-ssa-copy.c, tree-ssa-dom.c, tree-ssa-dse.c, + tree-ssa-forwprop.c, tree-ssa-operands.c, tree-ssa-pre.c, + tree-ssa.c, tree-tail-call.c: Call print_generic_* with + 'dump_flags'. + +2004-03-16 Dale Johannesen + + * Makefile.in (tree-ssa-phiopt.o): add langhooks.h dependency. + (tree-nrv.o): Ditto. + (tree-ssa-copy.o): Ditto. + (tree-ssa-dom.o): Ditto. + (tree-ssa-ccp.o): Ditto. + * c-common.c: Add #include hashtab.h. + (c_type_hash): New. + (c_common_get_alias_set): Handle multiple type nodes referring + to "the same" type, currently for C90 only. + * c-decl.c (current_file_decl): Move to toplev.c. + * c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to + c_types_compatible_p. + (c_types_compatible_p): New. + * c-tree.h (c_types_compatible_p): New declaration. + * c-typeck.c (tagged_types_tu_compatible_p): Allow for + compiler-generated TYPE_DECLs without a DECL_ORIGINAL_TYPE. + * gimplify.c (canonicalize_addr_expr): Use types_compatible_p langhook. + (cpt_same_type): Ditto. + * langhooks-def.h (lhd_types_compatible_p): New declaration. + LANG_HOOKS_TYPES_COMPATIBLE_P: New. + * langhooks.c (lhd_types_compatible_p): New. + * langhooks.h (struct lang_hooks): Add types_compatible_p. + * stmt.c (tail_recursion_args): Use types_compatible_p langhook. + * toplev.c (current_file_decl): New, moved from c-decl.c. + * tree-nrv.c: Include langhooks.h. + (tree_nrv): Use types_compatible_p langhook. + * tree-ssa-ccp.c: Include langhooks.h. + (maybe_fold_offset_to_array_ref): Use types_compatible_p langhook. + (maybe_fold_offset_to_component_ref): Ditto (2 places). + (fold_stmt_r): Make sure rhs of COMPONENT_REF is in lhs type. + * tree-ssa-copy.c: Include langhooks.h. + (cprop_into_stmt): Use types_compatible_p langhook. + * tree-ssa-dom.c: Include langhooks.h. + (avail_expr_p): Use types_compatible_p langhook. + * tree-ssa-phiopt.c: Include langhooks.h. + (conditional_replacement): Use types_compatible_p langhook. + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Use + types_compatible_p langhook. + * tree.h (current_file_decl): New declaration. + +2004-03-16 Dale Johannesen + + PR optimization/14498 + * gimplify.c (copy_if_shared_r): Mark VA_ARGS_EXPRs as volatile. + (mark_decls_volatile_r): Moved higher in file (unchanged). + +2004-03-16 Daniel Berlin + + PR optimization/14562 + * tree-ssa-pre.c (generate_expr_as_of_bb): Don't use names_match_p. + (generate_vops_as_of_bb): Ditto. + +2004-03-12 Diego Novillo + + PR optimization/14553 + * tree-ssa.c (replace_immediate_uses): Call propagate_value to + update operands. + +2004-03-12 Diego Novillo + + * tree-alias-common.c (create_alias_vars): Add #if + HAVE_BANSHEE around test for PTA_ANDERSEN. + +2004-03-11 Diego Novillo + + * tree-dfa.c (struct walk_state): Remove fields 'is_store' and + 'is_indirect_ref'. Update all users. + * tree-flow.h (struct var_ann_d): Remove fields 'is_stored', + 'is_dereferenced_store' and 'is_dereferenced_load'. Update + all users. + * tree-simple.c (get_base_address): Handle BIT_FIELD_REF. + * tree-ssa-alias.c (struct alias_info): Add fields + 'written_vars', 'dereferenced_ptrs_store' and + 'dereferenced_ptrs_load'. + (init_alias_info): Initialize them. + (delete_alias_info): Free them. + (find_ptr_dereference): New. + (ptr_is_dereferenced_by): Call it. + Add new argument 'is_store'. Set to true if the + expression is an indirect store operation. + (compute_points_to_and_addr_escape): If the statement + makes a store, load or write operation, update the + corresponding bitmap. + (compute_flow_insensitive_aliasing): Test the + 'written_vars' bitmap to determine if alias sets should + be computed. + (setup_pointers_and_addressables): Always assume that + volatile pointers and hidden pointers have been used in a + memory store operation. + * tree-ssa-operands.c (add_stmt_operand): Do add an + operand for may-aliased variables before computing + aliases. + +2004-03-11 Zdenek Dvorak + + * tree-optimize.c (init_tree_optimization_passes): Move + pass_tail_recursion and pass_ch after pass_may_alias. + * tree-ssa-loop.c (mark_defs_for_rewrite): Mark type tags + for rewriting. + * tree-ssa.c (mark_def_sites): Process the operand of a + VDEF before the result. + +2004-03-11 Richard Henderson + + PR 14204 + * tree-ssa.c (warn_uninit): Don't warn for hard register variables. + +2004-03-10 Richard Henderson + + * tree-simple.c (get_base_var, get_base_decl): Remove. + * tree-simple.h: Likewise. + * tree-dfa.c (discover_nonconstant_array_refs_r): Use get_base_address. + * tree-ssa-alias.c (ptr_is_dereferenced_by): Likewise. + (add_pointed_to_var, is_escape_site): Likewise. + * tree-ssa-ccp.c (get_default_value): Expect only SSA_NAME and DECLs. + * tree-ssa-operands.c (add_stmt_operand): Likewise. + (note_addressable): Use get_base_address. + * tree-ssa-dce.c (need_to_preserve_store): Expect only SSA_NAME. + * tree-ssa.c (set_is_used): Inline get_base_decl. + +2004-03-10 Richard Henderson + + * tree-nested.c (convert_nonlocal_reference): Clear TREE_INVARIANT + on modified ADDR_EXPRs. + +2004-03-10 Andrew Pinski + + * Makefile.in (tree-ssa-forwprop.o): Fix the dependences. + +2004-03-09 Jeff Law + + * tree-flow-inline.h (may_propagate_copy): Do not allow propagation of + a constant for a virtual operand. + +2004-03-08 Richard Henderson + + * calls.c (initialize_argument_information): Add + parameter may_tail_call. Set to false for invisible + pass-by-reference arguments that require stack + allocation. + Update all users. + +2004-03-07 Jeff Law + + * tree-ssa-dom.c: (get_eq_expr_value): Fix typo when comparing a + boolean against a constant. + * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Do not + record the same SSA_NAME more than once. Only record the SSA_NAME + tested, not the COND_EXPR. + (substitute_single_use_vars): Substitute booleans which are + set from a TRUTH_NOT_EXPR even if they have more than one use site. + +2004-03-05 Jeff Law + + * tree-ssa-dce.c (remove_dead_stmt): Clear PENDING_STMT after + redirect_edge_and_branch call. + + * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Also + record COND_EXPRs with single use vars defined by SSA_NAME + CONST + expressions. + (substitute_single_use_vars): Corresponding changes to rewrite + COND_EXPRs using single use vars defined by SSA_NAME + CONST + expressions. + +2004-03-05 Ulrich Weigand + + * config/s390/s390.c (s390_expand_movstr): Do not use + expand_exit_loop_top_cond, manually copy loop header. + (s390_expand_clrstr): Likewise. + (s390_expand_cmpmem): Likewise. + +2004-03-04 Diego Novillo + + * tree-ssa-alias.c (compute_flow_sensitive_aliasing): If + a name tag has been marked call-clobbered, also mark the + corresponding type tag. + +2004-03-04 Zdenek Dvorak + + * tree-ssa-loop-live.c (coalesce_tpa_members): Update the root + variable of the partition. + +2004-03-04 Jeff Law + + * tree-ssa-dce.c (remove_dead_stmt): Redirect an existing edge + rather than deleting the old ones and creating a new one when + removing a dead conditional. + + * fold-const.c (fold): When rebuilding the expression after a + call to fold_relational_hi_lo, make sure to convert the type of + the second argument to the type of the first. + +2004-03-04 Diego Novillo + + * cgraphunit.c (cgraph_optimize): Do not do memory release + check if there have been errors. + +2004-03-03 Jeff Law + + * tree-ssa-phiopt.c (conditional_replacement): Clear EDGE_TRUE_VALUE + and EDGE_FALSE_VALUE on the remaining edge after eliminating a PHI. + +2004-03-03 Andrew MacLeod + + * tree-ssa-copyrename.c (gate_copyrename): Really check it in. + * tree-ssa.c (create_temp): Use DECL_ARTIFICIAL from original decl. + +2004-03-02 Zdenek Dvorak + + * tree-tailcall.c (struct tailcall): Remove return_block and return_bsi + fields, add m and a fields. + (m_acc, a_acc): New. + (find_tail_calls): Find tail calls on whose results simple operations + are performed. + (independent_on_stmt_p, process_assignment, + propagate_through_phis, adjust_accumulator_values, + adjust_return_value): New. + (eliminate_tail_call): Update the accumulators if needed. + (optimize_tail_call): Do not create phis. + (tree_optimize_tail_calls): Create phis and accumulators as needed. + Adjust return values. + +2004-03-02 Diego Novillo + + * tree-ssa-operands.c (get_expr_operands): Mark CALL_EXPRs + with has_volatile_ops if aliases haven't been computed yet. + (add_stmt_operand): Use 'true' instead of '1'. + +2004-03-02 Diego Novillo + + PR optimization/14266 + * tree-ssa-alias.c (create_global_var): Mark GLOBAL_VAR for + renaming. + +2004-03-01 Richard Henderson + + * tree.c (associative_tree_code): Remove MINUS_EXPR, LSHIFT_EXPR, + RSHIFT_EXPR. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Use + is_gimple_min_invariant and is_gimple_var. Handle minus_expr + specially. + +2004-03-01 Richard Henderson + + * cfgbuild.c (rtl_make_eh_edge): Rename from make_eh_edge. + * basic-block.h, except.c: Update decl and uses. + +2004-03-01 Frank Ch. Eigler + + * doc/passes.texi: Add information about mudflap. + +2004-03-01 Andrew Pinski + + PR middle-end/13066 + * fold-const (fold): Call fold_convert when building + a TRUTH_*_EXPR tree. + +2004-03-01 Andrew MacLeod + + * common.opt : Add tree-copyrename option. Remove duplicate tree-sra. + * flags.h (flag_tree_copyrename): Declare. + * opts.c (decode_options): Turn copyrename on by default at -O. + (common_handle_option): Handle -ftree-copyrename. + * toplev.c (flag_tree_copyrename): Declare. + * tree-ssa-copyrename.c (gate_copyrename): New. Check flag. + (pass_rename_ssa_copies): Initialize with gated routine. + (lang_independent_options f_): Add tree-copyrename. + * doc/invoke.texi: Add -fdump-tree-copyrename and -ftree-copyrename. + * doc/passes.texi: Add blurb for copy renaming. + +2004-03-01 Jeff Law + + * tree-ssa-dom.c (true_false_expr_hash): Update comments slightly. + (true_false_expr_eq): Update comments slightly. Avoid using + operand_equal_p, instead check the code and operands directly. + +2004-03-01 Andrew MacLeod + + * Makefile.in (tree-ssa-copyrename.o): New object. + * timevar.def (TV_TREE_COPY_RENAME): New time variable. + * tree-optimize.c (init_tree_optimization_passes): Add copy rename + pass. + * tree-pass.h (pass_rename_ssa_copies): New pass structure. + * tree-sra.c (lookup_scalar): Copy DECL_ARITIFICIAL flag from base. + * tree-ssa-copyrename.c : New file. + (copy_rename_partition_coalesce): Coalesce partitions for renaming. + (rename_ssa_copies): Find renamable copies. + (pass_rename_ssa_copies): Initialize. + * tree-ssa-live.c (register_ssa_partition): Move to tree-ssa-live.h. + * tree-ssa-live.h (register_ssa_partition): Moved from tree-ssa-live.c. + +2004-02-29 David Edelsohn + + * doloop.c (doloop_optimize): Increment n_iterations if loop->top + present. + +2004-02-29 Diego Novillo + + * gimple-low.c (pass_remove_useless_vars): Add TODO_dump_func. + +2004-02-27 Richard Henderson + + PR middle-end/14310 + * explow.c (emit_stack_save): Remove savearea mode check. + +2004-02-27 Richard Henderson + + * builtins.c (simplify_builtin_strcmp): Don't export. Remove + length parameters. Remove conversion to memcmp. + (simplify_builtin_strncmp): Likewise. + * expr.h: Don't declare them. + * tree-ssa-ccp.c (ccp_fold_builtin): Don't call them. + +2004-02-27 Dale Johannesen + + * tree-cfg.c (cleanup_control_expr_graph): Prevent edge + probability from overflowing due to roundoff errors. + +2004-02-27 Jeff Law + + * tree-cfg.c (verify_expr): Do not walk down into types. + Expand checking to verify that unary/binary operators have + gimple operands. + * tree-ssa-ccp.c (ccp_fold_builtin, case BUILT_IN_STRLEN): Do not + create non-gimple code. Similarly for BUILTIN_IN_STRCPY and + BUILT_IN_STRNCPY. + * tree-ssa-phiopt.c (conditional_replacement): Do not create + non-gimple code. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + + * tree-simple.c (is_gimple_min_invariant): Subtraction of a + constant from a constant pointer is a gimple invariant as well. + * tree-ssa-operands.c (get_expr_operands): Handle subtraction + of a constant from a constant pointer too. + + * fold-const.c (fold): Tighten test for optimizing an equality + comparison of the address of two variables. + + * tree-inline.c (setup_one_parameter): Improve test for when we + need to gimplify the initialization statements. + +2004-02-27 Diego Novillo + + PR optimization/14312 + * tree-pretty-print.c (dump_generic_node): Mark tail calls. + * tree-ssa-alias.c (compute_may_aliases): Restore call to + dump_referenced_vars. + (compute_points_to_and_addr_escape): If the address of a + variable V is stored into a non-pointer variable, mark V as + call-clobbered. + * tree-tailcall.c (suitable_for_tail_opt_p): Check for + call-clobbered instead of TREE_ADDRESSABLE. + Ignore memory tags. + (optimize_tail_call): Add newline to dump output. + +2004-02-27 Diego Novillo + + PR optimization/13347 + * tree-sra.c (scalarize_structure_assignment): Use STRIP_NOPS + instead of STRIP_USELESS_TYPE_CONVERSION to remove type casts + from RHS of the assignment. + + * tree-ssa.c (tree_ssa_useless_type_conversion_1): Reformat + and rephrase comments. + * tree.h (STRIP_USELESS_TYPE_CONVERSION): Reformat comment. + +2004-02-26 Zdenek Dvorak + + * tree-cfg.c (tree_redirect_edge_and_branch_1): Allow to redirect + RETURN_EXPR branches. + +2004-02-26 Jeff Law + + * tree-nrv.c (tree_nrv): Only perform NRV optimization when the + return value lives in memory. + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): If an + operand is unsigned, then we can eliminate more ABS expressions + and turned div/mod expression into shift/and expressions. + + * fold-const.c (fold): An equality comparison of the address of + two non-weak variables has known compile-time result. + +2004-02-26 Andrew Pinski + + * tree-ssa-phiopt.c (conditional_replacement): + s/tree_dump_flags/dump_flags/. + + * tree-ssa-phiopt.c (tree_ssa_phiopt): Split into ... + (conditional_replacement): Here. + +2004-02-26 Andrew MacLeod + + * tree-ssa.c (find_replaceable_in_bb): Don't repalce expressions in + volatile statements. + +2004-02-25 Richard Henderson + + PR opt/14288 + * gimplify.c (gimple_push_cleanup): Add VAR argument. Set + TREE_NO_WARNING if in a conditional context. + (gimplify_target_expr): Pass new argument. + * tree-sra.c (lookup_scalar): Copy TREE_NO_WARNING to replacement. + +2004-02-24 Kazu Hirata + + * doc/invoke.texi: Replace -fdump-tree-all-ssa with + -fdump-tree-all. + +2004-02-24 Kazu Hirata + + PR target/14285 + * config/arm/arm.c (arm_compute_func_type): Replace + "current_function_needs_context" with "cfun->static_chain_decl + != NULL". + (arm_compute_initial_elimination_offset): Likewise. + * config/h8300/h8300.c (h8300_emit_stack_adjustment): + Likewise. + * config/sh/sh.c (output_stack_adjust): Likewise. + (sh5_schedule_saves): Likewise. + * config/xtensa/xtensa.c (compute_frame_size): Likewise. + +2004-02-24 Richard Henderson + + * c-simplify.c (c_genericize): s/dump_flags/local_dump_flags/. + * predict.c, tree-alias-ander.c, tree-cfg.c, tree-nrv.c, + tree-optimize.c, tree-pass.h, tree-sra.c, tree-ssa-alias.c, + tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, + tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c, + tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c: + s/tree_dump_flags/dump_flags/. + +2004-02-24 Richard Henderson + + * predict.c, tree-alias-ander.c, tree-cfg.c, tree-mudflap.c, + tree-nrv.c, tree-optimize.c, tree-pass.h, tree-profile.c, tree-sra.c, + tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, + tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c, + tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c, + tree-tailcall.c: s/tree_dump_file/dump_file/g. + +2004-02-24 Diego Novillo + + * doc/tree-ssa.texi: Fix formatting mark ups. + +2004-02-24 Jeff Law + + * gimple-low.c (remove_useless_vars): Now static. + (pass_remove_useless_vars): New. + * tree-flow.h (remove_useless_vars): Remove prototype. + * tree-nrv.c (struct nrv_data): Remove visited hashtable. + (finalize_nrv_r): Do not descend into types. No need to update + the visited hashtable. + (tree_nrv): No need to allocate/free the visited hashtable. + Clear the used flag on the variable's annotation. + * tree-optimize.c (init_tree_optimizatio_passes): Link in + pass_remove_useless_vars. + * tree-pass.h (pass_remove_useless_vars): Declare. + * tree-ssa.c (rewrite_out_of_ssa): Do not remove useless vars here. + + * Makefile.in (OBJS-common): Add tree-nrv.o. + (tree-nrv.o): Add dependencies. + * timevar.def (TV_TREE_NRV): New timevar. + * tree-nrv.c: New file implementing NRV on generic trees. + * tree-optimize.c (init_tree_optimization_passes): Link in + tree_nrv optimization pass. + * tree-pass.h (tree_nrv): Declare. + * doc/invoke.texi: Add -fdump-tree-nrv documentation. + +2004-02-24 Sebastian Pop + + * tree-flow.h (walk_use_def_chains_fn): Return a boolean. + True for stopping the use-def walk, false otherwise. + * tree-ssa-alias.c (collect_points_to_info_r): Same. + Always return false, and never stopping the def-use walk as before. + * tree-ssa.c (walk_use_def_chains_1): Stop when the result of the + callback function is true. + * doc/tree-ssa.texi: Document the behavior of the callback + function for walk_use_def_chains. + +2004-02-24 Richard Henderson + + * doc/passes.texi: Rewrite. + +2004-02-23 Diego Novillo + + * Makefile.in (TEXI_GCCINT_FILES): Add cfg.texi and tree-ssa.texi + * tree-ssa-alias.c (compute_may_aliases): Update documentation. + * doc/gccint.texi: Add node for Tree SSA documentation. + Include tree-ssa.texi. + * doc/tree-ssa.texi: New file. + +2004-02-23 Dale Johannesen + + * config/rs6000/rs6000.md: Roll in changes from mainline: + (movdf_softfloat64): Add POWER form of nop. + (movsf_hardfloat): Ditto, and accept CTR-to-CTR copy. + (movdf_hardfloat64): Ditto. + +2004-02-23 Jeff Law + + * ggc-page.c (struct page_entry): New field PREV. + (ggc_alloc): Update PREV field appropriately. + (sweep_pages): Likewise. + (ggc_free): Likewise. Use PREV field rather than loop to + improve ggc_free performance. + + * Makefile.in (OBJC-common): Add tree-ssa-copy.o. + (tree-ssa-copy.o): Add dependencies. + * tree-flow.h (propagate_value, replace_exp): Prototype. + (cprop_into_stmt, cprop_into_successor_phis): Likewise. + * tree-ssa-copy.c: New file, most functions copied from tree-ssa-dom.c + (cprop_into_stmt): Handle pointer & reference types better. + * tree-ssa-dom.c (opt_stats_d): Kill uninteresting stats. + (dump_dominator_optimization_stats): Corresponding changes. + (cprop_into_stmt): Moved into tree-ssa-copy.c. + (propagate_value): Likewise. + (cprop_into_phis): Simplify using code fromi tree-ssa-copy.c. + (optimize_stmt): Pass additional argument to cprop_into_stmt. + * tree-ssa-pre.c (generate_expr_as_of_bb): Use replace_exp. + (generate_vops_as_of_bb): Similarly. + +2004-02-21 Jan Hubicka + + * cgraphunit.c (decide_is_function_needed): Nested functions of extern + inline functions don't need to be output. + (expand_function): Re-enable sanity check. + +2004-02-21 Zdenek Dvorak + + * tree-ssa-loop.c (do_while_loop_p): New function. + (copy_loop_headers): Do not peel do-while loops. + +2004-02-21 Jan Hubicka + + * tree-cfg.c (cleanup_control_expr_graph): Update profile. + + * tree-cfg.c (disband_implicit_edges): Set fallthru edges correctly. + + * cfg.c (dump_flow_info): Work on trees too. + + * tree-pretty-print.c (dump_generic_bb_stuff): Do not touch bb + annotations when not allocated. + +2004-02-21 Jeff Law + + * tree-ssa-dom.c (cprop_into_stmt): Look at the type's main variant + to determine if the two operands of a copy have equivalent types. + +2004-02-20 Jeff Law + + * tree-flow-inline.h (may_propagate_copy): Do not perform ABNORMAL_PHI + and DECL_HARD_REGISTER tests on virtual operands. + * tree-flow.h (propagate_copy): Kill prototype. + (propagate_value): New prototype. + * tree-ssa-dom.c (propagate_copy): Now static. + (propagate_value): No longer static. + +2004-02-20 Richard Henderson + + PR middle-end/14218 + * c-simplify.c (mark_labels_r): Move to ... + * gimplify.c (force_labels_r): ... here, and rename. + (gimplify_init_constructor): Invoke it. + * tree-simple.h (force_labels_r): Declare. + +2004-02-20 Richard Henderson + + PR opt/14194 + * tree-ssa-ccp.c (substitute_and_fold): Also mark new vars + if fold_stmt was successful. + +2004-02-20 Diego Novillo + + * doc/invoke.texi: Add documentation for parameters + global-var-threshold and max-aliased-vops. + * params.def (PARAM_GLOBAL_VAR_THRESHOLD): Reformat help message. + (PARAM_MAX_ALIASED_VOPS): Rename from PARAM_MAX_ALIAS_SET_SIZE. + * params.h (MAX_ALIASED_VOPS): Rename from MAX_ALIAS_SET_SIZE. + Update all users. + * tree-ssa-alias.c (struct alias_map_d): Document fields. + Add fields total_alias_vops, grouped_p and may_aliases. + (struct alias_info): Change fields addressable_vars and + pointers to malloc'd arrays. Update all users. + Add fields num_references and total_alias_vops. + (compute_may_aliases): Add more comments. + (init_alias_info): Initialize new fields in struct alias_info. + (delete_alias_info): Corresponding changes. + (compute_points_to_and_addr_escape): Count references to + potentially aliased variables and pointer dereferences. + (compute_flow_insensitive_aliasing): Remove old grouping + heuristic. + Count the number of virtual operands induced by all the alias + sets created and call group_aliases if the number exceeds the + threshold set by --param max-aliased-vops. + (total_alias_vops_cmp): New. + (group_aliases_into): New. + (group_aliases): New. + * tree-ssa-operands.c (get_expr_operands): Change dump file + message when no flow-sensitive alias information is available. + (add_stmt_operand): Reformat comment. + * tree-ssa.c (init_tree_ssa): Don't call bitmap_clear. + + * tree-simple.c (get_base_decl): Fix typo in comment. + + * tree-pretty-print.c (print_call_name): Handle matrices of + function pointers. + +2004-02-20 Zdenek Dvorak + + * Makefile.in (tree-ssa-loop.o): Add tree-inline.h dependency. + * basic-block.h (struct reorder_block_def): Moved from cfglayout.h. + (alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): New. + * bb-reorder.c (copy_bb): Use cfghooks for bb duplication. + * cfg.c (rbi_pool): New variable. + (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New functions. + * cfghooks.c (can_duplicate_block_p, duplicate_block): New functions. + * cfghooks.h (struct cfg_hooks): Add can_duplicate_block_p and + duplicate_block hooks. + (can_duplicate_block_p, duplicate_block): Declare. + * cfglayout.c (cfg_layout_pool, cfg_layout_initialize_rbi): Removed. + (fixup_reorder_chain): Use initialize_bb_rbi. + (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Hookized. + (cfg_layout_initialize): Use cfg.c rbi pool manipulation functions. + (can_copy_bbs_p, copy_bbs): Use cfghooks for bb duplication. + * cfglayout.h (typedef struct reorder_block_def): Moved to + basic_block.h. + (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Declaration + removed. + * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Fill in can_duplicate_block_p + and duplicate_block fields. + * common.opt (ftree-ch): Add. + * flags.h (flag_tree_ch): Declare. + * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test, + copy_loop_headers): Removed. + * loop-unswitch.c (unswitch_loop): Use cfghooks for bb duplication. + * opts.c (decode_options): Enable flag_tree_ch at -O1. + (common_handle_option): Handle -ftree_ch. + * rtl.h (copy_loop_headers): Declaration removed. + * timevar.def (TV_TREE_CH): New. + * toplev.c (flag_tree_ch): New. + (rest_of_compilation): Do not call copy_loop_headers. + * tracer.c (tail_duplicate): Use cfghooks for bb duplication. + * tree-cfg.c (build_tree_cfg): Call alloc_rbi_pool. + (create_bb): Call initialize_bb_rbi. + (delete_tree_cfg): Call free_rbi_pool. + (tree_duplicate_bb): Hookize. + (tree_can_duplicate_bb_p): New. + (tree_cfg_hooks): Fill in can_duplicate_block_p and duplicate_block + fields. + * tree-flow.h (tree_duplicate_bb): Declaration removed. + * tree-optimize.c (init_tree_optimization_passes): Add pass_ch. + * tree-pass.h (pass_ch): Declare. + * tree-ssa-loop.c: Include tree-inline.h. + (call_expr_p, should_duplicate_loop_header_p, mark_defs_for_rewrite, + duplicate_blocks, copy_loop_headers, gate_ch): New functions. + (pass_ch): New. + * doc/invoke.texi (-fdump-tree-ch, -ftree-ch): Document. + +2004-02-19 David Edelsohn + + * config/rs6000/aix.h (MFWRAP_SPEC): Define. + (MFLIB_SPEC): Define. + +2004-02-19 Jeff Law + + * tree-ssa-phiopt.c (tree_ssa_phiopt): TRUTH_NOT_EXPR is valid + gimple code. + +2004-02-19 Steven Bosscher + + * tree-cfg.c (cleanup_dead_labels): New function to remove + redundant labels. + + Remove the RTL inliner. + * calls.c (try_to_integrate): Remove. + (expand_call): Do not try to expand calls inline. + * dbxout.c (dbxout_symbol_location): Don't mention integrate.c + in comments. + * expmed.c (extract_fixed_bit_field): Always propagate the + target for the shift if it is a REG. + * expr.c (emit_move_insn_1): Don't generate inline warnings. + (expand_expr_real_1): Don't look at inline_function_decl. + Don't output inlined functions here. + * expr.h (expand_inline_function): Remove prototype. + * emit-rtl.c (copy_most_rtx): Don't copy the integrated flag. + Copy the new return_val flag. + * final.c (final): Don't look at RTX_INTEGRATED_P. + * cfgrtl.c (create_basic_block_structure): Likewise. + * haifa-sched.c (priority): Likewise. + (restore_line_notes): Likewise. + * function.c (inline_function_decl): Remove. + (put_var_into_stack): Don't use it. + (fix_lexical_addr): Likewise. + * function.c (inline_function_decl): Remove extern declaration. + * genattrtab.c (ATTR_PERMANENT_P): Use the return_val flag + instead of the integrated flag. + * integrate.c (INTEGRATE_THRESHOLD): Remove. + (setup_initial_hard_reg_value_integration): Likewise. + (initialize_for_inline): Likewise. + (note_modified_parmregs): Likewise. + (integrate_parm_decls): Likewise. + (process_reg_param): Likewise. + (save_parm_insns): Likewise. + (copy_insn_list): Likewise. + (copy_insn_notes): Likewise. + (compare_blocks): Likewise. + (find_block): Likewise. + (inlining): Likewise. + (function_cannot_inline_p): Likewise. + (parmdecl_map): Likewise. + (in_nonparam_insns): Likewise. + (save_for_inline): Likewise. + (FIXED_BASE_PLUS): Likewise. + (expand_inline_function): Likewise. + (copy_rtx_and_substitute): Don't look at map->integrating, + map->inline_target, and inlining, since we are never copying + for integrating. + Don't abort on RTX_INTEGRATED_P. + (old_fun): Remove. + (output_inline_function): Remove. + * integrate.h (struct inline_map): Remove fields integrating, + block_map, leaf_reg_map, inline_target, and local_return_label. + * print-rtl.c (print_rtx): Don't print the integrated flag. + Print the return_val flag. + * rtl.h (struct rtx_def): Replace the integrated flag with the + return_val flag. + (RTX_INTEGRATED_P): Remove. + (notice_rtl_inlining_of_deferred_constant): Remove prototype. + * stmt.c (force_label_rtx): Don't look at inline_function_decl. + * toplev.c (rest_of_handle_inlining): Remove. + (rest_of_compilation): Don't call it, and never jump to exit. + Call convert_from_eh_region_ranges. + (wrapup_global_declarations): Don't output nested inlined functions. + * tree.h (function_cannot_inline_p): Remove prototype. + (save_for_inline): Ditto. + (output_inline_function): Ditto. + * unroll.c (unroll_loop): Don't clear map->inline_target. + * varasm.c (notice_rtl_inlining_of_deferred_constant): Remove. + + * system.h: Poison INTEGRATE_THRESHOLD. + * config/avr/avr.h: Remove define. + * config/ip2k/ip2k.h: Likewise. + + * unwind-sjlj.c (uw_install_context): Make a proper static inline + function. + + * doc/rtl.texi: Remove references to the integrated flag. + * doc/tm.texi: Remove documentation of INTEGRATE_THRESHOLD. + +2004-02-17 Andrew Macleod + + * tree-ssa-live.c (coalesce_tpa_members): Don't coalesce partitions + which are not in the same TPA group. + * tree-ssa.c (rewrite_out_of_ssa): Coalesce via list first. + +2004-02-17 Brian Booth + + * tree-ssa-ccp.c (substitute_and_fold): Update stmt after + calling fold_stmt. + +2004-02-16 Andrew Pinski + + * config/rs6000/rs6000.c (output_function_profiler): Check + cfun->static_chain_decl instead of current_function_needs_context. + +2004-02-16 Jeff Law + + * tree-ssa.dse.c (dse_optimize_stmt): Dump info when we delete + stores. + + * tree-ssa-dse.c: Update comments. + + * Makefile.in (OBJS-common): Add tree-ssa-dse.o + (tree-ssa-dse.o): Add dependencies. + * common.opt (ftree-dse): New option. + * flags.h (flag_tree_dse): New. + (flag_tree_dom): Fix comments. + * opts.c (decode_options): Turn on flag_tree_dse. + (common_handle_option): Handle OPT_ftree_dse. + * timevar.def (TV_TREE_PHIOPT): Update text. + (TV_TREE_DSE): New timevar. + * toplev.c (flag_tree_dse): New. + (flag_tree_dom): Fix comments. + (lang_independent_options): Add -ftree-dse. + * tree-dfa.c (redirect_immediate_use): New function. + (redirect_immediate_uses): New function. + * tree-flow.h (stmt_ann_d): Add UID field. + (redirect_immediate_uses): Declare. + * tree-optimize.c (init_tree_optimization_passes): Link in DSE pass. + * tree-pass.h (pass_dse): Declare. + * tree-ssa-dse.c: New file implementing DSE. + * doc/invoke.texi: Document new option. + +2004-02-16 Richard Henderson + + * tree-nested.c: New file. + * Makefile.in (OBJS-common, GTFILES, tree-nested.o): Add it. + * builtin-types.def (BT_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR_PTR): New. + * builtins.c (expand_builtin_nonlocal_goto): New. + (expand_builtin_apply): Fix prepare_call_address args. + (round_trampoline_addr): Move from function.c. + (expand_builtin_init_trampoline): New. + (expand_builtin_adjust_trampoline): New. + (expand_builtin): Invoke them. + (build_function_call_expr): Add CALL_EXPR chain operand. + * builtins.def (BUILT_IN_INIT_TRAMPOLINE, + BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO): New. + * c-decl.c (finish_function): Call lower_nested_functions. + (c_expand_decl): Don't declare_nonlocal_label. + * calls.c (prepare_call_address): Replace fndecl arg with a + precomputed static chain value. + (expand_call): Precompute the static chain value. Use + update_nonlocal_goto_save_area. + * cgraph.c (cgraph_mark_reachable_node): Don't force nested + functions to be reachable. + (cgraph_clone_node): Don't abort cloning functions containing + nested functions. + * cgraphunit.c (cgraph_assemble_pending_functions): Don't do + anything special for nested functions. + (cgraph_mark_functions_to_output): Likewise. + (cgraph_estimate_growth, cgraph_clone_inlined_nodes): Likewise. + (cgraph_optimize): Likewise. + (cgraph_finalize_function): Don't zap DECL_SAVED_INSNS. + (cgraph_expand_function): Allow functions to not be emitted. + * defaults.h (TRAMPOLINE_ALIGNMENT): Move from function.c. + * dwarf2out.c (gen_subprogram_die): Generate DW_AT_static_link. + * emit-rtl.c (maybe_set_first_label_num): New. + * explow.c (update_nonlocal_goto_save_area): New. + (allocate_dynamic_stack_space): Use it. + * expr.c (expand_expr_real_1) : Don't force_label_rtx. + : Ignore the possibility of non-local labels. + : Don't do trampoline_address. + * expr.h (lookup_static_chain): Remove. + (prepare_call_address): Update 2nd arg. + (update_nonlocal_goto_save_area): Declare. + * final.c (profile_function): Update static chain test. + * function.c (TRAMPOLINE_ALIGNMENT): Move to defaults.h. + (trampolines_created): Move to varasm.c. + (free_after_compilation): Update for removed fields. + (allocate_struct_function): Likewise. + (delete_handlers, lookup_static_chain): Remove. + (fix_lexical_addr): Don't consider non-local variable refs. + (trampoline_address): Remove. + (round_trampoline_addr): Move to builtins.c. + (adjust_trampoline_addr): Remove. + (expand_function_start): Update for changes to static chain + and nonlocal goto handling. + (initial_trampoline): Move to varasm.c. + (expand_function_end): Don't build trampolines or kill + unreferenced nonlocal goto labels. + * function.h (struct function): Remove x_nonlocal_labels, + x_nonlocal_goto_handler_slots, x_nonlocal_goto_stack_level, + x_context_display, x_trampoline_list, needs_context. + Add static_chain_decl, nonlocal_goto_save_area. + * gimple-low.c (record_vars): Don't record functions. + * gimplify.c (declare_tmp_vars): Export. + (create_artificial_label): Set type. + (gimplify_expr): Don't consider nonlocal gotos. + * integrate.c (expand_inline_function): Kill lookup_static_chain ref. + * jump.c (any_uncondjump_p): Reject nonlocal goto. + * rtl.h (maybe_set_first_label_num): Declare. + * stmt.c (label_rtx): Set LABEL_PRESERVE_P appropriately. + (expand_label): Handle DECL_NONLOCAL and FORCED_LABEL. + (declare_nonlocal_label): Remove. + (expand_goto): Don't handle nonlocal gotos. + (expand_nl_handler_label): Remove. + (expand_nl_goto_receivers): Remove. + (expand_end_bindings): Don't expand_nl_goto_receivers. Use + update_nonlocal_goto_save_area. + * tree-cfg.c (make_edges): Handle abnormal edges out of block + falling through to EXIT. + (make_ctrl_stmt_edges): Don't check GOTO_EXPR for nonlocal goto. + Handle computed goto with no destinations. + (tree_can_merge_blocks_p): Don't merge blocks with nonlocal labels. + (remove_useless_stmts_label, stmt_starts_bb_p): Likewise. + (tree_forwarder_block_p): Likewise. + (nonlocal_goto_p): Remove. + (tree_verify_flow_info): Update to match. + * tree-dump.c (dump_files): Add tree-nested. + * tree-flow.h (nonlocal_goto_p): Remove. + * tree-inline.c (setup_one_parameter): Split out from ... + (initialize_inlined_parameters): ... here. Handle static chain. + (inline_forbidden_p_1): Update nonlocal goto check. + (expand_call_inline): Disable mysterious cgraph abort. + * tree-optimize.c (tree_rest_of_compilation): Save DECL_SAVED_INSNS. + * tree-pretty-print.c (dump_generic_node): Print static chain + and nonlocal label. + * tree-simple.h (declare_tmp_vars): Declare. + (lower_nested_functions): Declare. + * tree-ssa-dom.c (propagate_value): Avoid sharing problems. + * tree-ssa-operands.c (get_expr_operands): Walk static chain + field of call_expr. + * tree.def (CALL_EXPR): Add static chain operand. + * tree.h (NONLOCAL_LABEL): Remove. + (TDI_nested): New. + * varasm.c (TRAMPOLINE_ALIGNMENT): Remove. + (initial_trampoline): Move from function.c. + (assemble_trampoline_template): Set and return it. + (trampolines_created): Move from function.c. + +2004-02-16 Steven Bosscher + + * tree-flow.h (cleanup_control_expr_graph): Don't declare here. + * tree-cfg.c (cleanup_control_expr_graph): Make static. + (find_edge_taken_cond_expr): Return an edge if the true and false + edges of a branch lead to the same basic block. + +2004-02-13 Diego Novillo + + * tree-phinodes.c (resize_phi_node): Do not use ggc_realloc to + allocate a new PHI node. + +2004-02-12 Diego Novillo + + * tree-flow.h (kill_redundant_phi_nodes): Remove declaration. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_redundant_phi after DOM and CCP. + (execute_todo): Do not call kill_redundant_phi_nodes. + * tree-pass.h (TODO_redundant_phi): Remove. + Update all users. + Adjust values for all the other TODO_* entries. + (pass_redundant_phi): Declare. + * tree-ssa.c (replace_immediate_uses): Call mark_new_vars_to_rename + if a pointer was replaced. + (kill_redundant_phi_nodes): Make static. + (pass_redundant_phi): Define. + +2004-02-12 Dale Johannesen + + * Makefile.in (OBJS-common): Add rtl-profile.o, tree-profile.o. + (profile.o): Add tree-flow.h dependency. + (rtl-profile.o): New rule. + (tree-profile.o): New rule. + (GTFILES): Add tree-profile.c, rtl-profile.c. + * basic-block.h (flow_call_edges_add): Remove. + * cfganal.c (need_fake_edge_p): Move to cfgrtl.c. + (flow_call_edges_add): Move to cfgrtl.c. + * cfghooks.c: (block_ends_with_call_p): New. + (block_ends_with_condjump_p): New. + (flow_call_edges_add): New. + * cfghooks.h: (struct cfg_hooks): add block_ends_with_call_p, + block_ends_with_condjump_p, flow_call_edges_add. + (block_ends_with_call_p): New declaration. + (block_ends_with_condjump_p): New declaration. + (flow_call_edges_add): New declaration. + * cfgrtl.c (rtl_block_ends_with_call_p): New. + (rtl_block_ends_with_condjump_p): New. + (need_fake_edge_p): Moved from cfganal.c. + (rtl_flow_call_edges_add): Moved from cfganal.c (flow_call_edges_add). + (rtl_cfg_hooks): Add rtl_block_ends_with_call_p, + rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add. + (cfg_layout_rtl_cfg_hooks): Ditto. + * common.opt (ftree-based-profiling): New. + * coverage.c (tree_ctr_tables): New. + (coverage_counter_alloc): Use it. + (build_ctr_info_value): Ditto. + (coverage_counter_ref): Ditto. Rename to rtl_coverage_counter_ref. + (tree_coverage_counter_ref): New. + * coverage.h (coverage_counter_ref): Remove declaration. + (rtl_coverage_counter_ref): New declaration. + (tree_coverage_counter_ref): New declaration. + * opts.c (OPT_ftree_based_profiling): New. + * profile.c: Include cfghooks.h, tree-flow.h. + (profile_hooks): New. + (profile_dump_file): New. + (instrument_edges): Use hooks instead of RTL-specific code. + (instrument_values): Ditto. + (get_exec_counts): Ditto. + (compute_branch_probabilities): Ditto. + (compute_value_histograms): Ditto. + (branch_prob): Ditto. + (find_spanning_tree): Ditto. + (end_branch_prob): Ditto. + (gen_edge_profiler): Move to rtl-profile.c (rtl_gen_edge_profiler). + (gen_interval_profiler): Ditto (rtl_gen_interval_profiler). + (gen_pow2_profiler): Ditto (rtl_gen_pow2_profiler). + (gen_one_value_profiler): Ditto (rtl_gen_one_value_profiler). + (tree_register_profile_hooks): New. + (rtl_register_profile_hooks): New. + * rtl-profile.c: New file. + * rtl.h (init_branch_prob): Move declaration to value-prof.h. + (end_branch_prob): Ditto. + (branch_prob): Ditto. + * toplev.c (flag_tree_based_profiling): New. + (f_options): Add -ftree-based-profiling. + (compile_file): Register rtl-based CFG and profiling hooks. + (rest_of_compilation): Do rtl-based profiling only when + !flag_tree_based_profiling. Register rtl-based profiling hooks. + (process_options): Sorry for -ftree-based-profiling plus + -ftest-coverage or -fprofile-values. + * toplev.h (flag_tree_based_profiling): New. + * tree-cfg.c (tree_block_ends_with_call_p): New. + (tree_block_ends_with_condjump_p): New. + (need_fake_edge_p): New. + (tree_flow_call_edges_add): New (largely from flow_call_edges_add + in cfganal.c). + (tree_cfg_hooks): Add tree_block_ends_with_call_p, + tree_block_ends_with_condjump_p, tree_flow_call_edges_add. + * tree-optimize.c (init_tree_optimization_passes): + Add pass_tree_profile. + * tree-pass.h: Ditto. + * tree-profile.c: New file. + * value-prof.c (value_prof_hooks): New. + (find_values_to_profile): Rename to rtl_find_values_to_profile. + Move rtl-specific bits in from branch_prob. + (value_profile_transformations): Rename to + rtl_value_profile_transformations. + (struct value_prof_hooks): New. + (rtl_value_prof_hooks): New. + (rtl_register_value_prof_hooks): New. + (tree_find_values_to_profile): New stub. + (tree_value_profile_transformations): New stub. + (tree_value_prof_hooks): New stub. + (tree_register_value_prof_hooks): New stub. + (find_values_to_profile): New. + (value_profile_transformations): New. + * value-prof.h: Add multiple inclusion guard. + (struct histogram_value): Change rtx fields to void *. + (rtl_register_value_prof_hooks): New declaration. + (tree_register_value_prof_hooks): New declaration. + (find_values_to_profile): New declaration. + (free_profiled_values): New declaration. + (value_profile_transformations): New declaration. + (struct profile_hooks): New declaration. + (init_branch_prob): Declaration moved from rtl.h. + (branch_prob): Declaration moved from rtl.h. + (end_branch_prob): Declaration mooved from rtl.h. + (tree_register_profile_hooks): New declaration. + (rtl_register_profile_hooks): New declaration. + (tree_profile_hooks): New declaration. + (rtl_profile_hooks): New declaration. + * doc/invoke.texi: Document -ftree-based-profiling. + +2004-02-12 Jeff Law + + * domwalk.c (walk_dominator_tree): Move statement walking from + clients into here. Walk statements in forward or backward order + as requested by the client. Walk either the dominator tree or + the post-dominator tree as requested by the client. + * domwalk.h (dom_walk_data): Add two fields to control direction of + statement walk and dominator vs post-dominator tree walk. Add + BSI argument to the per-statement callbacks. + * tree-ssa-dom.c (optimize_stmt): Update prototype so that it can + be directly used as a callback for the dominator tree walker. + Update stmts_to_rescan here. + (tree_ssa_dominator_optimize): Initialize new fields in the dominator + walker structure. Use optimize_stmt instead of dom_opt_walk_stmts + for statement callback. + (dom_opt_walk_stmts): Kill. No longer used. + * tree-ssa.c (mark_def_sites): Update prototype so that it can be + called as the per-statement callback. No longer walk statements here. + (mark_def_sites_initialize_block): New. + (rewrite_stmt): Update prototype so that it can be called as the + per-statement callback. + (rewrite_walk_stmts): Kill. No longer used. + (rewrite_into_ssa): Initialize new fields in the dominator walker + structure. Use rewrite_stmt instead of rewrite_walk_stmts. Add + mark_def_sites_initialize_block callback. + +2004-02-12 Steven Bosscher + + * doc/cfg.texi: New file. + * doc/ggcint.texi: Include it. Add a new chapter. + +2004-02-11 Jeff Law + + * Makefile.in (OBJS-common): Add tree-ssa-forwprop.o + (tree-ssa-forwprop.o): Add dependencies. + * timevar.def (TV_TREE_FORWPROP): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Link in + the forward propagation pass. + * tree-pass.h (pass_forwprop): Declare. + * tree-ssa-forwprop.c: New file with forward propagation pass. + * doc/invoke.texi: Document dump for forward propagation pass. + +2004-02-11 Andrew MacLeod + + * tree-ssa.c (rewrite_out_of_ssa): Don't use coalesce list until new + bug resolved. + +2004-02-11 Andrew MacLeod + + * tree-ssa-live.c (compare_pairs): New. Coalesce list cost function. + (sort_coalesce_list): Use qsort() to sort list by cost. + (coalesce_tpa_members): Use correct partition representatives. Add more + debug information. Allow coalesce by list, root_var, or both. + (tpa_dump): Show partition index. + * tree-ssa-live.h (SSANORM_COALESCE_PARTITIONS): New flag. + (SSANORM_USE_COALESCE_LIST): New flag. + * tree-ssa.c (create_temp): Don't mark as used when created. + (coalesce_ssa_name): Create coalesce list if requested. Add more + debug output. + (assign_vars): Add additional debug info. + (remove_ssa_form): Perform TER after assign_vars(). + (rewrite_vars_out_of_ssa): Pass coalesce partitions flag to + remove_ssa_form. + (rewrite_out_of_ssa): Add coalesce list flag to remove_ssa_form call. + +2004-02-10 Jeff Law + + * Makefile.in (OBJS-common): Add tree-ssa-phiopt.o + (tree-ssa-phiopt.o): Add dependencies. + * timevar.def (TV_TREE_PHIOPT): New timevar. + * tree-cfg.c (extract_true_false_edges_from_block): Moved here from + tree-ssa-dom.c. + (tree_verify_flow_info): Use extract_true_false_edges_from_block. + * tree-flow.h (extract_true_false_edges_from_block): Declare. + * tree-ssa-dom.c (extract_true_false_edges_from_block): Moved into + tree-cfg.c. + (get_eq_expr_value): Improve type check. + * tree-optimize.c (init_tree_optimization_passes): Link in + phiopt pass. + * tree-pass.h (pass_phiopt): Declare. + * tree-ssa-phiopt.c: New file with PHI node optimization pass. + * doc/invoke.texi: Document dump for PHI node optimization. + +2004-02-10 Richard Henderson + + * tree-sra.c (lookup_scalar): Handle unnamed fields. + +2004-02-10 Diego Novillo + + * Makefile.in (OBJS-common): Add tree-ssa-alias.o. + (tree-ssa-alias.o): New rule. + (tree-ssa-operands.o): Add dependency on $(TIMEVAR_H) and tree-pass.h + (gt-tree-dfa.h): Remove. + * timevar.def (TV_TREE_OPS): Rename from unused entry TV_TREE_DFA. + * tree-ssa-alias.c: New file. + * tree-dfa.c (struct alias_stats_d, alias_stats, dump_alias_stats, + may_alias_p, add_may_alias, global_var, aliases_computed_p, + compute_may_aliases): Move to tree-ssa-alias.c. + (struct walk_state): Remove fields 'is_asm_expr' and 'num_calls'. + Update all users. + (compute_alias_sets, create_memory_tags, may_access_global_mem_p, + get_memory_tag_for, promote_call_clobbered_vars, + find_addressable_vars): Remove. + (call_clobbered_vars): Move to tree-ssa-alias.c and convert to + bitmap. + (find_referenced_vars): Move logic to create .GLOBAL_VAR to + tree-ssa-alias.c. + (create_ssa_name_ann): New. + (dump_variable): Rearrange. + (dump_dfa_stats): Do not show the number of call clobbered + variables. + (find_vars_r): Do not try to determine if an assignment my access + global memory. + (add_referenced_var): Remove hacks to establish global memory + dependencies. + If the variable needs to live in memory mark it call-clobbered. + * tree-flow-inline.h (ssa_name_ann): New. + (get_ssa_name_ann): New. + (set_may_alias_global_mem): Remove. + (may_alias_global_mem_p): Remove. + (set_may_point_to_global_mem): Remove. + (may_point_to_global_mem_p): Remove. + (is_call_clobbered): New + (mark_call_clobbered): New + (mark_non_addressable): New + * tree-flow.h (enum tree_ann_type): Add SSA_NAME_ANN. + (enum mem_tag_kind): Declare. + (struct var_ann_d): Remove fields 'is_call_clobbered', + 'may_alias_global_mem' and 'may_point_to_global_mem'. + Replace bitfield 'mem_tag' with enum bitfield 'mem_tag_kind'. + Rename field 'mem_tag' to 'type_mem_tag'. + (struct stmt_ann_d): Change type of field 'addresses_taken' to a + bitmap. Update all users. + (struct ssa_name_ann_d): Declare. + (union tree_ann_d): Add field 'ssa_name'. + (ssa_name_ann_t): New type. + (struct bb_ann_d): Add field 'has_escape_site'. + (num_call_clobbered_vars): Remove. + (call_clobbered_var): Remove. + (call_clobbered_vars): Change to bitmap. + (dump_points_to_info): Declare. + (debug_points_to_info): Declare. + (walk_use_def_chains_fn): New type. + (walk_use_def_chains): Declare. + (is_call_clobbered): Declare. + (mark_call_clobbered): Declare. + * tree-simple.c (needs_to_live_in_memory): Move to tree.c. + (is_gimple_non_addressable): Update comment. + (is_gimple_call_clobbered): Remove. + (get_call_expr_in): New. + (get_base_var): Rename from get_base_symbol. Update all callers. + Don't strip SSA_NAME wrappers. + (get_base_decl): New. + (get_base_address): New. + * tree-simple.h (is_gimple_call_clobbered): Remove. + (needs_to_live_in_memory): Remove. + (get_base_decl): Declare. + (get_base_var): Declare. + (get_base_address): Declare. + * tree-ssa-dce.c (need_to_preserve_store): Reduce to calling + needs_to_live_in_memory. + * tree-ssa-operands.c: Include tree-pass.h and timevar.h + (get_stmt_operands): Push/pop TV_TREE_OPS time var. + Call mark_call_clobbered for asms that store to memory. + (get_expr_operands): When adding operands for INDIRECT_REF + expressions, use flow-sensitive aliasing, if available. + Assume that malloc-like function calls won't clobber. + (add_call_clobber_ops): + (add_call_read_ops): + * tree-ssa.c (rewrite_into_ssa): If any variable in vars_to_rename + is a pointer, invalidate all name memory tags. + (create_temp): Call is_call_clobbered and mark_call_clobbered. + (walk_use_def_chains_1): New. + (walk_use_def_chains): New. + + * tree.c (needs_to_live_in_memory): New. + * tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Define. + (struct tree_decl): Add bitfield 'needs_to_live_in_memory'. + Update unused bits comment. + (needs_to_live_in_memory): Declare. + + * tree-simple.h (get_call_expr_in): Declare. + * tree-sra.c (scalarize_stmt): Call get_call_expr_in when handling + function calls. + * tree-ssa-ccp.c (likely_value): Likewise. + + * params.def (PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR): Remove. + (PARAM_MAX_CALLS_GLOBAL_VAR): Remove. + (PARAM_GLOBAL_VAR_THRESHOLD): Define. + (PARAM_MAX_ALIAS_SET_SIZE): Define. + Update all users. + * params.h (MAX_CALLS_FOR_GLOBAL_VAR): Remove. + (MAX_CLOBBERED_VARS_FOR_GLOBAL_VAR): Remove. + (GLOBAL_VAR_THRESHOLD): Define. + (MAX_ALIAS_SET_SIZE): Define. + +2004-02-09 Richard Henderson + + * langhooks.h (lang_hooks_for_functions): Add missing_noreturn_ok_p. + * langhooks-def.h, c-lang.c, objc/objc-lang.c + (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New. + * c-objc-common.c (c_missing_noreturn_ok_p): Return bool. + (c_objc_common_init): Don't set lang_missing_noreturn_ok_p. + * c-tree.h (c_missing_noreturn_ok_p): Update decl. + * flow.c (lang_missing_noreturn_ok_p): Remove. + + * flow.c (check_function_return_warnings): Move to tree-cfg.c. + * toplev.c (rest_of_compilation): Don't call it. + * tree-cfg.c (execute_warn_function_return): Move from flow.c, + rename, update for tree vs rtl. + (pass_warn_function_return): New. + * tree-pass.h (pass_warn_function_return): Declare it. + * tree-optimize.c (init_tree_optimization_passes): Run it. + + * function.h (struct function): Remove x_clobber_return_insn. + * function.c (free_after_compilation): Don't set it. + (expand_function_end): Likewise. + +2004-02-09 Richard Henderson + + Revert: + 2004-02-06 Richard Henderson + * tree-ssa-dom.c (record_equivalences_from_phis): Use + record_const_or_copy. + (record_equivalences_from_stmt): Likewise. Replace + block_avail_exprs_p and block_nonzero_vars_p args with bd. + +2004-02-09 Jeff Law + + * tree-ssa-dom.c (get_eq_expr_value): Improve handling of boolean + conditions. + + * domwalk.c (walk_dominator_tree): Completely lose PARENT argument. + Callers updated. No longer pass PARENT to callbacks. + * domwalk.h (struct dom_walk_data): Corresponding changes. + * tree-ssa-dom.c: Likewise. + * tree-ssa.c: Likewise. + + * domwalk.c (walk_dominator_tree): Change last argument to be the + parent block in the dominator tree rather than the last statement + in the parent block in the dominator tree. Similarly in all the + callbacks. + * domwalk.h (struct dom_walk_data): Update callback prototypes. + * tree-ssa-dom.c: Corresponding changes. + * tree-ssa.c: Likewise. + + * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Break out + of tree_ssa_dominator_optimize. If the out-of-ssa pass creates + new variables, then invalidate some requested jump threads. + +2004-02-08 Richard Henderson + + * flow.c (regno_uninitialized): Remove. + * output.h (regno_uninitialized): Remove. + * function.c (setjmp_vars_warning): Rename from + uninitialized_vars_warning, remove uninitialized vars warning. + * toplev.c (rest_of_handle_life): Update to match. + * tree.h (setjmp_vars_warning): Likewise. + + * tree-sra.c (lookup_scalar): Set DECL_NAME to something descriptive. + + * tree-ssa.c (warn_uninit): New. + (warn_uninitialized_var, warn_uninitialized_phi): New. + (execute_early_warn_uninitialized): New. + (execute_late_warn_uninitialized): New. + (gate_warn_uninitialized): New. + (pass_early_warn_uninitialized): New. + (pass_late_warn_uninitialized): New. + * tree-pass.h (pass_early_warn_uninitialized): New. + (pass_late_warn_uninitialized): New. + * tree-optimize.c (init_tree_optimization_passes): Add them. + +2004-02-08 Richard Henderson + + * cppexp.c (append_digit): Rearrange unsignedp/overflow setting. + (eval_token, num_binary_op, num_part_mul, num_div_op): Likewise. + * ra-rewrite.c (rewrite_program2): Zero info. + * reload.c (decompose): Zero val. + * tree-ssa-ccp.c (visit_phi_node): Zero phi_val.const_val. + +2004-02-07 Jan Hubicka + + * tree-inline.c (save_body): Clone the parm decl correctly. + + * cgraph.c: Add introductionary comment. + (cgraph_remove_node): Release DECL_SAVED_INSNS too. + * cgraphunit.c: Likewise. + (cgraph_finalize_function): Release DECL_SAVED_INSNS of external function. + (decl_expand_function): Release DECL_SAVED_INSNS/body/tree. + (cgraph_remove_unreachable_nodes): Likewise; guard cgraph verification. + +2004-02-06 Richard Henderson + + * common.opt (fdisable-tree-ssa): Remove. + * flags.h (flag_disable_tree_ssa): Remove. + * toplev.c (flag_disable_tree_ssa): Remove. + (f_options): Don't set it. + * opts.c (common_handle_option): Likewise. + * doc/invoke.texi (fdisable-tree-ssa): Remove. + +2004-02-06 Richard Henderson + + * tree-ssa-dom.c (record_equivalences_from_phis): Use + record_const_or_copy. + (record_equivalences_from_stmt): Likewise. Replace + block_avail_exprs_p and block_nonzero_vars_p args with bd. + +2004-02-06 Andrew Pinski + + PR middle-end/13127 + * tree-inline.c (declare_return_variable): Set the no warning bit + on the variable created for the return value. + +2004-02-06 Richard Henderson + + * tree-pretty-print.c (dump_generic_node): Render NON_LVALUE_EXPR. + + * tree-ssa-dom.c (local_fold): New. + (thread_across_edge, simplify_rhs_and_lookup_avail_expr, + find_equivalent_equality_comparison): Use it. + +2004-02-06 Andrew Pinski + + PR c/13863 + * c-common.c (c_decl_uninit_1): Remove. + (c_decl_uninit): Remove. + * c-common.h (c_decl_uninit): Remove prototype. + * c-lang.c (LANG_HOOKS_DECL_UNINIT): Delete. + * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Delete. + * c-simplify.c (gimplify_decl_stmt): Set TREE_NO_WARNING + on the decl where the initial is itself. + * function.c (uninitialized_vars_warning): Remove old comment + and check for DECL_INITIAL, replace with a check of TREE_NO_WARNING + and do not call the langhook. + * langhooks-def.h (LANG_HOOKS_DECL_UNINIT): Remove. + (LANG_HOOKS_INITIALIZER): Remove usage of LANG_HOOKS_DECL_UNINIT. + * langhooks.c (lhd_decl_uninit): Remove. + * langhooks.h (lhd_decl_uninit): Remove prototype. + +2004-02-05 Richard Henderson + + * tree-ssa-dom.c (record_const_or_copy_1): New. + (record_const_or_copy): New. + (thread_across_edge): Use it. + (dom_opt_finalize_block): Likewise. Tidy. + (record_equality): Split out from ... + (record_equivalences_from_incoming_edge): ... here. + +2004-02-05 Richard Henderson + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Allow + mixing PLUS and MINUS when folding operations. + +2004-02-05 Andrew Macleod + + * tree-pretty-print.c (dump_bb_header): Allow TDF_SLIM printing. + (dump_bb_end): Allow TDF_SLIM printing. + (dump_generic_bb_buff): Add flags parameter to dump_bb_end. + +2004-02-05 Jan Hubicka + + * alias.c (find_base_term, get_addr): Do not dereference NULL + pointer when all VALUE's locations has been invalidated. + (rtx_equal_for_memref_p): Simplify checking of VALUEs. + +2004-02-04 Daniel Berlin + + * tree-alias-ander.c (andersen_init): Reorder/Redo code so that we + actually free the memory in intraprocedural mode. + (andersen_cleanup): Ditto. + +2004-02-04 Richard Henderson + + * tree-ssa-ccp.c (get_value, visit_phi_node, + visit_assignment, dump_lattice_value): Tidy. + (evaluate_stmt): Don't do debug dump here. + (def_to_undefined): Merge into set_lattice_value. + (def_to_varying): Likewise, but retain as a wrapper. + (set_lattice_value): Tidy. Emit correct debug info. + (replace_uses_in): Remove strlen hacks. + (execute_fold_all_builtins): Fix DECL_BUILT_IN comparison. + Force folding of BUILT_IN_CONSTANT_P. + +2004-02-04 Richard Henderson + + * builtins.c (fold_builtin_expect): New. + (fold_builtin_1): Call it. + +2004-02-04 Jeff Law + + * jump.c (duplicate_loop_exit_test): Allow copying of the loop + exit test even if we do not find the LOOP_END note. + + * domwalk.c: Update comments. + +2004-02-04 Brian Booth + + PR opt/13755 + * tree-dfa.c (compute_alias_sets): set rename flag for variables + aliased by GLOBAL_VAR. + +2004-02-04 Richard Henderson + + * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): New. + (eliminate_redundant_computations): Call it. + +2004-02-03 Richard Henderson + + PR opt/13869 + * tree-cfg.c (cfg_remove_useless_stmts_bb): Correct handling of + boolean variables in COND_EXPR_COND. + +2004-02-03 Richard Henderson + + PR middle-end/13325 + * builtins.c (fold_builtin_1): Rename from fold_builtin. + (fold_builtin): New. + * c-simplify.c (gimplify_expr_stmt): Check TREE_NO_WARNING. + * stmt.c (expand_expr_stmt_value): Likewise. + * tree.h (struct tree_common): Add nowarning_flag. + (TREE_NO_WARNING): New. + (TREE_NO_UNUSED_WARNING): Remove. + * c-typeck.c (build_unary_op): Use TREE_NO_WARNING instead. + * stmt.c (warn_if_unused_value): Likewise. + +2004-02-03 Steven Bosscher + + * tree-ssa-dce.c: Partial rewrite. The old DCE is now called + `conservative'. The more aggressive algorithm uses control + dependence and is called `aggressive' or cd-dce. + * timevar.def (TV_TREE_DCE): Rename. + (TV_TREE_CD_DCE, TV_CONTROL_DEPENDENCES): New timevars. + * tree-pass.h: Declare extern pass_cd_dce. + * tree-optimize.c (init_tree_optimization_passes): Replace + the final DCE pass with a CD-DCE pass. + +2004-02-01 Jan Hubicka + + * cgraphunit.c (cgraph_mark_inline_edge): Fix insertion to + cgraph_inline_hash. + +2004-01-30 Frank Ch. Eigler + + * common.opt: Add support for -fmudflapth, -fmudflapir. + * invoke.texi: Document them. + * opts.c: Ditto. + * flags.h: Add new flags flag_mudflap_threads, _ignore_reads. + * toplev.c: Initialize new flags. Remove redundant code from + lang_independent_options[]. + * tree-mudflap.c (*): Support new flag_mudflap_threads encoding. + (mf_xform_derefs_1): Support flag_mudflap_ignore_reads option. + * c-mudflap.c (mflang_flush_calls): Mark static ctor TREE_USED. + +2004-01-30 Ian Lance Taylor + + * gengtype-yacc.y (bitfieldlen): Add empty action. + +2004-01-30 Diego Novillo + + * configure.ac: Move configuration for libbanshee and + libgmp from configure.in. + +2004-01-30 Richard Henderson + + PR opt/13524 + * gengtype-yacc.y (struct_fields): Accept unnamed bitfields. + (bitfieldlen): Split from ... + (bitfieldopt): ... here. + * gimplify.c (mark_not_gimple): Remove. + (gimplify_call_expr): Don't ignore BUILT_IN_MD. + * tree-dfa.c (struct walk_state): Remove is_not_gimple. + (find_referenced_vars): Don't look for TREE_NOT_GIMPLE. + (find_vars_r, add_referenced_var): Likewise. + * tree-ssa-operands.c (get_stmt_operands, get_expr_operands): Likewise. + * tree-simple.h (mark_not_gimple): Remove. + * tree.h (struct tree_common): Remove not_gimple_flag. + (TREE_NOT_GIMPLE): Remove. + +2004-01-29 Jason Merrill + + PR c++/13865 + * c-simplify.c (gimplify_for_stmt): Reorganize to fix cleanups. + +2004-01-29 Richard Henderson + + PR c++/13543 + * tree-inline.c (initialize_inlined_parameters): Register the + substitute reference also. + +2004-01-29 Richard Henderson + + * tree-inline.c (gimple_expand_calls_inline): Look inside + RETURN_EXPR. + + * tree-pretty-print.c (dump_generic_node): If TDF_DETAILS, dump + both name and uid. + +2004-01-29 Zdenek Dvorak + + * cfg.c (unlink_block): Reset prev_bb and next_bb. + +2004-01-29 Jeff Law + Andrew MacLeod + + * tree-ssa-live.h (tpa_next_partition): Correctly handle compressed + elements. + * tree-ssa.c (coalesce_ssa_name): New argument, flags. Callers + updated. Test SSANORM_COMBINE_TEMPS in flags rather than + flag_tree_combine_temps. + (coalesce_vars): Either operand of a copy might not have a + partition when rewriting a subset of the variables out of SSA form. + (rewrite_vars_out_of_ssa): Honor -ftree-combine-temps by passing + in SSANORM_COMBINE_TEMPS in flags argument to remove_sas_form.. + +2004-01-29 Dale Johannesen + + * Makefile.in (OBJS-common): Move tree-nomudflap.o... + (OBJS-archive): ...to here, and remove duplicate tree-optimize.o. + +2004-01-28 Richard Henderson + + PR middle-end/13898 + * gimplify.c (gimplify_init_constructor): Invoke + lhd_set_decl_assembler_name on the now-static variable. + +2004-01-28 Richard Henderson + + PR opt/13798 + * expr.c (is_zeros_p): Remove. Change all callers to use + initializer_zerop. + (categorize_ctor_elements_1, categorize_ctor_elements): New. + (count_type_elements): New. + (mostly_zeros_p): Use them. + * gimplify.c (tmp_var_id_num): Split out from create_tmp_var_raw. + (create_tmp_var_name): Likewise. + (gimplify_init_constructor): Drop constructors to readonly memory + as indicated by categorize_ctor_elements and can_move_by_pieces. + * tree.c (initializer_zerop): Handle VECTOR_CST. Don't check + AGGREGATE_TYPE_P for CONSTRUCTOR. + * tree.h (categorize_ctor_elements): Declare. + (count_type_elements): Declare. + * Makefile.in (gimplify.o): Update dependencies. + (GTFILES): Add gimplify.c. + +2004-01-27 Frank Ch. Eigler + + * tree-mudflap.c (mx_register_decls): Support VLAs. + (mf_xform_derefs_1): Disable checking shortcut for VLAs. + * c-simplify.c (gimplify_decl_stmt): Add mudflap xref comment. + * gimplify.c (gimplify_bind_expr): Ditto. + +2004-01-27 Daniel Berlin + + * tree-ssa-pre.c: Add more comments describing SSAPRE and + the various functions. + (generate_expr_as_of_bb): Use PRED, a basic block argument, instead of + j, the index of that bb. + (generate_vops_as_of_bb): Ditto. + (insert_occ_in_preorder_dt_order): Rename to + create_and_insert_occ_in_preorder_dt_order. + +2004-01-27 Daniel Berlin + + * tree-ssa-pre.c (rename_1): Add some more comments. + +2004-01-25 Andrew Pinski + + PR c/13748 + * c-decl.c (finish_function): Do not pass + the function on to optimizers if there was an error. + +2004-01-23 Richard Henderson + + PR opt/12941 + * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value. + (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0) + if SHIFT_COUNT_TRUNCATED is set. + +2004-01-21 Richard Henderson + + PR c/11267 + * c-decl.c (c_finalize): New. + (finish_function): Use it. Genericize and finalize only non-nested + functions. Register nested functions with cgraph. + * c-simplify.c: Include cgraph.h. + (c_genericize): Genericize nested functions. + * gimplify.c (gimplify_expr): Use DECL_SAVED_INSNS to access + the struct function for the context. + * Makefile.in (c-simplify.o): Update dependencies. + +2004-01-21 Steven Bosscher + + PR opt/13767 + * tree-cfg.c (simple_goto_p): Remove NONLOCAL_LABEL check. + +2004-01-21 Dale Johannesen + + * tree-dfa.c: Fix comment. + +2004-01-21 Richard Henderson + + PR opt/13681 + * tree-ssa-operands.c (get_expr_operands): Handle (&x + c). + + * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Handle + flexible array members and lookalikes. + +2004-01-21 Dale Johannesen + + * tree-ssa-dom.c (cprop_into_stmt): Add convert call + to prevent type mismatches. + +2004-01-21 Daniel Berlin + + * tree-ssa-pre.c (load_modified_phi_result): PARM_DECL is okay + to not have a defbb. + (rename_1): Add a comment. + +2004-01-21 Jeff Law + + * tree-ssa-dom.c (find_equivalent_equality_comparison): Treat + CONVERT_EXPRs just like NOP_EXPRs. + (record_equivalences_from_stmt): Similarly. + (thread_across_edge): Fix formatting goof. + + * tree-ssa-dom.c (thread_across_edge): Remove bogus restriction + which prevents threading around to the top of a loop. + + * tree-ssa-dom.c (thread_across_edge): Handle SWITCH_EXPRs in the + target block in addition to COND_EXPRs. + + * tree-ssa-dom.c (thread_across_edge): Create equivalences for + PHIs before looking at the statements in the destination + block. + +2004-01-20 Roger Sayle + + * fold-const.c (fold_convert): Rename to fold_convert_const. + (fold_convert_const): Change arguments to take a tree_code, + a type and the operand/expression to be converted. Return + NULL_TREE if no simplification is possible. Add support for + FIX_CEIL_EXPR and FIX_FLOOR_EXPR in addition to FIX_TRUNC_EXPR. + (fold): Handle FIX_CEIL_EXPR and FIX_FLOOR_EXPR. + Adjust call to fold_convert to match new fold_convert_const. + Avoid modifying the tree passed to fold in-place. + (nondestructive_fold_unary_to_constant): Likewise, simplify + call to fold_convert to match new fold_convert_const. + +2004-01-20 Daniel Berlin + + * tree-alias-ander.c (andersen_op_assign): Update + prototype. Make this handle &x in the operands using + the addrargs parameter. + (andersen_init): Turn off ip_partial until variables + aliasing variables in other functions is resolved. + (andersen_add_var): Use newly renamed alias_var_new_with_aterm. + Fix comment. + (andersen_add_var_same): Ditto. + (andersen_function_call): Use ip_partial, not flag_unit_at_a_time. + * tree-alias-common.c (get_values_from_constructor): Add bitmap + and int * arguments. Used to mark operands that we are taking + address of. + (get_alias_var_decl): We should never see FIELD_DECL's right now. + (intra_function_call): Reverse ordering for slightly faster + projection merging. + (find_op_of_decl): New function. + (find_func_aliases): Use it. + Comment x = foo.y case. + Move get_alias_var_decl of arguments so we only call it if + necessary. + Handle address of arguments in operations. + (create_fun_alias_var): tvar->var. + Set context of fakeargs. + Set context of fakedecls. + Set DECL_PTA_ALIASVAR of RETURN_DECL's. + (create_fun_alias_var_ptf): tvar->var. + Set context of fakedecls. + (create_alias_vars): Only create alias vars for globals + with DECL_INITIAL's. + * tree-alias-common.h (struct tree_alias_ops): + Update op_assign arguments. + (may_alias): Fix comment. + (same_points_to_set): Ditto. + (empty_points_to_set): Ditto. + * tree-alias-type.h: Rename alias_tvar_new_with_aterm + -> alias_var_new_with_aterm. + * tree-alias-type.c: Ditto. + +2004-01-20 Richard Henderson + + * tree-sra.c (get_scalar_for_field): Validate field. + (create_scalar_copies): Iterate over rhs fields too. + +2004-01-19 Dale Johannesen + + * params.def: Add PARAM_MAX_CALLS_GLOBAL_VAR and + PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR. + params.h: Ditto. + tree-dfa.c: Use them. + doc/invoke.texi: Document them. + +2004-01-19 Jeff Law + + * tree-ssa.c (insert_phi_nodes_for): Always use fully pruned + SSA form. + + * tree-flow.h: Update copyright dates. + (register_new_def): Declare. + * tree-ssa-dom.c: Update copyright dates. + Add tracking of current definition of each program variable just + like we do when rewriting into SSA form. + (get_value_for, set_value_for): Handle either an SSA_NAME or + regular variable. + (tree_ssa_dominator_optimize): Initialize and update CURRDEFS. + If we thread through a block with real statements, the destination + of those statements must be rewritten too. + (thread_across_edge): Skip nop statements at the start of a + block. + (dom_opt_initialize_block_local_data): Clear block_defs + appropriately. + (record_equivalences_from_phis): Accept walk_data structure. + Call register_new_def appropriately. + (optimize_stmt): Call register_new_defs_for_stmt. + (dom_opt_finalize_block): Restore CURRDEFS appropriately. + (register_new_definitions_for_stmt): New. + * tree-ssa.c: Update copyright dates. + (register_new_def): No longer static. Accept additional argument + for the table to hold the new definition. Callers updated. + + * gimplify.c: Update copyright dates. + * tree-cfg.c: Likewise. + * tree.h: Likewise. + + * tree-iterator.c, tree-iterator.c: Use GCC rather than GNU CC. + * tree-ssa-pre.c, tree-ssa-live.h: Likewise. + +2004-01-19 Daniel Berlin + + * timevar.def (TV_TREE_SPLIT_EDGES): New timevar. + * tree-ssa-pre.c (split_critical_edges): Move from here + (pass_pre): Add PROP_no_crit_edges as required. + * tree-cfg.c (split_critical_edges): to here. + (pass_split_crit_edges): New pass. + * tree-optimize.c (tree_optimization_passes): Add NEXT_PASS + (split_crit_edges). + * tree-pass.h: Add PROP_no_crit_edges. + (pass_split_crit_edges): Declared. + +2004-01-19 Frank Ch. Eigler + + * tree-mudflap.c (mf_build_check_statement_for): Tolerate + incoming locus NULL pointer. + +2004-01-18 Richard Henderson + + * builtins.c (simplify_builtin_strcpy): Export. Take strlen argument. + (simplify_builtin_strncpy, simplify_builtin_strcmp): Similarly. + (simplify_builtin_strncmp): Similarly. + (simplify_builtin): Update to match. + * expr.h (simplify_builtin_strcmp, simplify_builtin_strncmp, + simplify_builtin_strcpy, simplify_builtin_strncpy): Declare. + * tree-pass.h (pass_fold_builtins): New. + * tree-optimize.c (init_tree_optimization_passes): Add it. + * tree-ssa-ccp.c (ccp_fold_builtin): Handle BUILT_IN_STRCPY, + BUILT_IN_STRNCPY, BUILT_IN_STRCMP, BUILT_IN_STRNCMP. + (get_strlen): Don't cast to size_t. + (execute_fold_all_builtins, pass_fold_builtins): New. + +2004-01-19 Jan Hubicka + + PR opt/13729 + * cgraphunit.c (cgraph_finalize_compilation_unit): Fix memory leak. + (cgraph_remove_unreachable_nodes): Do not mix analyzed and + DECL_SAVED_TREE flags. + +2004-01-18 Richard Henderson + + * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): Remove. + (sra_candidates, needs_copy_in): Use a bitmap. Update all users. + (struct sra_elt, sra_elt_hash, sra_elt_eq): New. + (sra_map_size): Remove. + (sra_map): Use a htab_t. + (lookup_scalar): Update to match. + (get_scalar_for_field, get_scalar_for_complex_part): Likewise. + (scalarize_structure_assignment): Use annotate_all_with_locus. + (csc_build_component_ref): Remove index argument. + (csc_build_complex_part): Take tree_code, not index. + (create_scalar_copies): Don't collect indicies. + (emit_scalar_copies): New. + (scalarize_modify_expr, scalarize_tree_list): Use it. + (scalarize_return_expr): Likewise. + (scalarize_structures): Simplify needs_copy_in iteration. + (scalarize_call_expr): Use annotate_all_with_locus. + (dump_sra_map_trav): Split from ... + (dump_sra_map): ... here. Update for hash table. + (tree_sra): Update for new datastructures. + +2004-01-18 Richard Henderson + + * tree-cfg.c (dump_function_to_file): Move ";; Function" header ... + * tree-optimize.c (execute_one_pass): ... here. + +2004-01-17 Daniel Berlin + + * tree-alias-common.c: s@_typevar@_var@g, s@_TVAR@_VAR@g, + s@_TYPEVAR@_VAR@g + * tree-alias-common.h: Ditto + * tree.h: Ditto + * tree-alias-ander.c: Ditto + * tree-alias-type.c: Ditto + * tree-alias-type.h: Ditto + +2004-01-17 Richard Henderson + + * tree-complex.c (gimplify_val): Copy TREE_BLOCK. + + * tree-complex.c (gimplify_val): New. + (extract_component, do_binop, do_unop): Use it. + +2004-01-17 Richard Henderson + + * tree-complex.c (expand_complex_operations_1): Fix RETURN_EXPR + thinko in last change. + +2004-01-18 Zdenek Dvorak + + * cfghooks.c (split_block): Don't redirect edges. + * cfgrtl.c (rtl_split_block): Do it here. + * tree-cfg.c (tree_split_block): Ditto. + +2004-01-17 Richard Henderson + + * tree-cfg.c (verify_expr): Tidy. Check COND_EXPR for boolean + condition. + +2004-01-17 Jan Hubicka + + PR optimization/11761 + * Makefile.in: Remove tree-simple.c from GTYized files. + * tree-dfa.c (find_addressable_vars): Parse nontrivial ADDR_EXPRs. + (discover_nonconstant_array_refs_r): New static function. + (discover_nonconstant_array_refs): New global function. + * tree-flow.h (discover_nonconstant_array_refs): Declare. + * tree-simple.c (types_checked, types_in_memory): Kill. + (struct_needs_to_live_in_memory): Kill. + (needs_to_live_in_memory): aggregates are safe. + * tree-ssa.c (rewrite_out_of_ssa): Call the new function. + +2004-01-17 Richard Henderson + + PR opt/13718 + * tree-complex.c (expand_complex_comparison): Handle COND_EXPR. + (expand_complex_operations_1): Likewise. + +2004-01-17 Richard Henderson + + * tree-sra.c (scalarize_tree_list): Take bitmap argument to + avoid emitting duplicates. Update all callers. + +2004-01-17 Richard Henderson + + PR opt/13718 + * tree-complex.c (expand_complex_comparison): New. + (expand_complex_operations_1): Handle EQ_EXPR and NE_EXPR. + +2004-01-16 Daniel Berlin + + * tree-alias-common.c (get_alias_var): Handle BIT_FIELD_REF. + (find_func_aliases): Ditto. + Update for fact that basic component_refs are no longer + is_gimple_variable. + (create_fun_alias_var): Set DECL_CONTEXT on our faked declarations. + (pass_del_pta): PTA dumps info on delete, so it needs a name. + +2004-01-16 Steven Bosscher + + * tree-optimize.c (init_tree_optimization_passes): Run DCE + before the first dominator optimization pass. + +2004-01-15 Brian Booth + Richard Henderson + + * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): New. + (sra_map_size): New. + (make_temp): New. + (mark_all_vdefs): New. + (is_sra_candidate_decl): New. + (is_sra_candidate_ref): New. + (lookup_scalar): Use sra_map_size, make_temp. + (get_scalar_for_field): Rename from get_scalar_for. + (get_scalar_for_complex_part): New. + (can_be_scalarized_p): Handle COMPLEX_TYPE. + (scalarize_component_ref): Handle REAL/IMAGPART_EXPR. + (scalarize_structure_assignment): Tidy. + (find_candidates_for_sra): Handle COMPLEX_TYPE, return bool. + (csc_assign, csc_build_component_ref): Split out from ... + (create_scalar_copies): ... here. Handle COMPLEX_TYPE. + (csc_build_complex_part): New. + (scalarize_modify_expr): Use is_sra_candidate_foo. + (scalarize_tree_list): Likewise. + (scalarize_return_expr): Likewise. + (dump_sra_map): Split out from ... + (tree_sra): ... here. Tidy. + +2004-01-15 Frank Ch. Eigler + + * tree-mudflap.c (mf_xform_derefs): Accept void return statements. + +2004-01-15 Andrew MacLeod + Jeff Law + + * tree-ssa-dom.c (remove_local_expressions_from_table): New function + extracted from dom_opt_finalize_block. + (restore_vars_to_originalvalue): Likewise. + (extract_true_false_edges_from_block): Likewise. + (thread_across_edge): Handle if (cond) too. + (dom_opt_finalize_block): Use new functions. Handle if (cond). + + * tree-ssa-dom.c (thread_across_edge): Accept dom_walk argument. + Record temporary equivalences created by PHIs and temporarily + const/copy propagate into conditionals. + (dom_opt_finalize_block): Thread across an edge to a dominated block + if the dominated block has PHIs. Remove temporary equivalenecs + created by PHIs in thread_across_edge. Update code to restore the + various hash tables to use the actual varray rather than a local + copy of the varray. + (simplify_rhs_and_lookup_avail_expr): Set the condition's code + before settings its operands. + + * tree-ssa.c (create_temp): Use add_referenced_var rather than + an incomplete inline of its behavior. Also make sure to + set is_dereferenced_{load,store}, is_call_clobbered and is_stored. + + * tree-ssa-live.c (build_tree_conflict_graph): Correctly handle + case where the result of a PHI is unused. + +2004-01-15 Diego Novillo + + * cfghooks.c (predicted_by_p): Add missing return. + +2004-01-15 Richard Henderson + + * tree-ssa-dom.c (optimize_stmt): Dump new statement if + folding succeeded. + +2004-01-15 Kazu Hirata + + * tree-cfg.c: Fix comment typos. + * tree-eh.c: Likewise. + * tree-inline.c: Likewise. + * tree-optimize.c: Likewise. + * tree-ssa.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa-operands.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-tailcall.c: Likewise. + +2004-01-14 Jan Hubicka + + * basic-block.h: Include predict.h + (tree_predicted_by_p, rtl_predicted_by_p, rtl_predict_edge, + predict_edge_def): Declare. + * cfghooks.h (cfg_hooks): add predict_edge and predicted_by_p + (predict_edge, predicted_by_p): Declare. + * cfghooks.c (predict_edge, predicted_by_p): Declare. + * cfgrtl (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add new hooks. + * cse.c (struct cse_basic_block_data): Rename enum values to not + conflict with profile.h; update all uses. + * predict.c: Include tree-flow.h, ggc.h, tree-dump.h + (predicted_by_p): Rename to ... + (rtl_predicted_by_p): .. this one; make global + (tree_predicted_by_p): New. + (dump_prediction): Add FILE argument. + (predict_edge): Rename to ... + (rtl_predict_edge): .. this one. + (tree_predict_edge): New. + (combine_predictions_for_insn): Update calls of predict_edge. + (predict_loops): Break out from ... + (estimate_probability): ... here; update comments; move updating + of unknown probabilities from ... + (estimate_bb_frequencies): ... here. + (combine_predictions_for_bb): New. + (tree_predict_by_opcode): New. + (tree_estimate_probability): New. + * predict.def (PRED_TREE_POINTER, PRED_TREE_OPCODE_POSITIVE, + PRED_TREE_OPCODE_NONEQUAL, PRED_TREE_FPOPCODE): New predictors. + * predict.h: Add include guard. + (predict_edge, predict_edge_def): Move prototypes to basic_block.h + * tree-cfg.c (tree_cfg_hooks): Add prediction hooks. + * tree-dump.c (dump_files): Add profile. + * tree-flow.h (struct edge_prediction): New structure. + (struct bb_ann_d): Add field predictions. + (tree_estimate_probability): Declare. + * tree-optimize.c (optimize_function_tree): Call tree_estimate_probability. + * tree.h (tree_dump_index): Add TDI_profile. + * tree-pass.h (pass_profile): Declare. + +2004-01-14 Zdenek Dvorak + + * basic-block.h (find_basic_blocks, cleanup_cfg, + delete_unreachable_blocks, merge_seq_blocks): Declare. + * cfgcleanup.c (merge_seq_blocks): New. + * output.h (find_basic_blocks, cleanup_cfg, delete_unreachable_blocks): + Declarations moved to basic-block.h. + * tree-cfg.c (tree_merge_blocks, tree_can_merge_blocks_p): New. + (cleanup_tree_cfg): Call merge_seq_blocks. + (tree_cfg_hooks): Add tree_can_merge_blocks_p and tree_merge_blocks. + +2004-01-14 Zdenek Dvorak + + * tree-cfg.c (tree_make_forwarder_block): Fix. + +2004-01-14 Richard Henderson + + * tree-complex.c: New file. + * Makefile.in (OBJS-common): Add it. + * tree-pass.h (pass_lower_complex): New. + * tree-optimize.c (init_tree_optimization_passes): Add it. + +2004-01-14 Zdenek Dvorak + + * Makefile.in (tree-ssa-loop.o): Add cfgloop.h dependency. + (cfghooks.o): Add TIMEVAR_H and toplev.h dependency. + * basic-block.h (struct edge_def): Use ir_type instead testing of + cfg_hooks directly. + (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info): + Declaration removed. + * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c. + * cfgcleanup.c (try_simplify_condjump): Changed due to change of + tidy_fallthru_edge. + * cfghooks.c: Include timevar.h and toplev.h. + (cfg_hooks): Made static. + (tree_register_cfg_hooks, ir_type): New. + (verify_flow_info, dump_bb): Moved from cfg.c. + (redirect_edge_and_branch, redirect_edge_and_branch_force, + split_block, split_block_after_labels, move_block_after, + delete_basic_block, split_edge, create_basic_block, + create_empty_bb, can_merge_blocks_p, merge_blocks, + make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New. + * cfghooks.h (struct cfg_hooks): Modified. + (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block, + delete_basic_block, split_edge, create_basic_block, can_merge_blocks_p, + merge_blocks, make_forwarder_block): Changed into functions. + (loop_optimizer_init, loop_optimizer_finalize): Removed. + (HEADER_BLOCK, LATCH_EDGE): Moved into cfgloop.c. + (tidy_fallthru_edge, tidy_fallthru_edges, create_empty_bb, + verify_flow_info, dump_bb, ir_type): Declare. + (cfg_layout_rtl_cfg_hooks): Declare. + * cfglayout.c (copy_bbs): Don't call add_to_dominance_info. + * cfgloop.c (HEADER_BLOCK, LATCH_EDGE): Moved from cfghooks.h. + (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions. + (canonicalize_loop_headers): Use new semantics of make_forwarder_block. + * cfgloop.h (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize): + Removed. + (loop_optimizer_init, loop_optimizer_finalize): Declare. + * cfgloopmanip.c (split_loop_bb): Don't update dominators. + (remove_bbs): Don't call remove_bbs. + (create_preheader): Use make_forwarder_block. + (mfb_keep_just, mfb_update_loops): New static functions. + * cfgrtl.c (cfg_layout_split_block, rtl_split_block, + rtl_make_forwarder_block, rtl_create_basic_block, + rtl_delete_block, rtl_split_block, rtl_merge_blocks, + tidy_fallthru_edge, rtl_split_edge, cfg_layout_merge_blocks, + cfg_layout_split_edge): Parts not specific to rtl moved to cfghooks.c + (tidy_fallthru_edges): Moved to cfghooks.c. + (rtl_move_block_after): New. + (redirect_edge_with_latch_update, update_cfg_after_block_merging): + Removed. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Modified. + * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1, + find_if_case_2): Don't update dominators. + * loop-init.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize): + Replaced by rtl_loop_optimizer_init and rtl_loop_optimizer_finalize. + * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info. + * toplev.c (rest_of_handle_loop2): Enter cfglayout mode here. + * tree-cfg.c (create_bb): Modified to suit create_basic_block hook. + (tree_redirect_edge_and_branch_1): Merged into + tree_redirect_edge_and_branch. + (create_blocks_annotations): Removed. + (tree_loop_optimizer_init, tree_loop_optimizer_finalize): Removed. + (tree_make_forwarder_block, remove_bb, tree_split_edge, + tree_redirect_edge_and_branch, tree_split_block, + tree_move_block_after): Partially moved to cfghooks.c. + (tree_duplicate_bb): New. + (PENDING_STMT): Moved to tree-flow.h. + (tree_register_cfg_hooks): Moved to cfghooks.c. + (build_tree_cfg): Don't call create_blocks_annotations. + (factor_computed_gotos, make_blocks): Use create_empty_bb. + (cleanup_tree_cfg): Use delete_unreachable_blocks. + (remove_unreachable_blocks, insert_bb_before): Removed. + (remove_phi_nodes_and_edges_for_unreachable_block): Modified. + (tree_find_edge_insert_loc, thread_jumps): Use cfg hooks. + (bsi_commit_edge_inserts): Update_annotations argument removed. + (tree_cfg_hooks): Modified. + * tree-flow.h (PENDING_STMT): Moved from tree-cfg.c. + (insert_bb_before, remove_unreachable_blocks, + remove_phi_nodes_and_edges_for_unreachable_block, tree_split_edge): + Declaration removed. + (bsi_commit_edge_inserts): Declaration changed. + (tree_duplicate_bb): Declare. + * tree-sra.c (scalarize_structures): Changed due to + bsi_commit_edge_inserts change. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Use + delete_unreachable_blocks. + * tree-ssa-loop.c: Include cfgloop.h. + * tree-ssa-pre.c (split_critical_edges, tree_perform_ssapre): Use cfg + hooks. + * tree-ssa.c (rewrite_trees, rewrite_vars_out_of_ssa): Changed due to + bsi_commit_edge_inserts change. + (ssa_redirect_edge): Record the phi arguments on the redirected edge. + * tree-tailcall.c (eliminate_tail_call): Clean stored phi arguments. + +2004-01-13 Richard Henderson + + * gimplify.c (gimplify_lhs_complex_part_expr): Remove. + (gimplify_modify_expr): Don't call it. + + * tree-alias-common.c (HAVE_BANSHEE): Make sure it's defined. + (pass_build_pta): Set name. + +2004-01-13 Zdenek Dvorak + + * tree-tailcall.c (eliminate_tail_call): Add phi nodes for the call + vdefs. + (find_tail_calls): Ignore returns with virtual operands. + +2004-01-12 Richard Henderson + + * tree-pass.h: New file. + * gimple-low.c: Include tree-pass.h. + (lower_function_body): Make static, take no arguments. Set + dont_emit_block_notes and call reset_block_changes here. + (pass_lower_cf): New. + * toplev.c (general_init): Call init_tree_optimization_passes. + * toplev.h (init_tree_optimization_passes): Declare. + * tree-alias-ander.c: Include tree-pass.h. + (tree_dump_file, tree_dump_flags): Remove. + (andersen_init): Don't dump_begin. + (andersen_cleanup): Don't dump_end. + * tree-alias-common.c: Include tree-pass.h, timevar.h. + (currptadecl): Remove. + (create_alias_vars): Make static, take no args. Tidy ifdefs. + (delete_alias_vars): Likewise. Protect vs PTA_ANDERSEN. + (pass_build_pta, pass_del_pta): New. + * tree-alias-common.h (create_alias_vars): Delete decl. + (delete_alias_vars): Likewise. + * tree-cfg.c: Include tree-pass.h. + (tree_dump_file, tree_dump_flags): Remove. + (build_tree_cfg): Don't timevar, do init_flow. Ensure one bb. + Don't dump the function here. + (execute_build_cfg, pass_build_cfg): New. + (remove_useless_stmts): Make static, take no arguments. + (pass_remove_useless_stmts): New. + (remove_bb): Don't open the dump file. + * tree-dfa.c: Include tree-pass.h. + (tree_dump_file, tree_dump_flags): Remove. + (find_referenced_vars): Make static, take no args. Do init_tree_ssa. + (compute_may_aliases): Similarly. Don't timevar or open dump file. + Don't delete_alias_vars here. + (pass_referenced_vars, pass_may_alias): New. + * tree-dump.c (dump_files): Remove optimization dumps. + (extra_dump_files, extra_dump_files_in_use): New. + (extra_dump_files_alloced): New. + (dump_register): New. + (get_dump_file_info): New. + (dump_begin, dump_enabled_p, dump_flag_name): Use it. + (dump_enable_all): Handle extra_dump_files. + (dump_switch_p_1): Split out from dump_switch_p. + (dump_switch_p): Handle extra_dump_files. + * tree-dump.h (dump_register): Declare. + * tree-eh.c: Include tree-pass.h + (lower_eh_constructs): Make static, take no args. Don't timevar, + don't dump function. + (pass_lower_eh): New. + * tree-flow.h (remove_useless_stmts, find_referenced_vars, + compute_may_aliases, lower_function_body, rewrite_out_of_ssa, + tree_ssa_ccp, tree_ssa_dominator_optimize, tree_ssa_dce, + tree_ssa_loop_opt, lower_eh_constructs, tree_sra): Remove. + (rewrite_into_ssa): Update decl. + * tree-mudflap.c: Include tree-pass.h. + (mudflap_function_decls): Make static, take no args, don't process + functions with mf_marked_p. + (mudflap_function_ops): Likewise. + (gate_mudflap, pass_mudflap_1, pass_mudflap_2): New. + (mudflap_enqueue_decl): Don't open dump file. + (mudflap_enqueue_constant): Likewise. + * tree-nomudflap.c: Include tree-pass.h. + (mudflap_c_function_decls, mudflap_c_function_ops): Remove. + (pass_mudflap_1, pass_mudflap_2): New. + * tree-optimize.c: Include tree-pass.h. + (optimize_function_tree): Remove. + (tree_dump_file, tree_dump_flags, vars_to_rename): New. + (all_passes): New. + (execute_gimple, pass_gimple): New. + (execute_rebuild_bind, pass_rebuild_bind): New. + (gate_all_optimizations, pass_all_optimizations): New. + (execute_del_cfg, pass_del_cfg): New. + (register_one_dump_file, register_dump_files): New. + (dup_pass_1, init_tree_optimization_passes): New. + (current_properties, last_verified): New. + (execute_todo, execute_one_pass, execute_pass_list): New. + (tree_rest_of_compilation): Remove -O0 passes. + * tree-sra.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags, vars_to_rename): Remove. + (tree_sra): Make static, take no args. Don't timevar or dump file. + (gate_sra, pass_sra): New. + * tree-ssa-ccp.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags): New. + (tree_ssa_ccp): Make static, take no args. Don't timevar or dump file. + (gate_ccp, pass_ccp): New. + (substitute_and_fold): Take no args. + * tree-ssa-dce.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags): New. + (tree_ssa_dce): Make static, take no args. Don't open dump file. + (gate_dce, pass_dce): New. + * tree-ssa-dom.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags, vars_to_rename): Remove. + (tree_ssa_dominator_optimize): Make static, take no args, don't + timevar, don't dump file. + (gate_dominator, pass_dominator): New. + * tree-ssa-loop.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags): Remove. + (tree_ssa_loop_opt): Make static, take no args, don't open dump file. + (gate_loop, pass_loop): New. + * tree-ssa-pre.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags): Remove. + (execute_pre): Rename from tree_perform_ssapre, make static, + take no args, don't timevar, don't open dump file, don't allocate + vars_to_rename. + (gate_pre, pass_pre): New. + * tree-ssa.c: Include tree-pass.h. + (tree_dump_file, tree_dump_flags, vars_to_rename): Remove. + (rewrite_into_ssa): Take no arguments, don't open dump file. + (rewrite_out_of_ssa): Make static, take no args, don't timevar, + don't open dump file. Disable TER if mudflap. + (pass_build_ssa, pass_del_ssa): New. + * tree-tailcall.c: Include tree-pass.h, flags.h. + (tree_dump_file, tree_dump_flags): Remove. + (tree_optimize_tail_calls_1): Rename from tree_optimize_tail_calls. + Make static, take only opt_tailcalls, don't dump file. + (execute_tail_recursion, gate_tail_calls, execute_tail_calls): New. + (pass_tail_recursion, pass_tail_calls): New. + * tree.h (enum tree_dump_index): Remove optimization dumps. + * Makefile.in (tree-alias-ander.o, tree-alias-common.o, tree-ssa.o, + tree-ssa-dom.o, tree-ssa-pre.o, tree-cfg.o, tree-tailcall.o, + tree-dfa.o, tree-eh.o, tree-ssa-loop.o, tree-optimize.o, gimple-low.o, + tree-mudflap.o, tree-ssa-dce.o, tree-ssa-ccp.o, tree-sra.o: Update + dependencies. + +2004-01-12 Frank Ch. Eigler + + * tree-mudflap.c (mf_xform_derefs): Restore instrumentation of + RETURN_EXPRs. + +2004-01-11 Jan Hubicka + + * tree-cfg.c (remove_usless_stmts_cond): Fold statement. + (remove_useless_stmts_1): Fold trees we know how to fold. + +2004-01-09 Richard Henderson + + * gimplify.c (gimplify_constructor): Merge into ... + (gimplify_init_constructor): ... here. Handle COMPLEX_TYPE and + VECTOR_TYPE. + (gimplify_lhs_complex_part_expr): New. + (gimplify_modify_expr): Call it. + * tree-simple.c (is_gimple_rhs): Accept COMPLEX_EXPR. + * c-pretty-print.c (pp_c_initializer): Accept any type CONSTRUCTOR. + (pp_c_initializer_list): Fix code expectations for VECTOR_TYPE and + COMPLEX_TYPE. + +2004-01-09 Steven Bosscher + + PR optimization/13599 + * tree-cfg.c (remove_useless_stmts_cond): Clear last-goto + before returning. + +2004-01-09 Richard Henderson + + * gimplify.c (gimplify_asm_expr): Fix ordering of ASM_INPUTS. + +2004-01-09 Jan Hubicka + + * cgraph.h (cgraph_clone_inlined_nodes): Declare. + * cgraphunit.c (cgrpah_clone_inlined_nodes): Make global. + (cgraph_mark_inline_edge): Sanity check that size is positive. + (cgraph_decide_inlining): Fix typo. + * tree-optimize.c (tree_rest_of_compilation): Fix node duplication + code. + +2004-01-09 Jan Hubicka + + * tree-inline.c (estimate_num_insns_1): Fix. + +2004-01-09 Richard Henderson + + * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c, + tree-sra.c, tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-dom.c, + tree-ssa-loop.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c: Rename + dump_file and dump_flags to tree_dump_file/flags. + +2004-01-08 Frank Ch. Eigler + + * tree-mudflap.c (mf_build_string): Properly mf_mark string. + (mf_varname_tree): Remove redundant marking. + * tree-optimize.c (tree_rest_of_compilation): Skip mudflap processing + of mf_marked functions. + * c-mudflap.c (mflang_flush_calls): mf_mark synthetic function. + +2004-01-07 Diego Novillo + + * Makefile.in (OBJS-common): Remove tree-must-alias.o + (tree-must-alias.o): Remove. + * common.opt (ftree-must-alias): Remove. + * flags.h (flag_tree_must_alias): Remove. Update all users. + * timevar.def (TV_TREE_MUST_ALIAS): Remove. + * toplev.c (f_options): Remove entry for -ftree-must-alias. + * tree-alias-common.c (local_alias_vars): Add GTY marker. + (local_alias_varnums): Likewise. + * tree-dfa.c (aliases_computed_p): Declare. + (dump_variable): Show variable UID and dereferenced bits. + (compute_may_aliases): Add arguments 'vars_to_rename' and 'phase'. + Do not call create_alias_vars. + Call promote_call_clobbered_vars + Do debugging dumps. + Set 'aliases_computed_p' to true before returning. + (create_memory_tags): Call may_be_aliased. + Mark new memory tags for renaming. + (compute_alias_sets): Don't do debugging dumps. + (find_variable_in): Move from tree-must-alias.c + (remove_element_from): Likewise. + (find_addressable_vars): Likewise + (promote_call_clobbered_vars): New. + (get_memory_tag_for): Mark the tag volatile if the pointed-to type + is volatile. + * tree-dump.c (dump_files): Remove entry for tree-mustalias. + Add entries for tree-ssa7, tree-dom3 and tree-dce3. + * tree-flow-inline.h (may_be_aliased): New. + * tree-flow.h (may_be_aliased): Declare. + (aliases_computed_p): Declare. + (tree_compute_must_alias): Remove. + * tree-must-alias.c: Remove. + * tree-optimize.c: Include tree-alias-common.h. + (optimize_function_tree): Call create_alias_vars before going into + SSA form. + Do not compute aliases until after the first DOM and DCE passes. + Run DOM and DCE once more after computing may-aliases. + * tree-ssa-dom.c (propagate_copy): Merge the dereferenced bit flags + when copy propagating pointers. + * tree-ssa-operands.c (get_stmt_operands): Assume that the + statement has no volatile operands. + (get_expr_operands): When processing an INDIRECT_REF expressions, + mark the statement as having volatile operands if aliases have not + been computed. + (add_stmt_operand): If the variable may be aliased and aliasing has + not been computed yet, mark the statement as having volatile + operands. + * tree-ssa.c (init_tree_ssa): Set aliases_computed_p to false. + (delete_tree_ssa): Likewise. + * tree.h (tree_dump_index): Remove TDI_mustalias. + Add TDI_dom_3, TDI_ssa_7 and TDI_dce_3. + * doc/invoke.texi: Remove must-alias documentation. + +2004-01-07 Jeff Law + + * tree-ssa-dce.c (find_useful_stmts): Do not consider PHIs for + virtual operands inherently necessary. + +2004-01-07 Zdenek Dvorak + + * tree-dfa.c (free_df_for_stmt, free_df): New functions. + (compute_immediate_uses_for_stmt): Record uses in VDEFs. + * tree-flow.h (free_df, kill_redundant_phi_nodes): Declare. + * tree-optimize.c (optimize_function_tree): Call + kill_redundant_phi_nodes. + * tree-ssa-ccp.c (finalize): Call free_df. + * tree-ssa.c (replace_immediate_uses, raise_value, + kill_redundant_phi_nodes): New functions. + +2004-01-06 Jeff Law + + * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Kill. + * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt): Use + current_function_has_nonlocal_label instead of + FUNCTION_RECEIVES_NONLOCAL_GOTO. + * gimplify.c (gimplify_expr): Set has_nonlocal_label in the + appropriate function's struct function rather than setting + a bit in the FUNCTION_DECL. + +2004-01-06 Jan Hubicka + + * expr.c (string_constant): Recognize array_ref. + +2004-01-06 Richard Henderson + + * builtins.c (builtin_save_expr): New. + (expand_builtin_mathfn, expand_builtin_mathfn_2, + expand_builtin_strcmp, expand_builtin_strncmp, + expand_builtin_strcat, fold_builtin_cabs): Use it. + +2004-01-06 Jan Hubicka + + * fold-const.c (fold): Do not rebuild comparison when nothing + changed. + +2004-01-05 Jan Hubicka + + * tree-ssa-ccp.c (ccp_fold_builtin): Return early for builtins + taking no arugment. + +2004-01-05 Steven Bosscher + + * tree-ssa-dce.c: Clean up whitespace. + + * tree-cfg.c (tree_verify_flow_info): Fix complaint about + missing or wrong labels in the targets of a conditional branch. + +2004-01-05 Richard Henderson + + * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Check + for signed zeros before recording value. + * Makefile.in (tree-ssa-dom.o): Depend on real.h. + +2004-01-05 Jeff Law + + * tree-ssa-dom.c (cprop_into_stmt): Remove hack which prevented + copy propagation into statements with virtual operands, but no + real operands. + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Correctly handle + the case where an edge we wish to redirect is split by the out of SSA + code. + +2004-01-05 Richard Henderson + + * c-tree.h (struct lang_type): Add enum_min, enum_max. + * c-decl.c (finish_enum): Set them. Set TYPE_MIN/MAX_VALUE to + the limits of the compatible type, not to the enumerators. + (check_bitfield_type_and_width): Use them. + (finish_struct): Clear allocated struct lang_type. + * gimplify.c (gimplify_switch_expr): Remove special handling of + outer cast in a switch. + * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Likewise. + +2004-01-05 Daniel Berlin + + * tree-ssa-pre.c (added_phis): Removed. + Remove gt-tree-ssa-pre.h. + (process_left_occs_and_kills): ASM_EXPR's block load pre. + + * Makefile.in (GTFILES): Don't process tree-ssa-pre.c. + gt-tree-ssa-pre.h isn't a gtfile anymore. + +2004-01-05 Andrew Pinski + + * config.gcc (powerpc-*-darwin*): Make libbanshee rebuild + on PPC darwin. + +2004-01-05 Richard Henderson + + * gimplify.c (gimplify_expr): Move check for error_mark inside + the main loop. + +2004-01-04 Jan Hubicka + + * Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency. + * cgraph.c (create_edge, dump_cgraph): Update to use inline_failed + * cgraph.h (cgraph_edge): Replace inline_call by inline_failed + (cgraph_inline_p): Add extra argument reason. + * cgraphunit.c: Minor formating fixes. + cgraph_first_inlined_callee): New functions. + (record_call_1): Record builtins too. + (cgraph_analyze_function): Update inline_failed messages. + (cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into, + cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed. + (cgraph_check_inline_limits): Likewise; Add argument reason. + (cgraph_set_inline_failed): New static function. + (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set + reasons. + (cgraph_inline_p): Add new argument reason. + * tree-inline.c (expand_call_inline): Update warning. + +2004-01-04 Andreas Jaeger + + * common.opt: Re-order some options in ASCII collating orders. + +2004-01-03 Richard Henderson + + * toplev.c (rest_of_compilation): Fixup merge error wrt + check_function_return_warnings. + + * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Use unsigned_flag. + +2004-01-02 Jan Hubicka + + * c-decl.c (duplicate_decls): Output DIE of extern inline function + only when it can be inlined. + * c-objc-common.c (c_disregard_inline_limits): When not inlining + extern inline functions do not disregard. + * cgraphunit.c (cgraph_analyze_function): When not inlining do not set + inline. + (cgraph_decide_inlining): Limit work done when not inlining. + (cgrpah_decide_inlining_incrementally): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Do not call + optimize_inline_calls + when there is nothing to inline. + +2004-01-01 Richard Henderson + + * c-common.c (c_expand_expr): Don't handle STMT_EXPR. + * c-objc-common.c (c_objc_common_finish_file): Use expand_expr. + * c-semantics.c (lang_expand_stmt, lang_expand_decl_stmt, + expand_cond, genrtl_do_pushlevel, genrtl_goto_stmt, genrtl_expr_stmt, + genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, + genrtl_while_stmt, genrtl_do_stmt_1, genrtl_do_stmt, + genrtl_return_stmt, genrtl_for_stmt, genrtl_break_stmt, + genrtl_continue_stmt, genrtl_scope_stmt, genrtl_switch_stmt, + genrtl_case_label, genrtl_compound_stmt, genrtl_asm_stmt, + genrtl_cleanup_stmt, expand_stmt, find_reachable_label, + find_reachable_label_1, expand_unreachable_if_stmt, + expand_unreachable_stmt): Remove. + * c-common.h: Update. + +2003-12-31 Richard Henderson + + * c-mudflap.c (mflang_register_call): Remove. + (mflang_flush_calls): Use start_function/finish_function. + * tree-mudflap.c (mf_init_extern_trees): Tidy. + (mf_decl_cache_locals): Fix chaining for empty body. + (deferred_static_decl_labels): Remove. + (deferred_static_decls_init): Remove. + (mudflap_register_call): New. + (mudflap_enqueue_decl): Use it. Remove label argument. + (mudflap_enqueue_constant): Likewise. + (mudflap_finish_file): Update to match. + * tree-mudflap.h (mudflap_enqueue_decl): Remove label argument. + (mudflap_enqueue_constant): Likewise. + (mflang_register_call): Remove. + * tree-nomudflap.c (mudflap_enqueue_decl): Remove label argument. + (mudflap_enqueue_constant): Likewise. + * tree-optimize.c (tree_ssa_finish): Don't create NULL bodies. + * varasm.c (make_decl_rtl): Update mudflap_enqueue_decl call. + (output_constant_def_contents): Similarly for mudflap_enqueue_constant. + +2003-12-26 Sebastian Pop + + * tree-cfg.c (print_loop, print_pred_bbs, print_succ_bbs, + debug_loop_ir, print_loop_ir): New. + * tree-flow.h (debug_loop_ir, print_loop_ir): Declare. + +2003-12-23 Jeff Law + + * tree-cfg.c (tree_find_edge_insert_loc): Do not use the target + block as an insertion location if the target block has PHI nodes. + +2003-12-23 Jan Hubicka + + * cgraphunit.c (cgraph_mark_inline): Accept argument edge; return + next edge not redirected. + (cgraph_recursive_inlining_p): Simplify. + (cgraph_decide_inlining*): Update calls of cgraph_mark_inline. + +2003-12-22 Toon Moene + + * tree-alias-common.c (find_func_aliases): Do not call + intra_function_call for languages assuring no aliasing between + arguments (by themselves) and global memory. + +2003-12-21 Jan Hubicka + + * tree-ssa-ccp.c (fold_stmt): Return when there is no RHS + (get_rhs): Return for RETURN_EXPR with no operand. + +2003-12-21 Zdenek Dvorak + + * tree-cfg.c (tree_make_forwarder_block): Use split_block. + (tree_split_block): New. + (tree_cfg_hooks): Add tree_split_block. + (tree_loop_optimizer_init): Enable force_single_succ_latches. + * cfgloopmanip.c (loop_split_edge_with): Don't update dominators. + * cfgrtl.c (rtl_split_edge, cfg_layout_split_edge): Update dominators. + +2003-12-19 Daniel Berlin + + * tree-dfa.c (alias_stats_d): New structure. + (alias_stats): New variable. + (create_memory_tags): Zero out alias_stats. + (dump_alias_stats): New function. + (compute_alias_sets): Call it if TDF_STATS is set. + (may_alias_p): Collect the various statistics. + +2003-12-19 Diego Novillo + + * gimple-low.c (expand_var_p): Always expand volatiles. + * tree-dfa.c (find_referenced_vars): Move up in the file. + (create_memory_tags): New local function. + (compute_may_aliases): Call it. + (add_referenced_var): Move code to create memory tags and create + aliasing arrays to create_memory_tags. + (get_memory_tag_for): Don't mark memory tags volatile. Mark them + addressable. + * tree-flow.h (var_ann_d): Add bitfields is_dereferenced_store and + is_dereferenced_load. + (add_call_clobbered_var): Remove. + * tree-ssa-operands.c (check_optype_freelist): Mark arguments + unused. + (add_optype_freelist): Likewise. + (add_stmt_operand): Don't add operands for volatile variables. + +2003-12-19 Kazu Hirata + + * dominance.c: Fix comment typos. + * et-forest.c: Likewise. + * et-forest.h: Likewise. + * tree-cfg.c: Likewise. + * tree-eh.c: Likewise. + * tree-mudflap.c: Likewise. + * tree-optimize.c: Likewise. + * tree-pretty-print.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa.c: Likewise. + * tree-tailcall.c: Likewise. + * tree.def: Likewise. + * tree.h: Likewise. + +2003-12-18 Jason Merrill + + PR c++/12453 + * c-simplify.c (stmt_expr_last_stmt): Split out from... + (gimplify_stmt_expr): Here. + * c-common.h: Declare it. + +2003-12-18 Zdenek Dvorak + + * et-forest.h (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons): Declarations removed. + (struct et_node): New. + (et_new_tree, et_free_tree, et_set_father, et_split, et_nca, + et_below): Declare. + * et-forest.c (struct et_forest_occurrence, struct et_forest, + struct et_forest_node): Removed. + (et_forest_create, et_forest_delete, + et_forest_add_node, et_forest_add_edge, et_forest_remove_node, + et_forest_remove_edge, et_forest_parent, + et_forest_common_ancestor, et_forest_node_value, + et_forest_enumerate_sons, splay, remove_all_occurrences, + find_leftmost_node, find_rightmost_node, calculate_value): Removed. + (struct et_occ): New. + (et_nodes, et_occurences): New. + (set_depth, set_depth_add, set_prev, set_next, et_recomp_min, + et_check_occ_sanity, et_check_sanity, et_check_tree_sanity, + record_path_before_1, record_path_before, check_path_after_1, + check_path_after, et_splay, et_new_occ, et_new_tree, + et_free_tree, et_set_father, et_split, et_nca, et_below): New. + * basic-block.h (struct basic_block_def): New field dom. + (struct dominance_info): Type removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators): Declarations + changed. + (enum dom_state): New. + (dom_computed): New variable. + (first_dom_son, next_dom_son): Declare. + * dominance.c (struct dominance_info): Removed. + (BB_NODE, SET_BB_NODE): Removed. + (calculate_dominance_info, free_dominance_info, + nearest_common_dominator, set_immediate_dominator, + get_immediate_dominator, dominated_by_p, get_dominated_by, + add_to_dominance_info, delete_from_dominance_info, + recount_dominator, redirect_immediate_dominators, + iterate_fix_dominators, verify_dominators, + debug_dominance_info): Work over new datastructure. Access + dominance datastructures through CFG. + (assign_dfs_numbers, compute_dom_fast_query, first_dom_son, + next_dom_son): New. + * tree-cfg.c (pdom_info): Variable removed. + (create_bb): Add the block to the dominance information. + (cleanup_tree_cfg): Let updating of the dominance on the + individual passes. + (remove_bb): Don't handle pdom. + (cleanup_control_expr_graph, tree_make_forwarder_block, + thread_jumps): Invalidate the dominators. + (tree_split_edge): Update the dominators. + (compute_dominance_frontiers_1, compute_dominance_frontiers, + tree_verify_flow_info, tree_loop_optimizer_init): Use the new + interface to dominators. + * domwalk.c (walk_dominator_tree): Do not use dom_children. + * tree-flow-inline.h (add_dom_child, remove_dom_child, + clear_dom_children, dom_children): Removed. + * tree-flow.h (struct bb_ann_d): Dom_children field removed. + (add_dom_child, dom_children, build_dominator_tree): Declaration + removed. + (compute_dominance_frontiers): Declaration changed. + * tree-optimize.c (optimize_function_tree): Free dominance + information in the end. + * tree-ssa-dom.c (tree_ssa_dominator_optimize, + dom_opt_finalize_block): Do not use dom_children. + * tree-ssa-pre.c (fast_a_dominates_b, build_dfs_id_array_1, + build_dfs_id_array): Removed. + (pre_idom, dfs_id, dfs_id_last): Variables removed. + (build_dfn_array): Do not use dom_children. + (eref_compare, load_modified_phi_result, rename_1, reaching_def, + finalize_1, collect_expressions, tree_perform_ssapre): Use the + new interface to the dominance information. + * tree-ssa.c (struct mark_def_sites_global_data): Idom field + removed. + (set_livein_block, verify_use, verify_phi_args, + rewrite_into_ssa, mark_def_sites, verify_ssa): Use the new + interface to the dominance information. + (build_dominator_tree): Removed. + * tree-tailcall.c (tree_optimize_tail_calls): Invalidate + dominance information. + * bt-load.c (dom): Variable removed. + (augment_live_range, combine_btr_defs, migrate_btr_def, + migrate_btr_defs, branch_target_load_optimize): Updated for the + new interface for dominance information. + * cfglayout.c (copy_bbs): Removed loops argument. Updated for + the new interface for dominance information. + * cfglayout.h (copy_bbs): Declaration changed. + * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump, + flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated + for the new interface for dominance information. + (flow_loop_scan): Loops argument removed. + (flow_loops_free): Don't release dominators. + * cfgloop.h (struct cfg): Dom field removed. + (flow_loop_scan, loop_split_edge_with, simple_loop_p, + just_once_each_iteration_p, split_loop_bb): Declaration changed. + * cfgloopanal.c (simple_loop_exit_p, simple_increment, + just_once_each_iteration_p, simple_loop_p): Remove loops argument. + Updated for the new interface for dominance information. + * cfgloopmanip.c (remove_bbs, find_path, create_preheader, + split_loop_bb, loopify, duplicate_loop_to_header_edge, + force_single_succ_latches, loop_split_edge_with): Ditto. + (create_loop_notes): Free the dominators. + * gcse.c (dominators): Variable removed. + (free_code_hoist_mem, compute_code_hoist_data, hoist_code): + Updated for the new interface for dominance information. + * ifcvt.c (post_dominators): Variable removed. + (mark_loop_exit_edges, merge_if_block, find_if_header, + find_cond_trap, find_if_case_1, find_if_case_2, if_convert): + Updated for the new interface for dominance information. + * loop-init.c (rtl_loop_optimizer_init, + rtl_loop_optimizer_finalize): Ditto. + * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling, + decide_peel_completely, decide_unroll_stupid, + decide_unroll_constant_iterations, + decide_unroll_runtime_iterations): Loops argument removed. + Updated for the new interface for dominance information. + (unroll_and_peel_loops, peel_loops_completely, + unroll_loop_runtime_iterations): Updated for the new interface for + dominance information. + * loop-unswitch.c (may_unswitch_on_p, unswitch_loops, + unswitch_single_loop, unswitch_loop): Updated for the new + interface for dominance information. + * predict.c (process_note_predictions, process_note_prediction, + estimate_probability, note_prediction_to_br_prob): Ditto. + * sched-rgn.c (find_rgns, init_regions): Ditto. + * toplev.c (rest_of_handle_branch_prob): Free the dominators. + +2003-12-18 Jeff Law + + * tree-ssa-dom.c (edges_to_redirect, redirection_targets): Merged + into a single varray "redirection_edges". + (tree_ssa_dominator_optimize): Twiddle initialization, finalization + and accessors to redirection information based on combining varrays. + Get the threading destination from the saved edge rather than from a + saved block. Mark variables appearing in PHIs at the jump thread + destination to be taken out of SSA form. + (thread_across_edge): Save the edge into the destination block + rather than the destination block itself. Twiddle based on + combining varrays of jump threading information. + * tree-flow.h (tree_block_forwards_to): Returns an edge rather than + a block. + * tree-cfg.c (tree_block_forwards_to): Return the edge leading to + the target block rather than the target block itself. + +2003-12-18 Daniel Berlin + + * tree-dfa.c (get_memory_tag_for): Don't put things with different + points-to sets in the same memory tag. + +2003-12-18 Jan Hubicka + + * c-common.c (handle_nonnull_attribute, check_function_nonnull): + Initialize arg_num. + * c-format.c (handle_format_attribute): Initialize format_num. + * rtlanal.c (get_related_value): Initialize get_jump_table_offset + +2003-12-18 Zdenek Dvorak + + * stmt.c (expand_start_loop, expand_loop_continue_here, + expand_end_loop): Don't create loop notes. + +2003-12-18 Zdenek Dvorak + Jeff Law + + * tree-cfg.c (tree_node_shared_p): Explicitly allow sharing of + CST nodes. + * tree-simple.c (is_gimple_rhs): Allow CST nodes. + (is_gimple_min_invariant): Reject constants with TREE_OVERFLOW set. + * tree-ssa-ccp (visit_assignment): Test is_gimple_min_invariant + after munging bitfields. + * tree-ssa-dom.c (record_equivalences_from_stmt): Similarly. + +2003-12-17 Jan Hubicka + + Based on patch by Dale Johannesen + * expr.c (MOVE_RATIO, CLEAR_RATIO): Move to ... + * expr.h (MOVE_RATIO, CLEAR_RATIO): ... here + +2003-12-17 Jan Hubicka + + * Makefile.in (sibcall.o): Kill. + (tree-tailcall.o): Add except.h dependency + * sibcall.c: Kill. + (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ... + * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here. + (expand_call): Do not produce placeholders; do not deal with tail + recursion; set tail_call_emit. + (fixup_tail_calls): New. + * expr.h (fixup_tail_calls): Declare. + * toplev.c (rest_of_handle_sibling_calls): Kill. + (rest_of_compialtion): Do not use rest_of_handle_sibling_calls; + call fixup_tail_calls. + * tree-dump.c (dump_files): Add tail2 + * tree-flow.h (tree_optimize_tail_calls): Update prototype. + * tree-optimize.c (optimize_function_tree): Do tail optimization twice. + * tree-tailcall.c: Inlucde except.h + (suitable_for_tail_call_opt_p): New. + (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls. + (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments. + * tree.h (CALL_EXPR_TAILCALL): New. + (tree_dump_index): Add tail2 + * function.h (struct function): Add tail_call_emit field. + +2003-12-17 Jan Hubicka + + * tree-inline.c (estimate_num_insns_1): Check that all nodes are + known; add missing nodes; fix MODIFY_EXPR + +2003-12-16 Jason Merrill + + PR middle-end/12920 + * stor-layout.c (layout_type): Just return if type is + error_mark_node. + * c-decl.c (grokdeclarator): Immediately layout an + ARRAY_TYPE used in a pointer-to-array declarator. + +2003-12-16 Diego Novillo + + * tree-dfa.c (may_alias_p): If VAR and PTR are pointers with the + same alias set, return false. + (get_memory_tag_for): Group based on alias set classes, not on + conflicting alias sets. + * tree-must-alias.c (promote_var): Don't bring aliases over when + all the may-aliases of a non-promotable variable are promoted. + +2003-12-16 Andrew MacLeod + + * tree-flow-inline.h (free_vuse, free_vdefs): Moved to + tree-ssa-operands.c + (get_def_ops, get_use_ops, get_vdef_ops, get_vuse_ops): Use the new + more direct structure pointer. + (get_use_op_ptr, get_def_op_ptr): Cast is no longer necessary. + * tree-flow.h (struct stmt_ann_d): Replace operands and voperands + pointers with pointers directly to the operand types. + * tree-ssa-dom.c (cprop_into_stmt): Use new stmt based interface to + free virtual operands. Check virtual bases of both VUSE and VDEF. + * tree-ssa-operands.c (struct voperands_d): Declare here, used only + for previous_vops during stmt operand construction. + (struct vecmanage_d, vecmanage_add_segmen, vecmanage_add_special, + vecmanage_init, vecmanage_tree_ptr_init, vecmanage_fini, check_free, + vecmanage_new_vector, vecmanage_new_tree_ptr_vector, + vecmanage_free_vector): Remove. + (allocate_ssa_op_vec, free_ssa_op_vec, allocate_ssa_virtual_op_vec, + allocate_operands_t, allocate_voperands_t): Remove. + (finalize_new_ssa_operands, inalize_new_ssa_virtual_operand): Remove. + (struct freelist_d): New. List of free operand structures. + (check_optype_freelist): New. Choose memory from freelist, if available. + (add_optype_freelist): New. Add structure to freelist, if appropriate. + (allocate_def_optype): New. Allocate a def operand list from GC. + (allocate_use_optype): New. Allocate a useoperand list from GC. + (allocate_vdef_optype): New. Allocate a vdef operand list from GC. + (allocate_vuse_optype): New. Allocate a vuse operand list from GC. + (free_uses, free_defs, free_vuses, free_vdefs): Use GC and the freelist. + (remove_vuses, remove_vdefs): New. External interface to remove virtual + operands. + (init_ssa_operands, fini_ssa_operands): Ensure the free list is empty. + (finalize_ssa_defs, finalize_ssa_use, finalize_ssa_vdefs, + finalize_ssa_vuses): Use new direct pointers from the stmt annotation. + (append_vdef, append_vuse): No need to hack prev_vops pointer now. + (get_stmt_operands): use new freeing interface, keep previous vops in + their own local structure for now, passing its address around. + * tree-ssa-operands.h (struct def_optype_d, struct use_optype_d, + struct vdef_optype_d, struct vuse_optype_d): Implement as a single + dynamically allocated structure. + (struct operands_d, struct operands_d): Remove. + * tree-ssa-pre.c (subst_phis): Remove virtual operands using new funcs. + +2003-12-16 Jan Hubicka + + * tree-cfg.c (verify_addr_expr): Rename to .... + (verify_expr): ... this one; check that no SSA names are on + freelist. + (verify_stmt, verify_stmts): Update calls of verify_addr_expr. + + Revert until initializers are made language independent: + * cgraphunit.c (record_call_1): Do not call analyze_expr hook + * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. + (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update. + * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr. + +2003-12-16 Zdenek Dvorak + + * tree-pretty-print.c (dump_bb_header): Show block number when + there is no label. + (pp_cfg_jump): Show labels in addition to block numbers. + (dump_generic_bb_buff): Always call dump_bb_header. + +2003-12-16 Jan Hubicka + + * cgraphunit.c (cgraph_remove_unreachable_nodes): Fix typo; + improve comments; cleanup linked list mantenance. + +2003-12-15 Diego Novillo + + * tree-sra.c (can_be_scalarized_p): Reject volatile variables. + + * sibcall.c (skip_copy_to_return_value): Initialize 'hardret' and + 'softret'. + +2003-12-16 Jan Hubicka + + * cgraph.c (cgraph_remove_node): Ignore DECL_EXTERNAL clones. + * cgraphunit.c (verify_cgraph_node): Do not insist on unemmited extern + inline functions to be valid. + (cgraph_finalize_compilation_unit): Fix ordering. + (cgraph_mark_functions_to_output): Do not insist on DECL_EXTERNAL + nodes to be reclaimed. + (cgraph_remove_unreachable_nodes): New function. + (cgraph_decide_inlining): use it. + +2003-12-15 Andrew MacLeod + + * Makefile.in (TREE_FLOW_H): Add dependence on tree-ssa-operands.h + (OBJS-common): Add tree-ssa-operands.o + (tree-ssa-operands.o): Add dependencies. + (GTFILES): Add tree-ssa-operands.[ch]. + * tree-dfa.c (get_stmt_operands, get_expr_operands, add_stmt_operand, + note_addressable, add_def, add_use, add_vde, add_vuse, + add_call_clobber_ops, add_call_read_ops): Moved to tree-ssa-operands.c. + (compute_immediate_uses_for_stmt): Use new optypes interface. + (cleanup_operand_arrays): Delete. + (collect_dfa_stats_r): Use new optypes interface. + (get_call_flags): Moved to tree-ssa-operands.c. + (vdefs_disappeared_p, mark_new_vars_to_rename): Use optypes interface. + * tree-flow-inline.h (def_ops, use_ops, vdef_ops, vuse_ops): Use new + optypes. + (free_vuses): New. Clear and release vuses. + (free_vdefs): New. Clear and release vdefs. + (get_use_ops_ptr): New. Get address of a use op. + (get_def_ops_ptr): New. Get address of a use op. + (get_vdef_result_ptr): New. Get address of a use op. + (get_vdef_op_ptr): New. Get address of a use op. + (get_vuse_op_ptr): New. Get address of a use op. + (start_ssa_stmt_operands): New. Entry point to start processing stmt + operands. + * tree-flow.h (struct operands_d, struct voperands_d): Move to + tree-ssa-operands.h + (struct stmt_ann_d): Add GTY markers to operands. + * tree-pretty-print.c (dump_vops): Use optypes interface. + * tree-sra.c (create_scalar_copies): Use optypes interface. + (scalarize_structures, scalarize_modify_exp): Use optypes interface. + * tree-ssa-ccp.c (visit_stmt, ccp_fold, initialize, replace_uses_in, + likely_value, set_rhs): Use optypes interface. + * tree-ssa-dce.c (find_useful_stmts, stmt_useful_p, process_worklist): + Use optypes interface. + * tree-ssa-dom.c (thread_across_edge, thread_jumps_walk_stmts): Use + optypes interface. + (cprop_into_stmt): Rewrite using new interface. + (eliminate_redundant_computations, record_equivalences_from_stmt, + optimize_stmt, avail_expr_hash, avail_expr_eq): Use optypes interface. + * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry, + build_tree_conflict_graph,register_ssa_partitions_for_vars): Use + optypes interface. + * tree-ssa-pre.c (names_match_p, maybe_find_rhs_use_for_var, + expr_phi_insertion, same_e_version_real_occ_real_occ, opnum_of_phi, + generate_expr_as_of_bb, generate_vops_as_of_bb, subst_phis, + load_modified_real_occ_real_occ, same_e_version_phi_result, can_insert, + get_default_def, reaching_def, process_left_occs_and_kills, + collect_expressions): Use optypes interface. + * tree-ssa.c (mark_def_sites, check_replaceable, find_replaceable_in_bb, + dump_replaceable_exprs, rewrite_trees, verify_ssa, rewrite_stmt): Use + optypes interface. + (init_tree_ssa): Initialize new operand data structures. + (delete_tree_ssa): Free new operand structures. + * tree.h (VDEF_RESULT, VDEF_OP, NUM_VDEFS): Move to tree-ssa-operands.h. + + * tree-ssa-operands.h: New file. + (struct def_optype_d): New. Structure for stmt defs. + (struct use_optype_d): New. Structure for stmt uses. + (struct vdef_optype_d): New. Structure for stmt vdefs. + (struct vuse_optype_d): New. Structure for stmt vuses. + (USE_OPS, STMT_USE_OPS, NUM_USES, USE_OP_PTR, USE_OP): Macros to + access stmt uses. + (DEF_OPS, STMT_DEF_OPS, NUM_DEFS, DEF_OP_PTR, DEF_OP): Macros to + access stmt defs. + (VDEF_OPS, STMT_VDEF_OPS, NUM_VDEFS, VDEF_RESULT_PTR, VDEF_RESULT, + VDEF_OP_PTR, VDEF_OP): Macros to access stmt vdefs. + (VUSE_OPS, STMT_VUSE_OPS, NUM_VUSES, VUSE_OP_PTR, VUSE_OP): Macros to + access stmt vuses. + (struct operands_d, struct voperands_d): moved from tree-dfa.c. + * tree-ssa-operands.c: New file. + (build_defs, build_uses, build_vdefs, build_vuses): New static varrays. + (struct vecmanage_d): New. Struct to manage non-GC vectors. + (vecmanage_add_segment): New. Add a new segment to a vector manager. + (vecmanage_add_special): New. Add a large vector to the special list. + (vecmanage_init): Initialize a vector manager. + (vecmanage_tree_ptr_init): New. Initialize a vector manager for tree *. + (vecmanage_fini): New. Release vector manager memory. + (check_free): New. Look for free memory in the vector maanger. + (vecmanage_new_vector): New. Allocate a vector. + (vecmanage_new_tree_ptr_vector): New. Allocate a vector of 'tree *'. + (vecmanage_free_vector): New. Free a vector. + (free_ssa_op_vec): New. Free an ssa operand's memory. + (allocate_ssa_op_vec): New. Allocate a vector for use/defs. + (allocate_ssa_virtual_op_vec): New. Allocate a vector for vuse/vdefs. + (allocate_operands_t): New. Allocate an operand structure. + (allocate_voperands_t): New. Allocate a virtual operand structure. + (free_uses): New. Clear and release uses. + (free_defs): New. Clear and release defs. + (init_ssa_operands): New. Initialize ssa operand management. + (fini_ssa_operands): New. Cleanup ssa operand management. + (finalize_new_ssa_operands): New. Commit current operands. + (finalize_new_ssa_virtual_operands): New. Commit current virtual ops. + (finalize_ssa_defs): New. Commit and verify stmt definitions. + (finalize_ssa_uses): New. Commit and verify stmt uses. + (finalize_ssa_vdefs): New. Commit and verify stmt virtual definitions. + (finalize_ssa_vuses): New. Commit and verify stmt virtual uses. + (finalize_ssa_stmt_operands): New. Commit all stmt operands. + (verify_start_operands): New. Verify build mechanism is ready for a new + stmt. + (append_def): Renamed from add_def, and moved from tree-dfa.c. + (append_use): Renamed from add_def, and moved from tree-dfa.c. + (append_vdef): Renamed from add_def, and moved from tree-dfa.c. + (append_vuse): Renamed from add_def, and moved from tree-dfa.c. + (add_vuse): New. Entry point to add a vuse to a stmt. + (get_call_flags): Moved from tree-dfa.c + (get_stmt_operands, get_expr_operands, add_stmt_operand): Moved from + tree-dfa.c, and use new optype interface. + (note_addressabe, add_call_clobber_ops, add_call_read_ops): Moved from + tree-dfa.c + +2003-12-15 Diego Novillo + + * tree-optimize.c (optimize_function_tree): Call BITMAP_XFREE. + +2003-12-15 Diego Novillo + + PR optimization/12747 + + * tree-cfg.c (verify_addr_expr): Simplify predicates. + * tree-must-alias.c (addresses_needed): Declare as file local. + (can_be_promoted): New. + (tree_compute_must_alias): Call it. + Remove promoted variables from call_clobbered_vars. + (find_addressable_vars): Update comment. + Remove argument. Update callers. + (promote_var): Always clear TREE_ADDRESSABLE. + Don't remove promoted variables from call_clobbered_vars. + If the promoted variable is in the may-alias set of a + non-promotable variable, copy its alias set into the alias set of + the non-promotable variable. + (find_variable_in): Update comment. + * tree-sra.c (can_be_scalarized_p): Reject structures with + __complex__ fields in them. + +2003-12-15 Diego Novillo + Jason Merrill + + PR optimization/12747 + + * Makefile.in (tree-simple.o): Add dependency on bitmap.h and + $(GGC_H). + (GTFILES): Add tree-simple.c. + * tree-simple.c: Include ggc.h and bitmap.h. + (is_gimple_non_addressable_1): Remove. Update all callers. + (types_checked): New local variable. + (types_in_memory): New local variable. + (struct_needs_to_live_in_memory): New. + (needs_to_live_in_memory): New. + (is_gimple_reg): Call it. + (is_gimple_non_addressable): Call it. + (is_gimple_call_clobbered): Call it. + * tree-simple.h (needs_to_live_in_memory): Declare. + +2003-12-14 Andreas Jaeger + + * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Handle + GNU F95. + +2003-12-14 Jan Hubicka + + * cgraphunit.c (cgraph_expand_function): Release function body when no + longer needed. + (lookup_recursive_calls): New function. + (cgraph_decide_recursive_inlining): Likewise. + (cgraph_decide_inlining_of_small_functions): Do recursive inlining. + * tree-inline.c: Include function.h + (copy_body): Choose saved body for recursive inlining. + (initialize_inlined_parameters): Likewise. + (expand_call_inline): Do not verify nodes when recursivly inlining, + insert ret_label into decl map. + * params.def (PARAM_MAX_INLINE_INSNS_RECURSIVE, + PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO, + PARAM_MAX_INLINE_RECURSIVE_DEPTH, + PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO): New argument. + * invoke.texi (max-inline-insns-recursive, max-inline-recursive-depth): + Document. + * Makefile.in (tree-inline.o): Include function.h. + +2003-12-14 Jan Hubicka + + * cgraphunit.c (record_call_1): Do not call analyze_expr hook + * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. + (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update. + * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr. + +2003-12-13 Jan Hubicka + + * timevar.def (TV_TREE_STMT_VERIFY, TV_CFG_VERIFY, TV_CGRAPH_VERIFY): + New timers. + * tree-cfg.c (verify_stmts): Push/pop timevar. + * cfg.c: Include timevar.h + (verify_flow_info): Push/pop timevar. + * Makefile.in (cfg.o): Add dependnecy on TIMEVARS + + * cgraph.c (cgraph_create_edge): Sanity check for duplicates; + initialize aux. + (cgraph_remove_node): Decrease cgraph_n_nodes; do not clear + DECL_SAVED_TREE when dumping. + (cgraph_dump_node): Break out from ...; print more information. + (cgraph_dump): ... here. + * cgraph.h (cgraph_node): Add aux field. + (dump_cgraph_node, verify_cgraph, verify_cgraph_node): Declare. + (cgraph_mark_inline_edge): Declare + * cgraphunit.c (error_found): New static variable. + (verify_cgraph_node_1): New static function. + (verify_cgraph_node, verify_cgraph): New global function. + (cgraph_expand_function): More sanity checks. + (cgraph_clone_inline_nodes): Destructivly clone DECL_EXTERNAL nodes. + (cgraph_mark_inline_edge): Make global. + (cgraph_decide_inlining): Remove extern inline functions never inlined. + (cgraph_decide_inlining_incrementally): Verify that function body is + still present. + (expand_all_functions): Verify that all nodes are reachable. + (cgraph_optimize): Verify cgraph and memory management. + * tree-inline.c (copy_body_r): All edges must be present. + (expand_call_inline): Sanity check newly created edges and nodes + being inlined. + (optimize_inline_calls): Sanity check that we've inlined everything. + * tree-optimize.c (tree_rest_of_compilation): Clone functions inlined + into cloned node. + +2003-12-13 Jan Hubicka + + * tree-flow.h (tree_ssa_useless_type_conversion_1): Declare. + * tree-flow.c (tree_ssa_useless_type_conversion_1): Break out from + from...; allow complex types whose subtypes match. + (tree_ssa_useless_type_conversion): ... here. + +2003-12-12 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Don't call cleanup_control_expr + here. Instead just note that we need to cleanup the cfg (which + will DTRT). + + * timevar.def (TV_TREE_SSA_THREAD_JUMPS): Kill. + * tree-dump.c (dump_files): Kill .thread dump. + * tree.h (TDI_thread_jumps): Kill. + * tree-flow.h (tree_ssa_dominator_thread_jumps): Kill prototype. + * tree-optimize.c (optimize_function_tree): Kill call to + tree_ssa_dominator_thread_jumps. + * tree-ssa-dom.c (thread_through_phis): Kill. We no longer need + to restrict threading through PHIs. + (tree_ssa_dominator_thread_jumps): Kill. + (tree_ssa_domiantor_optimize_1): Fold back into + tree_ssa_dominator_optimize. + (tree_ssa_dominator_optimize): Mark back edges in the flow graph. + Kill code which conditionalized the walk_tree callbacks based + on thread_through_phis. When threading jumps, reorganize code + so that we can take the affected variables out of SSA form. + Mark new variables created by out-of-ssa code as needing to be + rewritten. + (thread_across_edge): Always allow threading through phis. + (thread_jumps_walk_stmts): Kill. + + * tree-ssa.c (create_temp): When we create a new temporary, make + sure to put it into referenced_vars, give it an ID number and + a suitable mem_tag. + (eliminate_build): If we encounter a PHI argument which is an + SSA_VAR we are not rewriting out of SSA form, then just treat + it like a constant. + (rewrite_vars_out_of_ssa): New function. + * tree-flow.h (rewrite_vars_out_of_ssa): Prototype. + * tree-ssa-live.c (register_ssa_partitions_for_vars): New function. + * tree-ssa-live.h (register_ssa_partitions_for_vars): Prototype. + +2003-12-12 Jan Hubicka + + * tree-inline.c (remap_decl): Avoid invalid sharing. + * cp-tree.h (optimize_function): Kill. + * optimize.c (optimize_function): Kill. + * semantics.c (expand_body): Do not call optimize_function. + +2003-12-12 Jan Hubicka + + * cgraphunit.c (cgraph_optimize): Do not decide inlining when not + inlining + +2003-12-11 Jan Hubicka + + * tree-inline.c (initialize_inlined_parameters): Disable + constant propagation for non-gimple-min-invariant when + preserving gimple form. + +2003-12-11 Jeff Law + + * tree-ssa-ccp.c (widen_bitfield): Clear out unwanted high bits + even if the field's type is unsigned. + * tree-ssa-dom.c (record_equivalences_from_stmt): When creating + equivalences from stores, be more careful about non-constant + stores to bitfields. + +2003-12-11 Diego Novillo + + * opts.c (decode_options): Do not enable the tree loop optimizer by + default. + * tree-ssa-loop.c (tree_ssa_loop_opt): Remove ENABLE_CHECKING + guards. + +2003-12-10 Richard Henderson + + * builtins.c (expand_builtin_profile_func): New. + (expand_builtin): Use it. + * builtins.def (BUILT_IN_PROFILE_FUNC_ENTER): New. + (BUILT_IN_PROFILE_FUNC_EXIT): New. + * function.c (expand_function_start, expand_function_end): Don't + do function instrumentation here. + * gimplify.c (gimplify_function_tree): Do it here. + + * c-opts.c (c_common_post_options): Don't ever use rtl inlining. + +2003-12-10 Diego Novillo + + * ifcvt.c (dead_or_predicable): Initialize local variable + 'earliest'. + * tree-cfg.c (verify_stmt): Fix typo. + * tree-ssa-dom.c (propagate_value): New local function. + (cprop_into_stmt): Call it. + (cprop_into_phis): Call it. + (eliminate_redundant_computations): Call it. + +2003-12-10 Dale Johannesen + + * tree-dfa.c (compute_alias_sets): Don't try to make + GLOBAL_VAR alias itself. + +2003-12-08 Steven Bosscher + + * tree-must-alias.c (tree_compute_must_alias): Use + num_call_clobbered_vars and call_clobbered_var() instead of + poking in the call_clobbered_vars varray directly. + +2003-12-11 Jan Hubicka + + * cgraph.c (cgraph_function_possibly_inlined_p): Fix syntax error on + gcc-2.95. + +2003-12-10 Diego Novillo + + Revert + + 2003-12-07 Richard Henderson + + * c-common.c (c_address_looks_like_offsetof): New. + * c-common.h (c_address_looks_like_offsetof): Declare. + * c-typeck.c (build_unary_op) : Use it. Don't lower + address references not destined for offsetof. + (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF + when looking for returning address of local variable. + * expr.c (expand_expr_1): Don't dereference size + of unbounded arrays. + * gimplify.c (gimplify_addr_expr): Only fold + address of variable size array elements. + * tree-simple.c (is_gimple_min_invariant): Also check + is_gimple_variable before disallowing offset address for type. + * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New. + (maybe_fold_offset_to_component_ref): Use it. + (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise. + (maybe_fold_offset_to_array_ref): Likewise. + Don't fail for division remainder non-zero. + * varasm.c (initializer_constant_valid_p) : Use + handled_component_p and look inside references. + : Always look past widening casts. + +2003-12-09 Jan Hubicka + + * cgraph.c (cgraph_inline_hash): New global variable. + (cgraph_create_node): Break out of .... + (cgraph_node): ... this one. + (cgraph_redirect_edge_callee): New function. + (cgraph_remove_node): Aggressively elliminate dead nodes; + remove node out of clone list. + (dump_cgraph): Dump inlined_to field; dump uid numbers. + (cgraph_clone_edge): Return edge created. + (cgraph_clone_node): New. + (cgraph_function_possibly_inlined_p): Re-implement using hashtable. + * cgraph.h: Include hashtab.h + (struct cgraph_global_info): Kill inline_once, will be output and + cloned_times fields. Add inlined_to field. + (cgraph_node): Add next_clone. + (cgraph_inline_hash): Declare. + (cgraph_clone_edge): Update prototype. + (cgraph_clone_node, cgraph_redirect_callee): Declare. + * cgraphunit.c (cgraph_optimize_function): Kill. + (cgraph_assemble_function): Kill next_needed to avoid GGC corruption. + (cgraph_analyze_function): Do not intialize cloned_times and + will_be_output. + (cgraph_finalize_compilation_unit): Clear next_needed. + (cgraph_optimize_function): Kill. + (cgraph_expand_function): Do not use cgraph_optimize_function. + (cgraph_estimate_growth, cgraph_mark_inline, + cgraph_check_inline_limits, cgraph_recursive_inlining_p, + cgraph_preserve_function_body_p): Update for explicit clones. + (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, + cgraph_inlined_callees, struct cgraph_inline_context, + cgraph_create_inline_context, cgraph_free_inline_context, + cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller, + cgraph_inline_context_set_callee, cgraph_inline_context_clear_callee, + update_callee_keys): Kill. + (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge): New. + (cgraph_decide_inlining_of_small_functions, (cgraph_decide_inlining, + cgraph_decide_inlining_incrementally): Simplify. + * tree-inline.c (typedef struct_inline_data): New field saving_p. + (copy_body_r): Update all clones. + (expand_call_inline): Remove inlined cgraph node. + (save_body): Inicialize id.node and id.saving_p. + * tree-optimize.c (tree_rest_of_compilation): Maintain clone up-to-date + in no-unit-at-a-time mode. + +2003-12-08 Steven Bosscher + + * tree-optimize.c (optimize_function_tree): Move verify_ssa calls + into conditionals. + +2003-12-08 Daniel Berlin + + * tree-alias-ander.c (andersen_same_points_to_set): Fix memory leak. + +2003-12-08 Jeff Law + + * tree-ssa-live.c (register_ssa_partition): Kill legacy code which + recursively called register_ssa_partition on PHI arguments when + SSA_VAR was defined by a PHI_NODE. + +2003-12-08 Jan Hubicka + + * tree-dump.c (dump_files): Fix ordering of tail call pass. + * tree.h (tree_dump_index): Likewise. + +2003-12-08 Zdenek Dvorak + + * Makefile.in (tree-cfg.o): Add gt-tree-cfg.h dependency. + (GTFILES): Add tree-cfg.c. + * tree-cfg.c: Include gt-tree-cfg.h. + (factored_computed_goto_label, factored_computed_goto): + Mark gc roots. + +2003-12-08 Steven Bosscher + Jan Hubicka + + * gengtype-lex.l (IWOrD): Add HOST_WIDEST_INT + * Makefile.in (function.o, reg-stack.o): Add missing dependency on + basic-block.h. + (GTFILES): Add basic-block.h and hwint.h. + * basic-block.h (struct edge_def): Add GTY markers, make garbage + collectable. Make `insns' field GC safe depending on the setting + of cfg_hooks. + (struct basic_block_def): Add GTY markers, make garbage collectable. + (tree_bb_root, tree_phi_root): Kill extern decls. + (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Change from macro to variable + (entry_exit_blocks): Kill. + * cfg.c: Include ggc.h + (bb_pool, edge_pool, entry_exit_blocks): Kill. + (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Define. + (init_flow): Do not create ppols; allocate entry/exit block. + (free_edge, alloc_block, expunge_block, unchecked_make_edge): Use GGC. + (compact_blocks): Don't update tree_bb_root and tree_phi_root. + * cfgrtl.c (rtl_merge_blocks): Clear head pointer. + * regs.h: Protect against multiple inclusion. + * tree-cfg.c (obstack_tree_ann_obstack, first_block_tree_and_obj, + tree_bb_root): Kill. + (build_tree_cfg, create_bb, remove_bb, delete_tree_cfg): Don't + touch tree_bb_root and tree_phi_root. + (create_block_annotations): Do not initialize obstack. + (free_block_annotations): Do not free obstack. + (create_block_annotation): Use GGC. + * tree-dfa.c (tree_phi_root): Kill. + * tree-flow.h (bb_ann, bb_ann_d): Declare. Add `phi_nodes' field. + * tree-phinodes.c (create_phi_node, add_phi_arg, remove_phi_node, + remove_all_phi_nodes_for): Use `phi_nodes' field in the bb + annotation instead of tree_phi_root. + * tree-flow-inline.h (phi_nodes, set_phi_nodes): Likewise. + (add_dom_child, clear_dom_children): Use GGC. + * tree-ssa-pre.c (code_motion): Use `phi_nodes' field in the bb + annotation instead of tree_phi_root. + * varray.h (union varray_data): Make basic_block_def and edge_def + varrays garbage collectable. + +2003-12-07 Richard Henderson + + * c-common.c (c_address_looks_like_offsetof): New. + * c-common.h (c_address_looks_like_offsetof): Declare. + * c-typeck.c (build_unary_op) : Use it. Don't lower + address references not destined for offsetof. + (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF + when looking for returning address of local variable. + * expr.c (expand_expr_1): Don't dereference size of unbounded arrays. + * gimplify.c (gimplify_addr_expr): Only fold address of variable size + array elements. + * tree-simple.c (is_gimple_min_invariant): Also check + is_gimple_variable before disallowing offset address for type. + * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New. + (maybe_fold_offset_to_component_ref): Use it. + (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise. + (maybe_fold_offset_to_array_ref): Likewise. Don't fail for division + remainder non-zero. + * varasm.c (initializer_constant_valid_p) : Use + handled_component_p and look inside references. + : Always look past widening casts. + +2003-12-07 Zdenek Dvorak + + * tree-cfg.c (compute_dominance_frontiers): Don't assume that + the first block has index 0. + +2003-12-07 Jan Hubicka + + * cgraph.c (create_edge): Rename to ... + (cgraph_create_edge): ... this one; accept call_expr as operand. + (cgraph_edge): New function + (cgraph_remove_edge): Use edge as argument + (cgraph_record_call, cgraph_remove_call): Kill. + (clone_cgraphedge): New function. + * cgraph.h (cgraph_edge): Add call_expr argument; add chain_next. + (cgraph_record_call, cgraph_remove_call): Kill prototype. + (cgraph_remove_call, cgraph_inline_p): Update prototype. + (cgraph_clone_edge): Declare. + * cgraphunit.c (cgraph_finalize_function): Update use of + cgraph_remove_edge + (record_call_1): Use cgraph_create_edge; record builtins too. + (cgraph_create_edges): Accept node instead of decl. + (cgraph_analyze_function): Update use cgraph_create_edges. + (cgraph_inline_p): Accept edge. + * tree-inline.c (inline_data): Replace decl and current_decl + by node and current_node. + (copy_body_r): Clone edges. + (expand_call_inline): Do not create inlined edges. + (optimize_inline_call): Set id->current_node, id->node. + * tree-optimize.c (tree_rest_of_compilation): Update cgraph edges after + compiling. + +2003-12-07 Diego Novillo + + * tree-ssa-loop.c (dump_file, dump_flags): Only declare with + checking enabled. + (tree_ssa_loop_opt): Mark arguments with ATTRIBUTE_UNUSED. + +2003-12-07 Richard Henderson + + * function.h (struct function): Add last_label_uid. + * tree-cfg.c (set_bb_for_stmt): Use it. + (delete_tree_cfg): Clear label_to_block_map. + + * gimple-low.c (lower_stmt_body): Export. + (lower_stmt): Allow data to be null. + * gimplify.c (declare_tmp_vars): Make static. + (push_gimplify_context): Export. + (pop_gimplify_context): Export. Put the temps somewhere. + (gimplify_body): Don't declare_tmp_vars here. + * tree-flow.h, tree-simple.h: Update for new decls. + + * tree-mudflap.c (mf_build_string): New. + (mudflap_c_function_decls): Push and pop gimplify context, don't + gimplify here. Dump pass 1. + (mudflap_c_function_ops): Similarly. + (mf_decl_cache_locals): Gimplify eveything as we go along. + (mf_build_check_statement_for): Likewise. + (mf_mostly_copy_tree_r): Remove. + (mf_varname_tree): Use mf_build_string. + (mf_file_function_line_tree): Rewrite. + (mf_offset_expr_of_array_ref): Remove. + (mx_xfn_indirect_ref): Remove. + (mf_xform_derefs_1): New. + (mf_xform_derefs): Rewrite to expect gimple. + (mx_register_decls): Use build_function_call_expr. + (mudflap_enqueue_constant): Use mf_build_string. + * tree-optimize.c (tree_rest_of_compilation): Reorder mudflap bits. + * tree-dump.c (dump_files): Split mudflap to parts 1 and 2. + * tree.h (enum tree_dump_index): Likewise. + +2003-12-06 Zdenek Dvorak + + * tree-ssa-loop.c: New. + * Makefile.in (tree-ssa-loop.o): New. + * common.opt (ftree-loop-optimize): Add. + * flags.h (flag_tree_loop): Declare. + * opts.c (decode_options): Enable flag_tree_loop at -O1. + (common_handle_option): Handle OPT_ftree_loop_optimize. + * timevar.def (TV_TREE_LOOP): New. + * toplev.c (flag_tree_loop): New. + (f_options): Add -ftree-loop-optimize. + * tree-cfg.c (build_tree_cfg): Remove disabled loop optimizer + initialization. + (tree_make_forwarder_block): Update phi nodes. + (tree_loop_optimizer_init): Don't call force_single_succ_latches. + (tree_try_redirect_by_replacing_jump): Comment fix. + * tree-dump.c (dump_files): Add .loop dump. + * tree-flow.h (tree_ssa_loop_opt, set_phi_nodes): Declare. + * tree-optimize.c (optimize_function_tree): Call tree_ssa_loop_opt. + * tree.h (enum tree_dump_index): Add TDI_loop. + * tree-flow-inline.h (set_phi_nodes): New. + * doc/invoke.texi (-fdump-tree-loop, -ftree-loop-optimize): Document. + +2003-12-05 Jeff Law + + * tree-dfa.c (mark_new_vars_to_rename): Change VARS_TO_RENAME to be + a "bitmap" instead of an "sbitmap". Callers updated. + * tree-must-alias.c (promote_var): Likewise. + (tree_compute_must_alias): Likewise. + * tree-phinodes.c (remove_all_phi_nodes_for): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_thread_jumps): Likewise. + (tree_ssa_dominator_optimize): Likewise. + (tree_ssa_dominator_optimize_1): Likewise. + * tree-ssa-pre.c (pre_expression): Likewise. + (tree_perform_ssapre): Likewise. + * tree-ssa.c (rewrite_into_ssa): Likewise. + (insert_phi_nodes): If VARS_TO_RENAME is zero, then examine + each node to determine if we need to insert a PHI. + (prepare_operand_for_rename): If VARS_TO_RENAME is zero, then + assume the operand needs renaming. + * tree-ssa-ccp.c (substitute_and_fold): Change VARS_TO_RENAME to + be a "bitmap" instead of an "sbitmap". Callers updated. + (tree_ssa_ccp): Likewise. Also make sure timevar_pop encloses + entire function. + (scalarize_modify_expr): Likewise. + * tree-sra.c (create_scalar_copies): Change VARS_TO_RENAME to + be a "bitmap" instead of an "sbitmap". Callers updated. + (tree_sra): Likewise. + * tree-optimize.c (optimize_function_tree): Make VARS_TO_RENAME + be a "bitmap" instead of an "sbitmap". + * tree-flow.h: Update various prototypes. + +2003-12-05 Zdenek Dvorak + + * tree-cfg.c (remove_useless_stmts_goto, remove_useless_stmts): Move + handling of factored_computed_goto ... + (disband_implicit_edges): ... here. + +2003-12-05 Jan Hubicka + + * tree-eh.c (tree_could_trap_p): Fix warning. + * expr.c (expand_expr): Fix warning on uninitialized last. + +2003-12-04 Jeff Law + + * tree-ssa.c (rewrite_trees): Do not unconditionally overwrite + variables set by statements. Let replace_variable do any + required rewriting. + +2003-12-04 Richard Henderson + + * c-parse.in (primary): Use annotate_with_locus instead of + STMT_LINENO for STMT_EXPR. + * c-simplify.c (gimplify_stmt_expr): Likewise. + +2003-12-04 Jan Hubicka + + * tree-dump.c (dump_files): Reorder tailcall and mustalias + * tree.h (tree_dump_index): Likewise. + * tree-optimize.c (optimize_function_tree): Do tail call after mustalias. + +2003-12-04 Diego Novillo + + * tree-dfa.c (opf_none, opf_is_def, opf_no_vops): Change to #define. + +2003-12-04 Canqun Yang + + * stor-layout.c (update_alignment_for_field): Export. + * tree.h (update_alignment_for_field): Declare. + +2003-12-03 Andrew Haley + + * tree-eh.c (tree_could_trap_p): Add division instructions. + * expr.c (expand_expr): Check the EH region of an expression and + mark all the insns that result from its expansion with the + appropriate REG_EH_REGION. + +2003-12-03 Jan Hubicka + + * tree-cfg.c (verify_addr_expr, verify_stmt, tree_node_shared_p, + verify_stmts): New functions. + (verify_flow_info): Remove PHI checking code. + * tree-flow.h (verify_stmt, verify_stmts): Declare. + * tree-inline.h (walk_tree, walk_tree_without_duplicates): Move + prototypes ... + * tree.h (walk_tree, walk_tree_without_duplicates): ... here. + +2003-12-03 Jan Hubicka + Diego Novillo + + * tree-ssa.c (verify_def, verify_use, verify_phi_args): New static + functions. + (verify_ssa): New global function. + * tree-flow.h (verify_ssa): Declare. + * tree-optimize.c (optimize_function_tree): Call it. + +2003-12-03 Diego Novillo + + * timevar.def (TV_TREE_SSA_VERIFY): New timer. + * tree-sra.c (create_scalar_copies): Always mark the previous + variables on the LHS for renaming. + Do not emit unnecessary assignments from VA_ARG_EXPRs. + (scalarize_modify_expr): Similarly, when scalarizing the LHS of a + COMPONENT_REF assignment. + * tree-must-alias.c (tree_compute_must_alias): Do not promote + variables with hidden uses. + * tree-ssa-ccp.c (set_rhs): When replacing the whole statement, reset + SSA_NAME_DEF_STMT for all the SSA_NAMEs in vdef and def + operands. + +2003-12-03 Zdenek Dvorak + Diego Novillo + + * tree-dfa.c (opf_no_vops): New. + (add_stmt_operand): Don't create virtual operands when opf_no_vops + is passed in flags. + (get_expr_operands): Set opf_no_vops flag before diving into the + operand of an ADDR_EXPR node. + +2003-12-03 Richard Henderson + + * tree-simple.c (is_gimple_min_invariant): Disallow offset of + address of a scalar. + + * c-parse.in (primary): Set STMT_LINENO on STMT_EXPR. + * c-simplify.c (gimplify_stmt_expr): Be prepared for last_stmt + to be null. + +2003-12-03 Daniel Berlin + + Fix PR 13177 + * tree-ssa-pre.c (code_motion): Do phi nodes last, and rearrange + how we decide what temporary to choose so that we get it right. + +2003-12-03 Zdenek Dvorak + + * tree-dfa.c (get_expr_operands): Don't record VUSEs for invariant + adresses. + +2003-12-03 Brian Booth + + * tree-pretty-print.c (dump_phi_nodes): Removed superfluous ampersand. + +2003-12-03 Jeff Law + + * ggc-page.c: Resync with mainline sources. Remove tree-ssa + specific hack which disabled special GC pagesizes for 2 operand + tree expressions. + + * tree-ssa.c (mark_def_sites): Call prepare_operand_for_rename + on the VDEF_RESULT as well, providing a dummy uid argument. + + * tree-phinodes.c: Include rtl.h for ceil_log2. + (ideal_phi_node_len): New function. + (resize_phi_node): Make static. + (make_phi_node): Use ideal_phi_node_len. + (add_phi_arg): Likewise. + * tree.h (resize_phi_node): Remove prototype. + * Makefile.in (tree-phinodes.o): Depend on $(RTL_H). + +2003-12-03 Zdenek Dvorak + + * tree-cfg.c: (make_edges): Eliminate fallthru to exit. + (make_ctrl_stmt_edges): Nonlocal goto handling moved to + make_goto_expr_edges. + (make_goto_expr_edges): Remove simple gotos. + (cfg_remove_useless_stmts_bb): Goto removal cancelled. + (cleanup_cond_expr_graph, cleanup_switch_expr_graph): + Replaced by ... + (cleanup_control_expr_graph): New. + (cleanup_control_flow): Use it. + (disband_implicit_edges): New. + (tree_find_edge_insert_loc): Never insert before a control statement. + (tree_split_edge, thread_jumps, tree_try_redirect_by_replacing_jump, + tree_redirect_edge_and_branch): Work over no-gotos form. + (tree_verify_flow_info): Check no-gotos form invariants. + * tree-pretty-print.c (pp_cfg_jump, dump_implicit_edges): New. + (dump_generic_bb_buff): Call dump_implicit_edges. + * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph): + Declaration removed. + (cleanup_control_expr_graph, delete_tree_ssa, disband_implicit_edges): + Declare. + * tree-optimize.c (tree_ssa_finish): New. + (optimize_function_tree): Call it. + * tree-ssa-dom.c (thread_jumps_walk_stmts, optimize_stmt): Use + cleanup_control_expr_graph. + * tree-ssa.c (delete_tree_ssa): Export, work even if there are no + referenced_vars. + (rewrite_out_of_ssa): Don't call it. + +2003-12-03 Jan Hubicka + + * tree-ssa.dom.c (tree_ssa_domionator_thread_jumps): Mark back edges. + (thread_across_edge): Do not thread across loop headers. + + * Makefile.in (tree-optimize.o): Depend on cgraph.h + * cgraph.h (cgraph_preserve_function_body_p): Declare. + * cgraphunit.c (cgraph_preserve_function_body_p): New function. + * tree-optimize.c: Include cgraph.h + (clear_decl_rtl): Kill. + (tree_rest_of_compilation): Use cgraph_preserve_function_body_p; + do not clear DECL_RTL; do final ggc in the pushed context for nested + functions; + +2003-12-02 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Accept and pass down dominator + walker structure instead of individual varrays. Callers updated. + (eliminate_redundant_computations): Likewise. + (simplify_rhs_and_lookup_avail_expr): Likewise. Cache and update + a dummy COND_EXPR when querying the hash tables when transforming + DIV/MOD into RSHIFT/BIT_AND or ABS_EXPR into NEG_EXPR. + (dom_opt_walk_stmts): Don't reload the block data pointer each + iteration of the loop. Load it once outside the loop. + + * tree-dfa.c (cleanup_operand_arrays): Avoid creating a new + varray for the vuse operands. + + * tree-ssa-dom.c (extract_range_from_cond): Use int_const_binop to + avoid creating useless tree nodes. + + * tree-phinodes.c (add_phi_arg): If we receive a new node from + resize_phi_node, then release the old node and update the PHI + chain. + +2003-12-02 Brian Booth + + * tree-pretty-print.c (dump_phi_nodes): Added code to always show phi + nodes of regular gimple scalars. + (dump_generic_bb_buff): Removed condition upon which to show phi nodes. + +2003-12-02 Jan Hubicka + + * tree-optimize.c (optimize_function_tree): Invoke ggc_collect in + between optimization passes. + +2003-12-02 Daniel Berlin + + * tree-sra.c (can_be_scalarized_p): Print details about why something + could not be scalarized to the dump file. + +2003-12-01 Jeff Law + + * Makefile.in (OBJS-common): Add tree-phinodes.o. + (tree-phinodes.o): Add dependencies. + (GTFILES): Add tree-phinodes.c. + * tree-phinodes.c: New file. + * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o. + (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly. + (remove_phi_node, remove_all_phi_nodes_for): Similarly. + * tree-ssa.c (init_tree_ssa): Initialize PHI node management. + (delete_tree_ssa): Finalize PHI node management. + * tree.c (dump_tree_statistics): Dump PHI node stats. + (make_phi_node, resize_phi_node): Moved to tree-phinodes.o. + * tree.h (init_phinodes): Prototype. + (fini_phinodes, release_phi_node): Likewise. + (phinodes_print_statistics): Likewise. + +2003-12-01 Richard Henderson + + * tree-dfa.c (get_expr_operands): Don't handle PLUS_EXPR inside + INDIRECT_REF. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use int_const_binop. + (maybe_fold_offset_to_component_ref): Likewise. + (maybe_fold_stmt_indirect): Likewise. + (maybe_fold_stmt_plus): Expand ARRAY_REF when seen with addend. + * fold-const.c (int_const_binop): Export. + * tree.h (int_const_binop): Declare. + +2003-12-01 Jan Hubicka + + * basic-block.h (tree_phi_root): New variable. + * cfg.c: Include tree-flow.h. + (compact_blocks): Compact tree_phi_root + * tree-cfg.c (build_tree_cfg): Initialize tree_phi_root. + (create_bb, remove_bb, delete_tree_cfg): Update tree_phi_root. + * tree-dfa.c (tree_phi_root): Declare. + (create_phi_node, add_phi_arg, remove_phi_node, + remove_all_phi_nodes_for): Always use accessor functions for + getting, varray for setting phis. + * tree-ssa-pre.c (code_motion): Likewsie. + * tree-flow-inline.h (phi_nodes): Use varray. + * tree-flow.h (bb_ann_d): Remove phi_nodes. + + * tree-ssanames.c (free_ssanames): Do not use deleteable GTY flag. + +2003-11-30 Jan Hubicka + + * tree-optimize.c (tree_rest_of_compilation): Move ggc_collect call to + the end of function; keep clearing of DECL_SAVED_TREE to the cgraph + code. + +2003-11-30 Jan Hubicka + + * cgraphunit.c (cgraph_inline_context): New structure. + (cgrpah_mark_inline, cgraph_check_inline_limits): Use context + instead of passing all arguments by hand. + (cgraph_create_inline_context, cgraph_free_inline_context, + cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller, + cgraph_inline_context_set_callee, cgrpah_inline_context_clear_callee, + cgraph_recursive_inlining_p): New static function. + (cgraph_decide_inline*): Reorganize to use context. + +2003-11-30 Paul Brook + + * Makefile.in (GTFILES): Remove stray '\'. + +2003-11-30 Daniel Berlin + + * c-config-lang.in: Move tree-alias-* from here + * Makefile.in (GTFILES): To here. + * tree-alias-ander.c: Include bitmap.h + (andersen_function_call): Updated to take address of variables + in an ADDR_EXPR in a CALL_EXPR. + * tree-alias-common.h (struct tree_alias_ops): Update arguments to + function_call. + * tree-alias-type.h (struct alias_typevar_common): Add varnum. + * tree-alias-common.c: Include bitmap.h, and function.h. + s/global_var/pta_global_var/g. + (addrargs): New static variable. + (pta_global_var): Ditto. + (find_func_decls): Remove. + (find_func_aliases): Take one argument, update all callers. + Handle (cast) [addr-expr] [var]. + Handle COMPONENT_REF of an INDIRECT_REF. + Pass info about ADDR_EXPR arguments to function_call function. + (deal_with_call_aliasing): New function. + (call_may_return): New function. + (get_alias_var_decl): Call find_func_aliases on the DECL_INITIAL + of a global var. + Use ALIAS_TVAR_VARNUM, instead of VARRAY_ACTIVE_SIZE (alias_vars) - 1. + (get_alias_var): Handle REALPART_EXPR and IMAGPART_EXPR. + Return NULL in default case. + (intra_function_call): Remove wrong code. + (create_fun_alias_var): Use simple_assign, not addr_assign. + Set up ALIAS_TVAR_VARNUM when creating an alias var. + (create_fun_alis_var_ptf): Ditto on ALIAS_TVAR_VARNUM. + (create_alias_var): Ditto. + (create_alias_vars): Build pta_global_var here. + Walk unexpanded_var_list. + Walk the statements in basic blocks. + (delete_alias_vars): Correct ip_partial case. + Free addrargs. + (init_alias_vars): Create addrargs. + +2003-11-29 Jan Hubicka + + * Makefile.in (tree-ssanames.o): Depend on gt-tree-ssanames.h. + (tree-eh.o): Depend on gt-tree-eh.h. + (gr-tree-ssanames.h, gt-tree-eh.h): New targets. + (GTFILES): Add tree-ssanames.c, tree-eh.c + * tree-eh.c: Include ggc.h and gt-tree-eh.h + (lower_eh_constructs): Allecate throw_stmt_table in ggc. + * tree-ssanames.c: Include ggc.h and gt-tree-ssanames.h + + * function.h (struct function): Add saved_tree/saved_args. + * toplev.c (rest_of_compilation): Move code to clear cfun and + DECL_SAVED_INSNS and call to ggc_collect to ... + * tree-optimize.c (tree_rest_of_compilation): ... this function. Use + cfun to save/restore function body. + +2003-11-28 Richard Henderson + + * gimplify.c (create_tmp_var_raw): Split out from create_tmp_var. + (create_tmp_var): Use it. + (create_tmp_alias_var): Remove. + * tree-alias-common.c, tree-dfa.c: Use create_tmp_var_raw instead. + * tree-simple.h: Update decls. + +2003-11-28 Richard Henderson + + * gimple-low.c (lower_function_body): Call lower_bind_expr + to handle the outermost BIND_EXPR. + +2003-11-28 Jan Hubicka + + * tree-ssa.c (remove_annotations_r): Kill. + (delete_tree_ssa): Remove annotations using statement walk; + kill argument fndecl. + (rewrite_out_of_ssa): Update call. + +2003-11-27 Andrew MacLeod + + * tree-ssa-live.c (register_ssa_partition): Abort if a virtual SSA + version is registered. + (create_ssa_var_map): Always process PHI nodes. + * tree-ssa.c (Eliminate_virtual_phis): Rename from + eliminate_extraneous_phis, and look specifically for virtuals. + (rewrite_out_of_ssa): Eliminate virtual PHI nodes before building + partitions. + +2003-11-27 Zdenek Dvorak + + * tree-ssa-ccp.c (get_strlen): Mark the visited variables. + (ccp_fold_builtin): Changed due to changed calling convention of + get_strlen. + +2003-11-26 Diego Novillo + + Revert + + 2003-11-25 Jeff law + + * Makefile.in (OBJS-common): Add tree-phinodes.o. + (tree-phinodes.o): Add dependencies. + * tree-phinodes.c: New file. + * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o. + (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly. + (remove_phi_node, remove_all_phi_nodes_for): Similarly. + * tree-ssa.c (init_tree_ssa): Initialize PHI node management. + (delete_tree_ssa): Finalize PHI node management. + * tree.c (dump_tree_statistics): Dump PHI node stats. + (make_phi_node, resize_phi_node): Moved to tree-phinodes.o. + * tree.h (init_phinodes): Prototype. + (fini_phinodes, release_phi_node): Likewise. + (phinodes_print_statistics): Likewise. + +2003-11-25 Jan Hubicka + + * tree-mustalias.c (promote_var): Do not clear + may_point_to_global_mem. + +2003-11-25 Jeff law + + * domwalk.c (walk_dominator_tree): Indicate to the block local + data initializer if the block local data is new or recycled. + * domwalk.h (struct dom_walk_data): Corresponding changes. + * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Accept and use + "recycled" argument. For recycled structures, only clear varrays + that have been initialized. For new blocks, do not initialize + varrays here. + (dom_opt_finalize_block): When threading across edges, if the + true/false varrays have not been initialized, then the limit is zero. + Only clear block local varrays that have been initialized. + (record_equivalences_from_incoming_edge): If necessary, initialize + block local const_and_copies. + (dom_opt_walk_stmts): If necessary, initialize block local + stmts_to_rescan. + (record_var_is_nonzero): If necessary, initialize block local + nonzero_vars. + (record_cond_is_true): If necessary, initialize block local + true_exprs. + (record_cond_is_false): If necessary, initialize block local + false_exprs. + (lookup_avail_expr): If necessary, initialize block local + avail_exprs. + (record_range): If necessary, initialize block local vrp_varaibles. + * tree-ssa.c + * tree-ssa.c (rewrite_initialize_block_local_data): Accept and use + "recycled" argument. For recycled structures, only clear varrays + that have been initialized. For new blocks, do not initialize + varrays here. + (rewrite_finalize_block): Only clear block local varrays that have + been initialized. + (register_new_def): If necessary, initialize block local defs. + + * tree-ssa-dom.c (get_eq_expr_value): Return a struct rather than + a tree node. + (record_equivalences_from_incoming_edge): Corresponding changes. + (find_equivalent_equality_comparison): Use tree_int_cst_XXX rather + then building and folding nodes. + (simplify_cond_and_lookup_avail_expr): Likewise. + + * Makefile.in (OBJS-common): Add tree-phinodes.o. + (tree-phinodes.o): Add dependencies. + * tree-phinodes.c: New file. + * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o. + (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly. + (remove_phi_node, remove_all_phi_nodes_for): Similarly. + * tree-ssa.c (init_tree_ssa): Initialize PHI node management. + (delete_tree_ssa): Finalize PHI node management. + * tree.c (dump_tree_statistics): Dump PHI node stats. + (make_phi_node, resize_phi_node): Moved to tree-phinodes.o. + * tree.h (init_phinodes): Prototype. + (fini_phinodes, release_phi_node): Likewise. + (phinodes_print_statistics): Likewise. + +2003-11-25 Jan Hubicka + + * tree-inline.c (save_body): New body + * tree-inline.h (save_body): Declare. + * tree-optimize.c (tree_rest_of_compilation): Save function tree + properly. + +2003-11-24 Richard Henderson + + * gimplify.c (canonicalize_addr_expr): New. + (gimplify_conversion): Use it. Canonicalize after nop cast removal. + * tree-simple.c (is_gimple_min_invariant): Remove STRING_CST cast + special case. + +2003-11-24 Jeff Law + + * flow.c (count_or_remove_death_notes_bb): New. Extracted from + count_or_remove_death_notes. + (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP. + +2003-11-24 Richard Henderson + + PR 13174, PR 13143 + * gimplify.c (cpt_same_type): Allow different ARRAY_TYPEs with + the same base type. + +2003-11-24 Daniel Berlin + + Fix PR/13163 + * tree-ssa-pre.c (append_eref_to_block): Delete. + (insert_euse_in_preorder_dt_order_1): Ditto. + (insert_one_operand): Take an extra argument, because + avdefs may need to be changed. + (clear_all_eref_arrays): Use FOR_ALL_BB. + (insert_occ_in_preorder_dt_order): Stop appending to bb eref arrays. + Use FOR_ALL_BB. + (insert_euse_in_preorder_dt_order): Rewrite to just build a new varray + with only the EPHI's and EUSE's, and then sort it. + (pre_expression): Don't use bb based erefs array when printing + expressions. + (split_critical_edges): Just use FOR_ALL_BB. + (tree_perform_ssapre): Pre-split entry block successor edge if the + successor block has multiple preds. + + * tree-flow.h (struct bb_ann_d): Remove erefs varray. + +2003-11-24 Daniel Berlin + + * tree-cfg.c (cleanup_tree_cfg): FOR_EACH_BB -> FOR_ALL_BB when + clearing dom children, because the entry block has dom_children + too. + * tree-ssa.c (build_dominator_tree): Ditto. + +2003-11-24 Diego Novillo + + * tree-cfg.c (compute_dominance_frontiers_1, + compute_dominance_frontiers): Move from ssa.c. + * tree-flow.h (compute_dominance_frontiers): Declare. + * Makefile.in (tree-ssa.o, tree-ssa-live.o, tree-ssa-pre.o, + tree-optimize.o): Don't depend on ssa.h. + * tree-ssa.c: Don't include ssa.h. + * tree-ssa-live.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-optimize.c: Likewise. + +2003-11-24 Jan Hubicka + + * fold-const.c (fold): Do not return early when + optimizing COMPONENT_REF and constant. + +2003-11-24 Richard Henderson + + * objc/objc-act.c (build_protocol_expr): Use convert instead of + smashing TREE_TYPE. + +2003-11-23 Andrew MacLeod + + * tree-ssa-live.h (SSANORM_PERFORM_TER, SSANORM_COMBINE_TEMPS, + SSANORM_REMOVE_ALL_PHIS): New flag macros. + * tree-ssa.c (replace_variable): Return true if var was rewritten. + (eliminate_extraneous_phis): Dump var map to file if checking triggers + an abort. + (rewrite_trees): Set modified_stmt if stmt was changed. + (remove_ssa_form): Move more of rewrite_out_of_ssa to make it serve + all the same functions based on new flags in tree-ssa-live.h. + (rewrite_out_of_ssa): Call remove_ssa_form. + +2003-11-23 Jan Hubicka + + * tree-cfg.c (tree_verify_flow_info): Check that ENTRY/EXIT block + has no instructions associated with it. + +2003-11-22 Jeff Law + + * tree-ssa-names.c (release_ssa_name): Use SSA_NAME_IN_FREE_LIST + instead of checking SSA_NAME_DEF_STMT being null. + * tree.h (SSA_NAME_DEF_STMT): Use chain field rather than the + def_stmt field. + (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Use existing flag from tree_common. + (SSA_NAME_IN_FREE_LIST): Define. + (struct tree_ssa_name): Kill DEF_STMT and OCCURS_IN_ABNORMAL_PHI fields. + +2003-11-22 Zdenek Dvorak + + * tree-pretty-print.c (dump_generic_node): Remove superfluous ';'. + +2003-11-22 Diego Novillo + + * Makefile.in (simple-break-elim.o): Remove. + (simple-goto-elim.o): Remove. + (tree-dchain.o): Remove. + * simple-break-elim.c: Remove. + * simple-goto-elim.c: Remove. + * tree-dchain.c: Remove. + * tree-dchain.h: Remove. + +2003-11-22 Daniel Berlin + + * tree-ssa-pre.c (build_dfs_id_array_1): > should be >= + (build_dfn_array): Ditto. + +2003-11-21 Diego Novillo + + * Makefile.in (tree-dfa.o): Add dependency on $(TREE_DUMP_H) + * tree-dfa.c: Include tree-dump.h + (compute_alias_sets): Call dump_function_to_file. + (may_access_global_mem_p): Check if the base address of _REF nodes + may point to global memory. + + * cfgcleanup.c (try_crossjump_to_edge): Initialize newpos1 and + newpos2. + +2003-11-21 Jeff Law + + Revert: + + 2003-11-21 Jan Hubicka + + * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR. + * tree-must-alias.c (tree_compute_must_alias): promote pointers. + (find_addressable_vars): Deal with complex constant + expressions; do not clear may_point_to_global_mem. + +2003-11-21 Jeff Law + + * Makefile.in (domwalk.o): Depend on $(GGC_H). + * domwalk.c: Include ggc.h. + (walk_dominator_tree): Manage allocation/deallocation and + pushing/popping of the toplevel block data pointer here. + Use callback to initialize the block local data. + (init_walk_dominator_tree): New function. + (fini_walk_dominator_tree): Likewise. + * domwalk.h (struct dom_walk_data): Add callback to initialize + block local data. Add field for sizeof block local data. + Add "private" field free_block_data. + (init_dominator_tree, fini_dominator_tree): Prototype. + * tree-ssa-dom.c (dom_opt_initialize_local_data): New function. + (tree_ssa_dominator_optimize_1): Initialize new fields in the + dominator walker structure. Initialize and finalize the dominator + walker. Slightly reorder code to make it more readable.. + (dom_opt_initialize_block): No longer deal with allocation and + initialization of block local data. + (dom_opt_finalize_block): Similarly for deallocation of block + local data. + * tree-ssa.c (rewrite_block_data): New structure. + (rewrite_initialize_block_local_data): New function. + (rewrite_initialize_block): No longer deal with allocation and + initialization of block local data. + (rewrite_into_ssa): Initialize new fields in the dominator walker + structure. Initialize and finalize the dominator walker. + (rewrite_initialize_block): No longer deal with allocation and + initialization of block local data. + (rewrite_optimize_stmts): Deal with changes in the dominator + walker structure. + (rewrite_finalize_block): No longer with deallocation of block + local data. + + * tree-dfa.c (add_vdef, cleanup_voperand_arrays): Use NUM_VDEFS. + (mark_new_vars_to_rename, collect_dfa_status_r): Likewise. + * tree-pretty-print.c (dump_vops): Likewise. + * tree-sra.c (create_scalar_copies): Likewise. + * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise. + * tree-ssa-live.c (create_ssa_var_map): Likewise. + (calculate_live_on_entry): Likewise. + * tree-ssa-pre.c (process_left_occs_and_kills): Likewise. + * tree-ssa.c (mark_def_sites, rewrite_stmt): Likewise. + * tree.h (NUM_VDEFS): Define. + * tree-ssa-ccp.c (visit_stmt): Use NUM_VDEFS. Fix thinko in last + change. + (initialize): Use NUM_VDEFS. + + * tree-dfa.c (add_vdef): Revamp to handle new method for + recording vdefs. + (cleanup_operand_arrays): Similarly. + * tree-sra.c (create_scalar_copies): Similarly. + * tree-ssa-ccp.c (visit_stmt, initialize): Similarly. + * tree-ssa-dce.c (stmt_useful_p, process_worklist): Similarly. + * tree-ssa-dom.c (cprop_into_stmt): Similarly. + (record_equivalences_from_stmt): Similarly. + * tree-ssa-live.c (create_ssa_var_map): Similarly. + (calculate_live_on_entry): Similarly. + * tree-ssa.c (mark_def_sites, rewrite_stmt): Similarly. + * tree-ssa-pre.c (process_left_occr_and_kills): Similarly. + * tree-inline.c (estimate_num_insns_1): Kill VDEF_EXPR. + * tree-pretty-print.c (dump_generic_node) Kill VDEF_EXPR. + (dump_vops): Dump VDEFs here. + * tree.c (build_vdef_expr): Kill. + * tree.h (build_vdef_expr): Kill prototype. + (VDEF_RESULT, VDEF_OP): Revamp to handle new method for recording + vdefs. + * tree.def (VDEF_EXPR): Kill. + + * tree-cfg.c (cfg_remove_useless_stmts): Set both VAR and VAL to + NULL anytime one of them is determined to be invalid. + +2003-11-21 Andrew MacLeod + + * tree-ssa-live.c (compact_var_map): Fix typo. Clear correct field. + (calculate_live_on_entry): Remove unneeded stmt. + * tree-ssa-live.h (version_to_var): New. Return variable associated + with a specific SSA version. + * tree-ssa.c (eliminate_build): Add check that ignored results don't + have important arguments. Allow ignored results. + (coalesce_abnormal_edges): Allow non-relevant results to be ignored. + (eliminate_extraneous_phis): Allow non-relevant results. Check that + no important arguments are being missed. + (coalesce_vars): Non-partition variables are allowed now, just ignored. + (rewrite_trees): New. Split out from rewrite_out_of_ssa. Perform tree + rewriting step. + (remove_ssa_form): New. Allow rewriting of just specified variables. + (rewrite_out_of_ssa): Use rewrite_trees and reorganize slightly to + accommodate typechecking in eliminate_extraneous_phis. + +2003-11-21 Jan Hubicka + + * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR. + * tree-must-alias.c (tree_compute_must_alias): promote pointers. + (find_addressable_vars): Deal with complex constant expressions; + do not clear may_point_to_global_mem. + +2003-11-21 Jan Hubicka + + * parser.c (cp_parser_postfix_expression): Initialize 's' to + NULL_TREE. + +2003-11-20 Richard Henderson + + * Makefile.in (bitmap.o-warn, caller-save.o-warn, combine.o-warn, + cgraphunit.o-warn, c-semantics.o-warn, emit-rtl.o-warn, expr.o-warn, + fold-const.o-warn, genattrtab.o-warn, regmove.o-warn, tree.o-warn, + varasm.o-warn, f/expr.o-warn, profile.o-warn): Remove. + * bitmap.c (bitmap_first_set_bit): Abort if no non-zero word found. + (bitmap_last_set_bit): Likewise. + * combine.c (get_pos_from_mask): Always set *plen. + +2003-11-20 Richard Henderson + + * tree-dfa.c (get_expr_operands): Remove handling of PLUS_EXPR + inside INDIRECT_REF. + +2003-11-20 Diego Novillo + + * tree-nomudflap.c (nogo): Fix prototype. + +2003-11-20 Richard Henderson + + * except.c (output_function_exception_table): Strip nops. + * gimplify.c (gimplify_addr_expr): Kill missing cast workaround. + (cpt_same_type, check_pointer_types_r): New. + (gimplify_body): Call it. + * tree-inline.c (insert_decl_map): New. + (remap_decl, remap_type, remap_block, copy_body_r, + initialize_inlined_parameters, declare_return_variable, + remap_save_expr, mark_local_for_remap_r): Use it. + +2003-11-20 Frank Ch. Eigler + + libstdc++/11696 + * c-pragma.c (handle_pragma_redefine_extname): Define always. + (init_pragma): Activate #pragma redefine_extname for mudflap. + + * tree-inline.c (copy_tree_r): Propagate mf_marked-ness. + * tree-mudflap.c (mudflap_c_function): Break into new + _decls and _ops functions. + (mudflap_c_function_decls): Avoid unnecessary tree copying. + (mudflap_c_function_ops): Ditto. Gimplify explicitly only for + tree dumping. + * tree-nomudflap.c: Add new stub functions. Simplify error + message emission throughout. + * tree-mudflap.h: Corresponding changes. + * tree-optimize.c (tree_rest_of_compilation): Call the _decl + instrumentation before gimplification and ssa optimizations; + call the _ops instrumentation after ssa optimizations. + +2003-11-20 Diego Novillo + + Initial fix for PR optimization/12747 + + * Makefile.in (OBJS): Add tree-sra.o + * common.opt (ftree-sra): Add. + * flags.h (flag_tree_sra): Declare. + * gimplify.c (gimplify_addr_expr): Set TREE_INVARIANT + when producing and address expression for a DECL node. + * opts.c (decode_options): Enable SRA at -O1. + (common_handle_option): Handle -ftree-sra. + * timevar.def (TV_TREE_SRA): New timer. + * toplev.c (flag_tree_sra): Define. + * tree-cfg.c (stmt_ends_bb_p): Declare extern. + (bsi_replace): Add boolean argument to specify whether to + preserve EH region information. Update all callers. + (bsi_commit_edge_inserts): Also check the edge from ENTRY_BLOCK_PTR + to basic block 0. + Move loop body ... + (bsi_commit_edge_inserts_1): ... here. + * tree-dump.c: Add dump for SRA pass. + * tree.h (enum tree_dump_index): Modify accordingly. + (STRIP_USELESS_TYPE_CONVERSION): Define. Update all callers to + tree_ssa_useless_type_conversion. + * tree-eh.c (add_stmt_to_eh_region): New function. + * tree-flow.h (stmt_ends_bb_p): Declare. + (add_stmt_to_eh_region): Declare. + (tree_sra): Declare. + (enum bsi_iterator_update): Mirror entries in + enum tsi_iterator_update. + * tree-optimize.c (optimize_function_tree): Call SRA pass + after must-alias. + * tree-sra.c: New file. + * doc/invoke.texi: Document -ftree-sra and -fdump-tree-sra. + +2003-11-20 Andrew Macleod + + * tree-ssa.c (check_replaceable): Return false if the LHS is a + DECL_HARD_REGISTER. + +2003-11-20 Diego Novillo + + * tree-ssa-ccp.c (set_rhs): Replace with an empty statement when + the replacement has no side effects. + +2003-11-20 Jeff Law + + * Makefile.in (OBJS-common): Kill tree-ssa-copyprop.o. + (tree-ssa-copyprop.o): Kill dependencies clause. + * common.opt (tree-copyprop): Kill option. + * flags.h (flag_tree_copyprop): Kill. + * opts.c (decode_options): Don't set flag_tree_copyprop. + (common_handle_option): Kill handling of -ftree-copyprop. + * timevar.def (TV_TREE_COPYPROP): Kill. + * toplev.c (flag_tree_copyprop): Kill. + (lang_independent_options): Kill -ftree-copyprop. + * tree-dump.c (dump_files): Kill .copyprop dump. + * tree-flow.h (tree_ssa_copyprop): Kill prototype. + (propagate_copy): Move prototype. + * tree-optimize.c (optimize_function_tree): Kill -ftree-copyprop stuff. + * tree.h (tree_dump_index): Kill TDI_copyprop. + * tree-ssa-copyprop.c: Kill. + * tree-ssa-dom.c (propagate_copy): Moved here from tree-ssa-copyprop.c. + + * tree-ssanames.c (free_ssanames): No longer a varray. + (init_ssanames, make_ssa_name, release_ssa_name): Corresponding changes. + +2003-11-20 Steven Bosscher + + * tree-ssanames.c (ssanames_print_statistics): Use ISO function + declaration. Print unsigned ints, not usinged longs. + +2003-11-18 Daniel Berlin + + * tree-ssa-pre.c (rename_1): This should be static. + (append_eref_to_block): Don't gc allocate. + (clear_all_eref_arrays): Free the array rather than + clear them. + (rename_1): Ditto on both counts. + (free_expr_info): Free the arrays. + (collect_expressions): Don't gc allocate the arrays. + +2003-11-18 Daniel Berlin + + * tree-ssa-pre.c (insert_one_operand): Handle self-referential + ephi's properly. + +2003-11-19 Jeff Law + + * tree-ssa-dom.c (true_exprs, false_exprs): New hash tables. + (nonzero_vars): New varray. + (dom_walk_block_data): Add true_exprs, false_exprs and nonzero_vars. + (get_value_for, set_value_for): Accept additional argument indicating + which table to use. Callers updated. + (tree_ssa_dominator_optimize_1): Initialize and wipe our new hash + tables and varray appropriately. + (dom_opt_initialize_block): Initialize new block local varrays for + true expressions, false expressions and nonzero vars. Update call + to record_equivalences_from_incoming_edge. + (dom_opt_finalize_block): Put equivalences from taken edges + into the true_exprs and false_exprs hash tables. Restore global + state for true_exprs, false_exprs and nonzero_vars too. + (record_equivalences_from_incoming_edge): Accept dom_walk structure + instead of a gazillion varrays. Pass down block local + true_exprs, false_exprs and nonzero_vars varrays to various children. + (optimize_stmt): Accept block local nonzero_vars argument. Pass + new varrays down to record_equivalences_from_stmt. + (thread_jumps_walk_stmt): Pass new varrays down to + record_equivalences_from_stmt. + (dom_opt_walk_stmt): Pass new varrays down to optimize_stmt. + (dump_dominator_optimizer_statistics): Dump new hash tables. + (record_cond_is_true, record_cond_is_false): Record info into + the true/false hash tables/varrays instead of the main expression + varrays. Don't create useless tree nodes. + (record_var_is_nonzero): New function. + (record_equivalences_from_stmt): Don't generate useless tree nodes. + (lookup_avail_expr): Consult nonzero_vars and the true/false + expression tables as well. + (get_eq_expr_value): Record local true/false expressions in the + local true/false varrays rather than the main local expression + varray. + (true_false_expr_hash, true_false_expr_eq): New functions. + + * Makefile.in (OBJS-sommon): Add tree-ssanames.o. + (tree-ssanames.o): Add dependencies. + * tree-dfa.c (remove_phi_node): Release SSA_NAME expression when + we remove the PHI node. + (remove_all_phi_nodes_for): Similarly. + * tree-ssa.c (prepare_operand_for_rename): Similarly when we + strip away an SSA_NAME expression from an operand. + (init_tree_ssa): Call the SSA_NAME initializer. + (delete_tree_ssa): Call the SSA_NAME finalizer. + * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Clear the + const_and_copies and vrp_data virtual arrays. + * tree-ssanames.c: New file for management of SSA_NAME expressions. + * tree.h: Prototypes for functions exported by tree-ssanames.c. + * tree-flow.h, tree-ssa-ccp.c, tree-ssa-dce.c: Use highest_ssa_version + rather than next_ssa_version. + * tree-ssa-dom.c, tree-ssa-live.c, tree-ssa.c: Similarly. + * tree.c (dump_tree_statistics): Call into tree-ssaname statistics + dumper too. + (make_ssa_name): Kill. Now in tree-ssanames.c + +2003-11-18 Richard Henderson + + * tree.c (recompute_tree_invarant_for_addr_expr): Split out from ... + (build1): ... here. + * tree.h: Declare it. + * gimplify.c (gimplify_addr_expr): Use it. + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Split out + from fold_indirect_refs_r. + (maybe_fold_stmt_indirect): Likewise. + (maybe_fold_offset_to_component_ref): New. + (maybe_fold_stmt_plus): New. + (fold_stmt_r): Rename from fold_indirect_refs_r. + (fold_stmt): Strip more useless type conversions. + +2003-11-18 Richard Henderson + + * tree-cfg.c (dump_function_to_file): Mind when cfun is null. + +2003-11-18 Diego Novillo + + Revert + + 2003-11-18 Jan Hubicka + + * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash. + * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR. + + 2003-11-18 Jan Hubicka + + * Makefile.in (sibcall.o): Kill. + (tree-tailcall.o): Add except.h dependency + * sibcall.c: Kill. + (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ... + * calls.c (purge_reg_equiv_notes, + purge_mem_unchanging_flag) ... here. + (expand_call): Do not produce placeholders; do + not deal with tail recursion; update + equivalencies after sibcall production. + * toplev.c (rest_of_handle_sibling_calls): Kill. + (rest_of_compialtion): Do not use rest_of_handle_sibling_calls. + * tree-dump.c (dump_files): Add tail2 + * tree-flow.h (tree_optimize_tail_calls): Update prototype. + * tree-optimize.c (optimize_function_tree): Do + tail optimization twice. + * tree-tailcall.c: Inlucde except.h + (suitable_for_tail_call_opt_p): New. + (optimize_tail_call): Add opt_tailcalls argument; + optimize tailcalls. + (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments. + * tree.h (CALL_EXPR_TAILCALL): New. + (tree_dump_index): Add tail2 + +2003-11-18 Jan Hubicka + + * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash. + * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR. + +2003-11-18 Diego Novillo + + * tree-optimize.c (optimize_function_tree): Disable tail + call optimizations. + +2003-11-18 Jan Hubicka + + * Makefile.in (sibcall.o): Kill. + (tree-tailcall.o): Add except.h dependency + * sibcall.c: Kill. + (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ... + * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here. + (expand_call): Do not produce placeholders; do not deal with tail + recursion; update equivalencies after sibcall production. + * toplev.c (rest_of_handle_sibling_calls): Kill. + (rest_of_compialtion): Do not use rest_of_handle_sibling_calls. + * tree-dump.c (dump_files): Add tail2 + * tree-flow.h (tree_optimize_tail_calls): Update prototype. + * tree-optimize.c (optimize_function_tree): Do tail optimization twice. + * tree-tailcall.c: Inlucde except.h + (suitable_for_tail_call_opt_p): New. + (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls. + (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments. + * tree.h (CALL_EXPR_TAILCALL): New. + (tree_dump_index): Add tail2 + +2003-11-18 Jeff Law + + * tree-ssa-dom.c (thread_across_edge): Lose block_avail_exprs argument. + Callers updated. Pass NULL for block_avail_exprs in call to + lookup_avail_expr. Record both the condition and the inverted + condition when threading across an edge. + +2003-11-18 Richard Henderson + + * tree-ssa.c (tree_ssa_useless_type_conversion): Use TYPE_MAIN_VARIANT + when compariing pointer types too. + +2003-11-18 Jan Hubicka + + * tree-dump.c (dump_files): Reorder tail calls. + * tree-optimize.c (optimize_function_tree): Likewise + * tree-tailcall.c (optimize_tail_call, eliminate_tail_call): Remove + variable tmpvars; update SSA. + (suitable_for_tail_opt_p): Do not give up because of static variables. + (find_tail_calls): Track return values in SSA graph. + * tree.c (make-phi_node): Do not create new SSA name when operand + already is. + * tree.h (enum tree_dump_index): Reorder tail call. + +2003-11-17 Diego Novillo + + * gimplify.c (gimplify_call_expr): Change gimple_test_f argument to + return bool type. + (mark_decls_volatile_r): New local function. + (gimplify_expr): Make gimple_test_f return bool type. + Call mark_decls_volatile_r when gimplifying VA_ARG_EXPR. + * tree-dfa.c (struct walk_state): Remove field is_va_arg_expr. + Update all callers. + (opf_force_vop): Remove. Update all users. + (add_stmt_operand): Re-structure to add real operands only for + GIMPLE register variables. + (find_vars_r): Don't handle VA_ARG_EXPR nodes. + (add_referenced_var): Also assign a UID to variables with hidden + uses. + Call is_gimple_call_clobbered to determine if a variable is call + clobbered. + (get_memory_tag_for): Mark memory tags volatile and static. + * tree-flow.h (struct var_ann_d): Remove field is_in_va_arg_expr. + Update all users. + * tree-simple.c (is_gimple_*): Change return type to bool. Update + all users. + (is_gimple_reg_type): Return true only for non aggregate types. + (is_gimple_non_addressable_1): New local function. + (is_gimple_reg): Call it. + (is_gimple_non_addressable): New function. + (is_gimple_call_clobbered): New function. + * tree-simple.h (is_gimple_*): Change return type to bool. + +2003-11-17 Jason Merrill + + PR c++/11266 + * gimplify.c (gimple_add_tmp_var): Also make sure + seen_in_bind_expr isn't set. + (mostly_copy_tree_r): Don't copy a TARGET_EXPR. + (gimplify_target_expr): Only expand a TARGET_EXPR the first time + we see it. + +2003-11-17 Richard Henderson + + * tree-pretty-print.c (dump_generic_node): Use %u not %x for + printing DECL_UID. + +2003-11-16 Richard Henderson + + * c-common.c (c_add_case_label): Use create_artificial_label. + * tree-simple.h (create_artificial_label): Move decl ... + * tree.h: ... here. + +2003-11-16 Richard Henderson + + PR c++/12770 + * gimple-low.c (lower_stmt_body): Take a tree, not a tree*. + (lower_stmt): Handle EH nodes. + (lower_bind_expr): Remove fixme. + (block_may_fallthru): Move from tree-eh.c. Handle COND_EXPR, + BIND_EXPR, and TRY_FINALLY_EXPR. + (lower_cond_expr): Use it. + * tree-eh.c (collect_finally_tree): Ignore COND_EXPR and BIND_EXPR. + (replace_goto_queue_cond_clause): New. + (replace_goto_queue_1): Use it. Split out statement_list handling. + (replace_goto_queue_stmt_list): New. + (-block_may_fallthru): Move to gimple-low.c. + (lower_eh_constructs_1): Ignore BIND_EXPR. + * tree-flow.h (block_may_fallthru): Declare. + + * tree-dump.c (dump_files): Exchange .eh and .lower passes. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * tree.h (enum tree_dump_index): Likewise. + +2003-11-16 Jason Merrill + + * gimplify.c (mostly_copy_tree_r): Don't walk into a BLOCK. + + * tree-inline.c (walk_tree): Don't walk into the BIND_EXPR_VARS + of a BIND_EXPR. + * c-common.c (c_walk_subtrees): Don't walk into the decl of a + DECL_STMT. + + PR optimization/11269 + * dwarf2out.c (gen_subprogram_die): Generate a DIE for a named + return value. + (loc_descriptor_from_tree): Treat RESULT_DECL like VAR_DECL. + (add_location_or_const_value_attribute): Likewise. + (add_bound_info): Likewise. + (gen_decl_die): Likewise. + +2003-11-16 Jason Merrill + + * c-pretty-print.c (debug_c_tree): Restore removed fn. + * diagnostic.h: Declare it. + + * tree-pretty-print.c (dump_generic_node): Use DECL_UID when + dumping anonymous decls. + +2003-11-16 Richard Henderson + + * tree-cfg.c (last_and_only_stmt): New. + * tree-flow.h (last_and_only_stmt): Declare. + * tree-ssa-dom.c (thread_across_edge): Use it. + + * tree-cfg.c (tree_block_forwards_to): Don't check for empty stmts. + (tree_forwarder_block_p): Likewise. + * tree-dfa.c (get_stmt_operands): Likewise. + * tree-ssa-ccp.c (set_rhs): Likewise. + * tree-ssa-dom.c (optimize_stmt): Likewise. + * tree-ssa.c (rewrite_stmt): Likewise. + +2003-11-16 Richard Henderson + + * tree.h (LABEL_DECL_UID): Rename from LABEL_DECL_INDEX. + * tree-flow.h (bsi_remove): Declare. + * tree-flow-inline.h (bsi_remove): Move ... + * tree-cfg.c (set_bb_for_stmt): Don't re-set LABEL_DECL_UID. + Verify that a label isn't already in a block before adding it. + (bsi_remove): Move from tree-flow-inline.h, clear bb. + * tree-pretty-print.c (dump_generic_node): Use LABEL_DECL_UID if set. + +2003-11-15 Richard Henderson + + * function.c (clear_block_marks): Rename from reorder_blocks_0, export. + * function.h (clear_block_marks): Declare. + * gimple-low.c (lower_function_body): Use it. + (lower_bind_expr): Ensure we don't link blocks into the tree twice. + * gimplify.c (gimplify_body): Keep old bind_expr at top level if + possible. + +2003-11-14 Richard Henderson + + * tree-ssa-pre.c (split_critical_edges): Reimplement. Call + tree_split_edge directly. + +2003-11-14 Jason Merrill + + * tree-eh.c (do_return_redirection): Assign directly to the + RESULT_DECL of a function which returns in memory. + +2003-11-14 Daniel Berlin + + * tree-ssa-pre.c (pre_stats): Add ephis_current member. + (create_ephi_node): Use xmalloc, not ggc_alloc_tree. + (clear_all_eref_arrays): Free the ephis here. + (expr_phi_insertion): Don't append the ephis to the erefs array. + (insert_occ_in_preorder_dt_order): Move building/freeing of dfn + array so that it only occurs once per function.. + (rename_1): Ditto on the dfs_id array. + (ephi_use_pool): New alloc pool. + (add_ephi_use): Pool allocate these things, rather than + ggc_alloc'ing them. + (insert_euse_in_preorder_dt_order_1): Use ephi_at_block to put the + ephi in the list. + (pre_expression): Don't PRE when we only have 1 occurrence. + (expr_lexically_eq): Make inline. + (names_match_p): Move closer to first use. + (tree_perform_ssapre): Alloc and free the ephi_use_pool. + Make stat printing per-expression. + Add checking that we freed all ephis. + +2003-11-14 Andrew MacLeod + + * common.opt (ftree-ter): Document new option. + * flags.h (flag_tree_ter): Add new flag. + * fold-const.c (invert_truthvalue): Don't ignore cast to BOOLEAN_TYPE. + * opts.c (decode_options): Option -ftree-ter defaults to on. + (common_handle_option): Add processing for flag_tree_ter. + * toplev.c (flag_tree_ter): Initialize to 0. + (lang_independent_options f_): Add -ftree-ter flag. + * tree-ssa-live.c (init_var_map): Initialize ref_count to 0. + (delete_var_map): Free ref count if allocated. + (register_ssa_partition): Add "is_use" parameter for reference counting. + (create_ssa_var_map): Add flag and code for calculating ref counts. + * tree-ssa-live.h (struct _var_map): Add ref_count field. + (SSA_VAR_MAP_REF_COUNT): Define flag. + (version_ref_count): Function to retreive ref_count. + * tree-ssa.c (replace_variable): If an expression vector is passed in, + use replacement expression instead of mapped variable when available. + (struct value_expr_d): New structure for value lists. + (struct temp_expr_table_d): Structure used to build an expression + replacement table. + (new_temp_expr_table): New. Create a new TER (Temporary Expression + Replacement) table. + (free_temp_expr_table): New. Free a TER table. + (new_value_expr): New. Allocate a value list element. + (free_value_expr): New. Free a value list element. + (find_value_in_list): New. Find a value in a list. + (add_value_to_list): New. Add a value to a list if not already present. + (remove_value_from_list): New. Remove a value from a list. + (add_dependance): New. Add a dependency to an expression. + (check_replaceable): New. Check if a stmt is a candidate for TER. Add + to active list and create dependancies if so. + (finish_expr): New. Remove an expression from TER consideration. + (mark_replaceable): New. Finish a TER expression as a valid replacement. + (kill_expr): New. Finish dependent TER expressions as not replaceable. + (kill_virtual_exprs): New. Finish any TER expressions dependent on a + virtual operand as not replaceable. + (find_replaceable_in_bb): New. Process a basic block for TER expression. + (find_replaceable_exprs): New. Entry point for TER expression finder. + (dump_replaceable_exprs): New. output list of replaceable expressions. + (rewrite_out_of_ssa): Build TER table if requested, and use it. + +2003-11-14 Andreas Jaeger + + * c-semantics.c (find_reachable_label): Use C90 function + declaration. + +2003-11-14 Jason Merrill + + PR middle-end/12526 + * tree-cfg.c (call_expr_flags): Move to calls.c. + * tree-flow.h: Move prototype to tree.h. + + PR c++/13033 + * c-simplify.c (gimplify_c_loop): Wrap the increment in a + CLEANUP_POINT_EXPR. + + * tree-dfa.c (get_stmt_operands) : A memory clobber + clobbers all call-clobbered variables. Clobber clobber. + + * gimplify.c (canonicalize_component_ref): Remove redundant call + to recalculate_side_effects. + +2003-11-14 Richard Henderson + + PR c++/12751 + * tree-eh.c (struct leh_tf_state): Add outer. + (lower_try_finally, lower_cleanup): Set it. + (lower_try_finally_fallthru_label): New. + (honor_protect_cleanup_actions): Use it. + (lower_try_finally_copy, lower_try_finally_switch): Likewise. + + * tree-eh.c (collect_finally_tree): Complete manual tailrecurse + transformation. + +2003-11-14 Richard Henderson + + * gimplify.c (voidify_wrapper_expr): Don't clobber TREE_TYPE of + statements in a STATEMENT_LIST. Be prepared for an empty list. + +2003-11-14 Steven Bosscher + + * jump.c (never_reached_warning): Remove function. + * rtl.h (never_reached_warning): Don't declare it. + * cfgrtl.c (never_reached_warning): Don't call it. + * cse.c (never_reached_warning): Ditto. + +2003-11-13 Jeff Law + + * tree-cfg.c (bsi_replace): Restore accidentally removed code. + + * tree-cfg.c (cfg_remove_useless_stmts_bb): Also detect useless + var->var copies created by the out-of-ssa translation. + +2003-11-13 Steven Bosscher + + PR middle-end/11514 + * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR. + +2003-11-13 Richard Henderson + + * tree-cfg.c (cfg_remove_useless_stmts_bb): Initialize stmt. + +2003-11-13 Jan Hubicka + + * calls.c (special_function_p): Do not check for ECF_MALLOC. + (flags_from_decl_or_type): Use special_function_p. + (expand_call): Remove call to special_function_p. + * tree-cfg.c (notice_special_calls, clear_special_calls): New functions. + (remove_useless_stmts): Use clear_special_calls. + (remove_useless_stmts_1): Use notice_special_calls. + * tree-flow.h (notice_special_calls, clear_special_calls): New functions. + * tree-ssa-dce.c (remove_dead_stmts): Use clear_special_calls and + notice_special_calls.. + + * gimplify.c (gimplify_expr): Check labels. + + * tree-cfg.c (tree_verify_flow_info): Check labels. + + * tree-cfg.c (make_exit_edges): Do not create edges for const + functions. + (update_call_expr_flags): Fix. + +2003-11-12 Diego Novillo + + (declare_inlined_vars): New local function. + (initialize_inlined_parameters): Call it. + (expand_call_inline): Call it. + +2003-11-13 Steven Bosscher + + PR optimization/12640 + * tree-ssa-ccp.c (get_strlen): Don't follow the UD chain + of a PHI argument if the DEF stmt for the argument is + the PHI itself. + +2003-11-12 Zdenek Dvorak + Jeff Law + + * tree-cfg.c (cfg_remove_useless_stmts): New function. + (cfg_remove_useless_stmts_bb): Likewise. + * tree-flow.h (cfg_remove_useless_stmts): Prototype. + * tree-ssa.c (rewrite_out_of_ssa): Use cfg_remove_useless_stmts + instead of remove_useless_stmts. + +2003-11-12 Richard Henderson + + * Makefile.in (OBJS-common): Add tree-iterator.o. + (expr.o): Depend on tree-iterator.h. + (GTFILES): Add tree-iterator.c. + * basic-block.h (struct basic_block_def): Replace head_tree_p + and end_tree_p with stmt_list. + (tree_bb_root): New. + (create_bb): Don't declare. + * c-common.c (c_warn_unused_result): Handle STATEMENT_LIST. + * c-simplify.c (c_gimplify_stmt): Don't rationalize_compound_expr. + * cfg.c (entry_exit_blocks): Adjust for member changes. + (compact_blocks): Manage tree_bb_root. + * expr.c (expand_expr_1): Handle STATEMENT_LIST. + * gimple-low.c: Update for tree_stmt_iterator changes. + (lower_cond_expr): Use expr_only. Notice empty conditionals. + * gimplify.c (append_to_statement_list_1): Create and + manage statement_list nodes. + (foreach_stmt): Remove. + (wfl_locus): Remove. + (annotate_all_with_locus_1): Merge into... + (annotate_all_with_locus): ... here. Iterate over the + statement list directly. + (voidify_wrapper_expr): Handle STATEMENT_LIST. + (gimplify_return_expr): Likewise. + (gimplify_loop_expr): Likewise. + (shortcut_cond_r, shortcut_cond_expr): Likewise. + (gimplify_cleanup_point_expr): Likewise. + (gimple_build_eh_filter): Create statement list bodies. + (gimplify_bind_expr): Likewise. + (gimplify_switch_expr): Likewise. + (gimplify_cond_expr): Likewise. + (gimplify_compound_expr): Handle void expressions as well. + (gimplify_statement_list): New. + (gimple_push_cleanup): Gimplify the WITH_CLEANUP_EXPR operand. + (gimplify_stmt): Ensure non-null result. + (gimplify_to_stmt_list): New. + (gimplify_expr): Use gimplify_compound_expr, gimplify_statement_list, + gimplify_to_stmt_list as appropriate. + (gimplify_body): Fix creation of outer BIND_EXPR. + * tree-cfg.c (tree_bb_root): New. + (build_tree_cfg): Initialize it. Update for make_blocks changes. + (factor_computed_gotos): Use create_bb directly. + (make_blocks): Rewrite to use statement lists. + (append_stmt_to_bb, prepend_stmt_to_bb): Remove. + (create_bb): Make static. Add stmt_list argument. Don't allow + null after argument. Set tree_bb_root. + (make_edges): ENTRY block successor is FALLTHRU. + (remove_useless_stmts_warn_notreached): Handle STATEMENT_LIST. + (struct rus_data): Add last_goto. + (remove_useless_stmts_cond): Clear it. Zap empty conditionals. + Use expr_only for simple statment elimination. + (remove_useless_stmts_tf): Clear last_goto. Use TREE_SIDE_EFFECTS + instead of IS_EMPTY_STMT. Use append_to_statement_list instead of + munging to COMPOUND_EXPR. + (remove_useless_stmts_tc): Clear last_goto. Use TREE_SIDE_EFFECTS. + (remove_useless_stmts_goto): Set last_goto. + (remove_useless_stmts_label): New. Kill goto-next-label. + (remove_useless_stmts_1): Reorg to handle STATEMENT_LIST. + (remove_bb): Simplify block removal. + (remove_bsi_from_block): Kill. + (tree_block_forwards_to): Tidy bsi loops. Do not create + block label here. + (tree_cfg2dot): Update for bb->stmt_list. + (delete_tree_cfg): Clear tree_bb_root. + (set_bb_for_stmt): Handle STATEMENT_LISTs. + (bsi_insert_before, bsi_insert_after): Re-implement on TSIs. + (bsi_move_after, bsi_move_before, bsi_move_to_bb_end): Likewise. + (bsi_replace): Likewise. + (tree_find_edge_insert_loc): New, split from ... + (bsi_insert_on_edge_immediate): ... here. + (bsi_commit_edge_inserts): Use it. Add all stmts at once. + (bsi_insert_on_edge): Use statement lists. + (tree_split_edge): Position new block correctly. Deal with + fallthrough to EXIT. + (tree_verify_flow_info): Do not check block order vs statement chain. + (tree_make_forwarder_block): Update create_bb call, fix edge flags. + (thread_jumps): Call tree_redirect_edge_and_branch directly. + (tree_block_label): Don't return a NONLOCAL_LABEL. + (tree_redirect_edge_and_branch_1): Rename from s/_1//. Take an + argument to use ssa_redirect_edge or redirect_edge_succ. Use + tree_split_edge instead of bsi_insert_on_edge_immediate. + (tree_redirect_edge_and_branch): New. + (remove_stmt, first_exec_stmt, bsi_init, bsi_next_in_bb): Kill. + (bsi_start, bsi_last, bsi_prev, bsi_from_tsi): Kill. + (bsi_update_from_tsi, bsi_link_after): Kill. + * tree-eh.c (collect_finally_tree): Handle STATEMENT_LIST. + (replace_goto_queue_1): Likewise. + (replace_goto_queue): Don't use walk_tree. + (do_return_redirection): Create statement lists. + (do_goto_redirection): Likewise. + (block_may_fallthru_last): Fold into... + (block_may_fallthru): ... here. + (frob_into_branch_around): Use append_to_statement_list. + (honor_protect_cleanup_actions): Likewise. + (lower_try_finally_nofallthru): Likewise. + (lower_try_finally_onedest): Likewise. + (lower_try_finally_copy): Likewise. + (lower_try_finally_switch): Likewise. + (lower_try_finally): Likewise. + (lower_catch): Likewise. + (lower_eh_filter): Likewise. + (lower_eh_constructs_1): Handle STATEMENT_LIST. + * tree-flow-inline.h (BSI_NUM_ELEMENTS, bsi_list_p): Remove. + (new_bsi_list, empty_bsi_stack, FOR_EACH_BSI_IN_REVERSE): Remove. + (FOR_EACH_STMT_IN_REVERSE): Remove. + (bsi_start, bsi_last, bsi_end_p): Re-implement based on TSIs. + (bsi_next, bsi_prev, bsi_stmt, bsi_stmt_ptr, bsi_remove): Likewise. + * tree-flow.h (block_stmt_iterator): Likewise. + * tree-inline.c (copy_statement_list): New. + (copy_body_r): Use it, and append_to_statement_list. + (initialize_inlined_parameters): Use append_to_statement_list. + (expand_call_inline): Likewise. + (gimple_expand_calls_inline): New. + (expand_calls_inline): Use it. + (walk_tree, unsave_r): Handle STATEMENT_LIST. + (add_stmt_to_compound): Remove. + * tree-iterator.c: New file. + * tree-iterator.h: Re-implement based on STATEMENT_LIST. + * tree-mudflap.c (mf_decl_cache_locals): Don't + rationalize_compound_expr. + * tree-optimize.c (optimize_function_tree): Make static. + Rechain statements from blocks before deleting the cfg. + * tree-pretty-print.c (dump_generic_node): Handle STATEMENT_LIST, + update for change in tree_stmt_iterator wrt COMPOUND_EXPR. + (dump_generic_node): Dump lowered COND_EXPR on a single line. + * tree-simple.c (is_gimple_stmt): Handle STATEMENT_LIST. + * tree-simple.h (foreach_stmt_fn, foreach_stmt): Remove. + (gimplify_to_stmt_list): Declare. + (alloc_stmt_list, free_stmt_list): Declare. + * tree-ssa-dce.c (should_remove_dead_stmt): Rename from + remove_dead_stmt; return bool if statement should be removed. + (remove_dead_stmts): Update to match. + * tree-ssa-live.c (build_tree_conflict_graph): Don't use + FOR_EACH_STMT_IN_REVERSE. + * tree-ssa-pre.c (reaching_def): Tidy BSI usage. + (insert_one_operand, collect_expressions): Likewise. + * tree.c (tree_size): Handle STATEMENT_LIST. + (copy_node): Abort on STATEMENT_LIST. + (expr_first, expr_last): Move to tree-iterator.c. + (expr_length): Remove. + (tree_node_structure): Handle STATEMENT_LIST. + (tsi_link_before, tsi_link_after, tsi_delink): Move to tree-iterator.c. + (tsi_link_chain_before, tsi_link_chain_after): Merge into non-chain. + (tsi_new_stmt_list, tsi_stmt_list_head, body_is_empty): Kill. + * tree.def (STATEMENT_LIST): New. + * tree.h (STATEMENT_LIST_HEAD, STATEMENT_LIST_TAIL): New. + (struct tree_statement_list_node): New. + (struct tree_statement_list): New. + (enum tree_node_structure_enum): Add TS_STATEMENT_LIST. + (union tree_node): Add stmt_list. + (expr_length): Remove. + (expr_only): New. + (add_to_compound_expr, body_is_empty): Remove. + (optimize_function_tree): Remove. + +2003-11-12 Zdenek Dvorak + + * tree-flow.h (remove_useless_vars): Declare. + (expand_var_p): Declaration removed. + * tree-ssa.c (rewrite_out_of_ssa): Call remove_useless_vars. + * tree-cfg.c (dump_function_to_file): Update dumping of variables. + * gimple-low.c (expand_var_p): Made static. + (remove_useless_vars): New. + (expand_used_vars): Expand all variables in the + cfun->unexpanded_var_list. + +2003-11-11 Richard Henderson + + * c-common.c (c_gimplify_stmt): Fix botched removal of + rationalize_compound_expr calls. + + * c-semantics.c (build_stmt): Set TREE_SIDE_EFFECTS. + * c-simplify.c (c_gimplify_stmt): Return a gimplify_status; + mind the status from subroutines to avoid re-gimplification. + (c_build_bind_expr): Do not call gimplify_stmt. + (gimplify_c_loop): Don't create a loop_expr; fully gimplify. + (gimplify_block, gimplify_cleanup, gimplify_expr_stmt, + gimplify_for_stmt, gimplify_while_stmt, gimplify_do_stmt, + gimplify_if_stmt, gimplify_switch_stmt, gimplify_return_stmt, + gimplify_decl_stmt, gimplify_compound_literal_expr, + gimplify_stmt_expr): Return a gimplify_status. In most cases, + don't do local gimplification of sub-structures. + (gimplify_decl_stmt): Use append_to_compound_expr when we care + about the result value. + (gimplify_stmt_expr): Use append_to_statement_list_force and + re-gimplify so that voidify_wrapper_expr can work. + (finish_bc_block): Don't append to a non-list. + (c_gimplify_expr): Pass back the gimplify_status of subroutines. + * c-common.h (c_gimplify_stmt): Update decl. + * gimplify.c (append_to_statement_list_1): Make sure list_p is + never null after call. + (append_to_compound_expr): New. + * tree-simple.h (append_to_compound_expr): Declare. + +2003-11-11 Richard Henderson + + * gimplify.c (gimplify_addr_expr): Clear, not copy, TREE_SIDE_EFFECTS. + +2003-11-11 Richard Henderson + + PR c/13014 + * c-simplify.c (gimplify_if_stmt): Remove short circuit. + * tree-cfg.c (struct rus_data): Add has_label. + (remove_useless_stmts_warn_notreached): New. + (remove_useless_stmts_cond): Warn for deleted conditionals. + (remove_useless_stmts_tc): Warn for deleted catches. + (remove_useless_stmts_1): Set has_label. + +2003-11-11 Jan Hubicka + + * gimplify.c (gimplify_call_expr): Unset side effects for + pure functions too. + * tree-cfg.c (update-call_expr_flags): New function. + (remove_useless_stmts_and_vars_1): Use it. + (is_ctrl_altering_stmt): Pure/const calls never alter the CFG. + * tree-ssa-dce.c (stmt_useful_p): Check side effects flag + on call exprs. + +2003-11-11 Jan Hubicka + + * tree-cfg.c (has_label_p): New function. + (tree_verify_flow_info): New checks. + * tree-optimize.c (optimize_function_tree): Call verify_flow_info + before de-SSA. + +2003-11-11 Richard Henderson + + * tree-cfg.c (struct rus_data): Rename from rusv_data. + Remove remove_unused_vars. + (remove_useless_stmts*): Rename from remove_useless_stmts_and_vars*. + (remove_useless_stmts_bind): Do not remove dead variables. + (remove_useless_stmts): Kill remove_unused_vars argument. + * tree-flow.h (remove_useless_stmts): Update. + * tree-optimize.c (tree_rest_of_compilation): Update call. + * tree-ssa.c (rewrite_out_of_ssa): Likewise. + +2003-11-11 Zdenek Dvorak + Diego Novillo + + * basic-block.h (brief_dump_cfg): Declare. + * cfg.c (dump_cfg_bb_info, brief_dump_cfg): New. + * diagnostic.h (dump_generic_node): Declaration changed. + (print_generic_stmt_indented): Declare. + * gimple-low.c (expand_var_p): New. + (expand_used_vars): Use it. + * tree-cfg.c (struct cfg_stats_d): Remove num_failed_bind_expr_merges + field. + (remove_bb): Only dump whole block with TDF_DETAILS. + (tree_dump_bb): Use dump_generic_bb. + (dump_tree_cfg): Use brief_dump_cfg and dump_function_to_file. + (dump_cfg_function_to_file): Merged into dump_function_to_file, + removed. + (dump_cfg_stats): Do not dump cfg_stats.num_failed_bind_expr_merges. + (dump_function_to_file): Moved from tree-dump.c, merged with + dump_cfg_function_to_file. + * tree-dump.c (dump_function_to_file): Removed. + * tree-flow.h (dump_cfg_function_to_file): Declaration removed. + (dump_generic_bb, expand_var_p): Declare. + * tree-must-alias.c (tree_compute_must_alias): Replace + dump_cfg_function_to_file by dump_function_to_file. + * tree-ssa-ccp.c (tree_ssa_ccp): Ditto. + * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto. + * tree-ssa-dce.c (tree_ssa_dce): Ditto. + * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto. + * tree-ssa-pre.c (tree_perform_ssapre): Ditto. + * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto. + * tree-tailcall.c (tree_optimize_tail_calls): Ditto. + * tree-pretty-print.c (print_declaration, print_generic_decl): Don't + use flags argument, change spacing. + (dump_block_info): Removed. + (dump_generic_bb_buff, dump_generic_bb, print_generic_stmt_indented, + dump_bb_header, dump_bb_end, dump_phi_nodes): New functions. + (dump_vops): Change spacing, don't dump phi nodes. + (do_niy, print_generic_stmt, print_generic_expr, print_declaration, + print_struct_decl, print_call_name): Add argument to + the dump_generic_node calls. + (last_bb): Removed. + (dump_generic_node): Print semicolons at end of statements correctly. + Don't print bb related stuff. + (maybe_init_pretty_print): Don't initialize last_bb. + * tree-ssa.c (rewrite_out_of_ssa): Do not allow virtual operands to + be shown in the .optimized dump. + +2003-11-11 Daniel Berlin + + PR optimization/12936 + * tree-ssa-pre.c (expr_phi_insertion): Remove unused code that was + causing ICE's for VA_ARG_EXPR. + +2003-11-10 Richard Henderson + + * gimple-low.c (lower_function_body): Lower bind_expr in place. + (lower_stmt): Only incr for stmts we're skipping. + (lower_cond_expr): Detect empty if. + +2003-11-10 Steven Bosscher + + * toplev.c (rest_of_decl_compilation): Use the location of the + declaration for error messages. + +2003-11-10 Richard Henderson + + * gimplify.c (add_stmt_to_compound, add_tree): Remove. + (append_to_statement_list_1, append_to_statement_list): New. + (append_to_statement_list_force): New. + (gimplify_loop_expr): Take pre_p. + (gimplify_expr): Provide it. + * tree-simple.h: Update. + + * c-simplify.c: Replace add_tree with append_to_statement_list. + * gimplify.c, tree-mudflap.c: Likewise. + +2003-11-10 Richard Henderson + + * c-common.c (c_warn_unused_result): Restructure to use iterator + on COMPOUND_EXPR only. + +2003-11-09 Zdenek Dvorak + + * tree-cfg.c (tree_verify_flow_info): Fix checking of order of basic + blocks over code. + +2003-11-09 Richard Henderson + + * basic-block.h (struct edge_def): Turn insns into a union. + * cfgrtl.c (insert_insn_on_edge): Update to match. + (commit_one_edge_insertion, commit_edge_insertions): Likewise. + (commit_edge_insertions_watch_calls): Likewise. + * gcse.c (reg_killed_on_edge, bypass_block): Likewise. + * profile.c (instrument_edges): Likewise. + * rtlanal.c (hoist_insn_to_edge): Likewise. + * tree-cfg.c (PENDING_STMT): Likewise. + (SET_PENDING_STMT): Remove. + (bsi_commit_edge_inserts): Update to match. + +2003-11-08 Jan Hubicka + + * fold.c (nondestructive_fold_binary_to_constant): Fix typo. + * fold-const.c (fold_relational_const): Check for side effects. + +2003-11-07 Zdenek Dvorak + + * basic-block.h (create_bb): Declaration changed. + * tree-cfg.c (create_bb): Enable creating a block on specified place. + (make_blocks, tree_split_edge, tree_make_forwarder_block): Use it. + (tree_verify_flow_info): Check bbs are in the correct order. + + * tree-cfg.c (find_unreachable_blocks): Remove now incorrect comments. + + * tree-ssa.c (rewrite_out_of_ssa): Don't remove annotations from + statements before the final dump. + +2003-11-07 Zdenek Dvorak + + * tree-tailcall.c (struct tailcall): New. + (bb_optimize_tail_calls, find_tail_call_p): Removed. + (eliminate_tail_call): Get the tailcall from the struct tailcall. + (optimize_tail_call, find_tail_calls): New. + (tree_optimize_tail_calls): Use them. + +2003-11-07 Jan Hubicka + + * gimple-low.c (simple_goto_p): Move to... + * tree-cfg.c: (simple_goto_p): ... here; + (nonlocal_goto_p): New. + (is_computed_goto): Rename to ... + (computed_goto_p): ... this; make global. + (factor_computed_gotos, make_blocks): Update calls. + (make_ctrl_stmt_edges): Add edge for nonlocal labels; use new functions. + * tree-flow.h (is_coputed_goto): Kill. + (nonlocal_goto_p, simple_goto_p, computed_goto_p): Declare. + * tree-ssa-ccp (visit_stmt): Update. + +2003-11-07 Jan Hubicka + + * fold-const.c (tree_expr_nonzero_p): Fix typo. + + * fold-const.c (tree_expr_nonzero_p): New function. + (fold_relational_const): Use it. + (nondestructive_fold_binary_to_constant): Allow casts in address + expressions. + +2003-11-06 Jan Hubicka + + * tree-cfg.c (tree_block_label): Cleanup. + +2003-11-06 Daniel Berlin + + * tree-ssa-pre.c (fast_a_dominates_b): New function. + (build_dfs_id_array_1): Ditto. + (build_dfs_id_array): Ditto. + (load_modified_phi_result): Use fast_a_dominates_b. + (rename_1): Ditto. + Also use build_dfs_id_array, and remove some duplicate ephi_at_block + calls. + (insert_occ_in_preorder_dt_order): Remove some duplicate ephi_at_block + calls. + (pre_expression): Ditto. + Also free dfs_id arrays here. + (collect_expressions): Remove duplicate bsi_stmt calls. + +2003-11-06 Daniel Berlin + + * tree-ssa-pre.c (count_stmts_in_bb): Removed. + (set_var_phis): Only call bb_for_stmt once. + (insert_one_operand): Remove endtree, endtreep, a lot of special handling + no longer needed. Remove insert_done. + (collect_expressions): Enable INDIRECT_REF and SSA_NAME handling. + +2003-11-06 Steven Bosscher + + * tree-cfg.c (STRIP_CONTAINERS): Remove. + +2003-11-06 Jan Hubicka + + * tree-cfg.c (cleanup_cond_expr_graph): Clean edge flags. + +2003-11-06 Zdenek Dvorak + + * tree-dump.c (dump_options): Remove TDF_LINENO from all setting. + +2003-11-06 Jan Hubicka + + * builtins.c (expand_builtin_strstr, expand_builtin_strchr, + expand_builtin_strrchr, expand_builtin_strpbrk, + simplify_builtin_strstr, simplify_builtin_strrchr, + simplify_builtin_strpbrk): Add missing casts. + +2003-11-05 Zdenek Dvorak + + * diagnostic.h (print_generic_decl): Declare. + * tree-cfg.c (dump_cfg_function_to_file): Dump variables in + unexpanded_var_list. + * tree-pretty-print.c (print_generic_decl): New function. + +2003-11-05 Zdenek Dvorak + + * Makefile.in (gimplify.o): Add function.h dependency. + * c-call-graph.c (construct_call_graph): Modify build_tree_cfg call. + * gimple-low.c (record_vars): Export. + (lower_function_body): Remove the topmost BIND_EXPR. + * gimplify.c: Include function.h. + (gimple_add_tmp_var): Record temporaries in the + cfun->unexpanded_vars_list if available. + * tree-cfg.c (build_tree_cfg): Work without the topmost BIND_EXPR. + (dump_cfg_function_to_file): New. + (dump_tree_cfg): Use dump_cfg_function_to_file. + * tree-dump.c (dump_function_to_file): Work without the topmost + BIND_EXPR. + * tree-flow.h (build_tree_cfg): Declaration changed. + (dump_cfg_function_to_file, record_vars): Declare. + * tree-optimize.c (optimize_function_tree, tree_rest_of_compilation): + Work without the topmost BIND_EXPR. + * tree-must-alias.c (tree_compute_must_alias): Use + dump_cfg_function_to_file. + * tree-ssa-ccp.c (tree_ssa_ccp): Ditto. + * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto. + * tree-ssa-dce.c (tree_ssa_dce): Ditto. + * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto. + * tree-ssa-pre.c (tree_perform_ssapre): Ditto. + * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto. + * tree-tailcall.c (tree_optimize_tail_calls): Ditto. + * tree.h (optimize_function_tree): Declaration changed. + +2003-11-03 Daniel Berlin + + * tree-ssa-pre.c (handle_bb_creation): Removed. + (redo_dominators): Removed. + (insert_one_operand): Remove code to handle bb creation, since all + critical edges are now pre-split. + (finalize_2): Remove redo_dominators related code. + (pre_expression): Return 1 if we exited early because nothing happened. + (split_critical_edges): Do fake variable assignments instead, because + it works. return true if we actually split an edge. + (tree_perform_ssapre): Remove redo_dominators code. + +2003-11-03 Zdenek Dvorak + + * function.h (struct function): New field unexpanded_var_list. + * gimple-low.c (unexpanded_var_list): Removed. + (record_vars, expand_used_vars): Use cfun->unexpanded_var_list. + * tree-flow.h (unexpanded_var_list): Declaration removed. + + * gimplify.c (should_carry_locus_p): New. + (annotate_all_with_locus_1): Use it. Do not annotate empty + statements. + +2003-11-03 Jan Hubicka + + * tree-cfg.c (tree_try_redirect_by_replacing_jump): Do not use + succesor_block. + +2003-11-03 Zdenek Dvorak + + * tree-pretty-print.c (dump_block_info): Add flags parameter. + Only show line number when asked to. + (dump_generic_node): Pass flags to dump_block_info. + +2003-11-03 Jan Hubicka + + * cfghooks.h (redirect_edge_and_branch hook): Make it return edge. + * cfgrtl.c (cfg_layout_redirect_edge_and_branch, + rtl_redirect_edge_and_branch, try_redirect_by_replacing_jump): + Update to new interface. + * tree-cfg.c (tree_cfg_hooks): Move to end of file; set + redirect_edge_and_branch and redirect_edge_and_branch_force. + (thread_jumps): Use redirect_edge_and_branch. + (tree_block_label): new; break out of thread_edge. + (tree_try_redirect_by_replacing_jump): New. + (thread_edge): Rename to tree_redirect_edge_and_branch; deal sanely + with unusual edges; preserve profile. + (tree_redirect_edge_and_branch_force): New. + * tree-flow.h (ssa_redirect_edge): Declare. + * tree-ssa.dom.c (tree_ssa_dominator_optimize): Use redirect_edge_and_branch. + * tree-ssa.c (ssa_redirect_edge): New. + +2003-11-03 Jeff Law + + * domwalk.h (struct dom_walk_data): New field "global_data". + * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Initialize new + "global_data" field. + * tree-flow.h (enum need_phi_state): New enumeration. + (var_ann_d): Add bitfield for need_phi_state. + * tree-ssa.c (mark_def_sites_global_data): New structure to hold + global data for mark_def_sites dominator walk. + (mark_def_sites): Revamp to be called via the dominator walker. + (set_def_block): Update need_phi_state for the variable as needed. + (set_livein_block): Similarly. + (rewrite_into_ssa): Use dominator walker to call mark_def_sites. + Delay freeing dominance info. Kill "globals" bitmap. + (insert_phi_nodes): No longer need "globals" bitmap. Use + need_phi_state in variable's annotation to determine if a PHI + may be needed. + + * tree-ssa-dom.c (dom_opt_finalize_block): Try to thread across the + edges leaving COND_EXPR nodes which are leafs in the dominator + tree. + (record_equivalences_from_incoming_edge): Do not set EQ_EXPR_VALUE + unless the block's single predecessor contains parent_block_last_stmt. + +2003-11-03 Zdenek Dvorak + + * tree-dump.c (dump_options): Add TDF_LINENO. + * tree-pretty-print.c (dump_generic_node): Print line number for + statements if asked to. + * tree.h (TDF_LINENO): New. + * doc/invoke.texi (lineno): Document. + +2003-11-03 Zdenek Dvorak + + * expr.c (expand_vars, expand_var): Split of ... + (expand_expr_1): ... here. + * expr.h (expand_var): Declare. + * gimple-low.c (lower_function_body, lower_stmt, lower_bind_expr): + Eliminate BIND_EXPRs. + (expand_used_vars): New. + * tree-alias-common.c (create_alias_vars): Walk variables in blocks. + * tree-cfg.c (make_bind_expr_blocks): Removed. + (make_blocks, build_tree_cfg, factor_computed_gotos): Don't handle + BIND_EXPRs. + (assign_vars_to_scope, successor_block, NEXT_BLOCK_LINK): Removed. + (make_edges, make_exit_edges): Don't use successor_block. + (remove_useless_stmts_and_vars_goto): Don't expect NEXT_BLOCK_LINK + to be set. + (bsi_init, bsi_next_in_bb, bsi_from_tsi): Don't handle BIND_EXPRs. + (replace_stmt): Don't create BIND_EXPRs. + * tree-flow.h (struct var_ann_d): Removed field scope. + (struct stmt_ann_d): Removed fields scope and scope_level. + (propagate_copy): Declaration changed. + (fixup_var_scope): Removed. + * tree-must-alias.c (tree_compute_must_alias): Consider DECL_NONLOCAL + vars call clobbered. + * tree-optimize.c (tree_rest_of_compilation): Call expand_used_vars. + * tree-ssa-copyprop.c (move_var_to_scope, fixup_var_scope): Removed. + (copyprop_stmt): Call to propagate_copy changed. + (propagate_copy): Don't update scope. + * tree-ssa-dom.c (cprop_into_stmt): Call to propagate_copy changed. + (eliminate_redundant_computations): Don't call fixup_var_scope. + * tree-ssa.c (insert_copy_on_edge): Don't update scope. + +2003-11-02 Zdenek Dvorak + + * tree-inline.c (walk_tree): Tail recursion optimized for + COMPOUND_EXPRs. + * tree-eh.c (collect_finally_tree): Ditto. + +2003-11-02 Zdenek Dvorak + + * tree-optimize.c (optimize_function_tree): Removed duplicate call of + lower_function_body. Moved call of reset_block_changes ... + (tree_rest_of_compilation) ... here. Reset the scope to top before + expanding function end. + +2003-11-01 Zdenek Dvorak + + * basic-block.h (BB_CONTROL_STRUCTURE): Removed. + * tree-cfg.c (struct cfg_stats_d): Field num_merged_cases removed. + (make_blocks, make_bind_expr_blocks, append_stmt_to_bb, bsi_link_after, + build_tree_cfg, factor_computed_gotos, prepend_stmt_to_bb, + remove_stmt, replace_stmt): Don't set parent. + (set_parent_stmt, add_stmt_to_bb, find_contained_blocks, + blocks_unreachable_p, remove_blocks, remove_unreachable_block, + move_outgoing_edges, merge_tree_blocks, remap_stmts): Removed. + (REMOVE_ALL_STMTS, REMOVE_NO_STMTS, REMOVE_NON_CONTROL_STRUCTS, + REMOVE_CONTROL_STRUCTS): Removed. + (remove_bb): Code to handle control structures removed. + (tree_block_forwards_to): Don't stop due to CASE_LABEL_EXPRs. + (tree_dump_bb): Don't print parent. Print only BIND_EXPRs in slim + form. + (dump_tree_cfg): Don't count merged case labels. + (is_ctrl_structure): Removed. + (stmt_starts_bb_p): Don't handle CASE_LABEL_EXPRs. + (tree_verify_flow_info): Don't check BB_CONTROL_STRUCTURE. + * tree-flow-inline.h (parent_block, parent_stmt): Removed. + * tree-flow.h (struct stmt_ann_d): Remove parent_stmt field. + (parent_stmt, parent_block, is_ctrl_structure): Declarations removed. + * tree-pretty-print.c (dump_generic_node): Don't handle lowered + COND_EXPRs specially. + * tree-ssa-ccp.c (visit_stmt): Don't check is_ctrl_structure. + +2003-10-31 Jeff Law + + * tree-ssa-dom.c (record_equivalences_from_stmt): Restore lost code + to create equivalences from BIT_IOR_EXPR. + + * tree-ssa-dom.c (thread_jumps_walk_stmts): Go ahead and optimize + a COND_EXPR with a compile-time constant condition. + +2003-10-31 Diego Novillo + + * tree-optimize.c (optimize_function_tree): Fix comment + describing SSA pass after DOM2. + +2003-10-31 Diego Novillo + + Fix PR optimization/12825 + * tree-optimize.c (optimize_function_tree): Run SSA renamer after + second DOM pass. + +2003-10-30 Richard Henderson + + * c-common.c (match_case_to_enum_1, match_case_to_enum): New. + (c_do_switch_warnings): New. + * c-common.h (c_do_switch_warnings): Declare. + * c-typeck.c (c_finish_case): Call it. + * stmt.c (all_cases_count, BITARRAY_TEST, BITARRAY_SET, + mark_seen_cases, check_for_full_enumeration_handling): Remove. + (expand_end_case_type): Don't do warn_switch handling. + * expr.h, tree.h: Remove dead decls. + + * c-simplify.c (gimplify_switch_stmt): Force switch body non-null. + +2003-10-30 Richard Henderson + + * tree-cfg.c (thread_jumps): Allow SWITCH_EXPR. + (thread_edge): Handle it. Tidy surrounding code. + +2003-10-30 Richard Henderson + + * domwalk.c (walk_dominator_tree): Pass any final is_ctrl_stmt + down the recursive walk. + +2003-10-30 Jeff Law + + * tree-ssa-dom.c (thread_across_edge): Renamed from + thread_through_successor. Revamp to thread the destination of an edge + rather than the successors of a block. + (dom_opt_finalize_block): Corresponding changes. Do not bother calling + thread_across_edge unless we are at a leaf in the dominator tree. + + * tree-cfg.c (thread_jumps): Now returns a bool. Move some tests into + tree_forwarder_block_p. Improve comments. + (cleanup_control_flow): Now returns a bool indicating if anything was + changed. + (thread_unconditional_jumps): Kill. + (cleanup_tree_cfg): Repeat cascading cleanups until nothing changes. + (tree_forwarder_block_p): Check forwardable bit in the block's + annotation to avoid useless work. Mark blocks as not forwardable as + appropriate. Verify destination is not the exit block here. Do not + consider successors of the entry block as forwarders. Ignore empty + statements when walking through the block's statements. Verify target + block is not the start of a case label and that we can safely insert + a label at the target block. + +2003-10-29 Richard Henderson + + * c-common.c (c_warn_unused_result): Remove lowered containers. + * c-semantics.c (genrtl_case_label): Update add_case_node call. + * c-simplify.c (gimplify_switch_stmt): Build SWITCH_EXPR and + gimplify it simultaneously with the body. + * expr.c (expand_expr_1): Handle SWITCH_BODY clear and + SWITCH_LABELS set. Update add_case_node calls. + * gimple-low.c (lower_stmt): Don't do anything for SWITCH_EXPR. + (lower_switch_expr, lower_case_label_expr): Remove. + * gimplify.c (gimplify_switch_expr): Zap SWITCH_BODY after + gimplification. Force default entry for SWITCH_LABELS. + (gimplify_case_label_expr): Rename from gimple_add_case_label. + Assert switch in scope; lower to LABEL_EXPR. + * stmt.c (pushcase, pushcase_range) Update add_case_node calls. + (add_case_node): Add dont_expand_label argument. + (same_case_target_p): Don't search rtl. + * tree-cfg.c (enum find_location_action): Remove. + (make_switch_expr_blocks): Remove. + (make_blocks): Update. + (make_case_label_edges): Remove. + (make_edges): Update. + (find_contained_blocks): Remove lowered containers. + (make_switch_expr_edges): New. + (make_ctrl_stmt_edges): Call it. + (make_cond_expr_edges): Use label_to_block. + (remove_useless_stmts_and_vars_1): Don't go into SWITCH_BODY. + (remove_unreachable_block): Remove SWITCH_EXPR special case. + (cleanup_cond_expr_graph): Tidy. + (cleanup_switch_expr_graph): Rewrite. + (disconnect_unreachable_case_labels): Remove. + (find_taken_edge_cond_expr): Use integer_zerop/integer_nonzerop. + (find_taken_edge_switch_expr): Rewrite. + (value_matches_some_label): Remove. + (find_case_label_for_value): New. + (is_ctrl_structure): Remove lowered containers. + (is_ctrl_stmt): Add SWITCH_EXPR. + (switch_parent): Remove. + (handle_switch_fallthru): Remove. + (handle_switch_split): Remove. + (find_insert_location): Merge into ... + (bsi_insert_on_edge_immediate): ... here. Simplify. + (tree_split_edge): Don't set EDGE_FALLTHRU. + * tree-eh.c (collect_finally_tree): Remove lowered containers. + (replace_goto_queue_1, block_may_fallthru_last): Likewise. + (lower_eh_constructs_1): Likewise. + (verify_norecord_switch_expr): New. + (lower_try_finally_switch): Generate lowered switches. + * tree-inline.c (expand_calls_inline): Don't search null SWITCH_BODY. + * tree-pretty-print.c (dump_generic_node): Do something sensible + with lowered switch_expr. + * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Update + for lowered switch_expr. + * tree.def (SWITCH_EXPR): Update docs. + * tree.h (add_case_node): Update decl. + +2003-10-29 Daniel Berlin + + * tree-ssa-pre.c (n_phi_preds): New variable. + (generate_vops_as_of_bb): New function + (generate_expr_as_of_bb): Remove unused first argument. Update all + callers. + (subst_phis): Add boundary check for the phi_pred_cache array. + (same_e_version_phi_result): Once modified, no point in continuing + the loop. + (finalize_2): ESSA Minimization can crash if we ended up with new + BB's + +2003-10-29 Richard Henderson + + * tree-eh.c (do_return_redirection): Don't move copy to RESULT_DECL + outside the RETURN_EXPR. Introduce a new temporary as needed. + +2003-10-26 Richard Henderson + + * gimplify.c (keep_function_tree_in_gimple_form): Remove. + (gimplify_function_tree): Return void. Remove hack for + language not supporting gimple. + * tree.h: Update decls. + * langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): New. + * langhooks.h (struct lang_hooks): Add gimple_before_inlining. + * tree-inline.c (copy_body_r): Check that instead of + keep_function_tree_in_gimple_form. + (initialize_inlined_parameters): Likewise. + (expand_call_inline, expand_calls_inline): Likewise. + + * explow.c (probe_stack_range): Never emit loop notes. + * expr.c (emit_block_move_via_loop): Likewise. + * toplev.c (rest_of_compilation): Always synthesize loop notes. + +2003-10-26 Zdenek Dvorak + + * Makefile.in (gimple-low.o): Add function.h dependency. + * gimple-low.c (struct lower_data): New field block. + (lower_function_body, lower_stmt, lower_bind_expr): Record + the block at statements. + * cfglayout.c (insn_locators_initialize): Use new info about + blocks. + * expr.c (expand_expr): Record block changes. + * function.c (blocks_nreverse): Export. + (uninitialized_vars_warning): Use DECL_RTL_SET_P to test for presence + of rtl. + (reset_block_changes, record_block_change, finalize_block_changes, + check_block_change, free_block_changes): New functions. + * function.h (struct function): New bitfield dont_emit_block_notes. + New field ib_boundaries_block. + (blocks_nreverse, reset_block_changes, record_block_change, + finalize_block_changes, check_block_change, free_block_changes): + Declare. + * sibcall.c (optimize_sibling_and_tail_recursive_call): Don't call + reorder_blocks when dont_emit_block_notes. + * stmt.c (expand_start_bindings_and_block, expand_end_bindings): + Don't emit block notes when dont_emit_block_notes. + * toplev.c (rest_of_compilation): Don't call reorder_blocks when + dont_emit_block_notes. + * tree.c (build1): Initialize TREE_BLOCK field. + * tree-flow.h (lower_function_body): Declare. + * tree-optimize.c: Include function.h. + (optimize_function_tree): Call lower_function_body. + * tree.h (struct tree_exp): Add block field. + (TREE_BLOCK): New macro. + +2003-10-26 Richard Henderson + + * tree.h (tree_dump_index): Add TDI_lower. + * tree-dump.c (dump_files): Add .lower entry. + * tree-optimize.c (optimize_function_tree): Move lower_function_body, + (tree_rest_of_compilation): here. Tidy .useless dump. + +2003-10-25 Jan Hubicka + + * c-common.c (c_estimate_num_insns_1): Kill. + (c_estimate_num_insns): Kill. + * c-common.h (c_estimate_num_insns): Kill. + * c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill. + * objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill. + * java/lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill. + (java_estimate_num_insns_1, java_estimate_num_insns): Kill. + * cgraphunit (cgraph_analyze_function): Use estimate_num_insns. + * tree-eh.c (decide_copy_try_finally): Likewise. + * tree-inline.c (limits_allow_inilining, optimize_inline_calls): Likewise. + (estimate_num_insns_1, estimate_num_insns): New functions. + * langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill. + * langhooks.h (estimate_num_inssn): Kill. + * tree-inline.h (estimate_num_insns): Declare. + +2003-10-25 Zdenek Dvorak + + * gimple-low.c: New. + * Makefile.in (gimple-low.o): Add. + * domwalk.c (walk_dominator_tree): Consider COND_EXPR a control + structure. + * tree-cfg.c (make_cond_expr_blocks, linearize_control_structures, + linearize_cond_expr): Removed. + (thread_jumps, tree_forwarder_block_p): New. + (merge_tree_blocks): Unused now. + (phi_alternatives_equal): Modified for use in jump threading. + (enum find_location_action): Remove EDGE_INSERT_LOCATION_NEW_ELSE. + (make_blocks): Don't call make_cond_expr_blocks. + (set_parent_stmt): Ensure we don't set COND_EXPR as a parent + statement. + (find_contained_blocks): Remove COND_EXPR alternative. + (make_cond_expr_edges): Handle lowered gotos. + (cleanup_tree_cfg): Don't call linearize_control_structures, + call thread_jumps and verify_flow_info and rerun cleanup_control_flow. + (remove_unreachable_block): Remove handling of structured COND_EXPRs. + (remove_bb): Fix warning for removed goto exprs. + (cleanup_control_flow, cleanup_cond_expr_graph, + cleanup_switch_expr_graph, find_taken_edge_cond_expr, + bsi_insert_before, find_insert_location, bsi_insert_on_edge_immediate): + Handle lowered COND_EXPRs. + (is_ctrl_structure): Remove COND_EXPR. + (is_ctrl_stmt): Add COND_EXPR. + (tree_verify_flow_info): Check validity of COND_EXPRs. + (thread_edge): Moved from tree-ssa-dom.c. + * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph): + Declaration changed. + (thread_edge, lower_function_body): Declare. + * tree-optimize.c (optimize_function_tree): Call lower_function_body. + * tree-pretty-print.c (dump_generic_node): Dump lowered cond_exprs in + full. + * tree-ssa-copyprop.c (fixup_var_scope): Handle non-SSA_NAMEs. + * tree-ssa-dce.c (stmt_useful_p, process_worklist): Cleaned up when + COND_EXPRs are lowered. + * tree-ssa-dom.c (thread_edge): Moved to tree-cfg.c. + (tree_ssa_dominator_optimize_1): Dumps and setting of vars_to_rename + moved from thread_edge. + (optimize_stmt): Pass block iterator to cleanup_cond_expr_graph and + cleanup_switch_expr_graph. + * tree-ssa.c (insert_copy_on_edge): Fixup scope for emitted variables. + + * dominance.c (BB_NODE): Use VARRAY_GENERIC_PTR_NOGC. + (calculate_dominance_info): Use VARRAY_GENERIC_PTR_NOGC_INIT. + * varray.c (element): Add GENERIC_PTR_NOGC entry. + * varray.h (enum varray_data_enum): Add VARRAY_DATA_GENERIC_NOGC. + (union varray_data_tag): Add generic_nogc. + (VARRAY_GENERIC_PTR_NOGC_INIT, VARRAY_GENERIC_PTR_NOGC, + VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_TOP_GENERIC_PTR_NOGC): New. + +2003-10-25 Jan Hubicka + + * cppcharset.c (one_utf8_to_utf32): Initialize 's' to silence warning. + +2003-10-25 Jan Hubicka + + * fold-const.c (nondestructive_fold_binary_to_constant): Realize that + (plus (address) (const_int)) is a constant. + +2003-10-25 Jan Hubicka + + * opts.c (decode_options): Uncomment unit-at-a-time setting + * params.def: Syncrhonize with manline. + * tree-inline.c (initialize_inlined_parameters): Set variable as + gimplified. + +2003-10-24 Steven Bosscher + + * gimplify.c (create_artificial_label): New function. + (build_and_jump): Use it. + * c-simplify.c (c_gimplify_stmt): Likewise. + (gimplify_condition): Likewise. + * tree-cfg.c (factor_computed_gotos, tree_block_forwards_to, + handle_switch_fallthru, handle_switch_split): Likewise. + * tree-ssa-dom.c (thread_edge): Likewise. + * tree-ssa-pre.c (split_critical_edges): Likewise. + * tree-tailcall.c (eliminate_tail_call): Likewise. + * tree-eh.c (frob_into_branch_around, + honor_protect_cleanup_actions, lower_try_finally_nofallthru, + lower_try_finally_onedest, lower_try_finally_copy, + lower_try_finally_switch, lower_catch, lower_eh_filter, + lower_cleanup): Likewise. + (make_label): Remove. + * tree-simple.h (create_artificial_label): Add prototype. + * tree-inline.c (expand_call_inline): Make return label for + inlined function artificial. + +2003-10-23 Jeff Law + + * timevar.def (TV_TREE_SSA_THREAD_JUMPS): New timevar. + * tree-dump.c (dump_files): Add dump file for jump threading. + * tree.h (TDI_thread_jumps): New enum member. + * tree-cfg.c (tree_block_forwards_to): No longer static. + * tree-flow.h (tree_block_forwards_to): Prototype. + (tree_ssa_dominator_thread_jumps): Likewise. + * tree-optimize.c (optimize_function_tree): Call jump threader. + * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): New function. + Common code for redundancy elimination and jump threading on + the dominator tree. Slightly different callback initialization + for redundancy elimination and jump threading. Initialize + block forwardable attribute. + (tree_ssa_dominator_optimize): Call tree_ssa_dominator_optimize_1. + (tree_ssa_dominator_thread_jumps): New function. + (thread_edge): Mark results of PHI nodes as needing rewriting if + we have threaded through a block with PHI nodes. + (thread_through_successor): If thread_through_phis is nonzero, + then allow jump threading through blocks with PHI nodes. If the + target block is a forwarder block, then forward the jump. + (thread_jumps_walk_stmts): Statement walker for dominator thread + jumping. + + * tree-ssa-dom.c (record_equivalence_from_incoming_edge): Fix + comment typo. + +2003-10-23 Richard Henderson + + * gimplify.c (gimplify_*): Return gimplify_status. + (gimple_add_tmp_var): Set seen_in_bind_expr. + (gimplify_bind_expr): Likewise. Kill if 0 code. + (gimplify_return_expr): Cope with error marks. + (gimple_push_cleanup): Do nothing if errors seen. + (gimplify_expr): Cope with error marks. Use gimplify_status to + decide when to exit the main loop. Zap statements with errors. + (gimplify_body): Return void. + (keep_function_tree_in_gimple_form): Don't exit on errors. + (gimplify_function_tree): Return bool. Don't exit on errors. + * langhooks.c (lhd_gimplify_expr): Return GS_UNHANDLED. + * langhooks.h (struct lang_hooks): Update docs for gimplify_expr. + * tree-optimize.c (optimize_function_tree): Don't exit on errors. + Move delete_tree_cfg call outside optimization clause. + (tree_rest_of_compilation): Don't exit on errors. + * tree-simple.h (enum gimplify_status): New. + (gimplify_expr, gimplify_stmt, gimplify_body): Update. + * tree-ssa.c (rewrite_out_of_ssa): Move delete_tree_cfg call to + optimize_function_tree. + * tree.h (struct tree_decl): Add seen_in_bind_expr. + (gimplify_function_tree): Update. + * c-common.c (c_add_case_label): Unify three error exit paths. + Create a normal label, not a case label to suppress unreachable + code warning. + * c-simplify.c (c_build_bind_expr): Don't create an empty bind + body. Pass entire bind_expr to gimplify_stmt. + (gimplify_block): Don't abort on mismatches if errors seen. + (gimplify_expr_stmt): Cope with error marks. + (gimplify_decl_stmt): Likewise. + (c_gimplify_expr): Return gimplify_status. + +2003-10-22 Daniel Berlin + + * tree-pretty-print.c (dump_generic_node): Kill off ELEFT_NODE. + Print out status of new EUSE_LVAL flag. + + * tree-ssa-pre.c: #include alloc-pool.h + (append_eref_to_block): Inline. + (names_match_p): Ditto. + (pre_expression): Take sbitmap of variables to rename so we can + mark our new variable if necessary. + (insert_occ_in_preorder): Completely redo to be an O(n log n) + algorithm worst case, instead O(n^2) all the time. + (build_dfn_array): New function. + (eref_compare): Ditto. + (preorder_count): Remove no-longer used variable. + (pre_stats): Add new stats about memory use. + (struct expr_info): add loadpre_cand member. + (euse_node_pool): New alloc-pool + (eref_node_pool): Ditto + (create_expr_ref): Use them. + (expr_phi_insertion): Insert on PHI's of VUSES for loadpre cands. + Not all expressions have uses (left occurrences don't). + (load_modified_real_occ_real_occ): Return false, not abort. + (process_delayed_rename): Remove useless fibheap, do proper LVAL + handling. + (insert_euse_in_preorder_dt_order_1): No more ELEFT_NODE's. + (finalize_1): Ditto. + (set_save): Ditto. + (really_available_def): New function. + (finalize_2): Use really_available_def, not EUSE_SAVE, during EPHI + minimization. + (names_match_p): Handle INDIRECT_REF properly. + (call_modifies_slot): Removed. + (add_call_to_ei): Removed. + (process_left_occs_and_kills): Fix. + (pre_expression): Zero out counts. + (collect_expressions): Split out from tree_perform_ssapre. Do this + in domtree order. + (tree_perform_ssapre): Create and free alloc-pools. + Rename new variables that need to be renamed. + + * tree.c (tree_size): Remove ELEFT_NODE. + (tree_node_size): Ditto. + (is_essa_node): Ditto. + + * tree.def (ELEFT_NODE): Gone. + + * tree.h (EREF_NODE_CHECK): No more ELEFT_NODE. + (struct tree_eref_common): Add ID flag. + (struct tree_euse_node): Add lval flag. + (EREF_ID): New macro. + (EUSE_LVAL): New macro. + +2003-10-22 Daniel Berlin + + * tree-flow-inline.h (add_dom_child): XMALLOC, not GGC_ALLOC, + the bitmap. + (clear_dom_children): XFREE the bitmap. + +2003-10-22 Andrew MacLeod + + * tree-ssa-live.c (new_tree_live_info, (delete_tree_live_info, + live_worklist, set_if_valid, add_livein_if_notdef, + calculate_live_on_entry, calculate_live_on_exit, + add_conflicts_if_valid, dump_live_info): Use bitmap instead of sbitmap. + (build_tree_conflict_graph): Use bitmap, Change mechanism for + adding conflicts between live-on-entry partitions. + * tree-ssa-live.h (struct tree_live_info_d): Switch to bitmaps. + (partition_is_global, live_entry_blocks, live_on_exit, + live_merge_and_clear, make_live_on_entry): Switch to bitmaps. + * tree-ssa.c (struct _elim_graph): Remove bitmaps, use varrays. + (new_elim_graph, clear_elim_graph, delete_elim_graph): Switch from + old bitmap implementation. + (elim_graph_size): New. Number of elements in elimination graph. + (elim_graph_add_node): New. Add an element to the elim-graph. + (elim_graph_add_edge): New. Add an edge to the elim-graph. + (elim_graph_remove_succ_edge): New. Remove an edge for which a node + has a successor. + (FOR_EACH_ELIM_GRAPH_SUCC): Find all successor nodes. + (FOR_EACH_ELIM_GRAPH_PRED): Find all predeccesor nodes. + (eliminate_name, eliminate_build, elim_forward, + elim_unvisited_predecessor, elim_backward, elim_create, eliminate_phi): + Use new elim-graph routines. + (rewrite_out_of_ssa): Enable single-definition compaction when not + combining temporaries. + +2003-10-21 Richard Henderson + + * gimplify.c: Sort functions into use order, and all gimplification + functions to the end. + +2003-10-22 Jeff Law + + * tree-cfg.c (thread_unconditional_jumps): New function. + (tree_block_forwards_to): Likewise. + (cleanup_tree_cfg): Call thread_unconditional_jumps. + * tree-flow.h (bb_ann_t): Add forwardable status bit. + + * tree-dump.c (dump_files): Add entry for TDI_none. + (dump_begin): Do nothing for TDI_none. + (dump_enable_all, dump_switch_p): Start our scan at TDI_none + 1. + * tree.h (tree_dump_index): Add. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we have altered the + CFG and we have variables to [re]rename, go ahead and rename them before + starting the next iteration of the dominator optimizer. + +2003-10-21 Jason Merrill + + * gimplify.c (gimplify_modify_expr): Require a regvar on either + the lhs or rhs if we're dealing with a renameable type. + (canonicalize_component_ref): New fn. + (gimplify_compound_lval): Use it. + (gimplify_conversion): Use it. + (gimplify_expr): Lose redundant STRIP_MAIN_TYPE_NOPS. + Discard conversions in void context. + +2003-10-21 Daniel Berlin + + * tree-ssa-pre.c (pre_expression): Free and allocate the + ephi_pindex_htab and phi_pred_cache in this function only. + (phi_pred_cache): New array to store cached phi preds, to avoid + recomputation and unnecessary copying. + (subst_phis): Use it. + (added_phis): array of added phis that is marked for GC. + + * Makefile.in: Add tree-ssa-pre.c to the gtype files, and + gt-tree-ssa-pre.h to the list of generated files. + +2003-10-21 Jason Merrill + + PR optimization/12661 + * tree-dfa.c (get_expr_operands): Handle TRUTH_NOT_EXPR. + * tree-simple.c (is_gimple_rhs): Allow TRUTH_NOT_EXPR. + * gimplify.c (gimplify_expr) : Don't rewrite to an + EQ_EXPR. + +2003-10-21 Jan Hubicka + + * haifa-sched.c (choose_ready): Initialize index. + * tree-tailcall.c (bb_optimize_tail_calls): Initialize has_return. + * f/lex.c (ffelex_cfelex_): Initialize d. + +2003-10-20 Diego Novillo + + Fix PR optimization/12688 + * tree-dfa.c (get_stmt_operands): Don't return early when dealing + with an empty statement. + * tree-ssa-ccp.c (set_rhs): If the expression has no side effects, + replace the statement with an empty statement. + +2003-10-20 Andrew MacLeod + + * tree-ssa-dce.c (processed): Change to an sbitmap. + (mark_necessary): Test bits in 'processed'. + (tree_ssa_dce): Initialize/free processed as an sbitmap. + +2003-10-20 Diego Novillo + + * tree-cfg.c (bsi_prev): Also copy the context from the previous + iterator. + +2003-10-18 Richard Henderson + + * builtins.c (simplify_builtin): Handle BUILT_IN_CONSTANT_P. + +2003-10-18 Zdenek Dvorak + + * tree-tailcall.c: New. + * Makefile.in (tree-tailcall.o): Add. + * function.c (assign_parms): Setting of current_function_stdarg + moved ... + (allocate_struct_function): ... here. + * tree-dump.c (dump_files): Add .tail dump. + * tree-flow.h (tree_optimize_tail_calls): Declare. + * tree-optimize.c (optimize_function_tree): Call + tree_optimize_tail_calls. + * tree.h (enum tree_dump_index): Add TDI_tail. + +2003-10-18 Jan Hubicka + + * tree-ssa-copyprop.c (move_var_to_scope): Do not clear abstract + origin for static variables. + +2003-10-18 Jan Hubicka + + * integrate.c (copy_decl_for_inlinig): Fix copying of copies. + +2003-10-18 Jan Hubicka + + * cgraphunit.c (cgraph_analyze_function): Fix call of estimate_num_insns. + +2003-10-17 Kazu Hirata + + * ChangeLog.tree-ssa: Fix typos. + * tree-alias-common.c: Fix comment typos. + * tree-cfg.c: Likewise. + * tree-dfa.c: Likewise. + * tree-eh.c: Likewise. + * tree-flow.h: Likewise. + * tree-iterator.h: Likewise. + * tree-mudflap.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-dce.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa-live.c: Likewise. + * tree-ssa-live.h: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-ssa.c: Likewise. + +2003-10-17 Andrew MacLeod + + * tree-ssa-dce.c (processed): New Global vector. + (mark_necessary): Check if SSA_NAME has already been processed first. + (find_useful_stmts, process_worklist): Change call to mark_necessary(). + (tree_ssa_dce): Initialize and free processed vector. + * tree-cfg.c (handle_switch_fallthru): A new basic block can result + from splitting edges of nested switch stmts. + (handle_switch_split): If a new block is created, restart the loop for + inserting GOTO's to handle the new block. + +2003-10-17 Jan Hubicka + + * tree-cfg.c (remove_useless_stmts_and_vars_bind): Fix handling of + static variables. + +2003-10-16 Richard Henderson + + * common.opt (fdisable-gimple): Remove. + * flags.h (flag_disable_gimple): Remove. + * toplev.c (flag_disable_gimple): Remove. + (process_options): Don't check it. + (lang_independent_options): Don't set it. + * opts.c (common_handle_option): Likewise. + * gimplify.c (keep_function_tree_in_gimple_form): Don't check it. + * c-semantics.c (expand_stmt_toplev): Likewise. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + * doc/invoke.texi: Don't document it. + +2003-10-16 Roger Sayle + + * fold-const.c: Merge from mainline. + * tree.c (associate_tree_code, commutative_tree_code): Use a + switch statement instead of a sequence of comparisons. + +2003-10-16 Richard Henderson + + * gimplify.c (maybe_protect_cleanup): Remove. + * tree-simple.h (maybe_protect_cleanup): Remove. + * c-simplify.c (gimplify_cleanup): Don't call it. + +2003-10-16 Jeff Law + + * tree-cfg.c (found_computed_goto): New global for computed goto + factoring/unfactoring. + (factored_computed_goto_label, factored_computed_goto): Likewise. + (factor_computed_gotos): New function. + (build_tree_cfg): Use it. + (make_blocks): Record whether or not we find a computed goto. + (remove_useless_stmts_and_vars): Un-factor computed gotos. + (remove_useless_stmts_and_vars): Reset factored_computed_goto_label + and factored_computed_goto. + + * tree-ssa-dom.c (get_value_for, set_value_for): Move to the start + of the file. Delete pointless sanity checking. + + * tree-ssa.c (currdefs): Now a varray instead of a hash table. + (get_value_for, set_value_for): Corresponding changes. Move to + the start of the file and delete pointless sanity checking. + (rewrite_into_ssa, dump_tree_ssa_stats): Corresponding changes. + (var_value_hash, var_value_eq): Kill. + + * tree-ssa.c (rewrite_add_phi_arguments): Once we encounter a + rewritten PHI break the inner loop. + + * tree-ssa.c (insert_phi_nodes_for): Use EXECUTE_IF_AND_COMPL_IN_BITMAP. + + * tree-dfa.c (create_phi_node): Clear PHI_REWRITTEN on all new PHIs + (remove_all_phi_nodes_for): Set PHI_REWRITTEN on any PHIs which are + not removed. + * tree-ssa.c (rewrite_add_phi_arguments): Check the PHI node itself + to see if it has already been rewritten. + * tree.h (PHI_REWRITTEN): New accessor macro. + (struct phi_node): New field rewritten. + + * tree-flow.h (struct bb_ann_d): New field num_preds. + * tree-dfa.c (create_phi_node): Get the number of predecessors from + the block's annotation. + * tree-ssa.c (rewrite_into_ssa): Compute number of preds for each + block and store it into the block's annotation. + (insert_phi_nodes_for): Get the number of preds for each block + from the block's annotation. + + * tree-ssa.c: Remove parallel lifetime analysis code from April 2003. + (def_blocks_d): Remove PHI_INSERTION_POINTS field. + (compute_global_livein): Accept livein/def bitmaps to use for + life analyis rather than a varray of variables. Callers updated. + Rewritten to compute life information for one variable at a + time instead of several variables at once. + (insert_phis_for_deferred_variables): Remove. + (insert_phi_nodes_for): Lose varray argument. Callers updated. + No longer mess with deferring PHI insertions for variables. + (insert_phi_nodes): No longer need to deal with deferred variables. + Kill everything related to them. + +2003-10-15 Jeff Law + + * domwalk.c, domwalk.h: New files. + * Makefile.in (OBJS-common): Add domwalk.c. + (tree-ssa-dom.o): Add dependency on $(BASIC_BLOCK_H) and domwalk.h. + (tree-ssa.o): Add dependency on domwalk.h. + (domwalk.o): Add dependencies. + * tree-ssa-dom.c: Include domwalk.h. + (cfg_altered, vars_to_rename): Now globals. + (dom_walk_block_data): New structure for block data used by dominator + walker. + (optimize_block, record_equivalences_from_block_entry): Kill. + (optimize_stmt): Lose "cfg_altered" argument. Update callers. + Initialize may_have_exposed_new_symbols. + (get_value_for, set_value_for): Lose "table" argument. Update + callers. Use const_and_copies table directly. + (lookup_avail_expr): Lose "const_and_copies" argument. Callers + updated. + (get_eq_expr_value): Similarly. Also accept a pointer to the + vrp_variables. Callers updated. + (update_rhs_and_lookup_avail_expr): Similarly. + (record_cond_is_true, record_cond_is_false): Similarly. + (simplify_rhs_and_lookup_avail_expr): Similarly. + (simplify_cond_and_lookup_avail_expr): Similarly. + (record_equivalences_from_phis): Similarly. + (record_equivalences_from_incoming_edge): Similarly. Also accept + a pointer to the block const_and_copies table and vrp_variables. + Callers updated. + (eliminate_redundant_computations): Similarly + (record_equivalences_from_stmt, thread_through_successor): Similarly. + (dom_opt_initialize_block): New function. Perform block local + initialization for the dominator optimizer. + (dom_opt_finalize_block): Renamed from finalize_block. Get + block local varrays from walk_data. Pop entry off block local + data stack when complete. + (dom_opt_walk_stmts): New function. + (cprop_into_phis): Get block local varrays from walk_data. + (record_range): Get vrp varray by reference than by value. + (tree_ssa_dominator_optimize): Store incoming "vars" variable into + global "vars_to_rename". Initialize walk_data. Use + walk_dominator_tree. + (cprop_into_stmt): Initialize may_have_exposed_new_symbols. + * tree-ssa.c: Include domwalk.h + (rewrite_finalize_block, rewrite_initialize_block): New functions + extracted from rewrite_block. + (rewrite_walk_stmts, rewrite_add_phi_arguments): Similarly. + (rewrite_block): Kill. + (rewrite_into_ssa): Initialize walk_data. Use walk_dominator_tree. + +2003-10-14 Richard Henderson + + * gimplify.c (gimplify_expr): Return bool. Bail gracefully if + fb_mayfail is set. + (gimplify_asm_expr): Take pointer-to-expr. Allow gimplify_expr + to fail for lvalues, and issue appropriate error messages. Zap + the entire asm statement on failure. + * tree-simple.h (enum fallback_t): Add fb_mayfail. + +2003-10-14 Richard Henderson + + * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): New. + (union lang_tree_node): Use it for chain_next annotation. + +2003-10-14 Richard Henderson + + * c-common.c: Include tree-iterator.h. + (c_expand_expr): Kill warn_unused_result checks. + (c_warn_unused_result): New. + * c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Remove. + (c_warn_unused_result): Declare. + * c-decl.c (finish_function): Always gimplify. Call + c_warn_unused_result. + * calls.c (expand_call): Kill warn_unused_result checks. + * Makefile.in (c-common.o): Update. + +2003-10-15 Steven Bosscher + + * cfghooks.c (dump_bb): Take extra `int indent' argument. + * cfg.c (dump_bb): Take extra argument to match cfg hook. + Write out all information about bb that is shared between the tree + and rtl representations. + * basic-block.c (dump_bb): Adjust prototype. + * cfgrtl.c (rtl_dump_bb): Update prototype to match cfg hook. + Use indent. + * flow.c (verify_wide_reg, verify_local_live_at_start): + Fixup dump_bb calls. + * tree-cfg.c (dump_tree_bb): Rename to tree_dump_bb. Remove unused + `prefix' argument. Put in tree_cfg_hooks as cfg hook for dump_bb. + (remove_bb, debug_tree_bb, dump_tree_cfg): Call dump_bb. + * tree-ssa (dump_tree_ssa): Likewise. + * tree-flow.h (dump_tree_bb): Replace with new tree_dump_bb + prototype. + * tree-pretty-print (dump_block_info): Match case of BLOCK, SUCC, + PRED with dump_bb. + +2003-10-14 Daniel Berlin + + * tree-alias-ander.c (throwaway_global): Delete. + (andersen_same_ponts_to_set): We handle all globals individually + now. + * tree-alias-common.c: Remove doxygen markers. + (get_alias_var_decl): Always create an alias var for globals now. + Assign the global alias vars to GLOBAL_VAR, too. + (intra_function_call): Fix logic, do a bit of pre-filtering to + avoid useless global aliasing. + (get_values_from_constructor): It's the same for field based and + not field based. + (create_alias_vars): Remove special global var handling. + (same_points_to_set): Ditto. + (ptr_may_alias_var): Ditto. + +2003-10-14 Jeff Law + + * tree-ssa-dom.c (cprop_into_phis): Avoid doing useless work if the + edge we care about is abnormal. + * tree-ssa-copyprop (cprop_phi): Avoid doing useless work if the + destination of the PHI node occurs in an abnormal PHI. + + * tree-ssa-dom.c (record_equivalences_from_stmt): Renamed from + record_equivalances. Caller updated. + (record_equivalences_from_phis): New function extracted from + optimize_block. + (record_equivalences_from_incoming_edge): Likewise. + (record_equivalances_from_block_entry): Likewise. + (cprop_into_phis): Likewise. + (optimize_stmt): Lots of code moved into new functions. Call + record_equivlances_from_block_entry. + + * tree-ssa-dom.c (optimize_block): Simplify interface slightly. + Use finalize_block. Extract edge_flags from our block's + incoming edge as necessary. Simplify recursive call. + (thread_through_successor): Extracted from optimize_block. + (finalize_block): Similarly. + + * tree-ssa-dom.c (eliminate_redundant_computations): New function + extracted from optimize_stmt. + (record_equivalences): Similarly. + (optimize_stmt): Use eliminate_redundant_computations and + record_equivalences. If fold_stmt changes stmt, then make sure + to get a new annotation as well. + + * tree-cfg.c (cleanup_control_flow): Pass last statement down to + cleanup_cond_expr_graph and cleanup_switch_expr_graph. + (cleanup_cond_expr_graph): Accept statement from caller and + use it. Return nonzero if the predicate was constant. No longer + static. + (cleanup_switch_expr_graph): Similarly. + (disconnect_unreachable_case_labels): Similarly, except that it + is still static. + * tree-flow.h (cleanup_cond_expr_graph): Prototype. + (cleanup_switch_expr_graph): Similarly. + * tree-ssa-dom.c (optimize_stmt): Also optimize the condition + in a SWITCH_EXPR. Use COND_EXPR_COND and SWITCH_COND to get + conditions instead of relying upon known operand positions. + Use cleanup_cond_expr_graph and cleanup_switch_expr_graph rather + than open coding equivalents. + (lookup_avail_expr): Handle SWITCH_EXPRs. Use COND_EXPR_COND and + SWITCH_COND to get conditions instead of relying upon known + operand positions. + (avail_expr_hash, avail_expr_eq): Similarly. + +2003-10-14 Richard Henderson + + * gimplify.c (gimplify_body): Save and restore input_location; + initialize input_location to DECL_SOURCE_LOCATION. + (gimplify_expr): Always save and restore input_location. + +2003-10-14 Richard Henderson + + * expr.c (expand_expr): Break out EXPR_LOCUS code from ... + (expand_expr_1): ... here, renamed from expand_expr. + +2003-10-13 Richard Henderson + + * c-simplify.c (c_gimplify_stmt): Upreate on location_t and not + fine and line individually. + (gimplify_c_loop, gimplify_switch_stmt): Likewise. + * gimplify.c (wfl_locus): Merge wfl_filename+wfl_lineno. + (annotate_all_with_locus_1): Rename from annotate_stmt_with_file_line. + (annotate_all_with_locus): Replace annotate_all_with_file_line; + update all callers. + * tree-simple.h: Update. + * tree.c, tree.h (annotate_with_locus): New. + +2003-10-13 Steven Bosscher + + * tree-flow-inline.h (def_ops): Take a stmt_ann_t as argument + instead of a tree. + (use_ops): Likewise. + (vdef_ops): Likewise. + (vuse_ops): Likewise. + * tree-flow.h: Update prototypes. + * tree-cfg.c (remove_stmt): Load the statement annotation. + Adjust *_ops calls. + * tree-dfa.c (compute_immediate_uses_for_stmt, + mark_new_vars_to_rename): Likewise. + * tree-pretty-print.c (dump_vops): Likewise. + * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. Also remove now + superfluous stmt_ann() calls. + (visit_stmt, cpp_fold, add_var_to_ssa_edges_worklist, + initialize, replace_uses_in, likely_value): Likewise. + * tree-ssa-copyprop.c (copyprop_stmt): Likewise. + * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise. + * tree-ssa-dom.c (cprop_into_stmt, optimize_stmt, + avail_expr_hash, avail_expr_eq): + Likewise. + * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry, + build_tree_conflict_graph): Likewise. + * tree-ssa-pre.c (maybe_find_rhs_use_for_var, + expr_phi_insertion, same_e_version_real_occ_real_occ, + generate_expr_as_of_bb, bool load_modified_real_occ_real_occ, + bool same_e_version_phi_result, get_default_def,reaching_def, + tree_perform_ssapre): Likewise. + * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmt): + Likewise. + +2003-10-12 Richard Henderson + + * gimplify.c (gimplify_array_ref_to_plus): Be prepared for + null TYPE_DOMAIN or TYPE_MIN_VALUE for the array. + * tree-ssa-ccp.c (fold_indirect_refs_r): Likewise. + +2003-10-12 Richard Henderson + + * tree.h (struct tree_common): Rename unused_1 to invariant_flag. + (TREE_INVARIANT): New. + * builtins.c (build_string_literal): Set TREE_INVARIANT. + * c-common.c (fix_string_type): Likewise. + * c-typeck.c (build_external_ref): Likewise. + (build_c_cast, pop_init_level): Likewise. + * fold-const.c (fold_convert, fold): Likewise. + * tree.c (make_node, build_constructor): Likewise. + (build, build1): Likewise. + (staticp): Pass unknown component references to the language. + (save_expr): Check TREE_INVARIANT instead of TREE_CONSTANT. + (skip_simple_arithmetic): Likewise. + (stabilize_reference_1): Likewise. + * print-tree.c (print_node): Print TREE_INVARIANT. + + * c-common.c (pointer_int_sum): Rely on build to set TREE_CONSTANT. + (finish_label_address_expr): Likewise. + * c-typeck.c (default_function_array_conversion): Likewise. + (parser_build_binary_op, pointer_diff): Likewise. + (build_unary_op, build_binary_op): Likewise. + * fold-const.c (non_lvalue): Likewise. + + * tree-pretty-print.c (dump_generic_node): Handle VIEW_CONVERT_EXPR. + +2003-10-12 Richard Henderson + Diego Novillo + + * gimplify.c (gimplify_array_ref_to_plus): Subtract the array + domain minimum index. + (gimplify_addr_expr): Expand ARRAY_REFs. Cope with Fortran + missing cast wierdnesses. + * tree-dfa.c (get_expr_operands): Handle (&v + c); abort on + other address invariants that should have been folded. + (vdefs_disappeared_p): New. + (mark_new_vars_to_rename): Use it. Move from ... + * tree-ssa-dom.c: ... here. + * tree-flow-inline.h (is_unchanging_value): Remove; use + is_gimple_min_invariant everywhere instead. + (phi_ssa_name_p): New. + * tree-must-alias.c (find_addressable_vars): Process PHIs. + * tree-simple.c (is_gimple_min_invariant): Rename from + is_gimple_const; allow non-static variable addresses; update callers. + (is_gimple_val): Remove ADDR_EXPR checks. + * tree-simple.h: Update. + * tree-ssa-ccp.c (replace_uses_in): Add replaced_address argument. + (substitute_and_fold): Use that to mark_new_vars_to_rename. + (fold_indirect_refs_r): New. + (fold_stmt): Use it. + * tree-ssa-copyprop.c (copyprop_stmt): Call fold_stmt. + * tree-ssa-dce.c (NECESSARY): Use asm_written_flag. + (mark_necessary): Reject DECLs. + * tree-ssa-live.c (register_ssa_partition): Use phi_ssa_name_p. + * tree-ssa-pre.c (generate_expr_as_of_bb): Call fold_stmt if we + replaced with constants. + * tree-ssa.c (insert_copy_on_edge): Unwrap ADDR_EXPRs to set_is_used. + (eliminate_build, coalesce_abnormal_edges, coalesce_vars): Use + phi_ssa_name_p. + +2003-10-09 Frank Ch. Eigler + + java/12211 + * gimplify.c (gimplify_save_expr): Tolerate void-typed saved + expressions. + +2003-10-09 Diego Novillo + + * tree-dfa.c (add_call_clobber_ops): If a variable is read-only, + add a VUSE operand instead of VDEF. + +2003-10-08 Jason Merrill + + PR optimization/12525 + * tree-dfa.c (note_addressable): New fn, split out from... + (add_stmt_operands): Here. + (get_stmt_operands) : Call it for mem ops. + * gimplify.c (gimplify_asm_expr): Call parse_input_constraint + directly. It's only a mem op if allows_mem is set. + +2003-10-08 Diego Novillo + + PR/12187 + * tree-dfa.c (add_stmt_operand): Test against current_function_decl + when checking for global variables. + (may_access_global_mem_p): Likewise. + (add_referenced_var): Likewise. + Consider DECL_NONLOCAL variables call clobbered and used. + (find_hidden_use_vars): Do not test for DECL_NONLOCAL variables. + * tree-optimize.c (tree_rest_of_compilation): Test against + current_function_decl when checking for global variables. + * tree-ssa-ccp.c (get_default_value): Likewise. + * tree-ssa-dce.c (need_to_preserve_store): Likewise. + +2003-10-07 Jason Merrill + + PR optimization/12525 + * gimplify.c (gimplify_asm_expr): If the constraint doesn't allow + a register, call mark_addressable. Split an in/out operand that + does allow a register into separate input and output operands. + +2003-10-06 Richard Henderson + + * fold-const.c (fold): Fold (T1)((T2)X op Y) into (T1)X op Y, + for suitable values of T1 & T2. + +2003-10-06 Andrew Macleod + + * tree-dfa.c (compute_immediate_uses): Add optional callback. + (compute_immediate_uses_for_phi): Remove unused parameter. Add optional + callback to determine if usage info should be calculated for variable. + (compute_immediate_uses_for_stmt): Add optional callback to determine + if usage info should be calculated for variable. + * tree-flow.h (compute_immediate_uses): Update prototype. + * tree-ssa-ccp.c (need_imm_uses_for): New. Callback function passed to + compute_immediate_uses. + (initialize): Calculate defaults initially, then build reduced + immediate use information. + (get_default_value): Non empty stmt's which are not a PHI_NODE or + a MODIFY_EXPR default to VARYING. + +2003-10-06 Andrew Macleod + + * tree-cfg.c (tree_split_edge): Mark edge as FALLTHRU when splitting. + +2003-10-03 Zdenek Dvorak + + * tree-ssa.c (rewrite_block): Test vars_to_rename instead of + PHI_ARG_CAPACITY. + * tree-dfa.c (remove_phi_arg_num): Don't update + PHI_ARG_CAPACITY. + +2003-10-01 Richard Henderson + + * c-decl.c (set_decl_nonlocal): New. + (store_parm_decls): Use it via walk_tree. + +2003-10-01 Jeff Law + + * tree-ssa-dom.c (cprop_into_stmt): New function extracted from + optimize_stmt. + (optimize_stmt): Use cprop_into_stmt. + +2003-09-30 Richard Henderson + + * function.h (struct function): Add function_end_locus. + * c-decl.c (finish_function): Set it. + * tree-optimize.c (tree_rest_of_compilation): Set input_location + to function_end_locus before expand_function_end. + + * tree-optimize.c (optimize_function_tree): Move calls to + remove_useless_stmts_and_vars and lower_eh_constructs ... + (tree_rest_of_compilation): ... here. + + * c-simplify.c (gimplify_expr_stmt): Don't warn for any statement + with void result type. + +2003-09-30 Jeff Law + + * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Fix thinko + in test for swapping ranges. + + * tree-ssa-dom.c (record_range): New function. + (extract_range_from_cond): Likewise. + (tree_ssa_dominator_optimize): Initialize the vrp_data varray. + (optimize_block): Initialize the vrp_variables varray. Wipe + appropriate entries from the VRP varrays when done processing a block. + (get_eq_expr_value): Accept new argument "bb". Call record_range + appropriately. Refactor code to avoid useless work. + (simplify_cond_and_lookup_avail_expr): Use value range records to + simplify conditions. + (simplify_rhs_and_lookup_avail_expr): When simplifying ABS_EXPR, + DIV_EXPR and MOD_EXPR, use simplify_cond_and_lookup_avail_expr + to determine the range of the given variable. + + * tree-ssa-dom.c (find_equivalent_equality_comparison): Do not + look through a typecast which narrows a value. + +2003-09-30 Paul Brook + + * Makefile.in: Add rules for check-gfortran. + +2003-09-29 Richard Henderson + + * gimplify.c (gimplify_cond_expr): Fix both arms dead return value. + +2003-09-29 Jeff Law + + * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): New function. + (find_equivalent_equality_comparison): Likewise. + (optimize_block): Remove code to build a == c equivalence after + seeing a == b and b == c. Remove code to walk backwards + though typecasts to record equivalences and move relevant parts + into find_equivalent_equality_comparison. + (optimize_stmt): Call simplify_cond_and_lookup_avail_expr. + +2003-09-28 Richard Henderson + + * gimplify.c (gimplify_call_expr): Annotate all call_exprs. + * tree-inline.c (expand_call_inline): Set input_location based + on EXPR_LOCUS; save and restore input_location around that. + (walk_tree): Do not set input_location. + +2003-09-27 Graham Stott + + * expr.c (expand_expr)[CATCH_EXPR]: Fix bogus return value. + +2003-09-26 Andrew MacLeod + + * tree-ssa-dom.c (struct var_value_d): Remove. + (const_and_copies): Change to a varray_type. + (tree_ssa_dominator_optimize): Initialize const_and_copies as a varray. + (optimize_block): Simply set the value in const_and_copies. + (dump_dominator_optimization_stats): No hash stats for const_and_copies. + (record_cond_is_true, record_cond_is_false, + simplify_rhs_and_lookup_avail_expr, update_rhs_and_lookup_avail_expr): + Parameter const_and_copies is now a varray_type. + (var_value_hash, var_value_eq): Remove. + (get_value_for, set_value_for): Access varray elements. + (get_eq_expr_value): Parameter const_and_copies is now a varray_type. + + * tree-cfg.c (handle_switch_split): Update container of previous stmt. + +2003-09-25 Daniel Berlin + + * tree-ssa-pre.c (split_critical_edges): New function, temporarily + disabled until some edge splitting/insertion problems are fixed. + (opnum_of_ephi): Take an edge argument, constify. Use hash table lookup. + Update all callers. + (ephi_pindex_eq): New function. + (ephi_pindex_hash): New function. + (ephi_pindex_htab): New variable. + (add_ephi_pred): Update hash table. + (expr_phi_insertion): Don't free the bitmap returned by compute_idfs + anymore. + (idfs_cache): New variable. + (compute_idfs): Rewrite to use cache as much as possible, and not + recompute when we can avoid it. + +2003-09-25 Daniel Berlin + + * tree-alias-ander.c: Fixup comment spacing. + (andersen_op_assign): Handle >2 operands case. + +2003-09-24 Steven Bosscher + + * tree-dfa.c (compute_immediate_uses_for): Split up in two + separate functions, one for PHIs and one for normal statements. + (compute_immediate_uses_for_phi): New. + (compute_immediate_uses_for_stmt): New. + +2003-09-25 Jeff Law + + * tree-ssa-dom.c (optimize_block): When EQ_EXPR_VALUE has the + form DEST = SRC where both DEST and SRC are SSA_NAMEs also + record SRC = DEST into the const and copies table. + + * tree-ssa-dom.c (optimize_block): Change tests which checked + for SSA_VAR_P to only allow SSA_NAMEs. + (get_value_for, set_value_for): Likewise. + (lookup_avail_expr, get_eq_expr_value): Likewise. + +2003-09-25 Andrew MacLeod + + * tree-ssa-dce.c (pdom_info, needed_stmts): Remove. + (NECESSARY): Define. + (necessary_p): Check bit instead of hash table lookup. + (clear_necessary): New. Clear necessary bit. + (mark_necessary): Use bit instead of hash table. No control lookup. + (mark_tree_necessary): Remove. + (find_useful_stmts): Clear necessary bit before checking it. + (stmt_useful_p): Remove GOTO_EXPR case. Check arms of COND_EXPR for + GOTO. All other control flow stmts are necessary. + (process_worklist): Dont look for control parents. + (remove_dead_stmts): No dominattor info is necessary. + (remove_dead_stmt): Don't need BB any more. Remove COND_EXPR by changing + the condition to 'if (0)'. Abort on other control flow. + (tree_ssa_dce): No longer need the hash table. + (remove_conditional): Remove. + +2003-09-25 Andreas Schwab + + * tree-flow.h: Declare next_ssa_version. + * tree-ssa-ccp.c: Remove conflicting declaration. + * tree-ssa-live.c: Likewise. + * tree.c (make_ssa_name): Likewise. + +2003-09-24 Jason Merrill + + * tree.h (DECL_SOURCE_LOCATION): Resurrect. + (DECL_SOURCE_FILE, DECL_SOURCE_LINE): Likewise. + (EXPR_LOCUS): Renamed from TREE_LOCUS. Null for non-exprs. + (SET_EXPR_LOCUS): New macro. + (EXPR_FILENAME): Renamed from TREE_FILENAME. + (EXPR_LINENO): Renamed from TREE_LINENO. + (struct tree_common): Remove locus field. + (struct tree_decl): Re-add locus field. + (struct tree_expr): Add locus field. + * c-aux-info.c, c-decl.c, coverage.c, c-parse.in, dbxout.c, + diagnostic.c, dwarf2out.c, expr.c, function.c, gimplify.c, + integrate.c, print-tree.c, stmt.c, tree.c, tree-cfg.c, + tree-dump.c, tree-flow-inline.h, config/alpha/alpha.c, + config/mips/mips.c: Adjust. + +2003-09-24 Andrew MacLeod + + * tree-ssa-ccp.c (enum latticevalue): Add UNINITIALIZED. + (const_values, struct value_map_d): Remove hash table structures. + (value_vector): New array of values. + (get_value): Use value_vector instead of hash table. Mark inline. + (visit_phi_node): Ignore arguments if the PHI result is already VARYING. + (initialize): Initialize value vector instead of hash table. + (finalize): Free value vector instead of hash table. + (add_var_to_ssa_edges_worklist): Don't add to worklist if + DONT_SIMULATE_AGAIN flag is set. + (value_map_hash, value_map_eq): Delete. + +2003-09-24 Jeff Law + + * tree-ssa-dom.c (optimize_block): Create infrastructure for + tracking const_and_copies equivalences which disappear when + we leave the current block. Use it for equivalences created + by EQ_EXPR_VALUE. Follow use-def chains for EQ_EXPR_VALUE + equivalences and see if certain NOP_EXPRs can be ignored + to create a block-local equivalence for const_and_copies. + (optimize_stmt): Do not get confused by a cast of the return + value from alloca or the address of a non-weak decl. + + * fold-const.c (fold_read_from_constant_string): New function. + * tree.h (fold_read_from_constant_string): Prototype. + * expr.c (expand_expr, case INDIRECT_REF): Use it. + (expand_expr, case ARRAY_REF): Likewise. Put checking code + inside an ENABLE_CHECKING. + * tree-ssa-ccp.c (fold_stmt): Use fold_read_from_constant_string. + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. + +2003-09-23 Jeff Law + + * tree-ssa-dom.c (optimize_block): Ignore "useless" type + conversions in SWITCH_COND when creating equivalenecs at + case labels. + +2003-09-22 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Addresses of non-weak symbols + as well as dynamically allocated stack space are always nonzero. + + * tree-cfg.c (handle_switch_split): Properly mark the fallthru + edge from SRC to DEST with EDGE_FALLTHRU. + +2003-09-22 Daniel Berlin + + * tree-flow.h (struct bb_ann_d): Add erefs array. + * tree-ssa-pre.c (handle_bb_creation): Remove ei parameter. + Update caller. + (struct expr_info): Remove erefs array. + (append_eref_to_block): New function. + (clear_all_eref_arrays): Ditto. + (expr_phi_insertion): Use append_eref_to_block. + (insert_occ_in_preorder_dt_order_1): Ditto. + (subst_phis): Only copy expression, not the containing EUSE/EPHI. + Update all callers to reflect this. + (compute_will_be_avail): Update for per-block eref array. + (handle_bb_creation): Ditto. + (pre_expression): Ditto. + (tree_perform_ssapre): Clear eref arrays when done with expression. + +2003-09-22 Diego Novillo + + * tree-cfg.c (dump_tree_bb): Remove superlfuous newlines. + +2003-09-21 Diego Novillo + + * tree-dfa.c (compute_alias_sets): Use TDI_alias instead of + TDI_ssa. + * tree-dump.c (dump_files): Add enties for TDI_alias, TDI_ssa1, + TDI_dom1, TDI_ssa2, TDI_dce1, TDI_ssa3, TDI_dom2, TDI_ssa4, + TDI_ssa5 and TDI_dce2. + Remove entries for TDI_ssa, TDI_dom and TDI_dce. + * tree.h (enum tree_dump_index): Similarly. + (TDF_ALIAS): Remove. + (TDF_VOPS): Change value. + * doc/invoke.texi (-fdump-tree-alias): Document. + * tree-flow.h (tree_warn_uninitialized): Remove unused variable. + (rewrite_into_ssa): Add enum tree_dump_index argument. Update all + callers. + (rewrite_out_of_ssa): Likewise. + (tree_perform_ssa_pre): Likewise. + (tree_ssa_dominator_optimize): Likewise. + (tree_ssa_dce): Likewise. + (tree_ssa_copyprop): Likewise. + (tree_ssa_ccp): Likewise. + Add sbitmap argument. + (tree_compute_must_alias): Likewise. + (mark_new_vars_to_rename): Declare. + * tree-must-alias.c (tree_compute_must_alias): Do not call + rewrite_into_ssa. + Remove local vars_to_rename. Use new argument instead. + * tree-optimize.c (optimize_function_tree): Re-write optimization + ordering to support passes that need the SSA form updated. + Call tree_ssa_dominator_optimize. + Re-arrange optimization ordering. + * tree-ssa-ccp.c (substitute_and_fold): Take new argument + vars_to_rename. + Call mark_new_vars_to_rename. + (visit_phi_node): Move variable 'val' into the right scope. + (initialize): Move call dump_begin ... + (tree_ssa_ccp): ... here. + * tree-ssa-dom.c (mark_new_vars_to_rename): Declare extern. + Make sure that variables in virtual operands aren't marked + unnecessarily. + * tree-ssa.c (rewrite_into_ssa): Do not call + tree_ssa_dominator_optimize. + +2003-09-21 Diego Novillo + + * tree-ssa-dce.c (dom_info): Remove unused variable. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): If the CFG has been + altered, call cleanup_tree_cfg. + Call cleanup_tree_cfg before returning. + * tree-ssa-pre.c (tree_perform_ssapre): Call get_stmt_operands + before processing the statement. + * tree-ssa-dom.c (thread_edge): Remove attribute EDGE_FALLTHRU from + edge. + +2003-09-21 Jeff Law + + * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Break out of + optimize_stmt. Follow the def-use chains back for certain expressions + to see if we can simplify the RHS of the current expression based + on earlier expressions. + + * tree-ssa-dom.c (optimize_block): Rework code to propagate values + into PHI nodes to be more efficient. + +2003-09-20 Andrew MacLeod + + * tree-flow.h (struct dataflow_d): Remove reaching fields, add 2 element + vector of trees. + * tree-flow-inline.h (immediate_uses): Rename to get_immediate_uses, + return a dataflow object. + (reaching_defs): Remove until needed. + (num_immediate_uses): New. Return number of immediate uses. + (immediate_use): New. Return a specified immediate use. + * tree-dfa.c (add_immediate_use): Use new fields. + (dump_immediate_uses_for): Use new interface. + (create_phi_node): Chain to start of list. + * tree-ssa-ccp.c (add_var_to_ssa_edges_worklist): Use new interface. + * tree-ssa.c (compute_global_livein): Loop interchange. + +2003-09-18 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of a + MODIFY_EXPR even if we can't record any equivalences created by + the MODIFY_EXPR. Move code to simplify ABS_EXPR, TRUNC_DIV_EXPR + and TRUNC_MOD_EXPR to an earlier position. + +2003-09-19 Andrew MacLeod + + * tree-ssa-ccp.c (cfg_edges): Rename to cfg_blocks. + (cfg_blocks_num, cfg_blocks_head, cfg_blocks_tail): New. Queue markers. + (bb_in_list): New. Vector indicating if a BB is in the cfg_blocks list. + (tree_ssa_ccp): Use new routines. + (add_control_edge): Add to cfg_blocks list. + (initialize): Initialize new variables. + (finalize): Free allocations. + (cfg_blocks_empty): New. Is cfg_blocks queue list. + (cfg_blocks_add): New. Add a basic block to cfg_blocks list. + (cfg_blocks_pop): New. Get a basic_block from the list. + +2003-09-18 Richard Henderson + + * tree-cfg.c (struct rusv_data): Add may_throw, may_branch. + (remove_useless_stmts_and_vars_1): Set them. + (remove_useless_stmts_and_vars_goto): Likewise. + (remove_useless_stmts_and_vars_tf): Transform to compound_expr + if only fallthrough. + (remove_useless_stmts_and_vars_tc): Kill region if nothrow. + Detect catch regions that don't propagate exceptions. + (remove_useless_stmts_and_vars): Zero entire data struct. + +2003-09-18 Richard Henderson + + * tree-eh.c (lower_try_finally_dup_block): New. + (honor_protect_cleanup_actions, lower_try_finally_copy): Use it. + +2003-09-18 Richard Henderson + + * tree-cfg (remove_useless_stmts_and_vars_cond, + remove_useless_stmts_and_vars_tf, + remove_useless_stmts_and_vars_tc, + remove_useless_stmts_and_vars_bind, + remove_useless_stmts_and_vars_goto): Break out of ... + (remove_useless_stmts_and_vars_1): ... here. Rename to _1; + take and use struct rusv_data. + (remove_useless_stmts_and_vars): New. Loop until no change. + * tree-flow.h (remove_useless_stmts_and_vars): Update decl. + * tree-ssa.c (rewrite_out_of_ssa): Don't loop here. + +2003-09-18 Richard Henderson + + * tree-pretty-print.c (dump_generic_node): Don't double indent asms. + +2003-09-18 Richard Henderson + + * tree-eh.c: Include langhooks.h, remove errors.h. + (decide_copy_try_finally): Use estimate_num_insns to choose + between copy and switch implementations. + + * c-common.c (c_estimate_num_insns): Take an expr, not a decl. + * tree-inline.c (limits_allow_inlining): Pass it the body of the decl. + +2003-09-18 Jeff Law + + * tree-ssa-dom.c (lookup_avail_expr): New argument which indicates + if the expression should be entered into the hash table. All + callers updated. + (update_rhs_and_lookup_avail_expr): New function factored out + of optimize_stmt. + + * tree.h (commutative_tree_code, associative_tree_code): Declare + * tree.c (commutative_tree_code, associative_tree_code): New + functions. + (iterative_hash_expr): Use commutative_tree_code. + * fold-const.c (operand_equal_p): Use commutative_tree_code + rather than inlining the communitivy check. + (fold, nondestructive_fold_binary_to_constant): Similarly. + +2003-09-18 Diego Novillo + + * Makefile.in (tree-eh.o): Add dependency on errors.h + * tree-eh.c: Include errors.h + +2003-09-17 Richard Henderson + + * tree-cfg.c (remove_useless_stmts_and_vars): Revert last change. + * tree-flow.h, tree-ssa.c: Likewise. + +2003-09-17 Richard Henderson + + * tree-eh.c (decide_copy_try_finally): Remove forgotten debug code. + +2003-09-17 Daniel Berlin + + * tree-ssa-pre.c (pick_ssa_name): New function. + (code_motion): Use it. + +2003-09-17 Richard Henderson + + * tree-eh.c: New file. + * Makefile.in (OBJS-common): Add it. + (tree-eh.o): New. + * calls.c (emit_call_1): New argument for full call expr. + Check with lookup_stmt_eh_region to set REG_EH_REGION. + (expand_call): Likewise for tail-calls. + * except.c (struct eh_region): Add tree_label. + (gen_eh_region, gen_eh_region_cleanup, gen_eh_region_try, + gen_eh_region_catch, gen_eh_region_allowed, + gen_eh_region_must_not_throw, get_eh_region_number, + get_eh_region_may_contain_throw, get_eh_region_tree_label, + set_eh_region_tree_label, expand_resx_expr): New. + (expand_eh_region_start, expand_start_catch): Use them. + (expand_end_catch): Tidy. + (note_eh_region_may_contain_throw): Take region argument. + (note_current_region_may_contain_throw): New. + (get_exception_filter): Export. + (collect_eh_region_array): Export. + (remove_unreachable_regions): Check ERT_TRY based on reachability + of catches, not reachability of continue_label. Never remove + ERT_MUST_NOT_THROW regions. + (collect_rtl_labels_from_trees): New. + (convert_from_eh_region_ranges): Use it. + (connect_post_landing_pads): Handle dying cleanups. + (struct reachable_info): Add callback data. + (add_reachable_handler): Invoke the callback. + (foreach_reachable_handler): New. + (reachable_handlers): Use it. + (arh_to_landing_pad, arh_to_label): New. + (can_throw_internal_1): Split out from can_throw_internal. + (can_throw_external_1): Similarly. + * except.h: Update. + * expr.c (expand_expr): Handle RESX_EXPR, FILTER_EXPR. + * gimplify.c (gimplify_modify_expr): Use tree_could_trap_p. + * stmt.c (using_eh_for_cleanups_p): Export. + (expand_return): Allow any typed rhs. + * timevar.def (TV_TREE_EH): New. + * tree-cfg.c (eh_stack): Kill. + (build_tree_cfg): Don't set it. Kill code to handle EH. + (could_trap_p): Move to tree-eh.c as tree_could_trap_p. + (get_eh_region_type, make_try_expr_blocks, make_catch_expr_blocks, + make_eh_filter_expr_blocks, try_finallys): Kill. + (make_edges): Kill code to handle EH. + (make_ctrl_stmt_edges): Kill TRY_FINALLY_EXPR, CATCH_EXPR, + EH_FILTER_EXPR. Handle RESX_EXPR. + (make_call_expr_edges): Kill. + (make_exit_edges): Use make_eh_edges. + (label_to_block): New. + (make_goto_expr_edges): Use it. + (is_ctrl_stmt): Add RESX_EXPR. + (is_ctrl_altering_stmt): Restructure. Use tree_can_throw_internal. + (last_exec_block, compute_reachable_eh): Kill. + * tree-dfa.c (get_stmt_operands): Add RESX_EXPR. + (get_expr_operands): Add FILTER_EXPR. + * tree-dump.c (dump_files): Add tree-eh. + * tree-flow.h (struct stmt_ann_d): Kill reachable_exception_handlers. + (label_to_block, lower_eh_constructs, make_eh_edges, + tree_could_trap_p, tree_could_throw_p, tree_can_throw_internal, + tree_can_throw_external): Declare. + * tree-optimize.c (optimize_function_tree): Call lower_eh_constructs. + (tree_rest_of_compilation): Save tree for inlining. + * tree-pretty-print.c (dump_generic_node): Handle FILTER_EXPR, + RESX_EXPR. + * tree-simple.c (is_gimple_stmt): Add RESX_EXPR. + (is_gimple_val): Add FILTER_EXPR. + * tree-ssa-dce.c (stmt_useful_p): Restructure. Add lhs of + EXC_PTR_EXPR or FILTER_EXPR. + * tree.def (FILTER_EXPR, RESX_EXPR): New. + * tree.h (enum tree_dump_index): Add TDI_eh. + +2003-09-17 Richard Henderson + + * tree.c (tsi_link_before): Remove unnecessary parens. + (tsi_link_chain_before, tsi_delink): Likewise. + (tsi_link_after): Accept the case if the iterator points + to a NULL node; treat it as an empty list. + (tsi_link_chain_after): Likewise. Update iterator properly + for TSI_CHAIN_END. + +2003-09-17 Richard Henderson + + * tree-inline.c (debug_find_tree_1, debug_find_tree): New. + +2003-09-17 Richard Henderson + + * tree-cfg.c (struct rusv_data): New. + (remove_useless_stmts_and_vars_1): Rename from + remove_useless_stmts_and_vars. Use rusv_data. Handle goto-next + via remembering the last goto seen, and zapping it when appropriate. + (remove_useless_stmts_and_vars): New. Loop until done. + * tree-flow.h (remove_useless_stmts_and_vars): Update decl. + * tree-optimize.c (optimize_function_tree): Don't cache fnbody. + Dump data after remove_useless_stmts_and_vars. + * tree-ssa.c (rewrite_out_of_ssa): Kill loop around + remove_useless_stmts_and_vars. + * tree-dump.c (dump_files): Add .useless. + * tree.h (enum tree_dump_index): Add TDI_useless. + +2003-09-17 Diego Novillo + + * pretty-print.c (pp_write_text_to_stream): Export. + * pretty-print.h (pp_write_text_to_stream): Declare. + * tree-pretty-print.c (print_generic_stmt): Flush to file. + (dump_generic_node): Call pp_write_text_to_stream. + (maybe_init_pretty_print): Take file argument; associate the + stream with the buffer. + +2003-09-17 Jeff Law + + * tree-ssa-ccp.c (ccp_fold): If the return value has the wrong + type, try to convert it to the proper type rather than failing. + + * tree-ssa-dom.c (optimize_stmt): Note that the statement is + modified, even if we just change the virtual operands. If + the statement was modified by const/copy propagation, then + set may_have_exposed_new_symbols. + +2003-09-17 Diego Novillo + + * tree-dfa.c (find_vars_r): Do not consider 'void *' pointers as + dereferenced when scanning function call arguments. + * tree-flow-inline.h (may_propagate_copy): Block propagation of + pointers when they have different memory tags. + * tree-ssa-copyprop.c (propagate_copy): When copy propagating + pointers, abort if the two pointers don't have identical memory + tags. + +2003-09-16 Jeff Law + + * tree-ssa-ccp.c (visit_stmt): Do not set DONT_SIMULATE_AGAIN + just because a statement as virtual definitions. + (likely_value): A CALL_EXPR is assumed to return a VARYING + result, regardless of its operands. + +2003-09-15 Jason Merrill + + * tree-simple.c (is_gimple_val): Allow addresses of all decls. + (is_gimple_const): Allow addresses of all non-weak statics. + * tree-ssa-ccp.c (fold_stmt): Return bool. + * tree-flow.h: Adjust prototype. + * tree-ssa-dom.c (optimize_stmt): If folding changed stuff, we + need to recalculate the vops. + +2003-09-13 Diego Novillo + + Fix PR optimization/12268 + * tree-dfa.c (add_referenced_var): Call-clobbered pointers may + point to global memory. + +2003-09-13 Jason Merrill + + * c-common.c (c_apply_type_quals_to_decl): Unset TREE_READONLY for + types with constructors. + Remove superfluous references to TREE_TYPE (decl). + +2003-09-13 Diego Novillo + + * opts.c (decode_options): Enable must-alias optimization by default. + * tree-dfa.c (get_expr_operands): Always call add_stmt_operand when + dealing with ADDR_EXPR nodes. + (add_stmt_operand): If the variable has an alias set + of size zero, abort. + Call get_base_symbol() to retrieve the variable from an ADDR_EXPR + node. + (compute_alias_sets): Deep copy the aliases array when triggering + the alias grouping heuristic. + Don't group aliases if -ftree-must-alias is given. + * tree-must-alias.c (tree_compute_must_alias): Call + dump_referenced_vars when doing detailed dumps. + Rename promoted_vars to vars_to_rename. Update all users. + (find_addressable_vars): Always mark statements modified. + (promote_var): Also mark aliases of promoted variable to be + renamed. + Call find_variable_in and remove_element_from to update varrays for + call-clobbered variables and alias sets. + (find_variable_in): New local function. + (remove_element_from): New local function. + * varray.c (varray_copy): New function. + * varray.h (varray_copy): Declare. + +2003-09-13 Diego Novillo + + * tree-flow-inline.h (is_optimizable_addr_expr): Remove. Update + all users. + * tree-ssa-dom.c (optimize_stmt): Do not propagate SSA names from + redundant expressions across abnormal edges. + +2003-09-13 Zdenek Dvorak + + * tree-cfg.c (remove_unreachable_blocks): Clean up. + (debug_tree_bb_n): New. + (is_ctrl_structure): Remove LOOP_EXPR. + * tree-flow.h (debug_tree_bb_n): Declare. + +2003-09-12 Andrew Macleod + + * tree-ssa-live.c (calculate_live_on_entry): Use default_def to add + addition checks to live on entry calculations. + * tree-ssa.c (print_exprs_edge): New debug output function. + (coalesce_abnormal_edges): Add basic block information to output. + (coalesce_ssa_name): Use default_def instead of trying to compute live + on entry variables. + +2003-09-12 Diego Novillo + + * tree-optimize.c (tree_rest_of_compilation): Set TREE_ASM_WRITTEN + for functions that have errors. + +2003-09-12 Diego Novillo + + * tree-ssa-pre.c (graph_dump_file, graph_dump_flags): Remove + unused variables. + +2003-09-11 Daniel Berlin + + * tree-ssa-pre.c (reset_down_safe): Make test less conservative. + (cba_search_start_from): Start from abnormal edge arguments, too. + (cba_search_continue_from_to): Ditto here. + +2003-09-11 Daniel Berlin + + * tree-ssa-pre.c: s/#if ENABLE_CHECKING/#ifdef ENABLE_CHECKING/g. + Add more comments to DFS searching functions. + (cba_search_reach_from_to): Remove empty function. + (code_motion): Remove #if 0'd code. + (pre_expression): Ditto. + * tree.h (tree_dump_index): Remove TDI_predot. + * tree-dump.c (dump_files): Ditto. + +2003-09-11 Jason Merrill + + Make EDGE_FALLTHRU meaningful for tree-cfg. + * tree-cfg.c (make_edges): Set EDGE_FALLTHRU on fallthrough edge. + (make_exit_edges): Likewise. + (make_ctrl_stmt_edges): Don't set EDGE_FALLTHRU on edges into a + control structure. + (handle_switch_fallthru): Clear EDGE_FALLTHRU after inserting a goto. + (find_insert_location): Only insert after a CALL_EXPR or MODIFY_EXPR. + (bsi_insert_on_edge_immediate): Count outgoing abnormal edges. + Insert before all control stmts. + (bsi_link_after): Handle a block with nops after the last stmt. + + Rename some things to clarify difference between "control structures" + (i.e. COND_EXPR) and "control statements" (also GOTO_EXPR). + * basic-block.h (BB_CONTROL_STRUCTURE): Rename from BB_CONTROL_EXPR. + * tree-cfg.c (REMOVE_NON_CONTROL_STRUCTS): Rename from + REMOVE_NON_CONTROL_STMTS. + (REMOVE_CONTROL_STRUCTS): Rename from REMOVE_CONTROL_STMTS. + (make_ctrl_stmt_edges): Move GOTO_EXPR/RETURN_EXPR handling here... + (make_exit_edges): ...from here. + (is_ctrl_altering_stmt): Don't accept GOTO_EXPR/RETURN_EXPR. + (is_ctrl_structure): Renamed from old is_ctrl_stmt. + (is_ctrl_stmt): New fn. + (bsi_move_to_bb_end): Use it. + (stmt_starts_bb_p): Use is_ctrl_stmt and is_ctrl_altering_stmt. + * tree-flow.h: Add prototype. + * tree-ssa-ccp.c, tree-ssa-dom.c: Update for name changes. + +2003-09-10 Daniel Berlin + + * tree-ssa-pre.c (ephi_has_bottom): Remove dead function. + (ephi_has_unsafe_arg): New function. + (compute_down_safety): Use it. + (reset_down_safe): Continue search on abnormal edges, too. + +2003-09-10 Jason Merrill + + * gimplify.c (gimplify_asm_expr): Add post_p parm. + (get_initialized_tmp_var): Add post_p parm. + (internal_get_tmp_var): Likewise. + (gimplify_expr, get_formal_tmp_var): Pass it. + * c-simplify.c (gimplify_decl_stmt): Pass it. + * tree-simple.h: Adjust prototype. + + * tree-cfg.c (make_call_expr_edges): Break out from... + (make_exit_edges): ...here. Check TREE_NOTHROW. + (is_ctrl_altering_stmt): Check TREE_NOTHROW. + +2003-09-10 Paul Brook + + * gimplify.c (gimplify_compound_lval): Treat REALPART_EXPR and + IMAGPART_EXPR the same as COMPONENT_REF. + * tree-simple.c (is_gimple_addr_expr_arg): Ditto. + (is_gimple_lvalue): Remove REALPART_EXPR and IMAGPART_EXPR. + +2003-09-10 Diego Novillo + + * c-pretty-print.c (decl_name_str): New local function. + (pp_c_direct_declarator): Call it. + (pp_c_primary_expression): Call it. + (pp_c_id_expression): Call it. + (pp_c_statement): Call it. + +2003-09-10 Diego Novillo + + * tree-pretty-print.c (dump_generic_node): Change string used to + display _DECL nodes with no DECL_NAME. + +2003-09-10 Diego Novillo + + * tree-dfa.c (add_referenced_var): Handle cases when argument + walk_state is NULL. + (add_referenced_tmp_var): New function. + * tree-flow.h (add_referenced_tmp_var): Declare it. + * tree-ssa-pre.c (pre_expression): Call it. + * tree-ssa-live.c (create_ssa_var_map): Add checking for variables + being in real and virtual operands. + +2003-09-01 Zdenek Dvorak + Jeff Law + + * tree-flow.h (remove_unreachable_blocks): Declare. + * tree-cfg.c (remove_unreachable_blocks): Export. Return true + if blocks were removed. + * tree-ssa-dom.c (optimize_block, optimize_stmt): Record whether + the cfg has changed. Schedule jump threading. If a block + has more than one pred, then do not record equivalences created + by a controlling COND_EXPR. + (edges_to_redirect, redirection_targets): New variables. + (thread_edge): Split out of optimize_block. + (tree_ssa_dominator_optimize); Remove unreachable blocks and + recompute dominator tree when the cfg changes. + +2003-09-07 Steven Bosscher + + * c-tree.h: Don't declare c_genericize, it's already + declared in c-common.h. + +2003-09-07 Steven Bosscher + + Fix PR optimization/12198 + * tree-cfg.c (value_matches_some_label): Handle integer + case ranges. + +2003-09-06 Zdenek Dvorak + + * tree-iterator.h (tsi_iterator_update): Added TSI_CHAIN_START, + TSI_CHAIN_END, TSI_CONTINUE_LINKING and comments. + (tsi_link_chain_before, tsi_link_chain_after): Declare. + * tree.c (tsi_link_chain_before, tsi_link_chain_after): New. + (tsi_link_before, tsi_link_after): Handle new TSI_... + positions. + +2003-09-06 Diego Novillo + + * varray.c (element): Add entry for 'tree *'. + * varray.h (enum varray_data_enum): Add VARRAY_DATA_TREE_PTR. + (union varray_data_tag): Add entry for 'tree *'. + (VARRAY_TREE_PTR_INIT): Define. + (VARRAY_TREE_PTR): Define. + (VARRAY_PUSH_TREE_PTR): Define. + (VARRAY_TOP_TREE_PTR): Define. + * tree-cfg.c: Replace uses of VARRAY_GENERIC_PTR with + VARRAY_TREE_PTR when accessing operand arrays. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-copyprop.c: Likewise. + * tree-ssa-dce.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa-live.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-dfa.c: Likewise. + * tree-ssa.c: Likewise. + * tree-flow.h (struct operands_d): Remove 'skip' GC markers from + all fields. + (struct dataflow_d): Likewise. + +2003-09-05 Diego Novillo + + * tree-dfa.c (find_referenced_vars): Re-enable .GLOBAL_VAR + optimization. + +2003-09-05 Daniel Berlin + + * tree.h (tree_eref_common): Make stmt a tree, not a tree *. + * tree-ssa-pre.c: Transform all tree *'s to tree. + +2003-09-05 Paul Brook + + * tree.h (enum tree_index): Delete TI_SIGNED_SIZE_TYPE here. + (signed_size_type_node): No longer a member of global_trees. + * c-common.h (enum c_tree_index): New member CTI_SIGNED_SIZE_TYPE. + (signed_size_type_node): Moved, now a member of c_global_trees. + +2003-09-05 Diego Novillo + + * tree-dfa.c (find_referenced_vars): Temporarily disable + .GLOBAL_VAR optimization. + +2003-09-04 Daniel Berlin + + * tree-alias-common.c: Add overview. + * tree-alias-ander.c: Add overview and more specific comments on what + each function does. + +2003-09-04 Diego Novillo + + * tree-optimize.c (tree_rest_of_compilation): Return if errorcount + or sorrycount are non-zero. + +2003-09-04 Diego Novillo + + * tree-cfg.c (cleanup_tree_cfg): Traverse basic blocks + with FOR_EACH_BB. + (remove_useless_stmts_and_vars): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. + * tree-ssa.c (rewrite_into_ssa): Likewise. + * tree-dfa.c (remove_all_phi_nodes_for): Make sure that the new + list of PHI nodes is NULL-terminated. + Add sanity checks to make sure all the PHI nodes for variables to + rename are gone. + +2003-09-04 Diego Novillo + + * tree-dfa.c (struct walk_state): Add field 'num_calls'. + (add_call_clobber_ops): New local function. + (add_call_read_ops): New local function. + (get_expr_operands): Call them. + (add_stmt_operand): Call-clobbered variables are always added to + virtual operands. + (find_referenced_vars): If the number of call-clobbered variables + and number of call sites is larger than a certain threshold, group + all call-clobbered variables under .GLOBAL_VAR. + (find_vars_r): Count the number of call sites. + Don't add .GLOBAL_VAR to the list of referenced variables. + (add_referenced_var): If the addressable variable is an array, + register alias set of the type of the elements, not the type of the + array. + * tree-ssa-dom.c (mark_new_vars_to_rename): Rename from + find_new_vars_to_rename. Update all users. + Before scanning the statement for new operands, mark the existing + virtual operands to be renamed again. + (optimize_stmt): Also check for newly exposed variables when doing + redundancy elimination. + * tree-ssa.c (rewrite_into_ssa): Don't abort when rename_count is + greater than 2. Simply stop trying at 3. + (prepare_operand_for_rename): New function. + (mark_def_sites): Call it. + (rewrite_stmt): Don't check if the operand is an SSA_NAME before + calling rewrite_operand. + (rewrite_operand): Don't abort if the operand was already an + SSA_NAME. Ignore it. + +2003-09-03 Richard Henderson + + * tree-optimize.c (set_save_expr_context, clear_decl_rtl, + tree_rest_of_compilation): Merge from mainline new file. + * Makefile.in (tree-optimize.o): Update. + * c-semantics.c (expand_stmt_toplev): New. + * c-common.h (expand_stmt_toplev): Declare. + * c-lang.c, objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Use it. + +2003-09-03 Richard Henderson + + * gimplify.c (gimplify_switch_expr): Leave the outermost cast + as part of the switch condition. + +2003-09-02 Diego Novillo + + * Makefile.in (tree.o): Add dependency on $(BASIC_BLOCK_H) and + $(TREE_FLOW_H) + * tree.c: Include basic-block.h and tree-flow.h + (tsi_link_after): Adjust basic block tree pointers when inserting a + new COMPOUND_EXPR. + +2003-09-02 Richard Henderson + + * c-decl.c (finish_function): Fix misapplied patch. Don't + free_after_parsing or free_after_compilation. For real this time. + +2003-09-01 Daniel Berlin + + * tree-ssa-pre.c (finalize_1): Remove unnecessary call to + insert_euse_in_preorder_dt_order. + (code_motion): Ditto. + (pre_expression): Ditto. + +2003-09-01 Zdenek Dvorak + Jeff Law + + * basic-block.h (BB_LOOP_CONTROL_EXPR): Remove. + * c-simplify.c (gimplify_c_loop): Create loops in a better shape. + * cfgloop.h (create_loop_notes): Declare. + * cfgloopmanip.c (create_loop_notes): New. + * explow.c (probe_stack_range): Don't produce loop notes when we + recreate them. + * expr.c (emit_block_move_via_loop): Ditto. + * gimplify.c (build_and_jump): Export. + (gimplify_loop_expr): Don't produce LOOP_EXPRs. + * toplev.c (rest_of_compilation): Recreate loop notes if needed. + * tree-cfg.c (make_loop_expr_edges, make_loop_expr_blocks): Removed. + (find_contained_blocks, make_ctrl_stmt_edges, + remove_useless_stmts_and_vars, stmt_ends_bb_p, bsi_insert_before, + find_insert_location, bsi_insert_on_edge_immediate, + merge_tree_blocks): Remove handling of LOOP_EXPRs. + (remove_stmt): Remove handling of BB_LOOP_CONTROL_EXPR. + (find_taken_edge): Remove comment on LOOP_EXPRs. + (dump_tree_bb): Don't dump loop-related information. + (is_loop_stmt, is_latch_block_for): Removed. + (find_insert_location): Handle TRY_CATCH and TRY_FINALLY. + * tree-flow.h (is_loop_stmt, loop_body, set_loop_body, + is_latch_block_for): Removed. + * tree-dfa.c (get_stmt_operands): Don't handle LOOP_EXPRs. + * tree-simple.c (is_gimple_stmt): Remove handling of LOOP_EXPRs. + * tree-simple.h: Remove LOOP_EXPRs from gimple grammar comment. + (build_and_jump): Declare. + * tree-ssa.c (remove_annotations_r): Don't handle LOOP_EXPRs. + +2003-08-29 Daniel Berlin + + * opts.c (decode_options): Turn on SSAPRE by default. + +2003-08-29 Jason Merrill + + * builtins.c (simplify_builtin): Make sure that the replacement + has the same type as the original expression. + (simplify_builtin_strpbrk): Fix type of COMPOUND_EXPR. + (simplify_builtin_strncpy, simplify_builtin_memcmp): Likewise. + (simplify_builtin_strncmp, simplify_builtin_strncat): Likewise. + (simplify_builtin_strspn, simplify_builtin_strcspn): Likewise. + (simplify_builtin_fputs, simplify_builtin_sprintf): Likewise. + +2003-08-28 Zdenek Dvorak + + * builtins.c (expand_builtin): Expand BUILT_IN_STACK_SAVE and + BUILT_IN_STACK_RESTORE. + * builtins.def (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE): New. + * gimplify.c (build_stack_save_restore): New functions. + (struct gimplify_ctx): New field save_stack. + (gimplify_bind_expr, gimplify_call_expr): Arrange save of stack on + BIND_EXPR entry and restore on exits. + * stmt.c (expand_stack_alloc): Saving of stack removed. + (expand_stack_save, expand_stack_restore): New. + * tree.h (expand_stack_save, expand_stack_restore): Declare. + +2003-08-28 Diego Novillo + + * tree-dfa.c (add_vdef): Check for duplicate voperands first. + Handle SSA_NAME in voperands. + (add_vuse): Likewise. + +2003-08-27 Diego Novillo + + * tree-flow.h (var_ann_d): Convert is_in_va_arg_expr into a + bitfield. + +2003-08-27 Daniel Berlin + + * tree-ssa-pre.c: Update comments to reflect reality. + (insert_one_operand): Remove #if'0d code. + +2003-08-27 Zdenek Dvorak + + * gcov.c (typedef struct arc_info): New field cs_count. + (accumulate_line_counts): Find cycles correctly. + +2003-08-27 Daniel Berlin + + * tree-ssa-pre.c (compute_du_info): Move #if ENABLE_CHECKING up one + line. + +2003-08-27 Daniel Berlin + + * tree.h (struct ephi_arg_d): New structure. + (struct eref_common): Remove non-used members, move some members + elsewhere. + (struct ephi_node): Ditto. + + * tree-optimize.c (optimize_function_tree): Move PRE before DCE. + + * tree.c (tree_size): use sizeof (struct ephi_arg_d) for ephi's. + + * tree-pretty-print.c (dump_generic_node): Re-teach to pretty + print euses/ephis/etc given new structures, members, and + relationships. + + * tree-ssa-pre.c (fixup_domchildren): Removed. + (a_dom_b): Ditto. + (calculate_preorder): Ditto. + (defs_match_p): Ditto. + (defs_y_dom_x): Ditto. + (compute_can_be_avail): Ditto. + (reset_can_be_avail): Ditto. + (reset_later): Ditto. + (compute_later): Ditto. + (repair_*): Ditto. + (set_replacement): Ditto. + (remove_ephi): Ditto. + (set_expruse_def): Ditto. + (occ_compare): Ditto. + (defs_hash_expr): Ditto. + (compute_dt_preorder): Ditto + (search_dt_preorder): Ditto. + (ephi_operand_for_pred): Ditto. + (injured_ephi_operand): Ditto. + (compute_stops): New function. + (occ_identical_to): Ditto. + (require_phi): Ditto. + (do_ephi_df_search_1): Ditto. + (do_ephi_df_search): Ditto. + (any_operand_injured): Ditto. + (compute_du_info): Ditto. + (add_ephi_use): Ditto. + (insert_one_operand): Ditto. + (add_ephi_pred): Ditto. + (created_phi_preds): New bitmap. + (dfn) Removed static variable. + (idom_of_ephi): Ditto. + (avdefs): Move into expr_info). + (struct ephi_use_entry): New structure for EPHI uses. + (struct ephi_df_search): New structure for depth first searchs. + (cant_be_avail_search): Implementation of structure for + cant_be_avail search. + (stops_search): Ditto for stops. + (replacing_search): Ditto for replacing_search. + (do_proper_save): Arguments changed, callers updated. + (create_ephi_node): Use sizeof (struct ephi_arg_d). + (ephi_has_bottom): Rewrite for updated ephi-pred handling. + (ephi_will_be_avail): Rewrite in terms of CANT_BE_AVAIL and STOPS. + (expr_phi_insertion): Remove dead code. + Update for new flags. + (insert_occ_in_preorder_dt_order_1): Only insert one ephi-pred per + block. + Fix exit occurence handling. + (rename_1): Remove occs stuff. + Update for new ephi-pred handling. + (reset_down_safe): Update for new ephi-pred handling. + (compute_down_safe): Ditto. + (can_insert): Ditto. + (insert_one_operand): Split out from finalize_1. + (finalize_1): Update for new ephi-pred handling. + Only insert non-pointless, will-be-avail phis, rather than *all* + ephis. + (get_temp): New function. Hand us the right temporary for a given + EPHI/EUSE. + (code_motion): Use EREF_TEMP again, now that we can do it + properly. + +2003-08-26 Zdenek Dvorak + + * builtins.c (expand_builtin): Handle STACK_ALLOC. + * builtins.def (BUILT_IN_STACK_ALLOC): New. + * c-simplify.c (gimplify_decl_stmt, c_gimplify_stmt, + gimplify_compound_literal_expr): Arrange explicit stack allocation. + * expr.c (expand_expr): Handle deferred variables. + * stmt.c (expand_stack_alloc): New. + * tree-simple.c (is_gimple_val): Prevent ADDR_EXPRs of vla's from + being reduced. + * tree.h (expand_stack_alloc): Declare. + +2003-08-26 Zdenek Dvorak + + * tree-ssa.c (build_dominator_tree): Use FOR_EACH_BB. + +2003-08-26 Jason Merrill + + * tree-simple.c (is_gimple_val): Also disallow memory vars. + +2003-08-25 Zdenek Dvorak + + * integrate.c (copy_decl_for_inlining): Reset DECL_TOO_LATE. + +2003-08-25 Zdenek Dvorak + + * tree-ssa-dom.c (optimize_block): Handle empty source block. + + * tree-ssa-dom.c (optimize_block): Handle case when dominance + tree children have also other sucessors. Add dump to jump + threading. + +2003-08-25 Jason Merrill + + * c-simplify.c (mark_labels_r): New fn. + (gimplify_decl_stmt): Use it to mark labels in static initializers. + * tree-simple.c (is_gimple_initializer): Remove. + (is_gimple_reg_type): New fn. + (is_gimple_reg): Use it. Handle SSA_NAMEs properly. + * tree-simple.h: Adjust. + * gimplify.c (gimplify_expr) : Do nothing here. + + * gimplify.c (create_tmp_var): Set DECL_IGNORED_P. + + * tree-inline.c (initialize_inlined_parameters): Improve error + recovery. + + * gimplify.c (gimplify_boolean_expr): Just replace with a COND_EXPR. + +2003-08-25 Diego Novillo + + * tree-dfa.c (get_expr_operands): Don't create shared operands when + folding *&VAR expressions. + +2003-08-24 Diego Novillo + + * tree-flow.h (struct var_ann_d): Add field default_def. + (widen_bitfield): Declare. + (set_default_def): Declare. + (default_def): Declare. + * tree-flow-inline.h (set_default_def): New inline function. + (default_def): New inline function. + * tree-dfa.c (dump_variable): Display default_def, if set. + * tree-simple.c (is_gimple_reg): Check for DECL_P before checking + for DECL_EXTERNAL. + * tree-ssa-dom.c (add_expr_propagated_p): Remove. Update all + users. + (find_new_vars_to_rename): New local function. + (tree_ssa_dominator_optimize): Add new argument vars_to_rename. + Change return type to void. Update all users. + (optimize_block): Add new argument vars_to_rename. Update all + users. + If the call to optimize_stmt returns true, add the statement to the + list of statements to re-scan for operands. + After optimizing the block and its dominator children, call + find_new_vars_to_rename for every statement that may have had new + symbols exposed. + (optimize_stmt): Change return type to bool. Return true if the + statement may have had new symbols exposed by optimization. + Add a sanity check for the value returned by lookup_avail_expr. + Create equivalences for more memory stores, not just the ones done + via INDIRECT_REF expressions. + Call widen_bitfield when optimizing stores to bitfields. + (lookup_avail_expr): Reformat comment. + * tree-ssa.c (rewrite_into_ssa): Remove local variable + addr_expr_propagated_p. + Clear out vars_to_rename before running dominator optimizations. + (check_for_new_variables): Remove. + (rewrite_stmt): Always register new definitions and virtual + definitions. + (register_new_def): Update comment. + (get_reaching_def): Update the default_def field for the variable + if it didn't have a reaching definition. + * tree-ssa-ccp.c (widen_bitfield): Declare it extern. + +2003-08-23 Zdenek Dvorak + + * tree-cfg.c (bsi_next_in_bb): Work correctly when the block ends + with start of BIND_EXPR. + +2003-08-23 Daniel Berlin + + * tree-alias-ander.c (andersen_op_assign): Fix to join the operands, + the assign to the lhs. + +2003-08-23 Daniel Berlin + + * tree-alias-common.c (get_alias_var): Remove REFERENCE_EXPR. + (find_func_aliases): Fix some not quite right predicates, add ARRAY_REF + handling. + +2003-08-22 Jeff Law + + * tree-dfa.c (compute_alias_sets): A memory tag used for stores can + not conflict with objects marked TREE_READONLY. + + * tree-ssa-ccp.c (fold_stmt): Optimize reads from constant strings. + +2003-08-22 Jason Merrill + + * tree-simple.c: Total overhaul to only check forms and remove + unnecessary predicates. + (is_gimple_const): Accept function addresses here. + Don't accept LABEL_DECL or RESULT_DECL. + (is_gimple_val): Accept EXC_PTR_EXPR here. + (is_gimple_lvalue): Rename from is_gimple_modify_expr_lhs. + Accept BIT_FIELD_REF, REALPART_EXPR and IMAGPART_EXPR here. + (is_gimple_addr_expr_arg): Replace with former is_gimple_varname. + (is_gimple_constructor_elt): Just check for CONSTRUCTOR. + (is_gimple_initializer): Just hand off to is_gimple_rhs. + (is_gimple_rhs): Recognize most expressions here. + (is_gimple_variable): New fn. + (is_gimple_id): Use it. Now static. + (is_gimple_reg): New fn. + (is_gimple_cast): Replace with former is_gimple_cast_op. + (is_gimple_constructor, is_gimple_expr): Remove. + (is_gimple_modify_expr, is_gimple_relop): Remove. + (is_gimple_binary_expr, is_gimple_unary_expr): Remove. + (is_gimple_call_expr, is_gimple_arglist): Remove. + (is_gimple_compound_lval, is_gimple_arrayref): Remove. + (is_gimple_compref, is_gimple_exprseq): Remove. + (is_gimplifiable_builtin): Remove. + * tree-simple.h: Adjust. + * gimplify.c (gimplify_conversion): Break out from gimplify_expr. + (gimplify_expr): Use is_gimple_reg predicate to force a temp. + : Use gimplify_compound_lval. + : Likewise. + : Use is_gimple_reg predicate. + : Use new gimplify_minimax_expr. + : Reject. + (gimplify_tree_list, gimplify_component_ref): Remove. + (gimplify_compound_lval): Include REALPART_EXPR and IMAGPART_EXPR. + (gimplify_component_ref): Remove. + (gimplify_call_expr): Handle non-gimplifiable builtins and walking + the argument list here. + (gimplify_tree_list): Remove. + (gimplify_addr_expr): Use fb_either. + * tree-simple.h: Adjust. + * tree-alias-common.c (find_func_aliases): Update use of predicates. + +2003-08-21 Andrew Pinski + + * tree-ssa.c (tree_ssa_useless_type_conversion): Check also the + precision of the type to make sure they are really useless type + conversions. + +2003-08-21 Diego Novillo + + * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code classes. + +2003-08-21 Zdenek Dvorak + + * c-pretty-print.c (print_c_tree): Create new pp object. + +2003-08-21 Zdenek Dvorak + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Don't free hash tables + before statistics are made from them. + * tree-ssa.c (rewrite_into_ssa): Ditto. + +2003-08-21 Jason Merrill + + * tree-inline.c (copy_body_r): Don't convert when stripping &*. + Fix thinko in stripping *&. + +2003-08-21 Diego Novillo + Zdenek Dvorak + + * tree-cfg.c (stmt_starts_bb_p): Nonlocal and computed GOTO targets + always start a new block. + +2003-08-20 Jason Merrill + + * tree-pretty-print.c (dump_generic_node): Just print "" + for the RESULT_DECL. + + * c-simplify.c (make_type_writable, mostly_copy_tree_r): Remove. + (deep_copy_list, deep_copy_node): Remove. + + * expr.c (expand_expr): Don't check for 'r' or 's' if we're + checking IS_EXPR_CODE_CLASS. + * tree-dfa.c (may_access_global_mem_p): Likewise. + * tree-browser.c (browse_tree): Likewise. + * tree-ssa-pre.c (defs_hash_expr): Likewise. + * gimplify.c (gimplify_expr): Likewise. + (internal_get_tmp_var): Only copy TREE_LOCUS from an expr. + (mostly_copy_tree_r): Ignore decls here. + +2003-08-20 Diego Novillo + + * c-pretty-print.c: Discard. Replace with same file from + mainline. Update all users. + (print_c_tree): New function. + * c-pretty-print.h (print_c_tree): Declare. + * tree-pretty-print.c: Update to use new pp_* primitives. + * c-simplify.c: Include c-pretty-print.h. + * Makefile.in (c-simplify.o): Add dependency on $(C_PRETTY_PRINT_H). + +2003-08-20 Roger Sayle + + * c-common.h (enum c_tree_index): Delete CTI_SIGNED_SIZE_TYPE. + (signed_size_type_node): No longer a member of c_global_trees. + * tree.h (enum tree_index): New member TI_SIGNED_SIZE_TYPE here. + (signed_size_type_node): Moved, now a member of global_trees. + +2003-08-20 Zdenek Dvorak + + * tree-ssa-dom.c (optimize_block): Thread jump into empty + block correctly. + + * tree-cfg.c (linearize_cond_expr): Don't merge blocks if the + later has other predecessors. + +2003-08-19 Jason Merrill + + * c-typeck.c (build_array_ref): Also build ARRAY_REFs from + INDIRECT_REFs of ARRAY_TYPE. + + * tree-ssa.c (tree_ssa_useless_type_conversion): Also strip + conversions between pointer and reference types. + + * tree-dfa.c (get_stmt_operands): Just mark non-GIMPLE statements + as unmodified. + (find_referenced_vars): So we don't need to mark them here. + + * tree-inline.c (inline_data): Add retvar field. + (declare_return_variable): Set it. + (remap_decls): Use it. + (expand_call_inline): Tweak. + +2003-08-19 Zdenek Dvorak + + * cfg.c (dump_edge_info): Add name for EDGE_LOOP_EXIT flag. + +2003-08-19 Zdenek Dvorak + + * tree-flow.h (struct var_ann_d): New field scope. + (struct stmt_ann_d): New field scope. + (propagate_copy): Declaration changed. + (fixup_var_scope): Declare. + * tree-cfg.c (make_blocks, make_cond_expr_blocks, + make_catch_expr_blocks, make_eh_filter_expr_blocks, + make_try_expr_blocks, make_loop_expr_blocks, make_switch_expr_blocks, + make_bind_expr_blocks, build_tree_cfg): Assign variables and statements + to scopes. + (assign_vars_to_scope): New. + * tree-ssa-copyprop.c (move_var_to_scope): New. + (copyprop_stmt): Pass scope of statement to propagate_copy. + (propagate_copy): Assign variable to the right bind_expr. + (fixup_var_scope): New. + * tree-ssa-dom.c (optimize_stmt): Pass scope of statement to + propagate_copy. + +2003-08-19 Daniel Berlin + + * tree-cfg (bsi_move_after): New function. + (bsi_move_before): New function. + (bsi_move_to_bb_end): New function. + * tree-flow.h: Prototype new functions. + +2003-08-18 Daniel Berlin + + * tree-alias-ander.c: Remove doxygen markers. + (eq_to_var): remove. + (simple_cmp): Add. + (throwaway_global): Add. + (andersen_same_points_to_set): Handle ignoring global var aliasing the + right way here. + (andersen_may_alias): Use list_member to avoid stupid hack. + * tree-alias-common.c: Remove hacks for disabling global var aliasing. + +2003-08-17 Zdenek Dvorak + + * tree.c (resize_phi_node): Initialize new entries. + +2003-08-17 Jeff Law + + * tree-pretty-print.c (last_bb): Actually record the basic block, + not just its index. + (maybe_init_pretty_print): Corresponding changes. + (dump_generic_node, dump_vops): Test the actual block pointers, not + their indices. + + * tree-ssa-dom.c (optimize_block): Use equivalences from the + dominator tree walk to thread through conditional jumps at leafs in + the dominator tree. + + * tree-cfg.c (blocks_unreachable_p, remove_blocks): Use a bitmap + rather than a varray. + (REMOVE_ALL_STMTS, REMOVE_NO_STMTS): New defines for remove_bb. + (REMOVE_NON_CONTROL_STMTS, REMOVE_CONTROL_STMTS): Likewise. + (remove_unreachable_block): Use find_contained_blocks rather + than find_subblocks. If we have a COND_EXPR or SWITCH_EXPR which + is unreachable, but which has reachable children clear out the + condition and request all non-control statements be removed + from the block. + (remove_bb): Allow better control over what (if any) statements + are removed. All callers updated. + (find_subblocks): Remove. + (find_contained_blocks): Handle statements with no associated + basic block. + +2003-08-15 Andrew Pinski + + * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Define + as the c gimplifier. + +2003-08-15 Jeff Law + + * tree-cfg.c (cleanup_tree_cfg): Wipe out the dominator tree + if the number of basic blocks changes as a result of cfg cleanups. + * tree-flow.h (build_dominator_tree): Prototype. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Build the dominator + tree if it is not already available. + * tree-ssa.c (build_dominator_tree): New function. + (rewrite_into_ssa): Use it. + + * gimplify.c (gimplify_expr, cases NOP_EXPR, CONVERT_EXPR): If a + COMPONENT_REF is wrapped with a NOP_EXPR, then force the type of + the COMPONENT_REF to match the accessed field. Strip away + unnecessary type conversions and handle the case where all type + conversions were removed. + (case ARRAY_REF, COMPONENT_REF): Indicate to gimplify_array_ref + and gimplify_component_ref if we want an lvalue or not. + (gimplify_array_ref, gimplify_component_ref): Pass new argument + WANT_LVALUE through to gimplify_compound_lval. + (gimplify_compound_lval): If we do not want an lvalue and the + toplevel COMPONENT_REF's type does not match its field's type, + then wrap the COMPONENT_REF in a NOP_EXPR and force the + COMPONENT_REF's type to match its field's type. + (gimplify_modify_expr): If the RHS is a CALL_EXPR and the LHS + is not a gimple temporary, then force the RHS through a gimple + temporary, even if the call can not throw. + (create_tmp_var): Make sure not to lose the type's attributes + for the new variable. + * tree-ssa.c (tree_ssa_useless_type_conversion): New function. + * tree-flow.h (tree_ssa_useless_type_conversion): Prototype. + * tree-ssa-dom.c (optimize_stmt): Use tree_ssa_useless_type_conversion. + + * tree-cfg.c (remove_useless_stmts_and_vars): Catch more + useless statements created during the out-of-ssa pass. + +2003-08-14 Jeff Law + + * tree-ssa-dom.c (optimize_block): Record equivalences created by + SWITCH_EXPRs. + + * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of + a RETURN_EXPR which contains an optimizable MODIFY_EXPR. + (lookup_avail_expr): Corresponding changes. + (avail_expr_hash, avail_expr_eq): Likewise. + + * tree-ssa-dom.c (optimize_stmt): Fix typo which prevented + stores with more than one VDEF from creating useful equivalences. + + * tree-dfa.c (get_expr_operands): Do not special case *0; + + * fold-const.c (fold, case INDIRECT_REF): Revert last change. + +2003-08-14 Diego Novillo + + * tree-cfg.c (bsi_insert_on_edge_immediate): Only update the + container for the head tree of the next block if the new statement + needs to be linked to it. + +2003-08-13 Jeff Law + + * fold-const.c (fold, case INDIRECT_REF): Optimize reads from + constant strings. + + * tree-cfg.c (remove_useless_stmts_and_vars): For a COND_EXPR + where the condition is a variable and the ELSE clause merely + sets that variable to zero, remove the ELSE clause. + + * tree-ssa-dom.c (optimize_stmt): Do not check the type of the + value returned by lookup_avail_expr. + +2003-08-13 Daniel Berlin + + * tree-cfg.c (remove_stmt): Add new argument saying whether to remove + annotations and invalidate defs. Update all callers + (remove_bsi_from_block): Moved from bsi_remove, argument added. + (bsi_remove): Made into wrapper for remove_bsi_from_block. + +2003-08-13 Zdenek Dvorak + + * tree-ssa-dom.c (optimize_stmt): Call get_stmt_operands. + +2003-08-12 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Record equivalences created + by memory stores. + +2003-08-12 Diego Novillo + + * tree-cfg.c (find_insert_location): Handle other control + statements that may be at the end of the block. + +2003-08-12 Zdenek Dvorak + + * Makefile.in (tree-pretty-print.o): Add tree-iterator.h dependency. + * tree-pretty-print.c: Include tree-iterator.h. + (dump_generic_node): Avoid recursing into COMPOUND_EXPRs. + +2003-08-12 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Optimize ABS_EXPR when we know + the sign of the source operand. + + * tree-ssa-dom.c (optimize_stmt): Rewrite TRUNC_DIV_EXPR and + TRUNC_MOD_EXPR even if the LHS is not an SSA variable. Do not + enter the new expression in the hash tables if !may_optimize_p. + Also try GE_EXPR to see if this transformation is safe. + + * tree-ssa-dom.c (optimize_stmt): Fix typo in last change which + prevented recording equivalences created by IOR_EXPR. + + * tree-ssa-dom.c (optimize_stmt): Record that the destination of + a MODIFY_EXPR nonzero if the RHS contains an IOR with a nonzero + constant. Turn DIV/MOD by a power of 2 into SHIFT/AND if we know + dividend is positive. + +2003-08-11 Jeff Law + + * fold-const.c (fold, cases NE_EXPR and EQ_EXPR): Fold equality + comparisons of non-weak symbol addresses against zero. + + * tree-ssa-ccp.c (fold_stmt): Strip unnecessary NOP_EXPRs from + the folded result. + + * gimplify.c (gimplify_expr, case INDIRECT_REF): Copy the base + object into a temporary if it's in static memory or is addressable. + +2003-08-11 Steven Bosscher + + * tree-alias-common.h (struct tree_alias_ops): Add a semicolon, fix + bootstrap. + +2003-08-10 Daniel Berlin + + * tree-dfa.c (compute_may_aliases): Move points-to initialization from + here. + (find_referenced_vars): To here. + (get_memory_tag_for): Use new same_points_to_set function. + + * tree-alias-common.h (struct tree_alias_ops): Remove doxygen markers. + Add same_points_to_set function to struct. + (same_points_to_set): New function. + + * tree-alias-common.c (we_created_global_var): A bit of magic to ignore + global var aliasing when we didn't create global var. This will go + away soon + (same_points_to_set): New function. + + * tree-alias-andersen.c (struct andersen_alias_ops): Add + andersen_same_points_to_set. + (andersen_same_points_to_set): New function. Return true if the two + variables have the same points-to set. + + * opts.c (common_handle_option): Add "none" as a points-to option. + +2003-08-10 Paul Brook + + * doc/install.texi: Mention --enable-languages=f95. + +2003-08-09 Daniel Berlin + + * tree-pretty-print.c (dump_vops): check bb->tree_annotations, not + bb->aux. + +2003-08-08 Daniel Berlin + + * tree-cfg.c (bsi_insert_on_edge_immediate): If there's only + one statement in the block, and it's an empty statement, replace it. + +2003-08-08 Jason Merrill + + * c-decl.c (c_expand_body_1): Restore support for + !keep_function_tree_in_gimple_form. + (finish_function, c_expand_deferred_function): Do TDI_inlined dump. + + * gimplify.c (voidify_wrapper_expr): Set TREE_SIDE_EFFECTS on the + wrapper if we insert a MODIFY_EXPR. + +2003-08-07 Diego Novillo + + * Makefile.in (GTFILES): Add tree-ssa.c, tree-dfa.c and + tree-ssa-ccp.c. + (gt-tree-ssa.h, gt-tree-dfa.h, gt-tree-ssa-ccp.h): Depend on + s-gtype. + * tree-dfa.c (struct clobber_data_d): Remove. Update all users. + (struct alias_map_d): Mark for garbage collection. + (struct walk_state): Add fields 'is_not_gimple' and + 'is_va_arg_expr'. + (clobber_vars_r): Remove. Update all users. + (get_stmt_operands): Abort if attempting to get operands from a + non-GIMPLE statement. + (get_expr_operands): Likewise. + Do not force a virtual operand when scanning VA_ARG_EXPR. + (add_stmt_operand): If the variable has hidden uses, mark the + statement as having volatile operands and return. + If the variable occurs inside a VA_ARG_EXPR, add it as a virtual + operand. + (add_immediate_use): Call VARRAY_TREE_INIT instead of + VARRAY_GENERIC_PTR_INIT. + (dump_variable): Check is_in_va_arg_expr flag. + (compute_may_aliases): Move code to find variables ... + (find_referenced_vars): ... here. + (find_vars_r): Abort if we find a non-GIMPLE expression + unexpectedly. + Mark variables found inside a VA_ARG_EXPR. + Do not scan arguments for non-GIMPLE CALL_EXPRs. + Remove local variable saved_is_store. + Reformat some code for readability. + (add_referenced_var): If the variable is already marked as having + hidden uses, ignore it. + If the variable is found inside a non-GIMPLE expression, mark it. + If the variable is found inside a VA_ARG_EXPR, mark it. + + * tree-flow.h (struct var_ann_d): Add field is_in_va_arg_expr. + (find_referenced_vars): Declare. + * tree-optimize.c (optimize_function_tree): Call + find_referenced_vars before computing may aliases. + + * tree-ssa-dce.c (need_to_preserve_store): Do not check if the + variable has hidden uses. + * tree-ssa-live.c (type_var_init): Likewise. + + * tree-ssa-ccp.c (ssa_edges): Mark for garbage collection. + (tree_ssa_ccp): Use VARRAY_.*_EDGE calls to manipulate the varray + of CFG edges. + (add_control_edge): Likewise. + (initialize): Likewise. + * tree-ssa.c (struct def_blocks_d): Mark for garbage collection. + (struct var_value_d): Likewise. + (def_blocks_free): Remove. Update all users. + (rewrite_into_ssa): Do not specify free function when creating + def_blocks and currdefs. + Call sbitmap_free instead of free. + (mark_def_sites): Call sbitmap_free instead of free. + (set_def_block): Use GC allocation. + (set_livein_block): Likewise. + (insert_phi_nodes): Adjust name of varray def_maps when creating it. + (insert_phis_for_deferred_variables): Remove call to BITMAP_XFREE. + (insert_phi_nodes_for): Use GC allocation for phi_insertion_points. + (init_tree_ssa): Remove typecast in call to memset. + (set_value_for): Use GC allocation. + (get_def_blocks_for): Remove typecast in call to htab_find. + * varray.c (element): Add entry for struct edge_def *. + * varray.h (enum varray_data_enum): Add VARRAY_DATA_EDGE. + (union varray_data_tag): Add field of type struct edge_def *. + (VARRAY_EDGE_INIT): Define. + (VARRAY_EDGE): Define. + (VARRAY_PUSH_EDGE): Define. + (VARRAY_TOP_EDGE): Define. + +2003-08-06 Diego Novillo + + * tree-cfg.c (handle_switch_fallthru): Do not abort when the last + statement of the case block needs to be the last statement of the + block. + (find_insert_location): Fix typo. + +2003-08-06 Steven Bosscher + + * tree-dfa.c (remove_phi_arg): When the PHI no longer has + arguments, don't remove it here, but do so... + (remove_phi_arg_num): ...from here. + +2003-08-05 Jason Merrill + + * gimplify.c (gimplify_cond_expr): Gimplify shortcut expansion in + a conditional context. + + * tree-cfg.c (make_catch_expr_blocks): Don't change next_block_link. + (make_eh_filter_expr_blocks): Likewise. + + * tree-dfa.c (add_referenced_var): Static locals are call + clobbered. + +2003-08-05 Steven Bosscher + + * tree-dfa.c (add_phi_arg): Allow PHI capacity to grow. + * tree-flow.h (add_phi_arg): Adjust prototype. + * tree-ssa-pre.c (code_motion): Adjust call. + * tree-ssa.c (rewrite_block): Likewise. + * tree.c (resize_phi_node): New function. + * tree.h (resize_phi_node): Add prototype. + +2003-08-05 Jeff Law + + * tree-ssa-dom.c (optimize_block): Be more aggressive about + creating equivalences from PHI nodes. + + * tree-ssa-dom.c (optimize_stmt): Strip away certain NOP_EXPRs + before determining if we have an equivalence to enter into + the const_and_copies table. + + * tree-ssa-dce.c (remove_dead_stmts): Iterate backwards through the + basic blocks removing dead statements. Within each block iterate + backwards through the statements removing those which are dead. + + * tree-ssa-optimize.c (optimize_function_tree): Call + remove_useless_stmts_and_vars before building the flow graph. + * tree-cfg.c (remove_useless_stmts_and_vars): Rename argument from + first_iteration to remove_unused_vars. + + * tree-cfg.c (remove_unreachable_blocks): Remove blocks in reverse + order. + (remove_bb): Remove unwanted call to bsi_next. + (bsi_remove): Refine code which removes useless COMPOUND_EXPRs to allow + removal if one of the arms is not associated with a basic block. + (remove_stmt): Improve check for testing when a basic block head/end + pointer needs to be updated when removing a COMPOUND_EXPR. + + * tree-cfg.c (phi_alternatives_equal): New function. + (linearize_cond_expr): Allow linearization if the PHI nodes at the + target have equivalent arguments for the incoming edges from the THEN + and ELSE clauses. + + * tree-ssa-dce.c (mark_tree_necessary): Empty statements may be + necessary. + (process_worklist): Handle any incoming abnormal edges the first + time a statement in each block becomes executable. + + * tree-ssa-ccp.c (substitute_and_fold): Substitute known + constants into PHI nodes. + +2003-08-04 Sebastian Pop + + * basic-block.h: Declare bb_ann_d. + (basic_block_def): Add a field tree_annotations. + * cfg.c (entry_exit_blocks): Initialize tree_annotations to NULL. + * cfghooks.c: Remove the definition of cfg_level. + (rtl_register_cfg_hooks): Remove the initiallization of cfg_level. + * cfghooks.h (cfg_hooks): Add cfgh_loop_optimizer_init, and + cfgh_loop_optimizer_finalize. + (loop_optimizer_init, loop_optimizer_finalize): New macros. + (cfg_level): Remove. + * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Rename + to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize. + * cfgrtl.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize): + Declare, and register them in rtl_cfg_hooks and cfg_layout_rtl_cfg_hook. + * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Rename + to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize. Remove + the checks to cfg_level. + * tree-cfg.c (block_tree_ann_obstack, first_block_tree_ann_obj): New. + (create_blocks_annotations, create_block_annotation, + free_blocks_annotations, clear_blocks_annotations): New functions. + (tree_loop_optimizer_init, tree_loop_optimizer_finalize): New + functions. Register them in tree_cfg_hooks. + (build_tree_cfg, dump_tree_bb, delete_tree_cfg, tree_split_edge): Use + create_blocks_annotations instead of alloc_aux_for_blocks, + create_block_annotation instead of alloc_aux_for_block, + .tree_annotations instead of .aux, + free_blocks_annotations instead of free_aux_for_blocks. + (tree_register_cfg_hooks): Remove initialization of cfg_level. + * tree-flow-inline.h (bb_ann): Use .tree_annotations. + * tree-flow.h: Update comment. + +2003-08-04 Zdenek Dvorak + + * Makefile.in (c-pretty-print.o): Add TREE_H and C_TREE_H dependencies. + +2003-08-01 Paul Brook + + * Makefile.in (GMPINC): Set and use. + (GMPLIBS): Set it. + * configure.in: Add test and switches for the GMP library. + (all_need_gmp): Set from config-lang.in. + * sourcebuild.texi: Document need_gmp. + * configure: regen + +2003-08-01 Steven Bosscher + + * tree-inline.c (expand_calls_inline): Fix comments. + +2003-07-31 Diego Novillo + + * Makefile.in (tree-ssa-ccp.o): Depend on $(EXPR_H). + * builtins.c (c_strlen): Remove static declaration. + (simplify_builtin_fputs): Remove static declaration. + (simplify_builtin_sprintf): New local function. + (expand_builtin_sprintf): Remove by surrounding with #if 0. + (expand_builtin): Add BUILT_IN_SPRINTF to the list of built-ins + handed over to simplify_builtin. + (validate_arglist): Do not allow arguments with TREE_SIDE_EFFECTS. + (simplify_builtin_fputs): Add new argument KNOWN_LEN. If it's set, + use it instead of trying to compute the length of the string. + Update all callers. + * expr.h (simplify_builtin_fputs): Declare. + * tree-flow.h (fold_stmt): Change argument type to tree *. Update + all users. + * tree-ssa-ccp.c: Include expr.h. + (replace_uses_in): If the statement makes a call to some selected + built-ins, mark it for folding. + (get_strlen): New local function. + (ccp_fold_builtin): New local function. + (fold_stmt): Call it. + (set_rhs): Fix if-else-if chaining. Handle cases where the whole + statement needs to be replaced. + * tree.h (c_strlen): Declare. + +2003-07-31 Diego Novillo + + Fix PR optimization/11373 + * tree-ssa-dce.c (stmt_useful_p): Get statement operands before + checking for volatile operands. + * tree-dfa.c (get_expr_operands): If a constant is dereferenced as a + pointer, mark the statement as having volatile operands. + (may_access_global_mem_p): If a non-NULL constant is used as a + pointer, consider it as pointing to global memory. + * tree-ssa-dom.c (optimize_stmt): Set addr_expr_propagated_p when + propagating pointers that are integer constants. + +2003-07-31 Andrew MacLeod + + * tree-dfa.c (add_stmt_operand): Don't treat complex types as scalars. + * tree-ssa-live.c (var_union): Change comment. + (coalesce_tpa_members): Don't proceed if var_union fails. + * tree-ssa.c (insert_copy_on_edge): Change comment. + (coalesce_abnormal_edges): Handle var_union failing. + (coalesce_vars): Skip constant PHI arguments. + +2003-07-30 Jeff Law + + * tree-cfg.c (bsi_remove): Don't remove a COMPOUND_EXPR with empty + arms if the arms are in different basic blocks. + + * tree-ssa-dom.c (record_cond_is_false): New function. + (record_cond_is_true): Similarly. + (get_eq_expr_value): Use record_cond_expr_is_{true,false}. + (optimize_stmt): Fix minor formatting issue. If we encounter an + INDIRECT_REF, record that the dereferenced pointer can not be + null. + +2003-07-30 Daniel Berlin + + * tree-dump.c (dump_option_value_in): "all" is now everything but + TDF_RAW and TDF_SLIM. + +2003-07-30 Diego Novillo + + * tree-simple.c (is_gimple_const): Accept CONST + CONST expressions + as GIMPLE constants. + +2003-07-30 Daniel Berlin + + * tree-ssa-pre.c: #include real.h + (defs_match_p): Change arguments to something normal now that we use + the new renaming algorithm. Update all callers. + Use defs_hash_expr. + (defs_y_dom_x): Ditto. + (defs_hash_expr): New. Based on iterative_hash_expr. + (generate_exr_as_of_bb): If there aren't any uses, return. + (subst_phis): Call modify_stmt on the actually modified statement. :) + (get_default_def): Only walk SSA_NAME arguments in PHI's. + +2003-07-30 Jason Merrill + + Don't modify code that is already GIMPLE. + * gimplify.c (gimplify_expr): Don't return early if the predicate + matches. + Use a variable temp if the caller wants an lvalue. + Don't call gimplify_constructor if we're on the rhs of a MODIFY_EXPR. + (add_tree, add_stmt_to_compound): Do add an empty stmt if we + previously had nothing at all. + (gimplify_return_expr): Don't mess with iterators if it was already + gimple. + (gimplify_cond_expr): Remove a COND_EXPR with two empty arms. + (gimplify_call_expr): Try to simplify a builtin again after + gimplifying the args. + (internal_get_tmp_var): Gimplify the new MODIFY_EXPR. + (gimplify_expr, gimple_push_cleanup): Use boolean_false_node. + (gimplify_init_constructor): New fn, broken out from... + (gimplify_modify_expr): ...here. Be smarter about zero-initialization. + * tree-simple.c (is_gimple_rhs): Accept any CONSTRUCTOR. + * tree-simple.h: Adjust add_tree prototype. + +2003-07-29 Daniel Berlin + + * tree-alias-common.c (create_alias_vars): If we created global_var, + delete it when we are done. + (ptr_may_alias_var): Handle case that global_var is now NULL_TREE. + +2003-07-29 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Propagate copies into VUSEs and + the RHS of VDEFs. + +2003-07-29 Andrew MacLeod + + * tree-ssa.c (insert_copy_on_edge): Only set used bit on DECL nodes. + +2003-07-29 Andrew MacLeod + + * common.opt (ftree-combine-temps): Add new option. + * flags.h (flag_tree_combine_temps): New flag. + * opts.c (decode_options): Initialize flag_tree_combine_temps. + (common_handle_option): Handle new flag. + * toplev.c (flag_tree_combine_temps): Declare. + (lang_independent_options f): Add tree-combine-temp. + * tree-ssa-live.c (var_union): When combining 2 root variables, choose + the user variable over a temporary as the new variable. + (compact_var_map): Use renamed root_var routines. + (calculate_live_on_exit): Reformatting. + (tpa_init): Initialize a tpa object. + (tpa_remove_partition): Remove a partition from a tpa list. + (tpa_delete): Delete a tpa object. + (tpa_compact): Hide single elemenet lists. + (root_var_init): Split common part into tpa_init and rename. + (remove_root_var_partition, delete_root_va, dump_root_var): Delete. + (type_var_init): New. Initialize a type_var object. + (create_coalesce_list): New. Create a coalesce_list object. + (delete_coalesce_list): New. Free a coalesce list's memory. + (find_partition_pair): New. Find a coalesce pair in a coalesce list. + (add_coalesce): New. Add a coalesce between 2 partitions. + (sort_coalesce_list): New. Sort coalesce pairs by importance. + (pop_best_coalesce): New. Get best remaining pair to coalesce. + (add_conflicts_if_valid): Move from tree-ssa.c. + (build_tree_conflict_graph): Move from coalesce_ssa_name in tree-ssa.c. + Genericize to use tpa_p instead of root_var object. Don't add + interferences between copies. Update coalesce list. + (coalesce_tpa_members): Move from coalesce_ssa_name in tree-ssa.c. Use + tpa_p instead of root_var. Use coalesce list if provided. + (dump_coalesce_list): New. Show debug info for a coalesce list. + (tpa_dump): Rename from dump_root_var and genericize to use tpa_p. + * tree-ssa-live.h (root_var_p): Rename structure type to tpa_p + (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, + tpa_find_tree): New. Generic versions of existing root_var routines. + (tpa_decompact): New. Include single version lists. + (root_var_p): Declare as type tpa_p. + (root_var_num, root_var, root_var_first_partition, + root_var_next_partition, root_var_dump, root_var_delete, + root_var_remove_partition, root_var_find , root_var_compac, + root_var_decompac): Rename and call generic versions. + (type_var_p): New. Use tpa_p structure for a type based association. + (type_var_num, type_var, type_var_first_partition, + type_var_next_partition, type_var_dump, type_var_delete, + type_var_remove_partition, type_var_find, type_var_compact, + type_var_decompact): New. Call generic versions of the routine. + (struct partition_pair_d): New. Represent a desired coalesce. + (struct coalesce_list_d): New. Organize lists of desired coalesces. + (NO_BEST_COALESCE): Define value. + * tree-ssa.c (set_if_valid): Remove. + (insert_copy_on_edge): Set variable as used when inserting a copy. + (add_conflicts_if_valid): Remove. Move to tree-ssa-live.c. + (print_exprs): New. Routine for commonly used output format. + (coalesce_abnormal_edges): New. Split from coalece_ssa_name. Force + partition coalesces across abnormal edges. + (coalesce_ssa_name): Split out build_tree_conflict_graph, + coalesce_abnormal_edges, and coalesce_tpa_members. Return live + range info if required. Use renamed root_var routines. + (assign_vars): Use renamed root_var routines. + (replace_variable): Mark as inline. + (coalesce_vars): Coalesce variable memory storage. + (rewrite_out_of_ssa): Don't compact varmap anymore. Free live range + info if required. Call coalesce_vars if combining temps. + +2003-07-29 Andrew MacLeod + + * tree-cfg.c (handle_switch_fallthru): Use bsi_link_after if stmt is + in a basic block. + +2003-07-28 Diego Novillo + + * opts.c (decode_options): Disable must-alias optimization. + +2003-07-28 Andrew MacLeod + + * tree-ssa.c (struct _elim_graph): Add varray for constant copies. + (new_elim_graph): Initialize constant copy array.. + (eliminate_build): Push constant copies onto stack instead of emitting. + (eliminate_phi): Emit any pending constant copies. + +2003-07-28 Jeff Law + + * tree-ssa-dom.c (optimize_block): If a PHI has a single argument + that is a constant, then that creates a useful equivalence. + Propagate constant values into PHI nodes. + + * tree-flow-inline.h (may_propagate_copy): Allow RHS to be a + constant. + + * tree-dfa.c (compute_immediate_uses_for): Do not assume that + PHI arguments are SSA_NAMEs. + * tree-ssa-dce.c (process_worklist): Likewise. + * tree-ssa-copyprop.c (copyprop_phi): Likewise. Use may_propagate_copy. + * tree-ssa-ccp.c (visit_phi_node): Do not assume that PHI arguments + are SSA_NAMEs. Create a suitable value if a PHI argument is a + constant. + + * tree-cfg.c (move_outgoing_edges): Correctly handle case where + an edge already exists from BB1 to BB2's successor. + +2003-07-27 Daniel Berlin + + * tree.h (EREF_TEMP): Rename to EPHI_TEMP. + (tree_eref_common): Move temp to tree_ephi_node. + * tree-ssa-pre.c: Remove #if 0'd code. + Use EPHI_TEMP rather than EREF_TEMP, remove EREF_TEMP on EUSE nodes. + (finalize_1): Handle empty blocks properly. + +2003-07-27 Andreas Jaeger + + * tree.c: Convert remaining K&R prototypes to ISO C90. + * tree-dump.c: Likewise. + * tree-inline.c: Likewise. + * stmt.c (expand_asm_expr): Likewise. + + * diagnostic.h: Remove PARAMS. + +2003-07-26 Paul Brook + + * Makefile.in: Rename check-g95 to check-gfortran. + * gcc.c (default_compilers): Add entries for .f90 and .f95. + * doc/frontends.texi: Document new F95 front end. + * doc/install.texi: Ditto. + * doc/invoke.texi: Ditto. + * doc/sourcebuild.texi: Ditto. + * fortran: New front end. + +2003-07-25 Jeff law + + * tree-ssa-dom.c (optimize_block): Use may_propagate_copy. + +2003-07-25 Diego Novillo + + * opts.c (decode_options): Re-enable must-alias optimizations. + +2003-07-25 Daniel Berlin + + * configure.in: Update BANSHEEREBUILD for PWD change. + * configure: regen + +2003-07-25 Andreas Jaeger + + * c-call-graph.c: Convert to ISO C90. + * c-common.c: Likewise. + * c-mudflap.c: Likewise. + * c-pretty-print.c: Likewise. + * cfganal.c (find_edge): Likewise. + * dependence.c: Likewise. + * diagnostic.c (debug_output_buffer): Likewise. + * except.c (expand_eh_handler): Likewise. + * fold-const.c: Likewise. + * langhooks.c: Likewise. + * tree-cfg.c (last_exec_block): Likewise. + * tree-ssa-pre.c: Likewise. + * builtins.c: Likewise. + + * tree.h: Remove remaining PARAMS. + * c-common.h: Likewise. + * c-pretty-print.h: Likewise + * c-tree.h: Likewise. + * except.h: Likewise. + * langhooks-def.h: Likewise. + * langhooks.h: Likewise. + +2003-07-24 Diego Novillo + + * tree-dfa.c (cleanup_operand_arrays): New local function. Remove + superfluous VUSE operands. + (get_stmt_operands): Call it. + +2003-07-24 Jason Merrill + + * gimplify.c (gimple_boolify): New fn. + (gimplify_expr) : Boolify arg. + (gimplify_cond_expr): Boolify condition. + (gimplify_boolean_expr): Boolify args. + (gimple_push_cleanup): Make flag boolean. + + * tree-simple.c (is_gimple_relop): TRUTH_{AND,OR,XOR}_EXPR + are not comparisons. + (is_gimple_binary_expr): They are binary ops. + + * tree-mudflap.c (mf_build_check_statement_for): Use TRUTH_OR_EXPR + rather than BIT_IOR_EXPR. + +2003-07-23 Jason Merrill + Diego Novillo + + * c-common.h (DECL_C_HARD_REGISTER): Replace ... + * tree.h (DECL_HARD_REGISTER): ... with this. Update all users. + +2003-07-23 Diego Novillo + + * tree-flow-inline.h (may_propagate_copy): New function. + * tree-flow.h (may_propagate_copy): Declare. + * tree-ssa-copyprop.c (copyprop_stmt): Call it. + (get_original): Likewise. + * tree-ssa-dom.c (optimize_stmt): Likewise. + +2003-07-23 Frank Ch. Eigler + + * gcc.c (MFWRAP_SPEC): Also wrap pthread_join and pthread_exit. + +2003-07-23 Steven Bosscher + + * tree-flow-inline.h (remove_dom_child): New function. + (clear_dom_children): New function. + * tree-cfg.c (bsi_insert_on_edge_immediate): Do not clear + the annotation for the new bb, it is already memset to zero + in alloc_aux_for_block(). + (move_outgoing_edges): Use dom_children() instead of looking + at the dom_children field in the basic block annotation. + * tree-ssa.c (rewrite_into_ssa): Use clear_dom_children(). + + * tree-cfg.c (dump_tree_cfg): Dump to `file', not `dump_file'. + +2003-07-23 Diego Novillo + + * tree.h (DECL_ESTIMATED_INSNS): Move from c-common.h. + +2003-07-23 Steven Bosscher + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Make + found_unreachable a bool. Create/delete hash tables for + copies and available exprs outside the main loop. Use + htab_clean to wipe them after each iteration. + +2003-07-22 Diego Novillo + + * opts.c (decode_options): Add temporary test for environment + variable TREE_SSA_DO_PRE. + Do not disable dominator optimizations when PRE is enabled. + +2003-07-22 Daniel Berlin + + * tree-ssa-pre.c (finalize_1): Change to not use bsi_last. + +2003-07-22 Daniel Berlin + + * tree-cfg.c (remove_stmt): Revert 07-15 change. Turns out the bug is in + the reverse iterator. + +2003-07-22 Diego Novillo + + * tree-ssa-ccp.c (visit_phi_node): Assume default value of CONSTANT + if the PHI value was already constant. + +2003-07-22 Andrew MacLeod + + * c-pretty-print.c (print_call_name): Handle COND_EXPR correctly. + * tree-pretty-print.c (print_call_name): Handle COND_EXPR correctly and + handle SSA_NAME. + * tree-dfa.c (add_phi_arg, remove_phi_arg_num): Remove references to + SSA_NAME_HAS_REAL_REFS. + * tree-ssa-ccp.c (visit_phi_node): Remove SSA_NAME_HAS_REAL_REFS. + * tree-ssa-copyprop.c (copyprop_phi): Remove SSA_NAME_HAS_REAL_REFS. + * tree-ssa-live.c (register_ssa_partition): Register the PHI and it's + arguments if this variable is defined by a PHI. + (create_ssa_var_map): Only register real uses and defs, and virtual + operands of ASM_EXPR's. Remove SSA_NAME_HAS_REAL_REFS. Don't set + used flag on variables here. + (calculate_live_on_entry): Ignore constants in PHI arguments. + (calculate_live_on_exit): Ignore constants in PHI arguments. + (dump_live_info): New. Dump live range information. + * tree-ssa-live.h (dump_live_info): New prototype and flags. + * tree-ssa-pre.c (create_expr_ref, finalize_1, repair_use_injury, + code_motion): Remove SSA_NAME_HAS_REAL_REFS. + * tree-ssa.c (rewrite_operand, register_new_def): Remove real_ref + parameter and SSA_NAME_HAS_REAL_REFS. + (rewrite_block): Remove real_ref parameter from register_new_def call. + (eliminate_build): Remove SSA_NAME_HAS_REAL_REFS. Insert copy if PHI + argument is a constant. Handle irregular PHI argument ordering. + (elim_create): Remove dead code to count PHI nodes. + (assign_vars): Set used flag on variables when assigned. + (replace_variable): Eliminate dead code. + (coalesce_ssa_name): Remove SSA_NAME_HAS_REAL_REFS. Print error for + constant argument across an abnormal edge. + (eliminate_extraneous_phis): New. Remove PHI nodes which are not in + the partition. + (rewrite_out_of_ssa): Call eliminate_extraneous_phis. + (rewrite_stmt): Remove real_ref parameter from rewrite_operand and + register_new_def. + * tree.h (SSA_NAME_HAS_REAL_REFS): Remove. + (struct tree_ssa_name): Remove 'has_real_refs' field. + +2003-07-22 Daniel Berlin + + * tree-ssa-pre.c (factor_through_injuries): Take new argument specifying + whether use was injured or not (needed for SR). Update all callers. + (maybe_find_rhs_use_for_var): Take new argument specifying which + operand to start search with. Update all callers. + (phi_opnd_from_res): #if 0 out. + (rename_2): Ditto. + (rename_1): Ditto. + (defs_match_p): Take new arguments specifying which defs were injured. + Update all callers. + (defs_y_dom_x): Ditto. + (generate_expr_as_of_bb): Fix small memory overwrite. + (process_delayed_rename): Propagate injured flag around. + (new_rename_1): Ditto. + (finalize_1): Get correct variable names for newly created statement if + necessary due to PHI. + (repair_use_injury): Note the repair in the stats. Insert repair + in right place. + (repair_euse_injury): Fix handling of PHI_NODE. + (code_motion): Fix algorithm so it can handle using reaching_def all the + time (needed for SR). + Use reaching_def rather than EREF_TEMP. + +2003-07-21 Diego Novillo + + * tree-dfa.c (get_stmt_operands): Remove FIXME note + regarding virtual operands for ASM_EXPRs. + +2003-07-21 Diego Novillo + + * tree-dfa.c (add_def): Renamed from set_def. Update all users. + (get_stmt_operands): Don't force ASM_EXPR operands to be virtual. + (add_stmt_operand): Allow non-assignments to create new defs. + * tree-dump.c (dump_function): Move header dump... + (dump_function_to_file): ... here. + * tree-flow-inline.h (def_ops): Renamed from def_op. Return a + varray with all the definitions made by the statement. + Update all users. + * tree-flow.h (struct operands_d): Rename field 'def_op' to + 'def_ops'. Convert it into a varray. + * tree-must-alias.c (tree_compute_must_alias): Call + dump_function_to_file instead of dump_function. + * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. + (visit_stmt): Only visit statements that make new definitions using + MODIFY_EXPR. + Definitions coming from other statements are considered VARYING. + * tree-ssa-copyprop.c (tree_ssa_copyprop): Call + dump_function_to_file instead of dump_function. + * tree-ssa-dce.c (tree_ssa_dce): Likewise. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise. + (optimize_stmt): Don't abort if a statement makes more than one + definition. + Check for MODIFY_EXPR statements directly, instead of relying on + the presence of a single definition. + * tree-ssa-pre.c (tree_perform_ssapre): Call dump_function_to_file + instead of dump_function. + * tree-ssa.c (rewrite_into_ssa): Likewise. + Dump the function before dominator optimizations if TDF_DETAILS is + set. + (rewrite_stmt): Don't abort if the statement makes more than one + definition. + +2003-07-21 Jeff Law + + * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we made any + blocks unreachable, repeat the dominator optimizations. + (optimize_block): Enter PHIs with a single source argument into + the const_and_copies table. When propagating into a PHI node, + break the loop over the PHI arguments when a propagation is performed. + If the PHI agument is not an SSA_VAR, then no propagation is possible. + (optimize_stmt): If an operand is not an SSA_VAR, then no propagation + is possible/needed. + +2003-07-21 Diego Novillo + + * Makefile.in (tree-ssa-dom.o): Add dependency on $(TREE_DUMP_H). + * fold-const.c (fold): Remove unusued local variable 'invert'. + * tree-dump.c (dump_files): Add entry for -fdump-tree-dom. + * tree-flow.h (tree_ssa_dominator_optimize): Change declaration to + accept a function decl. + * tree-ssa-dom.c: Include timevar.h and tree-dump.h. + (tree_ssa_dominator_optimize): Change to receive the function decl + for the function to optimize. Update callers. + Use own dump file instead of dumping on the .ssa dump file. + Dump function at the end. + Push and pop TV_TREE_SSA_DOMINATOR_OPTS. + * tree-ssa.c (rewrite_into_ssa): Restore check for number of times + that the rename loop has been executed. Abort if the loop executes + more than twice. + * tree.h (enum tree_dump_index): Add TDI_dom. + * doc/invoke.texi: Document -fdump-tree-dom. + +2003-07-21 Steven Bosscher + Diego Novillo + + * Makefile.in (install-po): Check if $CATALOGS is empty to avoid + buggy shells. + * basic-block.h (rtl_verify_flow_info): Remove. + (tree_verify_flow_info): Remove. + (verify_flow_info): Declare. + * builtins.c: Rearrange to simplify merges. Add #if 0 around + expand_ functions that are not used in the branch and move new code + to the end of the file. + * c-opts.c (c_common_handle_option): Move handling of -fdump- to + opts.c. + * cfgloopmanip.c (loop_split_edge_with_NULL): Remove. Update all + users. + * common.opt: Add all the tree-ssa switches. + * opts.c: Handle them. + * flags.h (flag_tree_cp): Remove unused variable. + (enum pta_type): Move from tree-must-alias.h + (flag_tree_points_to): Likewise. + * toplev.c (flag_tree_cp): Remove unused variable. + * tree-cfg.c: Move cfg_hooks structures and functions for + trees from cfghooks.c. + * tree-mudflap.c (mudflap_enqueue_decl): Don't use %D to + avoid warning about format specifiers. + +2003-07-21 Diego Novillo + + * gimplify.c (gimplify_function_tree): Move gimplification of the + function body ... + (gimplify_body): ... here. + * tree-simple.h (gimplify_body): Declare. + * tree-inline.c (initialize_inlined_parameters): If the + emitted assignment is not in GIMPLE form, gimplify the + body of assignments emitted. + +2003-07-17 Jeff Law + + * tree-dfa.c (remove_phi_arg): Update PHI_ARG_CAPACITY. + + * tree-ssa.c (mark_def_sites): Do not build the dominator tree here. + (rewrite_into_ssa): Do not depend on mark_def_sites to build the + dominator tree. Move computation of dominance frontiers out + of main loop (even though it was only done once). Free immediate + dominator information as soon as we're done with it. + + * tree-flow.h (remove_phi_nodes_and_edges_for_unreachable_block): + Prototype. + * tree-cfg.c (remove_phi_nodes_and_edges_for_unreachable_block): New + function extracted from remove_bb. + (remove_bb): Call remove_phi_nodes_and_edges_for_unreachable_block. + + * tree-ssa-dom.c (optimize_block): Propagate values into PHI nodes. + Do not optimize a block which has become unreachable. + If a COND_EXPR has a compile-time constant condition, then remove + outgoing from the COND_EXPR which can not execute. + +2003-07-16 Frank Ch. Eigler + + * tree-mudflap.c (mx_xfn_indirect_ref): Correct source locations + for tracked expressions by ignoring incidental decl source loci. + +2003-07-16 Jeff Law + + * tree-cfg.c (remove_bb): Remove statements in reverse order. + Simplify code to issue warnings for unreachable code. + + * tree-ssa-dom.c (get_eq_expr_value): Also enter expressions + into the available expression hash table. Callers changed to + pass in the block_avail_exprs varray and const_and_copies hash + table. + (optimize_stmt): Allow optimization of the condition in + a COND_EXPR statement. + (lookup_avail_expr): For COND_EXPRs, just see if their condition + has been recorded into the hash table, do not enter them into + the hash table. Only do a lookup of the result in the + const_and_copies table if it is an SSA_VAR. + (avail_expr_hash): Handle COND_EXPRs, specifically we only care + about their condition and virtual operands. + (avail_expr_eq): Likewise. If one statement has virtual operands + and the other does not, then the expressions are not equal. + + * tree-ssa.c (rewrite_into_ssa): If we have done dominator + optimizations, then call cleanup_tree_cfg after rewriting is + complete. + * tree-ssa-dom.c (optimize_block): Get eq_expr_value for the + current block rather than having it passed in by the caller. + Propagate eq_expr_value into the false arm of a COND_EXPR. + (get_eq_expr_value): Return equivalences for the false + arm of a COND_EXPR if requested. + +2003-07-16 Daniel Berlin + + * c-decl.c (store_parm_decls): Also strip NON_LVALUE_EXPRs and + CONVERT_EXPRs when setting DECL_NONLOCAL. + +2003-07-15 Daniel Berlin + + * tree-cfg.c (remove_stmt): Update bb->end_tree_p properly when + stmt_p is the end of the bb. + +2003-07-15 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Consider two types equivalent if + their TYPE_MAIN_VARIANT is equivalent. + (avail_expr_eq): Likewise. + + * Makefile.in (OBJS): Add tree-ssa-dom.o + (tree-ssa-dom.o): Add dependencies. + (ssa.o, cfghooks.o): Use $(TREE_FLOW_H), not tree-flow.h. + * timevar.def: Add new timevar for dominator optimizer. Reorder + slightly. + * tree-dfa.c (add_stmt_operand): Do not consider references to + static storage as volatile operands. + (add_referenced_var): Static storage items reference global memory. + * tree-ssa.c: Simplify by moving everything specific to the + dominator optimizer into tree-ssa-dom.c. Call into the dominator + optimizer after rewriting all the basic blocks. + * tree-ssa-dom.c: New file. Mostly extracted from tree-ssa.c + * tree-flow.h (tree_ssa_dominator_optimize): Prototype. + (dump_dominator_optimization_stats): Likewise. + (debug_dominator_optimization_stats): Likewise. + +2003-07-15 Diego Novillo + + * tree-dfa.c (add_stmt_operand): Move volatile handling... + (find_vars_r): ... here. + Mark when the walker is inside an ASM_EXPR. + (struct walk_state): Add field 'is_asm_expr'. + Change flag fields to bitfields. + (add_referenced_var): If the variable is a pointer being stored by + an ASM_EXPR, mark it as a global memory pointer. + * tree-flow-inline.h (is_optimizable_addr_expr): New function. + * tree-flow.h (is_optimizable_addr_expr): Declare it. + * tree-ssa.c (rewrite_and_optimize_stmt): Use it. + (lookup_avail_expr): Likewise. + (get_eq_expr_value): Likewise. + (avail_expr_eq): Return 'true' when comparing a statement against + itself. + * tree-ssa-dce.c (need_to_preserve_store): Move volatile checking... + (stmt_useful_p): ...here. + +2003-07-15 Andreas Jaeger + + * c-simplify.c: Convert prototypes to ISO C90. + * gimplify.c: Likewise. + * simple-break-elim.c: Likewise. + * simple-goto-elim.c: Likewise. + + * tree-alias-ander.c: Convert prototypes to ISO C90. + * tree-alias-common.c: Likewise. + * tree-alias-type.c: Likewise. + * tree-browser.c: Likewise. + * tree-dchain.c: Likewise. + * tree-mudflap.c: Likewise. + * tree-nomudflap.c: Likewise. + * tree-optimize.c: Likewise. + * tree-pretty-print.c: Likewise. + * tree-simple.c: Likewise. + + * tree-alias-common.h: Convert prototypes to ISO C90, remove extra + whitespace. + * tree-alias-type.h: Convert prototypes to ISO C90. + * tree-dchain.h: Likewise. + * tree-flow-inline.h: Likewise. + * tree-flow.h: Likewise. + * tree-iterator.h: Likewise. + * tree-mudflap.h: Likewise. + * tree-simple.h: Likewise. + +2003-07-14 Daniel Berlin + + * tree-ssa-pre.c (tree_perform_ssapre): Fix dom_children after DCE + breaks them. + +2003-07-14 Diego Novillo + + * tree-dfa.c (add_vdef): Initialize variable 'vdef'. + (add_vuse): Initialize variable 'vuse'. + +2003-07-14 Diego Novillo + + Must alias analysis. Allow the SSA rename pass to be done on a set + of variables. + + * Makefile.in (OBJS): Add tree-must-alias.o. + * flags.h (flag_tree_must_alias): Declare. + * timevar.def (TV_TREE_MUST_ALIAS): Define. + * toplev.c (flag_tree_must_alias): Declare. + (f_options): Add entry for -ftree-must-alias. + (parse_options_and_default_flags): Enable must-alias analysis at -O1. + + * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove + addressable variables. + + * tree-dfa.c (dump_file, dump_flags): New local variables to + replace tree_ssa_dump_file and tree_ssa_dump_flags. Update every + user. + (get_stmt_operands): Clear the array of virtual operands before + scanning the statement. + (get_expr_operands): Do not add an operand for ADDR_EXPR if the + expression takes the address of a VAR_DECL or a PARM_DECL. Instead + add the variable to the list of variables whose address has been + taken by the statement. + Allow INDIRECT_REF expressions of the form *&VAR. Convert them + into an operand for VAR. + When processing function calls, add a VUSE for .GLOBAL_VAR if the + function is pure but not const. + (add_stmt_operand): If the operand is an ADDR_EXPR, add the + variable to the list of variables whose address has been taken by + the statement. + (add_vdef): If the statement had virtual definitions, try to find + an existing VDEF for the variable, to preserve SSA information. If + none is found, create a new one. + (add_vuse): Likewise. + (remove_all_phi_nodes_for): New function. + (get_call_flags): New function to replace call_may_clobber. Update + all callers. + + * tree-dump.c (dump_files): Add entry for -fdump-tree-mustalias. + * tree-flow-inline.h (addresses_taken): New function. + (is_unchanging_value): New function. + + * tree-flow.h (addresses_taken): Declare. + (remove_all_phi_nodes): Declare. + (init_tree_ssa): Declare. + (propagate_copy): Declare. + (is_unchanging_value): Declare. + (tree_compute_must_alias): Declare. + + * tree-inline.c (copy_body_r): Fold instances of *&VAR. + + * tree-must-alias.c: New file. + + * tree-optimize.c (optimize_function_tree): Call init_tree_ssa and + compute_may_aliases before calling rewrite_into_ssa. + After the SSA pass, run dead code elimination and compute + must-aliases. + + * tree-simple.c (is_gimple_call_expr): Add comment that + is_gimple_* predicates should not have side effects. + + * tree-ssa-ccp.c: Replace calls to really_constant_p with + is_unchanging_value everywhere. + (fold_stmt): Don't fold if the RHS is already a constant. + + * tree-ssa-copyprop.c (copyprop_stmt): Remove unnecessary + variable 'vuse'. + Call propagate_copy to replace the operand with its new value. + (copyprop_phi): Remove unnecessary variable 'vuse'. + (get_original): Remove unused parameter 'vuse_p'. + (propagate_copy): New function. + + * tree-ssa-dce.c (need_to_preserve_store): Update comments. + + * tree-ssa.c (dump_file, dump_flags): New local variables to + replace globals tree_ssa_dump_file and tree_ssa_dump_flags. Update + all users. + (addr_expr_propagated_p): New local variable. + (vars_to_rename): New local variable. + (check_for_new_variables): New local function. + (rewrite_into_ssa): Add new argument VARS which is a bitmap + representing all the variables that should be renamed into SSA. If + VARS is NULL, all the variables in the program are renamed. + Don't call init_tree_ssa nor compute_may_aliases. + Initialize all the local hash tables and bitmaps. + Add support for repeating the SSA rename process more than once. + If the dominator optimizations produced new symbols, repeat the + process. + (mark_def_sites): Ignore operands that are in SSA form already. + (insert_phi_nodes): Only add PHI nodes for variables in the + VARS_TO_RENAME bitmap. + (rewrite_block): Ignore PHI nodes that have been renamed already. + (rewrite_and_optimize_stmt): Ignore operands that are already in + SSA form. + When propagating ADDR_EXPR set addr_expr_propagated_p to 'true'. + Call propagate_copy when doing copy propagation. + Call is_unchanging_value to decide if the RHS of an assignment is a + constant. + (rewrite_stmt): Ignore operands that are already in SSA form. + (init_tree_ssa): Make external. + Move initialization of local hash tables and bitmaps to + rewrite_into_ssa. + (remove_annotations_r): Don't special case MODIFY_EXPR nodes. + (lookup_avail_expr): Call is_unchanging_value. + (get_eq_expr_value): Likewise. + + * tree.h (enum tree_dump_index): Add TDI_must_alias. + + * cp/optimize.c (optimize_function): Don't call the tree optimizers + if -fdisable-tree-ssa is given. + + * doc/invoke.texi: Add documentation for -ftree-must-alias. + +2003-07-07 Jeff Law + + * fold-const.c (nondestructive_fold_unary_to_constant: For BIT_NOT_EXPR + make sure OP0 is a suitable constant before trying to fold it. + + * tree-cfg.c (handle_switch_fallthru): Set DECL_CONTEXT for + newly created labels. + + * tree-cfg.c (move_outgoing_edges): New function. + (merge_tree_blocks): Use it. + (remove_bb): Remove the block from the pdom_info structures + as well if they exist. + (linearize_cond_expr): Move important edges from the then and + else arms to BB as appropriately + + * tree-cfg.c (remove_stmt): When removing a COMPOUND_EXPR, make + sure that any basic block pointers to the arms of the COMPOUND_EXPR + are updated. + + * tree-cfg.c (make_goto_expr_edges): Computed gotos create + abnormal edges. + +2003-07-05 Daniel Berlin + + * tree-ssa-pre.c (defs_match_p): Check for copies of the same version. + +2003-07-03 Frank Ch. Eigler + + * tree-nomudflap.c (mf_marked_p, mf_mark): New dummy functions. + +2003-07-03 Jeff Law + + * tree-ssa.c (lookup_avail_expr): Accept new argument containing the + const_and_copies table. All callers changed. If we find the + given expression in the availe expression hash table, then lookup + the LHS of the hash table's entry in the const_and_copies_table. + Do record type casts into the available expression table. + + * tree-nomudflap.c (mf_marked_p): Mark arguments as being unused. + (mf_mark): Likewise. + + * c-decl.c (store_parm_decls): Strip away NOP_EXPRs when looking + for hidden use variables. + +2003-07-02 Frank Ch. Eigler + + * varasm.c (build_constant_desc): Propagate mudflap marked-ness + across constant copying. + +2003-07-02 Daniel Berlin + + * tree-ssa-pre.c (tree_perform_ssapre): Don't optimize things with + volatile ops or making aliased loads right now. + (create_expr_ref): Mark the phi result of the new phi as having + real refs. + (finalize_1): Mark the new temp as having real refs. + (repair_use_injury): Ditto. + (code_motion): Ditto. + +2003-07-01 Daniel Berlin + + * tree.h (struct tree_eref_common): Add injured flag. + Add EREF_INJURED macro. + +2003-07-01 Daniel Berlin + + * tree-flow-inline.h (stmt_ann): We have stmt_ann on E*_NODE's as well, + so use is_essa_node as well. + * tree-dfa.c (create_stmt_ann): Ditto. + * tree.h (is_essa_node): Declare. + * tree.c (is_essa_node): Define. + +2003-07-01 Jason Merrill + + * tree-cfg.c (prepend_stmt_to_bb): New fn. + (bsi_insert_after): Add to the beginning of an empty block. + +2003-07-01 Jeff Law + + * expr.c (expand_expr, case COND_EXPR): Correctly (?) handle + cases where a containing block has a stack level. Handle + cases where one arm is a GOTO_EXPR and the other arm has + side effects. + + * stmt.c (containing_blocks_have_cleanups_or_stack_level): New + function. + (any_pending_cleanups): Further simplification. + * tree.h (containing_blocks_have_cleanups_or_stack_level): Prototype. + +2003-06-30 Diego Novillo + + * tree-flow.h (struct tree_ann_common_d): Remove 'stmt' field. + Update all users. + (struct var_ann_d): Remove field 'has_real_refs'. Update all callers + with calls to SSA_NAME_HAS_REAL_REFS. + Remove field 'occurs_in_abnormal_phi'. Update all callers with + calls to SSA_NAME_OCCURS_IN_ABNORMAL_PHI. + * tree-flow-inline.h (var_ann): Only accept _DECL nodes. + (stmt_ann): Only accept GIMPLE statements. + (tree_stmt): Remove. Update all users. + + * tree-cfg.c (linearize_cond_expr): Handle cases where BB doesn't + have a postdominator. + (find_contained_blocks): Do not look inside COND_EXPR_COND nor + SWITCH_COND expressions. + + * tree-dfa.c (get_stmt_operands): Force virtual operands on + ASM_EXPRs. + (get_expr_operands): Handle SSA names when adding operands for + memory tags. + (add_stmt_operand): Handle SSA names. + Move checks for volatile operands earlier in the code. + (add_vdef): Re-format for readability. + (create_var_ann): Only allow _DECL nodes. + (create_stmt_ann): Only allow GIMPLE statements. + (dump_variable): Handle SSA names. + (dump_may_aliases_for): Likewise. + (may_access_global_mem_p): Handle SSA names. + (remove_phi_arg): If the argument removed was the last one with + real references, update the LHS of the PHI node. + (add_phi_arg): If the argument added has real references, propagate + the attribute into the LHS of the PHI node. + + * tree-pretty-print.c (dump_generic_node): Only retrieve basic + block information from GIMPLE statements. + Always output the THEN and ELSE clauses of COND_EXPR nodes. + + * tree-simple.c (is_gimple_stmt): Accept PHI_NODEs. + (is_gimple_id): Accept SSA_NAMEs. + + * tree-ssa-copyprop.c (copyprop_phi): If an argument is used as a + real operand, propagate the attribute into the LHS of the PHI. + + * tree-ssa-live.c (create_ssa_var_map): Don't set 'used' flag on + both the operand and the result of VDEFs. + Only register PHI results and arguments that have been used as real + operands. + (calculate_live_on_entry): Fix formatting in debugging message. + + * tree-ssa.c (register_new_def): Add new argument + 'is_real_operand'. If it's set, set SSA_NAME_HAS_REAL_REFS for the + new name. Update all callers. + (rewrite_operand): Add new argument 'is_real_operand'. If it's + set, set SSA_NAME_HAS_REAL_REFS to the operand. + (eliminate_build): Ignore PHI arguments and PHI results that have + not been used in real operands. + (rewrite_vdefs): Remove. Update all users. + (set_is_used): Don't handle SSA names. + (coalesce_ssa_name): Ignore PHI arguments that have not had real + references in the program. + + * tree.c (make_ssa_name): Update documentation. + * tree.h (IS_EMPTY_STMT): Call integer_zerop instead of comparing + against size_zero_node. + (SSA_NAME_HAS_REAL_REFS): Define. + (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Define. + (struct tree_ssa_name): Add bitfields 'has_real_refs' and + 'occurs_in_abnormal_phi'. + +2003-06-30 Jeff Law + + * c-simplify.c (gimplify_c_loop): Don't return a LOOP_EXPR for + a do ... while (0) loop. + + * expr.c (expand_expr, case COND_EXPR): Be smarter about expanding + a COND_EXPR with only one useful arm, which happens to be a GOTO_EXPR. + + * tree-cfg.c (remove_useless_stmts_and_vars): Don't remove user + variables unless we're at -O2 or higher. + +2003-06-30 Daniel Berlin + + * tree-ssa-pre.c (expr_phi_insertion): Stop optimizing the expression + if we have > some very large number of ephi operands, as it will + take an ungodly amount of memory and time. + (pre_expression): Push/pop gc context so we can do gc collection + in between expressions. + Throw away expression info right after done optimizing it. + +2003-06-30 Jason Merrill + + * gimplify.c (gimplify_call_expr): Check PUSH_ARGS_REVERSED. + + * gimplify.c (gimplify_modify_expr): Also force a call with a + possible nonlocal goto into a temporary. + (gimplify_return_expr): Don't duplicate the MODIFY_EXPR. + * tree-iterator.h (tsi_one_before_end_p): New fn. + +2003-06-29 Jeff Sturm + + * fold-const.c (fold): Don't save_expr unless TREE_SIDE_EFFECTS. + +2003-06-26 Diego Novillo + + * c-simplify.c (gimplify_stmt_expr): Handle statement-expressions + that don't end in a non-void expression. Emit a warning in that + case. + +2003-06-26 Daniel Berlin + + * tree-ssa-pre.c (fixup_domchildren): Rename from + compute_domchildren, change to not use our own array. + (domchildren): Remove variable. + (insert_occ_in_preorder_dt_order_1): Use dom_children now. + (insert_euse_in_preorder_dt_order_1): Ditto. + (search_dt_preorder): Ditto. + (handle_bb_creation): Fix to work properly. + (tree_perform_ssapre): Remove remnants of domchildren. + Redo dominator info if we have to due to a new block. + +2003-06-26 Andrew MacLeod + + * tree-cfg.c (handle_switch_split): Use a tree iterator to find the + real split point rather than a block iterator. + +2003-06-26 Jason Merrill + + * tree-simple.c (is_gimple_stmt): Complete. + +2003-06-24 Jeff Law + + * tree-cfg.c (remove_useless_stmts_and_vars): On the first + iteration, remove unused variables from BIND_EXPRs. + * tree-flow.h (var_ann_d): Add new field USED. + (set_is_used): Prototype. + (remove_useless_stmts_and_vars): Update prototype. + * tree-ssa-live.c (create_ssa_var_map): Note which variables + are used so that we can delete those which are not used. + * tree-ssa.c (create_temp): Mark the new temporary as being used. + (rewrite_out_of_ssa): Note if the call to remove_useless_stmts_and_vars + is the first iteration or not. + (set_is_used): New function. + + * c-decl.c (store_parm_decls): Variables and parameters on the + pending_sizes chain have nonlocal uses. + +2003-06-25 Daniel Berlin + + * tree-ssa-pre.c: Convert to ISO C. + (handle_bb_creation): New function. + (ephi_will_be_avail): Remove dead code. + (finalize_1): Use handle_bb_creation, start to fix edge insertion + related fun. + (maybe_find_rhs_use_for_var): Stop using tree_stmt. + (code_motion): Always get the temporary from the right place. + +2003-06-24 Jason Merrill + + * gimplify.c (gimplify_self_mod_expr): Add want_value parm. + For postfix ops, make sure it returns an rvalue. + (gimplify_expr): Copy a volatile reference into a temp. + (create_tmp_var): Require a complete type. + (create_tmp_alias_var): Use TYPE_VOLATILE on types. + * tree-simple.c (is_gimple_stmt): Flesh out a bit. + (is_gimple_val): Don't allow volatiles. + + * c-simplify.c (gimplify_expr_stmt): Don't insert a null pointer. + + * gimplify.c (gimplify_return_expr): Search through the gimple + form for the interesting MODIFY_EXPR. + (gimplify_modify_expr): Don't suppress posteffects if want_value. + +2003-06-24 Diego Novillo + + * tree-dfa.c (struct dfa_stats_d): Remove obsolete fields + num_tree_refs and size_tree_refs. Update all users. + (dump_dfa_stats): Also dump information about VUSE and VDEF + operands. + * tree-ssa.c (rewrite_vdefs): Dump information about VDEF operators + promoted to real copies if -fdump-tree-optimized-details is given. + +2003-06-23 Jeff Law + + * tree-ssa.c (avail_expr_eq): Verify types are the same before + handing expressions to operand_equal_p. + + * tree-cfg.c (make_edges): Remove fake edges before building + extra edges for TRY_FINALLY_EXPRs. Delete unnecessary edges + leaving the TRY block in a TRY_FINALLY_EXPR. + (find_contained_blocks): Don't consider statements in the CATCH + clause of a TRY_CATCH_EXPR when noting the last statement in + the block. + * tree-dfa.c (remove_phi_arg): If we removed the last PHI argument, + then remove the entire PHI node. + * tree-ssa-dce.c (stmt_useful_p): Consider the other EH related + nodes useful as well (TRY_FINALLY_EXPR, TRY_CATCH_EXPR, and + EH_FILTER_EXPR). + + * tree-cfg.c (remove_useless_stmts_and_vars): If the body of a + TRY_CATCH_EXPR is empty, then the entire TRY_CATCH_EXPR can + be safely removed. + + * tree-cfg.c (find_contained_blocks): Renamed from + find_contained_blocks_and_edge_targets. Remove targets + bitmap argument and no longer record targets of edges. + All callers changed. + (make_edges): No longer need TRY_TARGETS bitmap. Kill it. + Simplify code which creates additional edges out of the TRY + block and the FINALLY block in a TRY_FINALLY_EXPR. + +2003-06-23 Diego Novillo + + * tree-alias-common.c (ptr_may_alias_var): Don't handle memory + tags. + * tree-dfa.c (struct alias_set_d): Remove. Update all users. + (alias_sets): Remove. Update all users. + (struct walk_state): Remove field aliased_objects_found. + (struct alias_map_d): New. + (addressable_vars): New local variable. + (pointers): New local variable. + (add_stmt_operand): Do not force aliased variables to be in virtual + operands. + (register_alias_set): Remove. Update all users. + (find_alias_for): Remove. Update all users. + (get_memory_tag_for): New local function. + (num_referenced_vars): Remove. + (num_aliased_objects): Remove. Update all users. + (aliased_objects): Remove. Update all users. + (aliased_objects_alias_set): Remove. Update all users. + (num_call_clobbered_vars): Remove. Update all users. + (dump_variable): Move code to dump aliases ... + (dump_may_aliases_for): ... here. + (debug_may_aliases_for): New function. + (compute_may_aliases): Initialize 'addressable_vars' and 'pointers' + arrays. + (compute_alias_sets): Re-implement matching pointers with + addressable variables. Limit the size of may-alias sets. + (may_alias_p): Re-implement to compare pointers against variables, + instead of memory tags. + (dump_alias_info): Re-implement to display pointers and addresable + variables arrays. + (add_referenced_var): Collect addressable variables and pointers. + Share memory tags among pointers that may alias each other. + * tree-flow.h (num_referenced_vars): Change to macro. + (referenced_var): Likewise. + (num_call_clobbered_vars): Likewise. + (call_clobbered_var): Likewise. + (dump_may_aliases_for): Declare. + (debug_may_aliases_for): Declare. + * tree-ssa.c (rewrite_vdefs): New local function. + (rewrite_out_of_ssa): Call it. + +2003-06-23 Jeff Law + + * tree-cfg.c (make_edges): Walk TRY_FINALLYs inner to outer and + simplify creation of special edges related to the TRY_FINALLY_EXPR. + + * tree-cfg.c (remove_useless_stmts_and_vars): More aggressively + remove TRY_CATCH_EXPRs and TRY_FINALLY_EXPRs. + + * tree-cfg.c (make_edges): Remove fake edges. + (make_exit_edges): Mark edges from nonreturning functions to the + exit block as being fake edges. + + * gimplify.c (gimplify_modify_expr): Don't create a new MODIFY_EXPR, + reuse the existing one. + +2003-06-23 Andrew MacLeod + + * tree-cfg.c (find_insert_location): Default case should insert after + the last stmt in the block. + +2003-06-22 Jeff Sturm + + * Makefile.in (old-tree-inline.o): Remove rule. + * old-tree-inline.c: Remove. + +2003-06-19 Jeff Law + + * tree-cfg.c (make_ctrl_stmt_edges): Do not create bogus edges + to the successor block of TRY_CATCH_EXPR, TRY_FINALLY_EXPR, + CATCH_EXPR or EH_FILTER_EXPR nodes. + + * gimplify.c (gimplify_modify_expr): If the RHS of an MODIFY_EXPR + might throw, then make sure its result goes into a temporary. + + * tree-cfg.c (handle_switch_split): Handle case where target + block has only one statement (the case label itself). + +2003-06-19 Diego Novillo + + * doc/invoke.texi: Add documentation for -ftree-dominator-opts + that was missing from an earlier patch. + +2003-06-19 Jeff Sturm + + * gimplify.c (gimplify_expr): Handle LABELED_BLOCK_EXPR + and EXIT_BLOCK_EXPR. + (gimplify_labeled_block_expr): New function. + (gimplify_exit_block_expr): New function. + +2003-06-18 Andrew MacLeod + + * tree-cfg.c (EDGE_INSERT_LOCATION_BSI_AFTER): New location code. + (cleanup_switch_expr_graph): Find default case correctly. + (bsi_insert_after): Get BB from stmt when its avialble. + (bsi_insert_before): Get BB from stmt when its avialble. + (handle_switch_fallthru): New. Handle edge from switch to the fallthru. + (handle_switch_split): Re-implement using new scheme. + (find_insert_location): Use handle_switch_fallthru (). + (bsi_insert_on_edge_immediate): Handle EDGE_INSERT_LOCATION_BSI_AFTER. + * tree-iterator.h (tsi_last): New. Find last stmt in a chain. + +2003-06-17 Daniel Berlin + + * tree-alias-common.c (find_func_aliases): Guard cast op + properly. + (ptr_may_alias_var): Small optimization to avoid calling + decl_function_context so often. + * tree-alias-ander.c (ander_simple_assign): Ignore if lhs == rhs. + +2003-06-17 Steven Bosscher + + * timevar.def (TV_TREE_BUILD_FUD_CHAINS): Remove. + +2003-06-16 Diego Novillo + + * tree-ssa-ccp.c (DONT_SIMULATE_AGAIN): Define. + (visit_phi_node): Don't do anything if the PHI node doesn't need to + be simulated. + If the PHI variable does not have real references, consider it + VARYING. + If the PHI node has a lattice value of VARYING, set + DONT_SIMULATE_AGAIN. + (visit_stmt): Don't do anything if the statement doesn't need to be + simulated. + Only visit conditional branches COND_EXPR and SWITCH_EXPR. + If the statement doesn't produce a result mark it with + DONT_SIMULATE_AGAIN. + (visit_assignment): Remove unnecessary def_op() check. + If the value is VARYING, mark the statement with + DONT_SIMULATE_AGAIN. + (visit_cond_stmt): Remove unnecessary is_ctrl_stmt() check. + If the predicate is VARYING, mark the statement with + DONT_SIMULATE_AGAIN. + (initialize): Clear DONT_SIMULATE_AGAIN flag for every statement + and PHI node. + (likely_value): Get statement operands after checking if it makes + aliased loads or has volatile operands. + +2003-06-16 Jeff Law + Jason Merrill + + * except.c (enum eh_region_type): Don't declare the enumeration + members here. Instead do it in except.h. + (expand_eh_hander): Use expr_first instead of open-coding it. + * except.h (enum eh_region_type): Define the enumeration memebers + here. + * tree-cfg.c (last_exec_block): Break out from make_edges. + (could_trap_p): No longer static. + (get_eh_region_type): New function. + (make_try_expr_blocks): Keep the whole TRY_CATCH_EXPR or + TRY_FINALLY_EXPR instead of just the handler part in the + EH_STACK varray. For a cleanup, record which cleanup higher + in the EH_STACK it can reach. + (make_edges): Use last_exec_block. + (make_ctrl_stmt_edges): Thread cleanups as needed. + (compute_reachable_eh): Use get_eh_region_type. Properly + track when we can skip cleanups. Skip cleanups when possible. + * tree-flow.h (could_trap_p): Prototype. + +2003-06-16 Andrew Macleod + + * tree-cfg.c (find_insert_location): Check for control_altering stmts, + and abort if its an unrecognized BB ending stmt. + (bsi_commit_first_edge_insert): Rename to bsi_insert_on_edge_immediate, + externalize, and change the interface to an on-demand inserter. + (bsi_commit_edge_inserts): Call bsi_insert_on_edge_immediate(). + * tree-flow.h (bsi_insert_on_edge_immediate): Prototype. + * tree-pretty-print.c (dump_block_info): Add 'ab' for abnormal edges. + * tree-ssa-dce.c (process_worklist): Use sparse bitmaps. + * tree-ssa-live.c (calculate_live_on_entry): Abort if ssa_name has a + definition, but is also live on entry. + * tree-ssa.c (coalesce_ssa_name): Call abort() instead of error(), and + provide more detailed info. + (rewrite_out_of_ssa): Provide CFG dumps before and after rewritting. + +2003-06-16 Frank Ch. Eigler + + * tree-mudflap.c (mf_mark): Use GC-compatible htab_create_ggc. + +2003-06-15 Jeff Law + + * tree-ssa-ccp.c (visit_phi_node): If the PHI is already known + to be varying, don't recompute its value. + +2003-06-14 Jeff Law + Jason Merrill + + * tree-cfg.c (make_blocks): Do not return early if presented + with an empty statement. + (make_ctrl_stmt_edges): Do not try to optimize an empty TRY + block in a TRY_FINALLY_EXPR. Simplify TRY_FINALLY_EXPR, + TRY_CATCH_EXPR, CATCH_EXPR, and EH_FILTER_EXPR now that empty + statements are no longer shared. + +2003-06-14 Kazu Hirata + + * tree-ssa-pre.c: Fix a comment typo. + +2003-06-13 Diego Novillo + + * tree-dfa.c (get_stmt_operands): Abort if the statement is a + variable. + (create_var_ann): Abort if the variable is not a _DECL node. + +2003-06-13 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_c_function): Change calling conventions so + as to return the instrumented function body rather than changing the + given fndecl in place. Gimplify at the very end, for cosmetic + reasons. + * tree-mudflap.h, tree-nomudflap.c: Corresponding changes. + * c-decl.c (c_expand_body_1): Call mudflap_c_function just before + rtl expansion of function body; don't interfere with inlining. + +2003-06-13 Diego Novillo + + * c-simplify.c: Fix typo in previous change. + +2003-06-13 Diego Novillo + + * c-common.c, c-common.h, c-decl.c, c-lang.c, c-simplify.c, + flags.h, gimplify.c, langhooks-def.h, langhooks.c, langhooks.h, + simple-break-elim.c, simple-goto-elim.c, toplev.c, + tree-alias-common.c, tree-cfg.c, tree-dfa.c, tree-dump.c, + tree-inline.c, tree-mudflap.c, tree-simple.c, tree-simple.h, + tree-ssa-ccp.c, tree-ssa-pre.c, tree-ssa.c, tree.h, doc/invoke.texi: + Rename SIMPLE to GIMPLE everywhere. + +2003-06-13 Andrew MacLeod + + * tree-cfg.c (bsi_commit_first_edge_insert): Only consider non-abnormal + edges when determining whether an edge needs to be split. + + * tree-ssa-dce.c (process_worklist): When checking for GOTO and + COND_EXPR's that are necessary, check each BB's predecessors only once. + +2003-06-12 Jeff Law + + * tree-ssa.c (avail_expr_eq): Add some checking code to + detect when equal expressions have different hash values. + + * tree.c (iterative_hash_expr): Don't hash types associated + with conversions. Instead hash on the signedness of the + toplevel object and the operand of the conversion. + + * Makefile.in (gimplify.o): Depend on $(RTL_H). Ugh. + * gimplify.c: Include "rtl.h". + (simplify_call_expr): Use call_expr_flags and check for ECF_CONST + rather than checking bits in the tree node directly. + + * fold-const.c (operand_equal_p): CALL_EXPRs with side effects + are never equal. + +2003-06-11 Frank Ch. Eigler + + * gcc.c (MFWRAP_SPEC): Always wrap main(). + * tree-mudflap.c (mudflap_enqueue_decl): Mark enqueued decls + to prevent their repeated processing. + +2003-06-11 Daniel Berlin + + * tree-ssa-pre.c: add graph_dump_file, graph_dump_flags. + (finalize_1): Modify to use temporary in expr_info structure, + remove temporary from arguments. + Use bsi_insert_on_edge for ephi insertions. + Set EREF_TEMP on inserted euses. + (repair_phi_injury): Note (to dump file) injuries we have + repaired already. + (repair_use_injury): Ditto. + (repair_euse_injury): Ditto. + (count_stmts_in_bb): Count both forwards and backwards, and make + sure the numbers agree. This makes sure both the head and end are + updated properly. + (code_motion): Use the EREF_TEMP, rather than calculating the + reaching def, when possible, because it's faster. + Add the phi we created when we insert the ephi. We should always + be able to get the reaching def of the ephi from EREF_TEMP (since + the args should have already been inserted, or in the case of + phi's, have a phi already allocated), so abort if we can't. + (create_expr_ref): Take expr_info parameter. Make a phi for the + ephi's, but don't add to the bb yet. Update all callers. + (get_default_def): New function. + (get_reaching_def): Use it to find the default def when we hit the + top of the dom tree. + (struct expr_info): Add temp. + (new_rename_1): Dump out occurrences after rename 1, but before + rename 2. + (requires_edge_placement): Now that we can insert on edges, we + shouldn't need this, so make it always return false. + Will remove unless something bad comes up. + (pre_expression): Start working on dumping the redundancy graph. + + * tree.h (struct treeeref_common): Add the temp member. + Add EREF_TEMP macro. + (tree_dump_index): Reorder to match actual optimization order. + Add TDI_predot. + + * tree-dump.c: Ditto. + +2003-06-11 Jeff Law + + * gimplify.c (simplify_call_expr): Clear TREE_SIDE_EFFECTS for + calls to "const" functions. + + * tree-inline.c (expand_call_inline): Recalculate TREE_SIDE_EFFECTS + properly when inlining gimplified functions. + + * fold-const.c (operand_equal_p): Handle CALL_EXPRs. + + * tree-cfg.c (first_exec_block): Kill. + (make_edges): Use bb_for_stmt rather than first_exec_block. + (make_ctrl_stmt_edges, make_exit_edges): Likewise. + (make_loop_expr_edges, make_cond_expr_edges): Likewise. + (successor_block): Don't skip empty statements. + + * tree-ssa.c (rewrite_and_optimize_stmt): Do not special case + CALL_EXPRs they're caught by the TREE_SIDE_EFFECTS test. + + * tree-ssa.c (rewrite_and_optimize_stmt): Improve/correct setting of + may_optimize_p. Simplify later code knowing may_optimize_p is + correctly set. + (avail_expr_hash): Do not use iterative_hash_object or deal with + SSA names for real operands. Instead use iterative_hash_expr + which handles both. + (avail_expr_eq): Use operand_equal_p to test for equality. + +2003-06-11 Steven Bosscher + + * tree-flow.h, tree-ssa-ccp.c, tree-ssa-copyprop.c, + tree-ssa-dce.c, tree-ssa-live.c, tree-ssa-live.h: + Convert function prototypes to ISO C. + +2003-06-10 Jeff Law + + * toplev.c (parse_options_and_default_flags): Fix typo in last change. + + * gimplify.c (simplify_expr, case BIT_FIELD_REF): Make sure + to call recalculate_side_effects after gimplifying the + operands. + +2003-06-10 Diego Novillo + + * toplev.c (flag_tree_dom): New variable. + (f_options): Add new entry for -ftree-dominator-opts. + (parse_options_and_default_flags): Enable flag_tree_dom for + -O1 and higher. At -O2 and higher, disable flag_tree_dom is + SSA-PRE is also specified. + * flags.h (flag_tree_dom): Declare. + * doc/invoke.texi: Document -ftree-dominator-opts. + * tree-ssa.c (rewrite_block): Disable tracking of available + expressions when not doing dominator optimizations. + Call rewrite_stmt when not doing dominator optimizations. + Otherwise, call rewrite_and_optimize_stmt. + (rewrite_stmt): Don't optimize the statement. Just rename. + (rewrite_and_optimize_stmt): Optimize the statement while rewriting + its operands. + (lookup_avail_expr): Update comments. + +2003-06-10 Andrew Haley + + * c-simplify.c (c_simplify_stmt): case ASM_STMT: Ensure qualifiers + come from input statement. + +2003-06-09 Andrew MacLeod + + * tree-cfg.c (handle_switch_split): Update PHI nodes when splitting. + (tree_split_edge): Update PHI nodes in destination block. + +2003-06-09 Steven Bosscher + + * basic-block.h, tree-dfa.c, tree-ssa.c, tree-cfg.c, + tree-flow.h: Convert function prototypes to ISO C. + +2003-06-09 Daniel Berlin + + * tree-cfg.c (bsi_commit_edge_inserts): Fix computation of + new_blocks. + +2003-06-08 Diego Novillo + + * tree-cfg.c (handle_switch_split): Don't allocate basic block + annotations more than once. + (bsi_commit_first_edge_insert): Likewise. + +2003-06-07 Jeff Sturm + + * tree-cfg.c (could_trap_p): New function. + (stmt_ends_bb_p): Handle flag_non_call_exceptions. + (make_exit_edges): Handle flag_non_call_exceptions. + (is_ctrl_altering_stmt): Handle flag_non_call_exceptions. + * tree-inline.c (walk_tree): Add case for CHAR_TYPE. + * tree-ssa-dce.c (stmt_useful_p): Keep all CATCH_EXPRs. + +2003-06-05 Jason Merrill + + * stmt.c (asm_op_is_mem_input): New fn. + * tree.h: Declare it. + * gimplify.c (simplify_asm_expr): Call resolve_asm_operand_names. + Use is_simple_modify_expr_lhs for mem input ops. + +2003-06-05 Frank Ch. Eigler + + * c-mudflap.c (mflang_register_call): Give the synthetic decl + undefined (not zero) size. + +2003-06-05 Frank Ch. Eigler + + * tree-mudflap.c (mx_flag): Remove. Update callers to use mf_mark. + (TREE_MUDFLAPPED_P): Remove. Update callers to use mf_marked_p. + (mf_mark, mf_marked_p): Replacement functions to replace old node + marking based on tree flag-bits. + (mf_mostly_copy_tree_r): Preserve markedness across copies. + * tree-mudflap.h: Add new decls + * c-mudflap.c (mx_flag): Remove. Update callers to use mf_mark. + +2003-06-04 Diego Novillo + + * tree-dfa.c (add_stmt_operand): Always consider non-scalar types + virtual operands. + +2003-06-04 Andrew MacLeod + + * toplev.c (parse_options_and_default_flags): Turn tree_copyprop on by + default. + * tree-cfg.c (linearize_control_structures, linearize_cond_expr, + replace_stmt, merge_tree_blocks, remap_stmts): Fix PROTOS. + (find_insert_location): Add additional basic block parameter. Handle + switch stmts. + (handle_switch_split): New. Split edges to switch labels. + (bsi_commit_first_edge_insert): Add extra parameter to + find_insert_location call. Fix split block chaining in THEN & ELSE. + * tree-ssa-live.c (calculate_live_on_entry): Process all PHI def's + after all the arguments have been processed. + * tree-ssa.c (struct ssa_stats_d, struct loops *loops, var_is_live, + rewrite_into_ssa): Remove old UNSSA code. + (rewrite_block): Remove stmt is rewrite_stmt returns 1. + (assign_vars): Remove abort and enable overlapping live ranges. + (replace_variable): New. Replace SSA name with the partition variable. + (rewrite_out_of_ssa): Use replace_variable(). + (dump_tree_ssa_stats): Remove old UNSSA code. + (rewrite_stmt): Return 1 if stmt should be deleted. Remove old + UNSSA code. + +2003-06-03 Diego Novillo + + * gimplify.c (simplify_call_expr): Move code to mark MD builtins + non-simplifiable... + * tree-simple.c (is_simple_call_expr): ... here. + +2003-06-03 Diego Novillo + + * c-parse.in: Fix botched merge. + +2003-06-03 Diego Novillo + + * tree-mudflap.c (MARK_TREE_MUDFLAPPED, TREE_MUDFLAPPED): + Use TREE_VISITED instead of TREE_BOUNDED. + * c-mudflap.c (TREE_MUDFLAPPED): Likewise. + * tree-pretty-print.c (dump_generic_node): Remove + references to TYPE_QUAL_BOUNDED. + +2003-06-03 Jason Merrill + + * gimplify.c (simplify_cond_expr): Call truthvalue_conversion + before invert_truthvalue. + +2003-06-02 Daniel Berlin + + * tree-dfa.c (compute_may_aliases): Call delete_alias_vars whenever we + call create_alias_vars. + + * tree-alias-common (ptr_may_alias_var): Cleanup determination of + global vars and whatnot. + +2003-06-02 Diego Novillo + + * Makefile.in (tree-ssa.o, tree-cfg.o): Add dependency on cfgloop.h + (tree-optimize.o): Remove dependency on cfgloop.h. + * basic-block.h (struct basic_block_def): Fix documentation for + field 'loop_father'. + * tree-dfa.c (add_referenced_var): Fix type of element + pushed into aliased_objects_alias_set. + * tree-optimize.c: Don't include cfgloop.h + (optimize_function_tree): Move code to initialize loop optimizer... + * tree-cfg.c (build_tree_cfg): ... here. + * tree-ssa.c: Include cfgloop.h. + (loops): New file local variable. + (rewrite_into_ssa): Initialize/finalize loop optimizer. + (rewrite_stmt): Call var_is_live when processing redundant + assignments to the same LHS. + (var_is_live): Add heuristic to discover overlapping definitions in + loops that do not have PHI nodes for VAR at the loop header. + +2003-06-02 Jason Merrill + + * gimplify.c (simplify_expr): Only allow a cast from a 'val'. + * tree-simple.c (is_simple_cast): Likewise. + +2003-06-02 Andrew MacLeod + + * tree-cfg.c (bsi_insert_before): Update end of block pointer if we + inserted before the last stmt in a block. (The container changed). + * tree-ssa.c (elim_backward): Inserting copy should be within + conditional check. + (elim_create): Only select one bit instead of the all. + +2003-06-01 Jason Merrill + + * Makefile.in: Remove lots of -Wno-error targets. + + * tree-simple.c (recalculate_side_effects): Check TREE_THIS_VOLATILE. + + * gimplify.c (simplify_compound_lval): Call + recalculate_side_effects on each of the subexpressions. + + * expr.c (expand_expr) : Use the if-statement code if + it's void. + +2003-06-01 Daniel Berlin + + * tree-alias-common.c: Remove setting of DECL_CONTEXT in temp vars, + it's done in create_tmp_alias_var for us. + (ptr_may_alias_var): Check if the variables are memory tags, and get + the associated pointers if they are. + +2003-05-30 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_c_function, enqueue_constant, enqueue_decl): + Rework dumping logic. + +2003-05-27 Jason Merrill + + * tree-ssa.c (avail_expr_hash): Simplify by using iterative_hash_expr + in more places. + * tree.c (iterative_hash_expr): Handle SSA_NAME. + +2003-05-29 Jeff Law + + * tree-ssa.c (rewrite_stmt): Detect and remove redundant + memory loads. + (avail_expr_hash): Use iterative_hash_expr, not iterative_hash_object + as needed. + +2003-05-27 Jason Merrill + + * gimplify.c (shortcut_cond_expr): Avoid jumps to jumps. + +2003-05-26 Jason Merrill + + * c-simplify.c (simplify_switch_stmt): A SWITCH_EXPR also gets the + source location of its first line. + +2003-05-24 Diego Novillo + + Do not consider INDIRECT_REF nodes to be variables. + + * gimplify.c (create_tmp_alias_var): Allow temporaries of + ARRAY_TYPE to be created. + Create new temporaries with function scope. + Don't call build_type_variant. + Mark the temporary volatile if its type is volatile. + + * tree-dfa.c: Change every function that received a variable and + its base symbol to just receive the variable. Update all callers. + (struct alias_set_d): Remove field 'tag_sym'. + Add documentation for fields. + (struct walk_state): Add field 'is_indirect_ref'. + Add documentation for fields. + (opf_ignore_bp): Remove. Update all users. + (aliased_objects_base): Remove. Update all users. + (get_stmt_operands): If the statement had virtual operands, do not + scan them again. + (get_expr_operands): Handle INDIRECT_REF nodes by adding an operand + for the memory tag represented and a use for the base pointer. + Don't add VUSE operands for pointer arguments to functions. + Force a virtual operand when processing ADDR_EXPR nodes. + (add_stmt_operand): If the variable is an alias tag, always add it + as a virtual operand. + Remove code to handle INDIRECT_REF nodes. + Move code to determine if a pointer may point to global memory to + find_vars_r. + Set has_volatile_ops flag in the statement when adding operands for + globals and local statics. + If the variable is an alias tag, mark the statement as making + aliased loads or stores. + (set_def): Mark the variable as having real references. + (add_use): Likewise. + (add_vdef): Remove code to re-add previous virtual operands. + If PREV_VOPS is set, don't add a new virtual operand. + (add_vuse): Likewise. + (dump_variable): Show annotation bitfields 'mem_tag', + 'occurs_in_abnormal_phi', 'is_alias_tag' and 'is_stored'. + (compute_may_aliases): Initialize walk_state.is_indirect_ref to 0. + (compute_alias_sets): Don't remove alias sets with exactly one + entry. + (register_alias_set): Re-implement to support memory tags instead + of INDIRECT_REF nodes. Document algorithm. + (find_alias_for): Likewise. + (may_alias_p): Likewise. + (add_may_alias): Likewise. + (find_vars_r): If a pointer assignment is found and the RHS of the + assignment may access global memory, mark the pointer as pointing + to global memory. + Handle INDIRECT_REF nodes by marking the base pointer as + dereferenced. + Do not share INDIRECT_REF nodes. + (add_referenced_var): Don't handle INDIRECT_REF nodes. + If called from a store operation, mark the variable as stored. + By default mark the variable as not having real references. + When processing a pointer that has been dereferenced, create a + memory tag for the pointer. + (add_indirect_ref_var): Remove. Update all callers. + (get_virtual_var): Don't handle INDIRECT_REF nodes. + (find_hidden_use_vars_r): + + * tree-flow-inline.h (get_var_ann): New function. Change all + functions that called var_ann and create_var_ann to call + get_var_ann. + (get_stmt_ann): Likewise. + (set_indirect_ref): Remove. Update all callers. + (indirect_ref): Remove. Update all callers. + (create_indirect_ref): Remove. Update all callers. + + * tree-flow.h (struct var_ann_d): Remove fields 'is_loaded', + 'unused' and 'indirect_ref'. + Add fields 'mem_tag', 'is_mem_tag', 'is_alias_tag' and + 'has_real_refs'. + (get_var_ann, get_stmt_ann): Declare. + (create_indirect_ref, set_indirect_ref, indirect_ref): Remove. + + * tree-pretty-print.c (dump_generic_node): Don't handle + INDIRECT_REF nodes inside SSA_NAME nodes. + + * tree-simple.c (get_base_symbol): Don't handle INDIRECT_REF nodes. + (is_simple_unary_expr): Don't call STRIP_NOPS. + + * tree-ssa-copyprop.c (get_original): Don't handle INDIRECT_REF + nodes. Allow pointers to be copy propagated. + + * tree-ssa-dce.c (need_to_preserve_store): Don't handle + INDIRECT_REF nodes. + + * tree-ssa-live.c (create_ssa_var_map): Only process variables that + have real references. + + * tree-ssa.c: Update documentation regarding INDIRECT_REF nodes. + (update_indirect_ref_vuses): Remove. Update all users. + (update_pointer_vuses): Remove. Update all users. + (MAY_COPYPROP_P): Remove. Update all users. + (create_temp): Don't handle INDIRECT_REF nodes. + (coalesce_ssa_name): Ignore variables that have no real references. + (rewrite_stmt): Mark the statement modified if a new copy or + constant was propagated into it. + Don't special-case pointers. + (rewrite_operand): Don't handle INDIRECT_REF nodes. + * tree.h (SSA_VAR_P): Remove. Update all users. + (SSA_DECL_P): Rename to SSA_VAR_P. + +2003-05-22 Jeff Law + + * gimplify.c (simplify_expr): Avoid gimplifying expressions which + are already in gimple form. + * tree-simple.c (is_simple_constructor): No longer treat TREE_STATIC + constructors specially. + (is_simple_addr_expr_arg): If we're taking the address of a label + for the first time, then the ADDR_EXPR is not in gimple form. + +2003-05-22 Jason Merrill + + * tree-cfg.c (compute_reachable_eh): Don't skip cleanups. + + * tree-dfa.c (add_referenced_var): Read-only INDIRECT_REFs can + also be clobbered by function calls. + +2003-05-22 Jeff Law + + * expr.c (convert_move): Avoid making silly copies. + (expand_expr, case BIND_EXPR): Correctly determine when the + result of the BIND_EXPR will not be used. + +2003-05-21 Jason Merrill + + * tree-cfg.c (compute_reachable_eh): Handle multiple CATCH_EXPRs. + + * builtins.c (simplify_builtin_next_arg): Split out from... + (expand_builtin_next_arg): ...here. + (simplify_builtin_va_start): Split out from... + (expand_builtin_va_start): ...here. + (simplify_builtin): Call it. + * gimplify.c (simplify_call_expr): If simplify_builtin worked, + just return. + +2003-05-20 Jason Merrill + + * gimplify.c (shortcut_cond_expr, shortcut_cond_r): Rewrite. + (simplify_cond_expr): Also invert ifs with no 'then'. + (build_and_jump): New fn, split out from... + (gimplify_exit_expr): ...here. Don't bother gimplifying the + condition. + + * gimplify.c (simplify_save_expr): Add post-effects to the + postqueue. + + * gimplify.c (mostly_copy_tree_r): Don't unshare constants. + +2003-05-20 Jeff Law + + * expr.c (expand_expr, case COND_EXPR): Avoid useless RTL generation + when the THEN or ELSE arm is empty. + + * tree-cfg.c (make_loop_expr_blocks): Do not accept next_block_link + as an argument, make it a local variable. Callers changed. + + * tree-cfg.c (remove_useless_stmts_and_empty_vars): Eliminate + GOTO_EXPRs which jump to the next statement occuring in an + outer control/block structure nest. + +2003-05-20 Diego Novillo + + * tree-ssa-ccp.c (set_rhs): Fix typo in handling of + RETURN_EXPR nodes. + +2003-05-19 Daniel Berlin + + * tree-alias-common.c (alias_get_name): Handle unnamed variables once + and for all. + +2003-05-19 Jeff Law + + * tree-ssa-dce.c (remove_conditional): If the conditional's block + has no post dominator in the CFG, then wire it to the exit node. + Avoid unnecessary check of bb->succ. + +2003-05-17 Daniel Berlin + + * tree-pretty-print.c (MASK_POINTER): Parameter is P, not node. + +2003-05-17 Daniel Berlin + + * tree-alias-common.c (get_alias_var): Handle REFERENCE_EXPR. + (find_func_aliases): Ditto. + (get_alias_var): Use POINTER_TYPE_P. + +2003-05-16 Frank Ch. Eigler + + * gcc.c (cc1_options): Correct "-fmudflapth" handling. + * tree-mudflap.c (mudflap_c_function, mf_build_check_statement_for): + Use locally cached mask/shift values only in single-threaded mode. + +2003-05-16 Daniel Berlin + + * tree-alias-common.c (ptr_may_alias_var): Fix DECL_CONTEXT + checking. + +2003-05-16 Andrew MacLeod + + * tree-flow.h (ssa_make_edge): Remove prototype. + * tree-ssa-dce.c (remove_dead_stmt): Change comment about removing + conditionals. + (remove_conditional): Don't update PHI nodes or call ssa_make_edge. + * tree-ssa.c (ssa_make_edge): Remove. + +2003-05-16 Jeff Law + + * tree-cfg.c (remove_useless_stmts_and_vars): Handle case where + both arms of an if-then-else simply jump to the same location. + + * tree-ssa-ccp.c (get_rhs): Correctly handle MODIFY_EXPR embedded in + a RETURN_EXPR. + (set_rhs): Likewise. + +2003-05-15 John David Anglin + + * Makefile.in (regmove.o-warn): Change to -Wno-error. + +2003-05-15 Andrew MacLeod + + * tree-cfg.c (enum find_location_action): Enum for find_insert_location. + (bsi_insert_before): Handle insert at start of a BB and update pointers + from parents if appropriate. + (find_insert_location): Handle COND_EXPR properly. Return + an enum type indicating what action to take on the returned value. + (bsi_commit_first_edge_insert): Use new returned action. + +2003-05-15 Jeff Law + + * tree-cfg.c (make_edges): Factor out loop invariants from + code to insert edges from the TRY to the FINALLY block. + Avoid creating unnecessary edges from the end of the + FINALLY block back to the start of the FINALLY block. + +2003-05-15 Diego Novillo + + * tree-ssa.c (rewrite_out_of_ssa): Undo previous patch. + +2003-05-15 Diego Novillo + + * tree-ssa.c (rewrite_out_of_ssa): Don't dump the optimized + function after the SSA->normal pass. + +2003-05-14 Toon Moene + + * Makefile.in: Add additional -Wno-error targets for Alpha. + +2003-05-13 Jason Merrill + + * gdbinit.in (pgs, pge): New macros. + + Implement expression temporary optimization. + * gimplify.c (gimplify_ctx): Add temp_htab field. + (push_gimplify_context): Initialize it. + (pop_gimplify_context): Destroy it. + (simplify_expr): If there's no internal postqueue, generate an + expression temporary. + (gimple_tree_hash, gimple_tree_eq): New fns. + (create_tmp_from_val, lookup_tmp_var): New fns. + (get_formal_tmp_var): New fn. + (internal_get_tmp_var): New fn. + (get_initialized_tmp_var): Use it. + * tree-simple.h: Declare it. + + * gimplify.c (simplify_cond_expr): Reorganize. + (shortcut_cond_expr, shortcut_cond_r): New fns. + (build_and_jump): New fn. + (gimplify_exit_expr): Use it. + + * gimplify.c (simplify_expr): Do better at stripping unnecessary + NOPs. Tidy GOTO_EXPR handling. Don't allow NON_LVALUE_EXPR. + * tree-simple.c (is_simple_modify_expr): Don't allow NON_LVALUE_EXPR. + (is_simple_binary_expr, is_simple_condexpr): Likewise. + (is_simple_unary_expr, is_simple_compound_lval): Likewise. + (is_simple_id): Likewise. + + * tree-ssa.c (rewrite_stmt): Discard redundant assignments. + (avail_expr_eq): Don't test ops1 == ops2. + (avail_expr_hash): Use iterative_hash_object. + +2003-05-13 Jeff Law + + * tree-cfg.c (cleanup_tree_cfg): Update comments. Set repeat + anytime we remove a control structure. + + * tree-flow.h (struct var_ann_d): New field occurs_in_abnormal_phi. + * tree-ssa.c (MAY_COPYPROP_P): Do not allow copy propagations + if either argument occurs in an abnormal phi. + * tree-dfa.c (add_phi_arg): Set occurs_in_abrnomal_phi as needed. + * tree-ssa-copyprop.c (copyprop_stmt): Do not allow copy + propagations if either argument occurs in an abnormal phi. + (copyprop_phi): Likewise. + +2003-05-12 Diego Novillo + + * c-common.h (STATEMENT_CODE_P): Use size_t cast instead + of int. + (INIT_STATEMENT_CODES): Change type of local variable i to + size_t. + +2003-05-12 Diego Novillo + + * c-pretty-print.c (dump_c_node): Call CONSTRUCTOR_ELTS + to access the operand of a CONSTRUCTOR node. + * tree-pretty-print.c (dump_generic_node): Likewise. + +2003-05-11 Diego Novillo + + * c-simplify.c (simplify_if_stmt): Replace calls to + warning_with_file_and_line with warning. + +2003-05-12 Frank Ch. Eigler + + * toplev.c (lang_independent_options): Add "-fmudflapth". + * flags.h (flag_mudflap): Document meaning of >1 value. + * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): Add -fmudflapth support. + (cpp_unique_options, cc1_options): Ditto. + +2003-05-10 Sebastian Pop + + * gimplify.c (simplify_expr): Replace CONST_DECL with its DECL_INITIAL. + +2003-05-09 Sebastian Pop + + * tree-optimize.c (optimize_function_tree): Clarify the use of the + loop analyzer. + +2003-05-09 Jeff Law + + * c-simplify.c (simplify_cleanup): Remove code which optimizes + TRY_FINALLY and TRY_CATCH. It doesn't trigger. + + * tree-cfg.c (remove_useless_stmts_and_vars): Optimize away + TRY_CATCH and TRY_FINALLY blocks when possible. + +2003-05-09 Diego Novillo + + * tree-pretty-print.c (dump_generic_node): CONSTRUCTOR + nodes have only one operand now. + +2003-05-08 Andrew MacLeod + + * tree-cfg.c (pdom_info): New file level static. + (cleanup_tree_cfg): Free dominance info, if it was used. + (bsi_replace): New. Replace a stmt with a new one. + (linearize_cond_expr): Use post dominator info to determine is a + conditional can be safely removed. + (find_insert_location): New. Determine where to insert a new stmt that + is placed on a split edge. + (bsi_commit_first_edge_insert): Use find_insert_location to determine + where to link a stmt when splitting an edge. + (merge_tree_blocks): When deleting a basic block, remove it from the + dominance structure if it exists. + * tree-dfa.c (add_stmt_operand): Don't rename local statics. Treat + them just like globals. + * tree-flow.h (struct var_ann_d): Add root_var_processed bit and + root_index fields. + * tree-ssa-dce.c (process_worklist): Mark conditions feeding PHI's as + necessary as well. + (remove_dead_phis): Add missing debug information. + * tree-ssa-live.c (var_union): Handle combining partitions when one + has a root_variable as a representative. + (compact_var_map): Add comments and use flags. + (init_root_var): Use new root_var fields in struct var_ann_d. + (dump_root_var): Send output to specified file, not stderr. + (dump_var_map): Remove dump_flag parameter & some grotesque debug info. + * tree-ssa-live.h (VAR_ANN_ROOT_INDEX): Define. + (VARMAP_NORMAL, VARMAP_NO_SINGLE_DEFS): Define flags for compact_var_map. + (var_to_partition_to_var): Return NULL if not in a partition. + (find_root_var): Use VAR_ANN_ROOT_INDEX. + * tree-ssa.c (insert_copy_on_edge): Add listing info. + (coalesce_ssa_name): Coalesce live-on-entry variables to their root. + Coalesce partitions across abnormal edges. + (assign_vars): Remove redundant initialization code. Handle root_vars + which have already been coalesced to a partition. + (rewrite_out_of_ssa): Add debug info & remove PHI nodes when processed. + (rewrite_stmt): Don't redefine redundant expressions. + +2003-05-08 Jeff Law + + * c-simplify.c (simplify_expr_stmt): Make sure to + simplify the body of the EXPR_STMT. + + * tree-dfa.c (remove_decl): Accept new argument for the block + to start the search. + * tree-flow.h (remove_decl): Update prototype. + * tree-cfg.c (remove_stmt): Pass the toplevel block to + remove_decl. + + * tree-dfa.c (find_hidden_use_vars): No longer returns a value. + Callers and prototype updated. No longer need to look for + nested functions, instead just mark any variables and + parameters with DECL_NONLOCAL set as having hidden uses. + +2003-05-08 Diego Novillo + + * version.c (version_string): Change format to show daily + datestamp and merged date. + +2003-05-07 Jeff Law + + * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove + the toplevel BIND_EXPR for an inlined function. + + * tree-dfa.c (find_hidden_use_vars): Look at the size of + VAR_DECLs, not the size of ARRAY_TYPES. Also make sure + to reset *inside_vla to its original value when done + processing any particular VAR_DECL. + +2003-05-06 Diego Novillo + + * c-simplify.c (simplify_if_stmt): Warn if + -Wunreachable-code is given and the conditional is always + true or always false. + + * expr.c (expand_expr): Don't try to expand FUNCTION_DECL + nodes when processing BIND_EXPR_VARS. + + * varasm.c (output_constant_def_contents): Re-use the + label when emitting a label for mudflap. + + Disable the following patch: + + 2003-04-30 Steven Bosscher + + * ggc-page.c (TREE_EXP_SIZE): Define. + (extra_order_size_table): New entry for expr trees with + two operands. + +2003-05-06 Jeff Law + + * tree-cfg.c (make_exit_edges): Fix handling of blocks which + end with calls. + + * tree-cfg.c (remove_useless_stmts_and_vars): Remove GOTO_EXPRs + to the immediately following tree node. + + * tree-cfg.c (make_goto_expr_edges): Fix typo in comment. + (remove_useless_stmts_and_vars): New function. + * tree-flow.h (remove_useless_stmts_and_vars): Prototype. + * tree-ssa.c (rewrite_out_of_ssa): After returning to normal + form, call remove_useless_stmts_and_vars. + +2003-05-02 Daniel Berlin + + * tree-alias-common.c (alias_get_name): Given unnamed result decls + a name. + (create_fun_alias_var): Use DECL_RESULT if available. + +2003-05-02 Jeff Law + + * tree-inline.c (expand_call_inline): Avoid creating naked + _DECL nodes for inlined functions which had NRV optimizations + applied. + +2003-05-02 Diego Novillo + + * tree-cfg.c (build_tree_cfg): Update comment. + (make_blocks): Don't skip over empty statements. + Move exception handling code ... + (compute_reachable_eh): ... here. + (set_parent_stmt): Don't skip over empty statements. + (bsi_remove): Don't return early on empty statements. + Don't call STRIP_NOPS. + (remove_stmt): Don't call STRIP_NOPS. + Always compute the block holding the statement. + After replacing the statement with an empty statement, add the + empty statement to the block. + (successor_block): Don't call STRIP_NOPS. + (first_exec_stmt): Likewise. + (first_exec_block): Don't return early for empty statements. + (first_stmt): Don't test for NULL blocks. + Reformat to improve legibility. + (bsi_next_in_bb): Don't call STRIP_NOPS. + Reformat to improve legibility. + (set_bb_for_stmt): Don't ignore empty statements. + + * tree-dfa.c (get_stmt_operands): Don't call STRIP_NOPS. + (create_stmt_ann): Don't abort on emtpy statements. + Don't call STRIP_NOPS. + (copy_stmt): Remove unused function. + * tree-flow.h (copy_stmt): Remove prototype. + + * tree-flow-inline.h: Don't call STRIP_NOPS. + Remove local variable 't'. + (bsi_stmt): Don't return NULL_TREE for empty statements. + Ignore error_mark_node. + + * tree-iterator.h (tsi_next): Don't call STRIP_NOPS. + (tsi_stmt_ptr): Likewise. + (tsi_stmt): Likewise. + Don't return NULL_TREE for empty statements. + + * tree-pretty-print.c (dump_generic_node): Don't ignore empty + statements. + + * tree-ssa-ccp.c (fold_stmt): Don't call STRIP_NOPS. + * tree-ssa-dce.c (find_useful_stmts): Likewise. + (remove_dead_stmt): Likewise. + * tree-ssa.c (mark_def_sites): Likewise. + (rewrite_out_of_ssa): Likewise. + (rewrite_stmt): Likewise. + + * tree.c (make_ssa_name): Don't ignore empty statements. + (body_is_empty): Fix comment. + +2003-05-01 Jeff Law + + * tree-dfa.c (find_hidden_use_vars): Renamed from find_vla_decls. + Now returns a value indicating if nested function was found. + When nested functions are found, mark suitable variables as + having hidden uses. + (find_hidden_use_vars_r): Renamed from find_vla_decls_r. + (compute_may_alias): Corresponding changes. Handle + multiple BLOCKs at the toplevel of a function. + +2003-04-30 Diego Novillo + + * tree.c (build_empty_stmt): New function. + * tree.h (IS_EMPTY_STMT): Define. + (TI_EMPTY_STMT): Remove. + (empty_stmt_node): Remove. + Replace 'X = empty_stmt_node' with 'X = build_empty_stmt ()', + and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everywhere. + (build_empty_stmt): Declare. + + * cp/cp-simplify.c (cp_simplify_stmt): Use IS_EMPTY_STMT. + + * java/java-tree.h (build_java_empty_stmt): Declare. + * java/expr.c (build_java_empty_stmt): New function. + * java/decl.c (java_init_decl_processing): Don't build empty_stmt_node. + Replace 'X = empty_stmt_node' with 'X = build_java_empty_stmt ()', + and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everwhere. + +2003-04-30 Jeff Law + + * tree-dfa.c (get_expr_operands): Do not ignore operands of an + an ADDR_EXPR if it is a PARM_DECL or VAR_DECL. + + * tree-dfa.c (get_expr_operands): Look inside operands in + a TREE_LIST. + +2003-04-29 Diego Novillo + + * builtins.def (BUILTIN_CONSTANT_P): Mark as constant. + + * tree-dfa.c (get_expr_operands): Do not add VDEF operands for + dereferenced pointers at call sites. + * tree-ssa.c (assign_vars): Abort if we couldn't coalesce all the + versions together. + +2003-04-29 Andrew MacLeod + + * tree-cfg.c (bsi_start): If there are no stmts in a block, use the + context pointer to represent the basic block. + (bsi_insert_after): Handle inserting into empty blocks better. + (bsi_insert_before): Call bsi_insert_after to handle empty blocks. + * tree-ssa.c (elim_create): Clear bitmap after its been processed + instead of during loop. + +2003-04-27 Diego Novillo + + * Makefile.in (tree-mudflap.o): Add dependency on $(TREE_DUMP_H). + * c-decl.c (c_expand_body_1): Don't call simplify_function_tree + after mudflap_c_function. + Move mudflap instrumentation after SSA optimizers. + * tree-dump.c (dump_files): Add entry for -fdump-tree-mudflap. + * tree.h (enum tree_dump_index): Add TDI_mudflap. + * doc/invoke.texi: Document -fdump-tree-mudflap. + * tree-mudflap.c: Include tree-dump.h. + (dump_file): New local variable. + (dump_flags): New local variable. + (mudflap_c_function): Call dump_begin, dump_end and dump_function. + (mf_decl_cache_locals): Set DECL_CONTEXT for __mf_lookup_shift_l + and __mf_lookup_mask_l to current_function_decl. + (mf_offset_expr_of_array_ref): Likewise for __mf_index_X. + (mf_build_check_statement_for): Re-implement to emit a proper + STMT_EXPR. + (mx_xfn_indirect_ref): Emit detailed debugging info if + -fdump-tree-mudflap-details is given. + (mudflap_enqueue_decl): Likewise + * tree-optimize.c (optimize_function_tree): Don't check for + -fmudflap. + +2003-04-26 Diego Novillo + + * c-simplify.c (build_bc_goto): If the target label couldn't be + found, emit an error message. + +2003-04-25 Andrew MacLeod + + * tree-ssa-live.c (compact_var_map): Add parameter to exclude variables + with a single SSA version. + (init_root_var): Allow that a var_map might not be compacted yet. + * tree-ssa-live.h (compact_var_map): Change Prototype. + * tree-ssa.c (rewrite_out_of_ssa): When coalescing, don't include single + reference variables during the compaction. + +2003-04-25 Jeff Law + + * tree-optimize.c (optimize_function_tree): Simplify slightly. + +2003-04-25 Andrew MacLeod + + * tree-ssa.c (struct _elim_graph): Change type of fields + 'pred' and 'succ' to be bitmaps instead of sbitmaps. + Update all uses. + +2003-04-25 Diego Novillo + + * tree-cfg.c (linearize_cond_expr): Reformat. + * tree-dfa.c (get_expr_operands): Check for read-only + status the dereferenced argument pointer, not the pointer + itself. + (add_stmt_operand): Always consider global variables as + virtual operands. + +2003-04-24 Jason Merrill + + * gimplify.c (simplify_cond_expr): Avoid redundant gimplification. + + Add TREE_VEC of case labels to the SWITCH_EXPR during gimplification. + * tree.def (CASE_LABEL_EXPR): Add an operand for the LABEL_DECL. + * tree.h (SWITCH_LABELS, CASE_LABEL): New macros. + * c-simplify.c (c_simplify_stmt) : Create LABEL_DECL here. + * expr.c (expand_expr) : Not here. + * gimplify.c (gimplify_ctx): Add case_labels field. + (gimplify_switch_expr, gimple_add_case_label): New fns. + (simplify_expr): Use them. + +2003-04-24 Andrew MacLeod + + * tree-flow.h (processed_out_of_ssa): Rename to out_of_ssa_tag. + * tree-ssa-live.c (register_ssa_partition): Add variable to partition. + (change_partition_var): Use out_of_ssa_tag. + (create_ssa_var_map): Add all uses, defs and PHI elements to partition. + (new_tree_live_info): Create a live range info structure. + (delete_tree_live_info): Free storage. + (live_worklist): Fill in the live range info for a variable for the + blocks between the def and all the blocks containing uses. + (set_if_valid): Set partition bit if variable is in a partition. + (add_livein_if_notdef): Set live on entry bit for a var's partition + if a definition has not been seen. + (calculate_live_on_entry): Create partition live on entry bitmaps for + all basic blocks . + (calculate_live_on_exit): Calculate live on exit information for each + basic block. + (init_root_var): Initialize and fill in a root_var structure. + (remove_root_var_partition): remove a partition from a root_var list. + (delete_root_var): Free storage. + (dump_root_var): Display root_var summary. + (dump_var_map): Show extra info for ssa name versions. + * tree-ssa-live.h (NO_PARTITION): Define. + (register_ssa_partition): Remove. + (partition_to_var): Use partition_find after decompressing. + (var_to_partition): Return NO_PARTITION if var is not in a partition. + (struct tree_live_info_d): Define live range info structure. + (partition_is_global): Return 1 if used outside a basic block. + (live_entry_blocks): Return bitmap over blocks that partition is live + on entry to. + (live_on_exit): Return bitmap of partitions live on exit from a block. + (struct root_var_d): Define a root_var structure. + (ROOT_VAR_NONE): Define. + (num_root_vars): Number of variables in root_var object. + (root_var): Return variable for a root_var index. + (first_root_var_partition): Return first partition for a root_var. + (next_root_var_partition): Get next partition for a root_var. + (find_root_var): Find root_var index for a specific partition. + * tree-ssa.c (eliminate_extraneous_phis): Remove. + (set_if_valid): Set partition bit if variable is in a partition. + (add_conflicts_if_valid): Add conflict between variable and all + related partitions set in a bitvector. + (coalesce_ssa_name): Create a conflict graph and coalesce all + partitions which don't conflict and are related by the same root_var. + (assign_vars): Use a root_var object, and assign different real + variables to all partitions. + (rewrite_out_of_ssa): Call compact_var_map() once, and don't call + eliminate_extraneous_phis. + +2003-04-23 Daniel Berlin + + * tree-flow.h (create_global_var): Add prototype. + + * tree-dfa.c (create_global_var): Externalize. + + * tree-alias-common.c: Set DECL_CONTEXT on our temp alias vars. + (call_may_clobber): Make a copy of this function, since our version + will be slightly different soon. + (create_alias_vars): We need global_var, so create it if necessary. + +2003-04-23 Daniel Berlin + + * tree-ssa-pre.c (do_proper_save): Remove old code, since the new + insertion code works okay. + (pre_expression): Use new_rename_1, it removes a *lot* of useless + saves. + +2003-04-23 Jeff Law + + * gimplify.c (simplify_target_expr): Make sure to simplify + the cleanup too. + + * tree-ssa.c (struct def_blocks_d): Add new field phi_insertion_points. + (compute_global_livein): Accept varray rather than bitmaps. Callers + updated. Rewrite to compute global life information for all the + objects in the varray in parallel. + (insert_phis_for_deferred_variables): New function. + (insert_phi_nodes_for): New argument DEF_MAPs. When an object + crosses the threshold for using fully pruned PHI insertions, + push it on the def_maps varray for deferred processing. + (insert_phi_nodes): Initialize def_maps. Pass it to + insert_phi_nodes_for. Drain the def_maps varray as it grows. + Also drain any residual objects in def_maps. Zero def_maps + when complete. + +2003-04-21 Jeff Law + + * tree-cfg.c (find_contained_blocks_and_edge_targets): New function. + (try_finallys): New varray used during edge creation. + (make_edges): Initialize try_finallys varray. After creating + all the "normal" edges, go back and create the special edges + for the try-finally blocks. + (make_ctrl_stmt_edges): Create edges for the EH nodes. Also + make sure to build the try-finally stack. + (make_exit_edges): Create edges from calls which may throw + to any directly reachable exception handlers. + (is_ctrl_altering_stmt): Statements which may throw alter + flow control. + + * tree-cfg.c: Include except.h. + (eh_stack): New file-scoped varray. + (build_tree_cfg): Initialize eh_stack. + (make_catch_expr_blocks): New function. + (make_try_expr_blocks, make_eh_filter_expr_blocks): Likewise. + (make_blocks): Call new functions as needed. When ending a block + due to a statement that may throw, compute the reachable exception + handlers and store it in the statement's annotation. + (is_ctrl_stmt): Handle EH nodes. + (stmt_ends_bb_p): Likewise. + * tree-flow.h (stmt_ann_d): Add new field reachable_exception_handlers. + + * except.c (check_handled): No longer static. + * except.h (check_handled): Prototype. + + * c-simplify.c (c_build_bind_expr): Revert change from earlier today. + + * c-common.h (find_reachable_label): Prototype. + * c-semantics.c (find_reachable_label): No longer static. + * c-simplify.c (c_build_bind_expr): Avoid creating unnecessary + BIND_EXPRs. + (simplify_cleanup): Avoid creating unnecessary TRY_CATCH_EXPRs + or TRY_FINALLY_EXPRs. + (simplify_if_stmt): If the condition is constant and the + unexecuted arm has no reachable code, then just emit + the executed arm. + +2003-04-18 Sebastian Pop + + * cfghooks.h, cfghooks.c: New files. + * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h. + (OBJS): Add cfghooks.o. + (tree-optimize.o): Depends on cfgloop.h. + (cfghooks.o): New rule. + * basic-block.h (split_edge): Rename to rtl_split_edge. + (tree_split_edge): Declare. + (create_bb): Declare extern here. + (verify_flow_info): Rename to rtl_verify_flow_info. + (tree_verify_flow_info): Declare. + (cfghooks.h): Included here. + * cfgloop.c (tree.h, tree-flow.h): Included. + (make_forwarder_block): Renamed to rtl_make_forwarder_block. + (tree_make_forwarder_block): New static function. + (blocks_headers): Declared static. + (HEADER_BLOCK): Use blocks_headers instead of bb's .aux field. + (redirect_edge_with_latch_update, make_forwarder_block, + canonicalize_loop_headers): Don't allocate .aux, but makes grow + the blocks_headers array. + (canonicalize_loop_headers): Register tree_make_forwarder_block + into the tree_cfg_hooks and rtl_make_forwarder_block into the + rtl_cfg_hooks structure. + (canonicalize_loop_headers): Initialize/free the blocks_headers + array rather than the bb's .aux field. + * cfgloopmanip.c (loop_split_edge_with_NULL): New static function. + (remove_path, force_single_succ_latches): + Call loop_split_edge_with_NULL instead of loop_split_edge_with. + * cfgrtl.c (split_block): Update the comment. + (split_edge): Renamed rtl_split_edge. + (verify_flow_info): Renamed rtl_verify_flow_info. + * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): + Execute code following the value of cfg_level. + * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks. + * tree-cfg.c (create_bb): Declared extern. + (build_tree_cfg): Call tree_register_cfg_hooks. + (make_edges, make_exit_edges): Remove the use of EDGE_FALLTHRU. + (bsi_commit_first_edge_insert): Use split_edge. + (tree_split_edge, tree_verify_flow_info): New functions. + * tree-optimize.c (cfgloop.h): Included. + (optimize_function_tree): Add #if 0'ed calls to + loop_optimizer_init and loop_optimizer_finalize. + +2003-04-16 Jeff Law + + * Makefile.in (tree-ssa.o): Depend on langhooks.h. + (tree-dfa.o, tree-cfg.o): Likewise. + * tree-cfg.c: Include langhooks.h + (dump_tree_cfg): Revamp how we get the current function's name + to not rely on current_function_name (and implicitly cfun). + (dump_cfg_stats, tree_cfg2dot): Likewise. + * tree-dfa.c: Include langhooks.h + (dump_immediate_uses): Revamp how we get the current function's name + to not rely on current_function_name (and implicitly cfun). + (dump_dfa_stats, dump_alias_info): Likewise. + * tree-ssa.c: Include langhooks.h + (dump_tree_ssa): Revamp how we get the current function's name + to not rely on current_function_name (and implicitly cfun). + + * tree-cfg.c (make_loop_expr_blocks): When determining the value for + NEXT_BLOCK_LINK, correctly handle empty statement nodes at the + end of the tree. + (make_cond_expr_blocks, make_switch_expr_blocks): Likewise. + (make_bind_expr_blocks): Likewise. + + * gimplify.c (keep_function_tree_in_gimple_form): Move check of + flag_disable_simple here. Include flags.h. + * Makefile.in (gimplify.o): Depends on flags.h + * c-decl.c (c_expand_body_1): No longer check flag_disable_simple. + * tree-inline.c (copy_body_r): Avoid creating non-gimple code + when inlining a function where the RESULT_DECL's initialization + is not on the RETURN_EXPR. + +2003-04-15 Jeff Law + + * tree-flow.h (struct var_ann_d): Renamed is_vla_decl field to + has_hidden_use. + (has_hidden_use, set_has_hidden_use): Renamed from is_vla_decl + and set_vla_decl. + * tree-flow-inline.h (has_hidden_use): Renamed from is_vla_decl. + Updated to use "has_hidden_use" instead of "is_vla_decl" field. + (set_has_hidden_use): Renamed from set_vla_decl. + Updated to use "has_hidden_use" instead of "is_vla_decl" field. + * tree-dfa.c (dump_variable): Corresponding changes. + (find_vla_decls_r): Likewise. + * c-simplify.c (simplify_decl_stmt): Likewise. + * tree-ssa-dce.c: Likewise. + +2003-04-09 Jeff Law + + * tree-dfa.c (struct alias_set_d, field tag_sym_set): Remove + unused field. + (register_alias_set): Rework to avoid incorrect coalescing of + entries. Fix memory leak. No longer set field tag_sym_set. + (get_expr_operands): ADDR_EXPR expressions may have interesting + operands in some cases. + +2003-04-09 Diego Novillo + + * gimplify.c (simplify_expr): Handle VECTOR_CST nodes. + * tree-cfg.c (make_blocks): Ignore empty statement containers. + Create a basic block before processing containers that only have + empty statements. + (make_loop_expr_blocks): Use the container instead of the statement + when setting NEXT_BLOCK_LINK. + (make_cond_expr_blocks): Likewise. + (make_switch_expr_blocks): Likewise. + (make_bind_expr_blocks): Likewise. + (successor_block): If the last statement of the block is the empty + statement, use its container to get NEXT_BLOCK_LINK. + (stmt_starts_bb_p): Return false if the statement is NULL. + * tree-pretty-print.c (dump_generic_node): Handle VECTOR_CST nodes. + * tree-simple.c (is_simple_const): Accept VECTOR_CST as constants. + * objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): + Define. + +2003-04-06 Diego Novillo + + * tree-cfg.c (remove_bb): Call ssa_remove_edge. + (cleanup_cond_expr_graph): Likewise. + (cleanup_switch_expr_graph): Likewise. + (disconnect_unreachable_case_labels): Likewise. + (merge_tree_blocks): Likewise. + Update PHI nodes at BB2's successor. + (dump_tree_bb): Show PHI nodes in the block. + * tree-dfa.c (add_phi_arg): Update comment. + (remove_phi_arg_num): New function. + (remove_phi_arg): Call it. + Move from tree-ssa.c. + (remove_phi_node): Move from tree-ssa.c. + * tree-flow.h (ssa_make_edge): Declare. + (ssa_remove_edge): Declare. + * tree-pretty-print.c (dump_generic_node): Show block where PHI + arguments are coming from. + * tree-ssa-dce.c (pdom_info): New local variable. + (remove_dead_stmts): Initialize it and free it at the end. + (remove_conditional): New function. + (remove_dead_stmt): Call it. + * tree-ssa.c (eliminate_phi): If the edge index is -1, abort + compilation. + (ssa_remove_edge): New function. + (ssa_make_edge): New function. + +2003-04-06 Andrew MacLeod + + * tree-cfg.c (push_bsi): New. Push a block_stmt_iterator onto a stack. + (pop_bsi): New. Pop a block_stmt_iterator off a stack. + * tree-flow-inline.h (struct bsi_list_d): Block iterator stack struct. + (new_bsi_list): Start a new bsi stack. + (empty_bsi_stack): Is stack empty. + (FOR_EACH_BSI_IN_REVERSE): Macro for processing bsi's in reverse. + (FOR_EACH_STMT_IN_REVERSE): Macro for processing stmt's in reverse. + +2003-04-06 Andreas Jaeger + + * treelang/treetree.c (tree_code_create_function_initial): Replace + calls to non-existent function annotate_with_file_line_column with + calls to annotate_with_file_line. + (tree_code_create_variable): Likewise. + +2003-04-05 Diego Novillo + + * tree-dfa.c (get_expr_operands): Do not clobber readonly operands + in CALL_EXPRs. + (find_vars_r): Likewise. + (add_indirect_ref_var): When creating new INDIRECT_REF variables, + copy the readonly attribute from the variable's type. + +2003-04-05 Diego Novillo + + * tree.c (copy_node): Never copy tree annotations. + +2003-04-05 Diego Novillo + + * tree-ssa-ccp.c (visit_cond_stmt): Don't short circuit evaluation + of UNDEFINED conditional expressions. + +2003-04-04 Andrew MacLeod + + * Makefile.in : Add tree-ssa-live.c and tree-ssa-live.h files. + * tree-ssa.c (struct _var_map, create_var_map, delete_var_map, + var_from_partition, get_var_partition, mapped_var_from_ref, + compact_var_map, dump_tree_partition, set_partition_for_var, + set_var_mapping, create_var_partition): Remove. + (create_temp): Allow temps to be created from SSA_NAME vars as well. + (eliminate_name, eliminate_build, elim_backward, elim_create, + eliminate_phi): Use new var map interface. + (coalesce_ssa_name): New. Coalesce ssa_name ranges together. + (assign_vars): Assign real variables to ssa_name partitions. + (rewrite_out_of_ssa): Use new varmap partition and routines. + * tree-ssa-live.h: New file + (var_map): Structure for variable map. + (num_var_partitions): Number of partitions. + (partition_to_var): Return variable for partition. + (var_to_partition): Return partition variable is in. + (var_to_partition_to_var): Return variable representing partition + another variable is in. + (register_ssa_partition): Initialize a partition element as used. + * tree-ssa-live.c: New file. + (init_var_map): Initialize a var_map. + (delete_var_map): Free storage for a var_map. + (var_union): Combine 2 partitions. + (compact_var_map): Reduce the number of partitions in a var_map. + (change_partition_var): Assign a specific var to a partition. + (create_ssa_var_map): Initialize a var_map with referenced variables. + (dump_var_map): Debug output for a var_map. + +2003-04-03 Diego Novillo + + * fold-const.c (fold_relational_hi_lo): Add missing comparison when + folding comparisons to signed_max+1. + +2003-04-02 Jason Merrill + Diego Novillo + + * tree-inline.c (initialize_inlined_parameters): Cast argument + types appropriately when emitting initialization assignments. + +2003-04-01 Andrew MacLeod + + * tree-cfg.c (PENDING_STMT, SET_PENDING_STMT): New Macros. + (bsi_insert_on_edge): Rename to bsi_commit_first_edge_insert. Add an + empty annotation record to the new basic_block. + (bsi_commit_edge_inserts): New. Commit all pending edge inserts. + (bsi_insert_on_edge): New. Add stmt to edge's pending insert list. + * tree-flow-inline.h (phi_arg_from_edge): Return PHI index for an edge. + (phi_element_for_edge): Return PHI element for an edge. + * tree-flow.h (struct var_ann_d): Add auxiallary field and new + bit 'processed_out_of_ssa'. + * tree-ssa.c (_var_map): Structure for variable parition map. + (struct _elim_graph): Elimination graph for out-of-ssa pass. + (create_var_map): Create a new var_map. + (delete_var_map): Delete a var_map. + (var_from_parition): Return var for a specified partition. + (get_var_partition): Return partition a var belongs to. + (mapped_var_from_ref): Get root var for a var's partition. + (compact_var_map): Re-map the partitions to make the list dense. + (dump_var_parition): Print var_map. + (set_partition_for_var): Associate a real var with a partition. + (set_var_mapping): Associate an SSA version var with a real var. + (create_var_partition): Create a partition for processing. + (create_temp): Create a new temp variable for a partition. + (insert_copy_on_edge): Insert a copy between variables on an edge. + (new_elim_graph): Create a new elimination graph. + (clear_elim_graph): clear an elimination graph. + (delete_elim_graph): Delete an elimination graph. + (eliminate_name, eliminate_build, elim_forward, + elim_unvisited_predecessor, elim_backward, elim_create, + eliminate_phi): Routines to implement Morgans PHI elimination algorithm. + (eliminate_extraneous_phis): Eliminate PHI nodes which will never + generate code. + (rewrite_out_of_ssa): Use partitions and PHI elimination algorithm. + +2003-04-01 Jeff Law + + * tree-cfg.c (make_blocks): Make sure the BIND_EXPR's subgraph + actually ended in a statement before seeing of the statement should + end a basic block. + + * tree-cfg.c (dump_tree_cfg): Avoid crashing when cfun is NULL. + (tree_cfg2dot): Likewise. + * tree-dfa.c (dump_immediate_uses): Likewise. + * tree-pretty-print.c (dump_generic_node): Dump the EH_FILTER_FAILURE + nodes attached to an EH_FILTER_EXPR. + + * tree-dfa.c (get_stmt_operands): Add cases for TRY_FINALLY_EXPR, + TRY_CATCH_EXPR, CATCH_EXPR and EH_FILTER_EXPR. + (get_expr_operands): Add case for EXC_PTR_EXPR. + + * tree-dfa.c (compute_may_aliases): Accept FNDECL as an argument. + Use FNDECL instead of relying on CURRENT_FUNCTION_DECL. + * tree-flow.h (compute_may_aliases): Update prototype. + * tree-ssa.c (rewrite_into_ssa): Corresponding changes. + + * tree-inline.c (expand_calls_inline): Correctly handle EH_FILTER_EXPR. + +2003-03-31 Diego Novillo + + * Makefile.in (STRICT_WARN, STRICT2_WARN): Remove -Wtraditional. + * timevar.def (TV_TREE_CLEANUP_CFG): Define. + * tree-cfg.c (set_parent_stmt): Add documentation. + (replace_stmt): New function. + (merge_tree_blocks): New function. + (remap_stmts): New function. + (linearize_cond_expr): New function. + (linearize_control_structures): New function. + (cleanup_tree_cfg): Call it. + Use new timevar TV_TREE_CLEANUP_CFG. + (remove_bb): Update debugging message. + Make sure that bb->head_tree_p and bb->end_tree_p exist before + resetting their basic blocks. + (remove_stmt): When removing a control flow expression, update + basic block flags. + (cleanup_control_flow): Make sure that the block contains + statements. + (last_stmt): Reformat for readability. + (last_stmt_ptr): Return NULL if the block has no statements. + * tree-flow-inline.h (parent_block): Check that the block is not + empty. + * tree-flow.h (bb_empty_p): Remove. + * tree-inline.c (copy_tree_r): Do not copy empty_stmt_node. + * tree-ssa-dce.c (tree_ssa_dce): Call cleanup_tree_cfg. + * tree.c (body_is_empty): New function. + * tree.h (body_is_empty): Declare. + +2003-03-31 Jeff Law + + * tree-ssa-ccp.c (simulate_block): Add abnormal edges out of a + block to the edge worklist after simulating a block for the + first time. If the block has a single outgoing normal edge, + add that edge to the worklist after simulating the block for + the first time. + +2003-03-31 Frank Ch. Eigler + + * gcc.c (MFLIB_SPEC): Remove -ld. + (MFWRAP_SPEC): Remove dlopen wrapping. + +2003-03-28 Diego Novillo + + * tree-ssa.c (rewrite_block): Add new argument 'eq_expr_value'. + Update all users. + If 'eq_expr_value' is given, use it to register a new + value for the variable given on the LHS. + If the block ends in a conditional expression of the form 'X == Y', + propagate 'X = Y' into the THEN_CLAUSE. + (MAY_COPYPROP_P): Define. + (rewrite_stmt): Call it. + (register_new_def): Fix comment. + (get_eq_expr_value): New function. + +2003-03-28 Diego Novillo + + * basic-block.h (BB_COMPOUND_ENTRY): Remove. Update all users + everywhere. + * tree-cfg.c: Minor fixes to various comments. + * tree-optimize.c (optimize_function_tree): Dump optimized function + after SSA->normal conversion. + +2003-03-26 Daniel Berlin + + * tree-ssa-pre.c: Implement open64 renaming algorithm. + (subst_phis): New function. + (generate_expr_as_of_bb): Ditto. + (new_rename_1): Ditto. + (process_delayed_rename): Ditto. + (do_proper_save): Use bsi_* functions for insertion, don't remove + old code quite yet, haven't fully tested. + Also add argument that says whether to insert before use or after use. + (defs_y_dom_x): Factor through injuries properly. + (defs_match_p): Ditto. + (phi_opnd_from_res): Attempt to fix, and remove useless argument. + (reset_can_be_avail): Fix broken condition that would cause infinite + loop. + (update_old_new): #if 0 updating of bb heads. + (finalize_1): We occasionally get 5 + a rather than a + 5, so we + need to make sure 5 is a DECL before trying to get a reaching def. + (repair_use_injury): If we couldn't find a reaching def, we don't need + to repair it. + (assign_new_class): Only push to stack2 if it exists (so we can + share this function in both rename implementations). + (create_ephi_node): Add argument that says whether to add ephi + to block or not (we create them sometimes for validation only). + (tree_perform_ssapre): Skip expressions without any uses. + + * tree.h: Add EREF_DELAYED_RENAME. + (struct tree_eref_common): Add delayed_rename bit. + +2003-03-25 Diego Novillo + + * tree-simple.c: Use tree codes to document grammar for relational + operators &&, || and ^. + +2003-03-25 Diego Novillo + + * cfg.c (dump_edge_info): Add labels for EDGE_TRUE_VALUE, + EDGE_FALSE_VALUE and EDGE_EXECUTABLE. + * tree-cfg.c (dump_tree_bb): Change formatting. Show all + statements in the block. + * tree-simple.c: Update documentation for GIMPLE conditional + expressions. + +2003-03-24 Diego Novillo + + * tree-dfa.c (get_expr_operands): If there are no call clobbered + variables, don't create a VDEF for GLOBAL_VAR at clobbering + CALL_EXPRS. + * tree-flow.h (fold_stmt): Declare. + * tree-ssa-ccp.c (fold_stmt): Change to extern declaration. + * tree-ssa.c (rewrite_stmt): Call it. + +2003-03-22 Diego Novillo + + * Makefile.in (gtype-desc.o): Add dependency on $(TREE_FLOW_H). + + * tree-dfa.c (struct alias_set_d): Add field 'num_elements'. + (struct walk_state): Move declaration earlier in the file. + (create_global_var): New local function. + (num_referenced_vars, num_aliased_objects): Change type to + 'size_t'. Update all users. + (aliased_objects, aliased_objects_base, aliased_objects_aliase_set): + Mark for garbage collection. + (num_call_clobbered_vars, call_clobbered_vars): New global + variable. + (get_expr_operands): For CALL_EXPRs, add a VUSE or VDEF reference + for every pointer argument. If the call may clobber, add a VDEF, + otherwise add a VUSE. + If the call may clobber, add VDEF for GLOBAL_VAR. + (dump_variable): Show whether the variable is call clobbered. + (dump_dfa_stats): Show call clobbered variables. + (compute_may_aliases): Minor formatting changes. + (compute_alias_sets): If the function makes clobbering calls, add + GLOBAL_VAR as an alias to every call-clobbered variable. + Remove alias sets that have exactly one element. + (register_alias_set): Set 'num_elements' to zero for every newly + created alias set. + (find_alias_for): Don't make a second call to add_may_alias to make + alias tags alias themselves. It's redundant. + Increment 'num_elements' when adding a new alias to an alias set. + (may_alias_p): Don't handle GLOBAL_VAR. + Check for structure aliasing when either PTR or VAR are a + structure. Don't do it only when both are structures. + (dump_alias_info): Show all aliases of each variable. + (find_vars_r): When processing a CALL_EXPR node, set + walk_state->is_store if the function may clobber and create a + reference to GLOBAL_VAR. + (add_indirect_ref_var): Change type of second argument from 'void *' + to 'struct walk_state *'. Update all users. + (add_referenced_var): Likewise. If a potentially aliased variabe + is not declared 'const', add it to the list of call clobbered + variables. + + * tree-flow.h (struct var_ann_d): Add field 'is_call_clobbered'. + Change type of field 'uid' to size_t. Update all users. + (stmt_ann_d): Add field 'makes_clobbering_call'. + (next_tree_ref_id): Remove unused variable. + (call_clobbered_vars): Declare. + (num_call_clobbered_vars): Declare. + (call_clobbered_var): New inline function. + + * tree-ssa-ccp.c (visit_phi_node): If the LHS of a PHI node is + volatile, mark the PHI node VARYING without checking its arguments. + (visit_assignment): Likewise. + (set_value): Remove. Update all users. + (likely_value): If the statement makes aliased loads or has + volatile operands, consider it VARYING. + (get_default_value): If a variable is volatile, consider it + VARYING. + + * tree-ssa.c (init_tree_ssa): Initialize num_call_clobbered_vars + and call_clobbered_vars. + Do not create GLOBAL_VAR. Set it to NULL_TREE. + Increase initial size for various hash tables. + (delete_tree_ssa): Reset num_call_clobbered_vars and + call_clobbered_vars. + (get_reaching_def): Rename from currdef_for. Update all users. + Always create default definitions for variables that need them. + Callers that use to call currdef_for with the second argument set + to false now call get_value_for. + (htab_statistics): New function. + (dump_tree_ssa): Call it. + (avail_expr_eq): Also compare VUSE operands. + +2003-03-21 Jeff Law + + * tree-dfa.c: Revert vla changes from yesterday. + (find_vla_decls_r): Do not look inside TYPE_DECLs. + +2003-03-20 Jeff Law + + * gimplify.c (simplify_return_expr): Tighten condition for + converting the RHS of a MODIFY_EXPR in a RETURN_EXPR to a + simple_val. Allow returning a RESULT_DECL directly. + * tree-dfa.c (get_expr_operands): A RESULT_DECL can have + interesting operands. + (clobber_vars_r): Handle RESULT_DECLs. + (compute_may_aliases): Initialize and free vla_htab. + (find_vla_decls): Pass vla_htab to walk_tree. + (find_vla_decls_r): Likewise. + * tree.h (SSA_DECL_P): Accept RESULT_DECLs. + +2003-03-19 Jeff Law + + * gimplify.c (simplify_return_expr): Only allow simple values + on the RHS of a MODIFY_EXPR appearing in a RETURN_EXPR. + * tree-cfg.c (make_exit_edges): We no longer need to look for + CALL_EXPRs on the RHS of a MODIFY_EXPR inside RETURN_EXPRs. + +2003-03-18 Andrew Macleod + + * tree-cfg.c (make_blocks): Use append_stmt_to_bb. Check for NULL + tsi_stmt when deciding whether to start a new block. + (add_stmt_to_bb): Don't update the basic block end pointer. + (append_stmt_to_bb): New. Add stmt and update the BB end pointer. + (first_stmt): Use only 1 return. + (last_stmt): Modified to use bsi_last(). + (last_stmt_ptr): Modified to use bsi_last(). + (bsi_last): New. Return an iterator to the last stmt in a block. + (bsi_from_tsi): Fix bug which wouldn't set the context properly when + within a nested BIND_EXPR. + (bsi_update_from_tsi): Insert helper which is more efficient than + bsi_from_tsi(). + (bsi_link_after): link in a new stmt and update the basic block + data structures. + (bsi_insert_after): Insert a new stmt into a block. + (bsi_insert_before): Insert a new stmt into a block. + (bsi_insert_on_edge): Insert a new stmt on an edge. + * tree-flow-inline.h (is_label_stmt): Return true if stmt can be a + target of a control transfer. + * tree-flow.h (is_label_stmt, bsi_last): New prototypes. + +2003-03-12 Jeff Law + + * c-simplify.c (simplify_switch_stmt): Save the type of the original + condition in TREE_TYPE (SWITCH_EXPR (...)). Annotate the SWITCH_EXPR + with file/line information. + * expr.c (expand_expr, case SWITCH_EXPR): Use expand_end_case_type. + * tree.def (SWITCH_EXPR): Document meaning of TREE_TYPE field of + the SWITCH_EXPR. + + * c-simplify.c (simplify_block): Set the current line number to + the line associated with the end of the block. + + * c-decl.c (finish_function): No longer save/restore the + current filename or linenumber around simplification. Instead + save/restore it around inlining. + (c_expand_body_1): Save/restore current filename and linenumber + around expansion of trees into RTL. + * gimplify.c (simplify_function_tree): Make the current file/line + number match the non-gimple code at the end of a function. + + * tree-cfg.c: Include toplev.h. + (remove_bb): Warn about unreachable code. + + * cfgrtl.c (verify_flow_info): Ignore EDGE_EXECUTABLE, it's for + the CCP optimizer only. + + * ssa.c (convert_to_ssa): Use last_basic_block, not n_basic_blocks. + +2003-03-11 Jeff Law + + * builtins.c: Fix minor comment typo. + (expand_builtin_strcmp, expand_builtin_strncmp): Remove. + (expand_builtin_strcat, expand_builtin_strncat): Likewise. + (expand_builtin_strspn, expand_builtin_strcspn): Likewise. + (expand_builtin_strcopy, expand_builtin_strstr): Likewise. + (expand_builtin_strpbrk, expand_builtin_strchr): Likewise. + (expand_builtin_strrchr, expand_builtin_fputs): Likewise. + (simplify_builtin_memcmp, simplify_builtin_strcmp): New functions. + (simplify_builtin_strpbrk, simplify_builtin_strstr): Likewise + (simplify_builtin_strchr, simplify_builtin_strrchr): Likewise + (simplify_builtin_strcpy, simplify_builtin_strncpy): Likewise + (simplify_builtin_strncmp, simplify_builtin_strcat): Likewise + (simplify_builtin_strncat, simplify_builtin_strspn): Likewise + (simplify_builtin_strcspn, simplify_builtin_fputs): Likewise + (expand_builtin_memcmp): Use simplify_builtin_memcmp. + (simplify_builtin): New function + (expand_builtin): Use simpify_builtin to collapse several common + cases together. + * gimplify.c (simplify_call_expr): Accept new argument. All + callers updated. Call simplify_builtin to try and simplify builtin + function calls before we simplify their arguments. + * tree.h (simplify_builtin): Prototype. + +2003-03-11 Jeff Law + + * timevar.def (TV_TREE_SSA_TO_NORMAL): New timevar. + * tree-cfg.c (remove_stmt): Also remove special annotations + on RHS of MODIFY_EXPR statements. + * tree-dfa.c (create_stmt_ann): Update comments. Fix formatting. + (compute_may_aliases): Make sure timevar encloses entire routine. + * tree-ssa.c (rewrite_out_of_ssa): Enclose with a timevar. + (remove_annotations_r): Avoid walking into subtrees of anything + except container nodes. Remove the special annotation on the + RHS of MODIFY_EXPRs. + +2003-03-10 Frank Ch. Eigler + + * tree-mudflap.c (mx_xfn_indirect_ref): Allow unfolded "& ptr->field" + constructs to pass uninstrumented. Remove TREE_ADDRESSABLE settings. + Keep array accesses to non-ADDRESSABLE objects uninstrumented. Update + __MF_TYPE_* constants for __mf_register calls. + +2003-03-10 Jeff Law + + * c-decl.c (c_expand_body_1): Update comments relating to + re-simplification after mudflap instrumentation. Avoid + unnecessary simplification of the function tree. + * gimplify.c (keep_function_tree_in_gimple_form): New function. + * tree-inline.c: Include tree-iterator.h and tree-simple.h + (struct inline_data): Add new TSI field. + (copy_body_r): Keep tree in gimple form when transforming a + RETURN_EXPR into a MODIFY_EXPR and GOTO_EXPR. + (initialize_inlined_parameters): Use MODIFY_EXPR, not INIT_EXPR + for initialization of inlined parameters. + (expand_call_inline): Save and restore the TSI around the + call to expand_calls_inline. Keep the tree in gimple form + when replacing a CALL_EXPR with a BIND_EXPR for the inlined + body. + (expand_calls_inline): Revamp to provide the current TSI to + expand_call_inline when we're working with gimple form. + * Makefile.in (tree-inline.o): Update dependencies. + * tree.h (keep_function_tree_in_gimple_form): Prototype. + +2003-03-10 Andrew MacLeod + + * Makefile.in (tree.o): Add tree-iterator.h dependancy. + * sbitmap.c (sbitmap_realloc): Grow a sbitmap structure. + * sbitmap.h (sbitmap_realloc): New Prototype. + * tree-cfg.c (remove_bb): Use new format for bsi_remove. + (bsi_remove): Update iterator to refer to the next stmt. + (bsi_prev): Implement previous stmt routine. + (bsi_from_tsi): Create a block iterator from a tree iterator. + * tree-flow-inline.h (bsi_prev): Remove. + (tsi_from_bsi): Create a tree iterator from a block iterator. + * tree-flow.h (bsi_prev,bsi_remove): Update prototypes. + (bsi_from_tsi, tsi_from_bsi, bsi_insert_*): New prototypes. + (bsi_iterator_update): New enum type. + * tree-iterator.h (tree_stmt_anchor, tsi_iterator_update): New type. + (tsi_link_before, tsi_link_after, tsi_delink, tsi_new_stmt_list, + tsi_stmt_list_head): New prototypes. + * tree-ssa-dce.c (remove_dead_stmts): Update removal loop to allow + that remove_dead_stmt update's the iterator. + (remove_dead_stmt): Use a pointer to the iterator since bsi_remove + requires it. + * tree.c (tsi_link_before): New function to link a stmt before an + iterator. + (tsi_link_after): New function links stmt after an iterator. + (tsi_delink): Removes a stmt from a list. + (tsi_new_stmt_list): New function to begin a new stmt list. + (tsi_stmt_list_head): New function to get the first stmt in a list. + +2003-03-07 Diego Novillo + + * tree-cfg.c (remove_stmt): Don't assume that the statement is in + SSA form. + + * tree-flow.h (dump_tree_ssa_stats): Declare. + (debug_tree_ssa_stats): Declare. + (stmt_ann_d): Add new statement flags 'makes_aliased_loads', + 'makes_aliased_stores', and 'has_volatile_ops'. + * tree-dfa.c (add_stmt_operand): Set new statement flags accordingly. + + * tree-pretty-print.c (dump_generic_node): Various cosmetic changes + to the rendering of some expressions. + + * tree-ssa.c (struct var_value_d): Rename from struct currdef_d. + Rename field 'currdef' to 'value'. Update all users. + (avail_exprs): New local hash table. + (const_and_copies): New local hash table. + (struct ssa_stats_d): Declare. + (ssa_stats): New local variable. + (rewrite_into_ssa): Deallocate avail_exprs and const_and_copies + after renaming. + Call dump_tree_ssa_stats() if -fdump-tree-ssa-stats is given. + (rewrite_block): Document the renaming process. + Add new local stack block_avail_exprs to keep track of expressions + made available in this block and its children. + (rewrite_stmts): Move body inside rewrite_block. + (dump_tree_ssa_stats): New function. + (debug_tree_ssa_stats): New function. + (get_def_blocks): New function. + (insert_phi_nodes_for): Call it. + (rewrite_stmt): Add support for keeping track of copies, constants + and globally redundant expressions. + (rewrite_operand): If a pointer has been copy propagated into + another one, rewrite INDIRECT_REF nodes of the original pointer to + refer to the new one. + (register_new_def): Add new argument 'var' indicating which + variable is this new definition for. Update all users. + (update_indirect_ref_vuses): New function. + (update_pointer_vuses): New function. + (init_tree_ssa): Set variable 'ssa_stats' to zero. + Allocate memory for 'avail_exprs' and 'const_and_copies'. + (currdef_for): Don't mark inline. + Call get_value_for and set_value_for. + (set_currdef_for): Remove. Update all users. + (var_value_hash): Rename from currdef_hash. Update all users. + (var_value_eq): Rename from currdef_eq. Update all users. + (get_value_for): New function. + (set_value_for): New function. + (lookup_avail_expr): New function. + (avail_expr_hash): New function. + (avail_expr_eq): New function. + (get_def_blocks_for): New function. + (var_is_live): New function. + +2003-03-06 Diego Novillo + + * tree-ssa-ccp.c (likely_value): Don't assume CONSTANT if the + statement has virtual uses. + +2003-03-05 Diego Novillo + + * tree-dfa.c (opf_none, opf_is_def, opf_force_vop, opf_ignore_bp): + New flags to alter the behavior of add_stmt_operand. + (get_expr_operands): Change operand IS_DEF with FLAGS. Update all + users. + When adding a VUSE for pointer dereferences in function arguments, + don't add a superfluous VUSE for the base pointer. + (add_stmt_operand): Remove operands IS_DEF and FORCE_VOP. Add + operand FLAGS. Update all users. + +2003-03-05 Jason Merrill + + * c-pretty-print.c (do_niy): Only print operands of expressions. + * tree-pretty-print.c: Likewise. + + * c-simplify.c (simplify_decl_stmt): Only simplify DECL_SIZE_UNIT. + * gimplify.c (simplify_array_ref_to_plus): New fn. + (simplify_array_ref): Use it. + (build_addr_expr_with_type): Split out from build_addr_expr. + (simplify_compound_lval): Break out an ARRAY_REF with non-constant + element size. + +2003-03-05 Frank Ch. Eigler + + * gcc.c (MFWRAP_SPEC): Remove most --wrap entries. + +2003-03-03 Daniel Berlin + + * tree-ssa-pre.c (is_strred_cand): Temporarily disable strength + reduction while working on bootstrapping. + (requires_edge_placement): Reenable for now, until an insertion + infrastructure exists that can handle critical edges. + (count_stmts_in_bb): New function, used for verifying we do + insertions properly. + (update_old_new): Fix up bb heads as well. + (do_proper_save): Handle single statement bb properly. + Handle BB's contained in BIND_EXPRS. + (code_motion): Count number of statements in bb before and after + to make sure we don't screw up boundaries. + (finalize_1): Ditto. + (rename_2): Fix subtle rename bug. + (phi_opnd_from_res): Do this the right way, by cloning the + occurrence and modifying it, as every other PRE implementation + does. + (tree_perform_ssapre): Handle comparisons too (unary exprs + currently disabled till load PRE is reimplemented). + (reset_can_be_avail): Fix can_be_avail test. + +2003-03-01 Diego Novillo + + * doc/invoke.texi: Fix typo. + +2003-02-28 Aldy Hernandez + Diego Novillo + + * Makefile.in (OBJS): Add tree-ssa-copyprop.o. + (tree-ssa-copyprop.o): New rule. + (tree-ssa-ccp.o): Add dependency on $(TREE_SIMPLE_H). + + * timevar.def (TV_TREE_COPYPROP): New timevar. + * flags.h (flag_tree_copyprop): Declare. + * toplev.c (flag_tree_copyprop): Define. + (f_options): Add -ftree-copyprop. + * tree.h (tree_dump_index): Add TDI_copyprop. + * tree-dump.c (dump_files): Add entry for -fdump-tree-copyprop. + * doc/invoke.texi: Document -ftree-copyprop and -fdump-tree-copyprop. + + * tree-ssa-copyprop.c: New file. + * tree-flow.h (tree_ssa_copyprop): Declare. + * tree-optimize.c (optimize_function_tree): Call it. + * tree-dfa.c (add_vuse): Make extern. Update all users. + + * tree-ssa.c (mark_def_sites): VUSEs are stored in a varray of trees. + +2003-02-28 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_enqueue_decl): Ignore extern artificial + variable declarations. + +2003-02-27 Diego Novillo + + * tree-dfa.c (get_stmt_operands): INIT_EXPR nodes cannot + appear in GIMPLE form. Don't handle them. + (get_expr_operands): Likewise. + (find_vars_r): Likewise. + * tree-ssa-ccp.c (get_rhs): Likewise. + (set_rhs): Likewise. + * tree-ssa-pre.c (tree_perform_ssapre): Likewise. + +2003-02-27 Diego Novillo + + * tree-ssa-ccp.c (ccp_fold): Fold builtins by replacing and + restoring their arguments. + +2003-02-27 Jeff Law + + * tree-dfa.c (find_vars_r): Clear *walk_subtrees appropriately + to avoid useless walking of subtrees. + + * fold-const.c (nondestructive_fold_binary_to_constant): Renamed + from nondestructive_fold_binary. Update comments slightly. + (nondestructive_fold_unary_to_constant): Similarly. + (fold_relational_hi_lo): Corresponding changes. + * tree-ssa-ccp.c (ccp_fold): Corresponding changes. + * tree.h: Corresponding changes. + +2003-02-26 Jeff Law + + * tree-ssa-ccp.c (ccp_fold): Also handle folding of calls to + builtin functions. + + * fold-const.c (nondestructive_fold_binary): Handle truth ops + when both arguments are constant (duh!). Handle CONJ_EXPR. + +2003-02-26 Daniel Berlin + + * flags.h: Remove flag_ip. + * toplev.c: Ditto. + * tree-alias-ander.c: s/flag_ip/flag_unit_at_a_time/g. + (andersen_cleanup): Set region to null when done. + (andersen_function_call): Check DECL_PTA_TYPEVAR, not + DECL_SAVED_TREE. + * tree-alias-common.c: s/SSA_DECL_P/DECL_P/g. + (get_alias_var_decl): Remove dead code, fix bug in what is a + local alias var. + (find_func_aliases): Use get_alias_var, not create_fun_alias_var. + (create_fun_alias_var): Fix to use DECL_PTA_TYPEVAR. + Use get_alias_var rather than create_alias_var. + (create_fun_alias_var_ptf): Ditto. + (create_alias_vars): Ditto. + * tree-dfa.c (compute_may_aliases): Fix check for + create_alias_vars. + Move deletion of alias vars back to here, from tree-ssa.c + * tree-ssa.c (delete_tree_ssa): Remove delete_alias_vars call. + +2003-02-25 Jeff Law + Diego Novillo + + * tree-ssa-ccp.c (likely_value): If the statement has no + use operands, then return CONSTANT. + + * fold-const.c (nondestructive_fold_binary): Handle TRUTH_AND_EXPR + and TRUTH_OR_EXPR. Placeholder for TRUTH_XOR_EXPR. + * tree-ssa-ccp.c (ccp_fold): Handle TRUTH_{AND,OR,XOR}_EXPR. + (def_to_undefined): Re-enable VARYING->UNDEFINED state transition + sanity check. + + * tree-ssa-ccp.c (likely_value): Renamed from may_fold_p. Now + returns a latticevalue indicating the likely value for the + the RHS of the statement. + (evaluate_stmt): Update to use likely_value instead of may_fold_p. + Statements with UNDEFINED operands produce an UNDEFINED result. + (set_lattice_value): Reenable VARYING->CONSTANT sanity check. + +2003-02-25 Andrew MacLeod + + * tree-cfg.c (bsi_init): Handle BIND_EXPR nodes inside a basic block. + (bsi_next_in_bb): Likewise. + +2003-02-25 Diego Novillo + + * tree-cfg.c (parent_array): Remove. Update all users. + (struct cfg_stats_d): Add field 'num_failed_bind_expr_merges'. + (NEXT_BLOCK_LINK): Define. + (build_tree_cfg): Call alloc_aux_for_blocks instead of + create_block_annotations. + (make_blocks): Rewrite to support basic blocks that can span whole + BIND_EXPR bodies and put control statements at the end of blocks. + Add arguments 'next_block_link' and 'bb'. Replace 'parent_block' + with 'parent_stmt'. Update all users. + (make_loop_expr_blocks): Replace argument 'parent_block' with 'entry'. + Add argument 'next_block_link'. Update all users. + Don't create an empty latch block. + (make_cond_expr_blocks): Add argument 'next_block_link'. Update + all users. + (make_switch_expr_blocks): Likewise. + (make_bind_expr_blocks): Replace 'parent_block' with 'parent_stmt'. + Add argument 'next_block_link' and 'entry'. + Don't create a new block for the BIND_EXPR node. Extend the + existing block. + (add_stmt_to_bb): New function. + (create_bb): Remove argument 'parent_block'. Update all users. + (create_block_annotations): Remove. Update all users. + (make_edges): Don't handle BIND_EXPR nodes. + (make_ctrl_stmt_edges): Don't create an extra edge to the body of + the switch. + (make_loop_expr_edges): Only create an edge to the body of the + loop. + (remove_unreachable_block): Add more documentation for the special + case where a control statement entry is unreachable but its body + isn't. + Remove the basic block annotation from the head and end containers + in the block. + (disconnect_unreachable_case_labels): Don't keep the edge that goes + to the BIND_EXPR at the start of the switch body. + (dump_tree_bb): Call is_latch_block_for. + (dump_cfg_stats): Show stats about basic blocks that could not span + beyond the end of a BIND_EXPR body. + (successor_block): Use NEXT_BLOCK_LINK if the block is the last + inside a control structure. + (is_ctrl_stmt): Update documentation. + (stmt_starts_bb_p): Add new argument 'prev_t'. Update all users. + Only labels may start a new basic block. + (stmt_ends_bb_p): Add LOOP_EXPR, TRY_FINALLY_EXPR and + TRY_CATCH_EXPR to the list. + (latch_block): Remove. + (is_latch_block_for): New function. + (set_bb_for_stmt): Reformat some code. + + * tree-flow-inline.h (set_parent_block): Remove. Update all users. + (parent_stmt): New function. + (parent_block): Call it. + + * tree-flow.h (struct stmt_ann_d): Add field 'parent_stmt'. + (struct bb_ann_d): Remove block parent_block. + + * tree-pretty-print.c (dump_generic_node): Don't handle empty latch + nodes. + + * tree-ssa-ccp.c (def_to_undefined): Temporarily disable check for + VARYING->UNDEFINED transitions. + (set_lattice_value): Likewise for VARYING->CONSTANT transitions. + + * tree-ssa-dce.c (mark_necessary): Use parent_stmt() to traverse + all the control statements that contain the current + statement. + (makr_control_parent_necessary): Remove. Update all users. + (stmt_useful_p): Add BIND_EXPR to the list of useful + statements. + (process_worklist): Check that the statement is + associated to a basic block. + (remove_dead_stmt): Don't assume that the block has a + postdominator. + +2002-02-20 Daniel Berlin + + * tree-alias-ander.c: Store cached ptsets in the typevar, not + a seperate hash table. + (ptset_map): Removed; + (ptset_map_eq): Ditto. + (ptset_map_hash): Ditto. + (andersen_init): Remove ptset_map. + (andersen_cleanup): Ditto. + (andersen_add_var): Ditto. + (andersen_add_var_asm): Ditto. + (andersen_may_alias): Ditto. + * tree-alias-common.c: Store typevars for DECL nodes in the tree_decl + structure. + (get_alias_var_decl): Use DECL_PTA_TYPEVAR for DECL's. + (create_alias_var): Ditto. + (find_func_aliases): CONST functions don't affect aliasing either. + (ptr_may_alias_var): Don't call get_base_symbol. + Remove decl_function_context, use DECL_CONTEXT instead. + For DECL's, use DECL_PTA_TYPEVAR. + * tree-alias-type.c (struct alias_typevar_aterm): Add ptset member. + (ALIAS_TVAR_PTSET): New macro. + * tree.h (DECL_PTA_TYPEVAR): New macro. + (struct tree_decl): Add typevar member. + +2003-02-20 Jeff Law + + * c-simplify.c (simplify_decl_stmt): Call set_vla_decl on the + temporary holding the size and unit size for a VLA. Minor + formatting fixes. + + * ssa.c: Revert caching of immediate dominators change made on + Jan 28, 2003. + + * tree-dfa.c: Fix comment. + +2003-02-20 Jeff Law + + * tree-cfg.c (remove_bb): Update PHI nodes as edges are removed. + (cleanup_cond_expr_graph): Likewise. + (cleanup_switch_expr_graph): Likewise. + (disconnect_unreachable_case_labels): Likewise. + + * tree-ssa-dce.c (mark_control_parent_necessary): Be much more + selective about what statements in the control parents are marked + as necessary. + + * tree-dfa.c (INDIRECT_REFs and ADDRESSABLE_VARs varrays): Replace + with a single ALIASED_OBJECTs set of varrays. + (dump_dfa_stats): Corresponding changes. + (compute_may_aliases, dump_alias_info): Likewise. + (compute_alias_sets): Likesise. Update comments. Register + alias sets for all potentially aliased objects which are stored. + Check each potentially aliased object with the registered alias + sets. + (register_alias_set): If DEREF aliases a single registered _DECL, + then replace the _DECL's entry with DEREF. + (find_alias_for): Update comments. Do not stop the search when + an alias is found. There may be multiple entries with conflicting + alias sets. + (struct walk_state): New structure for statement walker callbacks. + (find_vars_r): Add logic to track loads and stores of potentially + aliased objects separately. Various changes related to + using a single set of varrays for all aliased objects. + (add_referenced_var): Record in the var's annotation if the + var is read or written. Various changes related to using a + single set of varrays for all the aliased objects. + (add_stmt_operand): Only set may_point_to_global_mem for INDIRECT_REFs. + * tree-flow.h (struct var_ann_d): Add new fields indicating if + the var is loaded or stored. Explicitly note unused bitfield + entries. + +2003-02-19 Jeff Law + + * fold-const.c (fold_negate_const): New function. Broken out of + the generic fold code. + (fold_abs_const, fold_relational_const): Likewise. + (fold_relational_hi_lo): Likewise. + (nondestructive_fold_unary, nondestructive_fold_binary): Likewise. + (fold): Use fold_negate_const, fold_abs_const, fold_relational_const, + and fold_relational_hi_lo. + * tree.h (nondestructive_fold_unary): Declare. + (nondestructive_fold_binary): Declare. + * tree-ssa-ccp.c (ccp_fold): New function. + (add_control_edge): Fix trivial formatting bug. + (evaluate_stmt): Rework to use ccp_fold instead of copying + statements. + +2003-02-18 Jeff Law + + * tree-ssa-ccp.c (visit_assignment): For simple copies, copy the + lattice values. + (defs_to_undefined): Add missing abort. + (replace_uses_in): Do not do a replacement if it would create + non GIMPLE trees. + +2002-02-14 Jeff Law + + * tree-ssa-ccp.c (def_to_undefined): Improve sanity checking code + so that it can detect invalid VARYING->UNDEFINED transitions. + (set_lattice_value): Improve sanity checking code so that it + does not trip on valid VARYING->CONSTANT transitions. + + * tree-flow.h (struct stmt_ann_d): Add new field in_ccp_worklist. + * tree-ssa-ccp.c (simulate_stmt): Renamed from simulate_def_use_edges. + (add_var_to_ssa_edges_worklist): New function. Only add statements + to the ssa_edges worklist if they are not already on the worklist. + (def_to_undefined, def_to_varying, set_lattice_value) + (tree_ssa_ccp): Only reevaluate the statement if in_ccp_worklist + is set for the element popped off the ssa_edges worklist. + (simulate_statement): Simplify now that ssa_edges is a worklist + of statements to reevaluate rather than a worklist of defs + that need their immediate uses reevaluated. + (visit_stmt): Clear in_ccp_worklist. + + * tree-ssa-ccp.c (def_to_undefined): Directly store the new + lattice values rather than call set_value. + (def_to_varying): Likewise. + (set_lattice_value): Likewise. + + * tree-ssa-ccp.c (def_to_undefined): Add some state transition + sanity checking. Avoid calling set_value if nothing changed. + (def_to_varying): Avoid calling set_value if nothing changed. + (set_lattice_value): Add some state transition sanity checking + for transitions into the CONSTANT state. If the object's + "constant" value has changed to a new constant value, then the + object has a VARYING value. + + * tree-ssa-ccp.c (tree_ssa_ccp): Work through the entire + ssa_edges worklist each iteration through the main loop. + +2002-02-13 Jeff Law + + * tree-ssa-ccp.c: Fix comment formatting glitches. + + * tree-ssa-ccp.c (may_fold_p): New function. Returns nonzero if + the given statement may fold after replacement of operands with + constants. + (evaluate_stmt): Only create a copy of the statement if there is + a reasonable chance the statement will fold. + +2002-02-13 Diego Novillo + + * Makefile.in (OBJS): Add tree-ssa-pre.o. + +2003-02-13 Daniel Berlin + + * tree-dfa.c (create_stmt_ann): Do stmt part of common annotation. + * tree-flow-inline.h (tree_stmt): Return statement tree is part of. + * tree-flow.h (struct bb_ann_d): Add ephi_nodes. + * tree-optimize.c (optimize_tree): Activate SSAPRE again. + * tree-pretty-print.c (debug_generic_expr): New function. + (debug_generic_stmt): Ditto. + (dump_generic_node): Pretty print EUSE's, EREF's, and EPHI's. + + * tree-ssa-pre.c: Rewrite almost entirely. Now performs more + strength reduction, EPHI minimization, and keeps SSA up to date. + * tree.c (tree_size): Handle EUSE, EPHI, EREF nodes. + (tree_node_structure): Ditto. + (ephi_node_elt_check_failed): New function. + * tree.def: Add EUSE_NODE, ELEFT_NODE, EKILL_NODE, EPHI_NODE, + EEXIT_NODE. + * tree.h (EREF_NODE_CHECK): New. + (EPHI_NODE_ELT_CHECK): New. + (struct tree_eref_common): New. + (struct tree_euse_node): New. + (struct tree_ephi_node): New. + (union tree_node): Add euse, eref, ephi members. + (enum tree_node_structure): Add TS_EPHI_NODE, TS_EUSE_NODE, + TS_EREF_NODE. + +2003-02-13 Daniel Berlin + Andreas Jaeger + + * tree-flow.h: Add some garbage collector marks. + +2003-02-12 Jeff Law + + * Makefile.in (ssa.o): Depends on $(TREE_H) and tree-flow.h + * ssa.c: Include tree.h and tree-flow.h. + (compute_dominance_frontiers_1): Use the sparse bitmap + of dominator children from the basic block's annotation + if it's available. Otherwise build the sparse bitmap + using the result of get_dominated_by. + * tree-ssa.c (rewrite_into_ssa): Reorder things slightly so + that we can use the cached dominator children computed + by mark_def_sites in compute_dominance_frontiers. + +2003-02-12 Andreas Jaeger + + * tree-dfa.c (dump_alias_info): Cast variable of size_t properly. + +2003-02-12 Daniel Berlin + + * tree-dfa.c (find_may_aliases_for): Remove + (compute_may_aliases): Always call compute_alias_sets. + +2003-02-10 Jeff Law + + * ssa.c (compute_dominance_frontiers_1): Use a sparse bitmap + for the frontiers. + (compute_dominance_frontiers): Corresponding changes. + (convert_to_ssa): Similarly. Convert the sparse bitmap to + a simple bitmap to avoid lots of collateral damage. + * ssa.h (compute_dominance_frontiers): Update prototype. + * tree-ssa.c (added, in_work): Kill, no longer needed. + (struct def_blocks_d): Add new bitmap (livein_blocks). + (rewrite_into_ssa): Make dominance frontiers be a sparse + bitmap instead of a simple bitmap. Rename the "nonlocals" + simple bitmap to "globals". Pass it into mark_def_sites. + (compute_global_livein): New function. + (mark_def_sites): Also keep track of variables which are + used before they are set. Allow caller to allocate and + pass in a simple bitmap for global variables. Process + items defined in the statement last. + (set_def_block): Also allocate bitmap for globals. + (set_livein_block): New function. + (def_blocks_free): Free def_blocks correctly. Also free + livein_blocks. + (debug_def_blocks_r): Also dump the livein_blocks. + (insert_phi_nodes): Simplify now that we don't need the + added and in_work varrays. Accept DFS as a sparse bitmap + instead of a simple bitmap. + (insert_phi_nodes_for): Rework significantly. Pre-compute all + the insertion points for semi-pruned form. While computing those + insertion points keep track of how many phi vector entries + would be needed at those insertion points. When the number of + entries gets large (32), compute global life information and + use that to further pruned the number of PHI insertion points + necessary. + +2003-02-09 Diego Novillo + + * tree-dfa.c (find_vars_r): Assume that the RHS of an INDIRECT_REF, + that is also an SSA variable, is a VAR_DECL. + (get_virtual_var): Handle INDIRECT_REF nodes that are not valid SSA + variables. + + * tree-ssa-dce.c (stmt_useful_p): Revert kludge in previous commit. + VA_ARG_EXPR nodes are not inherently live. + + * tree-ssa.c (mark_def_sites): Don't process the LHS of assignments + twice. + The operand of a virtual definition constitutes a use of the + variable which should be considered a non-local if it had not been + killed inside the block. + + * tree.h (SSA_VAR_P): Only return true for INDIRECT_REFs if their + operand is a _DECL node. + +2003-02-09 Diego Novillo + + * config/rs6000/t-rs6000 (simplify-rtx.o): Compile with -Wno-error. + +2003-02-08 Diego Novillo + + * toplev.c (parse_options_and_default_flags): Enable SSA DCE by + default. + + * tree-dfa.c (get_expr_operands): Recurse into LHS of an ARRAY_REF + when it's not a regular variable. Always recurse into the RHS. + (add_stmt_operand): Set may_point_to_global_mem for pointers that + are assigned expressions that may reference global memory. Also + set its dereference variable to be an alias of global memory. + (dump_variable): Show may_point_to_global_mem flag. + (compute_alias_sets): Also dump all referenced variables when + dumping alias information. + (add_may_alias): Check for global memory aliasing. + (may_access_global_mem_p): Rename from may_access_global_mem. + Return true if the expression is a variable that may point to or + alias global memory. + (add_referenced_var): Pointer arguments and global pointers may + point to global memory. + (set_may_alias_global_mem): Move ... + * tree-flow-inline.h (set_may_alias_global_mem): ... here. + (set_may_point_to_global_mem): New function. + (may_point_to_global_mem_p): New function. + + * tree-ssa-dce.c (stmt_useful_p): VA_ARG_EXPRs are inherently live. + * tree-ssa.c (rewrite_into_ssa): Don't call dump_referenced_vars. + +2003-02-06 Diego Novillo + + * tree-dfa.c (struct alias_tags, alias_tags, num_alias_tags): + Remove. Update all users. + (struct alias_set_d): New. + (alias_sets): New file local variable. + (compute_alias_sets): New function. + (compute_may_aliases): Call it when not doing points-to analysis. + (register_alias_set): New function. + (find_alias_for): New function. + (may_alias_p): Declare static. + Don't assume that VAR may not be aliased if it's a non-addressable + _DECL. + If VAR and PTR are aggregate types, check if they can have a field + that points to the other one. + (find_may_aliases_for): Move handling of global memory aliasing ... + (add_may_alias): ... here. + Also accept the base symbols for the variable and its alias. + (register_new_alias): Remove. Update all users. + (find_alias_tag): Remove. Update all users. + (find_vars_r): Update VAR after re-writing *TP when sharing + INDIRECT_REF nodes. + * tree-flow.h (may_alias_p): Remove declaration. + + * tree-ssa.c (rewrite_into_ssa): Include referenced variables in + default debug dumps. + + Support for VLAs. + + * tree-dfa.c (find_vla_decls): New function. + (compute_may_aliases): Call it. + (find_vla_decls_r): New function. + (dump_variable): Show whether the variable is used in a VLA + declaration. + * tree-flow-inline.h (is_vla_decl): New function. + (set_vla_decl): New function. + * tree-flow.h (struct var_ann_d): Add bitfield 'is_vla_decl'. + * tree-ssa-dce.c (need_to_preserve_store): Return true if SYM is + used inside a VLA declaration. + +2003-02-05 Andrew MacLeod + + * Makefile.in : Include new file tree-iterator.h in tree-simple.h + * gimplify.c (simplify_cleanup_point_expr): Use tsi_ rather than gsi_. + * tree-cfg.c (make_blocks, remove_bb): Use tsi_ not gsi_ routines. + (bsi_remove): Renamed from gsi_remove, use bsi_ routines. + (successor_block, first_exec_stmt): Use tsi_ not gsi_ routines. + (first_stmt, last_stmt, last_stmt_ptr): Use bsi_ not gsi_ routines. + (bsi_init): Split out from bsi_start. + (bsi_start): Renamed from gsi_start_bb, use bsi_ routines. + (bsi_next_in_bb): Moved from tree-flow-inline.h and renamed from + gsi_step_in_bb. Also verify BB of new stmt. + * tree-dfa.c (compute_immediate_uses, dump_immediate_uses, + collect_dfa_stats, compute_may_aliases): Use block_stmt_iterator. + * tree-flow-inline.h (gsi_step_in_bb): Moved to tree-cfg.c + (bsi_end_p): Renamed from gsi_end_bb_p. + (bsi_next): renamed from gsi_step_bb + (bsi_prev): New function. + (bsi_stmt_ptr): Block version of gsi_stmt_ptr. + (bsi_stmt): Block version of gsi_stmt. + (bsi_container): Block version of gsi_container. + * tree-flow.h (block_stmt_iterator): New iterator type. + * tree-iterator.h: New include file for tree_iterator. + * tree-simple.h : Include tree-iterator.h + (gimple_stmt_iterator, gsi_start, gsi_end_p, gsi_stmt_ptr, + gsi_stmt, gsi_container): Move to tree-iterator.h and rename to tsi_. + (gsi_step): Move to tree-iterator.h and renamed to tsi_next. + * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use block + iterators instead of gimple_stmt_iterator. + * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts, + remove_dead_stmts, remove_dead_stmt): Use block_stmt_iterator. + * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmts): Use + block_stmt_iterator. + +2003-02-04 Daniel Berlin + + * tree-alias-common.c (get_alias_var_decl): If it's a global var, + make sure it doesn't get added to local_alias_vars. + (get_name): Return the right name for FUNCTION_DECL's. + +2003-02-04 Diego Novillo + + * tree-dfa.c (add_stmt_operand): Do not add a VUSE for a pointer + when clobbering its associated INDIRECT_REF variable. + +2003-02-04 Diego Novillo + + * config/rs6000/t-rs6000 (jump.o, regmove.o, c-typeck.o, cfgrtl.o, + combine.o, fold-const.o, ifcvt.o, reload1.o, rtlanal.o, + cp/decl2.o, cp/pt.o, f/where.o, java/expr.o, objc/objc-act.o, + rs6000.o, insn-emit.o): Compile with -Wno-error. + +2003-02-03 Diego Novillo + Jeff Law + + * tree-cfg.c (make_blocks): Don't always start a new block with + COND_EXPR and SWITCH_EXPR statements. + Call stmt_ends_bb_p to determine if the current statement should be + the last in the block. + (make_cond_expr_blocks): Second argument is now the entry block + to the conditional. + (make_switch_expr_blocks): Second argument is now the entry block + to the switch. + (make_edges, make_ctrl_stmt_edges, make_loop_expr_edges, + cleanup_control_flow, cleanup_cond_expr_graph, + cleanup_switch_expr_graph, disconnect_unreachable_case_labels, + find_taken_edge, successor_block, latch_block, is_latch_block, + switch_parent): Work with the last statement of the block, not the + first. + (is_ctrl_altering_stmt): Pre-compute the code of the statement. + (stmt_starts_bb_p): Declare file local. + Don't call is_ctrl_stmt. Check if T is a LOOP_EXPR instead. + (stmt_ends_bb_p): New function. + + * tree-flow.h (stmt_starts_bb_p): Remove declaration. + +2003-02-03 Diego Novillo + + * tree-dfa.c (find_vars_r): Share INDIRECT_REF nodes whose operand + is a VAR_DECL. + (add_referenced_var): Add additional argument 'sym'. Update all users. + Don't call get_base_symbol. + (add_indirect_ref_var): Rename argument 'var' to 'ptr'. + (htab_hash_var): Remove. Update all users to use htab_hash_pointer. + (htab_var_eq): Remove. Update all users to use htab_eq_pointer. + + * tree-flow-inline.h (var_ann): Don't retrieve the annotation of + the base pointer for INDIRECT_REF variables. + (is_aliased): Remove. Update all users. + (is_dereferenced): Remove. Update all users. + (same_var_p): Remove. Update all users to use pointer equality. + + * tree-simple.c (get_base_symbol): Convert tail recursion into + iteration. + + * tree-ssa.c (rewrite_out_of_ssa): Add FIXME note about overlapping + live ranges for different versions of the same variable. + +2003-02-03 Jeff Law + + * tree-dfa.c (add_referenced_var): Annotate each item in the + REFERENCED_VARS varray with a unique id. + * tree-flow.h (struct var_ann_d): Add new uid field. + * tree-ssa.c (mark_def_sites): Compute the set of variables + live across basic blocks and return them in an sbitmap. + (insert_phi_nodes): Use the set of nonlocal variables computed + by mark_def_sites to reduce the number of PHI nodes inserted. + (rewrite_into_ssa): Updated to deal with changes in + insert_phi_nodes and mark_def_sites. Free the sbitmap returned + by mark_def_sites. + +2003-02-03 Diego Novillo + + * c-common.h (GOTO_DESTINATION): Remove. Fix botched + merge. + +2003-02-03 Diego Novillo + + Fix warnings to allow bootstrapping with -Werror. + + * Makefile.in (c-semantics.o-warn): Add -Wno-error. + (emit-rtl.o-warn): Likewise. + (profile.o-warn): Likewise. + (tree.o-warn): Likewise. + (OBJS): Remove simple-break-elim.o and simple-goto-elim.o. + * c-pretty-print.c (print_function_decl): Remove unused function. + * bitmap.c (bitmap_last_set_bit): Initialize variable 'word'. + * c-typeck.c (build_binary_op): Initialize variable 'type'. + * combine.c (combine_simplify_rtx): Initialize variable 'reversed'. + (make_compound_operation): Initialize variable 'i'. + * dwarf2out.c (dwarf2out_finish): Initialize variable 'context'. + * expr.c (store_constructor): Initialize variables 'lo', 'hi', + 'startb' and 'endb'. + (expand_expr): Initialize variable 'op0'. + * fold-const.c (fold): Initialize variable 'tem'. + * profile.c (branch_prob): Initialize variable 'prev_file_name'. + * reload.c (find_equiv_reg): Initialize variables 'valtry and + 'valueno'. + * rtlanal.c (get_jump_table_offset): Initialize variable 'set'. + * ssa-ccp.c (ssa_const_prop): Fix sign mismatch warning. + * varasm.c (output_constant_def): Initialize variable 'defstr'. + * gimplify.c (simplify_expr): Initialize variables + 'saved_input_filename' and 'saved_lineno'. + (simplify_compound_lval): Initialize variable 'code'. + * tree-alias-ander.c (pta_bottom): De-ansify. + (andersen_cleanup): Remove unused variables. + (andersen_heap_assign): Mark argument lhs ATTRIBUTE_UNUSED. + (pta_bottom): Remove unused function. + (pta_get_ptsize): Remove unused function. + +2003-02-02 Diego Novillo + + * tree-dfa.c (get_expr_operands): Add a VUSE for the dereference of + every pointer passed in a function call. + Move code to add an operand for the base pointer of an + INDIRECT_REF ... + (add_stmt_operand): ... here. + Add a VUSE for the base pointer of every INDIRECT_REF variable. + (find_may_aliases_for): Fix starting index for the loop that scans + INDIRECT_REFs for aliasing. + Factor code that marks two variables aliased into + register_new_alias. + (register_new_alias): New function. + (may_alias_p): Handle aliasing of structure fields. + (add_may_alias): Fix documentation. + (find_vars_r): Factor code that adds a new referenced variable into + add_referenced_var. + (add_referenced_var): New function. + (add_indirect_ref_var): New function. + (get_virtual_var): Handle variables wrapped in SSA_NAMEs. + (set_may_alias_global_mem): Move from ... + * tree-flow-inline.h: ... here. + + * tree-ssa-dce.c (need_to_preserve_store): CALL_EXPRs are + implicitly live. VA_ARG_EXPRs are not. + (stmt_useful_p): + + * tree.h (SSA_NAME_VAR): Rename from SSA_NAME_DECL. Update all + users. + (struct tree_ssa_name): Rename field 'decl' to 'var'. Update all + users. + (SSA_DECL_P): Accept only VAR_DECLs and PARM_DECLs possibly wrapped + inside an SSA_NAME node. + (SSA_VAR_P): Also accept SSA_NAME nodes. + +2003-02-01 Daniel Berlin + + * Makefile.in (tree-ssa-pre2.o): Remove accidental addition. + +2003-01-31 Diego Novillo + + * tree-cfg.c (find_taken_edge_cond_expr): New function. + (find_taken_edge_switch_expr): New function. + (value_matches_some_label): New function. + (find_taken_edge): Re-structure to use the three new functions. + +2003-01-30 Jason Merrill + + * gimplify.c (simplify_function_tree): Set TREE_SIDE_EFFECTS on + the BIND_EXPR wrapper. + +2003-01-30 Diego Novillo + + * tree-dfa.c (call_may_clobber): New function. + (get_expr_operands): Call it. + (find_vars_r): Call it. + +2003-01-30 Jeff Law + + * tree-dfa.c (struct alias_tags): New. Collector for key information + regarding alias tags. + (indirect_refs_base, indirect_refs_alias_set): New varrays. + (addressable_vars_base, addressable_vars_alias_set): Likewise. + (compute_may_aliases): Initialize and finalize the new varrays. + Update allocation of alias tags information. + (find_may_aliases_for): Extract base symbols and alias set + information for V1 and V2 from the virtual arrays and store + them into local variables. Pass them as necessary to + may_alias_p, may_access_global_mem, find_alias_tag. Add base + symbol and alias set when creating a new alias tag. + (find_vars_r): Fill in new varrays as needed. + (may_alias_p): Add new arguments for base and alias set of the + two origianl incoming arguments. No longer call get_base_symbol + or get_alias_set. + (find_alias_tag, may_access_global_mem): Similarly. + (add_stmt_operand): Update to pass additional argument to + may_access_global_mem. + (dump_alias_info): Update to deal with new alias tag structure. + * tree-flow.h (may_alias_p): Update prototype with new arguments. + * tree-ssa-pre.c (process_left_occs_and_kills): Update to pass + new arguments to may_alias_p. + +2003-01-30 Daniel Berlin + + Remove all traces of steensgaard's algorithm. + * tree-alias-steen.c: Removed. + * tree-alias-steen.h: Ditto. + * tree-alias-ecr.c: Ditto. + * tree-alias-ecr.h: Ditto. + * disjoint-set.c: Ditto. + * disjoint-set.h: Ditto. + * Makefile.in: Remove removed files. + * c-config-lang.in: Ditto. + * gengtype.c: Ditto. + * tree-alias-common.c: Don't use steen_alias_ops anymore. + * toplev.c: Remove help text and steen option. + * tree-alias-common.h: Remove PTA_STEEN. + * tree-alias-type.c: Remove all steensgaard related types and + functions. + * tree-alias-type.h: Ditto. + +2003-01-30 Diego Novillo + + * tree-cfg.c (struct cfg_stats_d): New. + (cfg_stats): New file local. + (build_tree_cfg): Start TV_TREE_CFG timer before allocating memory. + Initialize cfg_stats. + (make_blocks): Count coalesced label blocks. + (dump_tree_cfg): Call dump_cfg_stats if TDF_STATS is enabled. + (dump_cfg_stats): New. + (debug_cfg_stats): New. + + * tree-dfa.c (SCALE, LABEL, PERCENT): Move ... + * tree-flow.h: ... here + +2003-01-29 Diego Novillo + + * tree-cfg.c (make_blocks): Do not start a new block if the + previous statement and the current statement are labels of the same + kind. + +2003-01-29 Diego Novillo + + * tree-cfg.c (parent_array): Make file local. + (label_to_block_map): New file local variable. + (build_tree_cfg): Initialize label_to_block_map. + (make_edges): Don't pre-scan all the blocks looking for blocks with + labels. + (make_exit_edges): Remove argument label_to_block_map. Update all + callers. + (make_goto_expr_edges): Likewise. + (dump_tree_bb): Check that the block has a valid annotation. + (set_bb_for_stmt): If the statement is a label, add the label to + the label_to_block_map. + + * tree-pretty-print.c (dump_vops): Check that the block has a valid + annotation. + +2003-01-29 Jeff Law + + * tree-dfa.c (find_may_aliases_for): Just accept the index of + the current indirect_ref. Caller updated. + (num_indirect_refs, num_addressable_vars): New variables. + (indirect_refs, addressable_vars): New varrays. + (dump_dfa_status): Dump info on the indirect refs and + addressable vars. + (dump_alias_info): Similarly. + (compute_may_aliases): Initialize and finalize the new virtual + arrays and hash tables for indirect refs and addressable vars. + Include setup/teardown in the cost for alias analysis. + (find_may_aliases_for): Split main loop into two. The first + walks over the indirect refs and takes advantage of the + symmetric properties of the aliasing relationship to avoid + useless work. The second loop iterates over the addressable + variables. + (find_vars_r): Rework to build all three arrays we need. + +2003-01-29 Andreas Jaeger + + * tree-alias-common.c (find_func_aliases): Remove unused variable. + (display_points_to_set_helper): #if 0 function to avoid warning + about unused function. + + * tree-alias-ecr.c (ECR_new): Remove ISO C style function + definition. + * disjoint-set.c (disjoint_set_new): Likewise. + +2003-01-29 Frank Ch. Eigler + + * tree-mudflap.c (mx_xfn_indirect_ref): Use a stack of flags for + tracking pointer dereference reads vs writes. + (mf_build_check_statement_for): Pass access-type value to __mf_check. + * c-mudflap.c (mflang_register_call): Adapt to mf-runtime.h API change. + +2003-01-29 Diego Novillo + + * Makefile.in (ssa.o): Add dependency on $(TIMEVAR_H). + * timevar.def (TV_DOM_FRONTIERS): Define. + * ssa.c (compute_dominance_frontiers): Use. + +2003-01-29 Diego Novillo + + * tree-ssa-dce.c (remove_dead_stmt): Fix uninitialized use + warning. + +2003-01-28 Diego Novillo + + * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Adjust legend. + * tree-ssa.c (rewrite_into_ssa): Use TV_TREE_SSA_REWRITE_BLOCKS. + (mark_def_sites): Add comment. + +2003-01-28 Jeff Law + + * ssa.c (compute_dominance_frontiers_1): Use get_dominated_by + to avoid useless walks over all the basic blocks. Use cache + of immediate dominators to avoid silly calls to get_immediate_dominator. + Do not clear elements of the frontiers bitmap. + (compute_dominance_frontiers): Compute cache of immediate + dominators and pass it to compute_dominance_frontiers_1. Clear + the entire vector of frontiers bitmaps. + + * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Renamed from + TV_TREE_BUILD_SSA. + (TV_TREE_SSA_OTHER): New timevar. + * tree-ssa.c (rewrite_into_ssa): Updated. Use new TV_TREE_SSA_OTHER + timevar. + + * tree.h (LABEL_DECL_INDEX): Define for use by CFG builder. + * tree-cfg.c (make_exit_edges): Accept and pass though label to + block mapping array. + (make_goto_expr_edges): For simple gotos, lookup the destination + in the label to block mapping array. Zap old slow code to + handle simple gotos. + (make_edges): Build the label to block mapping array. + + * tree.h (PHI_NODE_ELT_CHECK): Provide version when ENABLE_CHECKING + is not defined. + +2003-01-28 Diego Novillo + + * tree-flow-inline.h (parent_block, set_parent_block, phi_nodes): + Assume that blocks always have valid annotations. + (add_dom_child): New function. + (dominator_children): New function. + + * tree-flow.h (struct bb_ann_d): Add field 'dom_children'. + + * tree-ssa.c (mark_def_sites): Add parameter 'idom'. + Add each block BB to the set of dominator children of BB's + immediate dominator. + (rewrite_block): Remove 'idom' parameter. + Recurse into blocks set in the dominator children bitmap. + +2003-01-28 Diego Novillo + + * flags.h (flag_disable_tree_ssa): New flag. + * c-decl.c (c_expand_body): Use it. + * toplev.c: Declare it. + (f_options): Add help text for -fdisable-tree-ssa. + * doc/invoke.texi: Add documentation for -fdisable-tree-ssa. + +2003-01-28 Diego Novillo + + * Makefile.in (TREE_FLOW_H): Add dependency on $(HASHTAB_H) + (OBJS): Temporarily remove tree-ssa-pre.o. + (tree-ssa.o, c-decl.o): Add dependency on $(TREE_DUMP_H). + + * c-decl.c: Include tree-dump.h + + * c-pretty-print.c (dump_c_node): Fix rendering of GOTO_STMTs to + computed locations. + (op_prio): Don't abort on unknown operators. + + * c-simplify.c (mostly_copy_tree_r): Don't copy statement + annotations. + + * gimplify.c (simplify_addr_expr): Mark the RHS of the simplified + ADDR_EXPR addressable. + (mostly_copy_tree_r): Don't copy statement annotations. + + * old-tree-inline.c (walk_tree): Handle SSA_NAME nodes. + + * timevar.def (TV_TREE_RDEFS): Remove. + (TV_TREE_BUILD_SSA): Define. + (TV_TREE_DFA): Define. + + * tree-cfg.c: Update copyright notices. + Remove doxygen markers everywhere. + (remove_unreachable_block): New local function + (remove_unreachable_blocks): Call it. + (remove_bb): Rename from remove_tree_bb. Update all callers. + (validate_loops): Remove unused function. + (block_invalidates_loop): Remove unused function. + (remove_stmt): Invalidate the defining statement of all the + definitions made by the statement. + Remove the annotation before replacing the statement with + empty_stmt_node. + + * tree-dfa.c: Update copyright notices. + Remove doxygen markers everywhere. + (struct clobber_data_d): Remove existing fields. Add fields 'stmt' + and 'prev_vops'. Update all users. + (alias_tags): Rename from alias_leaders. + (num_alias_tags): Rename from num_alias_leaders. + (struct dfa_stats_d): Declare. + (struct dfa_counts_d): Remove. Update all users. + (TRM_*): Remove. Update all users. + (find_tree_refs): Remove. Update all users. + (get_stmt_operands): Rename from find_refs_in_stmt. Update all users. + (get_expr_operands): Rename from find_refs_in_expr. Update all users. + (add_stmt_operand): New function. + (set_def): New function. + (add_use): New function. + (add_vdef): New function. + (add_vuse): New function. + (create_phi_node): New function. + (copy_stmt): New function. + (compute_immediate_uses): New function. + (compute_immediate_uses_for): New function. + (compute_reached_uses): New function. + (compute_reaching_defs): New function. + (add_immediate_use): New function. + (create_var_ann): New function. + (create_stmt_ann): New function. + (dump_immediate_uses): New function. + (debug_immediate_uses): New function. + (dump_immediate_uses_for): New function. + (debug_immediate_uses_for): New function. + (create_ref_list, empty_ref_list, add_ref_to_list_begin, + add_ref_to_list_end, add_list_to_list_begin, add_list_to_list_end, + find_list_node, rli_start, rli_start_last, rli_start_at, + rli_delete, add_ref_to_list_after, tree_ref_size, create_ref, + add_ephi_arg, add_referenced_var, replace_ref_with, + try_replace_ref_with, replace_ref_r, replace_ref_stmt_with, + remove_ref, remove_def, reset_def_def_links, replace_phi_arg_with, + create_tree_ann, function_may_recurse_p, dump_ref, debug_ref, + dump_ref_list, dump_ref_array, debug_ref_list, debug_ref_array, + dump_phi_args, dump_if_different, count_tree_refs, ref_type_name, + ref_defines, is_killing_def, tree_ref_structure, output_ref): + Remove. Update all users. + (dump_referenced_vars): Remove parameter 'details'. Update all + users. + (dump_variable): Don't abort if the variable is nil. Display all + the aliases for the variable. + (dump_dfa_stats): Handle new counters. + (collect_dfa_stats): Likewise. + (collect_dfa_stats_r): Likewise. + (find_vars_r): New function. + (compute_may_aliases): Call it via walk_tree before computing aliases. + Only use alias tags if -ftree-points-to is not given. + Call add_may_alias. + (find_may_aliases_for): Only use alias tags if -ftree-points-to is + not given. + (add_may_alias): New function. + (find_alias_tag): Rename from find_alias_leader. + (dump_alias_info): New function. + (debug_alias_info): New function. + (htab_hash_var): New function. + (htab_var_eq): New function. + (get_virtual_var): New function. + + * tree-dump.c (struct dump_option_value_info): Rename -block to + -blocks. Add new option -vops. + (dump_function): Don't display which pass enabled the dump. + + * tree-flow-inline.h: Update copyright notices. + (var_ann): New function. + (stmt_ann): New function. + (ann_type): New function. + (bb_ann): Rename from bb_annotation. + (may_aliases): New function. + (set_may_alias_global_mem): New function. + (may_alias_global_mem_p): New function. + (set_indirect_ref): New function. + (indirect_ref): New function. + (is_dereferenced): New function. + (modify_stmt): New function. + (unmodify_stmt): New function. + (stmt_modified_p): New function. + (def_op): New function. + (use_ops): New function. + (vdef_ops): New function. + (vuse_ops): New function. + (immediate_uses): New function. + (reaching_defs): New function. + (phi_nodes): New function. + (same_var_p): New function. + (gsi_step_in_bb): Re-implement. Check if the iterator stepped out + of the block by calling bb_for_stmt. + (gsi_end_bb_p): Rename from gsi_end_bb. Update all users. + Call gsi_stmt to determine if the iterator has reached the end of + the block. + (ref_id, ref_type, ref_bb, ref_stmt, ref_var, imm_uses, + reached_uses, imm_reaching_def, set_imm_reaching_def, + set_phi_arg_def, phi_arg_def, set_phi_arg_edge, phi_arg_edge, + reaching_defs, phi_args, num_phi_args, phi_arg, set_phi_arg, + tree_annotation, tree_refs, add_tree_ref, remove_tree_ref, + alias_leader, set_alias_leader, set_tree_flag, clear_tree_flag, + reset_tree_flags, tree_flags, indirect_var, set_indirect_var, + bb_refs, remove_bb_ref, set_exprref_class, exprref_class, + set_exprref_inserted, exprref_inserted, set_exprref_save, + exprref_save, set_exprref_reload, exprref_reload, + set_exprref_processed, set_exprref_processed2, exprref_processed2i, + exprref_uses, set_exprref_uses, set_expruse_def, expruse_def, + set_expruse_phiop, expruse_phiop, set_expruse_phi, expruse_phi, + set_expruse_has_real_use, expruse_has_real_use, + set_exprphi_phi_args, exprphi_phi_args, num_ephi_args, ephi_arg, + set_ephi_arg, set_exprphi_downsafe, exprphi_downsafe, + set_exprphi_canbeavail, exprphi_canbeavail, set_exprphi_later, + exprphi_later, set_exprphi_extraneous, exprphi_extraneous, + exprphi_willbeavail, is_assignment_stmt, is_may_ref, is_may_def, + is_may_use, is_partial_ref, is_partial_use, is_volatile_ref, + is_volatile_def, is_volatile_use, is_clobbering_def, + is_relocating_def, is_addressof_use, is_pure_use, is_pure_def, + rli_after_end, rli_step, rli_step_rev, rli_ref, get_last_ref, + get_first_ref, ref_list_is_empty): Remove. Update all users. + + * tree-flow.h: Update copyright notices. + Remove doxygen markers. + Include hashtab.h. + (enum tree_ann_type): New. + (struct tree_ann_common_d): New. + (struct var_ann_d): New. + (struct operands_d): New. + (struct voperands_d): New. + (operands_t): New type. + (voperands_t): New type. + (struct dataflow_d): New. + (dataflow_t): New type. + (struct stmt_ann_d): New. + (tree_ann): New type. + (var_ann_t): New type. + (stmt_ann_t): New type. + (bb_ann_t): Rename from bb_ann. + (enum tree_ref_type, TRM_*, struct ref_list_node, struct + ref_list_priv, ref_list, struct tree_ref_common, struct var_ref_d, + struct var_def_d, struct var_phi_d, struct var_use_d, struct + phi_node_arg_d, phi_node_arg, struct expr_ref_common, struct + expr_phi_d, struct expr_use_d, enum tree_ref_structure_enum, union + tree_ref_d, tree_ref, struct tree_ann_d, tree_ann, enum tree_flags, + struct dfa_counts_d, ref_list_iterator): Remove. Update all users. + (TDFA_USE_OPS): Define. + (TDFA_USE_VOPS): Define. + + * tree-inline.c (walk_tree): Handle SSA_NAME nodes. + + * tree-optimize.c: Update copyright notices. + Remove doxygen markers. + (optimize_function_tree): Temporarily disable call to + tree_perform_ssapre. + Remove #if0 code. + + * tree-pretty-print.c (MASK_POINTER): Define. + (dump_vops): New function. + (dump_generic_node): Shorten made-up names for unnamed objects. + Hanlde PHI_NODE, VDEF_EXPR and SSA_NAME nodes. + Keep track of basic block transitions. + Call dump_vops if -vops dump option is given. + (op_prio): Don't abort if the operand is nil. + (dump_block_info): Don't keep track of basic block transitions. + + * tree-simple.c: Update copyright notices. + (get_base_symbol): Call STRIP_NOPS. + Handle SSA_NAME nodes. + + * tree-simple.h: Update copyright notices. + (gsi_end_p): Rename from gsi_end. Update all callers. + + * tree-ssa-ccp.c: Update copyright notices. + Update code to use the new SSA infrastructure. + (const_values): New hash table to keep track of constants. + (struct value_map_d): New. + (cfg_edges): Rename from edges. Update all users. + (set_value): New function. + (get_value): New function. + (get_default_value): New function. + (value_map_hash): New function. + (value_map_eq): New function. + + * tree-ssa-dce.c: Update copyright notice. + Update code to use new SSA infrastructure. Factor some code into + new functions. + (dom_info): Declare with file scope. + (struct stmt_stats): Add fields 'total_phis' and 'removed_phis'. + (needed_stmts): New hash table to keep track of needed statements. + (stmt_useful_p): New function. + (find_useful_stmts): Call it. + (remove_dead_stmt, remove_dead_phis): New functions. + (remove_dead_stmts): Call them. + (need_to_preserve_store): Preserve stores to volatile variables. + (tree_ssa_dce): Rename from tree_ssa_eliminate_dead_code. Update + all users. + + * tree-ssa.c: Update copyright notice. + Change basic algorithm to rewrite the function into SSA form + instead of building factored use-def chains. + Include hashtab.h and tree-dump.h + (next_ssa_version): New global variable. + (def_blocks): New file local variable. + (struct def_blocks_d): New. + (currdefs): New file local variable. + (struct currdef_d): New. + (rewrite_into_ssa): Rename from build_tree_ssa. Update all users. + Call compute_may_aliases, mark_def_sites and rewrite_block. + (rewrite_block): Rename from search_fud_chains. Call + rewrite_stmts. + (mark_def_sites): New function. + (set_def_block): New function. + (rewrite_stmts): New function. + (rewrite_stmt): New function. + (rewrite_operand): New function. + (rewrite_out_of_ssa): New function. + (remove_phi_node): New function. + (register_new_def): New function. + (def_blocks_free): New function. + (def_blocks_hash): New function. + (def_blocks_eq): New function. + (currdef_hash): New function. + (currdef_eq): New function. + (debug_def_blocks): New function. + (debug_def_blocks_r): New function. + (build_fud_chains, compute_reaching_defs, follow_chain, + dump_reaching_defs, debug_reaching_defs, set_ssa_links): Remove. + (remove_phi_arg): Rename from tree_ssa_remove_phi_alternative. + Update all users. + (init_tree_ssa): Set next_ssa_version to 1. + Create hash tables def_blocks and currdefs. + (delete_tree_ssa): Accept a FUNCTION_DECL tree as argument. Update + all users. + (currdef_for): Add new parameter 'create_default'. If nonzero, + create a new SSA name if none is found for the variable. + (set_currdef_for): Search in the currdefs hash table. + + * tree.c (tree_node_kind): Add new values phi_kind and + ssa_name_kind. + (tree_node_kind_names): Likewise. + (tree_size): Handle PHI_NODE and SSA_NAME nodes. + (make_node): Likewise. + (tree_node_structure): Likewise. + (phi_node_elt_check_failed): New function. + (make_phi_node): New function. + (make_ssa_name): New function. + (build_vdef_expr): New function. + + * tree.def (SSA_NAME): New code. + (VDEF_EXPR): New code. + (PHI_NODE): New code. + + * tree.h (union tree_ann_d): Forward declare. + (struct tree_common): Change type of field 'ann'. + (PHI_NODE_ELT_CHECK): Define. + (phi_node_elt_check_failed): Declare. + (VDEF_RESULT): Define. + (VDEF_OP): Define. + (SSA_NAME_DECL): Define. + (SSA_NAME_DEF_STMT): Define. + (SSA_NAME_VERSION): Define. + (struct tree_ssa_name): New. + (PHI_RESULT): Define. + (PHI_NUM_ARGS): Define. + (PHI_ARG_CAPACITY): Define. + (PHI_ARG_ELT): Define. + (PHI_ARG_EDGE): Define. + (PHI_ARG_DEF): Define. + (struct phi_arg_d): New. + (struct tree_phi_node): New. + (SSA_DECL_P): Define. + (SSA_VAR_P): Define. + (enum tree_node_structure_enum): Add values TS_SSA_NAME and + TS_PHI_NODE. + (union tree_node): Add fields 'ssa_name' and 'phi'. + (make_phi_node): Declare. + (make_ssa_name): Declare. + (build_vdef_expr): Declare. + (TDF_BLOCKS): Rename from TDF_BLOCK. + (TDF_VOPS): Define. + + * doc/invoke.texi: Document new tree dump option -vops. Update + documentation for switch -blocks. + +2003-01-27 Jeff Law + + * gimplify.c (simplify_return_expr): Correctly handle return + expressions with side effects in functions returning void. + + * tree-ssa-ccp.c (widen_bitfield): Do not try to widen anything + except constant integers. + +2003-01-26 Jeff Law + + * c-simplify.c (simplify_decl_stmt): Fix comment typo. + Use correct predicate when "simplifying" a static initializer. + +2003-01-26 Andreas Jaeger + + * Makefile.in (gt-dependence.h): New rule. + +2003-01-23 Jeff Law + + * c-simplify.c (simplify_decl_stmt): Arrange to examine initializers + for static variables. + * gimplify.c (simplify_constructor): Kill initial is_simple_constructor + check. + (simplify_modify_expr): Get the type from the destination rather than + the toplevel expression. Handle case where type is ARRAY_TYPE. Ignore + TREE_STATIC for the RHS. + +2003-01-24 Frank Ch. Eigler + + * tree-mudflap.c (mf_varname_tree): Check for non-NULL DECL_NAME + before trying to cplus_demangle it. + +2003-01-23 Jeff Law + + * tree-cfg.c (make_exit_edges): Fix thinkos. + +2003-01-22 Jeff Law + + * tree-cfg.c (make_goto_expr_edges): Check the underlying + LABEL_DECL, not the LABEL_EXPR for FORCED_LABEL and NONLOCAL_LABEL. + + * gimplify.c (simplify_expr, case GOTO_EXPR): Identify and mark + labels which are targets of nonlocal gotos and mark functions which + have labels which are targets of nonlocal gotos. + (simplify_expr, case LABEL_DECL): New case. Mark labels which + have their address taken. + * tree-cfg.c (is_nonlocal_label_block): Remove. All callers + updated. + (make_exit_edges, case GOTO_EXPR): Handle computed gotos sanely. + (make_exit_edges, case CALL_EXPR): Handle abnormal edges from + nonlocal gotos at call sites. + (make_exit_edges, case RETURN_EXPR): Likewise. + (make_exit_edges, case MODIFY_EXPR): New case to handle abnormal + edges from nonlocal gotos as call sites. + (make_goto_expr_edges): Handle computed gotos and nonlocal gotos. + (is_ctrl_altering_stmt): Handle abnormal edges in CALL_EXPRs + functions which receive nonlocal gotos. Similarly for CALL_EXPRs + which occur on the RHS of a MODIFY_EXPR. + * tree.h (FORCED_LABEL, NONLOCAL_LABEL): New defines. + (FUNCTION_RECEIVES_NONLOCAL_GOTO): Likewise. + +2003-01-22 Frank Ch. Eigler + + * doc/invoke.texi: Provide some information about -fmudflap. + + * tree-mudflap.c (mf_varname_tree): Conditionally invoke the C++ + demangler in libiberty. Reduce function printing verbosity. + (mf_file_function_line_tree): Reduce function printing verbosity. + (mudflap_enqueue_decl): Use COMPLETE_TYPE_P to avoid trying to + register (get size of) void-typed objects. + +2003-01-21 Jose Renau + + * tree-flow-inline.h (get_lineno): Return -1 for nodes without + locus information. + (get_filename): Return "???" for nodes without locus information. + +2003-01-21 Jeff Law + + * tree-cfg.c (cleanup_switch_expr_graph): Wrap declaration of + switch_expr with ENABLE_CHECKING block. + + * c-simplify.c (is_last_stmt_of_scope): Wrap definition and + declaration inside and ENABLE_CHECKING block. + +2003-01-20 Frank Ch. Eigler + + * tree-mudflap.c (mx_xfn_indirect_ref): Use new TREE_LOCUS field + as a predicate for finding TREE_FILENAME etc. + +2003-01-16 Daniel Berlin + + * Remove dead PRE code. + * tree-ssa-pre.c (tree_perform_ssapre): Collect left occurrences and + kills *after* finishing collecting all expressions. + +2003-01-15 Jeff Law + + * Death to WFL nodes. + * c-aux-info.c: Replace DECL_SOURCE_FILE and DECL_SOURCE_LINE with + TREE_FILENAME and TREE_LINENO respectively when retrieving file + and line information. Use TREE_LOCUS to copy existing information + from one node to another. Use annotate_with_file_line to add or + replace location information on a node. Remove support for + EXPR_WITH_FILE_LOCATION nodes. Remove STRIP_WFL statements. + * c-common.c, c-parse.in, c-pretty-print.c, dbxout.c: Likewise. + * diagnostic.c, dwarf2out.c, dwarfout.c: Likewise. + * except.c, integrate.c, stmt.c, tree-alias-common.c: Likewise. + * tree-cfg.c, tree-dfa.c, tree-dump.c, tree-flow-inline.h: Likewise. + * tree-mudflap.c, tree-pretty-print.c, tree-simple.c: Likewise. + * tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-pre.c: Likewise. + * varasm.c, xcoffout.c: Likewise. + * config/alpha/alpha.c: Likewise. + * config/mips/mips.c: Likewise. + * c-decl.c: Likewise. + (duplicate_decls): Also copy TREE_LOCUS from olddecl to newdecl. + (finish_function): Save and restore the current filename and + linenumber around genericizing of the function tree. + * c-simplify.c (c_simplify_stmt): Use annotate_all_with_file_line + instead of wrap_all_with_wfl. Remove STRIP_WFL statements. + * expr.c (expand_expr): Emit line number notes for expressions + with attached file/line information. Remove EXPR_WITH_FILE_LOCATION + support. + * gimplify.c: Kill STRIP_WFL statements. Remove EXPR_WITH_FILE_LOCATION + support. + (simplify_expr_wfl): Kill. + (annotate_stmt_with_file_line): Renamed from wrap_with_wfl. + (annotate_all_with_file_line): Renamed from wrap_all_with_wfl. + (simplify_expr): Save and restore the current file/line around + simplification of the given expression. Add annotation to more + nodes created during simplification. + (simplify_self_mod_expr): Add file/line location to nodes we create. + (get_initialized_tmp_var): Similarly. + * old-tree-inline.c (expand_call_inline): Use annotate_with_file_line + to add file/line information to nodes instead of wrapping them + with EXPR_WITH_FILE_LOCATION nodes. + * print-tree.c: Use TREE_FILENAME and TREE_LINENO instead of + DECL_SOURCE_FILE and DECL_SOURCE_LINE respectively. Remove + support for EXPR_WITH_FILE_LOCATION nodes. + (print_node): Dump any file/line information that is attached to + the given node. + * tree-inline.c (walk_tree): Set lineno appropriately. + * tree-simple.h (annotate_all_with_file_line): Renamed from + wrap_all_with_wfl. Remove STRIP_WFL statements. + * tree.c (build_expr_wfl): Kill. + (make_node): Use annotate_with_file_line. + (annotate_with_file_line): New function. + * tree.def: Remove EXPR_WITH_FILE_LOCATION. + * tree.h (tree_common): Add locus field. Remove references to + EXPR_WITH_FILE_LOCATION. + (tree_decl): Remove locus field. + (STRIP_WFL, EXPR_WFL_*): Kill. + (DECL_SOURCE_LOCATION, DECL_SOURCE_FILE, DECL_SOURCE_LINE): Kill. + (TREE_LOCUS, TREE_FILENAME, TREE_LINENO): new. + (annotate_with_file_line): Renamed from build_expr_wfl. + + * objc/objc-act.c: Use TREE_FILENAME and TREE_LINENO to + extract file/line information from tree nodes. + +2003-01-14 Frank Ch. Eigler + + * tree-mudflap.c (mx_xfn_indirect_ref): Handle ARRAY_REF of + a COMPONENT_REF specially to avoid unnecessary checks. + +2003-01-13 Frank Ch. Eigler + + Front-end generalization. + * Makefile.in (C_AND_OBJC_OBJS): Add c-mudflap.o and dependencies. + * tree-mudflap.c: Don't include "c-tree.h" any more. + (mf_init_extern_trees): Divert to mflang_lookup_decl(). + (mf_enqueue_register_call, mf_flush_enqueued_calls): Move and rename + these functions. + * tree-mudflap.h: Declare new mflang_* routines. + * c-mudflap.c: New file with C front-end mflang_* routines. + * tree-nomudflap.c (*): Call internal_error instead of abort. + +2003-01-07 Steven Bosscher + + * Makefile.in (check-g95): New test target. + (check-f95): Alias for check-g95. + +2003-01-07 Diego Novillo + + * tree-dump.c (dump_function_to_file): New function. + (dump_function): Call it. + Convert argument declaration to K&R format. + * tree-dump.h: Include splay-tree.h. + (dump_function_to_file): Declare. + + * tree-optimize.c (optimize_function_tree): Remove unused variables + dump_file and dump_flags. + (dump_current_function): Remove. Update all users by calling + dump_function instead. + * tree.h (dump_current_function): Remove declaration. + + * Makefile.in (TREE_DUMP_H): Define. + Update targets depending on tree-dump.h to depend on $(TREE_DUMP_H). + (tree-ssa-cp.o): Remove unused target. + (tree-cfg.o): Add dependency on $(TREE_DUMP_H). + (tree-optimize.o): Likewise. + (tree-ssa-dce.o): Likewise. + (tree-ssa-ccp.o): Likewise. + (tree-ssa-pre.o): Likewise. + +2003-01-02 Daniel Berlin + + * tree-ssa-pre.c (rename_2): Fix a false matching condition. + This is actually fallout from is_default_def change. + +2003-01-02 Jason Merrill + + * c-simplify.c (c_genericize): Dump more info about the function. + Use dump_function. + * tree-dump.c (dump_function): Move from cp/optimize.c. + * tree-dump.h: Declare it. + + * gimplify.c (mostly_copy_tree_r): Remove unnecessary cases. + (unshare_expr): New fn. + * tree-inline.c (mark_local_for_remap_r, unsave_r): New fns, adapted + from C++ versions. + (lhd_unsave_expr_now): Likewise. + * tree.c (unsave_expr_now): Remove. + (unsafe_for_reeval): Labels and BIND_EXPRs are only somewhat unsafe. + + * gimplify.c (simplify_function_tree): Add an outer BIND_EXPR if + needed. + (voidify_wrapper_expr): Not static. Abort if we try to voidify an + expression with TREE_ADDRESSABLE type. Be clever with INDIRECT_REFs. + (foreach_stmt): Avoid redundant work. + (create_tmp_var): Abort if we try to create a temp of ADDRESSABLE type. + (simplify_expr): Simplify VTABLE_REF. + * c-simplify.c (simplify_decl_stmt): Ignore DECL_EXTERNAL decls. + (simplify_stmt_expr): Fix thinko. + (simplify_block): Don't ignore partial scopes. + (simplify_condition): New fn. + (simplify_c_loop, simplify_if_stmt, simplify_switch_stmt): Call it. + * expr.c (expand_expr) [BIND_EXPR]: Handle statics better. + * tree-inline.c (remap_decl): Remap all decls. + (declare_return_variable): Be clever with INDIRECT_REFs. + (expand_call_inline): If we have an explicit return slot, the inlined + body is void. + (walk_tree): Fix type handling. + (copy_tree_r): Don't walk into decls. + * tree-simple.c (is_simple_unary_expr): Handle VTABLE_REF. + (is_simple_id): Allow RESULT_DECL. + * tree-simple.h (gsi_stmt): Strip WFLs and NOPs. + + * gimplify.c (simplify_cond_expr): Handle void arms. Add target parm. + (simplify_modify_expr): Pass it. Add special handling for COND_EXPR + and CONSTRUCTOR (from Daniel Berlin). Add want_value parm. + (simplify_expr): Pass new args. Loop sooner if language-specific + simplification happened. + (simplify_return_expr): Pass the whole MODIFY_EXPR to simplify_expr. + (simplify_target_expr): Simplify. + + * tree.def (CATCH_EXPR, EH_FILTER_EXPR): New tree codes. + * except.c (expand_eh_handler): New fn. + (expand_eh_region_end_allowed): If no types are allowed, hand off to + expand_eh_region_end_must_not_throw. + * except.h: Declare expand_eh_handler. + * expr.c (expand_expr) [TRY_CATCH_EXPR]: Use it. + [CATCH_EXPR, EH_FILTER_EXPR]: New cases. + * gimplify.c (simplify_expr) [EXC_PTR_EXPR, CATCH_EXPR, + EH_FILTER_EXPR]: New cases. + (gimple_build_eh_filter): New fn. + (maybe_protect_cleanup): New fn. + (gimple_push_cleanup): Call it. + (simplify_cleanup_point_expr): Fix thinko. + * c-simplify.c (simplify_cleanup): Call it. + * tree-simple.h: Declare it. + * Makefile.in (gimplify.o): Depend on except.h. + * tree.h (CATCH_TYPES, CATCH_BODY): New macros. + (EH_FILTER_TYPES, EH_FILTER_FAILURE): New macros. + * tree-simple.c (is_simple_id): Allow EXC_PTR_EXPR. + * c-pretty-print.c (dump_c_node) [CLEANUP_POINT_EXPR]: Support. + * tree-pretty-print.c (dump_generic_node): Likewise. + [CATCH_EXPR, EH_FILTER_EXPR, EXC_PTR_EXPR]: Support. + + * c-pretty-print.c (NIY): Print operands. + (dump_c_tree): Don't look at TREE_CHAIN if it doesn't matter. + (dump_c_node) [ARRAY_TYPE]: Handle non-constant array bounds. + [CALL_EXPR]: Pass spc down. + [VTABLE_REF]: Support. + (op_prio) [TARGET_EXPR]: Support. + (print_call_name): Handle function pointers. + * tree-pretty-print.c: Likewise. + +2002-12-31 Steven Bosscher + + * gimplify.c (create_tmp_var_noc): Remove unused function. + * tree-simple.h: Kill prototype. + +2002-12-30 Diego Novillo + + * tree-flow.h (tree_find_loops): Remove unused declaration. + +2002-12-29 Daniel Berlin + + * toplev.c: Add flag_ip, enable by default at -O4+ (This is not + set in stone, and thus, not documented). + (decode_f_option): Add warning if andersen's PTA is selected but + not compiled in. + + * flags.h: Add flag_ip. + + * tree-alias-ander.c: Fix todo. + (andersen_function_call): Return 1 if we don't need to process + the function. + (ptset_map): New map, cache points-to sets. + (andersen_op): We can do IP on all statics without help. + (andersen_init): Only init once if we are doing ip analysis. + (andersen_cleanup): Don't cleanup if we need the info for ip. + (andersen_add_var): Clear points-to set if it exists already. + (andersen_add_var_same): Ditto. + (andersen_function_call): We can do interprocedural analysis on + statics. + (andersen_may_alias): Cache points-to sets. + + * c-decl.c (c_expand_body): Don't throw away tree if flag_ip is + on, even if they are uninlinable, they may be wanted for ip + optimizations. + + * tree-alias-common.c (get_values_from_constructor): New + function to collect alias_typevars from constructors. + (alias_annot): Fix where the GTY is so gengtype picks it up. + (intra_function_call): Ignore non-pointers for global var + assignment. What arguments point to can now point to a global var + as well. + (find_func_aliases): We need to handle decl's with initials as + well. + Only call intra_function_call if we have to. + Handle constructors. + (create_fun_alias_var): Incoming pointer arguments could be + pointing to a global var, unless this is a static function and we + are doing interprocedural analysis. + (create_alias_vars): Take an fndecl argument, and use it. + (init_alias_vars): Handle ip_partial as well. + (ptr_may_alias_var): Simplify, fix. + + * tree-alias-common.h (tree_alias_ops): function_call now returns + an int, and we have an extra member named ip_partial. + + * tree-alias-steen.c (steen_ops): We can't do ip_partial. + (steen_function_call): Update definition and return 1. + + * tree-dfa.c (compute_may_aliases): Call create_alias_vars with + current_function_decl. + + * tree-flow.h (create_alias_vars): Remove proto from here, it's + in tree-alias-common.h. + (tree_perform_ssapre): Take a tree, like the other optimizers. + + * tree-optimize.c (optimize_function_tree): Call + tree_perform_ssapre with a tree. + + * tree-ssa-pre.c: Remove dead, #if 0'd code. + (tree_perform_ssapre): Use passed in tree. + +2002-12-23 Frank Ch. Eigler + + * tree-mudflap.c (mf_decl_cache_locals, mf_decl_clear_locals): New + functions. + (mudflap_c_function): Call them before/after basic transforms. + (mf_cache_shift_decl_l, ..._mask_l): New variables to track local + VAR_DECL shadows of cache parameters. + (mf_build_check_statement_for): Use and update them. + +2002-12-23 Frank Ch. Eigler + + * tree-mudflap.c (mx_register_decls): Trust incoming TREE_ADDRESSABLE + instead of own timetaking analysis. + (mf_find_addrof, mx_xfn_find_addrof): Removed functions. + +2002-12-23 Steven Bosscher + + * tree-dfa.c: Add doxygen markers in comments. + +2002-12-22 Diego Novillo + + * gimplify.c: Undo the following change: + 2002-12-11 Diego Novillo + * gimplify.c (simplify_return_expr): return statements should + only have a GIMPLE value as argument. + + * tree-simple.c: Fix grammar for return statements. + +2002-12-20 Frank Ch. Eigler + + * tree-mudflap.c (mf_init_extern_trees): Rewrite last change + without using statement-expressions. + +2002-12-19 Diego Novillo + + * tree-cfg.c (build_tree_cfg): Make sure that TV_TREE_CFG + is popped properly. + +2002-12-19 Frank Ch. Eigler + + * tree-mudflap.c (mf_init_extern_trees): Abort gracefully if + was not included. + (*): Correct some minor compiler warnings elsewhere. + +2002-12-18 Diego Novillo + + * configure: Regenerate with autoconf 2.13. + +2002-12-17 Ben Elliston + + * tree-optimize.c (optimize_function_tree): Temporarily + disable SSA optimizations if -fmudflap is present. + +2002-12-16 Ben Elliston + + * tree-mudflap.c (mx_flag): Assert that the tree node is valid. + +2002-12-14 Jason Merrill + + * tree-dump.c (dump_files): Add .generic. Move .inlined after it. + * tree.h (tree_dump_index): Likewise. + * c-simplify.c (c_genericize): Emit original and generic dumps here. + * c-decl.c (c_expand_body): Not here. + +2002-12-13 Ben Elliston + + * tree-dfa.c (find_refs_in_expr): Terminate comment. + +2002-12-12 Steven Bosscher + + * tree-cfg.c: Update doxygen documentation. + * tree-dfa.c: Add doxygen documentation. + +2002-12-11 Steven Bosscher + + * tree-cfg.c: Add doxygen markers in comments. + * tree-optimize.c: Likewise. + * tree-ssa.c: Likewise. + +2002-12-11 Diego Novillo + + * gimplify.c (simplify_return_expr): return statements should only + have a GIMPLE value as argument. + * tree-cfg.c (call_expr_flags): New function. + (is_ctrl_altering_stmt): Call it. + * tree-flow.h (extern): Declare it. + +2002-12-06 Diego Novillo + + * tree-cfg.c (make_goto_expr_edges): Temporary hack to prevent + removing blocks with nonlocal labels. + (is_nonlocal_label_block): Return true if DECL_NONLOCAL is set for + the label. + + * tree-dfa.c (alias_leaders): New local array. + (num_alias_leaders): New local variable. + (find_alias_leader): New local function. + (may_access_global_mem): New local function. + (find_may_aliases_for): Call them. + (compute_may_aliases): Allocate and deallocate alias_leaders. + Show alias information if -fdump-tree-...-alias flag is given. + (may_alias_p): Return true if both variables are the same. + (find_refs_in_expr): Strip WFL and NOPs from the parent statement. + If a pointer relocation is due to a function call, assignment from + a global or a function argument, mark the pointer as a may-alias + for global storage. + (dump_referenced_vars): Reformat output. + (dump_variable): Likewise. + + * tree-dump.c (dump_option_value_info): Add entry for TDF_ALIAS. + * tree.h (TDF_ALIAS): Define. + * doc/invoke.texi: Document new flag. + + * tree-flow-inline.h (may_alias_global_mem_p): New function. + * tree-flow.h (enum tree_flags): Add value TF_MAY_ALIAS_GLOBAL_MEM. + (may_alias_global_mem_p): Declare. + + * tree-simple.c (get_base_symbol): Return NULL_TREE, not NULL. + * tree-ssa-ccp.c (tree_ssa_ccp): Remove unused variable. + * tree-ssa-dce.c (need_to_preserve_store): Call + decl_function_context instead of DECL_CONTEXT. + If the symbol may alias global memory, return nonzero. + + * tree-ssa.c (dump_reaching_defs): Reformat output. + (set_currdef_for): Walk the alias leader chain, setting CURRDEF for + all the alias sets that may be affected by the definition. + +2002-12-06 Daniel Berlin + + * tree-dfa.c (may_alias_p): Fix global variables and points-to. + +2002-12-03 Daniel Berlin + + * tree-ssa.c (delete_tree_ssa): Move call to delete_alias_vars + above resetting num_referenced_vars. + +2002-12-03 Diego Novillo + + * Makefile.in: Add dependencies on $(TM_H) and coretypes.h for the + files mentioned below. + * old-tree-inline.c: Include tm.h and coretypes.h. + * c-pretty-print.c: Likewise. + * disjoint-set.c: Likewise. + * tree-alias-ecr.c: Likewise. + * tree-alias-type.c: Likewise. + * tree-alias-ander.c: Likewise. + * tree-alias-steen.c: Likewise. + * tree-alias-common.c: Likewise. + * tree-ssa.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-cfg.c: Likewise. + * tree-dfa.c: Likewise. + * tree-optimize.c: Likewise. + * c-simplify.c: Likewise. + * gimplify.c: Likewise. + * tree-browser.c: Likewise. + * simple-break-elim.c: Likewise. + * simple-goto-elim.c: Likewise. + * tree-dchain.c: Likewise. + * c-call-graph.c: Likewise. + * tree-simple.c: Likewise. + * tree-nomudflap.c: Likewise. + * tree-pretty-print.c: Likewise. + * tree-ssa-dce.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * dependence.c: Likewise. + * tree-mudflap.c: Likewise + (mx_xfn_indirect_ref): Use size_type_node instead of c_size_type_node. + +2002-12-03 Diego Novillo + + * tree-dfa.c: Undo this change that causes bootstrap + failures: + + 2002-12-02 Diego Novillo + + * tree-dfa.c (may_alias_p): Artificial variables + can also be aliased. + +2002-12-03 Andreas Jaeger + + * tree-simple.c (right_assocify_expr): Remove unused variable. + +2002-12-02 Andrew MacLeod + + * gimplify.c (simplify_cleanup_point_expr): gsi_stmt can return NULL, + use gsi_end. + * tree-cfg.c (make_blocks): Use gsi_end, gsi_stmt can return NULL. Set + basic_block for empty_stmt_node containers. + (make_edges): Stmt's can be NULL. + (make_ctrl_stmt_edges, make_exit_edges, make_loop_expr_edges, + make_cond_expr_edges, make_goto_expr_edges, is_nonlocal_label_block, + block_invalidates_loop, cleanup_control_flow, cleanup_cond_expr_graph, + cleanup_switch_expr_graph, disconnect_unreachable_case_labels, + find_taken_edge, tree_cfg2dot, successor_block, is_latch_block, + switch_parent, first_stmt, last_stmt): Check for first_stmt() or + last_stmt() returning NULL. + (remove_tree_bb, first_exec_stmt): Use gsi_end. + (last_stmt_ptr): Iterate to find last execuatbel stmt_ptr in a block. + (gsi_start_bb): Return first non-empty stmt, if there is one. + (set_bb_for_stmt): Don't decend into an empty_stmt_node. + * tree-dfa.c (find_tree_refs): Use gsi_end. + (collect_dfa_stats): Use gsi_end_bb. + * tree-flow-inline.h (gsi_step_bb): split. + (gsi_step_in_bb): gsi_step with explicit bb specified. Never return + empty_stmt_node. + (gsi_start_bb): Move to tree-cfg.c. + (gsi_end_bb): New. Have we reached the end of a basic block. + * tree-flow.h (gsi_start_bb): Make external. + (gsi_end_bb, gsi_step_in_bb): New prototypes. + * tree-simple.h (gsi_end): renamed from gsi_after_end. + (gsi_stmt): Return NULL if stmt is an empty_stmt_node or error mark. + * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use gsi_end. + * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts, + remove_dead_stmts): Use gsi_end_bb. + (process_worklist): Check for NULL last_stmt. + * tree-ssa-pre.c (finalize_1): Use gsi_end_bb, gsi_stmt can be NULL. + +2002-12-02 Diego Novillo + + * tree-dfa.c (dump_ref): Display '' for NULL references. + (dump_phi_args): Handle NULL arguments. + (may_alias_p): Artificial variables can also be aliased. + +2002-12-02 Daniel Berlin + + * tree-ssa-pre.c (okay_injuring_def): inj could be null. + (get_operand): Use instead of special casing INDIRECT_REF and + COMPONENT_REF everywhere. + (names_match_p): Fix. + (defs_match_p): Ignore partial uses. + (rename_2): Fix non-matching condition. + (update_old_new): Update the kills and lefts arrays. + (finalize_1): Set the bb for the new statement. + (update_ssa_for_new_use): Ditto. + (code_motion): Ditto. + (call_modifies_slot): Handle function pointers (where we end up + with a _DECL as our argument). + (pre_part_1_trav): Update the kills and lefts arrays. + Just use TREE_TYPE (ei->expr) for type of expression. + (add_left_occ): New helper function. + (process_left_occs_and_kills): Add other cases we need to handle. + (tree_perform_ssapre): Add new processed array, since for left + occurrences and kills, we need to process *all* statements, not + just ones we might consider candiates for PRE. + +2002-12-02 Diego Novillo + + * tree-dfa.c (find_refs_in_expr): Look for references in + VA_ARG_EXPR nodes. + +2002-12-01 Diego Novillo + + * tree-optimize.c (optimize_function_tree): Undo + inadvertent change in previous commit. + +2002-12-01 Diego Novillo + + * fold-const.c (operand_equal_p): Check for NULL TREE_TYPEs. + + * tree-cfg.c (remove_stmt): Call remove_ref. + (disconnect_unreachable_case_labels): Do not disconnect the edge + going to the block holding the BIND_EXPR node for the switch() + body. + (dump_tree_cfg): Call dump_current_function. + + * Makefile.in (tree-dfa.o): Depend on convert.h. + * tree-dfa.c: Include convert.h. + (remove_def): New local function. + (reset_def_def_links): New local function. + (replace_phi_arg_with): New local function. + (replace_ref_with): New function. + (try_replace_ref_with): Rename from replace_ref_in. + Also look for V_USE references on the LHS of assignments. + When replacing the callee of a CALL_EXPR, make sure that the type + of the new callee is compatible with the old one. + (replace_ref_r): Call operand_equal_p. + (remove_ref): New function. + (same_var_p): New function. + (dump_referenced_vars): Add new flag DETAILS. Update all users. + (debug_referenced_vars): Likewise. + + * tree-ssa.c (dump_reaching_defs): Change output format. + (set_ssa_links): Don't set def-def links for PHI nodes. + + * tree-ssa-ccp.c (replace_uses_in): Add new argument COMMIT. + Update all users. + + * tree-optimize.c (dump_current_function): New function. + (optimize_function_tree): Call it. + * tree.h (dump_current_function): Declare. + * c-decl.c (c_expand_body): Call dump_current_function. + * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Likewise. + * tree-ssa-pre.c (tree_perform_ssapre): Likewise. + * tree-ssa.c (build_tree_ssa): Likewise. + * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. + Dump variables and reaching definitions if TDF_DETAILS is set. + + * tree-pretty-print.c (print_call_name): Call dump_generic_node for + NOP_EXPR operands. + + * tree-ssa-pre.c: Don't include c-common.h nor c-tree.h + Replace calls to build_modify_expr with build everywhere. + Replace calls to deep_copy_node with copy_node_r everywhere. + +2002-11-29 Andreas Jaeger + + * c-call-graph.c (construct_call_graph): Fix format. + + * tree-alias-ander.c: Declare print_out_result. + + * tree-ssa-pre.c: Declare is_on_lhs and call_modifies_slot. + + * tree.h: Declare expand_asm_expr and add_var_to_bind_expr. + + * tree-inline.c: Declare remap_decls. + +2002-11-28 Daniel Berlin + + * tree-alias-common.h: Start adding doxygen docs. + + * tree-alias-common.c: Ditto + +2002-11-28 Daniel Berlin + + * tree-alias-ander.c: Convert debug defines and ifdefs into + dump_file use. + + * tree.h: Add TDI_pta. + + * tree-dump.c: Add dump-tree-pta and TDI_pta. + +2002-11-28 Diego Novillo + + * Makefile.in (tree-ssa-pre.o, tree-cfg.o, gimplify.o, tree-ssa-dce.o, + tree-ssa-ccp.o): Add dependency on $(TIMEVAR_H). + * timevar.def (TV_TREE_GIMPLIFY, TV_TREE_MAY_ALIAS, + TV_TREE_INSERT_PHI_NODES, TV_TREE_BUILD_FUD_CHAINS, TV_TREE_RDEFS): + New timers. + (TV_TREE_SSA): Remove. + (TV_INTEGRATION, TV_EXPAND): Switch order. + * c-decl.c (c_expand_body): Pop TV_EXPAND before running the tree + optimizers. + * gimplify.c (simplify_function_tree): Push/pop TV_TREE_GIMPLIFY. + * tree-cfg.c (build_tree_cfg): Push/pop TV_TREE_CFG. + * tree-dfa.c (compute_may_aliases): Push/pop TV_TREE_MAY_ALIAS. + * tree-ssa-ccp.c (tree_ssa_ccp): Push/pop TV_TREE_CCP. + * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Push/pop + TV_TREE_DCE. + Call compute_reaching_defs. + Remove debugging dumps before DCE. + * tree-ssa-pre.c (tree_perform_ssapre): Push/pop TV_TREE_PRE. + * tree-ssa.c (build_tree_ssa): Don't call compute_reaching_defs. + Don't call dump_reaching_defs. + (insert_phi_nodes): Push/pop TV_TREE_INSERT_PHI_NODES. + (build_fud_chains): Push/pop TV_TREE_BUILD_FUD_CHAINS. + (compute_reaching_defs): Push/pop TV_TREE_RDEFS. + Call dump_reaching_defs. + * tree-optimize.c (optimize_function_tree): Remove calls to + timevar_push and timevar_pop. + +2002-11-28 Diego Novillo + + * Makefile.in (tree-ssa.o): Add dependency on $(TIMEVAR_H) and + tree-alias-common.h. + (tree-dfa.o): Likewise. + (tree-optimize.o): Add dependency on $(TIMEVAR_H). + * tree-dfa.c (compute_may_aliases): Move call to delete_alias_vars + * tree-ssa.c (delete_tree_ssa): ... here. + +2002-11-27 Diego Novillo + + * tree-dfa.c (add_may_alias): Remove. Update all users. + (get_alias_index): Remove. Update all users. + (dfa_stats_d): Remove fields num_may_alias, max_num_may_alias, + num_alias_imm_rdefs and max_num_alias_imm_rdefs. Update all users. + (may_alias_p): Make extern. Move declaration to tree-flow.h. + (TRM_DEFAULT): Remove. Update all users. Update values of the + other TRM_* constants. + (create_ref): Don't initialize the PHI argument array with the + number of incoming edges. + (collect_dfa_stats): Do not traverse the function body with + walk_tree. + Free temporary hash table before returning. + (compute_may_aliases): Update comment. + (may_alias_p): Switch arguments if the first argument is not an + INDIRECT_PTR or the artificial global_var. + (find_may_aliases_for): If a pointer aliases a variable, set the + pointer to be the alias leader for the variable. + (ref_defines): Call may_alias_p. + (is_killing_def): Return false if the reaching definition is NULL. + Don't check for volatile definitions. + Change second argument to be a tree. Update all users. + + * tree-flow-inline.h (alias_imm_reaching_def): Remove. Update all + users. + (may_alias): Remove. Update all users. + (set_imm_reaching_def): Check for circularity. + (alias_leader): New function. + (set_alias_leader): New function. + (is_aliased): New function. + (is_default_def): Remove. Update all users. + + * tree-flow.h (struct var_ref_d): Remove field alias_imm_rdefs. + Update all users. + (struct var_def_d): Remove field m_default. Update all users. + (struct tree_ann_d): Remove field may_aliases. Update all users. + Add field alias_leader. + (struct dfa_counts_d): Remove fields num_may_alias and + num_may_alias_imm_rdefs. Update all users. + + * tree-ssa.c: Update documentation on may-alias processing. + (set_ssa_links): Remove third argument. Update all users. + (set_alias_imm_reaching_def): Remove. Update all users. + (create_default_def): Likewise. + (analyze_rdefs): Likewise. + (currdef_for): Move from tree-flow-inline.h + (set_currdef_for): Likewise. + (compute_reaching_defs): Rename from compute_tree_rdefs. Update + all users. + (follow_chain): Call is_killing_def instead of is_partial_def. + (tree_ssa_remove_phi_alternative): Remove unused variable ref. + (set_ssa_links): When processing V_USE references, make sure that + CURRDEF is a definition for the variable or one of its aliases. + +2002-11-26 Sebastian Pop + + * Makefile.in (OBJS): Add tree-browser.o. + (tree-browser.o): New dependency. + * tree-browser.c: New file. + * tree-browser.def: New file. + +2002-11-26 Jason Merrill + + Gimplify C++ cleanups. + * gimplify.c (voidify_wrapper_expr): Split out from... + (simplify_bind_expr): ...here. + (simplify_cleanup_point_expr): New fn. + (simplify_target_expr): New fn. + (gimple_conditional_context): New fn. + (gimple_push_condition, gimple_pop_condition): New fns. + (simplify_expr) [TRY_CATCH_EXPR]: Handle like TRY_FINALLY_EXPR. + * c-simplify.c (simplify_cleanup): New fn. + (c_simplify_stmt): Call it and lang_simplify_stmt. + (simplify_expr_stmt): Wrap the expr in a CLEANUP_POINT_EXPR. + (simplify_return_stmt, simplify_decl_stmt): Likewise. + (simplify_stmt_expr): Handle the STMT_EXPR_NO_SCOPE case. + (is_last_stmt_of_scope): Likewise. + * c-common.h: Declare c_genericize, c_simplify_stmt and + lang_simplify_stmt. + * c-common.c (lang_simplify_stmt): Define. + + Gimplify EXIT_EXPRs. + * gimplify.c (gimplify_loop_expr, gimplify_exit_expr): New fns. + (simplify_expr): Call them. + * expr.c (expand_expr) [LOOP_EXPR]: Pass 1 again for exit_flag. + + * tree-simple.c (right_assocify_expr): Also set TREE_SIDE_EFFECTS. + + * gimplify.c (simplify_expr): Call STRIP_TYPE_NOPS. + [REALPART_EXPR]: Don't just return. + + * tree-pretty-print.c (dump_c_node): Handle REFERENCE_TYPE. + * c-pretty-print.c (dump_c_node): Likewise. Handle null FOR_INIT_STMT. + +2002-11-25 Daniel Berlin + + * config.gcc: Try committing the correct version. + * tree-alias-ander.c (andersen_may_alias): Add "!= NULL" to make + return a bool. + +2002-11-24 Daniel Berlin + + * configure.in: Add --with-libbanshee, passed to us by toplevel if + libbanshee was configured. Substitute appropriate definitions for + Makefile (IE disabling tree-alias-ander building) if it wasn't. + * config.in: Regenerated. + * config.gcc: Rebuild libbanshee with stage1 on darwin to work + around system compiler problem. + * configure: Regenerated. + * Makefile.in: Add banshee stuff. + * tree-alias-ander.c: New file. + * tree-alias-ander.h: New file. + * tree-alias-common.c (get_alias_var): Fix field based stuff. + (find_func_aliases): Don't walk subtrees if we processed the tree. + (ptr_may_alias_var): Fix both field-based and non-field-based lookup. + +2002-11-22 Andrew MacLeod + + * tree-ssa-dce.c (mark_necessary): Split out mark_tree_necessary. Don't + mark if tree is already marked. + (mark_tree_necessary): New. Mark tree without processing control parent. + (mark_control_parent_necessary): Remove recursion, mark trees directly. + (need_to_preserve_store): Can expression/symbol affect external values. + (tree_ssa_eliminate_dead_code): Split. + (find_useful_stmts): Find initial set of needed statements. + (process_worklist): Find statements which calculate needed statements. + (remove_dead_stmts): Delete statements which are dead. + +2002-11-16 Jason Merrill + + Improve tree dumps. + * c-pretty-print.c, tree-pretty-print.c (dump_c_node): Handle + integers larger than a host word. + (op_prio): Handle INIT_EXPR. + * gimplify.c (simplify_bind_expr): Set TREE_SIDE_EFFECTS and type + of void_type_node on the COMPOUND_EXPRs as we walk. + * tree-simple.c (right_assocify_expr): Propagate the type from cur + rather than rhs. + + * c-decl.c (finish_function): Call c_genericize instead of + simplify_function_tree. + * c-simplify.c (c_genericize): New function. + (simplify_stmt_expr): Just genericize. + (simplify_compound_literal_expr): Likewise. + (c_build_bind_expr): Don't build a block for an artificial decl. + (simplify_decl_stmt): Add the variable to the temps list iff it's + artificial. + (c_simplify_expr): Don't call push/pop_context. + * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL. + * c-tree.h: Declare c_genericize. + + * c-simplify.c (tree_build_scope): Remove. + + Remove INIT_EXPR from GIMPLE. + * c-simplify.c (simplify_decl_stmt): Use MODIFY_EXPR. + * gimplify.c (simplify_bind_expr): Likewise. + (simplify_modify_expr): Convert INIT_EXPR to MODIFY_EXPR. + + * c-simplify.c (create_tmp_var_1): Drop; change all users to call + create_tmp_var. + (gimple_add_tmp_var): Now adds to the external temps list if + available, or directly to the function otherwise. + + Avoid gratuitous unused warnings. + * c-simplify.c (simplify_expr_stmt): Check TREE_SIDE_EFFECTS + directly. Also check for explicit conversions to void. + (expr_has_effect): Remove. + + * Makefile.in (OBJS): Remove tree-dchain.o. + + * stor-layout.c (variable_size): We don't care about + global_bindings_p if the frontend doesn't want a list of the + expressions. + +2002-11-13 Diego Novillo + + * toplev.c (parse_options_and_default_flags): Enable SSA-CCP by + default with optimization >= 1. + * tree-dfa.c (find_refs_in_expr): Clobber '*.GLOBAL_VAR', not + 'GLOBAL_VAR'. + (collect_dfa_stats): Collect statistics on '*.GLOBAL_VAR'. + (compute_may_aliases): Make sure that variable is an INDIRECT_REF. + (may_alias_p): GLOBAL_VAR should alias INDIRECT_REFs. + Only check addressability on VAR_DECLs. + (find_may_aliases_for): Make sure argument is an INDIRECT_REF. + * tree-flow-inline.h (indirect_var): Call DECL_P. + (set_indirect_var): Call DECL_P. + Create annotation if it doesn't exist. + (create_indirect_ref): Move from tree-dfa.c. + * tree-flow.h (create_indirect_ref): Declare. + * tree-ssa-ccp.c (visit_phi_node): Avoid debugging dump from + accessing uninitialized data. + * tree-ssa.c (init_tree_ssa): Create an INDIRECT_REF node for + .GLOBAL_VAR. + +2002-11-12 Diego Novillo + + * tree-cfg.c (delete_tree_cfg): Call free_aux_for_blocks. + Call free_basic_block_vars. + + * gimplify.c (simplify_expr): VA_ARG_EXPR nodes are in GIMPLE form + already. + Gimplify BIT_FIELD_REF nodes. + (simplify_call_expr): Update comment. + * tree-dfa.c (find_refs_in_expr): VA_ARG_EXPR nodes make no + data references. + Handle BIT_FIELD_REF nodes. + * tree-pretty-print.c (op_prio): Don't write an error message if + the operand is not recognized. + * tree-simple.c (is_simple_unary_expr): Handle BIT_FIELD_REFs. + (is_simplifiable_builtin): Only return false for MD builtins. + +2002-11-08 Diego Novillo + + * tree-cfg.c (cleanup_switch_expr_graph): Handle edges going to + EXIT_BLOCK_PTR. + (first_stmt): Return NULL for ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR and + INVALID_BLOCK. + * tree-dfa.c (find_refs_in_expr): Call mark_not_simple. + +2002-11-07 Diego Novillo + + * Makefile.in (tree-ssa.o, tree-cfg.o, tree-dfa.o): Add dependency + on function.h + * tree-cfg.c: Include function.h. + (build_tree_cfg): Set dump_file to NULL after closing the file. + (remove_tree_bb): Don't dump warnings about statements being + removed. + (dump_tree_cfg): Use current_function_name. + Check that the flowgraph is not empty before dumping the function + body. + (tree_cfg2dot): Use current_function_name. + * tree-dfa.c: Include function.h + (dump_dfa_stats): Use current_function_name. + * tree-optimize.c (optimize_function_tree): Set dump_file to NULL + after closing the file. + * tree-pretty-print.c (dump_generic_node): Make sure that the + flowgraph exists before displaying block boundaries. + * tree-ssa-ccp.c (tree_ssa_ccp): Set dump_file to NULL after + closing the file. + * tree-ssa.c: Include function.h. + (build_tree_ssa): Set tree_ssa_dump_file to NULL after closing the + file. + (dump_reaching_defs): Use current_function_name. + (dump_tree_ssa): Likewise. + +2002-11-07 Diego Novillo + + * tree-cfg.c (successor_block): Return EXIT_BLOCK_PTR if no + successor can be found while walking the nesting chain. + +2002-11-07 Diego Novillo + + * tree-cfg.c: Fix some formatting in code and comments. + (set_bb_for_stmt): Move from tree-flow-inline.h + * tree-dfa.c: Fix some formatting in code and comments. + * tree-flow-inline.h: Likewise. + * tree-flow.h: Likewise. + * tree-ssa.c: Likewise. + +2002-11-06 Diego Novillo + + * Makefile.in (tree-ssa-ccp.o): Add dependency on tree-inline.h + * tree-cfg.c (find_taken_edge): New function. + (cleanup_cond_expr_graph): Call it. + (disconnect_unreachable_case_labels): Call it. + + * tree-dfa.c (struct clobber_data_d): Remove field + parent_expr_p. Update all users. + (find_refs_in_expr): Remove argument parent_expr_p. Update all users. + (create_ref): Remove arguments parent_expr_p and operand_p. Update + all users. + (replace_ref_in): Rename from replace_ref_operand_with. Update all + users. Find the operand in the statement and replace it with a new + operand. + (replace_ref_r): New local function. + (is_killing_def): Also handle V_PHI references. + (output_ref): Move from tree-flow-inline.h + + * tree-flow-inline.h (ref_expr): Remove. Update all users. + (restore_ref_operand): Remove. Update all users. + (set_output_ref): Remove. Update all users. + (is_assignment_stmt): New function. + (is_may_def, is_may_use, is_partial_def, is_partial_use, + is_volatile_def, is_volatile_use, is_default_def, + is_clobbering_def, is_initializing_def, is_relocating_def, + is_addressof_use, is_pure_use): Check reference type first. + (is_pure_def): New function. + + * tree-flow.h (struct tree_ref_common): Remove fields expr_p, + operand_p and orig_operand. Update all users. + (struct tree_ann_d): Remove field output_ref. Update all users. + + * tree-ssa-ccp.c: Include tree-inline.h. + (simulate_block): Simulate every statement in the block, not its + references + (simulate_def_use_chains): Simulate statements containing uses + reached by the definition. + (substitute_and_fold): Traverse statements, not references. + Call fold_stmt. + (visit_phi_node): If PHI node is marked volatile, assume varying. + (visit_stmt): Rename from visit_expression_for. Work on a + statement, not a reference. + (visit_assignment): Rename from visit_assignment_for. Work on a + statement, not a reference. + (visit_cond_stmt): Rename from visit_condexpr_for. Work on a + statement, not a reference. + (evaluate_stmt): Rename from evaluate_expr. Work on a statement, + not a reference. + (initialize): Initialize special definitions to varying. + (replace_uses_in): Work on a statement, not an expression. + (fold_stmt): Rename from ccp_fold. Work on a statement, not an + expression. + (get_rhs): New local function. + (set_rhs): New local function. + +2002-11-06 Daniel Berlin + + * tree-flow.h: Prototype set_bb_for_stmt, last_stmt_ptr, + add_ephi_arg, num_ephi_args, set_ephi_arg, ephi_arg. + (enum tree_ref_type): Add E_LEFT, E_KILL, E_EXIT. + + * tree-cfg.c (set_bb_for_stmt): Move to tree-flow-inline.h. + (last_stmt_ptr): New function, gives pointer to last statement in + bb. + + * tree-flow-inline.h: Add exprref_processed, exprref_processed2, + expruse_phi, num_ephi_args, set_ephi_arg, ephi_arg, add_ephi_arg. + + * tree-dfa.c (tree_ref_structure): Handle E_{LEFT,KILL,EXIT}. + (ref_type_name): Ditto. + (tree_ref_size): Ditto. + (dump_ref): E_PHI's phi_args is now a varray of phi_arg structs. + (add_ephi_arg): New function. + (remove_ref_from_list): Fix crash when node not found. + (compute_may_aliases): Add timing for points-to analysis. + + * timevar.def: Add TV_TREE_PTA. + + * tree-ssa-pre.c: Start of massive cleanup and rewriting (in + preparation for load/store PRE). No more uses of ref_expr, proper + call handling. Started removing unnecessary structures and lists, + started removing redundant and inefficient operations (IE O(n^2) + loops to process all phi operands, etc). Basic load PRE implemented. + Code may look ugly due to large pieces commented out waiting for DFA + updating of refs to redo. + +2002-11-05 Diego Novillo + + * tree-cfg.c (create_block_annotations): New local function. + (create_bb_ann): Remove. Update all users. + (parent_array): New local variable. + (build_tree_cfg): Initialize it. + Call create_block_annotations. + (create_bb): Call alloc_block instead of ggc_alloc to allocate + memory for basic blocks. + Don't call set_parent_block. + Grow array parent_array. + (dump_tree_cfg): Change meaning of second argument. Make it accept + any of the TDF_* flags defined in tree.h. + (delete_tree_cfg): Call free_aux_for_blocks. + Free array parent_array. + * tree-flow-inline.h (get_filename): New function. + (is_exec_stmt): return false if T is error_mark_node. + * tree-flow.h (struct var_ref_d): Mark alias_imm_rdefs field for + garbage collection. + (get_filename): Declare. + (struct bb_ann_d): Rename from bb_ann_def. + Remove garbage collection markers. + (referenced_vars): Mark for garbage collection. + (global_var): Likewise. + (create_bb_ann): Remove. + * tree-optimize.c (optimize_function_tree): Remove CFG and SSA + after debugging dumps. + + * diagnostic.h (print_generic_stmt): Rename from print_generic_tree. + Update all users. + (print_generic_expr): Rename from print_generic_node. Update all + users. + (PPF_BRIEF): Remove. Update all users. + (PPF_BLOCK): Remove. Update all users. + (PPF_LINENO): Remove. Update all users. + (PPF_IS_STMT): Remove. Update all users. + * flags.h (flag_dump_tree_all_ssa): Remove. Update all users. + * toplev.c (f_options): Remove entry for -fdump-tree-all-ssa. + Update all users. + * tree-dump.c (dump_enable_all): Rename from dump_enable_all_ssa. + Update all users. + (dump_files): Add entry for -fdump-tree-all. + (dump_option_value_info): Remove entries for TDF_REFS and + TDF_RDEFS. + Add entry for TDF_BLOCK. + (dump_switch_p): If -fdump-tree-all was given, call dump_enable_all. + * tree-pretty-print.c (PPF_BRIEF): Remove. Update all users. + (PPF_BLOCK): Remove. Update all users. + (PPF_LINENO): Remove. Update all users. + (PPF_IS_STMT): Remove. Update all users. + (dumping_stmts): New local variable. + (print_generic_stmt): Rename from print_generic_tree. Update all + users. + Set dumping_stmts to true. + (print_generic_expr): Rename from print_generic_node. Update all + users. + Set dumping_stmts to false. + (maybe_init_pretty_print): Set last_bb to -1. + (dump_block_info): If available, dump file and line number + information for the first statement in the basic block. + * tree-ssa.c (build_tree_ssa): Dump referenced variables and + reaching definition information if -details is given. + * tree.h (enum tree_dump_index): Rename TDI_all to TDI_tu. Update + all users. + Add new index TDI_all. + (TDF_DETAILS): Change value. + (TDF_REFS): Remove. Update all users. + (TDF_RDEFS): Remove. Update all users. + (TDF_BLOCK): Define. + * doc/invoke.texi: Update documentation for -fdump-tree-... flags. + +2002-11-05 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_enqueue_decl, _constant): Use + size_in_bytes, not c_size_in_bytes. + (mf_init_extern_trees): Import uintptr_t typedef node from + mf-runtime.h. + +2002-11-01 Diego Novillo + + * tree-cfg.c (remove_tree_bb): Add new argument remove_stmts. + Update all callers. + (make_ctrl_stmt_edges): Add an edge to the body of a SWITCH_EXPR. + (make_cond_expr_edges): Don't try to linearize the if() subgraph. + (make_case_label_edges): Don't remove the fallthru edge from the + entry block to the switch() subgraph. + (cleanup_tree_cfg): Call cleanup_control_flow. + (remove_unreachable_blocks): Remove blocks of compound structures + before removing the entry block. + (remove_blocks): New local function. + (blocks_unreachable_p): New local function. + (is_nonlocal_label_block): New local function. + (find_subblocks): New local function. + (is_parent): New local function. + (gsi_remove): New function. + (remove_stmt): New local function. + (cleanup_control_flow): New local function. + (cleanup_cond_expr_graph): New local function. + (cleanup_switch_expr_graph): New local function. + (disconnect_unreachable_case_labels): New local function. + + * tree-dfa.c (remove_decl): New function. + (find_decl_location): New function. + + * tree-flow.h (gsi_remove): Declare. + (remove_decl): Declare. + (find_decl_location): Declare. + + * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove. Update all + users. + (ssa_ccp_df_delete_unreachable_insns): Remove. Update all users. + (tree_ssa_ccp): Call print_generic_tree with PPF_BLOCK. + +2002-10-31 Diego Novillo + + * tree-dfa.c (create_indirect_ref): New local function. + (find_refs_in_expr): Call it. + (create_ref): Check E_* reference types with == instead of &. + (dump_ref): Likewise. + (count_tree_refs): Likewise. + * tree-ssa.c (set_ssa_links): Update documentation comment for + save_chain. + +2002-10-31 Diego Novillo + + * tree-cfg.c (remove_tree_bb): Don't walk beyond the end of the + basic block. + +2002-10-26 Daniel Berlin + + * flags.h: Remove flag_tree_points_to from here. + * toplev.c: Include tree-alias-common.h. + (flag_tree_points_to): Now of type enum pta_type, rather than + int. + (lang_independent_options): Remove flag_tree_points_to. + (display_help): Display help for tree-points-to here. + (decode_f_option): Allow selecting of points-to algorithm. + * tree-alias-common.c (varmap): Removed. + (alias_annot): Changed to a hash table. Update all functions + appropriately. + (FIELD_BASED): New macro, switches between field-based analysis, + and field-independent analysis (field-based isn't quite done yet). + (alias_annot_entry): New, used in hash table. + (annot_eq): New function. + (annot_hash): New function. + (find_func_aliases): Handle casts, fix indendation. + (splaycount): Removed. + (splay_tree_count): Removed. + (display_points_to_set): Removed. + (splay_tree_size): Removed. + (alias_get_name): New function. + (ptr_may_alias_var): Globals are a bit funky to handle. + * tree-alias-steen.c: Use alias_get_name, rather than + print_generic_node. + (steen_simple_assign): Handle assignment of PTF's. + (test_assign): Remove. + * tree-alias-common.h (enum pta_type): New. + (alias_get_name): New. + (flag_tree_points_to): New. + +2002-10-26 Diego Novillo + + * tree-cfg.c (cleanup_tree_cfg): Uncomment call to + compact_blocks. + +2002-10-26 Diego Novillo + + * Makefile.in (tree-pretty-print.o): Depend on $(TREE_FLOW_H) + * basic-block.h (BB_COMPOUND_ENTRY): Rename from BB_CONTROL_ENTRY. + * diagnostic.h (dump_generic_tree): Remove extern declaration. + (print_generic_node_brief): Remove. Update all users. + (PPF_BRIEF): Declare. + (PPF_BLOCK): Declare. + (PPF_LINENO): Declare. + (PPF_IS_STMT): Declare. + * tree-pretty-print.c (PPF_BRIEF): New constant. + (PPF_BLOCK): New constant. + (PPF_LINENO): New constant. + (PPF_IS_STMT): New constant. + (dump_block_info): New local function. + (last_bb): New local variable. + (dump_generic_tree): Remove unused function. + (print_generic_tree): Add third argument 'flags'. Update all + users. + (print_generic_node_brief): Remove. Update all users. + (print_generic_node): Add third argument 'flags'. Update all + users. + (dump_generic_node): Add third argument 'flags'. Update all users. + If PPF_BLOCK is set, display basic block information at basic block + boundaries. + If PPF_IS_STMT is set, change the way COMPOUND_EXPR nodes are + rendered. + If PPF_BRIEF is set, don't show the bodies of control statements. + (print_declaration): + + * toplev.c (process_options): Update comment for -fdisable-simple. + + * tree-cfg.c (remove_tree_bb): Rename from tree_delete_bb. + (latch_block): Move declaration to tree-flow.h. Declare extern. + (make_blocks): Start a new block after finding a control flow + altering statement. + (make_loop_expr_blocks): Set the loop entry block to be the parent + block for the loop latch block. + (cleanup_tree_cfg): Rename from tree_cleanup_cfg. + Call compact_blocks. + (remove_tree_bb): Rename from tree_delete_bb. Update all users. + (dump_tree_bb): Rename from dump_tree_bb. Update all users. + Dump information about loop latch blocks. + (debug_tree_bb): Rename from tree_debug_bb. Update all users. + (debug_tree_cfg): Rename from tree_debug_cfg. Update all users. + (dump_tree_cfg): Rename from tree_dump_cfg. Update all users. + By default, dump the function with markers for basic block + boundaries. + (successor_block): If we can't find a successor following the + parent chain, return the next block in the linked list of blocks. + Update documentation comments. + (stmt_starts_bb_p): Don't let RETURN_EXPR start a new block. + (is_latch_block): New function. + (first_exec_stmt): Don't treat BIND_EXPR nodes as a special case. + (first_stmt): Return NULL_TREE if the block does not exist. + (last_stmt): Likewise. + + * tree-dfa.c (find_tree_refs): Rename from tree_find_refs. Update + all users. + (find_refs_in_stmt): Handle BIND_EXPR nodes. + (rli_start): Move from tree-flow-inline.h + (rli_start_last): Likewise. + (rli_start_at): Likewise. + (rli_delete): Likewise. + + * tree-flow-inline.h (gsi_start_bb): Handle NULL blocks. + (ref_list_is_empty): New function. + * tree-flow.h (rli_start): Change declaration to extern. + (rli_start_last): Likewise. + (rli_start_at): Likewise. + (rli_delete): Declare. + (latch_block): Declare. + (is_latch_block): Declare. + (get_last_ref): Change to inline declaration. + (get_first_ref): Likewise. + (ref_list_empty): Declare. + + * tree-optimize.c (delete_tree_ssa): Remove declaration. + + * tree-ssa-dce.c (mark_control_parent_necessary): Call gsi_step_bb + instead of gsi_step. + (tree_ssa_eliminate_dead_code): Likewise. + + * tree-ssa.c (compute_tree_rdefs): Rename from compute_tree_rdefs. + Update all users. + +2002-10-22 Diego Novillo + + * tree-dfa.c (struct dfa_stats_d): Add field size_tree_refs. + (tree_ref_size): New function. + (create_ref): Call it. + (dump_dfa_stats): Get total size from dfa_stats.size_tree_refs. + (count_tree_refs): Call tree_ref_size. + * tree-flow-inline.h (get_last_ref): New function. + (get_first_ref): New function. + * tree-flow.h (struct var_ref_d): Rename from var_ref. + (struct var_def_d): Rename from var_def. + (struct var_phi_d): Rename from var_phi. + (struct var_use_d): Rename from var_use. + (struct expr_phi_d): Rename from expr_phi. + (struct expr_use_d): Rename from expr_use. + * tree-ssa-ccp.c (tree_ssa_ccp): Call get_last_ref. + +2002-10-21 Daniel Berlin + + * timevar.def: Add TV_TREE_{PRE,CCP,DCE,CFG,SSA}} timevars. + + * tree-optimize.c (optimize_function_tree): Push and pop timevars + for the tree optimizers. + +2002-10-21 Diego Novillo + + * Makefile.in (OBJS): Move tree-mudflap.o ... + (C_AND_OBJC_OBJS): ... here. + +2002-10-21 Diego Novillo + + * tree-flow-inline.h (rli_start): New function. + (rli_start_rev): New function. + (rli_start_at): New function. + (rli_after_end): New function. + (rli_step): New function. + (rli_step_rev): New function. + (rli_ref): New function. + * tree-flow.h (struct ref_list_iterator): Declare. + (FOR_REF_BETWEEN, FOR_EACH_REF, FOR_EACH_REF_REV): Replace with new + rli_* iterator functions. Update all users. + +2002-10-21 Frank Ch. Eigler + + * tree-cfg.c (make_blocks): Ignore TRY_FINALLY_EXPR and + TRY_CATCH_EXPR. + * tree-mudflap.c (mx_register_decls): Ignore local decls + of extern variables of unknown size. + +2002-10-20 Daniel Berlin + + * tree-ssa-pre.c (repair_injury): DTRT, rather than abort. + + * tree-dfa.c (ref_type_name): E_* don't have these modifier + fields, but may have the same bits set, so don't print the + modifiers on them. + + * gimplify.c (create_tmp_var): New function, wraps calls to + create_tmp_var_1 with pushing/popping of right context. + All internal gimplify.c now use create_tmp_var_1. + (create_tmp_var_noc): New function, create the var without + pushing/popping, and without exposing internals of create_tmp_var_1. + Only one use of this. + + * tree-simple.h (create_tmp_var_noc): New prototype. + + * c-simplify.c (simplify_stmt_expr): create_tmp_var changed to + create_tmp_var_noc. + + * tree-ssa-pre.c: Add WAITING_FOR_DFA_UPDATE around code waiting for DFA + functions to keep refs up to date. + (add_call_to_ei): occurs and occurstmts is now an + array of tree pointers, not trees. Update approriately. + (insert_occ_in_preorder_dt_order_1): Ditto. + (tree_perform_ssapre): Ditto. + (find_use_for_var): Removed function. + (orig_expr_map): Removed global, removed uses. + (struct ei): Added injfixups member. + (is_strred_cand): STRIP_WFL the expression. + (calculate_increment): Ditto. + (is_injuring_def): Ditto. + (defs_y_dom_x): Ditto. Also account for fact that y is now a full + expression, not just an RHS. + (defs_match_p): Ditto (t2 is no longer just an RHS). + (finalize_1): Do insertion by replacement. + (repair_injury): Clean up, do insertion by replacement. + (find_reaching_def_of_var): Do backwards search in a cleaner way. + (update_ssa_for_new_use): Change how we do replacement. + (code_motion): Insertion by replacement. Print EXPR_WFL_LINENO, not + STMT_LINENO. + (pre_part_1_trav): Just create_tmp_var will now suffice. + +2002-10-18 Diego Novillo + + * tree-dfa.c (find_refs_in_expr): Change type of second argument to + enum tree_ref_type. Add third argument ref_mod. Update all users. + (create_ref): Add third argument ref_mod. Decode bitmask to set + the individual bitfields in the new reference. + * tree-flow-inline.h (is_may_ref): New function. + (is_may_def): New function. + (is_may_use): New function. + (is_partial_ref): New function. + (is_partial_def): New function. + (is_partial_use): New function. + (is_volatile_ref): New function. + (is_volatile_def): New function. + (is_volatile_use): New function. + (is_default_def): New function. + (is_clobbering_def): New function. + (is_initializing_def): New function. + (is_relocating_def): New function. + (is_addressof_use): New function. + (is_pure_use): New function. + * tree-flow.h (V_DEF, V_USE, V_PHI, E_PHI, E_USE, E_KILL): Redefine + inside enum tree_ref_type. Update all users. + (enum tree_ref_type): Define. + (TRM_DEFAULT, TRM_CLOBBER, TRM_MAY, TRM_PARTIAL, TRM_INITIAL, + TRM_VOLATILE, TRM_RELOCATE): Rename from M_*. Update all users. + (struct tree_ref_common): Change type of field 'type' to enum + tree_ref_type. Update all users. + (struct var_ref): Add bitfields 'm_may', 'm_partial' and 'm_volatile'. + (struct var_def): Add bitfield 'm_default', 'm_clobber', 'm_initial' + and 'm_relocate'. + (struct var_use): Add bitfield 'm_addressof'. + (ref_type): Change return type to enum tree_ref_type. Update all + users. + (create_ref): Add new argument ref_mod. Update all users. + (function_may_recurse_p): Change return type to bool. Update all + users. + (ref_type_name): Change argument type to tree_ref. Update all + users. + (validate_ref_type): Remove. + +2002-10-18 Diego Novillo + + * cp/Make-lang.in (CXX_C_OBJS): Remove tree-cfg.o, tree-dfa.o, + tree-optimize.o, tree-ssa.o, tree-ssa-pre.o, gimplify.o, tree-simple.o, + tree-alias-steen.o, tree-alias-ecr.o, tree-alias-type.o, + disjoint-set.o, tree-ssa-ccp.o, tree-dchain.o, tree-alias-common.o, + and tree-ssa-dce.o. + +2002-10-17 Diego Novillo + + * Makefile.in (TREE_FLOW_H): Add bitmap.h, basic-block.h, + hard-reg-set.h and tree-simple.h. Update all users. + (C_AND_OBJC_OBJS): Move tree-cfg.o, tree-dfa.o, + tree-ssa.o, tree-optimize.o, c-simplify.o, c-call-graph.o, + tree-simple.o, simple-break-elim.o, simple-goto-elim.o, tree-dchain.o, + tree-ssa-pre.o, tree-alias-type.o, tree-mudflap.o, gimplify.o, + tree-alias-ecr.o, tree-alias-common.o, tree-alias-steen.o, + disjoint-set.o, tree-ssa-ccp.o and tree-ssa-dce.o ... + (OBJS): ... here. + (gimplify.o): Add dependency on $(TREE_FLOW_H). + (tree-pretty-print.o): New rule. + (GTFILES): Add tree-flow.h + * c-config-lang.in (gtfiles): Remove tree-flow.h + * c-simplify.c (copy_if_shared_r, unmark_visited_r, + unshare_all_trees, mark_not_simple): Move ... + * gimplify.c: ... here. + Include tree-flow.h + * tree-flow.h: Include hard-reg-set.h. + + * c-common.h (print_c_tree, print_c_node, print_c_node_brief, + debug_c_tree, debug_c_node, debug_c_node_brief): Move declarations + from diagnostic.h. + * c-call-graph.c (construct_call_graph): Call get_name. + (print_callee): Likewise. + * c-pretty-print.c (print_declaration): Declare static. + (print_function_decl): Likewise. + (print_struct_decl): Likewise. + (dump_c_tree): Likewise. + (dump_c_node): Likewise. + * diagnostic.h (dump_generic_tree, dump_generic_node, + print_generic_tree, print_generic_node, print_generic_node_brief): + Declare. + * tree-pretty-print.c: New file. + * c-decl.c: Replace calls to print_c_node with print_generic_node. + * tree-alias-common.c: Likewise. + * tree-alias-steen.c: Likewise. + * tree-cfg.c: Likewise. + * tree-dfa.c: Likewise. + * tree-mudflap.c: Likewise. + * tree-optimize.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-ssa-dce.c: Likewise. + Don't include c-common.h nor c-tree.h + (tree_ssa_eliminate_dead_code): Don't call COMPOUND_BODY. + Replace ASM_STMT with ASM_EXPR. Don't check for EXPR_STMT. + +2002-10-17 Daniel Berlin + Diego Novillo + + * tree-cfg.c (remove_bb_ann): Remove. Update all users. + (delete_tree_cfg): Set bb->aux to NULL in all basic blocks. + * tree-dfa.c: Remove extern declaration for tree_find_refs. + (create_ref_list): Allocate new list with ggc_alloc. + (empty_ref_list): Just set first and last element to NULL. + (delete_ref_list): Remove. Update all users. + (remove_ref_from_list): Don't call free. + (add_ref_to_list_begin): Allocate new node with ggc_alloc. + (add_ref_to_list_end): Likewise. + (add_ref_to_list_after): Likewise. + (create_ref): Call BITMAP_GGC_ALLOC. + (remove_tree_ann): Remove. Update all users. + (tree_ref_structure): New function. + * tree-flow.h (edge, basic_block): Forward declare if necessary. + (struct ref_list_node): Mark for garbage collection. + (struct ref_list_priv): Likewise. + (struct tree_ref_common): Likewise. + (struct var_ref): Likewise. + (struct var_def): Likewise. + (struct var_phi): Likewise. + (struct var_use): Likewise. + (struct phi_node_arg_d): Likewise. + (struct expr_ref_common): Likewise. + (struct expr_phi): Likewise. + (struct expr_use): Likewise. + (union tree_ref_d): Likewise. + (struct tree_ann_d): Likewise. + (struct bb_ann_def): Likewise. + (referenced_vars): Likewise. + (global_var): Likewise. + (enum tree_ref_structure_enum): New. + (call_sites): Remove unused function. + * tree-inline.c (copy_tree_r): Copy the 'ann' field from tree_common. + * old-tree-inline.c (copy_tree_r): Likewise. + * tree-ssa.c (added): Mark for garbage collection. + (in_work): Likewise. + (work_stack): Likewise. + (delete_tree_ssa): Set global_var to NULL_TREE. + * tree.h (struct tree_ann_d): Forward declare. + (struct tree_common): Rename field 'aux' to 'ann'. Update all + users. Don't mark it 'skip' for garbage collection. + +2002-10-16 Daniel Berlin + + * tree-dfa.c (compute_may_aliases): Call create/delete_alias_vars + if flag_tree_points_to is on. + (may_alias_p): Use points-to info if user asked us to generate it. + + * tree-optimize.c (optimize_function_tree): Don't call + create_alias_vars here. + +2002-10-16 Diego Novillo + + * tree-cfg.c (make_cond_expr_edges): If the conditional has known + value, only make the edge to the corresponding branch. + (tree_delete_bb): Write a warning to the dump file when removing + blocks with executable statements. + (first_exec_stmt): Skip over empty BIND_EXPR blocks. + + * tree-dfa.c (find_refs_in_expr): Don't look for references in non + GIMPLE statements. + (remove_tree_ann): Clear the annotation with memset. + (collect_dfa_stats_r): Don't call tree_annotation. + (find_may_aliases_for): Avoid adding the same alias more than once. + (may_alias_p): Fix comment grammar. + + * tree-flow-inline.h (is_exec_stmt): New function. + * tree-flow.h (FOR_EACH_REF): Guard against NULL lists. + (FOR_EACH_REF_REV): Likewise. + (is_exec_stmt): Declare. + + * tree-ssa-ccp.c (visit_phi_node): Reformat debug dumping output. + (visit_expression_for): Move check for clobbering definitions + before check for NULL expressions. + (visit_condexpr_for): Reformat debug dumping output. + (set_lattice_value): Remove stale comments. + (replace_uses_in): Don't clear TF_FOLDED flag from expression. + + * tree-ssa.c (add_phi_node): If possible, associate the PHI node to + a statement. + (create_default_def): Create initial declarations for static + variables with DECL_INITIAL set. + (delete_tree_ssa): Remove annotations from variables. + +2002-10-16 Daniel Berlin + + * tree-alias-type.c (alias_tvar_new_with_aterm): New function. + Update all allocations to allocate right type, rather than the union. + Update to use macros to access members of alias_typevar. + + * tree-alias-type.h: Split alias_typevar into a common, an ECR, and + an aterm, update all users. + Add macros to access members of union. + + * tree-alias-common.c (create_alias_var): Handle function_decl's + properly (needed for proper handling of function pointers). + Updates for macros to access typevars. + Fix some indentation. + + * tree-alias-steen.c: Updates for macros to access typevars. + +2002-10-16 Frank Ch. Eigler + + * c-decl.c (c_expand_body): Enable mudflap, only for gimple. + * c-pretty-print.c (dump_c_node): Render try/catch/finally exprs. + (op_prio): Accept BIND_EXPRs. + * gcc.c (cpp_unique_options): Make -fmudflap -include mf-runtime.h. + * toplev.c (process_options): Complain on -fmudflap -fdisable-simple. + * tree-mudflap.c (*): Reorganize for generic/gimple operation. + (mf_init_extern_trees): Extract decl nodes from -include'd file. + (mf_external_ref, mf_decl_extern_trees): Removed; updated callers. + (mf_offset_expr_of_array_ref): Don't bother store index type as + TREE_PURPOSE. + (mf_build_check_statement_for): Use GIMPLE tree types and builders. + (mx_register_decls): New function, replacing mx_register_decl. + (mx_xfn_xform_decls): Support only GIMPLE input tree types. + (mf_flush_enqueued_calls): Clean up enqueued call statements. + +2002-10-14 Diego Novillo + + * toplev.c (parse_options_and_default_flags): Undo local + hack that slipped in the previous commit. + +2002-10-14 Diego Novillo + + * Makefile.in (c-decl.o): Add dependency on diagnostic.h. + * c-decl.c: Include diagnostic.h + (c_expand_body): Call get_name. + + * basic-block.h (struct basic_block_def): Rename head_tree to + head_tree_p and end_tree to end_tree_p. Change type to tree *. + Update all users. + (BLOCK_HEAD_TREE): Remove. Update all users. + (BLOCK_END_TREE): Remove. Update all users. + * tree-cfg.c (build_tree_cfg): Return if function body is empty. + (make_blocks): Change first argument to tree *. Update all users. + (make_bind_expr_blocks): Likewise. + (make_loop_expr_blocks): Likewise. + (make_cond_expr_blocks): Likewise. + (make_switch_expr_blocks): Likewise. + (create_bb): Likewise. + (first_exec_block): Likewise. + (first_exec_stmt): Likewise. + (tree_delete_bb): Use a gimple statement iterator to unmap + statements. + (insert_stmt_before): Remove empty function. + (replace_expr_in_tree): Remove. Update all users. + (find_expr_in_tree_helper): Likewise. + (find_expr_in_tree): Likewise. + (first_stmt): Call STRIP_NOPS. + (last_stmt): Call STRIP_NOPS. + + * tree-dfa.c (struct clobber_data_d): Rename parent_stmt to + parent_stmt_p and parent_expr to parent_expr_p. Change types to + tree *. Update all users. + (find_refs_in_stmt): Change first argument type to tree *. Update + all users. + (find_refs_in_expr): Chnage arguments parent_stmt and parent_expr + to tree *. Update all users. + (create_ref): Don't add the same reference twice on the same list + when parent_stmt and parent_expr are the same node. + Don't set output_ref when the parent statement is not in GIMPLE + form. + (replace_ref_operand_with): Move from tree-flow-inline.h + (replace_ref_expr_with): New function. + (replace_ref_stmt_with): New function. + (create_tree_ann): Abort if trying to annotate certain nodes. + Don't create an empty ref list. + In the presence of WFL or NOPS wrappers, add the annotation to the + inner node. + (dump_ref): Don't call tree_annotation to access the tree + annotation. + + * tree-flow.h (struct tree_ref_common): Rename field stmt to stmt_p + and field expr to expr_p. Change types to tree *. Update all + users. + (replace_ref_expr_with): Declare. + (replace_ref_stmt_with): Declare. + (insert_stmt_before, insert_stmt_after, replace_expr_in_tree, + find_expr_in_tree): Remove. + * tree-flow-inline.h (ref_expr): Return NULL_TREE if expr_p is + NULL. + (ref_stmt): Return NULL_TREE if stmt_p is NULL. + (tree_annotation): Call STRIP_WFL and STRIP_NOPS before returning + the annotation. + (add_tree_ref): Remove consistency checks. Create an empty list + the first time. + (get_lineno): Return -1 on NULL_TREE. + (set_output_ref): Remove consistency. + (set_tree_flag): Likewise. + (clear_tree_flag): Likewise. + (reset_tree_flags): Likewise. + * tree-simple.h (gimple_stmt_iterator): Rename ptr to tp. Change + type to tree *. Update all users. + (gsi_start): Change argument type to tree *. Update all users. + (gsi_stmt_ptr): New function. + (gsi_container): New function. + + * tree-optimize.c (optimize_function_tree): Don't test fnbody for + NULL. + Re-enable optimizers. + * tree-ssa-ccp.c: Update documentation comments. + Don't include c-common.h and c-tree.h. + (tree_ssa_ccp): Don't call COMPOUND_BODY. + (ccp_fold): New private function. + (substitute_and_fold): Call it. + Call replace_ref_expr_with. + Set TF_FOLDED flag on the statement, not the expression. + (visit_assignment_for): Call STRIP_NOPS and STRIP_WFL. + (evaluate_expr): Call ccp_fold. Only use the RHS of the simplified + value in the case of MODIFY_EXPR or INIT_EXPR. + (restore_expr): + * tree-ssa-dce.c (mark_control_parent_necessary): Use a gimple + iterator. + (tree_ssa_eliminate_dead_code): Likewise. + * tree-ssa-pre.c: Disable and add warning comments for out-of-date + calls to create_ref, find_refs_in_stmt and replace_expr_in_tree. + +2002-10-12 Daniel Berlin + + * tree-alias-type.h (alias_typevar_def): Add struct aterm + as a temporary hack for andersen's analysis. + * tree-alias-common.c (current_alias_ops): New, use it + instead of referring to steen_alias_ops everywhere. + (get_alias_var): Use STRIP_WFL. + (find_func_aliases): Ditto. + (create_alias_vars): Call init function, move deletion to + delete_alias_vars. + (delete_alias_vars): New function, move deletion code to here. + (get_virtual_var): Removed. + (ptr_may_alias_var): New function. + * tree-alias-common.h (struct tree_alias_ops): Add may_alias + function. + * tree-alias-steen.c (steen_may_alias): New function. + +2002-10-10 Falk Hueffner + + * diagnostic.h (dump_c_tree, dump_c_node, + print_declaration, print_function_decl, + print_struct_decl): Fix argument types. + +2002-10-10 Diego Novillo + + * tree.h (struct tree_common): Rename field unused_0 to + not_gimple_flag. + (TREE_NOT_GIMPLE): Define. + * c-simplify.c (mark_not_simple_r): Remove. Update all users. + (mark_not_simple): Set TREE_NOT_GIMPLE. + * gimplify.c (simplify_call_expr): Enable call to mark_not_simple. + * tree-flow.h (TF_NOT_SIMPLE): Remove. Update all users. + + * tree-cfg.c (build_tree_cfg): Rename from tree_find_basic_blocks. + Update all users. + Find the first executable statement before starting basic block 0. + (make_blocks): Do not accept TRY_FINALLY_EXPR and TRY_CATCH_EXPR + nodes. + (make_edges): Always create an edge from entry to basic block 0. + (delete_tree_cfg): Rename from delete_cfg. Update all uses. + (first_exec_stmt): Return the container for the first statement, + not the statement itself. + + * tree-dfa.c (tree_find_refs): Re-implement using a GIMPLE + iterator. + (find_refs_in_stmt): Handle GIMPLE statements. + (find_refs_in_expr): Call flags_from_decl_or_type when handling + CALL_EXPR expressions. + (create_ref): Call DECL_P. + (remove_tree_ann): Call tree_annotation. + + * tree-flow-inline.h (gsi_step_bb): Stop if statement is not inside + a basic block. + + * tree-flow.h (build_tree_cfg): Rename from tree_find_basic_blocks. + Update all users. + (delete_tree_cfg): Rename from delete_cfg. + (tree_find_refs): Declare. + (build_tree_ssa): Rename from tree_build_ssa. + (is_upward_exposed): Remove unused function. + * tree-optimize.c (delete_tree_ssa): Remove declaration. + (optimize_function_tree): Re-enable SSA builder. + * tree-simple.h (gsi_container): New function. + + * Makefile.in (tree-ssa.o): Remove dependencies on c-common.h and + c-tree.h. + * tree-ssa.c: Don't include c-common.h nor c-tree.h. + (tree_find_refs): Remove declaration. + (remove_annotations_r): New local function. + (build_tree_ssa): Rename from tree_build_ssa. Update all users. + (analyze_rdefs): Don't call prep_stmt. + (is_upward_exposed): Remove unused function. + (add_phi_node): Don't associate the PHI node to a statement. + (delete_tree_ssa): Receive the function body as argument. + Walk the function body removing annotations from every tree. + +2002-10-10 Steven Bosscher + + * tree-ssa-dce (tree_ssa_eliminate_dead_code): Initialize prev to + NULL_TREE. + Don't close dump_file until end of function. + Dump the tree after DCE for -fdump-tree-dce. + +2002-10-08 Richard Henderson + Jason Merrill + Diego Novillo + + * tree-simple.h (gimple_stmt_iterator): New type. + (gsi_start): New function. + (gsi_after_end): New function. + (gsi_step): New function. + (gsi_stmt): New function. + +2002-10-08 Diego Novillo + + * calls.c (flags_from_decl_or_type): Make extern. + (ECF_*): Move ... + * rtl.h (ECF_*): ... here. + (flags_from_decl_or_type): Declare. + + * tree.h (COND_EXPR_COND): Define. + (COND_EXPR_THEN): Define. + (COND_EXPR_ELSE): Define. + (LABEL_EXPR_LABEL): Define. + (optimize_function_tree): Declare. + +2002-10-08 Diego Novillo + + * Makefile.in (TREE_FLOW_H): Define. + (c-decl.o): Remove dependency on tree-optimize.h. + (tree-alias-steen.o, tree-alias-common.o, tree-ssa.o, tree-ssa-pre.o, + tree-cfg.o, tree-dfa.o, tree-optimize.o, c-simplify.o, c-call-graph.o, + tree-ssa-dce.o, tree-ssa-ccp.o): Depend on $(TREE_FLOW_H). + (tree-cfg.o): Remove dependencies on c-tree.h and c-common.h. + * c-call-graph.c (construct_call_graph): Disable calls to removed + functions. + * c-decl.c: Don't include tree-optimize.h. + (c_expand_body): Enable calls to optimize_function_tree. + + * c-pretty-print.c (dump_c_node): Fix printf warnings. + Only dump the first node of a COMPOUND_EXPR when brief_dump is set. + Use COND_EXPR_COND, COND_EXPR_THEN and COND_EXPR_ELSE accessors. + Only dump the opening brace of a BIND_EXPR when brief_dump is set. + + * tree-cfg.c: Don't include tree-optimize.h, c-common.h and c-tree.h. + (binding_stack, make_for_stmt_blocks, make_if_stmt_blocks, + make_while_stmt_blocks, make_switch_stmt_blocks, + make_do_stmt_blocks, create_maximal_bb, make_for_stmt_edges, + make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges, + make_break_stmt_edges, make_continue_stmt_edges, create_loop_hdr, + insert_before_ctrl_stmt, insert_before_normal_stmt, + insert_after_ctrl_stmt, insert_after_normal_stmt, + insert_after_loop_body, tree_split_bb, stmt_ends_bb_p): Remove. + Update all users. + (STRIP_CONTAINERS): Define. + (make_bind_expr_blocks): New local function. + (make_cond_expr_blocks): New local function. + (make_loop_expr_blocks): New local function. + (make_switch_expr_blocks): New local function. + (make_loop_expr_edges): New local function. + (make_cond_expr_edges): New local function. + (make_case_label_edges): New local function. + (first_exec_block): New local function. + (make_goto_expr_edges): Rename from make_goto_stmt_edges. + (make_blocks): Remove arguments COMPOUND_STMT and PREV_CHAIN_P. + Use gimple_stmt_iterator to iterate over the statements in the + function. Create maximal basic blocks during traversal. + (create_bb): Remove arguments end, prev_chain_p and binding_scope. + Rename control_parent to parent_block. + (set_bb_for_stmt): Move from tree-flow.h. + (make_edges): Don't assume that basic block 0 contains executable + statements. + Handle BIND_EXPR nodes. + (make_ctrl_stmt_edges): Handle LOOP_EXPR, COND_EXPR and + SWITCH_EXPR. + (make_exit_edges): Handle GOTO_EXPR, CALL_EXPR and RETURN_EXPR. + (tree_delete_bb): Call first_stmt and last_stmt. + (block_invalidates_loop): Call last_stmt. + (replace_expr_in_tree): Don't dump line number information. + (find_expr_in_tree_helper): Don't call statement_code_p. + (tree_dump_bb): Call get_lineno. + (tree_cfg2dot): Ditto. + (successor_block): Use a gimple_stmt_iterator to find the first + executable block after the current one. + (is_ctrl_stmt): Handle COND_EXPR, LOOP_EXPR and SWITCH_EXPR. + (is_ctrl_altering_stmt): Call flags_from_decl_or_type to discover + non-return functions. + (is_loop_stmt): Handle LOOP_EXPR. + (is_computed_goto): Handle GOTO_EXPR. + (stmt_starts_bb_p): Handle CASE_LABEL_EXPR, LABEL_EXPR, RETURN_EXPR + and BIND_EXPR. + (first_exec_stmt): Use a gimple_stmt_iterator to traverse the + statements. + (first_stmt): New function. + (last_stmt): New function. + + * tree-dfa.c: Don't include c-common.h, c-tree.h and + tree-optimize.h. Include diagnostic.h. + (tree_find_refs): Disable. + (find_refs_in_stmt): Disable. + (find_refs_in_expr): Don't call prep_stmt. + (tree_ann): Don't annotate empty_stmt_node. + (find_declaration): Remove. Update all users. + (dump_ref): Call get_lineno. + (is_visible_to): Always return true. + + * tree-flow.h: Include tree-flow-inline.h, basic-block.h and + tree-simple.h. + (tree_ann_d): Remove compound_parent field. + (set_bb_for_stmt): Declare extern. + (compound_parent, set_compound_parent, struct for_header_blocks, + union header_blocks, prev_chain_p, set_prev_chain_p, binding_scope, + set_binding_scope, loop_hdr, for_init_bb, set_for_init_bb, + for_cond_bb, set_for_cond_bb, for_expr_bb, set_for_expr_bb, + end_while_bb, set_end_while_bb, do_cond_bb, set_cond_bb, + stmt_ends_bb_p, loop_parent, latch_block, switch_parent, + first_exec_stmt, last_exec_stmt, is_exec_stmt, + is_statement_expression, first_non_decl_stmt, first_decl_stmt, + first_non_label_in_bb, tree_split_bb, find_declaration): Remove. + Update all users. + (get_lineno): New function. + (struct bb_ann_def): Rename field parent to parent_block. Update + all users. + Remove fields prev_chain_p, loop_hdr and binding_scope. Update all + users. + (parent_block): Rename from bb_parent. + (set_parent_block): Rename from set_bb_parent. + (prev_chain_p): Remove + (bb_empty_p): Return true if block only contains empty_stmt_node. + (gsi_step_bb): New function. + (gsi_start_bb): New function. + (gsi_insert_before, gsi_insert_after, gsi_delete, gsi_replace): + Declare. + (insert_stmt_before): Rename from insert_stmt_tree_before. + (insert_stmt_after): Rename from insert_stmt_tree_after. + (first_stmt): Declare. + (last_stmt): Declare. + (tree_perform_ssapre, tree_ssa_ccp, + tree_ssa_eliminate_dead_code): Move declaration from tree-optimize.h. + * tree-flow-inline.h: New file for all the inline functions + declared in tree-flow.h + + * tree-optimize.c: Don't include tree-optimize.h, c-common.h and + c-tree.h. + (optimize_function_tree): Disable call to double_chain_stmts. + Call init_flow. + Call tree_find_basic_blocks. + Disable calls to tree_build_ssa and optimizers. + (build_tree_ssa): Remove. Update all users. + * tree-optimize.h: Remove. + * tree-ssa-ccp.c: Don't include tree-optimize.h + * tree-ssa-dce.c: Don't include tree-optimize.h. + Include diagnostic.h + * tree-ssa-pre.c: Don't include tree-optimize.h. + (requires_edge_placement): Disable unused function. + (set_need_repair): Disable unused function. + (finalize_1): Disable calls to insert_stmt_tree_before and + insert_stmt_tree_after. + (repair_injury): Ditto. + (code_motion): Ditto. + * tree-ssa.c: Don't include tree-optimize.h. + (insert_phi_nodes_for): Remove unused variable. + (add_phi_node): Don't call statement_code_p. + * cp/optimize.c: Don't include tree-optimize.h + * tree-alias-common.c: Don't include tree-optimize.h. + (find_func_decls): Disable. + (display_points_to_set): Disable. + * tree-alias-steen.c: Don't include tree-optimize.h. + +2002-10-04 Jason Merrill + + * gimplify.c (declare_tmp_vars): Don't add temps to block vars. + * tree-inline.c (remap_decls): Split out from remap_block. + (copy_bind_expr): Remap BIND_EXPR_VARS separately from block vars. + + * c-simplify.c (simplify_expr_stmt): Call set_file_and_line_for_stmt. + + * gimplify.c: New file. + (push_gimplify_context, pop_gimplify_context): New fns. + (gimple_push_bind_expr, gimple_pop_bind_expr): New fns. + (simplify_bind_expr): Use them. + (gimple_current_bind_expr, gimple_add_tmp_var): New fn. + (foreach_stmt): Recurse if necessary. + (various): Use generic interfaces instead of c-specific ones. + * c-simplify.c: Move language-independent code to gimplify.c. + (simplify_c_loop): Use add_tree instead of add_stmt_to_compound. + (various): Use new *_bind_expr interfaces. + * Makefile.in (C_AND_OBJC_OBJS): Add gimplify.o. + (gimplify.o): New rule. + + * c-decl.c (c_expand_body): Dump trees here. + * c-simplify.c (simplify_function_body): Not here. + +2002-10-03 Frank Ch. Eigler + + * tree-mudflap.c (mf_offset_expr_of_array_ref): Don't emit + intermediate variables for constant index values. + (mx_xfn_indirect_ref): For constant valid index values and + known valid array sizes, omit bounds checks. + +2002-10-03 Jason Merrill + + * c-simplify.c (simplify_bind_expr): Don't clear TREE_SIDE_EFFECTS + if we have a block. + + * c-simplify.c (simplify_expr) [TRY_FINALLY_EXPR]: New case. + + * tree-inline.c (copy_body_r) [RETURN_EXPR]: Don't make an extra + copy of the MODIFY_EXPR. Mark the return label used. + (expand_call_inline): Don't push/pop_srcloc. Only emit the return + label if it was used. + + * tree-simple.c (right_assocify_expr): Split out from + rationalize_compound_expr. Don't move non-matching op0's. + * tree-simple.h: Declare it. + * c-simplify.c (simplify_boolean_expr): Call it. + (simplify_cond_expr): Reorganize. Optimize if (a&&b). + + * c-simplify.c (wrap_with_wfl): Drop special loop handling. + (simplify_c_loop): Wrap loop contents in wfls. + + * c-simplify.c (STRIP_WFL): Move... + * tree.h: ...here. + + * c-common.c (c_walk_subtrees): Don't walk TREE_CHAIN. + * tree-inline.c (walk_tree): Call langhook walk_subtrees first. + For expressions, walk TREE_CHAIN if it matters. + +2002-10-01 Frank Ch. Eigler + + * builtins.c (expand_builtin_alloca): Disable if -fmudflap. + * tree-mudflap.c (mudflap_enqueue_decl): Tweak logic to include + more globals. + (mx_xfn_indirect_ref): Handle bitfield COMPONENT_REFs; instrument + BIT_FIELD_REF/INDIRECT_REFs. + +2002-10-01 Jason Merrill + + * c-decl.c (poplevel): Only add undeclared labels to the toplevel + block. + * c-parse.in (label_decl): Push the declared label. + + * c-decl.c (c_expand_body): If we've been simplified, use + expand_expr_stmt_value instead. + + * c-decl.c (c_expand_decl): Rename from c_expand_decl_stmt. + Handle all C-specific expansion semantics. + * c-tree.h: Change prototype. + * langhooks.h (struct lang_hooks): Add expand_decl hook. + * langhooks.c (lhd_expand_decl): Default version. + * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Provide default. + * c-lang.c (LANG_HOOKS_EXPAND_DECL): Define. + * c-semantics.c (lang_expand_decl_stmt): Remove. + (genrtl_decl_stmt): Use lang_hooks.expand_decl. + * Makefile.in (c-semantics.o): Depend on langhooks.h. + * c-objc-common.c (c_objc_common_init): Don't set + lang_expand_decl_stmt. + + * c-common.def (ASM_STMT): Only 4 operands. + * c-common.h (ASM_CV_QUAL): Remove. + (genrtl_asm_stmt): Adjust prototype. + * c-typeck.c (build_asm_stmt): Adjust. + * c-semantics.c (genrtl_asm_stmt): Change cv_qualifier parm to + volatile_p. + (expand_stmt): Adjust. + + * c-common.h (SWITCH_COND, SWITCH_BODY, CASE_LOW, CASE_HIGH, + CASE_LABEL_DECL, GOTO_DESTINATION, ASM_STRING, ASM_OUTPUTS, + ASM_INPUTS, ASM_CLOBBERS, ASM_VOLATILE_P, ASM_INPUT_P): Move to tree.h. + + * c-pretty-print.c (newline_and_indent): New fn. + (dump_c_tree, dump_c_node): Make spc a plain int. + (dump_c_node): Use output_add_identifier. + Reorganize for bnw-simple; indent in the enclosing node rather + than the subexpression. + [FUNCTION_DECL]: Just print the name for now. + [COMPOUND_EXPR, COND_EXPR]: Handle use as statements. + [BIND_EXPR, GOTO_EXPR, EXIT_EXPR, LOOP_EXPR, LABELED_BLOCK_EXPR, + EXIT_BLOCK_EXPR, RETURN_EXPR, SWITCH_EXPR, ASM_EXPR, + CASE_LABEL_EXPR]: Implement. + (print_declaration): Print 'static'. + * c-tree.h: Move c-pretty-print decls to diagnostic.h. + + * expr.c (store_field): Don't always pass want_value==0 to store_expr. + + * expr.c (expand_expr) [EXIT_EXPR]: Handle EXIT_EXPR_IS_LOOP_COND. + + * expr.c (expand_expr) [LOOP_EXPR]: Pass exit_flag==0 to + exand_start_loop. + [BIND_EXPR]: Adjust for functions-as-trees mode. + [COMPOUND_EXPR]: Avoid recursion if possible. + [SWITCH_EXPR, LABEL_EXPR]: Move handling from java/expr.c. + [CASE_LABEL_EXPR, ASM_EXPR]: New handling. + + * tree.h (struct tree_common): Add visited flag. + (TREE_VISITED): New macro. + * tree.c (copy_node): Clear TREE_VISITED. + * print-tree.c (print_node): Print visted. + + * stmt.c (expand_asm_expr): New fn. + + * tree.c (build1): Always set TREE_SIDE_EFFECTS for 's' codes. + + * tree.h (enum tree_index): Add TI_EMPTY_STMT. + (empty_stmt_node): New macro. + * tree.c (build_common_tree_nodes_2): Initialize it. + + * tree.def: Change some codes from 'e' to 's'. + (CASE_LABEL_EXPR, ASM_EXPR): New codes. + + * tree.def (SWITCH_EXPR): Now has three operands. + + * tree-inline.c: Retarget to generic trees. FIXME FIXME. + * old-tree-inline.c: Old C/Java-specific inliner. + * Makefile.in (old-tree-inline.o): New rule. + * c-common.c (c_walk_subtrees): New fn. + (c_tree_chain_matters_p): New fn. + * c-lang.c: Use them for LANG_HOOKS_TREE_INLINING_WALK_SUBTREES + and LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P. + * c-common.h: Declare them. + (DECL_NUM_STMTS): Move to tree.h. + * c-decl.c (finish_function): Simplify the function trees. + * c-objc-common.c (inline_forbidden_p): Look inside BIND_EXPRs + for nested functions. Don't inline a function with _STMT trees. + + * basic-block.h: Include hard-reg-set.h. + + * c-decl.c (start_function): Don't call make_decl_rtl. + (c_expand_body): Call it here instead. + + * Makefile.in (explow.o): Depend on langhooks.h. + + * unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABELs + between copy_notes_from and loop_end, either. + +2002-09-30 Daniel Berlin + + * tree-ssa-pre.c (repair_injury): Start work on updating SSA + representation for strength reduction injuries. + Print a new line after outputting tree node in debug statements. + Fix strength reduction of a candidate with two variables (IE a * + c). + Put the repair after the injuring statement, not at the end of the + block. + Break the RHS use lookup if it's defined by a phi. + (calculate_increment): Ditto on node printing. + (code_motion): Ditto on updating SSA rep for strength reduction + injuries. + (find_rhs_use_for_var): Rewrite to use maybe_find_rhs_use_for_var. + (maybe_find_rhs_use_for_var): Rename from find_rhs_use_for_var, + don't abort, return NULL. + (set_var_phis): Simplify break condition. + Make sure RHS *has* a use before we go and get it. + (rename2): Ditto on RHS checking. + When looking up injuring defs, break on phis. + (phi_opnd_from_res): Ditto. + (defs_y_dom_x): Ditto. + (TODO List): Add new TODO to fix the remapping crud. + +2002-09-27 Daniel Berlin + + * tree-ssa-pre.c (tree_perform_ssapre): Move insertion into + splay tree inside the is_simple_modify_expr block, to prevent + tree check failure. + +2002-09-26 Daniel Berlin + + * tree-ssa-pre.c (update_phis_in_list): New function. + (update_ssa_for_new_use): New function. + (code_motion): Start working on code to update SSA representation. + (find_reaching_def_of_var): New function. + +2002-09-25 Steven Bosscher + + * Makefile.in (tree): Add dependency on c-tree.h + * tree-optimize.c: Include c-tree.h + (optimize_function_tree): React to -fdump-tree-optimized. + +2002-09-25 Daniel Berlin + + * tree-dfa.c (add_list_to_ref_list_end): New function. + (add_list_to_ref_list_begin): Ditto. + (find_list_node): Handle searching in empty lists. + (find_refs_in_stmt): De-staticify. + + * tree-flow.h (add_list_to_ref_list_end): New declaration. + (add_list_to_ref_list_begin): Ditto. + (find_refs_in_stmt): Add prototype. + +2002-09-25 Diego Novillo + + * Makefile.in (tree-dfa.o): Depend on flags.h + * tree-cfg.c (tree_dump_cfg): Alter output format slightly. + (block_invalidates_loop): Look for clobbering definitions of + GLOBAL_VARIABLE. + * tree-simple.c (get_base_symbol): Handle EXPR_WITH_FILE_LOCATION + nodes. + * tree-optimize.c (init_tree_flow): Remove. Update all users. + (build_tree_ssa): Don't call tree_find_refs. + Don't call tree_compute_rdefs. + + * tree-dfa.c: Include flags.h + (dump_file): Remove. + (dump_flags): Remove. + (pointer_refs): Remove. + (struct dfa_stats_d): Add fields max_num_phi_args, num_may_alias, + max_num_may_alias, num_alias_imm_rdefs and max_num_alias_imm_rdefs. + Remove field num_fcalls. + (dfa_counts): Declare. + (tree_find_refs): Declare. + (tree_ssa_dump_file): Declare. + (tree_ssa_dump_flags): Declare. + (dump_if_different): New function. + (add_default_defs): Remove. Update all users. + (add_call_site_clobbers): Remove. Update all users. + (add_ptr_may_refs): Remove. Update all users. + (compute_may_aliases): New function. + (find_may_aliases_for): New function. + (add_may_alias): New function. + (may_alias_p): New function. + (is_visible_to): New function. + (get_alias_index): New function. + (call_sites): Remove. Update all users. + (global_var): Declare. + (E_FCALL): Remove. Adjust other constants. + (M_INDIRECT): Remove. Update all users. + (M_RELOCATE): Declare. + (tree_find_refs): Move debugging dumps to tree_build_ssa. + Move initialization code to init_tree_ssa. + Call compute_may_aliases. + (find_refs_in_expr): For INDIRECT_REF nodes create a reference to + the canonical INDIRECT_REF node associated with the pointer symbol. + Given a pointer p, clobber the canonical INDIRECT_REF of p after + creating a V_DEF for p. + For CALL_EXPR nodes, if the called function is not pure nor + const, create a use and a clobbering definition to GLOBAL_VAR. + (create_ref): Allow INDIRECT_REF variables. + (add_phi_arg): Keep track of number of PHI arguments created. + (function_may_recurse_p): Look for clobbering definitions to + GLOBAL_VAR. + (get_fcalls): Remove unused function. + (is_pure_fcall): Remove unused function. + (fcall_takes_ref_args): Remove unused function. + (find_declaration): Stop iterating at ENTRY_BLOCK_PTR. + (debug_variable): New function. + (dump_variable): New function. + (dump_referenced_vars): Call it. + (dump_phi_args): Don't dump NULL arguments. + (PERCENT): Define. + (dump_dfa_stats): Re-format output. + Add new counters. + Call dump_if_different. + (collect_dfa_stats): Also recurse into GLOBAL_VAR. + (collect_dfa_stats_r): Collect may-alias information. + (count_tree_refs): Collect information about def-def links for + aliases. + Keep track of maximum values for number of PHI arguments, aliases + and def-def links. + (ref_type_name): Handle M_RELOCATE. + (validate_ref_type): Ditto. + + * tree-ssa.c: Add more documentation. + (tree_ssa_dump_file): Rename from dump_file. Declare extern. + (tree_ssa_dump_flags): Rename from dump_flags. Declare extern. + (added): New local varray. + (in_work): New local varray. + (work_stack): New local varray. + (dfa_counts): Declare. + (insert_phi_nodes_for): New local function. + (add_phi_node): New local function. + (set_ssa_links): New local function. + (set_alias_imm_reaching_def): New local function. + (create_default_def): New local function. + (init_tree_ssa): New local function. + (tree_find_refs): Relocate declaration from tree-flow.h + (tree_build_ssa): Call init_tree_ssa. + Call tree_find_refs. + Process all SSA-related dump options. + (insert_phi_nodes): Rename from insert_phi_terms. Update all + users. + Call insert_phi_nodes_for. + (build_fud_chains): Add more documentation. + Initialize save_chain to 0. + (search_fud_chains): Add more documentation. + Call set_ssa_links. + Call create_default_def. + (tree_compute_rdefs): Initialize array marked to 0. + (follow_chain): Follow def-def chains for non-killing definitions + for aliases. + (dump_reaching_defs): Call dump_variable. + + * tree-flow.h (E_FCALL): Remove. Update all users. + (M_INDIRECT): Remove. Update all users. + (M_RELOCATE): Declare. + (struct var_ref): Add field alias_imm_rdefs. + (alias_imm_reaching_def): New inline function. + (struct tree_ann_d): Add field indirect_var. + Add field may_aliases. + (enum tree_flags): Relocate. + (indirect_var): New inline function. + (set_indirect_var): New inline function. + (may_alias): New inline function. + (num_may_alias): New inline function. + (struct dfa_counts_d): Declare. + (global_var): Declare. + (FCALL_NON_PURE, FCALL_PURE, FCALL_BUILT_IN): Remove. + (tree_find_refs): Move to tree-ssa.c. + (dump_variable): Declare. + (debug_variable): Declare. + (get_fcalls): Remove. + (is_pure_fcall): Remove. + (fcall_takes_ref_args): Remove. + (ref_defines): Declare. + (is_killing_def): Declare. + (get_alias_index): Declare. + (delete_tree_ssa): Rename from delete_ssa. Update all users. + (set_currdef_for): Allow INDIRECT_REF nodes. + (bb_annotation): Don't create a new one if the block didn't have an + annotation already. + + * tree-ssa-ccp.c (substitute_and_fold): Rename from + ssa_ccp_substitute_constants. Update all users. + Call replace_uses_in. + (replace_uses_in): New local function. + (evaluate_expr): Call it. + (initialize): Call get_base_symbol. + + * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Don't handle + E_FCALL. + +2002-09-22 Diego Novillo + + * Makefile.in (tree-dfa.o): Depend on hashtab.h. + * c-simplify.c (get_name): Declare extern. + * tree-cfg.c (tree_dump_cfg): Call it. + (tree_cfg2dot): Call it. + * tree-ssa-ccp.c (tree_ssa_ccp): Call get_name. + * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Call get_name. + * tree-ssa-pre.c (tree_perform_ssapre): Call get_name. + * tree-ssa.c (analyze_rdefs): Call get_name. + (dump_reaching_defs): Call get_name. + (dump_tree_ssa): Call get_name. + * tree.h (get_name): Declare. + + * tree-dfa.c: Include "hashtab.h" + (struct dfa_stats_d): New. + (collect_dfa_stats): New local function. + (collect_dfa_stats_r): New local function. + (count_tree_refs): New local function. + (count_ref_list_nodes): New local function. + (tree_find_refs): Call dump_begin on entry to the function. + (dump_referenced_vars): Call get_name. + (SCALE): Declare. + (LABEL): Declare. + (dump_dfa_stats): New function. + (debug_dfa_stats): New function. + * tree-dump.c (struct dump_option_value_info): Add entry for TDF_STATS. + * tree-flow.h (has_annotation): Remove. Update all users. + (dump_dfa_stats): Declare. + (debug_dfa_stats): Declare. + (tree_annotation): Don't create one if the tree doesn't have one + already. Update all users to new semantics. + * tree-ssa-dce.c (print_stats): Dump if dump_flags has TDF_STATS bit + set. + * tree-ssa.c (tree_build_ssa): Open dump file on entry. + Call dump_dfa_stats if dump_flags has TDF_STATS bit set. + Call dump_tree_ssa if dump_flags has TDF_DETAILS bit set. + * tree.h (TDF_STATS): Define. + * doc/invoke.texi: Document 'stats' flag for -fdump-tree. + + * tree-dfa.c (next_tree_ref_id): Change type to unsigned long. + Update all users. + tree-flow.h (tree_ref_common): Change type of field 'id' to + unsigned long. Update all users. + (ref_id): Change return type to unsigned long. Update all users. + +2002-09-21 Daniel Berlin + + * tree-ssa-pre.c (struct expr_info): Add repaired member. + (repair_injury): Track which injuries we repaired, so we don't + repair them > 1 time. + +2002-09-20 Diego Novillo + + * c-pretty-print.c (dump_c_node): Fix call to REAL_VALUE_TO_DECIMAL. + +2002-09-20 Diego Novillo + + * tree-dfa.c (find_refs_in_stmt): Fix botched call to + clobber_vars_r with CLEANUP_STMT nodes. + +2002-09-20 Diego Novillo + + * toplev.c (flag_tree_ssa): Remove. Update all users. + +2002-09-20 Frank Ch. Eigler + + * gcc.c (cc1_options): Make -fmudflap imply -fno-merge-constants. + * varasm.c (categorize_decl_for_section): Likewise, for strings. + * tree-mudflap.c (mudflap_enqueue_decl): Don't be interested + in !TREE_USED decls. Fix minor type warning. + (mf_offset_expr_of_array_ref): Create explicit temporary variables + for array index expressions instead of SAVE_EXPRs. Update callers. + (mf_build_check_statement_for): Insert temp variables. + (mx_xfn_indirect_ref): Correct recursion-protection checking + sequence. Tweak array check-base calculation back to "&array[0]". + (*): Use build_function_type_list instead of build_function_type. + (mx_external_ref): Remove unused parameter. Update callers. + +2002-09-19 Diego Novillo + + * c-decl.c (c_expand_body): Invoke tree optimizers with -O1 and + above. + * flags.h (flag_tree_ssa): Remove. + * tree-cfg.c (find_expr_in_tree_helper): Change last argument type + to int. + * tree-dfa.c (create_ref): Ditto. + * tree-flow.h (num_referenced_vars): Change type to unsigned long. + * doc/invoke.texi (-ftree-ssa): Remove. + (-fdump-tree-{pre,ccp,dce}): Add to the summary section. + (-fdump-tree-xxx-details): Update documentation. + (-fdump-tree-ccp): Document. + (-fdump-tree-simple): Move elsewhere. + +2002-09-19 Richard Henderson + + * function.c (insns_for_mem_hash): Cast to size_t first. + * tree-dfa.c (num_referenced_vars): Unsigned long, not size_t. + (dump_referenced_vars): Use %lu for it. + (dump_ref): Use HOST_WIDE_INT_PRINT_DEC. + * tree-nomudflap.c (mudflap_c_function): Use ATTRIBUTE_UNUSED. + (mudflap_enqueue_decl, mudflap_enqueue_constant): Likewise. + * tree-ssa-pre.c (compute_idfs): Cast to size_t first. + + * tree-optimize.c (optimize_function_tree): Fix missed renamings. + * tree-ssa-pre.c (tree_perform_ssapre): Likewise. + +2002-09-19 Jeff Law + + * tree-dfa.c (find_refs_in_stmt): Search for references in the call + address of a CALL_EXPR. + +2002-09-19 Daniel Berlin + + * toplev.c: tree-ssa-* -> tree-*. + + * doc/invoke.texi: Ditto. + +2002-09-19 Daniel Berlin + + * flags.h: flag_tree_ssa_* -> flag_tree_*. + + * toplev.c: Ditto. + + * tree-optimize.c: Ditto. + + * tree-dump.c: dump-tree-ssa-* -> dump-tree-*. + TDI_ssa_* -> TDI_*. + + * tree.h: Ditto + + * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Fix dump handling. + +2002-09-18 Daniel Berlin + + * tree-dump.c (dump_files): Use dump-tree-ssa-??? for the option names + and "ssa-???" for the dump files. + + * tree.h: TDI_ccp and TDI_dce -> TDI_ssa_ccp and TDI_ssa_dce. + + * tree-ssa-ccp.c: TDI_ccp->TDI_ssa_ccp. + +2002-09-18 Daniel Berlin + + * tree-dump.c: Fix order of dump files + +2002-09-17 Daniel Berlin + + * tree-ssa-pre.c: Remove a lot of finding refs in statements junk. + Start on strength reduction. + Only generate simple statements. + Remove EXPR* macros in favor of inline functions. + Update comparisons and sets to 1 and 0 to true and false where + approriate. + (toplevel): Add DEBUGGING_STRRED define (temporary, for + implementation debugging, *not* useful as a dump option). + Add TODO notes. + Add global avdefs, orig_expr_map, need_repair_map, + strred_candidate. + (set_var_phis): Add struct expr_info * argument. + Update to handle injuring definitions. + (defs_y_dom_x): Ditto. + (phi_opnd_from_res): Ditto. + (phi_for_operand): Remove extra \. + (find_tree_ref_for_var): Renamed to find_use_for_var. Update all + callers. + Use orig_expr_map to lookup original expression, remove statement + searching gunk. + (find_rhs_use_for_var): New function. + (is_strred_cand): New function. + (is_injuring_def): New function. + (calculate_increment): New function. + (repair_injury): New function. + (set_need_repair): New function. + (struct expr_info): Add strred_cand member. + (rename_2): Update to handle injuring definitions. + (expr_phi_insertion): Ditto. + (code_motion): Update to repair injuries. + Only insert SIMPLE statements. + Free avdefs here now. + (finalize_1): Don't free avdefs anymore here. + (tree_perform_ssapre): Record original expresion for + find_use_for_var's benefit. + Determine strength reduction candidates. + + * tree-flow.h: Remove EXPR* macros in favor of inline functions. + Remove E_INJ. + + * tree-dfa.c: Change EXPR* macros to the new functions. + Remove E_INJ. + +2002-09-18 Diego Novillo + + * tree-dfa.c (M_ADDRESSOF): Define. + (find_refs_in_expr): Create addressof-use references for ADDR_EXPR + nodes. + Don't create references for FUNCTION_DECL nodes. + (ref_type_name): Handle M_ADDRESSOF. + (validate_ref_type): Ditto. + (clobber_vars_r): Don't clobber FUNCTION_DECL nodes. + * tree-flow.h (M_ADDRESSOF): Declare. + +2002-09-17 Diego Novillo + + * doc/invoke.texi: Document -ftree-ssa-dce and -fdump-tree-dce. + * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-dce.o. + +2002-09-17 Ben Elliston + + * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-dce.o. + tree-ssa-dce.o): New target. + * tree-ssa-dce.c: New file. + * flags.h (flag_tree_ssa_dce): Declare flag. + * tree.h (tree_dump_index): Add TDI_dce. + * toplev.c (flag_tree_ssa_dce): New flag. + (f_options): Add "dump-tree-all-ssa" option. + * tree-flow.h (enum tree_flags): Add TF_NECESSARY. + * tree-dump.c (dump_files): Add dump-tree-dce option. + (dump_enable_all_ssa): Enable it when dumping all. + * tree-optimize.h (tree_ssa_eliminate_dead_code): Declare. + * tree-optimize.c (optimize_function_tree): Invoke the + optimisation pass if flag_tree_ssa_dce is set. + +2002-09-17 Diego Novillo + + * Makefile.in (tree-ssa.o): Add dependency on c-tree.h + * c-simplify.c (mark_not_simple_r): Don't mark IDENTIFIER_NODEs. + * tree-dfa.c (function_may_recurse_p): Fix comment. + (dump_ref): Don't dump immediate uses for PHI nodes more than once. + (dump_referenced_vars): Unparse the name of the variable. + * tree-flow.h (dump_tree_ssa): Declare. + (debug_tree_ssa): Declare. + (replace_ref_operand_with): Check if OPERAND_P is NULL. + (restore_ref_operand): Ditto. + (tree_annotation): Check that constants, types and IDENTIFIER_NODEs + are not being annotated. + * tree-ssa.c: Include c-tree.h. + (dump_reaching_defs): Unparse the variable name. + (dump_tree_ssa): New function. + (tree_build_ssa): Call it. + (debug_tree_ssa): New function. + +2002-09-14 Steven Bosscher + + * dwarf2out.c (is_fortran): Return true for + DW_LANG_Fortran95. + (gen_compile_unit_die): Return DW_LANG_Fortran95 if + language is "GNU F95". + +2002-09-13 Daniel Berlin + + * tree-dump.c (dump_switch_p): Get longest match, not first one. + + * tree.h: Put TDI_* back in order, now that we do longest match + matching. + +2002-09-13 Diego Novillo + + * tree-dfa.c (add_call_site_clobbers): Call decl_function_context + instead of DECL_CONTEXT. + * tree-ssa-ccp.c (initialize): Ditto. + * tree-ssa.c (analyze_rdefs): Ditto. + +2002-09-11 Diego Novillo + + * tree-dfa.c (find_refs_in_stmt): Call clobber_vars_r to clobber + CLEANUP_STMT nodes. + (create_ref): Only add _DECL nodes to the list of referenced + variables. + (clobber_vars_r): Create a may-use reference prior to clobbering + the variable. + (add_call_site_clobbers): Ditto. + (add_ptr_may_refs): Move call to find_list_node where it's actually + needed. + * tree-flow.h: Update documentation on M_CLOBBER. + +2002-09-10 Daniel Berlin + + * tree-ssa-pre.c (defs_match_p): Fix typo ( | -> || ). + +2002-09-10 Diego Novillo + + * tree-dfa.c (V_PHI_ARG): Remove. Adjust related constants. + Update all users. + (add_ref_to_list_after): Don't allocate memory for the + node when adding to the beginning or the end of the list. + (add_phi_arg): Don't call create_ref to add a new argument. + (debug_phi_args): New function. + (dump_phi_args): New function. + (dump_ref): Call it. + (dump_referenced_vars): Use 'file' instead of 'dump_file'. + + * tree-flow.h (V_PHI_ARG): Remove. Update all users. + (struct var_ref): Move fields used in distinct + reference types to other structures. Update all users. + (struct var_def): New. + (struct var_phi): New. + (struct var_use): New. + (union tree_ref_d): Add members vdef, vphi, vuse and vphi_arg. + Update all users. + (save_chain): Remove. Update all users. + (set_save_chain): Remove. Update all users. + (marked_with): Remove. Update all users. + (mark_def_with): Remove. Update all users. + (dump_reaching_defs): Declare. + (debug_reaching_defs): Declare. + + (struct phi_node_arg_d): New structure. + (phi_node_arg): New type. + (phi_arg): Change return type to phi_node_arg. + (imm_reaching_def_edge): Rename to phi_arg_edge. + (set_imm_reaching_def_edge): Rename to set_phi_arg_edge. + (phi_arg_def): New inline function. + (set_phi_arg_def): New inline function. + (debug_phi_args): Declare. + (dump_phi_args): Declare. + + * tree-ssa-ccp.c: Use new phi_node_arg type when examining PHI node + arguments. + + * tree-ssa-pre.c: Ditto. + + * tree-ssa.c (save_chain): New local variable. + (build_fud_chains, search_fud_chains): Use it. + (marked): New local variable. + (tree_compute_rdefs, follow_chain): Use it. + (dump_reaching_defs): New function. + (debug_reaching_defs): New function. + +2002-09-09 Daniel Berlin + + * Makefile.in (tree-alias-steen.o): Remove gt-tree-alias-steen.h + (tree-alias-common.o): Add dependency on c-common.h + + * tree-ssa-pre.c: Fix PRE now that V_USE's expr's are the entire + assignment, rather than just the right hand side. + Stop generating our own call clobbers + + * tree-dfa.c (create_ref): Make sure var is not null before checking + TREE_THIS_VOLATILE. + + * tree.h: Reorder TDI_* so ssapre comes before ssa. + + * tree-dump.c: dump-tree-ssapre has to come before dump-tree-ssa + in the table, or else it'll never match. + +2002-09-09 Frank Ch. Eigler + + * tree-mudflap.c (mf_offset_expr_of_array_ref): Fold constants along + the way. + (mf_build_check_statement_for): Ditto. Flag new COMPONENT_REFs. + (mx_xfn_indirect_ref): Instrument COMPONENT_REFs specially. Tweak + ARRAY_REF instrumentation to reduce need of copying and recursion. + +2002-09-09 Diego Novillo + + * tree-ssa.c (analyze_rdefs): Disable uninitialized variable warnings. + +2002-09-09 Diego Novillo + + * Makefile.in (tree-ssa.o): Add dependency on tree-simple.h. + (tree-dfa.o): Add dependency on tree-simple.h and tree-inline.h. + (tree-alias-steen.o): Add dependency on c-common.h. + (tree-optimize.o): Add dependency on c-common.h. + + * c-simplify.c (deep_copy_node): Call walk_tree with mostly_copy_tree_r. + (mostly_copy_tree_r): Also copy flags from original tree. + (mark_not_simple_r): Call set_tree_flag. + + * tree-alias-steen.c: Include c-common.h. + + * tree-cfg.c (map_stmt_to_bb): Remove. + (block_invalidates_loop): Change return type to bool. + (create_loop_hdr): New function. + (create_bb): Call it. + (create_bb_ann): Return newly created annotation object. + (remove_bb_ann): Nullify loop_hdr annotation, if there is one. + (tree_delete_bb): Only remove basic block annotation from + executables statements. + (is_computed_goto): New function. + + * tree-dfa.c (pointer_refs): New file local variable. + (call_sites): New global variable. + (V_DEF, V_USE, V_PHI, V_PHI_ARG, E_FCALL, E_PHI, E_USE, E_KILL, + E_INJ): New global constants. + (M_DEFAULT, M_CLOBBER, M_MAY, M_PARTIAL, M_INITIAL, M_INDIRECT, + M_VOLATILE): New global constants. + (num_referenced_vars): New global variable. + (referenced_vars): Rename from referenced_symbols. Update all + users. + (clobber_vars_r): New function. + (add_default_defs): New function. + (add_call_site_clobbers): New function. + (add_ptr_may_refs): New function. + (add_phi_arg): New function. + (find_list_node): New function. + (remove_ref_from_list): Call it. + (add_ref_to_list_after): New function. + (is_pure_fcall): New function. + (fcall_takes_ref_args): New function. + (dump_referenced_vars): New function. + (debug_referenced_vars): New function. + (ref_type_name): New function. + (validate_ref_type): New function. + (debug_phi_args): Remove. + (dump_phi_args): Remove. + (add_referenced_var): Rename from add_ref_symbol. Update all + users. + (dump_ref): Rename from dump_varref. Update all users. + (debug_ref): Rename from debug_varref. Update all users. + (dump_ref_list): Rename from dump_varref_list. Update all users. + (dump_ref_array): Rename from dump_varref_array. Update all users. + (next_tree_ref_id): Rename from next_varref_id. Update all users. + + (tree_find_refs): Rename from tree_find_varrefs. Update all users. + Call add_default_defs. + Call add_call_site_clobbers. + Call add_ptr_may_refs. + Call dump_referenced_vars. + Create and destroy pointer_refs list. + + (find_refs_in_stmt): Set reference type to clobbering definition + for the ASM_OUTPUTS and ASM_CLOBBERS expressions of an ASM_STMT. + Set reference type to initial definition for the DECL_INITIAL node + of a DECL_STMT. + Clobber everything in CLEANUP_STMT nodes. + + (find_refs_in_expr): Re-write. + Recursively clobber every VAR_DECL contained in non SIMPLE nodes. + Mark indirect pointer references with M_INDIRECT flag. + Add pointer references to pointer_refs list. + Glob references to arrays and structures. + Add function call expressions to call_sites list. + + (empty_ref_list): Do nothing if the list is empty already. + (delete_ref_list): Ditto. + (create_ref): Add new argument ADD_TO_BB. + Set M_VOLATILE modifier if this is a reference to a volatile + variable. + Count number of incoming edges for V_PHI references before + initializing the V_PHI_ARG array. + Only add reference to basic block if ADD_TO_BB is true. + Set output reference for the parent expression for V_DEF + references. + (remove_tree_ann): Do nothing if the tree didn't have an + annotation. + + * tree-flow.h (enum treeref_type): Remove. Update all users. + (union varref_def): Ditto. + (tree_ref): Rename from varref. Update all users. + (V_DEF): Declare. + (V_USE): Declare. + (V_PHI): Declare. + (V_PHI_ARG): Declare. + (E_FCALL): Declare. + (E_PHI): Declare. + (E_USE): Declare. + (E_KILL): Declare. + (E_INJ): Declare. + (M_DEFAULT): Declare. + (M_CLOBBER): Declare. + (M_MAY): Declare. + (M_PARTIAL): Declare. + (M_INITIAL): Declare. + (M_INDIRECT): Declare. + (M_VOLATILE): Declare. + (struct tree_ref_common): Rename from treeref_common. Update all + users. + Change type of field 'type' to HOST_WIDE_INT. + Rename field 'sym' to 'var'. + (struct var_ref): Rename from varref. Update all users. + Join the structures varuse + and vardef into a single structure. + (struct expr_ref_common): Rename from exprref_common. Update all + users. + (struct expr_use): Rename from expruse. Update all users. + (struct expr_phi): Rename from exprphi. Update all users. + (union tree_ref_d): Rename from varref_def. Update all users. + (EXPRPHI_PHI_ARGS): Rename from EXPRPHI_PHI_CHAIN. Update all + users. + (struct tree_ann_d): Rename field 'compound_stmt' to + 'compound_parent'. + Add field 'output_ref'. + (enum tree_flags): New enum. + (TF_REFERENCED): New flag. + (phi_arg): Remove. + (get_num_phi_args): Remove. + (get_phi_arg): Remove. + + (struct vardef): Remove. Update all users. + (VARDEF_IMM_USES): Ditto. + (VARDEF_SAVE_CHAIN): Ditto. + (VARDEF_RUSES): Ditto. + (VARDEF_MARKED): Ditto. + (VARDEF_PHI_ARGS): Ditto. + (struct varuse): Ditto. + (VARUSE_IMM_RDEF): Ditto. + (VARUSE_RDEFS): Ditto. + (VARREF_ID): Ditto. + (VARREF_TYPE): Ditto. + (VARREF_BB): Ditto. + (VARREF_EXPR): Ditto. + (VARREF_OPERAND_P): Ditto. + (VARREF_STMT): Ditto. + (VARREF_SYM): Ditto. + (IS_DEFAULT_DEF): Ditto. + (IS_ARTIFICIAL_REF): Ditto. + (TREE_ANN): Ditto. + (BB_FOR_STMT): Ditto. + (TREE_CURRDEF): Ditto. + (TREE_REFS): Ditto. + (TREE_COMPOUND_STMT): Ditto. + (TREE_FLAGS): Ditto. + (BB_ANN): Ditto. + (BB_PARENT): Ditto. + (BB_REFS): Ditto. + (BB_PREV_CHAIN_P): Ditto. + (BB_BINDING_SCOPE): Ditto. + (BB_LOOP_HDR): Ditto. + (FOR_INIT_STMT_BB): Ditto. + (FOR_COND_BB): Ditto. + (FOR_EXPR_BB): Ditto. + (END_WHILE_BB): Ditto. + (DO_COND_BB): Ditto. + (BB_EMPTY_P): Ditto. + + (ref_type): New inline function. + (ref_var): New inline function. + (ref_stmt): New inline function. + (ref_expr): New inline function. + (ref_bb): New inline function. + (ref_id): New inline function. + (replace_ref_operand_with): New inline function. + (restore_ref_operand): New inline function. + (imm_uses): New inline function. + (save_chain): New inline function. + (set_save_chain): New inline function. + (reached_uses): New inline function. + (marked_with): New inline function. + (mark_def_with): New inline function. + (phi_args): New inline function. + (num_phi_args): New inline function. + (phi_arg): New inline function. + (imm_reaching_def): New inline function. + (set_imm_reaching_def): New inline function. + (imm_reaching_def_edge): New inline function. + (set_imm_reaching_def_edge): New inline function. + (reaching_defs): New inline function. + (tree_annotation): New inline function. + (has_annotation): New inline function. + (bb_for_stmt): New inline function. + (set_bb_for_stmt): New inline function. + (currdef_for): New inline function. + (set_currdef_for): New inline function. + (tree_refs): New inline function. + (add_tree_ref): New inline function. + (remove_tree_ref): New inline function. + (compound_parent): New inline function. + (set_compound_parent): New inline function. + (set_tree_flag): New inline function. + (clear_tree_flag): New inline function. + (tree_flags): New inline function. + (reset_tree_flags): New inline function. + (output_ref): New inline function. + (set_output_ref): New inline function. + (bb_annotation): New inline function. + (bb_parent): New inline function. + (set_bb_parent): New inline function. + (bb_refs): New inline function. + (remove_bb_ref): New inline function. + (prev_chain_p): New inline function. + (set_prev_chain_p): New inline function. + (binding_scope): New inline function. + (set_binding_scope): New inline function. + (header_blocks): New inline function. + (for_init_bb): New inline function. + (set_for_init_bb): New inline function. + (for_cond_bb): New inline function. + (set_for_cond_bb): New inline function. + (for_expr_bb): New inline function. + (set_for_expr_bb): New inline function. + (end_while_bb): New inline function. + (set_end_while_bb): New inline function. + (do_cond_bb): New inline function. + (set_do_cond_bb): New inline function. + (bb_empty_p): New inline function. + + (referenced_vars): Rename from referenced_symbols. Update all + users. + (num_referenced_vars): Declare. + (NREF_SYMBOLS): Remove. Update all users. + (REF_SYMBOL): Ditto. + (ADD_REF_SYMBOL): Ditto. + (referenced_var): New inline function. + (call_sites): Declare. + (next_tree_ref_id): Rename from next_varref_id. Update all users. + (is_computed_goto): Declare. + (is_pure_fcall): Declare. + (fcall_takes_ref_args): Declare. + (add_ref_to_list_after): Declare. + (find_list_node): Declare. + (ref_type_name): Declare. + (validate_ref_type): Declare. + + * tree-optimize.c: Include c-common.h. + (optimize_function_tree): Store DECL_SAVED_TREE in a local + variable. + + * tree-ssa-ccp.c (cp_lattice_meet): New function. + (visit_phi_node): Call it. + (add_outgoing_control_edges): New function. + (visit_expression_for): Call it. + Don't handle static initializers. + Handle computed gotos. + (add_control_edge): New function. + (visit_condexpr_for, simulate_block, add_outgoing_control_edges): Call + it. + (simulate_def_use_chains): Only look at unmodified V_USE references. + (ssa_ccp_substitute_constants): Ditto. + (evaluate_expr): Ditto. + (initialize): Set initial value for incoming parameters and globals + to VARYING. + Set initial value for initialized static variables to VARYING, + unless the variable is read-only. + (set_lattice_value): Don't special case globals, volatiles and + variables with their address taken. + + * tree-ssa.c: Include tree-simple.h. + (tree_build_ssa): Don't add default definitions. + (insert_phi_terms): Add new PHI nodes at the beginning of the list + of references for the basic block. + (search_fud_chains): Add def-def chains for non-killing + definitions. + (delete_ssa): Remove list call_sites. + Set num_referenced_vars to 0. + Set referenced_vars to NULL. + (follow_chain): Follow def-def chains for non-killing definitions. + (is_upward_exposed): Change return type to bool. + (add_phi_arg): Remove. + +2002-09-06 Frank Ch. Eigler + + * tree-mudflap.c (deferred_static_decl*): Correct GTY markup. + (mudflap_enqueue_decl): Correct iteration bounds. + (mf_init_extern_trees): Add more constness to mf_cache_structptr_type. + (mf_offset_expr_of_array_ref): Remove excess mx_flagging. save_expr + array subscripts. + (mf_build_check_statement_for): Reorganize to take explicit + check-base/size arguments, in addition to value argument. save_expr + array subscripts. Copy value/base/size subtrees. + (mx_xfn_indirect_ref): Support marking of subtrees for nontraversal. + Track source line numbers more aggressively. For arrays, check bounds + from base through indexed element, not just the indexed element. + Use nontraversal flagging to eliminate some excess instrumentation. + (mf_xform_derefs): Support nontraversal by a hash table. + (*): Remove "{{{"/"}}}" folding marks. + +2002-09-02 Daniel Berlin + + * tree-alias-common.[ch]: New files. + * tree-alias-steen.[ch]: Split out common stuff into + tree-alias-common.[ch]. + * c-config-lang.in: Modify to use tree-alias-common.[ch] instead of + tree-alias-steen, since this is where the GTY'd stuff is now. + * Makefile.in: Add dependencies for tree-alias-common.[ch]. + +2002-09-03 Diego Novillo + + * c-simplify.c (simplify_goto_stmt): New function. + (simplify_stmt): Call it. + * tree-simple.c: Document grammar for GOTO_STMT nodes. + (rationalize_compound_expr): Wrap it with #if 0/#endif. + (get_base_symbol): Minor comment fixup. + +2002-09-03 Frank Ch. Eigler + + * gcc.c (MFWRAP_SPEC): Add --wrap=alloca. + +2002-09-01 Diego Novillo + + * c-simplify.c (simplify_stmt): Mark CLEANUP_STMTs and ASM_STMTs + not SIMPLE. + (simplify_for_stmt): Do not allow expression sequences in + FOR_INIT_STMT and FOR_EXPR nodes. + * tree-simple.c: Document difference with original SIMPLE grammar. + +2002-08-31 Frank Ch. Eigler + + * tree-mudflap.c (mf_build_check_statement_for): Tolerate dereference + of void pointers. + (mx_register_decl): Correct typo in below patch. + +2002-08-30 Graydon Hoare + + * tree-mudflap.c (mx_register_decl): Mark declarations as + TREE_ADDRESSABLE when mudflap decides to register them. + +2002-08-29 Graydon Hoare + + * tree-mudflap.c (mx_xfn_indirect_ref): Rewrite array references as + pointer dereferences. + (struct mf_xform_decls_data): New member: param_decls. + (mx_register_decl): New function. + (mx_xfn_xform_decls): Factor code out into mx_register_decl. + Register live parameters with mudflap. + (mx_xfn_find_addrof): Notice references to fields of structures + and function parameters. + +2002-08-29 Frank Ch. Eigler + + * c-pretty-print.c (dump_c_tree): Detect loops in statement chains + using a hash table to track visited status. + * Makefile.in: Add hashtab.h dependency. + +2002-08-28 Frank Ch. Eigler + + * tree-mudflap.c (mudflap_enqueue_constant): Register non-string + constants also. + (mf_build_check_statement_for): Include pushlevel/pushdecl/poplevel + for local variables. + +2002-08-27 Frank Ch. Eigler + + Better static registration: + * varasm.c (make_decl_rtl): Handle DECL_RTL_SET_P case for + mudflap static registration. + * tree-mudflap.c (mudflap_enqueue_decl): Rewrite to handle + deferred statics. + (mudflap_finish_file): Call above fn back for deferred statics. + + Cleanup: + * tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree): + Reorganize output_buffer reuse mechanism. + (mf_build_check_statement_for): Set TREE_SIDE_EFFECTS. + (mx_xfn_indirect_ref): Correct file/line collection tests. + + Dynamic linking support: + * gcc.c (MFWRAP_SPEC): Make conditional on -static. Add the + newer wrapped functions dlopen/mmap/munmap. + (MFLIB_SPEC): Be sensitive to -static. Partial support for + dynamic linking. + +2002-08-26 Diego Novillo + + * Makefile.in (tree-ssa.o): Add dependency on ggc.h + (c-simplify.o): Add dependency on langhooks-def.h + * c-simplify.c: Include langhooks-def.h + (simplify_function_tree): Do nothing if the front end does not + support simplification. + + * tree-flow.h (struct vardef): Remove fields 'phi_chain' and + 'phi_chain_bb'. + Add field 'phi_args'. + (VARDEF_PHI_CHAIN): Remove. Update all users. + (VARDEF_PHI_CHAIN_BB): Remove. Update all users. + (VARDEF_PHI_ARGS): Define. + (struct varuse): Rename field 'chain' to 'imm_rdef'. Update all + users. + (VARUSE_IMM_RDEF): Rename from VARUSE_CHAIN. Update all users. + (phi_arg): New structure. + (get_num_phi_args): New function. + (get_phi_arg): New function. + (set_phi_arg): New function. + (add_phi_arg): New function. + (debug_phi_args): Declare. + (dump_phi_args): Declare. + * tree-dfa.c (create_ref): Remove initialization of + VARDEF_PHI_CHAIN and VARDEF_PHI_CHAIN_BB. + Initialize array VARDEF_PHI_ARGS. + (dump_varref): Call dump_phi_args. + (dump_phi_args): New function. + (debug_phi_args): New function. + * tree-ssa-ccp.c (PHI_PARMS): Remove. + (EIE): Remove. + (visit_phi_node): Get the argument's edge directly from the + argument instead of calling find_edge. + (initialize): Cast call to NUM_EDGES to unsigned. + * tree-ssa-pre.c: Update uses of VARDEF_PHI_CHAIN, + VARDEF_PHI_CHAIN_BB and VARUSE_CHAIN everywhere. + * tree-ssa.c: Ditto. + Include ggc.h. + (search_fud_chains): Call add_phi_arg to add arguments to each PHI + node. + (tree_ssa_remove_phi_alternative): Call set_phi_arg to switch the + last element with the element being removed. + +2002-08-26 Diego Novillo + + * c-simplify.c (mostly_copy_tree_r): Unshare STMT_EXPR + nodes. + +2002-08-25 Diego Novillo + + * tree-dfa.c (find_refs_in_stmt): Replace calls to + RETURN_EXPR with RETURN_STMT_EXPR. + * c-simplify.c (simplify_return_stmt): Ditto. + (deep_copy_node): Ditto. + * c-pretty-print.c (dump_c_node): Ditto. + +2002-08-24 Diego Novillo + + * c-pretty-print.c: Add `break' after calls to NIY in + switch statements. + +2002-08-23 Jeffrey A Law (law@redhat.com) + + * tree-ssa-ccp.c (tree_ssa_ccp): Remove #if 0 that accidentally + got checked in. Cleanup the cfg to remove unreachable blocks + discovered by CCP. + + * basic-block.h (EDGE_EXECUTABLE): New edge flag. + + * cfganal.c (find_edge): New function. + + * ssa-ccp.c: Convert to use EDGE_EXECUTABLE bit in the + edge flags rather than a bitmap. Convert edge worklist + into a varray. Avoids expensive find_index_edge calls. + * tree-ssa-ccp.c: Likewise. + + * tree-flow.h (tree_ssa_remove_phi_alternative): Declare. + * tree-ssa.c (tree_ssa_remove_phi_alternative): New function. + * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove + PHI alternatives for unexecutable edges. Also remove + unexecutable edges from the CFG. + +2002-08-22 Jeffrey A Law (law@redhat.com) + + * Makefile.in (tree-optimize.o): Depend on tree-dchain.o + * tree-optimize.c: Include tree-dchain.h. + (optimize_function_tree): Unconditionally build and tear down + the backpointers for the statement chain. + +2002-08-22 Diego Novillo + + * tree-dfa.c (find_refs_in_stmt): Look for VARUSE references in + initialization expressions. + (find_refs_in_expr): Reformat. + (remove_ref_from_list): Optimize for the common case of removing + the head or the tail of the list. + (add_ref_to_list_end): Reformat comment. + (create_ref): Store the reference to LHS of assignment expressions. + (dump_varref): Also dump immediate uses of PHI nodes. + * tree-flow.h (IS_GHOST_DEF): Rename to IS_DEFAULT_DEF. Update all + callers everywhere. + (struct tree_ann_def): Update comments for field 'currdef'. + * tree-ssa-ccp.c (ssa_edges): Change type to ref_list. + (SSA_NAME): Remove. + (initialize): New function + (finalize): New function. + (visit_expression): Rename to visit_expression_for. Update all + callers. + (visit_condexpr_for): New function. + (visit_assignment): Rename to visit_assignment_for. Update all + callers. + (examine_flow_edges): Rename to simulate_block. Update all + callers. + (follow_def_use_chains): Rename to simulate_def_use_chains. Update + all callers. + (evaluate_expr_for): Rename to evaluate_expr. Change argument to + 'tree'. + (set_lattice_value): New function. + (tree_ssa_ccp): Change main loop to visit flow_edges and ssa_edges + alternately. + (visit_phi_node): Do not set the lattice value to UNDEFINED when we + find a non-executable edge. + (visit_expression_for): Default definitions for PARM_DECLs are + assigned a VARYING value. + Default definitions for any other local variables are assigned an + UNDEFINED value. + Clobber VARDEFs that are not the LHS of an assignment. + Clobber VARDEFs that initialize non-const static variables. + * tree-ssa.c (search_fud_chains): Set up def-use edges for PHI + nodes and regular definitions. + + * tree.c (simple_cst_equal): Call simple_cst_list_equal to compare + CONSTRUCTOR_ELTS pointers. + +2002-08-22 Diego Novillo + + * c-pretty-print.c (buffer): New file local variable. + (initialized): New file local variable. + (print_c_tree): Don't call init_output_buffer. Call + maybe_init_pretty_print. + (print_c_node): Ditto. + (print_c_node_brief): Ditto. + (maybe_init_pretty_print): New function. + * tree-mudflap.c (mf_varname_tree): Only call init_output_buffer + once. Call output_clear_message_text before returning. + +2002-08-21 Frank Ch. Eigler + + Support source-file/line coordinates in check/violation messages. + * tree-mudflap.c (mf_init_extern_trees): Add new "location" formal + arg to __mf_check. + (mf_file_function_line_tree): New function to build an actual location + string. + (build_check_statement_for): Call it / pass it. + (mx_xfn_indirect_ref): Track source file/line location via + STMT_LINENO, FILE_STMT, EXPR_WITH_FILE_LOCATION traversal memos. + +2002-08-21 Daniel Berlin + + * dominance.c: Cache immediate dominators. + +2002-08-20 Daniel Berlin + + * tree-alias-steen.h (struct tree_alias_ops): Add flag for + interprocedural. + + * tree-alias-steen.c (steen_alias_ops): Set interprocedural to 0 + for now. + (intra_function_call): New function to handle intraprocedural calling. + (finc_func_aliases): Use it. + Handle *x = *y, *x = &y, and *x = (cast) y. + (display_points_to_set_helper): New function, split from ... + (display_points_to_set): Here. + (create_alias_vars): Try to print all alias vars we find in the + alias_vars array, rather than just those that are linked directly to + trees. + Clear arrays when we finish if we aren't interprocedural. + +2002-08-20 Frank Ch. Eigler + + static object registration support: + * tree-mudflap.c (mudflap_enqueue_decl, mudflap_enqueue_constant): + Replace stubs with real code. + (mf_enqueue_register_call): New function to generate asm-object + call to __mf_register. + (mf_flush_enqueued_calls): New function to emit global ctor function + with enqueued __mf_register calls. + (mf_varname_tree): Tolerate being called from non-function context. + * c-objc-common.c: #include . + + gengtypes support for mudflap: + * Makefile.in (GTFILES): Include tree-mudflap.c. + (gt-tree-mudflap.h): New target. + * tree-mudflap.c: Annotate global tree nodes with GTY(()). + * tree-nomudflap.c: Add dummy ggc root table. + +2002-08-19 Diego Novillo + + * tree-dfa.c (find_refs_in_expr): If the current sub-expression is + not SIMPLE, mark its parent. + (create_ref): If the parent expression is not SIMPLE, create + VARDEFs regardless of the original reference type. + + * tree-ssa-ccp.c (widen_bitfield): New function. + (evaluate_expr_for): Call it. + +2002-08-18 Diego Novillo + + * tree-ssa-ccp.c (evaluate_expr_for): Fix thinko in + 2002-08-17 patch. + +2002-08-17 Diego Novillo + + * tree-ssa-ccp.c (evaluate_expr_for): keep VARREF_SYM in a local + variable. + +2002-08-16 Diego Novillo + + * basic-block.h (BB_CONTROL_EXPR): Update value. + (BB_LOOP_CONTROL_EXPR): Define. + (BB_CONTROL_ENTRY): Update value. + * tree-cfg.c (make_for_stmt_blocks): Flag header blocks withh + BB_LOOP_CONTROL_EXPR. + (make_while_stmt_blocks): Ditto. + (make_do_stmt_blocks): Ditto. + (tree_delete_bb): Update annotations in the loop entry block when + removing one of the loop expression blocks. + + * tree-dfa.c (tree_find_varrefs): Disregard empty blocks. + (find_refs_in_stmt): Handle all the loop expression blocks in + FOR_STMT and DO_STMT nodes. + (find_refs_in_expr): Change first argument to tree *. Update all + callers. + Force all references to be definitions when the expression is not + in SIMPLE form. + Also create references for compound variables and array references. + Not just their individual components. + Always use the original parent expression when making recursive + calls. + (create_ref): Add new argument operand_p. Update all callers. + (remove_tree_ann): New function. + (dump_varref): Don't assume that the referenced symbol is a _DECL + node. + * tree-flow.h (treeref_common): Add field operand_p. + (VARREF_OPERAND_P): Define. + (BB_EMPTY_P): Define. + (remove_tree_ann): Declare. + (create_ref): Add new argument operand_p. + * tree-simple.c (get_base_symbol): New function. + * tree-simple.h (get_base_symbol): Declare. + * tree-ssa-ccp.c (visit_assignment): Call it. + (ssa_ccp_substitute_constants): Use VARREF_OPERAND_P to replace + values into the expression. + (evaluate_expr_for): Ditto. + Do not try to evaluate the expression if the reference is not of + the same type as the expression. + After evaluation, restore the expression to its original form. + * tree-ssa-pre.c (insert_occ_in_preorder_dt_order_): Update calls + to create_ref. + (finalize_): Ditto. + (expr_phi_insertion): Ditto. + * tree-ssa.c (tree_build_ssa): Ditto. + (insert_phi_terms): Ditto. + (delete_ssa): Call remove_tree_ann. + +2002-08-15 Diego Novillo + + * c-pretty-print.c: Move extern definitions to diagnostic.h. + (print_c_node_brief): New function. + (debug_c_node_brief): New function. + (debug_c_node): Add option for showing brief versions of statement + nodes. Update all callers. + (print_declaration): Ditto. + * c-simplify.c (simplify_function_tree): Add newline to debug + output. + * c-tree.h (print_c_node_brief): Declare. + (debug_c_node_brief): Declare. + * tree-cfg.c: Call print_c_node_brief in debugging otuput. + * tree-mudflap.c (dump_c_node): Remove extern declaration. + (mf_varname_tree): Update call to dump_c_node. + +2002-08-15 Daniel Berlin + + * tree-cfg.c (find_expr_in_tree_helper): Renamed from find_expr_in_tree. + (find_expr_in_tree): Redone. + +2002-08-15 Daniel Berlin + + * tree-cfg.c (insert_before_ctrl_stmt): Fix insertion for various + parts of for loop. + + * tree-ssa-pre.c (finalize_1): Set EXPR_STMT type to type of + expression in it. + +2002-08-14 Frank Ch. Eigler + + * gcc.c (LINK_COMMAND_SPEC): Tweak placement of %(mflib). + +2002-08-14 Diego Novillo + + * tree-simple.h (is_simple_decl_stmt): Declare. + +2002-08-13 Frank Ch. Eigler + + * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): New macros, splitting MFLIB_SPEC. + (mfwrap_spec, mflib_spec): Define corresponding vars. + (static_specs): Define correponding spec aliases. + (LINK_COMMAND_SPEC): Include -fmudflap refs to new spec aliases. + (cpp_unique_options): Move -fmudflap MFCPP_SPEC clause here. + (cc1_options): Move -fmudflap MFCC1_SPEC clause here. + (MFCC1_SPEC, MFCPP_SPEC, MFLIB_SPEC): Remove macros and uses. + +2002-08-13 Graydon Hoare + + * tree-mudflap.c (mf_build_check_statement_for): Factor code out of + mx_xfn_indirect_ref for use in ARRAY_REF case. + (mf_build_check_statement_for): Check size of underlying object + rather than size of pointer. + (mx_xfn_indirect_ref): Check ARRAY_REF expressions. + (mf_offset_expr_of_array_ref): New function to calculate array ref + offsets. + +2002-08-13 Diego Novillo + + * tree-simple.c (is_simple_condexpr): Update comment. + * tree-ssa-ccp.c (ssa_ccp_substitute_constants): Add debugging code. + +2002-08-12 Jason Merrill + + * c-typeck.c (build_component_ref): Don't add a NON_LVALUE_EXPR + in C99 mode. + + * c-simplify.c (simplify_expr): Always simplify. Loop if *expr_p + changed. + (simplify_addr_expr): Just replace *expr_p if we have a '&*'. + * tree-simple.c (is_simplifiable_builtin): Add more tree codes. + +2002-08-11 Diego Novillo + + * c-simplify.c: Fix typo. Substitute CHECKING with ENABLE_CHECKING. + * tree-cfg.c: Ditto. + * tree-dfa.c: Ditto. + * tree-ssa-ccp.c: Ditto. + * tree-ssa.c: Ditto. + +2002-08-11 Diego Novillo + + * tree-dfa.c (find_refs_in_expr): Use the given ref_type for some unary + expressions. + (create_ref): Insert ghost definitions at the beginning of the + basic block. + (find_expr_in_tree): Ignore IDENTIFIER_NODE. + * tree-flow.h (treeref_common): Move the id field to the end of the + structure. + (IS_GHOST_DEF): Redefine to return non zero for definitions + without an associated expression in basic block 0. + * tree-ssa-ccp.c (tree_ssa_ccp): Use last_basic_block to allocate + executable_blocks. + (visit_expression): Set the lattice value for ghost definitions to + VARYING. + (examine_flow_edges): Update comments. + * tree-ssa.c (tree_build_ssa): Create ghost definitions in basic + block 0. + (insert_phi_terms): Don't ignore ghost definitions. + + * c-simplify.c (simplify_function_tree): Return 0 if the function's + body is not a COMPOUND_STMT. + Return 0 if simplification failed. + (simplify_expr): Change to return int. Return non zero if + simplification was successful. + (c_simplify_expr): Add default case to avoid compile time warnings. + (create_tmp_alias_var): Reformat comment. + * tree-simple.h (simplify_expr): Change return type to int. + + * c-simplify.c: Guard consistency checks with #if defined CHECKING + everywhere. + * tree-cfg.c: Ditto. + * tree-dfa.c: Ditto. + * tree-ssa-ccp.c: Ditto. + * tree-ssa.c: Ditto. + + * c-simplify.c: Include hard-reg-set.h, basic-block.h and + tree-flow.h. + (mark_not_simple_r): New function. + (simplify_expr): Temporarily mark VA_ARG_EXPR and BIT_FIELD_REF + trees as not simplifiable. + (simplify_call_expr): If the builtin cannot be simplified, flag it. + * Makefile.in (c-simplify.o): Update dependencies. + * tree-dfa.c (create_ref): Variable references inside + non-simplifiable expressions are always considered definitions. + * tree-flow.h (TF_NOT_SIMPLE): New flag. + * tree-simple.c (is_simplifiable_builtin): Update comments. + + * c-pretty-print.c (dump_c_node): Unparse anonymous structures and + unions. + Change rendering for SAVE_EXPR and BIT_FIELD_REF. + + * Makefile.in (tree-mudflap.o, tree-nomudflap.o): Add. + +2002-08-11 Frank Ch. Eigler + + Prototype -fmudflap support. + * Makefile.in (C_AND_OBJC_OBJS): Add tree-mudflap.o. + (OBJS): Add tree-nomudflap.o. + * flags.h (flag_mudflap): New flag. + * toplev.c: Map "-fmudflap" to that flag. + * c-decl.c (c_expand_body): Call mudflap_c_function if flag_mudflap. + * c-objc-common.c (c_objc_common_finish_file): Add mudflap hook. + * varasm.c (make_decl_rtl): Add mudflap hook. + (output_constant_def_contents): Ditto. + * tree-mudflap.c: New file: implement mudflap instrumentation. + * tree-nomudflap.c: New file: stub functions for non-C frontends. + * tree-mudflap.h: New file: define exported functions. + * gcc.c (MFLIB_SPEC, MFCC1_SPEC, MFCPP_SPEC): Add general + -fmudflap spec mappings. + * c-simplify.c (simplify_stmt): Stub: handle CLEANUP_STMT nodes. + * tree-dfa.c (find_refs_in_stmt): Ditto. + * c-pretty-print.c (dump_c_node): Ditto. + (print_declaration): Handle "extern" decls. Handle arrays with + indefinite sizes. + * tree-simple.h (is_simple_stmt, is_simple_compstmt): Remove decls. + +2002-08-11 Jason Merrill + + * c-simplify.c (simplify_self_mod_expr): Unshare the lhs before + using it again. + (simplify_compound_lval): Don't unshare. + + * c-simplify.c (c_simplify_expr): Check statement_code_p. + + * c-simplify.c (maybe_fixup_loop_cond): Move to cp/cp-simplify.c. + (simplify_for_stmt): Don't call it. + (simplify_while_stmt): Don't call it. + +2002-08-11 Diego Novillo + + * c-simplify.c (simplify_compound_lval): Use mostly_copy_tree_r. + +2002-08-09 Jason Merrill + + * langhooks-def.h: Replace the simplify_function_tree hook + with a simplify_expr hook. + * langhooks.h: Likewise. + * langhooks.c: Replace lhd_simplify_function_tree with + lhd_simplify_expr. + * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Don't define. + (LANG_HOOKS_SIMPLIFY_EXPR): Define. + * c-decl.c (c_expand_body): De-hook simplify_function_tree. + * c-common.h: Declare c_simplify_expr. + * c-simplify.c (simplify_function_tree): Rename from + c_simplify_function_tree. Call simplify_expr instead of + simplify_stmt. + (c_simplify_expr): Split out from... + (simplify_expr): ...here. No longer static. Call langhook. + (is_simple_decl_stmt): Move here from tree-simple.c. + * tree-simple.c: Don't include c-tree.h. + (is_simple_stmt, is_simple_compstmt): Remove. + (is_simple_decl_stmt): Move to c-simplify.c. + * tree.h: Declare simplify_function_tree. + * tree-simple.h: Declare simplify_expr, add_tree. + + * tree-simple.c (rationalize_compound_expr): New fn. + +2002-08-07 Diego Novillo + + * basic-block.h (EDGE_TRUE_VALUE): Define. + (EDGE_FALSE_VALUE): Define. + * tree-cfg.c: Include c-tree.h. + (make_for_stmt_edges): Call simple_cst_equal to determine infinite + and zero iteration loops. + Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to edges coming out of + predicate block. + (make_while_stmt_edges): Ditto. + (make_do_stmt_edges): Ditto. + (make_if_stmt_edges): Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to + edges coming out of predicate block. + + * c-simplify.c (simplify_compound_lval): Unshare the compound + reference before simplification. + + * tree-cfg.c (insert_before_ctrl_stmt): Call print_c_node instead of + print_node_brief. + (insert_before_normal_stmt): Ditto. + (insert_after_ctrl_stmt): Ditto. + (insert_after_normal_stmt): Ditto. + (insert_after_loop_body): Ditto. + (replace_expr_in_tree): Ditto. + (tree_dump_bb): Ditto. + + * tree-dfa.c: Include c-tree.h + (next_varref_id): New global variable. + (tree_find_varrefs): Initialize it to 0. + (create_ref): Increment it after creating a new reference. Store + it in ref.common.id. + Add the new reference to the list of references for the containing + expression. + (dump_varref): Show the reference ID. + * tree-flow.h (treeref_common): Add field 'id'. + (VARREF_ID): Define. + + * tree-dump.c (dump_files): Re-order dump files. + * tree.h (tree_dump_index): Ditto. + + * tree-optimize.c (optimize_function_tree): Remove blank lines. + + * tree-simple.c: Remove unary operator '!' from grammar. + + * tree-flow.h (tree_ann_def): Add field 'flags'. + (TF_FOLD): Define. + (TREE_ANN): Re-define into an lvalue. + (BB_FOR_STMT): Ditto. + (TREE_CURRDEF): Ditto. + (next_varref_id): Declare. + * tree-ssa-ccp.c: Include tree-simple.h + (ssa_edges): Convert sbitmap into varray_type. Update all uses. + (decl_map): Remove. + (SSA_NAME): Use VARREF_ID instead of DECL_UID. + (visit_assignment): New function. + (evaluate_expr_for): New function. + (dump_lattice_value): New function. + (tree_ssa_ccp): Add debugging dumps. + Remove #if 0 code everywhere. + (visit_phi_node): Add debugging dumps. + Also visit PHI arguments. + Remove basic block argument + (visit_expression): Re-implement. + (examine_flow_edges): Add debugging dumps. + (ssa_ccp_substitute_constants): Add debugging dumps. + Update comments. + Mark and fold expressions with substituted constants. + * tree-ssa.c (search_fud_chains): Don't check if BB_REFS(bb) is + empty before iterating. + Add comment explaining how we chain PHI node arguments to their + originating basic block. + + * Makefile.in (tree-cfg.o, tree-dfa.o, tree-ssa-ccp.o): Update + dependencies. + +2002-07-29 Daniel Berlin + + * tree-ssa-pre.c (tree_perform_ssapre): Ben forgot to add a + dump_begin call when he removed the before dump. + +2002-07-24 Daniel Berlin + + * tree-alias-ecr.c (ECR_new_with_type): Use correct number in mapping. + +2002-07-23 Daniel Berlin + + * c-simplify.c (simplify_for_stmt): Deep copy the result of the + tail_expression, so it's unshared. + +2002-07-23 Daniel Berlin + + * tree-flow.h: Add prototype for create_alias_vars. + + * tree-alias-steen.c (display_points_to_set): New function. + (init_alias_vars): Display points to sets when we are done. + + * disjoint-set.h (disjoint_set_def): ptr_alias to ECR_def so that + we mark parent properly. + +2002-07-24 Diego Novillo + + * Makefile.in (GTFILES): Move tree-alias-type.[ch], + tree-alias-ecr.[ch], tree-alias-steen.[ch] from ... + * c-config-lang.in (gtfiles): ... here. + + * tree-simple.c (is_simplifiable_builtin): Replace + BUILT_IN_VARARGS_START with BUILT_IN_VA_START. + +2002-07-23 Andreas Jaeger + + * tree-ssa-pre.c (hash_expr_tree): Remove. + + * c-call-graph.c (write_dtd): Remove. + + * tree-ssa.c (delete_refs): Remove. + +2002-07-23 Andreas Jaeger + + * gengtype.c (open_base_files): Add tree.h. + + * tree-alias-type.h: Remove inclusion of tree.h. + + * tree-alias-steen.c: Include tree.h. + Add prototype for create_fun_alias_var_ptf. + + * tree-alias-ecr.c: Add prototype for ECR_add_pending. + + * tree-ssa-pre.c (calculate_preorder): Remove unused variables. + + * tree-simple.c: Include expr.h and rtl.h for prototypes. + + * tree-optimize.c: Include tree-alias-steen.h for prototypes. + + * Makefile.in (tree-optimize.o): Add tree-alias-steen.h. + (tree-simple.o): Add expr.h and rtl.h. + (tree-alias-steen.o): Add tree.h. + + * diagnostic.h: Add declaration of debug_output_buffer. + + * c-call-graph.c (construct_call_graph): Make static to follow + declaration. + (construct_call_graph): Use #if 0 instead of C++ comments to + disable code. + +2002-07-20 Andreas Jaeger + + * doc/invoke.texi (Option Summary): Fix syntax. + +2002-07-19 Jason Merrill + + * c-simplify.c (simplify_return_stmt): Do simplify a returned + expression in a void function. + + * c-simplify.c (simplify_stmt_expr): Handle C++ return semantics. + +2002-07-19 Jason Merrill + + * c-pretty-print.c (dump_c_node) [TARGET_EXPR]: Handle. + [COND_EXPR]: Print a returned expression in a void function. + +2002-07-19 Ben Elliston + + * tree-ssa-pre.c (tree_perform_ssapre): Don't dump the original + tree before applying this optimisation. + + * flags.h (flag_dump_tree_all_ssa): New flag. + * toplev.c (flag_dump_tree_all_ssa): New flag. + (f_options): Add "dump-tree-all-ssa" option. + (process_options): Process flag_dump_tree_all_ssa. + * tree.h (dump_enable_all_ssa): Declare. + * tree-dump.c (dump_enable_all_ssa): New function. + * doc/invoke.texi (Option Summary): Add -fdump-tree-all-ssa and + -fdump-tree-ssapre options. + (Debugging Options): Describe in more detail. + * c-simplify.c (c_simplify_function_tree): Dump the original tree + only if a TDI_original dump is requested, rather than TDI_simple. + + * tree-dump.c (dump_begin): Include phase number in dump filename. + +2002-07-18 Ben Elliston + + * tree-dump.c (dump_files): Rename "unparse" to "raw". + * tree.h (TDF_UNPARSE): Rename from this .. + (TDF_RAW): .. to this. + * tree-ssa-pre.c (tree_perform_ssapre): Use TDF_RAW and invert the + logical sense of this flag. + * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. + * c-simplify.c (c_simplify_function_tree): Likewise. + +2002-07-18 Daniel Berlin + + * tree-ssa-pre.c (calculate_preorder): New function. + (tree_perform_ssapre): Use it, rather than + flow_compute_preorder_tranversal, which seems to not do + what we want. + +2002-07-18 Daniel Berlin + + * tree-alias-type.c: Move gt-tree-alias-type include to end of file. + + * tree-alias-steen.c: Move gt-tree-alias-steen include to end of file. + +2002-07-18 Daniel Berlin + + * gengtype.c (get_base_file_bitmap): Mark tree-alias-* and + disjoint-set* as c/c++/objc files only. + + * Makefile.in (gt-tree-alias-type.h): Add. + (tree-alias-type.o): Add dependency on gt-tree-alias-type.h. + + * tree-alias-type.c: Include gt-tree-alias-type.h. + (alias_bottom): Add a GTY marked version of alias_bottom here. + + * tree-alias-type.h: Remove the GTY marker from alias_bottom. + +2002-07-17 Daniel Berlin + + * tree-alias-ecr.c (ECR_union_pending_sets): Only clear bitmap if + it's not NULL. + +2002-07-16 Jason Merrill + + * c-simplify.c (add_tree): Build an EXPR_STMT immediately. + (convert_to_stmt_chain): Remove. + (simplify_stmt, simplify_for_stmt, simplify_while_stmt, + simplify_do_stmt, simplify_expr_wfl, tail_expression): Adjust. + +2002-07-17 Daniel Berlin + + * tree-alias-ecr.c: New file. Equivalence Class Representation. + + * tree-alias-steen.c: New file. Steengaard Alias Analysis. + + * disjoint-set.c: New file. Disjoint set data structure. + + * tree-alias-type.c: New file. Alias types. + + * c-simplify.c (create_tmp_alias_var): New function, like + create_tmp_var, but doesn't add it to the current binding. + + * tree-simple.h: Prototype for create_tmp_alias_var. + + * tree-optimize.c (build_tree_ssa): Create alias variables, if + requested. + + * flags.h: Add flag_tree_points_to. + + * toplev.c: Ditto. + + * gengtype.c (open_base_files): Add disjoint-set.h, + tree-alias-ecr.h, tree-alias-type.h, tree-flow.h. + + * Makefile.in (C_AND_OBJC_OBJS): Add disjoint-set.o, + tree-alias-ecr.o, tree-alias-type.o, tree-alias-steen.o. + (tree-alias-steen.o): Add dependencies. + (tree-alias-ecr.o): Ditto. + (tree-alias-type.o): Ditto. + (disjoint-set.o): Ditto. + +2002-07-10 Daniel Berlin + Diego Novillo + + * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-ccp.o + * flags.h (flag_tree_ssa_ccp): Declare. + * fold-const.c (eval_subst): Make extern. + * toplev.c (flag_tree_ssa_ccp): Define. + (f_options): Document -ftree-ssa-ccp. + * tree-dump.c (dump_files): Add -fdump-tree-ccp. + * tree-flow.h (tree_perform_ssapre): Move declaration ... + * tree-optimize.h: ... here. + (tree_ssa_ccp): Declare. + * tree-optimize.c (optimize_function_tree): Call tree_ssa_ccp. + * tree-ssa-ccp.c: New file. + * tree.c (next_decl_uid): Remove static declaration. + * tree.h (next_decl_uid): Declare. + (tree_dump_index): Add TDI_ccp. + * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-ccp.o. + * doc/invoke.texi: Document -ftree-ssa-pre and -ftree-ssa-ccp. + +2002-07-09 Daniel Berlin + + s/varrays of refs/ref_list of refs/g + + * tree-flow.h: Add ref_list structure. + Add prototypes for ref_list functions. + (FOR_EACH_REF, FOR_EACH_REF_REV): New macros to iterate through + ref lists. + * tree-cfg.c, tree-ssa.c, tree-ssa-pre.c: Update all uses. + + * tree-dfa.c (create_ref_list): New function. + (delete_ref_list): Ditto. + (empty_ref_list): Ditto. + (add_ref_to_list_end): Ditto. + (add_ref_to_list_begin): Ditto. + (remove_ref_from_list): Ditto. + +2002-07-04 Diego Novillo + + * tree-simple.c (is_simplifiable_builtin): Don't simplify target + builtins. + +2002-07-03 Diego Novillo + + * c-simplify.c (simplify_decl_stmt): Unshare the + initializer nodes before simplification. + +2002-06-29 Aldy Hernandez + Diego Novillo + + * c-simplify.c (simplify_call_expr): Do not bail on all builtins. + (is_simple_call_expr): Same. + (simplify_addr_expr): New function. + (simplify_expr): Call it. + + * tree-simple.c (is_simplifiable_builtin): New. + (is_simple_compound_lval): Do not bail on INDIRECT_REF. + + * tree-simple.h: New prototype for is_simplifiable_builtin. + +2002-06-26 Daniel Berlin + + * tree-ssa.c (tree_build_ssa): Call free_dominance_info, not + free, on idom. + + * tree-ssa-pre.c (compute_domchildren): Update to use new + dominance_info structure, rather than idom array. + (tree_perform_ssapre): Don't forget to free the dominance info. + + s/VARRAY_FREE/VARRAY_CLEAR/g now that VARRAY's are ggc allocated. + +2002-06-24 Diego Novillo + + * tree-ssa.c (build_fud_chains): Use dominance_info instead of int *. + (search_fud_chains): Ditto. + Call get_immediate_dominator. + * tree-ssa-pre.c (a_dom_b): Call dominated_by_p. + (pre_idom): Change type to dominance_info. Update all uses. + (pre_doms): Remove. Update all uses. + +2002-06-20 Jason Merrill + + Simplify DECL_STMT, CONSTRUCTOR and COMPOUND_LITERAL_EXPR. + * tree-simple.c (is_simple_decl_stmt): New fn. + (is_simple_constructor, is_simple_constructor_elt): New fns. + (is_simple_stmt, is_simple_unary_expr): Use them. + (is_simple_modify_expr): Accept an INIT_EXPR. + (is_simple_id): Don't allow a COMPOUND_LITERAL_EXPR. + (is_simple_unary_expr): Here either. + * c-simplify.c (simplify_decl_stmt, simplify_constructor): New fns. + (simplify_compound_literal_expr): New fn. + (simplify_stmt, simplify_expr): Use them. + (get_initialized_tmp_var): Use an INIT_EXPR. + (simplify_modify_expr): Accept an INIT_EXPR. + (simplify_for_stmt): Call simplify_decl_stmt. + (get_name): Don't crash if the decl is anonymous. + (tail_expression): New fn. + * tree-simple.h: Declare new fns. + * c-pretty-print.c (dump_c_node) [INIT_EXPR]: Print like MODIFY_EXPR. + (dump_c_node, op_prio): Handle COMPOUND_LITERAL_EXPR. + * c-simplify.c (simplify_expr_wfl): Only wrap pre and post stuff + that came from our subexpression. + (simplify_stmt): Restore stmts_are_full_exprs_p. + + * c-simplify.c (simplify_expr_wfl): Bracket substatements with + FILE_STMTs rather than wrapping them in EXPR_WITH_FILE_LOCATION. + (simplify_stmt): Update lineno and input_filename from stmts. + (simplify_expr et al): Don't copy lineno between stmts. Don't pass + enclosing stmt down. + (update_line_number): Remove. + + * c-simplify.c (simplify_expr_stmt): Don't check + is_last_stmt_of_scope. + (simplify_stmt_expr): Check it here. Set *expr_p to void_zero_node + instead of NULL_TREE. + (expr_has_effect): No need to deal with NULL exprs now. + (simplify_expr_wfl): Likewise. + +2002-06-18 Diego Novillo + + * c-simplify.c (strip_off_ending): Rename to remove_suffix. + Update callers. + (is_last_stmt_of_scope): New function. + (simplify_expr_stmt): Call it. + (stmt_has_effect): Ditto. + (c_simplify_function_tree): Update comment. + +2002-06-18 Jason Merrill + + * c-simplify.c (maybe_fixup_loop_cond): New fn for C++ conditions. + (simplify_for_stmt, simplify_while_stmt): Use it. + + * c-pretty-print.c (dump_c_node) [COMPONENT_REF]: Print "->" if + appropriate. + +2002-06-19 Jason Merrill + + * c-simplify.c (simplify_stmt_expr): New fn. + (simplify_expr): Call it. + (stmt_expr_level): Remove. + (stmt_has_effect, c_simplify_function_tree): Remove refs. + (expr_has_effect): Deal with null expression. + (simplify_expr_wfl): If the subexpression is simplified away, drop + this one, too. Don't wrap statements. + * tree-simple.c (is_simple_unary_expr): Don't allow a STMT_EXPR. + * tree-inline.c (copy_tree_r): Clear the aux field in the copies. + +2002-06-17 Frank Ch. Eigler + + * c-pretty-print.c (dump_c_node): Print pointer-type + integer constants as raw numbers with a "B" (bytes) suffix. + +2002-06-17 Jason Merrill + + * c-simplify.c (simplify_stmt): Take a tree *. + (various): Adjust. + +2002-06-16 Daniel Berlin + + * c-simplify.c (get_name): New function. + (get_initialized_tmp_var): Use it to try to get a prefix for + create_tmp_var from the value we are initializing to. + (simplify_cond_expr): Add prefix for create_tmp_var. + (create_tmp_var): Add prefix argument. + + * tree-simple.h: Change create_tmp_var prototype to match. + + * tree-ssa-pre.c: Change create_tmp_var call. + +2002-06-15 Diego Novillo + + * Makefile.in (c-decl.o): Add dependency on langhooks.h + (c-simplify.o): Add dependency on flags.h, langhooks.h, toplev.h + and rtl.h. + * c-decl.c: Include langhooks.h. + (c_expand_body): Simplify the function. If it succeeds and + -ftree-ssa is enabled, call optimize_function_tree. + * c-simplify.c: Include flags.h, rtl.h and toplev.h. + (simplify_expr_stmt): New function. + (simplify_stmt): Call it. + * tree-optimize.c: Don't include langhooks.h. + (optimize_function_tree): Don't call lang_hooks.simplify_function_tree. + + * c-decl.c (c_expand_body): Do not simplify nor optimize the + function if -fdisable-simple is given. + * c-simplify.c (simplify_expr): Use is_simple_addr_expr_arg when + simplifying ADDR_EXPR nodes. + * flags.h (flag_disable_simple): Declare. + * toplev.c (flag_disable_simple): Define. + (f_options): Document -fdisable-simple. + (process_options): Warn if -fdisable-simple is used with + optimization enabled. + * tree-simple.c (is_simple_addr_expr_arg): New function. + (is_simple_unary_expr): Call it. + * tree-simple.h (is_simple_addr_expr_arg): Declare. + * doc/invoke.texi: Document -fdisable-simple. + + * c-pretty-print.c (dump_c_node): Handle DECL_STMT nodes inside + FOR_INIT_STMT. + * c-simplify.c (c_simplify_function_tree): Don't do anything if the + program had errors. + (simplify_stmt): Skip DECL_STMTs. + (simplify_for_stmt): Handle DECL_STMT nodes inside FOR_INIT_STMT. + (simplify_save_expr): New function. + (simplify_expr): Call it. + (tree_last_decl): Handle cases where DECL_STMTs are found before + the body of the function. + * tree-simple.c (is_simple_stmt): Handle DECL_STMT nodes inside + FOR_INIT_STMT. + (is_simple_compound_lval): Handle nodes wrapped in NON_LVALUE_EXPR. + +2002-06-14 Frank Ch. Eigler + + * c-pretty-print.c (dump_c_node): Print more type qualifiers, + especially for pointers. + +2002-06-11 Diego Novillo + + * c-simplify.c: Remove folding markers. + (insert_before_first): Remove unused function. + * tree-cfg.c: Remove folding markers. + * tree-dfa.c: Ditto. + * tree-flow.h: Ditto. + * tree-optimize.c: Ditto. + * tree-optimize.h: Ditto. + * tree-simple.c: Ditto. + * tree-ssa.c: Ditto. + +2002-06-11 Jason Merrill + + * c-simplify.c (add_tree): Don't deep-copy expressions. + (simplify_for_stmt): Only deep-copy pre_cond_s the first time. + Don't deep copy expr_chain. + +2002-06-10 Diego Novillo + + * tree-cfg.c (remove_bb_ann): Don't call VARRAY_FREE. + * tree-dfa.c (create_ref): Use sizeof (ref) instead of + refs->element_size. + * tree.h (struct tree_common): Skip field 'aux' from GC type + information. + * tree-optimize.c (optimize_function_tree): Don't call + VARRAY_REF. + * tree-ssa.c (insert_phi_terms): Ditto. + (delete_refs): Ditto. + * c-simplify.c (simplify_array_ref): Ditto. + * simple-break-elim.c: Disable whole file. + * simple-goto-elim.c: Disable whole file. + +2002-06-10 Jason Merrill + + * c-simplify.c (simplify_switch_stmt): Let simplify_expr handle + post-effects. Reorder. + (simplify_if_stmt): Likewise. Don't build redundant comparison. + (simplify_do_stmt, simplify_while_stmt): Likewise. + (simplify_for_stmt): Likewise. Remove POST_P parm. + (simplify_stmt): Adjust. + (insert_before_first): #if 0, no longer used. + + * c-pretty-print.c (dump_c_node): Print FIX_TRUNC_EXPR, FLOAT_EXPR + et al as casts. Add parens as needed. + + * tree-simple.c (is_union_based_ref): New fn. + (is_simple_min_lval): Use it. Rename from is_simple_arraybase. + (is_simple_arrayref): Adjust. Use loop instead of recursion. + (is_simple_compref): Likewise. + (is_simple_compref_lhs): Remove. + * tree-simple.h: Adjust. + * c-simplify.c (simplify_array_ref): Adjust. + (simplify_component_ref): Adjust. + + * c-simplify.c (simplify_expr_common): Tweak ordering. + (get_initialized_tmp_var): Let simplify_expr handle post-effects. + * tree-simple.c (is_simple_stmt): Accept an rhs for a return expr. + + * c-simplify.c (simplify_boolean_expr): Avoid redundant tests. + Give the temp the appropriate type for a boolean value, and + reconvert at the end. + + * c-simplify.c (simplify_self_mod_expr): Don't duplicate side-effects. + + * c-simplify.c (simplify_return_stmt): Accept a SIMPLE rhs. + Just hand off to simplify_expr. + + * c-simplify.c (get_initialized_tmp_var): New fn. + (simplify_expr_common): Use it. Handle post-effects internally if + POST_P is NULL. + (is_simple_tmp_var): Rename from simple_tmp_var_p. + * tree-simple.h: Adjust. + +2002-06-09 Diego Novillo + + * c-simplify.c (simplify_return_stmt): Update folding markers. + (build_addr_expr): Ditto. + * langhooks.h (struct langhooks): Document simplify_function_tree + hook. + +2002-06-09 Jason Merrill + + * c-simplify.c (simplify_expr_common): Handle creating both lvalue + and rvalue temps. Add new parameter to specify which. + (simplify_expr): Now just a wrapper. + (simplify_lvalue_expr): Likewise. + (simplify_expr_either): New wrapper. + (simplify_component_ref): Use it instead of simplify_lvalue_expr. + + * c-pretty-print.c (debug_c_tree): Add a trailing newline. + (debug_c_node): Likewise. + * gdbinit.in (pct): New macro, calls debug_c_tree. + +2002-06-08 Jason Merrill + + * tree-simple.c (is_simple_unary_expr): Only allow the address of + a varname. + (is_simple_id): Allow STRING_CST. + * c-simplify.c (simplify_expr_common): Split out from simplify_expr. + Do simplify ADDR_EXPR. + (simplify_lvalue_expr): Use it and build_addr_expr. Take + simple_test_f. + (simplify_modify_expr): Adjust. + (build_addr_expr): New fn. + (simplify_array_ref): Use simplify_lvalue_expr. + (simplify_component_ref): Likewise. + + * tree-simple.c (is_simple_rhs): Remove condexpr rule. + (is_simple_compref_lhs): Remove &ID.idlist rule. + (is_simple_relop): New fn. + (is_simple_binary_expr, is_simple_condexpr): Use it. + * tree-simple.h: Declare it. + + * c-simplify.c (create_tmp_var): Refuse to create an array temp. + (simple_tmp_var_p): New fn. + (simplify_lvalue_expr): Use it; make sure we don't return a temp. + * tree-simple.h: Declare it. + + * c-pretty-print.c (dump_c_node) [ARRAY_REF]: Wrap array in parens + as needed. + [COMPONENT_REF]: Likewise. + [POINTER_TYPE]: Fix pointer-to-function handling. + [ARRAY_TYPE]: Don't try to print an unknown dimension. + + * tree-simple.c (is_simple_arraybase): New function. + (is_simple_arrayref): Use it to check the array base again. + * tree-simple.h: Add declaration. + * c-simplify.c (simplify_array_ref): Do simplify the base. + * expr.c (expand_expr): First make sure the type has a size. + +2002-06-07 Jason Merrill + + * cppexp.c (num_equality_op): Use a temporary variable to work + around gcc 3.0.4 bug. + +2002-06-05 Diego Novillo + + * Makefile.in (BOOT_CFLAGS): Remove -ftree-ssa. + * c-decl.c (c_expand_body): Call optimize_function_tree if tree SSA + is enabled. + * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define. + * c-simplify.c (simplify_tree): Rename to c_simplify_function_tree. + Update all callers. + Dump function body before and after simplification if + -fdump-tree-simple is used. + (simplify_expr): Document FIXME for simplification of BIT_FIELD_REF + nodes. + * c-tree.h (simplify_tree): Rename to c_simplify_function_tree. + * langhooks-def.h (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define + (LANGHOOKS_INITIALIZER): Add LANG_HOOKS_SIMPLIFY_FUNCTION_TREE. + (lhd_simplify_function_tree): Declare. + * langhooks.c (lhd_simplify_function_tree): New function. + * langhooks.h (lang_hooks): Add simplify_function_tree function + pointer. + * toplev.c (parse_options_and_default_flags): Set flag_tree_ssa to + 1 at optimization levels >= 1. + Revert to default warning when -Wuninitialized is used without -O. + * tree-cfg.c (tree_find_basic_blocks): Rename argument 't' to + 'fnbody'. + * tree-optimize.c: Include langhooks.h. + (optimize_tree): Rename to optimize_function_tree. Update all + users. + Rename argument 't' to 'fndecl'. + Call simplify langhook before building SSA. + (build_tree_ssa): Rename argument 't' to 'fndecl'. + Adjust call to tree_find_basic_blocks to pass body of the function. + * tree-optimize.h (optimize_tree): Rename to + optimize_function_tree. + * tree-simple.c (is_simple_unary_expr): Document FIXME on + BIT_FIELD_REF nodes. + * tree-ssa.c: Add whitespace. + * testsuite/lib/c-torture.exp: Remove -ftree-ssa flag. + +2002-06-03 Daniel Berlin + + * tree-cfg.c (insert_before_*): For insertion into FOR_INIT's, if + we have an expression statement, transform into a compound + expression. + Pick the right place to insert a statement by iterating until we + have a first_exec_stmt (first_non_decl_stmt) that is really the + first executable non decl statement. + (insert_after_*): Ditto. + +2002-06-03 Daniel Berlin + + * tree-ssa-pre.c: Update BB stuff to new basic block structure. + Add some comments throughout (more coming, particularly describing + the algorithm, rather than the implementation). + (free_expr_info): Free refs as well. + (defs_y_dom_x): Handle unary expressions as well. + (insert_euse_in_preorder_dt_order_1): Use block of ref, not block + of statement. + Don't insert exit blocks if we hit them before hitting an + occurrence (it's pointless). + (rename_2): Return set of phi operands we touched, don't forget to + free VARRAY's we allocated. + (rename_1): Correct downsafety computation. Now get exact same + results as Open64. + Correct setting of has_real_use. + (finalize_1): Fix up insertion. + (code_motion): Fix up insertion. + + * tree-dfa.c (dump_varref): Improve dumping of expression + references. + +2002-06-03 Diego Novillo + + * tree-cfg.c (delete_bb): Rename to tree_delete_bb. Update callers. + (tree_find_basic_blocks): Initializer last_basic_block. + (create_bb): Update last_basic_block after creating a new block. + (tree_cleanup_cfg): Delete unreachable blocks by traversing the + linked list, not the array. Update comments. + (delete_bb): Update comments. + (tree_dump_cfg): Also show last_basic_block. + * tree-ssa.c (tree_build_ssa): Use last_basic_block instead of + n_basic_blocks to allocate dominator arrays. + (insert_phi_terms): Ditto. + (search_fud_chains): User FOR_EACH_BB to look for dominator + children. + +2002-05-29 Diego Novillo + + * tree-cfg.c (tree_find_basic_blocks): Set next_bb and prev_bb for + ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR. + (create_bb): Set flag BB_NEW for every newly created block. + Call link_block to add the new block to the linked list. + (tree_split_bb): Traverse basic blocks using FOR_EACH_BB. + (make_goto_stmt_edges): Ditto. + (remove_unreachable_blocks): Add reminder comment to stop + compacting the basic block array every time a block is deleted. + (delete_cfg): Traverse basic blocks using FOR_EACH_BB. + (tree_dump_bb): Ditto. + (tree_dump_cfg): Ditto. + (tree_cfg2dot): Ditto. + * tree-dfa.c (tree_find_varrefs): Ditto. + (create_tree_ann): Ditto. + (get_fcalls): Ditto. + (find_declaration): Ditto. + * tree-ssa.c (tree_build_ssa): Ditto. + +2002-05-28 Diego Novillo + + * Makefile.in: Add -ftree-ssa to BOOT_CFLAGS. + +2002-05-27 Diego Novillo + + * c-decl.c (c_expand_body): Close dump file before simplifying the + function. + * c-pretty-print.c (dump_c_node): Handle COMPLEX_CST, + BIT_FIELD_REF, COMPLEX_EXPR, CONJ_EXPR, REALPART_EXPR, + IMAGPART_EXPR and VA_ARG_EXPR nodes. + Display all type casts, not just pointer casts. + (op_prio): Handle LROTATE_EXPR, RROTATE_EXPR, REALPART_EXPR and + IMAGPART_EXPR. + * c-simplify.c: Include "tree-inline.h" + (dump_file): New local variable. + (dump_flags): New local variable. + (stmt_expr_level): New local variable. + (simplify_tree): Open and close dump file if + -fdump-tree-simple-details is given. + Initialize stmt_expr_level. + (simplify_stmt): Dump statement before and after simplification if + -fdump-tree-simple-detail is given. + Unshare the expression of an EXPR_STMT before simplifying it. + Call simplify_return_stmt to handle RETURN_STMT nodes. + Do not simplify DECL_STMT nodes. + Call stmt_has_effect before re-chaining side effects. + (simplify_for_stmt): Do not return the simplified statement. + Update all callers. + Simplify FOR_BODY after the headers. + Unshare loop header expressions before simplification. + (simplify_while_stmt): Do not return the simplified statement. + Update all callers. + Simplify WHILE_BODY after the headers. + Unshare the loop header expression before simplification. + (simplify_do_stmt): Do not return the simplified statement. Update + all callers. + Unshare the loop header expression before simplification. + (simplify_if_stmt): Do not return the simplified statement. Update + all callers. + Simplify the condition expression before the clauses. + Unshare the condition expression before simplification. + (simplify_switch_stmt): Do not return the simplified statement. + Update all callers. + Simplify the switch expression before the body. + Unshare the switch expression before simplification. + (simplify_decl_stmt): Remove. + (simplify_expr): Remove argument 'needs_lvalue'. + Add argument 'stmt'. + Replace first argument 'expr' with a pointer to the + expression 'expr_p'. + Do not return the simplified expression. + Update all callers and uses. + Handle TRUTH_NOT_EXPR nodes. Simplify SAVE_EXPR nodes into a + SIMPLE id and remove the SAVE_EXPR node. + Do not simplify BIT_FIELD_REF nodes. + Remove code that tried to create new lvalues. + (simplify_array_ref): Replace first argument 'expr' with a pointer + to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers and uses. + (simplify_self_mod_expr): Replace first argument 'expr' with a + pointer to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers and uses. + Call simplify_lvalue_expr to simplify a copy of the LHS into an + lvalue for the new assignment. + Simplify the new binary expression. + (simplify_component_ref): Replace first argument 'expr' with a + pointer to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers and uses. + (simplify_call_expr): Ditto. + (simplify_tree_list): Ditto. + (simplify_cond_expr): Ditto. + Build a replacement IF_STMT and call simplify_if_stmt() to process + it. Set the line number of the new statement from the statement + containing the original expression. + (simplify_modify_expr): Replace first argument 'expr' with a + pointer to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers. + Call simplify_lvalue_expr to simplify the LHS of the assignment. + (simplify_boolean_expr): Replace first argument 'expr' with a + pointer to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers. + Build a new IF_STMT and simplify it all at once by calling + simplify_if_stmt. + (simplify_compound_expr): Replace first argument 'expr' with a + pointer to the expression 'expr_p'. + Do not return the simplified expression. + Add argument 'stmt'. + Update all callers. + (simplify_expr_wfl): Ditto. + (simplify_lvalue_expr): New function. + (add_tree): Create a copy of each expression before adding it to + the list. + (deep_copy_node): Call copy_tree_r to copy expression nodes. + (stmt_has_effect): Return nonzero if the statement may be the last + statement of a statement expression body. + (mostly_copy_tree_r): New function. + * tree-dump.c (dump_options): Add 'details'. + * tree-simple.c: Update documentation about ADDRESSOF expressions. + (is_simple_stmt): Test for SIMPLE values when checking return + statements. + Accept all DECL_STMT nodes. + (is_simple_compstmt): Return nonzero if T is NULL. Do not test + DECL_STMT nodes + (is_simple_expr): Return nonzero if T is NULL. + (is_simple_rhs): Ditto. + (is_simple_modify_expr): Ditto. + (is_simple_modify_expr_lhs): Ditto. + (is_simple_binary_expr): Ditto. + (is_simple_cond_expr): Ditto. + (is_simple_unary_expr): Call STRIP_NOPS before testing T. + Always accept ADDR_EXPR nodes. + Always accept BIT_FIELD_REF nodes. + (is_simple_call_expr): Return nonzero if T is NULL. + (is_simple_const): Ditto. + (is_simple_val): Ditto. + (is_simple_compref): Ditto. + (is_simple_compref_lhs): Ditto. + (is_simple_cast): Ditto. + (is_simple_cast_op): Ditto. + (is_simple_id): Return nonzero if T is NULL. Allow identifiers + wrapped inside NON_LVALUE_EXPR and EXPR_WITH_FILE_LOCATION nodes. + Allow real and imaginary parts of a complex variable. + Allow compound literals. + (is_simple_arrayref): Allow arrays of complex types. + * tree.h (TDF_DETAILS): Define. + * cp/pt.c (tsubst_template_parms): Check that 'parms' is non-NULL + before calling TMPL_PARMS_DEPTH. + * doc/invoke.texi: Document -fdump-tree-simple-details. + +2002-05-10 Daniel Berlin + + * c-pretty-print.c (dump_c_node): Print "" for + types, variables, etc that have no name, rather than printing + nothing. + Handle PMF's properly. + Print out structure initializers in a somewhat sensible way. + Print SAVE_EXPR () around SAVE_EXPRs. + (print_call_name): Handle EXPR_WITH_FILE_LOCATION. + +2002-05-09 Daniel Berlin + + * tree-dfa.c (dump_varref): Tree inlining generates variables with + no name. Don't crash on dumping varref's of them. + + * tree-inline.c (expand_call_inline): Generate a proper STMT_EXPR + (it was missing COMPOUND_STMT). + +2002-05-08 Daniel Berlin + + s/varref_type/treeref_type/g + s/create_varref/create_ref/g + + * tree-flow.h: Add EXPRPHI, EXPRUSE, EXPRKILL, EXPRINJ. + Add structures and macros for each. + Add tree_perform_ssapre prototype. + + * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-pre.o + (tree-ssa-pre.o): Add dependencies for tree-ssa-pre.o + + * cp/Make-lang.in: Add tree-ssa-pre.o + + * flags.h: Add flag_tree_ssa_pre. + + * tree-ssa-pre.c: New file, SSA-PRE. + + * toplev.c: Add flag_tree_ssa_pre. + (lang_independent_options): Add tree-ssa-pre. + + * tree-dump.c (dump_files): Add ssapre dump. + + * tree-optimize.c (optimize_tree): Do SSAPRE if requested. + + * tree.h (dump_index): Add TDI_ssa_pre. + + * tree-dfa.c (create_ref): Add support for creating the EXPR*'s refs. + (dump_varref): Add support for dumping EXPR* refs. + + * tree-ssa.c (search_fud_chains): Add BB to VARDEF_PHI_CHAIN_BB. + +2002-05-07 Diego Novillo + + * c-pretty-print.c (op_prio): Handle ABS_EXPR. + Don't abort when the operand is not recognized. + (op_symbol): Don't abort when the operand is not recognized. + * c-simplify.c (simplify_expr): Remove 'const' qualifier from first + argument. + Do not copy incoming expression. + Exclude handling of MODIFY_EXPR, INIT_EXPR, SAVE_EXPR and binary + expression nodes. + (simplify_array_ref): Remove 'const' qualifier from first argument. + Do not copy the incoming expression. + (simplify_self_mod_expr): Ditto. + Do not simplify the first operand twice. + (simplify_component_ref): Remove 'const' qualifier from first + argument. Do not copy the incoming expression. + (simplify_call_expr): Ditto. + (simplify_tree_list): Ditto. + (simplify_cond_expr): Ditto. + (simplify_modify_expr): Ditto. + (simplify_boolean_expr): Ditto. + (simplify_compound_expr): Ditto. + (simplify_save_expr): Ditto. + (simplify_expr_wfl): Ditto. + (tree_build_scope): Re-write. Do nothing if block already contains + a scope. Use chainon to chain the body with the scope closing + node. + (deep_copy_node): Do not check for NULL nodes. Do not deep copy + declarations, types and constants. + +2002-05-06 Daniel Berlin + + * c-simplify.c (deep_copy_node): Don't copy DECL_STMT_DECL's. + +2002-05-06 Daniel Berlin + + * tree-simple.c (is_simple_compstmt): Don't post-initialize + statics or aggregate initializers. + + * c-simplify.c (simplify_decl_stmt): Ditto. + +2002-05-06 Sebastian Pop + + * Makefile.in (simple-break-elim.o, simple-goto-elim.o, tree-dchain.o): + Added. + * c-decl.c: Include tree-dchain.h + (c_expand_body): Add entry point to the goto, break elimination + after the simplification pass. + * simple-break-elim.c: New file. + * simple-goto-elim.c: New file. + * tree-dchain.h: New file. + * tree-dchain.c: New file. + +2002-05-02 Diego Novillo + + * c-simplify.c (simplify_expr): Constify first argument. + Always work on a copy of the input expression. + Do not simplify COMPOUND_LITERAL_EXPR nor CONSTRUCTOR nodes. + (simplify_array_ref): Constify first argument. Always work on a + copy of the input expression. + (simplify_self_mod_expr): Ditto. + (simplify_component_ref): Ditto. + (simplify_call_expr): Ditto. + (simplify_tree_list): Ditto. + (simplify_cond_expr): Ditto. + When building the THEN_CLAUSE and ELSE_CLAUSE for the new IF_STMT, + create a scope for them and simplify the scope, not the expression. + (simplify_modify_expr): Constify first argument. Always work on a + copy of the input expression. + (simplify_boolean_expr): Ditto. + (simplify_compound_expr): Ditto. + (simplify_save_expr): Ditto. + (simplify_expr_wfl): Ditto. + * tree-cfg.c (tree_find_basic_blocks): Update comments for + -fdump-tree-dot. + (tree_dump_cfg): Ditto. + * tree-dump.c (dump_files): Rename -fdump-tree-graphviz to + -fdump-tree-dot. + * tree-simple.c (is_simple_unary_expr): Do not handle &CONST + expressions. + Handle COMPOUND_LITERAL_EXPR and CONSTRUCTOR nodes. + (is_simple_const): Strip NOPS and handle &CONST expressions. + * tree.h (enum tree_dump_index): Remove references to GraphViz. + * doc/invoke.texi: Update documentation for -fdump-tree-dot. + +2002-05-02 Sebastian Pop + + * c-pretty-print.c (dump_c_node): Don't print declarations + from the SCOPE_STMT_BLOCK, use the DECL_STMT instead. + +2002-04-30 Diego Novillo + + * c-pretty-print.c (NIY): Display an error string instead of aborting. + (op_prio): Add support for COMPOUND_EXPR, TRUTH_XOR_EXPR, MIN_EXPR, + MAX_EXPR and NON_LVALUE_EXPR. + For EXPR_WITH_FILE_LOCATION nodes, return the priority of + the internal node. + (op_symbol): Add support for TRUTH_XOR_EXPR. + * c-simplify.c (simplify_stmt): Only remove null statements that + have been nullified by simplification. + Call debug_tree() dump unhandled tree nodes. + (simplify_for_stmt): Always deep-copy PRE_COND_S before adding it + to PRE_P. + (simplify_expr): When simplifying a MODIFY_EXPR node into an + rvalue, return operand 0. + Handle VA_ARG_EXPR, BIT_FIELD_REF and NON_LVALUE_EXPR nodes. + Treat TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR nodes as + regular binary expressions. + Call debug_tree() to dump an unhandled expression. + (simplify_array_ref): Do not simplify the base of an array. + (simplify_call_expr): Do not simplify calls to builtins. + (simplify_cond_expr): Handle conditional expressions of type void. + (simplify_boolean_expr): Return 'T != 0' instead of 'T'. + (simplify_save_expr): Do not wrap statement trees inside SAVE_EXPR + nodes. + (tree_last_decl): Ignore FILE_STMT nodes preceding a SCOPE_STMT. + * tree-simple.c: Update grammar to accept any valid C array as the + array base. + (is_simple_compstmt): Accept DECL_INITIAL expressions for read-only + variables. + (is_simple_expr): Do not abort if the incoming tree is NULL. + (is_simple_modify_expr): Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION + and NON_LVALUE_EXPR wrappers. + (is_simple_binary_expr): Ditto. + (is_simple_condexpr): Ditto. + Accept TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR. + (is_simple_unary_expr): Do not abort it the incoming tree is NULL. + Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR + wrappers. + Handle BIT_FIELD_REF and VA_ARG_EXPR nodes. + (is_simple_call_expr): Always return 1 for builtin calls. + (is_simple_arrayref): Do not check the array base. + +2002-04-30 Daniel Berlin + + * c-simplify.c (simplify_call_expr): Don't try to simplify + call_expr arglist if it's not there. + +2002-04-27 Diego Novillo + + * c-decl.c (c_expand_body): Call simplify_tree to simplify a + FUNCTION_DECL node. + * c-simplify.c (simplify_tree): New function. + (simplify_stmt): Remove variable 'new_vars'. Update all called + functions. + Remove argument 'scope'. Update all callers. + Do not keep track of new scope statements as they are entered. + Do not call declare_tmp_vars(). + (simplify_for_stmt): Remove argument new_vars_p. Update all callers. + (simplify_while_stmt): Ditto. + (simplify_do_stmt): Ditto. + (simplify_if_stmt): Ditto. + (simplify_switch_stmt): Ditto. + (simplify_decl_stmt): Reformat comments. + (simplify_expr): Remove argument new_vars_p. Update all callers. + Call simplify_save_expr() to simplify SAVE_EXPR nodes. + Call simplify_expr_wfl() to simplify EXPR_WITH_FILE_LOCATION nodes. + Do not call is_unop() and is_binop() when checking for unary and + binary operators. + Do not return early after simplify statement-expressions. + Do not call add_modify_stmt() to create assignment expressions. + (simplify_array_ref): Remove argument new_vars_p. Update all callers. + (simplify_self_mod_expr): Ditto. + (simplify_component_ref): Ditto. + (simplify_call_expr): Ditto. + (simplify_tree_list): Ditto. + (simplify_cond_expr): Ditto. + (simplify_modify_expr): Ditto. + (simplify_boolean_expr): Ditto. + (simplify_compound_expr): Ditto. + (simplify_save_expr): New function. + (simplify_expr_wfl): New function. + (tree_build_scope): Reformat. + (add_tree): Call stmt_has_effect() and expr_has_effect() to decide + whether or not to add a new tree to the list. + (add_modify_stmt): Remove. + (create_tmp_var): Remove 'new_vars_p' argument. + Call pushdecl() to insert the newly created variable in the current + binding scope. + (declare_tmp_vars): Do not create a BLOCK_VARS for the scope. + (is_binop): Remove. + (is_unop): Remove. + (expr_has_effect): New function. + * c-tree.h (simplify_tree): Remove second argument. + * stmt.c (warn_if_unused_value): Check operand 0 of SAVE_EXPR + nodes. + * tree-dfa.c (find_refs_in_expr): Call find_refs_in_expr() to look + inside an EXPR_WITH_FILE_LOCATION node. + * tree-simple.c (is_simple_stmt): Add a case for SCOPE_STMT nodes. + (is_simple_compstmt): Assume that T is the first tree in the + compound statement's body. + Stop when a scope ending SCOPE_STMT node is found. + (is_simple_binary_expr): Don't call is_simple_binop(). + (is_simple_condexpr): Don't call is_simple_relop(). + (is_simple_binop): Remove. + (is_simple_relop): Remove. + (is_simple_unary_expr): Accept any operator with tree code class + '1' followed by a simple value. + Accept simple unary expressions wrapped inside SAVE_EXPR, + EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes. + (is_simple_id): Accept simple identifiers wrapped inside SAVE_EXPR, + EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes. + * tree-simple.h (create_tmp_var): Remove second argument. + (is_simple_binop): Remove. + (is_simple_relop): Remove. + +2002-04-22 Diego Novillo + + * c-simplify.c (stmt_has_effect): New function. + (simplify_stmt): Fix example code in comment. + Use EXPR_STMT_EXPR to access the expression in an expression + statement. + Call debug_c_node to display unhandled statements. + Call stmt_has_effect to determine whether the statement has been + nullified by the simplification process. + (simplify_for_stmt): Do not simplify the initialization expression + if it's NULL. + Do not convert post_cond_s into a statement chain. + Do not simplify the expression if it's NULL. + (simplify_switch_stmt): initialize post_cond_s to NULL before + simplifying the expression. + (simplify_expr): Rename argument IS_LHS to NEEDS_LVALUE. Update + all uses. + When simplifying assignments, return the LHS of the assignment if + the caller wants to use the assignment as an rvalue. + Do not simplify ADDR_EXPR nodes. + Handle NOP_EXPR, CONVERT_EXPR, FIX_TRUNC_EXPR, FIX_CEIL_EXPR, + FIX_ROUND_EXPR, INDIRECT_REF, NEGATE_EXPR, INTEGER_CST, STRING_CST, + COMPLEX_CST. + Abort if the expression has not been simplified and cannot be used + as an rvalue to assign it to a temporary. + When creating a new temporary to hold an lvalue, if the expression + is an indirect reference, use the address of the referenced object. + When creating an indirect reference, use the pointed-to type as the + type of the reference. + (simplify_self_mod_expr): If the LHS operand needs to be + simplified, simplify twice. Once to produce an lvalue and another + to produce a simple value. + (simplify_modify_expr): Break assignment chains (a = b = c = ...) + into individual assignments. + (simplify_compound_expr): + (create_tmp_var): If the type is an array, use TYPE_POINTER_TO as + the pointer type. + (update_line_number): Fix typo in comment. + (is_unop): Ditto. + (convert_to_stmt_chain): Only add statements that comply with + stmt_has_effect(). + * tree-dfa.c (find_declaration): Fix typo in comment. + (debug_varref): Ditto. + * tree-flow.h: Ditto. + * tree-simple.c (is_simple_stmt): New function. + (is_simple_compstmt): New function. + (is_simple_expr): Fix typo in comment. + (is_simple_rhs): Allow conditional expressions. + (is_simple_modify_expr): Fix typo in comment. + (is_simple_modify_expr_lhs): Ditto. + (is_simple_binary_expr): Ditto. + (is_simple_condexpr): Ditto. + (is_simple_relop): Ditto. + (is_simple_unary_expr): Ditto. + Allow taking the address of a constant (for strings). + (is_simple_call_expr): Fix typo in comment. + Call is_simple_id to determine if the first operand is a SIMPLE + function identifier. + (is_simple_arglist): Fix typo in comment. + (is_simple_varname): Ditto. + (is_simple_const): Don't accept casts of SIMPLE constants. + (is_simple_id): Don't accept casts of SIMPLE identifiers. + (is_simple_val): Fix typo in comment. + (is_simple_arrayref): Ditto. + (is_simple_compref): Ditto. + (is_simple_compref_lhs): Ditto. + (is_simple_cast_op): Ditto. + (is_simple_exprseq): Allow NULL expression sequences. + * tree-simple.h (is_simple_stmt): Declare + (is_simple_compstmt): Declare. + * tree-ssa.c (follow_chain): Fix typo in comment. + +2002-04-22 Diego Novillo + + * c-pretty-print.c (dump_c_node): Don't print function + bodies of FUNCTION_DECL nodes. + +2002-04-19 Andreas Jaeger + + * Makefile.in (c-call-graph.o): New. + +2002-04-18 Sebastian Pop + + * c-pretty-print.c (PRINT_FUNCTION_NAME): Define. + (dump_c_node): Call pretty_print_string to print string. + Call print_call_name to print function names. + (pretty_print_string): New function. + (print_call_name): New function. + +2002-04-17 Diego Novillo + + * c-simplify.c (simplify_do_stmt): Call is_simple_condexpr to test + if the conditional is in SIMPLE form. + (simplify_if_stmt): Ditto. + +2002-04-17 Diego Novillo + + * c-pretty-print.c (dump_c_node): Handle escape sequences in strings. + (op_symbol): Handle TRUTH_NOT_EXPR. + * c-simplify.c: Rename 'after' with 'post' and 'before' with 'pre' + everywhere. + Re-group some functions and add comments. + (simplify_stmt): Update calls to simplify_for_stmt, + simplify_while_stmt, simplify_do_stmt and simplify_switch_stmt. + Call simplify_if_stmt. + Do not test if expression is in SIMPLE form before calling + simplify_expr. + Call convert_to_stmt_chain to emit statement trees for side effects + found while simplifying. + (simplify_for_stmt): Re-implement. Do not change structure of the + statement. Simplify each header expression and emit side effects + at sequence points. + (simplify_while_stmt): Ditto. + (simplify_do_stmt): Ditto. + (simplify_switch_stmt): Ditto. + (new_simplified_if): Rename to simplify_if_stmt. + Call simplify_expr to simplify the conditional. + (simplify_if_stmt): New name for new_simplified_if. + (simplify_expr): Do not default simple_test_f to is_simple_expr. + If simple_test_f is not set, abort. + Handle COMPOUND_EXPR, MODIFY_EXPR, TRUTH_ANDIF_EXPR, + TRUTH_ORIF_EXPR, SAVE_EXPR and EXPR_WITH_FILE_LOCATION. + (simplify_arglist): Rename to simplify_tree_list. + (simplify_tree_list): New name for simplify_arglist. + (simplify_boolean_expr): New function. + (simplify_compound_expr): New function. + (tree_build_scope): Use SCOPE_BEGIN_P instead of TREE_LANG_FLAG_0 + to access scope operands. Use COMPOUND_BODY instead of + TREE_OPERAND to access the body of the compound statement. + (add_tree): Use a TREE_LIST container instead of directly chaining the + trees. + (add_assignment_tree): Rename to add_modify_stmt. Update all + callers. + (add_modify_stmt): New name for add_assignment_tree. + (insert_before_continue_end): Do nothing it the tree to insert is + NULL. + (copy_stmt_chain): Rename to deep_copy_list. Update all callers. + (deep_copy_list): New name for copy_stmt_chain. + (copy_stmt): Rename to deep_copy_node. Update all callers. + (deep_copy_node): New name for copy_stmt. Handle TREE_LIST + trees. + (insert_before_first): New function. + (is_binop): Add COMPOUND_EXPR. + (convert_to_stmt_chain): New function. + * tree-cfg.c (make_for_stmt_blocks): Fix comment. + * tree-simple.c (is_simple_condexpr): New function. + (is_simple_const): Allow casts of SIMPLE constants. + (is_simple_id): Allow casts of SIMPLE identifiers. + (is_simple_cast): Call is_simple_cast_op. + (is_simple_cast_op): New function. + (is_simple_exprseq): New function. + * tree-simple.h (deep_copy_list): Declare. + (deep_copy_node): Declare. + (is_simple_cast_op): Declare. + (is_simple_exprseq): Declare. + +2002-04-03 Diego Novillo + + * c-simplify.c (simplify_expr): Add arguments simple_tree_f and + is_lhs. Update all callers. + Call simplify_call_expr, simplify_cond_expr, simplify_arglist and + simplify_modify_expr. + Call is_unop and is_binop to check for unary and binary operators. + (simplify_binary_expr): Remove. + (simplify_call_expr): New function. + (simplify_arglist): New function. + (simplify_cond_expr): New function. + (simplify_modify_expr): New function. + (keep_stmt_p): Remove. + (is_binop): New function. + (is_unop): New function. + (simplify_stmt): Don't call keep_stmt_p. + (simplify_decl_stmt): Call add_assignment_tree. + * tree-simple.c: Include c-tree.h + Add expression-statements to the SIMPLE grammar. + (is_simple_modify_expr_lhs): New function. + (is_simple_modify_expr): Call it. + (is_simple_relop): Update comment. + (is_simple_unary_expr): Allow expression-statements. + (is_simple_arglist): New function. + (is_simple_call_expr): Call it. + (is_simple_id): Accept expressions taking the address of a + function. + * tree-simple.h (is_simple_modify_expr_lhs): Declare. + (is_simple_arglist): Declare. + +2002-03-21 Diego Novillo + + * Makefile.in (c-simplify.o): Add dependency on varray.h. + * c-simplify.c: Include varray.h. + Remove comments with SIMPLE grammar. + (simplify_array_ref): New. + (simplify_self_mod_expr): New. + (simplify_component_ref): New. + (add_assignment_tree): New. + (simplify_expr): Call simplify_array_ref to simplify array + references. + Call simplify_self_mod_expr to simplify ++, --, += and -= + expressions. + Call simplify_component_ref to simplify references to structures. + (simplify_binary_expr): Do not check whether the expression is + already in SIMPLE form. + * tree-simple.c: Document changes from original SIMPLE grammar. + (is_simple_unary_expr): Add check for *ID. + (is_simple_call_expr): Update comments. + (is_simple_const): Ditto. + (is_simple_id): Do not accept *ID expressions. + (is_simple_val): Update comments. + (is_simple_arrayref): Accept any variable name as the base address. + (is_simple_compref_lhs): New. + (is_simple_compref): Call it. + * tree-simple.h (is_simple_compref_lhs): Declare. + +2002-03-18 Diego Novillo + + * Makefile.in (C_AND_OBJC_OBJS): Add tree-simple.o + (tree-simple.o): New rule. + * c-simplify.c (simplified_p): Remove. + (simplified_rec_p): Remove. + (simplified_condition_p): Remove. + (simplify_for_stmt): Call is_simple_expr instead of + simplified_condition_p. + (simplify_while_stmt): Ditto. + (simplify_do_stmt): Call is_simple_expr instead of simplified_p. + (new_simplified_if): Call is_simple_expr instead of + simplified_rec_p. + (simplify_decl_stmt): Update comment. + (simplify_expr): Return the original expression if it's already + in SIMPLE form. + Do not special case most binary and unary expressions. + When simplifying array references, create temporary variables to + hold the base address for the array. + Simplify COMPONENT_REF expressions separately. + Call simplify_binary_expr to handle most binary expressions. + (simplify_binary_expr): New function. + (keep_stmt_p): Call is_simple_unary_expr to determine whether the + statement should be kept or not. + * tree-simple.c: New file. + * tree-simple.h (is_simple_expr): Declare. + (is_simple_rhs): Declare. + (is_simple_modify_expr): Declare. + (is_simple_binary_expr): Declare. + (is_simple_binop): Declare. + (is_simple_relop): Declare. + (is_simple_unary_expr): Declare. + (is_simple_call_expr): Declare. + (is_simple_const): Declare. + (is_simple_id): Declare. + (is_simple_varname): Declare. + (is_simple_val): Declare. + (is_simple_arrayref): Declare. + (is_simple_compref): Declare. + (is_simple_cast): Declare. + * cp/Make-lang.in (CXX_C_OBJS): Add tree-simple.o + +2002-03-18 Diego Novillo + + * tree-simple.h: New file. + * Makefile.in (c-simplify.o): Add dependency on tree-simple.h + * c-simplify.c: Reformat some comments. + (tree_last_decl): Declare. + +2002-03-18 Sebastian Pop + + * c-simplify.c (insert_stmt_chain): Delete. + (simplified_condition_p, insert_after_case_labels): New. + (simplify_stmt, simplify_for_stmt, simplify_while_stmt, + simplify_do_stmt, new_simplified_if, simplify_switch_stmt): + Returns a single node, generate a chain of statements to be executed + before the if, and a list of new variables. + (new_simplified_if): Simplify clauses. + (simplify_expr): Remove unused parameter scope. + +2002-03-14 Sebastian Pop + + * c-simplify.c (simplify_switch_stmt, simplify_expr): Add scope + parameter. + (simplify_while_stmt, simplify_do_stmt, simplify_for_stmt): Avoid + negating loop condition during simplification. + (new_simplified_if): Don't simplify the IF_BODY. + (copy_stmt_chain): Use copy_stmt. + (copy_stmt): New function. + +2002-02-28 Sebastian Pop + + * tree-dfa.c (find_refs_in_stmt): Changed if/else statements in + a switch. + +2002-02-28 Sebastian Pop + + * c-simplify.c (simplify_if_stmt): Deleted. + (new_simplified_if): New function. + (make_type_writable): New function. + (insert_before_continue_end): New function. + (insert_before_continue): New function. + (copy_stmt_chain): New function. + (insert_stmt_chain): New function. + (update_line_number): New function. + (simplified_p): New function. + (simplified_rec_p) New function. + (simplify_stmt): Modify the way to call simplification + of COMPOUND_STMT, FOR_STMT, WHILE_STMT, DO_STMT, IF_STMT, + and SCOPE_STMT in order to avoid to execute the code after + the switch. Add FILE_STMT, LABEL_STMT, GOTO_STMT, ASM_STMT cases. + Simplified a little the code after the switch. + (simplify_for_stmt): Change functions parameters. + Add code to simplify the FOR_INIT_STMT, FOR_COND, FOR_EXPR. + (simplify_while_stmt): Change functions parameters. + Add code to simplify the WHILE_COND. + (simplify_do_stmt): Change functions parameters. + Add code to simplify the DO_COND. + (simplify_switch_stmt): Change functions parameters. + (simplify_expr): Remove scope parameter. + Avoid to introduce a new temporary variable for an expression + that is already simplified. + ([ARRAY|COMPONENT]_REF, COND_EXPR): Handle them apart. + (TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR): Avoid to evaluate the second + operand if the value can be deduced from the first one. + (keep_stmt_p): Add some other cases in which we don't need to keep + a statement after its simplification. + +2002-02-28 Sebastian Pop + + * Makefile.in: Add c-call-graph.o dependence. + * c-call-graph.c: New file. + * c-decl.c (c_expand_body): Add an entry point for call-graph. + * tree-dump.c (dump_files): Add the flag dump-call-graph. + * tree.h (tree_dump_index): Add TDI_xml. + +2002-02-28 Sebastian Pop + + * c-pretty-print.c (dump_c_tree): Declare it extern. + (dump_c_node): Declare it extern. + (dump_c_scope_vars): Deleted, some code moved in print_declaration (). + (print_declaration): New function. + (print_function_decl): New function. + (print_struct_decl): New function. + (INDENT_PRINT_C_NODE): Deleted. + (INDENT): New macro. + (NIY): Define the macro body in a block. + (dump_c_node): Add dumping for TREE_PURPOSE operand in TREE_LIST. + [VOID|INTEGER|REAL|COMPLEX|VECTOR|ENUMERAL|BOOLEAN|CHAR]_TYPE nodes: + insert some code from print-tree.c:print_node_brief () in order to + stabilise the type printing. + [RECORD|UNION]_TYPE nodes: Don't print their contents by default, + move the existing code in print_struct_decl (). + [POSTDECREMENT|POSTINCREMENT]_EXPR: Print the operand in post postion. + [MIN|MAX|ABS]_EXPR: New code for printing these nodes. + FOR_STMT: Don't print the FOR_BODY if it is not present. + RETURN_STMT: Don't print the return expression for a void function. + ASM_STMT: New code for printing this node. + SCOPE_STMT: Use print_declaration instead of dump_c_scope_vars. + COMPOUND_LITERAL_EXPR: Add the node as not implemented yet. + (op_prio): Fix switch indent. + Add node EXPR_WITH_FILE_LOCATION with priority 16. + (op_symbol): Fix switch indent. + +2002-01-25 Diego Novillo + + * Makefile.in (c-pretty-print.o): Add dependency on errors.h. + * c-decl.c (c_expand_body): React to -ftree-dump-simple. + * c-pretty-print.c: Fix typo in header comment. + (NYI): Flush output buffer, dump the tree and abort. + (dump_c_node): Add unparsing code for ERROR_MARK, IDENTIFIER_NODE, + ARRAY_TYPE, UNION_TYPE, STRING_CST, CEIL_DIV_EXPR, FLOOR_DIV_EXPR, + ROUND_DIV_EXPR, TRUNC_MOD_EXPR, FLOOR_MOD_EXPR, ROUND_MOD_EXPR, + RDIV_EXPR, EXACT_DIV_EXPR, LROTATE_EXPR, RROTATE_EXPR, + BIT_ANDTC_EXPR, BIT_NOT_EXPR, UNORDERED_EXPR, SAVE_EXPR and + EXPR_WITH_FILE_LOCATION. + Unify unparsing code for common binary and unary expressions. + Handle indirect references like any other unary expression. + (dump_c_scope_vars): Remove unused variable 'context'. + Call dump_c_node to print the type. + (dump_c_indirect_ref): Remove. + (op_prio): New function. + (op_symbol): New function. + * c-simplify.c (simplify_stmt): Do not simplify a return + expression, only its second operand. + Fix capitalization in error message. + (simplify_expr): Add documentation. + Fix capitalization in error message. + * tree-dump.c (dump_files): Add entry for -fdump-tree-simple. + (dump_options): Add entry for -unparse. + * tree.h (TDI_simple): Define. + (TDF_UNPARSE): Define. + * doc/invoke.texi: Document -fdump-tree-simple. + +2002-01-23 Sebastian Pop + + * c-pretty-print.c: Clean C++ comments. + (debug_output_buffer): Remove declaration and definition. + * diagnostic.h (debug_output_buffer): Add declaration. + * diagnostic.c (debug_output_buffer): Add definition. + +2002-01-21 Diego Novillo + + * tree-dfa.c (find_refs_in_stmt): Fix capitalization in error + message. + (find_refs_in_expr): Ditto. + +2002-01-20 Diego Novillo + Sebastian Pop + + * Makefile.in: Add c-simplify.o. + * cp/Make-lang.in: Ditto. + * c-decl.c (c_expand_body): Call simplify_stmt() before + calling optimize_tree(). + * c-simplify.c: New file. + * c-tree.h (simplify_stmt): Declare. + (print_c_tree) + * tree-dfa.c (find_refs_in_stmt): Fix error message for unhandled + statement codes. + +2002-01-20 Sebastian Pop + + * Makefile.in: Add c-pretty-print.o. + * cp/Make-lang.in: Ditto. + * c-pretty-print.c: New file. + * c-tree.h (print_c_tree): Declare. + (print_c_node): Declare. + (debug_c_tree): Declare. + (debug_c_node): Declare. + +2001-12-29 Diego Novillo + + * c-lang.c (c_post_options): Move code to enable tree-ssa + if -Wuninitialized is used ... + * c-common.c (c_common_post_options): ... here. + +2001-12-29 Diego Novillo + + * Makefile.in (tree-optimize.o): Don't depend on c-common.h + * tree-cfg.c: Don't include c-tree.h. Explain why we need to + include c-common.h. + * tree-dfa.c: Explain why we need to include c-common.h. + * tree-ssa.c: Ditto. + * tree-optimize.c: Don't include c-common.h + +2001-12-21 Nathan Sidwell + + Revert my patch of 2001-07-23 for the moment. + +2001-10-15 Diego Novillo + + * tree-dfa.c (create_varref): If the new reference is inside a + statement, add it to the list of references for that statement. + +2001-10-14 Diego Novillo + + * Merge from mainline: + + Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka + + * basic-block.h (cached_make_edge): New. + (make_edge): Remove first parameter. + * flow.c (cached_make_edge): Rename from make_edge; return + newly created edge; use obstack allocation. + (make_edge): New. + (flow_call_edges_add): Updaet make_edge call. + (add_noreturn_fake_exit_edges): Likewise. + (connect_infinite_loops_to_exit): Liekwise. + (make_label_edge, make_edges, find_sub_basic_blocks): Use + cached_make_edge. + * profile.c (branch_prob): Update make_edge call. + * ssa-dce.c (ssa_eliminate_dead_code): Likewise. + +2001-10-14 Diego Novillo + + * Makefile.in (tree-ssa.o): Remove dependency on flags.h. + (tree-optimize.o): Add dependency on flags.h. + * bb-reorder.c (fixup_reorder_chain): Update call to make_edge. + * c-lang.c (c_post_options): Set flag_tree_ssa if -Wuninitialized + is given. + * ifcvt.c (find_if_case_1): Update call to make_edge. + * toplev.c (toplev_main): Do not warn about -Wuninitialized without + -O if -ftree-ssa is used. + * tree-cfg.c (dot_dump_file): Remove. + (dot_dump_flags): Remove. + (cfg_dump_file): Rename to dump_file. + (cfg_dump_flags): Rename to dump_flags. + (remove_bb_ann): New function. + (tree_find_basic_blocks): Do not open dump files at the beginning + of the function. + Do not call delete_cfg. + Create annotations for ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR. + (make_for_stmt_blocks): Update FOR_INIT_STMT_BB and FOR_COND_BB + when creating the header blocks. + Create the blocks for the loop body before the expression block. + (make_while_stmt_blocks): Update END_WHILE_BB when creating the + header blocks. + Create the blocks for the loop body before the end-while block. + (make_do_stmt_blocks): Update DO_COND_BB when creating header + blocks. + Create the blocks for the loop body before the block for DO_COND. + (create_bb): When creating loop header blocks, allocate space for + the header_blocks union. + Call create_bb_ann to create a new annotation. + (remove_bb_ann): New function. + (tree_split_bb): New function. + (make_edges): Remove first argument from call to make_edge, + make_ctrl_stmt_edges, make_exit_edges, make_for_stmt_edges, + make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges, + make_goto_stmt_edges, make_break_stmt_edges and + make_continue_stmt_edges. + When creating edges for the default label, remove the fallthru edge + that was created for the associated SWITCH_STMT entry block. + Do not call delete_unreachable_blocks. + Call tree_cleanup_cfg. + (make_ctrl_stmt_edges): Remove first argument. + (make_exit_edges): Remove first argument. + If the last element of the block is an EXPR_STMT, assume that it is + the call to a non-returning function and make an edge to the exit + block. + Do not call make_return_stmt_edges. Call make_edge directly. + (make_for_stmt_edges): Remove first argument. + Simplify the graph for infinite and zero-iteration loops. + (make_while_stmt_edges): Remove first argument. + Simplify the graph for infinite and zero-iteration loops. + (make_do_stmt_edges): Remove first argument. + Simplify the graph for infinite and one-iteration loops. + (make_if_stmt_edges): Remove first argument. + Simplify the graph for always-true and always-false conditionals. + (make_goto_stmt_edges): Remove first argument. + (make_break_stmt_edges): Remove first argument. + (make_continue_stmt_edges): Remove first argument. + (make_return_stmt_edges): Remove. + (tree_cleanup_cfg): New function. + (delete_unreachable_blocks): Do not react to -Wunreachable-code. + Write to dump file blocks that have been removed. + Call remove_edge. + (is_ctrl_altering_stmt): If the statement contains a call to a + non-returning function, return 1. + (delete_cfg): Call remove_bb_ann. Also remove annotations for + ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR. + (latch_block): Use WHILE_COND_BB instead of END_WHILE_BB. + (insert_stmt_tree_before): Use cfg_dump_file instead of dump_file. + (insert_before_ctrl_stmt): Ditto. + (insert_before_normal_stmt): Ditto. + (insert_stmt_tree_after): Ditto. + (insert_after_ctrl_stmt): Ditto. + (insert_after_normal_stmt): Ditto. + (replace_expr_in_tree): Ditto. + (insert_bb_before): Ditto. + * tree-dfa.c (tree_find_varrefs): Call find_refs_in_expr when the + tree is not a statement. + (find_refs_in_stmt): Update comments. + Do not deal with FOR_STMT and DO_STMT trees separately. + When processing VAR_DECLs, call find_refs_in_expr with the + declaration, not its initial value. + (find_refs_in_expr): When processing COMPONENT_REFs and ARRAY_REFs, + recurse using the same reference type that was given by the + original caller. + (create_varref): Insert new PHI terms at the beginning of the + BB_REFS array, not the end. + * tree-flow.h (struct for_header_blocks): Declare. + (union header_blocks): Declare. + (struct bb_ann_def): Add new field 'loop_hdr'. + (BB_ANN): Re-define so that it can be used as an lvalue. + (BB_PARENT): Ditto. + (BB_REFS): Ditto. + (BB_PREV_CHAIN): Ditto. + (BB_BINDING_SCOPE): Ditto. + (BB_LOOP_HDR): Define. + (FOR_INIT_STMT_BB): Redefine using BB_LOOP_HDR. + (FOR_COND_BB): Ditto. + (FOR_EXPR_BB): Ditto. + (DO_COND_BB): Ditto. + (END_WHILE_BB): New name for WHILE_COND_BB. + (tree_warn_uninitialized): Declare. + (tree_cleanup_cfg): Declare. + (tree_split_bb): Declare. + * tree-optimize.c: Include flags.h. + (init_tree_flow): New function. + (optimize_tree): Call build_tree_ssa instead of building SSA + in-place. + (build_tree_ssa): New function. + * tree-optimize.h (build_tree_ssa): Declare. + * tree-ssa.c: Don't include toplev.h + (tree_warn_uninitialized): Define. + (tree_compute_rdefs): Do not call is_upward_exposed. Instead + traverse all the uses of each variable and warn if the use is + reached by the ghost definition. + +2001-10-10 Graham Stott + + * tree-cfg.c (create_bb): Add new binding_scope parameter which allows + the binding scope either to be explicitly specified if non-zero. + (make_blocks): Update call to create_bb. + (make_for_stmt_blocks): Ditto. + (make_while_stmt_blocks): Ditto. + (make_do_stmt_blocks): Ditto. + (make_if_stmt_blocks): Ditto. + (make_switch_stmt_blocks): Ditto. + (create_maximal_bb): Ditto. + (make_edges): If a statement expression is in the last basic + block create an edge to EXIT_BLOCK_PTR and not the next block. + (insert_before_normal_stmt): Pass the appropriate binding scope to + create_bb. + +2001-10-01 Graham Stott + Diego Novillo + + * tree-optimize.c (optimize_tree): Early return if the program has + errors. + +2001-09-30 Diego Novillo + + * tree-optimize.c (optimize_tree): Compute reaching definitions + after building SSA. + +2001-09-30 Diego Novillo + + * tree-cfg.c (insert_after_ctrl_stmt): Remove unused argument. + (make_blocks): Pop top element from scope binding stack when an end + of scope statement is found. + (create_bb): Remove code for popping top element from scope binding + stack. + Do not push basic block 0 to initialize scope binding stack. + (insert_stmt_tree_after): Remove unused argument from call to + insert_after_ctrl_stmt. + (tree_dump_bb): Dump BB_BINDING_SCOPE if defined. + * doc/invoke.texi: Document debugging option -ftree-dump-ssa-rdefs. + +2001-09-29 Diego Novillo + + * Makefile.in (tree-ssa.o): Update dependencies. + (tree-cfg.o): Ditto. + (tree-optimize.o): Ditto. + * basic-block.h (BB_CONTROL_EXPR): Define. + (BB_CONTROL_ENTRY): Define. + * c-common.h (TDF_RDEFS): Define. + * c-dump.c (dump_option_value_in): Add entry for TDF_RDEFS. + * tree-cfg.c: Include flags.h and c-tree.h + (binding_stack): New local variable. + (delete_block): Rename to delete_bb. + (tree_find_basic_blocks): Initialize varray 'binding_stack'. + Call make_blocks with an additional argument. + Adjust size of varray 'basic_block_info' after building CFG. + (make_blocks): Add new argument prev_chain_p. + Update all callers and callees. + Create sub-graphs for statement-expressions. + Update prev_chain_p when accessing the next tree in the chain. + (make_for_stmt_blocks): Add new argument prev_chain_p. + Update all callers and callees. + Update flags for control header blocks with BB_CONTROL_ENTRY and/or + BB_CONTROL_EXPR. + (make_while_stmt_blocks): Ditto. + (make_do_stmt_blocks): Ditto. + (make_if_stmt_blocks): Ditto. + (make_switch_stmt_blocks): Ditto. + (create_maximal_bb): Add new argument prev_chain_p. + Update all callers and callees. + (create_bb): Add new argument prev_chain_p. + Push basic block 0 the first time into the binding scope stack. + Associate the new basic block to the binding scope at the top of + the binding stack. + Push new binding scopes when a SCOPE_BEGIN statement is found. + Pop the top binding scope when a SCOPE_END statement is found. + (make_edges): Handle statement expressions. + Handle case labels preceded by scope statements in switch + statements. + (make_for_stmt_edges): Use FOR_INIT_STMT_BB, FOR_COND_BB and + FOR_EXPR_BB to access the header basic blocks. + (delete_unreachable_blocks): Call delete_bb instead of + delete_block. + (delete_block): Rename to delete_bb. + (block_invalidates_loop): Use data references to find calls to + non-pure functions. + (is_ctrl_stmt): Reformat. + (loop_body): New function. + (set_loop_body): New function. + (stmt_starts_bb_p): Statement expression trees also start a new + basic block. + (delete_cfg): Call VARRAY_FREE to delete all the references in each + basic block. + (latch_block): Use FOR_EXPR_BB, WHILE_COND_BB and DO_COND_BB to + find out the latch block for the loop. + (last_exec_stmt): New function. + (is_exec_stmt): Scope statements that begin a scope are also + considered executables. + (is_statement_expression): New function. + (first_non_decl_stmt): New function. + (first_decl_stmt): New function. + (first_non_label_in_bb): New function. + (insert_stmt_tree_before): New function. + (insert_before_ctrl_stmt): New function. + (insert_before_normal_stmt): New function. + (insert_stmt_tree_after): New function. + (insert_after_ctrl_stmt): New function. + (insert_after_normal_stmt): New function. + (insert_after_loop_body): New function. + (replace_expr_in_tree): New function. + (find_expr_in_tree): New function. + (insert_bb_before): New function. + (tree_dump_bb): Display the contents of BB_PREV_CHAIN_P. + * tree-dfa.c (tree_find_varrefs): Use accessor macros for array + 'referenced_symbols'. + (find_refs_in_stmt): Do not process error_mark_node trees. + Handle statement-expression nodes as any other statement tree. + Do not call find_refs_in_stmt_expr. + (find_refs_in_stmt_expr): Remove. + (add_ref_to_sym): Remove. + (add_ref_to_bb): Remove. + (find_refs_in_expr): Do not process error_mark_node trees. + ADDR_EXPR trees are not variable references except if used in a + CALL_EXPR node. + Handle EXPR_WITH_FILE_LOCATION nodes. + (create_varref): Remove variable 'is_new'. + Initialize data-flow arrays VARDEF_IMM_USES, VARDEF_RUSES, + VARDEF_PHI_CHAIN and VARUSE_RDEFS. + Do not call add_ref_to_sym and add_ref_to_bb. + (add_ref_symbol): Use accessor macros for varray + 'referenced_symbols'. + (function_may_recurse_p): New function. + (get_fcalls): New function. + (find_declaration): New function. + (dump_varref): Handle NULL values of VARREF_EXPR. + Use VARDEF_PHI_CHAIN instead of VARPHI_CHAIN. + (dump_varref_list): Check if the list is NULL before traversing it. + * tree-flow.h (struct vardef): Add fields 'ruses', 'marked' and + 'phi_chain'. + (VARDEF_RUSES): Define. + (VARDEF_MARKED): Define. + (VARDEF_PHI_CHAIN): Define. + (VARPHI_CHAIN): Remove. + (struct varphi): Remove. + (struct varuse): Add field 'rdefs'. + (VARUSE_RDEFS): Define. + (union varref_def): Remove field 'phi'. + (IS_GHOST_DEF): Define. + (IS_ARTIFICIAL_REF): Define. + (struct bb_ann_def): Add fields 'prev_chain_p' and 'binding_scope'. + (BB_PREV_CHAIN_P): Define. + (BB_BINDING_SCOPE): Define. + (FOR_INIT_STMT_BB): Define. + (FOR_COND_BB): Define. + (FOR_EXPR_BB): Define. + (WHILE_COND_BB): Define. + (DO_COND_BB): Define. + (IF_COND_BB): Define. + (CASE_COND_BB): Define. + (NREF_SYMBOLS): Define. + (REF_SYMBOL): Define. + (ADD_REF_SYMBOL): Define. + (FCALL_NON_PURE): Define. + (FCALL_PURE): Define. + (FCALL_BUILT_IN): Define. + (loop_body): Declare. + (set_loop_body): Declare. + (last_exec_stmt): Declare. + (is_statement_expression): Declare. + (first_non_decl_stmt): Declare. + (first_decl_stmt): Declare. + (first_non_label_in_bb): Declare. + (insert_stmt_tree_before): Declare. + (insert_stmt_tree_after): Declare. + (replace_expr_in_tree): Declare. + (find_expr_in_tree): Declare. + (insert_bb_before): Declare. + (function_may_recurse_p): Declare. + (get_fcalls): Declare. + (find_declaration): Declare. + (tree_compute_rdefs): Declare. + (analyze_rdefs): Declare. + (is_upward_exposed): Declare. + * tree-optimize.c (optimize_tree): Update name for varray + referenced_symbols. + Free varray referenced_symbols and call delete_ssa on exit. + * tree-ssa.c: Include flags.h, diagnostic.h and toplev.h. + (tree_build_ssa): Create ghost definitions before building FUD + chains. + (insert_phi_terms): Use accessor macros for 'referenced_symbols'. + Ignore ghost definitions when placing PHI terms. + (build_fud_chains): Call get_tree_ann to create an annotation for + the symbol if it doesn't already have one. + (search_fud_chains): Reformat comments. + Do not initialize varray VARDEF_IMM_USES. + If a successor basic block does not have references, continue on to + the next one, do not stop. + Do not initialize varray VARDEF_PHI_CHAIN. + (delete_ssa): New function. + (delete_refs): New function. + (tree_compute_rdefs): New function. + (analyze_rdefs): New function. + (follow_chain): New function. + (is_upward_exposed): New function. + +2001-09-14 Diego Novillo + + * tree-cfg.c (tree_find_basic_blocks): Remove call to + mark_critical_edges. + (create_maximal_bb): Do not create annotations for non-executable + statements. + (map_stmt_to_bb): Rename basic_block_ann with bb_ann. + (delete_cfg): Ditto. + (is_exec_stmt): Reformat. + (create_bb_ann): New function. + * tree-dfa.c (create_node): Remove. + (ref_symbols_list): Remove. + (create_tree_ann): Declare. + (referenced_symbols): Declare. + (tree_find_varrefs): Replace usage of linked lists with variable + arrays. + (create_varref): Remove second argument from call to + add_ref_symbol. + Update comments. + (add_ref_to_sym): Replace usage of linked lists with variable + arrays. + Declare static. + (add_ref_to_bb): Ditto. + (add_ref_symbol): Ditto. + (dump_varref_list): Ditto. + (debug_varref_list): Ditto. + (create_varref_list): Remove. + (push_ref): Remove. + (create_node): Remove. + (delete_varref_list): Remove. + (get_tree_ann): Call create_tree_ann if the tree doesn't have an + annotation already. + (create_tree_ann): New function. + * tree-flow.h (varref_list_def): Remove. + (vardef): Change type of field 'imm_uses' to 'varray_type'. + (varphi): Change type of field 'phi_chain' to 'varray_type'. + (varref_node_def): Remove. + (varref_node): Remove. + (VARREF_NODE_ELEM): Remove. + (VARREF_NODE_NEXT): Remove. + (VARREF_NODE_PREV): Remove. + (varref_list_def): Remove. + (varref_list): Remove. + (VARREF_LIST_FIRST): Remove. + (VARREF_LIST_LAST): Remove. + (tree_ann_def): Change type of field 'refs' to 'varray_type'. + (basic_block_ann_def): Rename to 'bb_ann_def'. + Change type of field 'refs' to 'varray_type'. + (basic_block_ann): Rename to 'bb_ann'. + (ref_symbols_list): Remove. + (referenced_symbols): Declare. + (add_ref_to_sym): Remove. + (add_ref_to_bb): Remove. + (add_ref_symbol): Remove. + (remove_ann_from_sym): Remove. + (create_varref_list): Remove. + (push_ref): Remove. + (delete_varref_list): Remove. + (debug_varref_list): Update argument type to be 'varray_type'. + (dump_varref_list): Ditto. + * tree-optimize.c: Include 'basic-block.h'. + (optimize_tree): Replace references to 'ref_symbols_list' with + 'referenced_symbols'. + Remove call to delete_varref_list. + * tree-ssa.c (insert_phi_terms): Rename 'work_list' to + 'work_stack'. + Use VARRAY_PUSH and VARRAY_TOP to access 'work_stack' instead of + maintaining the stack pointer in 'work_list_top'. + Remove code to grow 'work_stack'. + Remove references to 'work_list_top'. + Replace references to 'ref_symbols_list' with 'referenced_symbols'. + (build_fud_chains): Replace references to 'ref_symbols_list' with + 'referenced_symbols'. + (search_fud_chains): If there are no variable references in the + basic block, return early. + Change usage of linked lists with variable arrays. + +2001-09-07 Diego Novillo + + * tree-cfg.c (tree_find_basic_blocks): Document how to traverse + trees inside a basic block. + (make_for_stmt_blocks): Make sure that there is always a block for + FOR_EXPR, even if the loop does not have an expression. + Create a separate block for FOR_INIT_STMT. + (make_while_stmt_blocks): Always create an "end_while" block. + (make_if_stmt_blocks): Do not store IF_COND in the header block of + an IF statement. + (make_for_stmt_edges): Create an edge from the block header to the + block for FOR_INIT_STMT. + Determine the first block of the loop body calling BB_FOR_STMT on + the first executable statement in the body. + Remove the special case for missing FOR_EXPR trees. + (make_while_stmt_edges): Create a back edge from the end_while + block to the header block. + Determine the first block of the loop body calling BB_FOR_STMT on + the first executable statement in the body. + (make_do_stmt_edges): Determine the first block of the loop body + calling BB_FOR_STMT on the first executable statement in the body. + (condition_block): Rename to latch_block. Return the latch + block for the given loop header. + (make_continue_stmt_edges): Rename condition_block to + latch_block. + (successor_block): Ditto. + * tree-flow.h (condition_block): Rename to latch_block. + +2001-09-06 Diego Novillo + + * tree-dfa.c (tree_find_varrefs): Use TDF_REFS instead of TDF_VARREF. + * tree-flow.h (TDF_VARREF): Remove. + +2001-09-04 Nathan Sidwell + + * c-common.h (tree_dump_index): Add more comments. + (TDF_REFS): New dump flag. + * c-dump.c (dump_files): Name flags `tree' rather than `ast'. + (dump_option_value_info): New struct. + (dump_options): New array. + (dump_switch_p): Parse switch options symbolically. + * doc/invoke.texi (-fdump-ast): Rename to ... + (-fdump-tree): ... here. Document options are symbolic, and + not all are applicable. Combine ssa related flags into the other + tree dump flags. + +2001-08-27 Diego Novillo + + * Makefile.in (tree-ssa.o): Update dependencies. + (tree-cfg.o): Ditto. + (tree-dfa.o): Ditto. + (tree-optimize.o): Ditto. + +2001-08-26 Diego Novillo + + * Makefile.in (C_AND_OBJC_OBJS): Replace tree-opt.o with + tree-optimize.o. + (c-decl.o): Ditto. + (tree-ssa.o): Ditto. + (tree-cfg.o): Ditto. + (tree-dfa.o): Ditto. + (tree-opt.o): Ditto. + * c-decl.c: Replace tree-opt.h with tree-optimize.h. + (c_expand_body): Remove call to init_tree_opt. + * flow.c (flow_loop_dump): Do not display insn UIDs if this is not + an RTL basic block. + * tree-cfg.c: Replace tree-opt.h with tree-optimize.h. + (block_invalidates_loop): New local function. + (validate_loops): New function. + (tree_dump_bb): Display the loop depth of the block. + * tree-dfa.c: Replace tree-opt.h with tree-optimize.h. + * tree-flow.h (validate_loops): Declare. + * tree-opt.c: Rename to tree-optimize.c. + * tree-opt.h: Rename to tree-optimize.h. + * tree-optimize.c: Rename from tree-opt.c. + * tree-optimize.h: Rename from tree-opt.h. + * tree-ssa.c: Replace tree-opt.h with tree-optimize.h. + (tree_build_ssa): Call tree_dump_bb instead of tree_debug_bb. + * cp/Make-lang.in: Replace tree-opt.h with tree-optimize.h. + +2001-08-20 Diego Novillo + + * basic-block.h (basic_block): Remove field 'reachable'. + Add new field 'flags'. + (BB_REACHABLE): Define. + * c-common.h (tree_dump_index): Add TDI_cfg, TDI_dot, TDI_ssa. + * c-decl.c (c_decode_option): Skip '-f' prefix before calling + dump_switch_p. + * c-dump.c (dump_file_info): Add entries for -fdump-tree-cfg, + -fdump-tree-graphviz and -fdump-tree-ssa. + * flow.c (find_unreachable_blocks): Use BB_REACHABLE bit in bb->flags + instead of bb->reachable. + (delete_unreachable_blocks): Ditto. + * tree-cfg.c: Minor formatting changes throughout the file. + (DEBUG_TREE_FLOW): Remove. + (debug_tree_flow): Remove. + (cfg_dump_file): New local variable. + (dot_dump_file): New local variable. + (cfg_dump_flags): New local variable. + (dot_dump_flags): New local variable. + (tree_find_basic_blocks): Remove unused arguments. + Add code to react to -fdump-tree-cfg and -fdump-tree-graphviz. + Remove uses of DEBUG_TREE_FLOW. + (delete_unreachable_blocks): Use BB_REACHABLE bit in bb->flags + instead of bb->reachable. + (tree_dump_cfg): New. + (tree_debug_cfg): Call tree_dump_cfg(). + (tree_cfg2dot): Accept a FILE pointer instead of a file name as + argument. + Name the graph with the current function name. + * tree-dfa.c: Minor formatting changes throughout the file. + (DEBUG_TREE_DFA): Remove. + (debug_tree_dfa): Remove. + (dump_file): New local variable. + (dump_flags): New local variable. + (tree_find_varrefs): Add code to react to -fdump-tree-ssa. + Remove uses of DEBUG_TREE_DFA. + (find_refs_in_expr): Remove uses of DEBUG_TREE_DFA. + (create_varref): Replace VARREF_BLOCK with VARREF_BB. + * tree-flow.h: Minor formatting changes throughout the file. + (VARREF_BLOCK): Rename to VARREF_BB. + (VARREF_NEXT): Remove. + (VARREF_PREV): Remove. + (TDF_VARREF): Define. + (tree_find_basic_blocks): Remove unused arguments. + (tree_dump_cfg): Declare. + (tree_cfg2dot): Change argument to FILE *. + * tree-opt.c: Minor formatting changes throughout the file. + (optimize_tree): Remove unused arguments in call to + tree_find_basic_blocks(). + * tree-opt.h: Ditto. + * tree-ssa.c: Minor formatting changes throughout the file. + (DEBUG_TREE_SSA): Remove. + (debug_tree_ssa): Remove. + (dump_file): New local variable. + (dump_flags): New local variable. + (tree_build_ssa): Add code to react to -fdump-tree-ssa. + Remove uses of DEBUG_TREE_SSA. + (insert_phi_terms): Remove uses of DEBUG_TREE_SSA. + * doc/invoke.texi: Add documentation for -fdump-tree-cfg, + -fdump-tree-graphviz and -fdump-tree-ssa. + Replace existing references to -fdump-tree with -fdump-ast. + +2001-08-10 Diego Novillo + + * basic-block.h (basic_block): Add new field 'reachable'. + (expunge_block): Declare. + * flow.c (ENTRY_BLOCK_PTR): Initialize field 'reachable'. + (EXIT_BLOCK_PTR): Ditto. + (expunge_block): Remove static declaration. + (cleanup_cfg): Clear bb->aux on every basic block. + (find_unreachable_blocks): Use field 'reachable' when computing + reachability. + (delete_unreachable_blocks): Use field 'reachable'. + + * tree-cfg.c: Rename all instance of 'node' with 'block. + (get_successor_block): Rename to successor_block. + (make_compound_stmt_edges): Remove. + (make_switch_stmt_edges): Remove. + (delete_unreachable_blocks): New. + (delete_block): New. + (make_blocks): Add new argument 'compound_stmt'. Do not include + COMPOUND_STMT trees in the flowgraph. + (make_for_stmt_blocks): Include FOR_INIT_STMT in the entry block of + the loop. + If FOR_COND does not exist, create a tree holding the constant 1. + Add new argument 'compound_stmt'. + (make_while_stmt_blocks): Include WHILE_COND in the entry block of + the loop. + Add new argument 'compound_stmt'. + (make_do_stmt_blocks): Add new argument 'compound_stmt'. + (make_if_stmt_blocks): Add new argument 'compound_stmt'. + Include IF_COND in the IF header block. + (make_switch_stmt_blocks): Add new argument 'compound_stmt'. + Include SWITCH_COND in the SWITCH header block. + (create_maximal_bb): Remove argument 'is_loop_header'. + Add new argument 'compound_stmt'. + Update all callers. + Return the newly created basic block instead of its last statement. + Update comments. + Do not store control flow altering statements in bb->exit_stmt. + Only add executable statements to the block. + Annotate with 'compound_stmt' each tree added to the block. + (create_bb): Do not update annotation 'is_loop_header'. + (make_edges): Remove naive reachability analysis. + When a label node is found, add an edge from the immediately + enclosing switch statement. + Call delete_unreachable_blocks() after adding all the edges. + (make_ctrl_stmt_edges): Do not consider COMPOUND_STMT trees. + Do nothing for SWITCH_STMT trees. + (make_exit_edges): Use bb->end_tree instead of BB_EXIT_STMT. + (make_for_stmt_edges): Remove code that added edges for the block + holding FOR_INIT_STMT. + Update comments. + Do not consider the case where FOR_COND is NULL. + Call first_exec_stmt() to determine if FOR_BODY is empty. + Only create an edge from expr_bb to cond_bb if FOR_EXPR is + non-null. + (make_while_stmt_edges): Remove code that added edges for the block + holding WHILE_COND. + Update comments. + Call first_exec_stmt() to determine if WHILE_BODY is empty. + (make_do_stmt_edges): Call first_exec_stmt() to determine if + DO_BODY is empty. + (make_if_stmt_edges): Remove code that added edges for the block + holding IF_COND. + Call first_exec_stmt() to determine if THEN_CLAUSE or ELSE_CLAUSE + are empty. + (make_switch_stmt_edges): Remove. + (make_goto_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT. + (make_break_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT. + Call switch_parent() and loop_parent() to determine if the + statement is inside an appropriate control structure. + (make_continue_stmt_edges): Use bb->end_tree instead of + BB_EXIT_STMT. + (make_return_stmt_edges): Ditto. + (get_successor_block): Rename to successor_block. + Call first_exec_stmt() to find the first executable statement in + TREE_CHAIN. + (is_ctrl_stmt): Do not consider COMPOUND_STMT trees. + (stmt_starts_bb_p): Ditto. + (stmt_ends_bb_p): Reformat comments. + (delete_cfg): Reformat comments. + (find_loop_parent): Rename to loop_parent. + (get_condition_block): Rename to condition_block. + Update to use new index numbers for control structure header + blocks. + (switch_parent): New. + (first_exec_stmt): New. + (is_exec_stmt): New. + (tree_cfg2dot): Reformat comments. + * tree-dfa.c (find_refs): Remove. + (find_refs_in_stmt): New + (find_refs_in_stmt_expr): New. + (tree_find_varrefs): Look for variables doing a CFG traversal + instead of the trees. Remove both arguments. + (find_refs_in_expr): Add new argument 'bb'. + Update all recursive calls. + (create_varref): Abort if the basic block 'bb' is NULL. + (add_ref_to_sym): Reformat comments. + (add_ref_symbol): Ditto. + (delete_varref_list): Ditto. + * tree-flow.h (struct tree_ann_def): Add 'compound_stmt'. + (TREE_COMPOUND_STMT): New macro. + (struct basic_block_ann_def): Remove 'exit_stmt' and + 'is_loop_header'. + (BB_EXIT_STMT): Remove. + (BB_IS_LOOP_HEADER): Remove. + * tree-opt.c (optimize_tree): Call tree_find_varrefs() with no + arguments. + Only build DFA and SSA information if n_basic_blocks is greater + than zero. + * tree-ssa.c: Rename all instances of 'node' with 'block'. + (tree_build_ssa): Reformat comments. + (insert_phi_terms): Ditto. + +2001-08-01 Diego Novillo + + * tree-cfg.c (USE_TREE_IL): Remove. + (make_back_edges): Remove. + (make_fallthru_edge): Remove. + (get_outermost_scope_block): Remove. + (is_last_block_of_loop): Remove. + (tree_find_basic_blocks): Do not return early if 'errorcount' is set. + (make_edges): Do not treat back edges as a separate case. + Do not call make_fallthru_edge to create fall-through edges. + Do not emit a warning for unreachable blocks containing a single + closing brace. + (make_do_stmt_edges): Update comment. + (make_goto_stmt_edges): Do not call get_outermost_scope_block(). + (make_break_stmt_edges): Do not call get_outermost_scope_block(). + Do not call make_back_edges(). + (make_continue_stmt_edges): Call find_loop_parent(). Emit an error + if the 'continue' statement is not inside a loop. Call + get_condition_block() to find the target node. + (make_return_stmt_edges): Do not call get_outermost_scope_block(). + (get_successor_block): Return EXIT_BLOCK_PTR if 'bb' is the last + block in the graph. + Return the condition node of the loop if 'bb' doesn't have a + natural successor and its parent is a loop header. + (tree_cfg2dot): Output fake edges with dotted lines. + * tree-dfa.c (USE_TREE_IL): Remove. + * tree-opt.c (USE_TREE_IL): Remove. + * tree-ssa.c (USE_TREE_IL): Remove. + * tree-flow.h (is_last_block_of_loop): Remove. + +2001-07-23 Diego Novillo + + * Makefile.in (C_AND_OBJC_OBJS): Add tree-cfg.o, tree-dfa.o, + tree-ssa.o and tree-opt.o. + (c-decl.o): Add dependency on tree-opt.h + (tree-ssa.o): New rule. + (tree-cfg.o): New rule. + (tree-dfa.o): New rule. + (tree-opt.o): New rule. + * c-decl.c: Include tree-opt.h. + (c_expand_body): Call optimize_tree() when the -ftree-ssa flag is + given. + * flags.h (flag_tree_ssa): Declare. + * toplev.c (flag_tree_ssa): Define. + (lang_independent_options): Add -ftree-ssa. + * tree-cfg.c: New file. + * tree-dfa.c: New file. + * tree-flow.h: New file. + * tree-opt.c: New file. + * tree-opt.h: New file. + * tree-ssa.c: New file. + * cp/Make-lang.in (CXX_C_OBJS): Add tree-cfg.o, tree-dfa.o, + tree-opt.o and tree-ssa.o. + * doc/invoke.texi: Add documentation for -ftree-ssa. + +2001-07-23 Nathan Sidwell + + * Makefile.in (calls.o): Depend on intl.h. + * calls.c: Include intl.h. + (ECF_NEED_STACK_FRAME, ECF_NEED_ARG_FRAME): New flags. + (special_function_p): Detect when we need a stack or arg + frame. Don't optimize on length. + (setjmp_call_p): Remove. + (uninlinable_call_p): New function. + * tree.h (setjmp_call_p): Remove. + (uninlinable_call_p): Declare. + +2001-07-22 Nathan Sidwell + + * params.def (PARAM_MAX_INLINE_AST): New parameter. + (PARAM_ARG_INLINE_AST): New parameter. + * doc/invoke.texi (max-inline-ast, arg-inline-ast): Document + parameters. + +Local Variables: +mode: change-log +change-log-default-name: "ChangeLog.tree-ssa" +End: diff --git a/contrib/gcc/DATESTAMP b/contrib/gcc/DATESTAMP new file mode 100644 index 00000000000..9fa4bc3e86a --- /dev/null +++ b/contrib/gcc/DATESTAMP @@ -0,0 +1 @@ +20070514 diff --git a/contrib/gcc/DEV-PHASE b/contrib/gcc/DEV-PHASE new file mode 100644 index 00000000000..e69de29bb2d diff --git a/contrib/gcc/LANGUAGES b/contrib/gcc/LANGUAGES index d1e07198e64..5f20d9c24e9 100644 --- a/contrib/gcc/LANGUAGES +++ b/contrib/gcc/LANGUAGES @@ -6,60 +6,24 @@ time as we can formally start documenting the interface this file will serve as a repository for information on these interface and any incompatable changes we've made. +2004-09-09: + In an effort to decrease execution time, single char tree code + classes were changed to enumerated values. + + Old way: + + DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0) + + New way: + + DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", tcc_declaration, 0) + 2001-02-26: A DECL_INITIAL of NULL_TREE or error_mark_node in a VAR_DECL is no longer taken to signify a tentative definition which should not be emitted until end-of-file. Frontends which want that behavior should set DECL_DEFER_OUTPUT before calling rest_of_decl_compilation. -Aug 31, 1998: - The interface to HANDLE_PRAGMA has changed. It now takes three arguments. - The first two are pointers to functions that should be used to read characters - from the input stream, and to push them back into the input stream respectively. - The third argument is a pointer to a null terminate string which is the first - word after #pragma. The expression supplied by HANDLE_PRAGMA should return - nonzero if it parsed and implemented the pragma. Otherwise it should return - zero, and leave the input stream as it was before the expression was evaluated. - - A new back-end definable macro has been added: INSERT_ATTRIBUTES. This macro - allows backend to add attributes to decls as they are created. - -Jun 10, 1998: - The interface to lang_decode_option has changed. It now uses and argc/argv - interface to allow for options that use more than one input string. The new - declaration is: int lang_decode_option (int argc, char** argv). It now - returns the number of input strings processed, or 0 if the option is - unknown. - -Jun 7, 1998: - Front-ends must now define lang_init_options. It is safe for this - function to do nothing. See c-lang.c. - -Apr 21, 1998: - Front ends which link with c-common or other files from the C/C++ - front-ends may need to handle TI types. Look for references to - [unsigned]int_DI_type_node in your front end. If you have references - to these variables, you'll need up update the front end. - - To update the front end you must mirror all the code which currently - deals with intDI_type_node to also handle intTI_type_node. - - -Apr 7, 1998: - The interface between toplev.c and the language front ends for opening the - source file has changed: - - o init_lex() has been renamed to init_parse (char *filename) where filename - is the name of the source file. - o The code in toplev.c which opened the source file should be moved to - the new init_parse function. - o toplev.c now calls finish_parse() instead of closing the source file - using fclose(). This should now be done in finish_parse, if necessary. - -Apr 1, 1998: - Front-ends must now define lang_print_xnode. It is safe for this - function to do nothing. See c-lang.c. - Feb 1, 1998: GCC used to store structure sizes & offsets to elements as bitsize @@ -78,10 +42,6 @@ Feb 1, 1998: When a size in bits is converted into a size in bytes, which is expressed in trees, care should be taken to change the tree's type again to sizetype. - We've updated C, C++, Fortran & Objective-C to work with the new - scheme. Other languages will need to be updated accordingly. - Contact amylaar@cygnus.com for additional information. - ?? 1997: In an effort to decrease cache thrashing and useless loads we've changed the diff --git a/contrib/gcc/Makefile.in b/contrib/gcc/Makefile.in index 30815af4186..8c02cceedad 100644 --- a/contrib/gcc/Makefile.in +++ b/contrib/gcc/Makefile.in @@ -1,8 +1,9 @@ # Makefile for GNU Compiler Collection # Run 'configure' to generate Makefile from Makefile.in -# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, -# 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, +# 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. #This file is part of GCC. @@ -18,8 +19,8 @@ #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. +#the Free Software Foundation, 51 Franklin Street, Fifth Floor, +#Boston MA 02110-1301, USA. # The targets for external use include: # all, doc, proto, install, install-cross, install-cross-rest, @@ -71,18 +72,30 @@ program_transform_name := @program_transform_name@ # Directory where sources are, from where we are. srcdir = @srcdir@ -docdir = @srcdir@/doc +gcc_docdir = @srcdir@/doc # Directory where sources are, absolute. abs_srcdir = @abs_srcdir@ abs_docdir = @abs_srcdir@/doc -# Top build directory, relative to here. -top_builddir = .. +# Top build directory for this package, relative to here. +top_builddir = . # objdir is set by configure. # It's normally the absolute path to the current directory. objdir = @objdir@ +host_subdir=@host_subdir@ +build_subdir=@build_subdir@ +build_libsubdir=@build_libsubdir@ + +ifeq ($(host_subdir),.) +build_objdir := ../$(build_subdir) +build_libobjdir := ../$(build_libsubdir) +else +build_objdir := ../../$(build_subdir) +build_libobjdir := ../../$(build_libsubdir) +endif + # -------- # Defined vpaths # -------- @@ -90,12 +103,12 @@ objdir = @objdir@ # Directory where sources are, from where we are. VPATH = @srcdir@ -# We define a vpath for the sources of the .texi files here because they +# We define a vpath for the sources of the .texi files here because they # are split between multiple directories and we would rather use one implicit # pattern rule for everything. # This vpath could be extended within the Make-lang fragments. -vpath %.texi $(docdir):$(docdir)/include +vpath %.texi $(gcc_docdir):$(gcc_docdir)/include # ---- # Default values for variables overridden in Makefile fragments. @@ -117,10 +130,10 @@ T_ADAFLAGS = # See below for how to change them for certain systems. # List of language subdirectories. -SUBDIRS =@subdirs@ +SUBDIRS =@subdirs@ build # Selection of languages to be made. -CONFIG_LANGUAGES = @all_languages@ +CONFIG_LANGUAGES = @all_selected_languages@ LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES) # Selection of languages to be made during stage1 build. @@ -132,14 +145,17 @@ BOOT_LANGUAGES = c @all_boot_languages@ # or BOOT_CFLAGS # STAGE1_CFLAGS is set by configure on some targets or passed from toplevel # and sets the CFLAGS passed to stage1 of a bootstrap compilation. +# STAGE1_CHECKING enables checking for the stage1 compiler # BOOT_CFLAGS is the value of CFLAGS to pass to the stage2, stage3 and stage4 # bootstrap compilations. # XCFLAGS is used for most compilations but not when using the GCC just built. # TCFLAGS is used for compilations with the GCC just built. XCFLAGS = TCFLAGS = -CFLAGS = -g +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ STAGE1_CFLAGS = -g @stage1_cflags@ +STAGE1_CHECKING_CFLAGS = -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING BOOT_CFLAGS = -g -O2 # Flags to determine code coverage. When coverage is disabled, this will @@ -159,10 +175,16 @@ coverageexts = .{gcda,gcno} # STRICT_WARN and STRICT2_WARN are the additional warning flags to # apply to the back end and the C front end, which may be compiled # with other compilers. This is partially controlled by configure in -# stage1, as not all versions of gcc understand -Wno-long-long. +# stage1, as not all versions of gcc understand -Wno-long-long or +# -Wno-variadic-macros. +# CXX_COMPAT_WARN are C++ source compatibility warnings. LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes STRICT_WARN = @strict1_warn@ -STRICT2_WARN = -pedantic -Wno-long-long -Wold-style-definition @WERROR@ +WERROR_FLAGS = @WERROR@ +STRICT2_WARN = -pedantic -Wno-long-long -Wno-variadic-macros \ + -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute \ + $(WERROR_FLAGS) +CXX_COMPAT_WARN = @cxx_compat_warn@ # This is set by --enable-checking. The idea is to catch forgotten # "extern" tags in header files. @@ -177,19 +199,23 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@ # This is how we control whether or not the additional warnings are applied. .-warn = $(STRICT_WARN) +build-warn = $(STRICT_WARN) GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) -# These files are to have -Werror bypassed in stage2: -# These are very hard to completely clean due to target complexities. -gcc.o-warn = -Wno-error -insn-conditions.o-warn = -Wno-error +# These files are to have specific diagnostics suppressed, or are not to +# be subject to -Werror: # Bison-1.75 output often yields (harmless) -Wtraditional warnings -gengtype-yacc.o-warn = -Wno-error -c-parse.o-warn = -Wno-error +build/gengtype-yacc.o-warn = -Wno-error # flex output may yield harmless "no previous prototype" warnings -gengtype-lex.o-warn = -Wno-error +build/gengtype-lex.o-warn = -Wno-error # SYSCALLS.c misses prototypes SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error +# These files need -Wno-error because the gimplifier triggers hard to fix +# warnings when converting to GIMPLE form. The warnings are triggered because +# moving the condition into the loop prevents the loop optimizer from +# recognizing that the loop will always be executed at least once. We need +# a new loop optimizer. +reload1.o-warn = -Wno-error # All warnings have to be shut off in stage1 if the compiler used then # isn't gcc; configure determines that. WARN_CFLAGS will be either @@ -211,9 +237,11 @@ BISON = @BISON@ BISONFLAGS = FLEX = @FLEX@ FLEXFLAGS = -AR = ar +AR = @AR@ AR_FLAGS = rc +NM = @NM@ RANLIB = @RANLIB@ +RANLIB_FLAGS = @ranlib_flags@ # ------------------------------------------- # Programs which operate on the build machine @@ -240,6 +268,8 @@ INSTALL_SCRIPT = @INSTALL@ MAKEINFO = @MAKEINFO@ MAKEINFOFLAGS = --no-split TEXI2DVI = texi2dvi +TEXI2PDF = texi2pdf +TEXI2HTML = $(MAKEINFO) --html TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" # Some versions of `touch' (such as the version on Solaris 2.8) @@ -251,6 +281,9 @@ STAMP = echo timestamp > @SET_MAKE@ REMAKEFLAGS=LANGUAGES="$(LANGUAGES)" BOOT_CFLAGS="$(BOOT_CFLAGS)" +# Locate mkinstalldirs. +mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs + # -------- # UNSORTED # -------- @@ -265,6 +298,18 @@ OUTPUT_OPTION = @OUTPUT_OPTION@ ZLIB = @zlibdir@ -lz ZLIBINC = @zlibinc@ +# How to find GMP +GMPLIBS = @GMPLIBS@ +GMPINC = @GMPINC@ + +CPPLIB = ../libcpp/libcpp.a +CPPINC = -I$(srcdir)/../libcpp/include + +# Where to find decNumber +DECNUM = $(srcdir)/../libdecnumber +DECNUMINC = -I$(DECNUM) -I../libdecnumber +LIBDECNUMBER = ../libdecnumber/libdecnumber.a + # Substitution type for target's getgroups 2nd arg. TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@ @@ -274,15 +319,17 @@ INSTALL_HEADERS_DIR = @build_install_headers_dir@ # Header files that are made available under the same name # to programs compiled with GCC. -USER_H = $(srcdir)/ginclude/float.h \ +USER_H = $(srcdir)/ginclude/decfloat.h \ + $(srcdir)/ginclude/float.h \ $(srcdir)/ginclude/iso646.h \ $(srcdir)/ginclude/stdarg.h \ $(srcdir)/ginclude/stdbool.h \ $(srcdir)/ginclude/stddef.h \ $(srcdir)/ginclude/varargs.h \ - $(srcdir)/unwind.h \ $(EXTRA_HEADERS) +UNWIND_H = $(srcdir)/unwind-generic.h + # The GCC to use for compiling libgcc.a and crt*.o. # Usually the one we just built. # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS). @@ -291,26 +338,28 @@ GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isyste # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET. # It omits XCFLAGS, and specifies -B./. # It also specifies -isystem ./include to find, e.g., stddef.h. -GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS) +GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS) # --------------------------------------------------- # Programs which produce files for the target machine # --------------------------------------------------- -AR_FOR_TARGET = ` \ +AR_FOR_TARGET := $(shell \ if [ -f $(objdir)/../binutils/ar ] ; then \ echo $(objdir)/../binutils/ar ; \ else \ if [ "$(host)" = "$(target)" ] ; then \ - echo ar; \ + echo $(AR); \ else \ t='$(program_transform_name)'; echo ar | sed -e $$t ; \ fi; \ - fi` + fi) AR_FLAGS_FOR_TARGET = AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x -RANLIB_FOR_TARGET = ` \ +LIPO_FOR_TARGET = lipo +ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@ +RANLIB_FOR_TARGET := $(shell \ if [ -f $(objdir)/../binutils/ranlib ] ; then \ echo $(objdir)/../binutils/ranlib ; \ else \ @@ -319,19 +368,20 @@ RANLIB_FOR_TARGET = ` \ else \ t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \ fi; \ - fi` -NM_FOR_TARGET = ` \ - if [ -f ./nm ] ; then \ - echo ./nm ; \ - elif [ -f $(objdir)/../binutils/nm-new ] ; then \ - echo $(objdir)/../binutils/nm-new ; \ + fi) +ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@ +ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@ +NM_FOR_TARGET = ./nm +STRIP_FOR_TARGET := $(shell \ + if [ -f $(objdir)/../binutils/strip ] ; then \ + echo $(objdir)/../binutils/strip ; \ else \ if [ "$(host)" = "$(target)" ] ; then \ - echo nm; \ + echo strip; \ else \ - t='$(program_transform_name)'; echo nm | sed -e $$t ; \ + t='$(program_transform_name)'; echo strip | sed -e $$t ; \ fi; \ - fi` + fi) # -------- # UNSORTED @@ -343,6 +393,7 @@ OBSTACK_H = $(srcdir)/../include/obstack.h SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h FIBHEAP_H = $(srcdir)/../include/fibheap.h PARTITION_H = $(srcdir)/../include/partition.h +MD5_H = $(srcdir)/../include/md5.h # Default native SYSTEM_HEADER_DIR, to be overridden by targets. NATIVE_SYSTEM_HEADER_DIR = /usr/include @@ -350,7 +401,12 @@ NATIVE_SYSTEM_HEADER_DIR = /usr/include CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ # autoconf sets SYSTEM_HEADER_DIR to one of the above. -SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ +# Purge it of unneccessary internal relative paths +# to directories that might not exist yet. +# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. +# Use single quotes here to avoid nested double- and backquotes, this +# macro is also used in a double-quoted context. +SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` # Control whether to run fixproto and fixincludes. STMP_FIXPROTO = @STMP_FIXPROTO@ @@ -391,12 +447,8 @@ GCC_THREAD_FILE=@thread_file@ OBJC_BOEHM_GC=@objc_boehm_gc@ GTHREAD_FLAGS=@gthread_flags@ extra_modes_file=@extra_modes_file@ +extra_opt_files=@extra_opt_files@ host_hook_obj=@out_host_hook_obj@ -# Be prepared for gcc2 merges. -gcc_version=@gcc_version@ -gcc_version_trigger=@gcc_version_trigger@ -version=$(gcc_version) -mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'` # ------------------------ # Installation directories @@ -463,6 +515,13 @@ man7dir = $(mandir)/man7 # Dir for temp files. tmpdir = /tmp +datarootdir = @datarootdir@ +docdir = @docdir@ +# Directory in which to build HTML +build_htmldir = $(objdir)/HTML/gcc-$(version) +# Directory in which to put HTML +htmldir = @htmldir@ + # Whether we were configured with NLS. USE_NLS = @USE_NLS@ @@ -485,10 +544,20 @@ GGC_LIB= LIBGCC = libgcc.a INSTALL_LIBGCC = install-libgcc +# "true" if the target C library headers are unavailable; "false" +# otherwise. +inhibit_libc = @inhibit_libc@ +ifeq ($(inhibit_libc),true) +INHIBIT_LIBC_CFLAGS = -Dinhibit_libc +endif + # Options to use when compiling libgcc2.a. # LIBGCC2_DEBUG_CFLAGS = -g -LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@ +LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ + $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \ + -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ + $(INHIBIT_LIBC_CFLAGS) # Additional options to use when compiling libgcc2.a. # Some targets override this to -isystem include @@ -500,14 +569,15 @@ TARGET_LIBGCC2_CFLAGS = # Options to use when compiling crtbegin/end. CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ -finhibit-size-directive -fno-inline-functions -fno-exceptions \ - -fno-zero-initialized-in-bss -fno-unit-at-a-time + -fno-zero-initialized-in-bss -fno-toplevel-reorder \ + $(INHIBIT_LIBC_CFLAGS) # Additional sources to handle exceptions; overridden by targets as needed. LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c LIB2ADDEHSTATIC = $(LIB2ADDEH) LIB2ADDEHSHARED = $(LIB2ADDEH) -LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h +LIB2ADDEHDEP = $(UNWIND_H) unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h # Don't build libunwind by default. LIBUNWIND = @@ -541,9 +611,10 @@ EXTRA_GCC_OBJS =@extra_gcc_objs@ # List of additional header files to install. EXTRA_HEADERS =@extra_headers_list@ -# It is convenient for configure to add the assignment at the beginning, -# so don't override it here. -USE_COLLECT2 = collect2$(exeext) +# The configure script will set this to collect2$(exeext), except on a +# (non-Unix) host which can not build collect2, for which it will be +# set to empty. +COLLECT2 = @collect2@ # List of extra C and assembler files to add to static and shared libgcc2. # Assembler files should have names ending in `.asm'. @@ -553,9 +624,11 @@ LIB2FUNCS_EXTRA = # Assembler files should have names ending in `.asm'. LIB2FUNCS_STATIC_EXTRA = -# List of extra C and assembler files to add to shared libgcc2. -# Assembler files should have names ending in `.asm'. -LIB2FUNCS_SHARED_EXTRA = +# List of functions not to build from libgcc2.c. +LIB2FUNCS_EXCLUDE = + +# Target sfp-machine.h file. +SFP_MACHINE = # Program to convert libraries. LIBCONVERT = @@ -586,20 +659,11 @@ GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs $(EXTRA_PASSES) # List of things which should already be built whenever we try to use xgcc # to link anything. -GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS) +GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(COLLECT2) $(EXTRA_PARTS) # Directory to link to, when using the target `maketest'. DIR = ../gcc -# Flags to use when cross-building GCC. -# Prefix to apply to names of object files when using them -# to run on the machine we are compiling on. -BUILD_PREFIX = @BUILD_PREFIX@ -# Prefix to apply to names of object files when compiling them -# to run on the machine we are compiling on. -# The default for this variable is chosen to keep these rules -# out of the way of the other rules for compiling the same source files. -BUILD_PREFIX_1 = @BUILD_PREFIX_1@ # Native compiler for the build machine and its switches. CC_FOR_BUILD = @CC_FOR_BUILD@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE @@ -661,40 +725,97 @@ CONFIG_H = config.h $(host_xm_file_list) TCONFIG_H = tconfig.h $(xm_file_list) TM_P_H = tm_p.h $(tm_p_file_list) GTM_H = tm.h $(tm_file_list) -TM_H = $(GTM_H) insn-constants.h insn-flags.h +TM_H = $(GTM_H) insn-constants.h insn-flags.h options.h -TARGET_H = $(TM_H) target.h -HOOKS_H = hooks.h +# Variables for version information. +BASEVER := $(srcdir)/BASE-VER # 4.x.y +DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, "" +DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty + +BASEVER_c := $(shell cat $(BASEVER)) +DEVPHASE_c := $(shell cat $(DEVPHASE)) +DATESTAMP_c := $(shell cat $(DATESTAMP)) + +version := $(BASEVER_c) + +# For use in version.c - double quoted strings, with appropriate +# surrounding punctuation and spaces, and with the datestamp and +# development phase collapsed to the empty string in release mode +# (i.e. if DEVPHASE_c is empty). The space immediately after the +# comma in the $(if ...) constructs is significant - do not remove it. +BASEVER_s := "\"$(BASEVER_c)\"" +DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" +DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" + +# Shorthand variables for dependency lists. +TARGET_H = $(TM_H) target.h insn-modes.h +MACHMODE_H = machmode.h mode-classes.def insn-modes.h +HOOKS_H = hooks.h $(MACHMODE_H) +HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H) TARGET_DEF_H = target-def.h $(HOOKS_H) -MACHMODE_H = machmode.h mode-classes.def insn-modes.h -RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) -RTL_H = $(RTL_BASE_H) genrtl.h input.h +RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H) reg-notes.def insn-notes.def \ + input.h $(REAL_H) statistics.h vec.h +RTL_H = $(RTL_BASE_H) genrtl.h PARAMS_H = params.h params.def -TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \ - input.h +BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def +TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \ + input.h statistics.h vec.h treestruct.def $(HASHTAB_H) BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \ - hard-reg-set.h cfghooks.h -COVERAGE_H = coverage.h gcov-io.h gcov-iov.h + hard-reg-set.h cfghooks.h $(OBSTACK_H) +GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h +COVERAGE_H = coverage.h $(GCOV_IO_H) DEMANGLE_H = $(srcdir)/../include/demangle.h RECOG_H = recog.h -EXPR_H = expr.h +ALIAS_H = alias.h +EMIT_RTL_H = emit-rtl.h +FLAGS_H = flags.h options.h +FUNCTION_H = function.h $(TREE_H) $(HASHTAB_H) +EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H) OPTABS_H = optabs.h insn-codes.h -REGS_H = regs.h varray.h $(MACHMODE_H) -INTEGRATE_H = integrate.h varray.h -LOOP_H = loop.h varray.h bitmap.h +REGS_H = regs.h varray.h $(MACHMODE_H) $(OBSTACK_H) $(BASIC_BLOCK_H) $(FUNCTION_H) +RESOURCE_H = resource.h hard-reg-set.h +SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) +INTEGRATE_H = integrate.h $(VARRAY_H) +CFGLAYOUT_H = cfglayout.h $(BASIC_BLOCK_H) +CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(RTL_H) +IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H) +IPA_REFERENCE_H = ipa-reference.h bitmap.h $(TREE_H) +IPA_TYPE_ESCAPE_H = ipa-type-escape.h $(TREE_H) +CGRAPH_H = cgraph.h $(TREE_H) +DF_H = df.h bitmap.h $(BASIC_BLOCK_H) alloc-pool.h +DDG_H = ddg.h sbitmap.h $(DF_H) GCC_H = gcc.h version.h GGC_H = ggc.h gtype-desc.h TIMEVAR_H = timevar.h timevar.def INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h -C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) -C_TREE_H = c-tree.h $(C_COMMON_H) -SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h +C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) +C_PRAGMA_H = c-pragma.h $(CPPLIB_H) +C_TREE_H = c-tree.h $(C_COMMON_H) toplev.h $(DIAGNOSTIC_H) +SYSTEM_H = system.h hwint.h double-int.h $(srcdir)/../include/libiberty.h PREDICT_H = predict.h predict.def -CPPLIB_H = cpplib.h line-map.h +CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \ + $(srcdir)/../libcpp/include/cpplib.h +DECNUM_H = $(DECNUM)/decContext.h $(DECNUM)/decDPD.h $(DECNUM)/decNumber.h \ + $(DECNUM)/decimal32.h $(DECNUM)/decimal64.h $(DECNUM)/decimal128.h +MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h +SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h +CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h +TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) +TREE_GIMPLE_H = tree-gimple.h tree-iterator.h +TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \ + bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h $(TREE_GIMPLE_H) \ + $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) +TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H) vecprim.h PRETTY_PRINT_H = pretty-print.h input.h $(OBSTACK_H) -DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H) -C_PRETTY_PRINT_H = $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H) +DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H) options.h +C_PRETTY_PRINT_H = c-pretty-print.h $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H) +SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H) +LAMBDA_H = lambda.h $(TREE_H) vec.h $(GGC_H) +TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) +VARRAY_H = varray.h $(MACHMODE_H) $(SYSTEM_H) coretypes.h $(TM_H) +TREE_INLINE_H = tree-inline.h $(VARRAY_H) $(SPLAY_TREE_H) +REAL_H = real.h $(MACHMODE_H) # # Now figure out from those variables how to compile and link. @@ -709,16 +830,17 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@ ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@ -# Likewise. -ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) +# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro +# puts -I options in CPPFLAGS, our include files in the srcdir will always +# win against random include files in /usr/include. +ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS) -# Build and host support libraries. FORBUILD is either -# .. or ../$(build_alias) depending on whether host != build. +# Build and host support libraries. LIBIBERTY = ../libiberty/libiberty.a -BUILD_LIBIBERTY = @FORBUILD@/libiberty/libiberty.a +BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a # Dependencies on the intl and portability libraries. -LIBDEPS= $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) +LIBDEPS= $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBDECNUMBER) # Likewise, for use in the tools that must run on this machine # even if we are cross-building GCC. @@ -726,7 +848,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) # How to link with both our special library facilities # and the system's installed libraries. -LIBS = @LIBS@ $(LIBIBERTY) $(LIBINTL) $(LIBICONV) +LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) # Any system libraries needed just for GNAT. SYSLIBS = @GNAT_LIBEXC@ @@ -738,14 +860,9 @@ LDEXP_LIB = @LDEXP_LIB@ # even if we are cross-building GCC. BUILD_LIBS = $(BUILD_LIBIBERTY) -BUILD_RTL = $(BUILD_PREFIX)rtl.o read-rtl.o $(BUILD_PREFIX)bitmap.o \ - $(BUILD_PREFIX)ggc-none.o min-insn-modes.o -BUILD_SUPPORT = gensupport.o insn-conditions.o -BUILD_EARLY_SUPPORT = gensupport.o dummy-conditions.o - -BUILD_PRINT = print-rtl1.o -BUILD_ERRORS = $(BUILD_PREFIX)errors.o -BUILD_VARRAY = $(BUILD_PREFIX)varray.o +BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o \ + build/min-insn-modes.o build/gensupport.o build/print-rtl.o +BUILD_ERRORS = build/errors.o # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, @@ -755,10 +872,11 @@ BUILD_VARRAY = $(BUILD_PREFIX)varray.o # currently being compiled, in both source trees, to be examined as well. # libintl.h will be found in ../intl if we are using the included libintl. INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ - -I$(srcdir)/../include @INCINTL@ + -I$(srcdir)/../include @INCINTL@ \ + $(CPPINC) $(GMPINC) $(DECNUMINC) .c.o: - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) # # Support for additional languages (other than C). @@ -779,16 +897,16 @@ export AR_CREATE_FOR_TARGET export AR_FLAGS_FOR_TARGET export AR_EXTRACT_FOR_TARGET export AWK -export BUILD_PREFIX -export BUILD_PREFIX_1 export DESTDIR export GCC_FOR_TARGET export INCLUDES export INSTALL_DATA export LIB1ASMSRC export LIBGCC2_CFLAGS +export LIPO_FOR_TARGET export MACHMODE_H export NM_FOR_TARGET +export STRIP_FOR_TARGET export RANLIB_FOR_TARGET export libsubdir export slibdir @@ -833,84 +951,115 @@ SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \ # # Lists of files for various purposes. +# All option source files +ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files) + # Target specific, C specific object file C_TARGET_OBJS=@c_target_objs@ # Target specific, C++ specific object file CXX_TARGET_OBJS=@cxx_target_objs@ +# Object files for gcc driver. +GCC_OBJS = gcc.o opts-common.o gcc-options.o + # Language-specific object files for C and Objective C. C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \ c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \ c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \ - c-objc-common.o c-dump.o c-pch.o libcpp.a $(C_TARGET_OBJS) + c-objc-common.o c-dump.o c-pch.o c-parser.o $(C_TARGET_OBJS) \ + c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o # Language-specific object files for C. -C_OBJS = c-parse.o c-lang.o c-pretty-print.o stub-objc.o $(C_AND_OBJC_OBJS) +C_OBJS = c-lang.o stub-objc.o $(C_AND_OBJC_OBJS) # Language-independent object files. - OBJS-common = \ + double-int.o tree-chrec.o tree-scalar-evolution.o tree-data-ref.o \ + tree-cfg.o tree-dfa.o tree-eh.o tree-ssa.o tree-optimize.o tree-gimple.o \ + gimplify.o tree-pretty-print.o tree-into-ssa.o \ + tree-outof-ssa.o tree-ssa-ccp.o tree-vn.o tree-ssa-uncprop.o \ + tree-ssa-dce.o tree-ssa-copy.o tree-nrv.o tree-ssa-copyrename.o \ + tree-ssa-pre.o tree-ssa-live.o tree-ssa-operands.o tree-ssa-alias.o \ + tree-ssa-phiopt.o tree-ssa-forwprop.o tree-nested.o tree-ssa-dse.o \ + tree-ssa-dom.o domwalk.o tree-tailcall.o gimple-low.o tree-iterator.o \ + omp-low.o tree-phinodes.o tree-ssanames.o tree-sra.o tree-complex.o \ + tree-vect-generic.o tree-ssa-loop.o tree-ssa-loop-niter.o \ + tree-ssa-loop-manip.o tree-ssa-threadupdate.o tree-ssa-threadedge.o \ + tree-vectorizer.o tree-vect-analyze.o tree-vect-transform.o \ + tree-vect-patterns.o tree-ssa-loop-prefetch.o \ + tree-ssa-loop-ivcanon.o tree-ssa-propagate.o tree-ssa-address.o \ + tree-ssa-math-opts.o \ + tree-ssa-loop-ivopts.o tree-if-conv.o tree-ssa-loop-unswitch.o \ alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \ cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \ cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o \ cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o \ - dbxout.o debug.o df.o diagnostic.o dojump.o doloop.o dominance.o \ - dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o \ + dbxout.o ddg.o tree-ssa-loop-ch.o loop-invariant.o tree-ssa-loop-im.o \ + debug.o df-core.o df-problems.o df-scan.o dfp.o diagnostic.o dojump.o \ + dominance.o loop-doloop.o \ + dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o loop-iv.o \ expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o \ genrtl.o ggc-common.o global.o graph.o gtype-desc.o \ haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o insn-modes.o \ insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \ integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \ - loop.o optabs.o options.o opts.o params.o postreload.o predict.o \ - print-rtl.o print-tree.o value-prof.o \ - profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \ + mode-switching.o modulo-sched.o optabs.o options.o opts.o opts-common.o \ + params.o postreload.o postreload-gcse.o predict.o \ + insn-preds.o insn-automata.o pointer-set.o \ + print-rtl.o print-tree.o profile.o value-prof.o var-tracking.o \ real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \ reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \ sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \ - sibcall.o simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o \ - targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o unroll.o \ - varasm.o varray.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \ - et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o + see.o simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o \ + struct-equiv.o targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \ + varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \ + et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \ + tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \ + lambda-trans.o lambda-code.o tree-loop-linear.o tree-ssa-sink.o \ + tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.o \ + tree-ssa-structalias.o tree-object-size.o \ + rtl-factoring.o + OBJS-md = $(out_object_file) -OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o \ - tree-optimize.o cgraph.o cgraphunit.o +OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \ + cgraph.o cgraphunit.o tree-nomudflap.o ipa.o ipa-inline.o \ + ipa-utils.o ipa-reference.o ipa-pure-const.o ipa-type-escape.o \ + ipa-prop.o ipa-cp.o OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) OBJS-onestep = libbackend.o $(OBJS-archive) -BACKEND = main.o libbackend.a +BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER) -# Files to be copied away after each stage in building. -STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \ +# Files to be copied after each stage in building. +STAGECOPYSTUFF = insn-flags.h insn-config.h insn-codes.h \ insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ - insn-attr.h insn-attrtab.c insn-opinit.c insn-constants.h tm-preds.h \ - tree-check.h insn-conditions.c min-insn-modes.c insn-modes.c insn-modes.h \ - s-flags s-config s-codes s-mlib s-genrtl s-modes s-gtype gtyp-gen.h \ - s-output s-recog s-emit s-extract s-peep s-check s-conditions \ - s-attr s-attrtab s-opinit s-preds s-constants s-crt0 \ - genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \ - genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \ - genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \ - genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \ - gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext) \ - gengtype$(build_exeext) genconditions$(build_exeext) genmodes$(build_exeext) \ - genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c \ - xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \ + insn-attr.h insn-attrtab.c insn-opinit.c insn-preds.c insn-constants.h \ + tm-preds.h tm-constrs.h \ + tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \ + genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-gen.h + +# Files to be moved away after each stage in building. +STAGEMOVESTUFF = *$(objext) s-* \ + xgcc$(exeext) cpp$(exeext) cc1$(exeext) cc1*-dummy$(exeext) $(EXTRA_PASSES) \ $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ protoize$(exeext) unprotoize$(exeext) \ - $(SPECS) collect2$(exeext) $(USE_COLLECT2) \ + $(SPECS) collect2$(exeext) \ gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \ - *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \ + *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk \ $(LANG_STAGESTUFF) # Defined in libgcc2.c, included only in the static library. LIB2FUNCS_ST = _eprintf __gcc_bcmp # Defined in libgcov.c, included only in gcov library -LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta +LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ + _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \ + _gcov_execv _gcov_execvp _gcov_execve \ + _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ @@ -927,6 +1076,29 @@ TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \ _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \ _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf +D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \ + _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \ + _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \ + _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \ + _sd_to_sf _sd_to_df _sd_to_xf _sf_to_sd _df_to_sd _xf_to_sd \ + _sd_to_dd _sd_to_td _unord_sd _conv_sd + +D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \ + _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \ + _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \ + _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \ + _dd_to_sf _dd_to_df _dd_to_xf \ + _sf_to_dd _df_to_dd _xf_to_dd \ + _dd_to_sd _dd_to_td _unord_dd _conv_dd + +D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \ + _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \ + _td_to_si _td_to_di _td_to_usi _td_to_udi \ + _si_to_td _di_to_td _usi_to_td _udi_to_td \ + _td_to_sf _td_to_df _td_to_xf \ + _sf_to_td _df_to_td _xf_to_td \ + _td_to_sd _td_to_dd _unord_td _conv_td + # These might cause a divide overflow trap and so are compiled with # unwinder info. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 @@ -937,7 +1109,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 # The following targets define the interface between us and the languages. # # all.cross, start.encap, rest.encap, -# install-normal, install-common, install-info, install-man, +# install-common, install-info, install-man, # uninstall, # mostlyclean, clean, distclean, maintainer-clean, # stage1, stage2, stage3, stage4 @@ -950,9 +1122,6 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 # language hooks, generated by configure @language_hooks@ -# Set up library path if needed. -@set_gcc_lib_path@ - # per-language makefile fragments ifneq ($(LANG_MAKEFRAGS),) include $(LANG_MAKEFRAGS) @@ -977,7 +1146,43 @@ endif # Rebuilding this configuration # ----------------------------- -Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c $(LANG_MAKEFRAGS) +# On the use of stamps: +# Consider the example of tree-check.h. It is constructed with build/gencheck. +# A simple rule to build tree-check.h would be +# tree-check.h: build/gencheck$(build_exeext) +# $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h +# +# but tree-check.h doesn't change every time gencheck changes. It would the +# nice if targets that depend on tree-check.h wouldn't be rebuild +# unnecessarily when tree-check.h is unchanged. To make this, tree-check.h +# must not be overwritten with a identical copy. One solution is to use a +# temporary file +# tree-check.h: build/gencheck$(build_exeext) +# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h +# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h +# +# This solution has a different problem. Since the time stamp of tree-check.h +# is unchanged, make will try to update tree-check.h every time it runs. +# To prevent this, one can add a stamp +# tree-check.h: s-check +# s-check : build/gencheck$(build_exeext) +# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h +# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h +# $(STAMP) s-check +# +# The problem with this solution is that make thinks that tree-check.h is +# always unchanged. Make must be deceived into thinking that tree-check.h is +# rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command: +# tree-check.h: s-check; @true +# s-check : build/gencheck$(build_exeext) +# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h +# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h +# $(STAMP) s-check +# +# This is what is done in this makefile. Note that mkconfig.sh has a +# move-if-change built-in + +Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS) LANGUAGES="$(CONFIG_LANGUAGES)" \ CONFIG_HEADERS= \ CONFIG_SHELL="$(SHELL)" \ @@ -1001,7 +1206,7 @@ cs-bconfig.h: Makefile cs-tconfig.h: Makefile TARGET_CPU_DEFAULT="" \ - HEADERS="$(xm_include_list)" DEFINES="$(xm_defines)" \ + HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \ $(SHELL) $(srcdir)/mkconfig.sh tconfig.h cs-tm.h: Makefile @@ -1019,7 +1224,8 @@ cs-tm_p.h: Makefile # might be on a read-only file system. If configured for maintainer mode # then do allow autoconf to be run. -$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 \ + $(srcdir)/acinclude.m4 (cd $(srcdir) && autoconf) gccbug: $(srcdir)/gccbug.in @@ -1028,9 +1234,6 @@ gccbug: $(srcdir)/gccbug.in mklibgcc: $(srcdir)/mklibgcc.in CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status -mkheaders: $(srcdir)/mkheaders.in - CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status - # cstamp-h.in controls rebuilding of config.in. # It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't # delete it. A stamp file is needed as autoheader won't update the file if @@ -1057,7 +1260,7 @@ cstamp-h: config.in config.status # Really, really stupid make features, such as SUN's KEEP_STATE, may force # a target to build even if it is up-to-date. So we must verify that # config.status does not exist before failing. -config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c +config.status: $(srcdir)/configure $(srcdir)/config.gcc @if [ ! -f config.status ] ; then \ echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \ false; \ @@ -1071,8 +1274,8 @@ config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c all.internal: start.encap rest.encap doc # This is what to compile if making a cross-compiler. -all.cross: native gcc-cross cpp$(exeext) specs \ - $(LIBGCC) $(EXTRA_PARTS) lang.all.cross doc +all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \ + $(LIBGCC) $(EXTRA_PARTS) lang.all.cross doc @GENINSRC@ srcextra # This is what must be made before installing GCC and converting libraries. start.encap: native xgcc$(exeext) cpp$(exeext) specs \ xlimits.h lang.start.encap @GENINSRC@ srcextra @@ -1081,14 +1284,13 @@ rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap # This is what is made with the host's compiler # whether making a cross compiler or not. native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \ - $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) + $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) # Define the names for selecting languages in LANGUAGES. -C c: cc1$(exeext) -PROTO: proto +c: cc1$(exeext) # Tell GNU make these are phony targets. -.PHONY: C c PROTO proto +.PHONY: c proto # On the target machine, finish building a cross compiler. # This does the things that can't be done on the host machine. @@ -1098,27 +1300,81 @@ rest.cross: $(LIBGCC) specs # This is used only if the user explicitly asks for it. compilations: $(BACKEND) -# Like libcpp.a, this archive is strictly for the host. +# This archive is strictly for the host. libbackend.a: $(OBJS@onestep@) -rm -rf libbackend.a $(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@) - -$(RANLIB) libbackend.a + -$(RANLIB) $(RANLIB_FLAGS) libbackend.a # We call this executable `xgcc' rather than `gcc' # to avoid confusion if the current directory is in the path # and CC is `gcc'. It is renamed to `gcc' when it is installed. -xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \ +xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \ version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \ - prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) gccspec.o \ + intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) # cpp is to cpp0 as gcc is to cc1. # The only difference from xgcc is that it's linked with cppspec.o # instead of gccspec.o. -cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \ +cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \ version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \ - prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) cppspec.o \ + intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) + +# Create links to binutils, especially for in-tree builds, to make -B. +# use them. We need hard links so that directories can be shuffled +# during toplevel bootstrap. +# Go through an additional indirection, because the file we create +# can be either `sometool' (if it is a script) or `sometool$(exeext)' +# (if it is a hard link). +stamp-as: $(ORIGINAL_AS_FOR_TARGET) + @echo creating as; \ + case "$(ORIGINAL_AS_FOR_TARGET)" in \ + ./as) ;; \ + ../*) \ + rm -f as$(exeext); \ + echo $(LN) $< as$(exeext); \ + $(LN) $< as$(exeext) || cp $< as$(exeext) ;; \ + *) \ + rm -f as; \ + echo '#!$(SHELL)' > as; \ + echo 'exec $(ORIGINAL_AS_FOR_TARGET) "$$@"' >> as ; \ + chmod +x as ;; \ + esac + echo timestamp > $@ + +stamp-collect-ld: $(ORIGINAL_LD_FOR_TARGET) + @echo creating collect-ld; \ + case "$(ORIGINAL_LD_FOR_TARGET)" in \ + ./collect-ld) ;; \ + ../*) \ + rm -f collect-ld$(exeext); \ + echo $(LN) $< collect-ld$(exeext); \ + $(LN) $< collect-ld$(exeext) || cp $< collect-ld$(exeext) ;; \ + *) \ + rm -f collect-ld$(exeext); \ + echo '#!$(SHELL)' > collect-ld; \ + echo 'exec $(ORIGINAL_LD_FOR_TARGET) "$$@"' >> collect-ld ; \ + chmod +x collect-ld ;; \ + esac + echo timestamp > $@ + +stamp-nm: $(ORIGINAL_NM_FOR_TARGET) + @echo creating nm; \ + case "$(ORIGINAL_NM_FOR_TARGET)" in \ + ./nm) ;; \ + ../*) \ + rm -f nm$(exeext); \ + echo $(LN) $< nm$(exeext); \ + $(LN) $< nm$(exeext) || cp $< nm$(exeext) ;; \ + *) \ + rm -f nm$(exeext); \ + echo '#!$(SHELL)' > nm; \ + echo 'exec $(ORIGINAL_NM_FOR_TARGET) "$$@"' >> nm ; \ + chmod +x nm ;; \ + esac + echo timestamp > $@ # Dump a specs file to make -B./ read these specs over installed ones. $(SPECS): xgcc$(exeext) @@ -1128,12 +1384,23 @@ $(SPECS): xgcc$(exeext) # We do want to create an executable named `xgcc', so we can use it to # compile libgcc2.a. # Also create gcc-cross, so that install-common will install properly. -gcc-cross: xgcc$(exeext) +gcc-cross$(exeext): xgcc$(exeext) cp xgcc$(exeext) gcc-cross$(exeext) -cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \ - $(C_OBJS) $(BACKEND) $(LIBS) +dummy-checksum.o : dummy-checksum.c + +cc1-dummy$(exeext): $(C_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) dummy-checksum.o \ + $(BACKEND) $(LIBS) + +cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(build_exeext) + build/genchecksum$(build_exeext) cc1-dummy$(exeext) > $@ + +cc1-checksum.o : cc1-checksum.c + +cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) cc1-checksum.o \ + $(BACKEND) $(LIBS) # Build the version of limits.h that we will install. xlimits.h: glimits.h limitx.h limity.h @@ -1148,21 +1415,21 @@ xlimits.h: glimits.h limitx.h limity.h LIB2ADD = $(LIB2FUNCS_EXTRA) LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA) -LIB2ADD_SH = $(LIB2FUNCS_SHARED_EXTRA) -libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) $(LIB2ADD_SH) \ - xgcc$(exeext) specs +libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) specs \ + xgcc$(exeext) stamp-as stamp-collect-ld stamp-nm objext='$(objext)' \ LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \ LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \ + LIB2FUNCS_EXCLUDE='$(LIB2FUNCS_EXCLUDE)' \ LIBGCOV='$(LIBGCOV)' \ LIB2ADD='$(LIB2ADD)' \ LIB2ADD_ST='$(LIB2ADD_ST)' \ - LIB2ADD_SH='$(LIB2ADD_SH)' \ LIB2ADDEH='$(LIB2ADDEH)' \ LIB2ADDEHSTATIC='$(LIB2ADDEHSTATIC)' \ LIB2ADDEHSHARED='$(LIB2ADDEHSHARED)' \ LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \ + LIB2_SIDITI_CONV_FUNCS='$(LIB2_SIDITI_CONV_FUNCS)' \ LIBUNWIND='$(LIBUNWIND)' \ LIBUNWINDDEP='$(LIBUNWINDDEP)' \ SHLIBUNWIND_LINK='$(SHLIBUNWIND_LINK)' \ @@ -1174,6 +1441,14 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) $(LIB2ADD_SH DPBIT_FUNCS='$(DPBIT_FUNCS)' \ TPBIT='$(TPBIT)' \ TPBIT_FUNCS='$(TPBIT_FUNCS)' \ + DFP_ENABLE='$(DFP_ENABLE)' \ + DFP_CFLAGS='$(DFP_CFLAGS)' \ + D32PBIT='$(D32PBIT)' \ + D32PBIT_FUNCS='$(D32PBIT_FUNCS)' \ + D64PBIT='$(D64PBIT)' \ + D64PBIT_FUNCS='$(D64PBIT_FUNCS)' \ + D128PBIT='$(D128PBIT)' \ + D128PBIT_FUNCS='$(D128PBIT_FUNCS)' \ MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \ EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \ SHLIB_LINK='$(SHLIB_LINK)' \ @@ -1185,18 +1460,21 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) $(LIB2ADD_SH SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \ SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \ MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \ - mkinstalldirs='$(SHELL) $(srcdir)/mkinstalldirs' \ + ASM_HIDDEN_OP='$(ASM_HIDDEN_OP)' \ + GCC_FOR_TARGET='$(GCC_FOR_TARGET)' \ + mkinstalldirs='$(mkinstalldirs)' \ $(SHELL) mklibgcc > tmp-libgcc.mk mv tmp-libgcc.mk libgcc.mk # All the things that might cause us to want to recompile bits of libgcc. -LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \ +LIBGCC_DEPS = $(GCC_PASSES) stmp-int-hdrs $(STMP_FIXPROTO) \ libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \ - $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \ + $(MACHMODE_H) longlong.h gbl-ctors.h config.status $(srcdir)/libgcc2.h \ tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \ - $(LIB2ADD_ST) $(LIB2ADD_SH) $(LIB2ADDEH) $(LIB2ADDEHDEP) \ - $(EXTRA_PARTS) $(srcdir)/config/$(LIB1ASMSRC) \ - $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h + config/dfp-bit.h config/dfp-bit.c \ + $(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \ + $(srcdir)/config/$(LIB1ASMSRC) \ + $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h $(SFP_MACHINE) libgcov.a: libgcc.a; @true @@ -1229,7 +1507,7 @@ s-mlib: $(srcdir)/genmultilib Makefile $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \ > tmp-mlib.h; \ fi - $(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h + $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h $(STAMP) s-mlib # Build multiple copies of libgcc.a, one for each target switch. @@ -1247,33 +1525,33 @@ stmp-multilib: $(LIBGCC_DEPS) $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ - @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN \ + -c $(srcdir)/crtstuff.c -DCRT_BEGIN \ -o $(T)crtbegin$(objext) $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ - @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END \ + -c $(srcdir)/crtstuff.c -DCRT_END \ -o $(T)crtend$(objext) # These are versions of crtbegin and crtend for shared libraries. $(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \ - @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \ + -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \ -o $(T)crtbeginS$(objext) $(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \ - @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \ + -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \ -o $(T)crtendS$(objext) # This is a version of crtbegin for -static links. $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ - @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \ + -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \ -o $(T)crtbeginT$(objext) # Compile the start modules crt0.o and mcrt0.o that are linked with @@ -1296,60 +1574,62 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) # C language specific files. c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) flags.h $(DIAGNOSTIC_H) $(TM_P_H) -c-parse.o : c-parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) intl.h $(C_TREE_H) input.h flags.h toplev.h output.h $(CPPLIB_H) \ - varray.h gt-c-parse.h + $(C_TREE_H) $(FLAGS_H) $(DIAGNOSTIC_H) $(TM_P_H) +c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(GGC_H) $(TIMEVAR_H) $(C_TREE_H) input.h $(FLAGS_H) toplev.h output.h \ + $(CPPLIB_H) gt-c-parser.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H) \ + vec.h $(TARGET_H) srcextra: gcc.srcextra lang.srcextra -gcc.srcextra: c-parse.y c-parse.c gengtype-lex.c gengtype-yacc.c gengtype-yacc.h +gcc.srcextra: gengtype-lex.c gengtype-yacc.c gengtype-yacc.h -cp -p $^ $(srcdir) -c-parse.c: c-parse.y - -$(BISON) $(BISONFLAGS) -o $@ $< - -c-parse.y: c-parse.in - echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y - sed -e "/^@@ifobjc.*/,/^@@end_ifobjc.*/d" \ - -e "/^@@ifc.*/d" -e "/^@@end_ifc.*/d" $< >>tmp-c-parse.y - $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $@ - c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ - intl.h prefix.h coretypes.h $(TM_H) cppdefault.h + intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ + $(MACHMODE_H) c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) flags.h function.h output.h \ - $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) \ - opts.h c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h \ - $(LANGHOOKS_DEF_H) -c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \ - $(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H) + $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) $(FUNCTION_H) output.h \ + $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \ + opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \ + except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \ + $(DIAGNOSTIC_H) input.h langhooks.h $(TREE_GIMPLE_H) tree-mudflap.h \ + pointer-set.h +c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \ + $(RTL_H) toplev.h $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \ + $(TREE_GIMPLE_H) tree-iterator.h c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(C_PRETTY_PRINT_H) $(DIAGNOSTIC_H) \ - $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h + $(C_TREE_H) $(DIAGNOSTIC_H) \ + $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h \ + c-objc-common.h $(C_PRAGMA_H) c-common.def $(TREE_INLINE_H) stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ - $(GGC_H) $(C_COMMON_H) + $(C_COMMON_H) c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h c-incpath.h cppdefault.h \ - c-pragma.h input.h intl.h flags.h toplev.h output.h \ - $(CPPLIB_H) $(EXPR_H) $(TM_P_H) + $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) $(REAL_H) $(SPLAY_TREE_H) \ + $(C_PRAGMA_H) input.h intl.h $(FLAGS_H) toplev.h output.h \ + $(CPPLIB_H) $(TIMEVAR_H) $(TM_P_H) c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) cpphash.h $(TM_P_H) c-pragma.h -c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) $(C_TREE_H) \ - flags.h toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \ - langhooks.h $(GGC_H) $(TARGET_H) cgraph.h + $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(srcdir)/../libcpp/internal.h \ + $(C_PRAGMA_H) +c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \ + $(FUNCTION_H) $(FLAGS_H) toplev.h $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(VARRAY_H) \ + langhooks.h $(GGC_H) $(TARGET_H) $(C_PRETTY_PRINT_H) c-objc-common.h \ + tree-mudflap.h c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) flags.h toplev.h -c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - flags.h toplev.h $(C_COMMON_H) real.h -c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h -graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \ - $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h -sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - hard-reg-set.h $(BASIC_BLOCK_H) + $(C_TREE_H) $(FLAGS_H) toplev.h +c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) toplev.h $(C_COMMON_H) convert.h $(C_TREE_H) \ + langhooks.h $(TARGET_H) +c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FUNCTION_H) $(C_PRAGMA_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ + $(C_COMMON_H) $(TARGET_H) gt-c-pragma.h $(CPPLIB_H) $(FLAGS_H) +graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(FLAGS_H) output.h \ + $(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) +sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) COLLECT2_OBJS = collect2.o tlink.o intl.o version.o COLLECT2_LIBS = @COLLECT2_LIBS@ @@ -1359,9 +1639,9 @@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS) mv -f T$@ $@ -collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) gstab.h intl.h \ +collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h \ $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DTARGET_MACHINE=\"$(target_noncanonical)\" \ -c $(srcdir)/collect2.c $(OUTPUT_OPTION) @@ -1371,46 +1651,56 @@ tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h # A file used by all variants of C. c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(OBSTACK_H) $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h intl.h \ + $(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) toplev.h output.h $(C_PRAGMA_H) \ $(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \ - $(DIAGNOSTIC_H) gt-c-common.h langhooks.h varray.h $(RTL_H) \ - $(TARGET_H) $(C_TREE_H) -c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \ - $(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h + $(DIAGNOSTIC_H) gt-c-common.h langhooks.h $(VARRAY_H) $(RTL_H) \ + $(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \ + intl.h opts.h $(REAL_H) $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \ + $(BUILTINS_DEF) -c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - c-pragma.h flags.h toplev.h langhooks.h tree-inline.h $(DIAGNOSTIC_H) \ - intl.h debug.h $(C_COMMON_H) opts.h options.h $(PARAMS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ +c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \ + $(C_TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(REAL_H) \ + $(DIAGNOSTIC_H) tree-iterator.h + +c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h langhooks.h \ + $(TREE_INLINE_H) $(DIAGNOSTIC_H) intl.h debug.h $(C_COMMON_H) \ + opts.h options.h $(MKDEPS_H) c-incpath.h cppdefault.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@ c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(C_COMMON_H) c-pragma.h flags.h toplev.h langhooks.h \ - output.h except.h real.h $(TM_P_H) + $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h \ + output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) # A file used by all variants of C and some other languages. -attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \ - toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \ - builtin-types.def $(TARGET_H) langhooks.h +attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) $(TM_P_H) \ + $(TARGET_H) langhooks.h $(CPPLIB_H) c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \ - $(C_COMMON_H) flags.h toplev.h intl.h $(DIAGNOSTIC_H) + $(C_COMMON_H) $(FLAGS_H) toplev.h intl.h $(DIAGNOSTIC_H) c-format.h -c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \ - $(EXPR_H) $(PREDICT_H) tree-inline.h +c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) \ + $(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) except.h $(FUNCTION_H) \ + langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(TREE_GIMPLE_H) \ + $(VARRAY_H) c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) tree-dump.h + $(C_TREE_H) $(TREE_DUMP_H) c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \ - $(C_COMMON_H) output.h toplev.h c-pragma.h $(GGC_H) debug.h \ - langhooks.h flags.h hosthooks.h version.h $(TARGET_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(C_COMMON_H) output.h toplev.h $(C_PRAGMA_H) $(GGC_H) debug.h \ + langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DHOST_MACHINE=\"$(host)\" -DTARGET_MACHINE=\"$(target)\" \ $< $(OUTPUT_OPTION) +c-omp.o : c-omp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FUNCTION_H) $(C_COMMON_H) toplev.h $(TREE_GIMPLE_H) + # Language-independent files. DRIVER_DEFINES = \ @@ -1427,41 +1717,29 @@ DRIVER_DEFINES = \ `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \ - Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) + Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \ + configargs.h $(OBSTACK_H) opts.h (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(DRIVER_DEFINES) \ -c $(srcdir)/gcc.c $(OUTPUT_OPTION)) gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(DRIVER_DEFINES) \ -c $(srcdir)/gccspec.c $(OUTPUT_OPTION)) cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) -tree-check.h: s-check ; @true -s-check : gencheck$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./gencheck$(build_exeext) > tmp-check.h - $(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h - $(STAMP) s-check - -gencheck$(build_exeext) : gencheck.o $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - gencheck.o $(BUILD_LIBS) - -gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) $(lang_tree_files) - gencheck.h : s-gencheck ; @true s-gencheck : Makefile ltf="$(lang_tree_files)"; for f in $$ltf; do \ echo "#include \"$$f\""; \ done | sed 's|$(srcdir)/||' > tmp-gencheck.h - $(SHELL) $(srcdir)/move-if-change tmp-gencheck.h gencheck.h + $(SHELL) $(srcdir)/../move-if-change tmp-gencheck.h gencheck.h $(STAMP) s-gencheck specs.h : s-specs ; @true @@ -1469,425 +1747,926 @@ s-specs : Makefile lsf="$(lang_specs_files)"; for f in $$lsf; do \ echo "#include \"$$f\""; \ done | sed 's|$(srcdir)/||' > tmp-specs.h - $(SHELL) $(srcdir)/move-if-change tmp-specs.h specs.h + $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h $(STAMP) s-specs -options.c: $(lang_opt_files) $(srcdir)/opts.sh options.h intl.h +optionlist: s-options ; @true +s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk + $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist + $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist + $(STAMP) s-options -options.h: $(lang_opt_files) $(srcdir)/opts.sh Makefile - AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh \ - '$(SHELL) $(srcdir)/move-if-change' \ - options.c options.h $(lang_opt_files) +options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk + $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \ + -v header_name="config.h system.h coretypes.h tm.h" < $< > $@ + +options.h: s-options-h ; @true +s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk + $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opth-gen.awk \ + < $< > tmp-options.h + $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h + $(STAMP) $@ + +options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h + +gcc-options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(OUTPUT_OPTION) -DGCC_DRIVER options.c dumpvers: dumpvers.c -version.o: version.c version.h +version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) -gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h \ - $(HASHTAB_H) $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \ - libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \ - cselib.h insn-addr.h +gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ + $(FUNCTION_H) insn-config.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ + cselib.h insn-addr.h $(OPTABS_H) libfuncs.h debug.h $(GGC_H) \ + $(CGRAPH_H) $(TREE_FLOW_H) reload.h $(CPP_ID_DATA_H) ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ - $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h - -ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) + $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h $(HOSTHOOKS_DEF_H) ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) + $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H) -ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) +ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \ + $(PARAMS_H) bitmap.h $(VARRAY_H) + +ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ + $(BCONFIG_H) stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(GGC_H) gt-stringpool.h + $(TREE_H) $(GGC_H) gt-stringpool.h $(CPPLIB_H) $(SYMTAB_H) -ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) - -prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) Makefile prefix.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - -DPREFIX=\"$(prefix)\" \ +prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ + Makefile $(BASEVER) + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ + -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) \ -c $(srcdir)/prefix.c $(OUTPUT_OPTION) -convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \ - convert.h toplev.h langhooks.h +convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FLAGS_H) convert.h toplev.h langhooks.h $(REAL_H) -langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \ - tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \ - $(LANGHOOKS_DEF_H) flags.h $(GGC_H) gt-langhooks.h diagnostic.h -tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h function.h \ +double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) + +langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) toplev.h $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \ + langhooks.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) intl.h \ + $(TREE_GIMPLE_H) +tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \ toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \ - real.h gt-tree.h -tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \ - $(EXPR_H) $(SPLAY_TREE_H) tree-dump.h + $(REAL_H) gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + $(OBSTACK_H) pointer-set.h +tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \ + tree-iterator.h tree-pass.h $(DIAGNOSTIC_H) $(REAL_H) tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(RTL_H) $(EXPR_H) flags.h $(PARAMS_H) input.h insn-config.h \ - $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \ - langhooks.h $(C_COMMON_H) tree-inline.h cgraph.h intl.h -tree-optimize.o : tree-optimize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) toplev.h langhooks.h cgraph.h $(TIMEVAR_H) function.h $(GGC_H) - + $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h insn-config.h \ + $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \ + langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) intl.h $(FUNCTION_H) $(TREE_GIMPLE_H) \ + debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \ + ipa-prop.h print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) langhooks.h real.h -stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - flags.h function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \ + $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h +stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(RTL_H) \ + $(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \ + toplev.h +tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \ + $(SYSTEM_H) $(CONFIG_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \ + $(TM_H) coretypes.h $(CGRAPH_H) tree-pass.h $(TIMEVAR_H) \ + gt-tree-ssa-structalias.h $(PARAMS_H) +tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) bitmap.h \ + $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \ + $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) +tree-into-ssa.o : tree-into-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + langhooks.h domwalk.h tree-pass.h $(GGC_H) $(PARAMS_H) $(BASIC_BLOCK_H) \ + bitmap.h $(CFGLOOP_H) $(FLAGS_H) hard-reg-set.h $(HASHTAB_H) \ + $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) vecprim.h +tree-outof-ssa.o : tree-outof-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + langhooks.h tree-pass.h $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) bitmap.h \ + $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) $(TREE_GIMPLE_H) \ + $(TREE_INLINE_H) $(VARRAY_H) toplev.h vecprim.h +tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) \ + $(DIAGNOSTIC_H) $(TIMEVAR_H) +tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ langhooks.h -fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - flags.h real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h -diagnostic.o : diagnostic.c $(DIAGNOSTIC_H) real.h \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \ - input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H) +tree-ssa-phiopt.o : tree-ssa-phiopt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) langhooks.h $(FLAGS_H) \ + $(DIAGNOSTIC_H) $(TIMEVAR_H) +tree-nrv.o : tree-nrv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(RTL_H) $(FUNCTION_H) $(BASIC_BLOCK_H) $(EXPR_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TREE_DUMP_H) tree-pass.h \ + langhooks.h +tree-ssa-copy.o : tree-ssa-copy.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(BASIC_BLOCK_H) tree-pass.h langhooks.h tree-ssa-propagate.h $(FLAGS_H) +tree-ssa-propagate.o : tree-ssa-propagate.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \ + tree-ssa-propagate.h vec.h gt-tree-ssa-propagate.h $(FLAGS_H) $(VARRAY_H) +tree-ssa-dom.o : tree-ssa-dom.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(BASIC_BLOCK_H) domwalk.h tree-pass.h $(FLAGS_H) langhooks.h \ + tree-ssa-propagate.h $(CFGLOOP_H) $(PARAMS_H) $(REAL_H) +tree-ssa-uncprop.o : tree-ssa-uncprop.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) $(BASIC_BLOCK_H) domwalk.h tree-pass.h $(FLAGS_H) \ + langhooks.h tree-ssa-propagate.h $(REAL_H) +tree-ssa-threadedge.o : tree-ssa-threadedge.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h $(CFGLOOP_H) +tree-ssa-threadupdate.o : tree-ssa-threadupdate.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h $(CFGLOOP_H) +tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) gt-tree-ssanames.h $(TREE_FLOW_H) +tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + gt-tree-phinodes.h $(RTL_H) toplev.h +domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H) +tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \ + bitmap.h $(FLAGS_H) $(HASHTAB_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) \ + $(VARRAY_H) toplev.h vecprim.h +tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) tree-pass.h \ + $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \ + bitmap.h $(FLAGS_H) $(HASHTAB_H) langhooks.h $(TREE_GIMPLE_H) \ + $(TREE_INLINE_H) +tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \ + alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(HASHTAB_H) $(TREE_GIMPLE_H) \ + $(TREE_INLINE_H) tree-iterator.h +tree-vn.o : tree-vn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ + $(TREE_H) $(TREE_FLOW_H) $(HASHTAB_H) langhooks.h tree-pass.h \ + $(TREE_DUMP_H) $(DIAGNOSTIC_H) +tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(GGC_H) \ + $(BASIC_BLOCK_H) tree-ssa-propagate.h $(FLAGS_H) $(TREE_DUMP_H) \ + $(CFGLOOP_H) $(SCEV_H) tree-chrec.h $(TIMEVAR_H) toplev.h intl.h +tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ + $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) toplev.h \ + tree-ssa-propagate.h +tree-cfgcleanup.o : tree-cfgcleanup.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ + $(DIAGNOSTIC_H) toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ + $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) toplev.h \ + tree-ssa-propagate.h +rtl-factoring.o : rtl-factoring.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ + coretypes.h $(TM_H) $(BASIC_BLOCK_H) $(GGC_H) $(REGS_H) $(PARAMS_H) $(EXPR_H) \ + addresses.h $(TM_P_H) tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) output.h +tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(FUNCTION_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) $(DIAGNOSTIC_H) except.h tree-pass.h $(FLAGS_H) langhooks.h \ + $(BASIC_BLOCK_H) hard-reg-set.h +tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) alloc-pool.h \ + $(BASIC_BLOCK_H) bitmap.h $(CFGLOOP_H) $(FIBHEAP_H) $(HASHTAB_H) \ + langhooks.h $(REAL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) tree-iterator.h +tree-nested.o: tree-nested.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \ + $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(TREE_DUMP_H) $(TREE_INLINE_H) \ + tree-iterator.h $(TREE_GIMPLE_H) $(CGRAPH_H) $(EXPR_H) langhooks.h \ + $(GGC_H) gt-tree-nested.h coretypes.h $(TREE_FLOW_H) +tree-if-conv.o: tree-if-conv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + $(CFGLOOP_H) $(RTL_H) $(C_COMMON_H) tree-chrec.h $(TREE_DATA_REF_H) \ + $(SCEV_H) tree-pass.h $(DIAGNOSTIC_H) $(TARGET_H) $(TREE_DUMP_H) \ + $(VARRAY_H) +tree-iterator.o : tree-iterator.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + coretypes.h $(GGC_H) tree-iterator.h $(TREE_GIMPLE_H) gt-tree-iterator.h +tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + $(TREE_INLINE_H) $(HASHTAB_H) pointer-set.h $(FLAGS_H) $(FUNCTION_H) \ + $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h $(TREE_DUMP_H) \ + tree-pass.h $(PARAMS_H) $(CGRAPH_H) $(BASIC_BLOCK_H) hard-reg-set.h \ + $(TREE_GIMPLE_H) +tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TREE_INLINE_H) \ + $(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h toplev.h \ + gt-tree-ssa-operands.h coretypes.h langhooks.h $(IPA_REFERENCE_H) +tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) $(FUNCTION_H) except.h langhooks.h \ + $(GGC_H) tree-pass.h coretypes.h $(TIMEVAR_H) $(TM_P_H) \ + $(TREE_DUMP_H) $(TREE_INLINE_H) tree-iterator.h toplev.h +tree-ssa-loop.o : tree-ssa-loop.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(FLAGS_H) $(TREE_INLINE_H) $(SCEV_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h +tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) \ + $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ + domwalk.h $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h $(TREE_DUMP_H) tree-pass.h $(BASIC_BLOCK_H) hard-reg-set.h +tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(FLAGS_H) $(TREE_INLINE_H) $(RECOG_H) insn-config.h $(EXPR_H) \ + gt-tree-ssa-address.h $(GGC_H) +tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \ + $(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(FLAGS_H) tree-pass.h $(SCEV_H) $(TREE_DATA_REF_H) $(BASIC_BLOCK_H) \ + $(GGC_H) hard-reg-set.h tree-chrec.h intl.h +tree-ssa-loop-ivcanon.o : tree-ssa-loop-ivcanon.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \ + $(TREE_INLINE_H) output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(FLAGS_H) tree-pass.h $(SCEV_H) $(BASIC_BLOCK_H) $(GGC_H) hard-reg-set.h \ + tree-chrec.h +tree-ssa-loop-ch.o : tree-ssa-loop-ch.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(TREE_INLINE_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) hard-reg-set.h +tree-ssa-loop-prefetch.o: tree-ssa-loop-prefetch.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(EXPR_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \ + $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \ + tree-chrec.h toplev.h langhooks.h +tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(EXPR_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \ + $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \ + tree-chrec.h $(VARRAY_H) +tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \ + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(CFGLAYOUT_H) $(SCEV_H) $(BASIC_BLOCK_H) hard-reg-set.h \ + $(PARAMS_H) +tree-ssa-loop-im.o : tree-ssa-loop-im.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) domwalk.h \ + $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(REAL_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h +tree-ssa-math-opts.o : tree-ssa-math-opts.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(TIMEVAR_H) tree-pass.h $(TM_H) $(FLAGS_H) \ + alloc-pool.h $(BASIC_BLOCK_H) $(TARGET_H) +tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(TREE_INLINE_H) $(FLAGS_H) \ + $(FUNCTION_H) $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \ + $(TREE_DUMP_H) tree-pass.h $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ + hard-reg-set.h $(TREE_GIMPLE_H) vec.h tree-ssa-structalias.h \ + $(IPA_TYPE_ESCAPE_H) vecprim.h pointer-set.h +tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) tree-iterator.h\ + $(BASIC_BLOCK_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) vec.h \ + alloc-pool.h +tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \ + $(FUNCTION_H) langhooks.h $(FLAGS_H) $(CGRAPH_H) $(TREE_INLINE_H) \ + tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) \ + $(BASIC_BLOCK_H) graph.h hard-reg-set.h +c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \ + $(FLAGS_H) langhooks.h toplev.h $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \ + $(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h $(TREE_DUMP_H) $(TREE_INLINE_H) +gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ + $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \ + $(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) toplev.h $(OPTABS_H) \ + $(REAL_H) +gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \ + $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \ + $(HASHTAB_H) toplev.h +omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \ + $(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) toplev.h tree-pass.h \ + $(GGC_H) +tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \ + $(TREE_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ + $(TM_H) coretypes.h +tree-chrec.o: tree-chrec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(GGC_H) $(TREE_H) $(REAL_H) $(SCEV_H) tree-pass.h $(PARAMS_H) \ + $(DIAGNOSTIC_H) $(CFGLOOP_H) $(TREE_FLOW_H) +tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(REAL_H) $(RTL_H) \ + $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ + $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h +tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ + $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + $(TREE_DATA_REF_H) $(SCEV_H) tree-pass.h tree-chrec.h +tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) tree-chrec.h +tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-vectorizer.h $(TREE_DATA_REF_H) $(EXPR_H) $(TARGET_H) +tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(GGC_H) $(OPTABS_H) $(RECOG_H) $(TREE_H) $(RTL_H) \ + $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ + $(TIMEVAR_H) $(CFGLOOP_H) $(TARGET_H) tree-pass.h $(EXPR_H) \ + tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h toplev.h \ + tree-chrec.h +tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-pass.h $(EXPR_H) tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) \ + input.h $(TARGET_H) $(CFGLAYOUT_H) toplev.h tree-chrec.h +tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-pass.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) $(LAMBDA_H) \ + $(TARGET_H) tree-chrec.h +tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FUNCTION_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \ + tree-stdarg.h $(TARGET_H) langhooks.h +tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \ + tree-ssa-propagate.h +tree-gimple.o : tree-gimple.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(EXPR_H) \ + $(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h bitmap.h $(GGC_H) \ + output.h $(TREE_FLOW_H) +tree-mudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \ + $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) \ + gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h \ + $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) toplev.h +tree-nomudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \ + $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ + output.h $(VARRAY_H) langhooks.h tree-mudflap.h $(TM_H) coretypes.h \ + $(GGC_H) gt-tree-mudflap.h tree-pass.h toplev.h +tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \ + $(TREE_H) $(DIAGNOSTIC_H) $(REAL_H) $(HASHTAB_H) $(TREE_FLOW_H) \ + $(TM_H) coretypes.h tree-iterator.h tree-chrec.h langhooks.h tree-pass.h +fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) $(REAL_H) toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) \ + $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h +diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) input.h toplev.h intl.h \ + $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ - output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h -targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \ - output.h toplev.h + coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ + output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \ + $(FLAGS_H) $(PARAMS_H) tree-pass.h +opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h intl.h +targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ + $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h toplev.h \ + $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h -toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) \ - debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \ - dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ - graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ - $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ - langhooks.h insn-flags.h cfglayout.h real.h cfgloop.h \ - hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h $(COVERAGE_H) alloc-pool.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ +toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + version.h $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h \ + $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \ + $(RECOG_H) Makefile toplev.h dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \ + hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \ + value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ + langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \ + $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \ + $(CPPLIB_H) opts.h params.def tree-mudflap.h $(REAL_H) + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DTARGET_NAME=\"$(target_noncanonical)\" \ -c $(srcdir)/toplev.c $(OUTPUT_OPTION) + +passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h \ + $(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \ + dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ + graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ + $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ + langhooks.h insn-flags.h $(CFGLAYOUT_H) $(REAL_H) $(CFGLOOP_H) \ + hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h $(TREE_DUMP_H) \ + $(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h $(TREE_FLOW_H) $(TREE_INLINE_H) + main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - hosthooks.h hosthooks-def.h + hosthooks.h $(HOSTHOOKS_DEF_H) -rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(INSN_ATTR_H) \ - insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) $(CONFIG_H) +rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(INSN_ATTR_H) insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) \ + $(CONFIG_H) -rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) real.h \ - $(GGC_H) errors.h - $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) +rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(GGC_H) $(BCONFIG_H) insn-notes.def reg-notes.def toplev.h $(REAL_H) print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H) + $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(FLAGS_H) \ + $(BCONFIG_H) $(REAL_H) rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ - $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h \ - $(BASIC_BLOCK_H) + $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) $(REAL_H) \ + $(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) -errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h - $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) - -varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - flags.h function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \ - output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ - $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h -function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \ - insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \ - $(TM_P_H) langhooks.h gt-function.h $(TARGET_H) -stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \ - function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \ - $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \ - langhooks.h $(PREDICT_H) gt-stmt.h $(OPTABS_H) $(TARGET_H) +varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \ + output.h $(C_PRAGMA_H) toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ + $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \ + $(CFGLAYOUT_H) $(CGRAPH_H) tree-mudflap.h $(REAL_H) +function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \ + $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ + output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ + gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \ + tree-pass.h vecprim.h +stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) $(FUNCTION_H) insn-config.h hard-reg-set.h $(EXPR_H) \ + libfuncs.h except.h $(RECOG_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ + langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(MACHMODE_H) \ + $(REGS_H) except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \ + $(TREE_H) $(FLAGS_H) except.h $(FUNCTION_H) $(EXPR_H) libfuncs.h \ langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h cgraph.h -expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \ - function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h $(INSN_ATTR_H) insn-config.h \ - $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ - except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h $(TARGET_H) + gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ + $(TARGET_H) $(TM_P_H) tree-pass.h $(TIMEVAR_H) +expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \ + libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \ + typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h reload.h \ + $(GGC_H) langhooks.h intl.h $(TM_P_H) $(REAL_H) $(TARGET_H) \ + tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \ + tree-pass.h dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h function.h $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \ + $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \ langhooks.h $(GGC_H) gt-dojump.h -builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H)\ - flags.h $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \ - $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ - except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h -calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \ - $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ - libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) cgraph.h except.h +builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \ + $(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \ + hard-reg-set.h toplev.h hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \ + libfuncs.h $(REAL_H) langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \ + $(BUILTINS_DEF) $(MACHMODE_H) +calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ + libfuncs.h $(REGS_H) toplev.h output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \ + $(CGRAPH_H) except.h sbitmap.h expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \ + $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(REAL_H) \ toplev.h $(TM_P_H) langhooks.h explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ - toplev.h function.h $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h -optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \ - toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H) \ - $(TARGET_H) -dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - flags.h $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \ - insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \ - $(GGC_H) gt-dbxout.h + $(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ + toplev.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \ + $(TARGET_H) output.h +optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \ + $(RECOG_H) reload.h toplev.h $(GGC_H) $(REAL_H) $(TM_P_H) except.h \ + gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) $(FUNCTION_H) +dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) $(FUNCTION_H) \ + langhooks.h insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h \ + toplev.h $(GGC_H) $(OBSTACK_H) $(EXPR_H) gt-dbxout.h debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) -sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - flags.h function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \ - insn-config.h xcoffout.h c-pragma.h $(GGC_H) $(TARGET_H) \ - sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h -dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) dwarf2.h debug.h flags.h insn-config.h reload.h output.h $(DIAGNOSTIC_H) real.h \ - hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \ - $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \ - gt-dwarf2out.h $(TARGET_H) cgraph.h -dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) flags.h $(RTL_H) \ - $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) gt-dwarf2asm.h -vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) flags.h output.h vmsdbg.h debug.h langhooks.h function.h $(TARGET_H) -xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - xcoffout.h flags.h toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H) -emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \ - $(EXPR_H) $(OBSTACK_H) hard-reg-set.h bitmap.h toplev.h \ - $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h gt-emit-rtl.h -real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H) -integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \ - intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \ - $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h -jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \ - toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) \ - $(DIAGNOSTIC_H) - -simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H) +sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ + $(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \ + output.h toplev.h $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \ + gt-sdbout.h reload.h $(VARRAY_H) +dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \ + output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \ + libfuncs.h toplev.h dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \ + $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \ + $(MD5_H) input.h $(FUNCTION_H) $(VARRAY_H) +dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \ + gt-dwarf2asm.h dwarf2.h $(SPLAY_TREE_H) $(TARGET_H) +vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \ + $(RTL_H) $(FLAGS_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H) +xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) toplev.h output.h dbxout.h \ + $(GGC_H) $(TARGET_H) gstab.h xcoff.h +emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) insn-config.h $(RECOG_H) \ + $(GGC_H) $(EXPR_H) hard-reg-set.h bitmap.h toplev.h $(BASIC_BLOCK_H) \ + $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h tree-pass.h gt-emit-rtl.h \ + $(REAL_H) +real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + toplev.h $(TM_P_H) $(REAL_H) +dfp.o : dfp.c dfp.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + toplev.h $(TM_P_H) $(REAL_H) $(DECNUM_H) +integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \ + $(EXPR_H) $(REAL_H) $(REGS_H) intl.h $(FUNCTION_H) output.h $(RECOG_H) \ + except.h toplev.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \ + gt-integrate.h $(GGC_H) tree-pass.h +jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) \ + $(REAL_H) except.h $(FUNCTION_H) tree-pass.h $(DIAGNOSTIC_H) \ + toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) \ + $(TIMEVAR_H) $(TARGET_H) +simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h \ + $(RECOG_H) $(EXPR_H) toplev.h output.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) \ + $(TREE_H) $(TARGET_H) cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - langhooks.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h gt-cgraph.h \ - output.h intl.h -cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - langhooks.h tree-inline.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h intl.h \ - function.h -coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(GGC_H) $(TARGET_H) langhooks.h $(COVERAGE_H) libfuncs.h \ - gt-coverage.h $(HASHTAB_H) -cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h $(PARAMS_H) + langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \ + gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \ + $(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) +cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(FLAGS_H) $(GGC_H) \ + $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \ + $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \ + $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) ipa-prop.h \ + gt-cgraphunit.h +ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) +ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) ipa-prop.h \ + $(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) +ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + langhooks.h $(TARGET_H) $(CGRAPH_H) ipa-prop.h \ + $(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) $(DIAGNOSTIC_H) +ipa-inline.o : ipa-inline.c gt-ipa-inline.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \ + $(DIAGNOSTIC_H) $(FIBHEAP_H) $(PARAMS_H) $(TIMEVAR_H) tree-pass.h \ + $(COVERAGE_H) $(HASHTAB_H) +ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ + pointer-set.h $(GGC_H) $(C_COMMON_H) $(TREE_GIMPLE_H) \ + $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) +ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ + pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(C_COMMON_H) \ + $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) + +ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ + pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \ + $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) +ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ + pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(C_COMMON_H) \ + $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) + +coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ + $(FUNCTION_H) toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \ + $(HASHTAB_H) $(CGRAPH_H) tree-iterator.h +cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(RECOG_H) \ + $(EMIT_RTL_H) toplev.h output.h $(FUNCTION_H) cselib.h $(GGC_H) $(TM_P_H) \ + gt-cselib.h $(PARAMS_H) alloc-pool.h $(HASHTAB_H) $(TARGET_H) cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ - except.h $(TARGET_H) $(PARAMS_H) -web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h flags.h $(BASIC_BLOCK_H) function.h output.h toplev.h df.h -gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h flags.h real.h insn-config.h $(GGC_H) $(RECOG_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \ - except.h gt-gcse.h $(TREE_H) cselib.h -sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - function.h hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) -resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \ - $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \ - $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) + hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ + output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ + except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h tree-pass.h $(REAL_H) +web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ + $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h +see.o : see.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ + $(DF_H) $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h $(EXPR_H) +gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(GGC_H) \ + $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ + $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \ + intl.h $(OBSTACK_H) tree-pass.h +resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \ + coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) \ + $(FUNCTION_H) toplev.h $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h flags.h real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) $(TM_P_H) df.h function.h -df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \ - $(BASIC_BLOCK_H) df.h $(FIBHEAP_H) + hard-reg-set.h $(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(RECOG_H) \ + $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) output.h $(REAL_H) +mode-switching.o : mode-switching.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(INSN_ATTR_H) $(RECOG_H) $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) \ + output.h tree-pass.h $(TIMEVAR_H) $(REAL_H) +tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \ + $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H) $(CFGLOOP_H) \ + $(SCEV_H) +tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \ + $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \ + tree-ssa-propagate.h $(FLAGS_H) $(TARGET_H) toplev.h +tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \ + $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \ + $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \ + langhooks.h tree-pass.h $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) \ + bitmap.h $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(PARAMS_H) $(TARGET_H) +tree-complex.o : tree-complex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ + $(TM_H) $(RTL_H) $(REAL_H) $(FLAGS_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) \ + tree-iterator.h tree-pass.h tree-ssa-propagate.h $(DIAGNOSTIC_H) +tree-vect-generic.o : tree-vect-generic.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ + $(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \ + $(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \ + langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-vect-generic.h $(GGC_H) \ + coretypes.h insn-codes.h +df-core.o : df-core.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ + hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h \ + $(TM_P_H) $(FLAGS_H) output.h tree-pass.h +df-problems.o : df-problems.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ + hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h $(TM_P_H) \ + $(FLAGS_H) output.h vecprim.h +df-scan.o : df-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \ + hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h $(TM_P_H) \ + $(FLAGS_H) $(TARGET_H) $(TARGET_DEF_H) $(TREE_H) output.h tree-pass.h +var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \ + $(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H) \ + $(REGS_H) $(EXPR_H) $(TIMEVAR_H) tree-pass.h conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) \ $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_H) value-prof.h -value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h flags.h \ - $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) -loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \ - insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \ - real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \ - toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(GGC_H) -doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \ - cfgloop.h -unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \ - function.h $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \ - hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H) \ - cfgloop.h + $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) \ + toplev.h $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \ + $(CFGLOOP_H) $(TIMEVAR_H) tree-pass.h +tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ + $(FUNCTION_H) toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \ + tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h +value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \ + $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \ + $(TREE_H) $(COVERAGE_H) $(RTL_H) $(GCOV_IO_H) $(TREE_FLOW_H) \ + tree-flow-inline.h $(TIMEVAR_H) tree-pass.h +loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \ + toplev.h $(CFGLOOP_H) output.h $(PARAMS_H) $(TARGET_H) alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H) -flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(RECOG_H) function.h except.h $(EXPR_H) $(GGC_H) $(TM_P_H) -cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \ - $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h -cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(BASIC_BLOCK_H) cfglayout.h -cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) $(TM_P_H) insn-config.h $(EXPR_H) +flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ + hard-reg-set.h output.h toplev.h $(RECOG_H) $(FUNCTION_H) except.h \ + $(EXPR_H) $(TM_P_H) $(OBSTACK_H) $(SPLAY_TREE_H) $(TIMEVAR_H) tree-pass.h +cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ + $(REGS_H) hard-reg-set.h output.h toplev.h $(FUNCTION_H) except.h $(GGC_H) \ + $(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) alloc-pool.h $(HASHTAB_H) +cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) toplev.h +cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h $(TREE_DUMP_H) except.h langhooks.h tree-pass.h $(RTL_H) \ + $(DIAGNOSTIC_H) toplev.h $(BASIC_BLOCK_H) $(FLAGS_H) debug.h $(PARAMS_H) +cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ + output.h toplev.h $(FUNCTION_H) except.h $(TM_P_H) insn-config.h $(EXPR_H) \ + $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) \ + tree-pass.h cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H) -cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) + $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \ + $(TIMEVAR_H) $(OBSTACK_H) toplev.h +cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ + $(FUNCTION_H) except.h $(TIMEVAR_H) $(TREE_H) cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h \ - $(RECOG_H) toplev.h $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) \ - $(PARAMS_H) + $(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ + toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ + $(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) tree-pass.h $(CFGLOOP_H) $(EXPR_H) cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) $(FUNCTION_H) \ + $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h $(EXPR_H) coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \ + $(OBSTACK_H) output.h +struct-equiv.o : struct-equiv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ + insn-config.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ + $(REGS_H) $(EMIT_RTL_H) +loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \ + output.h intl.h $(DF_H) $(HASHTAB_H) +loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h \ + $(TM_H) $(TM_P_H) $(FUNCTION_H) $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h \ + $(HASHTAB_H) except.h cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h output.h coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \ + coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h \ - coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \ + coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H) loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ + output.h $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ + output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) \ + $(OBSTACK_H) dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h -et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h -combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H) \ - $(TREE_H) $(TARGET_H) $(PARAMS_H) + hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h $(OBSTACK_H) toplev.h $(TIMEVAR_H) +et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + et-forest.h alloc-pool.h $(BASIC_BLOCK_H) +combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(FUNCTION_H) insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \ + rtlhooks-def.h $(BASIC_BLOCK_H) $(RECOG_H) $(REAL_H) hard-reg-set.h \ + toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \ + insn-codes.h $(TIMEVAR_H) tree-pass.h regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \ - real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) -local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ - output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H) -bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) flags.h \ - $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H) - $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) -global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - reload.h function.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h \ - toplev.h $(TM_P_H) -varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h -ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h \ - $(RECOG_H) $(INTEGRATE_H) function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \ - $(BASIC_BLOCK_H) df.h $(EXPR_H) output.h toplev.h flags.h reload.h ra.h -ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) \ - insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \ - $(BASIC_BLOCK_H) df.h output.h $(GGC_H) ra.h gt-ra-build.h reload.h -ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h -ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h \ - ra.h $(TM_P_H) -ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h $(EXPR_H) \ - output.h except.h ra.h reload.h insn-config.h -reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h output.h \ - $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \ - $(REGS_H) function.h real.h toplev.h $(TM_P_H) $(PARAMS_H) -reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \ - $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ - $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \ - except.h $(TREE_H) -postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \ - $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ - $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \ - except.h $(TREE_H) -caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \ - $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H) -bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(BASIC_BLOCK_H) $(RTL_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) $(TM_P_H) \ - $(FIBHEAP_H) output.h $(TARGET_H) $(EXPR_H) flags.h $(INSN_ATTR_H) -reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \ - $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) -alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \ - $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \ - gt-alias.h $(TIMEVAR_H) cgraph.h -regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \ - $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \ - $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h -haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) -sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H) -sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) -sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(PARAMS_H) -sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - sched-int.h hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \ - $(TARGET_H) real.h -final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h intl.h $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) \ - function.h real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \ - toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) \ - $(EXPR_H) -recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \ - $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \ - $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H) -reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \ - varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h -sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h -predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H) $(PREDICT_H) sreal.h \ - $(PARAMS_H) $(TARGET_H) cfgloop.h $(COVERAGE_H) -lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) $(GGC_H) -bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(BASIC_BLOCK_H) flags.h timevar.h output.h cfglayout.h $(FIBHEAP_H) \ + hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ + $(RECOG_H) reload.h $(REAL_H) toplev.h $(FUNCTION_H) output.h $(GGC_H) \ + $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-regclass.h $(HASHTAB_H) \ $(TARGET_H) -tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h timevar.h \ - $(PARAMS_H) $(COVERAGE_H) +local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ + output.h $(FUNCTION_H) $(INSN_ATTR_H) toplev.h except.h reload.h $(TM_P_H) \ + $(GGC_H) $(INTEGRATE_H) $(TIMEVAR_H) tree-pass.h +bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(GGC_H) gt-bitmap.h bitmap.h $(OBSTACK_H) +global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) reload.h $(FUNCTION_H) $(RECOG_H) $(REGS_H) hard-reg-set.h \ + insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) tree-pass.h \ + $(TIMEVAR_H) vecprim.h +varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ + $(HASHTAB_H) $(BCONFIG_H) $(VARRAY_H) toplev.h +vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) coretypes.h vec.h $(GGC_H) \ + toplev.h +reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \ + hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) toplev.h \ + addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(REAL_H) +reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ + $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) toplev.h $(TM_P_H) \ + addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \ + $(OBSTACK_H) $(TARGET_H) +rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + rtlhooks-def.h $(EXPR_H) $(RECOG_H) +postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(REAL_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \ + hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \ + $(FUNCTION_H) toplev.h cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \ + $(OBSTACK_H) $(TIMEVAR_H) tree-pass.h +postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) output.h toplev.h \ + $(TM_P_H) except.h $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \ + $(PARAMS_H) $(TIMEVAR_H) tree-pass.h $(REAL_H) +caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \ + addresses.h $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H) +bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \ + $(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \ + $(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h toplev.h +reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ + $(INSN_ATTR_H) except.h $(RECOG_H) $(FUNCTION_H) $(FLAGS_H) output.h \ + $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) \ + $(TIMEVAR_H) $(TARGET_H) tree-pass.h +alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h \ + $(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) $(FUNCTION_H) cselib.h $(TREE_H) $(TM_P_H) \ + langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \ + $(SPLAY_TREE_H) $(VARRAY_H) $(IPA_TYPE_ESCAPE_H) tree-pass.h +regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + insn-config.h $(TIMEVAR_H) tree-pass.h \ + $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \ + $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h +ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \ + toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) bitmap.h $(DF_H) \ + hard-reg-set.h sbitmap.h $(TM_H) +modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TARGET_H) toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \ + cfghooks.h $(DF_H) $(GCOV_IO_H) hard-reg-set.h $(TM_H) $(TIMEVAR_H) \ + tree-pass.h +haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \ + $(TARGET_H) output.h $(PARAMS_H) +sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h \ + $(PARAMS_H) $(TM_P_H) $(DF_H) +sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ + $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) $(TIMEVAR_H) tree-pass.h +sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + $(FUNCTION_H) $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \ + $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) output.h +sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) \ + $(TM_P_H) $(REAL_H) toplev.h tree-pass.h +final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \ + insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \ + except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \ + $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \ + $(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) +recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \ + addresses.h $(TM_P_H) $(TIMEVAR_H) tree-pass.h hard-reg-set.h $(REAL_H) +reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \ + insn-config.h toplev.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \ + $(BASIC_BLOCK_H) output.h $(VARRAY_H) $(TIMEVAR_H) tree-pass.h \ + $(TARGET_H) vecprim.h +sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h +predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ + hard-reg-set.h output.h toplev.h $(RECOG_H) $(FUNCTION_H) except.h \ + $(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \ + $(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \ + $(TREE_FLOW_H) tree-pass.h $(EXPR_H) +lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ + $(RTL_H) $(GGC_H) gt-lists.h +bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \ + $(TARGET_H) $(FUNCTION_H) $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) \ + $(PARAMS_H) toplev.h tree-pass.h +tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \ + $(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) \ + tree-pass.h cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \ - function.h cfglayout.h cfgloop.h $(TARGET_H) gt-cfglayout.h $(GGC_H) -timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \ - intl.h toplev.h -regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \ - resource.h $(OBSTACK_H) flags.h $(TM_P_H) + $(FUNCTION_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \ + $(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) tree-pass.h vecprim.h +timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TIMEVAR_H) $(FLAGS_H) intl.h toplev.h $(RTL_H) timevar.def +regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ + output.h $(RECOG_H) $(FUNCTION_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \ + addresses.h reload.h toplev.h $(TIMEVAR_H) tree-pass.h ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) toplev.h flags.h insn-config.h function.h $(RECOG_H) $(TARGET_H) \ - $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h $(OPTABS_H) \ - cfgloop.h + $(REGS_H) toplev.h $(FLAGS_H) insn-config.h $(FUNCTION_H) $(RECOG_H) \ + $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \ + $(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h +lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ + $(TM_H) coretypes.h $(TREE_H) +lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ + $(TM_H) coretypes.h $(TARGET_H) $(TREE_H) +lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ + $(TM_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) coretypes.h $(TARGET_H) \ + tree-chrec.h tree-pass.h vec.h vecprim.h params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h +pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H) hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H) -pretty-print.o: $(CONFIG_H) $(SYSTEM_H) pretty-print.c $(PRETTY_PRINT_H) +pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H) \ + $(TREE_H) +errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H) -$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ +$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \ output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \ - $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H) \ - langhooks.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \ + langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(out_file) $(OUTPUT_OPTION) # Build auxiliary files that support ecoff format. mips-tfile: mips-tfile.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) -mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h +mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) version.h $(srcdir)/../include/getopt.h gstab.h intl.h mips-tdump: mips-tdump.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) -mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h +mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) version.h $(srcdir)/../include/getopt.h stab.def # FIXME: writing proper dependencies for this is a *LOT* of work. libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ insn-config.h insn-flags.h insn-codes.h insn-constants.h \ - insn-attr.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DTARGET_NAME=\"$(target_noncanonical)\" \ -DLOCALEDIR=\"$(localedir)\" \ - -c $(filter %.c,$^) -o $@ + -c $(filter %.c,$^) -o $@ \ + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DDEVPHASE=$(DEVPHASE_s) -combine # # Generate header and source files from the machine description, @@ -1895,205 +2674,204 @@ libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \ insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \ - insn-attr.h insn-attrtab.c + insn-attr.h insn-attrtab.c insn-preds.c -# The following pair of rules has this effect: -# genconfig is run only if the md has changed since genconfig was last run; -# but the file insn-config.h is touched only when its contents actually change. +# Dependencies for the md file. The first time through, we just assume +# the md file itself and the generated dependency file (in order to get +# it built). The second time through we have the dependency file. +-include mddeps.mk +MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES) -# Each of the other insn-* files is handled by a similar pair of rules. +s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext) + $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps + $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk + $(STAMP) s-mddeps -# This causes an anomaly in the results of make -n -# because insn-* is older than s-* -# and thus make -n thinks that insn-* will be updated -# and force recompilation of things that depend on it. -# We use move-if-change precisely to avoid such recompilation. -# But there is no way to teach make -n that it will be avoided. +# Header dependencies for generated source files. +genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)\ + $(GGC_H) +insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \ + insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H) +insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) $(REAL_H) output.h $(INSN_ATTR_H) \ + insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H) +insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(EXPR_H) $(REAL_H) output.h insn-config.h $(OPTABS_H) \ + reload.h $(RECOG_H) toplev.h $(FUNCTION_H) $(FLAGS_H) hard-reg-set.h \ + $(RESOURCE_H) $(TM_P_H) $(BASIC_BLOCK_H) tm-constrs.h +insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) toplev.h insn-config.h $(RECOG_H) +insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(MACHMODE_H) $(REAL_H) +insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) insn-config.h $(FLAGS_H) $(RECOG_H) $(EXPR_H) \ + $(OPTABS_H) reload.h +insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(GGC_H) $(REGS_H) $(REAL_H) conditions.h \ + hard-reg-set.h insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h \ + $(RECOG_H) $(FUNCTION_H) toplev.h $(FLAGS_H) insn-codes.h $(TM_P_H) \ + $(TARGET_H) tm-constrs.h +insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(REGS_H) output.h insn-config.h $(RECOG_H) except.h \ + $(FUNCTION_H) $(TM_P_H) $(REAL_H) tm-constrs.h +insn-preds.o : insn-preds.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(TREE_H) insn-config.h $(RECOG_H) output.h \ + $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) \ + toplev.h reload.h $(REGS_H) $(REAL_H) tm-constrs.h +insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) insn-config.h $(RECOG_H) output.h $(FLAGS_H) \ + $(FUNCTION_H) hard-reg-set.h $(RESOURCE_H) $(TM_P_H) toplev.h \ + reload.h $(REAL_H) tm-constrs.h -# Each of the insn-*.[ch] rules has a semicolon at the end, -# for otherwise the system Make on SunOS 4.1 never tries -# to recompile insn-*.o. To avoid problems and extra noise from -# versions of make which don't like empty commands (nothing after the -# trailing `;'), we call true for each. +# For each of the files generated by running a generator program over +# the machine description, the following pair of static pattern rules +# runs the generator program only if the machine description has changed, +# but touches the target file only when its contents actually change. +# The "; @true" construct forces Make to recheck the timestamp on the +# target file. -insn-config.h: s-config ; @true -s-config : $(md_file) genconfig$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genconfig$(build_exeext) $(md_file) > tmp-config.h - $(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h - $(STAMP) s-config +simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h -insn-conditions.c: s-conditions ; @true -s-conditions : $(md_file) genconditions$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genconditions$(build_exeext) $(md_file) > tmp-conditions.c - $(SHELL) $(srcdir)/move-if-change tmp-conditions.c insn-conditions.c - $(STAMP) s-conditions +simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \ + insn-extract.c insn-opinit.c insn-output.c \ + insn-peep.c insn-recog.c -insn-conditions.o : insn-conditions.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_H) $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h \ - flags.h hard-reg-set.h resource.h toplev.h reload.h gensupport.h \ - insn-constants.h - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) insn-conditions.c +$(simple_generated_h): insn-%.h: s-%; @true -dummy-conditions.o : dummy-conditions.c $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) gensupport.h +$(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext) \ + $(MD_DEPS) insn-conditions.md + $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \ + insn-conditions.md > tmp-$*.h + $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h + $(STAMP) s-$* -insn-flags.h: s-flags ; @true -s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genflags$(build_exeext) $(md_file) > tmp-flags.h - $(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h - $(STAMP) s-flags +$(simple_generated_c): insn-%.c: s-%; @true +$(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext) \ + $(MD_DEPS) insn-conditions.md + $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \ + insn-conditions.md > tmp-$*.c + $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c + $(STAMP) s-$* -insn-codes.h: s-codes ; @true -s-codes : $(md_file) gencodes$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./gencodes$(build_exeext) $(md_file) > tmp-codes.h - $(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h - $(STAMP) s-codes - -insn-constants.h: s-constants ; @true -s-constants : $(md_file) genconstants$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genconstants$(build_exeext) $(md_file) > tmp-constants.h - $(SHELL) $(srcdir)/move-if-change tmp-constants.h insn-constants.h +# genconstants needs to run before insn-conditions.md is available +# (because the constants may be used in the conditions). +insn-constants.h: s-constants; @true +s-constants: build/genconstants$(build_exeext) $(MD_DEPS) + $(RUN_GEN) build/genconstants$(build_exeext) $(md_file) \ + > tmp-constants.h + $(SHELL) $(srcdir)/../move-if-change tmp-constants.h insn-constants.h $(STAMP) s-constants -insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(EXPR_H) real.h output.h insn-config.h $(OPTABS_H) reload.h \ - $(RECOG_H) toplev.h function.h flags.h hard-reg-set.h resource.h $(TM_P_H) - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c \ - $(OUTPUT_OPTION) +# gencheck doesn't read the machine description, and the file produced +# doesn't use the insn-* convention. +tree-check.h: s-check ; @true +s-check : build/gencheck$(build_exeext) + $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h + $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h + $(STAMP) s-check -insn-emit.c: s-emit ; @true -s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genemit$(build_exeext) $(md_file) > tmp-emit.c - $(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c - $(STAMP) s-emit +# gencondmd doesn't use the standard naming convention. +build/gencondmd.c: s-conditions; @true +s-conditions: $(MD_DEPS) build/genconditions$(build_exeext) + $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c + $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.c + $(STAMP) s-conditions -insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) insn-config.h $(RECOG_H) real.h output.h flags.h function.h \ - hard-reg-set.h resource.h $(TM_P_H) toplev.h reload.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c \ - $(OUTPUT_OPTION) +insn-conditions.md: s-condmd; @true +s-condmd: build/gencondmd$(build_exeext) + $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md + $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md + $(STAMP) s-condmd -insn-recog.c: s-recog ; @true -s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genrecog$(build_exeext) $(md_file) > tmp-recog.c - $(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c - $(STAMP) s-recog -insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c \ - $(OUTPUT_OPTION) +# These files are generated by running the same generator more than +# once with different options, so they have custom rules. The +# stampfile idiom is the same. +genrtl.c: s-genrtl; @true +genrtl.h: s-genrtl-h; @true -insn-opinit.c: s-opinit ; @true -s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genopinit$(build_exeext) $(md_file) > tmp-opinit.c - $(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c - $(STAMP) s-opinit - -insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) toplev.h insn-config.h $(RECOG_H) - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c \ - $(OUTPUT_OPTION) - -insn-extract.c: s-extract ; @true -s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genextract$(build_exeext) $(md_file) > tmp-extract.c - $(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c - $(STAMP) s-extract - -insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) output.h real.h insn-config.h $(RECOG_H) except.h \ - function.h $(TM_P_H) - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c \ - $(OUTPUT_OPTION) - -insn-peep.c: s-peep ; @true -s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genpeep$(build_exeext) $(md_file) > tmp-peep.c - $(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c - $(STAMP) s-peep - -insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) real.h output.h $(INSN_ATTR_H) insn-config.h toplev.h \ - $(RECOG_H) $(TM_P_H) flags.h - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c \ - $(OUTPUT_OPTION) - -insn-attr.h: s-attr ; @true -s-attr : $(md_file) genattr$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genattr$(build_exeext) $(md_file) > tmp-attr.h - $(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h - $(STAMP) s-attr - -insn-attrtab.c: s-attrtab ; @true -s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genattrtab$(build_exeext) $(md_file) > tmp-attrtab.c - $(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c - $(STAMP) s-attrtab - -insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(GGC_H) $(REGS_H) real.h conditions.h hard-reg-set.h \ - insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h $(RECOG_H) function.h \ - toplev.h flags.h insn-codes.h $(TM_P_H) $(TARGET_H) - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c \ - $(OUTPUT_OPTION) - -insn-output.c: s-output ; @true -s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genoutput$(build_exeext) $(md_file) > tmp-output.c - $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c - $(STAMP) s-output - -genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(GGC_H) -genrtl.c genrtl.h : s-genrtl - @true # force gnu make to recheck modification times. - -s-genrtl: gengenrtl$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./gengenrtl$(build_exeext) -h > tmp-genrtl.h - $(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h - $(RUN_GEN) ./gengenrtl$(build_exeext) > tmp-genrtl.c - $(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c +s-genrtl: build/gengenrtl$(build_exeext) + $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.c + $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.c genrtl.c $(STAMP) s-genrtl -insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(MACHMODE_H) real.h -min-insn-modes.c insn-modes.c insn-modes.h : s-modes ; @true +s-genrtl-h: build/gengenrtl$(build_exeext) + $(RUN_GEN) build/gengenrtl$(build_exeext) -h > tmp-genrtl.h + $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h + $(STAMP) s-genrtl-h -s-modes: genmodes$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genmodes$(build_exeext) -h > tmp-modes.h - $(SHELL) $(srcdir)/move-if-change tmp-modes.h insn-modes.h - $(RUN_GEN) ./genmodes$(build_exeext) -m > tmp-min-modes.c - $(SHELL) $(srcdir)/move-if-change tmp-min-modes.c min-insn-modes.c - $(RUN_GEN) ./genmodes$(build_exeext) > tmp-modes.c - $(SHELL) $(srcdir)/move-if-change tmp-modes.c insn-modes.c +insn-modes.c: s-modes; @true +insn-modes.h: s-modes-h; @true +min-insn-modes.c: s-modes-m; @true + +s-modes: build/genmodes$(build_exeext) + $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c + $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c $(STAMP) s-modes -tm-preds.h: s-preds; @true +s-modes-h: build/genmodes$(build_exeext) + $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h + $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h + $(STAMP) s-modes-h -s-preds: genpreds$(build_exeext) $(srcdir)/move-if-change - $(RUN_GEN) ./genpreds$(build_exeext) > tmp-preds.h - $(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h +s-modes-m: build/genmodes$(build_exeext) + $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c + $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c + $(STAMP) s-modes-m + +insn-preds.c: s-preds; @true +tm-preds.h: s-preds-h; @true +tm-constrs.h: s-constrs-h; @true + +s-preds: $(MD_DEPS) build/genpreds$(build_exeext) + $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c + $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.c $(STAMP) s-preds -GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \ - $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \ - $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \ - $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \ - $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h \ +s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext) + $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h + $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h + $(STAMP) s-preds-h + +s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext) + $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h + $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h + $(STAMP) s-constrs-h + +GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \ + $(CPP_ID_DATA_H) $(host_xm_file_list) \ + $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \ + $(srcdir)/coverage.c $(srcdir)/rtl.h \ + $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/function.h $(srcdir)/libfuncs.h $(SYMTAB_H) \ + $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \ + $(srcdir)/ipa-reference.h $(srcdir)/output.h \ $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \ - $(srcdir)/c-common.h $(srcdir)/c-tree.h \ + $(srcdir)/c-common.h $(srcdir)/c-tree.h $(srcdir)/reload.h \ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \ + $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c \ $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \ - $(srcdir)/dojump.c \ + $(srcdir)/dojump.c $(srcdir)/tree-profile.c \ $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \ - $(srcdir)/fold-const.c $(srcdir)/function.c \ + $(srcdir)/function.c $(srcdir)/except.h \ $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \ - $(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \ - $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/langhooks.c \ - $(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \ + $(srcdir)/profile.c $(srcdir)/regclass.c \ + $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \ + $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \ $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \ - $(out_file) \ + $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \ + $(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parser.c \ + $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \ + $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \ + $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \ + $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \ + $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \ + $(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \ + $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \ + $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \ + $(srcdir)/tree-ssa-structalias.c \ + $(srcdir)/c-pragma.h $(srcdir)/omp-low.c \ + $(srcdir)/targhooks.c $(srcdir)/cgraphunit.c $(out_file) \ @all_gtfiles@ GTFILES_FILES_LANGS = @all_gtfiles_files_langs@ @@ -2101,241 +2879,182 @@ GTFILES_FILES_FILES = @all_gtfiles_files_files@ GTFILES_LANG_DIR_NAMES = @subdirs@ GTFILES_SRCDIR = @srcdir@ -gt-cgraph.h gt-coverage.h gtype-desc.h gtype-desc.c gt-except.h \ -gt-function.h gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h \ -gt-emit-rtl.h gt-explow.h gt-stor-layout.h gt-regclass.h \ -gt-lists.h gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h \ -gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \ -gt-dwarf2out.h gt-ra-build.h gt-reg-stack.h gt-dwarf2asm.h \ -gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \ -gt-c-pragma.h gtype-c.h gt-input.h gt-cfglayout.h \ -gt-stringpool.h gt-langhooks.h : s-gtype ; @true +GTFILES_FILES_FILES_C = $(subst $(srcdir)/,, \ + $(filter %.c, $(GTFILES_FILES_FILES))) +GTFILES_FILES_FILES_H = $(addprefix gt-, \ + $(subst /,-,$(GTFILES_FILES_FILES_C:.c=.h))) +GTFILES_LANG_DIR_NAMES_H = $(foreach d,$(GTFILES_LANG_DIR_NAMES), gtype-$(d).h) +ALL_GTFILES_H := $(sort $(GTFILES_FILES_FILES_H) $(GTFILES_LANG_DIR_NAMES_H)) -gtyp-gen.h: Makefile +$(ALL_GTFILES_H) : s-gtype ; @true + + +gt-cgraph.h gt-coverage.h gtype-desc.h gtype-desc.c gt-except.h \ +gt-function.h gt-integrate.h gt-tree.h gt-varasm.h \ +gt-emit-rtl.h gt-explow.h gt-stor-layout.h gt-regclass.h \ +gt-lists.h gt-alias.h gt-cselib.h gt-gcse.h \ +gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \ +gt-dwarf2out.h gt-dwarf2asm.h \ +gt-dbxout.h \ +gtype-c.h gt-cfglayout.h \ +gt-tree-mudflap.h gt-tree-vect-generic.h \ +gt-tree-profile.h gt-tree-ssa-address.h \ +gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \ +gt-tree-phinodes.h gt-tree-nested.h \ +gt-tree-ssa-operands.h gt-tree-ssa-propagate.h \ +gt-tree-ssa-structalias.h gt-ipa-inline.h gt-cgraphunit.h \ +gt-stringpool.h gt-targhooks.h gt-omp-low.h : s-gtype ; @true + +define echo_quoted_to_gtyp + echo "\"$(gtyp)\", " >> tmp-gtyp.h + +endef + +gtyp-gen.h: s-gtyp-gen ; @true +s-gtyp-gen: Makefile echo "/* This file is machine generated. Do not edit. */" > tmp-gtyp.h echo "static const char *const srcdir = " >> tmp-gtyp.h echo "\"$(GTFILES_SRCDIR)\"" >> tmp-gtyp.h echo ";" >> tmp-gtyp.h echo "static const char *const lang_files[] = {" >> tmp-gtyp.h - ll="$(GTFILES_FILES_FILES)"; \ - for f in $$ll; do \ - echo "\"$$f\", "; done >> tmp-gtyp.h + $(foreach gtyp,$(GTFILES_FILES_FILES),$(echo_quoted_to_gtyp)) echo "NULL};" >> tmp-gtyp.h echo "static const char *const langs_for_lang_files[] = {" >> tmp-gtyp.h - ff="$(GTFILES_FILES_LANGS)"; \ - for f in $$ff; do \ - echo "\"$$f\", " ; done >> tmp-gtyp.h + $(foreach gtyp,$(GTFILES_FILES_LANGS),$(echo_quoted_to_gtyp)) echo "NULL};" >> tmp-gtyp.h echo "static const char *const all_files[] = {" >> tmp-gtyp.h - gf="$(GTFILES)"; \ - for f in $$gf; do \ - echo "\"$$f\", "; done >> tmp-gtyp.h + $(foreach gtyp,$(GTFILES),$(echo_quoted_to_gtyp)) echo " NULL};" >> tmp-gtyp.h echo "static const char *const lang_dir_names[] = { \"c\", " >> tmp-gtyp.h - gf="$(GTFILES_LANG_DIR_NAMES)"; \ - for l in $$gf; do \ - echo "\"$$l\", "; done >> tmp-gtyp.h + $(foreach gtyp,$(GTFILES_LANG_DIR_NAMES),$(echo_quoted_to_gtyp)) echo "NULL};" >> tmp-gtyp.h - $(SHELL) $(srcdir)/move-if-change tmp-gtyp.h gtyp-gen.h + $(SHELL) $(srcdir)/../move-if-change tmp-gtyp.h gtyp-gen.h + $(STAMP) s-gtyp-gen -s-gtype: gengtype$(build_exeext) $(GTFILES) - $(RUN_GEN) ./gengtype +s-gtype: build/gengtype$(build_exeext) $(GTFILES) + $(RUN_GEN) build/gengtype$(build_exeext) $(STAMP) s-gtype # +# How to compile object files to run on the build machine. + +build/%.o : # dependencies provided by explicit rule later + $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o $@ $< + +# Header dependencies for the programs that generate source code. +# These are library modules... +build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h +build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H) \ + gensupport.h +build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GGC_H) +build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \ + $(MACHMODE_H) +build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) $(RTL_BASE_H) +build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) gensupport.h +build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \ + $(RTL_H) $(REAL_H) $(GGC_H) errors.h +build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) $(TREE_H) coretypes.h vec.h \ + $(GGC_H) toplev.h +build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H) \ + $(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H) \ + $(RESOURCE_H) toplev.h reload.h except.h tm-constrs.h +# This pulls in tm-pred.h which contains inline functions wrapping up +# predicates from the back-end so those functions must be discarded. +# No big deal since gencondmd.c is a dummy file for non-GCC compilers. +build/gencondmd.o : \ + BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS)) + +# ...these are the programs themselves. +build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \ + $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \ + gensupport.h +build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \ + $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \ + $(HASHTAB_H) gensupport.h +build/gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(GTM_H) \ + $(SYSTEM_H) coretypes.h $(lang_tree_files) +build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H) +build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \ + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h +build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genconstants.o : genconstants.c $(RTL_BASE_H) $(BCONFIG_H) \ + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h +build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \ + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h vecprim.h +build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h +build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def +build/gengtype-lex.o : gengtype-lex.c gengtype.h gengtype-yacc.h \ + $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) vec.h +build/gengtype-yacc.o : gengtype-yacc.c gengtype.h $(BCONFIG_H) \ + $(SYSTEM_H) coretypes.h $(GTM_H) +build/gengtype.o : gengtype.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) gengtype.h gtyp-gen.h rtl.def insn-notes.def errors.h +build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) $(RTL_BASE_H) errors.h gensupport.h +build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \ + $(HASHTAB_H) machmode.def $(extra_modes_file) +build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h +build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h toplev.h +build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h $(OBSTACK_H) +build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ + coretypes.h $(GTM_H) errors.h gensupport.h + # Compile the programs that generate insn-* from the machine description. # They are compiled with $(CC_FOR_BUILD), and associated libraries, # since they need to run on this machine # even if GCC is being compiled to run on some other machine. -# $(CONFIG_H) is omitted from the deps of the gen*.o -# because these programs don't really depend on anything -# about the target machine. They do depend on config.h itself, -# since that describes the host machine. - -# The names of programs that run on the "build" machine. -genprognames=genconfig genflags gencodes genemit genopinit genrecog \ - genextract genpeep genattr genoutput - -# The names of the executable files for those programs. -genprogs=$(genprognames:%=%$(build_exeext)) - -# Object files used in those programs. -genobjs=$(genprognames:%=%.o) read-rtl.o gensupport.o genattrtab.o \ - genautomata.o gengenrtl.o genmodes.o genpreds.o gengtype.o \ - genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \ - gencheck.o dummy-conditions.o genconditions.o - -$(genprogs): %$(build_exeext): %.o $(BUILD_RTL) $(BUILD_SUPPORT) \ - $(BUILD_PRINT) $(BUILD_ERRORS) \ - $(BUILD_LIBDEPS) +# As a general rule... +build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS) $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - $< $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \ - $(BUILD_ERRORS) $(BUILD_LIBS) + $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS) -$(genobjs): %.o : %.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) +# All these programs use the MD reader ($(BUILD_RTL)). +genprogmd = attr attrtab automata codes conditions config constants emit \ + extract flags mddeps opinit output peep preds recog +$(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_RTL) $(BUILD_ERRORS) -read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \ - $(OBSTACK_H) $(HASHTAB_H) +# These programs need libs over and above what they get from the above list. +build/genautomata$(build_exeext) : BUILD_LIBS += -lm -gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \ - $(OBSTACK_H) errors.h $(HASHTAB_H) gensupport.h - -genconfig.o : genconfig.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -gencodes.o : gencodes.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT) \ - $(BUILD_ERRORS) $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - genconstants.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \ - $(BUILD_ERRORS) $(BUILD_LIBS) - -genconstants.o : genconstants.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ - errors.h - -genemit.o : genemit.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ - errors.h gensupport.h - -genopinit.o : genopinit.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -genrecog.o : genrecog.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -genextract.o : genextract.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) insn-config.h errors.h gensupport.h - -genpeep.o : genpeep.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ - errors.h gensupport.h - -genattr.o : genattr.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h \ - gensupport.h - -genattrtab$(build_exeext) : genattrtab.o genautomata.o \ - $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_VARRAY) \ - $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - genattrtab.o genautomata.o \ - $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) \ - $(BUILD_VARRAY) $(BUILD_LIBS) -lm - -genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h - -genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H) - -genoutput.o : genoutput.c $(RTL_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h - -gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - gengenrtl.o $(BUILD_LIBS) - -gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def - -genmodes$(build_exeext) : genmodes.o $(BUILD_ERRORS) $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - genmodes.o $(BUILD_ERRORS) $(BUILD_LIBS) - -genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h $(HASHTAB_H) \ - machmode.def $(extra_modes_file) - -genpreds$(build_exeext) : genpreds.o $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - genpreds.o $(BUILD_LIBS) - -genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) - -gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \ - $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS) - -gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ - real.h $(RTL_BASE_H) gtyp-gen.h - -gengtype-lex.o : gengtype-lex.c gengtype.h gengtype-yacc.h \ - $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \ - $< $(OUTPUT_OPTION) - -gengtype-yacc.o : gengtype-yacc.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) \ - coretypes.h $(GTM_H) - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \ - $< $(OUTPUT_OPTION) +# These programs are not linked with the MD reader. +build/gengenrtl$(build_exeext) : $(BUILD_ERRORS) +build/genmodes$(build_exeext) : $(BUILD_ERRORS) +build/gengtype$(build_exeext) : build/gengtype-lex.o \ + build/gengtype-yacc.o $(BUILD_ERRORS) +# Generated source files for gengtype. gengtype-lex.c : gengtype-lex.l -$(FLEX) $(FLEXFLAGS) -o$@ $< - -gengtype-yacc.c gengtype-yacc.h: gengtype-yacc.y - -$(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c $< - -genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \ - $(BUILD_RTL) $(BUILD_ERRORS) $(BUILD_LIBDEPS) - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ - genconditions.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \ - $(BUILD_ERRORS) $(BUILD_LIBS) - -genconditions.o : genconditions.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) errors.h - -# -# Compile the libraries to be used by gen*. -# If we are not cross-building, gen* use the same .o's that cc1 will use, -# and BUILD_PREFIX_1 is `loser-', just to ensure these rules don't conflict -# with the rules for rtl.o, etc. -$(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(RTL_H) \ - real.h $(GGC_H) errors.h - rm -f $(BUILD_PREFIX)rtl.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION) - -print-rtl1.o: $(srcdir)/print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ - $(GTM_H) $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) - rm -f print-rtl1.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION) - -$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \ - $(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H) - rm -f $(BUILD_PREFIX)bitmap.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION) - -$(BUILD_PREFIX_1)errors.o: errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h - rm -f $(BUILD_PREFIX)errors.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION) - -$(BUILD_PREFIX_1)varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) varray.h \ - $(RTL_H) $(GGC_H) $(TREE_H) bitmap.h errors.h - rm -f $(BUILD_PREFIX)varray.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/varray.c > \ - $(BUILD_PREFIX)varray.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \ - $(BUILD_PREFIX)varray.c $(OUTPUT_OPTION) - -$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(GGC_H) - rm -f $(BUILD_PREFIX)ggc-none.c - sed -e 's/config[.]h/bconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION) - -min-insn-modes.o: min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) $(MACHMODE_H) - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \ - min-insn-modes.c $(OUTPUT_OPTION) +# This is a pattern rule solely so that Make knows it need not run the +# command twice. The modifier to $@ ensures that Bison is asked to +# produce a .c file, whether or not Make decides it needs the .h file +# first. +gengtype-y%.c gengtype-y%.h: gengtype-y%.y + -$(BISON) $(BISONFLAGS) -d -o $(@:.h=.c) $< # # Remake internationalization support. intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DLOCALEDIR=\"$(localedir)\" \ -c $(srcdir)/intl.c $(OUTPUT_OPTION) @@ -2352,48 +3071,18 @@ PREPROCESSOR_DEFINES = \ -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ @TARGET_SYSTEM_ROOT_DEFINE@ -LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \ - cpphash.o cpperror.o cppinit.o cppcharset.o \ - hashtable.o line-map.o mkdeps.o cpppch.o - -LIBCPP_DEPS = $(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \ - $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H) - -# Most of the other archives built/used by this makefile are for -# targets. This one is strictly for the host. -libcpp.a: $(LIBCPP_OBJS) - -rm -rf libcpp.a - $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS) - -$(RANLIB) libcpp.a - -cppcharset.o: cppcharset.c $(LIBCPP_DEPS) cppucnid.h -cpperror.o: cpperror.c $(LIBCPP_DEPS) -cppexp.o: cppexp.c $(LIBCPP_DEPS) -cpplex.o: cpplex.c $(LIBCPP_DEPS) -cppmacro.o: cppmacro.c $(LIBCPP_DEPS) -cpplib.o: cpplib.c $(LIBCPP_DEPS) -cpphash.o: cpphash.c $(LIBCPP_DEPS) -cpptrad.o: cpptrad.c $(LIBCPP_DEPS) -cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h -cppinit.o: cppinit.c $(LIBCPP_DEPS) mkdeps.h -cpppch.o: cpppch.c $(LIBCPP_DEPS) mkdeps.h - cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ cppdefault.h Makefile - $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(PREPROCESSOR_DEFINES) \ -c $(srcdir)/cppdefault.c $(OUTPUT_OPTION) -mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h -hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H) -line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H) - # Note for the stamp targets, we run the program `true' instead of # having an empty command (nothing following the semicolon). proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X -PROTO_OBJS = intl.o version.o cppdefault.o +PROTO_OBJS = intl.o version.o cppdefault.o errors.o protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS) @@ -2402,18 +3091,18 @@ unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS) protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) Makefile version.h + coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(DRIVER_DEFINES) \ $(srcdir)/protoize.c $(OUTPUT_OPTION)) -unprotoize.o: protoize.c $(srcdir)/../include/getopt.h \ - $(CONFIG_H) $(SYSTEM_H) Makefile version.h +unprotoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) \ + $(SYSTEM_H) coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ - $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(DRIVER_DEFINES) \ $(srcdir)/protoize.c $(OUTPUT_OPTION)) @@ -2423,7 +3112,7 @@ SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \ -rm -f SYSCALLS.c tmp-SYSCALLS.s sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \ $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c - $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) \ -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c -rm -f SYSCALLS.c tmp-SYSCALLS.s @@ -2458,25 +3147,28 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES) -rm -f tmp-proto.[cs] tmp-proto$(objext) # gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c -gcov-iov.o: gcov-iov.c version.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) coretypes.h $(TM_H) - $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gcov-iov.c $(OUTPUT_OPTION) -gcov-iov$(build_exeext): gcov-iov.o - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) gcov-iov.o -o $@ +build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \ + $(SYSTEM_H) coretypes.h $(TM_H) + +build/gcov-iov$(build_exeext): build/gcov-iov.o + $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) build/gcov-iov.o -o $@ + gcov-iov.h: s-iov -s-iov: gcov-iov$(build_exeext) $(srcdir)/move-if-change - ./gcov-iov$(build_exeext) > tmp-gcov-iov.h - $(SHELL) $(srcdir)/move-if-change tmp-gcov-iov.h gcov-iov.h +s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE) + build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \ + > tmp-gcov-iov.h + $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h $(STAMP) s-iov -gcov.o: gcov.c gcov-io.h gcov-io.c gcov-iov.h intl.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) -gcov-dump.o: gcov-dump.c gcov-io.h gcov-io.c gcov-iov.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) +gcov.o: gcov.c gcov-io.c $(GCOV_IO_H) intl.h $(SYSTEM_H) coretypes.h $(TM_H) \ + $(CONFIG_H) version.h +gcov-dump.o: gcov-dump.c gcov-io.c $(GCOV_IO_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(CONFIG_H) -# Only one of 'gcov' or 'gcov.exe' is actually built, depending -# upon whether $(exeext) is empty or not. -GCOV_OBJS = gcov.o intl.o version.o +GCOV_OBJS = gcov.o intl.o version.o errors.o gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@ -GCOV_DUMP_OBJS = gcov-dump.o version.o +GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@ # @@ -2485,7 +3177,7 @@ gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS) # be rebuilt. # Build the include directory -stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h +stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h $(UNWIND_H) # Copy in the headers provided with gcc. # The sed command gets just the last file name component; # this is necessary because VPATH could add a dirname. @@ -2503,64 +3195,76 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h done rm -f include/limits.h cp xlimits.h include/limits.h + rm -f include/unwind.h + cp $(UNWIND_H) include/unwind.h chmod a+r include/limits.h # Install the README rm -f include/README - cp $(srcdir)/README-fixinc include/README + cp $(srcdir)/../fixincludes/README-fixinc include/README chmod a+r include/README $(STAMP) $@ -# fixinc.sh depends on this, not on specs directly. -# The idea is to make sure specs gets built, but not rerun fixinc.sh -# after each stage just because specs' mtime has changed. -specs.ready: specs - -if [ -f specs.ready ] ; then \ - true; \ - else \ - $(STAMP) specs.ready; \ - fi - -# Until someone fixes this recursive make nightmare (please note where -# BUILD_CFLAGS and WARN_CFLAGS are first expanded below versus which -# later make invocation has the fine-grain -warn markings for fixinc): -fixinc.sh-warn = -Wno-error - -FIXINCSRCDIR=$(srcdir)/fixinc -fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \ - $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/server.c \ - $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready - (MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD_COMMAND}` ; \ - CC="$(CC_FOR_BUILD)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \ - WARN_CFLAGS="$(WARN_CFLAGS)"; LIBERTY=`${PWD_COMMAND}`/"$(BUILD_LIBIBERTY)"; \ - export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS LIBERTY; \ - cd ./fixinc && \ - $(SHELL) $${srcdir}/mkfixinc.sh $(build) $(target)) - .PHONY: install-gcc-tooldir install-gcc-tooldir: - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(gcc_tooldir) + $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir) + +macro_list: s-macro_list; @true +s-macro_list : $(GCC_PASSES) + echo | $(GCC_FOR_TARGET) -E -dM - | \ + sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \ + -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \ + sort -u > tmp-macro_list + $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list + $(STAMP) s-macro_list + +# The line below is supposed to avoid accidentally matching the +# built-in suffix rule `.o:' to build fixincl out of fixincl.o. You'd +# expect fixincl to be newer than fixincl.o, such that this situation +# would never come up. As it turns out, if you use ccache with +# CCACHE_HARDLINK enabled, the compiler doesn't embed the current +# working directory in object files (-g absent, or -fno-working-dir +# present), and build and host are the same, fixincl for the host will +# build after fixincl for the build machine, getting a cache hit, +# thereby updating the timestamp of fixincl.o in the host tree. +# Because of CCACHE_HARDLINK, this will also update the timestamp in +# the build tree, and so fixincl in the build tree will appear to be +# out of date. Yuck. +../$(build_subdir)/fixincludes/fixincl: ; @ : # Build fixed copies of system files. -stmp-fixinc: fixinc.sh gsyslimits.h - @if test ! -d ${SYSTEM_HEADER_DIR}; then \ +# Abort if no system headers available, unless building a crosscompiler. +# FIXME: abort unless building --without-headers would be more accurate and less ugly +stmp-fixinc: gsyslimits.h macro_list \ + $(build_objdir)/fixincludes/fixincl \ + $(build_objdir)/fixincludes/fixinc.sh + @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \ echo The directory that should contain system headers does not exist: >&2 ; \ echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ - if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ + tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \ + if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \ then sleep 1; else exit 1; fi; \ fi rm -rf include; mkdir include -chmod a+rx include - (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ - SHELL='$(SHELL)' ;\ - export TARGET_MACHINE srcdir SHELL ; \ - $(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \ - rm -f include/syslimits.h; \ - if [ -f include/limits.h ]; then \ - mv include/limits.h include/syslimits.h; \ + if [ -d ../prev-gcc ]; then \ + cd ../prev-gcc && \ + $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \ + libsubdir=. ; \ else \ - cp $(srcdir)/gsyslimits.h include/syslimits.h; \ - fi; \ - chmod a+r include/syslimits.h) + (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ + SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \ + export TARGET_MACHINE srcdir SHELL MACRO_LIST && \ + cd $(build_objdir)/fixincludes && \ + $(SHELL) ./fixinc.sh ../../gcc/include \ + $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \ + rm -f include/syslimits.h; \ + if [ -f include/limits.h ]; then \ + mv include/limits.h include/syslimits.h; \ + else \ + cp $(srcdir)/gsyslimits.h include/syslimits.h; \ + fi; \ + fi + chmod a+r include/syslimits.h $(STAMP) stmp-fixinc # Files related to the fixproto script. @@ -2579,49 +3283,53 @@ deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs $(STAMP) deduced.h; \ fi -GEN_PROTOS_OBJS = gen-protos.o scan.o -gen-protos$(build_exeext): $(GEN_PROTOS_OBJS) +GEN_PROTOS_OBJS = build/gen-protos.o build/scan.o $(BUILD_ERRORS) +build/gen-protos$(build_exeext): $(GEN_PROTOS_OBJS) ${CC_FOR_BUILD} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ $(GEN_PROTOS_OBJS) $(BUILD_LIBS) -gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) +build/gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ + $(GTM_H) errors.h -scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) +build/scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) -xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile +xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h \ + build/gen-protos$(build_exeext) Makefile sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \ deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c mv tmp-fixtmp.c fixtmp.c $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \ | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \ - | $(RUN_GEN) ./gen-protos >xsys-protos.hT + | $(RUN_GEN) build/gen-protos >xsys-protos.hT mv xsys-protos.hT xsys-protos.h rm -rf fixtmp.c # This is nominally a 'build' program, but it's run only when host==build, # so we can (indeed, must) use $(LIBDEPS) and $(LIBS). -fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \ - c-incpath.o cppdefault.o prefix.o $(LIBDEPS) libcpp.a - $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \ - c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o libcpp.a $(LIBS) +build/fix-header$(build_exeext): build/fix-header.o build/scan-decls.o \ + build/scan.o xsys-protos.h c-incpath.o cppdefault.o prefix.o \ + $(BUILD_ERRORS) $(LIBDEPS) + $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ + build/fix-header.o c-incpath.o cppdefault.o build/scan-decls.o prefix.o \ + build/scan.o $(BUILD_ERRORS) $(LIBS) -fix-header.o: fix-header.c $(OBSTACK_H) scan.h \ +build/fix-header.o: fix-header.c $(OBSTACK_H) scan.h errors.h \ xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H) -scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) +build/scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) # stmp-fixproto depends on this, not on fix-header directly. # The idea is to make sure fix-header gets built, # but not rerun fixproto after each stage # just because fix-header's mtime has changed. -fixhdr.ready: fix-header$(build_exeext) +fixhdr.ready: build/fix-header$(build_exeext) -if [ -f fixhdr.ready ] ; then \ true; \ else \ $(STAMP) fixhdr.ready; \ fi -# stmp-int-headers is to make sure fixincludes has already finished. +# stmp-int-hdrs is to make sure fixincludes has already finished. # The if statement is so that we don't run fixproto a second time # if it has already been run on the files in `include'. stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs @@ -2629,7 +3337,8 @@ stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs else \ : This line works around a 'make' bug in BSDI 1.1.; \ FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \ - mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \ + FIX_HEADER="build/fix-header$(build_exeext)"; export FIX_HEADER; \ + mkinstalldirs="$(mkinstalldirs)"; \ export mkinstalldirs; \ if [ -d "$(SYSTEM_HEADER_DIR)" ]; then \ $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \ @@ -2638,6 +3347,12 @@ stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs $(STAMP) include/fixed; \ fi $(STAMP) stmp-fixproto + +# We can't run fixproto (it's being built for a different host), but we still +# need to install it so that the user can run it when the compiler is +# installed. +stmp-install-fixproto: fixproto + $(STAMP) $@ # # Remake the info files. @@ -2651,26 +3366,43 @@ info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo srcinfo: $(INFOFILES) -cp -p $^ $(srcdir)/doc -TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi +TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \ + gcc-common.texi gcc-vers.texi -TEXI_GCC_FILES = gcc.texi gcc-common.texi frontends.texi standards.texi \ - invoke.texi extend.texi md.texi objc.texi gcov.texi trouble.texi \ - bugreport.texi service.texi contribute.texi compat.texi funding.texi \ - gnu.texi gpl.texi fdl.texi contrib.texi cppenv.texi cppopts.texi +TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \ + standards.texi invoke.texi extend.texi md.texi objc.texi \ + gcov.texi trouble.texi bugreport.texi service.texi \ + contribute.texi compat.texi funding.texi gnu.texi gpl.texi \ + fdl.texi contrib.texi cppenv.texi cppopts.texi \ + implement-c.texi -TEXI_GCCINT_FILES = gccint.texi gcc-common.texi contribute.texi makefile.texi \ - configterms.texi portability.texi interface.texi passes.texi \ - c-tree.texi rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \ - configfiles.texi collect2.texi headerdirs.texi funding.texi gnu.texi \ - gpl.texi fdl.texi contrib.texi languages.texi sourcebuild.texi \ - gty.texi libgcc.texi +TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \ + contribute.texi makefile.texi configterms.texi options.texi \ + portability.texi interface.texi passes.texi c-tree.texi \ + rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \ + configfiles.texi collect2.texi headerdirs.texi funding.texi \ + gnu.texi gpl.texi fdl.texi contrib.texi languages.texi \ + sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \ + loop.texi -TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi +TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi \ + gcc-common.texi gcc-vers.texi -TEXI_CPPINT_FILES = cppinternals.texi +TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi -# The *.1, *.7, *.info, and *.dvi files are being generated from implicit -# patterns. To use them, put each of the specific target with with their +# gcc-vers.texi is generated from the version files. +gcc-vers.texi: $(BASEVER) $(DEVPHASE) + (echo "@set version-GCC $(BASEVER_c)"; \ + if [ "$(DEVPHASE_c)" = "experimental" ]; \ + then echo "@set DEVELOPMENT"; \ + else echo "@clear DEVELOPMENT"; \ + fi) > $@T + echo "@set srcdir $(srcdir)" >> $@T + mv -f $@T $@ + + +# The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit +# patterns. To use them, put each of the specific targets with its # specific dependencies but no build commands. doc/cpp.info: $(TEXI_CPP_FILES) @@ -2680,15 +3412,15 @@ doc/cppinternals.info: $(TEXI_CPPINT_FILES) doc/%.info: %.texi if [ x$(BUILD_INFO) = xinfo ]; then \ - $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) \ - -I $(docdir)/include -o $@ $<; \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ fi # Duplicate entry to handle renaming of gccinstall.info doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) if [ x$(BUILD_INFO) = xinfo ]; then \ - $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) \ - -I $(docdir)/include -o $@ $<; \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ fi doc/cpp.dvi: $(TEXI_CPP_FILES) @@ -2696,19 +3428,65 @@ doc/gcc.dvi: $(TEXI_GCC_FILES) doc/gccint.dvi: $(TEXI_GCCINT_FILES) doc/cppinternals.dvi: $(TEXI_CPPINT_FILES) +doc/cpp.pdf: $(TEXI_CPP_FILES) +doc/gcc.pdf: $(TEXI_GCC_FILES) +doc/gccint.pdf: $(TEXI_GCCINT_FILES) +doc/cppinternals.pdf: $(TEXI_CPPINT_FILES) + +$(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES) +$(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES) +$(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES) +$(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES) + dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \ - doc/cppinternals.dvi + doc/cppinternals.dvi lang.dvi doc/%.dvi: %.texi - $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< # Duplicate entry to handle renaming of gccinstall.dvi doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) - $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + +pdf:: doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \ + doc/cppinternals.pdf lang.pdf + +doc/%.pdf: %.texi + $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + +# Duplicate entry to handle renaming of gccinstall.pdf +doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES) + $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + +# List the directories or single hmtl files which are installed by +# install-html. The lang.html file triggers language fragments to build +# html documentation. Installing language fragment documentation is not +# yet supported. +HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \ + $(build_htmldir)/gccinstall $(build_htmldir)/gccint \ + $(build_htmldir)/cppinternals + +# List the html file targets. +HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \ + $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \ + $(build_htmldir)/cppinternals/index.html lang.html + +html:: $(HTMLS_BUILD) + +$(build_htmldir)/%/index.html: %.texi + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< + +# Duplicate entry to handle renaming of gccinstall +$(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES) + $(mkinstalldirs) $(@D) + echo rm -f $(@D)/* + $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 doc/fsf-funding.7 -generated-manpages: man +generated-manpages: man man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman @@ -2735,7 +3513,7 @@ doc/%.7: %.pod cpp.pod: cpp.texi cppenv.texi cppopts.texi # These next rules exist because the output name is not the same as -# the input name, so our implict %.pod rule will not work. +# the input name, so our implicit %.pod rule will not work. gcc.pod: invoke.texi cppenv.texi cppopts.texi $(STAMP) $@ @@ -2748,6 +3526,18 @@ fsf-funding.pod: funding.texi -$(TEXI2POD) $< > $@ # +# clean-target removes all files made by compilation. +# This can be added to over time. + +clean-target: clean-target-libgcc + +clean-target-libgcc: + test ! -d libgcc || \ + (cd libgcc && find . -type d -print) | \ + while read d; do rm -f $$d/libgcc.a || : ; done + test ! -d libgcc || rm -r libgcc + test ! -f stmp-dirs || rm stmp-dirs + # Deletion of files made during compilation. # There are four levels of this: # `mostlyclean', `clean', `distclean' and `maintainer-clean'. @@ -2762,13 +3552,12 @@ fsf-funding.pod: funding.texi # (less duplicated code). mostlyclean: lang.mostlyclean - -rm -f $(STAGESTUFF) + -rm -f $(STAGECOPYSTUFF) $(STAGEMOVESTUFF) -rm -f *$(coverageexts) -rm -rf libgcc -# Delete the temporary source copies for cross compilation. - -rm -f $(BUILD_PREFIX_1)rtl.c $(BUILD_PREFIX_1)print-rtl.c - -rm -f $(BUILD_PREFIX_1)bitmap.c $(BUILD_PREFIX_1)errors.c - -rm -f $(BUILD_PREFIX_1)ggc-none.c print-rtl1.c +# Delete build programs + -rm -f build/* + -rm -f mddeps.mk # Delete the temp files made in the course of building libgcc.a. -rm -f xlimits.h # Delete other built files. @@ -2783,11 +3572,8 @@ mostlyclean: lang.mostlyclean -rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c -rm -f collect collect2 mips-tfile mips-tdump # Delete files generated for fixproto - -rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \ + -rm -rf $(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \ gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready -# Delete files generated for fixincl - -rm -rf fixincl fixinc.sh specs.ready - (cd fixinc && $(MAKE) clean) # Delete unwanted output files from TeX. -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg @@ -2800,6 +3586,8 @@ mostlyclean: lang.mostlyclean # Delete files generated by gengtype.c -rm -f gtype-* -rm -f gt-* +# Delete genchecksum outputs + -rm -f *-checksum.c # Delete all files made by compilation # that don't exist in the distribution. @@ -2808,9 +3596,11 @@ clean: mostlyclean lang.clean -rm -f libgcc_s* -rm -f libunwind* -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h + -rm -f options.c options.h optionlist -rm -f cs-* -rm -rf libgcc -rm -f doc/*.dvi + -rm -f doc/*.pdf # Delete the include directory. -rm -rf include # Delete files used by the "multilib" facility (including libgcc subdirs). @@ -2836,7 +3626,7 @@ distclean: clean lang.distclean -rm -f Makefile *.oaux -rm -f gthr-default.h -rm -f */stage1 */stage2 */stage3 */stage4 */include */stageprofile */stagefeedback - -rm -f c-parse.y c-parse.c c-parse.output TAGS */TAGS + -rm -f TAGS */TAGS -rm -f *.asm -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak -rm -f testsuite/*.log testsuite/*.sum @@ -2844,12 +3634,11 @@ distclean: clean lang.distclean -cd testsuite && rm -f *.out *.gcov *$(coverageexts) -rm -rf ${QMTEST_DIR} stamp-qmtest -rm -f cxxmain.c - -rm -f mklibgcc mkheaders gccbug .gdbinit configargs.h + -rm -f mklibgcc gccbug .gdbinit configargs.h -rm -f gcov.pod - -rm -f fixinc/Makefile # Delete po/*.gmo only if we are not building in the source directory. -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi - -rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null + -rmdir ada cp f java objc intl po testsuite 2>/dev/null # Get rid of every file that's generated from some other file, except for `configure'. # Most of these files ARE PRESENT in the GCC distribution. @@ -2857,10 +3646,9 @@ maintainer-clean: @echo 'This command is intended for maintainers to use; it' @echo 'deletes files that may need special tools to rebuild.' $(MAKE) lang.maintainer-clean distclean - -rm -f $(srcdir)/c-parse.y $(srcdir)/c-parse.c -rm -f cpp.??s cpp.*aux -rm -f gcc.??s gcc.*aux - -rm -f $(docdir)/*.info $(docdir)/*.1 $(docdir)/*.7 $(docdir)/*.dvi + -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf # # Entry points `install' and `uninstall'. # Also use `install-collect2' to install collect2 when the config files don't. @@ -2870,10 +3658,10 @@ maintainer-clean: # broken is small. install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \ install-cpp install-man install-info install-@POSUB@ \ - lang.install-normal install-driver + install-driver # Handle cpp installation. -install-cpp: cpp$(exeext) +install-cpp: installdirs cpp$(exeext) -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext) -if [ x$(cpp_install_dir) != x ]; then \ @@ -2884,14 +3672,14 @@ install-cpp: cpp$(exeext) # Create the installation directories. # $(libdir)/gcc/include isn't currently searched by cpp. installdirs: - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libsubdir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libexecsubdir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(includedir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(infodir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(slibdir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man1dir) - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man7dir) + $(mkinstalldirs) $(DESTDIR)$(libsubdir) + $(mkinstalldirs) $(DESTDIR)$(libexecsubdir) + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(includedir) + $(mkinstalldirs) $(DESTDIR)$(infodir) + $(mkinstalldirs) $(DESTDIR)$(slibdir) + $(mkinstalldirs) $(DESTDIR)$(man1dir) + $(mkinstalldirs) $(DESTDIR)$(man7dir) # Install the compiler executables built during cross compilation. install-common: native $(EXTRA_PARTS) lang.install-common installdirs @@ -2902,7 +3690,7 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs else true; \ fi; \ done - for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \ + for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \ if [ x"$$file" != x.. ]; then \ rm -f $(DESTDIR)$(libexecsubdir)/$$file; \ $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \ @@ -2915,12 +3703,11 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs chmod a-x $(DESTDIR)$(libsubdir)/$$file; \ else true; fi; \ done -# Don't mess with specs if it doesn't exist yet. - -if [ -f specs ] ; then \ - rm -f $(DESTDIR)$(libsubdir)/specs; \ - $(INSTALL_DATA) $(SPECS) $(DESTDIR)$(libsubdir)/specs; \ - chmod a-x $(DESTDIR)$(libsubdir)/specs; \ - fi +# We no longer install the specs file because its presence makes the +# driver slower, and because people who need it can recreate it by +# using -dumpspecs. We remove any old version because it would +# otherwise override the specs built into the driver. + rm -f $(DESTDIR)$(libsubdir)/specs # Install protoize if it was compiled. -if [ -f protoize$(exeext) ]; then \ rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ @@ -2939,15 +3726,15 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs fi $(INSTALL_SCRIPT) gccbug $(DESTDIR)$(bindir)/$(GCCBUG_INSTALL_NAME) -# Install the driver program as $(target_noncanonical)-gcc, +# Install the driver program as $(target_noncanonical)-gcc, # $(target_noncanonical)-gcc-$(version) # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc. install-driver: installdirs xgcc$(exeext) -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) - -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version) + -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) -( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ) + $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ) -if [ -f gcc-cross$(exeext) ] ; then \ if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \ rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \ @@ -2968,7 +3755,8 @@ install-info:: doc installdirs \ $(DESTDIR)$(infodir)/gcc.info \ $(DESTDIR)$(infodir)/cppinternals.info \ $(DESTDIR)$(infodir)/gccinstall.info \ - $(DESTDIR)$(infodir)/gccint.info + $(DESTDIR)$(infodir)/gccint.info \ + lang.install-info $(DESTDIR)$(infodir)/%.info: doc/%.info installdirs rm -f $@ @@ -2985,8 +3773,27 @@ $(DESTDIR)$(infodir)/%.info: doc/%.info installdirs else true; fi; \ else true; fi; +html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; + +install-html: $(HTMLS_BUILD) + @$(NORMAL_INSTALL) + test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)" + @list='$(HTMLS_INSTALL)'; for p in $$list; do \ + if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \ + f=$(html__strip_dir) \ + if test -d "$$d$$p"; then \ + echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ + else \ + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + fi; \ + done + # Install the man pages. -install-man: installdirs lang.install-man \ +install-man: lang.install-man \ $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \ $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \ $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \ @@ -2994,24 +3801,24 @@ install-man: installdirs lang.install-man \ $(DESTDIR)$(man7dir)/gfdl$(man7ext) \ $(DESTDIR)$(man7dir)/gpl$(man7ext) -$(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 +$(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 +$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs -rm -f $@ - -$(INSTALL_DATA) $< $@ + -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 +$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs -rm -f $@ - -$(INSTALL_DATA) $< $@ + -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 +$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs -rm -f $@ - -$(INSTALL_DATA) $< $@ + -$(INSTALL_DATA) $< $@ -chmod a-x $@ # Install the library. @@ -3020,6 +3827,7 @@ install-libgcc: libgcc.mk libgcc.a libgcov.a installdirs CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \ CONFIG_H="$(TCONFIG_H)" \ MAKEOVERRIDES= \ + mkinstalldirs='$(mkinstalldirs)' \ -f libgcc.mk install # Install multiple versions of libgcc.a, libgcov.a. @@ -3028,6 +3836,7 @@ install-multilib: stmp-multilib installdirs CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \ CONFIG_H="$(CONFIG_H)" \ MAKEOVERRIDES= \ + mkinstalldirs='$(mkinstalldirs)' \ -f libgcc.mk install # Install all the header files built in the include subdirectory. @@ -3053,6 +3862,13 @@ install-include-dir: installdirs mkdir $(DESTDIR)$(libsubdir)/include -chmod a+rx $(DESTDIR)$(libsubdir)/include +# Create or recreate the install-tools include file directory. +itoolsdir = $(libexecsubdir)/install-tools +itoolsdatadir = $(libsubdir)/install-tools +install-itoolsdirs: installdirs + $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include + $(mkinstalldirs) $(DESTDIR)$(itoolsdir) + # Install the include directory using tar. install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir # We use `pwd`/include instead of just include to problems with CDPATH @@ -3075,37 +3891,38 @@ install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir cp -p -r include $(DESTDIR)$(libsubdir) -itoolsdir = $(libexecsubdir)/install-tools -itoolsdatadir = $(libsubdir)/install-tools -# Don't install the headers. Instead, install appropriate scripts -# and supporting files for fixincludes to be run later. -install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \ - mkheaders xlimits.h - -rm -rf $(DESTDIR)$(itoolsdir) $(DESTDIR)$(itoolsdatadir) - $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdatadir)/include - $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdir) +# Targets without dependencies, for use in prev-gcc during bootstrap. +real-install-headers-tar: + (cd `${PWD_COMMAND}`/include ; \ + tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - ) + +real-install-headers-cpio: + cd `${PWD_COMMAND}`/include ; \ + find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include + +real-install-headers-cp: + cp -p -r include $(DESTDIR)$(libsubdir) + +# Install supporting files for fixincludes to be run later. +install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-itoolsdirs \ + macro_list xlimits.h for file in $(USER_H); do \ realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ $(INSTALL_DATA) $$file \ $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \ done $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h - if [ x$(STMP_FIXINC) != x ] ; then \ - $(INSTALL_DATA) $(srcdir)/README-fixinc \ - $(DESTDIR)$(itoolsdatadir)/include/README ; \ - $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \ - $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \ - $(INSTALL_DATA) $(srcdir)/gsyslimits.h \ - $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \ - else :; fi + $(INSTALL_DATA) $(UNWIND_H) $(DESTDIR)$(itoolsdatadir)/include/unwind.h + $(INSTALL_DATA) $(srcdir)/gsyslimits.h \ + $(DESTDIR)$(itoolsdatadir)/gsyslimits.h + $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list if [ x$(STMP_FIXPROTO) != x ] ; then \ - $(INSTALL_SCRIPT) $(srcdir)/mkinstalldirs \ + $(INSTALL_SCRIPT) $(mkinstalldirs) \ $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \ $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \ - $(INSTALL_PROGRAM) fix-header$(build_exeext) \ + $(INSTALL_PROGRAM) build/fix-header$(build_exeext) \ $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \ else :; fi - $(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \ > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \ @@ -3161,9 +3978,12 @@ site.exp: ./config.status Makefile @echo "set build_triplet $(build)" >> ./tmp0 @echo "set target_triplet $(target)" >> ./tmp0 @echo "set target_alias $(target_noncanonical)" >> ./tmp0 + @echo "set libiconv \"$(LIBICONV)\"" >> ./tmp0 # CFLAGS is set even though it's empty to show we reserve the right to set it. @echo "set CFLAGS \"\"" >> ./tmp0 @echo "set CXXFLAGS \"\"" >> ./tmp0 + @echo "set HOSTCC \"$(CC)\"" >> ./tmp0 + @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0 @echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0 @echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0 # If newlib has been configured, we need to pass -B to gcc so it can find @@ -3229,17 +4049,23 @@ $(lang_checks_parallel): site.exp TESTSUITEDIR = testsuite $(TESTSUITEDIR)/site.exp: site.exp - test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) + -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) -rm -f $@ sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@ -$(lang_checks): check-% : $(TESTSUITEDIR)/site.exp +$(lang_checks): check-% : site.exp + -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) + test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$* -(rootme=`${PWD_COMMAND}`; export rootme; \ srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \ - cd $(TESTSUITEDIR); \ + cd $(TESTSUITEDIR)/$*; \ + rm -f tmp-site.exp; \ + sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)/$*|' \ + < ../../site.exp > tmp-site.exp; \ + $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \ EXPECT=${EXPECT} ; export EXPECT ; \ if [ -f $${rootme}/../expect/expect ] ; then \ - TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ + TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ export TCL_LIBRARY ; fi ; \ $(RUNTEST) --tool $* $(RUNTESTFLAGS)) @@ -3249,7 +4075,7 @@ check-consistency: testsuite/site.exp cd testsuite; \ EXPECT=${EXPECT} ; export EXPECT ; \ if [ -f $${rootme}/../expect/expect ] ; then \ - TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ + TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ export TCL_LIBRARY ; fi ; \ $(RUNTEST) --tool consistency $(RUNTESTFLAGS) @@ -3308,8 +4134,8 @@ qmtest-gui: ${QMTEST_DIR}/context # Run Paranoia on real.c. paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) \ - real.h $(TREE_H) - g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) + $(REAL_H) $(TREE_H) + g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) paranoia: paranoia.o real.o $(LIBIBERTY) g++ -o $@ paranoia.o real.o $(LIBIBERTY) @@ -3325,11 +4151,7 @@ TAGS: lang.tags incs="$$incs --include $$dir/TAGS.sub"; \ fi; \ done; \ - mkdir tmp-tags; \ - mv -f c-parse.[ch] tmp-tags; \ - etags -o TAGS.sub *.y *.h *.c; \ - mv tmp-tags/* .; \ - rmdir tmp-tags; \ + etags -o TAGS.sub *.y *.h *.c; \ etags --include TAGS.sub $$incs) # ------------------------------------------------------ @@ -3337,7 +4159,7 @@ TAGS: lang.tags # ------------------------------------------------------ # A list of files to be destroyed during "lean" builds. -VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*` +VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) *.c *.h gen*` # Flags to pass to stage2 and later recursive makes. Note that the # WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in @@ -3358,26 +4180,27 @@ POSTSTAGE1_FLAGS_TO_PASS = \ STAGE2_FLAGS_TO_PASS = \ CFLAGS="$(BOOT_CFLAGS)" \ - WERROR="@WERROR@" \ + WERROR="$(WERROR_FLAGS)" \ STAGEPROFILE_FLAGS_TO_PASS = \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" # Files never linked into the final executable produces warnings about missing # profile. STAGEFEEDBACK_FLAGS_TO_PASS = \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + CFLAGS="$(BOOT_CFLAGS) -fprofile-use -freorder-blocks-and-partition" # Only build the C compiler for stage1, because that is the only one that # we can guarantee will build with the native compiler, and also it is the # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them # overrideable (for a bootstrap build stage1 also builds gcc.info). +# The stage1 compiler is always built with checking enabled. stage1_build: $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \ - CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \ - MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS= \ - OBJS-onestep="$(OBJS)" + CFLAGS="$(STAGE1_CFLAGS) $(STAGE1_CHECKING_CFLAGS)" \ + MAKEINFO="$(MAKEINFO)" MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \ + COVERAGE_FLAGS= OBJS-onestep="$(OBJS)" $(STAMP) stage1_build echo stage1_build > stage_last @@ -3481,7 +4304,7 @@ bootstrap4 bootstrap4-lean: stage4_build unstage1 unstage2 unstage3 unstage4 unstageprofile unstagefeedback: -set -vx; stage=`echo $@ | sed -e 's/un//'`; \ rm -f $$stage/as$(exeext); \ - rm -f $$stage/ld$(exeext); \ + rm -f $$stage/nm$(exeext); \ rm -f $$stage/collect-ld$(exeext); \ if test -d $$stage; then \ mv $$stage/specs $(SPECS) 2>/dev/null || :; \ @@ -3536,12 +4359,19 @@ bubblestrap: $(MAKE) $(REMAKEFLAGS) stage4_build || exit 1; \ fi +BOOTSTRAPPING := $(shell if test -f ../stage_last; then echo yes; else echo no; fi) +ifeq ($(BOOTSTRAPPING),yes) +# Provide quickstrap as a target that people can type into the gcc directory, +# and that fails if you're not into it. +quickstrap: all +else quickstrap: if test -f stage_last ; then \ LAST=`cat stage_last`; rm $$LAST; $(MAKE) $(REMAKEFLAGS) $$LAST; \ else \ $(MAKE) $(REMAKEFLAGS) stage1_build; \ fi +endif cleanstrap: -$(MAKE) clean @@ -3573,24 +4403,38 @@ fastcompare fastcompare3 fastcompare4 fastcompare-lean fastcompare3-lean fastcom gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force -rm -f .bad_compare case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ - for dir in . $(SUBDIRS); do \ + for dir in . $(SUBDIRS) libgcc; do \ if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ for file in $$dir/*$(objext); do \ case "$@" in \ slowcompare* ) \ - tail +16c ./$$file > tmp-foo1; \ - tail +16c stage$$stage/$$file > tmp-foo2 \ - && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ + if tail -c +1 /dev/null 2>&1; then \ + skip16='-c +17'; \ + else \ + skip16='+17c'; \ + fi; \ + tail $$skip16 ./$$file > tmp-foo1; \ + tail $$skip16 stage$$stage/$$file > tmp-foo2; \ + cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1; \ + cmpret=$$?; \ ;; \ fastcompare* ) \ cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ + cmpret=$$?; \ ;; \ gnucompare* ) \ cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ + cmpret=$$?; \ ;; \ esac ; \ + if test $$cmpret -eq 1; then \ + case $$file in \ + ./cc*-checksum$(objext) | libgcc/* ) \ + echo warning: $$file differs;; \ + *) \ + echo $$file differs >> .bad_compare;; \ + esac ; \ + fi; \ done; \ else true; fi; \ done @@ -3623,17 +4467,19 @@ stage1-start: do \ if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \ done + -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcov.a + -rm -f stage1/libgcc_s*$(SHLIB_EXT) + -rm -f stage1/libunwind.a stage1/libunwind*$(SHLIB_EXT) # If SPECS is overridden, make sure it is `installed' as specs. -mv $(SPECS) stage1/specs - -mv $(STAGESTUFF) stage1 + -mv $(STAGEMOVESTUFF) stage1 + -mv build/* stage1/build + -cp -p $(STAGECOPYSTUFF) stage1 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stage1 && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcov.a - -rm -f stage1/libgcc_s*$(SHLIB_EXT) - -rm -f stage1/libunwind.a stage1/libunwind*$(SHLIB_EXT) -cp libgcc.a stage1 -$(RANLIB_FOR_TARGET) stage1/libgcc.a -cp libgcov.a stage1 @@ -3660,17 +4506,19 @@ stage2-start: do \ if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \ done + -rm -f stage2/libgcc.a stage2/libgcov.a stage2/libgcc_eh.a + -rm -f stage2/libgcc_s*$(SHLIB_EXT) + -rm -f stage2/libunwind.a stage2/libunwind*$(SHLIB_EXT) # If SPECS is overridden, make sure it is `installed' as specs. -mv $(SPECS) stage2/specs - -mv $(STAGESTUFF) stage2 + -mv $(STAGEMOVESTUFF) stage2 + -mv build/* stage2/build + -cp -p $(STAGECOPYSTUFF) stage2 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stage2 && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stage2/libgcc.a stage2/libgcov.a stage2/libgcc_eh.a - -rm -f stage2/libgcc_s*$(SHLIB_EXT) - -rm -f stage2/libunwind.a stage2/libunwind*$(SHLIB_EXT) -cp libgcc.a stage2 -$(RANLIB_FOR_TARGET) stage2/libgcc.a -cp libgcov.a stage2 @@ -3693,17 +4541,19 @@ stage3-start: do \ if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \ done + -rm -f stage3/libgcc.a stage3/libgcov.a stage3/libgcc_eh.a + -rm -f stage3/libgcc_s*$(SHLIB_EXT) + -rm -f stage3/libunwind.a stage3/libunwind*$(SHLIB_EXT) # If SPECS is overridden, make sure it is `installed' as specs. -mv $(SPECS) stage3/specs - -mv $(STAGESTUFF) stage3 + -mv $(STAGEMOVESTUFF) stage3 + -mv build/* stage3/build + -cp -p $(STAGECOPYSTUFF) stage3 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stage3 && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stage3/libgcc.a stage3/libgcov.a stage3/libgcc_eh.a - -rm -f stage3/libgcc_s*$(SHLIB_EXT) - -rm -f stage3/libunwind.a stage3/libunwind*$(SHLIB_EXT) -cp libgcc.a stage3 -$(RANLIB_FOR_TARGET) stage3/libgcc.a -cp libgcov.a stage3 @@ -3726,17 +4576,19 @@ stage4-start: do \ if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \ done + -rm -f stage4/libgcc.a stage4/libgcov.a stage4/libgcc_eh.a + -rm -f stage4/libgcc_s*$(SHLIB_EXT) + -rm -f stage4/libunwind.a stage4/libunwind*$(SHLIB_EXT) # If SPECS is overridden, make sure it is `installed' as specs. -mv $(SPECS) stage4/specs - -mv $(STAGESTUFF) stage4 + -mv $(STAGEMOVESTUFF) stage4 + -mv build/* stage4/build + -cp -p $(STAGECOPYSTUFF) stage4 # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stage4 && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stage4/libgcc.a stage4/libgcov.a stage4/libgcc_eh.a - -rm -f stage4/libgcc_s*$(SHLIB_EXT) - -rm -f stage4/libunwind.a stage4/libunwind*$(SHLIB_EXT) -cp libgcc.a stage4 -$(RANLIB_FOR_TARGET) stage4/libgcc.a -cp libgcov.a stage4 @@ -3759,15 +4611,17 @@ stageprofile-start: do \ if [ -d stageprofile/$$dir ] ; then true ; else mkdir stageprofile/$$dir ; fi ; \ done - -mv $(STAGESTUFF) stageprofile + -rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a + -rm -f stageprofile/libgcc_s*$(SHLIB_EXT) + -rm -f stageprofile/libunwind.a stageprofile/libunwind*$(SHLIB_EXT) + -mv $(STAGEMOVESTUFF) stageprofile + -mv build/* stageprofile/build + -cp -p $(STAGECOPYSTUFF) stageprofile # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stageprofile && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a - -rm -f stageprofile/libgcc_s*$(SHLIB_EXT) - -rm -f stageprofile/libunwind.a stageprofile/libunwind*$(SHLIB_EXT) -cp libgcc.a stageprofile -$(RANLIB_FOR_TARGET) stageprofile/libgcc.a -cp libgcov.a stageprofile @@ -3790,16 +4644,18 @@ stagefeedback-start: do \ if [ -d stagefeedback/$$dir ] ; then true ; else mkdir stagefeedback/$$dir ; fi ; \ done - -mv $(STAGESTUFF) stagefeedback + -rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a + -rm -f stagefeedback/libgcc_s*$(SHLIB_EXT) + -rm -f stagefeedback/libunwind.a stagefeedback/libunwind*$(SHLIB_EXT) + -rm -f *.da + -mv $(STAGEMOVESTUFF) stagefeedback + -mv build/* stagefeedback/build + -cp -p $(STAGECOPYSTUFF) stagefeedback # Copy as/ld if they exist to stage dir, so that running xgcc from the stage # dir will work properly. -if [ -f as$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../as$(exeext) .) ; else true ; fi -if [ -f ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../ld$(exeext) .) ; else true ; fi -if [ -f collect-ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi - -rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a - -rm -f stagefeedback/libgcc_s*$(SHLIB_EXT) - -rm -f stagefeedback/libunwind.a stagefeedback/libunwind*$(SHLIB_EXT) - -rm -f *.da -for dir in fixinc po testsuite $(SUBDIRS); \ do \ rm -f $$dir/*.da ; \ @@ -3847,9 +4703,7 @@ risky-stage4: stage4 XGETTEXT = @XGETTEXT@ GMSGFMT = @GMSGFMT@ MSGMERGE = msgmerge - -PACKAGE = @PACKAGE@ -CATALOGS = @CATALOGS@ +CATALOGS = $(patsubst %,po/%,@CATALOGS@) .PHONY: build- install- build-po install-po update-po @@ -3872,20 +4726,20 @@ update-po: $(CATALOGS:.gmo=.pox) # The new .po has to be gone over by hand, so we deposit it into # build/po with a different extension. -# If build/po/$(PACKAGE).pot exists, use it (it was just created), +# If build/po/gcc.pot exists, use it (it was just created), # else use the one in srcdir. .po.pox: -test -d po || mkdir po - $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ - then echo po/$(PACKAGE).pot; \ - else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ + $(MSGMERGE) $< `if test -f po/gcc.pot; \ + then echo po/gcc.pot; \ + else echo $(srcdir)/po/gcc.pot; fi` -o $@ # This rule has to look for .gmo modules in both srcdir and # the cwd, and has to check that we actually have a catalog # for each language, in case they weren't built or included # with the distribution. install-po: - $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir) + $(mkinstalldirs) $(DESTDIR)$(datadir) cats="$(CATALOGS)"; for cat in $$cats; do \ lang=`basename $$cat | sed 's/\.gmo$$//'`; \ if [ -f $$cat ]; then :; \ @@ -3893,10 +4747,10 @@ install-po: else continue; \ fi; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ - echo $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir; \ - $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \ - echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ - $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + echo $(mkinstalldirs) $(DESTDIR)$$dir; \ + $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ + echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \ done # Rule for regenerating the message template (gcc.pot). @@ -3906,9 +4760,9 @@ install-po: # Note that exgettext has an awk script embedded in it which requires a # fairly modern (POSIX-compliant) awk. # The .pot file is left in the build directory. -$(PACKAGE).pot: po/$(PACKAGE).pot -po/$(PACKAGE).pot: force options.c +gcc.pot: po/gcc.pot +po/gcc.pot: force -test -d po || mkdir po $(MAKE) srcextra AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \ - $(XGETTEXT) $(PACKAGE) $(srcdir) + $(XGETTEXT) gcc $(srcdir) diff --git a/contrib/gcc/acinclude.m4 b/contrib/gcc/acinclude.m4 new file mode 100644 index 00000000000..ec1931ce398 --- /dev/null +++ b/contrib/gcc/acinclude.m4 @@ -0,0 +1,512 @@ +dnl See whether we need a declaration for a function. +dnl The result is highly dependent on the INCLUDES passed in, so make sure +dnl to use a different cache variable name in this macro if it is invoked +dnl in a different context somewhere else. +dnl gcc_AC_CHECK_DECL(SYMBOL, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) +AC_DEFUN([gcc_AC_CHECK_DECL], +[AC_MSG_CHECKING([whether $1 is declared]) +AC_CACHE_VAL(gcc_cv_have_decl_$1, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$4], +[#ifndef $1 +char *(*pfn) = (char *(*)) $1 ; +#endif])], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")]) +if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then + AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3]) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl Arrange to define HAVE_DECL_ to 0 or 1 as appropriate. +dnl gcc_AC_CHECK_DECLS(SYMBOLS, +dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]]) +AC_DEFUN([gcc_AC_CHECK_DECLS], +[AC_FOREACH([gcc_AC_Func], [$1], + [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_[]gcc_AC_Func), + [Define to 1 if we found a declaration for ']gcc_AC_Func[', otherwise + define to 0.])])dnl +for ac_func in $1 +do + ac_tr_decl=AS_TR_CPP([HAVE_DECL_$ac_func]) +gcc_AC_CHECK_DECL($ac_func, + [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2], + [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3], +dnl It is possible that the include files passed in here are local headers +dnl which supply a backup declaration for the relevant prototype based on +dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test +dnl will always return success. E.g. see libiberty.h's handling of +dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to +dnl 1 so that any local headers used do not provide their own prototype +dnl during this test. +#undef $ac_tr_decl +#define $ac_tr_decl 1 + $4 +) +done +]) + +dnl 'make compare' can be significantly faster, if cmp itself can +dnl skip bytes instead of using tail. The test being performed is +dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2" +dnl but we need to sink errors and handle broken shells. We also test +dnl for the parameter format "cmp file1 file2 skip1 skip2" which is +dnl accepted by cmp on some systems. +AC_DEFUN([gcc_AC_PROG_CMP_IGNORE_INITIAL], +[AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip, +[ echo abfoo >t1 + echo cdfoo >t2 + gcc_cv_prog_cmp_skip=slowcompare + if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then + if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip=gnucompare + fi + fi + if test $gcc_cv_prog_cmp_skip = slowcompare ; then + if cmp t1 t2 2 2 > /dev/null 2>&1; then + if cmp t1 t2 1 1 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip=fastcompare + fi + fi + fi + rm t1 t2 +]) +make_compare_target=$gcc_cv_prog_cmp_skip +AC_SUBST(make_compare_target) +]) + +dnl See if symbolic links work and if not, try to substitute either hard links or simple copy. +AC_DEFUN([gcc_AC_PROG_LN_S], +[AC_MSG_CHECKING(whether ln -s works) +AC_CACHE_VAL(gcc_cv_prog_LN_S, +[rm -f conftestdata_t +echo >conftestdata_f +if ln -s conftestdata_f conftestdata_t 2>/dev/null +then + gcc_cv_prog_LN_S="ln -s" +else + if ln conftestdata_f conftestdata_t 2>/dev/null + then + gcc_cv_prog_LN_S=ln + else + if cp -p conftestdata_f conftestdata_t 2>/dev/null + then + gcc_cv_prog_LN_S="cp -p" + else + gcc_cv_prog_LN_S=cp + fi + fi +fi +rm -f conftestdata_f conftestdata_t +])dnl +LN_S="$gcc_cv_prog_LN_S" +if test "$gcc_cv_prog_LN_S" = "ln -s"; then + AC_MSG_RESULT(yes) +else + if test "$gcc_cv_prog_LN_S" = "ln"; then + AC_MSG_RESULT([no, using ln]) + else + AC_MSG_RESULT([no, and neither does ln, so using $gcc_cv_prog_LN_S]) + fi +fi +AC_SUBST(LN_S)dnl +]) + +dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead +dnl of the usual 2. +AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG], +[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_DIRECT_H +# include +#endif], [mkdir ("foo", 0);])], + gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)]) +if test $gcc_cv_mkdir_takes_one_arg = yes ; then + AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.]) +fi +]) + +AC_DEFUN([gcc_AC_PROG_INSTALL], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +AC_MSG_CHECKING(for a BSD compatible install) +if test -z "$INSTALL"; then +AC_CACHE_VAL(ac_cv_path_install, +[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" +])dnl + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +dnl We do special magic for INSTALL instead of AC_SUBST, to get +dnl relative paths right. +AC_MSG_RESULT($INSTALL) +AC_SUBST(INSTALL)dnl + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +AC_SUBST(INSTALL_PROGRAM)dnl + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +AC_SUBST(INSTALL_DATA)dnl +]) + +# mmap(2) blacklisting. Some platforms provide the mmap library routine +# but don't support all of the features we need from it. +AC_DEFUN([gcc_AC_FUNC_MMAP_BLACKLIST], +[ +AC_CHECK_HEADER([sys/mman.h], + [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no]) +AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no]) +if test "$gcc_header_sys_mman_h" != yes \ + || test "$gcc_func_mmap" != yes; then + gcc_cv_func_mmap_file=no + gcc_cv_func_mmap_dev_zero=no + gcc_cv_func_mmap_anon=no +else + AC_CACHE_CHECK([whether read-only mmap of a plain file works], + gcc_cv_func_mmap_file, + [# Add a system to this blacklist if + # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a + # memory area containing the same data that you'd get if you applied + # read() to the same fd. The only system known to have a problem here + # is VMS, where text files have record structure. + case "$host_os" in + vms* | ultrix*) + gcc_cv_func_mmap_file=no ;; + *) + gcc_cv_func_mmap_file=yes;; + esac]) + AC_CACHE_CHECK([whether mmap from /dev/zero works], + gcc_cv_func_mmap_dev_zero, + [# Add a system to this blacklist if it has mmap() but /dev/zero + # does not exist, or if mmapping /dev/zero does not give anonymous + # zeroed pages with both the following properties: + # 1. If you map N consecutive pages in with one call, and then + # unmap any subset of those pages, the pages that were not + # explicitly unmapped remain accessible. + # 2. If you map two adjacent blocks of memory and then unmap them + # both at once, they must both go away. + # Systems known to be in this category are Windows (all variants), + # VMS, and Darwin. + case "$host_os" in + vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + gcc_cv_func_mmap_dev_zero=no ;; + *) + gcc_cv_func_mmap_dev_zero=yes;; + esac]) + + # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. + AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include +#include +#include + +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif +], +[int n = MAP_ANONYMOUS;])], + gcc_cv_decl_map_anon=yes, + gcc_cv_decl_map_anon=no)]) + + if test $gcc_cv_decl_map_anon = no; then + gcc_cv_func_mmap_anon=no + else + AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], + gcc_cv_func_mmap_anon, + [# Add a system to this blacklist if it has mmap() and MAP_ANON or + # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) + # doesn't give anonymous zeroed pages with the same properties listed + # above for use of /dev/zero. + # Systems known to be in this category are Windows, VMS, and SCO Unix. + case "$host_os" in + vms* | cygwin* | pe | mingw* | sco* | udk* ) + gcc_cv_func_mmap_anon=no ;; + *) + gcc_cv_func_mmap_anon=yes;; + esac]) + fi +fi + +if test $gcc_cv_func_mmap_file = yes; then + AC_DEFINE(HAVE_MMAP_FILE, 1, + [Define if read-only mmap of a plain file works.]) +fi +if test $gcc_cv_func_mmap_dev_zero = yes; then + AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, + [Define if mmap of /dev/zero works.]) +fi +if test $gcc_cv_func_mmap_anon = yes; then + AC_DEFINE(HAVE_MMAP_ANON, 1, + [Define if mmap with MAP_ANON(YMOUS) works.]) +fi +]) + +dnl Locate a program and check that its version is acceptable. +dnl AC_PROG_CHECK_VER(var, name, version-switch, +dnl version-extract-regexp, version-glob) +AC_DEFUN([gcc_AC_CHECK_PROG_VER], +[AC_REQUIRE([gcc_AC_BUILD_EXEEXT]) +AC_CHECK_PROG([$1], [$2], [$2]) +if test -n "[$]$1"; then + # Found it, now check the version. + AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern, +[changequote(<<,>>)dnl + ac_prog_version=`<<$>>$1 $3 2>&1 | + sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'` +changequote([,])dnl + echo "configure:__oline__: version of $2 is $ac_prog_version" >&AS_MESSAGE_LOG_FD +changequote(<<,>>)dnl + case $ac_prog_version in + '') gcc_cv_prog_$2_modern=no;; + <<$5>>) + gcc_cv_prog_$2_modern=yes;; + *) gcc_cv_prog_$2_modern=no;; + esac +changequote([,])dnl +]) +else + gcc_cv_prog_$2_modern=no +fi +]) + +dnl Determine if enumerated bitfields are unsigned. ISO C says they can +dnl be either signed or unsigned. +dnl +AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED], +[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned, +[AC_RUN_IFELSE([AC_LANG_SOURCE([#include +enum t { BLAH = 128 } ; +struct s_t { enum t member : 8; } s ; +int main(void) +{ + s.member = BLAH; + if (s.member < 0) exit(1); + exit(0); + +}])], gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)]) +if test $gcc_cv_enum_bf_unsigned = yes; then + AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1, + [Define if enumerated bitfields are treated as unsigned values.]) +fi]) + +dnl Probe number of bits in a byte. +dnl Note C89 requires CHAR_BIT >= 8. +dnl +AC_DEFUN([gcc_AC_C_CHAR_BIT], +[AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit, +[AC_EGREP_CPP(found, +[#ifdef HAVE_LIMITS_H +#include +#endif +#ifdef CHAR_BIT +found +#endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no) +]) +if test $gcc_cv_decl_char_bit = no; then + AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby, +[i=8 + gcc_cv_c_nbby= + while test $i -lt 65; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, + [switch(0) { + case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i): + case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)): + ; }])], + [gcc_cv_c_nbby=$i; break]) + i=`expr $i + 1` + done + test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed +]) +if test $gcc_cv_c_nbby = failed; then + AC_MSG_ERROR(cannot determine number of bits in a byte) +else + AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby, + [Define as the number of bits in a byte, if \`limits.h' doesn't.]) +fi +fi]) + +AC_DEFUN([gcc_AC_INITFINI_ARRAY], +[AC_ARG_ENABLE(initfini-array, + [ --enable-initfini-array use .init_array/.fini_array sections], + [], [ +AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, + gcc_cv_initfini_array, [dnl + AC_RUN_IFELSE([AC_LANG_SOURCE([ +static int x = -1; +int main (void) { return x; } +int foo (void) { x = 0; } +int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;])], + [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no], + [gcc_cv_initfini_array=no])]) + enable_initfini_array=$gcc_cv_initfini_array +]) +if test $enable_initfini_array = yes; then + AC_DEFINE(HAVE_INITFINI_ARRAY, 1, + [Define .init_array/.fini_array sections are available and working.]) +fi]) + +dnl # _gcc_COMPUTE_GAS_VERSION +dnl # Used by gcc_GAS_VERSION_GTE_IFELSE +dnl # +dnl # WARNING: +dnl # gcc_cv_as_gas_srcdir must be defined before this. +dnl # This gross requirement will go away eventually. +AC_DEFUN([_gcc_COMPUTE_GAS_VERSION], +[gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd +for f in $gcc_cv_as_bfd_srcdir/configure \ + $gcc_cv_as_gas_srcdir/configure \ + $gcc_cv_as_gas_srcdir/configure.in \ + $gcc_cv_as_gas_srcdir/Makefile.in ; do + gcc_cv_gas_version=`sed -n -e 's/^[[ ]]*\(VERSION=[[0-9]]*\.[[0-9]]*.*\)/\1/p' < $f` + if test x$gcc_cv_gas_version != x; then + break + fi +done +gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"` +gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"` +gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"` +case $gcc_cv_gas_patch_version in + "") gcc_cv_gas_patch_version="0" ;; +esac +gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \ + + $gcc_cv_gas_minor_version \) \* 1000 \ + + $gcc_cv_gas_patch_version` +]) []dnl # _gcc_COMPUTE_GAS_VERSION + +dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel, +dnl # [command_if_true = :], [command_if_false = :]) +dnl # Check to see if the version of GAS is greater than or +dnl # equal to the specified version. +dnl # +dnl # The first ifelse() shortens the shell code if the patchlevel +dnl # is unimportant (the usual case). The others handle missing +dnl # commands. Note that the tests are structured so that the most +dnl # common version number cases are tested first. +AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE], +[ifelse([$1], elf, + [if test $in_tree_gas_is_elf = yes \ + &&], + [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4` + then dnl +ifelse([$5],,:,[$5])[]dnl +ifelse([$6],,,[ + else $6]) +fi]) + +AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE], +[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl +ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)], + [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])]) + +dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel], +dnl [extra switches to as], [assembler input], +dnl [extra testing logic], [command if feature available]) +dnl +dnl Checks for an assembler feature. If we are building an in-tree +dnl gas, the feature is available if the associated assembler version +dnl is greater than or equal to major.minor.patchlevel. If not, then +dnl ASSEMBLER INPUT is fed to the assembler and the feature is available +dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string, +dnl then it is run instead of simply setting CV to "yes" - it is responsible +dnl for doing so, if appropriate. +AC_DEFUN([gcc_GAS_CHECK_FEATURE], +[AC_CACHE_CHECK([assembler for $1], [$2], + [[$2]=no + ifelse([$3],,,[dnl + if test $in_tree_gas = yes; then + gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes]) + el])if test x$gcc_cv_as != x; then + echo ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]') > conftest.s + if AC_TRY_COMMAND([$gcc_cv_as $4 -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD]) + then + ifelse([$6],, [$2]=yes, [$6]) + else + echo "configure: failed program was" >&AS_MESSAGE_LOG_FD + cat conftest.s >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.o conftest.s + fi]) +ifelse([$7],,,[dnl +if test $[$2] = yes; then + $7 +fi])]) + +dnl GCC_TARGET_TEMPLATE(KEY) +dnl ------------------------ +dnl Define KEY as a valid configure key on the target machine. + +m4_define([GCC_TARGET_TEMPLATE], +[m4_define([GCC_TARGET_TEMPLATE($1)],[])]) + +dnl AH_TEMPLATE(KEY, DESCRIPTION) +dnl ----------------------------- +dnl Issue an autoheader template for KEY, i.e., a comment composed of +dnl DESCRIPTION (properly wrapped), and then #undef KEY. Redefinition +dnl of the macro in autoheader.m4, to support definition of only a few +dnl keys while compiling target libraries. + +m4_define([AH_TEMPLATE], +[AH_VERBATIM([$1],m4_text_wrap([$2 */], [ ], [/* ]) +m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET +])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[ +#endif +]))]) + +dnl Make sure that build_exeext is looked for +AC_DEFUN([gcc_AC_BUILD_EXEEXT], [ +ac_executable_extensions="$build_exeext"]) + diff --git a/contrib/gcc/aclocal.m4 b/contrib/gcc/aclocal.m4 index 939fb640e45..1a71985f8c0 100644 --- a/contrib/gcc/aclocal.m4 +++ b/contrib/gcc/aclocal.m4 @@ -1,784 +1,104 @@ -sinclude(../config/acx.m4) -sinclude(../config/accross.m4) -sinclude(../config/gettext.m4) -sinclude(../config/progtest.m4) +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- -dnl See if stdbool.h properly defines bool and true/false. -AC_DEFUN([gcc_AC_HEADER_STDBOOL], -[AC_CACHE_CHECK([for working stdbool.h], - ac_cv_header_stdbool_h, -[AC_TRY_COMPILE([#include ], -[bool foo = false;], -ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)]) -if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, - [Define if you have a working header file.]) +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" fi ]) -dnl See whether we can include both string.h and strings.h. -AC_DEFUN([gcc_AC_HEADER_STRING], -[AC_CACHE_CHECK([whether string.h and strings.h may both be included], - gcc_cv_header_string, -[AC_TRY_COMPILE([#include -#include ], , gcc_cv_header_string=yes, gcc_cv_header_string=no)]) -if test $gcc_cv_header_string = yes; then - AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both and .]) -fi -]) - -dnl See whether we need a declaration for a function. -dnl The result is highly dependent on the INCLUDES passed in, so make sure -dnl to use a different cache variable name in this macro if it is invoked -dnl in a different context somewhere else. -dnl gcc_AC_CHECK_DECL(SYMBOL, -dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) -AC_DEFUN([gcc_AC_CHECK_DECL], -[AC_MSG_CHECKING([whether $1 is declared]) -AC_CACHE_VAL(gcc_cv_have_decl_$1, -[AC_TRY_COMPILE([$4], -[#ifndef $1 -char *(*pfn) = (char *(*)) $1 ; -#endif], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")]) -if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then - AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2]) -else - AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3]) -fi -])dnl - -dnl Check multiple functions to see whether each needs a declaration. -dnl Arrange to define HAVE_DECL_ to 0 or 1 as appropriate. -dnl gcc_AC_CHECK_DECLS(SYMBOLS, -dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]]) -AC_DEFUN([gcc_AC_CHECK_DECLS], -[for ac_func in $1 -do -changequote(, )dnl - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -changequote([, ])dnl -gcc_AC_CHECK_DECL($ac_func, - [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2], - [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3], -dnl It is possible that the include files passed in here are local headers -dnl which supply a backup declaration for the relevant prototype based on -dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test -dnl will always return success. E.g. see libiberty.h's handling of -dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to -dnl 1 so that any local headers used do not provide their own prototype -dnl during this test. -#undef $ac_tr_decl -#define $ac_tr_decl 1 - $4 -) -done -dnl Automatically generate config.h entries via autoheader. -if test x = y ; then - patsubst(translit([$1], [a-z], [A-Z]), [\w+], - [AC_DEFINE([HAVE_DECL_\&], 1, - [Define to 1 if we found this declaration otherwise define to 0.])])dnl -fi -]) - -dnl 'make compare' can be significantly faster, if cmp itself can -dnl skip bytes instead of using tail. The test being performed is -dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2" -dnl but we need to sink errors and handle broken shells. We also test -dnl for the parameter format "cmp file1 file2 skip1 skip2" which is -dnl accepted by cmp on some systems. -AC_DEFUN([gcc_AC_PROG_CMP_IGNORE_INITIAL], -[AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip, -[ echo abfoo >t1 - echo cdfoo >t2 - gcc_cv_prog_cmp_skip=slowcompare - if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then - if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip=gnucompare - fi - fi - if test $gcc_cv_prog_cmp_skip = slowcompare ; then - if cmp t1 t2 2 2 > /dev/null 2>&1; then - if cmp t1 t2 1 1 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip=fastcompare - fi - fi - fi - rm t1 t2 -]) -make_compare_target=$gcc_cv_prog_cmp_skip -AC_SUBST(make_compare_target) -]) - -dnl See if the printf functions in libc support %p in format strings. -AC_DEFUN([gcc_AC_FUNC_PRINTF_PTR], -[AC_CACHE_CHECK(whether the printf functions support %p, - gcc_cv_func_printf_ptr, -[AC_TRY_RUN([#include - -int main() -{ - char buf[64]; - char *p = buf, *q = NULL; - sprintf(buf, "%p", p); - sscanf(buf, "%p", &q); - return (p != q); -}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no, - gcc_cv_func_printf_ptr=no) -rm -f core core.* *.core]) -if test $gcc_cv_func_printf_ptr = yes ; then - AC_DEFINE(HAVE_PRINTF_PTR, 1, [Define if printf supports "%p".]) -fi -]) - -dnl See if symbolic links work and if not, try to substitute either hard links or simple copy. -AC_DEFUN([gcc_AC_PROG_LN_S], -[AC_MSG_CHECKING(whether ln -s works) -AC_CACHE_VAL(gcc_cv_prog_LN_S, -[rm -f conftestdata_t -echo >conftestdata_f -if ln -s conftestdata_f conftestdata_t 2>/dev/null -then - gcc_cv_prog_LN_S="ln -s" -else - if ln conftestdata_f conftestdata_t 2>/dev/null - then - gcc_cv_prog_LN_S=ln - else - gcc_cv_prog_LN_S=cp - fi -fi -rm -f conftestdata_f conftestdata_t -])dnl -LN_S="$gcc_cv_prog_LN_S" -if test "$gcc_cv_prog_LN_S" = "ln -s"; then - AC_MSG_RESULT(yes) -else - if test "$gcc_cv_prog_LN_S" = "ln"; then - AC_MSG_RESULT([no, using ln]) - else - AC_MSG_RESULT([no, and neither does ln, so using cp]) - fi -fi -AC_SUBST(LN_S)dnl -]) - -dnl See if hard links work and if not, try to substitute either symbolic links or simple copy. -AC_DEFUN([gcc_AC_PROG_LN], -[AC_MSG_CHECKING(whether ln works) -AC_CACHE_VAL(gcc_cv_prog_LN, -[rm -f conftestdata_t -echo >conftestdata_f -if ln conftestdata_f conftestdata_t 2>/dev/null -then - gcc_cv_prog_LN="ln" -else - if ln -s conftestdata_f conftestdata_t 2>/dev/null - then - gcc_cv_prog_LN="ln -s" - else - gcc_cv_prog_LN=cp - fi -fi -rm -f conftestdata_f conftestdata_t -])dnl -LN="$gcc_cv_prog_LN" -if test "$gcc_cv_prog_LN" = "ln"; then - AC_MSG_RESULT(yes) -else - if test "$gcc_cv_prog_LN" = "ln -s"; then - AC_MSG_RESULT([no, using ln -s]) - else - AC_MSG_RESULT([no, and neither does ln -s, so using cp]) - fi -fi -AC_SUBST(LN)dnl -]) - -dnl Check whether _Bool is built-in. -AC_DEFUN([gcc_AC_C__BOOL], -[AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool, -[AC_TRY_COMPILE(, -[_Bool foo;], -gcc_cv_c__bool=yes, gcc_cv_c__bool=no) -]) -if test $gcc_cv_c__bool = yes; then - AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.]) -fi -]) - -dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead -dnl of the usual 2. -AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG], -[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg, -[AC_TRY_COMPILE([ -#include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_DIRECT_H -# include -#endif], [mkdir ("foo", 0);], - gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)]) -if test $gcc_cv_mkdir_takes_one_arg = yes ; then - AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.]) -fi -]) - -AC_DEFUN([gcc_AC_PROG_INSTALL], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -AC_MSG_CHECKING(for a BSD compatible install) -if test -z "$INSTALL"; then -AC_CACHE_VAL(ac_cv_path_install, -[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" -])dnl - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -dnl We do special magic for INSTALL instead of AC_SUBST, to get -dnl relative paths right. -AC_MSG_RESULT($INSTALL) -AC_SUBST(INSTALL)dnl - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -AC_SUBST(INSTALL_PROGRAM)dnl - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -AC_SUBST(INSTALL_DATA)dnl -]) - -dnl Test for GNAT. -dnl We require the gnatbind program, and a compiler driver that -dnl understands Ada. We use the user's CC setting, already found. -dnl -dnl Sets the shell variable have_gnat to yes or no as appropriate, and -dnl substitutes GNATBIND. -AC_DEFUN([gcc_AC_PROG_GNAT], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) -AC_REQUIRE([AC_PROG_CC]) -AC_CHECK_TOOL(GNATBIND, gnatbind, no) -AC_CACHE_CHECK([whether compiler driver understands Ada], - gcc_cv_cc_supports_ada, -[cat >conftest.adb <&1 || echo failure` -if test x"$errors" = x && test -f conftest.$ac_objext; then - gcc_cv_cc_supports_ada=yes - break -fi -rm -f conftest.*]) - -if test x$GNATBIND != xno && test x$gcc_cv_cc_supports_ada != xno; then - have_gnat=yes -else - have_gnat=no -fi -]) - -dnl GCC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]]) -dnl like AC_PATH_PROG but use other cache variables -AC_DEFUN([GCC_PATH_PROG], -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(gcc_cv_path_$1, -[case "[$]$1" in - /*) - gcc_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - ?:/*) - gcc_cv_path_$1="[$]$1" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$4], , $PATH, [$4])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - gcc_cv_path_$1="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" -dnl If no 3rd arg is given, leave the cache variable unset, -dnl so GCC_PATH_PROGS will keep looking. -ifelse([$3], , , [ test -z "[$]gcc_cv_path_$1" && gcc_cv_path_$1="$3" -])dnl - ;; -esac])dnl -$1="$gcc_cv_path_$1" -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# mmap(2) blacklisting. Some platforms provide the mmap library routine -# but don't support all of the features we need from it. -AC_DEFUN([gcc_AC_FUNC_MMAP_BLACKLIST], -[if test $ac_cv_header_sys_mman_h != yes \ - || test $ac_cv_func_mmap != yes; then - gcc_cv_func_mmap_file=no - gcc_cv_func_mmap_dev_zero=no - gcc_cv_func_mmap_anon=no -else - AC_CACHE_CHECK([whether read-only mmap of a plain file works], - gcc_cv_func_mmap_file, - [# Add a system to this blacklist if - # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a - # memory area containing the same data that you'd get if you applied - # read() to the same fd. The only system known to have a problem here - # is VMS, where text files have record structure. - case "$host_os" in - vms* | ultrix*) - gcc_cv_func_mmap_file=no ;; - *) - gcc_cv_func_mmap_file=yes;; - esac]) - AC_CACHE_CHECK([whether mmap from /dev/zero works], - gcc_cv_func_mmap_dev_zero, - [# Add a system to this blacklist if it has mmap() but /dev/zero - # does not exist, or if mmapping /dev/zero does not give anonymous - # zeroed pages with both the following properties: - # 1. If you map N consecutive pages in with one call, and then - # unmap any subset of those pages, the pages that were not - # explicitly unmapped remain accessible. - # 2. If you map two adjacent blocks of memory and then unmap them - # both at once, they must both go away. - # Systems known to be in this category are Windows (all variants), - # VMS, and Darwin. - case "$host_os" in - vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) - gcc_cv_func_mmap_dev_zero=no ;; - *) - gcc_cv_func_mmap_dev_zero=yes;; - esac]) - - # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. - AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon, - [AC_TRY_COMPILE( -[#include -#include -#include - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -], -[int n = MAP_ANONYMOUS;], - gcc_cv_decl_map_anon=yes, - gcc_cv_decl_map_anon=no)]) - - if test $gcc_cv_decl_map_anon = no; then - gcc_cv_func_mmap_anon=no - else - AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], - gcc_cv_func_mmap_anon, - [# Add a system to this blacklist if it has mmap() and MAP_ANON or - # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) - # doesn't give anonymous zeroed pages with the same properties listed - # above for use of /dev/zero. - # Systems known to be in this category are Windows, VMS, and SCO Unix. - case "$host_os" in - vms* | cygwin* | pe | mingw* | sco* | udk* ) - gcc_cv_func_mmap_anon=no ;; - *) - gcc_cv_func_mmap_anon=yes;; - esac]) - fi -fi - -if test $gcc_cv_func_mmap_file = yes; then - AC_DEFINE(HAVE_MMAP_FILE, 1, - [Define if read-only mmap of a plain file works.]) -fi -if test $gcc_cv_func_mmap_dev_zero = yes; then - AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, - [Define if mmap of /dev/zero works.]) -fi -if test $gcc_cv_func_mmap_anon = yes; then - AC_DEFINE(HAVE_MMAP_ANON, 1, - [Define if mmap with MAP_ANON(YMOUS) works.]) -fi -]) - -dnl Locate a program and check that its version is acceptable. -dnl AC_PROG_CHECK_VER(var, name, version-switch, -dnl version-extract-regexp, version-glob) -AC_DEFUN([gcc_AC_CHECK_PROG_VER], -[AC_CHECK_PROG([$1], [$2], [$2]) -if test -n "[$]$1"; then - # Found it, now check the version. - AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern, -[changequote(<<,>>)dnl - ac_prog_version=`<<$>>$1 $3 2>&1 | - sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'` -changequote([,])dnl - echo "configure:__oline__: version of $2 is $ac_prog_version" >&AC_FD_CC -changequote(<<,>>)dnl - case $ac_prog_version in - '') gcc_cv_prog_$2_modern=no;; - <<$5>>) - gcc_cv_prog_$2_modern=yes;; - *) gcc_cv_prog_$2_modern=no;; - esac -changequote([,])dnl -]) -else - gcc_cv_prog_$2_modern=no -fi -]) - -dnl Determine if enumerated bitfields are unsigned. ISO C says they can -dnl be either signed or unsigned. -dnl -AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED], -[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned, -[AC_TRY_RUN(#include -enum t { BLAH = 128 } ; -struct s_t { enum t member : 8; } s ; -int main(void) -{ - s.member = BLAH; - if (s.member < 0) exit(1); - exit(0); - -}, gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)]) -if test $gcc_cv_enum_bf_unsigned = yes; then - AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1, - [Define if enumerated bitfields are treated as unsigned values.]) -fi]) - -dnl Probe number of bits in a byte. -dnl Note C89 requires CHAR_BIT >= 8. -dnl -AC_DEFUN([gcc_AC_C_CHAR_BIT], -[AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit, -[AC_EGREP_CPP(found, -[#ifdef HAVE_LIMITS_H -#include -#endif -#ifdef CHAR_BIT -found -#endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no) -]) -if test $gcc_cv_decl_char_bit = no; then - AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby, -[i=8 - gcc_cv_c_nbby= - while test $i -lt 65; do - AC_TRY_COMPILE(, - [switch(0) { - case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i): - case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)): - ; }], - [gcc_cv_c_nbby=$i; break]) - i=`expr $i + 1` - done - test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed -]) -if test $gcc_cv_c_nbby = failed; then - AC_MSG_ERROR(cannot determine number of bits in a byte) -else - AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby, - [Define as the number of bits in a byte, if \`limits.h' doesn't.]) -fi -fi]) - -dnl Checking for long long. -dnl By Caolan McNamara -dnl Added check for __int64, Zack Weinberg -dnl -AC_DEFUN([gcc_AC_C_LONG_LONG], -[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, - [AC_TRY_COMPILE(,[long long int i;], - ac_cv_c_long_long=yes, - ac_cv_c_long_long=no)]) - if test $ac_cv_c_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG, 1, - [Define if your compiler supports the \`long long' type.]) - fi -AC_CACHE_CHECK(for __int64, ac_cv_c___int64, - [AC_TRY_COMPILE(,[__int64 i;], - ac_cv_c___int64=yes, - ac_cv_c___int64=no)]) - if test $ac_cv_c___int64 = yes; then - AC_DEFINE(HAVE___INT64, 1, - [Define if your compiler supports the \`__int64' type.]) - fi -]) - -#serial AM2 - -dnl From Bruno Haible. - -AC_DEFUN([AM_ICONV], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - - am_cv_lib_iconv_ldpath= - AC_ARG_WITH([libiconv-prefix], -[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi - done - ]) - - AC_CHECK_HEADERS([iconv.h]) - - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, - [Define as const if the declaration of iconv() needs const.]) - fi - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="$am_cv_lib_iconv_ldpath -liconv" - fi - AC_SUBST(LIBICONV) -]) - -AC_DEFUN([gcc_AC_INITFINI_ARRAY], -[AC_ARG_ENABLE(initfini-array, - [ --enable-initfini-array use .init_array/.fini_array sections], - [], [ -AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, - gcc_cv_initfini_array, [dnl - AC_TRY_RUN([ -static int x = -1; -int main (void) { return x; } -int foo (void) { x = 0; } -int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;], - [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no], - [gcc_cv_initfini_array=no])]) - enable_initfini_array=$gcc_cv_initfini_array -]) -if test $enable_initfini_array = yes; then - AC_DEFINE(HAVE_INITFINI_ARRAY, 1, - [Define .init_array/.fini_array sections are available and working.]) -fi]) - -dnl # _gcc_COMPUTE_GAS_VERSION -dnl # Used by gcc_GAS_VERSION_GTE_IFELSE -dnl # -dnl # WARNING: -dnl # gcc_cv_as_gas_srcdir must be defined before this. -dnl # This gross requirement will go away eventually. -AC_DEFUN([_gcc_COMPUTE_GAS_VERSION], -[gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd -for f in $gcc_cv_as_bfd_srcdir/configure \ - $gcc_cv_as_gas_srcdir/configure \ - $gcc_cv_as_gas_srcdir/configure.in \ - $gcc_cv_as_gas_srcdir/Makefile.in ; do - gcc_cv_gas_version=`grep '^VERSION=[[0-9]]*\.[[0-9]]*' $f` - if test x$gcc_cv_gas_version != x; then - break - fi -done -gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"` -gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"` -gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"` -case $gcc_cv_gas_patch_version in - "") gcc_cv_gas_patch_version="0" ;; -esac -gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \ - + $gcc_cv_gas_minor_version \) \* 1000 \ - + $gcc_cv_gas_patch_version` -]) []dnl # _gcc_COMPUTE_GAS_VERSION - -dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel, -dnl # [command_if_true = :], [command_if_false = :]) -dnl # Check to see if the version of GAS is greater than or -dnl # equal to the specified version. -dnl # -dnl # The first ifelse() shortens the shell code if the patchlevel -dnl # is unimportant (the usual case). The others handle missing -dnl # commands. Note that the tests are structured so that the most -dnl # common version number cases are tested first. -AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE], -[ifelse([$1], elf, - [if test $in_tree_gas_is_elf = yes \ - &&], - [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4` - then dnl -ifelse([$5],,:,[$5])[]dnl -ifelse([$6],,,[ - else $6]) -fi]) - -AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE], -[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl -ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)], - [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])]) - -dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel], -dnl [extra switches to as], [assembler input], -dnl [extra testing logic], [command if feature available]) -dnl -dnl Checks for an assembler feature. If we are building an in-tree -dnl gas, the feature is available if the associated assembler version -dnl is greater than or equal to major.minor.patchlevel. If not, then -dnl ASSEMBLER INPUT is fed to the assembler and the feature is available -dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string, -dnl then it is run instead of simply setting CV to "yes" - it is responsible -dnl for doing so, if appropriate. -AC_DEFUN([gcc_GAS_CHECK_FEATURE], -[AC_CACHE_CHECK([assembler for $1], [$2], - [[$2]=no - ifelse([$3],,,[dnl - if test $in_tree_gas = yes; then - gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes]) - el])if test x$gcc_cv_as != x; then - echo ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]') > conftest.s - if AC_TRY_COMMAND([$gcc_cv_as $4 -o conftest.o conftest.s >&AC_FD_CC]) - then - ifelse([$6],, [$2]=yes, [$6]) - else - echo "configure: failed program was" >&AC_FD_CC - cat conftest.s >&AC_FD_CC - fi - rm -f conftest.o conftest.s - fi]) -ifelse([$7],,,[dnl -if test $[$2] = yes; then - $7 -fi])]) - -# lcmessage.m4 serial 3 (gettext-0.11.3) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper , 1995. - -# Check whether LC_MESSAGES is available in . - -AC_DEFUN([AM_LC_MESSAGES], -[ - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your file defines LC_MESSAGES.]) - fi -]) +m4_include([../config/acx.m4]) +m4_include([../config/codeset.m4]) +m4_include([../config/gettext-sister.m4]) +m4_include([../config/iconv.m4]) +m4_include([../config/lcmessage.m4]) +m4_include([../config/lib-ld.m4]) +m4_include([../config/lib-link.m4]) +m4_include([../config/lib-prefix.m4]) +m4_include([../config/progtest.m4]) +m4_include([acinclude.m4]) diff --git a/contrib/gcc/addresses.h b/contrib/gcc/addresses.h new file mode 100644 index 00000000000..6741acac041 --- /dev/null +++ b/contrib/gcc/addresses.h @@ -0,0 +1,81 @@ +/* Inline functions to test validity of reg classes for addressing modes. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS, + MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS. + Arguments as for the MODE_CODE_BASE_REG_CLASS macro. */ + +static inline enum reg_class +base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED, + enum rtx_code outer_code ATTRIBUTE_UNUSED, + enum rtx_code index_code ATTRIBUTE_UNUSED) +{ +#ifdef MODE_CODE_BASE_REG_CLASS + return MODE_CODE_BASE_REG_CLASS (mode, outer_code, index_code); +#else +#ifdef MODE_BASE_REG_REG_CLASS + if (index_code == REG) + return MODE_BASE_REG_REG_CLASS (mode); +#endif +#ifdef MODE_BASE_REG_CLASS + return MODE_BASE_REG_CLASS (mode); +#else + return BASE_REG_CLASS; +#endif +#endif +} + +/* Wrapper function to unify target macros REGNO_MODE_CODE_OK_FOR_BASE_P, + REGNO_MODE_OK_FOR_REG_BASE_P, REGNO_MODE_OK_FOR_BASE_P and + REGNO_OK_FOR_BASE_P. + Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */ + +static inline bool +ok_for_base_p_1 (unsigned regno, enum machine_mode mode ATTRIBUTE_UNUSED, + enum rtx_code outer_code ATTRIBUTE_UNUSED, + enum rtx_code index_code ATTRIBUTE_UNUSED) +{ +#ifdef REGNO_MODE_CODE_OK_FOR_BASE_P + return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, mode, outer_code, index_code); +#else +#ifdef REGNO_MODE_OK_FOR_REG_BASE_P + if (index_code == REG) + return REGNO_MODE_OK_FOR_REG_BASE_P (regno, mode); +#endif +#ifdef REGNO_MODE_OK_FOR_BASE_P + return REGNO_MODE_OK_FOR_BASE_P (regno, mode); +#else + return REGNO_OK_FOR_BASE_P (regno); +#endif +#endif +} + +/* Wrapper around ok_for_base_p_1, for use after register allocation is + complete. Arguments as for the called function. */ + +static inline bool +regno_ok_for_base_p (unsigned regno, enum machine_mode mode, + enum rtx_code outer_code, enum rtx_code index_code) +{ + if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0) + regno = reg_renumber[regno]; + + return ok_for_base_p_1 (regno, mode, outer_code, index_code); +} diff --git a/contrib/gcc/alias.c b/contrib/gcc/alias.c index 5cce5e4d16f..7c51ad79dd6 100644 --- a/contrib/gcc/alias.c +++ b/contrib/gcc/alias.c @@ -1,5 +1,5 @@ /* Alias analysis for GNU C - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by John Carr (jfc@mit.edu). @@ -17,8 +17,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -28,7 +28,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree.h" #include "tm_p.h" #include "function.h" -#include "expr.h" +#include "alias.h" +#include "emit-rtl.h" #include "regs.h" #include "hard-reg-set.h" #include "basic-block.h" @@ -43,6 +44,59 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "target.h" #include "cgraph.h" #include "varray.h" +#include "tree-pass.h" +#include "ipa-type-escape.h" + +/* The aliasing API provided here solves related but different problems: + + Say there exists (in c) + + struct X { + struct Y y1; + struct Z z2; + } x1, *px1, *px2; + + struct Y y2, *py; + struct Z z2, *pz; + + + py = &px1.y1; + px2 = &x1; + + Consider the four questions: + + Can a store to x1 interfere with px2->y1? + Can a store to x1 interfere with px2->z2? + (*px2).z2 + Can a store to x1 change the value pointed to by with py? + Can a store to x1 change the value pointed to by with pz? + + The answer to these questions can be yes, yes, yes, and maybe. + + The first two questions can be answered with a simple examination + of the type system. If structure X contains a field of type Y then + a store thru a pointer to an X can overwrite any field that is + contained (recursively) in an X (unless we know that px1 != px2). + + The last two of the questions can be solved in the same way as the + first two questions but this is too conservative. The observation + is that in some cases analysis we can know if which (if any) fields + are addressed and if those addresses are used in bad ways. This + analysis may be language specific. In C, arbitrary operations may + be applied to pointers. However, there is some indication that + this may be too conservative for some C++ types. + + The pass ipa-type-escape does this analysis for the types whose + instances do not escape across the compilation boundary. + + Historically in GCC, these two problems were combined and a single + data structure was used to represent the solution to these + problems. We now have two similar but different data structures, + The data structure to solve the last two question is similar to the + first, but does not contain have the fields in it whose address are + never taken. For types that do escape the compilation unit, the + data structures will have identical information. +*/ /* The alias sets assigned to MEMs assist the back-end in determining which MEMs can alias which other MEMs. In general, two MEMs in @@ -55,11 +109,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA `double'. (However, a store to an `int' cannot alias a `double' and vice versa.) We indicate this via a tree structure that looks like: - struct S - / \ + struct S + / \ / \ - |/_ _\| - int double + |/_ _\| + int double (The arrows are directed and point downwards.) In this situation we say the alias set for `struct S' is the @@ -112,15 +166,10 @@ static bool nonoverlapping_component_refs_p (tree, tree); static tree decl_for_component_ref (tree); static rtx adjust_offset_for_component_ref (tree, rtx); static int nonoverlapping_memrefs_p (rtx, rtx); -static int write_dependence_p (rtx, rtx, int, int); +static int write_dependence_p (rtx, rtx, int); -static int nonlocal_mentioned_p_1 (rtx *, void *); -static int nonlocal_mentioned_p (rtx); -static int nonlocal_referenced_p_1 (rtx *, void *); -static int nonlocal_referenced_p (rtx); -static int nonlocal_set_p_1 (rtx *, void *); -static int nonlocal_set_p (rtx); static void memory_modified_1 (rtx, rtx, void *); +static void record_alias_subset (HOST_WIDE_INT, HOST_WIDE_INT); /* Set up all info needed to perform alias analysis on memory references. */ @@ -157,32 +206,21 @@ static void memory_modified_1 (rtx, rtx, void *); current function performs nonlocal memory memory references for the purposes of marking the function as a constant function. */ -static GTY(()) varray_type reg_base_value; +static GTY(()) VEC(rtx,gc) *reg_base_value; static rtx *new_reg_base_value; /* We preserve the copy of old array around to avoid amount of garbage produced. About 8% of garbage produced were attributed to this array. */ -static GTY((deletable (""))) varray_type old_reg_base_value; +static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value; /* Static hunks of RTL used by the aliasing code; these are initialized once per function to avoid unnecessary RTL allocations. */ static GTY (()) rtx static_reg_base_value[FIRST_PSEUDO_REGISTER]; -#define REG_BASE_VALUE(X) \ - (reg_base_value && REGNO (X) < VARRAY_SIZE (reg_base_value) \ - ? VARRAY_RTX (reg_base_value, REGNO (X)) : 0) - -/* Vector of known invariant relationships between registers. Set in - loop unrolling. Indexed by register number, if nonzero the value - is an expression describing this register in terms of another. - - The length of this array is REG_BASE_VALUE_SIZE. - - Because this array contains only pseudo registers it has no effect - after reload. */ -static GTY((length("alias_invariant_size"))) rtx *alias_invariant; -unsigned GTY(()) int alias_invariant_size; +#define REG_BASE_VALUE(X) \ + (REGNO (X) < VEC_length (rtx, reg_base_value) \ + ? VEC_index (rtx, reg_base_value, REGNO (X)) : 0) /* Vector indexed by N giving the initial (unchanging) value known for pseudo-register N. This array is initialized in init_alias_analysis, @@ -210,8 +248,11 @@ static bool *reg_known_equiv_p; NOTE_INSN_FUNCTION_BEG note. */ static bool copying_arguments; +DEF_VEC_P(alias_set_entry); +DEF_VEC_ALLOC_P(alias_set_entry,gc); + /* The splay-tree used to store the various alias set entries. */ -static GTY ((param_is (struct alias_set_entry))) varray_type alias_sets; +static GTY (()) VEC(alias_set_entry,gc) *alias_sets; /* Returns a pointer to the alias set entry for ALIAS_SET, if there is such an entry, or NULL otherwise. */ @@ -219,7 +260,7 @@ static GTY ((param_is (struct alias_set_entry))) varray_type alias_sets; static inline alias_set_entry get_alias_set_entry (HOST_WIDE_INT alias_set) { - return (alias_set_entry)VARRAY_GENERIC_PTR (alias_sets, alias_set); + return VEC_index (alias_set_entry, alias_sets, alias_set); } /* Returns nonzero if the alias sets for MEM1 and MEM2 are such that @@ -228,7 +269,6 @@ get_alias_set_entry (HOST_WIDE_INT alias_set) static inline int mems_in_disjoint_alias_sets_p (rtx mem1, rtx mem2) { -#ifdef ENABLE_CHECKING /* Perform a basic sanity check. Namely, that there are no alias sets if we're not using strict aliasing. This helps to catch bugs whereby someone uses PUT_CODE, but doesn't clear MEM_ALIAS_SET, or @@ -236,10 +276,8 @@ mems_in_disjoint_alias_sets_p (rtx mem1, rtx mem2) gen_rtx_MEM, and the MEM_ALIAS_SET is not cleared. If we begin to use alias sets to indicate that spilled registers cannot alias each other, we might need to remove this check. */ - if (! flag_strict_aliasing - && (MEM_ALIAS_SET (mem1) != 0 || MEM_ALIAS_SET (mem2) != 0)) - abort (); -#endif + gcc_assert (flag_strict_aliasing + || (!MEM_ALIAS_SET (mem1) && !MEM_ALIAS_SET (mem2))); return ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1), MEM_ALIAS_SET (mem2)); } @@ -289,28 +327,19 @@ alias_sets_conflict_p (HOST_WIDE_INT set1, HOST_WIDE_INT set2) child of the other. Therefore, they cannot alias. */ return 0; } - -/* Return 1 if TYPE is a RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE and has - has any readonly fields. If any of the fields have types that - contain readonly fields, return true as well. */ + +/* Return 1 if the two specified alias sets might conflict, or if any subtype + of these alias sets might conflict. */ int -readonly_fields_p (tree type) +alias_sets_might_conflict_p (HOST_WIDE_INT set1, HOST_WIDE_INT set2) { - tree field; - - if (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE - && TREE_CODE (type) != QUAL_UNION_TYPE) - return 0; - - for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field)) - if (TREE_CODE (field) == FIELD_DECL - && (TREE_READONLY (field) - || readonly_fields_p (TREE_TYPE (field)))) - return 1; + if (set1 == 0 || set2 == 0 || set1 == set2) + return 1; return 0; } + /* Return 1 if any MEM object of type T1 will always conflict (using the dependency routines in this file) with any MEM object of type T2. @@ -328,14 +357,6 @@ objects_must_conflict_p (tree t1, tree t2) if (t1 == 0 && t2 == 0) return 0; - /* If one or the other has readonly fields or is readonly, - then they may not conflict. */ - if ((t1 != 0 && readonly_fields_p (t1)) - || (t2 != 0 && readonly_fields_p (t2)) - || (t1 != 0 && lang_hooks.honor_readonly && TYPE_READONLY (t1)) - || (t2 != 0 && lang_hooks.honor_readonly && TYPE_READONLY (t2))) - return 0; - /* If they are the same type, they must conflict. */ if (t1 == t2 /* Likewise if both are volatile. */ @@ -361,24 +382,29 @@ objects_must_conflict_p (tree t1, tree t2) static tree find_base_decl (tree t) { - tree d0, d1, d2; + tree d0, d1; if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t))) return 0; - /* If this is a declaration, return it. */ - if (TREE_CODE_CLASS (TREE_CODE (t)) == 'd') - return t; + /* If this is a declaration, return it. If T is based on a restrict + qualified decl, return that decl. */ + if (DECL_P (t)) + { + if (TREE_CODE (t) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (t)) + t = DECL_GET_RESTRICT_BASE (t); + return t; + } /* Handle general expressions. It would be nice to deal with COMPONENT_REFs here. If we could tell that `a' and `b' were the same, then `a->f' and `b->f' are also the same. */ switch (TREE_CODE_CLASS (TREE_CODE (t))) { - case '1': + case tcc_unary: return find_base_decl (TREE_OPERAND (t, 0)); - case '2': + case tcc_binary: /* Return 0 if found in neither or both are the same. */ d0 = find_base_decl (TREE_OPERAND (t, 0)); d1 = find_base_decl (TREE_OPERAND (t, 1)); @@ -391,56 +417,56 @@ find_base_decl (tree t) else return 0; - case '3': - d0 = find_base_decl (TREE_OPERAND (t, 0)); - d1 = find_base_decl (TREE_OPERAND (t, 1)); - d2 = find_base_decl (TREE_OPERAND (t, 2)); - - /* Set any nonzero values from the last, then from the first. */ - if (d1 == 0) d1 = d2; - if (d0 == 0) d0 = d1; - if (d1 == 0) d1 = d0; - if (d2 == 0) d2 = d1; - - /* At this point all are nonzero or all are zero. If all three are the - same, return it. Otherwise, return zero. */ - return (d0 == d1 && d1 == d2) ? d0 : 0; - default: return 0; } } -/* Return 1 if all the nested component references handled by - get_inner_reference in T are such that we can address the object in T. */ +/* Return true if all nested component references handled by + get_inner_reference in T are such that we should use the alias set + provided by the object at the heart of T. -int -can_address_p (tree t) + This is true for non-addressable components (which don't have their + own alias set), as well as components of objects in alias set zero. + This later point is a special case wherein we wish to override the + alias set used by the component, but we don't have per-FIELD_DECL + assignable alias sets. */ + +bool +component_uses_parent_alias_set (tree t) { - /* If we're at the end, it is vacuously addressable. */ - if (! handled_component_p (t)) - return 1; + while (1) + { + /* If we're at the end, it vacuously uses its own alias set. */ + if (!handled_component_p (t)) + return false; - /* Bitfields are never addressable. */ - else if (TREE_CODE (t) == BIT_FIELD_REF) - return 0; + switch (TREE_CODE (t)) + { + case COMPONENT_REF: + if (DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1))) + return true; + break; - /* Fields are addressable unless they are marked as nonaddressable or - the containing type has alias set 0. */ - else if (TREE_CODE (t) == COMPONENT_REF - && ! DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1)) - && get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) != 0 - && can_address_p (TREE_OPERAND (t, 0))) - return 1; + case ARRAY_REF: + case ARRAY_RANGE_REF: + if (TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (t, 0)))) + return true; + break; - /* Likewise for arrays. */ - else if ((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) - && ! TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (t, 0))) - && get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) != 0 - && can_address_p (TREE_OPERAND (t, 0))) - return 1; + case REALPART_EXPR: + case IMAGPART_EXPR: + break; - return 0; + default: + /* Bitfields and casts are never addressable. */ + return true; + } + + t = TREE_OPERAND (t, 0); + if (get_alias_set (TREE_TYPE (t)) == 0) + return true; + } } /* Return the alias set for T, which may be either a type or an @@ -467,31 +493,24 @@ get_alias_set (tree t) if (! TYPE_P (t)) { tree inner = t; - tree placeholder_ptr = 0; /* Remove any nops, then give the language a chance to do something with this tree before we look at it. */ STRIP_NOPS (t); - set = (*lang_hooks.get_alias_set) (t); + set = lang_hooks.get_alias_set (t); if (set != -1) return set; /* First see if the actual object referenced is an INDIRECT_REF from a - restrict-qualified pointer or a "void *". Replace - PLACEHOLDER_EXPRs. */ - while (TREE_CODE (inner) == PLACEHOLDER_EXPR - || handled_component_p (inner)) + restrict-qualified pointer or a "void *". */ + while (handled_component_p (inner)) { - if (TREE_CODE (inner) == PLACEHOLDER_EXPR) - inner = find_placeholder (inner, &placeholder_ptr); - else - inner = TREE_OPERAND (inner, 0); - + inner = TREE_OPERAND (inner, 0); STRIP_NOPS (inner); } /* Check for accesses through restrict-qualified pointers. */ - if (TREE_CODE (inner) == INDIRECT_REF) + if (INDIRECT_REF_P (inner)) { tree decl = find_base_decl (TREE_OPERAND (inner, 0)); @@ -523,7 +542,7 @@ get_alias_set (tree t) type, then we would believe that other subsets of the pointed-to type (such as fields of that type) do not conflict with the type pointed to - by the restricted pointer. */ + by the restricted pointer. */ DECL_POINTER_ALIAS_SET (decl) = pointed_to_alias_set; else @@ -539,22 +558,19 @@ get_alias_set (tree t) } /* If we have an INDIRECT_REF via a void pointer, we don't - know anything about what that might alias. */ - else if (TREE_CODE (TREE_TYPE (inner)) == VOID_TYPE) + know anything about what that might alias. Likewise if the + pointer is marked that way. */ + else if (TREE_CODE (TREE_TYPE (inner)) == VOID_TYPE + || (TYPE_REF_CAN_ALIAS_ALL + (TREE_TYPE (TREE_OPERAND (inner, 0))))) return 0; } /* Otherwise, pick up the outermost object that we could have a pointer - to, processing conversion and PLACEHOLDER_EXPR as above. */ - placeholder_ptr = 0; - while (TREE_CODE (t) == PLACEHOLDER_EXPR - || (handled_component_p (t) && ! can_address_p (t))) + to, processing conversions as above. */ + while (component_uses_parent_alias_set (t)) { - if (TREE_CODE (t) == PLACEHOLDER_EXPR) - t = find_placeholder (t, &placeholder_ptr); - else - t = TREE_OPERAND (t, 0); - + t = TREE_OPERAND (t, 0); STRIP_NOPS (t); } @@ -562,7 +578,7 @@ get_alias_set (tree t) it. This is necessary for C++ anonymous unions, whose component variables don't look like union members (boo!). */ if (TREE_CODE (t) == VAR_DECL - && DECL_RTL_SET_P (t) && GET_CODE (DECL_RTL (t)) == MEM) + && DECL_RTL_SET_P (t) && MEM_P (DECL_RTL (t))) return MEM_ALIAS_SET (DECL_RTL (t)); /* Now all we care about is the type. */ @@ -576,7 +592,7 @@ get_alias_set (tree t) return TYPE_ALIAS_SET (t); /* See if the language has special handling for this type. */ - set = (*lang_hooks.get_alias_set) (t); + set = lang_hooks.get_alias_set (t); if (set != -1) return set; @@ -609,18 +625,15 @@ get_alias_set (tree t) /* Return a brand-new alias set. */ -static GTY(()) HOST_WIDE_INT last_alias_set; - HOST_WIDE_INT new_alias_set (void) { if (flag_strict_aliasing) { - if (!alias_sets) - VARRAY_GENERIC_PTR_INIT (alias_sets, 10, "alias sets"); - else - VARRAY_GROW (alias_sets, last_alias_set + 2); - return ++last_alias_set; + if (alias_sets == 0) + VEC_safe_push (alias_set_entry, gc, alias_sets, 0); + VEC_safe_push (alias_set_entry, gc, alias_sets, 0); + return VEC_length (alias_set_entry, alias_sets) - 1; } else return 0; @@ -639,7 +652,7 @@ new_alias_set (void) It is illegal for SUPERSET to be zero; everything is implicitly a subset of alias set zero. */ -void +static void record_alias_subset (HOST_WIDE_INT superset, HOST_WIDE_INT subset) { alias_set_entry superset_entry; @@ -650,8 +663,7 @@ record_alias_subset (HOST_WIDE_INT superset, HOST_WIDE_INT subset) if (superset == subset) return; - if (superset == 0) - abort (); + gcc_assert (superset); superset_entry = get_alias_set_entry (superset); if (superset_entry == 0) @@ -663,7 +675,7 @@ record_alias_subset (HOST_WIDE_INT superset, HOST_WIDE_INT subset) superset_entry->children = splay_tree_new_ggc (splay_tree_compare_ints); superset_entry->has_zero_child = 0; - VARRAY_GENERIC_PTR (alias_sets, superset) = superset_entry; + VEC_replace (alias_set_entry, alias_sets, superset, superset_entry); } if (subset == 0) @@ -714,15 +726,15 @@ record_component_aliases (tree type) case UNION_TYPE: case QUAL_UNION_TYPE: /* Recursively record aliases for the base classes, if there are any. */ - if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL) + if (TYPE_BINFO (type)) { int i; - for (i = 0; i < TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type)); i++) - { - tree binfo = TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), i); - record_alias_subset (superset, - get_alias_set (BINFO_TYPE (binfo))); - } + tree binfo, base_binfo; + + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + record_alias_subset (superset, + get_alias_set (BINFO_TYPE (base_binfo))); } for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL && ! DECL_NONADDRESSABLE_P (field)) @@ -746,10 +758,18 @@ static GTY(()) HOST_WIDE_INT varargs_set = -1; HOST_WIDE_INT get_varargs_alias_set (void) { +#if 1 + /* We now lower VA_ARG_EXPR, and there's currently no way to attach the + varargs alias set to an INDIRECT_REF (FIXME!), so we can't + consistently use the varargs alias set for loads from the varargs + area. So don't use it anywhere. */ + return 0; +#else if (varargs_set == -1) varargs_set = new_alias_set (); return varargs_set; +#endif } /* Likewise, but used for the fixed portions of the frame, e.g., register @@ -795,7 +815,7 @@ find_base_value (rtx src) The test above is not sufficient because the scheduler may move a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN. */ if ((regno >= FIRST_PSEUDO_REGISTER || fixed_regs[regno]) - && regno < VARRAY_SIZE (reg_base_value)) + && regno < VEC_length (rtx, reg_base_value)) { /* If we're inside init_alias_analysis, use new_reg_base_value to reduce the number of relaxation iterations. */ @@ -803,8 +823,8 @@ find_base_value (rtx src) && REG_N_SETS (regno) == 1) return new_reg_base_value[regno]; - if (VARRAY_RTX (reg_base_value, regno)) - return VARRAY_RTX (reg_base_value, regno); + if (VEC_index (rtx, reg_base_value, regno)) + return VEC_index (rtx, reg_base_value, regno); } return 0; @@ -943,18 +963,17 @@ record_set (rtx dest, rtx set, void *data ATTRIBUTE_UNUSED) rtx src; int n; - if (GET_CODE (dest) != REG) + if (!REG_P (dest)) return; regno = REGNO (dest); - if (regno >= VARRAY_SIZE (reg_base_value)) - abort (); + gcc_assert (regno < VEC_length (rtx, reg_base_value)); /* If this spans multiple hard registers, then we must indicate that every register has an unusable value. */ if (regno < FIRST_PSEUDO_REGISTER) - n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + n = hard_regno_nregs[regno][GET_MODE (dest)]; else n = 1; if (n != 1) @@ -992,13 +1011,24 @@ record_set (rtx dest, rtx set, void *data ATTRIBUTE_UNUSED) return; } - /* This is not the first set. If the new value is not related to the - old value, forget the base value. Note that the following code is - not detected: - extern int x, y; int *p = &x; p += (&y-&x); + /* If this is not the first set of REGNO, see whether the new value + is related to the old one. There are two cases of interest: + + (1) The register might be assigned an entirely new value + that has the same base term as the original set. + + (2) The set might be a simple self-modification that + cannot change REGNO's base value. + + If neither case holds, reject the original base value as invalid. + Note that the following situation is not detected: + + extern int x, y; int *p = &x; p += (&y-&x); + ANSI C does not allow computing the difference of addresses of distinct top level objects. */ - if (new_reg_base_value[regno]) + if (new_reg_base_value[regno] != 0 + && find_base_value (src) != new_reg_base_value[regno]) switch (GET_CODE (src)) { case LO_SUM: @@ -1038,31 +1068,6 @@ record_set (rtx dest, rtx set, void *data ATTRIBUTE_UNUSED) reg_seen[regno] = 1; } -/* Called from loop optimization when a new pseudo-register is - created. It indicates that REGNO is being set to VAL. f INVARIANT - is true then this value also describes an invariant relationship - which can be used to deduce that two registers with unknown values - are different. */ - -void -record_base_value (unsigned int regno, rtx val, int invariant) -{ - if (invariant && alias_invariant && regno < alias_invariant_size) - alias_invariant[regno] = val; - - if (regno >= VARRAY_SIZE (reg_base_value)) - VARRAY_GROW (reg_base_value, max_reg_num ()); - - if (GET_CODE (val) == REG) - { - VARRAY_RTX (reg_base_value, regno) - = REG_BASE_VALUE (val); - return; - } - VARRAY_RTX (reg_base_value, regno) - = find_base_value (val); -} - /* Clear alias info for a register. This is used if an RTL transformation changes the value of a register. This is used in flow by AUTO_INC_DEC optimizations. We don't need to clear reg_base_value, since flow only @@ -1086,7 +1091,7 @@ clear_reg_alias_info (rtx reg) /* If a value is known for REGNO, return it. */ -rtx +rtx get_reg_known_value (unsigned int regno) { if (regno >= FIRST_PSEUDO_REGISTER) @@ -1146,7 +1151,7 @@ rtx canon_rtx (rtx x) { /* Recursively look for equivalences. */ - if (GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER) + if (REG_P (x) && REGNO (x) >= FIRST_PSEUDO_REGISTER) { rtx t = get_reg_known_value (REGNO (x)); if (t == x) @@ -1174,7 +1179,7 @@ canon_rtx (rtx x) the loop optimizer. Note we want to leave the original MEM alone, but need to return the canonicalized MEM with all the flags with their original values. */ - else if (GET_CODE (x) == MEM) + else if (MEM_P (x)) x = replace_equiv_address_nv (x, canon_rtx (XEXP (x, 0))); return x; @@ -1233,11 +1238,6 @@ rtx_equal_for_memref_p (rtx x, rtx y) comparison for these nodes. */ return 0; - case ADDRESSOF: - return (XINT (x, 1) == XINT (y, 1) - && rtx_equal_for_memref_p (XEXP (x, 0), - XEXP (y, 0))); - default: break; } @@ -1250,7 +1250,7 @@ rtx_equal_for_memref_p (rtx x, rtx y) && rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 0)))); /* For commutative operations, the RTX match if the operand match in any order. Also handle the simple binary and unary cases without a loop. */ - if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c') + if (COMMUTATIVE_P (x)) { rtx xop0 = canon_rtx (XEXP (x, 0)); rtx yop0 = canon_rtx (XEXP (y, 0)); @@ -1261,14 +1261,14 @@ rtx_equal_for_memref_p (rtx x, rtx y) || (rtx_equal_for_memref_p (xop0, yop1) && rtx_equal_for_memref_p (canon_rtx (XEXP (x, 1)), yop0))); } - else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2') + else if (NON_COMMUTATIVE_P (x)) { return (rtx_equal_for_memref_p (canon_rtx (XEXP (x, 0)), canon_rtx (XEXP (y, 0))) && rtx_equal_for_memref_p (canon_rtx (XEXP (x, 1)), canon_rtx (XEXP (y, 1)))); } - else if (GET_RTX_CLASS (code) == '1') + else if (UNARY_P (x)) return rtx_equal_for_memref_p (canon_rtx (XEXP (x, 0)), canon_rtx (XEXP (y, 0))); @@ -1319,7 +1319,7 @@ rtx_equal_for_memref_p (rtx x, rtx y) contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: - abort (); + gcc_unreachable (); } } return 1; @@ -1338,7 +1338,7 @@ find_symbolic_term (rtx x) code = GET_CODE (x); if (code == SYMBOL_REF || code == LABEL_REF) return x; - if (GET_RTX_CLASS (code) == 'o') + if (OBJECT_P (x)) return 0; fmt = GET_RTX_FORMAT (code); @@ -1479,9 +1479,6 @@ find_base_term (rtx x) case LABEL_REF: return x; - case ADDRESSOF: - return REG_BASE_VALUE (frame_pointer_rtx); - default: return 0; } @@ -1585,7 +1582,7 @@ get_addr (rtx x) if (CONSTANT_P (l->loc)) return l->loc; for (l = v->locs; l; l = l->next) - if (GET_CODE (l->loc) != REG && GET_CODE (l->loc) != MEM) + if (!REG_P (l->loc) && !MEM_P (l->loc)) return l->loc; if (v->locs) return v->locs->loc; @@ -1597,7 +1594,7 @@ get_addr (rtx x) where SIZE is the size in bytes of the memory reference. If ADDR is not modified by the memory reference then ADDR is returned. */ -rtx +static rtx addr_side_effect_eval (rtx addr, int size, int n_refs) { int offset = 0; @@ -1623,7 +1620,7 @@ addr_side_effect_eval (rtx addr, int size, int n_refs) if (offset) addr = gen_rtx_PLUS (GET_MODE (addr), XEXP (addr, 0), - GEN_INT (offset)); + GEN_INT (offset)); else addr = XEXP (addr, 0); addr = canon_rtx (addr); @@ -1759,25 +1756,6 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) return memrefs_conflict_p (xsize, x0, ysize, y0, c); } - case REG: - /* Are these registers known not to be equal? */ - if (alias_invariant) - { - unsigned int r_x = REGNO (x), r_y = REGNO (y); - rtx i_x, i_y; /* invariant relationships of X and Y */ - - i_x = r_x >= alias_invariant_size ? 0 : alias_invariant[r_x]; - i_y = r_y >= alias_invariant_size ? 0 : alias_invariant[r_y]; - - if (i_x == 0 && i_y == 0) - break; - - if (! memrefs_conflict_p (xsize, i_x ? i_x : x, - ysize, i_y ? i_y : y, c)) - return 0; - } - break; - default: break; } @@ -1803,18 +1781,6 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) return memrefs_conflict_p (xsize, x, ysize, canon_rtx (XEXP (y, 0)), c); } - if (GET_CODE (x) == ADDRESSOF) - { - if (y == frame_pointer_rtx - || GET_CODE (y) == ADDRESSOF) - return xsize <= 0 || ysize <= 0; - } - if (GET_CODE (y) == ADDRESSOF) - { - if (x == frame_pointer_rtx) - return xsize <= 0 || ysize <= 0; - } - if (CONSTANT_P (x)) { if (GET_CODE (x) == CONST_INT && GET_CODE (y) == CONST_INT) @@ -1913,7 +1879,7 @@ static int aliases_everything_p (rtx mem) { if (GET_CODE (XEXP (mem, 0)) == AND) - /* If the address is an AND, its very hard to know at what it is + /* If the address is an AND, it's very hard to know at what it is actually pointing. */ return 1; @@ -1936,13 +1902,13 @@ nonoverlapping_component_refs_p (tree x, tree y) do { fieldx = TREE_OPERAND (x, 1); - typex = DECL_FIELD_CONTEXT (fieldx); + typex = TYPE_MAIN_VARIANT (DECL_FIELD_CONTEXT (fieldx)); y = orig_y; do { fieldy = TREE_OPERAND (y, 1); - typey = DECL_FIELD_CONTEXT (fieldy); + typey = TYPE_MAIN_VARIANT (DECL_FIELD_CONTEXT (fieldy)); if (typex == typey) goto found; @@ -1954,7 +1920,6 @@ nonoverlapping_component_refs_p (tree x, tree y) x = TREE_OPERAND (x, 0); } while (x && TREE_CODE (x) == COMPONENT_REF); - /* Never found a common type. */ return false; @@ -2005,11 +1970,12 @@ adjust_offset_for_component_ref (tree x, rtx offset) ioffset = INTVAL (offset); do { + tree offset = component_ref_field_offset (x); tree field = TREE_OPERAND (x, 1); - if (! host_integerp (DECL_FIELD_OFFSET (field), 1)) + if (! host_integerp (offset, 1)) return NULL_RTX; - ioffset += (tree_low_cst (DECL_FIELD_OFFSET (field), 1) + ioffset += (tree_low_cst (offset, 1) + (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1) / BITS_PER_UNIT)); @@ -2042,17 +2008,29 @@ nonoverlapping_memrefs_p (rtx x, rtx y) && nonoverlapping_component_refs_p (exprx, expry)) return 1; + /* If the field reference test failed, look at the DECLs involved. */ moffsetx = MEM_OFFSET (x); if (TREE_CODE (exprx) == COMPONENT_REF) { - tree t = decl_for_component_ref (exprx); - if (! t) - return 0; - moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); - exprx = t; + if (TREE_CODE (expry) == VAR_DECL + && POINTER_TYPE_P (TREE_TYPE (expry))) + { + tree field = TREE_OPERAND (exprx, 1); + tree fieldcontext = DECL_FIELD_CONTEXT (field); + if (ipa_type_escape_field_does_not_clobber_p (fieldcontext, + TREE_TYPE (field))) + return 1; + } + { + tree t = decl_for_component_ref (exprx); + if (! t) + return 0; + moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); + exprx = t; + } } - else if (TREE_CODE (exprx) == INDIRECT_REF) + else if (INDIRECT_REF_P (exprx)) { exprx = TREE_OPERAND (exprx, 0); if (flag_argument_noalias < 2 @@ -2063,13 +2041,24 @@ nonoverlapping_memrefs_p (rtx x, rtx y) moffsety = MEM_OFFSET (y); if (TREE_CODE (expry) == COMPONENT_REF) { - tree t = decl_for_component_ref (expry); - if (! t) - return 0; - moffsety = adjust_offset_for_component_ref (expry, moffsety); - expry = t; + if (TREE_CODE (exprx) == VAR_DECL + && POINTER_TYPE_P (TREE_TYPE (exprx))) + { + tree field = TREE_OPERAND (expry, 1); + tree fieldcontext = DECL_FIELD_CONTEXT (field); + if (ipa_type_escape_field_does_not_clobber_p (fieldcontext, + TREE_TYPE (field))) + return 1; + } + { + tree t = decl_for_component_ref (expry); + if (! t) + return 0; + moffsety = adjust_offset_for_component_ref (expry, moffsety); + expry = t; + } } - else if (TREE_CODE (expry) == INDIRECT_REF) + else if (INDIRECT_REF_P (expry)) { expry = TREE_OPERAND (expry, 0); if (flag_argument_noalias < 2 @@ -2086,7 +2075,7 @@ nonoverlapping_memrefs_p (rtx x, rtx y) /* If either RTL is not a MEM, it must be a REG or CONCAT, meaning they can't overlap unless they are the same because we never reuse that part of the stack frame used for locals for spilled pseudos. */ - if ((GET_CODE (rtlx) != MEM || GET_CODE (rtly) != MEM) + if ((!MEM_P (rtlx) || !MEM_P (rtly)) && ! rtx_equal_p (rtlx, rtly)) return 1; @@ -2094,11 +2083,11 @@ nonoverlapping_memrefs_p (rtx x, rtx y) know both are and are the same, so use that as the base. The only we can avoid overlap is if we can deduce that they are nonoverlapping pieces of that decl, which is very rare. */ - basex = GET_CODE (rtlx) == MEM ? XEXP (rtlx, 0) : rtlx; + basex = MEM_P (rtlx) ? XEXP (rtlx, 0) : rtlx; if (GET_CODE (basex) == PLUS && GET_CODE (XEXP (basex, 1)) == CONST_INT) offsetx = INTVAL (XEXP (basex, 1)), basex = XEXP (basex, 0); - basey = GET_CODE (rtly) == MEM ? XEXP (rtly, 0) : rtly; + basey = MEM_P (rtly) ? XEXP (rtly, 0) : rtly; if (GET_CODE (basey) == PLUS && GET_CODE (XEXP (basey, 1)) == CONST_INT) offsety = INTVAL (XEXP (basey, 1)), basey = XEXP (basey, 0); @@ -2113,10 +2102,10 @@ nonoverlapping_memrefs_p (rtx x, rtx y) || (CONSTANT_P (basey) && REG_P (basex) && REGNO_PTR_FRAME_P (REGNO (basex)))); - sizex = (GET_CODE (rtlx) != MEM ? (int) GET_MODE_SIZE (GET_MODE (rtlx)) + sizex = (!MEM_P (rtlx) ? (int) GET_MODE_SIZE (GET_MODE (rtlx)) : MEM_SIZE (rtlx) ? INTVAL (MEM_SIZE (rtlx)) : -1); - sizey = (GET_CODE (rtly) != MEM ? (int) GET_MODE_SIZE (GET_MODE (rtly)) + sizey = (!MEM_P (rtly) ? (int) GET_MODE_SIZE (GET_MODE (rtly)) : MEM_SIZE (rtly) ? INTVAL (MEM_SIZE (rtly)) : -1); @@ -2165,21 +2154,17 @@ true_dependence (rtx mem, enum machine_mode mem_mode, rtx x, return 1; if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH) return 1; + if (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER + || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) + return 1; if (DIFFERENT_ALIAS_SETS_P (x, mem)) return 0; - /* Unchanging memory can't conflict with non-unchanging memory. - A non-unchanging read can conflict with a non-unchanging write. - An unchanging read can conflict with an unchanging write since - there may be a single store to this address to initialize it. - Note that an unchanging store can conflict with a non-unchanging read - since we have to make conservative assumptions when we have a - record with readonly fields and we are copying the whole thing. - Just fall through to the code below to resolve potential conflicts. - This won't handle all cases optimally, but the possible performance - loss should be negligible. */ - if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem)) + /* Read-only memory is by definition never modified, and therefore can't + conflict with anything. We don't expect to find read-only set on MEM, + but stupid user tricks can produce them, so don't die. */ + if (MEM_READONLY_P (x)) return 0; if (nonoverlapping_memrefs_p (mem, x)) @@ -2245,18 +2230,17 @@ canon_true_dependence (rtx mem, enum machine_mode mem_mode, rtx mem_addr, return 1; if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH) return 1; + if (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER + || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) + return 1; if (DIFFERENT_ALIAS_SETS_P (x, mem)) return 0; - /* If X is an unchanging read, then it can't possibly conflict with any - non-unchanging store. It may conflict with an unchanging write though, - because there may be a single store to this address to initialize it. - Just fall through to the code below to resolve the case where we have - both an unchanging read and an unchanging write. This won't handle all - cases optimally, but the possible performance loss should be - negligible. */ - if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem)) + /* Read-only memory is by definition never modified, and therefore can't + conflict with anything. We don't expect to find read-only set on MEM, + but stupid user tricks can produce them, so don't die. */ + if (MEM_READONLY_P (x)) return 0; if (nonoverlapping_memrefs_p (x, mem)) @@ -2290,11 +2274,10 @@ canon_true_dependence (rtx mem, enum machine_mode mem_mode, rtx mem_addr, } /* Returns nonzero if a write to X might alias a previous read from - (or, if WRITEP is nonzero, a write to) MEM. If CONSTP is nonzero, - honor the RTX_UNCHANGING_P flags on X and MEM. */ + (or, if WRITEP is nonzero, a write to) MEM. */ static int -write_dependence_p (rtx mem, rtx x, int writep, int constp) +write_dependence_p (rtx mem, rtx x, int writep) { rtx x_addr, mem_addr; rtx fixed_scalar; @@ -2309,22 +2292,16 @@ write_dependence_p (rtx mem, rtx x, int writep, int constp) return 1; if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH) return 1; + if (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER + || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) + return 1; if (DIFFERENT_ALIAS_SETS_P (x, mem)) return 0; - if (constp) - { - /* Unchanging memory can't conflict with non-unchanging memory. */ - if (RTX_UNCHANGING_P (x) != RTX_UNCHANGING_P (mem)) - return 0; - - /* If MEM is an unchanging read, then it can't possibly conflict with - the store to X, because there is at most one store to MEM, and it - must have occurred somewhere before MEM. */ - if (! writep && RTX_UNCHANGING_P (mem)) - return 0; - } + /* A read from read-only memory can't conflict with read-write memory. */ + if (!writep && MEM_READONLY_P (mem)) + return 0; if (nonoverlapping_memrefs_p (x, mem)) return 0; @@ -2365,7 +2342,7 @@ write_dependence_p (rtx mem, rtx x, int writep, int constp) int anti_dependence (rtx mem, rtx x) { - return write_dependence_p (mem, x, /*writep=*/0, /*constp*/1); + return write_dependence_p (mem, x, /*writep=*/0); } /* Output dependence: X is written after store in MEM takes place. */ @@ -2373,363 +2350,7 @@ anti_dependence (rtx mem, rtx x) int output_dependence (rtx mem, rtx x) { - return write_dependence_p (mem, x, /*writep=*/1, /*constp*/1); -} - -/* Unchanging anti dependence: Like anti_dependence but ignores - the UNCHANGING_RTX_P property on const variable references. */ - -int -unchanging_anti_dependence (rtx mem, rtx x) -{ - return write_dependence_p (mem, x, /*writep=*/0, /*constp*/0); -} - -/* A subroutine of nonlocal_mentioned_p, returns 1 if *LOC mentions - something which is not local to the function and is not constant. */ - -static int -nonlocal_mentioned_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *loc; - rtx base; - int regno; - - if (! x) - return 0; - - switch (GET_CODE (x)) - { - case SUBREG: - if (GET_CODE (SUBREG_REG (x)) == REG) - { - /* Global registers are not local. */ - if (REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER - && global_regs[subreg_regno (x)]) - return 1; - return 0; - } - break; - - case REG: - regno = REGNO (x); - /* Global registers are not local. */ - if (regno < FIRST_PSEUDO_REGISTER && global_regs[regno]) - return 1; - return 0; - - case SCRATCH: - case PC: - case CC0: - case CONST_INT: - case CONST_DOUBLE: - case CONST_VECTOR: - case CONST: - case LABEL_REF: - return 0; - - case SYMBOL_REF: - /* Constants in the function's constants pool are constant. */ - if (CONSTANT_POOL_ADDRESS_P (x)) - return 0; - return 1; - - case CALL: - /* Non-constant calls and recursion are not local. */ - return 1; - - case MEM: - /* Be overly conservative and consider any volatile memory - reference as not local. */ - if (MEM_VOLATILE_P (x)) - return 1; - base = find_base_term (XEXP (x, 0)); - if (base) - { - /* A Pmode ADDRESS could be a reference via the structure value - address or static chain. Such memory references are nonlocal. - - Thus, we have to examine the contents of the ADDRESS to find - out if this is a local reference or not. */ - if (GET_CODE (base) == ADDRESS - && GET_MODE (base) == Pmode - && (XEXP (base, 0) == stack_pointer_rtx - || XEXP (base, 0) == arg_pointer_rtx -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || XEXP (base, 0) == hard_frame_pointer_rtx -#endif - || XEXP (base, 0) == frame_pointer_rtx)) - return 0; - /* Constants in the function's constant pool are constant. */ - if (GET_CODE (base) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (base)) - return 0; - } - return 1; - - case UNSPEC_VOLATILE: - case ASM_INPUT: - return 1; - - case ASM_OPERANDS: - if (MEM_VOLATILE_P (x)) - return 1; - - /* Fall through. */ - - default: - break; - } - - return 0; -} - -/* Returns nonzero if X might mention something which is not - local to the function and is not constant. */ - -static int -nonlocal_mentioned_p (rtx x) -{ - if (INSN_P (x)) - { - if (GET_CODE (x) == CALL_INSN) - { - if (! CONST_OR_PURE_CALL_P (x)) - return 1; - x = CALL_INSN_FUNCTION_USAGE (x); - if (x == 0) - return 0; - } - else - x = PATTERN (x); - } - - return for_each_rtx (&x, nonlocal_mentioned_p_1, NULL); -} - -/* A subroutine of nonlocal_referenced_p, returns 1 if *LOC references - something which is not local to the function and is not constant. */ - -static int -nonlocal_referenced_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *loc; - - if (! x) - return 0; - - switch (GET_CODE (x)) - { - case MEM: - case REG: - case SYMBOL_REF: - case SUBREG: - return nonlocal_mentioned_p (x); - - case CALL: - /* Non-constant calls and recursion are not local. */ - return 1; - - case SET: - if (nonlocal_mentioned_p (SET_SRC (x))) - return 1; - - if (GET_CODE (SET_DEST (x)) == MEM) - return nonlocal_mentioned_p (XEXP (SET_DEST (x), 0)); - - /* If the destination is anything other than a CC0, PC, - MEM, REG, or a SUBREG of a REG that occupies all of - the REG, then X references nonlocal memory if it is - mentioned in the destination. */ - if (GET_CODE (SET_DEST (x)) != CC0 - && GET_CODE (SET_DEST (x)) != PC - && GET_CODE (SET_DEST (x)) != REG - && ! (GET_CODE (SET_DEST (x)) == SUBREG - && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG - && (((GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (x)))) - + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) - == ((GET_MODE_SIZE (GET_MODE (SET_DEST (x))) - + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)))) - return nonlocal_mentioned_p (SET_DEST (x)); - return 0; - - case CLOBBER: - if (GET_CODE (XEXP (x, 0)) == MEM) - return nonlocal_mentioned_p (XEXP (XEXP (x, 0), 0)); - return 0; - - case USE: - return nonlocal_mentioned_p (XEXP (x, 0)); - - case ASM_INPUT: - case UNSPEC_VOLATILE: - return 1; - - case ASM_OPERANDS: - if (MEM_VOLATILE_P (x)) - return 1; - - /* Fall through. */ - - default: - break; - } - - return 0; -} - -/* Returns nonzero if X might reference something which is not - local to the function and is not constant. */ - -static int -nonlocal_referenced_p (rtx x) -{ - if (INSN_P (x)) - { - if (GET_CODE (x) == CALL_INSN) - { - if (! CONST_OR_PURE_CALL_P (x)) - return 1; - x = CALL_INSN_FUNCTION_USAGE (x); - if (x == 0) - return 0; - } - else - x = PATTERN (x); - } - - return for_each_rtx (&x, nonlocal_referenced_p_1, NULL); -} - -/* A subroutine of nonlocal_set_p, returns 1 if *LOC sets - something which is not local to the function and is not constant. */ - -static int -nonlocal_set_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *loc; - - if (! x) - return 0; - - switch (GET_CODE (x)) - { - case CALL: - /* Non-constant calls and recursion are not local. */ - return 1; - - case PRE_INC: - case PRE_DEC: - case POST_INC: - case POST_DEC: - case PRE_MODIFY: - case POST_MODIFY: - return nonlocal_mentioned_p (XEXP (x, 0)); - - case SET: - if (nonlocal_mentioned_p (SET_DEST (x))) - return 1; - return nonlocal_set_p (SET_SRC (x)); - - case CLOBBER: - return nonlocal_mentioned_p (XEXP (x, 0)); - - case USE: - return 0; - - case ASM_INPUT: - case UNSPEC_VOLATILE: - return 1; - - case ASM_OPERANDS: - if (MEM_VOLATILE_P (x)) - return 1; - - /* Fall through. */ - - default: - break; - } - - return 0; -} - -/* Returns nonzero if X might set something which is not - local to the function and is not constant. */ - -static int -nonlocal_set_p (rtx x) -{ - if (INSN_P (x)) - { - if (GET_CODE (x) == CALL_INSN) - { - if (! CONST_OR_PURE_CALL_P (x)) - return 1; - x = CALL_INSN_FUNCTION_USAGE (x); - if (x == 0) - return 0; - } - else - x = PATTERN (x); - } - - return for_each_rtx (&x, nonlocal_set_p_1, NULL); -} - -/* Mark the function if it is pure or constant. */ - -void -mark_constant_function (void) -{ - rtx insn; - int nonlocal_memory_referenced; - - if (TREE_READONLY (current_function_decl) - || DECL_IS_PURE (current_function_decl) - || TREE_THIS_VOLATILE (current_function_decl) - || current_function_has_nonlocal_goto - || !(*targetm.binds_local_p) (current_function_decl)) - return; - - /* A loop might not return which counts as a side effect. */ - if (mark_dfs_back_edges ()) - return; - - nonlocal_memory_referenced = 0; - - init_alias_analysis (); - - /* Determine if this is a constant or pure function. */ - - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - { - if (! INSN_P (insn)) - continue; - - if (nonlocal_set_p (insn) || global_reg_mentioned_p (insn) - || volatile_refs_p (PATTERN (insn))) - break; - - if (! nonlocal_memory_referenced) - nonlocal_memory_referenced = nonlocal_referenced_p (insn); - } - - end_alias_analysis (); - - /* Mark the function. */ - - if (insn) - ; - else if (nonlocal_memory_referenced) - { - cgraph_rtl_info (current_function_decl)->pure_function = 1; - DECL_IS_PURE (current_function_decl) = 1; - } - else - { - cgraph_rtl_info (current_function_decl)->const_function = 1; - TREE_READONLY (current_function_decl) = 1; - } + return write_dependence_p (mem, x, /*writep=*/1); } @@ -2738,9 +2359,6 @@ init_alias_once (void) { int i; -#ifndef OUTGOING_REGNO -#define OUTGOING_REGNO(N) N -#endif for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) /* Check whether this register can hold an incoming pointer argument. FUNCTION_ARG_REGNO_P tests outgoing register @@ -2768,7 +2386,7 @@ static bool memory_modified; static void memory_modified_1 (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data) { - if (GET_CODE (x) == MEM) + if (MEM_P (x)) { if (anti_dependence (x, (rtx)data) || output_dependence (x, (rtx)data)) memory_modified = true; @@ -2777,7 +2395,7 @@ memory_modified_1 (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data) /* Return true when INSN possibly modify memory contents of MEM - (ie address can be modified). */ + (i.e. address can be modified). */ bool memory_modified_in_insn_p (rtx mem, rtx insn) { @@ -2806,32 +2424,19 @@ init_alias_analysis (void) reg_known_value = ggc_calloc (reg_known_value_size, sizeof (rtx)); reg_known_equiv_p = xcalloc (reg_known_value_size, sizeof (bool)); - /* Overallocate reg_base_value to allow some growth during loop - optimization. Loop unrolling can create a large number of - registers. */ + /* If we have memory allocated from the previous run, use it. */ if (old_reg_base_value) - { - reg_base_value = old_reg_base_value; - /* If varray gets large zeroing cost may get important. */ - if (VARRAY_SIZE (reg_base_value) > 256 - && VARRAY_SIZE (reg_base_value) > 4 * maxreg) - VARRAY_GROW (reg_base_value, maxreg); - VARRAY_CLEAR (reg_base_value); - if (VARRAY_SIZE (reg_base_value) < maxreg) - VARRAY_GROW (reg_base_value, maxreg); - } - else - { - VARRAY_RTX_INIT (reg_base_value, maxreg, "reg_base_value"); - } + reg_base_value = old_reg_base_value; - new_reg_base_value = xmalloc (maxreg * sizeof (rtx)); - reg_seen = xmalloc (maxreg); - if (! reload_completed && flag_old_unroll_loops) - { - alias_invariant = ggc_calloc (maxreg, sizeof (rtx)); - alias_invariant_size = maxreg; - } + if (reg_base_value) + VEC_truncate (rtx, reg_base_value, 0); + + VEC_safe_grow (rtx, gc, reg_base_value, maxreg); + memset (VEC_address (rtx, reg_base_value), 0, + sizeof (rtx) * VEC_length (rtx, reg_base_value)); + + new_reg_base_value = XNEWVEC (rtx, maxreg); + reg_seen = XNEWVEC (char, maxreg); /* The basic idea is that each pass through this loop will use the "constant" information from the previous pass to propagate alias @@ -2901,8 +2506,8 @@ init_alias_analysis (void) #endif /* If this insn has a noalias note, process it, Otherwise, - scan for sets. A simple set will have no side effects - which could change the base value of any other register. */ + scan for sets. A simple set will have no side effects + which could change the base value of any other register. */ if (GET_CODE (PATTERN (insn)) == SET && REG_NOTES (insn) != 0 @@ -2914,7 +2519,7 @@ init_alias_analysis (void) set = single_set (insn); if (set != 0 - && GET_CODE (SET_DEST (set)) == REG + && REG_P (SET_DEST (set)) && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER) { unsigned int regno = REGNO (SET_DEST (set)); @@ -2936,7 +2541,7 @@ init_alias_analysis (void) } else if (REG_N_SETS (regno) == 1 && GET_CODE (src) == PLUS - && GET_CODE (XEXP (src, 0)) == REG + && REG_P (XEXP (src, 0)) && (t = get_reg_known_value (REGNO (XEXP (src, 0)))) && GET_CODE (XEXP (src, 1)) == CONST_INT) { @@ -2952,22 +2557,22 @@ init_alias_analysis (void) } } } - else if (GET_CODE (insn) == NOTE + else if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) copying_arguments = false; } /* Now propagate values from new_reg_base_value to reg_base_value. */ - if (maxreg != (unsigned int) max_reg_num()) - abort (); + gcc_assert (maxreg == (unsigned int) max_reg_num()); + for (ui = 0; ui < maxreg; ui++) { if (new_reg_base_value[ui] - && new_reg_base_value[ui] != VARRAY_RTX (reg_base_value, ui) + && new_reg_base_value[ui] != VEC_index (rtx, reg_base_value, ui) && ! rtx_equal_p (new_reg_base_value[ui], - VARRAY_RTX (reg_base_value, ui))) + VEC_index (rtx, reg_base_value, ui))) { - VARRAY_RTX (reg_base_value, ui) = new_reg_base_value[ui]; + VEC_replace (rtx, reg_base_value, ui, new_reg_base_value[ui]); changed = 1; } } @@ -2996,15 +2601,15 @@ init_alias_analysis (void) pass++; for (ui = 0; ui < maxreg; ui++) { - rtx base = VARRAY_RTX (reg_base_value, ui); - if (base && GET_CODE (base) == REG) + rtx base = VEC_index (rtx, reg_base_value, ui); + if (base && REG_P (base)) { unsigned int base_regno = REGNO (base); if (base_regno == ui) /* register set from itself */ - VARRAY_RTX (reg_base_value, ui) = 0; + VEC_replace (rtx, reg_base_value, ui, 0); else - VARRAY_RTX (reg_base_value, ui) - = VARRAY_RTX (reg_base_value, base_regno); + VEC_replace (rtx, reg_base_value, ui, + VEC_index (rtx, reg_base_value, base_regno)); changed = 1; } } @@ -3023,15 +2628,11 @@ void end_alias_analysis (void) { old_reg_base_value = reg_base_value; + ggc_free (reg_known_value); reg_known_value = 0; reg_known_value_size = 0; free (reg_known_equiv_p); reg_known_equiv_p = 0; - if (alias_invariant) - { - alias_invariant = 0; - alias_invariant_size = 0; - } } #include "gt-alias.h" diff --git a/contrib/gcc/alias.h b/contrib/gcc/alias.h new file mode 100644 index 00000000000..f4ba839c6fb --- /dev/null +++ b/contrib/gcc/alias.h @@ -0,0 +1,35 @@ +/* Exported functions from alias.c + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#ifndef GCC_ALIAS_H +#define GCC_ALIAS_H + +extern HOST_WIDE_INT new_alias_set (void); +extern HOST_WIDE_INT get_varargs_alias_set (void); +extern HOST_WIDE_INT get_frame_alias_set (void); +extern bool component_uses_parent_alias_set (tree); + +/* This alias set can be used to force a memory to conflict with all + other memories, creating a barrier across which no memory reference + can move. Note that there are other legacy ways to create such + memory barriers, including an address of SCRATCH. */ +#define ALIAS_SET_MEMORY_BARRIER ((HOST_WIDE_INT) -1) + +#endif /* GCC_ALIAS_H */ diff --git a/contrib/gcc/alloc-pool.c b/contrib/gcc/alloc-pool.c index 9f1583df72b..fb40577953b 100644 --- a/contrib/gcc/alloc-pool.c +++ b/contrib/gcc/alloc-pool.c @@ -1,5 +1,5 @@ /* Functions to support a pool of allocatable objects. - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Daniel Berlin @@ -17,24 +17,14 @@ for more details. 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. */ #include "config.h" #include "system.h" #include "alloc-pool.h" #include "hashtab.h" -/* Redefine abort to report an internal error w/o coredump, and - reporting the location of the error in the source file. This logic - is duplicated in rtl.h and tree.h because every file that needs the - special abort includes one or both. toplev.h gets too few files, - system.h gets too many. */ - -extern void fancy_abort (const char *, int, const char *) - ATTRIBUTE_NORETURN; -#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) - #define align_eight(x) (((x+7) >> 3) << 3) /* The internal allocation object. */ @@ -75,7 +65,7 @@ static ALLOC_POOL_ID_TYPE last_id; #ifdef GATHER_STATISTICS -/* Store infromation about each particular alloc_pool. */ +/* Store information about each particular alloc_pool. */ struct alloc_pool_descriptor { const char *name; @@ -113,7 +103,7 @@ alloc_pool_descriptor (const char *name) slot = (struct alloc_pool_descriptor **) htab_find_slot_with_hash (alloc_pool_hash, name, - htab_hash_pointer (name), + htab_hash_pointer (name), 1); if (*slot) return *slot; @@ -135,8 +125,7 @@ create_alloc_pool (const char *name, size_t size, size_t num) struct alloc_pool_descriptor *desc; #endif - if (!name) - abort (); + gcc_assert (name); /* Make size large enough to store the list header. */ if (size < sizeof (alloc_pool_list)) @@ -151,8 +140,7 @@ create_alloc_pool (const char *name, size_t size, size_t num) #endif /* Um, we can't really allocate 0 elements per block. */ - if (num == 0) - abort (); + gcc_assert (num); /* Find the size of the pool structure, and the name. */ pool_size = sizeof (struct alloc_pool_def); @@ -201,10 +189,7 @@ free_alloc_pool (alloc_pool pool) struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name); #endif -#ifdef ENABLE_CHECKING - if (!pool) - abort (); -#endif + gcc_assert (pool); /* Free each block allocated to the pool. */ for (block = pool->block_list; block != NULL; block = next_block) @@ -215,13 +200,24 @@ free_alloc_pool (alloc_pool pool) desc->current -= pool->block_size; #endif } - /* Lastly, free the pool. */ #ifdef ENABLE_CHECKING memset (pool, 0xaf, sizeof (*pool)); #endif + /* Lastly, free the pool. */ free (pool); } +/* Frees the alloc_pool, if it is empty and zero *POOL in this case. */ +void +free_alloc_pool_if_empty (alloc_pool *pool) +{ + if ((*pool)->elts_free == (*pool)->elts_allocated) + { + free_alloc_pool (*pool); + *pool = NULL; + } +} + /* Allocates one element from the pool specified. */ void * pool_alloc (alloc_pool pool) @@ -234,10 +230,7 @@ pool_alloc (alloc_pool pool) desc->allocated+=pool->elt_size; #endif -#ifdef ENABLE_CHECKING - if (!pool) - abort (); -#endif + gcc_assert (pool); /* If there are no more free elements, make some more!. */ if (!pool->free_list) @@ -246,7 +239,7 @@ pool_alloc (alloc_pool pool) alloc_pool_list block_header; /* Make the block. */ - block = xmalloc (pool->block_size); + block = XNEWVEC (char, pool->block_size); block_header = (alloc_pool_list) block; block += align_eight (sizeof (struct alloc_pool_list_def)); #ifdef GATHER_STATISTICS @@ -266,12 +259,12 @@ pool_alloc (alloc_pool pool) /* Mark the element to be free. */ ((allocation_object *) block)->id = 0; #endif - header = (alloc_pool_list) USER_PTR_FROM_ALLOCATION_OBJECT_PTR (block); - header->next = pool->free_list; - pool->free_list = header; + header = (alloc_pool_list) USER_PTR_FROM_ALLOCATION_OBJECT_PTR (block); + header->next = pool->free_list; + pool->free_list = header; } /* Also update the number of elements we have free/allocated, and - increment the allocated block count. */ + increment the allocated block count. */ pool->elts_allocated += pool->elts_per_block; pool->elts_free += pool->elts_per_block; pool->blocks_allocated += 1; @@ -296,22 +289,19 @@ pool_free (alloc_pool pool, void *ptr) { alloc_pool_list header; -#ifdef ENABLE_CHECKING - if (!ptr) - abort (); + gcc_assert (ptr); +#ifdef ENABLE_CHECKING memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data)); /* Check whether the PTR was allocated from POOL. */ - if (pool->id != ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id) - abort (); + gcc_assert (pool->id == ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id); /* Mark the element to be free. */ ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id = 0; #else /* Check if we free more than we allocated, which is Bad (TM). */ - if (pool->elts_free + 1 > pool->elts_allocated) - abort (); + gcc_assert (pool->elts_free < pool->elts_allocated); #endif header = (alloc_pool_list) ptr; @@ -349,11 +339,15 @@ print_statistics (void **slot, void *b) #endif /* Output per-alloc_pool memory usage statistics. */ -void dump_alloc_pool_statistics (void) +void +dump_alloc_pool_statistics (void) { #ifdef GATHER_STATISTICS struct output_info info; + if (!alloc_pool_hash) + return; + fprintf (stderr, "\nAlloc-pool Kind Pools Allocated Peak Leak\n"); fprintf (stderr, "-------------------------------------------------------------\n"); info.count = 0; diff --git a/contrib/gcc/alloc-pool.h b/contrib/gcc/alloc-pool.h index 0eb2c9685b8..82188f4c064 100644 --- a/contrib/gcc/alloc-pool.h +++ b/contrib/gcc/alloc-pool.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef ALLOC_POOL_H #define ALLOC_POOL_H @@ -49,6 +49,7 @@ typedef struct alloc_pool_def extern alloc_pool create_alloc_pool (const char *, size_t, size_t); extern void free_alloc_pool (alloc_pool); +extern void free_alloc_pool_if_empty (alloc_pool *); extern void *pool_alloc (alloc_pool); extern void pool_free (alloc_pool, void *); extern void dump_alloc_pool_statistics (void); diff --git a/contrib/gcc/attribs.c b/contrib/gcc/attribs.c index 3286bf309df..7377c57691d 100644 --- a/contrib/gcc/attribs.c +++ b/contrib/gcc/attribs.c @@ -1,6 +1,6 @@ /* Functions dealing with attribute handling, used by most front ends. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "output.h" #include "rtl.h" #include "ggc.h" -#include "expr.h" #include "tm_p.h" #include "cpplib.h" #include "target.h" @@ -78,25 +77,25 @@ init_attributes (void) /* The name must not begin and end with __. */ const char *name = attribute_tables[i][j].name; int len = strlen (name); - if (name[0] == '_' && name[1] == '_' - && name[len - 1] == '_' && name[len - 2] == '_') - abort (); + + gcc_assert (!(name[0] == '_' && name[1] == '_' + && name[len - 1] == '_' && name[len - 2] == '_')); + /* The minimum and maximum lengths must be consistent. */ - if (attribute_tables[i][j].min_length < 0) - abort (); - if (attribute_tables[i][j].max_length != -1 - && (attribute_tables[i][j].max_length - < attribute_tables[i][j].min_length)) - abort (); + gcc_assert (attribute_tables[i][j].min_length >= 0); + + gcc_assert (attribute_tables[i][j].max_length == -1 + || (attribute_tables[i][j].max_length + >= attribute_tables[i][j].min_length)); + /* An attribute cannot require both a DECL and a TYPE. */ - if (attribute_tables[i][j].decl_required - && attribute_tables[i][j].type_required) - abort (); + gcc_assert (!attribute_tables[i][j].decl_required + || !attribute_tables[i][j].type_required); + /* If an attribute requires a function type, in particular it requires a type. */ - if (attribute_tables[i][j].function_type_required - && !attribute_tables[i][j].type_required) - abort (); + gcc_assert (!attribute_tables[i][j].function_type_required + || attribute_tables[i][j].type_required); } } @@ -106,9 +105,8 @@ init_attributes (void) int j, k; for (j = 0; attribute_tables[i][j].name != NULL; j++) for (k = j + 1; attribute_tables[i][k].name != NULL; k++) - if (!strcmp (attribute_tables[i][j].name, - attribute_tables[i][k].name)) - abort (); + gcc_assert (strcmp (attribute_tables[i][j].name, + attribute_tables[i][k].name)); } /* Check that no name occurs in more than one table. */ for (i = 0; i < ARRAY_SIZE (attribute_tables); i++) @@ -118,9 +116,8 @@ init_attributes (void) for (j = i + 1; j < ARRAY_SIZE (attribute_tables); j++) for (k = 0; attribute_tables[i][k].name != NULL; k++) for (l = 0; attribute_tables[j][l].name != NULL; l++) - if (!strcmp (attribute_tables[i][k].name, - attribute_tables[j][l].name)) - abort (); + gcc_assert (strcmp (attribute_tables[i][k].name, + attribute_tables[j][l].name)); } #endif @@ -145,7 +142,7 @@ decl_attributes (tree *node, tree attributes, int flags) if (!attributes_initialized) init_attributes (); - (*targetm.insert_attributes) (*node, &attributes); + targetm.insert_attributes (*node, &attributes); for (a = attributes; a; a = TREE_CHAIN (a)) { @@ -175,7 +172,7 @@ decl_attributes (tree *node, tree attributes, int flags) if (spec == NULL) { - warning ("`%s' attribute directive ignored", + warning (OPT_Wattributes, "%qs attribute directive ignored", IDENTIFIER_POINTER (name)); continue; } @@ -183,7 +180,7 @@ decl_attributes (tree *node, tree attributes, int flags) || (spec->max_length >= 0 && list_length (args) > spec->max_length)) { - error ("wrong number of arguments specified for `%s' attribute", + error ("wrong number of arguments specified for %qs attribute", IDENTIFIER_POINTER (name)); continue; } @@ -200,7 +197,7 @@ decl_attributes (tree *node, tree attributes, int flags) } else { - warning ("`%s' attribute does not apply to types", + warning (OPT_Wattributes, "%qs attribute does not apply to types", IDENTIFIER_POINTER (name)); continue; } @@ -230,8 +227,8 @@ decl_attributes (tree *node, tree attributes, int flags) pull out the target type now, frob it as appropriate, and rebuild the pointer type later. - This would all be simpler if attributes were part of the - declarator, grumble grumble. */ + This would all be simpler if attributes were part of the + declarator, grumble grumble. */ fn_ptr_tmp = TREE_TYPE (*anode); anode = &fn_ptr_tmp; flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; @@ -246,12 +243,21 @@ decl_attributes (tree *node, tree attributes, int flags) if (TREE_CODE (*anode) != FUNCTION_TYPE && TREE_CODE (*anode) != METHOD_TYPE) { - warning ("`%s' attribute only applies to function types", + warning (OPT_Wattributes, + "%qs attribute only applies to function types", IDENTIFIER_POINTER (name)); continue; } } + if (TYPE_P (*anode) + && (flags & (int) ATTR_FLAG_TYPE_IN_PLACE) + && TYPE_SIZE (*anode) != NULL_TREE) + { + warning (OPT_Wattributes, "type attributes ignored after type is already defined"); + continue; + } + if (spec->handler != NULL) returned_attrs = chainon ((*spec->handler) (anode, name, args, flags, &no_add_attrs), @@ -262,15 +268,7 @@ decl_attributes (tree *node, tree attributes, int flags) && (TREE_CODE (*node) == VAR_DECL || TREE_CODE (*node) == PARM_DECL || TREE_CODE (*node) == RESULT_DECL)) - { - /* Force a recalculation of mode and size. */ - DECL_MODE (*node) = VOIDmode; - DECL_SIZE (*node) = 0; - if (!DECL_USER_ALIGN (*node)) - DECL_ALIGN (*node) = 0; - - layout_decl (*node, 0); - } + relayout_decl (*node); if (!no_add_attrs) { @@ -296,7 +294,26 @@ decl_attributes (tree *node, tree attributes, int flags) if (DECL_P (*anode)) DECL_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); else if (flags & (int) ATTR_FLAG_TYPE_IN_PLACE) - TYPE_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); + { + TYPE_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs); + /* If this is the main variant, also push the attributes + out to the other variants. */ + if (*anode == TYPE_MAIN_VARIANT (*anode)) + { + tree variant; + for (variant = *anode; variant; + variant = TYPE_NEXT_VARIANT (variant)) + { + if (TYPE_ATTRIBUTES (variant) == old_attrs) + TYPE_ATTRIBUTES (variant) + = TYPE_ATTRIBUTES (*anode); + else if (!lookup_attribute + (spec->name, TYPE_ATTRIBUTES (variant))) + TYPE_ATTRIBUTES (variant) = tree_cons + (name, args, TYPE_ATTRIBUTES (variant)); + } + } + } else *anode = build_type_attribute_variant (*anode, tree_cons (name, args, @@ -311,114 +328,13 @@ decl_attributes (tree *node, tree attributes, int flags) fn_ptr_tmp = build_pointer_type (fn_ptr_tmp); if (DECL_P (*node)) TREE_TYPE (*node) = fn_ptr_tmp; - else if (TREE_CODE (*node) == POINTER_TYPE) - *node = fn_ptr_tmp; else - abort (); + { + gcc_assert (TREE_CODE (*node) == POINTER_TYPE); + *node = fn_ptr_tmp; + } } } return returned_attrs; } - -/* Split SPECS_ATTRS, a list of declspecs and prefix attributes, into two - lists. SPECS_ATTRS may also be just a typespec (eg: RECORD_TYPE). - - The head of the declspec list is stored in DECLSPECS. - The head of the attribute list is stored in PREFIX_ATTRIBUTES. - - Note that attributes in SPECS_ATTRS are stored in the TREE_PURPOSE of - the list elements. We drop the containing TREE_LIST nodes and link the - resulting attributes together the way decl_attributes expects them. */ - -void -split_specs_attrs (tree specs_attrs, tree *declspecs, tree *prefix_attributes) -{ - tree t, s, a, next, specs, attrs; - - /* This can happen after an __extension__ in pedantic mode. */ - if (specs_attrs != NULL_TREE - && TREE_CODE (specs_attrs) == INTEGER_CST) - { - *declspecs = NULL_TREE; - *prefix_attributes = NULL_TREE; - return; - } - - /* This can happen in c++ (eg: decl: typespec initdecls ';'). */ - if (specs_attrs != NULL_TREE - && TREE_CODE (specs_attrs) != TREE_LIST) - { - *declspecs = specs_attrs; - *prefix_attributes = NULL_TREE; - return; - } - - /* Remember to keep the lists in the same order, element-wise. */ - - specs = s = NULL_TREE; - attrs = a = NULL_TREE; - for (t = specs_attrs; t; t = next) - { - next = TREE_CHAIN (t); - /* Declspecs have a non-NULL TREE_VALUE. */ - if (TREE_VALUE (t) != NULL_TREE) - { - if (specs == NULL_TREE) - specs = s = t; - else - { - TREE_CHAIN (s) = t; - s = t; - } - } - /* The TREE_PURPOSE may also be empty in the case of - __attribute__(()). */ - else if (TREE_PURPOSE (t) != NULL_TREE) - { - if (attrs == NULL_TREE) - attrs = a = TREE_PURPOSE (t); - else - { - TREE_CHAIN (a) = TREE_PURPOSE (t); - a = TREE_PURPOSE (t); - } - /* More attrs can be linked here, move A to the end. */ - while (TREE_CHAIN (a) != NULL_TREE) - a = TREE_CHAIN (a); - } - } - - /* Terminate the lists. */ - if (s != NULL_TREE) - TREE_CHAIN (s) = NULL_TREE; - if (a != NULL_TREE) - TREE_CHAIN (a) = NULL_TREE; - - /* All done. */ - *declspecs = specs; - *prefix_attributes = attrs; -} - -/* Strip attributes from SPECS_ATTRS, a list of declspecs and attributes. - This function is used by the parser when a rule will accept attributes - in a particular position, but we don't want to support that just yet. - - A warning is issued for every ignored attribute. */ - -tree -strip_attrs (tree specs_attrs) -{ - tree specs, attrs; - - split_specs_attrs (specs_attrs, &specs, &attrs); - - while (attrs) - { - warning ("`%s' attribute ignored", - IDENTIFIER_POINTER (TREE_PURPOSE (attrs))); - attrs = TREE_CHAIN (attrs); - } - - return specs; -} diff --git a/contrib/gcc/basic-block.h b/contrib/gcc/basic-block.h index 5c6dd5c5e6d..0ab2a007c4c 100644 --- a/contrib/gcc/basic-block.h +++ b/contrib/gcc/basic-block.h @@ -1,5 +1,5 @@ /* Define control and data flow tables, and regsets. - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #ifndef GCC_BASIC_BLOCK_H #define GCC_BASIC_BLOCK_H @@ -27,14 +27,24 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "varray.h" #include "partition.h" #include "hard-reg-set.h" +#include "predict.h" +#include "vec.h" +#include "function.h" /* Head of register set linked list. */ typedef bitmap_head regset_head; + /* A pointer to a regset_head. */ typedef bitmap regset; +/* Allocate a register set with oballoc. */ +#define ALLOC_REG_SET(OBSTACK) BITMAP_ALLOC (OBSTACK) + +/* Do any cleanup needed on a regset when it is no longer used. */ +#define FREE_REG_SET(REGSET) BITMAP_FREE (REGSET) + /* Initialize a new regset. */ -#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, 1) +#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, ®_obstack) /* Clear a register set by freeing up the linked list. */ #define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD) @@ -46,21 +56,20 @@ typedef bitmap regset; #define REG_SET_EQUAL_P(A, B) bitmap_equal_p (A, B) /* `and' a register set with a second register set. */ -#define AND_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_AND) +#define AND_REG_SET(TO, FROM) bitmap_and_into (TO, FROM) /* `and' the complement of a register set with a register set. */ -#define AND_COMPL_REG_SET(TO, FROM) \ - bitmap_operation (TO, TO, FROM, BITMAP_AND_COMPL) +#define AND_COMPL_REG_SET(TO, FROM) bitmap_and_compl_into (TO, FROM) /* Inclusive or a register set with a second register set. */ -#define IOR_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_IOR) +#define IOR_REG_SET(TO, FROM) bitmap_ior_into (TO, FROM) /* Exclusive or a register set with a second register set. */ -#define XOR_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_XOR) +#define XOR_REG_SET(TO, FROM) bitmap_xor_into (TO, FROM) /* Or into TO the register set FROM1 `and'ed with the complement of FROM2. */ #define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2) \ - bitmap_ior_and_compl (TO, FROM1, FROM2) + bitmap_ior_and_compl_into (TO, FROM1, FROM2) /* Clear a single register in a register set. */ #define CLEAR_REGNO_REG_SET(HEAD, REG) bitmap_clear_bit (HEAD, REG) @@ -79,39 +88,24 @@ do { \ reg_set_to_hard_reg_set (&TO, FROM); \ } while (0) +typedef bitmap_iterator reg_set_iterator; + /* Loop over all registers in REGSET, starting with MIN, setting REGNUM to the register number and executing CODE for all registers that are set. */ -#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, CODE) \ - EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, CODE) +#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, RSI) \ + EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, RSI) /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting REGNUM to the register number and executing CODE for all registers that are set in the first regset and not set in the second. */ -#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \ - EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE) +#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \ + EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) /* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting REGNUM to the register number and executing CODE for all registers that are set in both regsets. */ -#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \ - EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE) - -/* Allocate a register set with oballoc. */ -#define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK) - -/* Initialize a register set. Returns the new register set. */ -#define INITIALIZE_REG_SET(HEAD) bitmap_initialize (&HEAD, 1) - -/* Do any cleanup needed on a regset when it is no longer used. */ -#define FREE_REG_SET(REGSET) BITMAP_FREE(REGSET) - -/* Do any one-time initializations needed for regsets. */ -#define INIT_ONCE_REG_SET() BITMAP_INIT_ONCE () - -/* Grow any tables needed when the number of registers is calculated - or extended. For the linked list allocation, nothing needs to - be done, other than zero the statistics on the first allocation. */ -#define MAX_REGNO_REG_SET(NUM_REGS, NEW_P, RENUMBER_P) +#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \ + EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \ /* Type we use to hold basic block counters. Should be at least 64bit. Although a counter cannot be negative, we use a signed @@ -121,24 +115,37 @@ do { \ typedef HOST_WIDEST_INT gcov_type; /* Control flow edge information. */ -typedef struct edge_def { - /* Links through the predecessor and successor lists. */ - struct edge_def *pred_next, *succ_next; - +struct edge_def GTY(()) +{ /* The two blocks at the ends of the edge. */ - struct basic_block_def *src, *dest; + struct basic_block_def *src; + struct basic_block_def *dest; /* Instructions queued on the edge. */ - rtx insns; + union edge_def_insns { + rtx GTY ((tag ("0"))) r; + tree GTY ((tag ("1"))) t; + } GTY ((desc ("ir_type ()"))) insns; /* Auxiliary info specific to a pass. */ - void *aux; + PTR GTY ((skip (""))) aux; + + /* Location of any goto implicit in the edge, during tree-ssa. */ + source_locus goto_locus; int flags; /* see EDGE_* below */ int probability; /* biased by REG_BR_PROB_BASE */ gcov_type count; /* Expected number of executions calculated in profile.c */ -} *edge; + + /* The index number corresponding to this edge in the edge vector + dest->preds. */ + unsigned int dest_idx; +}; + +typedef struct edge_def *edge; +DEF_VEC_P(edge); +DEF_VEC_ALLOC_P(edge,gc); #define EDGE_FALLTHRU 1 /* 'Straight line' flow */ #define EDGE_ABNORMAL 2 /* Strange flow, like computed @@ -153,7 +160,16 @@ typedef struct edge_def { #define EDGE_IRREDUCIBLE_LOOP 128 /* Part of irreducible loop. */ #define EDGE_SIBCALL 256 /* Edge from sibcall to exit. */ #define EDGE_LOOP_EXIT 512 /* Exit of a loop. */ -#define EDGE_ALL_FLAGS 1023 +#define EDGE_TRUE_VALUE 1024 /* Edge taken when controlling + predicate is nonzero. */ +#define EDGE_FALSE_VALUE 2048 /* Edge taken when controlling + predicate is zero. */ +#define EDGE_EXECUTABLE 4096 /* Edge is executable. Only + valid during SSA-CCP. */ +#define EDGE_CROSSING 8192 /* Edge crosses between hot + and cold sections, when we + do partitioning. */ +#define EDGE_ALL_FLAGS 16383 #define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH) @@ -165,6 +181,10 @@ extern const struct gcov_ctr_summary *profile_info; struct loop; struct loops; +/* Declared in tree-flow.h. */ +struct edge_prediction; +struct rtl_bb_info; + /* A basic block is a sequence of instructions with only entry and only one exit. If any one of the instructions are executed, they will all be executed, and in sequence from first to last. @@ -191,102 +211,233 @@ struct loops; basic blocks. */ /* Basic block information indexed by block number. */ -typedef struct basic_block_def { - /* The first and last insns of the block. */ - rtx head_, end_; - - /* The first and last trees of the block. */ - tree head_tree; - tree end_tree; +struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) +{ + /* Pointers to the first and last trees of the block. */ + tree stmt_list; /* The edges into and out of the block. */ - edge pred, succ; - - /* Liveness info. */ - - /* The registers that are modified within this in block. */ - regset local_set; - /* The registers that are conditionally modified within this block. - In other words, registers that are set only as part of a - COND_EXEC. */ - regset cond_local_set; - /* The registers that are live on entry to this block. - - Note that in SSA form, global_live_at_start does not reflect the - use of regs in phi functions, since the liveness of these regs - may depend on which edge was taken into the block. */ - regset global_live_at_start; - /* The registers that are live on exit from this block. */ - regset global_live_at_end; + VEC(edge,gc) *preds; + VEC(edge,gc) *succs; /* Auxiliary info specific to a pass. */ - void *aux; + PTR GTY ((skip (""))) aux; + + /* Innermost loop containing the block. */ + struct loop * GTY ((skip (""))) loop_father; + + /* The dominance and postdominance information node. */ + struct et_node * GTY ((skip (""))) dom[2]; + + /* Previous and next blocks in the chain. */ + struct basic_block_def *prev_bb; + struct basic_block_def *next_bb; + + union basic_block_il_dependent { + struct rtl_bb_info * GTY ((tag ("1"))) rtl; + } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il; + + /* Chain of PHI nodes for this block. */ + tree phi_nodes; + + /* A list of predictions. */ + struct edge_prediction *predictions; + + /* Expected number of executions: calculated in profile.c. */ + gcov_type count; /* The index of this block. */ int index; - /* Previous and next blocks in the chain. */ - struct basic_block_def *prev_bb, *next_bb; - /* The loop depth of this block. */ int loop_depth; - /* Outermost loop containing the block. */ - struct loop *loop_father; - - /* The dominance and postdominance information node. */ - struct et_node *dom[2]; - - /* Expected number of executions: calculated in profile.c. */ - gcov_type count; - /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */ int frequency; /* Various flags. See BB_* below. */ int flags; +}; - /* Additional data maintained by cfg_layout routines. */ - struct reorder_block_def *rbi; -} *basic_block; +struct rtl_bb_info GTY(()) +{ + /* The first and last insns of the block. */ + rtx head_; + rtx end_; + + /* The registers that are live on entry to this block. */ + bitmap GTY ((skip (""))) global_live_at_start; + + /* The registers that are live on exit from this block. */ + bitmap GTY ((skip (""))) global_live_at_end; + + /* In CFGlayout mode points to insn notes/jumptables to be placed just before + and after the block. */ + rtx header; + rtx footer; + + /* This field is used by the bb-reorder and tracer passes. */ + int visited; +}; + +typedef struct basic_block_def *basic_block; + +DEF_VEC_P(basic_block); +DEF_VEC_ALLOC_P(basic_block,gc); +DEF_VEC_ALLOC_P(basic_block,heap); #define BB_FREQ_MAX 10000 -/* Masks for basic_block.flags. */ -#define BB_DIRTY 1 -#define BB_NEW 2 -#define BB_REACHABLE 4 -#define BB_VISITED 8 -#define BB_IRREDUCIBLE_LOOP 16 -#define BB_SUPERBLOCK 32 +/* Masks for basic_block.flags. -/* Number of basic blocks in the current function. */ + BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout + the compilation, so they are never cleared. -extern int n_basic_blocks; + All other flags may be cleared by clear_bb_flags(). It is generally + a bad idea to rely on any flags being up-to-date. */ -/* First free basic block number. */ +enum bb_flags +{ -extern int last_basic_block; + /* Set if insns in BB have are modified. Used for updating liveness info. */ + BB_DIRTY = 1, -/* Number of edges in the current function. */ + /* Only set on blocks that have just been created by create_bb. */ + BB_NEW = 2, -extern int n_edges; + /* Set by find_unreachable_blocks. Do not rely on this being set in any + pass. */ + BB_REACHABLE = 4, -/* Index by basic block number, get basic block struct info. */ + /* Set for blocks in an irreducible loop by loop analysis. */ + BB_IRREDUCIBLE_LOOP = 8, -extern varray_type basic_block_info; + /* Set on blocks that may actually not be single-entry single-exit block. */ + BB_SUPERBLOCK = 16, -#define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N))) + /* Set on basic blocks that the scheduler should not touch. This is used + by SMS to prevent other schedulers from messing with the loop schedule. */ + BB_DISABLE_SCHEDULE = 32, + + /* Set on blocks that should be put in a hot section. */ + BB_HOT_PARTITION = 64, + + /* Set on blocks that should be put in a cold section. */ + BB_COLD_PARTITION = 128, + + /* Set on block that was duplicated. */ + BB_DUPLICATED = 256, + + /* Set on blocks that are in RTL format. */ + BB_RTL = 1024, + + /* Set on blocks that are forwarder blocks. + Only used in cfgcleanup.c. */ + BB_FORWARDER_BLOCK = 2048, + + /* Set on blocks that cannot be threaded through. + Only used in cfgcleanup.c. */ + BB_NONTHREADABLE_BLOCK = 4096 +}; + +/* Dummy flag for convenience in the hot/cold partitioning code. */ +#define BB_UNPARTITIONED 0 + +/* Partitions, to be used when partitioning hot and cold basic blocks into + separate sections. */ +#define BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION)) +#define BB_SET_PARTITION(bb, part) do { \ + basic_block bb_ = (bb); \ + bb_->flags = ((bb_->flags & ~(BB_HOT_PARTITION|BB_COLD_PARTITION)) \ + | (part)); \ +} while (0) + +#define BB_COPY_PARTITION(dstbb, srcbb) \ + BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) + +/* A structure to group all the per-function control flow graph data. + The x_* prefixing is necessary because otherwise references to the + fields of this struct are interpreted as the defines for backward + source compatibility following the definition of this struct. */ +struct control_flow_graph GTY(()) +{ + /* Block pointers for the exit and entry of a function. + These are always the head and tail of the basic block list. */ + basic_block x_entry_block_ptr; + basic_block x_exit_block_ptr; + + /* Index by basic block number, get basic block struct info. */ + VEC(basic_block,gc) *x_basic_block_info; + + /* Number of basic blocks in this flow graph. */ + int x_n_basic_blocks; + + /* Number of edges in this flow graph. */ + int x_n_edges; + + /* The first free basic block number. */ + int x_last_basic_block; + + /* Mapping of labels to their associated blocks. At present + only used for the tree CFG. */ + VEC(basic_block,gc) *x_label_to_block_map; + + enum profile_status { + PROFILE_ABSENT, + PROFILE_GUESSED, + PROFILE_READ + } x_profile_status; +}; + +/* Defines for accessing the fields of the CFG structure for function FN. */ +#define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr) +#define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr) +#define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info) +#define n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks) +#define n_edges_for_function(FN) ((FN)->cfg->x_n_edges) +#define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block) +#define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map) + +#define BASIC_BLOCK_FOR_FUNCTION(FN,N) \ + (VEC_index (basic_block, basic_block_info_for_function(FN), (N))) + +/* Defines for textual backward source compatibility. */ +#define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr) +#define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr) +#define basic_block_info (cfun->cfg->x_basic_block_info) +#define n_basic_blocks (cfun->cfg->x_n_basic_blocks) +#define n_edges (cfun->cfg->x_n_edges) +#define last_basic_block (cfun->cfg->x_last_basic_block) +#define label_to_block_map (cfun->cfg->x_label_to_block_map) +#define profile_status (cfun->cfg->x_profile_status) + +#define BASIC_BLOCK(N) (VEC_index (basic_block, basic_block_info, (N))) +#define SET_BASIC_BLOCK(N,BB) (VEC_replace (basic_block, basic_block_info, (N), (BB))) /* For iterating over basic blocks. */ #define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \ for (BB = FROM; BB != TO; BB = BB->DIR) -#define FOR_EACH_BB(BB) \ - FOR_BB_BETWEEN (BB, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR, next_bb) +#define FOR_EACH_BB_FN(BB, FN) \ + FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb) -#define FOR_EACH_BB_REVERSE(BB) \ - FOR_BB_BETWEEN (BB, EXIT_BLOCK_PTR->prev_bb, ENTRY_BLOCK_PTR, prev_bb) +#define FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun) + +#define FOR_EACH_BB_REVERSE_FN(BB, FN) \ + FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb) + +#define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN(BB, cfun) + +/* For iterating over insns in basic block. */ +#define FOR_BB_INSNS(BB, INSN) \ + for ((INSN) = BB_HEAD (BB); \ + (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \ + (INSN) = NEXT_INSN (INSN)) + +#define FOR_BB_INSNS_REVERSE(BB, INSN) \ + for ((INSN) = BB_END (BB); \ + (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \ + (INSN) = PREV_INSN (INSN)) /* Cycles through _all_ basic blocks, even the fake ones (entry and exit block). */ @@ -294,16 +445,10 @@ extern varray_type basic_block_info; #define FOR_ALL_BB(BB) \ for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb) -/* What registers are live at the setjmp call. */ +#define FOR_ALL_BB_FN(BB, FN) \ + for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb) -extern regset regs_live_at_setjmp; - -/* Special labels found during CFG build. */ - -extern GTY(()) rtx label_value_list; -extern GTY(()) rtx tail_recursion_label_list; - -extern struct obstack flow_obstack; +extern bitmap_obstack reg_obstack; /* Indexed by n, gives number of basic block that (REG n) is used in. If the value is REG_BLOCK_GLOBAL (-2), @@ -315,46 +460,42 @@ extern struct obstack flow_obstack; #define REG_BLOCK_UNKNOWN -1 #define REG_BLOCK_GLOBAL -2 -#define REG_BASIC_BLOCK(N) (VARRAY_REG (reg_n_info, N)->basic_block) +#define REG_BASIC_BLOCK(N) \ + (VEC_index (reg_info_p, reg_n_info, N)->basic_block) /* Stuff for recording basic block info. */ -#define BB_HEAD(B) (B)->head_ -#define BB_END(B) (B)->end_ +#define BB_HEAD(B) (B)->il.rtl->head_ +#define BB_END(B) (B)->il.rtl->end_ /* Special block numbers [markers] for entry and exit. */ -#define ENTRY_BLOCK (-1) -#define EXIT_BLOCK (-2) +#define ENTRY_BLOCK (0) +#define EXIT_BLOCK (1) -/* Special block number not valid for any block. */ -#define INVALID_BLOCK (-3) +/* The two blocks that are always in the cfg. */ +#define NUM_FIXED_BLOCKS (2) -/* Similarly, block pointers for the edge list. */ -extern struct basic_block_def entry_exit_blocks[2]; -#define ENTRY_BLOCK_PTR (&entry_exit_blocks[0]) -#define EXIT_BLOCK_PTR (&entry_exit_blocks[1]) #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0) #define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB) extern void compute_bb_for_insn (void); -extern void free_bb_for_insn (void); +extern unsigned int free_bb_for_insn (void); extern void update_bb_for_insn (basic_block); -extern void free_basic_block_vars (int); +extern void free_basic_block_vars (void); extern void insert_insn_on_edge (rtx, edge); -bool safe_insert_insn_on_edge (rtx, edge); extern void commit_edge_insertions (void); extern void commit_edge_insertions_watch_calls (void); extern void remove_fake_edges (void); +extern void remove_fake_exit_edges (void); extern void add_noreturn_fake_exit_edges (void); extern void connect_infinite_loops_to_exit (void); -extern int flow_call_edges_add (sbitmap); extern edge unchecked_make_edge (basic_block, basic_block, int); -extern edge cached_make_edge (sbitmap *, basic_block, basic_block, int); +extern edge cached_make_edge (sbitmap, basic_block, basic_block, int); extern edge make_edge (basic_block, basic_block, int); extern edge make_single_succ_edge (basic_block, basic_block, int); extern void remove_edge (edge); @@ -363,18 +504,20 @@ extern edge redirect_edge_succ_nodup (edge, basic_block); extern void redirect_edge_pred (edge, basic_block); extern basic_block create_basic_block_structure (rtx, rtx, rtx, basic_block); extern void clear_bb_flags (void); -extern void tidy_fallthru_edge (edge, basic_block, basic_block); -extern void tidy_fallthru_edges (void); -extern void flow_reverse_top_sort_order_compute (int *); -extern int flow_depth_first_order_compute (int *, int *); -extern void flow_preorder_transversal_compute (int *); +extern int post_order_compute (int *, bool); +extern int pre_and_rev_post_order_compute (int *, int *, bool); extern int dfs_enumerate_from (basic_block, int, bool (*)(basic_block, void *), basic_block *, int, void *); +extern void compute_dominance_frontiers (bitmap *); +extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *); extern void dump_edge_info (FILE *, edge, int); +extern void brief_dump_cfg (FILE *); extern void clear_edges (void); -extern void mark_critical_edges (void); extern rtx first_insn_after_basic_block_note (basic_block); +extern void scale_bbs_frequencies_int (basic_block *, int, int, int); +extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type, + gcov_type); /* Structure to group all of the information to process IF-THEN and IF-THEN-ELSE blocks for the conditional execution support. This @@ -411,6 +554,9 @@ struct edge_list edge *index_to_edge; }; +/* The base value for branch probability notes and edge probabilities. */ +#define REG_BR_PROB_BASE 10000 + /* This is the value which indicates no edge is present. */ #define EDGE_INDEX_NO_EDGE -1 @@ -430,12 +576,12 @@ struct edge_list #define NUM_EDGES(el) ((el)->num_edges) /* BB is assumed to contain conditional jump. Return the fallthru edge. */ -#define FALLTHRU_EDGE(bb) ((bb)->succ->flags & EDGE_FALLTHRU \ - ? (bb)->succ : (bb)->succ->succ_next) +#define FALLTHRU_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \ + ? EDGE_SUCC ((bb), 0) : EDGE_SUCC ((bb), 1)) /* BB is assumed to contain conditional jump. Return the branch edge. */ -#define BRANCH_EDGE(bb) ((bb)->succ->flags & EDGE_FALLTHRU \ - ? (bb)->succ->succ_next : (bb)->succ) +#define BRANCH_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \ + ? EDGE_SUCC ((bb), 1) : EDGE_SUCC ((bb), 0)) /* Return expected execution frequency of the edge E. */ #define EDGE_FREQUENCY(e) (((e)->src->frequency \ @@ -444,14 +590,202 @@ struct edge_list / REG_BR_PROB_BASE) /* Return nonzero if edge is critical. */ -#define EDGE_CRITICAL_P(e) ((e)->src->succ->succ_next \ - && (e)->dest->pred->pred_next) +#define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \ + && EDGE_COUNT ((e)->dest->preds) >= 2) + +#define EDGE_COUNT(ev) VEC_length (edge, (ev)) +#define EDGE_I(ev,i) VEC_index (edge, (ev), (i)) +#define EDGE_PRED(bb,i) VEC_index (edge, (bb)->preds, (i)) +#define EDGE_SUCC(bb,i) VEC_index (edge, (bb)->succs, (i)) + +/* Returns true if BB has precisely one successor. */ + +static inline bool +single_succ_p (basic_block bb) +{ + return EDGE_COUNT (bb->succs) == 1; +} + +/* Returns true if BB has precisely one predecessor. */ + +static inline bool +single_pred_p (basic_block bb) +{ + return EDGE_COUNT (bb->preds) == 1; +} + +/* Returns the single successor edge of basic block BB. Aborts if + BB does not have exactly one successor. */ + +static inline edge +single_succ_edge (basic_block bb) +{ + gcc_assert (single_succ_p (bb)); + return EDGE_SUCC (bb, 0); +} + +/* Returns the single predecessor edge of basic block BB. Aborts + if BB does not have exactly one predecessor. */ + +static inline edge +single_pred_edge (basic_block bb) +{ + gcc_assert (single_pred_p (bb)); + return EDGE_PRED (bb, 0); +} + +/* Returns the single successor block of basic block BB. Aborts + if BB does not have exactly one successor. */ + +static inline basic_block +single_succ (basic_block bb) +{ + return single_succ_edge (bb)->dest; +} + +/* Returns the single predecessor block of basic block BB. Aborts + if BB does not have exactly one predecessor.*/ + +static inline basic_block +single_pred (basic_block bb) +{ + return single_pred_edge (bb)->src; +} + +/* Iterator object for edges. */ + +typedef struct { + unsigned index; + VEC(edge,gc) **container; +} edge_iterator; + +static inline VEC(edge,gc) * +ei_container (edge_iterator i) +{ + gcc_assert (i.container); + return *i.container; +} + +#define ei_start(iter) ei_start_1 (&(iter)) +#define ei_last(iter) ei_last_1 (&(iter)) + +/* Return an iterator pointing to the start of an edge vector. */ +static inline edge_iterator +ei_start_1 (VEC(edge,gc) **ev) +{ + edge_iterator i; + + i.index = 0; + i.container = ev; + + return i; +} + +/* Return an iterator pointing to the last element of an edge + vector. */ +static inline edge_iterator +ei_last_1 (VEC(edge,gc) **ev) +{ + edge_iterator i; + + i.index = EDGE_COUNT (*ev) - 1; + i.container = ev; + + return i; +} + +/* Is the iterator `i' at the end of the sequence? */ +static inline bool +ei_end_p (edge_iterator i) +{ + return (i.index == EDGE_COUNT (ei_container (i))); +} + +/* Is the iterator `i' at one position before the end of the + sequence? */ +static inline bool +ei_one_before_end_p (edge_iterator i) +{ + return (i.index + 1 == EDGE_COUNT (ei_container (i))); +} + +/* Advance the iterator to the next element. */ +static inline void +ei_next (edge_iterator *i) +{ + gcc_assert (i->index < EDGE_COUNT (ei_container (*i))); + i->index++; +} + +/* Move the iterator to the previous element. */ +static inline void +ei_prev (edge_iterator *i) +{ + gcc_assert (i->index > 0); + i->index--; +} + +/* Return the edge pointed to by the iterator `i'. */ +static inline edge +ei_edge (edge_iterator i) +{ + return EDGE_I (ei_container (i), i.index); +} + +/* Return an edge pointed to by the iterator. Do it safely so that + NULL is returned when the iterator is pointing at the end of the + sequence. */ +static inline edge +ei_safe_edge (edge_iterator i) +{ + return !ei_end_p (i) ? ei_edge (i) : NULL; +} + +/* Return 1 if we should continue to iterate. Return 0 otherwise. + *Edge P is set to the next edge if we are to continue to iterate + and NULL otherwise. */ + +static inline bool +ei_cond (edge_iterator ei, edge *p) +{ + if (!ei_end_p (ei)) + { + *p = ei_edge (ei); + return 1; + } + else + { + *p = NULL; + return 0; + } +} + +/* This macro serves as a convenient way to iterate each edge in a + vector of predecessor or successor edges. It must not be used when + an element might be removed during the traversal, otherwise + elements will be missed. Instead, use a for-loop like that shown + in the following pseudo-code: + + FOR (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) + { + IF (e != taken_edge) + remove_edge (e); + ELSE + ei_next (&ei); + } +*/ + +#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ + for ((ITER) = ei_start ((EDGE_VEC)); \ + ei_cond ((ITER), &(EDGE)); \ + ei_next (&(ITER))) struct edge_list * create_edge_list (void); void free_edge_list (struct edge_list *); void print_edge_list (FILE *, struct edge_list *); void verify_edge_list (FILE *, struct edge_list *); int find_edge_index (struct edge_list *, basic_block, basic_block); +edge find_edge (basic_block, basic_block); enum update_life_extent @@ -471,10 +805,14 @@ enum update_life_extent #define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed by dead code removal. */ #define PROP_AUTOINC 64 /* Create autoinc mem references. */ -#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */ -#define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */ -#define PROP_ASM_SCAN 512 /* Internal flag used within flow.c +#define PROP_SCAN_DEAD_STORES 128 /* Scan for dead code. */ +#define PROP_ASM_SCAN 256 /* Internal flag used within flow.c to flag analysis of asms. */ +#define PROP_DEAD_INSN 1024 /* Internal flag used within flow.c + to flag analysis of dead insn. */ +#define PROP_POST_REGSTACK 2048 /* We run after reg-stack and need + to preserve REG_DEAD notes for + stack regs. */ #define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \ | PROP_REG_INFO | PROP_KILL_DEAD_CODE \ | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \ @@ -482,7 +820,7 @@ enum update_life_extent | PROP_SCAN_DEAD_STORES) #define PROP_POSTRELOAD (PROP_DEATH_NOTES \ | PROP_KILL_DEAD_CODE \ - | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \ + | PROP_SCAN_DEAD_CODE \ | PROP_SCAN_DEAD_STORES) #define CLEANUP_EXPENSIVE 1 /* Do relatively expensive optimizations @@ -490,17 +828,25 @@ enum update_life_extent #define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */ #define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need to care REG_DEAD notes. */ -#define CLEANUP_PRE_SIBCALL 8 /* Do not get confused by code hidden - inside call_placeholders.. */ -#define CLEANUP_PRE_LOOP 16 /* Take care to preserve syntactic loop - notes. */ -#define CLEANUP_UPDATE_LIFE 32 /* Keep life information up to date. */ -#define CLEANUP_THREADING 64 /* Do jump threading. */ -#define CLEANUP_NO_INSN_DEL 128 /* Do not try to delete trivially dead +#define CLEANUP_UPDATE_LIFE 8 /* Keep life information up to date. */ +#define CLEANUP_THREADING 16 /* Do jump threading. */ +#define CLEANUP_NO_INSN_DEL 32 /* Do not try to delete trivially dead insns. */ -#define CLEANUP_CFGLAYOUT 256 /* Do cleanup in cfglayout mode. */ -#define CLEANUP_LOG_LINKS 512 /* Update log links. */ -extern void life_analysis (rtx, FILE *, int); +#define CLEANUP_CFGLAYOUT 64 /* Do cleanup in cfglayout mode. */ +#define CLEANUP_LOG_LINKS 128 /* Update log links. */ + +/* The following are ORed in on top of the CLEANUP* flags in calls to + struct_equiv_block_eq. */ +#define STRUCT_EQUIV_START 256 /* Initializes the search range. */ +#define STRUCT_EQUIV_RERUN 512 /* Rerun to find register use in + found equivalence. */ +#define STRUCT_EQUIV_FINAL 1024 /* Make any changes necessary to get + actual equivalence. */ +#define STRUCT_EQUIV_NEED_FULL_BLOCK 2048 /* struct_equiv_block_eq is required + to match only full blocks */ +#define STRUCT_EQUIV_MATCH_JUMPS 4096 /* Also include the jumps at the end of the block in the comparison. */ + +extern void life_analysis (int); extern int update_life_info (sbitmap, enum update_life_extent, int); extern int update_life_info_in_dirty_blocks (enum update_life_extent, int); extern int count_or_remove_death_notes (sbitmap, int); @@ -513,52 +859,53 @@ extern struct propagate_block_info *init_propagate_block_info extern void free_propagate_block_info (struct propagate_block_info *); /* In lcm.c */ -extern struct edge_list *pre_edge_lcm (FILE *, int, sbitmap *, sbitmap *, +extern struct edge_list *pre_edge_lcm (int, sbitmap *, sbitmap *, sbitmap *, sbitmap *, sbitmap **, sbitmap **); -extern struct edge_list *pre_edge_rev_lcm (FILE *, int, sbitmap *, +extern struct edge_list *pre_edge_rev_lcm (int, sbitmap *, sbitmap *, sbitmap *, sbitmap *, sbitmap **, sbitmap **); extern void compute_available (sbitmap *, sbitmap *, sbitmap *, sbitmap *); -extern int optimize_mode_switching (FILE *); - -/* In emit-rtl.c. */ -extern rtx emit_block_insn_after (rtx, rtx, basic_block); -extern rtx emit_block_insn_before (rtx, rtx, basic_block); /* In predict.c */ -extern void estimate_probability (struct loops *); -extern void note_prediction_to_br_prob (void); extern void expected_value_to_br_prob (void); extern bool maybe_hot_bb_p (basic_block); extern bool probably_cold_bb_p (basic_block); extern bool probably_never_executed_bb_p (basic_block); +extern bool tree_predicted_by_p (basic_block, enum br_predictor); +extern bool rtl_predicted_by_p (basic_block, enum br_predictor); +extern void tree_predict_edge (edge, enum br_predictor, int); +extern void rtl_predict_edge (edge, enum br_predictor, int); +extern void predict_edge_def (edge, enum br_predictor, enum prediction); +extern void guess_outgoing_edge_probabilities (basic_block); +extern void remove_predictions_associated_with_edge (edge); +extern bool edge_probability_reliable_p (edge); +extern bool br_prob_note_reliable_p (rtx); /* In flow.c */ extern void init_flow (void); -extern void dump_bb (basic_block, FILE *); extern void debug_bb (basic_block); extern basic_block debug_bb_n (int); extern void dump_regset (regset, FILE *); extern void debug_regset (regset); extern void allocate_reg_life_data (void); -extern void allocate_bb_life_data (void); extern void expunge_block (basic_block); extern void link_block (basic_block, basic_block); extern void unlink_block (basic_block); extern void compact_blocks (void); extern basic_block alloc_block (void); extern void find_unreachable_blocks (void); -extern int delete_noop_moves (rtx); +extern int delete_noop_moves (void); extern basic_block force_nonfallthru (edge); extern rtx block_label (basic_block); extern bool forwarder_block_p (basic_block); -extern bool purge_all_dead_edges (int); +extern bool purge_all_dead_edges (void); extern bool purge_dead_edges (basic_block); -extern void find_sub_basic_blocks (basic_block); extern void find_many_sub_basic_blocks (sbitmap); +extern void rtl_make_eh_edge (sbitmap, basic_block, rtx); extern bool can_fallthru (basic_block, basic_block); +extern bool could_fall_through (basic_block, basic_block); extern void flow_nodes_print (const char *, const sbitmap, FILE *); extern void flow_edge_list_print (const char *, const edge *, int, FILE *); extern void alloc_aux_for_block (basic_block, int); @@ -569,11 +916,10 @@ extern void alloc_aux_for_edge (edge, int); extern void alloc_aux_for_edges (int); extern void clear_aux_for_edges (void); extern void free_aux_for_edges (void); - -/* This function is always defined so it can be called from the - debugger, and it is declared extern so we don't get warnings about - it being unused. */ -extern void verify_flow_info (void); +extern void find_basic_blocks (rtx); +extern bool cleanup_cfg (int); +extern bool delete_unreachable_blocks (void); +extern bool merge_seq_blocks (void); typedef struct conflict_graph_def *conflict_graph; @@ -594,16 +940,13 @@ extern void conflict_graph_enum (conflict_graph, int, conflict_graph_enum_fn, void *); extern void conflict_graph_merge_regs (conflict_graph, int, int); extern void conflict_graph_print (conflict_graph, FILE*); -extern conflict_graph conflict_graph_compute (regset, partition); extern bool mark_dfs_back_edges (void); extern void set_edge_can_fallthru_flag (void); extern void update_br_prob_note (basic_block); extern void fixup_abnormal_edges (void); -extern bool can_hoist_insn_p (rtx, rtx, regset); -extern rtx hoist_insn_after (rtx, rtx, rtx, rtx); -extern rtx hoist_insn_to_edge (rtx, edge, rtx, rtx); extern bool inside_basic_block_p (rtx); extern bool control_flow_insn_p (rtx); +extern rtx get_last_bb_insn (basic_block); /* In bb-reorder.c */ extern void reorder_basic_blocks (unsigned int); @@ -619,23 +962,26 @@ enum cdi_direction enum dom_state { DOM_NONE, /* Not computed at all. */ - DOM_CONS_OK, /* The data is conservatively OK, i.e. if it says you that A dominates B, - it indeed does. */ DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */ DOM_OK /* Everything is ok. */ }; extern enum dom_state dom_computed[2]; +extern bool dom_info_available_p (enum cdi_direction); extern void calculate_dominance_info (enum cdi_direction); extern void free_dominance_info (enum cdi_direction); extern basic_block nearest_common_dominator (enum cdi_direction, basic_block, basic_block); +extern basic_block nearest_common_dominator_for_set (enum cdi_direction, + bitmap); extern void set_immediate_dominator (enum cdi_direction, basic_block, basic_block); extern basic_block get_immediate_dominator (enum cdi_direction, basic_block); extern bool dominated_by_p (enum cdi_direction, basic_block, basic_block); extern int get_dominated_by (enum cdi_direction, basic_block, basic_block **); +extern unsigned get_dominated_by_region (enum cdi_direction, basic_block *, + unsigned, basic_block *); extern void add_to_dominance_info (enum cdi_direction, basic_block); extern void delete_from_dominance_info (enum cdi_direction, basic_block); basic_block recount_dominator (enum cdi_direction, basic_block); @@ -645,8 +991,203 @@ extern void iterate_fix_dominators (enum cdi_direction, basic_block *, int); extern void verify_dominators (enum cdi_direction); extern basic_block first_dom_son (enum cdi_direction, basic_block); extern basic_block next_dom_son (enum cdi_direction, basic_block); -extern bool try_redirect_by_replacing_jump (edge, basic_block, bool); +unsigned bb_dom_dfs_in (enum cdi_direction, basic_block); +unsigned bb_dom_dfs_out (enum cdi_direction, basic_block); + +extern edge try_redirect_by_replacing_jump (edge, basic_block, bool); +extern void break_superblocks (void); +extern void check_bb_profile (basic_block, FILE *); +extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge); +extern void init_rtl_bb_info (basic_block); + +extern void initialize_original_copy_tables (void); +extern void free_original_copy_tables (void); +extern void set_bb_original (basic_block, basic_block); +extern basic_block get_bb_original (basic_block); +extern void set_bb_copy (basic_block, basic_block); +extern basic_block get_bb_copy (basic_block); + +extern rtx insert_insn_end_bb_new (rtx, basic_block); #include "cfghooks.h" +/* In struct-equiv.c */ + +/* Constants used to size arrays in struct equiv_info (currently only one). + When these limits are exceeded, struct_equiv returns zero. + The maximum number of pseudo registers that are different in the two blocks, + but appear in equivalent places and are dead at the end (or where one of + a pair is dead at the end). */ +#define STRUCT_EQUIV_MAX_LOCAL 16 +/* The maximum number of references to an input register that struct_equiv + can handle. */ + +/* Structure used to track state during struct_equiv that can be rolled + back when we find we can't match an insn, or if we want to match part + of it in a different way. + This information pertains to the pair of partial blocks that has been + matched so far. Since this pair is structurally equivalent, this is + conceptually just one partial block expressed in two potentially + different ways. */ +struct struct_equiv_checkpoint +{ + int ninsns; /* Insns are matched so far. */ + int local_count; /* Number of block-local registers. */ + int input_count; /* Number of inputs to the block. */ + + /* X_START and Y_START are the first insns (in insn stream order) + of the partial blocks that have been considered for matching so far. + Since we are scanning backwards, they are also the instructions that + are currently considered - or the last ones that have been considered - + for matching (Unless we tracked back to these because a preceding + instruction failed to match). */ + rtx x_start, y_start; + + /* INPUT_VALID indicates if we have actually set up X_INPUT / Y_INPUT + during the current pass; we keep X_INPUT / Y_INPUT around between passes + so that we can match REG_EQUAL / REG_EQUIV notes referring to these. */ + bool input_valid; + + /* Some information would be expensive to exactly checkpoint, so we + merely increment VERSION any time information about local + registers, inputs and/or register liveness changes. When backtracking, + it is decremented for changes that can be undone, and if a discrepancy + remains, NEED_RERUN in the relevant struct equiv_info is set to indicate + that a new pass should be made over the entire block match to get + accurate register information. */ + int version; +}; + +/* A struct equiv_info is used to pass information to struct_equiv and + to gather state while two basic blocks are checked for structural + equivalence. */ + +struct equiv_info +{ + /* Fields set up by the caller to struct_equiv_block_eq */ + + basic_block x_block, y_block; /* The two blocks being matched. */ + + /* MODE carries the mode bits from cleanup_cfg if we are called from + try_crossjump_to_edge, and additionally it carries the + STRUCT_EQUIV_* bits described above. */ + int mode; + + /* INPUT_COST is the cost that adding an extra input to the matched blocks + is supposed to have, and is taken into account when considering if the + matched sequence should be extended backwards. input_cost < 0 means + don't accept any inputs at all. */ + int input_cost; + + + /* Fields to track state inside of struct_equiv_block_eq. Some of these + are also outputs. */ + + /* X_INPUT and Y_INPUT are used by struct_equiv to record a register that + is used as an input parameter, i.e. where different registers are used + as sources. This is only used for a register that is live at the end + of the blocks, or in some identical code at the end of the blocks; + Inputs that are dead at the end go into X_LOCAL / Y_LOCAL. */ + rtx x_input, y_input; + /* When a previous pass has identified a valid input, INPUT_REG is set + by struct_equiv_block_eq, and it is henceforth replaced in X_BLOCK + for the input. */ + rtx input_reg; + + /* COMMON_LIVE keeps track of the registers which are currently live + (as we scan backwards from the end) and have the same numbers in both + blocks. N.B. a register that is in common_live is unsuitable to become + a local reg. */ + regset common_live; + /* Likewise, X_LOCAL_LIVE / Y_LOCAL_LIVE keep track of registers that are + local to one of the blocks; these registers must not be accepted as + identical when encountered in both blocks. */ + regset x_local_live, y_local_live; + + /* EQUIV_USED indicates for which insns a REG_EQUAL or REG_EQUIV note is + being used, to avoid having to backtrack in the next pass, so that we + get accurate life info for this insn then. For each such insn, + the bit with the number corresponding to the CUR.NINSNS value at the + time of scanning is set. */ + bitmap equiv_used; + + /* Current state that can be saved & restored easily. */ + struct struct_equiv_checkpoint cur; + /* BEST_MATCH is used to store the best match so far, weighing the + cost of matched insns COSTS_N_INSNS (CUR.NINSNS) against the cost + CUR.INPUT_COUNT * INPUT_COST of setting up the inputs. */ + struct struct_equiv_checkpoint best_match; + /* If a checkpoint restore failed, or an input conflict newly arises, + NEED_RERUN is set. This has to be tested by the caller to re-run + the comparison if the match appears otherwise sound. The state kept in + x_start, y_start, equiv_used and check_input_conflict ensures that + we won't loop indefinitely. */ + bool need_rerun; + /* If there is indication of an input conflict at the end, + CHECK_INPUT_CONFLICT is set so that we'll check for input conflicts + for each insn in the next pass. This is needed so that we won't discard + a partial match if there is a longer match that has to be abandoned due + to an input conflict. */ + bool check_input_conflict; + /* HAD_INPUT_CONFLICT is set if CHECK_INPUT_CONFLICT was already set and we + have passed a point where there were multiple dying inputs. This helps + us decide if we should set check_input_conflict for the next pass. */ + bool had_input_conflict; + + /* LIVE_UPDATE controls if we want to change any life info at all. We + set it to false during REG_EQUAL / REG_EUQIV note comparison of the final + pass so that we don't introduce new registers just for the note; if we + can't match the notes without the current register information, we drop + them. */ + bool live_update; + + /* X_LOCAL and Y_LOCAL are used to gather register numbers of register pairs + that are local to X_BLOCK and Y_BLOCK, with CUR.LOCAL_COUNT being the index + to the next free entry. */ + rtx x_local[STRUCT_EQUIV_MAX_LOCAL], y_local[STRUCT_EQUIV_MAX_LOCAL]; + /* LOCAL_RVALUE is nonzero if the corresponding X_LOCAL / Y_LOCAL entry + was a source operand (including STRICT_LOW_PART) for the last invocation + of struct_equiv mentioning it, zero if it was a destination-only operand. + Since we are scanning backwards, this means the register is input/local + for the (partial) block scanned so far. */ + bool local_rvalue[STRUCT_EQUIV_MAX_LOCAL]; + + + /* Additional fields that are computed for the convenience of the caller. */ + + /* DYING_INPUTS is set to the number of local registers that turn out + to be inputs to the (possibly partial) block. */ + int dying_inputs; + /* X_END and Y_END are the last insns in X_BLOCK and Y_BLOCK, respectively, + that are being compared. A final jump insn will not be included. */ + rtx x_end, y_end; + + /* If we are matching tablejumps, X_LABEL in X_BLOCK corresponds to + Y_LABEL in Y_BLOCK. */ + rtx x_label, y_label; + +}; + +extern bool insns_match_p (rtx, rtx, struct equiv_info *); +extern int struct_equiv_block_eq (int, struct equiv_info *); +extern bool struct_equiv_init (int, struct equiv_info *); +extern bool rtx_equiv_p (rtx *, rtx, int, struct equiv_info *); + +/* In cfgrtl.c */ +extern bool condjump_equiv_p (struct equiv_info *, bool); + +/* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */ +static inline bool bb_has_eh_pred (basic_block bb) +{ + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->preds) + { + if (e->flags & EDGE_EH) + return true; + } + return false; +} + #endif /* GCC_BASIC_BLOCK_H */ diff --git a/contrib/gcc/bb-reorder.c b/contrib/gcc/bb-reorder.c index a8b3280d8ce..bf8c6afe05f 100644 --- a/contrib/gcc/bb-reorder.c +++ b/contrib/gcc/bb-reorder.c @@ -1,5 +1,5 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ 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 (greedy) algorithm constructs traces in several rounds. The construction starts from "seeds". The seed for the first round @@ -70,22 +70,44 @@ #include "coretypes.h" #include "tm.h" #include "rtl.h" -#include "basic-block.h" +#include "regs.h" #include "flags.h" #include "timevar.h" #include "output.h" #include "cfglayout.h" #include "fibheap.h" #include "target.h" +#include "function.h" +#include "tm_p.h" +#include "obstack.h" +#include "expr.h" +#include "params.h" +#include "toplev.h" +#include "tree-pass.h" + +#ifndef HAVE_conditional_execution +#define HAVE_conditional_execution 0 +#endif + +/* The number of rounds. In most cases there will only be 4 rounds, but + when partitioning hot and cold basic blocks into separate sections of + the .o file there will be an extra round.*/ +#define N_ROUNDS 5 + +/* Stubs in case we don't have a return insn. + We have to check at runtime too, not only compiletime. */ + +#ifndef HAVE_return +#define HAVE_return 0 +#define gen_return() NULL_RTX +#endif -/* The number of rounds. */ -#define N_ROUNDS 4 /* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE. */ -static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0}; +static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0}; /* Exec thresholds in thousandths (per mille) of the frequency of bb 0. */ -static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0}; +static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0}; /* If edge frequency is lower than DUPLICATION_THRESHOLD per mille of entry block the edge destination is not duplicated while connecting traces. */ @@ -103,6 +125,9 @@ typedef struct bbro_basic_block_data_def /* Which trace is the bb end of (-1 means it is not an end of a trace). */ int end_of_trace; + /* Which trace is the bb in? */ + int in_trace; + /* Which heap is BB in (if any)? */ fibheap_t heap; @@ -121,8 +146,7 @@ static bbro_basic_block_data *bbd; #define GET_ARRAY_SIZE(X) ((((X) / 4) + 1) * 5) /* Free the memory and set the pointer to NULL. */ -#define FREE(P) \ - do { if (P) { free (P); P = 0; } else { abort (); } } while (0) +#define FREE(P) (gcc_assert (P), free (P), P = 0) /* Structure for holding information about a trace. */ struct trace @@ -138,22 +162,60 @@ struct trace }; /* Maximum frequency and count of one of the entry blocks. */ -int max_entry_frequency; -gcov_type max_entry_count; +static int max_entry_frequency; +static gcov_type max_entry_count; /* Local function prototypes. */ static void find_traces (int *, struct trace *); static basic_block rotate_loop (edge, struct trace *, int); static void mark_bb_visited (basic_block, int); static void find_traces_1_round (int, int, gcov_type, struct trace *, int *, - int, fibheap_t *); + int, fibheap_t *, int); static basic_block copy_bb (basic_block, edge, basic_block, int); static fibheapkey_t bb_to_key (basic_block); -static bool better_edge_p (basic_block, edge, int, int, int, int); +static bool better_edge_p (basic_block, edge, int, int, int, int, edge); static void connect_traces (int, struct trace *); static bool copy_bb_p (basic_block, int); static int get_uncond_jump_length (void); +static bool push_to_next_round_p (basic_block, int, int, int, gcov_type); +static void find_rarely_executed_basic_blocks_and_crossing_edges (edge *, + int *, + int *); +static void add_labels_and_missing_jumps (edge *, int); +static void add_reg_crossing_jump_notes (void); +static void fix_up_fall_thru_edges (void); +static void fix_edges_for_rarely_executed_code (edge *, int); +static void fix_crossing_conditional_branches (void); +static void fix_crossing_unconditional_branches (void); +/* Check to see if bb should be pushed into the next round of trace + collections or not. Reasons for pushing the block forward are 1). + If the block is cold, we are doing partitioning, and there will be + another round (cold partition blocks are not supposed to be + collected into traces until the very last round); or 2). There will + be another round, and the basic block is not "hot enough" for the + current round of trace collection. */ + +static bool +push_to_next_round_p (basic_block bb, int round, int number_of_rounds, + int exec_th, gcov_type count_th) +{ + bool there_exists_another_round; + bool block_not_hot_enough; + + there_exists_another_round = round < number_of_rounds - 1; + + block_not_hot_enough = (bb->frequency < exec_th + || bb->count < count_th + || probably_never_executed_bb_p (bb)); + + if (there_exists_another_round + && block_not_hot_enough) + return true; + else + return false; +} + /* Find the traces for Software Trace Cache. Chain each trace through RBI()->next. Store the number of traces to N_TRACES and description of traces to TRACES. */ @@ -162,14 +224,22 @@ static void find_traces (int *n_traces, struct trace *traces) { int i; + int number_of_rounds; edge e; + edge_iterator ei; fibheap_t heap; + /* Add one extra round of trace collection when partitioning hot/cold + basic blocks into separate sections. The last round is for all the + cold blocks (and ONLY the cold blocks). */ + + number_of_rounds = N_ROUNDS - 1; + /* Insert entry points of function into heap. */ heap = fibheap_new (); max_entry_frequency = 0; max_entry_count = 0; - for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) { bbd[e->dest->index].heap = heap; bbd[e->dest->index].node = fibheap_insert (heap, bb_to_key (e->dest), @@ -181,12 +251,12 @@ find_traces (int *n_traces, struct trace *traces) } /* Find the traces. */ - for (i = 0; i < N_ROUNDS; i++) + for (i = 0; i < number_of_rounds; i++) { gcov_type count_threshold; - if (rtl_dump_file) - fprintf (rtl_dump_file, "STC - round %d\n", i + 1); + if (dump_file) + fprintf (dump_file, "STC - round %d\n", i + 1); if (max_entry_count < INT_MAX / 1000) count_threshold = max_entry_count * exec_threshold[i] / 1000; @@ -195,22 +265,23 @@ find_traces (int *n_traces, struct trace *traces) find_traces_1_round (REG_BR_PROB_BASE * branch_threshold[i] / 1000, max_entry_frequency * exec_threshold[i] / 1000, - count_threshold, traces, n_traces, i, &heap); + count_threshold, traces, n_traces, i, &heap, + number_of_rounds); } fibheap_delete (heap); - if (rtl_dump_file) + if (dump_file) { for (i = 0; i < *n_traces; i++) { basic_block bb; - fprintf (rtl_dump_file, "Trace %d (round %d): ", i + 1, + fprintf (dump_file, "Trace %d (round %d): ", i + 1, traces[i].round + 1); - for (bb = traces[i].first; bb != traces[i].last; bb = bb->rbi->next) - fprintf (rtl_dump_file, "%d [%d] ", bb->index, bb->frequency); - fprintf (rtl_dump_file, "%d [%d]\n", bb->index, bb->frequency); + for (bb = traces[i].first; bb != traces[i].last; bb = bb->aux) + fprintf (dump_file, "%d [%d] ", bb->index, bb->frequency); + fprintf (dump_file, "%d [%d]\n", bb->index, bb->frequency); } - fflush (rtl_dump_file); + fflush (dump_file); } } @@ -236,16 +307,18 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) do { edge e; - for (e = bb->succ; e; e = e->succ_next) + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->succs) if (e->dest != EXIT_BLOCK_PTR - && e->dest->rbi->visited != trace_n + && e->dest->il.rtl->visited != trace_n && (e->flags & EDGE_CAN_FALLTHRU) && !(e->flags & EDGE_COMPLEX)) { if (is_preferred) { /* The best edge is preferred. */ - if (!e->dest->rbi->visited + if (!e->dest->il.rtl->visited || bbd[e->dest->index].start_of_trace >= 0) { /* The current edge E is also preferred. */ @@ -261,7 +334,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) } else { - if (!e->dest->rbi->visited + if (!e->dest->il.rtl->visited || bbd[e->dest->index].start_of_trace >= 0) { /* The current edge E is preferred. */ @@ -284,7 +357,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) } } } - bb = bb->rbi->next; + bb = bb->aux; } while (bb != back_edge->dest); @@ -294,29 +367,29 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) the trace. */ if (back_edge->dest == trace->first) { - trace->first = best_bb->rbi->next; + trace->first = best_bb->aux; } else { basic_block prev_bb; for (prev_bb = trace->first; - prev_bb->rbi->next != back_edge->dest; - prev_bb = prev_bb->rbi->next) + prev_bb->aux != back_edge->dest; + prev_bb = prev_bb->aux) ; - prev_bb->rbi->next = best_bb->rbi->next; + prev_bb->aux = best_bb->aux; /* Try to get rid of uncond jump to cond jump. */ - if (prev_bb->succ && !prev_bb->succ->succ_next) + if (single_succ_p (prev_bb)) { - basic_block header = prev_bb->succ->dest; + basic_block header = single_succ (prev_bb); /* Duplicate HEADER if it is a small block containing cond jump in the end. */ - if (any_condjump_p (BB_END (header)) && copy_bb_p (header, 0)) - { - copy_bb (header, prev_bb->succ, prev_bb, trace_n); - } + if (any_condjump_p (BB_END (header)) && copy_bb_p (header, 0) + && !find_reg_note (BB_END (header), REG_CROSSING_JUMP, + NULL_RTX)) + copy_bb (header, single_succ_edge (prev_bb), prev_bb, trace_n); } } } @@ -325,7 +398,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) /* We have not found suitable loop tail so do no rotation. */ best_bb = back_edge->src; } - best_bb->rbi->next = NULL; + best_bb->aux = NULL; return best_bb; } @@ -334,7 +407,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n) static void mark_bb_visited (basic_block bb, int trace) { - bb->rbi->visited = trace; + bb->il.rtl->visited = trace; if (bbd[bb->index].heap) { fibheap_delete_node (bbd[bb->index].heap, bbd[bb->index].node); @@ -354,7 +427,7 @@ mark_bb_visited (basic_block bb, int trace) static void find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, struct trace *traces, int *n_traces, int round, - fibheap_t *heap) + fibheap_t *heap, int number_of_rounds) { /* Heap for discarded basic blocks which are possible starting points for the next round. */ @@ -366,25 +439,29 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, struct trace *trace; edge best_edge, e; fibheapkey_t key; + edge_iterator ei; bb = fibheap_extract_min (*heap); bbd[bb->index].heap = NULL; bbd[bb->index].node = NULL; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Getting bb %d\n", bb->index); + if (dump_file) + fprintf (dump_file, "Getting bb %d\n", bb->index); - /* If the BB's frequency is too low send BB to the next round. */ - if (round < N_ROUNDS - 1 - && (bb->frequency < exec_th || bb->count < count_th - || probably_never_executed_bb_p (bb))) + /* If the BB's frequency is too low send BB to the next round. When + partitioning hot/cold blocks into separate sections, make sure all + the cold blocks (and ONLY the cold blocks) go into the (extra) final + round. */ + + if (push_to_next_round_p (bb, round, number_of_rounds, exec_th, + count_th)) { int key = bb_to_key (bb); bbd[bb->index].heap = new_heap; bbd[bb->index].node = fibheap_insert (new_heap, key, bb); - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, " Possible start point of next round: %d (key: %d)\n", bb->index, key); continue; @@ -394,11 +471,13 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, trace->first = bb; trace->round = round; trace->length = 0; + bbd[bb->index].in_trace = *n_traces; (*n_traces)++; do { int prob, freq; + bool ends_in_call; /* The probability and frequency of the best edge. */ int best_prob = INT_MIN / 2; @@ -408,35 +487,55 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, mark_bb_visited (bb, *n_traces); trace->length++; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Basic block %d was visited in trace %d\n", + if (dump_file) + fprintf (dump_file, "Basic block %d was visited in trace %d\n", bb->index, *n_traces - 1); + ends_in_call = block_ends_with_call_p (bb); + /* Select the successor that will be placed after BB. */ - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { -#ifdef ENABLE_CHECKING - if (e->flags & EDGE_FAKE) - abort (); -#endif + gcc_assert (!(e->flags & EDGE_FAKE)); if (e->dest == EXIT_BLOCK_PTR) continue; - if (e->dest->rbi->visited - && e->dest->rbi->visited != *n_traces) + if (e->dest->il.rtl->visited + && e->dest->il.rtl->visited != *n_traces) + continue; + + if (BB_PARTITION (e->dest) != BB_PARTITION (bb)) continue; prob = e->probability; - freq = EDGE_FREQUENCY (e); + freq = e->dest->frequency; + + /* The only sensible preference for a call instruction is the + fallthru edge. Don't bother selecting anything else. */ + if (ends_in_call) + { + if (e->flags & EDGE_CAN_FALLTHRU) + { + best_edge = e; + best_prob = prob; + best_freq = freq; + } + continue; + } /* Edge that cannot be fallthru or improbable or infrequent - successor (ie. it is unsuitable successor). */ + successor (i.e. it is unsuitable successor). */ if (!(e->flags & EDGE_CAN_FALLTHRU) || (e->flags & EDGE_COMPLEX) - || prob < branch_th || freq < exec_th || e->count < count_th) + || prob < branch_th || EDGE_FREQUENCY (e) < exec_th + || e->count < count_th) continue; - if (better_edge_p (bb, e, prob, freq, best_prob, best_freq)) + /* If partitioning hot/cold basic blocks, don't consider edges + that cross section boundaries. */ + + if (better_edge_p (bb, e, prob, freq, best_prob, best_freq, + best_edge)) { best_edge = e; best_prob = prob; @@ -447,16 +546,16 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, /* If the best destination has multiple predecessors, and can be duplicated cheaper than a jump, don't allow it to be added to a trace. We'll duplicate it when connecting traces. */ - if (best_edge && best_edge->dest->pred->pred_next + if (best_edge && EDGE_COUNT (best_edge->dest->preds) >= 2 && copy_bb_p (best_edge->dest, 0)) best_edge = NULL; /* Add all non-selected successors to the heaps. */ - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if (e == best_edge || e->dest == EXIT_BLOCK_PTR - || e->dest->rbi->visited) + || e->dest->il.rtl->visited) continue; key = bb_to_key (e->dest); @@ -466,9 +565,9 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, /* E->DEST is already in some heap. */ if (key != bbd[e->dest->index].node->key) { - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Changing key for bb %d from %ld to %ld.\n", e->dest->index, (long) bbd[e->dest->index].node->key, @@ -490,7 +589,13 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, || prob < branch_th || freq < exec_th || e->count < count_th) { - if (round < N_ROUNDS - 1) + /* When partitioning hot/cold basic blocks, make sure + the cold blocks (and only the cold blocks) all get + pushed to the last round of trace collection. */ + + if (push_to_next_round_p (e->dest, round, + number_of_rounds, + exec_th, count_th)) which_heap = new_heap; } @@ -498,9 +603,9 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, bbd[e->dest->index].node = fibheap_insert (which_heap, key, e->dest); - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, " Possible start of %s round: %d (key: %ld)\n", (which_heap == new_heap) ? "next" : "this", e->dest->index, (long) key); @@ -511,7 +616,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, if (best_edge) /* Suitable successor was found. */ { - if (best_edge->dest->rbi->visited == *n_traces) + if (best_edge->dest->il.rtl->visited == *n_traces) { /* We do nothing with one basic block loops. */ if (best_edge->dest != bb) @@ -525,13 +630,15 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, if (best_edge->dest != ENTRY_BLOCK_PTR->next_bb) { - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Rotating loop %d - %d\n", best_edge->dest->index, bb->index); } - bb->rbi->next = best_edge->dest; + bb->aux = best_edge->dest; + bbd[best_edge->dest->index].in_trace = + (*n_traces) - 1; bb = rotate_loop (best_edge, trace, *n_traces); } } @@ -539,19 +646,12 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, { /* The loop has less than 4 iterations. */ - /* Check whether there is another edge from BB. */ - edge another_edge; - for (another_edge = bb->succ; - another_edge; - another_edge = another_edge->succ_next) - if (another_edge != best_edge) - break; - - if (!another_edge && copy_bb_p (best_edge->dest, - !optimize_size)) + if (single_succ_p (bb) + && copy_bb_p (best_edge->dest, !optimize_size)) { bb = copy_bb (best_edge->dest, best_edge, bb, *n_traces); + trace->length++; } } } @@ -582,27 +682,29 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, */ - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) if (e != best_edge && (e->flags & EDGE_CAN_FALLTHRU) && !(e->flags & EDGE_COMPLEX) - && !e->dest->rbi->visited - && !e->dest->pred->pred_next - && e->dest->succ - && (e->dest->succ->flags & EDGE_CAN_FALLTHRU) - && !(e->dest->succ->flags & EDGE_COMPLEX) - && !e->dest->succ->succ_next - && e->dest->succ->dest == best_edge->dest + && !e->dest->il.rtl->visited + && single_pred_p (e->dest) + && !(e->flags & EDGE_CROSSING) + && single_succ_p (e->dest) + && (single_succ_edge (e->dest)->flags + & EDGE_CAN_FALLTHRU) + && !(single_succ_edge (e->dest)->flags & EDGE_COMPLEX) + && single_succ (e->dest) == best_edge->dest && 2 * e->dest->frequency >= EDGE_FREQUENCY (best_edge)) { best_edge = e; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Selecting BB %d\n", + if (dump_file) + fprintf (dump_file, "Selecting BB %d\n", best_edge->dest->index); break; } - bb->rbi->next = best_edge->dest; + bb->aux = best_edge->dest; + bbd[best_edge->dest->index].in_trace = (*n_traces) - 1; bb = best_edge->dest; } } @@ -615,10 +717,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, /* The trace is terminated so we have to recount the keys in heap (some block can have a lower key because now one of its predecessors is an end of the trace). */ - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if (e->dest == EXIT_BLOCK_PTR - || e->dest->rbi->visited) + || e->dest->il.rtl->visited) continue; if (bbd[e->dest->index].heap) @@ -626,9 +728,9 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, key = bb_to_key (e->dest); if (key != bbd[e->dest->index].node->key) { - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Changing key for bb %d from %ld to %ld.\n", e->dest->index, (long) bbd[e->dest->index].node->key, key); @@ -656,18 +758,19 @@ copy_bb (basic_block old_bb, edge e, basic_block bb, int trace) { basic_block new_bb; - new_bb = cfg_layout_duplicate_bb (old_bb, e); - if (e->dest != new_bb) - abort (); - if (e->dest->rbi->visited) - abort (); - if (rtl_dump_file) - fprintf (rtl_dump_file, + new_bb = duplicate_block (old_bb, e, bb); + BB_COPY_PARTITION (new_bb, old_bb); + + gcc_assert (e->dest == new_bb); + gcc_assert (!e->dest->il.rtl->visited); + + if (dump_file) + fprintf (dump_file, "Duplicated bb %d (created bb %d)\n", old_bb->index, new_bb->index); - new_bb->rbi->visited = trace; - new_bb->rbi->next = bb->rbi->next; - bb->rbi->next = new_bb; + new_bb->il.rtl->visited = trace; + new_bb->aux = bb->aux; + bb->aux = new_bb; if (new_bb->index >= array_size || last_basic_block > array_size) { @@ -680,20 +783,23 @@ copy_bb (basic_block old_bb, edge e, basic_block bb, int trace) for (i = array_size; i < new_size; i++) { bbd[i].start_of_trace = -1; + bbd[i].in_trace = -1; bbd[i].end_of_trace = -1; bbd[i].heap = NULL; bbd[i].node = NULL; } array_size = new_size; - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Growing the dynamic array to %d elements.\n", array_size); } } + bbd[new_bb->index].in_trace = trace; + return new_bb; } @@ -703,16 +809,18 @@ static fibheapkey_t bb_to_key (basic_block bb) { edge e; - + edge_iterator ei; int priority = 0; /* Do not start in probably never executed blocks. */ - if (probably_never_executed_bb_p (bb)) + + if (BB_PARTITION (bb) == BB_COLD_PARTITION + || probably_never_executed_bb_p (bb)) return BB_FREQ_MAX; /* Prefer blocks whose predecessor is an end of some trace or whose predecessor edge is EDGE_DFS_BACK. */ - for (e = bb->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, bb->preds) { if ((e->src != ENTRY_BLOCK_PTR && bbd[e->src->index].end_of_trace >= 0) || (e->flags & EDGE_DFS_BACK)) @@ -739,7 +847,7 @@ bb_to_key (basic_block bb) static bool better_edge_p (basic_block bb, edge e, int prob, int freq, int best_prob, - int best_freq) + int best_freq, edge cur_best_edge) { bool is_better_edge; @@ -770,6 +878,16 @@ better_edge_p (basic_block bb, edge e, int prob, int freq, int best_prob, else is_better_edge = false; + /* If we are doing hot/cold partitioning, make sure that we always favor + non-crossing edges over crossing edges. */ + + if (!is_better_edge + && flag_reorder_blocks_and_partition + && cur_best_edge + && (cur_best_edge->flags & EDGE_CROSSING) + && !(e->flags & EDGE_CROSSING)) + is_better_edge = true; + return is_better_edge; } @@ -780,7 +898,10 @@ connect_traces (int n_traces, struct trace *traces) { int i; bool *connected; + bool two_passes; int last_trace; + int current_pass; + int current_partition; int freq_threshold; gcov_type count_threshold; @@ -790,26 +911,53 @@ connect_traces (int n_traces, struct trace *traces) else count_threshold = max_entry_count / 1000 * DUPLICATION_THRESHOLD; - connected = xcalloc (n_traces, sizeof (bool)); + connected = XCNEWVEC (bool, n_traces); last_trace = -1; - for (i = 0; i < n_traces; i++) + current_pass = 1; + current_partition = BB_PARTITION (traces[0].first); + two_passes = false; + + if (flag_reorder_blocks_and_partition) + for (i = 0; i < n_traces && !two_passes; i++) + if (BB_PARTITION (traces[0].first) + != BB_PARTITION (traces[i].first)) + two_passes = true; + + for (i = 0; i < n_traces || (two_passes && current_pass == 1) ; i++) { int t = i; int t2; edge e, best; int best_len; + if (i >= n_traces) + { + gcc_assert (two_passes && current_pass == 1); + i = 0; + t = i; + current_pass = 2; + if (current_partition == BB_HOT_PARTITION) + current_partition = BB_COLD_PARTITION; + else + current_partition = BB_HOT_PARTITION; + } + if (connected[t]) continue; + if (two_passes + && BB_PARTITION (traces[t].first) != current_partition) + continue; + connected[t] = true; /* Find the predecessor traces. */ for (t2 = t; t2 > 0;) { + edge_iterator ei; best = NULL; best_len = 0; - for (e = traces[t2].first->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, traces[t2].first->preds) { int si = e->src->index; @@ -818,6 +966,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e->flags & EDGE_COMPLEX) && bbd[si].end_of_trace >= 0 && !connected[bbd[si].end_of_trace] + && (BB_PARTITION (e->src) == current_partition) && (!best || e->probability > best->probability || (e->probability == best->probability @@ -829,12 +978,13 @@ connect_traces (int n_traces, struct trace *traces) } if (best) { - best->src->rbi->next = best->dest; + best->src->aux = best->dest; t2 = bbd[best->src->index].end_of_trace; connected[t2] = true; - if (rtl_dump_file) + + if (dump_file) { - fprintf (rtl_dump_file, "Connection: %d %d\n", + fprintf (dump_file, "Connection: %d %d\n", best->src->index, best->dest->index); } } @@ -843,16 +993,17 @@ connect_traces (int n_traces, struct trace *traces) } if (last_trace >= 0) - traces[last_trace].last->rbi->next = traces[t2].first; + traces[last_trace].last->aux = traces[t2].first; last_trace = t; /* Find the successor traces. */ while (1) { /* Find the continuation of the chain. */ + edge_iterator ei; best = NULL; best_len = 0; - for (e = traces[t].last->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, traces[t].last->succs) { int di = e->dest->index; @@ -861,6 +1012,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e->flags & EDGE_COMPLEX) && bbd[di].start_of_trace >= 0 && !connected[bbd[di].start_of_trace] + && (BB_PARTITION (e->dest) == current_partition) && (!best || e->probability > best->probability || (e->probability == best->probability @@ -873,13 +1025,13 @@ connect_traces (int n_traces, struct trace *traces) if (best) { - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, "Connection: %d %d\n", + fprintf (dump_file, "Connection: %d %d\n", best->src->index, best->dest->index); } t = bbd[best->dest->index].start_of_trace; - traces[last_trace].last->rbi->next = traces[t].first; + traces[last_trace].last->aux = traces[t].first; connected[t] = true; last_trace = t; } @@ -890,12 +1042,13 @@ connect_traces (int n_traces, struct trace *traces) basic_block next_bb = NULL; bool try_copy = false; - for (e = traces[t].last->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, traces[t].last->succs) if (e->dest != EXIT_BLOCK_PTR && (e->flags & EDGE_CAN_FALLTHRU) && !(e->flags & EDGE_COMPLEX) && (!best || e->probability > best->probability)) { + edge_iterator ei; edge best2 = NULL; int best2_len = 0; @@ -911,7 +1064,7 @@ connect_traces (int n_traces, struct trace *traces) continue; } - for (e2 = e->dest->succ; e2; e2 = e2->succ_next) + FOR_EACH_EDGE (e2, ei, e->dest->succs) { int di = e2->dest->index; @@ -920,6 +1073,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e2->flags & EDGE_COMPLEX) && bbd[di].start_of_trace >= 0 && !connected[bbd[di].start_of_trace] + && (BB_PARTITION (e2->dest) == current_partition) && (EDGE_FREQUENCY (e2) >= freq_threshold) && (e2->count >= count_threshold) && (!best2 @@ -940,6 +1094,9 @@ connect_traces (int n_traces, struct trace *traces) } } + if (flag_reorder_blocks_and_partition) + try_copy = false; + /* Copy tiny blocks always; copy larger blocks only when the edge is traversed frequently enough. */ if (try_copy @@ -950,16 +1107,16 @@ connect_traces (int n_traces, struct trace *traces) { basic_block new_bb; - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, "Connection: %d %d ", + fprintf (dump_file, "Connection: %d %d ", traces[t].last->index, best->dest->index); if (!next_bb) - fputc ('\n', rtl_dump_file); + fputc ('\n', dump_file); else if (next_bb == EXIT_BLOCK_PTR) - fprintf (rtl_dump_file, "exit\n"); + fprintf (dump_file, "exit\n"); else - fprintf (rtl_dump_file, "%d\n", next_bb->index); + fprintf (dump_file, "%d\n", next_bb->index); } new_bb = copy_bb (best->dest, best, traces[t].last, t); @@ -967,7 +1124,7 @@ connect_traces (int n_traces, struct trace *traces) if (next_bb && next_bb != EXIT_BLOCK_PTR) { t = bbd[next_bb->index].start_of_trace; - traces[last_trace].last->rbi->next = traces[t].first; + traces[last_trace].last->aux = traces[t].first; connected[t] = true; last_trace = t; } @@ -980,15 +1137,15 @@ connect_traces (int n_traces, struct trace *traces) } } - if (rtl_dump_file) + if (dump_file) { basic_block bb; - fprintf (rtl_dump_file, "Final order:\n"); - for (bb = traces[0].first; bb; bb = bb->rbi->next) - fprintf (rtl_dump_file, "%d ", bb->index); - fprintf (rtl_dump_file, "\n"); - fflush (rtl_dump_file); + fprintf (dump_file, "Final order:\n"); + for (bb = traces[0].first; bb; bb = bb->aux) + fprintf (dump_file, "%d ", bb->index); + fprintf (dump_file, "\n"); + fflush (dump_file); } FREE (connected); @@ -1003,41 +1160,33 @@ copy_bb_p (basic_block bb, int code_may_grow) int size = 0; int max_size = uncond_jump_length; rtx insn; - int n_succ; - edge e; if (!bb->frequency) return false; - if (!bb->pred || !bb->pred->pred_next) + if (EDGE_COUNT (bb->preds) < 2) return false; - if (!cfg_layout_can_duplicate_bb_p (bb)) + if (!can_duplicate_block_p (bb)) return false; /* Avoid duplicating blocks which have many successors (PR/13430). */ - n_succ = 0; - for (e = bb->succ; e; e = e->succ_next) - { - n_succ++; - if (n_succ > 8) - return false; - } + if (EDGE_COUNT (bb->succs) > 8) + return false; if (code_may_grow && maybe_hot_bb_p (bb)) - max_size *= 8; + max_size *= PARAM_VALUE (PARAM_MAX_GROW_COPY_BB_INSNS); - for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) { if (INSN_P (insn)) - size += get_attr_length (insn); + size += get_attr_min_length (insn); } if (size <= max_size) return true; - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Block %d can't be copied because its size = %d.\n", bb->index, size); } @@ -1056,13 +1205,685 @@ get_uncond_jump_length (void) label = emit_label_before (gen_label_rtx (), get_insns ()); jump = emit_jump_insn (gen_jump (label)); - length = get_attr_length (jump); + length = get_attr_min_length (jump); delete_insn (jump); delete_insn (label); return length; } +/* Find the basic blocks that are rarely executed and need to be moved to + a separate section of the .o file (to cut down on paging and improve + cache locality). */ + +static void +find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges, + int *n_crossing_edges, + int *max_idx) +{ + basic_block bb; + bool has_hot_blocks = false; + edge e; + int i; + edge_iterator ei; + + /* Mark which partition (hot/cold) each basic block belongs in. */ + + FOR_EACH_BB (bb) + { + if (probably_never_executed_bb_p (bb)) + BB_SET_PARTITION (bb, BB_COLD_PARTITION); + else + { + BB_SET_PARTITION (bb, BB_HOT_PARTITION); + has_hot_blocks = true; + } + } + + /* Mark every edge that crosses between sections. */ + + i = 0; + FOR_EACH_BB (bb) + FOR_EACH_EDGE (e, ei, bb->succs) + { + if (e->src != ENTRY_BLOCK_PTR + && e->dest != EXIT_BLOCK_PTR + && BB_PARTITION (e->src) != BB_PARTITION (e->dest)) + { + e->flags |= EDGE_CROSSING; + if (i == *max_idx) + { + *max_idx *= 2; + crossing_edges = xrealloc (crossing_edges, + (*max_idx) * sizeof (edge)); + } + crossing_edges[i++] = e; + } + else + e->flags &= ~EDGE_CROSSING; + } + *n_crossing_edges = i; +} + +/* If any destination of a crossing edge does not have a label, add label; + Convert any fall-through crossing edges (for blocks that do not contain + a jump) to unconditional jumps. */ + +static void +add_labels_and_missing_jumps (edge *crossing_edges, int n_crossing_edges) +{ + int i; + basic_block src; + basic_block dest; + rtx label; + rtx barrier; + rtx new_jump; + + for (i=0; i < n_crossing_edges; i++) + { + if (crossing_edges[i]) + { + src = crossing_edges[i]->src; + dest = crossing_edges[i]->dest; + + /* Make sure dest has a label. */ + + if (dest && (dest != EXIT_BLOCK_PTR)) + { + label = block_label (dest); + + /* Make sure source block ends with a jump. */ + + if (src && (src != ENTRY_BLOCK_PTR)) + { + if (!JUMP_P (BB_END (src))) + /* bb just falls through. */ + { + /* make sure there's only one successor */ + gcc_assert (single_succ_p (src)); + + /* Find label in dest block. */ + label = block_label (dest); + + new_jump = emit_jump_insn_after (gen_jump (label), + BB_END (src)); + barrier = emit_barrier_after (new_jump); + JUMP_LABEL (new_jump) = label; + LABEL_NUSES (label) += 1; + src->il.rtl->footer = unlink_insn_chain (barrier, barrier); + /* Mark edge as non-fallthru. */ + crossing_edges[i]->flags &= ~EDGE_FALLTHRU; + } /* end: 'if (GET_CODE ... ' */ + } /* end: 'if (src && src->index...' */ + } /* end: 'if (dest && dest->index...' */ + } /* end: 'if (crossing_edges[i]...' */ + } /* end for loop */ +} + +/* Find any bb's where the fall-through edge is a crossing edge (note that + these bb's must also contain a conditional jump; we've already + dealt with fall-through edges for blocks that didn't have a + conditional jump in the call to add_labels_and_missing_jumps). + Convert the fall-through edge to non-crossing edge by inserting a + new bb to fall-through into. The new bb will contain an + unconditional jump (crossing edge) to the original fall through + destination. */ + +static void +fix_up_fall_thru_edges (void) +{ + basic_block cur_bb; + basic_block new_bb; + edge succ1; + edge succ2; + edge fall_thru; + edge cond_jump = NULL; + edge e; + bool cond_jump_crosses; + int invert_worked; + rtx old_jump; + rtx fall_thru_label; + rtx barrier; + + FOR_EACH_BB (cur_bb) + { + fall_thru = NULL; + if (EDGE_COUNT (cur_bb->succs) > 0) + succ1 = EDGE_SUCC (cur_bb, 0); + else + succ1 = NULL; + + if (EDGE_COUNT (cur_bb->succs) > 1) + succ2 = EDGE_SUCC (cur_bb, 1); + else + succ2 = NULL; + + /* Find the fall-through edge. */ + + if (succ1 + && (succ1->flags & EDGE_FALLTHRU)) + { + fall_thru = succ1; + cond_jump = succ2; + } + else if (succ2 + && (succ2->flags & EDGE_FALLTHRU)) + { + fall_thru = succ2; + cond_jump = succ1; + } + + if (fall_thru && (fall_thru->dest != EXIT_BLOCK_PTR)) + { + /* Check to see if the fall-thru edge is a crossing edge. */ + + if (fall_thru->flags & EDGE_CROSSING) + { + /* The fall_thru edge crosses; now check the cond jump edge, if + it exists. */ + + cond_jump_crosses = true; + invert_worked = 0; + old_jump = BB_END (cur_bb); + + /* Find the jump instruction, if there is one. */ + + if (cond_jump) + { + if (!(cond_jump->flags & EDGE_CROSSING)) + cond_jump_crosses = false; + + /* We know the fall-thru edge crosses; if the cond + jump edge does NOT cross, and its destination is the + next block in the bb order, invert the jump + (i.e. fix it so the fall thru does not cross and + the cond jump does). */ + + if (!cond_jump_crosses + && cur_bb->aux == cond_jump->dest) + { + /* Find label in fall_thru block. We've already added + any missing labels, so there must be one. */ + + fall_thru_label = block_label (fall_thru->dest); + + if (old_jump && fall_thru_label) + invert_worked = invert_jump (old_jump, + fall_thru_label,0); + if (invert_worked) + { + fall_thru->flags &= ~EDGE_FALLTHRU; + cond_jump->flags |= EDGE_FALLTHRU; + update_br_prob_note (cur_bb); + e = fall_thru; + fall_thru = cond_jump; + cond_jump = e; + cond_jump->flags |= EDGE_CROSSING; + fall_thru->flags &= ~EDGE_CROSSING; + } + } + } + + if (cond_jump_crosses || !invert_worked) + { + /* This is the case where both edges out of the basic + block are crossing edges. Here we will fix up the + fall through edge. The jump edge will be taken care + of later. */ + + new_bb = force_nonfallthru (fall_thru); + + if (new_bb) + { + new_bb->aux = cur_bb->aux; + cur_bb->aux = new_bb; + + /* Make sure new fall-through bb is in same + partition as bb it's falling through from. */ + + BB_COPY_PARTITION (new_bb, cur_bb); + single_succ_edge (new_bb)->flags |= EDGE_CROSSING; + } + + /* Add barrier after new jump */ + + if (new_bb) + { + barrier = emit_barrier_after (BB_END (new_bb)); + new_bb->il.rtl->footer = unlink_insn_chain (barrier, + barrier); + } + else + { + barrier = emit_barrier_after (BB_END (cur_bb)); + cur_bb->il.rtl->footer = unlink_insn_chain (barrier, + barrier); + } + } + } + } + } +} + +/* This function checks the destination blockof a "crossing jump" to + see if it has any crossing predecessors that begin with a code label + and end with an unconditional jump. If so, it returns that predecessor + block. (This is to avoid creating lots of new basic blocks that all + contain unconditional jumps to the same destination). */ + +static basic_block +find_jump_block (basic_block jump_dest) +{ + basic_block source_bb = NULL; + edge e; + rtx insn; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, jump_dest->preds) + if (e->flags & EDGE_CROSSING) + { + basic_block src = e->src; + + /* Check each predecessor to see if it has a label, and contains + only one executable instruction, which is an unconditional jump. + If so, we can use it. */ + + if (LABEL_P (BB_HEAD (src))) + for (insn = BB_HEAD (src); + !INSN_P (insn) && insn != NEXT_INSN (BB_END (src)); + insn = NEXT_INSN (insn)) + { + if (INSN_P (insn) + && insn == BB_END (src) + && JUMP_P (insn) + && !any_condjump_p (insn)) + { + source_bb = src; + break; + } + } + + if (source_bb) + break; + } + + return source_bb; +} + +/* Find all BB's with conditional jumps that are crossing edges; + insert a new bb and make the conditional jump branch to the new + bb instead (make the new bb same color so conditional branch won't + be a 'crossing' edge). Insert an unconditional jump from the + new bb to the original destination of the conditional jump. */ + +static void +fix_crossing_conditional_branches (void) +{ + basic_block cur_bb; + basic_block new_bb; + basic_block last_bb; + basic_block dest; + basic_block prev_bb; + edge succ1; + edge succ2; + edge crossing_edge; + edge new_edge; + rtx old_jump; + rtx set_src; + rtx old_label = NULL_RTX; + rtx new_label; + rtx new_jump; + rtx barrier; + + last_bb = EXIT_BLOCK_PTR->prev_bb; + + FOR_EACH_BB (cur_bb) + { + crossing_edge = NULL; + if (EDGE_COUNT (cur_bb->succs) > 0) + succ1 = EDGE_SUCC (cur_bb, 0); + else + succ1 = NULL; + + if (EDGE_COUNT (cur_bb->succs) > 1) + succ2 = EDGE_SUCC (cur_bb, 1); + else + succ2 = NULL; + + /* We already took care of fall-through edges, so only one successor + can be a crossing edge. */ + + if (succ1 && (succ1->flags & EDGE_CROSSING)) + crossing_edge = succ1; + else if (succ2 && (succ2->flags & EDGE_CROSSING)) + crossing_edge = succ2; + + if (crossing_edge) + { + old_jump = BB_END (cur_bb); + + /* Check to make sure the jump instruction is a + conditional jump. */ + + set_src = NULL_RTX; + + if (any_condjump_p (old_jump)) + { + if (GET_CODE (PATTERN (old_jump)) == SET) + set_src = SET_SRC (PATTERN (old_jump)); + else if (GET_CODE (PATTERN (old_jump)) == PARALLEL) + { + set_src = XVECEXP (PATTERN (old_jump), 0,0); + if (GET_CODE (set_src) == SET) + set_src = SET_SRC (set_src); + else + set_src = NULL_RTX; + } + } + + if (set_src && (GET_CODE (set_src) == IF_THEN_ELSE)) + { + if (GET_CODE (XEXP (set_src, 1)) == PC) + old_label = XEXP (set_src, 2); + else if (GET_CODE (XEXP (set_src, 2)) == PC) + old_label = XEXP (set_src, 1); + + /* Check to see if new bb for jumping to that dest has + already been created; if so, use it; if not, create + a new one. */ + + new_bb = find_jump_block (crossing_edge->dest); + + if (new_bb) + new_label = block_label (new_bb); + else + { + /* Create new basic block to be dest for + conditional jump. */ + + new_bb = create_basic_block (NULL, NULL, last_bb); + new_bb->aux = last_bb->aux; + last_bb->aux = new_bb; + prev_bb = last_bb; + last_bb = new_bb; + + /* Update register liveness information. */ + + new_bb->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + new_bb->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (new_bb->il.rtl->global_live_at_end, + prev_bb->il.rtl->global_live_at_end); + COPY_REG_SET (new_bb->il.rtl->global_live_at_start, + prev_bb->il.rtl->global_live_at_end); + + /* Put appropriate instructions in new bb. */ + + new_label = gen_label_rtx (); + emit_label_before (new_label, BB_HEAD (new_bb)); + BB_HEAD (new_bb) = new_label; + + if (GET_CODE (old_label) == LABEL_REF) + { + old_label = JUMP_LABEL (old_jump); + new_jump = emit_jump_insn_after (gen_jump + (old_label), + BB_END (new_bb)); + } + else + { + gcc_assert (HAVE_return + && GET_CODE (old_label) == RETURN); + new_jump = emit_jump_insn_after (gen_return (), + BB_END (new_bb)); + } + + barrier = emit_barrier_after (new_jump); + JUMP_LABEL (new_jump) = old_label; + new_bb->il.rtl->footer = unlink_insn_chain (barrier, + barrier); + + /* Make sure new bb is in same partition as source + of conditional branch. */ + BB_COPY_PARTITION (new_bb, cur_bb); + } + + /* Make old jump branch to new bb. */ + + redirect_jump (old_jump, new_label, 0); + + /* Remove crossing_edge as predecessor of 'dest'. */ + + dest = crossing_edge->dest; + + redirect_edge_succ (crossing_edge, new_bb); + + /* Make a new edge from new_bb to old dest; new edge + will be a successor for new_bb and a predecessor + for 'dest'. */ + + if (EDGE_COUNT (new_bb->succs) == 0) + new_edge = make_edge (new_bb, dest, 0); + else + new_edge = EDGE_SUCC (new_bb, 0); + + crossing_edge->flags &= ~EDGE_CROSSING; + new_edge->flags |= EDGE_CROSSING; + } + } + } +} + +/* Find any unconditional branches that cross between hot and cold + sections. Convert them into indirect jumps instead. */ + +static void +fix_crossing_unconditional_branches (void) +{ + basic_block cur_bb; + rtx last_insn; + rtx label; + rtx label_addr; + rtx indirect_jump_sequence; + rtx jump_insn = NULL_RTX; + rtx new_reg; + rtx cur_insn; + edge succ; + + FOR_EACH_BB (cur_bb) + { + last_insn = BB_END (cur_bb); + + if (EDGE_COUNT (cur_bb->succs) < 1) + continue; + + succ = EDGE_SUCC (cur_bb, 0); + + /* Check to see if bb ends in a crossing (unconditional) jump. At + this point, no crossing jumps should be conditional. */ + + if (JUMP_P (last_insn) + && (succ->flags & EDGE_CROSSING)) + { + rtx label2, table; + + gcc_assert (!any_condjump_p (last_insn)); + + /* Make sure the jump is not already an indirect or table jump. */ + + if (!computed_jump_p (last_insn) + && !tablejump_p (last_insn, &label2, &table)) + { + /* We have found a "crossing" unconditional branch. Now + we must convert it to an indirect jump. First create + reference of label, as target for jump. */ + + label = JUMP_LABEL (last_insn); + label_addr = gen_rtx_LABEL_REF (Pmode, label); + LABEL_NUSES (label) += 1; + + /* Get a register to use for the indirect jump. */ + + new_reg = gen_reg_rtx (Pmode); + + /* Generate indirect the jump sequence. */ + + start_sequence (); + emit_move_insn (new_reg, label_addr); + emit_indirect_jump (new_reg); + indirect_jump_sequence = get_insns (); + end_sequence (); + + /* Make sure every instruction in the new jump sequence has + its basic block set to be cur_bb. */ + + for (cur_insn = indirect_jump_sequence; cur_insn; + cur_insn = NEXT_INSN (cur_insn)) + { + if (!BARRIER_P (cur_insn)) + BLOCK_FOR_INSN (cur_insn) = cur_bb; + if (JUMP_P (cur_insn)) + jump_insn = cur_insn; + } + + /* Insert the new (indirect) jump sequence immediately before + the unconditional jump, then delete the unconditional jump. */ + + emit_insn_before (indirect_jump_sequence, last_insn); + delete_insn (last_insn); + + /* Make BB_END for cur_bb be the jump instruction (NOT the + barrier instruction at the end of the sequence...). */ + + BB_END (cur_bb) = jump_insn; + } + } + } +} + +/* Add REG_CROSSING_JUMP note to all crossing jump insns. */ + +static void +add_reg_crossing_jump_notes (void) +{ + basic_block bb; + edge e; + edge_iterator ei; + + FOR_EACH_BB (bb) + FOR_EACH_EDGE (e, ei, bb->succs) + if ((e->flags & EDGE_CROSSING) + && JUMP_P (BB_END (e->src))) + REG_NOTES (BB_END (e->src)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP, + NULL_RTX, + REG_NOTES (BB_END + (e->src))); +} + +/* Hot and cold basic blocks are partitioned and put in separate + sections of the .o file, to reduce paging and improve cache + performance (hopefully). This can result in bits of code from the + same function being widely separated in the .o file. However this + is not obvious to the current bb structure. Therefore we must take + care to ensure that: 1). There are no fall_thru edges that cross + between sections; 2). For those architectures which have "short" + conditional branches, all conditional branches that attempt to + cross between sections are converted to unconditional branches; + and, 3). For those architectures which have "short" unconditional + branches, all unconditional branches that attempt to cross between + sections are converted to indirect jumps. + + The code for fixing up fall_thru edges that cross between hot and + cold basic blocks does so by creating new basic blocks containing + unconditional branches to the appropriate label in the "other" + section. The new basic block is then put in the same (hot or cold) + section as the original conditional branch, and the fall_thru edge + is modified to fall into the new basic block instead. By adding + this level of indirection we end up with only unconditional branches + crossing between hot and cold sections. + + Conditional branches are dealt with by adding a level of indirection. + A new basic block is added in the same (hot/cold) section as the + conditional branch, and the conditional branch is retargeted to the + new basic block. The new basic block contains an unconditional branch + to the original target of the conditional branch (in the other section). + + Unconditional branches are dealt with by converting them into + indirect jumps. */ + +static void +fix_edges_for_rarely_executed_code (edge *crossing_edges, + int n_crossing_edges) +{ + /* Make sure the source of any crossing edge ends in a jump and the + destination of any crossing edge has a label. */ + + add_labels_and_missing_jumps (crossing_edges, n_crossing_edges); + + /* Convert all crossing fall_thru edges to non-crossing fall + thrus to unconditional jumps (that jump to the original fall + thru dest). */ + + fix_up_fall_thru_edges (); + + /* If the architecture does not have conditional branches that can + span all of memory, convert crossing conditional branches into + crossing unconditional branches. */ + + if (!HAS_LONG_COND_BRANCH) + fix_crossing_conditional_branches (); + + /* If the architecture does not have unconditional branches that + can span all of memory, convert crossing unconditional branches + into indirect jumps. Since adding an indirect jump also adds + a new register usage, update the register usage information as + well. */ + + if (!HAS_LONG_UNCOND_BRANCH) + { + fix_crossing_unconditional_branches (); + reg_scan (get_insns(), max_reg_num ()); + } + + add_reg_crossing_jump_notes (); +} + +/* Verify, in the basic block chain, that there is at most one switch + between hot/cold partitions. This is modelled on + rtl_verify_flow_info_1, but it cannot go inside that function + because this condition will not be true until after + reorder_basic_blocks is called. */ + +static void +verify_hot_cold_block_grouping (void) +{ + basic_block bb; + int err = 0; + bool switched_sections = false; + int current_partition = 0; + + FOR_EACH_BB (bb) + { + if (!current_partition) + current_partition = BB_PARTITION (bb); + if (BB_PARTITION (bb) != current_partition) + { + if (switched_sections) + { + error ("multiple hot/cold transitions found (bb %i)", + bb->index); + err = 1; + } + else + { + switched_sections = true; + current_partition = BB_PARTITION (bb); + } + } + } + + gcc_assert(!err); +} + /* Reorder basic blocks. The main entry point to this file. FLAGS is the set of flags to pass to cfg_layout_initialize(). */ @@ -1073,14 +1894,12 @@ reorder_basic_blocks (unsigned int flags) int i; struct trace *traces; - if (n_basic_blocks <= 1) + if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1) return; - if ((* targetm.cannot_modify_jumps_p) ()) + if (targetm.cannot_modify_jumps_p ()) return; - timevar_push (TV_REORDER_BLOCKS); - cfg_layout_initialize (flags); set_edge_can_fallthru_flag (); @@ -1093,26 +1912,390 @@ reorder_basic_blocks (unsigned int flags) /* We need to know some information for each basic block. */ array_size = GET_ARRAY_SIZE (last_basic_block); - bbd = xmalloc (array_size * sizeof (bbro_basic_block_data)); + bbd = XNEWVEC (bbro_basic_block_data, array_size); for (i = 0; i < array_size; i++) { bbd[i].start_of_trace = -1; + bbd[i].in_trace = -1; bbd[i].end_of_trace = -1; bbd[i].heap = NULL; bbd[i].node = NULL; } - traces = xmalloc (n_basic_blocks * sizeof (struct trace)); + traces = XNEWVEC (struct trace, n_basic_blocks); n_traces = 0; find_traces (&n_traces, traces); connect_traces (n_traces, traces); FREE (traces); FREE (bbd); - if (rtl_dump_file) - dump_flow_info (rtl_dump_file); + if (dump_file) + dump_flow_info (dump_file, dump_flags); cfg_layout_finalize (); - - timevar_pop (TV_REORDER_BLOCKS); + if (flag_reorder_blocks_and_partition) + verify_hot_cold_block_grouping (); } + +/* Determine which partition the first basic block in the function + belongs to, then find the first basic block in the current function + that belongs to a different section, and insert a + NOTE_INSN_SWITCH_TEXT_SECTIONS note immediately before it in the + instruction stream. When writing out the assembly code, + encountering this note will make the compiler switch between the + hot and cold text sections. */ + +static void +insert_section_boundary_note (void) +{ + basic_block bb; + rtx new_note; + int first_partition = 0; + + if (flag_reorder_blocks_and_partition) + FOR_EACH_BB (bb) + { + if (!first_partition) + first_partition = BB_PARTITION (bb); + if (BB_PARTITION (bb) != first_partition) + { + new_note = emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS, + BB_HEAD (bb)); + break; + } + } +} + +/* Duplicate the blocks containing computed gotos. This basically unfactors + computed gotos that were factored early on in the compilation process to + speed up edge based data flow. We used to not unfactoring them again, + which can seriously pessimize code with many computed jumps in the source + code, such as interpreters. See e.g. PR15242. */ + +static bool +gate_duplicate_computed_gotos (void) +{ + return (optimize > 0 && flag_expensive_optimizations && !optimize_size); +} + + +static unsigned int +duplicate_computed_gotos (void) +{ + basic_block bb, new_bb; + bitmap candidates; + int max_size; + + if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1) + return 0; + + if (targetm.cannot_modify_jumps_p ()) + return 0; + + cfg_layout_initialize (0); + + /* We are estimating the length of uncond jump insn only once + since the code for getting the insn length always returns + the minimal length now. */ + if (uncond_jump_length == 0) + uncond_jump_length = get_uncond_jump_length (); + + max_size = uncond_jump_length * PARAM_VALUE (PARAM_MAX_GOTO_DUPLICATION_INSNS); + candidates = BITMAP_ALLOC (NULL); + + /* Look for blocks that end in a computed jump, and see if such blocks + are suitable for unfactoring. If a block is a candidate for unfactoring, + mark it in the candidates. */ + FOR_EACH_BB (bb) + { + rtx insn; + edge e; + edge_iterator ei; + int size, all_flags; + + /* Build the reorder chain for the original order of blocks. */ + if (bb->next_bb != EXIT_BLOCK_PTR) + bb->aux = bb->next_bb; + + /* Obviously the block has to end in a computed jump. */ + if (!computed_jump_p (BB_END (bb))) + continue; + + /* Only consider blocks that can be duplicated. */ + if (find_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX) + || !can_duplicate_block_p (bb)) + continue; + + /* Make sure that the block is small enough. */ + size = 0; + FOR_BB_INSNS (bb, insn) + if (INSN_P (insn)) + { + size += get_attr_min_length (insn); + if (size > max_size) + break; + } + if (size > max_size) + continue; + + /* Final check: there must not be any incoming abnormal edges. */ + all_flags = 0; + FOR_EACH_EDGE (e, ei, bb->preds) + all_flags |= e->flags; + if (all_flags & EDGE_COMPLEX) + continue; + + bitmap_set_bit (candidates, bb->index); + } + + /* Nothing to do if there is no computed jump here. */ + if (bitmap_empty_p (candidates)) + goto done; + + /* Duplicate computed gotos. */ + FOR_EACH_BB (bb) + { + if (bb->il.rtl->visited) + continue; + + bb->il.rtl->visited = 1; + + /* BB must have one outgoing edge. That edge must not lead to + the exit block or the next block. + The destination must have more than one predecessor. */ + if (!single_succ_p (bb) + || single_succ (bb) == EXIT_BLOCK_PTR + || single_succ (bb) == bb->next_bb + || single_pred_p (single_succ (bb))) + continue; + + /* The successor block has to be a duplication candidate. */ + if (!bitmap_bit_p (candidates, single_succ (bb)->index)) + continue; + + new_bb = duplicate_block (single_succ (bb), single_succ_edge (bb), bb); + new_bb->aux = bb->aux; + bb->aux = new_bb; + new_bb->il.rtl->visited = 1; + } + +done: + cfg_layout_finalize (); + + BITMAP_FREE (candidates); + return 0; +} + +struct tree_opt_pass pass_duplicate_computed_gotos = +{ + "compgotos", /* name */ + gate_duplicate_computed_gotos, /* gate */ + duplicate_computed_gotos, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_REORDER_BLOCKS, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 0 /* letter */ +}; + + +/* This function is the main 'entrance' for the optimization that + partitions hot and cold basic blocks into separate sections of the + .o file (to improve performance and cache locality). Ideally it + would be called after all optimizations that rearrange the CFG have + been called. However part of this optimization may introduce new + register usage, so it must be called before register allocation has + occurred. This means that this optimization is actually called + well before the optimization that reorders basic blocks (see + function above). + + This optimization checks the feedback information to determine + which basic blocks are hot/cold, updates flags on the basic blocks + to indicate which section they belong in. This information is + later used for writing out sections in the .o file. Because hot + and cold sections can be arbitrarily large (within the bounds of + memory), far beyond the size of a single function, it is necessary + to fix up all edges that cross section boundaries, to make sure the + instructions used can actually span the required distance. The + fixes are described below. + + Fall-through edges must be changed into jumps; it is not safe or + legal to fall through across a section boundary. Whenever a + fall-through edge crossing a section boundary is encountered, a new + basic block is inserted (in the same section as the fall-through + source), and the fall through edge is redirected to the new basic + block. The new basic block contains an unconditional jump to the + original fall-through target. (If the unconditional jump is + insufficient to cross section boundaries, that is dealt with a + little later, see below). + + In order to deal with architectures that have short conditional + branches (which cannot span all of memory) we take any conditional + jump that attempts to cross a section boundary and add a level of + indirection: it becomes a conditional jump to a new basic block, in + the same section. The new basic block contains an unconditional + jump to the original target, in the other section. + + For those architectures whose unconditional branch is also + incapable of reaching all of memory, those unconditional jumps are + converted into indirect jumps, through a register. + + IMPORTANT NOTE: This optimization causes some messy interactions + with the cfg cleanup optimizations; those optimizations want to + merge blocks wherever possible, and to collapse indirect jump + sequences (change "A jumps to B jumps to C" directly into "A jumps + to C"). Those optimizations can undo the jump fixes that + partitioning is required to make (see above), in order to ensure + that jumps attempting to cross section boundaries are really able + to cover whatever distance the jump requires (on many architectures + conditional or unconditional jumps are not able to reach all of + memory). Therefore tests have to be inserted into each such + optimization to make sure that it does not undo stuff necessary to + cross partition boundaries. This would be much less of a problem + if we could perform this optimization later in the compilation, but + unfortunately the fact that we may need to create indirect jumps + (through registers) requires that this optimization be performed + before register allocation. */ + +static void +partition_hot_cold_basic_blocks (void) +{ + basic_block cur_bb; + edge *crossing_edges; + int n_crossing_edges; + int max_edges = 2 * last_basic_block; + + if (n_basic_blocks <= NUM_FIXED_BLOCKS + 1) + return; + + crossing_edges = XCNEWVEC (edge, max_edges); + + cfg_layout_initialize (0); + + FOR_EACH_BB (cur_bb) + if (cur_bb->index >= NUM_FIXED_BLOCKS + && cur_bb->next_bb->index >= NUM_FIXED_BLOCKS) + cur_bb->aux = cur_bb->next_bb; + + find_rarely_executed_basic_blocks_and_crossing_edges (crossing_edges, + &n_crossing_edges, + &max_edges); + + if (n_crossing_edges > 0) + fix_edges_for_rarely_executed_code (crossing_edges, n_crossing_edges); + + free (crossing_edges); + + cfg_layout_finalize(); +} + +static bool +gate_handle_reorder_blocks (void) +{ + return (optimize > 0); +} + + +/* Reorder basic blocks. */ +static unsigned int +rest_of_handle_reorder_blocks (void) +{ + bool changed; + unsigned int liveness_flags; + + /* Last attempt to optimize CFG, as scheduling, peepholing and insn + splitting possibly introduced more crossjumping opportunities. */ + liveness_flags = (!HAVE_conditional_execution ? CLEANUP_UPDATE_LIFE : 0); + changed = cleanup_cfg (CLEANUP_EXPENSIVE | liveness_flags); + + if (flag_sched2_use_traces && flag_schedule_insns_after_reload) + { + timevar_push (TV_TRACER); + tracer (liveness_flags); + timevar_pop (TV_TRACER); + } + + if (flag_reorder_blocks || flag_reorder_blocks_and_partition) + reorder_basic_blocks (liveness_flags); + if (flag_reorder_blocks || flag_reorder_blocks_and_partition + || (flag_sched2_use_traces && flag_schedule_insns_after_reload)) + changed |= cleanup_cfg (CLEANUP_EXPENSIVE | liveness_flags); + + /* On conditional execution targets we can not update the life cheaply, so + we deffer the updating to after both cleanups. This may lose some cases + but should not be terribly bad. */ + if (changed && HAVE_conditional_execution) + update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, + PROP_DEATH_NOTES); + + /* Add NOTE_INSN_SWITCH_TEXT_SECTIONS notes. */ + insert_section_boundary_note (); + return 0; +} + +struct tree_opt_pass pass_reorder_blocks = +{ + "bbro", /* name */ + gate_handle_reorder_blocks, /* gate */ + rest_of_handle_reorder_blocks, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_REORDER_BLOCKS, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 'B' /* letter */ +}; + +static bool +gate_handle_partition_blocks (void) +{ + /* The optimization to partition hot/cold basic blocks into separate + sections of the .o file does not work well with linkonce or with + user defined section attributes. Don't call it if either case + arises. */ + + return (flag_reorder_blocks_and_partition + && !DECL_ONE_ONLY (current_function_decl) + && !user_defined_section_attribute); +} + +/* Partition hot and cold basic blocks. */ +static unsigned int +rest_of_handle_partition_blocks (void) +{ + no_new_pseudos = 0; + partition_hot_cold_basic_blocks (); + allocate_reg_life_data (); + update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, + PROP_LOG_LINKS | PROP_REG_INFO | PROP_DEATH_NOTES); + no_new_pseudos = 1; + return 0; +} + +struct tree_opt_pass pass_partition_blocks = +{ + "bbpart", /* name */ + gate_handle_partition_blocks, /* gate */ + rest_of_handle_partition_blocks, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_REORDER_BLOCKS, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 0 /* letter */ +}; + + diff --git a/contrib/gcc/bitmap.c b/contrib/gcc/bitmap.c index bffd9154aee..4ac38b04c2b 100644 --- a/contrib/gcc/bitmap.c +++ b/contrib/gcc/bitmap.c @@ -1,5 +1,5 @@ /* Functions to support general ended bitmaps. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -29,42 +29,37 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" #include "bitmap.h" -/* Obstack to allocate bitmap elements from. */ -static struct obstack bitmap_obstack; -static int bitmap_obstack_init = FALSE; - -#ifndef INLINE -#ifndef __GNUC__ -#define INLINE -#else -#define INLINE __inline__ -#endif -#endif - /* Global data */ -bitmap_element bitmap_zero_bits; /* An element of all zero bits. */ -static bitmap_element *bitmap_free; /* Freelist of bitmap elements. */ -static GTY((deletable (""))) bitmap_element *bitmap_ggc_free; +bitmap_element bitmap_zero_bits; /* An element of all zero bits. */ +bitmap_obstack bitmap_default_obstack; /* The default bitmap obstack. */ +static GTY((deletable)) bitmap_element *bitmap_ggc_free; /* Freelist of + GC'd elements. */ static void bitmap_elem_to_freelist (bitmap, bitmap_element *); static void bitmap_element_free (bitmap, bitmap_element *); static bitmap_element *bitmap_element_allocate (bitmap); static int bitmap_element_zerop (bitmap_element *); static void bitmap_element_link (bitmap, bitmap_element *); +static bitmap_element *bitmap_elt_insert_after (bitmap, bitmap_element *, unsigned int); +static void bitmap_elt_clear_from (bitmap, bitmap_element *); static bitmap_element *bitmap_find_bit (bitmap, unsigned int); + /* Add ELEM to the appropriate freelist. */ -static INLINE void +static inline void bitmap_elem_to_freelist (bitmap head, bitmap_element *elt) { - if (head->using_obstack) + bitmap_obstack *bit_obstack = head->obstack; + + elt->next = NULL; + if (bit_obstack) { - elt->next = bitmap_free; - bitmap_free = elt; + elt->prev = bit_obstack->elements; + bit_obstack->elements = elt; } else { - elt->next = bitmap_ggc_free; + elt->prev = bitmap_ggc_free; bitmap_ggc_free = elt; } } @@ -72,7 +67,7 @@ bitmap_elem_to_freelist (bitmap head, bitmap_element *elt) /* Free a bitmap element. Since these are allocated off the bitmap_obstack, "free" actually means "put onto the freelist". */ -static INLINE void +static inline void bitmap_element_free (bitmap head, bitmap_element *elt) { bitmap_element *next = elt->next; @@ -94,55 +89,54 @@ bitmap_element_free (bitmap head, bitmap_element *elt) head->current = next != 0 ? next : prev; if (head->current) head->indx = head->current->indx; + else + head->indx = 0; } bitmap_elem_to_freelist (head, elt); } /* Allocate a bitmap element. The bits are cleared, but nothing else is. */ -static INLINE bitmap_element * +static inline bitmap_element * bitmap_element_allocate (bitmap head) { bitmap_element *element; + bitmap_obstack *bit_obstack = head->obstack; - if (head->using_obstack) + if (bit_obstack) { - if (bitmap_free != 0) - { - element = bitmap_free; - bitmap_free = element->next; - } + element = bit_obstack->elements; + + if (element) + /* Use up the inner list first before looking at the next + element of the outer list. */ + if (element->next) + { + bit_obstack->elements = element->next; + bit_obstack->elements->prev = element->prev; + } + else + /* Inner list was just a singleton. */ + bit_obstack->elements = element->prev; else - { - /* We can't use gcc_obstack_init to initialize the obstack since - print-rtl.c now calls bitmap functions, and bitmap is linked - into the gen* functions. */ - if (!bitmap_obstack_init) - { - bitmap_obstack_init = TRUE; - -#if !defined(__GNUC__) || (__GNUC__ < 2) -#define __alignof__(type) 0 -#endif - - obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE, - __alignof__ (bitmap_element), - obstack_chunk_alloc, - obstack_chunk_free); - } - - element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element)); - } + element = XOBNEW (&bit_obstack->obstack, bitmap_element); } else { - if (bitmap_ggc_free != NULL) - { - element = bitmap_ggc_free; - bitmap_ggc_free = element->next; - } + element = bitmap_ggc_free; + if (element) + /* Use up the inner list first before looking at the next + element of the outer list. */ + if (element->next) + { + bitmap_ggc_free = element->next; + bitmap_ggc_free->prev = element->prev; + } + else + /* Inner list was just a singleton. */ + bitmap_ggc_free = element->prev; else - element = ggc_alloc (sizeof (bitmap_element)); + element = GGC_NEW (bitmap_element); } memset (element->bits, 0, sizeof (element->bits)); @@ -150,28 +144,146 @@ bitmap_element_allocate (bitmap head) return element; } -/* Release any memory allocated by bitmaps. */ +/* Remove ELT and all following elements from bitmap HEAD. */ void -bitmap_release_memory (void) +bitmap_elt_clear_from (bitmap head, bitmap_element *elt) { - bitmap_free = 0; - if (bitmap_obstack_init) + bitmap_element *prev; + bitmap_obstack *bit_obstack = head->obstack; + + if (!elt) return; + + prev = elt->prev; + if (prev) { - bitmap_obstack_init = FALSE; - obstack_free (&bitmap_obstack, NULL); + prev->next = NULL; + if (head->current->indx > prev->indx) + { + head->current = prev; + head->indx = prev->indx; + } + } + else + { + head->first = NULL; + head->current = NULL; + head->indx = 0; + } + + /* Put the entire list onto the free list in one operation. */ + if (bit_obstack) + { + elt->prev = bit_obstack->elements; + bit_obstack->elements = elt; + } + else + { + elt->prev = bitmap_ggc_free; + bitmap_ggc_free = elt; } } +/* Clear a bitmap by freeing the linked list. */ + +inline void +bitmap_clear (bitmap head) +{ + if (head->first) + bitmap_elt_clear_from (head, head->first); +} + +/* Initialize a bitmap obstack. If BIT_OBSTACK is NULL, initialize + the default bitmap obstack. */ + +void +bitmap_obstack_initialize (bitmap_obstack *bit_obstack) +{ + if (!bit_obstack) + bit_obstack = &bitmap_default_obstack; + +#if !defined(__GNUC__) || (__GNUC__ < 2) +#define __alignof__(type) 0 +#endif + + bit_obstack->elements = NULL; + bit_obstack->heads = NULL; + obstack_specify_allocation (&bit_obstack->obstack, OBSTACK_CHUNK_SIZE, + __alignof__ (bitmap_element), + obstack_chunk_alloc, + obstack_chunk_free); +} + +/* Release the memory from a bitmap obstack. If BIT_OBSTACK is NULL, + release the default bitmap obstack. */ + +void +bitmap_obstack_release (bitmap_obstack *bit_obstack) +{ + if (!bit_obstack) + bit_obstack = &bitmap_default_obstack; + + bit_obstack->elements = NULL; + bit_obstack->heads = NULL; + obstack_free (&bit_obstack->obstack, NULL); +} + +/* Create a new bitmap on an obstack. If BIT_OBSTACK is NULL, create + it on the default bitmap obstack. */ + +bitmap +bitmap_obstack_alloc (bitmap_obstack *bit_obstack) +{ + bitmap map; + + if (!bit_obstack) + bit_obstack = &bitmap_default_obstack; + map = bit_obstack->heads; + if (map) + bit_obstack->heads = (void *)map->first; + else + map = XOBNEW (&bit_obstack->obstack, bitmap_head); + bitmap_initialize (map, bit_obstack); + + return map; +} + +/* Create a new GCd bitmap. */ + +bitmap +bitmap_gc_alloc (void) +{ + bitmap map; + + map = GGC_NEW (struct bitmap_head_def); + bitmap_initialize (map, NULL); + + return map; +} + +/* Release an obstack allocated bitmap. */ + +void +bitmap_obstack_free (bitmap map) +{ + if (map) + { + bitmap_clear (map); + map->first = (void *)map->obstack->heads; + map->obstack->heads = map; + } +} + + /* Return nonzero if all bits in an element are zero. */ -static INLINE int +static inline int bitmap_element_zerop (bitmap_element *element) { #if BITMAP_ELEMENT_WORDS == 2 return (element->bits[0] | element->bits[1]) == 0; #else - int i; + unsigned i; for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) if (element->bits[i] != 0) @@ -183,7 +295,7 @@ bitmap_element_zerop (bitmap_element *element) /* Link the bitmap element into the current bitmap linked list. */ -static INLINE void +static inline void bitmap_element_link (bitmap head, bitmap_element *element) { unsigned int indx = element->indx; @@ -235,21 +347,40 @@ bitmap_element_link (bitmap head, bitmap_element *element) head->current = element; head->indx = indx; } - -/* Clear a bitmap by freeing the linked list. */ -INLINE void -bitmap_clear (bitmap head) +/* Insert a new uninitialized element into bitmap HEAD after element + ELT. If ELT is NULL, insert the element at the start. Return the + new element. */ + +static bitmap_element * +bitmap_elt_insert_after (bitmap head, bitmap_element *elt, unsigned int indx) { - bitmap_element *element, *next; + bitmap_element *node = bitmap_element_allocate (head); + node->indx = indx; - for (element = head->first; element != 0; element = next) + if (!elt) { - next = element->next; - bitmap_elem_to_freelist (head, element); + if (!head->current) + { + head->current = node; + head->indx = indx; + } + node->next = head->first; + if (node->next) + node->next->prev = node; + head->first = node; + node->prev = NULL; } - - head->first = head->current = 0; + else + { + gcc_assert (head->current); + node->next = elt->next; + if (node->next) + node->next->prev = node; + elt->next = node; + node->prev = elt; + } + return node; } /* Copy a bitmap to another bitmap. */ @@ -258,9 +389,6 @@ void bitmap_copy (bitmap to, bitmap from) { bitmap_element *from_ptr, *to_ptr = 0; -#if BITMAP_ELEMENT_WORDS != 2 - int i; -#endif bitmap_clear (to); @@ -270,14 +398,7 @@ bitmap_copy (bitmap to, bitmap from) bitmap_element *to_elt = bitmap_element_allocate (to); to_elt->indx = from_ptr->indx; - -#if BITMAP_ELEMENT_WORDS == 2 - to_elt->bits[0] = from_ptr->bits[0]; - to_elt->bits[1] = from_ptr->bits[1]; -#else - for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) - to_elt->bits[i] = from_ptr->bits[i]; -#endif + memcpy (to_elt->bits, from_ptr->bits, sizeof (to_elt->bits)); /* Here we have a special case of bitmap_element_link, for the case where we know the links are being entered in sequence. */ @@ -303,7 +424,7 @@ bitmap_copy (bitmap to, bitmap from) would hold the bitmap's bit to make eventual allocation faster. */ -static INLINE bitmap_element * +static inline bitmap_element * bitmap_find_bit (bitmap head, unsigned int bit) { bitmap_element *element; @@ -313,14 +434,26 @@ bitmap_find_bit (bitmap head, unsigned int bit) || head->indx == indx) return head->current; - if (head->indx > indx) + if (head->indx < indx) + /* INDX is beyond head->indx. Search from head->current + forward. */ + for (element = head->current; + element->next != 0 && element->indx < indx; + element = element->next) + ; + + else if (head->indx / 2 < indx) + /* INDX is less than head->indx and closer to head->indx than to + 0. Search from head->current backward. */ for (element = head->current; element->prev != 0 && element->indx > indx; element = element->prev) ; else - for (element = head->current; + /* INDX is less than head->indx and closer to 0 than to + head->indx. Search from head->first forward. */ + for (element = head->first; element->next != 0 && element->indx < indx; element = element->next) ; @@ -394,330 +527,933 @@ bitmap_bit_p (bitmap head, int bit) return (ptr->bits[word_num] >> bit_num) & 1; } -/* Return the bit number of the first set bit in the bitmap, or -1 - if the bitmap is empty. */ - -int -bitmap_first_set_bit (bitmap a) +#if GCC_VERSION < 3400 +/* Table of number of set bits in a character, indexed by value of char. */ +static unsigned char popcount_table[] = { - bitmap_element *ptr = a->first; - BITMAP_WORD word; - unsigned word_num, bit_num; + 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, + 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8, +}; - if (ptr == NULL) - return -1; - -#if BITMAP_ELEMENT_WORDS == 2 - word_num = 0, word = ptr->bits[0]; - if (word == 0) - word_num = 1, word = ptr->bits[1]; -#else - for (word_num = 0; word_num < BITMAP_ELEMENT_WORDS; ++word_num) - if ((word = ptr->bits[word_num]) != 0) - break; -#endif - - /* Binary search for the first set bit. */ - /* ??? It'd be nice to know if ffs or ffsl was available. */ - - bit_num = 0; - word = word & -word; - -#if nBITMAP_WORD_BITS > 64 - #error "Fill out the table." -#endif -#if nBITMAP_WORD_BITS > 32 - if ((word & 0xffffffff) == 0) - word >>= 32, bit_num += 32; -#endif - if ((word & 0xffff) == 0) - word >>= 16, bit_num += 16; - if ((word & 0xff) == 0) - word >>= 8, bit_num += 8; - if (word & 0xf0) - bit_num += 4; - if (word & 0xcc) - bit_num += 2; - if (word & 0xaa) - bit_num += 1; - - return (ptr->indx * BITMAP_ELEMENT_ALL_BITS - + word_num * BITMAP_WORD_BITS - + bit_num); -} - -/* Return the bit number of the last set bit in the bitmap, or -1 - if the bitmap is empty. */ - -int -bitmap_last_set_bit (bitmap a) +static unsigned long +bitmap_popcount (BITMAP_WORD a) { - bitmap_element *ptr = a->first; - BITMAP_WORD word; - unsigned word_num, bit_num; - - if (ptr == NULL) - return -1; - - while (ptr->next != NULL) - ptr = ptr->next; - -#if BITMAP_ELEMENT_WORDS == 2 - word_num = 1, word = ptr->bits[1]; - if (word == 0) - word_num = 0, word = ptr->bits[0]; -#else - for (word_num = BITMAP_ELEMENT_WORDS; word_num-- > 0; ) - if ((word = ptr->bits[word_num]) != 0) - break; -#endif - - /* Binary search for the last set bit. */ - - bit_num = 0; -#if nBITMAP_WORD_BITS > 64 - #error "Fill out the table." -#endif -#if nBITMAP_WORD_BITS > 32 - if (word & ~(BITMAP_WORD)0xffffffff) - word >>= 32, bit_num += 32; -#endif - if (word & 0xffff0000) - word >>= 16, bit_num += 16; - if (word & 0xff00) - word >>= 8, bit_num += 8; - if (word & 0xf0) - word >>= 4, bit_num += 4; - if (word & 0xc) - word >>= 2, bit_num += 2; - if (word & 0x2) - bit_num += 1; - - return (ptr->indx * BITMAP_ELEMENT_ALL_BITS - + word_num * BITMAP_WORD_BITS - + bit_num); -} - -/* Store in bitmap TO the result of combining bitmap FROM1 and FROM2 using - a specific bit manipulation. Return true if TO changes. */ - -int -bitmap_operation (bitmap to, bitmap from1, bitmap from2, - enum bitmap_bits operation) -{ -#define HIGHEST_INDEX (unsigned int) ~0 - - bitmap_element *from1_ptr = from1->first; - bitmap_element *from2_ptr = from2->first; - unsigned int indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX; - unsigned int indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX; - bitmap_element *to_ptr = to->first; - bitmap_element *from1_tmp; - bitmap_element *from2_tmp; - bitmap_element *to_tmp; - unsigned int indx; - int changed = 0; - -#if BITMAP_ELEMENT_WORDS == 2 -#define DOIT(OP) \ - do { \ - BITMAP_WORD t0, t1, f10, f11, f20, f21; \ - f10 = from1_tmp->bits[0]; \ - f20 = from2_tmp->bits[0]; \ - t0 = f10 OP f20; \ - changed |= (t0 != to_tmp->bits[0]); \ - f11 = from1_tmp->bits[1]; \ - f21 = from2_tmp->bits[1]; \ - t1 = f11 OP f21; \ - changed |= (t1 != to_tmp->bits[1]); \ - to_tmp->bits[0] = t0; \ - to_tmp->bits[1] = t1; \ - } while (0) -#else -#define DOIT(OP) \ - do { \ - BITMAP_WORD t, f1, f2; \ - int i; \ - for (i = 0; i < BITMAP_ELEMENT_WORDS; ++i) \ - { \ - f1 = from1_tmp->bits[i]; \ - f2 = from2_tmp->bits[i]; \ - t = f1 OP f2; \ - changed |= (t != to_tmp->bits[i]); \ - to_tmp->bits[i] = t; \ - } \ - } while (0) -#endif - - to->first = to->current = 0; - - while (from1_ptr != 0 || from2_ptr != 0) - { - /* Figure out whether we need to substitute zero elements for - missing links. */ - if (indx1 == indx2) - { - indx = indx1; - from1_tmp = from1_ptr; - from2_tmp = from2_ptr; - from1_ptr = from1_ptr->next; - indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX; - from2_ptr = from2_ptr->next; - indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX; - } - else if (indx1 < indx2) - { - indx = indx1; - from1_tmp = from1_ptr; - from2_tmp = &bitmap_zero_bits; - from1_ptr = from1_ptr->next; - indx1 = (from1_ptr) ? from1_ptr->indx : HIGHEST_INDEX; - } - else - { - indx = indx2; - from1_tmp = &bitmap_zero_bits; - from2_tmp = from2_ptr; - from2_ptr = from2_ptr->next; - indx2 = (from2_ptr) ? from2_ptr->indx : HIGHEST_INDEX; - } - - /* Find the appropriate element from TO. Begin by discarding - elements that we've skipped. */ - while (to_ptr && to_ptr->indx < indx) - { - changed = 1; - to_tmp = to_ptr; - to_ptr = to_ptr->next; - bitmap_elem_to_freelist (to, to_tmp); - } - if (to_ptr && to_ptr->indx == indx) - { - to_tmp = to_ptr; - to_ptr = to_ptr->next; - } - else - to_tmp = bitmap_element_allocate (to); - - /* Do the operation, and if any bits are set, link it into the - linked list. */ - switch (operation) - { - default: - abort (); - - case BITMAP_AND: - DOIT (&); - break; - - case BITMAP_AND_COMPL: - DOIT (&~); - break; - - case BITMAP_IOR: - DOIT (|); - break; - case BITMAP_IOR_COMPL: - DOIT (|~); - break; - case BITMAP_XOR: - DOIT (^); - break; - } - - if (! bitmap_element_zerop (to_tmp)) - { - to_tmp->indx = indx; - bitmap_element_link (to, to_tmp); - } - else - { - bitmap_elem_to_freelist (to, to_tmp); - } - } - - /* If we have elements of TO left over, free the lot. */ - if (to_ptr) - { - changed = 1; - for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next) - continue; - if (to->using_obstack) - { - to_tmp->next = bitmap_free; - bitmap_free = to_ptr; - } - else - { - to_tmp->next = bitmap_ggc_free; - bitmap_ggc_free = to_ptr; - } - } - -#undef DOIT - - return changed; -} - -/* Return true if two bitmaps are identical. */ - -int -bitmap_equal_p (bitmap a, bitmap b) -{ - bitmap_head c; - int ret; - - memset (&c, 0, sizeof (c)); - ret = ! bitmap_operation (&c, a, b, BITMAP_XOR); - bitmap_clear (&c); + unsigned long ret = 0; + unsigned i; + /* Just do this the table way for now */ + for (i = 0; i < BITMAP_WORD_BITS; i+= 8) + ret += popcount_table[(a >> i) & 0xff]; return ret; } - -/* Or into bitmap TO bitmap FROM1 and'ed with the complement of - bitmap FROM2. */ +#endif +/* Count the number of bits set in the bitmap, and return it. */ -void -bitmap_ior_and_compl (bitmap to, bitmap from1, bitmap from2) +unsigned long +bitmap_count_bits (bitmap a) { - bitmap_head tmp; + unsigned long count = 0; + bitmap_element *elt; + unsigned ix; - tmp.first = tmp.current = 0; - tmp.using_obstack = 0; - - bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL); - bitmap_operation (to, to, &tmp, BITMAP_IOR); - bitmap_clear (&tmp); + for (elt = a->first; elt; elt = elt->next) + { + for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) + { +#if GCC_VERSION >= 3400 + /* Note that popcountl matches BITMAP_WORD in type, so the actual size + of BITMAP_WORD is not material. */ + count += __builtin_popcountl (elt->bits[ix]); +#else + count += bitmap_popcount (elt->bits[ix]); +#endif + } + } + return count; } -int -bitmap_union_of_diff (bitmap dst, bitmap a, bitmap b, bitmap c) + + +/* Return the bit number of the first set bit in the bitmap. The + bitmap must be non-empty. */ + +unsigned +bitmap_first_set_bit (bitmap a) +{ + bitmap_element *elt = a->first; + unsigned bit_no; + BITMAP_WORD word; + unsigned ix; + + gcc_assert (elt); + bit_no = elt->indx * BITMAP_ELEMENT_ALL_BITS; + for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) + { + word = elt->bits[ix]; + if (word) + goto found_bit; + } + gcc_unreachable (); + found_bit: + bit_no += ix * BITMAP_WORD_BITS; + +#if GCC_VERSION >= 3004 + gcc_assert (sizeof(long) == sizeof (word)); + bit_no += __builtin_ctzl (word); +#else + /* Binary search for the first set bit. */ +#if BITMAP_WORD_BITS > 64 +#error "Fill out the table." +#endif +#if BITMAP_WORD_BITS > 32 + if (!(word & 0xffffffff)) + word >>= 32, bit_no += 32; +#endif + if (!(word & 0xffff)) + word >>= 16, bit_no += 16; + if (!(word & 0xff)) + word >>= 8, bit_no += 8; + if (!(word & 0xf)) + word >>= 4, bit_no += 4; + if (!(word & 0x3)) + word >>= 2, bit_no += 2; + if (!(word & 0x1)) + word >>= 1, bit_no += 1; + + gcc_assert (word & 1); +#endif + return bit_no; +} + + +/* DST = A & B. */ + +void +bitmap_and (bitmap dst, bitmap a, bitmap b) +{ + bitmap_element *dst_elt = dst->first; + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *dst_prev = NULL; + + gcc_assert (dst != a && dst != b); + + if (a == b) + { + bitmap_copy (dst, a); + return; + } + + while (a_elt && b_elt) + { + if (a_elt->indx < b_elt->indx) + a_elt = a_elt->next; + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + /* Matching elts, generate A & B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); + else + dst_elt->indx = a_elt->indx; + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix]; + + dst_elt->bits[ix] = r; + ior |= r; + } + if (ior) + { + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + a_elt = a_elt->next; + b_elt = b_elt->next; + } + } + bitmap_elt_clear_from (dst, dst_elt); + gcc_assert (!dst->current == !dst->first); + if (dst->current) + dst->indx = dst->current->indx; +} + +/* A &= B. */ + +void +bitmap_and_into (bitmap a, bitmap b) +{ + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *next; + + if (a == b) + return; + + while (a_elt && b_elt) + { + if (a_elt->indx < b_elt->indx) + { + next = a_elt->next; + bitmap_element_free (a, a_elt); + a_elt = next; + } + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + /* Matching elts, generate A &= B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix]; + + a_elt->bits[ix] = r; + ior |= r; + } + next = a_elt->next; + if (!ior) + bitmap_element_free (a, a_elt); + a_elt = next; + b_elt = b_elt->next; + } + } + bitmap_elt_clear_from (a, a_elt); + gcc_assert (!a->current == !a->first); + gcc_assert (!a->current || a->indx == a->current->indx); +} + +/* DST = A & ~B */ + +void +bitmap_and_compl (bitmap dst, bitmap a, bitmap b) +{ + bitmap_element *dst_elt = dst->first; + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *dst_prev = NULL; + + gcc_assert (dst != a && dst != b); + + if (a == b) + { + bitmap_clear (dst); + return; + } + + while (a_elt) + { + if (!b_elt || a_elt->indx < b_elt->indx) + { + /* Copy a_elt. */ + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); + else + dst_elt->indx = a_elt->indx; + memcpy (dst_elt->bits, a_elt->bits, sizeof (dst_elt->bits)); + dst_prev = dst_elt; + dst_elt = dst_elt->next; + a_elt = a_elt->next; + } + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + /* Matching elts, generate A & ~B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); + else + dst_elt->indx = a_elt->indx; + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix]; + + dst_elt->bits[ix] = r; + ior |= r; + } + if (ior) + { + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + a_elt = a_elt->next; + b_elt = b_elt->next; + } + } + bitmap_elt_clear_from (dst, dst_elt); + gcc_assert (!dst->current == !dst->first); + if (dst->current) + dst->indx = dst->current->indx; +} + +/* A &= ~B. Returns true if A changes */ + +bool +bitmap_and_compl_into (bitmap a, bitmap b) +{ + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *next; + BITMAP_WORD changed = 0; + + if (a == b) + { + if (bitmap_empty_p (a)) + return false; + else + { + bitmap_clear (a); + return true; + } + } + + while (a_elt && b_elt) + { + if (a_elt->indx < b_elt->indx) + a_elt = a_elt->next; + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + /* Matching elts, generate A &= ~B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix]; + BITMAP_WORD r = a_elt->bits[ix] ^ cleared; + + a_elt->bits[ix] = r; + changed |= cleared; + ior |= r; + } + next = a_elt->next; + if (!ior) + bitmap_element_free (a, a_elt); + a_elt = next; + b_elt = b_elt->next; + } + } + gcc_assert (!a->current == !a->first); + gcc_assert (!a->current || a->indx == a->current->indx); + return changed != 0; +} + +/* Clear COUNT bits from START in HEAD. */ +void +bitmap_clear_range (bitmap head, unsigned int start, unsigned int count) +{ + unsigned int first_index = start / BITMAP_ELEMENT_ALL_BITS; + unsigned int end_bit_plus1 = start + count; + unsigned int end_bit = end_bit_plus1 - 1; + unsigned int last_index = (end_bit) / BITMAP_ELEMENT_ALL_BITS; + bitmap_element *elt = bitmap_find_bit (head, start); + + /* If bitmap_find_bit returns zero, the current is the closest block + to the result. If the current is less than first index, find the + next one. Otherwise, just set elt to be current. */ + if (!elt) + { + if (head->current) + { + if (head->indx < first_index) + { + elt = head->current->next; + if (!elt) + return; + } + else + elt = head->current; + } + else + return; + } + + while (elt && (elt->indx <= last_index)) + { + bitmap_element * next_elt = elt->next; + unsigned elt_start_bit = (elt->indx) * BITMAP_ELEMENT_ALL_BITS; + unsigned elt_end_bit_plus1 = elt_start_bit + BITMAP_ELEMENT_ALL_BITS; + + + if (elt_start_bit >= start && elt_end_bit_plus1 <= end_bit_plus1) + /* Get rid of the entire elt and go to the next one. */ + bitmap_element_free (head, elt); + else + { + /* Going to have to knock out some bits in this elt. */ + unsigned int first_word_to_mod; + BITMAP_WORD first_mask; + unsigned int last_word_to_mod; + BITMAP_WORD last_mask; + unsigned int i; + bool clear = true; + + if (elt_start_bit <= start) + { + /* The first bit to turn off is somewhere inside this + elt. */ + first_word_to_mod = (start - elt_start_bit) / BITMAP_WORD_BITS; + + /* This mask should have 1s in all bits >= start position. */ + first_mask = + (((BITMAP_WORD) 1) << ((start % BITMAP_WORD_BITS))) - 1; + first_mask = ~first_mask; + } + else + { + /* The first bit to turn off is below this start of this elt. */ + first_word_to_mod = 0; + first_mask = 0; + first_mask = ~first_mask; + } + + if (elt_end_bit_plus1 <= end_bit_plus1) + { + /* The last bit to turn off is beyond this elt. */ + last_word_to_mod = BITMAP_ELEMENT_WORDS - 1; + last_mask = 0; + last_mask = ~last_mask; + } + else + { + /* The last bit to turn off is inside to this elt. */ + last_word_to_mod = + (end_bit_plus1 - elt_start_bit) / BITMAP_WORD_BITS; + + /* The last mask should have 1s below the end bit. */ + last_mask = + (((BITMAP_WORD) 1) << (((end_bit_plus1) % BITMAP_WORD_BITS))) - 1; + } + + + if (first_word_to_mod == last_word_to_mod) + { + BITMAP_WORD mask = first_mask & last_mask; + elt->bits[first_word_to_mod] &= ~mask; + } + else + { + elt->bits[first_word_to_mod] &= ~first_mask; + for (i = first_word_to_mod + 1; i < last_word_to_mod; i++) + elt->bits[i] = 0; + elt->bits[last_word_to_mod] &= ~last_mask; + } + for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) + if (elt->bits[i]) + { + clear = false; + break; + } + /* Check to see if there are any bits left. */ + if (clear) + bitmap_element_free (head, elt); + } + elt = next_elt; + } + + if (elt) + { + head->current = elt; + head->indx = head->current->indx; + } +} + +/* A = ~A & B. */ + +void +bitmap_compl_and_into (bitmap a, bitmap b) +{ + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *a_prev = NULL; + bitmap_element *next; + + gcc_assert (a != b); + + if (bitmap_empty_p (a)) + { + bitmap_copy (a, b); + return; + } + if (bitmap_empty_p (b)) + { + bitmap_clear (a); + return; + } + + while (a_elt || b_elt) + { + if (!b_elt || (a_elt && a_elt->indx < b_elt->indx)) + { + /* A is before B. Remove A */ + next = a_elt->next; + a_prev = a_elt->prev; + bitmap_element_free (a, a_elt); + a_elt = next; + } + else if (!a_elt || b_elt->indx < a_elt->indx) + { + /* B is before A. Copy B. */ + next = bitmap_elt_insert_after (a, a_prev, b_elt->indx); + memcpy (next->bits, b_elt->bits, sizeof (next->bits)); + a_prev = next; + b_elt = b_elt->next; + } + else + { + /* Matching elts, generate A = ~A & B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix]; + BITMAP_WORD r = b_elt->bits[ix] ^ cleared; + + a_elt->bits[ix] = r; + ior |= r; + } + next = a_elt->next; + if (!ior) + bitmap_element_free (a, a_elt); + else + a_prev = a_elt; + a_elt = next; + b_elt = b_elt->next; + } + } + gcc_assert (!a->current == !a->first); + gcc_assert (!a->current || a->indx == a->current->indx); + return; +} + +/* DST = A | B. Return true if DST changes. */ + +bool +bitmap_ior (bitmap dst, bitmap a, bitmap b) +{ + bitmap_element *dst_elt = dst->first; + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *dst_prev = NULL; + bool changed = false; + + gcc_assert (dst != a && dst != b); + + while (a_elt || b_elt) + { + if (a_elt && b_elt && a_elt->indx == b_elt->indx) + { + /* Matching elts, generate A | B. */ + unsigned ix; + + if (!changed && dst_elt && dst_elt->indx == a_elt->indx) + { + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; + + if (r != dst_elt->bits[ix]) + { + dst_elt->bits[ix] = r; + changed = true; + } + } + } + else + { + changed = true; + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); + else + dst_elt->indx = a_elt->indx; + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; + + dst_elt->bits[ix] = r; + } + } + a_elt = a_elt->next; + b_elt = b_elt->next; + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + else + { + /* Copy a single element. */ + bitmap_element *src; + + if (!b_elt || (a_elt && a_elt->indx < b_elt->indx)) + { + src = a_elt; + a_elt = a_elt->next; + } + else + { + src = b_elt; + b_elt = b_elt->next; + } + + if (!changed && dst_elt && dst_elt->indx == src->indx) + { + unsigned ix; + + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + if (src->bits[ix] != dst_elt->bits[ix]) + { + dst_elt->bits[ix] = src->bits[ix]; + changed = true; + } + } + else + { + changed = true; + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, src->indx); + else + dst_elt->indx = src->indx; + memcpy (dst_elt->bits, src->bits, sizeof (dst_elt->bits)); + } + + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + } + + if (dst_elt) + { + changed = true; + bitmap_elt_clear_from (dst, dst_elt); + } + gcc_assert (!dst->current == !dst->first); + if (dst->current) + dst->indx = dst->current->indx; + return changed; +} + +/* A |= B. Return true if A changes. */ + +bool +bitmap_ior_into (bitmap a, bitmap b) +{ + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *a_prev = NULL; + bool changed = false; + + if (a == b) + return false; + + while (b_elt) + { + if (!a_elt || b_elt->indx < a_elt->indx) + { + /* Copy b_elt. */ + bitmap_element *dst = bitmap_elt_insert_after (a, a_prev, b_elt->indx); + memcpy (dst->bits, b_elt->bits, sizeof (dst->bits)); + a_prev = dst; + b_elt = b_elt->next; + changed = true; + } + else if (a_elt->indx < b_elt->indx) + { + a_prev = a_elt; + a_elt = a_elt->next; + } + else + { + /* Matching elts, generate A |= B. */ + unsigned ix; + + if (changed) + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; + + a_elt->bits[ix] = r; + } + else + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; + + if (a_elt->bits[ix] != r) + { + changed = true; + a_elt->bits[ix] = r; + } + } + b_elt = b_elt->next; + a_prev = a_elt; + a_elt = a_elt->next; + } + } + gcc_assert (!a->current == !a->first); + if (a->current) + a->indx = a->current->indx; + return changed; +} + +/* DST = A ^ B */ + +void +bitmap_xor (bitmap dst, bitmap a, bitmap b) +{ + bitmap_element *dst_elt = dst->first; + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *dst_prev = NULL; + + gcc_assert (dst != a && dst != b); + if (a == b) + { + bitmap_clear (dst); + return; + } + + while (a_elt || b_elt) + { + if (a_elt && b_elt && a_elt->indx == b_elt->indx) + { + /* Matching elts, generate A ^ B. */ + unsigned ix; + BITMAP_WORD ior = 0; + + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); + else + dst_elt->indx = a_elt->indx; + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix]; + + ior |= r; + dst_elt->bits[ix] = r; + } + a_elt = a_elt->next; + b_elt = b_elt->next; + if (ior) + { + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + } + else + { + /* Copy a single element. */ + bitmap_element *src; + + if (!b_elt || (a_elt && a_elt->indx < b_elt->indx)) + { + src = a_elt; + a_elt = a_elt->next; + } + else + { + src = b_elt; + b_elt = b_elt->next; + } + + if (!dst_elt) + dst_elt = bitmap_elt_insert_after (dst, dst_prev, src->indx); + else + dst_elt->indx = src->indx; + memcpy (dst_elt->bits, src->bits, sizeof (dst_elt->bits)); + dst_prev = dst_elt; + dst_elt = dst_elt->next; + } + } + bitmap_elt_clear_from (dst, dst_elt); + gcc_assert (!dst->current == !dst->first); + if (dst->current) + dst->indx = dst->current->indx; +} + +/* A ^= B */ + +void +bitmap_xor_into (bitmap a, bitmap b) +{ + bitmap_element *a_elt = a->first; + bitmap_element *b_elt = b->first; + bitmap_element *a_prev = NULL; + + if (a == b) + { + bitmap_clear (a); + return; + } + + while (b_elt) + { + if (!a_elt || b_elt->indx < a_elt->indx) + { + /* Copy b_elt. */ + bitmap_element *dst = bitmap_elt_insert_after (a, a_prev, b_elt->indx); + memcpy (dst->bits, b_elt->bits, sizeof (dst->bits)); + a_prev = dst; + b_elt = b_elt->next; + } + else if (a_elt->indx < b_elt->indx) + { + a_prev = a_elt; + a_elt = a_elt->next; + } + else + { + /* Matching elts, generate A ^= B. */ + unsigned ix; + BITMAP_WORD ior = 0; + bitmap_element *next = a_elt->next; + + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + { + BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix]; + + ior |= r; + a_elt->bits[ix] = r; + } + b_elt = b_elt->next; + if (ior) + a_prev = a_elt; + else + bitmap_element_free (a, a_elt); + a_elt = next; + } + } + gcc_assert (!a->current == !a->first); + if (a->current) + a->indx = a->current->indx; +} + +/* Return true if two bitmaps are identical. + We do not bother with a check for pointer equality, as that never + occurs in practice. */ + +bool +bitmap_equal_p (bitmap a, bitmap b) +{ + bitmap_element *a_elt; + bitmap_element *b_elt; + unsigned ix; + + for (a_elt = a->first, b_elt = b->first; + a_elt && b_elt; + a_elt = a_elt->next, b_elt = b_elt->next) + { + if (a_elt->indx != b_elt->indx) + return false; + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + if (a_elt->bits[ix] != b_elt->bits[ix]) + return false; + } + return !a_elt && !b_elt; +} + +/* Return true if A AND B is not empty. */ + +bool +bitmap_intersect_p (bitmap a, bitmap b) +{ + bitmap_element *a_elt; + bitmap_element *b_elt; + unsigned ix; + + for (a_elt = a->first, b_elt = b->first; + a_elt && b_elt;) + { + if (a_elt->indx < b_elt->indx) + a_elt = a_elt->next; + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + if (a_elt->bits[ix] & b_elt->bits[ix]) + return true; + a_elt = a_elt->next; + b_elt = b_elt->next; + } + } + return false; +} + +/* Return true if A AND NOT B is not empty. */ + +bool +bitmap_intersect_compl_p (bitmap a, bitmap b) +{ + bitmap_element *a_elt; + bitmap_element *b_elt; + unsigned ix; + for (a_elt = a->first, b_elt = b->first; + a_elt && b_elt;) + { + if (a_elt->indx < b_elt->indx) + return true; + else if (b_elt->indx < a_elt->indx) + b_elt = b_elt->next; + else + { + for (ix = BITMAP_ELEMENT_WORDS; ix--;) + if (a_elt->bits[ix] & ~b_elt->bits[ix]) + return true; + a_elt = a_elt->next; + b_elt = b_elt->next; + } + } + return a_elt != NULL; +} + + +/* DST = A | (FROM1 & ~FROM2). Return true if DST changes. */ + +bool +bitmap_ior_and_compl (bitmap dst, bitmap a, bitmap from1, bitmap from2) { bitmap_head tmp; - int changed; + bool changed; - tmp.first = tmp.current = 0; - tmp.using_obstack = 0; - - bitmap_operation (&tmp, b, c, BITMAP_AND_COMPL); - changed = bitmap_operation (dst, &tmp, a, BITMAP_IOR); + bitmap_initialize (&tmp, &bitmap_default_obstack); + bitmap_and_compl (&tmp, from1, from2); + changed = bitmap_ior (dst, a, &tmp); bitmap_clear (&tmp); return changed; } - -/* Initialize a bitmap header. */ -bitmap -bitmap_initialize (bitmap head, int using_obstack) +/* A |= (FROM1 & ~FROM2). Return true if A changes. */ + +bool +bitmap_ior_and_compl_into (bitmap a, bitmap from1, bitmap from2) { - if (head == NULL && ! using_obstack) - head = ggc_alloc (sizeof (*head)); + bitmap_head tmp; + bool changed; - head->first = head->current = 0; - head->using_obstack = using_obstack; + bitmap_initialize (&tmp, &bitmap_default_obstack); + bitmap_and_compl (&tmp, from1, from2); + changed = bitmap_ior_into (a, &tmp); + bitmap_clear (&tmp); - return head; + return changed; } /* Debugging function to print out the contents of a bitmap. */ @@ -727,16 +1463,14 @@ debug_bitmap_file (FILE *file, bitmap head) { bitmap_element *ptr; - fprintf (file, "\nfirst = " HOST_PTR_PRINTF - " current = " HOST_PTR_PRINTF " indx = %u\n", + fprintf (file, "\nfirst = %p current = %p indx = %u\n", (void *) head->first, (void *) head->current, head->indx); for (ptr = head->first; ptr; ptr = ptr->next) { unsigned int i, j, col = 26; - fprintf (file, "\t" HOST_PTR_PRINTF " next = " HOST_PTR_PRINTF - " prev = " HOST_PTR_PRINTF " indx = %u\n\t\tbits = {", + fprintf (file, "\t%p next = %p prev = %p indx = %u\n\t\tbits = {", (void*) ptr, (void*) ptr->next, (void*) ptr->prev, ptr->indx); for (i = 0; i < BITMAP_ELEMENT_WORDS; i++) @@ -774,15 +1508,33 @@ void bitmap_print (FILE *file, bitmap head, const char *prefix, const char *suffix) { const char *comma = ""; - int i; + unsigned i; + bitmap_iterator bi; fputs (prefix, file); - EXECUTE_IF_SET_IN_BITMAP (head, 0, i, - { - fprintf (file, "%s%d", comma, i); - comma = ", "; - }); + EXECUTE_IF_SET_IN_BITMAP (head, 0, i, bi) + { + fprintf (file, "%s%d", comma, i); + comma = ", "; + } fputs (suffix, file); } +/* Compute hash of bitmap (for purposes of hashing). */ +hashval_t +bitmap_hash (bitmap head) +{ + bitmap_element *ptr; + BITMAP_WORD hash = 0; + int ix; + + for (ptr = head->first; ptr; ptr = ptr->next) + { + hash ^= ptr->indx; + for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) + hash ^= ptr->bits[ix]; + } + return (hashval_t)hash; +} + #include "gt-bitmap.h" diff --git a/contrib/gcc/bitmap.h b/contrib/gcc/bitmap.h index 4191542d3ac..3da58c5ba2b 100644 --- a/contrib/gcc/bitmap.h +++ b/contrib/gcc/bitmap.h @@ -1,5 +1,5 @@ /* Functions to support general ended bitmaps. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,37 +16,49 @@ for more details. 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. */ #ifndef GCC_BITMAP_H #define GCC_BITMAP_H +#include "hashtab.h" /* Fundamental storage type for bitmap. */ -/* typedef unsigned HOST_WIDE_INT BITMAP_WORD; */ -/* #define nBITMAP_WORD_BITS HOST_BITS_PER_WIDE_INT */ typedef unsigned long BITMAP_WORD; -#define nBITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG) -#define BITMAP_WORD_BITS (unsigned) nBITMAP_WORD_BITS +/* BITMAP_WORD_BITS needs to be unsigned, but cannot contain casts as + it is used in preprocessor directives -- hence the 1u. */ +#define BITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG * 1u) /* Number of words to use for each element in the linked list. */ #ifndef BITMAP_ELEMENT_WORDS -#define BITMAP_ELEMENT_WORDS ((128 + nBITMAP_WORD_BITS - 1) / nBITMAP_WORD_BITS) +#define BITMAP_ELEMENT_WORDS ((128 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) #endif -/* Number of bits in each actual element of a bitmap. We get slightly better - code for bit % BITMAP_ELEMENT_ALL_BITS and bit / BITMAP_ELEMENT_ALL_BITS if - bits is unsigned, assuming it is a power of 2. */ +/* Number of bits in each actual element of a bitmap. */ -#define BITMAP_ELEMENT_ALL_BITS \ - ((unsigned) (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS)) +#define BITMAP_ELEMENT_ALL_BITS (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS) + +/* Obstack for allocating bitmaps and elements from. */ +typedef struct bitmap_obstack GTY (()) +{ + struct bitmap_element_def *elements; + struct bitmap_head_def *heads; + struct obstack GTY ((skip)) obstack; +} bitmap_obstack; /* Bitmap set element. We use a linked list to hold only the bits that are set. This allows for use to grow the bitset dynamically without - having to realloc and copy a giant bit array. The `prev' field is - undefined for an element on the free list. */ + having to realloc and copy a giant bit array. + + The free list is implemented as a list of lists. There is one + outer list connected together by prev fields. Each element of that + outer is an inner list (that may consist only of the outer list + element) that are connected by the next fields. The prev pointer + is undefined for interior elements. This allows + bitmap_elt_clear_from to be implemented in unit time rather than + linear in the number of elements to be freed. */ typedef struct bitmap_element_def GTY(()) { @@ -61,22 +73,14 @@ typedef struct bitmap_head_def GTY(()) { bitmap_element *first; /* First element in linked list. */ bitmap_element *current; /* Last element looked at. */ unsigned int indx; /* Index of last element looked at. */ - int using_obstack; /* Are we using an obstack or ggc for - allocation? */ + bitmap_obstack *obstack; /* Obstack to allocate elements from. + If NULL, then use ggc_alloc. */ } bitmap_head; -typedef struct bitmap_head_def *bitmap; -/* Enumeration giving the various operations we support. */ -enum bitmap_bits { - BITMAP_AND, /* TO = FROM1 & FROM2 */ - BITMAP_AND_COMPL, /* TO = FROM1 & ~ FROM2 */ - BITMAP_IOR, /* TO = FROM1 | FROM2 */ - BITMAP_XOR, /* TO = FROM1 ^ FROM2 */ - BITMAP_IOR_COMPL /* TO = FROM1 | ~FROM2 */ -}; /* Global data */ extern bitmap_element bitmap_zero_bits; /* Zero bitmap element */ +extern bitmap_obstack bitmap_default_obstack; /* Default bitmap obstack */ /* Clear a bitmap by freeing up the linked list. */ extern void bitmap_clear (bitmap); @@ -85,14 +89,41 @@ extern void bitmap_clear (bitmap); extern void bitmap_copy (bitmap, bitmap); /* True if two bitmaps are identical. */ -extern int bitmap_equal_p (bitmap, bitmap); +extern bool bitmap_equal_p (bitmap, bitmap); -/* Perform an operation on two bitmaps, yielding a third. */ -extern int bitmap_operation (bitmap, bitmap, bitmap, enum bitmap_bits); +/* True if the bitmaps intersect (their AND is non-empty). */ +extern bool bitmap_intersect_p (bitmap, bitmap); -/* `or' into one bitmap the `and' of a second bitmap witih the complement - of a third. */ -extern void bitmap_ior_and_compl (bitmap, bitmap, bitmap); +/* True if the complement of the second intersects the first (their + AND_COMPL is non-empty). */ +extern bool bitmap_intersect_compl_p (bitmap, bitmap); + +/* True if MAP is an empty bitmap. */ +#define bitmap_empty_p(MAP) (!(MAP)->first) + +/* Count the number of bits set in the bitmap. */ +extern unsigned long bitmap_count_bits (bitmap); + +/* Boolean operations on bitmaps. The _into variants are two operand + versions that modify the first source operand. The other variants + are three operand versions that to not destroy the source bitmaps. + The operations supported are &, & ~, |, ^. */ +extern void bitmap_and (bitmap, bitmap, bitmap); +extern void bitmap_and_into (bitmap, bitmap); +extern void bitmap_and_compl (bitmap, bitmap, bitmap); +extern bool bitmap_and_compl_into (bitmap, bitmap); +#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A) +extern void bitmap_compl_and_into (bitmap, bitmap); +extern void bitmap_clear_range (bitmap, unsigned int, unsigned int); +extern bool bitmap_ior (bitmap, bitmap, bitmap); +extern bool bitmap_ior_into (bitmap, bitmap); +extern void bitmap_xor (bitmap, bitmap, bitmap); +extern void bitmap_xor_into (bitmap, bitmap); + +/* DST = A | (B & ~C). Return true if DST changes. */ +extern bool bitmap_ior_and_compl (bitmap DST, bitmap A, bitmap B, bitmap C); +/* A |= (B & ~C). Return true if A changes. */ +extern bool bitmap_ior_and_compl_into (bitmap DST, bitmap B, bitmap C); /* Clear a single register in a register set. */ extern void bitmap_clear_bit (bitmap, int); @@ -110,246 +141,428 @@ extern void debug_bitmap_file (FILE *, bitmap); /* Print a bitmap. */ extern void bitmap_print (FILE *, bitmap, const char *, const char *); -/* Initialize a bitmap header. If HEAD is NULL, a new header will be - allocated. USING_OBSTACK indicates how elements should be allocated. */ -extern bitmap bitmap_initialize (bitmap head, int using_obstack); +/* Initialize and release a bitmap obstack. */ +extern void bitmap_obstack_initialize (bitmap_obstack *); +extern void bitmap_obstack_release (bitmap_obstack *); -/* Release all memory used by the bitmap obstack. */ -extern void bitmap_release_memory (void); +/* Initialize a bitmap header. OBSTACK indicates the bitmap obstack + to allocate from, NULL for GC'd bitmap. */ + +static inline void +bitmap_initialize (bitmap head, bitmap_obstack *obstack) +{ + head->first = head->current = NULL; + head->obstack = obstack; +} + +/* Allocate and free bitmaps from obstack, malloc and gc'd memory. */ +extern bitmap bitmap_obstack_alloc (bitmap_obstack *obstack); +extern bitmap bitmap_gc_alloc (void); +extern void bitmap_obstack_free (bitmap); /* A few compatibility/functions macros for compatibility with sbitmaps */ #define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n") #define bitmap_zero(a) bitmap_clear (a) -#define bitmap_a_or_b(a,b,c) bitmap_operation (a, b, c, BITMAP_IOR) -#define bitmap_a_and_b(a,b,c) bitmap_operation (a, b, c, BITMAP_AND) -extern int bitmap_union_of_diff (bitmap, bitmap, bitmap, bitmap); -extern int bitmap_first_set_bit (bitmap); -extern int bitmap_last_set_bit (bitmap); +extern unsigned bitmap_first_set_bit (bitmap); -/* Allocate a bitmap with oballoc. */ -#define BITMAP_OBSTACK_ALLOC(OBSTACK) \ - bitmap_initialize (obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1) +/* Compute bitmap hash (for purposes of hashing etc.) */ +extern hashval_t bitmap_hash(bitmap); -/* Allocate a bitmap with ggc_alloc. */ -#define BITMAP_GGC_ALLOC() \ - bitmap_initialize (NULL, 0) +/* Allocate a bitmap from a bit obstack. */ +#define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK) -/* Allocate a bitmap with xmalloc. */ -#define BITMAP_XMALLOC() \ - bitmap_initialize (xmalloc (sizeof (bitmap_head)), 1) +/* Allocate a gc'd bitmap. */ +#define BITMAP_GGC_ALLOC() bitmap_gc_alloc () /* Do any cleanup needed on a bitmap when it is no longer used. */ #define BITMAP_FREE(BITMAP) \ -do { \ - if (BITMAP) \ - { \ - bitmap_clear (BITMAP); \ - (BITMAP) = 0; \ - } \ -} while (0) + ((void)(bitmap_obstack_free (BITMAP), (BITMAP) = NULL)) -/* Do any cleanup needed on an xmalloced bitmap when it is no longer used. */ -#define BITMAP_XFREE(BITMAP) \ -do { \ - if (BITMAP) \ - { \ - bitmap_clear (BITMAP); \ - free (BITMAP); \ - (BITMAP) = 0; \ - } \ -} while (0) +/* Iterator for bitmaps. */ -/* Do any one-time initializations needed for bitmaps. */ -#define BITMAP_INIT_ONCE() +typedef struct +{ + /* Pointer to the current bitmap element. */ + bitmap_element *elt1; -/* Loop over all bits in BITMAP, starting with MIN, setting BITNUM to the - bit number and executing CODE for all bits that are set. */ + /* Pointer to 2nd bitmap element when two are involved. */ + bitmap_element *elt2; -#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, CODE) \ -do { \ - bitmap_element *ptr_ = (BITMAP)->first; \ - unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \ - unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS; \ - unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; \ - \ - \ - /* Find the block the minimum bit is in. */ \ - while (ptr_ != 0 && ptr_->indx < indx_) \ - ptr_ = ptr_->next; \ - \ - if (ptr_ != 0 && ptr_->indx != indx_) \ - { \ - bit_num_ = 0; \ - word_num_ = 0; \ - } \ - \ - for (; ptr_ != 0; ptr_ = ptr_->next) \ - { \ - for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \ - { \ - BITMAP_WORD word_ = ptr_->bits[word_num_]; \ - \ - if (word_ != 0) \ - { \ - for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++) \ - { \ - BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_; \ - \ - if ((word_ & mask_) != 0) \ - { \ - word_ &= ~ mask_; \ - (BITNUM) = (ptr_->indx * BITMAP_ELEMENT_ALL_BITS \ - + word_num_ * BITMAP_WORD_BITS \ - + bit_num_); \ - CODE; \ - \ - if (word_ == 0) \ - break; \ - } \ - } \ - } \ - \ - bit_num_ = 0; \ - } \ - \ - word_num_ = 0; \ - } \ -} while (0) + /* Word within the current element. */ + unsigned word_no; -/* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting - BITNUM to the bit number and executing CODE for all bits that are set in - the first bitmap and not set in the second. */ + /* Contents of the actually processed word. When finding next bit + it is shifted right, so that the actual bit is always the least + significant bit of ACTUAL. */ + BITMAP_WORD bits; +} bitmap_iterator; -#define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE) \ -do { \ - bitmap_element *ptr1_ = (BITMAP1)->first; \ - bitmap_element *ptr2_ = (BITMAP2)->first; \ - unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \ - unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS; \ - unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; \ - \ - /* Find the block the minimum bit is in in the first bitmap. */ \ - while (ptr1_ != 0 && ptr1_->indx < indx_) \ - ptr1_ = ptr1_->next; \ - \ - if (ptr1_ != 0 && ptr1_->indx != indx_) \ - { \ - bit_num_ = 0; \ - word_num_ = 0; \ - } \ - \ - for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \ - { \ - /* Advance BITMAP2 to the equivalent link, using an all \ - zero element if an equivalent link doesn't exist. */ \ - bitmap_element *tmp2_; \ - \ - while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \ - ptr2_ = ptr2_->next; \ - \ - tmp2_ = ((ptr2_ != 0 && ptr2_->indx == ptr1_->indx) \ - ? ptr2_ : &bitmap_zero_bits); \ - \ - for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \ - { \ - BITMAP_WORD word_ = (ptr1_->bits[word_num_] \ - & ~ tmp2_->bits[word_num_]); \ - if (word_ != 0) \ - { \ - for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++) \ - { \ - BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_; \ - \ - if ((word_ & mask_) != 0) \ - { \ - word_ &= ~ mask_; \ - (BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \ - + word_num_ * BITMAP_WORD_BITS \ - + bit_num_); \ - \ - CODE; \ - if (word_ == 0) \ - break; \ - } \ - } \ - } \ - \ - bit_num_ = 0; \ - } \ - \ - word_num_ = 0; \ - } \ -} while (0) +/* Initialize a single bitmap iterator. START_BIT is the first bit to + iterate from. */ -/* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting - BITNUM to the bit number and executing CODE for all bits that are set in - the both bitmaps. */ +static inline void +bmp_iter_set_init (bitmap_iterator *bi, bitmap map, + unsigned start_bit, unsigned *bit_no) +{ + bi->elt1 = map->first; + bi->elt2 = NULL; -#define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE) \ -do { \ - bitmap_element *ptr1_ = (BITMAP1)->first; \ - bitmap_element *ptr2_ = (BITMAP2)->first; \ - unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \ - unsigned bit_num_ = (MIN) % BITMAP_WORD_BITS; \ - unsigned word_num_ = (MIN) / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; \ - \ - /* Find the block the minimum bit is in in the first bitmap. */ \ - while (ptr1_ != 0 && ptr1_->indx < indx_) \ - ptr1_ = ptr1_->next; \ - \ - if (ptr1_ != 0 && ptr1_->indx != indx_) \ - { \ - bit_num_ = 0; \ - word_num_ = 0; \ - } \ - \ - for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \ - { \ - /* Advance BITMAP2 to the equivalent link. */ \ - while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \ - ptr2_ = ptr2_->next; \ - \ - if (ptr2_ == 0) \ - { \ - /* If there are no more elements in BITMAP2, exit loop now. */ \ - ptr1_ = (bitmap_element *)0; \ - break; \ - } \ - else if (ptr2_->indx > ptr1_->indx) \ - { \ - bit_num_ = word_num_ = 0; \ - continue; \ - } \ - \ - for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \ - { \ - BITMAP_WORD word_ = (ptr1_->bits[word_num_] \ - & ptr2_->bits[word_num_]); \ - if (word_ != 0) \ - { \ - for (; bit_num_ < BITMAP_WORD_BITS; bit_num_++) \ - { \ - BITMAP_WORD mask_ = ((BITMAP_WORD) 1) << bit_num_; \ - \ - if ((word_ & mask_) != 0) \ - { \ - word_ &= ~ mask_; \ - (BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \ - + word_num_ * BITMAP_WORD_BITS \ - + bit_num_); \ - \ - CODE; \ - if (word_ == 0) \ - break; \ - } \ - } \ - } \ - \ - bit_num_ = 0; \ - } \ - \ - word_num_ = 0; \ - } \ -} while (0) + /* Advance elt1 until it is not before the block containing start_bit. */ + while (1) + { + if (!bi->elt1) + { + bi->elt1 = &bitmap_zero_bits; + break; + } + + if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS) + break; + bi->elt1 = bi->elt1->next; + } + + /* We might have gone past the start bit, so reinitialize it. */ + if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS) + start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + + /* Initialize for what is now start_bit. */ + bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; + bi->bits = bi->elt1->bits[bi->word_no]; + bi->bits >>= start_bit % BITMAP_WORD_BITS; + + /* If this word is zero, we must make sure we're not pointing at the + first bit, otherwise our incrementing to the next word boundary + will fail. It won't matter if this increment moves us into the + next word. */ + start_bit += !bi->bits; + + *bit_no = start_bit; +} + +/* Initialize an iterator to iterate over the intersection of two + bitmaps. START_BIT is the bit to commence from. */ + +static inline void +bmp_iter_and_init (bitmap_iterator *bi, bitmap map1, bitmap map2, + unsigned start_bit, unsigned *bit_no) +{ + bi->elt1 = map1->first; + bi->elt2 = map2->first; + + /* Advance elt1 until it is not before the block containing + start_bit. */ + while (1) + { + if (!bi->elt1) + { + bi->elt2 = NULL; + break; + } + + if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS) + break; + bi->elt1 = bi->elt1->next; + } + + /* Advance elt2 until it is not before elt1. */ + while (1) + { + if (!bi->elt2) + { + bi->elt1 = bi->elt2 = &bitmap_zero_bits; + break; + } + + if (bi->elt2->indx >= bi->elt1->indx) + break; + bi->elt2 = bi->elt2->next; + } + + /* If we're at the same index, then we have some intersecting bits. */ + if (bi->elt1->indx == bi->elt2->indx) + { + /* We might have advanced beyond the start_bit, so reinitialize + for that. */ + if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS) + start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + + bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; + bi->bits = bi->elt1->bits[bi->word_no] & bi->elt2->bits[bi->word_no]; + bi->bits >>= start_bit % BITMAP_WORD_BITS; + } + else + { + /* Otherwise we must immediately advance elt1, so initialize for + that. */ + bi->word_no = BITMAP_ELEMENT_WORDS - 1; + bi->bits = 0; + } + + /* If this word is zero, we must make sure we're not pointing at the + first bit, otherwise our incrementing to the next word boundary + will fail. It won't matter if this increment moves us into the + next word. */ + start_bit += !bi->bits; + + *bit_no = start_bit; +} + +/* Initialize an iterator to iterate over the bits in MAP1 & ~MAP2. + */ + +static inline void +bmp_iter_and_compl_init (bitmap_iterator *bi, bitmap map1, bitmap map2, + unsigned start_bit, unsigned *bit_no) +{ + bi->elt1 = map1->first; + bi->elt2 = map2->first; + + /* Advance elt1 until it is not before the block containing start_bit. */ + while (1) + { + if (!bi->elt1) + { + bi->elt1 = &bitmap_zero_bits; + break; + } + + if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS) + break; + bi->elt1 = bi->elt1->next; + } + + /* Advance elt2 until it is not before elt1. */ + while (bi->elt2 && bi->elt2->indx < bi->elt1->indx) + bi->elt2 = bi->elt2->next; + + /* We might have advanced beyond the start_bit, so reinitialize for + that. */ + if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS) + start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + + bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS; + bi->bits = bi->elt1->bits[bi->word_no]; + if (bi->elt2 && bi->elt1->indx == bi->elt2->indx) + bi->bits &= ~bi->elt2->bits[bi->word_no]; + bi->bits >>= start_bit % BITMAP_WORD_BITS; + + /* If this word is zero, we must make sure we're not pointing at the + first bit, otherwise our incrementing to the next word boundary + will fail. It won't matter if this increment moves us into the + next word. */ + start_bit += !bi->bits; + + *bit_no = start_bit; +} + +/* Advance to the next bit in BI. We don't advance to the next + nonzero bit yet. */ + +static inline void +bmp_iter_next (bitmap_iterator *bi, unsigned *bit_no) +{ + bi->bits >>= 1; + *bit_no += 1; +} + +/* Advance to the next nonzero bit of a single bitmap, we will have + already advanced past the just iterated bit. Return true if there + is a bit to iterate. */ + +static inline bool +bmp_iter_set (bitmap_iterator *bi, unsigned *bit_no) +{ + /* If our current word is nonzero, it contains the bit we want. */ + if (bi->bits) + { + next_bit: + while (!(bi->bits & 1)) + { + bi->bits >>= 1; + *bit_no += 1; + } + return true; + } + + /* Round up to the word boundary. We might have just iterated past + the end of the last word, hence the -1. It is not possible for + bit_no to point at the beginning of the now last word. */ + *bit_no = ((*bit_no + BITMAP_WORD_BITS - 1) + / BITMAP_WORD_BITS * BITMAP_WORD_BITS); + bi->word_no++; + + while (1) + { + /* Find the next nonzero word in this elt. */ + while (bi->word_no != BITMAP_ELEMENT_WORDS) + { + bi->bits = bi->elt1->bits[bi->word_no]; + if (bi->bits) + goto next_bit; + *bit_no += BITMAP_WORD_BITS; + bi->word_no++; + } + + /* Advance to the next element. */ + bi->elt1 = bi->elt1->next; + if (!bi->elt1) + return false; + *bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + bi->word_no = 0; + } +} + +/* Advance to the next nonzero bit of an intersecting pair of + bitmaps. We will have already advanced past the just iterated bit. + Return true if there is a bit to iterate. */ + +static inline bool +bmp_iter_and (bitmap_iterator *bi, unsigned *bit_no) +{ + /* If our current word is nonzero, it contains the bit we want. */ + if (bi->bits) + { + next_bit: + while (!(bi->bits & 1)) + { + bi->bits >>= 1; + *bit_no += 1; + } + return true; + } + + /* Round up to the word boundary. We might have just iterated past + the end of the last word, hence the -1. It is not possible for + bit_no to point at the beginning of the now last word. */ + *bit_no = ((*bit_no + BITMAP_WORD_BITS - 1) + / BITMAP_WORD_BITS * BITMAP_WORD_BITS); + bi->word_no++; + + while (1) + { + /* Find the next nonzero word in this elt. */ + while (bi->word_no != BITMAP_ELEMENT_WORDS) + { + bi->bits = bi->elt1->bits[bi->word_no] & bi->elt2->bits[bi->word_no]; + if (bi->bits) + goto next_bit; + *bit_no += BITMAP_WORD_BITS; + bi->word_no++; + } + + /* Advance to the next identical element. */ + do + { + /* Advance elt1 while it is less than elt2. We always want + to advance one elt. */ + do + { + bi->elt1 = bi->elt1->next; + if (!bi->elt1) + return false; + } + while (bi->elt1->indx < bi->elt2->indx); + + /* Advance elt2 to be no less than elt1. This might not + advance. */ + while (bi->elt2->indx < bi->elt1->indx) + { + bi->elt2 = bi->elt2->next; + if (!bi->elt2) + return false; + } + } + while (bi->elt1->indx != bi->elt2->indx); + + *bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + bi->word_no = 0; + } +} + +/* Advance to the next nonzero bit in the intersection of + complemented bitmaps. We will have already advanced past the just + iterated bit. */ + +static inline bool +bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no) +{ + /* If our current word is nonzero, it contains the bit we want. */ + if (bi->bits) + { + next_bit: + while (!(bi->bits & 1)) + { + bi->bits >>= 1; + *bit_no += 1; + } + return true; + } + + /* Round up to the word boundary. We might have just iterated past + the end of the last word, hence the -1. It is not possible for + bit_no to point at the beginning of the now last word. */ + *bit_no = ((*bit_no + BITMAP_WORD_BITS - 1) + / BITMAP_WORD_BITS * BITMAP_WORD_BITS); + bi->word_no++; + + while (1) + { + /* Find the next nonzero word in this elt. */ + while (bi->word_no != BITMAP_ELEMENT_WORDS) + { + bi->bits = bi->elt1->bits[bi->word_no]; + if (bi->elt2 && bi->elt2->indx == bi->elt1->indx) + bi->bits &= ~bi->elt2->bits[bi->word_no]; + if (bi->bits) + goto next_bit; + *bit_no += BITMAP_WORD_BITS; + bi->word_no++; + } + + /* Advance to the next element of elt1. */ + bi->elt1 = bi->elt1->next; + if (!bi->elt1) + return false; + + /* Advance elt2 until it is no less than elt1. */ + while (bi->elt2 && bi->elt2->indx < bi->elt1->indx) + bi->elt2 = bi->elt2->next; + + *bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS; + bi->word_no = 0; + } +} + +/* Loop over all bits set in BITMAP, starting with MIN and setting + BITNUM to the bit number. ITER is a bitmap iterator. BITNUM + should be treated as a read-only variable as it contains loop + state. */ + +#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \ + for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \ + bmp_iter_set (&(ITER), &(BITNUM)); \ + bmp_iter_next (&(ITER), &(BITNUM))) + +/* Loop over all the bits set in BITMAP1 & BITMAP2, starting with MIN + and setting BITNUM to the bit number. ITER is a bitmap iterator. + BITNUM should be treated as a read-only variable as it contains + loop state. */ + +#define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \ + for (bmp_iter_and_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \ + &(BITNUM)); \ + bmp_iter_and (&(ITER), &(BITNUM)); \ + bmp_iter_next (&(ITER), &(BITNUM))) + +/* Loop over all the bits set in BITMAP1 & ~BITMAP2, starting with MIN + and setting BITNUM to the bit number. ITER is a bitmap iterator. + BITNUM should be treated as a read-only variable as it contains + loop state. */ + +#define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \ + for (bmp_iter_and_compl_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \ + &(BITNUM)); \ + bmp_iter_and_compl (&(ITER), &(BITNUM)); \ + bmp_iter_next (&(ITER), &(BITNUM))) #endif /* GCC_BITMAP_H */ diff --git a/contrib/gcc/bt-load.c b/contrib/gcc/bt-load.c index 2a68cd76bdb..bd1761616c9 100644 --- a/contrib/gcc/bt-load.c +++ b/contrib/gcc/bt-load.c @@ -1,5 +1,6 @@ /* Perform branch target register load optimizations. - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,20 +16,16 @@ for more details. 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. */ #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" -#include "bitmap.h" -#include "sbitmap.h" #include "rtl.h" #include "hard-reg-set.h" -#include "basic-block.h" #include "regs.h" -#include "obstack.h" #include "fibheap.h" #include "output.h" #include "target.h" @@ -36,7 +33,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "flags.h" #include "insn-attr.h" #include "function.h" +#include "except.h" #include "tm_p.h" +#include "toplev.h" +#include "tree-pass.h" /* Target register optimizations - these are performed after reload. */ @@ -101,6 +101,10 @@ typedef struct btr_def_s as appropriate. */ char other_btr_uses_before_def; char other_btr_uses_after_use; + /* We set own_end when we have moved a definition into a dominator. + Thus, when a later combination removes this definition again, we know + to clear out trs_live_at_end again. */ + char own_end; bitmap live_range; } *btr_def; @@ -126,9 +130,9 @@ static void link_btr_uses (btr_def *, btr_user *, sbitmap *, sbitmap *, int); static void build_btr_def_use_webs (fibheap_t); static int block_at_edge_of_live_range_p (int, btr_def); static void clear_btr_from_live_range (btr_def def); -static void add_btr_to_live_range (btr_def); +static void add_btr_to_live_range (btr_def, int); static void augment_live_range (bitmap, HARD_REG_SET *, basic_block, - basic_block); + basic_block, int); static int choose_btr (HARD_REG_SET); static void combine_btr_defs (btr_def, HARD_REG_SET *); static void btr_def_live_range (btr_def, HARD_REG_SET *); @@ -159,6 +163,10 @@ static struct obstack migrate_btrl_obstack; live in that block. */ static HARD_REG_SET *btrs_live; +/* Array indexed by basic block number, giving the set of registers live at + the end of that block, including any uses by a final jump insn, if any. */ +static HARD_REG_SET *btrs_live_at_end; + /* Set of all target registers that we are willing to allocate. */ static HARD_REG_SET all_btrs; @@ -168,8 +176,7 @@ static int first_btr, last_btr; -/* Return an estimate of the frequency of execution of block bb. - If we have a profiling count available, we could use it here. */ +/* Return an estimate of the frequency of execution of block bb. */ static int basic_block_freq (basic_block bb) { @@ -191,10 +198,10 @@ find_btr_reference (rtx *px, void *preg) if (px == preg) return -1; x = *px; - if (GET_CODE (x) != REG) + if (!REG_P (x)) return 0; regno = REGNO (x); - for (i = HARD_REGNO_NREGS (regno, GET_MODE (x)) - 1; i >= 0; i--) + for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--) if (TEST_HARD_REG_BIT (all_btrs, regno+i)) { btr_reference_found = px; @@ -221,7 +228,7 @@ insn_sets_btr_p (rtx insn, int check_const, int *regno) { rtx set; - if (GET_CODE (insn) == INSN + if (NONJUMP_INSN_P (insn) && (set = single_set (insn))) { rtx dest = SET_DEST (set); @@ -230,11 +237,11 @@ insn_sets_btr_p (rtx insn, int check_const, int *regno) if (GET_CODE (dest) == SUBREG) dest = XEXP (dest, 0); - if (GET_CODE (dest) == REG + if (REG_P (dest) && TEST_HARD_REG_BIT (all_btrs, REGNO (dest))) { - if (btr_referenced_p (src, NULL)) - abort(); + gcc_assert (!btr_referenced_p (src, NULL)); + if (!check_const || CONSTANT_P (src)) { if (regno) @@ -315,8 +322,8 @@ add_btr_def (fibheap_t all_btr_defs, basic_block bb, int insn_luid, rtx insn, fibheap_insert (all_btr_defs, -this->cost, this); - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Found target reg definition: sets %u { bb %d, insn %d }%s priority %d\n", dest_reg, bb->index, INSN_UID (insn), (this->group ? "" : ":not const"), this->cost); @@ -359,13 +366,13 @@ new_btr_user (basic_block bb, int insn_luid, rtx insn) user->n_reaching_defs = 0; user->first_reaching_def = -1; - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, "Uses target reg: { bb %d, insn %d }", + fprintf (dump_file, "Uses target reg: { bb %d, insn %d }", bb->index, INSN_UID (insn)); if (user->use) - fprintf (rtl_dump_file, ": unambiguous use of reg %d\n", + fprintf (dump_file, ": unambiguous use of reg %d\n", REGNO (user->use)); } @@ -379,16 +386,16 @@ dump_hard_reg_set (HARD_REG_SET s) int reg; for (reg = 0; reg < FIRST_PSEUDO_REGISTER; reg++) if (TEST_HARD_REG_BIT (s, reg)) - fprintf (rtl_dump_file, " %d", reg); + fprintf (dump_file, " %d", reg); } /* Write the set of target regs live in block BB to the dump file. */ static void dump_btrs_live (int bb) { - fprintf (rtl_dump_file, "BB%d live:", bb); + fprintf (dump_file, "BB%d live:", bb); dump_hard_reg_set (btrs_live[bb]); - fprintf (rtl_dump_file, "\n"); + fprintf (dump_file, "\n"); } /* REGNO is the number of a branch target register that is being used or @@ -423,10 +430,10 @@ note_btr_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data) defs_uses_info *info = data; int regno, end_regno; - if (GET_CODE (dest) != REG) + if (!REG_P (dest)) return; regno = REGNO (dest); - end_regno = regno + HARD_REGNO_NREGS (regno, GET_MODE (dest)); + end_regno = regno + hard_regno_nregs[regno][GET_MODE (dest)]; for (; regno < end_regno; regno++) if (TEST_HARD_REG_BIT (all_btrs, regno)) { @@ -455,13 +462,14 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, defs_uses_info info; sbitmap_vector_zero (bb_gen, n_basic_blocks); - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) { basic_block bb = BASIC_BLOCK (i); int reg; btr_def defs_this_bb = NULL; rtx insn; rtx last; + int can_throw = 0; info.users_this_bb = NULL; info.bb_gen = bb_gen[i]; @@ -471,7 +479,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, CLEAR_HARD_REG_SET (info.btrs_written_in_block); for (reg = first_btr; reg <= last_btr; reg++) if (TEST_HARD_REG_BIT (all_btrs, reg) - && REGNO_REG_SET_P (bb->global_live_at_start, reg)) + && REGNO_REG_SET_P (bb->il.rtl->global_live_at_start, reg)) SET_HARD_REG_BIT (info.btrs_live_in_block, reg); for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); @@ -501,6 +509,22 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, SET_BIT (btr_defset[regno - first_btr], insn_uid); note_other_use_this_block (regno, info.users_this_bb); } + /* Check for the blockage emitted by expand_nl_goto_receiver. */ + else if (current_function_has_nonlocal_label + && GET_CODE (PATTERN (insn)) == ASM_INPUT) + { + btr_user user; + + /* Do the equivalent of calling note_other_use_this_block + for every target register. */ + for (user = info.users_this_bb; user != NULL; + user = user->next) + if (user->use) + user->other_use_this_block = 1; + IOR_HARD_REG_SET (info.btrs_written_in_block, all_btrs); + IOR_HARD_REG_SET (info.btrs_live_in_block, all_btrs); + sbitmap_zero (info.bb_gen); + } else { if (btr_referenced_p (PATTERN (insn), NULL)) @@ -528,7 +552,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, user->next = info.users_this_bb; info.users_this_bb = user; } - if (GET_CODE (insn) == CALL_INSN) + if (CALL_P (insn)) { HARD_REG_SET *clobbered = &call_used_reg_set; HARD_REG_SET call_saved; @@ -544,7 +568,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, call_used_reg_set); clobbered = &call_saved; } - + for (regno = first_btr; regno <= last_btr; regno++) if (TEST_HARD_REG_BIT (*clobbered, regno)) note_btr_set (regno_reg_rtx[regno], NULL_RTX, &info); @@ -555,7 +579,36 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, COPY_HARD_REG_SET (btrs_live[i], info.btrs_live_in_block); COPY_HARD_REG_SET (btrs_written[i], info.btrs_written_in_block); - if (rtl_dump_file) + + REG_SET_TO_HARD_REG_SET (btrs_live_at_end[i], bb->il.rtl->global_live_at_end); + /* If this block ends in a jump insn, add any uses or even clobbers + of branch target registers that it might have. */ + for (insn = BB_END (bb); insn != BB_HEAD (bb) && ! INSN_P (insn); ) + insn = PREV_INSN (insn); + /* ??? for the fall-through edge, it would make sense to insert the + btr set on the edge, but that would require to split the block + early on so that we can distinguish between dominance from the fall + through edge - which can use the call-clobbered registers - from + dominance by the throw edge. */ + if (can_throw_internal (insn)) + { + HARD_REG_SET tmp; + + COPY_HARD_REG_SET (tmp, call_used_reg_set); + AND_HARD_REG_SET (tmp, all_btrs); + IOR_HARD_REG_SET (btrs_live_at_end[i], tmp); + can_throw = 1; + } + if (can_throw || JUMP_P (insn)) + { + int regno; + + for (regno = first_btr; regno <= last_btr; regno++) + if (refers_to_regno_p (regno, regno+1, insn, NULL)) + SET_HARD_REG_BIT (btrs_live_at_end[i], regno); + } + + if (dump_file) dump_btrs_live(i); } } @@ -570,7 +623,7 @@ compute_kill (sbitmap *bb_kill, sbitmap *btr_defset, /* For each basic block, form the set BB_KILL - the set of definitions that the block kills. */ sbitmap_vector_zero (bb_kill, n_basic_blocks); - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) { for (regno = first_btr; regno <= last_btr; regno++) if (TEST_HARD_REG_BIT (all_btrs, regno) @@ -593,14 +646,14 @@ compute_out (sbitmap *bb_out, sbitmap *bb_gen, sbitmap *bb_kill, int max_uid) int changed; sbitmap bb_in = sbitmap_alloc (max_uid); - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) sbitmap_copy (bb_out[i], bb_gen[i]); changed = 1; while (changed) { changed = 0; - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) { sbitmap_union_of_preds (bb_in, bb_out, i); changed |= sbitmap_union_of_diff_cg (bb_out[i], bb_gen[i], @@ -619,7 +672,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, /* Link uses to the uses lists of all of their reaching defs. Count up the number of reaching defs of each use. */ - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) { basic_block bb = BASIC_BLOCK (i); rtx insn; @@ -649,7 +702,8 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, { /* Find all the reaching defs for this use. */ sbitmap reaching_defs_of_reg = sbitmap_alloc(max_uid); - int uid; + unsigned int uid = 0; + sbitmap_iterator sbi; if (user->use) sbitmap_a_and_b ( @@ -670,14 +724,14 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, reaching_defs, btr_defset[reg - first_btr]); } - EXECUTE_IF_SET_IN_SBITMAP (reaching_defs_of_reg, 0, uid, + EXECUTE_IF_SET_IN_SBITMAP (reaching_defs_of_reg, 0, uid, sbi) { btr_def def = def_array[uid]; /* We now know that def reaches user. */ - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Def in insn %d reaches use in insn %d\n", uid, insn_uid); @@ -691,8 +745,8 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, def->has_ambiguous_use = 1; def_array[user->first_reaching_def] ->has_ambiguous_use = 1; - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "(use %d has multiple reaching defs)\n", insn_uid); } @@ -702,11 +756,11 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out, def->other_btr_uses_after_use = 1; user->next = def->uses; def->uses = user; - }); + } sbitmap_free (reaching_defs_of_reg); } - if (GET_CODE (insn) == CALL_INSN) + if (CALL_P (insn)) { int regno; @@ -726,12 +780,12 @@ static void build_btr_def_use_webs (fibheap_t all_btr_defs) { const int max_uid = get_max_uid (); - btr_def *def_array = xcalloc (max_uid, sizeof (btr_def)); - btr_user *use_array = xcalloc (max_uid, sizeof (btr_user)); + btr_def *def_array = XCNEWVEC (btr_def, max_uid); + btr_user *use_array = XCNEWVEC (btr_user, max_uid); sbitmap *btr_defset = sbitmap_vector_alloc ( (last_btr - first_btr) + 1, max_uid); sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid); - HARD_REG_SET *btrs_written = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET)); + HARD_REG_SET *btrs_written = XCNEWVEC (HARD_REG_SET, n_basic_blocks); sbitmap *bb_kill; sbitmap *bb_out; @@ -787,37 +841,49 @@ block_at_edge_of_live_range_p (int bb, btr_def def) static void clear_btr_from_live_range (btr_def def) { - int bb; + unsigned bb; + bitmap_iterator bi; - EXECUTE_IF_SET_IN_BITMAP - (def->live_range, 0, bb, - { - if ((!def->other_btr_uses_before_def - && !def->other_btr_uses_after_use) - || !block_at_edge_of_live_range_p (bb, def)) - { - CLEAR_HARD_REG_BIT (btrs_live[bb], def->btr); - if (rtl_dump_file) - dump_btrs_live (bb); - } - }); + EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi) + { + if ((!def->other_btr_uses_before_def + && !def->other_btr_uses_after_use) + || !block_at_edge_of_live_range_p (bb, def)) + { + CLEAR_HARD_REG_BIT (btrs_live[bb], def->btr); + CLEAR_HARD_REG_BIT (btrs_live_at_end[bb], def->btr); + if (dump_file) + dump_btrs_live (bb); + } + } + if (def->own_end) + CLEAR_HARD_REG_BIT (btrs_live_at_end[def->bb->index], def->btr); } /* We are adding the def/use web DEF. Add the target register used in this web to the live set of all of the basic blocks that contain - the live range of the web. */ + the live range of the web. + If OWN_END is set, also show that the register is live from our + definitions at the end of the basic block where it is defined. */ static void -add_btr_to_live_range (btr_def def) +add_btr_to_live_range (btr_def def, int own_end) { - int bb; - EXECUTE_IF_SET_IN_BITMAP - (def->live_range, 0, bb, - { - SET_HARD_REG_BIT (btrs_live[bb], def->btr); - if (rtl_dump_file) - dump_btrs_live (bb); - }); + unsigned bb; + bitmap_iterator bi; + + EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi) + { + SET_HARD_REG_BIT (btrs_live[bb], def->btr); + SET_HARD_REG_BIT (btrs_live_at_end[bb], def->btr); + if (dump_file) + dump_btrs_live (bb); + } + if (own_end) + { + SET_HARD_REG_BIT (btrs_live_at_end[def->bb->index], def->btr); + def->own_end = 1; + } } /* Update a live range to contain the basic block NEW_BLOCK, and all @@ -826,39 +892,59 @@ add_btr_to_live_range (btr_def def) all other blocks in the existing live range. Also add to the set BTRS_LIVE_IN_RANGE all target registers that are live in the blocks that we add to the live range. + If FULL_RANGE is set, include the full live range of NEW_BB; + otherwise, if NEW_BB dominates HEAD_BB, only add registers that + are life at the end of NEW_BB for NEW_BB itself. It is a precondition that either NEW_BLOCK dominates HEAD,or HEAD dom NEW_BLOCK. This is used to speed up the implementation of this function. */ static void augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range, - basic_block head_bb, basic_block new_bb) + basic_block head_bb, basic_block new_bb, int full_range) { basic_block *worklist, *tos; - tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1)); + tos = worklist = XNEWVEC (basic_block, n_basic_blocks + 1); if (dominated_by_p (CDI_DOMINATORS, new_bb, head_bb)) - *tos++ = new_bb; - else if (dominated_by_p (CDI_DOMINATORS, head_bb, new_bb)) { - edge e; - int new_block = new_bb->index; - - bitmap_set_bit (live_range, new_block); - IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[new_block]); - if (rtl_dump_file) + if (new_bb == head_bb) { - fprintf (rtl_dump_file, - "Adding block %d to live range\n", new_block); - fprintf (rtl_dump_file,"Now live btrs are "); - dump_hard_reg_set (*btrs_live_in_range); - fprintf (rtl_dump_file, "\n"); + if (full_range) + IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[new_bb->index]); + free (tos); + return; } - for (e = head_bb->pred; e; e = e->pred_next) - *tos++ = e->src; + *tos++ = new_bb; } else - abort(); + { + edge e; + edge_iterator ei; + int new_block = new_bb->index; + + gcc_assert (dominated_by_p (CDI_DOMINATORS, head_bb, new_bb)); + + IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[head_bb->index]); + bitmap_set_bit (live_range, new_block); + /* A previous btr migration could have caused a register to be + live just at the end of new_block which we need in full, so + use trs_live_at_end even if full_range is set. */ + IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live_at_end[new_block]); + if (full_range) + IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[new_block]); + if (dump_file) + { + fprintf (dump_file, + "Adding end of block %d and rest of %d to live range\n", + new_block, head_bb->index); + fprintf (dump_file,"Now live btrs are "); + dump_hard_reg_set (*btrs_live_in_range); + fprintf (dump_file, "\n"); + } + FOR_EACH_EDGE (e, ei, head_bb->preds) + *tos++ = e->src; + } while (tos != worklist) { @@ -866,20 +952,25 @@ augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range, if (!bitmap_bit_p (live_range, bb->index)) { edge e; + edge_iterator ei; bitmap_set_bit (live_range, bb->index); IOR_HARD_REG_SET (*btrs_live_in_range, btrs_live[bb->index]); - if (rtl_dump_file) + /* A previous btr migration could have caused a register to be + live just at the end of a block which we need in full. */ + IOR_HARD_REG_SET (*btrs_live_in_range, + btrs_live_at_end[bb->index]); + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Adding block %d to live range\n", bb->index); - fprintf (rtl_dump_file,"Now live btrs are "); + fprintf (dump_file,"Now live btrs are "); dump_hard_reg_set (*btrs_live_in_range); - fprintf (rtl_dump_file, "\n"); + fprintf (dump_file, "\n"); } - for (e = bb->pred; e != NULL; e = e->pred_next) + FOR_EACH_EDGE (e, ei, bb->preds) { basic_block pred = e->src; if (!bitmap_bit_p (live_range, pred->index)) @@ -926,14 +1017,19 @@ btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range) { btr_user user; - def->live_range = BITMAP_XMALLOC (); + def->live_range = BITMAP_ALLOC (NULL); bitmap_set_bit (def->live_range, def->bb->index); - COPY_HARD_REG_SET (*btrs_live_in_range, btrs_live[def->bb->index]); + COPY_HARD_REG_SET (*btrs_live_in_range, + (flag_btr_bb_exclusive + ? btrs_live : btrs_live_at_end)[def->bb->index]); for (user = def->uses; user != NULL; user = user->next) augment_live_range (def->live_range, btrs_live_in_range, - def->bb, user->bb); + def->bb, user->bb, + (flag_btr_bb_exclusive + || user->insn != BB_END (def->bb) + || !JUMP_P (user->insn))); } else { @@ -941,15 +1037,17 @@ btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range) the set of target registers live over it, because migration of other PT instructions may have affected it. */ - int bb; + unsigned bb; + unsigned def_bb = flag_btr_bb_exclusive ? -1 : def->bb->index; + bitmap_iterator bi; CLEAR_HARD_REG_SET (*btrs_live_in_range); - EXECUTE_IF_SET_IN_BITMAP - (def->live_range, 0, bb, - { - IOR_HARD_REG_SET (*btrs_live_in_range, - btrs_live[bb]); - }); + EXECUTE_IF_SET_IN_BITMAP (def->live_range, 0, bb, bi) + { + IOR_HARD_REG_SET (*btrs_live_in_range, + (def_bb == bb + ? btrs_live_at_end : btrs_live) [bb]); + } } if (!def->other_btr_uses_before_def && !def->other_btr_uses_after_use) @@ -979,7 +1077,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) target registers live over the merged range. */ int btr; HARD_REG_SET combined_btrs_live; - bitmap combined_live_range = BITMAP_XMALLOC (); + bitmap combined_live_range = BITMAP_ALLOC (NULL); btr_user user; if (other_def->live_range == NULL) @@ -992,14 +1090,17 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) for (user = other_def->uses; user != NULL; user = user->next) augment_live_range (combined_live_range, &combined_btrs_live, - def->bb, user->bb); + def->bb, user->bb, + (flag_btr_bb_exclusive + || user->insn != BB_END (def->bb) + || !JUMP_P (user->insn))); btr = choose_btr (combined_btrs_live); if (btr != -1) { /* We can combine them. */ - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Combining def in insn %d with def in insn %d\n", INSN_UID (other_def->insn), INSN_UID (def->insn)); @@ -1026,7 +1127,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) clear_btr_from_live_range (other_def); other_def->uses = NULL; bitmap_copy (def->live_range, combined_live_range); - if (other_def->other_btr_uses_after_use) + if (other_def->btr == btr && other_def->other_btr_uses_after_use) def->other_btr_uses_after_use = 1; COPY_HARD_REG_SET (*btrs_live_in_range, combined_btrs_live); @@ -1034,7 +1135,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) delete_insn (other_def->insn); } - BITMAP_XFREE (combined_live_range); + BITMAP_FREE (combined_live_range); } } } @@ -1064,8 +1165,8 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, btr_user user; rtx set; - if (rtl_dump_file) - fprintf(rtl_dump_file, "migrating to basic block %d, using reg %d\n", + if (dump_file) + fprintf(dump_file, "migrating to basic block %d, using reg %d\n", new_def_bb->index, btr); clear_btr_from_live_range (def); @@ -1073,22 +1174,33 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, def->bb = new_def_bb; def->luid = 0; def->cost = basic_block_freq (new_def_bb); - def->other_btr_uses_before_def = 0; bitmap_copy (def->live_range, live_range); combine_btr_defs (def, btrs_live_in_range); btr = def->btr; - add_btr_to_live_range (def); - if (GET_CODE (insp) == CODE_LABEL) + def->other_btr_uses_before_def + = TEST_HARD_REG_BIT (btrs_live[b->index], btr) ? 1 : 0; + add_btr_to_live_range (def, 1); + if (LABEL_P (insp)) insp = NEXT_INSN (insp); /* N.B.: insp is expected to be NOTE_INSN_BASIC_BLOCK now. Some optimizations can result in insp being both first and last insn of its basic block. */ /* ?? some assertions to check that insp is sensible? */ + if (def->other_btr_uses_before_def) + { + insp = BB_END (b); + for (insp = BB_END (b); ! INSN_P (insp); insp = PREV_INSN (insp)) + gcc_assert (insp != BB_HEAD (b)); + + if (JUMP_P (insp) || can_throw_internal (insp)) + insp = PREV_INSN (insp); + } + set = single_set (old_insn); src = SET_SRC (set); btr_mode = GET_MODE (SET_DEST (set)); - btr_rtx = gen_rtx (REG, btr_mode, btr); + btr_rtx = gen_rtx_REG (btr_mode, btr); new_insn = gen_move_insn (btr_rtx, src); @@ -1097,8 +1209,8 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, regs_ever_live[btr] = 1; - if (rtl_dump_file) - fprintf (rtl_dump_file, "New pt is insn %d, inserted after insn %d\n", + if (dump_file) + fprintf (dump_file, "New pt is insn %d, inserted after insn %d\n", INSN_UID (def->insn), INSN_UID (insp)); /* Delete the old target register initialization. */ @@ -1117,7 +1229,7 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range, || GET_MODE (user->use) == VOIDmode) replacement_rtx = btr_rtx; else - replacement_rtx = gen_rtx (REG, GET_MODE (user->use), btr); + replacement_rtx = gen_rtx_REG (GET_MODE (user->use), btr); replace_rtx (user->insn, user->use, replacement_rtx); user->use = replacement_rtx; } @@ -1170,18 +1282,18 @@ migrate_btr_def (btr_def def, int min_cost) int give_up = 0; int def_moved = 0; btr_user user; - int def_latency = 1; + int def_latency; - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Attempting to migrate pt from insn %d (cost = %d, min_cost = %d) ... ", INSN_UID (def->insn), def->cost, min_cost); if (!def->group || def->has_ambiguous_use) /* These defs are not migratable. */ { - if (rtl_dump_file) - fprintf (rtl_dump_file, "it's not migratable\n"); + if (dump_file) + fprintf (dump_file, "it's not migratable\n"); return 0; } @@ -1190,24 +1302,21 @@ migrate_btr_def (btr_def def, int min_cost) no need to consider it further. */ { - if (rtl_dump_file) - fprintf (rtl_dump_file, "it's already combined with another pt\n"); + if (dump_file) + fprintf (dump_file, "it's already combined with another pt\n"); return 0; } btr_def_live_range (def, &btrs_live_in_range); - live_range = BITMAP_XMALLOC (); + live_range = BITMAP_ALLOC (NULL); bitmap_copy (live_range, def->live_range); #ifdef INSN_SCHEDULING - if ((*targetm.sched.use_dfa_pipeline_interface) ()) - def_latency = insn_default_latency (def->insn); - else - def_latency = result_ready_cost (def->insn); + def_latency = insn_default_latency (def->insn) * issue_rate; +#else + def_latency = issue_rate; #endif - def_latency *= issue_rate; - for (user = def->uses; user != NULL; user = user->next) { if (user->bb == def->bb @@ -1230,20 +1339,30 @@ migrate_btr_def (btr_def def, int min_cost) /* Try to move the instruction that sets the target register into basic block TRY. */ int try_freq = basic_block_freq (try); + edge_iterator ei; + edge e; - if (rtl_dump_file) - fprintf (rtl_dump_file, "trying block %d ...", try->index); + /* If TRY has abnormal edges, skip it. */ + FOR_EACH_EDGE (e, ei, try->succs) + if (e->flags & EDGE_COMPLEX) + break; + if (e) + continue; + + if (dump_file) + fprintf (dump_file, "trying block %d ...", try->index); if (try_freq < def_basic_block_freq || (try_freq == def_basic_block_freq && btr_used_near_def)) { int btr; - augment_live_range (live_range, &btrs_live_in_range, def->bb, try); - if (rtl_dump_file) + augment_live_range (live_range, &btrs_live_in_range, def->bb, try, + flag_btr_bb_exclusive); + if (dump_file) { - fprintf (rtl_dump_file, "Now btrs live in range are: "); + fprintf (dump_file, "Now btrs live in range are: "); dump_hard_reg_set (btrs_live_in_range); - fprintf (rtl_dump_file, "\n"); + fprintf (dump_file, "\n"); } btr = choose_btr (btrs_live_in_range); if (btr != -1) @@ -1259,8 +1378,8 @@ migrate_btr_def (btr_def def, int min_cost) /* There are no free target registers available to move this far forward, so give up */ give_up = 1; - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "giving up because there are no free target registers\n"); } @@ -1269,10 +1388,10 @@ migrate_btr_def (btr_def def, int min_cost) if (!def_moved) { give_up = 1; - if (rtl_dump_file) - fprintf (rtl_dump_file, "failed to move\n"); + if (dump_file) + fprintf (dump_file, "failed to move\n"); } - BITMAP_XFREE (live_range); + BITMAP_FREE (live_range); return !give_up; } @@ -1285,14 +1404,14 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save) int reg; gcc_obstack_init (&migrate_btrl_obstack); - if (rtl_dump_file) + if (dump_file) { int i; - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) { basic_block bb = BASIC_BLOCK (i); - fprintf(rtl_dump_file, + fprintf(dump_file, "Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC " loop-depth = %d idom = %d\n", i, (HOST_WIDEST_INT) bb->count, bb->loop_depth, @@ -1312,45 +1431,43 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save) } btrs_live = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET)); + btrs_live_at_end = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET)); build_btr_def_use_webs (all_btr_defs); while (!fibheap_empty (all_btr_defs)) { - btr_def def = - (btr_def) fibheap_extract_min (all_btr_defs); + btr_def def = fibheap_extract_min (all_btr_defs); int min_cost = -fibheap_min_key (all_btr_defs); if (migrate_btr_def (def, min_cost)) { fibheap_insert (all_btr_defs, -def->cost, (void *) def); - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, "Putting insn %d back on queue with priority %d\n", INSN_UID (def->insn), def->cost); } } else - { - if (def->live_range) - BITMAP_XFREE (def->live_range); - } + BITMAP_FREE (def->live_range); } free (btrs_live); + free (btrs_live_at_end); obstack_free (&migrate_btrl_obstack, NULL); fibheap_delete (all_btr_defs); } void -branch_target_load_optimize (rtx insns, bool after_prologue_epilogue_gen) +branch_target_load_optimize (bool after_prologue_epilogue_gen) { - enum reg_class class = (*targetm.branch_target_register_class) (); + enum reg_class class = targetm.branch_target_register_class (); if (class != NO_REGS) { /* Initialize issue_rate. */ if (targetm.sched.issue_rate) - issue_rate = (*targetm.sched.issue_rate) (); + issue_rate = targetm.sched.issue_rate (); else issue_rate = 1; @@ -1361,12 +1478,12 @@ branch_target_load_optimize (rtx insns, bool after_prologue_epilogue_gen) cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0); #endif - life_analysis (insns, NULL, 0); + life_analysis (0); /* Dominator info is also needed for migrate_btr_def. */ calculate_dominance_info (CDI_DOMINATORS); migrate_btr_defs (class, - ((*targetm.branch_target_register_callee_saved) + (targetm.branch_target_register_callee_saved (after_prologue_epilogue_gen))); free_dominance_info (CDI_DOMINATORS); @@ -1375,3 +1492,51 @@ branch_target_load_optimize (rtx insns, bool after_prologue_epilogue_gen) PROP_DEATH_NOTES | PROP_REG_INFO); } } + +static bool +gate_handle_branch_target_load_optimize (void) +{ + return (optimize > 0 && flag_branch_target_load_optimize2); +} + + +static unsigned int +rest_of_handle_branch_target_load_optimize (void) +{ + static int warned = 0; + + /* Leave this a warning for now so that it is possible to experiment + with running this pass twice. In 3.6, we should either make this + an error, or use separate dump files. */ + if (flag_branch_target_load_optimize + && flag_branch_target_load_optimize2 + && !warned) + { + warning (0, "branch target register load optimization is not intended " + "to be run twice"); + + warned = 1; + } + + branch_target_load_optimize (epilogue_completed); + return 0; +} + +struct tree_opt_pass pass_branch_target_load_optimize = +{ + "btl", /* name */ + gate_handle_branch_target_load_optimize, /* gate */ + rest_of_handle_branch_target_load_optimize, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func | + TODO_ggc_collect, /* todo_flags_finish */ + 'd' /* letter */ +}; + diff --git a/contrib/gcc/builtin-attrs.def b/contrib/gcc/builtin-attrs.def index 92fe65e1e0d..46ac70d4c35 100644 --- a/contrib/gcc/builtin-attrs.def +++ b/contrib/gcc/builtin-attrs.def @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Joseph Myers . This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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 header provides a declarative way of describing the attributes that are applied to some functions by default. @@ -55,6 +55,8 @@ DEF_ATTR_FOR_INT (1) DEF_ATTR_FOR_INT (2) DEF_ATTR_FOR_INT (3) DEF_ATTR_FOR_INT (4) +DEF_ATTR_FOR_INT (5) +DEF_ATTR_FOR_INT (6) #undef DEF_ATTR_FOR_INT /* Construct a tree for a list of two integers. */ @@ -67,9 +69,13 @@ DEF_LIST_INT_INT (2,0) DEF_LIST_INT_INT (2,3) DEF_LIST_INT_INT (3,0) DEF_LIST_INT_INT (3,4) +DEF_LIST_INT_INT (4,0) +DEF_LIST_INT_INT (4,5) +DEF_LIST_INT_INT (5,0) +DEF_LIST_INT_INT (5,6) #undef DEF_LIST_INT_INT -/* Construct tress for identifiers. */ +/* Construct trees for identifiers. */ DEF_ATTR_IDENT (ATTR_CONST, "const") DEF_ATTR_IDENT (ATTR_FORMAT, "format") DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") @@ -83,45 +89,65 @@ DEF_ATTR_IDENT (ATTR_GCC_DIAG, "gcc_diag") DEF_ATTR_IDENT (ATTR_GCC_CDIAG, "gcc_cdiag") DEF_ATTR_IDENT (ATTR_GCC_CXXDIAG, "gcc_cxxdiag") DEF_ATTR_IDENT (ATTR_PURE, "pure") +DEF_ATTR_IDENT (ATTR_NOVOPS, "no vops") DEF_ATTR_IDENT (ATTR_SCANF, "scanf") +DEF_ATTR_IDENT (ATTR_SENTINEL, "sentinel") DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon") DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") +DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL) + DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL) DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \ ATTR_NULL, ATTR_NOTHROW_LIST) DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \ ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NOVOPS_LIST, ATTR_NOVOPS, \ + ATTR_NULL, ATTR_PURE_NOTHROW_LIST) DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \ ATTR_NULL, ATTR_NOTHROW_LIST) DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LIST, ATTR_MALLOC, \ ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_SENTINEL_NOTHROW_LIST, ATTR_SENTINEL, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +/* Functions whose pointer parameter(s) are all nonnull. */ +DEF_ATTR_TREE_LIST (ATTR_NONNULL_LIST, ATTR_NONNULL, ATTR_NULL, ATTR_NULL) +/* Functions whose first parameter is a nonnull pointer. */ +DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL) +/* Functions whose second parameter is a nonnull pointer. */ +DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, ATTR_NULL) +/* Nothrow functions with the sentinel(1) attribute. */ +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_SENTINEL_1, ATTR_SENTINEL, ATTR_LIST_1, \ + ATTR_NOTHROW_LIST) +/* Nothrow functions whose pointer parameter(s) are all nonnull. */ +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL, ATTR_NONNULL, ATTR_NULL, \ + ATTR_NOTHROW_LIST) +/* Nothrow functions whose first parameter is a nonnull pointer. */ DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, \ ATTR_NOTHROW_LIST) +/* Nothrow functions whose second parameter is a nonnull pointer. */ DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, \ ATTR_NOTHROW_LIST) +/* Nothrow functions whose third parameter is a nonnull pointer. */ DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, \ ATTR_NOTHROW_LIST) -/* Nothrow functions whose first and second parameters are nonnull pointers. */ -DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_2, ATTR_NONNULL, ATTR_LIST_2, \ - ATTR_NOTHROW_NONNULL_1) -/* Nothrow functions whose first and fourth parameters are nonnull pointers. */ -DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1_4, ATTR_NONNULL, ATTR_LIST_4, \ - ATTR_NOTHROW_NONNULL_1) -/* Nothrow const functions whose first parameter is a nonnull pointer. */ -DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL_1, ATTR_CONST, ATTR_NULL, \ - ATTR_NOTHROW_NONNULL_1) -/* Nothrow pure functions whose first parameter is a nonnull pointer. */ -DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE, ATTR_NULL, \ - ATTR_NOTHROW_NONNULL_1) -/* Nothrow pure functions whose first and second parameters are nonnull pointers. */ -DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_PURE, ATTR_NULL, \ - ATTR_NOTHROW_NONNULL_1_2) -/* Nothrow malloc functions whose first parameter is a nonnull pointer. */ -DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL_1, ATTR_MALLOC, ATTR_NULL, \ - ATTR_NOTHROW_NONNULL_1) +/* Nothrow functions whose fourth parameter is a nonnull pointer. */ +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_4, ATTR_NONNULL, ATTR_LIST_4, \ + ATTR_NOTHROW_LIST) +/* Nothrow functions whose fifth parameter is a nonnull pointer. */ +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_5, ATTR_NONNULL, ATTR_LIST_5, \ + ATTR_NOTHROW_LIST) +/* Nothrow const functions whose pointer parameter(s) are all nonnull. */ +DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL, ATTR_CONST, ATTR_NULL, \ + ATTR_NOTHROW_NONNULL) +/* Nothrow pure functions whose pointer parameter(s) are all nonnull. */ +DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL, ATTR_PURE, ATTR_NULL, \ + ATTR_NOTHROW_NONNULL) +/* Nothrow malloc functions whose pointer parameter(s) are all nonnull. */ +DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL, ATTR_MALLOC, ATTR_NULL, \ + ATTR_NOTHROW_NONNULL) /* Construct a tree for a format attribute. */ #define DEF_FORMAT_ATTRIBUTE(TYPE, FA, VALUES) \ @@ -135,6 +161,10 @@ DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_0) DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_3) DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_0) DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_4) +DEF_FORMAT_ATTRIBUTE(PRINTF,4,4_0) +DEF_FORMAT_ATTRIBUTE(PRINTF,4,4_5) +DEF_FORMAT_ATTRIBUTE(PRINTF,5,5_0) +DEF_FORMAT_ATTRIBUTE(PRINTF,5,5_6) DEF_FORMAT_ATTRIBUTE(SCANF,1,1_0) DEF_FORMAT_ATTRIBUTE(SCANF,1,1_2) DEF_FORMAT_ATTRIBUTE(SCANF,2,2_0) diff --git a/contrib/gcc/builtin-types.def b/contrib/gcc/builtin-types.def index 85b30b98caa..d6330b15652 100644 --- a/contrib/gcc/builtin-types.def +++ b/contrib/gcc/builtin-types.def @@ -1,4 +1,5 @@ -/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GCC. @@ -14,10 +15,10 @@ for more details. 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 header provides a declaritive way of describing the types that +/* This header provides a declarative way of describing the types that are used when declaring builtin functions. Before including this header, you must define the following macros: @@ -32,6 +33,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DEF_FUNCTION_TYPE_2 (ENUM, RETURN, ARG1, ARG2) DEF_FUNCTION_TYPE_3 (ENUM, RETURN, ARG1, ARG2, ARG3) DEF_FUNCTION_TYPE_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) + DEF_FUNCTION_TYPE_5 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) + DEF_FUNCTION_TYPE_6 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) + DEF_FUNCTION_TYPE_7 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) These macros describe function types. ENUM is as above. The RETURN type is one of the enumerals already defined. ARG1, ARG2, @@ -41,6 +45,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DEF_FUNCTION_TYPE_VAR_1 (ENUM, RETURN, ARG1) DEF_FUNCTION_TYPE_VAR_2 (ENUM, RETURN, ARG1, ARG2) DEF_FUNCTION_TYPE_VAR_3 (ENUM, RETURN, ARG1, ARG2, ARG3) + DEF_FUNCTION_TYPE_VAR_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) + DEF_FUNCTION_TYPE_VAR_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) Similar, but for function types that take variable arguments. For example: @@ -53,20 +59,24 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DEF_FUNCTION_TYPE_VAR_1 (BT_INT_DOUBLE_VAR, BT_INT, BT_DOUBLE) describes the type `int ()(double, ...)'. - + DEF_POINTER_TYPE (ENUM, TYPE) This macro describes a pointer type. ENUM is as above; TYPE is the type pointed to. */ DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node) +DEF_PRIMITIVE_TYPE (BT_BOOL, boolean_type_node) DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node) -DEF_PRIMITIVE_TYPE (BT_UNSIGNED, unsigned_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node) +DEF_PRIMITIVE_TYPE (BT_ULONG, long_unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node) +DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node) +DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) +DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node) DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0)) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) -DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node) DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE, long_double_type_node) DEF_PRIMITIVE_TYPE (BT_COMPLEX_FLOAT, complex_float_type_node) @@ -74,58 +84,96 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_DOUBLE, complex_double_type_node) DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node) DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_FILEPTR, fileptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR, + build_pointer_type + (build_qualified_type (void_type_node, + TYPE_QUAL_VOLATILE))) DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0)) DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE_PTR, long_double_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_PID, pid_type_node) DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node) DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node) +DEF_PRIMITIVE_TYPE (BT_WINT, wint_type_node) DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT32, dfloat32_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT64, dfloat64_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT128, dfloat128_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT32_PTR, dfloat32_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT64_PTR, dfloat64_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_DFLOAT128_PTR, dfloat128_ptr_type_node) + DEF_PRIMITIVE_TYPE (BT_VALIST_REF, va_list_ref_type_node) DEF_PRIMITIVE_TYPE (BT_VALIST_ARG, va_list_arg_type_node) +DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1)) +DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1)) +DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1)) +DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1)) +DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1)) + +DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING) +DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG) +DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR) + DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID) +DEF_FUNCTION_TYPE_0 (BT_FN_BOOL, BT_BOOL) DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR) -DEF_FUNCTION_TYPE_0 (BT_FN_UNSIGNED, BT_UNSIGNED) +DEF_FUNCTION_TYPE_0 (BT_FN_PID, BT_PID) +DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT) +DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT) DEF_FUNCTION_TYPE_0 (BT_FN_FLOAT, BT_FLOAT) DEF_FUNCTION_TYPE_0 (BT_FN_DOUBLE, BT_DOUBLE) /* For "long double" we use LONGDOUBLE (not LONG_DOUBLE) to distinguish it from two types in sequence, "long" followed by "double". */ DEF_FUNCTION_TYPE_0 (BT_FN_LONGDOUBLE, BT_LONGDOUBLE) +DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT32, BT_DFLOAT32) +DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT64, BT_DFLOAT64) +DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT128, BT_DFLOAT128) DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONG, BT_LONG, BT_LONG) DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGLONG, BT_LONGLONG, BT_LONGLONG) DEF_FUNCTION_TYPE_1 (BT_FN_INTMAX_INTMAX, BT_INTMAX, BT_INTMAX) DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_FLOAT, BT_FLOAT, BT_FLOAT) DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_DOUBLE, BT_DOUBLE, BT_DOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_LONGDOUBLE, - BT_LONGDOUBLE, BT_LONGDOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, +DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_LONGDOUBLE, + BT_LONGDOUBLE, BT_LONGDOUBLE) +DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT) -DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, +DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, - BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_COMPLEX_FLOAT, - BT_FLOAT, BT_COMPLEX_FLOAT) +DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, + BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) +DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_COMPLEX_FLOAT, + BT_FLOAT, BT_COMPLEX_FLOAT) DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLEX_DOUBLE, - BT_DOUBLE, BT_COMPLEX_DOUBLE) + BT_DOUBLE, BT_COMPLEX_DOUBLE) DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, - BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) -DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UNSIGNED, BT_PTR, BT_UNSIGNED) + BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) +DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UINT, BT_PTR, BT_UINT) DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE) DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINT, BT_INT, BT_UINT) DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONG, BT_INT, BT_LONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONG, BT_INT, BT_ULONG) DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGLONG, BT_INT, BT_LONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONGLONG, BT_INT, BT_ULONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_INTMAX, BT_INT, BT_INTMAX) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINTMAX, BT_INT, BT_UINTMAX) DEF_FUNCTION_TYPE_1 (BT_FN_INT_PTR, BT_INT, BT_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_INT_FLOAT, BT_INT, BT_FLOAT) DEF_FUNCTION_TYPE_1 (BT_FN_INT_DOUBLE, BT_INT, BT_DOUBLE) DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT32, BT_INT, BT_DFLOAT32) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT64, BT_INT, BT_DFLOAT64) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT128, BT_INT, BT_DFLOAT128) DEF_FUNCTION_TYPE_1 (BT_FN_LONG_FLOAT, BT_LONG, BT_FLOAT) DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE, BT_LONG, BT_DOUBLE) DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONGDOUBLE, BT_LONG, BT_LONGDOUBLE) @@ -142,27 +190,43 @@ DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_CONST_STRING, BT_FLOAT, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_CONST_STRING, BT_DOUBLE, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_CONST_STRING, BT_LONGDOUBLE, BT_CONST_STRING) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT32_CONST_STRING, BT_DFLOAT32, BT_CONST_STRING) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT64_CONST_STRING, BT_DFLOAT64, BT_CONST_STRING) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_CONST_STRING, + BT_DFLOAT128, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_WORD_PTR, BT_WORD, BT_PTR) +DEF_FUNCTION_TYPE_1 (BT_FN_INT_WINT, BT_INT, BT_WINT) +DEF_FUNCTION_TYPE_1 (BT_FN_WINT_WINT, BT_WINT, BT_WINT) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT32_DFLOAT32, BT_DFLOAT32, BT_DFLOAT32) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT64_DFLOAT64, BT_DFLOAT64, BT_DFLOAT64) +DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFLOAT128, BT_DFLOAT128, BT_DFLOAT128) +DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) +DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT) + +DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT) -DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING, - BT_STRING, BT_STRING, BT_CONST_STRING) +DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING, + BT_STRING, BT_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_CONST_STRING, - BT_INT, BT_CONST_STRING, BT_CONST_STRING) + BT_INT, BT_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_STRING_CONST_STRING, - BT_SIZE, BT_CONST_STRING, BT_CONST_STRING) + BT_SIZE, BT_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_INT, - BT_STRING, BT_CONST_STRING, BT_INT) -DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_PTR, - BT_INT, BT_CONST_STRING, BT_PTR) -DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_PTR, - BT_INT, BT_INT, BT_PTR) + BT_STRING, BT_CONST_STRING, BT_INT) +DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_SIZE, + BT_STRING, BT_CONST_STRING, BT_SIZE) +DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_FILEPTR, + BT_INT, BT_CONST_STRING, BT_FILEPTR) +DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_FILEPTR, + BT_INT, BT_INT, BT_FILEPTR) DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTRMODE_PTR, BT_VOID, BT_PTRMODE, BT_PTR) -DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VALIST_REF_VALIST_ARG, +DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VALIST_REF_VALIST_ARG, BT_VOID, BT_VALIST_REF, BT_VALIST_ARG) DEF_FUNCTION_TYPE_2 (BT_FN_LONG_LONG_LONG, BT_LONG, BT_LONG, BT_LONG) @@ -214,12 +278,23 @@ DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_VALIST_ARG, BT_INT, BT_CONST_STRING, BT_VALIST_ARG) DEF_FUNCTION_TYPE_2 (BT_FN_PTR_SIZE_SIZE, BT_PTR, BT_SIZE, BT_SIZE) -DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT, +DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT) -DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE, +DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE) -DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, - BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) +DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, + BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE) +DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR) +DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING, + BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING) +DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_PTR_INT, BT_SIZE, BT_CONST_PTR, BT_INT) +DEF_FUNCTION_TYPE_2 (BT_FN_I1_VPTR_I1, BT_I1, BT_VOLATILE_PTR, BT_I1) +DEF_FUNCTION_TYPE_2 (BT_FN_I2_VPTR_I2, BT_I2, BT_VOLATILE_PTR, BT_I2) +DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4) +DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8) +DEF_FUNCTION_TYPE_2 (BT_FN_I16_VPTR_I16, BT_I16, BT_VOLATILE_PTR, BT_I16) +DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_LONGPTR_LONGPTR, + BT_BOOL, BT_PTR_LONG, BT_PTR_LONG) DEF_FUNCTION_TYPE_3 (BT_FN_STRING_STRING_CONST_STRING_SIZE, BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE) @@ -228,9 +303,9 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_CONST_PTR_SIZE, BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE) DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, - BT_INT, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE) + BT_INT, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_INT_SIZE, - BT_PTR, BT_PTR, BT_INT, BT_SIZE) + BT_PTR, BT_PTR, BT_INT, BT_SIZE) DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_INT_INT, BT_VOID, BT_PTR, BT_INT, BT_INT) DEF_FUNCTION_TYPE_3 (BT_FN_VOID_CONST_PTR_PTR_SIZE, @@ -239,8 +314,8 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, BT_INT, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG) DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG) -DEF_FUNCTION_TYPE_3 (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, - BT_INT, BT_PTR, BT_CONST_STRING, BT_VALIST_ARG) +DEF_FUNCTION_TYPE_3 (BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, + BT_INT, BT_FILEPTR, BT_CONST_STRING, BT_VALIST_ARG) DEF_FUNCTION_TYPE_3 (BT_FN_STRING_CONST_STRING_CONST_STRING_INT, BT_STRING, BT_CONST_STRING, BT_CONST_STRING, BT_INT) DEF_FUNCTION_TYPE_3 (BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, @@ -261,37 +336,103 @@ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR, BT_VOID, BT_DOUBLE, BT_DOUBLE_PTR, BT_DOUBLE_PTR) DEF_FUNCTION_TYPE_3 (BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR, BT_VOID, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR, BT_LONGDOUBLE_PTR) +DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_PTR_PTR, BT_VOID, BT_PTR, BT_PTR, BT_PTR) +DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING, + BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING, BT_PTR_CONST_STRING) +DEF_FUNCTION_TYPE_3 (BT_FN_INT_INT_CONST_STRING_VALIST_ARG, + BT_INT, BT_INT, BT_CONST_STRING, BT_VALIST_ARG) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I1_I1, BT_BOOL, BT_VOLATILE_PTR, + BT_I1, BT_I1) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I2_I2, BT_BOOL, BT_VOLATILE_PTR, + BT_I2, BT_I2) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I4_I4, BT_BOOL, BT_VOLATILE_PTR, + BT_I4, BT_I4) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I8_I8, BT_BOOL, BT_VOLATILE_PTR, + BT_I8, BT_I8) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I16_I16, BT_BOOL, BT_VOLATILE_PTR, + BT_I16, BT_I16) +DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_I1, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_I1) +DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_I2, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_I2) +DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_I4, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_I4) +DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_I8, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_I8) +DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR, + BT_I16, BT_I16) +DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR, + BT_PTR, BT_UINT) -DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, - BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR) +DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, + BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR) DEF_FUNCTION_TYPE_4 (BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG) DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, BT_SIZE, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_PTR) +DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, + BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE, BT_SIZE) +DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_INT_SIZE_SIZE, + BT_PTR, BT_PTR, BT_INT, BT_SIZE, BT_SIZE) +DEF_FUNCTION_TYPE_4 (BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, + BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE, BT_SIZE) +DEF_FUNCTION_TYPE_4 (BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG, + BT_INT, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VALIST_ARG) +DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT, + BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT) + +DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG, + BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING, + BT_VALIST_ARG) +DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, + BT_BOOL, BT_LONG, BT_LONG, BT_LONG, + BT_PTR_LONG, BT_PTR_LONG) + +DEF_FUNCTION_TYPE_6 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG, + BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, + BT_CONST_STRING, BT_VALIST_ARG) +DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, + BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG, + BT_PTR_LONG, BT_PTR_LONG) +DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, + BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, + BT_LONG, BT_LONG, BT_LONG) + +DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG, + BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, + BT_LONG, BT_LONG, BT_LONG, BT_LONG) DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID) DEF_FUNCTION_TYPE_VAR_0 (BT_FN_INT_VAR, BT_INT) DEF_FUNCTION_TYPE_VAR_0 (BT_FN_PTR_VAR, BT_PTR) -DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_VALIST_REF_VAR, +DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_VALIST_REF_VAR, BT_VOID, BT_VALIST_REF) DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_CONST_PTR_VAR, BT_VOID, BT_CONST_PTR) DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR, - BT_INT, BT_CONST_STRING) + BT_INT, BT_CONST_STRING) -DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_PTR_CONST_STRING_VAR, - BT_INT, BT_PTR, BT_CONST_STRING) +DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_FILEPTR_CONST_STRING_VAR, + BT_INT, BT_FILEPTR, BT_CONST_STRING) DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_STRING_CONST_STRING_VAR, BT_INT, BT_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_CONST_STRING_CONST_STRING_VAR, BT_INT, BT_CONST_STRING, BT_CONST_STRING) +DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_INT_CONST_STRING_VAR, + BT_INT, BT_INT, BT_CONST_STRING) DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_STRING_SIZE_CONST_STRING_VAR, BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING) DEF_FUNCTION_TYPE_VAR_3 (BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, BT_SSIZE, BT_STRING, BT_SIZE, BT_CONST_STRING) +DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR, + BT_INT, BT_FILEPTR, BT_INT, BT_CONST_STRING) + +DEF_FUNCTION_TYPE_VAR_4 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, + BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING) + +DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, + BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, + BT_CONST_STRING) DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE) + diff --git a/contrib/gcc/builtins.c b/contrib/gcc/builtins.c index 2931684a9a6..27f19894cc7 100644 --- a/contrib/gcc/builtins.c +++ b/contrib/gcc/builtins.c @@ -1,6 +1,6 @@ /* Expand builtin functions. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -27,6 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "real.h" #include "rtl.h" #include "tree.h" +#include "tree-gimple.h" #include "flags.h" #include "regs.h" #include "hard-reg-set.h" @@ -44,17 +45,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm_p.h" #include "target.h" #include "langhooks.h" - -#define CALLED_AS_BUILT_IN(NODE) \ - (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10)) - -/* Register mappings for target machines without register windows. */ -#ifndef INCOMING_REGNO -#define INCOMING_REGNO(OUT) (OUT) -#endif -#ifndef OUTGOING_REGNO -#define OUTGOING_REGNO(IN) (IN) -#endif +#include "basic-block.h" +#include "tree-mudflap.h" #ifndef PAD_VARARGS_DOWN #define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN @@ -64,8 +56,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA const char *const built_in_class_names[4] = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"}; -#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM) #X, -const char *const built_in_names[(int) END_BUILTINS] = +#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM, COND) #X, +const char * built_in_names[(int) END_BUILTINS] = { #include "builtins.def" }; @@ -76,22 +68,20 @@ const char *const built_in_names[(int) END_BUILTINS] = tree built_in_decls[(int) END_BUILTINS]; /* Declarations used when constructing the builtin implicitly in the compiler. It may be NULL_TREE when this is invalid (for instance runtime is not - required to implement the function call in all cases. */ + required to implement the function call in all cases). */ tree implicit_built_in_decls[(int) END_BUILTINS]; static int get_pointer_alignment (tree, unsigned int); -static tree c_strlen (tree, int); static const char *c_getstr (tree); static rtx c_readstr (const char *, enum machine_mode); static int target_char_cast (tree, char *); -static rtx get_memory_rtx (tree); -static tree build_string_literal (int, const char *); +static rtx get_memory_rtx (tree, tree); static int apply_args_size (void); static int apply_result_size (void); #if defined (HAVE_untyped_call) || defined (HAVE_untyped_return) static rtx result_vector (int, rtx); #endif -static rtx expand_builtin_setjmp (tree, rtx); +static void expand_builtin_update_setjmp_buf (rtx); static void expand_builtin_prefetch (tree); static rtx expand_builtin_apply_args (void); static rtx expand_builtin_apply_args_1 (void); @@ -102,9 +92,11 @@ static rtx expand_builtin_classify_type (tree); static void expand_errno_check (tree, rtx); static rtx expand_builtin_mathfn (tree, rtx, rtx); static rtx expand_builtin_mathfn_2 (tree, rtx, rtx); -static rtx expand_builtin_constant_p (tree, enum machine_mode); +static rtx expand_builtin_mathfn_3 (tree, rtx, rtx); +static rtx expand_builtin_sincos (tree); +static rtx expand_builtin_int_roundingfn (tree, rtx, rtx); static rtx expand_builtin_args_info (tree); -static rtx expand_builtin_next_arg (tree); +static rtx expand_builtin_next_arg (void); static rtx expand_builtin_va_start (tree); static rtx expand_builtin_va_end (tree); static rtx expand_builtin_va_copy (tree); @@ -112,27 +104,27 @@ static rtx expand_builtin_memcmp (tree, tree, rtx, enum machine_mode); static rtx expand_builtin_strcmp (tree, rtx, enum machine_mode); static rtx expand_builtin_strncmp (tree, rtx, enum machine_mode); static rtx builtin_memcpy_read_str (void *, HOST_WIDE_INT, enum machine_mode); -static rtx expand_builtin_strcat (tree, rtx, enum machine_mode); +static rtx expand_builtin_strcat (tree, tree, rtx, enum machine_mode); static rtx expand_builtin_strncat (tree, rtx, enum machine_mode); static rtx expand_builtin_strspn (tree, rtx, enum machine_mode); static rtx expand_builtin_strcspn (tree, rtx, enum machine_mode); static rtx expand_builtin_memcpy (tree, rtx, enum machine_mode); -static rtx expand_builtin_mempcpy (tree, rtx, enum machine_mode, int); -static rtx expand_builtin_memmove (tree, rtx, enum machine_mode); +static rtx expand_builtin_mempcpy (tree, tree, rtx, enum machine_mode, int); +static rtx expand_builtin_memmove (tree, tree, rtx, enum machine_mode, tree); static rtx expand_builtin_bcopy (tree); -static rtx expand_builtin_strcpy (tree, rtx, enum machine_mode); +static rtx expand_builtin_strcpy (tree, tree, rtx, enum machine_mode); static rtx expand_builtin_stpcpy (tree, rtx, enum machine_mode); static rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode); static rtx expand_builtin_strncpy (tree, rtx, enum machine_mode); static rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode); static rtx builtin_memset_gen_str (void *, HOST_WIDE_INT, enum machine_mode); -static rtx expand_builtin_memset (tree, rtx, enum machine_mode); +static rtx expand_builtin_memset (tree, rtx, enum machine_mode, tree); static rtx expand_builtin_bzero (tree); static rtx expand_builtin_strlen (tree, rtx, enum machine_mode); -static rtx expand_builtin_strstr (tree, rtx, enum machine_mode); -static rtx expand_builtin_strpbrk (tree, rtx, enum machine_mode); -static rtx expand_builtin_strchr (tree, rtx, enum machine_mode); -static rtx expand_builtin_strrchr (tree, rtx, enum machine_mode); +static rtx expand_builtin_strstr (tree, tree, rtx, enum machine_mode); +static rtx expand_builtin_strpbrk (tree, tree, rtx, enum machine_mode); +static rtx expand_builtin_strchr (tree, tree, rtx, enum machine_mode); +static rtx expand_builtin_strrchr (tree, tree, rtx, enum machine_mode); static rtx expand_builtin_alloca (tree, rtx); static rtx expand_builtin_unop (enum machine_mode, tree, rtx, rtx, optab); static rtx expand_builtin_frame_address (tree, tree); @@ -144,27 +136,88 @@ static tree stabilize_va_list (tree, int); static rtx expand_builtin_expect (tree, rtx); static tree fold_builtin_constant_p (tree); static tree fold_builtin_classify_type (tree); +static tree fold_builtin_strlen (tree); static tree fold_builtin_inf (tree, int); static tree fold_builtin_nan (tree, tree, int); static int validate_arglist (tree, ...); static bool integer_valued_real_p (tree); -static tree fold_trunc_transparent_mathfn (tree); +static tree fold_trunc_transparent_mathfn (tree, tree); static bool readonly_data_expr (tree); static rtx expand_builtin_fabs (tree, rtx, rtx); -static rtx expand_builtin_cabs (tree, rtx); -static tree fold_builtin_cabs (tree, tree, tree); -static tree fold_builtin_trunc (tree); -static tree fold_builtin_floor (tree); -static tree fold_builtin_ceil (tree); -static tree fold_builtin_bitop (tree); -static tree fold_builtin_memcpy (tree); -static tree fold_builtin_mempcpy (tree); -static tree fold_builtin_memmove (tree); -static tree fold_builtin_strcpy (tree); -static tree fold_builtin_strncpy (tree); +static rtx expand_builtin_signbit (tree, rtx); +static tree fold_builtin_sqrt (tree, tree); +static tree fold_builtin_cbrt (tree, tree); +static tree fold_builtin_pow (tree, tree, tree); +static tree fold_builtin_powi (tree, tree, tree); +static tree fold_builtin_sin (tree); +static tree fold_builtin_cos (tree, tree, tree); +static tree fold_builtin_tan (tree); +static tree fold_builtin_atan (tree, tree); +static tree fold_builtin_trunc (tree, tree); +static tree fold_builtin_floor (tree, tree); +static tree fold_builtin_ceil (tree, tree); +static tree fold_builtin_round (tree, tree); +static tree fold_builtin_int_roundingfn (tree, tree); +static tree fold_builtin_bitop (tree, tree); +static tree fold_builtin_memory_op (tree, tree, bool, int); +static tree fold_builtin_strchr (tree, tree); static tree fold_builtin_memcmp (tree); static tree fold_builtin_strcmp (tree); static tree fold_builtin_strncmp (tree); +static tree fold_builtin_signbit (tree, tree); +static tree fold_builtin_copysign (tree, tree, tree); +static tree fold_builtin_isascii (tree); +static tree fold_builtin_toascii (tree); +static tree fold_builtin_isdigit (tree); +static tree fold_builtin_fabs (tree, tree); +static tree fold_builtin_abs (tree, tree); +static tree fold_builtin_unordered_cmp (tree, tree, enum tree_code, + enum tree_code); +static tree fold_builtin_1 (tree, tree, bool); + +static tree fold_builtin_strpbrk (tree, tree); +static tree fold_builtin_strstr (tree, tree); +static tree fold_builtin_strrchr (tree, tree); +static tree fold_builtin_strcat (tree); +static tree fold_builtin_strncat (tree); +static tree fold_builtin_strspn (tree); +static tree fold_builtin_strcspn (tree); +static tree fold_builtin_sprintf (tree, int); + +static rtx expand_builtin_object_size (tree); +static rtx expand_builtin_memory_chk (tree, rtx, enum machine_mode, + enum built_in_function); +static void maybe_emit_chk_warning (tree, enum built_in_function); +static void maybe_emit_sprintf_chk_warning (tree, enum built_in_function); +static tree fold_builtin_object_size (tree); +static tree fold_builtin_strcat_chk (tree, tree); +static tree fold_builtin_strncat_chk (tree, tree); +static tree fold_builtin_sprintf_chk (tree, enum built_in_function); +static tree fold_builtin_printf (tree, tree, bool, enum built_in_function); +static tree fold_builtin_fprintf (tree, tree, bool, enum built_in_function); +static bool init_target_chars (void); + +static unsigned HOST_WIDE_INT target_newline; +static unsigned HOST_WIDE_INT target_percent; +static unsigned HOST_WIDE_INT target_c; +static unsigned HOST_WIDE_INT target_s; +static char target_percent_c[3]; +static char target_percent_s[3]; +static char target_percent_s_newline[4]; + +/* Return true if NODE should be considered for inline expansion regardless + of the optimization level. This means whenever a function is invoked with + its "internal" name, which normally contains the prefix "__builtin". */ + +static bool called_as_built_in (tree node) +{ + const char *name = IDENTIFIER_POINTER (DECL_NAME (node)); + if (strncmp (name, "__builtin_", 10) == 0) + return true; + if (strncmp (name, "__sync_", 7) == 0) + return true; + return false; +} /* Return the alignment in bits of EXP, a pointer valued expression. But don't return more than MAX_ALIGN no matter what. @@ -179,7 +232,11 @@ get_pointer_alignment (tree exp, unsigned int max_align) { unsigned int align, inner; - if (TREE_CODE (TREE_TYPE (exp)) != POINTER_TYPE) + /* We rely on TER to compute accurate alignment information. */ + if (!(optimize && flag_tree_ter)) + return 0; + + if (!POINTER_TYPE_P (TREE_TYPE (exp))) return 0; align = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))); @@ -193,7 +250,7 @@ get_pointer_alignment (tree exp, unsigned int max_align) case CONVERT_EXPR: case NON_LVALUE_EXPR: exp = TREE_OPERAND (exp, 0); - if (TREE_CODE (TREE_TYPE (exp)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (exp))) return align; inner = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))); @@ -218,14 +275,59 @@ get_pointer_alignment (tree exp, unsigned int max_align) case ADDR_EXPR: /* See what we are pointing at and look at its alignment. */ exp = TREE_OPERAND (exp, 0); + inner = max_align; + if (handled_component_p (exp)) + { + HOST_WIDE_INT bitsize, bitpos; + tree offset; + enum machine_mode mode; + int unsignedp, volatilep; + + exp = get_inner_reference (exp, &bitsize, &bitpos, &offset, + &mode, &unsignedp, &volatilep, true); + if (bitpos) + inner = MIN (inner, (unsigned) (bitpos & -bitpos)); + if (offset && TREE_CODE (offset) == PLUS_EXPR + && host_integerp (TREE_OPERAND (offset, 1), 1)) + { + /* Any overflow in calculating offset_bits won't change + the alignment. */ + unsigned offset_bits + = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1) + * BITS_PER_UNIT); + + if (offset_bits) + inner = MIN (inner, (offset_bits & -offset_bits)); + offset = TREE_OPERAND (offset, 0); + } + if (offset && TREE_CODE (offset) == MULT_EXPR + && host_integerp (TREE_OPERAND (offset, 1), 1)) + { + /* Any overflow in calculating offset_factor won't change + the alignment. */ + unsigned offset_factor + = ((unsigned) tree_low_cst (TREE_OPERAND (offset, 1), 1) + * BITS_PER_UNIT); + + if (offset_factor) + inner = MIN (inner, (offset_factor & -offset_factor)); + } + else if (offset) + inner = MIN (inner, BITS_PER_UNIT); + } if (TREE_CODE (exp) == FUNCTION_DECL) align = FUNCTION_BOUNDARY; else if (DECL_P (exp)) - align = DECL_ALIGN (exp); + align = MIN (inner, DECL_ALIGN (exp)); #ifdef CONSTANT_ALIGNMENT - else if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'c') - align = CONSTANT_ALIGNMENT (exp, align); + else if (CONSTANT_CLASS_P (exp)) + align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align)); #endif + else if (TREE_CODE (exp) == VIEW_CONVERT_EXPR + || TREE_CODE (exp) == INDIRECT_REF) + align = MIN (TYPE_ALIGN (TREE_TYPE (exp)), inner); + else + align = MIN (align, inner); return MIN (align, max_align); default: @@ -250,7 +352,7 @@ get_pointer_alignment (tree exp, unsigned int max_align) Unfortunately, string_constant can't access the values of const char arrays with initializers, so neither can we do so here. */ -static tree +tree c_strlen (tree src, int only_value) { tree offset_node; @@ -266,7 +368,7 @@ c_strlen (tree src, int only_value) len1 = c_strlen (TREE_OPERAND (src, 1), only_value); len2 = c_strlen (TREE_OPERAND (src, 2), only_value); - if (tree_int_cst_equal (len1, len2)) + if (tree_int_cst_equal (len1, len2)) return len1; } @@ -315,7 +417,7 @@ c_strlen (tree src, int only_value) runtime. */ if (offset < 0 || offset > max) { - warning ("offset outside bounds of constant string"); + warning (0, "offset outside bounds of constant string"); return 0; } @@ -359,8 +461,8 @@ c_readstr (const char *str, enum machine_mode mode) HOST_WIDE_INT ch; unsigned int i, j; - if (GET_MODE_CLASS (mode) != MODE_INT) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_INT); + c[0] = 0; c[1] = 0; ch = 1; @@ -373,8 +475,8 @@ c_readstr (const char *str, enum machine_mode mode) && GET_MODE_SIZE (mode) > UNITS_PER_WORD) j = j + UNITS_PER_WORD - 2 * (j % UNITS_PER_WORD) - 1; j *= BITS_PER_UNIT; - if (j > 2 * HOST_BITS_PER_WIDE_INT) - abort (); + gcc_assert (j <= 2 * HOST_BITS_PER_WIDE_INT); + if (ch) ch = (unsigned char) str[i]; c[j / HOST_BITS_PER_WIDE_INT] |= ch << (j % HOST_BITS_PER_WIDE_INT); @@ -383,7 +485,7 @@ c_readstr (const char *str, enum machine_mode mode) } /* Cast a target constant CST to target CHAR and if that value fits into - host char type, return zero and put that value into variable pointed by + host char type, return zero and put that value into variable pointed to by P. */ static int @@ -410,25 +512,64 @@ target_char_cast (tree cst, char *p) return 0; } +/* Similar to save_expr, but assumes that arbitrary code is not executed + in between the multiple evaluations. In particular, we assume that a + non-addressable local variable will not be modified. */ + +static tree +builtin_save_expr (tree exp) +{ + if (TREE_ADDRESSABLE (exp) == 0 + && (TREE_CODE (exp) == PARM_DECL + || (TREE_CODE (exp) == VAR_DECL && !TREE_STATIC (exp)))) + return exp; + + return save_expr (exp); +} + /* Given TEM, a pointer to a stack frame, follow the dynamic chain COUNT times to get the address of either a higher stack frame, or a return address located within it (depending on FNDECL_CODE). */ -rtx -expand_builtin_return_addr (enum built_in_function fndecl_code, int count, - rtx tem) +static rtx +expand_builtin_return_addr (enum built_in_function fndecl_code, int count) { int i; +#ifdef INITIAL_FRAME_ADDRESS_RTX + rtx tem = INITIAL_FRAME_ADDRESS_RTX; +#else + rtx tem; + + /* For a zero count with __builtin_return_address, we don't care what + frame address we return, because target-specific definitions will + override us. Therefore frame pointer elimination is OK, and using + the soft frame pointer is OK. + + For a non-zero count, or a zero count with __builtin_frame_address, + we require a stable offset from the current frame pointer to the + previous one, so we must use the hard frame pointer, and + we must disable frame pointer elimination. */ + if (count == 0 && fndecl_code == BUILT_IN_RETURN_ADDRESS) + tem = frame_pointer_rtx; + else + { + tem = hard_frame_pointer_rtx; + + /* Tell reload not to eliminate the frame pointer. */ + current_function_accesses_prior_frames = 1; + } +#endif + /* Some machines need special handling before we can access - arbitrary frames. For example, on the sparc, we must first flush + arbitrary frames. For example, on the SPARC, we must first flush all register windows to the stack. */ #ifdef SETUP_FRAME_ADDRESSES if (count > 0) SETUP_FRAME_ADDRESSES (); #endif - /* On the sparc, the return address is not in the frame, it is in a + /* On the SPARC, the return address is not in the frame, it is in a register. There is no way to access it off of the current frame pointer, but it can be accessed off the previous frame pointer by reading the value from the register window save area. */ @@ -446,24 +587,26 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count, tem = DYNAMIC_CHAIN_ADDRESS (tem); #endif tem = memory_address (Pmode, tem); - tem = gen_rtx_MEM (Pmode, tem); - set_mem_alias_set (tem, get_frame_alias_set ()); + tem = gen_frame_mem (Pmode, tem); tem = copy_to_reg (tem); } - /* For __builtin_frame_address, return what we've got. */ + /* For __builtin_frame_address, return what we've got. But, on + the SPARC for example, we may have to add a bias. */ if (fndecl_code == BUILT_IN_FRAME_ADDRESS) +#ifdef FRAME_ADDR_RTX + return FRAME_ADDR_RTX (tem); +#else return tem; +#endif - /* For __builtin_return_address, Get the return address from that - frame. */ + /* For __builtin_return_address, get the return address from that frame. */ #ifdef RETURN_ADDR_RTX tem = RETURN_ADDR_RTX (count, tem); #else tem = memory_address (Pmode, plus_constant (tem, GET_MODE_SIZE (Pmode))); - tem = gen_rtx_MEM (Pmode, tem); - set_mem_alias_set (tem, get_frame_alias_set ()); + tem = gen_frame_mem (Pmode, tem); #endif return tem; } @@ -472,8 +615,8 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count, static HOST_WIDE_INT setjmp_alias_set = -1; /* Construct the leading half of a __builtin_setjmp call. Control will - return to RECEIVER_LABEL. This is used directly by sjlj exception - handling code. */ + return to RECEIVER_LABEL. This is also called directly by the SJLJ + exception handling code. */ void expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) @@ -489,19 +632,13 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) buf_addr = force_reg (Pmode, force_operand (buf_addr, NULL_RTX)); - emit_queue (); - /* We store the frame pointer and the address of receiver_label in the buffer and use the rest of it for the stack save area, which is machine-dependent. */ -#ifndef BUILTIN_SETJMP_FRAME_VALUE -#define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx -#endif - mem = gen_rtx_MEM (Pmode, buf_addr); set_mem_alias_set (mem, setjmp_alias_set); - emit_move_insn (mem, BUILTIN_SETJMP_FRAME_VALUE); + emit_move_insn (mem, targetm.builtin_setjmp_frame_value ()); mem = gen_rtx_MEM (Pmode, plus_constant (buf_addr, GET_MODE_SIZE (Pmode))), set_mem_alias_set (mem, setjmp_alias_set); @@ -530,8 +667,8 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) current_function_has_nonlocal_label = 1; } -/* Construct the trailing part of a __builtin_setjmp call. - This is used directly by sjlj exception handling code. */ +/* Construct the trailing part of a __builtin_setjmp call. This is + also called directly by the SJLJ exception handling code. */ void expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED) @@ -545,12 +682,16 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED) emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx)); /* Now put in the code to restore the frame pointer, and argument - pointer, if needed. The code below is from expand_end_bindings - in stmt.c; see detailed documentation there. */ + pointer, if needed. */ #ifdef HAVE_nonlocal_goto if (! HAVE_nonlocal_goto) #endif - emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); + { + emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); + /* This might change the hard frame pointer in ways that aren't + apparent to early optimization passes, so force a clobber. */ + emit_insn (gen_rtx_CLOBBER (VOIDmode, hard_frame_pointer_rtx)); + } #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM if (fixed_regs[ARG_POINTER_REGNUM]) @@ -595,69 +736,12 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED) emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "")); } -/* __builtin_setjmp is passed a pointer to an array of five words (not - all will be used on all machines). It operates similarly to the C - library function of the same name, but is more efficient. Much of - the code below (and for longjmp) is copied from the handling of - non-local gotos. - - NOTE: This is intended for use by GNAT and the exception handling - scheme in the compiler and will only work in the method used by - them. */ - -static rtx -expand_builtin_setjmp (tree arglist, rtx target) -{ - rtx buf_addr, next_lab, cont_lab; - - if (!validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) - return NULL_RTX; - - if (target == 0 || GET_CODE (target) != REG - || REGNO (target) < FIRST_PSEUDO_REGISTER) - target = gen_reg_rtx (TYPE_MODE (integer_type_node)); - - buf_addr = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0); - - next_lab = gen_label_rtx (); - cont_lab = gen_label_rtx (); - - expand_builtin_setjmp_setup (buf_addr, next_lab); - - /* Set TARGET to zero and branch to the continue label. Use emit_jump to - ensure that pending stack adjustments are flushed. */ - emit_move_insn (target, const0_rtx); - emit_jump (cont_lab); - - emit_label (next_lab); - - expand_builtin_setjmp_receiver (next_lab); - - /* Set TARGET to one. */ - emit_move_insn (target, const1_rtx); - emit_label (cont_lab); - - /* Tell flow about the strange goings on. Putting `next_lab' on - `nonlocal_goto_handler_labels' to indicates that function - calls may traverse the arc back to this label. */ - - current_function_has_nonlocal_label = 1; - nonlocal_goto_handler_labels - = gen_rtx_EXPR_LIST (VOIDmode, next_lab, nonlocal_goto_handler_labels); - - return target; -} - /* __builtin_longjmp is passed a pointer to an array of five words (not all will be used on all machines). It operates similarly to the C library function of the same name, but is more efficient. Much of - the code below is copied from the handling of non-local gotos. + the code below is copied from the handling of non-local gotos. */ - NOTE: This is intended for use by GNAT and the exception handling - scheme in the compiler and will only work in the method used by - them. */ - -void +static void expand_builtin_longjmp (rtx buf_addr, rtx value) { rtx fp, lab, stack, insn, last; @@ -675,10 +759,7 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) a second argument of 1, because that is what builtin_setjmp will return. This also makes EH slightly more efficient, since we are no longer copying around a value that we don't care about. */ - if (value != const1_rtx) - abort (); - - current_function_calls_longjmp = 1; + gcc_assert (value == const1_rtx); last = get_last_insn (); #ifdef HAVE_builtin_longjmp @@ -699,7 +780,7 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) /* Pick up FP, label, and SP from the block and jump. This code is from expand_goto in stmt.c; see there for detailed comments. */ -#if HAVE_nonlocal_goto +#ifdef HAVE_nonlocal_goto if (HAVE_nonlocal_goto) /* We have to pass a value to the nonlocal_goto pattern that will get copied into the static_chain pointer, but it does not matter @@ -733,19 +814,128 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) internal exception handling use only. */ for (insn = get_last_insn (); insn; insn = PREV_INSN (insn)) { - if (insn == last) - abort (); - if (GET_CODE (insn) == JUMP_INSN) + gcc_assert (insn != last); + + if (JUMP_P (insn)) { REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx, REG_NOTES (insn)); break; } - else if (GET_CODE (insn) == CALL_INSN) + else if (CALL_P (insn)) break; } } +/* Expand a call to __builtin_nonlocal_goto. We're passed the target label + and the address of the save area. */ + +static rtx +expand_builtin_nonlocal_goto (tree arglist) +{ + tree t_label, t_save_area; + rtx r_label, r_save_area, r_fp, r_sp, insn; + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return NULL_RTX; + + t_label = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + t_save_area = TREE_VALUE (arglist); + + r_label = expand_normal (t_label); + r_label = convert_memory_address (Pmode, r_label); + r_save_area = expand_normal (t_save_area); + r_save_area = convert_memory_address (Pmode, r_save_area); + r_fp = gen_rtx_MEM (Pmode, r_save_area); + r_sp = gen_rtx_MEM (STACK_SAVEAREA_MODE (SAVE_NONLOCAL), + plus_constant (r_save_area, GET_MODE_SIZE (Pmode))); + + current_function_has_nonlocal_goto = 1; + +#ifdef HAVE_nonlocal_goto + /* ??? We no longer need to pass the static chain value, afaik. */ + if (HAVE_nonlocal_goto) + emit_insn (gen_nonlocal_goto (const0_rtx, r_label, r_sp, r_fp)); + else +#endif + { + r_label = copy_to_reg (r_label); + + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + gen_rtx_SCRATCH (VOIDmode)))); + + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, + hard_frame_pointer_rtx))); + + /* Restore frame pointer for containing function. + This sets the actual hard register used for the frame pointer + to the location of the function's incoming static chain info. + The non-local goto handler will then adjust it to contain the + proper value and reload the argument pointer, if needed. */ + emit_move_insn (hard_frame_pointer_rtx, r_fp); + emit_stack_restore (SAVE_NONLOCAL, r_sp, NULL_RTX); + + /* USE of hard_frame_pointer_rtx added for consistency; + not clear if really needed. */ + emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + emit_indirect_jump (r_label); + } + + /* Search backwards to the jump insn and mark it as a + non-local goto. */ + for (insn = get_last_insn (); insn; insn = PREV_INSN (insn)) + { + if (JUMP_P (insn)) + { + REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, + const0_rtx, REG_NOTES (insn)); + break; + } + else if (CALL_P (insn)) + break; + } + + return const0_rtx; +} + +/* __builtin_update_setjmp_buf is passed a pointer to an array of five words + (not all will be used on all machines) that was passed to __builtin_setjmp. + It updates the stack pointer in that block to correspond to the current + stack pointer. */ + +static void +expand_builtin_update_setjmp_buf (rtx buf_addr) +{ + enum machine_mode sa_mode = Pmode; + rtx stack_save; + + +#ifdef HAVE_save_stack_nonlocal + if (HAVE_save_stack_nonlocal) + sa_mode = insn_data[(int) CODE_FOR_save_stack_nonlocal].operand[0].mode; +#endif +#ifdef STACK_SAVEAREA_MODE + sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL); +#endif + + stack_save + = gen_rtx_MEM (sa_mode, + memory_address + (sa_mode, + plus_constant (buf_addr, 2 * GET_MODE_SIZE (Pmode)))); + +#ifdef HAVE_setjmp + if (HAVE_setjmp) + emit_insn (gen_setjmp ()); +#endif + + emit_stack_save (SAVE_NONLOCAL, &stack_save, NULL_RTX); +} + /* Expand a call to __builtin_prefetch. For a target that does not support data prefetch, evaluate the memory address argument in case it has side effects. */ @@ -769,12 +959,12 @@ expand_builtin_prefetch (tree arglist) if (TREE_CHAIN (TREE_CHAIN (arglist))) arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); else - arg2 = build_int_2 (3, 0); + arg2 = build_int_cst (NULL_TREE, 3); } else { arg1 = integer_zero_node; - arg2 = build_int_2 (3, 0); + arg2 = build_int_cst (NULL_TREE, 3); } /* Argument 0 is an address. */ @@ -783,28 +973,29 @@ expand_builtin_prefetch (tree arglist) /* Argument 1 (read/write flag) must be a compile-time constant int. */ if (TREE_CODE (arg1) != INTEGER_CST) { - error ("second arg to `__builtin_prefetch' must be a constant"); + error ("second argument to %<__builtin_prefetch%> must be a constant"); arg1 = integer_zero_node; } - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op1 = expand_normal (arg1); /* Argument 1 must be either zero or one. */ if (INTVAL (op1) != 0 && INTVAL (op1) != 1) { - warning ("invalid second arg to __builtin_prefetch; using zero"); + warning (0, "invalid second argument to %<__builtin_prefetch%>;" + " using zero"); op1 = const0_rtx; } /* Argument 2 (locality) must be a compile-time constant int. */ if (TREE_CODE (arg2) != INTEGER_CST) { - error ("third arg to `__builtin_prefetch' must be a constant"); + error ("third argument to %<__builtin_prefetch%> must be a constant"); arg2 = integer_zero_node; } - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op2 = expand_normal (arg2); /* Argument 2 must be 0, 1, 2, or 3. */ if (INTVAL (op2) < 0 || INTVAL (op2) > 3) { - warning ("invalid third arg to __builtin_prefetch; using zero"); + warning (0, "invalid third argument to %<__builtin_prefetch%>; using zero"); op2 = const0_rtx; } @@ -821,27 +1012,24 @@ expand_builtin_prefetch (tree arglist) } emit_insn (gen_prefetch (op0, op1, op2)); } - else #endif - op0 = protect_from_queue (op0, 0); + /* Don't do anything with direct references to volatile memory, but generate code to handle other side effects. */ - if (GET_CODE (op0) != MEM && side_effects_p (op0)) + if (!MEM_P (op0) && side_effects_p (op0)) emit_insn (op0); } /* Get a MEM rtx for expression EXP which is the address of an operand - to be used to be used in a string instruction (cmpstrsi, movstrsi, ..). */ + to be used in a string instruction (cmpstrsi, movmemsi, ..). LEN is + the maximum length of the block of memory that might be accessed or + NULL if unknown. */ static rtx -get_memory_rtx (tree exp) +get_memory_rtx (tree exp, tree len) { - rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_SUM); - rtx mem; - - addr = convert_memory_address (Pmode, addr); - - mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); + rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_NORMAL); + rtx mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); /* Get an expression we can use to find the attributes to assign to MEM. If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if @@ -852,15 +1040,94 @@ get_memory_rtx (tree exp) exp = TREE_OPERAND (exp, 0); if (TREE_CODE (exp) == ADDR_EXPR) - { - exp = TREE_OPERAND (exp, 0); - set_mem_attributes (mem, exp, 0); - } + exp = TREE_OPERAND (exp, 0); else if (POINTER_TYPE_P (TREE_TYPE (exp))) + exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp); + else + exp = NULL; + + /* Honor attributes derived from exp, except for the alias set + (as builtin stringops may alias with anything) and the size + (as stringops may access multiple array elements). */ + if (exp) { - exp = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (exp)), exp); - /* memcpy, memset and other builtin stringops can alias with anything. */ + set_mem_attributes (mem, exp, 0); + + /* Allow the string and memory builtins to overflow from one + field into another, see http://gcc.gnu.org/PR23561. + Thus avoid COMPONENT_REFs in MEM_EXPR unless we know the whole + memory accessed by the string or memory builtin will fit + within the field. */ + if (MEM_EXPR (mem) && TREE_CODE (MEM_EXPR (mem)) == COMPONENT_REF) + { + tree mem_expr = MEM_EXPR (mem); + HOST_WIDE_INT offset = -1, length = -1; + tree inner = exp; + + while (TREE_CODE (inner) == ARRAY_REF + || TREE_CODE (inner) == NOP_EXPR + || TREE_CODE (inner) == CONVERT_EXPR + || TREE_CODE (inner) == NON_LVALUE_EXPR + || TREE_CODE (inner) == VIEW_CONVERT_EXPR + || TREE_CODE (inner) == SAVE_EXPR) + inner = TREE_OPERAND (inner, 0); + + gcc_assert (TREE_CODE (inner) == COMPONENT_REF); + + if (MEM_OFFSET (mem) + && GET_CODE (MEM_OFFSET (mem)) == CONST_INT) + offset = INTVAL (MEM_OFFSET (mem)); + + if (offset >= 0 && len && host_integerp (len, 0)) + length = tree_low_cst (len, 0); + + while (TREE_CODE (inner) == COMPONENT_REF) + { + tree field = TREE_OPERAND (inner, 1); + gcc_assert (! DECL_BIT_FIELD (field)); + gcc_assert (TREE_CODE (mem_expr) == COMPONENT_REF); + gcc_assert (field == TREE_OPERAND (mem_expr, 1)); + + if (length >= 0 + && TYPE_SIZE_UNIT (TREE_TYPE (inner)) + && host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (inner)), 0)) + { + HOST_WIDE_INT size + = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (inner)), 0); + /* If we can prove the memory starting at XEXP (mem, 0) + and ending at XEXP (mem, 0) + LENGTH will fit into + this field, we can keep that COMPONENT_REF in MEM_EXPR. */ + if (offset <= size + && length <= size + && offset + length <= size) + break; + } + + if (offset >= 0 + && host_integerp (DECL_FIELD_OFFSET (field), 0)) + offset += tree_low_cst (DECL_FIELD_OFFSET (field), 0) + + tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1) + / BITS_PER_UNIT; + else + { + offset = -1; + length = -1; + } + + mem_expr = TREE_OPERAND (mem_expr, 0); + inner = TREE_OPERAND (inner, 0); + } + + if (mem_expr == NULL) + offset = -1; + if (mem_expr != MEM_EXPR (mem)) + { + set_mem_expr (mem, mem_expr); + set_mem_offset (mem, offset >= 0 ? GEN_INT (offset) : NULL_RTX); + } + } set_mem_alias_set (mem, 0); + set_mem_size (mem, NULL_RTX); } return mem; @@ -888,23 +1155,6 @@ static enum machine_mode apply_result_mode[FIRST_PSEUDO_REGISTER]; used for calling a function. */ static int apply_args_reg_offset[FIRST_PSEUDO_REGISTER]; -/* Return the offset of register REGNO into the block returned by - __builtin_apply_args. This is not declared static, since it is - needed in objc-act.c. */ - -int -apply_args_register_offset (int regno) -{ - apply_args_size (); - - /* Arguments are always put in outgoing registers (in the argument - block) if such make sense. */ -#ifdef OUTGOING_REGNO - regno = OUTGOING_REGNO (regno); -#endif - return apply_args_reg_offset[regno]; -} - /* Return the size required for the block returned by __builtin_apply_args, and initialize apply_args_mode. */ @@ -930,44 +1180,9 @@ apply_args_size (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (FUNCTION_ARG_REGNO_P (regno)) { - /* Search for the proper mode for copying this register's - value. I'm not sure this is right, but it works so far. */ - enum machine_mode best_mode = VOIDmode; + mode = reg_raw_mode[regno]; - for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && HARD_REGNO_NREGS (regno, mode) == 1) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - mode = best_mode; - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT; if (size % align != 0) @@ -1003,43 +1218,9 @@ apply_result_size (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (FUNCTION_VALUE_REGNO_P (regno)) { - /* Search for the proper mode for copying this register's - value. I'm not sure this is right, but it works so far. */ - enum machine_mode best_mode = VOIDmode; + mode = reg_raw_mode[regno]; - for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); - mode != TImode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode)) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - if (best_mode == VOIDmode) - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (HARD_REGNO_MODE_OK (regno, mode) - && have_insn_for (SET, mode)) - best_mode = mode; - - mode = best_mode; - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT; if (size % align != 0) @@ -1135,7 +1316,7 @@ expand_builtin_apply_args_1 (void) NULL_RTX); #endif emit_move_insn (adjust_address (registers, Pmode, 0), tem); - + size = GET_MODE_SIZE (Pmode); /* Save the structure value address unless this is passed as an @@ -1184,7 +1365,7 @@ expand_builtin_apply_args (void) chain current, so the code is placed at the start of the function. */ push_topmost_sequence (); - emit_insn_before (seq, NEXT_INSN (get_insns ())); + emit_insn_before (seq, NEXT_INSN (entry_of_function ())); pop_topmost_sequence (); return temp; } @@ -1216,9 +1397,6 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) incoming_args, 0, OPTAB_LIB_WIDEN); #endif - /* Perform postincrements before actually calling the function. */ - emit_queue (); - /* Push a new argument block and copy the arguments. Do not allow the (potential) memcpy call below to interfere with our stack manipulations. */ @@ -1281,13 +1459,13 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) rtx value = gen_reg_rtx (Pmode); emit_move_insn (value, adjust_address (arguments, Pmode, size)); emit_move_insn (struct_value, value); - if (GET_CODE (struct_value) == REG) + if (REG_P (struct_value)) use_reg (&call_fusage, struct_value); size += GET_MODE_SIZE (Pmode); } /* All arguments and registers used for the call are set up by now! */ - function = prepare_call_address (function, NULL_TREE, &call_fusage, 0, 0); + function = prepare_call_address (function, NULL, &call_fusage, 0, 0); /* Ensure address is valid. SYMBOL_REF is already valid, so no need, and we don't want to load it into a register as an optimization, @@ -1314,8 +1492,8 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if ((mode = apply_result_mode[regno]) != VOIDmode) { - if (valreg) - abort (); /* HAVE_untyped_call required. */ + gcc_assert (!valreg); /* HAVE_untyped_call required. */ + valreg = gen_rtx_REG (mode, regno); } @@ -1327,7 +1505,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) } else #endif - abort (); + gcc_unreachable (); /* Find the CALL insn we just emitted, and attach the register usage information. */ @@ -1408,7 +1586,6 @@ type_to_class (tree type) { case VOID_TYPE: return void_type_class; case INTEGER_TYPE: return integer_type_class; - case CHAR_TYPE: return char_type_class; case ENUMERAL_TYPE: return enumeral_type_class; case BOOLEAN_TYPE: return boolean_type_class; case POINTER_TYPE: return pointer_type_class; @@ -1423,8 +1600,6 @@ type_to_class (tree type) case QUAL_UNION_TYPE: return union_type_class; case ARRAY_TYPE: return (TYPE_STRING_FLAG (type) ? string_type_class : array_type_class); - case SET_TYPE: return set_type_class; - case FILE_TYPE: return file_type_class; case LANG_TYPE: return lang_type_class; default: return no_type_class; } @@ -1441,32 +1616,6 @@ expand_builtin_classify_type (tree arglist) return GEN_INT (no_type_class); } -/* Expand expression EXP, which is a call to __builtin_constant_p. */ - -static rtx -expand_builtin_constant_p (tree arglist, enum machine_mode target_mode) -{ - rtx tmp; - - if (arglist == 0) - return const0_rtx; - arglist = TREE_VALUE (arglist); - - /* We have taken care of the easy cases during constant folding. This - case is not obvious, so emit (constant_p_rtx (ARGLIST)) and let CSE - get a chance to see if it can deduce whether ARGLIST is constant. - If CSE isn't going to run, of course, don't bother waiting. */ - - if (cse_not_expected) - return const0_rtx; - - current_function_calls_constant_p = 1; - - tmp = expand_expr (arglist, NULL_RTX, VOIDmode, 0); - tmp = gen_rtx_CONSTANT_P_RTX (target_mode, tmp); - return tmp; -} - /* This helper macro, meant to be used in mathfn_built_in below, determines which among a set of three builtin math functions is appropriate for a given type mode. The `F' and `L' cases are @@ -1481,7 +1630,6 @@ expand_builtin_constant_p (tree arglist, enum machine_mode target_mode) tree mathfn_built_in (tree type, enum built_in_function fn) { - const enum machine_mode type_mode = TYPE_MODE (type); enum built_in_function fcode, fcodef, fcodel; switch (fn) @@ -1521,8 +1669,12 @@ mathfn_built_in (tree type, enum built_in_function fn) CASE_MATHFN (BUILT_IN_J0) CASE_MATHFN (BUILT_IN_J1) CASE_MATHFN (BUILT_IN_JN) + CASE_MATHFN (BUILT_IN_LCEIL) CASE_MATHFN (BUILT_IN_LDEXP) + CASE_MATHFN (BUILT_IN_LFLOOR) CASE_MATHFN (BUILT_IN_LGAMMA) + CASE_MATHFN (BUILT_IN_LLCEIL) + CASE_MATHFN (BUILT_IN_LLFLOOR) CASE_MATHFN (BUILT_IN_LLRINT) CASE_MATHFN (BUILT_IN_LLROUND) CASE_MATHFN (BUILT_IN_LOG) @@ -1539,6 +1691,7 @@ mathfn_built_in (tree type, enum built_in_function fn) CASE_MATHFN (BUILT_IN_NEXTAFTER) CASE_MATHFN (BUILT_IN_NEXTTOWARD) CASE_MATHFN (BUILT_IN_POW) + CASE_MATHFN (BUILT_IN_POWI) CASE_MATHFN (BUILT_IN_POW10) CASE_MATHFN (BUILT_IN_REMAINDER) CASE_MATHFN (BUILT_IN_REMQUO) @@ -1564,11 +1717,11 @@ mathfn_built_in (tree type, enum built_in_function fn) return 0; } - if (type_mode == TYPE_MODE (double_type_node)) + if (TYPE_MAIN_VARIANT (type) == double_type_node) return implicit_built_in_decls[fcode]; - else if (type_mode == TYPE_MODE (float_type_node)) + else if (TYPE_MAIN_VARIANT (type) == float_type_node) return implicit_built_in_decls[fcodef]; - else if (type_mode == TYPE_MODE (long_double_type_node)) + else if (TYPE_MAIN_VARIANT (type) == long_double_type_node) return implicit_built_in_decls[fcodel]; else return 0; @@ -1613,7 +1766,7 @@ expand_errno_check (tree exp, rtx target) } -/* Expand a call to one of the builtin math functions (sin, cos, or sqrt). +/* Expand a call to one of the builtin math functions (sqrt, exp, or log). Return 0 if a normal call should be emitted rather than expanding the function in-line. EXP is the expression that is a call to the builtin function; if convenient, the result should be placed in TARGET. @@ -1637,58 +1790,56 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) switch (DECL_FUNCTION_CODE (fndecl)) { - case BUILT_IN_SIN: - case BUILT_IN_SINF: - case BUILT_IN_SINL: - builtin_optab = sin_optab; break; - case BUILT_IN_COS: - case BUILT_IN_COSF: - case BUILT_IN_COSL: - builtin_optab = cos_optab; break; - case BUILT_IN_SQRT: - case BUILT_IN_SQRTF: - case BUILT_IN_SQRTL: + CASE_FLT_FN (BUILT_IN_SQRT): errno_set = ! tree_expr_nonnegative_p (arg); builtin_optab = sqrt_optab; break; - case BUILT_IN_EXP: - case BUILT_IN_EXPF: - case BUILT_IN_EXPL: + CASE_FLT_FN (BUILT_IN_EXP): errno_set = true; builtin_optab = exp_optab; break; - case BUILT_IN_LOG: - case BUILT_IN_LOGF: - case BUILT_IN_LOGL: + CASE_FLT_FN (BUILT_IN_EXP10): + CASE_FLT_FN (BUILT_IN_POW10): + errno_set = true; builtin_optab = exp10_optab; break; + CASE_FLT_FN (BUILT_IN_EXP2): + errno_set = true; builtin_optab = exp2_optab; break; + CASE_FLT_FN (BUILT_IN_EXPM1): + errno_set = true; builtin_optab = expm1_optab; break; + CASE_FLT_FN (BUILT_IN_LOGB): + errno_set = true; builtin_optab = logb_optab; break; + CASE_FLT_FN (BUILT_IN_ILOGB): + errno_set = true; builtin_optab = ilogb_optab; break; + CASE_FLT_FN (BUILT_IN_LOG): errno_set = true; builtin_optab = log_optab; break; - case BUILT_IN_TAN: - case BUILT_IN_TANF: - case BUILT_IN_TANL: + CASE_FLT_FN (BUILT_IN_LOG10): + errno_set = true; builtin_optab = log10_optab; break; + CASE_FLT_FN (BUILT_IN_LOG2): + errno_set = true; builtin_optab = log2_optab; break; + CASE_FLT_FN (BUILT_IN_LOG1P): + errno_set = true; builtin_optab = log1p_optab; break; + CASE_FLT_FN (BUILT_IN_ASIN): + builtin_optab = asin_optab; break; + CASE_FLT_FN (BUILT_IN_ACOS): + builtin_optab = acos_optab; break; + CASE_FLT_FN (BUILT_IN_TAN): builtin_optab = tan_optab; break; - case BUILT_IN_ATAN: - case BUILT_IN_ATANF: - case BUILT_IN_ATANL: + CASE_FLT_FN (BUILT_IN_ATAN): builtin_optab = atan_optab; break; - case BUILT_IN_FLOOR: - case BUILT_IN_FLOORF: - case BUILT_IN_FLOORL: + CASE_FLT_FN (BUILT_IN_FLOOR): builtin_optab = floor_optab; break; - case BUILT_IN_CEIL: - case BUILT_IN_CEILF: - case BUILT_IN_CEILL: + CASE_FLT_FN (BUILT_IN_CEIL): builtin_optab = ceil_optab; break; - case BUILT_IN_TRUNC: - case BUILT_IN_TRUNCF: - case BUILT_IN_TRUNCL: + CASE_FLT_FN (BUILT_IN_TRUNC): builtin_optab = btrunc_optab; break; - case BUILT_IN_ROUND: - case BUILT_IN_ROUNDF: - case BUILT_IN_ROUNDL: + CASE_FLT_FN (BUILT_IN_ROUND): builtin_optab = round_optab; break; - case BUILT_IN_NEARBYINT: - case BUILT_IN_NEARBYINTF: - case BUILT_IN_NEARBYINTL: + CASE_FLT_FN (BUILT_IN_NEARBYINT): builtin_optab = nearbyint_optab; break; + CASE_FLT_FN (BUILT_IN_RINT): + builtin_optab = rint_optab; break; + CASE_FLT_FN (BUILT_IN_LRINT): + CASE_FLT_FN (BUILT_IN_LLRINT): + builtin_optab = lrint_optab; break; default: - abort (); + gcc_unreachable (); } /* Make a suitable register to place result in. */ @@ -1705,7 +1856,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) /* Wrap the computation of the argument in a SAVE_EXPR, as we may need to expand the argument again. This way, we will not perform side-effects more the once. */ - narg = save_expr (arg); + narg = builtin_save_expr (arg); if (narg != arg) { arg = narg; @@ -1715,7 +1866,6 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) op0 = expand_expr (arg, subtarget, VOIDmode, 0); - emit_queue (); start_sequence (); /* Compute into TARGET. @@ -1769,7 +1919,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) rtx operand = XEXP (XEXP (XEXP (note, 0), 1), 0); /* Check operand is a register with expected mode. */ if (operand - && GET_CODE (operand) == REG + && REG_P (operand) && GET_MODE (operand) == mode) { /* Replace the REG_EQUAL note with a SQRT rtx. */ @@ -1798,6 +1948,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) { optab builtin_optab; rtx op0, op1, insns; + int op1_type = REAL_TYPE; tree fndecl = get_callee_fndecl (exp); tree arglist = TREE_OPERAND (exp, 1); tree arg0, arg1, temp, narg; @@ -1805,7 +1956,12 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) bool errno_set = true; bool stable = true; - if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) + if ((DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXP) + || (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXPF) + || (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXPL)) + op1_type = INTEGER_TYPE; + + if (!validate_arglist (arglist, REAL_TYPE, op1_type, VOID_TYPE)) return 0; arg0 = TREE_VALUE (arglist); @@ -1813,16 +1969,18 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) switch (DECL_FUNCTION_CODE (fndecl)) { - case BUILT_IN_POW: - case BUILT_IN_POWF: - case BUILT_IN_POWL: + CASE_FLT_FN (BUILT_IN_POW): builtin_optab = pow_optab; break; - case BUILT_IN_ATAN2: - case BUILT_IN_ATAN2F: - case BUILT_IN_ATAN2L: + CASE_FLT_FN (BUILT_IN_ATAN2): builtin_optab = atan2_optab; break; + CASE_FLT_FN (BUILT_IN_LDEXP): + builtin_optab = ldexp_optab; break; + CASE_FLT_FN (BUILT_IN_FMOD): + builtin_optab = fmod_optab; break; + CASE_FLT_FN (BUILT_IN_DREM): + builtin_optab = drem_optab; break; default: - abort (); + gcc_unreachable (); } /* Make a suitable register to place result in. */ @@ -1837,8 +1995,8 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) if (! flag_errno_math || ! HONOR_NANS (mode)) errno_set = false; - /* Alway stabilize the argument list. */ - narg = save_expr (arg1); + /* Always stabilize the argument list. */ + narg = builtin_save_expr (arg1); if (narg != arg1) { arg1 = narg; @@ -1848,7 +2006,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) else temp = TREE_CHAIN (arglist); - narg = save_expr (arg0); + narg = builtin_save_expr (arg0); if (narg != arg0) { arg0 = narg; @@ -1861,10 +2019,9 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) if (! stable) exp = build_function_call_expr (fndecl, arglist); - op0 = expand_expr (arg0, subtarget, VOIDmode, 0); - op1 = expand_expr (arg1, 0, VOIDmode, 0); + op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL); + op1 = expand_normal (arg1); - emit_queue (); start_sequence (); /* Compute into TARGET. @@ -1892,6 +2049,266 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) return target; } +/* Expand a call to the builtin sin and cos math functions. + Return 0 if a normal call should be emitted rather than expanding the + function in-line. EXP is the expression that is a call to the builtin + function; if convenient, the result should be placed in TARGET. + SUBTARGET may be used as the target for computing one of EXP's + operands. */ + +static rtx +expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget) +{ + optab builtin_optab; + rtx op0, insns; + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); + enum machine_mode mode; + tree arg, narg; + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + CASE_FLT_FN (BUILT_IN_SIN): + CASE_FLT_FN (BUILT_IN_COS): + builtin_optab = sincos_optab; break; + default: + gcc_unreachable (); + } + + /* Make a suitable register to place result in. */ + mode = TYPE_MODE (TREE_TYPE (exp)); + + /* Check if sincos insn is available, otherwise fallback + to sin or cos insn. */ + if (builtin_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing) { + switch (DECL_FUNCTION_CODE (fndecl)) + { + CASE_FLT_FN (BUILT_IN_SIN): + builtin_optab = sin_optab; break; + CASE_FLT_FN (BUILT_IN_COS): + builtin_optab = cos_optab; break; + default: + gcc_unreachable (); + } + } + + /* Before working hard, check whether the instruction is available. */ + if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) + { + target = gen_reg_rtx (mode); + + /* Wrap the computation of the argument in a SAVE_EXPR, as we may + need to expand the argument again. This way, we will not perform + side-effects more the once. */ + narg = save_expr (arg); + if (narg != arg) + { + arg = narg; + arglist = build_tree_list (NULL_TREE, arg); + exp = build_function_call_expr (fndecl, arglist); + } + + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + start_sequence (); + + /* Compute into TARGET. + Set TARGET to wherever the result comes back. */ + if (builtin_optab == sincos_optab) + { + int result; + + switch (DECL_FUNCTION_CODE (fndecl)) + { + CASE_FLT_FN (BUILT_IN_SIN): + result = expand_twoval_unop (builtin_optab, op0, 0, target, 0); + break; + CASE_FLT_FN (BUILT_IN_COS): + result = expand_twoval_unop (builtin_optab, op0, target, 0, 0); + break; + default: + gcc_unreachable (); + } + gcc_assert (result); + } + else + { + target = expand_unop (mode, builtin_optab, op0, target, 0); + } + + if (target != 0) + { + /* Output the entire sequence. */ + insns = get_insns (); + end_sequence (); + emit_insn (insns); + return target; + } + + /* If we were unable to expand via the builtin, stop the sequence + (without outputting the insns) and call to the library function + with the stabilized argument list. */ + end_sequence (); + } + + target = expand_call (exp, target, target == const0_rtx); + + return target; +} + +/* Expand a call to the builtin sincos math function. + Return 0 if a normal call should be emitted rather than expanding the + function in-line. EXP is the expression that is a call to the builtin + function. */ + +static rtx +expand_builtin_sincos (tree exp) +{ + rtx op0, op1, op2, target1, target2; + tree arglist = TREE_OPERAND (exp, 1); + enum machine_mode mode; + tree arg, sinp, cosp; + int result; + + if (!validate_arglist (arglist, REAL_TYPE, + POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + sinp = TREE_VALUE (TREE_CHAIN (arglist)); + cosp = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + /* Make a suitable register to place result in. */ + mode = TYPE_MODE (TREE_TYPE (arg)); + + /* Check if sincos insn is available, otherwise emit the call. */ + if (sincos_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing) + return NULL_RTX; + + target1 = gen_reg_rtx (mode); + target2 = gen_reg_rtx (mode); + + op0 = expand_normal (arg); + op1 = expand_normal (build_fold_indirect_ref (sinp)); + op2 = expand_normal (build_fold_indirect_ref (cosp)); + + /* Compute into target1 and target2. + Set TARGET to wherever the result comes back. */ + result = expand_twoval_unop (sincos_optab, op0, target2, target1, 0); + gcc_assert (result); + + /* Move target1 and target2 to the memory locations indicated + by op1 and op2. */ + emit_move_insn (op1, target1); + emit_move_insn (op2, target2); + + return const0_rtx; +} + +/* Expand a call to one of the builtin rounding functions (lfloor). + If expanding via optab fails, lower expression to (int)(floor(x)). + EXP is the expression that is a call to the builtin function; + if convenient, the result should be placed in TARGET. SUBTARGET may + be used as the target for computing one of EXP's operands. */ + +static rtx +expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget) +{ + optab builtin_optab; + rtx op0, insns, tmp; + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); + enum built_in_function fallback_fn; + tree fallback_fndecl; + enum machine_mode mode; + tree arg, narg; + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + gcc_unreachable (); + + arg = TREE_VALUE (arglist); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + CASE_FLT_FN (BUILT_IN_LCEIL): + CASE_FLT_FN (BUILT_IN_LLCEIL): + builtin_optab = lceil_optab; + fallback_fn = BUILT_IN_CEIL; + break; + + CASE_FLT_FN (BUILT_IN_LFLOOR): + CASE_FLT_FN (BUILT_IN_LLFLOOR): + builtin_optab = lfloor_optab; + fallback_fn = BUILT_IN_FLOOR; + break; + + default: + gcc_unreachable (); + } + + /* Make a suitable register to place result in. */ + mode = TYPE_MODE (TREE_TYPE (exp)); + + /* Before working hard, check whether the instruction is available. */ + if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) + { + target = gen_reg_rtx (mode); + + /* Wrap the computation of the argument in a SAVE_EXPR, as we may + need to expand the argument again. This way, we will not perform + side-effects more the once. */ + narg = builtin_save_expr (arg); + if (narg != arg) + { + arg = narg; + arglist = build_tree_list (NULL_TREE, arg); + exp = build_function_call_expr (fndecl, arglist); + } + + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + start_sequence (); + + /* Compute into TARGET. + Set TARGET to wherever the result comes back. */ + target = expand_unop (mode, builtin_optab, op0, target, 0); + + if (target != 0) + { + /* Output the entire sequence. */ + insns = get_insns (); + end_sequence (); + emit_insn (insns); + return target; + } + + /* If we were unable to expand via the builtin, stop the sequence + (without outputting the insns). */ + end_sequence (); + } + + /* Fall back to floating point rounding optab. */ + fallback_fndecl = mathfn_built_in (TREE_TYPE (arg), fallback_fn); + /* We shouldn't get here on targets without TARGET_C99_FUNCTIONS. + ??? Perhaps convert (int)floorf(x) into (int)floor((double)x). */ + gcc_assert (fallback_fndecl != NULL_TREE); + exp = build_function_call_expr (fallback_fndecl, arglist); + + tmp = expand_normal (exp); + + /* Truncate the result of floating point optab to integer + via expand_fix (). */ + target = gen_reg_rtx (mode); + expand_fix (target, tmp, 0); + + return target; +} + /* To evaluate powi(x,n), the floating point value x raised to the constant integer exponent n, we use a hybrid algorithm that combines the "window method" with look-up tables. For an @@ -1905,7 +2322,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget) multiplications to inline before calling the system library's pow function. powi(x,n) requires at worst 2*bits(n)-2 multiplications, so this default never requires calling pow, powf or powl. */ - + #ifndef POWI_MAX_MULTS #define POWI_MAX_MULTS (2*HOST_BITS_PER_WIDE_INT-2) #endif @@ -2022,7 +2439,7 @@ powi_cost (HOST_WIDE_INT n) result++; } } - + return result + powi_lookup_cost (val, cache); } @@ -2040,7 +2457,7 @@ expand_powi_1 (enum machine_mode mode, unsigned HOST_WIDE_INT n, rtx *cache) if (n < POWI_TABLE_SIZE) { if (cache[n]) - return cache[n]; + return cache[n]; target = gen_reg_rtx (mode); cache[n] = target; @@ -2071,7 +2488,7 @@ expand_powi_1 (enum machine_mode mode, unsigned HOST_WIDE_INT n, rtx *cache) /* Expand the RTL to evaluate powi(x,n) in mode MODE. X is the floating point operand in mode MODE, and N is the exponent. This function needs to be kept in sync with powi_cost above. */ - + static rtx expand_powi (rtx x, enum machine_mode mode, HOST_WIDE_INT n) { @@ -2141,7 +2558,74 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget) } } } - return expand_builtin_mathfn_2 (exp, target, NULL_RTX); + + if (! flag_unsafe_math_optimizations) + return NULL_RTX; + return expand_builtin_mathfn_2 (exp, target, subtarget); +} + +/* Expand a call to the powi built-in mathematical function. Return 0 if + a normal call should be emitted rather than expanding the function + in-line. EXP is the expression that is a call to the builtin + function; if convenient, the result should be placed in TARGET. */ + +static rtx +expand_builtin_powi (tree exp, rtx target, rtx subtarget) +{ + tree arglist = TREE_OPERAND (exp, 1); + tree arg0, arg1; + rtx op0, op1; + enum machine_mode mode; + enum machine_mode mode2; + + if (! validate_arglist (arglist, REAL_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + mode = TYPE_MODE (TREE_TYPE (exp)); + + /* Handle constant power. */ + + if (TREE_CODE (arg1) == INTEGER_CST + && ! TREE_CONSTANT_OVERFLOW (arg1)) + { + HOST_WIDE_INT n = TREE_INT_CST_LOW (arg1); + + /* If the exponent is -1, 0, 1 or 2, then expand_powi is exact. + Otherwise, check the number of multiplications required. */ + if ((TREE_INT_CST_HIGH (arg1) == 0 + || TREE_INT_CST_HIGH (arg1) == -1) + && ((n >= -1 && n <= 2) + || (! optimize_size + && powi_cost (n) <= POWI_MAX_MULTS))) + { + op0 = expand_expr (arg0, subtarget, VOIDmode, 0); + op0 = force_reg (mode, op0); + return expand_powi (op0, mode, n); + } + } + + /* Emit a libcall to libgcc. */ + + /* Mode of the 2nd argument must match that of an int. */ + mode2 = mode_for_size (INT_TYPE_SIZE, MODE_INT, 0); + + if (target == NULL_RTX) + target = gen_reg_rtx (mode); + + op0 = expand_expr (arg0, subtarget, mode, 0); + if (GET_MODE (op0) != mode) + op0 = convert_to_mode (mode, op0, 0); + op1 = expand_expr (arg1, 0, mode2, 0); + if (GET_MODE (op1) != mode2) + op1 = convert_to_mode (mode2, op1, 0); + + target = emit_library_call_value (powi_optab->handlers[(int) mode].libfunc, + target, LCT_CONST_MAKE_BLOCK, mode, 2, + op0, mode, op1, mode2); + + return target; } /* Expand expression EXP which is a call to the strlen builtin. Return 0 @@ -2201,7 +2685,7 @@ expand_builtin_strlen (tree arglist, rtx target, /* Make a place to write the result of the instruction. */ result = target; if (! (result != 0 - && GET_CODE (result) == REG + && REG_P (result) && GET_MODE (result) == insn_mode && REGNO (result) >= FIRST_PSEUDO_REGISTER)) result = gen_reg_rtx (insn_mode); @@ -2229,8 +2713,7 @@ expand_builtin_strlen (tree arglist, rtx target, /* Now that we are assured of success, expand the source. */ start_sequence (); - pat = memory_address (BLKmode, - expand_expr (src, src_reg, ptr_mode, EXPAND_SUM)); + pat = expand_expr (src, src_reg, ptr_mode, EXPAND_NORMAL); if (pat != src_reg) emit_move_insn (src_reg, pat); pat = get_insns (); @@ -2258,53 +2741,15 @@ expand_builtin_strlen (tree arglist, rtx target, in TARGET, if convenient (and in mode MODE if that's convenient). */ static rtx -expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strstr (tree arglist, tree type, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - tree fn; - const char *p1, *p2; - - p2 = c_getstr (s2); - if (p2 == NULL) - return 0; - - p1 = c_getstr (s1); - if (p1 != NULL) - { - const char *r = strstr (p1, p2); - - if (r == NULL) - return const0_rtx; - - /* Return an offset into the constant string argument. */ - return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, convert (TREE_TYPE (s1), - ssize_int (r - p1)))), - target, mode, EXPAND_NORMAL); - } - - if (p2[0] == '\0') - return expand_expr (s1, target, mode, EXPAND_NORMAL); - - if (p2[1] != '\0') - return 0; - - fn = implicit_built_in_decls[BUILT_IN_STRCHR]; - if (!fn) - return 0; - - /* New argument list transforming strstr(s1, s2) to - strchr(s1, s2[0]). */ - arglist = - build_tree_list (NULL_TREE, build_int_2 (p2[0], 0)); - arglist = tree_cons (NULL_TREE, s1, arglist); - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + tree result = fold_builtin_strstr (arglist, type); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Expand a call to the strchr builtin. Return 0 if we failed the @@ -2312,43 +2757,17 @@ expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode) in TARGET, if convenient (and in mode MODE if that's convenient). */ static rtx -expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strchr (tree arglist, tree type, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - const char *p1; + tree result = fold_builtin_strchr (arglist, type); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); - if (TREE_CODE (s2) != INTEGER_CST) - return 0; - - p1 = c_getstr (s1); - if (p1 != NULL) - { - char c; - const char *r; - - if (target_char_cast (s2, &c)) - return 0; - - r = strchr (p1, c); - - if (r == NULL) - return const0_rtx; - - /* Return an offset into the constant string argument. */ - return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, convert (TREE_TYPE (s1), - ssize_int (r - p1)))), - target, mode, EXPAND_NORMAL); - } - - /* FIXME: Should use here strchrM optab so that ports can optimize - this. */ - return 0; + /* FIXME: Should use strchrM optab so that ports can optimize this. */ } + return 0; } /* Expand a call to the strrchr builtin. Return 0 if we failed the @@ -2356,51 +2775,15 @@ expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode) in TARGET, if convenient (and in mode MODE if that's convenient). */ static rtx -expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strrchr (tree arglist, tree type, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - tree fn; - const char *p1; - - if (TREE_CODE (s2) != INTEGER_CST) - return 0; - - p1 = c_getstr (s1); - if (p1 != NULL) - { - char c; - const char *r; - - if (target_char_cast (s2, &c)) - return 0; - - r = strrchr (p1, c); - - if (r == NULL) - return const0_rtx; - - /* Return an offset into the constant string argument. */ - return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, convert (TREE_TYPE (s1), - ssize_int (r - p1)))), - target, mode, EXPAND_NORMAL); - } - - if (! integer_zerop (s2)) - return 0; - - fn = implicit_built_in_decls[BUILT_IN_STRCHR]; - if (!fn) - return 0; - - /* Transform strrchr(s1, '\0') to strchr(s1, '\0'). */ - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + tree result = fold_builtin_strrchr (arglist, type); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Expand a call to the strpbrk builtin. Return 0 if we failed the @@ -2408,59 +2791,15 @@ expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode) in TARGET, if convenient (and in mode MODE if that's convenient). */ static rtx -expand_builtin_strpbrk (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strpbrk (tree arglist, tree type, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - tree fn; - const char *p1, *p2; - - p2 = c_getstr (s2); - if (p2 == NULL) - return 0; - - p1 = c_getstr (s1); - if (p1 != NULL) - { - const char *r = strpbrk (p1, p2); - - if (r == NULL) - return const0_rtx; - - /* Return an offset into the constant string argument. */ - return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1), - s1, convert (TREE_TYPE (s1), - ssize_int (r - p1)))), - target, mode, EXPAND_NORMAL); - } - - if (p2[0] == '\0') - { - /* strpbrk(x, "") == NULL. - Evaluate and ignore the arguments in case they had - side-effects. */ - expand_expr (s1, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - - if (p2[1] != '\0') - return 0; /* Really call strpbrk. */ - - fn = implicit_built_in_decls[BUILT_IN_STRCHR]; - if (!fn) - return 0; - - /* New argument list transforming strpbrk(s1, s2) to - strchr(s1, s2[0]). */ - arglist = - build_tree_list (NULL_TREE, build_int_2 (p2[0], 0)); - arglist = tree_cons (NULL_TREE, s1, arglist); - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + tree result = fold_builtin_strpbrk (arglist, type); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) @@ -2473,10 +2812,9 @@ builtin_memcpy_read_str (void *data, HOST_WIDE_INT offset, { const char *str = (const char *) data; - if (offset < 0 - || ((unsigned HOST_WIDE_INT) offset + GET_MODE_SIZE (mode) - > strlen (str) + 1)) - abort (); /* Attempt to read past the end of constant string. */ + gcc_assert (offset >= 0 + && ((unsigned HOST_WIDE_INT) offset + GET_MODE_SIZE (mode) + <= strlen (str) + 1)); return c_readstr (str + offset, mode); } @@ -2486,8 +2824,10 @@ builtin_memcpy_read_str (void *data, HOST_WIDE_INT offset, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient). */ static rtx -expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode) { + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; @@ -2501,35 +2841,32 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) unsigned int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); rtx dest_mem, src_mem, dest_addr, len_rtx; + tree result = fold_builtin_memory_op (arglist, TREE_TYPE (TREE_TYPE (fndecl)), + false, /*endp=*/0); + + if (result) + { + while (TREE_CODE (result) == COMPOUND_EXPR) + { + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); + } + return expand_expr (result, target, mode, EXPAND_NORMAL); + } /* If DEST is not a pointer type, call the normal function. */ if (dest_align == 0) return 0; - /* If the LEN parameter is zero, return DEST. */ - if (integer_zerop (len)) - { - /* Evaluate and ignore SRC in case it has side-effects. */ - expand_expr (src, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); - } - - /* If SRC and DEST are the same (and not volatile), return DEST. */ - if (operand_equal_p (src, dest, 0)) - { - /* Evaluate and ignore LEN in case it has side-effects. */ - expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); - } - /* If either SRC is not a pointer type, don't do this - operation in-line. */ + operation in-line. */ if (src_align == 0) return 0; - dest_mem = get_memory_rtx (dest); + dest_mem = get_memory_rtx (dest, len); set_mem_align (dest_mem, dest_align); - len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); + len_rtx = expand_normal (len); src_str = c_getstr (src); /* If SRC is a string constant and block move would be done @@ -2549,12 +2886,13 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) return dest_mem; } - src_mem = get_memory_rtx (src); + src_mem = get_memory_rtx (src, len); set_mem_align (src_mem, src_align); /* Copy word part most expediently. */ dest_addr = emit_block_move (dest_mem, src_mem, len_rtx, - BLOCK_OP_NORMAL); + CALL_EXPR_TAILCALL (exp) + ? BLOCK_OP_TAILCALL : BLOCK_OP_NORMAL); if (dest_addr == 0) { @@ -2566,7 +2904,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) } /* Expand a call to the mempcpy builtin, with arguments in ARGLIST. - Return 0 if we failed the caller should emit a normal call, + Return 0 if we failed; the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient). If ENDP is 0 return the destination pointer, if ENDP is 1 return the end pointer ala @@ -2574,7 +2912,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) stpcpy. */ static rtx -expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, +expand_builtin_mempcpy (tree arglist, tree type, rtx target, enum machine_mode mode, int endp) { if (!validate_arglist (arglist, @@ -2601,49 +2939,29 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, unsigned int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); rtx dest_mem, src_mem, len_rtx; + tree result = fold_builtin_memory_op (arglist, type, false, endp); - /* If DEST is not a pointer type, call the normal function. */ - if (dest_align == 0) - return 0; - - /* If SRC and DEST are the same (and not volatile), do nothing. */ - if (operand_equal_p (src, dest, 0)) + if (result) { - tree expr; - - if (endp == 0) + while (TREE_CODE (result) == COMPOUND_EXPR) { - /* Evaluate and ignore LEN in case it has side-effects. */ - expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); } - - if (endp == 2) - len = fold (build (MINUS_EXPR, TREE_TYPE (len), dest, - integer_one_node)); - len = convert (TREE_TYPE (dest), len); - expr = fold (build (PLUS_EXPR, TREE_TYPE (dest), dest, len)); - return expand_expr (expr, target, mode, EXPAND_NORMAL); + return expand_expr (result, target, mode, EXPAND_NORMAL); } + /* If either SRC or DEST is not a pointer type, don't do this + operation in-line. */ + if (dest_align == 0 || src_align == 0) + return 0; + /* If LEN is not constant, call the normal function. */ if (! host_integerp (len, 1)) return 0; - - /* If the LEN parameter is zero, return DEST. */ - if (tree_low_cst (len, 1) == 0) - { - /* Evaluate and ignore SRC in case it has side-effects. */ - expand_expr (src, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); - } - /* If either SRC is not a pointer type, don't do this - operation in-line. */ - if (src_align == 0) - return 0; - - len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); + len_rtx = expand_normal (len); src_str = c_getstr (src); /* If SRC is a string constant and block move would be done @@ -2655,7 +2973,7 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, && can_store_by_pieces (INTVAL (len_rtx), builtin_memcpy_read_str, (void *) src_str, dest_align)) { - dest_mem = get_memory_rtx (dest); + dest_mem = get_memory_rtx (dest, len); set_mem_align (dest_mem, dest_align); dest_mem = store_by_pieces (dest_mem, INTVAL (len_rtx), builtin_memcpy_read_str, @@ -2669,9 +2987,9 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, && can_move_by_pieces (INTVAL (len_rtx), MIN (dest_align, src_align))) { - dest_mem = get_memory_rtx (dest); + dest_mem = get_memory_rtx (dest, len); set_mem_align (dest_mem, dest_align); - src_mem = get_memory_rtx (src); + src_mem = get_memory_rtx (src, len); set_mem_align (src_mem, src_align); dest_mem = move_by_pieces (dest_mem, src_mem, INTVAL (len_rtx), MIN (dest_align, src_align), endp); @@ -2685,10 +3003,11 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, } /* Expand expression EXP, which is a call to the memmove builtin. Return 0 - if we failed the caller should emit a normal call. */ + if we failed; the caller should emit a normal call. */ static rtx -expand_builtin_memmove (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_memmove (tree arglist, tree type, rtx target, + enum machine_mode mode, tree orig_exp) { if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -2702,41 +3021,49 @@ expand_builtin_memmove (tree arglist, rtx target, enum machine_mode mode) unsigned int src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); unsigned int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); + tree result = fold_builtin_memory_op (arglist, type, false, /*endp=*/3); + + if (result) + { + while (TREE_CODE (result) == COMPOUND_EXPR) + { + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); + } + return expand_expr (result, target, mode, EXPAND_NORMAL); + } /* If DEST is not a pointer type, call the normal function. */ if (dest_align == 0) return 0; - /* If the LEN parameter is zero, return DEST. */ - if (integer_zerop (len)) - { - /* Evaluate and ignore SRC in case it has side-effects. */ - expand_expr (src, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); - } - - /* If SRC and DEST are the same (and not volatile), return DEST. */ - if (operand_equal_p (src, dest, 0)) - { - /* Evaluate and ignore LEN in case it has side-effects. */ - expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dest, target, mode, EXPAND_NORMAL); - } - /* If either SRC is not a pointer type, don't do this - operation in-line. */ + operation in-line. */ if (src_align == 0) return 0; /* If src is categorized for a readonly section we can use normal memcpy. */ if (readonly_data_expr (src)) - { - tree const fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; + { + tree fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (orig_exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); + } + + /* If length is 1 and we can expand memcpy call inline, + it is ok to use memcpy as well. */ + if (integer_onep (len)) + { + rtx ret = expand_builtin_mempcpy (arglist, type, target, mode, + /*endp=*/0); + if (ret) + return ret; } /* Otherwise, call the normal function. */ @@ -2748,8 +3075,10 @@ expand_builtin_memmove (tree arglist, rtx target, enum machine_mode mode) if we failed the caller should emit a normal call. */ static rtx -expand_builtin_bcopy (tree arglist) +expand_builtin_bcopy (tree exp) { + tree arglist = TREE_OPERAND (exp, 1); + tree type = TREE_TYPE (exp); tree src, dest, size, newarglist; if (!validate_arglist (arglist, @@ -2765,11 +3094,78 @@ expand_builtin_bcopy (tree arglist) so that if it isn't expanded inline, we fallback to calling bcopy instead of memmove. */ - newarglist = build_tree_list (NULL_TREE, convert (sizetype, size)); + newarglist = build_tree_list (NULL_TREE, fold_convert (sizetype, size)); newarglist = tree_cons (NULL_TREE, src, newarglist); newarglist = tree_cons (NULL_TREE, dest, newarglist); - return expand_builtin_memmove (newarglist, const0_rtx, VOIDmode); + return expand_builtin_memmove (newarglist, type, const0_rtx, VOIDmode, exp); +} + +#ifndef HAVE_movstr +# define HAVE_movstr 0 +# define CODE_FOR_movstr CODE_FOR_nothing +#endif + +/* Expand into a movstr instruction, if one is available. Return 0 if + we failed, the caller should emit a normal call, otherwise try to + get the result in TARGET, if convenient. If ENDP is 0 return the + destination pointer, if ENDP is 1 return the end pointer ala + mempcpy, and if ENDP is 2 return the end pointer minus one ala + stpcpy. */ + +static rtx +expand_movstr (tree dest, tree src, rtx target, int endp) +{ + rtx end; + rtx dest_mem; + rtx src_mem; + rtx insn; + const struct insn_data * data; + + if (!HAVE_movstr) + return 0; + + dest_mem = get_memory_rtx (dest, NULL); + src_mem = get_memory_rtx (src, NULL); + if (!endp) + { + target = force_reg (Pmode, XEXP (dest_mem, 0)); + dest_mem = replace_equiv_address (dest_mem, target); + end = gen_reg_rtx (Pmode); + } + else + { + if (target == 0 || target == const0_rtx) + { + end = gen_reg_rtx (Pmode); + if (target == 0) + target = end; + } + else + end = target; + } + + data = insn_data + CODE_FOR_movstr; + + if (data->operand[0].mode != VOIDmode) + end = gen_lowpart (data->operand[0].mode, end); + + insn = data->genfun (end, dest_mem, src_mem); + + gcc_assert (insn); + + emit_insn (insn); + + /* movstr is supposed to set end to the address of the NUL + terminator. If the caller requested a mempcpy-like return value, + adjust it. */ + if (endp == 1 && target != const0_rtx) + { + rtx tem = plus_constant (gen_lowpart (GET_MODE (target), end), 1); + emit_move_insn (target, force_operand (tem, NULL_RTX)); + } + + return target; } /* Expand expression EXP, which is a call to the strcpy builtin. Return 0 @@ -2778,34 +3174,27 @@ expand_builtin_bcopy (tree arglist) convenient). */ static rtx -expand_builtin_strcpy (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strcpy (tree fndecl, tree arglist, rtx target, enum machine_mode mode) { - tree fn, len, src, dst; + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + { + tree result = fold_builtin_strcpy (fndecl, arglist, 0); + if (result) + { + while (TREE_CODE (result) == COMPOUND_EXPR) + { + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); + } + return expand_expr (result, target, mode, EXPAND_NORMAL); + } - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - - src = TREE_VALUE (TREE_CHAIN (arglist)); - dst = TREE_VALUE (arglist); - - /* If SRC and DST are equal (and not volatile), return DST. */ - if (operand_equal_p (src, dst, 0)) - return expand_expr (dst, target, mode, EXPAND_NORMAL); - - fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; - if (!fn) - return 0; - - len = c_strlen (src, 1); - if (len == 0 || TREE_SIDE_EFFECTS (len)) - return 0; - - len = size_binop (PLUS_EXPR, len, ssize_int (1)); - arglist = build_tree_list (NULL_TREE, len); - arglist = tree_cons (NULL_TREE, src, arglist); - arglist = tree_cons (NULL_TREE, dst, arglist); - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + return expand_movstr (TREE_VALUE (arglist), + TREE_VALUE (TREE_CHAIN (arglist)), + target, /*endp=*/0); + } + return 0; } /* Expand a call to the stpcpy builtin, with arguments in ARGLIST. @@ -2814,39 +3203,82 @@ expand_builtin_strcpy (tree arglist, rtx target, enum machine_mode mode) mode MODE if that's convenient). */ static rtx -expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_stpcpy (tree exp, rtx target, enum machine_mode mode) { + tree arglist = TREE_OPERAND (exp, 1); + /* If return value is ignored, transform stpcpy into strcpy. */ + if (target == const0_rtx) + { + tree fn = implicit_built_in_decls[BUILT_IN_STRCPY]; + if (!fn) + return 0; + + return expand_expr (build_function_call_expr (fn, arglist), + target, mode, EXPAND_NORMAL); + } + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) return 0; else { - tree dst, src, len; - - /* If return value is ignored, transform stpcpy into strcpy. */ - if (target == const0_rtx) - { - tree fn = implicit_built_in_decls[BUILT_IN_STRCPY]; - if (!fn) - return 0; - - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); - } + tree dst, src, len, lenp1; + tree narglist; + rtx ret; /* Ensure we get an actual string whose length can be evaluated at - compile-time, not an expression containing a string. This is - because the latter will potentially produce pessimized code - when used to produce the return value. */ + compile-time, not an expression containing a string. This is + because the latter will potentially produce pessimized code + when used to produce the return value. */ src = TREE_VALUE (TREE_CHAIN (arglist)); if (! c_getstr (src) || ! (len = c_strlen (src, 0))) - return 0; + return expand_movstr (TREE_VALUE (arglist), + TREE_VALUE (TREE_CHAIN (arglist)), + target, /*endp=*/2); dst = TREE_VALUE (arglist); - len = fold (size_binop (PLUS_EXPR, len, ssize_int (1))); - arglist = build_tree_list (NULL_TREE, len); - arglist = tree_cons (NULL_TREE, src, arglist); - arglist = tree_cons (NULL_TREE, dst, arglist); - return expand_builtin_mempcpy (arglist, target, mode, /*endp=*/2); + lenp1 = size_binop (PLUS_EXPR, len, ssize_int (1)); + narglist = build_tree_list (NULL_TREE, lenp1); + narglist = tree_cons (NULL_TREE, src, narglist); + narglist = tree_cons (NULL_TREE, dst, narglist); + ret = expand_builtin_mempcpy (narglist, TREE_TYPE (exp), + target, mode, /*endp=*/2); + + if (ret) + return ret; + + if (TREE_CODE (len) == INTEGER_CST) + { + rtx len_rtx = expand_normal (len); + + if (GET_CODE (len_rtx) == CONST_INT) + { + ret = expand_builtin_strcpy (get_callee_fndecl (exp), + arglist, target, mode); + + if (ret) + { + if (! target) + { + if (mode != VOIDmode) + target = gen_reg_rtx (mode); + else + target = gen_reg_rtx (GET_MODE (ret)); + } + if (GET_MODE (target) != GET_MODE (ret)) + ret = gen_lowpart (GET_MODE (target), ret); + + ret = plus_constant (ret, INTVAL (len_rtx)); + ret = emit_move_insn (target, force_operand (ret, NULL_RTX)); + gcc_assert (ret); + + return target; + } + } + } + + return expand_movstr (TREE_VALUE (arglist), + TREE_VALUE (TREE_CHAIN (arglist)), + target, /*endp=*/2); } } @@ -2870,41 +3302,36 @@ builtin_strncpy_read_str (void *data, HOST_WIDE_INT offset, if we failed the caller should emit a normal call. */ static rtx -expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strncpy (tree exp, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - return 0; - else + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); + if (validate_arglist (arglist, + POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { tree slen = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)), 1); tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - tree fn; + tree result = fold_builtin_strncpy (fndecl, arglist, slen); - /* We must be passed a constant len parameter. */ - if (TREE_CODE (len) != INTEGER_CST) - return 0; - - /* If the len parameter is zero, return the dst parameter. */ - if (integer_zerop (len)) + if (result) { - /* Evaluate and ignore the src argument in case it has - side-effects. */ - expand_expr (TREE_VALUE (TREE_CHAIN (arglist)), const0_rtx, - VOIDmode, EXPAND_NORMAL); - /* Return the dst parameter. */ - return expand_expr (TREE_VALUE (arglist), target, mode, - EXPAND_NORMAL); + while (TREE_CODE (result) == COMPOUND_EXPR) + { + expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode, + EXPAND_NORMAL); + result = TREE_OPERAND (result, 1); + } + return expand_expr (result, target, mode, EXPAND_NORMAL); } - /* Now, we must be passed a constant src ptr parameter. */ - if (slen == 0 || TREE_CODE (slen) != INTEGER_CST) + /* We must be passed a constant len and src parameter. */ + if (!host_integerp (len, 1) || !slen || !host_integerp (slen, 1)) return 0; slen = size_binop (PLUS_EXPR, slen, ssize_int (1)); /* We're required to pad with trailing zeros if the requested - len is greater than strlen(s2)+1. In that case try to + len is greater than strlen(s2)+1. In that case try to use store_by_pieces, if it fails, punt. */ if (tree_int_cst_lt (slen, len)) { @@ -2920,7 +3347,7 @@ expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode) (void *) p, dest_align)) return 0; - dest_mem = get_memory_rtx (dest); + dest_mem = get_memory_rtx (dest, len); store_by_pieces (dest_mem, tree_low_cst (len, 1), builtin_strncpy_read_str, (void *) p, dest_align, 0); @@ -2928,14 +3355,8 @@ expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode) dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } - - /* OK transform into builtin memcpy. */ - fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; - if (!fn) - return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); } + return 0; } /* Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) @@ -2986,7 +3407,8 @@ builtin_memset_gen_str (void *data, HOST_WIDE_INT offset ATTRIBUTE_UNUSED, convenient). */ static rtx -expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode, + tree orig_exp) { if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -2996,12 +3418,14 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) tree dest = TREE_VALUE (arglist); tree val = TREE_VALUE (TREE_CHAIN (arglist)); tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + tree fndecl, fn; + enum built_in_function fcode; char c; - - unsigned int dest_align - = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); + unsigned int dest_align; rtx dest_mem, dest_addr, len_rtx; + dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); + /* If DEST is not a pointer type, don't do this operation in-line. */ if (dest_align == 0) @@ -3015,64 +3439,69 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) return expand_expr (dest, target, mode, EXPAND_NORMAL); } + /* Stabilize the arguments in case we fail. */ + dest = builtin_save_expr (dest); + val = builtin_save_expr (val); + len = builtin_save_expr (len); + + len_rtx = expand_normal (len); + dest_mem = get_memory_rtx (dest, len); + if (TREE_CODE (val) != INTEGER_CST) { rtx val_rtx; - if (!host_integerp (len, 1)) - return 0; - - if (optimize_size && tree_low_cst (len, 1) > 1) - return 0; + val_rtx = expand_normal (val); + val_rtx = convert_to_mode (TYPE_MODE (unsigned_char_type_node), + val_rtx, 0); /* Assume that we can memset by pieces if we can store the * the coefficients by pieces (in the required modes). * We can't pass builtin_memset_gen_str as that emits RTL. */ c = 1; - if (!can_store_by_pieces (tree_low_cst (len, 1), - builtin_memset_read_str, - &c, dest_align)) - return 0; + if (host_integerp (len, 1) + && !(optimize_size && tree_low_cst (len, 1) > 1) + && can_store_by_pieces (tree_low_cst (len, 1), + builtin_memset_read_str, &c, dest_align)) + { + val_rtx = force_reg (TYPE_MODE (unsigned_char_type_node), + val_rtx); + store_by_pieces (dest_mem, tree_low_cst (len, 1), + builtin_memset_gen_str, val_rtx, dest_align, 0); + } + else if (!set_storage_via_setmem (dest_mem, len_rtx, val_rtx, + dest_align)) + goto do_libcall; - val = fold (build1 (CONVERT_EXPR, unsigned_char_type_node, val)); - val_rtx = expand_expr (val, NULL_RTX, VOIDmode, 0); - val_rtx = force_reg (TYPE_MODE (unsigned_char_type_node), - val_rtx); - dest_mem = get_memory_rtx (dest); - store_by_pieces (dest_mem, tree_low_cst (len, 1), - builtin_memset_gen_str, - val_rtx, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } if (target_char_cast (val, &c)) - return 0; + goto do_libcall; if (c) { - if (!host_integerp (len, 1)) - return 0; - if (!can_store_by_pieces (tree_low_cst (len, 1), - builtin_memset_read_str, &c, - dest_align)) - return 0; + if (host_integerp (len, 1) + && !(optimize_size && tree_low_cst (len, 1) > 1) + && can_store_by_pieces (tree_low_cst (len, 1), + builtin_memset_read_str, &c, dest_align)) + store_by_pieces (dest_mem, tree_low_cst (len, 1), + builtin_memset_read_str, &c, dest_align, 0); + else if (!set_storage_via_setmem (dest_mem, len_rtx, GEN_INT (c), + dest_align)) + goto do_libcall; - dest_mem = get_memory_rtx (dest); - store_by_pieces (dest_mem, tree_low_cst (len, 1), - builtin_memset_read_str, - &c, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } - len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); - - dest_mem = get_memory_rtx (dest); set_mem_align (dest_mem, dest_align); - dest_addr = clear_storage (dest_mem, len_rtx); + dest_addr = clear_storage (dest_mem, len_rtx, + CALL_EXPR_TAILCALL (orig_exp) + ? BLOCK_OP_TAILCALL : BLOCK_OP_NORMAL); if (dest_addr == 0) { @@ -3081,6 +3510,19 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) } return dest_addr; + + do_libcall: + fndecl = get_callee_fndecl (orig_exp); + fcode = DECL_FUNCTION_CODE (fndecl); + gcc_assert (fcode == BUILT_IN_MEMSET || fcode == BUILT_IN_BZERO); + arglist = build_tree_list (NULL_TREE, len); + if (fcode == BUILT_IN_MEMSET) + arglist = tree_cons (NULL_TREE, val, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + fn = build_function_call_expr (fndecl, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (orig_exp); + return expand_call (fn, target, target == const0_rtx); } } @@ -3088,8 +3530,9 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) if we failed the caller should emit a normal call. */ static rtx -expand_builtin_bzero (tree arglist) +expand_builtin_bzero (tree exp) { + tree arglist = TREE_OPERAND (exp, 1); tree dest, size, newarglist; if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -3103,11 +3546,11 @@ expand_builtin_bzero (tree arglist) so that if it isn't expanded inline, we fallback to calling bzero instead of memset. */ - newarglist = build_tree_list (NULL_TREE, convert (sizetype, size)); + newarglist = build_tree_list (NULL_TREE, fold_convert (sizetype, size)); newarglist = tree_cons (NULL_TREE, integer_zero_node, newarglist); newarglist = tree_cons (NULL_TREE, dest, newarglist); - return expand_builtin_memset (newarglist, const0_rtx, VOIDmode); + return expand_builtin_memset (newarglist, const0_rtx, VOIDmode, exp); } /* Expand expression EXP, which is a call to the memcmp built-in function. @@ -3119,69 +3562,21 @@ static rtx expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target, enum machine_mode mode) { - tree arg1, arg2, len; - const char *p1, *p2; - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; - - arg1 = TREE_VALUE (arglist); - arg2 = TREE_VALUE (TREE_CHAIN (arglist)); - len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - - /* If the len parameter is zero, return zero. */ - if (integer_zerop (len)) + else { - /* Evaluate and ignore arg1 and arg2 in case they have - side-effects. */ - expand_expr (arg1, const0_rtx, VOIDmode, EXPAND_NORMAL); - expand_expr (arg2, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; + tree result = fold_builtin_memcmp (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } - /* If both arguments are equal (and not volatile), return zero. */ - if (operand_equal_p (arg1, arg2, 0)) - { - /* Evaluate and ignore len in case it has side-effects. */ - expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - - p1 = c_getstr (arg1); - p2 = c_getstr (arg2); - - /* If all arguments are constant, and the value of len is not greater - than the lengths of arg1 and arg2, evaluate at compile-time. */ - if (host_integerp (len, 1) && p1 && p2 - && compare_tree_int (len, strlen (p1) + 1) <= 0 - && compare_tree_int (len, strlen (p2) + 1) <= 0) - { - const int r = memcmp (p1, p2, tree_low_cst (len, 1)); - - return (r < 0 ? constm1_rtx : (r > 0 ? const1_rtx : const0_rtx)); - } - - /* If len parameter is one, return an expression corresponding to - (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ - if (integer_onep (len)) - { - tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); - tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node); - tree ind1 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg1)))); - tree ind2 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg2)))); - tree result = fold (build (MINUS_EXPR, integer_type_node, ind1, ind2)); - return expand_expr (result, target, mode, EXPAND_NORMAL); - } - -#if defined HAVE_cmpmemsi || defined HAVE_cmpstrsi +#if defined HAVE_cmpmemsi || defined HAVE_cmpstrnsi { + tree arg1 = TREE_VALUE (arglist); + tree arg2 = TREE_VALUE (TREE_CHAIN (arglist)); + tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); rtx arg1_rtx, arg2_rtx, arg3_rtx; rtx result; rtx insn; @@ -3197,12 +3592,12 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target, insn_mode = insn_data[(int) CODE_FOR_cmpmemsi].operand[0].mode; else #endif -#ifdef HAVE_cmpstrsi - if (HAVE_cmpstrsi) - insn_mode = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode; +#ifdef HAVE_cmpstrnsi + if (HAVE_cmpstrnsi) + insn_mode = insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode; else #endif - return 0; + return 0; /* If we don't have POINTER_TYPE, call the function. */ if (arg1_align == 0 || arg2_align == 0) @@ -3211,26 +3606,34 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target, /* Make a place to write the result of the instruction. */ result = target; if (! (result != 0 - && GET_CODE (result) == REG && GET_MODE (result) == insn_mode + && REG_P (result) && GET_MODE (result) == insn_mode && REGNO (result) >= FIRST_PSEUDO_REGISTER)) result = gen_reg_rtx (insn_mode); - arg1_rtx = get_memory_rtx (arg1); - arg2_rtx = get_memory_rtx (arg2); - arg3_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); + arg1_rtx = get_memory_rtx (arg1, len); + arg2_rtx = get_memory_rtx (arg2, len); + arg3_rtx = expand_normal (len); + + /* Set MEM_SIZE as appropriate. */ + if (GET_CODE (arg3_rtx) == CONST_INT) + { + set_mem_size (arg1_rtx, arg3_rtx); + set_mem_size (arg2_rtx, arg3_rtx); + } + #ifdef HAVE_cmpmemsi if (HAVE_cmpmemsi) insn = gen_cmpmemsi (result, arg1_rtx, arg2_rtx, arg3_rtx, GEN_INT (MIN (arg1_align, arg2_align))); else #endif -#ifdef HAVE_cmpstrsi - if (HAVE_cmpstrsi) - insn = gen_cmpstrsi (result, arg1_rtx, arg2_rtx, arg3_rtx, - GEN_INT (MIN (arg1_align, arg2_align))); +#ifdef HAVE_cmpstrnsi + if (HAVE_cmpstrnsi) + insn = gen_cmpstrnsi (result, arg1_rtx, arg2_rtx, arg3_rtx, + GEN_INT (MIN (arg1_align, arg2_align))); else #endif - abort (); + gcc_unreachable (); if (insn) emit_insn (insn); @@ -3240,7 +3643,7 @@ expand_builtin_memcmp (tree exp ATTRIBUTE_UNUSED, tree arglist, rtx target, XEXP (arg1_rtx, 0), Pmode, XEXP (arg2_rtx, 0), Pmode, convert_to_mode (TYPE_MODE (sizetype), arg3_rtx, - TREE_UNSIGNED (sizetype)), + TYPE_UNSIGNED (sizetype)), TYPE_MODE (sizetype)); /* Return the value in the proper mode for this function. */ @@ -3268,139 +3671,146 @@ static rtx expand_builtin_strcmp (tree exp, rtx target, enum machine_mode mode) { tree arglist = TREE_OPERAND (exp, 1); - tree arg1, arg2; - const char *p1, *p2; if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) return 0; - - arg1 = TREE_VALUE (arglist); - arg2 = TREE_VALUE (TREE_CHAIN (arglist)); - - /* If both arguments are equal (and not volatile), return zero. */ - if (operand_equal_p (arg1, arg2, 0)) - return const0_rtx; - - p1 = c_getstr (arg1); - p2 = c_getstr (arg2); - - if (p1 && p2) + else { - const int i = strcmp (p1, p2); - return (i < 0 ? constm1_rtx : (i > 0 ? const1_rtx : const0_rtx)); + tree result = fold_builtin_strcmp (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } - /* If either arg is "", return an expression corresponding to - (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ - if ((p1 && *p1 == '\0') || (p2 && *p2 == '\0')) +#if defined HAVE_cmpstrsi || defined HAVE_cmpstrnsi + if (cmpstr_optab[SImode] != CODE_FOR_nothing + || cmpstrn_optab[SImode] != CODE_FOR_nothing) { - tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); - tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node); - tree ind1 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg1)))); - tree ind2 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg2)))); - tree result = fold (build (MINUS_EXPR, integer_type_node, ind1, ind2)); - return expand_expr (result, target, mode, EXPAND_NORMAL); - } + rtx arg1_rtx, arg2_rtx; + rtx result, insn = NULL_RTX; + tree fndecl, fn; + + tree arg1 = TREE_VALUE (arglist); + tree arg2 = TREE_VALUE (TREE_CHAIN (arglist)); + int arg1_align + = get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; + int arg2_align + = get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; + + /* If we don't have POINTER_TYPE, call the function. */ + if (arg1_align == 0 || arg2_align == 0) + return 0; + + /* Stabilize the arguments in case gen_cmpstr(n)si fail. */ + arg1 = builtin_save_expr (arg1); + arg2 = builtin_save_expr (arg2); + + arg1_rtx = get_memory_rtx (arg1, NULL); + arg2_rtx = get_memory_rtx (arg2, NULL); #ifdef HAVE_cmpstrsi - if (HAVE_cmpstrsi) - { - tree len, len1, len2; - rtx arg1_rtx, arg2_rtx, arg3_rtx; - rtx result, insn; - tree fndecl; + /* Try to call cmpstrsi. */ + if (HAVE_cmpstrsi) + { + enum machine_mode insn_mode + = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode; - int arg1_align - = get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; - int arg2_align - = get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; - enum machine_mode insn_mode - = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode; + /* Make a place to write the result of the instruction. */ + result = target; + if (! (result != 0 + && REG_P (result) && GET_MODE (result) == insn_mode + && REGNO (result) >= FIRST_PSEUDO_REGISTER)) + result = gen_reg_rtx (insn_mode); - len1 = c_strlen (arg1, 1); - len2 = c_strlen (arg2, 1); + insn = gen_cmpstrsi (result, arg1_rtx, arg2_rtx, + GEN_INT (MIN (arg1_align, arg2_align))); + } +#endif +#ifdef HAVE_cmpstrnsi + /* Try to determine at least one length and call cmpstrnsi. */ + if (!insn && HAVE_cmpstrnsi) + { + tree len; + rtx arg3_rtx; - if (len1) - len1 = size_binop (PLUS_EXPR, ssize_int (1), len1); - if (len2) - len2 = size_binop (PLUS_EXPR, ssize_int (1), len2); + enum machine_mode insn_mode + = insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode; + tree len1 = c_strlen (arg1, 1); + tree len2 = c_strlen (arg2, 1); - /* If we don't have a constant length for the first, use the length - of the second, if we know it. We don't require a constant for - this case; some cost analysis could be done if both are available - but neither is constant. For now, assume they're equally cheap, - unless one has side effects. If both strings have constant lengths, - use the smaller. */ + if (len1) + len1 = size_binop (PLUS_EXPR, ssize_int (1), len1); + if (len2) + len2 = size_binop (PLUS_EXPR, ssize_int (1), len2); - if (!len1) - len = len2; - else if (!len2) - len = len1; - else if (TREE_SIDE_EFFECTS (len1)) - len = len2; - else if (TREE_SIDE_EFFECTS (len2)) - len = len1; - else if (TREE_CODE (len1) != INTEGER_CST) - len = len2; - else if (TREE_CODE (len2) != INTEGER_CST) - len = len1; - else if (tree_int_cst_lt (len1, len2)) - len = len1; - else - len = len2; + /* If we don't have a constant length for the first, use the length + of the second, if we know it. We don't require a constant for + this case; some cost analysis could be done if both are available + but neither is constant. For now, assume they're equally cheap, + unless one has side effects. If both strings have constant lengths, + use the smaller. */ - /* If both arguments have side effects, we cannot optimize. */ - if (!len || TREE_SIDE_EFFECTS (len)) - return 0; + if (!len1) + len = len2; + else if (!len2) + len = len1; + else if (TREE_SIDE_EFFECTS (len1)) + len = len2; + else if (TREE_SIDE_EFFECTS (len2)) + len = len1; + else if (TREE_CODE (len1) != INTEGER_CST) + len = len2; + else if (TREE_CODE (len2) != INTEGER_CST) + len = len1; + else if (tree_int_cst_lt (len1, len2)) + len = len1; + else + len = len2; - /* If we don't have POINTER_TYPE, call the function. */ - if (arg1_align == 0 || arg2_align == 0) - return 0; + /* If both arguments have side effects, we cannot optimize. */ + if (!len || TREE_SIDE_EFFECTS (len)) + goto do_libcall; - /* Make a place to write the result of the instruction. */ - result = target; - if (! (result != 0 - && GET_CODE (result) == REG && GET_MODE (result) == insn_mode - && REGNO (result) >= FIRST_PSEUDO_REGISTER)) - result = gen_reg_rtx (insn_mode); + arg3_rtx = expand_normal (len); - /* Stabilize the arguments in case gen_cmpstrsi fails. */ - arg1 = save_expr (arg1); - arg2 = save_expr (arg2); + /* Make a place to write the result of the instruction. */ + result = target; + if (! (result != 0 + && REG_P (result) && GET_MODE (result) == insn_mode + && REGNO (result) >= FIRST_PSEUDO_REGISTER)) + result = gen_reg_rtx (insn_mode); - arg1_rtx = get_memory_rtx (arg1); - arg2_rtx = get_memory_rtx (arg2); - arg3_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); - insn = gen_cmpstrsi (result, arg1_rtx, arg2_rtx, arg3_rtx, - GEN_INT (MIN (arg1_align, arg2_align))); - if (insn) - { - emit_insn (insn); + insn = gen_cmpstrnsi (result, arg1_rtx, arg2_rtx, arg3_rtx, + GEN_INT (MIN (arg1_align, arg2_align))); + } +#endif - /* Return the value in the proper mode for this function. */ - mode = TYPE_MODE (TREE_TYPE (exp)); - if (GET_MODE (result) == mode) - return result; - if (target == 0) - return convert_to_mode (mode, result, 0); - convert_move (target, result, 0); - return target; - } + if (insn) + { + emit_insn (insn); - /* Expand the library call ourselves using a stabilized argument - list to avoid re-evaluating the function's arguments twice. */ - arglist = build_tree_list (NULL_TREE, arg2); - arglist = tree_cons (NULL_TREE, arg1, arglist); - fndecl = get_callee_fndecl (exp); - exp = build_function_call_expr (fndecl, arglist); - return expand_call (exp, target, target == const0_rtx); - } + /* Return the value in the proper mode for this function. */ + mode = TYPE_MODE (TREE_TYPE (exp)); + if (GET_MODE (result) == mode) + return result; + if (target == 0) + return convert_to_mode (mode, result, 0); + convert_move (target, result, 0); + return target; + } + + /* Expand the library call ourselves using a stabilized argument + list to avoid re-evaluating the function's arguments twice. */ +#ifdef HAVE_cmpstrnsi + do_libcall: +#endif + arglist = build_tree_list (NULL_TREE, arg2); + arglist = tree_cons (NULL_TREE, arg1, arglist); + fndecl = get_callee_fndecl (exp); + fn = build_function_call_expr (fndecl, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_call (fn, target, target == const0_rtx); + } #endif return 0; } @@ -3413,83 +3823,37 @@ static rtx expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) { tree arglist = TREE_OPERAND (exp, 1); - tree arg1, arg2, arg3; - const char *p1, *p2; if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; - - arg1 = TREE_VALUE (arglist); - arg2 = TREE_VALUE (TREE_CHAIN (arglist)); - arg3 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - - /* If the len parameter is zero, return zero. */ - if (integer_zerop (arg3)) + else { - /* Evaluate and ignore arg1 and arg2 in case they have - side-effects. */ - expand_expr (arg1, const0_rtx, VOIDmode, EXPAND_NORMAL); - expand_expr (arg2, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - - /* If arg1 and arg2 are equal (and not volatile), return zero. */ - if (operand_equal_p (arg1, arg2, 0)) - { - /* Evaluate and ignore arg3 in case it has side-effects. */ - expand_expr (arg3, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - - p1 = c_getstr (arg1); - p2 = c_getstr (arg2); - - /* If all arguments are constant, evaluate at compile-time. */ - if (host_integerp (arg3, 1) && p1 && p2) - { - const int r = strncmp (p1, p2, tree_low_cst (arg3, 1)); - return (r < 0 ? constm1_rtx : (r > 0 ? const1_rtx : const0_rtx)); - } - - /* If len == 1 or (either string parameter is "" and (len >= 1)), - return (*(const u_char*)arg1 - *(const u_char*)arg2). */ - if (host_integerp (arg3, 1) - && (tree_low_cst (arg3, 1) == 1 - || (tree_low_cst (arg3, 1) > 1 - && ((p1 && *p1 == '\0') || (p2 && *p2 == '\0'))))) - { - tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); - tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node); - tree ind1 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg1)))); - tree ind2 = - fold (build1 (CONVERT_EXPR, integer_type_node, - build1 (INDIRECT_REF, cst_uchar_node, - build1 (NOP_EXPR, cst_uchar_ptr_node, arg2)))); - tree result = fold (build (MINUS_EXPR, integer_type_node, ind1, ind2)); - return expand_expr (result, target, mode, EXPAND_NORMAL); + tree result = fold_builtin_strncmp (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } /* If c_strlen can determine an expression for one of the string - lengths, and it doesn't have side effects, then emit cmpstrsi + lengths, and it doesn't have side effects, then emit cmpstrnsi using length MIN(strlen(string)+1, arg3). */ -#ifdef HAVE_cmpstrsi - if (HAVE_cmpstrsi) +#ifdef HAVE_cmpstrnsi + if (HAVE_cmpstrnsi) { + tree arg1 = TREE_VALUE (arglist); + tree arg2 = TREE_VALUE (TREE_CHAIN (arglist)); + tree arg3 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); tree len, len1, len2; rtx arg1_rtx, arg2_rtx, arg3_rtx; rtx result, insn; - tree fndecl; + tree fndecl, fn; int arg1_align = get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; int arg2_align = get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; enum machine_mode insn_mode - = insn_data[(int) CODE_FOR_cmpstrsi].operand[0].mode; + = insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode; len1 = c_strlen (arg1, 1); len2 = c_strlen (arg2, 1); @@ -3528,7 +3892,8 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) return 0; /* The actual new length parameter is MIN(len,arg3). */ - len = fold (build (MIN_EXPR, TREE_TYPE (len), len, arg3)); + len = fold_build2 (MIN_EXPR, TREE_TYPE (len), len, + fold_convert (TREE_TYPE (len), arg3)); /* If we don't have POINTER_TYPE, call the function. */ if (arg1_align == 0 || arg2_align == 0) @@ -3537,20 +3902,20 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) /* Make a place to write the result of the instruction. */ result = target; if (! (result != 0 - && GET_CODE (result) == REG && GET_MODE (result) == insn_mode + && REG_P (result) && GET_MODE (result) == insn_mode && REGNO (result) >= FIRST_PSEUDO_REGISTER)) result = gen_reg_rtx (insn_mode); - /* Stabilize the arguments in case gen_cmpstrsi fails. */ - arg1 = save_expr (arg1); - arg2 = save_expr (arg2); - len = save_expr (len); + /* Stabilize the arguments in case gen_cmpstrnsi fails. */ + arg1 = builtin_save_expr (arg1); + arg2 = builtin_save_expr (arg2); + len = builtin_save_expr (len); - arg1_rtx = get_memory_rtx (arg1); - arg2_rtx = get_memory_rtx (arg2); - arg3_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); - insn = gen_cmpstrsi (result, arg1_rtx, arg2_rtx, arg3_rtx, - GEN_INT (MIN (arg1_align, arg2_align))); + arg1_rtx = get_memory_rtx (arg1, len); + arg2_rtx = get_memory_rtx (arg2, len); + arg3_rtx = expand_normal (len); + insn = gen_cmpstrnsi (result, arg1_rtx, arg2_rtx, arg3_rtx, + GEN_INT (MIN (arg1_align, arg2_align))); if (insn) { emit_insn (insn); @@ -3571,8 +3936,10 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) arglist = tree_cons (NULL_TREE, arg2, arglist); arglist = tree_cons (NULL_TREE, arg1, arglist); fndecl = get_callee_fndecl (exp); - exp = build_function_call_expr (fndecl, arglist); - return expand_call (exp, target, target == const0_rtx); + fn = build_function_call_expr (fndecl, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_call (fn, target, target == const0_rtx); } #endif return 0; @@ -3583,61 +3950,61 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) otherwise try to get the result in TARGET, if convenient. */ static rtx -expand_builtin_strcat (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_strcat (tree fndecl, tree arglist, rtx target, enum machine_mode mode) { if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) return 0; else { tree dst = TREE_VALUE (arglist), - src = TREE_VALUE (TREE_CHAIN (arglist)); + src = TREE_VALUE (TREE_CHAIN (arglist)); const char *p = c_getstr (src); - if (p) + /* If the string length is zero, return the dst parameter. */ + if (p && *p == '\0') + return expand_expr (dst, target, mode, EXPAND_NORMAL); + + if (!optimize_size) { - /* If the string length is zero, return the dst parameter. */ - if (*p == '\0') - return expand_expr (dst, target, mode, EXPAND_NORMAL); - else if (!optimize_size) + /* See if we can store by pieces into (dst + strlen(dst)). */ + tree newsrc, newdst, + strlen_fn = implicit_built_in_decls[BUILT_IN_STRLEN]; + rtx insns; + + /* Stabilize the argument list. */ + newsrc = builtin_save_expr (src); + if (newsrc != src) + arglist = build_tree_list (NULL_TREE, newsrc); + else + arglist = TREE_CHAIN (arglist); /* Reusing arglist if safe. */ + + dst = builtin_save_expr (dst); + + start_sequence (); + + /* Create strlen (dst). */ + newdst = + build_function_call_expr (strlen_fn, + build_tree_list (NULL_TREE, dst)); + /* Create (dst + (cast) strlen (dst)). */ + newdst = fold_convert (TREE_TYPE (dst), newdst); + newdst = fold_build2 (PLUS_EXPR, TREE_TYPE (dst), dst, newdst); + + newdst = builtin_save_expr (newdst); + arglist = tree_cons (NULL_TREE, newdst, arglist); + + if (!expand_builtin_strcpy (fndecl, arglist, target, mode)) { - /* Otherwise if !optimize_size, see if we can store by - pieces into (dst + strlen(dst)). */ - tree newdst, arglist, - strlen_fn = implicit_built_in_decls[BUILT_IN_STRLEN]; - - /* This is the length argument. */ - arglist = build_tree_list (NULL_TREE, - fold (size_binop (PLUS_EXPR, - c_strlen (src, 0), - ssize_int (1)))); - /* Prepend src argument. */ - arglist = tree_cons (NULL_TREE, src, arglist); - - /* We're going to use dst more than once. */ - dst = save_expr (dst); - - /* Create strlen (dst). */ - newdst = - fold (build_function_call_expr (strlen_fn, - build_tree_list (NULL_TREE, - dst))); - /* Create (dst + strlen (dst)). */ - newdst = fold (build (PLUS_EXPR, TREE_TYPE (dst), dst, newdst)); - - /* Prepend the new dst argument. */ - arglist = tree_cons (NULL_TREE, newdst, arglist); - - /* We don't want to get turned into a memcpy if the - target is const0_rtx, i.e. when the return value - isn't used. That would produce pessimized code so - pass in a target of zero, it should never actually be - used. If this was successful return the original - dst, not the result of mempcpy. */ - if (expand_builtin_mempcpy (arglist, /*target=*/0, mode, /*endp=*/0)) - return expand_expr (dst, target, mode, EXPAND_NORMAL); - else - return 0; + end_sequence (); /* Stop sequence. */ + return 0; } + + /* Output the entire sequence. */ + insns = get_insns (); + end_sequence (); + emit_insn (insns); + + return expand_expr (dst, target, mode, EXPAND_NORMAL); } return 0; @@ -3651,46 +4018,14 @@ expand_builtin_strcat (tree arglist, rtx target, enum machine_mode mode) static rtx expand_builtin_strncat (tree arglist, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, + POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { - tree dst = TREE_VALUE (arglist), - src = TREE_VALUE (TREE_CHAIN (arglist)), - len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - const char *p = c_getstr (src); - - /* If the requested length is zero, or the src parameter string - length is zero, return the dst parameter. */ - if (integer_zerop (len) || (p && *p == '\0')) - { - /* Evaluate and ignore the src and len parameters in case - they have side-effects. */ - expand_expr (src, const0_rtx, VOIDmode, EXPAND_NORMAL); - expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); - return expand_expr (dst, target, mode, EXPAND_NORMAL); - } - - /* If the requested len is greater than or equal to the string - length, call strcat. */ - if (TREE_CODE (len) == INTEGER_CST && p - && compare_tree_int (len, strlen (p)) >= 0) - { - tree newarglist - = tree_cons (NULL_TREE, dst, build_tree_list (NULL_TREE, src)); - tree fn = implicit_built_in_decls[BUILT_IN_STRCAT]; - - /* If the replacement _DECL isn't initialized, don't do the - transformation. */ - if (!fn) - return 0; - - return expand_expr (build_function_call_expr (fn, newarglist), - target, mode, EXPAND_NORMAL); - } - return 0; + tree result = fold_builtin_strncat (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Expand expression EXP, which is a call to the strspn builtin. @@ -3700,31 +4035,13 @@ expand_builtin_strncat (tree arglist, rtx target, enum machine_mode mode) static rtx expand_builtin_strspn (tree arglist, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - const char *p1 = c_getstr (s1), *p2 = c_getstr (s2); - - /* If both arguments are constants, evaluate at compile-time. */ - if (p1 && p2) - { - const size_t r = strspn (p1, p2); - return expand_expr (size_int (r), target, mode, EXPAND_NORMAL); - } - - /* If either argument is "", return 0. */ - if ((p1 && *p1 == '\0') || (p2 && *p2 == '\0')) - { - /* Evaluate and ignore both arguments in case either one has - side-effects. */ - expand_expr (s1, const0_rtx, VOIDmode, EXPAND_NORMAL); - expand_expr (s2, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - return 0; + tree result = fold_builtin_strspn (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Expand expression EXP, which is a call to the strcspn builtin. @@ -3734,45 +4051,13 @@ expand_builtin_strspn (tree arglist, rtx target, enum machine_mode mode) static rtx expand_builtin_strcspn (tree arglist, rtx target, enum machine_mode mode) { - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - else + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) { - tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); - const char *p1 = c_getstr (s1), *p2 = c_getstr (s2); - - /* If both arguments are constants, evaluate at compile-time. */ - if (p1 && p2) - { - const size_t r = strcspn (p1, p2); - return expand_expr (size_int (r), target, mode, EXPAND_NORMAL); - } - - /* If the first argument is "", return 0. */ - if (p1 && *p1 == '\0') - { - /* Evaluate and ignore argument s2 in case it has - side-effects. */ - expand_expr (s2, const0_rtx, VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - - /* If the second argument is "", return __builtin_strlen(s1). */ - if (p2 && *p2 == '\0') - { - tree newarglist = build_tree_list (NULL_TREE, s1), - fn = implicit_built_in_decls[BUILT_IN_STRLEN]; - - /* If the replacement _DECL isn't initialized, don't do the - transformation. */ - if (!fn) - return 0; - - return expand_expr (build_function_call_expr (fn, newarglist), - target, mode, EXPAND_NORMAL); - } - return 0; + tree result = fold_builtin_strcspn (arglist); + if (result) + return expand_expr (result, target, mode, EXPAND_NORMAL); } + return 0; } /* Expand a call to __builtin_saveregs, generating the result in TARGET, @@ -3806,7 +4091,7 @@ expand_builtin_saveregs (void) is inside a start_sequence, make the outer-level insn chain current, so the code is placed at the start of the function. */ push_topmost_sequence (); - emit_insn_after (seq, get_insns ()); + emit_insn_after (seq, entry_of_function ()); pop_topmost_sequence (); return val; @@ -3822,66 +4107,35 @@ expand_builtin_args_info (tree arglist) int nwords = sizeof (CUMULATIVE_ARGS) / sizeof (int); int *word_ptr = (int *) ¤t_function_args_info; - if (sizeof (CUMULATIVE_ARGS) % sizeof (int) != 0) - abort (); + gcc_assert (sizeof (CUMULATIVE_ARGS) % sizeof (int) == 0); if (arglist != 0) { if (!host_integerp (TREE_VALUE (arglist), 0)) - error ("argument of `__builtin_args_info' must be constant"); + error ("argument of %<__builtin_args_info%> must be constant"); else { HOST_WIDE_INT wordnum = tree_low_cst (TREE_VALUE (arglist), 0); if (wordnum < 0 || wordnum >= nwords) - error ("argument of `__builtin_args_info' out of range"); + error ("argument of %<__builtin_args_info%> out of range"); else return GEN_INT (word_ptr[wordnum]); } } else - error ("missing argument in `__builtin_args_info'"); + error ("missing argument in %<__builtin_args_info%>"); return const0_rtx; } -/* Expand ARGLIST, from a call to __builtin_next_arg. */ +/* Expand a call to __builtin_next_arg. */ static rtx -expand_builtin_next_arg (tree arglist) +expand_builtin_next_arg (void) { - tree fntype = TREE_TYPE (current_function_decl); - - if (TYPE_ARG_TYPES (fntype) == 0 - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) - == void_type_node)) - { - error ("`va_start' used in function with fixed args"); - return const0_rtx; - } - - if (arglist) - { - tree last_parm = tree_last (DECL_ARGUMENTS (current_function_decl)); - tree arg = TREE_VALUE (arglist); - - /* Strip off all nops for the sake of the comparison. This - is not quite the same as STRIP_NOPS. It does more. - We must also strip off INDIRECT_EXPR for C++ reference - parameters. */ - while (TREE_CODE (arg) == NOP_EXPR - || TREE_CODE (arg) == CONVERT_EXPR - || TREE_CODE (arg) == NON_LVALUE_EXPR - || TREE_CODE (arg) == INDIRECT_REF) - arg = TREE_OPERAND (arg, 0); - if (arg != last_parm) - warning ("second parameter of `va_start' not last named argument"); - } - else - /* Evidently an out of date version of ; can't validate - va_start's second argument, but can still work as intended. */ - warning ("`__builtin_next_arg' called without an argument"); - + /* Checking arguments is already done in fold_builtin_next_arg + that must be called before this function. */ return expand_binop (Pmode, add_optab, current_function_internal_arg_pointer, current_function_arg_offset_rtx, @@ -3906,10 +4160,7 @@ stabilize_va_list (tree valist, int needs_lvalue) if (TREE_CODE (TREE_TYPE (valist)) == ARRAY_TYPE) { tree p1 = build_pointer_type (TREE_TYPE (va_list_type_node)); - tree p2 = build_pointer_type (va_list_type_node); - - valist = build1 (ADDR_EXPR, p2, valist); - valist = fold (build1 (NOP_EXPR, p1, valist)); + valist = build_fold_addr_expr_with_type (valist, p1); } } else @@ -3922,14 +4173,13 @@ stabilize_va_list (tree valist, int needs_lvalue) return valist; pt = build_pointer_type (va_list_type_node); - valist = fold (build1 (ADDR_EXPR, pt, valist)); + valist = fold_build1 (ADDR_EXPR, pt, valist); TREE_SIDE_EFFECTS (valist) = 1; } if (TREE_SIDE_EFFECTS (valist)) valist = save_expr (valist); - valist = fold (build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), - valist)); + valist = build_fold_indirect_ref (valist); } return valist; @@ -3951,8 +4201,8 @@ std_expand_builtin_va_start (tree valist, rtx nextarg) { tree t; - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, - make_tree (ptr_type_node, nextarg)); + t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, + make_tree (ptr_type_node, nextarg)); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); @@ -3968,10 +4218,16 @@ expand_builtin_va_start (tree arglist) chain = TREE_CHAIN (arglist); - if (TREE_CHAIN (chain)) - error ("too many arguments to function `va_start'"); + if (!chain) + { + error ("too few arguments to function %"); + return const0_rtx; + } - nextarg = expand_builtin_next_arg (chain); + if (fold_builtin_next_arg (chain)) + return const0_rtx; + + nextarg = expand_builtin_next_arg (); valist = stabilize_va_list (TREE_VALUE (arglist), 1); #ifdef EXPAND_BUILTIN_VA_START @@ -3986,180 +4242,211 @@ expand_builtin_va_start (tree arglist) /* The "standard" implementation of va_arg: read the value from the current (padded) address and increment by the (padded) size. */ -rtx -std_expand_builtin_va_arg (tree valist, tree type) +tree +std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) { - tree addr_tree, t, type_size = NULL; - tree align, alignm1; - tree rounded_size; - rtx addr; - HOST_WIDE_INT boundary; + tree addr, t, type_size, rounded_size, valist_tmp; + unsigned HOST_WIDE_INT align, boundary; + bool indirect; - /* Compute the rounded size of the type. */ - align = size_int (PARM_BOUNDARY / BITS_PER_UNIT); - alignm1 = size_int (PARM_BOUNDARY / BITS_PER_UNIT - 1); - boundary = FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), type); +#ifdef ARGS_GROW_DOWNWARD + /* All of the alignment and movement below is for args-grow-up machines. + As of 2004, there are only 3 ARGS_GROW_DOWNWARD targets, and they all + implement their own specialized gimplify_va_arg_expr routines. */ + gcc_unreachable (); +#endif + + indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); + if (indirect) + type = build_pointer_type (type); + + align = PARM_BOUNDARY / BITS_PER_UNIT; + boundary = FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), type) / BITS_PER_UNIT; + + /* Hoist the valist value into a temporary for the moment. */ + valist_tmp = get_initialized_tmp_var (valist, pre_p, NULL); /* va_list pointer is aligned to PARM_BOUNDARY. If argument actually requires greater alignment, we must perform dynamic alignment. */ - - if (boundary > PARM_BOUNDARY) + if (boundary > align + && !integer_zerop (TYPE_SIZE (type))) { - if (!PAD_VARARGS_DOWN) - { - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, - build (PLUS_EXPR, TREE_TYPE (valist), valist, - build_int_2 (boundary / BITS_PER_UNIT - 1, 0))); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - } - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, - build (BIT_AND_EXPR, TREE_TYPE (valist), valist, - build_int_2 (~(boundary / BITS_PER_UNIT - 1), -1))); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = fold_convert (TREE_TYPE (valist), size_int (boundary - 1)); + t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp, + build2 (PLUS_EXPR, TREE_TYPE (valist), valist_tmp, t)); + gimplify_and_add (t, pre_p); + + t = fold_convert (TREE_TYPE (valist), size_int (-boundary)); + t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp, + build2 (BIT_AND_EXPR, TREE_TYPE (valist), valist_tmp, t)); + gimplify_and_add (t, pre_p); } - if (type == error_mark_node - || (type_size = TYPE_SIZE_UNIT (TYPE_MAIN_VARIANT (type))) == NULL - || TREE_OVERFLOW (type_size)) - rounded_size = size_zero_node; else - rounded_size = fold (build (MULT_EXPR, sizetype, - fold (build (TRUNC_DIV_EXPR, sizetype, - fold (build (PLUS_EXPR, sizetype, - type_size, alignm1)), - align)), - align)); + boundary = align; + + /* If the actual alignment is less than the alignment of the type, + adjust the type accordingly so that we don't assume strict alignment + when deferencing the pointer. */ + boundary *= BITS_PER_UNIT; + if (boundary < TYPE_ALIGN (type)) + { + type = build_variant_type_copy (type); + TYPE_ALIGN (type) = boundary; + } + + /* Compute the rounded size of the type. */ + type_size = size_in_bytes (type); + rounded_size = round_up (type_size, align); + + /* Reduce rounded_size so it's sharable with the postqueue. */ + gimplify_expr (&rounded_size, pre_p, post_p, is_gimple_val, fb_rvalue); /* Get AP. */ - addr_tree = valist; - if (PAD_VARARGS_DOWN && ! integer_zerop (rounded_size)) + addr = valist_tmp; + if (PAD_VARARGS_DOWN && !integer_zerop (rounded_size)) { /* Small args are padded downward. */ - addr_tree = fold (build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree, - fold (build (COND_EXPR, sizetype, - fold (build (GT_EXPR, sizetype, - rounded_size, - align)), - size_zero_node, - fold (build (MINUS_EXPR, sizetype, - rounded_size, - type_size)))))); + t = fold_build2 (GT_EXPR, sizetype, rounded_size, size_int (align)); + t = fold_build3 (COND_EXPR, sizetype, t, size_zero_node, + size_binop (MINUS_EXPR, rounded_size, type_size)); + t = fold_convert (TREE_TYPE (addr), t); + addr = fold_build2 (PLUS_EXPR, TREE_TYPE (addr), addr, t); } - addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL); - addr = copy_to_reg (addr); - /* Compute new value for AP. */ - if (! integer_zerop (rounded_size)) - { - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, - build (PLUS_EXPR, TREE_TYPE (valist), valist, - rounded_size)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - } + t = fold_convert (TREE_TYPE (valist), rounded_size); + t = build2 (PLUS_EXPR, TREE_TYPE (valist), valist_tmp, t); + t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t); + gimplify_and_add (t, pre_p); + + addr = fold_convert (build_pointer_type (type), addr); + + if (indirect) + addr = build_va_arg_indirect_ref (addr); + + return build_va_arg_indirect_ref (addr); +} + +/* Build an indirect-ref expression over the given TREE, which represents a + piece of a va_arg() expansion. */ +tree +build_va_arg_indirect_ref (tree addr) +{ + addr = build_fold_indirect_ref (addr); + + if (flag_mudflap) /* Don't instrument va_arg INDIRECT_REF. */ + mf_mark (addr); return addr; } -/* Expand __builtin_va_arg, which is not really a builtin function, but - a very special sort of operator. */ +/* Return a dummy expression of type TYPE in order to keep going after an + error. */ -rtx -expand_builtin_va_arg (tree valist, tree type) +static tree +dummy_object (tree type) +{ + tree t = build_int_cst (build_pointer_type (type), 0); + return build1 (INDIRECT_REF, type, t); +} + +/* Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a + builtin function, but a very special sort of operator. */ + +enum gimplify_status +gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p) { - rtx addr, result; tree promoted_type, want_va_type, have_va_type; + tree valist = TREE_OPERAND (*expr_p, 0); + tree type = TREE_TYPE (*expr_p); + tree t; /* Verify that valist is of the proper type. */ - want_va_type = va_list_type_node; have_va_type = TREE_TYPE (valist); + + if (have_va_type == error_mark_node) + return GS_ERROR; + if (TREE_CODE (want_va_type) == ARRAY_TYPE) { /* If va_list is an array type, the argument may have decayed to a pointer type, e.g. by being passed to another function. - In that case, unwrap both types so that we can compare the + In that case, unwrap both types so that we can compare the underlying records. */ if (TREE_CODE (have_va_type) == ARRAY_TYPE - || TREE_CODE (have_va_type) == POINTER_TYPE) + || POINTER_TYPE_P (have_va_type)) { want_va_type = TREE_TYPE (want_va_type); have_va_type = TREE_TYPE (have_va_type); } } + if (TYPE_MAIN_VARIANT (want_va_type) != TYPE_MAIN_VARIANT (have_va_type)) { - error ("first argument to `va_arg' not of type `va_list'"); - addr = const0_rtx; + error ("first argument to % not of type %"); + return GS_ERROR; } /* Generate a diagnostic for requesting data of a type that cannot be passed through `...' due to type promotion at the call site. */ - else if ((promoted_type = (*lang_hooks.types.type_promotes_to) (type)) + else if ((promoted_type = lang_hooks.types.type_promotes_to (type)) != type) { - const char *name = "", *pname = 0; static bool gave_help; - if (TYPE_NAME (type)) - { - if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - name = IDENTIFIER_POINTER (TYPE_NAME (type)); - else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (type))) - name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); - } - if (TYPE_NAME (promoted_type)) - { - if (TREE_CODE (TYPE_NAME (promoted_type)) == IDENTIFIER_NODE) - pname = IDENTIFIER_POINTER (TYPE_NAME (promoted_type)); - else if (TREE_CODE (TYPE_NAME (promoted_type)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (promoted_type))) - pname = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (promoted_type))); - } - /* Unfortunately, this is merely undefined, rather than a constraint violation, so we cannot make this an error. If this call is never executed, the program is still strictly conforming. */ - warning ("`%s' is promoted to `%s' when passed through `...'", - name, pname); + warning (0, "%qT is promoted to %qT when passed through %<...%>", + type, promoted_type); if (! gave_help) { gave_help = true; - warning ("(so you should pass `%s' not `%s' to `va_arg')", - pname, name); + warning (0, "(so you should pass %qT not %qT to %)", + promoted_type, type); } /* We can, however, treat "undefined" any way we please. Call abort to encourage the user to fix the program. */ inform ("if this code is reached, the program will abort"); - expand_builtin_trap (); + t = build_function_call_expr (implicit_built_in_decls[BUILT_IN_TRAP], + NULL); + append_to_statement_list (t, pre_p); /* This is dead code, but go ahead and finish so that the mode of the result comes out right. */ - addr = const0_rtx; + *expr_p = dummy_object (type); + return GS_ALL_DONE; } else { /* Make it easier for the backends by protecting the valist argument - from multiple evaluations. */ - valist = stabilize_va_list (valist, 0); + from multiple evaluations. */ + if (TREE_CODE (va_list_type_node) == ARRAY_TYPE) + { + /* For this case, the backends will be expecting a pointer to + TREE_TYPE (va_list_type_node), but it's possible we've + actually been given an array (an actual va_list_type_node). + So fix it. */ + if (TREE_CODE (TREE_TYPE (valist)) == ARRAY_TYPE) + { + tree p1 = build_pointer_type (TREE_TYPE (va_list_type_node)); + valist = build_fold_addr_expr_with_type (valist, p1); + } + gimplify_expr (&valist, pre_p, post_p, is_gimple_val, fb_rvalue); + } + else + gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval, fb_lvalue); -#ifdef EXPAND_BUILTIN_VA_ARG - addr = EXPAND_BUILTIN_VA_ARG (valist, type); -#else - addr = std_expand_builtin_va_arg (valist, type); -#endif + if (!targetm.gimplify_va_arg_expr) + /* FIXME:Once most targets are converted we should merely + assert this is non-null. */ + return GS_ALL_DONE; + + *expr_p = targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p); + return GS_OK; } - - addr = convert_memory_address (Pmode, addr); - - result = gen_rtx_MEM (TYPE_MODE (type), addr); - set_mem_alias_set (result, get_varargs_alias_set ()); - - return result; } /* Expand ARGLIST, from a call to __builtin_va_end. */ @@ -4194,7 +4481,7 @@ expand_builtin_va_copy (tree arglist) if (TREE_CODE (va_list_type_node) != ARRAY_TYPE) { - t = build (MODIFY_EXPR, va_list_type_node, dst, src); + t = build2 (MODIFY_EXPR, va_list_type_node, dst, src); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); } @@ -4241,25 +4528,24 @@ expand_builtin_frame_address (tree fndecl, tree arglist) else if (! host_integerp (TREE_VALUE (arglist), 1)) { if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) - error ("invalid arg to `__builtin_frame_address'"); + error ("invalid argument to %<__builtin_frame_address%>"); else - error ("invalid arg to `__builtin_return_address'"); + error ("invalid argument to %<__builtin_return_address%>"); return const0_rtx; } else { rtx tem = expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl), - tree_low_cst (TREE_VALUE (arglist), 1), - hard_frame_pointer_rtx); + tree_low_cst (TREE_VALUE (arglist), 1)); /* Some ports cannot access arbitrary stack frames. */ if (tem == NULL) { if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) - warning ("unsupported arg to `__builtin_frame_address'"); + warning (0, "unsupported argument to %<__builtin_frame_address%>"); else - warning ("unsupported arg to `__builtin_return_address'"); + warning (0, "unsupported argument to %<__builtin_return_address%>"); return const0_rtx; } @@ -4267,7 +4553,7 @@ expand_builtin_frame_address (tree fndecl, tree arglist) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) return tem; - if (GET_CODE (tem) != REG + if (!REG_P (tem) && ! CONSTANT_P (tem)) tem = copy_to_mode_reg (Pmode, tem); return tem; @@ -4284,11 +4570,17 @@ expand_builtin_alloca (tree arglist, rtx target) rtx op0; rtx result; + /* In -fmudflap-instrumented code, alloca() and __builtin_alloca() + should always expand to function calls. These can be intercepted + in libmudflap. */ + if (flag_mudflap) + return 0; + if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) return 0; /* Compute the argument. */ - op0 = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0); + op0 = expand_normal (TREE_VALUE (arglist)); /* Allocate the desired space. */ result = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT); @@ -4316,8 +4608,7 @@ expand_builtin_unop (enum machine_mode target_mode, tree arglist, rtx target, Set TARGET to wherever the result comes back. */ target = expand_unop (TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist))), op_optab, op0, target, 1); - if (target == 0) - abort (); + gcc_assert (target); return convert_to_mode (target_mode, target, 0); } @@ -4328,83 +4619,15 @@ expand_builtin_unop (enum machine_mode target_mode, tree arglist, rtx target, static rtx expand_builtin_fputs (tree arglist, rtx target, bool unlocked) { - tree len, fn; - /* If we're using an unlocked function, assume the other unlocked - functions exist explicitly. */ - tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FPUTC]; - tree const fn_fwrite = unlocked ? built_in_decls[BUILT_IN_FWRITE_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FWRITE]; - - /* If the return value is used, don't do the transformation. */ - if (target != const0_rtx) - return 0; - /* Verify the arguments in the original call. */ - if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) - return 0; - - /* Get the length of the string passed to fputs. If the length - can't be determined, punt. */ - if (!(len = c_strlen (TREE_VALUE (arglist), 1)) - || TREE_CODE (len) != INTEGER_CST) - return 0; - - switch (compare_tree_int (len, 1)) + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) { - case -1: /* length is 0, delete the call entirely . */ - { - /* Evaluate and ignore the argument in case it has - side-effects. */ - expand_expr (TREE_VALUE (TREE_CHAIN (arglist)), const0_rtx, - VOIDmode, EXPAND_NORMAL); - return const0_rtx; - } - case 0: /* length is 1, call fputc. */ - { - const char *p = c_getstr (TREE_VALUE (arglist)); - - if (p != NULL) - { - /* New argument list transforming fputs(string, stream) to - fputc(string[0], stream). */ - arglist = - build_tree_list (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist))); - arglist = - tree_cons (NULL_TREE, build_int_2 (p[0], 0), arglist); - fn = fn_fputc; - break; - } - } - /* Fall through. */ - case 1: /* length is greater than 1, call fwrite. */ - { - tree string_arg; - - /* If optimizing for size keep fputs. */ - if (optimize_size) - return 0; - string_arg = TREE_VALUE (arglist); - /* New argument list transforming fputs(string, stream) to - fwrite(string, 1, len, stream). */ - arglist = build_tree_list (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist))); - arglist = tree_cons (NULL_TREE, len, arglist); - arglist = tree_cons (NULL_TREE, size_one_node, arglist); - arglist = tree_cons (NULL_TREE, string_arg, arglist); - fn = fn_fwrite; - break; - } - default: - abort (); + tree result = fold_builtin_fputs (arglist, (target == const0_rtx), + unlocked, NULL_TREE); + if (result) + return expand_expr (result, target, VOIDmode, EXPAND_NORMAL); } - - /* If the replacement _DECL isn't initialized, don't do the - transformation. */ - if (!fn) - return 0; - - return expand_expr (build_function_call_expr (fn, arglist), - const0_rtx, VOIDmode, EXPAND_NORMAL); + return 0; } /* Expand a call to __builtin_expect. We return our argument and emit a @@ -4425,7 +4648,7 @@ expand_builtin_expect (tree arglist, rtx target) if (TREE_CODE (c) != INTEGER_CST) { - error ("second arg to `__builtin_expect' must be a constant"); + error ("second argument to %<__builtin_expect%> must be a constant"); c = integer_zero_node; } @@ -4476,9 +4699,9 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) ret = get_insns (); drop_through_label = get_last_insn (); - if (drop_through_label && GET_CODE (drop_through_label) == NOTE) + if (drop_through_label && NOTE_P (drop_through_label)) drop_through_label = prev_nonnote_insn (drop_through_label); - if (drop_through_label && GET_CODE (drop_through_label) != CODE_LABEL) + if (drop_through_label && !LABEL_P (drop_through_label)) drop_through_label = NULL_RTX; end_sequence (); @@ -4493,7 +4716,7 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) { rtx next = NEXT_INSN (insn); - if (GET_CODE (insn) == JUMP_INSN && any_condjump_p (insn)) + if (JUMP_P (insn) && any_condjump_p (insn)) { rtx ifelse = SET_SRC (pc_set (insn)); rtx then_dest = XEXP (ifelse, 1); @@ -4516,10 +4739,10 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) /* Otherwise check where we drop through. */ else if (else_dest == pc_rtx) { - if (next && GET_CODE (next) == NOTE) + if (next && NOTE_P (next)) next = next_nonnote_insn (next); - if (next && GET_CODE (next) == JUMP_INSN + if (next && JUMP_P (next) && any_uncondjump_p (next)) temp = XEXP (SET_SRC (pc_set (next)), 0); else @@ -4534,10 +4757,10 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) } else if (then_dest == pc_rtx) { - if (next && GET_CODE (next) == NOTE) + if (next && NOTE_P (next)) next = next_nonnote_insn (next); - if (next && GET_CODE (next) == JUMP_INSN + if (next && JUMP_P (next) && any_uncondjump_p (next)) temp = XEXP (SET_SRC (pc_set (next)), 0); else @@ -4555,7 +4778,7 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label) probabilities. */ if (integer_zerop (arg1)) taken = 1 - taken; - predict_insn_def (insn, PRED_BUILTIN_EXPECT, taken); + predict_insn_def (insn, PRED_BUILTIN_EXPECT, taken); } } @@ -4600,43 +4823,43 @@ expand_builtin_fabs (tree arglist, rtx target, rtx subtarget) return expand_abs (mode, op0, target, 0, safe_from_p (target, arg, 1)); } -/* Expand a call to cabs, cabsf or cabsl with arguments ARGLIST. - Return 0 if a normal call should be emitted rather than expanding - the function inline. If convenient, the result should be placed - in target. */ +/* Expand a call to copysign, copysignf, or copysignl with arguments ARGLIST. + Return NULL is a normal call should be emitted rather than expanding the + function inline. If convenient, the result should be placed in TARGET. + SUBTARGET may be used as the target for computing the operand. */ static rtx -expand_builtin_cabs (tree arglist, rtx target) +expand_builtin_copysign (tree arglist, rtx target, rtx subtarget) { - enum machine_mode mode; + rtx op0, op1; tree arg; - rtx op0; - if (arglist == 0 || TREE_CHAIN (arglist)) + if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) return 0; + arg = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (arg)) != COMPLEX_TYPE - || TREE_CODE (TREE_TYPE (TREE_TYPE (arg))) != REAL_TYPE) - return 0; + op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL); - mode = TYPE_MODE (TREE_TYPE (arg)); - op0 = expand_expr (arg, NULL_RTX, VOIDmode, 0); - return expand_complex_abs (mode, op0, target, 0); + arg = TREE_VALUE (TREE_CHAIN (arglist)); + op1 = expand_normal (arg); + + return expand_copysign (op0, op1, target); } /* Create a new constant string literal and return a char* pointer to it. The STRING_CST value is the LEN characters at STR. */ -static tree +tree build_string_literal (int len, const char *str) { tree t, elem, index, type; t = build_string (len, str); elem = build_type_variant (char_type_node, 1, 0); - index = build_index_type (build_int_2 (len - 1, 0)); + index = build_index_type (build_int_cst (NULL_TREE, len - 1)); type = build_array_type (elem, index); TREE_TYPE (t) = type; TREE_CONSTANT (t) = 1; + TREE_INVARIANT (t) = 1; TREE_READONLY (t) = 1; TREE_STATIC (t) = 1; @@ -4648,15 +4871,16 @@ build_string_literal (int len, const char *str) return t; } -/* Expand a call to printf or printf_unlocked with argument list ARGLIST. +/* Expand EXP, a call to printf or printf_unlocked. Return 0 if a normal call should be emitted rather than transforming the function inline. If convenient, the result should be placed in - TARGET with mode MODE. UNLOCKED indicates this is a printf_unlocked + TARGET with mode MODE. UNLOCKED indicates this is a printf_unlocked call. */ static rtx -expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, +expand_builtin_printf (tree exp, rtx target, enum machine_mode mode, bool unlocked) { + tree arglist = TREE_OPERAND (exp, 1); /* If we're using an unlocked function, assume the other unlocked functions exist explicitly. */ tree const fn_putchar = unlocked ? built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] @@ -4674,7 +4898,7 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, if (! arglist) return 0; fmt = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) return 0; arglist = TREE_CHAIN (arglist); @@ -4683,17 +4907,20 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, if (fmt_str == NULL) return 0; + if (!init_target_chars()) + return 0; + /* If the format specifier was "%s\n", call __builtin_puts(arg). */ - if (strcmp (fmt_str, "%s\n") == 0) + if (strcmp (fmt_str, target_percent_s_newline) == 0) { if (! arglist - || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE + || ! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist))) || TREE_CHAIN (arglist)) return 0; fn = fn_puts; } /* If the format specifier was "%c", call __builtin_putchar(arg). */ - else if (strcmp (fmt_str, "%c") == 0) + else if (strcmp (fmt_str, target_percent_c) == 0) { if (! arglist || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE @@ -4704,8 +4931,8 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, else { /* We can't handle anything else with % args or %% ... yet. */ - if (strchr (fmt_str, '%')) - return 0; + if (strchr (fmt_str, target_percent)) + return 0; if (arglist) return 0; @@ -4719,7 +4946,7 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, /* Given printf("c"), (where c is any one character,) convert "c"[0] to an int and pass that to the replacement function. */ - arg = build_int_2 (fmt_str[0], 0); + arg = build_int_cst (NULL_TREE, fmt_str[0]); arglist = build_tree_list (NULL_TREE, arg); fn = fn_putchar; } @@ -4727,11 +4954,11 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, { /* If the format specifier was "string\n", call puts("string"). */ size_t len = strlen (fmt_str); - if (fmt_str[len - 1] == '\n') + if ((unsigned char)fmt_str[len - 1] == target_newline) { /* Create a NUL-terminated string that's one char shorter than the original, stripping off the trailing '\n'. */ - char *newstr = (char *) alloca (len); + char *newstr = alloca (len); memcpy (newstr, fmt_str, len - 1); newstr[len - 1] = 0; @@ -4748,19 +4975,22 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); } -/* Expand a call to fprintf or fprintf_unlocked with argument list ARGLIST. +/* Expand EXP, a call to fprintf or fprintf_unlocked. Return 0 if a normal call should be emitted rather than transforming the function inline. If convenient, the result should be placed in - TARGET with mode MODE. UNLOCKED indicates this is a fprintf_unlocked + TARGET with mode MODE. UNLOCKED indicates this is a fprintf_unlocked call. */ static rtx -expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, - bool unlocked) +expand_builtin_fprintf (tree exp, rtx target, enum machine_mode mode, + bool unlocked) { + tree arglist = TREE_OPERAND (exp, 1); /* If we're using an unlocked function, assume the other unlocked functions exist explicitly. */ tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] @@ -4778,13 +5008,13 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, if (! arglist) return 0; fp = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (fp)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (fp))) return 0; arglist = TREE_CHAIN (arglist); if (! arglist) return 0; fmt = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) return 0; arglist = TREE_CHAIN (arglist); @@ -4793,11 +5023,14 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, if (fmt_str == NULL) return 0; + if (!init_target_chars()) + return 0; + /* If the format specifier was "%s", call __builtin_fputs(arg,fp). */ - if (strcmp (fmt_str, "%s") == 0) + if (strcmp (fmt_str, target_percent_s) == 0) { if (! arglist - || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE + || ! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist))) || TREE_CHAIN (arglist)) return 0; arg = TREE_VALUE (arglist); @@ -4806,7 +5039,7 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, fn = fn_fputs; } /* If the format specifier was "%c", call __builtin_fputc(arg,fp). */ - else if (strcmp (fmt_str, "%c") == 0) + else if (strcmp (fmt_str, target_percent_c) == 0) { if (! arglist || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE @@ -4820,8 +5053,8 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, else { /* We can't handle anything else with % args or %% ... yet. */ - if (strchr (fmt_str, '%')) - return 0; + if (strchr (fmt_str, target_percent)) + return 0; if (arglist) return 0; @@ -4844,8 +5077,10 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); } /* Expand a call to sprintf with argument list ARGLIST. Return 0 if @@ -4865,13 +5100,13 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode) if (! arglist) return 0; dest = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (dest)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (dest))) return 0; arglist = TREE_CHAIN (arglist); if (! arglist) return 0; fmt = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (fmt)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) return 0; arglist = TREE_CHAIN (arglist); @@ -4880,8 +5115,11 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode) if (fmt_str == NULL) return 0; + if (!init_target_chars()) + return 0; + /* If the format doesn't contain % args or %%, use strcpy. */ - if (strchr (fmt_str, '%') == 0) + if (strchr (fmt_str, target_percent) == 0) { tree fn = implicit_built_in_decls[BUILT_IN_STRCPY]; tree exp; @@ -4892,12 +5130,11 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode) const0_rtx, VOIDmode, EXPAND_NORMAL); if (target == const0_rtx) return const0_rtx; - exp = build_int_2 (strlen (fmt_str), 0); - exp = fold (build1 (NOP_EXPR, integer_type_node, exp)); + exp = build_int_cst (NULL_TREE, strlen (fmt_str)); return expand_expr (exp, target, mode, EXPAND_NORMAL); } /* If the format is "%s", use strcpy if the result isn't used. */ - else if (strcmp (fmt_str, "%s") == 0) + else if (strcmp (fmt_str, target_percent_s) == 0) { tree fn, arg, len; fn = implicit_built_in_decls[BUILT_IN_STRCPY]; @@ -4908,7 +5145,7 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode) if (! arglist || TREE_CHAIN (arglist)) return 0; arg = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (arg)) != POINTER_TYPE) + if (! POINTER_TYPE_P (TREE_TYPE (arg))) return 0; if (target != const0_rtx) @@ -4932,6 +5169,472 @@ expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode) return 0; } + +/* Expand a call to either the entry or exit function profiler. */ + +static rtx +expand_builtin_profile_func (bool exitp) +{ + rtx this, which; + + this = DECL_RTL (current_function_decl); + gcc_assert (MEM_P (this)); + this = XEXP (this, 0); + + if (exitp) + which = profile_function_exit_libfunc; + else + which = profile_function_entry_libfunc; + + emit_library_call (which, LCT_NORMAL, VOIDmode, 2, this, Pmode, + expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS, + 0), + Pmode); + + return const0_rtx; +} + +/* Given a trampoline address, make sure it satisfies TRAMPOLINE_ALIGNMENT. */ + +static rtx +round_trampoline_addr (rtx tramp) +{ + rtx temp, addend, mask; + + /* If we don't need too much alignment, we'll have been guaranteed + proper alignment by get_trampoline_type. */ + if (TRAMPOLINE_ALIGNMENT <= STACK_BOUNDARY) + return tramp; + + /* Round address up to desired boundary. */ + temp = gen_reg_rtx (Pmode); + addend = GEN_INT (TRAMPOLINE_ALIGNMENT / BITS_PER_UNIT - 1); + mask = GEN_INT (-TRAMPOLINE_ALIGNMENT / BITS_PER_UNIT); + + temp = expand_simple_binop (Pmode, PLUS, tramp, addend, + temp, 0, OPTAB_LIB_WIDEN); + tramp = expand_simple_binop (Pmode, AND, temp, mask, + temp, 0, OPTAB_LIB_WIDEN); + + return tramp; +} + +static rtx +expand_builtin_init_trampoline (tree arglist) +{ + tree t_tramp, t_func, t_chain; + rtx r_tramp, r_func, r_chain; +#ifdef TRAMPOLINE_TEMPLATE + rtx blktramp; +#endif + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, + POINTER_TYPE, VOID_TYPE)) + return NULL_RTX; + + t_tramp = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + t_func = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + t_chain = TREE_VALUE (arglist); + + r_tramp = expand_normal (t_tramp); + r_func = expand_normal (t_func); + r_chain = expand_normal (t_chain); + + /* Generate insns to initialize the trampoline. */ + r_tramp = round_trampoline_addr (r_tramp); +#ifdef TRAMPOLINE_TEMPLATE + blktramp = gen_rtx_MEM (BLKmode, r_tramp); + set_mem_align (blktramp, TRAMPOLINE_ALIGNMENT); + emit_block_move (blktramp, assemble_trampoline_template (), + GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); +#endif + trampolines_created = 1; + INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain); + + return const0_rtx; +} + +static rtx +expand_builtin_adjust_trampoline (tree arglist) +{ + rtx tramp; + + if (!validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) + return NULL_RTX; + + tramp = expand_normal (TREE_VALUE (arglist)); + tramp = round_trampoline_addr (tramp); +#ifdef TRAMPOLINE_ADJUST_ADDRESS + TRAMPOLINE_ADJUST_ADDRESS (tramp); +#endif + + return tramp; +} + +/* Expand a call to the built-in signbit, signbitf or signbitl function. + Return NULL_RTX if a normal call should be emitted rather than expanding + the function in-line. EXP is the expression that is a call to the builtin + function; if convenient, the result should be placed in TARGET. */ + +static rtx +expand_builtin_signbit (tree exp, rtx target) +{ + const struct real_format *fmt; + enum machine_mode fmode, imode, rmode; + HOST_WIDE_INT hi, lo; + tree arg, arglist; + int word, bitpos; + rtx temp; + + arglist = TREE_OPERAND (exp, 1); + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + fmode = TYPE_MODE (TREE_TYPE (arg)); + rmode = TYPE_MODE (TREE_TYPE (exp)); + fmt = REAL_MODE_FORMAT (fmode); + + /* For floating point formats without a sign bit, implement signbit + as "ARG < 0.0". */ + bitpos = fmt->signbit_ro; + if (bitpos < 0) + { + /* But we can't do this if the format supports signed zero. */ + if (fmt->has_signed_zero && HONOR_SIGNED_ZEROS (fmode)) + return 0; + + arg = fold_build2 (LT_EXPR, TREE_TYPE (exp), arg, + build_real (TREE_TYPE (arg), dconst0)); + return expand_expr (arg, target, VOIDmode, EXPAND_NORMAL); + } + + temp = expand_normal (arg); + if (GET_MODE_SIZE (fmode) <= UNITS_PER_WORD) + { + imode = int_mode_for_mode (fmode); + if (imode == BLKmode) + return 0; + temp = gen_lowpart (imode, temp); + } + else + { + imode = word_mode; + /* Handle targets with different FP word orders. */ + if (FLOAT_WORDS_BIG_ENDIAN) + word = (GET_MODE_BITSIZE (fmode) - bitpos) / BITS_PER_WORD; + else + word = bitpos / BITS_PER_WORD; + temp = operand_subword_force (temp, word, fmode); + bitpos = bitpos % BITS_PER_WORD; + } + + /* Force the intermediate word_mode (or narrower) result into a + register. This avoids attempting to create paradoxical SUBREGs + of floating point modes below. */ + temp = force_reg (imode, temp); + + /* If the bitpos is within the "result mode" lowpart, the operation + can be implement with a single bitwise AND. Otherwise, we need + a right shift and an AND. */ + + if (bitpos < GET_MODE_BITSIZE (rmode)) + { + if (bitpos < HOST_BITS_PER_WIDE_INT) + { + hi = 0; + lo = (HOST_WIDE_INT) 1 << bitpos; + } + else + { + hi = (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT); + lo = 0; + } + + if (imode != rmode) + temp = gen_lowpart (rmode, temp); + temp = expand_binop (rmode, and_optab, temp, + immed_double_const (lo, hi, rmode), + NULL_RTX, 1, OPTAB_LIB_WIDEN); + } + else + { + /* Perform a logical right shift to place the signbit in the least + significant bit, then truncate the result to the desired mode + and mask just this bit. */ + temp = expand_shift (RSHIFT_EXPR, imode, temp, + build_int_cst (NULL_TREE, bitpos), NULL_RTX, 1); + temp = gen_lowpart (rmode, temp); + temp = expand_binop (rmode, and_optab, temp, const1_rtx, + NULL_RTX, 1, OPTAB_LIB_WIDEN); + } + + return temp; +} + +/* Expand fork or exec calls. TARGET is the desired target of the + call. ARGLIST is the list of arguments of the call. FN is the + identificator of the actual function. IGNORE is nonzero if the + value is to be ignored. */ + +static rtx +expand_builtin_fork_or_exec (tree fn, tree arglist, rtx target, int ignore) +{ + tree id, decl; + tree call; + + /* If we are not profiling, just call the function. */ + if (!profile_arc_flag) + return NULL_RTX; + + /* Otherwise call the wrapper. This should be equivalent for the rest of + compiler, so the code does not diverge, and the wrapper may run the + code necessary for keeping the profiling sane. */ + + switch (DECL_FUNCTION_CODE (fn)) + { + case BUILT_IN_FORK: + id = get_identifier ("__gcov_fork"); + break; + + case BUILT_IN_EXECL: + id = get_identifier ("__gcov_execl"); + break; + + case BUILT_IN_EXECV: + id = get_identifier ("__gcov_execv"); + break; + + case BUILT_IN_EXECLP: + id = get_identifier ("__gcov_execlp"); + break; + + case BUILT_IN_EXECLE: + id = get_identifier ("__gcov_execle"); + break; + + case BUILT_IN_EXECVP: + id = get_identifier ("__gcov_execvp"); + break; + + case BUILT_IN_EXECVE: + id = get_identifier ("__gcov_execve"); + break; + + default: + gcc_unreachable (); + } + + decl = build_decl (FUNCTION_DECL, id, TREE_TYPE (fn)); + DECL_EXTERNAL (decl) = 1; + TREE_PUBLIC (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; + TREE_NOTHROW (decl) = 1; + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + call = build_function_call_expr (decl, arglist); + + return expand_call (call, target, ignore); +} + + +/* Reconstitute a mode for a __sync intrinsic operation. Since the type of + the pointer in these functions is void*, the tree optimizers may remove + casts. The mode computed in expand_builtin isn't reliable either, due + to __sync_bool_compare_and_swap. + + FCODE_DIFF should be fcode - base, where base is the FOO_1 code for the + group of builtins. This gives us log2 of the mode size. */ + +static inline enum machine_mode +get_builtin_sync_mode (int fcode_diff) +{ + /* The size is not negotiable, so ask not to get BLKmode in return + if the target indicates that a smaller size would be better. */ + return mode_for_size (BITS_PER_UNIT << fcode_diff, MODE_INT, 0); +} + +/* Expand the memory expression LOC and return the appropriate memory operand + for the builtin_sync operations. */ + +static rtx +get_builtin_sync_mem (tree loc, enum machine_mode mode) +{ + rtx addr, mem; + + addr = expand_expr (loc, NULL, Pmode, EXPAND_SUM); + + /* Note that we explicitly do not want any alias information for this + memory, so that we kill all other live memories. Otherwise we don't + satisfy the full barrier semantics of the intrinsic. */ + mem = validize_mem (gen_rtx_MEM (mode, addr)); + + set_mem_align (mem, get_pointer_alignment (loc, BIGGEST_ALIGNMENT)); + set_mem_alias_set (mem, ALIAS_SET_MEMORY_BARRIER); + MEM_VOLATILE_P (mem) = 1; + + return mem; +} + +/* Expand the __sync_xxx_and_fetch and __sync_fetch_and_xxx intrinsics. + ARGLIST is the operands list to the function. CODE is the rtx code + that corresponds to the arithmetic or logical operation from the name; + an exception here is that NOT actually means NAND. TARGET is an optional + place for us to store the results; AFTER is true if this is the + fetch_and_xxx form. IGNORE is true if we don't actually care about + the result of the operation at all. */ + +static rtx +expand_builtin_sync_operation (enum machine_mode mode, tree arglist, + enum rtx_code code, bool after, + rtx target, bool ignore) +{ + rtx val, mem; + enum machine_mode old_mode; + + /* Expand the operands. */ + mem = get_builtin_sync_mem (TREE_VALUE (arglist), mode); + + arglist = TREE_CHAIN (arglist); + val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + /* If VAL is promoted to a wider mode, convert it back to MODE. Take care + of CONST_INTs, where we know the old_mode only from the call argument. */ + old_mode = GET_MODE (val); + if (old_mode == VOIDmode) + old_mode = TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist))); + val = convert_modes (mode, old_mode, val, 1); + + if (ignore) + return expand_sync_operation (mem, val, code); + else + return expand_sync_fetch_operation (mem, val, code, after, target); +} + +/* Expand the __sync_val_compare_and_swap and __sync_bool_compare_and_swap + intrinsics. ARGLIST is the operands list to the function. IS_BOOL is + true if this is the boolean form. TARGET is a place for us to store the + results; this is NOT optional if IS_BOOL is true. */ + +static rtx +expand_builtin_compare_and_swap (enum machine_mode mode, tree arglist, + bool is_bool, rtx target) +{ + rtx old_val, new_val, mem; + enum machine_mode old_mode; + + /* Expand the operands. */ + mem = get_builtin_sync_mem (TREE_VALUE (arglist), mode); + + arglist = TREE_CHAIN (arglist); + old_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + /* If VAL is promoted to a wider mode, convert it back to MODE. Take care + of CONST_INTs, where we know the old_mode only from the call argument. */ + old_mode = GET_MODE (old_val); + if (old_mode == VOIDmode) + old_mode = TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist))); + old_val = convert_modes (mode, old_mode, old_val, 1); + + arglist = TREE_CHAIN (arglist); + new_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + /* If VAL is promoted to a wider mode, convert it back to MODE. Take care + of CONST_INTs, where we know the old_mode only from the call argument. */ + old_mode = GET_MODE (new_val); + if (old_mode == VOIDmode) + old_mode = TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist))); + new_val = convert_modes (mode, old_mode, new_val, 1); + + if (is_bool) + return expand_bool_compare_and_swap (mem, old_val, new_val, target); + else + return expand_val_compare_and_swap (mem, old_val, new_val, target); +} + +/* Expand the __sync_lock_test_and_set intrinsic. Note that the most + general form is actually an atomic exchange, and some targets only + support a reduced form with the second argument being a constant 1. + ARGLIST is the operands list to the function; TARGET is an optional + place for us to store the results. */ + +static rtx +expand_builtin_lock_test_and_set (enum machine_mode mode, tree arglist, + rtx target) +{ + rtx val, mem; + enum machine_mode old_mode; + + /* Expand the operands. */ + mem = get_builtin_sync_mem (TREE_VALUE (arglist), mode); + + arglist = TREE_CHAIN (arglist); + val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + /* If VAL is promoted to a wider mode, convert it back to MODE. Take care + of CONST_INTs, where we know the old_mode only from the call argument. */ + old_mode = GET_MODE (val); + if (old_mode == VOIDmode) + old_mode = TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist))); + val = convert_modes (mode, old_mode, val, 1); + + return expand_sync_lock_test_and_set (mem, val, target); +} + +/* Expand the __sync_synchronize intrinsic. */ + +static void +expand_builtin_synchronize (void) +{ + tree x; + +#ifdef HAVE_memory_barrier + if (HAVE_memory_barrier) + { + emit_insn (gen_memory_barrier ()); + return; + } +#endif + + /* If no explicit memory barrier instruction is available, create an + empty asm stmt with a memory clobber. */ + x = build4 (ASM_EXPR, void_type_node, build_string (0, ""), NULL, NULL, + tree_cons (NULL, build_string (6, "memory"), NULL)); + ASM_VOLATILE_P (x) = 1; + expand_asm_expr (x); +} + +/* Expand the __sync_lock_release intrinsic. ARGLIST is the operands list + to the function. */ + +static void +expand_builtin_lock_release (enum machine_mode mode, tree arglist) +{ + enum insn_code icode; + rtx mem, insn; + rtx val = const0_rtx; + + /* Expand the operands. */ + mem = get_builtin_sync_mem (TREE_VALUE (arglist), mode); + + /* If there is an explicit operation in the md file, use it. */ + icode = sync_lock_release[mode]; + if (icode != CODE_FOR_nothing) + { + if (!insn_data[icode].operand[1].predicate (val, mode)) + val = force_reg (mode, val); + + insn = GEN_FCN (icode) (mem, val); + if (insn) + { + emit_insn (insn); + return; + } + } + + /* Otherwise we can implement this operation by emitting a barrier + followed by a store of zero. */ + expand_builtin_synchronize (); + emit_move_insn (mem, val); +} /* Expand an expression EXP that calls a built-in function, with result going to TARGET if that's convenient @@ -4948,16 +5651,13 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); enum machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp)); - /* Perform postincrements before expanding builtin functions. */ - emit_queue (); - if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) - return (*targetm.expand_builtin) (exp, target, subtarget, mode, ignore); + return targetm.expand_builtin (exp, target, subtarget, mode, ignore); /* When not optimizing, generate calls to library functions for a certain set of builtins. */ if (!optimize - && !CALLED_AS_BUILT_IN (fndecl) + && !called_as_built_in (fndecl) && DECL_ASSEMBLER_NAME_SET_P (fndecl) && fcode != BUILT_IN_ALLOCA) return expand_call (exp, target, ignore); @@ -4994,103 +5694,81 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, switch (fcode) { - case BUILT_IN_ABS: - case BUILT_IN_LABS: - case BUILT_IN_LLABS: - case BUILT_IN_IMAXABS: - /* build_function_call changes these into ABS_EXPR. */ - abort (); - - case BUILT_IN_FABS: - case BUILT_IN_FABSF: - case BUILT_IN_FABSL: + CASE_FLT_FN (BUILT_IN_FABS): target = expand_builtin_fabs (arglist, target, subtarget); if (target) - return target; + return target; break; - case BUILT_IN_CABS: - case BUILT_IN_CABSF: - case BUILT_IN_CABSL: - if (flag_unsafe_math_optimizations) - { - target = expand_builtin_cabs (arglist, target); - if (target) - return target; - } + CASE_FLT_FN (BUILT_IN_COPYSIGN): + target = expand_builtin_copysign (arglist, target, subtarget); + if (target) + return target; break; - case BUILT_IN_CONJ: - case BUILT_IN_CONJF: - case BUILT_IN_CONJL: - case BUILT_IN_CREAL: - case BUILT_IN_CREALF: - case BUILT_IN_CREALL: - case BUILT_IN_CIMAG: - case BUILT_IN_CIMAGF: - case BUILT_IN_CIMAGL: - /* expand_tree_builtin changes these into CONJ_EXPR, REALPART_EXPR - and IMAGPART_EXPR. */ - abort (); + /* Just do a normal library call if we were unable to fold + the values. */ + CASE_FLT_FN (BUILT_IN_CABS): + break; - case BUILT_IN_SIN: - case BUILT_IN_SINF: - case BUILT_IN_SINL: - case BUILT_IN_COS: - case BUILT_IN_COSF: - case BUILT_IN_COSL: - case BUILT_IN_EXP: - case BUILT_IN_EXPF: - case BUILT_IN_EXPL: - case BUILT_IN_LOG: - case BUILT_IN_LOGF: - case BUILT_IN_LOGL: - case BUILT_IN_TAN: - case BUILT_IN_TANF: - case BUILT_IN_TANL: - case BUILT_IN_ATAN: - case BUILT_IN_ATANF: - case BUILT_IN_ATANL: + CASE_FLT_FN (BUILT_IN_EXP): + CASE_FLT_FN (BUILT_IN_EXP10): + CASE_FLT_FN (BUILT_IN_POW10): + CASE_FLT_FN (BUILT_IN_EXP2): + CASE_FLT_FN (BUILT_IN_EXPM1): + CASE_FLT_FN (BUILT_IN_LOGB): + CASE_FLT_FN (BUILT_IN_ILOGB): + CASE_FLT_FN (BUILT_IN_LOG): + CASE_FLT_FN (BUILT_IN_LOG10): + CASE_FLT_FN (BUILT_IN_LOG2): + CASE_FLT_FN (BUILT_IN_LOG1P): + CASE_FLT_FN (BUILT_IN_TAN): + CASE_FLT_FN (BUILT_IN_ASIN): + CASE_FLT_FN (BUILT_IN_ACOS): + CASE_FLT_FN (BUILT_IN_ATAN): /* Treat these like sqrt only if unsafe math optimizations are allowed, because of possible accuracy problems. */ if (! flag_unsafe_math_optimizations) break; - case BUILT_IN_SQRT: - case BUILT_IN_SQRTF: - case BUILT_IN_SQRTL: - case BUILT_IN_FLOOR: - case BUILT_IN_FLOORF: - case BUILT_IN_FLOORL: - case BUILT_IN_CEIL: - case BUILT_IN_CEILF: - case BUILT_IN_CEILL: - case BUILT_IN_TRUNC: - case BUILT_IN_TRUNCF: - case BUILT_IN_TRUNCL: - case BUILT_IN_ROUND: - case BUILT_IN_ROUNDF: - case BUILT_IN_ROUNDL: - case BUILT_IN_NEARBYINT: - case BUILT_IN_NEARBYINTF: - case BUILT_IN_NEARBYINTL: + CASE_FLT_FN (BUILT_IN_SQRT): + CASE_FLT_FN (BUILT_IN_FLOOR): + CASE_FLT_FN (BUILT_IN_CEIL): + CASE_FLT_FN (BUILT_IN_TRUNC): + CASE_FLT_FN (BUILT_IN_ROUND): + CASE_FLT_FN (BUILT_IN_NEARBYINT): + CASE_FLT_FN (BUILT_IN_RINT): + CASE_FLT_FN (BUILT_IN_LRINT): + CASE_FLT_FN (BUILT_IN_LLRINT): target = expand_builtin_mathfn (exp, target, subtarget); if (target) return target; break; - case BUILT_IN_POW: - case BUILT_IN_POWF: - case BUILT_IN_POWL: - if (! flag_unsafe_math_optimizations) - break; + CASE_FLT_FN (BUILT_IN_LCEIL): + CASE_FLT_FN (BUILT_IN_LLCEIL): + CASE_FLT_FN (BUILT_IN_LFLOOR): + CASE_FLT_FN (BUILT_IN_LLFLOOR): + target = expand_builtin_int_roundingfn (exp, target, subtarget); + if (target) + return target; + break; + + CASE_FLT_FN (BUILT_IN_POW): target = expand_builtin_pow (exp, target, subtarget); if (target) return target; break; - case BUILT_IN_ATAN2: - case BUILT_IN_ATAN2F: - case BUILT_IN_ATAN2L: + CASE_FLT_FN (BUILT_IN_POWI): + target = expand_builtin_powi (exp, target, subtarget); + if (target) + return target; + break; + + CASE_FLT_FN (BUILT_IN_ATAN2): + CASE_FLT_FN (BUILT_IN_LDEXP): + CASE_FLT_FN (BUILT_IN_FMOD): + CASE_FLT_FN (BUILT_IN_DREM): if (! flag_unsafe_math_optimizations) break; target = expand_builtin_mathfn_2 (exp, target, subtarget); @@ -5098,6 +5776,23 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return target; break; + CASE_FLT_FN (BUILT_IN_SIN): + CASE_FLT_FN (BUILT_IN_COS): + if (! flag_unsafe_math_optimizations) + break; + target = expand_builtin_mathfn_3 (exp, target, subtarget); + if (target) + return target; + break; + + CASE_FLT_FN (BUILT_IN_SINCOS): + if (! flag_unsafe_math_optimizations) + break; + target = expand_builtin_sincos (exp); + if (target) + return target; + break; + case BUILT_IN_APPLY_ARGS: return expand_builtin_apply_args (); @@ -5124,7 +5819,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, rtx ops[3]; for (t = arglist, i = 0; t; t = TREE_CHAIN (t), i++) - ops[i] = expand_expr (TREE_VALUE (t), NULL_RTX, VOIDmode, 0); + ops[i] = expand_normal (TREE_VALUE (t)); return expand_builtin_apply (ops[0], ops[1], ops[2]); } @@ -5134,8 +5829,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, memory returned by __builtin_apply. */ case BUILT_IN_RETURN: if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) - expand_builtin_return (expand_expr (TREE_VALUE (arglist), - NULL_RTX, VOIDmode, 0)); + expand_builtin_return (expand_normal (TREE_VALUE (arglist))); return const0_rtx; case BUILT_IN_SAVEREGS: @@ -5146,13 +5840,15 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, /* Return the address of the first anonymous stack arg. */ case BUILT_IN_NEXT_ARG: - return expand_builtin_next_arg (arglist); + if (fold_builtin_next_arg (arglist)) + return const0_rtx; + return expand_builtin_next_arg (); case BUILT_IN_CLASSIFY_TYPE: return expand_builtin_classify_type (arglist); case BUILT_IN_CONSTANT_P: - return expand_builtin_constant_p (arglist, target_mode); + return const0_rtx; case BUILT_IN_FRAME_ADDRESS: case BUILT_IN_RETURN_ADDRESS: @@ -5163,7 +5859,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_AGGREGATE_INCOMING_ADDRESS: if (arglist != 0 || ! AGGREGATE_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))) - || GET_CODE (DECL_RTL (DECL_RESULT (current_function_decl))) != MEM) + || !MEM_P (DECL_RTL (DECL_RESULT (current_function_decl)))) return const0_rtx; else return XEXP (DECL_RTL (DECL_RESULT (current_function_decl)), 0); @@ -5174,45 +5870,47 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return target; break; - case BUILT_IN_FFS: - case BUILT_IN_FFSL: - case BUILT_IN_FFSLL: + case BUILT_IN_STACK_SAVE: + return expand_stack_save (); + + case BUILT_IN_STACK_RESTORE: + expand_stack_restore (TREE_VALUE (arglist)); + return const0_rtx; + + CASE_INT_FN (BUILT_IN_FFS): + case BUILT_IN_FFSIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, ffs_optab); if (target) return target; break; - case BUILT_IN_CLZ: - case BUILT_IN_CLZL: - case BUILT_IN_CLZLL: + CASE_INT_FN (BUILT_IN_CLZ): + case BUILT_IN_CLZIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, clz_optab); if (target) return target; break; - case BUILT_IN_CTZ: - case BUILT_IN_CTZL: - case BUILT_IN_CTZLL: + CASE_INT_FN (BUILT_IN_CTZ): + case BUILT_IN_CTZIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, ctz_optab); if (target) return target; break; - case BUILT_IN_POPCOUNT: - case BUILT_IN_POPCOUNTL: - case BUILT_IN_POPCOUNTLL: + CASE_INT_FN (BUILT_IN_POPCOUNT): + case BUILT_IN_POPCOUNTIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, popcount_optab); if (target) return target; break; - case BUILT_IN_PARITY: - case BUILT_IN_PARITYL: - case BUILT_IN_PARITYLL: + CASE_INT_FN (BUILT_IN_PARITY): + case BUILT_IN_PARITYIMAX: target = expand_builtin_unop (target_mode, arglist, target, subtarget, parity_optab); if (target) @@ -5226,25 +5924,25 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_STRCPY: - target = expand_builtin_strcpy (arglist, target, mode); + target = expand_builtin_strcpy (fndecl, arglist, target, mode); if (target) return target; break; case BUILT_IN_STRNCPY: - target = expand_builtin_strncpy (arglist, target, mode); + target = expand_builtin_strncpy (exp, target, mode); if (target) return target; break; case BUILT_IN_STPCPY: - target = expand_builtin_stpcpy (arglist, target, mode); + target = expand_builtin_stpcpy (exp, target, mode); if (target) return target; break; case BUILT_IN_STRCAT: - target = expand_builtin_strcat (arglist, target, mode); + target = expand_builtin_strcat (fndecl, arglist, target, mode); if (target) return target; break; @@ -5268,63 +5966,64 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_STRSTR: - target = expand_builtin_strstr (arglist, target, mode); + target = expand_builtin_strstr (arglist, TREE_TYPE (exp), target, mode); if (target) return target; break; case BUILT_IN_STRPBRK: - target = expand_builtin_strpbrk (arglist, target, mode); + target = expand_builtin_strpbrk (arglist, TREE_TYPE (exp), target, mode); if (target) return target; break; case BUILT_IN_INDEX: case BUILT_IN_STRCHR: - target = expand_builtin_strchr (arglist, target, mode); + target = expand_builtin_strchr (arglist, TREE_TYPE (exp), target, mode); if (target) return target; break; case BUILT_IN_RINDEX: case BUILT_IN_STRRCHR: - target = expand_builtin_strrchr (arglist, target, mode); + target = expand_builtin_strrchr (arglist, TREE_TYPE (exp), target, mode); if (target) return target; break; case BUILT_IN_MEMCPY: - target = expand_builtin_memcpy (arglist, target, mode); + target = expand_builtin_memcpy (exp, target, mode); if (target) return target; break; case BUILT_IN_MEMPCPY: - target = expand_builtin_mempcpy (arglist, target, mode, /*endp=*/ 1); + target = expand_builtin_mempcpy (arglist, TREE_TYPE (exp), target, mode, /*endp=*/ 1); if (target) return target; break; case BUILT_IN_MEMMOVE: - target = expand_builtin_memmove (arglist, target, mode); + target = expand_builtin_memmove (arglist, TREE_TYPE (exp), target, + mode, exp); if (target) return target; break; case BUILT_IN_BCOPY: - target = expand_builtin_bcopy (arglist); + target = expand_builtin_bcopy (exp); if (target) return target; break; case BUILT_IN_MEMSET: - target = expand_builtin_memset (arglist, target, mode); + target = expand_builtin_memset (arglist, target, mode, exp); if (target) return target; break; case BUILT_IN_BZERO: - target = expand_builtin_bzero (arglist); + target = expand_builtin_bzero (exp); if (target) return target; break; @@ -5349,46 +6048,110 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_SETJMP: - target = expand_builtin_setjmp (arglist, target); - if (target) - return target; + /* This should have been lowered to the builtins below. */ + gcc_unreachable (); + + case BUILT_IN_SETJMP_SETUP: + /* __builtin_setjmp_setup is passed a pointer to an array of five words + and the receiver label. */ + if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + { + rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget, + VOIDmode, EXPAND_NORMAL); + tree label = TREE_OPERAND (TREE_VALUE (TREE_CHAIN (arglist)), 0); + rtx label_r = label_rtx (label); + + /* This is copied from the handling of non-local gotos. */ + expand_builtin_setjmp_setup (buf_addr, label_r); + nonlocal_goto_handler_labels + = gen_rtx_EXPR_LIST (VOIDmode, label_r, + nonlocal_goto_handler_labels); + /* ??? Do not let expand_label treat us as such since we would + not want to be both on the list of non-local labels and on + the list of forced labels. */ + FORCED_LABEL (label) = 0; + return const0_rtx; + } + break; + + case BUILT_IN_SETJMP_DISPATCHER: + /* __builtin_setjmp_dispatcher is passed the dispatcher label. */ + if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) + { + tree label = TREE_OPERAND (TREE_VALUE (arglist), 0); + rtx label_r = label_rtx (label); + + /* Remove the dispatcher label from the list of non-local labels + since the receiver labels have been added to it above. */ + remove_node_from_expr_list (label_r, &nonlocal_goto_handler_labels); + return const0_rtx; + } + break; + + case BUILT_IN_SETJMP_RECEIVER: + /* __builtin_setjmp_receiver is passed the receiver label. */ + if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) + { + tree label = TREE_OPERAND (TREE_VALUE (arglist), 0); + rtx label_r = label_rtx (label); + + expand_builtin_setjmp_receiver (label_r); + return const0_rtx; + } break; /* __builtin_longjmp is passed a pointer to an array of five words. It's similar to the C library longjmp function but works with __builtin_setjmp above. */ case BUILT_IN_LONGJMP: - if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - break; - else + if (validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) { rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget, - VOIDmode, 0); - rtx value = expand_expr (TREE_VALUE (TREE_CHAIN (arglist)), - NULL_RTX, VOIDmode, 0); + VOIDmode, EXPAND_NORMAL); + rtx value = expand_normal (TREE_VALUE (TREE_CHAIN (arglist))); if (value != const1_rtx) { - error ("__builtin_longjmp second argument must be 1"); + error ("%<__builtin_longjmp%> second argument must be 1"); return const0_rtx; } expand_builtin_longjmp (buf_addr, value); return const0_rtx; } + break; + + case BUILT_IN_NONLOCAL_GOTO: + target = expand_builtin_nonlocal_goto (arglist); + if (target) + return target; + break; + + /* This updates the setjmp buffer that is its argument with the value + of the current stack pointer. */ + case BUILT_IN_UPDATE_SETJMP_BUF: + if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) + { + rtx buf_addr + = expand_normal (TREE_VALUE (arglist)); + + expand_builtin_update_setjmp_buf (buf_addr); + return const0_rtx; + } + break; case BUILT_IN_TRAP: expand_builtin_trap (); return const0_rtx; case BUILT_IN_PRINTF: - target = expand_builtin_printf (arglist, target, mode, false); + target = expand_builtin_printf (exp, target, mode, false); if (target) return target; break; case BUILT_IN_PRINTF_UNLOCKED: - target = expand_builtin_printf (arglist, target, mode, true); + target = expand_builtin_printf (exp, target, mode, true); if (target) return target; break; @@ -5398,7 +6161,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, if (target) return target; break; - case BUILT_IN_FPUTS_UNLOCKED: target = expand_builtin_fputs (arglist, target, true); if (target) @@ -5406,13 +6168,13 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_FPRINTF: - target = expand_builtin_fprintf (arglist, target, mode, false); + target = expand_builtin_fprintf (exp, target, mode, false); if (target) return target; break; case BUILT_IN_FPRINTF_UNLOCKED: - target = expand_builtin_fprintf (arglist, target, mode, true); + target = expand_builtin_fprintf (exp, target, mode, true); if (target) return target; break; @@ -5423,6 +6185,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return target; break; + CASE_FLT_FN (BUILT_IN_SIGNBIT): + target = expand_builtin_signbit (exp, target); + if (target) + return target; + break; + /* Various hooks for the DWARF 2 __throw routine. */ case BUILT_IN_UNWIND_INIT: expand_builtin_unwind_init (); @@ -5464,11 +6232,251 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, expand_builtin_prefetch (arglist); return const0_rtx; + case BUILT_IN_PROFILE_FUNC_ENTER: + return expand_builtin_profile_func (false); + case BUILT_IN_PROFILE_FUNC_EXIT: + return expand_builtin_profile_func (true); + + case BUILT_IN_INIT_TRAMPOLINE: + return expand_builtin_init_trampoline (arglist); + case BUILT_IN_ADJUST_TRAMPOLINE: + return expand_builtin_adjust_trampoline (arglist); + + case BUILT_IN_FORK: + case BUILT_IN_EXECL: + case BUILT_IN_EXECV: + case BUILT_IN_EXECLP: + case BUILT_IN_EXECLE: + case BUILT_IN_EXECVP: + case BUILT_IN_EXECVE: + target = expand_builtin_fork_or_exec (fndecl, arglist, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_ADD_1: + case BUILT_IN_FETCH_AND_ADD_2: + case BUILT_IN_FETCH_AND_ADD_4: + case BUILT_IN_FETCH_AND_ADD_8: + case BUILT_IN_FETCH_AND_ADD_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_ADD_1); + target = expand_builtin_sync_operation (mode, arglist, PLUS, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_SUB_1: + case BUILT_IN_FETCH_AND_SUB_2: + case BUILT_IN_FETCH_AND_SUB_4: + case BUILT_IN_FETCH_AND_SUB_8: + case BUILT_IN_FETCH_AND_SUB_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_SUB_1); + target = expand_builtin_sync_operation (mode, arglist, MINUS, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_OR_1: + case BUILT_IN_FETCH_AND_OR_2: + case BUILT_IN_FETCH_AND_OR_4: + case BUILT_IN_FETCH_AND_OR_8: + case BUILT_IN_FETCH_AND_OR_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_OR_1); + target = expand_builtin_sync_operation (mode, arglist, IOR, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_AND_1: + case BUILT_IN_FETCH_AND_AND_2: + case BUILT_IN_FETCH_AND_AND_4: + case BUILT_IN_FETCH_AND_AND_8: + case BUILT_IN_FETCH_AND_AND_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_AND_1); + target = expand_builtin_sync_operation (mode, arglist, AND, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_XOR_1: + case BUILT_IN_FETCH_AND_XOR_2: + case BUILT_IN_FETCH_AND_XOR_4: + case BUILT_IN_FETCH_AND_XOR_8: + case BUILT_IN_FETCH_AND_XOR_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_XOR_1); + target = expand_builtin_sync_operation (mode, arglist, XOR, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_NAND_1: + case BUILT_IN_FETCH_AND_NAND_2: + case BUILT_IN_FETCH_AND_NAND_4: + case BUILT_IN_FETCH_AND_NAND_8: + case BUILT_IN_FETCH_AND_NAND_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_FETCH_AND_NAND_1); + target = expand_builtin_sync_operation (mode, arglist, NOT, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_ADD_AND_FETCH_1: + case BUILT_IN_ADD_AND_FETCH_2: + case BUILT_IN_ADD_AND_FETCH_4: + case BUILT_IN_ADD_AND_FETCH_8: + case BUILT_IN_ADD_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_ADD_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, PLUS, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_SUB_AND_FETCH_1: + case BUILT_IN_SUB_AND_FETCH_2: + case BUILT_IN_SUB_AND_FETCH_4: + case BUILT_IN_SUB_AND_FETCH_8: + case BUILT_IN_SUB_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_SUB_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, MINUS, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_OR_AND_FETCH_1: + case BUILT_IN_OR_AND_FETCH_2: + case BUILT_IN_OR_AND_FETCH_4: + case BUILT_IN_OR_AND_FETCH_8: + case BUILT_IN_OR_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_OR_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, IOR, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_AND_AND_FETCH_1: + case BUILT_IN_AND_AND_FETCH_2: + case BUILT_IN_AND_AND_FETCH_4: + case BUILT_IN_AND_AND_FETCH_8: + case BUILT_IN_AND_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_AND_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, AND, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_XOR_AND_FETCH_1: + case BUILT_IN_XOR_AND_FETCH_2: + case BUILT_IN_XOR_AND_FETCH_4: + case BUILT_IN_XOR_AND_FETCH_8: + case BUILT_IN_XOR_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_XOR_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, XOR, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_NAND_AND_FETCH_1: + case BUILT_IN_NAND_AND_FETCH_2: + case BUILT_IN_NAND_AND_FETCH_4: + case BUILT_IN_NAND_AND_FETCH_8: + case BUILT_IN_NAND_AND_FETCH_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_NAND_AND_FETCH_1); + target = expand_builtin_sync_operation (mode, arglist, NOT, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_BOOL_COMPARE_AND_SWAP_1: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_2: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_4: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_16: + if (mode == VOIDmode) + mode = TYPE_MODE (boolean_type_node); + if (!target || !register_operand (target, mode)) + target = gen_reg_rtx (mode); + + mode = get_builtin_sync_mode (fcode - BUILT_IN_BOOL_COMPARE_AND_SWAP_1); + target = expand_builtin_compare_and_swap (mode, arglist, true, target); + if (target) + return target; + break; + + case BUILT_IN_VAL_COMPARE_AND_SWAP_1: + case BUILT_IN_VAL_COMPARE_AND_SWAP_2: + case BUILT_IN_VAL_COMPARE_AND_SWAP_4: + case BUILT_IN_VAL_COMPARE_AND_SWAP_8: + case BUILT_IN_VAL_COMPARE_AND_SWAP_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_VAL_COMPARE_AND_SWAP_1); + target = expand_builtin_compare_and_swap (mode, arglist, false, target); + if (target) + return target; + break; + + case BUILT_IN_LOCK_TEST_AND_SET_1: + case BUILT_IN_LOCK_TEST_AND_SET_2: + case BUILT_IN_LOCK_TEST_AND_SET_4: + case BUILT_IN_LOCK_TEST_AND_SET_8: + case BUILT_IN_LOCK_TEST_AND_SET_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_LOCK_TEST_AND_SET_1); + target = expand_builtin_lock_test_and_set (mode, arglist, target); + if (target) + return target; + break; + + case BUILT_IN_LOCK_RELEASE_1: + case BUILT_IN_LOCK_RELEASE_2: + case BUILT_IN_LOCK_RELEASE_4: + case BUILT_IN_LOCK_RELEASE_8: + case BUILT_IN_LOCK_RELEASE_16: + mode = get_builtin_sync_mode (fcode - BUILT_IN_LOCK_RELEASE_1); + expand_builtin_lock_release (mode, arglist); + return const0_rtx; + + case BUILT_IN_SYNCHRONIZE: + expand_builtin_synchronize (); + return const0_rtx; + + case BUILT_IN_OBJECT_SIZE: + return expand_builtin_object_size (exp); + + case BUILT_IN_MEMCPY_CHK: + case BUILT_IN_MEMPCPY_CHK: + case BUILT_IN_MEMMOVE_CHK: + case BUILT_IN_MEMSET_CHK: + target = expand_builtin_memory_chk (exp, target, mode, fcode); + if (target) + return target; + break; + + case BUILT_IN_STRCPY_CHK: + case BUILT_IN_STPCPY_CHK: + case BUILT_IN_STRNCPY_CHK: + case BUILT_IN_STRCAT_CHK: + case BUILT_IN_SNPRINTF_CHK: + case BUILT_IN_VSNPRINTF_CHK: + maybe_emit_chk_warning (exp, fcode); + break; + + case BUILT_IN_SPRINTF_CHK: + case BUILT_IN_VSPRINTF_CHK: + maybe_emit_sprintf_chk_warning (exp, fcode); + break; default: /* just do library call, if unknown builtin */ - if (!DECL_ASSEMBLER_NAME_SET_P (fndecl)) - error ("built-in function `%s' not currently supported", - IDENTIFIER_POINTER (DECL_NAME (fndecl))); + break; } /* The switch statement above can drop through to cause the function @@ -5565,12 +6573,19 @@ fold_builtin_constant_p (tree arglist) STRIP_NOPS (arglist); /* If we know this is a constant, emit the constant of one. */ - if (TREE_CODE_CLASS (TREE_CODE (arglist)) == 'c' + if (CONSTANT_CLASS_P (arglist) || (TREE_CODE (arglist) == CONSTRUCTOR - && TREE_CONSTANT (arglist)) - || (TREE_CODE (arglist) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (arglist, 0)) == STRING_CST)) + && TREE_CONSTANT (arglist))) return integer_one_node; + if (TREE_CODE (arglist) == ADDR_EXPR) + { + tree op = TREE_OPERAND (arglist, 0); + if (TREE_CODE (op) == STRING_CST + || (TREE_CODE (op) == ARRAY_REF + && integer_zerop (TREE_OPERAND (op, 1)) + && TREE_CODE (TREE_OPERAND (op, 0)) == STRING_CST)) + return integer_one_node; + } /* If this expression has side effects, show we don't know it to be a constant. Likewise if it's a pointer or aggregate type since in @@ -5582,21 +6597,84 @@ fold_builtin_constant_p (tree arglist) if (TREE_SIDE_EFFECTS (arglist) || AGGREGATE_TYPE_P (TREE_TYPE (arglist)) || POINTER_TYPE_P (TREE_TYPE (arglist)) - || cfun == 0) + || cfun == 0 + || folding_initializer) return integer_zero_node; return 0; } +/* Fold a call to __builtin_expect, if we expect that a comparison against + the argument will fold to a constant. In practice, this means a true + constant or the address of a non-weak symbol. ARGLIST is the argument + list of the call. */ + +static tree +fold_builtin_expect (tree arglist) +{ + tree arg, inner; + + if (arglist == 0) + return 0; + + arg = TREE_VALUE (arglist); + + /* If the argument isn't invariant, then there's nothing we can do. */ + if (!TREE_INVARIANT (arg)) + return 0; + + /* If we're looking at an address of a weak decl, then do not fold. */ + inner = arg; + STRIP_NOPS (inner); + if (TREE_CODE (inner) == ADDR_EXPR) + { + do + { + inner = TREE_OPERAND (inner, 0); + } + while (TREE_CODE (inner) == COMPONENT_REF + || TREE_CODE (inner) == ARRAY_REF); + if (DECL_P (inner) && DECL_WEAK (inner)) + return 0; + } + + /* Otherwise, ARG already has the proper type for the return value. */ + return arg; +} + /* Fold a call to __builtin_classify_type. */ static tree fold_builtin_classify_type (tree arglist) { if (arglist == 0) - return build_int_2 (no_type_class, 0); + return build_int_cst (NULL_TREE, no_type_class); - return build_int_2 (type_to_class (TREE_TYPE (TREE_VALUE (arglist))), 0); + return build_int_cst (NULL_TREE, + type_to_class (TREE_TYPE (TREE_VALUE (arglist)))); +} + +/* Fold a call to __builtin_strlen. */ + +static tree +fold_builtin_strlen (tree arglist) +{ + if (!validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) + return NULL_TREE; + else + { + tree len = c_strlen (TREE_VALUE (arglist), 0); + + if (len) + { + /* Convert from the internal "sizetype" type to "size_t". */ + if (size_type_node) + len = fold_convert (size_type_node, len); + return len; + } + + return NULL_TREE; + } } /* Fold a call to __builtin_inf or __builtin_huge_val. */ @@ -5606,8 +6684,15 @@ fold_builtin_inf (tree type, int warn) { REAL_VALUE_TYPE real; + /* __builtin_inff is intended to be usable to define INFINITY on all + targets. If an infinity is not available, INFINITY expands "to a + positive constant of type float that overflows at translation + time", footnote "In this case, using INFINITY will violate the + constraint in 6.4.4 and thus require a diagnostic." (C99 7.12#4). + Thus we pedwarn to ensure this constraint violation is + diagnosed. */ if (!MODE_HAS_INFINITIES (TYPE_MODE (type)) && warn) - warning ("target format does not support infinity"); + pedwarn ("target format does not support infinity"); real_inf (&real); return build_real (type, real); @@ -5669,12 +6754,13 @@ integer_valued_real_p (tree t) case REAL_CST: if (! TREE_CONSTANT_OVERFLOW (t)) { - REAL_VALUE_TYPE c, cint; + REAL_VALUE_TYPE c, cint; c = TREE_REAL_CST (t); real_trunc (&cint, TYPE_MODE (TREE_TYPE (t)), &c); return real_identical (&c, &cint); } + break; case NOP_EXPR: { @@ -5689,21 +6775,12 @@ integer_valued_real_p (tree t) case CALL_EXPR: switch (builtin_mathfn_code (t)) { - case BUILT_IN_CEIL: - case BUILT_IN_CEILF: - case BUILT_IN_CEILL: - case BUILT_IN_FLOOR: - case BUILT_IN_FLOORF: - case BUILT_IN_FLOORL: - case BUILT_IN_NEARBYINT: - case BUILT_IN_NEARBYINTF: - case BUILT_IN_NEARBYINTL: - case BUILT_IN_ROUND: - case BUILT_IN_ROUNDF: - case BUILT_IN_ROUNDL: - case BUILT_IN_TRUNC: - case BUILT_IN_TRUNCF: - case BUILT_IN_TRUNCL: + CASE_FLT_FN (BUILT_IN_CEIL): + CASE_FLT_FN (BUILT_IN_FLOOR): + CASE_FLT_FN (BUILT_IN_NEARBYINT): + CASE_FLT_FN (BUILT_IN_RINT): + CASE_FLT_FN (BUILT_IN_ROUND): + CASE_FLT_FN (BUILT_IN_TRUNC): return true; default: @@ -5722,10 +6799,8 @@ integer_valued_real_p (tree t) Do the transformation. */ static tree -fold_trunc_transparent_mathfn (tree exp) +fold_trunc_transparent_mathfn (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); tree arg; @@ -5745,7 +6820,7 @@ fold_trunc_transparent_mathfn (tree exp) if (optimize) { tree arg0 = strip_float_extensions (arg); - tree ftype = TREE_TYPE (exp); + tree ftype = TREE_TYPE (TREE_TYPE (fndecl)); tree newtype = TREE_TYPE (arg0); tree decl; @@ -5753,20 +6828,94 @@ fold_trunc_transparent_mathfn (tree exp) && (decl = mathfn_built_in (newtype, fcode))) { arglist = - build_tree_list (NULL_TREE, fold (convert (newtype, arg0))); - return convert (ftype, - build_function_call_expr (decl, arglist)); + build_tree_list (NULL_TREE, fold_convert (newtype, arg0)); + return fold_convert (ftype, + build_function_call_expr (decl, arglist)); } } return 0; } -/* Fold function call to builtin cabs, cabsf or cabsl. FNDECL is the - function's DECL, ARGLIST is the argument list and TYPE is the return - type. Return NULL_TREE if no simplification can be made. */ +/* EXP is assumed to be builtin call which can narrow the FP type of + the argument, for instance lround((double)f) -> lroundf (f). */ static tree -fold_builtin_cabs (tree fndecl, tree arglist, tree type) +fold_fixed_mathfn (tree fndecl, tree arglist) +{ + enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); + tree arg; + + if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + + /* If argument is already integer valued, and we don't need to worry + about setting errno, there's no need to perform rounding. */ + if (! flag_errno_math && integer_valued_real_p (arg)) + return fold_build1 (FIX_TRUNC_EXPR, TREE_TYPE (TREE_TYPE (fndecl)), arg); + + if (optimize) + { + tree ftype = TREE_TYPE (arg); + tree arg0 = strip_float_extensions (arg); + tree newtype = TREE_TYPE (arg0); + tree decl; + + if (TYPE_PRECISION (newtype) < TYPE_PRECISION (ftype) + && (decl = mathfn_built_in (newtype, fcode))) + { + arglist = + build_tree_list (NULL_TREE, fold_convert (newtype, arg0)); + return build_function_call_expr (decl, arglist); + } + } + + /* Canonicalize llround (x) to lround (x) on LP64 targets where + sizeof (long long) == sizeof (long). */ + if (TYPE_PRECISION (long_long_integer_type_node) + == TYPE_PRECISION (long_integer_type_node)) + { + tree newfn = NULL_TREE; + switch (fcode) + { + CASE_FLT_FN (BUILT_IN_LLCEIL): + newfn = mathfn_built_in (TREE_TYPE (arg), BUILT_IN_LCEIL); + break; + + CASE_FLT_FN (BUILT_IN_LLFLOOR): + newfn = mathfn_built_in (TREE_TYPE (arg), BUILT_IN_LFLOOR); + break; + + CASE_FLT_FN (BUILT_IN_LLROUND): + newfn = mathfn_built_in (TREE_TYPE (arg), BUILT_IN_LROUND); + break; + + CASE_FLT_FN (BUILT_IN_LLRINT): + newfn = mathfn_built_in (TREE_TYPE (arg), BUILT_IN_LRINT); + break; + + default: + break; + } + + if (newfn) + { + tree newcall = build_function_call_expr (newfn, arglist); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), newcall); + } + } + + return 0; +} + +/* Fold function call to builtin cabs, cabsf or cabsl. ARGLIST + is the argument list, TYPE is the return type and FNDECL is the + original function DECL. Return NULL_TREE if no if no simplification + can be made. */ + +static tree +fold_builtin_cabs (tree arglist, tree type, tree fndecl) { tree arg; @@ -5802,43 +6951,42 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type) /* If either part is zero, cabs is fabs of the other. */ if (TREE_CODE (arg) == COMPLEX_EXPR && real_zerop (TREE_OPERAND (arg, 0))) - return fold (build1 (ABS_EXPR, type, TREE_OPERAND (arg, 1))); + return fold_build1 (ABS_EXPR, type, TREE_OPERAND (arg, 1)); if (TREE_CODE (arg) == COMPLEX_EXPR && real_zerop (TREE_OPERAND (arg, 1))) - return fold (build1 (ABS_EXPR, type, TREE_OPERAND (arg, 0))); + return fold_build1 (ABS_EXPR, type, TREE_OPERAND (arg, 0)); - if (flag_unsafe_math_optimizations) + /* Optimize cabs(-z) and cabs(conj(z)) as cabs(z). */ + if (TREE_CODE (arg) == NEGATE_EXPR + || TREE_CODE (arg) == CONJ_EXPR) { - enum built_in_function fcode; - tree sqrtfn; + tree arglist = build_tree_list (NULL_TREE, TREE_OPERAND (arg, 0)); + return build_function_call_expr (fndecl, arglist); + } - fcode = DECL_FUNCTION_CODE (fndecl); - if (fcode == BUILT_IN_CABS) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRT]; - else if (fcode == BUILT_IN_CABSF) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTF]; - else if (fcode == BUILT_IN_CABSL) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTL]; - else - sqrtfn = NULL_TREE; + /* Don't do this when optimizing for size. */ + if (flag_unsafe_math_optimizations + && optimize && !optimize_size) + { + tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT); if (sqrtfn != NULL_TREE) { tree rpart, ipart, result, arglist; - arg = save_expr (arg); + arg = builtin_save_expr (arg); - rpart = fold (build1 (REALPART_EXPR, type, arg)); - ipart = fold (build1 (IMAGPART_EXPR, type, arg)); + rpart = fold_build1 (REALPART_EXPR, type, arg); + ipart = fold_build1 (IMAGPART_EXPR, type, arg); - rpart = save_expr (rpart); - ipart = save_expr (ipart); + rpart = builtin_save_expr (rpart); + ipart = builtin_save_expr (ipart); - result = fold (build (PLUS_EXPR, type, - fold (build (MULT_EXPR, type, - rpart, rpart)), - fold (build (MULT_EXPR, type, - ipart, ipart)))); + result = fold_build2 (PLUS_EXPR, type, + fold_build2 (MULT_EXPR, type, + rpart, rpart), + fold_build2 (MULT_EXPR, type, + ipart, ipart)); arglist = build_tree_list (NULL_TREE, result); return build_function_call_expr (sqrtfn, arglist); @@ -5848,13 +6996,286 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type) return NULL_TREE; } +/* Fold a builtin function call to sqrt, sqrtf, or sqrtl. Return + NULL_TREE if no simplification can be made. */ + +static tree +fold_builtin_sqrt (tree arglist, tree type) +{ + + enum built_in_function fcode; + tree arg = TREE_VALUE (arglist); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize sqrt of constant value. */ + if (TREE_CODE (arg) == REAL_CST + && ! TREE_CONSTANT_OVERFLOW (arg)) + { + REAL_VALUE_TYPE r, x; + + x = TREE_REAL_CST (arg); + if (real_sqrt (&r, TYPE_MODE (type), &x) + || (!flag_trapping_math && !flag_errno_math)) + return build_real (type, r); + } + + /* Optimize sqrt(expN(x)) = expN(x*0.5). */ + fcode = builtin_mathfn_code (arg); + if (flag_unsafe_math_optimizations && BUILTIN_EXPONENT_P (fcode)) + { + tree expfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + arg = fold_build2 (MULT_EXPR, type, + TREE_VALUE (TREE_OPERAND (arg, 1)), + build_real (type, dconsthalf)); + arglist = build_tree_list (NULL_TREE, arg); + return build_function_call_expr (expfn, arglist); + } + + /* Optimize sqrt(Nroot(x)) -> pow(x,1/(2*N)). */ + if (flag_unsafe_math_optimizations && BUILTIN_ROOT_P (fcode)) + { + tree powfn = mathfn_built_in (type, BUILT_IN_POW); + + if (powfn) + { + tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); + tree tree_root; + /* The inner root was either sqrt or cbrt. */ + REAL_VALUE_TYPE dconstroot = + BUILTIN_SQRT_P (fcode) ? dconsthalf : dconstthird; + + /* Adjust for the outer root. */ + SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); + dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); + tree_root = build_real (type, dconstroot); + arglist = tree_cons (NULL_TREE, arg0, + build_tree_list (NULL_TREE, tree_root)); + return build_function_call_expr (powfn, arglist); + } + } + + /* Optimize sqrt(pow(x,y)) = pow(|x|,y*0.5). */ + if (flag_unsafe_math_optimizations + && (fcode == BUILT_IN_POW + || fcode == BUILT_IN_POWF + || fcode == BUILT_IN_POWL)) + { + tree powfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); + tree arg1 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1))); + tree narg1; + if (!tree_expr_nonnegative_p (arg0)) + arg0 = build1 (ABS_EXPR, type, arg0); + narg1 = fold_build2 (MULT_EXPR, type, arg1, + build_real (type, dconsthalf)); + arglist = tree_cons (NULL_TREE, arg0, + build_tree_list (NULL_TREE, narg1)); + return build_function_call_expr (powfn, arglist); + } + + return NULL_TREE; +} + +/* Fold a builtin function call to cbrt, cbrtf, or cbrtl. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_cbrt (tree arglist, tree type) +{ + tree arg = TREE_VALUE (arglist); + const enum built_in_function fcode = builtin_mathfn_code (arg); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize cbrt of constant value. */ + if (real_zerop (arg) || real_onep (arg) || real_minus_onep (arg)) + return arg; + + if (flag_unsafe_math_optimizations) + { + /* Optimize cbrt(expN(x)) -> expN(x/3). */ + if (BUILTIN_EXPONENT_P (fcode)) + { + tree expfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + const REAL_VALUE_TYPE third_trunc = + real_value_truncate (TYPE_MODE (type), dconstthird); + arg = fold_build2 (MULT_EXPR, type, + TREE_VALUE (TREE_OPERAND (arg, 1)), + build_real (type, third_trunc)); + arglist = build_tree_list (NULL_TREE, arg); + return build_function_call_expr (expfn, arglist); + } + + /* Optimize cbrt(sqrt(x)) -> pow(x,1/6). */ + if (BUILTIN_SQRT_P (fcode)) + { + tree powfn = mathfn_built_in (type, BUILT_IN_POW); + + if (powfn) + { + tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); + tree tree_root; + REAL_VALUE_TYPE dconstroot = dconstthird; + + SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1); + dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); + tree_root = build_real (type, dconstroot); + arglist = tree_cons (NULL_TREE, arg0, + build_tree_list (NULL_TREE, tree_root)); + return build_function_call_expr (powfn, arglist); + } + } + + /* Optimize cbrt(cbrt(x)) -> pow(x,1/9) iff x is nonnegative. */ + if (BUILTIN_CBRT_P (fcode)) + { + tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); + if (tree_expr_nonnegative_p (arg0)) + { + tree powfn = mathfn_built_in (type, BUILT_IN_POW); + + if (powfn) + { + tree tree_root; + REAL_VALUE_TYPE dconstroot; + + real_arithmetic (&dconstroot, MULT_EXPR, &dconstthird, &dconstthird); + dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot); + tree_root = build_real (type, dconstroot); + arglist = tree_cons (NULL_TREE, arg0, + build_tree_list (NULL_TREE, tree_root)); + return build_function_call_expr (powfn, arglist); + } + } + } + + /* Optimize cbrt(pow(x,y)) -> pow(x,y/3) iff x is nonnegative. */ + if (fcode == BUILT_IN_POW || fcode == BUILT_IN_POWF + || fcode == BUILT_IN_POWL) + { + tree arg00 = TREE_VALUE (TREE_OPERAND (arg, 1)); + tree arg01 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1))); + if (tree_expr_nonnegative_p (arg00)) + { + tree powfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + const REAL_VALUE_TYPE dconstroot + = real_value_truncate (TYPE_MODE (type), dconstthird); + tree narg01 = fold_build2 (MULT_EXPR, type, arg01, + build_real (type, dconstroot)); + arglist = tree_cons (NULL_TREE, arg00, + build_tree_list (NULL_TREE, narg01)); + return build_function_call_expr (powfn, arglist); + } + } + } + return NULL_TREE; +} + +/* Fold function call to builtin sin, sinf, or sinl. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_sin (tree arglist) +{ + tree arg = TREE_VALUE (arglist); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize sin (0.0) = 0.0. */ + if (real_zerop (arg)) + return arg; + + return NULL_TREE; +} + +/* Fold function call to builtin cos, cosf, or cosl. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_cos (tree arglist, tree type, tree fndecl) +{ + tree arg = TREE_VALUE (arglist); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize cos (0.0) = 1.0. */ + if (real_zerop (arg)) + return build_real (type, dconst1); + + /* Optimize cos(-x) into cos (x). */ + if (TREE_CODE (arg) == NEGATE_EXPR) + { + tree args = build_tree_list (NULL_TREE, + TREE_OPERAND (arg, 0)); + return build_function_call_expr (fndecl, args); + } + + return NULL_TREE; +} + +/* Fold function call to builtin tan, tanf, or tanl. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_tan (tree arglist) +{ + enum built_in_function fcode; + tree arg = TREE_VALUE (arglist); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize tan(0.0) = 0.0. */ + if (real_zerop (arg)) + return arg; + + /* Optimize tan(atan(x)) = x. */ + fcode = builtin_mathfn_code (arg); + if (flag_unsafe_math_optimizations + && (fcode == BUILT_IN_ATAN + || fcode == BUILT_IN_ATANF + || fcode == BUILT_IN_ATANL)) + return TREE_VALUE (TREE_OPERAND (arg, 1)); + + return NULL_TREE; +} + +/* Fold function call to builtin atan, atanf, or atanl. Return + NULL_TREE if no simplification can be made. */ + +static tree +fold_builtin_atan (tree arglist, tree type) +{ + + tree arg = TREE_VALUE (arglist); + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize atan(0.0) = 0.0. */ + if (real_zerop (arg)) + return arg; + + /* Optimize atan(1.0) = pi/4. */ + if (real_onep (arg)) + { + REAL_VALUE_TYPE cst; + + real_convert (&cst, TYPE_MODE (type), &dconstpi); + SET_REAL_EXP (&cst, REAL_EXP (&cst) - 2); + return build_real (type, cst); + } + + return NULL_TREE; +} + /* Fold function call to builtin trunc, truncf or truncl. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_trunc (tree exp) +fold_builtin_trunc (tree fndecl, tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -5865,23 +7286,22 @@ fold_builtin_trunc (tree exp) if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg)) { REAL_VALUE_TYPE r, x; - tree type = TREE_TYPE (exp); + tree type = TREE_TYPE (TREE_TYPE (fndecl)); x = TREE_REAL_CST (arg); real_trunc (&r, TYPE_MODE (type), &x); return build_real (type, r); } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin floor, floorf or floorl. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_floor (tree exp) +fold_builtin_floor (tree fndecl, tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -5896,7 +7316,7 @@ fold_builtin_floor (tree exp) x = TREE_REAL_CST (arg); if (! REAL_VALUE_ISNAN (x) || ! flag_errno_math) { - tree type = TREE_TYPE (exp); + tree type = TREE_TYPE (TREE_TYPE (fndecl)); REAL_VALUE_TYPE r; real_floor (&r, TYPE_MODE (type), &x); @@ -5904,16 +7324,15 @@ fold_builtin_floor (tree exp) } } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin ceil, ceilf or ceill. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_ceil (tree exp) +fold_builtin_ceil (tree fndecl, tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -5928,7 +7347,7 @@ fold_builtin_ceil (tree exp) x = TREE_REAL_CST (arg); if (! REAL_VALUE_ISNAN (x) || ! flag_errno_math) { - tree type = TREE_TYPE (exp); + tree type = TREE_TYPE (TREE_TYPE (fndecl)); REAL_VALUE_TYPE r; real_ceil (&r, TYPE_MODE (type), &x); @@ -5936,7 +7355,94 @@ fold_builtin_ceil (tree exp) } } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); +} + +/* Fold function call to builtin round, roundf or roundl. Return + NULL_TREE if no simplification can be made. */ + +static tree +fold_builtin_round (tree fndecl, tree arglist) +{ + tree arg; + + if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return 0; + + /* Optimize round of constant value. */ + arg = TREE_VALUE (arglist); + if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg)) + { + REAL_VALUE_TYPE x; + + x = TREE_REAL_CST (arg); + if (! REAL_VALUE_ISNAN (x) || ! flag_errno_math) + { + tree type = TREE_TYPE (TREE_TYPE (fndecl)); + REAL_VALUE_TYPE r; + + real_round (&r, TYPE_MODE (type), &x); + return build_real (type, r); + } + } + + return fold_trunc_transparent_mathfn (fndecl, arglist); +} + +/* Fold function call to builtin lround, lroundf or lroundl (or the + corresponding long long versions) and other rounding functions. + Return NULL_TREE if no simplification can be made. */ + +static tree +fold_builtin_int_roundingfn (tree fndecl, tree arglist) +{ + tree arg; + + if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return 0; + + /* Optimize lround of constant value. */ + arg = TREE_VALUE (arglist); + if (TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg)) + { + const REAL_VALUE_TYPE x = TREE_REAL_CST (arg); + + if (! REAL_VALUE_ISNAN (x) && ! REAL_VALUE_ISINF (x)) + { + tree itype = TREE_TYPE (TREE_TYPE (fndecl)); + tree ftype = TREE_TYPE (arg), result; + HOST_WIDE_INT hi, lo; + REAL_VALUE_TYPE r; + + switch (DECL_FUNCTION_CODE (fndecl)) + { + CASE_FLT_FN (BUILT_IN_LFLOOR): + CASE_FLT_FN (BUILT_IN_LLFLOOR): + real_floor (&r, TYPE_MODE (ftype), &x); + break; + + CASE_FLT_FN (BUILT_IN_LCEIL): + CASE_FLT_FN (BUILT_IN_LLCEIL): + real_ceil (&r, TYPE_MODE (ftype), &x); + break; + + CASE_FLT_FN (BUILT_IN_LROUND): + CASE_FLT_FN (BUILT_IN_LLROUND): + real_round (&r, TYPE_MODE (ftype), &x); + break; + + default: + gcc_unreachable (); + } + + REAL_VALUE_TO_INT (&lo, &hi, r); + result = build_int_cst_wide (NULL_TREE, lo, hi); + if (int_fits_type_p (result, itype)) + return fold_convert (itype, result); + } + } + + return fold_fixed_mathfn (fndecl, arglist); } /* Fold function call to builtin ffs, clz, ctz, popcount and parity @@ -5944,10 +7450,8 @@ fold_builtin_ceil (tree exp) Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_bitop (tree exp) +fold_builtin_bitop (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) @@ -5959,7 +7463,7 @@ fold_builtin_bitop (tree exp) { HOST_WIDE_INT hi, width, result; unsigned HOST_WIDE_INT lo; - tree type, t; + tree type; type = TREE_TYPE (arg); width = TYPE_PRECISION (type); @@ -5981,9 +7485,7 @@ fold_builtin_bitop (tree exp) switch (DECL_FUNCTION_CODE (fndecl)) { - case BUILT_IN_FFS: - case BUILT_IN_FFSL: - case BUILT_IN_FFSLL: + CASE_INT_FN (BUILT_IN_FFS): if (lo != 0) result = exact_log2 (lo & -lo) + 1; else if (hi != 0) @@ -5992,9 +7494,7 @@ fold_builtin_bitop (tree exp) result = 0; break; - case BUILT_IN_CLZ: - case BUILT_IN_CLZL: - case BUILT_IN_CLZLL: + CASE_INT_FN (BUILT_IN_CLZ): if (hi != 0) result = width - floor_log2 (hi) - 1 - HOST_BITS_PER_WIDE_INT; else if (lo != 0) @@ -6003,9 +7503,7 @@ fold_builtin_bitop (tree exp) result = width; break; - case BUILT_IN_CTZ: - case BUILT_IN_CTZL: - case BUILT_IN_CTZLL: + CASE_INT_FN (BUILT_IN_CTZ): if (lo != 0) result = exact_log2 (lo & -lo); else if (hi != 0) @@ -6014,9 +7512,7 @@ fold_builtin_bitop (tree exp) result = width; break; - case BUILT_IN_POPCOUNT: - case BUILT_IN_POPCOUNTL: - case BUILT_IN_POPCOUNTLL: + CASE_INT_FN (BUILT_IN_POPCOUNT): result = 0; while (lo) result++, lo &= lo - 1; @@ -6024,9 +7520,7 @@ fold_builtin_bitop (tree exp) result++, hi &= hi - 1; break; - case BUILT_IN_PARITY: - case BUILT_IN_PARITYL: - case BUILT_IN_PARITYLL: + CASE_INT_FN (BUILT_IN_PARITY): result = 0; while (lo) result++, lo &= lo - 1; @@ -6036,12 +7530,10 @@ fold_builtin_bitop (tree exp) break; default: - abort(); + gcc_unreachable (); } - t = build_int_2 (result, 0); - TREE_TYPE (t) = TREE_TYPE (exp); - return t; + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), result); } return NULL_TREE; @@ -6055,44 +7547,42 @@ real_dconstp (tree expr, const REAL_VALUE_TYPE *value) STRIP_NOPS (expr); return ((TREE_CODE (expr) == REAL_CST - && ! TREE_CONSTANT_OVERFLOW (expr) - && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), *value)) - || (TREE_CODE (expr) == COMPLEX_CST - && real_dconstp (TREE_REALPART (expr), value) - && real_zerop (TREE_IMAGPART (expr)))); + && ! TREE_CONSTANT_OVERFLOW (expr) + && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), *value)) + || (TREE_CODE (expr) == COMPLEX_CST + && real_dconstp (TREE_REALPART (expr), value) + && real_zerop (TREE_IMAGPART (expr)))); } /* A subroutine of fold_builtin to fold the various logarithmic - functions. EXP is the CALL_EXPR of a call to a builtin log* - function. VALUE is the base of the log* function. */ + functions. EXP is the CALL_EXPR of a call to a builtin logN + function. VALUE is the base of the logN function. */ static tree -fold_builtin_logarithm (tree exp, const REAL_VALUE_TYPE *value) +fold_builtin_logarithm (tree fndecl, tree arglist, + const REAL_VALUE_TYPE *value) { - tree arglist = TREE_OPERAND (exp, 1); - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) { - tree fndecl = get_callee_fndecl (exp); tree type = TREE_TYPE (TREE_TYPE (fndecl)); tree arg = TREE_VALUE (arglist); const enum built_in_function fcode = builtin_mathfn_code (arg); - - /* Optimize log*(1.0) = 0.0. */ + + /* Optimize logN(1.0) = 0.0. */ if (real_onep (arg)) return build_real (type, dconst0); /* Optimize logN(N) = 1.0. If N can't be truncated to MODE - exactly, then only do this if flag_unsafe_math_optimizations. */ + exactly, then only do this if flag_unsafe_math_optimizations. */ if (exact_real_truncate (TYPE_MODE (type), value) || flag_unsafe_math_optimizations) - { + { const REAL_VALUE_TYPE value_truncate = real_value_truncate (TYPE_MODE (type), *value); if (real_dconstp (arg, &value_truncate)) return build_real (type, dconst1); } - + /* Special case, optimize logN(expN(x)) = x. */ if (flag_unsafe_math_optimizations && ((value == &dconste @@ -6103,64 +7593,47 @@ fold_builtin_logarithm (tree exp, const REAL_VALUE_TYPE *value) && (fcode == BUILT_IN_EXP2 || fcode == BUILT_IN_EXP2F || fcode == BUILT_IN_EXP2L)) - || (value == &dconst10 - && (fcode == BUILT_IN_EXP10 - || fcode == BUILT_IN_EXP10F - || fcode == BUILT_IN_EXP10L)))) - return convert (type, TREE_VALUE (TREE_OPERAND (arg, 1))); + || (value == &dconst10 && (BUILTIN_EXP10_P (fcode))))) + return fold_convert (type, TREE_VALUE (TREE_OPERAND (arg, 1))); - /* Optimize log*(func()) for various exponential functions. We - want to determine the value "x" and the power "exponent" in - order to transform logN(x**exponent) into exponent*logN(x). */ + /* Optimize logN(func()) for various exponential functions. We + want to determine the value "x" and the power "exponent" in + order to transform logN(x**exponent) into exponent*logN(x). */ if (flag_unsafe_math_optimizations) - { + { tree exponent = 0, x = 0; - + switch (fcode) { - case BUILT_IN_EXP: - case BUILT_IN_EXPF: - case BUILT_IN_EXPL: + CASE_FLT_FN (BUILT_IN_EXP): /* Prepare to do logN(exp(exponent) -> exponent*logN(e). */ x = build_real (type, real_value_truncate (TYPE_MODE (type), dconste)); exponent = TREE_VALUE (TREE_OPERAND (arg, 1)); break; - case BUILT_IN_EXP2: - case BUILT_IN_EXP2F: - case BUILT_IN_EXP2L: + CASE_FLT_FN (BUILT_IN_EXP2): /* Prepare to do logN(exp2(exponent) -> exponent*logN(2). */ x = build_real (type, dconst2); exponent = TREE_VALUE (TREE_OPERAND (arg, 1)); break; - case BUILT_IN_EXP10: - case BUILT_IN_EXP10F: - case BUILT_IN_EXP10L: - case BUILT_IN_POW10: - case BUILT_IN_POW10F: - case BUILT_IN_POW10L: + CASE_FLT_FN (BUILT_IN_EXP10): + CASE_FLT_FN (BUILT_IN_POW10): /* Prepare to do logN(exp10(exponent) -> exponent*logN(10). */ x = build_real (type, dconst10); exponent = TREE_VALUE (TREE_OPERAND (arg, 1)); break; - case BUILT_IN_SQRT: - case BUILT_IN_SQRTF: - case BUILT_IN_SQRTL: + CASE_FLT_FN (BUILT_IN_SQRT): /* Prepare to do logN(sqrt(x) -> 0.5*logN(x). */ x = TREE_VALUE (TREE_OPERAND (arg, 1)); exponent = build_real (type, dconsthalf); break; - case BUILT_IN_CBRT: - case BUILT_IN_CBRTF: - case BUILT_IN_CBRTL: + CASE_FLT_FN (BUILT_IN_CBRT): /* Prepare to do logN(cbrt(x) -> (1/3)*logN(x). */ x = TREE_VALUE (TREE_OPERAND (arg, 1)); exponent = build_real (type, real_value_truncate (TYPE_MODE (type), dconstthird)); break; - case BUILT_IN_POW: - case BUILT_IN_POWF: - case BUILT_IN_POWL: + CASE_FLT_FN (BUILT_IN_POW): /* Prepare to do logN(pow(x,exponent) -> exponent*logN(x). */ x = TREE_VALUE (TREE_OPERAND (arg, 1)); exponent = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1))); @@ -6175,26 +7648,212 @@ fold_builtin_logarithm (tree exp, const REAL_VALUE_TYPE *value) tree logfn; arglist = build_tree_list (NULL_TREE, x); logfn = build_function_call_expr (fndecl, arglist); - return fold (build (MULT_EXPR, type, exponent, logfn)); + return fold_build2 (MULT_EXPR, type, exponent, logfn); } } } return 0; } - + +/* Fold a builtin function call to pow, powf, or powl. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_pow (tree fndecl, tree arglist, tree type) +{ + tree arg0 = TREE_VALUE (arglist); + tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + + if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize pow(1.0,y) = 1.0. */ + if (real_onep (arg0)) + return omit_one_operand (type, build_real (type, dconst1), arg1); + + if (TREE_CODE (arg1) == REAL_CST + && ! TREE_CONSTANT_OVERFLOW (arg1)) + { + REAL_VALUE_TYPE cint; + REAL_VALUE_TYPE c; + HOST_WIDE_INT n; + + c = TREE_REAL_CST (arg1); + + /* Optimize pow(x,0.0) = 1.0. */ + if (REAL_VALUES_EQUAL (c, dconst0)) + return omit_one_operand (type, build_real (type, dconst1), + arg0); + + /* Optimize pow(x,1.0) = x. */ + if (REAL_VALUES_EQUAL (c, dconst1)) + return arg0; + + /* Optimize pow(x,-1.0) = 1.0/x. */ + if (REAL_VALUES_EQUAL (c, dconstm1)) + return fold_build2 (RDIV_EXPR, type, + build_real (type, dconst1), arg0); + + /* Optimize pow(x,0.5) = sqrt(x). */ + if (flag_unsafe_math_optimizations + && REAL_VALUES_EQUAL (c, dconsthalf)) + { + tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT); + + if (sqrtfn != NULL_TREE) + { + tree arglist = build_tree_list (NULL_TREE, arg0); + return build_function_call_expr (sqrtfn, arglist); + } + } + + /* Check for an integer exponent. */ + n = real_to_integer (&c); + real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0); + if (real_identical (&c, &cint)) + { + /* Attempt to evaluate pow at compile-time. */ + if (TREE_CODE (arg0) == REAL_CST + && ! TREE_CONSTANT_OVERFLOW (arg0)) + { + REAL_VALUE_TYPE x; + bool inexact; + + x = TREE_REAL_CST (arg0); + inexact = real_powi (&x, TYPE_MODE (type), &x, n); + if (flag_unsafe_math_optimizations || !inexact) + return build_real (type, x); + } + + /* Strip sign ops from even integer powers. */ + if ((n & 1) == 0 && flag_unsafe_math_optimizations) + { + tree narg0 = fold_strip_sign_ops (arg0); + if (narg0) + { + arglist = build_tree_list (NULL_TREE, arg1); + arglist = tree_cons (NULL_TREE, narg0, arglist); + return build_function_call_expr (fndecl, arglist); + } + } + } + } + + if (flag_unsafe_math_optimizations) + { + const enum built_in_function fcode = builtin_mathfn_code (arg0); + + /* Optimize pow(expN(x),y) = expN(x*y). */ + if (BUILTIN_EXPONENT_P (fcode)) + { + tree expfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); + tree arg = TREE_VALUE (TREE_OPERAND (arg0, 1)); + arg = fold_build2 (MULT_EXPR, type, arg, arg1); + arglist = build_tree_list (NULL_TREE, arg); + return build_function_call_expr (expfn, arglist); + } + + /* Optimize pow(sqrt(x),y) = pow(x,y*0.5). */ + if (BUILTIN_SQRT_P (fcode)) + { + tree narg0 = TREE_VALUE (TREE_OPERAND (arg0, 1)); + tree narg1 = fold_build2 (MULT_EXPR, type, arg1, + build_real (type, dconsthalf)); + + arglist = tree_cons (NULL_TREE, narg0, + build_tree_list (NULL_TREE, narg1)); + return build_function_call_expr (fndecl, arglist); + } + + /* Optimize pow(cbrt(x),y) = pow(x,y/3) iff x is nonnegative. */ + if (BUILTIN_CBRT_P (fcode)) + { + tree arg = TREE_VALUE (TREE_OPERAND (arg0, 1)); + if (tree_expr_nonnegative_p (arg)) + { + const REAL_VALUE_TYPE dconstroot + = real_value_truncate (TYPE_MODE (type), dconstthird); + tree narg1 = fold_build2 (MULT_EXPR, type, arg1, + build_real (type, dconstroot)); + arglist = tree_cons (NULL_TREE, arg, + build_tree_list (NULL_TREE, narg1)); + return build_function_call_expr (fndecl, arglist); + } + } + + /* Optimize pow(pow(x,y),z) = pow(x,y*z). */ + if (fcode == BUILT_IN_POW || fcode == BUILT_IN_POWF + || fcode == BUILT_IN_POWL) + { + tree arg00 = TREE_VALUE (TREE_OPERAND (arg0, 1)); + tree arg01 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg0, 1))); + tree narg1 = fold_build2 (MULT_EXPR, type, arg01, arg1); + arglist = tree_cons (NULL_TREE, arg00, + build_tree_list (NULL_TREE, narg1)); + return build_function_call_expr (fndecl, arglist); + } + } + + return NULL_TREE; +} + +/* Fold a builtin function call to powi, powif, or powil. Return + NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_powi (tree fndecl ATTRIBUTE_UNUSED, tree arglist, tree type) +{ + tree arg0 = TREE_VALUE (arglist); + tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + + if (!validate_arglist (arglist, REAL_TYPE, INTEGER_TYPE, VOID_TYPE)) + return NULL_TREE; + + /* Optimize pow(1.0,y) = 1.0. */ + if (real_onep (arg0)) + return omit_one_operand (type, build_real (type, dconst1), arg1); + + if (host_integerp (arg1, 0)) + { + HOST_WIDE_INT c = TREE_INT_CST_LOW (arg1); + + /* Evaluate powi at compile-time. */ + if (TREE_CODE (arg0) == REAL_CST + && ! TREE_CONSTANT_OVERFLOW (arg0)) + { + REAL_VALUE_TYPE x; + x = TREE_REAL_CST (arg0); + real_powi (&x, TYPE_MODE (type), &x, c); + return build_real (type, x); + } + + /* Optimize pow(x,0) = 1.0. */ + if (c == 0) + return omit_one_operand (type, build_real (type, dconst1), + arg0); + + /* Optimize pow(x,1) = x. */ + if (c == 1) + return arg0; + + /* Optimize pow(x,-1) = 1.0/x. */ + if (c == -1) + return fold_build2 (RDIV_EXPR, type, + build_real (type, dconst1), arg0); + } + + return NULL_TREE; +} + /* A subroutine of fold_builtin to fold the various exponent functions. EXP is the CALL_EXPR of a call to a builtin function. VALUE is the value which will be raised to a power. */ static tree -fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value) +fold_builtin_exponent (tree fndecl, tree arglist, + const REAL_VALUE_TYPE *value) { - tree arglist = TREE_OPERAND (exp, 1); - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) { - tree fndecl = get_callee_fndecl (exp); tree type = TREE_TYPE (TREE_TYPE (fndecl)); tree arg = TREE_VALUE (arglist); @@ -6204,7 +7863,7 @@ fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value) /* Optimize expN(1.0) = N. */ if (real_onep (arg)) - { + { REAL_VALUE_TYPE cst; real_convert (&cst, TYPE_MODE (type), value); @@ -6215,7 +7874,7 @@ fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value) if (flag_unsafe_math_optimizations && TREE_CODE (arg) == REAL_CST && ! TREE_CONSTANT_OVERFLOW (arg)) - { + { REAL_VALUE_TYPE cint; REAL_VALUE_TYPE c; HOST_WIDE_INT n; @@ -6235,7 +7894,7 @@ fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value) /* Optimize expN(logN(x)) = x. */ if (flag_unsafe_math_optimizations) - { + { const enum built_in_function fcode = builtin_mathfn_code (arg); if ((value == &dconste @@ -6250,84 +7909,142 @@ fold_builtin_exponent (tree exp, const REAL_VALUE_TYPE *value) && (fcode == BUILT_IN_LOG10 || fcode == BUILT_IN_LOG10F || fcode == BUILT_IN_LOG10L))) - return convert (type, TREE_VALUE (TREE_OPERAND (arg, 1))); + return fold_convert (type, TREE_VALUE (TREE_OPERAND (arg, 1))); } } return 0; } -/* Fold function call to builtin memcpy. Return - NULL_TREE if no simplification can be made. */ +/* Return true if VAR is a VAR_DECL or a component thereof. */ -static tree -fold_builtin_memcpy (tree exp) +static bool +var_decl_component_p (tree var) { - tree arglist = TREE_OPERAND (exp, 1); - tree dest, src, len; - - if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) - return 0; - - dest = TREE_VALUE (arglist); - src = TREE_VALUE (TREE_CHAIN (arglist)); - len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - - /* If the LEN parameter is zero, return DEST. */ - if (integer_zerop (len)) - return omit_one_operand (TREE_TYPE (exp), dest, src); - - /* If SRC and DEST are the same (and not volatile), return DEST. */ - if (operand_equal_p (src, dest, 0)) - return omit_one_operand (TREE_TYPE (exp), dest, len); - - return 0; + tree inner = var; + while (handled_component_p (inner)) + inner = TREE_OPERAND (inner, 0); + return SSA_VAR_P (inner); } -/* Fold function call to builtin mempcpy. Return +/* Fold function call to builtin memset. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_mempcpy (tree exp) +fold_builtin_memset (tree arglist, tree type, bool ignore) { - tree arglist = TREE_OPERAND (exp, 1); - tree dest, src, len; + tree dest, c, len, var, ret; + unsigned HOST_WIDE_INT length, cval; if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; dest = TREE_VALUE (arglist); - src = TREE_VALUE (TREE_CHAIN (arglist)); + c = TREE_VALUE (TREE_CHAIN (arglist)); len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + if (! host_integerp (len, 1)) + return 0; + /* If the LEN parameter is zero, return DEST. */ if (integer_zerop (len)) - return omit_one_operand (TREE_TYPE (exp), dest, src); + return omit_one_operand (type, dest, c); - /* If SRC and DEST are the same (and not volatile), return DEST+LEN. */ - if (operand_equal_p (src, dest, 0)) + if (! host_integerp (c, 1) || TREE_SIDE_EFFECTS (dest)) + return 0; + + var = dest; + STRIP_NOPS (var); + if (TREE_CODE (var) != ADDR_EXPR) + return 0; + + var = TREE_OPERAND (var, 0); + if (TREE_THIS_VOLATILE (var)) + return 0; + + if (!INTEGRAL_TYPE_P (TREE_TYPE (var)) + && !POINTER_TYPE_P (TREE_TYPE (var))) + return 0; + + if (! var_decl_component_p (var)) + return 0; + + length = tree_low_cst (len, 1); + if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (var))) != length + || get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT + < (int) length) + return 0; + + if (length > HOST_BITS_PER_WIDE_INT / BITS_PER_UNIT) + return 0; + + if (integer_zerop (c)) + cval = 0; + else { - tree temp = convert (TREE_TYPE (dest), len); - temp = fold (build (PLUS_EXPR, TREE_TYPE (dest), dest, len)); - return convert (TREE_TYPE (exp), temp); + if (CHAR_BIT != 8 || BITS_PER_UNIT != 8 || HOST_BITS_PER_WIDE_INT > 64) + return 0; + + cval = tree_low_cst (c, 1); + cval &= 0xff; + cval |= cval << 8; + cval |= cval << 16; + cval |= (cval << 31) << 1; } - return 0; + ret = build_int_cst_type (TREE_TYPE (var), cval); + ret = build2 (MODIFY_EXPR, TREE_TYPE (var), var, ret); + if (ignore) + return ret; + + return omit_one_operand (type, dest, ret); } -/* Fold function call to builtin memmove. Return +/* Fold function call to builtin memset. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_memmove (tree exp) +fold_builtin_bzero (tree arglist, bool ignore) { - tree arglist = TREE_OPERAND (exp, 1); - tree dest, src, len; + tree dest, size, newarglist; - if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + if (!ignore) + return 0; + + dest = TREE_VALUE (arglist); + size = TREE_VALUE (TREE_CHAIN (arglist)); + + /* New argument list transforming bzero(ptr x, int y) to + memset(ptr x, int 0, size_t y). This is done this way + so that if it isn't expanded inline, we fallback to + calling bzero instead of memset. */ + + newarglist = build_tree_list (NULL_TREE, fold_convert (sizetype, size)); + newarglist = tree_cons (NULL_TREE, integer_zero_node, newarglist); + newarglist = tree_cons (NULL_TREE, dest, newarglist); + return fold_builtin_memset (newarglist, void_type_node, ignore); +} + +/* Fold function call to builtin mem{{,p}cpy,move}. Return + NULL_TREE if no simplification can be made. + If ENDP is 0, return DEST (like memcpy). + If ENDP is 1, return DEST+LEN (like mempcpy). + If ENDP is 2, return DEST+LEN-1 (like stpcpy). + If ENDP is 3, return DEST, additionally *SRC and *DEST may overlap + (memmove). */ + +static tree +fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp) +{ + tree dest, src, len, destvar, srcvar, expr; + unsigned HOST_WIDE_INT length; + + if (! validate_arglist (arglist, + POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; dest = TREE_VALUE (arglist); @@ -6336,23 +8053,133 @@ fold_builtin_memmove (tree exp) /* If the LEN parameter is zero, return DEST. */ if (integer_zerop (len)) - return omit_one_operand (TREE_TYPE (exp), dest, src); + return omit_one_operand (type, dest, src); - /* If SRC and DEST are the same (and not volatile), return DEST. */ + /* If SRC and DEST are the same (and not volatile), return + DEST{,+LEN,+LEN-1}. */ if (operand_equal_p (src, dest, 0)) - return omit_one_operand (TREE_TYPE (exp), dest, len); + expr = len; + else + { + if (! host_integerp (len, 1)) + return 0; - return 0; + if (TREE_SIDE_EFFECTS (dest) || TREE_SIDE_EFFECTS (src)) + return 0; + + destvar = dest; + STRIP_NOPS (destvar); + if (TREE_CODE (destvar) != ADDR_EXPR) + return 0; + + destvar = TREE_OPERAND (destvar, 0); + if (TREE_THIS_VOLATILE (destvar)) + return 0; + + if (!INTEGRAL_TYPE_P (TREE_TYPE (destvar)) + && !POINTER_TYPE_P (TREE_TYPE (destvar)) + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (destvar))) + return 0; + + if (! var_decl_component_p (destvar)) + return 0; + + srcvar = src; + STRIP_NOPS (srcvar); + if (TREE_CODE (srcvar) != ADDR_EXPR) + return 0; + + srcvar = TREE_OPERAND (srcvar, 0); + if (TREE_THIS_VOLATILE (srcvar)) + return 0; + + if (!INTEGRAL_TYPE_P (TREE_TYPE (srcvar)) + && !POINTER_TYPE_P (TREE_TYPE (srcvar)) + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (srcvar))) + return 0; + + if (! var_decl_component_p (srcvar)) + return 0; + + length = tree_low_cst (len, 1); + if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (destvar))) != length + || get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT + < (int) length + || GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (srcvar))) != length + || get_pointer_alignment (src, BIGGEST_ALIGNMENT) / BITS_PER_UNIT + < (int) length) + return 0; + + if ((INTEGRAL_TYPE_P (TREE_TYPE (srcvar)) + || POINTER_TYPE_P (TREE_TYPE (srcvar))) + && (INTEGRAL_TYPE_P (TREE_TYPE (destvar)) + || POINTER_TYPE_P (TREE_TYPE (destvar)))) + expr = fold_convert (TREE_TYPE (destvar), srcvar); + else + expr = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (destvar), srcvar); + expr = build2 (MODIFY_EXPR, TREE_TYPE (destvar), destvar, expr); + } + + if (ignore) + return expr; + + if (endp == 0 || endp == 3) + return omit_one_operand (type, dest, expr); + + if (expr == len) + expr = 0; + + if (endp == 2) + len = fold_build2 (MINUS_EXPR, TREE_TYPE (len), len, + ssize_int (1)); + + len = fold_convert (TREE_TYPE (dest), len); + dest = fold_build2 (PLUS_EXPR, TREE_TYPE (dest), dest, len); + dest = fold_convert (type, dest); + if (expr) + dest = omit_one_operand (type, dest, expr); + return dest; } -/* Fold function call to builtin strcpy. Return - NULL_TREE if no simplification can be made. */ +/* Fold function call to builtin bcopy. Return NULL_TREE if no + simplification can be made. */ static tree -fold_builtin_strcpy (tree exp) +fold_builtin_bcopy (tree arglist, bool ignore) { - tree arglist = TREE_OPERAND (exp, 1); - tree dest, src; + tree src, dest, size, newarglist; + + if (!validate_arglist (arglist, + POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + if (! ignore) + return 0; + + src = TREE_VALUE (arglist); + dest = TREE_VALUE (TREE_CHAIN (arglist)); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + /* New argument list transforming bcopy(ptr x, ptr y, int z) to + memmove(ptr y, ptr x, size_t z). This is done this way + so that if it isn't expanded inline, we fallback to + calling bcopy instead of memmove. */ + + newarglist = build_tree_list (NULL_TREE, fold_convert (sizetype, size)); + newarglist = tree_cons (NULL_TREE, src, newarglist); + newarglist = tree_cons (NULL_TREE, dest, newarglist); + + return fold_builtin_memory_op (newarglist, void_type_node, true, /*endp=*/3); +} + +/* Fold function call to builtin strcpy. If LEN is not NULL, it represents + the length of the string to be copied. Return NULL_TREE if no + simplification can be made. */ + +tree +fold_builtin_strcpy (tree fndecl, tree arglist, tree len) +{ + tree dest, src, fn; if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) @@ -6363,19 +8190,38 @@ fold_builtin_strcpy (tree exp) /* If SRC and DEST are the same (and not volatile), return DEST. */ if (operand_equal_p (src, dest, 0)) - return convert (TREE_TYPE (exp), dest); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), dest); - return 0; + if (optimize_size) + return 0; + + fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; + if (!fn) + return 0; + + if (!len) + { + len = c_strlen (src, 1); + if (! len || TREE_SIDE_EFFECTS (len)) + return 0; + } + + len = size_binop (PLUS_EXPR, len, ssize_int (1)); + arglist = build_tree_list (NULL_TREE, len); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), + build_function_call_expr (fn, arglist)); } -/* Fold function call to builtin strncpy. Return - NULL_TREE if no simplification can be made. */ +/* Fold function call to builtin strncpy. If SLEN is not NULL, it represents + the length of the source string. Return NULL_TREE if no simplification + can be made. */ -static tree -fold_builtin_strncpy (tree exp) +tree +fold_builtin_strncpy (tree fndecl, tree arglist, tree slen) { - tree arglist = TREE_OPERAND (exp, 1); - tree dest, src, len; + tree dest, src, len, fn; if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -6387,19 +8233,44 @@ fold_builtin_strncpy (tree exp) /* If the LEN parameter is zero, return DEST. */ if (integer_zerop (len)) - return omit_one_operand (TREE_TYPE (exp), dest, src); + return omit_one_operand (TREE_TYPE (TREE_TYPE (fndecl)), dest, src); - return 0; + /* We can't compare slen with len as constants below if len is not a + constant. */ + if (len == 0 || TREE_CODE (len) != INTEGER_CST) + return 0; + + if (!slen) + slen = c_strlen (src, 1); + + /* Now, we must be passed a constant src ptr parameter. */ + if (slen == 0 || TREE_CODE (slen) != INTEGER_CST) + return 0; + + slen = size_binop (PLUS_EXPR, slen, ssize_int (1)); + + /* We do not support simplification of this case, though we do + support it when expanding trees into RTL. */ + /* FIXME: generate a call to __builtin_memset. */ + if (tree_int_cst_lt (slen, len)) + return 0; + + /* OK transform into builtin memcpy. */ + fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; + if (!fn) + return 0; + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), + build_function_call_expr (fn, arglist)); } /* Fold function call to builtin memcmp. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_memcmp (tree exp) +fold_builtin_memcmp (tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg1, arg2, len; + const char *p1, *p2; if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -6411,14 +8282,50 @@ fold_builtin_memcmp (tree exp) /* If the LEN parameter is zero, return zero. */ if (integer_zerop (len)) - { - tree temp = omit_one_operand (TREE_TYPE (exp), integer_zero_node, arg2); - return omit_one_operand (TREE_TYPE (exp), temp, arg1); - } + return omit_two_operands (integer_type_node, integer_zero_node, + arg1, arg2); /* If ARG1 and ARG2 are the same (and not volatile), return zero. */ if (operand_equal_p (arg1, arg2, 0)) - return omit_one_operand (TREE_TYPE (exp), integer_zero_node, len); + return omit_one_operand (integer_type_node, integer_zero_node, len); + + p1 = c_getstr (arg1); + p2 = c_getstr (arg2); + + /* If all arguments are constant, and the value of len is not greater + than the lengths of arg1 and arg2, evaluate at compile-time. */ + if (host_integerp (len, 1) && p1 && p2 + && compare_tree_int (len, strlen (p1) + 1) <= 0 + && compare_tree_int (len, strlen (p2) + 1) <= 0) + { + const int r = memcmp (p1, p2, tree_low_cst (len, 1)); + + if (r > 0) + return integer_one_node; + else if (r < 0) + return integer_minus_one_node; + else + return integer_zero_node; + } + + /* If len parameter is one, return an expression corresponding to + (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ + if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1) + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + tree ind1 = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg1))); + tree ind2 = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg2))); + return fold_build2 (MINUS_EXPR, integer_type_node, ind1, ind2); + } return 0; } @@ -6427,14 +8334,12 @@ fold_builtin_memcmp (tree exp) NULL_TREE if no simplification can be made. */ static tree -fold_builtin_strcmp (tree exp) +fold_builtin_strcmp (tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg1, arg2; const char *p1, *p2; - if (!validate_arglist (arglist, - POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) return 0; arg1 = TREE_VALUE (arglist); @@ -6442,22 +8347,47 @@ fold_builtin_strcmp (tree exp) /* If ARG1 and ARG2 are the same (and not volatile), return zero. */ if (operand_equal_p (arg1, arg2, 0)) - return convert (TREE_TYPE (exp), integer_zero_node); + return integer_zero_node; p1 = c_getstr (arg1); p2 = c_getstr (arg2); if (p1 && p2) { - tree temp; const int i = strcmp (p1, p2); if (i < 0) - temp = integer_minus_one_node; + return integer_minus_one_node; else if (i > 0) - temp = integer_one_node; + return integer_one_node; else - temp = integer_zero_node; - return convert (TREE_TYPE (exp), temp); + return integer_zero_node; + } + + /* If the second arg is "", return *(const unsigned char*)arg1. */ + if (p2 && *p2 == '\0') + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + return fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg1))); + } + + /* If the first arg is "", return -*(const unsigned char*)arg2. */ + if (p1 && *p1 == '\0') + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + tree temp = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg2))); + return fold_build1 (NEGATE_EXPR, integer_type_node, temp); } return 0; @@ -6467,9 +8397,8 @@ fold_builtin_strcmp (tree exp) NULL_TREE if no simplification can be made. */ static tree -fold_builtin_strncmp (tree exp) +fold_builtin_strncmp (tree arglist) { - tree arglist = TREE_OPERAND (exp, 1); tree arg1, arg2, len; const char *p1, *p2; @@ -6483,455 +8412,764 @@ fold_builtin_strncmp (tree exp) /* If the LEN parameter is zero, return zero. */ if (integer_zerop (len)) - { - tree temp = omit_one_operand (TREE_TYPE (exp), integer_zero_node, arg2); - return omit_one_operand (TREE_TYPE (exp), temp, arg1); - } + return omit_two_operands (integer_type_node, integer_zero_node, + arg1, arg2); /* If ARG1 and ARG2 are the same (and not volatile), return zero. */ if (operand_equal_p (arg1, arg2, 0)) - return omit_one_operand (TREE_TYPE (exp), integer_zero_node, len); + return omit_one_operand (integer_type_node, integer_zero_node, len); p1 = c_getstr (arg1); p2 = c_getstr (arg2); if (host_integerp (len, 1) && p1 && p2) { - tree temp; const int i = strncmp (p1, p2, tree_low_cst (len, 1)); - if (i < 0) - temp = integer_minus_one_node; - else if (i > 0) - temp = integer_one_node; + if (i > 0) + return integer_one_node; + else if (i < 0) + return integer_minus_one_node; else - temp = integer_zero_node; - return convert (TREE_TYPE (exp), temp); + return integer_zero_node; + } + + /* If the second arg is "", and the length is greater than zero, + return *(const unsigned char*)arg1. */ + if (p2 && *p2 == '\0' + && TREE_CODE (len) == INTEGER_CST + && tree_int_cst_sgn (len) == 1) + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + return fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg1))); + } + + /* If the first arg is "", and the length is greater than zero, + return -*(const unsigned char*)arg2. */ + if (p1 && *p1 == '\0' + && TREE_CODE (len) == INTEGER_CST + && tree_int_cst_sgn (len) == 1) + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + tree temp = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg2))); + return fold_build1 (NEGATE_EXPR, integer_type_node, temp); + } + + /* If len parameter is one, return an expression corresponding to + (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ + if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1) + { + tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); + tree cst_uchar_ptr_node + = build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true); + + tree ind1 = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg1))); + tree ind2 = fold_convert (integer_type_node, + build1 (INDIRECT_REF, cst_uchar_node, + fold_convert (cst_uchar_ptr_node, + arg2))); + return fold_build2 (MINUS_EXPR, integer_type_node, ind1, ind2); } return 0; } -/* Used by constant folding to eliminate some builtin calls early. EXP is - the CALL_EXPR of a call to a builtin function. */ +/* Fold function call to builtin signbit, signbitf or signbitl. Return + NULL_TREE if no simplification can be made. */ -tree -fold_builtin (tree exp) +static tree +fold_builtin_signbit (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree type = TREE_TYPE (TREE_TYPE (fndecl)); + tree arg, temp; - if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + arg = TREE_VALUE (arglist); + + /* If ARG is a compile-time constant, determine the result. */ + if (TREE_CODE (arg) == REAL_CST + && !TREE_CONSTANT_OVERFLOW (arg)) + { + REAL_VALUE_TYPE c; + + c = TREE_REAL_CST (arg); + temp = REAL_VALUE_NEGATIVE (c) ? integer_one_node : integer_zero_node; + return fold_convert (type, temp); + } + + /* If ARG is non-negative, the result is always zero. */ + if (tree_expr_nonnegative_p (arg)) + return omit_one_operand (type, integer_zero_node, arg); + + /* If ARG's format doesn't have signed zeros, return "arg < 0.0". */ + if (!HONOR_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (arg)))) + return fold_build2 (LT_EXPR, type, arg, + build_real (TREE_TYPE (arg), dconst0)); + + return NULL_TREE; +} + +/* Fold function call to builtin copysign, copysignf or copysignl. + Return NULL_TREE if no simplification can be made. */ + +static tree +fold_builtin_copysign (tree fndecl, tree arglist, tree type) +{ + tree arg1, arg2, tem; + + if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) + return NULL_TREE; + + arg1 = TREE_VALUE (arglist); + arg2 = TREE_VALUE (TREE_CHAIN (arglist)); + + /* copysign(X,X) is X. */ + if (operand_equal_p (arg1, arg2, 0)) + return fold_convert (type, arg1); + + /* If ARG1 and ARG2 are compile-time constants, determine the result. */ + if (TREE_CODE (arg1) == REAL_CST + && TREE_CODE (arg2) == REAL_CST + && !TREE_CONSTANT_OVERFLOW (arg1) + && !TREE_CONSTANT_OVERFLOW (arg2)) + { + REAL_VALUE_TYPE c1, c2; + + c1 = TREE_REAL_CST (arg1); + c2 = TREE_REAL_CST (arg2); + /* c1.sign := c2.sign. */ + real_copysign (&c1, &c2); + return build_real (type, c1); + } + + /* copysign(X, Y) is fabs(X) when Y is always non-negative. + Remember to evaluate Y for side-effects. */ + if (tree_expr_nonnegative_p (arg2)) + return omit_one_operand (type, + fold_build1 (ABS_EXPR, type, arg1), + arg2); + + /* Strip sign changing operations for the first argument. */ + tem = fold_strip_sign_ops (arg1); + if (tem) + { + arglist = tree_cons (NULL_TREE, tem, TREE_CHAIN (arglist)); + return build_function_call_expr (fndecl, arglist); + } + + return NULL_TREE; +} + +/* Fold a call to builtin isascii. */ + +static tree +fold_builtin_isascii (tree arglist) +{ + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + /* Transform isascii(c) -> ((c & ~0x7f) == 0). */ + tree arg = TREE_VALUE (arglist); + + arg = build2 (BIT_AND_EXPR, integer_type_node, arg, + build_int_cst (NULL_TREE, + ~ (unsigned HOST_WIDE_INT) 0x7f)); + arg = fold_build2 (EQ_EXPR, integer_type_node, + arg, integer_zero_node); + + if (in_gimple_form && !TREE_CONSTANT (arg)) + return NULL_TREE; + else + return arg; + } +} + +/* Fold a call to builtin toascii. */ + +static tree +fold_builtin_toascii (tree arglist) +{ + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + /* Transform toascii(c) -> (c & 0x7f). */ + tree arg = TREE_VALUE (arglist); + + return fold_build2 (BIT_AND_EXPR, integer_type_node, arg, + build_int_cst (NULL_TREE, 0x7f)); + } +} + +/* Fold a call to builtin isdigit. */ + +static tree +fold_builtin_isdigit (tree arglist) +{ + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + /* Transform isdigit(c) -> (unsigned)(c) - '0' <= 9. */ + /* According to the C standard, isdigit is unaffected by locale. + However, it definitely is affected by the target character set. */ + tree arg; + unsigned HOST_WIDE_INT target_digit0 + = lang_hooks.to_target_charset ('0'); + + if (target_digit0 == 0) + return NULL_TREE; + + arg = fold_convert (unsigned_type_node, TREE_VALUE (arglist)); + arg = build2 (MINUS_EXPR, unsigned_type_node, arg, + build_int_cst (unsigned_type_node, target_digit0)); + arg = fold_build2 (LE_EXPR, integer_type_node, arg, + build_int_cst (unsigned_type_node, 9)); + if (in_gimple_form && !TREE_CONSTANT (arg)) + return NULL_TREE; + else + return arg; + } +} + +/* Fold a call to fabs, fabsf or fabsl. */ + +static tree +fold_builtin_fabs (tree arglist, tree type) +{ + tree arg; + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) return 0; - switch (DECL_FUNCTION_CODE (fndecl)) + arg = TREE_VALUE (arglist); + arg = fold_convert (type, arg); + if (TREE_CODE (arg) == REAL_CST) + return fold_abs_const (arg, type); + return fold_build1 (ABS_EXPR, type, arg); +} + +/* Fold a call to abs, labs, llabs or imaxabs. */ + +static tree +fold_builtin_abs (tree arglist, tree type) +{ + tree arg; + + if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + arg = fold_convert (type, arg); + if (TREE_CODE (arg) == INTEGER_CST) + return fold_abs_const (arg, type); + return fold_build1 (ABS_EXPR, type, arg); +} + +/* Fold a call to __builtin_isnan(), __builtin_isinf, __builtin_finite. + EXP is the CALL_EXPR for the call. */ + +static tree +fold_builtin_classify (tree fndecl, tree arglist, int builtin_index) +{ + tree type = TREE_TYPE (TREE_TYPE (fndecl)); + tree arg; + REAL_VALUE_TYPE r; + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) { + /* Check that we have exactly one argument. */ + if (arglist == 0) + { + error ("too few arguments to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + else if (TREE_CHAIN (arglist) != 0) + { + error ("too many arguments to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + else + { + error ("non-floating-point argument to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + } + + arg = TREE_VALUE (arglist); + switch (builtin_index) + { + case BUILT_IN_ISINF: + if (!MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + return omit_one_operand (type, integer_zero_node, arg); + + if (TREE_CODE (arg) == REAL_CST) + { + r = TREE_REAL_CST (arg); + if (real_isinf (&r)) + return real_compare (GT_EXPR, &r, &dconst0) + ? integer_one_node : integer_minus_one_node; + else + return integer_zero_node; + } + + return NULL_TREE; + + case BUILT_IN_FINITE: + if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg))) + && !MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + return omit_one_operand (type, integer_zero_node, arg); + + if (TREE_CODE (arg) == REAL_CST) + { + r = TREE_REAL_CST (arg); + return real_isinf (&r) || real_isnan (&r) + ? integer_zero_node : integer_one_node; + } + + return NULL_TREE; + + case BUILT_IN_ISNAN: + if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg)))) + return omit_one_operand (type, integer_zero_node, arg); + + if (TREE_CODE (arg) == REAL_CST) + { + r = TREE_REAL_CST (arg); + return real_isnan (&r) ? integer_one_node : integer_zero_node; + } + + arg = builtin_save_expr (arg); + return fold_build2 (UNORDERED_EXPR, type, arg, arg); + + default: + gcc_unreachable (); + } +} + +/* Fold a call to an unordered comparison function such as + __builtin_isgreater(). FNDECL is the FUNCTION_DECL for the function + being called and ARGLIST is the argument list for the call. + UNORDERED_CODE and ORDERED_CODE are comparison codes that give + the opposite of the desired result. UNORDERED_CODE is used + for modes that can hold NaNs and ORDERED_CODE is used for + the rest. */ + +static tree +fold_builtin_unordered_cmp (tree fndecl, tree arglist, + enum tree_code unordered_code, + enum tree_code ordered_code) +{ + tree type = TREE_TYPE (TREE_TYPE (fndecl)); + enum tree_code code; + tree arg0, arg1; + tree type0, type1; + enum tree_code code0, code1; + tree cmp_type = NULL_TREE; + + if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) + { + /* Check that we have exactly two arguments. */ + if (arglist == 0 || TREE_CHAIN (arglist) == 0) + { + error ("too few arguments to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + else if (TREE_CHAIN (TREE_CHAIN (arglist)) != 0) + { + error ("too many arguments to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + } + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + + type0 = TREE_TYPE (arg0); + type1 = TREE_TYPE (arg1); + + code0 = TREE_CODE (type0); + code1 = TREE_CODE (type1); + + if (code0 == REAL_TYPE && code1 == REAL_TYPE) + /* Choose the wider of two real types. */ + cmp_type = TYPE_PRECISION (type0) >= TYPE_PRECISION (type1) + ? type0 : type1; + else if (code0 == REAL_TYPE && code1 == INTEGER_TYPE) + cmp_type = type0; + else if (code0 == INTEGER_TYPE && code1 == REAL_TYPE) + cmp_type = type1; + else + { + error ("non-floating-point argument to function %qs", + IDENTIFIER_POINTER (DECL_NAME (fndecl))); + return error_mark_node; + } + + arg0 = fold_convert (cmp_type, arg0); + arg1 = fold_convert (cmp_type, arg1); + + if (unordered_code == UNORDERED_EXPR) + { + if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0)))) + return omit_two_operands (type, integer_zero_node, arg0, arg1); + return fold_build2 (UNORDERED_EXPR, type, arg0, arg1); + } + + code = MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0))) ? unordered_code + : ordered_code; + return fold_build1 (TRUTH_NOT_EXPR, type, + fold_build2 (code, type, arg0, arg1)); +} + +/* Used by constant folding to simplify calls to builtin functions. EXP is + the CALL_EXPR of a call to a builtin function. IGNORE is true if the + result of the function call is ignored. This function returns NULL_TREE + if no simplification was possible. */ + +static tree +fold_builtin_1 (tree fndecl, tree arglist, bool ignore) +{ + tree type = TREE_TYPE (TREE_TYPE (fndecl)); + enum built_in_function fcode; + + if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) + return targetm.fold_builtin (fndecl, arglist, ignore); + + fcode = DECL_FUNCTION_CODE (fndecl); + switch (fcode) + { + case BUILT_IN_FPUTS: + return fold_builtin_fputs (arglist, ignore, false, NULL_TREE); + + case BUILT_IN_FPUTS_UNLOCKED: + return fold_builtin_fputs (arglist, ignore, true, NULL_TREE); + + case BUILT_IN_STRSTR: + return fold_builtin_strstr (arglist, type); + + case BUILT_IN_STRCAT: + return fold_builtin_strcat (arglist); + + case BUILT_IN_STRNCAT: + return fold_builtin_strncat (arglist); + + case BUILT_IN_STRSPN: + return fold_builtin_strspn (arglist); + + case BUILT_IN_STRCSPN: + return fold_builtin_strcspn (arglist); + + case BUILT_IN_STRCHR: + case BUILT_IN_INDEX: + return fold_builtin_strchr (arglist, type); + + case BUILT_IN_STRRCHR: + case BUILT_IN_RINDEX: + return fold_builtin_strrchr (arglist, type); + + case BUILT_IN_STRCPY: + return fold_builtin_strcpy (fndecl, arglist, NULL_TREE); + + case BUILT_IN_STRNCPY: + return fold_builtin_strncpy (fndecl, arglist, NULL_TREE); + + case BUILT_IN_STRCMP: + return fold_builtin_strcmp (arglist); + + case BUILT_IN_STRNCMP: + return fold_builtin_strncmp (arglist); + + case BUILT_IN_STRPBRK: + return fold_builtin_strpbrk (arglist, type); + + case BUILT_IN_BCMP: + case BUILT_IN_MEMCMP: + return fold_builtin_memcmp (arglist); + + case BUILT_IN_SPRINTF: + return fold_builtin_sprintf (arglist, ignore); + case BUILT_IN_CONSTANT_P: - return fold_builtin_constant_p (arglist); + { + tree val; + + val = fold_builtin_constant_p (arglist); + /* Gimplification will pull the CALL_EXPR for the builtin out of + an if condition. When not optimizing, we'll not CSE it back. + To avoid link error types of regressions, return false now. */ + if (!val && !optimize) + val = integer_zero_node; + + return val; + } + + case BUILT_IN_EXPECT: + return fold_builtin_expect (arglist); case BUILT_IN_CLASSIFY_TYPE: return fold_builtin_classify_type (arglist); case BUILT_IN_STRLEN: - if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE)) - { - tree len = c_strlen (TREE_VALUE (arglist), 0); - if (len) - { - /* Convert from the internal "sizetype" type to "size_t". */ - if (size_type_node) - len = convert (size_type_node, len); - return len; - } - } + return fold_builtin_strlen (arglist); + + CASE_FLT_FN (BUILT_IN_FABS): + return fold_builtin_fabs (arglist, type); + + case BUILT_IN_ABS: + case BUILT_IN_LABS: + case BUILT_IN_LLABS: + case BUILT_IN_IMAXABS: + return fold_builtin_abs (arglist, type); + + CASE_FLT_FN (BUILT_IN_CONJ): + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return fold_build1 (CONJ_EXPR, type, TREE_VALUE (arglist)); break; - case BUILT_IN_FABS: - case BUILT_IN_FABSF: - case BUILT_IN_FABSL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - return fold (build1 (ABS_EXPR, type, TREE_VALUE (arglist))); + CASE_FLT_FN (BUILT_IN_CREAL): + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return non_lvalue (fold_build1 (REALPART_EXPR, type, + TREE_VALUE (arglist))); break; - case BUILT_IN_CABS: - case BUILT_IN_CABSF: - case BUILT_IN_CABSL: - return fold_builtin_cabs (fndecl, arglist, type); - - case BUILT_IN_SQRT: - case BUILT_IN_SQRTF: - case BUILT_IN_SQRTL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - { - enum built_in_function fcode; - tree arg = TREE_VALUE (arglist); - - /* Optimize sqrt of constant value. */ - if (TREE_CODE (arg) == REAL_CST - && ! TREE_CONSTANT_OVERFLOW (arg)) - { - REAL_VALUE_TYPE r, x; - - x = TREE_REAL_CST (arg); - if (real_sqrt (&r, TYPE_MODE (type), &x) - || (!flag_trapping_math && !flag_errno_math)) - return build_real (type, r); - } - - /* Optimize sqrt(exp(x)) = exp(x*0.5). */ - fcode = builtin_mathfn_code (arg); - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_EXP - || fcode == BUILT_IN_EXPF - || fcode == BUILT_IN_EXPL)) - { - tree expfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); - arg = fold (build (MULT_EXPR, type, - TREE_VALUE (TREE_OPERAND (arg, 1)), - build_real (type, dconsthalf))); - arglist = build_tree_list (NULL_TREE, arg); - return build_function_call_expr (expfn, arglist); - } - - /* Optimize sqrt(pow(x,y)) = pow(|x|,y*0.5). */ - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_POW - || fcode == BUILT_IN_POWF - || fcode == BUILT_IN_POWL)) - { - tree powfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); - tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1)); - tree arg1 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1))); - tree narg1; - if (!tree_expr_nonnegative_p (arg0)) - arg0 = build1 (ABS_EXPR, type, arg0); - narg1 = fold (build (MULT_EXPR, type, arg1, - build_real (type, dconsthalf))); - arglist = tree_cons (NULL_TREE, arg0, - build_tree_list (NULL_TREE, narg1)); - return build_function_call_expr (powfn, arglist); - } - } + CASE_FLT_FN (BUILT_IN_CIMAG): + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return non_lvalue (fold_build1 (IMAGPART_EXPR, type, + TREE_VALUE (arglist))); break; - case BUILT_IN_SIN: - case BUILT_IN_SINF: - case BUILT_IN_SINL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - { - tree arg = TREE_VALUE (arglist); + CASE_FLT_FN (BUILT_IN_CABS): + return fold_builtin_cabs (arglist, type, fndecl); - /* Optimize sin(0.0) = 0.0. */ - if (real_zerop (arg)) - return arg; - } - break; + CASE_FLT_FN (BUILT_IN_SQRT): + return fold_builtin_sqrt (arglist, type); - case BUILT_IN_COS: - case BUILT_IN_COSF: - case BUILT_IN_COSL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - { - tree arg = TREE_VALUE (arglist); + CASE_FLT_FN (BUILT_IN_CBRT): + return fold_builtin_cbrt (arglist, type); - /* Optimize cos(0.0) = 1.0. */ - if (real_zerop (arg)) - return build_real (type, dconst1); + CASE_FLT_FN (BUILT_IN_SIN): + return fold_builtin_sin (arglist); - /* Optimize cos(-x) into cos(x). */ - if (TREE_CODE (arg) == NEGATE_EXPR) - { - tree arglist = build_tree_list (NULL_TREE, - TREE_OPERAND (arg, 0)); - return build_function_call_expr (fndecl, arglist); - } - } - break; + CASE_FLT_FN (BUILT_IN_COS): + return fold_builtin_cos (arglist, type, fndecl); - case BUILT_IN_EXP: - case BUILT_IN_EXPF: - case BUILT_IN_EXPL: - return fold_builtin_exponent (exp, &dconste); - case BUILT_IN_EXP2: - case BUILT_IN_EXP2F: - case BUILT_IN_EXP2L: - return fold_builtin_exponent (exp, &dconst2); - case BUILT_IN_EXP10: - case BUILT_IN_EXP10F: - case BUILT_IN_EXP10L: - case BUILT_IN_POW10: - case BUILT_IN_POW10F: - case BUILT_IN_POW10L: - return fold_builtin_exponent (exp, &dconst10); - case BUILT_IN_LOG: - case BUILT_IN_LOGF: - case BUILT_IN_LOGL: - return fold_builtin_logarithm (exp, &dconste); - break; - case BUILT_IN_LOG2: - case BUILT_IN_LOG2F: - case BUILT_IN_LOG2L: - return fold_builtin_logarithm (exp, &dconst2); - break; - case BUILT_IN_LOG10: - case BUILT_IN_LOG10F: - case BUILT_IN_LOG10L: - return fold_builtin_logarithm (exp, &dconst10); - break; + CASE_FLT_FN (BUILT_IN_EXP): + return fold_builtin_exponent (fndecl, arglist, &dconste); - case BUILT_IN_TAN: - case BUILT_IN_TANF: - case BUILT_IN_TANL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - { - enum built_in_function fcode; - tree arg = TREE_VALUE (arglist); + CASE_FLT_FN (BUILT_IN_EXP2): + return fold_builtin_exponent (fndecl, arglist, &dconst2); - /* Optimize tan(0.0) = 0.0. */ - if (real_zerop (arg)) - return arg; + CASE_FLT_FN (BUILT_IN_EXP10): + CASE_FLT_FN (BUILT_IN_POW10): + return fold_builtin_exponent (fndecl, arglist, &dconst10); - /* Optimize tan(atan(x)) = x. */ - fcode = builtin_mathfn_code (arg); - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_ATAN - || fcode == BUILT_IN_ATANF - || fcode == BUILT_IN_ATANL)) - return TREE_VALUE (TREE_OPERAND (arg, 1)); - } - break; + CASE_FLT_FN (BUILT_IN_LOG): + return fold_builtin_logarithm (fndecl, arglist, &dconste); - case BUILT_IN_ATAN: - case BUILT_IN_ATANF: - case BUILT_IN_ATANL: - if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) - { - tree arg = TREE_VALUE (arglist); + CASE_FLT_FN (BUILT_IN_LOG2): + return fold_builtin_logarithm (fndecl, arglist, &dconst2); - /* Optimize atan(0.0) = 0.0. */ - if (real_zerop (arg)) - return arg; + CASE_FLT_FN (BUILT_IN_LOG10): + return fold_builtin_logarithm (fndecl, arglist, &dconst10); - /* Optimize atan(1.0) = pi/4. */ - if (real_onep (arg)) - { - REAL_VALUE_TYPE cst; + CASE_FLT_FN (BUILT_IN_TAN): + return fold_builtin_tan (arglist); - real_convert (&cst, TYPE_MODE (type), &dconstpi); - cst.exp -= 2; - return build_real (type, cst); - } - } - break; + CASE_FLT_FN (BUILT_IN_ATAN): + return fold_builtin_atan (arglist, type); - case BUILT_IN_POW: - case BUILT_IN_POWF: - case BUILT_IN_POWL: - if (validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE)) - { - enum built_in_function fcode; - tree arg0 = TREE_VALUE (arglist); - tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + CASE_FLT_FN (BUILT_IN_POW): + return fold_builtin_pow (fndecl, arglist, type); - /* Optimize pow(1.0,y) = 1.0. */ - if (real_onep (arg0)) - return omit_one_operand (type, build_real (type, dconst1), arg1); + CASE_FLT_FN (BUILT_IN_POWI): + return fold_builtin_powi (fndecl, arglist, type); - if (TREE_CODE (arg1) == REAL_CST - && ! TREE_CONSTANT_OVERFLOW (arg1)) - { - REAL_VALUE_TYPE c; - c = TREE_REAL_CST (arg1); - - /* Optimize pow(x,0.0) = 1.0. */ - if (REAL_VALUES_EQUAL (c, dconst0)) - return omit_one_operand (type, build_real (type, dconst1), - arg0); - - /* Optimize pow(x,1.0) = x. */ - if (REAL_VALUES_EQUAL (c, dconst1)) - return arg0; - - /* Optimize pow(x,-1.0) = 1.0/x. */ - if (REAL_VALUES_EQUAL (c, dconstm1)) - return fold (build (RDIV_EXPR, type, - build_real (type, dconst1), - arg0)); - - /* Optimize pow(x,0.5) = sqrt(x). */ - if (flag_unsafe_math_optimizations - && REAL_VALUES_EQUAL (c, dconsthalf)) - { - tree sqrtfn; - - fcode = DECL_FUNCTION_CODE (fndecl); - if (fcode == BUILT_IN_POW) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRT]; - else if (fcode == BUILT_IN_POWF) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTF]; - else if (fcode == BUILT_IN_POWL) - sqrtfn = implicit_built_in_decls[BUILT_IN_SQRTL]; - else - sqrtfn = NULL_TREE; - - if (sqrtfn != NULL_TREE) - { - tree arglist = build_tree_list (NULL_TREE, arg0); - return build_function_call_expr (sqrtfn, arglist); - } - } - - /* Attempt to evaluate pow at compile-time. */ - if (TREE_CODE (arg0) == REAL_CST - && ! TREE_CONSTANT_OVERFLOW (arg0)) - { - REAL_VALUE_TYPE cint; - HOST_WIDE_INT n; - - n = real_to_integer (&c); - real_from_integer (&cint, VOIDmode, n, - n < 0 ? -1 : 0, 0); - if (real_identical (&c, &cint)) - { - REAL_VALUE_TYPE x; - bool inexact; - - x = TREE_REAL_CST (arg0); - inexact = real_powi (&x, TYPE_MODE (type), &x, n); - if (flag_unsafe_math_optimizations || !inexact) - return build_real (type, x); - } - } - } - - /* Optimize pow(exp(x),y) = exp(x*y). */ - fcode = builtin_mathfn_code (arg0); - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_EXP - || fcode == BUILT_IN_EXPF - || fcode == BUILT_IN_EXPL)) - { - tree expfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); - tree arg = TREE_VALUE (TREE_OPERAND (arg0, 1)); - arg = fold (build (MULT_EXPR, type, arg, arg1)); - arglist = build_tree_list (NULL_TREE, arg); - return build_function_call_expr (expfn, arglist); - } - - /* Optimize pow(sqrt(x),y) = pow(x,y*0.5). */ - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_SQRT - || fcode == BUILT_IN_SQRTF - || fcode == BUILT_IN_SQRTL)) - { - tree narg0 = TREE_VALUE (TREE_OPERAND (arg0, 1)); - tree narg1 = fold (build (MULT_EXPR, type, arg1, - build_real (type, dconsthalf))); - - arglist = tree_cons (NULL_TREE, narg0, - build_tree_list (NULL_TREE, narg1)); - return build_function_call_expr (fndecl, arglist); - } - - /* Optimize pow(pow(x,y),z) = pow(x,y*z). */ - if (flag_unsafe_math_optimizations - && (fcode == BUILT_IN_POW - || fcode == BUILT_IN_POWF - || fcode == BUILT_IN_POWL)) - { - tree arg00 = TREE_VALUE (TREE_OPERAND (arg0, 1)); - tree arg01 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg0, 1))); - tree narg1 = fold (build (MULT_EXPR, type, arg01, arg1)); - arglist = tree_cons (NULL_TREE, arg00, - build_tree_list (NULL_TREE, narg1)); - return build_function_call_expr (fndecl, arglist); - } - } - break; - - case BUILT_IN_INF: - case BUILT_IN_INFF: - case BUILT_IN_INFL: + CASE_FLT_FN (BUILT_IN_INF): + case BUILT_IN_INFD32: + case BUILT_IN_INFD64: + case BUILT_IN_INFD128: return fold_builtin_inf (type, true); - case BUILT_IN_HUGE_VAL: - case BUILT_IN_HUGE_VALF: - case BUILT_IN_HUGE_VALL: + CASE_FLT_FN (BUILT_IN_HUGE_VAL): return fold_builtin_inf (type, false); - case BUILT_IN_NAN: - case BUILT_IN_NANF: - case BUILT_IN_NANL: + CASE_FLT_FN (BUILT_IN_NAN): + case BUILT_IN_NAND32: + case BUILT_IN_NAND64: + case BUILT_IN_NAND128: return fold_builtin_nan (arglist, type, true); - case BUILT_IN_NANS: - case BUILT_IN_NANSF: - case BUILT_IN_NANSL: + CASE_FLT_FN (BUILT_IN_NANS): return fold_builtin_nan (arglist, type, false); - case BUILT_IN_FLOOR: - case BUILT_IN_FLOORF: - case BUILT_IN_FLOORL: - return fold_builtin_floor (exp); + CASE_FLT_FN (BUILT_IN_FLOOR): + return fold_builtin_floor (fndecl, arglist); - case BUILT_IN_CEIL: - case BUILT_IN_CEILF: - case BUILT_IN_CEILL: - return fold_builtin_ceil (exp); + CASE_FLT_FN (BUILT_IN_CEIL): + return fold_builtin_ceil (fndecl, arglist); - case BUILT_IN_TRUNC: - case BUILT_IN_TRUNCF: - case BUILT_IN_TRUNCL: - return fold_builtin_trunc (exp); + CASE_FLT_FN (BUILT_IN_TRUNC): + return fold_builtin_trunc (fndecl, arglist); - case BUILT_IN_ROUND: - case BUILT_IN_ROUNDF: - case BUILT_IN_ROUNDL: - case BUILT_IN_NEARBYINT: - case BUILT_IN_NEARBYINTF: - case BUILT_IN_NEARBYINTL: - return fold_trunc_transparent_mathfn (exp); + CASE_FLT_FN (BUILT_IN_ROUND): + return fold_builtin_round (fndecl, arglist); - case BUILT_IN_FFS: - case BUILT_IN_FFSL: - case BUILT_IN_FFSLL: - case BUILT_IN_CLZ: - case BUILT_IN_CLZL: - case BUILT_IN_CLZLL: - case BUILT_IN_CTZ: - case BUILT_IN_CTZL: - case BUILT_IN_CTZLL: - case BUILT_IN_POPCOUNT: - case BUILT_IN_POPCOUNTL: - case BUILT_IN_POPCOUNTLL: - case BUILT_IN_PARITY: - case BUILT_IN_PARITYL: - case BUILT_IN_PARITYLL: - return fold_builtin_bitop (exp); + CASE_FLT_FN (BUILT_IN_NEARBYINT): + CASE_FLT_FN (BUILT_IN_RINT): + return fold_trunc_transparent_mathfn (fndecl, arglist); + + CASE_FLT_FN (BUILT_IN_LCEIL): + CASE_FLT_FN (BUILT_IN_LLCEIL): + CASE_FLT_FN (BUILT_IN_LFLOOR): + CASE_FLT_FN (BUILT_IN_LLFLOOR): + CASE_FLT_FN (BUILT_IN_LROUND): + CASE_FLT_FN (BUILT_IN_LLROUND): + return fold_builtin_int_roundingfn (fndecl, arglist); + + CASE_FLT_FN (BUILT_IN_LRINT): + CASE_FLT_FN (BUILT_IN_LLRINT): + return fold_fixed_mathfn (fndecl, arglist); + + CASE_INT_FN (BUILT_IN_FFS): + CASE_INT_FN (BUILT_IN_CLZ): + CASE_INT_FN (BUILT_IN_CTZ): + CASE_INT_FN (BUILT_IN_POPCOUNT): + CASE_INT_FN (BUILT_IN_PARITY): + return fold_builtin_bitop (fndecl, arglist); + + case BUILT_IN_MEMSET: + return fold_builtin_memset (arglist, type, ignore); case BUILT_IN_MEMCPY: - return fold_builtin_memcpy (exp); + return fold_builtin_memory_op (arglist, type, ignore, /*endp=*/0); case BUILT_IN_MEMPCPY: - return fold_builtin_mempcpy (exp); + return fold_builtin_memory_op (arglist, type, ignore, /*endp=*/1); case BUILT_IN_MEMMOVE: - return fold_builtin_memmove (exp); + return fold_builtin_memory_op (arglist, type, ignore, /*endp=*/3); - case BUILT_IN_STRCPY: - return fold_builtin_strcpy (exp); + case BUILT_IN_BZERO: + return fold_builtin_bzero (arglist, ignore); - case BUILT_IN_STRNCPY: - return fold_builtin_strncpy (exp); + case BUILT_IN_BCOPY: + return fold_builtin_bcopy (arglist, ignore); - case BUILT_IN_MEMCMP: - return fold_builtin_memcmp (exp); + CASE_FLT_FN (BUILT_IN_SIGNBIT): + return fold_builtin_signbit (fndecl, arglist); - case BUILT_IN_STRCMP: - return fold_builtin_strcmp (exp); + case BUILT_IN_ISASCII: + return fold_builtin_isascii (arglist); - case BUILT_IN_STRNCMP: - return fold_builtin_strncmp (exp); + case BUILT_IN_TOASCII: + return fold_builtin_toascii (arglist); + + case BUILT_IN_ISDIGIT: + return fold_builtin_isdigit (arglist); + + CASE_FLT_FN (BUILT_IN_COPYSIGN): + return fold_builtin_copysign (fndecl, arglist, type); + + CASE_FLT_FN (BUILT_IN_FINITE): + case BUILT_IN_FINITED32: + case BUILT_IN_FINITED64: + case BUILT_IN_FINITED128: + return fold_builtin_classify (fndecl, arglist, BUILT_IN_FINITE); + + CASE_FLT_FN (BUILT_IN_ISINF): + case BUILT_IN_ISINFD32: + case BUILT_IN_ISINFD64: + case BUILT_IN_ISINFD128: + return fold_builtin_classify (fndecl, arglist, BUILT_IN_ISINF); + + CASE_FLT_FN (BUILT_IN_ISNAN): + case BUILT_IN_ISNAND32: + case BUILT_IN_ISNAND64: + case BUILT_IN_ISNAND128: + return fold_builtin_classify (fndecl, arglist, BUILT_IN_ISNAN); + + case BUILT_IN_ISGREATER: + return fold_builtin_unordered_cmp (fndecl, arglist, UNLE_EXPR, LE_EXPR); + case BUILT_IN_ISGREATEREQUAL: + return fold_builtin_unordered_cmp (fndecl, arglist, UNLT_EXPR, LT_EXPR); + case BUILT_IN_ISLESS: + return fold_builtin_unordered_cmp (fndecl, arglist, UNGE_EXPR, GE_EXPR); + case BUILT_IN_ISLESSEQUAL: + return fold_builtin_unordered_cmp (fndecl, arglist, UNGT_EXPR, GT_EXPR); + case BUILT_IN_ISLESSGREATER: + return fold_builtin_unordered_cmp (fndecl, arglist, UNEQ_EXPR, EQ_EXPR); + case BUILT_IN_ISUNORDERED: + return fold_builtin_unordered_cmp (fndecl, arglist, UNORDERED_EXPR, + NOP_EXPR); + + /* We do the folding for va_start in the expander. */ + case BUILT_IN_VA_START: + break; + + case BUILT_IN_OBJECT_SIZE: + return fold_builtin_object_size (arglist); + case BUILT_IN_MEMCPY_CHK: + case BUILT_IN_MEMPCPY_CHK: + case BUILT_IN_MEMMOVE_CHK: + case BUILT_IN_MEMSET_CHK: + return fold_builtin_memory_chk (fndecl, arglist, NULL_TREE, ignore, + DECL_FUNCTION_CODE (fndecl)); + case BUILT_IN_STRCPY_CHK: + case BUILT_IN_STPCPY_CHK: + return fold_builtin_stxcpy_chk (fndecl, arglist, NULL_TREE, ignore, + DECL_FUNCTION_CODE (fndecl)); + case BUILT_IN_STRNCPY_CHK: + return fold_builtin_strncpy_chk (arglist, NULL_TREE); + case BUILT_IN_STRCAT_CHK: + return fold_builtin_strcat_chk (fndecl, arglist); + case BUILT_IN_STRNCAT_CHK: + return fold_builtin_strncat_chk (fndecl, arglist); + case BUILT_IN_SPRINTF_CHK: + case BUILT_IN_VSPRINTF_CHK: + return fold_builtin_sprintf_chk (arglist, DECL_FUNCTION_CODE (fndecl)); + case BUILT_IN_SNPRINTF_CHK: + case BUILT_IN_VSNPRINTF_CHK: + return fold_builtin_snprintf_chk (arglist, NULL_TREE, + DECL_FUNCTION_CODE (fndecl)); + + case BUILT_IN_PRINTF: + case BUILT_IN_PRINTF_UNLOCKED: + case BUILT_IN_VPRINTF: + case BUILT_IN_PRINTF_CHK: + case BUILT_IN_VPRINTF_CHK: + return fold_builtin_printf (fndecl, arglist, ignore, + DECL_FUNCTION_CODE (fndecl)); + + case BUILT_IN_FPRINTF: + case BUILT_IN_FPRINTF_UNLOCKED: + case BUILT_IN_VFPRINTF: + case BUILT_IN_FPRINTF_CHK: + case BUILT_IN_VFPRINTF_CHK: + return fold_builtin_fprintf (fndecl, arglist, ignore, + DECL_FUNCTION_CODE (fndecl)); default: break; @@ -6940,6 +9178,23 @@ fold_builtin (tree exp) return 0; } +/* A wrapper function for builtin folding that prevents warnings for + "statement without effect" and the like, caused by removing the + call node earlier than the warning is generated. */ + +tree +fold_builtin (tree fndecl, tree arglist, bool ignore) +{ + tree exp = fold_builtin_1 (fndecl, arglist, ignore); + if (exp) + { + exp = build1 (NOP_EXPR, TREE_TYPE (exp), exp); + TREE_NO_WARNING (exp) = 1; + } + + return exp; +} + /* Conveniently construct a function call expression. */ tree @@ -6948,9 +9203,8 @@ build_function_call_expr (tree fn, tree arglist) tree call_expr; call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn); - call_expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), - call_expr, arglist); - return fold (call_expr); + return fold_build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), + call_expr, arglist, NULL_TREE); } /* This function validates the types of a function call argument list @@ -6985,8 +9239,14 @@ validate_arglist (tree arglist, ...) /* If no parameters remain or the parameter's code does not match the specified code, return false. Otherwise continue checking any remaining arguments. */ - if (arglist == 0 - || code != TREE_CODE (TREE_TYPE (TREE_VALUE (arglist)))) + if (arglist == 0) + goto end; + if (code == POINTER_TYPE) + { + if (! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist)))) + goto end; + } + else if (code != TREE_CODE (TREE_TYPE (TREE_VALUE (arglist)))) goto end; break; } @@ -7014,31 +9274,6 @@ default_expand_builtin (tree exp ATTRIBUTE_UNUSED, return NULL_RTX; } -/* Instantiate all remaining CONSTANT_P_RTX nodes. */ - -void -purge_builtin_constant_p (void) -{ - rtx insn, set, arg, new, note; - - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - if (INSN_P (insn) - && (set = single_set (insn)) != NULL_RTX - && (GET_CODE (arg = SET_SRC (set)) == CONSTANT_P_RTX - || (GET_CODE (arg) == SUBREG - && (GET_CODE (arg = SUBREG_REG (arg)) - == CONSTANT_P_RTX)))) - { - arg = XEXP (arg, 0); - new = CONSTANT_P (arg) ? const1_rtx : const0_rtx; - validate_change (insn, &SET_SRC (set), new, 0); - - /* Remove the REG_EQUAL note from the insn. */ - if ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0) - remove_note (insn, note); - } -} - /* Returns true is EXP represents data that would potentially reside in a readonly section. */ @@ -7047,8 +9282,1919 @@ readonly_data_expr (tree exp) { STRIP_NOPS (exp); - if (TREE_CODE (exp) == ADDR_EXPR) - return decl_readonly_section (TREE_OPERAND (exp, 0), 0); + if (TREE_CODE (exp) != ADDR_EXPR) + return false; + + exp = get_base_address (TREE_OPERAND (exp, 0)); + if (!exp) + return false; + + /* Make sure we call decl_readonly_section only for trees it + can handle (since it returns true for everything it doesn't + understand). */ + if (TREE_CODE (exp) == STRING_CST + || TREE_CODE (exp) == CONSTRUCTOR + || (TREE_CODE (exp) == VAR_DECL && TREE_STATIC (exp))) + return decl_readonly_section (exp, 0); else return false; } + +/* Simplify a call to the strstr builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strstr (tree arglist, tree type) +{ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + tree fn; + const char *p1, *p2; + + p2 = c_getstr (s2); + if (p2 == NULL) + return 0; + + p1 = c_getstr (s1); + if (p1 != NULL) + { + const char *r = strstr (p1, p2); + tree tem; + + if (r == NULL) + return build_int_cst (TREE_TYPE (s1), 0); + + /* Return an offset into the constant string argument. */ + tem = fold_build2 (PLUS_EXPR, TREE_TYPE (s1), + s1, build_int_cst (TREE_TYPE (s1), r - p1)); + return fold_convert (type, tem); + } + + /* The argument is const char *, and the result is char *, so we need + a type conversion here to avoid a warning. */ + if (p2[0] == '\0') + return fold_convert (type, s1); + + if (p2[1] != '\0') + return 0; + + fn = implicit_built_in_decls[BUILT_IN_STRCHR]; + if (!fn) + return 0; + + /* New argument list transforming strstr(s1, s2) to + strchr(s1, s2[0]). */ + arglist = build_tree_list (NULL_TREE, + build_int_cst (NULL_TREE, p2[0])); + arglist = tree_cons (NULL_TREE, s1, arglist); + return build_function_call_expr (fn, arglist); + } +} + +/* Simplify a call to the strchr builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strchr (tree arglist, tree type) +{ + if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + const char *p1; + + if (TREE_CODE (s2) != INTEGER_CST) + return 0; + + p1 = c_getstr (s1); + if (p1 != NULL) + { + char c; + const char *r; + tree tem; + + if (target_char_cast (s2, &c)) + return 0; + + r = strchr (p1, c); + + if (r == NULL) + return build_int_cst (TREE_TYPE (s1), 0); + + /* Return an offset into the constant string argument. */ + tem = fold_build2 (PLUS_EXPR, TREE_TYPE (s1), + s1, build_int_cst (TREE_TYPE (s1), r - p1)); + return fold_convert (type, tem); + } + return 0; + } +} + +/* Simplify a call to the strrchr builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strrchr (tree arglist, tree type) +{ + if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + tree fn; + const char *p1; + + if (TREE_CODE (s2) != INTEGER_CST) + return 0; + + p1 = c_getstr (s1); + if (p1 != NULL) + { + char c; + const char *r; + tree tem; + + if (target_char_cast (s2, &c)) + return 0; + + r = strrchr (p1, c); + + if (r == NULL) + return build_int_cst (TREE_TYPE (s1), 0); + + /* Return an offset into the constant string argument. */ + tem = fold_build2 (PLUS_EXPR, TREE_TYPE (s1), + s1, build_int_cst (TREE_TYPE (s1), r - p1)); + return fold_convert (type, tem); + } + + if (! integer_zerop (s2)) + return 0; + + fn = implicit_built_in_decls[BUILT_IN_STRCHR]; + if (!fn) + return 0; + + /* Transform strrchr(s1, '\0') to strchr(s1, '\0'). */ + return build_function_call_expr (fn, arglist); + } +} + +/* Simplify a call to the strpbrk builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strpbrk (tree arglist, tree type) +{ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + tree fn; + const char *p1, *p2; + + p2 = c_getstr (s2); + if (p2 == NULL) + return 0; + + p1 = c_getstr (s1); + if (p1 != NULL) + { + const char *r = strpbrk (p1, p2); + tree tem; + + if (r == NULL) + return build_int_cst (TREE_TYPE (s1), 0); + + /* Return an offset into the constant string argument. */ + tem = fold_build2 (PLUS_EXPR, TREE_TYPE (s1), + s1, build_int_cst (TREE_TYPE (s1), r - p1)); + return fold_convert (type, tem); + } + + if (p2[0] == '\0') + /* strpbrk(x, "") == NULL. + Evaluate and ignore s1 in case it had side-effects. */ + return omit_one_operand (TREE_TYPE (s1), integer_zero_node, s1); + + if (p2[1] != '\0') + return 0; /* Really call strpbrk. */ + + fn = implicit_built_in_decls[BUILT_IN_STRCHR]; + if (!fn) + return 0; + + /* New argument list transforming strpbrk(s1, s2) to + strchr(s1, s2[0]). */ + arglist = build_tree_list (NULL_TREE, + build_int_cst (NULL_TREE, p2[0])); + arglist = tree_cons (NULL_TREE, s1, arglist); + return build_function_call_expr (fn, arglist); + } +} + +/* Simplify a call to the strcat builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strcat (tree arglist) +{ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + else + { + tree dst = TREE_VALUE (arglist), + src = TREE_VALUE (TREE_CHAIN (arglist)); + const char *p = c_getstr (src); + + /* If the string length is zero, return the dst parameter. */ + if (p && *p == '\0') + return dst; + + return 0; + } +} + +/* Simplify a call to the strncat builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strncat (tree arglist) +{ + if (!validate_arglist (arglist, + POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + else + { + tree dst = TREE_VALUE (arglist); + tree src = TREE_VALUE (TREE_CHAIN (arglist)); + tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + const char *p = c_getstr (src); + + /* If the requested length is zero, or the src parameter string + length is zero, return the dst parameter. */ + if (integer_zerop (len) || (p && *p == '\0')) + return omit_two_operands (TREE_TYPE (dst), dst, src, len); + + /* If the requested len is greater than or equal to the string + length, call strcat. */ + if (TREE_CODE (len) == INTEGER_CST && p + && compare_tree_int (len, strlen (p)) >= 0) + { + tree newarglist + = tree_cons (NULL_TREE, dst, build_tree_list (NULL_TREE, src)); + tree fn = implicit_built_in_decls[BUILT_IN_STRCAT]; + + /* If the replacement _DECL isn't initialized, don't do the + transformation. */ + if (!fn) + return 0; + + return build_function_call_expr (fn, newarglist); + } + return 0; + } +} + +/* Simplify a call to the strspn builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strspn (tree arglist) +{ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + const char *p1 = c_getstr (s1), *p2 = c_getstr (s2); + + /* If both arguments are constants, evaluate at compile-time. */ + if (p1 && p2) + { + const size_t r = strspn (p1, p2); + return size_int (r); + } + + /* If either argument is "", return 0. */ + if ((p1 && *p1 == '\0') || (p2 && *p2 == '\0')) + /* Evaluate and ignore both arguments in case either one has + side-effects. */ + return omit_two_operands (integer_type_node, integer_zero_node, + s1, s2); + return 0; + } +} + +/* Simplify a call to the strcspn builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. + + The simplified form may be a constant or other expression which + computes the same value, but in a more efficient manner (including + calls to other builtin functions). + + The call may contain arguments which need to be evaluated, but + which are not useful to determine the result of the call. In + this case we return a chain of COMPOUND_EXPRs. The LHS of each + COMPOUND_EXPR will be an argument which must be evaluated. + COMPOUND_EXPRs are chained through their RHS. The RHS of the last + COMPOUND_EXPR in the chain will contain the tree for the simplified + form of the builtin function call. */ + +static tree +fold_builtin_strcspn (tree arglist) +{ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + else + { + tree s1 = TREE_VALUE (arglist), s2 = TREE_VALUE (TREE_CHAIN (arglist)); + const char *p1 = c_getstr (s1), *p2 = c_getstr (s2); + + /* If both arguments are constants, evaluate at compile-time. */ + if (p1 && p2) + { + const size_t r = strcspn (p1, p2); + return size_int (r); + } + + /* If the first argument is "", return 0. */ + if (p1 && *p1 == '\0') + { + /* Evaluate and ignore argument s2 in case it has + side-effects. */ + return omit_one_operand (integer_type_node, + integer_zero_node, s2); + } + + /* If the second argument is "", return __builtin_strlen(s1). */ + if (p2 && *p2 == '\0') + { + tree newarglist = build_tree_list (NULL_TREE, s1), + fn = implicit_built_in_decls[BUILT_IN_STRLEN]; + + /* If the replacement _DECL isn't initialized, don't do the + transformation. */ + if (!fn) + return 0; + + return build_function_call_expr (fn, newarglist); + } + return 0; + } +} + +/* Fold a call to the fputs builtin. IGNORE is true if the value returned + by the builtin will be ignored. UNLOCKED is true is true if this + actually a call to fputs_unlocked. If LEN in non-NULL, it represents + the known length of the string. Return NULL_TREE if no simplification + was possible. */ + +tree +fold_builtin_fputs (tree arglist, bool ignore, bool unlocked, tree len) +{ + tree fn; + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FPUTC]; + tree const fn_fwrite = unlocked ? built_in_decls[BUILT_IN_FWRITE_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FWRITE]; + + /* If the return value is used, don't do the transformation. */ + if (!ignore) + return 0; + + /* Verify the arguments in the original call. */ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE)) + return 0; + + if (! len) + len = c_strlen (TREE_VALUE (arglist), 0); + + /* Get the length of the string passed to fputs. If the length + can't be determined, punt. */ + if (!len + || TREE_CODE (len) != INTEGER_CST) + return 0; + + switch (compare_tree_int (len, 1)) + { + case -1: /* length is 0, delete the call entirely . */ + return omit_one_operand (integer_type_node, integer_zero_node, + TREE_VALUE (TREE_CHAIN (arglist))); + + case 0: /* length is 1, call fputc. */ + { + const char *p = c_getstr (TREE_VALUE (arglist)); + + if (p != NULL) + { + /* New argument list transforming fputs(string, stream) to + fputc(string[0], stream). */ + arglist = build_tree_list (NULL_TREE, + TREE_VALUE (TREE_CHAIN (arglist))); + arglist = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, p[0]), + arglist); + fn = fn_fputc; + break; + } + } + /* FALLTHROUGH */ + case 1: /* length is greater than 1, call fwrite. */ + { + tree string_arg; + + /* If optimizing for size keep fputs. */ + if (optimize_size) + return 0; + string_arg = TREE_VALUE (arglist); + /* New argument list transforming fputs(string, stream) to + fwrite(string, 1, len, stream). */ + arglist = build_tree_list (NULL_TREE, + TREE_VALUE (TREE_CHAIN (arglist))); + arglist = tree_cons (NULL_TREE, len, arglist); + arglist = tree_cons (NULL_TREE, size_one_node, arglist); + arglist = tree_cons (NULL_TREE, string_arg, arglist); + fn = fn_fwrite; + break; + } + default: + gcc_unreachable (); + } + + /* If the replacement _DECL isn't initialized, don't do the + transformation. */ + if (!fn) + return 0; + + /* These optimizations are only performed when the result is ignored, + hence there's no need to cast the result to integer_type_node. */ + return build_function_call_expr (fn, arglist); +} + +/* Fold the new_arg's arguments (ARGLIST). Returns true if there was an error + produced. False otherwise. This is done so that we don't output the error + or warning twice or three times. */ +bool +fold_builtin_next_arg (tree arglist) +{ + tree fntype = TREE_TYPE (current_function_decl); + + if (TYPE_ARG_TYPES (fntype) == 0 + || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) + == void_type_node)) + { + error ("% used in function with fixed args"); + return true; + } + else if (!arglist) + { + /* Evidently an out of date version of ; can't validate + va_start's second argument, but can still work as intended. */ + warning (0, "%<__builtin_next_arg%> called without an argument"); + return true; + } + /* We use __builtin_va_start (ap, 0, 0) or __builtin_next_arg (0, 0) + when we checked the arguments and if needed issued a warning. */ + else if (!TREE_CHAIN (arglist) + || !integer_zerop (TREE_VALUE (arglist)) + || !integer_zerop (TREE_VALUE (TREE_CHAIN (arglist))) + || TREE_CHAIN (TREE_CHAIN (arglist))) + { + tree last_parm = tree_last (DECL_ARGUMENTS (current_function_decl)); + tree arg = TREE_VALUE (arglist); + + if (TREE_CHAIN (arglist)) + { + error ("% used with too many arguments"); + return true; + } + + /* Strip off all nops for the sake of the comparison. This + is not quite the same as STRIP_NOPS. It does more. + We must also strip off INDIRECT_EXPR for C++ reference + parameters. */ + while (TREE_CODE (arg) == NOP_EXPR + || TREE_CODE (arg) == CONVERT_EXPR + || TREE_CODE (arg) == NON_LVALUE_EXPR + || TREE_CODE (arg) == INDIRECT_REF) + arg = TREE_OPERAND (arg, 0); + if (arg != last_parm) + { + /* FIXME: Sometimes with the tree optimizers we can get the + not the last argument even though the user used the last + argument. We just warn and set the arg to be the last + argument so that we will get wrong-code because of + it. */ + warning (0, "second parameter of % not last named argument"); + } + /* We want to verify the second parameter just once before the tree + optimizers are run and then avoid keeping it in the tree, + as otherwise we could warn even for correct code like: + void foo (int i, ...) + { va_list ap; i++; va_start (ap, i); va_end (ap); } */ + TREE_VALUE (arglist) = integer_zero_node; + TREE_CHAIN (arglist) = build_tree_list (NULL, integer_zero_node); + } + return false; +} + + +/* Simplify a call to the sprintf builtin. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. If IGNORED is true, it means that + the caller does not use the returned value of the function. */ + +static tree +fold_builtin_sprintf (tree arglist, int ignored) +{ + tree call, retval, dest, fmt; + const char *fmt_str = NULL; + + /* Verify the required arguments in the original call. We deal with two + types of sprintf() calls: 'sprintf (str, fmt)' and + 'sprintf (dest, "%s", orig)'. */ + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE) + && !validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, POINTER_TYPE, + VOID_TYPE)) + return NULL_TREE; + + /* Get the destination string and the format specifier. */ + dest = TREE_VALUE (arglist); + fmt = TREE_VALUE (TREE_CHAIN (arglist)); + arglist = TREE_CHAIN (TREE_CHAIN (arglist)); + + /* Check whether the format is a literal string constant. */ + fmt_str = c_getstr (fmt); + if (fmt_str == NULL) + return NULL_TREE; + + call = NULL_TREE; + retval = NULL_TREE; + + if (!init_target_chars()) + return 0; + + /* If the format doesn't contain % args or %%, use strcpy. */ + if (strchr (fmt_str, target_percent) == NULL) + { + tree fn = implicit_built_in_decls[BUILT_IN_STRCPY]; + + if (!fn) + return NULL_TREE; + + /* Don't optimize sprintf (buf, "abc", ptr++). */ + if (arglist) + return NULL_TREE; + + /* Convert sprintf (str, fmt) into strcpy (str, fmt) when + 'format' is known to contain no % formats. */ + arglist = build_tree_list (NULL_TREE, fmt); + arglist = tree_cons (NULL_TREE, dest, arglist); + call = build_function_call_expr (fn, arglist); + if (!ignored) + retval = build_int_cst (NULL_TREE, strlen (fmt_str)); + } + + /* If the format is "%s", use strcpy if the result isn't used. */ + else if (fmt_str && strcmp (fmt_str, target_percent_s) == 0) + { + tree fn, orig; + fn = implicit_built_in_decls[BUILT_IN_STRCPY]; + + if (!fn) + return NULL_TREE; + + /* Don't crash on sprintf (str1, "%s"). */ + if (!arglist) + return NULL_TREE; + + /* Convert sprintf (str1, "%s", str2) into strcpy (str1, str2). */ + orig = TREE_VALUE (arglist); + arglist = build_tree_list (NULL_TREE, orig); + arglist = tree_cons (NULL_TREE, dest, arglist); + if (!ignored) + { + retval = c_strlen (orig, 1); + if (!retval || TREE_CODE (retval) != INTEGER_CST) + return NULL_TREE; + } + call = build_function_call_expr (fn, arglist); + } + + if (call && retval) + { + retval = fold_convert + (TREE_TYPE (TREE_TYPE (implicit_built_in_decls[BUILT_IN_SPRINTF])), + retval); + return build2 (COMPOUND_EXPR, TREE_TYPE (retval), call, retval); + } + else + return call; +} + +/* Expand a call to __builtin_object_size. */ + +rtx +expand_builtin_object_size (tree exp) +{ + tree ost; + int object_size_type; + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); + location_t locus = EXPR_LOCATION (exp); + + if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + { + error ("%Hfirst argument of %D must be a pointer, second integer constant", + &locus, fndecl); + expand_builtin_trap (); + return const0_rtx; + } + + ost = TREE_VALUE (TREE_CHAIN (arglist)); + STRIP_NOPS (ost); + + if (TREE_CODE (ost) != INTEGER_CST + || tree_int_cst_sgn (ost) < 0 + || compare_tree_int (ost, 3) > 0) + { + error ("%Hlast argument of %D is not integer constant between 0 and 3", + &locus, fndecl); + expand_builtin_trap (); + return const0_rtx; + } + + object_size_type = tree_low_cst (ost, 0); + + return object_size_type < 2 ? constm1_rtx : const0_rtx; +} + +/* Expand EXP, a call to the __mem{cpy,pcpy,move,set}_chk builtin. + FCODE is the BUILT_IN_* to use. + Return 0 if we failed; the caller should emit a normal call, + otherwise try to get the result in TARGET, if convenient (and in + mode MODE if that's convenient). */ + +static rtx +expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode, + enum built_in_function fcode) +{ + tree arglist = TREE_OPERAND (exp, 1); + tree dest, src, len, size; + + if (!validate_arglist (arglist, + POINTER_TYPE, + fcode == BUILT_IN_MEMSET_CHK + ? INTEGER_TYPE : POINTER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + src = TREE_VALUE (TREE_CHAIN (arglist)); + len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))); + + if (! host_integerp (size, 1)) + return 0; + + if (host_integerp (len, 1) || integer_all_onesp (size)) + { + tree fn; + + if (! integer_all_onesp (size) && tree_int_cst_lt (size, len)) + { + location_t locus = EXPR_LOCATION (exp); + warning (0, "%Hcall to %D will always overflow destination buffer", + &locus, get_callee_fndecl (exp)); + return 0; + } + + arglist = build_tree_list (NULL_TREE, len); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + fn = NULL_TREE; + /* If __builtin_mem{cpy,pcpy,move,set}_chk is used, assume + mem{cpy,pcpy,move,set} is available. */ + switch (fcode) + { + case BUILT_IN_MEMCPY_CHK: + fn = built_in_decls[BUILT_IN_MEMCPY]; + break; + case BUILT_IN_MEMPCPY_CHK: + fn = built_in_decls[BUILT_IN_MEMPCPY]; + break; + case BUILT_IN_MEMMOVE_CHK: + fn = built_in_decls[BUILT_IN_MEMMOVE]; + break; + case BUILT_IN_MEMSET_CHK: + fn = built_in_decls[BUILT_IN_MEMSET]; + break; + default: + break; + } + + if (! fn) + return 0; + + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); + } + else if (fcode == BUILT_IN_MEMSET_CHK) + return 0; + else + { + unsigned int dest_align + = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); + + /* If DEST is not a pointer type, call the normal function. */ + if (dest_align == 0) + return 0; + + /* If SRC and DEST are the same (and not volatile), do nothing. */ + if (operand_equal_p (src, dest, 0)) + { + tree expr; + + if (fcode != BUILT_IN_MEMPCPY_CHK) + { + /* Evaluate and ignore LEN in case it has side-effects. */ + expand_expr (len, const0_rtx, VOIDmode, EXPAND_NORMAL); + return expand_expr (dest, target, mode, EXPAND_NORMAL); + } + + len = fold_convert (TREE_TYPE (dest), len); + expr = fold_build2 (PLUS_EXPR, TREE_TYPE (dest), dest, len); + return expand_expr (expr, target, mode, EXPAND_NORMAL); + } + + /* __memmove_chk special case. */ + if (fcode == BUILT_IN_MEMMOVE_CHK) + { + unsigned int src_align + = get_pointer_alignment (src, BIGGEST_ALIGNMENT); + + if (src_align == 0) + return 0; + + /* If src is categorized for a readonly section we can use + normal __memcpy_chk. */ + if (readonly_data_expr (src)) + { + tree fn = built_in_decls[BUILT_IN_MEMCPY_CHK]; + if (!fn) + return 0; + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); + } + } + return 0; + } +} + +/* Emit warning if a buffer overflow is detected at compile time. */ + +static void +maybe_emit_chk_warning (tree exp, enum built_in_function fcode) +{ + int arg_mask, is_strlen = 0; + tree arglist = TREE_OPERAND (exp, 1), a; + tree len, size; + location_t locus; + + switch (fcode) + { + case BUILT_IN_STRCPY_CHK: + case BUILT_IN_STPCPY_CHK: + /* For __strcat_chk the warning will be emitted only if overflowing + by at least strlen (dest) + 1 bytes. */ + case BUILT_IN_STRCAT_CHK: + arg_mask = 6; + is_strlen = 1; + break; + case BUILT_IN_STRNCPY_CHK: + arg_mask = 12; + break; + case BUILT_IN_SNPRINTF_CHK: + case BUILT_IN_VSNPRINTF_CHK: + arg_mask = 10; + break; + default: + gcc_unreachable (); + } + + len = NULL_TREE; + size = NULL_TREE; + for (a = arglist; a && arg_mask; a = TREE_CHAIN (a), arg_mask >>= 1) + if (arg_mask & 1) + { + if (len) + size = a; + else + len = a; + } + + if (!len || !size) + return; + + len = TREE_VALUE (len); + size = TREE_VALUE (size); + + if (! host_integerp (size, 1) || integer_all_onesp (size)) + return; + + if (is_strlen) + { + len = c_strlen (len, 1); + if (! len || ! host_integerp (len, 1) || tree_int_cst_lt (len, size)) + return; + } + else if (! host_integerp (len, 1) || ! tree_int_cst_lt (size, len)) + return; + + locus = EXPR_LOCATION (exp); + warning (0, "%Hcall to %D will always overflow destination buffer", + &locus, get_callee_fndecl (exp)); +} + +/* Emit warning if a buffer overflow is detected at compile time + in __sprintf_chk/__vsprintf_chk calls. */ + +static void +maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode) +{ + tree arglist = TREE_OPERAND (exp, 1); + tree dest, size, len, fmt, flag; + const char *fmt_str; + + /* Verify the required arguments in the original call. */ + if (! arglist) + return; + dest = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + if (! arglist) + return; + flag = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + if (! arglist) + return; + size = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + if (! arglist) + return; + fmt = TREE_VALUE (arglist); + arglist = TREE_CHAIN (arglist); + + if (! host_integerp (size, 1) || integer_all_onesp (size)) + return; + + /* Check whether the format is a literal string constant. */ + fmt_str = c_getstr (fmt); + if (fmt_str == NULL) + return; + + if (!init_target_chars()) + return; + + /* If the format doesn't contain % args or %%, we know its size. */ + if (strchr (fmt_str, target_percent) == 0) + len = build_int_cstu (size_type_node, strlen (fmt_str)); + /* If the format is "%s" and first ... argument is a string literal, + we know it too. */ + else if (fcode == BUILT_IN_SPRINTF_CHK && strcmp (fmt_str, target_percent_s) == 0) + { + tree arg; + + if (! arglist) + return; + arg = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (arg))) + return; + + len = c_strlen (arg, 1); + if (!len || ! host_integerp (len, 1)) + return; + } + else + return; + + if (! tree_int_cst_lt (len, size)) + { + location_t locus = EXPR_LOCATION (exp); + warning (0, "%Hcall to %D will always overflow destination buffer", + &locus, get_callee_fndecl (exp)); + } +} + +/* Fold a call to __builtin_object_size, if possible. */ + +tree +fold_builtin_object_size (tree arglist) +{ + tree ptr, ost, ret = 0; + int object_size_type; + + if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + ptr = TREE_VALUE (arglist); + ost = TREE_VALUE (TREE_CHAIN (arglist)); + STRIP_NOPS (ost); + + if (TREE_CODE (ost) != INTEGER_CST + || tree_int_cst_sgn (ost) < 0 + || compare_tree_int (ost, 3) > 0) + return 0; + + object_size_type = tree_low_cst (ost, 0); + + /* __builtin_object_size doesn't evaluate side-effects in its arguments; + if there are any side-effects, it returns (size_t) -1 for types 0 and 1 + and (size_t) 0 for types 2 and 3. */ + if (TREE_SIDE_EFFECTS (ptr)) + return fold_convert (size_type_node, + object_size_type < 2 + ? integer_minus_one_node : integer_zero_node); + + if (TREE_CODE (ptr) == ADDR_EXPR) + ret = build_int_cstu (size_type_node, + compute_builtin_object_size (ptr, object_size_type)); + + else if (TREE_CODE (ptr) == SSA_NAME) + { + unsigned HOST_WIDE_INT bytes; + + /* If object size is not known yet, delay folding until + later. Maybe subsequent passes will help determining + it. */ + bytes = compute_builtin_object_size (ptr, object_size_type); + if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 + ? -1 : 0)) + ret = build_int_cstu (size_type_node, bytes); + } + + if (ret) + { + ret = force_fit_type (ret, -1, false, false); + if (TREE_CONSTANT_OVERFLOW (ret)) + ret = 0; + } + + return ret; +} + +/* Fold a call to the __mem{cpy,pcpy,move,set}_chk builtin. + IGNORE is true, if return value can be ignored. FCODE is the BUILT_IN_* + code of the builtin. If MAXLEN is not NULL, it is maximum length + passed as third argument. */ + +tree +fold_builtin_memory_chk (tree fndecl, tree arglist, tree maxlen, bool ignore, + enum built_in_function fcode) +{ + tree dest, src, len, size, fn; + + if (!validate_arglist (arglist, + POINTER_TYPE, + fcode == BUILT_IN_MEMSET_CHK + ? INTEGER_TYPE : POINTER_TYPE, + INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + /* Actually val for __memset_chk, but it doesn't matter. */ + src = TREE_VALUE (TREE_CHAIN (arglist)); + len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))); + + /* If SRC and DEST are the same (and not volatile), return DEST + (resp. DEST+LEN for __mempcpy_chk). */ + if (fcode != BUILT_IN_MEMSET_CHK && operand_equal_p (src, dest, 0)) + { + if (fcode != BUILT_IN_MEMPCPY_CHK) + return omit_one_operand (TREE_TYPE (TREE_TYPE (fndecl)), dest, len); + else + { + tree temp = fold_convert (TREE_TYPE (dest), len); + temp = fold_build2 (PLUS_EXPR, TREE_TYPE (dest), dest, temp); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), temp); + } + } + + if (! host_integerp (size, 1)) + return 0; + + if (! integer_all_onesp (size)) + { + if (! host_integerp (len, 1)) + { + /* If LEN is not constant, try MAXLEN too. + For MAXLEN only allow optimizing into non-_ocs function + if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ + if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) + { + if (fcode == BUILT_IN_MEMPCPY_CHK && ignore) + { + /* (void) __mempcpy_chk () can be optimized into + (void) __memcpy_chk (). */ + fn = built_in_decls[BUILT_IN_MEMCPY_CHK]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); + } + return 0; + } + } + else + maxlen = len; + + if (tree_int_cst_lt (size, maxlen)) + return 0; + } + + arglist = build_tree_list (NULL_TREE, len); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + fn = NULL_TREE; + /* If __builtin_mem{cpy,pcpy,move,set}_chk is used, assume + mem{cpy,pcpy,move,set} is available. */ + switch (fcode) + { + case BUILT_IN_MEMCPY_CHK: + fn = built_in_decls[BUILT_IN_MEMCPY]; + break; + case BUILT_IN_MEMPCPY_CHK: + fn = built_in_decls[BUILT_IN_MEMPCPY]; + break; + case BUILT_IN_MEMMOVE_CHK: + fn = built_in_decls[BUILT_IN_MEMMOVE]; + break; + case BUILT_IN_MEMSET_CHK: + fn = built_in_decls[BUILT_IN_MEMSET]; + break; + default: + break; + } + + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to the __st[rp]cpy_chk builtin. + IGNORE is true, if return value can be ignored. FCODE is the BUILT_IN_* + code of the builtin. If MAXLEN is not NULL, it is maximum length of + strings passed as second argument. */ + +tree +fold_builtin_stxcpy_chk (tree fndecl, tree arglist, tree maxlen, bool ignore, + enum built_in_function fcode) +{ + tree dest, src, size, len, fn; + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, + VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + src = TREE_VALUE (TREE_CHAIN (arglist)); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + /* If SRC and DEST are the same (and not volatile), return DEST. */ + if (fcode == BUILT_IN_STRCPY_CHK && operand_equal_p (src, dest, 0)) + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), dest); + + if (! host_integerp (size, 1)) + return 0; + + if (! integer_all_onesp (size)) + { + len = c_strlen (src, 1); + if (! len || ! host_integerp (len, 1)) + { + /* If LEN is not constant, try MAXLEN too. + For MAXLEN only allow optimizing into non-_ocs function + if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ + if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) + { + if (fcode == BUILT_IN_STPCPY_CHK) + { + if (! ignore) + return 0; + + /* If return value of __stpcpy_chk is ignored, + optimize into __strcpy_chk. */ + fn = built_in_decls[BUILT_IN_STRCPY_CHK]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); + } + + if (! len || TREE_SIDE_EFFECTS (len)) + return 0; + + /* If c_strlen returned something, but not a constant, + transform __strcpy_chk into __memcpy_chk. */ + fn = built_in_decls[BUILT_IN_MEMCPY_CHK]; + if (!fn) + return 0; + + len = size_binop (PLUS_EXPR, len, ssize_int (1)); + arglist = build_tree_list (NULL_TREE, size); + arglist = tree_cons (NULL_TREE, len, arglist); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), + build_function_call_expr (fn, arglist)); + } + } + else + maxlen = len; + + if (! tree_int_cst_lt (maxlen, size)) + return 0; + } + + arglist = build_tree_list (NULL_TREE, src); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_st{r,p}cpy_chk is used, assume st{r,p}cpy is available. */ + fn = built_in_decls[fcode == BUILT_IN_STPCPY_CHK + ? BUILT_IN_STPCPY : BUILT_IN_STRCPY]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to the __strncpy_chk builtin. + If MAXLEN is not NULL, it is maximum length passed as third argument. */ + +tree +fold_builtin_strncpy_chk (tree arglist, tree maxlen) +{ + tree dest, src, size, len, fn; + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + src = TREE_VALUE (TREE_CHAIN (arglist)); + len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))); + + if (! host_integerp (size, 1)) + return 0; + + if (! integer_all_onesp (size)) + { + if (! host_integerp (len, 1)) + { + /* If LEN is not constant, try MAXLEN too. + For MAXLEN only allow optimizing into non-_ocs function + if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ + if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) + return 0; + } + else + maxlen = len; + + if (tree_int_cst_lt (size, maxlen)) + return 0; + } + + arglist = build_tree_list (NULL_TREE, len); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_strncpy_chk is used, assume strncpy is available. */ + fn = built_in_decls[BUILT_IN_STRNCPY]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to the __strcat_chk builtin FNDECL with ARGLIST. */ + +static tree +fold_builtin_strcat_chk (tree fndecl, tree arglist) +{ + tree dest, src, size, fn; + const char *p; + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, + VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + src = TREE_VALUE (TREE_CHAIN (arglist)); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + p = c_getstr (src); + /* If the SRC parameter is "", return DEST. */ + if (p && *p == '\0') + return omit_one_operand (TREE_TYPE (TREE_TYPE (fndecl)), dest, src); + + if (! host_integerp (size, 1) || ! integer_all_onesp (size)) + return 0; + + arglist = build_tree_list (NULL_TREE, src); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_strcat_chk is used, assume strcat is available. */ + fn = built_in_decls[BUILT_IN_STRCAT]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to the __strncat_chk builtin EXP. */ + +static tree +fold_builtin_strncat_chk (tree fndecl, tree arglist) +{ + tree dest, src, size, len, fn; + const char *p; + + if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, + INTEGER_TYPE, VOID_TYPE)) + return 0; + + dest = TREE_VALUE (arglist); + src = TREE_VALUE (TREE_CHAIN (arglist)); + len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + size = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))); + + p = c_getstr (src); + /* If the SRC parameter is "" or if LEN is 0, return DEST. */ + if (p && *p == '\0') + return omit_one_operand (TREE_TYPE (TREE_TYPE (fndecl)), dest, len); + else if (integer_zerop (len)) + return omit_one_operand (TREE_TYPE (TREE_TYPE (fndecl)), dest, src); + + if (! host_integerp (size, 1)) + return 0; + + if (! integer_all_onesp (size)) + { + tree src_len = c_strlen (src, 1); + if (src_len + && host_integerp (src_len, 1) + && host_integerp (len, 1) + && ! tree_int_cst_lt (len, src_len)) + { + /* If LEN >= strlen (SRC), optimize into __strcat_chk. */ + fn = built_in_decls[BUILT_IN_STRCAT_CHK]; + if (!fn) + return 0; + + arglist = build_tree_list (NULL_TREE, size); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + return build_function_call_expr (fn, arglist); + } + return 0; + } + + arglist = build_tree_list (NULL_TREE, len); + arglist = tree_cons (NULL_TREE, src, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_strncat_chk is used, assume strncat is available. */ + fn = built_in_decls[BUILT_IN_STRNCAT]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to __{,v}sprintf_chk with argument list ARGLIST. Return 0 if + a normal call should be emitted rather than expanding the function + inline. FCODE is either BUILT_IN_SPRINTF_CHK or BUILT_IN_VSPRINTF_CHK. */ + +static tree +fold_builtin_sprintf_chk (tree arglist, enum built_in_function fcode) +{ + tree dest, size, len, fn, fmt, flag; + const char *fmt_str; + + /* Verify the required arguments in the original call. */ + if (! arglist) + return 0; + dest = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (dest))) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + flag = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (flag)) != INTEGER_TYPE) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + size = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + fmt = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) + return 0; + arglist = TREE_CHAIN (arglist); + + if (! host_integerp (size, 1)) + return 0; + + len = NULL_TREE; + + if (!init_target_chars()) + return 0; + + /* Check whether the format is a literal string constant. */ + fmt_str = c_getstr (fmt); + if (fmt_str != NULL) + { + /* If the format doesn't contain % args or %%, we know the size. */ + if (strchr (fmt_str, target_percent) == 0) + { + if (fcode != BUILT_IN_SPRINTF_CHK || arglist == NULL_TREE) + len = build_int_cstu (size_type_node, strlen (fmt_str)); + } + /* If the format is "%s" and first ... argument is a string literal, + we know the size too. */ + else if (fcode == BUILT_IN_SPRINTF_CHK && strcmp (fmt_str, target_percent_s) == 0) + { + tree arg; + + if (arglist && !TREE_CHAIN (arglist)) + { + arg = TREE_VALUE (arglist); + if (POINTER_TYPE_P (TREE_TYPE (arg))) + { + len = c_strlen (arg, 1); + if (! len || ! host_integerp (len, 1)) + len = NULL_TREE; + } + } + } + } + + if (! integer_all_onesp (size)) + { + if (! len || ! tree_int_cst_lt (len, size)) + return 0; + } + + /* Only convert __{,v}sprintf_chk to {,v}sprintf if flag is 0 + or if format doesn't contain % chars or is "%s". */ + if (! integer_zerop (flag)) + { + if (fmt_str == NULL) + return 0; + if (strchr (fmt_str, target_percent) != NULL && strcmp (fmt_str, target_percent_s)) + return 0; + } + + arglist = tree_cons (NULL_TREE, fmt, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_{,v}sprintf_chk is used, assume {,v}sprintf is available. */ + fn = built_in_decls[fcode == BUILT_IN_VSPRINTF_CHK + ? BUILT_IN_VSPRINTF : BUILT_IN_SPRINTF]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to {,v}snprintf with argument list ARGLIST. Return 0 if + a normal call should be emitted rather than expanding the function + inline. FCODE is either BUILT_IN_SNPRINTF_CHK or + BUILT_IN_VSNPRINTF_CHK. If MAXLEN is not NULL, it is maximum length + passed as second argument. */ + +tree +fold_builtin_snprintf_chk (tree arglist, tree maxlen, + enum built_in_function fcode) +{ + tree dest, size, len, fn, fmt, flag; + const char *fmt_str; + + /* Verify the required arguments in the original call. */ + if (! arglist) + return 0; + dest = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (dest))) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + len = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (len)) != INTEGER_TYPE) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + flag = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (len)) != INTEGER_TYPE) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + size = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE) + return 0; + arglist = TREE_CHAIN (arglist); + if (! arglist) + return 0; + fmt = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) + return 0; + arglist = TREE_CHAIN (arglist); + + if (! host_integerp (size, 1)) + return 0; + + if (! integer_all_onesp (size)) + { + if (! host_integerp (len, 1)) + { + /* If LEN is not constant, try MAXLEN too. + For MAXLEN only allow optimizing into non-_ocs function + if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ + if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) + return 0; + } + else + maxlen = len; + + if (tree_int_cst_lt (size, maxlen)) + return 0; + } + + if (!init_target_chars()) + return 0; + + /* Only convert __{,v}snprintf_chk to {,v}snprintf if flag is 0 + or if format doesn't contain % chars or is "%s". */ + if (! integer_zerop (flag)) + { + fmt_str = c_getstr (fmt); + if (fmt_str == NULL) + return 0; + if (strchr (fmt_str, target_percent) != NULL && strcmp (fmt_str, target_percent_s)) + return 0; + } + + arglist = tree_cons (NULL_TREE, fmt, arglist); + arglist = tree_cons (NULL_TREE, len, arglist); + arglist = tree_cons (NULL_TREE, dest, arglist); + + /* If __builtin_{,v}snprintf_chk is used, assume {,v}snprintf is + available. */ + fn = built_in_decls[fcode == BUILT_IN_VSNPRINTF_CHK + ? BUILT_IN_VSNPRINTF : BUILT_IN_SNPRINTF]; + if (!fn) + return 0; + + return build_function_call_expr (fn, arglist); +} + +/* Fold a call to the {,v}printf{,_unlocked} and __{,v}printf_chk builtins. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. FCODE is the BUILT_IN_* + code of the function to be simplified. */ + +static tree +fold_builtin_printf (tree fndecl, tree arglist, bool ignore, + enum built_in_function fcode) +{ + tree fmt, fn = NULL_TREE, fn_putchar, fn_puts, arg, call; + const char *fmt_str = NULL; + + /* If the return value is used, don't do the transformation. */ + if (! ignore) + return 0; + + /* Verify the required arguments in the original call. */ + if (fcode == BUILT_IN_PRINTF_CHK || fcode == BUILT_IN_VPRINTF_CHK) + { + tree flag; + + if (! arglist) + return 0; + flag = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (flag)) != INTEGER_TYPE + || TREE_SIDE_EFFECTS (flag)) + return 0; + arglist = TREE_CHAIN (arglist); + } + + if (! arglist) + return 0; + fmt = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) + return 0; + arglist = TREE_CHAIN (arglist); + + /* Check whether the format is a literal string constant. */ + fmt_str = c_getstr (fmt); + if (fmt_str == NULL) + return NULL_TREE; + + if (fcode == BUILT_IN_PRINTF_UNLOCKED) + { + /* If we're using an unlocked function, assume the other + unlocked functions exist explicitly. */ + fn_putchar = built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED]; + fn_puts = built_in_decls[BUILT_IN_PUTS_UNLOCKED]; + } + else + { + fn_putchar = implicit_built_in_decls[BUILT_IN_PUTCHAR]; + fn_puts = implicit_built_in_decls[BUILT_IN_PUTS]; + } + + if (!init_target_chars()) + return 0; + + if (strcmp (fmt_str, target_percent_s) == 0 || strchr (fmt_str, target_percent) == NULL) + { + const char *str; + + if (strcmp (fmt_str, target_percent_s) == 0) + { + if (fcode == BUILT_IN_VPRINTF || fcode == BUILT_IN_VPRINTF_CHK) + return 0; + + if (! arglist + || ! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist))) + || TREE_CHAIN (arglist)) + return 0; + + str = c_getstr (TREE_VALUE (arglist)); + if (str == NULL) + return 0; + } + else + { + /* The format specifier doesn't contain any '%' characters. */ + if (fcode != BUILT_IN_VPRINTF && fcode != BUILT_IN_VPRINTF_CHK + && arglist) + return 0; + str = fmt_str; + } + + /* If the string was "", printf does nothing. */ + if (str[0] == '\0') + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), 0); + + /* If the string has length of 1, call putchar. */ + if (str[1] == '\0') + { + /* Given printf("c"), (where c is any one character,) + convert "c"[0] to an int and pass that to the replacement + function. */ + arg = build_int_cst (NULL_TREE, str[0]); + arglist = build_tree_list (NULL_TREE, arg); + fn = fn_putchar; + } + else + { + /* If the string was "string\n", call puts("string"). */ + size_t len = strlen (str); + if ((unsigned char)str[len - 1] == target_newline) + { + /* Create a NUL-terminated string that's one char shorter + than the original, stripping off the trailing '\n'. */ + char *newstr = alloca (len); + memcpy (newstr, str, len - 1); + newstr[len - 1] = 0; + + arg = build_string_literal (len, newstr); + arglist = build_tree_list (NULL_TREE, arg); + fn = fn_puts; + } + else + /* We'd like to arrange to call fputs(string,stdout) here, + but we need stdout and don't have a way to get it yet. */ + return 0; + } + } + + /* The other optimizations can be done only on the non-va_list variants. */ + else if (fcode == BUILT_IN_VPRINTF || fcode == BUILT_IN_VPRINTF_CHK) + return 0; + + /* If the format specifier was "%s\n", call __builtin_puts(arg). */ + else if (strcmp (fmt_str, target_percent_s_newline) == 0) + { + if (! arglist + || ! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist))) + || TREE_CHAIN (arglist)) + return 0; + fn = fn_puts; + } + + /* If the format specifier was "%c", call __builtin_putchar(arg). */ + else if (strcmp (fmt_str, target_percent_c) == 0) + { + if (! arglist + || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE + || TREE_CHAIN (arglist)) + return 0; + fn = fn_putchar; + } + + if (!fn) + return 0; + + call = build_function_call_expr (fn, arglist); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), call); +} + +/* Fold a call to the {,v}fprintf{,_unlocked} and __{,v}printf_chk builtins. + + Return 0 if no simplification was possible, otherwise return the + simplified form of the call as a tree. FCODE is the BUILT_IN_* + code of the function to be simplified. */ + +static tree +fold_builtin_fprintf (tree fndecl, tree arglist, bool ignore, + enum built_in_function fcode) +{ + tree fp, fmt, fn = NULL_TREE, fn_fputc, fn_fputs, arg, call; + const char *fmt_str = NULL; + + /* If the return value is used, don't do the transformation. */ + if (! ignore) + return 0; + + /* Verify the required arguments in the original call. */ + if (! arglist) + return 0; + fp = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (fp))) + return 0; + arglist = TREE_CHAIN (arglist); + + if (fcode == BUILT_IN_FPRINTF_CHK || fcode == BUILT_IN_VFPRINTF_CHK) + { + tree flag; + + if (! arglist) + return 0; + flag = TREE_VALUE (arglist); + if (TREE_CODE (TREE_TYPE (flag)) != INTEGER_TYPE + || TREE_SIDE_EFFECTS (flag)) + return 0; + arglist = TREE_CHAIN (arglist); + } + + if (! arglist) + return 0; + fmt = TREE_VALUE (arglist); + if (! POINTER_TYPE_P (TREE_TYPE (fmt))) + return 0; + arglist = TREE_CHAIN (arglist); + + /* Check whether the format is a literal string constant. */ + fmt_str = c_getstr (fmt); + if (fmt_str == NULL) + return NULL_TREE; + + if (fcode == BUILT_IN_FPRINTF_UNLOCKED) + { + /* If we're using an unlocked function, assume the other + unlocked functions exist explicitly. */ + fn_fputc = built_in_decls[BUILT_IN_FPUTC_UNLOCKED]; + fn_fputs = built_in_decls[BUILT_IN_FPUTS_UNLOCKED]; + } + else + { + fn_fputc = implicit_built_in_decls[BUILT_IN_FPUTC]; + fn_fputs = implicit_built_in_decls[BUILT_IN_FPUTS]; + } + + if (!init_target_chars()) + return 0; + + /* If the format doesn't contain % args or %%, use strcpy. */ + if (strchr (fmt_str, target_percent) == NULL) + { + if (fcode != BUILT_IN_VFPRINTF && fcode != BUILT_IN_VFPRINTF_CHK + && arglist) + return 0; + + /* If the format specifier was "", fprintf does nothing. */ + if (fmt_str[0] == '\0') + { + /* If FP has side-effects, just wait until gimplification is + done. */ + if (TREE_SIDE_EFFECTS (fp)) + return 0; + + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), 0); + } + + /* When "string" doesn't contain %, replace all cases of + fprintf (fp, string) with fputs (string, fp). The fputs + builtin will take care of special cases like length == 1. */ + arglist = build_tree_list (NULL_TREE, fp); + arglist = tree_cons (NULL_TREE, fmt, arglist); + fn = fn_fputs; + } + + /* The other optimizations can be done only on the non-va_list variants. */ + else if (fcode == BUILT_IN_VFPRINTF || fcode == BUILT_IN_VFPRINTF_CHK) + return 0; + + /* If the format specifier was "%s", call __builtin_fputs (arg, fp). */ + else if (strcmp (fmt_str, target_percent_s) == 0) + { + if (! arglist + || ! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist))) + || TREE_CHAIN (arglist)) + return 0; + arg = TREE_VALUE (arglist); + arglist = build_tree_list (NULL_TREE, fp); + arglist = tree_cons (NULL_TREE, arg, arglist); + fn = fn_fputs; + } + + /* If the format specifier was "%c", call __builtin_fputc (arg, fp). */ + else if (strcmp (fmt_str, target_percent_c) == 0) + { + if (! arglist + || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != INTEGER_TYPE + || TREE_CHAIN (arglist)) + return 0; + arg = TREE_VALUE (arglist); + arglist = build_tree_list (NULL_TREE, fp); + arglist = tree_cons (NULL_TREE, arg, arglist); + fn = fn_fputc; + } + + if (!fn) + return 0; + + call = build_function_call_expr (fn, arglist); + return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), call); +} + +/* Initialize format string characters in the target charset. */ + +static bool +init_target_chars (void) +{ + static bool init; + if (!init) + { + target_newline = lang_hooks.to_target_charset ('\n'); + target_percent = lang_hooks.to_target_charset ('%'); + target_c = lang_hooks.to_target_charset ('c'); + target_s = lang_hooks.to_target_charset ('s'); + if (target_newline == 0 || target_percent == 0 || target_c == 0 + || target_s == 0) + return false; + + target_percent_c[0] = target_percent; + target_percent_c[1] = target_c; + target_percent_c[2] = '\0'; + + target_percent_s[0] = target_percent; + target_percent_s[1] = target_s; + target_percent_s[2] = '\0'; + + target_percent_s_newline[0] = target_percent; + target_percent_s_newline[1] = target_s; + target_percent_s_newline[2] = target_newline; + target_percent_s_newline[3] = '\0'; + + init = true; + } + return true; +} diff --git a/contrib/gcc/builtins.def b/contrib/gcc/builtins.def index dbc61ce3775..37ea28c0960 100644 --- a/contrib/gcc/builtins.def +++ b/contrib/gcc/builtins.def @@ -1,6 +1,7 @@ /* This file contains the definitions and documentation for the builtins used in the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,13 +17,13 @@ for more details. 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. */ /* Before including this file, you should define a macro: DEF_BUILTIN (ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, - FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT) + FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT, COND) This macro will be called once for each builtin function. The ENUM will be of type `enum built_in_function', and will indicate @@ -53,22 +54,30 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA exist when compiling in ANSI conformant mode. ATTRs is an attribute list as defined in builtin-attrs.def that - describes the attributes of this builtin function. + describes the attributes of this builtin function. IMPLICIT specifies condition when the builtin can be produced by compiler. For instance C90 reserves floorf function, but does not define it's meaning. When user uses floorf we may assume that the floorf has the meaning we expect, but we can't produce floorf by simplifying floor((double)float) since the runtime need not implement - it. */ - + it. + + The builtins is registered only if COND is true. */ + /* A GCC builtin (like __builtin_saveregs) is provided by the compiler, but does not correspond to a function in the standard library. */ #undef DEF_GCC_BUILTIN #define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \ - false, false, false, ATTRS, true) + false, false, false, ATTRS, true, true) + +/* Like DEF_GCC_BUILTIN, except we don't prepend "__builtin_". */ +#undef DEF_SYNC_BUILTIN +#define DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \ + false, false, false, ATTRS, true, true) /* A library builtin (like __builtin_strchr) is a builtin equivalent of an ANSI/ISO standard library function. In addition to the @@ -76,34 +85,62 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA `strchr') as well. If we cannot compute the answer using the builtin function, we will fall back to the standard library version. */ -#undef DEF_LIB_BUILTIN +#undef DEF_LIB_BUILTIN #define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ - true, true, false, ATTRS, true) + true, true, false, ATTRS, true, true) /* Like DEF_LIB_BUILTIN, except that the function is not one that is specified by ANSI/ISO C. So, when we're being fully conformant we ignore the version of these builtins that does not begin with __builtin. */ -#undef DEF_EXT_LIB_BUILTIN +#undef DEF_EXT_LIB_BUILTIN #define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ - true, true, true, ATTRS, false) + true, true, true, ATTRS, false, true) + +/* Like DEF_LIB_BUILTIN, except that the function is only a part of + the standard in C94 or above. */ +#undef DEF_C94_BUILTIN +#define DEF_C94_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ + true, true, !flag_isoc94, ATTRS, TARGET_C99_FUNCTIONS, true) /* Like DEF_LIB_BUILTIN, except that the function is only a part of the standard in C99 or above. */ -#undef DEF_C99_BUILTIN +#undef DEF_C99_BUILTIN #define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ - true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS) + true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true) /* Builtin that is specified by C99 and C90 reserve the name for future use. We can still recognize the builtin in C90 mode but we can't produce it implicitly. */ -#undef DEF_C99_C90RES_BUILTIN +#undef DEF_C99_C90RES_BUILTIN #define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ - true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS) + true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true) + +/* Builtin that C99 reserve the name for future use. We can still recognize + the builtin in C99 mode but we can't produce it implicitly. */ +#undef DEF_EXT_C99RES_BUILTIN +#define DEF_EXT_C99RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ + true, true, true, ATTRS, false, true) + +/* Allocate the enum and the name for a builtin, but do not actually + define it here at all. */ +#undef DEF_BUILTIN_STUB +#define DEF_BUILTIN_STUB(ENUM, NAME) \ + DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, 0, 0, false, false, \ + false, 0, false, false) + +/* Builtin used by the implementation of GNU OpenMP. None of these are + actually implemented in the compiler; they're all in libgomp. */ +#undef DEF_GOMP_BUILTIN +#define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ + false, true, true, ATTRS, false, flag_openmp) /* Define an attribute list for math functions that are normally "impure" because some of them may write into global memory for @@ -115,11 +152,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Define an attribute list for math functions that are normally "pure" but if flag_unsafe_math_optimizations is set they are instead "const". This distinction accounts for the fact that some - math functions check the rounding mode which is akin to examing + math functions check the rounding mode which is akin to examining global memory. In "unsafe" mode we can be less careful. */ #undef ATTR_MATHFN_FPROUNDING #define ATTR_MATHFN_FPROUNDING (flag_unsafe_math_optimizations ? \ - ATTR_CONST_NOTHROW_LIST : ATTR_PURE_NOTHROW_LIST) + ATTR_CONST_NOTHROW_LIST : ATTR_PURE_NOTHROW_NOVOPS_LIST) /* Define an attribute list for math functions that are normally "impure" because some of them may write into global memory for @@ -218,9 +255,9 @@ DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LON DEF_LIB_BUILTIN (BUILT_IN_FREXP, "frexp", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE) DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPF, "frexpf", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE) DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPL, "frexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE) -DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) -DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) -DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE) +DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE) +DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE) DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) @@ -233,6 +270,9 @@ DEF_C99_BUILTIN (BUILT_IN_ILOGBL, "ilogbl", BT_FN_INT_LONGDOUBLE, ATTR_MA DEF_GCC_BUILTIN (BUILT_IN_INF, "inf", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_INFF, "inff", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_INFL, "infl", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_INFD32, "infd32", BT_FN_DFLOAT32, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_INFD64, "infd64", BT_FN_DFLOAT64, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_INFD128, "infd128", BT_FN_DFLOAT128, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_J0, "j0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_J0F, "j0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_J0L, "j0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) @@ -242,12 +282,24 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_J1L, "j1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_M DEF_EXT_LIB_BUILTIN (BUILT_IN_JN, "jn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_JNF, "jnf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_JNL, "jnl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_LCEIL, "lceil", BT_FN_LONG_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LCEILF, "lceilf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LCEILL, "lceill", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_LDEXP, "ldexp", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPF, "ldexpf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPL, "ldexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) -DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) -DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) -DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_LFLOOR, "lfloor", BT_FN_LONG_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LFLOORF, "lfloorf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LFLOORL, "lfloorl", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE) +DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE) +DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE) +DEF_GCC_BUILTIN (BUILT_IN_LLCEIL, "llceil", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LLCEILF, "llceilf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LLCEILL, "llceill", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOOR, "llfloor", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOORF, "llfloorf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOORL, "llfloorl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_LLRINT, "llrint", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LLRINTF, "llrintf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LLRINTL, "llrintl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) @@ -278,12 +330,15 @@ DEF_C99_BUILTIN (BUILT_IN_LROUNDL, "lroundl", BT_FN_LONG_LONGDOUBLE, ATTR DEF_LIB_BUILTIN (BUILT_IN_MODF, "modf", BT_FN_DOUBLE_DOUBLE_DOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE) DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFF, "modff", BT_FN_FLOAT_FLOAT_FLOATPTR, ATTR_MATHFN_FPROUNDING_STORE) DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFL, "modfl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE) -DEF_GCC_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) -DEF_GCC_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) -DEF_GCC_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) -DEF_GCC_BUILTIN (BUILT_IN_NANS, "nans", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) -DEF_GCC_BUILTIN (BUILT_IN_NANSF, "nansf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) -DEF_GCC_BUILTIN (BUILT_IN_NANSL, "nansl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL_1) +DEF_GCC_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NAND32, "nand32", BT_FN_DFLOAT32_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NAND64, "nand64", BT_FN_DFLOAT64_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NAND128, "nand128", BT_FN_DFLOAT128_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NANS, "nans", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NANSF, "nansf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) +DEF_GCC_BUILTIN (BUILT_IN_NANSL, "nansl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL) DEF_C99_BUILTIN (BUILT_IN_NEARBYINT, "nearbyint", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_NEARBYINTF, "nearbyintf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_NEARBYINTL, "nearbyintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) @@ -298,6 +353,9 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10, "pow10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHF DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10F, "pow10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10L, "pow10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_POWF, "powf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_POWI, "powi", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_POWIF, "powif", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_POWIL, "powil", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING) DEF_C99_C90RES_BUILTIN (BUILT_IN_POWL, "powl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) @@ -320,6 +378,9 @@ DEF_C99_BUILTIN (BUILT_IN_SCALBLNL, "scalblnl", BT_FN_LONGDOUBLE_LONGDOUB DEF_C99_BUILTIN (BUILT_IN_SCALBN, "scalbn", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITF, "signbitf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITL, "signbitl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICAND, "significand", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) @@ -358,8 +419,6 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_YNF, "ynf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_ DEF_EXT_LIB_BUILTIN (BUILT_IN_YNL, "ynl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) /* Category: _Complex math builtins. */ -/* The C99 clog function conflicts with C++ iostreams clog, see - http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00510.html */ DEF_C99_BUILTIN (BUILT_IN_CABS, "cabs", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING) DEF_C99_BUILTIN (BUILT_IN_CABSF, "cabsf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING) DEF_C99_BUILTIN (BUILT_IN_CABSL, "cabsl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) @@ -396,9 +455,12 @@ DEF_C99_BUILTIN (BUILT_IN_CEXPL, "cexpl", BT_FN_COMPLEX_LONGDOUBLE_COMPLE DEF_C99_BUILTIN (BUILT_IN_CIMAG, "cimag", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_CIMAGF, "cimagf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_CIMAGL, "cimagl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) -/*DEF_C99_BUILTIN (BUILT_IN_CLOG, "clog", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)*/ -/*DEF_C99_BUILTIN (BUILT_IN_CLOGF, "clogf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)*/ -/*DEF_C99_BUILTIN (BUILT_IN_CLOGL, "clogl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)*/ +DEF_C99_BUILTIN (BUILT_IN_CLOG, "clog", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_C99_BUILTIN (BUILT_IN_CLOGF, "clogf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_C99_BUILTIN (BUILT_IN_CLOGL, "clogl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10, "clog10", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10F, "clog10f", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10L, "clog10l", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) DEF_C99_BUILTIN (BUILT_IN_CONJ, "conj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_CONJF, "conjf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN_CONJL, "conjl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) @@ -433,60 +495,97 @@ DEF_C99_BUILTIN (BUILT_IN_CTANL, "ctanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLE DEF_EXT_LIB_BUILTIN (BUILT_IN_BCMP, "bcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1) -DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2) -DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL_1) -DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1) -DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1) -DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL_1) -DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1) -DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRPBRK, "strpbrk", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRRCHR, "strrchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_1) -DEF_LIB_BUILTIN (BUILT_IN_STRSPN, "strspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_STRSTR, "strstr", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_1_2) +DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRPBRK, "strpbrk", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRRCHR, "strrchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRSPN, "strspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_LIB_BUILTIN (BUILT_IN_STRSTR, "strstr", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) /* Category: stdio builtins. */ -DEF_LIB_BUILTIN (BUILT_IN_FPRINTF, "fprintf", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_UNLOCKED, "fprintf_unlocked", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) -DEF_LIB_BUILTIN (BUILT_IN_FPUTC, "fputc", BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTC_UNLOCKED, "fputc_unlocked", BT_FN_INT_INT_PTR, ATTR_NOTHROW_NONNULL_2) -DEF_LIB_BUILTIN (BUILT_IN_FPUTS, "fputs", BT_FN_INT_CONST_STRING_PTR, ATTR_NOTHROW_NONNULL_1_2) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTS_UNLOCKED, "fputs_unlocked", BT_FN_INT_CONST_STRING_PTR, ATTR_NOTHROW_NONNULL_1_2) -DEF_LIB_BUILTIN (BUILT_IN_FSCANF, "fscanf", BT_FN_INT_PTR_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3) -DEF_LIB_BUILTIN (BUILT_IN_FWRITE, "fwrite", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4) -DEF_EXT_LIB_BUILTIN (BUILT_IN_FWRITE_UNLOCKED, "fwrite_unlocked", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR, ATTR_NOTHROW_NONNULL_1_4) +DEF_LIB_BUILTIN (BUILT_IN_FPRINTF, "fprintf", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_UNLOCKED, "fprintf_unlocked", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) +DEF_LIB_BUILTIN (BUILT_IN_PUTC, "putc", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTC_UNLOCKED, "putc_unlocked", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST) +DEF_LIB_BUILTIN (BUILT_IN_FPUTC, "fputc", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTC_UNLOCKED, "fputc_unlocked", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST) +DEF_LIB_BUILTIN (BUILT_IN_FPUTS, "fputs", BT_FN_INT_CONST_STRING_FILEPTR, ATTR_NONNULL_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTS_UNLOCKED, "fputs_unlocked", BT_FN_INT_CONST_STRING_FILEPTR, ATTR_NONNULL_LIST) +DEF_LIB_BUILTIN (BUILT_IN_FSCANF, "fscanf", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3) +DEF_LIB_BUILTIN (BUILT_IN_FWRITE, "fwrite", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, ATTR_NONNULL_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FWRITE_UNLOCKED, "fwrite_unlocked", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, ATTR_NONNULL_LIST) DEF_LIB_BUILTIN (BUILT_IN_PRINTF, "printf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2) DEF_EXT_LIB_BUILTIN (BUILT_IN_PRINTF_UNLOCKED, "printf_unlocked", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2) -DEF_LIB_BUILTIN (BUILT_IN_PUTCHAR, "putchar", BT_FN_INT_INT, ATTR_NOTHROW_LIST) -DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTCHAR_UNLOCKED, "putchar_unlocked", BT_FN_INT_INT, ATTR_NOTHROW_LIST) -DEF_LIB_BUILTIN (BUILT_IN_PUTS, "puts", BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1) -DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTS_UNLOCKED, "puts_unlocked", BT_FN_INT_CONST_STRING, ATTR_NOTHROW_NONNULL_1) +DEF_LIB_BUILTIN (BUILT_IN_PUTCHAR, "putchar", BT_FN_INT_INT, ATTR_NULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTCHAR_UNLOCKED, "putchar_unlocked", BT_FN_INT_INT, ATTR_NULL) +DEF_LIB_BUILTIN (BUILT_IN_PUTS, "puts", BT_FN_INT_CONST_STRING, ATTR_NONNULL_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTS_UNLOCKED, "puts_unlocked", BT_FN_INT_CONST_STRING, ATTR_NONNULL_LIST) DEF_LIB_BUILTIN (BUILT_IN_SCANF, "scanf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_SCANF_1_2) DEF_C99_BUILTIN (BUILT_IN_SNPRINTF, "snprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_3_4) DEF_LIB_BUILTIN (BUILT_IN_SPRINTF, "sprintf", BT_FN_INT_STRING_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) DEF_LIB_BUILTIN (BUILT_IN_SSCANF, "sscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3) -DEF_LIB_BUILTIN (BUILT_IN_VFPRINTF, "vfprintf", BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0) -DEF_C99_BUILTIN (BUILT_IN_VFSCANF, "vfscanf", BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0) +DEF_LIB_BUILTIN (BUILT_IN_VFPRINTF, "vfprintf", BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0) +DEF_C99_BUILTIN (BUILT_IN_VFSCANF, "vfscanf", BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0) DEF_LIB_BUILTIN (BUILT_IN_VPRINTF, "vprintf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_1_0) DEF_C99_BUILTIN (BUILT_IN_VSCANF, "vscanf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_1_0) DEF_C99_BUILTIN (BUILT_IN_VSNPRINTF, "vsnprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_3_0) DEF_LIB_BUILTIN (BUILT_IN_VSPRINTF, "vsprintf", BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0) DEF_C99_BUILTIN (BUILT_IN_VSSCANF, "vsscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0) +/* Category: ctype builtins. */ +DEF_LIB_BUILTIN (BUILT_IN_ISALNUM, "isalnum", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISALPHA, "isalpha", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISASCII, "isascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_C99_BUILTIN (BUILT_IN_ISBLANK, "isblank", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISCNTRL, "iscntrl", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISDIGIT, "isdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISGRAPH, "isgraph", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISLOWER, "islower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISPRINT, "isprint", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISPUNCT, "ispunct", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISSPACE, "isspace", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISUPPER, "isupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_ISXDIGIT, "isxdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_TOASCII, "toascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_TOLOWER, "tolower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) +DEF_LIB_BUILTIN (BUILT_IN_TOUPPER, "toupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST) + +/* Category: wctype builtins. */ +DEF_C94_BUILTIN (BUILT_IN_ISWALNUM, "iswalnum", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWALPHA, "iswalpha", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C99_BUILTIN (BUILT_IN_ISWBLANK, "iswblank", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWCNTRL, "iswcntrl", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWDIGIT, "iswdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWGRAPH, "iswgraph", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWLOWER, "iswlower", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWPRINT, "iswprint", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWPUNCT, "iswpunct", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWSPACE, "iswspace", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWUPPER, "iswupper", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_ISWXDIGIT, "iswxdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_TOWLOWER, "towlower", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LIST) +DEF_C94_BUILTIN (BUILT_IN_TOWUPPER, "towupper", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LIST) + /* Category: miscellaneous builtins. */ DEF_LIB_BUILTIN (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_ABS, "abs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) @@ -497,28 +596,59 @@ DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_N DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL) DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZIMAX, "clzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CONSTANT_P, "constant_p", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZIMAX, "ctzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_DCGETTEXT, "dcgettext", BT_FN_STRING_CONST_STRING_CONST_STRING_INT, ATTR_FORMAT_ARG_2) DEF_EXT_LIB_BUILTIN (BUILT_IN_DGETTEXT, "dgettext", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_FORMAT_ARG_2) DEF_GCC_BUILTIN (BUILT_IN_DWARF_CFA, "dwarf_cfa", BT_FN_PTR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UNSIGNED, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN, "eh_return", BT_FN_VOID_PTRMODE_PTR, ATTR_NORETURN_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN_DATA_REGNO, "eh_return_data_regno", BT_FN_INT_INT, ATTR_NULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECL, "execl", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_SENTINEL_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECLP, "execlp", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_SENTINEL_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECLE, "execle", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_NOTHROW_SENTINEL_1) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECV, "execv", BT_FN_INT_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECVP, "execvp", BT_FN_INT_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECVE, "execve", BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_EXIT, "exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_EXPECT, "expect", BT_FN_LONG_LONG_LONG, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_EXPECT, "expect", BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EXTEND_POINTER, "extend_pointer", BT_FN_WORD_PTR, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_EXTRACT_RETURN_ADDR, "extract_return_addr", BT_FN_PTR_PTR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UNSIGNED, ATTR_NULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSIMAX, "ffsimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FORK, "fork", BT_FN_PID, ATTR_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1) DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_INIT_DWARF_REG_SIZES, "init_dwarf_reg_size_table", BT_FN_VOID_PTR, ATTR_NULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITE, "finite", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEF, "finitef", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEL, "finitel", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED32, "finited32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED64, "finited64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED128, "finited128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST) +DEF_C99_C90RES_BUILTIN (BUILT_IN_ISINF, "isinf", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFF, "isinff", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFL, "isinfl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD32, "isinfd32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD64, "isinfd64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD128, "isinfd128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST) +DEF_C99_C90RES_BUILTIN (BUILT_IN_ISNAN, "isnan", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANF, "isnanf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANL, "isnanl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND32, "isnand32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND64, "isnand64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND128, "isnand128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_ISGREATER, "isgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_ISGREATEREQUAL, "isgreaterequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_ISLESS, "isless", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST) @@ -530,15 +660,17 @@ DEF_C99_BUILTIN (BUILT_IN_LLABS, "llabs", BT_FN_LONGLONG_LONGLONG, ATTR_C DEF_GCC_BUILTIN (BUILT_IN_LONGJMP, "longjmp", BT_FN_VOID_PTR_INT, ATTR_NORETURN_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_MALLOC, "malloc", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_NEXT_ARG, "next_arg", BT_FN_PTR_VAR, ATTR_NULL) -DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYIMAX, "parityimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTIMAX, "popcountimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NOVOPS_LIST) DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LIST) -DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UNSIGNED, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_STDARG_START, "stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL) @@ -546,8 +678,53 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CON DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_3_0) DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_UNWIND_INIT, "unwind_init", BT_FN_VOID, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_UPDATE_SETJMP_BUF, "update_setjmp_buf", BT_FN_VOID_PTR_INT, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_VA_COPY, "va_copy", BT_FN_VOID_VALIST_REF_VALIST_ARG, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_VA_END, "va_end", BT_FN_VOID_VALIST_REF, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_VA_START, "va_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL) DEF_EXT_LIB_BUILTIN (BUILT_IN__EXIT, "_exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST) DEF_C99_BUILTIN (BUILT_IN__EXIT2, "_Exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST) + +/* Implementing nested functions. */ +DEF_BUILTIN_STUB (BUILT_IN_INIT_TRAMPOLINE, "__builtin_init_trampoline") +DEF_BUILTIN_STUB (BUILT_IN_ADJUST_TRAMPOLINE, "__builtin_adjust_trampoline") +DEF_BUILTIN_STUB (BUILT_IN_NONLOCAL_GOTO, "__builtin_nonlocal_goto") + +/* Implementing __builtin_setjmp. */ +DEF_BUILTIN_STUB (BUILT_IN_SETJMP_SETUP, "__builtin_setjmp_setup") +DEF_BUILTIN_STUB (BUILT_IN_SETJMP_DISPATCHER, "__builtin_setjmp_dispatcher") +DEF_BUILTIN_STUB (BUILT_IN_SETJMP_RECEIVER, "__builtin_setjmp_receiver") + +/* Implementing variable sized local variables. */ +DEF_BUILTIN_STUB (BUILT_IN_STACK_SAVE, "__builtin_stack_save") +DEF_BUILTIN_STUB (BUILT_IN_STACK_RESTORE, "__builtin_stack_restore") + +/* Object size checking builtins. */ +DEF_GCC_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LIST) +DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_SNPRINTF_CHK, "__snprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_5_6) +DEF_EXT_LIB_BUILTIN (BUILT_IN_SPRINTF_CHK, "__sprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_4_5) +DEF_EXT_LIB_BUILTIN (BUILT_IN_VSNPRINTF_CHK, "__vsnprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_5_0) +DEF_EXT_LIB_BUILTIN (BUILT_IN_VSPRINTF_CHK, "__vsprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_4_0) +DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_CHK, "__fprintf_chk", BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_3_4) +DEF_EXT_LIB_BUILTIN (BUILT_IN_PRINTF_CHK, "__printf_chk", BT_FN_INT_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3) +DEF_EXT_LIB_BUILTIN (BUILT_IN_VFPRINTF_CHK, "__vfprintf_chk", BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_3_0) +DEF_EXT_LIB_BUILTIN (BUILT_IN_VPRINTF_CHK, "__vprintf_chk", BT_FN_INT_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0) + +/* Profiling hooks. */ +DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter") +DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit") + +/* Synchronization Primitives. */ +#include "sync-builtins.def" + +/* OpenMP builtins. */ +#include "omp-builtins.def" diff --git a/contrib/gcc/c-aux-info.c b/contrib/gcc/c-aux-info.c index e785ade2239..b7267b2a850 100644 --- a/contrib/gcc/c-aux-info.c +++ b/contrib/gcc/c-aux-info.c @@ -2,7 +2,7 @@ on information stored in GCC's tree structure. This code implements the -aux-info option. Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998, - 1999, 2000, 2003 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@segfault.us.com). This file is part of GCC. @@ -19,8 +19,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -75,15 +75,15 @@ affix_data_type (const char *param) for (;;) { if (!strncmp (p, "volatile ", 9)) - { - p += 9; - continue; - } + { + p += 9; + continue; + } if (!strncmp (p, "const ", 6)) - { - p += 6; - continue; - } + { + p += 6; + continue; + } break; } @@ -123,7 +123,7 @@ gen_formal_list_for_type (tree fntype, formals_style style) const char *this_type; if (*formal_list) - formal_list = concat (formal_list, ", ", NULL); + formal_list = concat (formal_list, ", ", NULL); this_type = gen_type ("", TREE_VALUE (formal_type), ansi); formal_list @@ -167,18 +167,18 @@ gen_formal_list_for_type (tree fntype, formals_style style) if (!*formal_list) { if (TYPE_ARG_TYPES (fntype)) - /* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */ - formal_list = "void"; + /* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */ + formal_list = "void"; else - formal_list = "/* ??? */"; + formal_list = "/* ??? */"; } else { /* If there were at least some parameters, and if the formals-types-list - petered out to a NULL (i.e. without being terminated by a - void_type_node) then we need to tack on an ellipsis. */ + petered out to a NULL (i.e. without being terminated by a + void_type_node) then we need to tack on an ellipsis. */ if (!formal_type) - formal_list = concat (formal_list, ", ...", NULL); + formal_list = concat (formal_list, ", ...", NULL); } return concat (" (", formal_list, ")", NULL); @@ -237,20 +237,20 @@ gen_formal_list_for_func_def (tree fndecl, formals_style style) const char *this_formal; if (*formal_list && ((style == ansi) || (style == k_and_r_names))) - formal_list = concat (formal_list, ", ", NULL); + formal_list = concat (formal_list, ", ", NULL); this_formal = gen_decl (formal_decl, 0, style); if (style == k_and_r_decls) - formal_list = concat (formal_list, this_formal, "; ", NULL); + formal_list = concat (formal_list, this_formal, "; ", NULL); else - formal_list = concat (formal_list, this_formal, NULL); + formal_list = concat (formal_list, this_formal, NULL); formal_decl = TREE_CHAIN (formal_decl); } if (style == ansi) { if (!DECL_ARGUMENTS (fndecl)) - formal_list = concat (formal_list, "void", NULL); + formal_list = concat (formal_list, "void", NULL); if (deserves_ellipsis (TREE_TYPE (fndecl))) - formal_list = concat (formal_list, ", ...", NULL); + formal_list = concat (formal_list, ", ...", NULL); } if ((style == ansi) || (style == k_and_r_names)) formal_list = concat (" (", formal_list, ")", NULL); @@ -309,23 +309,23 @@ gen_type (const char *ret_val, tree t, formals_style style) else { switch (TREE_CODE (t)) - { - case POINTER_TYPE: - if (TYPE_READONLY (t)) - ret_val = concat ("const ", ret_val, NULL); - if (TYPE_VOLATILE (t)) - ret_val = concat ("volatile ", ret_val, NULL); + { + case POINTER_TYPE: + if (TYPE_READONLY (t)) + ret_val = concat ("const ", ret_val, NULL); + if (TYPE_VOLATILE (t)) + ret_val = concat ("volatile ", ret_val, NULL); - ret_val = concat ("*", ret_val, NULL); + ret_val = concat ("*", ret_val, NULL); if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) ret_val = concat ("(", ret_val, ")", NULL); - ret_val = gen_type (ret_val, TREE_TYPE (t), style); + ret_val = gen_type (ret_val, TREE_TYPE (t), style); - return ret_val; + return ret_val; - case ARRAY_TYPE: + case ARRAY_TYPE: if (!COMPLETE_TYPE_P (t) || TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST) ret_val = gen_type (concat (ret_val, "[]", NULL), TREE_TYPE (t), style); @@ -340,23 +340,23 @@ gen_type (const char *ret_val, tree t, formals_style style) ret_val = gen_type (concat (ret_val, buff, NULL), TREE_TYPE (t), style); } - break; + break; - case FUNCTION_TYPE: - ret_val = gen_type (concat (ret_val, + case FUNCTION_TYPE: + ret_val = gen_type (concat (ret_val, gen_formal_list_for_type (t, style), NULL), TREE_TYPE (t), style); - break; + break; - case IDENTIFIER_NODE: - data_type = IDENTIFIER_POINTER (t); - break; + case IDENTIFIER_NODE: + data_type = IDENTIFIER_POINTER (t); + break; /* The following three cases are complicated by the fact that a - user may do something really stupid, like creating a brand new - "anonymous" type specification in a formal argument list (or as - part of a function return type specification). For example: + user may do something really stupid, like creating a brand new + "anonymous" type specification in a formal argument list (or as + part of a function return type specification). For example: int f (enum { red, green, blue } color); @@ -364,7 +364,7 @@ gen_type (const char *ret_val, tree t, formals_style style) to represent the (anonymous) type. Thus, we have to generate the whole darn type specification. Yuck! */ - case RECORD_TYPE: + case RECORD_TYPE: if (TYPE_NAME (t)) data_type = IDENTIFIER_POINTER (TYPE_NAME (t)); else @@ -383,7 +383,7 @@ gen_type (const char *ret_val, tree t, formals_style style) data_type = concat ("struct ", data_type, NULL); break; - case UNION_TYPE: + case UNION_TYPE: if (TYPE_NAME (t)) data_type = IDENTIFIER_POINTER (TYPE_NAME (t)); else @@ -402,7 +402,7 @@ gen_type (const char *ret_val, tree t, formals_style style) data_type = concat ("union ", data_type, NULL); break; - case ENUMERAL_TYPE: + case ENUMERAL_TYPE: if (TYPE_NAME (t)) data_type = IDENTIFIER_POINTER (TYPE_NAME (t)); else @@ -422,33 +422,33 @@ gen_type (const char *ret_val, tree t, formals_style style) data_type = concat ("enum ", data_type, NULL); break; - case TYPE_DECL: - data_type = IDENTIFIER_POINTER (DECL_NAME (t)); - break; + case TYPE_DECL: + data_type = IDENTIFIER_POINTER (DECL_NAME (t)); + break; - case INTEGER_TYPE: - data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t))); - /* Normally, `unsigned' is part of the deal. Not so if it comes + case INTEGER_TYPE: + data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t))); + /* Normally, `unsigned' is part of the deal. Not so if it comes with a type qualifier. */ - if (TREE_UNSIGNED (t) && TYPE_QUALS (t)) + if (TYPE_UNSIGNED (t) && TYPE_QUALS (t)) data_type = concat ("unsigned ", data_type, NULL); break; - case REAL_TYPE: - data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t))); - break; + case REAL_TYPE: + data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t))); + break; - case VOID_TYPE: - data_type = "void"; - break; + case VOID_TYPE: + data_type = "void"; + break; case ERROR_MARK: data_type = "[ERROR]"; break; - default: - abort (); - } + default: + gcc_unreachable (); + } } if (TYPE_READONLY (t)) ret_val = concat ("const ", ret_val, NULL); @@ -518,11 +518,11 @@ gen_decl (tree decl, int is_func_definition, formals_style style) NULL); /* Since we have already added in the formals list stuff, here we don't - add the whole "type" of the function we are considering (which - would include its parameter-list info), rather, we only add in - the "type" of the "type" of the function, which is really just - the return-type of the function (and does not include the parameter - list info). */ + add the whole "type" of the function we are considering (which + would include its parameter-list info), rather, we only add in + the "type" of the "type" of the function, which is really just + the return-type of the function (and does not include the parameter + list info). */ ret_val = gen_type (ret_val, TREE_TYPE (TREE_TYPE (decl)), style); } @@ -531,7 +531,7 @@ gen_decl (tree decl, int is_func_definition, formals_style style) ret_val = affix_data_type (ret_val); - if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl)) + if (TREE_CODE (decl) != FUNCTION_DECL && C_DECL_REGISTER (decl)) ret_val = concat ("register ", ret_val, NULL); if (TREE_PUBLIC (decl)) ret_val = concat ("extern ", ret_val, NULL); @@ -554,11 +554,12 @@ gen_aux_info_record (tree fndecl, int is_definition, int is_implicit, if (flag_gen_aux_info) { static int compiled_from_record = 0; + expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (fndecl)); /* Each output .X file must have a header line. Write one now if we have not yet done so. */ - if (! compiled_from_record++) + if (!compiled_from_record++) { /* The first line tells which directory file names are relative to. Currently, -aux-info works only for files in the working @@ -569,8 +570,7 @@ gen_aux_info_record (tree fndecl, int is_definition, int is_implicit, /* Write the actual line of auxiliary info. */ fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;", - DECL_SOURCE_FILE (fndecl), - DECL_SOURCE_LINE (fndecl), + xloc.file, xloc.line, (is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O', (is_definition) ? 'F' : 'C', gen_decl (fndecl, is_definition, ansi)); diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c index 30f869a9a0d..b5ea60818f2 100644 --- a/contrib/gcc/c-common.c +++ b/contrib/gcc/c-common.c @@ -1,6 +1,6 @@ /* Subroutines shared by all languages that are variants of C. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -42,6 +42,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree-inline.h" #include "c-tree.h" #include "toplev.h" +#include "tree-iterator.h" +#include "hashtab.h" +#include "tree-mudflap.h" +#include "opts.h" +#include "real.h" +#include "cgraph.h" cpp_reader *parse_in; /* Declared in c-pragma.h. */ @@ -55,6 +61,10 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */ #define SIZE_TYPE "long unsigned int" #endif +#ifndef PID_TYPE +#define PID_TYPE "int" +#endif + #ifndef WCHAR_TYPE #define WCHAR_TYPE "int" #endif @@ -121,6 +131,10 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */ tree complex_double_type_node; tree complex_long_double_type_node; + tree dfloat32_type_node; + tree dfloat64_type_node; + tree_dfloat128_type_node; + tree intQI_type_node; tree intHI_type_node; tree intSI_type_node; @@ -182,11 +196,6 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */ */ tree c_global_trees[CTI_MAX]; - -/* TRUE if a code represents a statement. The front end init - langhook should take care of initialization of this array. */ - -bool statement_code_p[MAX_TREE_CODES]; /* Switches common to the C front ends. */ @@ -211,6 +220,10 @@ char flag_dump_macros; char flag_dump_includes; +/* Nonzero means process PCH files while preprocessing. */ + +bool flag_pch_preprocess; + /* The file name to which we should write a precompiled header, or NULL if no header will be written in this compile. */ @@ -248,74 +261,9 @@ int flag_ms_extensions; int flag_no_asm; -/* Nonzero means give string constants the type `const char *', as mandated - by the standard. */ - -int flag_const_strings; - /* Nonzero means to treat bitfields as signed unless they say `unsigned'. */ int flag_signed_bitfields = 1; -int explicit_flag_signed_bitfields; - -/* Nonzero means warn about pointer casts that can drop a type qualifier - from the pointer target type. */ - -int warn_cast_qual; - -/* Warn about functions which might be candidates for format attributes. */ - -int warn_missing_format_attribute; - -/* Nonzero means warn about sizeof(function) or addition/subtraction - of function pointers. */ - -int warn_pointer_arith; - -/* Nonzero means warn for any global function def - without separate previous prototype decl. */ - -int warn_missing_prototypes; - -/* Warn if adding () is suggested. */ - -int warn_parentheses; - -/* Warn if initializer is not completely bracketed. */ - -int warn_missing_braces; - -/* Warn about comparison of signed and unsigned values. - If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified - (in which case -Wextra gets to decide). */ - -int warn_sign_compare = -1; - -/* Nonzero means warn about usage of long long when `-pedantic'. */ - -int warn_long_long = 1; - -/* Nonzero means warn about deprecated conversion from string constant to - `char *'. */ - -int warn_write_strings; - -/* Nonzero means warn about multiple (redundant) decls for the same single - variable or function. */ - -int warn_redundant_decls; - -/* Warn about testing equality of floating point numbers. */ - -int warn_float_equal; - -/* Warn about a subscript that has type char. */ - -int warn_char_subscripts; - -/* Warn if a type conversion is done that might have confusing results. */ - -int warn_conversion; /* Warn about #pragma directives that are not recognized. */ @@ -326,35 +274,17 @@ int warn_unknown_pragmas; /* Tri state variable. */ int warn_format; -/* Warn about Y2K problems with strftime formats. */ +/* Warn about using __null (as NULL in C++) as sentinel. For code compiled + with GCC this doesn't matter as __null is guaranteed to have the right + size. */ -int warn_format_y2k; - -/* Warn about excess arguments to formats. */ - -int warn_format_extra_args; - -/* Warn about zero-length formats. */ - -int warn_format_zero_length; - -/* Warn about non-literal format arguments. */ - -int warn_format_nonliteral; - -/* Warn about possible security problems with calls to format functions. */ - -int warn_format_security; +int warn_strict_null_sentinel; /* Zero means that faster, ...NonNil variants of objc_msgSend... calls will be used in ObjC; passing nil receivers to such calls will most likely result in crashes. */ int flag_nil_receivers = 1; -/* Nonzero means that we will allow new ObjC exception syntax (@throw, - @try, etc.) in source code. */ -int flag_objc_exceptions = 0; - /* Nonzero means that code generation will be altered to support "zero-link" execution. This currently affects ObjC only, but may affect other languages in the future. */ @@ -364,15 +294,10 @@ int flag_zero_link = 0; unit. It will inform the ObjC runtime that class definition(s) herein contained are to replace one(s) previously loaded. */ int flag_replace_objc_classes = 0; - + /* C/ObjC language option variables. */ -/* Nonzero means message about use of implicit function declarations; - 1 means warning; 2 means error. */ - -int mesg_implicit_function_declaration = -1; - /* Nonzero means allow type mismatches in conditional expressions; just make their values `void'. */ @@ -390,67 +315,10 @@ int flag_isoc99; int flag_hosted = 1; -/* Nonzero means warn when casting a function call to a type that does - not match the return type (e.g. (float)sqrt() or (anything*)malloc() - when there is no previous declaration of sqrt or malloc. */ - -int warn_bad_function_cast; - -/* Warn about traditional constructs whose meanings changed in ANSI C. */ - -int warn_traditional; - -/* Nonzero means warn for a declaration found after a statement. */ - -int warn_declaration_after_statement; - -/* Nonzero means warn for non-prototype function decls - or non-prototyped defs without previous prototype. */ - -int warn_strict_prototypes; - -/* Nonzero means warn for any global function def - without separate previous decl. */ - -int warn_missing_declarations; - -/* Nonzero means warn about declarations of objects not at - file-scope level and about *all* declarations of functions (whether - or static) not at file-scope level. Note that we exclude - implicit function declarations. To get warnings about those, use - -Wimplicit. */ - -int warn_nested_externs; - /* Warn if main is suspicious. */ int warn_main; -/* Nonzero means warn about possible violations of sequence point rules. */ - -int warn_sequence_point; - -/* Nonzero means warn about uninitialized variable when it is initialized with itself. - For example: int i = i;, GCC will not warn about this when warn_init_self is nonzero. */ - -int warn_init_self; - -/* Nonzero means to warn about compile-time division by zero. */ -int warn_div_by_zero = 1; - -/* Nonzero means warn about use of implicit int. */ - -int warn_implicit_int; - -/* Warn about NULL being passed to argument slots marked as requiring - non-NULL. */ - -int warn_nonnull; - -/* Warn about old-style parameter declaration. */ - -int warn_old_style_definition; - /* ObjC language option variables. */ @@ -460,43 +328,16 @@ int warn_old_style_definition; int flag_gen_declaration; -/* Generate code for GNU or NeXT runtime environment. */ - -#ifdef NEXT_OBJC_RUNTIME -int flag_next_runtime = 1; -#else -int flag_next_runtime = 0; -#endif - /* Tells the compiler that this is a special run. Do not perform any compiling, instead we are to test some platform dependent features and output a C header file with appropriate definitions. */ int print_struct_values; -/* ???. Undocumented. */ +/* Tells the compiler what is the constant string class for Objc. */ const char *constant_string_class_name; -/* Warn if multiple methods are seen for the same selector, but with - different argument types. Performs the check on the whole selector - table at the end of compilation. */ - -int warn_selector; - -/* Warn if a @selector() is found, and no method with that selector - has been previously declared. The check is done on each - @selector() as soon as it is found - so it warns about forward - declarations. */ - -int warn_undeclared_selector; - -/* Warn if methods required by a protocol are not implemented in the - class adopting it. When turned off, methods inherited to that - class are also considered implemented. */ - -int warn_protocol = 1; - /* C++ language option variables. */ @@ -583,10 +424,16 @@ int flag_weak = 1; int flag_working_directory = -1; /* Nonzero to use __cxa_atexit, rather than atexit, to register - destructors for local statics and global objects. */ + destructors for local statics and global objects. '2' means it has been + set nonzero as a default, not by a command-line flag. */ int flag_use_cxa_atexit = DEFAULT_USE_CXA_ATEXIT; +/* Nonzero to use __cxa_get_exception_ptr in C++ exception-handling + code. '2' means it has not been set explicitly on the command line. */ + +int flag_use_cxa_get_exception_ptr = 2; + /* Nonzero means make the default pedwarns warnings instead of errors. The value of this flag is ignored if -pedantic is specified. */ @@ -599,70 +446,15 @@ int flag_permissive; int flag_enforce_eh_specs = 1; -/* Nonzero means warn about things that will change when compiling - with an ABI-compliant compiler. */ +/* Nonzero means to generate thread-safe code for initializing local + statics. */ -int warn_abi = 0; - -/* Nonzero means warn about invalid uses of offsetof. */ - -int warn_invalid_offsetof = 1; +int flag_threadsafe_statics = 1; /* Nonzero means warn about implicit declarations. */ int warn_implicit = 1; -/* Nonzero means warn when all ctors or dtors are private, and the class - has no friends. */ - -int warn_ctor_dtor_privacy = 0; - -/* Nonzero means warn in function declared in derived class has the - same name as a virtual in the base class, but fails to match the - type signature of any virtual function in the base class. */ - -int warn_overloaded_virtual; - -/* Nonzero means warn when declaring a class that has a non virtual - destructor, when it really ought to have a virtual one. */ - -int warn_nonvdtor; - -/* Nonzero means warn when the compiler will reorder code. */ - -int warn_reorder; - -/* Nonzero means warn when synthesis behavior differs from Cfront's. */ - -int warn_synth; - -/* Nonzero means warn when we convert a pointer to member function - into a pointer to (void or function). */ - -int warn_pmf2ptr = 1; - -/* Nonzero means warn about violation of some Effective C++ style rules. */ - -int warn_ecpp; - -/* Nonzero means warn where overload resolution chooses a promotion from - unsigned to signed over a conversion to an unsigned of the same size. */ - -int warn_sign_promo; - -/* Nonzero means warn when an old-style cast is used. */ - -int warn_old_style_cast; - -/* Nonzero means warn when non-templatized friend functions are - declared within a template */ - -int warn_nontemplate_friend = 1; - -/* Nonzero means complain about deprecated features. */ - -int warn_deprecated = 1; - /* Maximum template instantiation depth. This limit is rather arbitrary, but it exists to limit the time it takes to notice infinite template instantiations. */ @@ -677,10 +469,6 @@ tree *ridpointers; tree (*make_fname_decl) (tree, int); -/* If non-NULL, the address of a language-specific function that takes - any action required right before expand_function_end is called. */ -void (*lang_expand_function_end) (void); - /* Nonzero means the expression being parsed will never be evaluated. This is a count, since unevaluated expressions can nest. */ int skip_evaluation; @@ -707,27 +495,8 @@ const struct fname_var_t fname_vars[] = }; static int constant_fits_type_p (tree, tree); - -/* Keep a stack of if statements. We record the number of compound - statements seen up to the if keyword, as well as the line number - and file of the if. If a potentially ambiguous else is seen, that - fact is recorded; the warning is issued when we can be sure that - the enclosing if statement does not have an else branch. */ -typedef struct -{ - int compstmt_count; - location_t locus; - int needs_warning; - tree if_stmt; -} if_elt; - -static if_elt *if_stack; - -/* Amount of space in the if statement stack. */ -static int if_stack_space = 0; - -/* Stack pointer. */ -static int if_stack_pointer = 0; +static tree check_case_value (tree); +static bool check_case_bounds (tree, tree, tree *, tree *); static tree handle_packed_attribute (tree *, tree, tree, int, bool *); static tree handle_nocommon_attribute (tree *, tree, tree, int, bool *); @@ -736,8 +505,13 @@ static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *); static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_always_inline_attribute (tree *, tree, tree, int, bool *); +static tree handle_gnu_inline_attribute (tree *, tree, tree, int, + bool *); +static tree handle_flatten_attribute (tree *, tree, tree, int, bool *); static tree handle_used_attribute (tree *, tree, tree, int, bool *); static tree handle_unused_attribute (tree *, tree, tree, int, bool *); +static tree handle_externally_visible_attribute (tree *, tree, tree, int, + bool *); static tree handle_const_attribute (tree *, tree, tree, int, bool *); static tree handle_transparent_union_attribute (tree *, tree, tree, int, bool *); @@ -748,6 +522,7 @@ static tree handle_section_attribute (tree *, tree, tree, int, bool *); static tree handle_aligned_attribute (tree *, tree, tree, int, bool *); static tree handle_weak_attribute (tree *, tree, tree, int, bool *) ; static tree handle_alias_attribute (tree *, tree, tree, int, bool *); +static tree handle_weakref_attribute (tree *, tree, tree, int, bool *) ; static tree handle_visibility_attribute (tree *, tree, tree, int, bool *); static tree handle_tls_model_attribute (tree *, tree, tree, int, @@ -755,9 +530,11 @@ static tree handle_tls_model_attribute (tree *, tree, tree, int, static tree handle_no_instrument_function_attribute (tree *, tree, tree, int, bool *); static tree handle_malloc_attribute (tree *, tree, tree, int, bool *); +static tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *); static tree handle_no_limit_stack_attribute (tree *, tree, tree, int, bool *); static tree handle_pure_attribute (tree *, tree, tree, int, bool *); +static tree handle_novops_attribute (tree *, tree, tree, int, bool *); static tree handle_deprecated_attribute (tree *, tree, tree, int, bool *); static tree handle_vector_size_attribute (tree *, tree, tree, int, @@ -767,6 +544,7 @@ static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *); static tree handle_cleanup_attribute (tree *, tree, tree, int, bool *); static tree handle_warn_unused_result_attribute (tree *, tree, tree, int, bool *); +static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); static void check_function_nonnull (tree, tree); static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT); @@ -797,10 +575,16 @@ const struct attribute_spec c_common_attribute_table[] = handle_noinline_attribute }, { "always_inline", 0, 0, true, false, false, handle_always_inline_attribute }, + { "gnu_inline", 0, 0, true, false, false, + handle_gnu_inline_attribute }, + { "flatten", 0, 0, true, false, false, + handle_flatten_attribute }, { "used", 0, 0, true, false, false, handle_used_attribute }, { "unused", 0, 0, false, false, false, handle_unused_attribute }, + { "externally_visible", 0, 0, true, false, false, + handle_externally_visible_attribute }, /* The same comments as for noreturn attributes apply to const ones. */ { "const", 0, 0, true, false, false, handle_const_attribute }, @@ -820,19 +604,27 @@ const struct attribute_spec c_common_attribute_table[] = handle_weak_attribute }, { "alias", 1, 1, true, false, false, handle_alias_attribute }, + { "weakref", 0, 1, true, false, false, + handle_weakref_attribute }, { "no_instrument_function", 0, 0, true, false, false, handle_no_instrument_function_attribute }, { "malloc", 0, 0, true, false, false, handle_malloc_attribute }, + { "returns_twice", 0, 0, true, false, false, + handle_returns_twice_attribute }, { "no_stack_limit", 0, 0, true, false, false, handle_no_limit_stack_attribute }, { "pure", 0, 0, true, false, false, handle_pure_attribute }, + /* For internal use (marking of builtins) only. The name contains space + to prevent its usage in source code. */ + { "no vops", 0, 0, true, false, false, + handle_novops_attribute }, { "deprecated", 0, 0, false, false, false, handle_deprecated_attribute }, { "vector_size", 1, 1, false, true, false, handle_vector_size_attribute }, - { "visibility", 1, 1, true, false, false, + { "visibility", 1, 1, false, false, false, handle_visibility_attribute }, { "tls_model", 1, 1, true, false, false, handle_tls_model_attribute }, @@ -845,6 +637,8 @@ const struct attribute_spec c_common_attribute_table[] = handle_cleanup_attribute }, { "warn_unused_result", 0, 0, false, true, true, handle_warn_unused_result_attribute }, + { "sentinel", 0, 1, false, true, true, + handle_sentinel_attribute }, { NULL, 0, 0, false, false, false, NULL } }; @@ -861,131 +655,6 @@ const struct attribute_spec c_common_format_attribute_table[] = { NULL, 0, 0, false, false, false, NULL } }; -/* Record the start of an if-then, and record the start of it - for ambiguous else detection. - - COND is the condition for the if-then statement. - - IF_STMT is the statement node that has already been created for - this if-then statement. It is created before parsing the - condition to keep line number information accurate. */ - -void -c_expand_start_cond (tree cond, int compstmt_count, tree if_stmt) -{ - /* Make sure there is enough space on the stack. */ - if (if_stack_space == 0) - { - if_stack_space = 10; - if_stack = xmalloc (10 * sizeof (if_elt)); - } - else if (if_stack_space == if_stack_pointer) - { - if_stack_space += 10; - if_stack = xrealloc (if_stack, if_stack_space * sizeof (if_elt)); - } - - IF_COND (if_stmt) = cond; - add_stmt (if_stmt); - - /* Record this if statement. */ - if_stack[if_stack_pointer].compstmt_count = compstmt_count; - if_stack[if_stack_pointer].locus = input_location; - if_stack[if_stack_pointer].needs_warning = 0; - if_stack[if_stack_pointer].if_stmt = if_stmt; - if_stack_pointer++; -} - -/* Called after the then-clause for an if-statement is processed. */ - -void -c_finish_then (void) -{ - tree if_stmt = if_stack[if_stack_pointer - 1].if_stmt; - RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt)); -} - -/* Record the end of an if-then. Optionally warn if a nested - if statement had an ambiguous else clause. */ - -void -c_expand_end_cond (void) -{ - if_stack_pointer--; - if (if_stack[if_stack_pointer].needs_warning) - warning ("%Hsuggest explicit braces to avoid ambiguous `else'", - &if_stack[if_stack_pointer].locus); - last_expr_type = NULL_TREE; -} - -/* Called between the then-clause and the else-clause - of an if-then-else. */ - -void -c_expand_start_else (void) -{ - /* An ambiguous else warning must be generated for the enclosing if - statement, unless we see an else branch for that one, too. */ - if (warn_parentheses - && if_stack_pointer > 1 - && (if_stack[if_stack_pointer - 1].compstmt_count - == if_stack[if_stack_pointer - 2].compstmt_count)) - if_stack[if_stack_pointer - 2].needs_warning = 1; - - /* Even if a nested if statement had an else branch, it can't be - ambiguous if this one also has an else. So don't warn in that - case. Also don't warn for any if statements nested in this else. */ - if_stack[if_stack_pointer - 1].needs_warning = 0; - if_stack[if_stack_pointer - 1].compstmt_count--; -} - -/* Called after the else-clause for an if-statement is processed. */ - -void -c_finish_else (void) -{ - tree if_stmt = if_stack[if_stack_pointer - 1].if_stmt; - RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt)); -} - -/* Begin an if-statement. Returns a newly created IF_STMT if - appropriate. - - Unlike the C++ front-end, we do not call add_stmt here; it is - probably safe to do so, but I am not very familiar with this - code so I am being extra careful not to change its behavior - beyond what is strictly necessary for correctness. */ - -tree -c_begin_if_stmt (void) -{ - tree r; - r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE); - return r; -} - -/* Begin a while statement. Returns a newly created WHILE_STMT if - appropriate. - - Unlike the C++ front-end, we do not call add_stmt here; it is - probably safe to do so, but I am not very familiar with this - code so I am being extra careful not to change its behavior - beyond what is strictly necessary for correctness. */ - -tree -c_begin_while_stmt (void) -{ - tree r; - r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE); - return r; -} - -void -c_finish_while_stmt_cond (tree cond, tree while_stmt) -{ - WHILE_COND (while_stmt) = cond; -} - /* Push current bindings for the function name VAR_DECLS. */ void @@ -1000,7 +669,7 @@ start_fname_decls (void) if (decl) { - saved = tree_cons (decl, build_int_2 (ix, 0), saved); + saved = tree_cons (decl, build_int_cst (NULL_TREE, ix), saved); *fname_vars[ix].decl = NULL_TREE; } } @@ -1011,43 +680,30 @@ start_fname_decls (void) saved_function_name_decls); } -/* Finish up the current bindings, adding them into the - current function's statement tree. This is done by wrapping the - function's body in a COMPOUND_STMT containing these decls too. This - must be done _before_ finish_stmt_tree is called. If there is no - current function, we must be at file scope and no statements are - involved. Pop the previous bindings. */ +/* Finish up the current bindings, adding them into the current function's + statement tree. This must be done _before_ finish_stmt_tree is called. + If there is no current function, we must be at file scope and no statements + are involved. Pop the previous bindings. */ void finish_fname_decls (void) { unsigned ix; - tree body = NULL_TREE; + tree stmts = NULL_TREE; tree stack = saved_function_name_decls; for (; stack && TREE_VALUE (stack); stack = TREE_CHAIN (stack)) - body = chainon (TREE_VALUE (stack), body); + append_to_statement_list (TREE_VALUE (stack), &stmts); - if (body) + if (stmts) { - /* They were called into existence, so add to statement tree. Add - the DECL_STMTs inside the outermost scope. */ - tree *p = &DECL_SAVED_TREE (current_function_decl); - /* Skip the dummy EXPR_STMT and any EH_SPEC_BLOCK. */ - while (TREE_CODE (*p) != COMPOUND_STMT) - { - if (TREE_CODE (*p) == EXPR_STMT) - p = &TREE_CHAIN (*p); - else - p = &TREE_OPERAND(*p, 0); - } + tree *bodyp = &DECL_SAVED_TREE (current_function_decl); - p = &COMPOUND_BODY (*p); - if (TREE_CODE (*p) == SCOPE_STMT) - p = &TREE_CHAIN (*p); + if (TREE_CODE (*bodyp) == BIND_EXPR) + bodyp = &BIND_EXPR_BODY (*bodyp); - body = chainon (body, *p); - *p = body; + append_to_statement_list_force (*bodyp, &stmts); + *bodyp = stmts; } for (ix = 0; fname_vars[ix].decl; ix++) @@ -1071,26 +727,68 @@ finish_fname_decls (void) } /* Return the text name of the current function, suitably prettified - by PRETTY_P. */ + by PRETTY_P. Return string must be freed by caller. */ const char * fname_as_string (int pretty_p) { const char *name = "top level"; + char *namep; int vrb = 2; - if (! pretty_p) + if (!pretty_p) { name = ""; vrb = 0; } if (current_function_decl) - name = (*lang_hooks.decl_printable_name) (current_function_decl, vrb); + name = lang_hooks.decl_printable_name (current_function_decl, vrb); - return name; + if (c_lex_string_translate) + { + int len = strlen (name) + 3; /* Two for '"'s. One for NULL. */ + cpp_string cstr = { 0, 0 }, strname; + + namep = XNEWVEC (char, len); + snprintf (namep, len, "\"%s\"", name); + strname.text = (unsigned char *) namep; + strname.len = len - 1; + + if (cpp_interpret_string (parse_in, &strname, 1, &cstr, false)) + { + XDELETEVEC (namep); + return (char *) cstr.text; + } + } + else + namep = xstrdup (name); + + return namep; } +/* Expand DECL if it declares an entity not handled by the + common code. */ + +int +c_expand_decl (tree decl) +{ + if (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl)) + { + /* Let the back-end know about this variable. */ + if (!anon_aggr_type_p (TREE_TYPE (decl))) + emit_local_var (decl); + else + expand_anon_union_decl (decl, NULL_TREE, + DECL_ANON_UNION_ELEMS (decl)); + } + else + return 0; + + return 1; +} + + /* Return the VAR_DECL for a const char array naming the current function. If the VAR_DECL has not yet been created, create it now. RID indicates how it should be formatted and IDENTIFIER_NODE @@ -1111,33 +809,30 @@ fname_decl (unsigned int rid, tree id) decl = *fname_vars[ix].decl; if (!decl) { - tree saved_last_tree = last_tree; /* If a tree is built here, it would normally have the lineno of the current statement. Later this tree will be moved to the beginning of the function and this line number will be wrong. To avoid this problem set the lineno to 0 here; that prevents it from appearing in the RTL. */ - int saved_lineno = input_line; + tree stmts; + location_t saved_location = input_location; +#ifdef USE_MAPPED_LOCATION + input_location = UNKNOWN_LOCATION; +#else input_line = 0; +#endif + stmts = push_stmt_list (); decl = (*make_fname_decl) (id, fname_vars[ix].pretty); - if (last_tree != saved_last_tree) - { - /* We created some statement tree for the decl. This belongs - at the start of the function, so remove it now and reinsert - it after the function is complete. */ - tree stmts = TREE_CHAIN (saved_last_tree); - - TREE_CHAIN (saved_last_tree) = NULL_TREE; - last_tree = saved_last_tree; - saved_function_name_decls = tree_cons (decl, stmts, - saved_function_name_decls); - } + stmts = pop_stmt_list (stmts); + if (!IS_EMPTY_STMT (stmts)) + saved_function_name_decls + = tree_cons (decl, stmts, saved_function_name_decls); *fname_vars[ix].decl = decl; - input_line = saved_lineno; + input_location = saved_location; } if (!ix && !current_function_decl) - pedwarn ("'%D' is not defined outside of function scope", decl); + pedwarn ("%qD is not defined outside of function scope", decl); return decl; } @@ -1149,37 +844,56 @@ fix_string_type (tree value) { const int wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT; const int wide_flag = TREE_TYPE (value) == wchar_array_type_node; - const int nchars_max = flag_isoc99 ? 4095 : 509; int length = TREE_STRING_LENGTH (value); int nchars; + tree e_type, i_type, a_type; /* Compute the number of elements, for the array type. */ nchars = wide_flag ? length / wchar_bytes : length; - if (pedantic && nchars - 1 > nchars_max && !c_dialect_cxx ()) - pedwarn ("string length `%d' is greater than the length `%d' ISO C%d compilers are required to support", - nchars - 1, nchars_max, flag_isoc99 ? 99 : 89); - - /* Create the array type for the string constant. - -Wwrite-strings says make the string constant an array of const char - so that copying it to a non-const pointer will get a warning. - For C++, this is the standard behavior. */ - if (flag_const_strings && ! flag_writable_strings) + /* C89 2.2.4.1, C99 5.2.4.1 (Translation limits). The analogous + limit in C++98 Annex B is very large (65536) and is not normative, + so we do not diagnose it (warn_overlength_strings is forced off + in c_common_post_options). */ + if (warn_overlength_strings) { - tree elements - = build_type_variant (wide_flag ? wchar_type_node : char_type_node, - 1, 0); - TREE_TYPE (value) - = build_array_type (elements, - build_index_type (build_int_2 (nchars - 1, 0))); + const int nchars_max = flag_isoc99 ? 4095 : 509; + const int relevant_std = flag_isoc99 ? 99 : 90; + if (nchars - 1 > nchars_max) + /* Translators: The %d after 'ISO C' will be 90 or 99. Do not + separate the %d from the 'C'. 'ISO' should not be + translated, but it may be moved after 'C%d' in languages + where modifiers follow nouns. */ + pedwarn ("string length %qd is greater than the length %qd " + "ISO C%d compilers are required to support", + nchars - 1, nchars_max, relevant_std); } - else - TREE_TYPE (value) - = build_array_type (wide_flag ? wchar_type_node : char_type_node, - build_index_type (build_int_2 (nchars - 1, 0))); + /* Create the array type for the string constant. The ISO C++ + standard says that a string literal has type `const char[N]' or + `const wchar_t[N]'. We use the same logic when invoked as a C + front-end with -Wwrite-strings. + ??? We should change the type of an expression depending on the + state of a warning flag. We should just be warning -- see how + this is handled in the C++ front-end for the deprecated implicit + conversion from string literals to `char*' or `wchar_t*'. + + The C++ front end relies on TYPE_MAIN_VARIANT of a cv-qualified + array type being the unqualified version of that type. + Therefore, if we are constructing an array of const char, we must + construct the matching unqualified array type first. The C front + end does not require this, but it does no harm, so we do it + unconditionally. */ + e_type = wide_flag ? wchar_type_node : char_type_node; + i_type = build_index_type (build_int_cst (NULL_TREE, nchars - 1)); + a_type = build_array_type (e_type, i_type); + if (c_dialect_cxx() || warn_write_strings) + a_type = c_build_qualified_type (a_type, TYPE_QUAL_CONST); + + TREE_TYPE (value) = a_type; TREE_CONSTANT (value) = 1; - TREE_READONLY (value) = ! flag_writable_strings; + TREE_INVARIANT (value) = 1; + TREE_READONLY (value) = 1; TREE_STATIC (value) = 1; return value; } @@ -1196,7 +910,9 @@ constant_expression_warning (tree value) if ((TREE_CODE (value) == INTEGER_CST || TREE_CODE (value) == REAL_CST || TREE_CODE (value) == VECTOR_CST || TREE_CODE (value) == COMPLEX_CST) - && TREE_CONSTANT_OVERFLOW (value) && pedantic) + && TREE_CONSTANT_OVERFLOW (value) + && warn_overflow + && pedantic) pedwarn ("overflow in constant expression"); } @@ -1217,7 +933,7 @@ overflow_warning (tree value) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("integer overflow in expression"); + warning (OPT_Woverflow, "integer overflow in expression"); } else if ((TREE_CODE (value) == REAL_CST || (TREE_CODE (value) == COMPLEX_CST @@ -1226,13 +942,13 @@ overflow_warning (tree value) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("floating point overflow in expression"); + warning (OPT_Woverflow, "floating point overflow in expression"); } else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value)) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("vector overflow in expression"); + warning (OPT_Woverflow, "vector overflow in expression"); } } @@ -1241,25 +957,93 @@ overflow_warning (tree value) Invoke this function on every expression that might be implicitly converted to an unsigned type. */ -void +static void unsigned_conversion_warning (tree result, tree operand) { tree type = TREE_TYPE (result); if (TREE_CODE (operand) == INTEGER_CST && TREE_CODE (type) == INTEGER_TYPE - && TREE_UNSIGNED (type) + && TYPE_UNSIGNED (type) && skip_evaluation == 0 && !int_fits_type_p (operand, type)) { if (!int_fits_type_p (operand, c_common_signed_type (type))) /* This detects cases like converting -129 or 256 to unsigned char. */ - warning ("large integer implicitly truncated to unsigned type"); - else if (warn_conversion) - warning ("negative integer implicitly converted to unsigned type"); + warning (OPT_Woverflow, + "large integer implicitly truncated to unsigned type"); + else + warning (OPT_Wconversion, + "negative integer implicitly converted to unsigned type"); } } +/* Print a warning about casts that might indicate violation + of strict aliasing rules if -Wstrict-aliasing is used and + strict aliasing mode is in effect. OTYPE is the original + TREE_TYPE of EXPR, and TYPE the type we're casting to. */ + +void +strict_aliasing_warning (tree otype, tree type, tree expr) +{ + if (flag_strict_aliasing && warn_strict_aliasing + && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype) + && TREE_CODE (expr) == ADDR_EXPR + && (DECL_P (TREE_OPERAND (expr, 0)) + || handled_component_p (TREE_OPERAND (expr, 0))) + && !VOID_TYPE_P (TREE_TYPE (type))) + { + /* Casting the address of an object to non void pointer. Warn + if the cast breaks type based aliasing. */ + if (!COMPLETE_TYPE_P (TREE_TYPE (type))) + warning (OPT_Wstrict_aliasing, "type-punning to incomplete type " + "might break strict-aliasing rules"); + else + { + HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); + HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); + + if (!alias_sets_conflict_p (set1, set2)) + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer will break strict-aliasing rules"); + else if (warn_strict_aliasing > 1 + && !alias_sets_might_conflict_p (set1, set2)) + warning (OPT_Wstrict_aliasing, "dereferencing type-punned " + "pointer might break strict-aliasing rules"); + } + } +} + + +/* Print a warning about if (); or if () .. else; constructs + via the special empty statement node that we create. INNER_THEN + and INNER_ELSE are the statement lists of the if and the else + block. */ + +void +empty_body_warning (tree inner_then, tree inner_else) +{ + if (extra_warnings) + { + if (TREE_CODE (inner_then) == STATEMENT_LIST + && STATEMENT_LIST_TAIL (inner_then)) + inner_then = STATEMENT_LIST_TAIL (inner_then)->stmt; + + if (inner_else && TREE_CODE (inner_else) == STATEMENT_LIST + && STATEMENT_LIST_TAIL (inner_else)) + inner_else = STATEMENT_LIST_TAIL (inner_else)->stmt; + + if (IS_EMPTY_STMT (inner_then) && !inner_else) + warning (OPT_Wextra, "%Hempty body in an if-statement", + EXPR_LOCUS (inner_then)); + + if (inner_else && IS_EMPTY_STMT (inner_else)) + warning (OPT_Wextra, "%Hempty body in an else-statement", + EXPR_LOCUS (inner_else)); + } +} + + /* Nonzero if constant C has a value that is permissible for type TYPE (an INTEGER_TYPE). */ @@ -1280,7 +1064,9 @@ vector_types_convertible_p (tree t1, tree t2) { return targetm.vector_opaque_p (t1) || targetm.vector_opaque_p (t2) - || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)) + || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)) + && (TREE_CODE (TREE_TYPE (t1)) != REAL_TYPE || + TYPE_PRECISION (t1) == TYPE_PRECISION (t2)) && INTEGRAL_TYPE_P (TREE_TYPE (t1)) == INTEGRAL_TYPE_P (TREE_TYPE (t2))); } @@ -1301,20 +1087,22 @@ convert_and_check (tree type, tree expr) /* Do not diagnose overflow in a constant expression merely because a conversion overflowed. */ - TREE_CONSTANT_OVERFLOW (t) = TREE_CONSTANT_OVERFLOW (expr); + TREE_CONSTANT_OVERFLOW (t) = CONSTANT_CLASS_P (expr) + && TREE_CONSTANT_OVERFLOW (expr); /* No warning for converting 0x80000000 to int. */ - if (!(TREE_UNSIGNED (type) < TREE_UNSIGNED (TREE_TYPE (expr)) + if (!(TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (expr)) && TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr)))) /* If EXPR fits in the unsigned version of TYPE, don't warn unless pedantic. */ if ((pedantic - || TREE_UNSIGNED (type) - || ! constant_fits_type_p (expr, - c_common_unsigned_type (type))) - && skip_evaluation == 0) - warning ("overflow in implicit constant conversion"); + || TYPE_UNSIGNED (type) + || !constant_fits_type_p (expr, + c_common_unsigned_type (type))) + && skip_evaluation == 0) + warning (OPT_Woverflow, + "overflow in implicit constant conversion"); } else unsigned_conversion_warning (t, expr); @@ -1360,14 +1148,13 @@ static int warning_candidate_p (tree); static void warn_for_collisions (struct tlist *); static void warn_for_collisions_1 (tree, tree, struct tlist *, int); static struct tlist *new_tlist (struct tlist *, tree, tree); -static void verify_sequence_points (tree); /* Create a new struct tlist and fill in its fields. */ static struct tlist * new_tlist (struct tlist *next, tree t, tree writer) { struct tlist *l; - l = obstack_alloc (&tlist_obstack, sizeof *l); + l = XOBNEW (&tlist_obstack, struct tlist); l->next = next; l->expr = t; l->writer = writer; @@ -1383,9 +1170,9 @@ add_tlist (struct tlist **to, struct tlist *add, tree exclude_writer, int copy) while (add) { struct tlist *next = add->next; - if (! copy) + if (!copy) add->next = *to; - if (! exclude_writer || add->writer != exclude_writer) + if (!exclude_writer || add->writer != exclude_writer) *to = copy ? new_tlist (*to, add->expr, add->writer) : add; add = next; } @@ -1415,10 +1202,10 @@ merge_tlist (struct tlist **to, struct tlist *add, int copy) if (tmp2->expr == add->expr) { found = 1; - if (! tmp2->writer) + if (!tmp2->writer) tmp2->writer = add->writer; } - if (! found) + if (!found) { *end = copy ? add : new_tlist (NULL, add->expr, add->writer); end = &(*end)->next; @@ -1447,11 +1234,11 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list, { if (list->expr == written && list->writer != writer - && (! only_writes || list->writer)) + && (!only_writes || list->writer) + && DECL_NAME (list->expr)) { warned_ids = new_tlist (warned_ids, written, NULL_TREE); - warning ("operation on `%s' may be undefined", - IDENTIFIER_POINTER (DECL_NAME (list->expr))); + warning (0, "operation on %qE may be undefined", list->expr); } list = list->next; } @@ -1511,7 +1298,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, { struct tlist *tmp_before, *tmp_nosp, *tmp_list2, *tmp_list3; enum tree_code code; - char class; + enum tree_code_class cl; /* X may be NULL if it is the operand of an empty statement expression ({ }). */ @@ -1520,7 +1307,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, restart: code = TREE_CODE (x); - class = TREE_CODE_CLASS (code); + cl = TREE_CODE_CLASS (code); if (warning_candidate_p (x)) { @@ -1635,9 +1422,9 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, if (t->expr == x) break; - if (! t) + if (!t) { - t = obstack_alloc (&tlist_obstack, sizeof *t); + t = XOBNEW (&tlist_obstack, struct tlist_cache); t->next = save_expr_cache; t->expr = x; save_expr_cache = t; @@ -1660,47 +1447,37 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp, add_tlist (pno_sp, t->cache_after_sp, NULL_TREE, 1); return; } + default: - break; - } - - if (class == '1') - { - if (first_rtl_op (code) == 0) - return; - x = TREE_OPERAND (x, 0); - writer = 0; - goto restart; - } - - switch (class) - { - case 'r': - case '<': - case '2': - case 'b': - case 'e': - case 's': - case 'x': - { - int lp; - int max = first_rtl_op (TREE_CODE (x)); - for (lp = 0; lp < max; lp++) - { - tmp_before = tmp_nosp = 0; - verify_tree (TREE_OPERAND (x, lp), &tmp_before, &tmp_nosp, NULL_TREE); - merge_tlist (&tmp_nosp, tmp_before, 0); - add_tlist (pno_sp, tmp_nosp, NULL_TREE, 0); - } - break; - } + /* For other expressions, simply recurse on their operands. + Manual tail recursion for unary expressions. + Other non-expressions need not be processed. */ + if (cl == tcc_unary) + { + x = TREE_OPERAND (x, 0); + writer = 0; + goto restart; + } + else if (IS_EXPR_CODE_CLASS (cl)) + { + int lp; + int max = TREE_CODE_LENGTH (TREE_CODE (x)); + for (lp = 0; lp < max; lp++) + { + tmp_before = tmp_nosp = 0; + verify_tree (TREE_OPERAND (x, lp), &tmp_before, &tmp_nosp, 0); + merge_tlist (&tmp_nosp, tmp_before, 0); + add_tlist (pno_sp, tmp_nosp, NULL_TREE, 0); + } + } + return; } } /* Try to warn for undefined behavior in EXPR due to missing sequence points. */ -static void +void verify_sequence_points (tree expr) { struct tlist *before_sp = 0, *after_sp = 0; @@ -1710,45 +1487,24 @@ verify_sequence_points (tree expr) if (tlist_firstobj == 0) { gcc_obstack_init (&tlist_obstack); - tlist_firstobj = obstack_alloc (&tlist_obstack, 0); + tlist_firstobj = (char *) obstack_alloc (&tlist_obstack, 0); } verify_tree (expr, &before_sp, &after_sp, 0); warn_for_collisions (after_sp); obstack_free (&tlist_obstack, tlist_firstobj); } - -tree -c_expand_expr_stmt (tree expr) -{ - /* Do default conversion if safe and possibly important, - in case within ({...}). */ - if ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE - && (flag_isoc99 || lvalue_p (expr))) - || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE) - expr = default_conversion (expr); - - if (warn_sequence_point) - verify_sequence_points (expr); - - if (TREE_TYPE (expr) != error_mark_node - && !COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (expr)) - && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) - error ("expression statement has incomplete type"); - - last_expr_type = TREE_TYPE (expr); - return add_stmt (build_stmt (EXPR_STMT, expr)); -} /* Validate the expression after `case' and apply default promotions. */ -tree +static tree check_case_value (tree value) { if (value == NULL_TREE) return value; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ + /* ??? Can we ever get nops here for a valid case value? We + shouldn't for C. */ STRIP_TYPE_NOPS (value); /* In C++, the following is allowed: @@ -1763,21 +1519,89 @@ check_case_value (tree value) value = fold (value); } - if (TREE_CODE (value) != INTEGER_CST - && value != error_mark_node) + if (TREE_CODE (value) == INTEGER_CST) + /* Promote char or short to int. */ + value = perform_integral_promotions (value); + else if (value != error_mark_node) { error ("case label does not reduce to an integer constant"); value = error_mark_node; } - else - /* Promote char or short to int. */ - value = default_conversion (value); constant_expression_warning (value); return value; } +/* See if the case values LOW and HIGH are in the range of the original + type (i.e. before the default conversion to int) of the switch testing + expression. + TYPE is the promoted type of the testing expression, and ORIG_TYPE is + the type before promoting it. CASE_LOW_P is a pointer to the lower + bound of the case label, and CASE_HIGH_P is the upper bound or NULL + if the case is not a case range. + The caller has to make sure that we are not called with NULL for + CASE_LOW_P (i.e. the default case). + Returns true if the case label is in range of ORIG_TYPE (saturated or + untouched) or false if the label is out of range. */ + +static bool +check_case_bounds (tree type, tree orig_type, + tree *case_low_p, tree *case_high_p) +{ + tree min_value, max_value; + tree case_low = *case_low_p; + tree case_high = case_high_p ? *case_high_p : case_low; + + /* If there was a problem with the original type, do nothing. */ + if (orig_type == error_mark_node) + return true; + + min_value = TYPE_MIN_VALUE (orig_type); + max_value = TYPE_MAX_VALUE (orig_type); + + /* Case label is less than minimum for type. */ + if (tree_int_cst_compare (case_low, min_value) < 0 + && tree_int_cst_compare (case_high, min_value) < 0) + { + warning (0, "case label value is less than minimum value for type"); + return false; + } + + /* Case value is greater than maximum for type. */ + if (tree_int_cst_compare (case_low, max_value) > 0 + && tree_int_cst_compare (case_high, max_value) > 0) + { + warning (0, "case label value exceeds maximum value for type"); + return false; + } + + /* Saturate lower case label value to minimum. */ + if (tree_int_cst_compare (case_high, min_value) >= 0 + && tree_int_cst_compare (case_low, min_value) < 0) + { + warning (0, "lower value in case label range" + " less than minimum value for type"); + case_low = min_value; + } + + /* Saturate upper case label value to maximum. */ + if (tree_int_cst_compare (case_low, max_value) <= 0 + && tree_int_cst_compare (case_high, max_value) > 0) + { + warning (0, "upper value in case label range" + " exceeds maximum value for type"); + case_high = max_value; + } + + if (*case_low_p != case_low) + *case_low_p = convert (type, case_low); + if (case_high_p && *case_high_p != case_high) + *case_high_p = convert (type, case_high); + + return true; +} + /* Return an integer type with BITS bits of precision, that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */ @@ -1849,7 +1673,7 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp) if (mode == TYPE_MODE (widest_integer_literal_type_node)) return unsignedp ? widest_unsigned_literal_type_node - : widest_integer_literal_type_node; + : widest_integer_literal_type_node; if (mode == QImode) return unsignedp ? unsigned_intQI_type_node : intQI_type_node; @@ -1879,46 +1703,51 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp) if (mode == TYPE_MODE (void_type_node)) return void_type_node; - + if (mode == TYPE_MODE (build_pointer_type (char_type_node))) - return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode); + return (unsignedp + ? make_unsigned_type (GET_MODE_PRECISION (mode)) + : make_signed_type (GET_MODE_PRECISION (mode))); if (mode == TYPE_MODE (build_pointer_type (integer_type_node))) - return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode); + return (unsignedp + ? make_unsigned_type (GET_MODE_PRECISION (mode)) + : make_signed_type (GET_MODE_PRECISION (mode))); - switch (mode) + if (COMPLEX_MODE_P (mode)) { - case V16QImode: - return unsignedp ? unsigned_V16QI_type_node : V16QI_type_node; - case V8HImode: - return unsignedp ? unsigned_V8HI_type_node : V8HI_type_node; - case V4SImode: - return unsignedp ? unsigned_V4SI_type_node : V4SI_type_node; - case V2DImode: - return unsignedp ? unsigned_V2DI_type_node : V2DI_type_node; - case V2SImode: - return unsignedp ? unsigned_V2SI_type_node : V2SI_type_node; - case V2HImode: - return unsignedp ? unsigned_V2HI_type_node : V2HI_type_node; - case V4HImode: - return unsignedp ? unsigned_V4HI_type_node : V4HI_type_node; - case V8QImode: - return unsignedp ? unsigned_V8QI_type_node : V8QI_type_node; - case V1DImode: - return unsignedp ? unsigned_V1DI_type_node : V1DI_type_node; - case V16SFmode: - return V16SF_type_node; - case V4SFmode: - return V4SF_type_node; - case V2SFmode: - return V2SF_type_node; - case V2DFmode: - return V2DF_type_node; - case V4DFmode: - return V4DF_type_node; - default: - break; + enum machine_mode inner_mode; + tree inner_type; + + if (mode == TYPE_MODE (complex_float_type_node)) + return complex_float_type_node; + if (mode == TYPE_MODE (complex_double_type_node)) + return complex_double_type_node; + if (mode == TYPE_MODE (complex_long_double_type_node)) + return complex_long_double_type_node; + + if (mode == TYPE_MODE (complex_integer_type_node) && !unsignedp) + return complex_integer_type_node; + + inner_mode = GET_MODE_INNER (mode); + inner_type = c_common_type_for_mode (inner_mode, unsignedp); + if (inner_type != NULL_TREE) + return build_complex_type (inner_type); } + else if (VECTOR_MODE_P (mode)) + { + enum machine_mode inner_mode = GET_MODE_INNER (mode); + tree inner_type = c_common_type_for_mode (inner_mode, unsignedp); + if (inner_type != NULL_TREE) + return build_vector_type_for_mode (inner_type, mode); + } + + if (mode == TYPE_MODE (dfloat32_type_node)) + return dfloat32_type_node; + if (mode == TYPE_MODE (dfloat64_type_node)) + return dfloat64_type_node; + if (mode == TYPE_MODE (dfloat128_type_node)) + return dfloat128_type_node; for (t = registered_builtin_types; t; t = TREE_CHAIN (t)) if (TYPE_MODE (TREE_VALUE (t)) == mode) @@ -2000,44 +1829,80 @@ c_common_signed_type (tree type) tree c_common_signed_or_unsigned_type (int unsignedp, tree type) { - if (! INTEGRAL_TYPE_P (type) - || TREE_UNSIGNED (type) == unsignedp) + if (!INTEGRAL_TYPE_P (type) + || TYPE_UNSIGNED (type) == unsignedp) return type; - /* Must check the mode of the types, not the precision. Enumeral types - in C++ have precision set to match their range, but may use a wider - mode to match an ABI. If we change modes, we may wind up with bad - conversions. */ + /* For ENUMERAL_TYPEs in C++, must check the mode of the types, not + the precision; they have precision set to match their range, but + may use a wider mode to match an ABI. If we change modes, we may + wind up with bad conversions. For INTEGER_TYPEs in C, must check + the precision as well, so as to yield correct results for + bit-field types. C++ does not have these separate bit-field + types, and producing a signed or unsigned variant of an + ENUMERAL_TYPE may cause other problems as well. */ - if (TYPE_MODE (type) == TYPE_MODE (signed_char_type_node)) +#define TYPE_OK(node) \ + (TYPE_MODE (type) == TYPE_MODE (node) \ + && (c_dialect_cxx () || TYPE_PRECISION (type) == TYPE_PRECISION (node))) + if (TYPE_OK (signed_char_type_node)) return unsignedp ? unsigned_char_type_node : signed_char_type_node; - if (TYPE_MODE (type) == TYPE_MODE (integer_type_node)) + if (TYPE_OK (integer_type_node)) return unsignedp ? unsigned_type_node : integer_type_node; - if (TYPE_MODE (type) == TYPE_MODE (short_integer_type_node)) + if (TYPE_OK (short_integer_type_node)) return unsignedp ? short_unsigned_type_node : short_integer_type_node; - if (TYPE_MODE (type) == TYPE_MODE (long_integer_type_node)) + if (TYPE_OK (long_integer_type_node)) return unsignedp ? long_unsigned_type_node : long_integer_type_node; - if (TYPE_MODE (type) == TYPE_MODE (long_long_integer_type_node)) + if (TYPE_OK (long_long_integer_type_node)) return (unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node); - if (TYPE_MODE (type) == TYPE_MODE (widest_integer_literal_type_node)) + if (TYPE_OK (widest_integer_literal_type_node)) return (unsignedp ? widest_unsigned_literal_type_node : widest_integer_literal_type_node); #if HOST_BITS_PER_WIDE_INT >= 64 - if (TYPE_MODE (type) == TYPE_MODE (intTI_type_node)) + if (TYPE_OK (intTI_type_node)) return unsignedp ? unsigned_intTI_type_node : intTI_type_node; #endif - if (TYPE_MODE (type) == TYPE_MODE (intDI_type_node)) + if (TYPE_OK (intDI_type_node)) return unsignedp ? unsigned_intDI_type_node : intDI_type_node; - if (TYPE_MODE (type) == TYPE_MODE (intSI_type_node)) + if (TYPE_OK (intSI_type_node)) return unsignedp ? unsigned_intSI_type_node : intSI_type_node; - if (TYPE_MODE (type) == TYPE_MODE (intHI_type_node)) + if (TYPE_OK (intHI_type_node)) return unsignedp ? unsigned_intHI_type_node : intHI_type_node; - if (TYPE_MODE (type) == TYPE_MODE (intQI_type_node)) + if (TYPE_OK (intQI_type_node)) return unsignedp ? unsigned_intQI_type_node : intQI_type_node; +#undef TYPE_OK - return type; + if (c_dialect_cxx ()) + return type; + else + return build_nonstandard_integer_type (TYPE_PRECISION (type), unsignedp); +} + +/* Build a bit-field integer type for the given WIDTH and UNSIGNEDP. */ + +tree +c_build_bitfield_integer_type (unsigned HOST_WIDE_INT width, int unsignedp) +{ + /* Extended integer types of the same width as a standard type have + lesser rank, so those of the same width as int promote to int or + unsigned int and are valid for printf formats expecting int or + unsigned int. To avoid such special cases, avoid creating + extended integer types for bit-fields if a standard integer type + is available. */ + if (width == TYPE_PRECISION (integer_type_node)) + return unsignedp ? unsigned_type_node : integer_type_node; + if (width == TYPE_PRECISION (signed_char_type_node)) + return unsignedp ? unsigned_char_type_node : signed_char_type_node; + if (width == TYPE_PRECISION (short_integer_type_node)) + return unsignedp ? short_unsigned_type_node : short_integer_type_node; + if (width == TYPE_PRECISION (long_integer_type_node)) + return unsignedp ? long_unsigned_type_node : long_integer_type_node; + if (width == TYPE_PRECISION (long_long_integer_type_node)) + return (unsignedp ? long_long_unsigned_type_node + : long_long_integer_type_node); + return build_nonstandard_integer_type (width, unsignedp); } /* The C version of the register_builtin_type langhook. */ @@ -2071,7 +1936,7 @@ min_precision (tree value, int unsignedp) a bit-wise negation, so use that operation instead. */ if (tree_int_cst_sgn (value) < 0) - value = fold (build1 (BIT_NOT_EXPR, TREE_TYPE (value), value)); + value = fold_build1 (BIT_NOT_EXPR, TREE_TYPE (value), value); /* Return the number of bits needed, taking into account the fact that we need one more bit for a signed than unsigned type. */ @@ -2081,12 +1946,11 @@ min_precision (tree value, int unsignedp) else log = tree_floor_log2 (value); - return log + 1 + ! unsignedp; + return log + 1 + !unsignedp; } /* Print an error message for invalid operands to arith operation - CODE. NOP_EXPR is used as a special case (see - c_common_truthvalue_conversion). */ + CODE. */ void binary_op_error (enum tree_code code) @@ -2095,10 +1959,6 @@ binary_op_error (enum tree_code code) switch (code) { - case NOP_EXPR: - error ("invalid truth-value expression"); - return; - case PLUS_EXPR: opname = "+"; break; case MINUS_EXPR: @@ -2141,11 +2001,8 @@ binary_op_error (enum tree_code code) opname = "||"; break; case BIT_XOR_EXPR: opname = "^"; break; - case LROTATE_EXPR: - case RROTATE_EXPR: - opname = "rotate"; break; default: - opname = "unknown"; break; + gcc_unreachable (); } error ("invalid operands to binary %s", opname); } @@ -2186,9 +2043,9 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, but it *requires* conversion to FINAL_TYPE. */ if (op0 == primop0 && TREE_TYPE (op0) != *restype_ptr) - unsignedp0 = TREE_UNSIGNED (TREE_TYPE (op0)); + unsignedp0 = TYPE_UNSIGNED (TREE_TYPE (op0)); if (op1 == primop1 && TREE_TYPE (op1) != *restype_ptr) - unsignedp1 = TREE_UNSIGNED (TREE_TYPE (op1)); + unsignedp1 = TYPE_UNSIGNED (TREE_TYPE (op1)); /* If one of the operands must be floated, we cannot optimize. */ real1 = TREE_CODE (TREE_TYPE (primop0)) == REAL_TYPE; @@ -2199,7 +2056,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, the second arg is 0. */ if (TREE_CONSTANT (primop0) - && ! integer_zerop (primop1) && ! real_zerop (primop1)) + && !integer_zerop (primop1) && !real_zerop (primop1)) { tree tem = primop0; int temi = unsignedp0; @@ -2260,20 +2117,12 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, int min_gt, max_gt, min_lt, max_lt; tree maxval, minval; /* 1 if comparison is nominally unsigned. */ - int unsignedp = TREE_UNSIGNED (*restype_ptr); + int unsignedp = TYPE_UNSIGNED (*restype_ptr); tree val; type = c_common_signed_or_unsigned_type (unsignedp0, TREE_TYPE (primop0)); - /* In C, if TYPE is an enumeration, then we need to get its - min/max values from it's underlying integral type, not the - enumerated type itself. In C++, TYPE_MAX_VALUE and - TYPE_MIN_VALUE have already been set correctly on the - enumeration type. */ - if (!c_dialect_cxx() && TREE_CODE (type) == ENUMERAL_TYPE) - type = c_common_type_for_size (TYPE_PRECISION (type), unsignedp0); - maxval = TYPE_MAX_VALUE (type); minval = TYPE_MIN_VALUE (type); @@ -2281,7 +2130,16 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, *restype_ptr = c_common_signed_type (*restype_ptr); if (TREE_TYPE (primop1) != *restype_ptr) - primop1 = convert (*restype_ptr, primop1); + { + /* Convert primop1 to target type, but do not introduce + additional overflow. We know primop1 is an int_cst. */ + tree tmp = build_int_cst_wide (*restype_ptr, + TREE_INT_CST_LOW (primop1), + TREE_INT_CST_HIGH (primop1)); + + primop1 = force_fit_type (tmp, 0, TREE_OVERFLOW (primop1), + TREE_CONSTANT_OVERFLOW (primop1)); + } if (type != *restype_ptr) { minval = convert (*restype_ptr, minval); @@ -2381,16 +2239,16 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, if (TREE_CODE (primop0) != INTEGER_CST) { if (val == truthvalue_false_node) - warning ("comparison is always false due to limited range of data type"); + warning (0, "comparison is always false due to limited range of data type"); if (val == truthvalue_true_node) - warning ("comparison is always true due to limited range of data type"); + warning (0, "comparison is always true due to limited range of data type"); } if (val != 0) { /* Don't forget to evaluate PRIMOP0 if it has side effects. */ if (TREE_SIDE_EFFECTS (primop0)) - return build (COMPOUND_EXPR, TREE_TYPE (val), primop0, val); + return build2 (COMPOUND_EXPR, TREE_TYPE (val), primop0, val); return val; } @@ -2398,6 +2256,14 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, in the type of the operand that is not constant. TYPE is already properly set. */ } + + /* If either arg is decimal float and the other is float, find the + proper common type to use for comparison. */ + else if (real1 && real2 + && (DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0))) + || DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1))))) + type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1)); + else if (real1 && real2 && (TYPE_PRECISION (TREE_TYPE (primop0)) == TYPE_PRECISION (TREE_TYPE (primop1)))) @@ -2417,7 +2283,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, { type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1)); type = c_common_signed_or_unsigned_type (unsignedp0 - || TREE_UNSIGNED (*restype_ptr), + || TYPE_UNSIGNED (*restype_ptr), type); /* Make sure shorter operand is extended the right way to match the longer operand. */ @@ -2439,7 +2305,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, primop1 = op1; if (!real1 && !real2 && integer_zerop (primop1) - && TREE_UNSIGNED (*restype_ptr)) + && TYPE_UNSIGNED (*restype_ptr)) { tree value = 0; switch (code) @@ -2450,19 +2316,19 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, >= 0, the signedness of the comparison isn't an issue, so suppress the warning. */ if (extra_warnings && !in_system_header - && ! (TREE_CODE (primop0) == INTEGER_CST - && ! TREE_OVERFLOW (convert (c_common_signed_type (type), - primop0)))) - warning ("comparison of unsigned expression >= 0 is always true"); + && !(TREE_CODE (primop0) == INTEGER_CST + && !TREE_OVERFLOW (convert (c_common_signed_type (type), + primop0)))) + warning (0, "comparison of unsigned expression >= 0 is always true"); value = truthvalue_true_node; break; case LT_EXPR: if (extra_warnings && !in_system_header - && ! (TREE_CODE (primop0) == INTEGER_CST - && ! TREE_OVERFLOW (convert (c_common_signed_type (type), - primop0)))) - warning ("comparison of unsigned expression < 0 is always false"); + && !(TREE_CODE (primop0) == INTEGER_CST + && !TREE_OVERFLOW (convert (c_common_signed_type (type), + primop0)))) + warning (0, "comparison of unsigned expression < 0 is always false"); value = truthvalue_false_node; break; @@ -2474,8 +2340,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, { /* Don't forget to evaluate PRIMOP0 if it has side effects. */ if (TREE_SIDE_EFFECTS (primop0)) - return build (COMPOUND_EXPR, TREE_TYPE (value), - primop0, value); + return build2 (COMPOUND_EXPR, TREE_TYPE (value), + primop0, value); return value; } } @@ -2495,10 +2361,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, tree pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) { - tree size_exp; - - tree result; - tree folded; + tree size_exp, ret; /* The result is a pointer of the same type that is being added. */ @@ -2507,7 +2370,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE) { if (pedantic || warn_pointer_arith) - pedwarn ("pointer of type `void *' used in arithmetic"); + pedwarn ("pointer of type % used in arithmetic"); size_exp = integer_one_node; } else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE) @@ -2525,13 +2388,19 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) else size_exp = size_in_bytes (TREE_TYPE (result_type)); + /* We are manipulating pointer values, so we don't need to warn + about relying on undefined signed overflow. We disable the + warning here because we use integer types so fold won't know that + they are really pointers. */ + fold_defer_overflow_warnings (); + /* If what we are about to multiply by the size of the elements contains a constant term, apply distributive law and multiply that constant term separately. This helps produce common subexpressions. */ if ((TREE_CODE (intop) == PLUS_EXPR || TREE_CODE (intop) == MINUS_EXPR) - && ! TREE_CONSTANT (intop) + && !TREE_CONSTANT (intop) && TREE_CONSTANT (TREE_OPERAND (intop, 1)) && TREE_CONSTANT (size_exp) /* If the constant comes from pointer subtraction, @@ -2540,7 +2409,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) /* If the constant is unsigned, and smaller than the pointer size, then we must skip this optimization. This is because it could cause an overflow error if the constant is negative but INTOP is not. */ - && (! TREE_UNSIGNED (TREE_TYPE (intop)) + && (!TYPE_UNSIGNED (TREE_TYPE (intop)) || (TYPE_PRECISION (TREE_TYPE (intop)) == TYPE_PRECISION (TREE_TYPE (ptrop))))) { @@ -2560,9 +2429,9 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) so the multiply won't overflow spuriously. */ if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype) - || TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype)) + || TYPE_UNSIGNED (TREE_TYPE (intop)) != TYPE_UNSIGNED (sizetype)) intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype), - TREE_UNSIGNED (sizetype)), intop); + TYPE_UNSIGNED (sizetype)), intop); /* Replace the integer argument with a suitable product by the object size. Do this multiplication as signed, then convert to the appropriate @@ -2573,17 +2442,17 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) convert (TREE_TYPE (intop), size_exp), 1)); /* Create the sum or difference. */ + ret = fold_build2 (resultcode, result_type, ptrop, intop); - result = build (resultcode, result_type, ptrop, intop); + fold_undefer_and_ignore_overflow_warnings (); - folded = fold (result); - if (folded == result) - TREE_CONSTANT (folded) = TREE_CONSTANT (ptrop) & TREE_CONSTANT (intop); - return folded; + return ret; } /* Prepare expr to be an argument of a TRUTH_NOT_EXPR, - or validate its data type for an `if' or `while' statement or ?..: exp. + or for an `if' or `while' statement or ?..: exp. It should already + have been validated to be of suitable type; otherwise, a bad + diagnostic may result. This preparation consists of taking the ordinary representation of an expression expr and producing a valid tree @@ -2596,77 +2465,77 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) tree c_common_truthvalue_conversion (tree expr) { - if (TREE_CODE (expr) == ERROR_MARK) - return expr; - - if (TREE_CODE (expr) == FUNCTION_DECL) - expr = build_unary_op (ADDR_EXPR, expr, 0); - -#if 0 /* This appears to be wrong for C++. */ - /* These really should return error_mark_node after 2.4 is stable. - But not all callers handle ERROR_MARK properly. */ - switch (TREE_CODE (TREE_TYPE (expr))) - { - case RECORD_TYPE: - error ("struct type value used where scalar is required"); - return truthvalue_false_node; - - case UNION_TYPE: - error ("union type value used where scalar is required"); - return truthvalue_false_node; - - case ARRAY_TYPE: - error ("array type value used where scalar is required"); - return truthvalue_false_node; - - default: - break; - } -#endif /* 0 */ - switch (TREE_CODE (expr)) { - case EQ_EXPR: - case NE_EXPR: case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR: + case EQ_EXPR: case NE_EXPR: case UNEQ_EXPR: case LTGT_EXPR: + case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR: + case UNLE_EXPR: case UNGE_EXPR: case UNLT_EXPR: case UNGT_EXPR: + case ORDERED_EXPR: case UNORDERED_EXPR: + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build2 (TREE_CODE (expr), truthvalue_type_node, + TREE_OPERAND (expr, 0), TREE_OPERAND (expr, 1)); + case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build2 (TREE_CODE (expr), truthvalue_type_node, + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 1))); + case TRUTH_NOT_EXPR: - TREE_TYPE (expr) = truthvalue_type_node; - return expr; + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build1 (TREE_CODE (expr), truthvalue_type_node, + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0))); case ERROR_MARK: return expr; case INTEGER_CST: - return integer_zerop (expr) ? truthvalue_false_node : truthvalue_true_node; + /* Avoid integer_zerop to ignore TREE_CONSTANT_OVERFLOW. */ + return (TREE_INT_CST_LOW (expr) != 0 || TREE_INT_CST_HIGH (expr) != 0) + ? truthvalue_true_node + : truthvalue_false_node; case REAL_CST: - return real_zerop (expr) ? truthvalue_false_node : truthvalue_true_node; + return real_compare (NE_EXPR, &TREE_REAL_CST (expr), &dconst0) + ? truthvalue_true_node + : truthvalue_false_node; + + case FUNCTION_DECL: + expr = build_unary_op (ADDR_EXPR, expr, 0); + /* Fall through. */ case ADDR_EXPR: { - if (TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL - && ! DECL_WEAK (TREE_OPERAND (expr, 0))) + tree inner = TREE_OPERAND (expr, 0); + if (DECL_P (inner) + && (TREE_CODE (inner) == PARM_DECL + || TREE_CODE (inner) == LABEL_DECL + || !DECL_WEAK (inner))) { - /* Common Ada/Pascal programmer's mistake. We always warn + /* Common Ada/Pascal programmer's mistake. We always warn about this since it is so bad. */ - warning ("the address of `%D', will always evaluate as `true'", - TREE_OPERAND (expr, 0)); + warning (OPT_Waddress, + "the address of %qD will always evaluate as %", + inner); return truthvalue_true_node; } /* If we are taking the address of an external decl, it might be zero if it is weak, so we cannot optimize. */ - if (DECL_P (TREE_OPERAND (expr, 0)) - && DECL_EXTERNAL (TREE_OPERAND (expr, 0))) + if (DECL_P (inner) + && DECL_EXTERNAL (inner)) break; - if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0))) - return build (COMPOUND_EXPR, truthvalue_type_node, - TREE_OPERAND (expr, 0), truthvalue_true_node); + if (TREE_SIDE_EFFECTS (inner)) + return build2 (COMPOUND_EXPR, truthvalue_type_node, + inner, truthvalue_true_node); else return truthvalue_true_node; } @@ -2689,65 +2558,36 @@ c_common_truthvalue_conversion (tree expr) /* These don't change whether an object is zero or nonzero, but we can't ignore them if their second arg has side-effects. */ if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))) - return build (COMPOUND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 1), - c_common_truthvalue_conversion (TREE_OPERAND (expr, 0))); + return build2 (COMPOUND_EXPR, truthvalue_type_node, + TREE_OPERAND (expr, 1), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0))); else return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)); case COND_EXPR: /* Distribute the conversion into the arms of a COND_EXPR. */ - return fold (build (COND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 0), + return fold_build3 (COND_EXPR, truthvalue_type_node, + TREE_OPERAND (expr, 0), c_common_truthvalue_conversion (TREE_OPERAND (expr, 1)), - c_common_truthvalue_conversion (TREE_OPERAND (expr, 2)))); + c_common_truthvalue_conversion (TREE_OPERAND (expr, 2))); case CONVERT_EXPR: + case NOP_EXPR: /* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE, since that affects how `default_conversion' will behave. */ if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE || TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE) break; - /* Fall through.... */ - case NOP_EXPR: /* If this is widening the argument, we can ignore it. */ if (TYPE_PRECISION (TREE_TYPE (expr)) >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))) return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)); break; - case MINUS_EXPR: - /* Perhaps reduce (x - y) != 0 to (x != y). The expressions - aren't guaranteed to the be same for modes that can represent - infinity, since if x and y are both +infinity, or both - -infinity, then x - y is not a number. - - Note that this transformation is safe when x or y is NaN. - (x - y) is then NaN, and both (x - y) != 0 and x != y will - be false. */ - if (HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (TREE_OPERAND (expr, 0))))) - break; - /* Fall through.... */ - case BIT_XOR_EXPR: - /* This and MINUS_EXPR can be changed into a comparison of the - two objects. */ - if (TREE_TYPE (TREE_OPERAND (expr, 0)) - == TREE_TYPE (TREE_OPERAND (expr, 1))) - return build_binary_op (NE_EXPR, TREE_OPERAND (expr, 0), - TREE_OPERAND (expr, 1), 1); - return build_binary_op (NE_EXPR, TREE_OPERAND (expr, 0), - fold (build1 (NOP_EXPR, - TREE_TYPE (TREE_OPERAND (expr, 0)), - TREE_OPERAND (expr, 1))), 1); - - case BIT_AND_EXPR: - if (integer_onep (TREE_OPERAND (expr, 1)) - && TREE_TYPE (expr) != truthvalue_type_node) - /* Using convert here would cause infinite recursion. */ - return build1 (NOP_EXPR, truthvalue_type_node, expr); - break; - case MODIFY_EXPR: - if (warn_parentheses && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR) - warning ("suggest parentheses around assignment used as truth value"); + if (!TREE_NO_WARNING (expr)) + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); break; default: @@ -2768,9 +2608,12 @@ c_common_truthvalue_conversion (tree expr) return build_binary_op (NE_EXPR, expr, integer_zero_node, 1); } -static tree builtin_function_2 (const char *, const char *, tree, tree, - int, enum built_in_class, int, int, - tree); +static void def_builtin_1 (enum built_in_function fncode, + const char *name, + enum built_in_class fnclass, + tree fntype, tree libtype, + bool both_p, bool fallback_p, bool nonansi_p, + tree fnattrs, bool implicit_p); /* Make a variant type in the proper way for C/C++, propagating qualifiers down to the element type of an array. */ @@ -2780,11 +2623,30 @@ c_build_qualified_type (tree type, int type_quals) { if (type == error_mark_node) return type; - + if (TREE_CODE (type) == ARRAY_TYPE) - return build_array_type (c_build_qualified_type (TREE_TYPE (type), - type_quals), - TYPE_DOMAIN (type)); + { + tree t; + tree element_type = c_build_qualified_type (TREE_TYPE (type), + type_quals); + + /* See if we already have an identically qualified type. */ + for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) + { + if (TYPE_QUALS (strip_array_types (t)) == type_quals + && TYPE_NAME (t) == TYPE_NAME (type) + && TYPE_CONTEXT (t) == TYPE_CONTEXT (type) + && attribute_list_equal (TYPE_ATTRIBUTES (t), + TYPE_ATTRIBUTES (type))) + break; + } + if (!t) + { + t = build_variant_type_copy (type); + TREE_TYPE (t) = element_type; + } + return t; + } /* A restrict-qualified pointer type must be a pointer to object or incomplete type. Note that the use of POINTER_TYPE_P also allows @@ -2793,7 +2655,7 @@ c_build_qualified_type (tree type, int type_quals) && (!POINTER_TYPE_P (type) || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type)))) { - error ("invalid use of `restrict'"); + error ("invalid use of %"); type_quals &= ~TYPE_QUAL_RESTRICT; } @@ -2806,7 +2668,7 @@ void c_apply_type_quals_to_decl (int type_quals, tree decl) { tree type = TREE_TYPE (decl); - + if (type == error_mark_node) return; @@ -2833,7 +2695,7 @@ c_apply_type_quals_to_decl (int type_quals, tree decl) if (!type || !POINTER_TYPE_P (type) || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type))) - error ("invalid use of `restrict'"); + error ("invalid use of %"); else if (flag_strict_aliasing && type == TREE_TYPE (decl)) /* Indicate we need to make a unique alias set for this pointer. We can't do it here because it might be pointing to an @@ -2842,6 +2704,51 @@ c_apply_type_quals_to_decl (int type_quals, tree decl) } } +/* Hash function for the problem of multiple type definitions in + different files. This must hash all types that will compare + equal via comptypes to the same value. In practice it hashes + on some of the simple stuff and leaves the details to comptypes. */ + +static hashval_t +c_type_hash (const void *p) +{ + int i = 0; + int shift, size; + tree t = (tree) p; + tree t2; + switch (TREE_CODE (t)) + { + /* For pointers, hash on pointee type plus some swizzling. */ + case POINTER_TYPE: + return c_type_hash (TREE_TYPE (t)) ^ 0x3003003; + /* Hash on number of elements and total size. */ + case ENUMERAL_TYPE: + shift = 3; + t2 = TYPE_VALUES (t); + break; + case RECORD_TYPE: + shift = 0; + t2 = TYPE_FIELDS (t); + break; + case QUAL_UNION_TYPE: + shift = 1; + t2 = TYPE_FIELDS (t); + break; + case UNION_TYPE: + shift = 2; + t2 = TYPE_FIELDS (t); + break; + default: + gcc_unreachable (); + } + for (; t2; t2 = TREE_CHAIN (t2)) + i++; + size = TREE_INT_CST_LOW (TYPE_SIZE (t)); + return ((size << 24) | (i << shift)); +} + +static GTY((param_is (union tree_node))) htab_t type_hash_table; + /* Return the typed-based alias set for T, which may be an expression or a type. Return -1 if we don't do anything special. */ @@ -2849,6 +2756,7 @@ HOST_WIDE_INT c_common_get_alias_set (tree t) { tree u; + PTR *slot; /* Permit type-punning when accessing a union, provided the access is directly through the union. For example, this code does not @@ -2864,7 +2772,7 @@ c_common_get_alias_set (tree t) return 0; /* That's all the expressions we handle specially. */ - if (! TYPE_P (t)) + if (!TYPE_P (t)) return -1; /* The C standard guarantees that any object may be accessed via an @@ -2881,7 +2789,7 @@ c_common_get_alias_set (tree t) /* The C standard specifically allows aliasing between signed and unsigned variants of the same type. We treat the signed variant as canonical. */ - if (TREE_CODE (t) == INTEGER_TYPE && TREE_UNSIGNED (t)) + if (TREE_CODE (t) == INTEGER_TYPE && TYPE_UNSIGNED (t)) { tree t1 = c_common_signed_type (t); @@ -2905,14 +2813,14 @@ c_common_get_alias_set (tree t) technically, an `int **' and `const int **' cannot point at the same thing. - But, the standard is wrong. In particular, this code is + But, the standard is wrong. In particular, this code is legal C++: - int *ip; - int **ipp = &ip; - const int* const* cipp = &ipp; + int *ip; + int **ipp = &ip; + const int* const* cipp = ipp; - And, it doesn't make sense for that to be legal unless you + And, it doesn't make sense for that to be legal unless you can dereference IPP and CIPP. So, we ignore cv-qualifiers on the pointed-to types. This issue has been reported to the C++ committee. */ @@ -2921,6 +2829,66 @@ c_common_get_alias_set (tree t) return get_alias_set (t1); } + /* Handle the case of multiple type nodes referring to "the same" type, + which occurs with IMA. These share an alias set. FIXME: Currently only + C90 is handled. (In C99 type compatibility is not transitive, which + complicates things mightily. The alias set splay trees can theoretically + represent this, but insertion is tricky when you consider all the + different orders things might arrive in.) */ + + if (c_language != clk_c || flag_isoc99) + return -1; + + /* Save time if there's only one input file. */ + if (num_in_fnames == 1) + return -1; + + /* Pointers need special handling if they point to any type that + needs special handling (below). */ + if (TREE_CODE (t) == POINTER_TYPE) + { + tree t2; + /* Find bottom type under any nested POINTERs. */ + for (t2 = TREE_TYPE (t); + TREE_CODE (t2) == POINTER_TYPE; + t2 = TREE_TYPE (t2)) + ; + if (TREE_CODE (t2) != RECORD_TYPE + && TREE_CODE (t2) != ENUMERAL_TYPE + && TREE_CODE (t2) != QUAL_UNION_TYPE + && TREE_CODE (t2) != UNION_TYPE) + return -1; + if (TYPE_SIZE (t2) == 0) + return -1; + } + /* These are the only cases that need special handling. */ + if (TREE_CODE (t) != RECORD_TYPE + && TREE_CODE (t) != ENUMERAL_TYPE + && TREE_CODE (t) != QUAL_UNION_TYPE + && TREE_CODE (t) != UNION_TYPE + && TREE_CODE (t) != POINTER_TYPE) + return -1; + /* Undefined? */ + if (TYPE_SIZE (t) == 0) + return -1; + + /* Look up t in hash table. Only one of the compatible types within each + alias set is recorded in the table. */ + if (!type_hash_table) + type_hash_table = htab_create_ggc (1021, c_type_hash, + (htab_eq) lang_hooks.types_compatible_p, + NULL); + slot = htab_find_slot (type_hash_table, t, INSERT); + if (*slot != NULL) + { + TYPE_ALIAS_SET (t) = TYPE_ALIAS_SET ((tree)*slot); + return TYPE_ALIAS_SET ((tree)*slot); + } + else + /* Our caller will assign and record (in t) a new alias set; all we need + to do is remember t in the hash table. */ + *slot = t; + return -1; } @@ -2928,22 +2896,22 @@ c_common_get_alias_set (tree t) second parameter indicates which OPERATOR is being applied. The COMPLAIN flag controls whether we should diagnose possibly ill-formed constructs or not. */ + tree -c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain) +c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain) { const char *op_name; tree value = NULL; enum tree_code type_code = TREE_CODE (type); - my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720); - op_name = op == SIZEOF_EXPR ? "sizeof" : "__alignof__"; + op_name = is_sizeof ? "sizeof" : "__alignof__"; if (type_code == FUNCTION_TYPE) { - if (op == SIZEOF_EXPR) + if (is_sizeof) { if (complain && (pedantic || warn_pointer_arith)) - pedwarn ("invalid application of `sizeof' to a function type"); + pedwarn ("invalid application of % to a function type"); value = size_one_node; } else @@ -2953,33 +2921,33 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain) { if (type_code == VOID_TYPE && complain && (pedantic || warn_pointer_arith)) - pedwarn ("invalid application of `%s' to a void type", op_name); + pedwarn ("invalid application of %qs to a void type", op_name); value = size_one_node; } else if (!COMPLETE_TYPE_P (type)) { if (complain) - error ("invalid application of `%s' to incomplete type `%T' ", + error ("invalid application of %qs to incomplete type %qT ", op_name, type); value = size_zero_node; } else { - if (op == SIZEOF_EXPR) + if (is_sizeof) /* Convert in case a char is more than one unit. */ value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type), size_int (TYPE_PRECISION (char_type_node) / BITS_PER_UNIT)); else - value = size_int (TYPE_ALIGN (type) / BITS_PER_UNIT); + value = size_int (TYPE_ALIGN_UNIT (type)); } /* VALUE will have an integer type with TYPE_IS_SIZETYPE set. TYPE_IS_SIZETYPE means that certain things (like overflow) will never happen. However, this node should really have type `size_t', which is just a typedef for an ordinary integer type. */ - value = fold (build1 (NOP_EXPR, size_type_node, value)); - my_friendly_assert (!TYPE_IS_SIZETYPE (TREE_TYPE (value)), 20001021); + value = fold_convert (size_type_node, value); + gcc_assert (!TYPE_IS_SIZETYPE (TREE_TYPE (value))); return value; } @@ -2995,17 +2963,17 @@ c_alignof_expr (tree expr) tree t; if (TREE_CODE (expr) == VAR_DECL) - t = size_int (DECL_ALIGN (expr) / BITS_PER_UNIT); + t = size_int (DECL_ALIGN_UNIT (expr)); else if (TREE_CODE (expr) == COMPONENT_REF && DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1))) { - error ("`__alignof' applied to a bit-field"); + error ("%<__alignof%> applied to a bit-field"); t = size_one_node; } else if (TREE_CODE (expr) == COMPONENT_REF && TREE_CODE (TREE_OPERAND (expr, 1)) == FIELD_DECL) - t = size_int (DECL_ALIGN (TREE_OPERAND (expr, 1)) / BITS_PER_UNIT); + t = size_int (DECL_ALIGN_UNIT (TREE_OPERAND (expr, 1))); else if (TREE_CODE (expr) == INDIRECT_REF) { @@ -3013,7 +2981,7 @@ c_alignof_expr (tree expr) tree best = t; int bestalign = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (t))); - while (TREE_CODE (t) == NOP_EXPR + while ((TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR) && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == POINTER_TYPE) { int thisalign; @@ -3028,7 +2996,7 @@ c_alignof_expr (tree expr) else return c_alignof (TREE_TYPE (expr)); - return fold (build1 (NOP_EXPR, size_type_node, t)); + return fold_convert (size_type_node, t); } /* Handle C and C++ default attributes. */ @@ -3051,24 +3019,24 @@ static GTY(()) tree built_in_attributes[(int) ATTR_LAST]; static void c_init_attributes (void); -/* Build tree nodes and builtin functions common to both C and C++ language - frontends. */ - -void -c_common_nodes_and_builtins (void) +enum c_builtin_type { - enum builtin_type - { #define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME, #define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME, #define DEF_FUNCTION_TYPE_1(NAME, RETURN, ARG1) NAME, #define DEF_FUNCTION_TYPE_2(NAME, RETURN, ARG1, ARG2) NAME, #define DEF_FUNCTION_TYPE_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME, #define DEF_FUNCTION_TYPE_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME, +#define DEF_FUNCTION_TYPE_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) NAME, +#define DEF_FUNCTION_TYPE_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) NAME, +#define DEF_FUNCTION_TYPE_7(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) NAME, #define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME, #define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME, #define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME, #define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME, +#define DEF_FUNCTION_TYPE_VAR_4(NAME, RETURN, ARG1, ARG2, ARG3, ARG4) NAME, +#define DEF_FUNCTION_TYPE_VAR_5(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG6) \ + NAME, #define DEF_POINTER_TYPE(NAME, TYPE) NAME, #include "builtin-types.def" #undef DEF_PRIMITIVE_TYPE @@ -3077,17 +3045,71 @@ c_common_nodes_and_builtins (void) #undef DEF_FUNCTION_TYPE_2 #undef DEF_FUNCTION_TYPE_3 #undef DEF_FUNCTION_TYPE_4 +#undef DEF_FUNCTION_TYPE_5 +#undef DEF_FUNCTION_TYPE_6 +#undef DEF_FUNCTION_TYPE_7 #undef DEF_FUNCTION_TYPE_VAR_0 #undef DEF_FUNCTION_TYPE_VAR_1 #undef DEF_FUNCTION_TYPE_VAR_2 #undef DEF_FUNCTION_TYPE_VAR_3 +#undef DEF_FUNCTION_TYPE_VAR_4 +#undef DEF_FUNCTION_TYPE_VAR_5 #undef DEF_POINTER_TYPE - BT_LAST - }; + BT_LAST +}; - typedef enum builtin_type builtin_type; +typedef enum c_builtin_type builtin_type; - tree builtin_types[(int) BT_LAST]; +/* A temporary array for c_common_nodes_and_builtins. Used in + communication with def_fn_type. */ +static tree builtin_types[(int) BT_LAST + 1]; + +/* A helper function for c_common_nodes_and_builtins. Build function type + for DEF with return type RET and N arguments. If VAR is true, then the + function should be variadic after those N arguments. + + Takes special care not to ICE if any of the types involved are + error_mark_node, which indicates that said type is not in fact available + (see builtin_type_for_size). In which case the function type as a whole + should be error_mark_node. */ + +static void +def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...) +{ + tree args = NULL, t; + va_list list; + int i; + + va_start (list, n); + for (i = 0; i < n; ++i) + { + builtin_type a = va_arg (list, builtin_type); + t = builtin_types[a]; + if (t == error_mark_node) + goto egress; + args = tree_cons (NULL_TREE, t, args); + } + va_end (list); + + args = nreverse (args); + if (!var) + args = chainon (args, void_list_node); + + t = builtin_types[ret]; + if (t == error_mark_node) + goto egress; + t = build_function_type (t, args); + + egress: + builtin_types[def] = t; +} + +/* Build tree nodes and builtin functions common to both C and C++ language + frontends. */ + +void +c_common_nodes_and_builtins (void) +{ int wchar_type_size; tree array_domain_type; tree va_list_ref_type_node; @@ -3128,43 +3150,45 @@ c_common_nodes_and_builtins (void) /* These are types that c_common_type_for_size and c_common_type_for_mode use. */ - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - intQI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - intHI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - intSI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - intDI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + intQI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + intHI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + intSI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + intDI_type_node)); #if HOST_BITS_PER_WIDE_INT >= 64 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__int128_t"), - intTI_type_node)); + if (targetm.scalar_mode_supported_p (TImode)) + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + get_identifier ("__int128_t"), + intTI_type_node)); #endif - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - unsigned_intQI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - unsigned_intHI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - unsigned_intSI_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - unsigned_intDI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + unsigned_intQI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + unsigned_intHI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + unsigned_intSI_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + unsigned_intDI_type_node)); #if HOST_BITS_PER_WIDE_INT >= 64 - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__uint128_t"), - unsigned_intTI_type_node)); + if (targetm.scalar_mode_supported_p (TImode)) + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + get_identifier ("__uint128_t"), + unsigned_intTI_type_node)); #endif /* Create the widest literal types. */ widest_integer_literal_type_node = make_signed_type (HOST_BITS_PER_WIDE_INT * 2); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - widest_integer_literal_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + widest_integer_literal_type_node)); widest_unsigned_literal_type_node = make_unsigned_type (HOST_BITS_PER_WIDE_INT * 2); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE, - widest_unsigned_literal_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, NULL_TREE, + widest_unsigned_literal_type_node)); /* `unsigned long' is the standard type for sizeof. Note that stddef.h uses `unsigned long', @@ -3174,81 +3198,48 @@ c_common_nodes_and_builtins (void) signed_size_type_node = c_common_signed_type (size_type_node); set_sizetype (size_type_node); + pid_type_node = + TREE_TYPE (identifier_global_value (get_identifier (PID_TYPE))); + build_common_tree_nodes_2 (flag_short_double); record_builtin_type (RID_FLOAT, NULL, float_type_node); record_builtin_type (RID_DOUBLE, NULL, double_type_node); record_builtin_type (RID_MAX, "long double", long_double_type_node); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("complex int"), - complex_integer_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("complex float"), - complex_float_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("complex double"), - complex_double_type_node)); - (*lang_hooks.decls.pushdecl) + /* Only supported decimal floating point extension if the target + actually supports underlying modes. */ + if (targetm.scalar_mode_supported_p (SDmode) + && targetm.scalar_mode_supported_p (DDmode) + && targetm.scalar_mode_supported_p (TDmode)) + { + record_builtin_type (RID_DFLOAT32, NULL, dfloat32_type_node); + record_builtin_type (RID_DFLOAT64, NULL, dfloat64_type_node); + record_builtin_type (RID_DFLOAT128, NULL, dfloat128_type_node); + } + + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + get_identifier ("complex int"), + complex_integer_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + get_identifier ("complex float"), + complex_float_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + get_identifier ("complex double"), + complex_double_type_node)); + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, get_identifier ("complex long double"), complex_long_double_type_node)); - /* Types which are common to the fortran compiler and libf2c. When - changing these, you also need to be concerned with f/com.h. */ - - if (TYPE_PRECISION (float_type_node) - == TYPE_PRECISION (long_integer_type_node)) - { - g77_integer_type_node = long_integer_type_node; - g77_uinteger_type_node = long_unsigned_type_node; - } - else if (TYPE_PRECISION (float_type_node) - == TYPE_PRECISION (integer_type_node)) - { - g77_integer_type_node = integer_type_node; - g77_uinteger_type_node = unsigned_type_node; - } - else - g77_integer_type_node = g77_uinteger_type_node = NULL_TREE; - - if (g77_integer_type_node != NULL_TREE) - { - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__g77_integer"), - g77_integer_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__g77_uinteger"), - g77_uinteger_type_node)); - } - - if (TYPE_PRECISION (float_type_node) * 2 - == TYPE_PRECISION (long_integer_type_node)) - { - g77_longint_type_node = long_integer_type_node; - g77_ulongint_type_node = long_unsigned_type_node; - } - else if (TYPE_PRECISION (float_type_node) * 2 - == TYPE_PRECISION (long_long_integer_type_node)) - { - g77_longint_type_node = long_long_integer_type_node; - g77_ulongint_type_node = long_long_unsigned_type_node; - } - else - g77_longint_type_node = g77_ulongint_type_node = NULL_TREE; - - if (g77_longint_type_node != NULL_TREE) - { - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__g77_longint"), - g77_longint_type_node)); - (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, - get_identifier ("__g77_ulongint"), - g77_ulongint_type_node)); - } + if (c_dialect_cxx ()) + /* For C++, make fileptr_type_node a distinct void * type until + FILE type is defined. */ + fileptr_type_node = build_variant_type_copy (ptr_type_node); record_builtin_type (RID_VOID, NULL, void_type_node); - void_zero_node = build_int_2 (0, 0); + /* This node must not be shared. */ + void_zero_node = make_node (INTEGER_CST); TREE_TYPE (void_zero_node) = void_type_node; void_list_node = build_void_list_node (); @@ -3281,7 +3272,7 @@ c_common_nodes_and_builtins (void) wchar_type_size = TYPE_PRECISION (wchar_type_node); if (c_dialect_cxx ()) { - if (TREE_UNSIGNED (wchar_type_node)) + if (TYPE_UNSIGNED (wchar_type_node)) wchar_type_node = make_unsigned_type (wchar_type_size); else wchar_type_node = make_signed_type (wchar_type_size); @@ -3310,18 +3301,10 @@ c_common_nodes_and_builtins (void) = TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE))); unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node); - (*lang_hooks.decls.pushdecl) + lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"), va_list_type_node)); - (*lang_hooks.decls.pushdecl) - (build_decl (TYPE_DECL, get_identifier ("__builtin_ptrdiff_t"), - ptrdiff_type_node)); - - (*lang_hooks.decls.pushdecl) - (build_decl (TYPE_DECL, get_identifier ("__builtin_size_t"), - sizetype)); - if (TREE_CODE (va_list_type_node) == ARRAY_TYPE) { va_list_arg_type_node = va_list_ref_type_node = @@ -3334,137 +3317,121 @@ c_common_nodes_and_builtins (void) } #define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ - builtin_types[(int) ENUM] = VALUE; -#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ - builtin_types[(int) ENUM] \ - = build_function_type (builtin_types[(int) RETURN], \ - void_list_node); -#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ - builtin_types[(int) ENUM] \ - = build_function_type (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - void_list_node)); -#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ - builtin_types[(int) ENUM] \ - = build_function_type \ - (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG2], \ - void_list_node))); -#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - builtin_types[(int) ENUM] \ - = build_function_type \ - (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG2], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG3], \ - void_list_node)))); -#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ - builtin_types[(int) ENUM] \ - = build_function_type \ - (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG2], \ - tree_cons \ - (NULL_TREE, \ - builtin_types[(int) ARG3], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG4], \ - void_list_node))))); -#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ - builtin_types[(int) ENUM] \ - = build_function_type (builtin_types[(int) RETURN], NULL_TREE); -#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ - builtin_types[(int) ENUM] \ - = build_function_type (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - NULL_TREE)); + builtin_types[ENUM] = VALUE; +#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 0, 0); +#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 0, 1, ARG1); +#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6) \ + def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6); +#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ + ARG6, ARG7) \ + def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7); +#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ + def_fn_type (ENUM, RETURN, 1, 0); +#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ + def_fn_type (ENUM, RETURN, 1, 1, ARG1); +#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ + def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2); +#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3); +#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ + def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4); +#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ + def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5); +#define DEF_POINTER_TYPE(ENUM, TYPE) \ + builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]); -#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ - builtin_types[(int) ENUM] \ - = build_function_type \ - (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG2], \ - NULL_TREE))); - -#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ - builtin_types[(int) ENUM] \ - = build_function_type \ - (builtin_types[(int) RETURN], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG1], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG2], \ - tree_cons (NULL_TREE, \ - builtin_types[(int) ARG3], \ - NULL_TREE)))); - -#define DEF_POINTER_TYPE(ENUM, TYPE) \ - builtin_types[(int) ENUM] \ - = build_pointer_type (builtin_types[(int) TYPE]); #include "builtin-types.def" + #undef DEF_PRIMITIVE_TYPE #undef DEF_FUNCTION_TYPE_1 #undef DEF_FUNCTION_TYPE_2 #undef DEF_FUNCTION_TYPE_3 #undef DEF_FUNCTION_TYPE_4 +#undef DEF_FUNCTION_TYPE_5 +#undef DEF_FUNCTION_TYPE_6 #undef DEF_FUNCTION_TYPE_VAR_0 #undef DEF_FUNCTION_TYPE_VAR_1 #undef DEF_FUNCTION_TYPE_VAR_2 #undef DEF_FUNCTION_TYPE_VAR_3 +#undef DEF_FUNCTION_TYPE_VAR_4 +#undef DEF_FUNCTION_TYPE_VAR_5 #undef DEF_POINTER_TYPE + builtin_types[(int) BT_LAST] = NULL_TREE; c_init_attributes (); -#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, \ - BOTH_P, FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT) \ - if (NAME) \ - { \ - tree decl; \ - \ - if (strncmp (NAME, "__builtin_", strlen ("__builtin_")) != 0) \ - abort (); \ - \ - if (!BOTH_P) \ - decl = builtin_function (NAME, builtin_types[TYPE], ENUM, \ - CLASS, \ - (FALLBACK_P \ - ? (NAME + strlen ("__builtin_")) \ - : NULL), \ - built_in_attributes[(int) ATTRS]); \ - else \ - decl = builtin_function_2 (NAME, \ - NAME + strlen ("__builtin_"), \ - builtin_types[TYPE], \ - builtin_types[LIBTYPE], \ - ENUM, \ - CLASS, \ - FALLBACK_P, \ - NONANSI_P, \ - built_in_attributes[(int) ATTRS]); \ - \ - built_in_decls[(int) ENUM] = decl; \ - if (IMPLICIT) \ - implicit_built_in_decls[(int) ENUM] = decl; \ - } +#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \ + NONANSI_P, ATTRS, IMPLICIT, COND) \ + if (NAME && COND) \ + def_builtin_1 (ENUM, NAME, CLASS, \ + builtin_types[(int) TYPE], \ + builtin_types[(int) LIBTYPE], \ + BOTH_P, FALLBACK_P, NONANSI_P, \ + built_in_attributes[(int) ATTRS], IMPLICIT); #include "builtins.def" #undef DEF_BUILTIN - (*targetm.init_builtins) (); + build_common_builtin_nodes (); + + targetm.init_builtins (); + if (flag_mudflap) + mudflap_init (); main_identifier_node = get_identifier ("main"); + + /* Create the built-in __null node. It is important that this is + not shared. */ + null_node = make_node (INTEGER_CST); + TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0); + + /* Since builtin_types isn't gc'ed, don't export these nodes. */ + memset (builtin_types, 0, sizeof (builtin_types)); +} + +/* Look up the function in built_in_decls that corresponds to DECL + and set ASMSPEC as its user assembler name. DECL must be a + function decl that declares a builtin. */ + +void +set_builtin_user_assembler_name (tree decl, const char *asmspec) +{ + tree builtin; + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL + && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL + && asmspec != 0); + + builtin = built_in_decls [DECL_FUNCTION_CODE (decl)]; + set_user_assembler_name (builtin, asmspec); + if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY) + init_block_move_fn (asmspec); + else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET) + init_block_clear_fn (asmspec); +} + +/* The number of named compound-literals generated thus far. */ +static GTY(()) int compound_literal_number; + +/* Set DECL_NAME for DECL, a VAR_DECL for a compound-literal. */ + +void +set_compound_literal_name (tree decl) +{ + char *name; + ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal", + compound_literal_number); + compound_literal_number++; + DECL_NAME (decl) = get_identifier (name); } tree @@ -3492,13 +3459,13 @@ void disable_builtin_function (const char *name) { if (strncmp (name, "__builtin_", strlen ("__builtin_")) == 0) - error ("cannot disable built-in function `%s'", name); + error ("cannot disable built-in function %qs", name); else { - disabled_builtin *new = xmalloc (sizeof (disabled_builtin)); - new->name = name; - new->next = disabled_builtins; - disabled_builtins = new; + disabled_builtin *new_disabled_builtin = XNEW (disabled_builtin); + new_disabled_builtin->name = name; + new_disabled_builtin->next = disabled_builtins; + disabled_builtins = new_disabled_builtin; } } @@ -3519,39 +3486,42 @@ builtin_function_disabled_p (const char *name) } -/* Possibly define a builtin function with one or two names. BUILTIN_NAME - is an __builtin_-prefixed name; NAME is the ordinary name; one or both - of these may be NULL (though both being NULL is useless). - BUILTIN_TYPE is the type of the __builtin_-prefixed function; - TYPE is the type of the function with the ordinary name. These - may differ if the ordinary name is declared with a looser type to avoid - conflicts with headers. FUNCTION_CODE and CLASS are as for - builtin_function. If LIBRARY_NAME_P is nonzero, NAME is passed as - the LIBRARY_NAME parameter to builtin_function when declaring BUILTIN_NAME. - If NONANSI_P is nonzero, the name NAME is treated as a non-ANSI name; - ATTRS is the tree list representing the builtin's function attributes. - Returns the declaration of BUILTIN_NAME, if any, otherwise - the declaration of NAME. Does not declare NAME if flag_no_builtin, - or if NONANSI_P and flag_no_nonansi_builtin. */ +/* Worker for DEF_BUILTIN. + Possibly define a builtin function with one or two names. + Does not declare a non-__builtin_ function if flag_no_builtin, or if + nonansi_p and flag_no_nonansi_builtin. */ -static tree -builtin_function_2 (const char *builtin_name, const char *name, - tree builtin_type, tree type, int function_code, - enum built_in_class class, int library_name_p, - int nonansi_p, tree attrs) +static void +def_builtin_1 (enum built_in_function fncode, + const char *name, + enum built_in_class fnclass, + tree fntype, tree libtype, + bool both_p, bool fallback_p, bool nonansi_p, + tree fnattrs, bool implicit_p) { - tree bdecl = NULL_TREE; - tree decl = NULL_TREE; + tree decl; + const char *libname; - if (builtin_name != 0) - bdecl = builtin_function (builtin_name, builtin_type, function_code, - class, library_name_p ? name : NULL, attrs); + if (fntype == error_mark_node) + return; - if (name != 0 && !flag_no_builtin && !builtin_function_disabled_p (name) + gcc_assert ((!both_p && !fallback_p) + || !strncmp (name, "__builtin_", + strlen ("__builtin_"))); + + libname = name + strlen ("__builtin_"); + decl = lang_hooks.builtin_function (name, fntype, fncode, fnclass, + (fallback_p ? libname : NULL), + fnattrs); + if (both_p + && !flag_no_builtin && !builtin_function_disabled_p (libname) && !(nonansi_p && flag_no_nonansi_builtin)) - decl = builtin_function (name, type, function_code, class, NULL, attrs); + lang_hooks.builtin_function (libname, libtype, fncode, fnclass, + NULL, fnattrs); - return (bdecl != 0 ? bdecl : decl); + built_in_decls[(int) fncode] = decl; + if (implicit_p) + implicit_built_in_decls[(int) fncode] = decl; } /* Nonzero if the type T promotes to int. This is (nearly) the @@ -3595,6 +3565,9 @@ self_promoting_args_p (tree parms) { tree type = TREE_VALUE (t); + if (type == error_mark_node) + continue; + if (TREE_CHAIN (t) == 0 && type != void_type_node) return 0; @@ -3631,225 +3604,6 @@ strip_pointer_operator (tree t) return t; } -static tree expand_unordered_cmp (tree, tree, enum tree_code, enum tree_code); - -/* Expand a call to an unordered comparison function such as - __builtin_isgreater(). FUNCTION is the function's declaration and - PARAMS a list of the values passed. For __builtin_isunordered(), - UNORDERED_CODE is UNORDERED_EXPR and ORDERED_CODE is NOP_EXPR. In - other cases, UNORDERED_CODE and ORDERED_CODE are comparison codes - that give the opposite of the desired result. UNORDERED_CODE is - used for modes that can hold NaNs and ORDERED_CODE is used for the - rest. */ - -static tree -expand_unordered_cmp (tree function, tree params, - enum tree_code unordered_code, - enum tree_code ordered_code) -{ - tree arg0, arg1, type; - enum tree_code code0, code1; - - /* Check that we have exactly two arguments. */ - if (params == 0 || TREE_CHAIN (params) == 0) - { - error ("too few arguments to function `%s'", - IDENTIFIER_POINTER (DECL_NAME (function))); - return error_mark_node; - } - else if (TREE_CHAIN (TREE_CHAIN (params)) != 0) - { - error ("too many arguments to function `%s'", - IDENTIFIER_POINTER (DECL_NAME (function))); - return error_mark_node; - } - - arg0 = TREE_VALUE (params); - arg1 = TREE_VALUE (TREE_CHAIN (params)); - - code0 = TREE_CODE (TREE_TYPE (arg0)); - code1 = TREE_CODE (TREE_TYPE (arg1)); - - /* Make sure that the arguments have a common type of REAL. */ - type = 0; - if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) - && (code1 == INTEGER_TYPE || code1 == REAL_TYPE)) - type = common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)); - - if (type == 0 || TREE_CODE (type) != REAL_TYPE) - { - error ("non-floating-point argument to function `%s'", - IDENTIFIER_POINTER (DECL_NAME (function))); - return error_mark_node; - } - - if (unordered_code == UNORDERED_EXPR) - { - if (MODE_HAS_NANS (TYPE_MODE (type))) - return build_binary_op (unordered_code, - convert (type, arg0), - convert (type, arg1), - 0); - else - return integer_zero_node; - } - - return build_unary_op (TRUTH_NOT_EXPR, - build_binary_op (MODE_HAS_NANS (TYPE_MODE (type)) - ? unordered_code - : ordered_code, - convert (type, arg0), - convert (type, arg1), - 0), - 0); -} - - -/* Recognize certain built-in functions so we can make tree-codes - other than CALL_EXPR. We do this when it enables fold-const.c - to do something useful. */ -/* ??? By rights this should go in builtins.c, but only C and C++ - implement build_{binary,unary}_op. Not exactly sure what bits - of functionality are actually needed from those functions, or - where the similar functionality exists in the other front ends. */ - -tree -expand_tree_builtin (tree function, tree params, tree coerced_params) -{ - if (DECL_BUILT_IN_CLASS (function) != BUILT_IN_NORMAL) - return NULL_TREE; - - switch (DECL_FUNCTION_CODE (function)) - { - case BUILT_IN_ABS: - case BUILT_IN_LABS: - case BUILT_IN_LLABS: - case BUILT_IN_IMAXABS: - case BUILT_IN_FABS: - case BUILT_IN_FABSL: - case BUILT_IN_FABSF: - if (coerced_params == 0) - return integer_zero_node; - return build_unary_op (ABS_EXPR, TREE_VALUE (coerced_params), 0); - - case BUILT_IN_CONJ: - case BUILT_IN_CONJF: - case BUILT_IN_CONJL: - if (coerced_params == 0) - return integer_zero_node; - return build_unary_op (CONJ_EXPR, TREE_VALUE (coerced_params), 0); - - case BUILT_IN_CREAL: - case BUILT_IN_CREALF: - case BUILT_IN_CREALL: - if (coerced_params == 0) - return integer_zero_node; - return non_lvalue (build_unary_op (REALPART_EXPR, - TREE_VALUE (coerced_params), 0)); - - case BUILT_IN_CIMAG: - case BUILT_IN_CIMAGF: - case BUILT_IN_CIMAGL: - if (coerced_params == 0) - return integer_zero_node; - return non_lvalue (build_unary_op (IMAGPART_EXPR, - TREE_VALUE (coerced_params), 0)); - - case BUILT_IN_ISGREATER: - return expand_unordered_cmp (function, params, UNLE_EXPR, LE_EXPR); - - case BUILT_IN_ISGREATEREQUAL: - return expand_unordered_cmp (function, params, UNLT_EXPR, LT_EXPR); - - case BUILT_IN_ISLESS: - return expand_unordered_cmp (function, params, UNGE_EXPR, GE_EXPR); - - case BUILT_IN_ISLESSEQUAL: - return expand_unordered_cmp (function, params, UNGT_EXPR, GT_EXPR); - - case BUILT_IN_ISLESSGREATER: - return expand_unordered_cmp (function, params, UNEQ_EXPR, EQ_EXPR); - - case BUILT_IN_ISUNORDERED: - return expand_unordered_cmp (function, params, UNORDERED_EXPR, NOP_EXPR); - - default: - break; - } - - return NULL_TREE; -} - -/* Walk the statement tree, rooted at *tp. Apply FUNC to all the - sub-trees of *TP in a pre-order traversal. FUNC is called with the - DATA and the address of each sub-tree. If FUNC returns a non-NULL - value, the traversal is aborted, and the value returned by FUNC is - returned. If FUNC sets WALK_SUBTREES to zero, then the subtrees of - the node being visited are not walked. - - We don't need a without_duplicates variant of this one because the - statement tree is a tree, not a graph. */ - -tree -walk_stmt_tree (tree *tp, walk_tree_fn func, void *data) -{ - enum tree_code code; - int walk_subtrees; - tree result; - int i, len; - -#define WALK_SUBTREE(NODE) \ - do \ - { \ - result = walk_stmt_tree (&(NODE), func, data); \ - if (result) \ - return result; \ - } \ - while (0) - - /* Skip empty subtrees. */ - if (!*tp) - return NULL_TREE; - - /* Skip subtrees below non-statement nodes. */ - if (!STATEMENT_CODE_P (TREE_CODE (*tp))) - return NULL_TREE; - - /* Call the function. */ - walk_subtrees = 1; - result = (*func) (tp, &walk_subtrees, data); - - /* If we found something, return it. */ - if (result) - return result; - - /* FUNC may have modified the tree, recheck that we're looking at a - statement node. */ - code = TREE_CODE (*tp); - if (!STATEMENT_CODE_P (code)) - return NULL_TREE; - - /* Visit the subtrees unless FUNC decided that there was nothing - interesting below this point in the tree. */ - if (walk_subtrees) - { - /* Walk over all the sub-trees of this operand. Statement nodes - never contain RTL, and we needn't worry about TARGET_EXPRs. */ - len = TREE_CODE_LENGTH (code); - - /* Go through the subtrees. We need to do this in forward order so - that the scope of a FOR_EXPR is handled properly. */ - for (i = 0; i < len; ++i) - WALK_SUBTREE (TREE_OPERAND (*tp, i)); - } - - /* Finally visit the chain. This can be tail-recursion optimized if - we write it this way. */ - return walk_stmt_tree (&TREE_CHAIN (*tp), func, data); - -#undef WALK_SUBTREE -} - /* Used to compare case labels. K1 and K2 are actually tree nodes representing case labels, or NULL_TREE for a `default' label. Returns -1 if K1 is ordered before K2, -1 if K1 is ordered after @@ -3874,12 +3628,12 @@ case_compare (splay_tree_key k1, splay_tree_key k2) case label was declared using the usual C/C++ syntax, rather than the GNU case range extension. CASES is a tree containing all the case ranges processed so far; COND is the condition for the - switch-statement itself. Returns the CASE_LABEL created, or - ERROR_MARK_NODE if no CASE_LABEL is created. */ + switch-statement itself. Returns the CASE_LABEL_EXPR created, or + ERROR_MARK_NODE if no CASE_LABEL_EXPR is created. */ tree -c_add_case_label (splay_tree cases, tree cond, tree low_value, - tree high_value) +c_add_case_label (splay_tree cases, tree cond, tree orig_type, + tree low_value, tree high_value) { tree type; tree label; @@ -3887,25 +3641,21 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value, splay_tree_node node; /* Create the LABEL_DECL itself. */ - label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); - DECL_CONTEXT (label) = current_function_decl; + label = create_artificial_label (); /* If there was an error processing the switch condition, bail now before we get more confused. */ if (!cond || cond == error_mark_node) - { - /* Add a label anyhow so that the back-end doesn't think that - the beginning of the switch is unreachable. */ - if (!cases->root) - add_stmt (build_case_label (NULL_TREE, NULL_TREE, label)); - return error_mark_node; - } + goto error_out; if ((low_value && TREE_TYPE (low_value) && POINTER_TYPE_P (TREE_TYPE (low_value))) || (high_value && TREE_TYPE (high_value) && POINTER_TYPE_P (TREE_TYPE (high_value)))) - error ("pointers are not permitted as case values"); + { + error ("pointers are not permitted as case values"); + goto error_out; + } /* Case ranges are a GNU extension. */ if (high_value && pedantic) @@ -3916,29 +3666,35 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value, { low_value = check_case_value (low_value); low_value = convert_and_check (type, low_value); + if (low_value == error_mark_node) + goto error_out; } if (high_value) { high_value = check_case_value (high_value); high_value = convert_and_check (type, high_value); + if (high_value == error_mark_node) + goto error_out; } - /* If an error has occurred, bail out now. */ - if (low_value == error_mark_node || high_value == error_mark_node) + if (low_value && high_value) { - if (!cases->root) - add_stmt (build_case_label (NULL_TREE, NULL_TREE, label)); - return error_mark_node; + /* If the LOW_VALUE and HIGH_VALUE are the same, then this isn't + really a case range, even though it was written that way. + Remove the HIGH_VALUE to simplify later processing. */ + if (tree_int_cst_equal (low_value, high_value)) + high_value = NULL_TREE; + else if (!tree_int_cst_lt (low_value, high_value)) + warning (0, "empty range specified"); } - /* If the LOW_VALUE and HIGH_VALUE are the same, then this isn't - really a case range, even though it was written that way. Remove - the HIGH_VALUE to simplify later processing. */ - if (tree_int_cst_equal (low_value, high_value)) - high_value = NULL_TREE; - if (low_value && high_value - && !tree_int_cst_lt (low_value, high_value)) - warning ("empty range specified"); + /* See if the case is in range of the type of the original testing + expression. If both low_value and high_value are out of range, + don't insert the case label and return NULL_TREE. */ + if (low_value + && !check_case_bounds (type, orig_type, + &low_value, high_value ? &high_value : NULL)) + return NULL_TREE; /* Look up the LOW_VALUE in the table of case labels we already have. */ @@ -3985,7 +3741,7 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value, /* If there was an overlap, issue an error. */ if (node) { - tree duplicate = CASE_LABEL_DECL ((tree) node->value); + tree duplicate = CASE_LABEL ((tree) node->value); if (high_value) { @@ -4002,8 +3758,7 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value, error ("multiple default labels in one switch"); error ("%Jthis is the first default label", duplicate); } - if (!cases->root) - add_stmt (build_case_label (NULL_TREE, NULL_TREE, label)); + goto error_out; } /* Add a CASE_LABEL to the statement-tree. */ @@ -4014,6 +3769,179 @@ c_add_case_label (splay_tree cases, tree cond, tree low_value, (splay_tree_value) case_label); return case_label; + + error_out: + /* Add a label so that the back-end doesn't think that the beginning of + the switch is unreachable. Note that we do not add a case label, as + that just leads to duplicates and thence to failure later on. */ + if (!cases->root) + { + tree t = create_artificial_label (); + add_stmt (build_stmt (LABEL_EXPR, t)); + } + return error_mark_node; +} + +/* Subroutines of c_do_switch_warnings, called via splay_tree_foreach. + Used to verify that case values match up with enumerator values. */ + +static void +match_case_to_enum_1 (tree key, tree type, tree label) +{ + char buf[2 + 2*HOST_BITS_PER_WIDE_INT/4 + 1]; + + /* ??? Not working too hard to print the double-word value. + Should perhaps be done with %lwd in the diagnostic routines? */ + if (TREE_INT_CST_HIGH (key) == 0) + snprintf (buf, sizeof (buf), HOST_WIDE_INT_PRINT_UNSIGNED, + TREE_INT_CST_LOW (key)); + else if (!TYPE_UNSIGNED (type) + && TREE_INT_CST_HIGH (key) == -1 + && TREE_INT_CST_LOW (key) != 0) + snprintf (buf, sizeof (buf), "-" HOST_WIDE_INT_PRINT_UNSIGNED, + -TREE_INT_CST_LOW (key)); + else + snprintf (buf, sizeof (buf), HOST_WIDE_INT_PRINT_DOUBLE_HEX, + TREE_INT_CST_HIGH (key), TREE_INT_CST_LOW (key)); + + if (TYPE_NAME (type) == 0) + warning (0, "%Jcase value %qs not in enumerated type", + CASE_LABEL (label), buf); + else + warning (0, "%Jcase value %qs not in enumerated type %qT", + CASE_LABEL (label), buf, type); +} + +/* Subroutine of c_do_switch_warnings, called via splay_tree_foreach. + Used to verify that case values match up with enumerator values. */ + +static int +match_case_to_enum (splay_tree_node node, void *data) +{ + tree label = (tree) node->value; + tree type = (tree) data; + + /* Skip default case. */ + if (!CASE_LOW (label)) + return 0; + + /* If CASE_LOW_SEEN is not set, that means CASE_LOW did not appear + when we did our enum->case scan. Reset our scratch bit after. */ + if (!CASE_LOW_SEEN (label)) + match_case_to_enum_1 (CASE_LOW (label), type, label); + else + CASE_LOW_SEEN (label) = 0; + + /* If CASE_HIGH is non-null, we have a range. If CASE_HIGH_SEEN is + not set, that means that CASE_HIGH did not appear when we did our + enum->case scan. Reset our scratch bit after. */ + if (CASE_HIGH (label)) + { + if (!CASE_HIGH_SEEN (label)) + match_case_to_enum_1 (CASE_HIGH (label), type, label); + else + CASE_HIGH_SEEN (label) = 0; + } + + return 0; +} + +/* Handle -Wswitch*. Called from the front end after parsing the + switch construct. */ +/* ??? Should probably be somewhere generic, since other languages + besides C and C++ would want this. At the moment, however, C/C++ + are the only tree-ssa languages that support enumerations at all, + so the point is moot. */ + +void +c_do_switch_warnings (splay_tree cases, location_t switch_location, + tree type, tree cond) +{ + splay_tree_node default_node; + splay_tree_node node; + tree chain; + + if (!warn_switch && !warn_switch_enum && !warn_switch_default) + return; + + default_node = splay_tree_lookup (cases, (splay_tree_key) NULL); + if (!default_node) + warning (OPT_Wswitch_default, "%Hswitch missing default case", + &switch_location); + + /* From here on, we only care about about enumerated types. */ + if (!type || TREE_CODE (type) != ENUMERAL_TYPE) + return; + + /* If the switch expression was an enumerated type, check that + exactly all enumeration literals are covered by the cases. + The check is made when -Wswitch was specified and there is no + default case, or when -Wswitch-enum was specified. */ + + if (!warn_switch_enum + && !(warn_switch && !default_node)) + return; + + /* Clearing COND if it is not an integer constant simplifies + the tests inside the loop below. */ + if (TREE_CODE (cond) != INTEGER_CST) + cond = NULL_TREE; + + /* The time complexity here is O(N*lg(N)) worst case, but for the + common case of monotonically increasing enumerators, it is + O(N), since the nature of the splay tree will keep the next + element adjacent to the root at all times. */ + + for (chain = TYPE_VALUES (type); chain; chain = TREE_CHAIN (chain)) + { + tree value = TREE_VALUE (chain); + node = splay_tree_lookup (cases, (splay_tree_key) value); + if (node) + { + /* Mark the CASE_LOW part of the case entry as seen. */ + tree label = (tree) node->value; + CASE_LOW_SEEN (label) = 1; + continue; + } + + /* Even though there wasn't an exact match, there might be a + case range which includes the enumator's value. */ + node = splay_tree_predecessor (cases, (splay_tree_key) value); + if (node && CASE_HIGH ((tree) node->value)) + { + tree label = (tree) node->value; + int cmp = tree_int_cst_compare (CASE_HIGH (label), value); + if (cmp >= 0) + { + /* If we match the upper bound exactly, mark the CASE_HIGH + part of the case entry as seen. */ + if (cmp == 0) + CASE_HIGH_SEEN (label) = 1; + continue; + } + } + + /* We've now determined that this enumerated literal isn't + handled by the case labels of the switch statement. */ + + /* If the switch expression is a constant, we only really care + about whether that constant is handled by the switch. */ + if (cond && tree_int_cst_compare (cond, value)) + continue; + + warning (0, "%Henumeration value %qE not handled in switch", + &switch_location, TREE_PURPOSE (chain)); + } + + /* Warn if there are case expressions that don't correspond to + enumerators. This can occur since C and C++ don't enforce + type-checking of assignments to enumeration variables. + + The time complexity here is now always O(N) worst case, since + we should have marked both the lower bound and upper bound of + every disjoint case label, with CASE_LOW_SEEN and CASE_HIGH_SEEN + above. This scan also resets those fields. */ + splay_tree_foreach (cases, match_case_to_enum, type); } /* Finish an expression taking the address of LABEL (an @@ -4037,7 +3965,6 @@ finish_label_address_expr (tree label) { TREE_USED (label) = 1; result = build1 (ADDR_EXPR, ptr_type_node, label); - TREE_CONSTANT (result) = 1; /* The current function in not necessarily uninlinable. Computed gotos are incompatible with inlining, but the value here could be used only in a diagnostic, for example. */ @@ -4047,96 +3974,17 @@ finish_label_address_expr (tree label) } /* Hook used by expand_expr to expand language-specific tree codes. */ +/* The only things that should go here are bits needed to expand + constant initializers. Everything else should be handled by the + gimplification routines. */ rtx -c_expand_expr (tree exp, rtx target, enum machine_mode tmode, +c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier /* Actually enum_modifier. */, rtx *alt_rtl) { switch (TREE_CODE (exp)) { - case STMT_EXPR: - { - tree rtl_expr; - rtx result; - bool preserve_result = false; - - if (STMT_EXPR_WARN_UNUSED_RESULT (exp) && target == const0_rtx) - { - tree stmt = STMT_EXPR_STMT (exp); - tree scope; - - for (scope = COMPOUND_BODY (stmt); - scope && TREE_CODE (scope) != SCOPE_STMT; - scope = TREE_CHAIN (scope)); - - if (scope && SCOPE_STMT_BLOCK (scope)) - warning ("%Hignoring return value of `%D', " - "declared with attribute warn_unused_result", - &expr_wfl_stack->location, - BLOCK_ABSTRACT_ORIGIN (SCOPE_STMT_BLOCK (scope))); - else - warning ("%Hignoring return value of function " - "declared with attribute warn_unused_result", - &expr_wfl_stack->location); - } - - /* Since expand_expr_stmt calls free_temp_slots after every - expression statement, we must call push_temp_slots here. - Otherwise, any temporaries in use now would be considered - out-of-scope after the first EXPR_STMT from within the - STMT_EXPR. */ - push_temp_slots (); - rtl_expr = expand_start_stmt_expr (!STMT_EXPR_NO_SCOPE (exp)); - - /* If we want the result of this expression, find the last - EXPR_STMT in the COMPOUND_STMT and mark it as addressable. */ - if (target != const0_rtx - && TREE_CODE (STMT_EXPR_STMT (exp)) == COMPOUND_STMT - && TREE_CODE (COMPOUND_BODY (STMT_EXPR_STMT (exp))) == SCOPE_STMT) - { - tree expr = COMPOUND_BODY (STMT_EXPR_STMT (exp)); - tree last = TREE_CHAIN (expr); - - while (TREE_CHAIN (last)) - { - expr = last; - last = TREE_CHAIN (last); - } - - if (TREE_CODE (last) == SCOPE_STMT - && TREE_CODE (expr) == EXPR_STMT) - { - /* Otherwise, note that we want the value from the last - expression. */ - TREE_ADDRESSABLE (expr) = 1; - preserve_result = true; - } - } - - expand_stmt (STMT_EXPR_STMT (exp)); - expand_end_stmt_expr (rtl_expr); - - result = expand_expr_real (rtl_expr, target, tmode, modifier, alt_rtl); - if (preserve_result && GET_CODE (result) == MEM) - { - if (GET_MODE (result) != BLKmode) - result = copy_to_reg (result); - else - preserve_temp_slots (result); - } - - /* If the statment-expression does not have a scope, then the - new temporaries we created within it must live beyond the - statement-expression. */ - if (STMT_EXPR_NO_SCOPE (exp)) - preserve_temp_slots (NULL_RTX); - - pop_temp_slots (); - return result; - } - break; - case COMPOUND_LITERAL_EXPR: { /* Initialize the anonymous variable declared in the compound @@ -4147,63 +3995,18 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, } default: - abort (); + gcc_unreachable (); } - - abort (); - return NULL; -} - -/* Hook used by safe_from_p to handle language-specific tree codes. */ - -int -c_safe_from_p (rtx target, tree exp) -{ - /* We can see statements here when processing the body of a - statement-expression. For a declaration statement declaring a - variable, look at the variable's initializer. */ - if (TREE_CODE (exp) == DECL_STMT) - { - tree decl = DECL_STMT_DECL (exp); - - if (TREE_CODE (decl) == VAR_DECL - && DECL_INITIAL (decl) - && !safe_from_p (target, DECL_INITIAL (decl), /*top_p=*/0)) - return 0; - } - - /* For any statement, we must follow the statement-chain. */ - if (STATEMENT_CODE_P (TREE_CODE (exp)) && TREE_CHAIN (exp)) - return safe_from_p (target, TREE_CHAIN (exp), /*top_p=*/0); - - /* Assume everything else is safe. */ - return 1; -} - -/* Hook used by unsafe_for_reeval to handle language-specific tree codes. */ - -int -c_common_unsafe_for_reeval (tree exp) -{ - /* Statement expressions may not be reevaluated, likewise compound - literals. */ - if (TREE_CODE (exp) == STMT_EXPR - || TREE_CODE (exp) == COMPOUND_LITERAL_EXPR) - return 2; - - /* Walk all other expressions. */ - return -1; } /* Hook used by staticp to handle language-specific tree codes. */ -int +tree c_staticp (tree exp) { - if (TREE_CODE (exp) == COMPOUND_LITERAL_EXPR - && TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (exp))) - return 1; - return 0; + return (TREE_CODE (exp) == COMPOUND_LITERAL_EXPR + && TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (exp)) + ? exp : NULL); } @@ -4220,25 +4023,27 @@ boolean_increment (enum tree_code code, tree arg) switch (code) { case PREINCREMENT_EXPR: - val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res); + val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res); break; case POSTINCREMENT_EXPR: - val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res); + val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, true_res); arg = save_expr (arg); - val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg); - val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); + val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg); + val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); break; case PREDECREMENT_EXPR: - val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg)); + val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, + invert_truthvalue (arg)); break; case POSTDECREMENT_EXPR: - val = build (MODIFY_EXPR, TREE_TYPE (arg), arg, invert_truthvalue (arg)); + val = build2 (MODIFY_EXPR, TREE_TYPE (arg), arg, + invert_truthvalue (arg)); arg = save_expr (arg); - val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg); - val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); + val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), val, arg); + val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); break; default: - abort (); + gcc_unreachable (); } TREE_SIDE_EFFECTS (val) = 1; return val; @@ -4253,16 +4058,18 @@ c_stddef_cpp_builtins(void) builtin_define_with_value ("__PTRDIFF_TYPE__", PTRDIFF_TYPE, 0); builtin_define_with_value ("__WCHAR_TYPE__", MODIFIED_WCHAR_TYPE, 0); builtin_define_with_value ("__WINT_TYPE__", WINT_TYPE, 0); + builtin_define_with_value ("__INTMAX_TYPE__", INTMAX_TYPE, 0); + builtin_define_with_value ("__UINTMAX_TYPE__", UINTMAX_TYPE, 0); } static void c_init_attributes (void) { /* Fill in the built_in_attributes array. */ -#define DEF_ATTR_NULL_TREE(ENUM) \ +#define DEF_ATTR_NULL_TREE(ENUM) \ built_in_attributes[(int) ENUM] = NULL_TREE; -#define DEF_ATTR_INT(ENUM, VALUE) \ - built_in_attributes[(int) ENUM] = build_int_2 (VALUE, VALUE < 0 ? -1 : 0); +#define DEF_ATTR_INT(ENUM, VALUE) \ + built_in_attributes[(int) ENUM] = build_int_cst (NULL_TREE, VALUE); #define DEF_ATTR_IDENT(ENUM, STRING) \ built_in_attributes[(int) ENUM] = get_identifier (STRING); #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \ @@ -4283,39 +4090,31 @@ c_init_attributes (void) struct attribute_spec.handler. */ static tree -handle_packed_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, +handle_packed_attribute (tree *node, tree name, tree ARG_UNUSED (args), int flags, bool *no_add_attrs) { if (TYPE_P (*node)) { if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - *node = build_type_copy (*node); + *node = build_variant_type_copy (*node); TYPE_PACKED (*node) = 1; - if (TYPE_MAIN_VARIANT (*node) == *node) - { - /* If it is the main variant, then pack the other variants - too. This happens in, - - struct Foo { - struct Foo const *ptr; // creates a variant w/o packed flag - } __ attribute__((packed)); // packs it now. - */ - tree probe; - - for (probe = *node; probe; probe = TYPE_NEXT_VARIANT (probe)) - TYPE_PACKED (probe) = 1; - } - } else if (TREE_CODE (*node) == FIELD_DECL) - DECL_PACKED (*node) = 1; + { + if (TYPE_ALIGN (TREE_TYPE (*node)) <= BITS_PER_UNIT) + warning (OPT_Wattributes, + "%qE attribute ignored for field of type %qT", + name, TREE_TYPE (*node)); + else + DECL_PACKED (*node) = 1; + } /* We can't set DECL_PACKED for a VAR_DECL, because the bit is used for DECL_REGISTER. It wouldn't mean anything anyway. We can't set DECL_PACKED on the type of a TYPE_DECL, because that changes what the typedef is typing. */ else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4327,14 +4126,14 @@ handle_packed_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, static tree handle_nocommon_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == VAR_DECL) DECL_COMMON (*node) = 0; else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4345,14 +4144,14 @@ handle_nocommon_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -handle_common_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == VAR_DECL) DECL_COMMON (*node) = 1; else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4363,8 +4162,8 @@ handle_common_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, struct attribute_spec.handler. */ static tree -handle_noreturn_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree type = TREE_TYPE (*node); @@ -4376,10 +4175,10 @@ handle_noreturn_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, TREE_TYPE (*node) = build_pointer_type (build_type_variant (TREE_TYPE (type), - TREE_READONLY (TREE_TYPE (type)), 1)); + TYPE_READONLY (TREE_TYPE (type)), 1)); else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4391,14 +4190,14 @@ handle_noreturn_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, static tree handle_noinline_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) DECL_UNINLINABLE (*node) = 1; else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4410,8 +4209,8 @@ handle_noinline_attribute (tree *node, tree name, static tree handle_always_inline_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) @@ -4421,19 +4220,64 @@ handle_always_inline_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } return NULL_TREE; } +/* Handle a "gnu_inline" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_gnu_inline_attribute (tree *node, tree name, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (*node)) + { + /* Do nothing else, just set the attribute. We'll get at + it later with lookup_attribute. */ + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +/* Handle a "flatten" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_flatten_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + /* Do nothing else, just set the attribute. We'll get at + it later with lookup_attribute. */ + ; + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + + /* Handle a "used" attribute; arguments as in struct attribute_spec.handler. */ static tree -handle_used_attribute (tree *pnode, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree node = *pnode; @@ -4441,10 +4285,11 @@ handle_used_attribute (tree *pnode, tree name, tree args ATTRIBUTE_UNUSED, || (TREE_CODE (node) == VAR_DECL && TREE_STATIC (node))) { TREE_USED (node) = 1; + DECL_PRESERVE_P (node) = 1; } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4455,8 +4300,8 @@ handle_used_attribute (tree *pnode, tree name, tree args ATTRIBUTE_UNUSED, struct attribute_spec.handler. */ static tree -handle_unused_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_unused_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int flags, bool *no_add_attrs) { if (DECL_P (*node)) { @@ -4470,26 +4315,56 @@ handle_unused_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, TREE_USED (decl) = 1; else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } } else { if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - *node = build_type_copy (*node); + *node = build_variant_type_copy (*node); TREE_USED (*node) = 1; } return NULL_TREE; } +/* Handle a "externally_visible" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_externally_visible_attribute (tree *pnode, tree name, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + tree node = *pnode; + + if (TREE_CODE (node) == FUNCTION_DECL || TREE_CODE (node) == VAR_DECL) + { + if ((!TREE_STATIC (node) && TREE_CODE (node) != FUNCTION_DECL + && !DECL_EXTERNAL (node)) || !TREE_PUBLIC (node)) + { + warning (OPT_Wattributes, + "%qE attribute have effect only on public objects", name); + *no_add_attrs = true; + } + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "const" attribute; arguments as in struct attribute_spec.handler. */ static tree -handle_const_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree type = TREE_TYPE (*node); @@ -4504,7 +4379,7 @@ handle_const_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, TREE_THIS_VOLATILE (TREE_TYPE (type)))); else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4516,42 +4391,46 @@ handle_const_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, static tree handle_transparent_union_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, int flags, + tree ARG_UNUSED (args), int flags, bool *no_add_attrs) { - tree decl = NULL_TREE; - tree *type = NULL; - int is_type = 0; + tree type = NULL; + + *no_add_attrs = true; if (DECL_P (*node)) { - decl = *node; - type = &TREE_TYPE (decl); - is_type = TREE_CODE (*node) == TYPE_DECL; + if (TREE_CODE (*node) != TYPE_DECL) + goto ignored; + node = &TREE_TYPE (*node); + type = *node; } else if (TYPE_P (*node)) - type = node, is_type = 1; - - if (is_type - && TREE_CODE (*type) == UNION_TYPE - && (decl == 0 - || (TYPE_FIELDS (*type) != 0 - && TYPE_MODE (*type) == DECL_MODE (TYPE_FIELDS (*type))))) - { - if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - *type = build_type_copy (*type); - TYPE_TRANSPARENT_UNION (*type) = 1; - } - else if (decl != 0 && TREE_CODE (decl) == PARM_DECL - && TREE_CODE (*type) == UNION_TYPE - && TYPE_MODE (*type) == DECL_MODE (TYPE_FIELDS (*type))) - DECL_TRANSPARENT_UNION (decl) = 1; + type = *node; else + goto ignored; + + if (TREE_CODE (type) == UNION_TYPE) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - *no_add_attrs = true; + /* When IN_PLACE is set, leave the check for FIELDS and MODE to + the code in finish_struct. */ + if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + { + if (TYPE_FIELDS (type) == NULL_TREE + || TYPE_MODE (type) != DECL_MODE (TYPE_FIELDS (type))) + goto ignored; + + /* A type variant isn't good enough, since we don't a cast + to such a type removed as a no-op. */ + *node = type = build_duplicate_type (type); + } + + TYPE_TRANSPARENT_UNION (type) = 1; + return NULL_TREE; } + ignored: + warning (OPT_Wattributes, "%qE attribute ignored", name); return NULL_TREE; } @@ -4560,8 +4439,8 @@ handle_transparent_union_attribute (tree *node, tree name, static tree handle_constructor_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; @@ -4576,7 +4455,7 @@ handle_constructor_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4588,8 +4467,8 @@ handle_constructor_attribute (tree *node, tree name, static tree handle_destructor_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; @@ -4604,7 +4483,7 @@ handle_destructor_attribute (tree *node, tree name, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4615,15 +4494,15 @@ handle_destructor_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_mode_attribute (tree *node, tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) { tree type = *node; *no_add_attrs = true; if (TREE_CODE (TREE_VALUE (args)) != IDENTIFIER_NODE) - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); else { int j; @@ -4631,12 +4510,12 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, int len = strlen (p); enum machine_mode mode = VOIDmode; tree typefm; - tree ptr_type; + bool valid_mode; if (len > 4 && p[0] == '_' && p[1] == '_' && p[len - 1] == '_' && p[len - 2] == '_') { - char *newp = alloca (len - 1); + char *newp = (char *) alloca (len - 1); strcpy (newp, &p[2]); newp[len - 4] = '\0'; @@ -4645,11 +4524,11 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, /* Change this type to have a type with the specified mode. First check for the special modes. */ - if (! strcmp (p, "byte")) + if (!strcmp (p, "byte")) mode = byte_mode; else if (!strcmp (p, "word")) mode = word_mode; - else if (! strcmp (p, "pointer")) + else if (!strcmp (p, "pointer")) mode = ptr_mode; else for (j = 0; j < NUM_MACHINE_MODES; j++) @@ -4660,76 +4539,107 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, } if (mode == VOIDmode) - error ("unknown machine mode `%s'", p); - else if (0 == (typefm = (*lang_hooks.types.type_for_mode) - (mode, TREE_UNSIGNED (type)))) - error ("no data type for mode `%s'", p); - else if ((TREE_CODE (type) == POINTER_TYPE - || TREE_CODE (type) == REFERENCE_TYPE) - && !(*targetm.valid_pointer_mode) (mode)) - error ("invalid pointer mode `%s'", p); - else { - /* If this is a vector, make sure we either have hardware - support, or we can emulate it. */ - if (VECTOR_MODE_P (mode) && !vector_mode_valid_p (mode)) + error ("unknown machine mode %qs", p); + return NULL_TREE; + } + + valid_mode = false; + switch (GET_MODE_CLASS (mode)) + { + case MODE_INT: + case MODE_PARTIAL_INT: + case MODE_FLOAT: + case MODE_DECIMAL_FLOAT: + valid_mode = targetm.scalar_mode_supported_p (mode); + break; + + case MODE_COMPLEX_INT: + case MODE_COMPLEX_FLOAT: + valid_mode = targetm.scalar_mode_supported_p (GET_MODE_INNER (mode)); + break; + + case MODE_VECTOR_INT: + case MODE_VECTOR_FLOAT: + warning (OPT_Wattributes, "specifying vector types with " + "__attribute__ ((mode)) is deprecated"); + warning (OPT_Wattributes, + "use __attribute__ ((vector_size)) instead"); + valid_mode = vector_mode_valid_p (mode); + break; + + default: + break; + } + if (!valid_mode) + { + error ("unable to emulate %qs", p); + return NULL_TREE; + } + + if (POINTER_TYPE_P (type)) + { + tree (*fn)(tree, enum machine_mode, bool); + + if (!targetm.valid_pointer_mode (mode)) { - error ("unable to emulate '%s'", GET_MODE_NAME (mode)); + error ("invalid pointer mode %qs", p); return NULL_TREE; } if (TREE_CODE (type) == POINTER_TYPE) - { - ptr_type = build_pointer_type_for_mode (TREE_TYPE (type), - mode); - *node = ptr_type; - } - else if (TREE_CODE (type) == REFERENCE_TYPE) - { - ptr_type = build_reference_type_for_mode (TREE_TYPE (type), - mode); - *node = ptr_type; - } - else if (TREE_CODE (type) == ENUMERAL_TYPE) - { - /* For enumeral types, copy the precision from the integer - type returned above. If not an INTEGER_TYPE, we can't use - this mode for this type. */ - if (TREE_CODE (typefm) != INTEGER_TYPE) - { - error ("cannot use mode %qs for enumeral types", p); - return NULL_TREE; - } + fn = build_pointer_type_for_mode; + else + fn = build_reference_type_for_mode; + typefm = fn (TREE_TYPE (type), mode, false); + } + else + typefm = lang_hooks.types.type_for_mode (mode, TYPE_UNSIGNED (type)); - if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - type = build_type_copy (type); - - /* We cannot use layout_type here, because that will attempt - to re-layout all variants, corrupting our original. */ - TYPE_PRECISION (type) = TYPE_PRECISION (typefm); - TYPE_MIN_VALUE (type) = TYPE_MIN_VALUE (typefm); - TYPE_MAX_VALUE (type) = TYPE_MAX_VALUE (typefm); - TYPE_SIZE (type) = TYPE_SIZE (typefm); - TYPE_SIZE_UNIT (type) = TYPE_SIZE_UNIT (typefm); - TYPE_MODE (type) = TYPE_MODE (typefm); - if (!TYPE_USER_ALIGN (type)) - TYPE_ALIGN (type) = TYPE_ALIGN (typefm); - - *node = type; - } - else if (VECTOR_MODE_P (mode) - ? TREE_CODE (type) != TREE_CODE (TREE_TYPE (typefm)) - : TREE_CODE (type) != TREE_CODE (typefm)) - + if (typefm == NULL_TREE) + { + error ("no data type for mode %qs", p); + return NULL_TREE; + } + else if (TREE_CODE (type) == ENUMERAL_TYPE) + { + /* For enumeral types, copy the precision from the integer + type returned above. If not an INTEGER_TYPE, we can't use + this mode for this type. */ + if (TREE_CODE (typefm) != INTEGER_TYPE) { - error ("mode `%s' applied to inappropriate type", p); + error ("cannot use mode %qs for enumeral types", p); return NULL_TREE; } - else - *node = typefm; - /* No need to layout the type here. The caller should do this. */ + if (flags & ATTR_FLAG_TYPE_IN_PLACE) + { + TYPE_PRECISION (type) = TYPE_PRECISION (typefm); + typefm = type; + } + else + { + /* We cannot build a type variant, as there's code that assumes + that TYPE_MAIN_VARIANT has the same mode. This includes the + debug generators. Instead, create a subrange type. This + results in all of the enumeral values being emitted only once + in the original, and the subtype gets them by reference. */ + if (TYPE_UNSIGNED (type)) + typefm = make_unsigned_type (TYPE_PRECISION (typefm)); + else + typefm = make_signed_type (TYPE_PRECISION (typefm)); + TREE_TYPE (typefm) = type; + } } + else if (VECTOR_MODE_P (mode) + ? TREE_CODE (type) != TREE_CODE (TREE_TYPE (typefm)) + : TREE_CODE (type) != TREE_CODE (typefm)) + { + error ("mode %qs applied to inappropriate type", p); + return NULL_TREE; + } + + *node = typefm; } return NULL_TREE; @@ -4739,23 +4649,25 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, struct attribute_spec.handler. */ static tree -handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; if (targetm.have_named_sections) { + user_defined_section_attribute = true; + if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL) && TREE_CODE (TREE_VALUE (args)) == STRING_CST) { if (TREE_CODE (decl) == VAR_DECL && current_function_decl != NULL_TREE - && ! TREE_STATIC (decl)) + && !TREE_STATIC (decl)) { error ("%Jsection attribute cannot be specified for " - "local variables", decl); + "local variables", decl); *no_add_attrs = true; } @@ -4765,8 +4677,8 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, && strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)), TREE_STRING_POINTER (TREE_VALUE (args))) != 0) { - error ("%Jsection of '%D' conflicts with previous declaration", - *node, *node); + error ("section of %q+D conflicts with previous declaration", + *node); *no_add_attrs = true; } else @@ -4774,7 +4686,7 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, } else { - error ("%Jsection attribute not allowed for '%D'", *node, *node); + error ("section attribute not allowed for %q+D", *node); *no_add_attrs = true; } } @@ -4791,7 +4703,7 @@ handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, struct attribute_spec.handler. */ static tree -handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, +handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args, int flags, bool *no_add_attrs) { tree decl = NULL_TREE; @@ -4810,12 +4722,6 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, else if (TYPE_P (*node)) type = node, is_type = 1; - /* Strip any NOPs of any kind. */ - while (TREE_CODE (align_expr) == NOP_EXPR - || TREE_CODE (align_expr) == CONVERT_EXPR - || TREE_CODE (align_expr) == NON_LVALUE_EXPR) - align_expr = TREE_OPERAND (align_expr, 0); - if (TREE_CODE (align_expr) != INTEGER_CST) { error ("requested alignment is not a constant"); @@ -4839,14 +4745,14 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, && DECL_ORIGINAL_TYPE (decl) == NULL_TREE) { tree tt = TREE_TYPE (decl); - *type = build_type_copy (*type); + *type = build_variant_type_copy (*type); DECL_ORIGINAL_TYPE (decl) = tt; TYPE_NAME (*type) = decl; TREE_USED (*type) = TREE_USED (decl); TREE_TYPE (decl) = *type; } else if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - *type = build_type_copy (*type); + *type = build_variant_type_copy (*type); TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT; TYPE_USER_ALIGN (*type) = 1; @@ -4854,7 +4760,7 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, else if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FIELD_DECL) { - error ("%Jalignment may not be specified for '%D'", decl, decl); + error ("alignment may not be specified for %q+D", decl); *no_add_attrs = true; } else @@ -4870,12 +4776,17 @@ handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, struct attribute_spec.handler. */ static tree -handle_weak_attribute (tree *node, tree name ATTRIBUTE_UNUSED, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, - bool *no_add_attrs ATTRIBUTE_UNUSED) +handle_weak_attribute (tree *node, tree name, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), + bool * ARG_UNUSED (no_add_attrs)) { - declare_weak (*node); + if (TREE_CODE (*node) == FUNCTION_DECL + || TREE_CODE (*node) == VAR_DECL) + declare_weak (*node); + else + warning (OPT_Wattributes, "%qE attribute ignored", name); + return NULL_TREE; } @@ -4885,24 +4796,35 @@ handle_weak_attribute (tree *node, tree name ATTRIBUTE_UNUSED, static tree handle_alias_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; if ((TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl)) - || (TREE_CODE (decl) != FUNCTION_DECL && ! DECL_EXTERNAL (decl))) + || (TREE_CODE (decl) != FUNCTION_DECL + && TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) + /* A static variable declaration is always a tentative definition, + but the alias is a non-tentative definition which overrides. */ + || (TREE_CODE (decl) != FUNCTION_DECL + && ! TREE_PUBLIC (decl) && DECL_INITIAL (decl))) { - error ("%J'%D' defined both normally and as an alias", decl, decl); + error ("%q+D defined both normally and as an alias", decl); *no_add_attrs = true; } - else if (decl_function_context (decl) == 0) + + /* Note that the very first time we process a nested declaration, + decl_function_context will not be set. Indeed, *would* never + be set except for the DECL_INITIAL/DECL_EXTERNAL frobbery that + we do below. After such frobbery, pushdecl would set the context. + In any case, this is never what we want. */ + else if (decl_function_context (decl) == 0 && current_function_decl == NULL) { tree id; id = TREE_VALUE (args); if (TREE_CODE (id) != STRING_CST) { - error ("alias arg not a string"); + error ("alias argument not a string"); *no_add_attrs = true; return NULL_TREE; } @@ -4913,92 +4835,238 @@ handle_alias_attribute (tree *node, tree name, tree args, if (TREE_CODE (decl) == FUNCTION_DECL) DECL_INITIAL (decl) = error_mark_node; else - DECL_EXTERNAL (decl) = 0; + { + if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) + DECL_EXTERNAL (decl) = 1; + else + DECL_EXTERNAL (decl) = 0; + TREE_STATIC (decl) = 1; + } } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } return NULL_TREE; } +/* Handle a "weakref" attribute; arguments as in struct + attribute_spec.handler. */ + +static tree +handle_weakref_attribute (tree *node, tree ARG_UNUSED (name), tree args, + int flags, bool *no_add_attrs) +{ + tree attr = NULL_TREE; + + /* We must ignore the attribute when it is associated with + local-scoped decls, since attribute alias is ignored and many + such symbols do not even have a DECL_WEAK field. */ + if (decl_function_context (*node) || current_function_decl) + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + return NULL_TREE; + } + + /* The idea here is that `weakref("name")' mutates into `weakref, + alias("name")', and weakref without arguments, in turn, + implicitly adds weak. */ + + if (args) + { + attr = tree_cons (get_identifier ("alias"), args, attr); + attr = tree_cons (get_identifier ("weakref"), NULL_TREE, attr); + + *no_add_attrs = true; + + decl_attributes (node, attr, flags); + } + else + { + if (lookup_attribute ("alias", DECL_ATTRIBUTES (*node))) + error ("%Jweakref attribute must appear before alias attribute", + *node); + + /* Can't call declare_weak because it wants this to be TREE_PUBLIC, + and that isn't supported; and because it wants to add it to + the list of weak decls, which isn't helpful. */ + DECL_WEAK (*node) = 1; + } + + return NULL_TREE; +} + /* Handle an "visibility" attribute; arguments as in struct attribute_spec.handler. */ static tree handle_visibility_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, - bool *no_add_attrs) + int ARG_UNUSED (flags), + bool *ARG_UNUSED (no_add_attrs)) { tree decl = *node; tree id = TREE_VALUE (args); + enum symbol_visibility vis; - *no_add_attrs = true; - - if (decl_function_context (decl) != 0 || ! TREE_PUBLIC (decl)) + if (TYPE_P (*node)) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + if (TREE_CODE (*node) == ENUMERAL_TYPE) + /* OK */; + else if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE) + { + warning (OPT_Wattributes, "%qE attribute ignored on non-class types", + name); + return NULL_TREE; + } + else if (TYPE_FIELDS (*node)) + { + error ("%qE attribute ignored because %qT is already defined", + name, *node); + return NULL_TREE; + } + } + else if (decl_function_context (decl) != 0 || !TREE_PUBLIC (decl)) + { + warning (OPT_Wattributes, "%qE attribute ignored", name); return NULL_TREE; } if (TREE_CODE (id) != STRING_CST) { - error ("visibility arg not a string"); + error ("visibility argument not a string"); return NULL_TREE; } + /* If this is a type, set the visibility on the type decl. */ + if (TYPE_P (decl)) + { + decl = TYPE_NAME (decl); + if (!decl) + return NULL_TREE; + if (TREE_CODE (decl) == IDENTIFIER_NODE) + { + warning (OPT_Wattributes, "%qE attribute ignored on types", + name); + return NULL_TREE; + } + } + if (strcmp (TREE_STRING_POINTER (id), "default") == 0) - DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + vis = VISIBILITY_DEFAULT; else if (strcmp (TREE_STRING_POINTER (id), "internal") == 0) - DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL; + vis = VISIBILITY_INTERNAL; else if (strcmp (TREE_STRING_POINTER (id), "hidden") == 0) - DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + vis = VISIBILITY_HIDDEN; else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0) - DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED; + vis = VISIBILITY_PROTECTED; else - error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); + { + error ("visibility argument must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); + vis = VISIBILITY_DEFAULT; + } + + if (DECL_VISIBILITY_SPECIFIED (decl) + && vis != DECL_VISIBILITY (decl) + && lookup_attribute ("visibility", (TYPE_P (*node) + ? TYPE_ATTRIBUTES (*node) + : DECL_ATTRIBUTES (decl)))) + error ("%qD redeclared with different visibility", decl); + + DECL_VISIBILITY (decl) = vis; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + + /* Go ahead and attach the attribute to the node as well. This is needed + so we can determine whether we have VISIBILITY_DEFAULT because the + visibility was not specified, or because it was explicitly overridden + from the containing scope. */ return NULL_TREE; } +/* Determine the ELF symbol visibility for DECL, which is either a + variable or a function. It is an error to use this function if a + definition of DECL is not available in this translation unit. + Returns true if the final visibility has been determined by this + function; false if the caller is free to make additional + modifications. */ + +bool +c_determine_visibility (tree decl) +{ + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL); + + /* If the user explicitly specified the visibility with an + attribute, honor that. DECL_VISIBILITY will have been set during + the processing of the attribute. We check for an explicit + attribute, rather than just checking DECL_VISIBILITY_SPECIFIED, + to distinguish the use of an attribute from the use of a "#pragma + GCC visibility push(...)"; in the latter case we still want other + considerations to be able to overrule the #pragma. */ + if (lookup_attribute ("visibility", DECL_ATTRIBUTES (decl))) + return true; + + /* Anything that is exported must have default visibility. */ + if (TARGET_DLLIMPORT_DECL_ATTRIBUTES + && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl))) + { + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + return true; + } + + /* Set default visibility to whatever the user supplied with + visibility_specified depending on #pragma GCC visibility. */ + if (!DECL_VISIBILITY_SPECIFIED (decl)) + { + DECL_VISIBILITY (decl) = default_visibility; + DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma; + } + return false; +} + /* Handle an "tls_model" attribute; arguments as in struct attribute_spec.handler. */ static tree handle_tls_model_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + int ARG_UNUSED (flags), bool *no_add_attrs) { + tree id; tree decl = *node; + enum tls_model kind; - if (! DECL_THREAD_LOCAL (decl)) + *no_add_attrs = true; + + if (!DECL_THREAD_LOCAL_P (decl)) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - *no_add_attrs = true; + warning (OPT_Wattributes, "%qE attribute ignored", name); + return NULL_TREE; } + + kind = DECL_TLS_MODEL (decl); + id = TREE_VALUE (args); + if (TREE_CODE (id) != STRING_CST) + { + error ("tls_model argument not a string"); + return NULL_TREE; + } + + if (!strcmp (TREE_STRING_POINTER (id), "local-exec")) + kind = TLS_MODEL_LOCAL_EXEC; + else if (!strcmp (TREE_STRING_POINTER (id), "initial-exec")) + kind = TLS_MODEL_INITIAL_EXEC; + else if (!strcmp (TREE_STRING_POINTER (id), "local-dynamic")) + kind = optimize ? TLS_MODEL_LOCAL_DYNAMIC : TLS_MODEL_GLOBAL_DYNAMIC; + else if (!strcmp (TREE_STRING_POINTER (id), "global-dynamic")) + kind = TLS_MODEL_GLOBAL_DYNAMIC; else - { - tree id; - - id = TREE_VALUE (args); - if (TREE_CODE (id) != STRING_CST) - { - error ("tls_model arg not a string"); - *no_add_attrs = true; - return NULL_TREE; - } - if (strcmp (TREE_STRING_POINTER (id), "local-exec") - && strcmp (TREE_STRING_POINTER (id), "initial-exec") - && strcmp (TREE_STRING_POINTER (id), "local-dynamic") - && strcmp (TREE_STRING_POINTER (id), "global-dynamic")) - { - error ("tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\""); - *no_add_attrs = true; - return NULL_TREE; - } - } + error ("tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\""); + DECL_TLS_MODEL (decl) = kind; return NULL_TREE; } @@ -5007,20 +5075,20 @@ handle_tls_model_attribute (tree *node, tree name, tree args, static tree handle_no_instrument_function_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; if (TREE_CODE (decl) != FUNCTION_DECL) { - error ("%J'%E' attribute applies only to functions", decl, name); + error ("%J%qE attribute applies only to functions", decl, name); *no_add_attrs = true; } else if (DECL_INITIAL (decl)) { - error ("%Jcan't set '%E' attribute after definition", decl, name); + error ("%Jcan%'t set %qE attribute after definition", decl, name); *no_add_attrs = true; } else @@ -5033,15 +5101,33 @@ handle_no_instrument_function_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -handle_malloc_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { - if (TREE_CODE (*node) == FUNCTION_DECL) + if (TREE_CODE (*node) == FUNCTION_DECL + && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node)))) DECL_IS_MALLOC (*node) = 1; - /* ??? TODO: Support types. */ else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +/* Handle a "returns_twice" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + DECL_IS_RETURNS_TWICE (*node) = 1; + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -5053,20 +5139,20 @@ handle_malloc_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, static tree handle_no_limit_stack_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; if (TREE_CODE (decl) != FUNCTION_DECL) { - error ("%J'%E' attribute applies only to functions", decl, name); + error ("%J%qE attribute applies only to functions", decl, name); *no_add_attrs = true; } else if (DECL_INITIAL (decl)) { - error ("%Jcan't set '%E' attribute after definition", decl, name); + error ("%Jcan%'t set %qE attribute after definition", decl, name); *no_add_attrs = true; } else @@ -5079,32 +5165,45 @@ handle_no_limit_stack_attribute (tree *node, tree name, struct attribute_spec.handler. */ static tree -handle_pure_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) DECL_IS_PURE (*node) = 1; /* ??? TODO: Support types. */ else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } return NULL_TREE; } +/* Handle a "no vops" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_novops_attribute (tree *node, tree ARG_UNUSED (name), + tree ARG_UNUSED (args), int ARG_UNUSED (flags), + bool *ARG_UNUSED (no_add_attrs)) +{ + gcc_assert (TREE_CODE (*node) == FUNCTION_DECL); + DECL_IS_NOVOPS (*node) = 1; + return NULL_TREE; +} + /* Handle a "deprecated" attribute; arguments as in struct attribute_spec.handler. */ static tree handle_deprecated_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, int flags, + tree ARG_UNUSED (args), int flags, bool *no_add_attrs) { tree type = NULL_TREE; int warn = 0; - const char *what = NULL; + tree what = NULL_TREE; if (DECL_P (*node)) { @@ -5123,7 +5222,7 @@ handle_deprecated_attribute (tree *node, tree name, else if (TYPE_P (*node)) { if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) - *node = build_type_copy (*node); + *node = build_variant_type_copy (*node); TREE_DEPRECATED (*node) = 1; type = *node; } @@ -5136,52 +5235,44 @@ handle_deprecated_attribute (tree *node, tree name, if (type && TYPE_NAME (type)) { if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - what = IDENTIFIER_POINTER (TYPE_NAME (*node)); + what = TYPE_NAME (*node); else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && DECL_NAME (TYPE_NAME (type))) - what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); + what = DECL_NAME (TYPE_NAME (type)); } if (what) - warning ("`%s' attribute ignored for `%s'", - IDENTIFIER_POINTER (name), what); + warning (OPT_Wattributes, "%qE attribute ignored for %qE", name, what); else - warning ("`%s' attribute ignored", - IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); } return NULL_TREE; } -/* Keep a list of vector type nodes we created in handle_vector_size_attribute, - to prevent us from duplicating type nodes unnecessarily. - The normal mechanism to prevent duplicates is to use type_hash_canon, but - since we want to distinguish types that are essentially identical (except - for their debug representation), we use a local list here. */ -static GTY(()) tree vector_type_node_list = 0; - /* Handle a "vector_size" attribute; arguments as in struct attribute_spec.handler. */ static tree handle_vector_size_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, + int ARG_UNUSED (flags), bool *no_add_attrs) { unsigned HOST_WIDE_INT vecsize, nunits; - enum machine_mode mode, orig_mode, new_mode; - tree type = *node, new_type = NULL_TREE; - tree type_list_node; + enum machine_mode orig_mode; + tree type = *node, new_type, size; *no_add_attrs = true; - if (! host_integerp (TREE_VALUE (args), 1)) + size = TREE_VALUE (args); + + if (!host_integerp (size, 1)) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); return NULL_TREE; } /* Get the vector size (in bytes). */ - vecsize = tree_low_cst (TREE_VALUE (args), 1); + vecsize = tree_low_cst (size, 1); /* We need to provide for vector pointers, vector arrays, and functions returning vectors. For example: @@ -5201,99 +5292,37 @@ handle_vector_size_attribute (tree *node, tree name, tree args, orig_mode = TYPE_MODE (type); if (TREE_CODE (type) == RECORD_TYPE - || (GET_MODE_CLASS (orig_mode) != MODE_FLOAT + || TREE_CODE (type) == UNION_TYPE + || TREE_CODE (type) == VECTOR_TYPE + || (!SCALAR_FLOAT_MODE_P (orig_mode) && GET_MODE_CLASS (orig_mode) != MODE_INT) - || ! host_integerp (TYPE_SIZE_UNIT (type), 1)) + || !host_integerp (TYPE_SIZE_UNIT (type), 1)) { - error ("invalid vector type for attribute `%s'", - IDENTIFIER_POINTER (name)); + error ("invalid vector type for attribute %qE", name); return NULL_TREE; } + if (vecsize % tree_low_cst (TYPE_SIZE_UNIT (type), 1)) + { + error ("vector size not an integral multiple of component size"); + return NULL; + } + + if (vecsize == 0) + { + error ("zero vector size"); + return NULL; + } + /* Calculate how many units fit in the vector. */ nunits = vecsize / tree_low_cst (TYPE_SIZE_UNIT (type), 1); - - /* Find a suitably sized vector. */ - new_mode = VOIDmode; - for (mode = GET_CLASS_NARROWEST_MODE (GET_MODE_CLASS (orig_mode) == MODE_INT - ? MODE_VECTOR_INT - : MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if (vecsize == GET_MODE_SIZE (mode) - && nunits == (unsigned HOST_WIDE_INT) GET_MODE_NUNITS (mode)) - { - new_mode = mode; - break; - } - - if (new_mode == VOIDmode) + if (nunits & (nunits - 1)) { - error ("no vector mode with the size and type specified could be found"); + error ("number of components of the vector not a power of two"); return NULL_TREE; } - for (type_list_node = vector_type_node_list; type_list_node; - type_list_node = TREE_CHAIN (type_list_node)) - { - tree other_type = TREE_VALUE (type_list_node); - tree record = TYPE_DEBUG_REPRESENTATION_TYPE (other_type); - tree fields = TYPE_FIELDS (record); - tree field_type = TREE_TYPE (fields); - tree array_type = TREE_TYPE (field_type); - if (TREE_CODE (fields) != FIELD_DECL - || TREE_CODE (field_type) != ARRAY_TYPE) - abort (); - - if (TYPE_MODE (other_type) == mode && type == array_type) - { - new_type = other_type; - break; - } - } - - if (new_type == NULL_TREE) - { - tree index, array, rt, list_node; - - new_type = (*lang_hooks.types.type_for_mode) (new_mode, - TREE_UNSIGNED (type)); - - if (!new_type) - { - error ("no vector mode with the size and type specified could be found"); - return NULL_TREE; - } - - new_type = build_type_copy (new_type); - - /* If this is a vector, make sure we either have hardware - support, or we can emulate it. */ - if ((GET_MODE_CLASS (mode) == MODE_VECTOR_INT - || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) - && !vector_mode_valid_p (mode)) - { - error ("unable to emulate '%s'", GET_MODE_NAME (mode)); - return NULL_TREE; - } - - /* Set the debug information here, because this is the only - place where we know the underlying type for a vector made - with vector_size. For debugging purposes we pretend a vector - is an array within a structure. */ - index = build_int_2 (TYPE_VECTOR_SUBPARTS (new_type) - 1, 0); - array = build_array_type (type, build_index_type (index)); - rt = make_node (RECORD_TYPE); - - TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array); - DECL_CONTEXT (TYPE_FIELDS (rt)) = rt; - layout_type (rt); - TYPE_DEBUG_REPRESENTATION_TYPE (new_type) = rt; - - list_node = build_tree_list (NULL, new_type); - TREE_CHAIN (list_node) = vector_type_node_list; - vector_type_node_list = list_node; - } + new_type = build_vector_type (type, nunits); /* Build back pointers if needed. */ *node = reconstruct_complex_type (*node, new_type); @@ -5303,8 +5332,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args, /* Handle the "nonnull" attribute. */ static tree -handle_nonnull_attribute (tree *node, tree name ATTRIBUTE_UNUSED, - tree args, int flags ATTRIBUTE_UNUSED, +handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), + tree args, int ARG_UNUSED (flags), bool *no_add_attrs) { tree type = *node; @@ -5313,12 +5342,12 @@ handle_nonnull_attribute (tree *node, tree name ATTRIBUTE_UNUSED, /* If no arguments are specified, all pointer arguments should be non-null. Verify a full prototype is given so that the arguments will have the correct types when we actually check them later. */ - if (! args) + if (!args) { - if (! TYPE_ARG_TYPES (type)) + if (!TYPE_ARG_TYPES (type)) { error ("nonnull attribute without arguments on a non-prototype"); - *no_add_attrs = true; + *no_add_attrs = true; } return NULL_TREE; } @@ -5328,11 +5357,11 @@ handle_nonnull_attribute (tree *node, tree name ATTRIBUTE_UNUSED, for (attr_arg_num = 1; args; args = TREE_CHAIN (args)) { tree argument; - unsigned HOST_WIDE_INT arg_num, ck_num; + unsigned HOST_WIDE_INT arg_num = 0, ck_num; - if (! get_nonnull_operand (TREE_VALUE (args), &arg_num)) + if (!get_nonnull_operand (TREE_VALUE (args), &arg_num)) { - error ("nonnull argument has invalid operand number (arg %lu)", + error ("nonnull argument has invalid operand number (argument %lu)", (unsigned long) attr_arg_num); *no_add_attrs = true; return NULL_TREE; @@ -5343,23 +5372,23 @@ handle_nonnull_attribute (tree *node, tree name ATTRIBUTE_UNUSED, { for (ck_num = 1; ; ck_num++) { - if (! argument || ck_num == arg_num) + if (!argument || ck_num == arg_num) break; argument = TREE_CHAIN (argument); } - if (! argument + if (!argument || TREE_CODE (TREE_VALUE (argument)) == VOID_TYPE) { - error ("nonnull argument with out-of-range operand number (arg %lu, operand %lu)", + error ("nonnull argument with out-of-range operand number (argument %lu, operand %lu)", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; } - if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE) + if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE) { - error ("nonnull argument references non-pointer operand (arg %lu, operand %lu)", + error ("nonnull argument references non-pointer operand (argument %lu, operand %lu)", (unsigned long) attr_arg_num, (unsigned long) arg_num); *no_add_attrs = true; return NULL_TREE; @@ -5383,22 +5412,90 @@ check_function_nonnull (tree attrs, tree params) { if (is_attribute_p ("nonnull", TREE_PURPOSE (a))) { - args = TREE_VALUE (a); + args = TREE_VALUE (a); - /* Walk the argument list. If we encounter an argument number we - should check for non-null, do it. If the attribute has no args, - then every pointer argument is checked (in which case the check + /* Walk the argument list. If we encounter an argument number we + should check for non-null, do it. If the attribute has no args, + then every pointer argument is checked (in which case the check for pointer type is done in check_nonnull_arg). */ - for (param = params, param_num = 1; ; - param_num++, param = TREE_CHAIN (param)) - { - if (! param) + for (param = params, param_num = 1; ; + param_num++, param = TREE_CHAIN (param)) + { + if (!param) break; - if (! args || nonnull_check_p (args, param_num)) + if (!args || nonnull_check_p (args, param_num)) check_function_arguments_recurse (check_nonnull_arg, NULL, TREE_VALUE (param), param_num); - } + } + } + } +} + +/* Check that the Nth argument of a function call (counting backwards + from the end) is a (pointer)0. */ + +static void +check_function_sentinel (tree attrs, tree params, tree typelist) +{ + tree attr = lookup_attribute ("sentinel", attrs); + + if (attr) + { + /* Skip over the named arguments. */ + while (typelist && params) + { + typelist = TREE_CHAIN (typelist); + params = TREE_CHAIN (params); + } + + if (typelist || !params) + warning (OPT_Wformat, + "not enough variable arguments to fit a sentinel"); + else + { + tree sentinel, end; + unsigned pos = 0; + + if (TREE_VALUE (attr)) + { + tree p = TREE_VALUE (TREE_VALUE (attr)); + pos = TREE_INT_CST_LOW (p); + } + + sentinel = end = params; + + /* Advance `end' ahead of `sentinel' by `pos' positions. */ + while (pos > 0 && TREE_CHAIN (end)) + { + pos--; + end = TREE_CHAIN (end); + } + if (pos > 0) + { + warning (OPT_Wformat, + "not enough variable arguments to fit a sentinel"); + return; + } + + /* Now advance both until we find the last parameter. */ + while (TREE_CHAIN (end)) + { + end = TREE_CHAIN (end); + sentinel = TREE_CHAIN (sentinel); + } + + /* Validate the sentinel. */ + if ((!POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (sentinel))) + || !integer_zerop (TREE_VALUE (sentinel))) + /* Although __null (in C++) is only an integer we allow it + nevertheless, as we are guaranteed that it's exactly + as wide as a pointer, and we don't want to force + users to cast the NULL they have written there. + We warn with -Wstrict-null-sentinel, though. */ + && (warn_strict_null_sentinel + || null_node != TREE_VALUE (sentinel))) + warning (OPT_Wformat, "missing sentinel in function call"); } } } @@ -5410,12 +5507,13 @@ check_function_nonnull (tree attrs, tree params) static bool nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num) { - unsigned HOST_WIDE_INT arg_num; + unsigned HOST_WIDE_INT arg_num = 0; for (; args; args = TREE_CHAIN (args)) { - if (! get_nonnull_operand (TREE_VALUE (args), &arg_num)) - abort (); + bool found = get_nonnull_operand (TREE_VALUE (args), &arg_num); + + gcc_assert (found); if (arg_num == param_num) return true; @@ -5428,7 +5526,7 @@ nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num) via check_function_arguments_recurse. */ static void -check_nonnull_arg (void *ctx ATTRIBUTE_UNUSED, tree param, +check_nonnull_arg (void * ARG_UNUSED (ctx), tree param, unsigned HOST_WIDE_INT param_num) { /* Just skip checking the argument if it's not a pointer. This can @@ -5439,8 +5537,8 @@ check_nonnull_arg (void *ctx ATTRIBUTE_UNUSED, tree param, return; if (integer_zerop (param)) - warning ("null argument where non-null required (arg %lu)", - (unsigned long) param_num); + warning (OPT_Wnonnull, "null argument where non-null required " + "(argument %lu)", (unsigned long) param_num); } /* Helper for nonnull attribute handling; fetch the operand number @@ -5449,13 +5547,7 @@ check_nonnull_arg (void *ctx ATTRIBUTE_UNUSED, tree param, static bool get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp) { - /* Strip any conversions from the arg number and verify they - are constants. */ - while (TREE_CODE (arg_num_expr) == NOP_EXPR - || TREE_CODE (arg_num_expr) == CONVERT_EXPR - || TREE_CODE (arg_num_expr) == NON_LVALUE_EXPR) - arg_num_expr = TREE_OPERAND (arg_num_expr, 0); - + /* Verify the arg number is a constant. */ if (TREE_CODE (arg_num_expr) != INTEGER_CST || TREE_INT_CST_HIGH (arg_num_expr) != 0) return false; @@ -5468,15 +5560,15 @@ get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp) struct attribute_spec.handler. */ static tree -handle_nothrow_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) == FUNCTION_DECL) TREE_NOTHROW (*node) = 1; /* ??? TODO: Support types. */ else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -5488,7 +5580,7 @@ handle_nothrow_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, static tree handle_cleanup_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + int ARG_UNUSED (flags), bool *no_add_attrs) { tree decl = *node; tree cleanup_id, cleanup_decl; @@ -5499,7 +5591,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args, we'd be missing too much, since we do have attribute constructor. */ if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; return NULL_TREE; } @@ -5510,14 +5602,14 @@ handle_cleanup_attribute (tree *node, tree name, tree args, cleanup_id = TREE_VALUE (args); if (TREE_CODE (cleanup_id) != IDENTIFIER_NODE) { - error ("cleanup arg not an identifier"); + error ("cleanup argument not an identifier"); *no_add_attrs = true; return NULL_TREE; } cleanup_decl = lookup_name (cleanup_id); if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL) { - error ("cleanup arg not a function"); + error ("cleanup argument not a function"); *no_add_attrs = true; return NULL_TREE; } @@ -5532,22 +5624,71 @@ handle_cleanup_attribute (tree *node, tree name, tree args, static tree handle_warn_unused_result_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) { /* Ignore the attribute for functions not returning any value. */ if (VOID_TYPE_P (TREE_TYPE (*node))) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qE attribute ignored", name); *no_add_attrs = true; } return NULL_TREE; } + +/* Handle a "sentinel" attribute. */ + +static tree +handle_sentinel_attribute (tree *node, tree name, tree args, + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + tree params = TYPE_ARG_TYPES (*node); + + if (!params) + { + warning (OPT_Wattributes, + "%qE attribute requires prototypes with named arguments", name); + *no_add_attrs = true; + } + else + { + while (TREE_CHAIN (params)) + params = TREE_CHAIN (params); + + if (VOID_TYPE_P (TREE_VALUE (params))) + { + warning (OPT_Wattributes, + "%qE attribute only applies to variadic functions", name); + *no_add_attrs = true; + } + } + + if (args) + { + tree position = TREE_VALUE (args); + + if (TREE_CODE (position) != INTEGER_CST) + { + warning (0, "requested position is not an integer constant"); + *no_add_attrs = true; + } + else + { + if (tree_int_cst_lt (position, integer_zero_node)) + { + warning (0, "requested position is less than zero"); + *no_add_attrs = true; + } + } + } + + return NULL_TREE; +} /* Check for valid arguments being passed to a function. */ void -check_function_arguments (tree attrs, tree params) +check_function_arguments (tree attrs, tree params, tree typelist) { /* Check for null being passed in a pointer argument that must be non-null. We also need to do this if format checking is enabled. */ @@ -5557,8 +5698,11 @@ check_function_arguments (tree attrs, tree params) /* Check for errors in format strings. */ + if (warn_format || warn_missing_format_attribute) + check_function_format (attrs, params); + if (warn_format) - check_function_format (NULL, attrs, params); + check_function_sentinel (attrs, params, typelist); } /* Generic argument checking recursion routine. PARAM is the argument to @@ -5570,11 +5714,13 @@ check_function_arguments_recurse (void (*callback) void *ctx, tree param, unsigned HOST_WIDE_INT param_num) { - if (TREE_CODE (param) == NOP_EXPR) + if ((TREE_CODE (param) == NOP_EXPR || TREE_CODE (param) == CONVERT_EXPR) + && (TYPE_PRECISION (TREE_TYPE (param)) + == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (param, 0))))) { /* Strip coercion. */ check_function_arguments_recurse (callback, ctx, - TREE_OPERAND (param, 0), param_num); + TREE_OPERAND (param, 0), param_num); return; } @@ -5601,14 +5747,9 @@ check_function_arguments_recurse (void (*callback) /* Extract the argument number, which was previously checked to be valid. */ format_num_expr = TREE_VALUE (TREE_VALUE (attrs)); - while (TREE_CODE (format_num_expr) == NOP_EXPR - || TREE_CODE (format_num_expr) == CONVERT_EXPR - || TREE_CODE (format_num_expr) == NON_LVALUE_EXPR) - format_num_expr = TREE_OPERAND (format_num_expr, 0); - if (TREE_CODE (format_num_expr) != INTEGER_CST - || TREE_INT_CST_HIGH (format_num_expr) != 0) - abort (); + gcc_assert (TREE_CODE (format_num_expr) == INTEGER_CST + && !TREE_INT_CST_HIGH (format_num_expr)); format_num = TREE_INT_CST_LOW (format_num_expr); @@ -5636,9 +5777,9 @@ check_function_arguments_recurse (void (*callback) { /* Check both halves of the conditional expression. */ check_function_arguments_recurse (callback, ctx, - TREE_OPERAND (param, 1), param_num); + TREE_OPERAND (param, 1), param_num); check_function_arguments_recurse (callback, ctx, - TREE_OPERAND (param, 2), param_num); + TREE_OPERAND (param, 2), param_num); return; } @@ -5650,8 +5791,9 @@ check_function_arguments_recurse (void (*callback) int field_decl_cmp (const void *x_p, const void *y_p) { - const tree *const x = x_p; - const tree *const y = y_p; + const tree *const x = (const tree *const) x_p; + const tree *const y = (const tree *const) y_p; + if (DECL_NAME (*x) == DECL_NAME (*y)) /* A nontype is "greater" than a type. */ return (TREE_CODE (*y) == TYPE_DECL) - (TREE_CODE (*x) == TYPE_DECL); @@ -5675,8 +5817,8 @@ pointer operator in resort_data. */ static int resort_field_decl_cmp (const void *x_p, const void *y_p) { - const tree *const x = x_p; - const tree *const y = y_p; + const tree *const x = (const tree *const) x_p; + const tree *const y = (const tree *const) y_p; if (DECL_NAME (*x) == DECL_NAME (*y)) /* A nontype is "greater" than a type. */ @@ -5700,205 +5842,634 @@ resort_field_decl_cmp (const void *x_p, const void *y_p) void resort_sorted_fields (void *obj, - void *orig_obj ATTRIBUTE_UNUSED , - gt_pointer_operator new_value, - void *cookie) + void * ARG_UNUSED (orig_obj), + gt_pointer_operator new_value, + void *cookie) { - struct sorted_fields_type *sf = obj; + struct sorted_fields_type *sf = (struct sorted_fields_type *) obj; resort_data.new_value = new_value; resort_data.cookie = cookie; qsort (&sf->elts[0], sf->len, sizeof (tree), - resort_field_decl_cmp); + resort_field_decl_cmp); } -/* Used by estimate_num_insns. Estimate number of instructions seen - by given statement. */ -static tree -c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) +/* Subroutine of c_parse_error. + Return the result of concatenating LHS and RHS. RHS is really + a string literal, its first character is indicated by RHS_START and + RHS_SIZE is its length (including the terminating NUL character). + + The caller is responsible for deleting the returned pointer. */ + +static char * +catenate_strings (const char *lhs, const char *rhs_start, int rhs_size) { - int *count = data; - tree x = *tp; - - if (TYPE_P (x) || DECL_P (x)) - { - *walk_subtrees = 0; - return NULL; - } - /* Assume that constants and references counts nothing. These should - be majorized by amount of operations among them we count later - and are common target of CSE and similar optimizations. */ - if (TREE_CODE_CLASS (TREE_CODE (x)) == 'c' - || TREE_CODE_CLASS (TREE_CODE (x)) == 'r') - return NULL; - switch (TREE_CODE (x)) - { - /* Recognize assignments of large structures and constructors of - big arrays. */ - case MODIFY_EXPR: - case CONSTRUCTOR: - { - HOST_WIDE_INT size; - - size = int_size_in_bytes (TREE_TYPE (x)); - - if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO) - *count += 10; - else - *count += ((size + MOVE_MAX_PIECES - 1) / MOVE_MAX_PIECES); - } - break; - case CALL_EXPR: - { - tree decl = get_callee_fndecl (x); - - if (decl && DECL_BUILT_IN (decl)) - switch (DECL_FUNCTION_CODE (decl)) - { - case BUILT_IN_CONSTANT_P: - *walk_subtrees = 0; - return NULL_TREE; - case BUILT_IN_EXPECT: - return NULL_TREE; - default: - break; - } - *count += 10; - break; - } - /* Few special cases of expensive operations. This is usefull - to avoid inlining on functions having too many of these. */ - case TRUNC_DIV_EXPR: - case CEIL_DIV_EXPR: - case FLOOR_DIV_EXPR: - case ROUND_DIV_EXPR: - case TRUNC_MOD_EXPR: - case CEIL_MOD_EXPR: - case FLOOR_MOD_EXPR: - case ROUND_MOD_EXPR: - case RDIV_EXPR: - *count += 10; - break; - /* Various containers that will produce no code themselves. */ - case INIT_EXPR: - case TARGET_EXPR: - case BIND_EXPR: - case BLOCK: - case TREE_LIST: - case TREE_VEC: - case IDENTIFIER_NODE: - case PLACEHOLDER_EXPR: - case WITH_CLEANUP_EXPR: - case CLEANUP_POINT_EXPR: - case NOP_EXPR: - case VIEW_CONVERT_EXPR: - case SAVE_EXPR: - case UNSAVE_EXPR: - case COMPLEX_EXPR: - case REALPART_EXPR: - case IMAGPART_EXPR: - case TRY_CATCH_EXPR: - case TRY_FINALLY_EXPR: - case LABEL_EXPR: - case EXIT_EXPR: - case LABELED_BLOCK_EXPR: - case EXIT_BLOCK_EXPR: - case EXPR_WITH_FILE_LOCATION: - - case EXPR_STMT: - case COMPOUND_STMT: - case RETURN_STMT: - case LABEL_STMT: - case SCOPE_STMT: - case FILE_STMT: - case CASE_LABEL: - case STMT_EXPR: - case CLEANUP_STMT: - - case SIZEOF_EXPR: - case ARROW_EXPR: - case ALIGNOF_EXPR: - break; - case DECL_STMT: - /* Do not account static initializers. */ - if (TREE_STATIC (TREE_OPERAND (x, 0))) - *walk_subtrees = 0; - break; - default: - (*count)++; - } - return NULL; + const int lhs_size = strlen (lhs); + char *result = XNEWVEC (char, lhs_size + rhs_size); + strncpy (result, lhs, lhs_size); + strncpy (result + lhs_size, rhs_start, rhs_size); + return result; } -/* Estimate number of instructions that will be created by expanding the body. */ -int -c_estimate_num_insns (tree decl) -{ - int num = 0; - walk_tree_without_duplicates (&DECL_SAVED_TREE (decl), c_estimate_num_insns_1, &num); - return num; -} - -/* Used by c_decl_uninit to find where expressions like x = x + 1; */ - -static tree -c_decl_uninit_1 (tree *t, int *walk_sub_trees, void *x) -{ - /* If x = EXP(&x)EXP, then do not warn about the use of x. */ - if (TREE_CODE (*t) == ADDR_EXPR && TREE_OPERAND (*t, 0) == x) - { - *walk_sub_trees = 0; - return NULL_TREE; - } - if (*t == x) - return *t; - return NULL_TREE; -} - -/* Find out if a variable is uninitialized based on DECL_INITIAL. */ - -bool -c_decl_uninit (tree t) -{ - /* int x = x; is GCC extension to turn off this warning, only if warn_init_self is zero. */ - if (DECL_INITIAL (t) == t) - return warn_init_self ? true : false; - - /* Walk the trees looking for the variable itself. */ - if (walk_tree_without_duplicates (&DECL_INITIAL (t), c_decl_uninit_1, t)) - return true; - return false; -} - -/* Issue the error given by MSGID, indicating that it occurred before +/* Issue the error given by GMSGID, indicating that it occurred before TOKEN, which had the associated VALUE. */ void -c_parse_error (const char *msgid, enum cpp_ttype token, tree value) +c_parse_error (const char *gmsgid, enum cpp_ttype token, tree value) { - const char *string = _(msgid); +#define catenate_messages(M1, M2) catenate_strings ((M1), (M2), sizeof (M2)) + + char *message = NULL; if (token == CPP_EOF) - error ("%s at end of input", string); + message = catenate_messages (gmsgid, " at end of input"); else if (token == CPP_CHAR || token == CPP_WCHAR) { unsigned int val = TREE_INT_CST_LOW (value); const char *const ell = (token == CPP_CHAR) ? "" : "L"; if (val <= UCHAR_MAX && ISGRAPH (val)) - error ("%s before %s'%c'", string, ell, val); + message = catenate_messages (gmsgid, " before %s'%c'"); else - error ("%s before %s'\\x%x'", string, ell, val); + message = catenate_messages (gmsgid, " before %s'\\x%x'"); + + error (message, ell, val); + free (message); + message = NULL; } - else if (token == CPP_STRING - || token == CPP_WSTRING) - error ("%s before string constant", string); + else if (token == CPP_STRING || token == CPP_WSTRING) + message = catenate_messages (gmsgid, " before string constant"); else if (token == CPP_NUMBER) - error ("%s before numeric constant", string); + message = catenate_messages (gmsgid, " before numeric constant"); else if (token == CPP_NAME) - error ("%s before \"%s\"", string, IDENTIFIER_POINTER (value)); + { + message = catenate_messages (gmsgid, " before %qE"); + error (message, value); + free (message); + message = NULL; + } + else if (token == CPP_PRAGMA) + message = catenate_messages (gmsgid, " before %<#pragma%>"); + else if (token == CPP_PRAGMA_EOL) + message = catenate_messages (gmsgid, " before end of line"); else if (token < N_TTYPES) - error ("%s before '%s' token", string, cpp_type2name (token)); + { + message = catenate_messages (gmsgid, " before %qs token"); + error (message, cpp_type2name (token)); + free (message); + message = NULL; + } else - error ("%s", string); + error (gmsgid); + + if (message) + { + error (message); + free (message); + } +#undef catenate_messages } +/* Walk a gimplified function and warn for functions whose return value is + ignored and attribute((warn_unused_result)) is set. This is done before + inlining, so we don't have to worry about that. */ + +void +c_warn_unused_result (tree *top_p) +{ + tree t = *top_p; + tree_stmt_iterator i; + tree fdecl, ftype; + + switch (TREE_CODE (t)) + { + case STATEMENT_LIST: + for (i = tsi_start (*top_p); !tsi_end_p (i); tsi_next (&i)) + c_warn_unused_result (tsi_stmt_ptr (i)); + break; + + case COND_EXPR: + c_warn_unused_result (&COND_EXPR_THEN (t)); + c_warn_unused_result (&COND_EXPR_ELSE (t)); + break; + case BIND_EXPR: + c_warn_unused_result (&BIND_EXPR_BODY (t)); + break; + case TRY_FINALLY_EXPR: + case TRY_CATCH_EXPR: + c_warn_unused_result (&TREE_OPERAND (t, 0)); + c_warn_unused_result (&TREE_OPERAND (t, 1)); + break; + case CATCH_EXPR: + c_warn_unused_result (&CATCH_BODY (t)); + break; + case EH_FILTER_EXPR: + c_warn_unused_result (&EH_FILTER_FAILURE (t)); + break; + + case CALL_EXPR: + if (TREE_USED (t)) + break; + + /* This is a naked call, as opposed to a CALL_EXPR nested inside + a MODIFY_EXPR. All calls whose value is ignored should be + represented like this. Look for the attribute. */ + fdecl = get_callee_fndecl (t); + if (fdecl) + ftype = TREE_TYPE (fdecl); + else + { + ftype = TREE_TYPE (TREE_OPERAND (t, 0)); + /* Look past pointer-to-function to the function type itself. */ + ftype = TREE_TYPE (ftype); + } + + if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype))) + { + if (fdecl) + warning (0, "%Hignoring return value of %qD, " + "declared with attribute warn_unused_result", + EXPR_LOCUS (t), fdecl); + else + warning (0, "%Hignoring return value of function " + "declared with attribute warn_unused_result", + EXPR_LOCUS (t)); + } + break; + + default: + /* Not a container, not a call, or a call whose value is used. */ + break; + } +} + +/* Convert a character from the host to the target execution character + set. cpplib handles this, mostly. */ + +HOST_WIDE_INT +c_common_to_target_charset (HOST_WIDE_INT c) +{ + /* Character constants in GCC proper are sign-extended under -fsigned-char, + zero-extended under -fno-signed-char. cpplib insists that characters + and character constants are always unsigned. Hence we must convert + back and forth. */ + cppchar_t uc = ((cppchar_t)c) & ((((cppchar_t)1) << CHAR_BIT)-1); + + uc = cpp_host_to_exec_charset (parse_in, uc); + + if (flag_signed_char) + return ((HOST_WIDE_INT)uc) << (HOST_BITS_PER_WIDE_INT - CHAR_TYPE_SIZE) + >> (HOST_BITS_PER_WIDE_INT - CHAR_TYPE_SIZE); + else + return uc; +} + +/* Build the result of __builtin_offsetof. EXPR is a nested sequence of + component references, with STOP_REF, or alternatively an INDIRECT_REF of + NULL, at the bottom; much like the traditional rendering of offsetof as a + macro. Returns the folded and properly cast result. */ + +static tree +fold_offsetof_1 (tree expr, tree stop_ref) +{ + enum tree_code code = PLUS_EXPR; + tree base, off, t; + + if (expr == stop_ref && TREE_CODE (expr) != ERROR_MARK) + return size_zero_node; + + switch (TREE_CODE (expr)) + { + case ERROR_MARK: + return expr; + + case VAR_DECL: + error ("cannot apply % to static data member %qD", expr); + return error_mark_node; + + case CALL_EXPR: + error ("cannot apply % when % is overloaded"); + return error_mark_node; + + case INTEGER_CST: + gcc_assert (integer_zerop (expr)); + return size_zero_node; + + case NOP_EXPR: + case INDIRECT_REF: + base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref); + gcc_assert (base == error_mark_node || base == size_zero_node); + return base; + + case COMPONENT_REF: + base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref); + if (base == error_mark_node) + return base; + + t = TREE_OPERAND (expr, 1); + if (DECL_C_BIT_FIELD (t)) + { + error ("attempt to take address of bit-field structure " + "member %qD", t); + return error_mark_node; + } + off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), + size_int (tree_low_cst (DECL_FIELD_BIT_OFFSET (t), 1) + / BITS_PER_UNIT)); + break; + + case ARRAY_REF: + base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref); + if (base == error_mark_node) + return base; + + t = TREE_OPERAND (expr, 1); + if (TREE_CODE (t) == INTEGER_CST && tree_int_cst_sgn (t) < 0) + { + code = MINUS_EXPR; + t = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t); + } + t = convert (sizetype, t); + off = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (TREE_TYPE (expr)), t); + break; + + case COMPOUND_EXPR: + /* Handle static members of volatile structs. */ + t = TREE_OPERAND (expr, 1); + gcc_assert (TREE_CODE (t) == VAR_DECL); + return fold_offsetof_1 (t, stop_ref); + + default: + gcc_unreachable (); + } + + return size_binop (code, base, off); +} + +tree +fold_offsetof (tree expr, tree stop_ref) +{ + /* Convert back from the internal sizetype to size_t. */ + return convert (size_type_node, fold_offsetof_1 (expr, stop_ref)); +} + +/* Print an error message for an invalid lvalue. USE says + how the lvalue is being used and so selects the error message. */ + +void +lvalue_error (enum lvalue_use use) +{ + switch (use) + { + case lv_assign: + error ("lvalue required as left operand of assignment"); + break; + case lv_increment: + error ("lvalue required as increment operand"); + break; + case lv_decrement: + error ("lvalue required as decrement operand"); + break; + case lv_addressof: + error ("lvalue required as unary %<&%> operand"); + break; + case lv_asm: + error ("lvalue required in asm statement"); + break; + default: + gcc_unreachable (); + } +} + +/* *PTYPE is an incomplete array. Complete it with a domain based on + INITIAL_VALUE. If INITIAL_VALUE is not present, use 1 if DO_DEFAULT + is true. Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, + 2 if INITIAL_VALUE was NULL, and 3 if INITIAL_VALUE was empty. */ + +int +complete_array_type (tree *ptype, tree initial_value, bool do_default) +{ + tree maxindex, type, main_type, elt, unqual_elt; + int failure = 0, quals; + + maxindex = size_zero_node; + if (initial_value) + { + if (TREE_CODE (initial_value) == STRING_CST) + { + int eltsize + = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); + maxindex = size_int (TREE_STRING_LENGTH (initial_value)/eltsize - 1); + } + else if (TREE_CODE (initial_value) == CONSTRUCTOR) + { + VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value); + + if (VEC_empty (constructor_elt, v)) + { + if (pedantic) + failure = 3; + maxindex = integer_minus_one_node; + } + else + { + tree curindex; + unsigned HOST_WIDE_INT cnt; + constructor_elt *ce; + + if (VEC_index (constructor_elt, v, 0)->index) + maxindex = fold_convert (sizetype, + VEC_index (constructor_elt, + v, 0)->index); + curindex = maxindex; + + for (cnt = 1; + VEC_iterate (constructor_elt, v, cnt, ce); + cnt++) + { + if (ce->index) + curindex = fold_convert (sizetype, ce->index); + else + curindex = size_binop (PLUS_EXPR, curindex, size_one_node); + + if (tree_int_cst_lt (maxindex, curindex)) + maxindex = curindex; + } + } + } + else + { + /* Make an error message unless that happened already. */ + if (initial_value != error_mark_node) + failure = 1; + } + } + else + { + failure = 2; + if (!do_default) + return failure; + } + + type = *ptype; + elt = TREE_TYPE (type); + quals = TYPE_QUALS (strip_array_types (elt)); + if (quals == 0) + unqual_elt = elt; + else + unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED); + + /* Using build_distinct_type_copy and modifying things afterward instead + of using build_array_type to create a new type preserves all of the + TYPE_LANG_FLAG_? bits that the front end may have set. */ + main_type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); + TREE_TYPE (main_type) = unqual_elt; + TYPE_DOMAIN (main_type) = build_index_type (maxindex); + layout_type (main_type); + + if (quals == 0) + type = main_type; + else + type = c_build_qualified_type (main_type, quals); + + *ptype = type; + return failure; +} + + +/* Used to help initialize the builtin-types.def table. When a type of + the correct size doesn't exist, use error_mark_node instead of NULL. + The later results in segfaults even when a decl using the type doesn't + get invoked. */ + +tree +builtin_type_for_size (int size, bool unsignedp) +{ + tree type = lang_hooks.types.type_for_size (size, unsignedp); + return type ? type : error_mark_node; +} + +/* A helper function for resolve_overloaded_builtin in resolving the + overloaded __sync_ builtins. Returns a positive power of 2 if the + first operand of PARAMS is a pointer to a supported data type. + Returns 0 if an error is encountered. */ + +static int +sync_resolve_size (tree function, tree params) +{ + tree type; + int size; + + if (params == NULL) + { + error ("too few arguments to function %qE", function); + return 0; + } + + type = TREE_TYPE (TREE_VALUE (params)); + if (TREE_CODE (type) != POINTER_TYPE) + goto incompatible; + + type = TREE_TYPE (type); + if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) + goto incompatible; + + size = tree_low_cst (TYPE_SIZE_UNIT (type), 1); + if (size == 1 || size == 2 || size == 4 || size == 8 || size == 16) + return size; + + incompatible: + error ("incompatible type for argument %d of %qE", 1, function); + return 0; +} + +/* A helper function for resolve_overloaded_builtin. Adds casts to + PARAMS to make arguments match up with those of FUNCTION. Drops + the variadic arguments at the end. Returns false if some error + was encountered; true on success. */ + +static bool +sync_resolve_params (tree orig_function, tree function, tree params) +{ + tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (function)); + tree ptype; + int number; + + /* We've declared the implementation functions to use "volatile void *" + as the pointer parameter, so we shouldn't get any complaints from the + call to check_function_arguments what ever type the user used. */ + arg_types = TREE_CHAIN (arg_types); + ptype = TREE_TYPE (TREE_TYPE (TREE_VALUE (params))); + number = 2; + + /* For the rest of the values, we need to cast these to FTYPE, so that we + don't get warnings for passing pointer types, etc. */ + while (arg_types != void_list_node) + { + tree val; + + params = TREE_CHAIN (params); + if (params == NULL) + { + error ("too few arguments to function %qE", orig_function); + return false; + } + + /* ??? Ideally for the first conversion we'd use convert_for_assignment + so that we get warnings for anything that doesn't match the pointer + type. This isn't portable across the C and C++ front ends atm. */ + val = TREE_VALUE (params); + val = convert (ptype, val); + val = convert (TREE_VALUE (arg_types), val); + TREE_VALUE (params) = val; + + arg_types = TREE_CHAIN (arg_types); + number++; + } + + /* The definition of these primitives is variadic, with the remaining + being "an optional list of variables protected by the memory barrier". + No clue what that's supposed to mean, precisely, but we consider all + call-clobbered variables to be protected so we're safe. */ + TREE_CHAIN (params) = NULL; + + return true; +} + +/* A helper function for resolve_overloaded_builtin. Adds a cast to + RESULT to make it match the type of the first pointer argument in + PARAMS. */ + +static tree +sync_resolve_return (tree params, tree result) +{ + tree ptype = TREE_TYPE (TREE_TYPE (TREE_VALUE (params))); + ptype = TYPE_MAIN_VARIANT (ptype); + return convert (ptype, result); +} + +/* Some builtin functions are placeholders for other expressions. This + function should be called immediately after parsing the call expression + before surrounding code has committed to the type of the expression. + + FUNCTION is the DECL that has been invoked; it is known to be a builtin. + PARAMS is the argument list for the call. The return value is non-null + when expansion is complete, and null if normal processing should + continue. */ + +tree +resolve_overloaded_builtin (tree function, tree params) +{ + enum built_in_function orig_code = DECL_FUNCTION_CODE (function); + switch (DECL_BUILT_IN_CLASS (function)) + { + case BUILT_IN_NORMAL: + break; + case BUILT_IN_MD: + if (targetm.resolve_overloaded_builtin) + return targetm.resolve_overloaded_builtin (function, params); + else + return NULL_TREE; + default: + return NULL_TREE; + } + + /* Handle BUILT_IN_NORMAL here. */ + switch (orig_code) + { + case BUILT_IN_FETCH_AND_ADD_N: + case BUILT_IN_FETCH_AND_SUB_N: + case BUILT_IN_FETCH_AND_OR_N: + case BUILT_IN_FETCH_AND_AND_N: + case BUILT_IN_FETCH_AND_XOR_N: + case BUILT_IN_FETCH_AND_NAND_N: + case BUILT_IN_ADD_AND_FETCH_N: + case BUILT_IN_SUB_AND_FETCH_N: + case BUILT_IN_OR_AND_FETCH_N: + case BUILT_IN_AND_AND_FETCH_N: + case BUILT_IN_XOR_AND_FETCH_N: + case BUILT_IN_NAND_AND_FETCH_N: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_N: + case BUILT_IN_VAL_COMPARE_AND_SWAP_N: + case BUILT_IN_LOCK_TEST_AND_SET_N: + case BUILT_IN_LOCK_RELEASE_N: + { + int n = sync_resolve_size (function, params); + tree new_function, result; + + if (n == 0) + return error_mark_node; + + new_function = built_in_decls[orig_code + exact_log2 (n) + 1]; + if (!sync_resolve_params (function, new_function, params)) + return error_mark_node; + + result = build_function_call (new_function, params); + if (orig_code != BUILT_IN_BOOL_COMPARE_AND_SWAP_N + && orig_code != BUILT_IN_LOCK_RELEASE_N) + result = sync_resolve_return (params, result); + + return result; + } + + default: + return NULL_TREE; + } +} + +/* Ignoring their sign, return true if two scalar types are the same. */ +bool +same_scalar_type_ignoring_signedness (tree t1, tree t2) +{ + enum tree_code c1 = TREE_CODE (t1), c2 = TREE_CODE (t2); + + gcc_assert ((c1 == INTEGER_TYPE || c1 == REAL_TYPE) + && (c2 == INTEGER_TYPE || c2 == REAL_TYPE)); + + /* Equality works here because c_common_signed_type uses + TYPE_MAIN_VARIANT. */ + return lang_hooks.types.signed_type (t1) + == lang_hooks.types.signed_type (t2); +} + +/* Check for missing format attributes on function pointers. LTYPE is + the new type or left-hand side type. RTYPE is the old type or + right-hand side type. Returns TRUE if LTYPE is missing the desired + attribute. */ + +bool +check_missing_format_attribute (tree ltype, tree rtype) +{ + tree const ttr = TREE_TYPE (rtype), ttl = TREE_TYPE (ltype); + tree ra; + + for (ra = TYPE_ATTRIBUTES (ttr); ra; ra = TREE_CHAIN (ra)) + if (is_attribute_p ("format", TREE_PURPOSE (ra))) + break; + if (ra) + { + tree la; + for (la = TYPE_ATTRIBUTES (ttl); la; la = TREE_CHAIN (la)) + if (is_attribute_p ("format", TREE_PURPOSE (la))) + break; + return !la; + } + else + return false; +} + +/* Subscripting with type char is likely to lose on a machine where + chars are signed. So warn on any machine, but optionally. Don't + warn for unsigned char since that type is safe. Don't warn for + signed char because anyone who uses that must have done so + deliberately. Furthermore, we reduce the false positive load by + warning only for non-constant value of type char. */ + +void +warn_array_subscript_with_type_char (tree index) +{ + if (TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node + && TREE_CODE (index) != INTEGER_CST) + warning (OPT_Wchar_subscripts, "array subscript has type %"); +} + + #include "gt-c-common.h" diff --git a/contrib/gcc/c-common.def b/contrib/gcc/c-common.def index dfdec8c4df0..1be88bd10dc 100644 --- a/contrib/gcc/c-common.def +++ b/contrib/gcc/c-common.def @@ -1,8 +1,8 @@ /* This file contains the definitions and documentation for the - additional tree codes used in the GNU C++ compiler (see tree.def + additional tree codes used in the GNU C compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. Written by Benjamin Chelf This file is part of GCC. @@ -19,101 +19,18 @@ for more details. 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. */ -/* Tree nodes relevant to both C and C++. These were originally in -cp-tree.def in the cp subdir. */ - -DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", '1', 1) -DEFTREECODE (ARROW_EXPR, "arrow_expr", 'e', 1) -DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", '1', 1) - -/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to - obtain the expression. */ -DEFTREECODE (EXPR_STMT, "expr_stmt", 'e', 1) - -/* Used to represent a brace-enclosed block. The operand is - COMPOUND_BODY. */ -DEFTREECODE (COMPOUND_STMT, "compound_stmt", 'e', 1) - -/* Used to represent a local declaration. The operand is - DECL_STMT_DECL. */ -DEFTREECODE (DECL_STMT, "decl_stmt", 'e', 1) - -/* Represents an 'if' statement. The operands are IF_COND, - THEN_CLAUSE, and ELSE_CLAUSE, respectively. */ -DEFTREECODE (IF_STMT, "if_stmt", 'e', 3) - -/* Used to represent a `for' statement. The operands are - FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ -DEFTREECODE (FOR_STMT, "for_stmt", 'e', 4) - -/* Used to represent a 'while' statement. The operands are WHILE_COND - and WHILE_BODY, respectively. */ -DEFTREECODE (WHILE_STMT, "while_stmt", 'e', 2) - -/* Used to represent a 'do' statement. The operands are DO_BODY and - DO_COND, respectively. */ -DEFTREECODE (DO_STMT, "do_stmt", 'e', 2) - -/* Used to represent a 'return' statement. The operand is - RETURN_STMT_EXPR. */ -DEFTREECODE (RETURN_STMT, "return_stmt", 'e', 1) - -/* Used to represent a 'break' statement. */ -DEFTREECODE (BREAK_STMT, "break_stmt", 'e', 0) - -/* Used to represent a 'continue' statement. */ -DEFTREECODE (CONTINUE_STMT, "continue_stmt", 'e', 0) - -/* Used to represent a 'switch' statement. The operands are - SWITCH_COND, SWITCH_BODY and SWITCH_TYPE, respectively. */ -DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 3) - -/* Used to represent a 'goto' statement. The operand is GOTO_DESTINATION. */ -DEFTREECODE (GOTO_STMT, "goto_stmt", 'e', 1) - -/* Used to represent a 'label' statement. The operand is a LABEL_DECL - and can be obtained through the macro LABEL_STMT_LABEL. */ -DEFTREECODE (LABEL_STMT, "label_stmt", 'e', 1) - -/* Used to represent an inline assembly statement. */ -DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 5) - -/* A SCOPE_STMT marks the beginning or end of a scope. If - SCOPE_BEGIN_P holds, then this is the start of a scope. If - SCOPE_END_P holds, then this is the end of a scope. If - SCOPE_NULLIFIED_P holds then there turned out to be no variables in - this scope. The SCOPE_STMT_BLOCK is the BLOCK containing the - variables declared in this scope. */ -DEFTREECODE (SCOPE_STMT, "scope_stmt", 'e', 1) - -/* A FILE_STMT marks the spot where a function changes files. It has no - other semantics. FILE_STMT_FILENAME gives the name. */ -DEFTREECODE (FILE_STMT, "file_stmt", 'e', 1) - -/* Used to represent a CASE_LABEL. The operands are CASE_LOW and - CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a - 'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case - label. The CASE_LABEL_DECL is a LABEL_DECL for this node. */ -DEFTREECODE (CASE_LABEL, "case_label", 'e', 3) - -/* A STMT_EXPR represents a statement-expression. The - STMT_EXPR_STMT is the statement given by the expression. */ -DEFTREECODE (STMT_EXPR, "stmt_expr", 'e', 1) +/* Tree nodes used in the C frontend. These are also shared with the + C++ and Objective C frontends. */ /* A COMPOUND_LITERAL_EXPR represents a C99 compound literal. The COMPOUND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl for the anonymous object represented by the COMPOUND_LITERAL; the DECL_INITIAL of that decl is the CONSTRUCTOR that initializes the compound literal. */ -DEFTREECODE (COMPOUND_LITERAL_EXPR, "compound_literal_expr", 'e', 1) - -/* A CLEANUP_STMT marks the point at which a declaration is fully - constructed. If, after this point, the CLEANUP_DECL goes out of - scope, the CLEANUP_EXPR must be run. */ -DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", 'e', 2) +DEFTREECODE (COMPOUND_LITERAL_EXPR, "compound_literal_expr", tcc_expression, 1) /* Local variables: diff --git a/contrib/gcc/c-common.h b/contrib/gcc/c-common.h index 0576a0a3bd8..633990a3a35 100644 --- a/contrib/gcc/c-common.h +++ b/contrib/gcc/c-common.h @@ -1,6 +1,6 @@ /* Definitions for c-common.c. Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #ifndef GCC_C_COMMON_H #define GCC_C_COMMON_H @@ -27,21 +27,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" /* Usage of TREE_LANG_FLAG_?: - 0: COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT). - TREE_NEGATED_INT (in INTEGER_CST). + 0: TREE_NEGATED_INT (in INTEGER_CST). IDENTIFIER_MARKED (used by search routines). - SCOPE_BEGIN_P (in SCOPE_STMT) DECL_PRETTY_FUNCTION_P (in VAR_DECL) - NEW_FOR_SCOPE_P (in FOR_STMT) - ASM_INPUT_P (in ASM_STMT) - STMT_EXPR_NO_SCOPE (in STMT_EXPR) 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL) - STMT_IS_FULL_EXPR_P (in _STMT) - 2: STMT_LINENO_FOR_FN_P (in _STMT) - 3: SCOPE_NO_CLEANUPS_P (in SCOPE_STMT) - COMPOUND_STMT_BODY_BLOCK (in COMPOUND_STMT) - STMT_EXPR_WARN_UNUSED_RESULT (in STMT_EXPR) - 4: SCOPE_PARTIAL_P (in SCOPE_STMT) + STATEMENT_LIST_STMT_EXPR (in STATEMENT_LIST) + 2: unused + 3: STATEMENT_LIST_HAS_LABEL (in STATEMENT_LIST) + 4: unused */ /* Reserved identifiers. This is the union of all the keywords for C, @@ -77,8 +70,9 @@ enum rid /* C extensions */ RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG, - RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_PTRBASE, - RID_PTREXTENT, RID_PTRVALUE, RID_CHOOSE_EXPR, RID_TYPES_COMPATIBLE_P, + RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, + RID_TYPES_COMPATIBLE_P, + RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, /* Too many ways of getting the name of a function as a string */ RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME, @@ -88,19 +82,19 @@ enum rid RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_TEMPLATE, RID_NULL, RID_CATCH, RID_DELETE, RID_FALSE, RID_NAMESPACE, - RID_NEW, RID_OFFSETOF, RID_OPERATOR, - RID_THIS, RID_THROW, RID_TRUE, - RID_TRY, RID_TYPENAME, RID_TYPEID, + RID_NEW, RID_OFFSETOF, RID_OPERATOR, + RID_THIS, RID_THROW, RID_TRUE, + RID_TRY, RID_TYPENAME, RID_TYPEID, RID_USING, /* casts */ RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST, /* Objective-C */ - RID_ID, RID_AT_ENCODE, RID_AT_END, + RID_AT_ENCODE, RID_AT_END, RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS, RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, - RID_AT_PROTOCOL, RID_AT_SELECTOR, + RID_AT_PROTOCOL, RID_AT_SELECTOR, RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH, RID_AT_FINALLY, RID_AT_SYNCHRONIZED, RID_AT_INTERFACE, @@ -118,16 +112,16 @@ enum rid }; #define OBJC_IS_AT_KEYWORD(rid) \ - ((unsigned int)(rid) >= (unsigned int)RID_FIRST_AT && \ - (unsigned int)(rid) <= (unsigned int)RID_LAST_AT) + ((unsigned int) (rid) >= (unsigned int) RID_FIRST_AT && \ + (unsigned int) (rid) <= (unsigned int) RID_LAST_AT) #define OBJC_IS_PQ_KEYWORD(rid) \ - ((unsigned int)(rid) >= (unsigned int)RID_FIRST_PQ && \ - (unsigned int)(rid) <= (unsigned int)RID_LAST_PQ) + ((unsigned int) (rid) >= (unsigned int) RID_FIRST_PQ && \ + (unsigned int) (rid) <= (unsigned int) RID_LAST_PQ) /* The elements of `ridpointers' are identifier nodes for the reserved type names and storage classes. It is indexed by a RID_... value. */ -extern GTY ((length ("(int)RID_MAX"))) tree *ridpointers; +extern GTY ((length ("(int) RID_MAX"))) tree *ridpointers; /* Standard named or nameless data types of the C compiler. */ @@ -157,19 +151,16 @@ enum c_tree_index CTI_DEFAULT_FUNCTION_TYPE, - CTI_G77_INTEGER_TYPE, - CTI_G77_UINTEGER_TYPE, - CTI_G77_LONGINT_TYPE, - CTI_G77_ULONGINT_TYPE, - /* These are not types, but we have to look them up all the time. */ CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL, CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS, - + CTI_VOID_ZERO, + CTI_NULL, + CTI_MAX }; @@ -206,12 +197,6 @@ struct c_common_identifier GTY(()) #define default_function_type c_global_trees[CTI_DEFAULT_FUNCTION_TYPE] -/* g77 integer types, which which must be kept in sync with f/com.h */ -#define g77_integer_type_node c_global_trees[CTI_G77_INTEGER_TYPE] -#define g77_uinteger_type_node c_global_trees[CTI_G77_UINTEGER_TYPE] -#define g77_longint_type_node c_global_trees[CTI_G77_LONGINT_TYPE] -#define g77_ulongint_type_node c_global_trees[CTI_G77_ULONGINT_TYPE] - #define function_name_decl_node c_global_trees[CTI_FUNCTION_NAME_DECL] #define pretty_function_name_decl_node c_global_trees[CTI_PRETTY_FUNCTION_NAME_DECL] #define c99_function_name_decl_node c_global_trees[CTI_C99_FUNCTION_NAME_DECL] @@ -220,6 +205,9 @@ struct c_common_identifier GTY(()) /* A node for `((void) 0)'. */ #define void_zero_node c_global_trees[CTI_VOID_ZERO] +/* The node for C++ `__null'. */ +#define null_node c_global_trees[CTI_NULL] + extern GTY(()) tree c_global_trees[CTI_MAX]; /* In a RECORD_TYPE, a sorted array of the fields of the type, not a @@ -234,10 +222,6 @@ struct sorted_fields_type GTY(()) These may be shadowed, and may be referenced from nested functions. */ #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) -/* Flag strings given by __FUNCTION__ and __PRETTY_FUNCTION__ for a - warning if they undergo concatenation. */ -#define C_ARTIFICIAL_STRING_P(NODE) TREE_LANG_FLAG_0 (NODE) - typedef enum c_language_kind { clk_c = 0, /* C90, C94 or C99 */ @@ -257,13 +241,9 @@ extern c_language_kind c_language; /* Information about a statement tree. */ struct stmt_tree_s GTY(()) { - /* The last statement added to the tree. */ - tree x_last_stmt; - /* The type of the last expression statement. (This information is - needed to implement the statement-expression extension.) */ - tree x_last_expr_type; - /* The last filename we recorded. */ - const char *x_last_expr_filename; + /* The current statement list being collected. */ + tree x_cur_stmt_list; + /* In C++, Nonzero if we should treat statements as full expressions. In particular, this variable is no-zero if at the end of a statement we should destroy any temporaries created @@ -290,64 +270,42 @@ struct c_language_function GTY(()) { /* While we are parsing the function, this contains information about the statement-tree that we are building. */ struct stmt_tree_s x_stmt_tree; - /* The stack of SCOPE_STMTs for the current function. */ - tree x_scope_stmt_stack; }; -/* When building a statement-tree, this is the last statement added to - the tree. */ +/* When building a statement-tree, this is the current statement list + being collected. It's TREE_CHAIN is a back-pointer to the previous + statement list. */ -#define last_tree (current_stmt_tree ()->x_last_stmt) - -/* The type of the last expression-statement we have seen. */ - -#define last_expr_type (current_stmt_tree ()->x_last_expr_type) - -/* The name of the last file we have seen. */ - -#define last_expr_filename (current_stmt_tree ()->x_last_expr_filename) - -/* LAST_TREE contains the last statement parsed. These are chained - together through the TREE_CHAIN field, but often need to be - re-organized since the parse is performed bottom-up. This macro - makes LAST_TREE the indicated SUBSTMT of STMT. */ - -#define RECHAIN_STMTS(stmt, substmt) \ - do { \ - substmt = TREE_CHAIN (stmt); \ - TREE_CHAIN (stmt) = NULL_TREE; \ - last_tree = stmt; \ - } while (0) +#define cur_stmt_list (current_stmt_tree ()->x_cur_stmt_list) /* Language-specific hooks. */ -extern void (*lang_expand_stmt) (tree); -extern void (*lang_expand_decl_stmt) (tree); -extern void (*lang_expand_function_end) (void); - /* Callback that determines if it's ok for a function to have no noreturn attribute. */ extern int (*lang_missing_noreturn_ok_p) (tree); -extern int yyparse (void); -extern stmt_tree current_stmt_tree (void); -extern tree *current_scope_stmt_stack (void); -extern void begin_stmt_tree (tree *); -extern tree add_stmt (tree); -extern void add_decl_stmt (tree); -extern tree add_scope_stmt (int, int); -extern void finish_stmt_tree (tree *); +/* If non-NULL, this function is called after a precompile header file + is loaded. */ +extern void (*lang_post_pch_load) (void); -extern tree walk_stmt_tree (tree *, walk_tree_fn, void *); -extern void prep_stmt (tree); -extern void expand_stmt (tree); -extern tree c_begin_if_stmt (void); -extern tree c_begin_while_stmt (void); -extern void c_finish_while_stmt_cond (tree, tree); +extern void push_file_scope (void); +extern void pop_file_scope (void); +extern stmt_tree current_stmt_tree (void); +extern tree push_stmt_list (void); +extern tree pop_stmt_list (tree); +extern tree add_stmt (tree); +extern void push_cleanup (tree, tree, bool); +extern tree pushdecl_top_level (tree); +extern tree pushdecl (tree); +extern tree build_modify_expr (tree, enum tree_code, tree); +extern tree build_indirect_ref (tree, const char *); + +extern int c_expand_decl (tree); extern int field_decl_cmp (const void *, const void *); -extern void resort_sorted_fields (void *, void *, gt_pointer_operator, - void *); +extern void resort_sorted_fields (void *, void *, gt_pointer_operator, + void *); +extern bool has_c_linkage (tree decl); /* Switches common to the C front ends. */ @@ -364,6 +322,9 @@ extern int flag_nil_receivers; @try, etc.) in source code. */ extern int flag_objc_exceptions; +/* Nonzero means that we generate NeXT setjmp based exceptions. */ +extern int flag_objc_sjlj_exceptions; + /* Nonzero means that code generation will be altered to support "zero-link" execution. This currently affects ObjC only, but may affect other languages in the future. */ @@ -392,6 +353,10 @@ extern char flag_dump_macros; extern char flag_dump_includes; +/* Nonzero means process PCH files while preprocessing. */ + +extern bool flag_pch_preprocess; + /* The file name to which we should write a precompiled header, or NULL if no header will be written in this compile. */ @@ -439,104 +404,20 @@ extern int flag_const_strings; /* Nonzero means to treat bitfields as signed unless they say `unsigned'. */ extern int flag_signed_bitfields; -extern int explicit_flag_signed_bitfields; -/* Nonzero means warn about pointer casts that can drop a type qualifier - from the pointer target type. */ +/* Warn about #pragma directives that are not recognized. */ -extern int warn_cast_qual; - -/* Warn about functions which might be candidates for format attributes. */ - -extern int warn_missing_format_attribute; - -/* Nonzero means warn about sizeof(function) or addition/subtraction - of function pointers. */ - -extern int warn_pointer_arith; - -/* Nonzero means warn for any global function def - without separate previous prototype decl. */ - -extern int warn_missing_prototypes; - -/* Warn if adding () is suggested. */ - -extern int warn_parentheses; - -/* Warn if initializer is not completely bracketed. */ - -extern int warn_missing_braces; - -/* Warn about comparison of signed and unsigned values. - If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */ - -extern int warn_sign_compare; - -/* Nonzero means warn about usage of long long when `-pedantic'. */ - -extern int warn_long_long; - -/* Nonzero means warn about deprecated conversion from string constant to - `char *'. */ - -extern int warn_write_strings; - -/* Nonzero means warn about multiple (redundant) decls for the same single - variable or function. */ - -extern int warn_redundant_decls; - -/* Warn about testing equality of floating point numbers. */ - -extern int warn_float_equal; - -/* Warn about a subscript that has type char. */ - -extern int warn_char_subscripts; - -/* Warn if a type conversion is done that might have confusing results. */ - -extern int warn_conversion; - -/* Warn about #pragma directives that are not recognized. */ - -extern int warn_unknown_pragmas; /* Tri state variable. */ +extern int warn_unknown_pragmas; /* Tri state variable. */ /* Warn about format/argument anomalies in calls to formatted I/O functions (*printf, *scanf, strftime, strfmon, etc.). */ extern int warn_format; -/* Warn about Y2K problems with strftime formats. */ - -extern int warn_format_y2k; - -/* Warn about excess arguments to formats. */ - -extern int warn_format_extra_args; - -/* Warn about zero-length formats. */ - -extern int warn_format_zero_length; - -/* Warn about non-literal format arguments. */ - -extern int warn_format_nonliteral; - -/* Warn about possible security problems with calls to format functions. */ - -extern int warn_format_security; - /* C/ObjC language option variables. */ -/* Nonzero means message about use of implicit function declarations; - 1 means warning; 2 means error. */ - -extern int mesg_implicit_function_declaration; - /* Nonzero means allow type mismatches in conditional expressions; just make their values `void'. */ @@ -554,68 +435,10 @@ extern int flag_isoc99; extern int flag_hosted; -/* Nonzero means warn when casting a function call to a type that does - not match the return type (e.g. (float)sqrt() or (anything*)malloc() - when there is no previous declaration of sqrt or malloc. */ - -extern int warn_bad_function_cast; - -/* Warn about traditional constructs whose meanings changed in ANSI C. */ - -extern int warn_traditional; - -/* Nonzero means warn for a declaration found after a statement. */ - -extern int warn_declaration_after_statement; - -/* Nonzero means warn for non-prototype function decls - or non-prototyped defs without previous prototype. */ - -extern int warn_strict_prototypes; - -/* Nonzero means warn for any global function def - without separate previous decl. */ - -extern int warn_missing_declarations; - -/* Nonzero means warn about extern declarations of objects not at - file-scope level and about *all* declarations of functions (whether - extern or static) not at file-scope level. Note that we exclude - implicit function declarations. To get warnings about those, use - -Wimplicit. */ - -extern int warn_nested_externs; - /* Warn if main is suspicious. */ extern int warn_main; -/* Nonzero means warn about possible violations of sequence point rules. */ - -extern int warn_sequence_point; - -/* Nonzero means warn about uninitialized variable when it is initialized with itself. - For example: int i = i;, GCC will not warn about this when warn_init_self is nonzero. */ - -extern int warn_init_self; - - -/* Nonzero means to warn about compile-time division by zero. */ -extern int warn_div_by_zero; - -/* Nonzero means warn about use of implicit int. */ - -extern int warn_implicit_int; - -/* Warn about NULL being passed to argument slots marked as requiring - non-NULL. */ - -extern int warn_nonnull; - -/* Warn about old-style parameter declaration. */ - -extern int warn_old_style_definition; - /* ObjC language option variables. */ @@ -625,10 +448,6 @@ extern int warn_old_style_definition; extern int flag_gen_declaration; -/* Generate code for GNU or NeXT runtime environment. */ - -extern int flag_next_runtime; - /* Tells the compiler that this is a special run. Do not perform any compiling, instead we are to test some platform dependent features and output a C header file with appropriate definitions. */ @@ -639,25 +458,6 @@ extern int print_struct_values; extern const char *constant_string_class_name; -/* Warn if multiple methods are seen for the same selector, but with - different argument types. Performs the check on the whole selector - table at the end of compilation. */ - -extern int warn_selector; - -/* Warn if a @selector() is found, and no method with that selector - has been previously declared. The check is done on each - @selector() as soon as it is found - so it warns about forward - declarations. */ - -extern int warn_undeclared_selector; - -/* Warn if methods required by a protocol are not implemented in the - class adopting it. When turned off, methods inherited to that - class are also considered implemented. */ - -extern int warn_protocol; - /* C++ language option variables. */ @@ -748,6 +548,11 @@ extern int flag_working_directory; extern int flag_use_cxa_atexit; +/* Nonzero to use __cxa_get_exception_ptr in the C++ exception-handling + logic. */ + +extern int flag_use_cxa_get_exception_ptr; + /* Nonzero means make the default pedwarns warnings instead of errors. The value of this flag is ignored if -pedantic is specified. */ @@ -760,69 +565,20 @@ extern int flag_permissive; extern int flag_enforce_eh_specs; -/* Nonzero means warn about things that will change when compiling - with an ABI-compliant compiler. */ +/* Nonzero (the default) means to generate thread-safe code for + initializing local statics. */ -extern int warn_abi; - -/* Nonzero means warn about invalid uses of offsetof. */ - -extern int warn_invalid_offsetof; +extern int flag_threadsafe_statics; /* Nonzero means warn about implicit declarations. */ extern int warn_implicit; -/* Nonzero means warn when all ctors or dtors are private, and the class - has no friends. */ +/* Warn about using __null (as NULL in C++) as sentinel. For code compiled + with GCC this doesn't matter as __null is guaranteed to have the right + size. */ -extern int warn_ctor_dtor_privacy; - -/* Nonzero means warn in function declared in derived class has the - same name as a virtual in the base class, but fails to match the - type signature of any virtual function in the base class. */ - -extern int warn_overloaded_virtual; - -/* Nonzero means warn when declaring a class that has a non virtual - destructor, when it really ought to have a virtual one. */ - -extern int warn_nonvdtor; - -/* Nonzero means warn when the compiler will reorder code. */ - -extern int warn_reorder; - -/* Nonzero means warn when synthesis behavior differs from Cfront's. */ - -extern int warn_synth; - -/* Nonzero means warn when we convert a pointer to member function - into a pointer to (void or function). */ - -extern int warn_pmf2ptr; - -/* Nonzero means warn about violation of some Effective C++ style rules. */ - -extern int warn_ecpp; - -/* Nonzero means warn where overload resolution chooses a promotion from - unsigned to signed over a conversion to an unsigned of the same size. */ - -extern int warn_sign_promo; - -/* Nonzero means warn when an old-style cast is used. */ - -extern int warn_old_style_cast; - -/* Nonzero means warn when non-templatized friend functions are - declared within a template */ - -extern int warn_nontemplate_friend; - -/* Nonzero means complain about deprecated features. */ - -extern int warn_deprecated; +extern int warn_strict_null_sentinel; /* Maximum template instantiation depth. This limit is rather arbitrary, but it exists to limit the time it takes to notice @@ -851,10 +607,6 @@ extern int skip_evaluation; #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \ (!C_TYPE_FUNCTION_P (type)) -/* Record in each node resulting from a binary operator - what operator was specified for it. */ -#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp)) - /* Attribute table common to the C front ends. */ extern const struct attribute_spec c_common_attribute_table[]; extern const struct attribute_spec c_common_format_attribute_table[]; @@ -874,13 +626,13 @@ extern void finish_fname_decls (void); extern const char *fname_as_string (int); extern tree fname_decl (unsigned, tree); -extern void check_function_arguments (tree, tree); +extern void check_function_arguments (tree, tree, tree); extern void check_function_arguments_recurse (void (*) (void *, tree, unsigned HOST_WIDE_INT), void *, tree, unsigned HOST_WIDE_INT); -extern void check_function_format (int *, tree, tree); +extern void check_function_format (tree, tree); extern void set_Wformat (int); extern tree handle_format_attribute (tree *, tree, tree, int, bool *); extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); @@ -891,36 +643,26 @@ extern tree c_common_type_for_size (unsigned int, int); extern tree c_common_unsigned_type (tree); extern tree c_common_signed_type (tree); extern tree c_common_signed_or_unsigned_type (int, tree); +extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); extern tree c_common_truthvalue_conversion (tree); extern void c_apply_type_quals_to_decl (int, tree); -extern tree c_sizeof_or_alignof_type (tree, enum tree_code, int); +extern tree c_sizeof_or_alignof_type (tree, bool, int); extern tree c_alignof_expr (tree); /* Print an error message for invalid operands to arith operation CODE. NOP_EXPR is used as a special case (see truthvalue_conversion). */ extern void binary_op_error (enum tree_code); -#define my_friendly_assert(EXP, N) (void) \ - (((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0) - -extern tree c_expand_expr_stmt (tree); -extern void c_expand_start_cond (tree, int, tree); -extern void c_finish_then (void); -extern void c_expand_start_else (void); -extern void c_finish_else (void); -extern void c_expand_end_cond (void); -/* Validate the expression after `case' and apply default promotions. */ -extern tree check_case_value (tree); extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); +extern void strict_aliasing_warning(tree, tree, tree); +extern void empty_body_warning (tree, tree); extern tree convert_and_check (tree, tree); extern void overflow_warning (tree); -extern void unsigned_conversion_warning (tree, tree); +extern bool c_determine_visibility (tree); +extern bool same_scalar_type_ignoring_signedness (tree, tree); -/* Read the rest of the current #-directive line. */ -extern char *get_directive_line (void); -#define GET_DIRECTIVE_LINE() get_directive_line () -#define c_sizeof(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 1) -#define c_alignof(T) c_sizeof_or_alignof_type (T, ALIGNOF_EXPR, 1) +#define c_sizeof(T) c_sizeof_or_alignof_type (T, true, 1) +#define c_alignof(T) c_sizeof_or_alignof_type (T, false, 1) /* Subroutine of build_binary_op, used for comparison operations. See if the operands have both been converted from subword integer types @@ -937,8 +679,12 @@ extern tree c_build_qualified_type (tree, int); frontends. */ extern void c_common_nodes_and_builtins (void); +extern void set_builtin_user_assembler_name (tree decl, const char *asmspec); + extern void disable_builtin_function (const char *); +extern void set_compound_literal_name (tree decl); + extern tree build_va_arg (tree, tree); extern unsigned int c_common_init_options (unsigned int, const char **); @@ -952,190 +698,30 @@ extern bool c_promoting_integer_type_p (tree); extern int self_promoting_args_p (tree); extern tree strip_array_types (tree); extern tree strip_pointer_operator (tree); +extern HOST_WIDE_INT c_common_to_target_charset (HOST_WIDE_INT); -/* This function resets the parsers' state in preparation for parsing - a new file. */ -extern void c_reset_state (void); /* This is the basic parsing function. */ extern void c_parse_file (void); /* This is misnamed, it actually performs end-of-compilation processing. */ extern void finish_file (void); + /* These macros provide convenient access to the various _STMT nodes. */ -/* Nonzero if this statement should be considered a full-expression, - i.e., if temporaries created during this statement should have - their destructors run at the end of this statement. (In C, this - will always be false, since there are no destructors.) */ -#define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE)) +/* Nonzero if a given STATEMENT_LIST represents the outermost binding + if a statement expression. */ +#define STATEMENT_LIST_STMT_EXPR(NODE) \ + TREE_LANG_FLAG_1 (STATEMENT_LIST_CHECK (NODE)) -/* IF_STMT accessors. These give access to the condition of the if - statement, the then block of the if statement, and the else block - of the if statement if it exists. */ -#define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0) -#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) -#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) - -/* WHILE_STMT accessors. These give access to the condition of the - while statement and the body of the while statement, respectively. */ -#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) -#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) - -/* DO_STMT accessors. These give access to the condition of the do - statement and the body of the do statement, respectively. */ -#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) -#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) - -/* RETURN_STMT accessors. These give the expression associated with a - return statement, and whether it should be ignored when expanding - (as opposed to inlining). */ -#define RETURN_STMT_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0) - -/* EXPR_STMT accessor. This gives the expression associated with an - expression statement. */ -#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) - -/* FOR_STMT accessors. These give access to the init statement, - condition, update expression, and body of the for statement, - respectively. */ -#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) -#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) -#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) -#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) - -/* SWITCH_STMT accessors. These give access to the condition, body and - original condition type (before any compiler conversions) - of the switch statement, respectively. */ -#define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) -#define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) -#define SWITCH_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) - -/* CASE_LABEL accessors. These give access to the high and low values - of a case label, respectively. */ -#define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 0) -#define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 1) -#define CASE_LABEL_DECL(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 2) - -/* GOTO_STMT accessor. This gives access to the label associated with - a goto statement. */ -#define GOTO_DESTINATION(NODE) TREE_OPERAND (GOTO_STMT_CHECK (NODE), 0) -/* True for goto created artificially by the compiler. */ -#define GOTO_FAKE_P(NODE) (TREE_LANG_FLAG_0 (GOTO_STMT_CHECK (NODE))) - -/* COMPOUND_STMT accessor. This gives access to the TREE_LIST of - statements associated with a compound statement. The result is the - first statement in the list. Succeeding nodes can be accessed by - calling TREE_CHAIN on a node in the list. */ -#define COMPOUND_BODY(NODE) TREE_OPERAND (COMPOUND_STMT_CHECK (NODE), 0) - -/* ASM_STMT accessors. ASM_STRING returns a STRING_CST for the - instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and - ASM_CLOBBERS represent the outputs, inputs, and clobbers for the - statement. */ -#define ASM_CV_QUAL(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 0) -#define ASM_STRING(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 1) -#define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 2) -#define ASM_INPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 3) -#define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 4) - -/* DECL_STMT accessor. This gives access to the DECL associated with - the given declaration statement. */ -#define DECL_STMT_DECL(NODE) TREE_OPERAND (DECL_STMT_CHECK (NODE), 0) - -/* STMT_EXPR accessor. */ -#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) - -/* Nonzero if this statement-expression does not have an associated scope. */ -#define STMT_EXPR_NO_SCOPE(NODE) \ - TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) - -/* Nonzero if this statement-expression should cause warning if its result - is not used. */ -#define STMT_EXPR_WARN_UNUSED_RESULT(NODE) \ - TREE_LANG_FLAG_3 (STMT_EXPR_CHECK (NODE)) - -/* LABEL_STMT accessor. This gives access to the label associated with - the given label statement. */ -#define LABEL_STMT_LABEL(NODE) TREE_OPERAND (LABEL_STMT_CHECK (NODE), 0) +/* Nonzero if a label has been added to the statement list. */ +#define STATEMENT_LIST_HAS_LABEL(NODE) \ + TREE_LANG_FLAG_3 (STATEMENT_LIST_CHECK (NODE)) /* COMPOUND_LITERAL_EXPR accessors. */ #define COMPOUND_LITERAL_EXPR_DECL_STMT(NODE) \ TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0) #define COMPOUND_LITERAL_EXPR_DECL(NODE) \ - DECL_STMT_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE)) - -/* Nonzero if this SCOPE_STMT is for the beginning of a scope. */ -#define SCOPE_BEGIN_P(NODE) \ - (TREE_LANG_FLAG_0 (SCOPE_STMT_CHECK (NODE))) - -/* Nonzero if this SCOPE_STMT is for the end of a scope. */ -#define SCOPE_END_P(NODE) \ - (!SCOPE_BEGIN_P (SCOPE_STMT_CHECK (NODE))) - -/* The BLOCK containing the declarations contained in this scope. */ -#define SCOPE_STMT_BLOCK(NODE) \ - (TREE_OPERAND (SCOPE_STMT_CHECK (NODE), 0)) - -/* Nonzero for a SCOPE_STMT if there were no variables in this scope. */ -#define SCOPE_NULLIFIED_P(NODE) \ - (SCOPE_STMT_BLOCK ((NODE)) == NULL_TREE) - -/* Nonzero for a SCOPE_STMT which represents a lexical scope, but - which should be treated as non-existent from the point of view of - running cleanup actions. */ -#define SCOPE_NO_CLEANUPS_P(NODE) \ - (TREE_LANG_FLAG_3 (SCOPE_STMT_CHECK (NODE))) - -/* Nonzero for a SCOPE_STMT if this statement is for a partial scope. - For example, in: - - S s; - l: - S s2; - goto l; - - there is (implicitly) a new scope after `l', even though there are - no curly braces. In particular, when we hit the goto, we must - destroy s2 and then re-construct it. For the implicit scope, - SCOPE_PARTIAL_P will be set. */ -#define SCOPE_PARTIAL_P(NODE) \ - (TREE_LANG_FLAG_4 (SCOPE_STMT_CHECK (NODE))) - -/* Nonzero for an ASM_STMT if the assembly statement is volatile. */ -#define ASM_VOLATILE_P(NODE) \ - (ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE) - -/* The VAR_DECL to clean up in a CLEANUP_STMT. */ -#define CLEANUP_DECL(NODE) \ - TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0) -/* The cleanup to run in a CLEANUP_STMT. */ -#define CLEANUP_EXPR(NODE) \ - TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1) - -/* The filename we are changing to as of this FILE_STMT. */ -#define FILE_STMT_FILENAME_NODE(NODE) \ - (TREE_OPERAND (FILE_STMT_CHECK (NODE), 0)) -#define FILE_STMT_FILENAME(NODE) \ - (IDENTIFIER_POINTER (FILE_STMT_FILENAME_NODE (NODE))) - -/* The line-number at which a statement began. But if - STMT_LINENO_FOR_FN_P does holds, then this macro gives the - line number for the end of the current function instead. */ -#define STMT_LINENO(NODE) \ - (TREE_COMPLEXITY ((NODE))) - -/* If nonzero, the STMT_LINENO for NODE is the line at which the - function ended. */ -#define STMT_LINENO_FOR_FN_P(NODE) \ - (TREE_LANG_FLAG_2 ((NODE))) - -/* Nonzero if we want the new ISO rules for pushing a new scope for `for' - initialization variables. */ -#define NEW_FOR_SCOPE_P(NODE) (TREE_LANG_FLAG_0 (NODE)) - -/* Nonzero if we want to create an ASM_INPUT instead of an - ASM_OPERAND with no operands. */ -#define ASM_INPUT_P(NODE) (TREE_LANG_FLAG_0 (NODE)) + DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE)) #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, @@ -1147,47 +733,6 @@ enum c_tree_code { #undef DEFTREECODE -#define c_common_stmt_codes \ - CLEANUP_STMT, EXPR_STMT, COMPOUND_STMT, \ - DECL_STMT, IF_STMT, FOR_STMT, \ - WHILE_STMT, DO_STMT, RETURN_STMT, \ - BREAK_STMT, CONTINUE_STMT, SCOPE_STMT, \ - SWITCH_STMT, GOTO_STMT, LABEL_STMT, \ - ASM_STMT, FILE_STMT, CASE_LABEL - -/* TRUE if a code represents a statement. The front end init - langhook should take care of initialization of this array. */ -extern bool statement_code_p[MAX_TREE_CODES]; - -#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] - -#define INIT_STATEMENT_CODES(STMT_CODES) \ - do { \ - unsigned int i; \ - memset (&statement_code_p, 0, sizeof (statement_code_p)); \ - for (i = 0; i < ARRAY_SIZE (STMT_CODES); i++) \ - statement_code_p[STMT_CODES[i]] = true; \ - } while (0) - -extern void genrtl_do_pushlevel (void); -extern void genrtl_goto_stmt (tree); -extern void genrtl_expr_stmt (tree); -extern void genrtl_expr_stmt_value (tree, int, int); -extern void genrtl_decl_stmt (tree); -extern void genrtl_if_stmt (tree); -extern void genrtl_while_stmt (tree); -extern void genrtl_do_stmt (tree); -extern void genrtl_return_stmt (tree); -extern void genrtl_for_stmt (tree); -extern void genrtl_break_stmt (void); -extern void genrtl_continue_stmt (void); -extern void genrtl_scope_stmt (tree); -extern void genrtl_switch_stmt (tree); -extern void genrtl_case_label (tree); -extern void genrtl_compound_stmt (tree); -extern void genrtl_asm_stmt (tree, tree, tree, tree, tree, int); -extern void genrtl_cleanup_stmt (tree); -extern int stmts_are_full_exprs_p (void); extern int anon_aggr_type_p (tree); /* For a VAR_DECL that is an anonymous union, these are the various @@ -1202,35 +747,21 @@ extern int anon_aggr_type_p (tree); #define CLEAR_DECL_C_BIT_FIELD(NODE) \ (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) -/* In a VAR_DECL, nonzero if the decl is a register variable with - an explicit asm specification. */ -#define DECL_C_HARD_REGISTER(DECL) DECL_LANG_FLAG_4 (VAR_DECL_CHECK (DECL)) - extern void emit_local_var (tree); -extern void make_rtl_for_local_static (tree); -extern tree expand_cond (tree); -extern tree c_expand_return (tree); extern tree do_case (tree, tree); extern tree build_stmt (enum tree_code, ...); extern tree build_case_label (tree, tree, tree); -extern tree build_continue_stmt (void); -extern tree build_break_stmt (void); -extern tree build_return_stmt (tree); - -#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE) - -/* Used by the C++ frontend to mark the block around the member - initializers and cleanups. */ -#define COMPOUND_STMT_BODY_BLOCK(NODE) TREE_LANG_FLAG_3 (NODE) - -extern void c_expand_asm_operands (tree, tree, tree, tree, int, location_t); /* These functions must be defined by each front-end which implements a variant of the C language. They are used in c-common.c. */ extern tree build_unary_op (enum tree_code, tree, int); extern tree build_binary_op (enum tree_code, tree, tree, int); -extern int lvalue_p (tree); +extern tree perform_integral_promotions (tree); + +/* These functions must be defined by each front-end which implements + a variant of the C language. They are used by port files. */ + extern tree default_conversion (tree); /* Given two integer or real types, return the type for their sum. @@ -1238,38 +769,33 @@ extern tree default_conversion (tree); extern tree common_type (tree, tree); -extern tree expand_tree_builtin (tree, tree, tree); - extern tree decl_constant_value (tree); /* Handle increment and decrement of boolean types. */ extern tree boolean_increment (enum tree_code, tree); -/* Hook currently used only by the C++ front end to reset internal state - after entering or leaving a header file. */ -extern void extract_interface_info (void); - extern int case_compare (splay_tree_key, splay_tree_key); -extern tree c_add_case_label (splay_tree, tree, tree, tree); +extern tree c_add_case_label (splay_tree, tree, tree, tree, tree); + +extern void c_do_switch_warnings (splay_tree, location_t, tree, tree); extern tree build_function_call (tree, tree); +extern tree resolve_overloaded_builtin (tree, tree); + extern tree finish_label_address_expr (tree); /* Same function prototype, but the C and C++ front ends have different implementations. Used in c-common.c. */ extern tree lookup_label (tree); +extern tree lookup_name (tree); extern int vector_types_convertible_p (tree t1, tree t2); extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *); -extern int c_safe_from_p (rtx, tree); - -extern int c_staticp (tree); - -extern int c_common_unsafe_for_reeval (tree); +extern tree c_staticp (tree); extern void init_c_lex (void); @@ -1277,14 +803,21 @@ extern void c_cpp_builtins (cpp_reader *); /* Positive if an implicit `extern "C"' scope has just been entered; negative if such a scope has just been exited. */ -extern int pending_lang_change; +extern GTY(()) int pending_lang_change; /* Information recorded about each file examined during compilation. */ struct c_fileinfo { int time; /* Time spent in the file. */ - short interface_only; /* Flags - used only by C++ */ + + /* Flags used only by C++. + INTERFACE_ONLY nonzero means that we are in an "interface" section + of the compiler. INTERFACE_UNKNOWN nonzero means we cannot trust + the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN is zero and + INTERFACE_ONLY is zero, it means that we are responsible for + exporting definitions that others might need. */ + short interface_only; short interface_unknown; }; @@ -1293,30 +826,114 @@ extern void dump_time_statistics (void); extern bool c_dump_tree (void *, tree); +extern void c_warn_unused_result (tree *); + +extern void verify_sequence_points (tree); + +extern tree fold_offsetof (tree, tree); + +/* Places where an lvalue, or modifiable lvalue, may be required. + Used to select diagnostic messages in lvalue_error and + readonly_error. */ +enum lvalue_use { + lv_assign, + lv_increment, + lv_decrement, + lv_addressof, + lv_asm +}; + +extern void lvalue_error (enum lvalue_use); + +extern int complete_array_type (tree *, tree, bool); + +extern tree builtin_type_for_size (int, bool); + +extern void warn_array_subscript_with_type_char (tree); + +/* In c-gimplify.c */ +extern void c_genericize (tree); +extern int c_gimplify_expr (tree *, tree *, tree *); +extern tree c_build_bind_expr (tree, tree); + +/* In c-pch.c */ extern void pch_init (void); extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd); extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd, const char *orig); extern void c_common_write_pch (void); extern void c_common_no_more_pch (void); +extern void c_common_pch_pragma (cpp_reader *pfile, const char *); +extern void c_common_print_pch_checksum (FILE *f); + +/* In *-checksum.c */ +extern const unsigned char executable_checksum[16]; + extern void builtin_define_with_value (const char *, const char *, int); extern void c_stddef_cpp_builtins (void); extern void fe_file_change (const struct line_map *); -extern int c_estimate_num_insns (tree decl); -extern bool c_decl_uninit (tree t); extern void c_parse_error (const char *, enum cpp_ttype, tree); -/* The following have been moved here from c-tree.h, since they're needed - in the ObjC++ world, too. What is more, stub-objc.c could use a few - prototypes. */ -extern tree lookup_interface (tree); -extern tree is_class_name (tree); +/* Objective-C / Objective-C++ entry points. */ + +/* The following ObjC/ObjC++ functions are called by the C and/or C++ + front-ends; they all must have corresponding stubs in stub-objc.c. */ +extern tree objc_is_class_name (tree); extern tree objc_is_object_ptr (tree); extern void objc_check_decl (tree); -extern int objc_comptypes (tree, tree, int); +extern int objc_is_reserved_word (tree); +extern bool objc_compare_types (tree, tree, int, tree); +extern void objc_volatilize_decl (tree); +extern bool objc_type_quals_match (tree, tree); +extern tree objc_rewrite_function_call (tree, tree); extern tree objc_message_selector (void); -extern tree lookup_objc_ivar (tree); -extern void *get_current_scope (void); +extern tree objc_lookup_ivar (tree, tree); +extern void objc_clear_super_receiver (void); +extern int objc_is_public (tree, tree); +extern tree objc_is_id (tree); +extern void objc_declare_alias (tree, tree); +extern void objc_declare_class (tree); +extern void objc_declare_protocols (tree); +extern tree objc_build_message_expr (tree); +extern tree objc_finish_message_expr (tree, tree, tree); +extern tree objc_build_selector_expr (tree); +extern tree objc_build_protocol_expr (tree); +extern tree objc_build_encode_expr (tree); +extern tree objc_build_string_object (tree); +extern tree objc_get_protocol_qualified_type (tree, tree); +extern tree objc_get_class_reference (tree); +extern tree objc_get_class_ivars (tree); +extern void objc_start_class_interface (tree, tree, tree); +extern void objc_start_category_interface (tree, tree, tree); +extern void objc_start_protocol (tree, tree); +extern void objc_continue_interface (void); +extern void objc_finish_interface (void); +extern void objc_start_class_implementation (tree, tree); +extern void objc_start_category_implementation (tree, tree); +extern void objc_continue_implementation (void); +extern void objc_finish_implementation (void); +extern void objc_set_visibility (int); +extern void objc_set_method_type (enum tree_code); +extern tree objc_build_method_signature (tree, tree, tree, bool); +extern void objc_add_method_declaration (tree); +extern void objc_start_method_definition (tree); +extern void objc_finish_method_definition (tree); +extern void objc_add_instance_variable (tree); +extern tree objc_build_keyword_decl (tree, tree, tree); +extern tree objc_build_throw_stmt (tree); +extern void objc_begin_try_stmt (location_t, tree); +extern tree objc_finish_try_stmt (void); +extern void objc_begin_catch_clause (tree); +extern void objc_finish_catch_clause (void); +extern void objc_build_finally_clause (location_t, tree); +extern tree objc_build_synchronized (location_t, tree, tree); +extern int objc_static_init_needed_p (void); +extern tree objc_generate_static_init_call (tree); +extern tree objc_generate_write_barrier (tree, enum tree_code, tree); + +/* The following are provided by the C and C++ front-ends, and called by + ObjC/ObjC++. */ +extern void *objc_get_current_scope (void); extern void objc_mark_locals_volatile (void *); /* In c-ppoutput.c */ @@ -1324,5 +941,30 @@ extern void init_pp_output (FILE *); extern void preprocess_file (cpp_reader *); extern void pp_file_change (const struct line_map *); extern void pp_dir_change (cpp_reader *, const char *); +extern bool check_missing_format_attribute (tree, tree); + +/* In c-omp.c */ +extern tree c_finish_omp_master (tree); +extern tree c_finish_omp_critical (tree, tree); +extern tree c_finish_omp_ordered (tree); +extern void c_finish_omp_barrier (void); +extern tree c_finish_omp_atomic (enum tree_code, tree, tree); +extern void c_finish_omp_flush (void); +extern tree c_finish_omp_for (location_t, tree, tree, tree, tree, tree, tree); +extern void c_split_parallel_clauses (tree, tree *, tree *); +extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree); + +/* Not in c-omp.c; provided by the front end. */ +extern bool c_omp_sharing_predetermined (tree); +extern tree c_omp_remap_decl (tree, bool); + +/* In order for the format checking to accept the C frontend + diagnostic framework extensions, you must include this file before + toplev.h, not after. The C front end formats are a subset of those + for C++, so they are the appropriate set to use in common code; + cp-tree.h overrides this for C++. */ +#ifndef GCC_DIAG_STYLE +#define GCC_DIAG_STYLE __gcc_cdiag__ +#endif #endif /* ! GCC_C_COMMON_H */ diff --git a/contrib/gcc/c-config-lang.in b/contrib/gcc/c-config-lang.in index c0a786f53fd..01fe1d02936 100644 --- a/contrib/gcc/c-config-lang.in +++ b/contrib/gcc/c-config-lang.in @@ -1,5 +1,5 @@ # Top level configure fragment for GNU C - C language. -# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. #This file is part of GCC. @@ -15,12 +15,12 @@ #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. +#the Free Software Foundation, 51 Franklin Street, Fifth Floor, +#Boston, MA 02110-1301, USA. # This file c-config-lang.c is a special pseudo config-lang.in file # for the language C. It has limited use, specifically to record the # files used by C that have garbage collection GTY macros in them # which therefore need to be scanned by gengtype.c. -gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c" +gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-parser.c" diff --git a/contrib/gcc/c-convert.c b/contrib/gcc/c-convert.c index ce095acc29a..bf306c8ea2f 100644 --- a/contrib/gcc/c-convert.c +++ b/contrib/gcc/c-convert.c @@ -1,5 +1,5 @@ /* Language-level data type conversion for GNU C. - Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003 + Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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 contains the functions for converting C expressions @@ -33,7 +33,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "flags.h" #include "convert.h" #include "c-common.h" +#include "c-tree.h" +#include "langhooks.h" #include "toplev.h" +#include "target.h" /* Change of width--truncation and extension of integers or reals-- is represented with NOP_EXPR. Proper functioning of many things @@ -67,14 +70,25 @@ convert (tree type, tree expr) { tree e = expr; enum tree_code code = TREE_CODE (type); + const char *invalid_conv_diag; - if (type == TREE_TYPE (expr) - || TREE_CODE (expr) == ERROR_MARK - || code == ERROR_MARK || TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK) + if (type == error_mark_node + || expr == error_mark_node + || TREE_TYPE (expr) == error_mark_node) + return error_mark_node; + + if ((invalid_conv_diag + = targetm.invalid_conversion (TREE_TYPE (expr), type))) + { + error (invalid_conv_diag); + return error_mark_node; + } + + if (type == TREE_TYPE (expr)) return expr; if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr))) - return fold (build1 (NOP_EXPR, type, expr)); + return fold_convert (type, expr); if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK) return error_mark_node; if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE) @@ -83,25 +97,11 @@ convert (tree type, tree expr) return error_mark_node; } if (code == VOID_TYPE) - return build1 (CONVERT_EXPR, type, e); -#if 0 - /* This is incorrect. A truncation can't be stripped this way. - Extensions will be stripped by the use of get_unwidened. */ - if (TREE_CODE (expr) == NOP_EXPR) - return convert (type, TREE_OPERAND (expr, 0)); -#endif + return fold_convert (type, e); if (code == INTEGER_TYPE || code == ENUMERAL_TYPE) return fold (convert_to_integer (type, e)); if (code == BOOLEAN_TYPE) - { - tree t = c_common_truthvalue_conversion (expr); - /* If it returns a NOP_EXPR, we must fold it here to avoid - infinite recursion between fold () and convert (). */ - if (TREE_CODE (t) == NOP_EXPR) - return fold (build1 (NOP_EXPR, type, TREE_OPERAND (t, 0))); - else - return fold (build1 (NOP_EXPR, type, t)); - } + return fold_convert (type, c_objc_common_truthvalue_conversion (expr)); if (code == POINTER_TYPE || code == REFERENCE_TYPE) return fold (convert_to_pointer (type, e)); if (code == REAL_TYPE) @@ -110,6 +110,9 @@ convert (tree type, tree expr) return fold (convert_to_complex (type, e)); if (code == VECTOR_TYPE) return fold (convert_to_vector (type, e)); + if ((code == RECORD_TYPE || code == UNION_TYPE) + && lang_hooks.types_compatible_p (type, TREE_TYPE (expr))) + return e; error ("conversion to non-scalar type requested"); return error_mark_node; diff --git a/contrib/gcc/c-cppbuiltin.c b/contrib/gcc/c-cppbuiltin.c index 8573b8c5a46..45e2acbf88a 100644 --- a/contrib/gcc/c-cppbuiltin.c +++ b/contrib/gcc/c-cppbuiltin.c @@ -1,5 +1,5 @@ /* Define builtin-in macros for the C family front ends. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,14 +15,15 @@ for more details. 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. */ #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "version.h" #include "flags.h" #include "real.h" #include "c-common.h" @@ -31,6 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ #include "toplev.h" #include "tm_p.h" /* Target prototypes. */ +#include "target.h" #ifndef TARGET_OS_CPP_BUILTINS # define TARGET_OS_CPP_BUILTINS() @@ -51,10 +53,14 @@ static void builtin_define_with_value_n (const char *, const char *, static void builtin_define_with_int_value (const char *, HOST_WIDE_INT); static void builtin_define_with_hex_fp_value (const char *, tree, int, const char *, + const char *, const char *); +static void builtin_define_stdint_macros (void); static void builtin_define_type_max (const char *, tree, int); static void builtin_define_type_precision (const char *, tree); -static void builtin_define_float_constants (const char *, const char *, +static void builtin_define_float_constants (const char *, + const char *, + const char *, tree); static void define__GNUC__ (void); @@ -65,9 +71,13 @@ builtin_define_type_precision (const char *name, tree type) builtin_define_with_int_value (name, TYPE_PRECISION (type)); } -/* Define the float.h constants for TYPE using NAME_PREFIX and FP_SUFFIX. */ +/* Define the float.h constants for TYPE using NAME_PREFIX, FP_SUFFIX, + and FP_CAST. */ static void -builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, tree type) +builtin_define_float_constants (const char *name_prefix, + const char *fp_suffix, + const char *fp_cast, + tree type) { /* Used to convert radix-based values to base 10 values in several cases. @@ -86,6 +96,7 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, int decimal_dig; fmt = REAL_MODE_FORMAT (TYPE_MODE (type)); + gcc_assert (fmt->b != 10); /* The radix of the exponent representation. */ if (type == float_type_node) @@ -205,19 +216,24 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, } } sprintf (name, "__%s_MAX__", name_prefix); - builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix); + builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast); /* The minimum normalized positive floating-point number, b**(emin-1). */ sprintf (name, "__%s_MIN__", name_prefix); sprintf (buf, "0x1p%d", (fmt->emin - 1) * fmt->log2_b); - builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix); + builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast); /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**(1-p). */ sprintf (name, "__%s_EPSILON__", name_prefix); - sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b); - builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix); + if (fmt->pnan < fmt->p) + /* This is an IBM extended double format, so 1.0 + any double is + representable precisely. */ + sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b); + else + sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b); + builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast); /* For C++ std::numeric_limits::denorm_min. The minimum denormalized positive floating-point number, b**(emin-p). Zero for formats that @@ -227,7 +243,7 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, { sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b); builtin_define_with_hex_fp_value (name, type, decimal_dig, - buf, fp_suffix); + buf, fp_suffix, fp_cast); } else { @@ -235,6 +251,9 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, builtin_define_with_value (name, buf, 0); } + sprintf (name, "__%s_HAS_DENORM__", name_prefix); + builtin_define_with_value (name, fmt->has_denorm ? "1" : "0", 0); + /* For C++ std::numeric_limits::has_infinity. */ sprintf (name, "__%s_HAS_INFINITY__", name_prefix); builtin_define_with_int_value (name, @@ -248,6 +267,70 @@ builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, builtin_define_with_int_value (name, MODE_HAS_NANS (TYPE_MODE (type))); } +/* Define __DECx__ constants for TYPE using NAME_PREFIX and SUFFIX. */ +static void +builtin_define_decimal_float_constants (const char *name_prefix, + const char *suffix, + tree type) +{ + const struct real_format *fmt; + char name[64], buf[128], *p; + int digits; + + fmt = REAL_MODE_FORMAT (TYPE_MODE (type)); + + /* The number of radix digits, p, in the significand. */ + sprintf (name, "__%s_MANT_DIG__", name_prefix); + builtin_define_with_int_value (name, fmt->p); + + /* The minimum negative int x such that b**(x-1) is a normalized float. */ + sprintf (name, "__%s_MIN_EXP__", name_prefix); + sprintf (buf, "(%d)", fmt->emin); + builtin_define_with_value (name, buf, 0); + + /* The maximum int x such that b**(x-1) is a representable float. */ + sprintf (name, "__%s_MAX_EXP__", name_prefix); + builtin_define_with_int_value (name, fmt->emax); + + /* Compute the minimum representable value. */ + sprintf (name, "__%s_MIN__", name_prefix); + sprintf (buf, "1E%d%s", fmt->emin, suffix); + builtin_define_with_value (name, buf, 0); + + /* Compute the maximum representable value. */ + sprintf (name, "__%s_MAX__", name_prefix); + p = buf; + for (digits = fmt->p; digits; digits--) + { + *p++ = '9'; + if (digits == fmt->p) + *p++ = '.'; + } + *p = 0; + /* fmt->p plus 1, to account for the decimal point. */ + sprintf (&buf[fmt->p + 1], "E%d%s", fmt->emax, suffix); + builtin_define_with_value (name, buf, 0); + + /* Compute epsilon (the difference between 1 and least value greater + than 1 representable). */ + sprintf (name, "__%s_EPSILON__", name_prefix); + sprintf (buf, "1E-%d%s", fmt->p - 1, suffix); + builtin_define_with_value (name, buf, 0); + + /* Minimum denormalized postive decimal value. */ + sprintf (name, "__%s_DEN__", name_prefix); + p = buf; + for (digits = fmt->p; digits > 1; digits--) + { + *p++ = '0'; + if (digits == fmt->p) + *p++ = '.'; + } + *p = 0; + sprintf (&buf[fmt->p], "1E%d%s", fmt->emin, suffix); + builtin_define_with_value (name, buf, 0); +} + /* Define __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__. */ static void define__GNUC__ (void) @@ -256,10 +339,9 @@ define__GNUC__ (void) ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */ const char *q, *v = version_string; - while (*v && ! ISDIGIT (*v)) + while (*v && !ISDIGIT (*v)) v++; - if (!*v || (v > version_string && v[-1] != '-')) - abort (); + gcc_assert (*v && (v <= version_string || v[-1] == '-')); q = v; while (ISDIGIT (*v)) @@ -268,8 +350,8 @@ define__GNUC__ (void) if (c_dialect_cxx ()) builtin_define_with_value_n ("__GNUG__", q, v - q); - if (*v != '.' || !ISDIGIT (v[1])) - abort (); + gcc_assert (*v == '.' && ISDIGIT (v[1])); + q = ++v; while (ISDIGIT (*v)) v++; @@ -277,8 +359,7 @@ define__GNUC__ (void) if (*v == '.') { - if (!ISDIGIT (v[1])) - abort (); + gcc_assert (ISDIGIT (v[1])); q = ++v; while (ISDIGIT (*v)) v++; @@ -287,8 +368,24 @@ define__GNUC__ (void) else builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1); - if (*v && *v != ' ' && *v != '-') - abort (); + gcc_assert (!*v || *v == ' ' || *v == '-'); +} + +/* Define macros used by . Currently only defines limits + for intmax_t, used by the testsuite. */ +static void +builtin_define_stdint_macros (void) +{ + int intmax_long; + if (intmax_type_node == long_long_integer_type_node) + intmax_long = 2; + else if (intmax_type_node == long_integer_type_node) + intmax_long = 1; + else if (intmax_type_node == integer_type_node) + intmax_long = 0; + else + gcc_unreachable (); + builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node, intmax_long); } /* Hook that registers front end and target-specific built-ins. */ @@ -306,7 +403,7 @@ c_cpp_builtins (cpp_reader *pfile) if (c_dialect_cxx ()) { - if (SUPPORTS_ONE_ONLY) + if (flag_weak && SUPPORTS_ONE_ONLY) cpp_define (pfile, "__GXX_WEAK__=1"); else cpp_define (pfile, "__GXX_WEAK__=0"); @@ -323,19 +420,19 @@ c_cpp_builtins (cpp_reader *pfile) if (flag_abi_version == 0) /* Use a very large value so that: - #if __GXX_ABI_VERSION >= + #if __GXX_ABI_VERSION >= will work whether the user explicitly says "-fabi-version=x" or "-fabi-version=0". Do not use INT_MAX because that will be different from system to system. */ builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999); else if (flag_abi_version == 1) - /* Due to an historical accident, this version had the value + /* Due to a historical accident, this version had the value "102". */ builtin_define_with_int_value ("__GXX_ABI_VERSION", 102); else /* Newer versions have values 1002, 1003, .... */ - builtin_define_with_int_value ("__GXX_ABI_VERSION", + builtin_define_with_int_value ("__GXX_ABI_VERSION", 1000 + flag_abi_version); /* libgcc needs to know this. */ @@ -352,14 +449,33 @@ c_cpp_builtins (cpp_reader *pfile) builtin_define_type_precision ("__CHAR_BIT__", char_type_node); + /* stdint.h (eventually) and the testsuite need to know these. */ + builtin_define_stdint_macros (); + /* float.h needs to know these. */ builtin_define_with_int_value ("__FLT_EVAL_METHOD__", TARGET_FLT_EVAL_METHOD); - builtin_define_float_constants ("FLT", "F", float_type_node); - builtin_define_float_constants ("DBL", "", double_type_node); - builtin_define_float_constants ("LDBL", "L", long_double_type_node); + /* And decfloat.h needs this. */ + builtin_define_with_int_value ("__DEC_EVAL_METHOD__", + TARGET_DEC_EVAL_METHOD); + + builtin_define_float_constants ("FLT", "F", "%s", float_type_node); + /* Cast the double precision constants when single precision constants are + specified. The correct result is computed by the compiler when using + macros that include a cast. This has the side-effect of making the value + unusable in const expressions. */ + if (flag_single_precision_constant) + builtin_define_float_constants ("DBL", "L", "((double)%s)", double_type_node); + else + builtin_define_float_constants ("DBL", "", "%s", double_type_node); + builtin_define_float_constants ("LDBL", "L", "%s", long_double_type_node); + + /* For decfloat.h. */ + builtin_define_decimal_float_constants ("DEC32", "DF", dfloat32_type_node); + builtin_define_decimal_float_constants ("DEC64", "DD", dfloat64_type_node); + builtin_define_decimal_float_constants ("DEC128", "DL", dfloat128_type_node); /* For use in assembly language. */ builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); @@ -368,6 +484,8 @@ c_cpp_builtins (cpp_reader *pfile) /* Misc. */ builtin_define_with_value ("__VERSION__", version_string, 1); + cpp_define (pfile, "__GNUC_GNU_INLINE__"); + /* Definitions for LP64 model. */ if (TYPE_PRECISION (long_integer_type_node) == 64 && POINTER_SIZE == 64 @@ -394,6 +512,11 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__FINITE_MATH_ONLY__=1"); else cpp_define (pfile, "__FINITE_MATH_ONLY__=0"); + if (flag_pic) + { + builtin_define_with_int_value ("__pic__", flag_pic); + builtin_define_with_int_value ("__PIC__", flag_pic); + } if (flag_iso) cpp_define (pfile, "__STRICT_ANSI__"); @@ -401,13 +524,31 @@ c_cpp_builtins (cpp_reader *pfile) if (!flag_signed_char) cpp_define (pfile, "__CHAR_UNSIGNED__"); - if (c_dialect_cxx () && TREE_UNSIGNED (wchar_type_node)) + if (c_dialect_cxx () && TYPE_UNSIGNED (wchar_type_node)) cpp_define (pfile, "__WCHAR_UNSIGNED__"); /* Make the choice of ObjC runtime visible to source code. */ if (c_dialect_objc () && flag_next_runtime) cpp_define (pfile, "__NEXT_RUNTIME__"); + /* Show the availability of some target pragmas. */ + if (flag_mudflap || targetm.handle_pragma_redefine_extname) + cpp_define (pfile, "__PRAGMA_REDEFINE_EXTNAME"); + + if (targetm.handle_pragma_extern_prefix) + cpp_define (pfile, "__PRAGMA_EXTERN_PREFIX"); + + /* Make the choice of the stack protector runtime visible to source code. + The macro names and values here were chosen for compatibility with an + earlier implementation, i.e. ProPolice. */ + if (flag_stack_protect == 2) + cpp_define (pfile, "__SSP_ALL__=2"); + else if (flag_stack_protect == 1) + cpp_define (pfile, "__SSP__=1"); + + if (flag_openmp) + cpp_define (pfile, "_OPENMP=200505"); + /* A straightforward target hook doesn't work, because of problems linking that hook's body when part of non-C front ends. */ # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM) @@ -417,6 +558,15 @@ c_cpp_builtins (cpp_reader *pfile) TARGET_CPU_CPP_BUILTINS (); TARGET_OS_CPP_BUILTINS (); TARGET_OBJFMT_CPP_BUILTINS (); + + /* Support the __declspec keyword by turning them into attributes. + Note that the current way we do this may result in a collision + with predefined attributes later on. This can be solved by using + one attribute, say __declspec__, and passing args to it. The + problem with that approach is that args are not accumulated: each + new appearance would clobber any existing args. */ + if (TARGET_DECLSPEC) + builtin_define ("__declspec(x)=__attribute__((x))"); } /* Pass an object-like macro. If it doesn't lie in the user's @@ -432,7 +582,7 @@ void builtin_define_std (const char *macro) { size_t len = strlen (macro); - char *buff = alloca (len + 5); + char *buff = (char *) alloca (len + 5); char *p = buff + 2; char *q = p + len; @@ -478,7 +628,7 @@ builtin_define_with_value (const char *macro, const char *expansion, int is_str) if (is_str) extra += 2; /* space for two quote marks */ - buf = alloca (mlen + elen + extra); + buf = (char *) alloca (mlen + elen + extra); if (is_str) sprintf (buf, "%s=\"%s\"", macro, expansion); else @@ -496,7 +646,7 @@ builtin_define_with_value_n (const char *macro, const char *expansion, size_t el size_t mlen = strlen (macro); /* Space for an = and a NUL. */ - buf = alloca (mlen + elen + 2); + buf = (char *) alloca (mlen + elen + 2); memcpy (buf, macro, mlen); buf[mlen] = '='; memcpy (buf + mlen + 1, expansion, elen); @@ -514,7 +664,7 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value) size_t vlen = 18; size_t extra = 2; /* space for = and NUL. */ - buf = alloca (mlen + vlen + extra); + buf = (char *) alloca (mlen + vlen + extra); memcpy (buf, macro, mlen); buf[mlen] = '='; sprintf (buf + mlen + 1, HOST_WIDE_INT_PRINT_DEC, value); @@ -526,10 +676,12 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value) static void builtin_define_with_hex_fp_value (const char *macro, tree type ATTRIBUTE_UNUSED, int digits, - const char *hex_str, const char *fp_suffix) + const char *hex_str, + const char *fp_suffix, + const char *fp_cast) { REAL_VALUE_TYPE real; - char dec_str[64], buf[256]; + char dec_str[64], buf1[256], buf2[256]; /* Hex values are really cool and convenient, except that they're not supported in strict ISO C90 mode. First, the "p-" sequence @@ -544,8 +696,13 @@ builtin_define_with_hex_fp_value (const char *macro, real_from_string (&real, hex_str); real_to_decimal (dec_str, &real, sizeof (dec_str), digits, 0); - sprintf (buf, "%s=%s%s", macro, dec_str, fp_suffix); - cpp_define (parse_in, buf); + /* Assemble the macro in the following fashion + macro = fp_cast [dec_str fp_suffix] */ + sprintf (buf1, "%s%s", dec_str, fp_suffix); + sprintf (buf2, fp_cast, buf1); + sprintf (buf1, "%s=%s", macro, buf2); + + cpp_define (parse_in, buf1); } /* Define MAX for TYPE based on the precision of the type. IS_LONG is @@ -578,13 +735,14 @@ builtin_define_type_max (const char *macro, tree type, int is_long) case 32: idx = 4; break; case 64: idx = 6; break; case 128: idx = 8; break; - default: abort (); + default: gcc_unreachable (); } - value = values[idx + TREE_UNSIGNED (type)]; - suffix = suffixes[is_long * 2 + TREE_UNSIGNED (type)]; + value = values[idx + TYPE_UNSIGNED (type)]; + suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)]; - buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1); + buf = (char *) alloca (strlen (macro) + 1 + strlen (value) + + strlen (suffix) + 1); sprintf (buf, "%s=%s%s", macro, value, suffix); cpp_define (parse_in, buf); diff --git a/contrib/gcc/c-decl.c b/contrib/gcc/c-decl.c index 66e0fd7d484..00b372e222d 100644 --- a/contrib/gcc/c-decl.c +++ b/contrib/gcc/c-decl.c @@ -1,6 +1,6 @@ /* Process declarations and variables for C compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ /* Process declarations and symbol lookup for C front end. Also constructs types; the standard scalar types at initialization, @@ -29,6 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "config.h" #include "system.h" #include "coretypes.h" +#include "input.h" #include "tm.h" #include "intl.h" #include "tree.h" @@ -49,11 +50,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "timevar.h" #include "c-common.h" #include "c-pragma.h" +#include "langhooks.h" +#include "tree-mudflap.h" +#include "tree-gimple.h" +#include "diagnostic.h" +#include "tree-dump.h" #include "cgraph.h" #include "hashtab.h" #include "libfuncs.h" #include "except.h" #include "langhooks-def.h" +#include "pointer-set.h" /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context @@ -66,11 +73,14 @@ enum decl_context /* Nonzero if we have seen an invalid cross reference to a struct, union, or enum, but not yet printed the message. */ - tree pending_invalid_xref; + /* File and line to appear in the eventual error message. */ location_t pending_invalid_xref_location; +/* True means we've initialized exception handling. */ +bool c_eh_initialized_p; + /* While defining an enum type, this is 1 plus the last enumerator constant value. Note that will do not have to save this or `enum_overflow' around nested function definition since such a definition could only @@ -83,64 +93,46 @@ static tree enum_next_value; static int enum_overflow; -/* Parsing a function declarator leaves a list of parameter names - or a chain of parameter decls here. */ - -static tree last_function_parms; - -/* ... and a chain of structure and enum types declared in the - parmlist here. */ - -static tree last_function_parm_tags; - -/* ... and a chain of all non-parameter declarations (such as - CONST_DECLs from enumerations) here. */ - -static tree last_function_parm_others; - -/* After parsing the declarator that starts a function definition, - `start_function' puts the list of parameter names or chain of decls here - for `store_parm_decls' to find. */ - -static tree current_function_parms; - -/* Similar, for last_function_parm_tags. */ - -static tree current_function_parm_tags; - -/* And for last_function_parm_others. */ - -static tree current_function_parm_others; - -/* Similar, for the file and line that the prototype came from if this is - an old-style definition. */ +/* The file and line that the prototype came from if this is an + old-style definition; used for diagnostics in + store_parm_decls_oldstyle. */ static location_t current_function_prototype_locus; +/* Whether this prototype was built-in. */ + +static bool current_function_prototype_built_in; + +/* The argument type information of this prototype. */ + +static tree current_function_prototype_arg_types; + +/* The argument information structure for the function currently being + defined. */ + +static struct c_arg_info *current_function_arg_info; + +/* The obstack on which parser and related data structures, which are + not live beyond their top-level declaration or definition, are + allocated. */ +struct obstack parser_obstack; + /* The current statement tree. */ static GTY(()) struct stmt_tree_s c_stmt_tree; -/* The current scope statement stack. */ - -static GTY(()) tree c_scope_stmt_stack; - /* State saving variables. */ -int c_in_iteration_stmt; -int c_in_case_stmt; +tree c_break_label; +tree c_cont_label; -/* A list of external DECLs that appeared at block scope when there was - some other global meaning for that identifier. */ -static GTY(()) tree truly_local_externals; +/* Linked list of TRANSLATION_UNIT_DECLS for the translation units + included in this invocation. Note that the current translation + unit is not included in this list. */ -/* All the builtins; this is a subset of the entries of global_scope. */ +static GTY(()) tree all_translation_units; -static GTY(()) tree first_builtin_decl; -static GTY(()) tree last_builtin_decl; - -/* A DECL for the current file-scope context. */ - -static GTY(()) tree current_file_decl; +/* A list of decls to be made automatically visible in each file scope. */ +static GTY(()) tree visible_builtins; /* Set to 0 at beginning of a function definition, set to 1 if a return statement that specifies a return value is seen. */ @@ -165,10 +157,115 @@ static int warn_about_return_type; /* Nonzero when starting a function declared `extern inline'. */ static int current_extern_inline; + +/* Nonzero when the current toplevel function contains a declaration + of a nested function which is never defined. */ + +static bool undef_nested_function; + +/* True means global_bindings_p should return false even if the scope stack + says we are in file scope. */ +bool c_override_global_bindings_to_false; + -/* Each c_scope structure describes the complete contents of one scope. - Three scopes are distinguished specially: the innermost or current - scope, the innermost function scope, and the outermost or file scope. +/* Each c_binding structure describes one binding of an identifier to + a decl. All the decls in a scope - irrespective of namespace - are + chained together by the ->prev field, which (as the name implies) + runs in reverse order. All the decls in a given namespace bound to + a given identifier are chained by the ->shadowed field, which runs + from inner to outer scopes. + + The ->decl field usually points to a DECL node, but there are two + exceptions. In the namespace of type tags, the bound entity is a + RECORD_TYPE, UNION_TYPE, or ENUMERAL_TYPE node. If an undeclared + identifier is encountered, it is bound to error_mark_node to + suppress further errors about that identifier in the current + function. + + The ->type field stores the type of the declaration in this scope; + if NULL, the type is the type of the ->decl field. This is only of + relevance for objects with external or internal linkage which may + be redeclared in inner scopes, forming composite types that only + persist for the duration of those scopes. In the external scope, + this stores the composite of all the types declared for this + object, visible or not. The ->inner_comp field (used only at file + scope) stores whether an incomplete array type at file scope was + completed at an inner scope to an array size other than 1. + + The depth field is copied from the scope structure that holds this + decl. It is used to preserve the proper ordering of the ->shadowed + field (see bind()) and also for a handful of special-case checks. + Finally, the invisible bit is true for a decl which should be + ignored for purposes of normal name lookup, and the nested bit is + true for a decl that's been bound a second time in an inner scope; + in all such cases, the binding in the outer scope will have its + invisible bit true. */ + +struct c_binding GTY((chain_next ("%h.prev"))) +{ + tree decl; /* the decl bound */ + tree type; /* the type in this scope */ + tree id; /* the identifier it's bound to */ + struct c_binding *prev; /* the previous decl in this scope */ + struct c_binding *shadowed; /* the innermost decl shadowed by this one */ + unsigned int depth : 28; /* depth of this scope */ + BOOL_BITFIELD invisible : 1; /* normal lookup should ignore this binding */ + BOOL_BITFIELD nested : 1; /* do not set DECL_CONTEXT when popping */ + BOOL_BITFIELD inner_comp : 1; /* incomplete array completed in inner scope */ + /* one free bit */ +}; +#define B_IN_SCOPE(b1, b2) ((b1)->depth == (b2)->depth) +#define B_IN_CURRENT_SCOPE(b) ((b)->depth == current_scope->depth) +#define B_IN_FILE_SCOPE(b) ((b)->depth == 1 /*file_scope->depth*/) +#define B_IN_EXTERNAL_SCOPE(b) ((b)->depth == 0 /*external_scope->depth*/) + +#define I_SYMBOL_BINDING(node) \ + (((struct lang_identifier *) IDENTIFIER_NODE_CHECK(node))->symbol_binding) +#define I_SYMBOL_DECL(node) \ + (I_SYMBOL_BINDING(node) ? I_SYMBOL_BINDING(node)->decl : 0) + +#define I_TAG_BINDING(node) \ + (((struct lang_identifier *) IDENTIFIER_NODE_CHECK(node))->tag_binding) +#define I_TAG_DECL(node) \ + (I_TAG_BINDING(node) ? I_TAG_BINDING(node)->decl : 0) + +#define I_LABEL_BINDING(node) \ + (((struct lang_identifier *) IDENTIFIER_NODE_CHECK(node))->label_binding) +#define I_LABEL_DECL(node) \ + (I_LABEL_BINDING(node) ? I_LABEL_BINDING(node)->decl : 0) + +/* Each C symbol points to three linked lists of c_binding structures. + These describe the values of the identifier in the three different + namespaces defined by the language. */ + +struct lang_identifier GTY(()) +{ + struct c_common_identifier common_id; + struct c_binding *symbol_binding; /* vars, funcs, constants, typedefs */ + struct c_binding *tag_binding; /* struct/union/enum tags */ + struct c_binding *label_binding; /* labels */ +}; + +/* Validate c-lang.c's assumptions. */ +extern char C_SIZEOF_STRUCT_LANG_IDENTIFIER_isnt_accurate +[(sizeof(struct lang_identifier) == C_SIZEOF_STRUCT_LANG_IDENTIFIER) ? 1 : -1]; + +/* The resulting tree type. */ + +union lang_tree_node + GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), + chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : (union lang_tree_node *) TREE_CHAIN (&%h.generic)"))) +{ + union tree_node GTY ((tag ("0"), + desc ("tree_node_structure (&%h)"))) + generic; + struct lang_identifier GTY ((tag ("1"))) identifier; +}; + +/* Each c_scope structure describes the complete contents of one + scope. Four scopes are distinguished specially: the innermost or + current scope, the innermost function scope, the file scope (always + the second to outermost) and the outermost or external scope. Most declarations are recorded in the current scope. @@ -178,20 +275,39 @@ static int current_extern_inline; hence the 'innermost' qualifier.) Explicitly declared labels (using the __label__ extension) appear in the current scope. - Being in the global scope (current_scope == global_scope) causes + Being in the file scope (current_scope == file_scope) causes special behavior in several places below. Also, under some conditions the Objective-C front end records declarations in the - global scope even though that isn't the current scope. + file scope even though that isn't the current scope. - The order of the names, parms, and blocks lists matters, and they - are frequently appended to. To avoid having to walk all the way to - the end of the list on each insertion, or reverse the lists later, - we maintain a pointer to the last list entry for each of the lists. + All declarations with external linkage are recorded in the external + scope, even if they aren't visible there; this models the fact that + such declarations are visible to the entire program, and (with a + bit of cleverness, see pushdecl) allows diagnosis of some violations + of C99 6.2.2p7 and 6.2.7p2: - The order of the tags, shadowed, and shadowed_tags - lists does not matter, so we just prepend to these lists. */ + If, within the same translation unit, the same identifier appears + with both internal and external linkage, the behavior is + undefined. -struct c_scope GTY(()) + All declarations that refer to the same object or function shall + have compatible type; otherwise, the behavior is undefined. + + Initially only the built-in declarations, which describe compiler + intrinsic functions plus a subset of the standard library, are in + this scope. + + The order of the blocks list matters, and it is frequently appended + to. To avoid having to walk all the way to the end of the list on + each insertion, or reverse the list later, we maintain a pointer to + the last list entry. (FIXME: It should be feasible to use a reversed + list here.) + + The bindings list is strictly in reverse order of declarations; + pop_scope relies on this. */ + + +struct c_scope GTY((chain_next ("%h.outer"))) { /* The scope containing this one. */ struct c_scope *outer; @@ -199,39 +315,26 @@ struct c_scope GTY(()) /* The next outermost function scope. */ struct c_scope *outer_function; - /* All variables, constants, functions, labels, and typedef names. */ - tree names; - tree names_last; - - /* All parameter declarations. Used only in the outermost scope of - a function. */ - tree parms; - tree parms_last; - - /* All structure, union, and enum type tags. */ - tree tags; - - /* For each scope, a list of shadowed outer-scope definitions - to be restored when this scope is popped. - Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and - whose TREE_VALUE is its old definition (a kind of ..._DECL node). */ - tree shadowed; - - /* For each scope, a list of shadowed outer-scope tag definitions - to be restored when this scope is popped. - Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and - whose TREE_VALUE is its old definition (a kind of ..._TYPE node). */ - tree shadowed_tags; + /* All bindings in this scope. */ + struct c_binding *bindings; /* For each scope (except the global one), a chain of BLOCK nodes for all the scopes that were entered and exited one level down. */ tree blocks; tree blocks_last; + /* The depth of this scope. Used to keep the ->shadowed chain of + bindings sorted innermost to outermost. */ + unsigned int depth : 28; + /* True if we are currently filling this scope with parameter declarations. */ BOOL_BITFIELD parm_flag : 1; + /* True if we saw [*] in this scope. Used to give an error messages + if these appears in a function definition. */ + BOOL_BITFIELD had_vla_unspec : 1; + /* True if we already complained about forward parameter decls in this scope. This prevents double warnings on foo (int a; int b; ...) */ @@ -251,20 +354,28 @@ struct c_scope GTY(()) static GTY(()) struct c_scope *current_scope; -/* A chain of c_scope structures awaiting reuse. */ - -static GTY((deletable (""))) struct c_scope *scope_freelist; - /* The innermost function scope. Ordinary (not explicitly declared) labels, bindings to error_mark_node, and the lazily-created bindings of __func__ and its friends get this scope. */ static GTY(()) struct c_scope *current_function_scope; -/* The outermost scope, corresponding to the C "file scope". This is - created when the compiler is started and exists through the entire run. */ +/* The C file scope. This is reset for each input translation unit. */ -static GTY(()) struct c_scope *global_scope; +static GTY(()) struct c_scope *file_scope; + +/* The outermost scope. This is used for all declarations with + external linkage, and only these, hence the name. */ + +static GTY(()) struct c_scope *external_scope; + +/* A chain of c_scope structures awaiting reuse. */ + +static GTY((deletable)) struct c_scope *scope_freelist; + +/* A chain of c_binding structures awaiting reuse. */ + +static GTY((deletable)) struct c_binding *binding_freelist; /* Append VAR to LIST in scope SCOPE. */ #define SCOPE_LIST_APPEND(scope, list, decl) do { \ @@ -292,7 +403,7 @@ static GTY(()) struct c_scope *global_scope; static bool keep_next_level_flag; -/* True means the next call to pushlevel will be the outermost scope +/* True means the next call to push_scope will be the outermost scope of a function body, so do not push a new scope, merely cease expecting parameter decls. */ @@ -300,32 +411,42 @@ static bool next_is_function_body; /* Functions called automatically at the beginning and end of execution. */ -tree static_ctors, static_dtors; +static GTY(()) tree static_ctors; +static GTY(()) tree static_dtors; /* Forward declarations. */ - -static struct c_scope *make_scope (void); -static void pop_scope (void); -static tree make_label (tree, location_t); -static void bind_label (tree, tree, struct c_scope *); -static void implicit_decl_warning (tree); -static tree lookup_tag (enum tree_code, tree, int); -static tree lookup_name_current_level (tree); -static tree grokdeclarator (tree, tree, enum decl_context, int, tree *); -static tree grokparms (tree, int); -static void layout_array_type (tree); -static void store_parm_decls_newstyle (void); -static void store_parm_decls_oldstyle (void); +static tree lookup_name_in_scope (tree, struct c_scope *); static tree c_make_fname_decl (tree, int); -static void c_expand_body_1 (tree, int); -static tree any_external_decl (tree); -static void record_external_decl (tree); -static void warn_if_shadowing (tree, tree); -static void check_bitfield_type_and_width (tree *, tree *, const char *); -static void clone_underlying_type (tree); -static bool flexible_array_type_p (tree); -static hashval_t link_hash_hash (const void *); -static int link_hash_eq (const void *, const void *); +static tree grokdeclarator (const struct c_declarator *, + struct c_declspecs *, + enum decl_context, bool, tree *); +static tree grokparms (struct c_arg_info *, bool); +static void layout_array_type (tree); + +/* T is a statement. Add it to the statement-tree. This is the + C/ObjC version--C++ has a slightly different version of this + function. */ + +tree +add_stmt (tree t) +{ + enum tree_code code = TREE_CODE (t); + + if (EXPR_P (t) && code != LABEL_EXPR) + { + if (!EXPR_HAS_LOCATION (t)) + SET_EXPR_LOCATION (t, input_location); + } + + if (code == LABEL_EXPR || code == CASE_LABEL_EXPR) + STATEMENT_LIST_HAS_LABEL (cur_stmt_list) = 1; + + /* Add T to the statement-tree. Non-side-effect statements need to be + recorded during statement expressions. */ + append_to_statement_list_force (t, &cur_stmt_list); + + return t; +} /* States indicating how grokdeclarator() should handle declspecs marked with __attribute__((deprecated)). An object declared as @@ -342,17 +463,93 @@ static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; void c_print_identifier (FILE *file, tree node, int indent) { - print_node (file, "symbol", IDENTIFIER_SYMBOL_VALUE (node), indent + 4); - print_node (file, "tag", IDENTIFIER_TAG_VALUE (node), indent + 4); - print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4); + print_node (file, "symbol", I_SYMBOL_DECL (node), indent + 4); + print_node (file, "tag", I_TAG_DECL (node), indent + 4); + print_node (file, "label", I_LABEL_DECL (node), indent + 4); if (C_IS_RESERVED_WORD (node)) { tree rid = ridpointers[C_RID_CODE (node)]; indent_to (file, indent + 4); - fprintf (file, "rid " HOST_PTR_PRINTF " \"%s\"", + fprintf (file, "rid %p \"%s\"", (void *) rid, IDENTIFIER_POINTER (rid)); } } + +/* Establish a binding between NAME, an IDENTIFIER_NODE, and DECL, + which may be any of several kinds of DECL or TYPE or error_mark_node, + in the scope SCOPE. */ +static void +bind (tree name, tree decl, struct c_scope *scope, bool invisible, bool nested) +{ + struct c_binding *b, **here; + + if (binding_freelist) + { + b = binding_freelist; + binding_freelist = b->prev; + } + else + b = GGC_NEW (struct c_binding); + + b->shadowed = 0; + b->decl = decl; + b->id = name; + b->depth = scope->depth; + b->invisible = invisible; + b->nested = nested; + b->inner_comp = 0; + + b->type = 0; + + b->prev = scope->bindings; + scope->bindings = b; + + if (!name) + return; + + switch (TREE_CODE (decl)) + { + case LABEL_DECL: here = &I_LABEL_BINDING (name); break; + case ENUMERAL_TYPE: + case UNION_TYPE: + case RECORD_TYPE: here = &I_TAG_BINDING (name); break; + case VAR_DECL: + case FUNCTION_DECL: + case TYPE_DECL: + case CONST_DECL: + case PARM_DECL: + case ERROR_MARK: here = &I_SYMBOL_BINDING (name); break; + + default: + gcc_unreachable (); + } + + /* Locate the appropriate place in the chain of shadowed decls + to insert this binding. Normally, scope == current_scope and + this does nothing. */ + while (*here && (*here)->depth > scope->depth) + here = &(*here)->shadowed; + + b->shadowed = *here; + *here = b; +} + +/* Clear the binding structure B, stick it on the binding_freelist, + and return the former value of b->prev. This is used by pop_scope + and get_parm_info to iterate destructively over all the bindings + from a given scope. */ +static struct c_binding * +free_binding_and_advance (struct c_binding *b) +{ + struct c_binding *prev = b->prev; + + memset (b, 0, sizeof (struct c_binding)); + b->prev = binding_freelist; + binding_freelist = b; + + return prev; +} + /* Hook called at end of compilation to assume 1 elt for a file-scope tentative array defn that wasn't complete before. */ @@ -365,56 +562,22 @@ c_finish_incomplete_decl (tree decl) tree type = TREE_TYPE (decl); if (type != error_mark_node && TREE_CODE (type) == ARRAY_TYPE - && ! DECL_EXTERNAL (decl) + && !DECL_EXTERNAL (decl) && TYPE_DOMAIN (type) == 0) { - warning ("%Jarray '%D' assumed to have one element", decl, decl); + warning (0, "array %q+D assumed to have one element", decl); - complete_array_type (type, NULL_TREE, 1); + complete_array_type (&TREE_TYPE (decl), NULL_TREE, true); layout_decl (decl, 0); } } } -/* Reuse or create a struct for this scope. */ - -static struct c_scope * -make_scope (void) -{ - struct c_scope *result; - if (scope_freelist) - { - result = scope_freelist; - scope_freelist = result->outer; - } - else - result = ggc_alloc_cleared (sizeof (struct c_scope)); - - return result; -} - -/* Remove the topmost scope from the stack and add it to the - free list, updating current_function_scope if necessary. */ - -static void -pop_scope (void) -{ - struct c_scope *scope = current_scope; - - current_scope = scope->outer; - if (scope->function_body) - current_function_scope = scope->outer_function; - - memset (scope, 0, sizeof (struct c_scope)); - scope->outer = scope_freelist; - scope_freelist = scope; -} - /* The Objective-C front-end often needs to determine the current scope. */ void * -get_current_scope (void) +objc_get_current_scope (void) { return current_scope; } @@ -426,30 +589,27 @@ void objc_mark_locals_volatile (void *enclosing_blk) { struct c_scope *scope; + struct c_binding *b; for (scope = current_scope; scope && scope != enclosing_blk; scope = scope->outer) { - tree decl; + for (b = scope->bindings; b; b = b->prev) + objc_volatilize_decl (b->decl); - for (decl = scope->names; decl; decl = TREE_CHAIN (decl)) - { - DECL_REGISTER (decl) = 0; - TREE_THIS_VOLATILE (decl) = 1; - } /* Do not climb up past the current function. */ if (scope->function_body) break; } } -/* Nonzero if we are currently in the global scope. */ +/* Nonzero if we are currently in file scope. */ int global_bindings_p (void) { - return current_scope == global_scope; + return current_scope == file_scope && !c_override_global_bindings_to_false; } void @@ -466,19 +626,8 @@ declare_parm_level (void) current_scope->parm_flag = true; } -/* Nonzero if currently making parm declarations. */ - -int -in_parm_level_p (void) -{ - return current_scope->parm_flag; -} - -/* Enter a new scope. The dummy parameter is for signature - compatibility with lang_hooks.decls.pushlevel. */ - void -pushlevel (int dummy ATTRIBUTE_UNUSED) +push_scope (void) { if (next_is_function_body) { @@ -503,49 +652,58 @@ pushlevel (int dummy ATTRIBUTE_UNUSED) } else { - struct c_scope *scope = make_scope (); + struct c_scope *scope; + if (scope_freelist) + { + scope = scope_freelist; + scope_freelist = scope->outer; + } + else + scope = GGC_CNEW (struct c_scope); scope->keep = keep_next_level_flag; scope->outer = current_scope; + scope->depth = current_scope ? (current_scope->depth + 1) : 0; + + /* Check for scope depth overflow. Unlikely (2^28 == 268,435,456) but + possible. */ + if (current_scope && scope->depth == 0) + { + scope->depth--; + sorry ("GCC supports only %u nested scopes", scope->depth); + } + current_scope = scope; keep_next_level_flag = false; } } +/* Set the TYPE_CONTEXT of all of TYPE's variants to CONTEXT. */ + +static void +set_type_context (tree type, tree context) +{ + for (type = TYPE_MAIN_VARIANT (type); type; + type = TYPE_NEXT_VARIANT (type)) + TYPE_CONTEXT (type) = context; +} + /* Exit a scope. Restore the state of the identifier-decl mappings - that were in effect when this scope was entered. - - If KEEP is KEEP_YES (1), this scope had explicit declarations, so - create a BLOCK node to record its declarations and subblocks for - debugging output. If KEEP is KEEP_MAYBE, do so only if the names - or tags lists are nonempty. - - The second parameter is ignored; it is present only for - signature compatibility with lang_hooks.decls.poplevel. - - If FUNCTIONBODY is nonzero, this level is the body of a function, - even if current_scope->function_body is not set. This is used - by language-independent code that generates synthetic functions, - and cannot set current_scope->function_body. - - FIXME: Eliminate the need for all arguments. */ + that were in effect when this scope was entered. Return a BLOCK + node containing all the DECLs in this scope that are of interest + to debug info generation. */ tree -poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) +pop_scope (void) { struct c_scope *scope = current_scope; - tree block; - tree decl; - tree p; + tree block, context, p; + struct c_binding *b; - /* The following line does not use |= due to a bug in HP's C compiler. */ - scope->function_body = scope->function_body | functionbody; + bool functionbody = scope->function_body; + bool keep = functionbody || scope->keep || scope->bindings; - if (keep == KEEP_MAYBE) - keep = (scope->names || scope->tags); - - keep |= scope->keep; - keep |= scope->function_body; + c_end_vm_scope (scope->depth); /* If appropriate, create a BLOCK to record the decls for the life of this function. */ @@ -553,93 +711,20 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) if (keep) { block = make_node (BLOCK); - BLOCK_VARS (block) = scope->names; BLOCK_SUBBLOCKS (block) = scope->blocks; TREE_USED (block) = 1; + + /* In each subblock, record that this is its superior. */ + for (p = scope->blocks; p; p = TREE_CHAIN (p)) + BLOCK_SUPERCONTEXT (p) = block; + + BLOCK_VARS (block) = 0; } - /* In each subblock, record that this is its superior. */ - for (p = scope->blocks; p; p = TREE_CHAIN (p)) - BLOCK_SUPERCONTEXT (p) = block; - - /* Clear out the variable bindings in this scope. - - Propagate TREE_ADDRESSABLE from nested functions to their - containing functions. - - Issue warnings for unused variables and labels, and errors for - undefined labels, if there are any. */ - - for (p = scope->names; p; p = TREE_CHAIN (p)) - { - switch (TREE_CODE (p)) - { - case LABEL_DECL: - if (TREE_USED (p) && !DECL_INITIAL (p)) - { - error ("%Jlabel `%D' used but not defined", p, p); - DECL_INITIAL (p) = error_mark_node; - } - else if (!TREE_USED (p) && warn_unused_label) - { - if (DECL_INITIAL (p)) - warning ("%Jlabel `%D' defined but not used", p, p); - else - warning ("%Jlabel `%D' declared but not defined", p, p); - } - - IDENTIFIER_LABEL_VALUE (DECL_NAME (p)) = 0; - break; - - case FUNCTION_DECL: - if (! TREE_ASM_WRITTEN (p) - && DECL_INITIAL (p) != 0 - && TREE_ADDRESSABLE (p) - && DECL_ABSTRACT_ORIGIN (p) != 0 - && DECL_ABSTRACT_ORIGIN (p) != p) - TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1; - goto normal; - - case VAR_DECL: - /* Keep this in sync with stmt.c:warn_about_unused_variables. - No warnings when the global scope is popped because the - global scope isn't popped for the last translation unit, - so the warnings are done in c_write_global_declaration. */ - if (warn_unused_variable && scope != global_scope - && !TREE_USED (p) - && !DECL_IN_SYSTEM_HEADER (p) - && DECL_NAME (p) - && !DECL_ARTIFICIAL (p)) - warning ("%Junused variable `%D'", p, p); - /* fall through */ - - default: - normal: - if (DECL_NAME (p)) - { - if (DECL_EXTERNAL (p) && scope != global_scope) - /* External decls stay in the symbol-value slot but are - inaccessible. */ - C_DECL_INVISIBLE (p) = 1; - else - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (p)) = 0; - } - break; - } - } - - /* Clear out the parameter bindings in this scope, if any. - Unused-parameter warnings are handled by function.c. */ - for (p = scope->parms; p; p = TREE_CHAIN (p)) - if (DECL_NAME (p)) - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (p)) = 0; - - /* Clear out the tag-meanings declared in this scope. - - Set the TYPE_CONTEXTs for all of the tagged types belonging to - this scope so that they point to the appropriate construct, i.e. - either to the current FUNCTION_DECL node, or else to the BLOCK - node we just constructed. + /* The TYPE_CONTEXTs for all of the tagged types belonging to this + scope must be set so that they point to the appropriate + construct, i.e. either to the current FUNCTION_DECL node, or + else to the BLOCK node we just constructed. Note that for tagged types whose scope is just the formal parameter list for some function type specification, we can't @@ -649,32 +734,147 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) type nodes get set in `grokdeclarator' as soon as we have created the FUNCTION_TYPE node which will represent the "scope" for these "parameter list local" tagged types. */ - - decl = scope->function_body ? current_function_decl : block; - for (p = scope->tags; p; p = TREE_CHAIN (p)) + if (scope->function_body) + context = current_function_decl; + else if (scope == file_scope) { - if (TREE_PURPOSE (p)) - IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = 0; - if (decl) - TYPE_CONTEXT (TREE_VALUE (p)) = decl; + tree file_decl = build_decl (TRANSLATION_UNIT_DECL, 0, 0); + TREE_CHAIN (file_decl) = all_translation_units; + all_translation_units = file_decl; + context = file_decl; + } + else + context = block; + + /* Clear all bindings in this scope. */ + for (b = scope->bindings; b; b = free_binding_and_advance (b)) + { + p = b->decl; + switch (TREE_CODE (p)) + { + case LABEL_DECL: + /* Warnings for unused labels, errors for undefined labels. */ + if (TREE_USED (p) && !DECL_INITIAL (p)) + { + error ("label %q+D used but not defined", p); + DECL_INITIAL (p) = error_mark_node; + } + else if (!TREE_USED (p) && warn_unused_label) + { + if (DECL_INITIAL (p)) + warning (0, "label %q+D defined but not used", p); + else + warning (0, "label %q+D declared but not defined", p); + } + /* Labels go in BLOCK_VARS. */ + TREE_CHAIN (p) = BLOCK_VARS (block); + BLOCK_VARS (block) = p; + gcc_assert (I_LABEL_BINDING (b->id) == b); + I_LABEL_BINDING (b->id) = b->shadowed; + break; + + case ENUMERAL_TYPE: + case UNION_TYPE: + case RECORD_TYPE: + set_type_context (p, context); + + /* Types may not have tag-names, in which case the type + appears in the bindings list with b->id NULL. */ + if (b->id) + { + gcc_assert (I_TAG_BINDING (b->id) == b); + I_TAG_BINDING (b->id) = b->shadowed; + } + break; + + case FUNCTION_DECL: + /* Propagate TREE_ADDRESSABLE from nested functions to their + containing functions. */ + if (!TREE_ASM_WRITTEN (p) + && DECL_INITIAL (p) != 0 + && TREE_ADDRESSABLE (p) + && DECL_ABSTRACT_ORIGIN (p) != 0 + && DECL_ABSTRACT_ORIGIN (p) != p) + TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (p)) = 1; + if (!DECL_EXTERNAL (p) + && DECL_INITIAL (p) == 0) + { + error ("nested function %q+D declared but never defined", p); + undef_nested_function = true; + } + goto common_symbol; + + case VAR_DECL: + /* Warnings for unused variables. */ + if (!TREE_USED (p) + && !TREE_NO_WARNING (p) + && !DECL_IN_SYSTEM_HEADER (p) + && DECL_NAME (p) + && !DECL_ARTIFICIAL (p) + && scope != file_scope + && scope != external_scope) + warning (OPT_Wunused_variable, "unused variable %q+D", p); + + if (b->inner_comp) + { + error ("type of array %q+D completed incompatibly with" + " implicit initialization", p); + } + + /* Fall through. */ + case TYPE_DECL: + case CONST_DECL: + common_symbol: + /* All of these go in BLOCK_VARS, but only if this is the + binding in the home scope. */ + if (!b->nested) + { + TREE_CHAIN (p) = BLOCK_VARS (block); + BLOCK_VARS (block) = p; + } + /* If this is the file scope, and we are processing more + than one translation unit in this compilation, set + DECL_CONTEXT of each decl to the TRANSLATION_UNIT_DECL. + This makes same_translation_unit_p work, and causes + static declarations to be given disambiguating suffixes. */ + if (scope == file_scope && num_in_fnames > 1) + { + DECL_CONTEXT (p) = context; + if (TREE_CODE (p) == TYPE_DECL) + set_type_context (TREE_TYPE (p), context); + } + + /* Fall through. */ + /* Parameters go in DECL_ARGUMENTS, not BLOCK_VARS, and have + already been put there by store_parm_decls. Unused- + parameter warnings are handled by function.c. + error_mark_node obviously does not go in BLOCK_VARS and + does not get unused-variable warnings. */ + case PARM_DECL: + case ERROR_MARK: + /* It is possible for a decl not to have a name. We get + here with b->id NULL in this case. */ + if (b->id) + { + gcc_assert (I_SYMBOL_BINDING (b->id) == b); + I_SYMBOL_BINDING (b->id) = b->shadowed; + if (b->shadowed && b->shadowed->type) + TREE_TYPE (b->shadowed->decl) = b->shadowed->type; + } + break; + + default: + gcc_unreachable (); + } } - /* Restore all name- and label-meanings from outer scopes that were - shadowed by this scope. */ - for (p = scope->shadowed; p; p = TREE_CHAIN (p)) - if (TREE_VALUE (p) && TREE_CODE (TREE_VALUE (p)) == LABEL_DECL) - IDENTIFIER_LABEL_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p); - else - IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p); - - /* Restore all tag-meanings from outer scopes that were shadowed by - this scope. */ - for (p = scope->shadowed_tags; p; p = TREE_CHAIN (p)) - IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p); /* Dispose of the block that we just made inside some higher level. */ - if (scope->function_body && current_function_decl) - DECL_INITIAL (current_function_decl) = block; + if ((scope->function_body || scope == file_scope) && context) + { + DECL_INITIAL (context) = block; + BLOCK_SUPERCONTEXT (block) = context; + } else if (scope->outer) { if (block) @@ -687,11 +887,64 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody) } /* Pop the current scope, and free the structure for reuse. */ - pop_scope (); + current_scope = scope->outer; + if (scope->function_body) + current_function_scope = scope->outer_function; + + memset (scope, 0, sizeof (struct c_scope)); + scope->outer = scope_freelist; + scope_freelist = scope; return block; } +void +push_file_scope (void) +{ + tree decl; + + if (file_scope) + return; + + push_scope (); + file_scope = current_scope; + + start_fname_decls (); + + for (decl = visible_builtins; decl; decl = TREE_CHAIN (decl)) + bind (DECL_NAME (decl), decl, file_scope, + /*invisible=*/false, /*nested=*/true); +} + +void +pop_file_scope (void) +{ + /* In case there were missing closebraces, get us back to the global + binding level. */ + while (current_scope != file_scope) + pop_scope (); + + /* __FUNCTION__ is defined at file scope (""). This + call may not be necessary as my tests indicate it + still works without it. */ + finish_fname_decls (); + + /* This is the point to write out a PCH if we're doing that. + In that case we do not want to do anything else. */ + if (pch_file) + { + c_common_write_pch (); + return; + } + + /* Pop off the file scope and close this translation unit. */ + pop_scope (); + file_scope = 0; + + maybe_apply_pending_pragma_weaks (); + cgraph_finalize_compilation_unit (); +} + /* Insert BLOCK at the end of the list of subblocks of the current scope. This is used when a BIND_EXPR is expanded, to handle the BLOCK node inside the BIND_EXPR. */ @@ -702,15 +955,6 @@ insert_block (tree block) TREE_USED (block) = 1; SCOPE_LIST_APPEND (current_scope, blocks, block); } - -/* Set the BLOCK node for the innermost scope (the one we are - currently in). The RTL expansion machinery requires us to provide - this hook, but it is not useful in function-at-a-time mode. */ - -void -set_block (tree block ATTRIBUTE_UNUSED) -{ -} /* Push a definition or a declaration of struct, union or enum tag "name". "type" should be the type node. @@ -719,24 +963,13 @@ set_block (tree block ATTRIBUTE_UNUSED) Note that the definition may really be just a forward reference. In that case, the TYPE_SIZE will be zero. */ -void +static void pushtag (tree name, tree type) { - struct c_scope *b = current_scope; - /* Record the identifier as the type's name if it has none. */ - if (name) - { - if (TYPE_NAME (type) == 0) - TYPE_NAME (type) = name; - - if (IDENTIFIER_TAG_VALUE (name)) - b->shadowed_tags = tree_cons (name, IDENTIFIER_TAG_VALUE (name), - b->shadowed_tags); - IDENTIFIER_TAG_VALUE (name) = type; - } - - b->tags = tree_cons (name, type, b->tags); + if (name && !TYPE_NAME (type)) + TYPE_NAME (type) = name; + bind (name, type, current_scope, /*invisible=*/false, /*nested=*/false); /* Create a fake NULL-named TYPE_DECL node whose TREE_TYPE will be the tagged type we just added to the current scope. This fake @@ -748,7 +981,7 @@ pushtag (tree name, tree type) TYPE_STUB_DECL (type) = pushdecl (build_decl (TYPE_DECL, NULL_TREE, type)); /* An approximation for now, so we can tell this is a function-scope tag. - This will be updated in poplevel. */ + This will be updated in pop_scope. */ TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_STUB_DECL (type)); } @@ -776,10 +1009,10 @@ match_builtin_function_types (tree newtype, tree oldtype) while (oldargs || newargs) { - if (! oldargs - || ! newargs - || ! TREE_VALUE (oldargs) - || ! TREE_VALUE (newargs) + if (!oldargs + || !newargs + || !TREE_VALUE (oldargs) + || !TREE_VALUE (newargs) || TYPE_MODE (TREE_VALUE (oldargs)) != TYPE_MODE (TREE_VALUE (newargs))) return 0; @@ -792,9 +1025,9 @@ match_builtin_function_types (tree newtype, tree oldtype) return build_type_attribute_variant (trytype, TYPE_ATTRIBUTES (oldtype)); } -/* Subroutine of diagnose_mismathed_decls. Check for function type +/* Subroutine of diagnose_mismatched_decls. Check for function type mismatch involving an empty arglist vs a nonempty one and give clearer - diagnostics. */ + diagnostics. */ static void diagnose_arglist_conflict (tree newdecl, tree olddecl, tree newtype, tree oldtype) @@ -802,7 +1035,7 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl, tree t; if (TREE_CODE (olddecl) != FUNCTION_DECL - || !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype), COMPARE_STRICT) + || !comptypes (TREE_TYPE (oldtype), TREE_TYPE (newtype)) || !((TYPE_ARG_TYPES (oldtype) == 0 && DECL_INITIAL (olddecl) == 0) || (TYPE_ARG_TYPES (newtype) == 0 && DECL_INITIAL (newdecl) == 0))) @@ -818,14 +1051,14 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl, if (TREE_CHAIN (t) == 0 && TYPE_MAIN_VARIANT (type) != void_type_node) { - inform ("a parameter list with an ellipsis can't match " + inform ("a parameter list with an ellipsis can%'t match " "an empty parameter name list declaration"); break; } if (c_type_promotes_to (type) != type) { - inform ("an argument type that has a default promotion can't match " + inform ("an argument type that has a default promotion can%'t match " "an empty parameter name list declaration"); break; } @@ -842,8 +1075,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) tree newargs, oldargs; int i; - /* ??? Elsewhere TYPE_MAIN_VARIANT is not used in this context. */ -#define END_OF_ARGLIST(t) (TYPE_MAIN_VARIANT (t) == void_type_node) +#define END_OF_ARGLIST(t) ((t) == void_type_node) oldargs = TYPE_ACTUAL_ARG_TYPES (oldtype); newargs = TYPE_ARG_TYPES (newtype); @@ -854,6 +1086,12 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) tree oldargtype = TREE_VALUE (oldargs); tree newargtype = TREE_VALUE (newargs); + if (oldargtype == error_mark_node || newargtype == error_mark_node) + return false; + + oldargtype = TYPE_MAIN_VARIANT (oldargtype); + newargtype = TYPE_MAIN_VARIANT (newargtype); + if (END_OF_ARGLIST (oldargtype) && END_OF_ARGLIST (newargtype)) break; @@ -861,23 +1099,24 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) agree on the number of arguments. */ if (END_OF_ARGLIST (oldargtype)) { - error ("%Jprototype for '%D' declares more arguments " - "than previous old-style definition", newdecl, newdecl); + error ("prototype for %q+D declares more arguments " + "than previous old-style definition", newdecl); return false; } else if (END_OF_ARGLIST (newargtype)) { - error ("%Jprototype for '%D' declares fewer arguments " - "than previous old-style definition", newdecl, newdecl); + error ("prototype for %q+D declares fewer arguments " + "than previous old-style definition", newdecl); return false; } /* Type for passing arg must be consistent with that declared for the arg. */ - else if (! comptypes (oldargtype, newargtype, COMPARE_STRICT)) + else if (!comptypes (oldargtype, newargtype)) { - error ("%Jprototype for '%D' declares arg %d with incompatible type", - newdecl, newdecl, i); + error ("prototype for %q+D declares argument %d" + " with incompatible type", + newdecl, i); return false; } @@ -888,8 +1127,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) /* If we get here, no errors were found, but do issue a warning for this poor-style construct. */ - warning ("%Jprototype for '%D' follows non-prototype definition", - newdecl, newdecl); + warning (0, "prototype for %q+D follows non-prototype definition", + newdecl); return true; #undef END_OF_ARGLIST } @@ -898,16 +1137,16 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) first in a pair of mismatched declarations, using the diagnostic function DIAG. */ static void -locate_old_decl (tree decl, void (*diag)(const char *, ...)) +locate_old_decl (tree decl, void (*diag)(const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2)) { if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) ; else if (DECL_INITIAL (decl)) - diag (N_("%Jprevious definition of '%D' was here"), decl, decl); + diag (G_("previous definition of %q+D was here"), decl); else if (C_DECL_IMPLICIT (decl)) - diag (N_("%Jprevious implicit declaration of '%D' was here"), decl, decl); + diag (G_("previous implicit declaration of %q+D was here"), decl); else - diag (N_("%Jprevious declaration of '%D' was here"), decl, decl); + diag (G_("previous declaration of %q+D was here"), decl); } /* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL. @@ -925,6 +1164,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, tree newtype, oldtype; bool pedwarned = false; bool warned = false; + bool retval = true; + +#define DECL_EXTERN_INLINE(DECL) (DECL_DECLARED_INLINE_P (DECL) \ + && DECL_EXTERNAL (DECL)) /* If we have error_mark_node for either decl or type, just discard the previous decl - we're in an error cascade already. */ @@ -939,19 +1182,19 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, unless OLDDECL is a builtin. OLDDECL will be discarded in any case. */ if (TREE_CODE (olddecl) != TREE_CODE (newdecl)) { - if (TREE_CODE (olddecl) != FUNCTION_DECL - || !DECL_BUILT_IN (olddecl) || !C_DECL_INVISIBLE (olddecl)) + if (!(TREE_CODE (olddecl) == FUNCTION_DECL + && DECL_BUILT_IN (olddecl) + && !C_DECL_DECLARED_BUILTIN (olddecl))) { - error ("%J'%D' redeclared as different kind of symbol", - newdecl, newdecl); + error ("%q+D redeclared as different kind of symbol", newdecl); locate_old_decl (olddecl, error); } else if (TREE_PUBLIC (newdecl)) - warning ("%Jbuilt-in function '%D' declared as non-function", - newdecl, newdecl); - else if (warn_shadow) - warning ("%Jshadowing built-in function '%D'", - newdecl, newdecl); + warning (0, "built-in function %q+D declared as non-function", + newdecl); + else + warning (OPT_Wshadow, "declaration of %q+D shadows " + "a built-in function", newdecl); return false; } @@ -959,34 +1202,34 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, given scope. */ if (TREE_CODE (olddecl) == CONST_DECL) { - error ("%Jredeclaration of enumerator `%D'", newdecl, newdecl); + error ("redeclaration of enumerator %q+D", newdecl); locate_old_decl (olddecl, error); return false; } - if (!comptypes (oldtype, newtype, COMPARE_STRICT)) + if (!comptypes (oldtype, newtype)) { if (TREE_CODE (olddecl) == FUNCTION_DECL - && DECL_BUILT_IN (olddecl) && C_DECL_INVISIBLE (olddecl)) + && DECL_BUILT_IN (olddecl) && !C_DECL_DECLARED_BUILTIN (olddecl)) { /* Accept harmless mismatch in function types. This is for the ffs and fprintf builtins. */ tree trytype = match_builtin_function_types (newtype, oldtype); - if (trytype && comptypes (newtype, trytype, COMPARE_STRICT)) + if (trytype && comptypes (newtype, trytype)) *oldtypep = oldtype = trytype; else { /* If types don't match for a built-in, throw away the built-in. No point in calling locate_old_decl here, it - won't print anything. */ - warning ("%Jconflicting types for built-in function '%D'", - newdecl, newdecl); + won't print anything. */ + warning (0, "conflicting types for built-in function %q+D", + newdecl); return false; } } else if (TREE_CODE (olddecl) == FUNCTION_DECL - && DECL_SOURCE_LINE (olddecl) == 0) + && DECL_IS_BUILTIN (olddecl)) { /* A conflicting function declaration for a predeclared function that isn't actually built in. Objective C uses @@ -1002,17 +1245,32 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, else if (TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) && TYPE_MAIN_VARIANT (TREE_TYPE (oldtype)) == void_type_node && TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == integer_type_node - && C_FUNCTION_IMPLICIT_INT (newdecl)) + && C_FUNCTION_IMPLICIT_INT (newdecl) && !DECL_INITIAL (olddecl)) { - pedwarn ("%Jconflicting types for '%D'", newdecl, newdecl); + pedwarn ("conflicting types for %q+D", newdecl); /* Make sure we keep void as the return type. */ TREE_TYPE (newdecl) = *newtypep = newtype = oldtype; C_FUNCTION_IMPLICIT_INT (newdecl) = 0; pedwarned = true; } + /* Permit void foo (...) to match an earlier call to foo (...) with + no declared type (thus, implicitly int). */ + else if (TREE_CODE (newdecl) == FUNCTION_DECL + && TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == void_type_node + && TYPE_MAIN_VARIANT (TREE_TYPE (oldtype)) == integer_type_node + && C_DECL_IMPLICIT (olddecl) && !DECL_INITIAL (olddecl)) + { + pedwarn ("conflicting types for %q+D", newdecl); + /* Make sure we keep void as the return type. */ + TREE_TYPE (olddecl) = *oldtypep = oldtype = newtype; + pedwarned = true; + } else { - error ("%Jconflicting types for '%D'", newdecl, newdecl); + if (TYPE_QUALS (newtype) != TYPE_QUALS (oldtype)) + error ("conflicting type qualifiers for %q+D", newdecl); + else + error ("conflicting types for %q+D", newdecl); diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype); locate_old_decl (olddecl, error); return false; @@ -1025,9 +1283,9 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, if (TREE_CODE (newdecl) == TYPE_DECL) { if (DECL_IN_SYSTEM_HEADER (newdecl) || DECL_IN_SYSTEM_HEADER (olddecl)) - return true; /* allow OLDDECL to continue in use */ - - error ("%Jredefinition of typedef '%D'", newdecl, newdecl); + return true; /* Allow OLDDECL to continue in use. */ + + error ("redefinition of typedef %q+D", newdecl); locate_old_decl (olddecl, error); return false; } @@ -1038,6 +1296,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, Multiple definitions are not allowed (6.9p3,5) but GCC permits two definitions if one is 'extern inline' and one is not. The non- extern-inline definition supersedes the extern-inline definition. */ + else if (TREE_CODE (newdecl) == FUNCTION_DECL) { /* If you declare a built-in function name as static, or @@ -1045,28 +1304,39 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, can't validate the argument list) the built-in definition is overridden, but optionally warn this was a bad choice of name. */ if (DECL_BUILT_IN (olddecl) - && C_DECL_INVISIBLE (olddecl) + && !C_DECL_DECLARED_BUILTIN (olddecl) && (!TREE_PUBLIC (newdecl) || (DECL_INITIAL (newdecl) && !TYPE_ARG_TYPES (TREE_TYPE (newdecl))))) { - if (warn_shadow) - warning ("%Jshadowing built-in function '%D'", newdecl, newdecl); + warning (OPT_Wshadow, "declaration of %q+D shadows " + "a built-in function", newdecl); /* Discard the old built-in function. */ return false; } - + if (DECL_INITIAL (newdecl)) { - if (DECL_INITIAL (olddecl) - && !(DECL_DECLARED_INLINE_P (olddecl) - && DECL_EXTERNAL (olddecl) - && !(DECL_DECLARED_INLINE_P (newdecl) - && DECL_EXTERNAL (newdecl)))) + if (DECL_INITIAL (olddecl)) { - error ("%Jredefinition of '%D'", newdecl, newdecl); - locate_old_decl (olddecl, error); - return false; + /* If both decls are in the same TU and the new declaration + isn't overriding an extern inline reject the new decl. + When we handle c99 style inline rules we'll want to reject + the following: + + DECL_EXTERN_INLINE (olddecl) + && !DECL_EXTERN_INLINE (newdecl) + + if they're in the same translation unit. Until we implement + the full semantics we accept the construct. */ + if (!(DECL_EXTERN_INLINE (olddecl) + && !DECL_EXTERN_INLINE (newdecl)) + && same_translation_unit_p (newdecl, olddecl)) + { + error ("redefinition of %q+D", newdecl); + locate_old_decl (olddecl, error); + return false; + } } } /* If we have a prototype after an old-style function definition, @@ -1079,47 +1349,67 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, locate_old_decl (olddecl, error); return false; } - /* Mismatched non-static and static is considered poor style. - We only diagnose static then non-static if -Wtraditional, - because it is the most convenient way to get some effects - (see e.g. what unwind-dw2-fde-glibc.c does to the definition - of _Unwind_Find_FDE in unwind-dw2-fde.c). Revisit? */ + /* A non-static declaration (even an "extern") followed by a + static declaration is undefined behavior per C99 6.2.2p3-5,7. + The same is true for a static forward declaration at block + scope followed by a non-static declaration/definition at file + scope. Static followed by non-static at the same scope is + not undefined behavior, and is the most convenient way to get + some effects (see e.g. what unwind-dw2-fde-glibc.c does to + the definition of _Unwind_Find_FDE in unwind-dw2-fde.c), but + we do diagnose it if -Wtraditional. */ if (TREE_PUBLIC (olddecl) && !TREE_PUBLIC (newdecl)) { - /* A static function declaration for a predeclared function - that isn't actually built in, silently overrides the - default. Objective C uses these. See also above. - FIXME: Make Objective C use normal builtins. */ - if (TREE_CODE (olddecl) == FUNCTION_DECL - && DECL_SOURCE_LINE (olddecl) == 0) - return false; - else + /* Two exceptions to the rule. If olddecl is an extern + inline, or a predeclared function that isn't actually + built in, newdecl silently overrides olddecl. The latter + occur only in Objective C; see also above. (FIXME: Make + Objective C use normal builtins.) */ + if (!DECL_IS_BUILTIN (olddecl) + && !DECL_EXTERN_INLINE (olddecl)) { - warning ("%Jstatic declaration of '%D' follows " - "non-static declaration", newdecl, newdecl); + error ("static declaration of %q+D follows " + "non-static declaration", newdecl); + locate_old_decl (olddecl, error); + } + return false; + } + else if (TREE_PUBLIC (newdecl) && !TREE_PUBLIC (olddecl)) + { + if (DECL_CONTEXT (olddecl)) + { + error ("non-static declaration of %q+D follows " + "static declaration", newdecl); + locate_old_decl (olddecl, error); + return false; + } + else if (warn_traditional) + { + warning (OPT_Wtraditional, "non-static declaration of %q+D " + "follows static declaration", newdecl); warned = true; } } - else if (TREE_PUBLIC (newdecl) && !TREE_PUBLIC (olddecl) - && warn_traditional) - { - warning ("%Jnon-static declaration of '%D' follows " - "static declaration", newdecl, newdecl); - warned = true; - } } else if (TREE_CODE (newdecl) == VAR_DECL) { /* Only variables can be thread-local, and all declarations must agree on this property. */ - if (DECL_THREAD_LOCAL (newdecl) != DECL_THREAD_LOCAL (olddecl)) + if (C_DECL_THREADPRIVATE_P (olddecl) && !DECL_THREAD_LOCAL_P (newdecl)) { - if (DECL_THREAD_LOCAL (newdecl)) - error ("%Jthread-local declaration of '%D' follows " - "non-thread-local declaration", newdecl, newdecl); + /* Nothing to check. Since OLDDECL is marked threadprivate + and NEWDECL does not have a thread-local attribute, we + will merge the threadprivate attribute into NEWDECL. */ + ; + } + else if (DECL_THREAD_LOCAL_P (newdecl) != DECL_THREAD_LOCAL_P (olddecl)) + { + if (DECL_THREAD_LOCAL_P (newdecl)) + error ("thread-local declaration of %q+D follows " + "non-thread-local declaration", newdecl); else - error ("%Jnon-thread-local declaration of '%D' follows " - "thread-local declaration", newdecl, newdecl); + error ("non-thread-local declaration of %q+D follows " + "thread-local declaration", newdecl); locate_old_decl (olddecl, error); return false; @@ -1128,25 +1418,46 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, /* Multiple initialized definitions are not allowed (6.9p3,5). */ if (DECL_INITIAL (newdecl) && DECL_INITIAL (olddecl)) { - error ("%Jredefinition of '%D'", newdecl, newdecl); + error ("redefinition of %q+D", newdecl); locate_old_decl (olddecl, error); return false; } - /* Objects declared at file scope: if at least one is 'extern', - it's fine (6.2.2p4); otherwise the linkage must agree (6.2.2p7). */ - if (DECL_FILE_SCOPE_P (newdecl)) + /* Objects declared at file scope: if the first declaration had + external linkage (even if it was an external reference) the + second must have external linkage as well, or the behavior is + undefined. If the first declaration had internal linkage, then + the second must too, or else be an external reference (in which + case the composite declaration still has internal linkage). + As for function declarations, we warn about the static-then- + extern case only for -Wtraditional. See generally 6.2.2p3-5,7. */ + if (DECL_FILE_SCOPE_P (newdecl) + && TREE_PUBLIC (newdecl) != TREE_PUBLIC (olddecl)) { - if (!DECL_EXTERNAL (newdecl) - && !DECL_EXTERNAL (olddecl) - && TREE_PUBLIC (newdecl) != TREE_PUBLIC (olddecl)) + if (DECL_EXTERNAL (newdecl)) + { + if (!DECL_FILE_SCOPE_P (olddecl)) + { + error ("extern declaration of %q+D follows " + "declaration with no linkage", newdecl); + locate_old_decl (olddecl, error); + return false; + } + else if (warn_traditional) + { + warning (OPT_Wtraditional, "non-static declaration of %q+D " + "follows static declaration", newdecl); + warned = true; + } + } + else { if (TREE_PUBLIC (newdecl)) - error ("%Jnon-static declaration of '%D' follows " - "static declaration", newdecl, newdecl); + error ("non-static declaration of %q+D follows " + "static declaration", newdecl); else - error ("%Jstatic declaration of '%D' follows " - "non-static declaration", newdecl, newdecl); + error ("static declaration of %q+D follows " + "non-static declaration", newdecl); locate_old_decl (olddecl, error); return false; @@ -1154,32 +1465,37 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } /* Two objects with the same name declared at the same block scope must both be external references (6.7p3). */ - else if (DECL_CONTEXT (newdecl) == DECL_CONTEXT (olddecl) - && (!DECL_EXTERNAL (newdecl) || !DECL_EXTERNAL (olddecl))) + else if (!DECL_FILE_SCOPE_P (newdecl)) { if (DECL_EXTERNAL (newdecl)) - error ("%Jextern declaration of '%D' follows " - "declaration with no linkage", newdecl, newdecl); + { + /* Extern with initializer at block scope, which will + already have received an error. */ + } else if (DECL_EXTERNAL (olddecl)) - error ("%Jdeclaration of '%D' with no linkage follows " - "extern declaration", newdecl, newdecl); + { + error ("declaration of %q+D with no linkage follows " + "extern declaration", newdecl); + locate_old_decl (olddecl, error); + } else - error ("%Jredeclaration of '%D' with no linkage", - newdecl, newdecl); + { + error ("redeclaration of %q+D with no linkage", newdecl); + locate_old_decl (olddecl, error); + } - locate_old_decl (olddecl, error); return false; } } /* warnings */ - /* All decls must agree on a non-default visibility. */ - if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT - && DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT + /* All decls must agree on a visibility. */ + if (CODE_CONTAINS_STRUCT (TREE_CODE (newdecl), TS_DECL_WITH_VIS) + && DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY_SPECIFIED (olddecl) && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) { - warning ("%Jredeclaration of '%D' with different visibility " - "(old visibility preserved)", newdecl, newdecl); + warning (0, "redeclaration of %q+D with different visibility " + "(old visibility preserved)", newdecl); warned = true; } @@ -1189,70 +1505,56 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, if (DECL_DECLARED_INLINE_P (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning ("%Jinline declaration of '%D' follows " - "declaration with attribute noinline", newdecl, newdecl); + warning (OPT_Wattributes, "inline declaration of %qD follows " + "declaration with attribute noinline", newdecl); warned = true; } else if (DECL_DECLARED_INLINE_P (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning ("%Jdeclaration of '%D' with attribute noinline follows " - "inline declaration ", newdecl, newdecl); + warning (OPT_Wattributes, "declaration of %q+D with attribute " + "noinline follows inline declaration ", newdecl); warned = true; } /* Inline declaration after use or definition. ??? Should we still warn about this now we have unit-at-a-time - mode and can get it right? */ - if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl)) + mode and can get it right? + Definitely don't complain if the decls are in different translation + units. */ + if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl) + && same_translation_unit_p (olddecl, newdecl)) { if (TREE_USED (olddecl)) { - warning ("%J'%D' declared inline after being called", - olddecl, olddecl); + warning (0, "%q+D declared inline after being called", olddecl); warned = true; } else if (DECL_INITIAL (olddecl)) { - warning ("%J'%D' declared inline after its definition", - olddecl, olddecl); + warning (0, "%q+D declared inline after its definition", olddecl); warned = true; } } } else /* PARM_DECL, VAR_DECL */ { - /* Redeclaration of a PARM_DECL is invalid unless this is the - real position of a forward-declared parameter (GCC extension). */ + /* Redeclaration of a parameter is a constraint violation (this is + not explicitly stated, but follows from C99 6.7p3 [no more than + one declaration of the same identifier with no linkage in the + same scope, except type tags] and 6.2.2p6 [parameters have no + linkage]). We must check for a forward parameter declaration, + indicated by TREE_ASM_WRITTEN on the old declaration - this is + an extension, the mandatory diagnostic for which is handled by + mark_forward_parm_decls. */ + if (TREE_CODE (newdecl) == PARM_DECL && (!TREE_ASM_WRITTEN (olddecl) || TREE_ASM_WRITTEN (newdecl))) { - error ("%Jredefinition of parameter '%D'", newdecl, newdecl); + error ("redefinition of parameter %q+D", newdecl); locate_old_decl (olddecl, error); return false; } - - /* These bits are only type qualifiers when applied to objects. */ - if (TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl)) - { - if (TREE_THIS_VOLATILE (newdecl)) - pedwarn ("%Jvolatile declaration of '%D' follows " - "non-volatile declaration", newdecl, newdecl); - else - pedwarn ("%Jnon-volatile declaration of '%D' follows " - "volatile declaration", newdecl, newdecl); - pedwarned = true; - } - if (TREE_READONLY (newdecl) != TREE_READONLY (olddecl)) - { - if (TREE_READONLY (newdecl)) - pedwarn ("%Jconst declaration of '%D' follows " - "non-const declaration", newdecl, newdecl); - else - pedwarn ("%Jnon-const declaration of '%D' follows " - "const declaration", newdecl, newdecl); - pedwarned = true; - } } /* Optional warning for completely redundant decls. */ @@ -1262,11 +1564,11 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, definition. */ && !(TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)) - /* Don't warn about redundant redeclarations of builtins. */ + /* Don't warn about redundant redeclarations of builtins. */ && !(TREE_CODE (newdecl) == FUNCTION_DECL && !DECL_BUILT_IN (newdecl) && DECL_BUILT_IN (olddecl) - && C_DECL_INVISIBLE (olddecl)) + && !C_DECL_DECLARED_BUILTIN (olddecl)) /* Don't warn about an extern followed by a definition. */ && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) /* Don't warn about forward parameter decls. */ @@ -1276,15 +1578,18 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, && !(TREE_CODE (newdecl) == VAR_DECL && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) { - warning ("%Jredundant redeclaration of '%D'", newdecl, newdecl); + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); warned = true; } /* Report location of previous decl/defn in a consistent manner. */ if (warned || pedwarned) - locate_old_decl (olddecl, pedwarned ? pedwarn : warning); + locate_old_decl (olddecl, pedwarned ? pedwarn : warning0); - return true; +#undef DECL_EXTERN_INLINE + + return retval; } /* Subroutine of duplicate_decls. NEWDECL has been found to be @@ -1297,26 +1602,43 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) { int new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0); + int new_is_prototype = (TREE_CODE (newdecl) == FUNCTION_DECL + && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != 0); + int old_is_prototype = (TREE_CODE (olddecl) == FUNCTION_DECL + && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) != 0); - /* For real parm decl following a forward decl, return 1 so old decl - will be reused. Only allow this to happen once. */ + /* For real parm decl following a forward decl, rechain the old decl + in its new location and clear TREE_ASM_WRITTEN (it's not a + forward decl anymore). */ if (TREE_CODE (newdecl) == PARM_DECL - && TREE_ASM_WRITTEN (olddecl) && ! TREE_ASM_WRITTEN (newdecl)) + && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) { + struct c_binding *b, **here; + + for (here = ¤t_scope->bindings; *here; here = &(*here)->prev) + if ((*here)->decl == olddecl) + goto found; + gcc_unreachable (); + + found: + b = *here; + *here = b->prev; + b->prev = current_scope->bindings; + current_scope->bindings = b; + TREE_ASM_WRITTEN (olddecl) = 0; - return; } DECL_ATTRIBUTES (newdecl) - = (*targetm.merge_decl_attributes) (olddecl, newdecl); + = targetm.merge_decl_attributes (olddecl, newdecl); /* Merge the data types specified in the two decls. */ TREE_TYPE (newdecl) = TREE_TYPE (olddecl) - = common_type (newtype, oldtype); + = composite_type (newtype, oldtype); /* Lay the type out, unless already done. */ - if (oldtype != TREE_TYPE (newdecl)) + if (!comptypes (oldtype, TREE_TYPE (newdecl))) { if (TREE_TYPE (newdecl) != error_mark_node) layout_type (TREE_TYPE (newdecl)); @@ -1339,76 +1661,93 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) } } - /* Keep the old rtl since we can safely use it. */ - COPY_DECL_RTL (olddecl, newdecl); /* Merge the type qualifiers. */ if (TREE_READONLY (newdecl)) TREE_READONLY (olddecl) = 1; if (TREE_THIS_VOLATILE (newdecl)) - { - TREE_THIS_VOLATILE (olddecl) = 1; - if (TREE_CODE (newdecl) == VAR_DECL) - make_var_volatile (newdecl); - } + TREE_THIS_VOLATILE (olddecl) = 1; - /* Keep source location of definition rather than declaration. */ - if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) + /* Merge deprecatedness. */ + if (TREE_DEPRECATED (newdecl)) + TREE_DEPRECATED (olddecl) = 1; + + /* Keep source location of definition rather than declaration and of + prototype rather than non-prototype unless that prototype is + built-in. */ + if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) + || (old_is_prototype && !new_is_prototype + && !C_DECL_BUILTIN_PROTOTYPE (olddecl))) DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl); - /* Merge the unused-warning information. */ - if (DECL_IN_SYSTEM_HEADER (olddecl)) - DECL_IN_SYSTEM_HEADER (newdecl) = 1; - else if (DECL_IN_SYSTEM_HEADER (newdecl)) - DECL_IN_SYSTEM_HEADER (olddecl) = 1; - /* Merge the initialization information. */ if (DECL_INITIAL (newdecl) == 0) DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); - /* Merge the section attribute. - We want to issue an error if the sections conflict but that must be - done later in decl_attributes since we are called before attributes - are assigned. */ - if (DECL_SECTION_NAME (newdecl) == NULL_TREE) - DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl); - - /* Copy the assembler name. - Currently, it can only be defined in the prototype. */ - COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); - - /* If either declaration has a nondefault visibility, use it. */ - if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) - DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); - - if (TREE_CODE (newdecl) == FUNCTION_DECL) + /* Merge the threadprivate attribute. */ + if (TREE_CODE (olddecl) == VAR_DECL && C_DECL_THREADPRIVATE_P (olddecl)) { - DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl); - DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl); - DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl); - DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl) - |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl); - TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl); - TREE_READONLY (newdecl) |= TREE_READONLY (olddecl); - DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl); - DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl); + DECL_TLS_MODEL (newdecl) = DECL_TLS_MODEL (olddecl); + C_DECL_THREADPRIVATE_P (newdecl) = 1; } - /* Merge the storage class information. */ - merge_weak (newdecl, olddecl); - - /* For functions, static overrides non-static. */ - if (TREE_CODE (newdecl) == FUNCTION_DECL) + if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS)) { - TREE_PUBLIC (newdecl) &= TREE_PUBLIC (olddecl); - /* This is since we don't automatically - copy the attributes of NEWDECL into OLDDECL. */ - TREE_PUBLIC (olddecl) = TREE_PUBLIC (newdecl); - /* If this clears `static', clear it in the identifier too. */ - if (! TREE_PUBLIC (olddecl)) - TREE_PUBLIC (DECL_NAME (olddecl)) = 0; + /* Merge the unused-warning information. */ + if (DECL_IN_SYSTEM_HEADER (olddecl)) + DECL_IN_SYSTEM_HEADER (newdecl) = 1; + else if (DECL_IN_SYSTEM_HEADER (newdecl)) + DECL_IN_SYSTEM_HEADER (olddecl) = 1; + + /* Merge the section attribute. + We want to issue an error if the sections conflict but that + must be done later in decl_attributes since we are called + before attributes are assigned. */ + if (DECL_SECTION_NAME (newdecl) == NULL_TREE) + DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl); + + /* Copy the assembler name. + Currently, it can only be defined in the prototype. */ + COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); + + /* Use visibility of whichever declaration had it specified */ + if (DECL_VISIBILITY_SPECIFIED (olddecl)) + { + DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); + DECL_VISIBILITY_SPECIFIED (newdecl) = 1; + } + + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { + DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl); + DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl); + DECL_NO_LIMIT_STACK (newdecl) |= DECL_NO_LIMIT_STACK (olddecl); + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (newdecl) + |= DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (olddecl); + TREE_THIS_VOLATILE (newdecl) |= TREE_THIS_VOLATILE (olddecl); + TREE_READONLY (newdecl) |= TREE_READONLY (olddecl); + DECL_IS_MALLOC (newdecl) |= DECL_IS_MALLOC (olddecl); + DECL_IS_PURE (newdecl) |= DECL_IS_PURE (olddecl); + DECL_IS_NOVOPS (newdecl) |= DECL_IS_NOVOPS (olddecl); + } + + /* Merge the storage class information. */ + merge_weak (newdecl, olddecl); + + /* For functions, static overrides non-static. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { + TREE_PUBLIC (newdecl) &= TREE_PUBLIC (olddecl); + /* This is since we don't automatically + copy the attributes of NEWDECL into OLDDECL. */ + TREE_PUBLIC (olddecl) = TREE_PUBLIC (newdecl); + /* If this clears `static', clear it in the identifier too. */ + if (!TREE_PUBLIC (olddecl)) + TREE_PUBLIC (DECL_NAME (olddecl)) = 0; + } } + if (DECL_EXTERNAL (newdecl)) { TREE_STATIC (newdecl) = TREE_STATIC (olddecl); @@ -1416,7 +1755,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) /* An extern decl does not override previous storage class. */ TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl); - if (! DECL_EXTERNAL (newdecl)) + if (!DECL_EXTERNAL (newdecl)) { DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl); DECL_COMMON (newdecl) = DECL_COMMON (olddecl); @@ -1432,13 +1771,13 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) { /* If we're redefining a function previously defined as extern inline, make sure we emit debug info for the inline before we - throw it away, in case it was inlined into a function that hasn't - been written out yet. */ + throw it away, in case it was inlined into a function that + hasn't been written out yet. */ if (new_is_definition && DECL_INITIAL (olddecl)) { if (TREE_USED (olddecl) /* In unit-at-a-time mode we never inline re-defined extern - inline functions. */ + inline functions. */ && !flag_unit_at_a_time && cgraph_function_possibly_inlined_p (olddecl)) (*debug_hooks->outlining_inline_function) (olddecl); @@ -1449,8 +1788,8 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) } else { - /* If either decl says `inline', this fn is inline, - unless its definition was passed already. */ + /* If either decl says `inline', this fn is inline, unless + its definition was passed already. */ if (DECL_DECLARED_INLINE_P (newdecl) || DECL_DECLARED_INLINE_P (olddecl)) DECL_DECLARED_INLINE_P (newdecl) = 1; @@ -1461,23 +1800,30 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) if (DECL_BUILT_IN (olddecl)) { - /* If redeclaring a builtin function, it stays built in. */ + /* If redeclaring a builtin function, it stays built in. + But it gets tagged as having been declared. */ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); + C_DECL_DECLARED_BUILTIN (newdecl) = 1; + if (new_is_prototype) + C_DECL_BUILTIN_PROTOTYPE (newdecl) = 0; + else + C_DECL_BUILTIN_PROTOTYPE (newdecl) + = C_DECL_BUILTIN_PROTOTYPE (olddecl); } /* Also preserve various other info from the definition. */ - if (! new_is_definition) + if (!new_is_definition) { DECL_RESULT (newdecl) = DECL_RESULT (olddecl); DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); - DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl); + DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl); DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl); DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl); /* Set DECL_INLINE on the declaration if we've got a body from which to instantiate. */ - if (DECL_INLINE (olddecl) && ! DECL_UNINLINABLE (newdecl)) + if (DECL_INLINE (olddecl) && !DECL_UNINLINABLE (newdecl)) { DECL_INLINE (newdecl) = 1; DECL_ABSTRACT_ORIGIN (newdecl) @@ -1489,22 +1835,43 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) /* If a previous declaration said inline, mark the definition as inlinable. */ if (DECL_DECLARED_INLINE_P (newdecl) - && ! DECL_UNINLINABLE (newdecl)) + && !DECL_UNINLINABLE (newdecl)) DECL_INLINE (newdecl) = 1; } } /* Copy most of the decl-specific fields of NEWDECL into OLDDECL. - But preserve OLDDECL's DECL_UID and C_DECL_INVISIBLE. */ + But preserve OLDDECL's DECL_UID and DECL_CONTEXT. */ { unsigned olddecl_uid = DECL_UID (olddecl); - unsigned olddecl_invisible = C_DECL_INVISIBLE (olddecl); + tree olddecl_context = DECL_CONTEXT (olddecl); memcpy ((char *) olddecl + sizeof (struct tree_common), (char *) newdecl + sizeof (struct tree_common), - sizeof (struct tree_decl) - sizeof (struct tree_common)); + sizeof (struct tree_decl_common) - sizeof (struct tree_common)); + switch (TREE_CODE (olddecl)) + { + case FIELD_DECL: + case VAR_DECL: + case PARM_DECL: + case LABEL_DECL: + case RESULT_DECL: + case CONST_DECL: + case TYPE_DECL: + case FUNCTION_DECL: + memcpy ((char *) olddecl + sizeof (struct tree_decl_common), + (char *) newdecl + sizeof (struct tree_decl_common), + tree_code_size (TREE_CODE (olddecl)) - sizeof (struct tree_decl_common)); + break; + + default: + + memcpy ((char *) olddecl + sizeof (struct tree_decl_common), + (char *) newdecl + sizeof (struct tree_decl_common), + sizeof (struct tree_decl_non_common) - sizeof (struct tree_decl_common)); + } DECL_UID (olddecl) = olddecl_uid; - C_DECL_INVISIBLE (olddecl) = olddecl_invisible; + DECL_CONTEXT (olddecl) = olddecl_context; } /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl @@ -1514,7 +1881,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) && (TREE_CODE (olddecl) == FUNCTION_DECL || (TREE_CODE (olddecl) == VAR_DECL && TREE_STATIC (olddecl)))) - make_decl_rtl (olddecl, NULL); + make_decl_rtl (olddecl); } /* Handle when a new declaration NEWDECL has the same name as an old @@ -1527,81 +1894,67 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) static bool duplicate_decls (tree newdecl, tree olddecl) { - tree newtype, oldtype; + tree newtype = NULL, oldtype = NULL; if (!diagnose_mismatched_decls (newdecl, olddecl, &newtype, &oldtype)) - return false; + { + /* Avoid `unused variable' and other warnings warnings for OLDDECL. */ + TREE_NO_WARNING (olddecl) = 1; + return false; + } merge_decls (newdecl, olddecl, newtype, oldtype); return true; } - + -/* Return any external DECL associated with ID, whether or not it is - currently in scope. */ - -static tree -any_external_decl (tree id) -{ - tree decl = IDENTIFIER_SYMBOL_VALUE (id); - tree t; - - if (decl == 0 || TREE_CODE (decl) == ERROR_MARK) - return 0; - else if (TREE_CODE (decl) != TYPE_DECL && DECL_EXTERNAL (decl)) - return decl; - - t = purpose_member (id, truly_local_externals); - if (t) - return TREE_VALUE (t); - - return 0; -} - -/* Record an external decl DECL. This only does something if a - shadowing decl already exists. */ +/* Check whether decl-node NEW_DECL shadows an existing declaration. */ static void -record_external_decl (tree decl) +warn_if_shadowing (tree new_decl) { - tree name = DECL_NAME (decl); - if (!IDENTIFIER_SYMBOL_VALUE (name)) - return; + struct c_binding *b; - truly_local_externals = tree_cons (name, decl, truly_local_externals); -} - -/* Check whether decl-node X shadows an existing declaration. - OLD is the old IDENTIFIER_SYMBOL_VALUE of the DECL_NAME of X, - which might be a NULL_TREE. */ -static void -warn_if_shadowing (tree x, tree old) -{ - /* Nothing to shadow? */ - if (old == 0 - /* Shadow warnings not wanted? */ - || !warn_shadow + /* Shadow warnings wanted? */ + if (!warn_shadow /* No shadow warnings for internally generated vars. */ - || DECL_SOURCE_LINE (x) == 0 + || DECL_IS_BUILTIN (new_decl) /* No shadow warnings for vars made for inlining. */ - || DECL_FROM_INLINE (x) - /* Don't warn about the parm names in function declarator - within a function declarator. - It would be nice to avoid warning in any function - declarator in a declaration, as opposed to a definition, - but there is no way to tell it's not a definition. */ - || (TREE_CODE (x) == PARM_DECL && current_scope->outer->parm_flag) - /* Shadow warnings only apply to local variables and parameters. */ - || (TREE_CODE (x) != PARM_DECL && DECL_FILE_SCOPE_P (x))) + || DECL_FROM_INLINE (new_decl)) return; - if (TREE_CODE (old) == PARM_DECL) - warning ("%Jdeclaration of '%D' shadows a parameter", x, x); - else if (DECL_FILE_SCOPE_P (old)) - warning ("%Jdeclaration of '%D' shadows a global declaration", x, x); - else - warning ("%Jdeclaration of '%D' shadows a previous local", x, x); + /* Is anything being shadowed? Invisible decls do not count. */ + for (b = I_SYMBOL_BINDING (DECL_NAME (new_decl)); b; b = b->shadowed) + if (b->decl && b->decl != new_decl && !b->invisible) + { + tree old_decl = b->decl; - warning ("%Jshadowed declaration is here", old); + if (old_decl == error_mark_node) + { + warning (OPT_Wshadow, "declaration of %q+D shadows previous " + "non-variable", new_decl); + break; + } + else if (TREE_CODE (old_decl) == PARM_DECL) + warning (OPT_Wshadow, "declaration of %q+D shadows a parameter", + new_decl); + else if (DECL_FILE_SCOPE_P (old_decl)) + warning (OPT_Wshadow, "declaration of %q+D shadows a global " + "declaration", new_decl); + else if (TREE_CODE (old_decl) == FUNCTION_DECL + && DECL_BUILT_IN (old_decl)) + { + warning (OPT_Wshadow, "declaration of %q+D shadows " + "a built-in function", new_decl); + break; + } + else + warning (OPT_Wshadow, "declaration of %q+D shadows a previous local", + new_decl); + + warning (OPT_Wshadow, "%Jshadowed declaration is here", old_decl); + + break; + } } @@ -1621,7 +1974,7 @@ warn_if_shadowing (tree x, tree old) translation and get back the corresponding typedef name. For example, given: - typedef struct S MY_TYPE; + typedef struct S MY_TYPE; MY_TYPE object; Later parts of the compiler might only know that `object' was of @@ -1652,7 +2005,7 @@ warn_if_shadowing (tree x, tree old) static void clone_underlying_type (tree x) { - if (DECL_SOURCE_LINE (x) == 0) + if (DECL_IS_BUILTIN (x)) { if (TYPE_NAME (TREE_TYPE (x)) == 0) TYPE_NAME (TREE_TYPE (x)) = x; @@ -1662,7 +2015,7 @@ clone_underlying_type (tree x) { tree tt = TREE_TYPE (x); DECL_ORIGINAL_TYPE (x) = tt; - tt = build_type_copy (tt); + tt = build_variant_type_copy (tt); TYPE_NAME (tt) = x; TREE_USED (tt) = TREE_USED (x); TREE_TYPE (x) = tt; @@ -1682,134 +2035,253 @@ pushdecl (tree x) { tree name = DECL_NAME (x); struct c_scope *scope = current_scope; - -#ifdef ENABLE_CHECKING - if (error_mark_node == 0) - /* Called too early. */ - abort (); -#endif + struct c_binding *b; + bool nested = false; /* Functions need the lang_decl data. */ - if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x)) - DECL_LANG_SPECIFIC (x) = ggc_alloc_cleared (sizeof (struct lang_decl)); + if (TREE_CODE (x) == FUNCTION_DECL && !DECL_LANG_SPECIFIC (x)) + DECL_LANG_SPECIFIC (x) = GGC_CNEW (struct lang_decl); - /* A local extern declaration for a function doesn't constitute nesting. - A local auto declaration does, since it's a forward decl - for a nested function coming later. */ - if (current_function_decl == NULL - || ((TREE_CODE (x) == FUNCTION_DECL || TREE_CODE (x) == VAR_DECL) - && DECL_INITIAL (x) == 0 && DECL_EXTERNAL (x))) - DECL_CONTEXT (x) = current_file_decl; - else + /* Must set DECL_CONTEXT for everything not at file scope or + DECL_FILE_SCOPE_P won't work. Local externs don't count + unless they have initializers (which generate code). */ + if (current_function_decl + && ((TREE_CODE (x) != FUNCTION_DECL && TREE_CODE (x) != VAR_DECL) + || DECL_INITIAL (x) || !DECL_EXTERNAL (x))) DECL_CONTEXT (x) = current_function_decl; - if (name) + /* If this is of variably modified type, prevent jumping into its + scope. */ + if ((TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == TYPE_DECL) + && variably_modified_type_p (TREE_TYPE (x), NULL_TREE)) + c_begin_vm_scope (scope->depth); + + /* Anonymous decls are just inserted in the scope. */ + if (!name) { - tree old; + bind (name, x, scope, /*invisible=*/false, /*nested=*/false); + return x; + } - if (warn_nested_externs - && scope != global_scope - && DECL_EXTERNAL (x) - && !DECL_IN_SYSTEM_HEADER (x)) - warning ("nested extern declaration of `%s'", - IDENTIFIER_POINTER (name)); - - old = lookup_name_current_level (name); - if (old && duplicate_decls (x, old)) + /* First, see if there is another declaration with the same name in + the current scope. If there is, duplicate_decls may do all the + work for us. If duplicate_decls returns false, that indicates + two incompatible decls in the same scope; we are to silently + replace the old one (duplicate_decls has issued all appropriate + diagnostics). In particular, we should not consider possible + duplicates in the external scope, or shadowing. */ + b = I_SYMBOL_BINDING (name); + if (b && B_IN_SCOPE (b, scope)) + { + struct c_binding *b_ext, *b_use; + tree type = TREE_TYPE (x); + tree visdecl = b->decl; + tree vistype = TREE_TYPE (visdecl); + if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE + && COMPLETE_TYPE_P (TREE_TYPE (x))) + b->inner_comp = false; + b_use = b; + b_ext = b; + /* If this is an external linkage declaration, we should check + for compatibility with the type in the external scope before + setting the type at this scope based on the visible + information only. */ + if (TREE_PUBLIC (x) && TREE_PUBLIC (visdecl)) { - /* For PARM_DECLs, old may be a forward declaration. - If so, we want to remove it from its old location - (in the variables chain) and rechain it in the - location given by the new declaration. */ - if (TREE_CODE (x) == PARM_DECL) + while (b_ext && !B_IN_EXTERNAL_SCOPE (b_ext)) + b_ext = b_ext->shadowed; + if (b_ext) { - tree *p; - for (p = &scope->names; *p; p = &TREE_CHAIN (*p)) - if (*p == old) - { - *p = TREE_CHAIN (old); - SCOPE_LIST_APPEND (scope, parms, old); - break; - } + b_use = b_ext; + if (b_use->type) + TREE_TYPE (b_use->decl) = b_use->type; } - return old; } - if (DECL_EXTERNAL (x) || scope == global_scope) + if (duplicate_decls (x, b_use->decl)) { - /* Find and check against a previous, not-in-scope, external - decl for this identifier. (C99 6.2.7p2: All declarations - that refer to the same object or function shall have - compatible type; otherwise, the behavior is undefined.) */ - tree ext = any_external_decl (name); - if (ext) + if (b_use != b) { - if (duplicate_decls (x, ext)) - x = copy_node (ext); + /* Save the updated type in the external scope and + restore the proper type for this scope. */ + tree thistype; + if (comptypes (vistype, type)) + thistype = composite_type (vistype, type); + else + thistype = TREE_TYPE (b_use->decl); + b_use->type = TREE_TYPE (b_use->decl); + if (TREE_CODE (b_use->decl) == FUNCTION_DECL + && DECL_BUILT_IN (b_use->decl)) + thistype + = build_type_attribute_variant (thistype, + TYPE_ATTRIBUTES + (b_use->type)); + TREE_TYPE (b_use->decl) = thistype; + } + return b_use->decl; + } + else + goto skip_external_and_shadow_checks; + } + + /* All declarations with external linkage, and all external + references, go in the external scope, no matter what scope is + current. However, the binding in that scope is ignored for + purposes of normal name lookup. A separate binding structure is + created in the requested scope; this governs the normal + visibility of the symbol. + + The binding in the externals scope is used exclusively for + detecting duplicate declarations of the same object, no matter + what scope they are in; this is what we do here. (C99 6.2.7p2: + All declarations that refer to the same object or function shall + have compatible type; otherwise, the behavior is undefined.) */ + if (DECL_EXTERNAL (x) || scope == file_scope) + { + tree type = TREE_TYPE (x); + tree vistype = 0; + tree visdecl = 0; + bool type_saved = false; + if (b && !B_IN_EXTERNAL_SCOPE (b) + && (TREE_CODE (b->decl) == FUNCTION_DECL + || TREE_CODE (b->decl) == VAR_DECL) + && DECL_FILE_SCOPE_P (b->decl)) + { + visdecl = b->decl; + vistype = TREE_TYPE (visdecl); + } + if (scope != file_scope + && !DECL_IN_SYSTEM_HEADER (x)) + warning (OPT_Wnested_externs, "nested extern declaration of %qD", x); + + while (b && !B_IN_EXTERNAL_SCOPE (b)) + { + /* If this decl might be modified, save its type. This is + done here rather than when the decl is first bound + because the type may change after first binding, through + being completed or through attributes being added. If we + encounter multiple such decls, only the first should have + its type saved; the others will already have had their + proper types saved and the types will not have changed as + their scopes will not have been re-entered. */ + if (DECL_P (b->decl) && DECL_FILE_SCOPE_P (b->decl) && !type_saved) + { + b->type = TREE_TYPE (b->decl); + type_saved = true; + } + if (B_IN_FILE_SCOPE (b) + && TREE_CODE (b->decl) == VAR_DECL + && TREE_STATIC (b->decl) + && TREE_CODE (TREE_TYPE (b->decl)) == ARRAY_TYPE + && !TYPE_DOMAIN (TREE_TYPE (b->decl)) + && TREE_CODE (type) == ARRAY_TYPE + && TYPE_DOMAIN (type) + && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) + && !integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))) + { + /* Array type completed in inner scope, which should be + diagnosed if the completion does not have size 1 and + it does not get completed in the file scope. */ + b->inner_comp = true; + } + b = b->shadowed; + } + + /* If a matching external declaration has been found, set its + type to the composite of all the types of that declaration. + After the consistency checks, it will be reset to the + composite of the visible types only. */ + if (b && (TREE_PUBLIC (x) || same_translation_unit_p (x, b->decl)) + && b->type) + TREE_TYPE (b->decl) = b->type; + + /* The point of the same_translation_unit_p check here is, + we want to detect a duplicate decl for a construct like + foo() { extern bar(); } ... static bar(); but not if + they are in different translation units. In any case, + the static does not go in the externals scope. */ + if (b + && (TREE_PUBLIC (x) || same_translation_unit_p (x, b->decl)) + && duplicate_decls (x, b->decl)) + { + tree thistype; + if (vistype) + { + if (comptypes (vistype, type)) + thistype = composite_type (vistype, type); + else + thistype = TREE_TYPE (b->decl); } else - record_external_decl (x); + thistype = type; + b->type = TREE_TYPE (b->decl); + if (TREE_CODE (b->decl) == FUNCTION_DECL && DECL_BUILT_IN (b->decl)) + thistype + = build_type_attribute_variant (thistype, + TYPE_ATTRIBUTES (b->type)); + TREE_TYPE (b->decl) = thistype; + bind (name, b->decl, scope, /*invisible=*/false, /*nested=*/true); + return b->decl; } - - if (TREE_CODE (x) == TYPE_DECL) - clone_underlying_type (x); - - /* If storing a local value, there may already be one - (inherited). If so, record it for restoration when this - scope ends. Take care not to do this if we are replacing an - older decl in the same scope (i.e. duplicate_decls returned - false, above). */ - if (scope != global_scope) + else if (TREE_PUBLIC (x)) { - tree inherited_decl = lookup_name (name); - if (inherited_decl && inherited_decl != old) + if (visdecl && !b && duplicate_decls (x, visdecl)) { - warn_if_shadowing (x, inherited_decl); - scope->shadowed = tree_cons (name, inherited_decl, - scope->shadowed); + /* An external declaration at block scope referring to a + visible entity with internal linkage. The composite + type will already be correct for this scope, so we + just need to fall through to make the declaration in + this scope. */ + nested = true; + x = visdecl; + } + else + { + bind (name, x, external_scope, /*invisible=*/true, + /*nested=*/false); + nested = true; } - } - - /* Install the new declaration in the requested scope. */ - IDENTIFIER_SYMBOL_VALUE (name) = x; - C_DECL_INVISIBLE (x) = 0; - - /* If x's type is incomplete because it's based on a - structure or union which has not yet been fully declared, - attach it to that structure or union type, so we can go - back and complete the variable declaration later, if the - structure or union gets fully declared. - - If the input is erroneous, we can have error_mark in the type - slot (e.g. "f(void a, ...)") - that doesn't count as an - incomplete type. */ - if (TREE_TYPE (x) != error_mark_node - && !COMPLETE_TYPE_P (TREE_TYPE (x))) - { - tree element = TREE_TYPE (x); - - while (TREE_CODE (element) == ARRAY_TYPE) - element = TREE_TYPE (element); - element = TYPE_MAIN_VARIANT (element); - - if ((TREE_CODE (element) == RECORD_TYPE - || TREE_CODE (element) == UNION_TYPE) - && (TREE_CODE (x) != TYPE_DECL - || TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE) - && !COMPLETE_TYPE_P (element)) - C_TYPE_INCOMPLETE_VARS (element) - = tree_cons (NULL_TREE, x, C_TYPE_INCOMPLETE_VARS (element)); } } - if (TREE_CODE (x) == PARM_DECL) - SCOPE_LIST_APPEND (scope, parms, x); - else - SCOPE_LIST_APPEND (scope, names, x); + if (TREE_CODE (x) != PARM_DECL) + warn_if_shadowing (x); + skip_external_and_shadow_checks: + if (TREE_CODE (x) == TYPE_DECL) + clone_underlying_type (x); + + bind (name, x, scope, /*invisible=*/false, nested); + + /* If x's type is incomplete because it's based on a + structure or union which has not yet been fully declared, + attach it to that structure or union type, so we can go + back and complete the variable declaration later, if the + structure or union gets fully declared. + + If the input is erroneous, we can have error_mark in the type + slot (e.g. "f(void a, ...)") - that doesn't count as an + incomplete type. */ + if (TREE_TYPE (x) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (x))) + { + tree element = TREE_TYPE (x); + + while (TREE_CODE (element) == ARRAY_TYPE) + element = TREE_TYPE (element); + element = TYPE_MAIN_VARIANT (element); + + if ((TREE_CODE (element) == RECORD_TYPE + || TREE_CODE (element) == UNION_TYPE) + && (TREE_CODE (x) != TYPE_DECL + || TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE) + && !COMPLETE_TYPE_P (element)) + C_TYPE_INCOMPLETE_VARS (element) + = tree_cons (NULL_TREE, x, C_TYPE_INCOMPLETE_VARS (element)); + } return x; } -/* Record X as belonging to the global scope (C99 "file scope"). +/* Record X as belonging to file scope. This is used only internally by the Objective-C front end, and is limited to its needs. duplicate_decls is not called; if there is any preexisting decl for this identifier, it is an ICE. */ @@ -1818,50 +2290,117 @@ tree pushdecl_top_level (tree x) { tree name; - - if (TREE_CODE (x) != VAR_DECL) - abort (); + bool nested = false; + gcc_assert (TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == CONST_DECL); name = DECL_NAME (x); - if (IDENTIFIER_SYMBOL_VALUE (name)) - abort (); + gcc_assert (TREE_CODE (x) == CONST_DECL || !I_SYMBOL_BINDING (name)); - DECL_CONTEXT (x) = current_file_decl; - IDENTIFIER_SYMBOL_VALUE (name) = x; + if (TREE_PUBLIC (x)) + { + bind (name, x, external_scope, /*invisible=*/true, /*nested=*/false); + nested = true; + } + if (file_scope) + bind (name, x, file_scope, /*invisible=*/false, nested); - SCOPE_LIST_APPEND (global_scope, names, x); return x; } +static void +implicit_decl_warning (tree id, tree olddecl) +{ + void (*diag) (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2); + switch (mesg_implicit_function_declaration) + { + case 0: return; + case 1: diag = warning0; break; + case 2: diag = error; break; + default: gcc_unreachable (); + } + + diag (G_("implicit declaration of function %qE"), id); + if (olddecl) + locate_old_decl (olddecl, diag); +} + /* Generate an implicit declaration for identifier FUNCTIONID as a function of type int (). */ tree implicitly_declare (tree functionid) { - tree decl = any_external_decl (functionid); + struct c_binding *b; + tree decl = 0; + tree asmspec_tree; + + for (b = I_SYMBOL_BINDING (functionid); b; b = b->shadowed) + { + if (B_IN_SCOPE (b, external_scope)) + { + decl = b->decl; + break; + } + } if (decl) { - /* Implicit declaration of a function already declared - (somehow) in a different scope, or as a built-in. - If this is the first time this has happened, warn; - then recycle the old declaration. */ - if (!C_DECL_IMPLICIT (decl)) - { - implicit_decl_warning (DECL_NAME (decl)); - if (! DECL_FILE_SCOPE_P (decl)) - warning ("%Jprevious declaration of '%D'", decl, decl); - C_DECL_IMPLICIT (decl) = 1; - } - /* If this function is global, then it must already be in the - global scope, so there's no need to push it again. */ - if (current_scope == global_scope) + if (decl == error_mark_node) return decl; - /* If this is a local declaration, make a copy; we can't have - the same DECL listed in two different scopes. */ - return pushdecl (copy_node (decl)); + + /* FIXME: Objective-C has weird not-really-builtin functions + which are supposed to be visible automatically. They wind up + in the external scope because they're pushed before the file + scope gets created. Catch this here and rebind them into the + file scope. */ + if (!DECL_BUILT_IN (decl) && DECL_IS_BUILTIN (decl)) + { + bind (functionid, decl, file_scope, + /*invisible=*/false, /*nested=*/true); + return decl; + } + else + { + tree newtype = default_function_type; + if (b->type) + TREE_TYPE (decl) = b->type; + /* Implicit declaration of a function already declared + (somehow) in a different scope, or as a built-in. + If this is the first time this has happened, warn; + then recycle the old declaration but with the new type. */ + if (!C_DECL_IMPLICIT (decl)) + { + implicit_decl_warning (functionid, decl); + C_DECL_IMPLICIT (decl) = 1; + } + if (DECL_BUILT_IN (decl)) + { + newtype = build_type_attribute_variant (newtype, + TYPE_ATTRIBUTES + (TREE_TYPE (decl))); + if (!comptypes (newtype, TREE_TYPE (decl))) + { + warning (0, "incompatible implicit declaration of built-in" + " function %qD", decl); + newtype = TREE_TYPE (decl); + } + } + else + { + if (!comptypes (newtype, TREE_TYPE (decl))) + { + error ("incompatible implicit declaration of function %qD", + decl); + locate_old_decl (decl, error); + } + } + b->type = TREE_TYPE (decl); + TREE_TYPE (decl) = newtype; + bind (functionid, decl, current_scope, + /*invisible=*/false, /*nested=*/true); + return decl; + } } /* Not seen before. */ @@ -1869,14 +2408,17 @@ implicitly_declare (tree functionid) DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; C_DECL_IMPLICIT (decl) = 1; - implicit_decl_warning (functionid); + implicit_decl_warning (functionid, 0); + asmspec_tree = maybe_apply_renaming_pragma (decl, /*asmname=*/NULL); + if (asmspec_tree) + set_user_assembler_name (decl, TREE_STRING_POINTER (asmspec_tree)); /* C89 says implicit declarations are in the innermost block. So we record the decl in the standard fashion. */ decl = pushdecl (decl); /* No need to call objc_check_decl here - it's a function type. */ - rest_of_decl_compilation (decl, NULL, 0, 0); + rest_of_decl_compilation (decl, 0, 0); /* Write a record describing this implicit function declaration to the prototypes file (if requested). */ @@ -1888,51 +2430,38 @@ implicitly_declare (tree functionid) return decl; } -static void -implicit_decl_warning (tree id) -{ - const char *name = IDENTIFIER_POINTER (id); - if (mesg_implicit_function_declaration == 2) - error ("implicit declaration of function `%s'", name); - else if (mesg_implicit_function_declaration == 1) - warning ("implicit declaration of function `%s'", name); -} - /* Issue an error message for a reference to an undeclared variable ID, including a reference to a builtin outside of function-call context. Establish a binding of the identifier to error_mark_node in an appropriate scope, which will suppress further errors for the - same identifier. */ + same identifier. The error message should be given location LOC. */ void -undeclared_variable (tree id) +undeclared_variable (tree id, location_t loc) { static bool already = false; struct c_scope *scope; if (current_function_decl == 0) { - error ("`%s' undeclared here (not in a function)", - IDENTIFIER_POINTER (id)); + error ("%H%qE undeclared here (not in a function)", &loc, id); scope = current_scope; } else { - error ("`%s' undeclared (first use in this function)", - IDENTIFIER_POINTER (id)); + error ("%H%qE undeclared (first use in this function)", &loc, id); - if (! already) + if (!already) { - error ("(Each undeclared identifier is reported only once"); - error ("for each function it appears in.)"); + error ("%H(Each undeclared identifier is reported only once", &loc); + error ("%Hfor each function it appears in.)", &loc); already = true; } - scope = current_function_scope; + /* If we are parsing old-style parameter decls, current_function_decl + will be nonnull but current_function_scope will be null. */ + scope = current_function_scope ? current_function_scope : current_scope; } - - scope->shadowed = tree_cons (id, IDENTIFIER_SYMBOL_VALUE (id), - scope->shadowed); - IDENTIFIER_SYMBOL_VALUE (id) = error_mark_node; + bind (id, error_mark_node, scope, /*invisible=*/false, /*nested=*/false); } /* Subroutine of lookup_label, declare_label, define_label: construct a @@ -1950,20 +2479,6 @@ make_label (tree name, location_t location) return label; } -/* Another subroutine of lookup_label, declare_label, define_label: - set up the binding of name to LABEL_DECL in the given SCOPE. */ - -static void -bind_label (tree name, tree label, struct c_scope *scope) -{ - if (IDENTIFIER_LABEL_VALUE (name)) - scope->shadowed = tree_cons (name, IDENTIFIER_LABEL_VALUE (name), - scope->shadowed); - IDENTIFIER_LABEL_VALUE (name) = label; - - SCOPE_LIST_APPEND (scope, names, label); -} - /* Get the LABEL_DECL corresponding to identifier NAME as a label. Create one if none exists so far for the current function. This is called when a label is used in a goto expression or @@ -1976,15 +2491,14 @@ lookup_label (tree name) if (current_function_decl == 0) { - error ("label %s referenced outside of any function", - IDENTIFIER_POINTER (name)); + error ("label %qE referenced outside of any function", name); return 0; } /* Use a label already defined or ref'd with this name, but not if it is inherited from a containing function and wasn't declared using __label__. */ - label = IDENTIFIER_LABEL_VALUE (name); + label = I_LABEL_DECL (name); if (label && (DECL_CONTEXT (label) == current_function_decl || C_DECLARED_LABEL_FLAG (label))) { @@ -2000,7 +2514,8 @@ lookup_label (tree name) label = make_label (name, input_location); /* Ordinary labels go in the current function scope. */ - bind_label (name, label, current_function_scope); + bind (name, label, current_function_scope, + /*invisible=*/false, /*nested=*/false); return label; } @@ -2008,33 +2523,29 @@ lookup_label (tree name) any that may be inherited from containing functions or containing scopes. This is called for __label__ declarations. */ -/* Note that valid use, if the label being shadowed comes from another - scope in the same function, requires calling declare_nonlocal_label - right away. (Is this still true? -zw 2003-07-17) */ - tree declare_label (tree name) { - tree label = IDENTIFIER_LABEL_VALUE (name); - tree dup; + struct c_binding *b = I_LABEL_BINDING (name); + tree label; /* Check to make sure that the label hasn't already been declared at this scope */ - for (dup = current_scope->names; dup; dup = TREE_CHAIN (dup)) - if (dup == label) - { - error ("duplicate label declaration `%s'", IDENTIFIER_POINTER (name)); - error ("%Jthis is a previous declaration", dup); + if (b && B_IN_CURRENT_SCOPE (b)) + { + error ("duplicate label declaration %qE", name); + locate_old_decl (b->decl, error); - /* Just use the previous declaration. */ - return dup; - } + /* Just use the previous declaration. */ + return b->decl; + } label = make_label (name, input_location); C_DECLARED_LABEL_FLAG (label) = 1; /* Declared labels go in the current scope. */ - bind_label (name, label, current_scope); + bind (name, label, current_scope, + /*invisible=*/false, /*nested=*/false); return label; } @@ -2045,13 +2556,12 @@ declare_label (tree name) tree define_label (location_t location, tree name) { - tree label; - /* Find any preexisting label with this name. It is an error if that label has already been defined in this function, or if there is a containing function with a declared label with the same name. */ - label = IDENTIFIER_LABEL_VALUE (name); + tree label = I_LABEL_DECL (name); + struct c_label_list *nlist_se, *nlist_vm; if (label && ((DECL_CONTEXT (label) == current_function_decl @@ -2059,11 +2569,8 @@ define_label (location_t location, tree name) || (DECL_CONTEXT (label) != current_function_decl && C_DECLARED_LABEL_FLAG (label)))) { - error ("%Hduplicate label `%D'", &location, label); - if (DECL_INITIAL (label)) - error ("%J`%D' previously defined here", label, label); - else - error ("%J`%D' previously declared here", label, label); + error ("%Hduplicate label %qD", &location, label); + locate_old_decl (label, error); return 0; } else if (label && DECL_CONTEXT (label) == current_function_decl) @@ -2071,6 +2578,11 @@ define_label (location_t location, tree name) /* The label has been used or declared already in this function, but not defined. Update its location to point to this definition. */ + if (C_DECL_UNDEFINABLE_STMT_EXPR (label)) + error ("%Jjump into statement expression", label); + if (C_DECL_UNDEFINABLE_VM (label)) + error ("%Jjump into scope of identifier with variably modified type", + label); DECL_SOURCE_LOCATION (label) = location; } else @@ -2079,27 +2591,28 @@ define_label (location_t location, tree name) label = make_label (name, location); /* Ordinary labels go in the current function scope. */ - bind_label (name, label, current_function_scope); + bind (name, label, current_function_scope, + /*invisible=*/false, /*nested=*/false); } - if (warn_traditional && !in_system_header && lookup_name (name)) - warning ("%Htraditional C lacks a separate namespace for labels, " - "identifier `%s' conflicts", &location, - IDENTIFIER_POINTER (name)); + if (!in_system_header && lookup_name (name)) + warning (OPT_Wtraditional, "%Htraditional C lacks a separate namespace " + "for labels, identifier %qE conflicts", &location, name); + + nlist_se = XOBNEW (&parser_obstack, struct c_label_list); + nlist_se->next = label_context_stack_se->labels_def; + nlist_se->label = label; + label_context_stack_se->labels_def = nlist_se; + + nlist_vm = XOBNEW (&parser_obstack, struct c_label_list); + nlist_vm->next = label_context_stack_vm->labels_def; + nlist_vm->label = label; + label_context_stack_vm->labels_def = nlist_vm; /* Mark label as having been defined. */ DECL_INITIAL (label) = error_mark_node; return label; } - -/* Return the list of declarations of the current scope. */ - -tree -getdecls (void) -{ - return current_scope->names; -} - /* Given NAME, an IDENTIFIER_NODE, return the structure (or union or enum) definition for that name. @@ -2111,25 +2624,29 @@ getdecls (void) static tree lookup_tag (enum tree_code code, tree name, int thislevel_only) { - tree tag = IDENTIFIER_TAG_VALUE (name); + struct c_binding *b = I_TAG_BINDING (name); int thislevel = 0; - if (!tag) + if (!b || !b->decl) return 0; /* We only care about whether it's in this level if thislevel_only was set or it might be a type clash. */ - if (thislevel_only || TREE_CODE (tag) != code) + if (thislevel_only || TREE_CODE (b->decl) != code) { - if (current_scope == global_scope - || purpose_member (name, current_scope->tags)) + /* For our purposes, a tag in the external scope is the same as + a tag in the file scope. (Primarily relevant to Objective-C + and its builtin structure tags, which get pushed before the + file scope is created.) */ + if (B_IN_CURRENT_SCOPE (b) + || (current_scope == file_scope && B_IN_EXTERNAL_SCOPE (b))) thislevel = 1; } if (thislevel_only && !thislevel) return 0; - if (TREE_CODE (tag) != code) + if (TREE_CODE (b->decl) != code) { /* Definition isn't the kind we were looking for. */ pending_invalid_xref = name; @@ -2142,7 +2659,7 @@ lookup_tag (enum tree_code code, tree name, int thislevel_only) if (thislevel) pending_xref_error (); } - return tag; + return b->decl; } /* Print an error message now @@ -2154,9 +2671,8 @@ void pending_xref_error (void) { if (pending_invalid_xref != 0) - error ("%H`%s' defined as wrong kind of tag", - &pending_invalid_xref_location, - IDENTIFIER_POINTER (pending_invalid_xref)); + error ("%H%qE defined as wrong kind of tag", + &pending_invalid_xref_location, pending_invalid_xref); pending_invalid_xref = 0; } @@ -2169,36 +2685,22 @@ pending_xref_error (void) tree lookup_name (tree name) { - tree decl = IDENTIFIER_SYMBOL_VALUE (name); - if (decl == 0 || decl == error_mark_node) - return decl; - if (C_DECL_INVISIBLE (decl)) - return 0; - return decl; + struct c_binding *b = I_SYMBOL_BINDING (name); + if (b && !b->invisible) + return b->decl; + return 0; } -/* Similar to `lookup_name' but look only at the current scope. */ +/* Similar to `lookup_name' but look only at the indicated scope. */ static tree -lookup_name_current_level (tree name) +lookup_name_in_scope (tree name, struct c_scope *scope) { - tree decl = IDENTIFIER_SYMBOL_VALUE (name); - - if (decl == 0 || decl == error_mark_node || C_DECL_INVISIBLE (decl)) - return 0; - - if (current_scope == global_scope) - return decl; - - /* Scan the current scope for a decl with name NAME. - For PARM_DECLs, we have to look at both ->parms and ->names, since - forward parameter declarations wind up on the ->names list. */ - if (TREE_CODE (decl) == PARM_DECL - && chain_member (decl, current_scope->parms)) - return decl; - if (chain_member (decl, current_scope->names)) - return decl; + struct c_binding *b; + for (b = I_SYMBOL_BINDING (name); b; b = b->shadowed) + if (B_IN_SCOPE (b, scope)) + return b->decl; return 0; } @@ -2210,29 +2712,30 @@ lookup_name_current_level (tree name) void c_init_decl_processing (void) { - tree endlink; - tree ptr_ftype_void, ptr_ftype_ptr; location_t save_loc = input_location; - /* Adds some ggc roots, and reserved words for c-parse.in. */ + /* Initialize reserved words for parser. */ c_parse_init (); current_function_decl = 0; - /* Make the c_scope structure for global names. */ - pushlevel (0); - global_scope = current_scope; + gcc_obstack_init (&parser_obstack); + + /* Make the externals scope. */ + push_scope (); + external_scope = current_scope; /* Declarations from c_common_nodes_and_builtins must not be associated with this input file, lest we get differences between using and not using preprocessed headers. */ - input_location.file = ""; +#ifdef USE_MAPPED_LOCATION + input_location = BUILTINS_LOCATION; +#else + input_location.file = ""; input_location.line = 0; +#endif - /* Make the DECL for the toplevel file scope. */ - current_file_decl = build_decl (TRANSLATION_UNIT_DECL, NULL, NULL); - - build_common_tree_nodes (flag_signed_char); + build_common_tree_nodes (flag_signed_char, false); c_common_nodes_and_builtins (); @@ -2245,21 +2748,12 @@ c_init_decl_processing (void) pushdecl (build_decl (TYPE_DECL, get_identifier ("_Bool"), boolean_type_node)); - endlink = void_list_node; - ptr_ftype_void = build_function_type (ptr_type_node, endlink); - ptr_ftype_ptr - = build_function_type (ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, endlink)); - input_location = save_loc; - pedantic_lvalues = pedantic; + pedantic_lvalues = true; make_fname_decl = c_make_fname_decl; start_fname_decls (); - - first_builtin_decl = global_scope->names; - last_builtin_decl = global_scope->names_last; } /* Create the VAR_DECL for __FUNCTION__ etc. ID is the name to give the @@ -2276,9 +2770,9 @@ c_make_fname_decl (tree id, int type_dep) tree decl, type, init; size_t length = strlen (name); - type = build_array_type - (build_qualified_type (char_type_node, TYPE_QUAL_CONST), - build_index_type (size_int (length))); + type = build_array_type (char_type_node, + build_index_type (size_int (length))); + type = c_build_qualified_type (type, TYPE_QUAL_CONST); decl = build_decl (VAR_DECL, id, type); @@ -2287,16 +2781,26 @@ c_make_fname_decl (tree id, int type_dep) DECL_ARTIFICIAL (decl) = 1; init = build_string (length + 1, name); + free ((char *) name); TREE_TYPE (init) = type; DECL_INITIAL (decl) = init; TREE_USED (decl) = 1; - if (current_function_decl) + if (current_function_decl + /* For invalid programs like this: + + void foo() + const char* p = __FUNCTION__; + + the __FUNCTION__ is believed to appear in K&R style function + parameter declarator. In that case we still don't have + function_scope. */ + && (!errorcount || current_function_scope)) { DECL_CONTEXT (decl) = current_function_decl; - IDENTIFIER_SYMBOL_VALUE (id) = decl; - SCOPE_LIST_APPEND (current_function_scope, names, decl); + bind (id, decl, current_function_scope, + /*invisible=*/false, /*nested=*/false); } finish_decl (decl, init, NULL_TREE); @@ -2315,23 +2819,32 @@ c_make_fname_decl (tree id, int type_dep) tree builtin_function (const char *name, tree type, int function_code, - enum built_in_class class, const char *library_name, + enum built_in_class cl, const char *library_name, tree attrs) { - tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); - DECL_EXTERNAL (decl) = 1; + tree id = get_identifier (name); + tree decl = build_decl (FUNCTION_DECL, id, type); TREE_PUBLIC (decl) = 1; + DECL_EXTERNAL (decl) = 1; + DECL_LANG_SPECIFIC (decl) = GGC_CNEW (struct lang_decl); + DECL_BUILT_IN_CLASS (decl) = cl; + DECL_FUNCTION_CODE (decl) = function_code; + C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0); if (library_name) SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name)); - make_decl_rtl (decl, NULL); - pushdecl (decl); - DECL_BUILT_IN_CLASS (decl) = class; - DECL_FUNCTION_CODE (decl) = function_code; - /* Warn if a function in the namespace for users - is used without an occasion to consider it declared. */ - if (name[0] != '_' || name[1] != '_') - C_DECL_INVISIBLE (decl) = 1; + /* Should never be called on a symbol with a preexisting meaning. */ + gcc_assert (!I_SYMBOL_BINDING (id)); + + bind (id, decl, external_scope, /*invisible=*/true, /*nested=*/false); + + /* Builtins in the implementation namespace are made visible without + needing to be explicitly declared. See push_file_scope. */ + if (name[0] == '_' && (name[1] == '_' || ISUPPER (name[1]))) + { + TREE_CHAIN (decl) = visible_builtins; + visible_builtins = decl; + } /* Possibly apply some default attributes to this built-in function. */ if (attrs) @@ -2351,31 +2864,21 @@ builtin_function (const char *name, tree type, int function_code, Otherwise, it is an error. */ void -shadow_tag (tree declspecs) +shadow_tag (const struct c_declspecs *declspecs) { shadow_tag_warned (declspecs, 0); } +/* WARNED is 1 if we have done a pedwarn, 2 if we have done a warning, + but no pedwarn. */ void -shadow_tag_warned (tree declspecs, int warned) - - - /* 1 => we have done a pedwarn. 2 => we have done a warning, but - no pedwarn. */ +shadow_tag_warned (const struct c_declspecs *declspecs, int warned) { - int found_tag = 0; - tree link; - tree specs, attrs; + bool found_tag = false; - pending_invalid_xref = 0; - - /* Remove the attributes from declspecs, since they will confuse the - following code. */ - split_specs_attrs (declspecs, &specs, &attrs); - - for (link = specs; link; link = TREE_CHAIN (link)) + if (declspecs->type && !declspecs->default_int_p && !declspecs->typedef_p) { - tree value = TREE_VALUE (link); + tree value = declspecs->type; enum tree_code code = TREE_CODE (value); if (code == RECORD_TYPE || code == UNION_TYPE || code == ENUMERAL_TYPE) @@ -2385,7 +2888,7 @@ shadow_tag_warned (tree declspecs, int warned) tree name = TYPE_NAME (value); tree t; - found_tag++; + found_tag = true; if (name == 0) { @@ -2396,8 +2899,29 @@ shadow_tag_warned (tree declspecs, int warned) warned = 1; } } + else if (!declspecs->tag_defined_p + && declspecs->storage_class != csc_none) + { + if (warned != 1) + pedwarn ("empty declaration with storage class specifier " + "does not redeclare tag"); + warned = 1; + pending_xref_error (); + } + else if (!declspecs->tag_defined_p + && (declspecs->const_p + || declspecs->volatile_p + || declspecs->restrict_p)) + { + if (warned != 1) + pedwarn ("empty declaration with type qualifier " + "does not redeclare tag"); + warned = 1; + pending_xref_error (); + } else { + pending_invalid_xref = 0; t = lookup_tag (code, name, 1); if (t == 0) @@ -2409,102 +2933,210 @@ shadow_tag_warned (tree declspecs, int warned) } else { - if (!warned && ! in_system_header) + if (warned != 1 && !in_system_header) { - warning ("useless keyword or type name in empty declaration"); - warned = 2; + pedwarn ("useless type name in empty declaration"); + warned = 1; } } } + else if (warned != 1 && !in_system_header && declspecs->typedef_p) + { + pedwarn ("useless type name in empty declaration"); + warned = 1; + } - if (found_tag > 1) - error ("two types specified in one empty declaration"); + pending_invalid_xref = 0; + + if (declspecs->inline_p) + { + error ("% in empty declaration"); + warned = 1; + } + + if (current_scope == file_scope && declspecs->storage_class == csc_auto) + { + error ("% in file-scope empty declaration"); + warned = 1; + } + + if (current_scope == file_scope && declspecs->storage_class == csc_register) + { + error ("% in file-scope empty declaration"); + warned = 1; + } + + if (!warned && !in_system_header && declspecs->storage_class != csc_none) + { + warning (0, "useless storage class specifier in empty declaration"); + warned = 2; + } + + if (!warned && !in_system_header && declspecs->thread_p) + { + warning (0, "useless %<__thread%> in empty declaration"); + warned = 2; + } + + if (!warned && !in_system_header && (declspecs->const_p + || declspecs->volatile_p + || declspecs->restrict_p)) + { + warning (0, "useless type qualifier in empty declaration"); + warned = 2; + } if (warned != 1) { - if (found_tag == 0) + if (!found_tag) pedwarn ("empty declaration"); } } -/* Construct an array declarator. EXPR is the expression inside [], or - NULL_TREE. QUALS are the type qualifiers inside the [] (to be applied - to the pointer to which a parameter array is converted). STATIC_P is - nonzero if "static" is inside the [], zero otherwise. VLA_UNSPEC_P - is nonzero is the array is [*], a VLA of unspecified length which is - nevertheless a complete type (not currently implemented by GCC), - zero otherwise. The declarator is constructed as an ARRAY_REF - (to be decoded by grokdeclarator), whose operand 0 is what's on the - left of the [] (filled by in set_array_declarator_type) and operand 1 - is the expression inside; whose TREE_TYPE is the type qualifiers and - which has TREE_STATIC set if "static" is used. */ -tree -build_array_declarator (tree expr, tree quals, int static_p, int vla_unspec_p) +/* Return the qualifiers from SPECS as a bitwise OR of TYPE_QUAL_* + bits. SPECS represents declaration specifiers that the grammar + only permits to contain type qualifiers and attributes. */ + +int +quals_from_declspecs (const struct c_declspecs *specs) { - tree decl; - decl = build_nt (ARRAY_REF, NULL_TREE, expr); - TREE_TYPE (decl) = quals; - TREE_STATIC (decl) = (static_p ? 1 : 0); + int quals = ((specs->const_p ? TYPE_QUAL_CONST : 0) + | (specs->volatile_p ? TYPE_QUAL_VOLATILE : 0) + | (specs->restrict_p ? TYPE_QUAL_RESTRICT : 0)); + gcc_assert (!specs->type + && !specs->decl_attr + && specs->typespec_word == cts_none + && specs->storage_class == csc_none + && !specs->typedef_p + && !specs->explicit_signed_p + && !specs->deprecated_p + && !specs->long_p + && !specs->long_long_p + && !specs->short_p + && !specs->signed_p + && !specs->unsigned_p + && !specs->complex_p + && !specs->inline_p + && !specs->thread_p); + return quals; +} + +/* Construct an array declarator. EXPR is the expression inside [], + or NULL_TREE. QUALS are the type qualifiers inside the [] (to be + applied to the pointer to which a parameter array is converted). + STATIC_P is true if "static" is inside the [], false otherwise. + VLA_UNSPEC_P is true if the array is [*], a VLA of unspecified + length which is nevertheless a complete type, false otherwise. The + field for the contained declarator is left to be filled in by + set_array_declarator_inner. */ + +struct c_declarator * +build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p, + bool vla_unspec_p) +{ + struct c_declarator *declarator = XOBNEW (&parser_obstack, + struct c_declarator); + declarator->kind = cdk_array; + declarator->declarator = 0; + declarator->u.array.dimen = expr; + if (quals) + { + declarator->u.array.attrs = quals->attrs; + declarator->u.array.quals = quals_from_declspecs (quals); + } + else + { + declarator->u.array.attrs = NULL_TREE; + declarator->u.array.quals = 0; + } + declarator->u.array.static_p = static_p; + declarator->u.array.vla_unspec_p = vla_unspec_p; if (pedantic && !flag_isoc99) { - if (static_p || quals != NULL_TREE) - pedwarn ("ISO C90 does not support `static' or type qualifiers in parameter array declarators"); + if (static_p || quals != NULL) + pedwarn ("ISO C90 does not support % or type " + "qualifiers in parameter array declarators"); if (vla_unspec_p) - pedwarn ("ISO C90 does not support `[*]' array declarators"); + pedwarn ("ISO C90 does not support %<[*]%> array declarators"); } if (vla_unspec_p) - warning ("GCC does not yet properly implement `[*]' array declarators"); + { + if (!current_scope->parm_flag) + { + /* C99 6.7.5.2p4 */ + error ("%<[*]%> not allowed in other than function prototype scope"); + declarator->u.array.vla_unspec_p = false; + return NULL; + } + current_scope->had_vla_unspec = true; + } + return declarator; +} + +/* Set the contained declarator of an array declarator. DECL is the + declarator, as constructed by build_array_declarator; INNER is what + appears on the left of the []. ABSTRACT_P is true if it is an + abstract declarator, false otherwise; this is used to reject static + and type qualifiers in abstract declarators, where they are not in + the C99 grammar (subject to possible change in DR#289). */ + +struct c_declarator * +set_array_declarator_inner (struct c_declarator *decl, + struct c_declarator *inner, bool abstract_p) +{ + decl->declarator = inner; + if (abstract_p && (decl->u.array.quals != TYPE_UNQUALIFIED + || decl->u.array.attrs != NULL_TREE + || decl->u.array.static_p)) + error ("static or type qualifiers in abstract declarator"); return decl; } -/* Set the type of an array declarator. DECL is the declarator, as - constructed by build_array_declarator; TYPE is what appears on the left - of the [] and goes in operand 0. ABSTRACT_P is nonzero if it is an - abstract declarator, zero otherwise; this is used to reject static and - type qualifiers in abstract declarators, where they are not in the - C99 grammar. */ +/* INIT is a constructor that forms DECL's initializer. If the final + element initializes a flexible array field, add the size of that + initializer to DECL's size. */ -tree -set_array_declarator_type (tree decl, tree type, int abstract_p) +static void +add_flexible_array_elts_to_size (tree decl, tree init) { - TREE_OPERAND (decl, 0) = type; - if (abstract_p && (TREE_TYPE (decl) != NULL_TREE || TREE_STATIC (decl))) - error ("static or type qualifiers in abstract declarator"); - return decl; + tree elt, type; + + if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init))) + return; + + elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init))->value; + type = TREE_TYPE (elt); + if (TREE_CODE (type) == ARRAY_TYPE + && TYPE_SIZE (type) == NULL_TREE + && TYPE_DOMAIN (type) != NULL_TREE + && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) == NULL_TREE) + { + complete_array_type (&type, elt, false); + DECL_SIZE (decl) + = size_binop (PLUS_EXPR, DECL_SIZE (decl), TYPE_SIZE (type)); + DECL_SIZE_UNIT (decl) + = size_binop (PLUS_EXPR, DECL_SIZE_UNIT (decl), TYPE_SIZE_UNIT (type)); + } } /* Decode a "typename", such as "int **", returning a ..._TYPE node. */ tree -groktypename (tree typename) +groktypename (struct c_type_name *type_name) { - tree specs, attrs; + tree type; + tree attrs = type_name->specs->attrs; - if (TREE_CODE (typename) != TREE_LIST) - return typename; + type_name->specs->attrs = NULL_TREE; - split_specs_attrs (TREE_PURPOSE (typename), &specs, &attrs); - - typename = grokdeclarator (TREE_VALUE (typename), specs, TYPENAME, 0, - NULL); + type = grokdeclarator (type_name->declarator, type_name->specs, TYPENAME, + false, NULL); /* Apply attributes. */ - decl_attributes (&typename, attrs, 0); + decl_attributes (&type, attrs, 0); - return typename; -} - -/* Return a PARM_DECL node for a given pair of specs and declarator. */ - -tree -groktypename_in_parm_context (tree typename) -{ - if (TREE_CODE (typename) != TREE_LIST) - return typename; - return grokdeclarator (TREE_VALUE (typename), - TREE_PURPOSE (typename), - PARM, 0, NULL); + return type; } /* Decode a declarator in an ordinary declaration or data definition. @@ -2523,7 +3155,8 @@ groktypename_in_parm_context (tree typename) grokfield and not through here. */ tree -start_decl (tree declarator, tree declspecs, int initialized, tree attributes) +start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, + bool initialized, tree attributes) { tree decl; tree tem; @@ -2535,44 +3168,43 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, NULL); + if (!decl) + return 0; deprecated_state = DEPRECATED_NORMAL; if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL && MAIN_NAME_P (DECL_NAME (decl))) - warning ("%J'%D' is usually a function", decl, decl); + warning (OPT_Wmain, "%q+D is usually a function", decl); if (initialized) /* Is it valid for this decl to have an initializer at all? If not, set INITIALIZED to zero, which will indirectly - tell `finish_decl' to ignore the initializer once it is parsed. */ + tell 'finish_decl' to ignore the initializer once it is parsed. */ switch (TREE_CODE (decl)) { case TYPE_DECL: - error ("typedef `%s' is initialized (use __typeof__ instead)", - IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("typedef %qD is initialized (use __typeof__ instead)", decl); initialized = 0; break; case FUNCTION_DECL: - error ("function `%s' is initialized like a variable", - IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("function %qD is initialized like a variable", decl); initialized = 0; break; case PARM_DECL: /* DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE. */ - error ("parameter `%s' is initialized", - IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("parameter %qD is initialized", decl); initialized = 0; break; default: - /* Don't allow initializations for incomplete types - except for arrays which might be completed by the initialization. */ + /* Don't allow initializations for incomplete types except for + arrays which might be completed by the initialization. */ - /* This can happen if the array size is an undefined macro. We already - gave a warning, so we don't need another one. */ + /* This can happen if the array size is an undefined macro. + We already gave a warning, so we don't need another one. */ if (TREE_TYPE (decl) == error_mark_node) initialized = 0; else if (COMPLETE_TYPE_P (TREE_TYPE (decl))) @@ -2588,27 +3220,28 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) } else if (TREE_CODE (TREE_TYPE (decl)) != ARRAY_TYPE) { - error ("variable `%s' has initializer but incomplete type", - IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("variable %qD has initializer but incomplete type", decl); initialized = 0; } - else if (!COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))) + else if (C_DECL_VARIABLE_SIZE (decl)) { - error ("elements of array `%s' have incomplete type", - IDENTIFIER_POINTER (DECL_NAME (decl))); + /* Although C99 is unclear about whether incomplete arrays + of VLAs themselves count as VLAs, it does not make + sense to permit them to be initialized given that + ordinary VLAs may not be initialized. */ + error ("variable-sized object may not be initialized"); initialized = 0; } } if (initialized) { - DECL_EXTERNAL (decl) = 0; - if (current_scope == global_scope) + if (current_scope == file_scope) TREE_STATIC (decl) = 1; - /* Tell `pushdecl' this is an initialized decl + /* Tell 'pushdecl' this is an initialized decl even though we don't yet have the initializer expression. - Also tell `finish_decl' it may store the real initializer. */ + Also tell 'finish_decl' it may store the real initializer. */ DECL_INITIAL (decl) = error_mark_node; } @@ -2632,7 +3265,7 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) if (TREE_CODE (decl) == VAR_DECL && !initialized && TREE_PUBLIC (decl) - && !DECL_THREAD_LOCAL (decl) + && !DECL_THREAD_LOCAL_P (decl) && !flag_no_common) DECL_COMMON (decl) = 1; @@ -2642,17 +3275,17 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) if (TREE_CODE (decl) == FUNCTION_DECL && targetm.calls.promote_prototypes (TREE_TYPE (decl))) { - tree ce = declarator; + struct c_declarator *ce = declarator; - if (TREE_CODE (ce) == INDIRECT_REF) - ce = TREE_OPERAND (declarator, 0); - if (TREE_CODE (ce) == CALL_EXPR) + if (ce->kind == cdk_pointer) + ce = declarator->declarator; + if (ce->kind == cdk_function) { - tree args = TREE_PURPOSE (TREE_OPERAND (ce, 1)); + tree args = ce->u.arg_info->parms; for (; args; args = TREE_CHAIN (args)) { tree type = TREE_TYPE (args); - if (INTEGRAL_TYPE_P (type) + if (type && INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) DECL_ARG_TYPE (args) = integer_type_node; } @@ -2663,30 +3296,39 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) && DECL_DECLARED_INLINE_P (decl) && DECL_UNINLINABLE (decl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl))) - warning ("%Jinline function '%D' given attribute noinline", decl, decl); + warning (OPT_Wattributes, "inline function %q+D given attribute noinline", + decl); /* Add this decl to the current scope. TEM may equal DECL or it may be a previous decl of the same name. */ tem = pushdecl (decl); - /* For a local variable, define the RTL now. */ - if (current_scope != global_scope - /* But not if this is a duplicate decl - and we preserved the rtl from the previous one - (which may or may not happen). */ - && !DECL_RTL_SET_P (tem) - && DECL_FILE_SCOPE_P (tem)) + if (initialized && DECL_EXTERNAL (tem)) { - if (TREE_TYPE (tem) != error_mark_node - && (COMPLETE_TYPE_P (TREE_TYPE (tem)) - || (TREE_CODE (TREE_TYPE (tem)) == ARRAY_TYPE - && DECL_INITIAL (tem) != 0))) - expand_decl (tem); + DECL_EXTERNAL (tem) = 0; + TREE_STATIC (tem) = 1; } return tem; } +/* Initialize EH if not initialized yet and exceptions are enabled. */ + +void +c_maybe_initialize_eh (void) +{ + if (!flag_exceptions || c_eh_initialized_p) + return; + + c_eh_initialized_p = true; + eh_personality_libfunc + = init_one_libfunc (USING_SJLJ_EXCEPTIONS + ? "__gcc_personality_sj0" + : "__gcc_personality_v0"); + default_init_unwind_resume_libfunc (); + using_eh_for_cleanups (); +} + /* Finish processing of a declaration; install its initial value. If the length of an array type is not known before, @@ -2695,12 +3337,13 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes) void finish_decl (tree decl, tree init, tree asmspec_tree) { - tree type = TREE_TYPE (decl); + tree type; int was_incomplete = (DECL_SIZE (decl) == 0); const char *asmspec = 0; /* If a name was specified, get the string. */ - if (current_scope == global_scope) + if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL) + && DECL_FILE_SCOPE_P (decl)) asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree); if (asmspec_tree) asmspec = TREE_STRING_POINTER (asmspec_tree); @@ -2717,56 +3360,86 @@ finish_decl (tree decl, tree init, tree asmspec_tree) store_init_value (decl, init); if (c_dialect_objc () && (TREE_CODE (decl) == VAR_DECL - || TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == FIELD_DECL)) + || TREE_CODE (decl) == FUNCTION_DECL + || TREE_CODE (decl) == FIELD_DECL)) objc_check_decl (decl); + type = TREE_TYPE (decl); + /* Deduce size of array from initialization, if not already known. */ if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == 0 && TREE_CODE (decl) != TYPE_DECL) { - int do_default + bool do_default = (TREE_STATIC (decl) /* Even if pedantic, an external linkage array may have incomplete type at first. */ ? pedantic && !TREE_PUBLIC (decl) : !DECL_EXTERNAL (decl)); int failure - = complete_array_type (type, DECL_INITIAL (decl), do_default); + = complete_array_type (&TREE_TYPE (decl), DECL_INITIAL (decl), + do_default); /* Get the completed type made by complete_array_type. */ type = TREE_TYPE (decl); - if (failure == 1) - error ("%Jinitializer fails to determine size of '%D'", decl, decl); - - else if (failure == 2) + switch (failure) { + case 1: + error ("initializer fails to determine size of %q+D", decl); + break; + + case 2: if (do_default) - error ("%Jarray size missing in '%D'", decl, decl); + error ("array size missing in %q+D", decl); /* If a `static' var's size isn't known, make it extern as well as static, so it does not get allocated. If it is not `static', then do not mark extern; finish_incomplete_decl will give it a default size and it will get allocated. */ - else if (!pedantic && TREE_STATIC (decl) && ! TREE_PUBLIC (decl)) + else if (!pedantic && TREE_STATIC (decl) && !TREE_PUBLIC (decl)) DECL_EXTERNAL (decl) = 1; + break; + + case 3: + error ("zero or negative size array %q+D", decl); + break; + + case 0: + /* For global variables, update the copy of the type that + exists in the binding. */ + if (TREE_PUBLIC (decl)) + { + struct c_binding *b_ext = I_SYMBOL_BINDING (DECL_NAME (decl)); + while (b_ext && !B_IN_EXTERNAL_SCOPE (b_ext)) + b_ext = b_ext->shadowed; + if (b_ext) + { + if (b_ext->type) + b_ext->type = composite_type (b_ext->type, type); + else + b_ext->type = type; + } + } + break; + + default: + gcc_unreachable (); } - /* TYPE_MAX_VALUE is always one less than the number of elements - in the array, because we start counting at zero. Therefore, - warn only if the value is less than zero. */ - else if (pedantic && TYPE_DOMAIN (type) != 0 - && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0) - error ("%Jzero or negative size array '%D'", decl, decl); + if (DECL_INITIAL (decl)) + TREE_TYPE (DECL_INITIAL (decl)) = type; layout_decl (decl, 0); } if (TREE_CODE (decl) == VAR_DECL) { + if (init && TREE_CODE (init) == CONSTRUCTOR) + add_flexible_array_elts_to_size (decl, init); + if (DECL_SIZE (decl) == 0 && TREE_TYPE (decl) != error_mark_node && COMPLETE_TYPE_P (TREE_TYPE (decl))) layout_decl (decl, 0); @@ -2775,22 +3448,20 @@ finish_decl (tree decl, tree init, tree asmspec_tree) /* Don't give an error if we already gave one earlier. */ && TREE_TYPE (decl) != error_mark_node && (TREE_STATIC (decl) - ? - /* A static variable with an incomplete type - is an error if it is initialized. - Also if it is not file scope. - Otherwise, let it through, but if it is not `extern' - then it may cause an error message later. */ - (DECL_INITIAL (decl) != 0 + /* A static variable with an incomplete type + is an error if it is initialized. + Also if it is not file scope. + Otherwise, let it through, but if it is not `extern' + then it may cause an error message later. */ + ? (DECL_INITIAL (decl) != 0 || !DECL_FILE_SCOPE_P (decl)) - : - /* An automatic variable with an incomplete type - is an error. */ - !DECL_EXTERNAL (decl))) - { - error ("%Jstorage size of '%D' isn't known", decl, decl); - TREE_TYPE (decl) = error_mark_node; - } + /* An automatic variable with an incomplete type + is an error. */ + : !DECL_EXTERNAL (decl))) + { + error ("storage size of %q+D isn%'t known", decl); + TREE_TYPE (decl) = error_mark_node; + } if ((DECL_EXTERNAL (decl) || TREE_STATIC (decl)) && DECL_SIZE (decl) != 0) @@ -2798,7 +3469,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) constant_expression_warning (DECL_SIZE (decl)); else - error ("%Jstorage size of '%D' isn't constant", decl, decl); + error ("storage size of %q+D isn%'t constant", decl); } if (TREE_USED (type)) @@ -2810,36 +3481,13 @@ finish_decl (tree decl, tree init, tree asmspec_tree) was a normal built-in. */ if (TREE_CODE (decl) == FUNCTION_DECL && asmspec) { - /* ASMSPEC is given, and not the name of a register. Mark the - name with a star so assemble_name won't munge it. */ - char *starred = alloca (strlen (asmspec) + 2); - starred[0] = '*'; - strcpy (starred + 1, asmspec); - if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) - { - tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)]; - SET_DECL_RTL (builtin, NULL_RTX); - SET_DECL_ASSEMBLER_NAME (builtin, get_identifier (starred)); -#ifdef TARGET_MEM_FUNCTIONS - if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY) - init_block_move_fn (starred); - else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET) - init_block_clear_fn (starred); -#else - if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BCOPY) - init_block_move_fn (starred); - else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_BZERO) - init_block_clear_fn (starred); -#endif - } - SET_DECL_RTL (decl, NULL_RTX); - change_decl_assembler_name (decl, get_identifier (starred)); + set_builtin_user_assembler_name (decl, asmspec); + set_user_assembler_name (decl, asmspec); } /* If #pragma weak was used, mark the decl weak now. */ - if (current_scope == global_scope) - maybe_apply_pragma_weak (decl); + maybe_apply_pragma_weak (decl); /* Output the assembler code and/or RTL code for variables and functions, unless the type is an undefined structure or union. @@ -2847,10 +3495,31 @@ finish_decl (tree decl, tree init, tree asmspec_tree) if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL) { + /* Determine the ELF visibility. */ + if (TREE_PUBLIC (decl)) + c_determine_visibility (decl); + /* This is a no-op in c-lang.c or something real in objc-act.c. */ if (c_dialect_objc ()) objc_check_decl (decl); + if (asmspec) + { + /* If this is not a static variable, issue a warning. + It doesn't make any sense to give an ASMSPEC for an + ordinary, non-register local variable. Historically, + GCC has accepted -- but ignored -- the ASMSPEC in + this case. */ + if (!DECL_FILE_SCOPE_P (decl) + && TREE_CODE (decl) == VAR_DECL + && !C_DECL_REGISTER (decl) + && !TREE_STATIC (decl)) + warning (0, "ignoring asm-specifier for non-static local " + "variable %q+D", decl); + else + set_user_assembler_name (decl, asmspec); + } + if (DECL_FILE_SCOPE_P (decl)) { if (DECL_INITIAL (decl) == NULL_TREE @@ -2859,44 +3528,51 @@ finish_decl (tree decl, tree init, tree asmspec_tree) when a tentative file-scope definition is seen. But at end of compilation, do output code for them. */ DECL_DEFER_OUTPUT (decl) = 1; - rest_of_decl_compilation (decl, asmspec, true, 0); + rest_of_decl_compilation (decl, true, 0); } else { - /* This is a local variable. If there is an ASMSPEC, the - user has requested that we handle it specially. */ - if (asmspec) + /* In conjunction with an ASMSPEC, the `register' + keyword indicates that we should place the variable + in a particular register. */ + if (asmspec && C_DECL_REGISTER (decl)) { - /* In conjunction with an ASMSPEC, the `register' - keyword indicates that we should place the variable - in a particular register. */ - if (DECL_REGISTER (decl)) - DECL_C_HARD_REGISTER (decl) = 1; - - /* If this is not a static variable, issue a warning. - It doesn't make any sense to give an ASMSPEC for an - ordinary, non-register local variable. Historically, - GCC has accepted -- but ignored -- the ASMSPEC in - this case. */ - if (TREE_CODE (decl) == VAR_DECL - && !DECL_REGISTER (decl) - && !TREE_STATIC (decl)) - warning ("%Jignoring asm-specifier for non-static local " - "variable '%D'", decl, decl); - else - change_decl_assembler_name (decl, get_identifier (asmspec)); + DECL_HARD_REGISTER (decl) = 1; + /* This cannot be done for a structure with volatile + fields, on which DECL_REGISTER will have been + reset. */ + if (!DECL_REGISTER (decl)) + error ("cannot put object with volatile field into register"); } if (TREE_CODE (decl) != FUNCTION_DECL) - add_decl_stmt (decl); + { + /* If we're building a variable sized type, and we might be + reachable other than via the top of the current binding + level, then create a new BIND_EXPR so that we deallocate + the object at the right time. */ + /* Note that DECL_SIZE can be null due to errors. */ + if (DECL_SIZE (decl) + && !TREE_CONSTANT (DECL_SIZE (decl)) + && STATEMENT_LIST_HAS_LABEL (cur_stmt_list)) + { + tree bind; + bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL); + TREE_SIDE_EFFECTS (bind) = 1; + add_stmt (bind); + BIND_EXPR_BODY (bind) = push_stmt_list (); + } + add_stmt (build_stmt (DECL_EXPR, decl)); + } } + if (!DECL_FILE_SCOPE_P (decl)) { /* Recompute the RTL of a local array now if it used to be an incomplete type. */ if (was_incomplete - && ! TREE_STATIC (decl) && ! DECL_EXTERNAL (decl)) + && !TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) { /* If we used it already as memory, it must stay in memory. */ TREE_ADDRESSABLE (decl) = TREE_USED (decl); @@ -2908,16 +3584,22 @@ finish_decl (tree decl, tree init, tree asmspec_tree) } /* If this was marked 'used', be sure it will be output. */ - if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) - mark_referenced (DECL_ASSEMBLER_NAME (decl)); + if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + mark_decl_referenced (decl); if (TREE_CODE (decl) == TYPE_DECL) - rest_of_decl_compilation (decl, NULL, DECL_FILE_SCOPE_P (decl), 0); + { + if (!DECL_FILE_SCOPE_P (decl) + && variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)) + add_stmt (build_stmt (DECL_EXPR, decl)); + + rest_of_decl_compilation (decl, DECL_FILE_SCOPE_P (decl), 0); + } /* At the end of a declaration, throw away any variable type sizes of types defined inside that declaration. There is no use computing them in the following function definition. */ - if (current_scope == global_scope) + if (current_scope == file_scope) get_pending_sizes (); /* Install a cleanup (aka destructor) if one was given. */ @@ -2926,8 +3608,6 @@ finish_decl (tree decl, tree init, tree asmspec_tree) tree attr = lookup_attribute ("cleanup", DECL_ATTRIBUTES (decl)); if (attr) { - static bool eh_initialized_p; - tree cleanup_id = TREE_VALUE (TREE_VALUE (attr)); tree cleanup_decl = lookup_name (cleanup_id); tree cleanup; @@ -2939,67 +3619,52 @@ finish_decl (tree decl, tree init, tree asmspec_tree) /* Don't warn about decl unused; the cleanup uses it. */ TREE_USED (decl) = 1; + TREE_USED (cleanup_decl) = 1; /* Initialize EH, if we've been told to do so. */ - if (flag_exceptions && !eh_initialized_p) - { - eh_initialized_p = true; - eh_personality_libfunc - = init_one_libfunc (USING_SJLJ_EXCEPTIONS - ? "__gcc_personality_sj0" - : "__gcc_personality_v0"); - using_eh_for_cleanups (); - } + c_maybe_initialize_eh (); - add_stmt (build_stmt (CLEANUP_STMT, decl, cleanup)); + push_cleanup (decl, cleanup, false); } } } +/* Given a parsed parameter declaration, decode it into a PARM_DECL. */ + +tree +grokparm (const struct c_parm *parm) +{ + tree decl = grokdeclarator (parm->declarator, parm->specs, PARM, false, + NULL); + + decl_attributes (&decl, parm->attrs, 0); + + return decl; +} + /* Given a parsed parameter declaration, decode it into a PARM_DECL and push that on the current scope. */ void -push_parm_decl (tree parm) +push_parm_decl (const struct c_parm *parm) { tree decl; - int old_dont_save_pending_sizes_p = 0; - /* Don't attempt to expand sizes while parsing this decl. - (We can get here with i_s_e 1 somehow from Objective-C.) */ - int save_immediate_size_expand = immediate_size_expand; - immediate_size_expand = 0; - - /* If this is a nested function, we do want to keep SAVE_EXPRs for - the argument sizes, regardless of the parent's setting. */ - if (cfun) - { - old_dont_save_pending_sizes_p = cfun->x_dont_save_pending_sizes_p; - cfun->x_dont_save_pending_sizes_p = 0; - } - - decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)), - TREE_PURPOSE (TREE_PURPOSE (parm)), - PARM, 0, NULL); - decl_attributes (&decl, TREE_VALUE (parm), 0); + decl = grokdeclarator (parm->declarator, parm->specs, PARM, false, NULL); + decl_attributes (&decl, parm->attrs, 0); decl = pushdecl (decl); finish_decl (decl, NULL_TREE, NULL_TREE); - - if (cfun) - cfun->x_dont_save_pending_sizes_p = old_dont_save_pending_sizes_p; - immediate_size_expand = save_immediate_size_expand; } -/* Mark all the parameter declarations to date as forward decls, - shift them to the variables list, and reset the parameters list. +/* Mark all the parameter declarations to date as forward decls. Also diagnose use of this extension. */ void mark_forward_parm_decls (void) { - tree parm; + struct c_binding *b; if (pedantic && !current_scope->warned_forward_parm_decls) { @@ -3007,16 +3672,11 @@ mark_forward_parm_decls (void) current_scope->warned_forward_parm_decls = true; } - for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm)) - TREE_ASM_WRITTEN (parm) = 1; - - SCOPE_LIST_CONCAT (current_scope, names, current_scope, parms); - current_scope->parms = 0; - current_scope->parms_last = 0; + for (b = current_scope->bindings; b; b = b->prev) + if (TREE_CODE (b->decl) == PARM_DECL) + TREE_ASM_WRITTEN (b->decl) = 1; } -static GTY(()) int compound_literal_number; - /* Build a COMPOUND_LITERAL_EXPR. TYPE is the type given in the compound literal, which may be an incomplete array type completed by the initializer; INIT is a CONSTRUCTOR that initializes the compound @@ -3027,123 +3687,58 @@ build_compound_literal (tree type, tree init) { /* We do not use start_decl here because we have a type, not a declarator; and do not use finish_decl because the decl should be stored inside - the COMPOUND_LITERAL_EXPR rather than added elsewhere as a DECL_STMT. */ - tree decl = build_decl (VAR_DECL, NULL_TREE, type); + the COMPOUND_LITERAL_EXPR rather than added elsewhere as a DECL_EXPR. */ + tree decl; tree complit; tree stmt; + + if (type == error_mark_node) + return error_mark_node; + + decl = build_decl (VAR_DECL, NULL_TREE, type); DECL_EXTERNAL (decl) = 0; TREE_PUBLIC (decl) = 0; - TREE_STATIC (decl) = (current_scope == global_scope); + TREE_STATIC (decl) = (current_scope == file_scope); DECL_CONTEXT (decl) = current_function_decl; TREE_USED (decl) = 1; TREE_TYPE (decl) = type; - TREE_READONLY (decl) = TREE_READONLY (type); + TREE_READONLY (decl) = TYPE_READONLY (type); store_init_value (decl, init); if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type)) { - int failure = complete_array_type (type, DECL_INITIAL (decl), 1); - if (failure) - abort (); + int failure = complete_array_type (&TREE_TYPE (decl), + DECL_INITIAL (decl), true); + gcc_assert (!failure); + + type = TREE_TYPE (decl); + TREE_TYPE (DECL_INITIAL (decl)) = type; } - type = TREE_TYPE (decl); if (type == error_mark_node || !COMPLETE_TYPE_P (type)) return error_mark_node; - stmt = build_stmt (DECL_STMT, decl); - complit = build1 (COMPOUND_LITERAL_EXPR, TREE_TYPE (decl), stmt); + stmt = build_stmt (DECL_EXPR, decl); + complit = build1 (COMPOUND_LITERAL_EXPR, type, stmt); TREE_SIDE_EFFECTS (complit) = 1; layout_decl (decl, 0); if (TREE_STATIC (decl)) { - /* This decl needs a name for the assembler output. We also need - a unique suffix to be added to the name. */ - char *name; - - ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal", - compound_literal_number); - compound_literal_number++; - DECL_NAME (decl) = get_identifier (name); + /* This decl needs a name for the assembler output. */ + set_compound_literal_name (decl); DECL_DEFER_OUTPUT (decl) = 1; DECL_COMDAT (decl) = 1; DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; pushdecl (decl); - rest_of_decl_compilation (decl, NULL, 1, 0); + rest_of_decl_compilation (decl, 1, 0); } return complit; } -/* Make TYPE a complete type based on INITIAL_VALUE. - Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, - 2 if there was no information (in which case assume 1 if DO_DEFAULT). */ - -int -complete_array_type (tree type, tree initial_value, int do_default) -{ - tree maxindex = NULL_TREE; - int value = 0; - - if (initial_value) - { - /* Note MAXINDEX is really the maximum index, - one less than the size. */ - if (TREE_CODE (initial_value) == STRING_CST) - { - int eltsize - = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); - maxindex = build_int_2 ((TREE_STRING_LENGTH (initial_value) - / eltsize) - 1, 0); - } - else if (TREE_CODE (initial_value) == CONSTRUCTOR) - { - tree elts = CONSTRUCTOR_ELTS (initial_value); - maxindex = build_int_2 (-1, -1); - for (; elts; elts = TREE_CHAIN (elts)) - { - if (TREE_PURPOSE (elts)) - maxindex = TREE_PURPOSE (elts); - else - maxindex = fold (build (PLUS_EXPR, integer_type_node, - maxindex, integer_one_node)); - } - maxindex = copy_node (maxindex); - } - else - { - /* Make an error message unless that happened already. */ - if (initial_value != error_mark_node) - value = 1; - - /* Prevent further error messages. */ - maxindex = build_int_2 (0, 0); - } - } - - if (!maxindex) - { - if (do_default) - maxindex = build_int_2 (0, 0); - value = 2; - } - - if (maxindex) - { - TYPE_DOMAIN (type) = build_index_type (maxindex); - if (!TREE_TYPE (maxindex)) - TREE_TYPE (maxindex) = TYPE_DOMAIN (type); - } - - /* Lay out the type now that we can get the real answer. */ - - layout_type (type); - - return value; -} - /* Determine whether TYPE is a structure with a flexible array member, or a union containing such a structure (possibly recursively). */ @@ -3187,14 +3782,12 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) unsigned HOST_WIDE_INT w; const char *name = orig_name ? orig_name: _(""); - /* Necessary? */ - STRIP_NOPS (*width); - /* Detect and ignore out of range field width and process valid field widths. */ - if (TREE_CODE (*width) != INTEGER_CST) + if (!INTEGRAL_TYPE_P (TREE_TYPE (*width)) + || TREE_CODE (*width) != INTEGER_CST) { - error ("bit-field `%s' width not an integer constant", name); + error ("bit-field %qs width not an integer constant", name); *width = integer_one_node; } else @@ -3202,12 +3795,12 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) constant_expression_warning (*width); if (tree_int_cst_sgn (*width) < 0) { - error ("negative width in bit-field `%s'", name); + error ("negative width in bit-field %qs", name); *width = integer_one_node; } else if (integer_zerop (*width) && orig_name) { - error ("zero width for bit-field `%s'", name); + error ("zero width for bit-field %qs", name); *width = integer_one_node; } } @@ -3217,16 +3810,17 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) && TREE_CODE (*type) != BOOLEAN_TYPE && TREE_CODE (*type) != ENUMERAL_TYPE) { - error ("bit-field `%s' has invalid type", name); + error ("bit-field %qs has invalid type", name); *type = unsigned_type_node; } type_mv = TYPE_MAIN_VARIANT (*type); if (pedantic + && !in_system_header && type_mv != integer_type_node && type_mv != unsigned_type_node && type_mv != boolean_type_node) - pedwarn ("type of bit-field `%s' is a GCC extension", name); + pedwarn ("type of bit-field %qs is a GCC extension", name); if (type_mv == boolean_type_node) max_width = CHAR_TYPE_SIZE; @@ -3235,18 +3829,23 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) if (0 < compare_tree_int (*width, max_width)) { - error ("width of `%s' exceeds its type", name); + error ("width of %qs exceeds its type", name); w = max_width; - *width = build_int_2 (w, 0); + *width = build_int_cst (NULL_TREE, w); } else w = tree_low_cst (*width, 1); - if (TREE_CODE (*type) == ENUMERAL_TYPE - && (w < min_precision (TYPE_MIN_VALUE (*type), TREE_UNSIGNED (*type)) - || w < min_precision (TYPE_MAX_VALUE (*type), TREE_UNSIGNED (*type)))) - warning ("`%s' is narrower than values of its type", name); + if (TREE_CODE (*type) == ENUMERAL_TYPE) + { + struct lang_type *lt = TYPE_LANG_SPECIFIC (*type); + if (!lt + || w < min_precision (lt->enum_min, TYPE_UNSIGNED (*type)) + || w < min_precision (lt->enum_max, TYPE_UNSIGNED (*type))) + warning (0, "%qs is narrower than values of its type", name); + } } + /* Given declspecs and a declarator, determine the name and type of the object declared @@ -3254,8 +3853,7 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) (In one case we can return a ..._TYPE node instead. For invalid input we sometimes return 0.) - DECLSPECS is a chain of tree_list nodes whose value fields - are the storage classes and type specifiers. + DECLSPECS is a c_declspecs structure for the declaration specifiers. DECL_CONTEXT says which syntactic context this declaration is in: NORMAL for most contexts. Make a VAR_DECL or FUNCTION_DECL or TYPE_DECL. @@ -3267,7 +3865,7 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) TYPENAME if for a typename (in a cast or sizeof). Don't make a DECL node; just return the ..._TYPE node. FIELD for a struct or union field; make a FIELD_DECL. - INITIALIZED is 1 if the decl has an initializer. + INITIALIZED is true if the decl has an initializer. WIDTH is non-NULL for bit-fields, and is a pointer to an INTEGER_CST node representing the width of the bit-field. @@ -3279,64 +3877,63 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) and `extern' are interpreted. */ static tree -grokdeclarator (tree declarator, tree declspecs, - enum decl_context decl_context, int initialized, tree *width) +grokdeclarator (const struct c_declarator *declarator, + struct c_declspecs *declspecs, + enum decl_context decl_context, bool initialized, tree *width) { - int specbits = 0; - tree spec; - tree type = NULL_TREE; - int longlong = 0; + tree type = declspecs->type; + bool threadp = declspecs->thread_p; + enum c_storage_class storage_class = declspecs->storage_class; int constp; int restrictp; int volatilep; int type_quals = TYPE_UNQUALIFIED; - int inlinep; - int explicit_int = 0; - int explicit_char = 0; - int defaulted_int = 0; - tree typedef_decl = 0; const char *name, *orig_name; tree typedef_type = 0; - int funcdef_flag = 0; - enum tree_code innermost_code = ERROR_MARK; + bool funcdef_flag = false; + bool funcdef_syntax = false; int size_varies = 0; - tree decl_attr = NULL_TREE; - tree array_ptr_quals = NULL_TREE; + tree decl_attr = declspecs->decl_attr; + int array_ptr_quals = TYPE_UNQUALIFIED; + tree array_ptr_attrs = NULL_TREE; int array_parm_static = 0; + bool array_parm_vla_unspec_p = false; tree returned_attrs = NULL_TREE; bool bitfield = width != NULL; tree element_type; + struct c_arg_info *arg_info = 0; if (decl_context == FUNCDEF) - funcdef_flag = 1, decl_context = NORMAL; + funcdef_flag = true, decl_context = NORMAL; /* Look inside a declarator for the name being declared and get it as a string, for an error message. */ { - tree decl = declarator; + const struct c_declarator *decl = declarator; name = 0; while (decl) - switch (TREE_CODE (decl)) + switch (decl->kind) { - case ARRAY_REF: - case INDIRECT_REF: - case CALL_EXPR: - innermost_code = TREE_CODE (decl); - decl = TREE_OPERAND (decl, 0); + case cdk_function: + case cdk_array: + case cdk_pointer: + funcdef_syntax = (decl->kind == cdk_function); + decl = decl->declarator; break; - case TREE_LIST: - decl = TREE_VALUE (decl); + case cdk_attrs: + decl = decl->declarator; break; - case IDENTIFIER_NODE: - name = IDENTIFIER_POINTER (decl); + case cdk_id: + if (decl->u.id) + name = IDENTIFIER_POINTER (decl->u.id); decl = 0; break; default: - abort (); + gcc_unreachable (); } orig_name = name; if (name == 0) @@ -3346,302 +3943,49 @@ grokdeclarator (tree declarator, tree declspecs, /* A function definition's declarator must have the form of a function declarator. */ - if (funcdef_flag && innermost_code != CALL_EXPR) + if (funcdef_flag && !funcdef_syntax) return 0; /* If this looks like a function definition, make it one, even if it occurs where parms are expected. Then store_parm_decls will reject it and not use it as a parm. */ - if (decl_context == NORMAL && !funcdef_flag - && current_scope->parm_flag) + if (decl_context == NORMAL && !funcdef_flag && current_scope->parm_flag) decl_context = PARM; - /* Look through the decl specs and record which ones appear. - Some typespecs are defined as built-in typenames. - Others, the ones that are modifiers of other types, - are represented by bits in SPECBITS: set the bits for - the modifiers that appear. Storage class keywords are also in SPECBITS. + if (declspecs->deprecated_p && deprecated_state != DEPRECATED_SUPPRESS) + warn_deprecated_use (declspecs->type); - If there is a typedef name or a type, store the type in TYPE. - This includes builtin typedefs such as `int'. - - Set EXPLICIT_INT or EXPLICIT_CHAR if the type is `int' or `char' - and did not come from a user typedef. - - Set LONGLONG if `long' is mentioned twice. */ - - for (spec = declspecs; spec; spec = TREE_CHAIN (spec)) + if ((decl_context == NORMAL || decl_context == FIELD) + && current_scope == file_scope + && variably_modified_type_p (type, NULL_TREE)) { - tree id = TREE_VALUE (spec); - - /* If the entire declaration is itself tagged as deprecated then - suppress reports of deprecated items. */ - if (id && TREE_DEPRECATED (id)) - { - if (deprecated_state != DEPRECATED_SUPPRESS) - warn_deprecated_use (id); - } - - if (id == ridpointers[(int) RID_INT]) - explicit_int = 1; - if (id == ridpointers[(int) RID_CHAR]) - explicit_char = 1; - - if (TREE_CODE (id) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (id)) - { - enum rid i = C_RID_CODE (id); - if ((int) i <= (int) RID_LAST_MODIFIER) - { - if (i == RID_LONG && (specbits & (1 << (int) RID_LONG))) - { - if (longlong) - error ("`long long long' is too long for GCC"); - else - { - if (pedantic && !flag_isoc99 && ! in_system_header - && warn_long_long) - pedwarn ("ISO C90 does not support `long long'"); - longlong = 1; - } - } - else if (specbits & (1 << (int) i)) - { - if (i == RID_CONST || i == RID_VOLATILE || i == RID_RESTRICT) - { - if (pedantic && !flag_isoc99) - pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id)); - } - else - error ("duplicate `%s'", IDENTIFIER_POINTER (id)); - } - - /* Diagnose "__thread extern". Recall that this list - is in the reverse order seen in the text. */ - if (i == RID_THREAD - && (specbits & (1 << (int) RID_EXTERN - | 1 << (int) RID_STATIC))) - { - if (specbits & 1 << (int) RID_EXTERN) - error ("`__thread' before `extern'"); - else - error ("`__thread' before `static'"); - } - - specbits |= 1 << (int) i; - goto found; - } - } - if (type) - error ("two or more data types in declaration of `%s'", name); - /* Actual typedefs come to us as TYPE_DECL nodes. */ - else if (TREE_CODE (id) == TYPE_DECL) - { - if (TREE_TYPE (id) == error_mark_node) - ; /* Allow the type to default to int to avoid cascading errors. */ - else - { - type = TREE_TYPE (id); - decl_attr = DECL_ATTRIBUTES (id); - typedef_decl = id; - } - } - /* Built-in types come as identifiers. */ - else if (TREE_CODE (id) == IDENTIFIER_NODE) - { - tree t = lookup_name (id); - if (TREE_TYPE (t) == error_mark_node) - ; - else if (!t || TREE_CODE (t) != TYPE_DECL) - error ("`%s' fails to be a typedef or built in type", - IDENTIFIER_POINTER (id)); - else - { - type = TREE_TYPE (t); - typedef_decl = t; - } - } - else if (TREE_CODE (id) != ERROR_MARK) - type = id; - - found: - ; - } - - typedef_type = type; - if (type) - size_varies = C_TYPE_VARIABLE_SIZE (type); - - /* No type at all: default to `int', and set DEFAULTED_INT - because it was not a user-defined typedef. */ - - if (type == 0) - { - if ((! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT) - | (1 << (int) RID_SIGNED) - | (1 << (int) RID_UNSIGNED) - | (1 << (int) RID_COMPLEX)))) - /* Don't warn about typedef foo = bar. */ - && ! (specbits & (1 << (int) RID_TYPEDEF) && initialized) - && ! in_system_header) - { - /* Issue a warning if this is an ISO C 99 program or if -Wreturn-type - and this is a function, or if -Wimplicit; prefer the former - warning since it is more explicit. */ - if ((warn_implicit_int || warn_return_type || flag_isoc99) - && funcdef_flag) - warn_about_return_type = 1; - else if (warn_implicit_int || flag_isoc99) - pedwarn_c99 ("type defaults to `int' in declaration of `%s'", - name); - } - - defaulted_int = 1; + error ("variably modified %qs at file scope", name); type = integer_type_node; } - /* Now process the modifiers that were specified - and check for invalid combinations. */ + typedef_type = type; + size_varies = C_TYPE_VARIABLE_SIZE (type); - /* Long double is a special combination. */ + /* Diagnose defaulting to "int". */ - if ((specbits & 1 << (int) RID_LONG) && ! longlong - && TYPE_MAIN_VARIANT (type) == double_type_node) + if (declspecs->default_int_p && !in_system_header) { - specbits &= ~(1 << (int) RID_LONG); - type = long_double_type_node; + /* Issue a warning if this is an ISO C 99 program or if + -Wreturn-type and this is a function, or if -Wimplicit; + prefer the former warning since it is more explicit. */ + if ((warn_implicit_int || warn_return_type || flag_isoc99) + && funcdef_flag) + warn_about_return_type = 1; + else if (warn_implicit_int || flag_isoc99) + pedwarn_c99 ("type defaults to % in declaration of %qs", name); } - /* Check all other uses of type modifiers. */ - - if (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT) - | (1 << (int) RID_UNSIGNED) | (1 << (int) RID_SIGNED))) - { - int ok = 0; - - if ((specbits & 1 << (int) RID_LONG) - && (specbits & 1 << (int) RID_SHORT)) - error ("both long and short specified for `%s'", name); - else if (((specbits & 1 << (int) RID_LONG) - || (specbits & 1 << (int) RID_SHORT)) - && explicit_char) - error ("long or short specified with char for `%s'", name); - else if (((specbits & 1 << (int) RID_LONG) - || (specbits & 1 << (int) RID_SHORT)) - && TREE_CODE (type) == REAL_TYPE) - { - static int already = 0; - - error ("long or short specified with floating type for `%s'", name); - if (! already && ! pedantic) - { - error ("the only valid combination is `long double'"); - already = 1; - } - } - else if ((specbits & 1 << (int) RID_SIGNED) - && (specbits & 1 << (int) RID_UNSIGNED)) - error ("both signed and unsigned specified for `%s'", name); - else if (TREE_CODE (type) != INTEGER_TYPE) - error ("long, short, signed or unsigned invalid for `%s'", name); - else - { - ok = 1; - if (!explicit_int && !defaulted_int && !explicit_char) - { - error ("long, short, signed or unsigned used invalidly for `%s'", - name); - ok = 0; - } - } - - /* Discard the type modifiers if they are invalid. */ - if (! ok) - { - specbits &= ~((1 << (int) RID_LONG) | (1 << (int) RID_SHORT) - | (1 << (int) RID_UNSIGNED) | (1 << (int) RID_SIGNED)); - longlong = 0; - } - } - - if ((specbits & (1 << (int) RID_COMPLEX)) - && TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE) - { - error ("complex invalid for `%s'", name); - specbits &= ~(1 << (int) RID_COMPLEX); - } - - /* Decide whether an integer type is signed or not. - Optionally treat bit-fields as signed by default. */ - if (specbits & 1 << (int) RID_UNSIGNED - || (bitfield && ! flag_signed_bitfields - && (explicit_int || defaulted_int || explicit_char - /* A typedef for plain `int' without `signed' - can be controlled just like plain `int'. */ - || ! (typedef_decl != 0 - && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl))) - && TREE_CODE (type) != ENUMERAL_TYPE - && !(specbits & 1 << (int) RID_SIGNED))) - { - if (longlong) - type = long_long_unsigned_type_node; - else if (specbits & 1 << (int) RID_LONG) - type = long_unsigned_type_node; - else if (specbits & 1 << (int) RID_SHORT) - type = short_unsigned_type_node; - else if (type == char_type_node) - type = unsigned_char_type_node; - else if (typedef_decl) - type = c_common_unsigned_type (type); - else - type = unsigned_type_node; - } - else if ((specbits & 1 << (int) RID_SIGNED) - && type == char_type_node) - type = signed_char_type_node; - else if (longlong) - type = long_long_integer_type_node; - else if (specbits & 1 << (int) RID_LONG) - type = long_integer_type_node; - else if (specbits & 1 << (int) RID_SHORT) - type = short_integer_type_node; - - if (specbits & 1 << (int) RID_COMPLEX) - { - if (pedantic && !flag_isoc99) - pedwarn ("ISO C90 does not support complex types"); - /* If we just have "complex", it is equivalent to - "complex double", but if any modifiers at all are specified it is - the complex form of TYPE. E.g, "complex short" is - "complex short int". */ - - if (defaulted_int && ! longlong - && ! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT) - | (1 << (int) RID_SIGNED) - | (1 << (int) RID_UNSIGNED)))) - { - if (pedantic) - pedwarn ("ISO C does not support plain `complex' meaning `double complex'"); - type = complex_double_type_node; - } - else if (type == integer_type_node) - { - if (pedantic) - pedwarn ("ISO C does not support complex integer types"); - type = complex_integer_type_node; - } - else if (type == float_type_node) - type = complex_float_type_node; - else if (type == double_type_node) - type = complex_double_type_node; - else if (type == long_double_type_node) - type = complex_long_double_type_node; - else - { - if (pedantic) - pedwarn ("ISO C does not support complex integer types"); - type = build_complex_type (type); - } - } + /* Adjust the type if a bit-field is being declared, + -funsigned-bitfields applied and the type is not explicitly + "signed". */ + if (bitfield && !flag_signed_bitfields && !declspecs->explicit_signed_p + && TREE_CODE (type) == INTEGER_TYPE) + type = c_common_unsigned_type (type); /* Figure out the type qualifiers for the declaration. There are two ways a declaration can become qualified. One is something @@ -3655,141 +3999,132 @@ grokdeclarator (tree declarator, tree declspecs, duplicate qualifiers should be diagnosed in this case, but it seems most appropriate to do so). */ element_type = strip_array_types (type); - constp = !! (specbits & 1 << (int) RID_CONST) + TYPE_READONLY (element_type); - restrictp - = !! (specbits & 1 << (int) RID_RESTRICT) + TYPE_RESTRICT (element_type); - volatilep - = !! (specbits & 1 << (int) RID_VOLATILE) + TYPE_VOLATILE (element_type); - inlinep = !! (specbits & (1 << (int) RID_INLINE)); + constp = declspecs->const_p + TYPE_READONLY (element_type); + restrictp = declspecs->restrict_p + TYPE_RESTRICT (element_type); + volatilep = declspecs->volatile_p + TYPE_VOLATILE (element_type); if (pedantic && !flag_isoc99) { if (constp > 1) - pedwarn ("duplicate `const'"); + pedwarn ("duplicate %"); if (restrictp > 1) - pedwarn ("duplicate `restrict'"); + pedwarn ("duplicate %"); if (volatilep > 1) - pedwarn ("duplicate `volatile'"); + pedwarn ("duplicate %"); } - if (! flag_gen_aux_info && (TYPE_QUALS (type))) + if (!flag_gen_aux_info && (TYPE_QUALS (element_type))) type = TYPE_MAIN_VARIANT (type); type_quals = ((constp ? TYPE_QUAL_CONST : 0) | (restrictp ? TYPE_QUAL_RESTRICT : 0) | (volatilep ? TYPE_QUAL_VOLATILE : 0)); - /* Warn if two storage classes are given. Default to `auto'. */ + /* Warn about storage classes that are invalid for certain + kinds of declarations (parameters, typenames, etc.). */ - { - int nclasses = 0; - - if (specbits & 1 << (int) RID_AUTO) nclasses++; - if (specbits & 1 << (int) RID_STATIC) nclasses++; - if (specbits & 1 << (int) RID_EXTERN) nclasses++; - if (specbits & 1 << (int) RID_REGISTER) nclasses++; - if (specbits & 1 << (int) RID_TYPEDEF) nclasses++; - - /* "static __thread" and "extern __thread" are allowed. */ - if ((specbits & (1 << (int) RID_THREAD - | 1 << (int) RID_STATIC - | 1 << (int) RID_EXTERN)) == (1 << (int) RID_THREAD)) - nclasses++; - - /* Warn about storage classes that are invalid for certain - kinds of declarations (parameters, typenames, etc.). */ - - if (nclasses > 1) - error ("multiple storage classes in declaration of `%s'", name); - else if (funcdef_flag - && (specbits - & ((1 << (int) RID_REGISTER) - | (1 << (int) RID_AUTO) - | (1 << (int) RID_TYPEDEF) - | (1 << (int) RID_THREAD)))) - { - if (specbits & 1 << (int) RID_AUTO - && (pedantic || current_scope == global_scope)) - pedwarn ("function definition declared `auto'"); - if (specbits & 1 << (int) RID_REGISTER) - error ("function definition declared `register'"); - if (specbits & 1 << (int) RID_TYPEDEF) - error ("function definition declared `typedef'"); - if (specbits & 1 << (int) RID_THREAD) - error ("function definition declared `__thread'"); - specbits &= ~((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER) - | (1 << (int) RID_AUTO) | (1 << (int) RID_THREAD)); - } - else if (decl_context != NORMAL && nclasses > 0) - { - if (decl_context == PARM && specbits & 1 << (int) RID_REGISTER) - ; - else - { - switch (decl_context) - { - case FIELD: - error ("storage class specified for structure field `%s'", - name); - break; - case PARM: - error ("storage class specified for parameter `%s'", name); - break; - default: - error ("storage class specified for typename"); - break; - } - specbits &= ~((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER) - | (1 << (int) RID_AUTO) | (1 << (int) RID_STATIC) - | (1 << (int) RID_EXTERN) | (1 << (int) RID_THREAD)); - } - } - else if (specbits & 1 << (int) RID_EXTERN && initialized && ! funcdef_flag) - { - /* `extern' with initialization is invalid if not at file scope. */ - if (current_scope == global_scope) - warning ("`%s' initialized and declared `extern'", name); - else - error ("`%s' has both `extern' and initializer", name); - } - else if (current_scope == global_scope) - { - if (specbits & 1 << (int) RID_AUTO) - error ("file-scope declaration of `%s' specifies `auto'", name); - } - else - { - if (specbits & 1 << (int) RID_EXTERN && funcdef_flag) - error ("nested function `%s' declared `extern'", name); - else if ((specbits & (1 << (int) RID_THREAD - | 1 << (int) RID_EXTERN - | 1 << (int) RID_STATIC)) - == (1 << (int) RID_THREAD)) - { - error ("function-scope `%s' implicitly auto and declared `__thread'", - name); - specbits &= ~(1 << (int) RID_THREAD); - } - } - } + if (funcdef_flag + && (threadp + || storage_class == csc_auto + || storage_class == csc_register + || storage_class == csc_typedef)) + { + if (storage_class == csc_auto + && (pedantic || current_scope == file_scope)) + pedwarn ("function definition declared %"); + if (storage_class == csc_register) + error ("function definition declared %"); + if (storage_class == csc_typedef) + error ("function definition declared %"); + if (threadp) + error ("function definition declared %<__thread%>"); + threadp = false; + if (storage_class == csc_auto + || storage_class == csc_register + || storage_class == csc_typedef) + storage_class = csc_none; + } + else if (decl_context != NORMAL && (storage_class != csc_none || threadp)) + { + if (decl_context == PARM && storage_class == csc_register) + ; + else + { + switch (decl_context) + { + case FIELD: + error ("storage class specified for structure field %qs", + name); + break; + case PARM: + error ("storage class specified for parameter %qs", name); + break; + default: + error ("storage class specified for typename"); + break; + } + storage_class = csc_none; + threadp = false; + } + } + else if (storage_class == csc_extern + && initialized + && !funcdef_flag) + { + /* 'extern' with initialization is invalid if not at file scope. */ + if (current_scope == file_scope) + { + /* It is fine to have 'extern const' when compiling at C + and C++ intersection. */ + if (!(warn_cxx_compat && constp)) + warning (0, "%qs initialized and declared %", name); + } + else + error ("%qs has both % and initializer", name); + } + else if (current_scope == file_scope) + { + if (storage_class == csc_auto) + error ("file-scope declaration of %qs specifies %", name); + if (pedantic && storage_class == csc_register) + pedwarn ("file-scope declaration of %qs specifies %", name); + } + else + { + if (storage_class == csc_extern && funcdef_flag) + error ("nested function %qs declared %", name); + else if (threadp && storage_class == csc_none) + { + error ("function-scope %qs implicitly auto and declared " + "%<__thread%>", + name); + threadp = false; + } + } /* Now figure out the structure of the declarator proper. Descend through it, creating more complex types, until we reach - the declared identifier (or NULL_TREE, in an absolute declarator). */ + the declared identifier (or NULL_TREE, in an absolute declarator). + At each stage we maintain an unqualified version of the type + together with any qualifiers that should be applied to it with + c_build_qualified_type; this way, array types including + multidimensional array types are first built up in unqualified + form and then the qualified form is created with + TYPE_MAIN_VARIANT pointing to the unqualified form. */ - while (declarator && TREE_CODE (declarator) != IDENTIFIER_NODE) + while (declarator && declarator->kind != cdk_id) { if (type == error_mark_node) { - declarator = TREE_OPERAND (declarator, 0); + declarator = declarator->declarator; continue; } - /* Each level of DECLARATOR is either an ARRAY_REF (for ...[..]), - an INDIRECT_REF (for *...), - a CALL_EXPR (for ...(...)), - a TREE_LIST (for nested attributes), - an identifier (for the name being declared) - or a null pointer (for the place in an absolute declarator + /* Each level of DECLARATOR is either a cdk_array (for ...[..]), + a cdk_pointer (for *...), + a cdk_function (for ...(...)), + a cdk_attrs (for nested attributes), + or a cdk_id (for the name being declared + or the place in an absolute declarator where the name was omitted). - For the last two cases, we have just exited the loop. + For the last case, we have just exited the loop. At this point, TYPE is the type of elements of an array, or for a function to return, or for a pointer to point to. @@ -3797,360 +4132,410 @@ grokdeclarator (tree declarator, tree declspecs, array or function or pointer, and DECLARATOR has had its outermost layer removed. */ - if (array_ptr_quals != NULL_TREE || array_parm_static) + if (array_ptr_quals != TYPE_UNQUALIFIED + || array_ptr_attrs != NULL_TREE + || array_parm_static) { /* Only the innermost declarator (making a parameter be of array type which is converted to pointer type) may have static or type qualifiers. */ error ("static or type qualifiers in non-parameter array declarator"); - array_ptr_quals = NULL_TREE; + array_ptr_quals = TYPE_UNQUALIFIED; + array_ptr_attrs = NULL_TREE; array_parm_static = 0; } - if (TREE_CODE (declarator) == TREE_LIST) + switch (declarator->kind) { - /* We encode a declarator with embedded attributes using - a TREE_LIST. */ - tree attrs = TREE_PURPOSE (declarator); - tree inner_decl; - int attr_flags = 0; - declarator = TREE_VALUE (declarator); - inner_decl = declarator; - while (inner_decl != NULL_TREE - && TREE_CODE (inner_decl) == TREE_LIST) - inner_decl = TREE_VALUE (inner_decl); - if (inner_decl == NULL_TREE - || TREE_CODE (inner_decl) == IDENTIFIER_NODE) - attr_flags |= (int) ATTR_FLAG_DECL_NEXT; - else if (TREE_CODE (inner_decl) == CALL_EXPR) - attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT; - else if (TREE_CODE (inner_decl) == ARRAY_REF) - attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT; - returned_attrs = decl_attributes (&type, - chainon (returned_attrs, attrs), - attr_flags); - } - else if (TREE_CODE (declarator) == ARRAY_REF) - { - tree itype = NULL_TREE; - tree size = TREE_OPERAND (declarator, 1); - /* The index is a signed object `sizetype' bits wide. */ - tree index_type = c_common_signed_type (sizetype); - - array_ptr_quals = TREE_TYPE (declarator); - array_parm_static = TREE_STATIC (declarator); - - declarator = TREE_OPERAND (declarator, 0); - - /* Check for some types that there cannot be arrays of. */ - - if (VOID_TYPE_P (type)) - { - error ("declaration of `%s' as array of voids", name); - type = error_mark_node; - } - - if (TREE_CODE (type) == FUNCTION_TYPE) - { - error ("declaration of `%s' as array of functions", name); - type = error_mark_node; - } - - if (pedantic && !in_system_header && flexible_array_type_p (type)) - pedwarn ("invalid use of structure with flexible array member"); - - if (size == error_mark_node) - type = error_mark_node; - - if (type == error_mark_node) - continue; - - /* If size was specified, set ITYPE to a range-type for that size. - Otherwise, ITYPE remains null. finish_decl may figure it out - from an initial value. */ - - if (size) - { - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - STRIP_TYPE_NOPS (size); - - if (! INTEGRAL_TYPE_P (TREE_TYPE (size))) - { - error ("size of array `%s' has non-integer type", name); - size = integer_one_node; - } - - if (pedantic && integer_zerop (size)) - pedwarn ("ISO C forbids zero-size array `%s'", name); - - if (TREE_CODE (size) == INTEGER_CST) - { - constant_expression_warning (size); - if (tree_int_cst_sgn (size) < 0) - { - error ("size of array `%s' is negative", name); - size = integer_one_node; - } - } - else - { - /* Make sure the array size remains visibly nonconstant - even if it is (eg) a const variable with known value. */ - size_varies = 1; - - if (!flag_isoc99 && pedantic) - { - if (TREE_CONSTANT (size)) - pedwarn ("ISO C90 forbids array `%s' whose size can't be evaluated", - name); - else - pedwarn ("ISO C90 forbids variable-size array `%s'", - name); - } - } - - if (integer_zerop (size)) - { - /* A zero-length array cannot be represented with an - unsigned index type, which is what we'll get with - build_index_type. Create an open-ended range instead. */ - itype = build_range_type (sizetype, size, NULL_TREE); - } - else - { - /* Compute the maximum valid index, that is, size - 1. - Do the calculation in index_type, so that if it is - a variable the computations will be done in the - proper mode. */ - itype = fold (build (MINUS_EXPR, index_type, - convert (index_type, size), - convert (index_type, size_one_node))); - - /* If that overflowed, the array is too big. - ??? While a size of INT_MAX+1 technically shouldn't - cause an overflow (because we subtract 1), the overflow - is recorded during the conversion to index_type, before - the subtraction. Handling this case seems like an - unnecessary complication. */ - if (TREE_OVERFLOW (itype)) - { - error ("size of array `%s' is too large", name); - type = error_mark_node; - continue; - } - - if (size_varies) - { - /* We must be able to distinguish the - SAVE_EXPR_CONTEXT for the variably-sized type - so that we can set it correctly in - set_save_expr_context. The convention is - that all SAVE_EXPRs that need to be reset - have NULL_TREE for their SAVE_EXPR_CONTEXT. */ - tree cfd = current_function_decl; - if (decl_context == PARM) - current_function_decl = NULL_TREE; - itype = variable_size (itype); - if (decl_context == PARM) - current_function_decl = cfd; - } - itype = build_index_type (itype); - } - } - else if (decl_context == FIELD) - { - if (pedantic && !flag_isoc99 && !in_system_header) - pedwarn ("ISO C90 does not support flexible array members"); - - /* ISO C99 Flexible array members are effectively identical - to GCC's zero-length array extension. */ - itype = build_range_type (sizetype, size_zero_node, NULL_TREE); - } - - /* If pedantic, complain about arrays of incomplete types. */ - - if (pedantic && !COMPLETE_TYPE_P (type)) - pedwarn ("array type has incomplete element type"); - - /* Build the array type itself, then merge any constancy or - volatility into the target type. We must do it in this order - to ensure that the TYPE_MAIN_VARIANT field of the array type - is set correctly. */ - - type = build_array_type (type, itype); - if (type_quals) - type = c_build_qualified_type (type, type_quals); - - if (size_varies) - C_TYPE_VARIABLE_SIZE (type) = 1; - - /* The GCC extension for zero-length arrays differs from - ISO flexible array members in that sizeof yields zero. */ - if (size && integer_zerop (size)) - { - layout_type (type); - TYPE_SIZE (type) = bitsize_zero_node; - TYPE_SIZE_UNIT (type) = size_zero_node; - } - if (decl_context != PARM - && (array_ptr_quals != NULL_TREE || array_parm_static)) - { - error ("static or type qualifiers in non-parameter array declarator"); - array_ptr_quals = NULL_TREE; - array_parm_static = 0; - } - } - else if (TREE_CODE (declarator) == CALL_EXPR) - { - /* Say it's a definition only for the declarator closest to - the identifier, apart possibly from some attributes. */ - bool really_funcdef = false; - tree arg_types; - if (funcdef_flag) - { - tree t = TREE_OPERAND (declarator, 0); - while (TREE_CODE (t) == TREE_LIST) - t = TREE_VALUE (t); - really_funcdef = (TREE_CODE (t) == IDENTIFIER_NODE); - } - - /* Declaring a function type. - Make sure we have a valid type for the function to return. */ - if (type == error_mark_node) - continue; - - size_varies = 0; - - /* Warn about some types functions can't return. */ - - if (TREE_CODE (type) == FUNCTION_TYPE) - { - error ("`%s' declared as function returning a function", name); - type = integer_type_node; - } - if (TREE_CODE (type) == ARRAY_TYPE) - { - error ("`%s' declared as function returning an array", name); - type = integer_type_node; - } - - /* Construct the function type and go to the next - inner layer of declarator. */ - - arg_types = grokparms (TREE_OPERAND (declarator, 1), - really_funcdef); - /* Type qualifiers before the return type of the function - qualify the return type, not the function type. */ - if (type_quals) - { - /* Type qualifiers on a function return type are normally - permitted by the standard but have no effect, so give a - warning at -Wextra. Qualifiers on a void return type have - meaning as a GNU extension, and are banned on function - definitions in ISO C. FIXME: strictly we shouldn't - pedwarn for qualified void return types except on function - definitions, but not doing so could lead to the undesirable - state of a "volatile void" function return type not being - warned about, and a use of the function being compiled - with GNU semantics, with no diagnostics under -pedantic. */ - if (VOID_TYPE_P (type) && pedantic && !in_system_header) - pedwarn ("ISO C forbids qualified void function return type"); - else if (extra_warnings - && !(VOID_TYPE_P (type) - && type_quals == TYPE_QUAL_VOLATILE)) - warning ("type qualifiers ignored on function return type"); - - type = c_build_qualified_type (type, type_quals); - } - type_quals = TYPE_UNQUALIFIED; - - type = build_function_type (type, arg_types); - declarator = TREE_OPERAND (declarator, 0); - - /* Set the TYPE_CONTEXTs for each tagged type which is local to - the formal parameter list of this FUNCTION_TYPE to point to - the FUNCTION_TYPE node itself. */ - + case cdk_attrs: { - tree link; - - for (link = last_function_parm_tags; - link; - link = TREE_CHAIN (link)) - TYPE_CONTEXT (TREE_VALUE (link)) = type; + /* A declarator with embedded attributes. */ + tree attrs = declarator->u.attrs; + const struct c_declarator *inner_decl; + int attr_flags = 0; + declarator = declarator->declarator; + inner_decl = declarator; + while (inner_decl->kind == cdk_attrs) + inner_decl = inner_decl->declarator; + if (inner_decl->kind == cdk_id) + attr_flags |= (int) ATTR_FLAG_DECL_NEXT; + else if (inner_decl->kind == cdk_function) + attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT; + else if (inner_decl->kind == cdk_array) + attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT; + returned_attrs = decl_attributes (&type, + chainon (returned_attrs, attrs), + attr_flags); + break; } - } - else if (TREE_CODE (declarator) == INDIRECT_REF) - { - /* Merge any constancy or volatility into the target type - for the pointer. */ + case cdk_array: + { + tree itype = NULL_TREE; + tree size = declarator->u.array.dimen; + /* The index is a signed object `sizetype' bits wide. */ + tree index_type = c_common_signed_type (sizetype); - if (pedantic && TREE_CODE (type) == FUNCTION_TYPE - && type_quals) - pedwarn ("ISO C forbids qualified function types"); - if (type_quals) - type = c_build_qualified_type (type, type_quals); - type_quals = TYPE_UNQUALIFIED; - size_varies = 0; + array_ptr_quals = declarator->u.array.quals; + array_ptr_attrs = declarator->u.array.attrs; + array_parm_static = declarator->u.array.static_p; + array_parm_vla_unspec_p = declarator->u.array.vla_unspec_p; - type = build_pointer_type (type); + declarator = declarator->declarator; - /* Process a list of type modifier keywords - (such as const or volatile) that were given inside the `*'. */ + /* Check for some types that there cannot be arrays of. */ - if (TREE_TYPE (declarator)) + if (VOID_TYPE_P (type)) + { + error ("declaration of %qs as array of voids", name); + type = error_mark_node; + } + + if (TREE_CODE (type) == FUNCTION_TYPE) + { + error ("declaration of %qs as array of functions", name); + type = error_mark_node; + } + + if (pedantic && !in_system_header && flexible_array_type_p (type)) + pedwarn ("invalid use of structure with flexible array member"); + + if (size == error_mark_node) + type = error_mark_node; + + if (type == error_mark_node) + continue; + + /* If size was specified, set ITYPE to a range-type for + that size. Otherwise, ITYPE remains null. finish_decl + may figure it out from an initial value. */ + + if (size) + { + /* Strip NON_LVALUE_EXPRs since we aren't using as an + lvalue. */ + STRIP_TYPE_NOPS (size); + + if (!INTEGRAL_TYPE_P (TREE_TYPE (size))) + { + error ("size of array %qs has non-integer type", name); + size = integer_one_node; + } + + if (pedantic && integer_zerop (size)) + pedwarn ("ISO C forbids zero-size array %qs", name); + + if (TREE_CODE (size) == INTEGER_CST) + { + constant_expression_warning (size); + if (tree_int_cst_sgn (size) < 0) + { + error ("size of array %qs is negative", name); + size = integer_one_node; + } + } + else if ((decl_context == NORMAL || decl_context == FIELD) + && current_scope == file_scope) + { + error ("variably modified %qs at file scope", name); + size = integer_one_node; + } + else + { + /* Make sure the array size remains visibly + nonconstant even if it is (eg) a const variable + with known value. */ + size_varies = 1; + + if (!flag_isoc99 && pedantic) + { + if (TREE_CONSTANT (size)) + pedwarn ("ISO C90 forbids array %qs whose size " + "can%'t be evaluated", + name); + else + pedwarn ("ISO C90 forbids variable-size array %qs", + name); + } + } + + if (integer_zerop (size)) + { + /* A zero-length array cannot be represented with + an unsigned index type, which is what we'll + get with build_index_type. Create an + open-ended range instead. */ + itype = build_range_type (sizetype, size, NULL_TREE); + } + else + { + /* Arrange for the SAVE_EXPR on the inside of the + MINUS_EXPR, which allows the -1 to get folded + with the +1 that happens when building TYPE_SIZE. */ + if (size_varies) + size = variable_size (size); + + /* Compute the maximum valid index, that is, size + - 1. Do the calculation in index_type, so that + if it is a variable the computations will be + done in the proper mode. */ + itype = fold_build2 (MINUS_EXPR, index_type, + convert (index_type, size), + convert (index_type, + size_one_node)); + + /* If that overflowed, the array is too big. ??? + While a size of INT_MAX+1 technically shouldn't + cause an overflow (because we subtract 1), the + overflow is recorded during the conversion to + index_type, before the subtraction. Handling + this case seems like an unnecessary + complication. */ + if (TREE_CODE (itype) == INTEGER_CST + && TREE_OVERFLOW (itype)) + { + error ("size of array %qs is too large", name); + type = error_mark_node; + continue; + } + + itype = build_index_type (itype); + } + } + else if (decl_context == FIELD) + { + if (pedantic && !flag_isoc99 && !in_system_header) + pedwarn ("ISO C90 does not support flexible array members"); + + /* ISO C99 Flexible array members are effectively + identical to GCC's zero-length array extension. */ + itype = build_range_type (sizetype, size_zero_node, NULL_TREE); + } + else if (decl_context == PARM) + { + if (array_parm_vla_unspec_p) + { + if (! orig_name) + { + /* C99 6.7.5.2p4 */ + error ("%<[*]%> not allowed in other than a declaration"); + } + + itype = build_range_type (sizetype, size_zero_node, NULL_TREE); + size_varies = 1; + } + } + else if (decl_context == TYPENAME) + { + if (array_parm_vla_unspec_p) + { + /* The error is printed elsewhere. We use this to + avoid messing up with incomplete array types of + the same type, that would otherwise be modified + below. */ + itype = build_range_type (sizetype, size_zero_node, + NULL_TREE); + } + } + + /* Complain about arrays of incomplete types. */ + if (!COMPLETE_TYPE_P (type)) + { + error ("array type has incomplete element type"); + type = error_mark_node; + } + else + /* When itype is NULL, a shared incomplete array type is + returned for all array of a given type. Elsewhere we + make sure we don't complete that type before copying + it, but here we want to make sure we don't ever + modify the shared type, so we gcc_assert (itype) + below. */ + type = build_array_type (type, itype); + + if (type != error_mark_node) + { + if (size_varies) + { + /* It is ok to modify type here even if itype is + NULL: if size_varies, we're in a + multi-dimensional array and the inner type has + variable size, so the enclosing shared array type + must too. */ + if (size && TREE_CODE (size) == INTEGER_CST) + type + = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); + C_TYPE_VARIABLE_SIZE (type) = 1; + } + + /* The GCC extension for zero-length arrays differs from + ISO flexible array members in that sizeof yields + zero. */ + if (size && integer_zerop (size)) + { + gcc_assert (itype); + TYPE_SIZE (type) = bitsize_zero_node; + TYPE_SIZE_UNIT (type) = size_zero_node; + } + if (array_parm_vla_unspec_p) + { + gcc_assert (itype); + /* The type is complete. C99 6.7.5.2p4 */ + TYPE_SIZE (type) = bitsize_zero_node; + TYPE_SIZE_UNIT (type) = size_zero_node; + } + } + + if (decl_context != PARM + && (array_ptr_quals != TYPE_UNQUALIFIED + || array_ptr_attrs != NULL_TREE + || array_parm_static)) + { + error ("static or type qualifiers in non-parameter array declarator"); + array_ptr_quals = TYPE_UNQUALIFIED; + array_ptr_attrs = NULL_TREE; + array_parm_static = 0; + } + break; + } + case cdk_function: + { + /* Say it's a definition only for the declarator closest + to the identifier, apart possibly from some + attributes. */ + bool really_funcdef = false; + tree arg_types; + if (funcdef_flag) + { + const struct c_declarator *t = declarator->declarator; + while (t->kind == cdk_attrs) + t = t->declarator; + really_funcdef = (t->kind == cdk_id); + } + + /* Declaring a function type. Make sure we have a valid + type for the function to return. */ + if (type == error_mark_node) + continue; + + size_varies = 0; + + /* Warn about some types functions can't return. */ + if (TREE_CODE (type) == FUNCTION_TYPE) + { + error ("%qs declared as function returning a function", name); + type = integer_type_node; + } + if (TREE_CODE (type) == ARRAY_TYPE) + { + error ("%qs declared as function returning an array", name); + type = integer_type_node; + } + + /* Construct the function type and go to the next + inner layer of declarator. */ + arg_info = declarator->u.arg_info; + arg_types = grokparms (arg_info, really_funcdef); + if (really_funcdef) + put_pending_sizes (arg_info->pending_sizes); + + /* Type qualifiers before the return type of the function + qualify the return type, not the function type. */ + if (type_quals) + { + /* Type qualifiers on a function return type are + normally permitted by the standard but have no + effect, so give a warning at -Wreturn-type. + Qualifiers on a void return type are banned on + function definitions in ISO C; GCC used to used + them for noreturn functions. */ + if (VOID_TYPE_P (type) && really_funcdef) + pedwarn ("function definition has qualified void return type"); + else + warning (OPT_Wreturn_type, + "type qualifiers ignored on function return type"); + + type = c_build_qualified_type (type, type_quals); + } + type_quals = TYPE_UNQUALIFIED; + + type = build_function_type (type, arg_types); + declarator = declarator->declarator; + + /* Set the TYPE_CONTEXTs for each tagged type which is local to + the formal parameter list of this FUNCTION_TYPE to point to + the FUNCTION_TYPE node itself. */ { - tree typemodlist; - int erred = 0; + tree link; - constp = 0; - volatilep = 0; - restrictp = 0; - for (typemodlist = TREE_TYPE (declarator); typemodlist; - typemodlist = TREE_CHAIN (typemodlist)) - { - tree qualifier = TREE_VALUE (typemodlist); - - if (C_IS_RESERVED_WORD (qualifier)) - { - if (C_RID_CODE (qualifier) == RID_CONST) - constp++; - else if (C_RID_CODE (qualifier) == RID_VOLATILE) - volatilep++; - else if (C_RID_CODE (qualifier) == RID_RESTRICT) - restrictp++; - else - erred++; - } - else - erred++; - } - - if (erred) - error ("invalid type modifier within pointer declarator"); - if (pedantic && !flag_isoc99) - { - if (constp > 1) - pedwarn ("duplicate `const'"); - if (volatilep > 1) - pedwarn ("duplicate `volatile'"); - if (restrictp > 1) - pedwarn ("duplicate `restrict'"); - } - - type_quals = ((constp ? TYPE_QUAL_CONST : 0) - | (restrictp ? TYPE_QUAL_RESTRICT : 0) - | (volatilep ? TYPE_QUAL_VOLATILE : 0)); + for (link = arg_info->tags; + link; + link = TREE_CHAIN (link)) + TYPE_CONTEXT (TREE_VALUE (link)) = type; } + break; + } + case cdk_pointer: + { + /* Merge any constancy or volatility into the target type + for the pointer. */ - declarator = TREE_OPERAND (declarator, 0); + if (pedantic && TREE_CODE (type) == FUNCTION_TYPE + && type_quals) + pedwarn ("ISO C forbids qualified function types"); + if (type_quals) + type = c_build_qualified_type (type, type_quals); + size_varies = 0; + + /* When the pointed-to type involves components of variable size, + care must be taken to ensure that the size evaluation code is + emitted early enough to dominate all the possible later uses + and late enough for the variables on which it depends to have + been assigned. + + This is expected to happen automatically when the pointed-to + type has a name/declaration of it's own, but special attention + is required if the type is anonymous. + + We handle the NORMAL and FIELD contexts here by attaching an + artificial TYPE_DECL to such pointed-to type. This forces the + sizes evaluation at a safe point and ensures it is not deferred + until e.g. within a deeper conditional context. + + We expect nothing to be needed here for PARM or TYPENAME. + Pushing a TYPE_DECL at this point for TYPENAME would actually + be incorrect, as we might be in the middle of an expression + with side effects on the pointed-to type size "arguments" prior + to the pointer declaration point and the fake TYPE_DECL in the + enclosing context would force the size evaluation prior to the + side effects. */ + + if (!TYPE_NAME (type) + && (decl_context == NORMAL || decl_context == FIELD) + && variably_modified_type_p (type, NULL_TREE)) + { + tree decl = build_decl (TYPE_DECL, NULL_TREE, type); + DECL_ARTIFICIAL (decl) = 1; + pushdecl (decl); + finish_decl (decl, NULL_TREE, NULL_TREE); + TYPE_NAME (type) = decl; + } + + type = build_pointer_type (type); + + /* Process type qualifiers (such as const or volatile) + that were given inside the `*'. */ + type_quals = declarator->u.pointer_quals; + + declarator = declarator->declarator; + break; + } + default: + gcc_unreachable (); } - else - abort (); - } - /* Now TYPE has the actual type. */ + /* Now TYPE has the actual type, apart from any qualifiers in + TYPE_QUALS. */ /* Check the type and width of a bit-field. */ if (bitfield) @@ -4160,9 +4545,10 @@ grokdeclarator (tree declarator, tree declspecs, if (TREE_CODE (type) == ARRAY_TYPE && COMPLETE_TYPE_P (type) - && TREE_OVERFLOW (TYPE_SIZE (type))) + && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST + && TREE_OVERFLOW (TYPE_SIZE_UNIT (type))) { - error ("size of array `%s' is too large", name); + error ("size of array %qs is too large", name); /* If we proceed with the array type as it is, we'll eventually crash in tree_low_cst(). */ type = error_mark_node; @@ -4170,46 +4556,32 @@ grokdeclarator (tree declarator, tree declspecs, /* If this is declaring a typedef name, return a TYPE_DECL. */ - if (specbits & (1 << (int) RID_TYPEDEF)) + if (storage_class == csc_typedef) { tree decl; - /* Note that the grammar rejects storage classes - in typenames, fields or parameters */ if (pedantic && TREE_CODE (type) == FUNCTION_TYPE && type_quals) pedwarn ("ISO C forbids qualified function types"); if (type_quals) type = c_build_qualified_type (type, type_quals); - decl = build_decl (TYPE_DECL, declarator, type); - if ((specbits & (1 << (int) RID_SIGNED)) - || (typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl))) + decl = build_decl (TYPE_DECL, declarator->u.id, type); + if (declspecs->explicit_signed_p) C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1; decl_attributes (&decl, returned_attrs, 0); + if (declspecs->inline_p) + pedwarn ("typedef %q+D declared %", decl); return decl; } - /* Detect the case of an array type of unspecified size - which came, as such, direct from a typedef name. - We must copy the type, so that each identifier gets - a distinct type, so that each identifier's size can be - controlled separately by its own initializer. */ - - if (type != 0 && typedef_type != 0 - && TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == 0 - && TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (typedef_type)) - { - type = build_array_type (TREE_TYPE (type), 0); - if (size_varies) - C_TYPE_VARIABLE_SIZE (type) = 1; - } - /* If this is a type name (such as, in a cast or sizeof), compute the type and return it now. */ if (decl_context == TYPENAME) { - /* Note that the grammar rejects storage classes - in typenames, fields or parameters */ + /* Note that the grammar rejects storage classes in typenames + and fields. */ + gcc_assert (storage_class == csc_none && !threadp + && !declspecs->inline_p); if (pedantic && TREE_CODE (type) == FUNCTION_TYPE && type_quals) pedwarn ("ISO C forbids const or volatile function types"); @@ -4219,6 +4591,13 @@ grokdeclarator (tree declarator, tree declspecs, return type; } + if (pedantic && decl_context == FIELD + && variably_modified_type_p (type, NULL_TREE)) + { + /* C99 6.7.2.1p8 */ + pedwarn ("a member of a structure or union cannot have a variably modified type"); + } + /* Aside from typedefs and type names (handle above), `void' at top level (not within pointer) is allowed only in public variables. @@ -4226,13 +4605,13 @@ grokdeclarator (tree declarator, tree declspecs, a better error message can be made later. */ if (VOID_TYPE_P (type) && decl_context != PARM - && ! ((decl_context != FIELD && TREE_CODE (type) != FUNCTION_TYPE) - && ((specbits & (1 << (int) RID_EXTERN)) - || (current_scope == global_scope - && !(specbits - & ((1 << (int) RID_STATIC) | (1 << (int) RID_REGISTER))))))) + && !((decl_context != FIELD && TREE_CODE (type) != FUNCTION_TYPE) + && (storage_class == csc_extern + || (current_scope == file_scope + && !(storage_class == csc_static + || storage_class == csc_register))))) { - error ("variable or field `%s' declared void", name); + error ("variable or field %qs declared void", name); type = integer_type_node; } @@ -4257,45 +4636,13 @@ grokdeclarator (tree declarator, tree declspecs, if (type_quals) type = c_build_qualified_type (type, type_quals); type = build_pointer_type (type); - type_quals = TYPE_UNQUALIFIED; - if (array_ptr_quals) - { - tree new_ptr_quals, new_ptr_attrs; - int erred = 0; - split_specs_attrs (array_ptr_quals, &new_ptr_quals, &new_ptr_attrs); - /* We don't yet implement attributes in this context. */ - if (new_ptr_attrs != NULL_TREE) - warning ("attributes in parameter array declarator ignored"); + type_quals = array_ptr_quals; - constp = 0; - volatilep = 0; - restrictp = 0; - for (; new_ptr_quals; new_ptr_quals = TREE_CHAIN (new_ptr_quals)) - { - tree qualifier = TREE_VALUE (new_ptr_quals); + /* We don't yet implement attributes in this context. */ + if (array_ptr_attrs != NULL_TREE) + warning (OPT_Wattributes, + "attributes in parameter array declarator ignored"); - if (C_IS_RESERVED_WORD (qualifier)) - { - if (C_RID_CODE (qualifier) == RID_CONST) - constp++; - else if (C_RID_CODE (qualifier) == RID_VOLATILE) - volatilep++; - else if (C_RID_CODE (qualifier) == RID_RESTRICT) - restrictp++; - else - erred++; - } - else - erred++; - } - - if (erred) - error ("invalid type modifier within array declarator"); - - type_quals = ((constp ? TYPE_QUAL_CONST : 0) - | (restrictp ? TYPE_QUAL_RESTRICT : 0) - | (volatilep ? TYPE_QUAL_VOLATILE : 0)); - } size_varies = 0; } else if (TREE_CODE (type) == FUNCTION_TYPE) @@ -4312,7 +4659,7 @@ grokdeclarator (tree declarator, tree declspecs, type_as_written = type; - decl = build_decl (PARM_DECL, declarator, type); + decl = build_decl (PARM_DECL, declarator->u.id, type); if (size_varies) C_DECL_VARIABLE_SIZE (decl) = 1; @@ -4327,29 +4674,31 @@ grokdeclarator (tree declarator, tree declspecs, promoted_type = c_type_promotes_to (type); DECL_ARG_TYPE (decl) = promoted_type; - DECL_ARG_TYPE_AS_WRITTEN (decl) = type_as_written; + if (declspecs->inline_p) + pedwarn ("parameter %q+D declared %", decl); } else if (decl_context == FIELD) { + /* Note that the grammar rejects storage classes in typenames + and fields. */ + gcc_assert (storage_class == csc_none && !threadp + && !declspecs->inline_p); + /* Structure field. It may not be a function. */ if (TREE_CODE (type) == FUNCTION_TYPE) { - error ("field `%s' declared as a function", name); + error ("field %qs declared as a function", name); type = build_pointer_type (type); } else if (TREE_CODE (type) != ERROR_MARK - && !COMPLETE_OR_UNBOUND_ARRAY_TYPE_P (type)) + && !COMPLETE_OR_UNBOUND_ARRAY_TYPE_P (type)) { - error ("field `%s' has incomplete type", name); + error ("field %qs has incomplete type", name); type = error_mark_node; } - /* Move type qualifiers down to element of an array. */ - if (TREE_CODE (type) == ARRAY_TYPE && type_quals) - type = build_array_type (c_build_qualified_type (TREE_TYPE (type), - type_quals), - TYPE_DOMAIN (type)); - decl = build_decl (FIELD_DECL, declarator, type); + type = c_build_qualified_type (type, type_quals); + decl = build_decl (FIELD_DECL, declarator->u.id, type); DECL_NONADDRESSABLE_P (decl) = bitfield; if (size_varies) @@ -4357,60 +4706,75 @@ grokdeclarator (tree declarator, tree declspecs, } else if (TREE_CODE (type) == FUNCTION_TYPE) { - /* Every function declaration is "external" - except for those which are inside a function body - in which `auto' is used. - That is a case not specified by ANSI C, - and we use it for forward declarations for nested functions. */ - int extern_ref = (!(specbits & (1 << (int) RID_AUTO)) - || current_scope == global_scope); + if (storage_class == csc_register || threadp) + { + error ("invalid storage class for function %qs", name); + } + else if (current_scope != file_scope) + { + /* Function declaration not at file scope. Storage + classes other than `extern' are not allowed, C99 + 6.7.1p5, and `extern' makes no difference. However, + GCC allows 'auto', perhaps with 'inline', to support + nested functions. */ + if (storage_class == csc_auto) + { + if (pedantic) + pedwarn ("invalid storage class for function %qs", name); + } + else if (storage_class == csc_static) + { + error ("invalid storage class for function %qs", name); + if (funcdef_flag) + storage_class = declspecs->storage_class = csc_none; + else + return 0; + } + } - if (specbits & (1 << (int) RID_AUTO) - && (pedantic || current_scope == global_scope)) - pedwarn ("invalid storage class for function `%s'", name); - if (specbits & (1 << (int) RID_REGISTER)) - error ("invalid storage class for function `%s'", name); - if (specbits & (1 << (int) RID_THREAD)) - error ("invalid storage class for function `%s'", name); - /* Function declaration not at file scope. - Storage classes other than `extern' are not allowed - and `extern' makes no difference. */ - if (current_scope != global_scope - && (specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_INLINE))) - && pedantic) - pedwarn ("invalid storage class for function `%s'", name); - - decl = build_decl (FUNCTION_DECL, declarator, type); + decl = build_decl (FUNCTION_DECL, declarator->u.id, type); decl = build_decl_attribute_variant (decl, decl_attr); - DECL_LANG_SPECIFIC (decl) - = ggc_alloc_cleared (sizeof (struct lang_decl)); + DECL_LANG_SPECIFIC (decl) = GGC_CNEW (struct lang_decl); - if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl)) + if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl)) pedwarn ("ISO C forbids qualified function types"); - /* GNU C interprets a `volatile void' return type to indicate + /* GNU C interprets a volatile-qualified function type to indicate that the function does not return. */ if ((type_quals & TYPE_QUAL_VOLATILE) && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))) - warning ("`noreturn' function returns non-void value"); + warning (0, "% function returns non-void value"); - if (extern_ref) + /* Every function declaration is an external reference + (DECL_EXTERNAL) except for those which are not at file + scope and are explicitly declared "auto". This is + forbidden by standard C (C99 6.7.1p5) and is interpreted by + GCC to signify a forward declaration of a nested function. */ + if (storage_class == csc_auto && current_scope != file_scope) + DECL_EXTERNAL (decl) = 0; + else DECL_EXTERNAL (decl) = 1; + /* Record absence of global scope for `static' or `auto'. */ TREE_PUBLIC (decl) - = !(specbits & ((1 << (int) RID_STATIC) | (1 << (int) RID_AUTO))); + = !(storage_class == csc_static || storage_class == csc_auto); - if (defaulted_int) + /* For a function definition, record the argument information + block where store_parm_decls will look for it. */ + if (funcdef_flag) + current_function_arg_info = arg_info; + + if (declspecs->default_int_p) C_FUNCTION_IMPLICIT_INT (decl) = 1; /* Record presence of `inline', if it is reasonable. */ - if (MAIN_NAME_P (declarator)) + if (flag_hosted && MAIN_NAME_P (declarator->u.id)) { - if (inlinep) - warning ("cannot inline function `main'"); + if (declspecs->inline_p) + pedwarn ("cannot inline function %"); } - else if (inlinep) + else if (declspecs->inline_p) { /* Record that the function is declared `inline'. */ DECL_DECLARED_INLINE_P (decl) = 1; @@ -4422,7 +4786,7 @@ grokdeclarator (tree declarator, tree declspecs, if (initialized) { DECL_INLINE (decl) = 1; - if (specbits & (1 << (int) RID_EXTERN)) + if (storage_class == csc_extern) current_extern_inline = 1; } } @@ -4436,66 +4800,62 @@ grokdeclarator (tree declarator, tree declspecs, { /* It's a variable. */ /* An uninitialized decl with `extern' is a reference. */ - int extern_ref = !initialized && (specbits & (1 << (int) RID_EXTERN)); + int extern_ref = !initialized && storage_class == csc_extern; - /* Move type qualifiers down to element of an array. */ - if (TREE_CODE (type) == ARRAY_TYPE && type_quals) - { - int saved_align = TYPE_ALIGN(type); - type = build_array_type (c_build_qualified_type (TREE_TYPE (type), - type_quals), - TYPE_DOMAIN (type)); - TYPE_ALIGN (type) = saved_align; - } - else if (type_quals) - type = c_build_qualified_type (type, type_quals); + type = c_build_qualified_type (type, type_quals); - /* It is invalid to create an `extern' declaration for a + /* C99 6.2.2p7: It is invalid (compile-time undefined + behavior) to create an 'extern' declaration for a variable if there is a global declaration that is - `static' and the global declaration is not visible. */ - if (extern_ref && current_scope != global_scope) + 'static' and the global declaration is not visible. + (If the static declaration _is_ currently visible, + the 'extern' declaration is taken to refer to that decl.) */ + if (extern_ref && current_scope != file_scope) { - tree global_decl; + tree global_decl = identifier_global_value (declarator->u.id); + tree visible_decl = lookup_name (declarator->u.id); - global_decl = identifier_global_value (declarator); if (global_decl + && global_decl != visible_decl && TREE_CODE (global_decl) == VAR_DECL - && lookup_name (declarator) != global_decl && !TREE_PUBLIC (global_decl)) - error ("variable previously declared `static' redeclared " - "`extern'"); + error ("variable previously declared % redeclared " + "%"); } - decl = build_decl (VAR_DECL, declarator, type); + decl = build_decl (VAR_DECL, declarator->u.id, type); + DECL_SOURCE_LOCATION (decl) = declarator->id_loc; if (size_varies) C_DECL_VARIABLE_SIZE (decl) = 1; - if (inlinep) - pedwarn ("%Jvariable '%D' declared `inline'", decl, decl); + if (declspecs->inline_p) + pedwarn ("variable %q+D declared %", decl); - DECL_EXTERNAL (decl) = extern_ref; + /* At file scope, an initialized extern declaration may follow + a static declaration. In that case, DECL_EXTERNAL will be + reset later in start_decl. */ + DECL_EXTERNAL (decl) = (storage_class == csc_extern); /* At file scope, the presence of a `static' or `register' storage class specifier, or the absence of all storage class specifiers makes this declaration a definition (perhaps tentative). Also, - the absence of both `static' and `register' makes it public. */ - if (current_scope == global_scope) + the absence of `static' makes it public. */ + if (current_scope == file_scope) { - TREE_PUBLIC (decl) = !(specbits & ((1 << (int) RID_STATIC) - | (1 << (int) RID_REGISTER))); + TREE_PUBLIC (decl) = storage_class != csc_static; TREE_STATIC (decl) = !extern_ref; } /* Not at file scope, only `static' makes a static definition. */ else { - TREE_STATIC (decl) = (specbits & (1 << (int) RID_STATIC)) != 0; + TREE_STATIC (decl) = (storage_class == csc_static); TREE_PUBLIC (decl) = extern_ref; } - if (specbits & 1 << (int) RID_THREAD) + if (threadp) { if (targetm.have_tls) - DECL_THREAD_LOCAL (decl) = 1; + DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); else /* A mere warning is sure to result in improper semantics at runtime. Don't bother to allow this to compile. */ @@ -4503,27 +4863,46 @@ grokdeclarator (tree declarator, tree declspecs, } } + if (storage_class == csc_extern + && variably_modified_type_p (type, NULL_TREE)) + { + /* C99 6.7.5.2p2 */ + error ("object with variably modified type must have no linkage"); + } + /* Record `register' declaration for warnings on & and in case doing stupid register allocation. */ - if (specbits & (1 << (int) RID_REGISTER)) - DECL_REGISTER (decl) = 1; + if (storage_class == csc_register) + { + C_DECL_REGISTER (decl) = 1; + DECL_REGISTER (decl) = 1; + } /* Record constancy and volatility. */ c_apply_type_quals_to_decl (type_quals, decl); /* If a type has volatile components, it should be stored in memory. Otherwise, the fact that those components are volatile - will be ignored, and would even crash the compiler. */ - if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl))) - c_mark_addressable (decl); + will be ignored, and would even crash the compiler. + Of course, this only makes sense on VAR,PARM, and RESULT decl's. */ + if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (decl)) + && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL + || TREE_CODE (decl) == RESULT_DECL)) + { + /* It is not an error for a structure with volatile fields to + be declared register, but reset DECL_REGISTER since it + cannot actually go in a register. */ + int was_reg = C_DECL_REGISTER (decl); + C_DECL_REGISTER (decl) = 0; + DECL_REGISTER (decl) = 0; + c_mark_addressable (decl); + C_DECL_REGISTER (decl) = was_reg; + } -#ifdef ENABLE_CHECKING /* This is the earliest point at which we might know the assembler name of a variable. Thus, if it's known before this, die horribly. */ - if (DECL_ASSEMBLER_NAME_SET_P (decl)) - abort (); -#endif + gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl)); decl_attributes (&decl, returned_attrs, 0); @@ -4532,218 +4911,295 @@ grokdeclarator (tree declarator, tree declspecs, } /* Decode the parameter-list info for a function type or function definition. - The argument is the value returned by `get_parm_info' (or made in parse.y + The argument is the value returned by `get_parm_info' (or made in c-parse.c if there is an identifier list instead of a parameter decl list). These two functions are separate because when a function returns or receives functions then each is called multiple times but the order of calls is different. The last call to `grokparms' is always the one that contains the formal parameter names of a function definition. - Store in `last_function_parms' a chain of the decls of parms. - Also store in `last_function_parm_tags' a chain of the struct, union, - and enum tags declared among the parms. - Return a list of arg types to use in the FUNCTION_TYPE for this function. - FUNCDEF_FLAG is nonzero for a function definition, 0 for + FUNCDEF_FLAG is true for a function definition, false for a mere declaration. A nonempty identifier-list gets an error message - when FUNCDEF_FLAG is zero. */ + when FUNCDEF_FLAG is false. */ static tree -grokparms (tree parms_info, int funcdef_flag) +grokparms (struct c_arg_info *arg_info, bool funcdef_flag) { - tree first_parm = TREE_CHAIN (parms_info); + tree arg_types = arg_info->types; - last_function_parms = TREE_PURPOSE (parms_info); - last_function_parm_tags = TREE_VALUE (parms_info); - last_function_parm_others = TREE_TYPE (parms_info); - - if (warn_strict_prototypes && first_parm == 0 && !funcdef_flag - && !in_system_header) - warning ("function declaration isn't a prototype"); - - if (first_parm != 0 - && TREE_CODE (TREE_VALUE (first_parm)) == IDENTIFIER_NODE) + if (funcdef_flag && arg_info->had_vla_unspec) { - if (! funcdef_flag) + /* A function definition isn't function prototype scope C99 6.2.1p4. */ + /* C99 6.7.5.2p4 */ + error ("%<[*]%> not allowed in other than function prototype scope"); + } + + if (arg_types == 0 && !funcdef_flag && !in_system_header) + warning (OPT_Wstrict_prototypes, + "function declaration isn%'t a prototype"); + + if (arg_types == error_mark_node) + return 0; /* don't set TYPE_ARG_TYPES in this case */ + + else if (arg_types && TREE_CODE (TREE_VALUE (arg_types)) == IDENTIFIER_NODE) + { + if (!funcdef_flag) pedwarn ("parameter names (without types) in function declaration"); - last_function_parms = first_parm; + arg_info->parms = arg_info->types; + arg_info->types = 0; return 0; } else { - tree parm; - tree typelt; - /* If the arg types are incomplete in a declaration, - they must include undefined tags. - These tags can never be defined in the scope of the declaration, - so the types can never be completed, - and no call can be compiled successfully. */ + tree parm, type, typelt; + unsigned int parmno; - for (parm = last_function_parms, typelt = first_parm; + /* If there is a parameter of incomplete type in a definition, + this is an error. In a declaration this is valid, and a + struct or union type may be completed later, before any calls + or definition of the function. In the case where the tag was + first declared within the parameter list, a warning has + already been given. If a parameter has void type, then + however the function cannot be defined or called, so + warn. */ + + for (parm = arg_info->parms, typelt = arg_types, parmno = 1; parm; - parm = TREE_CHAIN (parm)) - /* Skip over any enumeration constants declared here. */ - if (TREE_CODE (parm) == PARM_DECL) - { - /* Barf if the parameter itself has an incomplete type. */ - tree type = TREE_VALUE (typelt); - if (type == error_mark_node) - continue; - if (!COMPLETE_TYPE_P (type)) - { - if (funcdef_flag && DECL_NAME (parm) != 0) - error ("parameter `%s' has incomplete type", - IDENTIFIER_POINTER (DECL_NAME (parm))); - else - warning ("parameter has incomplete type"); - if (funcdef_flag) - { - TREE_VALUE (typelt) = error_mark_node; - TREE_TYPE (parm) = error_mark_node; - } - } - typelt = TREE_CHAIN (typelt); - } + parm = TREE_CHAIN (parm), typelt = TREE_CHAIN (typelt), parmno++) + { + type = TREE_VALUE (typelt); + if (type == error_mark_node) + continue; - return first_parm; + if (!COMPLETE_TYPE_P (type)) + { + if (funcdef_flag) + { + if (DECL_NAME (parm)) + error ("parameter %u (%q+D) has incomplete type", + parmno, parm); + else + error ("%Jparameter %u has incomplete type", + parm, parmno); + + TREE_VALUE (typelt) = error_mark_node; + TREE_TYPE (parm) = error_mark_node; + } + else if (VOID_TYPE_P (type)) + { + if (DECL_NAME (parm)) + warning (0, "parameter %u (%q+D) has void type", + parmno, parm); + else + warning (0, "%Jparameter %u has void type", + parm, parmno); + } + } + + if (DECL_NAME (parm) && TREE_USED (parm)) + warn_if_shadowing (parm); + } + return arg_types; } } -/* Return a tree_list node with info on a parameter list just parsed. - The TREE_PURPOSE is a list of decls of those parms. - The TREE_VALUE is a list of structure, union and enum tags defined. - The TREE_CHAIN is a list of argument types to go in the FUNCTION_TYPE. - The TREE_TYPE is a list of non-parameter decls which appeared with the - parameters. - This tree_list node is later fed to `grokparms'. +/* Take apart the current scope and return a c_arg_info structure with + info on a parameter list just parsed. - VOID_AT_END nonzero means append `void' to the end of the type-list. - Zero means the parmlist ended with an ellipsis so don't append `void'. */ + This structure is later fed to 'grokparms' and 'store_parm_decls'. -tree -get_parm_info (int void_at_end) + ELLIPSIS being true means the argument list ended in '...' so don't + append a sentinel (void_list_node) to the end of the type-list. */ + +struct c_arg_info * +get_parm_info (bool ellipsis) { - tree decl, type, list; - tree types = 0; - tree *last_type = &types; - tree tags = current_scope->tags; - tree parms = current_scope->parms; - tree others = current_scope->names; + struct c_binding *b = current_scope->bindings; + struct c_arg_info *arg_info = XOBNEW (&parser_obstack, + struct c_arg_info); + tree parms = 0; + tree tags = 0; + tree types = 0; + tree others = 0; + static bool explained_incomplete_types = false; bool gave_void_only_once_err = false; - /* Just "void" (and no ellipsis) is special. There are really no parms. - But if the "void" is qualified (by "const" or "volatile"), or has a - storage class specifier ("register"), then the behavior is undefined; - issue an error. Typedefs for "void" are OK (see DR#157). */ - if (void_at_end && parms != 0 - && TREE_CHAIN (parms) == 0 - && VOID_TYPE_P (TREE_TYPE (parms)) - && !DECL_NAME (parms)) - { - if (TREE_THIS_VOLATILE (parms) - || TREE_READONLY (parms) - || DECL_REGISTER (parms)) - error ("\"void\" as only parameter may not be qualified"); + arg_info->parms = 0; + arg_info->tags = 0; + arg_info->types = 0; + arg_info->others = 0; + arg_info->pending_sizes = 0; + arg_info->had_vla_unspec = current_scope->had_vla_unspec; - return tree_cons (0, 0, tree_cons (0, void_type_node, 0)); + /* The bindings in this scope must not get put into a block. + We will take care of deleting the binding nodes. */ + current_scope->bindings = 0; + + /* This function is only called if there was *something* on the + parameter list. */ + gcc_assert (b); + + /* A parameter list consisting solely of 'void' indicates that the + function takes no arguments. But if the 'void' is qualified + (by 'const' or 'volatile'), or has a storage class specifier + ('register'), then the behavior is undefined; issue an error. + Typedefs for 'void' are OK (see DR#157). */ + if (b->prev == 0 /* one binding */ + && TREE_CODE (b->decl) == PARM_DECL /* which is a parameter */ + && !DECL_NAME (b->decl) /* anonymous */ + && VOID_TYPE_P (TREE_TYPE (b->decl))) /* of void type */ + { + if (TREE_THIS_VOLATILE (b->decl) + || TREE_READONLY (b->decl) + || C_DECL_REGISTER (b->decl)) + error ("% as only parameter may not be qualified"); + + /* There cannot be an ellipsis. */ + if (ellipsis) + error ("% must be the only parameter"); + + arg_info->types = void_list_node; + return arg_info; } - /* Sanity check all of the parameter declarations. */ - for (decl = parms; decl; decl = TREE_CHAIN (decl)) + if (!ellipsis) + types = void_list_node; + + /* Break up the bindings list into parms, tags, types, and others; + apply sanity checks; purge the name-to-decl bindings. */ + while (b) { - if (TREE_CODE (decl) != PARM_DECL) - abort (); - if (TREE_ASM_WRITTEN (decl)) - abort (); - - /* Since there is a prototype, args are passed in their - declared types. The back end may override this. */ - type = TREE_TYPE (decl); - DECL_ARG_TYPE (decl) = type; - - /* Check for (..., void, ...) and issue an error. */ - if (VOID_TYPE_P (type) && !DECL_NAME (decl) && !gave_void_only_once_err) - { - error ("\"void\" must be the only parameter"); - gave_void_only_once_err = true; - } - - type = build_tree_list (0, type); - *last_type = type; - last_type = &TREE_CHAIN (type); - } - - /* Check the list of non-parameter decls for any forward parm decls - that never got real decls. */ - for (decl = others; decl; decl = TREE_CHAIN (decl)) - if (TREE_CODE (decl) == PARM_DECL) - { - if (!TREE_ASM_WRITTEN (decl)) - abort (); - - error ("%Jparameter \"%D\" has just a forward declaration", - decl, decl); - } - - /* Warn about any struct, union or enum tags defined within this - list. The scope of such types is limited to this declaration, - which is rarely if ever desirable (it's impossible to call such - a function with type-correct arguments). */ - for (decl = tags; decl; decl = TREE_CHAIN (decl)) - { - enum tree_code code = TREE_CODE (TREE_VALUE (decl)); + tree decl = b->decl; + tree type = TREE_TYPE (decl); const char *keyword; - /* An anonymous union parm type is meaningful as a GNU extension. - So don't warn for that. */ - if (code == UNION_TYPE && TREE_PURPOSE (decl) == 0 && !pedantic) - continue; - /* The keyword should not be translated. */ - switch (code) + switch (TREE_CODE (decl)) { - case RECORD_TYPE: keyword = "struct"; break; - case UNION_TYPE: keyword = "union"; break; - case ENUMERAL_TYPE: keyword = "enum"; break; - default: abort (); + case PARM_DECL: + if (b->id) + { + gcc_assert (I_SYMBOL_BINDING (b->id) == b); + I_SYMBOL_BINDING (b->id) = b->shadowed; + } + + /* Check for forward decls that never got their actual decl. */ + if (TREE_ASM_WRITTEN (decl)) + error ("parameter %q+D has just a forward declaration", decl); + /* Check for (..., void, ...) and issue an error. */ + else if (VOID_TYPE_P (type) && !DECL_NAME (decl)) + { + if (!gave_void_only_once_err) + { + error ("% must be the only parameter"); + gave_void_only_once_err = true; + } + } + else + { + /* Valid parameter, add it to the list. */ + TREE_CHAIN (decl) = parms; + parms = decl; + + /* Since there is a prototype, args are passed in their + declared types. The back end may override this later. */ + DECL_ARG_TYPE (decl) = type; + types = tree_cons (0, type, types); + } + break; + + case ENUMERAL_TYPE: keyword = "enum"; goto tag; + case UNION_TYPE: keyword = "union"; goto tag; + case RECORD_TYPE: keyword = "struct"; goto tag; + tag: + /* Types may not have tag-names, in which case the type + appears in the bindings list with b->id NULL. */ + if (b->id) + { + gcc_assert (I_TAG_BINDING (b->id) == b); + I_TAG_BINDING (b->id) = b->shadowed; + } + + /* Warn about any struct, union or enum tags defined in a + parameter list. The scope of such types is limited to + the parameter list, which is rarely if ever desirable + (it's impossible to call such a function with type- + correct arguments). An anonymous union parm type is + meaningful as a GNU extension, so don't warn for that. */ + if (TREE_CODE (decl) != UNION_TYPE || b->id != 0) + { + if (b->id) + /* The %s will be one of 'struct', 'union', or 'enum'. */ + warning (0, "%<%s %E%> declared inside parameter list", + keyword, b->id); + else + /* The %s will be one of 'struct', 'union', or 'enum'. */ + warning (0, "anonymous %s declared inside parameter list", + keyword); + + if (!explained_incomplete_types) + { + warning (0, "its scope is only this definition or declaration," + " which is probably not what you want"); + explained_incomplete_types = true; + } + } + + tags = tree_cons (b->id, decl, tags); + break; + + case CONST_DECL: + case TYPE_DECL: + case FUNCTION_DECL: + /* CONST_DECLs appear here when we have an embedded enum, + and TYPE_DECLs appear here when we have an embedded struct + or union. No warnings for this - we already warned about the + type itself. FUNCTION_DECLs appear when there is an implicit + function declaration in the parameter list. */ + + TREE_CHAIN (decl) = others; + others = decl; + /* fall through */ + + case ERROR_MARK: + /* error_mark_node appears here when we have an undeclared + variable. Just throw it away. */ + if (b->id) + { + gcc_assert (I_SYMBOL_BINDING (b->id) == b); + I_SYMBOL_BINDING (b->id) = b->shadowed; + } + break; + + /* Other things that might be encountered. */ + case LABEL_DECL: + case VAR_DECL: + default: + gcc_unreachable (); } - if (TREE_PURPOSE (decl)) - /* The first %s will be one of 'struct', 'union', or 'enum'. */ - warning ("\"%s %s\" declared inside parameter list", - keyword, IDENTIFIER_POINTER (TREE_PURPOSE (decl))); - else - /* The %s will be one of 'struct', 'union', or 'enum'. */ - warning ("anonymous %s declared inside parameter list", keyword); - - if (! explained_incomplete_types) - { - warning ("its scope is only this definition or declaration," - " which is probably not what you want"); - explained_incomplete_types = true; - } + b = free_binding_and_advance (b); } - - if (void_at_end) - { - type = build_tree_list (0, void_type_node); - *last_type = type; - } - - list = tree_cons (parms, tags, types); - TREE_TYPE (list) = others; - return list; + arg_info->parms = parms; + arg_info->tags = tags; + arg_info->types = types; + arg_info->others = others; + arg_info->pending_sizes = get_pending_sizes (); + return arg_info; } /* Get the struct, enum or union (CODE says which) with tag NAME. - Define the tag as a forward-reference if it is not defined. */ + Define the tag as a forward-reference if it is not defined. + Return a c_typespec structure for the type specifier. */ -tree -xref_tag (enum tree_code code, tree name) +struct c_typespec +parser_xref_tag (enum tree_code code, tree name) { + struct c_typespec ret; /* If a cross reference is requested, look up the type already defined for this tag and return it. */ @@ -4759,8 +5215,12 @@ xref_tag (enum tree_code code, tree name) this would not work properly if we return the reference found. (For example, with "struct foo" in an outer scope, "union foo;" must shadow that tag with a new one of union type.) */ + ret.kind = (ref ? ctsk_tagref : ctsk_tagfirstref); if (ref && TREE_CODE (ref) == code) - return ref; + { + ret.spec = ref; + return ret; + } /* If no such tag is yet defined, create a forward-reference node and record it as the "definition". @@ -4775,7 +5235,7 @@ xref_tag (enum tree_code code, tree name) TYPE_MODE (ref) = TYPE_MODE (unsigned_type_node); TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node); TYPE_USER_ALIGN (ref) = 0; - TREE_UNSIGNED (ref) = 1; + TYPE_UNSIGNED (ref) = 1; TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node); TYPE_MIN_VALUE (ref) = TYPE_MIN_VALUE (unsigned_type_node); TYPE_MAX_VALUE (ref) = TYPE_MAX_VALUE (unsigned_type_node); @@ -4783,7 +5243,18 @@ xref_tag (enum tree_code code, tree name) pushtag (name, ref); - return ref; + ret.spec = ref; + return ret; +} + +/* Get the struct, enum or union (CODE says which) with tag NAME. + Define the tag as a forward-reference if it is not defined. + Return a tree for the type. */ + +tree +xref_tag (enum tree_code code, tree name) +{ + return parser_xref_tag (code, name).spec; } /* Make sure that the tag NAME is defined *in the current scope* @@ -4803,20 +5274,18 @@ start_struct (enum tree_code code, tree name) if (ref && TREE_CODE (ref) == code) { if (TYPE_SIZE (ref)) - { + { if (code == UNION_TYPE) - error ("redefinition of `union %s'", IDENTIFIER_POINTER (name)); - else - error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name)); + error ("redefinition of %", name); + else + error ("redefinition of %", name); } else if (C_TYPE_BEING_DEFINED (ref)) { if (code == UNION_TYPE) - error ("nested redefinition of `union %s'", - IDENTIFIER_POINTER (name)); - else - error ("nested redefinition of `struct %s'", - IDENTIFIER_POINTER (name)); + error ("nested redefinition of %", name); + else + error ("nested redefinition of %", name); } } else @@ -4832,7 +5301,7 @@ start_struct (enum tree_code code, tree name) return ref; } -/* Process the specs, declarator (NULL if omitted) and width (NULL if omitted) +/* Process the specs, declarator and width (NULL if omitted) of a structure component, returning a FIELD_DECL node. WIDTH is non-NULL for bit-fields only, and is an INTEGER_CST node. @@ -4841,11 +5310,13 @@ start_struct (enum tree_code code, tree name) are ultimately passed to `build_struct' to make the RECORD_TYPE node. */ tree -grokfield (tree declarator, tree declspecs, tree width) +grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs, + tree width) { tree value; - if (declarator == NULL_TREE && width == NULL_TREE) + if (declarator->kind == cdk_id && declarator->u.id == NULL_TREE + && width == NULL_TREE) { /* This is an unnamed decl. @@ -4866,30 +5337,33 @@ grokfield (tree declarator, tree declspecs, tree width) took this from Plan 9 or if it was an accident of implementation that took root before someone noticed the bug... */ - tree type = TREE_VALUE (declspecs); + tree type = declspecs->type; + bool type_ok = (TREE_CODE (type) == RECORD_TYPE + || TREE_CODE (type) == UNION_TYPE); + bool ok = false; - if (flag_ms_extensions && TREE_CODE (type) == TYPE_DECL) - type = TREE_TYPE (type); - if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) + if (type_ok + && (flag_ms_extensions || !declspecs->typedef_p)) { if (flag_ms_extensions) - ; /* ok */ + ok = true; else if (flag_iso) - goto warn_unnamed_field; + ok = false; else if (TYPE_NAME (type) == NULL) - ; /* ok */ + ok = true; else - goto warn_unnamed_field; + ok = false; } - else + if (!ok) { - warn_unnamed_field: - warning ("declaration does not declare anything"); + pedwarn ("declaration does not declare anything"); return NULL_TREE; } + if (pedantic) + pedwarn ("ISO C doesn%'t support unnamed structs/unions"); } - value = grokdeclarator (declarator, declspecs, FIELD, 0, + value = grokdeclarator (declarator, declspecs, FIELD, false, width ? &width : NULL); finish_decl (value, NULL_TREE, NULL_TREE); @@ -4929,7 +5403,7 @@ detect_field_duplicates (tree fieldlist) for (y = fieldlist; y != x; y = TREE_CHAIN (y)) if (DECL_NAME (y) == DECL_NAME (x)) { - error ("%Jduplicate member '%D'", x, x); + error ("duplicate member %q+D", x); DECL_NAME (x) = NULL_TREE; } } @@ -4945,7 +5419,7 @@ detect_field_duplicates (tree fieldlist) slot = htab_find_slot (htab, y, INSERT); if (*slot) { - error ("%Jduplicate member '%D'", x, x); + error ("duplicate member %q+D", x); DECL_NAME (x) = NULL_TREE; } *slot = y; @@ -4963,7 +5437,7 @@ tree finish_struct (tree t, tree fieldlist, tree attributes) { tree x; - int toplevel = global_scope == current_scope; + bool toplevel = file_scope == current_scope; int saw_named_field; /* If this type was previously laid out as a forward reference, @@ -4973,19 +5447,6 @@ finish_struct (tree t, tree fieldlist, tree attributes) decl_attributes (&t, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE); - /* Nameless union parm types are useful as GCC extension. */ - if (! (TREE_CODE (t) == UNION_TYPE && TYPE_NAME (t) == 0) && !pedantic) - /* Otherwise, warn about any struct or union def. in parmlist. */ - if (in_parm_level_p ()) - { - if (pedantic) - pedwarn ("%s defined inside parms", - TREE_CODE (t) == UNION_TYPE ? _("union") : _("structure")); - else - warning ("%s defined inside parms", - TREE_CODE (t) == UNION_TYPE ? _("union") : _("structure")); - } - if (pedantic) { for (x = fieldlist; x; x = TREE_CHAIN (x)) @@ -4993,21 +5454,41 @@ finish_struct (tree t, tree fieldlist, tree attributes) break; if (x == 0) - pedwarn ("%s has no %s", - TREE_CODE (t) == UNION_TYPE ? _("union") : _("struct"), - fieldlist ? _("named members") : _("members")); + { + if (TREE_CODE (t) == UNION_TYPE) + { + if (fieldlist) + pedwarn ("union has no named members"); + else + pedwarn ("union has no members"); + } + else + { + if (fieldlist) + pedwarn ("struct has no named members"); + else + pedwarn ("struct has no members"); + } + } } /* Install struct as DECL_CONTEXT of each field decl. - Also process specified field sizes,m which is found in the DECL_INITIAL. - Store 0 there, except for ": 0" fields (so we can find them - and delete them, below). */ + Also process specified field sizes, found in the DECL_INITIAL, + storing 0 there after the type has been changed to precision equal + to its width, rather than the precision of the specified standard + type. (Correct layout requires the original type to have been preserved + until now.) */ saw_named_field = 0; for (x = fieldlist; x; x = TREE_CHAIN (x)) { + if (TREE_TYPE (x) == error_mark_node) + continue; + DECL_CONTEXT (x) = t; - DECL_PACKED (x) |= TYPE_PACKED (t); + + if (TYPE_PACKED (t) && TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT) + DECL_PACKED (x) = 1; /* If any field is const, the structure type is pseudo-const. */ if (TREE_READONLY (x)) @@ -5040,8 +5521,6 @@ finish_struct (tree t, tree fieldlist, tree attributes) SET_DECL_C_BIT_FIELD (x); } - DECL_INITIAL (x) = 0; - /* Detect flexible array member in an invalid context. */ if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE && TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE @@ -5058,7 +5537,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) error ("%Jflexible array member not at end of struct", x); TREE_TYPE (x) = error_mark_node; } - else if (! saw_named_field) + else if (!saw_named_field) { error ("%Jflexible array member in otherwise empty struct", x); TREE_TYPE (x) = error_mark_node; @@ -5082,12 +5561,24 @@ finish_struct (tree t, tree fieldlist, tree attributes) layout_type (t); - /* Delete all zero-width bit-fields from the fieldlist. */ + /* Give bit-fields their proper types. */ { tree *fieldlistp = &fieldlist; while (*fieldlistp) - if (TREE_CODE (*fieldlistp) == FIELD_DECL && DECL_INITIAL (*fieldlistp)) - *fieldlistp = TREE_CHAIN (*fieldlistp); + if (TREE_CODE (*fieldlistp) == FIELD_DECL && DECL_INITIAL (*fieldlistp) + && TREE_TYPE (*fieldlistp) != error_mark_node) + { + unsigned HOST_WIDE_INT width + = tree_low_cst (DECL_INITIAL (*fieldlistp), 1); + tree type = TREE_TYPE (*fieldlistp); + if (width != TYPE_PRECISION (type)) + { + TREE_TYPE (*fieldlistp) + = c_build_bitfield_integer_type (width, TYPE_UNSIGNED (type)); + DECL_MODE (*fieldlistp) = TYPE_MODE (TREE_TYPE (*fieldlistp)); + } + DECL_INITIAL (*fieldlistp) = 0; + } else fieldlistp = &TREE_CHAIN (*fieldlistp); } @@ -5105,45 +5596,46 @@ finish_struct (tree t, tree fieldlist, tree attributes) for (x = fieldlist; x; x = TREE_CHAIN (x)) { - if (len > 15 || DECL_NAME (x) == NULL) - break; - len += 1; + if (len > 15 || DECL_NAME (x) == NULL) + break; + len += 1; } if (len > 15) { - tree *field_array; - struct lang_type *space; - struct sorted_fields_type *space2; + tree *field_array; + struct lang_type *space; + struct sorted_fields_type *space2; - len += list_length (x); + len += list_length (x); - /* Use the same allocation policy here that make_node uses, to - ensure that this lives as long as the rest of the struct decl. - All decls in an inline function need to be saved. */ + /* Use the same allocation policy here that make_node uses, to + ensure that this lives as long as the rest of the struct decl. + All decls in an inline function need to be saved. */ - space = ggc_alloc (sizeof (struct lang_type)); - space2 = ggc_alloc (sizeof (struct sorted_fields_type) + len * sizeof (tree)); + space = GGC_CNEW (struct lang_type); + space2 = GGC_NEWVAR (struct sorted_fields_type, + sizeof (struct sorted_fields_type) + len * sizeof (tree)); - len = 0; + len = 0; space->s = space2; field_array = &space2->elts[0]; - for (x = fieldlist; x; x = TREE_CHAIN (x)) - { - field_array[len++] = x; + for (x = fieldlist; x; x = TREE_CHAIN (x)) + { + field_array[len++] = x; - /* If there is anonymous struct or union, break out of the loop. */ - if (DECL_NAME (x) == NULL) - break; - } - /* Found no anonymous struct/union. Add the TYPE_LANG_SPECIFIC. */ - if (x == NULL) - { - TYPE_LANG_SPECIFIC (t) = space; - TYPE_LANG_SPECIFIC (t)->s->len = len; - field_array = TYPE_LANG_SPECIFIC (t)->s->elts; - qsort (field_array, len, sizeof (tree), field_decl_cmp); - } + /* If there is anonymous struct or union, break out of the loop. */ + if (DECL_NAME (x) == NULL) + break; + } + /* Found no anonymous struct/union. Add the TYPE_LANG_SPECIFIC. */ + if (x == NULL) + { + TYPE_LANG_SPECIFIC (t) = space; + TYPE_LANG_SPECIFIC (t)->s->len = len; + field_array = TYPE_LANG_SPECIFIC (t)->s->elts; + qsort (field_array, len, sizeof (tree), field_decl_cmp); + } } } @@ -5151,8 +5643,6 @@ finish_struct (tree t, tree fieldlist, tree attributes) { TYPE_FIELDS (x) = TYPE_FIELDS (t); TYPE_LANG_SPECIFIC (x) = TYPE_LANG_SPECIFIC (t); - TYPE_ALIGN (x) = TYPE_ALIGN (t); - TYPE_USER_ALIGN (x) = TYPE_USER_ALIGN (t); C_TYPE_FIELDS_READONLY (x) = C_TYPE_FIELDS_READONLY (t); C_TYPE_FIELDS_VOLATILE (x) = C_TYPE_FIELDS_VOLATILE (t); C_TYPE_VARIABLE_SIZE (x) = C_TYPE_VARIABLE_SIZE (t); @@ -5165,7 +5655,7 @@ finish_struct (tree t, tree fieldlist, tree attributes) && (!TYPE_FIELDS (t) || TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t)))) { TYPE_TRANSPARENT_UNION (t) = 0; - warning ("union cannot be made transparent"); + warning (0, "union cannot be made transparent"); } /* If this structure or union completes the type of any previous @@ -5182,8 +5672,8 @@ finish_struct (tree t, tree fieldlist, tree attributes) layout_decl (decl, 0); if (c_dialect_objc ()) objc_check_decl (decl); - rest_of_decl_compilation (decl, NULL, toplevel, 0); - if (! toplevel) + rest_of_decl_compilation (decl, toplevel, 0); + if (!toplevel) expand_decl (decl); } } @@ -5192,6 +5682,12 @@ finish_struct (tree t, tree fieldlist, tree attributes) /* Finish debugging output for this type. */ rest_of_type_compilation (t, toplevel); + /* If we're inside a function proper, i.e. not file-scope and not still + parsing parameters, then arrange for the size of a variable sized type + to be bound now. */ + if (cur_stmt_list && variably_modified_type_p (t, NULL_TREE)) + add_stmt (build_stmt (DECL_EXPR, build_decl (TYPE_DECL, NULL, t))); + return t; } @@ -5230,14 +5726,14 @@ start_enum (tree name) } if (C_TYPE_BEING_DEFINED (enumtype)) - error ("nested redefinition of `enum %s'", IDENTIFIER_POINTER (name)); + error ("nested redefinition of %", name); C_TYPE_BEING_DEFINED (enumtype) = 1; if (TYPE_VALUES (enumtype) != 0) { /* This enum is a named one that has been declared already. */ - error ("redeclaration of `enum %s'", IDENTIFIER_POINTER (name)); + error ("redeclaration of %", name); /* Completely replace its old definition. The old enumerators remain defined, however. */ @@ -5263,12 +5759,10 @@ tree finish_enum (tree enumtype, tree values, tree attributes) { tree pair, tem; - tree minnode = 0, maxnode = 0, enum_value_type; + tree minnode = 0, maxnode = 0; int precision, unsign; - int toplevel = (global_scope == current_scope); - - if (in_parm_level_p ()) - warning ("enum defined inside parms"); + bool toplevel = (file_scope == current_scope); + struct lang_type *lt; decl_attributes (&enumtype, attributes, (int) ATTR_FLAG_TYPE_IN_PLACE); @@ -5296,28 +5790,22 @@ finish_enum (tree enumtype, tree values, tree attributes) unsign = (tree_int_cst_sgn (minnode) >= 0); precision = MAX (min_precision (minnode, unsign), min_precision (maxnode, unsign)); + if (TYPE_PACKED (enumtype) || precision > TYPE_PRECISION (integer_type_node)) { - tree narrowest = c_common_type_for_size (precision, unsign); - if (narrowest == 0) + tem = c_common_type_for_size (precision, unsign); + if (tem == NULL) { - warning ("enumeration values exceed range of largest integer"); - narrowest = long_long_integer_type_node; + warning (0, "enumeration values exceed range of largest integer"); + tem = long_long_integer_type_node; } - - precision = TYPE_PRECISION (narrowest); } else - precision = TYPE_PRECISION (integer_type_node); + tem = unsign ? unsigned_type_node : integer_type_node; - if (precision == TYPE_PRECISION (integer_type_node)) - enum_value_type = c_common_type_for_size (precision, 0); - else - enum_value_type = enumtype; - - TYPE_MIN_VALUE (enumtype) = minnode; - TYPE_MAX_VALUE (enumtype) = maxnode; - TREE_UNSIGNED (enumtype) = unsign; + TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (tem); + TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (tem); + TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (tem); TYPE_SIZE (enumtype) = 0; /* If the precision of the type was specific with an attribute and it @@ -5328,7 +5816,7 @@ finish_enum (tree enumtype, tree values, tree attributes) error ("specified mode too small for enumeral values"); } else - TYPE_PRECISION (enumtype) = precision; + TYPE_PRECISION (enumtype) = TYPE_PRECISION (tem); layout_type (enumtype); @@ -5344,6 +5832,7 @@ finish_enum (tree enumtype, tree values, tree attributes) for (pair = values; pair; pair = TREE_CHAIN (pair)) { tree enu = TREE_PURPOSE (pair); + tree ini = DECL_INITIAL (enu); TREE_TYPE (enu) = enumtype; @@ -5354,18 +5843,27 @@ finish_enum (tree enumtype, tree values, tree attributes) when comparing integers with enumerators that fit in the int range. When -pedantic is given, build_enumerator() would have already taken care of those that don't fit. */ - if (int_fits_type_p (DECL_INITIAL (enu), enum_value_type)) - DECL_INITIAL (enu) = convert (enum_value_type, DECL_INITIAL (enu)); + if (int_fits_type_p (ini, integer_type_node)) + tem = integer_type_node; else - DECL_INITIAL (enu) = convert (enumtype, DECL_INITIAL (enu)); + tem = enumtype; + ini = convert (tem, ini); + DECL_INITIAL (enu) = ini; TREE_PURPOSE (pair) = DECL_NAME (enu); - TREE_VALUE (pair) = DECL_INITIAL (enu); + TREE_VALUE (pair) = ini; } TYPE_VALUES (enumtype) = values; } + /* Record the min/max values so that we can warn about bit-field + enumerations that are too small for the values. */ + lt = GGC_CNEW (struct lang_type); + lt->enum_min = minnode; + lt->enum_max = maxnode; + TYPE_LANG_SPECIFIC (enumtype) = lt; + /* Fix up all variant types of this enum type. */ for (tem = TYPE_MAIN_VARIANT (enumtype); tem; tem = TYPE_NEXT_VARIANT (tem)) { @@ -5380,7 +5878,8 @@ finish_enum (tree enumtype, tree values, tree attributes) TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype); TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype); TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype); - TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype); + TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype); + TYPE_LANG_SPECIFIC (tem) = TYPE_LANG_SPECIFIC (enumtype); } /* Finish debugging output for this type. */ @@ -5401,22 +5900,22 @@ build_enumerator (tree name, tree value) /* Validate and default VALUE. */ - /* Remove no-op casts from the value. */ - if (value) - STRIP_TYPE_NOPS (value); - if (value != 0) { - if (TREE_CODE (value) == INTEGER_CST) + /* Don't issue more errors for error_mark_node (i.e. an + undeclared identifier) - just ignore the value expression. */ + if (value == error_mark_node) + value = 0; + else if (!INTEGRAL_TYPE_P (TREE_TYPE (value)) + || TREE_CODE (value) != INTEGER_CST) { - value = default_conversion (value); - constant_expression_warning (value); + error ("enumerator value for %qE is not an integer constant", name); + value = 0; } else { - error ("enumerator value for `%s' not integer constant", - IDENTIFIER_POINTER (name)); - value = 0; + value = default_conversion (value); + constant_expression_warning (value); } } @@ -5430,9 +5929,11 @@ build_enumerator (tree name, tree value) error ("overflow in enumeration values"); } - if (pedantic && ! int_fits_type_p (value, integer_type_node)) + if (pedantic && !int_fits_type_p (value, integer_type_node)) { - pedwarn ("ISO C restricts enumerator values to range of `int'"); + pedwarn ("ISO C restricts enumerator values to range of %"); + /* XXX This causes -pedantic to change the meaning of the program. + Remove? -zw 2004-03-15 */ value = convert (integer_type_node, value); } @@ -5447,7 +5948,7 @@ build_enumerator (tree name, tree value) TYPE_PRECISION (integer_type_node)), (TYPE_PRECISION (type) >= TYPE_PRECISION (integer_type_node) - && TREE_UNSIGNED (type))); + && TYPE_UNSIGNED (type))); decl = build_decl (CONST_DECL, name, type); DECL_INITIAL (decl) = convert (type, value); @@ -5470,30 +5971,47 @@ build_enumerator (tree name, tree value) yyparse to report a parse error. */ int -start_function (tree declspecs, tree declarator, tree attributes) +start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, + tree attributes) { tree decl1, old_decl; - tree restype; - int old_immediate_size_expand = immediate_size_expand; + tree restype, resdecl; + struct c_label_context_se *nstack_se; + struct c_label_context_vm *nstack_vm; current_function_returns_value = 0; /* Assume, until we see it does. */ current_function_returns_null = 0; current_function_returns_abnormally = 0; warn_about_return_type = 0; current_extern_inline = 0; - c_in_iteration_stmt = 0; - c_in_case_stmt = 0; + c_switch_stack = NULL; - /* Don't expand any sizes in the return type of the function. */ - immediate_size_expand = 0; + nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack_se->labels_def = NULL; + nstack_se->labels_used = NULL; + nstack_se->next = label_context_stack_se; + label_context_stack_se = nstack_se; - decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, NULL); + nstack_vm = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack_vm->labels_def = NULL; + nstack_vm->labels_used = NULL; + nstack_vm->scope = 0; + nstack_vm->next = label_context_stack_vm; + label_context_stack_vm = nstack_vm; + + /* Indicate no valid break/continue context by setting these variables + to some non-null, non-label value. We'll notice and emit the proper + error message in c_finish_bc_stmt. */ + c_break_label = c_cont_label = size_zero_node; + + decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, true, NULL); /* If the declarator is not suitable for a function definition, cause a syntax error. */ if (decl1 == 0) { - immediate_size_expand = old_immediate_size_expand; + label_context_stack_se = label_context_stack_se->next; + label_context_stack_vm = label_context_stack_vm->next; return 0; } @@ -5502,7 +6020,8 @@ start_function (tree declspecs, tree declarator, tree attributes) if (DECL_DECLARED_INLINE_P (decl1) && DECL_UNINLINABLE (decl1) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl1))) - warning ("%Jinline function '%D' given attribute noinline", decl1, decl1); + warning (OPT_Wattributes, "inline function %q+D given attribute noinline", + decl1); announce_function (decl1); @@ -5516,63 +6035,105 @@ start_function (tree declspecs, tree declarator, tree attributes) } if (warn_about_return_type) - pedwarn_c99 ("return type defaults to `int'"); - - /* Save the parm names or decls from this function's declarator - where store_parm_decls will find them. */ - current_function_parms = last_function_parms; - current_function_parm_tags = last_function_parm_tags; - current_function_parm_others = last_function_parm_others; + pedwarn_c99 ("return type defaults to %"); /* Make the init_value nonzero so pushdecl knows this is not tentative. - error_mark_node is replaced below (in poplevel) with the BLOCK. */ + error_mark_node is replaced below (in pop_scope) with the BLOCK. */ DECL_INITIAL (decl1) = error_mark_node; /* If this definition isn't a prototype and we had a prototype declaration - before, copy the arg type info from that prototype. - But not if what we had before was a builtin function. */ - old_decl = lookup_name_current_level (DECL_NAME (decl1)); - if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE - && !DECL_BUILT_IN (old_decl) - && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1))) - == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (old_decl)))) - && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0) + before, copy the arg type info from that prototype. */ + old_decl = lookup_name_in_scope (DECL_NAME (decl1), current_scope); + if (old_decl && TREE_CODE (old_decl) != FUNCTION_DECL) + old_decl = 0; + current_function_prototype_locus = UNKNOWN_LOCATION; + current_function_prototype_built_in = false; + current_function_prototype_arg_types = NULL_TREE; + if (TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0) { - TREE_TYPE (decl1) = TREE_TYPE (old_decl); - current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl); + if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE + && comptypes (TREE_TYPE (TREE_TYPE (decl1)), + TREE_TYPE (TREE_TYPE (old_decl)))) + { + TREE_TYPE (decl1) = composite_type (TREE_TYPE (old_decl), + TREE_TYPE (decl1)); + current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl); + current_function_prototype_built_in + = C_DECL_BUILTIN_PROTOTYPE (old_decl); + current_function_prototype_arg_types + = TYPE_ARG_TYPES (TREE_TYPE (decl1)); + } + if (TREE_PUBLIC (decl1)) + { + /* If there is an external prototype declaration of this + function, record its location but do not copy information + to this decl. This may be an invisible declaration + (built-in or in a scope which has finished) or simply + have more refined argument types than any declaration + found above. */ + struct c_binding *b; + for (b = I_SYMBOL_BINDING (DECL_NAME (decl1)); b; b = b->shadowed) + if (B_IN_SCOPE (b, external_scope)) + break; + if (b) + { + tree ext_decl, ext_type; + ext_decl = b->decl; + ext_type = b->type ? b->type : TREE_TYPE (ext_decl); + if (TREE_CODE (ext_type) == FUNCTION_TYPE + && comptypes (TREE_TYPE (TREE_TYPE (decl1)), + TREE_TYPE (ext_type))) + { + current_function_prototype_locus + = DECL_SOURCE_LOCATION (ext_decl); + current_function_prototype_built_in + = C_DECL_BUILTIN_PROTOTYPE (ext_decl); + current_function_prototype_arg_types + = TYPE_ARG_TYPES (ext_type); + } + } + } } /* Optionally warn of old-fashioned def with no previous prototype. */ if (warn_strict_prototypes + && old_decl != error_mark_node && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0 && C_DECL_ISNT_PROTOTYPE (old_decl)) - warning ("function declaration isn't a prototype"); + warning (OPT_Wstrict_prototypes, + "function declaration isn%'t a prototype"); /* Optionally warn of any global def with no previous prototype. */ else if (warn_missing_prototypes + && old_decl != error_mark_node && TREE_PUBLIC (decl1) - && ! MAIN_NAME_P (DECL_NAME (decl1)) + && !MAIN_NAME_P (DECL_NAME (decl1)) && C_DECL_ISNT_PROTOTYPE (old_decl)) - warning ("%Jno previous prototype for '%D'", decl1, decl1); + warning (OPT_Wmissing_prototypes, "no previous prototype for %q+D", decl1); /* Optionally warn of any def with no previous prototype if the function has already been used. */ else if (warn_missing_prototypes - && old_decl != 0 && TREE_USED (old_decl) + && old_decl != 0 + && old_decl != error_mark_node + && TREE_USED (old_decl) && TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0) - warning ("%J'%D' was used with no prototype before its definition", - decl1, decl1); + warning (OPT_Wmissing_prototypes, + "%q+D was used with no prototype before its definition", decl1); /* Optionally warn of any global def with no previous declaration. */ else if (warn_missing_declarations && TREE_PUBLIC (decl1) && old_decl == 0 - && ! MAIN_NAME_P (DECL_NAME (decl1))) - warning ("%Jno previous declaration for '%D'", decl1, decl1); + && !MAIN_NAME_P (DECL_NAME (decl1))) + warning (OPT_Wmissing_declarations, "no previous declaration for %q+D", + decl1); /* Optionally warn of any def with no previous declaration if the function has already been used. */ else if (warn_missing_declarations - && old_decl != 0 && TREE_USED (old_decl) + && old_decl != 0 + && old_decl != error_mark_node + && TREE_USED (old_decl) && C_DECL_IMPLICIT (old_decl)) - warning ("%J`%D' was used with no declaration before its definition", - decl1, decl1); + warning (OPT_Wmissing_declarations, + "%q+D was used with no declaration before its definition", decl1); /* This is a definition, not a reference. So normally clear DECL_EXTERNAL. @@ -5580,6 +6141,30 @@ start_function (tree declspecs, tree declarator, tree attributes) except for defining how to inline. So set DECL_EXTERNAL in that case. */ DECL_EXTERNAL (decl1) = current_extern_inline; + /* C99 specified different behaviour for non-static inline + functions, compared with the traditional GNU behaviour. We don't + support the C99 behaviour, but we do warn about non-static inline + functions here. The warning can be disabled via an explicit use + of -fgnu89-inline, or by using the gnu_inline attribute. */ + if (DECL_DECLARED_INLINE_P (decl1) + && TREE_PUBLIC (decl1) + && flag_isoc99 + && flag_gnu89_inline != 1 + && !lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (decl1)) + && diagnostic_report_warnings_p ()) + { + static bool info = false; + + warning (0, "C99 inline functions are not supported; using GNU89"); + if (!info) + { + warning (0, + "to disable this warning use -fgnu89-inline or " + "the gnu_inline function attribute"); + info = true; + } + } + /* This function exists in static storage. (This does not mean `static' in the C sense!) */ TREE_STATIC (decl1) = 1; @@ -5588,15 +6173,12 @@ start_function (tree declspecs, tree declarator, tree attributes) if (current_function_decl != 0) TREE_PUBLIC (decl1) = 0; -#ifdef ENABLE_CHECKING /* This is the earliest point at which we might know the assembler name of the function. Thus, if it's set before this, die horribly. */ - if (DECL_ASSEMBLER_NAME_SET_P (decl1)) - abort (); -#endif + gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl1)); /* If #pragma weak was used, mark the decl weak now. */ - if (current_scope == global_scope) + if (current_scope == file_scope) maybe_apply_pragma_weak (decl1); /* Warn for unlikely, improbable, or stupid declarations of `main'. */ @@ -5607,7 +6189,7 @@ start_function (tree declspecs, tree declarator, tree attributes) if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1))) != integer_type_node) - pedwarn ("%Jreturn type of '%D' is not `int'", decl1, decl1); + pedwarn ("return type of %q+D is not %", decl1); for (args = TYPE_ARG_TYPES (TREE_TYPE (decl1)); args; args = TREE_CHAIN (args)) @@ -5622,8 +6204,7 @@ start_function (tree declspecs, tree declarator, tree attributes) { case 1: if (TYPE_MAIN_VARIANT (type) != integer_type_node) - pedwarn ("%Jfirst argument of '%D' should be `int'", - decl1, decl1); + pedwarn ("first argument of %q+D should be %", decl1); break; case 2: @@ -5631,8 +6212,8 @@ start_function (tree declspecs, tree declarator, tree attributes) || TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE || (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type))) != char_type_node)) - pedwarn ("%Jsecond argument of '%D' should be 'char **'", - decl1, decl1); + pedwarn ("second argument of %q+D should be %", + decl1); break; case 3: @@ -5640,8 +6221,8 @@ start_function (tree declspecs, tree declarator, tree attributes) || TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE || (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type))) != char_type_node)) - pedwarn ("%Jthird argument of '%D' should probably be " - "'char **'", decl1, decl1); + pedwarn ("third argument of %q+D should probably be " + "%", decl1); break; } } @@ -5650,10 +6231,10 @@ start_function (tree declspecs, tree declarator, tree attributes) argument because it's only mentioned in an appendix of the standard. */ if (argct > 0 && (argct < 2 || argct > 3)) - pedwarn ("%J'%D' takes only zero or two arguments", decl1, decl1); + pedwarn ("%q+D takes only zero or two arguments", decl1); - if (! TREE_PUBLIC (decl1)) - pedwarn ("%J'%D' is normally a non-static function", decl1, decl1); + if (!TREE_PUBLIC (decl1)) + pedwarn ("%q+D is normally a non-static function", decl1); } /* Record the decl so that the function name is defined. @@ -5662,32 +6243,26 @@ start_function (tree declspecs, tree declarator, tree attributes) current_function_decl = pushdecl (decl1); - pushlevel (0); + push_scope (); declare_parm_level (); - make_decl_rtl (current_function_decl, NULL); - restype = TREE_TYPE (TREE_TYPE (current_function_decl)); /* Promote the value to int before returning it. */ if (c_promoting_integer_type_p (restype)) { /* It retains unsignedness if not really getting wider. */ - if (TREE_UNSIGNED (restype) + if (TYPE_UNSIGNED (restype) && (TYPE_PRECISION (restype) == TYPE_PRECISION (integer_type_node))) restype = unsigned_type_node; else restype = integer_type_node; } - DECL_RESULT (current_function_decl) - = build_decl (RESULT_DECL, NULL_TREE, restype); - /* If this fcn was already referenced via a block-scope `extern' decl - (or an implicit decl), propagate certain information about the usage. */ - if (TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (current_function_decl))) - TREE_ADDRESSABLE (current_function_decl) = 1; - - immediate_size_expand = old_immediate_size_expand; + resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (current_function_decl) = resdecl; start_fname_decls (); @@ -5699,98 +6274,78 @@ start_function (tree declspecs, tree declarator, tree attributes) need only record them as in effect and complain if any redundant old-style parm decls were written. */ static void -store_parm_decls_newstyle (void) +store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info) { - tree decl, last; - tree fndecl = current_function_decl; - tree parms = current_function_parms; - tree tags = current_function_parm_tags; - tree others = current_function_parm_others; + tree decl; - if (current_scope->parms || current_scope->names || current_scope->tags) + if (current_scope->bindings) { error ("%Jold-style parameter declarations in prototyped " "function definition", fndecl); /* Get rid of the old-style declarations. */ - poplevel (0, 0, 0); - pushlevel (0); + pop_scope (); + push_scope (); } + /* Don't issue this warning for nested functions, and don't issue this + warning if we got here because ARG_INFO_TYPES was error_mark_node + (this happens when a function definition has just an ellipsis in + its parameter list). */ + else if (!in_system_header && !current_function_scope + && arg_info->types != error_mark_node) + warning (OPT_Wtraditional, + "%Jtraditional C rejects ISO C style function definitions", + fndecl); /* Now make all the parameter declarations visible in the function body. We can bypass most of the grunt work of pushdecl. */ - for (last = 0, decl = parms; decl; last = decl, decl = TREE_CHAIN (decl)) + for (decl = arg_info->parms; decl; decl = TREE_CHAIN (decl)) { DECL_CONTEXT (decl) = current_function_decl; - if (DECL_NAME (decl) == 0) - error ("%Jparameter name omitted", decl); - else + if (DECL_NAME (decl)) { - if (IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl))) - current_scope->shadowed - = tree_cons (DECL_NAME (decl), - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)), - current_scope->shadowed); - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)) = decl; + bind (DECL_NAME (decl), decl, current_scope, + /*invisible=*/false, /*nested=*/false); + if (!TREE_USED (decl)) + warn_if_shadowing (decl); } + else + error ("%Jparameter name omitted", decl); } - current_scope->parms = parms; - current_scope->parms_last = last; /* Record the parameter list in the function declaration. */ - DECL_ARGUMENTS (fndecl) = parms; + DECL_ARGUMENTS (fndecl) = arg_info->parms; /* Now make all the ancillary declarations visible, likewise. */ - for (last = 0, decl = others; decl; last = decl, decl = TREE_CHAIN (decl)) + for (decl = arg_info->others; decl; decl = TREE_CHAIN (decl)) { DECL_CONTEXT (decl) = current_function_decl; - if (DECL_NAME (decl) - && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) != void_type_node) - { - if (IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl))) - current_scope->shadowed - = tree_cons (DECL_NAME (decl), - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)), - current_scope->shadowed); - IDENTIFIER_SYMBOL_VALUE (DECL_NAME (decl)) = decl; - } + if (DECL_NAME (decl)) + bind (DECL_NAME (decl), decl, current_scope, + /*invisible=*/false, /*nested=*/false); } - current_scope->names = others; - current_scope->names_last = last; /* And all the tag declarations. */ - for (decl = tags; decl; decl = TREE_CHAIN (decl)) + for (decl = arg_info->tags; decl; decl = TREE_CHAIN (decl)) if (TREE_PURPOSE (decl)) - { - if (IDENTIFIER_TAG_VALUE (TREE_PURPOSE (decl))) - current_scope->shadowed_tags - = tree_cons (TREE_PURPOSE (decl), - IDENTIFIER_SYMBOL_VALUE (TREE_PURPOSE (decl)), - current_scope->shadowed_tags); - IDENTIFIER_TAG_VALUE (TREE_PURPOSE (decl)) = TREE_VALUE (decl); - } - current_scope->tags = tags; + bind (TREE_PURPOSE (decl), TREE_VALUE (decl), current_scope, + /*invisible=*/false, /*nested=*/false); } /* Subroutine of store_parm_decls which handles old-style function definitions (separate parameter list and declarations). */ static void -store_parm_decls_oldstyle (void) +store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) { + struct c_binding *b; tree parm, decl, last; - tree fndecl = current_function_decl; + tree parmids = arg_info->parms; + struct pointer_set_t *seen_args = pointer_set_create (); - /* This is the identifier list from the function declarator. */ - tree parmids = current_function_parms; - - /* We use DECL_WEAK as a flag to show which parameters have been - seen already, since it is not used on PARM_DECL. */ -#ifdef ENABLE_CHECKING - for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm)) - if (DECL_WEAK (parm)) - abort (); -#endif + if (!in_system_header) + warning (OPT_Wold_style_definition, "%Jold-style function definition", + fndecl); /* Match each formal parameter name with its declaration. Save each decl in the appropriate TREE_PURPOSE slot of the parmids chain. */ @@ -5803,17 +6358,18 @@ store_parm_decls_oldstyle (void) continue; } - decl = IDENTIFIER_SYMBOL_VALUE (TREE_VALUE (parm)); - if (decl && DECL_CONTEXT (decl) == fndecl) + b = I_SYMBOL_BINDING (TREE_VALUE (parm)); + if (b && B_IN_CURRENT_SCOPE (b)) { + decl = b->decl; /* If we got something other than a PARM_DECL it is an error. */ if (TREE_CODE (decl) != PARM_DECL) - error ("%J\"%D\" declared as a non-parameter", decl, decl); + error ("%q+D declared as a non-parameter", decl); /* If the declaration is already marked, we have a duplicate name. Complain and ignore the duplicate. */ - else if (DECL_WEAK (decl)) + else if (pointer_set_contains (seen_args, decl)) { - error ("%Jmultiple parameters named \"%D\"", decl, decl); + error ("multiple parameters named %q+D", decl); TREE_PURPOSE (parm) = 0; continue; } @@ -5821,11 +6377,12 @@ store_parm_decls_oldstyle (void) an int. */ else if (VOID_TYPE_P (TREE_TYPE (decl))) { - error ("%Jparameter \"%D\" declared void", decl, decl); + error ("parameter %q+D declared with void type", decl); TREE_TYPE (decl) = integer_type_node; DECL_ARG_TYPE (decl) = integer_type_node; layout_decl (decl, 0); } + warn_if_shadowing (decl); } /* If no declaration found, default to int. */ else @@ -5834,32 +6391,37 @@ store_parm_decls_oldstyle (void) DECL_ARG_TYPE (decl) = TREE_TYPE (decl); DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (fndecl); pushdecl (decl); + warn_if_shadowing (decl); if (flag_isoc99) - pedwarn ("%Jtype of \"%D\" defaults to \"int\"", decl, decl); + pedwarn ("type of %q+D defaults to %", decl); else if (extra_warnings) - warning ("%Jtype of \"%D\" defaults to \"int\"", decl, decl); + warning (OPT_Wextra, "type of %q+D defaults to %", decl); } TREE_PURPOSE (parm) = decl; - DECL_WEAK (decl) = 1; + pointer_set_insert (seen_args, decl); } /* Now examine the parms chain for incomplete declarations and declarations with no corresponding names. */ - for (parm = current_scope->parms; parm; parm = TREE_CHAIN (parm)) + for (b = current_scope->bindings; b; b = b->prev) { - if (!COMPLETE_TYPE_P (TREE_TYPE (parm))) + parm = b->decl; + if (TREE_CODE (parm) != PARM_DECL) + continue; + + if (TREE_TYPE (parm) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (parm))) { - error ("%Jparameter \"%D\" has incomplete type", parm, parm); + error ("parameter %q+D has incomplete type", parm); TREE_TYPE (parm) = error_mark_node; } - if (! DECL_WEAK (parm)) + if (!pointer_set_contains (seen_args, parm)) { - error ("%Jdeclaration for parameter \"%D\" but no such parameter", - parm, parm); + error ("declaration for parameter %q+D but no such parameter", parm); /* Pretend the parameter was not missing. This gets us to a standard state and minimizes @@ -5880,29 +6442,27 @@ store_parm_decls_oldstyle (void) { last = TREE_PURPOSE (parm); DECL_ARGUMENTS (fndecl) = last; - current_scope->parms = last; - DECL_WEAK (last) = 0; for (parm = TREE_CHAIN (parm); parm; parm = TREE_CHAIN (parm)) if (TREE_PURPOSE (parm)) { TREE_CHAIN (last) = TREE_PURPOSE (parm); last = TREE_PURPOSE (parm); - DECL_WEAK (last) = 0; } - current_scope->parms_last = last; TREE_CHAIN (last) = 0; } + pointer_set_destroy (seen_args); + /* If there was a previous prototype, set the DECL_ARG_TYPE of each argument according to the type previously specified, and report any mismatches. */ - if (TYPE_ARG_TYPES (TREE_TYPE (fndecl))) + if (current_function_prototype_arg_types) { tree type; for (parm = DECL_ARGUMENTS (fndecl), - type = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); + type = current_function_prototype_arg_types; parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node)); parm = TREE_CHAIN (parm), type = TREE_CHAIN (type)) @@ -5910,17 +6470,22 @@ store_parm_decls_oldstyle (void) if (parm == 0 || type == 0 || TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node) { - error ("number of arguments doesn't match prototype"); - error ("%Hprototype declaration", - ¤t_function_prototype_locus); + if (current_function_prototype_built_in) + warning (0, "number of arguments doesn%'t match " + "built-in prototype"); + else + { + error ("number of arguments doesn%'t match prototype"); + error ("%Hprototype declaration", + ¤t_function_prototype_locus); + } break; } /* Type for passing arg must be consistent with that declared for the arg. ISO C says we take the unqualified type for parameters declared with qualified type. */ - if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), - TYPE_MAIN_VARIANT (TREE_VALUE (type)), - COMPARE_STRICT)) + if (!comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), + TYPE_MAIN_VARIANT (TREE_VALUE (type)))) { if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) == TYPE_MAIN_VARIANT (TREE_VALUE (type))) @@ -5940,17 +6505,33 @@ store_parm_decls_oldstyle (void) if (pedantic) { - pedwarn ("promoted argument \"%D\" " - "doesn't match prototype", parm); - pedwarn ("%Hprototype declaration", - ¤t_function_prototype_locus); + /* ??? Is it possible to get here with a + built-in prototype or will it always have + been diagnosed as conflicting with an + old-style definition and discarded? */ + if (current_function_prototype_built_in) + warning (0, "promoted argument %qD " + "doesn%'t match built-in prototype", parm); + else + { + pedwarn ("promoted argument %qD " + "doesn%'t match prototype", parm); + pedwarn ("%Hprototype declaration", + ¤t_function_prototype_locus); + } } } else { - error ("argument \"%D\" doesn't match prototype", parm); - error ("%Hprototype declaration", - ¤t_function_prototype_locus); + if (current_function_prototype_built_in) + warning (0, "argument %qD doesn%'t match " + "built-in prototype", parm); + else + { + error ("argument %qD doesn%'t match prototype", parm); + error ("%Hprototype declaration", + ¤t_function_prototype_locus); + } } } } @@ -5986,12 +6567,22 @@ store_parm_decls_oldstyle (void) will be a variant of the main variant of the original function type. */ - TREE_TYPE (fndecl) = build_type_copy (TREE_TYPE (fndecl)); + TREE_TYPE (fndecl) = build_variant_type_copy (TREE_TYPE (fndecl)); TYPE_ACTUAL_ARG_TYPES (TREE_TYPE (fndecl)) = actual; } } +/* Store parameter declarations passed in ARG_INFO into the current + function declaration. */ + +void +store_parm_decls_from (struct c_arg_info *arg_info) +{ + current_function_arg_info = arg_info; + store_parm_decls (); +} + /* Store the parameter declarations into the current function declaration. This is called after parsing the parameter declarations, before digesting the body of the function. @@ -6003,46 +6594,79 @@ void store_parm_decls (void) { tree fndecl = current_function_decl; + bool proto; - /* True if this definition is written with a prototype. */ - bool prototype = (current_function_parms - && TREE_CODE (current_function_parms) != TREE_LIST); + /* The argument information block for FNDECL. */ + struct c_arg_info *arg_info = current_function_arg_info; + current_function_arg_info = 0; - if (prototype) - store_parm_decls_newstyle (); + /* True if this definition is written with a prototype. Note: + despite C99 6.7.5.3p14, we can *not* treat an empty argument + list in a function definition as equivalent to (void) -- an + empty argument list specifies the function has no parameters, + but only (void) sets up a prototype for future calls. */ + proto = arg_info->types != 0; + + if (proto) + store_parm_decls_newstyle (fndecl, arg_info); else - store_parm_decls_oldstyle (); + store_parm_decls_oldstyle (fndecl, arg_info); - /* The next call to pushlevel will be a function body. */ + /* The next call to push_scope will be a function body. */ next_is_function_body = true; /* Write a record describing this function definition to the prototypes file (if requested). */ - gen_aux_info_record (fndecl, 1, 0, prototype); + gen_aux_info_record (fndecl, 1, 0, proto); /* Initialize the RTL code for the function. */ allocate_struct_function (fndecl); /* Begin the statement tree for this function. */ - begin_stmt_tree (&DECL_SAVED_TREE (fndecl)); + DECL_SAVED_TREE (fndecl) = push_stmt_list (); - /* Save away the sizes of any variable-size types so that we can - expand them when generating RTL. */ - DECL_LANG_SPECIFIC (fndecl)->pending_sizes = get_pending_sizes (); - - /* This function is being processed in whole-function mode. */ - cfun->x_whole_function_mode_p = 1; + /* ??? Insert the contents of the pending sizes list into the function + to be evaluated. The only reason left to have this is + void foo(int n, int array[n++]) + because we throw away the array type in favor of a pointer type, and + thus won't naturally see the SAVE_EXPR containing the increment. All + other pending sizes would be handled by gimplify_parameters. */ + { + tree t; + for (t = nreverse (get_pending_sizes ()); t ; t = TREE_CHAIN (t)) + add_stmt (TREE_VALUE (t)); + } /* Even though we're inside a function body, we still don't want to call expand_expr to calculate the size of a variable-sized array. We haven't necessarily assigned RTL to all variables yet, so it's not safe to try to expand expressions involving them. */ - immediate_size_expand = 0; cfun->x_dont_save_pending_sizes_p = 1; } +/* Emit diagnostics that require gimple input for detection. Operate on + FNDECL and all its nested functions. */ + +static void +c_gimple_diagnostics_recursively (tree fndecl) +{ + struct cgraph_node *cgn; + + /* Handle attribute((warn_unused_result)). Relies on gimple input. */ + c_warn_unused_result (&DECL_SAVED_TREE (fndecl)); + + /* Notice when OpenMP structured block constraints are violated. */ + if (flag_openmp) + diagnose_omp_structured_block_errors (fndecl); + + /* Finalize all nested functions now. */ + cgn = cgraph_node (fndecl); + for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) + c_gimple_diagnostics_recursively (cgn->decl); +} + /* Finish up a function declaration and compile that function all the way to assembler language output. The free the storage for the function definition. @@ -6054,33 +6678,20 @@ finish_function (void) { tree fndecl = current_function_decl; - /* When a function declaration is totally empty, e.g. - void foo(void) { } - (the argument list is irrelevant) the compstmt rule will not - bother calling pushlevel/poplevel, which means we get here with - the scope stack out of sync. Detect this situation by noticing - that current_scope is still as store_parm_decls left it, and do - a dummy push/pop to get back to consistency. - Note that the call to pushlevel does not actually push another - scope - see there for details. */ - - if (current_scope->parm_flag && next_is_function_body) - { - pushlevel (0); - poplevel (0, 0, 0); - } + label_context_stack_se = label_context_stack_se->next; + label_context_stack_vm = label_context_stack_vm->next; if (TREE_CODE (fndecl) == FUNCTION_DECL && targetm.calls.promote_prototypes (TREE_TYPE (fndecl))) { tree args = DECL_ARGUMENTS (fndecl); for (; args; args = TREE_CHAIN (args)) - { - tree type = TREE_TYPE (args); - if (INTEGRAL_TYPE_P (type) - && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) - DECL_ARG_TYPE (args) = integer_type_node; - } + { + tree type = TREE_TYPE (args); + if (INTEGRAL_TYPE_P (type) + && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)) + DECL_ARG_TYPE (args) = integer_type_node; + } } if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node) @@ -6099,30 +6710,41 @@ finish_function (void) /* If warn_main is 1 (-Wmain) or 2 (-Wall), we have already warned. If warn_main is -1 (-Wno-main) we don't want to be warned. */ if (!warn_main) - pedwarn ("%Jreturn type of '%D' is not `int'", fndecl, fndecl); + pedwarn ("return type of %q+D is not %", fndecl); } else { -#ifdef DEFAULT_MAIN_RETURN - /* Make it so that `main' always returns success by default. */ - DEFAULT_MAIN_RETURN; -#else if (flag_isoc99) - c_expand_return (integer_zero_node); + { + tree stmt = c_finish_return (integer_zero_node); +#ifdef USE_MAPPED_LOCATION + /* Hack. We don't want the middle-end to warn that this return + is unreachable, so we mark its location as special. Using + UNKNOWN_LOCATION has the problem that it gets clobbered in + annotate_one_with_locus. A cleaner solution might be to + ensure ! should_carry_locus_p (stmt), but that needs a flag. + */ + SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION); +#else + /* Hack. We don't want the middle-end to warn that this + return is unreachable, so put the statement on the + special line 0. */ + annotate_with_file_line (stmt, input_filename, 0); #endif + } } } - finish_fname_decls (); - /* Tie off the statement tree for this function. */ - finish_stmt_tree (&DECL_SAVED_TREE (fndecl)); + DECL_SAVED_TREE (fndecl) = pop_stmt_list (DECL_SAVED_TREE (fndecl)); + + finish_fname_decls (); /* Complain if there's just no return statement. */ if (warn_return_type && TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE && !current_function_returns_value && !current_function_returns_null - /* Don't complain if we abort. */ + /* Don't complain if we are no-return. */ && !current_function_returns_abnormally /* Don't warn for main(). */ && !MAIN_NAME_P (DECL_NAME (fndecl)) @@ -6131,111 +6753,116 @@ finish_function (void) /* Normally, with -Wreturn-type, flow will complain. Unless we're an inline function, as we might never be compiled separately. */ && DECL_INLINE (fndecl)) - warning ("no return statement in function returning non-void"); + { + warning (OPT_Wreturn_type, + "no return statement in function returning non-void"); + TREE_NO_WARNING (fndecl) = 1; + } /* With just -Wextra, complain only if function returns both with and without a value. */ if (extra_warnings && current_function_returns_value && current_function_returns_null) - warning ("this function may return with or without a value"); + warning (OPT_Wextra, "this function may return with or without a value"); - /* We're leaving the context of this function, so zap cfun. It's still in - DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */ + /* Store the end of the function, so that we get good line number + info for the epilogue. */ + cfun->function_end_locus = input_location; + + /* If we don't have ctors/dtors sections, and this is a static + constructor or destructor, it must be recorded now. */ + if (DECL_STATIC_CONSTRUCTOR (fndecl) + && !targetm.have_ctors_dtors) + static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); + if (DECL_STATIC_DESTRUCTOR (fndecl) + && !targetm.have_ctors_dtors) + static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); + + /* Finalize the ELF visibility for the function. */ + c_determine_visibility (fndecl); + + /* Genericize before inlining. Delay genericizing nested functions + until their parent function is genericized. Since finalizing + requires GENERIC, delay that as well. */ + + if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node + && !undef_nested_function) + { + if (!decl_function_context (fndecl)) + { + c_genericize (fndecl); + c_gimple_diagnostics_recursively (fndecl); + + /* ??? Objc emits functions after finalizing the compilation unit. + This should be cleaned up later and this conditional removed. */ + if (cgraph_global_info_ready) + { + c_expand_body (fndecl); + return; + } + + cgraph_finalize_function (fndecl, false); + } + else + { + /* Register this function with cgraph just far enough to get it + added to our parent's nested function list. Handy, since the + C front end doesn't have such a list. */ + (void) cgraph_node (fndecl); + } + } + + if (!decl_function_context (fndecl)) + undef_nested_function = false; + + /* We're leaving the context of this function, so zap cfun. + It's still in DECL_STRUCT_FUNCTION, and we'll restore it in + tree_rest_of_compilation. */ cfun = NULL; - - /* ??? Objc emits functions after finalizing the compilation unit. - This should be cleaned up later and this conditional removed. */ - if (!cgraph_global_info_ready) - cgraph_finalize_function (fndecl, false); - else - c_expand_body (fndecl); current_function_decl = NULL; } -/* Generate the RTL for a deferred function FNDECL. */ - -void -c_expand_deferred_function (tree fndecl) -{ - /* DECL_INLINE or DECL_RESULT might got cleared after the inline - function was deferred, e.g. in duplicate_decls. */ - if (DECL_INLINE (fndecl) && DECL_RESULT (fndecl)) - { - if (flag_inline_trees) - { - timevar_push (TV_INTEGRATION); - optimize_inline_calls (fndecl); - timevar_pop (TV_INTEGRATION); - } - c_expand_body (fndecl); - current_function_decl = NULL; - } -} - -/* Generate the RTL for the body of FNDECL. If NESTED_P is nonzero, - then we are already in the process of generating RTL for another - function. */ - -static void -c_expand_body_1 (tree fndecl, int nested_p) -{ - if (nested_p) - /* Squirrel away our current state. */ - push_function_context (); - - /* Make sure that we will evaluate variable-sized types involved - in our function's type. */ - put_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes); - tree_rest_of_compilation (fndecl, nested_p); - - if (nested_p) - /* Return to the enclosing function. */ - pop_function_context (); - - if (DECL_STATIC_CONSTRUCTOR (fndecl)) - { - if (targetm.have_ctors_dtors) - (* targetm.asm_out.constructor) (XEXP (DECL_RTL (fndecl), 0), - DEFAULT_INIT_PRIORITY); - else - static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors); - } - - if (DECL_STATIC_DESTRUCTOR (fndecl)) - { - if (targetm.have_ctors_dtors) - (* targetm.asm_out.destructor) (XEXP (DECL_RTL (fndecl), 0), - DEFAULT_INIT_PRIORITY); - else - static_dtors = tree_cons (NULL_TREE, fndecl, static_dtors); - } -} - -/* Like c_expand_body_1 but only for unnested functions. */ +/* Generate the RTL for the body of FNDECL. */ void c_expand_body (tree fndecl) { - if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node) - c_expand_body_1 (fndecl, 0); + if (!DECL_INITIAL (fndecl) + || DECL_INITIAL (fndecl) == error_mark_node) + return; + + tree_rest_of_compilation (fndecl); + + if (DECL_STATIC_CONSTRUCTOR (fndecl) + && targetm.have_ctors_dtors) + targetm.asm_out.constructor (XEXP (DECL_RTL (fndecl), 0), + DEFAULT_INIT_PRIORITY); + if (DECL_STATIC_DESTRUCTOR (fndecl) + && targetm.have_ctors_dtors) + targetm.asm_out.destructor (XEXP (DECL_RTL (fndecl), 0), + DEFAULT_INIT_PRIORITY); } /* Check the declarations given in a for-loop for satisfying the C99 - constraints. */ -void + constraints. If exactly one such decl is found, return it. */ + +tree check_for_loop_decls (void) { - tree t; + struct c_binding *b; + tree one_decl = NULL_TREE; + int n_decls = 0; + if (!flag_isoc99) { /* If we get here, declarations have been used in a for loop without the C99 for loop scope. This doesn't make much sense, so don't allow it. */ - error ("'for' loop initial declaration used outside C99 mode"); - return; + error ("% loop initial declaration used outside C99 mode"); + return NULL_TREE; } /* C99 subclause 6.8.5 paragraph 3: @@ -6251,36 +6878,47 @@ check_for_loop_decls (void) interpretation, to avoid creating an extension which later causes problems. */ - for (t = current_scope->tags; t; t = TREE_CHAIN (t)) + for (b = current_scope->bindings; b; b = b->prev) { - if (TREE_PURPOSE (t) != 0) - { - enum tree_code code = TREE_CODE (TREE_VALUE (t)); + tree id = b->id; + tree decl = b->decl; - if (code == RECORD_TYPE) - error ("'struct %s' declared in 'for' loop initial declaration", - IDENTIFIER_POINTER (TREE_PURPOSE (t))); - else if (code == UNION_TYPE) - error ("'union %s' declared in 'for' loop initial declaration", - IDENTIFIER_POINTER (TREE_PURPOSE (t))); - else - error ("'enum %s' declared in 'for' loop initial declaration", - IDENTIFIER_POINTER (TREE_PURPOSE (t))); - } + if (!id) + continue; + + switch (TREE_CODE (decl)) + { + case VAR_DECL: + if (TREE_STATIC (decl)) + error ("declaration of static variable %q+D in % loop " + "initial declaration", decl); + else if (DECL_EXTERNAL (decl)) + error ("declaration of % variable %q+D in % loop " + "initial declaration", decl); + break; + + case RECORD_TYPE: + error ("% declared in % loop initial declaration", + id); + break; + case UNION_TYPE: + error ("% declared in % loop initial declaration", + id); + break; + case ENUMERAL_TYPE: + error ("% declared in % loop initial declaration", + id); + break; + default: + error ("declaration of non-variable %q+D in % loop " + "initial declaration", decl); + } + + n_decls++; + one_decl = decl; } - for (t = getdecls (); t; t = TREE_CHAIN (t)) - { - if (TREE_CODE (t) != VAR_DECL && DECL_NAME (t)) - error ("%Jdeclaration of non-variable '%D' in 'for' loop " - "initial declaration", t, t); - else if (TREE_STATIC (t)) - error ("%Jdeclaration of static variable '%D' in 'for' loop " - "initial declaration", t, t); - else if (DECL_EXTERNAL (t)) - error ("%Jdeclaration of 'extern' variable '%D' in 'for' loop " - "initial declaration", t, t); - } + return n_decls == 1 ? one_decl : NULL_TREE; } /* Save and reinitialize the variables @@ -6290,13 +6928,14 @@ void c_push_function_context (struct function *f) { struct language_function *p; - p = ggc_alloc (sizeof (struct language_function)); + p = GGC_NEW (struct language_function); f->language = p; p->base.x_stmt_tree = c_stmt_tree; - p->base.x_scope_stmt_stack = c_scope_stmt_stack; - p->x_in_iteration_stmt = c_in_iteration_stmt; - p->x_in_case_stmt = c_in_case_stmt; + p->x_break_label = c_break_label; + p->x_cont_label = c_cont_label; + p->x_switch_stack = c_switch_stack; + p->arg_info = current_function_arg_info; p->returns_value = current_function_returns_value; p->returns_null = current_function_returns_null; p->returns_abnormally = current_function_returns_abnormally; @@ -6311,7 +6950,7 @@ c_pop_function_context (struct function *f) { struct language_function *p = f->language; - if (DECL_SAVED_INSNS (current_function_decl) == 0 + if (DECL_STRUCT_FUNCTION (current_function_decl) == 0 && DECL_SAVED_TREE (current_function_decl) == NULL_TREE) { /* Stop pointing to the local nodes about to be freed. */ @@ -6322,9 +6961,10 @@ c_pop_function_context (struct function *f) } c_stmt_tree = p->base.x_stmt_tree; - c_scope_stmt_stack = p->base.x_scope_stmt_stack; - c_in_iteration_stmt = p->x_in_iteration_stmt; - c_in_case_stmt = p->x_in_case_stmt; + c_break_label = p->x_break_label; + c_cont_label = p->x_cont_label; + c_switch_stack = p->x_switch_stack; + current_function_arg_info = p->arg_info; current_function_returns_value = p->returns_value; current_function_returns_null = p->returns_null; current_function_returns_abnormally = p->returns_abnormally; @@ -6344,7 +6984,7 @@ c_dup_lang_specific_decl (tree decl) if (!DECL_LANG_SPECIFIC (decl)) return; - ld = ggc_alloc (sizeof (struct lang_decl)); + ld = GGC_NEW (struct lang_decl); memcpy (ld, DECL_LANG_SPECIFIC (decl), sizeof (struct lang_decl)); DECL_LANG_SPECIFIC (decl) = ld; } @@ -6354,16 +6994,6 @@ c_dup_lang_specific_decl (tree decl) functions are not called from anywhere in the C front end, but as these changes continue, that will change. */ -/* Returns nonzero if the current statement is a full expression, - i.e. temporaries created during that statement should be destroyed - at the end of the statement. */ - -int -stmts_are_full_exprs_p (void) -{ - return 0; -} - /* Returns the stmt_tree (if any) to which statements are currently being added. If there is no active statement-tree, NULL is returned. */ @@ -6374,74 +7004,26 @@ current_stmt_tree (void) return &c_stmt_tree; } -/* Returns the stack of SCOPE_STMTs for the current function. */ - -tree * -current_scope_stmt_stack (void) -{ - return &c_scope_stmt_stack; -} - /* Nonzero if TYPE is an anonymous union or struct type. Always 0 in C. */ int -anon_aggr_type_p (tree node ATTRIBUTE_UNUSED) +anon_aggr_type_p (tree ARG_UNUSED (node)) { return 0; } -/* Dummy function in place of callback used by C++. */ - -void -extract_interface_info (void) -{ -} - -/* Return a new COMPOUND_STMT, after adding it to the current - statement tree. */ - -tree -c_begin_compound_stmt (void) -{ - tree stmt; - - /* Create the COMPOUND_STMT. */ - stmt = add_stmt (build_stmt (COMPOUND_STMT, error_mark_node)); - - return stmt; -} - -/* Expand T (a DECL_STMT) if it declares an entity not handled by the - common code. */ - -void -c_expand_decl_stmt (tree t) -{ - tree decl = DECL_STMT_DECL (t); - - /* Expand nested functions. */ - if (TREE_CODE (decl) == FUNCTION_DECL - && DECL_CONTEXT (decl) == current_function_decl - && DECL_SAVED_TREE (decl)) - c_expand_body_1 (decl, 1); -} - /* Return the global value of T as a symbol. */ tree identifier_global_value (tree t) { - tree decl = IDENTIFIER_SYMBOL_VALUE (t); - if (decl == 0 || DECL_FILE_SCOPE_P (decl)) - return decl; + struct c_binding *b; - /* Shadowed by something else; find the true global value. */ - for (decl = global_scope->names; decl; decl = TREE_CHAIN (decl)) - if (DECL_NAME (decl) == t) - return decl; + for (b = I_SYMBOL_BINDING (t); b; b = b->shadowed) + if (B_IN_FILE_SCOPE (b) || B_IN_EXTERNAL_SCOPE (b)) + return b->decl; - /* Only local values for this decl. */ return 0; } @@ -6451,12 +7033,15 @@ identifier_global_value (tree t) void record_builtin_type (enum rid rid_index, const char *name, tree type) { - tree id; + tree id, decl; if (name == 0) id = ridpointers[(int) rid_index]; else id = get_identifier (name); - pushdecl (build_decl (TYPE_DECL, id, type)); + decl = build_decl (TYPE_DECL, id, type); + pushdecl (decl); + if (debug_hooks->type_decl) + debug_hooks->type_decl (decl, false); } /* Build the void_list_node (void_type_node having been created). */ @@ -6467,214 +7052,916 @@ build_void_list_node (void) return t; } +/* Return a c_parm structure with the given SPECS, ATTRS and DECLARATOR. */ + +struct c_parm * +build_c_parm (struct c_declspecs *specs, tree attrs, + struct c_declarator *declarator) +{ + struct c_parm *ret = XOBNEW (&parser_obstack, struct c_parm); + ret->specs = specs; + ret->attrs = attrs; + ret->declarator = declarator; + return ret; +} + +/* Return a declarator with nested attributes. TARGET is the inner + declarator to which these attributes apply. ATTRS are the + attributes. */ + +struct c_declarator * +build_attrs_declarator (tree attrs, struct c_declarator *target) +{ + struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); + ret->kind = cdk_attrs; + ret->declarator = target; + ret->u.attrs = attrs; + return ret; +} + +/* Return a declarator for a function with arguments specified by ARGS + and return type specified by TARGET. */ + +struct c_declarator * +build_function_declarator (struct c_arg_info *args, + struct c_declarator *target) +{ + struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); + ret->kind = cdk_function; + ret->declarator = target; + ret->u.arg_info = args; + return ret; +} + +/* Return a declarator for the identifier IDENT (which may be + NULL_TREE for an abstract declarator). */ + +struct c_declarator * +build_id_declarator (tree ident) +{ + struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); + ret->kind = cdk_id; + ret->declarator = 0; + ret->u.id = ident; + /* Default value - may get reset to a more precise location. */ + ret->id_loc = input_location; + return ret; +} + /* Return something to represent absolute declarators containing a *. TARGET is the absolute declarator that the * contains. - TYPE_QUALS_ATTRS is a list of modifiers such as const or volatile - to apply to the pointer type, represented as identifiers, possible mixed - with attributes. + TYPE_QUALS_ATTRS is a structure for type qualifiers and attributes + to apply to the pointer type. */ - We return an INDIRECT_REF whose "contents" are TARGET (inside a TREE_LIST, - if attributes are present) and whose type is the modifier list. */ - -tree -make_pointer_declarator (tree type_quals_attrs, tree target) +struct c_declarator * +make_pointer_declarator (struct c_declspecs *type_quals_attrs, + struct c_declarator *target) { - tree quals, attrs; - tree itarget = target; - split_specs_attrs (type_quals_attrs, &quals, &attrs); - if (attrs != NULL_TREE) - itarget = tree_cons (attrs, target, NULL_TREE); - return build1 (INDIRECT_REF, quals, itarget); + tree attrs; + int quals = 0; + struct c_declarator *itarget = target; + struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); + if (type_quals_attrs) + { + attrs = type_quals_attrs->attrs; + quals = quals_from_declspecs (type_quals_attrs); + if (attrs != NULL_TREE) + itarget = build_attrs_declarator (attrs, target); + } + ret->kind = cdk_pointer; + ret->declarator = itarget; + ret->u.pointer_quals = quals; + return ret; } -/* A wrapper around lhd_set_decl_assembler_name that gives static - variables their C names if they are at file scope and only one - translation unit is being compiled, for backwards compatibility - with certain bizarre assembler hacks (like crtstuff.c). */ +/* Return a pointer to a structure for an empty list of declaration + specifiers. */ -void -c_static_assembler_name (tree decl) +struct c_declspecs * +build_null_declspecs (void) { - if (num_in_fnames == 1 - && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl) - && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL) - SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl)); - else - lhd_set_decl_assembler_name (decl); + struct c_declspecs *ret = XOBNEW (&parser_obstack, struct c_declspecs); + ret->type = 0; + ret->decl_attr = 0; + ret->attrs = 0; + ret->typespec_word = cts_none; + ret->storage_class = csc_none; + ret->declspecs_seen_p = false; + ret->type_seen_p = false; + ret->non_sc_seen_p = false; + ret->typedef_p = false; + ret->tag_defined_p = false; + ret->explicit_signed_p = false; + ret->deprecated_p = false; + ret->default_int_p = false; + ret->long_p = false; + ret->long_long_p = false; + ret->short_p = false; + ret->signed_p = false; + ret->unsigned_p = false; + ret->complex_p = false; + ret->inline_p = false; + ret->thread_p = false; + ret->const_p = false; + ret->volatile_p = false; + ret->restrict_p = false; + return ret; } -/* Hash and equality functions for link_hash_table: key off - DECL_ASSEMBLER_NAME. */ +/* Add the type qualifier QUAL to the declaration specifiers SPECS, + returning SPECS. */ -static hashval_t -link_hash_hash (const void *x_p) +struct c_declspecs * +declspecs_add_qual (struct c_declspecs *specs, tree qual) { - tree x = (tree)x_p; - return (hashval_t) (long)DECL_ASSEMBLER_NAME (x); + enum rid i; + bool dupe = false; + specs->non_sc_seen_p = true; + specs->declspecs_seen_p = true; + gcc_assert (TREE_CODE (qual) == IDENTIFIER_NODE + && C_IS_RESERVED_WORD (qual)); + i = C_RID_CODE (qual); + switch (i) + { + case RID_CONST: + dupe = specs->const_p; + specs->const_p = true; + break; + case RID_VOLATILE: + dupe = specs->volatile_p; + specs->volatile_p = true; + break; + case RID_RESTRICT: + dupe = specs->restrict_p; + specs->restrict_p = true; + break; + default: + gcc_unreachable (); + } + if (dupe && pedantic && !flag_isoc99) + pedwarn ("duplicate %qE", qual); + return specs; } -static int -link_hash_eq (const void *x1_p, const void *x2_p) +/* Add the type specifier TYPE to the declaration specifiers SPECS, + returning SPECS. */ + +struct c_declspecs * +declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec) { - tree x1 = (tree)x1_p; - tree x2 = (tree)x2_p; - return DECL_ASSEMBLER_NAME (x1) == DECL_ASSEMBLER_NAME (x2); + tree type = spec.spec; + specs->non_sc_seen_p = true; + specs->declspecs_seen_p = true; + specs->type_seen_p = true; + if (TREE_DEPRECATED (type)) + specs->deprecated_p = true; + + /* Handle type specifier keywords. */ + if (TREE_CODE (type) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (type)) + { + enum rid i = C_RID_CODE (type); + if (specs->type) + { + error ("two or more data types in declaration specifiers"); + return specs; + } + if ((int) i <= (int) RID_LAST_MODIFIER) + { + /* "long", "short", "signed", "unsigned" or "_Complex". */ + bool dupe = false; + switch (i) + { + case RID_LONG: + if (specs->long_long_p) + { + error ("% is too long for GCC"); + break; + } + if (specs->long_p) + { + if (specs->typespec_word == cts_double) + { + error ("both % and % in " + "declaration specifiers"); + break; + } + if (pedantic && !flag_isoc99 && !in_system_header + && warn_long_long) + pedwarn ("ISO C90 does not support %"); + specs->long_long_p = 1; + break; + } + if (specs->short_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_void) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_bool) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_char) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_float) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat32) + error ("both % and %<_Decimal32%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat64) + error ("both % and %<_Decimal64%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat128) + error ("both % and %<_Decimal128%> in " + "declaration specifiers"); + else + specs->long_p = true; + break; + case RID_SHORT: + dupe = specs->short_p; + if (specs->long_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_void) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_bool) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_char) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_float) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_double) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat32) + error ("both % and %<_Decimal32%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat64) + error ("both % and %<_Decimal64%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat128) + error ("both % and %<_Decimal128%> in " + "declaration specifiers"); + else + specs->short_p = true; + break; + case RID_SIGNED: + dupe = specs->signed_p; + if (specs->unsigned_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_void) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_bool) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_float) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_double) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat32) + error ("both % and %<_Decimal32%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat64) + error ("both % and %<_Decimal64%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat128) + error ("both % and %<_Decimal128%> in " + "declaration specifiers"); + else + specs->signed_p = true; + break; + case RID_UNSIGNED: + dupe = specs->unsigned_p; + if (specs->signed_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_void) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_bool) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_float) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_double) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat32) + error ("both % and %<_Decimal32%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat64) + error ("both % and %<_Decimal64%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat128) + error ("both % and %<_Decimal128%> in " + "declaration specifiers"); + else + specs->unsigned_p = true; + break; + case RID_COMPLEX: + dupe = specs->complex_p; + if (pedantic && !flag_isoc99 && !in_system_header) + pedwarn ("ISO C90 does not support complex types"); + if (specs->typespec_word == cts_void) + error ("both % and % in " + "declaration specifiers"); + else if (specs->typespec_word == cts_bool) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat32) + error ("both % and %<_Decimal32%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat64) + error ("both % and %<_Decimal64%> in " + "declaration specifiers"); + else if (specs->typespec_word == cts_dfloat128) + error ("both % and %<_Decimal128%> in " + "declaration specifiers"); + else + specs->complex_p = true; + break; + default: + gcc_unreachable (); + } + + if (dupe) + error ("duplicate %qE", type); + + return specs; + } + else + { + /* "void", "_Bool", "char", "int", "float" or "double". */ + if (specs->typespec_word != cts_none) + { + error ("two or more data types in declaration specifiers"); + return specs; + } + switch (i) + { + case RID_VOID: + if (specs->long_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->short_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->signed_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->unsigned_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->complex_p) + error ("both % and % in " + "declaration specifiers"); + else + specs->typespec_word = cts_void; + return specs; + case RID_BOOL: + if (specs->long_p) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->short_p) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->signed_p) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->unsigned_p) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else if (specs->complex_p) + error ("both % and %<_Bool%> in " + "declaration specifiers"); + else + specs->typespec_word = cts_bool; + return specs; + case RID_CHAR: + if (specs->long_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->short_p) + error ("both % and % in " + "declaration specifiers"); + else + specs->typespec_word = cts_char; + return specs; + case RID_INT: + specs->typespec_word = cts_int; + return specs; + case RID_FLOAT: + if (specs->long_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->short_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->signed_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->unsigned_p) + error ("both % and % in " + "declaration specifiers"); + else + specs->typespec_word = cts_float; + return specs; + case RID_DOUBLE: + if (specs->long_long_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->short_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->signed_p) + error ("both % and % in " + "declaration specifiers"); + else if (specs->unsigned_p) + error ("both % and % in " + "declaration specifiers"); + else + specs->typespec_word = cts_double; + return specs; + case RID_DFLOAT32: + case RID_DFLOAT64: + case RID_DFLOAT128: + { + const char *str; + if (i == RID_DFLOAT32) + str = "_Decimal32"; + else if (i == RID_DFLOAT64) + str = "_Decimal64"; + else + str = "_Decimal128"; + if (specs->long_long_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + if (specs->long_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + else if (specs->short_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + else if (specs->signed_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + else if (specs->unsigned_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + else if (specs->complex_p) + error ("both % and %<%s%> in " + "declaration specifiers", str); + else if (i == RID_DFLOAT32) + specs->typespec_word = cts_dfloat32; + else if (i == RID_DFLOAT64) + specs->typespec_word = cts_dfloat64; + else + specs->typespec_word = cts_dfloat128; + } + if (!targetm.decimal_float_supported_p ()) + error ("decimal floating point not supported for this target"); + if (pedantic) + pedwarn ("ISO C does not support decimal floating point"); + return specs; + default: + /* ObjC reserved word "id", handled below. */ + break; + } + } + } + + /* Now we have a typedef (a TYPE_DECL node), an identifier (some + form of ObjC type, cases such as "int" and "long" being handled + above), a TYPE (struct, union, enum and typeof specifiers) or an + ERROR_MARK. In none of these cases may there have previously + been any type specifiers. */ + if (specs->type || specs->typespec_word != cts_none + || specs->long_p || specs->short_p || specs->signed_p + || specs->unsigned_p || specs->complex_p) + error ("two or more data types in declaration specifiers"); + else if (TREE_CODE (type) == TYPE_DECL) + { + if (TREE_TYPE (type) == error_mark_node) + ; /* Allow the type to default to int to avoid cascading errors. */ + else + { + specs->type = TREE_TYPE (type); + specs->decl_attr = DECL_ATTRIBUTES (type); + specs->typedef_p = true; + specs->explicit_signed_p = C_TYPEDEF_EXPLICITLY_SIGNED (type); + } + } + else if (TREE_CODE (type) == IDENTIFIER_NODE) + { + tree t = lookup_name (type); + if (!t || TREE_CODE (t) != TYPE_DECL) + error ("%qE fails to be a typedef or built in type", type); + else if (TREE_TYPE (t) == error_mark_node) + ; + else + specs->type = TREE_TYPE (t); + } + else if (TREE_CODE (type) != ERROR_MARK) + { + if (spec.kind == ctsk_tagdef || spec.kind == ctsk_tagfirstref) + specs->tag_defined_p = true; + if (spec.kind == ctsk_typeof) + specs->typedef_p = true; + specs->type = type; + } + + return specs; } -/* Propagate information between definitions and uses between multiple - translation units in TU_LIST based on linkage rules. */ +/* Add the storage class specifier or function specifier SCSPEC to the + declaration specifiers SPECS, returning SPECS. */ -void -merge_translation_unit_decls (void) +struct c_declspecs * +declspecs_add_scspec (struct c_declspecs *specs, tree scspec) { - const tree tu_list = current_file_decl; - tree tu; - tree decl; - htab_t link_hash_table; - tree block; + enum rid i; + enum c_storage_class n = csc_none; + bool dupe = false; + specs->declspecs_seen_p = true; + gcc_assert (TREE_CODE (scspec) == IDENTIFIER_NODE + && C_IS_RESERVED_WORD (scspec)); + i = C_RID_CODE (scspec); + if (extra_warnings && specs->non_sc_seen_p) + warning (OPT_Wextra, "%qE is not at beginning of declaration", scspec); + switch (i) + { + case RID_INLINE: + /* C99 permits duplicate inline. Although of doubtful utility, + it seems simplest to permit it in gnu89 mode as well, as + there is also little utility in maintaining this as a + difference between gnu89 and C99 inline. */ + dupe = false; + specs->inline_p = true; + break; + case RID_THREAD: + dupe = specs->thread_p; + if (specs->storage_class == csc_auto) + error ("%<__thread%> used with %"); + else if (specs->storage_class == csc_register) + error ("%<__thread%> used with %"); + else if (specs->storage_class == csc_typedef) + error ("%<__thread%> used with %"); + else + specs->thread_p = true; + break; + case RID_AUTO: + n = csc_auto; + break; + case RID_EXTERN: + n = csc_extern; + /* Diagnose "__thread extern". */ + if (specs->thread_p) + error ("%<__thread%> before %"); + break; + case RID_REGISTER: + n = csc_register; + break; + case RID_STATIC: + n = csc_static; + /* Diagnose "__thread static". */ + if (specs->thread_p) + error ("%<__thread%> before %"); + break; + case RID_TYPEDEF: + n = csc_typedef; + break; + default: + gcc_unreachable (); + } + if (n != csc_none && n == specs->storage_class) + dupe = true; + if (dupe) + error ("duplicate %qE", scspec); + if (n != csc_none) + { + if (specs->storage_class != csc_none && n != specs->storage_class) + { + error ("multiple storage classes in declaration specifiers"); + } + else + { + specs->storage_class = n; + if (n != csc_extern && n != csc_static && specs->thread_p) + { + error ("%<__thread%> used with %qE", scspec); + specs->thread_p = false; + } + } + } + return specs; +} - /* Create the BLOCK that poplevel would have created, but don't - actually call poplevel since that's expensive. */ - block = make_node (BLOCK); - BLOCK_VARS (block) = current_scope->names; - TREE_USED (block) = 1; - DECL_INITIAL (current_file_decl) = block; +/* Add the attributes ATTRS to the declaration specifiers SPECS, + returning SPECS. */ - /* If only one translation unit seen, no copying necessary. */ - if (TREE_CHAIN (tu_list) == NULL_TREE) +struct c_declspecs * +declspecs_add_attrs (struct c_declspecs *specs, tree attrs) +{ + specs->attrs = chainon (attrs, specs->attrs); + specs->declspecs_seen_p = true; + return specs; +} + +/* Combine "long", "short", "signed", "unsigned" and "_Complex" type + specifiers with any other type specifier to determine the resulting + type. This is where ISO C checks on complex types are made, since + "_Complex long" is a prefix of the valid ISO C type "_Complex long + double". */ + +struct c_declspecs * +finish_declspecs (struct c_declspecs *specs) +{ + /* If a type was specified as a whole, we have no modifiers and are + done. */ + if (specs->type != NULL_TREE) + { + gcc_assert (!specs->long_p && !specs->long_long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p + && !specs->complex_p); + return specs; + } + + /* If none of "void", "_Bool", "char", "int", "float" or "double" + has been specified, treat it as "int" unless "_Complex" is + present and there are no other specifiers. If we just have + "_Complex", it is equivalent to "_Complex double", but e.g. + "_Complex short" is equivalent to "_Complex short int". */ + if (specs->typespec_word == cts_none) + { + if (specs->long_p || specs->short_p + || specs->signed_p || specs->unsigned_p) + { + specs->typespec_word = cts_int; + } + else if (specs->complex_p) + { + specs->typespec_word = cts_double; + if (pedantic) + pedwarn ("ISO C does not support plain % meaning " + "%"); + } + else + { + specs->typespec_word = cts_int; + specs->default_int_p = true; + /* We don't diagnose this here because grokdeclarator will + give more specific diagnostics according to whether it is + a function definition. */ + } + } + + /* If "signed" was specified, record this to distinguish "int" and + "signed int" in the case of a bit-field with + -funsigned-bitfields. */ + specs->explicit_signed_p = specs->signed_p; + + /* Now compute the actual type. */ + switch (specs->typespec_word) + { + case cts_void: + gcc_assert (!specs->long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p + && !specs->complex_p); + specs->type = void_type_node; + break; + case cts_bool: + gcc_assert (!specs->long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p + && !specs->complex_p); + specs->type = boolean_type_node; + break; + case cts_char: + gcc_assert (!specs->long_p && !specs->short_p); + gcc_assert (!(specs->signed_p && specs->unsigned_p)); + if (specs->signed_p) + specs->type = signed_char_type_node; + else if (specs->unsigned_p) + specs->type = unsigned_char_type_node; + else + specs->type = char_type_node; + if (specs->complex_p) + { + if (pedantic) + pedwarn ("ISO C does not support complex integer types"); + specs->type = build_complex_type (specs->type); + } + break; + case cts_int: + gcc_assert (!(specs->long_p && specs->short_p)); + gcc_assert (!(specs->signed_p && specs->unsigned_p)); + if (specs->long_long_p) + specs->type = (specs->unsigned_p + ? long_long_unsigned_type_node + : long_long_integer_type_node); + else if (specs->long_p) + specs->type = (specs->unsigned_p + ? long_unsigned_type_node + : long_integer_type_node); + else if (specs->short_p) + specs->type = (specs->unsigned_p + ? short_unsigned_type_node + : short_integer_type_node); + else + specs->type = (specs->unsigned_p + ? unsigned_type_node + : integer_type_node); + if (specs->complex_p) + { + if (pedantic) + pedwarn ("ISO C does not support complex integer types"); + specs->type = build_complex_type (specs->type); + } + break; + case cts_float: + gcc_assert (!specs->long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p); + specs->type = (specs->complex_p + ? complex_float_type_node + : float_type_node); + break; + case cts_double: + gcc_assert (!specs->long_long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p); + if (specs->long_p) + { + specs->type = (specs->complex_p + ? complex_long_double_type_node + : long_double_type_node); + } + else + { + specs->type = (specs->complex_p + ? complex_double_type_node + : double_type_node); + } + break; + case cts_dfloat32: + case cts_dfloat64: + case cts_dfloat128: + gcc_assert (!specs->long_p && !specs->long_long_p && !specs->short_p + && !specs->signed_p && !specs->unsigned_p && !specs->complex_p); + if (specs->typespec_word == cts_dfloat32) + specs->type = dfloat32_type_node; + else if (specs->typespec_word == cts_dfloat64) + specs->type = dfloat64_type_node; + else + specs->type = dfloat128_type_node; + break; + default: + gcc_unreachable (); + } + + return specs; +} + +/* Synthesize a function which calls all the global ctors or global + dtors in this file. This is only used for targets which do not + support .ctors/.dtors sections. FIXME: Migrate into cgraph. */ +static void +build_cdtor (int method_type, tree cdtors) +{ + tree body = 0; + + if (!cdtors) return; - link_hash_table = htab_create (1021, link_hash_hash, link_hash_eq, NULL); + for (; cdtors; cdtors = TREE_CHAIN (cdtors)) + append_to_statement_list (build_function_call (TREE_VALUE (cdtors), 0), + &body); - /* Enter any actual definitions into the hash table. */ - for (tu = tu_list; tu; tu = TREE_CHAIN (tu)) - for (decl = BLOCK_VARS (DECL_INITIAL (tu)); decl; decl = TREE_CHAIN (decl)) - if (TREE_PUBLIC (decl) && ! DECL_EXTERNAL (decl)) - { - PTR *slot; - slot = htab_find_slot (link_hash_table, decl, INSERT); - - /* If we've already got a definition, work out which one is - the real one, put it into the hash table, and make the - other one DECL_EXTERNAL. This is important to avoid - putting out two definitions of the same symbol in the - assembly output. */ - if (*slot != NULL) - { - tree old_decl = (tree) *slot; - - /* If this is weak or common or whatever, suppress it - in favor of the other definition. */ - if (DECL_WEAK (decl)) - DECL_EXTERNAL (decl) = 1; - else if (DECL_WEAK (old_decl) && ! DECL_WEAK (decl)) - DECL_EXTERNAL (old_decl) = 1; - else if (DECL_COMMON (decl) || DECL_ONE_ONLY (decl)) - DECL_EXTERNAL (decl) = 1; - else if (DECL_COMMON (old_decl) || DECL_ONE_ONLY (old_decl)) - DECL_EXTERNAL (old_decl) = 1; - - if (DECL_EXTERNAL (decl)) - { - DECL_INITIAL (decl) = NULL_TREE; - DECL_COMMON (decl) = 0; - DECL_ONE_ONLY (decl) = 0; - DECL_WEAK (decl) = 0; - } - else if (DECL_EXTERNAL (old_decl)) - { - DECL_INITIAL (old_decl) = NULL_TREE; - DECL_COMMON (old_decl) = 0; - DECL_ONE_ONLY (old_decl) = 0; - DECL_WEAK (old_decl) = 0; - *slot = decl; - } - else - { - error ("%Jredefinition of global '%D'", decl, decl); - error ("%J'%D' previously defined here", old_decl, old_decl); - } - } - else - *slot = decl; - } - - /* Now insert the desired information from all the definitions - into any plain declarations. */ - for (tu = tu_list; tu; tu = TREE_CHAIN (tu)) - for (decl = BLOCK_VARS (DECL_INITIAL (tu)); decl; decl = TREE_CHAIN (decl)) - if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl)) - { - tree global_decl; - global_decl = htab_find (link_hash_table, decl); - - if (! global_decl) - continue; - - /* Print any appropriate error messages, and partially merge - the decls. */ - (void) duplicate_decls (decl, global_decl); - } - - htab_delete (link_hash_table); + cgraph_build_static_cdtor (method_type, body, DEFAULT_INIT_PRIORITY); } -/* Perform final processing on file-scope data. */ +/* A subroutine of c_write_global_declarations. Perform final processing + on one file scope's declarations (or the external scope's declarations), + GLOBALS. */ -void -c_write_global_declarations(void) +static void +c_write_global_declarations_1 (tree globals) { - tree link; + tree decl; + bool reconsider; - for (link = current_file_decl; link; link = TREE_CHAIN (link)) + /* Process the decls in the order they were written. */ + for (decl = globals; decl; decl = TREE_CHAIN (decl)) { - tree globals = BLOCK_VARS (DECL_INITIAL (link)); - int len = list_length (globals); - tree *vec = xmalloc (sizeof (tree) * len); - int i; - tree decl; + /* Check for used but undefined static functions using the C + standard's definition of "used", and set TREE_NO_WARNING so + that check_global_declarations doesn't repeat the check. */ + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_INITIAL (decl) == 0 + && DECL_EXTERNAL (decl) + && !TREE_PUBLIC (decl) + && C_DECL_USED (decl)) + { + pedwarn ("%q+F used but never defined", decl); + TREE_NO_WARNING (decl) = 1; + } - /* Process the decls in the order they were written. */ - - for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl)) - vec[i] = decl; - - wrapup_global_declarations (vec, len); - - check_global_declarations (vec, len); - - /* Clean up. */ - free (vec); + wrapup_global_declaration_1 (decl); } + + do + { + reconsider = false; + for (decl = globals; decl; decl = TREE_CHAIN (decl)) + reconsider |= wrapup_global_declaration_2 (decl); + } + while (reconsider); + + for (decl = globals; decl; decl = TREE_CHAIN (decl)) + check_global_declaration_1 (decl); } -/* Reset the parser's state in preparation for a new file. */ +/* A subroutine of c_write_global_declarations Emit debug information for each + of the declarations in GLOBALS. */ + +static void +c_write_global_declarations_2 (tree globals) +{ + tree decl; + + for (decl = globals; decl ; decl = TREE_CHAIN (decl)) + debug_hooks->global_decl (decl); +} + +/* Preserve the external declarations scope across a garbage collect. */ +static GTY(()) tree ext_block; void -c_reset_state (void) +c_write_global_declarations (void) { - tree link; - tree file_scope_decl; + tree t; - /* Pop the global scope. */ - if (current_scope != global_scope) - current_scope = global_scope; - file_scope_decl = current_file_decl; - DECL_INITIAL (file_scope_decl) = poplevel (1, 0, 0); - BLOCK_SUPERCONTEXT (DECL_INITIAL (file_scope_decl)) = file_scope_decl; - truly_local_externals = NULL_TREE; + /* We don't want to do this if generating a PCH. */ + if (pch_file) + return; - /* Start a new global binding level. */ - pushlevel (0); - global_scope = current_scope; - current_file_decl = build_decl (TRANSLATION_UNIT_DECL, NULL, NULL); - TREE_CHAIN (current_file_decl) = file_scope_decl; + /* Don't waste time on further processing if -fsyntax-only or we've + encountered errors. */ + if (flag_syntax_only || errorcount || sorrycount || cpp_errors (parse_in)) + return; - /* Reintroduce the builtin declarations. */ - for (link = first_builtin_decl; - link != TREE_CHAIN (last_builtin_decl); - link = TREE_CHAIN (link)) - pushdecl (copy_node (link)); + /* Close the external scope. */ + ext_block = pop_scope (); + external_scope = 0; + gcc_assert (!current_scope); + + if (ext_block) + { + tree tmp = BLOCK_VARS (ext_block); + int flags; + FILE * stream = dump_begin (TDI_tu, &flags); + if (stream && tmp) + { + dump_node (tmp, flags & ~TDF_SLIM, stream); + dump_end (TDI_tu, stream); + } + } + + /* Process all file scopes in this compilation, and the external_scope, + through wrapup_global_declarations and check_global_declarations. */ + for (t = all_translation_units; t; t = TREE_CHAIN (t)) + c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t))); + c_write_global_declarations_1 (BLOCK_VARS (ext_block)); + + /* Generate functions to call static constructors and destructors + for targets that do not support .ctors/.dtors sections. These + functions have magic names which are detected by collect2. */ + build_cdtor ('I', static_ctors); static_ctors = 0; + build_cdtor ('D', static_dtors); static_dtors = 0; + + /* We're done parsing; proceed to optimize and emit assembly. + FIXME: shouldn't be the front end's responsibility to call this. */ + cgraph_optimize (); + + /* After cgraph has had a chance to emit everything that's going to + be emitted, output debug information for globals. */ + if (errorcount == 0 && sorrycount == 0) + { + timevar_push (TV_SYMOUT); + for (t = all_translation_units; t; t = TREE_CHAIN (t)) + c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t))); + c_write_global_declarations_2 (BLOCK_VARS (ext_block)); + timevar_pop (TV_SYMOUT); + } + + ext_block = NULL; } #include "gt-c-decl.h" diff --git a/contrib/gcc/c-dump.c b/contrib/gcc/c-dump.c index 5403bf88601..8dc751b3197 100644 --- a/contrib/gcc/c-dump.c +++ b/contrib/gcc/c-dump.c @@ -1,5 +1,5 @@ /* Tree-dumping functionality for C-family languages. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. Written by Mark Mitchell This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -32,15 +32,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA void dump_stmt (dump_info_p di, tree t) { - dump_int (di, "line", STMT_LINENO (t)); -} - -/* Dump the next statement after STMT. */ - -void -dump_next_stmt (dump_info_p di, tree t) -{ - dump_child ("next", TREE_CHAIN (t)); + if (EXPR_HAS_LOCATION (t)) + dump_int (di, "line", EXPR_LINENO (t)); } /* Dump any C-specific tree codes and attributes of common codes. */ @@ -61,129 +54,6 @@ c_dump_tree (void *dump_info, tree t) dump_string (di, "bitfield"); break; - case ASM_STMT: - dump_stmt (di, t); - if (ASM_VOLATILE_P (t)) - dump_string (di, "volatile"); - dump_child ("strg", ASM_STRING (t)); - dump_child ("outs", ASM_OUTPUTS (t)); - dump_child ("ins", ASM_INPUTS (t)); - dump_child ("clbr", ASM_CLOBBERS (t)); - dump_next_stmt (di, t); - break; - - case BREAK_STMT: - case CONTINUE_STMT: - dump_stmt (di, t); - dump_next_stmt (di, t); - break; - - case CASE_LABEL: - /* Note that a case label is not like other statements; there is - no way to get the line-number of a case label. */ - dump_child ("low", CASE_LOW (t)); - dump_child ("high", CASE_HIGH (t)); - dump_next_stmt (di, t); - break; - - case CLEANUP_STMT: - dump_stmt (di, t); - dump_child ("decl", CLEANUP_DECL (t)); - dump_child ("expr", CLEANUP_EXPR (t)); - dump_next_stmt (di, t); - break; - - case COMPOUND_STMT: - dump_stmt (di, t); - dump_child ("body", COMPOUND_BODY (t)); - dump_next_stmt (di, t); - break; - - case DECL_STMT: - dump_stmt (di, t); - dump_child ("decl", DECL_STMT_DECL (t)); - dump_next_stmt (di, t); - break; - - case DO_STMT: - dump_stmt (di, t); - dump_child ("body", DO_BODY (t)); - dump_child ("cond", DO_COND (t)); - dump_next_stmt (di, t); - break; - - case EXPR_STMT: - dump_stmt (di, t); - dump_child ("expr", EXPR_STMT_EXPR (t)); - dump_next_stmt (di, t); - break; - - case FOR_STMT: - dump_stmt (di, t); - dump_child ("init", FOR_INIT_STMT (t)); - dump_child ("cond", FOR_COND (t)); - dump_child ("expr", FOR_EXPR (t)); - dump_child ("body", FOR_BODY (t)); - dump_next_stmt (di, t); - break; - - case GOTO_STMT: - dump_stmt (di, t); - dump_child ("dest", GOTO_DESTINATION (t)); - dump_next_stmt (di, t); - break; - - case IF_STMT: - dump_stmt (di, t); - dump_child ("cond", IF_COND (t)); - dump_child ("then", THEN_CLAUSE (t)); - dump_child ("else", ELSE_CLAUSE (t)); - dump_next_stmt (di, t); - break; - - case LABEL_STMT: - dump_stmt (di, t); - dump_child ("labl", LABEL_STMT_LABEL (t)); - dump_next_stmt (di, t); - break; - - case RETURN_STMT: - dump_stmt (di, t); - dump_child ("expr", RETURN_STMT_EXPR (t)); - dump_next_stmt (di, t); - break; - - case SWITCH_STMT: - dump_stmt (di, t); - dump_child ("cond", SWITCH_COND (t)); - dump_child ("body", SWITCH_BODY (t)); - dump_next_stmt (di, t); - break; - - case WHILE_STMT: - dump_stmt (di, t); - dump_child ("cond", WHILE_COND (t)); - dump_child ("body", WHILE_BODY (t)); - dump_next_stmt (di, t); - break; - - case SCOPE_STMT: - dump_stmt (di, t); - if (SCOPE_BEGIN_P (t)) - dump_string (di, "begn"); - else - dump_string (di, "end"); - if (SCOPE_NULLIFIED_P (t)) - dump_string (di, "null"); - if (!SCOPE_NO_CLEANUPS_P (t)) - dump_string (di, "clnp"); - dump_next_stmt (di, t); - break; - - case STMT_EXPR: - dump_child ("stmt", STMT_EXPR_STMT (t)); - break; - default: break; } diff --git a/contrib/gcc/c-errors.c b/contrib/gcc/c-errors.c index fa71b8cfa97..7654239d4bb 100644 --- a/contrib/gcc/c-errors.c +++ b/contrib/gcc/c-errors.c @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -32,14 +32,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Issue an ISO C99 pedantic warning MSGID. */ void -pedwarn_c99 (const char *msgid, ...) +pedwarn_c99 (const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; - - va_start (ap, msgid); - diagnostic_set_info (&diagnostic, msgid, &ap, input_location, - flag_isoc99 ? pedantic_error_kind () : DK_WARNING); + + va_start (ap, gmsgid); + diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, + flag_isoc99 ? pedantic_error_kind () : DK_WARNING); report_diagnostic (&diagnostic); va_end (ap); } @@ -50,14 +50,14 @@ pedwarn_c99 (const char *msgid, ...) (There is no flag_c90.) */ void -pedwarn_c90 (const char *msgid, ...) +pedwarn_c90 (const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; - va_start (ap, msgid); - diagnostic_set_info (&diagnostic, msgid, &ap, input_location, - flag_isoc99 ? DK_WARNING : pedantic_error_kind ()); + va_start (ap, gmsgid); + diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, + flag_isoc99 ? DK_WARNING : pedantic_error_kind ()); report_diagnostic (&diagnostic); va_end (ap); } diff --git a/contrib/gcc/c-format.c b/contrib/gcc/c-format.c index 620277ff604..403724e5e11 100644 --- a/contrib/gcc/c-format.c +++ b/contrib/gcc/c-format.c @@ -1,6 +1,6 @@ /* Check calls to formatted I/O functions (-Wformat). Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -25,11 +25,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "tree.h" #include "flags.h" -#include "toplev.h" #include "c-common.h" +#include "toplev.h" #include "intl.h" #include "diagnostic.h" #include "langhooks.h" +#include "c-format.h" /* Set format warning options according to a -Wformat=n option. */ @@ -53,23 +54,25 @@ set_Wformat (int setting) /* Handle attributes associated with format checking. */ -/* This must be in the same order as format_types, with format_type_error - last. */ +/* This must be in the same order as format_types, except for + format_type_error. Target-specific format types do not have + matching enum values. */ enum format_type { printf_format_type, asm_fprintf_format_type, - gcc_diag_format_type, gcc_cdiag_format_type, - gcc_cxxdiag_format_type, + gcc_diag_format_type, gcc_tdiag_format_type, + gcc_cdiag_format_type, + gcc_cxxdiag_format_type, gcc_gfc_format_type, scanf_format_type, strftime_format_type, - strfmon_format_type, format_type_error }; + strfmon_format_type, format_type_error = -1}; typedef struct function_format_info { - enum format_type format_type; /* type of format (printf, scanf, etc.) */ + int format_type; /* type of format (printf, scanf, etc.) */ unsigned HOST_WIDE_INT format_num; /* number of format argument */ unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */ } function_format_info; static bool decode_format_attr (tree, function_format_info *, int); -static enum format_type decode_format_type (const char *); +static int decode_format_type (const char *); static bool check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, @@ -81,12 +84,12 @@ static bool get_constant (tree expr, unsigned HOST_WIDE_INT *value, /* Handle a "format_arg" attribute; arguments as in struct attribute_spec.handler. */ tree -handle_format_arg_attribute (tree *node, tree name ATTRIBUTE_UNUSED, +handle_format_arg_attribute (tree *node, tree ARG_UNUSED (name), tree args, int flags, bool *no_add_attrs) { tree type = *node; tree format_num_expr = TREE_VALUE (args); - unsigned HOST_WIDE_INT format_num; + unsigned HOST_WIDE_INT format_num = 0; tree argument; if (!get_constant (format_num_expr, &format_num, 0)) @@ -137,7 +140,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, != char_type_node)) { if (!(flags & (int) ATTR_FLAG_BUILT_IN)) - error ("format string arg not a string type"); + error ("format string argument not a string type"); *no_add_attrs = true; return false; } @@ -145,21 +148,15 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, return true; } -/* Strip any conversions from the expression, verify it is a constant, - and store its value. If validated_p is true, abort on errors. +/* Verify EXPR is a constant, and store its value. + If validated_p is true there should be no errors. Returns true on success, false otherwise. */ static bool -get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p) +get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p) { - while (TREE_CODE (expr) == NOP_EXPR - || TREE_CODE (expr) == CONVERT_EXPR - || TREE_CODE (expr) == NON_LVALUE_EXPR) - expr = TREE_OPERAND (expr, 0); - if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0) { - if (validated_p) - abort (); + gcc_assert (!validated_p); return false; } @@ -168,12 +165,12 @@ get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p) return true; } -/* Decode the arguments to a "format" attribute into a function_format_info - structure. It is already known that the list is of the right length. - If VALIDATED_P is true, then these attributes have already been validated - and this function will abort if they are erroneous; if false, it - will give an error message. Returns true if the attributes are - successfully decoded, false otherwise. */ +/* Decode the arguments to a "format" attribute into a + function_format_info structure. It is already known that the list + is of the right length. If VALIDATED_P is true, then these + attributes have already been validated and must not be erroneous; + if false, it will give an error message. Returns true if the + attributes are successfully decoded, false otherwise. */ static bool decode_format_attr (tree args, function_format_info *info, int validated_p) @@ -185,8 +182,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) if (TREE_CODE (format_type_id) != IDENTIFIER_NODE) { - if (validated_p) - abort (); + gcc_assert (!validated_p); error ("unrecognized format specifier"); return false; } @@ -198,9 +194,9 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) if (info->format_type == format_type_error) { - if (validated_p) - abort (); - warning ("`%s' is an unrecognized format function type", p); + gcc_assert (!validated_p); + warning (OPT_Wformat, "%qE is an unrecognized format function type", + format_type_id); return false; } } @@ -213,15 +209,14 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) if (!get_constant (first_arg_num_expr, &info->first_arg_num, validated_p)) { - error ("'...' has invalid operand number"); + error ("%<...%> has invalid operand number"); return false; } if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num) { - if (validated_p) - abort (); - error ("format string arg follows the args to be formatted"); + gcc_assert (!validated_p); + error ("format string argument follows the args to be formatted"); return false; } @@ -230,41 +225,14 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) /* Check a call to a format function against a parameter list. */ -/* The meaningfully distinct length modifiers for format checking recognized - by GCC. */ -enum format_lengths -{ - FMT_LEN_none, - FMT_LEN_hh, - FMT_LEN_h, - FMT_LEN_l, - FMT_LEN_ll, - FMT_LEN_L, - FMT_LEN_z, - FMT_LEN_t, - FMT_LEN_j, - FMT_LEN_MAX -}; - - -/* The standard versions in which various format features appeared. */ -enum format_std_version -{ - STD_C89, - STD_C94, - STD_C9L, /* C99, but treat as C89 if -Wno-long-long. */ - STD_C99, - STD_EXT -}; - /* The C standard version C++ is treated as equivalent to or inheriting from, for the purpose of format features supported. */ #define CPLUSPLUS_STD_VER STD_C94 /* The C standard version we are checking formats against when pedantic. */ -#define C_STD_VER ((int)(c_dialect_cxx () \ - ? CPLUSPLUS_STD_VER \ - : (flag_isoc99 \ - ? STD_C99 \ +#define C_STD_VER ((int) (c_dialect_cxx () \ + ? CPLUSPLUS_STD_VER \ + : (flag_isoc99 \ + ? STD_C99 \ : (flag_isoc94 ? STD_C94 : STD_C89)))) /* The name to give to the standard version we are warning about when pedantic. FEATURE_VER is the version in which the feature warned out @@ -276,199 +244,10 @@ enum format_std_version : "ISO C90")) /* Adjust a C standard version, which may be STD_C9L, to account for -Wno-long-long. Returns other standard versions unchanged. */ -#define ADJ_STD(VER) ((int)((VER) == STD_C9L \ +#define ADJ_STD(VER) ((int) ((VER) == STD_C9L \ ? (warn_long_long ? STD_C99 : STD_C89) \ : (VER))) -/* Flags that may apply to a particular kind of format checked by GCC. */ -enum -{ - /* This format converts arguments of types determined by the - format string. */ - FMT_FLAG_ARG_CONVERT = 1, - /* The scanf allocation 'a' kludge applies to this format kind. */ - FMT_FLAG_SCANF_A_KLUDGE = 2, - /* A % during parsing a specifier is allowed to be a modified % rather - that indicating the format is broken and we are out-of-sync. */ - FMT_FLAG_FANCY_PERCENT_OK = 4, - /* With $ operand numbers, it is OK to reference the same argument more - than once. */ - FMT_FLAG_DOLLAR_MULTIPLE = 8, - /* This format type uses $ operand numbers (strfmon doesn't). */ - FMT_FLAG_USE_DOLLAR = 16, - /* Zero width is bad in this type of format (scanf). */ - FMT_FLAG_ZERO_WIDTH_BAD = 32, - /* Empty precision specification is OK in this type of format (printf). */ - FMT_FLAG_EMPTY_PREC_OK = 64, - /* Gaps are allowed in the arguments with $ operand numbers if all - arguments are pointers (scanf). */ - FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128 - /* Not included here: details of whether width or precision may occur - (controlled by width_char and precision_char); details of whether - '*' can be used for these (width_type and precision_type); details - of whether length modifiers can occur (length_char_specs). */ -}; - - -/* Structure describing a length modifier supported in format checking, and - possibly a doubled version such as "hh". */ -typedef struct -{ - /* Name of the single-character length modifier. */ - const char *name; - /* Index into a format_char_info.types array. */ - enum format_lengths index; - /* Standard version this length appears in. */ - enum format_std_version std; - /* Same, if the modifier can be repeated, or NULL if it can't. */ - const char *double_name; - enum format_lengths double_index; - enum format_std_version double_std; -} format_length_info; - - -/* Structure describing the combination of a conversion specifier - (or a set of specifiers which act identically) and a length modifier. */ -typedef struct -{ - /* The standard version this combination of length and type appeared in. - This is only relevant if greater than those for length and type - individually; otherwise it is ignored. */ - enum format_std_version std; - /* The name to use for the type, if different from that generated internally - (e.g., "signed size_t"). */ - const char *name; - /* The type itself. */ - tree *type; -} format_type_detail; - - -/* Macros to fill out tables of these. */ -#define NOARGUMENTS { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } -#define BADLEN { 0, NULL, NULL } -#define NOLENGTHS { BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } - - -/* Structure describing a format conversion specifier (or a set of specifiers - which act identically), and the length modifiers used with it. */ -typedef struct -{ - const char *format_chars; - int pointer_count; - enum format_std_version std; - /* Types accepted for each length modifier. */ - format_type_detail types[FMT_LEN_MAX]; - /* List of other modifier characters allowed with these specifiers. - This lists flags, and additionally "w" for width, "p" for precision - (right precision, for strfmon), "#" for left precision (strfmon), - "a" for scanf "a" allocation extension (not applicable in C99 mode), - "*" for scanf suppression, and "E" and "O" for those strftime - modifiers. */ - const char *flag_chars; - /* List of additional flags describing these conversion specifiers. - "c" for generic character pointers being allowed, "2" for strftime - two digit year formats, "3" for strftime formats giving two digit - years in some locales, "4" for "2" which becomes "3" with an "E" modifier, - "o" if use of strftime "O" is a GNU extension beyond C99, - "W" if the argument is a pointer which is dereferenced and written into, - "R" if the argument is a pointer which is dereferenced and read from, - "i" for printf integer formats where the '0' flag is ignored with - precision, and "[" for the starting character of a scanf scanset. */ - const char *flags2; -} format_char_info; - - -/* Structure describing a flag accepted by some kind of format. */ -typedef struct -{ - /* The flag character in question (0 for end of array). */ - int flag_char; - /* Zero if this entry describes the flag character in general, or a - nonzero character that may be found in flags2 if it describes the - flag when used with certain formats only. If the latter, only - the first such entry found that applies to the current conversion - specifier is used; the values of `name' and `long_name' it supplies - will be used, if non-NULL and the standard version is higher than - the unpredicated one, for any pedantic warning. For example, 'o' - for strftime formats (meaning 'O' is an extension over C99). */ - int predicate; - /* Nonzero if the next character after this flag in the format should - be skipped ('=' in strfmon), zero otherwise. */ - int skip_next_char; - /* The name to use for this flag in diagnostic messages. For example, - N_("`0' flag"), N_("field width"). */ - const char *name; - /* Long name for this flag in diagnostic messages; currently only used for - "ISO C does not support ...". For example, N_("the `I' printf flag"). */ - const char *long_name; - /* The standard version in which it appeared. */ - enum format_std_version std; -} format_flag_spec; - - -/* Structure describing a combination of flags that is bad for some kind - of format. */ -typedef struct -{ - /* The first flag character in question (0 for end of array). */ - int flag_char1; - /* The second flag character. */ - int flag_char2; - /* Nonzero if the message should say that the first flag is ignored with - the second, zero if the combination should simply be objected to. */ - int ignored; - /* Zero if this entry applies whenever this flag combination occurs, - a nonzero character from flags2 if it only applies in some - circumstances (e.g. 'i' for printf formats ignoring 0 with precision). */ - int predicate; -} format_flag_pair; - - -/* Structure describing a particular kind of format processed by GCC. */ -typedef struct -{ - /* The name of this kind of format, for use in diagnostics. Also - the name of the attribute (without preceding and following __). */ - const char *name; - /* Specifications of the length modifiers accepted; possibly NULL. */ - const format_length_info *length_char_specs; - /* Details of the conversion specification characters accepted. */ - const format_char_info *conversion_specs; - /* String listing the flag characters that are accepted. */ - const char *flag_chars; - /* String listing modifier characters (strftime) accepted. May be NULL. */ - const char *modifier_chars; - /* Details of the flag characters, including pseudo-flags. */ - const format_flag_spec *flag_specs; - /* Details of bad combinations of flags. */ - const format_flag_pair *bad_flag_pairs; - /* Flags applicable to this kind of format. */ - int flags; - /* Flag character to treat a width as, or 0 if width not used. */ - int width_char; - /* Flag character to treat a left precision (strfmon) as, - or 0 if left precision not used. */ - int left_precision_char; - /* Flag character to treat a precision (for strfmon, right precision) as, - or 0 if precision not used. */ - int precision_char; - /* If a flag character has the effect of suppressing the conversion of - an argument ('*' in scanf), that flag character, otherwise 0. */ - int suppression_char; - /* Flag character to treat a length modifier as (ignored if length - modifiers not used). Need not be placed in flag_chars for conversion - specifiers, but is used to check for bad combinations such as length - modifier with assignment suppression in scanf. */ - int length_code_char; - /* Pointer to type of argument expected if '*' is used for a width, - or NULL if '*' not used for widths. */ - tree *width_type; - /* Pointer to type of argument expected if '*' is used for a precision, - or NULL if '*' not used for precisions. */ - tree *precision_type; -} format_kind_info; - - /* Structure describing details of a type expected in format checking, and the type to check against it. */ typedef struct format_wanted_type @@ -488,12 +267,10 @@ typedef struct format_wanted_type /* Whether the argument, dereferenced once, is read from and so must not be a NULL pointer. */ int reading_from_flag; - /* If warnings should be of the form "field precision is not type int", - the name to use (in this case "field precision"), otherwise NULL, - for "%s format, %s arg" type messages. If (in an extension), this - is a pointer type, wanted_type_name should be set to include the - terminating '*' characters of the type name to give a correct - message. */ + /* If warnings should be of the form "field precision should have + type 'int'", the name to use (in this case "field precision"), + otherwise NULL, for "format expects type 'long'" type + messages. */ const char *name; /* The actual parameter to check against the wanted type. */ tree param; @@ -514,6 +291,8 @@ static const format_length_info printf_length_specs[] = { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, { "t", FMT_LEN_t, STD_C99, NULL, 0, 0 }, { "j", FMT_LEN_j, STD_C99, NULL, 0, 0 }, + { "H", FMT_LEN_H, STD_EXT, NULL, 0, 0 }, + { "D", FMT_LEN_D, STD_EXT, "DD", FMT_LEN_DD, STD_EXT }, { NULL, 0, 0, NULL, 0, 0 } }; @@ -534,6 +313,7 @@ static const format_length_info gcc_diag_length_specs[] = }; /* The custom diagnostics all accept the same length specifiers. */ +#define gcc_tdiag_length_specs gcc_diag_length_specs #define gcc_cdiag_length_specs gcc_diag_length_specs #define gcc_cxxdiag_length_specs gcc_diag_length_specs @@ -547,6 +327,8 @@ static const format_length_info scanf_length_specs[] = { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, { "t", FMT_LEN_t, STD_C99, NULL, 0, 0 }, { "j", FMT_LEN_j, STD_C99, NULL, 0, 0 }, + { "H", FMT_LEN_H, STD_EXT, NULL, 0, 0 }, + { "D", FMT_LEN_D, STD_EXT, "DD", FMT_LEN_DD, STD_EXT }, { NULL, 0, 0, NULL, 0, 0 } }; @@ -562,13 +344,13 @@ static const format_length_info strfmon_length_specs[] = static const format_flag_spec printf_flag_specs[] = { - { ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 }, - { '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, - { '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, - { '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 }, - { '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 }, - { '\'', 0, 0, N_("`'' flag"), N_("the `'' printf flag"), STD_EXT }, - { 'I', 0, 0, N_("`I' flag"), N_("the `I' printf flag"), STD_EXT }, + { ' ', 0, 0, N_("' ' flag"), N_("the ' ' printf flag"), STD_C89 }, + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, + { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 }, + { '0', 0, 0, N_("'0' flag"), N_("the '0' printf flag"), STD_C89 }, + { '-', 0, 0, N_("'-' flag"), N_("the '-' printf flag"), STD_C89 }, + { '\'', 0, 0, N_("''' flag"), N_("the ''' printf flag"), STD_EXT }, + { 'I', 0, 0, N_("'I' flag"), N_("the 'I' printf flag"), STD_EXT }, { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, @@ -586,11 +368,11 @@ static const format_flag_pair printf_flag_pairs[] = static const format_flag_spec asm_fprintf_flag_specs[] = { - { ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 }, - { '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, - { '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, - { '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 }, - { '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 }, + { ' ', 0, 0, N_("' ' flag"), N_("the ' ' printf flag"), STD_C89 }, + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, + { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 }, + { '0', 0, 0, N_("'0' flag"), N_("the '0' printf flag"), STD_C89 }, + { '-', 0, 0, N_("'-' flag"), N_("the '-' printf flag"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, @@ -610,22 +392,32 @@ static const format_flag_pair gcc_diag_flag_pairs[] = { 0, 0, 0, 0 } }; +#define gcc_tdiag_flag_pairs gcc_diag_flag_pairs #define gcc_cdiag_flag_pairs gcc_diag_flag_pairs #define gcc_cxxdiag_flag_pairs gcc_diag_flag_pairs +static const format_flag_pair gcc_gfc_flag_pairs[] = +{ + { 0, 0, 0, 0 } +}; + static const format_flag_spec gcc_diag_flag_specs[] = { + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, + { 'q', 0, 0, N_("'q' flag"), N_("the 'q' diagnostic flag"), STD_C89 }, { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, { 0, 0, 0, NULL, NULL, 0 } }; +#define gcc_tdiag_flag_specs gcc_diag_flag_specs #define gcc_cdiag_flag_specs gcc_diag_flag_specs static const format_flag_spec gcc_cxxdiag_flag_specs[] = { - { '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, - { '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, + { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 }, + { 'q', 0, 0, N_("'q' flag"), N_("the 'q' diagnostic flag"), STD_C89 }, { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, { 0, 0, 0, NULL, NULL, 0 } @@ -634,11 +426,11 @@ static const format_flag_spec gcc_cxxdiag_flag_specs[] = static const format_flag_spec scanf_flag_specs[] = { { '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 }, - { 'a', 0, 0, N_("`a' flag"), N_("the `a' scanf flag"), STD_EXT }, + { 'a', 0, 0, N_("'a' flag"), N_("the 'a' scanf flag"), STD_EXT }, { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, - { '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT }, - { 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT }, + { '\'', 0, 0, N_("''' flag"), N_("the ''' scanf flag"), STD_EXT }, + { 'I', 0, 0, N_("'I' flag"), N_("the 'I' scanf flag"), STD_EXT }, { 0, 0, 0, NULL, NULL, 0 } }; @@ -652,15 +444,15 @@ static const format_flag_pair scanf_flag_pairs[] = static const format_flag_spec strftime_flag_specs[] = { - { '_', 0, 0, N_("`_' flag"), N_("the `_' strftime flag"), STD_EXT }, - { '-', 0, 0, N_("`-' flag"), N_("the `-' strftime flag"), STD_EXT }, - { '0', 0, 0, N_("`0' flag"), N_("the `0' strftime flag"), STD_EXT }, - { '^', 0, 0, N_("`^' flag"), N_("the `^' strftime flag"), STD_EXT }, - { '#', 0, 0, N_("`#' flag"), N_("the `#' strftime flag"), STD_EXT }, + { '_', 0, 0, N_("'_' flag"), N_("the '_' strftime flag"), STD_EXT }, + { '-', 0, 0, N_("'-' flag"), N_("the '-' strftime flag"), STD_EXT }, + { '0', 0, 0, N_("'0' flag"), N_("the '0' strftime flag"), STD_EXT }, + { '^', 0, 0, N_("'^' flag"), N_("the '^' strftime flag"), STD_EXT }, + { '#', 0, 0, N_("'#' flag"), N_("the '#' strftime flag"), STD_EXT }, { 'w', 0, 0, N_("field width"), N_("field width in strftime format"), STD_EXT }, - { 'E', 0, 0, N_("`E' modifier"), N_("the `E' strftime modifier"), STD_C99 }, - { 'O', 0, 0, N_("`O' modifier"), N_("the `O' strftime modifier"), STD_C99 }, - { 'O', 'o', 0, NULL, N_("the `O' modifier"), STD_EXT }, + { 'E', 0, 0, N_("'E' modifier"), N_("the 'E' strftime modifier"), STD_C99 }, + { 'O', 0, 0, N_("'O' modifier"), N_("the 'O' strftime modifier"), STD_C99 }, + { 'O', 'o', 0, NULL, N_("the 'O' modifier"), STD_EXT }, { 0, 0, 0, NULL, NULL, 0 } }; @@ -679,11 +471,11 @@ static const format_flag_pair strftime_flag_pairs[] = static const format_flag_spec strfmon_flag_specs[] = { { '=', 0, 1, N_("fill character"), N_("fill character in strfmon format"), STD_C89 }, - { '^', 0, 0, N_("`^' flag"), N_("the `^' strfmon flag"), STD_C89 }, - { '+', 0, 0, N_("`+' flag"), N_("the `+' strfmon flag"), STD_C89 }, - { '(', 0, 0, N_("`(' flag"), N_("the `(' strfmon flag"), STD_C89 }, - { '!', 0, 0, N_("`!' flag"), N_("the `!' strfmon flag"), STD_C89 }, - { '-', 0, 0, N_("`-' flag"), N_("the `-' strfmon flag"), STD_C89 }, + { '^', 0, 0, N_("'^' flag"), N_("the '^' strfmon flag"), STD_C89 }, + { '+', 0, 0, N_("'+' flag"), N_("the '+' strfmon flag"), STD_C89 }, + { '(', 0, 0, N_("'(' flag"), N_("the '(' strfmon flag"), STD_C89 }, + { '!', 0, 0, N_("'!' flag"), N_("the '!' strfmon flag"), STD_C89 }, + { '-', 0, 0, N_("'-' flag"), N_("the '-' strfmon flag"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in strfmon format"), STD_C89 }, { '#', 0, 0, N_("left precision"), N_("left precision in strfmon format"), STD_C89 }, { 'p', 0, 0, N_("right precision"), N_("right precision in strfmon format"), STD_C89 }, @@ -698,260 +490,261 @@ static const format_flag_pair strfmon_flag_pairs[] = }; -#define T_I &integer_type_node -#define T89_I { STD_C89, NULL, T_I } -#define T_L &long_integer_type_node -#define T89_L { STD_C89, NULL, T_L } -#define T_LL &long_long_integer_type_node -#define T9L_LL { STD_C9L, NULL, T_LL } -#define TEX_LL { STD_EXT, NULL, T_LL } -#define T_S &short_integer_type_node -#define T89_S { STD_C89, NULL, T_S } -#define T_UI &unsigned_type_node -#define T89_UI { STD_C89, NULL, T_UI } -#define T_UL &long_unsigned_type_node -#define T89_UL { STD_C89, NULL, T_UL } -#define T_ULL &long_long_unsigned_type_node -#define T9L_ULL { STD_C9L, NULL, T_ULL } -#define TEX_ULL { STD_EXT, NULL, T_ULL } -#define T_US &short_unsigned_type_node -#define T89_US { STD_C89, NULL, T_US } -#define T_F &float_type_node -#define T89_F { STD_C89, NULL, T_F } -#define T99_F { STD_C99, NULL, T_F } -#define T_D &double_type_node -#define T89_D { STD_C89, NULL, T_D } -#define T99_D { STD_C99, NULL, T_D } -#define T_LD &long_double_type_node -#define T89_LD { STD_C89, NULL, T_LD } -#define T99_LD { STD_C99, NULL, T_LD } -#define T_C &char_type_node -#define T89_C { STD_C89, NULL, T_C } -#define T_SC &signed_char_type_node -#define T99_SC { STD_C99, NULL, T_SC } -#define T_UC &unsigned_char_type_node -#define T99_UC { STD_C99, NULL, T_UC } -#define T_V &void_type_node -#define T89_V { STD_C89, NULL, T_V } -#define T_W &wchar_type_node -#define T94_W { STD_C94, "wchar_t", T_W } -#define TEX_W { STD_EXT, "wchar_t", T_W } -#define T_WI &wint_type_node -#define T94_WI { STD_C94, "wint_t", T_WI } -#define TEX_WI { STD_EXT, "wint_t", T_WI } -#define T_ST &size_type_node -#define T99_ST { STD_C99, "size_t", T_ST } -#define T_SST &signed_size_type_node -#define T99_SST { STD_C99, "signed size_t", T_SST } -#define T_PD &ptrdiff_type_node -#define T99_PD { STD_C99, "ptrdiff_t", T_PD } -#define T_UPD &unsigned_ptrdiff_type_node -#define T99_UPD { STD_C99, "unsigned ptrdiff_t", T_UPD } -#define T_IM &intmax_type_node -#define T99_IM { STD_C99, "intmax_t", T_IM } -#define T_UIM &uintmax_type_node -#define T99_UIM { STD_C99, "uintmax_t", T_UIM } - static const format_char_info print_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" }, - { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" }, - { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" }, - { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" }, - { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#I", "" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" }, - { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" }, - { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" }, + { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM, BADLEN, BADLEN, BADLEN }, "-wp0 +'I", "i", NULL }, + { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM, BADLEN, BADLEN, BADLEN }, "-wp0#", "i", NULL }, + { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM, BADLEN, BADLEN, BADLEN }, "-wp0'I", "i", NULL }, + { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN, TEX_D32, TEX_D64, TEX_D128 }, "-wp0 +#'I", "", NULL }, + { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN, TEX_D32, TEX_D64, TEX_D128 }, "-wp0 +#I", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c", NULL }, + { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM, BADLEN, BADLEN, BADLEN }, "", "W", NULL }, /* C99 conversion specifiers. */ - { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" }, - { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" }, + { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, TEX_D32, TEX_D64, TEX_D128 }, "-wp0 +#'I", "", NULL }, + { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "", NULL }, /* X/Open conversion specifiers. */ - { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, - { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" }, + { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R", NULL }, /* GNU conversion specifiers. */ - { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info asm_fprintf_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +", "i" }, - { "oxX", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0#", "i" }, - { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "i" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" }, + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +", "i", NULL }, + { "oxX", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0#", "i", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0", "i", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL }, /* asm_fprintf conversion specifiers. */ - { "O", 0, STD_C89, NOARGUMENTS, "", "" }, - { "R", 0, STD_C89, NOARGUMENTS, "", "" }, - { "I", 0, STD_C89, NOARGUMENTS, "", "" }, - { "L", 0, STD_C89, NOARGUMENTS, "", "" }, - { "U", 0, STD_C89, NOARGUMENTS, "", "" }, - { "r", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "@", 0, STD_C89, NOARGUMENTS, "", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "O", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "R", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "I", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "L", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "U", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "r", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", NULL }, + { "@", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info gcc_diag_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "p", "cR" }, - { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "c" }, + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "pq", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "c", NULL }, /* Custom conversion specifiers. */ /* %H will require "location_t" at runtime. */ - { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, /* These will require a "tree" at runtime. */ - { "J", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + { "J", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, - { "m", 0, STD_C89, NOARGUMENTS, "", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +static const format_char_info gcc_tdiag_char_table[] = +{ + /* C89 conversion specifiers. */ + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "pq", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "c", NULL }, + + /* Custom conversion specifiers. */ + + /* %H will require "location_t" at runtime. */ + { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + + /* These will require a "tree" at runtime. */ + { "DFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL }, + + { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info gcc_cdiag_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "p", "cR" }, - { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "c" }, + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "pq", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "c", NULL }, /* Custom conversion specifiers. */ /* %H will require "location_t" at runtime. */ - { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, /* These will require a "tree" at runtime. */ - { "DEFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + { "DEFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL }, - { "m", 0, STD_C89, NOARGUMENTS, "", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info gcc_cxxdiag_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "p", "cR" }, - { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "c" }, + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "ox", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "pq", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "c", NULL }, /* Custom conversion specifiers. */ /* %H will require "location_t" at runtime. */ - { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, /* These will require a "tree" at runtime. */ - { "ADEFJTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "+#", "" }, + { "ADEFJTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL }, - /* These accept either an `int' or an `enum tree_code' (which is handled as an `int'.) */ - { "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "" }, + /* These accept either an 'int' or an 'enum tree_code' (which is handled as an 'int'.) */ + { "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, - { "m", 0, STD_C89, NOARGUMENTS, "", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +static const format_char_info gcc_gfc_char_table[] = +{ + /* C89 conversion specifiers. */ + { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }, + + /* gfc conversion specifiers. */ + + { "C", 0, STD_C89, NOARGUMENTS, "", "", NULL }, + + /* This will require a "locus" at runtime. */ + { "L", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "R", NULL }, + + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info scan_char_table[] = { /* C89 conversion specifiers. */ - { "di", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "*w'I", "W" }, - { "u", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "*w'I", "W" }, - { "oxX", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "*w", "W" }, - { "efgEG", 1, STD_C89, { T89_F, BADLEN, BADLEN, T89_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "*w'", "W" }, - { "c", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "cW" }, - { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW" }, - { "[", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW[" }, - { "p", 2, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W" }, - { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" }, + { "di", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM, BADLEN, BADLEN, BADLEN }, "*w'I", "W", NULL }, + { "u", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM, BADLEN, BADLEN, BADLEN }, "*w'I", "W", NULL }, + { "oxX", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "efgEG", 1, STD_C89, { T89_F, BADLEN, BADLEN, T89_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN, TEX_D32, TEX_D64, TEX_D128 }, "*w'", "W", NULL }, + { "c", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "cW", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW", NULL }, + { "[", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW[", NULL }, + { "p", 2, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM, BADLEN, BADLEN, BADLEN }, "", "W", NULL }, /* C99 conversion specifiers. */ - { "FaA", 1, STD_C99, { T99_F, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "*w'", "W" }, + { "F", 1, STD_C99, { T99_F, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, TEX_D32, TEX_D64, TEX_D128 }, "*w'", "W", NULL }, + { "aA", 1, STD_C99, { T99_F, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w'", "W", NULL }, /* X/Open conversion specifiers. */ - { "C", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W" }, - { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "W" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "C", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "W", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info time_char_table[] = { /* C89 conversion specifiers. */ - { "ABZab", 0, STD_C89, NOLENGTHS, "^#", "" }, - { "cx", 0, STD_C89, NOLENGTHS, "E", "3" }, - { "HIMSUWdmw", 0, STD_C89, NOLENGTHS, "-_0Ow", "" }, - { "j", 0, STD_C89, NOLENGTHS, "-_0Ow", "o" }, - { "p", 0, STD_C89, NOLENGTHS, "#", "" }, - { "X", 0, STD_C89, NOLENGTHS, "E", "" }, - { "y", 0, STD_C89, NOLENGTHS, "EO-_0w", "4" }, - { "Y", 0, STD_C89, NOLENGTHS, "-_0EOw", "o" }, - { "%", 0, STD_C89, NOLENGTHS, "", "" }, + { "ABZab", 0, STD_C89, NOLENGTHS, "^#", "", NULL }, + { "cx", 0, STD_C89, NOLENGTHS, "E", "3", NULL }, + { "HIMSUWdmw", 0, STD_C89, NOLENGTHS, "-_0Ow", "", NULL }, + { "j", 0, STD_C89, NOLENGTHS, "-_0Ow", "o", NULL }, + { "p", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "X", 0, STD_C89, NOLENGTHS, "E", "", NULL }, + { "y", 0, STD_C89, NOLENGTHS, "EO-_0w", "4", NULL }, + { "Y", 0, STD_C89, NOLENGTHS, "-_0EOw", "o", NULL }, + { "%", 0, STD_C89, NOLENGTHS, "", "", NULL }, /* C99 conversion specifiers. */ - { "C", 0, STD_C99, NOLENGTHS, "-_0EOw", "o" }, - { "D", 0, STD_C99, NOLENGTHS, "", "2" }, - { "eVu", 0, STD_C99, NOLENGTHS, "-_0Ow", "" }, - { "FRTnrt", 0, STD_C99, NOLENGTHS, "", "" }, - { "g", 0, STD_C99, NOLENGTHS, "O-_0w", "2o" }, - { "G", 0, STD_C99, NOLENGTHS, "-_0Ow", "o" }, - { "h", 0, STD_C99, NOLENGTHS, "^#", "" }, - { "z", 0, STD_C99, NOLENGTHS, "O", "o" }, + { "C", 0, STD_C99, NOLENGTHS, "-_0EOw", "o", NULL }, + { "D", 0, STD_C99, NOLENGTHS, "", "2", NULL }, + { "eVu", 0, STD_C99, NOLENGTHS, "-_0Ow", "", NULL }, + { "FRTnrt", 0, STD_C99, NOLENGTHS, "", "", NULL }, + { "g", 0, STD_C99, NOLENGTHS, "O-_0w", "2o", NULL }, + { "G", 0, STD_C99, NOLENGTHS, "-_0Ow", "o", NULL }, + { "h", 0, STD_C99, NOLENGTHS, "^#", "", NULL }, + { "z", 0, STD_C99, NOLENGTHS, "O", "o", NULL }, /* GNU conversion specifiers. */ - { "kls", 0, STD_EXT, NOLENGTHS, "-_0Ow", "" }, - { "P", 0, STD_EXT, NOLENGTHS, "", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "kls", 0, STD_EXT, NOLENGTHS, "-_0Ow", "", NULL }, + { "P", 0, STD_EXT, NOLENGTHS, "", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; static const format_char_info monetary_char_table[] = { - { "in", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "=^+(!-w#p", "" }, - { NULL, 0, 0, NOLENGTHS, NULL, NULL } + { "in", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "=^+(!-w#p", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } }; - /* This must be in the same order as enum format_type. */ static const format_kind_info format_types_orig[] = { - { "printf", printf_length_specs, print_char_table, " +#0-'I", NULL, + { "printf", printf_length_specs, print_char_table, " +#0-'I", NULL, printf_flag_specs, printf_flag_pairs, FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK, 'w', 0, 'p', 0, 'L', &integer_type_node, &integer_type_node }, - { "asm_fprintf", asm_fprintf_length_specs, asm_fprintf_char_table, " +#0-", NULL, + { "asm_fprintf", asm_fprintf_length_specs, asm_fprintf_char_table, " +#0-", NULL, asm_fprintf_flag_specs, asm_fprintf_flag_pairs, FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, 'w', 0, 'p', 0, 'L', NULL, NULL }, - { "gcc_diag", gcc_diag_length_specs, gcc_diag_char_table, "", NULL, + { "gcc_diag", gcc_diag_length_specs, gcc_diag_char_table, "q+", NULL, gcc_diag_flag_specs, gcc_diag_flag_pairs, FMT_FLAG_ARG_CONVERT, 0, 0, 'p', 0, 'L', NULL, &integer_type_node }, - { "gcc_cdiag", gcc_cdiag_length_specs, gcc_cdiag_char_table, "", NULL, + { "gcc_tdiag", gcc_tdiag_length_specs, gcc_tdiag_char_table, "q+", NULL, + gcc_tdiag_flag_specs, gcc_tdiag_flag_pairs, + FMT_FLAG_ARG_CONVERT, + 0, 0, 'p', 0, 'L', + NULL, &integer_type_node + }, + { "gcc_cdiag", gcc_cdiag_length_specs, gcc_cdiag_char_table, "q+", NULL, gcc_cdiag_flag_specs, gcc_cdiag_flag_pairs, FMT_FLAG_ARG_CONVERT, 0, 0, 'p', 0, 'L', NULL, &integer_type_node }, - { "gcc_cxxdiag", gcc_cxxdiag_length_specs, gcc_cxxdiag_char_table, "+#", NULL, + { "gcc_cxxdiag", gcc_cxxdiag_length_specs, gcc_cxxdiag_char_table, "q+#", NULL, gcc_cxxdiag_flag_specs, gcc_cxxdiag_flag_pairs, FMT_FLAG_ARG_CONVERT, 0, 0, 'p', 0, 'L', NULL, &integer_type_node }, - { "scanf", scanf_length_specs, scan_char_table, "*'I", NULL, + { "gcc_gfc", NULL, gcc_gfc_char_table, "", NULL, + NULL, gcc_gfc_flag_pairs, + FMT_FLAG_ARG_CONVERT, + 0, 0, 0, 0, 0, + NULL, NULL + }, + { "scanf", scanf_length_specs, scan_char_table, "*'I", NULL, scanf_flag_specs, scanf_flag_pairs, FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK, 'w', 0, 0, '*', 'L', @@ -962,7 +755,7 @@ static const format_kind_info format_types_orig[] = FMT_FLAG_FANCY_PERCENT_OK, 'w', 0, 0, 0, 0, NULL, NULL }, - { "strfmon", strfmon_length_specs, monetary_char_table, "=^+(!-", NULL, + { "strfmon", strfmon_length_specs, monetary_char_table, "=^+(!-", NULL, strfmon_flag_specs, strfmon_flag_pairs, FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L', NULL, NULL @@ -973,9 +766,12 @@ static const format_kind_info format_types_orig[] = new data if necessary, while still allowing the original data to be const. */ static const format_kind_info *format_types = format_types_orig; -/* We can modify this one. */ +/* We can modify this one. We also add target-specific format types + to the end of the array. */ static format_kind_info *dynamic_format_types; +static int n_format_types = ARRAY_SIZE (format_types_orig); + /* Structure detailing the results of checking a format function call where the format expression may be a conditional expression with many leaves resulting from nested conditional expressions. */ @@ -1008,49 +804,49 @@ typedef struct format_check_results *res; function_format_info *info; tree params; - int *status; } format_check_context; -static void check_format_info (int *, function_format_info *, tree); +static void check_format_info (function_format_info *, tree); static void check_format_arg (void *, tree, unsigned HOST_WIDE_INT); -static void check_format_info_main (int *, format_check_results *, +static void check_format_info_main (format_check_results *, function_format_info *, const char *, int, tree, unsigned HOST_WIDE_INT); -static void status_warning (int *, const char *, ...) - ATTRIBUTE_PRINTF_2; static void init_dollar_format_checking (int, tree); -static int maybe_read_dollar_number (int *, const char **, int, +static int maybe_read_dollar_number (const char **, int, tree, tree *, const format_kind_info *); -static void finish_dollar_format_checking (int *, format_check_results *, int); +static bool avoid_dollar_number (const char *); +static void finish_dollar_format_checking (format_check_results *, int); static const format_flag_spec *get_flag_spec (const format_flag_spec *, int, const char *); -static void check_format_types (int *, format_wanted_type *); +static void check_format_types (format_wanted_type *, const char *, int); +static void format_type_warning (const char *, const char *, int, tree, + int, const char *, tree, int); /* Decode a format type from a string, returning the type, or format_type_error if not valid, in which case the caller should print an error message. */ -static enum format_type +static int decode_format_type (const char *s) { int i; int slen; slen = strlen (s); - for (i = 0; i < (int) format_type_error; i++) + for (i = 0; i < n_format_types; i++) { int alen; if (!strcmp (s, format_types[i].name)) - break; + return i; alen = strlen (format_types[i].name); if (slen == alen + 4 && s[0] == '_' && s[1] == '_' && s[slen - 1] == '_' && s[slen - 2] == '_' && !strncmp (s + 2, format_types[i].name, alen)) - break; + return i; } - return ((enum format_type) i); + return format_type_error; } @@ -1061,7 +857,7 @@ decode_format_type (const char *s) attribute themselves. */ void -check_function_format (int *status, tree attrs, tree params) +check_function_format (tree attrs, tree params) { tree a; @@ -1073,7 +869,8 @@ check_function_format (int *status, tree attrs, tree params) /* Yup; check it. */ function_format_info info; decode_format_attr (TREE_VALUE (a), &info, 1); - check_format_info (status, &info, params); + if (warn_format) + check_format_info (&info, params); if (warn_missing_format_attribute && info.first_arg_num == 0 && (format_types[info.format_type].flags & (int) FMT_FLAG_ARG_CONVERT)) @@ -1104,7 +901,8 @@ check_function_format (int *status, tree attrs, tree params) break; } if (args != 0) - warning ("function might be possible candidate for `%s' format attribute", + warning (OPT_Wmissing_format_attribute, "function might " + "be possible candidate for %qs format attribute", format_types[info.format_type].name); } } @@ -1112,31 +910,6 @@ check_function_format (int *status, tree attrs, tree params) } } -/* This function replaces `warning' inside the printf format checking - functions. If the `status' parameter is non-NULL, then it is - dereferenced and set to 1 whenever a warning is caught. Otherwise - it warns as usual by replicating the innards of the warning - function from diagnostic.c. */ -static void -status_warning (int *status, const char *msgid, ...) -{ - diagnostic_info diagnostic ; - va_list ap; - - va_start (ap, msgid); - - if (status) - *status = 1; - else - { - /* This duplicates the warning function behavior. */ - diagnostic_set_info (&diagnostic, _(msgid), &ap, - input_location, DK_WARNING); - report_diagnostic (&diagnostic); - } - - va_end (ap); -} /* Variables used by the checking of $ operand number formats. */ static char *dollar_arguments_used = NULL; @@ -1177,8 +950,8 @@ init_dollar_format_checking (int first_arg_num, tree params) if (dollar_arguments_pointer_p) free (dollar_arguments_pointer_p); dollar_arguments_alloc = dollar_arguments_count; - dollar_arguments_used = xmalloc (dollar_arguments_alloc); - dollar_arguments_pointer_p = xmalloc (dollar_arguments_alloc); + dollar_arguments_used = XNEWVEC (char, dollar_arguments_alloc); + dollar_arguments_pointer_p = XNEWVEC (char, dollar_arguments_alloc); } if (dollar_arguments_alloc) { @@ -1209,18 +982,18 @@ init_dollar_format_checking (int first_arg_num, tree params) a $ format is found, *FORMAT is updated to point just after it. */ static int -maybe_read_dollar_number (int *status, const char **format, +maybe_read_dollar_number (const char **format, int dollar_needed, tree params, tree *param_ptr, const format_kind_info *fki) { int argnum; int overflow_flag; const char *fcp = *format; - if (! ISDIGIT (*fcp)) + if (!ISDIGIT (*fcp)) { if (dollar_needed) { - status_warning (status, "missing $ operand number in format"); + warning (OPT_Wformat, "missing $ operand number in format"); return -1; } else @@ -1241,7 +1014,7 @@ maybe_read_dollar_number (int *status, const char **format, { if (dollar_needed) { - status_warning (status, "missing $ operand number in format"); + warning (OPT_Wformat, "missing $ operand number in format"); return -1; } else @@ -1250,15 +1023,14 @@ maybe_read_dollar_number (int *status, const char **format, *format = fcp + 1; if (pedantic && !dollar_format_warned) { - status_warning (status, - "%s does not support %%n$ operand number formats", - C_STD_NAME (STD_EXT)); + warning (OPT_Wformat, "%s does not support %%n$ operand number formats", + C_STD_NAME (STD_EXT)); dollar_format_warned = 1; } if (overflow_flag || argnum == 0 || (dollar_first_arg_num && argnum > dollar_arguments_count)) { - status_warning (status, "operand number out of range in format"); + warning (OPT_Wformat, "operand number out of range in format"); return -1; } if (argnum > dollar_max_arg_used) @@ -1269,9 +1041,10 @@ maybe_read_dollar_number (int *status, const char **format, { int nalloc; nalloc = 2 * dollar_arguments_alloc + 16; - dollar_arguments_used = xrealloc (dollar_arguments_used, nalloc); - dollar_arguments_pointer_p = xrealloc (dollar_arguments_pointer_p, - nalloc); + dollar_arguments_used = XRESIZEVEC (char, dollar_arguments_used, + nalloc); + dollar_arguments_pointer_p = XRESIZEVEC (char, dollar_arguments_pointer_p, + nalloc); memset (dollar_arguments_used + dollar_arguments_alloc, 0, nalloc - dollar_arguments_alloc); dollar_arguments_alloc = nalloc; @@ -1280,9 +1053,8 @@ maybe_read_dollar_number (int *status, const char **format, && dollar_arguments_used[argnum - 1] == 1) { dollar_arguments_used[argnum - 1] = 2; - status_warning (status, - "format argument %d used more than once in %s format", - argnum, fki->name); + warning (OPT_Wformat, "format argument %d used more than once in %s format", + argnum, fki->name); } else dollar_arguments_used[argnum - 1] = 1; @@ -1293,17 +1065,32 @@ maybe_read_dollar_number (int *status, const char **format, for (i = 1; i < argnum && *param_ptr != 0; i++) *param_ptr = TREE_CHAIN (*param_ptr); - if (*param_ptr == 0) - { - /* This case shouldn't be caught here. */ - abort (); - } + /* This case shouldn't be caught here. */ + gcc_assert (*param_ptr); } else *param_ptr = 0; return argnum; } +/* Ensure that FORMAT does not start with a decimal number followed by + a $; give a diagnostic and return true if it does, false otherwise. */ + +static bool +avoid_dollar_number (const char *format) +{ + if (!ISDIGIT (*format)) + return false; + while (ISDIGIT (*format)) + format++; + if (*format == '$') + { + warning (OPT_Wformat, "$ operand number used after format without operand number"); + return true; + } + return false; +} + /* Finish the checking for a format string that used $ operand number formats instead of non-$ formats. We check for unused operands before used ones @@ -1316,7 +1103,7 @@ maybe_read_dollar_number (int *status, const char **format, pointers. */ static void -finish_dollar_format_checking (int *status, format_check_results *res, int pointer_gap_ok) +finish_dollar_format_checking (format_check_results *res, int pointer_gap_ok) { int i; bool found_pointer_gap = false; @@ -1328,8 +1115,9 @@ finish_dollar_format_checking (int *status, format_check_results *res, int point || dollar_arguments_pointer_p[i])) found_pointer_gap = true; else - status_warning (status, "format argument %d unused before used argument %d in $-style format", - i + 1, dollar_max_arg_used); + warning (OPT_Wformat, + "format argument %d unused before used argument %d in $-style format", + i + 1, dollar_max_arg_used); } } if (found_pointer_gap @@ -1345,10 +1133,10 @@ finish_dollar_format_checking (int *status, format_check_results *res, int point /* Retrieve the specification for a format flag. SPEC contains the specifications for format flags for the applicable kind of format. FLAG is the flag in question. If PREDICATES is NULL, the basic - spec for that flag must be retrieved and this function aborts if - it cannot be found. If PREDICATES is not NULL, it is a string listing - possible predicates for the spec entry; if an entry predicated on any - of these is found, it is returned, otherwise NULL is returned. */ + spec for that flag must be retrieved and must exist. If + PREDICATES is not NULL, it is a string listing possible predicates + for the spec entry; if an entry predicated on any of these is + found, it is returned, otherwise NULL is returned. */ static const format_flag_spec * get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates) @@ -1367,10 +1155,8 @@ get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates) else if (spec[i].predicate == 0) return &spec[i]; } - if (predicates == NULL) - abort (); - else - return NULL; + gcc_assert (predicates); + return NULL; } @@ -1379,7 +1165,7 @@ get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates) PARAMS is the list of argument values. */ static void -check_format_info (int *status, function_format_info *info, tree params) +check_format_info (function_format_info *info, tree params) { format_check_context format_ctx; unsigned HOST_WIDE_INT arg_num; @@ -1411,7 +1197,6 @@ check_format_info (int *status, function_format_info *info, tree params) format_ctx.res = &res; format_ctx.info = info; format_ctx.params = params; - format_ctx.status = status; check_function_arguments_recurse (check_format_arg, &format_ctx, format_tree, arg_num); @@ -1425,8 +1210,8 @@ check_format_info (int *status, function_format_info *info, tree params) { /* For strftime-like formats, warn for not checking the format string; but there are no arguments to check. */ - if (warn_format_nonliteral) - status_warning (status, "format not a string literal, format string not checked"); + warning (OPT_Wformat_nonliteral, + "format not a string literal, format string not checked"); } else if (info->first_arg_num != 0) { @@ -1439,10 +1224,15 @@ check_format_info (int *status, function_format_info *info, tree params) params = TREE_CHAIN (params); ++arg_num; } - if (params == 0 && (warn_format_nonliteral || warn_format_security)) - status_warning (status, "format not a string literal and no format arguments"); - else if (warn_format_nonliteral) - status_warning (status, "format not a string literal, argument types not checked"); + if (params == 0 && warn_format_security) + warning (OPT_Wformat_security, + "format not a string literal and no format arguments"); + else if (params == 0 && warn_format_nonliteral) + warning (OPT_Wformat_nonliteral, + "format not a string literal and no format arguments"); + else + warning (OPT_Wformat_nonliteral, + "format not a string literal, argument types not checked"); } } @@ -1454,21 +1244,21 @@ check_format_info (int *status, function_format_info *info, tree params) If the format is an empty string, this should be counted similarly to the case of extra format arguments. */ if (res.number_extra_args > 0 && res.number_non_literal == 0 - && res.number_other == 0 && warn_format_extra_args) - status_warning (status, "too many arguments for format"); + && res.number_other == 0) + warning (OPT_Wformat_extra_args, "too many arguments for format"); if (res.number_dollar_extra_args > 0 && res.number_non_literal == 0 - && res.number_other == 0 && warn_format_extra_args) - status_warning (status, "unused arguments in $-style format"); + && res.number_other == 0) + warning (OPT_Wformat_extra_args, "unused arguments in $-style format"); if (res.number_empty > 0 && res.number_non_literal == 0 - && res.number_other == 0 && warn_format_zero_length) - status_warning (status, "zero-length %s format string", - format_types[info->format_type].name); + && res.number_other == 0) + warning (OPT_Wformat_zero_length, "zero-length %s format string", + format_types[info->format_type].name); if (res.number_wide > 0) - status_warning (status, "format is a wide character string"); + warning (OPT_Wformat, "format is a wide character string"); if (res.number_unterminated > 0) - status_warning (status, "unterminated format string"); + warning (OPT_Wformat, "unterminated format string"); } /* Callback from check_function_arguments_recurse to check a @@ -1480,11 +1270,10 @@ static void check_format_arg (void *ctx, tree format_tree, unsigned HOST_WIDE_INT arg_num) { - format_check_context *format_ctx = ctx; + format_check_context *format_ctx = (format_check_context *) ctx; format_check_results *res = format_ctx->res; function_format_info *info = format_ctx->info; tree params = format_ctx->params; - int *status = format_ctx->status; int format_length; HOST_WIDE_INT offset; @@ -1546,6 +1335,10 @@ check_format_arg (void *ctx, tree format_tree, return; } format_tree = TREE_OPERAND (format_tree, 0); + if (TREE_CODE (format_tree) == ARRAY_REF + && host_integerp (TREE_OPERAND (format_tree, 1), 0) + && (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0) + format_tree = TREE_OPERAND (format_tree, 0); if (TREE_CODE (format_tree) == VAR_DECL && TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE && (array_init = decl_constant_value (format_tree)) != format_tree @@ -1572,8 +1365,8 @@ check_format_arg (void *ctx, tree format_tree, if (array_size != 0) { /* Variable length arrays can't be initialized. */ - if (TREE_CODE (array_size) != INTEGER_CST) - abort (); + gcc_assert (TREE_CODE (array_size) == INTEGER_CST); + if (host_integerp (array_size, 0)) { HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size); @@ -1621,7 +1414,7 @@ check_format_arg (void *ctx, tree format_tree, will decrement it if it finds there are extra arguments, but this way need not adjust it for every return. */ res->number_other++; - check_format_info_main (status, res, info, format_chars, format_length, + check_format_info_main (res, info, format_chars, format_length, params, arg_num); } @@ -1634,7 +1427,7 @@ check_format_arg (void *ctx, tree format_tree, argument in the list of arguments. */ static void -check_format_info_main (int *status, format_check_results *res, +check_format_info_main (format_check_results *res, function_format_info *info, const char *format_chars, int format_length, tree params, unsigned HOST_WIDE_INT arg_num) @@ -1675,10 +1468,11 @@ check_format_info_main (int *status, format_check_results *res, const format_char_info *fci = NULL; char flag_chars[256]; int aflag = 0; + const char *format_start = format_chars; if (*format_chars == 0) { if (format_chars - orig_format_chars != format_length) - status_warning (status, "embedded `\\0' in format"); + warning (OPT_Wformat, "embedded %<\\0%> in format"); if (info->first_arg_num != 0 && params != 0 && has_operand_number <= 0) { @@ -1686,14 +1480,14 @@ check_format_info_main (int *status, format_check_results *res, res->number_extra_args++; } if (has_operand_number > 0) - finish_dollar_format_checking (status, res, fki->flags & (int) FMT_FLAG_DOLLAR_GAP_POINTER_OK); + finish_dollar_format_checking (res, fki->flags & (int) FMT_FLAG_DOLLAR_GAP_POINTER_OK); return; } if (*format_chars++ != '%') continue; if (*format_chars == 0) { - status_warning (status, "spurious trailing `%%' in format"); + warning (OPT_Wformat, "spurious trailing %<%%%> in format"); continue; } if (*format_chars == '%') @@ -1710,7 +1504,7 @@ check_format_info_main (int *status, format_check_results *res, is not used here, we can't immediately conclude this is a format without them, since it could be printf %m or scanf %*. */ int opnum; - opnum = maybe_read_dollar_number (status, &format_chars, 0, + opnum = maybe_read_dollar_number (&format_chars, 0, first_fillin_param, &main_arg_params, fki); if (opnum == -1) @@ -1721,6 +1515,11 @@ check_format_info_main (int *status, format_check_results *res, main_arg_num = opnum + info->first_arg_num - 1; } } + else if (fki->flags & FMT_FLAG_USE_DOLLAR) + { + if (avoid_dollar_number (format_chars)) + return; + } /* Read any format flags, but do not yet validate them beyond removing duplicates, since in general validation depends on the rest of @@ -1732,7 +1531,7 @@ check_format_info_main (int *status, format_check_results *res, *format_chars, NULL); if (strchr (flag_chars, *format_chars) != 0) { - status_warning (status, "repeated %s in format", _(s->name)); + warning (OPT_Wformat, "repeated %s in format", _(s->name)); } else { @@ -1745,7 +1544,7 @@ check_format_info_main (int *status, format_check_results *res, ++format_chars; if (*format_chars == 0) { - status_warning (status, "missing fill character at end of strfmon format"); + warning (OPT_Wformat, "missing fill character at end of strfmon format"); return; } } @@ -1766,7 +1565,7 @@ check_format_info_main (int *status, format_check_results *res, if (has_operand_number != 0) { int opnum; - opnum = maybe_read_dollar_number (status, &format_chars, + opnum = maybe_read_dollar_number (&format_chars, has_operand_number == 1, first_fillin_param, ¶ms, fki); @@ -1780,11 +1579,16 @@ check_format_info_main (int *status, format_check_results *res, else has_operand_number = 0; } + else + { + if (avoid_dollar_number (format_chars)) + return; + } if (info->first_arg_num != 0) { if (params == 0) { - status_warning (status, "too few arguments for format"); + warning (OPT_Wformat, "too few arguments for format"); return; } cur_param = TREE_VALUE (params); @@ -1825,8 +1629,7 @@ check_format_info_main (int *status, format_check_results *res, } if (found_width && !non_zero_width_char && (fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD)) - status_warning (status, "zero width in %s format", - fki->name); + warning (OPT_Wformat, "zero width in %s format", fki->name); if (found_width) { i = strlen (flag_chars); @@ -1844,8 +1647,7 @@ check_format_info_main (int *status, format_check_results *res, flag_chars[i++] = fki->left_precision_char; flag_chars[i] = 0; if (!ISDIGIT (*format_chars)) - status_warning (status, "empty left precision in %s format", - fki->name); + warning (OPT_Wformat, "empty left precision in %s format", fki->name); while (ISDIGIT (*format_chars)) ++format_chars; } @@ -1865,7 +1667,7 @@ check_format_info_main (int *status, format_check_results *res, if (has_operand_number != 0) { int opnum; - opnum = maybe_read_dollar_number (status, &format_chars, + opnum = maybe_read_dollar_number (&format_chars, has_operand_number == 1, first_fillin_param, ¶ms, fki); @@ -1879,11 +1681,16 @@ check_format_info_main (int *status, format_check_results *res, else has_operand_number = 0; } + else + { + if (avoid_dollar_number (format_chars)) + return; + } if (info->first_arg_num != 0) { if (params == 0) { - status_warning (status, "too few arguments for format"); + warning (OPT_Wformat, "too few arguments for format"); return; } cur_param = TREE_VALUE (params); @@ -1913,8 +1720,7 @@ check_format_info_main (int *status, format_check_results *res, { if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK) && !ISDIGIT (*format_chars)) - status_warning (status, "empty precision in %s format", - fki->name); + warning (OPT_Wformat, "empty precision in %s format", fki->name); while (ISDIGIT (*format_chars)) ++format_chars; } @@ -1953,9 +1759,10 @@ check_format_info_main (int *status, format_check_results *res, { /* Warn if the length modifier is non-standard. */ if (ADJ_STD (length_chars_std) > C_STD_VER) - status_warning (status, "%s does not support the `%s' %s length modifier", - C_STD_NAME (length_chars_std), length_chars, - fki->name); + warning (OPT_Wformat, + "%s does not support the %qs %s length modifier", + C_STD_NAME (length_chars_std), length_chars, + fki->name); } } @@ -1969,7 +1776,7 @@ check_format_info_main (int *status, format_check_results *res, { const format_flag_spec *s = get_flag_spec (flag_specs, *format_chars, NULL); - status_warning (status, "repeated %s in format", _(s->name)); + warning (OPT_Wformat, "repeated %s in format", _(s->name)); } else { @@ -1989,7 +1796,7 @@ check_format_info_main (int *status, format_check_results *res, if (format_chars[1] == 's' || format_chars[1] == 'S' || format_chars[1] == '[') { - /* `a' is used as a flag. */ + /* 'a' is used as a flag. */ i = strlen (flag_chars); flag_chars[i++] = 'a'; flag_chars[i] = 0; @@ -2003,7 +1810,7 @@ check_format_info_main (int *status, format_check_results *res, || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK) && format_char == '%')) { - status_warning (status, "conversion lacks type at end of format"); + warning (OPT_Wformat, "conversion lacks type at end of format"); continue; } format_chars++; @@ -2013,19 +1820,19 @@ check_format_info_main (int *status, format_check_results *res, ++fci; if (fci->format_chars == 0) { - if (ISGRAPH(format_char)) - status_warning (status, "unknown conversion type character `%c' in format", + if (ISGRAPH (format_char)) + warning (OPT_Wformat, "unknown conversion type character %qc in format", format_char); else - status_warning (status, "unknown conversion type character 0x%x in format", + warning (OPT_Wformat, "unknown conversion type character 0x%x in format", format_char); continue; } if (pedantic) { if (ADJ_STD (fci->std) > C_STD_VER) - status_warning (status, "%s does not support the `%%%c' %s format", - C_STD_NAME (fci->std), format_char, fki->name); + warning (OPT_Wformat, "%s does not support the %<%%%c%> %s format", + C_STD_NAME (fci->std), format_char, fki->name); } /* Validate the individual flags used, removing any that are invalid. */ @@ -2040,8 +1847,8 @@ check_format_info_main (int *status, format_check_results *res, continue; if (strchr (fci->flag_chars, flag_chars[i]) == 0) { - status_warning (status, "%s used with `%%%c' %s format", - _(s->name), format_char, fki->name); + warning (OPT_Wformat, "%s used with %<%%%c%> %s format", + _(s->name), format_char, fki->name); d++; continue; } @@ -2049,8 +1856,8 @@ check_format_info_main (int *status, format_check_results *res, { const format_flag_spec *t; if (ADJ_STD (s->std) > C_STD_VER) - status_warning (status, "%s does not support %s", - C_STD_NAME (s->std), _(s->long_name)); + warning (OPT_Wformat, "%s does not support %s", + C_STD_NAME (s->std), _(s->long_name)); t = get_flag_spec (flag_specs, flag_chars[i], fci->flags2); if (t != NULL && ADJ_STD (t->std) > ADJ_STD (s->std)) { @@ -2058,9 +1865,10 @@ check_format_info_main (int *status, format_check_results *res, ? t->long_name : s->long_name); if (ADJ_STD (t->std) > C_STD_VER) - status_warning (status, "%s does not support %s with the `%%%c' %s format", - C_STD_NAME (t->std), _(long_name), - format_char, fki->name); + warning (OPT_Wformat, + "%s does not support %s with the %<%%%c%> %s format", + C_STD_NAME (t->std), _(long_name), + format_char, fki->name); } } } @@ -2091,22 +1899,24 @@ check_format_info_main (int *status, format_check_results *res, if (bad_flag_pairs[i].ignored) { if (bad_flag_pairs[i].predicate != 0) - status_warning (status, "%s ignored with %s and `%%%c' %s format", - _(s->name), _(t->name), format_char, - fki->name); + warning (OPT_Wformat, + "%s ignored with %s and %<%%%c%> %s format", + _(s->name), _(t->name), format_char, + fki->name); else - status_warning (status, "%s ignored with %s in %s format", - _(s->name), _(t->name), fki->name); + warning (OPT_Wformat, "%s ignored with %s in %s format", + _(s->name), _(t->name), fki->name); } else { if (bad_flag_pairs[i].predicate != 0) - status_warning (status, "use of %s and %s together with `%%%c' %s format", - _(s->name), _(t->name), format_char, - fki->name); + warning (OPT_Wformat, + "use of %s and %s together with %<%%%c%> %s format", + _(s->name), _(t->name), format_char, + fki->name); else - status_warning (status, "use of %s and %s together in %s format", - _(s->name), _(t->name), fki->name); + warning (OPT_Wformat, "use of %s and %s together in %s format", + _(s->name), _(t->name), fki->name); } } @@ -2124,10 +1934,11 @@ check_format_info_main (int *status, format_check_results *res, else if (strchr (fci->flags2, '2') != 0) y2k_level = 2; if (y2k_level == 3) - status_warning (status, "`%%%c' yields only last 2 digits of year in some locales", - format_char); + warning (OPT_Wformat_y2k, "%<%%%c%> yields only last 2 digits of " + "year in some locales", format_char); else if (y2k_level == 2) - status_warning (status, "`%%%c' yields only last 2 digits of year", format_char); + warning (OPT_Wformat_y2k, "%<%%%c%> yields only last 2 digits of " + "year", format_char); } if (strchr (fci->flags2, '[') != 0) @@ -2143,7 +1954,7 @@ check_format_info_main (int *status, format_check_results *res, ++format_chars; if (*format_chars != ']') /* The end of the format string was reached. */ - status_warning (status, "no closing `]' for `%%[' format"); + warning (OPT_Wformat, "no closing %<]%> for %<%%[%> format"); } wanted_type = 0; @@ -2156,14 +1967,15 @@ check_format_info_main (int *status, format_check_results *res, wanted_type_std = fci->types[length_chars_val].std; if (wanted_type == 0) { - status_warning (status, "use of `%s' length modifier with `%c' type character", - length_chars, format_char); + warning (OPT_Wformat, + "use of %qs length modifier with %qc type character", + length_chars, format_char); /* Heuristic: skip one argument when an invalid length/type combination is encountered. */ arg_num++; if (params == 0) { - status_warning (status, "too few arguments for format"); + warning (OPT_Wformat, "too few arguments for format"); return; } params = TREE_CHAIN (params); @@ -2177,12 +1989,15 @@ check_format_info_main (int *status, format_check_results *res, && ADJ_STD (wanted_type_std) > ADJ_STD (fci->std)) { if (ADJ_STD (wanted_type_std) > C_STD_VER) - status_warning (status, "%s does not support the `%%%s%c' %s format", - C_STD_NAME (wanted_type_std), length_chars, - format_char, fki->name); + warning (OPT_Wformat, + "%s does not support the %<%%%s%c%> %s format", + C_STD_NAME (wanted_type_std), length_chars, + format_char, fki->name); } } + main_wanted_type.next = NULL; + /* Finally. . .check type of argument against desired type! */ if (info->first_arg_num == 0) continue; @@ -2192,13 +2007,17 @@ check_format_info_main (int *status, format_check_results *res, if (main_arg_num != 0) { if (suppressed) - status_warning (status, "operand number specified with suppressed assignment"); + warning (OPT_Wformat, "operand number specified with " + "suppressed assignment"); else - status_warning (status, "operand number specified for format taking no argument"); + warning (OPT_Wformat, "operand number specified for format " + "taking no argument"); } } else { + format_wanted_type *wanted_type_ptr; + if (main_arg_num != 0) { arg_num = main_arg_num; @@ -2209,50 +2028,77 @@ check_format_info_main (int *status, format_check_results *res, ++arg_num; if (has_operand_number > 0) { - status_warning (status, "missing $ operand number in format"); + warning (OPT_Wformat, "missing $ operand number in format"); return; } else has_operand_number = 0; + } + + wanted_type_ptr = &main_wanted_type; + while (fci) + { if (params == 0) { - status_warning (status, "too few arguments for format"); + warning (OPT_Wformat, "too few arguments for format"); return; } + + cur_param = TREE_VALUE (params); + params = TREE_CHAIN (params); + + wanted_type_ptr->wanted_type = wanted_type; + wanted_type_ptr->wanted_type_name = wanted_type_name; + wanted_type_ptr->pointer_count = fci->pointer_count + aflag; + wanted_type_ptr->char_lenient_flag = 0; + if (strchr (fci->flags2, 'c') != 0) + wanted_type_ptr->char_lenient_flag = 1; + wanted_type_ptr->writing_in_flag = 0; + wanted_type_ptr->reading_from_flag = 0; + if (aflag) + wanted_type_ptr->writing_in_flag = 1; + else + { + if (strchr (fci->flags2, 'W') != 0) + wanted_type_ptr->writing_in_flag = 1; + if (strchr (fci->flags2, 'R') != 0) + wanted_type_ptr->reading_from_flag = 1; + } + wanted_type_ptr->name = NULL; + wanted_type_ptr->param = cur_param; + wanted_type_ptr->arg_num = arg_num; + wanted_type_ptr->next = NULL; + if (last_wanted_type != 0) + last_wanted_type->next = wanted_type_ptr; + if (first_wanted_type == 0) + first_wanted_type = wanted_type_ptr; + last_wanted_type = wanted_type_ptr; + + fci = fci->chain; + if (fci) + { + wanted_type_ptr = GGC_NEW (format_wanted_type); + arg_num++; + wanted_type = *fci->types[length_chars_val].type; + wanted_type_name = fci->types[length_chars_val].name; + } } - cur_param = TREE_VALUE (params); - params = TREE_CHAIN (params); - main_wanted_type.wanted_type = wanted_type; - main_wanted_type.wanted_type_name = wanted_type_name; - main_wanted_type.pointer_count = fci->pointer_count + aflag; - main_wanted_type.char_lenient_flag = 0; - if (strchr (fci->flags2, 'c') != 0) - main_wanted_type.char_lenient_flag = 1; - main_wanted_type.writing_in_flag = 0; - main_wanted_type.reading_from_flag = 0; - if (aflag) - main_wanted_type.writing_in_flag = 1; - else - { - if (strchr (fci->flags2, 'W') != 0) - main_wanted_type.writing_in_flag = 1; - if (strchr (fci->flags2, 'R') != 0) - main_wanted_type.reading_from_flag = 1; - } - main_wanted_type.name = NULL; - main_wanted_type.param = cur_param; - main_wanted_type.arg_num = arg_num; - main_wanted_type.next = NULL; - if (last_wanted_type != 0) - last_wanted_type->next = &main_wanted_type; - if (first_wanted_type == 0) - first_wanted_type = &main_wanted_type; - last_wanted_type = &main_wanted_type; } if (first_wanted_type != 0) - check_format_types (status, first_wanted_type); + check_format_types (first_wanted_type, format_start, + format_chars - format_start); + if (main_wanted_type.next != NULL) + { + format_wanted_type *wanted_type_ptr = main_wanted_type.next; + while (wanted_type_ptr) + { + format_wanted_type *next = wanted_type_ptr->next; + ggc_free (wanted_type_ptr); + wanted_type_ptr = next; + } + } } } @@ -2260,7 +2106,8 @@ check_format_info_main (int *status, format_check_results *res, /* Check the argument types from a single format conversion (possibly including width and precision arguments). */ static void -check_format_types (int *status, format_wanted_type *types) +check_format_types (format_wanted_type *types, const char *format_start, + int format_length) { for (; types != 0; types = types->next) { @@ -2275,18 +2122,19 @@ check_format_types (int *status, format_wanted_type *types) cur_type = TREE_TYPE (cur_param); if (cur_type == error_mark_node) continue; + orig_cur_type = cur_type; char_type_flag = 0; wanted_type = types->wanted_type; arg_num = types->arg_num; /* The following should not occur here. */ - if (wanted_type == 0) - abort (); - if (wanted_type == void_type_node && types->pointer_count == 0) - abort (); + gcc_assert (wanted_type); + gcc_assert (wanted_type != void_type_node || types->pointer_count); if (types->pointer_count == 0) - wanted_type = (*lang_hooks.types.type_promotes_to) (wanted_type); + wanted_type = lang_hooks.types.type_promotes_to (wanted_type); + + wanted_type = TYPE_MAIN_VARIANT (wanted_type); STRIP_NOPS (cur_param); @@ -2305,18 +2153,16 @@ check_format_types (int *status, format_wanted_type *types) && i == 0 && cur_param != 0 && integer_zerop (cur_param)) - status_warning (status, - "writing through null pointer (arg %d)", - arg_num); + warning (OPT_Wformat, "writing through null pointer " + "(argument %d)", arg_num); /* Check for reading through a NULL pointer. */ if (types->reading_from_flag && i == 0 && cur_param != 0 && integer_zerop (cur_param)) - status_warning (status, - "reading through null pointer (arg %d)", - arg_num); + warning (OPT_Wformat, "reading through null pointer " + "(argument %d)", arg_num); if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR) cur_param = TREE_OPERAND (cur_param, 0); @@ -2332,10 +2178,11 @@ check_format_types (int *status, format_wanted_type *types) && i == 0 && (TYPE_READONLY (cur_type) || (cur_param != 0 - && (TREE_CODE_CLASS (TREE_CODE (cur_param)) == 'c' + && (CONSTANT_CLASS_P (cur_param) || (DECL_P (cur_param) && TREE_READONLY (cur_param)))))) - status_warning (status, "writing into constant object (arg %d)", arg_num); + warning (OPT_Wformat, "writing into constant object " + "(argument %d)", arg_num); /* If there are extra type qualifiers beyond the first indirection, then this makes the types technically @@ -2345,16 +2192,17 @@ check_format_types (int *status, format_wanted_type *types) && (TYPE_READONLY (cur_type) || TYPE_VOLATILE (cur_type) || TYPE_RESTRICT (cur_type))) - status_warning (status, "extra type qualifiers in format argument (arg %d)", + warning (OPT_Wformat, "extra type qualifiers in format " + "argument (argument %d)", arg_num); } else { - if (types->pointer_count == 1) - status_warning (status, "format argument is not a pointer (arg %d)", arg_num); - else - status_warning (status, "format argument is not a pointer to a pointer (arg %d)", arg_num); + format_type_warning (types->name, format_start, format_length, + wanted_type, types->pointer_count, + types->wanted_type_name, orig_cur_type, + arg_num); break; } } @@ -2362,7 +2210,6 @@ check_format_types (int *status, format_wanted_type *types) if (i < types->pointer_count) continue; - orig_cur_type = cur_type; cur_type = TYPE_MAIN_VARIANT (cur_type); /* Check whether the argument type is a character type. This leniency @@ -2374,9 +2221,9 @@ check_format_types (int *status, format_wanted_type *types) || cur_type == unsigned_char_type_node); /* Check the type of the "real" argument, if there's a type we want. */ - if (wanted_type == cur_type) + if (lang_hooks.types_compatible_p (wanted_type, cur_type)) continue; - /* If we want `void *', allow any pointer type. + /* If we want 'void *', allow any pointer type. (Anything else would already have got a warning.) With -pedantic, only allow pointers to void and to character types. */ @@ -2389,116 +2236,126 @@ check_format_types (int *status, format_wanted_type *types) a second level of indirection. */ if (TREE_CODE (wanted_type) == INTEGER_TYPE && TREE_CODE (cur_type) == INTEGER_TYPE - && (! pedantic || i == 0 || (i == 1 && char_type_flag)) - && (TREE_UNSIGNED (wanted_type) + && (!pedantic || i == 0 || (i == 1 && char_type_flag)) + && (TYPE_UNSIGNED (wanted_type) ? wanted_type == c_common_unsigned_type (cur_type) : wanted_type == c_common_signed_type (cur_type))) continue; /* Likewise, "signed char", "unsigned char" and "char" are equivalent but the above test won't consider them equivalent. */ if (wanted_type == char_type_node - && (! pedantic || i < 2) + && (!pedantic || i < 2) && char_type_flag) continue; /* Now we have a type mismatch. */ - { - const char *this; - const char *that; - tree tmp; - - tmp = TYPE_NAME (wanted_type); - if (TREE_CODE (tmp) == TYPE_DECL) - tmp = DECL_NAME (tmp); - this = IDENTIFIER_POINTER (tmp); - - that = 0; - if (TYPE_NAME (orig_cur_type) != 0 - && TREE_CODE (orig_cur_type) != INTEGER_TYPE - && !(TREE_CODE (orig_cur_type) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (orig_cur_type)) == INTEGER_TYPE)) - { - tmp = TYPE_NAME (orig_cur_type); - if (TREE_CODE (tmp) == TYPE_DECL) - tmp = DECL_NAME (tmp); - if (tmp) - that = IDENTIFIER_POINTER (tmp); - } - - /* A nameless type can't possibly match what the format wants. - So there will be a warning for it. - Make up a string to describe vaguely what it is. */ - if (that == 0) - { - if (TREE_CODE (orig_cur_type) == POINTER_TYPE) - that = _("pointer"); - else - that = _("different type"); - } - - /* Make the warning better in case of mismatch of int vs long. */ - if (TREE_CODE (orig_cur_type) == INTEGER_TYPE - && TREE_CODE (wanted_type) == INTEGER_TYPE - && TYPE_PRECISION (orig_cur_type) == TYPE_PRECISION (wanted_type) - && TYPE_NAME (orig_cur_type) != 0 - && TREE_CODE (TYPE_NAME (orig_cur_type)) == TYPE_DECL) - that = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (orig_cur_type))); - - if (strcmp (this, that) != 0) - { - /* There may be a better name for the format, e.g. size_t, - but we should allow for programs with a perverse typedef - making size_t something other than what the compiler - thinks. */ - if (types->wanted_type_name != 0 - && strcmp (types->wanted_type_name, that) != 0) - this = types->wanted_type_name; - if (types->name != 0) - status_warning (status, "%s is not type %s (arg %d)", types->name, this, - arg_num); - else - status_warning (status, "%s format, %s arg (arg %d)", this, that, arg_num); - } - } + format_type_warning (types->name, format_start, format_length, + wanted_type, types->pointer_count, + types->wanted_type_name, orig_cur_type, arg_num); } } + +/* Give a warning about a format argument of different type from that + expected. DESCR is a description such as "field precision", or + NULL for an ordinary format. For an ordinary format, FORMAT_START + points to where the format starts in the format string and + FORMAT_LENGTH is its length. WANTED_TYPE is the type the argument + should have after POINTER_COUNT pointer dereferences. + WANTED_NAME_NAME is a possibly more friendly name of WANTED_TYPE, + or NULL if the ordinary name of the type should be used. ARG_TYPE + is the type of the actual argument. ARG_NUM is the number of that + argument. */ +static void +format_type_warning (const char *descr, const char *format_start, + int format_length, tree wanted_type, int pointer_count, + const char *wanted_type_name, tree arg_type, int arg_num) +{ + char *p; + /* If ARG_TYPE is a typedef with a misleading name (for example, + size_t but not the standard size_t expected by printf %zu), avoid + printing the typedef name. */ + if (wanted_type_name + && TYPE_NAME (arg_type) + && TREE_CODE (TYPE_NAME (arg_type)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (arg_type)) + && !strcmp (wanted_type_name, + lang_hooks.decl_printable_name (TYPE_NAME (arg_type), 2))) + arg_type = TYPE_MAIN_VARIANT (arg_type); + /* The format type and name exclude any '*' for pointers, so those + must be formatted manually. For all the types we currently have, + this is adequate, but formats taking pointers to functions or + arrays would require the full type to be built up in order to + print it with %T. */ + p = (char *) alloca (pointer_count + 2); + if (pointer_count == 0) + p[0] = 0; + else if (c_dialect_cxx ()) + { + memset (p, '*', pointer_count); + p[pointer_count] = 0; + } + else + { + p[0] = ' '; + memset (p + 1, '*', pointer_count); + p[pointer_count + 1] = 0; + } + if (wanted_type_name) + { + if (descr) + warning (OPT_Wformat, "%s should have type %<%s%s%>, " + "but argument %d has type %qT", + descr, wanted_type_name, p, arg_num, arg_type); + else + warning (OPT_Wformat, "format %q.*s expects type %<%s%s%>, " + "but argument %d has type %qT", + format_length, format_start, wanted_type_name, p, + arg_num, arg_type); + } + else + { + if (descr) + warning (OPT_Wformat, "%s should have type %<%T%s%>, " + "but argument %d has type %qT", + descr, wanted_type, p, arg_num, arg_type); + else + warning (OPT_Wformat, "format %q.*s expects type %<%T%s%>, " + "but argument %d has type %qT", + format_length, format_start, wanted_type, p, arg_num, arg_type); + } +} + + /* Given a format_char_info array FCI, and a character C, this function returns the index into the conversion_specs where that specifier's - data is located. If the character isn't found it aborts. */ + data is located. The character must exist. */ static unsigned int find_char_info_specifier_index (const format_char_info *fci, int c) { - unsigned int i = 0; - - while (fci->format_chars) - { - if (strchr (fci->format_chars, c)) - return i; - i++; fci++; - } - + unsigned i; + + for (i = 0; fci->format_chars; i++, fci++) + if (strchr (fci->format_chars, c)) + return i; + /* We shouldn't be looking for a non-existent specifier. */ - abort (); + gcc_unreachable (); } /* Given a format_length_info array FLI, and a character C, this function returns the index into the conversion_specs where that - modifier's data is located. If the character isn't found it - aborts. */ + modifier's data is located. The character must exist. */ static unsigned int find_length_info_modifier_index (const format_length_info *fli, int c) { - unsigned int i = 0; - - while (fli->name) - { - if (strchr (fli->name, c)) - return i; - i++; fli++; - } - + unsigned i; + + for (i = 0; fli->name; i++, fli++) + if (strchr (fli->name, c)) + return i; + /* We shouldn't be looking for a non-existent modifier. */ - abort (); + gcc_unreachable (); } /* Determine the type of HOST_WIDE_INT in the code being compiled for @@ -2508,12 +2365,12 @@ static void init_dynamic_asm_fprintf_info (void) { static tree hwi; - + if (!hwi) { format_length_info *new_asm_fprintf_length_specs; unsigned int i; - + /* Find the underlying type for HOST_WIDE_INT. For the %w length modifier to work, one must have issued: "typedef HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code @@ -2521,27 +2378,27 @@ init_dynamic_asm_fprintf_info (void) hwi = maybe_get_identifier ("__gcc_host_wide_int__"); if (!hwi) { - error ("'__gcc_host_wide_int__' is not defined as a type"); + error ("%<__gcc_host_wide_int__%> is not defined as a type"); return; } hwi = identifier_global_value (hwi); if (!hwi || TREE_CODE (hwi) != TYPE_DECL) { - error ("'__gcc_host_wide_int__' is not defined as a type"); + error ("%<__gcc_host_wide_int__%> is not defined as a type"); return; } hwi = DECL_ORIGINAL_TYPE (hwi); - if (!hwi) - abort (); + gcc_assert (hwi); if (hwi != long_integer_type_node && hwi != long_long_integer_type_node) { - error ("'__gcc_host_wide_int__' is not defined as 'long'" - " or 'long long'"); + error ("%<__gcc_host_wide_int__%> is not defined as %" + " or %"); return; } /* Create a new (writable) copy of asm_fprintf_length_specs. */ - new_asm_fprintf_length_specs = xmemdup (asm_fprintf_length_specs, + new_asm_fprintf_length_specs = (format_length_info *) + xmemdup (asm_fprintf_length_specs, sizeof (asm_fprintf_length_specs), sizeof (asm_fprintf_length_specs)); @@ -2552,7 +2409,7 @@ init_dynamic_asm_fprintf_info (void) else if (hwi == long_long_integer_type_node) new_asm_fprintf_length_specs[i].index = FMT_LEN_ll; else - abort (); + gcc_unreachable (); /* Assign the new data for use. */ dynamic_format_types[asm_fprintf_format_type].length_char_specs = @@ -2560,6 +2417,55 @@ init_dynamic_asm_fprintf_info (void) } } +/* Determine the type of a "locus" in the code being compiled for use + in GCC's __gcc_gfc__ custom format attribute. You must have set + dynamic_format_types before calling this function. */ +static void +init_dynamic_gfc_info (void) +{ + static tree locus; + + if (!locus) + { + static format_char_info *gfc_fci; + + /* For the GCC __gcc_gfc__ custom format specifier to work, one + must have declared 'locus' prior to using this attribute. If + we haven't seen this declarations then you shouldn't use the + specifier requiring that type. */ + if ((locus = maybe_get_identifier ("locus"))) + { + locus = identifier_global_value (locus); + if (locus) + { + if (TREE_CODE (locus) != TYPE_DECL) + { + error ("% is not defined as a type"); + locus = 0; + } + else + locus = TREE_TYPE (locus); + } + } + + /* Assign the new data for use. */ + + /* Handle the __gcc_gfc__ format specifics. */ + if (!gfc_fci) + dynamic_format_types[gcc_gfc_format_type].conversion_specs = + gfc_fci = (format_char_info *) + xmemdup (gcc_gfc_char_table, + sizeof (gcc_gfc_char_table), + sizeof (gcc_gfc_char_table)); + if (locus) + { + const unsigned i = find_char_info_specifier_index (gfc_fci, 'L'); + gfc_fci[i].types[0].type = &locus; + gfc_fci[i].pointer_count = 1; + } + } +} + /* Determine the types of "tree" and "location_t" in the code being compiled for use in GCC's diagnostic custom format attributes. You must have set dynamic_format_types before calling this function. */ @@ -2567,15 +2473,15 @@ static void init_dynamic_diag_info (void) { static tree t, loc, hwi; - + if (!loc || !t || !hwi) { - static format_char_info *diag_fci, *cdiag_fci, *cxxdiag_fci; + static format_char_info *diag_fci, *tdiag_fci, *cdiag_fci, *cxxdiag_fci; static format_length_info *diag_ls; unsigned int i; /* For the GCC-diagnostics custom format specifiers to work, one - must have declared `tree' and/or `location_t' prior to using + must have declared 'tree' and/or 'location_t' prior to using those attributes. If we haven't seen these declarations then you shouldn't use the specifiers requiring these types. However we don't force a hard ICE because we may see only one @@ -2587,7 +2493,7 @@ init_dynamic_diag_info (void) { if (TREE_CODE (loc) != TYPE_DECL) { - error ("'location_t' is not defined as a type"); + error ("% is not defined as a type"); loc = 0; } else @@ -2595,7 +2501,7 @@ init_dynamic_diag_info (void) } } - /* We need to grab the underlying `union tree_node' so peek into + /* We need to grab the underlying 'union tree_node' so peek into an extra type level. */ if ((t = maybe_get_identifier ("tree"))) { @@ -2604,19 +2510,19 @@ init_dynamic_diag_info (void) { if (TREE_CODE (t) != TYPE_DECL) { - error ("'tree' is not defined as a type"); + error ("% is not defined as a type"); t = 0; } else if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE) { - error ("'tree' is not defined as a pointer type"); + error ("% is not defined as a pointer type"); t = 0; } else t = TREE_TYPE (TREE_TYPE (t)); } } - + /* Find the underlying type for HOST_WIDE_INT. For the %w length modifier to work, one must have issued: "typedef HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code @@ -2628,37 +2534,38 @@ init_dynamic_diag_info (void) { if (TREE_CODE (hwi) != TYPE_DECL) { - error ("'__gcc_host_wide_int__' is not defined as a type"); + error ("%<__gcc_host_wide_int__%> is not defined as a type"); hwi = 0; } else { hwi = DECL_ORIGINAL_TYPE (hwi); - if (!hwi) - abort (); + gcc_assert (hwi); if (hwi != long_integer_type_node && hwi != long_long_integer_type_node) { - error ("'__gcc_host_wide_int__' is not defined" - " as 'long' or 'long long'"); + error ("%<__gcc_host_wide_int__%> is not defined" + " as % or %"); hwi = 0; } } } } - + /* Assign the new data for use. */ /* All the GCC diag formats use the same length specs. */ - if (! diag_ls) + if (!diag_ls) dynamic_format_types[gcc_diag_format_type].length_char_specs = + dynamic_format_types[gcc_tdiag_format_type].length_char_specs = dynamic_format_types[gcc_cdiag_format_type].length_char_specs = dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs = - diag_ls = xmemdup (gcc_diag_length_specs, + diag_ls = (format_length_info *) + xmemdup (gcc_diag_length_specs, sizeof (gcc_diag_length_specs), - sizeof (gcc_diag_length_specs)); + sizeof (gcc_diag_length_specs)); if (hwi) - { + { /* HOST_WIDE_INT must be one of 'long' or 'long long'. */ i = find_length_info_modifier_index (diag_ls, 'w'); if (hwi == long_integer_type_node) @@ -2666,42 +2573,68 @@ init_dynamic_diag_info (void) else if (hwi == long_long_integer_type_node) diag_ls[i].index = FMT_LEN_ll; else - abort (); + gcc_unreachable (); } /* Handle the __gcc_diag__ format specifics. */ - if (! diag_fci) + if (!diag_fci) dynamic_format_types[gcc_diag_format_type].conversion_specs = - diag_fci = xmemdup (gcc_diag_char_table, - sizeof(gcc_diag_char_table), - sizeof(gcc_diag_char_table)); + diag_fci = (format_char_info *) + xmemdup (gcc_diag_char_table, + sizeof (gcc_diag_char_table), + sizeof (gcc_diag_char_table)); if (loc) - { + { i = find_char_info_specifier_index (diag_fci, 'H'); diag_fci[i].types[0].type = &loc; diag_fci[i].pointer_count = 1; } if (t) - { + { i = find_char_info_specifier_index (diag_fci, 'J'); diag_fci[i].types[0].type = &t; diag_fci[i].pointer_count = 1; } - /* Handle the __gcc_cdiag__ format specifics. */ - if (! cdiag_fci) - dynamic_format_types[gcc_cdiag_format_type].conversion_specs = - cdiag_fci = xmemdup (gcc_cdiag_char_table, - sizeof(gcc_cdiag_char_table), - sizeof(gcc_cdiag_char_table)); + /* Handle the __gcc_tdiag__ format specifics. */ + if (!tdiag_fci) + dynamic_format_types[gcc_tdiag_format_type].conversion_specs = + tdiag_fci = (format_char_info *) + xmemdup (gcc_tdiag_char_table, + sizeof (gcc_tdiag_char_table), + sizeof (gcc_tdiag_char_table)); if (loc) - { + { + i = find_char_info_specifier_index (tdiag_fci, 'H'); + tdiag_fci[i].types[0].type = &loc; + tdiag_fci[i].pointer_count = 1; + } + if (t) + { + /* All specifiers taking a tree share the same struct. */ + i = find_char_info_specifier_index (tdiag_fci, 'D'); + tdiag_fci[i].types[0].type = &t; + tdiag_fci[i].pointer_count = 1; + i = find_char_info_specifier_index (tdiag_fci, 'J'); + tdiag_fci[i].types[0].type = &t; + tdiag_fci[i].pointer_count = 1; + } + + /* Handle the __gcc_cdiag__ format specifics. */ + if (!cdiag_fci) + dynamic_format_types[gcc_cdiag_format_type].conversion_specs = + cdiag_fci = (format_char_info *) + xmemdup (gcc_cdiag_char_table, + sizeof (gcc_cdiag_char_table), + sizeof (gcc_cdiag_char_table)); + if (loc) + { i = find_char_info_specifier_index (cdiag_fci, 'H'); cdiag_fci[i].types[0].type = &loc; cdiag_fci[i].pointer_count = 1; } if (t) - { + { /* All specifiers taking a tree share the same struct. */ i = find_char_info_specifier_index (cdiag_fci, 'D'); cdiag_fci[i].types[0].type = &t; @@ -2712,19 +2645,20 @@ init_dynamic_diag_info (void) } /* Handle the __gcc_cxxdiag__ format specifics. */ - if (! cxxdiag_fci) + if (!cxxdiag_fci) dynamic_format_types[gcc_cxxdiag_format_type].conversion_specs = - cxxdiag_fci = xmemdup (gcc_cxxdiag_char_table, - sizeof(gcc_cxxdiag_char_table), - sizeof(gcc_cxxdiag_char_table)); + cxxdiag_fci = (format_char_info *) + xmemdup (gcc_cxxdiag_char_table, + sizeof (gcc_cxxdiag_char_table), + sizeof (gcc_cxxdiag_char_table)); if (loc) - { + { i = find_char_info_specifier_index (cxxdiag_fci, 'H'); cxxdiag_fci[i].types[0].type = &loc; cxxdiag_fci[i].pointer_count = 1; } if (t) - { + { /* All specifiers taking a tree share the same struct. */ i = find_char_info_specifier_index (cxxdiag_fci, 'D'); cxxdiag_fci[i].types[0].type = &t; @@ -2736,16 +2670,37 @@ init_dynamic_diag_info (void) } } +#ifdef TARGET_FORMAT_TYPES +extern const format_kind_info TARGET_FORMAT_TYPES[]; +#endif + /* Handle a "format" attribute; arguments as in struct attribute_spec.handler. */ tree -handle_format_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, +handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args, int flags, bool *no_add_attrs) { tree type = *node; function_format_info info; tree argument; +#ifdef TARGET_FORMAT_TYPES + /* If the target provides additional format types, we need to + add them to FORMAT_TYPES at first use. */ + if (TARGET_FORMAT_TYPES != NULL && !dynamic_format_types) + { + dynamic_format_types = xmalloc ((n_format_types + TARGET_N_FORMAT_TYPES) + * sizeof (dynamic_format_types[0])); + memcpy (dynamic_format_types, format_types_orig, + sizeof (format_types_orig)); + memcpy (&dynamic_format_types[n_format_types], TARGET_FORMAT_TYPES, + TARGET_N_FORMAT_TYPES * sizeof (dynamic_format_types[0])); + + format_types = dynamic_format_types; + n_format_types += TARGET_N_FORMAT_TYPES; + } +#endif + if (!decode_format_attr (args, &info, 0)) { *no_add_attrs = true; @@ -2771,7 +2726,7 @@ handle_format_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, if (arg_num != info.first_arg_num) { if (!(flags & (int) ATTR_FLAG_BUILT_IN)) - error ("args to be formatted is not '...'"); + error ("args to be formatted is not %<...%>"); *no_add_attrs = true; return NULL_TREE; } @@ -2788,29 +2743,36 @@ handle_format_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args, /* If this is a custom GCC-internal format type, we have to initialize certain bits a runtime. */ if (info.format_type == asm_fprintf_format_type + || info.format_type == gcc_gfc_format_type || info.format_type == gcc_diag_format_type + || info.format_type == gcc_tdiag_format_type || info.format_type == gcc_cdiag_format_type || info.format_type == gcc_cxxdiag_format_type) { /* Our first time through, we have to make sure that our - format_type data is allocated dynamically and is modifiable. */ + format_type data is allocated dynamically and is modifiable. */ if (!dynamic_format_types) - format_types = dynamic_format_types = + format_types = dynamic_format_types = (format_kind_info *) xmemdup (format_types_orig, sizeof (format_types_orig), sizeof (format_types_orig)); /* If this is format __asm_fprintf__, we have to initialize - GCC's notion of HOST_WIDE_INT for checking %wd. */ + GCC's notion of HOST_WIDE_INT for checking %wd. */ if (info.format_type == asm_fprintf_format_type) - init_dynamic_asm_fprintf_info(); + init_dynamic_asm_fprintf_info (); + /* If this is format __gcc_gfc__, we have to initialize GCC's + notion of 'locus' at runtime for %L. */ + else if (info.format_type == gcc_gfc_format_type) + init_dynamic_gfc_info (); /* If this is one of the diagnostic attributes, then we have to - initialize `location_t' and `tree' at runtime. */ + initialize 'location_t' and 'tree' at runtime. */ else if (info.format_type == gcc_diag_format_type + || info.format_type == gcc_tdiag_format_type || info.format_type == gcc_cdiag_format_type || info.format_type == gcc_cxxdiag_format_type) - init_dynamic_diag_info(); + init_dynamic_diag_info (); else - abort(); + gcc_unreachable (); } return NULL_TREE; diff --git a/contrib/gcc/c-format.h b/contrib/gcc/c-format.h new file mode 100644 index 00000000000..5fa544dde80 --- /dev/null +++ b/contrib/gcc/c-format.h @@ -0,0 +1,308 @@ +/* Check calls to formatted I/O functions (-Wformat). + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#ifndef GCC_C_FORMAT_H +#define GCC_C_FORMAT_H + +/* The meaningfully distinct length modifiers for format checking recognized + by GCC. */ +enum format_lengths +{ + FMT_LEN_none, + FMT_LEN_hh, + FMT_LEN_h, + FMT_LEN_l, + FMT_LEN_ll, + FMT_LEN_L, + FMT_LEN_z, + FMT_LEN_t, + FMT_LEN_j, + FMT_LEN_H, + FMT_LEN_D, + FMT_LEN_DD, + FMT_LEN_MAX +}; + + +/* The standard versions in which various format features appeared. */ +enum format_std_version +{ + STD_C89, + STD_C94, + STD_C9L, /* C99, but treat as C89 if -Wno-long-long. */ + STD_C99, + STD_EXT +}; + +/* Flags that may apply to a particular kind of format checked by GCC. */ +enum +{ + /* This format converts arguments of types determined by the + format string. */ + FMT_FLAG_ARG_CONVERT = 1, + /* The scanf allocation 'a' kludge applies to this format kind. */ + FMT_FLAG_SCANF_A_KLUDGE = 2, + /* A % during parsing a specifier is allowed to be a modified % rather + that indicating the format is broken and we are out-of-sync. */ + FMT_FLAG_FANCY_PERCENT_OK = 4, + /* With $ operand numbers, it is OK to reference the same argument more + than once. */ + FMT_FLAG_DOLLAR_MULTIPLE = 8, + /* This format type uses $ operand numbers (strfmon doesn't). */ + FMT_FLAG_USE_DOLLAR = 16, + /* Zero width is bad in this type of format (scanf). */ + FMT_FLAG_ZERO_WIDTH_BAD = 32, + /* Empty precision specification is OK in this type of format (printf). */ + FMT_FLAG_EMPTY_PREC_OK = 64, + /* Gaps are allowed in the arguments with $ operand numbers if all + arguments are pointers (scanf). */ + FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128 + /* Not included here: details of whether width or precision may occur + (controlled by width_char and precision_char); details of whether + '*' can be used for these (width_type and precision_type); details + of whether length modifiers can occur (length_char_specs). */ +}; + + +/* Structure describing a length modifier supported in format checking, and + possibly a doubled version such as "hh". */ +typedef struct +{ + /* Name of the single-character length modifier. */ + const char *name; + /* Index into a format_char_info.types array. */ + enum format_lengths index; + /* Standard version this length appears in. */ + enum format_std_version std; + /* Same, if the modifier can be repeated, or NULL if it can't. */ + const char *double_name; + enum format_lengths double_index; + enum format_std_version double_std; +} format_length_info; + + +/* Structure describing the combination of a conversion specifier + (or a set of specifiers which act identically) and a length modifier. */ +typedef struct +{ + /* The standard version this combination of length and type appeared in. + This is only relevant if greater than those for length and type + individually; otherwise it is ignored. */ + enum format_std_version std; + /* The name to use for the type, if different from that generated internally + (e.g., "signed size_t"). */ + const char *name; + /* The type itself. */ + tree *type; +} format_type_detail; + + +/* Macros to fill out tables of these. */ +#define NOARGUMENTS { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } +#define BADLEN { 0, NULL, NULL } +#define NOLENGTHS { BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } + + +/* Structure describing a format conversion specifier (or a set of specifiers + which act identically), and the length modifiers used with it. */ +typedef struct format_char_info +{ + const char *format_chars; + int pointer_count; + enum format_std_version std; + /* Types accepted for each length modifier. */ + format_type_detail types[FMT_LEN_MAX]; + /* List of other modifier characters allowed with these specifiers. + This lists flags, and additionally "w" for width, "p" for precision + (right precision, for strfmon), "#" for left precision (strfmon), + "a" for scanf "a" allocation extension (not applicable in C99 mode), + "*" for scanf suppression, and "E" and "O" for those strftime + modifiers. */ + const char *flag_chars; + /* List of additional flags describing these conversion specifiers. + "c" for generic character pointers being allowed, "2" for strftime + two digit year formats, "3" for strftime formats giving two digit + years in some locales, "4" for "2" which becomes "3" with an "E" modifier, + "o" if use of strftime "O" is a GNU extension beyond C99, + "W" if the argument is a pointer which is dereferenced and written into, + "R" if the argument is a pointer which is dereferenced and read from, + "i" for printf integer formats where the '0' flag is ignored with + precision, and "[" for the starting character of a scanf scanset. */ + const char *flags2; + /* If this format conversion character consumes more than one argument, + CHAIN points to information about the next argument. For later + arguments, only POINTER_COUNT, TYPES, and the "c", "R", and "W" flags + in FLAGS2 are used. */ + const struct format_char_info *chain; +} format_char_info; + + +/* Structure describing a flag accepted by some kind of format. */ +typedef struct +{ + /* The flag character in question (0 for end of array). */ + int flag_char; + /* Zero if this entry describes the flag character in general, or a + nonzero character that may be found in flags2 if it describes the + flag when used with certain formats only. If the latter, only + the first such entry found that applies to the current conversion + specifier is used; the values of 'name' and 'long_name' it supplies + will be used, if non-NULL and the standard version is higher than + the unpredicated one, for any pedantic warning. For example, 'o' + for strftime formats (meaning 'O' is an extension over C99). */ + int predicate; + /* Nonzero if the next character after this flag in the format should + be skipped ('=' in strfmon), zero otherwise. */ + int skip_next_char; + /* The name to use for this flag in diagnostic messages. For example, + N_("'0' flag"), N_("field width"). */ + const char *name; + /* Long name for this flag in diagnostic messages; currently only used for + "ISO C does not support ...". For example, N_("the 'I' printf flag"). */ + const char *long_name; + /* The standard version in which it appeared. */ + enum format_std_version std; +} format_flag_spec; + + +/* Structure describing a combination of flags that is bad for some kind + of format. */ +typedef struct +{ + /* The first flag character in question (0 for end of array). */ + int flag_char1; + /* The second flag character. */ + int flag_char2; + /* Nonzero if the message should say that the first flag is ignored with + the second, zero if the combination should simply be objected to. */ + int ignored; + /* Zero if this entry applies whenever this flag combination occurs, + a nonzero character from flags2 if it only applies in some + circumstances (e.g. 'i' for printf formats ignoring 0 with precision). */ + int predicate; +} format_flag_pair; + + +/* Structure describing a particular kind of format processed by GCC. */ +typedef struct +{ + /* The name of this kind of format, for use in diagnostics. Also + the name of the attribute (without preceding and following __). */ + const char *name; + /* Specifications of the length modifiers accepted; possibly NULL. */ + const format_length_info *length_char_specs; + /* Details of the conversion specification characters accepted. */ + const format_char_info *conversion_specs; + /* String listing the flag characters that are accepted. */ + const char *flag_chars; + /* String listing modifier characters (strftime) accepted. May be NULL. */ + const char *modifier_chars; + /* Details of the flag characters, including pseudo-flags. */ + const format_flag_spec *flag_specs; + /* Details of bad combinations of flags. */ + const format_flag_pair *bad_flag_pairs; + /* Flags applicable to this kind of format. */ + int flags; + /* Flag character to treat a width as, or 0 if width not used. */ + int width_char; + /* Flag character to treat a left precision (strfmon) as, + or 0 if left precision not used. */ + int left_precision_char; + /* Flag character to treat a precision (for strfmon, right precision) as, + or 0 if precision not used. */ + int precision_char; + /* If a flag character has the effect of suppressing the conversion of + an argument ('*' in scanf), that flag character, otherwise 0. */ + int suppression_char; + /* Flag character to treat a length modifier as (ignored if length + modifiers not used). Need not be placed in flag_chars for conversion + specifiers, but is used to check for bad combinations such as length + modifier with assignment suppression in scanf. */ + int length_code_char; + /* Pointer to type of argument expected if '*' is used for a width, + or NULL if '*' not used for widths. */ + tree *width_type; + /* Pointer to type of argument expected if '*' is used for a precision, + or NULL if '*' not used for precisions. */ + tree *precision_type; +} format_kind_info; + +#define T_I &integer_type_node +#define T89_I { STD_C89, NULL, T_I } +#define T_L &long_integer_type_node +#define T89_L { STD_C89, NULL, T_L } +#define T_LL &long_long_integer_type_node +#define T9L_LL { STD_C9L, NULL, T_LL } +#define TEX_LL { STD_EXT, NULL, T_LL } +#define T_S &short_integer_type_node +#define T89_S { STD_C89, NULL, T_S } +#define T_UI &unsigned_type_node +#define T89_UI { STD_C89, NULL, T_UI } +#define T_UL &long_unsigned_type_node +#define T89_UL { STD_C89, NULL, T_UL } +#define T_ULL &long_long_unsigned_type_node +#define T9L_ULL { STD_C9L, NULL, T_ULL } +#define TEX_ULL { STD_EXT, NULL, T_ULL } +#define T_US &short_unsigned_type_node +#define T89_US { STD_C89, NULL, T_US } +#define T_F &float_type_node +#define T89_F { STD_C89, NULL, T_F } +#define T99_F { STD_C99, NULL, T_F } +#define T_D &double_type_node +#define T89_D { STD_C89, NULL, T_D } +#define T99_D { STD_C99, NULL, T_D } +#define T_LD &long_double_type_node +#define T89_LD { STD_C89, NULL, T_LD } +#define T99_LD { STD_C99, NULL, T_LD } +#define T_C &char_type_node +#define T89_C { STD_C89, NULL, T_C } +#define T_SC &signed_char_type_node +#define T99_SC { STD_C99, NULL, T_SC } +#define T_UC &unsigned_char_type_node +#define T99_UC { STD_C99, NULL, T_UC } +#define T_V &void_type_node +#define T89_V { STD_C89, NULL, T_V } +#define T_W &wchar_type_node +#define T94_W { STD_C94, "wchar_t", T_W } +#define TEX_W { STD_EXT, "wchar_t", T_W } +#define T_WI &wint_type_node +#define T94_WI { STD_C94, "wint_t", T_WI } +#define TEX_WI { STD_EXT, "wint_t", T_WI } +#define T_ST &size_type_node +#define T99_ST { STD_C99, "size_t", T_ST } +#define T_SST &signed_size_type_node +#define T99_SST { STD_C99, "signed size_t", T_SST } +#define T_PD &ptrdiff_type_node +#define T99_PD { STD_C99, "ptrdiff_t", T_PD } +#define T_UPD &unsigned_ptrdiff_type_node +#define T99_UPD { STD_C99, "unsigned ptrdiff_t", T_UPD } +#define T_IM &intmax_type_node +#define T99_IM { STD_C99, "intmax_t", T_IM } +#define T_UIM &uintmax_type_node +#define T99_UIM { STD_C99, "uintmax_t", T_UIM } +#define T_D32 &dfloat32_type_node +#define TEX_D32 { STD_EXT, "_Decimal32", T_D32 } +#define T_D64 &dfloat64_type_node +#define TEX_D64 { STD_EXT, "_Decimal64", T_D64 } +#define T_D128 &dfloat128_type_node +#define TEX_D128 { STD_EXT, "_Decimal128", T_D128 } + +#endif /* GCC_C_FORMAT_H */ diff --git a/contrib/gcc/c-gimplify.c b/contrib/gcc/c-gimplify.c new file mode 100644 index 00000000000..7ddc88cf4ea --- /dev/null +++ b/contrib/gcc/c-gimplify.c @@ -0,0 +1,226 @@ +/* Tree lowering pass. This pass gimplifies the tree representation built + by the C-based front ends. The structure of gimplified, or + language-independent, trees is dictated by the grammar described in this + file. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Lowering of expressions contributed by Sebastian Pop + Re-written to support lowering of whole function trees, documentation + and miscellaneous cleanups by Diego Novillo + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "varray.h" +#include "c-tree.h" +#include "c-common.h" +#include "tree-gimple.h" +#include "hard-reg-set.h" +#include "basic-block.h" +#include "tree-flow.h" +#include "tree-inline.h" +#include "diagnostic.h" +#include "langhooks.h" +#include "langhooks-def.h" +#include "flags.h" +#include "rtl.h" +#include "toplev.h" +#include "tree-dump.h" +#include "c-pretty-print.h" +#include "cgraph.h" + + +/* The gimplification pass converts the language-dependent trees + (ld-trees) emitted by the parser into language-independent trees + (li-trees) that are the target of SSA analysis and transformations. + + Language-independent trees are based on the SIMPLE intermediate + representation used in the McCAT compiler framework: + + "Designing the McCAT Compiler Based on a Family of Structured + Intermediate Representations," + L. Hendren, C. Donawa, M. Emami, G. Gao, Justiani, and B. Sridharan, + Proceedings of the 5th International Workshop on Languages and + Compilers for Parallel Computing, no. 757 in Lecture Notes in + Computer Science, New Haven, Connecticut, pp. 406-420, + Springer-Verlag, August 3-5, 1992. + + http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html + + Basically, we walk down gimplifying the nodes that we encounter. As we + walk back up, we check that they fit our constraints, and copy them + into temporaries if not. */ + +/* Gimplification of statement trees. */ + +/* Convert the tree representation of FNDECL from C frontend trees to + GENERIC. */ + +void +c_genericize (tree fndecl) +{ + FILE *dump_orig; + int local_dump_flags; + struct cgraph_node *cgn; + + /* Dump the C-specific tree IR. */ + dump_orig = dump_begin (TDI_original, &local_dump_flags); + if (dump_orig) + { + fprintf (dump_orig, "\n;; Function %s", + lang_hooks.decl_printable_name (fndecl, 2)); + fprintf (dump_orig, " (%s)\n", + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl))); + fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original)); + fprintf (dump_orig, "\n"); + + if (local_dump_flags & TDF_RAW) + dump_node (DECL_SAVED_TREE (fndecl), + TDF_SLIM | local_dump_flags, dump_orig); + else + print_c_tree (dump_orig, DECL_SAVED_TREE (fndecl)); + fprintf (dump_orig, "\n"); + + dump_end (TDI_original, dump_orig); + } + + /* Go ahead and gimplify for now. */ + gimplify_function_tree (fndecl); + + /* Dump the genericized tree IR. */ + dump_function (TDI_generic, fndecl); + + /* Genericize all nested functions now. We do things in this order so + that items like VLA sizes are expanded properly in the context of + the correct function. */ + cgn = cgraph_node (fndecl); + for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) + c_genericize (cgn->decl); +} + +static void +add_block_to_enclosing (tree block) +{ + tree enclosing; + + for (enclosing = gimple_current_bind_expr (); + enclosing; enclosing = TREE_CHAIN (enclosing)) + if (BIND_EXPR_BLOCK (enclosing)) + break; + + enclosing = BIND_EXPR_BLOCK (enclosing); + BLOCK_SUBBLOCKS (enclosing) = chainon (BLOCK_SUBBLOCKS (enclosing), block); +} + +/* Genericize a scope by creating a new BIND_EXPR. + BLOCK is either a BLOCK representing the scope or a chain of _DECLs. + In the latter case, we need to create a new BLOCK and add it to the + BLOCK_SUBBLOCKS of the enclosing block. + BODY is a chain of C _STMT nodes for the contents of the scope, to be + genericized. */ + +tree +c_build_bind_expr (tree block, tree body) +{ + tree decls, bind; + + if (block == NULL_TREE) + decls = NULL_TREE; + else if (TREE_CODE (block) == BLOCK) + decls = BLOCK_VARS (block); + else + { + decls = block; + if (DECL_ARTIFICIAL (decls)) + block = NULL_TREE; + else + { + block = make_node (BLOCK); + BLOCK_VARS (block) = decls; + add_block_to_enclosing (block); + } + } + + if (!body) + body = build_empty_stmt (); + if (decls || block) + { + bind = build3 (BIND_EXPR, void_type_node, decls, body, block); + TREE_SIDE_EFFECTS (bind) = 1; + } + else + bind = body; + + return bind; +} + +/* Gimplification of expression trees. */ + +/* Gimplify a C99 compound literal expression. This just means adding + the DECL_EXPR before the current statement and using its anonymous + decl instead. */ + +static enum gimplify_status +gimplify_compound_literal_expr (tree *expr_p, tree *pre_p) +{ + tree decl_s = COMPOUND_LITERAL_EXPR_DECL_STMT (*expr_p); + tree decl = DECL_EXPR_DECL (decl_s); + + /* This decl isn't mentioned in the enclosing block, so add it to the + list of temps. FIXME it seems a bit of a kludge to say that + anonymous artificial vars aren't pushed, but everything else is. */ + if (DECL_NAME (decl) == NULL_TREE && !DECL_SEEN_IN_BIND_EXPR_P (decl)) + gimple_add_tmp_var (decl); + + gimplify_and_add (decl_s, pre_p); + *expr_p = decl; + return GS_OK; +} + +/* Do C-specific gimplification. Args are as for gimplify_expr. */ + +int +c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED) +{ + enum tree_code code = TREE_CODE (*expr_p); + + switch (code) + { + case DECL_EXPR: + /* This is handled mostly by gimplify.c, but we have to deal with + not warning about int x = x; as it is a GCC extension to turn off + this warning but only if warn_init_self is zero. */ + if (TREE_CODE (DECL_EXPR_DECL (*expr_p)) == VAR_DECL + && !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p)) + && !TREE_STATIC (DECL_EXPR_DECL (*expr_p)) + && (DECL_INITIAL (DECL_EXPR_DECL (*expr_p)) + == DECL_EXPR_DECL (*expr_p)) + && !warn_init_self) + TREE_NO_WARNING (DECL_EXPR_DECL (*expr_p)) = 1; + return GS_UNHANDLED; + + case COMPOUND_LITERAL_EXPR: + return gimplify_compound_literal_expr (expr_p, pre_p); + + default: + return GS_UNHANDLED; + } +} diff --git a/contrib/gcc/c-incpath.c b/contrib/gcc/c-incpath.c index b90bb7fde5d..0e534dd2337 100644 --- a/contrib/gcc/c-incpath.c +++ b/contrib/gcc/c-incpath.c @@ -1,6 +1,7 @@ /* Set up combined include path chain for the preprocessor. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003. @@ -16,11 +17,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" #include "coretypes.h" +#include "machmode.h" +#include "target.h" #include "tm.h" #include "cpplib.h" #include "prefix.h" @@ -35,7 +38,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A))) # define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC)) #else -# if (defined _WIN32 && ! defined (_UWIN)) || defined __MSDOS__ +# if (defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__ # define INO_T_EQ(A, B) 0 # else # define INO_T_EQ(A, B) ((A) == (B)) @@ -43,8 +46,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # define INO_T_COPY(DEST, SRC) (DEST) = (SRC) #endif +static const char dir_separator_str[] = { DIR_SEPARATOR, 0 }; + static void add_env_var_paths (const char *, int); -static void add_standard_paths (const char *, const char *, int); +static void add_standard_paths (const char *, const char *, const char *, int); static void free_path (struct cpp_dir *, int); static void merge_include_chains (cpp_reader *, int); static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *, @@ -107,18 +112,19 @@ add_env_var_paths (const char *env_var, int chain) path = xstrdup ("."); else { - path = xmalloc (q - p + 1); + path = XNEWVEC (char, q - p + 1); memcpy (path, p, q - p); path[q - p] = '\0'; } - add_path (path, chain, chain == SYSTEM); + add_path (path, chain, chain == SYSTEM, false); } } /* Append the standard include chain defined in cppdefault.c. */ static void -add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) +add_standard_paths (const char *sysroot, const char *iprefix, + const char *imultilib, int cxx_stdinc) { const struct default_include *p; size_t len; @@ -126,7 +132,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0) { /* Look for directories that start with the standard prefix. - "Translate" them, ie. replace /usr/local/lib/gcc... with + "Translate" them, i.e. replace /usr/local/lib/gcc... with IPREFIX and search them first. */ for (p = cpp_include_defaults; p->fname; p++) { @@ -140,7 +146,9 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len)) { char *str = concat (iprefix, p->fname + len, NULL); - add_path (str, SYSTEM, p->cxx_aware); + if (p->multilib && imultilib) + str = concat (str, dir_separator_str, imultilib, NULL); + add_path (str, SYSTEM, p->cxx_aware, false); } } } @@ -158,7 +166,10 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) else str = update_path (p->fname, p->component); - add_path (str, SYSTEM, p->cxx_aware); + if (p->multilib && imultilib) + str = concat (str, dir_separator_str, imultilib, NULL); + + add_path (str, SYSTEM, p->cxx_aware, false); } } } @@ -169,6 +180,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) JOIN, unless it duplicates JOIN in which case the last path is removed. Return the head of the resulting chain. Any of HEAD, JOIN and SYSTEM can be NULL. */ + static struct cpp_dir * remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, struct cpp_dir *system, struct cpp_dir *join, @@ -189,7 +201,13 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, if (errno != ENOENT) cpp_errno (pfile, CPP_DL_ERROR, cur->name); else - reason = REASON_NOENT; + { + /* If -Wmissing-include-dirs is given, warn. */ + cpp_options *opts = cpp_get_options (pfile); + if (opts->warn_missing_include_dirs && cur->user_supplied_p) + cpp_errno (pfile, CPP_DL_WARNING, cur->name); + reason = REASON_NOENT; + } } else if (!S_ISDIR (st.st_mode)) cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0, @@ -202,7 +220,8 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, /* Remove this one if it is in the system chain. */ reason = REASON_DUP_SYS; for (tmp = system; tmp; tmp = tmp->next) - if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev) + if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev + && cur->construct == tmp->construct) break; if (!tmp) @@ -210,14 +229,16 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, /* Duplicate of something earlier in the same chain? */ reason = REASON_DUP; for (tmp = head; tmp != cur; tmp = tmp->next) - if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev) + if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev + && cur->construct == tmp->construct) break; if (tmp == cur /* Last in the chain and duplicate of JOIN? */ && !(cur->next == NULL && join && INO_T_EQ (cur->ino, join->ino) - && cur->dev == join->dev)) + && cur->dev == join->dev + && cur->construct == join->construct)) { /* Unique, so keep this directory. */ pcur = &cur->next; @@ -241,9 +262,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, We can't just merge the lists and then uniquify them because then we may lose directories from the <> search path that should be - there; consider -Ifoo -Ibar -I- -Ifoo -Iquux. It is however safe - to treat -Ibar -Ifoo -I- -Ifoo -Iquux as if written -Ibar -I- -Ifoo - -Iquux. */ + there; consider -iquote foo -iquote bar -Ifoo -Iquux. It is + however safe to treat -iquote bar -iquote foo -Ifoo -Iquux as if + written -iquote bar -Ifoo -Iquux. */ + static void merge_include_chains (cpp_reader *pfile, int verbose) { @@ -298,31 +320,11 @@ split_quote_chain (void) quote_ignores_source_dir = true; } -/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and - NUL-terminated. */ +/* Add P to the chain specified by CHAIN. */ + void -add_path (char *path, int chain, int cxx_aware) +add_cpp_dir_path (cpp_dir *p, int chain) { - struct cpp_dir *p; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Convert all backslashes to slashes. The native CRT stat() - function does not recognise a directory that ends in a backslash - (unless it is a drive root dir, such "c:\"). Forward slashes, - trailing or otherwise, cause no problems for stat(). */ - char* c; - for (c = path; *c; c++) - if (*c == '\\') *c = '/'; -#endif - - p = xmalloc (sizeof (struct cpp_dir)); - p->next = NULL; - p->name = path; - if (chain == SYSTEM || chain == AFTER) - p->sysp = 1 + !cxx_aware; - else - p->sysp = 0; - if (tails[chain]) tails[chain]->next = p; else @@ -330,12 +332,42 @@ add_path (char *path, int chain, int cxx_aware) tails[chain] = p; } +/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and + NUL-terminated. */ +void +add_path (char *path, int chain, int cxx_aware, bool user_supplied_p) +{ + cpp_dir *p; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Convert all backslashes to slashes. The native CRT stat() + function does not recognize a directory that ends in a backslash + (unless it is a drive root dir, such "c:\"). Forward slashes, + trailing or otherwise, cause no problems for stat(). */ + char* c; + for (c = path; *c; c++) + if (*c == '\\') *c = '/'; +#endif + + p = XNEW (cpp_dir); + p->next = NULL; + p->name = path; + if (chain == SYSTEM || chain == AFTER) + p->sysp = 1 + !cxx_aware; + else + p->sysp = 0; + p->construct = 0; + p->user_supplied_p = user_supplied_p; + + add_cpp_dir_path (p, chain); +} + /* Exported function to handle include chain merging, duplicate removal, and registration with cpplib. */ void register_include_chains (cpp_reader *pfile, const char *sysroot, - const char *iprefix, int stdinc, int cxx_stdinc, - int verbose) + const char *iprefix, const char *imultilib, + int stdinc, int cxx_stdinc, int verbose) { static const char *const lang_env_vars[] = { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", @@ -353,12 +385,33 @@ register_include_chains (cpp_reader *pfile, const char *sysroot, add_env_var_paths ("CPATH", BRACKET); add_env_var_paths (lang_env_vars[idx], SYSTEM); + target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc); + /* Finally chain on the standard directories. */ if (stdinc) - add_standard_paths (sysroot, iprefix, cxx_stdinc); + add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc); + + target_c_incpath.extra_includes (sysroot, iprefix, stdinc); merge_include_chains (pfile, verbose); cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET], quote_ignores_source_dir); } +#if !(defined TARGET_EXTRA_INCLUDES) || !(defined TARGET_EXTRA_PRE_INCLUDES) +static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED, + const char *iprefix ATTRIBUTE_UNUSED, + int stdinc ATTRIBUTE_UNUSED) +{ +} +#endif + +#ifndef TARGET_EXTRA_INCLUDES +#define TARGET_EXTRA_INCLUDES hook_void_charptr_charptr_int +#endif +#ifndef TARGET_EXTRA_PRE_INCLUDES +#define TARGET_EXTRA_PRE_INCLUDES hook_void_charptr_charptr_int +#endif + +struct target_c_incpath_s target_c_incpath = { TARGET_EXTRA_PRE_INCLUDES, TARGET_EXTRA_INCLUDES }; + diff --git a/contrib/gcc/c-incpath.h b/contrib/gcc/c-incpath.h index 31ed657da2a..3f268b79d57 100644 --- a/contrib/gcc/c-incpath.h +++ b/contrib/gcc/c-incpath.h @@ -1,5 +1,5 @@ /* Set up combined include path for the preprocessor. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -13,11 +13,21 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ extern void split_quote_chain (void); -extern void add_path (char *, int, int); +extern void add_path (char *, int, int, bool); extern void register_include_chains (cpp_reader *, const char *, - const char *, int, int, int); + const char *, const char *, + int, int, int); +extern void add_cpp_dir_path (struct cpp_dir *, int); + +struct target_c_incpath_s { + /* Do extra includes processing. STDINC is false iff -nostdinc was given. */ + void (*extra_pre_includes) (const char *, const char *, int); + void (*extra_includes) (const char *, const char *, int); +}; + +extern struct target_c_incpath_s target_c_incpath; enum { QUOTE = 0, BRACKET, SYSTEM, AFTER }; diff --git a/contrib/gcc/c-lang.c b/contrib/gcc/c-lang.c index 1a097e27797..81fb05bc700 100644 --- a/contrib/gcc/c-lang.c +++ b/contrib/gcc/c-lang.c @@ -1,6 +1,6 @@ /* Language-specific hook definitions for C front end. Copyright (C) 1991, 1995, 1997, 1998, - 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" @@ -30,127 +30,31 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" #include "langhooks.h" #include "langhooks-def.h" +#include "tree-inline.h" #include "diagnostic.h" -#include "c-pretty-print.h" - -static void c_initialize_diagnostics (diagnostic_context *); +#include "c-objc-common.h" +#include "c-pragma.h" enum c_language_kind c_language = clk_c; -/* ### When changing hooks, consider if ObjC needs changing too!! ### */ +/* Lang hooks common to C and ObjC are declared in c-objc-common.h; + consequently, there should be very few hooks below. */ #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU C" #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT c_objc_common_init -#undef LANG_HOOKS_FINISH -#define LANG_HOOKS_FINISH c_common_finish -#undef LANG_HOOKS_INIT_OPTIONS -#define LANG_HOOKS_INIT_OPTIONS c_common_init_options -#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS -#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics -#undef LANG_HOOKS_HANDLE_OPTION -#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option -#undef LANG_HOOKS_MISSING_ARGUMENT -#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument -#undef LANG_HOOKS_POST_OPTIONS -#define LANG_HOOKS_POST_OPTIONS c_common_post_options -#undef LANG_HOOKS_GET_ALIAS_SET -#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set -#undef LANG_HOOKS_SAFE_FROM_P -#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p -#undef LANG_HOOKS_EXPAND_EXPR -#define LANG_HOOKS_EXPAND_EXPR c_expand_expr -#undef LANG_HOOKS_MARK_ADDRESSABLE -#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable -#undef LANG_HOOKS_PARSE_FILE -#define LANG_HOOKS_PARSE_FILE c_common_parse_file -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion -#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL -#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl -#undef LANG_HOOKS_UNSAFE_FOR_REEVAL -#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval -#undef LANG_HOOKS_STATICP -#define LANG_HOOKS_STATICP c_staticp -#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME -#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME c_static_assembler_name -#undef LANG_HOOKS_NO_BODY_BLOCKS -#define LANG_HOOKS_NO_BODY_BLOCKS true -#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL -#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl -#undef LANG_HOOKS_PRINT_IDENTIFIER -#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier -#undef LANG_HOOKS_FUNCTION_ENTER_NESTED -#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context -#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED -#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context -#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL -#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl -#undef LANG_HOOKS_DECL_UNINIT -#define LANG_HOOKS_DECL_UNINIT c_decl_uninit -#undef LANG_HOOKS_RTL_EXPAND_STMT -#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt - -/* Attribute hooks. */ -#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE -#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table -#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE -#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table - -#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN -#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ - c_cannot_inline_tree_fn -#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS -#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ - c_disregard_inline_limits -#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P -#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \ - anon_aggr_type_p -#undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING -#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ - c_convert_parm_for_inlining -#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS -#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns -#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN -#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree - -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body - -#undef LANG_HOOKS_TYPE_FOR_MODE -#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode -#undef LANG_HOOKS_TYPE_FOR_SIZE -#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size -#undef LANG_HOOKS_SIGNED_TYPE -#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type -#undef LANG_HOOKS_UNSIGNED_TYPE -#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type -#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE -#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type -#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR -#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error -#undef LANG_HOOKS_TYPE_PROMOTES_TO -#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to -#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE -#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type - -#undef LANG_HOOKS_WRITE_GLOBALS -#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations - -/* ### When changing hooks, consider if ObjC needs changing too!! ### */ - -/* Each front end provides its own. */ +/* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; /* Tree code classes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, -const char tree_code_type[] = { +const enum tree_code_class tree_code_type[] = { #include "tree.def" - 'x', + tcc_exceptional, #include "c-common.def" }; #undef DEFTREECODE @@ -179,23 +83,11 @@ const char *const tree_code_name[] = { }; #undef DEFTREECODE +/* Final processing of file-scope data. The Objective-C version of + this function still does something. */ void finish_file (void) { - c_objc_common_finish_file (); -} - -static void -c_initialize_diagnostics (diagnostic_context *context) -{ - pretty_printer *base = context->printer; - c_pretty_printer *pp = xmalloc (sizeof (c_pretty_printer)); - memcpy (pp_base (pp), base, sizeof (pretty_printer)); - pp_c_pretty_printer_init (pp); - context->printer = (pretty_printer *) pp; - - /* It is safe to free this object because it was previously malloc()'d. */ - free (base); } #include "gtype-c.h" diff --git a/contrib/gcc/c-lex.c b/contrib/gcc/c-lex.c index aba571fab9a..108bc5cff17 100644 --- a/contrib/gcc/c-lex.c +++ b/contrib/gcc/c-lex.c @@ -1,6 +1,7 @@ /* Mainly the interface between cpplib and the C front ends. Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997 - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +17,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -27,7 +28,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "real.h" #include "rtl.h" #include "tree.h" -#include "expr.h" #include "input.h" #include "output.h" #include "c-tree.h" @@ -42,28 +42,29 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "splay-tree.h" #include "debug.h" -/* The current line map. */ -static const struct line_map *map; - /* We may keep statistics about how long which files took to compile. */ static int header_time, body_time; static splay_tree file_info_tree; -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE TYPE_PRECISION (wchar_type_node) - -/* Number of bytes in a wide character. */ -#define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT) - int pending_lang_change; /* If we need to switch languages - C++ only */ int c_header_level; /* depth in C headers - C++ only */ +/* If we need to translate characters received. This is tri-state: + 0 means use only the untranslated string; 1 means use only + the translated string; -1 means chain the translated string + to the untranslated one. */ +int c_lex_string_translate = 1; + +/* True if strings should be passed to the caller of c_lex completely + unmolested (no concatenation, no translation). */ +bool c_lex_return_raw_strings = false; + static tree interpret_integer (const cpp_token *, unsigned int); static tree interpret_float (const cpp_token *, unsigned int); -static enum integer_type_kind - narrowest_unsigned_type (tree, unsigned int); -static enum integer_type_kind - narrowest_signed_type (tree, unsigned int); +static enum integer_type_kind narrowest_unsigned_type + (unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int); +static enum integer_type_kind narrowest_signed_type + (unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int); static enum cpp_ttype lex_string (const cpp_token *, tree *, bool); static tree lex_charconst (const cpp_token *); static void update_header_times (const char *); @@ -80,10 +81,8 @@ init_c_lex (void) struct cpp_callbacks *cb; struct c_fileinfo *toplevel; - /* Set up filename timing. Must happen before cpp_read_main_file. */ - file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp, - 0, - (splay_tree_delete_value_fn)free); + /* The get_fileinfo data structure must be initialized before + cpp_read_main_file is called. */ toplevel = get_fileinfo (""); if (flag_detailed_statistics) { @@ -102,8 +101,8 @@ init_c_lex (void) /* Set the debug callbacks if we can use them. */ if (debug_info_level == DINFO_LEVEL_VERBOSE - && (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG - || write_symbols == VMS_AND_DWARF2_DEBUG)) + && (write_symbols == DWARF2_DEBUG + || write_symbols == VMS_AND_DWARF2_DEBUG)) { cb->define = cb_define; cb->undef = cb_undef; @@ -116,11 +115,16 @@ get_fileinfo (const char *name) splay_tree_node n; struct c_fileinfo *fi; + if (!file_info_tree) + file_info_tree = splay_tree_new ((splay_tree_compare_fn) strcmp, + 0, + (splay_tree_delete_value_fn) free); + n = splay_tree_lookup (file_info_tree, (splay_tree_key) name); if (n) return (struct c_fileinfo *) n->value; - fi = xmalloc (sizeof (struct c_fileinfo)); + fi = XNEW (struct c_fileinfo); fi->time = 0; fi->interface_only = 0; fi->interface_unknown = 1; @@ -145,7 +149,7 @@ update_header_times (const char *name) } static int -dump_one_header (splay_tree_node n, void *dummy ATTRIBUTE_UNUSED) +dump_one_header (splay_tree_node n, void * ARG_UNUSED (dummy)) { print_time ((const char *) n->key, ((struct c_fileinfo *) n->value)->time); @@ -163,26 +167,26 @@ dump_time_statistics (void) print_time ("header files (total)", header_time); print_time ("main file (total)", this_time - body_time); fprintf (stderr, "ratio = %g : 1\n", - (double)header_time / (double)(this_time - body_time)); + (double) header_time / (double) (this_time - body_time)); fprintf (stderr, "\n******\n"); splay_tree_foreach (file_info_tree, dump_one_header, 0); } static void -cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, - unsigned int line ATTRIBUTE_UNUSED, - const cpp_string *str ATTRIBUTE_UNUSED) +cb_ident (cpp_reader * ARG_UNUSED (pfile), + unsigned int ARG_UNUSED (line), + const cpp_string * ARG_UNUSED (str)) { #ifdef ASM_OUTPUT_IDENT - if (! flag_no_ident) + if (!flag_no_ident) { /* Convert escapes in the string. */ cpp_string cstr = { 0, 0 }; if (cpp_interpret_string (pfile, str, 1, &cstr, false)) { ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text); - free ((void *)cstr.text); + free ((void *) cstr.text); } } #endif @@ -191,34 +195,44 @@ cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, /* Called at the start of every non-empty line. TOKEN is the first lexed token on the line. Used for diagnostic line numbers. */ static void -cb_line_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const cpp_token *token, +cb_line_change (cpp_reader * ARG_UNUSED (pfile), const cpp_token *token, int parsing_args) { - if (token->type == CPP_EOF || parsing_args) - return; - - input_line = SOURCE_LINE (map, token->line); + if (token->type != CPP_EOF && !parsing_args) +#ifdef USE_MAPPED_LOCATION + input_location = token->src_loc; +#else + { + source_location loc = token->src_loc; + const struct line_map *map = linemap_lookup (&line_table, loc); + input_line = SOURCE_LINE (map, loc); + } +#endif } void fe_file_change (const struct line_map *new_map) { if (new_map == NULL) - { - map = NULL; - return; - } + return; if (new_map->reason == LC_ENTER) { /* Don't stack the main buffer on the input stack; we already did in compile_file. */ - if (map != NULL) + if (!MAIN_FILE_P (new_map)) { - int included_at = SOURCE_LINE (new_map - 1, new_map->from_line - 1); +#ifdef USE_MAPPED_LOCATION + int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1); + + input_location = included_at; + push_srcloc (new_map->start_location); +#else + int included_at = LAST_SOURCE_LINE (new_map - 1); input_line = included_at; push_srcloc (new_map->to_file, 1); +#endif (*debug_hooks->start_source_file) (included_at, new_map->to_file); #ifndef NO_IMPLICIT_EXTERN_C if (c_header_level) @@ -237,7 +251,7 @@ fe_file_change (const struct line_map *new_map) if (c_header_level && --c_header_level == 0) { if (new_map->sysp == 2) - warning ("badly nested C headers from preprocessor"); + warning (0, "badly nested C headers from preprocessor"); --pending_lang_change; } #endif @@ -248,16 +262,16 @@ fe_file_change (const struct line_map *new_map) update_header_times (new_map->to_file); in_system_header = new_map->sysp != 0; +#ifdef USE_MAPPED_LOCATION + input_location = new_map->start_location; +#else input_filename = new_map->to_file; input_line = new_map->to_line; - map = new_map; - - /* Hook for C++. */ - extract_interface_info (); +#endif } static void -cb_def_pragma (cpp_reader *pfile, unsigned int line) +cb_def_pragma (cpp_reader *pfile, source_location loc) { /* Issue a warning message if we have been asked to do so. Ignore unknown pragmas in system headers unless an explicit @@ -266,6 +280,14 @@ cb_def_pragma (cpp_reader *pfile, unsigned int line) { const unsigned char *space, *name; const cpp_token *s; +#ifndef USE_MAPPED_LOCATION + location_t fe_loc; + const struct line_map *map = linemap_lookup (&line_table, loc); + fe_loc.file = map->to_file; + fe_loc.line = SOURCE_LINE (map, loc); +#else + location_t fe_loc = loc; +#endif space = name = (const unsigned char *) ""; s = cpp_get_token (pfile); @@ -277,54 +299,58 @@ cb_def_pragma (cpp_reader *pfile, unsigned int line) name = cpp_token_as_text (pfile, s); } - input_line = SOURCE_LINE (map, line); - warning ("ignoring #pragma %s %s", space, name); + warning (OPT_Wunknown_pragmas, "%Hignoring #pragma %s %s", + &fe_loc, space, name); } } /* #define callback for DWARF and DWARF2 debug info. */ static void -cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node) +cb_define (cpp_reader *pfile, source_location loc, cpp_hashnode *node) { - (*debug_hooks->define) (SOURCE_LINE (map, line), + const struct line_map *map = linemap_lookup (&line_table, loc); + (*debug_hooks->define) (SOURCE_LINE (map, loc), (const char *) cpp_macro_definition (pfile, node)); } /* #undef callback for DWARF and DWARF2 debug info. */ static void -cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line, +cb_undef (cpp_reader * ARG_UNUSED (pfile), source_location loc, cpp_hashnode *node) { - (*debug_hooks->undef) (SOURCE_LINE (map, line), + const struct line_map *map = linemap_lookup (&line_table, loc); + (*debug_hooks->undef) (SOURCE_LINE (map, loc), (const char *) NODE_NAME (node)); } -static inline const cpp_token * -get_nonpadding_token (void) -{ - const cpp_token *tok; - timevar_push (TV_CPP); - do - tok = cpp_get_token (parse_in); - while (tok->type == CPP_PADDING); - timevar_pop (TV_CPP); +/* Read a token and return its type. Fill *VALUE with its value, if + applicable. Fill *CPP_FLAGS with the token's flags, if it is + non-NULL. */ - return tok; -} - -int -c_lex_with_flags (tree *value, unsigned char *cpp_flags) +enum cpp_ttype +c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags) { - const cpp_token *tok; - location_t atloc; static bool no_more_pch; + const cpp_token *tok; + enum cpp_ttype type; + unsigned char add_flags = 0; + timevar_push (TV_CPP); retry: - tok = get_nonpadding_token (); + tok = cpp_get_token (parse_in); + type = tok->type; retry_after_at: - switch (tok->type) +#ifdef USE_MAPPED_LOCATION + *loc = tok->src_loc; +#else + *loc = input_location; +#endif + switch (type) { + case CPP_PADDING: + goto retry; + case CPP_NAME: *value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node)); break; @@ -338,9 +364,14 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) case CPP_N_INVALID: /* cpplib has issued an error. */ *value = error_mark_node; + errorcount++; break; case CPP_N_INTEGER: + /* C++ uses '0' to mark virtual functions as pure. + Set PURE_ZERO to pass this information to the C++ parser. */ + if (tok->val.str.len == 1 && *tok->val.str.text == '0') + add_flags = PURE_ZERO; *value = interpret_integer (tok, flags); break; @@ -349,41 +380,59 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) break; default: - abort (); + gcc_unreachable (); } } break; case CPP_ATSIGN: /* An @ may give the next token special significance in Objective-C. */ - atloc = input_location; - tok = get_nonpadding_token (); if (c_dialect_objc ()) { - tree val; - switch (tok->type) + location_t atloc = input_location; + + retry_at: + tok = cpp_get_token (parse_in); + type = tok->type; + switch (type) { - case CPP_NAME: - val = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node)); - if (C_IS_RESERVED_WORD (val) - && OBJC_IS_AT_KEYWORD (C_RID_CODE (val))) - { - *value = val; - return CPP_AT_NAME; - } - break; + case CPP_PADDING: + goto retry_at; case CPP_STRING: case CPP_WSTRING: - return lex_string (tok, value, true); + type = lex_string (tok, value, true); + break; - default: break; + case CPP_NAME: + *value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node)); + if (objc_is_reserved_word (*value)) + { + type = CPP_AT_NAME; + break; + } + /* FALLTHROUGH */ + + default: + /* ... or not. */ + error ("%Hstray %<@%> in program", &atloc); + goto retry_after_at; } + break; } - /* ... or not. */ - error ("%Hstray '@' in program", &atloc); - goto retry_after_at; + /* FALLTHROUGH */ + case CPP_HASH: + case CPP_PASTE: + { + unsigned char name[4]; + + *cpp_spell_token (parse_in, tok, name, true) = 0; + + error ("stray %qs in program", name); + } + + goto retry; case CPP_OTHER: { @@ -392,9 +441,9 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) if (c == '"' || c == '\'') error ("missing terminating %c character", (int) c); else if (ISGRAPH (c)) - error ("stray '%c' in program", (int) c); + error ("stray %qc in program", (int) c); else - error ("stray '\\%o' in program", (int) c); + error ("stray %<\\%o%> in program", (int) c); } goto retry; @@ -405,42 +454,51 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) case CPP_STRING: case CPP_WSTRING: - return lex_string (tok, value, false); + if (!c_lex_return_raw_strings) + { + type = lex_string (tok, value, false); + break; + } + *value = build_string (tok->val.str.len, (char *) tok->val.str.text); + break; + + case CPP_PRAGMA: + *value = build_int_cst (NULL, tok->val.pragma); break; /* These tokens should not be visible outside cpplib. */ case CPP_HEADER_NAME: case CPP_COMMENT: case CPP_MACRO_ARG: - abort (); + gcc_unreachable (); default: *value = NULL_TREE; break; } - if (! no_more_pch) + if (cpp_flags) + *cpp_flags = tok->flags | add_flags; + + if (!no_more_pch) { no_more_pch = true; c_common_no_more_pch (); } - if (cpp_flags) - *cpp_flags = tok->flags; - return tok->type; -} + timevar_pop (TV_CPP); -int -c_lex (tree *value) -{ - return c_lex_with_flags (value, NULL); + return type; } /* Returns the narrowest C-visible unsigned type, starting with the - minimum specified by FLAGS, that can fit VALUE, or itk_none if + minimum specified by FLAGS, that can fit HIGH:LOW, or itk_none if there isn't one. */ + static enum integer_type_kind -narrowest_unsigned_type (tree value, unsigned int flags) +narrowest_unsigned_type (unsigned HOST_WIDE_INT low, + unsigned HOST_WIDE_INT high, + unsigned int flags) { enum integer_type_kind itk; @@ -451,20 +509,23 @@ narrowest_unsigned_type (tree value, unsigned int flags) else itk = itk_unsigned_long_long; - /* int_fits_type_p must think the type of its first argument is - wider than its second argument, or it won't do the proper check. */ - TREE_TYPE (value) = widest_unsigned_literal_type_node; - for (; itk < itk_none; itk += 2 /* skip unsigned types */) - if (int_fits_type_p (value, integer_types[itk])) - return itk; + { + tree upper = TYPE_MAX_VALUE (integer_types[itk]); + + if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high + || ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high + && TREE_INT_CST_LOW (upper) >= low)) + return itk; + } return itk_none; } /* Ditto, but narrowest signed type. */ static enum integer_type_kind -narrowest_signed_type (tree value, unsigned int flags) +narrowest_signed_type (unsigned HOST_WIDE_INT low, + unsigned HOST_WIDE_INT high, unsigned int flags) { enum integer_type_kind itk; @@ -475,13 +536,16 @@ narrowest_signed_type (tree value, unsigned int flags) else itk = itk_long_long; - /* int_fits_type_p must think the type of its first argument is - wider than its second argument, or it won't do the proper check. */ - TREE_TYPE (value) = widest_unsigned_literal_type_node; for (; itk < itk_none; itk += 2 /* skip signed types */) - if (int_fits_type_p (value, integer_types[itk])) - return itk; + { + tree upper = TYPE_MAX_VALUE (integer_types[itk]); + + if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high + || ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high + && TREE_INT_CST_LOW (upper) >= low)) + return itk; + } return itk_none; } @@ -497,18 +561,19 @@ interpret_integer (const cpp_token *token, unsigned int flags) integer = cpp_interpret_integer (parse_in, token, flags); integer = cpp_num_sign_extend (integer, options->precision); - value = build_int_2_wide (integer.low, integer.high); /* The type of a constant with a U suffix is straightforward. */ if (flags & CPP_N_UNSIGNED) - itk = narrowest_unsigned_type (value, flags); + itk = narrowest_unsigned_type (integer.low, integer.high, flags); else { /* The type of a potentially-signed integer constant varies depending on the base it's in, the standard in use, and the length suffixes. */ - enum integer_type_kind itk_u = narrowest_unsigned_type (value, flags); - enum integer_type_kind itk_s = narrowest_signed_type (value, flags); + enum integer_type_kind itk_u + = narrowest_unsigned_type (integer.low, integer.high, flags); + enum integer_type_kind itk_s + = narrowest_signed_type (integer.low, integer.high, flags); /* In both C89 and C99, octal and hex constants may be signed or unsigned, whichever fits tighter. We do not warn about this @@ -532,10 +597,11 @@ interpret_integer (const cpp_token *token, unsigned int flags) if (itk_u < itk_unsigned_long) itk_u = itk_unsigned_long; itk = itk_u; - warning ("this decimal constant is unsigned only in ISO C90"); + warning (0, "this decimal constant is unsigned only in ISO C90"); } - else if (warn_traditional) - warning ("this decimal constant would be unsigned in ISO C90"); + else + warning (OPT_Wtraditional, + "this decimal constant would be unsigned in ISO C90"); } } } @@ -550,15 +616,15 @@ interpret_integer (const cpp_token *token, unsigned int flags) if (itk > itk_unsigned_long && (flags & CPP_N_WIDTH) != CPP_N_LARGE - && ! in_system_header && ! flag_isoc99) - pedwarn ("integer constant is too large for \"%s\" type", + && !in_system_header && !flag_isoc99) + pedwarn ("integer constant is too large for %qs type", (flags & CPP_N_UNSIGNED) ? "unsigned long" : "long"); - TREE_TYPE (value) = type; + value = build_int_cst_wide (type, integer.low, integer.high); /* Convert imaginary to a complex type. */ if (flags & CPP_N_IMAGINARY) - value = build_complex (NULL_TREE, convert (type, integer_zero_node), value); + value = build_complex (NULL_TREE, build_int_cst (type, 0), value); return value; } @@ -573,51 +639,53 @@ interpret_float (const cpp_token *token, unsigned int flags) REAL_VALUE_TYPE real; char *copy; size_t copylen; - const char *typename; - /* FIXME: make %T work in error/warning, then we don't need typename. */ - if ((flags & CPP_N_WIDTH) == CPP_N_LARGE) - { - type = long_double_type_node; - typename = "long double"; - } - else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL - || flag_single_precision_constant) - { - type = float_type_node; - typename = "float"; - } + /* Decode type based on width and properties. */ + if (flags & CPP_N_DFLOAT) + if ((flags & CPP_N_WIDTH) == CPP_N_LARGE) + type = dfloat128_type_node; + else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL) + type = dfloat32_type_node; + else + type = dfloat64_type_node; else - { + if ((flags & CPP_N_WIDTH) == CPP_N_LARGE) + type = long_double_type_node; + else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL + || flag_single_precision_constant) + type = float_type_node; + else type = double_type_node; - typename = "double"; - } /* Copy the constant to a nul-terminated buffer. If the constant has any suffixes, cut them off; REAL_VALUE_ATOF/ REAL_VALUE_HTOF can't handle them. */ copylen = token->val.str.len; - if ((flags & CPP_N_WIDTH) != CPP_N_MEDIUM) - /* Must be an F or L suffix. */ - copylen--; - if (flags & CPP_N_IMAGINARY) - /* I or J suffix. */ - copylen--; + if (flags & CPP_N_DFLOAT) + copylen -= 2; + else + { + if ((flags & CPP_N_WIDTH) != CPP_N_MEDIUM) + /* Must be an F or L suffix. */ + copylen--; + if (flags & CPP_N_IMAGINARY) + /* I or J suffix. */ + copylen--; + } - copy = alloca (copylen + 1); + copy = (char *) alloca (copylen + 1); memcpy (copy, token->val.str.text, copylen); copy[copylen] = '\0'; - real_from_string (&real, copy); - real_convert (&real, TYPE_MODE (type), &real); + real_from_string3 (&real, copy, TYPE_MODE (type)); - /* A diagnostic is required for "soft" overflow by some ISO C - testsuites. This is not pedwarn, because some people don't want - an error for this. - ??? That's a dubious reason... is this a mandatory diagnostic or - isn't it? -- zw, 2001-08-21. */ + /* Both C and C++ require a diagnostic for a floating constant + outside the range of representable values of its type. Since we + have __builtin_inf* to produce an infinity, it might now be + appropriate for this to be a mandatory pedwarn rather than + conditioned on -pedantic. */ if (REAL_VALUE_ISINF (real) && pedantic) - warning ("floating constant exceeds range of \"%s\"", typename); + pedwarn ("floating constant exceeds range of %qT", type); /* Create a node with determined type and value. */ value = build_real (type, real); @@ -648,7 +716,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) { tree value; bool wide = false; - size_t count = 1; + size_t concats = 0; struct obstack str_ob; cpp_string istr; @@ -660,45 +728,76 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) if (tok->type == CPP_WSTRING) wide = true; - tok = get_nonpadding_token (); - if (c_dialect_objc () && tok->type == CPP_ATSIGN) + retry: + tok = cpp_get_token (parse_in); + switch (tok->type) { - objc_string = true; - tok = get_nonpadding_token (); - } - if (tok->type == CPP_STRING || tok->type == CPP_WSTRING) - { - gcc_obstack_init (&str_ob); - obstack_grow (&str_ob, &str, sizeof (cpp_string)); - - do + case CPP_PADDING: + goto retry; + case CPP_ATSIGN: + if (c_dialect_objc ()) { - count++; - if (tok->type == CPP_WSTRING) - wide = true; - obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string)); - - tok = get_nonpadding_token (); - if (c_dialect_objc () && tok->type == CPP_ATSIGN) - { - objc_string = true; - tok = get_nonpadding_token (); - } + objc_string = true; + goto retry; } - while (tok->type == CPP_STRING || tok->type == CPP_WSTRING); - strs = obstack_finish (&str_ob); + /* FALLTHROUGH */ + + default: + break; + + case CPP_WSTRING: + wide = true; + /* FALLTHROUGH */ + + case CPP_STRING: + if (!concats) + { + gcc_obstack_init (&str_ob); + obstack_grow (&str_ob, &str, sizeof (cpp_string)); + } + + concats++; + obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string)); + goto retry; } /* We have read one more token than we want. */ _cpp_backup_tokens (parse_in, 1); + if (concats) + strs = XOBFINISH (&str_ob, cpp_string *); - if (count > 1 && !objc_string && warn_traditional && !in_system_header) - warning ("traditional C rejects string constant concatenation"); + if (concats && !objc_string && !in_system_header) + warning (OPT_Wtraditional, + "traditional C rejects string constant concatenation"); - if (cpp_interpret_string (parse_in, strs, count, &istr, wide)) + if ((c_lex_string_translate + ? cpp_interpret_string : cpp_interpret_string_notranslate) + (parse_in, strs, concats + 1, &istr, wide)) { - value = build_string (istr.len, (char *)istr.text); - free ((void *)istr.text); + value = build_string (istr.len, (char *) istr.text); + free ((void *) istr.text); + + if (c_lex_string_translate == -1) + { + int xlated = cpp_interpret_string_notranslate (parse_in, strs, + concats + 1, + &istr, wide); + /* Assume that, if we managed to translate the string above, + then the untranslated parsing will always succeed. */ + gcc_assert (xlated); + + if (TREE_STRING_LENGTH (value) != (int) istr.len + || 0 != strncmp (TREE_STRING_POINTER (value), (char *) istr.text, + istr.len)) + { + /* Arrange for us to return the untranslated string in + *valp, but to set up the C type of the translated + one. */ + *valp = build_string (istr.len, (char *) istr.text); + valp = &TREE_CHAIN (*valp); + } + free ((void *) istr.text); + } } else { @@ -717,7 +816,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node; *valp = fix_string_type (value); - if (strs != &str) + if (concats) obstack_free (&str_ob, 0); return objc_string ? CPP_OBJC_STRING : wide ? CPP_WSTRING : CPP_STRING; @@ -735,13 +834,6 @@ lex_charconst (const cpp_token *token) result = cpp_interpret_charconst (parse_in, token, &chars_seen, &unsignedp); - /* Cast to cppchar_signed_t to get correct sign-extension of RESULT - before possibly widening to HOST_WIDE_INT for build_int_2. */ - if (unsignedp || (cppchar_signed_t) result >= 0) - value = build_int_2 (result, 0); - else - value = build_int_2 ((cppchar_signed_t) result, -1); - if (token->type == CPP_WCHAR) type = wchar_type_node; /* In C, a character constant has type 'int'. @@ -751,6 +843,12 @@ lex_charconst (const cpp_token *token) else type = char_type_node; - TREE_TYPE (value) = type; + /* Cast to cppchar_signed_t to get correct sign-extension of RESULT + before possibly widening to HOST_WIDE_INT for build_int_cst. */ + if (unsignedp || (cppchar_signed_t) result >= 0) + value = build_int_cst_wide (type, result, 0); + else + value = build_int_cst_wide (type, (cppchar_signed_t) result, -1); + return value; } diff --git a/contrib/gcc/c-objc-common.c b/contrib/gcc/c-objc-common.c index 0efa2adc372..d4ad1f89f26 100644 --- a/contrib/gcc/c-objc-common.c +++ b/contrib/gcc/c-objc-common.c @@ -1,5 +1,5 @@ /* Some code common to C and ObjC front ends. - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -26,8 +26,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "rtl.h" #include "insn-config.h" #include "integrate.h" -#include "expr.h" #include "c-tree.h" +#include "c-pretty-print.h" #include "function.h" #include "flags.h" #include "toplev.h" @@ -36,14 +36,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "varray.h" #include "ggc.h" #include "langhooks.h" +#include "tree-mudflap.h" #include "target.h" -#include "cgraph.h" +#include "c-objc-common.h" -static bool c_tree_printer (pretty_printer *, text_info *); -static tree start_cdtor (int); -static void finish_cdtor (tree); +static bool c_tree_printer (pretty_printer *, text_info *, const char *, + int, bool, bool, bool); -int +bool c_missing_noreturn_ok_p (tree decl) { /* A missing noreturn is not ok for freestanding implementations and @@ -69,7 +69,6 @@ int c_cannot_inline_tree_fn (tree *fnp) { tree fn = *fnp; - tree t; bool do_warning = (warn_inline && DECL_INLINE (fn) && DECL_DECLARED_INLINE_P (fn) @@ -79,50 +78,26 @@ c_cannot_inline_tree_fn (tree *fnp) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) { if (do_warning) - warning ("%Jfunction '%F' can never be inlined because it " - "is suppressed using -fno-inline", fn, fn); + warning (OPT_Winline, "function %q+F can never be inlined because it " + "is suppressed using -fno-inline", fn); goto cannot_inline; } /* Don't auto-inline anything that might not be bound within this unit of translation. */ - if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn)) + if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn)) { if (do_warning) - warning ("%Jfunction '%F' can never be inlined because it might not " - "be bound within this unit of translation", fn, fn); + warning (OPT_Winline, "function %q+F can never be inlined because it " + "might not be bound within this unit of translation", fn); goto cannot_inline; } - if (! function_attribute_inlinable_p (fn)) + if (!function_attribute_inlinable_p (fn)) { if (do_warning) - warning ("%Jfunction '%F' can never be inlined because it uses " - "attributes conflicting with inlining", fn, fn); - goto cannot_inline; - } - - /* If a function has pending sizes, we must not defer its - compilation, and we can't inline it as a tree. */ - if (fn == current_function_decl) - { - t = get_pending_sizes (); - put_pending_sizes (t); - - if (t) - { - if (do_warning) - warning ("%Jfunction '%F' can never be inlined because it has " - "pending sizes", fn, fn); - goto cannot_inline; - } - } - - if (DECL_LANG_SPECIFIC (fn)->pending_sizes) - { - if (do_warning) - warning ("%Jfunction '%F' can never be inlined because it has " - "pending sizes", fn, fn); + warning (OPT_Winline, "function %q+F can never be inlined because it " + "uses attributes conflicting with inlining", fn); goto cannot_inline; } @@ -150,24 +125,15 @@ c_warn_unused_global_decl (tree decl) bool c_objc_common_init (void) { - static const enum tree_code stmt_codes[] = { - c_common_stmt_codes - }; - - INIT_STATEMENT_CODES (stmt_codes); - c_init_decl_processing (); if (c_common_init () == false) return false; - lang_expand_decl_stmt = c_expand_decl_stmt; - /* These were not defined in the Objective-C front end, but I'm putting them here anyway. The diagnostic format decoder might want an enhanced ObjC implementation. */ diagnostic_format_decoder (global_dc) = &c_tree_printer; - lang_missing_noreturn_ok_p = &c_missing_noreturn_ok_p; /* If still unspecified, make it match -std=c99 (allowing for -pedantic-errors). */ @@ -182,102 +148,11 @@ c_objc_common_init (void) return true; } -static tree -start_cdtor (int method_type) -{ - tree fnname = get_file_function_name (method_type); - tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node); - tree body; - - start_function (void_list_node_1, - build_nt (CALL_EXPR, fnname, - tree_cons (NULL_TREE, NULL_TREE, void_list_node_1), - NULL_TREE), - NULL_TREE); - store_parm_decls (); - - current_function_cannot_inline - = "static constructors and destructors cannot be inlined"; - - body = c_begin_compound_stmt (); - - pushlevel (0); - clear_last_expr (); - add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0); - - return body; -} - -static void -finish_cdtor (tree body) -{ - tree scope; - tree block; - - scope = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0); - block = poplevel (0, 0, 0); - SCOPE_STMT_BLOCK (TREE_PURPOSE (scope)) = block; - SCOPE_STMT_BLOCK (TREE_VALUE (scope)) = block; - - RECHAIN_STMTS (body, COMPOUND_BODY (body)); - - finish_function (); -} - -/* Called at end of parsing, but before end-of-file processing. */ - -void -c_objc_common_finish_file (void) -{ - if (pch_file) - c_common_write_pch (); - - /* If multiple translation units were built, copy information between - them based on linkage rules. */ - merge_translation_unit_decls (); - - cgraph_finalize_compilation_unit (); - cgraph_optimize (); - - if (static_ctors) - { - tree body = start_cdtor ('I'); - - for (; static_ctors; static_ctors = TREE_CHAIN (static_ctors)) - c_expand_expr_stmt (build_function_call (TREE_VALUE (static_ctors), - NULL_TREE)); - - finish_cdtor (body); - } - - if (static_dtors) - { - tree body = start_cdtor ('D'); - - for (; static_dtors; static_dtors = TREE_CHAIN (static_dtors)) - c_expand_expr_stmt (build_function_call (TREE_VALUE (static_dtors), - NULL_TREE)); - - finish_cdtor (body); - } - - { - int flags; - FILE *stream = dump_begin (TDI_all, &flags); - - if (stream) - { - dump_node (getdecls (), flags & ~TDF_SLIM, stream); - dump_end (TDI_all, stream); - } - } -} - /* Called during diagnostic message formatting process to print a source-level entity onto BUFFER. The meaning of the format specifiers is as follows: %D: a general decl, - %E: An expression, + %E: an identifier or expression, %F: a function declaration, %T: a type. @@ -286,30 +161,56 @@ c_objc_common_finish_file (void) Please notice when called, the `%' part was already skipped by the diagnostic machinery. */ static bool -c_tree_printer (pretty_printer *pp, text_info *text) +c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, + int precision, bool wide, bool set_locus, bool hash) { tree t = va_arg (*text->args_ptr, tree); + tree name; const char *n = "({anonymous})"; + c_pretty_printer *cpp = (c_pretty_printer *) pp; + pp->padding = pp_none; - switch (*text->format_spec) + if (precision != 0 || wide || hash) + return false; + + if (set_locus && text->locus) + *text->locus = DECL_SOURCE_LOCATION (t); + + switch (*spec) { case 'D': + if (DECL_DEBUG_EXPR_IS_FROM (t) && DECL_DEBUG_EXPR (t)) + { + t = DECL_DEBUG_EXPR (t); + if (!DECL_P (t)) + { + pp_c_expression (cpp, t); + return true; + } + } + /* FALLTHRU */ + case 'F': if (DECL_NAME (t)) - n = (*lang_hooks.decl_printable_name) (t, 2); + n = lang_hooks.decl_printable_name (t, 2); break; case 'T': - if (TREE_CODE (t) == TYPE_DECL) + gcc_assert (TYPE_P (t)); + name = TYPE_NAME (t); + + if (name && TREE_CODE (name) == TYPE_DECL) { - if (DECL_NAME (t)) - n = (*lang_hooks.decl_printable_name) (t, 2); + if (DECL_NAME (name)) + pp_string (cpp, lang_hooks.decl_printable_name (name, 2)); + else + pp_type_id (cpp, t); + return true; } else { - t = TYPE_NAME (t); - if (t) - n = IDENTIFIER_POINTER (t); + pp_type_id (cpp, t); + return true; } break; @@ -317,13 +218,50 @@ c_tree_printer (pretty_printer *pp, text_info *text) if (TREE_CODE (t) == IDENTIFIER_NODE) n = IDENTIFIER_POINTER (t); else - return false; + { + pp_expression (cpp, t); + return true; + } break; default: return false; } - pp_string (pp, n); + pp_string (cpp, n); return true; } + +/* In C and ObjC, all decls have "C" linkage. */ +bool +has_c_linkage (tree decl ATTRIBUTE_UNUSED) +{ + return true; +} + +void +c_initialize_diagnostics (diagnostic_context *context) +{ + pretty_printer *base = context->printer; + c_pretty_printer *pp = XNEW (c_pretty_printer); + memcpy (pp_base (pp), base, sizeof (pretty_printer)); + pp_c_pretty_printer_init (pp); + context->printer = (pretty_printer *) pp; + + /* It is safe to free this object because it was previously XNEW()'d. */ + XDELETE (base); +} + +int +c_types_compatible_p (tree x, tree y) +{ + return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y)); +} + +/* Determine if the type is a vla type for the backend. */ + +bool +c_vla_unspec_p (tree x, tree fn ATTRIBUTE_UNUSED) +{ + return c_vla_type_p (x); +} diff --git a/contrib/gcc/c-objc-common.h b/contrib/gcc/c-objc-common.h new file mode 100644 index 00000000000..49f9ce428b1 --- /dev/null +++ b/contrib/gcc/c-objc-common.h @@ -0,0 +1,143 @@ +/* Language hooks common to C and ObjC front ends. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#ifndef GCC_C_OBJC_COMMON +#define GCC_C_OBJC_COMMON + +/* In c-objc-common.c. */ +extern void c_initialize_diagnostics (diagnostic_context *); + +/* Lang hooks that are shared between C and ObjC are defined here. Hooks + specific to C or ObjC go in c-lang.c and objc/objc-lang.c, respectively. */ + +#undef LANG_HOOKS_IDENTIFIER_SIZE +#define LANG_HOOKS_IDENTIFIER_SIZE C_SIZEOF_STRUCT_LANG_IDENTIFIER +#undef LANG_HOOKS_FINISH +#define LANG_HOOKS_FINISH c_common_finish +#undef LANG_HOOKS_INIT_OPTIONS +#define LANG_HOOKS_INIT_OPTIONS c_common_init_options +#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS +#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics +#undef LANG_HOOKS_HANDLE_OPTION +#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option +#undef LANG_HOOKS_MISSING_ARGUMENT +#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument +#undef LANG_HOOKS_POST_OPTIONS +#define LANG_HOOKS_POST_OPTIONS c_common_post_options +#undef LANG_HOOKS_GET_ALIAS_SET +#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set +#undef LANG_HOOKS_EXPAND_EXPR +#define LANG_HOOKS_EXPAND_EXPR c_expand_expr +#undef LANG_HOOKS_EXPAND_DECL +#define LANG_HOOKS_EXPAND_DECL c_expand_decl +#undef LANG_HOOKS_MARK_ADDRESSABLE +#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable +#undef LANG_HOOKS_PARSE_FILE +#define LANG_HOOKS_PARSE_FILE c_common_parse_file +#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL +#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl +#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS +#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true +#undef LANG_HOOKS_STATICP +#define LANG_HOOKS_STATICP c_staticp +#undef LANG_HOOKS_NO_BODY_BLOCKS +#define LANG_HOOKS_NO_BODY_BLOCKS true +#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL +#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier +#undef LANG_HOOKS_TYPES_COMPATIBLE_P +#define LANG_HOOKS_TYPES_COMPATIBLE_P c_types_compatible_p +#undef LANG_HOOKS_FUNCTION_ENTER_NESTED +#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context +#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED +#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context +#undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P +#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p +#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL +#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl + +/* Attribute hooks. */ +#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE +#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table +#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE +#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table + +#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN +#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ + c_cannot_inline_tree_fn +#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS +#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ + c_disregard_inline_limits +#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P +#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \ + anon_aggr_type_p +#undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING +#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ + c_convert_parm_for_inlining +#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN +#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree + +#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION +#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body + +#undef LANG_HOOKS_TYPE_FOR_MODE +#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode +#undef LANG_HOOKS_TYPE_FOR_SIZE +#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size +#undef LANG_HOOKS_SIGNED_TYPE +#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type +#undef LANG_HOOKS_UNSIGNED_TYPE +#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type +#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE +#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type +#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR +#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error +#undef LANG_HOOKS_TYPE_PROMOTES_TO +#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to +#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE +#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type +#undef LANG_HOOKS_TO_TARGET_CHARSET +#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset +#undef LANG_HOOKS_EXPR_TO_DECL +#define LANG_HOOKS_EXPR_TO_DECL c_expr_to_decl + +/* The C front end's scoping structure is very different from + that expected by the language-independent code; it is best + to disable getdecls. + This means it must also provide its own write_globals. */ + +#undef LANG_HOOKS_GETDECLS +#define LANG_HOOKS_GETDECLS lhd_return_null_tree_v +#undef LANG_HOOKS_WRITE_GLOBALS +#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations + +/* Hooks for tree gimplification. */ +#undef LANG_HOOKS_GIMPLIFY_EXPR +#define LANG_HOOKS_GIMPLIFY_EXPR c_gimplify_expr + +#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING +#define LANG_HOOKS_OMP_PREDETERMINED_SHARING c_omp_predetermined_sharing + +#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P +#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P c_vla_unspec_p + +#endif /* GCC_C_OBJC_COMMON */ diff --git a/contrib/gcc/c-omp.c b/contrib/gcc/c-omp.c new file mode 100644 index 00000000000..0bae32140d8 --- /dev/null +++ b/contrib/gcc/c-omp.c @@ -0,0 +1,441 @@ +/* This file contains routines to construct GNU OpenMP constructs, + called from parsing in the C and C++ front ends. + + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Richard Henderson , + Diego Novillo . + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "function.h" +#include "c-common.h" +#include "toplev.h" +#include "tree-gimple.h" +#include "bitmap.h" +#include "langhooks.h" + + +/* Complete a #pragma omp master construct. STMT is the structured-block + that follows the pragma. */ + +tree +c_finish_omp_master (tree stmt) +{ + return add_stmt (build1 (OMP_MASTER, void_type_node, stmt)); +} + +/* Complete a #pragma omp critical construct. STMT is the structured-block + that follows the pragma, NAME is the identifier in the pragma, or null + if it was omitted. */ + +tree +c_finish_omp_critical (tree body, tree name) +{ + tree stmt = make_node (OMP_CRITICAL); + TREE_TYPE (stmt) = void_type_node; + OMP_CRITICAL_BODY (stmt) = body; + OMP_CRITICAL_NAME (stmt) = name; + return add_stmt (stmt); +} + +/* Complete a #pragma omp ordered construct. STMT is the structured-block + that follows the pragma. */ + +tree +c_finish_omp_ordered (tree stmt) +{ + return add_stmt (build1 (OMP_ORDERED, void_type_node, stmt)); +} + + +/* Complete a #pragma omp barrier construct. */ + +void +c_finish_omp_barrier (void) +{ + tree x; + + x = built_in_decls[BUILT_IN_GOMP_BARRIER]; + x = build_function_call_expr (x, NULL); + add_stmt (x); +} + + +/* Complete a #pragma omp atomic construct. The expression to be + implemented atomically is LHS code= RHS. The value returned is + either error_mark_node (if the construct was erroneous) or an + OMP_ATOMIC node which should be added to the current statement tree + with add_stmt. */ + +tree +c_finish_omp_atomic (enum tree_code code, tree lhs, tree rhs) +{ + tree x, type, addr; + + if (lhs == error_mark_node || rhs == error_mark_node) + return error_mark_node; + + /* ??? According to one reading of the OpenMP spec, complex type are + supported, but there are no atomic stores for any architecture. + But at least icc 9.0 doesn't support complex types here either. + And lets not even talk about vector types... */ + type = TREE_TYPE (lhs); + if (!INTEGRAL_TYPE_P (type) + && !POINTER_TYPE_P (type) + && !SCALAR_FLOAT_TYPE_P (type)) + { + error ("invalid expression type for %<#pragma omp atomic%>"); + return error_mark_node; + } + + /* ??? Validate that rhs does not overlap lhs. */ + + /* Take and save the address of the lhs. From then on we'll reference it + via indirection. */ + addr = build_unary_op (ADDR_EXPR, lhs, 0); + if (addr == error_mark_node) + return error_mark_node; + addr = save_expr (addr); + if (TREE_CODE (addr) != SAVE_EXPR + && (TREE_CODE (addr) != ADDR_EXPR + || TREE_CODE (TREE_OPERAND (addr, 0)) != VAR_DECL)) + { + /* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize + it even after unsharing function body. */ + tree var = create_tmp_var_raw (TREE_TYPE (addr), NULL); + addr = build4 (TARGET_EXPR, TREE_TYPE (addr), var, addr, NULL, NULL); + } + lhs = build_indirect_ref (addr, NULL); + + /* There are lots of warnings, errors, and conversions that need to happen + in the course of interpreting a statement. Use the normal mechanisms + to do this, and then take it apart again. */ + x = build_modify_expr (lhs, code, rhs); + if (x == error_mark_node) + return error_mark_node; + gcc_assert (TREE_CODE (x) == MODIFY_EXPR); + rhs = TREE_OPERAND (x, 1); + + /* Punt the actual generation of atomic operations to common code. */ + return build2 (OMP_ATOMIC, void_type_node, addr, rhs); +} + + +/* Complete a #pragma omp flush construct. We don't do anything with the + variable list that the syntax allows. */ + +void +c_finish_omp_flush (void) +{ + tree x; + + x = built_in_decls[BUILT_IN_SYNCHRONIZE]; + x = build_function_call_expr (x, NULL); + add_stmt (x); +} + + +/* Check and canonicalize #pragma omp for increment expression. + Helper function for c_finish_omp_for. */ + +static tree +check_omp_for_incr_expr (tree exp, tree decl) +{ + tree t; + + if (!INTEGRAL_TYPE_P (TREE_TYPE (exp)) + || TYPE_PRECISION (TREE_TYPE (exp)) < TYPE_PRECISION (TREE_TYPE (decl))) + return error_mark_node; + + if (exp == decl) + return build_int_cst (TREE_TYPE (exp), 0); + + switch (TREE_CODE (exp)) + { + case NOP_EXPR: + t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl); + if (t != error_mark_node) + return fold_convert (TREE_TYPE (exp), t); + break; + case MINUS_EXPR: + t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl); + if (t != error_mark_node) + return fold_build2 (MINUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1)); + break; + case PLUS_EXPR: + t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl); + if (t != error_mark_node) + return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1)); + t = check_omp_for_incr_expr (TREE_OPERAND (exp, 1), decl); + if (t != error_mark_node) + return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), TREE_OPERAND (exp, 0), t); + break; + default: + break; + } + + return error_mark_node; +} + +/* Validate and emit code for the OpenMP directive #pragma omp for. + INIT, COND, INCR, BODY and PRE_BODY are the five basic elements + of the loop (initialization expression, controlling predicate, increment + expression, body of the loop and statements to go before the loop). + DECL is the iteration variable. */ + +tree +c_finish_omp_for (location_t locus, tree decl, tree init, tree cond, + tree incr, tree body, tree pre_body) +{ + location_t elocus = locus; + bool fail = false; + + if (EXPR_HAS_LOCATION (init)) + elocus = EXPR_LOCATION (init); + + /* Validate the iteration variable. */ + if (!INTEGRAL_TYPE_P (TREE_TYPE (decl))) + { + error ("%Hinvalid type for iteration variable %qE", &elocus, decl); + fail = true; + } + if (TYPE_UNSIGNED (TREE_TYPE (decl))) + warning (0, "%Hiteration variable %qE is unsigned", &elocus, decl); + + /* In the case of "for (int i = 0...)", init will be a decl. It should + have a DECL_INITIAL that we can turn into an assignment. */ + if (init == decl) + { + elocus = DECL_SOURCE_LOCATION (decl); + + init = DECL_INITIAL (decl); + if (init == NULL) + { + error ("%H%qE is not initialized", &elocus, decl); + init = integer_zero_node; + fail = true; + } + + init = build_modify_expr (decl, NOP_EXPR, init); + SET_EXPR_LOCATION (init, elocus); + } + gcc_assert (TREE_CODE (init) == MODIFY_EXPR); + gcc_assert (TREE_OPERAND (init, 0) == decl); + + if (cond == NULL_TREE) + { + error ("%Hmissing controlling predicate", &elocus); + fail = true; + } + else + { + bool cond_ok = false; + + if (EXPR_HAS_LOCATION (cond)) + elocus = EXPR_LOCATION (cond); + + if (TREE_CODE (cond) == LT_EXPR + || TREE_CODE (cond) == LE_EXPR + || TREE_CODE (cond) == GT_EXPR + || TREE_CODE (cond) == GE_EXPR) + { + tree op0 = TREE_OPERAND (cond, 0); + tree op1 = TREE_OPERAND (cond, 1); + + /* 2.5.1. The comparison in the condition is computed in the type + of DECL, otherwise the behavior is undefined. + + For example: + long n; int i; + i < n; + + according to ISO will be evaluated as: + (long)i < n; + + We want to force: + i < (int)n; */ + if (TREE_CODE (op0) == NOP_EXPR + && decl == TREE_OPERAND (op0, 0)) + { + TREE_OPERAND (cond, 0) = TREE_OPERAND (op0, 0); + TREE_OPERAND (cond, 1) = fold_build1 (NOP_EXPR, TREE_TYPE (decl), + TREE_OPERAND (cond, 1)); + } + else if (TREE_CODE (op1) == NOP_EXPR + && decl == TREE_OPERAND (op1, 0)) + { + TREE_OPERAND (cond, 1) = TREE_OPERAND (op1, 0); + TREE_OPERAND (cond, 0) = fold_build1 (NOP_EXPR, TREE_TYPE (decl), + TREE_OPERAND (cond, 0)); + } + + if (decl == TREE_OPERAND (cond, 0)) + cond_ok = true; + else if (decl == TREE_OPERAND (cond, 1)) + { + TREE_SET_CODE (cond, swap_tree_comparison (TREE_CODE (cond))); + TREE_OPERAND (cond, 1) = TREE_OPERAND (cond, 0); + TREE_OPERAND (cond, 0) = decl; + cond_ok = true; + } + } + + if (!cond_ok) + { + error ("%Hinvalid controlling predicate", &elocus); + fail = true; + } + } + + if (incr == NULL_TREE) + { + error ("%Hmissing increment expression", &elocus); + fail = true; + } + else + { + bool incr_ok = false; + + if (EXPR_HAS_LOCATION (incr)) + elocus = EXPR_LOCATION (incr); + + /* Check all the valid increment expressions: v++, v--, ++v, --v, + v = v + incr, v = incr + v and v = v - incr. */ + switch (TREE_CODE (incr)) + { + case POSTINCREMENT_EXPR: + case PREINCREMENT_EXPR: + case POSTDECREMENT_EXPR: + case PREDECREMENT_EXPR: + incr_ok = (TREE_OPERAND (incr, 0) == decl); + break; + + case MODIFY_EXPR: + if (TREE_OPERAND (incr, 0) != decl) + break; + if (TREE_OPERAND (incr, 1) == decl) + break; + if (TREE_CODE (TREE_OPERAND (incr, 1)) == PLUS_EXPR + && (TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl + || TREE_OPERAND (TREE_OPERAND (incr, 1), 1) == decl)) + incr_ok = true; + else if (TREE_CODE (TREE_OPERAND (incr, 1)) == MINUS_EXPR + && TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl) + incr_ok = true; + else + { + tree t = check_omp_for_incr_expr (TREE_OPERAND (incr, 1), decl); + if (t != error_mark_node) + { + incr_ok = true; + t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t); + incr = build2 (MODIFY_EXPR, void_type_node, decl, t); + } + } + break; + + default: + break; + } + if (!incr_ok) + { + error ("%Hinvalid increment expression", &elocus); + fail = true; + } + } + + if (fail) + return NULL; + else + { + tree t = make_node (OMP_FOR); + + TREE_TYPE (t) = void_type_node; + OMP_FOR_INIT (t) = init; + OMP_FOR_COND (t) = cond; + OMP_FOR_INCR (t) = incr; + OMP_FOR_BODY (t) = body; + OMP_FOR_PRE_BODY (t) = pre_body; + + SET_EXPR_LOCATION (t, locus); + return add_stmt (t); + } +} + + +/* Divide CLAUSES into two lists: those that apply to a parallel construct, + and those that apply to a work-sharing construct. Place the results in + *PAR_CLAUSES and *WS_CLAUSES respectively. In addition, add a nowait + clause to the work-sharing list. */ + +void +c_split_parallel_clauses (tree clauses, tree *par_clauses, tree *ws_clauses) +{ + tree next; + + *par_clauses = NULL; + *ws_clauses = build_omp_clause (OMP_CLAUSE_NOWAIT); + + for (; clauses ; clauses = next) + { + next = OMP_CLAUSE_CHAIN (clauses); + + switch (OMP_CLAUSE_CODE (clauses)) + { + case OMP_CLAUSE_PRIVATE: + case OMP_CLAUSE_SHARED: + case OMP_CLAUSE_FIRSTPRIVATE: + case OMP_CLAUSE_LASTPRIVATE: + case OMP_CLAUSE_REDUCTION: + case OMP_CLAUSE_COPYIN: + case OMP_CLAUSE_IF: + case OMP_CLAUSE_NUM_THREADS: + case OMP_CLAUSE_DEFAULT: + OMP_CLAUSE_CHAIN (clauses) = *par_clauses; + *par_clauses = clauses; + break; + + case OMP_CLAUSE_SCHEDULE: + case OMP_CLAUSE_ORDERED: + OMP_CLAUSE_CHAIN (clauses) = *ws_clauses; + *ws_clauses = clauses; + break; + + default: + gcc_unreachable (); + } + } +} + +/* True if OpenMP sharing attribute of DECL is predetermined. */ + +enum omp_clause_default_kind +c_omp_predetermined_sharing (tree decl) +{ + /* Variables with const-qualified type having no mutable member + are predetermined shared. */ + if (TREE_READONLY (decl)) + return OMP_CLAUSE_DEFAULT_SHARED; + + return OMP_CLAUSE_DEFAULT_UNSPECIFIED; +} diff --git a/contrib/gcc/c-opts.c b/contrib/gcc/c-opts.c index 2a617447cfd..ed04791f25c 100644 --- a/contrib/gcc/c-opts.c +++ b/contrib/gcc/c-opts.c @@ -1,5 +1,6 @@ /* C/ObjC/C++ command line option handling. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Neil Booth. This file is part of GCC. @@ -16,8 +17,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -37,6 +38,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "debug.h" /* For debug_hooks. */ #include "opts.h" #include "options.h" +#include "mkdeps.h" #ifndef DOLLARS_IN_IDENTIFIERS # define DOLLARS_IN_IDENTIFIERS true @@ -46,7 +48,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA # define TARGET_SYSTEM_ROOT NULL #endif -static int saved_lineno; +#ifndef TARGET_OPTF +#define TARGET_OPTF(ARG) +#endif /* CPP's options. */ static cpp_options *cpp_opts; @@ -67,12 +71,18 @@ static bool deps_seen; /* If -v seen. */ static bool verbose; +/* If -lang-fortran seen. */ +static bool lang_fortran = false; + /* Dependency output file. */ static const char *deps_file; /* The prefix given by -iprefix, if any. */ static const char *iprefix; +/* The multilib directory given by -imultilib, if any. */ +static const char *imultilib; + /* The system root, if any. Overridden by -isysroot. */ static const char *sysroot = TARGET_SYSTEM_ROOT; @@ -88,15 +98,15 @@ static bool quote_chain_split; /* If -Wunused-macros. */ static bool warn_unused_macros; +/* If -Wvariadic-macros. */ +static bool warn_variadic_macros = true; + /* Number of deferred options. */ static size_t deferred_count; /* Number of deferred options scanned for -include. */ static size_t include_cursor; -/* Permit Fotran front-end options. */ -static bool permit_fortran_options; - static void set_Wimplicit (int); static void handle_OPT_d (const char *); static void set_std_cxx98 (int); @@ -138,23 +148,25 @@ c_common_missing_argument (const char *opt, size_t code) return false; case OPT_fconstant_string_class_: - error ("no class name specified with \"%s\"", opt); + error ("no class name specified with %qs", opt); break; case OPT_A: - error ("assertion missing after \"%s\"", opt); + error ("assertion missing after %qs", opt); break; case OPT_D: case OPT_U: - error ("macro name missing after \"%s\"", opt); + error ("macro name missing after %qs", opt); break; + case OPT_F: case OPT_I: case OPT_idirafter: case OPT_isysroot: case OPT_isystem: - error ("missing path after \"%s\"", opt); + case OPT_iquote: + error ("missing path after %qs", opt); break; case OPT_MF: @@ -163,12 +175,12 @@ c_common_missing_argument (const char *opt, size_t code) case OPT_include: case OPT_imacros: case OPT_o: - error ("missing filename after \"%s\"", opt); + error ("missing filename after %qs", opt); break; case OPT_MQ: case OPT_MT: - error ("missing makefile target after \"%s\"", opt); + error ("missing makefile target after %qs", opt); break; } @@ -204,7 +216,7 @@ c_common_init_options (unsigned int argc, const char **argv) } parse_in = cpp_create_reader (c_dialect_cxx () ? CLK_GNUCXX: CLK_GNUC89, - ident_hash); + ident_hash, &line_table); cpp_opts = cpp_get_options (parse_in); cpp_opts->dollars_in_ident = DOLLARS_IN_IDENTIFIERS; @@ -214,33 +226,35 @@ c_common_init_options (unsigned int argc, const char **argv) before passing on command-line options to cpplib. */ cpp_opts->warn_dollars = 0; - flag_const_strings = c_dialect_cxx (); flag_exceptions = c_dialect_cxx (); warn_pointer_arith = c_dialect_cxx (); + warn_write_strings = c_dialect_cxx(); - deferred_opts = xmalloc (argc * sizeof (struct deferred_opt)); + deferred_opts = XNEWVEC (struct deferred_opt, argc); result = lang_flags[c_language]; if (c_language == clk_c) { + /* If preprocessing assembly language, accept any of the C-family + front end options since the driver may pass them through. */ for (i = 1; i < argc; i++) - { - /* If preprocessing assembly language, accept any of the C-family - front end options since the driver may pass them through. */ - if (! strcmp (argv[i], "-lang-asm")) + if (! strcmp (argv[i], "-lang-asm")) + { result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX; -#ifdef CL_F77 - /* If potentially preprocessing Fortran we have to accept its - front end options since the driver may them through. */ - else if (! strcmp (argv[i], "-traditional-cpp")) - { - permit_fortran_options = true; - result |= CL_F77; - } -#endif + break; + } + +#ifdef CL_Fortran + for (i = 1; i < argc; i++) + if (! strcmp (argv[i], "-lang-fortran")) + { + result |= CL_Fortran; + break; } +#endif } + return result; } @@ -255,10 +269,20 @@ c_common_handle_option (size_t scode, const char *arg, int value) enum opt_code code = (enum opt_code) scode; int result = 1; + /* Prevent resetting the language standard to a C dialect when the driver + has already determined that we're looking at assembler input. */ + bool preprocessing_asm_p = (cpp_get_options (parse_in)->lang == CLK_ASM); + switch (code) { default: - result = permit_fortran_options; + if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX)) + break; +#ifdef CL_Fortran + if (lang_fortran && (cl_options[code].flags & (CL_Fortran))) + break; +#endif + result = 0; break; case OPT__output_pch_: @@ -290,15 +314,20 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->print_include_names = 1; break; + case OPT_F: + TARGET_OPTF (xstrdup (arg)); + break; + case OPT_I: if (strcmp (arg, "-")) - add_path (xstrdup (arg), BRACKET, 0); + add_path (xstrdup (arg), BRACKET, 0, true); else { if (quote_chain_split) error ("-I- specified twice"); quote_chain_split = true; split_quote_chain (); + inform ("obsolete option -I- used, please use -iquote instead"); } break; @@ -352,10 +381,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) defer_opt (code, arg); break; - case OPT_Wabi: - warn_abi = value; - break; - case OPT_Wall: set_Wunused (value); set_Wformat (value); @@ -369,6 +394,8 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_sign_compare = value; warn_switch = value; warn_strict_aliasing = value; + warn_strict_overflow = value; + warn_address = value; /* Only warn about unknown pragmas that are not in system headers. */ @@ -387,7 +414,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) else { /* C++-specific warnings. */ - warn_nonvdtor = value; warn_reorder = value; warn_nontemplate_friend = value; } @@ -396,18 +422,9 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->warn_comments = value; cpp_opts->warn_num_sign_change = value; cpp_opts->warn_multichar = value; /* Was C++ only. */ - break; - case OPT_Wbad_function_cast: - warn_bad_function_cast = value; - break; - - case OPT_Wcast_qual: - warn_cast_qual = value; - break; - - case OPT_Wchar_subscripts: - warn_char_subscripts = value; + if (warn_pointer_sign == -1) + warn_pointer_sign = 1; break; case OPT_Wcomment: @@ -415,47 +432,23 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->warn_comments = value; break; - case OPT_Wconversion: - warn_conversion = value; - break; - - case OPT_Wctor_dtor_privacy: - warn_ctor_dtor_privacy = value; - break; - - case OPT_Wdeclaration_after_statement: - warn_declaration_after_statement = value; - break; - case OPT_Wdeprecated: - warn_deprecated = value; cpp_opts->warn_deprecated = value; break; - case OPT_Wdiv_by_zero: - warn_div_by_zero = value; - break; - - case OPT_Weffc__: - warn_ecpp = value; - break; - case OPT_Wendif_labels: cpp_opts->warn_endif_labels = value; break; case OPT_Werror: cpp_opts->warnings_are_errors = value; + global_dc->warning_as_error_requested = value; break; case OPT_Werror_implicit_function_declaration: mesg_implicit_function_declaration = 2; break; - case OPT_Wfloat_equal: - warn_float_equal = value; - break; - case OPT_Wformat: set_Wformat (value); break; @@ -464,58 +457,18 @@ c_common_handle_option (size_t scode, const char *arg, int value) set_Wformat (atoi (arg)); break; - case OPT_Wformat_extra_args: - warn_format_extra_args = value; - break; - - case OPT_Wformat_nonliteral: - warn_format_nonliteral = value; - break; - - case OPT_Wformat_security: - warn_format_security = value; - break; - - case OPT_Wformat_y2k: - warn_format_y2k = value; - break; - - case OPT_Wformat_zero_length: - warn_format_zero_length = value; - break; - - case OPT_Winit_self: - warn_init_self = value; - break; - case OPT_Wimplicit: set_Wimplicit (value); break; - case OPT_Wimplicit_function_declaration: - mesg_implicit_function_declaration = value; - break; - - case OPT_Wimplicit_int: - warn_implicit_int = value; - break; - case OPT_Wimport: /* Silently ignore for now. */ break; - case OPT_Winvalid_offsetof: - warn_invalid_offsetof = value; - break; - case OPT_Winvalid_pch: cpp_opts->warn_invalid_pch = value; break; - case OPT_Wlong_long: - warn_long_long = value; - break; - case OPT_Wmain: if (value) warn_main = 1; @@ -523,104 +476,33 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_main = -1; break; - case OPT_Wmissing_braces: - warn_missing_braces = value; - break; - - case OPT_Wmissing_declarations: - warn_missing_declarations = value; - break; - - case OPT_Wmissing_format_attribute: - warn_missing_format_attribute = value; - break; - - case OPT_Wmissing_prototypes: - warn_missing_prototypes = value; + case OPT_Wmissing_include_dirs: + cpp_opts->warn_missing_include_dirs = value; break; case OPT_Wmultichar: cpp_opts->warn_multichar = value; break; - case OPT_Wnested_externs: - warn_nested_externs = value; - break; - - case OPT_Wnon_template_friend: - warn_nontemplate_friend = value; - break; - - case OPT_Wnon_virtual_dtor: - warn_nonvdtor = value; - break; - - case OPT_Wnonnull: - warn_nonnull = value; - break; - - case OPT_Wold_style_definition: - warn_old_style_definition = value; - break; - - case OPT_Wold_style_cast: - warn_old_style_cast = value; - break; - - case OPT_Woverloaded_virtual: - warn_overloaded_virtual = value; - break; - - case OPT_Wparentheses: - warn_parentheses = value; - break; - - case OPT_Wpmf_conversions: - warn_pmf2ptr = value; - break; - - case OPT_Wpointer_arith: - warn_pointer_arith = value; - break; - - case OPT_Wprotocol: - warn_protocol = value; - break; - - case OPT_Wselector: - warn_selector = value; - break; - - case OPT_Wredundant_decls: - warn_redundant_decls = value; - break; - - case OPT_Wreorder: - warn_reorder = value; + case OPT_Wnormalized_: + if (!value || (arg && strcasecmp (arg, "none") == 0)) + cpp_opts->warn_normalize = normalized_none; + else if (!arg || strcasecmp (arg, "nfkc") == 0) + cpp_opts->warn_normalize = normalized_KC; + else if (strcasecmp (arg, "id") == 0) + cpp_opts->warn_normalize = normalized_identifier_C; + else if (strcasecmp (arg, "nfc") == 0) + cpp_opts->warn_normalize = normalized_C; + else + error ("argument %qs to %<-Wnormalized%> not recognized", arg); break; case OPT_Wreturn_type: warn_return_type = value; break; - case OPT_Wsequence_point: - warn_sequence_point = value; - break; - - case OPT_Wsign_compare: - warn_sign_compare = value; - break; - - case OPT_Wsign_promo: - warn_sign_promo = value; - break; - - case OPT_Wstrict_prototypes: - warn_strict_prototypes = value; - break; - - case OPT_Wsynth: - warn_synth = value; + case OPT_Wstrict_null_sentinel: + warn_strict_null_sentinel = value; break; case OPT_Wsystem_headers: @@ -628,7 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) break; case OPT_Wtraditional: - warn_traditional = value; cpp_opts->warn_traditional = value; break; @@ -636,10 +517,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->warn_trigraphs = value; break; - case OPT_Wundeclared_selector: - warn_undeclared_selector = value; - break; - case OPT_Wundef: cpp_opts->warn_undef = value; break; @@ -654,11 +531,18 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_unused_macros = value; break; + case OPT_Wvariadic_macros: + warn_variadic_macros = value; + break; + case OPT_Wwrite_strings: - if (!c_dialect_cxx ()) - flag_const_strings = value; - else - warn_write_strings = value; + warn_write_strings = value; + break; + + case OPT_Weffc__: + warn_ecpp = value; + if (value) + warn_nonvdtor = true; break; case OPT_ansi: @@ -697,7 +581,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_fvtable_thunks: case OPT_fxref: case OPT_fvtable_gc: - warning ("switch \"%s\" is no longer supported", option->opt_text); + warning (0, "switch %qs is no longer supported", option->opt_text); break; case OPT_faccess_control: @@ -723,11 +607,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->dollars_in_ident = value; break; - case OPT_fdump_: - if (!dump_switch_p (arg)) - result = 0; - break; - case OPT_ffreestanding: value = !value; /* Fall through.... */ @@ -753,7 +632,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_fsigned_bitfields: flag_signed_bitfields = value; - explicit_flag_signed_bitfields = 1; break; case OPT_fsigned_char: @@ -762,7 +640,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_funsigned_bitfields: flag_signed_bitfields = !value; - explicit_flag_signed_bitfields = 1; break; case OPT_funsigned_char: @@ -777,10 +654,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_conserve_space = value; break; - case OPT_fconst_strings: - flag_const_strings = value; - break; - case OPT_fconstant_string_class_: constant_string_class_name = arg; break; @@ -797,11 +670,8 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_enforce_eh_specs = value; break; - case OPT_ffixed_form: - case OPT_ffixed_line_length_: - /* Fortran front end options ignored when preprocessing only. */ - if (!flag_preprocess_only) - result = 0; + case OPT_fextended_identifiers: + cpp_opts->extended_identifiers = value; break; case OPT_ffor_scope: @@ -817,7 +687,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) break; case OPT_fhandle_exceptions: - warning ("-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"); + warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"); flag_exceptions = value; break; @@ -849,10 +719,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_no_nonansi_builtin = !value; break; - case OPT_fobjc_exceptions: - flag_objc_exceptions = value; - break; - case OPT_foperator_names: cpp_opts->operator_names = value; break; @@ -865,6 +731,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->restore_pch_deps = value; break; + case OPT_fpch_preprocess: + flag_pch_preprocess = value; + break; + case OPT_fpermissive: flag_permissive = value; break; @@ -876,7 +746,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_freplace_objc_classes: flag_replace_objc_classes = value; break; - + case OPT_frepo: flag_use_repository = value; if (value) @@ -920,11 +790,23 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_fuse_cxa_atexit: flag_use_cxa_atexit = value; break; + + case OPT_fuse_cxa_get_exception_ptr: + flag_use_cxa_get_exception_ptr = value; + break; + + case OPT_fvisibility_inlines_hidden: + visibility_options.inlines_hidden = value; + break; case OPT_fweak: flag_weak = value; break; + case OPT_fthreadsafe_statics: + flag_threadsafe_statics = value; + break; + case OPT_fzero_link: flag_zero_link = value; break; @@ -934,7 +816,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) break; case OPT_idirafter: - add_path (xstrdup (arg), AFTER, 0); + add_path (xstrdup (arg), AFTER, 0, true); break; case OPT_imacros: @@ -942,16 +824,24 @@ c_common_handle_option (size_t scode, const char *arg, int value) defer_opt (code, arg); break; + case OPT_imultilib: + imultilib = arg; + break; + case OPT_iprefix: iprefix = arg; break; + case OPT_iquote: + add_path (xstrdup (arg), QUOTE, 0, true); + break; + case OPT_isysroot: sysroot = arg; break; case OPT_isystem: - add_path (xstrdup (arg), SYSTEM, 0); + add_path (xstrdup (arg), SYSTEM, 0, true); break; case OPT_iwithprefix: @@ -967,6 +857,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) cpp_opts->dollars_in_ident = false; break; + case OPT_lang_fortran: + lang_fortran = true; + break; + case OPT_lang_objc: cpp_opts->objc = 1; break; @@ -995,41 +889,55 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_pedantic: cpp_opts->pedantic = 1; cpp_opts->warn_endif_labels = 1; + if (warn_pointer_sign == -1) + warn_pointer_sign = 1; + if (warn_overlength_strings == -1) + warn_overlength_strings = 1; break; case OPT_print_objc_runtime_info: print_struct_values = 1; break; + case OPT_print_pch_checksum: + c_common_print_pch_checksum (stdout); + exit_after_options = true; + break; + case OPT_remap: cpp_opts->remap = 1; break; case OPT_std_c__98: case OPT_std_gnu__98: - set_std_cxx98 (code == OPT_std_c__98 /* ISO */); + if (!preprocessing_asm_p) + set_std_cxx98 (code == OPT_std_c__98 /* ISO */); break; case OPT_std_c89: case OPT_std_iso9899_1990: case OPT_std_iso9899_199409: - set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */); + if (!preprocessing_asm_p) + set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */); break; case OPT_std_gnu89: - set_std_c89 (false /* c94 */, false /* ISO */); + if (!preprocessing_asm_p) + set_std_c89 (false /* c94 */, false /* ISO */); break; case OPT_std_c99: case OPT_std_c9x: case OPT_std_iso9899_1999: case OPT_std_iso9899_199x: - set_std_c99 (true /* ISO */); + if (!preprocessing_asm_p) + set_std_c99 (true /* ISO */); break; case OPT_std_gnu99: case OPT_std_gnu9x: - set_std_c99 (false /* ISO */); + if (!preprocessing_asm_p) + set_std_c99 (false /* ISO */); break; case OPT_trigraphs: @@ -1065,7 +973,7 @@ c_common_post_options (const char **pfilename) /* Canonicalize the input and output filenames. */ if (in_fnames == NULL) { - in_fnames = xmalloc (sizeof (in_fnames[0])); + in_fnames = XNEWVEC (const char *, 1); in_fnames[0] = ""; } else if (strcmp (in_fnames[0], "-") == 0) @@ -1081,48 +989,80 @@ c_common_post_options (const char **pfilename) sanitize_cpp_opts (); - register_include_chains (parse_in, sysroot, iprefix, + register_include_chains (parse_in, sysroot, iprefix, imultilib, std_inc, std_cxx_inc && c_dialect_cxx (), verbose); +#ifdef C_COMMON_OVERRIDE_OPTIONS + /* Some machines may reject certain combinations of C + language-specific options. */ + C_COMMON_OVERRIDE_OPTIONS; +#endif + flag_inline_trees = 1; - /* Use tree inlining if possible. Function instrumentation is only - done in the RTL level, so we disable tree inlining. */ - if (flag_instrument_function_entry_exit) - { - flag_no_inline = 1; - flag_really_no_inline = 1; - } - else - { - if (!flag_no_inline) - flag_no_inline = 1; - if (flag_inline_functions) - { - flag_inline_trees = 2; - flag_inline_functions = 0; - } - } + /* Use tree inlining. */ + if (!flag_no_inline) + flag_no_inline = 1; + if (flag_inline_functions) + flag_inline_trees = 2; - /* -Wextra implies -Wsign-compare, but not if explicitly - overridden. */ + /* We recognize -fgnu89-inline in preparation for 4.3 where the + option will be meaningful. Here we just reject + -fno-gnu89-inline, since we don't support it. */ + if (!flag_gnu89_inline) + error ("-fno-gnu89-inline is not supported"); + + /* If we are given more than one input file, we must use + unit-at-a-time mode. */ + if (num_in_fnames > 1) + flag_unit_at_a_time = 1; + + /* Default to ObjC sjlj exception handling if NeXT runtime. */ + if (flag_objc_sjlj_exceptions < 0) + flag_objc_sjlj_exceptions = flag_next_runtime; + if (flag_objc_exceptions && !flag_objc_sjlj_exceptions) + flag_exceptions = 1; + + /* -Wextra implies -Wsign-compare, -Wmissing-field-initializers and + -Woverride-init, but not if explicitly overridden. */ if (warn_sign_compare == -1) warn_sign_compare = extra_warnings; + if (warn_missing_field_initializers == -1) + warn_missing_field_initializers = extra_warnings; + if (warn_override_init == -1) + warn_override_init = extra_warnings; + + /* -Wpointer_sign is disabled by default, but it is enabled if any + of -Wall or -pedantic are given. */ + if (warn_pointer_sign == -1) + warn_pointer_sign = 0; + + /* -Woverlength-strings is off by default, but is enabled by -pedantic. + It is never enabled in C++, as the minimum limit is not normative + in that standard. */ + if (warn_overlength_strings == -1 || c_dialect_cxx ()) + warn_overlength_strings = 0; /* Special format checking options don't work without -Wformat; warn if they are used. */ - if (warn_format_y2k && !warn_format) - warning ("-Wformat-y2k ignored without -Wformat"); - if (warn_format_extra_args && !warn_format) - warning ("-Wformat-extra-args ignored without -Wformat"); - if (warn_format_zero_length && !warn_format) - warning ("-Wformat-zero-length ignored without -Wformat"); - if (warn_format_nonliteral && !warn_format) - warning ("-Wformat-nonliteral ignored without -Wformat"); - if (warn_format_security && !warn_format) - warning ("-Wformat-security ignored without -Wformat"); - if (warn_missing_format_attribute && !warn_format) - warning ("-Wmissing-format-attribute ignored without -Wformat"); + if (!warn_format) + { + warning (OPT_Wformat_y2k, + "-Wformat-y2k ignored without -Wformat"); + warning (OPT_Wformat_extra_args, + "-Wformat-extra-args ignored without -Wformat"); + warning (OPT_Wformat_zero_length, + "-Wformat-zero-length ignored without -Wformat"); + warning (OPT_Wformat_nonliteral, + "-Wformat-nonliteral ignored without -Wformat"); + warning (OPT_Wformat_security, + "-Wformat-security ignored without -Wformat"); + } + + /* C99 requires special handling of complex multiplication and division; + -ffast-math and -fcx-limited-range are handled in process_options. */ + if (flag_isoc99) + flag_complex_method = 2; if (flag_preprocess_only) { @@ -1151,7 +1091,7 @@ c_common_post_options (const char **pfilename) init_c_lex (); /* Yuk. WTF is this? I do know ObjC relies on it somewhere. */ - input_line = 0; + input_location = UNKNOWN_LOCATION; } cb = cpp_get_callbacks (parse_in); @@ -1159,8 +1099,7 @@ c_common_post_options (const char **pfilename) cb->dir_change = cb_dir_change; cpp_post_options (parse_in); - saved_lineno = input_line; - input_line = 0; + input_location = UNKNOWN_LOCATION; /* If an error has occurred in cpplib, note it so we fail immediately. */ @@ -1176,7 +1115,7 @@ c_common_post_options (const char **pfilename) } if (flag_working_directory - && flag_preprocess_only && ! flag_no_line_commands) + && flag_preprocess_only && !flag_no_line_commands) pp_dir_change (parse_in, get_src_pwd ()); return flag_preprocess_only; @@ -1186,21 +1125,22 @@ c_common_post_options (const char **pfilename) bool c_common_init (void) { - input_line = saved_lineno; - /* Set up preprocessor arithmetic. Must be done after call to c_common_nodes_and_builtins for type nodes to be good. */ cpp_opts->precision = TYPE_PRECISION (intmax_type_node); cpp_opts->char_precision = TYPE_PRECISION (char_type_node); cpp_opts->int_precision = TYPE_PRECISION (integer_type_node); cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node); - cpp_opts->unsigned_wchar = TREE_UNSIGNED (wchar_type_node); + cpp_opts->unsigned_wchar = TYPE_UNSIGNED (wchar_type_node); cpp_opts->bytes_big_endian = BYTES_BIG_ENDIAN; /* This can't happen until after wchar_precision and bytes_big_endian are known. */ cpp_init_iconv (parse_in); + if (version_flag) + c_common_print_pch_checksum (stderr); + if (flag_preprocess_only) { finish_options (); @@ -1217,41 +1157,44 @@ c_common_init (void) /* Initialize the integrated preprocessor after debug output has been initialized; loop over each input file. */ void -c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED) +c_common_parse_file (int set_yydebug) { - unsigned file_index; - + unsigned int i; + + /* Enable parser debugging, if requested and we can. If requested + and we can't, notify the user. */ #if YYDEBUG != 0 yydebug = set_yydebug; #else - warning ("YYDEBUG not defined"); + if (set_yydebug) + warning (0, "YYDEBUG was not defined at build time, -dy ignored"); #endif - file_index = 0; - - do + i = 0; + for (;;) { - if (file_index > 0) - { - /* Reset the state of the parser. */ - c_reset_state(); - - /* Reset cpplib's macros and start a new file. */ - cpp_undef_all (parse_in); - main_input_filename = this_input_filename - = cpp_read_main_file (parse_in, in_fnames[file_index]); - if (this_input_filename == NULL) - break; - } + /* Start the main input file, if the debug writer wants it. */ + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->start_source_file) (0, this_input_filename); finish_options (); - if (file_index == 0) - pch_init(); + pch_init (); + push_file_scope (); c_parse_file (); - - file_index++; - } while (file_index < num_in_fnames); - - finish_file (); + finish_file (); + pop_file_scope (); + /* And end the main input file, if the debug writer wants it */ + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->end_source_file) (0); + if (++i >= num_in_fnames) + break; + cpp_undef_all (parse_in); + this_input_filename + = cpp_read_main_file (parse_in, in_fnames[i]); + /* If an input file is missing, abandon further compilation. + cpplib has issued a diagnostic. */ + if (!this_input_filename) + break; + } } /* Common finish hook for the C, ObjC and C++ front ends. */ @@ -1327,6 +1270,7 @@ check_deps_environment_vars (void) deps_file = spec; deps_append = 1; + deps_seen = true; } } @@ -1335,13 +1279,22 @@ static void handle_deferred_opts (void) { size_t i; + struct deps *deps; + + /* Avoid allocating the deps buffer if we don't need it. + (This flag may be true without there having been -MT or -MQ + options, but we'll still need the deps buffer.) */ + if (!deps_seen) + return; + + deps = cpp_get_deps (parse_in); for (i = 0; i < deferred_count; i++) { struct deferred_opt *opt = &deferred_opts[i]; if (opt->code == OPT_MT || opt->code == OPT_MQ) - cpp_add_dependency_target (parse_in, opt->arg, opt->code == OPT_MQ); + deps_add_target (deps, opt->arg, opt->code == OPT_MQ); } } @@ -1362,7 +1315,7 @@ sanitize_cpp_opts (void) /* Disable -dD, -dN and -dI if normal output is suppressed. Allow -dM since at least glibc relies on -M -dM to work. */ - /* Also, flag_no_output implies flag_no_line_commands, always. */ + /* Also, flag_no_output implies flag_no_line_commands, always. */ if (flag_no_output) { if (flag_dump_macros != 'M') @@ -1379,6 +1332,11 @@ sanitize_cpp_opts (void) cpp_opts->warn_long_long = warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional); + /* Similarly with -Wno-variadic-macros. No check for c99 here, since + this also turns off warnings about GCCs extension. */ + cpp_opts->warn_variadic_macros + = warn_variadic_macros && (pedantic || warn_traditional); + /* If we're generating preprocessor output, emit current directory if explicitly requested or if debugging information is enabled. ??? Maybe we should only do it for debugging formats that @@ -1399,12 +1357,12 @@ add_prefixed_path (const char *suffix, size_t chain) prefix = iprefix ? iprefix : cpp_GCC_INCLUDE_DIR; prefix_len = iprefix ? strlen (iprefix) : cpp_GCC_INCLUDE_DIR_len; - path = xmalloc (prefix_len + suffix_len + 1); + path = (char *) xmalloc (prefix_len + suffix_len + 1); memcpy (path, prefix, prefix_len); memcpy (path + prefix_len, suffix, suffix_len); path[prefix_len + suffix_len] = '\0'; - add_path (path, chain, 0); + add_path (path, chain, 0, false); } /* Handle -D, -U, -A, -imacros, and the first -include. */ @@ -1415,7 +1373,10 @@ finish_options (void) { size_t i; - cpp_change_file (parse_in, LC_RENAME, _("")); + cb_file_change (parse_in, + linemap_add (&line_table, LC_RENAME, 0, + _(""), 0)); + cpp_init_builtins (parse_in, flag_hosted); c_cpp_builtins (parse_in); @@ -1430,7 +1391,10 @@ finish_options (void) their acceptance on the -std= setting. */ cpp_opts->warn_dollars = (cpp_opts->pedantic && !cpp_opts->c99); - cpp_change_file (parse_in, LC_RENAME, _("")); + cb_file_change (parse_in, + linemap_add (&line_table, LC_RENAME, 0, + _(""), 0)); + for (i = 0; i < deferred_count; i++) { struct deferred_opt *opt = &deferred_opts[i]; @@ -1475,7 +1439,7 @@ push_command_line_include (void) { struct deferred_opt *opt = &deferred_opts[include_cursor++]; - if (! cpp_opts->preprocessed && opt->code == OPT_include + if (!cpp_opts->preprocessed && opt->code == OPT_include && cpp_push_include (parse_in, opt->arg)) return; } @@ -1486,19 +1450,18 @@ push_command_line_include (void) /* -Wunused-macros should only warn about macros defined hereafter. */ cpp_opts->warn_unused_macros = warn_unused_macros; /* Restore the line map from . */ - if (! cpp_opts->preprocessed) - cpp_change_file (parse_in, LC_RENAME, main_input_filename); + if (!cpp_opts->preprocessed) + cpp_change_file (parse_in, LC_RENAME, this_input_filename); /* Set this here so the client can change the option if it wishes, and after stacking the main file so we don't trace the main file. */ - cpp_get_line_maps (parse_in)->trace_includes - = cpp_opts->print_include_names; + line_table.trace_includes = cpp_opts->print_include_names; } } /* File change callback. Has to handle -include files. */ static void -cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED, +cb_file_change (cpp_reader * ARG_UNUSED (pfile), const struct line_map *new_map) { if (flag_preprocess_only) @@ -1511,10 +1474,10 @@ cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED, } void -cb_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir) +cb_dir_change (cpp_reader * ARG_UNUSED (pfile), const char *dir) { - if (! set_src_pwd (dir)) - warning ("too late for # directive to set debug directory"); + if (!set_src_pwd (dir)) + warning (0, "too late for # directive to set debug directory"); } /* Set the C 89 standard (with 1994 amendments if C94, without GNU @@ -1529,7 +1492,6 @@ set_std_c89 (int c94, int iso) flag_no_nonansi_builtin = iso; flag_isoc94 = c94; flag_isoc99 = 0; - flag_writable_strings = 0; } /* Set the C 99 standard (without GNU extensions if ISO). */ @@ -1542,7 +1504,6 @@ set_std_c99 (int iso) flag_iso = iso; flag_isoc99 = 1; flag_isoc94 = 1; - flag_writable_strings = 0; } /* Set the C++ 98 standard (without GNU extensions if ISO). */ diff --git a/contrib/gcc/c-parser.c b/contrib/gcc/c-parser.c new file mode 100644 index 00000000000..c6be63918f6 --- /dev/null +++ b/contrib/gcc/c-parser.c @@ -0,0 +1,7868 @@ +/* Parser for C and Objective-C. + Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + + Parser actions based on the old Bison parser; structure somewhat + influenced by and fragments based on the C++ parser. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* TODO: + + Make sure all relevant comments, and all relevant code from all + actions, brought over from old parser. Verify exact correspondence + of syntax accepted. + + Add testcases covering every input symbol in every state in old and + new parsers. + + Include full syntax for GNU C, including erroneous cases accepted + with error messages, in syntax productions in comments. + + Make more diagnostics in the front end generally take an explicit + location rather than implicitly using input_location. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "rtl.h" +#include "langhooks.h" +#include "input.h" +#include "cpplib.h" +#include "timevar.h" +#include "c-pragma.h" +#include "c-tree.h" +#include "flags.h" +#include "output.h" +#include "toplev.h" +#include "ggc.h" +#include "c-common.h" +#include "vec.h" +#include "target.h" +#include "cgraph.h" + + +/* Miscellaneous data and functions needed for the parser. */ + +int yydebug; + +/* Objective-C specific parser/lexer information. */ + +static int objc_pq_context = 0; + +/* The following flag is needed to contextualize Objective-C lexical + analysis. In some cases (e.g., 'int NSObject;'), it is undesirable + to bind an identifier to an Objective-C class, even if a class with + that name exists. */ +static int objc_need_raw_identifier = 0; +#define OBJC_NEED_RAW_IDENTIFIER(VAL) \ + do { \ + if (c_dialect_objc ()) \ + objc_need_raw_identifier = VAL; \ + } while (0) + +/* The reserved keyword table. */ +struct resword +{ + const char *word; + ENUM_BITFIELD(rid) rid : 16; + unsigned int disable : 16; +}; + +/* Disable mask. Keywords are disabled if (reswords[i].disable & + mask) is _true_. */ +#define D_C89 0x01 /* not in C89 */ +#define D_EXT 0x02 /* GCC extension */ +#define D_EXT89 0x04 /* GCC extension incorporated in C99 */ +#define D_OBJC 0x08 /* Objective C only */ + +static const struct resword reswords[] = +{ + { "_Bool", RID_BOOL, 0 }, + { "_Complex", RID_COMPLEX, 0 }, + { "_Decimal32", RID_DFLOAT32, D_EXT }, + { "_Decimal64", RID_DFLOAT64, D_EXT }, + { "_Decimal128", RID_DFLOAT128, D_EXT }, + { "__FUNCTION__", RID_FUNCTION_NAME, 0 }, + { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 }, + { "__alignof", RID_ALIGNOF, 0 }, + { "__alignof__", RID_ALIGNOF, 0 }, + { "__asm", RID_ASM, 0 }, + { "__asm__", RID_ASM, 0 }, + { "__attribute", RID_ATTRIBUTE, 0 }, + { "__attribute__", RID_ATTRIBUTE, 0 }, + { "__builtin_choose_expr", RID_CHOOSE_EXPR, 0 }, + { "__builtin_offsetof", RID_OFFSETOF, 0 }, + { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, 0 }, + { "__builtin_va_arg", RID_VA_ARG, 0 }, + { "__complex", RID_COMPLEX, 0 }, + { "__complex__", RID_COMPLEX, 0 }, + { "__const", RID_CONST, 0 }, + { "__const__", RID_CONST, 0 }, + { "__extension__", RID_EXTENSION, 0 }, + { "__func__", RID_C99_FUNCTION_NAME, 0 }, + { "__imag", RID_IMAGPART, 0 }, + { "__imag__", RID_IMAGPART, 0 }, + { "__inline", RID_INLINE, 0 }, + { "__inline__", RID_INLINE, 0 }, + { "__label__", RID_LABEL, 0 }, + { "__real", RID_REALPART, 0 }, + { "__real__", RID_REALPART, 0 }, + { "__restrict", RID_RESTRICT, 0 }, + { "__restrict__", RID_RESTRICT, 0 }, + { "__signed", RID_SIGNED, 0 }, + { "__signed__", RID_SIGNED, 0 }, + { "__thread", RID_THREAD, 0 }, + { "__typeof", RID_TYPEOF, 0 }, + { "__typeof__", RID_TYPEOF, 0 }, + { "__volatile", RID_VOLATILE, 0 }, + { "__volatile__", RID_VOLATILE, 0 }, + { "asm", RID_ASM, D_EXT }, + { "auto", RID_AUTO, 0 }, + { "break", RID_BREAK, 0 }, + { "case", RID_CASE, 0 }, + { "char", RID_CHAR, 0 }, + { "const", RID_CONST, 0 }, + { "continue", RID_CONTINUE, 0 }, + { "default", RID_DEFAULT, 0 }, + { "do", RID_DO, 0 }, + { "double", RID_DOUBLE, 0 }, + { "else", RID_ELSE, 0 }, + { "enum", RID_ENUM, 0 }, + { "extern", RID_EXTERN, 0 }, + { "float", RID_FLOAT, 0 }, + { "for", RID_FOR, 0 }, + { "goto", RID_GOTO, 0 }, + { "if", RID_IF, 0 }, + { "inline", RID_INLINE, D_EXT89 }, + { "int", RID_INT, 0 }, + { "long", RID_LONG, 0 }, + { "register", RID_REGISTER, 0 }, + { "restrict", RID_RESTRICT, D_C89 }, + { "return", RID_RETURN, 0 }, + { "short", RID_SHORT, 0 }, + { "signed", RID_SIGNED, 0 }, + { "sizeof", RID_SIZEOF, 0 }, + { "static", RID_STATIC, 0 }, + { "struct", RID_STRUCT, 0 }, + { "switch", RID_SWITCH, 0 }, + { "typedef", RID_TYPEDEF, 0 }, + { "typeof", RID_TYPEOF, D_EXT }, + { "union", RID_UNION, 0 }, + { "unsigned", RID_UNSIGNED, 0 }, + { "void", RID_VOID, 0 }, + { "volatile", RID_VOLATILE, 0 }, + { "while", RID_WHILE, 0 }, + /* These Objective-C keywords are recognized only immediately after + an '@'. */ + { "class", RID_AT_CLASS, D_OBJC }, + { "compatibility_alias", RID_AT_ALIAS, D_OBJC }, + { "defs", RID_AT_DEFS, D_OBJC }, + { "encode", RID_AT_ENCODE, D_OBJC }, + { "end", RID_AT_END, D_OBJC }, + { "implementation", RID_AT_IMPLEMENTATION, D_OBJC }, + { "interface", RID_AT_INTERFACE, D_OBJC }, + { "private", RID_AT_PRIVATE, D_OBJC }, + { "protected", RID_AT_PROTECTED, D_OBJC }, + { "protocol", RID_AT_PROTOCOL, D_OBJC }, + { "public", RID_AT_PUBLIC, D_OBJC }, + { "selector", RID_AT_SELECTOR, D_OBJC }, + { "throw", RID_AT_THROW, D_OBJC }, + { "try", RID_AT_TRY, D_OBJC }, + { "catch", RID_AT_CATCH, D_OBJC }, + { "finally", RID_AT_FINALLY, D_OBJC }, + { "synchronized", RID_AT_SYNCHRONIZED, D_OBJC }, + /* These are recognized only in protocol-qualifier context + (see above) */ + { "bycopy", RID_BYCOPY, D_OBJC }, + { "byref", RID_BYREF, D_OBJC }, + { "in", RID_IN, D_OBJC }, + { "inout", RID_INOUT, D_OBJC }, + { "oneway", RID_ONEWAY, D_OBJC }, + { "out", RID_OUT, D_OBJC }, +}; +#define N_reswords (sizeof reswords / sizeof (struct resword)) + +/* All OpenMP clauses. OpenMP 2.5. */ +typedef enum pragma_omp_clause { + PRAGMA_OMP_CLAUSE_NONE = 0, + + PRAGMA_OMP_CLAUSE_COPYIN, + PRAGMA_OMP_CLAUSE_COPYPRIVATE, + PRAGMA_OMP_CLAUSE_DEFAULT, + PRAGMA_OMP_CLAUSE_FIRSTPRIVATE, + PRAGMA_OMP_CLAUSE_IF, + PRAGMA_OMP_CLAUSE_LASTPRIVATE, + PRAGMA_OMP_CLAUSE_NOWAIT, + PRAGMA_OMP_CLAUSE_NUM_THREADS, + PRAGMA_OMP_CLAUSE_ORDERED, + PRAGMA_OMP_CLAUSE_PRIVATE, + PRAGMA_OMP_CLAUSE_REDUCTION, + PRAGMA_OMP_CLAUSE_SCHEDULE, + PRAGMA_OMP_CLAUSE_SHARED +} pragma_omp_clause; + + +/* Initialization routine for this file. */ + +void +c_parse_init (void) +{ + /* The only initialization required is of the reserved word + identifiers. */ + unsigned int i; + tree id; + int mask = (flag_isoc99 ? 0 : D_C89) + | (flag_no_asm ? (flag_isoc99 ? D_EXT : D_EXT|D_EXT89) : 0); + + if (!c_dialect_objc ()) + mask |= D_OBJC; + + ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX); + for (i = 0; i < N_reswords; i++) + { + /* If a keyword is disabled, do not enter it into the table + and so create a canonical spelling that isn't a keyword. */ + if (reswords[i].disable & mask) + continue; + + id = get_identifier (reswords[i].word); + C_RID_CODE (id) = reswords[i].rid; + C_IS_RESERVED_WORD (id) = 1; + ridpointers [(int) reswords[i].rid] = id; + } +} + +/* The C lexer intermediates between the lexer in cpplib and c-lex.c + and the C parser. Unlike the C++ lexer, the parser structure + stores the lexer information instead of using a separate structure. + Identifiers are separated into ordinary identifiers, type names, + keywords and some other Objective-C types of identifiers, and some + look-ahead is maintained. + + ??? It might be a good idea to lex the whole file up front (as for + C++). It would then be possible to share more of the C and C++ + lexer code, if desired. */ + +/* The following local token type is used. */ + +/* A keyword. */ +#define CPP_KEYWORD ((enum cpp_ttype) (N_TTYPES + 1)) + +/* More information about the type of a CPP_NAME token. */ +typedef enum c_id_kind { + /* An ordinary identifier. */ + C_ID_ID, + /* An identifier declared as a typedef name. */ + C_ID_TYPENAME, + /* An identifier declared as an Objective-C class name. */ + C_ID_CLASSNAME, + /* Not an identifier. */ + C_ID_NONE +} c_id_kind; + +/* A single C token after string literal concatenation and conversion + of preprocessing tokens to tokens. */ +typedef struct c_token GTY (()) +{ + /* The kind of token. */ + ENUM_BITFIELD (cpp_ttype) type : 8; + /* If this token is a CPP_NAME, this value indicates whether also + declared as some kind of type. Otherwise, it is C_ID_NONE. */ + ENUM_BITFIELD (c_id_kind) id_kind : 8; + /* If this token is a keyword, this value indicates which keyword. + Otherwise, this value is RID_MAX. */ + ENUM_BITFIELD (rid) keyword : 8; + /* If this token is a CPP_PRAGMA, this indicates the pragma that + was seen. Otherwise it is PRAGMA_NONE. */ + ENUM_BITFIELD (pragma_kind) pragma_kind : 7; + /* True if this token is from a system header. */ + BOOL_BITFIELD in_system_header : 1; + /* The value associated with this token, if any. */ + tree value; + /* The location at which this token was found. */ + location_t location; +} c_token; + +/* A parser structure recording information about the state and + context of parsing. Includes lexer information with up to two + tokens of look-ahead; more are not needed for C. */ +typedef struct c_parser GTY(()) +{ + /* The look-ahead tokens. */ + c_token tokens[2]; + /* How many look-ahead tokens are available (0, 1 or 2). */ + short tokens_avail; + /* True if a syntax error is being recovered from; false otherwise. + c_parser_error sets this flag. It should clear this flag when + enough tokens have been consumed to recover from the error. */ + BOOL_BITFIELD error : 1; + /* True if we're processing a pragma, and shouldn't automatically + consume CPP_PRAGMA_EOL. */ + BOOL_BITFIELD in_pragma : 1; +} c_parser; + + +/* The actual parser and external interface. ??? Does this need to be + garbage-collected? */ + +static GTY (()) c_parser *the_parser; + + +/* Read in and lex a single token, storing it in *TOKEN. */ + +static void +c_lex_one_token (c_token *token) +{ + timevar_push (TV_LEX); + + token->type = c_lex_with_flags (&token->value, &token->location, NULL); + token->id_kind = C_ID_NONE; + token->keyword = RID_MAX; + token->pragma_kind = PRAGMA_NONE; + token->in_system_header = in_system_header; + + switch (token->type) + { + case CPP_NAME: + { + tree decl; + + int objc_force_identifier = objc_need_raw_identifier; + OBJC_NEED_RAW_IDENTIFIER (0); + + if (C_IS_RESERVED_WORD (token->value)) + { + enum rid rid_code = C_RID_CODE (token->value); + + if (c_dialect_objc ()) + { + if (!OBJC_IS_AT_KEYWORD (rid_code) + && (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context)) + { + /* Return the canonical spelling for this keyword. */ + token->value = ridpointers[(int) rid_code]; + token->type = CPP_KEYWORD; + token->keyword = rid_code; + break; + } + } + else + { + /* Return the canonical spelling for this keyword. */ + token->value = ridpointers[(int) rid_code]; + token->type = CPP_KEYWORD; + token->keyword = rid_code; + break; + } + } + + decl = lookup_name (token->value); + if (decl) + { + if (TREE_CODE (decl) == TYPE_DECL) + { + token->id_kind = C_ID_TYPENAME; + break; + } + } + else if (c_dialect_objc ()) + { + tree objc_interface_decl = objc_is_class_name (token->value); + /* Objective-C class names are in the same namespace as + variables and typedefs, and hence are shadowed by local + declarations. */ + if (objc_interface_decl + && (global_bindings_p () + || (!objc_force_identifier && !decl))) + { + token->value = objc_interface_decl; + token->id_kind = C_ID_CLASSNAME; + break; + } + } + token->id_kind = C_ID_ID; + } + break; + case CPP_AT_NAME: + /* This only happens in Objective-C; it must be a keyword. */ + token->type = CPP_KEYWORD; + token->keyword = C_RID_CODE (token->value); + break; + case CPP_COLON: + case CPP_COMMA: + case CPP_CLOSE_PAREN: + case CPP_SEMICOLON: + /* These tokens may affect the interpretation of any identifiers + following, if doing Objective-C. */ + OBJC_NEED_RAW_IDENTIFIER (0); + break; + case CPP_PRAGMA: + /* We smuggled the cpp_token->u.pragma value in an INTEGER_CST. */ + token->pragma_kind = TREE_INT_CST_LOW (token->value); + token->value = NULL; + break; + default: + break; + } + timevar_pop (TV_LEX); +} + +/* Return a pointer to the next token from PARSER, reading it in if + necessary. */ + +static inline c_token * +c_parser_peek_token (c_parser *parser) +{ + if (parser->tokens_avail == 0) + { + c_lex_one_token (&parser->tokens[0]); + parser->tokens_avail = 1; + } + return &parser->tokens[0]; +} + +/* Return true if the next token from PARSER has the indicated + TYPE. */ + +static inline bool +c_parser_next_token_is (c_parser *parser, enum cpp_ttype type) +{ + return c_parser_peek_token (parser)->type == type; +} + +/* Return true if the next token from PARSER does not have the + indicated TYPE. */ + +static inline bool +c_parser_next_token_is_not (c_parser *parser, enum cpp_ttype type) +{ + return !c_parser_next_token_is (parser, type); +} + +/* Return true if the next token from PARSER is the indicated + KEYWORD. */ + +static inline bool +c_parser_next_token_is_keyword (c_parser *parser, enum rid keyword) +{ + c_token *token; + + /* Peek at the next token. */ + token = c_parser_peek_token (parser); + /* Check to see if it is the indicated keyword. */ + return token->keyword == keyword; +} + +/* Return true if TOKEN can start a type name, + false otherwise. */ +static bool +c_token_starts_typename (c_token *token) +{ + switch (token->type) + { + case CPP_NAME: + switch (token->id_kind) + { + case C_ID_ID: + return false; + case C_ID_TYPENAME: + return true; + case C_ID_CLASSNAME: + gcc_assert (c_dialect_objc ()); + return true; + default: + gcc_unreachable (); + } + case CPP_KEYWORD: + switch (token->keyword) + { + case RID_UNSIGNED: + case RID_LONG: + case RID_SHORT: + case RID_SIGNED: + case RID_COMPLEX: + case RID_INT: + case RID_CHAR: + case RID_FLOAT: + case RID_DOUBLE: + case RID_VOID: + case RID_DFLOAT32: + case RID_DFLOAT64: + case RID_DFLOAT128: + case RID_BOOL: + case RID_ENUM: + case RID_STRUCT: + case RID_UNION: + case RID_TYPEOF: + case RID_CONST: + case RID_VOLATILE: + case RID_RESTRICT: + case RID_ATTRIBUTE: + return true; + default: + return false; + } + case CPP_LESS: + if (c_dialect_objc ()) + return true; + return false; + default: + return false; + } +} + +/* Return true if the next token from PARSER can start a type name, + false otherwise. */ +static inline bool +c_parser_next_token_starts_typename (c_parser *parser) +{ + c_token *token = c_parser_peek_token (parser); + return c_token_starts_typename (token); +} + +/* Return true if TOKEN can start declaration specifiers, false + otherwise. */ +static bool +c_token_starts_declspecs (c_token *token) +{ + switch (token->type) + { + case CPP_NAME: + switch (token->id_kind) + { + case C_ID_ID: + return false; + case C_ID_TYPENAME: + return true; + case C_ID_CLASSNAME: + gcc_assert (c_dialect_objc ()); + return true; + default: + gcc_unreachable (); + } + case CPP_KEYWORD: + switch (token->keyword) + { + case RID_STATIC: + case RID_EXTERN: + case RID_REGISTER: + case RID_TYPEDEF: + case RID_INLINE: + case RID_AUTO: + case RID_THREAD: + case RID_UNSIGNED: + case RID_LONG: + case RID_SHORT: + case RID_SIGNED: + case RID_COMPLEX: + case RID_INT: + case RID_CHAR: + case RID_FLOAT: + case RID_DOUBLE: + case RID_VOID: + case RID_DFLOAT32: + case RID_DFLOAT64: + case RID_DFLOAT128: + case RID_BOOL: + case RID_ENUM: + case RID_STRUCT: + case RID_UNION: + case RID_TYPEOF: + case RID_CONST: + case RID_VOLATILE: + case RID_RESTRICT: + case RID_ATTRIBUTE: + return true; + default: + return false; + } + case CPP_LESS: + if (c_dialect_objc ()) + return true; + return false; + default: + return false; + } +} + +/* Return true if the next token from PARSER can start declaration + specifiers, false otherwise. */ +static inline bool +c_parser_next_token_starts_declspecs (c_parser *parser) +{ + c_token *token = c_parser_peek_token (parser); + return c_token_starts_declspecs (token); +} + +/* Return a pointer to the next-but-one token from PARSER, reading it + in if necessary. The next token is already read in. */ + +static c_token * +c_parser_peek_2nd_token (c_parser *parser) +{ + if (parser->tokens_avail >= 2) + return &parser->tokens[1]; + gcc_assert (parser->tokens_avail == 1); + gcc_assert (parser->tokens[0].type != CPP_EOF); + gcc_assert (parser->tokens[0].type != CPP_PRAGMA_EOL); + c_lex_one_token (&parser->tokens[1]); + parser->tokens_avail = 2; + return &parser->tokens[1]; +} + +/* Consume the next token from PARSER. */ + +static void +c_parser_consume_token (c_parser *parser) +{ + gcc_assert (parser->tokens_avail >= 1); + gcc_assert (parser->tokens[0].type != CPP_EOF); + gcc_assert (!parser->in_pragma || parser->tokens[0].type != CPP_PRAGMA_EOL); + gcc_assert (parser->error || parser->tokens[0].type != CPP_PRAGMA); + if (parser->tokens_avail == 2) + parser->tokens[0] = parser->tokens[1]; + parser->tokens_avail--; +} + +/* Expect the current token to be a #pragma. Consume it and remember + that we've begun parsing a pragma. */ + +static void +c_parser_consume_pragma (c_parser *parser) +{ + gcc_assert (!parser->in_pragma); + gcc_assert (parser->tokens_avail >= 1); + gcc_assert (parser->tokens[0].type == CPP_PRAGMA); + if (parser->tokens_avail == 2) + parser->tokens[0] = parser->tokens[1]; + parser->tokens_avail--; + parser->in_pragma = true; +} + +/* Update the globals input_location and in_system_header from + TOKEN. */ +static inline void +c_parser_set_source_position_from_token (c_token *token) +{ + if (token->type != CPP_EOF) + { + input_location = token->location; + in_system_header = token->in_system_header; + } +} + +/* Issue a diagnostic of the form + FILE:LINE: MESSAGE before TOKEN + where TOKEN is the next token in the input stream of PARSER. + MESSAGE (specified by the caller) is usually of the form "expected + OTHER-TOKEN". + + Do not issue a diagnostic if still recovering from an error. + + ??? This is taken from the C++ parser, but building up messages in + this way is not i18n-friendly and some other approach should be + used. */ + +static void +c_parser_error (c_parser *parser, const char *gmsgid) +{ + c_token *token = c_parser_peek_token (parser); + if (parser->error) + return; + parser->error = true; + if (!gmsgid) + return; + /* This diagnostic makes more sense if it is tagged to the line of + the token we just peeked at. */ + c_parser_set_source_position_from_token (token); + c_parse_error (gmsgid, + /* Because c_parse_error does not understand + CPP_KEYWORD, keywords are treated like + identifiers. */ + (token->type == CPP_KEYWORD ? CPP_NAME : token->type), + token->value); +} + +/* If the next token is of the indicated TYPE, consume it. Otherwise, + issue the error MSGID. If MSGID is NULL then a message has already + been produced and no message will be produced this time. Returns + true if found, false otherwise. */ + +static bool +c_parser_require (c_parser *parser, + enum cpp_ttype type, + const char *msgid) +{ + if (c_parser_next_token_is (parser, type)) + { + c_parser_consume_token (parser); + return true; + } + else + { + c_parser_error (parser, msgid); + return false; + } +} + +/* If the next token is the indicated keyword, consume it. Otherwise, + issue the error MSGID. Returns true if found, false otherwise. */ + +static bool +c_parser_require_keyword (c_parser *parser, + enum rid keyword, + const char *msgid) +{ + if (c_parser_next_token_is_keyword (parser, keyword)) + { + c_parser_consume_token (parser); + return true; + } + else + { + c_parser_error (parser, msgid); + return false; + } +} + +/* Like c_parser_require, except that tokens will be skipped until the + desired token is found. An error message is still produced if the + next token is not as expected. If MSGID is NULL then a message has + already been produced and no message will be produced this + time. */ + +static void +c_parser_skip_until_found (c_parser *parser, + enum cpp_ttype type, + const char *msgid) +{ + unsigned nesting_depth = 0; + + if (c_parser_require (parser, type, msgid)) + return; + + /* Skip tokens until the desired token is found. */ + while (true) + { + /* Peek at the next token. */ + c_token *token = c_parser_peek_token (parser); + /* If we've reached the token we want, consume it and stop. */ + if (token->type == type && !nesting_depth) + { + c_parser_consume_token (parser); + break; + } + + /* If we've run out of tokens, stop. */ + if (token->type == CPP_EOF) + return; + if (token->type == CPP_PRAGMA_EOL && parser->in_pragma) + return; + if (token->type == CPP_OPEN_BRACE + || token->type == CPP_OPEN_PAREN + || token->type == CPP_OPEN_SQUARE) + ++nesting_depth; + else if (token->type == CPP_CLOSE_BRACE + || token->type == CPP_CLOSE_PAREN + || token->type == CPP_CLOSE_SQUARE) + { + if (nesting_depth-- == 0) + break; + } + /* Consume this token. */ + c_parser_consume_token (parser); + } + parser->error = false; +} + +/* Skip tokens until the end of a parameter is found, but do not + consume the comma, semicolon or closing delimiter. */ + +static void +c_parser_skip_to_end_of_parameter (c_parser *parser) +{ + unsigned nesting_depth = 0; + + while (true) + { + c_token *token = c_parser_peek_token (parser); + if ((token->type == CPP_COMMA || token->type == CPP_SEMICOLON) + && !nesting_depth) + break; + /* If we've run out of tokens, stop. */ + if (token->type == CPP_EOF) + return; + if (token->type == CPP_PRAGMA_EOL && parser->in_pragma) + return; + if (token->type == CPP_OPEN_BRACE + || token->type == CPP_OPEN_PAREN + || token->type == CPP_OPEN_SQUARE) + ++nesting_depth; + else if (token->type == CPP_CLOSE_BRACE + || token->type == CPP_CLOSE_PAREN + || token->type == CPP_CLOSE_SQUARE) + { + if (nesting_depth-- == 0) + break; + } + /* Consume this token. */ + c_parser_consume_token (parser); + } + parser->error = false; +} + +/* Expect to be at the end of the pragma directive and consume an + end of line marker. */ + +static void +c_parser_skip_to_pragma_eol (c_parser *parser) +{ + gcc_assert (parser->in_pragma); + parser->in_pragma = false; + + if (!c_parser_require (parser, CPP_PRAGMA_EOL, "expected end of line")) + while (true) + { + c_token *token = c_parser_peek_token (parser); + if (token->type == CPP_EOF) + break; + if (token->type == CPP_PRAGMA_EOL) + { + c_parser_consume_token (parser); + break; + } + c_parser_consume_token (parser); + } + + parser->error = false; +} + +/* Skip tokens until we have consumed an entire block, or until we + have consumed a non-nested ';'. */ + +static void +c_parser_skip_to_end_of_block_or_statement (c_parser *parser) +{ + unsigned nesting_depth = 0; + bool save_error = parser->error; + + while (true) + { + c_token *token; + + /* Peek at the next token. */ + token = c_parser_peek_token (parser); + + switch (token->type) + { + case CPP_EOF: + return; + + case CPP_PRAGMA_EOL: + if (parser->in_pragma) + return; + break; + + case CPP_SEMICOLON: + /* If the next token is a ';', we have reached the + end of the statement. */ + if (!nesting_depth) + { + /* Consume the ';'. */ + c_parser_consume_token (parser); + goto finished; + } + break; + + case CPP_CLOSE_BRACE: + /* If the next token is a non-nested '}', then we have + reached the end of the current block. */ + if (nesting_depth == 0 || --nesting_depth == 0) + { + c_parser_consume_token (parser); + goto finished; + } + break; + + case CPP_OPEN_BRACE: + /* If it the next token is a '{', then we are entering a new + block. Consume the entire block. */ + ++nesting_depth; + break; + + case CPP_PRAGMA: + /* If we see a pragma, consume the whole thing at once. We + have some safeguards against consuming pragmas willy-nilly. + Normally, we'd expect to be here with parser->error set, + which disables these safeguards. But it's possible to get + here for secondary error recovery, after parser->error has + been cleared. */ + c_parser_consume_pragma (parser); + c_parser_skip_to_pragma_eol (parser); + parser->error = save_error; + continue; + + default: + break; + } + + c_parser_consume_token (parser); + } + + finished: + parser->error = false; +} + +/* Save the warning flags which are controlled by __extension__. */ + +static inline int +disable_extension_diagnostics (void) +{ + int ret = (pedantic + | (warn_pointer_arith << 1) + | (warn_traditional << 2) + | (flag_iso << 3)); + pedantic = 0; + warn_pointer_arith = 0; + warn_traditional = 0; + flag_iso = 0; + return ret; +} + +/* Restore the warning flags which are controlled by __extension__. + FLAGS is the return value from disable_extension_diagnostics. */ + +static inline void +restore_extension_diagnostics (int flags) +{ + pedantic = flags & 1; + warn_pointer_arith = (flags >> 1) & 1; + warn_traditional = (flags >> 2) & 1; + flag_iso = (flags >> 3) & 1; +} + +/* Possibly kinds of declarator to parse. */ +typedef enum c_dtr_syn { + /* A normal declarator with an identifier. */ + C_DTR_NORMAL, + /* An abstract declarator (maybe empty). */ + C_DTR_ABSTRACT, + /* A parameter declarator: may be either, but after a type name does + not redeclare a typedef name as an identifier if it can + alternatively be interpreted as a typedef name; see DR#009, + applied in C90 TC1, omitted from C99 and reapplied in C99 TC2 + following DR#249. For example, given a typedef T, "int T" and + "int *T" are valid parameter declarations redeclaring T, while + "int (T)" and "int * (T)" and "int (T[])" and "int (T (int))" are + abstract declarators rather than involving redundant parentheses; + the same applies with attributes inside the parentheses before + "T". */ + C_DTR_PARM +} c_dtr_syn; + +static void c_parser_external_declaration (c_parser *); +static void c_parser_asm_definition (c_parser *); +static void c_parser_declaration_or_fndef (c_parser *, bool, bool, bool, bool); +static void c_parser_declspecs (c_parser *, struct c_declspecs *, bool, bool, + bool); +static struct c_typespec c_parser_enum_specifier (c_parser *); +static struct c_typespec c_parser_struct_or_union_specifier (c_parser *); +static tree c_parser_struct_declaration (c_parser *); +static struct c_typespec c_parser_typeof_specifier (c_parser *); +static struct c_declarator *c_parser_declarator (c_parser *, bool, c_dtr_syn, + bool *); +static struct c_declarator *c_parser_direct_declarator (c_parser *, bool, + c_dtr_syn, bool *); +static struct c_declarator *c_parser_direct_declarator_inner (c_parser *, + bool, + struct c_declarator *); +static struct c_arg_info *c_parser_parms_declarator (c_parser *, bool, tree); +static struct c_arg_info *c_parser_parms_list_declarator (c_parser *, tree); +static struct c_parm *c_parser_parameter_declaration (c_parser *, tree); +static tree c_parser_simple_asm_expr (c_parser *); +static tree c_parser_attributes (c_parser *); +static struct c_type_name *c_parser_type_name (c_parser *); +static struct c_expr c_parser_initializer (c_parser *); +static struct c_expr c_parser_braced_init (c_parser *, tree, bool); +static void c_parser_initelt (c_parser *); +static void c_parser_initval (c_parser *, struct c_expr *); +static tree c_parser_compound_statement (c_parser *); +static void c_parser_compound_statement_nostart (c_parser *); +static void c_parser_label (c_parser *); +static void c_parser_statement (c_parser *); +static void c_parser_statement_after_labels (c_parser *); +static void c_parser_if_statement (c_parser *); +static void c_parser_switch_statement (c_parser *); +static void c_parser_while_statement (c_parser *); +static void c_parser_do_statement (c_parser *); +static void c_parser_for_statement (c_parser *); +static tree c_parser_asm_statement (c_parser *); +static tree c_parser_asm_operands (c_parser *, bool); +static tree c_parser_asm_clobbers (c_parser *); +static struct c_expr c_parser_expr_no_commas (c_parser *, struct c_expr *); +static struct c_expr c_parser_conditional_expression (c_parser *, + struct c_expr *); +static struct c_expr c_parser_binary_expression (c_parser *, struct c_expr *); +static struct c_expr c_parser_cast_expression (c_parser *, struct c_expr *); +static struct c_expr c_parser_unary_expression (c_parser *); +static struct c_expr c_parser_sizeof_expression (c_parser *); +static struct c_expr c_parser_alignof_expression (c_parser *); +static struct c_expr c_parser_postfix_expression (c_parser *); +static struct c_expr c_parser_postfix_expression_after_paren_type (c_parser *, + struct c_type_name *); +static struct c_expr c_parser_postfix_expression_after_primary (c_parser *, + struct c_expr); +static struct c_expr c_parser_expression (c_parser *); +static struct c_expr c_parser_expression_conv (c_parser *); +static tree c_parser_expr_list (c_parser *, bool); +static void c_parser_omp_construct (c_parser *); +static void c_parser_omp_threadprivate (c_parser *); +static void c_parser_omp_barrier (c_parser *); +static void c_parser_omp_flush (c_parser *); + +enum pragma_context { pragma_external, pragma_stmt, pragma_compound }; +static bool c_parser_pragma (c_parser *, enum pragma_context); + +/* These Objective-C parser functions are only ever called when + compiling Objective-C. */ +static void c_parser_objc_class_definition (c_parser *); +static void c_parser_objc_class_instance_variables (c_parser *); +static void c_parser_objc_class_declaration (c_parser *); +static void c_parser_objc_alias_declaration (c_parser *); +static void c_parser_objc_protocol_definition (c_parser *); +static enum tree_code c_parser_objc_method_type (c_parser *); +static void c_parser_objc_method_definition (c_parser *); +static void c_parser_objc_methodprotolist (c_parser *); +static void c_parser_objc_methodproto (c_parser *); +static tree c_parser_objc_method_decl (c_parser *); +static tree c_parser_objc_type_name (c_parser *); +static tree c_parser_objc_protocol_refs (c_parser *); +static void c_parser_objc_try_catch_statement (c_parser *); +static void c_parser_objc_synchronized_statement (c_parser *); +static tree c_parser_objc_selector (c_parser *); +static tree c_parser_objc_selector_arg (c_parser *); +static tree c_parser_objc_receiver (c_parser *); +static tree c_parser_objc_message_args (c_parser *); +static tree c_parser_objc_keywordexpr (c_parser *); + +/* Parse a translation unit (C90 6.7, C99 6.9). + + translation-unit: + external-declarations + + external-declarations: + external-declaration + external-declarations external-declaration + + GNU extensions: + + translation-unit: + empty +*/ + +static void +c_parser_translation_unit (c_parser *parser) +{ + if (c_parser_next_token_is (parser, CPP_EOF)) + { + if (pedantic) + pedwarn ("ISO C forbids an empty source file"); + } + else + { + void *obstack_position = obstack_alloc (&parser_obstack, 0); + do + { + ggc_collect (); + c_parser_external_declaration (parser); + obstack_free (&parser_obstack, obstack_position); + } + while (c_parser_next_token_is_not (parser, CPP_EOF)); + } +} + +/* Parse an external declaration (C90 6.7, C99 6.9). + + external-declaration: + function-definition + declaration + + GNU extensions: + + external-declaration: + asm-definition + ; + __extension__ external-declaration + + Objective-C: + + external-declaration: + objc-class-definition + objc-class-declaration + objc-alias-declaration + objc-protocol-definition + objc-method-definition + @end +*/ + +static void +c_parser_external_declaration (c_parser *parser) +{ + int ext; + switch (c_parser_peek_token (parser)->type) + { + case CPP_KEYWORD: + switch (c_parser_peek_token (parser)->keyword) + { + case RID_EXTENSION: + ext = disable_extension_diagnostics (); + c_parser_consume_token (parser); + c_parser_external_declaration (parser); + restore_extension_diagnostics (ext); + break; + case RID_ASM: + c_parser_asm_definition (parser); + break; + case RID_AT_INTERFACE: + case RID_AT_IMPLEMENTATION: + gcc_assert (c_dialect_objc ()); + c_parser_objc_class_definition (parser); + break; + case RID_AT_CLASS: + gcc_assert (c_dialect_objc ()); + c_parser_objc_class_declaration (parser); + break; + case RID_AT_ALIAS: + gcc_assert (c_dialect_objc ()); + c_parser_objc_alias_declaration (parser); + break; + case RID_AT_PROTOCOL: + gcc_assert (c_dialect_objc ()); + c_parser_objc_protocol_definition (parser); + break; + case RID_AT_END: + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + objc_finish_implementation (); + break; + default: + goto decl_or_fndef; + } + break; + case CPP_SEMICOLON: + if (pedantic) + pedwarn ("ISO C does not allow extra %<;%> outside of a function"); + c_parser_consume_token (parser); + break; + case CPP_PRAGMA: + c_parser_pragma (parser, pragma_external); + break; + case CPP_PLUS: + case CPP_MINUS: + if (c_dialect_objc ()) + { + c_parser_objc_method_definition (parser); + break; + } + /* Else fall through, and yield a syntax error trying to parse + as a declaration or function definition. */ + default: + decl_or_fndef: + /* A declaration or a function definition. We can only tell + which after parsing the declaration specifiers, if any, and + the first declarator. */ + c_parser_declaration_or_fndef (parser, true, true, false, true); + break; + } +} + + +/* Parse a declaration or function definition (C90 6.5, 6.7.1, C99 + 6.7, 6.9.1). If FNDEF_OK is true, a function definition is + accepted; otherwise (old-style parameter declarations) only other + declarations are accepted. If NESTED is true, we are inside a + function or parsing old-style parameter declarations; any functions + encountered are nested functions and declaration specifiers are + required; otherwise we are at top level and functions are normal + functions and declaration specifiers may be optional. If EMPTY_OK + is true, empty declarations are OK (subject to all other + constraints); otherwise (old-style parameter declarations) they are + diagnosed. If START_ATTR_OK is true, the declaration specifiers + may start with attributes; otherwise they may not. + + declaration: + declaration-specifiers init-declarator-list[opt] ; + + function-definition: + declaration-specifiers[opt] declarator declaration-list[opt] + compound-statement + + declaration-list: + declaration + declaration-list declaration + + init-declarator-list: + init-declarator + init-declarator-list , init-declarator + + init-declarator: + declarator simple-asm-expr[opt] attributes[opt] + declarator simple-asm-expr[opt] attributes[opt] = initializer + + GNU extensions: + + nested-function-definition: + declaration-specifiers declarator declaration-list[opt] + compound-statement + + The simple-asm-expr and attributes are GNU extensions. + + This function does not handle __extension__; that is handled in its + callers. ??? Following the old parser, __extension__ may start + external declarations, declarations in functions and declarations + at the start of "for" loops, but not old-style parameter + declarations. + + C99 requires declaration specifiers in a function definition; the + absence is diagnosed through the diagnosis of implicit int. In GNU + C we also allow but diagnose declarations without declaration + specifiers, but only at top level (elsewhere they conflict with + other syntax). + + OpenMP: + + declaration: + threadprivate-directive */ + +static void +c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok, + bool nested, bool start_attr_ok) +{ + struct c_declspecs *specs; + tree prefix_attrs; + tree all_prefix_attrs; + bool diagnosed_no_specs = false; + + specs = build_null_declspecs (); + c_parser_declspecs (parser, specs, true, true, start_attr_ok); + if (parser->error) + { + c_parser_skip_to_end_of_block_or_statement (parser); + return; + } + if (nested && !specs->declspecs_seen_p) + { + c_parser_error (parser, "expected declaration specifiers"); + c_parser_skip_to_end_of_block_or_statement (parser); + return; + } + finish_declspecs (specs); + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + if (empty_ok) + shadow_tag (specs); + else + { + shadow_tag_warned (specs, 1); + pedwarn ("empty declaration"); + } + c_parser_consume_token (parser); + return; + } + pending_xref_error (); + prefix_attrs = specs->attrs; + all_prefix_attrs = prefix_attrs; + specs->attrs = NULL_TREE; + while (true) + { + struct c_declarator *declarator; + bool dummy = false; + tree fnbody; + /* Declaring either one or more declarators (in which case we + should diagnose if there were no declaration specifiers) or a + function definition (in which case the diagnostic for + implicit int suffices). */ + declarator = c_parser_declarator (parser, specs->type_seen_p, + C_DTR_NORMAL, &dummy); + if (declarator == NULL) + { + c_parser_skip_to_end_of_block_or_statement (parser); + return; + } + if (c_parser_next_token_is (parser, CPP_EQ) + || c_parser_next_token_is (parser, CPP_COMMA) + || c_parser_next_token_is (parser, CPP_SEMICOLON) + || c_parser_next_token_is_keyword (parser, RID_ASM) + || c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + { + tree asm_name = NULL_TREE; + tree postfix_attrs = NULL_TREE; + if (!diagnosed_no_specs && !specs->declspecs_seen_p) + { + diagnosed_no_specs = true; + pedwarn ("data definition has no type or storage class"); + } + /* Having seen a data definition, there cannot now be a + function definition. */ + fndef_ok = false; + if (c_parser_next_token_is_keyword (parser, RID_ASM)) + asm_name = c_parser_simple_asm_expr (parser); + if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + postfix_attrs = c_parser_attributes (parser); + if (c_parser_next_token_is (parser, CPP_EQ)) + { + tree d; + struct c_expr init; + c_parser_consume_token (parser); + /* The declaration of the variable is in effect while + its initializer is parsed. */ + d = start_decl (declarator, specs, true, + chainon (postfix_attrs, all_prefix_attrs)); + if (!d) + d = error_mark_node; + start_init (d, asm_name, global_bindings_p ()); + init = c_parser_initializer (parser); + finish_init (); + if (d != error_mark_node) + { + maybe_warn_string_init (TREE_TYPE (d), init); + finish_decl (d, init.value, asm_name); + } + } + else + { + tree d = start_decl (declarator, specs, false, + chainon (postfix_attrs, + all_prefix_attrs)); + if (d) + finish_decl (d, NULL_TREE, asm_name); + } + if (c_parser_next_token_is (parser, CPP_COMMA)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + all_prefix_attrs = chainon (c_parser_attributes (parser), + prefix_attrs); + else + all_prefix_attrs = prefix_attrs; + continue; + } + else if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + c_parser_consume_token (parser); + return; + } + else + { + c_parser_error (parser, "expected %<,%> or %<;%>"); + c_parser_skip_to_end_of_block_or_statement (parser); + return; + } + } + else if (!fndef_ok) + { + c_parser_error (parser, "expected %<=%>, %<,%>, %<;%>, " + "% or %<__attribute__%>"); + c_parser_skip_to_end_of_block_or_statement (parser); + return; + } + /* Function definition (nested or otherwise). */ + if (nested) + { + if (pedantic) + pedwarn ("ISO C forbids nested functions"); + push_function_context (); + } + if (!start_function (specs, declarator, all_prefix_attrs)) + { + /* This can appear in many cases looking nothing like a + function definition, so we don't give a more specific + error suggesting there was one. */ + c_parser_error (parser, "expected %<=%>, %<,%>, %<;%>, % " + "or %<__attribute__%>"); + if (nested) + pop_function_context (); + break; + } + /* Parse old-style parameter declarations. ??? Attributes are + not allowed to start declaration specifiers here because of a + syntax conflict between a function declaration with attribute + suffix and a function definition with an attribute prefix on + first old-style parameter declaration. Following the old + parser, they are not accepted on subsequent old-style + parameter declarations either. However, there is no + ambiguity after the first declaration, nor indeed on the + first as long as we don't allow postfix attributes after a + declarator with a nonempty identifier list in a definition; + and postfix attributes have never been accepted here in + function definitions either. */ + while (c_parser_next_token_is_not (parser, CPP_EOF) + && c_parser_next_token_is_not (parser, CPP_OPEN_BRACE)) + c_parser_declaration_or_fndef (parser, false, false, true, false); + DECL_SOURCE_LOCATION (current_function_decl) + = c_parser_peek_token (parser)->location; + store_parm_decls (); + fnbody = c_parser_compound_statement (parser); + if (nested) + { + tree decl = current_function_decl; + add_stmt (fnbody); + finish_function (); + pop_function_context (); + add_stmt (build_stmt (DECL_EXPR, decl)); + } + else + { + add_stmt (fnbody); + finish_function (); + } + break; + } +} + +/* Parse an asm-definition (asm() outside a function body). This is a + GNU extension. + + asm-definition: + simple-asm-expr ; +*/ + +static void +c_parser_asm_definition (c_parser *parser) +{ + tree asm_str = c_parser_simple_asm_expr (parser); + if (asm_str) + cgraph_add_asm_node (asm_str); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); +} + +/* Parse some declaration specifiers (possibly none) (C90 6.5, C99 + 6.7), adding them to SPECS (which may already include some). + Storage class specifiers are accepted iff SCSPEC_OK; type + specifiers are accepted iff TYPESPEC_OK; attributes are accepted at + the start iff START_ATTR_OK. + + declaration-specifiers: + storage-class-specifier declaration-specifiers[opt] + type-specifier declaration-specifiers[opt] + type-qualifier declaration-specifiers[opt] + function-specifier declaration-specifiers[opt] + + Function specifiers (inline) are from C99, and are currently + handled as storage class specifiers, as is __thread. + + C90 6.5.1, C99 6.7.1: + storage-class-specifier: + typedef + extern + static + auto + register + + C99 6.7.4: + function-specifier: + inline + + C90 6.5.2, C99 6.7.2: + type-specifier: + void + char + short + int + long + float + double + signed + unsigned + _Bool + _Complex + [_Imaginary removed in C99 TC2] + struct-or-union-specifier + enum-specifier + typedef-name + + (_Bool and _Complex are new in C99.) + + C90 6.5.3, C99 6.7.3: + + type-qualifier: + const + restrict + volatile + + (restrict is new in C99.) + + GNU extensions: + + declaration-specifiers: + attributes declaration-specifiers[opt] + + storage-class-specifier: + __thread + + type-specifier: + typeof-specifier + _Decimal32 + _Decimal64 + _Decimal128 + + Objective-C: + + type-specifier: + class-name objc-protocol-refs[opt] + typedef-name objc-protocol-refs + objc-protocol-refs +*/ + +static void +c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, + bool scspec_ok, bool typespec_ok, bool start_attr_ok) +{ + bool attrs_ok = start_attr_ok; + bool seen_type = specs->type_seen_p; + while (c_parser_next_token_is (parser, CPP_NAME) + || c_parser_next_token_is (parser, CPP_KEYWORD) + || (c_dialect_objc () && c_parser_next_token_is (parser, CPP_LESS))) + { + struct c_typespec t; + tree attrs; + if (c_parser_next_token_is (parser, CPP_NAME)) + { + tree value = c_parser_peek_token (parser)->value; + c_id_kind kind = c_parser_peek_token (parser)->id_kind; + /* This finishes the specifiers unless a type name is OK, it + is declared as a type name and a type name hasn't yet + been seen. */ + if (!typespec_ok || seen_type + || (kind != C_ID_TYPENAME && kind != C_ID_CLASSNAME)) + break; + c_parser_consume_token (parser); + seen_type = true; + attrs_ok = true; + if (kind == C_ID_TYPENAME + && (!c_dialect_objc () + || c_parser_next_token_is_not (parser, CPP_LESS))) + { + t.kind = ctsk_typedef; + /* For a typedef name, record the meaning, not the name. + In case of 'foo foo, bar;'. */ + t.spec = lookup_name (value); + } + else + { + tree proto = NULL_TREE; + gcc_assert (c_dialect_objc ()); + t.kind = ctsk_objc; + if (c_parser_next_token_is (parser, CPP_LESS)) + proto = c_parser_objc_protocol_refs (parser); + t.spec = objc_get_protocol_qualified_type (value, proto); + } + declspecs_add_type (specs, t); + continue; + } + if (c_parser_next_token_is (parser, CPP_LESS)) + { + /* Make "" equivalent to "id " - + nisse@lysator.liu.se. */ + tree proto; + gcc_assert (c_dialect_objc ()); + if (!typespec_ok || seen_type) + break; + proto = c_parser_objc_protocol_refs (parser); + t.kind = ctsk_objc; + t.spec = objc_get_protocol_qualified_type (NULL_TREE, proto); + declspecs_add_type (specs, t); + continue; + } + gcc_assert (c_parser_next_token_is (parser, CPP_KEYWORD)); + switch (c_parser_peek_token (parser)->keyword) + { + case RID_STATIC: + case RID_EXTERN: + case RID_REGISTER: + case RID_TYPEDEF: + case RID_INLINE: + case RID_AUTO: + case RID_THREAD: + if (!scspec_ok) + goto out; + attrs_ok = true; + /* TODO: Distinguish between function specifiers (inline) + and storage class specifiers, either here or in + declspecs_add_scspec. */ + declspecs_add_scspec (specs, c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + break; + case RID_UNSIGNED: + case RID_LONG: + case RID_SHORT: + case RID_SIGNED: + case RID_COMPLEX: + case RID_INT: + case RID_CHAR: + case RID_FLOAT: + case RID_DOUBLE: + case RID_VOID: + case RID_DFLOAT32: + case RID_DFLOAT64: + case RID_DFLOAT128: + case RID_BOOL: + if (!typespec_ok) + goto out; + attrs_ok = true; + seen_type = true; + OBJC_NEED_RAW_IDENTIFIER (1); + t.kind = ctsk_resword; + t.spec = c_parser_peek_token (parser)->value; + declspecs_add_type (specs, t); + c_parser_consume_token (parser); + break; + case RID_ENUM: + if (!typespec_ok) + goto out; + attrs_ok = true; + seen_type = true; + t = c_parser_enum_specifier (parser); + declspecs_add_type (specs, t); + break; + case RID_STRUCT: + case RID_UNION: + if (!typespec_ok) + goto out; + attrs_ok = true; + seen_type = true; + t = c_parser_struct_or_union_specifier (parser); + declspecs_add_type (specs, t); + break; + case RID_TYPEOF: + /* ??? The old parser rejected typeof after other type + specifiers, but is a syntax error the best way of + handling this? */ + if (!typespec_ok || seen_type) + goto out; + attrs_ok = true; + seen_type = true; + t = c_parser_typeof_specifier (parser); + declspecs_add_type (specs, t); + break; + case RID_CONST: + case RID_VOLATILE: + case RID_RESTRICT: + attrs_ok = true; + declspecs_add_qual (specs, c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + break; + case RID_ATTRIBUTE: + if (!attrs_ok) + goto out; + attrs = c_parser_attributes (parser); + declspecs_add_attrs (specs, attrs); + break; + default: + goto out; + } + } + out: ; +} + +/* Parse an enum specifier (C90 6.5.2.2, C99 6.7.2.2). + + enum-specifier: + enum attributes[opt] identifier[opt] { enumerator-list } attributes[opt] + enum attributes[opt] identifier[opt] { enumerator-list , } attributes[opt] + enum attributes[opt] identifier + + The form with trailing comma is new in C99. The forms with + attributes are GNU extensions. In GNU C, we accept any expression + without commas in the syntax (assignment expressions, not just + conditional expressions); assignment expressions will be diagnosed + as non-constant. + + enumerator-list: + enumerator + enumerator-list , enumerator + + enumerator: + enumeration-constant + enumeration-constant = constant-expression +*/ + +static struct c_typespec +c_parser_enum_specifier (c_parser *parser) +{ + struct c_typespec ret; + tree attrs; + tree ident = NULL_TREE; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_ENUM)); + c_parser_consume_token (parser); + attrs = c_parser_attributes (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + ident = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + { + /* Parse an enum definition. */ + tree type = start_enum (ident); + tree postfix_attrs; + /* We chain the enumerators in reverse order, then put them in + forward order at the end. */ + tree values = NULL_TREE; + c_parser_consume_token (parser); + while (true) + { + tree enum_id; + tree enum_value; + tree enum_decl; + bool seen_comma; + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, NULL); + values = error_mark_node; + break; + } + enum_id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_EQ)) + { + c_parser_consume_token (parser); + enum_value = c_parser_expr_no_commas (parser, NULL).value; + } + else + enum_value = NULL_TREE; + enum_decl = build_enumerator (enum_id, enum_value); + TREE_CHAIN (enum_decl) = values; + values = enum_decl; + seen_comma = false; + if (c_parser_next_token_is (parser, CPP_COMMA)) + { + seen_comma = true; + c_parser_consume_token (parser); + } + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + if (seen_comma && pedantic && !flag_isoc99) + pedwarn ("comma at end of enumerator list"); + c_parser_consume_token (parser); + break; + } + if (!seen_comma) + { + c_parser_error (parser, "expected %<,%> or %<}%>"); + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, NULL); + values = error_mark_node; + break; + } + } + postfix_attrs = c_parser_attributes (parser); + ret.spec = finish_enum (type, nreverse (values), + chainon (attrs, postfix_attrs)); + ret.kind = ctsk_tagdef; + return ret; + } + else if (!ident) + { + c_parser_error (parser, "expected %<{%>"); + ret.spec = error_mark_node; + ret.kind = ctsk_tagref; + return ret; + } + ret = parser_xref_tag (ENUMERAL_TYPE, ident); + /* In ISO C, enumerated types can be referred to only if already + defined. */ + if (pedantic && !COMPLETE_TYPE_P (ret.spec)) + pedwarn ("ISO C forbids forward references to % types"); + return ret; +} + +/* Parse a struct or union specifier (C90 6.5.2.1, C99 6.7.2.1). + + struct-or-union-specifier: + struct-or-union attributes[opt] identifier[opt] + { struct-contents } attributes[opt] + struct-or-union attributes[opt] identifier + + struct-contents: + struct-declaration-list + + struct-declaration-list: + struct-declaration ; + struct-declaration-list struct-declaration ; + + GNU extensions: + + struct-contents: + empty + struct-declaration + struct-declaration-list struct-declaration + + struct-declaration-list: + struct-declaration-list ; + ; + + (Note that in the syntax here, unlike that in ISO C, the semicolons + are included here rather than in struct-declaration, in order to + describe the syntax with extra semicolons and missing semicolon at + end.) + + Objective-C: + + struct-declaration-list: + @defs ( class-name ) + + (Note this does not include a trailing semicolon, but can be + followed by further declarations, and gets a pedwarn-if-pedantic + when followed by a semicolon.) */ + +static struct c_typespec +c_parser_struct_or_union_specifier (c_parser *parser) +{ + struct c_typespec ret; + tree attrs; + tree ident = NULL_TREE; + enum tree_code code; + switch (c_parser_peek_token (parser)->keyword) + { + case RID_STRUCT: + code = RECORD_TYPE; + break; + case RID_UNION: + code = UNION_TYPE; + break; + default: + gcc_unreachable (); + } + c_parser_consume_token (parser); + attrs = c_parser_attributes (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + ident = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + { + /* Parse a struct or union definition. Start the scope of the + tag before parsing components. */ + tree type = start_struct (code, ident); + tree postfix_attrs; + /* We chain the components in reverse order, then put them in + forward order at the end. Each struct-declaration may + declare multiple components (comma-separated), so we must use + chainon to join them, although when parsing each + struct-declaration we can use TREE_CHAIN directly. + + The theory behind all this is that there will be more + semicolon separated fields than comma separated fields, and + so we'll be minimizing the number of node traversals required + by chainon. */ + tree contents = NULL_TREE; + c_parser_consume_token (parser); + /* Handle the Objective-C @defs construct, + e.g. foo(sizeof(struct{ @defs(ClassName) }));. */ + if (c_parser_next_token_is_keyword (parser, RID_AT_DEFS)) + { + tree name; + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + goto end_at_defs; + if (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_token (parser)->id_kind == C_ID_CLASSNAME) + { + name = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + else + { + c_parser_error (parser, "expected class name"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + goto end_at_defs; + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + contents = nreverse (objc_get_class_ivars (name)); + } + end_at_defs: + /* Parse the struct-declarations and semicolons. Problems with + semicolons are diagnosed here; empty structures are diagnosed + elsewhere. */ + while (true) + { + tree decls; + /* Parse any stray semicolon. */ + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + if (pedantic) + pedwarn ("extra semicolon in struct or union specified"); + c_parser_consume_token (parser); + continue; + } + /* Stop if at the end of the struct or union contents. */ + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + c_parser_consume_token (parser); + break; + } + /* Accept #pragmas at struct scope. */ + if (c_parser_next_token_is (parser, CPP_PRAGMA)) + { + c_parser_pragma (parser, pragma_external); + continue; + } + /* Parse some comma-separated declarations, but not the + trailing semicolon if any. */ + decls = c_parser_struct_declaration (parser); + contents = chainon (decls, contents); + /* If no semicolon follows, either we have a parse error or + are at the end of the struct or union and should + pedwarn. */ + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + c_parser_consume_token (parser); + else + { + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + pedwarn ("no semicolon at end of struct or union"); + else + { + c_parser_error (parser, "expected %<;%>"); + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, NULL); + break; + } + } + } + postfix_attrs = c_parser_attributes (parser); + ret.spec = finish_struct (type, nreverse (contents), + chainon (attrs, postfix_attrs)); + ret.kind = ctsk_tagdef; + return ret; + } + else if (!ident) + { + c_parser_error (parser, "expected %<{%>"); + ret.spec = error_mark_node; + ret.kind = ctsk_tagref; + return ret; + } + ret = parser_xref_tag (code, ident); + return ret; +} + +/* Parse a struct-declaration (C90 6.5.2.1, C99 6.7.2.1), *without* + the trailing semicolon. + + struct-declaration: + specifier-qualifier-list struct-declarator-list + + specifier-qualifier-list: + type-specifier specifier-qualifier-list[opt] + type-qualifier specifier-qualifier-list[opt] + attributes specifier-qualifier-list[opt] + + struct-declarator-list: + struct-declarator + struct-declarator-list , attributes[opt] struct-declarator + + struct-declarator: + declarator attributes[opt] + declarator[opt] : constant-expression attributes[opt] + + GNU extensions: + + struct-declaration: + __extension__ struct-declaration + specifier-qualifier-list + + Unlike the ISO C syntax, semicolons are handled elsewhere. The use + of attributes where shown is a GNU extension. In GNU C, we accept + any expression without commas in the syntax (assignment + expressions, not just conditional expressions); assignment + expressions will be diagnosed as non-constant. */ + +static tree +c_parser_struct_declaration (c_parser *parser) +{ + struct c_declspecs *specs; + tree prefix_attrs; + tree all_prefix_attrs; + tree decls; + if (c_parser_next_token_is_keyword (parser, RID_EXTENSION)) + { + int ext; + tree decl; + ext = disable_extension_diagnostics (); + c_parser_consume_token (parser); + decl = c_parser_struct_declaration (parser); + restore_extension_diagnostics (ext); + return decl; + } + specs = build_null_declspecs (); + c_parser_declspecs (parser, specs, false, true, true); + if (parser->error) + return NULL_TREE; + if (!specs->declspecs_seen_p) + { + c_parser_error (parser, "expected specifier-qualifier-list"); + return NULL_TREE; + } + finish_declspecs (specs); + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + tree ret; + if (!specs->type_seen_p) + { + if (pedantic) + pedwarn ("ISO C forbids member declarations with no members"); + shadow_tag_warned (specs, pedantic); + ret = NULL_TREE; + } + else + { + /* Support for unnamed structs or unions as members of + structs or unions (which is [a] useful and [b] supports + MS P-SDK). */ + ret = grokfield (build_id_declarator (NULL_TREE), specs, NULL_TREE); + } + return ret; + } + pending_xref_error (); + prefix_attrs = specs->attrs; + all_prefix_attrs = prefix_attrs; + specs->attrs = NULL_TREE; + decls = NULL_TREE; + while (true) + { + /* Declaring one or more declarators or un-named bit-fields. */ + struct c_declarator *declarator; + bool dummy = false; + if (c_parser_next_token_is (parser, CPP_COLON)) + declarator = build_id_declarator (NULL_TREE); + else + declarator = c_parser_declarator (parser, specs->type_seen_p, + C_DTR_NORMAL, &dummy); + if (declarator == NULL) + { + c_parser_skip_to_end_of_block_or_statement (parser); + break; + } + if (c_parser_next_token_is (parser, CPP_COLON) + || c_parser_next_token_is (parser, CPP_COMMA) + || c_parser_next_token_is (parser, CPP_SEMICOLON) + || c_parser_next_token_is (parser, CPP_CLOSE_BRACE) + || c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + { + tree postfix_attrs = NULL_TREE; + tree width = NULL_TREE; + tree d; + if (c_parser_next_token_is (parser, CPP_COLON)) + { + c_parser_consume_token (parser); + width = c_parser_expr_no_commas (parser, NULL).value; + } + if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + postfix_attrs = c_parser_attributes (parser); + d = grokfield (declarator, specs, width); + decl_attributes (&d, chainon (postfix_attrs, + all_prefix_attrs), 0); + TREE_CHAIN (d) = decls; + decls = d; + if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + all_prefix_attrs = chainon (c_parser_attributes (parser), + prefix_attrs); + else + all_prefix_attrs = prefix_attrs; + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else if (c_parser_next_token_is (parser, CPP_SEMICOLON) + || c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + /* Semicolon consumed in caller. */ + break; + } + else + { + c_parser_error (parser, "expected %<,%>, %<;%> or %<}%>"); + break; + } + } + else + { + c_parser_error (parser, + "expected %<:%>, %<,%>, %<;%>, %<}%> or " + "%<__attribute__%>"); + break; + } + } + return decls; +} + +/* Parse a typeof specifier (a GNU extension). + + typeof-specifier: + typeof ( expression ) + typeof ( type-name ) +*/ + +static struct c_typespec +c_parser_typeof_specifier (c_parser *parser) +{ + struct c_typespec ret; + ret.kind = ctsk_typeof; + ret.spec = error_mark_node; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_TYPEOF)); + c_parser_consume_token (parser); + skip_evaluation++; + in_typeof++; + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + skip_evaluation--; + in_typeof--; + return ret; + } + if (c_parser_next_token_starts_typename (parser)) + { + struct c_type_name *type = c_parser_type_name (parser); + skip_evaluation--; + in_typeof--; + if (type != NULL) + { + ret.spec = groktypename (type); + pop_maybe_used (variably_modified_type_p (ret.spec, NULL_TREE)); + } + } + else + { + bool was_vm; + struct c_expr expr = c_parser_expression (parser); + skip_evaluation--; + in_typeof--; + if (TREE_CODE (expr.value) == COMPONENT_REF + && DECL_C_BIT_FIELD (TREE_OPERAND (expr.value, 1))) + error ("% applied to a bit-field"); + ret.spec = TREE_TYPE (expr.value); + was_vm = variably_modified_type_p (ret.spec, NULL_TREE); + /* This should be returned with the type so that when the type + is evaluated, this can be evaluated. For now, we avoid + evaluation when the context might. */ + if (!skip_evaluation && was_vm) + { + tree e = expr.value; + + /* If the expression is not of a type to which we cannot assign a line + number, wrap the thing in a no-op NOP_EXPR. */ + if (DECL_P (e) || CONSTANT_CLASS_P (e)) + e = build1 (NOP_EXPR, void_type_node, e); + + if (EXPR_P (e)) + SET_EXPR_LOCATION (e, input_location); + + add_stmt (e); + } + pop_maybe_used (was_vm); + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + return ret; +} + +/* Parse a declarator, possibly an abstract declarator (C90 6.5.4, + 6.5.5, C99 6.7.5, 6.7.6). If TYPE_SEEN_P then a typedef name may + be redeclared; otherwise it may not. KIND indicates which kind of + declarator is wanted. Returns a valid declarator except in the + case of a syntax error in which case NULL is returned. *SEEN_ID is + set to true if an identifier being declared is seen; this is used + to diagnose bad forms of abstract array declarators and to + determine whether an identifier list is syntactically permitted. + + declarator: + pointer[opt] direct-declarator + + direct-declarator: + identifier + ( attributes[opt] declarator ) + direct-declarator array-declarator + direct-declarator ( parameter-type-list ) + direct-declarator ( identifier-list[opt] ) + + pointer: + * type-qualifier-list[opt] + * type-qualifier-list[opt] pointer + + type-qualifier-list: + type-qualifier + attributes + type-qualifier-list type-qualifier + type-qualifier-list attributes + + parameter-type-list: + parameter-list + parameter-list , ... + + parameter-list: + parameter-declaration + parameter-list , parameter-declaration + + parameter-declaration: + declaration-specifiers declarator attributes[opt] + declaration-specifiers abstract-declarator[opt] attributes[opt] + + identifier-list: + identifier + identifier-list , identifier + + abstract-declarator: + pointer + pointer[opt] direct-abstract-declarator + + direct-abstract-declarator: + ( attributes[opt] abstract-declarator ) + direct-abstract-declarator[opt] array-declarator + direct-abstract-declarator[opt] ( parameter-type-list[opt] ) + + GNU extensions: + + direct-declarator: + direct-declarator ( parameter-forward-declarations + parameter-type-list[opt] ) + + direct-abstract-declarator: + direct-abstract-declarator[opt] ( parameter-forward-declarations + parameter-type-list[opt] ) + + parameter-forward-declarations: + parameter-list ; + parameter-forward-declarations parameter-list ; + + The uses of attributes shown above are GNU extensions. + + Some forms of array declarator are not included in C99 in the + syntax for abstract declarators; these are disallowed elsewhere. + This may be a defect (DR#289). + + This function also accepts an omitted abstract declarator as being + an abstract declarator, although not part of the formal syntax. */ + +static struct c_declarator * +c_parser_declarator (c_parser *parser, bool type_seen_p, c_dtr_syn kind, + bool *seen_id) +{ + /* Parse any initial pointer part. */ + if (c_parser_next_token_is (parser, CPP_MULT)) + { + struct c_declspecs *quals_attrs = build_null_declspecs (); + struct c_declarator *inner; + c_parser_consume_token (parser); + c_parser_declspecs (parser, quals_attrs, false, false, true); + inner = c_parser_declarator (parser, type_seen_p, kind, seen_id); + if (inner == NULL) + return NULL; + else + return make_pointer_declarator (quals_attrs, inner); + } + /* Now we have a direct declarator, direct abstract declarator or + nothing (which counts as a direct abstract declarator here). */ + return c_parser_direct_declarator (parser, type_seen_p, kind, seen_id); +} + +/* Parse a direct declarator or direct abstract declarator; arguments + as c_parser_declarator. */ + +static struct c_declarator * +c_parser_direct_declarator (c_parser *parser, bool type_seen_p, c_dtr_syn kind, + bool *seen_id) +{ + /* The direct declarator must start with an identifier (possibly + omitted) or a parenthesized declarator (possibly abstract). In + an ordinary declarator, initial parentheses must start a + parenthesized declarator. In an abstract declarator or parameter + declarator, they could start a parenthesized declarator or a + parameter list. To tell which, the open parenthesis and any + following attributes must be read. If a declaration specifier + follows, then it is a parameter list; if the specifier is a + typedef name, there might be an ambiguity about redeclaring it, + which is resolved in the direction of treating it as a typedef + name. If a close parenthesis follows, it is also an empty + parameter list, as the syntax does not permit empty abstract + declarators. Otherwise, it is a parenthesized declarator (in + which case the analysis may be repeated inside it, recursively). + + ??? There is an ambiguity in a parameter declaration "int + (__attribute__((foo)) x)", where x is not a typedef name: it + could be an abstract declarator for a function, or declare x with + parentheses. The proper resolution of this ambiguity needs + documenting. At present we follow an accident of the old + parser's implementation, whereby the first parameter must have + some declaration specifiers other than just attributes. Thus as + a parameter declaration it is treated as a parenthesized + parameter named x, and as an abstract declarator it is + rejected. + + ??? Also following the old parser, attributes inside an empty + parameter list are ignored, making it a list not yielding a + prototype, rather than giving an error or making it have one + parameter with implicit type int. + + ??? Also following the old parser, typedef names may be + redeclared in declarators, but not Objective-C class names. */ + + if (kind != C_DTR_ABSTRACT + && c_parser_next_token_is (parser, CPP_NAME) + && ((type_seen_p + && c_parser_peek_token (parser)->id_kind == C_ID_TYPENAME) + || c_parser_peek_token (parser)->id_kind == C_ID_ID)) + { + struct c_declarator *inner + = build_id_declarator (c_parser_peek_token (parser)->value); + *seen_id = true; + inner->id_loc = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + return c_parser_direct_declarator_inner (parser, *seen_id, inner); + } + + if (kind != C_DTR_NORMAL + && c_parser_next_token_is (parser, CPP_OPEN_SQUARE)) + { + struct c_declarator *inner = build_id_declarator (NULL_TREE); + return c_parser_direct_declarator_inner (parser, *seen_id, inner); + } + + /* Either we are at the end of an abstract declarator, or we have + parentheses. */ + + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + tree attrs; + struct c_declarator *inner; + c_parser_consume_token (parser); + attrs = c_parser_attributes (parser); + if (kind != C_DTR_NORMAL + && (c_parser_next_token_starts_declspecs (parser) + || c_parser_next_token_is (parser, CPP_CLOSE_PAREN))) + { + struct c_arg_info *args + = c_parser_parms_declarator (parser, kind == C_DTR_NORMAL, + attrs); + if (args == NULL) + return NULL; + else + { + inner + = build_function_declarator (args, + build_id_declarator (NULL_TREE)); + return c_parser_direct_declarator_inner (parser, *seen_id, + inner); + } + } + /* A parenthesized declarator. */ + inner = c_parser_declarator (parser, type_seen_p, kind, seen_id); + if (inner != NULL && attrs != NULL) + inner = build_attrs_declarator (attrs, inner); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + c_parser_consume_token (parser); + if (inner == NULL) + return NULL; + else + return c_parser_direct_declarator_inner (parser, *seen_id, inner); + } + else + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return NULL; + } + } + else + { + if (kind == C_DTR_NORMAL) + { + c_parser_error (parser, "expected identifier or %<(%>"); + return NULL; + } + else + return build_id_declarator (NULL_TREE); + } +} + +/* Parse part of a direct declarator or direct abstract declarator, + given that some (in INNER) has already been parsed; ID_PRESENT is + true if an identifier is present, false for an abstract + declarator. */ + +static struct c_declarator * +c_parser_direct_declarator_inner (c_parser *parser, bool id_present, + struct c_declarator *inner) +{ + /* Parse a sequence of array declarators and parameter lists. */ + if (c_parser_next_token_is (parser, CPP_OPEN_SQUARE)) + { + struct c_declarator *declarator; + struct c_declspecs *quals_attrs = build_null_declspecs (); + bool static_seen; + bool star_seen; + tree dimen; + c_parser_consume_token (parser); + c_parser_declspecs (parser, quals_attrs, false, false, true); + static_seen = c_parser_next_token_is_keyword (parser, RID_STATIC); + if (static_seen) + c_parser_consume_token (parser); + if (static_seen && !quals_attrs->declspecs_seen_p) + c_parser_declspecs (parser, quals_attrs, false, false, true); + if (!quals_attrs->declspecs_seen_p) + quals_attrs = NULL; + /* If "static" is present, there must be an array dimension. + Otherwise, there may be a dimension, "*", or no + dimension. */ + if (static_seen) + { + star_seen = false; + dimen = c_parser_expr_no_commas (parser, NULL).value; + } + else + { + if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE)) + { + dimen = NULL_TREE; + star_seen = false; + } + else if (c_parser_next_token_is (parser, CPP_MULT)) + { + if (c_parser_peek_2nd_token (parser)->type == CPP_CLOSE_SQUARE) + { + dimen = NULL_TREE; + star_seen = true; + c_parser_consume_token (parser); + } + else + { + star_seen = false; + dimen = c_parser_expr_no_commas (parser, NULL).value; + } + } + else + { + star_seen = false; + dimen = c_parser_expr_no_commas (parser, NULL).value; + } + } + if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE)) + c_parser_consume_token (parser); + else + { + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + return NULL; + } + declarator = build_array_declarator (dimen, quals_attrs, static_seen, + star_seen); + if (declarator == NULL) + return NULL; + inner = set_array_declarator_inner (declarator, inner, !id_present); + return c_parser_direct_declarator_inner (parser, id_present, inner); + } + else if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + tree attrs; + struct c_arg_info *args; + c_parser_consume_token (parser); + attrs = c_parser_attributes (parser); + args = c_parser_parms_declarator (parser, id_present, attrs); + if (args == NULL) + return NULL; + else + { + inner = build_function_declarator (args, inner); + return c_parser_direct_declarator_inner (parser, id_present, inner); + } + } + return inner; +} + +/* Parse a parameter list or identifier list, including the closing + parenthesis but not the opening one. ATTRS are the attributes at + the start of the list. ID_LIST_OK is true if an identifier list is + acceptable; such a list must not have attributes at the start. */ + +static struct c_arg_info * +c_parser_parms_declarator (c_parser *parser, bool id_list_ok, tree attrs) +{ + push_scope (); + declare_parm_level (); + /* If the list starts with an identifier, it is an identifier list. + Otherwise, it is either a prototype list or an empty list. */ + if (id_list_ok + && !attrs + && c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_token (parser)->id_kind == C_ID_ID) + { + tree list = NULL_TREE, *nextp = &list; + while (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_token (parser)->id_kind == C_ID_ID) + { + *nextp = build_tree_list (NULL_TREE, + c_parser_peek_token (parser)->value); + nextp = & TREE_CHAIN (*nextp); + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_COMMA)) + break; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + c_parser_error (parser, "expected identifier"); + break; + } + } + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + struct c_arg_info *ret = XOBNEW (&parser_obstack, struct c_arg_info); + ret->parms = 0; + ret->tags = 0; + ret->types = list; + ret->others = 0; + ret->pending_sizes = 0; + ret->had_vla_unspec = 0; + c_parser_consume_token (parser); + pop_scope (); + return ret; + } + else + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + pop_scope (); + return NULL; + } + } + else + { + struct c_arg_info *ret = c_parser_parms_list_declarator (parser, attrs); + pop_scope (); + return ret; + } +} + +/* Parse a parameter list (possibly empty), including the closing + parenthesis but not the opening one. ATTRS are the attributes at + the start of the list. */ + +static struct c_arg_info * +c_parser_parms_list_declarator (c_parser *parser, tree attrs) +{ + bool good_parm = false; + /* ??? Following the old parser, forward parameter declarations may + use abstract declarators, and if no real parameter declarations + follow the forward declarations then this is not diagnosed. Also + note as above that attributes are ignored as the only contents of + the parentheses, or as the only contents after forward + declarations. */ + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + struct c_arg_info *ret = XOBNEW (&parser_obstack, struct c_arg_info); + ret->parms = 0; + ret->tags = 0; + ret->types = 0; + ret->others = 0; + ret->pending_sizes = 0; + ret->had_vla_unspec = 0; + c_parser_consume_token (parser); + return ret; + } + if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) + { + struct c_arg_info *ret = XOBNEW (&parser_obstack, struct c_arg_info); + ret->parms = 0; + ret->tags = 0; + ret->others = 0; + ret->pending_sizes = 0; + ret->had_vla_unspec = 0; + /* Suppress -Wold-style-definition for this case. */ + ret->types = error_mark_node; + error ("ISO C requires a named argument before %<...%>"); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + c_parser_consume_token (parser); + return ret; + } + else + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return NULL; + } + } + /* Nonempty list of parameters, either terminated with semicolon + (forward declarations; recurse) or with close parenthesis (normal + function) or with ", ... )" (variadic function). */ + while (true) + { + /* Parse a parameter. */ + struct c_parm *parm = c_parser_parameter_declaration (parser, attrs); + attrs = NULL_TREE; + if (parm != NULL) + { + good_parm = true; + push_parm_decl (parm); + } + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + tree new_attrs; + c_parser_consume_token (parser); + mark_forward_parm_decls (); + new_attrs = c_parser_attributes (parser); + return c_parser_parms_list_declarator (parser, new_attrs); + } + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + c_parser_consume_token (parser); + if (good_parm) + return get_parm_info (false); + else + { + struct c_arg_info *ret + = XOBNEW (&parser_obstack, struct c_arg_info); + ret->parms = 0; + ret->tags = 0; + ret->types = 0; + ret->others = 0; + ret->pending_sizes = 0; + ret->had_vla_unspec = 0; + return ret; + } + } + if (!c_parser_require (parser, CPP_COMMA, + "expected %<;%>, %<,%> or %<)%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL; + } + if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + c_parser_consume_token (parser); + if (good_parm) + return get_parm_info (true); + else + { + struct c_arg_info *ret + = XOBNEW (&parser_obstack, struct c_arg_info); + ret->parms = 0; + ret->tags = 0; + ret->types = 0; + ret->others = 0; + ret->pending_sizes = 0; + ret->had_vla_unspec = 0; + return ret; + } + } + else + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return NULL; + } + } + } +} + +/* Parse a parameter declaration. ATTRS are the attributes at the + start of the declaration if it is the first parameter. */ + +static struct c_parm * +c_parser_parameter_declaration (c_parser *parser, tree attrs) +{ + struct c_declspecs *specs; + struct c_declarator *declarator; + tree prefix_attrs; + tree postfix_attrs = NULL_TREE; + bool dummy = false; + if (!c_parser_next_token_starts_declspecs (parser)) + { + /* ??? In some Objective-C cases '...' isn't applicable so there + should be a different message. */ + c_parser_error (parser, + "expected declaration specifiers or %<...%>"); + c_parser_skip_to_end_of_parameter (parser); + return NULL; + } + specs = build_null_declspecs (); + if (attrs) + { + declspecs_add_attrs (specs, attrs); + attrs = NULL_TREE; + } + c_parser_declspecs (parser, specs, true, true, true); + finish_declspecs (specs); + pending_xref_error (); + prefix_attrs = specs->attrs; + specs->attrs = NULL_TREE; + declarator = c_parser_declarator (parser, specs->type_seen_p, + C_DTR_PARM, &dummy); + if (declarator == NULL) + { + c_parser_skip_until_found (parser, CPP_COMMA, NULL); + return NULL; + } + if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + postfix_attrs = c_parser_attributes (parser); + return build_c_parm (specs, chainon (postfix_attrs, prefix_attrs), + declarator); +} + +/* Parse a string literal in an asm expression. It should not be + translated, and wide string literals are an error although + permitted by the syntax. This is a GNU extension. + + asm-string-literal: + string-literal + + ??? At present, following the old parser, the caller needs to have + set c_lex_string_translate to 0. It would be better to follow the + C++ parser rather than using the c_lex_string_translate kludge. */ + +static tree +c_parser_asm_string_literal (c_parser *parser) +{ + tree str; + if (c_parser_next_token_is (parser, CPP_STRING)) + { + str = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + else if (c_parser_next_token_is (parser, CPP_WSTRING)) + { + error ("wide string literal in %"); + str = build_string (1, ""); + c_parser_consume_token (parser); + } + else + { + c_parser_error (parser, "expected string literal"); + str = NULL_TREE; + } + return str; +} + +/* Parse a simple asm expression. This is used in restricted + contexts, where a full expression with inputs and outputs does not + make sense. This is a GNU extension. + + simple-asm-expr: + asm ( asm-string-literal ) +*/ + +static tree +c_parser_simple_asm_expr (c_parser *parser) +{ + tree str; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_ASM)); + /* ??? Follow the C++ parser rather than using the + c_lex_string_translate kludge. */ + c_lex_string_translate = 0; + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + c_lex_string_translate = 1; + return NULL_TREE; + } + str = c_parser_asm_string_literal (parser); + c_lex_string_translate = 1; + if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + return str; +} + +/* Parse (possibly empty) attributes. This is a GNU extension. + + attributes: + empty + attributes attribute + + attribute: + __attribute__ ( ( attribute-list ) ) + + attribute-list: + attrib + attribute_list , attrib + + attrib: + empty + any-word + any-word ( identifier ) + any-word ( identifier , nonempty-expr-list ) + any-word ( expr-list ) + + where the "identifier" must not be declared as a type, and + "any-word" may be any identifier (including one declared as a + type), a reserved word storage class specifier, type specifier or + type qualifier. ??? This still leaves out most reserved keywords + (following the old parser), shouldn't we include them, and why not + allow identifiers declared as types to start the arguments? */ + +static tree +c_parser_attributes (c_parser *parser) +{ + tree attrs = NULL_TREE; + while (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) + { + /* ??? Follow the C++ parser rather than using the + c_lex_string_translate kludge. */ + c_lex_string_translate = 0; + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + c_lex_string_translate = 1; + return attrs; + } + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return attrs; + } + /* Parse the attribute list. */ + while (c_parser_next_token_is (parser, CPP_COMMA) + || c_parser_next_token_is (parser, CPP_NAME) + || c_parser_next_token_is (parser, CPP_KEYWORD)) + { + tree attr, attr_name, attr_args; + if (c_parser_next_token_is (parser, CPP_COMMA)) + { + c_parser_consume_token (parser); + continue; + } + if (c_parser_next_token_is (parser, CPP_KEYWORD)) + { + /* ??? See comment above about what keywords are + accepted here. */ + bool ok; + switch (c_parser_peek_token (parser)->keyword) + { + case RID_STATIC: + case RID_UNSIGNED: + case RID_LONG: + case RID_CONST: + case RID_EXTERN: + case RID_REGISTER: + case RID_TYPEDEF: + case RID_SHORT: + case RID_INLINE: + case RID_VOLATILE: + case RID_SIGNED: + case RID_AUTO: + case RID_RESTRICT: + case RID_COMPLEX: + case RID_THREAD: + case RID_INT: + case RID_CHAR: + case RID_FLOAT: + case RID_DOUBLE: + case RID_VOID: + case RID_DFLOAT32: + case RID_DFLOAT64: + case RID_DFLOAT128: + case RID_BOOL: + ok = true; + break; + default: + ok = false; + break; + } + if (!ok) + break; + } + attr_name = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN)) + { + attr = build_tree_list (attr_name, NULL_TREE); + attrs = chainon (attrs, attr); + continue; + } + c_parser_consume_token (parser); + /* Parse the attribute contents. If they start with an + identifier which is followed by a comma or close + parenthesis, then the arguments start with that + identifier; otherwise they are an expression list. */ + if (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_token (parser)->id_kind == C_ID_ID + && ((c_parser_peek_2nd_token (parser)->type == CPP_COMMA) + || (c_parser_peek_2nd_token (parser)->type + == CPP_CLOSE_PAREN))) + { + tree arg1 = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + attr_args = build_tree_list (NULL_TREE, arg1); + else + { + c_parser_consume_token (parser); + attr_args = tree_cons (NULL_TREE, arg1, + c_parser_expr_list (parser, false)); + } + } + else + { + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + attr_args = NULL_TREE; + else + attr_args = c_parser_expr_list (parser, false); + } + attr = build_tree_list (attr_name, attr_args); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + c_parser_consume_token (parser); + else + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return attrs; + } + attrs = chainon (attrs, attr); + } + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + c_parser_consume_token (parser); + else + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return attrs; + } + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + c_parser_consume_token (parser); + else + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + return attrs; + } + c_lex_string_translate = 1; + } + return attrs; +} + +/* Parse a type name (C90 6.5.5, C99 6.7.6). + + type-name: + specifier-qualifier-list abstract-declarator[opt] +*/ + +static struct c_type_name * +c_parser_type_name (c_parser *parser) +{ + struct c_declspecs *specs = build_null_declspecs (); + struct c_declarator *declarator; + struct c_type_name *ret; + bool dummy = false; + c_parser_declspecs (parser, specs, false, true, true); + if (!specs->declspecs_seen_p) + { + c_parser_error (parser, "expected specifier-qualifier-list"); + return NULL; + } + pending_xref_error (); + finish_declspecs (specs); + declarator = c_parser_declarator (parser, specs->type_seen_p, + C_DTR_ABSTRACT, &dummy); + if (declarator == NULL) + return NULL; + ret = XOBNEW (&parser_obstack, struct c_type_name); + ret->specs = specs; + ret->declarator = declarator; + return ret; +} + +/* Parse an initializer (C90 6.5.7, C99 6.7.8). + + initializer: + assignment-expression + { initializer-list } + { initializer-list , } + + initializer-list: + designation[opt] initializer + initializer-list , designation[opt] initializer + + designation: + designator-list = + + designator-list: + designator + designator-list designator + + designator: + array-designator + . identifier + + array-designator: + [ constant-expression ] + + GNU extensions: + + initializer: + { } + + designation: + array-designator + identifier : + + array-designator: + [ constant-expression ... constant-expression ] + + Any expression without commas is accepted in the syntax for the + constant-expressions, with non-constant expressions rejected later. + + This function is only used for top-level initializers; for nested + ones, see c_parser_initval. */ + +static struct c_expr +c_parser_initializer (c_parser *parser) +{ + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + return c_parser_braced_init (parser, NULL_TREE, false); + else + { + struct c_expr ret; + ret = c_parser_expr_no_commas (parser, NULL); + if (TREE_CODE (ret.value) != STRING_CST + && TREE_CODE (ret.value) != COMPOUND_LITERAL_EXPR) + ret = default_function_array_conversion (ret); + return ret; + } +} + +/* Parse a braced initializer list. TYPE is the type specified for a + compound literal, and NULL_TREE for other initializers and for + nested braced lists. NESTED_P is true for nested braced lists, + false for the list of a compound literal or the list that is the + top-level initializer in a declaration. */ + +static struct c_expr +c_parser_braced_init (c_parser *parser, tree type, bool nested_p) +{ + gcc_assert (c_parser_next_token_is (parser, CPP_OPEN_BRACE)); + c_parser_consume_token (parser); + if (nested_p) + push_init_level (0); + else + really_start_incremental_init (type); + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + if (pedantic) + pedwarn ("ISO C forbids empty initializer braces"); + } + else + { + /* Parse a non-empty initializer list, possibly with a trailing + comma. */ + while (true) + { + c_parser_initelt (parser); + if (parser->error) + break; + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + break; + } + } + if (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE)) + { + struct c_expr ret; + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, "expected %<}%>"); + return ret; + } + c_parser_consume_token (parser); + return pop_init_level (0); +} + +/* Parse a nested initializer, including designators. */ + +static void +c_parser_initelt (c_parser *parser) +{ + /* Parse any designator or designator list. A single array + designator may have the subsequent "=" omitted in GNU C, but a + longer list or a structure member designator may not. */ + if (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_2nd_token (parser)->type == CPP_COLON) + { + /* Old-style structure member designator. */ + set_init_label (c_parser_peek_token (parser)->value); + if (pedantic) + pedwarn ("obsolete use of designated initializer with %<:%>"); + c_parser_consume_token (parser); + c_parser_consume_token (parser); + } + else + { + /* des_seen is 0 if there have been no designators, 1 if there + has been a single array designator and 2 otherwise. */ + int des_seen = 0; + while (c_parser_next_token_is (parser, CPP_OPEN_SQUARE) + || c_parser_next_token_is (parser, CPP_DOT)) + { + int des_prev = des_seen; + if (des_seen < 2) + des_seen++; + if (c_parser_next_token_is (parser, CPP_DOT)) + { + des_seen = 2; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + set_init_label (c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + } + else + { + struct c_expr init; + init.value = error_mark_node; + init.original_code = ERROR_MARK; + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_COMMA, NULL); + process_init_element (init); + return; + } + } + else + { + tree first, second; + /* ??? Following the old parser, [ objc-receiver + objc-message-args ] is accepted as an initializer, + being distinguished from a designator by what follows + the first assignment expression inside the square + brackets, but after a first array designator a + subsequent square bracket is for Objective-C taken to + start an expression, using the obsolete form of + designated initializer without '=', rather than + possibly being a second level of designation: in LALR + terms, the '[' is shifted rather than reducing + designator to designator-list. */ + if (des_prev == 1 && c_dialect_objc ()) + { + des_seen = des_prev; + break; + } + if (des_prev == 0 && c_dialect_objc ()) + { + /* This might be an array designator or an + Objective-C message expression. If the former, + continue parsing here; if the latter, parse the + remainder of the initializer given the starting + primary-expression. ??? It might make sense to + distinguish when des_prev == 1 as well; see + previous comment. */ + tree rec, args; + struct c_expr mexpr; + c_parser_consume_token (parser); + if (c_parser_peek_token (parser)->type == CPP_NAME + && ((c_parser_peek_token (parser)->id_kind + == C_ID_TYPENAME) + || (c_parser_peek_token (parser)->id_kind + == C_ID_CLASSNAME))) + { + /* Type name receiver. */ + tree id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + rec = objc_get_class_reference (id); + goto parse_message_args; + } + first = c_parser_expr_no_commas (parser, NULL).value; + if (c_parser_next_token_is (parser, CPP_ELLIPSIS) + || c_parser_next_token_is (parser, CPP_CLOSE_SQUARE)) + goto array_desig_after_first; + /* Expression receiver. So far only one part + without commas has been parsed; there might be + more of the expression. */ + rec = first; + while (c_parser_next_token_is (parser, CPP_COMMA)) + { + struct c_expr next; + c_parser_consume_token (parser); + next = c_parser_expr_no_commas (parser, NULL); + next = default_function_array_conversion (next); + rec = build_compound_expr (rec, next.value); + } + parse_message_args: + /* Now parse the objc-message-args. */ + args = c_parser_objc_message_args (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + mexpr.value + = objc_build_message_expr (build_tree_list (rec, args)); + mexpr.original_code = ERROR_MARK; + /* Now parse and process the remainder of the + initializer, starting with this message + expression as a primary-expression. */ + c_parser_initval (parser, &mexpr); + return; + } + c_parser_consume_token (parser); + first = c_parser_expr_no_commas (parser, NULL).value; + array_desig_after_first: + if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) + { + c_parser_consume_token (parser); + second = c_parser_expr_no_commas (parser, NULL).value; + } + else + second = NULL_TREE; + if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE)) + { + c_parser_consume_token (parser); + set_init_index (first, second); + if (pedantic && second) + pedwarn ("ISO C forbids specifying range of " + "elements to initialize"); + } + else + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + } + } + if (des_seen >= 1) + { + if (c_parser_next_token_is (parser, CPP_EQ)) + { + if (pedantic && !flag_isoc99) + pedwarn ("ISO C90 forbids specifying subobject to initialize"); + c_parser_consume_token (parser); + } + else + { + if (des_seen == 1) + { + if (pedantic) + pedwarn ("obsolete use of designated initializer " + "without %<=%>"); + } + else + { + struct c_expr init; + init.value = error_mark_node; + init.original_code = ERROR_MARK; + c_parser_error (parser, "expected %<=%>"); + c_parser_skip_until_found (parser, CPP_COMMA, NULL); + process_init_element (init); + return; + } + } + } + } + c_parser_initval (parser, NULL); +} + +/* Parse a nested initializer; as c_parser_initializer but parses + initializers within braced lists, after any designators have been + applied. If AFTER is not NULL then it is an Objective-C message + expression which is the primary-expression starting the + initializer. */ + +static void +c_parser_initval (c_parser *parser, struct c_expr *after) +{ + struct c_expr init; + gcc_assert (!after || c_dialect_objc ()); + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE) && !after) + init = c_parser_braced_init (parser, NULL_TREE, true); + else + { + init = c_parser_expr_no_commas (parser, after); + if (init.value != NULL_TREE + && TREE_CODE (init.value) != STRING_CST + && TREE_CODE (init.value) != COMPOUND_LITERAL_EXPR) + init = default_function_array_conversion (init); + } + process_init_element (init); +} + +/* Parse a compound statement (possibly a function body) (C90 6.6.2, + C99 6.8.2). + + compound-statement: + { block-item-list[opt] } + { label-declarations block-item-list } + + block-item-list: + block-item + block-item-list block-item + + block-item: + nested-declaration + statement + + nested-declaration: + declaration + + GNU extensions: + + compound-statement: + { label-declarations block-item-list } + + nested-declaration: + __extension__ nested-declaration + nested-function-definition + + label-declarations: + label-declaration + label-declarations label-declaration + + label-declaration: + __label__ identifier-list ; + + Allowing the mixing of declarations and code is new in C99. The + GNU syntax also permits (not shown above) labels at the end of + compound statements, which yield an error. We don't allow labels + on declarations; this might seem like a natural extension, but + there would be a conflict between attributes on the label and + prefix attributes on the declaration. ??? The syntax follows the + old parser in requiring something after label declarations. + Although they are erroneous if the labels declared aren't defined, + is it useful for the syntax to be this way? + + OpenMP: + + block-item: + openmp-directive + + openmp-directive: + barrier-directive + flush-directive */ + +static tree +c_parser_compound_statement (c_parser *parser) +{ + tree stmt; + if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) + return error_mark_node; + stmt = c_begin_compound_stmt (true); + c_parser_compound_statement_nostart (parser); + return c_end_compound_stmt (stmt, true); +} + +/* Parse a compound statement except for the opening brace. This is + used for parsing both compound statements and statement expressions + (which follow different paths to handling the opening). */ + +static void +c_parser_compound_statement_nostart (c_parser *parser) +{ + bool last_stmt = false; + bool last_label = false; + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + c_parser_consume_token (parser); + return; + } + if (c_parser_next_token_is_keyword (parser, RID_LABEL)) + { + /* Read zero or more forward-declarations for labels that nested + functions can jump to. */ + while (c_parser_next_token_is_keyword (parser, RID_LABEL)) + { + c_parser_consume_token (parser); + /* Any identifiers, including those declared as type names, + are OK here. */ + while (true) + { + tree label; + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + break; + } + label + = declare_label (c_parser_peek_token (parser)->value); + C_DECLARED_LABEL_FLAG (label) = 1; + add_stmt (build_stmt (DECL_EXPR, label)); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + } + /* ??? Locating this diagnostic on the token after the + declarations end follows the old parser, but it might be + better to locate it where the declarations start instead. */ + if (pedantic) + pedwarn ("ISO C forbids label declarations"); + } + /* We must now have at least one statement, label or declaration. */ + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + c_parser_error (parser, "expected declaration or statement"); + c_parser_consume_token (parser); + return; + } + while (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE)) + { + location_t loc = c_parser_peek_token (parser)->location; + if (c_parser_next_token_is_keyword (parser, RID_CASE) + || c_parser_next_token_is_keyword (parser, RID_DEFAULT) + || (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_2nd_token (parser)->type == CPP_COLON)) + { + last_label = true; + last_stmt = false; + c_parser_label (parser); + } + else if (!last_label + && c_parser_next_token_starts_declspecs (parser)) + { + last_label = false; + c_parser_declaration_or_fndef (parser, true, true, true, true); + if (last_stmt + && ((pedantic && !flag_isoc99) + || warn_declaration_after_statement)) + pedwarn_c90 ("%HISO C90 forbids mixed declarations and code", + &loc); + last_stmt = false; + } + else if (!last_label + && c_parser_next_token_is_keyword (parser, RID_EXTENSION)) + { + /* __extension__ can start a declaration, but is also an + unary operator that can start an expression. Consume all + but the last of a possible series of __extension__ to + determine which. */ + while (c_parser_peek_2nd_token (parser)->type == CPP_KEYWORD + && (c_parser_peek_2nd_token (parser)->keyword + == RID_EXTENSION)) + c_parser_consume_token (parser); + if (c_token_starts_declspecs (c_parser_peek_2nd_token (parser))) + { + int ext; + ext = disable_extension_diagnostics (); + c_parser_consume_token (parser); + last_label = false; + c_parser_declaration_or_fndef (parser, true, true, true, true); + /* Following the old parser, __extension__ does not + disable this diagnostic. */ + restore_extension_diagnostics (ext); + if (last_stmt + && ((pedantic && !flag_isoc99) + || warn_declaration_after_statement)) + pedwarn_c90 ("%HISO C90 forbids mixed declarations and code", + &loc); + last_stmt = false; + } + else + goto statement; + } + else if (c_parser_next_token_is (parser, CPP_PRAGMA)) + { + /* External pragmas, and some omp pragmas, are not associated + with regular c code, and so are not to be considered statements + syntactically. This ensures that the user doesn't put them + places that would turn into syntax errors if the directive + were ignored. */ + if (c_parser_pragma (parser, pragma_compound)) + last_label = false, last_stmt = true; + } + else if (c_parser_next_token_is (parser, CPP_EOF)) + { + c_parser_error (parser, "expected declaration or statement"); + return; + } + else + { + statement: + last_label = false; + last_stmt = true; + c_parser_statement_after_labels (parser); + } + + parser->error = false; + } + if (last_label) + error ("label at end of compound statement"); + c_parser_consume_token (parser); +} + +/* Parse a label (C90 6.6.1, C99 6.8.1). + + label: + identifier : attributes[opt] + case constant-expression : + default : + + GNU extensions: + + label: + case constant-expression ... constant-expression : + + The use of attributes on labels is a GNU extension. The syntax in + GNU C accepts any expressions without commas, non-constant + expressions being rejected later. */ + +static void +c_parser_label (c_parser *parser) +{ + location_t loc1 = c_parser_peek_token (parser)->location; + tree label = NULL_TREE; + if (c_parser_next_token_is_keyword (parser, RID_CASE)) + { + tree exp1, exp2; + c_parser_consume_token (parser); + exp1 = c_parser_expr_no_commas (parser, NULL).value; + if (c_parser_next_token_is (parser, CPP_COLON)) + { + c_parser_consume_token (parser); + label = do_case (exp1, NULL_TREE); + } + else if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) + { + c_parser_consume_token (parser); + exp2 = c_parser_expr_no_commas (parser, NULL).value; + if (c_parser_require (parser, CPP_COLON, "expected %<:%>")) + label = do_case (exp1, exp2); + } + else + c_parser_error (parser, "expected %<:%> or %<...%>"); + } + else if (c_parser_next_token_is_keyword (parser, RID_DEFAULT)) + { + c_parser_consume_token (parser); + if (c_parser_require (parser, CPP_COLON, "expected %<:%>")) + label = do_case (NULL_TREE, NULL_TREE); + } + else + { + tree name = c_parser_peek_token (parser)->value; + tree tlab; + location_t loc2; + tree attrs; + gcc_assert (c_parser_next_token_is (parser, CPP_NAME)); + c_parser_consume_token (parser); + gcc_assert (c_parser_next_token_is (parser, CPP_COLON)); + loc2 = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + attrs = c_parser_attributes (parser); + tlab = define_label (loc2, name); + if (tlab) + { + decl_attributes (&tlab, attrs, 0); + label = add_stmt (build_stmt (LABEL_EXPR, tlab)); + } + } + if (label) + SET_EXPR_LOCATION (label, loc1); +} + +/* Parse a statement (C90 6.6, C99 6.8). + + statement: + labeled-statement + compound-statement + expression-statement + selection-statement + iteration-statement + jump-statement + + labeled-statement: + label statement + + expression-statement: + expression[opt] ; + + selection-statement: + if-statement + switch-statement + + iteration-statement: + while-statement + do-statement + for-statement + + jump-statement: + goto identifier ; + continue ; + break ; + return expression[opt] ; + + GNU extensions: + + statement: + asm-statement + + jump-statement: + goto * expression ; + + Objective-C: + + statement: + objc-throw-statement + objc-try-catch-statement + objc-synchronized-statement + + objc-throw-statement: + @throw expression ; + @throw ; + + OpenMP: + + statement: + openmp-construct + + openmp-construct: + parallel-construct + for-construct + sections-construct + single-construct + parallel-for-construct + parallel-sections-construct + master-construct + critical-construct + atomic-construct + ordered-construct + + parallel-construct: + parallel-directive structured-block + + for-construct: + for-directive iteration-statement + + sections-construct: + sections-directive section-scope + + single-construct: + single-directive structured-block + + parallel-for-construct: + parallel-for-directive iteration-statement + + parallel-sections-construct: + parallel-sections-directive section-scope + + master-construct: + master-directive structured-block + + critical-construct: + critical-directive structured-block + + atomic-construct: + atomic-directive expression-statement + + ordered-construct: + ordered-directive structured-block */ + +static void +c_parser_statement (c_parser *parser) +{ + while (c_parser_next_token_is_keyword (parser, RID_CASE) + || c_parser_next_token_is_keyword (parser, RID_DEFAULT) + || (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_2nd_token (parser)->type == CPP_COLON)) + c_parser_label (parser); + c_parser_statement_after_labels (parser); +} + +/* Parse a statement, other than a labeled statement. */ + +static void +c_parser_statement_after_labels (c_parser *parser) +{ + location_t loc = c_parser_peek_token (parser)->location; + tree stmt = NULL_TREE; + switch (c_parser_peek_token (parser)->type) + { + case CPP_OPEN_BRACE: + add_stmt (c_parser_compound_statement (parser)); + break; + case CPP_KEYWORD: + switch (c_parser_peek_token (parser)->keyword) + { + case RID_IF: + c_parser_if_statement (parser); + break; + case RID_SWITCH: + c_parser_switch_statement (parser); + break; + case RID_WHILE: + c_parser_while_statement (parser); + break; + case RID_DO: + c_parser_do_statement (parser); + break; + case RID_FOR: + c_parser_for_statement (parser); + break; + case RID_GOTO: + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + stmt = c_finish_goto_label (c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + } + else if (c_parser_next_token_is (parser, CPP_MULT)) + { + c_parser_consume_token (parser); + stmt = c_finish_goto_ptr (c_parser_expression (parser).value); + } + else + c_parser_error (parser, "expected identifier or %<*%>"); + goto expect_semicolon; + case RID_CONTINUE: + c_parser_consume_token (parser); + stmt = c_finish_bc_stmt (&c_cont_label, false); + goto expect_semicolon; + case RID_BREAK: + c_parser_consume_token (parser); + stmt = c_finish_bc_stmt (&c_break_label, true); + goto expect_semicolon; + case RID_RETURN: + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + stmt = c_finish_return (NULL_TREE); + c_parser_consume_token (parser); + } + else + { + stmt = c_finish_return (c_parser_expression_conv (parser).value); + goto expect_semicolon; + } + break; + case RID_ASM: + stmt = c_parser_asm_statement (parser); + break; + case RID_AT_THROW: + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + stmt = objc_build_throw_stmt (NULL_TREE); + c_parser_consume_token (parser); + } + else + { + stmt + = objc_build_throw_stmt (c_parser_expression (parser).value); + goto expect_semicolon; + } + break; + case RID_AT_TRY: + gcc_assert (c_dialect_objc ()); + c_parser_objc_try_catch_statement (parser); + break; + case RID_AT_SYNCHRONIZED: + gcc_assert (c_dialect_objc ()); + c_parser_objc_synchronized_statement (parser); + break; + default: + goto expr_stmt; + } + break; + case CPP_SEMICOLON: + c_parser_consume_token (parser); + break; + case CPP_CLOSE_PAREN: + case CPP_CLOSE_SQUARE: + /* Avoid infinite loop in error recovery: + c_parser_skip_until_found stops at a closing nesting + delimiter without consuming it, but here we need to consume + it to proceed further. */ + c_parser_error (parser, "expected statement"); + c_parser_consume_token (parser); + break; + case CPP_PRAGMA: + c_parser_pragma (parser, pragma_stmt); + break; + default: + expr_stmt: + stmt = c_finish_expr_stmt (c_parser_expression_conv (parser).value); + expect_semicolon: + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + break; + } + /* Two cases cannot and do not have line numbers associated: If stmt + is degenerate, such as "2;", then stmt is an INTEGER_CST, which + cannot hold line numbers. But that's OK because the statement + will either be changed to a MODIFY_EXPR during gimplification of + the statement expr, or discarded. If stmt was compound, but + without new variables, we will have skipped the creation of a + BIND and will have a bare STATEMENT_LIST. But that's OK because + (recursively) all of the component statements should already have + line numbers assigned. ??? Can we discard no-op statements + earlier? */ + if (stmt && EXPR_P (stmt)) + SET_EXPR_LOCATION (stmt, loc); +} + +/* Parse a parenthesized condition from an if, do or while statement. + + condition: + ( expression ) +*/ +static tree +c_parser_paren_condition (c_parser *parser) +{ + location_t loc; + tree cond; + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + return error_mark_node; + loc = c_parser_peek_token (parser)->location; + cond = c_objc_common_truthvalue_conversion + (c_parser_expression_conv (parser).value); + if (EXPR_P (cond)) + SET_EXPR_LOCATION (cond, loc); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + return cond; +} + +/* Parse a statement which is a block in C99. */ + +static tree +c_parser_c99_block_statement (c_parser *parser) +{ + tree block = c_begin_compound_stmt (flag_isoc99); + c_parser_statement (parser); + return c_end_compound_stmt (block, flag_isoc99); +} + +/* Parse the body of an if statement or the else half thereof. This + is just parsing a statement but (a) it is a block in C99, (b) we + track whether the body is an if statement for the sake of + -Wparentheses warnings, (c) we handle an empty body specially for + the sake of -Wextra warnings. */ + +static tree +c_parser_if_body (c_parser *parser, bool *if_p) +{ + tree block = c_begin_compound_stmt (flag_isoc99); + while (c_parser_next_token_is_keyword (parser, RID_CASE) + || c_parser_next_token_is_keyword (parser, RID_DEFAULT) + || (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_2nd_token (parser)->type == CPP_COLON)) + c_parser_label (parser); + *if_p = c_parser_next_token_is_keyword (parser, RID_IF); + if (extra_warnings && c_parser_next_token_is (parser, CPP_SEMICOLON)) + add_stmt (build_empty_stmt ()); + c_parser_statement_after_labels (parser); + return c_end_compound_stmt (block, flag_isoc99); +} + +/* Parse an if statement (C90 6.6.4, C99 6.8.4). + + if-statement: + if ( expression ) statement + if ( expression ) statement else statement +*/ + +static void +c_parser_if_statement (c_parser *parser) +{ + tree block; + location_t loc; + tree cond; + bool first_if = false, second_if = false; + tree first_body, second_body; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_IF)); + c_parser_consume_token (parser); + block = c_begin_compound_stmt (flag_isoc99); + loc = c_parser_peek_token (parser)->location; + cond = c_parser_paren_condition (parser); + first_body = c_parser_if_body (parser, &first_if); + if (c_parser_next_token_is_keyword (parser, RID_ELSE)) + { + c_parser_consume_token (parser); + second_body = c_parser_if_body (parser, &second_if); + } + else + second_body = NULL_TREE; + c_finish_if_stmt (loc, cond, first_body, second_body, first_if); + add_stmt (c_end_compound_stmt (block, flag_isoc99)); +} + +/* Parse a switch statement (C90 6.6.4, C99 6.8.4). + + switch-statement: + switch (expression) statement +*/ + +static void +c_parser_switch_statement (c_parser *parser) +{ + tree block, expr, body, save_break; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_SWITCH)); + c_parser_consume_token (parser); + block = c_begin_compound_stmt (flag_isoc99); + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr = c_parser_expression (parser).value; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + else + expr = error_mark_node; + c_start_case (expr); + save_break = c_break_label; + c_break_label = NULL_TREE; + body = c_parser_c99_block_statement (parser); + c_finish_case (body); + if (c_break_label) + add_stmt (build1 (LABEL_EXPR, void_type_node, c_break_label)); + c_break_label = save_break; + add_stmt (c_end_compound_stmt (block, flag_isoc99)); +} + +/* Parse a while statement (C90 6.6.5, C99 6.8.5). + + while-statement: + while (expression) statement +*/ + +static void +c_parser_while_statement (c_parser *parser) +{ + tree block, cond, body, save_break, save_cont; + location_t loc; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_WHILE)); + c_parser_consume_token (parser); + block = c_begin_compound_stmt (flag_isoc99); + loc = c_parser_peek_token (parser)->location; + cond = c_parser_paren_condition (parser); + save_break = c_break_label; + c_break_label = NULL_TREE; + save_cont = c_cont_label; + c_cont_label = NULL_TREE; + body = c_parser_c99_block_statement (parser); + c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, true); + add_stmt (c_end_compound_stmt (block, flag_isoc99)); + c_break_label = save_break; + c_cont_label = save_cont; +} + +/* Parse a do statement (C90 6.6.5, C99 6.8.5). + + do-statement: + do statement while ( expression ) ; +*/ + +static void +c_parser_do_statement (c_parser *parser) +{ + tree block, cond, body, save_break, save_cont, new_break, new_cont; + location_t loc; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_DO)); + c_parser_consume_token (parser); + block = c_begin_compound_stmt (flag_isoc99); + loc = c_parser_peek_token (parser)->location; + save_break = c_break_label; + c_break_label = NULL_TREE; + save_cont = c_cont_label; + c_cont_label = NULL_TREE; + body = c_parser_c99_block_statement (parser); + c_parser_require_keyword (parser, RID_WHILE, "expected %"); + new_break = c_break_label; + c_break_label = save_break; + new_cont = c_cont_label; + c_cont_label = save_cont; + cond = c_parser_paren_condition (parser); + if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>")) + c_parser_skip_to_end_of_block_or_statement (parser); + c_finish_loop (loc, cond, NULL, body, new_break, new_cont, false); + add_stmt (c_end_compound_stmt (block, flag_isoc99)); +} + +/* Parse a for statement (C90 6.6.5, C99 6.8.5). + + for-statement: + for ( expression[opt] ; expression[opt] ; expression[opt] ) statement + for ( nested-declaration expression[opt] ; expression[opt] ) statement + + The form with a declaration is new in C99. + + ??? In accordance with the old parser, the declaration may be a + nested function, which is then rejected in check_for_loop_decls, + but does it make any sense for this to be included in the grammar? + Note in particular that the nested function does not include a + trailing ';', whereas the "declaration" production includes one. + Also, can we reject bad declarations earlier and cheaper than + check_for_loop_decls? */ + +static void +c_parser_for_statement (c_parser *parser) +{ + tree block, cond, incr, save_break, save_cont, body; + location_t loc; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR)); + loc = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + block = c_begin_compound_stmt (flag_isoc99); + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + /* Parse the initialization declaration or expression. */ + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + c_parser_consume_token (parser); + c_finish_expr_stmt (NULL_TREE); + } + else if (c_parser_next_token_starts_declspecs (parser)) + { + c_parser_declaration_or_fndef (parser, true, true, true, true); + check_for_loop_decls (); + } + else if (c_parser_next_token_is_keyword (parser, RID_EXTENSION)) + { + /* __extension__ can start a declaration, but is also an + unary operator that can start an expression. Consume all + but the last of a possible series of __extension__ to + determine which. */ + while (c_parser_peek_2nd_token (parser)->type == CPP_KEYWORD + && (c_parser_peek_2nd_token (parser)->keyword + == RID_EXTENSION)) + c_parser_consume_token (parser); + if (c_token_starts_declspecs (c_parser_peek_2nd_token (parser))) + { + int ext; + ext = disable_extension_diagnostics (); + c_parser_consume_token (parser); + c_parser_declaration_or_fndef (parser, true, true, true, true); + restore_extension_diagnostics (ext); + check_for_loop_decls (); + } + else + goto init_expr; + } + else + { + init_expr: + c_finish_expr_stmt (c_parser_expression (parser).value); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + } + /* Parse the loop condition. */ + loc = c_parser_peek_token (parser)->location; + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + c_parser_consume_token (parser); + cond = NULL_TREE; + } + else + { + tree ocond = c_parser_expression_conv (parser).value; + cond = c_objc_common_truthvalue_conversion (ocond); + if (EXPR_P (cond)) + SET_EXPR_LOCATION (cond, loc); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + } + /* Parse the increment expression. */ + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + incr = c_process_expr_stmt (NULL_TREE); + else + incr = c_process_expr_stmt (c_parser_expression (parser).value); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + else + { + cond = error_mark_node; + incr = error_mark_node; + } + save_break = c_break_label; + c_break_label = NULL_TREE; + save_cont = c_cont_label; + c_cont_label = NULL_TREE; + body = c_parser_c99_block_statement (parser); + c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, true); + add_stmt (c_end_compound_stmt (block, flag_isoc99)); + c_break_label = save_break; + c_cont_label = save_cont; +} + +/* Parse an asm statement, a GNU extension. This is a full-blown asm + statement with inputs, outputs, clobbers, and volatile tag + allowed. + + asm-statement: + asm type-qualifier[opt] ( asm-argument ) ; + + asm-argument: + asm-string-literal + asm-string-literal : asm-operands[opt] + asm-string-literal : asm-operands[opt] : asm-operands[opt] + asm-string-literal : asm-operands[opt] : asm-operands[opt] : asm-clobbers + + Qualifiers other than volatile are accepted in the syntax but + warned for. */ + +static tree +c_parser_asm_statement (c_parser *parser) +{ + tree quals, str, outputs, inputs, clobbers, ret; + bool simple; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_ASM)); + c_parser_consume_token (parser); + if (c_parser_next_token_is_keyword (parser, RID_VOLATILE)) + { + quals = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + else if (c_parser_next_token_is_keyword (parser, RID_CONST) + || c_parser_next_token_is_keyword (parser, RID_RESTRICT)) + { + warning (0, "%E qualifier ignored on asm", + c_parser_peek_token (parser)->value); + quals = NULL_TREE; + c_parser_consume_token (parser); + } + else + quals = NULL_TREE; + /* ??? Follow the C++ parser rather than using the + c_lex_string_translate kludge. */ + c_lex_string_translate = 0; + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + c_lex_string_translate = 1; + return NULL_TREE; + } + str = c_parser_asm_string_literal (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + simple = true; + outputs = NULL_TREE; + inputs = NULL_TREE; + clobbers = NULL_TREE; + goto done_asm; + } + if (!c_parser_require (parser, CPP_COLON, "expected %<:%> or %<)%>")) + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + simple = false; + /* Parse outputs. */ + if (c_parser_next_token_is (parser, CPP_COLON) + || c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + outputs = NULL_TREE; + else + outputs = c_parser_asm_operands (parser, false); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + inputs = NULL_TREE; + clobbers = NULL_TREE; + goto done_asm; + } + if (!c_parser_require (parser, CPP_COLON, "expected %<:%> or %<)%>")) + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + /* Parse inputs. */ + if (c_parser_next_token_is (parser, CPP_COLON) + || c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + inputs = NULL_TREE; + else + inputs = c_parser_asm_operands (parser, true); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + clobbers = NULL_TREE; + goto done_asm; + } + if (!c_parser_require (parser, CPP_COLON, "expected %<:%> or %<)%>")) + { + c_lex_string_translate = 1; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + /* Parse clobbers. */ + clobbers = c_parser_asm_clobbers (parser); + done_asm: + c_lex_string_translate = 1; + if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>")) + c_parser_skip_to_end_of_block_or_statement (parser); + ret = build_asm_stmt (quals, build_asm_expr (str, outputs, inputs, + clobbers, simple)); + return ret; +} + +/* Parse asm operands, a GNU extension. If CONVERT_P (for inputs but + not outputs), apply the default conversion of functions and arrays + to pointers. + + asm-operands: + asm-operand + asm-operands , asm-operand + + asm-operand: + asm-string-literal ( expression ) + [ identifier ] asm-string-literal ( expression ) +*/ + +static tree +c_parser_asm_operands (c_parser *parser, bool convert_p) +{ + tree list = NULL_TREE; + while (true) + { + tree name, str; + struct c_expr expr; + if (c_parser_next_token_is (parser, CPP_OPEN_SQUARE)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + tree id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + name = build_string (IDENTIFIER_LENGTH (id), + IDENTIFIER_POINTER (id)); + } + else + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL); + return NULL_TREE; + } + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + } + else + name = NULL_TREE; + str = c_parser_asm_string_literal (parser); + if (str == NULL_TREE) + return NULL_TREE; + c_lex_string_translate = 1; + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + c_lex_string_translate = 0; + return NULL_TREE; + } + expr = c_parser_expression (parser); + if (convert_p) + expr = default_function_array_conversion (expr); + c_lex_string_translate = 0; + if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return NULL_TREE; + } + list = chainon (list, build_tree_list (build_tree_list (name, str), + expr.value)); + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + return list; +} + +/* Parse asm clobbers, a GNU extension. + + asm-clobbers: + asm-string-literal + asm-clobbers , asm-string-literal +*/ + +static tree +c_parser_asm_clobbers (c_parser *parser) +{ + tree list = NULL_TREE; + while (true) + { + tree str = c_parser_asm_string_literal (parser); + if (str) + list = tree_cons (NULL_TREE, str, list); + else + return NULL_TREE; + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + return list; +} + +/* Parse an expression other than a compound expression; that is, an + assignment expression (C90 6.3.16, C99 6.5.16). If AFTER is not + NULL then it is an Objective-C message expression which is the + primary-expression starting the expression as an initializer. + + assignment-expression: + conditional-expression + unary-expression assignment-operator assignment-expression + + assignment-operator: one of + = *= /= %= += -= <<= >>= &= ^= |= + + In GNU C we accept any conditional expression on the LHS and + diagnose the invalid lvalue rather than producing a syntax + error. */ + +static struct c_expr +c_parser_expr_no_commas (c_parser *parser, struct c_expr *after) +{ + struct c_expr lhs, rhs, ret; + enum tree_code code; + gcc_assert (!after || c_dialect_objc ()); + lhs = c_parser_conditional_expression (parser, after); + switch (c_parser_peek_token (parser)->type) + { + case CPP_EQ: + code = NOP_EXPR; + break; + case CPP_MULT_EQ: + code = MULT_EXPR; + break; + case CPP_DIV_EQ: + code = TRUNC_DIV_EXPR; + break; + case CPP_MOD_EQ: + code = TRUNC_MOD_EXPR; + break; + case CPP_PLUS_EQ: + code = PLUS_EXPR; + break; + case CPP_MINUS_EQ: + code = MINUS_EXPR; + break; + case CPP_LSHIFT_EQ: + code = LSHIFT_EXPR; + break; + case CPP_RSHIFT_EQ: + code = RSHIFT_EXPR; + break; + case CPP_AND_EQ: + code = BIT_AND_EXPR; + break; + case CPP_XOR_EQ: + code = BIT_XOR_EXPR; + break; + case CPP_OR_EQ: + code = BIT_IOR_EXPR; + break; + default: + return lhs; + } + c_parser_consume_token (parser); + rhs = c_parser_expr_no_commas (parser, NULL); + rhs = default_function_array_conversion (rhs); + ret.value = build_modify_expr (lhs.value, code, rhs.value); + if (code == NOP_EXPR) + ret.original_code = MODIFY_EXPR; + else + { + TREE_NO_WARNING (ret.value) = 1; + ret.original_code = ERROR_MARK; + } + return ret; +} + +/* Parse a conditional expression (C90 6.3.15, C99 6.5.15). If AFTER + is not NULL then it is an Objective-C message expression which is + the primary-expression starting the expression as an initializer. + + conditional-expression: + logical-OR-expression + logical-OR-expression ? expression : conditional-expression + + GNU extensions: + + conditional-expression: + logical-OR-expression ? : conditional-expression +*/ + +static struct c_expr +c_parser_conditional_expression (c_parser *parser, struct c_expr *after) +{ + struct c_expr cond, exp1, exp2, ret; + gcc_assert (!after || c_dialect_objc ()); + cond = c_parser_binary_expression (parser, after); + if (c_parser_next_token_is_not (parser, CPP_QUERY)) + return cond; + cond = default_function_array_conversion (cond); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COLON)) + { + if (pedantic) + pedwarn ("ISO C forbids omitting the middle term of a ?: expression"); + /* Make sure first operand is calculated only once. */ + exp1.value = save_expr (default_conversion (cond.value)); + cond.value = c_objc_common_truthvalue_conversion (exp1.value); + skip_evaluation += cond.value == truthvalue_true_node; + } + else + { + cond.value + = c_objc_common_truthvalue_conversion + (default_conversion (cond.value)); + skip_evaluation += cond.value == truthvalue_false_node; + exp1 = c_parser_expression_conv (parser); + skip_evaluation += ((cond.value == truthvalue_true_node) + - (cond.value == truthvalue_false_node)); + } + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) + { + skip_evaluation -= cond.value == truthvalue_true_node; + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + return ret; + } + exp2 = c_parser_conditional_expression (parser, NULL); + exp2 = default_function_array_conversion (exp2); + skip_evaluation -= cond.value == truthvalue_true_node; + ret.value = build_conditional_expr (cond.value, exp1.value, exp2.value); + ret.original_code = ERROR_MARK; + return ret; +} + +/* Parse a binary expression; that is, a logical-OR-expression (C90 + 6.3.5-6.3.14, C99 6.5.5-6.5.14). If AFTER is not NULL then it is + an Objective-C message expression which is the primary-expression + starting the expression as an initializer. + + multiplicative-expression: + cast-expression + multiplicative-expression * cast-expression + multiplicative-expression / cast-expression + multiplicative-expression % cast-expression + + additive-expression: + multiplicative-expression + additive-expression + multiplicative-expression + additive-expression - multiplicative-expression + + shift-expression: + additive-expression + shift-expression << additive-expression + shift-expression >> additive-expression + + relational-expression: + shift-expression + relational-expression < shift-expression + relational-expression > shift-expression + relational-expression <= shift-expression + relational-expression >= shift-expression + + equality-expression: + relational-expression + equality-expression == relational-expression + equality-expression != relational-expression + + AND-expression: + equality-expression + AND-expression & equality-expression + + exclusive-OR-expression: + AND-expression + exclusive-OR-expression ^ AND-expression + + inclusive-OR-expression: + exclusive-OR-expression + inclusive-OR-expression | exclusive-OR-expression + + logical-AND-expression: + inclusive-OR-expression + logical-AND-expression && inclusive-OR-expression + + logical-OR-expression: + logical-AND-expression + logical-OR-expression || logical-AND-expression +*/ + +static struct c_expr +c_parser_binary_expression (c_parser *parser, struct c_expr *after) +{ + /* A binary expression is parsed using operator-precedence parsing, + with the operands being cast expressions. All the binary + operators are left-associative. Thus a binary expression is of + form: + + E0 op1 E1 op2 E2 ... + + which we represent on a stack. On the stack, the precedence + levels are strictly increasing. When a new operator is + encountered of higher precedence than that at the top of the + stack, it is pushed; its LHS is the top expression, and its RHS + is everything parsed until it is popped. When a new operator is + encountered with precedence less than or equal to that at the top + of the stack, triples E[i-1] op[i] E[i] are popped and replaced + by the result of the operation until the operator at the top of + the stack has lower precedence than the new operator or there is + only one element on the stack; then the top expression is the LHS + of the new operator. In the case of logical AND and OR + expressions, we also need to adjust skip_evaluation as + appropriate when the operators are pushed and popped. */ + + /* The precedence levels, where 0 is a dummy lowest level used for + the bottom of the stack. */ + enum prec { + PREC_NONE, + PREC_LOGOR, + PREC_LOGAND, + PREC_BITOR, + PREC_BITXOR, + PREC_BITAND, + PREC_EQ, + PREC_REL, + PREC_SHIFT, + PREC_ADD, + PREC_MULT, + NUM_PRECS + }; + struct { + /* The expression at this stack level. */ + struct c_expr expr; + /* The precedence of the operator on its left, PREC_NONE at the + bottom of the stack. */ + enum prec prec; + /* The operation on its left. */ + enum tree_code op; + } stack[NUM_PRECS]; + int sp; +#define POP \ + do { \ + switch (stack[sp].op) \ + { \ + case TRUTH_ANDIF_EXPR: \ + skip_evaluation -= stack[sp - 1].expr.value == truthvalue_false_node; \ + break; \ + case TRUTH_ORIF_EXPR: \ + skip_evaluation -= stack[sp - 1].expr.value == truthvalue_true_node; \ + break; \ + default: \ + break; \ + } \ + stack[sp - 1].expr \ + = default_function_array_conversion (stack[sp - 1].expr); \ + stack[sp].expr \ + = default_function_array_conversion (stack[sp].expr); \ + stack[sp - 1].expr = parser_build_binary_op (stack[sp].op, \ + stack[sp - 1].expr, \ + stack[sp].expr); \ + sp--; \ + } while (0) + gcc_assert (!after || c_dialect_objc ()); + stack[0].expr = c_parser_cast_expression (parser, after); + stack[0].prec = PREC_NONE; + sp = 0; + while (true) + { + enum prec oprec; + enum tree_code ocode; + if (parser->error) + goto out; + switch (c_parser_peek_token (parser)->type) + { + case CPP_MULT: + oprec = PREC_MULT; + ocode = MULT_EXPR; + break; + case CPP_DIV: + oprec = PREC_MULT; + ocode = TRUNC_DIV_EXPR; + break; + case CPP_MOD: + oprec = PREC_MULT; + ocode = TRUNC_MOD_EXPR; + break; + case CPP_PLUS: + oprec = PREC_ADD; + ocode = PLUS_EXPR; + break; + case CPP_MINUS: + oprec = PREC_ADD; + ocode = MINUS_EXPR; + break; + case CPP_LSHIFT: + oprec = PREC_SHIFT; + ocode = LSHIFT_EXPR; + break; + case CPP_RSHIFT: + oprec = PREC_SHIFT; + ocode = RSHIFT_EXPR; + break; + case CPP_LESS: + oprec = PREC_REL; + ocode = LT_EXPR; + break; + case CPP_GREATER: + oprec = PREC_REL; + ocode = GT_EXPR; + break; + case CPP_LESS_EQ: + oprec = PREC_REL; + ocode = LE_EXPR; + break; + case CPP_GREATER_EQ: + oprec = PREC_REL; + ocode = GE_EXPR; + break; + case CPP_EQ_EQ: + oprec = PREC_EQ; + ocode = EQ_EXPR; + break; + case CPP_NOT_EQ: + oprec = PREC_EQ; + ocode = NE_EXPR; + break; + case CPP_AND: + oprec = PREC_BITAND; + ocode = BIT_AND_EXPR; + break; + case CPP_XOR: + oprec = PREC_BITXOR; + ocode = BIT_XOR_EXPR; + break; + case CPP_OR: + oprec = PREC_BITOR; + ocode = BIT_IOR_EXPR; + break; + case CPP_AND_AND: + oprec = PREC_LOGAND; + ocode = TRUTH_ANDIF_EXPR; + break; + case CPP_OR_OR: + oprec = PREC_LOGOR; + ocode = TRUTH_ORIF_EXPR; + break; + default: + /* Not a binary operator, so end of the binary + expression. */ + goto out; + } + c_parser_consume_token (parser); + while (oprec <= stack[sp].prec) + POP; + switch (ocode) + { + case TRUTH_ANDIF_EXPR: + stack[sp].expr + = default_function_array_conversion (stack[sp].expr); + stack[sp].expr.value = c_objc_common_truthvalue_conversion + (default_conversion (stack[sp].expr.value)); + skip_evaluation += stack[sp].expr.value == truthvalue_false_node; + break; + case TRUTH_ORIF_EXPR: + stack[sp].expr + = default_function_array_conversion (stack[sp].expr); + stack[sp].expr.value = c_objc_common_truthvalue_conversion + (default_conversion (stack[sp].expr.value)); + skip_evaluation += stack[sp].expr.value == truthvalue_true_node; + break; + default: + break; + } + sp++; + stack[sp].expr = c_parser_cast_expression (parser, NULL); + stack[sp].prec = oprec; + stack[sp].op = ocode; + } + out: + while (sp > 0) + POP; + return stack[0].expr; +#undef POP +} + +/* Parse a cast expression (C90 6.3.4, C99 6.5.4). If AFTER is not + NULL then it is an Objective-C message expression which is the + primary-expression starting the expression as an initializer. + + cast-expression: + unary-expression + ( type-name ) unary-expression +*/ + +static struct c_expr +c_parser_cast_expression (c_parser *parser, struct c_expr *after) +{ + gcc_assert (!after || c_dialect_objc ()); + if (after) + return c_parser_postfix_expression_after_primary (parser, *after); + /* If the expression begins with a parenthesized type name, it may + be either a cast or a compound literal; we need to see whether + the next character is '{' to tell the difference. If not, it is + an unary expression. */ + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN) + && c_token_starts_typename (c_parser_peek_2nd_token (parser))) + { + struct c_type_name *type_name; + struct c_expr ret; + struct c_expr expr; + c_parser_consume_token (parser); + type_name = c_parser_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + if (type_name == NULL) + { + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + return ret; + } + + /* Save casted types in the function's used types hash table. */ + used_types_insert (type_name->specs->type); + + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + return c_parser_postfix_expression_after_paren_type (parser, + type_name); + expr = c_parser_cast_expression (parser, NULL); + expr = default_function_array_conversion (expr); + ret.value = c_cast_expr (type_name, expr.value); + ret.original_code = ERROR_MARK; + return ret; + } + else + return c_parser_unary_expression (parser); +} + +/* Parse an unary expression (C90 6.3.3, C99 6.5.3). + + unary-expression: + postfix-expression + ++ unary-expression + -- unary-expression + unary-operator cast-expression + sizeof unary-expression + sizeof ( type-name ) + + unary-operator: one of + & * + - ~ ! + + GNU extensions: + + unary-expression: + __alignof__ unary-expression + __alignof__ ( type-name ) + && identifier + + unary-operator: one of + __extension__ __real__ __imag__ + + In addition, the GNU syntax treats ++ and -- as unary operators, so + they may be applied to cast expressions with errors for non-lvalues + given later. */ + +static struct c_expr +c_parser_unary_expression (c_parser *parser) +{ + int ext; + struct c_expr ret, op; + switch (c_parser_peek_token (parser)->type) + { + case CPP_PLUS_PLUS: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (PREINCREMENT_EXPR, op); + case CPP_MINUS_MINUS: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (PREDECREMENT_EXPR, op); + case CPP_AND: + c_parser_consume_token (parser); + return parser_build_unary_op (ADDR_EXPR, + c_parser_cast_expression (parser, NULL)); + case CPP_MULT: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + ret.value = build_indirect_ref (op.value, "unary *"); + ret.original_code = ERROR_MARK; + return ret; + case CPP_PLUS: + c_parser_consume_token (parser); + if (!c_dialect_objc () && !in_system_header) + warning (OPT_Wtraditional, + "traditional C rejects the unary plus operator"); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (CONVERT_EXPR, op); + case CPP_MINUS: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (NEGATE_EXPR, op); + case CPP_COMPL: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (BIT_NOT_EXPR, op); + case CPP_NOT: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (TRUTH_NOT_EXPR, op); + case CPP_AND_AND: + /* Refer to the address of a label as a pointer. */ + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + ret.value = finish_label_address_expr + (c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + } + else + { + c_parser_error (parser, "expected identifier"); + ret.value = error_mark_node; + } + ret.original_code = ERROR_MARK; + return ret; + case CPP_KEYWORD: + switch (c_parser_peek_token (parser)->keyword) + { + case RID_SIZEOF: + return c_parser_sizeof_expression (parser); + case RID_ALIGNOF: + return c_parser_alignof_expression (parser); + case RID_EXTENSION: + c_parser_consume_token (parser); + ext = disable_extension_diagnostics (); + ret = c_parser_cast_expression (parser, NULL); + restore_extension_diagnostics (ext); + return ret; + case RID_REALPART: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (REALPART_EXPR, op); + case RID_IMAGPART: + c_parser_consume_token (parser); + op = c_parser_cast_expression (parser, NULL); + op = default_function_array_conversion (op); + return parser_build_unary_op (IMAGPART_EXPR, op); + default: + return c_parser_postfix_expression (parser); + } + default: + return c_parser_postfix_expression (parser); + } +} + +/* Parse a sizeof expression. */ + +static struct c_expr +c_parser_sizeof_expression (c_parser *parser) +{ + struct c_expr expr; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_SIZEOF)); + c_parser_consume_token (parser); + skip_evaluation++; + in_sizeof++; + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN) + && c_token_starts_typename (c_parser_peek_2nd_token (parser))) + { + /* Either sizeof ( type-name ) or sizeof unary-expression + starting with a compound literal. */ + struct c_type_name *type_name; + c_parser_consume_token (parser); + type_name = c_parser_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + if (type_name == NULL) + { + struct c_expr ret; + skip_evaluation--; + in_sizeof--; + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + return ret; + } + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + { + expr = c_parser_postfix_expression_after_paren_type (parser, + type_name); + goto sizeof_expr; + } + /* sizeof ( type-name ). */ + skip_evaluation--; + in_sizeof--; + if (type_name->declarator->kind == cdk_array + && type_name->declarator->u.array.vla_unspec_p) + { + /* C99 6.7.5.2p4 */ + error ("%<[*]%> not allowed in other than a declaration"); + } + return c_expr_sizeof_type (type_name); + } + else + { + expr = c_parser_unary_expression (parser); + sizeof_expr: + skip_evaluation--; + in_sizeof--; + if (TREE_CODE (expr.value) == COMPONENT_REF + && DECL_C_BIT_FIELD (TREE_OPERAND (expr.value, 1))) + error ("% applied to a bit-field"); + return c_expr_sizeof_expr (expr); + } +} + +/* Parse an alignof expression. */ + +static struct c_expr +c_parser_alignof_expression (c_parser *parser) +{ + struct c_expr expr; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_ALIGNOF)); + c_parser_consume_token (parser); + skip_evaluation++; + in_alignof++; + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN) + && c_token_starts_typename (c_parser_peek_2nd_token (parser))) + { + /* Either __alignof__ ( type-name ) or __alignof__ + unary-expression starting with a compound literal. */ + struct c_type_name *type_name; + struct c_expr ret; + c_parser_consume_token (parser); + type_name = c_parser_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + if (type_name == NULL) + { + struct c_expr ret; + skip_evaluation--; + in_alignof--; + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + return ret; + } + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + { + expr = c_parser_postfix_expression_after_paren_type (parser, + type_name); + goto alignof_expr; + } + /* alignof ( type-name ). */ + skip_evaluation--; + in_alignof--; + ret.value = c_alignof (groktypename (type_name)); + ret.original_code = ERROR_MARK; + return ret; + } + else + { + struct c_expr ret; + expr = c_parser_unary_expression (parser); + alignof_expr: + skip_evaluation--; + in_alignof--; + ret.value = c_alignof_expr (expr.value); + ret.original_code = ERROR_MARK; + return ret; + } +} + +/* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2). + + postfix-expression: + primary-expression + postfix-expression [ expression ] + postfix-expression ( argument-expression-list[opt] ) + postfix-expression . identifier + postfix-expression -> identifier + postfix-expression ++ + postfix-expression -- + ( type-name ) { initializer-list } + ( type-name ) { initializer-list , } + + argument-expression-list: + argument-expression + argument-expression-list , argument-expression + + primary-expression: + identifier + constant + string-literal + ( expression ) + + GNU extensions: + + primary-expression: + __func__ + (treated as a keyword in GNU C) + __FUNCTION__ + __PRETTY_FUNCTION__ + ( compound-statement ) + __builtin_va_arg ( assignment-expression , type-name ) + __builtin_offsetof ( type-name , offsetof-member-designator ) + __builtin_choose_expr ( assignment-expression , + assignment-expression , + assignment-expression ) + __builtin_types_compatible_p ( type-name , type-name ) + + offsetof-member-designator: + identifier + offsetof-member-designator . identifier + offsetof-member-designator [ expression ] + + Objective-C: + + primary-expression: + [ objc-receiver objc-message-args ] + @selector ( objc-selector-arg ) + @protocol ( identifier ) + @encode ( type-name ) + objc-string-literal +*/ + +static struct c_expr +c_parser_postfix_expression (c_parser *parser) +{ + struct c_expr expr, e1, e2, e3; + struct c_type_name *t1, *t2; + switch (c_parser_peek_token (parser)->type) + { + case CPP_NUMBER: + case CPP_CHAR: + case CPP_WCHAR: + expr.value = c_parser_peek_token (parser)->value; + expr.original_code = ERROR_MARK; + c_parser_consume_token (parser); + break; + case CPP_STRING: + case CPP_WSTRING: + expr.value = c_parser_peek_token (parser)->value; + expr.original_code = STRING_CST; + c_parser_consume_token (parser); + break; + case CPP_OBJC_STRING: + gcc_assert (c_dialect_objc ()); + expr.value + = objc_build_string_object (c_parser_peek_token (parser)->value); + expr.original_code = ERROR_MARK; + c_parser_consume_token (parser); + break; + case CPP_NAME: + if (c_parser_peek_token (parser)->id_kind != C_ID_ID) + { + c_parser_error (parser, "expected expression"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + { + tree id = c_parser_peek_token (parser)->value; + location_t loc = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + expr.value = build_external_ref (id, + (c_parser_peek_token (parser)->type + == CPP_OPEN_PAREN), loc); + expr.original_code = ERROR_MARK; + } + break; + case CPP_OPEN_PAREN: + /* A parenthesized expression, statement expression or compound + literal. */ + if (c_parser_peek_2nd_token (parser)->type == CPP_OPEN_BRACE) + { + /* A statement expression. */ + tree stmt; + c_parser_consume_token (parser); + c_parser_consume_token (parser); + if (cur_stmt_list == NULL) + { + error ("braced-group within expression allowed " + "only inside a function"); + parser->error = true; + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, NULL); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + stmt = c_begin_stmt_expr (); + c_parser_compound_statement_nostart (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + if (pedantic) + pedwarn ("ISO C forbids braced-groups within expressions"); + expr.value = c_finish_stmt_expr (stmt); + expr.original_code = ERROR_MARK; + } + else if (c_token_starts_typename (c_parser_peek_2nd_token (parser))) + { + /* A compound literal. ??? Can we actually get here rather + than going directly to + c_parser_postfix_expression_after_paren_type from + elsewhere? */ + struct c_type_name *type_name; + c_parser_consume_token (parser); + type_name = c_parser_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + if (type_name == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + } + else + expr = c_parser_postfix_expression_after_paren_type (parser, + type_name); + } + else + { + /* A parenthesized expression. */ + c_parser_consume_token (parser); + expr = c_parser_expression (parser); + if (TREE_CODE (expr.value) == MODIFY_EXPR) + TREE_NO_WARNING (expr.value) = 1; + expr.original_code = ERROR_MARK; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + } + break; + case CPP_KEYWORD: + switch (c_parser_peek_token (parser)->keyword) + { + case RID_FUNCTION_NAME: + case RID_PRETTY_FUNCTION_NAME: + case RID_C99_FUNCTION_NAME: + expr.value = fname_decl (c_parser_peek_token (parser)->keyword, + c_parser_peek_token (parser)->value); + expr.original_code = ERROR_MARK; + c_parser_consume_token (parser); + break; + case RID_VA_ARG: + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + e1 = c_parser_expr_no_commas (parser, NULL); + if (!c_parser_require (parser, CPP_COMMA, "expected %<,%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + t1 = c_parser_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + if (t1 == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + } + else + { + expr.value = build_va_arg (e1.value, groktypename (t1)); + expr.original_code = ERROR_MARK; + } + break; + case RID_OFFSETOF: + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + t1 = c_parser_type_name (parser); + if (t1 == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + if (!c_parser_require (parser, CPP_COMMA, "expected %<,%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + { + tree type = groktypename (t1); + tree offsetof_ref; + if (type == error_mark_node) + offsetof_ref = error_mark_node; + else + offsetof_ref = build1 (INDIRECT_REF, type, null_pointer_node); + /* Parse the second argument to __builtin_offsetof. We + must have one identifier, and beyond that we want to + accept sub structure and sub array references. */ + if (c_parser_next_token_is (parser, CPP_NAME)) + { + offsetof_ref = build_component_ref + (offsetof_ref, c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + while (c_parser_next_token_is (parser, CPP_DOT) + || c_parser_next_token_is (parser, + CPP_OPEN_SQUARE)) + { + if (c_parser_next_token_is (parser, CPP_DOT)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, + CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + break; + } + offsetof_ref = build_component_ref + (offsetof_ref, + c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + } + else + { + tree idx; + c_parser_consume_token (parser); + idx = c_parser_expression (parser).value; + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + offsetof_ref = build_array_ref (offsetof_ref, idx); + } + } + } + else + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + expr.value = fold_offsetof (offsetof_ref, NULL_TREE); + expr.original_code = ERROR_MARK; + } + break; + case RID_CHOOSE_EXPR: + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + e1 = c_parser_expr_no_commas (parser, NULL); + if (!c_parser_require (parser, CPP_COMMA, "expected %<,%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + e2 = c_parser_expr_no_commas (parser, NULL); + if (!c_parser_require (parser, CPP_COMMA, "expected %<,%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + e3 = c_parser_expr_no_commas (parser, NULL); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + { + tree c; + + c = fold (e1.value); + if (TREE_CODE (c) != INTEGER_CST) + error ("first argument to %<__builtin_choose_expr%> not" + " a constant"); + expr = integer_zerop (c) ? e3 : e2; + } + break; + case RID_TYPES_COMPATIBLE_P: + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + t1 = c_parser_type_name (parser); + if (t1 == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + if (!c_parser_require (parser, CPP_COMMA, "expected %<,%>")) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + t2 = c_parser_type_name (parser); + if (t2 == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + { + tree e1, e2; + + e1 = TYPE_MAIN_VARIANT (groktypename (t1)); + e2 = TYPE_MAIN_VARIANT (groktypename (t2)); + + expr.value = comptypes (e1, e2) + ? build_int_cst (NULL_TREE, 1) + : build_int_cst (NULL_TREE, 0); + expr.original_code = ERROR_MARK; + } + break; + case RID_AT_SELECTOR: + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + { + tree sel = c_parser_objc_selector_arg (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + expr.value = objc_build_selector_expr (sel); + expr.original_code = ERROR_MARK; + } + break; + case RID_AT_PROTOCOL: + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + { + tree id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + expr.value = objc_build_protocol_expr (id); + expr.original_code = ERROR_MARK; + } + break; + case RID_AT_ENCODE: + /* Extension to support C-structures in the archiver. */ + gcc_assert (c_dialect_objc ()); + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + t1 = c_parser_type_name (parser); + if (t1 == NULL) + { + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + break; + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + { + tree type = groktypename (t1); + expr.value = objc_build_encode_expr (type); + expr.original_code = ERROR_MARK; + } + break; + default: + c_parser_error (parser, "expected expression"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + break; + case CPP_OPEN_SQUARE: + if (c_dialect_objc ()) + { + tree receiver, args; + c_parser_consume_token (parser); + receiver = c_parser_objc_receiver (parser); + args = c_parser_objc_message_args (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + expr.value = objc_build_message_expr (build_tree_list (receiver, + args)); + expr.original_code = ERROR_MARK; + break; + } + /* Else fall through to report error. */ + default: + c_parser_error (parser, "expected expression"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + break; + } + return c_parser_postfix_expression_after_primary (parser, expr); +} + +/* Parse a postfix expression after a parenthesized type name: the + brace-enclosed initializer of a compound literal, possibly followed + by some postfix operators. This is separate because it is not + possible to tell until after the type name whether a cast + expression has a cast or a compound literal, or whether the operand + of sizeof is a parenthesized type name or starts with a compound + literal. */ + +static struct c_expr +c_parser_postfix_expression_after_paren_type (c_parser *parser, + struct c_type_name *type_name) +{ + tree type; + struct c_expr init; + struct c_expr expr; + start_init (NULL_TREE, NULL, 0); + type = groktypename (type_name); + if (type != error_mark_node && C_TYPE_VARIABLE_SIZE (type)) + { + error ("compound literal has variable size"); + type = error_mark_node; + } + init = c_parser_braced_init (parser, type, false); + finish_init (); + maybe_warn_string_init (type, init); + + if (pedantic && !flag_isoc99) + pedwarn ("ISO C90 forbids compound literals"); + expr.value = build_compound_literal (type, init.value); + expr.original_code = ERROR_MARK; + return c_parser_postfix_expression_after_primary (parser, expr); +} + +/* Parse a postfix expression after the initial primary or compound + literal; that is, parse a series of postfix operators. */ + +static struct c_expr +c_parser_postfix_expression_after_primary (c_parser *parser, + struct c_expr expr) +{ + tree ident, idx, exprlist; + while (true) + { + switch (c_parser_peek_token (parser)->type) + { + case CPP_OPEN_SQUARE: + /* Array reference. */ + c_parser_consume_token (parser); + idx = c_parser_expression (parser).value; + c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, + "expected %<]%>"); + expr.value = build_array_ref (expr.value, idx); + expr.original_code = ERROR_MARK; + break; + case CPP_OPEN_PAREN: + /* Function call. */ + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + exprlist = NULL_TREE; + else + exprlist = c_parser_expr_list (parser, true); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + expr.value = build_function_call (expr.value, exprlist); + expr.original_code = ERROR_MARK; + break; + case CPP_DOT: + /* Structure element reference. */ + c_parser_consume_token (parser); + expr = default_function_array_conversion (expr); + if (c_parser_next_token_is (parser, CPP_NAME)) + ident = c_parser_peek_token (parser)->value; + else + { + c_parser_error (parser, "expected identifier"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + return expr; + } + c_parser_consume_token (parser); + expr.value = build_component_ref (expr.value, ident); + expr.original_code = ERROR_MARK; + break; + case CPP_DEREF: + /* Structure element reference. */ + c_parser_consume_token (parser); + expr = default_function_array_conversion (expr); + if (c_parser_next_token_is (parser, CPP_NAME)) + ident = c_parser_peek_token (parser)->value; + else + { + c_parser_error (parser, "expected identifier"); + expr.value = error_mark_node; + expr.original_code = ERROR_MARK; + return expr; + } + c_parser_consume_token (parser); + expr.value = build_component_ref (build_indirect_ref (expr.value, + "->"), ident); + expr.original_code = ERROR_MARK; + break; + case CPP_PLUS_PLUS: + /* Postincrement. */ + c_parser_consume_token (parser); + expr = default_function_array_conversion (expr); + expr.value = build_unary_op (POSTINCREMENT_EXPR, expr.value, 0); + expr.original_code = ERROR_MARK; + break; + case CPP_MINUS_MINUS: + /* Postdecrement. */ + c_parser_consume_token (parser); + expr = default_function_array_conversion (expr); + expr.value = build_unary_op (POSTDECREMENT_EXPR, expr.value, 0); + expr.original_code = ERROR_MARK; + break; + default: + return expr; + } + } +} + +/* Parse an expression (C90 6.3.17, C99 6.5.17). + + expression: + assignment-expression + expression , assignment-expression +*/ + +static struct c_expr +c_parser_expression (c_parser *parser) +{ + struct c_expr expr; + expr = c_parser_expr_no_commas (parser, NULL); + while (c_parser_next_token_is (parser, CPP_COMMA)) + { + struct c_expr next; + c_parser_consume_token (parser); + next = c_parser_expr_no_commas (parser, NULL); + next = default_function_array_conversion (next); + expr.value = build_compound_expr (expr.value, next.value); + expr.original_code = COMPOUND_EXPR; + } + return expr; +} + +/* Parse an expression and convert functions or arrays to + pointers. */ + +static struct c_expr +c_parser_expression_conv (c_parser *parser) +{ + struct c_expr expr; + expr = c_parser_expression (parser); + expr = default_function_array_conversion (expr); + return expr; +} + +/* Parse a non-empty list of expressions. If CONVERT_P, convert + functions and arrays to pointers. + + nonempty-expr-list: + assignment-expression + nonempty-expr-list , assignment-expression +*/ + +static tree +c_parser_expr_list (c_parser *parser, bool convert_p) +{ + struct c_expr expr; + tree ret, cur; + expr = c_parser_expr_no_commas (parser, NULL); + if (convert_p) + expr = default_function_array_conversion (expr); + ret = cur = build_tree_list (NULL_TREE, expr.value); + while (c_parser_next_token_is (parser, CPP_COMMA)) + { + c_parser_consume_token (parser); + expr = c_parser_expr_no_commas (parser, NULL); + if (convert_p) + expr = default_function_array_conversion (expr); + cur = TREE_CHAIN (cur) = build_tree_list (NULL_TREE, expr.value); + } + return ret; +} + + +/* Parse Objective-C-specific constructs. */ + +/* Parse an objc-class-definition. + + objc-class-definition: + @interface identifier objc-superclass[opt] objc-protocol-refs[opt] + objc-class-instance-variables[opt] objc-methodprotolist @end + @implementation identifier objc-superclass[opt] + objc-class-instance-variables[opt] + @interface identifier ( identifier ) objc-protocol-refs[opt] + objc-methodprotolist @end + @implementation identifier ( identifier ) + + objc-superclass: + : identifier + + "@interface identifier (" must start "@interface identifier ( + identifier ) ...": objc-methodprotolist in the first production may + not start with a parenthesized identifier as a declarator of a data + definition with no declaration specifiers if the objc-superclass, + objc-protocol-refs and objc-class-instance-variables are omitted. */ + +static void +c_parser_objc_class_definition (c_parser *parser) +{ + bool iface_p; + tree id1; + tree superclass; + if (c_parser_next_token_is_keyword (parser, RID_AT_INTERFACE)) + iface_p = true; + else if (c_parser_next_token_is_keyword (parser, RID_AT_IMPLEMENTATION)) + iface_p = false; + else + gcc_unreachable (); + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + return; + } + id1 = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + tree id2; + tree proto = NULL_TREE; + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + return; + } + id2 = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + if (!iface_p) + { + objc_start_category_implementation (id1, id2); + return; + } + if (c_parser_next_token_is (parser, CPP_LESS)) + proto = c_parser_objc_protocol_refs (parser); + objc_start_category_interface (id1, id2, proto); + c_parser_objc_methodprotolist (parser); + c_parser_require_keyword (parser, RID_AT_END, "expected %<@end%>"); + objc_finish_interface (); + return; + } + if (c_parser_next_token_is (parser, CPP_COLON)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + return; + } + superclass = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + else + superclass = NULL_TREE; + if (iface_p) + { + tree proto = NULL_TREE; + if (c_parser_next_token_is (parser, CPP_LESS)) + proto = c_parser_objc_protocol_refs (parser); + objc_start_class_interface (id1, superclass, proto); + } + else + objc_start_class_implementation (id1, superclass); + if (c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + c_parser_objc_class_instance_variables (parser); + if (iface_p) + { + objc_continue_interface (); + c_parser_objc_methodprotolist (parser); + c_parser_require_keyword (parser, RID_AT_END, "expected %<@end%>"); + objc_finish_interface (); + } + else + { + objc_continue_implementation (); + return; + } +} + +/* Parse objc-class-instance-variables. + + objc-class-instance-variables: + { objc-instance-variable-decl-list[opt] } + + objc-instance-variable-decl-list: + objc-visibility-spec + objc-instance-variable-decl ; + ; + objc-instance-variable-decl-list objc-visibility-spec + objc-instance-variable-decl-list objc-instance-variable-decl ; + objc-instance-variable-decl-list ; + + objc-visibility-spec: + @private + @protected + @public + + objc-instance-variable-decl: + struct-declaration +*/ + +static void +c_parser_objc_class_instance_variables (c_parser *parser) +{ + gcc_assert (c_parser_next_token_is (parser, CPP_OPEN_BRACE)); + c_parser_consume_token (parser); + while (c_parser_next_token_is_not (parser, CPP_EOF)) + { + tree decls; + /* Parse any stray semicolon. */ + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + if (pedantic) + pedwarn ("extra semicolon in struct or union specified"); + c_parser_consume_token (parser); + continue; + } + /* Stop if at the end of the instance variables. */ + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + { + c_parser_consume_token (parser); + break; + } + /* Parse any objc-visibility-spec. */ + if (c_parser_next_token_is_keyword (parser, RID_AT_PRIVATE)) + { + c_parser_consume_token (parser); + objc_set_visibility (2); + continue; + } + else if (c_parser_next_token_is_keyword (parser, RID_AT_PROTECTED)) + { + c_parser_consume_token (parser); + objc_set_visibility (0); + continue; + } + else if (c_parser_next_token_is_keyword (parser, RID_AT_PUBLIC)) + { + c_parser_consume_token (parser); + objc_set_visibility (1); + continue; + } + else if (c_parser_next_token_is (parser, CPP_PRAGMA)) + { + c_parser_pragma (parser, pragma_external); + continue; + } + + /* Parse some comma-separated declarations. */ + decls = c_parser_struct_declaration (parser); + { + /* Comma-separated instance variables are chained together in + reverse order; add them one by one. */ + tree ivar = nreverse (decls); + for (; ivar; ivar = TREE_CHAIN (ivar)) + objc_add_instance_variable (copy_node (ivar)); + } + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + } +} + +/* Parse an objc-class-declaration. + + objc-class-declaration: + @class identifier-list ; +*/ + +static void +c_parser_objc_class_declaration (c_parser *parser) +{ + tree list = NULL_TREE; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_AT_CLASS)); + c_parser_consume_token (parser); + /* Any identifiers, including those declared as type names, are OK + here. */ + while (true) + { + tree id; + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + break; + } + id = c_parser_peek_token (parser)->value; + list = chainon (list, build_tree_list (NULL_TREE, id)); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + objc_declare_class (list); +} + +/* Parse an objc-alias-declaration. + + objc-alias-declaration: + @compatibility_alias identifier identifier ; +*/ + +static void +c_parser_objc_alias_declaration (c_parser *parser) +{ + tree id1, id2; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_AT_ALIAS)); + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_SEMICOLON, NULL); + return; + } + id1 = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + c_parser_skip_until_found (parser, CPP_SEMICOLON, NULL); + return; + } + id2 = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + objc_declare_alias (id1, id2); +} + +/* Parse an objc-protocol-definition. + + objc-protocol-definition: + @protocol identifier objc-protocol-refs[opt] objc-methodprotolist @end + @protocol identifier-list ; + + "@protocol identifier ;" should be resolved as "@protocol + identifier-list ;": objc-methodprotolist may not start with a + semicolon in the first alternative if objc-protocol-refs are + omitted. */ + +static void +c_parser_objc_protocol_definition (c_parser *parser) +{ + gcc_assert (c_parser_next_token_is_keyword (parser, RID_AT_PROTOCOL)); + c_parser_consume_token (parser); + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + return; + } + if (c_parser_peek_2nd_token (parser)->type == CPP_COMMA + || c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON) + { + tree list = NULL_TREE; + /* Any identifiers, including those declared as type names, are + OK here. */ + while (true) + { + tree id; + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + break; + } + id = c_parser_peek_token (parser)->value; + list = chainon (list, build_tree_list (NULL_TREE, id)); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + objc_declare_protocols (list); + } + else + { + tree id = c_parser_peek_token (parser)->value; + tree proto = NULL_TREE; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_LESS)) + proto = c_parser_objc_protocol_refs (parser); + objc_pq_context = 1; + objc_start_protocol (id, proto); + c_parser_objc_methodprotolist (parser); + c_parser_require_keyword (parser, RID_AT_END, "expected %<@end%>"); + objc_pq_context = 0; + objc_finish_interface (); + } +} + +/* Parse an objc-method-type. + + objc-method-type: + + + - +*/ + +static enum tree_code +c_parser_objc_method_type (c_parser *parser) +{ + switch (c_parser_peek_token (parser)->type) + { + case CPP_PLUS: + c_parser_consume_token (parser); + return PLUS_EXPR; + case CPP_MINUS: + c_parser_consume_token (parser); + return MINUS_EXPR; + default: + gcc_unreachable (); + } +} + +/* Parse an objc-method-definition. + + objc-method-definition: + objc-method-type objc-method-decl ;[opt] compound-statement +*/ + +static void +c_parser_objc_method_definition (c_parser *parser) +{ + enum tree_code type = c_parser_objc_method_type (parser); + tree decl; + objc_set_method_type (type); + objc_pq_context = 1; + decl = c_parser_objc_method_decl (parser); + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + c_parser_consume_token (parser); + if (pedantic) + pedwarn ("extra semicolon in method definition specified"); + } + if (!c_parser_next_token_is (parser, CPP_OPEN_BRACE)) + { + c_parser_error (parser, "expected %<{%>"); + return; + } + objc_pq_context = 0; + objc_start_method_definition (decl); + add_stmt (c_parser_compound_statement (parser)); + objc_finish_method_definition (current_function_decl); +} + +/* Parse an objc-methodprotolist. + + objc-methodprotolist: + empty + objc-methodprotolist objc-methodproto + objc-methodprotolist declaration + objc-methodprotolist ; + + The declaration is a data definition, which may be missing + declaration specifiers under the same rules and diagnostics as + other data definitions outside functions, and the stray semicolon + is diagnosed the same way as a stray semicolon outside a + function. */ + +static void +c_parser_objc_methodprotolist (c_parser *parser) +{ + while (true) + { + /* The list is terminated by @end. */ + switch (c_parser_peek_token (parser)->type) + { + case CPP_SEMICOLON: + if (pedantic) + pedwarn ("ISO C does not allow extra %<;%> outside of a function"); + c_parser_consume_token (parser); + break; + case CPP_PLUS: + case CPP_MINUS: + c_parser_objc_methodproto (parser); + break; + case CPP_PRAGMA: + c_parser_pragma (parser, pragma_external); + break; + case CPP_EOF: + return; + default: + if (c_parser_next_token_is_keyword (parser, RID_AT_END)) + return; + c_parser_declaration_or_fndef (parser, false, true, false, true); + break; + } + } +} + +/* Parse an objc-methodproto. + + objc-methodproto: + objc-method-type objc-method-decl ; +*/ + +static void +c_parser_objc_methodproto (c_parser *parser) +{ + enum tree_code type = c_parser_objc_method_type (parser); + tree decl; + objc_set_method_type (type); + /* Remember protocol qualifiers in prototypes. */ + objc_pq_context = 1; + decl = c_parser_objc_method_decl (parser); + /* Forget protocol qualifiers here. */ + objc_pq_context = 0; + objc_add_method_declaration (decl); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); +} + +/* Parse an objc-method-decl. + + objc-method-decl: + ( objc-type-name ) objc-selector + objc-selector + ( objc-type-name ) objc-keyword-selector objc-optparmlist + objc-keyword-selector objc-optparmlist + + objc-keyword-selector: + objc-keyword-decl + objc-keyword-selector objc-keyword-decl + + objc-keyword-decl: + objc-selector : ( objc-type-name ) identifier + objc-selector : identifier + : ( objc-type-name ) identifier + : identifier + + objc-optparmlist: + objc-optparms objc-optellipsis + + objc-optparms: + empty + objc-opt-parms , parameter-declaration + + objc-optellipsis: + empty + , ... +*/ + +static tree +c_parser_objc_method_decl (c_parser *parser) +{ + tree type = NULL_TREE; + tree sel; + tree parms = NULL_TREE; + bool ellipsis = false; + + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + c_parser_consume_token (parser); + type = c_parser_objc_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + sel = c_parser_objc_selector (parser); + /* If there is no selector, or a colon follows, we have an + objc-keyword-selector. If there is a selector, and a colon does + not follow, that selector ends the objc-method-decl. */ + if (!sel || c_parser_next_token_is (parser, CPP_COLON)) + { + tree tsel = sel; + tree list = NULL_TREE; + while (true) + { + tree atype = NULL_TREE, id, keyworddecl; + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) + break; + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + c_parser_consume_token (parser); + atype = c_parser_objc_type_name (parser); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<)%>"); + } + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + return error_mark_node; + } + id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + keyworddecl = objc_build_keyword_decl (tsel, atype, id); + list = chainon (list, keyworddecl); + tsel = c_parser_objc_selector (parser); + if (!tsel && c_parser_next_token_is_not (parser, CPP_COLON)) + break; + } + /* Parse the optional parameter list. Optional Objective-C + method parameters follow the C syntax, and may include '...' + to denote a variable number of arguments. */ + parms = make_node (TREE_LIST); + while (c_parser_next_token_is (parser, CPP_COMMA)) + { + struct c_parm *parm; + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) + { + ellipsis = true; + c_parser_consume_token (parser); + break; + } + parm = c_parser_parameter_declaration (parser, NULL_TREE); + if (parm == NULL) + break; + parms = chainon (parms, + build_tree_list (NULL_TREE, grokparm (parm))); + } + sel = list; + } + return objc_build_method_signature (type, sel, parms, ellipsis); +} + +/* Parse an objc-type-name. + + objc-type-name: + objc-type-qualifiers[opt] type-name + objc-type-qualifiers[opt] + + objc-type-qualifiers: + objc-type-qualifier + objc-type-qualifiers objc-type-qualifier + + objc-type-qualifier: one of + in out inout bycopy byref oneway +*/ + +static tree +c_parser_objc_type_name (c_parser *parser) +{ + tree quals = NULL_TREE; + struct c_type_name *typename = NULL; + tree type = NULL_TREE; + while (true) + { + c_token *token = c_parser_peek_token (parser); + if (token->type == CPP_KEYWORD + && (token->keyword == RID_IN + || token->keyword == RID_OUT + || token->keyword == RID_INOUT + || token->keyword == RID_BYCOPY + || token->keyword == RID_BYREF + || token->keyword == RID_ONEWAY)) + { + quals = chainon (quals, build_tree_list (NULL_TREE, token->value)); + c_parser_consume_token (parser); + } + else + break; + } + if (c_parser_next_token_starts_typename (parser)) + typename = c_parser_type_name (parser); + if (typename) + type = groktypename (typename); + return build_tree_list (quals, type); +} + +/* Parse objc-protocol-refs. + + objc-protocol-refs: + < identifier-list > +*/ + +static tree +c_parser_objc_protocol_refs (c_parser *parser) +{ + tree list = NULL_TREE; + gcc_assert (c_parser_next_token_is (parser, CPP_LESS)); + c_parser_consume_token (parser); + /* Any identifiers, including those declared as type names, are OK + here. */ + while (true) + { + tree id; + if (c_parser_next_token_is_not (parser, CPP_NAME)) + { + c_parser_error (parser, "expected identifier"); + break; + } + id = c_parser_peek_token (parser)->value; + list = chainon (list, build_tree_list (NULL_TREE, id)); + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COMMA)) + c_parser_consume_token (parser); + else + break; + } + c_parser_require (parser, CPP_GREATER, "expected %<>%>"); + return list; +} + +/* Parse an objc-try-catch-statement. + + objc-try-catch-statement: + @try compound-statement objc-catch-list[opt] + @try compound-statement objc-catch-list[opt] @finally compound-statement + + objc-catch-list: + @catch ( parameter-declaration ) compound-statement + objc-catch-list @catch ( parameter-declaration ) compound-statement +*/ + +static void +c_parser_objc_try_catch_statement (c_parser *parser) +{ + location_t loc; + tree stmt; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_AT_TRY)); + c_parser_consume_token (parser); + loc = c_parser_peek_token (parser)->location; + stmt = c_parser_compound_statement (parser); + objc_begin_try_stmt (loc, stmt); + while (c_parser_next_token_is_keyword (parser, RID_AT_CATCH)) + { + struct c_parm *parm; + c_parser_consume_token (parser); + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + break; + parm = c_parser_parameter_declaration (parser, NULL_TREE); + if (parm == NULL) + { + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); + break; + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + objc_begin_catch_clause (grokparm (parm)); + if (c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) + c_parser_compound_statement_nostart (parser); + objc_finish_catch_clause (); + } + if (c_parser_next_token_is_keyword (parser, RID_AT_FINALLY)) + { + location_t finloc; + tree finstmt; + c_parser_consume_token (parser); + finloc = c_parser_peek_token (parser)->location; + finstmt = c_parser_compound_statement (parser); + objc_build_finally_clause (finloc, finstmt); + } + objc_finish_try_stmt (); +} + +/* Parse an objc-synchronized-statement. + + objc-synchronized-statement: + @synchronized ( expression ) compound-statement +*/ + +static void +c_parser_objc_synchronized_statement (c_parser *parser) +{ + location_t loc; + tree expr, stmt; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_AT_SYNCHRONIZED)); + c_parser_consume_token (parser); + loc = c_parser_peek_token (parser)->location; + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + expr = c_parser_expression (parser).value; + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + else + expr = error_mark_node; + stmt = c_parser_compound_statement (parser); + objc_build_synchronized (loc, expr, stmt); +} + +/* Parse an objc-selector; return NULL_TREE without an error if the + next token is not an objc-selector. + + objc-selector: + identifier + one of + enum struct union if else while do for switch case default + break continue return goto asm sizeof typeof __alignof + unsigned long const short volatile signed restrict _Complex + in out inout bycopy byref oneway int char float double void _Bool + + ??? Why this selection of keywords but not, for example, storage + class specifiers? */ + +static tree +c_parser_objc_selector (c_parser *parser) +{ + c_token *token = c_parser_peek_token (parser); + tree value = token->value; + if (token->type == CPP_NAME) + { + c_parser_consume_token (parser); + return value; + } + if (token->type != CPP_KEYWORD) + return NULL_TREE; + switch (token->keyword) + { + case RID_ENUM: + case RID_STRUCT: + case RID_UNION: + case RID_IF: + case RID_ELSE: + case RID_WHILE: + case RID_DO: + case RID_FOR: + case RID_SWITCH: + case RID_CASE: + case RID_DEFAULT: + case RID_BREAK: + case RID_CONTINUE: + case RID_RETURN: + case RID_GOTO: + case RID_ASM: + case RID_SIZEOF: + case RID_TYPEOF: + case RID_ALIGNOF: + case RID_UNSIGNED: + case RID_LONG: + case RID_CONST: + case RID_SHORT: + case RID_VOLATILE: + case RID_SIGNED: + case RID_RESTRICT: + case RID_COMPLEX: + case RID_IN: + case RID_OUT: + case RID_INOUT: + case RID_BYCOPY: + case RID_BYREF: + case RID_ONEWAY: + case RID_INT: + case RID_CHAR: + case RID_FLOAT: + case RID_DOUBLE: + case RID_VOID: + case RID_BOOL: + c_parser_consume_token (parser); + return value; + default: + return NULL_TREE; + } +} + +/* Parse an objc-selector-arg. + + objc-selector-arg: + objc-selector + objc-keywordname-list + + objc-keywordname-list: + objc-keywordname + objc-keywordname-list objc-keywordname + + objc-keywordname: + objc-selector : + : +*/ + +static tree +c_parser_objc_selector_arg (c_parser *parser) +{ + tree sel = c_parser_objc_selector (parser); + tree list = NULL_TREE; + if (sel && c_parser_next_token_is_not (parser, CPP_COLON)) + return sel; + while (true) + { + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) + return list; + list = chainon (list, build_tree_list (sel, NULL_TREE)); + sel = c_parser_objc_selector (parser); + if (!sel && c_parser_next_token_is_not (parser, CPP_COLON)) + break; + } + return list; +} + +/* Parse an objc-receiver. + + objc-receiver: + expression + class-name + type-name +*/ + +static tree +c_parser_objc_receiver (c_parser *parser) +{ + if (c_parser_peek_token (parser)->type == CPP_NAME + && (c_parser_peek_token (parser)->id_kind == C_ID_TYPENAME + || c_parser_peek_token (parser)->id_kind == C_ID_CLASSNAME)) + { + tree id = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + return objc_get_class_reference (id); + } + return c_parser_expression (parser).value; +} + +/* Parse objc-message-args. + + objc-message-args: + objc-selector + objc-keywordarg-list + + objc-keywordarg-list: + objc-keywordarg + objc-keywordarg-list objc-keywordarg + + objc-keywordarg: + objc-selector : objc-keywordexpr + : objc-keywordexpr +*/ + +static tree +c_parser_objc_message_args (c_parser *parser) +{ + tree sel = c_parser_objc_selector (parser); + tree list = NULL_TREE; + if (sel && c_parser_next_token_is_not (parser, CPP_COLON)) + return sel; + while (true) + { + tree keywordexpr; + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) + return list; + keywordexpr = c_parser_objc_keywordexpr (parser); + list = chainon (list, build_tree_list (sel, keywordexpr)); + sel = c_parser_objc_selector (parser); + if (!sel && c_parser_next_token_is_not (parser, CPP_COLON)) + break; + } + return list; +} + +/* Parse an objc-keywordexpr. + + objc-keywordexpr: + nonempty-expr-list +*/ + +static tree +c_parser_objc_keywordexpr (c_parser *parser) +{ + tree list = c_parser_expr_list (parser, true); + if (TREE_CHAIN (list) == NULL_TREE) + { + /* Just return the expression, remove a level of + indirection. */ + return TREE_VALUE (list); + } + else + { + /* We have a comma expression, we will collapse later. */ + return list; + } +} + + +/* Handle pragmas. Some OpenMP pragmas are associated with, and therefore + should be considered, statements. ALLOW_STMT is true if we're within + the context of a function and such pragmas are to be allowed. Returns + true if we actually parsed such a pragma. */ + +static bool +c_parser_pragma (c_parser *parser, enum pragma_context context) +{ + unsigned int id; + + id = c_parser_peek_token (parser)->pragma_kind; + gcc_assert (id != PRAGMA_NONE); + + switch (id) + { + case PRAGMA_OMP_BARRIER: + if (context != pragma_compound) + { + if (context == pragma_stmt) + c_parser_error (parser, "%<#pragma omp barrier%> may only be " + "used in compound statements"); + goto bad_stmt; + } + c_parser_omp_barrier (parser); + return false; + + case PRAGMA_OMP_FLUSH: + if (context != pragma_compound) + { + if (context == pragma_stmt) + c_parser_error (parser, "%<#pragma omp flush%> may only be " + "used in compound statements"); + goto bad_stmt; + } + c_parser_omp_flush (parser); + return false; + + case PRAGMA_OMP_THREADPRIVATE: + c_parser_omp_threadprivate (parser); + return false; + + case PRAGMA_OMP_SECTION: + error ("%<#pragma omp section%> may only be used in " + "%<#pragma omp sections%> construct"); + c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); + return false; + + case PRAGMA_GCC_PCH_PREPROCESS: + c_parser_error (parser, "%<#pragma GCC pch_preprocess%> must be first"); + c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); + return false; + + default: + if (id < PRAGMA_FIRST_EXTERNAL) + { + if (context == pragma_external) + { + bad_stmt: + c_parser_error (parser, "expected declaration specifiers"); + c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); + return false; + } + c_parser_omp_construct (parser); + return true; + } + break; + } + + c_parser_consume_pragma (parser); + c_invoke_pragma_handler (id); + + /* Skip to EOL, but suppress any error message. Those will have been + generated by the handler routine through calling error, as opposed + to calling c_parser_error. */ + parser->error = true; + c_parser_skip_to_pragma_eol (parser); + + return false; +} + +/* The interface the pragma parsers have to the lexer. */ + +enum cpp_ttype +pragma_lex (tree *value) +{ + c_token *tok = c_parser_peek_token (the_parser); + enum cpp_ttype ret = tok->type; + + *value = tok->value; + if (ret == CPP_PRAGMA_EOL || ret == CPP_EOF) + ret = CPP_EOF; + else + { + if (ret == CPP_KEYWORD) + ret = CPP_NAME; + c_parser_consume_token (the_parser); + } + + return ret; +} + +static void +c_parser_pragma_pch_preprocess (c_parser *parser) +{ + tree name = NULL; + + c_parser_consume_pragma (parser); + if (c_parser_next_token_is (parser, CPP_STRING)) + { + name = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + } + else + c_parser_error (parser, "expected string literal"); + c_parser_skip_to_pragma_eol (parser); + + if (name) + c_common_pch_pragma (parse_in, TREE_STRING_POINTER (name)); +} + +/* OpenMP 2.5 parsing routines. */ + +/* Returns name of the next clause. + If the clause is not recognized PRAGMA_OMP_CLAUSE_NONE is returned and + the token is not consumed. Otherwise appropriate pragma_omp_clause is + returned and the token is consumed. */ + +static pragma_omp_clause +c_parser_omp_clause_name (c_parser *parser) +{ + pragma_omp_clause result = PRAGMA_OMP_CLAUSE_NONE; + + if (c_parser_next_token_is_keyword (parser, RID_IF)) + result = PRAGMA_OMP_CLAUSE_IF; + else if (c_parser_next_token_is_keyword (parser, RID_DEFAULT)) + result = PRAGMA_OMP_CLAUSE_DEFAULT; + else if (c_parser_next_token_is (parser, CPP_NAME)) + { + const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); + + switch (p[0]) + { + case 'c': + if (!strcmp ("copyin", p)) + result = PRAGMA_OMP_CLAUSE_COPYIN; + else if (!strcmp ("copyprivate", p)) + result = PRAGMA_OMP_CLAUSE_COPYPRIVATE; + break; + case 'f': + if (!strcmp ("firstprivate", p)) + result = PRAGMA_OMP_CLAUSE_FIRSTPRIVATE; + break; + case 'l': + if (!strcmp ("lastprivate", p)) + result = PRAGMA_OMP_CLAUSE_LASTPRIVATE; + break; + case 'n': + if (!strcmp ("nowait", p)) + result = PRAGMA_OMP_CLAUSE_NOWAIT; + else if (!strcmp ("num_threads", p)) + result = PRAGMA_OMP_CLAUSE_NUM_THREADS; + break; + case 'o': + if (!strcmp ("ordered", p)) + result = PRAGMA_OMP_CLAUSE_ORDERED; + break; + case 'p': + if (!strcmp ("private", p)) + result = PRAGMA_OMP_CLAUSE_PRIVATE; + break; + case 'r': + if (!strcmp ("reduction", p)) + result = PRAGMA_OMP_CLAUSE_REDUCTION; + break; + case 's': + if (!strcmp ("schedule", p)) + result = PRAGMA_OMP_CLAUSE_SCHEDULE; + else if (!strcmp ("shared", p)) + result = PRAGMA_OMP_CLAUSE_SHARED; + break; + } + } + + if (result != PRAGMA_OMP_CLAUSE_NONE) + c_parser_consume_token (parser); + + return result; +} + +/* Validate that a clause of the given type does not already exist. */ + +static void +check_no_duplicate_clause (tree clauses, enum tree_code code, const char *name) +{ + tree c; + + for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == code) + { + error ("too many %qs clauses", name); + break; + } +} + +/* OpenMP 2.5: + variable-list: + identifier + variable-list , identifier + + If KIND is nonzero, create the appropriate node and install the decl + in OMP_CLAUSE_DECL and add the node to the head of the list. + + If KIND is zero, create a TREE_LIST with the decl in TREE_PURPOSE; + return the list created. */ + +static tree +c_parser_omp_variable_list (c_parser *parser, enum omp_clause_code kind, + tree list) +{ + if (c_parser_next_token_is_not (parser, CPP_NAME) + || c_parser_peek_token (parser)->id_kind != C_ID_ID) + c_parser_error (parser, "expected identifier"); + + while (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_token (parser)->id_kind == C_ID_ID) + { + tree t = lookup_name (c_parser_peek_token (parser)->value); + + if (t == NULL_TREE) + undeclared_variable (c_parser_peek_token (parser)->value, + c_parser_peek_token (parser)->location); + else if (t == error_mark_node) + ; + else if (kind != 0) + { + tree u = build_omp_clause (kind); + OMP_CLAUSE_DECL (u) = t; + OMP_CLAUSE_CHAIN (u) = list; + list = u; + } + else + list = tree_cons (t, NULL_TREE, list); + + c_parser_consume_token (parser); + + if (c_parser_next_token_is_not (parser, CPP_COMMA)) + break; + + c_parser_consume_token (parser); + } + + return list; +} + +/* Similarly, but expect leading and trailing parenthesis. This is a very + common case for omp clauses. */ + +static tree +c_parser_omp_var_list_parens (c_parser *parser, enum tree_code kind, tree list) +{ + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + list = c_parser_omp_variable_list (parser, kind, list); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + return list; +} + +/* OpenMP 2.5: + copyin ( variable-list ) */ + +static tree +c_parser_omp_clause_copyin (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_COPYIN, list); +} + +/* OpenMP 2.5: + copyprivate ( variable-list ) */ + +static tree +c_parser_omp_clause_copyprivate (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_COPYPRIVATE, list); +} + +/* OpenMP 2.5: + default ( shared | none ) */ + +static tree +c_parser_omp_clause_default (c_parser *parser, tree list) +{ + enum omp_clause_default_kind kind = OMP_CLAUSE_DEFAULT_UNSPECIFIED; + tree c; + + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + return list; + if (c_parser_next_token_is (parser, CPP_NAME)) + { + const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); + + switch (p[0]) + { + case 'n': + if (strcmp ("none", p) != 0) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_NONE; + break; + + case 's': + if (strcmp ("shared", p) != 0) + goto invalid_kind; + kind = OMP_CLAUSE_DEFAULT_SHARED; + break; + + default: + goto invalid_kind; + } + + c_parser_consume_token (parser); + } + else + { + invalid_kind: + c_parser_error (parser, "expected % or %"); + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + + if (kind == OMP_CLAUSE_DEFAULT_UNSPECIFIED) + return list; + + check_no_duplicate_clause (list, OMP_CLAUSE_DEFAULT, "default"); + c = build_omp_clause (OMP_CLAUSE_DEFAULT); + OMP_CLAUSE_CHAIN (c) = list; + OMP_CLAUSE_DEFAULT_KIND (c) = kind; + + return c; +} + +/* OpenMP 2.5: + firstprivate ( variable-list ) */ + +static tree +c_parser_omp_clause_firstprivate (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_FIRSTPRIVATE, list); +} + +/* OpenMP 2.5: + if ( expression ) */ + +static tree +c_parser_omp_clause_if (c_parser *parser, tree list) +{ + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + tree t = c_parser_paren_condition (parser); + tree c; + + check_no_duplicate_clause (list, OMP_CLAUSE_IF, "if"); + + c = build_omp_clause (OMP_CLAUSE_IF); + OMP_CLAUSE_IF_EXPR (c) = t; + OMP_CLAUSE_CHAIN (c) = list; + list = c; + } + else + c_parser_error (parser, "expected %<(%>"); + + return list; +} + +/* OpenMP 2.5: + lastprivate ( variable-list ) */ + +static tree +c_parser_omp_clause_lastprivate (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_LASTPRIVATE, list); +} + +/* OpenMP 2.5: + nowait */ + +static tree +c_parser_omp_clause_nowait (c_parser *parser ATTRIBUTE_UNUSED, tree list) +{ + tree c; + + check_no_duplicate_clause (list, OMP_CLAUSE_NOWAIT, "nowait"); + + c = build_omp_clause (OMP_CLAUSE_NOWAIT); + OMP_CLAUSE_CHAIN (c) = list; + return c; +} + +/* OpenMP 2.5: + num_threads ( expression ) */ + +static tree +c_parser_omp_clause_num_threads (c_parser *parser, tree list) +{ + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + tree c, t = c_parser_expression (parser).value; + + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + + if (!INTEGRAL_TYPE_P (TREE_TYPE (t))) + { + c_parser_error (parser, "expected integer expression"); + return list; + } + + /* Attempt to statically determine when the number isn't positive. */ + c = fold_build2 (LE_EXPR, boolean_type_node, t, + build_int_cst (TREE_TYPE (t), 0)); + if (c == boolean_true_node) + { + warning (0, "% value must be positive"); + t = integer_one_node; + } + + check_no_duplicate_clause (list, OMP_CLAUSE_NUM_THREADS, "num_threads"); + + c = build_omp_clause (OMP_CLAUSE_NUM_THREADS); + OMP_CLAUSE_NUM_THREADS_EXPR (c) = t; + OMP_CLAUSE_CHAIN (c) = list; + list = c; + } + + return list; +} + +/* OpenMP 2.5: + ordered */ + +static tree +c_parser_omp_clause_ordered (c_parser *parser ATTRIBUTE_UNUSED, tree list) +{ + tree c; + + check_no_duplicate_clause (list, OMP_CLAUSE_ORDERED, "ordered"); + + c = build_omp_clause (OMP_CLAUSE_ORDERED); + OMP_CLAUSE_CHAIN (c) = list; + return c; +} + +/* OpenMP 2.5: + private ( variable-list ) */ + +static tree +c_parser_omp_clause_private (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_PRIVATE, list); +} + +/* OpenMP 2.5: + reduction ( reduction-operator : variable-list ) + + reduction-operator: + One of: + * - & ^ | && || */ + +static tree +c_parser_omp_clause_reduction (c_parser *parser, tree list) +{ + if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + { + enum tree_code code; + + switch (c_parser_peek_token (parser)->type) + { + case CPP_PLUS: + code = PLUS_EXPR; + break; + case CPP_MULT: + code = MULT_EXPR; + break; + case CPP_MINUS: + code = MINUS_EXPR; + break; + case CPP_AND: + code = BIT_AND_EXPR; + break; + case CPP_XOR: + code = BIT_XOR_EXPR; + break; + case CPP_OR: + code = BIT_IOR_EXPR; + break; + case CPP_AND_AND: + code = TRUTH_ANDIF_EXPR; + break; + case CPP_OR_OR: + code = TRUTH_ORIF_EXPR; + break; + default: + c_parser_error (parser, + "expected %<+%>, %<*%>, %<-%>, %<&%>, " + "%<^%>, %<|%>, %<&&%>, or %<||%>"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, 0); + return list; + } + c_parser_consume_token (parser); + if (c_parser_require (parser, CPP_COLON, "expected %<:%>")) + { + tree nl, c; + + nl = c_parser_omp_variable_list (parser, OMP_CLAUSE_REDUCTION, list); + for (c = nl; c != list; c = OMP_CLAUSE_CHAIN (c)) + OMP_CLAUSE_REDUCTION_CODE (c) = code; + + list = nl; + } + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + return list; +} + +/* OpenMP 2.5: + schedule ( schedule-kind ) + schedule ( schedule-kind , expression ) + + schedule-kind: + static | dynamic | guided | runtime +*/ + +static tree +c_parser_omp_clause_schedule (c_parser *parser, tree list) +{ + tree c, t; + + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + return list; + + c = build_omp_clause (OMP_CLAUSE_SCHEDULE); + + if (c_parser_next_token_is (parser, CPP_NAME)) + { + tree kind = c_parser_peek_token (parser)->value; + const char *p = IDENTIFIER_POINTER (kind); + + switch (p[0]) + { + case 'd': + if (strcmp ("dynamic", p) != 0) + goto invalid_kind; + OMP_CLAUSE_SCHEDULE_KIND (c) = OMP_CLAUSE_SCHEDULE_DYNAMIC; + break; + + case 'g': + if (strcmp ("guided", p) != 0) + goto invalid_kind; + OMP_CLAUSE_SCHEDULE_KIND (c) = OMP_CLAUSE_SCHEDULE_GUIDED; + break; + + case 'r': + if (strcmp ("runtime", p) != 0) + goto invalid_kind; + OMP_CLAUSE_SCHEDULE_KIND (c) = OMP_CLAUSE_SCHEDULE_RUNTIME; + break; + + default: + goto invalid_kind; + } + } + else if (c_parser_next_token_is_keyword (parser, RID_STATIC)) + OMP_CLAUSE_SCHEDULE_KIND (c) = OMP_CLAUSE_SCHEDULE_STATIC; + else + goto invalid_kind; + + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_COMMA)) + { + c_parser_consume_token (parser); + + t = c_parser_expr_no_commas (parser, NULL).value; + + if (OMP_CLAUSE_SCHEDULE_KIND (c) == OMP_CLAUSE_SCHEDULE_RUNTIME) + error ("schedule % does not take " + "a % parameter"); + else if (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE) + OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c) = t; + else + c_parser_error (parser, "expected integer expression"); + + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + else + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, + "expected %<,%> or %<)%>"); + + check_no_duplicate_clause (list, OMP_CLAUSE_SCHEDULE, "schedule"); + OMP_CLAUSE_CHAIN (c) = list; + return c; + + invalid_kind: + c_parser_error (parser, "invalid schedule kind"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, 0); + return list; +} + +/* OpenMP 2.5: + shared ( variable-list ) */ + +static tree +c_parser_omp_clause_shared (c_parser *parser, tree list) +{ + return c_parser_omp_var_list_parens (parser, OMP_CLAUSE_SHARED, list); +} + +/* Parse all OpenMP clauses. The set clauses allowed by the directive + is a bitmask in MASK. Return the list of clauses found; the result + of clause default goes in *pdefault. */ + +static tree +c_parser_omp_all_clauses (c_parser *parser, unsigned int mask, + const char *where) +{ + tree clauses = NULL; + + while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL)) + { + const pragma_omp_clause c_kind = c_parser_omp_clause_name (parser); + const char *c_name; + tree prev = clauses; + + switch (c_kind) + { + case PRAGMA_OMP_CLAUSE_COPYIN: + clauses = c_parser_omp_clause_copyin (parser, clauses); + c_name = "copyin"; + break; + case PRAGMA_OMP_CLAUSE_COPYPRIVATE: + clauses = c_parser_omp_clause_copyprivate (parser, clauses); + c_name = "copyprivate"; + break; + case PRAGMA_OMP_CLAUSE_DEFAULT: + clauses = c_parser_omp_clause_default (parser, clauses); + c_name = "default"; + break; + case PRAGMA_OMP_CLAUSE_FIRSTPRIVATE: + clauses = c_parser_omp_clause_firstprivate (parser, clauses); + c_name = "firstprivate"; + break; + case PRAGMA_OMP_CLAUSE_IF: + clauses = c_parser_omp_clause_if (parser, clauses); + c_name = "if"; + break; + case PRAGMA_OMP_CLAUSE_LASTPRIVATE: + clauses = c_parser_omp_clause_lastprivate (parser, clauses); + c_name = "lastprivate"; + break; + case PRAGMA_OMP_CLAUSE_NOWAIT: + clauses = c_parser_omp_clause_nowait (parser, clauses); + c_name = "nowait"; + break; + case PRAGMA_OMP_CLAUSE_NUM_THREADS: + clauses = c_parser_omp_clause_num_threads (parser, clauses); + c_name = "num_threads"; + break; + case PRAGMA_OMP_CLAUSE_ORDERED: + clauses = c_parser_omp_clause_ordered (parser, clauses); + c_name = "ordered"; + break; + case PRAGMA_OMP_CLAUSE_PRIVATE: + clauses = c_parser_omp_clause_private (parser, clauses); + c_name = "private"; + break; + case PRAGMA_OMP_CLAUSE_REDUCTION: + clauses = c_parser_omp_clause_reduction (parser, clauses); + c_name = "reduction"; + break; + case PRAGMA_OMP_CLAUSE_SCHEDULE: + clauses = c_parser_omp_clause_schedule (parser, clauses); + c_name = "schedule"; + break; + case PRAGMA_OMP_CLAUSE_SHARED: + clauses = c_parser_omp_clause_shared (parser, clauses); + c_name = "shared"; + break; + default: + c_parser_error (parser, "expected %<#pragma omp%> clause"); + goto saw_error; + } + + if (((mask >> c_kind) & 1) == 0 && !parser->error) + { + /* Remove the invalid clause(s) from the list to avoid + confusing the rest of the compiler. */ + clauses = prev; + error ("%qs is not valid for %qs", c_name, where); + } + } + + saw_error: + c_parser_skip_to_pragma_eol (parser); + + return c_finish_omp_clauses (clauses); +} + +/* OpenMP 2.5: + structured-block: + statement + + In practice, we're also interested in adding the statement to an + outer node. So it is convenient if we work around the fact that + c_parser_statement calls add_stmt. */ + +static tree +c_parser_omp_structured_block (c_parser *parser) +{ + tree stmt = push_stmt_list (); + c_parser_statement (parser); + return pop_stmt_list (stmt); +} + +/* OpenMP 2.5: + # pragma omp atomic new-line + expression-stmt + + expression-stmt: + x binop= expr | x++ | ++x | x-- | --x + binop: + +, *, -, /, &, ^, |, <<, >> + + where x is an lvalue expression with scalar type. */ + +static void +c_parser_omp_atomic (c_parser *parser) +{ + tree lhs, rhs; + tree stmt; + enum tree_code code; + + c_parser_skip_to_pragma_eol (parser); + + lhs = c_parser_unary_expression (parser).value; + switch (TREE_CODE (lhs)) + { + case ERROR_MARK: + saw_error: + c_parser_skip_to_end_of_block_or_statement (parser); + return; + + case PREINCREMENT_EXPR: + case POSTINCREMENT_EXPR: + lhs = TREE_OPERAND (lhs, 0); + code = PLUS_EXPR; + rhs = integer_one_node; + break; + + case PREDECREMENT_EXPR: + case POSTDECREMENT_EXPR: + lhs = TREE_OPERAND (lhs, 0); + code = MINUS_EXPR; + rhs = integer_one_node; + break; + + default: + switch (c_parser_peek_token (parser)->type) + { + case CPP_MULT_EQ: + code = MULT_EXPR; + break; + case CPP_DIV_EQ: + code = TRUNC_DIV_EXPR; + break; + case CPP_PLUS_EQ: + code = PLUS_EXPR; + break; + case CPP_MINUS_EQ: + code = MINUS_EXPR; + break; + case CPP_LSHIFT_EQ: + code = LSHIFT_EXPR; + break; + case CPP_RSHIFT_EQ: + code = RSHIFT_EXPR; + break; + case CPP_AND_EQ: + code = BIT_AND_EXPR; + break; + case CPP_OR_EQ: + code = BIT_IOR_EXPR; + break; + case CPP_XOR_EQ: + code = BIT_XOR_EXPR; + break; + default: + c_parser_error (parser, + "invalid operator for %<#pragma omp atomic%>"); + goto saw_error; + } + + c_parser_consume_token (parser); + rhs = c_parser_expression (parser).value; + break; + } + stmt = c_finish_omp_atomic (code, lhs, rhs); + if (stmt != error_mark_node) + add_stmt (stmt); + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); +} + + +/* OpenMP 2.5: + # pragma omp barrier new-line +*/ + +static void +c_parser_omp_barrier (c_parser *parser) +{ + c_parser_consume_pragma (parser); + c_parser_skip_to_pragma_eol (parser); + + c_finish_omp_barrier (); +} + +/* OpenMP 2.5: + # pragma omp critical [(name)] new-line + structured-block +*/ + +static tree +c_parser_omp_critical (c_parser *parser) +{ + tree stmt, name = NULL; + + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + { + c_parser_consume_token (parser); + if (c_parser_next_token_is (parser, CPP_NAME)) + { + name = c_parser_peek_token (parser)->value; + c_parser_consume_token (parser); + c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + } + else + c_parser_error (parser, "expected identifier"); + } + else if (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL)) + c_parser_error (parser, "expected %<(%> or end of line"); + c_parser_skip_to_pragma_eol (parser); + + stmt = c_parser_omp_structured_block (parser); + return c_finish_omp_critical (stmt, name); +} + +/* OpenMP 2.5: + # pragma omp flush flush-vars[opt] new-line + + flush-vars: + ( variable-list ) */ + +static void +c_parser_omp_flush (c_parser *parser) +{ + c_parser_consume_pragma (parser); + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) + c_parser_omp_var_list_parens (parser, 0, NULL); + else if (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL)) + c_parser_error (parser, "expected %<(%> or end of line"); + c_parser_skip_to_pragma_eol (parser); + + c_finish_omp_flush (); +} + +/* Parse the restricted form of the for statment allowed by OpenMP. + The real trick here is to determine the loop control variable early + so that we can push a new decl if necessary to make it private. */ + +static tree +c_parser_omp_for_loop (c_parser *parser) +{ + tree decl, cond, incr, save_break, save_cont, body, init; + location_t loc; + + if (!c_parser_next_token_is_keyword (parser, RID_FOR)) + { + c_parser_error (parser, "for statement expected"); + return NULL; + } + loc = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + + if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + return NULL; + + /* Parse the initialization declaration or expression. */ + if (c_parser_next_token_starts_declspecs (parser)) + { + c_parser_declaration_or_fndef (parser, true, true, true, true); + decl = check_for_loop_decls (); + if (decl == NULL) + goto error_init; + init = decl; + } + else if (c_parser_next_token_is (parser, CPP_NAME) + && c_parser_peek_2nd_token (parser)->type == CPP_EQ) + { + decl = c_parser_postfix_expression (parser).value; + + c_parser_require (parser, CPP_EQ, "expected %<=%>"); + + init = c_parser_expr_no_commas (parser, NULL).value; + init = build_modify_expr (decl, NOP_EXPR, init); + init = c_process_expr_stmt (init); + + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + } + else + goto error_init; + + /* Parse the loop condition. */ + cond = NULL_TREE; + if (c_parser_next_token_is_not (parser, CPP_SEMICOLON)) + { + cond = c_parser_expression_conv (parser).value; + cond = c_objc_common_truthvalue_conversion (cond); + if (EXPR_P (cond)) + SET_EXPR_LOCATION (cond, input_location); + } + c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); + + /* Parse the increment expression. */ + incr = NULL_TREE; + if (c_parser_next_token_is_not (parser, CPP_CLOSE_PAREN)) + incr = c_process_expr_stmt (c_parser_expression (parser).value); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + + parse_body: + save_break = c_break_label; + c_break_label = size_one_node; + save_cont = c_cont_label; + c_cont_label = NULL_TREE; + body = push_stmt_list (); + + add_stmt (c_parser_c99_block_statement (parser)); + if (c_cont_label) + add_stmt (build1 (LABEL_EXPR, void_type_node, c_cont_label)); + + body = pop_stmt_list (body); + c_break_label = save_break; + c_cont_label = save_cont; + + /* Only bother calling c_finish_omp_for if we havn't already generated + an error from the initialization parsing. */ + if (decl != NULL && decl != error_mark_node && init != error_mark_node) + return c_finish_omp_for (loc, decl, init, cond, incr, body, NULL); + return NULL; + + error_init: + c_parser_error (parser, "expected iteration declaration or initialization"); + c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); + decl = init = cond = incr = NULL_TREE; + goto parse_body; +} + +/* OpenMP 2.5: + #pragma omp for for-clause[optseq] new-line + for-loop +*/ + +#define OMP_FOR_CLAUSE_MASK \ + ( (1u << PRAGMA_OMP_CLAUSE_PRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_FIRSTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_LASTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_REDUCTION) \ + | (1u << PRAGMA_OMP_CLAUSE_ORDERED) \ + | (1u << PRAGMA_OMP_CLAUSE_SCHEDULE) \ + | (1u << PRAGMA_OMP_CLAUSE_NOWAIT)) + +static tree +c_parser_omp_for (c_parser *parser) +{ + tree block, clauses, ret; + + clauses = c_parser_omp_all_clauses (parser, OMP_FOR_CLAUSE_MASK, + "#pragma omp for"); + + block = c_begin_compound_stmt (true); + ret = c_parser_omp_for_loop (parser); + if (ret) + OMP_FOR_CLAUSES (ret) = clauses; + block = c_end_compound_stmt (block, true); + add_stmt (block); + + return ret; +} + +/* OpenMP 2.5: + # pragma omp master new-line + structured-block +*/ + +static tree +c_parser_omp_master (c_parser *parser) +{ + c_parser_skip_to_pragma_eol (parser); + return c_finish_omp_master (c_parser_omp_structured_block (parser)); +} + +/* OpenMP 2.5: + # pragma omp ordered new-line + structured-block +*/ + +static tree +c_parser_omp_ordered (c_parser *parser) +{ + c_parser_skip_to_pragma_eol (parser); + return c_finish_omp_ordered (c_parser_omp_structured_block (parser)); +} + +/* OpenMP 2.5: + + section-scope: + { section-sequence } + + section-sequence: + section-directive[opt] structured-block + section-sequence section-directive structured-block */ + +static tree +c_parser_omp_sections_scope (c_parser *parser) +{ + tree stmt, substmt; + bool error_suppress = false; + location_t loc; + + if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) + { + /* Avoid skipping until the end of the block. */ + parser->error = false; + return NULL_TREE; + } + + stmt = push_stmt_list (); + + loc = c_parser_peek_token (parser)->location; + if (c_parser_peek_token (parser)->pragma_kind != PRAGMA_OMP_SECTION) + { + substmt = push_stmt_list (); + + while (1) + { + c_parser_statement (parser); + + if (c_parser_peek_token (parser)->pragma_kind == PRAGMA_OMP_SECTION) + break; + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + break; + if (c_parser_next_token_is (parser, CPP_EOF)) + break; + } + + substmt = pop_stmt_list (substmt); + substmt = build1 (OMP_SECTION, void_type_node, substmt); + SET_EXPR_LOCATION (substmt, loc); + add_stmt (substmt); + } + + while (1) + { + if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) + break; + if (c_parser_next_token_is (parser, CPP_EOF)) + break; + + loc = c_parser_peek_token (parser)->location; + if (c_parser_peek_token (parser)->pragma_kind == PRAGMA_OMP_SECTION) + { + c_parser_consume_pragma (parser); + c_parser_skip_to_pragma_eol (parser); + error_suppress = false; + } + else if (!error_suppress) + { + error ("expected %<#pragma omp section%> or %<}%>"); + error_suppress = true; + } + + substmt = c_parser_omp_structured_block (parser); + substmt = build1 (OMP_SECTION, void_type_node, substmt); + SET_EXPR_LOCATION (substmt, loc); + add_stmt (substmt); + } + c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, + "expected %<#pragma omp section%> or %<}%>"); + + substmt = pop_stmt_list (stmt); + + stmt = make_node (OMP_SECTIONS); + TREE_TYPE (stmt) = void_type_node; + OMP_SECTIONS_BODY (stmt) = substmt; + + return add_stmt (stmt); +} + +/* OpenMP 2.5: + # pragma omp sections sections-clause[optseq] newline + sections-scope +*/ + +#define OMP_SECTIONS_CLAUSE_MASK \ + ( (1u << PRAGMA_OMP_CLAUSE_PRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_FIRSTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_LASTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_REDUCTION) \ + | (1u << PRAGMA_OMP_CLAUSE_NOWAIT)) + +static tree +c_parser_omp_sections (c_parser *parser) +{ + tree block, clauses, ret; + + clauses = c_parser_omp_all_clauses (parser, OMP_SECTIONS_CLAUSE_MASK, + "#pragma omp sections"); + + block = c_begin_compound_stmt (true); + ret = c_parser_omp_sections_scope (parser); + if (ret) + OMP_SECTIONS_CLAUSES (ret) = clauses; + block = c_end_compound_stmt (block, true); + add_stmt (block); + + return ret; +} + +/* OpenMP 2.5: + # pragma parallel parallel-clause new-line + # pragma parallel for parallel-for-clause new-line + # pragma parallel sections parallel-sections-clause new-line +*/ + +#define OMP_PARALLEL_CLAUSE_MASK \ + ( (1u << PRAGMA_OMP_CLAUSE_IF) \ + | (1u << PRAGMA_OMP_CLAUSE_PRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_FIRSTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_DEFAULT) \ + | (1u << PRAGMA_OMP_CLAUSE_SHARED) \ + | (1u << PRAGMA_OMP_CLAUSE_COPYIN) \ + | (1u << PRAGMA_OMP_CLAUSE_REDUCTION) \ + | (1u << PRAGMA_OMP_CLAUSE_NUM_THREADS)) + +static tree +c_parser_omp_parallel (c_parser *parser) +{ + enum pragma_kind p_kind = PRAGMA_OMP_PARALLEL; + const char *p_name = "#pragma omp parallel"; + tree stmt, clauses, par_clause, ws_clause, block; + unsigned int mask = OMP_PARALLEL_CLAUSE_MASK; + + if (c_parser_next_token_is_keyword (parser, RID_FOR)) + { + c_parser_consume_token (parser); + p_kind = PRAGMA_OMP_PARALLEL_FOR; + p_name = "#pragma omp parallel for"; + mask |= OMP_FOR_CLAUSE_MASK; + mask &= ~(1u << PRAGMA_OMP_CLAUSE_NOWAIT); + } + else if (c_parser_next_token_is (parser, CPP_NAME)) + { + const char *p = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value); + if (strcmp (p, "sections") == 0) + { + c_parser_consume_token (parser); + p_kind = PRAGMA_OMP_PARALLEL_SECTIONS; + p_name = "#pragma omp parallel sections"; + mask |= OMP_SECTIONS_CLAUSE_MASK; + mask &= ~(1u << PRAGMA_OMP_CLAUSE_NOWAIT); + } + } + + clauses = c_parser_omp_all_clauses (parser, mask, p_name); + + switch (p_kind) + { + case PRAGMA_OMP_PARALLEL: + block = c_begin_omp_parallel (); + c_parser_statement (parser); + stmt = c_finish_omp_parallel (clauses, block); + break; + + case PRAGMA_OMP_PARALLEL_FOR: + block = c_begin_omp_parallel (); + c_split_parallel_clauses (clauses, &par_clause, &ws_clause); + stmt = c_parser_omp_for_loop (parser); + if (stmt) + OMP_FOR_CLAUSES (stmt) = ws_clause; + stmt = c_finish_omp_parallel (par_clause, block); + OMP_PARALLEL_COMBINED (stmt) = 1; + break; + + case PRAGMA_OMP_PARALLEL_SECTIONS: + block = c_begin_omp_parallel (); + c_split_parallel_clauses (clauses, &par_clause, &ws_clause); + stmt = c_parser_omp_sections_scope (parser); + if (stmt) + OMP_SECTIONS_CLAUSES (stmt) = ws_clause; + stmt = c_finish_omp_parallel (par_clause, block); + OMP_PARALLEL_COMBINED (stmt) = 1; + break; + + default: + gcc_unreachable (); + } + + return stmt; +} + +/* OpenMP 2.5: + # pragma omp single single-clause[optseq] new-line + structured-block +*/ + +#define OMP_SINGLE_CLAUSE_MASK \ + ( (1u << PRAGMA_OMP_CLAUSE_PRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_FIRSTPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_COPYPRIVATE) \ + | (1u << PRAGMA_OMP_CLAUSE_NOWAIT)) + +static tree +c_parser_omp_single (c_parser *parser) +{ + tree stmt = make_node (OMP_SINGLE); + TREE_TYPE (stmt) = void_type_node; + + OMP_SINGLE_CLAUSES (stmt) + = c_parser_omp_all_clauses (parser, OMP_SINGLE_CLAUSE_MASK, + "#pragma omp single"); + OMP_SINGLE_BODY (stmt) = c_parser_omp_structured_block (parser); + + return add_stmt (stmt); +} + + +/* Main entry point to parsing most OpenMP pragmas. */ + +static void +c_parser_omp_construct (c_parser *parser) +{ + enum pragma_kind p_kind; + location_t loc; + tree stmt; + + loc = c_parser_peek_token (parser)->location; + p_kind = c_parser_peek_token (parser)->pragma_kind; + c_parser_consume_pragma (parser); + + /* For all constructs below except #pragma omp atomic + MUST_NOT_THROW catch handlers are needed when exceptions + are enabled. */ + if (p_kind != PRAGMA_OMP_ATOMIC) + c_maybe_initialize_eh (); + + switch (p_kind) + { + case PRAGMA_OMP_ATOMIC: + c_parser_omp_atomic (parser); + return; + case PRAGMA_OMP_CRITICAL: + stmt = c_parser_omp_critical (parser); + break; + case PRAGMA_OMP_FOR: + stmt = c_parser_omp_for (parser); + break; + case PRAGMA_OMP_MASTER: + stmt = c_parser_omp_master (parser); + break; + case PRAGMA_OMP_ORDERED: + stmt = c_parser_omp_ordered (parser); + break; + case PRAGMA_OMP_PARALLEL: + stmt = c_parser_omp_parallel (parser); + break; + case PRAGMA_OMP_SECTIONS: + stmt = c_parser_omp_sections (parser); + break; + case PRAGMA_OMP_SINGLE: + stmt = c_parser_omp_single (parser); + break; + default: + gcc_unreachable (); + } + + if (stmt) + SET_EXPR_LOCATION (stmt, loc); +} + + +/* OpenMP 2.5: + # pragma omp threadprivate (variable-list) */ + +static void +c_parser_omp_threadprivate (c_parser *parser) +{ + tree vars, t; + + c_parser_consume_pragma (parser); + vars = c_parser_omp_var_list_parens (parser, 0, NULL); + + if (!targetm.have_tls) + sorry ("threadprivate variables not supported in this target"); + + /* Mark every variable in VARS to be assigned thread local storage. */ + for (t = vars; t; t = TREE_CHAIN (t)) + { + tree v = TREE_PURPOSE (t); + + /* If V had already been marked threadprivate, it doesn't matter + whether it had been used prior to this point. */ + if (TREE_USED (v) && !C_DECL_THREADPRIVATE_P (v)) + error ("%qE declared % after first use", v); + else if (! TREE_STATIC (v) && ! DECL_EXTERNAL (v)) + error ("automatic variable %qE cannot be %", v); + else if (! COMPLETE_TYPE_P (TREE_TYPE (v))) + error ("% %qE has incomplete type", v); + else + { + if (! DECL_THREAD_LOCAL_P (v)) + { + DECL_TLS_MODEL (v) = decl_default_tls_model (v); + /* If rtl has been already set for this var, call + make_decl_rtl once again, so that encode_section_info + has a chance to look at the new decl flags. */ + if (DECL_RTL_SET_P (v)) + make_decl_rtl (v); + } + C_DECL_THREADPRIVATE_P (v) = 1; + } + } + + c_parser_skip_to_pragma_eol (parser); +} + + +/* Parse a single source file. */ + +void +c_parse_file (void) +{ + /* Use local storage to begin. If the first token is a pragma, parse it. + If it is #pragma GCC pch_preprocess, then this will load a PCH file + which will cause garbage collection. */ + c_parser tparser; + + memset (&tparser, 0, sizeof tparser); + the_parser = &tparser; + + if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS) + c_parser_pragma_pch_preprocess (&tparser); + + the_parser = GGC_NEW (c_parser); + *the_parser = tparser; + + c_parser_translation_unit (the_parser); + the_parser = NULL; +} + +#include "gt-c-parser.h" diff --git a/contrib/gcc/c-pch.c b/contrib/gcc/c-pch.c index 45898642966..76e40fb0a26 100644 --- a/contrib/gcc/c-pch.c +++ b/contrib/gcc/c-pch.c @@ -1,5 +1,5 @@ /* Precompiled header implementation for the C languages. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -35,37 +35,41 @@ Boston, MA 02111-1307, USA. */ #include "hosthooks.h" #include "target.h" -/* This structure is read very early when validating the PCH, and - might be read for a PCH which is for a completely different compiler - for a different operating system. Thus, it should really only contain - 'unsigned char' entries, at least in the initial entries. +/* This is a list of flag variables that must match exactly, and their + names for the error message. The possible values for *flag_var must + fit in a 'signed char'. */ - If you add or change entries before version_length, you should increase - the version number in get_ident(). +static const struct c_pch_matching +{ + int *flag_var; + const char *flag_name; +} pch_matching[] = { + { &flag_exceptions, "-fexceptions" }, + { &flag_unit_at_a_time, "-funit-at-a-time" } +}; - There are a bunch of fields named *_length; those are lengths of data that - follows this structure in the same order as the fields in the structure. +enum { + MATCH_SIZE = ARRAY_SIZE (pch_matching) +}; - The flags_info field is used to verify that certain flags settings that - have to be the same during the compilation of the PCH and a compilation - using the PCH are indeed the same. */ +/* The value of the checksum in the dummy compiler that is actually + checksummed. That compiler should never be run. */ +static const char no_checksum[16] = { 0 }; + +/* Information about flags and suchlike that affect PCH validity. + + Before this structure is read, both an initial 8-character identification + string, and a 16-byte checksum, have been read and validated. */ struct c_pch_validity { - unsigned char host_machine_length; - unsigned char target_machine_length; - unsigned char version_length; unsigned char debug_info_type; - unsigned int flags_info; + signed char match[MATCH_SIZE]; void (*pch_init) (void); size_t target_data_length; }; -/* If -funit-at-a-time is set, we require that it was also set during the - compilation of the PCH we may be using. */ -#define FLAG_UNIT_AT_A_TIME_SET 1 << 0 - -struct c_pch_header +struct c_pch_header { unsigned long asm_size; }; @@ -78,10 +82,6 @@ static FILE *pch_outfile; /* The position in the assembler output file when pch_init was called. */ static long asm_file_startpos; -/* The host and target machines. */ -static const char host_machine[] = HOST_MACHINE; -static const char target_machine[] = TARGET_MACHINE; - static const char *get_ident (void); /* Compute an appropriate 8-byte magic number for the PCH file, so that @@ -90,20 +90,22 @@ static const char *get_ident (void); format. */ static const char * -get_ident(void) +get_ident (void) { static char result[IDENT_LENGTH]; - static const char template[IDENT_LENGTH] = "gpch.012"; + static const char template[IDENT_LENGTH] = "gpch.013"; static const char c_language_chars[] = "Co+O"; - + memcpy (result, template, IDENT_LENGTH); result[4] = c_language_chars[c_language]; return result; } -/* Prepare to write a PCH file. This is called at the start of - compilation. */ +/* Prepare to write a PCH file, if one is being written. This is + called at the start of compilation. + + Also, print out the executable checksum if -fverbose-asm is in effect. */ void pch_init (void) @@ -112,50 +114,55 @@ pch_init (void) struct c_pch_validity v; void *target_validity; static const char partial_pch[IDENT_LENGTH] = "gpcWrite"; - unsigned int current_flags_info = 0; - - if (! pch_file) - return; - if (flag_unit_at_a_time) - current_flags_info |= FLAG_UNIT_AT_A_TIME_SET; +#ifdef ASM_COMMENT_START + if (flag_verbose_asm) + { + fprintf (asm_out_file, "%s ", ASM_COMMENT_START); + c_common_print_pch_checksum (asm_out_file); + fputc ('\n', asm_out_file); + } +#endif + + if (!pch_file) + return; f = fopen (pch_file, "w+b"); if (f == NULL) - fatal_error ("can't create precompiled header %s: %m", pch_file); + fatal_error ("can%'t create precompiled header %s: %m", pch_file); pch_outfile = f; - - if (strlen (host_machine) > 255 || strlen (target_machine) > 255 - || strlen (version_string) > 255) - abort (); - - v.host_machine_length = strlen (host_machine); - v.target_machine_length = strlen (target_machine); - v.version_length = strlen (version_string); + + gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); + v.debug_info_type = write_symbols; - v.flags_info = current_flags_info; + { + size_t i; + for (i = 0; i < MATCH_SIZE; i++) + { + v.match[i] = *pch_matching[i].flag_var; + gcc_assert (v.match[i] == *pch_matching[i].flag_var); + } + } v.pch_init = &pch_init; target_validity = targetm.get_pch_validity (&v.target_data_length); - + if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1 + || fwrite (executable_checksum, 16, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 - || fwrite (host_machine, v.host_machine_length, 1, f) != 1 - || fwrite (target_machine, v.target_machine_length, 1, f) != 1 - || fwrite (version_string, v.version_length, 1, f) != 1 || fwrite (target_validity, v.target_data_length, 1, f) != 1) - fatal_error ("can't write to %s: %m", pch_file); + fatal_error ("can%'t write to %s: %m", pch_file); /* We need to be able to re-read the output. */ /* The driver always provides a valid -o option. */ if (asm_file_name == NULL || strcmp (asm_file_name, "-") == 0) - fatal_error ("`%s' is not a valid output file", asm_file_name); - + fatal_error ("%qs is not a valid output file", asm_file_name); + asm_file_startpos = ftell (asm_out_file); - + /* Let the debugging format deal with the PCHness. */ (*debug_hooks->handle_pch) (0); - + cpp_save_state (parse_in, f); } @@ -176,15 +183,14 @@ c_common_write_pch (void) asm_file_end = ftell (asm_out_file); h.asm_size = asm_file_end - asm_file_startpos; - + if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); - - buf = xmalloc (16384); - fflush (asm_out_file); + fatal_error ("can%'t write %s: %m", pch_file); + + buf = XNEWVEC (char, 16384); if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0) - fatal_error ("can't seek in %s: %m", asm_file_name); + fatal_error ("can%'t seek in %s: %m", asm_file_name); for (written = asm_file_startpos; written < asm_file_end; ) { @@ -192,21 +198,23 @@ c_common_write_pch (void) if (size > 16384) size = 16384; if (fread (buf, size, 1, asm_out_file) != 1) - fatal_error ("can't read %s: %m", asm_file_name); + fatal_error ("can%'t read %s: %m", asm_file_name); if (fwrite (buf, size, 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); + fatal_error ("can%'t write %s: %m", pch_file); written += size; } free (buf); - /* asm_out_file can be written afterwards, so must be flushed first. */ - fflush (asm_out_file); + /* asm_out_file can be written afterwards, so fseek to clear + _IOREAD flag. */ + if (fseek (asm_out_file, 0, SEEK_END) != 0) + fatal_error ("can%'t seek in %s: %m", asm_file_name); gt_pch_save (pch_outfile); cpp_write_pch_state (parse_in, pch_outfile); if (fseek (pch_outfile, 0, SEEK_SET) != 0 || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1) - fatal_error ("can't write %s: %m", pch_file); + fatal_error ("can%'t write %s: %m", pch_file); fclose (pch_outfile); } @@ -221,26 +229,25 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) { int sizeread; int result; - char ident[IDENT_LENGTH]; - char short_strings[256 * 3]; - int strings_length; + char ident[IDENT_LENGTH + 16]; const char *pch_ident; struct c_pch_validity v; - unsigned int current_flags_info = 0; - - if (flag_unit_at_a_time) - current_flags_info |= FLAG_UNIT_AT_A_TIME_SET; /* Perform a quick test of whether this is a valid - precompiled header for the current language - and with the current flag settings. */ + precompiled header for the current language. */ - sizeread = read (fd, ident, IDENT_LENGTH); + gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); + + sizeread = read (fd, ident, IDENT_LENGTH + 16); if (sizeread == -1) - fatal_error ("can't read %s: %m", name); - else if (sizeread != IDENT_LENGTH) - return 2; - + fatal_error ("can%'t read %s: %m", name); + else if (sizeread != IDENT_LENGTH + 16) + { + cpp_error (pfile, CPP_DL_WARNING, "%s: too short to be a PCH file", + name); + return 2; + } + pch_ident = get_ident(); if (memcmp (ident, pch_ident, IDENT_LENGTH) != 0) { @@ -249,71 +256,31 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if (memcmp (ident, pch_ident, 5) == 0) /* It's a PCH, for the right language, but has the wrong version. */ - cpp_error (pfile, CPP_DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: not compatible with this GCC version", name); else if (memcmp (ident, pch_ident, 4) == 0) /* It's a PCH for the wrong language. */ cpp_error (pfile, CPP_DL_WARNING, "%s: not for %s", name, lang_hooks.name); - else + else /* Not any kind of PCH. */ cpp_error (pfile, CPP_DL_WARNING, "%s: not a PCH file", name); } return 2; } + if (memcmp (ident + IDENT_LENGTH, executable_checksum, 16) != 0) + { + if (cpp_get_options (pfile)->warn_invalid_pch) + cpp_error (pfile, CPP_DL_WARNING, + "%s: created by a different GCC executable", name); + return 2; + } - /* At this point, we know it's a PCH file, so it ought to be long enough - that we can read a c_pch_validity structure. */ + /* At this point, we know it's a PCH file created by this + executable, so it ought to be long enough that we can read a + c_pch_validity structure. */ if (read (fd, &v, sizeof (v)) != sizeof (v)) - fatal_error ("can't read %s: %m", name); - - strings_length = (v.host_machine_length + v.target_machine_length - + v.version_length); - if (read (fd, short_strings, strings_length) != strings_length) - fatal_error ("can't read %s: %m", name); - if (v.host_machine_length != strlen (host_machine) - || memcmp (host_machine, short_strings, strlen (host_machine)) != 0) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created on host `%.*s', but used on host `%s'", name, - v.host_machine_length, short_strings, host_machine); - return 2; - } - if (v.target_machine_length != strlen (target_machine) - || memcmp (target_machine, short_strings + v.host_machine_length, - strlen (target_machine)) != 0) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created for target `%.*s', but used for target `%s'", - name, v.target_machine_length, - short_strings + v.host_machine_length, target_machine); - return 2; - } - if (v.version_length != strlen (version_string) - || memcmp (version_string, - (short_strings + v.host_machine_length - + v.target_machine_length), - v.version_length) != 0) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created by version `%.*s', but this is version `%s'", - name, v.version_length, - (short_strings + v.host_machine_length - + v.target_machine_length), - version_string); - return 2; - } - if (v.flags_info != current_flags_info) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created using different flags", - name); - return 2; - } + fatal_error ("can%'t read %s: %m", name); /* The allowable debug info combinations are that either the PCH file was built with the same as is being used now, or the PCH file was @@ -322,21 +289,37 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) && write_symbols != NO_DEBUG) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: created with -g%s, but used with -g%s", name, debug_type_names[v.debug_info_type], debug_type_names[write_symbols]); return 2; } + /* Check flags that must match exactly. */ + { + size_t i; + for (i = 0; i < MATCH_SIZE; i++) + if (*pch_matching[i].flag_var != v.match[i]) + { + if (cpp_get_options (pfile)->warn_invalid_pch) + cpp_error (pfile, CPP_DL_WARNING, + "%s: settings for %s do not match", name, + pch_matching[i].flag_name); + return 2; + } + } + /* If the text segment was not loaded at the same address as it was when the PCH file was created, function pointers loaded from the PCH will not be valid. We could in theory remap all the function - pointers, but no support for that exists at present. */ + pointers, but no support for that exists at present. + Since we have the same executable, it should only be necessary to + check one function. */ if (v.pch_init != &pch_init) { if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, + cpp_error (pfile, CPP_DL_WARNING, "%s: had text segment at different address", name); return 2; } @@ -345,10 +328,10 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) { void *this_file_data = xmalloc (v.target_data_length); const char *msg; - + if ((size_t) read (fd, this_file_data, v.target_data_length) != v.target_data_length) - fatal_error ("can't read %s: %m", name); + fatal_error ("can%'t read %s: %m", name); msg = targetm.pch_valid_p (this_file_data, v.target_data_length); free (this_file_data); if (msg != NULL) @@ -361,7 +344,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) /* Check the preprocessor macros are the same as when the PCH was generated. */ - + result = cpp_valid_state (pfile, name, fd); if (result == -1) return 2; @@ -369,6 +352,10 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) return result == 0; } +/* If non-NULL, this function is called after a precompile header file + is loaded. */ +void (*lang_post_pch_load) (void); + /* Load in the PCH file NAME, open on FD. It was originally searched for by ORIG_NAME. */ @@ -378,10 +365,8 @@ c_common_read_pch (cpp_reader *pfile, const char *name, { FILE *f; struct c_pch_header h; - char *buf; - unsigned long written; struct save_macro_data *smd; - + f = fdopen (fd, "rb"); if (f == NULL) { @@ -397,18 +382,30 @@ c_common_read_pch (cpp_reader *pfile, const char *name, return; } - buf = xmalloc (16384); - for (written = 0; written < h.asm_size; ) + if (!flag_preprocess_only) { - long size = h.asm_size - written; - if (size > 16384) - size = 16384; - if (fread (buf, size, 1, f) != 1 - || fwrite (buf, size, 1, asm_out_file) != 1) - cpp_errno (pfile, CPP_DL_ERROR, "reading"); - written += size; + unsigned long written; + char * buf = XNEWVEC (char, 16384); + + for (written = 0; written < h.asm_size; ) + { + long size = h.asm_size - written; + if (size > 16384) + size = 16384; + if (fread (buf, size, 1, f) != 1 + || fwrite (buf, size, 1, asm_out_file) != 1) + cpp_errno (pfile, CPP_DL_ERROR, "reading"); + written += size; + } + free (buf); + } + else + { + /* If we're preprocessing, don't write to a NULL + asm_out_file. */ + if (fseek (f, h.asm_size, SEEK_CUR) != 0) + cpp_errno (pfile, CPP_DL_ERROR, "seeking"); } - free (buf); cpp_prepare_state (pfile, &smd); @@ -418,6 +415,11 @@ c_common_read_pch (cpp_reader *pfile, const char *name, return; fclose (f); + + /* Give the front end a chance to take action after a PCH file has + been loaded. */ + if (lang_post_pch_load) + (*lang_post_pch_load) (); } /* Indicate that no more PCH files should be read. */ @@ -431,3 +433,49 @@ c_common_no_more_pch (void) host_hooks.gt_pch_use_address (NULL, 0, -1, 0); } } + +/* Handle #pragma GCC pch_preprocess, to load in the PCH file. */ + +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +void +c_common_pch_pragma (cpp_reader *pfile, const char *name) +{ + int fd; + + if (!cpp_get_options (pfile)->preprocessed) + { + error ("pch_preprocess pragma should only be used with -fpreprocessed"); + inform ("use #include instead"); + return; + } + + fd = open (name, O_RDONLY | O_BINARY, 0666); + if (fd == -1) + fatal_error ("%s: couldn%'t open PCH file: %m", name); + + if (c_common_valid_pch (pfile, name, fd) != 1) + { + if (!cpp_get_options (pfile)->warn_invalid_pch) + inform ("use -Winvalid-pch for more information"); + fatal_error ("%s: PCH file was invalid", name); + } + + c_common_read_pch (pfile, name, fd, name); + + close (fd); +} + +/* Print out executable_checksum[]. */ + +void +c_common_print_pch_checksum (FILE *f) +{ + int i; + fputs ("Compiler executable checksum: ", f); + for (i = 0; i < 16; i++) + fprintf (f, "%02x", executable_checksum[i]); + putc ('\n', f); +} diff --git a/contrib/gcc/c-ppoutput.c b/contrib/gcc/c-ppoutput.c index 8162ccba26b..10540b7f125 100644 --- a/contrib/gcc/c-ppoutput.c +++ b/contrib/gcc/c-ppoutput.c @@ -15,14 +15,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "cpplib.h" -#include "cpphash.h" +#include "../libcpp/internal.h" #include "tree.h" #include "c-common.h" /* For flags. */ #include "c-pragma.h" /* For parse_in. */ @@ -32,11 +32,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static struct { FILE *outf; /* Stream to write to. */ - const struct line_map *map; /* Logical to physical line mappings. */ const cpp_token *prev; /* Previous token. */ const cpp_token *source; /* Source token for spacing. */ - fileline line; /* Line currently being written. */ + int src_line; /* Line number currently being written. */ unsigned char printed; /* Nonzero if something output at line. */ + bool first_time; /* pp_file_change hasn't been called yet. */ } print; /* General output routines. */ @@ -45,18 +45,20 @@ static void scan_translation_unit_trad (cpp_reader *); static void account_for_newlines (const unsigned char *, size_t); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); -static void print_line (const struct line_map *, fileline, const char *); -static void maybe_print_line (const struct line_map *, fileline); +static void print_line (source_location, const char *); +static void maybe_print_line (source_location); /* Callback routines for the parser. Most of these are active only in specific modes. */ static void cb_line_change (cpp_reader *, const cpp_token *, int); -static void cb_define (cpp_reader *, fileline, cpp_hashnode *); -static void cb_undef (cpp_reader *, fileline, cpp_hashnode *); -static void cb_include (cpp_reader *, fileline, const unsigned char *, - const char *, int); -static void cb_ident (cpp_reader *, fileline, const cpp_string *); -static void cb_def_pragma (cpp_reader *, fileline); +static void cb_define (cpp_reader *, source_location, cpp_hashnode *); +static void cb_undef (cpp_reader *, source_location, cpp_hashnode *); +static void cb_include (cpp_reader *, source_location, const unsigned char *, + const char *, int, const cpp_token **); +static void cb_ident (cpp_reader *, source_location, const cpp_string *); +static void cb_def_pragma (cpp_reader *, source_location); +static void cb_read_pch (cpp_reader *pfile, const char *name, + int fd, const char *orig_name); /* Preprocess and output. */ void @@ -106,20 +108,26 @@ init_pp_output (FILE *out_stream) if (flag_dump_includes) cb->include = cb_include; + if (flag_pch_preprocess) + { + cb->valid_pch = c_common_valid_pch; + cb->read_pch = cb_read_pch; + } + if (flag_dump_macros == 'N' || flag_dump_macros == 'D') { cb->define = cb_define; cb->undef = cb_undef; } - /* Initialize the print structure. Setting print.line to -1 here is + /* Initialize the print structure. Setting print.src_line to -1 here is a trick to guarantee that the first token of the file will cause a linemarker to be output by maybe_print_line. */ - print.line = (fileline) -1; + print.src_line = -1; print.printed = 0; print.prev = 0; - print.map = 0; print.outf = out_stream; + print.first_time = 1; } /* Writes out the preprocessed file, handling spacing and paste @@ -171,13 +179,13 @@ scan_translation_unit (cpp_reader *pfile) } } -/* Adjust print.line for newlines embedded in output. */ +/* Adjust print.src_line for newlines embedded in output. */ static void account_for_newlines (const unsigned char *str, size_t len) { while (len--) if (*str++ == '\n') - print.line++; + print.src_line++; } /* Writes out a traditionally preprocessed file. */ @@ -187,7 +195,7 @@ scan_translation_unit_trad (cpp_reader *pfile) while (_cpp_read_logical_line_trad (pfile)) { size_t len = pfile->out.cur - pfile->out.base; - maybe_print_line (print.map, pfile->out.first_line); + maybe_print_line (pfile->out.first_line); fwrite (pfile->out.base, 1, len, print.outf); print.printed = 1; if (!CPP_OPTION (pfile, discard_comments)) @@ -199,52 +207,58 @@ scan_translation_unit_trad (cpp_reader *pfile) different line to the current one, output the required newlines or a line marker, and return 1. Otherwise return 0. */ static void -maybe_print_line (const struct line_map *map, fileline line) +maybe_print_line (source_location src_loc) { + const struct line_map *map = linemap_lookup (&line_table, src_loc); + int src_line = SOURCE_LINE (map, src_loc); /* End the previous line of text. */ if (print.printed) { putc ('\n', print.outf); - print.line++; + print.src_line++; print.printed = 0; } - if (line >= print.line && line < print.line + 8) + if (src_line >= print.src_line && src_line < print.src_line + 8) { - while (line > print.line) + while (src_line > print.src_line) { putc ('\n', print.outf); - print.line++; + print.src_line++; } } else - print_line (map, line, ""); + print_line (src_loc, ""); } /* Output a line marker for logical line LINE. Special flags are "1" or "2" indicating entering or leaving a file. */ static void -print_line (const struct line_map *map, fileline line, const char *special_flags) +print_line (source_location src_loc, const char *special_flags) { /* End any previous line of text. */ if (print.printed) putc ('\n', print.outf); print.printed = 0; - print.line = line; if (!flag_no_line_commands) { + const struct line_map *map = linemap_lookup (&line_table, src_loc); + size_t to_file_len = strlen (map->to_file); - unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1); + unsigned char *to_file_quoted = + (unsigned char *) alloca (to_file_len * 4 + 1); unsigned char *p; + print.src_line = SOURCE_LINE (map, src_loc); + /* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */ p = cpp_quote_string (to_file_quoted, - (unsigned char *)map->to_file, to_file_len); + (unsigned char *) map->to_file, to_file_len); *p = '\0'; fprintf (print.outf, "# %u \"%s\"%s", - SOURCE_LINE (map, print.line), + print.src_line == 0 ? 1 : print.src_line, to_file_quoted, special_flags); if (map->sysp == 2) @@ -262,10 +276,12 @@ static void cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args) { + source_location src_loc = token->src_loc; + if (token->type == CPP_EOF || parsing_args) return; - maybe_print_line (print.map, token->line); + maybe_print_line (src_loc); print.prev = 0; print.source = 0; @@ -276,30 +292,28 @@ cb_line_change (cpp_reader *pfile, const cpp_token *token, ought to care. Some things do care; the fault lies with them. */ if (!CPP_OPTION (pfile, traditional)) { + const struct line_map *map = linemap_lookup (&line_table, src_loc); + int spaces = SOURCE_COLUMN (map, src_loc) - 2; print.printed = 1; - if (token->col > 2) - { - unsigned int spaces = token->col - 2; - while (spaces--) - putc (' ', print.outf); - } + while (-- spaces >= 0) + putc (' ', print.outf); } } static void -cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line, +cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line, const cpp_string *str) { - maybe_print_line (print.map, line); + maybe_print_line (line); fprintf (print.outf, "#ident %s\n", str->text); - print.line++; + print.src_line++; } static void -cb_define (cpp_reader *pfile, fileline line, cpp_hashnode *node) +cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node) { - maybe_print_line (print.map, line); + maybe_print_line (line); fputs ("#define ", print.outf); /* 'D' is whole definition; 'N' is name only. */ @@ -310,49 +324,64 @@ cb_define (cpp_reader *pfile, fileline line, cpp_hashnode *node) fputs ((const char *) NODE_NAME (node), print.outf); putc ('\n', print.outf); - print.line++; + if (linemap_lookup (&line_table, line)->to_line != 0) + print.src_line++; } static void -cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line, +cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line, cpp_hashnode *node) { - maybe_print_line (print.map, line); + maybe_print_line (line); fprintf (print.outf, "#undef %s\n", NODE_NAME (node)); - print.line++; + print.src_line++; } static void -cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, fileline line, - const unsigned char *dir, const char *header, int angle_brackets) +cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line, + const unsigned char *dir, const char *header, int angle_brackets, + const cpp_token **comments) { - maybe_print_line (print.map, line); + maybe_print_line (line); if (angle_brackets) - fprintf (print.outf, "#%s <%s>\n", dir, header); + fprintf (print.outf, "#%s <%s>", dir, header); else - fprintf (print.outf, "#%s \"%s\"\n", dir, header); - print.line++; + fprintf (print.outf, "#%s \"%s\"", dir, header); + + if (comments != NULL) + { + while (*comments != NULL) + { + if ((*comments)->flags & PREV_WHITE) + putc (' ', print.outf); + cpp_output_token (*comments, print.outf); + ++comments; + } + } + + putc ('\n', print.outf); + print.src_line++; } /* Callback called when -fworking-director and -E to emit working - diretory in cpp output file. */ + directory in cpp output file. */ void pp_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir) { size_t to_file_len = strlen (dir); - unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1); + unsigned char *to_file_quoted = + (unsigned char *) alloca (to_file_len * 4 + 1); unsigned char *p; - /* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */ + /* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */ p = cpp_quote_string (to_file_quoted, (unsigned char *) dir, to_file_len); *p = '\0'; fprintf (print.outf, "# 1 \"%s//\"\n", to_file_quoted); } /* The file name, line number or system header flags have changed, as - described in MAP. From this point on, the old print.map might be - pointing to freed memory, and so must not be dereferenced. */ + described in MAP. */ void pp_file_change (const struct line_map *map) @@ -364,38 +393,38 @@ pp_file_change (const struct line_map *map) if (map != NULL) { - /* First time? */ - if (print.map == NULL) + if (print.first_time) { /* Avoid printing foo.i when the main file is foo.c. */ if (!cpp_get_options (parse_in)->preprocessed) - print_line (map, map->from_line, flags); + print_line (map->start_location, flags); + print.first_time = 0; } else { /* Bring current file to correct line when entering a new file. */ if (map->reason == LC_ENTER) - maybe_print_line (map - 1, map->from_line - 1); - + { + const struct line_map *from = INCLUDED_FROM (&line_table, map); + maybe_print_line (LAST_SOURCE_LINE_LOCATION (from)); + } if (map->reason == LC_ENTER) flags = " 1"; else if (map->reason == LC_LEAVE) flags = " 2"; - print_line (map, map->from_line, flags); + print_line (map->start_location, flags); } } - - print.map = map; } /* Copy a #pragma directive to the preprocessed output. */ static void -cb_def_pragma (cpp_reader *pfile, fileline line) +cb_def_pragma (cpp_reader *pfile, source_location line) { - maybe_print_line (print.map, line); + maybe_print_line (line); fputs ("#pragma ", print.outf); cpp_output_line (pfile, print.outf); - print.line++; + print.src_line++; } /* Dump out the hash table. */ @@ -408,8 +437,22 @@ dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED) fputs ((const char *) cpp_macro_definition (pfile, node), print.outf); putc ('\n', print.outf); - print.line++; + print.src_line++; } return 1; } + +/* Load in the PCH file NAME, open on FD. It was originally searched for + by ORIG_NAME. Also, print out a #include command so that the PCH + file can be loaded when the preprocessed output is compiled. */ + +static void +cb_read_pch (cpp_reader *pfile, const char *name, + int fd, const char *orig_name ATTRIBUTE_UNUSED) +{ + c_common_read_pch (pfile, name, fd, orig_name); + + fprintf (print.outf, "#pragma GCC pch_preprocess \"%s\"\n", name); + print.src_line++; +} diff --git a/contrib/gcc/c-pragma.c b/contrib/gcc/c-pragma.c index 10c8caea35d..b2712acc937 100644 --- a/contrib/gcc/c-pragma.c +++ b/contrib/gcc/c-pragma.c @@ -1,6 +1,6 @@ /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack. - Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -34,15 +34,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "c-common.h" #include "output.h" #include "tm_p.h" +#include "vec.h" +#include "target.h" +#include "diagnostic.h" +#include "opts.h" -#define GCC_BAD(msgid) do { warning (msgid); return; } while (0) -#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0) +#define GCC_BAD(gmsgid) \ + do { warning (OPT_Wpragmas, gmsgid); return; } while (0) +#define GCC_BAD2(gmsgid, arg) \ + do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0) typedef struct align_stack GTY(()) { - int alignment; - unsigned int num_pushes; - tree id; + int alignment; + tree id; struct align_stack * prev; } align_stack; @@ -53,13 +58,14 @@ static void handle_pragma_pack (cpp_reader *); #ifdef HANDLE_PRAGMA_PACK_PUSH_POP /* If we have a "global" #pragma pack() in effect when the first - #pragma pack(push,) is encountered, this stores the value of - maximum_field_alignment in effect. When the final pop_alignment() + #pragma pack(push,) is encountered, this stores the value of + maximum_field_alignment in effect. When the final pop_alignment() happens, we restore the value to this, not to a value of 0 for maximum_field_alignment. Value is in bits. */ static int default_alignment; -#define SET_GLOBAL_ALIGNMENT(ALIGN) \ - (default_alignment = maximum_field_alignment = (ALIGN)) +#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \ + ? &default_alignment \ + : &alignment_stack->alignment) = (ALIGN)) static void push_alignment (int, tree); static void pop_alignment (tree); @@ -68,31 +74,23 @@ static void pop_alignment (tree); static void push_alignment (int alignment, tree id) { - if (alignment_stack == NULL - || alignment_stack->alignment != alignment - || id != NULL_TREE) - { - align_stack * entry; + align_stack * entry; - entry = ggc_alloc (sizeof (* entry)); + entry = GGC_NEW (align_stack); - entry->alignment = alignment; - entry->num_pushes = 1; - entry->id = id; - entry->prev = alignment_stack; - - /* The current value of maximum_field_alignment is not necessarily - 0 since there may be a #pragma pack() in effect; remember it - so that we can restore it after the final #pragma pop(). */ - if (alignment_stack == NULL) - default_alignment = maximum_field_alignment; - - alignment_stack = entry; + entry->alignment = alignment; + entry->id = id; + entry->prev = alignment_stack; - maximum_field_alignment = alignment; - } - else - alignment_stack->num_pushes ++; + /* The current value of maximum_field_alignment is not necessarily + 0 since there may be a #pragma pack() in effect; remember it + so that we can restore it after the final #pragma pop(). */ + if (alignment_stack == NULL) + default_alignment = maximum_field_alignment; + + alignment_stack = entry; + + maximum_field_alignment = alignment; } /* Undo a push of an alignment onto the stack. */ @@ -100,14 +98,9 @@ static void pop_alignment (tree id) { align_stack * entry; - + if (alignment_stack == NULL) - { - warning ("\ -#pragma pack (pop) encountered without matching #pragma pack (push, )" - ); - return; - } + GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)"); /* If we got an identifier, strip away everything above the target entry so that the next step will restore the state just below it. */ @@ -116,73 +109,70 @@ pop_alignment (tree id) for (entry = alignment_stack; entry; entry = entry->prev) if (entry->id == id) { - entry->num_pushes = 1; alignment_stack = entry; break; } if (entry == NULL) - warning ("\ -#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s, )" + warning (OPT_Wpragmas, "\ +#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)" , IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id)); } - if (-- alignment_stack->num_pushes == 0) - { - entry = alignment_stack->prev; + entry = alignment_stack->prev; - if (entry == NULL) - maximum_field_alignment = default_alignment; - else - maximum_field_alignment = entry->alignment; + maximum_field_alignment = entry ? entry->alignment : default_alignment; - alignment_stack = entry; - } + alignment_stack = entry; } #else /* not HANDLE_PRAGMA_PACK_PUSH_POP */ #define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN)) #define push_alignment(ID, N) \ - GCC_BAD("#pragma pack(push[, id], ) is not supported on this target") + GCC_BAD ("#pragma pack(push[, id], ) is not supported on this target") #define pop_alignment(ID) \ - GCC_BAD("#pragma pack(pop[, id], ) is not supported on this target") + GCC_BAD ("#pragma pack(pop[, id], ) is not supported on this target") #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ /* #pragma pack () #pragma pack (N) - + + #pragma pack (push) #pragma pack (push, N) + #pragma pack (push, ID) #pragma pack (push, ID, N) #pragma pack (pop) #pragma pack (pop, ID) */ static void -handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED) +handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) { tree x, id = 0; int align = -1; enum cpp_ttype token; enum { set, push, pop } action; - if (c_lex (&x) != CPP_OPEN_PAREN) - GCC_BAD ("missing '(' after '#pragma pack' - ignored"); + if (pragma_lex (&x) != CPP_OPEN_PAREN) + GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored"); - token = c_lex (&x); + token = pragma_lex (&x); if (token == CPP_CLOSE_PAREN) { action = set; - align = 0; + align = initial_max_fld_align; } else if (token == CPP_NUMBER) { + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); align = TREE_INT_CST_LOW (x); action = set; - if (c_lex (&x) != CPP_CLOSE_PAREN) - GCC_BAD ("malformed '#pragma pack' - ignored"); + if (pragma_lex (&x) != CPP_CLOSE_PAREN) + GCC_BAD ("malformed %<#pragma pack%> - ignored"); } else if (token == CPP_NAME) { -#define GCC_BAD_ACTION do { if (action == push) \ - GCC_BAD ("malformed '#pragma pack(push[, id], )' - ignored"); \ +#define GCC_BAD_ACTION do { if (action != pop) \ + GCC_BAD ("malformed %<#pragma pack(push[, id][, ])%> - ignored"); \ else \ - GCC_BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \ + GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \ } while (0) const char *op = IDENTIFIER_POINTER (x); @@ -191,33 +181,25 @@ handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED) else if (!strcmp (op, "pop")) action = pop; else - GCC_BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op); + GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op); - token = c_lex (&x); - if (token != CPP_COMMA && action == push) - GCC_BAD_ACTION; - - if (token == CPP_COMMA) + while ((token = pragma_lex (&x)) == CPP_COMMA) { - token = c_lex (&x); - if (token == CPP_NAME) + token = pragma_lex (&x); + if (token == CPP_NAME && id == 0) { id = x; - if (action == push && c_lex (&x) != CPP_COMMA) - GCC_BAD_ACTION; - token = c_lex (&x); } - - if (action == push) + else if (token == CPP_NUMBER && action == push && align == -1) { - if (token == CPP_NUMBER) - { - align = TREE_INT_CST_LOW (x); - token = c_lex (&x); - } - else - GCC_BAD_ACTION; + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); + align = TREE_INT_CST_LOW (x); + if (align == -1) + action = set; } + else + GCC_BAD_ACTION; } if (token != CPP_CLOSE_PAREN) @@ -225,10 +207,13 @@ handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED) #undef GCC_BAD_ACTION } else - GCC_BAD ("malformed '#pragma pack' - ignored"); + GCC_BAD ("malformed %<#pragma pack%> - ignored"); - if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma pack'"); + if (pragma_lex (&x) != CPP_EOF) + warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>"); + + if (flag_pack_struct) + GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored"); if (action != pop) switch (align) @@ -241,6 +226,12 @@ handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED) case 16: align *= BITS_PER_UNIT; break; + case -1: + if (action == push) + { + align = maximum_field_alignment; + break; + } default: GCC_BAD2 ("alignment must be a small power of two, not %d", align); } @@ -249,7 +240,7 @@ handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED) { case set: SET_GLOBAL_ALIGNMENT (align); break; case push: push_alignment (align, id); break; - case pop: pop_alignment (id); break; + case pop: pop_alignment (id); break; } } #endif /* HANDLE_PRAGMA_PACK */ @@ -275,8 +266,8 @@ apply_pragma_weak (tree decl, tree value) if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl) && !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) - warning ("%Japplying #pragma weak '%D' after first use results " - "in unspecified behavior", decl, decl); + warning (OPT_Wpragmas, "applying #pragma weak %q+D after first use " + "results in unspecified behavior", decl); declare_weak (decl); } @@ -297,7 +288,7 @@ maybe_apply_pragma_weak (tree decl) return; /* If it's not a function or a variable, it can't be weak. FIXME: what kinds of things are visible outside this file but - aren't functions or variables? Should this be an abort() instead? */ + aren't functions or variables? Should this be an assert instead? */ if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) return; @@ -312,29 +303,56 @@ maybe_apply_pragma_weak (tree decl) } } +/* Process all "#pragma weak A = B" directives where we have not seen + a decl for A. */ +void +maybe_apply_pending_pragma_weaks (void) +{ + tree *p, t, alias_id, id, decl, *next; + + for (p = &pending_weaks; (t = *p) ; p = next) + { + next = &TREE_CHAIN (t); + alias_id = TREE_PURPOSE (t); + id = TREE_VALUE (t); + + if (TREE_VALUE (t) == NULL) + continue; + + decl = build_decl (FUNCTION_DECL, alias_id, default_function_type); + + DECL_ARTIFICIAL (decl) = 1; + TREE_PUBLIC (decl) = 1; + DECL_EXTERNAL (decl) = 1; + DECL_WEAK (decl) = 1; + + assemble_alias (decl, id); + } +} + /* #pragma weak name [= value] */ static void -handle_pragma_weak (cpp_reader *dummy ATTRIBUTE_UNUSED) +handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy)) { tree name, value, x, decl; enum cpp_ttype t; value = 0; - if (c_lex (&name) != CPP_NAME) + if (pragma_lex (&name) != CPP_NAME) GCC_BAD ("malformed #pragma weak, ignored"); - t = c_lex (&x); + t = pragma_lex (&x); if (t == CPP_EQ) { - if (c_lex (&value) != CPP_NAME) + if (pragma_lex (&value) != CPP_NAME) GCC_BAD ("malformed #pragma weak, ignored"); - t = c_lex (&x); + t = pragma_lex (&x); } if (t != CPP_EOF) - warning ("junk at end of #pragma weak"); + warning (OPT_Wpragmas, "junk at end of %<#pragma weak%>"); decl = identifier_global_value (name); - if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') + if (decl && DECL_P (decl)) { apply_pragma_weak (decl, value); if (value) @@ -345,83 +363,142 @@ handle_pragma_weak (cpp_reader *dummy ATTRIBUTE_UNUSED) } #else void -maybe_apply_pragma_weak (tree decl ATTRIBUTE_UNUSED) +maybe_apply_pragma_weak (tree ARG_UNUSED (decl)) +{ +} + +void +maybe_apply_pending_pragma_weaks (void) { } #endif /* HANDLE_PRAGMA_WEAK */ +/* GCC supports two #pragma directives for renaming the external + symbol associated with a declaration (DECL_ASSEMBLER_NAME), for + compatibility with the Solaris and Tru64 system headers. GCC also + has its own notation for this, __asm__("name") annotations. + + Corner cases of these features and their interaction: + + 1) Both pragmas silently apply only to declarations with external + linkage (that is, TREE_PUBLIC || DECL_EXTERNAL). Asm labels + do not have this restriction. + + 2) In C++, both #pragmas silently apply only to extern "C" declarations. + Asm labels do not have this restriction. + + 3) If any of the three ways of changing DECL_ASSEMBLER_NAME is + applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the + new name is different, a warning issues and the name does not change. + + 4) The "source name" for #pragma redefine_extname is the DECL_NAME, + *not* the DECL_ASSEMBLER_NAME. + + 5) If #pragma extern_prefix is in effect and a declaration occurs + with an __asm__ name, the #pragma extern_prefix is silently + ignored for that declaration. + + 6) If #pragma extern_prefix and #pragma redefine_extname apply to + the same declaration, whichever triggered first wins, and a warning + is issued. (We would like to have #pragma redefine_extname always + win, but it can appear either before or after the declaration, and + if it appears afterward, we have no way of knowing whether a modified + DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */ + static GTY(()) tree pending_redefine_extname; -#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME static void handle_pragma_redefine_extname (cpp_reader *); -/* #pragma redefined_extname oldname newname */ +/* #pragma redefine_extname oldname newname */ static void -handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED) +handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy)) { tree oldname, newname, decl, x; enum cpp_ttype t; - if (c_lex (&oldname) != CPP_NAME) - { - warning ("malformed #pragma redefine_extname, ignored"); - return; - } - if (c_lex (&newname) != CPP_NAME) - { - warning ("malformed #pragma redefine_extname, ignored"); - return; - } - t = c_lex (&x); + if (pragma_lex (&oldname) != CPP_NAME) + GCC_BAD ("malformed #pragma redefine_extname, ignored"); + if (pragma_lex (&newname) != CPP_NAME) + GCC_BAD ("malformed #pragma redefine_extname, ignored"); + t = pragma_lex (&x); if (t != CPP_EOF) - warning ("junk at end of #pragma redefine_extname"); + warning (OPT_Wpragmas, "junk at end of %<#pragma redefine_extname%>"); + + if (!flag_mudflap && !targetm.handle_pragma_redefine_extname) + { + if (warn_unknown_pragmas > in_system_header) + warning (OPT_Wunknown_pragmas, + "#pragma redefine_extname not supported on this target"); + return; + } decl = identifier_global_value (oldname); - if (decl && (TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == VAR_DECL)) + if (decl + && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl)) + && (TREE_CODE (decl) == FUNCTION_DECL + || TREE_CODE (decl) == VAR_DECL) + && has_c_linkage (decl)) { - if (DECL_ASSEMBLER_NAME_SET_P (decl) - && DECL_ASSEMBLER_NAME (decl) != newname) - warning ("#pragma redefine_extname conflicts with declaration"); - change_decl_assembler_name (decl, newname); + if (DECL_ASSEMBLER_NAME_SET_P (decl)) + { + const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + name = targetm.strip_name_encoding (name); + + if (strcmp (name, IDENTIFIER_POINTER (newname))) + warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to " + "conflict with previous rename"); + } + else + change_decl_assembler_name (decl, newname); } else - add_to_renaming_pragma_list(oldname, newname); + /* We have to add this to the rename list even if there's already + a global value that doesn't meet the above criteria, because in + C++ "struct foo {...};" puts "foo" in the current namespace but + does *not* conflict with a subsequent declaration of a function + or variable foo. See g++.dg/other/pragma-re-2.C. */ + add_to_renaming_pragma_list (oldname, newname); } -#endif +/* This is called from here and from ia64.c. */ void add_to_renaming_pragma_list (tree oldname, tree newname) { + tree previous = purpose_member (oldname, pending_redefine_extname); + if (previous) + { + if (TREE_VALUE (previous) != newname) + warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to " + "conflict with previous #pragma redefine_extname"); + return; + } + pending_redefine_extname = tree_cons (oldname, newname, pending_redefine_extname); } static GTY(()) tree pragma_extern_prefix; -#ifdef HANDLE_PRAGMA_EXTERN_PREFIX -static void handle_pragma_extern_prefix (cpp_reader *); - /* #pragma extern_prefix "prefix" */ static void -handle_pragma_extern_prefix (cpp_reader *dummy ATTRIBUTE_UNUSED) +handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy)) { tree prefix, x; enum cpp_ttype t; - if (c_lex (&prefix) != CPP_STRING) - { - warning ("malformed #pragma extern_prefix, ignored"); - return; - } - t = c_lex (&x); + if (pragma_lex (&prefix) != CPP_STRING) + GCC_BAD ("malformed #pragma extern_prefix, ignored"); + t = pragma_lex (&x); if (t != CPP_EOF) - warning ("junk at end of #pragma extern_prefix"); + warning (OPT_Wpragmas, "junk at end of %<#pragma extern_prefix%>"); - /* Note that the length includes the null terminator. */ - pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL); + if (targetm.handle_pragma_extern_prefix) + /* Note that the length includes the null terminator. */ + pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL); + else if (warn_unknown_pragmas > in_system_header) + warning (OPT_Wunknown_pragmas, + "#pragma extern_prefix not supported on this target"); } -#endif /* Hook from the front ends to apply the results of one of the preceding pragmas that rename variables. */ @@ -429,83 +506,330 @@ handle_pragma_extern_prefix (cpp_reader *dummy ATTRIBUTE_UNUSED) tree maybe_apply_renaming_pragma (tree decl, tree asmname) { - tree oldname; + tree *p, t; - /* Copied from the check in set_decl_assembler_name. */ - if (TREE_CODE (decl) == FUNCTION_DECL - || (TREE_CODE (decl) == VAR_DECL - && (TREE_STATIC (decl) - || DECL_EXTERNAL (decl) - || TREE_PUBLIC (decl)))) - oldname = DECL_ASSEMBLER_NAME (decl); - else + /* The renaming pragmas are only applied to declarations with + external linkage. */ + if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) + || (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) + || !has_c_linkage (decl)) return asmname; - /* If the name begins with a *, that's a sign of an asmname attached to - a previous declaration. */ - if (IDENTIFIER_POINTER (oldname)[0] == '*') + /* If the DECL_ASSEMBLER_NAME is already set, it does not change, + but we may warn about a rename that conflicts. */ + if (DECL_ASSEMBLER_NAME_SET_P (decl)) { - const char *oldasmname = IDENTIFIER_POINTER (oldname) + 1; - if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldasmname) != 0) - warning ("asm declaration conflicts with previous rename"); - asmname = build_string (strlen (oldasmname), oldasmname); + const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + oldname = targetm.strip_name_encoding (oldname); + + if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname)) + warning (OPT_Wpragmas, "asm declaration ignored due to " + "conflict with previous rename"); + + /* Take any pending redefine_extname off the list. */ + for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t)) + if (DECL_NAME (decl) == TREE_PURPOSE (t)) + { + /* Only warn if there is a conflict. */ + if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname)) + warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to " + "conflict with previous rename"); + + *p = TREE_CHAIN (t); + break; + } + return 0; } - { - tree *p, t; + /* Find out if we have a pending #pragma redefine_extname. */ + for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t)) + if (DECL_NAME (decl) == TREE_PURPOSE (t)) + { + tree newname = TREE_VALUE (t); + *p = TREE_CHAIN (t); - for (p = &pending_redefine_extname; (t = *p) ; p = &TREE_CHAIN (t)) - if (oldname == TREE_PURPOSE (t)) - { - const char *newname = IDENTIFIER_POINTER (TREE_VALUE (t)); + /* If we already have an asmname, #pragma redefine_extname is + ignored (with a warning if it conflicts). */ + if (asmname) + { + if (strcmp (TREE_STRING_POINTER (asmname), + IDENTIFIER_POINTER (newname)) != 0) + warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to " + "conflict with __asm__ declaration"); + return asmname; + } - if (asmname && strcmp (TREE_STRING_POINTER (asmname), newname) != 0) - warning ("#pragma redefine_extname conflicts with declaration"); - *p = TREE_CHAIN (t); + /* Otherwise we use what we've got; #pragma extern_prefix is + silently ignored. */ + return build_string (IDENTIFIER_LENGTH (newname), + IDENTIFIER_POINTER (newname)); + } - return build_string (strlen (newname), newname); - } - } + /* If we've got an asmname, #pragma extern_prefix is silently ignored. */ + if (asmname) + return asmname; -#ifdef HANDLE_PRAGMA_EXTERN_PREFIX - if (pragma_extern_prefix && !asmname) + /* If #pragma extern_prefix is in effect, apply it. */ + if (pragma_extern_prefix) { - char *x = concat (TREE_STRING_POINTER (pragma_extern_prefix), - IDENTIFIER_POINTER (oldname), NULL); - asmname = build_string (strlen (x), x); - free (x); - return asmname; - } -#endif + const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix); + size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1; - return asmname; + const char *id = IDENTIFIER_POINTER (DECL_NAME (decl)); + size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl)); + + char *newname = (char *) alloca (plen + ilen + 1); + + memcpy (newname, prefix, plen); + memcpy (newname + plen, id, ilen + 1); + + return build_string (plen + ilen, newname); + } + + /* Nada. */ + return 0; } -/* Front-end wrapper for pragma registration to avoid dragging - cpplib.h in almost everywhere. */ + +#ifdef HANDLE_PRAGMA_VISIBILITY +static void handle_pragma_visibility (cpp_reader *); + +typedef enum symbol_visibility visibility; +DEF_VEC_I (visibility); +DEF_VEC_ALLOC_I (visibility, heap); +static VEC (visibility, heap) *visstack; + +/* Push the visibility indicated by STR onto the top of the #pragma + visibility stack. */ + void -c_register_pragma (const char *space, const char *name, - void (*handler) (struct cpp_reader *)) +push_visibility (const char *str) { - cpp_register_pragma (parse_in, space, name, handler); + VEC_safe_push (visibility, heap, visstack, + default_visibility); + if (!strcmp (str, "default")) + default_visibility = VISIBILITY_DEFAULT; + else if (!strcmp (str, "internal")) + default_visibility = VISIBILITY_INTERNAL; + else if (!strcmp (str, "hidden")) + default_visibility = VISIBILITY_HIDDEN; + else if (!strcmp (str, "protected")) + default_visibility = VISIBILITY_PROTECTED; + else + GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected"); + visibility_options.inpragma = 1; +} + +/* Pop a level of the #pragma visibility stack. */ + +void +pop_visibility (void) +{ + default_visibility = VEC_pop (visibility, visstack); + visibility_options.inpragma + = VEC_length (visibility, visstack) != 0; +} + +/* Sets the default visibility for symbols to something other than that + specified on the command line. */ + +static void +handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) +{ + /* Form is #pragma GCC visibility push(hidden)|pop */ + tree x; + enum cpp_ttype token; + enum { bad, push, pop } action = bad; + + token = pragma_lex (&x); + if (token == CPP_NAME) + { + const char *op = IDENTIFIER_POINTER (x); + if (!strcmp (op, "push")) + action = push; + else if (!strcmp (op, "pop")) + action = pop; + } + if (bad == action) + GCC_BAD ("#pragma GCC visibility must be followed by push or pop"); + else + { + if (pop == action) + { + if (!VEC_length (visibility, visstack)) + GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>"); + else + pop_visibility (); + } + else + { + if (pragma_lex (&x) != CPP_OPEN_PAREN) + GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored"); + token = pragma_lex (&x); + if (token != CPP_NAME) + GCC_BAD ("malformed #pragma GCC visibility push"); + else + push_visibility (IDENTIFIER_POINTER (x)); + if (pragma_lex (&x) != CPP_CLOSE_PAREN) + GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored"); + } + } + if (pragma_lex (&x) != CPP_EOF) + warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>"); +} + +#endif + +static void +handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy)) +{ + const char *kind_string, *option_string; + unsigned int option_index; + enum cpp_ttype token; + diagnostic_t kind; + tree x; + + if (cfun) + { + error ("#pragma GCC diagnostic not allowed inside functions"); + return; + } + + token = pragma_lex (&x); + if (token != CPP_NAME) + GCC_BAD ("missing [error|warning|ignored] after %<#pragma GCC diagnostic%>"); + kind_string = IDENTIFIER_POINTER (x); + if (strcmp (kind_string, "error") == 0) + kind = DK_ERROR; + else if (strcmp (kind_string, "warning") == 0) + kind = DK_WARNING; + else if (strcmp (kind_string, "ignored") == 0) + kind = DK_IGNORED; + else + GCC_BAD ("expected [error|warning|ignored] after %<#pragma GCC diagnostic%>"); + + token = pragma_lex (&x); + if (token != CPP_STRING) + GCC_BAD ("missing option after %<#pragma GCC diagnostic%> kind"); + option_string = TREE_STRING_POINTER (x); + for (option_index = 0; option_index < cl_options_count; option_index++) + if (strcmp (cl_options[option_index].opt_text, option_string) == 0) + { + /* This overrides -Werror, for example. */ + diagnostic_classify_diagnostic (global_dc, option_index, kind); + /* This makes sure the option is enabled, like -Wfoo would do. */ + if (cl_options[option_index].var_type == CLVC_BOOLEAN + && cl_options[option_index].flag_var + && kind != DK_IGNORED) + *(int *) cl_options[option_index].flag_var = 1; + return; + } + GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind"); +} + +/* A vector of registered pragma callbacks. */ + +DEF_VEC_O (pragma_handler); +DEF_VEC_ALLOC_O (pragma_handler, heap); + +static VEC(pragma_handler, heap) *registered_pragmas; + +/* Front-end wrappers for pragma registration to avoid dragging + cpplib.h in almost everywhere. */ + +static void +c_register_pragma_1 (const char *space, const char *name, + pragma_handler handler, bool allow_expansion) +{ + unsigned id; + + VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler); + id = VEC_length (pragma_handler, registered_pragmas); + id += PRAGMA_FIRST_EXTERNAL - 1; + + /* The C++ front end allocates 6 bits in cp_token; the C front end + allocates 7 bits in c_token. At present this is sufficient. */ + gcc_assert (id < 64); + + cpp_register_deferred_pragma (parse_in, space, name, id, + allow_expansion, false); +} + +void +c_register_pragma (const char *space, const char *name, pragma_handler handler) +{ + c_register_pragma_1 (space, name, handler, false); +} + +void +c_register_pragma_with_expansion (const char *space, const char *name, + pragma_handler handler) +{ + c_register_pragma_1 (space, name, handler, true); +} + +void +c_invoke_pragma_handler (unsigned int id) +{ + pragma_handler handler; + + id -= PRAGMA_FIRST_EXTERNAL; + handler = *VEC_index (pragma_handler, registered_pragmas, id); + + handler (parse_in); } /* Set up front-end pragmas. */ void init_pragma (void) { + if (flag_openmp && !flag_preprocess_only) + { + struct omp_pragma_def { const char *name; unsigned int id; }; + static const struct omp_pragma_def omp_pragmas[] = { + { "atomic", PRAGMA_OMP_ATOMIC }, + { "barrier", PRAGMA_OMP_BARRIER }, + { "critical", PRAGMA_OMP_CRITICAL }, + { "flush", PRAGMA_OMP_FLUSH }, + { "for", PRAGMA_OMP_FOR }, + { "master", PRAGMA_OMP_MASTER }, + { "ordered", PRAGMA_OMP_ORDERED }, + { "parallel", PRAGMA_OMP_PARALLEL }, + { "section", PRAGMA_OMP_SECTION }, + { "sections", PRAGMA_OMP_SECTIONS }, + { "single", PRAGMA_OMP_SINGLE }, + { "threadprivate", PRAGMA_OMP_THREADPRIVATE } + }; + + const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas); + int i; + + for (i = 0; i < n_omp_pragmas; ++i) + cpp_register_deferred_pragma (parse_in, "omp", omp_pragmas[i].name, + omp_pragmas[i].id, true, true); + } + + cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess", + PRAGMA_GCC_PCH_PREPROCESS, false, false); + #ifdef HANDLE_PRAGMA_PACK +#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION + c_register_pragma_with_expansion (0, "pack", handle_pragma_pack); +#else c_register_pragma (0, "pack", handle_pragma_pack); #endif +#endif #ifdef HANDLE_PRAGMA_WEAK c_register_pragma (0, "weak", handle_pragma_weak); #endif -#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME - c_register_pragma (0, "redefine_extname", handle_pragma_redefine_extname); +#ifdef HANDLE_PRAGMA_VISIBILITY + c_register_pragma ("GCC", "visibility", handle_pragma_visibility); #endif -#ifdef HANDLE_PRAGMA_EXTERN_PREFIX + + c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic); + + c_register_pragma_with_expansion (0, "redefine_extname", handle_pragma_redefine_extname); c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix); -#endif #ifdef REGISTER_TARGET_PRAGMAS REGISTER_TARGET_PRAGMAS (); diff --git a/contrib/gcc/c-pragma.h b/contrib/gcc/c-pragma.h index a1469db1742..a38d95aecec 100644 --- a/contrib/gcc/c-pragma.h +++ b/contrib/gcc/c-pragma.h @@ -1,5 +1,5 @@ /* Pragma related interfaces. - Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,12 +16,39 @@ for more details. 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. */ #ifndef GCC_C_PRAGMA_H #define GCC_C_PRAGMA_H +#include /* For enum cpp_ttype. */ + +/* Pragma identifiers built in to the front end parsers. Identifiers + for ancillary handlers will follow these. */ +typedef enum pragma_kind { + PRAGMA_NONE = 0, + + PRAGMA_OMP_ATOMIC, + PRAGMA_OMP_BARRIER, + PRAGMA_OMP_CRITICAL, + PRAGMA_OMP_FLUSH, + PRAGMA_OMP_FOR, + PRAGMA_OMP_MASTER, + PRAGMA_OMP_ORDERED, + PRAGMA_OMP_PARALLEL, + PRAGMA_OMP_PARALLEL_FOR, + PRAGMA_OMP_PARALLEL_SECTIONS, + PRAGMA_OMP_SECTION, + PRAGMA_OMP_SECTIONS, + PRAGMA_OMP_SINGLE, + PRAGMA_OMP_THREADPRIVATE, + + PRAGMA_GCC_PCH_PREPROCESS, + + PRAGMA_FIRST_EXTERNAL +} pragma_kind; + /* Cause the `yydebug' variable to be defined. */ #define YYDEBUG 1 extern int yydebug; @@ -44,17 +71,42 @@ extern struct cpp_reader* parse_in; #define HANDLE_PRAGMA_PACK 1 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ +/* It's safe to always leave visibility pragma enabled as if + visibility is not supported on the host OS platform the + statements are ignored. */ +#define HANDLE_PRAGMA_VISIBILITY 1 +extern void push_visibility (const char *); +extern void pop_visibility (void); + extern void init_pragma (void); -/* Front-end wrapper for pragma registration to avoid dragging - cpplib.h in almost everywhere. */ -extern void c_register_pragma (const char *, const char *, - void (*) (struct cpp_reader *)); +/* Front-end wrappers for pragma registration. */ +typedef void (*pragma_handler)(struct cpp_reader *); +extern void c_register_pragma (const char *, const char *, pragma_handler); +extern void c_register_pragma_with_expansion (const char *, const char *, + pragma_handler); +extern void c_invoke_pragma_handler (unsigned int); + extern void maybe_apply_pragma_weak (tree); +extern void maybe_apply_pending_pragma_weaks (void); extern tree maybe_apply_renaming_pragma (tree, tree); extern void add_to_renaming_pragma_list (tree, tree); -extern int c_lex (tree *); -extern int c_lex_with_flags (tree *, unsigned char *); +extern enum cpp_ttype pragma_lex (tree *); + +/* This is not actually available to pragma parsers. It's merely a + convenient location to declare this function for c-lex, after + having enum cpp_ttype declared. */ +extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *); + +/* If 1, then lex strings into the execution character set. + If 0, lex strings into the host character set. + If -1, lex both, and chain them together, such that the former + is the TREE_CHAIN of the latter. */ +extern int c_lex_string_translate; + +/* If true, strings should be passed to the caller of c_lex completely + unmolested (no concatenation, no translation). */ +extern bool c_lex_return_raw_strings; #endif /* GCC_C_PRAGMA_H */ diff --git a/contrib/gcc/c-pretty-print.c b/contrib/gcc/c-pretty-print.c index bcbfd793ad3..5225ea3dd96 100644 --- a/contrib/gcc/c-pretty-print.c +++ b/contrib/gcc/c-pretty-print.c @@ -1,5 +1,5 @@ /* Subroutines common to both C and C++ pretty-printers. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -26,6 +26,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "real.h" #include "c-pretty-print.h" #include "c-tree.h" +#include "tree-iterator.h" +#include "diagnostic.h" /* The pretty-printer code is primarily designed to closely follow (GNU) C and C++ grammars. That is to be contrasted with spaghetti @@ -41,24 +43,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA pp_c_whitespace (PP); \ } while (0) -#define pp_c_left_bracket(PP) \ - do { \ - pp_left_bracket (PP); \ - pp_base (PP)->padding = pp_none; \ - } while (0) - -#define pp_c_right_bracket(PP) \ - do { \ - pp_right_bracket (PP); \ - pp_base (PP)->padding = pp_none; \ - } while (0) - -#define pp_c_star(PP) \ - do { \ - pp_star (PP); \ - pp_base (PP)->padding = pp_none; \ - } while (0) - /* literal */ static void pp_c_char (c_pretty_printer *, int); @@ -118,6 +102,20 @@ pp_c_right_brace (c_pretty_printer *pp) pp_base (pp)->padding = pp_none; } +void +pp_c_left_bracket (c_pretty_printer *pp) +{ + pp_left_bracket (pp); + pp_base (pp)->padding = pp_none; +} + +void +pp_c_right_bracket (c_pretty_printer *pp) +{ + pp_right_bracket (pp); + pp_base (pp)->padding = pp_none; +} + void pp_c_dot (c_pretty_printer *pp) { @@ -132,6 +130,13 @@ pp_c_ampersand (c_pretty_printer *pp) pp_base (pp)->padding = pp_none; } +void +pp_c_star (c_pretty_printer *pp) +{ + pp_star (pp); + pp_base (pp)->padding = pp_none; +} + void pp_c_arrow (c_pretty_printer *pp) { @@ -140,17 +145,36 @@ pp_c_arrow (c_pretty_printer *pp) } void -pp_c_semicolon(c_pretty_printer *pp) +pp_c_semicolon (c_pretty_printer *pp) { pp_semicolon (pp); pp_base (pp)->padding = pp_none; } +void +pp_c_complement (c_pretty_printer *pp) +{ + pp_complement (pp); + pp_base (pp)->padding = pp_none; +} + +void +pp_c_exclamation (c_pretty_printer *pp) +{ + pp_exclamation (pp); + pp_base (pp)->padding = pp_none; +} + +/* Print out the external representation of CV-QUALIFIER. */ + static void pp_c_cv_qualifier (c_pretty_printer *pp, const char *cv) { const char *p = pp_last_position_in_text (pp); - if (p != NULL && *p == '*') + /* The C programming language does not have references, but it is much + simpler to handle those here rather than going through the same + logic in the C++ pretty-printer. */ + if (p != NULL && (*p == '*' || *p == '&')) pp_c_whitespace (pp); pp_c_identifier (pp, cv); } @@ -165,6 +189,9 @@ pp_c_type_cast (c_pretty_printer *pp, tree t) pp_c_right_paren (pp); } +/* We're about to pretty-print a pointer type as indicated by T. + Output a whitespace, if needed, preparing for subsequent output. */ + void pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t) { @@ -172,8 +199,8 @@ pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t) { tree pointee = strip_pointer_operator (TREE_TYPE (t)); if (TREE_CODE (pointee) != ARRAY_TYPE - && TREE_CODE (pointee) != FUNCTION_TYPE) - pp_c_whitespace (pp); + && TREE_CODE (pointee) != FUNCTION_TYPE) + pp_c_whitespace (pp); } } @@ -198,7 +225,7 @@ void pp_c_type_qualifier_list (c_pretty_printer *pp, tree t) { int qualifiers; - + if (!TYPE_P (t)) t = TREE_TYPE (t); @@ -226,14 +253,21 @@ pp_c_pointer (c_pretty_printer *pp, tree t) /* It is easier to handle C++ reference types here. */ case REFERENCE_TYPE: if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE) - pp_c_pointer (pp, TREE_TYPE (t)); + pp_c_pointer (pp, TREE_TYPE (t)); if (TREE_CODE (t) == POINTER_TYPE) - pp_c_star (pp); + pp_c_star (pp); else - pp_c_ampersand (pp); + pp_c_ampersand (pp); pp_c_type_qualifier_list (pp, t); break; + /* ??? This node is now in GENERIC and so shouldn't be here. But + we'll fix that later. */ + case DECL_EXPR: + pp_declaration (pp, DECL_EXPR_DECL (t)); + pp_needs_newline (pp) = true; + break; + default: pp_unsupported_tree (pp, t); } @@ -272,19 +306,50 @@ pp_c_type_specifier (c_pretty_printer *pp, tree t) break; case IDENTIFIER_NODE: - pp_c_tree_identifier (pp, t); + pp_c_tree_decl_identifier (pp, t); break; case VOID_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: case INTEGER_TYPE: case REAL_TYPE: if (TYPE_NAME (t)) - t = TYPE_NAME (t); + { + t = TYPE_NAME (t); + pp_c_type_specifier (pp, t); + } else - t = c_common_type_for_mode (TYPE_MODE (t), TREE_UNSIGNED (t)); - pp_c_type_specifier (pp, t); + { + int prec = TYPE_PRECISION (t); + t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t)); + if (TYPE_NAME (t)) + { + pp_c_type_specifier (pp, t); + if (TYPE_PRECISION (t) != prec) + { + pp_string (pp, ":"); + pp_decimal_int (pp, prec); + } + } + else + { + switch (code) + { + case INTEGER_TYPE: + pp_string (pp, (TYPE_UNSIGNED (t) + ? ""); + } + } break; case TYPE_DECL: @@ -341,16 +406,18 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t) case REFERENCE_TYPE: case POINTER_TYPE: { - /* Get the types-specifier of this type. */ - tree pointee = strip_pointer_operator (TREE_TYPE (t)); - pp_c_specifier_qualifier_list (pp, pointee); - if (TREE_CODE (pointee) == ARRAY_TYPE - || TREE_CODE (pointee) == FUNCTION_TYPE) - { - pp_c_whitespace (pp); - pp_c_left_paren (pp); - } - pp_ptr_operator (pp, t); + /* Get the types-specifier of this type. */ + tree pointee = strip_pointer_operator (TREE_TYPE (t)); + pp_c_specifier_qualifier_list (pp, pointee); + if (TREE_CODE (pointee) == ARRAY_TYPE + || TREE_CODE (pointee) == FUNCTION_TYPE) + { + pp_c_whitespace (pp); + pp_c_left_paren (pp); + } + else if (!c_dialect_cxx ()) + pp_c_whitespace (pp); + pp_ptr_operator (pp, t); } break; @@ -363,9 +430,9 @@ pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t) case COMPLEX_TYPE: pp_c_specifier_qualifier_list (pp, TREE_TYPE (t)); if (code == COMPLEX_TYPE) - pp_c_identifier (pp, flag_isoc99 ? "_Complex" : "__complex__"); + pp_c_identifier (pp, flag_isoc99 ? "_Complex" : "__complex__"); else if (code == VECTOR_TYPE) - pp_c_identifier (pp, "__vector__"); + pp_c_identifier (pp, "__vector__"); break; default: @@ -398,17 +465,17 @@ pp_c_parameter_type_list (c_pretty_printer *pp, tree t) { bool first = true; for ( ; parms && parms != void_list_node; parms = TREE_CHAIN (parms)) - { - if (!first) - pp_separate_with (pp, ','); - first = false; - pp_declaration_specifiers - (pp, want_parm_decl ? parms : TREE_VALUE (parms)); - if (want_parm_decl) - pp_declarator (pp, parms); - else - pp_abstract_declarator (pp, TREE_VALUE (parms)); - } + { + if (!first) + pp_separate_with (pp, ','); + first = false; + pp_declaration_specifiers + (pp, want_parm_decl ? parms : TREE_VALUE (parms)); + if (want_parm_decl) + pp_declarator (pp, parms); + else + pp_abstract_declarator (pp, TREE_VALUE (parms)); + } } pp_c_right_paren (pp); } @@ -423,8 +490,8 @@ pp_c_abstract_declarator (c_pretty_printer *pp, tree t) if (TREE_CODE (t) == POINTER_TYPE) { if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE - || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) - pp_c_right_paren (pp); + || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) + pp_c_right_paren (pp); t = TREE_TYPE (t); } @@ -445,7 +512,7 @@ pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t) case POINTER_TYPE: pp_abstract_declarator (pp, t); break; - + case FUNCTION_TYPE: pp_c_parameter_type_list (pp, t); pp_direct_abstract_declarator (pp, TREE_TYPE (t)); @@ -453,8 +520,17 @@ pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t) case ARRAY_TYPE: pp_c_left_bracket (pp); - if (TYPE_DOMAIN (t)) - pp_expression (pp, TYPE_MAX_VALUE (TYPE_DOMAIN (t))); + if (TYPE_DOMAIN (t) && TYPE_MAX_VALUE (TYPE_DOMAIN (t))) + { + tree maxval = TYPE_MAX_VALUE (TYPE_DOMAIN (t)); + tree type = TREE_TYPE (maxval); + + if (host_integerp (maxval, 0)) + pp_wide_integer (pp, tree_low_cst (maxval, 0) + 1); + else + pp_expression (pp, fold (build2 (PLUS_EXPR, type, maxval, + build_int_cst (type, 1)))); + } pp_c_right_bracket (pp); pp_direct_abstract_declarator (pp, TREE_TYPE (t)); break; @@ -471,7 +547,7 @@ pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t) case COMPLEX_TYPE: case TYPE_DECL: break; - + default: pp_unsupported_tree (pp, t); break; @@ -503,9 +579,9 @@ pp_c_storage_class_specifier (c_pretty_printer *pp, tree t) else if (DECL_P (t)) { if (DECL_REGISTER (t)) - pp_c_identifier (pp, "register"); + pp_c_identifier (pp, "register"); else if (TREE_STATIC (t) && TREE_CODE (t) == VAR_DECL) - pp_c_identifier (pp, "static"); + pp_c_identifier (pp, "static"); } } @@ -540,7 +616,7 @@ pp_c_declaration_specifiers (c_pretty_printer *pp, tree t) direct-declarator [ static type-qualifier-list(opt) assignment-expression(opt)] direct-declarator [ type-qualifier-list static assignment-expression ] direct-declarator [ type-qualifier-list * ] - direct-declaratpr ( parameter-type-list ) + direct-declarator ( parameter-type-list ) direct-declarator ( identifier-list(opt) ) */ void @@ -553,11 +629,10 @@ pp_c_direct_declarator (c_pretty_printer *pp, tree t) case TYPE_DECL: case FIELD_DECL: case LABEL_DECL: - if (DECL_NAME (t)) - { - pp_c_space_for_pointer_operator (pp, TREE_TYPE (t)); - pp_c_tree_identifier (pp, DECL_NAME (t)); - } + pp_c_space_for_pointer_operator (pp, TREE_TYPE (t)); + pp_c_tree_decl_identifier (pp, t); + break; + case ARRAY_TYPE: case POINTER_TYPE: pp_abstract_declarator (pp, TREE_TYPE (t)); @@ -570,14 +645,14 @@ pp_c_direct_declarator (c_pretty_printer *pp, tree t) case FUNCTION_DECL: pp_c_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t))); - pp_c_tree_identifier (pp, DECL_NAME (t)); + pp_c_tree_decl_identifier (pp, t); if (pp_c_base (pp)->flags & pp_c_flag_abstract) - pp_abstract_declarator (pp, TREE_TYPE (t)); + pp_abstract_declarator (pp, TREE_TYPE (t)); else - { - pp_parameter_list (pp, t); - pp_abstract_declarator (pp, TREE_TYPE (TREE_TYPE (t))); - } + { + pp_parameter_list (pp, t); + pp_abstract_declarator (pp, TREE_TYPE (TREE_TYPE (t))); + } break; case INTEGER_TYPE: @@ -619,7 +694,7 @@ pp_c_declarator (c_pretty_printer *pp, tree t) pp_direct_declarator (pp, t); break; - + default: pp_unsupported_tree (pp, t); break; @@ -651,7 +726,7 @@ pp_c_attributes (c_pretty_printer *pp, tree attributes) { pp_tree_identifier (pp, TREE_PURPOSE (attributes)); if (TREE_VALUE (attributes)) - pp_c_call_argument_list (pp, TREE_VALUE (attributes)); + pp_c_call_argument_list (pp, TREE_VALUE (attributes)); if (TREE_CHAIN (attributes)) pp_separate_with (pp, ','); @@ -677,50 +752,37 @@ pp_c_function_definition (c_pretty_printer *pp, tree t) /* Expressions. */ -/* Print out a c-char. */ +/* Print out a c-char. This is called solely for characters which are + in the *target* execution character set. We ought to convert them + back to the *host* execution character set before printing, but we + have no way to do this at present. A decent compromise is to print + all characters as if they were in the host execution character set, + and not attempt to recover any named escape characters, but render + all unprintables as octal escapes. If the host and target character + sets are the same, this produces relatively readable output. If they + are not the same, strings may appear as gibberish, but that's okay + (in fact, it may well be what the reader wants, e.g. if they are looking + to see if conversion to the target character set happened correctly). + + A special case: we need to prefix \, ", and ' with backslashes. It is + correct to do so for the *host*'s \, ", and ', because the rest of the + file appears in the host character set. */ static void pp_c_char (c_pretty_printer *pp, int c) { - switch (c) + if (ISPRINT (c)) { - case TARGET_NEWLINE: - pp_string (pp, "\\n"); - break; - case TARGET_TAB: - pp_string (pp, "\\t"); - break; - case TARGET_VT: - pp_string (pp, "\\v"); - break; - case TARGET_BS: - pp_string (pp, "\\b"); - break; - case TARGET_CR: - pp_string (pp, "\\r"); - break; - case TARGET_FF: - pp_string (pp, "\\f"); - break; - case TARGET_BELL: - pp_string (pp, "\\a"); - break; - case '\\': - pp_string (pp, "\\\\"); - break; - case '\'': - pp_string (pp, "\\'"); - break; - case '\"': - pp_string (pp, "\\\""); - break; - default: - if (ISPRINT (c)) - pp_character (pp, c); - else - pp_scalar (pp, "\\%03o", (unsigned) c); - break; + switch (c) + { + case '\\': pp_string (pp, "\\\\"); break; + case '\'': pp_string (pp, "\\\'"); break; + case '\"': pp_string (pp, "\\\""); break; + default: pp_character (pp, c); + } } + else + pp_scalar (pp, "\\%03o", (unsigned) c); } /* Print out a STRING literal. */ @@ -737,6 +799,8 @@ pp_c_string_literal (c_pretty_printer *pp, tree s) pp_doublequote (pp); } +/* Pretty-print an INTEGER literal. */ + static void pp_c_integer_constant (c_pretty_printer *pp, tree i) { @@ -747,22 +811,24 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i) else { if (tree_int_cst_sgn (i) < 0) - { - pp_c_char (pp, '-'); - i = build_int_2 (-TREE_INT_CST_LOW (i), - ~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i)); - } + { + pp_character (pp, '-'); + i = build_int_cst_wide (NULL_TREE, + -TREE_INT_CST_LOW (i), + ~TREE_INT_CST_HIGH (i) + + !TREE_INT_CST_LOW (i)); + } sprintf (pp_buffer (pp)->digit_buffer, - HOST_WIDE_INT_PRINT_DOUBLE_HEX, - TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i)); + HOST_WIDE_INT_PRINT_DOUBLE_HEX, + TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i)); pp_string (pp, pp_buffer (pp)->digit_buffer); } - if (TREE_UNSIGNED (type)) + if (TYPE_UNSIGNED (type)) pp_character (pp, 'u'); if (type == long_integer_type_node || type == long_unsigned_type_node) pp_character (pp, 'l'); else if (type == long_long_integer_type_node - || type == long_long_unsigned_type_node) + || type == long_long_unsigned_type_node) pp_string (pp, "ll"); } @@ -773,10 +839,10 @@ pp_c_character_constant (c_pretty_printer *pp, tree c) { tree type = TREE_TYPE (c); if (type == wchar_type_node) - pp_character (pp, 'L'); + pp_character (pp, 'L'); pp_quote (pp); - if (host_integerp (c, TREE_UNSIGNED (type))) - pp_c_char (pp, tree_low_cst (c, TREE_UNSIGNED (type))); + if (host_integerp (c, TYPE_UNSIGNED (type))) + pp_c_char (pp, tree_low_cst (c, TYPE_UNSIGNED (type))); else pp_scalar (pp, "\\x%x", (unsigned) TREE_INT_CST_LOW (c)); pp_quote (pp); @@ -853,15 +919,21 @@ pp_c_floating_constant (c_pretty_printer *pp, tree r) pp_character (pp, 'f'); else if (TREE_TYPE (r) == long_double_type_node) pp_character (pp, 'l'); + else if (TREE_TYPE (r) == dfloat128_type_node) + pp_string (pp, "dl"); + else if (TREE_TYPE (r) == dfloat64_type_node) + pp_string (pp, "dd"); + else if (TREE_TYPE (r) == dfloat32_type_node) + pp_string (pp, "df"); } /* Pretty-print a compound literal expression. GNU extensions include - vector constants. */ + vector constants. */ static void pp_c_compound_literal (c_pretty_printer *pp, tree e) { - tree type = TREE_TYPE (e); + tree type = TREE_TYPE (e); pp_c_type_cast (pp, type); switch (TREE_CODE (type)) @@ -895,16 +967,16 @@ pp_c_constant (c_pretty_printer *pp, tree e) { case INTEGER_CST: { - tree type = TREE_TYPE (e); - if (type == boolean_type_node) - pp_c_bool_constant (pp, e); - else if (type == char_type_node) - pp_c_character_constant (pp, e); - else if (TREE_CODE (type) == ENUMERAL_TYPE - && pp_c_enumeration_constant (pp, e)) - ; - else - pp_c_integer_constant (pp, e); + tree type = TREE_TYPE (e); + if (type == boolean_type_node) + pp_c_bool_constant (pp, e); + else if (type == char_type_node) + pp_c_character_constant (pp, e); + else if (TREE_CODE (type) == ENUMERAL_TYPE + && pp_c_enumeration_constant (pp, e)) + ; + else + pp_c_integer_constant (pp, e); } break; @@ -922,11 +994,13 @@ pp_c_constant (c_pretty_printer *pp, tree e) } } +/* Pretty-print an IDENTIFIER_NODE, preceded by whitespace is necessary. */ + void pp_c_identifier (c_pretty_printer *pp, const char *id) { - pp_c_maybe_whitespace (pp); - pp_identifier (pp, id); + pp_c_maybe_whitespace (pp); + pp_identifier (pp, id); pp_base (pp)->padding = pp_before; } @@ -948,8 +1022,9 @@ pp_c_primary_expression (c_pretty_printer *pp, tree e) case CONST_DECL: case FUNCTION_DECL: case LABEL_DECL: - e = DECL_NAME (e); - /* Fall through. */ + pp_c_tree_decl_identifier (pp, e); + break; + case IDENTIFIER_NODE: pp_c_tree_identifier (pp, e); break; @@ -968,9 +1043,19 @@ pp_c_primary_expression (c_pretty_printer *pp, tree e) pp_c_constant (pp, e); break; - case STMT_EXPR: + case TARGET_EXPR: + pp_c_identifier (pp, "__builtin_memcpy"); pp_c_left_paren (pp); - pp_statement (pp, STMT_EXPR_STMT (e)); + pp_ampersand (pp); + pp_primary_expression (pp, TREE_OPERAND (e, 0)); + pp_separate_with (pp, ','); + pp_ampersand (pp); + pp_initializer (pp, TREE_OPERAND (e, 1)); + if (TREE_OPERAND (e, 2)) + { + pp_separate_with (pp, ','); + pp_c_expression (pp, TREE_OPERAND (e, 2)); + } pp_c_right_paren (pp); break; @@ -993,13 +1078,7 @@ static void pp_c_initializer (c_pretty_printer *pp, tree e) { if (TREE_CODE (e) == CONSTRUCTOR) - { - enum tree_code code = TREE_CODE (TREE_TYPE (e)); - if (code == RECORD_TYPE || code == UNION_TYPE || code == ARRAY_TYPE) - pp_c_brace_enclosed_initializer_list (pp, e); - else - pp_unsupported_tree (pp, TREE_OPERAND (e, 1)); - } + pp_c_brace_enclosed_initializer_list (pp, e); else pp_expression (pp, e); } @@ -1012,26 +1091,28 @@ void pp_c_init_declarator (c_pretty_printer *pp, tree t) { pp_declarator (pp, t); - if (DECL_INITIAL (t)) + /* We don't want to output function definitions here. There are handled + elsewhere (and the syntactic form is bogus anyway). */ + if (TREE_CODE (t) != FUNCTION_DECL && DECL_INITIAL (t)) { tree init = DECL_INITIAL (t); /* This C++ bit is handled here because it is easier to do so. - In templates, the C++ parser builds a TREE_LIST for a - direct-initialization; the TREE_PURPOSE is the variable to - initialize and the TREE_VALUE is the initializer. */ + In templates, the C++ parser builds a TREE_LIST for a + direct-initialization; the TREE_PURPOSE is the variable to + initialize and the TREE_VALUE is the initializer. */ if (TREE_CODE (init) == TREE_LIST) - { - pp_c_left_paren (pp); - pp_expression (pp, TREE_VALUE (init)); - pp_right_paren (pp); - } + { + pp_c_left_paren (pp); + pp_expression (pp, TREE_VALUE (init)); + pp_right_paren (pp); + } else - { - pp_space (pp); - pp_equal (pp); - pp_space (pp); - pp_c_initializer (pp, init); - } + { + pp_space (pp); + pp_equal (pp); + pp_space (pp); + pp_c_initializer (pp, init); + } } } @@ -1062,48 +1143,59 @@ pp_c_initializer_list (c_pretty_printer *pp, tree e) case UNION_TYPE: case ARRAY_TYPE: { - tree init = TREE_OPERAND (e, 0); - for (; init != NULL_TREE; init = TREE_CHAIN (init)) - { - if (code == RECORD_TYPE || code == UNION_TYPE) - { - pp_c_dot (pp); - pp_c_primary_expression (pp, TREE_PURPOSE (init)); - } - else - { - pp_c_left_bracket (pp); - if (TREE_PURPOSE (init)) - pp_c_constant (pp, TREE_PURPOSE (init)); - pp_c_right_bracket (pp); - } - pp_c_whitespace (pp); - pp_equal (pp); - pp_c_whitespace (pp); - pp_initializer (pp, TREE_VALUE (init)); - if (TREE_CHAIN (init)) - pp_separate_with (pp, ','); - } + tree init = TREE_OPERAND (e, 0); + for (; init != NULL_TREE; init = TREE_CHAIN (init)) + { + if (code == RECORD_TYPE || code == UNION_TYPE) + { + pp_c_dot (pp); + pp_c_primary_expression (pp, TREE_PURPOSE (init)); + } + else + { + pp_c_left_bracket (pp); + if (TREE_PURPOSE (init)) + pp_c_constant (pp, TREE_PURPOSE (init)); + pp_c_right_bracket (pp); + } + pp_c_whitespace (pp); + pp_equal (pp); + pp_c_whitespace (pp); + pp_initializer (pp, TREE_VALUE (init)); + if (TREE_CHAIN (init)) + pp_separate_with (pp, ','); + } } - break; + return; case VECTOR_TYPE: - pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e)); - break; + if (TREE_CODE (e) == VECTOR_CST) + pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e)); + else if (TREE_CODE (e) == CONSTRUCTOR) + pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); + else + break; + return; case COMPLEX_TYPE: - { - const bool cst = TREE_CODE (e) == COMPLEX_CST; - pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0)); - pp_separate_with (pp, ','); - pp_expression (pp, cst ? TREE_IMAGPART (e) : TREE_OPERAND (e, 1)); - } - break; + if (TREE_CODE (e) == CONSTRUCTOR) + pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); + else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) + { + const bool cst = TREE_CODE (e) == COMPLEX_CST; + pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0)); + pp_separate_with (pp, ','); + pp_expression (pp, cst ? TREE_IMAGPART (e) : TREE_OPERAND (e, 1)); + } + else + break; + return; default: - pp_unsupported_tree (pp, type); break; } + + pp_unsupported_tree (pp, type); } /* Pretty-print a brace-enclosed initializer-list. */ @@ -1135,7 +1227,9 @@ pp_c_id_expression (c_pretty_printer *pp, tree t) case FUNCTION_DECL: case FIELD_DECL: case LABEL_DECL: - t = DECL_NAME (t); + pp_c_tree_decl_identifier (pp, t); + break; + case IDENTIFIER_NODE: pp_c_tree_identifier (pp, t); break; @@ -1169,11 +1263,6 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) pp_identifier (pp, code == POSTINCREMENT_EXPR ? "++" : "--"); break; - case ARROW_EXPR: - pp_postfix_expression (pp, TREE_OPERAND (e, 0)); - pp_c_arrow (pp); - break; - case ARRAY_REF: pp_postfix_expression (pp, TREE_OPERAND (e, 0)); pp_c_left_bracket (pp); @@ -1186,6 +1275,62 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) pp_c_call_argument_list (pp, TREE_OPERAND (e, 1)); break; + case UNORDERED_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "isunordered" + : "__builtin_isunordered"); + goto two_args_fun; + + case ORDERED_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!isunordered" + : "!__builtin_isunordered"); + goto two_args_fun; + + case UNLT_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!isgreaterequal" + : "!__builtin_isgreaterequal"); + goto two_args_fun; + + case UNLE_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!isgreater" + : "!__builtin_isgreater"); + goto two_args_fun; + + case UNGT_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!islessequal" + : "!__builtin_islessequal"); + goto two_args_fun; + + case UNGE_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!isless" + : "!__builtin_isless"); + goto two_args_fun; + + case UNEQ_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "!islessgreater" + : "!__builtin_islessgreater"); + goto two_args_fun; + + case LTGT_EXPR: + pp_c_identifier (pp, flag_isoc99 + ? "islessgreater" + : "__builtin_islessgreater"); + goto two_args_fun; + + two_args_fun: + pp_c_left_paren (pp); + pp_expression (pp, TREE_OPERAND (e, 0)); + pp_separate_with (pp, ','); + pp_expression (pp, TREE_OPERAND (e, 1)); + pp_c_right_paren (pp); + break; + case ABS_EXPR: pp_c_identifier (pp, "__builtin_abs"); pp_c_left_paren (pp); @@ -1234,10 +1379,10 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) case ADDR_EXPR: if (TREE_CODE (TREE_OPERAND (e, 0)) == FUNCTION_DECL) - { - pp_c_id_expression (pp, TREE_OPERAND (e, 0)); - break; - } + { + pp_c_id_expression (pp, TREE_OPERAND (e, 0)); + break; + } /* else fall through. */ default: @@ -1259,6 +1404,22 @@ pp_c_expression_list (c_pretty_printer *pp, tree e) } } +/* Print out V, which contains the elements of a constructor. */ + +void +pp_c_constructor_elts (c_pretty_printer *pp, VEC(constructor_elt,gc) *v) +{ + unsigned HOST_WIDE_INT ix; + tree value; + + FOR_EACH_CONSTRUCTOR_VALUE (v, ix, value) + { + pp_expression (pp, value); + if (ix != VEC_length (constructor_elt, v) - 1) + pp_separate_with (pp, ','); + } +} + /* Print out an expression-list in parens, as in a function call. */ void @@ -1280,7 +1441,7 @@ pp_c_call_argument_list (c_pretty_printer *pp, tree t) unary-operator: one of * & + - ! ~ - + GNU extensions. unary-expression: __alignof__ unary-expression @@ -1320,16 +1481,6 @@ pp_c_unary_expression (c_pretty_printer *pp, tree e) pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); break; - case SIZEOF_EXPR: - case ALIGNOF_EXPR: - pp_c_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__"); - pp_c_whitespace (pp); - if (TYPE_P (TREE_OPERAND (e, 0))) - pp_c_type_cast (pp, TREE_OPERAND (e, 0)); - else - pp_unary_expression (pp, TREE_OPERAND (e, 0)); - break; - case REALPART_EXPR: case IMAGPART_EXPR: pp_c_identifier (pp, code == REALPART_EXPR ? "__real__" : "__imag__"); @@ -1355,6 +1506,7 @@ pp_c_cast_expression (c_pretty_printer *pp, tree e) case FLOAT_EXPR: case FIX_TRUNC_EXPR: case CONVERT_EXPR: + case NOP_EXPR: pp_c_type_cast (pp, TREE_TYPE (e)); pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); break; @@ -1417,7 +1569,7 @@ pp_c_additive_expression (c_pretty_printer *pp, tree e) else pp_minus (pp); pp_c_whitespace (pp); - pp_multiplicative_expression (pp, TREE_OPERAND (e, 1)); + pp_multiplicative_expression (pp, TREE_OPERAND (e, 1)); break; default: @@ -1635,7 +1787,7 @@ pp_c_conditional_expression (c_pretty_printer *pp, tree e) /* assignment-expression: conditional-expression - unary-expression assignment-operator assignment-expression + unary-expression assignment-operator assignment-expression assignment-expression: one of = *= /= %= += -= >>= <<= &= ^= |= */ @@ -1691,19 +1843,25 @@ pp_c_expression (c_pretty_printer *pp, tree e) case FIELD_DECL: case LABEL_DECL: case ERROR_MARK: - case STMT_EXPR: pp_primary_expression (pp, e); break; case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: - case ARROW_EXPR: case ARRAY_REF: case CALL_EXPR: case COMPONENT_REF: case COMPLEX_CST: case COMPLEX_EXPR: case VECTOR_CST: + case ORDERED_EXPR: + case UNORDERED_EXPR: + case LTGT_EXPR: + case UNEQ_EXPR: + case UNLE_EXPR: + case UNLT_EXPR: + case UNGE_EXPR: + case UNGT_EXPR: case ABS_EXPR: case CONSTRUCTOR: case COMPOUND_LITERAL_EXPR: @@ -1719,8 +1877,6 @@ pp_c_expression (c_pretty_printer *pp, tree e) case TRUTH_NOT_EXPR: case PREINCREMENT_EXPR: case PREDECREMENT_EXPR: - case SIZEOF_EXPR: - case ALIGNOF_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: pp_c_unary_expression (pp, e); @@ -1729,6 +1885,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) case FLOAT_EXPR: case FIX_TRUNC_EXPR: case CONVERT_EXPR: + case NOP_EXPR: pp_c_cast_expression (pp, e); break; @@ -1774,7 +1931,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) case NE_EXPR: pp_c_equality_expression (pp, e); break; - + case COND_EXPR: pp_conditional_expression (pp, e); break; @@ -1797,17 +1954,15 @@ pp_c_expression (c_pretty_printer *pp, tree e) pp_c_right_paren (pp); break; - case NOP_EXPR: case NON_LVALUE_EXPR: case SAVE_EXPR: - case UNSAVE_EXPR: pp_expression (pp, TREE_OPERAND (e, 0)); break; case TARGET_EXPR: pp_postfix_expression (pp, TREE_OPERAND (e, 1)); break; - + default: pp_unsupported_tree (pp, e); break; @@ -1818,308 +1973,16 @@ pp_c_expression (c_pretty_printer *pp, tree e) /* Statements. */ -/* statement: - labeled-statement - compound-statement - expression-statement - selection-statement - iteration-statement - jump-statement */ - void pp_c_statement (c_pretty_printer *pp, tree stmt) { - enum tree_code code; - if (stmt == NULL) return; - - code = TREE_CODE (stmt); - switch (code) - { - /* labeled-statement: - identifier : statement - case constant-expression : statement - default : statement */ - case LABEL_STMT: - case CASE_LABEL: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, -3); - else - pp_indentation (pp) -= 3; - if (code == LABEL_STMT) - pp_tree_identifier (pp, DECL_NAME (LABEL_STMT_LABEL (stmt))); - else if (code == CASE_LABEL) - { - if (CASE_LOW (stmt) == NULL_TREE) - pp_identifier (pp, "default"); - else - { - pp_c_identifier (pp, "case"); - pp_c_whitespace (pp); - pp_conditional_expression (pp, CASE_LOW (stmt)); - if (CASE_HIGH (stmt)) - { - pp_identifier (pp, "..."); - pp_conditional_expression (pp, CASE_HIGH (stmt)); - } - } - } - pp_colon (pp); - pp_indentation (pp) += 3; - pp_needs_newline (pp) = true; - break; - /* compound-statement: - { block-item-list(opt) } + if (pp_needs_newline (pp)) + pp_newline_and_indent (pp, 0); - block-item-list: - block-item - block-item-list block-item - - block-item: - declaration - statement */ - case COMPOUND_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_left_brace (pp); - pp_newline_and_indent (pp, 3); - for (stmt = COMPOUND_BODY (stmt); stmt; stmt = TREE_CHAIN (stmt)) - pp_statement (pp, stmt); - pp_newline_and_indent (pp, -3); - pp_c_right_brace (pp); - pp_needs_newline (pp) = true; - break; - - /* expression-statement: - expression(opt) ; */ - case EXPR_STMT: - case CLEANUP_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - { - tree e = code == EXPR_STMT - ? EXPR_STMT_EXPR (stmt) - : CLEANUP_EXPR (stmt); - if (e) - pp_expression (pp, e); - } - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - /* selection-statement: - if ( expression ) statement - if ( expression ) statement else statement - switch ( expression ) statement */ - case IF_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, "if"); - pp_c_whitespace (pp); - pp_c_left_paren (pp); - pp_expression (pp, IF_COND (stmt)); - pp_c_right_paren (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, THEN_CLAUSE (stmt)); - pp_newline_and_indent (pp, -3); - if (ELSE_CLAUSE (stmt)) - { - tree else_clause = ELSE_CLAUSE (stmt); - pp_c_identifier (pp, "else"); - if (TREE_CODE (else_clause) == IF_STMT) - pp_c_whitespace (pp); - else - pp_newline_and_indent (pp, 3); - pp_statement (pp, else_clause); - if (TREE_CODE (else_clause) != IF_STMT) - pp_newline_and_indent (pp, -3); - } - break; - - case SWITCH_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, "switch"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, SWITCH_COND (stmt)); - pp_c_right_paren (pp); - pp_indentation (pp) += 3; - pp_needs_newline (pp) = true; - pp_statement (pp, SWITCH_BODY (stmt)); - pp_newline_and_indent (pp, -3); - break; - - /* iteration-statement: - while ( expression ) statement - do statement while ( expression ) ; - for ( expression(opt) ; expression(opt) ; expression(opt) ) statement - for ( declaration expression(opt) ; expression(opt) ) statement */ - case WHILE_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, "while"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, WHILE_COND (stmt)); - pp_c_right_paren (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, WHILE_BODY (stmt)); - pp_indentation (pp) -= 3; - pp_needs_newline (pp) = true; - break; - - case DO_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, "do"); - pp_newline_and_indent (pp, 3); - pp_statement (pp, DO_BODY (stmt)); - pp_newline_and_indent (pp, -3); - pp_c_identifier (pp, "while"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, DO_COND (stmt)); - pp_c_right_paren (pp); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - case FOR_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, "for"); - pp_space (pp); - pp_c_left_paren (pp); - if (FOR_INIT_STMT (stmt)) - pp_statement (pp, FOR_INIT_STMT (stmt)); - else - pp_c_semicolon (pp); - pp_needs_newline (pp) = false; - pp_c_whitespace (pp); - if (FOR_COND (stmt)) - pp_expression (pp, FOR_COND (stmt)); - pp_c_semicolon (pp); - pp_needs_newline (pp) = false; - pp_c_whitespace (pp); - if (FOR_EXPR (stmt)) - pp_expression (pp, FOR_EXPR (stmt)); - pp_c_right_paren (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, FOR_BODY (stmt)); - pp_indentation (pp) -= 3; - pp_needs_newline (pp) = true; - break; - - /* jump-statement: - goto identifier; - continue ; - return expression(opt) ; */ - case BREAK_STMT: - case CONTINUE_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_identifier (pp, code == BREAK_STMT ? "break" : "continue"); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - case RETURN_STMT: - case GOTO_STMT: - { - tree e = code == RETURN_STMT - ? RETURN_STMT_EXPR (stmt) - : GOTO_DESTINATION (stmt); - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_c_identifier (pp, code == RETURN_STMT ? "return" : "goto"); - pp_c_whitespace (pp); - if (e) - { - if (TREE_CODE (e) == INIT_EXPR - && TREE_CODE (TREE_OPERAND (e, 0)) == RESULT_DECL) - e = TREE_OPERAND (e, 1); - pp_expression (pp, e); - } - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - } - break; - - case SCOPE_STMT: - if (!SCOPE_NULLIFIED_P (stmt) && SCOPE_NO_CLEANUPS_P (stmt)) - { - int i = 0; - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - if (SCOPE_BEGIN_P (stmt)) - { - pp_left_brace (pp); - i = 3; - } - else if (SCOPE_END_P (stmt)) - { - pp_right_brace (pp); - i = -3; - } - pp_indentation (pp) += i; - pp_needs_newline (pp) = true; - } - break; - - case DECL_STMT: - if (pp_needs_newline (pp)) - pp_newline_and_indent (pp, 0); - pp_declaration (pp, DECL_STMT_DECL (stmt)); - pp_needs_newline (pp) = true; - break; - - case ASM_STMT: - { - bool has_volatile_p = ASM_VOLATILE_P (stmt); - bool is_extended = has_volatile_p || ASM_INPUTS (stmt) - || ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt); - pp_c_identifier (pp, is_extended ? "__asm__" : "asm"); - if (has_volatile_p) - pp_c_identifier (pp, "__volatile__"); - pp_space (pp); - pp_c_left_paren (pp); - pp_c_string_literal (pp, ASM_STRING (stmt)); - if (is_extended) - { - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_OUTPUTS (stmt)) - pp_expression (pp, ASM_OUTPUTS (stmt)); - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_INPUTS (stmt)) - pp_expression (pp, ASM_INPUTS (stmt)); - pp_space (pp); - pp_separate_with (pp, ':'); - if (ASM_CLOBBERS (stmt)) - pp_expression (pp, ASM_CLOBBERS (stmt)); - } - pp_c_right_paren (pp); - pp_newline (pp); - } - break; - - case FILE_STMT: - pp_c_identifier (pp, "__FILE__"); - pp_space (pp); - pp_equal (pp); - pp_c_whitespace (pp); - pp_c_identifier (pp, FILE_STMT_FILENAME (stmt)); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - default: - pp_unsupported_tree (pp, stmt); - } + dump_generic_node (pp_base (pp), stmt, pp_indentation (pp), 0, true); } @@ -2146,6 +2009,7 @@ pp_c_pretty_printer_init (c_pretty_printer *pp) pp->statement = pp_c_statement; + pp->constant = pp_c_constant; pp->id_expression = pp_c_id_expression; pp->primary_expression = pp_c_primary_expression; pp->postfix_expression = pp_c_postfix_expression; @@ -2156,3 +2020,59 @@ pp_c_pretty_printer_init (c_pretty_printer *pp) pp->assignment_expression = pp_c_assignment_expression; pp->expression = pp_c_expression; } + + +/* Print the tree T in full, on file FILE. */ + +void +print_c_tree (FILE *file, tree t) +{ + static c_pretty_printer pp_rec; + static bool initialized = 0; + c_pretty_printer *pp = &pp_rec; + + if (!initialized) + { + initialized = 1; + pp_construct (pp_base (pp), NULL, 0); + pp_c_pretty_printer_init (pp); + pp_needs_newline (pp) = true; + } + pp_base (pp)->buffer->stream = file; + + pp_statement (pp, t); + + pp_newline (pp); + pp_flush (pp); +} + +/* Print the tree T in full, on stderr. */ + +void +debug_c_tree (tree t) +{ + print_c_tree (stderr, t); + fputc ('\n', stderr); +} + +/* Output the DECL_NAME of T. If T has no DECL_NAME, output a string made + up of T's memory address. */ + +void +pp_c_tree_decl_identifier (c_pretty_printer *pp, tree t) +{ + const char *name; + + gcc_assert (DECL_P (t)); + + if (DECL_NAME (t)) + name = IDENTIFIER_POINTER (DECL_NAME (t)); + else + { + static char xname[8]; + sprintf (xname, "", ((unsigned)((unsigned long)(t) & 0xffff))); + name = xname; + } + + pp_c_identifier (pp, name); +} diff --git a/contrib/gcc/c-pretty-print.h b/contrib/gcc/c-pretty-print.h index 39e0be77d2d..6a4086b4fc2 100644 --- a/contrib/gcc/c-pretty-print.h +++ b/contrib/gcc/c-pretty-print.h @@ -1,5 +1,5 @@ /* Various declarations for the C and C++ pretty-printers. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #ifndef GCC_C_PRETTY_PRINTER #define GCC_C_PRETTY_PRINTER @@ -30,7 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA typedef enum { pp_c_flag_abstract = 1 << 1, - pp_c_flag_last_bit = 2 + pp_c_flag_last_bit = 2 } pp_c_pretty_print_flags; @@ -60,7 +60,7 @@ struct c_pretty_print_info int *offset_list; pp_flags flags; - + /* These must be overridden by each of the C and C++ front-end to reflect their understanding of syntactic productions when they differ. */ c_pretty_print_fn declaration; @@ -80,6 +80,7 @@ struct c_pretty_print_info c_pretty_print_fn statement; + c_pretty_print_fn constant; c_pretty_print_fn id_expression; c_pretty_print_fn primary_expression; c_pretty_print_fn postfix_expression; @@ -95,7 +96,7 @@ struct c_pretty_print_info #undef pp_base #define pp_base(PP) (&pp_c_base (PP)->base) - + #define pp_c_tree_identifier(PPI, ID) \ pp_c_identifier (PPI, IDENTIFIER_POINTER (ID)) @@ -129,6 +130,8 @@ struct c_pretty_print_info #define pp_statement(PPI, S) \ pp_c_base (PPI)->statement (pp_c_base (PPI), S) +#define pp_constant(PP, E) \ + pp_c_base (PP)->constant (pp_c_base (PP), E) #define pp_id_expression(PP, E) \ pp_c_base (PP)->id_expression (pp_c_base (PP), E) #define pp_primary_expression(PPI, E) \ @@ -159,13 +162,19 @@ void pp_c_left_paren (c_pretty_printer *); void pp_c_right_paren (c_pretty_printer *); void pp_c_left_brace (c_pretty_printer *); void pp_c_right_brace (c_pretty_printer *); +void pp_c_left_bracket (c_pretty_printer *); +void pp_c_right_bracket (c_pretty_printer *); void pp_c_dot (c_pretty_printer *); void pp_c_ampersand (c_pretty_printer *); +void pp_c_star (c_pretty_printer *); void pp_c_arrow (c_pretty_printer *); void pp_c_semicolon (c_pretty_printer *); +void pp_c_complement (c_pretty_printer *); +void pp_c_exclamation (c_pretty_printer *); void pp_c_space_for_pointer_operator (c_pretty_printer *, tree); /* Declarations. */ +void pp_c_tree_decl_identifier (c_pretty_printer *, tree); void pp_c_function_definition (c_pretty_printer *, tree); void pp_c_attributes (c_pretty_printer *, tree); void pp_c_type_qualifier_list (c_pretty_printer *, tree); @@ -186,6 +195,7 @@ void pp_c_statement (c_pretty_printer *, tree); void pp_c_expression (c_pretty_printer *, tree); void pp_c_logical_or_expression (c_pretty_printer *, tree); void pp_c_expression_list (c_pretty_printer *, tree); +void pp_c_constructor_elts (c_pretty_printer *, VEC(constructor_elt,gc) *); void pp_c_call_argument_list (c_pretty_printer *, tree); void pp_c_unary_expression (c_pretty_printer *, tree); void pp_c_cast_expression (c_pretty_printer *, tree); @@ -197,4 +207,6 @@ void pp_c_id_expression (c_pretty_printer *, tree); void pp_c_identifier (c_pretty_printer *, const char *); void pp_c_string_literal (c_pretty_printer *, tree); +void print_c_tree (FILE *file, tree t); + #endif /* GCC_C_PRETTY_PRINTER */ diff --git a/contrib/gcc/c-semantics.c b/contrib/gcc/c-semantics.c index 692adfcde26..2dda9b03a66 100644 --- a/contrib/gcc/c-semantics.c +++ b/contrib/gcc/c-semantics.c @@ -1,7 +1,8 @@ /* This file contains the definitions and documentation for the common tree codes used in the GNU C and C++ compilers (see c-common.def for the standard codes). - Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Benjamin Chelf (chelf@codesourcery.com). This file is part of GCC. @@ -18,8 +19,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -39,225 +40,106 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "flags.h" #include "ggc.h" #include "rtl.h" -#include "expr.h" #include "output.h" #include "timevar.h" #include "predict.h" #include "tree-inline.h" - -/* If non-NULL, the address of a language-specific function for - expanding statements. */ -void (*lang_expand_stmt) (tree); - -/* If non-NULL, the address of a language-specific function for - expanding a DECL_STMT. After the language-independent cases are - handled, this function will be called. If this function is not - defined, it is assumed that declarations other than those for - variables and labels do not require any RTL generation. */ -void (*lang_expand_decl_stmt) (tree); - -static tree find_reachable_label_1 (tree *, int *, void *); -static tree find_reachable_label (tree); -static bool expand_unreachable_if_stmt (tree); -static tree expand_unreachable_stmt (tree, int); -static void genrtl_do_stmt_1 (tree, tree); +#include "tree-gimple.h" +#include "langhooks.h" /* Create an empty statement tree rooted at T. */ -void -begin_stmt_tree (tree *t) -{ - /* We create a trivial EXPR_STMT so that last_tree is never NULL in - what follows. We remove the extraneous statement in - finish_stmt_tree. */ - *t = build_nt (EXPR_STMT, void_zero_node); - last_tree = *t; - last_expr_type = NULL_TREE; - last_expr_filename = input_filename; -} - -/* T is a statement. Add it to the statement-tree. */ - tree -add_stmt (tree t) +push_stmt_list (void) { - if (input_filename != last_expr_filename) - { - /* If the filename has changed, also add in a FILE_STMT. Do a string - compare first, though, as it might be an equivalent string. */ - int add = (strcmp (input_filename, last_expr_filename) != 0); - last_expr_filename = input_filename; - if (add) - { - tree pos = build_nt (FILE_STMT, get_identifier (input_filename)); - add_stmt (pos); - } - } - - /* Add T to the statement-tree. */ - TREE_CHAIN (last_tree) = t; - last_tree = t; - - /* When we expand a statement-tree, we must know whether or not the - statements are full-expressions. We record that fact here. */ - STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p (); - + tree t; + t = alloc_stmt_list (); + TREE_CHAIN (t) = cur_stmt_list; + cur_stmt_list = t; return t; } -/* Create a declaration statement for the declaration given by the - DECL. */ - -void -add_decl_stmt (tree decl) -{ - tree decl_stmt; - - /* We need the type to last until instantiation time. */ - decl_stmt = build_stmt (DECL_STMT, decl); - add_stmt (decl_stmt); -} - -/* Add a scope-statement to the statement-tree. BEGIN_P indicates - whether this statements opens or closes a scope. PARTIAL_P is true - for a partial scope, i.e, the scope that begins after a label when - an object that needs a cleanup is created. If BEGIN_P is nonzero, - returns a new TREE_LIST representing the top of the SCOPE_STMT - stack. The TREE_PURPOSE is the new SCOPE_STMT. If BEGIN_P is - zero, returns a TREE_LIST whose TREE_VALUE is the new SCOPE_STMT, - and whose TREE_PURPOSE is the matching SCOPE_STMT with - SCOPE_BEGIN_P set. */ - -tree -add_scope_stmt (int begin_p, int partial_p) -{ - tree *stack_ptr = current_scope_stmt_stack (); - tree ss; - tree top = *stack_ptr; - - /* Build the statement. */ - ss = build_stmt (SCOPE_STMT, NULL_TREE); - SCOPE_BEGIN_P (ss) = begin_p; - SCOPE_PARTIAL_P (ss) = partial_p; - - /* Keep the scope stack up to date. */ - if (begin_p) - { - top = tree_cons (ss, NULL_TREE, top); - *stack_ptr = top; - } - else - { - if (partial_p != SCOPE_PARTIAL_P (TREE_PURPOSE (top))) - abort (); - TREE_VALUE (top) = ss; - *stack_ptr = TREE_CHAIN (top); - } - - /* Add the new statement to the statement-tree. */ - add_stmt (ss); - - return top; -} - /* Finish the statement tree rooted at T. */ -void -finish_stmt_tree (tree *t) +tree +pop_stmt_list (tree t) { - tree stmt; + tree u = cur_stmt_list, chain; - /* Remove the fake extra statement added in begin_stmt_tree. */ - stmt = TREE_CHAIN (*t); - *t = stmt; - last_tree = NULL_TREE; - - if (cfun && stmt) + /* Pop statement lists until we reach the target level. The extra + nestings will be due to outstanding cleanups. */ + while (1) { - /* The line-number recorded in the outermost statement in a function - is the line number of the end of the function. */ - STMT_LINENO (stmt) = input_line; - STMT_LINENO_FOR_FN_P (stmt) = 1; + chain = TREE_CHAIN (u); + TREE_CHAIN (u) = NULL_TREE; + if (t == u) + break; + u = chain; } + cur_stmt_list = chain; + + /* If the statement list is completely empty, just return it. This is + just as good small as build_empty_stmt, with the advantage that + statement lists are merged when they appended to one another. So + using the STATEMENT_LIST avoids pathological buildup of EMPTY_STMT_P + statements. */ + if (TREE_SIDE_EFFECTS (t)) + { + tree_stmt_iterator i = tsi_start (t); + + /* If the statement list contained exactly one statement, then + extract it immediately. */ + if (tsi_one_before_end_p (i)) + { + u = tsi_stmt (i); + tsi_delink (&i); + free_stmt_list (t); + t = u; + } + } + + return t; } /* Build a generic statement based on the given type of node and arguments. Similar to `build_nt', except that we set - STMT_LINENO to be the current line number. */ + EXPR_LOCATION to be the current source location. */ /* ??? This should be obsolete with the lineno_stmt productions in the grammar. */ tree build_stmt (enum tree_code code, ...) { - tree t; - int length; - int i; + tree ret; + int length, i; va_list p; + bool side_effects; va_start (p, code); - t = make_node (code); + ret = make_node (code); + TREE_TYPE (ret) = void_type_node; length = TREE_CODE_LENGTH (code); - STMT_LINENO (t) = input_line; + SET_EXPR_LOCATION (ret, input_location); + /* TREE_SIDE_EFFECTS will already be set for statements with + implicit side effects. Here we make sure it is set for other + expressions by checking whether the parameters have side + effects. */ + + side_effects = false; for (i = 0; i < length; i++) - TREE_OPERAND (t, i) = va_arg (p, tree); + { + tree t = va_arg (p, tree); + if (t && !TYPE_P (t)) + side_effects |= TREE_SIDE_EFFECTS (t); + TREE_OPERAND (ret, i) = t; + } + + TREE_SIDE_EFFECTS (ret) |= side_effects; va_end (p); - return t; -} - -/* Some statements, like for-statements or if-statements, require a - condition. This condition can be a declaration. If T is such a - declaration it is processed, and an expression appropriate to use - as the condition is returned. Otherwise, T itself is returned. */ - -tree -expand_cond (tree t) -{ - if (t && TREE_CODE (t) == TREE_LIST) - { - expand_stmt (TREE_PURPOSE (t)); - return TREE_VALUE (t); - } - else - return t; -} - -/* Create RTL for the local static variable DECL. */ - -void -make_rtl_for_local_static (tree decl) -{ - const char *asmspec = NULL; - - /* If we inlined this variable, we could see it's declaration - again. */ - if (TREE_ASM_WRITTEN (decl)) - return; - - /* If the DECL_ASSEMBLER_NAME is not the same as the DECL_NAME, then - either we already created RTL for this DECL (and since it was a - local variable, its DECL_ASSEMBLER_NAME got hacked up to prevent - clashes with other local statics with the same name by a previous - call to make_decl_rtl), or the user explicitly requested a - particular assembly name for this variable, using the GNU - extension for this purpose: - - int i asm ("j"); - - There's no way to know which case we're in, here. But, it turns - out we're safe. If there's already RTL, then - rest_of_decl_compilation ignores the ASMSPEC parameter, so we - may as well not pass it in. If there isn't RTL, then we didn't - already create RTL, which means that the modification to - DECL_ASSEMBLER_NAME came only via the explicit extension. */ - if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl) - && !DECL_RTL_SET_P (decl)) - asmspec = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - - rest_of_decl_compilation (decl, asmspec, /*top_level=*/0, /*at_end=*/0); + return ret; } /* Let the back-end know about DECL. */ @@ -268,796 +150,19 @@ emit_local_var (tree decl) /* Create RTL for this variable. */ if (!DECL_RTL_SET_P (decl)) { - if (DECL_C_HARD_REGISTER (decl)) + if (DECL_HARD_REGISTER (decl)) /* The user specified an assembler name for this variable. Set that up now. */ - rest_of_decl_compilation - (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), - /*top_level=*/0, /*at_end=*/0); + rest_of_decl_compilation (decl, 0, 0); else expand_decl (decl); } - - if (DECL_INITIAL (decl)) - { - /* Actually do the initialization. */ - if (stmts_are_full_exprs_p ()) - expand_start_target_temps (); - - expand_decl_init (decl); - - if (stmts_are_full_exprs_p ()) - expand_end_target_temps (); - } } -/* Helper for generating the RTL at the beginning of a scope. */ - -void -genrtl_do_pushlevel (void) -{ - emit_line_note (input_location); - clear_last_expr (); -} - -/* Generate the RTL for DESTINATION, which is a GOTO_STMT. */ - -void -genrtl_goto_stmt (tree destination) -{ - if (TREE_CODE (destination) == IDENTIFIER_NODE) - abort (); - - /* We warn about unused labels with -Wunused. That means we have to - mark the used labels as used. */ - if (TREE_CODE (destination) == LABEL_DECL) - TREE_USED (destination) = 1; - - emit_line_note (input_location); - - if (TREE_CODE (destination) == LABEL_DECL) - { - label_rtx (destination); - expand_goto (destination); - } - else - expand_computed_goto (destination); -} - -/* Generate the RTL for EXPR, which is an EXPR_STMT. Provided just - for backward compatibility. genrtl_expr_stmt_value() should be - used for new code. */ - -void -genrtl_expr_stmt (tree expr) -{ - genrtl_expr_stmt_value (expr, -1, 1); -} - -/* Generate the RTL for EXPR, which is an EXPR_STMT. WANT_VALUE tells - whether to (1) save the value of the expression, (0) discard it or - (-1) use expr_stmts_for_value to tell. The use of -1 is - deprecated, and retained only for backward compatibility. - MAYBE_LAST is nonzero if this EXPR_STMT might be the last statement - in expression statement. */ - -void -genrtl_expr_stmt_value (tree expr, int want_value, int maybe_last) -{ - if (expr != NULL_TREE) - { - emit_line_note (input_location); - - if (stmts_are_full_exprs_p ()) - expand_start_target_temps (); - - if (expr != error_mark_node) - expand_expr_stmt_value (expr, want_value, maybe_last); - - if (stmts_are_full_exprs_p ()) - expand_end_target_temps (); - } -} - -/* Generate the RTL for T, which is a DECL_STMT. */ - -void -genrtl_decl_stmt (tree t) -{ - tree decl; - emit_line_note (input_location); - decl = DECL_STMT_DECL (t); - /* If this is a declaration for an automatic local - variable, initialize it. Note that we might also see a - declaration for a namespace-scope object (declared with - `extern'). We don't have to handle the initialization - of those objects here; they can only be declarations, - rather than definitions. */ - if (TREE_CODE (decl) == VAR_DECL - && !TREE_STATIC (decl) - && !DECL_EXTERNAL (decl)) - { - /* Let the back-end know about this variable. */ - if (!anon_aggr_type_p (TREE_TYPE (decl))) - emit_local_var (decl); - else - expand_anon_union_decl (decl, NULL_TREE, - DECL_ANON_UNION_ELEMS (decl)); - } - else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) - make_rtl_for_local_static (decl); - else if (TREE_CODE (decl) == LABEL_DECL - && C_DECLARED_LABEL_FLAG (decl)) - declare_nonlocal_label (decl); - else if (lang_expand_decl_stmt) - (*lang_expand_decl_stmt) (t); -} - -/* Generate the RTL for T, which is an IF_STMT. */ - -void -genrtl_if_stmt (tree t) -{ - tree cond; - genrtl_do_pushlevel (); - cond = expand_cond (IF_COND (t)); - emit_line_note (input_location); - expand_start_cond (cond, 0); - if (THEN_CLAUSE (t)) - { - tree nextt = THEN_CLAUSE (t); - - if (cond && integer_zerop (cond)) - nextt = expand_unreachable_stmt (nextt, warn_notreached); - expand_stmt (nextt); - } - - if (ELSE_CLAUSE (t)) - { - tree nextt = ELSE_CLAUSE (t); - expand_start_else (); - if (cond && integer_nonzerop (cond)) - nextt = expand_unreachable_stmt (nextt, warn_notreached); - expand_stmt (nextt); - } - expand_end_cond (); -} - -/* Generate the RTL for T, which is a WHILE_STMT. */ - -void -genrtl_while_stmt (tree t) -{ - tree cond = WHILE_COND (t); - - emit_line_note (input_location); - expand_start_loop (1); - genrtl_do_pushlevel (); - - if (cond && !integer_nonzerop (cond)) - { - cond = expand_cond (cond); - emit_line_note (input_location); - expand_exit_loop_top_cond (0, cond); - genrtl_do_pushlevel (); - } - - expand_stmt (WHILE_BODY (t)); - - expand_end_loop (); -} - -/* Generate the RTL for a DO_STMT with condition COND and loop BODY - body. This is reused for expanding unreachable WHILE_STMTS. */ - -static void -genrtl_do_stmt_1 (tree cond, tree body) -{ - /* Recognize the common special-case of do { ... } while (0) and do - not emit the loop widgetry in this case. In particular this - avoids cluttering the rtl with dummy loop notes, which can affect - alignment of adjacent labels. COND can be NULL due to parse - errors. */ - if (!cond || integer_zerop (cond)) - { - expand_start_null_loop (); - expand_stmt (body); - expand_end_null_loop (); - } - else if (integer_nonzerop (cond)) - { - emit_line_note (input_location); - expand_start_loop (1); - - expand_stmt (body); - - emit_line_note (input_location); - expand_end_loop (); - } - else - { - emit_line_note (input_location); - expand_start_loop_continue_elsewhere (1); - - expand_stmt (body); - - expand_loop_continue_here (); - cond = expand_cond (cond); - emit_line_note (input_location); - expand_exit_loop_if_false (0, cond); - expand_end_loop (); - } -} - -/* Generate the RTL for T, which is a DO_STMT. */ - -void -genrtl_do_stmt (tree t) -{ - genrtl_do_stmt_1 (DO_COND (t), DO_BODY (t)); -} - -/* Build the node for a return statement and return it. */ - -tree -build_return_stmt (tree expr) -{ - return (build_stmt (RETURN_STMT, expr)); -} - -/* Generate the RTL for STMT, which is a RETURN_STMT. */ - -void -genrtl_return_stmt (tree stmt) -{ - tree expr; - - expr = RETURN_STMT_EXPR (stmt); - - emit_line_note (input_location); - if (!expr) - expand_null_return (); - else - { - expand_start_target_temps (); - expand_return (expr); - expand_end_target_temps (); - } -} - -/* Generate the RTL for T, which is a FOR_STMT. */ - -void -genrtl_for_stmt (tree t) -{ - tree cond = FOR_COND (t); - location_t saved_loc; - - if (NEW_FOR_SCOPE_P (t)) - genrtl_do_pushlevel (); - - expand_stmt (FOR_INIT_STMT (t)); - - /* Expand the initialization. */ - emit_line_note (input_location); - if (FOR_EXPR (t)) - expand_start_loop_continue_elsewhere (1); - else - expand_start_loop (1); - genrtl_do_pushlevel (); - - /* Save the filename and line number so that we expand the FOR_EXPR - we can reset them back to the saved values. */ - saved_loc = input_location; - - /* Expand the condition. */ - if (cond && !integer_nonzerop (cond)) - { - cond = expand_cond (cond); - emit_line_note (input_location); - expand_exit_loop_top_cond (0, cond); - genrtl_do_pushlevel (); - } - - /* Expand the body. */ - expand_stmt (FOR_BODY (t)); - - /* Expand the increment expression. */ - input_location = saved_loc; - emit_line_note (input_location); - if (FOR_EXPR (t)) - { - expand_loop_continue_here (); - genrtl_expr_stmt (FOR_EXPR (t)); - } - expand_end_loop (); -} - -/* Build a break statement node and return it. */ - -tree -build_break_stmt (void) -{ - return (build_stmt (BREAK_STMT)); -} - -/* Generate the RTL for a BREAK_STMT. */ - -void -genrtl_break_stmt (void) -{ - emit_line_note (input_location); - if ( ! expand_exit_something ()) - abort (); -} - -/* Build a continue statement node and return it. */ - -tree -build_continue_stmt (void) -{ - return (build_stmt (CONTINUE_STMT)); -} - -/* Generate the RTL for a CONTINUE_STMT. */ - -void -genrtl_continue_stmt (void) -{ - emit_line_note (input_location); - if (! expand_continue_loop (0)) - abort (); -} - -/* Generate the RTL for T, which is a SCOPE_STMT. */ - -void -genrtl_scope_stmt (tree t) -{ - tree block = SCOPE_STMT_BLOCK (t); - - if (!SCOPE_NO_CLEANUPS_P (t)) - { - if (SCOPE_BEGIN_P (t)) - expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t), block); - else if (SCOPE_END_P (t)) - expand_end_bindings (NULL_TREE, !SCOPE_NULLIFIED_P (t), 0); - } - else if (!SCOPE_NULLIFIED_P (t)) - { - rtx note = emit_note (SCOPE_BEGIN_P (t) - ? NOTE_INSN_BLOCK_BEG : NOTE_INSN_BLOCK_END); - NOTE_BLOCK (note) = block; - } - - /* If we're at the end of a scope that contains inlined nested - functions, we have to decide whether or not to write them out. */ - if (block && SCOPE_END_P (t)) - { - tree fn; - - for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn)) - { - if (TREE_CODE (fn) == FUNCTION_DECL - && DECL_CONTEXT (fn) == current_function_decl - && DECL_SAVED_INSNS (fn) - && DECL_SAVED_INSNS (fn)->saved_for_inline - && !TREE_ASM_WRITTEN (fn) - && TREE_ADDRESSABLE (fn)) - { - push_function_context (); - output_inline_function (fn); - pop_function_context (); - } - } - } -} - -/* Generate the RTL for T, which is a SWITCH_STMT. */ - -void -genrtl_switch_stmt (tree t) -{ - tree cond; - genrtl_do_pushlevel (); - - cond = expand_cond (SWITCH_COND (t)); - if (cond == error_mark_node) - /* The code is in error, but we don't want expand_end_case to - crash. */ - cond = truthvalue_false_node; - - emit_line_note (input_location); - expand_start_case (1, cond, TREE_TYPE (cond), "switch statement"); - expand_stmt (expand_unreachable_stmt (SWITCH_BODY (t), warn_notreached)); - expand_end_case_type (cond, SWITCH_TYPE (t)); -} - -/* Create a CASE_LABEL tree node and return it. */ +/* Create a CASE_LABEL_EXPR tree node and return it. */ tree build_case_label (tree low_value, tree high_value, tree label_decl) { - return build_stmt (CASE_LABEL, low_value, high_value, label_decl); -} - - -/* Generate the RTL for a CASE_LABEL. */ - -void -genrtl_case_label (tree case_label) -{ - tree duplicate; - tree cleanup; - - cleanup = last_cleanup_this_contour (); - if (cleanup) - { - static int explained = 0; - warning ("destructor needed for `%D'", (TREE_PURPOSE (cleanup))); - warning ("where case label appears here"); - if (!explained) - { - warning ("(enclose actions of previous case statements requiring destructors in their own scope.)"); - explained = 1; - } - } - - add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label), - CASE_LABEL_DECL (case_label), &duplicate); -} - -/* Generate the RTL for T, which is a COMPOUND_STMT. */ - -void -genrtl_compound_stmt (tree t) -{ -#ifdef ENABLE_CHECKING - struct nesting *n = current_nesting_level (); -#endif - - expand_stmt (COMPOUND_BODY (t)); - -#ifdef ENABLE_CHECKING - /* Make sure that we've pushed and popped the same number of levels. */ - if (!COMPOUND_STMT_NO_SCOPE (t) && n != current_nesting_level ()) - abort (); -#endif -} - -/* Generate the RTL for an ASM_STMT. */ - -void -genrtl_asm_stmt (tree cv_qualifier, tree string, tree output_operands, - tree input_operands, tree clobbers, int asm_input_p) -{ - if (cv_qualifier != NULL_TREE - && cv_qualifier != ridpointers[(int) RID_VOLATILE]) - { - warning ("%s qualifier ignored on asm", - IDENTIFIER_POINTER (cv_qualifier)); - cv_qualifier = NULL_TREE; - } - - emit_line_note (input_location); - if (asm_input_p) - expand_asm (string, cv_qualifier != NULL_TREE); - else - c_expand_asm_operands (string, output_operands, input_operands, - clobbers, cv_qualifier != NULL_TREE, - input_location); -} - -/* Generate the RTL for a CLEANUP_STMT. */ - -void -genrtl_cleanup_stmt (tree t) -{ - tree decl = CLEANUP_DECL (t); - if (!decl || !DECL_P (decl) - || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node)) - expand_decl_cleanup_eh (decl, CLEANUP_EXPR (t), CLEANUP_EH_ONLY (t)); -} - -/* We're about to expand T, a statement. Set up appropriate context - for the substitution. */ - -void -prep_stmt (tree t) -{ - if (!STMT_LINENO_FOR_FN_P (t)) - input_line = STMT_LINENO (t); - current_stmt_tree ()->stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t); -} - -/* Generate the RTL for the statement T, its substatements, and any - other statements at its nesting level. */ - -void -expand_stmt (tree t) -{ - while (t && t != error_mark_node) - { - int saved_stmts_are_full_exprs_p; - - /* Set up context appropriately for handling this statement. */ - saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); - prep_stmt (t); - - switch (TREE_CODE (t)) - { - case FILE_STMT: - input_filename = FILE_STMT_FILENAME (t); - break; - - case RETURN_STMT: - genrtl_return_stmt (t); - t = expand_unreachable_stmt (TREE_CHAIN (t), warn_notreached); - goto process_t; - - case EXPR_STMT: - genrtl_expr_stmt_value (EXPR_STMT_EXPR (t), TREE_ADDRESSABLE (t), - TREE_CHAIN (t) == NULL - || (TREE_CODE (TREE_CHAIN (t)) == SCOPE_STMT - && TREE_CHAIN (TREE_CHAIN (t)) == NULL)); - break; - - case DECL_STMT: - genrtl_decl_stmt (t); - break; - - case FOR_STMT: - genrtl_for_stmt (t); - break; - - case WHILE_STMT: - genrtl_while_stmt (t); - break; - - case DO_STMT: - genrtl_do_stmt (t); - break; - - case IF_STMT: - genrtl_if_stmt (t); - break; - - case COMPOUND_STMT: - genrtl_compound_stmt (t); - break; - - case BREAK_STMT: - genrtl_break_stmt (); - t = expand_unreachable_stmt (TREE_CHAIN (t), warn_notreached); - goto process_t; - - case CONTINUE_STMT: - genrtl_continue_stmt (); - t = expand_unreachable_stmt (TREE_CHAIN (t), warn_notreached); - goto process_t; - - case SWITCH_STMT: - genrtl_switch_stmt (t); - break; - - case CASE_LABEL: - genrtl_case_label (t); - break; - - case LABEL_STMT: - expand_label (LABEL_STMT_LABEL (t)); - break; - - case GOTO_STMT: - /* Emit information for branch prediction. */ - if (!GOTO_FAKE_P (t) - && TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL - && flag_guess_branch_prob) - { - rtx note = emit_note (NOTE_INSN_PREDICTION); - - NOTE_PREDICTION (note) = NOTE_PREDICT (PRED_GOTO, NOT_TAKEN); - } - genrtl_goto_stmt (GOTO_DESTINATION (t)); - t = expand_unreachable_stmt (TREE_CHAIN (t), warn_notreached); - goto process_t; - - case ASM_STMT: - genrtl_asm_stmt (ASM_CV_QUAL (t), ASM_STRING (t), - ASM_OUTPUTS (t), ASM_INPUTS (t), - ASM_CLOBBERS (t), ASM_INPUT_P (t)); - break; - - case SCOPE_STMT: - genrtl_scope_stmt (t); - break; - - case CLEANUP_STMT: - genrtl_cleanup_stmt (t); - break; - - default: - if (lang_expand_stmt) - (*lang_expand_stmt) (t); - else - abort (); - break; - } - - /* Go on to the next statement in this scope. */ - t = TREE_CHAIN (t); - - process_t: - /* Restore saved state. */ - current_stmt_tree ()->stmts_are_full_exprs_p - = saved_stmts_are_full_exprs_p; - } -} - -/* If *TP is a potentially reachable label, return nonzero. */ - -static tree -find_reachable_label_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) -{ - switch (TREE_CODE (*tp)) - { - case LABEL_STMT: - case CASE_LABEL: - return *tp; - - default: - break; - } - return NULL_TREE; -} - -/* Determine whether expression EXP contains a potentially - reachable label. */ -static tree -find_reachable_label (tree exp) -{ - location_t saved_loc = input_location; - tree ret = walk_tree_without_duplicates - (&exp, find_reachable_label_1, NULL); - input_location = saved_loc; - return ret; -} - -/* Expand an unreachable if statement, T. This function returns - true if the IF_STMT contains a potentially reachable code_label. */ -static bool -expand_unreachable_if_stmt (tree t) -{ - tree n; - - if (find_reachable_label (IF_COND (t)) != NULL_TREE) - { - genrtl_if_stmt (t); - return true; - } - - /* Account for declarations as conditions. */ - expand_cond (IF_COND (t)); - - if (THEN_CLAUSE (t) && ELSE_CLAUSE (t)) - { - n = expand_unreachable_stmt (THEN_CLAUSE (t), 0); - - if (n != NULL_TREE) - { - rtx label; - expand_stmt (n); - label = gen_label_rtx (); - emit_jump (label); - expand_stmt (expand_unreachable_stmt (ELSE_CLAUSE (t), 0)); - emit_label (label); - return true; - } - else - n = expand_unreachable_stmt (ELSE_CLAUSE (t), 0); - } - else if (THEN_CLAUSE (t)) - n = expand_unreachable_stmt (THEN_CLAUSE (t), 0); - else if (ELSE_CLAUSE (t)) - n = expand_unreachable_stmt (ELSE_CLAUSE (t), 0); - else - n = NULL_TREE; - - expand_stmt (n); - - return n != NULL_TREE; -} - -/* Expand an unreachable statement list. This function skips all - statements preceding the first potentially reachable label and - then returns the label (or, in same cases, the statement after - one containing the label). This function returns NULL_TREE if - the end of the given statement list is unreachable, and a - non-NULL value, possibly error_mark_node, otherwise. */ -static tree -expand_unreachable_stmt (tree t, int warn) -{ - int saved; - - while (t && t != error_mark_node) - { - if (warn) - switch (TREE_CODE (t)) - { - case BREAK_STMT: - case CONTINUE_STMT: - case EXPR_STMT: - case GOTO_STMT: - case IF_STMT: - case RETURN_STMT: - if (!STMT_LINENO_FOR_FN_P (t)) - input_line = STMT_LINENO (t); - warning("will never be executed"); - warn = false; - break; - - default: - break; - } - - switch (TREE_CODE (t)) - { - case GOTO_STMT: - case CONTINUE_STMT: - case BREAK_STMT: - break; - - case FILE_STMT: - input_filename = FILE_STMT_FILENAME (t); - break; - - case RETURN_STMT: - if (find_reachable_label (RETURN_STMT_EXPR (t)) != NULL_TREE) - return t; - break; - - case EXPR_STMT: - if (find_reachable_label (EXPR_STMT_EXPR (t)) != NULL_TREE) - return t; - break; - - case IF_STMT: - if (expand_unreachable_if_stmt (t)) - return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node; - break; - - case WHILE_STMT: - /* If the start of a while statement is unreachable, there is - no need to rotate the loop, instead the WHILE_STMT can be - expanded like a DO_STMT. */ - genrtl_do_stmt_1 (WHILE_COND (t), WHILE_BODY (t)); - return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node; - - case COMPOUND_STMT: - { - tree n; - n = expand_unreachable_stmt (COMPOUND_BODY (t), warn); - if (n != NULL_TREE) - { - expand_stmt (n); - return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node; - } - warn = false; - break; - } - - case SCOPE_STMT: - saved = stmts_are_full_exprs_p (); - prep_stmt (t); - genrtl_scope_stmt (t); - current_stmt_tree ()->stmts_are_full_exprs_p = saved; - break; - - default: - return t; - } - t = TREE_CHAIN (t); - } - return NULL_TREE; + return build_stmt (CASE_LABEL_EXPR, low_value, high_value, label_decl); } diff --git a/contrib/gcc/c-tree.h b/contrib/gcc/c-tree.h index 0500f81a3d8..51392158750 100644 --- a/contrib/gcc/c-tree.h +++ b/contrib/gcc/c-tree.h @@ -1,6 +1,6 @@ /* Definitions for C parsing and type checking. Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,74 +16,28 @@ for more details. 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. */ #ifndef GCC_C_TREE_H #define GCC_C_TREE_H #include "c-common.h" +#include "toplev.h" +#include "diagnostic.h" -/* Language-dependent contents of an identifier. */ - -/* The limbo_value is used for block level extern declarations, which need - to be type checked against subsequent extern declarations. They can't - be referenced after they fall out of scope, so they can't be global. - - The rid_code field is used for keywords. It is in all - lang_identifier nodes, because some keywords are only special in a - particular context. */ - -struct lang_identifier GTY(()) -{ - struct c_common_identifier common_id; - tree symbol_value; - tree tag_value; - tree label_value; -}; - -/* The resulting tree type. */ - -union lang_tree_node - GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), - chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *)TYPE_NEXT_VARIANT (&%h.generic) : (union lang_tree_node *)TREE_CHAIN (&%h.generic)"))) -{ - union tree_node GTY ((tag ("0"), - desc ("tree_node_structure (&%h)"))) - generic; - struct lang_identifier GTY ((tag ("1"))) identifier; -}; +/* struct lang_identifier is private to c-decl.c, but langhooks.c needs to + know how big it is. This is sanity-checked in c-decl.c. */ +#define C_SIZEOF_STRUCT_LANG_IDENTIFIER \ + (sizeof (struct c_common_identifier) + 3 * sizeof (void *)) /* Language-specific declaration information. */ struct lang_decl GTY(()) { - /* The return types and parameter types may have variable size. - This is a list of any SAVE_EXPRs that need to be evaluated to - compute those sizes. */ - tree pending_sizes; + char dummy; }; -/* Macros for access to language-specific slots in an identifier. */ -/* Each of these slots contains a DECL node or null. */ - -/* The value of the identifier in the namespace of "ordinary identifiers" - (data objects, enum constants, functions, typedefs). */ -#define IDENTIFIER_SYMBOL_VALUE(NODE) \ - (((struct lang_identifier *) (NODE))->symbol_value) -/* The value of the identifier in the namespace of struct, union, - and enum tags. */ -#define IDENTIFIER_TAG_VALUE(NODE) \ - (((struct lang_identifier *) (NODE))->tag_value) -/* The value of the identifier in the namespace of labels. */ -#define IDENTIFIER_LABEL_VALUE(NODE) \ - (((struct lang_identifier *) (NODE))->label_value) - -/* In identifiers, C uses the following fields in a special way: - TREE_PUBLIC to record that there was a previous local extern decl. - TREE_USED to record that such a decl was used. - TREE_ADDRESSABLE to record that the address of such a decl was used. */ - /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE) @@ -103,10 +57,17 @@ struct lang_decl GTY(()) and C_RID_YYCODE is the token number wanted by Yacc. */ #define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID) -/* In a RECORD_TYPE, a sorted array of the fields of the type. */ struct lang_type GTY(()) { + /* In a RECORD_TYPE, a sorted array of the fields of the type. */ struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s; + /* In an ENUMERAL_TYPE, the min and max values. */ + tree enum_min; + tree enum_max; + /* In a RECORD_TYPE, information specific to Objective-C, such + as a list of adopted protocols or a pointer to a corresponding + @interface. See objc/objc-act.h for details. */ + tree objc_info; }; /* Record whether a type or decl was written with nonconstant size. @@ -114,10 +75,6 @@ struct lang_type GTY(()) #define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE) #define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE) -/* Store a value in that field. */ -#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \ - (TREE_COMPLEXITY (EXP) = (int) (CODE)) - /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP) @@ -128,11 +85,53 @@ struct lang_type GTY(()) /* For a FUNCTION_DECL, nonzero if it was an implicit declaration. */ #define C_DECL_IMPLICIT(EXP) DECL_LANG_FLAG_2 (EXP) -/* Nonzero for a declaration of an external object which is not - currently in scope. This is either a built-in declaration of - a library function, before a real declaration has been seen, - or a declaration that appeared in an inner scope that has ended. */ -#define C_DECL_INVISIBLE(EXP) DECL_LANG_FLAG_3 (EXP) +/* For FUNCTION_DECLs, evaluates true if the decl is built-in but has + been declared. */ +#define C_DECL_DECLARED_BUILTIN(EXP) \ + DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP)) + +/* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a + built-in prototype and does not have a non-built-in prototype. */ +#define C_DECL_BUILTIN_PROTOTYPE(EXP) \ + DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP)) + +/* Record whether a decl was declared register. This is strictly a + front-end flag, whereas DECL_REGISTER is used for code generation; + they may differ for structures with volatile fields. */ +#define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4 (EXP) + +/* Record whether a decl was used in an expression anywhere except an + unevaluated operand of sizeof / typeof / alignof. This is only + used for functions declared static but not defined, though outside + sizeof and typeof it is set for other function decls as well. */ +#define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (EXP)) + +/* Record whether a label was defined in a statement expression which + has finished and so can no longer be jumped to. */ +#define C_DECL_UNJUMPABLE_STMT_EXPR(EXP) \ + DECL_LANG_FLAG_6 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was the subject of a goto from outside the + current level of statement expression nesting and so cannot be + defined right now. */ +#define C_DECL_UNDEFINABLE_STMT_EXPR(EXP) \ + DECL_LANG_FLAG_7 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was defined in the scope of an identifier + with variably modified type which has finished and so can no longer + be jumped to. */ +#define C_DECL_UNJUMPABLE_VM(EXP) \ + DECL_LANG_FLAG_3 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was the subject of a goto from outside the + current level of scopes of identifiers with variably modified type + and so cannot be defined right now. */ +#define C_DECL_UNDEFINABLE_VM(EXP) \ + DECL_LANG_FLAG_5 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a variable has been declared threadprivate by + #pragma omp threadprivate. */ +#define C_DECL_THREADPRIVATE_P(DECL) DECL_LANG_FLAG_3 (VAR_DECL_CHECK (DECL)) /* Nonzero for a decl which either doesn't exist or isn't a prototype. N.B. Could be simplified if all built-in decls had complete prototypes @@ -145,12 +144,230 @@ struct lang_type GTY(()) /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as TYPE_ARG_TYPES for functions with prototypes, but created for functions without prototypes. */ -#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_BINFO (NODE) +#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_LANG_SLOT_1 (NODE) -/* Values for the first parameter to poplevel. */ -#define KEEP_NO 0 -#define KEEP_YES 1 -#define KEEP_MAYBE 2 +/* Record parser information about an expression that is irrelevant + for code generation alongside a tree representing its value. */ +struct c_expr +{ + /* The value of the expression. */ + tree value; + /* Record the original binary operator of an expression, which may + have been changed by fold, STRING_CST for unparenthesized string + constants, or ERROR_MARK for other expressions (including + parenthesized expressions). */ + enum tree_code original_code; +}; + +/* A kind of type specifier. Note that this information is currently + only used to distinguish tag definitions, tag references and typeof + uses. */ +enum c_typespec_kind { + /* A reserved keyword type specifier. */ + ctsk_resword, + /* A reference to a tag, previously declared, such as "struct foo". + This includes where the previous declaration was as a different + kind of tag, in which case this is only valid if shadowing that + tag in an inner scope. */ + ctsk_tagref, + /* A reference to a tag, not previously declared in a visible + scope. */ + ctsk_tagfirstref, + /* A definition of a tag such as "struct foo { int a; }". */ + ctsk_tagdef, + /* A typedef name. */ + ctsk_typedef, + /* An ObjC-specific kind of type specifier. */ + ctsk_objc, + /* A typeof specifier. */ + ctsk_typeof +}; + +/* A type specifier: this structure is created in the parser and + passed to declspecs_add_type only. */ +struct c_typespec { + /* What kind of type specifier this is. */ + enum c_typespec_kind kind; + /* The specifier itself. */ + tree spec; +}; + +/* A storage class specifier. */ +enum c_storage_class { + csc_none, + csc_auto, + csc_extern, + csc_register, + csc_static, + csc_typedef +}; + +/* A type specifier keyword "void", "_Bool", "char", "int", "float", + "double", or none of these. */ +enum c_typespec_keyword { + cts_none, + cts_void, + cts_bool, + cts_char, + cts_int, + cts_float, + cts_double, + cts_dfloat32, + cts_dfloat64, + cts_dfloat128 +}; + +/* A sequence of declaration specifiers in C. */ +struct c_declspecs { + /* The type specified, if a single type specifier such as a struct, + union or enum specifier, typedef name or typeof specifies the + whole type, or NULL_TREE if none or a keyword such as "void" or + "char" is used. Does not include qualifiers. */ + tree type; + /* The attributes from a typedef decl. */ + tree decl_attr; + /* When parsing, the attributes. Outside the parser, this will be + NULL; attributes (possibly from multiple lists) will be passed + separately. */ + tree attrs; + /* Any type specifier keyword used such as "int", not reflecting + modifiers such as "short", or cts_none if none. */ + enum c_typespec_keyword typespec_word; + /* The storage class specifier, or csc_none if none. */ + enum c_storage_class storage_class; + /* Whether any declaration specifiers have been seen at all. */ + BOOL_BITFIELD declspecs_seen_p : 1; + /* Whether a type specifier has been seen. */ + BOOL_BITFIELD type_seen_p : 1; + /* Whether something other than a storage class specifier or + attribute has been seen. This is used to warn for the + obsolescent usage of storage class specifiers other than at the + start of the list. (Doing this properly would require function + specifiers to be handled separately from storage class + specifiers.) */ + BOOL_BITFIELD non_sc_seen_p : 1; + /* Whether the type is specified by a typedef or typeof name. */ + BOOL_BITFIELD typedef_p : 1; + /* Whether a struct, union or enum type either had its content + defined by a type specifier in the list or was the first visible + declaration of its tag. */ + BOOL_BITFIELD tag_defined_p : 1; + /* Whether the type is explicitly "signed" or specified by a typedef + whose type is explicitly "signed". */ + BOOL_BITFIELD explicit_signed_p : 1; + /* Whether the specifiers include a deprecated typedef. */ + BOOL_BITFIELD deprecated_p : 1; + /* Whether the type defaulted to "int" because there were no type + specifiers. */ + BOOL_BITFIELD default_int_p; + /* Whether "long" was specified. */ + BOOL_BITFIELD long_p : 1; + /* Whether "long" was specified more than once. */ + BOOL_BITFIELD long_long_p : 1; + /* Whether "short" was specified. */ + BOOL_BITFIELD short_p : 1; + /* Whether "signed" was specified. */ + BOOL_BITFIELD signed_p : 1; + /* Whether "unsigned" was specified. */ + BOOL_BITFIELD unsigned_p : 1; + /* Whether "complex" was specified. */ + BOOL_BITFIELD complex_p : 1; + /* Whether "inline" was specified. */ + BOOL_BITFIELD inline_p : 1; + /* Whether "__thread" was specified. */ + BOOL_BITFIELD thread_p : 1; + /* Whether "const" was specified. */ + BOOL_BITFIELD const_p : 1; + /* Whether "volatile" was specified. */ + BOOL_BITFIELD volatile_p : 1; + /* Whether "restrict" was specified. */ + BOOL_BITFIELD restrict_p : 1; +}; + +/* The various kinds of declarators in C. */ +enum c_declarator_kind { + /* An identifier. */ + cdk_id, + /* A function. */ + cdk_function, + /* An array. */ + cdk_array, + /* A pointer. */ + cdk_pointer, + /* Parenthesized declarator with nested attributes. */ + cdk_attrs +}; + +/* Information about the parameters in a function declarator. */ +struct c_arg_info { + /* A list of parameter decls. */ + tree parms; + /* A list of structure, union and enum tags defined. */ + tree tags; + /* A list of argument types to go in the FUNCTION_TYPE. */ + tree types; + /* A list of non-parameter decls (notably enumeration constants) + defined with the parameters. */ + tree others; + /* A list of VLA sizes from the parameters. In a function + definition, these are used to ensure that side-effects in sizes + of arrays converted to pointers (such as a parameter int i[n++]) + take place; otherwise, they are ignored. */ + tree pending_sizes; + /* True when these arguments had [*]. */ + BOOL_BITFIELD had_vla_unspec : 1; +}; + +/* A declarator. */ +struct c_declarator { + /* The kind of declarator. */ + enum c_declarator_kind kind; + /* Except for cdk_id, the contained declarator. For cdk_id, NULL. */ + struct c_declarator *declarator; + location_t id_loc; /* Currently only set for cdk_id. */ + union { + /* For identifiers, an IDENTIFIER_NODE or NULL_TREE if an abstract + declarator. */ + tree id; + /* For functions. */ + struct c_arg_info *arg_info; + /* For arrays. */ + struct { + /* The array dimension, or NULL for [] and [*]. */ + tree dimen; + /* The qualifiers inside []. */ + int quals; + /* The attributes (currently ignored) inside []. */ + tree attrs; + /* Whether [static] was used. */ + BOOL_BITFIELD static_p : 1; + /* Whether [*] was used. */ + BOOL_BITFIELD vla_unspec_p : 1; + } array; + /* For pointers, the qualifiers on the pointer type. */ + int pointer_quals; + /* For attributes. */ + tree attrs; + } u; +}; + +/* A type name. */ +struct c_type_name { + /* The declaration specifiers. */ + struct c_declspecs *specs; + /* The declarator. */ + struct c_declarator *declarator; +}; + +/* A parameter. */ +struct c_parm { + /* The declaration specifiers, minus any prefix attributes. */ + struct c_declspecs *specs; + /* The attributes. */ + tree attrs; + /* The declarator. */ + struct c_declarator *declarator; +}; /* Save and restore the variables in this file and elsewhere that keep track of the progress of compilation of the current function. @@ -159,140 +376,219 @@ struct lang_type GTY(()) struct language_function GTY(()) { struct c_language_function base; + tree x_break_label; + tree x_cont_label; + struct c_switch * GTY((skip)) x_switch_stack; + struct c_arg_info * GTY((skip)) arg_info; int returns_value; int returns_null; int returns_abnormally; int warn_about_return_type; int extern_inline; - int x_in_iteration_stmt; - int x_in_case_stmt; +}; + +/* Save lists of labels used or defined in particular contexts. + Allocated on the parser obstack. */ + +struct c_label_list +{ + /* The label at the head of the list. */ + tree label; + /* The rest of the list. */ + struct c_label_list *next; +}; + +/* Statement expression context. */ + +struct c_label_context_se +{ + /* The labels defined at this level of nesting. */ + struct c_label_list *labels_def; + /* The labels used at this level of nesting. */ + struct c_label_list *labels_used; + /* The next outermost context. */ + struct c_label_context_se *next; +}; + +/* Context of variably modified declarations. */ + +struct c_label_context_vm +{ + /* The labels defined at this level of nesting. */ + struct c_label_list *labels_def; + /* The labels used at this level of nesting. */ + struct c_label_list *labels_used; + /* The scope of this context. Multiple contexts may be at the same + numbered scope, since each variably modified declaration starts a + new context. */ + unsigned scope; + /* The next outermost context. */ + struct c_label_context_vm *next; }; -/* in c-parse.in */ +/* in c-parser.c */ extern void c_parse_init (void); /* in c-aux-info.c */ extern void gen_aux_info_record (tree, int, int, int); /* in c-decl.c */ -extern int c_in_iteration_stmt; -extern int c_in_case_stmt; +extern struct obstack parser_obstack; +extern tree c_break_label; +extern tree c_cont_label; extern int global_bindings_p (void); -extern tree getdecls (void); -extern void pushlevel (int); +extern void push_scope (void); +extern tree pop_scope (void); extern void insert_block (tree); -extern void set_block (tree); -extern tree pushdecl (tree); extern void c_expand_body (tree); extern void c_init_decl_processing (void); extern void c_dup_lang_specific_decl (tree); extern void c_print_identifier (FILE *, tree, int); -extern tree build_array_declarator (tree, tree, int, int); +extern int quals_from_declspecs (const struct c_declspecs *); +extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *, + bool, bool); extern tree build_enumerator (tree, tree); -extern void check_for_loop_decls (void); +extern tree check_for_loop_decls (void); extern void mark_forward_parm_decls (void); -extern int complete_array_type (tree, tree, int); extern void declare_parm_level (void); -extern void undeclared_variable (tree); +extern void undeclared_variable (tree, location_t); extern tree declare_label (tree); extern tree define_label (location_t, tree); +extern void c_maybe_initialize_eh (void); extern void finish_decl (tree, tree, tree); extern tree finish_enum (tree, tree, tree); extern void finish_function (void); extern tree finish_struct (tree, tree, tree); -extern tree get_parm_info (int); -extern tree grokfield (tree, tree, tree); -extern tree groktypename (tree); -extern tree groktypename_in_parm_context (tree); +extern struct c_arg_info *get_parm_info (bool); +extern tree grokfield (struct c_declarator *, struct c_declspecs *, tree); +extern tree groktypename (struct c_type_name *); +extern tree grokparm (const struct c_parm *); extern tree implicitly_declare (tree); -extern int in_parm_level_p (void); extern void keep_next_level (void); -extern tree lookup_name (tree); extern void pending_xref_error (void); extern void c_push_function_context (struct function *); extern void c_pop_function_context (struct function *); -extern void push_parm_decl (tree); -extern tree pushdecl_top_level (tree); -extern void pushtag (tree, tree); -extern tree set_array_declarator_type (tree, tree, int); -extern void shadow_tag (tree); -extern void shadow_tag_warned (tree, int); +extern void push_parm_decl (const struct c_parm *); +extern struct c_declarator *set_array_declarator_inner (struct c_declarator *, + struct c_declarator *, + bool); +extern tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); +extern void shadow_tag (const struct c_declspecs *); +extern void shadow_tag_warned (const struct c_declspecs *, int); extern tree start_enum (tree); -extern int start_function (tree, tree, tree); -extern tree start_decl (tree, tree, int, tree); +extern int start_function (struct c_declspecs *, struct c_declarator *, tree); +extern tree start_decl (struct c_declarator *, struct c_declspecs *, bool, + tree); extern tree start_struct (enum tree_code, tree); extern void store_parm_decls (void); +extern void store_parm_decls_from (struct c_arg_info *); extern tree xref_tag (enum tree_code, tree); -extern tree c_begin_compound_stmt (void); -extern void c_expand_deferred_function (tree); -extern void c_expand_decl_stmt (tree); -extern void c_static_assembler_name (tree); -extern tree make_pointer_declarator (tree, tree); -extern void merge_translation_unit_decls (void); +extern struct c_typespec parser_xref_tag (enum tree_code, tree); +extern int c_expand_decl (tree); +extern struct c_parm *build_c_parm (struct c_declspecs *, tree, + struct c_declarator *); +extern struct c_declarator *build_attrs_declarator (tree, + struct c_declarator *); +extern struct c_declarator *build_function_declarator (struct c_arg_info *, + struct c_declarator *); +extern struct c_declarator *build_id_declarator (tree); +extern struct c_declarator *make_pointer_declarator (struct c_declspecs *, + struct c_declarator *); +extern struct c_declspecs *build_null_declspecs (void); +extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_type (struct c_declspecs *, + struct c_typespec); +extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree); +extern struct c_declspecs *finish_declspecs (struct c_declspecs *); /* in c-objc-common.c */ extern int c_disregard_inline_limits (tree); extern int c_cannot_inline_tree_fn (tree *); extern bool c_objc_common_init (void); -extern int c_missing_noreturn_ok_p (tree); -extern void c_objc_common_finish_file (void); -extern int defer_fn (tree); +extern bool c_missing_noreturn_ok_p (tree); +extern tree c_objc_common_truthvalue_conversion (tree expr); extern bool c_warn_unused_global_decl (tree); +extern void c_initialize_diagnostics (diagnostic_context *); +extern bool c_vla_unspec_p (tree x, tree fn); #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \ c_build_qualified_type ((TYPE), \ ((CONST_P) ? TYPE_QUAL_CONST : 0) | \ ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0)) -#define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0) - /* in c-typeck.c */ +extern int in_alignof; +extern int in_sizeof; +extern int in_typeof; -/* For use with comptypes. */ -enum { - COMPARE_STRICT = 0 -}; +extern struct c_switch *c_switch_stack; +extern struct c_label_context_se *label_context_stack_se; +extern struct c_label_context_vm *label_context_stack_vm; extern tree require_complete_type (tree); -extern int comptypes (tree, tree, int); -extern tree c_size_in_bytes (tree); +extern int same_translation_unit_p (tree, tree); +extern int comptypes (tree, tree); +extern bool c_vla_type_p (tree); extern bool c_mark_addressable (tree); extern void c_incomplete_type_error (tree, tree); extern tree c_type_promotes_to (tree); +extern struct c_expr default_function_array_conversion (struct c_expr); +extern tree composite_type (tree, tree); extern tree build_component_ref (tree, tree); -extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); -extern tree build_external_ref (tree, int); -extern tree parser_build_binary_op (enum tree_code, tree, tree); -extern int c_tree_expr_nonnegative_p (tree); -extern void readonly_error (tree, const char *); +extern tree build_external_ref (tree, int, location_t); +extern void pop_maybe_used (bool); +extern struct c_expr c_expr_sizeof_expr (struct c_expr); +extern struct c_expr c_expr_sizeof_type (struct c_type_name *); +extern struct c_expr parser_build_unary_op (enum tree_code, struct c_expr); +extern struct c_expr parser_build_binary_op (enum tree_code, struct c_expr, + struct c_expr); extern tree build_conditional_expr (tree, tree, tree); -extern tree build_compound_expr (tree); -extern tree c_cast_expr (tree, tree); +extern tree build_compound_expr (tree, tree); +extern tree c_cast_expr (struct c_type_name *, tree); extern tree build_c_cast (tree, tree); -extern tree build_modify_expr (tree, enum tree_code, tree); extern void store_init_value (tree, tree); extern void error_init (const char *); extern void pedwarn_init (const char *); +extern void maybe_warn_string_init (tree, struct c_expr); extern void start_init (tree, tree, int); extern void finish_init (void); extern void really_start_incremental_init (tree); extern void push_init_level (int); -extern tree pop_init_level (int); +extern struct c_expr pop_init_level (int); extern void set_init_index (tree, tree); extern void set_init_label (tree); -extern void process_init_element (tree); +extern void process_init_element (struct c_expr); extern tree build_compound_literal (tree, tree); -extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_PRINTF_1; -extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1; extern tree c_start_case (tree); -extern void c_finish_case (void); -extern tree simple_asm_stmt (tree); -extern tree build_asm_stmt (tree, tree, tree, tree, tree); +extern void c_finish_case (tree); +extern tree build_asm_expr (tree, tree, tree, tree, bool); +extern tree build_asm_stmt (tree, tree); extern tree c_convert_parm_for_inlining (tree, tree, tree, int); +extern int c_types_compatible_p (tree, tree); +extern tree c_begin_compound_stmt (bool); +extern tree c_end_compound_stmt (tree, bool); +extern void c_finish_if_stmt (location_t, tree, tree, tree, bool); +extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool); +extern tree c_begin_stmt_expr (void); +extern tree c_finish_stmt_expr (tree); +extern tree c_process_expr_stmt (tree); +extern tree c_finish_expr_stmt (tree); +extern tree c_finish_return (tree); +extern tree c_finish_bc_stmt (tree *, bool); +extern tree c_finish_goto_label (tree); +extern tree c_finish_goto_ptr (tree); +extern void c_begin_vm_scope (unsigned int); +extern void c_end_vm_scope (unsigned int); +extern tree c_expr_to_decl (tree, bool *, bool *, bool *); +extern tree c_begin_omp_parallel (void); +extern tree c_finish_omp_parallel (tree, tree); +extern tree c_finish_omp_clauses (tree); /* Set to 0 at beginning of a function definition, set to 1 if a return statement that specifies a return value is seen. */ @@ -313,18 +609,28 @@ extern int current_function_returns_abnormally; extern int system_header_p; +/* True means global_bindings_p should return false even if the scope stack + says we are in file scope. */ + +extern bool c_override_global_bindings_to_false; + +/* True means we've initialized exception handling. */ +extern bool c_eh_initialized_p; + /* In c-decl.c */ extern void c_finish_incomplete_decl (tree); -extern void *get_current_scope (void); -extern void objc_mark_locals_volatile (void *); extern void c_write_global_declarations (void); -extern GTY(()) tree static_ctors; -extern GTY(()) tree static_dtors; - /* In order for the format checking to accept the C frontend diagnostic framework extensions, you must include this file before toplev.h, not after. */ -#define GCC_DIAG_STYLE __gcc_cdiag__ +#if GCC_VERSION >= 4001 +#define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m) +#else +#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m) +#endif + +extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2); +extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2); #endif /* ! GCC_C_TREE_H */ diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c index 42c7b77609b..912fd273951 100644 --- a/contrib/gcc/c-typeck.c +++ b/contrib/gcc/c-typeck.c @@ -1,6 +1,7 @@ /* Build expressions with type checking for C compiler. - Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,18 +17,14 @@ for more details. 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 is part of the C front end. It contains routines to build C expressions given their operands, including computing the types of the result, C-specific error checks, - and some optimization. - - There are also routines to build RETURN_STMT nodes and CASE_STMT nodes, - and to process initializations in declarations (since they work - like a strange sort of assignment). */ + and some optimization. */ #include "config.h" #include "system.h" @@ -35,6 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" #include "tree.h" +#include "langhooks.h" #include "c-tree.h" #include "tm_p.h" #include "flags.h" @@ -44,6 +42,31 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "intl.h" #include "ggc.h" #include "target.h" +#include "tree-iterator.h" +#include "tree-gimple.h" +#include "tree-flow.h" + +/* Possible cases of implicit bad conversions. Used to select + diagnostic messages in convert_for_assignment. */ +enum impl_conv { + ic_argpass, + ic_argpass_nonproto, + ic_assign, + ic_init, + ic_return +}; + +/* The level of nesting inside "__alignof__". */ +int in_alignof; + +/* The level of nesting inside "sizeof". */ +int in_sizeof; + +/* The level of nesting inside "typeof". */ +int in_typeof; + +struct c_label_context_se *label_context_stack_se; +struct c_label_context_vm *label_context_stack_vm; /* Nonzero if we've already printed a "missing braces around initializer" message within this initializer. */ @@ -52,32 +75,26 @@ static int missing_braces_mentioned; static int require_constant_value; static int require_constant_elements; +static bool null_pointer_constant_p (tree); static tree qualify_type (tree, tree); -static int same_translation_unit_p (tree, tree); -static int tagged_types_tu_compatible_p (tree, tree, int); -static int comp_target_types (tree, tree, int); -static int function_types_compatible_p (tree, tree, int); -static int type_lists_compatible_p (tree, tree, int); +static int tagged_types_tu_compatible_p (tree, tree); +static int comp_target_types (tree, tree); +static int function_types_compatible_p (tree, tree); +static int type_lists_compatible_p (tree, tree); static tree decl_constant_value_for_broken_optimization (tree); -static tree default_function_array_conversion (tree); static tree lookup_field (tree, tree); static tree convert_arguments (tree, tree, tree, tree); static tree pointer_diff (tree, tree); -static tree unary_complex_lvalue (enum tree_code, tree, int); -static void pedantic_lvalue_warning (enum tree_code); -static tree internal_build_compound_expr (tree, int); -static tree convert_for_assignment (tree, tree, const char *, tree, tree, +static tree convert_for_assignment (tree, tree, enum impl_conv, tree, tree, int); -static void warn_for_assignment (const char *, const char *, tree, int); static tree valid_compound_expr_initializer (tree, tree); static void push_string (const char *); static void push_member_name (tree); -static void push_array_bounds (int); static int spelling_length (void); static char *print_spelling (char *); static void warning_init (const char *); -static tree digest_init (tree, tree, int); -static void output_init_element (tree, tree, tree, int); +static tree digest_init (tree, tree, bool, int); +static void output_init_element (tree, bool, tree, tree, int); static void output_pending_init_elements (int); static int set_designator (int); static void push_range_stack (tree); @@ -85,7 +102,42 @@ static void add_pending_init (tree, tree); static void set_nonincremental_init (void); static void set_nonincremental_init_from_string (tree); static tree find_init_member (tree); +static void readonly_error (tree, enum lvalue_use); +static int lvalue_or_else (tree, enum lvalue_use); +static int lvalue_p (tree); +static void record_maybe_used_decl (tree); +static int comptypes_internal (tree, tree); +/* Return true if EXP is a null pointer constant, false otherwise. */ + +static bool +null_pointer_constant_p (tree expr) +{ + /* This should really operate on c_expr structures, but they aren't + yet available everywhere required. */ + tree type = TREE_TYPE (expr); + return (TREE_CODE (expr) == INTEGER_CST + && !TREE_CONSTANT_OVERFLOW (expr) + && integer_zerop (expr) + && (INTEGRAL_TYPE_P (type) + || (TREE_CODE (type) == POINTER_TYPE + && VOID_TYPE_P (TREE_TYPE (type)) + && TYPE_QUALS (TREE_TYPE (type)) == TYPE_UNQUALIFIED))); +} + /* This is a cache to hold if two types are compatible or not. */ + +struct tagged_tu_seen_cache { + const struct tagged_tu_seen_cache * next; + tree t1; + tree t2; + /* The return value of tagged_types_tu_compatible_p if we had seen + these two types already. */ + int val; +}; + +static const struct tagged_tu_seen_cache * tagged_tu_seen_base; +static void free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *); + /* Do `exp = require_complete_type (exp);' to make sure exp does not have an incomplete type. (That includes void types.) */ @@ -120,8 +172,7 @@ c_incomplete_type_error (tree value, tree type) if (value != 0 && (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == PARM_DECL)) - error ("`%s' has an incomplete type", - IDENTIFIER_POINTER (DECL_NAME (value))); + error ("%qD has an incomplete type", value); else { retry: @@ -160,16 +211,15 @@ c_incomplete_type_error (tree value, tree type) return; default: - abort (); + gcc_unreachable (); } if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - error ("invalid use of undefined type `%s %s'", - type_code_string, IDENTIFIER_POINTER (TYPE_NAME (type))); + error ("invalid use of undefined type %<%s %E%>", + type_code_string, TYPE_NAME (type)); else /* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */ - error ("invalid use of incomplete typedef `%s'", - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); + error ("invalid use of incomplete typedef %qD", TYPE_NAME (type)); } } @@ -185,9 +235,9 @@ c_type_promotes_to (tree type) if (c_promoting_integer_type_p (type)) { /* Preserve unsignedness if not really getting any wider. */ - if (TREE_UNSIGNED (type) - && (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))) - return unsigned_type_node; + if (TYPE_UNSIGNED (type) + && (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))) + return unsigned_type_node; return integer_type_node; } @@ -203,17 +253,26 @@ qualify_type (tree type, tree like) return c_build_qualified_type (type, TYPE_QUALS (type) | TYPE_QUALS (like)); } - -/* Return the common type of two types. - We assume that comptypes has already been done and returned 1; - if that isn't so, this may crash. In particular, we assume that qualifiers - match. - This is the type for the result of most arithmetic operations - if the operands have the given two types. */ +/* Return true iff the given tree T is a variable length array. */ + +bool +c_vla_type_p (tree t) +{ + if (TREE_CODE (t) == ARRAY_TYPE + && C_TYPE_VARIABLE_SIZE (t)) + return true; + return false; +} + +/* Return the composite type of two compatible types. + + We assume that comptypes has already been done and returned + nonzero; if that isn't so, this may crash. In particular, we + assume that qualifiers match. */ tree -common_type (tree t1, tree t2) +composite_type (tree t1, tree t2) { enum tree_code code1; enum tree_code code2; @@ -229,134 +288,111 @@ common_type (tree t1, tree t2) if (t2 == error_mark_node) return t1; - /* Merge the attributes. */ - attributes = (*targetm.merge_type_attributes) (t1, t2); - - /* Treat an enum type as the unsigned integer type of the same width. */ - - if (TREE_CODE (t1) == ENUMERAL_TYPE) - t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1); - if (TREE_CODE (t2) == ENUMERAL_TYPE) - t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1); - code1 = TREE_CODE (t1); code2 = TREE_CODE (t2); - /* If one type is complex, form the common type of the non-complex - components, then make that complex. Use T1 or T2 if it is the - required type. */ - if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE) - { - tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1) : t1; - tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2) : t2; - tree subtype = common_type (subtype1, subtype2); + /* Merge the attributes. */ + attributes = targetm.merge_type_attributes (t1, t2); - if (code1 == COMPLEX_TYPE && TREE_TYPE (t1) == subtype) - return build_type_attribute_variant (t1, attributes); - else if (code2 == COMPLEX_TYPE && TREE_TYPE (t2) == subtype) - return build_type_attribute_variant (t2, attributes); - else - return build_type_attribute_variant (build_complex_type (subtype), - attributes); - } + /* If one is an enumerated type and the other is the compatible + integer type, the composite type might be either of the two + (DR#013 question 3). For consistency, use the enumerated type as + the composite type. */ + + if (code1 == ENUMERAL_TYPE && code2 == INTEGER_TYPE) + return t1; + if (code2 == ENUMERAL_TYPE && code1 == INTEGER_TYPE) + return t2; + + gcc_assert (code1 == code2); switch (code1) { - case INTEGER_TYPE: - case REAL_TYPE: - /* If only one is real, use it as the result. */ - - if (code1 == REAL_TYPE && code2 != REAL_TYPE) - return build_type_attribute_variant (t1, attributes); - - if (code2 == REAL_TYPE && code1 != REAL_TYPE) - return build_type_attribute_variant (t2, attributes); - - /* Both real or both integers; use the one with greater precision. */ - - if (TYPE_PRECISION (t1) > TYPE_PRECISION (t2)) - return build_type_attribute_variant (t1, attributes); - else if (TYPE_PRECISION (t2) > TYPE_PRECISION (t1)) - return build_type_attribute_variant (t2, attributes); - - /* Same precision. Prefer longs to ints even when same size. */ - - if (TYPE_MAIN_VARIANT (t1) == long_unsigned_type_node - || TYPE_MAIN_VARIANT (t2) == long_unsigned_type_node) - { - t1 = build_qualified_type (long_unsigned_type_node, - TYPE_QUALS (t1)); - return build_type_attribute_variant (t1, attributes); - } - - if (TYPE_MAIN_VARIANT (t1) == long_integer_type_node - || TYPE_MAIN_VARIANT (t2) == long_integer_type_node) - { - tree ntype; - - /* But preserve unsignedness from the other type, - since long cannot hold all the values of an unsigned int. */ - if (TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2)) - ntype = long_unsigned_type_node; - else - ntype = long_integer_type_node; - - ntype = build_qualified_type (ntype, TYPE_QUALS (t1)); - return build_type_attribute_variant (ntype, attributes); - } - - /* Likewise, prefer long double to double even if same size. */ - if (TYPE_MAIN_VARIANT (t1) == long_double_type_node - || TYPE_MAIN_VARIANT (t2) == long_double_type_node) - { - t1 = build_qualified_type (long_double_type_node, - TYPE_QUALS (t1)); - return build_type_attribute_variant (t1, attributes); - } - - /* Otherwise prefer the unsigned one. */ - - if (TREE_UNSIGNED (t1)) - return build_type_attribute_variant (t1, attributes); - else - return build_type_attribute_variant (t2, attributes); - case POINTER_TYPE: - /* For two pointers, do this recursively on the target type, - and combine the qualifiers of the two types' targets. */ - /* This code was turned off; I don't know why. - But ANSI C specifies doing this with the qualifiers. - So I turned it on again. */ + /* For two pointers, do this recursively on the target type. */ { tree pointed_to_1 = TREE_TYPE (t1); tree pointed_to_2 = TREE_TYPE (t2); - tree target = common_type (TYPE_MAIN_VARIANT (pointed_to_1), - TYPE_MAIN_VARIANT (pointed_to_2)); - t1 = build_pointer_type (c_build_qualified_type - (target, - TYPE_QUALS (pointed_to_1) | - TYPE_QUALS (pointed_to_2))); - return build_type_attribute_variant (t1, attributes); + tree target = composite_type (pointed_to_1, pointed_to_2); + t1 = build_pointer_type (target); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } case ARRAY_TYPE: { - tree elt = common_type (TREE_TYPE (t1), TREE_TYPE (t2)); + tree elt = composite_type (TREE_TYPE (t1), TREE_TYPE (t2)); + int quals; + tree unqual_elt; + tree d1 = TYPE_DOMAIN (t1); + tree d2 = TYPE_DOMAIN (t2); + bool d1_variable, d2_variable; + bool d1_zero, d2_zero; + + /* We should not have any type quals on arrays at all. */ + gcc_assert (!TYPE_QUALS (t1) && !TYPE_QUALS (t2)); + + d1_zero = d1 == 0 || !TYPE_MAX_VALUE (d1); + d2_zero = d2 == 0 || !TYPE_MAX_VALUE (d2); + + d1_variable = (!d1_zero + && (TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST + || TREE_CODE (TYPE_MAX_VALUE (d1)) != INTEGER_CST)); + d2_variable = (!d2_zero + && (TREE_CODE (TYPE_MIN_VALUE (d2)) != INTEGER_CST + || TREE_CODE (TYPE_MAX_VALUE (d2)) != INTEGER_CST)); + d1_variable = d1_variable || (d1_zero && c_vla_type_p (t1)); + d2_variable = d2_variable || (d2_zero && c_vla_type_p (t2)); + /* Save space: see if the result is identical to one of the args. */ - if (elt == TREE_TYPE (t1) && TYPE_DOMAIN (t1)) + if (elt == TREE_TYPE (t1) && TYPE_DOMAIN (t1) + && (d2_variable || d2_zero || !d1_variable)) return build_type_attribute_variant (t1, attributes); - if (elt == TREE_TYPE (t2) && TYPE_DOMAIN (t2)) + if (elt == TREE_TYPE (t2) && TYPE_DOMAIN (t2) + && (d1_variable || d1_zero || !d2_variable)) return build_type_attribute_variant (t2, attributes); - /* Merge the element types, and have a size if either arg has one. */ - t1 = build_array_type (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)); + + if (elt == TREE_TYPE (t1) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1)) + return build_type_attribute_variant (t1, attributes); + if (elt == TREE_TYPE (t2) && !TYPE_DOMAIN (t2) && !TYPE_DOMAIN (t1)) + return build_type_attribute_variant (t2, attributes); + + /* Merge the element types, and have a size if either arg has + one. We may have qualifiers on the element types. To set + up TYPE_MAIN_VARIANT correctly, we need to form the + composite of the unqualified types and add the qualifiers + back at the end. */ + quals = TYPE_QUALS (strip_array_types (elt)); + unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED); + t1 = build_array_type (unqual_elt, + TYPE_DOMAIN ((TYPE_DOMAIN (t1) + && (d2_variable + || d2_zero + || !d1_variable)) + ? t1 + : t2)); + t1 = c_build_qualified_type (t1, quals); return build_type_attribute_variant (t1, attributes); } + case ENUMERAL_TYPE: + case RECORD_TYPE: + case UNION_TYPE: + if (attributes != NULL) + { + /* Try harder not to create a new aggregate type. */ + if (attribute_list_equal (TYPE_ATTRIBUTES (t1), attributes)) + return t1; + if (attribute_list_equal (TYPE_ATTRIBUTES (t2), attributes)) + return t2; + } + return build_type_attribute_variant (t1, attributes); + case FUNCTION_TYPE: /* Function types: prefer the one that specified arg types. If both do, merge the arg types. Also merge the return types. */ { - tree valtype = common_type (TREE_TYPE (t1), TREE_TYPE (t2)); + tree valtype = composite_type (TREE_TYPE (t1), TREE_TYPE (t2)); tree p1 = TYPE_ARG_TYPES (t1); tree p2 = TYPE_ARG_TYPES (t2); int len; @@ -364,28 +400,30 @@ common_type (tree t1, tree t2) int i; /* Save space: see if the result is identical to one of the args. */ - if (valtype == TREE_TYPE (t1) && ! TYPE_ARG_TYPES (t2)) + if (valtype == TREE_TYPE (t1) && !TYPE_ARG_TYPES (t2)) return build_type_attribute_variant (t1, attributes); - if (valtype == TREE_TYPE (t2) && ! TYPE_ARG_TYPES (t1)) + if (valtype == TREE_TYPE (t2) && !TYPE_ARG_TYPES (t1)) return build_type_attribute_variant (t2, attributes); /* Simple way if one arg fails to specify argument types. */ if (TYPE_ARG_TYPES (t1) == 0) { - t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2)); - return build_type_attribute_variant (t1, attributes); + t1 = build_function_type (valtype, TYPE_ARG_TYPES (t2)); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } if (TYPE_ARG_TYPES (t2) == 0) { t1 = build_function_type (valtype, TYPE_ARG_TYPES (t1)); - return build_type_attribute_variant (t1, attributes); + t1 = build_type_attribute_variant (t1, attributes); + return qualify_type (t1, t2); } /* If both args specify argument types, we must merge the two lists, argument by argument. */ - - pushlevel (0); - declare_parm_level (); + /* Tell global_bindings_p to return false so that variable_size + doesn't die on VLAs in parameter types. */ + c_override_global_bindings_to_false = true; len = list_length (p1); newargs = 0; @@ -418,39 +456,59 @@ common_type (tree t1, tree t2) && TREE_VALUE (p1) != TREE_VALUE (p2)) { tree memb; + tree mv2 = TREE_VALUE (p2); + if (mv2 && mv2 != error_mark_node + && TREE_CODE (mv2) != ARRAY_TYPE) + mv2 = TYPE_MAIN_VARIANT (mv2); for (memb = TYPE_FIELDS (TREE_VALUE (p1)); memb; memb = TREE_CHAIN (memb)) - if (comptypes (TREE_TYPE (memb), TREE_VALUE (p2), - COMPARE_STRICT)) - { - TREE_VALUE (n) = TREE_VALUE (p2); - if (pedantic) - pedwarn ("function types not truly compatible in ISO C"); - goto parm_done; - } + { + tree mv3 = TREE_TYPE (memb); + if (mv3 && mv3 != error_mark_node + && TREE_CODE (mv3) != ARRAY_TYPE) + mv3 = TYPE_MAIN_VARIANT (mv3); + if (comptypes (mv3, mv2)) + { + TREE_VALUE (n) = composite_type (TREE_TYPE (memb), + TREE_VALUE (p2)); + if (pedantic) + pedwarn ("function types not truly compatible in ISO C"); + goto parm_done; + } + } } if (TREE_CODE (TREE_VALUE (p2)) == UNION_TYPE && TREE_VALUE (p2) != TREE_VALUE (p1)) { tree memb; + tree mv1 = TREE_VALUE (p1); + if (mv1 && mv1 != error_mark_node + && TREE_CODE (mv1) != ARRAY_TYPE) + mv1 = TYPE_MAIN_VARIANT (mv1); for (memb = TYPE_FIELDS (TREE_VALUE (p2)); memb; memb = TREE_CHAIN (memb)) - if (comptypes (TREE_TYPE (memb), TREE_VALUE (p1), - COMPARE_STRICT)) - { - TREE_VALUE (n) = TREE_VALUE (p1); - if (pedantic) - pedwarn ("function types not truly compatible in ISO C"); - goto parm_done; - } + { + tree mv3 = TREE_TYPE (memb); + if (mv3 && mv3 != error_mark_node + && TREE_CODE (mv3) != ARRAY_TYPE) + mv3 = TYPE_MAIN_VARIANT (mv3); + if (comptypes (mv3, mv1)) + { + TREE_VALUE (n) = composite_type (TREE_TYPE (memb), + TREE_VALUE (p1)); + if (pedantic) + pedwarn ("function types not truly compatible in ISO C"); + goto parm_done; + } + } } - TREE_VALUE (n) = common_type (TREE_VALUE (p1), TREE_VALUE (p2)); + TREE_VALUE (n) = composite_type (TREE_VALUE (p1), TREE_VALUE (p2)); parm_done: ; } - poplevel (0, 0, 0); - + c_override_global_bindings_to_false = false; t1 = build_function_type (valtype, newargs); + t1 = qualify_type (t1, t2); /* ... falls through ... */ } @@ -459,13 +517,273 @@ common_type (tree t1, tree t2) } } + +/* Return the type of a conditional expression between pointers to + possibly differently qualified versions of compatible types. + + We assume that comp_target_types has already been done and returned + nonzero; if that isn't so, this may crash. */ + +static tree +common_pointer_type (tree t1, tree t2) +{ + tree attributes; + tree pointed_to_1, mv1; + tree pointed_to_2, mv2; + tree target; + + /* Save time if the two types are the same. */ + + if (t1 == t2) return t1; + + /* If one type is nonsense, use the other. */ + if (t1 == error_mark_node) + return t2; + if (t2 == error_mark_node) + return t1; + + gcc_assert (TREE_CODE (t1) == POINTER_TYPE + && TREE_CODE (t2) == POINTER_TYPE); + + /* Merge the attributes. */ + attributes = targetm.merge_type_attributes (t1, t2); + + /* Find the composite type of the target types, and combine the + qualifiers of the two types' targets. Do not lose qualifiers on + array element types by taking the TYPE_MAIN_VARIANT. */ + mv1 = pointed_to_1 = TREE_TYPE (t1); + mv2 = pointed_to_2 = TREE_TYPE (t2); + if (TREE_CODE (mv1) != ARRAY_TYPE) + mv1 = TYPE_MAIN_VARIANT (pointed_to_1); + if (TREE_CODE (mv2) != ARRAY_TYPE) + mv2 = TYPE_MAIN_VARIANT (pointed_to_2); + target = composite_type (mv1, mv2); + t1 = build_pointer_type (c_build_qualified_type + (target, + TYPE_QUALS (pointed_to_1) | + TYPE_QUALS (pointed_to_2))); + return build_type_attribute_variant (t1, attributes); +} + +/* Return the common type for two arithmetic types under the usual + arithmetic conversions. The default conversions have already been + applied, and enumerated types converted to their compatible integer + types. The resulting type is unqualified and has no attributes. + + This is the type for the result of most arithmetic operations + if the operands have the given two types. */ + +static tree +c_common_type (tree t1, tree t2) +{ + enum tree_code code1; + enum tree_code code2; + + /* If one type is nonsense, use the other. */ + if (t1 == error_mark_node) + return t2; + if (t2 == error_mark_node) + return t1; + + if (TYPE_QUALS (t1) != TYPE_UNQUALIFIED) + t1 = TYPE_MAIN_VARIANT (t1); + + if (TYPE_QUALS (t2) != TYPE_UNQUALIFIED) + t2 = TYPE_MAIN_VARIANT (t2); + + if (TYPE_ATTRIBUTES (t1) != NULL_TREE) + t1 = build_type_attribute_variant (t1, NULL_TREE); + + if (TYPE_ATTRIBUTES (t2) != NULL_TREE) + t2 = build_type_attribute_variant (t2, NULL_TREE); + + /* Save time if the two types are the same. */ + + if (t1 == t2) return t1; + + code1 = TREE_CODE (t1); + code2 = TREE_CODE (t2); + + gcc_assert (code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE + || code1 == REAL_TYPE || code1 == INTEGER_TYPE); + gcc_assert (code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE + || code2 == REAL_TYPE || code2 == INTEGER_TYPE); + + /* When one operand is a decimal float type, the other operand cannot be + a generic float type or a complex type. We also disallow vector types + here. */ + if ((DECIMAL_FLOAT_TYPE_P (t1) || DECIMAL_FLOAT_TYPE_P (t2)) + && !(DECIMAL_FLOAT_TYPE_P (t1) && DECIMAL_FLOAT_TYPE_P (t2))) + { + if (code1 == VECTOR_TYPE || code2 == VECTOR_TYPE) + { + error ("can%'t mix operands of decimal float and vector types"); + return error_mark_node; + } + if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE) + { + error ("can%'t mix operands of decimal float and complex types"); + return error_mark_node; + } + if (code1 == REAL_TYPE && code2 == REAL_TYPE) + { + error ("can%'t mix operands of decimal float and other float types"); + return error_mark_node; + } + } + + /* If one type is a vector type, return that type. (How the usual + arithmetic conversions apply to the vector types extension is not + precisely specified.) */ + if (code1 == VECTOR_TYPE) + return t1; + + if (code2 == VECTOR_TYPE) + return t2; + + /* If one type is complex, form the common type of the non-complex + components, then make that complex. Use T1 or T2 if it is the + required type. */ + if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE) + { + tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1) : t1; + tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2) : t2; + tree subtype = c_common_type (subtype1, subtype2); + + if (code1 == COMPLEX_TYPE && TREE_TYPE (t1) == subtype) + return t1; + else if (code2 == COMPLEX_TYPE && TREE_TYPE (t2) == subtype) + return t2; + else + return build_complex_type (subtype); + } + + /* If only one is real, use it as the result. */ + + if (code1 == REAL_TYPE && code2 != REAL_TYPE) + return t1; + + if (code2 == REAL_TYPE && code1 != REAL_TYPE) + return t2; + + /* If both are real and either are decimal floating point types, use + the decimal floating point type with the greater precision. */ + + if (code1 == REAL_TYPE && code2 == REAL_TYPE) + { + if (TYPE_MAIN_VARIANT (t1) == dfloat128_type_node + || TYPE_MAIN_VARIANT (t2) == dfloat128_type_node) + return dfloat128_type_node; + else if (TYPE_MAIN_VARIANT (t1) == dfloat64_type_node + || TYPE_MAIN_VARIANT (t2) == dfloat64_type_node) + return dfloat64_type_node; + else if (TYPE_MAIN_VARIANT (t1) == dfloat32_type_node + || TYPE_MAIN_VARIANT (t2) == dfloat32_type_node) + return dfloat32_type_node; + } + + /* Both real or both integers; use the one with greater precision. */ + + if (TYPE_PRECISION (t1) > TYPE_PRECISION (t2)) + return t1; + else if (TYPE_PRECISION (t2) > TYPE_PRECISION (t1)) + return t2; + + /* Same precision. Prefer long longs to longs to ints when the + same precision, following the C99 rules on integer type rank + (which are equivalent to the C90 rules for C90 types). */ + + if (TYPE_MAIN_VARIANT (t1) == long_long_unsigned_type_node + || TYPE_MAIN_VARIANT (t2) == long_long_unsigned_type_node) + return long_long_unsigned_type_node; + + if (TYPE_MAIN_VARIANT (t1) == long_long_integer_type_node + || TYPE_MAIN_VARIANT (t2) == long_long_integer_type_node) + { + if (TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2)) + return long_long_unsigned_type_node; + else + return long_long_integer_type_node; + } + + if (TYPE_MAIN_VARIANT (t1) == long_unsigned_type_node + || TYPE_MAIN_VARIANT (t2) == long_unsigned_type_node) + return long_unsigned_type_node; + + if (TYPE_MAIN_VARIANT (t1) == long_integer_type_node + || TYPE_MAIN_VARIANT (t2) == long_integer_type_node) + { + /* But preserve unsignedness from the other type, + since long cannot hold all the values of an unsigned int. */ + if (TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2)) + return long_unsigned_type_node; + else + return long_integer_type_node; + } + + /* Likewise, prefer long double to double even if same size. */ + if (TYPE_MAIN_VARIANT (t1) == long_double_type_node + || TYPE_MAIN_VARIANT (t2) == long_double_type_node) + return long_double_type_node; + + /* Otherwise prefer the unsigned one. */ + + if (TYPE_UNSIGNED (t1)) + return t1; + else + return t2; +} +/* Wrapper around c_common_type that is used by c-common.c and other + front end optimizations that remove promotions. ENUMERAL_TYPEs + are allowed here and are converted to their compatible integer types. + BOOLEAN_TYPEs are allowed here and return either boolean_type_node or + preferably a non-Boolean type as the common type. */ +tree +common_type (tree t1, tree t2) +{ + if (TREE_CODE (t1) == ENUMERAL_TYPE) + t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1); + if (TREE_CODE (t2) == ENUMERAL_TYPE) + t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1); + + /* If both types are BOOLEAN_TYPE, then return boolean_type_node. */ + if (TREE_CODE (t1) == BOOLEAN_TYPE + && TREE_CODE (t2) == BOOLEAN_TYPE) + return boolean_type_node; + + /* If either type is BOOLEAN_TYPE, then return the other. */ + if (TREE_CODE (t1) == BOOLEAN_TYPE) + return t2; + if (TREE_CODE (t2) == BOOLEAN_TYPE) + return t1; + + return c_common_type (t1, t2); +} + /* Return 1 if TYPE1 and TYPE2 are compatible types for assignment or various other operations. Return 2 if they are compatible but a warning may be needed if you use them together. */ int -comptypes (tree type1, tree type2, int flags) +comptypes (tree type1, tree type2) +{ + const struct tagged_tu_seen_cache * tagged_tu_seen_base1 = tagged_tu_seen_base; + int val; + + val = comptypes_internal (type1, type2); + free_all_tagged_tu_seen_up_to (tagged_tu_seen_base1); + + return val; +} + +/* Return 1 if TYPE1 and TYPE2 are compatible types for assignment + or various other operations. Return 2 if they are compatible + but a warning may be needed if you use them together. This + differs from comptypes, in that we don't free the seen types. */ + +static int +comptypes_internal (tree type1, tree type2) { tree t1 = type1; tree t2 = type2; @@ -480,21 +798,22 @@ comptypes (tree type1, tree type2, int flags) /* If either type is the internal version of sizetype, return the language version. */ if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1) - && TYPE_DOMAIN (t1) != 0) - t1 = TYPE_DOMAIN (t1); + && TYPE_ORIG_SIZE_TYPE (t1)) + t1 = TYPE_ORIG_SIZE_TYPE (t1); if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2) - && TYPE_DOMAIN (t2) != 0) - t2 = TYPE_DOMAIN (t2); + && TYPE_ORIG_SIZE_TYPE (t2)) + t2 = TYPE_ORIG_SIZE_TYPE (t2); + /* Enumerated types are compatible with integer types, but this is not transitive: two enumerated types in the same translation unit are compatible with each other only if they are the same type. */ if (TREE_CODE (t1) == ENUMERAL_TYPE && TREE_CODE (t2) != ENUMERAL_TYPE) - t1 = c_common_type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1)); + t1 = c_common_type_for_size (TYPE_PRECISION (t1), TYPE_UNSIGNED (t1)); else if (TREE_CODE (t2) == ENUMERAL_TYPE && TREE_CODE (t1) != ENUMERAL_TYPE) - t2 = c_common_type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2)); + t2 = c_common_type_for_size (TYPE_PRECISION (t2), TYPE_UNSIGNED (t2)); if (t1 == t2) return 1; @@ -504,7 +823,7 @@ comptypes (tree type1, tree type2, int flags) if (TREE_CODE (t1) != TREE_CODE (t2)) return 0; - /* Qualifiers must match. */ + /* Qualifiers must match. C99 6.7.3p9 */ if (TYPE_QUALS (t1) != TYPE_QUALS (t2)) return 0; @@ -513,11 +832,12 @@ comptypes (tree type1, tree type2, int flags) definition. Note that we already checked for equality of the type qualifiers (just above). */ - if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2)) + if (TREE_CODE (t1) != ARRAY_TYPE + && TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2)) return 1; /* 1 if no need for warning yet, 2 if warning cause has been seen. */ - if (! (attrval = (*targetm.comp_type_attributes) (t1, t2))) + if (!(attrval = targetm.comp_type_attributes (t1, t2))) return 0; /* 1 if no need for warning yet, 2 if warning cause has been seen. */ @@ -526,16 +846,16 @@ comptypes (tree type1, tree type2, int flags) switch (TREE_CODE (t1)) { case POINTER_TYPE: - /* We must give ObjC the first crack at comparing pointers, since - protocol qualifiers may be involved. */ - if (c_dialect_objc () && (val = objc_comptypes (t1, t2, 0)) >= 0) + /* Do not remove mode or aliasing information. */ + if (TYPE_MODE (t1) != TYPE_MODE (t2) + || TYPE_REF_CAN_ALIAS_ALL (t1) != TYPE_REF_CAN_ALIAS_ALL (t2)) break; val = (TREE_TYPE (t1) == TREE_TYPE (t2) - ? 1 : comptypes (TREE_TYPE (t1), TREE_TYPE (t2), flags)); + ? 1 : comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2))); break; case FUNCTION_TYPE: - val = function_types_compatible_p (t1, t2, flags); + val = function_types_compatible_p (t1, t2); break; case ARRAY_TYPE: @@ -548,52 +868,58 @@ comptypes (tree type1, tree type2, int flags) /* Target types must match incl. qualifiers. */ if (TREE_TYPE (t1) != TREE_TYPE (t2) - && 0 == (val = comptypes (TREE_TYPE (t1), TREE_TYPE (t2), - flags))) + && 0 == (val = comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2)))) return 0; /* Sizes must match unless one is missing or variable. */ if (d1 == 0 || d2 == 0 || d1 == d2) break; - d1_zero = ! TYPE_MAX_VALUE (d1); - d2_zero = ! TYPE_MAX_VALUE (d2); + d1_zero = !TYPE_MAX_VALUE (d1); + d2_zero = !TYPE_MAX_VALUE (d2); - d1_variable = (! d1_zero + d1_variable = (!d1_zero && (TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST || TREE_CODE (TYPE_MAX_VALUE (d1)) != INTEGER_CST)); - d2_variable = (! d2_zero + d2_variable = (!d2_zero && (TREE_CODE (TYPE_MIN_VALUE (d2)) != INTEGER_CST || TREE_CODE (TYPE_MAX_VALUE (d2)) != INTEGER_CST)); + d1_variable = d1_variable || (d1_zero && c_vla_type_p (t1)); + d2_variable = d2_variable || (d2_zero && c_vla_type_p (t2)); if (d1_variable || d2_variable) break; if (d1_zero && d2_zero) break; if (d1_zero || d2_zero - || ! tree_int_cst_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2)) - || ! tree_int_cst_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2))) + || !tree_int_cst_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2)) + || !tree_int_cst_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2))) val = 0; - break; + break; } - case RECORD_TYPE: - /* We are dealing with two distinct structs. In assorted Objective-C - corner cases, however, these can still be deemed equivalent. */ - if (c_dialect_objc () && objc_comptypes (t1, t2, 0) == 1) - val = 1; - case ENUMERAL_TYPE: + case RECORD_TYPE: case UNION_TYPE: if (val != 1 && !same_translation_unit_p (t1, t2)) - val = tagged_types_tu_compatible_p (t1, t2, flags); + { + tree a1 = TYPE_ATTRIBUTES (t1); + tree a2 = TYPE_ATTRIBUTES (t2); + + if (! attribute_list_contained (a1, a2) + && ! attribute_list_contained (a2, a1)) + break; + + if (attrval != 2) + return tagged_types_tu_compatible_p (t1, t2); + val = tagged_types_tu_compatible_p (t1, t2); + } break; case VECTOR_TYPE: - /* The target might allow certain vector types to be compatible. */ - val = (*targetm.vector_opaque_p) (t1) - || (*targetm.vector_opaque_p) (t2); + val = TYPE_VECTOR_SUBPARTS (t1) == TYPE_VECTOR_SUBPARTS (t2) + && comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2)); break; default: @@ -603,23 +929,23 @@ comptypes (tree type1, tree type2, int flags) } /* Return 1 if TTL and TTR are pointers to types that are equivalent, - ignoring their qualifiers. REFLEXIVE is only used by ObjC - set it - to 1 or 0 depending if the check of the pointer types is meant to - be reflexive or not (typically, assignments are not reflexive, - while comparisons are reflexive). -*/ + ignoring their qualifiers. */ static int -comp_target_types (tree ttl, tree ttr, int reflexive) +comp_target_types (tree ttl, tree ttr) { int val; + tree mvl, mvr; - /* Give objc_comptypes a crack at letting these types through. */ - if ((val = objc_comptypes (ttl, ttr, reflexive)) >= 0) - return val; - - val = comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (ttl)), - TYPE_MAIN_VARIANT (TREE_TYPE (ttr)), COMPARE_STRICT); + /* Do not lose qualifiers on element types of array types that are + pointer targets by taking their TYPE_MAIN_VARIANT. */ + mvl = TREE_TYPE (ttl); + mvr = TREE_TYPE (ttr); + if (TREE_CODE (mvl) != ARRAY_TYPE) + mvl = TYPE_MAIN_VARIANT (mvl); + if (TREE_CODE (mvr) != ARRAY_TYPE) + mvr = TYPE_MAIN_VARIANT (mvr); + val = comptypes (mvl, mvr); if (val == 2 && pedantic) pedwarn ("types are not quite compatible"); @@ -628,49 +954,82 @@ comp_target_types (tree ttl, tree ttr, int reflexive) /* Subroutines of `comptypes'. */ -/* Determine whether two types derive from the same translation unit. - If the CONTEXT chain ends in a null, that type's context is still - being parsed, so if two types have context chains ending in null, +/* Determine whether two trees derive from the same translation unit. + If the CONTEXT chain ends in a null, that tree's context is still + being parsed, so if two trees have context chains ending in null, they're in the same translation unit. */ -static int +int same_translation_unit_p (tree t1, tree t2) { while (t1 && TREE_CODE (t1) != TRANSLATION_UNIT_DECL) switch (TREE_CODE_CLASS (TREE_CODE (t1))) { - case 'd': t1 = DECL_CONTEXT (t1); break; - case 't': t1 = TYPE_CONTEXT (t1); break; - case 'b': t1 = BLOCK_SUPERCONTEXT (t1); break; - default: abort (); + case tcc_declaration: + t1 = DECL_CONTEXT (t1); break; + case tcc_type: + t1 = TYPE_CONTEXT (t1); break; + case tcc_exceptional: + t1 = BLOCK_SUPERCONTEXT (t1); break; /* assume block */ + default: gcc_unreachable (); } while (t2 && TREE_CODE (t2) != TRANSLATION_UNIT_DECL) switch (TREE_CODE_CLASS (TREE_CODE (t2))) { - case 'd': t2 = DECL_CONTEXT (t2); break; - case 't': t2 = TYPE_CONTEXT (t2); break; - case 'b': t2 = BLOCK_SUPERCONTEXT (t2); break; - default: abort (); + case tcc_declaration: + t2 = DECL_CONTEXT (t2); break; + case tcc_type: + t2 = TYPE_CONTEXT (t2); break; + case tcc_exceptional: + t2 = BLOCK_SUPERCONTEXT (t2); break; /* assume block */ + default: gcc_unreachable (); } return t1 == t2; } -/* The C standard says that two structures in different translation - units are compatible with each other only if the types of their - fields are compatible (among other things). So, consider two copies - of this structure: */ +/* Allocate the seen two types, assuming that they are compatible. */ -struct tagged_tu_seen { - const struct tagged_tu_seen * next; - tree t1; - tree t2; -}; +static struct tagged_tu_seen_cache * +alloc_tagged_tu_seen_cache (tree t1, tree t2) +{ + struct tagged_tu_seen_cache *tu = XNEW (struct tagged_tu_seen_cache); + tu->next = tagged_tu_seen_base; + tu->t1 = t1; + tu->t2 = t2; -/* Can they be compatible with each other? We choose to break the - recursion by allowing those types to be compatible. */ + tagged_tu_seen_base = tu; -static const struct tagged_tu_seen * tagged_tu_seen_base; + /* The C standard says that two structures in different translation + units are compatible with each other only if the types of their + fields are compatible (among other things). We assume that they + are compatible until proven otherwise when building the cache. + An example where this can occur is: + struct a + { + struct a *next; + }; + If we are comparing this against a similar struct in another TU, + and did not assume they were compatible, we end up with an infinite + loop. */ + tu->val = 1; + return tu; +} + +/* Free the seen types until we get to TU_TIL. */ + +static void +free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *tu_til) +{ + const struct tagged_tu_seen_cache *tu = tagged_tu_seen_base; + while (tu != tu_til) + { + struct tagged_tu_seen_cache *tu1 = (struct tagged_tu_seen_cache*)tu; + tu = tu1->next; + free (tu1); + } + tagged_tu_seen_base = tu_til; +} /* Return 1 if two 'struct', 'union', or 'enum' types T1 and T2 are compatible. If the two types are not the same (which has been @@ -679,7 +1038,7 @@ static const struct tagged_tu_seen * tagged_tu_seen_base; rules. */ static int -tagged_types_tu_compatible_p (tree t1, tree t2, int flags) +tagged_types_tu_compatible_p (tree t1, tree t2) { tree s1, s2; bool needs_warning = false; @@ -687,7 +1046,9 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) /* We have to verify that the tags of the types are the same. This is harder than it looks because this may be a typedef, so we have to go look at the original type. It may even be a typedef of a - typedef... */ + typedef... + In the case of compiler-created builtin structs the TYPE_DECL + may be a dummy, with no DECL_ORIGINAL_TYPE. Don't fault. */ while (TYPE_NAME (t1) && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL && DECL_ORIGINAL_TYPE (TYPE_NAME (t1))) @@ -710,52 +1071,123 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) return 1; { - const struct tagged_tu_seen * tts_i; + const struct tagged_tu_seen_cache * tts_i; for (tts_i = tagged_tu_seen_base; tts_i != NULL; tts_i = tts_i->next) if (tts_i->t1 == t1 && tts_i->t2 == t2) - return 1; + return tts_i->val; } switch (TREE_CODE (t1)) { case ENUMERAL_TYPE: { + struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2); + /* Speed up the case where the type values are in the same order. */ + tree tv1 = TYPE_VALUES (t1); + tree tv2 = TYPE_VALUES (t2); + + if (tv1 == tv2) + { + return 1; + } + + for (;tv1 && tv2; tv1 = TREE_CHAIN (tv1), tv2 = TREE_CHAIN (tv2)) + { + if (TREE_PURPOSE (tv1) != TREE_PURPOSE (tv2)) + break; + if (simple_cst_equal (TREE_VALUE (tv1), TREE_VALUE (tv2)) != 1) + { + tu->val = 0; + return 0; + } + } + + if (tv1 == NULL_TREE && tv2 == NULL_TREE) + { + return 1; + } + if (tv1 == NULL_TREE || tv2 == NULL_TREE) + { + tu->val = 0; + return 0; + } + if (list_length (TYPE_VALUES (t1)) != list_length (TYPE_VALUES (t2))) - return 0; + { + tu->val = 0; + return 0; + } for (s1 = TYPE_VALUES (t1); s1; s1 = TREE_CHAIN (s1)) { s2 = purpose_member (TREE_PURPOSE (s1), TYPE_VALUES (t2)); if (s2 == NULL || simple_cst_equal (TREE_VALUE (s1), TREE_VALUE (s2)) != 1) - return 0; + { + tu->val = 0; + return 0; + } } return 1; } case UNION_TYPE: { + struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2); if (list_length (TYPE_FIELDS (t1)) != list_length (TYPE_FIELDS (t2))) - return 0; + { + tu->val = 0; + return 0; + } + + /* Speed up the common case where the fields are in the same order. */ + for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2); s1 && s2; + s1 = TREE_CHAIN (s1), s2 = TREE_CHAIN (s2)) + { + int result; + + + if (DECL_NAME (s1) == NULL + || DECL_NAME (s1) != DECL_NAME (s2)) + break; + result = comptypes_internal (TREE_TYPE (s1), TREE_TYPE (s2)); + if (result == 0) + { + tu->val = 0; + return 0; + } + if (result == 2) + needs_warning = true; + + if (TREE_CODE (s1) == FIELD_DECL + && simple_cst_equal (DECL_FIELD_BIT_OFFSET (s1), + DECL_FIELD_BIT_OFFSET (s2)) != 1) + { + tu->val = 0; + return 0; + } + } + if (!s1 && !s2) + { + tu->val = needs_warning ? 2 : 1; + return tu->val; + } for (s1 = TYPE_FIELDS (t1); s1; s1 = TREE_CHAIN (s1)) { bool ok = false; - struct tagged_tu_seen tts; - - tts.next = tagged_tu_seen_base; - tts.t1 = t1; - tts.t2 = t2; - tagged_tu_seen_base = &tts; if (DECL_NAME (s1) != NULL) - for (s2 = TYPE_VALUES (t2); s2; s2 = TREE_CHAIN (s2)) + for (s2 = TYPE_FIELDS (t2); s2; s2 = TREE_CHAIN (s2)) if (DECL_NAME (s1) == DECL_NAME (s2)) { int result; - result = comptypes (TREE_TYPE (s1), TREE_TYPE (s2), flags); + result = comptypes_internal (TREE_TYPE (s1), TREE_TYPE (s2)); if (result == 0) - break; + { + tu->val = 0; + return 0; + } if (result == 2) needs_warning = true; @@ -767,21 +1199,19 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) ok = true; break; } - tagged_tu_seen_base = tts.next; - if (! ok) - return 0; + if (!ok) + { + tu->val = 0; + return 0; + } } - return needs_warning ? 2 : 1; + tu->val = needs_warning ? 2 : 10; + return tu->val; } case RECORD_TYPE: { - struct tagged_tu_seen tts; - - tts.next = tagged_tu_seen_base; - tts.t1 = t1; - tts.t2 = t2; - tagged_tu_seen_base = &tts; + struct tagged_tu_seen_cache *tu = alloc_tagged_tu_seen_cache (t1, t2); for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2); s1 && s2; @@ -791,7 +1221,7 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) if (TREE_CODE (s1) != TREE_CODE (s2) || DECL_NAME (s1) != DECL_NAME (s2)) break; - result = comptypes (TREE_TYPE (s1), TREE_TYPE (s2), flags); + result = comptypes_internal (TREE_TYPE (s1), TREE_TYPE (s2)); if (result == 0) break; if (result == 2) @@ -802,14 +1232,15 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) DECL_FIELD_BIT_OFFSET (s2)) != 1) break; } - tagged_tu_seen_base = tts.next; if (s1 && s2) - return 0; - return needs_warning ? 2 : 1; + tu->val = 0; + else + tu->val = needs_warning ? 2 : 1; + return tu->val; } default: - abort (); + gcc_unreachable (); } } @@ -821,7 +1252,7 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags) Otherwise, the argument types must match. */ static int -function_types_compatible_p (tree f1, tree f2, int flags) +function_types_compatible_p (tree f1, tree f2) { tree args1, args2; /* 1 if no need for warning yet, 2 if warning cause has been seen. */ @@ -832,17 +1263,17 @@ function_types_compatible_p (tree f1, tree f2, int flags) ret1 = TREE_TYPE (f1); ret2 = TREE_TYPE (f2); - /* 'volatile' qualifiers on a function's return type mean the function - is noreturn. */ - if (pedantic && TYPE_VOLATILE (ret1) != TYPE_VOLATILE (ret2)) - pedwarn ("function return types not compatible due to `volatile'"); + /* 'volatile' qualifiers on a function's return type used to mean + the function is noreturn. */ + if (TYPE_VOLATILE (ret1) != TYPE_VOLATILE (ret2)) + pedwarn ("function return types not compatible due to %"); if (TYPE_VOLATILE (ret1)) ret1 = build_qualified_type (TYPE_MAIN_VARIANT (ret1), TYPE_QUALS (ret1) & ~TYPE_QUAL_VOLATILE); if (TYPE_VOLATILE (ret2)) ret2 = build_qualified_type (TYPE_MAIN_VARIANT (ret2), TYPE_QUALS (ret2) & ~TYPE_QUAL_VOLATILE); - val = comptypes (ret1, ret2, flags); + val = comptypes_internal (ret1, ret2); if (val == 0) return 0; @@ -860,8 +1291,7 @@ function_types_compatible_p (tree f1, tree f2, int flags) compare that with the other type's arglist. If they don't match, ask for a warning (but no error). */ if (TYPE_ACTUAL_ARG_TYPES (f1) - && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1), - flags)) + && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1))) val = 2; return val; } @@ -870,14 +1300,13 @@ function_types_compatible_p (tree f1, tree f2, int flags) if (!self_promoting_args_p (args1)) return 0; if (TYPE_ACTUAL_ARG_TYPES (f2) - && 1 != type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2), - flags)) + && 1 != type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2))) val = 2; return val; } /* Both types have argument lists: compare them and propagate results. */ - val1 = type_lists_compatible_p (args1, args2, flags); + val1 = type_lists_compatible_p (args1, args2); return val1 != 1 ? val1 : val; } @@ -886,7 +1315,7 @@ function_types_compatible_p (tree f1, tree f2, int flags) or 2 for compatible with warning. */ static int -type_lists_compatible_p (tree args1, tree args2, int flags) +type_lists_compatible_p (tree args1, tree args2) { /* 1 if no need for warning yet, 2 if warning cause has been seen. */ int val = 1; @@ -894,65 +1323,80 @@ type_lists_compatible_p (tree args1, tree args2, int flags) while (1) { + tree a1, mv1, a2, mv2; if (args1 == 0 && args2 == 0) return val; /* If one list is shorter than the other, they fail to match. */ if (args1 == 0 || args2 == 0) return 0; + mv1 = a1 = TREE_VALUE (args1); + mv2 = a2 = TREE_VALUE (args2); + if (mv1 && mv1 != error_mark_node && TREE_CODE (mv1) != ARRAY_TYPE) + mv1 = TYPE_MAIN_VARIANT (mv1); + if (mv2 && mv2 != error_mark_node && TREE_CODE (mv2) != ARRAY_TYPE) + mv2 = TYPE_MAIN_VARIANT (mv2); /* A null pointer instead of a type means there is supposed to be an argument but nothing is specified about what type it has. So match anything that self-promotes. */ - if (TREE_VALUE (args1) == 0) + if (a1 == 0) { - if (c_type_promotes_to (TREE_VALUE (args2)) != TREE_VALUE (args2)) + if (c_type_promotes_to (a2) != a2) return 0; } - else if (TREE_VALUE (args2) == 0) + else if (a2 == 0) { - if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1)) + if (c_type_promotes_to (a1) != a1) return 0; } /* If one of the lists has an error marker, ignore this arg. */ - else if (TREE_CODE (TREE_VALUE (args1)) == ERROR_MARK - || TREE_CODE (TREE_VALUE (args2)) == ERROR_MARK) + else if (TREE_CODE (a1) == ERROR_MARK + || TREE_CODE (a2) == ERROR_MARK) ; - else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)), - TYPE_MAIN_VARIANT (TREE_VALUE (args2)), - flags))) + else if (!(newval = comptypes_internal (mv1, mv2))) { /* Allow wait (union {union wait *u; int *i} *) and wait (union wait *) to be compatible. */ - if (TREE_CODE (TREE_VALUE (args1)) == UNION_TYPE - && (TYPE_NAME (TREE_VALUE (args1)) == 0 - || TYPE_TRANSPARENT_UNION (TREE_VALUE (args1))) - && TREE_CODE (TYPE_SIZE (TREE_VALUE (args1))) == INTEGER_CST - && tree_int_cst_equal (TYPE_SIZE (TREE_VALUE (args1)), - TYPE_SIZE (TREE_VALUE (args2)))) + if (TREE_CODE (a1) == UNION_TYPE + && (TYPE_NAME (a1) == 0 + || TYPE_TRANSPARENT_UNION (a1)) + && TREE_CODE (TYPE_SIZE (a1)) == INTEGER_CST + && tree_int_cst_equal (TYPE_SIZE (a1), + TYPE_SIZE (a2))) { tree memb; - for (memb = TYPE_FIELDS (TREE_VALUE (args1)); + for (memb = TYPE_FIELDS (a1); memb; memb = TREE_CHAIN (memb)) - if (comptypes (TREE_TYPE (memb), TREE_VALUE (args2), - flags)) - break; + { + tree mv3 = TREE_TYPE (memb); + if (mv3 && mv3 != error_mark_node + && TREE_CODE (mv3) != ARRAY_TYPE) + mv3 = TYPE_MAIN_VARIANT (mv3); + if (comptypes_internal (mv3, mv2)) + break; + } if (memb == 0) return 0; } - else if (TREE_CODE (TREE_VALUE (args2)) == UNION_TYPE - && (TYPE_NAME (TREE_VALUE (args2)) == 0 - || TYPE_TRANSPARENT_UNION (TREE_VALUE (args2))) - && TREE_CODE (TYPE_SIZE (TREE_VALUE (args2))) == INTEGER_CST - && tree_int_cst_equal (TYPE_SIZE (TREE_VALUE (args2)), - TYPE_SIZE (TREE_VALUE (args1)))) + else if (TREE_CODE (a2) == UNION_TYPE + && (TYPE_NAME (a2) == 0 + || TYPE_TRANSPARENT_UNION (a2)) + && TREE_CODE (TYPE_SIZE (a2)) == INTEGER_CST + && tree_int_cst_equal (TYPE_SIZE (a2), + TYPE_SIZE (a1))) { tree memb; - for (memb = TYPE_FIELDS (TREE_VALUE (args2)); + for (memb = TYPE_FIELDS (a2); memb; memb = TREE_CHAIN (memb)) - if (comptypes (TREE_TYPE (memb), TREE_VALUE (args1), - flags)) - break; + { + tree mv3 = TREE_TYPE (memb); + if (mv3 && mv3 != error_mark_node + && TREE_CODE (mv3) != ARRAY_TYPE) + mv3 = TYPE_MAIN_VARIANT (mv3); + if (comptypes_internal (mv3, mv1)) + break; + } if (memb == 0) return 0; } @@ -971,7 +1415,7 @@ type_lists_compatible_p (tree args1, tree args2, int flags) /* Compute the size to increment a pointer by. */ -tree +static tree c_size_in_bytes (tree type) { enum tree_code code = TREE_CODE (type); @@ -997,9 +1441,11 @@ tree decl_constant_value (tree decl) { if (/* Don't change a variable array bound or initial value to a constant - in a place where a variable is invalid. */ + in a place where a variable is invalid. Note that DECL_INITIAL + isn't valid for a PARM_DECL. */ current_function_decl != 0 - && ! TREE_THIS_VOLATILE (decl) + && TREE_CODE (decl) != PARM_DECL + && !TREE_THIS_VOLATILE (decl) && TREE_READONLY (decl) && DECL_INITIAL (decl) != 0 && TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK @@ -1024,117 +1470,185 @@ decl_constant_value (tree decl) static tree decl_constant_value_for_broken_optimization (tree decl) { + tree ret; + if (pedantic || DECL_MODE (decl) == BLKmode) return decl; - else - return decl_constant_value (decl); + + ret = decl_constant_value (decl); + /* Avoid unwanted tree sharing between the initializer and current + function's body where the tree can be modified e.g. by the + gimplifier. */ + if (ret != decl && TREE_STATIC (decl)) + ret = unshare_expr (ret); + return ret; } +/* Convert the array expression EXP to a pointer. */ +static tree +array_to_pointer_conversion (tree exp) +{ + tree orig_exp = exp; + tree type = TREE_TYPE (exp); + tree adr; + tree restype = TREE_TYPE (type); + tree ptrtype; + + gcc_assert (TREE_CODE (type) == ARRAY_TYPE); + + STRIP_TYPE_NOPS (exp); + + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp) = 1; + + ptrtype = build_pointer_type (restype); + + if (TREE_CODE (exp) == INDIRECT_REF) + return convert (ptrtype, TREE_OPERAND (exp, 0)); + + if (TREE_CODE (exp) == VAR_DECL) + { + /* We are making an ADDR_EXPR of ptrtype. This is a valid + ADDR_EXPR because it's the best way of representing what + happens in C when we take the address of an array and place + it in a pointer to the element type. */ + adr = build1 (ADDR_EXPR, ptrtype, exp); + if (!c_mark_addressable (exp)) + return error_mark_node; + TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */ + return adr; + } + + /* This way is better for a COMPONENT_REF since it can + simplify the offset for a component. */ + adr = build_unary_op (ADDR_EXPR, exp, 1); + return convert (ptrtype, adr); +} + +/* Convert the function expression EXP to a pointer. */ +static tree +function_to_pointer_conversion (tree exp) +{ + tree orig_exp = exp; + + gcc_assert (TREE_CODE (TREE_TYPE (exp)) == FUNCTION_TYPE); + + STRIP_TYPE_NOPS (exp); + + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp) = 1; + + return build_unary_op (ADDR_EXPR, exp, 0); +} /* Perform the default conversion of arrays and functions to pointers. Return the result of converting EXP. For any other expression, just - return EXP. */ + return EXP after removing NOPs. */ -static tree -default_function_array_conversion (tree exp) +struct c_expr +default_function_array_conversion (struct c_expr exp) { - tree orig_exp; - tree type = TREE_TYPE (exp); + tree orig_exp = exp.value; + tree type = TREE_TYPE (exp.value); enum tree_code code = TREE_CODE (type); - int not_lvalue = 0; - /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as - an lvalue. - - Do not use STRIP_NOPS here! It will remove conversions from pointer - to integer and cause infinite recursion. */ - orig_exp = exp; - while (TREE_CODE (exp) == NON_LVALUE_EXPR - || (TREE_CODE (exp) == NOP_EXPR - && TREE_TYPE (TREE_OPERAND (exp, 0)) == TREE_TYPE (exp))) + switch (code) { - if (TREE_CODE (exp) == NON_LVALUE_EXPR) - not_lvalue = 1; - exp = TREE_OPERAND (exp, 0); + case ARRAY_TYPE: + { + bool not_lvalue = false; + bool lvalue_array_p; + + while ((TREE_CODE (exp.value) == NON_LVALUE_EXPR + || TREE_CODE (exp.value) == NOP_EXPR + || TREE_CODE (exp.value) == CONVERT_EXPR) + && TREE_TYPE (TREE_OPERAND (exp.value, 0)) == type) + { + if (TREE_CODE (exp.value) == NON_LVALUE_EXPR) + not_lvalue = true; + exp.value = TREE_OPERAND (exp.value, 0); + } + + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp.value) = 1; + + lvalue_array_p = !not_lvalue && lvalue_p (exp.value); + if (!flag_isoc99 && !lvalue_array_p) + { + /* Before C99, non-lvalue arrays do not decay to pointers. + Normally, using such an array would be invalid; but it can + be used correctly inside sizeof or as a statement expression. + Thus, do not give an error here; an error will result later. */ + return exp; + } + + exp.value = array_to_pointer_conversion (exp.value); + } + break; + case FUNCTION_TYPE: + exp.value = function_to_pointer_conversion (exp.value); + break; + default: + STRIP_TYPE_NOPS (exp.value); + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp.value) = 1; + break; } - /* Preserve the original expression code. */ - if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (exp)))) - C_SET_EXP_ORIGINAL_CODE (exp, C_EXP_ORIGINAL_CODE (orig_exp)); - - if (code == FUNCTION_TYPE) - { - return build_unary_op (ADDR_EXPR, exp, 0); - } - if (code == ARRAY_TYPE) - { - tree adr; - tree restype = TREE_TYPE (type); - tree ptrtype; - int constp = 0; - int volatilep = 0; - int lvalue_array_p; - - if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'r' || DECL_P (exp)) - { - constp = TREE_READONLY (exp); - volatilep = TREE_THIS_VOLATILE (exp); - } - - if (TYPE_QUALS (type) || constp || volatilep) - restype - = c_build_qualified_type (restype, - TYPE_QUALS (type) - | (constp * TYPE_QUAL_CONST) - | (volatilep * TYPE_QUAL_VOLATILE)); - - if (TREE_CODE (exp) == INDIRECT_REF) - return convert (TYPE_POINTER_TO (restype), - TREE_OPERAND (exp, 0)); - - if (TREE_CODE (exp) == COMPOUND_EXPR) - { - tree op1 = default_conversion (TREE_OPERAND (exp, 1)); - return build (COMPOUND_EXPR, TREE_TYPE (op1), - TREE_OPERAND (exp, 0), op1); - } - - lvalue_array_p = !not_lvalue && lvalue_p (exp); - if (!flag_isoc99 && !lvalue_array_p) - { - /* Before C99, non-lvalue arrays do not decay to pointers. - Normally, using such an array would be invalid; but it can - be used correctly inside sizeof or as a statement expression. - Thus, do not give an error here; an error will result later. */ - return exp; - } - - ptrtype = build_pointer_type (restype); - - if (TREE_CODE (exp) == VAR_DECL) - { - /* ??? This is not really quite correct - in that the type of the operand of ADDR_EXPR - is not the target type of the type of the ADDR_EXPR itself. - Question is, can this lossage be avoided? */ - adr = build1 (ADDR_EXPR, ptrtype, exp); - if (!c_mark_addressable (exp)) - return error_mark_node; - TREE_CONSTANT (adr) = staticp (exp); - TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */ - return adr; - } - /* This way is better for a COMPONENT_REF since it can - simplify the offset for a component. */ - adr = build_unary_op (ADDR_EXPR, exp, 1); - return convert (ptrtype, adr); - } return exp; } + +/* EXP is an expression of integer type. Apply the integer promotions + to it and return the promoted value. */ + +tree +perform_integral_promotions (tree exp) +{ + tree type = TREE_TYPE (exp); + enum tree_code code = TREE_CODE (type); + + gcc_assert (INTEGRAL_TYPE_P (type)); + + /* Normally convert enums to int, + but convert wide enums to something wider. */ + if (code == ENUMERAL_TYPE) + { + type = c_common_type_for_size (MAX (TYPE_PRECISION (type), + TYPE_PRECISION (integer_type_node)), + ((TYPE_PRECISION (type) + >= TYPE_PRECISION (integer_type_node)) + && TYPE_UNSIGNED (type))); + + return convert (type, exp); + } + + /* ??? This should no longer be needed now bit-fields have their + proper types. */ + if (TREE_CODE (exp) == COMPONENT_REF + && DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1)) + /* If it's thinner than an int, promote it like a + c_promoting_integer_type_p, otherwise leave it alone. */ + && 0 > compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)), + TYPE_PRECISION (integer_type_node))) + return convert (integer_type_node, exp); + + if (c_promoting_integer_type_p (type)) + { + /* Preserve unsignedness if not really getting any wider. */ + if (TYPE_UNSIGNED (type) + && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)) + return convert (unsigned_type_node, exp); + + return convert (integer_type_node, exp); + } + + return exp; +} + + /* Perform default promotions for C data used in expressions. - Arrays and functions are converted to pointers; - enumeral types or short or char, to int. + Enumeral types or short or char are converted to int. In addition, manifest constants symbols are replaced by their values. */ tree @@ -1144,8 +1658,10 @@ default_conversion (tree exp) tree type = TREE_TYPE (exp); enum tree_code code = TREE_CODE (type); - if (code == FUNCTION_TYPE || code == ARRAY_TYPE) - return default_function_array_conversion (exp); + /* Functions and arrays have been converted during parsing. */ + gcc_assert (code != FUNCTION_TYPE); + if (code == ARRAY_TYPE) + return exp; /* Constants can be used directly unless they're not loadable. */ if (TREE_CODE (exp) == CONST_DECL) @@ -1160,51 +1676,15 @@ default_conversion (tree exp) type = TREE_TYPE (exp); } - /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as - an lvalue. - - Do not use STRIP_NOPS here! It will remove conversions from pointer - to integer and cause infinite recursion. */ + /* Strip no-op conversions. */ orig_exp = exp; - while (TREE_CODE (exp) == NON_LVALUE_EXPR - || (TREE_CODE (exp) == NOP_EXPR - && TREE_TYPE (TREE_OPERAND (exp, 0)) == TREE_TYPE (exp))) - exp = TREE_OPERAND (exp, 0); + STRIP_TYPE_NOPS (exp); - /* Preserve the original expression code. */ - if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (exp)))) - C_SET_EXP_ORIGINAL_CODE (exp, C_EXP_ORIGINAL_CODE (orig_exp)); + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp) = 1; - /* Normally convert enums to int, - but convert wide enums to something wider. */ - if (code == ENUMERAL_TYPE) - { - type = c_common_type_for_size (MAX (TYPE_PRECISION (type), - TYPE_PRECISION (integer_type_node)), - ((TYPE_PRECISION (type) - >= TYPE_PRECISION (integer_type_node)) - && TREE_UNSIGNED (type))); - - return convert (type, exp); - } - - if (TREE_CODE (exp) == COMPONENT_REF - && DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1)) - /* If it's thinner than an int, promote it like a - c_promoting_integer_type_p, otherwise leave it alone. */ - && 0 > compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)), - TYPE_PRECISION (integer_type_node))) - return convert (integer_type_node, exp); - - if (c_promoting_integer_type_p (type)) - { - /* Preserve unsignedness if not really getting any wider. */ - if (TREE_UNSIGNED (type) - && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)) - return convert (unsigned_type_node, exp); - - return convert (integer_type_node, exp); - } + if (INTEGRAL_TYPE_P (type)) + return perform_integral_promotions (exp); if (code == VOID_TYPE) { @@ -1234,7 +1714,7 @@ lookup_field (tree decl, tree component) find the element. Otherwise, do a linear search. TYPE_LANG_SPECIFIC will always be set for structures which have many elements. */ - if (TYPE_LANG_SPECIFIC (type)) + if (TYPE_LANG_SPECIFIC (type) && TYPE_LANG_SPECIFIC (type)->s) { int bot, top, half; tree *field_array = &TYPE_LANG_SPECIFIC (type)->s->elts[0]; @@ -1320,6 +1800,9 @@ build_component_ref (tree datum, tree component) tree field = NULL; tree ref; + if (!objc_is_public (datum, component)) + return error_mark_node; + /* See if there is a field or component with name COMPONENT. */ if (code == RECORD_TYPE || code == UNION_TYPE) @@ -1334,9 +1817,7 @@ build_component_ref (tree datum, tree component) if (!field) { - error ("%s has no member named `%s'", - code == RECORD_TYPE ? "structure" : "union", - IDENTIFIER_POINTER (component)); + error ("%qT has no member named %qE", type, component); return error_mark_node; } @@ -1348,11 +1829,18 @@ build_component_ref (tree datum, tree component) do { tree subdatum = TREE_VALUE (field); + int quals; + tree subtype; if (TREE_TYPE (subdatum) == error_mark_node) return error_mark_node; - ref = build (COMPONENT_REF, TREE_TYPE (subdatum), datum, subdatum); + quals = TYPE_QUALS (strip_array_types (TREE_TYPE (subdatum))); + quals |= TYPE_QUALS (TREE_TYPE (datum)); + subtype = c_build_qualified_type (TREE_TYPE (subdatum), quals); + + ref = build3 (COMPONENT_REF, subtype, datum, subdatum, + NULL_TREE); if (TREE_READONLY (datum) || TREE_READONLY (subdatum)) TREE_READONLY (ref) = 1; if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (subdatum)) @@ -1370,8 +1858,8 @@ build_component_ref (tree datum, tree component) return ref; } else if (code != ERROR_MARK) - error ("request for member `%s' in something not a structure or union", - IDENTIFIER_POINTER (component)); + error ("request for member %qE in something not a structure or union", + component); return error_mark_node; } @@ -1395,7 +1883,9 @@ build_indirect_ref (tree ptr, const char *errorstring) else { tree t = TREE_TYPE (type); - tree ref = build1 (INDIRECT_REF, TYPE_MAIN_VARIANT (t), pointer); + tree ref; + + ref = build1 (INDIRECT_REF, t, pointer); if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE) { @@ -1403,7 +1893,7 @@ build_indirect_ref (tree ptr, const char *errorstring) return error_mark_node; } if (VOID_TYPE_P (t) && skip_evaluation == 0) - warning ("dereferencing `void *' pointer"); + warning (0, "dereferencing % pointer"); /* We *must* set TREE_READONLY when dereferencing a pointer to const, so that we get the proper error message if the result is used @@ -1420,7 +1910,7 @@ build_indirect_ref (tree ptr, const char *errorstring) } } else if (TREE_CODE (pointer) != ERROR_MARK) - error ("invalid type argument of `%s'", errorstring); + error ("invalid type argument of %qs", errorstring); return error_mark_node; } @@ -1436,40 +1926,52 @@ build_indirect_ref (tree ptr, const char *errorstring) tree build_array_ref (tree array, tree index) { - if (index == 0) - { - error ("subscript missing in array reference"); - return error_mark_node; - } - + bool swapped = false; if (TREE_TYPE (array) == error_mark_node || TREE_TYPE (index) == error_mark_node) return error_mark_node; - if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE - && TREE_CODE (array) != INDIRECT_REF) + if (TREE_CODE (TREE_TYPE (array)) != ARRAY_TYPE + && TREE_CODE (TREE_TYPE (array)) != POINTER_TYPE) { - tree rval, type; - - /* Subscripting with type char is likely to lose - on a machine where chars are signed. - So warn on any machine, but optionally. - Don't warn for unsigned char since that type is safe. - Don't warn for signed char because anyone who uses that - must have done so deliberately. */ - if (warn_char_subscripts - && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node) - warning ("array subscript has type `char'"); - - /* Apply default promotions *after* noticing character types. */ - index = default_conversion (index); - - /* Require integer *after* promotion, for sake of enums. */ - if (TREE_CODE (TREE_TYPE (index)) != INTEGER_TYPE) + tree temp; + if (TREE_CODE (TREE_TYPE (index)) != ARRAY_TYPE + && TREE_CODE (TREE_TYPE (index)) != POINTER_TYPE) { - error ("array subscript is not an integer"); + error ("subscripted value is neither array nor pointer"); return error_mark_node; } + temp = array; + array = index; + index = temp; + swapped = true; + } + + if (!INTEGRAL_TYPE_P (TREE_TYPE (index))) + { + error ("array subscript is not an integer"); + return error_mark_node; + } + + if (TREE_CODE (TREE_TYPE (TREE_TYPE (array))) == FUNCTION_TYPE) + { + error ("subscripted value is pointer to function"); + return error_mark_node; + } + + /* ??? Existing practice has been to warn only when the char + index is syntactically the index, not for char[array]. */ + if (!swapped) + warn_array_subscript_with_type_char (index); + + /* Apply default promotions *after* noticing character types. */ + index = default_conversion (index); + + gcc_assert (TREE_CODE (TREE_TYPE (index)) == INTEGER_TYPE); + + if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE) + { + tree rval, type; /* An array that is indexed by a non-constant cannot be stored in a register; we must be able to do @@ -1487,8 +1989,8 @@ build_array_ref (tree array, tree index) would get a crash in store_bit_field/extract_bit_field when trying to access a non-existent part of the register. */ if (TREE_CODE (index) == INTEGER_CST - && TYPE_VALUES (TREE_TYPE (array)) - && ! int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array)))) + && TYPE_DOMAIN (TREE_TYPE (array)) + && !int_fits_type_p (index, TYPE_DOMAIN (TREE_TYPE (array)))) { if (!c_mark_addressable (array)) return error_mark_node; @@ -1499,16 +2001,18 @@ build_array_ref (tree array, tree index) tree foo = array; while (TREE_CODE (foo) == COMPONENT_REF) foo = TREE_OPERAND (foo, 0); - if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo)) - pedwarn ("ISO C forbids subscripting `register' array"); - else if (! flag_isoc99 && ! lvalue_p (foo)) + if (TREE_CODE (foo) == VAR_DECL && C_DECL_REGISTER (foo)) + pedwarn ("ISO C forbids subscripting % array"); + else if (!flag_isoc99 && !lvalue_p (foo)) pedwarn ("ISO C90 forbids subscripting non-lvalue array"); } - type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array))); - rval = build (ARRAY_REF, type, array, index); + type = TREE_TYPE (TREE_TYPE (array)); + if (TREE_CODE (type) != ARRAY_TYPE) + type = TYPE_MAIN_VARIANT (type); + rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE); /* Array ref is const/volatile if the array elements are - or if the array is. */ + or if the array is. */ TREE_READONLY (rval) |= (TYPE_READONLY (TREE_TYPE (TREE_TYPE (array))) | TREE_READONLY (array)); @@ -1524,72 +2028,36 @@ build_array_ref (tree array, tree index) | TREE_THIS_VOLATILE (array)); return require_complete_type (fold (rval)); } + else + { + tree ar = default_conversion (array); - { - tree ar = default_conversion (array); - tree ind = default_conversion (index); + if (ar == error_mark_node) + return ar; - /* Do the same warning check as above, but only on the part that's - syntactically the index and only if it is also semantically - the index. */ - if (warn_char_subscripts - && TREE_CODE (TREE_TYPE (index)) == INTEGER_TYPE - && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node) - warning ("subscript has type `char'"); + gcc_assert (TREE_CODE (TREE_TYPE (ar)) == POINTER_TYPE); + gcc_assert (TREE_CODE (TREE_TYPE (TREE_TYPE (ar))) != FUNCTION_TYPE); - /* Put the integer in IND to simplify error checking. */ - if (TREE_CODE (TREE_TYPE (ar)) == INTEGER_TYPE) - { - tree temp = ar; - ar = ind; - ind = temp; - } - - if (ar == error_mark_node) - return ar; - - if (TREE_CODE (TREE_TYPE (ar)) != POINTER_TYPE - || TREE_CODE (TREE_TYPE (TREE_TYPE (ar))) == FUNCTION_TYPE) - { - error ("subscripted value is neither array nor pointer"); - return error_mark_node; - } - if (TREE_CODE (TREE_TYPE (ind)) != INTEGER_TYPE) - { - error ("array subscript is not an integer"); - return error_mark_node; - } - - return build_indirect_ref (build_binary_op (PLUS_EXPR, ar, ind, 0), - "array indexing"); - } + return build_indirect_ref (build_binary_op (PLUS_EXPR, ar, index, 0), + "array indexing"); + } } /* Build an external reference to identifier ID. FUN indicates - whether this will be used for a function call. */ + whether this will be used for a function call. LOC is the source + location of the identifier. */ tree -build_external_ref (tree id, int fun) +build_external_ref (tree id, int fun, location_t loc) { tree ref; tree decl = lookup_name (id); - tree objc_ivar = lookup_objc_ivar (id); + + /* In Objective-C, an instance variable (ivar) may be preferred to + whatever lookup_name() found. */ + decl = objc_lookup_ivar (decl, id); if (decl && decl != error_mark_node) - { - /* Properly declared variable or function reference. */ - if (!objc_ivar) - ref = decl; - else if (decl != objc_ivar && !DECL_FILE_SCOPE_P (decl)) - { - warning ("local declaration of `%s' hides instance variable", - IDENTIFIER_POINTER (id)); - ref = decl; - } - else - ref = objc_ivar; - } - else if (objc_ivar) - ref = objc_ivar; + ref = decl; else if (fun) /* Implicit function declaration. */ ref = implicitly_declare (id); @@ -1599,7 +2067,7 @@ build_external_ref (tree id, int fun) return error_mark_node; else { - undeclared_variable (id); + undeclared_variable (id, loc); return error_mark_node; } @@ -1613,10 +2081,22 @@ build_external_ref (tree id, int fun) assemble_external (ref); TREE_USED (ref) = 1; + if (TREE_CODE (ref) == FUNCTION_DECL && !in_alignof) + { + if (!in_sizeof && !in_typeof) + C_DECL_USED (ref) = 1; + else if (DECL_INITIAL (ref) == 0 + && DECL_EXTERNAL (ref) + && !TREE_PUBLIC (ref)) + record_maybe_used_decl (ref); + } + if (TREE_CODE (ref) == CONST_DECL) { + used_types_insert (TREE_TYPE (ref)); ref = DECL_INITIAL (ref); TREE_CONSTANT (ref) = 1; + TREE_INVARIANT (ref) = 1; } else if (current_function_decl != 0 && !DECL_FILE_SCOPE_P (current_function_decl) @@ -1633,6 +2113,101 @@ build_external_ref (tree id, int fun) return ref; } +/* Record details of decls possibly used inside sizeof or typeof. */ +struct maybe_used_decl +{ + /* The decl. */ + tree decl; + /* The level seen at (in_sizeof + in_typeof). */ + int level; + /* The next one at this level or above, or NULL. */ + struct maybe_used_decl *next; +}; + +static struct maybe_used_decl *maybe_used_decls; + +/* Record that DECL, an undefined static function reference seen + inside sizeof or typeof, might be used if the operand of sizeof is + a VLA type or the operand of typeof is a variably modified + type. */ + +static void +record_maybe_used_decl (tree decl) +{ + struct maybe_used_decl *t = XOBNEW (&parser_obstack, struct maybe_used_decl); + t->decl = decl; + t->level = in_sizeof + in_typeof; + t->next = maybe_used_decls; + maybe_used_decls = t; +} + +/* Pop the stack of decls possibly used inside sizeof or typeof. If + USED is false, just discard them. If it is true, mark them used + (if no longer inside sizeof or typeof) or move them to the next + level up (if still inside sizeof or typeof). */ + +void +pop_maybe_used (bool used) +{ + struct maybe_used_decl *p = maybe_used_decls; + int cur_level = in_sizeof + in_typeof; + while (p && p->level > cur_level) + { + if (used) + { + if (cur_level == 0) + C_DECL_USED (p->decl) = 1; + else + p->level = cur_level; + } + p = p->next; + } + if (!used || cur_level == 0) + maybe_used_decls = p; +} + +/* Return the result of sizeof applied to EXPR. */ + +struct c_expr +c_expr_sizeof_expr (struct c_expr expr) +{ + struct c_expr ret; + if (expr.value == error_mark_node) + { + ret.value = error_mark_node; + ret.original_code = ERROR_MARK; + pop_maybe_used (false); + } + else + { + ret.value = c_sizeof (TREE_TYPE (expr.value)); + ret.original_code = ERROR_MARK; + if (c_vla_type_p (TREE_TYPE (expr.value))) + { + /* sizeof is evaluated when given a vla (C99 6.5.3.4p2). */ + ret.value = build2 (COMPOUND_EXPR, TREE_TYPE (ret.value), expr.value, ret.value); + } + pop_maybe_used (C_TYPE_VARIABLE_SIZE (TREE_TYPE (expr.value))); + } + return ret; +} + +/* Return the result of sizeof applied to T, a structure for the type + name passed to sizeof (rather than the type itself). */ + +struct c_expr +c_expr_sizeof_type (struct c_type_name *t) +{ + tree type; + struct c_expr ret; + type = groktypename (t); + ret.value = c_sizeof (type); + ret.original_code = ERROR_MARK; + pop_maybe_used (type != error_mark_node + ? C_TYPE_VARIABLE_SIZE (type) : false); + return ret; +} + /* Build a function call to function FUNCTION with parameters PARAMS. PARAMS is a list--a chain of TREE_LIST nodes--in which the TREE_VALUE of each node is a parameter-expression. @@ -1652,19 +2227,23 @@ build_function_call (tree function, tree params) /* Convert anything with function type to a pointer-to-function. */ if (TREE_CODE (function) == FUNCTION_DECL) { - name = DECL_NAME (function); + /* Implement type-directed function overloading for builtins. + resolve_overloaded_builtin and targetm.resolve_overloaded_builtin + handle all the type checking. The result is a complete expression + that implements this function call. */ + tem = resolve_overloaded_builtin (function, params); + if (tem) + return tem; - /* Differs from default_conversion by not setting TREE_ADDRESSABLE - (because calling an inline function does not mean the function - needs to be separately compiled). */ - fntype = build_type_variant (TREE_TYPE (function), - TREE_READONLY (function), - TREE_THIS_VOLATILE (function)); + name = DECL_NAME (function); fundecl = function; - function = build1 (ADDR_EXPR, build_pointer_type (fntype), function); } - else - function = default_conversion (function); + if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE) + function = function_to_pointer_conversion (function); + + /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF + expressions, like those used for ObjC messenger dispatches. */ + function = objc_rewrite_function_call (function, params); fntype = TREE_TYPE (function); @@ -1674,7 +2253,7 @@ build_function_call (tree function, tree params) if (!(TREE_CODE (fntype) == POINTER_TYPE && TREE_CODE (TREE_TYPE (fntype)) == FUNCTION_TYPE)) { - error ("called object is not a function"); + error ("called object %qE is not a function", function); return error_mark_node; } @@ -1688,16 +2267,12 @@ build_function_call (tree function, tree params) If it is not, replace the call by a trap, wrapped up in a compound expression if necessary. This has the nice side-effect to prevent the tree-inliner from generating invalid assignment trees which may - blow up in the RTL expander later. - - ??? This doesn't work for Objective-C because objc_comptypes - refuses to compare function prototypes, yet the compiler appears - to build calls that are flagged as invalid by C's comptypes. */ - if (! c_dialect_objc () - && TREE_CODE (function) == NOP_EXPR + blow up in the RTL expander later. */ + if ((TREE_CODE (function) == NOP_EXPR + || TREE_CODE (function) == CONVERT_EXPR) && TREE_CODE (tem = TREE_OPERAND (function, 0)) == ADDR_EXPR && TREE_CODE (tem = TREE_OPERAND (tem, 0)) == FUNCTION_DECL - && ! comptypes (fntype, TREE_TYPE (tem), COMPARE_STRICT)) + && !comptypes (fntype, TREE_TYPE (tem))) { tree return_type = TREE_TYPE (fntype); tree trap = build_function_call (built_in_decls[BUILT_IN_TRAP], @@ -1706,7 +2281,7 @@ build_function_call (tree function, tree params) /* This situation leads to run-time undefined behavior. We can't, therefore, simply error unless we can prove that all possible executions of the program must execute the code. */ - warning ("function called through a non-compatible type"); + warning (0, "function called through a non-compatible type"); /* We can, however, treat "undefined" any way we please. Call abort to encourage the user to fix the program. */ @@ -1720,12 +2295,11 @@ build_function_call (tree function, tree params) if (AGGREGATE_TYPE_P (return_type)) rhs = build_compound_literal (return_type, - build_constructor (return_type, - NULL_TREE)); + build_constructor (return_type, 0)); else - rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node)); + rhs = fold_convert (return_type, integer_zero_node); - return build (COMPOUND_EXPR, return_type, trap, rhs); + return build2 (COMPOUND_EXPR, return_type, trap, rhs); } } @@ -1733,33 +2307,20 @@ build_function_call (tree function, tree params) function prototype, or apply default promotions. */ coerced_params - = convert_arguments (TYPE_ARG_TYPES (fntype), params, name, fundecl); + = convert_arguments (TYPE_ARG_TYPES (fntype), params, function, fundecl); + + if (coerced_params == error_mark_node) + return error_mark_node; /* Check that the arguments to the function are valid. */ - check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params); - - /* Recognize certain built-in functions so we can make tree-codes - other than CALL_EXPR. We do this when it enables fold-const.c - to do something useful. */ - - if (TREE_CODE (function) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL - && DECL_BUILT_IN (TREE_OPERAND (function, 0))) - { - result = expand_tree_builtin (TREE_OPERAND (function, 0), - params, coerced_params); - if (result) - return result; - } - - result = build (CALL_EXPR, TREE_TYPE (fntype), - function, coerced_params, NULL_TREE); - TREE_SIDE_EFFECTS (result) = 1; + check_function_arguments (TYPE_ATTRIBUTES (fntype), coerced_params, + TYPE_ARG_TYPES (fntype)); if (require_constant_value) { - result = fold_initializer (result); + result = fold_build3_initializer (CALL_EXPR, TREE_TYPE (fntype), + function, coerced_params, NULL_TREE); if (TREE_CONSTANT (result) && (name == NULL_TREE @@ -1767,7 +2328,8 @@ build_function_call (tree function, tree params) pedwarn_init ("initializer element is not constant"); } else - result = fold (result); + result = fold_build3 (CALL_EXPR, TREE_TYPE (fntype), + function, coerced_params, NULL_TREE); if (VOID_TYPE_P (TREE_TYPE (result))) return result; @@ -1776,7 +2338,8 @@ build_function_call (tree function, tree params) /* Convert the argument expressions in the list VALUES to the types in the list TYPELIST. The result is a list of converted - argument expressions. + argument expressions, unless there are too few arguments in which + case it is error_mark_node. If TYPELIST is exhausted, or when an element has NULL as its type, perform the default conversions. @@ -1785,7 +2348,8 @@ build_function_call (tree function, tree params) It may be 0, if that info is not available. It is used only for generating error messages. - NAME is an IDENTIFIER_NODE or 0. It is used only for error messages. + FUNCTION is a tree for the called function. It is used only for + error messages, where it is formatted with %qE. This is also where warnings about wrong number of args are generated. @@ -1793,11 +2357,21 @@ build_function_call (tree function, tree params) with the elements of the list in the TREE_VALUE slots of those nodes. */ static tree -convert_arguments (tree typelist, tree values, tree name, tree fundecl) +convert_arguments (tree typelist, tree values, tree function, tree fundecl) { tree typetail, valtail; tree result = NULL; int parmnum; + tree selector; + + /* Change pointer to function to the function itself for + diagnostics. */ + if (TREE_CODE (function) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL) + function = TREE_OPERAND (function, 0); + + /* Handle an ObjC selector specially for diagnostics. */ + selector = objc_message_selector (); /* Scan the given expressions and types, producing individual converted arguments and pushing them on RESULT in reverse order. */ @@ -1808,24 +2382,23 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) { tree type = typetail ? TREE_VALUE (typetail) : 0; tree val = TREE_VALUE (valtail); + tree rname = function; + int argnum = parmnum + 1; + const char *invalid_func_diag; if (type == void_type_node) { - if (name) - error ("too many arguments to function `%s'", - IDENTIFIER_POINTER (name)); - else - error ("too many arguments to function"); + error ("too many arguments to function %qE", function); break; } - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here! We do not want an enumerator with value 0 - to convert automatically to a pointer. */ - if (TREE_CODE (val) == NON_LVALUE_EXPR) - val = TREE_OPERAND (val, 0); + if (selector && argnum > 2) + { + rname = selector; + argnum -= 2; + } - val = default_function_array_conversion (val); + STRIP_TYPE_NOPS (val); val = require_complete_type (val); @@ -1834,7 +2407,7 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) /* Formal parm type is specified by a function prototype. */ tree parmval; - if (!COMPLETE_TYPE_P (type)) + if (type == error_mark_node || !COMPLETE_TYPE_P (type)) { error ("type of formal parameter %d is incomplete", parmnum + 1); parmval = val; @@ -1845,26 +2418,38 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) differ from the default conversions. */ if (warn_conversion || warn_traditional) { - int formal_prec = TYPE_PRECISION (type); + unsigned int formal_prec = TYPE_PRECISION (type); if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_TYPE (val)) == REAL_TYPE) - warn_for_assignment ("%s as integer rather than floating due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as integer " + "rather than floating due to prototype", + argnum, rname); if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE) - warn_for_assignment ("%s as integer rather than complex due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as integer " + "rather than complex due to prototype", + argnum, rname); else if (TREE_CODE (type) == COMPLEX_TYPE && TREE_CODE (TREE_TYPE (val)) == REAL_TYPE) - warn_for_assignment ("%s as complex rather than floating due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as complex " + "rather than floating due to prototype", + argnum, rname); else if (TREE_CODE (type) == REAL_TYPE && INTEGRAL_TYPE_P (TREE_TYPE (val))) - warn_for_assignment ("%s as floating rather than integer due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as floating " + "rather than integer due to prototype", + argnum, rname); else if (TREE_CODE (type) == COMPLEX_TYPE && INTEGRAL_TYPE_P (TREE_TYPE (val))) - warn_for_assignment ("%s as complex rather than integer due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as complex " + "rather than integer due to prototype", + argnum, rname); else if (TREE_CODE (type) == REAL_TYPE && TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE) - warn_for_assignment ("%s as floating rather than complex due to prototype", (char *) 0, name, parmnum + 1); + warning (0, "passing argument %d of %qE as floating " + "rather than complex due to prototype", + argnum, rname); /* ??? At some point, messages should be written about conversions between complex types, but that's too messy to do now. */ @@ -1873,8 +2458,37 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) { /* Warn if any argument is passed as `float', since without a prototype it would be `double'. */ - if (formal_prec == TYPE_PRECISION (float_type_node)) - warn_for_assignment ("%s as `float' rather than `double' due to prototype", (char *) 0, name, parmnum + 1); + if (formal_prec == TYPE_PRECISION (float_type_node) + && type != dfloat32_type_node) + warning (0, "passing argument %d of %qE as % " + "rather than % due to prototype", + argnum, rname); + + /* Warn if mismatch between argument and prototype + for decimal float types. Warn of conversions with + binary float types and of precision narrowing due to + prototype. */ + else if (type != TREE_TYPE (val) + && (type == dfloat32_type_node + || type == dfloat64_type_node + || type == dfloat128_type_node + || TREE_TYPE (val) == dfloat32_type_node + || TREE_TYPE (val) == dfloat64_type_node + || TREE_TYPE (val) == dfloat128_type_node) + && (formal_prec + <= TYPE_PRECISION (TREE_TYPE (val)) + || (type == dfloat128_type_node + && (TREE_TYPE (val) + != dfloat64_type_node + && (TREE_TYPE (val) + != dfloat32_type_node))) + || (type == dfloat64_type_node + && (TREE_TYPE (val) + != dfloat32_type_node)))) + warning (0, "passing argument %d of %qE as %qT " + "rather than %qT due to prototype", + argnum, rname, type, TREE_TYPE (val)); + } /* Detect integer changing in width or signedness. These warnings are only activated with @@ -1892,8 +2506,10 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) and the actual arg is that enum type. */ ; else if (formal_prec != TYPE_PRECISION (type1)) - warn_for_assignment ("%s with different width due to prototype", (char *) 0, name, parmnum + 1); - else if (TREE_UNSIGNED (type) == TREE_UNSIGNED (type1)) + warning (OPT_Wconversion, "passing argument %d of %qE " + "with different width due to prototype", + argnum, rname); + else if (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (type1)) ; /* Don't complain if the formal parameter type is an enum, because we can't tell now whether @@ -1905,28 +2521,26 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) /* Change in signedness doesn't matter if a constant value is unaffected. */ ; - /* Likewise for a constant in a NOP_EXPR. */ - else if (TREE_CODE (val) == NOP_EXPR - && TREE_CODE (TREE_OPERAND (val, 0)) == INTEGER_CST - && int_fits_type_p (TREE_OPERAND (val, 0), type)) - ; /* If the value is extended from a narrower unsigned type, it doesn't matter whether we pass it as signed or unsigned; the value certainly is the same either way. */ else if (TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type) - && TREE_UNSIGNED (TREE_TYPE (val))) + && TYPE_UNSIGNED (TREE_TYPE (val))) ; - else if (TREE_UNSIGNED (type)) - warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1); + else if (TYPE_UNSIGNED (type)) + warning (OPT_Wconversion, "passing argument %d of %qE " + "as unsigned due to prototype", + argnum, rname); else - warn_for_assignment ("%s as signed due to prototype", (char *) 0, name, parmnum + 1); + warning (OPT_Wconversion, "passing argument %d of %qE " + "as signed due to prototype", argnum, rname); } } - parmval = convert_for_assignment (type, val, - (char *) 0, /* arg passing */ - fundecl, name, parmnum + 1); + parmval = convert_for_assignment (type, val, ic_argpass, + fundecl, function, + parmnum + 1); if (targetm.calls.promote_prototypes (fundecl ? TREE_TYPE (fundecl) : 0) && INTEGRAL_TYPE_P (type) @@ -1936,10 +2550,17 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) result = tree_cons (NULL_TREE, parmval, result); } else if (TREE_CODE (TREE_TYPE (val)) == REAL_TYPE - && (TYPE_PRECISION (TREE_TYPE (val)) - < TYPE_PRECISION (double_type_node))) + && (TYPE_PRECISION (TREE_TYPE (val)) + < TYPE_PRECISION (double_type_node)) + && !DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (val)))) /* Convert `float' to `double'. */ result = tree_cons (NULL_TREE, convert (double_type_node, val), result); + else if ((invalid_func_diag = + targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val))) + { + error (invalid_func_diag); + return error_mark_node; + } else /* Convert `short' and `char' to full-size `int'. */ result = tree_cons (NULL_TREE, default_conversion (val), result); @@ -1950,58 +2571,68 @@ convert_arguments (tree typelist, tree values, tree name, tree fundecl) if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) { - if (name) - error ("too few arguments to function `%s'", - IDENTIFIER_POINTER (name)); - else - error ("too few arguments to function"); + error ("too few arguments to function %qE", function); + return error_mark_node; } return nreverse (result); } -/* This is the entry point used by the parser - for binary operators in the input. - In addition to constructing the expression, - we check for operands that were written with other binary operators - in a way that is likely to confuse the user. */ +/* This is the entry point used by the parser to build unary operators + in the input. CODE, a tree_code, specifies the unary operator, and + ARG is the operand. For unary plus, the C parser currently uses + CONVERT_EXPR for code. */ -tree -parser_build_binary_op (enum tree_code code, tree arg1, tree arg2) +struct c_expr +parser_build_unary_op (enum tree_code code, struct c_expr arg) { - tree result = build_binary_op (code, arg1, arg2, 1); + struct c_expr result; - char class; - char class1 = TREE_CODE_CLASS (TREE_CODE (arg1)); - char class2 = TREE_CODE_CLASS (TREE_CODE (arg2)); - enum tree_code code1 = ERROR_MARK; - enum tree_code code2 = ERROR_MARK; + result.original_code = ERROR_MARK; + result.value = build_unary_op (code, arg.value, 0); + overflow_warning (result.value); + return result; +} - if (TREE_CODE (result) == ERROR_MARK) - return error_mark_node; +/* This is the entry point used by the parser to build binary operators + in the input. CODE, a tree_code, specifies the binary operator, and + ARG1 and ARG2 are the operands. In addition to constructing the + expression, we check for operands that were written with other binary + operators in a way that is likely to confuse the user. */ - if (IS_EXPR_CODE_CLASS (class1)) - code1 = C_EXP_ORIGINAL_CODE (arg1); - if (IS_EXPR_CODE_CLASS (class2)) - code2 = C_EXP_ORIGINAL_CODE (arg2); +struct c_expr +parser_build_binary_op (enum tree_code code, struct c_expr arg1, + struct c_expr arg2) +{ + struct c_expr result; + + enum tree_code code1 = arg1.original_code; + enum tree_code code2 = arg2.original_code; + + result.value = build_binary_op (code, arg1.value, arg2.value, 1); + result.original_code = code; + + if (TREE_CODE (result.value) == ERROR_MARK) + return result; /* Check for cases such as x+y< used in subtraction"); if (TREE_CODE (target_type) == FUNCTION_TYPE) pedwarn ("pointer to a function used in subtraction"); } @@ -2118,8 +2733,18 @@ pointer_diff (tree op0, tree op1) different mode in place.) So first try to find a common term here 'by hand'; we want to cover at least the cases that occur in legal static initializers. */ - con0 = TREE_CODE (op0) == NOP_EXPR ? TREE_OPERAND (op0, 0) : op0; - con1 = TREE_CODE (op1) == NOP_EXPR ? TREE_OPERAND (op1, 0) : op1; + if ((TREE_CODE (op0) == NOP_EXPR || TREE_CODE (op0) == CONVERT_EXPR) + && (TYPE_PRECISION (TREE_TYPE (op0)) + == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (op0, 0))))) + con0 = TREE_OPERAND (op0, 0); + else + con0 = op0; + if ((TREE_CODE (op1) == NOP_EXPR || TREE_CODE (op1) == CONVERT_EXPR) + && (TYPE_PRECISION (TREE_TYPE (op1)) + == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (op1, 0))))) + con1 = TREE_OPERAND (op1, 0); + else + con1 = op1; if (TREE_CODE (con0) == PLUS_EXPR) { @@ -2159,13 +2784,7 @@ pointer_diff (tree op0, tree op1) op1 = c_size_in_bytes (target_type); /* Divide by the size, in easiest possible way. */ - - result = build (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)); - - folded = fold (result); - if (folded == result) - TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1); - return folded; + return fold_build2 (EXACT_DIV_EXPR, restype, op0, convert (restype, op1)); } /* Construct and perhaps optimize a tree representation @@ -2186,12 +2805,20 @@ build_unary_op (enum tree_code code, tree xarg, int flag) enum tree_code typecode = TREE_CODE (TREE_TYPE (arg)); tree val; int noconvert = flag; + const char *invalid_op_diag; if (typecode == ERROR_MARK) return error_mark_node; if (typecode == ENUMERAL_TYPE || typecode == BOOLEAN_TYPE) typecode = INTEGER_TYPE; + if ((invalid_op_diag + = targetm.invalid_unary_op (code, TREE_TYPE (xarg)))) + { + error (invalid_op_diag); + return error_mark_node; + } + switch (code) { case CONVERT_EXPR: @@ -2199,7 +2826,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag) is enough to prevent anybody from looking inside for associativity, but won't generate any code. */ if (!(typecode == INTEGER_TYPE || typecode == REAL_TYPE - || typecode == COMPLEX_TYPE)) + || typecode == COMPLEX_TYPE + || typecode == VECTOR_TYPE)) { error ("wrong type argument to unary plus"); return error_mark_node; @@ -2231,7 +2859,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag) { code = CONJ_EXPR; if (pedantic) - pedwarn ("ISO C does not support `~' for complex conjugation"); + pedwarn ("ISO C does not support %<~%> for complex conjugation"); if (!noconvert) arg = default_conversion (arg); } @@ -2267,24 +2895,19 @@ build_unary_op (enum tree_code code, tree xarg, int flag) case TRUTH_NOT_EXPR: if (typecode != INTEGER_TYPE && typecode != REAL_TYPE && typecode != POINTER_TYPE - && typecode != COMPLEX_TYPE - /* These will convert to a pointer. */ - && typecode != ARRAY_TYPE && typecode != FUNCTION_TYPE) + && typecode != COMPLEX_TYPE) { error ("wrong type argument to unary exclamation mark"); return error_mark_node; } - arg = c_common_truthvalue_conversion (arg); + arg = c_objc_common_truthvalue_conversion (arg); return invert_truthvalue (arg); - case NOP_EXPR: - break; - case REALPART_EXPR: if (TREE_CODE (arg) == COMPLEX_CST) return TREE_REALPART (arg); else if (TREE_CODE (TREE_TYPE (arg)) == COMPLEX_TYPE) - return fold (build1 (REALPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg)); + return fold_build1 (REALPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg); else return arg; @@ -2292,7 +2915,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag) if (TREE_CODE (arg) == COMPLEX_CST) return TREE_IMAGPART (arg); else if (TREE_CODE (TREE_TYPE (arg)) == COMPLEX_TYPE) - return fold (build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg)); + return fold_build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg); else return convert (TREE_TYPE (arg), integer_zero_node); @@ -2300,12 +2923,6 @@ build_unary_op (enum tree_code code, tree xarg, int flag) case POSTINCREMENT_EXPR: case PREDECREMENT_EXPR: case POSTDECREMENT_EXPR: - /* Handle complex lvalues (when permitted) - by reduction to simpler cases. */ - - val = unary_complex_lvalue (code, arg, 0); - if (val != 0) - return val; /* Increment or decrement the real part of the value, and don't change the imaginary part. */ @@ -2314,13 +2931,14 @@ build_unary_op (enum tree_code code, tree xarg, int flag) tree real, imag; if (pedantic) - pedwarn ("ISO C does not support `++' and `--' on complex types"); + pedwarn ("ISO C does not support %<++%> and %<--%>" + " on complex types"); arg = stabilize_reference (arg); real = build_unary_op (REALPART_EXPR, arg, 1); imag = build_unary_op (IMAGPART_EXPR, arg, 1); - return build (COMPLEX_EXPR, TREE_TYPE (arg), - build_unary_op (code, real, 1), imag); + return build2 (COMPLEX_EXPR, TREE_TYPE (arg), + build_unary_op (code, real, 1), imag); } /* Report invalid types. */ @@ -2329,9 +2947,9 @@ build_unary_op (enum tree_code code, tree xarg, int flag) && typecode != INTEGER_TYPE && typecode != REAL_TYPE) { if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - error ("wrong type argument to increment"); - else - error ("wrong type argument to decrement"); + error ("wrong type argument to increment"); + else + error ("wrong type argument to decrement"); return error_mark_node; } @@ -2359,7 +2977,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag) else if ((pedantic || warn_pointer_arith) && (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)) - { + { if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) pedwarn ("wrong type argument to increment"); else @@ -2373,79 +2991,31 @@ build_unary_op (enum tree_code code, tree xarg, int flag) inc = convert (argtype, inc); - /* Handle incrementing a cast-expression. */ - - while (1) - switch (TREE_CODE (arg)) - { - case NOP_EXPR: - case CONVERT_EXPR: - case FLOAT_EXPR: - case FIX_TRUNC_EXPR: - case FIX_FLOOR_EXPR: - case FIX_ROUND_EXPR: - case FIX_CEIL_EXPR: - pedantic_lvalue_warning (CONVERT_EXPR); - /* If the real type has the same machine representation - as the type it is cast to, we can make better output - by adding directly to the inside of the cast. */ - if ((TREE_CODE (TREE_TYPE (arg)) - == TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0)))) - && (TYPE_MODE (TREE_TYPE (arg)) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (arg, 0))))) - arg = TREE_OPERAND (arg, 0); - else - { - tree incremented, modify, value; - if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE) - value = boolean_increment (code, arg); - else - { - arg = stabilize_reference (arg); - if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR) - value = arg; - else - value = save_expr (arg); - incremented = build (((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? PLUS_EXPR : MINUS_EXPR), - argtype, value, inc); - TREE_SIDE_EFFECTS (incremented) = 1; - modify = build_modify_expr (arg, NOP_EXPR, incremented); - value = build (COMPOUND_EXPR, TREE_TYPE (arg), modify, value); - } - TREE_USED (value) = 1; - return value; - } - break; - - default: - goto give_up; - } - give_up: - /* Complain about anything else that is not a true lvalue. */ if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - ? "invalid lvalue in increment" - : "invalid lvalue in decrement"))) + ? lv_increment + : lv_decrement))) return error_mark_node; /* Report a read-only lvalue. */ if (TREE_READONLY (arg)) - readonly_error (arg, - ((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR) - ? "increment" : "decrement")); + { + readonly_error (arg, + ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) + ? lv_increment : lv_decrement)); + return error_mark_node; + } if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE) val = boolean_increment (code, arg); else - val = build (code, TREE_TYPE (arg), arg, inc); + val = build2 (code, TREE_TYPE (arg), arg, inc); TREE_SIDE_EFFECTS (val) = 1; val = convert (result_type, val); if (TREE_CODE (val) != code) - TREE_NO_UNUSED_WARNING (val) = 1; + TREE_NO_WARNING (val) = 1; return val; } @@ -2464,89 +3034,74 @@ build_unary_op (enum tree_code code, tree xarg, int flag) /* For &x[y], return x+y */ if (TREE_CODE (arg) == ARRAY_REF) { - if (!c_mark_addressable (TREE_OPERAND (arg, 0))) + tree op0 = TREE_OPERAND (arg, 0); + if (!c_mark_addressable (op0)) return error_mark_node; - return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0), + return build_binary_op (PLUS_EXPR, + (TREE_CODE (TREE_TYPE (op0)) == ARRAY_TYPE + ? array_to_pointer_conversion (op0) + : op0), TREE_OPERAND (arg, 1), 1); } - /* Handle complex lvalues (when permitted) - by reduction to simpler cases. */ - val = unary_complex_lvalue (code, arg, flag); - if (val != 0) - return val; - /* Anything not already handled and not a true memory reference or a non-lvalue array is an error. */ else if (typecode != FUNCTION_TYPE && !flag - && !lvalue_or_else (arg, "invalid lvalue in unary `&'")) + && !lvalue_or_else (arg, lv_addressof)) return error_mark_node; /* Ordinary case; arg is a COMPONENT_REF or a decl. */ argtype = TREE_TYPE (arg); /* If the lvalue is const or volatile, merge that into the type - to which the address will point. Note that you can't get a + to which the address will point. Note that you can't get a restricted pointer by taking the address of something, so we only have to deal with `const' and `volatile' here. */ - if ((DECL_P (arg) || TREE_CODE_CLASS (TREE_CODE (arg)) == 'r') + if ((DECL_P (arg) || REFERENCE_CLASS_P (arg)) && (TREE_READONLY (arg) || TREE_THIS_VOLATILE (arg))) argtype = c_build_type_variant (argtype, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg)); - argtype = build_pointer_type (argtype); - if (!c_mark_addressable (arg)) return error_mark_node; - { - tree addr; + gcc_assert (TREE_CODE (arg) != COMPONENT_REF + || !DECL_C_BIT_FIELD (TREE_OPERAND (arg, 1))); - if (TREE_CODE (arg) == COMPONENT_REF) - { - tree field = TREE_OPERAND (arg, 1); + argtype = build_pointer_type (argtype); - addr = build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0), flag); + /* ??? Cope with user tricks that amount to offsetof. Delete this + when we have proper support for integer constant expressions. */ + val = get_base_address (arg); + if (val && TREE_CODE (val) == INDIRECT_REF + && TREE_CONSTANT (TREE_OPERAND (val, 0))) + { + tree op0 = fold_convert (argtype, fold_offsetof (arg, val)), op1; - if (DECL_C_BIT_FIELD (field)) - { - error ("attempt to take address of bit-field structure member `%s'", - IDENTIFIER_POINTER (DECL_NAME (field))); - return error_mark_node; - } + op1 = fold_convert (argtype, TREE_OPERAND (val, 0)); + return fold_build2 (PLUS_EXPR, argtype, op0, op1); + } - addr = fold (build (PLUS_EXPR, argtype, - convert (argtype, addr), - convert (argtype, byte_position (field)))); - } - else - addr = build1 (code, argtype, arg); + val = build1 (ADDR_EXPR, argtype, arg); - /* Address of a static or external variable or - file-scope function counts as a constant. */ - if (staticp (arg) - && ! (TREE_CODE (arg) == FUNCTION_DECL - && !DECL_FILE_SCOPE_P (arg))) - TREE_CONSTANT (addr) = 1; - return addr; - } + return val; default: - break; + gcc_unreachable (); } if (argtype == 0) argtype = TREE_TYPE (arg); - val = build1 (code, argtype, arg); - return require_constant_value ? fold_initializer (val) : fold (val); + return require_constant_value ? fold_build1_initializer (code, argtype, arg) + : fold_build1 (code, argtype, arg); } /* Return nonzero if REF is an lvalue valid for this language. Lvalues can be assigned, unless their type has TYPE_READONLY. - Lvalues can have their address taken, unless they have DECL_REGISTER. */ + Lvalues can have their address taken, unless they have C_DECL_REGISTER. */ -int +static int lvalue_p (tree ref) { enum tree_code code = TREE_CODE (ref); @@ -2572,108 +3127,64 @@ lvalue_p (tree ref) && TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE); case BIND_EXPR: - case RTL_EXPR: return TREE_CODE (TREE_TYPE (ref)) == ARRAY_TYPE; default: return 0; } } - -/* Return nonzero if REF is an lvalue valid for this language; - otherwise, print an error message and return zero. */ - -int -lvalue_or_else (tree ref, const char *msgid) -{ - int win = lvalue_p (ref); - - if (! win) - error ("%s", msgid); - - return win; -} - -/* Apply unary lvalue-demanding operator CODE to the expression ARG - for certain kinds of expressions which are not really lvalues - but which we can accept as lvalues. If FLAG is nonzero, then - non-lvalues are OK since we may be converting a non-lvalue array to - a pointer in C99. - - If ARG is not a kind of expression we can handle, return zero. */ - -static tree -unary_complex_lvalue (enum tree_code code, tree arg, int flag) -{ - /* Handle (a, b) used as an "lvalue". */ - if (TREE_CODE (arg) == COMPOUND_EXPR) - { - tree real_result = build_unary_op (code, TREE_OPERAND (arg, 1), 0); - - /* If this returns a function type, it isn't really being used as - an lvalue, so don't issue a warning about it. */ - if (TREE_CODE (TREE_TYPE (arg)) != FUNCTION_TYPE && !flag) - pedantic_lvalue_warning (COMPOUND_EXPR); - - return build (COMPOUND_EXPR, TREE_TYPE (real_result), - TREE_OPERAND (arg, 0), real_result); - } - - /* Handle (a ? b : c) used as an "lvalue". */ - if (TREE_CODE (arg) == COND_EXPR) - { - if (!flag) - pedantic_lvalue_warning (COND_EXPR); - if (TREE_CODE (TREE_TYPE (arg)) != FUNCTION_TYPE && !flag) - pedantic_lvalue_warning (COMPOUND_EXPR); - - return (build_conditional_expr - (TREE_OPERAND (arg, 0), - build_unary_op (code, TREE_OPERAND (arg, 1), flag), - build_unary_op (code, TREE_OPERAND (arg, 2), flag))); - } - - return 0; -} - -/* If pedantic, warn about improper lvalue. CODE is either COND_EXPR - COMPOUND_EXPR, or CONVERT_EXPR (for casts). */ + +/* Give an error for storing in something that is 'const'. */ static void -pedantic_lvalue_warning (enum tree_code code) -{ - switch (code) - { - case COND_EXPR: - pedwarn ("use of conditional expressions as lvalues is deprecated"); - break; - case COMPOUND_EXPR: - pedwarn ("use of compound expressions as lvalues is deprecated"); - break; - default: - pedwarn ("use of cast expressions as lvalues is deprecated"); - break; - } -} - -/* Warn about storing in something that is `const'. */ - -void -readonly_error (tree arg, const char *msgid) +readonly_error (tree arg, enum lvalue_use use) { + gcc_assert (use == lv_assign || use == lv_increment || use == lv_decrement + || use == lv_asm); + /* Using this macro rather than (for example) arrays of messages + ensures that all the format strings are checked at compile + time. */ +#define READONLY_MSG(A, I, D, AS) (use == lv_assign ? (A) \ + : (use == lv_increment ? (I) \ + : (use == lv_decrement ? (D) : (AS)))) if (TREE_CODE (arg) == COMPONENT_REF) { if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0)))) - readonly_error (TREE_OPERAND (arg, 0), msgid); + readonly_error (TREE_OPERAND (arg, 0), use); else - error ("%s of read-only member `%s'", _(msgid), - IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1)))); + error (READONLY_MSG (G_("assignment of read-only member %qD"), + G_("increment of read-only member %qD"), + G_("decrement of read-only member %qD"), + G_("read-only member %qD used as % output")), + TREE_OPERAND (arg, 1)); } else if (TREE_CODE (arg) == VAR_DECL) - error ("%s of read-only variable `%s'", _(msgid), - IDENTIFIER_POINTER (DECL_NAME (arg))); + error (READONLY_MSG (G_("assignment of read-only variable %qD"), + G_("increment of read-only variable %qD"), + G_("decrement of read-only variable %qD"), + G_("read-only variable %qD used as % output")), + arg); else - error ("%s of read-only location", _(msgid)); + error (READONLY_MSG (G_("assignment of read-only location"), + G_("increment of read-only location"), + G_("decrement of read-only location"), + G_("read-only location used as % output"))); +} + + +/* Return nonzero if REF is an lvalue valid for this language; + otherwise, print an error message and return zero. USE says + how the lvalue is being used and so selects the error message. */ + +static int +lvalue_or_else (tree ref, enum lvalue_use use) +{ + int win = lvalue_p (ref); + + if (!win) + lvalue_error (use); + + return win; } /* Mark EXP saying that we need to be able to take the @@ -2691,8 +3202,8 @@ c_mark_addressable (tree exp) case COMPONENT_REF: if (DECL_C_BIT_FIELD (TREE_OPERAND (x, 1))) { - error ("cannot take address of bit-field `%s'", - IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1)))); + error + ("cannot take address of bit-field %qD", TREE_OPERAND (x, 1)); return false; } @@ -2714,42 +3225,25 @@ c_mark_addressable (tree exp) case CONST_DECL: case PARM_DECL: case RESULT_DECL: - if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x) + if (C_DECL_REGISTER (x) && DECL_NONLOCAL (x)) { if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x)) { - error ("global register variable `%s' used in nested function", - IDENTIFIER_POINTER (DECL_NAME (x))); + error + ("global register variable %qD used in nested function", x); return false; } - pedwarn ("register variable `%s' used in nested function", - IDENTIFIER_POINTER (DECL_NAME (x))); + pedwarn ("register variable %qD used in nested function", x); } - else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)) + else if (C_DECL_REGISTER (x)) { if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x)) - { - error ("address of global register variable `%s' requested", - IDENTIFIER_POINTER (DECL_NAME (x))); - return false; - } - - /* If we are making this addressable due to its having - volatile components, give a different error message. Also - handle the case of an unnamed parameter by not trying - to give the name. */ - - else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x))) - { - error ("cannot put object with volatile field into register"); - return false; - } - - pedwarn ("address of register variable `%s' requested", - IDENTIFIER_POINTER (DECL_NAME (x))); + error ("address of global register variable %qD requested", x); + else + error ("address of register variable %qD requested", x); + return false; } - put_var_into_stack (x, /*rescan=*/true); /* drops in */ case FUNCTION_DECL: @@ -2772,8 +3266,6 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) tree result_type = NULL; tree orig_op1 = op1, orig_op2 = op2; - ifexp = c_common_truthvalue_conversion (default_conversion (ifexp)); - /* Promote both alternatives. */ if (TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE) @@ -2791,6 +3283,14 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) type2 = TREE_TYPE (op2); code2 = TREE_CODE (type2); + /* C90 does not permit non-lvalue arrays in conditional expressions. + In C99 they will be pointers by now. */ + if (code1 == ARRAY_TYPE || code2 == ARRAY_TYPE) + { + error ("non-lvalue array in conditional expression"); + return error_mark_node; + } + /* Quickly detect the usual case where op1 and op2 have the same type after promotion. */ if (TYPE_MAIN_VARIANT (type1) == TYPE_MAIN_VARIANT (type2)) @@ -2801,11 +3301,11 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) result_type = TYPE_MAIN_VARIANT (type1); } else if ((code1 == INTEGER_TYPE || code1 == REAL_TYPE - || code1 == COMPLEX_TYPE) - && (code2 == INTEGER_TYPE || code2 == REAL_TYPE - || code2 == COMPLEX_TYPE)) + || code1 == COMPLEX_TYPE) + && (code2 == INTEGER_TYPE || code2 == REAL_TYPE + || code2 == COMPLEX_TYPE)) { - result_type = common_type (type1, type2); + result_type = c_common_type (type1, type2); /* If -Wsign-compare, warn here if type1 and type2 have different signedness. We'll promote the signed to unsigned @@ -2814,24 +3314,28 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) will be considered, but default promotions won't. */ if (warn_sign_compare && !skip_evaluation) { - int unsigned_op1 = TREE_UNSIGNED (TREE_TYPE (orig_op1)); - int unsigned_op2 = TREE_UNSIGNED (TREE_TYPE (orig_op2)); + int unsigned_op1 = TYPE_UNSIGNED (TREE_TYPE (orig_op1)); + int unsigned_op2 = TYPE_UNSIGNED (TREE_TYPE (orig_op2)); if (unsigned_op1 ^ unsigned_op2) { + bool ovf; + /* Do not warn if the result type is signed, since the signed type will only be chosen if it can represent all the values of the unsigned type. */ - if (! TREE_UNSIGNED (result_type)) + if (!TYPE_UNSIGNED (result_type)) /* OK */; /* Do not warn if the signed quantity is an unsuffixed integer literal (or some static constant expression involving such literals) and it is non-negative. */ - else if ((unsigned_op2 && c_tree_expr_nonnegative_p (op1)) - || (unsigned_op1 && c_tree_expr_nonnegative_p (op2))) + else if ((unsigned_op2 + && tree_expr_nonnegative_warnv_p (op1, &ovf)) + || (unsigned_op1 + && tree_expr_nonnegative_warnv_p (op2, &ovf))) /* OK */; else - warning ("signed and unsigned type in conditional expression"); + warning (0, "signed and unsigned type in conditional expression"); } } } @@ -2843,25 +3347,25 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) } else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE) { - if (comp_target_types (type1, type2, 1)) - result_type = common_type (type1, type2); - else if (integer_zerop (op1) && TREE_TYPE (type1) == void_type_node - && TREE_CODE (orig_op1) != NOP_EXPR) + if (comp_target_types (type1, type2)) + result_type = common_pointer_type (type1, type2); + else if (null_pointer_constant_p (orig_op1)) result_type = qualify_type (type2, type1); - else if (integer_zerop (op2) && TREE_TYPE (type2) == void_type_node - && TREE_CODE (orig_op2) != NOP_EXPR) + else if (null_pointer_constant_p (orig_op2)) result_type = qualify_type (type1, type2); else if (VOID_TYPE_P (TREE_TYPE (type1))) { if (pedantic && TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE) - pedwarn ("ISO C forbids conditional expr between `void *' and function pointer"); + pedwarn ("ISO C forbids conditional expr between " + "% and function pointer"); result_type = build_pointer_type (qualify_type (TREE_TYPE (type1), TREE_TYPE (type2))); } else if (VOID_TYPE_P (TREE_TYPE (type2))) { if (pedantic && TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE) - pedwarn ("ISO C forbids conditional expr between `void *' and function pointer"); + pedwarn ("ISO C forbids conditional expr between " + "% and function pointer"); result_type = build_pointer_type (qualify_type (TREE_TYPE (type2), TREE_TYPE (type1))); } @@ -2873,7 +3377,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) } else if (code1 == POINTER_TYPE && code2 == INTEGER_TYPE) { - if (! integer_zerop (op2)) + if (!null_pointer_constant_p (orig_op2)) pedwarn ("pointer/integer type mismatch in conditional expression"); else { @@ -2883,7 +3387,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) } else if (code2 == POINTER_TYPE && code1 == INTEGER_TYPE) { - if (!integer_zerop (op1)) + if (!null_pointer_constant_p (orig_op1)) pedwarn ("pointer/integer type mismatch in conditional expression"); else { @@ -2914,51 +3418,34 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) if (result_type != TREE_TYPE (op2)) op2 = convert_and_check (result_type, op2); - if (TREE_CODE (ifexp) == INTEGER_CST) - return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1); - - return fold (build (COND_EXPR, result_type, ifexp, op1, op2)); + return fold_build3 (COND_EXPR, result_type, ifexp, op1, op2); } -/* Given a list of expressions, return a compound expression - that performs them all and returns the value of the last of them. */ +/* Return a compound expression that performs two expressions and + returns the value of the second of them. */ tree -build_compound_expr (tree list) +build_compound_expr (tree expr1, tree expr2) { - return internal_build_compound_expr (list, TRUE); -} - -static tree -internal_build_compound_expr (tree list, int first_p) -{ - tree rest; - - if (TREE_CHAIN (list) == 0) - { - /* Convert arrays and functions to pointers when there - really is a comma operator. */ - if (!first_p) - TREE_VALUE (list) - = default_function_array_conversion (TREE_VALUE (list)); - - /* Don't let (0, 0) be null pointer constant. */ - if (!first_p && integer_zerop (TREE_VALUE (list))) - return non_lvalue (TREE_VALUE (list)); - return TREE_VALUE (list); - } - - rest = internal_build_compound_expr (TREE_CHAIN (list), FALSE); - - if (! TREE_SIDE_EFFECTS (TREE_VALUE (list))) + if (!TREE_SIDE_EFFECTS (expr1)) { /* The left-hand operand of a comma expression is like an expression - statement: with -Wextra or -Wunused, we should warn if it doesn't have + statement: with -Wextra or -Wunused, we should warn if it doesn't have any side-effects, unless it was explicitly cast to (void). */ - if (warn_unused_value - && ! (TREE_CODE (TREE_VALUE (list)) == CONVERT_EXPR - && VOID_TYPE_P (TREE_TYPE (TREE_VALUE (list))))) - warning ("left-hand operand of comma expression has no effect"); + if (warn_unused_value) + { + if (VOID_TYPE_P (TREE_TYPE (expr1)) + && (TREE_CODE (expr1) == NOP_EXPR + || TREE_CODE (expr1) == CONVERT_EXPR)) + ; /* (void) a, b */ + else if (VOID_TYPE_P (TREE_TYPE (expr1)) + && TREE_CODE (expr1) == COMPOUND_EXPR + && (TREE_CODE (TREE_OPERAND (expr1, 1)) == CONVERT_EXPR + || TREE_CODE (TREE_OPERAND (expr1, 1)) == NOP_EXPR)) + ; /* (void) a, (void) b, c */ + else + warning (0, "left-hand operand of comma expression has no effect"); + } } /* With -Wunused, we should also warn if the left-hand operand does have @@ -2966,9 +3453,12 @@ internal_build_compound_expr (tree list, int first_p) `foo() + bar(), baz()' the result of the `+' operator is not used, so we should issue a warning. */ else if (warn_unused_value) - warn_if_unused_value (TREE_VALUE (list)); + warn_if_unused_value (expr1, input_location); - return build (COMPOUND_EXPR, TREE_TYPE (rest), TREE_VALUE (list), rest); + if (expr2 == error_mark_node) + return error_mark_node; + + return build2 (COMPOUND_EXPR, TREE_TYPE (expr2), expr1, expr2); } /* Build an expression representing a cast to type TYPE of expression EXPR. */ @@ -2984,8 +3474,10 @@ build_c_cast (tree type, tree expr) /* The ObjC front-end uses TYPE_MAIN_VARIANT to tie together types differing only in qualifications. But when constructing cast expressions, the protocols do matter and must be kept around. */ - if (!c_dialect_objc () || !objc_is_object_ptr (type)) - type = TYPE_MAIN_VARIANT (type); + if (objc_is_object_ptr (type) && objc_is_object_ptr (TREE_TYPE (expr))) + return build1 (NOP_EXPR, type, expr); + + type = TYPE_MAIN_VARIANT (type); if (TREE_CODE (type) == ARRAY_TYPE) { @@ -3011,11 +3503,10 @@ build_c_cast (tree type, tree expr) else if (TREE_CODE (type) == UNION_TYPE) { tree field; - value = default_function_array_conversion (value); for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (field)), - TYPE_MAIN_VARIANT (TREE_TYPE (value)), COMPARE_STRICT)) + TYPE_MAIN_VARIANT (TREE_TYPE (value)))) break; if (field) @@ -3025,10 +3516,10 @@ build_c_cast (tree type, tree expr) if (pedantic) pedwarn ("ISO C forbids casts to union type"); t = digest_init (type, - build_constructor (type, - build_tree_list (field, value)), - 0); + build_constructor_single (type, field, value), + true, 0); TREE_CONSTANT (t) = TREE_CONSTANT (value); + TREE_INVARIANT (t) = TREE_INVARIANT (value); return t; } error ("cast to union type from type not present in union"); @@ -3038,14 +3529,9 @@ build_c_cast (tree type, tree expr) { tree otype, ovalue; - /* If casting to void, avoid the error that would come - from default_conversion in the case of a non-lvalue array. */ if (type == void_type_node) return build1 (CONVERT_EXPR, type, value); - /* Convert functions and arrays to pointers, - but don't convert any other types. */ - value = default_function_array_conversion (value); otype = TREE_TYPE (value); /* Optionally warn about potentially worrisome casts. */ @@ -3082,16 +3568,16 @@ build_c_cast (tree type, tree expr) && TREE_CODE (in_otype) == POINTER_TYPE); if (added) - warning ("cast adds new qualifiers to function type"); + warning (0, "cast adds new qualifiers to function type"); if (discarded) /* There are qualifiers present in IN_OTYPE that are not present in IN_TYPE. */ - warning ("cast discards qualifiers from pointer target type"); + warning (0, "cast discards qualifiers from pointer target type"); } /* Warn about possible alignment problems. */ - if (STRICT_ALIGNMENT && warn_cast_align + if (STRICT_ALIGNMENT && TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == POINTER_TYPE && TREE_CODE (TREE_TYPE (otype)) != VOID_TYPE @@ -3102,42 +3588,34 @@ build_c_cast (tree type, tree expr) || TREE_CODE (TREE_TYPE (otype)) == RECORD_TYPE) && TYPE_MODE (TREE_TYPE (otype)) == VOIDmode) && TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype))) - warning ("cast increases required alignment of target type"); + warning (OPT_Wcast_align, + "cast increases required alignment of target type"); if (TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (otype) == POINTER_TYPE - && TYPE_PRECISION (type) != TYPE_PRECISION (otype) - && !TREE_CONSTANT (value)) - warning ("cast from pointer to integer of different size"); + && TYPE_PRECISION (type) != TYPE_PRECISION (otype)) + /* Unlike conversion of integers to pointers, where the + warning is disabled for converting constants because + of cases such as SIG_*, warn about converting constant + pointers to integers. In some cases it may cause unwanted + sign extension, and a warning is appropriate. */ + warning (OPT_Wpointer_to_int_cast, + "cast from pointer to integer of different size"); - if (warn_bad_function_cast - && TREE_CODE (value) == CALL_EXPR + if (TREE_CODE (value) == CALL_EXPR && TREE_CODE (type) != TREE_CODE (otype)) - warning ("cast does not match function type"); + warning (OPT_Wbad_function_cast, "cast from function call of type %qT " + "to non-matching type %qT", otype, type); if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == INTEGER_TYPE && TYPE_PRECISION (type) != TYPE_PRECISION (otype) /* Don't warn about converting any constant. */ && !TREE_CONSTANT (value)) - warning ("cast to pointer from integer of different size"); + warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer " + "of different size"); - if (TREE_CODE (type) == POINTER_TYPE - && TREE_CODE (otype) == POINTER_TYPE - && TREE_CODE (expr) == ADDR_EXPR - && DECL_P (TREE_OPERAND (expr, 0)) - && flag_strict_aliasing && warn_strict_aliasing - && !VOID_TYPE_P (TREE_TYPE (type))) - { - /* Casting the address of a decl to non void pointer. Warn - if the cast breaks type based aliasing. */ - if (!COMPLETE_TYPE_P (TREE_TYPE (type))) - warning ("type-punning to incomplete type might break strict-aliasing rules"); - else if (!alias_sets_conflict_p - (get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))), - get_alias_set (TREE_TYPE (type)))) - warning ("dereferencing type-punned pointer will break strict-aliasing rules"); - } + strict_aliasing_warning (otype, type, expr); /* If pedantic, warn for conversions between function and object pointer types, except for converting a null pointer constant @@ -3154,32 +3632,33 @@ build_c_cast (tree type, tree expr) && TREE_CODE (otype) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE && TREE_CODE (TREE_TYPE (otype)) != FUNCTION_TYPE - && !(integer_zerop (value) && TREE_TYPE (otype) == void_type_node - && TREE_CODE (expr) != NOP_EXPR)) + && !null_pointer_constant_p (value)) pedwarn ("ISO C forbids conversion of object pointer to function pointer type"); ovalue = value; - /* Replace a nonvolatile const static variable with its value. */ - if (optimize && TREE_CODE (value) == VAR_DECL) - value = decl_constant_value (value); value = convert (type, value); /* Ignore any integer overflow caused by the cast. */ if (TREE_CODE (value) == INTEGER_CST) { - TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue); - TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue); + if (CONSTANT_CLASS_P (ovalue) + && (TREE_OVERFLOW (ovalue) || TREE_CONSTANT_OVERFLOW (ovalue))) + { + /* Avoid clobbering a shared constant. */ + value = copy_node (value); + TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue); + TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue); + } + else if (TREE_OVERFLOW (value) || TREE_CONSTANT_OVERFLOW (value)) + /* Reset VALUE's overflow flags, ensuring constant sharing. */ + value = build_int_cst_wide (TREE_TYPE (value), + TREE_INT_CST_LOW (value), + TREE_INT_CST_HIGH (value)); } } - /* Pedantically, don't let (void *) (FOO *) 0 be a null pointer constant. */ - if (pedantic && TREE_CODE (value) == INTEGER_CST - && TREE_CODE (expr) == INTEGER_CST - && TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE) - value = non_lvalue (value); - - /* If pedantic, don't let a cast be an lvalue. */ - if (value == expr && pedantic) + /* Don't let a cast be an lvalue. */ + if (value == expr) value = non_lvalue (value); return value; @@ -3187,20 +3666,20 @@ build_c_cast (tree type, tree expr) /* Interpret a cast of expression EXPR to type TYPE. */ tree -c_cast_expr (tree type, tree expr) +c_cast_expr (struct c_type_name *type_name, tree expr) { + tree type; int saved_wsp = warn_strict_prototypes; /* This avoids warnings about unprototyped casts on integers. E.g. "#define SIG_DFL (void(*)())0". */ if (TREE_CODE (expr) == INTEGER_CST) warn_strict_prototypes = 0; - type = groktypename (type); + type = groktypename (type_name); warn_strict_prototypes = saved_wsp; return build_c_cast (type, expr); } - /* Build an assignment expression of lvalue LHS from value RHS. MODIFYCODE is the code for a binary operator that we use @@ -3222,53 +3701,13 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (TREE_CODE (lhs) == ERROR_MARK || TREE_CODE (rhs) == ERROR_MARK) return error_mark_node; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (rhs) == NON_LVALUE_EXPR) - rhs = TREE_OPERAND (rhs, 0); + if (!lvalue_or_else (lhs, lv_assign)) + return error_mark_node; + + STRIP_TYPE_NOPS (rhs); newrhs = rhs; - /* Handle control structure constructs used as "lvalues". */ - - switch (TREE_CODE (lhs)) - { - /* Handle (a, b) used as an "lvalue". */ - case COMPOUND_EXPR: - pedantic_lvalue_warning (COMPOUND_EXPR); - newrhs = build_modify_expr (TREE_OPERAND (lhs, 1), modifycode, rhs); - if (TREE_CODE (newrhs) == ERROR_MARK) - return error_mark_node; - return build (COMPOUND_EXPR, lhstype, - TREE_OPERAND (lhs, 0), newrhs); - - /* Handle (a ? b : c) used as an "lvalue". */ - case COND_EXPR: - pedantic_lvalue_warning (COND_EXPR); - rhs = save_expr (rhs); - { - /* Produce (a ? (b = rhs) : (c = rhs)) - except that the RHS goes through a save-expr - so the code to compute it is only emitted once. */ - tree cond - = build_conditional_expr (TREE_OPERAND (lhs, 0), - build_modify_expr (TREE_OPERAND (lhs, 1), - modifycode, rhs), - build_modify_expr (TREE_OPERAND (lhs, 2), - modifycode, rhs)); - if (TREE_CODE (cond) == ERROR_MARK) - return cond; - /* Make sure the code to compute the rhs comes out - before the split. */ - return build (COMPOUND_EXPR, TREE_TYPE (lhs), - /* But cast it to void to avoid an "unused" error. */ - convert (void_type_node, rhs), cond); - } - default: - break; - } - /* If a binary op has been requested, combine the old LHS value with the RHS producing the value we should actually store into the LHS. */ @@ -3278,52 +3717,16 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) newrhs = build_binary_op (modifycode, lhs, rhs, 1); } - /* Handle a cast used as an "lvalue". - We have already performed any binary operator using the value as cast. - Now convert the result to the cast type of the lhs, - and then true type of the lhs and store it there; - then convert result back to the cast type to be the value - of the assignment. */ - - switch (TREE_CODE (lhs)) - { - case NOP_EXPR: - case CONVERT_EXPR: - case FLOAT_EXPR: - case FIX_TRUNC_EXPR: - case FIX_FLOOR_EXPR: - case FIX_ROUND_EXPR: - case FIX_CEIL_EXPR: - newrhs = default_function_array_conversion (newrhs); - { - tree inner_lhs = TREE_OPERAND (lhs, 0); - tree result; - result = build_modify_expr (inner_lhs, NOP_EXPR, - convert (TREE_TYPE (inner_lhs), - convert (lhstype, newrhs))); - if (TREE_CODE (result) == ERROR_MARK) - return result; - pedantic_lvalue_warning (CONVERT_EXPR); - return convert (TREE_TYPE (lhs), result); - } - - default: - break; - } - - /* Now we have handled acceptable kinds of LHS that are not truly lvalues. - Reject anything strange now. */ - - if (!lvalue_or_else (lhs, "invalid lvalue in assignment")) - return error_mark_node; - - /* Warn about storing in something that is `const'. */ + /* Give an error for storing in something that is 'const'. */ if (TREE_READONLY (lhs) || TYPE_READONLY (lhstype) || ((TREE_CODE (lhstype) == RECORD_TYPE || TREE_CODE (lhstype) == UNION_TYPE) && C_TYPE_FIELDS_READONLY (lhstype))) - readonly_error (lhs, "assignment"); + { + readonly_error (lhs, lv_assign); + return error_mark_node; + } /* If storing into a structure or union member, it has probably been given type `int'. @@ -3348,14 +3751,22 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) /* Convert new value to destination type. */ - newrhs = convert_for_assignment (lhstype, newrhs, _("assignment"), + newrhs = convert_for_assignment (lhstype, newrhs, ic_assign, NULL_TREE, NULL_TREE, 0); if (TREE_CODE (newrhs) == ERROR_MARK) return error_mark_node; - /* Scan operands */ + /* Emit ObjC write barrier, if necessary. */ + if (c_dialect_objc () && flag_objc_gc) + { + result = objc_generate_write_barrier (lhs, modifycode, newrhs); + if (result) + return result; + } - result = build (MODIFY_EXPR, lhstype, lhs, newrhs); + /* Scan operands. */ + + result = build2 (MODIFY_EXPR, lhstype, lhs, newrhs); TREE_SIDE_EFFECTS (result) = 1; /* If we got the LHS in a different type for storing in, @@ -3365,7 +3776,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (olhstype == TREE_TYPE (result)) return result; - return convert_for_assignment (olhstype, result, _("assignment"), + return convert_for_assignment (olhstype, result, ic_assign, NULL_TREE, NULL_TREE, 0); } @@ -3374,32 +3785,72 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) The real work of conversion is done by `convert'. The purpose of this function is to generate error messages for assignments that are not allowed in C. - ERRTYPE is a string to use in error messages: - "assignment", "return", etc. If it is null, this is parameter passing - for a function call (and different error messages are output). + ERRTYPE says whether it is argument passing, assignment, + initialization or return. - FUNNAME is the name of the function being called, - as an IDENTIFIER_NODE, or null. + FUNCTION is a tree for the function being called. PARMNUM is the number of the argument, for printing in error messages. */ static tree -convert_for_assignment (tree type, tree rhs, const char *errtype, - tree fundecl, tree funname, int parmnum) +convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, + tree fundecl, tree function, int parmnum) { enum tree_code codel = TREE_CODE (type); tree rhstype; enum tree_code coder; + tree rname = NULL_TREE; + bool objc_ok = false; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (rhs) == NON_LVALUE_EXPR) - rhs = TREE_OPERAND (rhs, 0); + if (errtype == ic_argpass || errtype == ic_argpass_nonproto) + { + tree selector; + /* Change pointer to function to the function itself for + diagnostics. */ + if (TREE_CODE (function) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL) + function = TREE_OPERAND (function, 0); - if (TREE_CODE (TREE_TYPE (rhs)) == ARRAY_TYPE - || TREE_CODE (TREE_TYPE (rhs)) == FUNCTION_TYPE) - rhs = default_conversion (rhs); - else if (optimize && TREE_CODE (rhs) == VAR_DECL) + /* Handle an ObjC selector specially for diagnostics. */ + selector = objc_message_selector (); + rname = function; + if (selector && parmnum > 2) + { + rname = selector; + parmnum -= 2; + } + } + + /* This macro is used to emit diagnostics to ensure that all format + strings are complete sentences, visible to gettext and checked at + compile time. */ +#define WARN_FOR_ASSIGNMENT(AR, AS, IN, RE) \ + do { \ + switch (errtype) \ + { \ + case ic_argpass: \ + pedwarn (AR, parmnum, rname); \ + break; \ + case ic_argpass_nonproto: \ + warning (0, AR, parmnum, rname); \ + break; \ + case ic_assign: \ + pedwarn (AS); \ + break; \ + case ic_init: \ + pedwarn (IN); \ + break; \ + case ic_return: \ + pedwarn (RE); \ + break; \ + default: \ + gcc_unreachable (); \ + } \ + } while (0) + + STRIP_TYPE_NOPS (rhs); + + if (optimize && TREE_CODE (rhs) == VAR_DECL + && TREE_CODE (TREE_TYPE (rhs)) != ARRAY_TYPE) rhs = decl_constant_value_for_broken_optimization (rhs); rhstype = TREE_TYPE (rhs); @@ -3408,19 +3859,45 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, if (coder == ERROR_MARK) return error_mark_node; + if (c_dialect_objc ()) + { + int parmno; + + switch (errtype) + { + case ic_return: + parmno = 0; + break; + + case ic_assign: + parmno = -1; + break; + + case ic_init: + parmno = -2; + break; + + default: + parmno = parmnum; + break; + } + + objc_ok = objc_compare_types (type, rhstype, parmno, rname); + } + if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype)) { overflow_warning (rhs); - /* Check for Objective-C protocols. This will automatically - issue a warning if there are protocol violations. No need to - use the return value. */ - if (c_dialect_objc ()) - objc_comptypes (type, rhstype, 0); return rhs; } if (coder == VOID_TYPE) { + /* Except for passing an argument to an unprototyped function, + this is a constraint violation. When passing an argument to + an unprototyped function, it is compile-time undefined; + making it a constraint in that case was rejected in + DR#252. */ error ("void value not ignored as it ought to be"); return error_mark_node; } @@ -3428,7 +3905,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, This code doesn't fully support references, it's just for the special case of va_start and va_copy. */ if (codel == REFERENCE_TYPE - && comptypes (TREE_TYPE (type), TREE_TYPE (rhs), COMPARE_STRICT) == 1) + && comptypes (TREE_TYPE (type), TREE_TYPE (rhs)) == 1) { if (!lvalue_p (rhs)) { @@ -3452,8 +3929,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, } /* Some types can interconvert without explicit casts. */ else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE - && ((*targetm.vector_opaque_p) (type) - || (*targetm.vector_opaque_p) (rhstype))) + && vector_types_convertible_p (type, TREE_TYPE (rhs))) return convert (type, rhs); /* Arithmetic types all interconvert, and enum is treated like int. */ else if ((codel == INTEGER_TYPE || codel == REAL_TYPE @@ -3464,20 +3940,25 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, || coder == BOOLEAN_TYPE)) return convert_and_check (type, rhs); + /* Aggregates in different TUs might need conversion. */ + if ((codel == RECORD_TYPE || codel == UNION_TYPE) + && codel == coder + && comptypes (type, rhstype)) + return convert_and_check (type, rhs); + /* Conversion to a transparent union from its member types. This applies only to function arguments. */ - else if (codel == UNION_TYPE && TYPE_TRANSPARENT_UNION (type) && ! errtype) + if (codel == UNION_TYPE && TYPE_TRANSPARENT_UNION (type) + && (errtype == ic_argpass || errtype == ic_argpass_nonproto)) { - tree memb_types; - tree marginal_memb_type = 0; + tree memb, marginal_memb = NULL_TREE; - for (memb_types = TYPE_FIELDS (type); memb_types; - memb_types = TREE_CHAIN (memb_types)) + for (memb = TYPE_FIELDS (type); memb ; memb = TREE_CHAIN (memb)) { - tree memb_type = TREE_TYPE (memb_types); + tree memb_type = TREE_TYPE (memb); if (comptypes (TYPE_MAIN_VARIANT (memb_type), - TYPE_MAIN_VARIANT (rhstype), COMPARE_STRICT)) + TYPE_MAIN_VARIANT (rhstype))) break; if (TREE_CODE (memb_type) != POINTER_TYPE) @@ -3493,7 +3974,7 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, Meanwhile, the lhs target must have all the qualifiers of the rhs. */ if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr) - || comp_target_types (memb_type, rhstype, 0)) + || comp_target_types (memb_type, rhstype)) { /* If this type won't generate any warnings, use it. */ if (TYPE_QUALS (ttl) == TYPE_QUALS (ttr) @@ -3506,28 +3987,26 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, break; /* Keep looking for a better type, but remember this one. */ - if (! marginal_memb_type) - marginal_memb_type = memb_type; + if (!marginal_memb) + marginal_memb = memb; } } /* Can convert integer zero to any pointer type. */ - if (integer_zerop (rhs) - || (TREE_CODE (rhs) == NOP_EXPR - && integer_zerop (TREE_OPERAND (rhs, 0)))) + if (null_pointer_constant_p (rhs)) { rhs = null_pointer_node; break; } } - if (memb_types || marginal_memb_type) + if (memb || marginal_memb) { - if (! memb_types) + if (!memb) { /* We have only a marginally acceptable member type; it needs a warning. */ - tree ttl = TREE_TYPE (marginal_memb_type); + tree ttl = TREE_TYPE (TREE_TYPE (marginal_memb)); tree ttr = TREE_TYPE (rhstype); /* Const and volatile mean something different for function @@ -3541,19 +4020,35 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, function where an ordinary one is wanted, but not vice-versa. */ if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr)) - warn_for_assignment ("%s makes qualified function pointer from unqualified", - errtype, funname, parmnum); + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE " + "makes qualified function " + "pointer from unqualified"), + G_("assignment makes qualified " + "function pointer from " + "unqualified"), + G_("initialization makes qualified " + "function pointer from " + "unqualified"), + G_("return makes qualified function " + "pointer from unqualified")); } else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl)) - warn_for_assignment ("%s discards qualifiers from pointer target type", - errtype, funname, - parmnum); + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards " + "qualifiers from pointer target type"), + G_("assignment discards qualifiers " + "from pointer target type"), + G_("initialization discards qualifiers " + "from pointer target type"), + G_("return discards qualifiers from " + "pointer target type")); + + memb = marginal_memb; } - if (pedantic && ! DECL_IN_SYSTEM_HEADER (fundecl)) + if (pedantic && (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl))) pedwarn ("ISO C prohibits argument conversion to union type"); - return build1 (NOP_EXPR, type, rhs); + return build_constructor_single (type, memb, rhs); } } @@ -3563,51 +4058,125 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, { tree ttl = TREE_TYPE (type); tree ttr = TREE_TYPE (rhstype); + tree mvl = ttl; + tree mvr = ttr; bool is_opaque_pointer; int target_cmp = 0; /* Cache comp_target_types () result. */ + if (TREE_CODE (mvl) != ARRAY_TYPE) + mvl = TYPE_MAIN_VARIANT (mvl); + if (TREE_CODE (mvr) != ARRAY_TYPE) + mvr = TYPE_MAIN_VARIANT (mvr); /* Opaque pointers are treated like void pointers. */ - is_opaque_pointer = ((*targetm.vector_opaque_p) (type) - || (*targetm.vector_opaque_p) (rhstype)) - && TREE_CODE (ttl) == VECTOR_TYPE - && TREE_CODE (ttr) == VECTOR_TYPE; + is_opaque_pointer = (targetm.vector_opaque_p (type) + || targetm.vector_opaque_p (rhstype)) + && TREE_CODE (ttl) == VECTOR_TYPE + && TREE_CODE (ttr) == VECTOR_TYPE; + + /* C++ does not allow the implicit conversion void* -> T*. However, + for the purpose of reducing the number of false positives, we + tolerate the special case of + + int *p = NULL; + + where NULL is typically defined in C to be '(void *) 0'. */ + if (VOID_TYPE_P (ttr) && rhs != null_pointer_node && !VOID_TYPE_P (ttl)) + warning (OPT_Wc___compat, "request for implicit conversion from " + "%qT to %qT not permitted in C++", rhstype, type); + + /* Check if the right-hand side has a format attribute but the + left-hand side doesn't. */ + if (warn_missing_format_attribute + && check_missing_format_attribute (type, rhstype)) + { + switch (errtype) + { + case ic_argpass: + case ic_argpass_nonproto: + warning (OPT_Wmissing_format_attribute, + "argument %d of %qE might be " + "a candidate for a format attribute", + parmnum, rname); + break; + case ic_assign: + warning (OPT_Wmissing_format_attribute, + "assignment left-hand side might be " + "a candidate for a format attribute"); + break; + case ic_init: + warning (OPT_Wmissing_format_attribute, + "initialization left-hand side might be " + "a candidate for a format attribute"); + break; + case ic_return: + warning (OPT_Wmissing_format_attribute, + "return type might be " + "a candidate for a format attribute"); + break; + default: + gcc_unreachable (); + } + } /* Any non-function converts to a [const][volatile] void * and vice versa; otherwise, targets must be the same. Meanwhile, the lhs target must have all the qualifiers of the rhs. */ if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr) - || (target_cmp = comp_target_types (type, rhstype, 0)) + || (target_cmp = comp_target_types (type, rhstype)) || is_opaque_pointer - || (c_common_unsigned_type (TYPE_MAIN_VARIANT (ttl)) - == c_common_unsigned_type (TYPE_MAIN_VARIANT (ttr)))) + || (c_common_unsigned_type (mvl) + == c_common_unsigned_type (mvr))) { if (pedantic && ((VOID_TYPE_P (ttl) && TREE_CODE (ttr) == FUNCTION_TYPE) || (VOID_TYPE_P (ttr) - /* Check TREE_CODE to catch cases like (void *) (char *) 0 - which are not ANSI null ptr constants. */ - && (!integer_zerop (rhs) || TREE_CODE (rhs) == NOP_EXPR) + && !null_pointer_constant_p (rhs) && TREE_CODE (ttl) == FUNCTION_TYPE))) - warn_for_assignment ("ISO C forbids %s between function pointer and `void *'", - errtype, funname, parmnum); + WARN_FOR_ASSIGNMENT (G_("ISO C forbids passing argument %d of " + "%qE between function pointer " + "and %"), + G_("ISO C forbids assignment between " + "function pointer and %"), + G_("ISO C forbids initialization between " + "function pointer and %"), + G_("ISO C forbids return between function " + "pointer and %")); /* Const and volatile mean something different for function types, so the usual warnings are not appropriate. */ else if (TREE_CODE (ttr) != FUNCTION_TYPE && TREE_CODE (ttl) != FUNCTION_TYPE) { if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl)) - warn_for_assignment ("%s discards qualifiers from pointer target type", - errtype, funname, parmnum); + { + /* Types differing only by the presence of the 'volatile' + qualifier are acceptable if the 'volatile' has been added + in by the Objective-C EH machinery. */ + if (!objc_type_quals_match (ttl, ttr)) + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards " + "qualifiers from pointer target type"), + G_("assignment discards qualifiers " + "from pointer target type"), + G_("initialization discards qualifiers " + "from pointer target type"), + G_("return discards qualifiers from " + "pointer target type")); + } /* If this is not a case of ignoring a mismatch in signedness, no warning. */ else if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr) || target_cmp) ; /* If there is a mismatch, do warn. */ - else if (pedantic) - warn_for_assignment ("pointer targets in %s differ in signedness", - errtype, funname, parmnum); + else if (warn_pointer_sign) + WARN_FOR_ASSIGNMENT (G_("pointer targets in passing argument " + "%d of %qE differ in signedness"), + G_("pointer targets in assignment " + "differ in signedness"), + G_("pointer targets in initialization " + "differ in signedness"), + G_("pointer targets in return differ " + "in signedness")); } else if (TREE_CODE (ttl) == FUNCTION_TYPE && TREE_CODE (ttr) == FUNCTION_TYPE) @@ -3617,17 +4186,33 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, it is okay to use a const or volatile function where an ordinary one is wanted, but not vice-versa. */ if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr)) - warn_for_assignment ("%s makes qualified function pointer from unqualified", - errtype, funname, parmnum); + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes " + "qualified function pointer " + "from unqualified"), + G_("assignment makes qualified function " + "pointer from unqualified"), + G_("initialization makes qualified " + "function pointer from unqualified"), + G_("return makes qualified function " + "pointer from unqualified")); } } else - warn_for_assignment ("%s from incompatible pointer type", - errtype, funname, parmnum); + /* Avoid warning about the volatile ObjC EH puts on decls. */ + if (!objc_ok) + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE from " + "incompatible pointer type"), + G_("assignment from incompatible pointer type"), + G_("initialization from incompatible " + "pointer type"), + G_("return from incompatible pointer type")); + return convert (type, rhs); } else if (codel == POINTER_TYPE && coder == ARRAY_TYPE) { + /* ??? This should not be an error when inlining calls to + unprototyped functions. */ error ("invalid use of non-lvalue array"); return error_mark_node; } @@ -3636,51 +4221,59 @@ convert_for_assignment (tree type, tree rhs, const char *errtype, /* An explicit constant 0 can convert to a pointer, or one that results from arithmetic, even including a cast to integer type. */ - if (! (TREE_CODE (rhs) == INTEGER_CST && integer_zerop (rhs)) - && - ! (TREE_CODE (rhs) == NOP_EXPR - && TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE - && TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST - && integer_zerop (TREE_OPERAND (rhs, 0)))) - warn_for_assignment ("%s makes pointer from integer without a cast", - errtype, funname, parmnum); + if (!null_pointer_constant_p (rhs)) + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes " + "pointer from integer without a cast"), + G_("assignment makes pointer from integer " + "without a cast"), + G_("initialization makes pointer from " + "integer without a cast"), + G_("return makes pointer from integer " + "without a cast")); return convert (type, rhs); } else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) { - warn_for_assignment ("%s makes integer from pointer without a cast", - errtype, funname, parmnum); + WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes integer " + "from pointer without a cast"), + G_("assignment makes integer from pointer " + "without a cast"), + G_("initialization makes integer from pointer " + "without a cast"), + G_("return makes integer from pointer " + "without a cast")); return convert (type, rhs); } else if (codel == BOOLEAN_TYPE && coder == POINTER_TYPE) return convert (type, rhs); - if (!errtype) + switch (errtype) { - if (funname) - { - tree selector = objc_message_selector (); - - if (selector && parmnum > 2) - error ("incompatible type for argument %d of `%s'", - parmnum - 2, IDENTIFIER_POINTER (selector)); - else - error ("incompatible type for argument %d of `%s'", - parmnum, IDENTIFIER_POINTER (funname)); - } - else - error ("incompatible type for argument %d of indirect function call", - parmnum); + case ic_argpass: + case ic_argpass_nonproto: + /* ??? This should not be an error when inlining calls to + unprototyped functions. */ + error ("incompatible type for argument %d of %qE", parmnum, rname); + break; + case ic_assign: + error ("incompatible types in assignment"); + break; + case ic_init: + error ("incompatible types in initialization"); + break; + case ic_return: + error ("incompatible types in return"); + break; + default: + gcc_unreachable (); } - else - error ("incompatible types in %s", errtype); return error_mark_node; } /* Convert VALUE for assignment into inlined parameter PARM. ARGNUM - is used for error and waring reporting and indicates which argument + is used for error and warning reporting and indicates which argument is being processed. */ tree @@ -3688,82 +4281,27 @@ c_convert_parm_for_inlining (tree parm, tree value, tree fn, int argnum) { tree ret, type; - /* If FN was prototyped, the value has been converted already - in convert_arguments. */ - if (! value || TYPE_ARG_TYPES (TREE_TYPE (fn))) + /* If FN was prototyped at the call site, the value has been converted + already in convert_arguments. + However, we might see a prototype now that was not in place when + the function call was seen, so check that the VALUE actually matches + PARM before taking an early exit. */ + if (!value + || (TYPE_ARG_TYPES (TREE_TYPE (fn)) + && (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) + == TYPE_MAIN_VARIANT (TREE_TYPE (value))))) return value; type = TREE_TYPE (parm); ret = convert_for_assignment (type, value, - (char *) 0 /* arg passing */, fn, - DECL_NAME (fn), argnum); + ic_argpass_nonproto, fn, + fn, argnum); if (targetm.calls.promote_prototypes (TREE_TYPE (fn)) && INTEGRAL_TYPE_P (type) && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))) ret = default_conversion (ret); return ret; } - -/* Print a warning using MSGID. - It gets OPNAME as its one parameter. - if OPNAME is null and ARGNUM is 0, it is replaced by "passing arg of `FUNCTION'". - Otherwise if OPNAME is null, it is replaced by "passing arg ARGNUM of `FUNCTION'". - FUNCTION and ARGNUM are handled specially if we are building an - Objective-C selector. */ - -static void -warn_for_assignment (const char *msgid, const char *opname, tree function, - int argnum) -{ - if (opname == 0) - { - tree selector = objc_message_selector (); - char * new_opname; - - if (selector && argnum > 2) - { - function = selector; - argnum -= 2; - } - if (argnum == 0) - { - if (function) - { - /* Function name is known; supply it. */ - const char *const argstring = _("passing arg of `%s'"); - new_opname = alloca (IDENTIFIER_LENGTH (function) - + strlen (argstring) + 1 + 1); - sprintf (new_opname, argstring, - IDENTIFIER_POINTER (function)); - } - else - { - /* Function name unknown (call through ptr). */ - const char *const argnofun = _("passing arg of pointer to function"); - new_opname = alloca (strlen (argnofun) + 1 + 1); - sprintf (new_opname, argnofun); - } - } - else if (function) - { - /* Function name is known; supply it. */ - const char *const argstring = _("passing arg %d of `%s'"); - new_opname = alloca (IDENTIFIER_LENGTH (function) - + strlen (argstring) + 1 + 25 /*%d*/ + 1); - sprintf (new_opname, argstring, argnum, - IDENTIFIER_POINTER (function)); - } - else - { - /* Function name unknown (call through ptr); just give arg number. */ - const char *const argnofun = _("passing arg %d of pointer to function"); - new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1); - sprintf (new_opname, argnofun, argnum); - } - opname = new_opname; - } - pedwarn (msgid, opname); -} /* If VALUE is a compound expr all of whose expressions are constant, then return its value. Otherwise, return error_mark_node. @@ -3782,8 +4320,7 @@ valid_compound_expr_initializer (tree value, tree endtype) return valid_compound_expr_initializer (TREE_OPERAND (value, 1), endtype); } - else if (! TREE_CONSTANT (value) - && ! initializer_constant_valid_p (value, endtype)) + else if (!initializer_constant_valid_p (value, endtype)) return error_mark_node; else return value; @@ -3807,13 +4344,14 @@ store_init_value (tree decl, tree init) /* Digest the specified initializer into an expression. */ - value = digest_init (type, init, TREE_STATIC (decl)); + value = digest_init (type, init, true, TREE_STATIC (decl)); /* Store the expression if valid; else report error. */ - if (warn_traditional && !in_system_header - && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && ! TREE_STATIC (decl)) - warning ("traditional C rejects automatic aggregate initialization"); + if (!in_system_header + && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && !TREE_STATIC (decl)) + warning (OPT_Wtraditional, "traditional C rejects automatic " + "aggregate initialization"); DECL_INITIAL (decl) = value; @@ -3828,22 +4366,23 @@ store_init_value (tree decl, tree init) { tree inside_init = init; - if (TREE_CODE (init) == NON_LVALUE_EXPR) - inside_init = TREE_OPERAND (init, 0); + STRIP_TYPE_NOPS (inside_init); inside_init = fold (inside_init); if (TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) { - tree decl = COMPOUND_LITERAL_EXPR_DECL (inside_init); + tree cldecl = COMPOUND_LITERAL_EXPR_DECL (inside_init); - if (TYPE_DOMAIN (TREE_TYPE (decl))) + if (TYPE_DOMAIN (TREE_TYPE (cldecl))) { /* For int foo[] = (int [3]){1}; we need to set array size now since later on array initializer will be just the brace enclosed list of the compound literal. */ - TYPE_DOMAIN (type) = TYPE_DOMAIN (TREE_TYPE (decl)); + type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); + TREE_TYPE (decl) = type; + TYPE_DOMAIN (type) = TYPE_DOMAIN (TREE_TYPE (cldecl)); layout_type (type); - layout_decl (decl, 0); + layout_decl (cldecl, 0); } } } @@ -3859,7 +4398,7 @@ struct spelling int kind; union { - int i; + unsigned HOST_WIDE_INT i; const char *s; } u; }; @@ -3888,11 +4427,8 @@ static int spelling_size; /* Size of the spelling stack. */ if (depth >= spelling_size) \ { \ spelling_size += 10; \ - if (spelling_base == 0) \ - spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \ - else \ - spelling_base = xrealloc (spelling_base, \ - spelling_size * sizeof (struct spelling)); \ + spelling_base = XRESIZEVEC (struct spelling, spelling_base, \ + spelling_size); \ RESTORE_SPELLING_DEPTH (depth); \ } \ \ @@ -3922,7 +4458,7 @@ push_member_name (tree decl) /* Push an array bounds on the stack. Printed as [BOUNDS]. */ static void -push_array_bounds (int bounds) +push_array_bounds (unsigned HOST_WIDE_INT bounds) { PUSH_SPELLING (SPELLING_BOUNDS, bounds, u.i); } @@ -3957,7 +4493,7 @@ print_spelling (char *buffer) for (p = spelling_base; p < spelling; p++) if (p->kind == SPELLING_BOUNDS) { - sprintf (d, "[%d]", p->u.i); + sprintf (d, "[" HOST_WIDE_INT_PRINT_UNSIGNED "]", p->u.i); d += strlen (d); } else @@ -3982,9 +4518,9 @@ error_init (const char *msgid) char *ofwhat; error ("%s", _(msgid)); - ofwhat = print_spelling (alloca (spelling_length () + 1)); + ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); if (*ofwhat) - error ("(near initialization for `%s')", ofwhat); + error ("(near initialization for %qs)", ofwhat); } /* Issue a pedantic warning for a bad initializer component. @@ -3997,9 +4533,9 @@ pedwarn_init (const char *msgid) char *ofwhat; pedwarn ("%s", _(msgid)); - ofwhat = print_spelling (alloca (spelling_length () + 1)); + ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); if (*ofwhat) - pedwarn ("(near initialization for `%s')", ofwhat); + pedwarn ("(near initialization for %qs)", ofwhat); } /* Issue a warning for a bad initializer component. @@ -4011,66 +4547,90 @@ warning_init (const char *msgid) { char *ofwhat; - warning ("%s", _(msgid)); - ofwhat = print_spelling (alloca (spelling_length () + 1)); + warning (0, "%s", _(msgid)); + ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); if (*ofwhat) - warning ("(near initialization for `%s')", ofwhat); + warning (0, "(near initialization for %qs)", ofwhat); } +/* If TYPE is an array type and EXPR is a parenthesized string + constant, warn if pedantic that EXPR is being used to initialize an + object of type TYPE. */ + +void +maybe_warn_string_init (tree type, struct c_expr expr) +{ + if (pedantic + && TREE_CODE (type) == ARRAY_TYPE + && TREE_CODE (expr.value) == STRING_CST + && expr.original_code != STRING_CST) + pedwarn_init ("array initialized from parenthesized string constant"); +} + /* Digest the parser output INIT as an initializer for type TYPE. Return a C expression of type TYPE to represent the initial value. + If INIT is a string constant, STRICT_STRING is true if it is + unparenthesized or we should not warn here for it being parenthesized. + For other types of INIT, STRICT_STRING is not used. + REQUIRE_CONSTANT requests an error if non-constant initializers or elements are seen. */ static tree -digest_init (tree type, tree init, int require_constant) +digest_init (tree type, tree init, bool strict_string, int require_constant) { enum tree_code code = TREE_CODE (type); tree inside_init = init; if (type == error_mark_node + || !init || init == error_mark_node || TREE_TYPE (init) == error_mark_node) return error_mark_node; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (init) == NON_LVALUE_EXPR) - inside_init = TREE_OPERAND (init, 0); + STRIP_TYPE_NOPS (inside_init); inside_init = fold (inside_init); /* Initialization of an array of chars from a string constant optionally enclosed in braces. */ - if (code == ARRAY_TYPE) + if (code == ARRAY_TYPE && inside_init + && TREE_CODE (inside_init) == STRING_CST) { tree typ1 = TYPE_MAIN_VARIANT (TREE_TYPE (type)); - if ((typ1 == char_type_node - || typ1 == signed_char_type_node - || typ1 == unsigned_char_type_node - || typ1 == unsigned_wchar_type_node - || typ1 == signed_wchar_type_node) - && ((inside_init && TREE_CODE (inside_init) == STRING_CST))) + /* Note that an array could be both an array of character type + and an array of wchar_t if wchar_t is signed char or unsigned + char. */ + bool char_array = (typ1 == char_type_node + || typ1 == signed_char_type_node + || typ1 == unsigned_char_type_node); + bool wchar_array = !!comptypes (typ1, wchar_type_node); + if (char_array || wchar_array) { + struct c_expr expr; + bool char_string; + expr.value = inside_init; + expr.original_code = (strict_string ? STRING_CST : ERROR_MARK); + maybe_warn_string_init (type, expr); + + char_string + = (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init))) + == char_type_node); + if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)), - TYPE_MAIN_VARIANT (type), COMPARE_STRICT)) + TYPE_MAIN_VARIANT (type))) return inside_init; - if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init))) - != char_type_node) - && TYPE_PRECISION (typ1) == TYPE_PRECISION (char_type_node)) + if (!wchar_array && !char_string) { error_init ("char-array initialized from wide string"); return error_mark_node; } - if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init))) - == char_type_node) - && TYPE_PRECISION (typ1) != TYPE_PRECISION (char_type_node)) + if (char_string && !char_array) { - error_init ("int-array initialized from non-wide string"); + error_init ("wchar_t-array initialized from non-wide string"); return error_mark_node; } @@ -4092,6 +4652,12 @@ digest_init (tree type, tree init, int require_constant) return inside_init; } + else if (INTEGRAL_TYPE_P (typ1)) + { + error_init ("array of inappropriate type initialized " + "from string constant"); + return error_mark_node; + } } /* Build a VECTOR_CST from a *constant* vector constructor. If the @@ -4104,25 +4670,28 @@ digest_init (tree type, tree init, int require_constant) { if (TREE_CODE (inside_init) == VECTOR_CST && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)), - TYPE_MAIN_VARIANT (type), - COMPARE_STRICT)) + TYPE_MAIN_VARIANT (type))) return inside_init; if (TREE_CODE (inside_init) == CONSTRUCTOR) { - tree link; - - /* Iterate through elements and check if all constructor - elements are *_CSTs. */ - for (link = CONSTRUCTOR_ELTS (inside_init); - link; - link = TREE_CHAIN (link)) - if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (link))) != 'c') - break; - - if (link == NULL) - return build_vector (type, CONSTRUCTOR_ELTS (inside_init)); - } + unsigned HOST_WIDE_INT ix; + tree value; + bool constant_p = true; + + /* Iterate through elements and check if all constructor + elements are *_CSTs. */ + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (inside_init), ix, value) + if (!CONSTANT_CLASS_P (value)) + { + constant_p = false; + break; + } + + if (constant_p) + return build_vector_from_ctor (type, + CONSTRUCTOR_ELTS (inside_init)); + } } /* Any type can be initialized @@ -4130,42 +4699,44 @@ digest_init (tree type, tree init, int require_constant) if (inside_init && TREE_TYPE (inside_init) != 0 && (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)), - TYPE_MAIN_VARIANT (type), COMPARE_STRICT) + TYPE_MAIN_VARIANT (type)) || (code == ARRAY_TYPE - && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT)) + && comptypes (TREE_TYPE (inside_init), type)) || (code == VECTOR_TYPE - && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT)) + && comptypes (TREE_TYPE (inside_init), type)) || (code == POINTER_TYPE && TREE_CODE (TREE_TYPE (inside_init)) == ARRAY_TYPE && comptypes (TREE_TYPE (TREE_TYPE (inside_init)), - TREE_TYPE (type), COMPARE_STRICT)) - || (code == POINTER_TYPE - && TREE_CODE (TREE_TYPE (inside_init)) == FUNCTION_TYPE - && comptypes (TREE_TYPE (inside_init), - TREE_TYPE (type), COMPARE_STRICT)))) + TREE_TYPE (type))))) { if (code == POINTER_TYPE) { - inside_init = default_function_array_conversion (inside_init); - if (TREE_CODE (TREE_TYPE (inside_init)) == ARRAY_TYPE) { - error_init ("invalid use of non-lvalue array"); - return error_mark_node; + if (TREE_CODE (inside_init) == STRING_CST + || TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) + inside_init = array_to_pointer_conversion (inside_init); + else + { + error_init ("invalid use of non-lvalue array"); + return error_mark_node; + } } - } + } if (code == VECTOR_TYPE) /* Although the types are compatible, we may require a conversion. */ inside_init = convert (type, inside_init); - if (require_constant && !flag_isoc99 + if (require_constant + && (code == VECTOR_TYPE || !flag_isoc99) && TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) { /* As an extension, allow initializing objects with static storage duration with compound literals (which are then treated just as - the brace enclosed list they contain). */ + the brace enclosed list they contain). Also allow this for + vectors, as we can only assign them with compound literals. */ tree decl = COMPOUND_LITERAL_EXPR_DECL (inside_init); inside_init = DECL_INITIAL (decl); } @@ -4197,43 +4768,45 @@ digest_init (tree type, tree init, int require_constant) inside_init = error_mark_node; } else if (require_constant - && (!TREE_CONSTANT (inside_init) - /* This test catches things like `7 / 0' which - result in an expression for which TREE_CONSTANT - is true, but which is not actually something - that is a legal constant. We really should not - be using this function, because it is a part of - the back-end. Instead, the expression should - already have been turned into ERROR_MARK_NODE. */ - || !initializer_constant_valid_p (inside_init, - TREE_TYPE (inside_init)))) + && !initializer_constant_valid_p (inside_init, + TREE_TYPE (inside_init))) { error_init ("initializer element is not constant"); inside_init = error_mark_node; } + /* Added to enable additional -Wmissing-format-attribute warnings. */ + if (TREE_CODE (TREE_TYPE (inside_init)) == POINTER_TYPE) + inside_init = convert_for_assignment (type, inside_init, ic_init, NULL_TREE, + NULL_TREE, 0); return inside_init; } /* Handle scalar types, including conversions. */ if (code == INTEGER_TYPE || code == REAL_TYPE || code == POINTER_TYPE - || code == ENUMERAL_TYPE || code == BOOLEAN_TYPE || code == COMPLEX_TYPE) + || code == ENUMERAL_TYPE || code == BOOLEAN_TYPE || code == COMPLEX_TYPE + || code == VECTOR_TYPE) { - /* Note that convert_for_assignment calls default_conversion - for arrays and functions. We must not call it in the - case where inside_init is a null pointer constant. */ + if (TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE + && (TREE_CODE (init) == STRING_CST + || TREE_CODE (init) == COMPOUND_LITERAL_EXPR)) + init = array_to_pointer_conversion (init); inside_init - = convert_for_assignment (type, init, _("initialization"), + = convert_for_assignment (type, init, ic_init, NULL_TREE, NULL_TREE, 0); - if (require_constant && ! TREE_CONSTANT (inside_init)) + /* Check to see if we have already given an error message. */ + if (inside_init == error_mark_node) + ; + else if (require_constant && !TREE_CONSTANT (inside_init)) { error_init ("initializer element is not constant"); inside_init = error_mark_node; } else if (require_constant - && initializer_constant_valid_p (inside_init, TREE_TYPE (inside_init)) == 0) + && !initializer_constant_valid_p (inside_init, + TREE_TYPE (inside_init))) { error_init ("initializer element is not computable at load time"); inside_init = error_mark_node; @@ -4285,7 +4858,7 @@ static tree constructor_bit_index; /* If we are saving up the elements rather than allocating them, this is the list of elements so far (in reverse order, most recent first). */ -static tree constructor_elements; +static VEC(constructor_elt,gc) *constructor_elements; /* 1 if constructor should be incrementally stored into a constructor chain, 0 if all the elements should be kept in AVL tree. */ @@ -4322,17 +4895,11 @@ static struct init_node *constructor_pending_elts; /* The SPELLING_DEPTH of this constructor. */ static int constructor_depth; -/* 0 if implicitly pushing constructor levels is allowed. */ -int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */ - /* DECL node for which an initializer is being read. 0 means we are reading a constructor expression such as (struct foo) {...}. */ static tree constructor_decl; -/* start_init saves the ASMSPEC arg here for really_start_incremental_init. */ -static const char *constructor_asmspec; - /* Nonzero if this is an initializer for a top-level decl. */ static int constructor_top_level; @@ -4343,7 +4910,7 @@ static int constructor_designated; static int designator_depth; /* Nonzero if there were diagnosed errors in this designator list. */ -static int designator_errorneous; +static int designator_erroneous; /* This stack has a level for each implicit or explicit level of @@ -4362,13 +4929,13 @@ struct constructor_stack tree unfilled_index; tree unfilled_fields; tree bit_index; - tree elements; + VEC(constructor_elt,gc) *elements; struct init_node *pending_elts; int offset; int depth; - /* If nonzero, this value should replace the entire + /* If value nonzero, this value should replace the entire constructor at this level. */ - tree replacement_value; + struct c_expr replacement_value; struct constructor_range_stack *range_stack; char constant; char simple; @@ -4379,7 +4946,7 @@ struct constructor_stack char designated; }; -struct constructor_stack *constructor_stack; +static struct constructor_stack *constructor_stack; /* This stack represents designators from some range designator up to the last designator in the list. */ @@ -4394,7 +4961,7 @@ struct constructor_range_stack tree fields; }; -struct constructor_range_stack *constructor_range_stack; +static struct constructor_range_stack *constructor_range_stack; /* This stack records separate initializers that are nested. Nested initializers can't happen in ANSI C, but GNU C allows them @@ -4404,10 +4971,9 @@ struct initializer_stack { struct initializer_stack *next; tree decl; - const char *asmspec; struct constructor_stack *constructor_stack; struct constructor_range_stack *constructor_range_stack; - tree elements; + VEC(constructor_elt,gc) *elements; struct spelling *spelling; struct spelling *spelling_base; int spelling_size; @@ -4416,22 +4982,17 @@ struct initializer_stack char require_constant_elements; }; -struct initializer_stack *initializer_stack; +static struct initializer_stack *initializer_stack; /* Prepare to parse and output the initializer for variable DECL. */ void -start_init (tree decl, tree asmspec_tree, int top_level) +start_init (tree decl, tree asmspec_tree ATTRIBUTE_UNUSED, int top_level) { const char *locus; - struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack)); - const char *asmspec = 0; - - if (asmspec_tree) - asmspec = TREE_STRING_POINTER (asmspec_tree); + struct initializer_stack *p = XNEW (struct initializer_stack); p->decl = constructor_decl; - p->asmspec = constructor_asmspec; p->require_constant_value = require_constant_value; p->require_constant_elements = require_constant_elements; p->constructor_stack = constructor_stack; @@ -4445,11 +5006,10 @@ start_init (tree decl, tree asmspec_tree, int top_level) initializer_stack = p; constructor_decl = decl; - constructor_asmspec = asmspec; constructor_designated = 0; constructor_top_level = top_level; - if (decl != 0) + if (decl != 0 && decl != error_mark_node) { require_constant_value = TREE_STATIC (decl); require_constant_elements @@ -4495,14 +5055,12 @@ finish_init (void) free (q); } - if (constructor_range_stack) - abort (); + gcc_assert (!constructor_range_stack); /* Pop back to the data of the outer initializer (if any). */ free (spelling_base); constructor_decl = p->decl; - constructor_asmspec = p->asmspec; require_constant_value = p->require_constant_value; require_constant_elements = p->require_constant_elements; constructor_stack = p->constructor_stack; @@ -4526,12 +5084,12 @@ finish_init (void) void really_start_incremental_init (tree type) { - struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack)); + struct constructor_stack *p = XNEW (struct constructor_stack); if (type == 0) type = TREE_TYPE (constructor_decl); - if ((*targetm.vector_opaque_p) (type)) + if (targetm.vector_opaque_p (type)) error ("opaque vector types cannot be initialized"); p->type = constructor_type; @@ -4547,7 +5105,8 @@ really_start_incremental_init (tree type) p->erroneous = constructor_erroneous; p->pending_elts = constructor_pending_elts; p->depth = constructor_depth; - p->replacement_value = 0; + p->replacement_value.value = 0; + p->replacement_value.original_code = ERROR_MARK; p->implicit = 0; p->range_stack = 0; p->outer = 0; @@ -4565,7 +5124,7 @@ really_start_incremental_init (tree type) constructor_incremental = 1; constructor_designated = 0; designator_depth = 0; - designator_errorneous = 0; + designator_erroneous = 0; if (TREE_CODE (constructor_type) == RECORD_TYPE || TREE_CODE (constructor_type) == UNION_TYPE) @@ -4589,21 +5148,24 @@ really_start_incremental_init (tree type) /* Detect non-empty initializations of zero-length arrays. */ if (constructor_max_index == NULL_TREE && TYPE_SIZE (constructor_type)) - constructor_max_index = build_int_2 (-1, -1); + constructor_max_index = build_int_cst (NULL_TREE, -1); /* constructor_max_index needs to be an INTEGER_CST. Attempts to initialize VLAs will cause a proper error; avoid tree checking errors as well by setting a safe value. */ if (constructor_max_index && TREE_CODE (constructor_max_index) != INTEGER_CST) - constructor_max_index = build_int_2 (-1, -1); + constructor_max_index = build_int_cst (NULL_TREE, -1); constructor_index = convert (bitsizetype, TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type))); } else - constructor_index = bitsize_zero_node; + { + constructor_index = bitsize_zero_node; + constructor_max_index = NULL_TREE; + } constructor_unfilled_index = constructor_index; } @@ -4611,8 +5173,8 @@ really_start_incremental_init (tree type) { /* Vectors are like simple fixed-size arrays. */ constructor_max_index = - build_int_2 (TYPE_VECTOR_SUBPARTS (constructor_type) - 1, 0); - constructor_index = convert (bitsizetype, bitsize_zero_node); + build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (constructor_type) - 1); + constructor_index = bitsize_zero_node; constructor_unfilled_index = constructor_index; } else @@ -4670,7 +5232,7 @@ push_init_level (int implicit) value = find_init_member (constructor_index); } - p = xmalloc (sizeof (struct constructor_stack)); + p = XNEW (struct constructor_stack); p->type = constructor_type; p->fields = constructor_fields; p->index = constructor_index; @@ -4684,7 +5246,8 @@ push_init_level (int implicit) p->erroneous = constructor_erroneous; p->pending_elts = constructor_pending_elts; p->depth = constructor_depth; - p->replacement_value = 0; + p->replacement_value.value = 0; + p->replacement_value.original_code = ERROR_MARK; p->implicit = implicit; p->outer = 0; p->incremental = constructor_incremental; @@ -4705,7 +5268,7 @@ push_init_level (int implicit) p->range_stack = constructor_range_stack; constructor_range_stack = 0; designator_depth = 0; - designator_errorneous = 0; + designator_erroneous = 0; } /* Don't die if an entire brace-pair level is superfluous @@ -4728,7 +5291,7 @@ push_init_level (int implicit) else if (TREE_CODE (constructor_type) == ARRAY_TYPE) { constructor_type = TREE_TYPE (constructor_type); - push_array_bounds (tree_low_cst (constructor_index, 0)); + push_array_bounds (tree_low_cst (constructor_index, 1)); constructor_depth++; } @@ -4745,7 +5308,7 @@ push_init_level (int implicit) constructor_constant = TREE_CONSTANT (value); constructor_simple = TREE_STATIC (value); constructor_elements = CONSTRUCTOR_ELTS (value); - if (constructor_elements + if (!VEC_empty (constructor_elt, constructor_elements) && (TREE_CODE (constructor_type) == RECORD_TYPE || TREE_CODE (constructor_type) == ARRAY_TYPE)) set_nonincremental_init (); @@ -4773,7 +5336,7 @@ push_init_level (int implicit) { /* Vectors are like simple fixed-size arrays. */ constructor_max_index = - build_int_2 (TYPE_VECTOR_SUBPARTS (constructor_type) - 1, 0); + build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (constructor_type) - 1); constructor_index = convert (bitsizetype, integer_zero_node); constructor_unfilled_index = constructor_index; } @@ -4787,14 +5350,14 @@ push_init_level (int implicit) /* Detect non-empty initializations of zero-length arrays. */ if (constructor_max_index == NULL_TREE && TYPE_SIZE (constructor_type)) - constructor_max_index = build_int_2 (-1, -1); + constructor_max_index = build_int_cst (NULL_TREE, -1); /* constructor_max_index needs to be an INTEGER_CST. Attempts to initialize VLAs will cause a proper error; avoid tree checking errors as well by setting a safe value. */ if (constructor_max_index && TREE_CODE (constructor_max_index) != INTEGER_CST) - constructor_max_index = build_int_2 (-1, -1); + constructor_max_index = build_int_cst (NULL_TREE, -1); constructor_index = convert (bitsizetype, @@ -4814,25 +5377,31 @@ push_init_level (int implicit) } else { - warning_init ("braces around scalar initializer"); + if (constructor_type != error_mark_node) + warning_init ("braces around scalar initializer"); constructor_fields = constructor_type; constructor_unfilled_fields = constructor_type; } } /* At the end of an implicit or explicit brace level, - finish up that level of constructor. - If we were outputting the elements as they are read, return 0 + finish up that level of constructor. If a single expression + with redundant braces initialized that level, return the + c_expr structure for that expression. Otherwise, the original_code + element is set to ERROR_MARK. + If we were outputting the elements as they are read, return 0 as the value from inner levels (process_init_element ignores that), - but return error_mark_node from the outermost level + but return error_mark_node as the value from the outermost level (that's what we want to put in DECL_INITIAL). - Otherwise, return a CONSTRUCTOR expression. */ + Otherwise, return a CONSTRUCTOR expression as the value. */ -tree +struct c_expr pop_init_level (int implicit) { struct constructor_stack *p; - tree constructor = 0; + struct c_expr ret; + ret.value = 0; + ret.original_code = ERROR_MARK; if (implicit == 0) { @@ -4841,8 +5410,7 @@ pop_init_level (int implicit) while (constructor_stack->implicit) process_init_element (pop_init_level (1)); - if (constructor_range_stack) - abort (); + gcc_assert (!constructor_range_stack); } /* Now output all pending elements. */ @@ -4856,14 +5424,16 @@ pop_init_level (int implicit) if (constructor_type && constructor_fields && TREE_CODE (constructor_type) == ARRAY_TYPE && TYPE_DOMAIN (constructor_type) - && ! TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type))) + && !TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type))) { /* Silently discard empty initializations. The parser will already have pedwarned for empty brackets. */ if (integer_zerop (constructor_unfilled_index)) constructor_type = NULL_TREE; - else if (! TYPE_SIZE (constructor_type)) + else { + gcc_assert (!TYPE_SIZE (constructor_type)); + if (constructor_depth > 2) error_init ("initialization of flexible array member in a nested context"); else if (pedantic) @@ -4871,25 +5441,21 @@ pop_init_level (int implicit) /* We have already issued an error message for the existence of a flexible array member not at the end of the structure. - Discard the initializer so that we do not abort later. */ + Discard the initializer so that we do not die later. */ if (TREE_CHAIN (constructor_fields) != NULL_TREE) constructor_type = NULL_TREE; } - else - /* Zero-length arrays are no longer special, so we should no longer - get here. */ - abort (); } /* Warn when some struct elements are implicitly initialized to zero. */ - if (extra_warnings + if (warn_missing_field_initializers && constructor_type && TREE_CODE (constructor_type) == RECORD_TYPE && constructor_unfilled_fields) { /* Do not warn for flexible array members or zero-length arrays. */ while (constructor_unfilled_fields - && (! DECL_SIZE (constructor_unfilled_fields) + && (!DECL_SIZE (constructor_unfilled_fields) || integer_zerop (DECL_SIZE (constructor_unfilled_fields)))) constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields); @@ -4904,10 +5470,10 @@ pop_init_level (int implicit) } /* Pad out the end of the structure. */ - if (p->replacement_value) + if (p->replacement_value.value) /* If this closes a superfluous brace pair, just pass out the element between them. */ - constructor = p->replacement_value; + ret = p->replacement_value; else if (constructor_type == 0) ; else if (TREE_CODE (constructor_type) != RECORD_TYPE @@ -4917,32 +5483,32 @@ pop_init_level (int implicit) { /* A nonincremental scalar initializer--just return the element, after verifying there is just one. */ - if (constructor_elements == 0) + if (VEC_empty (constructor_elt,constructor_elements)) { if (!constructor_erroneous) error_init ("empty scalar initializer"); - constructor = error_mark_node; + ret.value = error_mark_node; } - else if (TREE_CHAIN (constructor_elements) != 0) + else if (VEC_length (constructor_elt,constructor_elements) != 1) { error_init ("extra elements in scalar initializer"); - constructor = TREE_VALUE (constructor_elements); + ret.value = VEC_index (constructor_elt,constructor_elements,0)->value; } else - constructor = TREE_VALUE (constructor_elements); + ret.value = VEC_index (constructor_elt,constructor_elements,0)->value; } else { if (constructor_erroneous) - constructor = error_mark_node; + ret.value = error_mark_node; else { - constructor = build_constructor (constructor_type, - nreverse (constructor_elements)); + ret.value = build_constructor (constructor_type, + constructor_elements); if (constructor_constant) - TREE_CONSTANT (constructor) = 1; + TREE_CONSTANT (ret.value) = TREE_INVARIANT (ret.value) = 1; if (constructor_constant && constructor_simple) - TREE_STATIC (constructor) = 1; + TREE_STATIC (ret.value) = 1; } } @@ -4968,13 +5534,9 @@ pop_init_level (int implicit) constructor_stack = p->next; free (p); - if (constructor == 0) - { - if (constructor_stack == 0) - return error_mark_node; - return NULL_TREE; - } - return constructor; + if (ret.value == 0 && constructor_stack == 0) + ret.value = error_mark_node; + return ret; } /* Common handling for both array range and field name designators. @@ -4991,14 +5553,14 @@ set_designator (int array) if (constructor_type == 0) return 1; - /* If there were errors in this designator list already, bail out silently. */ - if (designator_errorneous) + /* If there were errors in this designator list already, bail out + silently. */ + if (designator_erroneous) return 1; if (!designator_depth) { - if (constructor_range_stack) - abort (); + gcc_assert (!constructor_range_stack); /* Designator list starts at the level of closest explicit braces. */ @@ -5008,25 +5570,20 @@ set_designator (int array) return 0; } - if (constructor_no_implicit) - { - error_init ("initialization designators may not nest"); - return 1; - } - - if (TREE_CODE (constructor_type) == RECORD_TYPE - || TREE_CODE (constructor_type) == UNION_TYPE) + switch (TREE_CODE (constructor_type)) { + case RECORD_TYPE: + case UNION_TYPE: subtype = TREE_TYPE (constructor_fields); if (subtype != error_mark_node) subtype = TYPE_MAIN_VARIANT (subtype); - } - else if (TREE_CODE (constructor_type) == ARRAY_TYPE) - { + break; + case ARRAY_TYPE: subtype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type)); + break; + default: + gcc_unreachable (); } - else - abort (); subcode = TREE_CODE (subtype); if (array && subcode != ARRAY_TYPE) @@ -5054,7 +5611,7 @@ push_range_stack (tree range_end) { struct constructor_range_stack *p; - p = ggc_alloc (sizeof (struct constructor_range_stack)); + p = GGC_NEW (struct constructor_range_stack); p->prev = constructor_range_stack; p->next = 0; p->fields = constructor_fields; @@ -5077,22 +5634,14 @@ set_init_index (tree first, tree last) if (set_designator (1)) return; - designator_errorneous = 1; + designator_erroneous = 1; - while ((TREE_CODE (first) == NOP_EXPR - || TREE_CODE (first) == CONVERT_EXPR - || TREE_CODE (first) == NON_LVALUE_EXPR) - && (TYPE_MODE (TREE_TYPE (first)) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (first, 0))))) - first = TREE_OPERAND (first, 0); - - if (last) - while ((TREE_CODE (last) == NOP_EXPR - || TREE_CODE (last) == CONVERT_EXPR - || TREE_CODE (last) == NON_LVALUE_EXPR) - && (TYPE_MODE (TREE_TYPE (last)) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (last, 0))))) - last = TREE_OPERAND (last, 0); + if (!INTEGRAL_TYPE_P (TREE_TYPE (first)) + || (last && !INTEGRAL_TYPE_P (TREE_TYPE (last)))) + { + error_init ("array index in initializer not of integer type"); + return; + } if (TREE_CODE (first) != INTEGER_CST) error_init ("nonconstant array index in initializer"); @@ -5131,7 +5680,7 @@ set_init_index (tree first, tree last) } designator_depth++; - designator_errorneous = 0; + designator_erroneous = 0; if (constructor_range_stack || last) push_range_stack (last); } @@ -5147,7 +5696,7 @@ set_init_label (tree fieldname) if (set_designator (0)) return; - designator_errorneous = 1; + designator_erroneous = 1; if (TREE_CODE (constructor_type) != RECORD_TYPE && TREE_CODE (constructor_type) != UNION_TYPE) @@ -5164,13 +5713,12 @@ set_init_label (tree fieldname) } if (tail == 0) - error ("unknown field `%s' specified in initializer", - IDENTIFIER_POINTER (fieldname)); + error ("unknown field %qE specified in initializer", fieldname); else { constructor_fields = tail; designator_depth++; - designator_errorneous = 0; + designator_erroneous = 0; if (constructor_range_stack) push_range_stack (NULL_TREE); } @@ -5201,6 +5749,8 @@ add_pending_init (tree purpose, tree value) { if (TREE_SIDE_EFFECTS (p->value)) warning_init ("initialized field with side-effects overwritten"); + else if (warn_override_init) + warning_init ("initialized field overwritten"); p->value = value; return; } @@ -5222,13 +5772,15 @@ add_pending_init (tree purpose, tree value) { if (TREE_SIDE_EFFECTS (p->value)) warning_init ("initialized field with side-effects overwritten"); + else if (warn_override_init) + warning_init ("initialized field overwritten"); p->value = value; return; } } } - r = ggc_alloc (sizeof (struct init_node)); + r = GGC_NEW (struct init_node); r->purpose = purpose; r->value = value; @@ -5398,14 +5950,15 @@ add_pending_init (tree purpose, tree value) static void set_nonincremental_init (void) { - tree chain; + unsigned HOST_WIDE_INT ix; + tree index, value; if (TREE_CODE (constructor_type) != RECORD_TYPE && TREE_CODE (constructor_type) != ARRAY_TYPE) return; - for (chain = constructor_elements; chain; chain = TREE_CHAIN (chain)) - add_pending_init (TREE_PURPOSE (chain), TREE_VALUE (chain)); + FOR_EACH_CONSTRUCTOR_ELT (constructor_elements, ix, index, value) + add_pending_init (index, value); constructor_elements = 0; if (TREE_CODE (constructor_type) == RECORD_TYPE) { @@ -5439,18 +5992,17 @@ set_nonincremental_init_from_string (tree str) const char *p, *end; int byte, wchar_bytes, charwidth, bitpos; - if (TREE_CODE (constructor_type) != ARRAY_TYPE) - abort (); + gcc_assert (TREE_CODE (constructor_type) == ARRAY_TYPE); if (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str))) == TYPE_PRECISION (char_type_node)) wchar_bytes = 1; - else if (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str))) - == TYPE_PRECISION (wchar_type_node)) - wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT; else - abort (); - + { + gcc_assert (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str))) + == TYPE_PRECISION (wchar_type_node)); + wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT; + } charwidth = TYPE_PRECISION (char_type_node); type = TREE_TYPE (constructor_type); p = TREE_STRING_POINTER (str); @@ -5481,7 +6033,7 @@ set_nonincremental_init_from_string (tree str) } } - if (!TREE_UNSIGNED (type)) + if (!TYPE_UNSIGNED (type)) { bitpos = ((wchar_bytes - 1) * charwidth) + HOST_BITS_PER_CHAR; if (bitpos < HOST_BITS_PER_WIDE_INT) @@ -5495,7 +6047,7 @@ set_nonincremental_init_from_string (tree str) else if (bitpos == HOST_BITS_PER_WIDE_INT) { if (val[1] < 0) - val[0] = -1; + val[0] = -1; } else if (val[0] & (((HOST_WIDE_INT) 1) << (bitpos - 1 - HOST_BITS_PER_WIDE_INT))) @@ -5503,8 +6055,7 @@ set_nonincremental_init_from_string (tree str) << (bitpos - HOST_BITS_PER_WIDE_INT); } - value = build_int_2 (val[1], val[0]); - TREE_TYPE (value) = type; + value = build_int_cst_wide (type, val[1], val[0]); add_pending_init (purpose, value); } @@ -5559,9 +6110,10 @@ find_init_member (tree field) } else if (TREE_CODE (constructor_type) == UNION_TYPE) { - if (constructor_elements - && TREE_PURPOSE (constructor_elements) == field) - return TREE_VALUE (constructor_elements); + if (!VEC_empty (constructor_elt, constructor_elements) + && (VEC_last (constructor_elt, constructor_elements)->index + == field)) + return VEC_last (constructor_elt, constructor_elements)->value; } return 0; } @@ -5571,27 +6123,34 @@ find_init_member (tree field) Otherwise, collect it in a list from which we will make a CONSTRUCTOR. TYPE is the data type that the containing data type wants here. FIELD is the field (a FIELD_DECL) or the index that this element fills. + If VALUE is a string constant, STRICT_STRING is true if it is + unparenthesized or we should not warn here for it being parenthesized. + For other types of VALUE, STRICT_STRING is not used. PENDING if non-nil means output pending elements that belong right after this element. (PENDING is normally 1; it is 0 while outputting pending elements, to avoid recursion.) */ static void -output_init_element (tree value, tree type, tree field, int pending) +output_init_element (tree value, bool strict_string, tree type, tree field, + int pending) { - if (type == error_mark_node) + constructor_elt *celt; + + if (type == error_mark_node || value == error_mark_node) { constructor_erroneous = 1; return; } - if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE - || (TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE - && !(TREE_CODE (value) == STRING_CST - && TREE_CODE (type) == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE) - && !comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (value)), - TYPE_MAIN_VARIANT (type), COMPARE_STRICT))) - value = default_conversion (value); + if (TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE + && (TREE_CODE (value) == STRING_CST + || TREE_CODE (value) == COMPOUND_LITERAL_EXPR) + && !(TREE_CODE (value) == STRING_CST + && TREE_CODE (type) == ARRAY_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (type))) + && !comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (value)), + TYPE_MAIN_VARIANT (type))) + value = array_to_pointer_conversion (value); if (TREE_CODE (value) == COMPOUND_LITERAL_EXPR && require_constant_value && !flag_isoc99 && pending) @@ -5607,21 +6166,23 @@ output_init_element (tree value, tree type, tree field, int pending) constructor_erroneous = 1; else if (!TREE_CONSTANT (value)) constructor_constant = 0; - else if (initializer_constant_valid_p (value, TREE_TYPE (value)) == 0 + else if (!initializer_constant_valid_p (value, TREE_TYPE (value)) || ((TREE_CODE (constructor_type) == RECORD_TYPE || TREE_CODE (constructor_type) == UNION_TYPE) && DECL_C_BIT_FIELD (field) && TREE_CODE (value) != INTEGER_CST)) constructor_simple = 0; - if (require_constant_value && ! TREE_CONSTANT (value)) + if (!initializer_constant_valid_p (value, TREE_TYPE (value))) { - error_init ("initializer element is not constant"); - value = error_mark_node; + if (require_constant_value) + { + error_init ("initializer element is not constant"); + value = error_mark_node; + } + else if (require_constant_elements) + pedwarn ("initializer element is not computable at load time"); } - else if (require_constant_elements - && initializer_constant_valid_p (value, TREE_TYPE (value)) == 0) - pedwarn ("initializer element is not computable at load time"); /* If this field is empty (and not at the end of structure), don't do anything other than checking the initializer. */ @@ -5633,7 +6194,7 @@ output_init_element (tree value, tree type, tree field, int pending) || TREE_CHAIN (field))))) return; - value = digest_init (type, value, require_constant_value); + value = digest_init (type, value, strict_string, require_constant_value); if (value == error_mark_node) { constructor_erroneous = 1; @@ -5680,10 +6241,13 @@ output_init_element (tree value, tree type, tree field, int pending) return; } else if (TREE_CODE (constructor_type) == UNION_TYPE - && constructor_elements) + && !VEC_empty (constructor_elt, constructor_elements)) { - if (TREE_SIDE_EFFECTS (TREE_VALUE (constructor_elements))) + if (TREE_SIDE_EFFECTS (VEC_last (constructor_elt, + constructor_elements)->value)) warning_init ("initialized field with side-effects overwritten"); + else if (warn_override_init) + warning_init ("initialized field overwritten"); /* We can have just one union field set. */ constructor_elements = 0; @@ -5692,10 +6256,9 @@ output_init_element (tree value, tree type, tree field, int pending) /* Otherwise, output this element either to constructor_elements or to the assembler file. */ - if (field && TREE_CODE (field) == INTEGER_CST) - field = copy_node (field); - constructor_elements - = tree_cons (field, value, constructor_elements); + celt = VEC_safe_push (constructor_elt, gc, constructor_elements, NULL); + celt->index = field; + celt->value = value; /* Advance the variable that indicates sequential elements output. */ if (TREE_CODE (constructor_type) == ARRAY_TYPE) @@ -5753,7 +6316,7 @@ output_pending_init_elements (int all) { if (tree_int_cst_equal (elt->purpose, constructor_unfilled_index)) - output_init_element (elt->value, + output_init_element (elt->value, true, TREE_TYPE (constructor_type), constructor_unfilled_index, 0); else if (tree_int_cst_lt (constructor_unfilled_index, @@ -5807,7 +6370,7 @@ output_pending_init_elements (int all) if (tree_int_cst_equal (elt_bitpos, ctor_unfilled_bitpos)) { constructor_unfilled_fields = elt->purpose; - output_init_element (elt->value, TREE_TYPE (elt->purpose), + output_init_element (elt->value, true, TREE_TYPE (elt->purpose), elt->purpose, 0); } else if (tree_int_cst_lt (ctor_unfilled_bitpos, elt_bitpos)) @@ -5849,7 +6412,7 @@ output_pending_init_elements (int all) /* Ordinarily return, but not if we want to output all and there are elements left. */ - if (! (all && next != 0)) + if (!(all && next != 0)) return; /* If it's not incremental, just skip over the gap, so that after @@ -5874,29 +6437,30 @@ output_pending_init_elements (int all) it calls output_init_element. */ void -process_init_element (tree value) +process_init_element (struct c_expr value) { - tree orig_value = value; - int string_flag = value != 0 && TREE_CODE (value) == STRING_CST; + tree orig_value = value.value; + int string_flag = orig_value != 0 && TREE_CODE (orig_value) == STRING_CST; + bool strict_string = value.original_code == STRING_CST; designator_depth = 0; - designator_errorneous = 0; + designator_erroneous = 0; /* Handle superfluous braces around string cst as in char x[] = {"foo"}; */ if (string_flag && constructor_type && TREE_CODE (constructor_type) == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (constructor_type)) == INTEGER_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (constructor_type)) && integer_zerop (constructor_unfilled_index)) { - if (constructor_stack->replacement_value) - error_init ("excess elements in char array initializer"); + if (constructor_stack->replacement_value.value) + error_init ("excess elements in char array initializer"); constructor_stack->replacement_value = value; return; } - if (constructor_stack->replacement_value != 0) + if (constructor_stack->replacement_value.value != 0) { error_init ("excess elements in struct initializer"); return; @@ -5929,10 +6493,10 @@ process_init_element (tree value) { /* If value is a compound literal and we'll be just using its content, don't put it into a SAVE_EXPR. */ - if (TREE_CODE (value) != COMPOUND_LITERAL_EXPR + if (TREE_CODE (value.value) != COMPOUND_LITERAL_EXPR || !require_constant_value || flag_isoc99) - value = save_expr (value); + value.value = save_expr (value.value); } while (1) @@ -5964,16 +6528,16 @@ process_init_element (tree value) } /* Accept a string constant to initialize a subarray. */ - if (value != 0 + if (value.value != 0 && fieldcode == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (fieldtype)) == INTEGER_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (fieldtype)) && string_flag) - value = orig_value; + value.value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 && !constructor_no_implicit - && value != error_mark_node - && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != fieldtype + else if (value.value != 0 + && value.value != error_mark_node + && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE || fieldcode == UNION_TYPE)) { @@ -5981,10 +6545,11 @@ process_init_element (tree value) continue; } - if (value) + if (value.value) { push_member_name (constructor_fields); - output_init_element (value, fieldtype, constructor_fields, 1); + output_init_element (value.value, strict_string, + fieldtype, constructor_fields, 1); RESTORE_SPELLING_DEPTH (constructor_depth); } else @@ -5993,10 +6558,10 @@ process_init_element (tree value) { /* For a record, keep track of end position of last field. */ if (DECL_SIZE (constructor_fields)) - constructor_bit_index + constructor_bit_index = size_binop (PLUS_EXPR, - bit_position (constructor_fields), - DECL_SIZE (constructor_fields)); + bit_position (constructor_fields), + DECL_SIZE (constructor_fields)); /* If the current field was the first one not yet written out, it isn't now, so update. */ @@ -6045,21 +6610,23 @@ process_init_element (tree value) again on the assumption that this must be conditional on __STDC__ anyway (and we've already complained about the member-designator already). */ - if (warn_traditional && !in_system_header && !constructor_designated - && !(value && (integer_zerop (value) || real_zerop (value)))) - warning ("traditional C rejects initialization of unions"); + if (!in_system_header && !constructor_designated + && !(value.value && (integer_zerop (value.value) + || real_zerop (value.value)))) + warning (OPT_Wtraditional, "traditional C rejects initialization " + "of unions"); /* Accept a string constant to initialize a subarray. */ - if (value != 0 + if (value.value != 0 && fieldcode == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (fieldtype)) == INTEGER_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (fieldtype)) && string_flag) - value = orig_value; + value.value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 && !constructor_no_implicit - && value != error_mark_node - && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != fieldtype + else if (value.value != 0 + && value.value != error_mark_node + && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE || fieldcode == UNION_TYPE)) { @@ -6067,10 +6634,11 @@ process_init_element (tree value) continue; } - if (value) + if (value.value) { push_member_name (constructor_fields); - output_init_element (value, fieldtype, constructor_fields, 1); + output_init_element (value.value, strict_string, + fieldtype, constructor_fields, 1); RESTORE_SPELLING_DEPTH (constructor_depth); } else @@ -6089,16 +6657,16 @@ process_init_element (tree value) enum tree_code eltcode = TREE_CODE (elttype); /* Accept a string constant to initialize a subarray. */ - if (value != 0 + if (value.value != 0 && eltcode == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (elttype)) == INTEGER_TYPE + && INTEGRAL_TYPE_P (TREE_TYPE (elttype)) && string_flag) - value = orig_value; + value.value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 && !constructor_no_implicit - && value != error_mark_node - && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != elttype + else if (value.value != 0 + && value.value != error_mark_node + && TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype && (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE || eltcode == UNION_TYPE)) { @@ -6115,17 +6683,18 @@ process_init_element (tree value) } /* Now output the actual element. */ - if (value) + if (value.value) { - push_array_bounds (tree_low_cst (constructor_index, 0)); - output_init_element (value, elttype, constructor_index, 1); + push_array_bounds (tree_low_cst (constructor_index, 1)); + output_init_element (value.value, strict_string, + elttype, constructor_index, 1); RESTORE_SPELLING_DEPTH (constructor_depth); } constructor_index = size_binop (PLUS_EXPR, constructor_index, bitsize_one_node); - if (! value) + if (!value.value) /* If we are doing the bookkeeping for an element that was directly output as a constructor, we must update constructor_unfilled_index. */ @@ -6135,8 +6704,8 @@ process_init_element (tree value) { tree elttype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type)); - /* Do a basic check of initializer size. Note that vectors - always have a fixed size derived from their type. */ + /* Do a basic check of initializer size. Note that vectors + always have a fixed size derived from their type. */ if (tree_int_cst_lt (constructor_max_index, constructor_index)) { pedwarn_init ("excess elements in vector initializer"); @@ -6144,13 +6713,14 @@ process_init_element (tree value) } /* Now output the actual element. */ - if (value) - output_init_element (value, elttype, constructor_index, 1); + if (value.value) + output_init_element (value.value, strict_string, + elttype, constructor_index, 1); constructor_index = size_binop (PLUS_EXPR, constructor_index, bitsize_one_node); - if (! value) + if (!value.value) /* If we are doing the bookkeeping for an element that was directly output as a constructor, we must update constructor_unfilled_index. */ @@ -6159,15 +6729,17 @@ process_init_element (tree value) /* Handle the sole element allowed in a braced initializer for a scalar variable. */ - else if (constructor_fields == 0) + else if (constructor_type != error_mark_node + && constructor_fields == 0) { pedwarn_init ("excess elements in scalar initializer"); break; } else { - if (value) - output_init_element (value, constructor_type, NULL_TREE, 1); + if (value.value) + output_init_element (value.value, strict_string, + constructor_type, NULL_TREE, 1); constructor_fields = 0; } @@ -6182,16 +6754,14 @@ process_init_element (tree value) constructor_range_stack = 0; while (constructor_stack != range_stack->stack) { - if (!constructor_stack->implicit) - abort (); + gcc_assert (constructor_stack->implicit); process_init_element (pop_init_level (1)); } for (p = range_stack; !p->range_end || tree_int_cst_equal (p->index, p->range_end); p = p->prev) { - if (!constructor_stack->implicit) - abort (); + gcc_assert (constructor_stack->implicit); process_init_element (pop_init_level (1)); } @@ -6228,181 +6798,209 @@ process_init_element (tree value) constructor_range_stack = 0; } -/* Build a simple asm-statement, from one string literal. */ +/* Build a complete asm-statement, whose components are a CV_QUALIFIER + (guaranteed to be 'volatile' or null) and ARGS (represented using + an ASM_EXPR node). */ tree -simple_asm_stmt (tree expr) +build_asm_stmt (tree cv_qualifier, tree args) { - STRIP_NOPS (expr); - - if (TREE_CODE (expr) == ADDR_EXPR) - expr = TREE_OPERAND (expr, 0); - - if (TREE_CODE (expr) == STRING_CST) - { - tree stmt; - - /* Simple asm statements are treated as volatile. */ - stmt = add_stmt (build_stmt (ASM_STMT, ridpointers[(int) RID_VOLATILE], - expr, NULL_TREE, NULL_TREE, NULL_TREE)); - ASM_INPUT_P (stmt) = 1; - return stmt; - } - - error ("argument of `asm' is not a constant string"); - return NULL_TREE; + if (!ASM_VOLATILE_P (args) && cv_qualifier) + ASM_VOLATILE_P (args) = 1; + return add_stmt (args); } -/* Build an asm-statement, whose components are a CV_QUALIFIER, a - STRING, some OUTPUTS, some INPUTS, and some CLOBBERS. */ - +/* Build an asm-expr, whose components are a STRING, some OUTPUTS, + some INPUTS, and some CLOBBERS. The latter three may be NULL. + SIMPLE indicates whether there was anything at all after the + string in the asm expression -- asm("blah") and asm("blah" : ) + are subtly different. We use a ASM_EXPR node to represent this. */ tree -build_asm_stmt (tree cv_qualifier, tree string, tree outputs, tree inputs, - tree clobbers) +build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers, + bool simple) { tree tail; + tree args; + int i; + const char *constraint; + const char **oconstraints; + bool allows_mem, allows_reg, is_inout; + int ninputs, noutputs; - if (TREE_CODE (string) != STRING_CST) + ninputs = list_length (inputs); + noutputs = list_length (outputs); + oconstraints = (const char **) alloca (noutputs * sizeof (const char *)); + + string = resolve_asm_operand_names (string, outputs, inputs); + + /* Remove output conversions that change the type but not the mode. */ + for (i = 0, tail = outputs; tail; ++i, tail = TREE_CHAIN (tail)) { - error ("asm template is not a string constant"); + tree output = TREE_VALUE (tail); + + /* ??? Really, this should not be here. Users should be using a + proper lvalue, dammit. But there's a long history of using casts + in the output operands. In cases like longlong.h, this becomes a + primitive form of typechecking -- if the cast can be removed, then + the output operand had a type of the proper width; otherwise we'll + get an error. Gross, but ... */ + STRIP_NOPS (output); + + if (!lvalue_or_else (output, lv_asm)) + output = error_mark_node; + + if (output != error_mark_node + && (TREE_READONLY (output) + || TYPE_READONLY (TREE_TYPE (output)) + || ((TREE_CODE (TREE_TYPE (output)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (output)) == UNION_TYPE) + && C_TYPE_FIELDS_READONLY (TREE_TYPE (output))))) + readonly_error (output, lv_asm); + + constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (tail))); + oconstraints[i] = constraint; + + if (parse_output_constraint (&constraint, i, ninputs, noutputs, + &allows_mem, &allows_reg, &is_inout)) + { + /* If the operand is going to end up in memory, + mark it addressable. */ + if (!allows_reg && !c_mark_addressable (output)) + output = error_mark_node; + } + else + output = error_mark_node; + + TREE_VALUE (tail) = output; + } + + for (i = 0, tail = inputs; tail; ++i, tail = TREE_CHAIN (tail)) + { + tree input; + + constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (tail))); + input = TREE_VALUE (tail); + + if (parse_input_constraint (&constraint, i, ninputs, noutputs, 0, + oconstraints, &allows_mem, &allows_reg)) + { + /* If the operand is going to end up in memory, + mark it addressable. */ + if (!allows_reg && allows_mem) + { + /* Strip the nops as we allow this case. FIXME, this really + should be rejected or made deprecated. */ + STRIP_NOPS (input); + if (!c_mark_addressable (input)) + input = error_mark_node; + } + } + else + input = error_mark_node; + + TREE_VALUE (tail) = input; + } + + args = build_stmt (ASM_EXPR, string, outputs, inputs, clobbers); + + /* asm statements without outputs, including simple ones, are treated + as volatile. */ + ASM_INPUT_P (args) = simple; + ASM_VOLATILE_P (args) = (noutputs == 0); + + return args; +} + +/* Generate a goto statement to LABEL. */ + +tree +c_finish_goto_label (tree label) +{ + tree decl = lookup_label (label); + if (!decl) + return NULL_TREE; + + if (C_DECL_UNJUMPABLE_STMT_EXPR (decl)) + { + error ("jump into statement expression"); return NULL_TREE; } - if (cv_qualifier != NULL_TREE - && cv_qualifier != ridpointers[(int) RID_VOLATILE]) + if (C_DECL_UNJUMPABLE_VM (decl)) { - warning ("%s qualifier ignored on asm", - IDENTIFIER_POINTER (cv_qualifier)); - cv_qualifier = NULL_TREE; + error ("jump into scope of identifier with variably modified type"); + return NULL_TREE; } - /* We can remove output conversions that change the type, - but not the mode. */ - for (tail = outputs; tail; tail = TREE_CHAIN (tail)) + if (!C_DECL_UNDEFINABLE_STMT_EXPR (decl)) { - tree output = TREE_VALUE (tail); - - STRIP_NOPS (output); - TREE_VALUE (tail) = output; - - /* Allow conversions as LHS here. build_modify_expr as called below - will do the right thing with them. */ - while (TREE_CODE (output) == NOP_EXPR - || TREE_CODE (output) == CONVERT_EXPR - || TREE_CODE (output) == FLOAT_EXPR - || TREE_CODE (output) == FIX_TRUNC_EXPR - || TREE_CODE (output) == FIX_FLOOR_EXPR - || TREE_CODE (output) == FIX_ROUND_EXPR - || TREE_CODE (output) == FIX_CEIL_EXPR) - output = TREE_OPERAND (output, 0); - - lvalue_or_else (TREE_VALUE (tail), "invalid lvalue in asm statement"); + /* No jump from outside this statement expression context, so + record that there is a jump from within this context. */ + struct c_label_list *nlist; + nlist = XOBNEW (&parser_obstack, struct c_label_list); + nlist->next = label_context_stack_se->labels_used; + nlist->label = decl; + label_context_stack_se->labels_used = nlist; } - /* Remove output conversions that change the type but not the mode. */ - for (tail = outputs; tail; tail = TREE_CHAIN (tail)) + if (!C_DECL_UNDEFINABLE_VM (decl)) { - tree output = TREE_VALUE (tail); - STRIP_NOPS (output); - TREE_VALUE (tail) = output; + /* No jump from outside this context context of identifiers with + variably modified type, so record that there is a jump from + within this context. */ + struct c_label_list *nlist; + nlist = XOBNEW (&parser_obstack, struct c_label_list); + nlist->next = label_context_stack_vm->labels_used; + nlist->label = decl; + label_context_stack_vm->labels_used = nlist; } - /* Perform default conversions on array and function inputs. - Don't do this for other types as it would screw up operands - expected to be in memory. */ - for (tail = inputs; tail; tail = TREE_CHAIN (tail)) - TREE_VALUE (tail) = default_function_array_conversion (TREE_VALUE (tail)); - - return add_stmt (build_stmt (ASM_STMT, cv_qualifier, string, - outputs, inputs, clobbers)); + TREE_USED (decl) = 1; + return add_stmt (build1 (GOTO_EXPR, void_type_node, decl)); } -/* Expand an ASM statement with operands, handling output operands - that are not variables or INDIRECT_REFS by transforming such - cases into cases that expand_asm_operands can handle. - - Arguments are same as for expand_asm_operands. */ - -void -c_expand_asm_operands (tree string, tree outputs, tree inputs, - tree clobbers, int vol, location_t locus) -{ - int noutputs = list_length (outputs); - int i; - /* o[I] is the place that output number I should be written. */ - tree *o = alloca (noutputs * sizeof (tree)); - tree tail; - - /* Record the contents of OUTPUTS before it is modified. */ - for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++) - { - o[i] = TREE_VALUE (tail); - if (o[i] == error_mark_node) - return; - } - - /* Generate the ASM_OPERANDS insn; store into the TREE_VALUEs of - OUTPUTS some trees for where the values were actually stored. */ - expand_asm_operands (string, outputs, inputs, clobbers, vol, locus); - - /* Copy all the intermediate outputs into the specified outputs. */ - for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++) - { - if (o[i] != TREE_VALUE (tail)) - { - expand_expr (build_modify_expr (o[i], NOP_EXPR, TREE_VALUE (tail)), - NULL_RTX, VOIDmode, EXPAND_NORMAL); - free_temp_slots (); - - /* Restore the original value so that it's correct the next - time we expand this function. */ - TREE_VALUE (tail) = o[i]; - } - /* Detect modification of read-only values. - (Otherwise done by build_modify_expr.) */ - else - { - tree type = TREE_TYPE (o[i]); - if (TREE_READONLY (o[i]) - || TYPE_READONLY (type) - || ((TREE_CODE (type) == RECORD_TYPE - || TREE_CODE (type) == UNION_TYPE) - && C_TYPE_FIELDS_READONLY (type))) - readonly_error (o[i], "modification by `asm'"); - } - } - - /* Those MODIFY_EXPRs could do autoincrements. */ - emit_queue (); -} - -/* Expand a C `return' statement. - RETVAL is the expression for what to return, - or a null pointer for `return;' with no value. */ +/* Generate a computed goto statement to EXPR. */ tree -c_expand_return (tree retval) +c_finish_goto_ptr (tree expr) { - tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)); + if (pedantic) + pedwarn ("ISO C forbids %"); + expr = convert (ptr_type_node, expr); + return add_stmt (build1 (GOTO_EXPR, void_type_node, expr)); +} + +/* Generate a C `return' statement. RETVAL is the expression for what + to return, or a null pointer for `return;' with no value. */ + +tree +c_finish_return (tree retval) +{ + tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)), ret_stmt; + bool no_warning = false; if (TREE_THIS_VOLATILE (current_function_decl)) - warning ("function declared `noreturn' has a `return' statement"); + warning (0, "function declared % has a % statement"); if (!retval) { current_function_returns_null = 1; if ((warn_return_type || flag_isoc99) && valtype != 0 && TREE_CODE (valtype) != VOID_TYPE) - pedwarn_c99 ("`return' with no value, in function returning non-void"); + { + pedwarn_c99 ("% with no value, in " + "function returning non-void"); + no_warning = true; + } } else if (valtype == 0 || TREE_CODE (valtype) == VOID_TYPE) { current_function_returns_null = 1; if (pedantic || TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE) - pedwarn ("`return' with a value, in function returning void"); + pedwarn ("% with a value, in function returning void"); } else { - tree t = convert_for_assignment (valtype, retval, _("return"), + tree t = convert_for_assignment (valtype, retval, ic_return, NULL_TREE, NULL_TREE, 0); tree res = DECL_RESULT (current_function_decl); tree inner; @@ -6431,7 +7029,7 @@ c_expand_return (tree retval) { tree op1 = TREE_OPERAND (inner, 1); - while (! POINTER_TYPE_P (TREE_TYPE (op1)) + while (!POINTER_TYPE_P (TREE_TYPE (op1)) && (TREE_CODE (op1) == NOP_EXPR || TREE_CODE (op1) == NON_LVALUE_EXPR || TREE_CODE (op1) == CONVERT_EXPR)) @@ -6447,14 +7045,15 @@ c_expand_return (tree retval) case ADDR_EXPR: inner = TREE_OPERAND (inner, 0); - while (TREE_CODE_CLASS (TREE_CODE (inner)) == 'r') + while (REFERENCE_CLASS_P (inner) + && TREE_CODE (inner) != INDIRECT_REF) inner = TREE_OPERAND (inner, 0); - if (TREE_CODE (inner) == VAR_DECL - && ! DECL_EXTERNAL (inner) - && ! TREE_STATIC (inner) + if (DECL_P (inner) + && !DECL_EXTERNAL (inner) + && !TREE_STATIC (inner) && DECL_CONTEXT (inner) == current_function_decl) - warning ("function returns address of local variable"); + warning (0, "function returns address of local variable"); break; default: @@ -6464,21 +7063,39 @@ c_expand_return (tree retval) break; } - retval = build (MODIFY_EXPR, TREE_TYPE (res), res, t); + retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t); } - return add_stmt (build_return_stmt (retval)); + ret_stmt = build_stmt (RETURN_EXPR, retval); + TREE_NO_WARNING (ret_stmt) |= no_warning; + return add_stmt (ret_stmt); } struct c_switch { - /* The SWITCH_STMT being built. */ - tree switch_stmt; + /* The SWITCH_EXPR being built. */ + tree switch_expr; + + /* The original type of the testing expression, i.e. before the + default conversion is applied. */ + tree orig_type; + /* A splay-tree mapping the low element of a case range to the high element, or NULL_TREE if there is no high element. Used to determine whether or not a new case label duplicates an old case label. We need a tree, rather than simply a hash table, because of the GNU case range extension. */ splay_tree cases; + + /* Number of nested statement expressions within this switch + statement; if nonzero, case and default labels may not + appear. */ + unsigned int blocked_stmt_expr; + + /* Scope of outermost declarations of identifiers with variably + modified type within this switch statement; if nonzero, case and + default labels may not appear. */ + unsigned int blocked_vm; + /* The next node on the stack. */ struct c_switch *next; }; @@ -6489,51 +7106,55 @@ struct c_switch { during the processing of the body of a function, and we never collect at that point. */ -static struct c_switch *switch_stack; +struct c_switch *c_switch_stack; /* Start a C switch statement, testing expression EXP. Return the new - SWITCH_STMT. */ + SWITCH_EXPR. */ tree c_start_case (tree exp) { - enum tree_code code; - tree type, orig_type = error_mark_node; + tree orig_type = error_mark_node; struct c_switch *cs; if (exp != error_mark_node) { - code = TREE_CODE (TREE_TYPE (exp)); orig_type = TREE_TYPE (exp); - if (! INTEGRAL_TYPE_P (orig_type) - && code != ERROR_MARK) + if (!INTEGRAL_TYPE_P (orig_type)) { - error ("switch quantity not an integer"); + if (orig_type != error_mark_node) + { + error ("switch quantity not an integer"); + orig_type = error_mark_node; + } exp = integer_zero_node; } else { - type = TYPE_MAIN_VARIANT (TREE_TYPE (exp)); + tree type = TYPE_MAIN_VARIANT (orig_type); - if (warn_traditional && !in_system_header + if (!in_system_header && (type == long_integer_type_node || type == long_unsigned_type_node)) - warning ("`long' switch expression not converted to `int' in ISO C"); + warning (OPT_Wtraditional, "% switch expression not " + "converted to % in ISO C"); exp = default_conversion (exp); - type = TREE_TYPE (exp); } } - /* Add this new SWITCH_STMT to the stack. */ - cs = xmalloc (sizeof (*cs)); - cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type); + /* Add this new SWITCH_EXPR to the stack. */ + cs = XNEW (struct c_switch); + cs->switch_expr = build3 (SWITCH_EXPR, orig_type, exp, NULL_TREE, NULL_TREE); + cs->orig_type = orig_type; cs->cases = splay_tree_new (case_compare, NULL, NULL); - cs->next = switch_stack; - switch_stack = cs; + cs->blocked_stmt_expr = 0; + cs->blocked_vm = 0; + cs->next = c_switch_stack; + c_switch_stack = cs; - return add_stmt (switch_stack->switch_stmt); + return add_stmt (cs->switch_expr); } /* Process a case label. */ @@ -6543,26 +7164,38 @@ do_case (tree low_value, tree high_value) { tree label = NULL_TREE; - if (switch_stack) + if (c_switch_stack && !c_switch_stack->blocked_stmt_expr + && !c_switch_stack->blocked_vm) { - bool switch_was_empty_p = (SWITCH_BODY (switch_stack->switch_stmt) == NULL_TREE); - - label = c_add_case_label (switch_stack->cases, - SWITCH_COND (switch_stack->switch_stmt), + label = c_add_case_label (c_switch_stack->cases, + SWITCH_COND (c_switch_stack->switch_expr), + c_switch_stack->orig_type, low_value, high_value); if (label == error_mark_node) label = NULL_TREE; - else if (switch_was_empty_p) - { - /* Attach the first case label to the SWITCH_BODY. */ - SWITCH_BODY (switch_stack->switch_stmt) = TREE_CHAIN (switch_stack->switch_stmt); - TREE_CHAIN (switch_stack->switch_stmt) = NULL_TREE; - } + } + else if (c_switch_stack && c_switch_stack->blocked_stmt_expr) + { + if (low_value) + error ("case label in statement expression not containing " + "enclosing switch statement"); + else + error ("% label in statement expression not containing " + "enclosing switch statement"); + } + else if (c_switch_stack && c_switch_stack->blocked_vm) + { + if (low_value) + error ("case label in scope of identifier with variably modified " + "type not containing enclosing switch statement"); + else + error ("% label in scope of identifier with variably " + "modified type not containing enclosing switch statement"); } else if (low_value) error ("case label not within a switch statement"); else - error ("`default' label not within a switch statement"); + error ("% label not within a switch statement"); return label; } @@ -6570,27 +7203,557 @@ do_case (tree low_value, tree high_value) /* Finish the switch statement. */ void -c_finish_case (void) +c_finish_case (tree body) { - struct c_switch *cs = switch_stack; + struct c_switch *cs = c_switch_stack; + location_t switch_location; - /* If we've not seen any case labels (or a default), we may still - need to chain any statements that were seen as the SWITCH_BODY. */ - if (SWITCH_BODY (cs->switch_stmt) == NULL) - { - SWITCH_BODY (cs->switch_stmt) = TREE_CHAIN (cs->switch_stmt); - TREE_CHAIN (cs->switch_stmt) = NULL_TREE; - } + SWITCH_BODY (cs->switch_expr) = body; - /* Rechain the next statements to the SWITCH_STMT. */ - last_tree = cs->switch_stmt; + /* We must not be within a statement expression nested in the switch + at this point; we might, however, be within the scope of an + identifier with variably modified type nested in the switch. */ + gcc_assert (!cs->blocked_stmt_expr); + + /* Emit warnings as needed. */ + if (EXPR_HAS_LOCATION (cs->switch_expr)) + switch_location = EXPR_LOCATION (cs->switch_expr); + else + switch_location = input_location; + c_do_switch_warnings (cs->cases, switch_location, + TREE_TYPE (cs->switch_expr), + SWITCH_COND (cs->switch_expr)); /* Pop the stack. */ - switch_stack = switch_stack->next; + c_switch_stack = cs->next; splay_tree_delete (cs->cases); - free (cs); + XDELETE (cs); +} + +/* Emit an if statement. IF_LOCUS is the location of the 'if'. COND, + THEN_BLOCK and ELSE_BLOCK are expressions to be used; ELSE_BLOCK + may be null. NESTED_IF is true if THEN_BLOCK contains another IF + statement, and was not surrounded with parenthesis. */ + +void +c_finish_if_stmt (location_t if_locus, tree cond, tree then_block, + tree else_block, bool nested_if) +{ + tree stmt; + + /* Diagnose an ambiguous else if if-then-else is nested inside if-then. */ + if (warn_parentheses && nested_if && else_block == NULL) + { + tree inner_if = then_block; + + /* We know from the grammar productions that there is an IF nested + within THEN_BLOCK. Due to labels and c99 conditional declarations, + it might not be exactly THEN_BLOCK, but should be the last + non-container statement within. */ + while (1) + switch (TREE_CODE (inner_if)) + { + case COND_EXPR: + goto found; + case BIND_EXPR: + inner_if = BIND_EXPR_BODY (inner_if); + break; + case STATEMENT_LIST: + inner_if = expr_last (then_block); + break; + case TRY_FINALLY_EXPR: + case TRY_CATCH_EXPR: + inner_if = TREE_OPERAND (inner_if, 0); + break; + default: + gcc_unreachable (); + } + found: + + if (COND_EXPR_ELSE (inner_if)) + warning (OPT_Wparentheses, + "%Hsuggest explicit braces to avoid ambiguous %", + &if_locus); + } + + empty_body_warning (then_block, else_block); + + stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block); + SET_EXPR_LOCATION (stmt, if_locus); + add_stmt (stmt); } +/* Emit a general-purpose loop construct. START_LOCUS is the location of + the beginning of the loop. COND is the loop condition. COND_IS_FIRST + is false for DO loops. INCR is the FOR increment expression. BODY is + the statement controlled by the loop. BLAB is the break label. CLAB is + the continue label. Everything is allowed to be NULL. */ + +void +c_finish_loop (location_t start_locus, tree cond, tree incr, tree body, + tree blab, tree clab, bool cond_is_first) +{ + tree entry = NULL, exit = NULL, t; + + /* If the condition is zero don't generate a loop construct. */ + if (cond && integer_zerop (cond)) + { + if (cond_is_first) + { + t = build_and_jump (&blab); + SET_EXPR_LOCATION (t, start_locus); + add_stmt (t); + } + } + else + { + tree top = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + + /* If we have an exit condition, then we build an IF with gotos either + out of the loop, or to the top of it. If there's no exit condition, + then we just build a jump back to the top. */ + exit = build_and_jump (&LABEL_EXPR_LABEL (top)); + + if (cond && !integer_nonzerop (cond)) + { + /* Canonicalize the loop condition to the end. This means + generating a branch to the loop condition. Reuse the + continue label, if possible. */ + if (cond_is_first) + { + if (incr || !clab) + { + entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + t = build_and_jump (&LABEL_EXPR_LABEL (entry)); + } + else + t = build1 (GOTO_EXPR, void_type_node, clab); + SET_EXPR_LOCATION (t, start_locus); + add_stmt (t); + } + + t = build_and_jump (&blab); + exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t); + if (cond_is_first) + SET_EXPR_LOCATION (exit, start_locus); + else + SET_EXPR_LOCATION (exit, input_location); + } + + add_stmt (top); + } + + if (body) + add_stmt (body); + if (clab) + add_stmt (build1 (LABEL_EXPR, void_type_node, clab)); + if (incr) + add_stmt (incr); + if (entry) + add_stmt (entry); + if (exit) + add_stmt (exit); + if (blab) + add_stmt (build1 (LABEL_EXPR, void_type_node, blab)); +} + +tree +c_finish_bc_stmt (tree *label_p, bool is_break) +{ + bool skip; + tree label = *label_p; + + /* In switch statements break is sometimes stylistically used after + a return statement. This can lead to spurious warnings about + control reaching the end of a non-void function when it is + inlined. Note that we are calling block_may_fallthru with + language specific tree nodes; this works because + block_may_fallthru returns true when given something it does not + understand. */ + skip = !block_may_fallthru (cur_stmt_list); + + if (!label) + { + if (!skip) + *label_p = label = create_artificial_label (); + } + else if (TREE_CODE (label) == LABEL_DECL) + ; + else switch (TREE_INT_CST_LOW (label)) + { + case 0: + if (is_break) + error ("break statement not within loop or switch"); + else + error ("continue statement not within a loop"); + return NULL_TREE; + + case 1: + gcc_assert (is_break); + error ("break statement used with OpenMP for loop"); + return NULL_TREE; + + default: + gcc_unreachable (); + } + + if (skip) + return NULL_TREE; + + return add_stmt (build1 (GOTO_EXPR, void_type_node, label)); +} + +/* A helper routine for c_process_expr_stmt and c_finish_stmt_expr. */ + +static void +emit_side_effect_warnings (tree expr) +{ + if (expr == error_mark_node) + ; + else if (!TREE_SIDE_EFFECTS (expr)) + { + if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr)) + warning (0, "%Hstatement with no effect", + EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location); + } + else if (warn_unused_value) + warn_if_unused_value (expr, input_location); +} + +/* Process an expression as if it were a complete statement. Emit + diagnostics, but do not call ADD_STMT. */ + +tree +c_process_expr_stmt (tree expr) +{ + if (!expr) + return NULL_TREE; + + if (warn_sequence_point) + verify_sequence_points (expr); + + if (TREE_TYPE (expr) != error_mark_node + && !COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (expr)) + && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) + error ("expression statement has incomplete type"); + + /* If we're not processing a statement expression, warn about unused values. + Warnings for statement expressions will be emitted later, once we figure + out which is the result. */ + if (!STATEMENT_LIST_STMT_EXPR (cur_stmt_list) + && (extra_warnings || warn_unused_value)) + emit_side_effect_warnings (expr); + + /* If the expression is not of a type to which we cannot assign a line + number, wrap the thing in a no-op NOP_EXPR. */ + if (DECL_P (expr) || CONSTANT_CLASS_P (expr)) + expr = build1 (NOP_EXPR, TREE_TYPE (expr), expr); + + if (EXPR_P (expr)) + SET_EXPR_LOCATION (expr, input_location); + + return expr; +} + +/* Emit an expression as a statement. */ + +tree +c_finish_expr_stmt (tree expr) +{ + if (expr) + return add_stmt (c_process_expr_stmt (expr)); + else + return NULL; +} + +/* Do the opposite and emit a statement as an expression. To begin, + create a new binding level and return it. */ + +tree +c_begin_stmt_expr (void) +{ + tree ret; + struct c_label_context_se *nstack; + struct c_label_list *glist; + + /* We must force a BLOCK for this level so that, if it is not expanded + later, there is a way to turn off the entire subtree of blocks that + are contained in it. */ + keep_next_level (); + ret = c_begin_compound_stmt (true); + if (c_switch_stack) + { + c_switch_stack->blocked_stmt_expr++; + gcc_assert (c_switch_stack->blocked_stmt_expr != 0); + } + for (glist = label_context_stack_se->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_STMT_EXPR (glist->label) = 1; + } + nstack = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack->labels_def = NULL; + nstack->labels_used = NULL; + nstack->next = label_context_stack_se; + label_context_stack_se = nstack; + + /* Mark the current statement list as belonging to a statement list. */ + STATEMENT_LIST_STMT_EXPR (ret) = 1; + + return ret; +} + +tree +c_finish_stmt_expr (tree body) +{ + tree last, type, tmp, val; + tree *last_p; + struct c_label_list *dlist, *glist, *glist_prev = NULL; + + body = c_end_compound_stmt (body, true); + if (c_switch_stack) + { + gcc_assert (c_switch_stack->blocked_stmt_expr != 0); + c_switch_stack->blocked_stmt_expr--; + } + /* It is no longer possible to jump to labels defined within this + statement expression. */ + for (dlist = label_context_stack_se->labels_def; + dlist != NULL; + dlist = dlist->next) + { + C_DECL_UNJUMPABLE_STMT_EXPR (dlist->label) = 1; + } + /* It is again possible to define labels with a goto just outside + this statement expression. */ + for (glist = label_context_stack_se->next->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_STMT_EXPR (glist->label) = 0; + glist_prev = glist; + } + if (glist_prev != NULL) + glist_prev->next = label_context_stack_se->labels_used; + else + label_context_stack_se->next->labels_used + = label_context_stack_se->labels_used; + label_context_stack_se = label_context_stack_se->next; + + /* Locate the last statement in BODY. See c_end_compound_stmt + about always returning a BIND_EXPR. */ + last_p = &BIND_EXPR_BODY (body); + last = BIND_EXPR_BODY (body); + + continue_searching: + if (TREE_CODE (last) == STATEMENT_LIST) + { + tree_stmt_iterator i; + + /* This can happen with degenerate cases like ({ }). No value. */ + if (!TREE_SIDE_EFFECTS (last)) + return body; + + /* If we're supposed to generate side effects warnings, process + all of the statements except the last. */ + if (extra_warnings || warn_unused_value) + { + for (i = tsi_start (last); !tsi_one_before_end_p (i); tsi_next (&i)) + emit_side_effect_warnings (tsi_stmt (i)); + } + else + i = tsi_last (last); + last_p = tsi_stmt_ptr (i); + last = *last_p; + } + + /* If the end of the list is exception related, then the list was split + by a call to push_cleanup. Continue searching. */ + if (TREE_CODE (last) == TRY_FINALLY_EXPR + || TREE_CODE (last) == TRY_CATCH_EXPR) + { + last_p = &TREE_OPERAND (last, 0); + last = *last_p; + goto continue_searching; + } + + /* In the case that the BIND_EXPR is not necessary, return the + expression out from inside it. */ + if (last == error_mark_node + || (last == BIND_EXPR_BODY (body) + && BIND_EXPR_VARS (body) == NULL)) + { + /* Do not warn if the return value of a statement expression is + unused. */ + if (EXPR_P (last)) + TREE_NO_WARNING (last) = 1; + return last; + } + + /* Extract the type of said expression. */ + type = TREE_TYPE (last); + + /* If we're not returning a value at all, then the BIND_EXPR that + we already have is a fine expression to return. */ + if (!type || VOID_TYPE_P (type)) + return body; + + /* Now that we've located the expression containing the value, it seems + silly to make voidify_wrapper_expr repeat the process. Create a + temporary of the appropriate type and stick it in a TARGET_EXPR. */ + tmp = create_tmp_var_raw (type, NULL); + + /* Unwrap a no-op NOP_EXPR as added by c_finish_expr_stmt. This avoids + tree_expr_nonnegative_p giving up immediately. */ + val = last; + if (TREE_CODE (val) == NOP_EXPR + && TREE_TYPE (val) == TREE_TYPE (TREE_OPERAND (val, 0))) + val = TREE_OPERAND (val, 0); + + *last_p = build2 (MODIFY_EXPR, void_type_node, tmp, val); + SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last)); + + return build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE); +} + +/* Begin the scope of an identifier of variably modified type, scope + number SCOPE. Jumping from outside this scope to inside it is not + permitted. */ + +void +c_begin_vm_scope (unsigned int scope) +{ + struct c_label_context_vm *nstack; + struct c_label_list *glist; + + gcc_assert (scope > 0); + + /* At file_scope, we don't have to do any processing. */ + if (label_context_stack_vm == NULL) + return; + + if (c_switch_stack && !c_switch_stack->blocked_vm) + c_switch_stack->blocked_vm = scope; + for (glist = label_context_stack_vm->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_VM (glist->label) = 1; + } + nstack = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack->labels_def = NULL; + nstack->labels_used = NULL; + nstack->scope = scope; + nstack->next = label_context_stack_vm; + label_context_stack_vm = nstack; +} + +/* End a scope which may contain identifiers of variably modified + type, scope number SCOPE. */ + +void +c_end_vm_scope (unsigned int scope) +{ + if (label_context_stack_vm == NULL) + return; + if (c_switch_stack && c_switch_stack->blocked_vm == scope) + c_switch_stack->blocked_vm = 0; + /* We may have a number of nested scopes of identifiers with + variably modified type, all at this depth. Pop each in turn. */ + while (label_context_stack_vm->scope == scope) + { + struct c_label_list *dlist, *glist, *glist_prev = NULL; + + /* It is no longer possible to jump to labels defined within this + scope. */ + for (dlist = label_context_stack_vm->labels_def; + dlist != NULL; + dlist = dlist->next) + { + C_DECL_UNJUMPABLE_VM (dlist->label) = 1; + } + /* It is again possible to define labels with a goto just outside + this scope. */ + for (glist = label_context_stack_vm->next->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_VM (glist->label) = 0; + glist_prev = glist; + } + if (glist_prev != NULL) + glist_prev->next = label_context_stack_vm->labels_used; + else + label_context_stack_vm->next->labels_used + = label_context_stack_vm->labels_used; + label_context_stack_vm = label_context_stack_vm->next; + } +} + +/* Begin and end compound statements. This is as simple as pushing + and popping new statement lists from the tree. */ + +tree +c_begin_compound_stmt (bool do_scope) +{ + tree stmt = push_stmt_list (); + if (do_scope) + push_scope (); + return stmt; +} + +tree +c_end_compound_stmt (tree stmt, bool do_scope) +{ + tree block = NULL; + + if (do_scope) + { + if (c_dialect_objc ()) + objc_clear_super_receiver (); + block = pop_scope (); + } + + stmt = pop_stmt_list (stmt); + stmt = c_build_bind_expr (block, stmt); + + /* If this compound statement is nested immediately inside a statement + expression, then force a BIND_EXPR to be created. Otherwise we'll + do the wrong thing for ({ { 1; } }) or ({ 1; { } }). In particular, + STATEMENT_LISTs merge, and thus we can lose track of what statement + was really last. */ + if (cur_stmt_list + && STATEMENT_LIST_STMT_EXPR (cur_stmt_list) + && TREE_CODE (stmt) != BIND_EXPR) + { + stmt = build3 (BIND_EXPR, void_type_node, NULL, stmt, NULL); + TREE_SIDE_EFFECTS (stmt) = 1; + } + + return stmt; +} + +/* Queue a cleanup. CLEANUP is an expression/statement to be executed + when the current scope is exited. EH_ONLY is true when this is not + meant to apply to normal control flow transfer. */ + +void +push_cleanup (tree ARG_UNUSED (decl), tree cleanup, bool eh_only) +{ + enum tree_code code; + tree stmt, list; + bool stmt_expr; + + code = eh_only ? TRY_CATCH_EXPR : TRY_FINALLY_EXPR; + stmt = build_stmt (code, NULL, cleanup); + add_stmt (stmt); + stmt_expr = STATEMENT_LIST_STMT_EXPR (cur_stmt_list); + list = push_stmt_list (); + TREE_OPERAND (stmt, 0) = list; + STATEMENT_LIST_STMT_EXPR (list) = stmt_expr; +} + /* Build a binary-operation expression without default conversions. CODE is the kind of expression to build. This function differs from `build' in several ways: @@ -6613,6 +7776,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree type0, type1; enum tree_code code0, code1; tree op0, op1; + const char *invalid_op_diag; /* Expression code to give to the expression when it is built. Normally this is CODE, which is what the caller asked for, @@ -6656,6 +7820,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, /* Nonzero means set RESULT_TYPE to the common type of the args. */ int common = 0; + /* True means types are compatible as far as ObjC is concerned. */ + bool objc_ok; + if (convert_p) { op0 = default_conversion (orig_op0); @@ -6685,6 +7852,15 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (code0 == ERROR_MARK || code1 == ERROR_MARK) return error_mark_node; + if ((invalid_op_diag + = targetm.invalid_binary_op (code, type0, type1))) + { + error (invalid_op_diag); + return error_mark_node; + } + + objc_ok = objc_compare_types (type0, type1, -3, NULL_TREE); + switch (code) { case PLUS_EXPR: @@ -6701,7 +7877,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, /* Subtraction of two similar pointers. We must subtract them as integers, then divide by object size. */ if (code0 == POINTER_TYPE && code1 == POINTER_TYPE - && comp_target_types (type0, type1, 1)) + && comp_target_types (type0, type1)) return pointer_diff (op0, op1); /* Handle pointer minus int. Just like pointer plus int. */ else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) @@ -6721,15 +7897,22 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case EXACT_DIV_EXPR: /* Floating point division by zero is a legitimate way to obtain infinities and NaNs. */ - if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1)) - warning ("division by zero"); + if (skip_evaluation == 0 && integer_zerop (op1)) + warning (OPT_Wdiv_by_zero, "division by zero"); if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE) && (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE)) { - if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)) + enum tree_code tcode0 = code0, tcode1 = code1; + + if (code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE) + tcode0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0))); + if (code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE) + tcode1 = TREE_CODE (TREE_TYPE (TREE_TYPE (op1))); + + if (!(tcode0 == INTEGER_TYPE && tcode1 == INTEGER_TYPE)) resultcode = RDIV_EXPR; else /* Although it would be tempting to shorten always here, that @@ -6737,9 +7920,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, undefined if the quotient can't be represented in the computation mode. We shorten only if unsigned or if dividing by something we know != -1. */ - shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0)) + shorten = (TYPE_UNSIGNED (TREE_TYPE (orig_op0)) || (TREE_CODE (op1) == INTEGER_CST - && ! integer_all_onesp (op1))); + && !integer_all_onesp (op1))); common = 1; } break; @@ -6755,8 +7938,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case TRUNC_MOD_EXPR: case FLOOR_MOD_EXPR: - if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1)) - warning ("division by zero"); + if (skip_evaluation == 0 && integer_zerop (op1)) + warning (OPT_Wdiv_by_zero, "division by zero"); if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) { @@ -6764,9 +7947,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, on some targets, since the modulo instruction is undefined if the quotient can't be represented in the computation mode. We shorten only if unsigned or if dividing by something we know != -1. */ - shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0)) + shorten = (TYPE_UNSIGNED (TREE_TYPE (orig_op0)) || (TREE_CODE (op1) == INTEGER_CST - && ! integer_all_onesp (op1))); + && !integer_all_onesp (op1))); common = 1; } break; @@ -6801,14 +7984,14 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) { if (tree_int_cst_sgn (op1) < 0) - warning ("right shift count is negative"); + warning (0, "right shift count is negative"); else { - if (! integer_zerop (op1)) + if (!integer_zerop (op1)) short_shift = 1; if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("right shift count >= width of type"); + warning (0, "right shift count >= width of type"); } } @@ -6829,33 +8012,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) { if (tree_int_cst_sgn (op1) < 0) - warning ("left shift count is negative"); + warning (0, "left shift count is negative"); else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("left shift count >= width of type"); - } - - /* Use the type of the value to be shifted. */ - result_type = type0; - /* Convert the shift-count to an integer, regardless of size - of value being shifted. */ - if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node) - op1 = convert (integer_type_node, op1); - /* Avoid converting op1 to result_type later. */ - converted = 1; - } - break; - - case RROTATE_EXPR: - case LROTATE_EXPR: - if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) - { - if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) - { - if (tree_int_cst_sgn (op1) < 0) - warning ("shift count is negative"); - else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("shift count >= width of type"); + warning (0, "left shift count >= width of type"); } /* Use the type of the value to be shifted. */ @@ -6871,8 +8031,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case EQ_EXPR: case NE_EXPR: - if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE)) - warning ("comparing floating point with == or != is unsafe"); + if (code0 == REAL_TYPE || code1 == REAL_TYPE) + warning (OPT_Wfloat_equal, + "comparing floating point with == or != is unsafe"); /* Result of comparison is always int, but don't convert the args to int! */ build_type = integer_type_node; @@ -6888,34 +8049,54 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, /* Anything compares with void *. void * compares with anything. Otherwise, the targets must be compatible and both must be object or both incomplete. */ - if (comp_target_types (type0, type1, 1)) - result_type = common_type (type0, type1); + if (comp_target_types (type0, type1)) + result_type = common_pointer_type (type0, type1); else if (VOID_TYPE_P (tt0)) { /* op0 != orig_op0 detects the case of something whose value is 0 but which isn't a valid null ptr const. */ - if (pedantic && (!integer_zerop (op0) || op0 != orig_op0) + if (pedantic && !null_pointer_constant_p (orig_op0) && TREE_CODE (tt1) == FUNCTION_TYPE) - pedwarn ("ISO C forbids comparison of `void *' with function pointer"); + pedwarn ("ISO C forbids comparison of %" + " with function pointer"); } else if (VOID_TYPE_P (tt1)) { - if (pedantic && (!integer_zerop (op1) || op1 != orig_op1) + if (pedantic && !null_pointer_constant_p (orig_op1) && TREE_CODE (tt0) == FUNCTION_TYPE) - pedwarn ("ISO C forbids comparison of `void *' with function pointer"); + pedwarn ("ISO C forbids comparison of %" + " with function pointer"); } else - pedwarn ("comparison of distinct pointer types lacks a cast"); + /* Avoid warning about the volatile ObjC EH puts on decls. */ + if (!objc_ok) + pedwarn ("comparison of distinct pointer types lacks a cast"); if (result_type == NULL_TREE) result_type = ptr_type_node; } - else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST - && integer_zerop (op1)) - result_type = type0; - else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST - && integer_zerop (op0)) - result_type = type1; + else if (code0 == POINTER_TYPE && null_pointer_constant_p (orig_op1)) + { + if (TREE_CODE (op0) == ADDR_EXPR + && DECL_P (TREE_OPERAND (op0, 0)) + && (TREE_CODE (TREE_OPERAND (op0, 0)) == PARM_DECL + || TREE_CODE (TREE_OPERAND (op0, 0)) == LABEL_DECL + || !DECL_WEAK (TREE_OPERAND (op0, 0)))) + warning (OPT_Waddress, "the address of %qD will never be NULL", + TREE_OPERAND (op0, 0)); + result_type = type0; + } + else if (code1 == POINTER_TYPE && null_pointer_constant_p (orig_op0)) + { + if (TREE_CODE (op1) == ADDR_EXPR + && DECL_P (TREE_OPERAND (op1, 0)) + && (TREE_CODE (TREE_OPERAND (op1, 0)) == PARM_DECL + || TREE_CODE (TREE_OPERAND (op1, 0)) == LABEL_DECL + || !DECL_WEAK (TREE_OPERAND (op1, 0)))) + warning (OPT_Waddress, "the address of %qD will never be NULL", + TREE_OPERAND (op1, 0)); + result_type = type1; + } else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) { result_type = type0; @@ -6928,28 +8109,6 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, } break; - case MAX_EXPR: - case MIN_EXPR: - if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) - && (code1 == INTEGER_TYPE || code1 == REAL_TYPE)) - shorten = 1; - else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) - { - if (comp_target_types (type0, type1, 1)) - { - result_type = common_type (type0, type1); - if (pedantic - && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) - pedwarn ("ISO C forbids ordered comparisons of pointers to functions"); - } - else - { - result_type = ptr_type_node; - pedwarn ("comparison of distinct pointer types lacks a cast"); - } - } - break; - case LE_EXPR: case GE_EXPR: case LT_EXPR: @@ -6960,9 +8119,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, short_compare = 1; else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) { - if (comp_target_types (type0, type1, 1)) + if (comp_target_types (type0, type1)) { - result_type = common_type (type0, type1); + result_type = common_pointer_type (type0, type1); if (!COMPLETE_TYPE_P (TREE_TYPE (type0)) != !COMPLETE_TYPE_P (TREE_TYPE (type1))) pedwarn ("comparison of complete and incomplete pointers"); @@ -6976,15 +8135,13 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, pedwarn ("comparison of distinct pointer types lacks a cast"); } } - else if (code0 == POINTER_TYPE && TREE_CODE (op1) == INTEGER_CST - && integer_zerop (op1)) + else if (code0 == POINTER_TYPE && null_pointer_constant_p (orig_op1)) { result_type = type0; if (pedantic || extra_warnings) pedwarn ("ordered comparison of pointer with integer zero"); } - else if (code1 == POINTER_TYPE && TREE_CODE (op0) == INTEGER_CST - && integer_zerop (op0)) + else if (code1 == POINTER_TYPE && null_pointer_constant_p (orig_op0)) { result_type = type1; if (pedantic) @@ -7002,24 +8159,20 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, } break; - case UNORDERED_EXPR: - case ORDERED_EXPR: - case UNLT_EXPR: - case UNLE_EXPR: - case UNGT_EXPR: - case UNGE_EXPR: - case UNEQ_EXPR: - build_type = integer_type_node; - if (code0 != REAL_TYPE || code1 != REAL_TYPE) - { - error ("unordered comparison on non-floating point argument"); - return error_mark_node; - } - common = 1; - break; - default: - break; + gcc_unreachable (); + } + + if (code0 == ERROR_MARK || code1 == ERROR_MARK) + return error_mark_node; + + if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE + && (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1)) + || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0), + TREE_TYPE (type1)))) + { + binary_op_error (code); + return error_mark_node; } if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE @@ -7031,7 +8184,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE); if (shorten || common || short_compare) - result_type = common_type (type0, type1); + result_type = c_common_type (type0, type1); /* For certain operations (which identify themselves by shorten != 0) if both args were extended from the same smaller type, @@ -7047,12 +8200,35 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (shorten && none_complex) { int unsigned0, unsigned1; - tree arg0 = get_narrower (op0, &unsigned0); - tree arg1 = get_narrower (op1, &unsigned1); - /* UNS is 1 if the operation to be done is an unsigned one. */ - int uns = TREE_UNSIGNED (result_type); + tree arg0, arg1; + int uns; tree type; + /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents + excessive narrowing when we call get_narrower below. For + example, suppose that OP0 is of unsigned int extended + from signed char and that RESULT_TYPE is long long int. + If we explicitly cast OP0 to RESULT_TYPE, OP0 would look + like + + (long long int) (unsigned int) signed_char + + which get_narrower would narrow down to + + (unsigned int) signed char + + If we do not cast OP0 first, get_narrower would return + signed_char, which is inconsistent with the case of the + explicit cast. */ + op0 = convert (result_type, op0); + op1 = convert (result_type, op1); + + arg0 = get_narrower (op0, &unsigned0); + arg1 = get_narrower (op1, &unsigned1); + + /* UNS is 1 if the operation to be done is an unsigned one. */ + uns = TYPE_UNSIGNED (result_type); + final_type = result_type; /* Handle the case that OP0 (or OP1) does not *contain* a conversion @@ -7061,11 +8237,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if ((TYPE_PRECISION (TREE_TYPE (op0)) == TYPE_PRECISION (TREE_TYPE (arg0))) && TREE_TYPE (op0) != final_type) - unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0)); + unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0)); if ((TYPE_PRECISION (TREE_TYPE (op1)) == TYPE_PRECISION (TREE_TYPE (arg1))) && TREE_TYPE (op1) != final_type) - unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1)); + unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1)); /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */ @@ -7120,14 +8296,14 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, final_type = result_type; if (arg0 == op0 && final_type == TREE_TYPE (op0)) - unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0)); + unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0)); if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type) /* We can shorten only if the shift count is less than the number of bits in the smaller type size. */ && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0 /* We cannot drop an unsigned shift after sign-extension. */ - && (!TREE_UNSIGNED (final_type) || unsigned_arg)) + && (!TYPE_UNSIGNED (final_type) || unsigned_arg)) { /* Do an unsigned shift if the operand was zero-extended. */ result_type @@ -7163,8 +8339,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (warn_sign_compare && skip_evaluation == 0) { - int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0)); - int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1)); + int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0)); + int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1)); int unsignedp0, unsignedp1; tree primop0 = get_narrower (op0, &unsignedp0); tree primop1 = get_narrower (op1, &unsignedp1); @@ -7183,14 +8359,15 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, Do not warn if the comparison is being done in a signed type, since the signed type will only be chosen if it can represent all the values of the unsigned type. */ - if (! TREE_UNSIGNED (result_type)) + if (!TYPE_UNSIGNED (result_type)) + /* OK */; + /* Do not warn if both operands are the same signedness. */ + else if (op0_signed == op1_signed) /* OK */; - /* Do not warn if both operands are the same signedness. */ - else if (op0_signed == op1_signed) - /* OK */; else { tree sop, uop; + bool ovf; if (op0_signed) sop = xop0, uop = xop1; @@ -7202,7 +8379,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, constant expression involving such literals or a conditional expression involving such literals) and it is non-negative. */ - if (c_tree_expr_nonnegative_p (sop)) + if (tree_expr_nonnegative_warnv_p (sop, &ovf)) /* OK */; /* Do not warn if the comparison is an equality operation, the unsigned quantity is an integral constant, and it @@ -7218,11 +8395,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, else if (TREE_CODE (uop) == INTEGER_CST && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE && int_fits_type_p - (TYPE_MAX_VALUE (TREE_TYPE(uop)), + (TYPE_MAX_VALUE (TREE_TYPE (uop)), c_common_signed_type (result_type))) /* OK */; else - warning ("comparison between signed and unsigned"); + warning (0, "comparison between signed and unsigned"); } /* Warn if two unsigned values are being compared in a size @@ -7266,9 +8443,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (bits < TYPE_PRECISION (result_type) && bits < HOST_BITS_PER_WIDE_INT && unsignedp) { - mask = (~ (HOST_WIDE_INT) 0) << bits; + mask = (~(HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) - warning ("comparison of promoted ~unsigned with constant"); + warning (0, "comparison of promoted ~unsigned with constant"); } } else if (unsignedp0 && unsignedp1 @@ -7276,7 +8453,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type))) - warning ("comparison of promoted ~unsigned with unsigned"); + warning (0, "comparison of promoted ~unsigned with unsigned"); } } } @@ -7294,28 +8471,330 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, return error_mark_node; } - if (! converted) + if (!converted) { if (TREE_TYPE (op0) != result_type) - op0 = convert (result_type, op0); + op0 = convert_and_check (result_type, op0); if (TREE_TYPE (op1) != result_type) - op1 = convert (result_type, op1); + op1 = convert_and_check (result_type, op1); + + /* This can happen if one operand has a vector type, and the other + has a different type. */ + if (TREE_CODE (op0) == ERROR_MARK || TREE_CODE (op1) == ERROR_MARK) + return error_mark_node; } if (build_type == NULL_TREE) build_type = result_type; { - tree result = build (resultcode, build_type, op0, op1); - tree folded; - /* Treat expressions in initializers specially as they can't trap. */ - folded = require_constant_value ? fold_initializer (result) - : fold (result); - if (folded == result) - TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1); + tree result = require_constant_value ? fold_build2_initializer (resultcode, + build_type, + op0, op1) + : fold_build2 (resultcode, build_type, + op0, op1); + if (final_type != 0) - return convert (final_type, folded); - return folded; + result = convert (final_type, result); + return result; } } + + +/* Convert EXPR to be a truth-value, validating its type for this + purpose. */ + +tree +c_objc_common_truthvalue_conversion (tree expr) +{ + switch (TREE_CODE (TREE_TYPE (expr))) + { + case ARRAY_TYPE: + error ("used array that cannot be converted to pointer where scalar is required"); + return error_mark_node; + + case RECORD_TYPE: + error ("used struct type value where scalar is required"); + return error_mark_node; + + case UNION_TYPE: + error ("used union type value where scalar is required"); + return error_mark_node; + + case FUNCTION_TYPE: + gcc_unreachable (); + + default: + break; + } + + /* ??? Should we also give an error for void and vectors rather than + leaving those to give errors later? */ + return c_common_truthvalue_conversion (expr); +} + + +/* Convert EXPR to a contained DECL, updating *TC, *TI and *SE as + required. */ + +tree +c_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED, + bool *ti ATTRIBUTE_UNUSED, bool *se) +{ + if (TREE_CODE (expr) == COMPOUND_LITERAL_EXPR) + { + tree decl = COMPOUND_LITERAL_EXPR_DECL (expr); + /* Executing a compound literal inside a function reinitializes + it. */ + if (!TREE_STATIC (decl)) + *se = true; + return decl; + } + else + return expr; +} + +/* Like c_begin_compound_stmt, except force the retention of the BLOCK. */ + +tree +c_begin_omp_parallel (void) +{ + tree block; + + keep_next_level (); + block = c_begin_compound_stmt (true); + + return block; +} + +tree +c_finish_omp_parallel (tree clauses, tree block) +{ + tree stmt; + + block = c_end_compound_stmt (block, true); + + stmt = make_node (OMP_PARALLEL); + TREE_TYPE (stmt) = void_type_node; + OMP_PARALLEL_CLAUSES (stmt) = clauses; + OMP_PARALLEL_BODY (stmt) = block; + + return add_stmt (stmt); +} + +/* For all elements of CLAUSES, validate them vs OpenMP constraints. + Remove any elements from the list that are invalid. */ + +tree +c_finish_omp_clauses (tree clauses) +{ + bitmap_head generic_head, firstprivate_head, lastprivate_head; + tree c, t, *pc = &clauses; + const char *name; + + bitmap_obstack_initialize (NULL); + bitmap_initialize (&generic_head, &bitmap_default_obstack); + bitmap_initialize (&firstprivate_head, &bitmap_default_obstack); + bitmap_initialize (&lastprivate_head, &bitmap_default_obstack); + + for (pc = &clauses, c = clauses; c ; c = *pc) + { + bool remove = false; + bool need_complete = false; + bool need_implicitly_determined = false; + + switch (OMP_CLAUSE_CODE (c)) + { + case OMP_CLAUSE_SHARED: + name = "shared"; + need_implicitly_determined = true; + goto check_dup_generic; + + case OMP_CLAUSE_PRIVATE: + name = "private"; + need_complete = true; + need_implicitly_determined = true; + goto check_dup_generic; + + case OMP_CLAUSE_REDUCTION: + name = "reduction"; + need_implicitly_determined = true; + t = OMP_CLAUSE_DECL (c); + if (AGGREGATE_TYPE_P (TREE_TYPE (t)) + || POINTER_TYPE_P (TREE_TYPE (t))) + { + error ("%qE has invalid type for %", t); + remove = true; + } + else if (FLOAT_TYPE_P (TREE_TYPE (t))) + { + enum tree_code r_code = OMP_CLAUSE_REDUCTION_CODE (c); + const char *r_name = NULL; + + switch (r_code) + { + case PLUS_EXPR: + case MULT_EXPR: + case MINUS_EXPR: + break; + case BIT_AND_EXPR: + r_name = "&"; + break; + case BIT_XOR_EXPR: + r_name = "^"; + break; + case BIT_IOR_EXPR: + r_name = "|"; + break; + case TRUTH_ANDIF_EXPR: + r_name = "&&"; + break; + case TRUTH_ORIF_EXPR: + r_name = "||"; + break; + default: + gcc_unreachable (); + } + if (r_name) + { + error ("%qE has invalid type for %", + t, r_name); + remove = true; + } + } + goto check_dup_generic; + + case OMP_CLAUSE_COPYPRIVATE: + name = "copyprivate"; + goto check_dup_generic; + + case OMP_CLAUSE_COPYIN: + name = "copyin"; + t = OMP_CLAUSE_DECL (c); + if (TREE_CODE (t) != VAR_DECL || !DECL_THREAD_LOCAL_P (t)) + { + error ("%qE must be % for %", t); + remove = true; + } + goto check_dup_generic; + + check_dup_generic: + t = OMP_CLAUSE_DECL (c); + if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL) + { + error ("%qE is not a variable in clause %qs", t, name); + remove = true; + } + else if (bitmap_bit_p (&generic_head, DECL_UID (t)) + || bitmap_bit_p (&firstprivate_head, DECL_UID (t)) + || bitmap_bit_p (&lastprivate_head, DECL_UID (t))) + { + error ("%qE appears more than once in data clauses", t); + remove = true; + } + else + bitmap_set_bit (&generic_head, DECL_UID (t)); + break; + + case OMP_CLAUSE_FIRSTPRIVATE: + name = "firstprivate"; + t = OMP_CLAUSE_DECL (c); + need_complete = true; + need_implicitly_determined = true; + if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL) + { + error ("%qE is not a variable in clause %", t); + remove = true; + } + else if (bitmap_bit_p (&generic_head, DECL_UID (t)) + || bitmap_bit_p (&firstprivate_head, DECL_UID (t))) + { + error ("%qE appears more than once in data clauses", t); + remove = true; + } + else + bitmap_set_bit (&firstprivate_head, DECL_UID (t)); + break; + + case OMP_CLAUSE_LASTPRIVATE: + name = "lastprivate"; + t = OMP_CLAUSE_DECL (c); + need_complete = true; + need_implicitly_determined = true; + if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL) + { + error ("%qE is not a variable in clause %", t); + remove = true; + } + else if (bitmap_bit_p (&generic_head, DECL_UID (t)) + || bitmap_bit_p (&lastprivate_head, DECL_UID (t))) + { + error ("%qE appears more than once in data clauses", t); + remove = true; + } + else + bitmap_set_bit (&lastprivate_head, DECL_UID (t)); + break; + + case OMP_CLAUSE_IF: + case OMP_CLAUSE_NUM_THREADS: + case OMP_CLAUSE_SCHEDULE: + case OMP_CLAUSE_NOWAIT: + case OMP_CLAUSE_ORDERED: + case OMP_CLAUSE_DEFAULT: + pc = &OMP_CLAUSE_CHAIN (c); + continue; + + default: + gcc_unreachable (); + } + + if (!remove) + { + t = OMP_CLAUSE_DECL (c); + + if (need_complete) + { + t = require_complete_type (t); + if (t == error_mark_node) + remove = true; + } + + if (need_implicitly_determined) + { + const char *share_name = NULL; + + if (TREE_CODE (t) == VAR_DECL && DECL_THREAD_LOCAL_P (t)) + share_name = "threadprivate"; + else switch (c_omp_predetermined_sharing (t)) + { + case OMP_CLAUSE_DEFAULT_UNSPECIFIED: + break; + case OMP_CLAUSE_DEFAULT_SHARED: + share_name = "shared"; + break; + case OMP_CLAUSE_DEFAULT_PRIVATE: + share_name = "private"; + break; + default: + gcc_unreachable (); + } + if (share_name) + { + error ("%qE is predetermined %qs for %qs", + t, share_name, name); + remove = true; + } + } + } + + if (remove) + *pc = OMP_CLAUSE_CHAIN (c); + else + pc = &OMP_CLAUSE_CHAIN (c); + } + + bitmap_obstack_release (NULL); + return clauses; +} diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt index 7160dabbc55..01f47fcbb74 100644 --- a/contrib/gcc/c.opt +++ b/contrib/gcc/c.opt @@ -1,5 +1,5 @@ ; Options for the C, ObjC, C++ and ObjC++ front ends. -; Copyright (C) 2003 Free Software Foundation, Inc. +; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -7,55 +7,18 @@ ; the terms of the GNU General Public License as published by the Free ; Software Foundation; either version 2, or (at your option) any later ; version. -; +; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY ; WARRANTY; without even the implied warranty of MERCHANTABILITY or ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ; for more details. -; +; ; 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 is processed by the script opts.sh. It is a database of -; command line options, with each record separated by a blank line, -; and each field appearing on its own line. The first field is the -; command-line switch with the leading "-" removed. All options -; beginning with "f" or "W" are implicitly assumed to take a "no-" -; form; this form should not be listed. If you do not want this -; negative form and you want it to be automatically rejected, add -; RejectNegative to the second field. - -; The second field is a space-separated list of which parts of the -; compiler recognize the switch, as declared by "Language" entries. -; If the switch takes an argument, then you should also specify -; "Joined" and/or "Separate" to indicate where the argument can -; appear. If a Joined argument can legitimately be omitted, specify -; "JoinedOrMissing" instead of "Joined". If the argument to a switch -; is a non-negative integer, you can specify "UInteger" and the switch -; decoder will convert the argument for you, or complain to the user -; if the argument is invalid. - -; The third field is the help text to output with --help. This is -; automatically line-wrapped on output. Normally the switch is output -; automatically, with the help text on the right hand side of the -; output. However, if the help text contains a tab character, the -; text to the left of the tab is output instead of the switch, and the -; text to its right forms the help. This is useful for elaborating on -; what type of argument a switch takes, for example. If the second -; field contains "Undocumented" then nothing is output with --help. -; Only do this with good reason like the switch being internal between -; the driver and the front end - it is not an excuse to leave a switch -; undocumented. - -; Comments can appear on their own line anwhere in the file, preceded -; by a semicolon. Whitespace is permitted before the semicolon. - -; For each switch XXX below, an enumeration constant is created by the -; script opts.sh spelt OPT_XXX, but with all non-alphanumeric -; characters replaced with an underscore. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -93,13 +56,17 @@ C ObjC C++ ObjC++ Joined Separate E C ObjC C++ ObjC++ Undocumented +F +C ObjC C++ ObjC++ Joined Separate +-F Add to the end of the main framework include path + H C ObjC C++ ObjC++ Print the name of header files as they are used I C ObjC C++ ObjC++ Joined Separate --I Add to the end of the main include path. -I- gives more include path control; see info documentation +-I Add to the end of the main include path M C ObjC C++ ObjC++ @@ -146,22 +113,36 @@ C ObjC C++ ObjC++ Joined Separate -U Undefine Wabi -C++ ObjC++ +C++ ObjC++ Var(warn_abi) +Warn about things that will change when compiling with an ABI-compliant compiler + +Waddress +C ObjC C++ ObjC++ Var(warn_address) +Warn about suspicious uses of memory addresses Wall C ObjC C++ ObjC++ Enable most warning messages +Wassign-intercept +ObjC ObjC++ Var(warn_assign_intercept) +Warn whenever an Objective-C assignment is being intercepted by the garbage collector + Wbad-function-cast -C ObjC +C ObjC Var(warn_bad_function_cast) Warn about casting functions to incompatible types +Wc++-compat +C ObjC Var(warn_cxx_compat) +Warn about C constructs that are not in the common subset of C and C++ + + Wcast-qual -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_cast_qual) Warn about casts which discard qualifiers Wchar-subscripts -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_char_subscripts) Warn about subscripts whose type is \"char\" Wcomment @@ -173,27 +154,27 @@ C ObjC C++ ObjC++ Synonym for -Wcomment Wconversion -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_conversion) Warn about possibly confusing type conversions Wctor-dtor-privacy -C++ ObjC++ +C++ ObjC++ Var(warn_ctor_dtor_privacy) Warn when all constructors and destructors are private Wdeclaration-after-statement -C ObjC +C ObjC Var(warn_declaration_after_statement) Warn when a declaration is found after a statement Wdeprecated -C++ ObjC++ +C++ ObjC++ Var(warn_deprecated) Init(1) Warn about deprecated compiler features Wdiv-by-zero -C ObjC +C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warn about compile-time integer division by zero Weffc++ -C++ ObjC++ +C++ ObjC++ Var(warn_ecpp) Warn about violations of Effective C++ style rules Wendif-labels @@ -209,7 +190,7 @@ C ObjC RejectNegative Make implicit function declarations an error Wfloat-equal -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_float_equal) Warn if testing floating point numbers for equality Wformat @@ -217,48 +198,53 @@ C ObjC C++ ObjC++ Warn about printf/scanf/strftime/strfmon format string anomalies Wformat-extra-args -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_format_extra_args) Warn if passing too many arguments to a function for its format string Wformat-nonliteral -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warn about format strings that are not literals Wformat-security -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_format_security) Warn about possible security problems with format functions Wformat-y2k -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_format_y2k) Warn about strftime formats yielding 2-digit years Wformat-zero-length -C ObjC +C ObjC Var(warn_format_zero_length) +Warn about zero-length formats Wformat= C ObjC C++ ObjC++ Joined Winit-self -C ObjC C++ ObjC++ -Warn about variables which are initialized to themselves. +C ObjC C++ ObjC++ Var(warn_init_self) +Warn about variables which are initialized to themselves Wimplicit C ObjC C++ ObjC++ Wimplicit-function-declaration -C ObjC +C ObjC Var(mesg_implicit_function_declaration) Init(-1) Warn about implicit function declarations Wimplicit-int -C ObjC +C ObjC Var(warn_implicit_int) Warn when a declaration does not specify a type Wimport C ObjC C++ ObjC++ -Deprecated. This switch has no effect. +Deprecated. This switch has no effect + +Wint-to-pointer-cast +C ObjC Var(warn_int_to_pointer_cast) Init(1) +Warn when there is a cast to a pointer from an integer of a different size Winvalid-offsetof -C++ ObjC++ +C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warn about invalid uses of the \"offsetof\" macro Winvalid-pch @@ -266,7 +252,7 @@ C ObjC C++ ObjC++ Warn about PCH files that are found but not used Wlong-long -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Do not warn about using \"long long\" when -pedantic Wmain @@ -274,19 +260,27 @@ C ObjC Warn about suspicious declarations of \"main\" Wmissing-braces -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_missing_braces) Warn about possibly missing braces around initializers Wmissing-declarations -C ObjC +C ObjC Var(warn_missing_declarations) Warn about global functions without previous declarations +Wmissing-field-initializers +C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1) +Warn about missing fields in struct initializers + Wmissing-format-attribute -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_missing_format_attribute) Warn about functions which might be candidates for format attributes +Wmissing-include-dirs +C ObjC C++ ObjC++ +Warn about user-specified include directories that do not exist + Wmissing-prototypes -C ObjC +C ObjC Var(warn_missing_prototypes) Warn about global functions without prototypes Wmultichar @@ -294,82 +288,111 @@ C ObjC C++ ObjC++ Warn about use of multi-character character constants Wnested-externs -C ObjC +C ObjC Var(warn_nested_externs) Warn about \"extern\" declarations not at file scope Wnon-template-friend -C++ ObjC++ +C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warn when non-templatized friend functions are declared within a template Wnon-virtual-dtor -C++ ObjC++ +C++ ObjC++ Var(warn_nonvdtor) Warn about non-virtual destructors Wnonnull -C ObjC +C ObjC Var(warn_nonnull) +Warn about NULL being passed to argument slots marked as requiring non-NULL + +Wnormalized= +C ObjC C++ ObjC++ Joined +-Wnormalized= Warn about non-normalised Unicode strings Wold-style-cast -C++ ObjC++ +C++ ObjC++ Var(warn_old_style_cast) Warn if a C-style cast is used in a program Wold-style-definition -C ObjC +C ObjC Var(warn_old_style_definition) Warn if an old-style parameter definition is used +Woverlength-strings +C ObjC C++ ObjC++ Var(warn_overlength_strings) Init(-1) +Warn if a string is longer than the maximum portable length specified by the standard + Woverloaded-virtual -C++ ObjC++ +C++ ObjC++ Var(warn_overloaded_virtual) Warn about overloaded virtual function names +Woverride-init +C ObjC Var(warn_override_init) Init(-1) +Warn about overriding initializers without side effects + Wparentheses -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_parentheses) Warn about possibly missing parentheses Wpmf-conversions -C++ ObjC++ +C++ ObjC++ Var(warn_pmf2ptr) Init(1) Warn when converting the type of pointers to member functions Wpointer-arith -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_pointer_arith) Warn about function pointer arithmetic +Wpointer-to-int-cast +C ObjC Var(warn_pointer_to_int_cast) Init(1) +Warn when a pointer is cast to an integer of a different size + +Wpragmas +C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) +Warn about misuses of pragmas + Wprotocol -ObjC ObjC++ +ObjC ObjC++ Var(warn_protocol) Init(1) Warn if inherited methods are unimplemented Wredundant-decls -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_redundant_decls) Warn about multiple declarations of the same object Wreorder -C++ ObjC++ +C++ ObjC++ Var(warn_reorder) Warn when the compiler reorders code Wreturn-type -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_return_type) Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++) Wselector -ObjC ObjC++ +ObjC ObjC++ Var(warn_selector) Warn if a selector has multiple methods Wsequence-point -C ObjC +C ObjC C++ ObjC++ Var(warn_sequence_point) Warn about possible violations of sequence point rules Wsign-compare -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1) Warn about signed-unsigned comparisons Wsign-promo -C++ ObjC++ +C++ ObjC++ Var(warn_sign_promo) Warn when overload promotes from unsigned to signed +Wstrict-null-sentinel +C++ ObjC++ +Warn about uncasted NULL used as sentinel + Wstrict-prototypes -C ObjC +C ObjC Var(warn_strict_prototypes) Warn about unprototyped function declarations +Wstrict-selector-match +ObjC ObjC++ Var(warn_strict_selector_match) +Warn if type signatures of candidate methods do not match exactly + Wsynth -C++ ObjC++ +C++ ObjC++ Var(warn_synth) Warn when synthesis behavior differs from Cfront Wsystem-headers @@ -377,7 +400,7 @@ C ObjC C++ ObjC++ Do not suppress warnings from system headers Wtraditional -C ObjC +C ObjC Var(warn_traditional) Warn about features not present in traditional C Wtrigraphs @@ -385,7 +408,8 @@ C ObjC C++ ObjC++ Warn if trigraphs are encountered that might affect the meaning of the program Wundeclared-selector -ObjC ObjC++ +ObjC ObjC++ Var(warn_undeclared_selector) +Warn about @selector()s without previously declared methods Wundef C ObjC C++ ObjC++ @@ -399,13 +423,21 @@ Wunused-macros C ObjC C++ ObjC++ Warn about macros defined in the main file that are not used -Wwrite-strings +Wvariadic-macros C ObjC C++ ObjC++ -Give strings the type \"array of char\" +Do not warn about using variadic macros when -pedantic + +Wwrite-strings +C ObjC C++ ObjC++ Var(warn_write_strings) +In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard. + +Wpointer-sign +C ObjC Var(warn_pointer_sign) Init(-1) +Warn when a pointer differs in signedness in an assignment ansi C ObjC C++ ObjC++ -A synonym for -std=c89 (for C) or -std=c++98 (for C++). +A synonym for -std=c89 (for C) or -std=c++98 (for C++) d C ObjC C++ ObjC++ Joined @@ -445,10 +477,6 @@ fconserve-space C++ ObjC++ Reduce the size of object files -fconst-strings -C++ ObjC++ -Make string literals \"const char[]\" not \"char[]\" - fconstant-string-class= ObjC ObjC++ Joined -fconst-string-class= Use class for constant strings @@ -461,10 +489,6 @@ fdollars-in-identifiers C ObjC C++ ObjC++ Permit '$' as an identifier character -fdump- -C ObjC C++ ObjC++ Joined RejectNegative --fdump- Dump various compiler internals to a file - felide-constructors C++ ObjC++ @@ -479,20 +503,18 @@ fexec-charset= C ObjC C++ ObjC++ Joined RejectNegative -fexec-charset= Convert all strings and character constants to character set +fextended-identifiers +C ObjC C++ ObjC++ +Permit universal character names (\\u and \\U) in identifiers + finput-charset= C ObjC C++ ObjC++ Joined RejectNegative --finput-charset= Specify the default character set for source files. +-finput-charset= Specify the default character set for source files fexternal-templates C++ ObjC++ -ffixed-form -C ObjC - -ffixed-line-length- -C ObjC Joined - ffor-scope C++ ObjC++ Scope of for-init-statement variables is local to the loop @@ -509,6 +531,10 @@ fgnu-runtime ObjC ObjC++ Generate code for GNU runtime environment +fgnu89-inline +C ObjC Var(flag_gnu89_inline) Init(-1) +Use traditional GNU semantics for inline functions + fguiding-decls C++ ObjC++ @@ -538,6 +564,10 @@ fimplicit-templates C++ ObjC++ Emit implicit instantiations of templates +ffriend-injection +C++ ObjC++ Var(flag_friend_injection) +Inject friend functions into enclosing namespace + flabels-ok C++ ObjC++ @@ -565,10 +595,35 @@ C++ ObjC++ fnonnull-objects C++ ObjC++ +; Generate special '- .cxx_construct' and '- .cxx_destruct' methods +; to initialize any non-POD ivars in Objective-C++ classes. +fobjc-call-cxx-cdtors +ObjC++ Var(flag_objc_call_cxx_cdtors) +Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed + +fobjc-direct-dispatch +ObjC ObjC++ Var(flag_objc_direct_dispatch) +Allow fast jumps to the message dispatcher + +; Nonzero means that we will allow new ObjC exception syntax (@throw, +; @try, etc.) in source code. fobjc-exceptions -ObjC ObjC++ +ObjC ObjC++ Var(flag_objc_exceptions) Enable Objective-C exception and synchronization syntax +fobjc-gc +ObjC ObjC++ Var(flag_objc_gc) +Enable garbage collection (GC) in Objective-C/Objective-C++ programs + +; Nonzero means that we generate NeXT setjmp based exceptions. +fobjc-sjlj-exceptions +ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1) +Enable Objective-C setjmp exception handling runtime + +fopenmp +C ObjC C++ ObjC++ Var(flag_openmp) +Enable OpenMP + foperator-names C++ ObjC++ Recognize C++ kewords like \"compl\" and \"xor\" @@ -580,6 +635,10 @@ Enable optional diagnostics fpch-deps C ObjC C++ ObjC++ +fpch-preprocess +C ObjC C++ ObjC++ +Look for and use PCH files even when preprocessing + fpermissive C++ ObjC++ Downgrade conformance errors to warnings @@ -612,9 +671,6 @@ fshort-wchar C ObjC C++ ObjC++ Force the underlying type for \"wchar_t\" to be \"unsigned short\" -fshow-column -C ObjC C++ ObjC++ - fsigned-bitfields C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield signed @@ -638,12 +694,16 @@ C ObjC C++ ObjC++ Joined RejectNegative UInteger -ftabstop= Distance between tab stops for column reporting ftemplate-depth- -C++ ObjC++ Joined RejectNegative UInteger +C++ ObjC++ Joined RejectNegative UInteger -ftemplate-depth- Specify maximum template instantiation depth fthis-is-variable C++ ObjC++ +fthreadsafe-statics +C++ ObjC++ +-fno-threadsafe-statics Do not generate thread-safe code for initializing local statics + funsigned-bitfields C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield unsigned @@ -656,6 +716,14 @@ fuse-cxa-atexit C++ ObjC++ Use __cxa_atexit to register destructors +fuse-cxa-get-exception-ptr +C++ ObjC++ +Use __cxa_get_exception_ptr in exception handling + +fvisibility-inlines-hidden +C++ ObjC++ +Marks all inlined methods as having hidden visibility + fvtable-gc C++ ObjC++ Discard unused virtual functions @@ -696,6 +764,10 @@ imacros C ObjC C++ ObjC++ Joined Separate -imacros Accept definition of macros in +imultilib +C ObjC C++ ObjC++ Joined Separate +-imultilib Set to be the multilib include subdirectory + include C ObjC C++ ObjC++ Joined Separate -include Include the contents of before other files @@ -712,6 +784,10 @@ isystem C ObjC C++ ObjC++ Joined Separate -isystem Add to the start of the system include path +iquote +C ObjC C++ ObjC++ Joined Separate +-iquote Add to the end of the quote include path + iwithprefix C ObjC C++ ObjC++ Joined Separate -iwithprefix Add to the end of the system include path @@ -723,6 +799,9 @@ C ObjC C++ ObjC++ Joined Separate lang-asm C Undocumented +lang-fortran +C Undocumented + lang-objc C ObjC C++ ObjC++ Undocumented @@ -750,6 +829,10 @@ print-objc-runtime-info ObjC ObjC++ Generate C header of platform-specific features +print-pch-checksum +C ObjC C++ ObjC++ +Print a checksum of the executable for PCH validity checking, and stop + remap C ObjC C++ ObjC++ Remap file names when including files diff --git a/contrib/gcc/caller-save.c b/contrib/gcc/caller-save.c index 7133fe393ab..c81c72c49b6 100644 --- a/contrib/gcc/caller-save.c +++ b/contrib/gcc/caller-save.c @@ -1,6 +1,6 @@ /* Save and restore call-clobbered registers which are live across a call. Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,17 +16,17 @@ for more details. 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. */ #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "rtl.h" +#include "regs.h" #include "insn-config.h" #include "flags.h" -#include "regs.h" #include "hard-reg-set.h" #include "recog.h" #include "basic-block.h" @@ -35,6 +35,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "expr.h" #include "toplev.h" #include "tm_p.h" +#include "addresses.h" #ifndef MAX_MOVE_MAX #define MAX_MOVE_MAX MOVE_MAX @@ -83,10 +84,6 @@ static int n_regs_saved; insn. */ static HARD_REG_SET referenced_regs; -/* Computed in mark_set_regs, holds all registers set by the current - instruction. */ -static HARD_REG_SET this_insn_sets; - static void mark_set_regs (rtx, rtx, void *); static void mark_referenced_regs (rtx); @@ -157,11 +154,10 @@ init_caller_save (void) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (reg_class_contents - [(int) MODE_BASE_REG_CLASS (regno_save_mode [i][1])], i)) + [(int) base_reg_class (regno_save_mode [i][1], PLUS, CONST_INT)], i)) break; - if (i == FIRST_PSEUDO_REGISTER) - abort (); + gcc_assert (i < FIRST_PSEUDO_REGISTER); addr_reg = gen_rtx_REG (Pmode, i); @@ -199,7 +195,7 @@ init_caller_save (void) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (mode = 0 ; mode < MAX_MACHINE_MODE; mode++) if (HARD_REGNO_MODE_OK (i, mode)) - { + { int ok; /* Update the register number and modes of the register @@ -216,7 +212,7 @@ init_caller_save (void) reg_restore_code[i][mode] = recog_memoized (restinsn); /* Now extract both insns and see if we can meet their - constraints. */ + constraints. */ ok = (reg_save_code[i][mode] != -1 && reg_restore_code[i][mode] != -1); if (ok) @@ -232,7 +228,7 @@ init_caller_save (void) reg_save_code[i][mode] = -1; reg_restore_code[i][mode] = -1; } - } + } else { reg_save_code[i][mode] = -1; @@ -300,7 +296,7 @@ setup_save_areas (void) { unsigned int regno = reg_renumber[i]; unsigned int endregno - = regno + HARD_REGNO_NREGS (regno, GET_MODE (regno_reg_rtx[i])); + = regno + hard_regno_nregs[regno][GET_MODE (regno_reg_rtx[i])]; for (r = regno; r < endregno; r++) if (call_used_regs[r]) @@ -371,6 +367,10 @@ save_call_clobbered_regs (void) struct insn_chain *chain, *next; enum machine_mode save_mode [FIRST_PSEUDO_REGISTER]; + /* Computed in mark_set_regs, holds all registers set by the current + instruction. */ + HARD_REG_SET this_insn_sets; + CLEAR_HARD_REG_SET (hard_regs_saved); n_regs_saved = 0; @@ -381,10 +381,9 @@ save_call_clobbered_regs (void) next = chain->next; - if (chain->is_caller_save_insn) - abort (); + gcc_assert (!chain->is_caller_save_insn); - if (GET_RTX_CLASS (code) == 'i') + if (INSN_P (insn)) { /* If some registers have been saved, see if INSN references any of them. We must restore them before the insn if so. */ @@ -410,8 +409,9 @@ save_call_clobbered_regs (void) if (code == CALL_INSN && ! find_reg_note (insn, REG_NORETURN, NULL)) { - int regno; + unsigned regno; HARD_REG_SET hard_regs_to_save; + reg_set_iterator rsi; /* Use the register life information in CHAIN to compute which regs are live during the call. */ @@ -427,34 +427,34 @@ save_call_clobbered_regs (void) /* Look through all live pseudos, mark their hard registers and choose proper mode for saving. */ EXECUTE_IF_SET_IN_REG_SET - (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, - { - int r = reg_renumber[regno]; - int nregs; + (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi) + { + int r = reg_renumber[regno]; + int nregs; + enum machine_mode mode; - if (r >= 0) - { - enum machine_mode mode; - - nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (regno)); - mode = HARD_REGNO_CALLER_SAVE_MODE - (r, nregs, PSEUDO_REGNO_MODE (regno)); - if (GET_MODE_BITSIZE (mode) - > GET_MODE_BITSIZE (save_mode[r])) - save_mode[r] = mode; - while (nregs-- > 0) - SET_HARD_REG_BIT (hard_regs_to_save, r + nregs); - } - else - abort (); - }); + gcc_assert (r >= 0); + nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)]; + mode = HARD_REGNO_CALLER_SAVE_MODE + (r, nregs, PSEUDO_REGNO_MODE (regno)); + if (GET_MODE_BITSIZE (mode) + > GET_MODE_BITSIZE (save_mode[r])) + save_mode[r] = mode; + while (nregs-- > 0) + SET_HARD_REG_BIT (hard_regs_to_save, r + nregs); + } /* Record all registers set in this call insn. These don't need to be saved. N.B. the call insn might set a subreg of a multi-hard-reg pseudo; then the pseudo is considered live during the call, but the subreg that is set isn't. */ CLEAR_HARD_REG_SET (this_insn_sets); - note_stores (PATTERN (insn), mark_set_regs, NULL); + note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets); + /* Sibcalls are considered to set the return value, + compare flow.c:propagate_one_insn. */ + if (SIBLING_CALL_P (insn) && current_function_return_rtx) + mark_set_regs (current_function_return_rtx, NULL_RTX, + &this_insn_sets); /* Compute which hard regs must be saved before this call. */ AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set); @@ -484,41 +484,41 @@ save_call_clobbered_regs (void) if (n_regs_saved) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (TEST_HARD_REG_BIT (hard_regs_saved, regno)) - regno += insert_restore (chain, GET_CODE (insn) == JUMP_INSN, + regno += insert_restore (chain, JUMP_P (insn), regno, MOVE_MAX_WORDS, save_mode); } } } -/* Here from note_stores when an insn stores a value in a register. +/* Here from note_stores, or directly from save_call_clobbered_regs, when + an insn stores a value in a register. Set the proper bit or bits in this_insn_sets. All pseudos that have been assigned hard regs have had their register number changed already, so we can ignore pseudos. */ static void -mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) +mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data) { int regno, endregno, i; enum machine_mode mode = GET_MODE (reg); + HARD_REG_SET *this_insn_sets = data; if (GET_CODE (reg) == SUBREG) { rtx inner = SUBREG_REG (reg); - if (GET_CODE (inner) != REG || REGNO (inner) >= FIRST_PSEUDO_REGISTER) + if (!REG_P (inner) || REGNO (inner) >= FIRST_PSEUDO_REGISTER) return; - - regno = subreg_hard_regno (reg, 1); + regno = subreg_regno (reg); } - else if (GET_CODE (reg) == REG + else if (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER) regno = REGNO (reg); else return; - endregno = regno + HARD_REGNO_NREGS (regno, mode); + endregno = regno + hard_regno_nregs[regno][mode]; for (i = regno; i < endregno; i++) - SET_HARD_REG_BIT (this_insn_sets, i); + SET_HARD_REG_BIT (*this_insn_sets, i); } /* Here from note_stores when an insn stores a value in a register. @@ -535,7 +535,7 @@ add_stored_regs (rtx reg, rtx setter, void *data) if (GET_CODE (setter) == CLOBBER) return; - if (GET_CODE (reg) == SUBREG && GET_CODE (SUBREG_REG (reg)) == REG) + if (GET_CODE (reg) == SUBREG && REG_P (SUBREG_REG (reg))) { offset = subreg_regno_offset (REGNO (SUBREG_REG (reg)), GET_MODE (SUBREG_REG (reg)), @@ -544,11 +544,11 @@ add_stored_regs (rtx reg, rtx setter, void *data) reg = SUBREG_REG (reg); } - if (GET_CODE (reg) != REG || REGNO (reg) >= FIRST_PSEUDO_REGISTER) + if (!REG_P (reg) || REGNO (reg) >= FIRST_PSEUDO_REGISTER) return; regno = REGNO (reg) + offset; - endregno = regno + HARD_REGNO_NREGS (regno, mode); + endregno = regno + hard_regno_nregs[regno][mode]; for (i = regno; i < endregno; i++) SET_REGNO_REG_SET ((regset) data, i); @@ -570,7 +570,7 @@ mark_referenced_regs (rtx x) code = GET_CODE (x); if ((code == REG && REGNO (x) < FIRST_PSEUDO_REGISTER) || code == PC || code == CC0 - || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG + || (code == SUBREG && REG_P (SUBREG_REG (x)) && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER /* If we're setting only part of a multi-word register, we shall mark it as referenced, because the words @@ -595,7 +595,7 @@ mark_referenced_regs (rtx x) if (hardregno >= 0) { - int nregs = HARD_REGNO_NREGS (hardregno, GET_MODE (x)); + int nregs = hard_regno_nregs[hardregno][GET_MODE (x)]; while (nregs-- > 0) SET_HARD_REG_BIT (referenced_regs, hardregno + nregs); } @@ -644,15 +644,13 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, struct insn_chain *new; rtx mem; - /* A common failure mode if register status is not correct in the RTL - is for this routine to be called with a REGNO we didn't expect to - save. That will cause us to write an insn with a (nil) SET_DEST - or SET_SRC. Instead of doing so and causing a crash later, check - for this common case and abort here instead. This will remove one - step in debugging such problems. */ - - if (regno_save_mem[regno][1] == 0) - abort (); + /* A common failure mode if register status is not correct in the + RTL is for this routine to be called with a REGNO we didn't + expect to save. That will cause us to write an insn with a (nil) + SET_DEST or SET_SRC. Instead of doing so and causing a crash + later, check for this common case here instead. This will remove + one step in debugging such problems. */ + gcc_assert (regno_save_mem[regno][1]); /* Get the pattern to emit and update our status. @@ -683,8 +681,10 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]]) mem = adjust_address (mem, save_mode[regno], 0); + else + mem = copy_rtx (mem); pat = gen_rtx_SET (VOIDmode, gen_rtx_REG (GET_MODE (mem), regno), mem); @@ -717,15 +717,13 @@ insert_save (struct insn_chain *chain, int before_p, int regno, struct insn_chain *new; rtx mem; - /* A common failure mode if register status is not correct in the RTL - is for this routine to be called with a REGNO we didn't expect to - save. That will cause us to write an insn with a (nil) SET_DEST - or SET_SRC. Instead of doing so and causing a crash later, check - for this common case and abort here instead. This will remove one + /* A common failure mode if register status is not correct in the + RTL is for this routine to be called with a REGNO we didn't + expect to save. That will cause us to write an insn with a (nil) + SET_DEST or SET_SRC. Instead of doing so and causing a crash + later, check for this common case here. This will remove one step in debugging such problems. */ - - if (regno_save_mem[regno][1] == 0) - abort (); + gcc_assert (regno_save_mem[regno][1]); /* Get the pattern to emit and update our status. @@ -755,8 +753,10 @@ insert_save (struct insn_chain *chain, int before_p, int regno, mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]]) mem = adjust_address (mem, save_mode[regno], 0); + else + mem = copy_rtx (mem); pat = gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (GET_MODE (mem), regno)); @@ -789,7 +789,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) isn't a problem. We do, however, assume here that CALL_INSNs don't reference CC0. Guard against non-INSN's like CODE_LABEL. */ - if ((GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN) + if ((NONJUMP_INSN_P (insn) || JUMP_P (insn)) && before_p && reg_referenced_p (cc0_rtx, PATTERN (insn))) chain = chain->prev, insn = chain->insn; @@ -820,15 +820,13 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) rtx reg = XEXP (link, 0); int regno, i; - if (GET_CODE (reg) != REG) - abort (); - + gcc_assert (REG_P (reg)); regno = REGNO (reg); if (regno >= FIRST_PSEUDO_REGISTER) regno = reg_renumber[regno]; if (regno < 0) continue; - for (i = HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1; + for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1; i >= 0; i--) SET_REGNO_REG_SET (&new->live_throughout, regno + i); } @@ -849,7 +847,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) registers from the live sets, and observe REG_UNUSED notes. */ COPY_REG_SET (&new->live_throughout, &chain->live_throughout); /* Registers that are set in CHAIN->INSN live in the new insn. - (Unless there is a REG_UNUSED note for them, but we don't + (Unless there is a REG_UNUSED note for them, but we don't look for them here.) */ note_stores (PATTERN (chain->insn), add_stored_regs, &new->live_throughout); diff --git a/contrib/gcc/calls.c b/contrib/gcc/calls.c index 86e51842cf5..063e6847e98 100644 --- a/contrib/gcc/calls.c +++ b/contrib/gcc/calls.c @@ -1,6 +1,7 @@ /* Convert function calls to rtl insns, for GNU C compiler. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +17,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -64,11 +65,14 @@ struct arg_data This is not the same register as for normal calls on machines with register windows. */ rtx tail_call_reg; + /* If REG is a PARALLEL, this is a copy of VALUE pulled into the correct + form for emit_group_move. */ + rtx parallel_value; /* If REG was promoted from the actual mode of the argument expression, indicates whether the promotion is sign- or zero-extended. */ int unsignedp; - /* Number of registers to use. 0 means put the whole arg in registers. - Also 0 if not passed in registers. */ + /* Number of bytes to put in registers. 0 means put the whole arg + in registers. Also 0 if not passed in registers. */ int partial; /* Nonzero if argument must be passed on stack. Note that some arguments may be passed on the stack @@ -115,12 +119,9 @@ static sbitmap stored_args_map; returns a BLKmode struct) and expand_call must take special action to make sure the object being constructed does not overlap the argument list for the constructor call. */ -int stack_arg_under_construction; +static int stack_arg_under_construction; -static int calls_function (tree, int); -static int calls_function_1 (tree, int); - -static void emit_call_1 (rtx, tree, tree, HOST_WIDE_INT, HOST_WIDE_INT, +static void emit_call_1 (rtx, tree, tree, tree, HOST_WIDE_INT, HOST_WIDE_INT, HOST_WIDE_INT, rtx, rtx, int, rtx, int, CUMULATIVE_ARGS *); static void precompute_register_parameters (int, struct arg_data *, int *); @@ -134,7 +135,7 @@ static void initialize_argument_information (int, struct arg_data *, struct args_size *, int, tree, tree, CUMULATIVE_ARGS *, int, rtx *, int *, int *, int *, - bool); + bool *, bool); static void compute_argument_addresses (struct arg_data *, rtx, int); static rtx rtx_for_function_call (tree, tree); static void load_register_parameters (struct arg_data *, int, rtx *, int, @@ -142,136 +143,19 @@ static void load_register_parameters (struct arg_data *, int, rtx *, int, static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type, enum machine_mode, int, va_list); static int special_function_p (tree, int); -static rtx try_to_integrate (tree, tree, rtx, int, tree, rtx); static int check_sibcall_argument_overlap_1 (rtx); static int check_sibcall_argument_overlap (rtx, struct arg_data *, int); static int combine_pending_stack_adjustment_and_call (int, struct args_size *, - int); -static tree fix_unsafe_tree (tree); -static bool shift_returned_value (tree, rtx *); + unsigned int); +static tree split_complex_values (tree); +static tree split_complex_types (tree); #ifdef REG_PARM_STACK_SPACE static rtx save_fixed_argument_area (int, rtx, int *, int *); static void restore_fixed_argument_area (rtx, rtx, int, int); #endif -/* If WHICH is 1, return 1 if EXP contains a call to the built-in function - `alloca'. - - If WHICH is 0, return 1 if EXP contains a call to any function. - Actually, we only need return 1 if evaluating EXP would require pushing - arguments on the stack, but that is too difficult to compute, so we just - assume any function call might require the stack. */ - -static tree calls_function_save_exprs; - -static int -calls_function (tree exp, int which) -{ - int val; - - calls_function_save_exprs = 0; - val = calls_function_1 (exp, which); - calls_function_save_exprs = 0; - return val; -} - -/* Recursive function to do the work of above function. */ - -static int -calls_function_1 (tree exp, int which) -{ - int i; - enum tree_code code = TREE_CODE (exp); - int class = TREE_CODE_CLASS (code); - int length = first_rtl_op (code); - - /* If this code is language-specific, we don't know what it will do. */ - if ((int) code >= NUM_TREE_CODES) - return 1; - - switch (code) - { - case CALL_EXPR: - if (which == 0) - return 1; - else if ((TREE_CODE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))) - == FUNCTION_TYPE) - && (TYPE_RETURNS_STACK_DEPRESSED - (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))))) - return 1; - else if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR - && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) - == FUNCTION_DECL) - && (special_function_p (TREE_OPERAND (TREE_OPERAND (exp, 0), 0), - 0) - & ECF_MAY_BE_ALLOCA)) - return 1; - - break; - - case CONSTRUCTOR: - { - tree tem; - - for (tem = CONSTRUCTOR_ELTS (exp); tem != 0; tem = TREE_CHAIN (tem)) - if (calls_function_1 (TREE_VALUE (tem), which)) - return 1; - } - - return 0; - - case SAVE_EXPR: - if (SAVE_EXPR_RTL (exp) != 0) - return 0; - if (value_member (exp, calls_function_save_exprs)) - return 0; - calls_function_save_exprs = tree_cons (NULL_TREE, exp, - calls_function_save_exprs); - return (TREE_OPERAND (exp, 0) != 0 - && calls_function_1 (TREE_OPERAND (exp, 0), which)); - - case BLOCK: - { - tree local; - tree subblock; - - for (local = BLOCK_VARS (exp); local; local = TREE_CHAIN (local)) - if (DECL_INITIAL (local) != 0 - && calls_function_1 (DECL_INITIAL (local), which)) - return 1; - - for (subblock = BLOCK_SUBBLOCKS (exp); - subblock; - subblock = TREE_CHAIN (subblock)) - if (calls_function_1 (subblock, which)) - return 1; - } - return 0; - - case TREE_LIST: - for (; exp != 0; exp = TREE_CHAIN (exp)) - if (calls_function_1 (TREE_VALUE (exp), which)) - return 1; - return 0; - - default: - break; - } - - /* Only expressions and blocks can contain calls. */ - if (! IS_EXPR_CODE_CLASS (class) && class != 'b') - return 0; - - for (i = 0; i < length; i++) - if (TREE_OPERAND (exp, i) != 0 - && calls_function_1 (TREE_OPERAND (exp, i), which)) - return 1; - - return 0; -} - /* Force FUNEXP into a form suitable for the address of a CALL, and return that as an rtx. Also load the static chain register if FNDECL is a nested function. @@ -280,17 +164,9 @@ calls_function_1 (tree exp, int which) CALL_INSN_FUNCTION_USAGE information. */ rtx -prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage, - int reg_parm_seen, int sibcallp) +prepare_call_address (rtx funexp, rtx static_chain_value, + rtx *call_fusage, int reg_parm_seen, int sibcallp) { - rtx static_chain_value = 0; - - funexp = protect_from_queue (funexp, 0); - - if (fndecl != 0) - /* Get possible static chain value for nested function in C. */ - static_chain_value = lookup_static_chain (fndecl); - /* Make a valid memory address and copy constants through pseudo-regs, but not for a constant address if -fno-function-cse. */ if (GET_CODE (funexp) != SYMBOL_REF) @@ -303,18 +179,16 @@ prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage, { #ifndef NO_FUNCTION_CSE if (optimize && ! flag_no_function_cse) -#ifdef NO_RECURSIVE_FUNCTION_CSE - if (fndecl != current_function_decl) -#endif - funexp = force_reg (Pmode, funexp); + funexp = force_reg (Pmode, funexp); #endif } if (static_chain_value != 0) { + static_chain_value = convert_memory_address (Pmode, static_chain_value); emit_move_insn (static_chain_rtx, static_chain_value); - if (GET_CODE (static_chain_rtx) == REG) + if (REG_P (static_chain_rtx)) use_reg (call_fusage, static_chain_rtx); } @@ -362,7 +236,8 @@ prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage, denote registers used by the called function. */ static void -emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UNUSED, +emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED, + tree funtype ATTRIBUTE_UNUSED, HOST_WIDE_INT stack_size ATTRIBUTE_UNUSED, HOST_WIDE_INT rounded_stack_size, HOST_WIDE_INT struct_value_size ATTRIBUTE_UNUSED, @@ -479,7 +354,7 @@ emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UN } else #endif - abort (); + gcc_unreachable (); /* Find the call we just emitted. */ call_insn = last_call_insn (); @@ -506,19 +381,25 @@ emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UN REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, const0_rtx, REG_NOTES (call_insn)); else - note_eh_region_may_contain_throw (); + { + int rn = lookup_stmt_eh_region (fntree); + + /* If rn < 0, then either (1) tree-ssa not used or (2) doesn't + throw, which we already took care of. */ + if (rn > 0) + REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (rn), + REG_NOTES (call_insn)); + note_current_region_may_contain_throw (); + } if (ecf_flags & ECF_NORETURN) REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx, REG_NOTES (call_insn)); - if (ecf_flags & ECF_ALWAYS_RETURN) - REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_ALWAYS_RETURN, const0_rtx, - REG_NOTES (call_insn)); if (ecf_flags & ECF_RETURNS_TWICE) { REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx, - REG_NOTES (call_insn)); + REG_NOTES (call_insn)); current_function_calls_setjmp = 1; } @@ -551,7 +432,7 @@ emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UN if (rounded_stack_size != 0) { - if (ecf_flags & (ECF_SP_DEPRESSED | ECF_NORETURN | ECF_LONGJMP)) + if (ecf_flags & (ECF_SP_DEPRESSED | ECF_NORETURN)) /* Just pretend we did the pop. */ stack_pointer_delta -= rounded_stack_size; else if (flag_defer_pop && inhibit_defer_pop == 0 @@ -582,7 +463,7 @@ emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UN For example, if the function might return more than one time (setjmp), then set RETURNS_TWICE to a nonzero value. - Similarly set LONGJMP for if the function is in the longjmp family. + Similarly set NORETURN if the function is in the longjmp family. Set MAY_BE_ALLOCA for any memory allocation function that might allocate space from the stack such as alloca. */ @@ -590,17 +471,16 @@ emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UN static int special_function_p (tree fndecl, int flags) { - if (! (flags & ECF_MALLOC) - && fndecl && DECL_NAME (fndecl) + if (fndecl && DECL_NAME (fndecl) && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17 /* Exclude functions not at the file scope, or not `extern', since they are not the magic functions we would otherwise think they are. - FIXME: this should be handled with attributes, not with this - hacky imitation of DECL_ASSEMBLER_NAME. It's (also) wrong - because you can declare fork() inside a function if you - wish. */ - && (DECL_CONTEXT (fndecl) == NULL_TREE + FIXME: this should be handled with attributes, not with this + hacky imitation of DECL_ASSEMBLER_NAME. It's (also) wrong + because you can declare fork() inside a function if you + wish. */ + && (DECL_CONTEXT (fndecl) == NULL_TREE || TREE_CODE (DECL_CONTEXT (fndecl)) == TRANSLATION_UNIT_DECL) && TREE_PUBLIC (fndecl)) { @@ -642,36 +522,25 @@ special_function_p (tree fndecl, int flags) if (tname[1] == 'i' && ! strcmp (tname, "siglongjmp")) - flags |= ECF_LONGJMP; + flags |= ECF_NORETURN; } else if ((tname[0] == 'q' && tname[1] == 's' && ! strcmp (tname, "qsetjmp")) || (tname[0] == 'v' && tname[1] == 'f' - && ! strcmp (tname, "vfork"))) + && ! strcmp (tname, "vfork")) + || (tname[0] == 'g' && tname[1] == 'e' + && !strcmp (tname, "getcontext"))) flags |= ECF_RETURNS_TWICE; else if (tname[0] == 'l' && tname[1] == 'o' && ! strcmp (tname, "longjmp")) - flags |= ECF_LONGJMP; - - else if ((tname[0] == 'f' && tname[1] == 'o' - && ! strcmp (tname, "fork")) - /* Linux specific: __clone. check NAME to insist on the - leading underscores, to avoid polluting the ISO / POSIX - namespace. */ - || (name[0] == '_' && name[1] == '_' - && ! strcmp (tname, "clone")) - || (tname[0] == 'e' && tname[1] == 'x' && tname[2] == 'e' - && tname[3] == 'c' && (tname[4] == 'l' || tname[4] == 'v') - && (tname[5] == '\0' - || ((tname[5] == 'p' || tname[5] == 'e') - && tname[6] == '\0')))) - flags |= ECF_FORK_OR_EXEC; + flags |= ECF_NORETURN; } + return flags; } -/* Return nonzero when tree represent call to longjmp. */ +/* Return nonzero when FNDECL represents a call to setjmp. */ int setjmp_call_p (tree fndecl) @@ -703,33 +572,32 @@ flags_from_decl_or_type (tree exp) if (DECL_P (exp)) { - struct cgraph_rtl_info *i = cgraph_rtl_info (exp); type = TREE_TYPE (exp); - if (i) - { - if (i->pure_function) - flags |= ECF_PURE | ECF_LIBCALL_BLOCK; - if (i->const_function) - flags |= ECF_CONST | ECF_LIBCALL_BLOCK; - } - /* The function exp may have the `malloc' attribute. */ if (DECL_IS_MALLOC (exp)) flags |= ECF_MALLOC; + /* The function exp may have the `returns_twice' attribute. */ + if (DECL_IS_RETURNS_TWICE (exp)) + flags |= ECF_RETURNS_TWICE; + /* The function exp may have the `pure' attribute. */ if (DECL_IS_PURE (exp)) - flags |= ECF_PURE | ECF_LIBCALL_BLOCK; + flags |= ECF_PURE; + + if (DECL_IS_NOVOPS (exp)) + flags |= ECF_NOVOPS; if (TREE_NOTHROW (exp)) flags |= ECF_NOTHROW; if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) - flags |= ECF_LIBCALL_BLOCK; - } + flags |= ECF_CONST; - if (TREE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) + flags = special_function_p (exp, flags); + } + else if (TYPE_P (exp) && TYPE_READONLY (exp) && ! TREE_THIS_VOLATILE (exp)) flags |= ECF_CONST; if (TREE_THIS_VOLATILE (exp)) @@ -740,7 +608,7 @@ flags_from_decl_or_type (tree exp) if (TREE_CODE (type) == FUNCTION_TYPE && TYPE_RETURNS_STACK_DEPRESSED (type)) { flags |= ECF_SP_DEPRESSED; - flags &= ~(ECF_PURE | ECF_CONST | ECF_LIBCALL_BLOCK); + flags &= ~(ECF_PURE | ECF_CONST); } return flags; @@ -776,7 +644,8 @@ call_expr_flags (tree t) Set REG_PARM_SEEN if we encounter a register parameter. */ static void -precompute_register_parameters (int num_actuals, struct arg_data *args, int *reg_parm_seen) +precompute_register_parameters (int num_actuals, struct arg_data *args, + int *reg_parm_seen) { int i; @@ -790,14 +659,9 @@ precompute_register_parameters (int num_actuals, struct arg_data *args, int *reg if (args[i].value == 0) { push_temp_slots (); - args[i].value = expand_expr (args[i].tree_value, NULL_RTX, - VOIDmode, 0); + args[i].value = expand_normal (args[i].tree_value); preserve_temp_slots (args[i].value); pop_temp_slots (); - - /* ANSI doesn't require a sequence point here, - but PCC has one, so this will avoid some problems. */ - emit_queue (); } /* If the value is a non-legitimate constant, force it into a @@ -815,6 +679,17 @@ precompute_register_parameters (int num_actuals, struct arg_data *args, int *reg TYPE_MODE (TREE_TYPE (args[i].tree_value)), args[i].value, args[i].unsignedp); + /* If we're going to have to load the value by parts, pull the + parts into pseudos. The part extraction process can involve + non-trivial computation. */ + if (GET_CODE (args[i].reg) == PARALLEL) + { + tree type = TREE_TYPE (args[i].tree_value); + args[i].parallel_value + = emit_group_load_into_temps (args[i].reg, args[i].value, + type, int_size_in_bytes (type)); + } + /* If the value is expensive, and we are inside an appropriately short loop, put the value into a pseudo and then put the pseudo into the hard reg. @@ -823,13 +698,13 @@ precompute_register_parameters (int num_actuals, struct arg_data *args, int *reg register parameters. This is to avoid reload conflicts while loading the parameters registers. */ - if ((! (GET_CODE (args[i].value) == REG - || (GET_CODE (args[i].value) == SUBREG - && GET_CODE (SUBREG_REG (args[i].value)) == REG))) - && args[i].mode != BLKmode - && rtx_cost (args[i].value, SET) > COSTS_N_INSNS (1) - && ((SMALL_REGISTER_CLASSES && *reg_parm_seen) - || preserve_subexpressions_p ())) + else if ((! (REG_P (args[i].value) + || (GET_CODE (args[i].value) == SUBREG + && REG_P (SUBREG_REG (args[i].value))))) + && args[i].mode != BLKmode + && rtx_cost (args[i].value, SET) > COSTS_N_INSNS (1) + && ((SMALL_REGISTER_CLASSES && *reg_parm_seen) + || optimize)) args[i].value = copy_to_mode_reg (args[i].mode, args[i].value); } } @@ -954,11 +829,20 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) < (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD))) { int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value)); - int nregs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int endian_correction = 0; - args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs; - args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs); + if (args[i].partial) + { + gcc_assert (args[i].partial % UNITS_PER_WORD == 0); + args[i].n_aligned_regs = args[i].partial / UNITS_PER_WORD; + } + else + { + args[i].n_aligned_regs + = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + } + + args[i].aligned_regs = XNEWVEC (rtx, args[i].n_aligned_regs); /* Structures smaller than a word are normally aligned to the least significant byte. On a BYTES_BIG_ENDIAN machine, @@ -983,7 +867,7 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) args[i].aligned_regs[j] = reg; word = extract_bit_field (word, bitsize, 0, 1, NULL_RTX, - word_mode, word_mode, BITS_PER_WORD); + word_mode, word_mode); /* There is no need to restrict this code to loading items in TYPE_ALIGN sized hunks. The bitfield instructions can @@ -1000,7 +884,7 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) bytes -= bitsize / BITS_PER_UNIT; store_bit_field (reg, bitsize, endian_correction, word_mode, - word, BITS_PER_WORD); + word); } } } @@ -1024,7 +908,10 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) and may be modified by this routine. OLD_PENDING_ADJ, MUST_PREALLOCATE and FLAGS are pointers to integer - flags which may may be modified by this routine. + flags which may may be modified by this routine. + + MAY_TAILCALL is cleared if we encounter an invisible pass-by-reference + that requires allocation of stack space. CALL_FROM_THUNK_P is true if this call is the jump from a thunk to the thunked-to function. */ @@ -1039,7 +926,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, int reg_parm_stack_space, rtx *old_stack_level, int *old_pending_adj, int *must_preallocate, int *ecf_flags, - bool call_from_thunk_p) + bool *may_tailcall, bool call_from_thunk_p) { /* 1 if scanning parms front to back, -1 if scanning back to front. */ int inc; @@ -1092,7 +979,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, args[i].reg is nonzero if all or part is passed in registers. args[i].partial is nonzero if part but not all is passed in registers, - and the exact value says how many words are passed in registers. + and the exact value says how many bytes are passed in registers. args[i].pass_on_stack is nonzero if the argument must at least be computed on the stack. It may then be loaded back into registers @@ -1102,56 +989,33 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, with those made by function.c. */ /* See if this argument should be passed by invisible reference. */ - if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (type)) - || TREE_ADDRESSABLE (type) -#ifdef FUNCTION_ARG_PASS_BY_REFERENCE - || FUNCTION_ARG_PASS_BY_REFERENCE (*args_so_far, TYPE_MODE (type), - type, argpos < n_named_args) -#endif - ) + if (pass_by_reference (args_so_far, TYPE_MODE (type), + type, argpos < n_named_args)) { - /* If we're compiling a thunk, pass through invisible - references instead of making a copy. */ + bool callee_copies; + tree base; + + callee_copies + = reference_callee_copied (args_so_far, TYPE_MODE (type), + type, argpos < n_named_args); + + /* If we're compiling a thunk, pass through invisible references + instead of making a copy. */ if (call_from_thunk_p -#ifdef FUNCTION_ARG_CALLEE_COPIES - || (FUNCTION_ARG_CALLEE_COPIES (*args_so_far, TYPE_MODE (type), - type, argpos < n_named_args) - /* If it's in a register, we must make a copy of it too. */ - /* ??? Is this a sufficient test? Is there a better one? */ - && !(TREE_CODE (args[i].tree_value) == VAR_DECL - && REG_P (DECL_RTL (args[i].tree_value))) - && ! TREE_ADDRESSABLE (type)) -#endif - ) + || (callee_copies + && !TREE_ADDRESSABLE (type) + && (base = get_base_address (args[i].tree_value)) + && (!DECL_P (base) || MEM_P (DECL_RTL (base))))) { - /* C++ uses a TARGET_EXPR to indicate that we want to make a - new object from the argument. If we are passing by - invisible reference, the callee will do that for us, so we - can strip off the TARGET_EXPR. This is not always safe, - but it is safe in the only case where this is a useful - optimization; namely, when the argument is a plain object. - In that case, the frontend is just asking the backend to - make a bitwise copy of the argument. */ + /* We can't use sibcalls if a callee-copied argument is + stored in the current function's frame. */ + if (!call_from_thunk_p && DECL_P (base) && !TREE_STATIC (base)) + *may_tailcall = false; - if (TREE_CODE (args[i].tree_value) == TARGET_EXPR - && (DECL_P (TREE_OPERAND (args[i].tree_value, 1))) - && ! REG_P (DECL_RTL (TREE_OPERAND (args[i].tree_value, 1)))) - args[i].tree_value = TREE_OPERAND (args[i].tree_value, 1); + args[i].tree_value = build_fold_addr_expr (args[i].tree_value); + type = TREE_TYPE (args[i].tree_value); - args[i].tree_value = build1 (ADDR_EXPR, - build_pointer_type (type), - args[i].tree_value); - type = build_pointer_type (type); - } - else if (TREE_CODE (args[i].tree_value) == TARGET_EXPR) - { - /* In the V3 C++ ABI, parameters are destroyed in the caller. - We implement this by passing the address of the temporary - rather than expanding it into another allocated slot. */ - args[i].tree_value = build1 (ADDR_EXPR, - build_pointer_type (type), - args[i].tree_value); - type = build_pointer_type (type); + *ecf_flags &= ~(ECF_CONST | ECF_LIBCALL_BLOCK); } else { @@ -1185,17 +1049,21 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, copy = assign_temp (type, 0, 1, 0); store_expr (args[i].tree_value, copy, 0); - *ecf_flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK); - args[i].tree_value = build1 (ADDR_EXPR, - build_pointer_type (type), - make_tree (type, copy)); - type = build_pointer_type (type); + if (callee_copies) + *ecf_flags &= ~(ECF_CONST | ECF_LIBCALL_BLOCK); + else + *ecf_flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK); + + args[i].tree_value + = build_fold_addr_expr (make_tree (type, copy)); + type = TREE_TYPE (args[i].tree_value); + *may_tailcall = false; } } mode = TYPE_MODE (type); - unsignedp = TREE_UNSIGNED (type); + unsignedp = TYPE_UNSIGNED (type); if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0)) mode = promote_mode (type, mode, &unsignedp, 1); @@ -1215,14 +1083,12 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, args[i].tail_call_reg = args[i].reg; #endif -#ifdef FUNCTION_ARG_PARTIAL_NREGS if (args[i].reg) args[i].partial - = FUNCTION_ARG_PARTIAL_NREGS (*args_so_far, mode, type, - argpos < n_named_args); -#endif + = targetm.calls.arg_partial_bytes (args_so_far, mode, type, + argpos < n_named_args); - args[i].pass_on_stack = MUST_PASS_IN_STACK (mode, type); + args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type); /* If FUNCTION_ARG returned a (parallel [(expr_list (nil) ...) ...]), it means that we are to pass this arg in the register(s) designated @@ -1314,8 +1180,7 @@ compute_argument_block_size (int reg_parm_stack_space, /* We don't handle this case yet. To handle it correctly we have to add the delta, round and subtract the delta. Currently no machine description requires this support. */ - if (stack_pointer_delta & (preferred_stack_boundary - 1)) - abort (); + gcc_assert (!(stack_pointer_delta & (preferred_stack_boundary - 1))); args_size->var = round_up (args_size->var, preferred_stack_boundary); } @@ -1349,11 +1214,6 @@ compute_argument_block_size (int reg_parm_stack_space, args_size->constant = MAX (args_size->constant, reg_parm_stack_space); -#ifdef MAYBE_REG_PARM_STACK_SPACE - if (reg_parm_stack_space == 0) - args_size->constant = 0; -#endif - #ifndef OUTGOING_REG_PARM_STACK_SPACE args_size->constant -= reg_parm_stack_space; #endif @@ -1376,63 +1236,43 @@ precompute_arguments (int flags, int num_actuals, struct arg_data *args) { int i; - /* If this function call is cse'able, precompute all the parameters. - Note that if the parameter is constructed into a temporary, this will - cause an additional copy because the parameter will be constructed - into a temporary location and then copied into the outgoing arguments. - If a parameter contains a call to alloca and this function uses the - stack, precompute the parameter. */ - - /* If we preallocated the stack space, and some arguments must be passed - on the stack, then we must precompute any parameter which contains a - function call which will store arguments on the stack. - Otherwise, evaluating the parameter may clobber previous parameters - which have already been stored into the stack. (we have code to avoid - such case by saving the outgoing stack arguments, but it results in - worse code) */ + /* If this is a libcall, then precompute all arguments so that we do not + get extraneous instructions emitted as part of the libcall sequence. */ + if ((flags & ECF_LIBCALL_BLOCK) == 0) + return; for (i = 0; i < num_actuals; i++) - if ((flags & ECF_LIBCALL_BLOCK) - || calls_function (args[i].tree_value, !ACCUMULATE_OUTGOING_ARGS)) - { - enum machine_mode mode; + { + enum machine_mode mode; - /* If this is an addressable type, we cannot pre-evaluate it. */ - if (TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value))) - abort (); + /* If this is an addressable type, we cannot pre-evaluate it. */ + gcc_assert (!TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value))); - args[i].value - = expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0); + args[i].initial_value = args[i].value + = expand_normal (args[i].tree_value); - /* ANSI doesn't require a sequence point here, - but PCC has one, so this will avoid some problems. */ - emit_queue (); - - args[i].initial_value = args[i].value - = protect_from_queue (args[i].value, 0); - - mode = TYPE_MODE (TREE_TYPE (args[i].tree_value)); - if (mode != args[i].mode) - { - args[i].value - = convert_modes (args[i].mode, mode, - args[i].value, args[i].unsignedp); -#ifdef PROMOTE_FOR_CALL_ONLY - /* CSE will replace this only if it contains args[i].value - pseudo, so convert it down to the declared mode using - a SUBREG. */ - if (GET_CODE (args[i].value) == REG - && GET_MODE_CLASS (args[i].mode) == MODE_INT) - { - args[i].initial_value - = gen_lowpart_SUBREG (mode, args[i].value); - SUBREG_PROMOTED_VAR_P (args[i].initial_value) = 1; - SUBREG_PROMOTED_UNSIGNED_SET (args[i].initial_value, - args[i].unsignedp); - } + mode = TYPE_MODE (TREE_TYPE (args[i].tree_value)); + if (mode != args[i].mode) + { + args[i].value + = convert_modes (args[i].mode, mode, + args[i].value, args[i].unsignedp); +#if defined(PROMOTE_FUNCTION_MODE) && !defined(PROMOTE_MODE) + /* CSE will replace this only if it contains args[i].value + pseudo, so convert it down to the declared mode using + a SUBREG. */ + if (REG_P (args[i].value) + && GET_MODE_CLASS (args[i].mode) == MODE_INT) + { + args[i].initial_value + = gen_lowpart_SUBREG (mode, args[i].value); + SUBREG_PROMOTED_VAR_P (args[i].initial_value) = 1; + SUBREG_PROMOTED_UNSIGNED_SET (args[i].initial_value, + args[i].unsignedp); + } #endif - } - } + } + } } /* Given the current state of MUST_PREALLOCATE and information about @@ -1514,9 +1354,14 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals rtx offset = ARGS_SIZE_RTX (args[i].locate.offset); rtx slot_offset = ARGS_SIZE_RTX (args[i].locate.slot_offset); rtx addr; + unsigned int align, boundary; + unsigned int units_on_stack = 0; + enum machine_mode partial_mode = VOIDmode; /* Skip this parm if it will not be passed on the stack. */ - if (! args[i].pass_on_stack && args[i].reg != 0) + if (! args[i].pass_on_stack + && args[i].reg != 0 + && args[i].partial == 0) continue; if (GET_CODE (offset) == CONST_INT) @@ -1525,10 +1370,33 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals addr = gen_rtx_PLUS (Pmode, arg_reg, offset); addr = plus_constant (addr, arg_offset); - args[i].stack = gen_rtx_MEM (args[i].mode, addr); - set_mem_align (args[i].stack, PARM_BOUNDARY); - set_mem_attributes (args[i].stack, - TREE_TYPE (args[i].tree_value), 1); + + if (args[i].partial != 0) + { + /* Only part of the parameter is being passed on the stack. + Generate a simple memory reference of the correct size. */ + units_on_stack = args[i].locate.size.constant; + partial_mode = mode_for_size (units_on_stack * BITS_PER_UNIT, + MODE_INT, 1); + args[i].stack = gen_rtx_MEM (partial_mode, addr); + set_mem_size (args[i].stack, GEN_INT (units_on_stack)); + } + else + { + args[i].stack = gen_rtx_MEM (args[i].mode, addr); + set_mem_attributes (args[i].stack, + TREE_TYPE (args[i].tree_value), 1); + } + align = BITS_PER_UNIT; + boundary = args[i].locate.boundary; + if (args[i].locate.where_pad != downward) + align = boundary; + else if (GET_CODE (offset) == CONST_INT) + { + align = INTVAL (offset) * BITS_PER_UNIT | boundary; + align = align & -align; + } + set_mem_align (args[i].stack, align); if (GET_CODE (slot_offset) == CONST_INT) addr = plus_constant (arg_reg, INTVAL (slot_offset)); @@ -1536,10 +1404,21 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals addr = gen_rtx_PLUS (Pmode, arg_reg, slot_offset); addr = plus_constant (addr, arg_offset); - args[i].stack_slot = gen_rtx_MEM (args[i].mode, addr); - set_mem_align (args[i].stack_slot, PARM_BOUNDARY); - set_mem_attributes (args[i].stack_slot, - TREE_TYPE (args[i].tree_value), 1); + + if (args[i].partial != 0) + { + /* Only part of the parameter is being passed on the stack. + Generate a simple memory reference of the correct size. */ + args[i].stack_slot = gen_rtx_MEM (partial_mode, addr); + set_mem_size (args[i].stack_slot, GEN_INT (units_on_stack)); + } + else + { + args[i].stack_slot = gen_rtx_MEM (args[i].mode, addr); + set_mem_attributes (args[i].stack_slot, + TREE_TYPE (args[i].tree_value), 1); + } + set_mem_align (args[i].stack_slot, args[i].locate.boundary); /* Function incoming arguments may overlap with sibling call outgoing arguments and we cannot allow reordering of reads @@ -1582,13 +1461,52 @@ rtx_for_function_call (tree fndecl, tree addr) /* Generate an rtx (probably a pseudo-register) for the address. */ { push_temp_slots (); - funexp = expand_expr (addr, NULL_RTX, VOIDmode, 0); + funexp = expand_normal (addr); pop_temp_slots (); /* FUNEXP can't be BLKmode. */ - emit_queue (); } return funexp; } +/* Return true if and only if SIZE storage units (usually bytes) + starting from address ADDR overlap with already clobbered argument + area. This function is used to determine if we should give up a + sibcall. */ + +static bool +mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) +{ + HOST_WIDE_INT i; + + if (addr == current_function_internal_arg_pointer) + i = 0; + else if (GET_CODE (addr) == PLUS + && XEXP (addr, 0) == current_function_internal_arg_pointer + && GET_CODE (XEXP (addr, 1)) == CONST_INT) + i = INTVAL (XEXP (addr, 1)); + /* Return true for arg pointer based indexed addressing. */ + else if (GET_CODE (addr) == PLUS + && (XEXP (addr, 0) == current_function_internal_arg_pointer + || XEXP (addr, 1) == current_function_internal_arg_pointer)) + return true; + else + return false; + +#ifdef ARGS_GROW_DOWNWARD + i = -i - size; +#endif + if (size > 0) + { + unsigned HOST_WIDE_INT k; + + for (k = 0; k < size; k++) + if (i + k < stored_args_map->n_bits + && TEST_BIT (stored_args_map, i + k)) + return true; + } + + return false; +} + /* Do the register loads required for any wholly-register parms or any parms which are passed both on the stack and in a register. Their expressions were already evaluated. @@ -1596,7 +1514,7 @@ rtx_for_function_call (tree fndecl, tree addr) Mark all register-parms as living through the call, putting these USE insns in the CALL_INSN_FUNCTION_USAGE field. - When IS_SIBCALL, perform the check_sibcall_overlap_argument_overlap + When IS_SIBCALL, perform the check_sibcall_argument_overlap checking, setting *SIBCALL_FAILURE if appropriate. */ static void @@ -1616,13 +1534,18 @@ load_register_parameters (struct arg_data *args, int num_actuals, int nregs; int size = 0; rtx before_arg = get_last_insn (); - /* Set to non-negative if must move a word at a time, even if just - one word (e.g, partial == 1 && mode == DFmode). Set to -1 if - we just use a normal move insn. This value can be zero if the - argument is a zero size structure with no fields. */ + /* Set non-negative if we must move a word at a time, even if + just one word (e.g, partial == 4 && mode == DFmode). Set + to -1 if we just use a normal move insn. This value can be + zero if the argument is a zero size structure. */ nregs = -1; - if (partial) - nregs = partial; + if (GET_CODE (reg) == PARALLEL) + ; + else if (partial) + { + gcc_assert (partial % UNITS_PER_WORD == 0); + nregs = partial / UNITS_PER_WORD; + } else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode) { size = int_size_in_bytes (TREE_TYPE (args[i].tree_value)); @@ -1635,11 +1558,7 @@ load_register_parameters (struct arg_data *args, int num_actuals, locations. The Irix 6 ABI has examples of this. */ if (GET_CODE (reg) == PARALLEL) - { - tree type = TREE_TYPE (args[i].tree_value); - emit_group_load (reg, args[i].value, type, - int_size_in_bytes (type)); - } + emit_group_move (reg, args[i].parallel_value); /* If simple case, just do move. If normal partial, store_one_arg has already loaded the register for us. In all other cases, @@ -1664,8 +1583,9 @@ load_register_parameters (struct arg_data *args, int num_actuals, call only uses SIZE bytes at the msb end, but it doesn't seem worth generating rtl to say that. */ reg = gen_rtx_REG (word_mode, REGNO (reg)); - x = expand_binop (word_mode, ashl_optab, reg, - GEN_INT (shift), reg, 1, OPTAB_WIDEN); + x = expand_shift (LSHIFT_EXPR, word_mode, reg, + build_int_cst (NULL_TREE, shift), + reg, 1); if (x != reg) emit_move_insn (reg, x); } @@ -1684,25 +1604,36 @@ load_register_parameters (struct arg_data *args, int num_actuals, { rtx mem = validize_mem (args[i].value); -#ifdef BLOCK_REG_PADDING + /* Check for overlap with already clobbered argument area. */ + if (is_sibcall + && mem_overlaps_already_clobbered_arg_p (XEXP (args[i].value, 0), + size)) + *sibcall_failure = 1; + /* Handle a BLKmode that needs shifting. */ if (nregs == 1 && size < UNITS_PER_WORD - && args[i].locate.where_pad == downward) +#ifdef BLOCK_REG_PADDING + && args[i].locate.where_pad == downward +#else + && BYTES_BIG_ENDIAN +#endif + ) { rtx tem = operand_subword_force (mem, 0, args[i].mode); rtx ri = gen_rtx_REG (word_mode, REGNO (reg)); rtx x = gen_reg_rtx (word_mode); int shift = (UNITS_PER_WORD - size) * BITS_PER_UNIT; - optab dir = BYTES_BIG_ENDIAN ? lshr_optab : ashl_optab; + enum tree_code dir = BYTES_BIG_ENDIAN ? RSHIFT_EXPR + : LSHIFT_EXPR; emit_move_insn (x, tem); - x = expand_binop (word_mode, dir, x, GEN_INT (shift), - ri, 1, OPTAB_WIDEN); + x = expand_shift (dir, word_mode, x, + build_int_cst (NULL_TREE, shift), + ri, 1); if (x != ri) emit_move_insn (ri, x); } else -#endif move_block_to_reg (REGNO (reg), mem, nregs, args[i].mode); } @@ -1725,123 +1656,6 @@ load_register_parameters (struct arg_data *args, int num_actuals, } } -/* Try to integrate function. See expand_inline_function for documentation - about the parameters. */ - -static rtx -try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore, - tree type, rtx structure_value_addr) -{ - rtx temp; - rtx before_call; - int i; - rtx old_stack_level = 0; - int reg_parm_stack_space = 0; - -#ifdef REG_PARM_STACK_SPACE -#ifdef MAYBE_REG_PARM_STACK_SPACE - reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE; -#else - reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl); -#endif -#endif - - before_call = get_last_insn (); - - timevar_push (TV_INTEGRATION); - - temp = expand_inline_function (fndecl, actparms, target, - ignore, type, - structure_value_addr); - - timevar_pop (TV_INTEGRATION); - - /* If inlining succeeded, return. */ - if (temp != (rtx) (size_t) - 1) - { - if (ACCUMULATE_OUTGOING_ARGS) - { - /* If the outgoing argument list must be preserved, push - the stack before executing the inlined function if it - makes any calls. */ - - i = reg_parm_stack_space; - if (i > highest_outgoing_arg_in_use) - i = highest_outgoing_arg_in_use; - while (--i >= 0 && stack_usage_map[i] == 0) - ; - - if (stack_arg_under_construction || i >= 0) - { - rtx first_insn - = before_call ? NEXT_INSN (before_call) : get_insns (); - rtx insn = NULL_RTX, seq; - - /* Look for a call in the inline function code. - If DECL_SAVED_INSNS (fndecl)->outgoing_args_size is - nonzero then there is a call and it is not necessary - to scan the insns. */ - - if (DECL_SAVED_INSNS (fndecl)->outgoing_args_size == 0) - for (insn = first_insn; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN) - break; - - if (insn) - { - /* Reserve enough stack space so that the largest - argument list of any function call in the inline - function does not overlap the argument list being - evaluated. This is usually an overestimate because - allocate_dynamic_stack_space reserves space for an - outgoing argument list in addition to the requested - space, but there is no way to ask for stack space such - that an argument list of a certain length can be - safely constructed. - - Add the stack space reserved for register arguments, if - any, in the inline function. What is really needed is the - largest value of reg_parm_stack_space in the inline - function, but that is not available. Using the current - value of reg_parm_stack_space is wrong, but gives - correct results on all supported machines. */ - - int adjust = (DECL_SAVED_INSNS (fndecl)->outgoing_args_size - + reg_parm_stack_space); - - start_sequence (); - emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX); - allocate_dynamic_stack_space (GEN_INT (adjust), - NULL_RTX, BITS_PER_UNIT); - seq = get_insns (); - end_sequence (); - emit_insn_before (seq, first_insn); - emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX); - } - } - } - - /* If the result is equivalent to TARGET, return TARGET to simplify - checks in store_expr. They can be equivalent but not equal in the - case of a function that returns BLKmode. */ - if (temp != target && rtx_equal_p (temp, target)) - return target; - return temp; - } - - /* If inlining failed, mark FNDECL as needing to be compiled - separately after all. If function was declared inline, - give a warning. */ - if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline - && optimize > 0 && !TREE_ADDRESSABLE (fndecl)) - { - warning ("%Jinlining failed in call to '%F'", fndecl, fndecl); - warning ("called from here"); - } - (*lang_hooks.mark_addressable) (fndecl); - return (rtx) (size_t) - 1; -} - /* We need to pop PENDING_STACK_ADJUST bytes. But, if the arguments wouldn't fill up an even multiple of PREFERRED_UNIT_STACK_BOUNDARY bytes, then we would need to push some additional bytes to pad the @@ -1854,14 +1668,14 @@ try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore, static int combine_pending_stack_adjustment_and_call (int unadjusted_args_size, struct args_size *args_size, - int preferred_unit_stack_boundary) + unsigned int preferred_unit_stack_boundary) { /* The number of bytes to pop so that the stack will be under-aligned by UNADJUSTED_ARGS_SIZE bytes. */ HOST_WIDE_INT adjustment; /* The alignment of the stack after the arguments are pushed, if we just pushed the arguments without adjust the stack here. */ - HOST_WIDE_INT unadjusted_alignment; + unsigned HOST_WIDE_INT unadjusted_alignment; unadjusted_alignment = ((stack_pointer_delta + unadjusted_args_size) @@ -1909,7 +1723,6 @@ check_sibcall_argument_overlap_1 (rtx x) { RTX_CODE code; int i, j; - unsigned int k; const char *fmt; if (x == NULL_RTX) @@ -1918,28 +1731,8 @@ check_sibcall_argument_overlap_1 (rtx x) code = GET_CODE (x); if (code == MEM) - { - if (XEXP (x, 0) == current_function_internal_arg_pointer) - i = 0; - else if (GET_CODE (XEXP (x, 0)) == PLUS - && XEXP (XEXP (x, 0), 0) == - current_function_internal_arg_pointer - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) - i = INTVAL (XEXP (XEXP (x, 0), 1)); - else - return 0; - -#ifdef ARGS_GROW_DOWNWARD - i = -i - GET_MODE_SIZE (GET_MODE (x)); -#endif - - for (k = 0; k < GET_MODE_SIZE (GET_MODE (x)); k++) - if (i + k < stored_args_map->n_bits - && TEST_BIT (stored_args_map, i + k)) - return 1; - - return 0; - } + return mem_overlaps_already_clobbered_arg_p (XEXP (x, 0), + GET_MODE_SIZE (GET_MODE (x))); /* Scan all subexpressions. */ fmt = GET_RTX_FORMAT (code); @@ -1996,60 +1789,27 @@ check_sibcall_argument_overlap (rtx insn, struct arg_data *arg, int mark_stored_ return insn != NULL_RTX; } -static tree -fix_unsafe_tree (tree t) +/* Given that a function returns a value of mode MODE at the most + significant end of hard register VALUE, shift VALUE left or right + as specified by LEFT_P. Return true if some action was needed. */ + +bool +shift_return_value (enum machine_mode mode, bool left_p, rtx value) { - switch (unsafe_for_reeval (t)) - { - case 0: /* Safe. */ - break; + HOST_WIDE_INT shift; - case 1: /* Mildly unsafe. */ - t = unsave_expr (t); - break; + gcc_assert (REG_P (value) && HARD_REGISTER_P (value)); + shift = GET_MODE_BITSIZE (GET_MODE (value)) - GET_MODE_BITSIZE (mode); + if (shift == 0) + return false; - case 2: /* Wildly unsafe. */ - { - tree var = build_decl (VAR_DECL, NULL_TREE, - TREE_TYPE (t)); - SET_DECL_RTL (var, - expand_expr (t, NULL_RTX, VOIDmode, EXPAND_NORMAL)); - t = var; - } - break; - - default: - abort (); - } - return t; -} - - -/* If function value *VALUE was returned at the most significant end of a - register, shift it towards the least significant end and convert it to - TYPE's mode. Return true and update *VALUE if some action was needed. - - TYPE is the type of the function's return value, which is known not - to have mode BLKmode. */ - -static bool -shift_returned_value (tree type, rtx *value) -{ - if (targetm.calls.return_in_msb (type)) - { - HOST_WIDE_INT shift; - - shift = (GET_MODE_BITSIZE (GET_MODE (*value)) - - BITS_PER_UNIT * int_size_in_bytes (type)); - if (shift > 0) - { - *value = expand_binop (GET_MODE (*value), lshr_optab, *value, - GEN_INT (shift), 0, 1, OPTAB_WIDEN); - *value = convert_to_mode (TYPE_MODE (type), *value, 0); - return true; - } - } - return false; + /* Use ashr rather than lshr for right shifts. This is for the benefit + of the MIPS port, which requires SImode values to be sign-extended + when stored in 64-bit registers. */ + if (!force_expand_binop (GET_MODE (value), left_p ? ashl_optab : ashr_optab, + value, GEN_INT (shift), value, 1, OPTAB_WIDEN)) + gcc_unreachable (); + return true; } /* Generate all the code for a function call @@ -2068,11 +1828,9 @@ expand_call (tree exp, rtx target, int ignore) tree actparms = TREE_OPERAND (exp, 1); /* RTX for the function to be called. */ rtx funexp; - /* Sequence of insns to perform a tail recursive "call". */ - rtx tail_recursion_insns = NULL_RTX; /* Sequence of insns to perform a normal "call". */ rtx normal_call_insns = NULL_RTX; - /* Sequence of insns to perform a tail recursive "call". */ + /* Sequence of insns to perform a tail "call". */ rtx tail_call_insns = NULL_RTX; /* Data type of the function. */ tree funtype; @@ -2082,9 +1840,7 @@ expand_call (tree exp, rtx target, int ignore) tree fndecl = 0; /* The type of the function being called. */ tree fntype; - rtx insn; - int try_tail_call = 1; - int try_tail_recursion = 1; + bool try_tail_call = CALL_EXPR_TAILCALL (exp); int pass; /* Register in which non-BLKmode value will be returned, @@ -2145,8 +1901,6 @@ expand_call (tree exp, rtx target, int ignore) /* Mask of ECF_ flags. */ int flags = 0; - /* Nonzero if this is a call to an inline function. */ - int is_integrable = 0; #ifdef REG_PARM_STACK_SPACE /* Define the boundary of the register parm stack space that needs to be saved, if any. */ @@ -2155,8 +1909,8 @@ expand_call (tree exp, rtx target, int ignore) #endif int initial_highest_arg_in_use = highest_outgoing_arg_in_use; - rtx temp_target = 0; char *initial_stack_usage_map = stack_usage_map; + char *stack_usage_map_buf = NULL; int old_stack_allocated; @@ -2176,61 +1930,26 @@ expand_call (tree exp, rtx target, int ignore) tree addr = TREE_OPERAND (exp, 0); int i; /* The alignment of the stack, in bits. */ - HOST_WIDE_INT preferred_stack_boundary; + unsigned HOST_WIDE_INT preferred_stack_boundary; /* The alignment of the stack, in bytes. */ - HOST_WIDE_INT preferred_unit_stack_boundary; - + unsigned HOST_WIDE_INT preferred_unit_stack_boundary; + /* The static chain value to use for this call. */ + rtx static_chain_value; /* See if this is "nothrow" function call. */ if (TREE_NOTHROW (exp)) flags |= ECF_NOTHROW; - /* See if we can find a DECL-node for the actual function. - As a result, decide whether this is a call to an integrable function. */ - + /* See if we can find a DECL-node for the actual function, and get the + function attributes (flags) from the function decl or type node. */ fndecl = get_callee_fndecl (exp); if (fndecl) { fntype = TREE_TYPE (fndecl); - if (!flag_no_inline - && fndecl != current_function_decl - && DECL_INLINE (fndecl) - && DECL_SAVED_INSNS (fndecl) - && DECL_SAVED_INSNS (fndecl)->inlinable) - is_integrable = 1; - else if (! TREE_ADDRESSABLE (fndecl)) - { - /* In case this function later becomes inlinable, - record that there was already a non-inline call to it. - - Use abstraction instead of setting TREE_ADDRESSABLE - directly. */ - if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline - && optimize > 0) - { - warning ("%Jcan't inline call to '%F'", fndecl, fndecl); - warning ("called from here"); - } - (*lang_hooks.mark_addressable) (fndecl); - } - - if (ignore - && lookup_attribute ("warn_unused_result", - TYPE_ATTRIBUTES (TREE_TYPE (fndecl)))) - warning ("ignoring return value of `%D', " - "declared with attribute warn_unused_result", fndecl); - flags |= flags_from_decl_or_type (fndecl); } - - /* If we don't have specific function to call, see if we have a - attributes set in the type. */ else { fntype = TREE_TYPE (TREE_TYPE (p)); - if (ignore - && lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (fntype))) - warning ("ignoring return value of function " - "declared with attribute warn_unused_result"); flags |= flags_from_decl_or_type (fntype); } @@ -2238,8 +1957,8 @@ expand_call (tree exp, rtx target, int ignore) /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ - if (warn_aggregate_return && AGGREGATE_TYPE_P (TREE_TYPE (exp))) - warning ("function call has aggregate value"); + if (AGGREGATE_TYPE_P (TREE_TYPE (exp))) + warning (OPT_Waggregate_return, "function call has aggregate value"); /* If the result of a pure or const function call is ignored (or void), and none of its arguments are volatile, we can avoid expanding the @@ -2268,12 +1987,8 @@ expand_call (tree exp, rtx target, int ignore) } #ifdef REG_PARM_STACK_SPACE -#ifdef MAYBE_REG_PARM_STACK_SPACE - reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE; -#else reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl); #endif -#endif #ifndef OUTGOING_REG_PARM_STACK_SPACE if (reg_parm_stack_space > 0 && PUSH_ARGS) @@ -2291,38 +2006,19 @@ expand_call (tree exp, rtx target, int ignore) #ifdef PCC_STATIC_STRUCT_RETURN { pcc_struct_value = 1; - /* Easier than making that case work right. */ - if (is_integrable) - { - /* In case this is a static function, note that it has been - used. */ - if (! TREE_ADDRESSABLE (fndecl)) - (*lang_hooks.mark_addressable) (fndecl); - is_integrable = 0; - } } #else /* not PCC_STATIC_STRUCT_RETURN */ { struct_value_size = int_size_in_bytes (TREE_TYPE (exp)); - if (CALL_EXPR_HAS_RETURN_SLOT_ADDR (exp)) - { - /* The structure value address arg is already in actparms. - Pull it out. It might be nice to just leave it there, but - we need to set structure_value_addr. */ - tree return_arg = TREE_VALUE (actparms); - actparms = TREE_CHAIN (actparms); - structure_value_addr = expand_expr (return_arg, NULL_RTX, - VOIDmode, EXPAND_NORMAL); - } - else if (target && GET_CODE (target) == MEM) + if (target && MEM_P (target) && CALL_EXPR_RETURN_SLOT_OPT (exp)) structure_value_addr = XEXP (target, 0); else { /* For variable-sized objects, we must be called with a target specified. If we were to allocate space on the stack here, we would have no way of knowing when to free it. */ - rtx d = assign_temp (TREE_TYPE (exp), 1, 1, 1); + rtx d = assign_temp (TREE_TYPE (exp), 0, 1, 1); mark_temp_addr_taken (d); structure_value_addr = XEXP (d, 0); @@ -2332,17 +2028,6 @@ expand_call (tree exp, rtx target, int ignore) #endif /* not PCC_STATIC_STRUCT_RETURN */ } - /* If called function is inline, try to integrate it. */ - - if (is_integrable) - { - rtx temp = try_to_integrate (fndecl, actparms, target, - ignore, TREE_TYPE (exp), - structure_value_addr); - if (temp != (rtx) (size_t) - 1) - return temp; - } - /* Figure out the amount to which the stack should be aligned. */ preferred_stack_boundary = PREFERRED_STACK_BOUNDARY; if (fndecl) @@ -2354,8 +2039,7 @@ expand_call (tree exp, rtx target, int ignore) /* Operand 0 is a pointer-to-function; get the type of the function. */ funtype = TREE_TYPE (addr); - if (! POINTER_TYPE_P (funtype)) - abort (); + gcc_assert (POINTER_TYPE_P (funtype)); funtype = TREE_TYPE (funtype); /* Munge the tree to split complex arguments into their imaginary @@ -2368,10 +2052,6 @@ expand_call (tree exp, rtx target, int ignore) else type_arg_types = TYPE_ARG_TYPES (funtype); - /* See if this is a call to a function that can return more than once - or a call to longjmp or malloc. */ - flags |= special_function_p (fndecl, flags); - if (flags & ECF_MAY_BE_ALLOCA) current_function_calls_alloca = 1; @@ -2384,11 +2064,11 @@ expand_call (tree exp, rtx target, int ignore) is not a REG, we must always copy it into a register. If it is virtual_outgoing_args_rtx, we must copy it to another register in some cases. */ - rtx temp = (GET_CODE (structure_value_addr) != REG + rtx temp = (!REG_P (structure_value_addr) || (ACCUMULATE_OUTGOING_ARGS && stack_arg_under_construction && structure_value_addr == virtual_outgoing_args_rtx) - ? copy_addr_to_reg (convert_memory_address + ? copy_addr_to_reg (convert_memory_address (Pmode, structure_value_addr)) : structure_value_addr); @@ -2464,7 +2144,7 @@ expand_call (tree exp, rtx target, int ignore) &args_so_far, reg_parm_stack_space, &old_stack_level, &old_pending_adj, &must_preallocate, &flags, - CALL_FROM_THUNK_P (exp)); + &try_tail_call, CALL_FROM_THUNK_P (exp)); if (args_size.var) { @@ -2494,33 +2174,16 @@ expand_call (tree exp, rtx target, int ignore) || (!ACCUMULATE_OUTGOING_ARGS && args_size.constant))) structure_value_addr = copy_to_reg (structure_value_addr); - /* Tail calls can make things harder to debug, and we're traditionally + /* Tail calls can make things harder to debug, and we've traditionally pushed these optimizations into -O2. Don't try if we're already expanding a call, as that means we're an argument. Don't try if - there's cleanups, as we know there's code to follow the call. + there's cleanups, as we know there's code to follow the call. */ - If rtx_equal_function_value_matters is false, that means we've - finished with regular parsing. Which means that some of the - machinery we use to generate tail-calls is no longer in place. - This is most often true of sjlj-exceptions, which we couldn't - tail-call to anyway. - - If current_nesting_level () == 0, we're being called after - the function body has been expanded. This can happen when - setting up trampolines in expand_function_end. */ if (currently_expanding_call++ != 0 || !flag_optimize_sibling_calls - || !rtx_equal_function_value_matters - || current_nesting_level () == 0 - || any_pending_cleanups () - || args_size.var) - try_tail_call = try_tail_recursion = 0; - - /* Tail recursion fails, when we are not dealing with recursive calls. */ - if (!try_tail_recursion - || TREE_CODE (addr) != ADDR_EXPR - || TREE_OPERAND (addr, 0) != current_function_decl) - try_tail_recursion = 0; + || args_size.var + || lookup_stmt_eh_region (exp) >= 0) + try_tail_call = 0; /* Rest of purposes for tail call optimizations to fail. */ if ( @@ -2537,131 +2200,30 @@ expand_call (tree exp, rtx target, int ignore) || structure_value_addr != NULL_RTX /* Check whether the target is able to optimize the call into a sibcall. */ - || !(*targetm.function_ok_for_sibcall) (fndecl, exp) + || !targetm.function_ok_for_sibcall (fndecl, exp) /* Functions that do not return exactly once may not be sibcall - optimized. */ - || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP | ECF_NORETURN)) + optimized. */ + || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) /* If the called function is nested in the current one, it might access - some of the caller's arguments, but could clobber them beforehand if - the argument areas are shared. */ + some of the caller's arguments, but could clobber them beforehand if + the argument areas are shared. */ || (fndecl && decl_function_context (fndecl) == current_function_decl) /* If this function requires more stack slots than the current - function, we cannot change it into a sibling call. */ - || args_size.constant > current_function_args_size + function, we cannot change it into a sibling call. + current_function_pretend_args_size is not part of the + stack allocated by our caller. */ + || args_size.constant > (current_function_args_size + - current_function_pretend_args_size) /* If the callee pops its own arguments, then it must pop exactly the same number of arguments as the current function. */ || (RETURN_POPS_ARGS (fndecl, funtype, args_size.constant) != RETURN_POPS_ARGS (current_function_decl, TREE_TYPE (current_function_decl), current_function_args_size)) - || !(*lang_hooks.decls.ok_for_sibcall) (fndecl)) + || !lang_hooks.decls.ok_for_sibcall (fndecl)) try_tail_call = 0; - if (try_tail_call || try_tail_recursion) - { - int end, inc; - actparms = NULL_TREE; - /* Ok, we're going to give the tail call the old college try. - This means we're going to evaluate the function arguments - up to three times. There are two degrees of badness we can - encounter, those that can be unsaved and those that can't. - (See unsafe_for_reeval commentary for details.) - - Generate a new argument list. Pass safe arguments through - unchanged. For the easy badness wrap them in UNSAVE_EXPRs. - For hard badness, evaluate them now and put their resulting - rtx in a temporary VAR_DECL. - - initialize_argument_information has ordered the array for the - order to be pushed, and we must remember this when reconstructing - the original argument order. */ - - if (PUSH_ARGS_REVERSED) - { - inc = 1; - i = 0; - end = num_actuals; - } - else - { - inc = -1; - i = num_actuals - 1; - end = -1; - } - - for (; i != end; i += inc) - { - args[i].tree_value = fix_unsafe_tree (args[i].tree_value); - /* We need to build actparms for optimize_tail_recursion. We can - safely trash away TREE_PURPOSE, since it is unused by this - function. */ - if (try_tail_recursion) - actparms = tree_cons (NULL_TREE, args[i].tree_value, actparms); - } - /* Do the same for the function address if it is an expression. */ - if (!fndecl) - addr = fix_unsafe_tree (addr); - /* Expanding one of those dangerous arguments could have added - cleanups, but otherwise give it a whirl. */ - if (any_pending_cleanups ()) - try_tail_call = try_tail_recursion = 0; - } - - /* Generate a tail recursion sequence when calling ourselves. */ - - if (try_tail_recursion) - { - /* We want to emit any pending stack adjustments before the tail - recursion "call". That way we know any adjustment after the tail - recursion call can be ignored if we indeed use the tail recursion - call expansion. */ - int save_pending_stack_adjust = pending_stack_adjust; - int save_stack_pointer_delta = stack_pointer_delta; - - /* Emit any queued insns now; otherwise they would end up in - only one of the alternates. */ - emit_queue (); - - /* Use a new sequence to hold any RTL we generate. We do not even - know if we will use this RTL yet. The final decision can not be - made until after RTL generation for the entire function is - complete. */ - start_sequence (); - /* If expanding any of the arguments creates cleanups, we can't - do a tailcall. So, we'll need to pop the pending cleanups - list. If, however, all goes well, and there are no cleanups - then the call to expand_start_target_temps will have no - effect. */ - expand_start_target_temps (); - if (optimize_tail_recursion (actparms, get_last_insn ())) - { - if (any_pending_cleanups ()) - try_tail_call = try_tail_recursion = 0; - else - tail_recursion_insns = get_insns (); - } - expand_end_target_temps (); - end_sequence (); - - /* Restore the original pending stack adjustment for the sibling and - normal call cases below. */ - pending_stack_adjust = save_pending_stack_adjust; - stack_pointer_delta = save_stack_pointer_delta; - } - - if (profile_arc_flag && (flags & ECF_FORK_OR_EXEC)) - { - /* A fork duplicates the profile information, and an exec discards - it. We can't rely on fork/exec to be paired. So write out the - profile information we have gathered so far, and clear it. */ - /* ??? When Linux's __clone is called with CLONE_VM set, profiling - is subject to race conditions, just as with multithreaded - programs. */ - - emit_library_call (gcov_flush_libfunc, LCT_ALWAYS_RETURN, VOIDmode, 0); - } - /* Ensure current function's preferred stack boundary is at least what we need. We don't have to increase alignment for recursive functions. */ @@ -2673,8 +2235,6 @@ expand_call (tree exp, rtx target, int ignore) preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT; - function_call_count++; - /* We want to make two insn chains; one for a sibling call, the other for a normal call. We will select one of the two chains after initial RTL generation is complete. */ @@ -2683,7 +2243,7 @@ expand_call (tree exp, rtx target, int ignore) int sibcall_failure = 0; /* We want to emit any pending stack adjustments before the tail recursion "call". That way we know any adjustment after the tail - recursion call can be ignored if we indeed use the tail recursion + recursion call can be ignored if we indeed use the tail call expansion. */ int save_pending_stack_adjust = 0; int save_stack_pointer_delta = 0; @@ -2692,10 +2252,6 @@ expand_call (tree exp, rtx target, int ignore) if (pass == 0) { - /* Emit any queued insns now; otherwise they would end up in - only one of the alternates. */ - emit_queue (); - /* State variables we need to save and restore between iterations. */ save_pending_stack_adjust = pending_stack_adjust; @@ -2717,15 +2273,6 @@ expand_call (tree exp, rtx target, int ignore) sibcall_failure instead of continuing the loop. */ start_sequence (); - if (pass == 0) - { - /* We know at this point that there are not currently any - pending cleanups. If, however, in the process of evaluating - the arguments we were to create some, we'll need to be - able to get rid of them. */ - expand_start_target_temps (); - } - /* Don't let pending stack adjusts add up to too much. Also, do all pending adjustments now if there is any chance this might be a call to alloca or if we are expanding a sibling @@ -2746,10 +2293,6 @@ expand_call (tree exp, rtx target, int ignore) if (pass && (flags & ECF_LIBCALL_BLOCK)) NO_DEFER_POP; -#ifdef FINAL_REG_PARM_STACK_SPACE - reg_parm_stack_space = FINAL_REG_PARM_STACK_SPACE (args_size.constant, - args_size.var); -#endif /* Precompute any arguments as needed. */ if (pass) precompute_arguments (flags, num_actuals, args); @@ -2759,6 +2302,9 @@ expand_call (tree exp, rtx target, int ignore) if (pass && (flags & (ECF_LIBCALL_BLOCK | ECF_MALLOC))) start_sequence (); + if (pass == 0 && cfun->stack_protect_guard) + stack_protect_epilogue (); + adjusted_args_size = args_size; /* Compute the actual size of the argument block required. The variable and constant sizes must be combined, the size may have to be rounded, @@ -2774,7 +2320,7 @@ expand_call (tree exp, rtx target, int ignore) old_stack_allocated = stack_pointer_delta - pending_stack_adjust; /* The argument block when performing a sibling call is the - incoming argument block. */ + incoming argument block. */ if (pass == 0) { argblock = virtual_incoming_args_rtx; @@ -2854,7 +2400,10 @@ expand_call (tree exp, rtx target, int ignore) highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, needed); #endif - stack_usage_map = alloca (highest_outgoing_arg_in_use); + if (stack_usage_map_buf) + free (stack_usage_map_buf); + stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use); + stack_usage_map = stack_usage_map_buf; if (initial_highest_arg_in_use) memcpy (stack_usage_map, initial_stack_usage_map, @@ -2959,7 +2508,10 @@ expand_call (tree exp, rtx target, int ignore) = stack_arg_under_construction; stack_arg_under_construction = 0; /* Make a new map for the new argument list. */ - stack_usage_map = alloca (highest_outgoing_arg_in_use); + if (stack_usage_map_buf) + free (stack_usage_map_buf); + stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use); + stack_usage_map = stack_usage_map_buf; memset (stack_usage_map, 0, highest_outgoing_arg_in_use); highest_outgoing_arg_in_use = 0; } @@ -3014,15 +2566,21 @@ expand_call (tree exp, rtx target, int ignore) { if (pcc_struct_value) valreg = hard_function_value (build_pointer_type (TREE_TYPE (exp)), - fndecl, (pass == 0)); + fndecl, NULL, (pass == 0)); else - valreg = hard_function_value (TREE_TYPE (exp), fndecl, (pass == 0)); + valreg = hard_function_value (TREE_TYPE (exp), fndecl, fntype, + (pass == 0)); } /* Precompute all register parameters. It isn't safe to compute anything once we have started filling any specific hard regs. */ precompute_register_parameters (num_actuals, args, ®_parm_seen); + if (TREE_OPERAND (exp, 2)) + static_chain_value = expand_normal (TREE_OPERAND (exp, 2)); + else + static_chain_value = 0; + #ifdef REG_PARM_STACK_SPACE /* Save the fixed argument area if it's part of the caller's frame and is clobbered by argument setup for this call. */ @@ -3102,26 +2660,23 @@ expand_call (tree exp, rtx target, int ignore) structure value. */ if (pass != 0 && structure_value_addr && ! structure_value_addr_parm) { - structure_value_addr + structure_value_addr = convert_memory_address (Pmode, structure_value_addr); emit_move_insn (struct_value, force_reg (Pmode, force_operand (structure_value_addr, NULL_RTX))); - if (GET_CODE (struct_value) == REG) + if (REG_P (struct_value)) use_reg (&call_fusage, struct_value); } - funexp = prepare_call_address (funexp, fndecl, &call_fusage, - reg_parm_seen, pass == 0); + funexp = prepare_call_address (funexp, static_chain_value, + &call_fusage, reg_parm_seen, pass == 0); load_register_parameters (args, num_actuals, &call_fusage, flags, pass == 0, &sibcall_failure); - /* Perform postincrements before actually calling the function. */ - emit_queue (); - /* Save a pointer to the last insn before the call, so that we can later safely search backwards to find the CALL_INSN. */ before_call = get_last_insn (); @@ -3141,15 +2696,29 @@ expand_call (tree exp, rtx target, int ignore) now! */ /* Stack must be properly aligned now. */ - if (pass && stack_pointer_delta % preferred_unit_stack_boundary) - abort (); + gcc_assert (!pass + || !(stack_pointer_delta % preferred_unit_stack_boundary)); /* Generate the actual call instruction. */ - emit_call_1 (funexp, fndecl, funtype, unadjusted_args_size, + emit_call_1 (funexp, exp, fndecl, funtype, unadjusted_args_size, adjusted_args_size.constant, struct_value_size, next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage, flags, & args_so_far); + /* If a non-BLKmode value is returned at the most significant end + of a register, shift the register right by the appropriate amount + and update VALREG accordingly. BLKmode values are handled by the + group load/store machinery below. */ + if (!structure_value_addr + && !pcc_struct_value + && TYPE_MODE (TREE_TYPE (exp)) != BLKmode + && targetm.calls.return_in_msb (TREE_TYPE (exp))) + { + if (shift_return_value (TYPE_MODE (TREE_TYPE (exp)), false, valreg)) + sibcall_failure = 1; + valreg = gen_rtx_REG (TYPE_MODE (TREE_TYPE (exp)), REGNO (valreg)); + } + /* If call is cse'able, make appropriate pair of reg-notes around it. Test valreg so we don't crash; may safely ignore `const' if return type is void. Disable for PARALLEL return values, because @@ -3160,12 +2729,12 @@ expand_call (tree exp, rtx target, int ignore) rtx insn; bool failed = valreg == 0 || GET_CODE (valreg) == PARALLEL; - insns = get_insns (); + insns = get_insns (); /* Expansion of block moves possibly introduced a loop that may not appear inside libcall block. */ for (insn = insns; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == JUMP_INSN) + if (JUMP_P (insn)) failed = true; if (failed) @@ -3186,12 +2755,12 @@ expand_call (tree exp, rtx target, int ignore) end_sequence (); if (flag_unsafe_math_optimizations && fndecl - && DECL_BUILT_IN (fndecl) + && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL && (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRT || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTF || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTL)) - note = gen_rtx_fmt_e (SQRT, - GET_MODE (temp), + note = gen_rtx_fmt_e (SQRT, + GET_MODE (temp), args[0].initial_value); else { @@ -3202,7 +2771,7 @@ expand_call (tree exp, rtx target, int ignore) note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note); note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note); - + if (flags & ECF_PURE) note = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, @@ -3243,19 +2812,18 @@ expand_call (tree exp, rtx target, int ignore) if nonvolatile values are live. For functions that cannot return, inform flow that control does not fall through. */ - if ((flags & (ECF_NORETURN | ECF_LONGJMP)) || pass == 0) + if ((flags & ECF_NORETURN) || pass == 0) { /* The barrier must be emitted immediately after the CALL_INSN. Some ports emit more than just a CALL_INSN above, so we must search for it here. */ rtx last = get_last_insn (); - while (GET_CODE (last) != CALL_INSN) + while (!CALL_P (last)) { last = PREV_INSN (last); /* There was no CALL_INSN? */ - if (last == before_call) - abort (); + gcc_assert (last != before_call); } emit_barrier_after (last); @@ -3270,27 +2838,14 @@ expand_call (tree exp, rtx target, int ignore) } } - if (flags & ECF_LONGJMP) - current_function_calls_longjmp = 1; - /* If value type not void, return an rtx for the value. */ - /* If there are cleanups to be called, don't use a hard reg as target. - We need to double check this and see if it matters anymore. */ - if (any_pending_cleanups ()) - { - if (target && REG_P (target) - && REGNO (target) < FIRST_PSEUDO_REGISTER) - target = 0; - sibcall_failure = 1; - } - if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode || ignore) target = const0_rtx; else if (structure_value_addr) { - if (target == 0 || GET_CODE (target) != MEM) + if (target == 0 || !MEM_P (target)) { target = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), @@ -3312,11 +2867,7 @@ expand_call (tree exp, rtx target, int ignore) The Irix 6 ABI has examples of this. */ else if (GET_CODE (valreg) == PARALLEL) { - /* Second condition is added because "target" is freed at the - the end of "pass0" for -O2 when call is made to - expand_end_target_temps (). Its "in_use" flag has been set - to false, so allocate a new temp. */ - if (target == 0 || (pass == 1 && target == temp_target)) + if (target == 0) { /* This will only be assigned once, so it can be readonly. */ tree nt = build_qualified_type (TREE_TYPE (exp), @@ -3324,8 +2875,6 @@ expand_call (tree exp, rtx target, int ignore) | TYPE_QUAL_CONST)); target = assign_temp (nt, 0, 1, 1); - temp_target = target; - preserve_temp_slots (target); } if (! rtx_equal_p (target, valreg)) @@ -3339,19 +2888,50 @@ expand_call (tree exp, rtx target, int ignore) && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp)) && GET_MODE (target) == GET_MODE (valreg)) { - /* TARGET and VALREG cannot be equal at this point because the - latter would not have REG_FUNCTION_VALUE_P true, while the - former would if it were referring to the same register. + bool may_overlap = false; - If they refer to the same register, this move will be a no-op, - except when function inlining is being done. */ - emit_move_insn (target, valreg); + /* We have to copy a return value in a CLASS_LIKELY_SPILLED hard + reg to a plain register. */ + if (REG_P (valreg) + && HARD_REGISTER_P (valreg) + && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (REGNO (valreg))) + && !(REG_P (target) && !HARD_REGISTER_P (target))) + valreg = copy_to_reg (valreg); - /* If we are setting a MEM, this code must be executed. Since it is - emitted after the call insn, sibcall optimization cannot be - performed in that case. */ - if (GET_CODE (target) == MEM) - sibcall_failure = 1; + /* If TARGET is a MEM in the argument area, and we have + saved part of the argument area, then we can't store + directly into TARGET as it may get overwritten when we + restore the argument save area below. Don't work too + hard though and simply force TARGET to a register if it + is a MEM; the optimizer is quite likely to sort it out. */ + if (ACCUMULATE_OUTGOING_ARGS && pass && MEM_P (target)) + for (i = 0; i < num_actuals; i++) + if (args[i].save_area) + { + may_overlap = true; + break; + } + + if (may_overlap) + target = copy_to_reg (valreg); + else + { + /* TARGET and VALREG cannot be equal at this point + because the latter would not have + REG_FUNCTION_VALUE_P true, while the former would if + it were referring to the same register. + + If they refer to the same register, this move will be + a no-op, except when function inlining is being + done. */ + emit_move_insn (target, valreg); + + /* If we are setting a MEM, this code must be executed. + Since it is emitted after the call insn, sibcall + optimization cannot be performed in that case. */ + if (MEM_P (target)) + sibcall_failure = 1; + } } else if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode) { @@ -3361,45 +2941,40 @@ expand_call (tree exp, rtx target, int ignore) sibcall_failure = 1; } else - { - if (shift_returned_value (TREE_TYPE (exp), &valreg)) - sibcall_failure = 1; - - target = copy_to_reg (valreg); - } + target = copy_to_reg (valreg); if (targetm.calls.promote_function_return(funtype)) { - /* If we promoted this return value, make the proper SUBREG. TARGET - might be const0_rtx here, so be careful. */ - if (GET_CODE (target) == REG - && TYPE_MODE (TREE_TYPE (exp)) != BLKmode - && GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp))) - { - tree type = TREE_TYPE (exp); - int unsignedp = TREE_UNSIGNED (type); - int offset = 0; + /* If we promoted this return value, make the proper SUBREG. + TARGET might be const0_rtx here, so be careful. */ + if (REG_P (target) + && TYPE_MODE (TREE_TYPE (exp)) != BLKmode + && GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp))) + { + tree type = TREE_TYPE (exp); + int unsignedp = TYPE_UNSIGNED (type); + int offset = 0; + enum machine_mode pmode; - /* If we don't promote as expected, something is wrong. */ - if (GET_MODE (target) - != promote_mode (type, TYPE_MODE (type), &unsignedp, 1)) - abort (); + pmode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1); + /* If we don't promote as expected, something is wrong. */ + gcc_assert (GET_MODE (target) == pmode); - if ((WORDS_BIG_ENDIAN || BYTES_BIG_ENDIAN) - && GET_MODE_SIZE (GET_MODE (target)) - > GET_MODE_SIZE (TYPE_MODE (type))) - { - offset = GET_MODE_SIZE (GET_MODE (target)) - - GET_MODE_SIZE (TYPE_MODE (type)); - if (! BYTES_BIG_ENDIAN) - offset = (offset / UNITS_PER_WORD) * UNITS_PER_WORD; - else if (! WORDS_BIG_ENDIAN) - offset %= UNITS_PER_WORD; - } - target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset); - SUBREG_PROMOTED_VAR_P (target) = 1; - SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp); - } + if ((WORDS_BIG_ENDIAN || BYTES_BIG_ENDIAN) + && (GET_MODE_SIZE (GET_MODE (target)) + > GET_MODE_SIZE (TYPE_MODE (type)))) + { + offset = GET_MODE_SIZE (GET_MODE (target)) + - GET_MODE_SIZE (TYPE_MODE (type)); + if (! BYTES_BIG_ENDIAN) + offset = (offset / UNITS_PER_WORD) * UNITS_PER_WORD; + else if (! WORDS_BIG_ENDIAN) + offset %= UNITS_PER_WORD; + } + target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset); + SUBREG_PROMOTED_VAR_P (target) = 1; + SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp); + } } /* If size of args is variable or this was a constructor call for a stack @@ -3410,6 +2985,7 @@ expand_call (tree exp, rtx target, int ignore) emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX); stack_pointer_delta = old_stack_pointer_delta; pending_stack_adjust = old_pending_adj; + old_stack_allocated = stack_pointer_delta - pending_stack_adjust; stack_arg_under_construction = old_stack_arg_under_construction; highest_outgoing_arg_in_use = initial_highest_arg_in_use; stack_usage_map = initial_stack_usage_map; @@ -3449,38 +3025,14 @@ expand_call (tree exp, rtx target, int ignore) Check for the handler slots since we might not have a save area for non-local gotos. */ - if ((flags & ECF_MAY_BE_ALLOCA) && nonlocal_goto_handler_slots != 0) - emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX); + if ((flags & ECF_MAY_BE_ALLOCA) && cfun->nonlocal_goto_save_area != 0) + update_nonlocal_goto_save_area (); /* Free up storage we no longer need. */ for (i = 0; i < num_actuals; ++i) if (args[i].aligned_regs) free (args[i].aligned_regs); - if (pass == 0) - { - /* Undo the fake expand_start_target_temps we did earlier. If - there had been any cleanups created, we've already set - sibcall_failure. */ - expand_end_target_temps (); - } - - /* If this function is returning into a memory location marked as - readonly, it means it is initializing that location. We normally treat - functions as not clobbering such locations, so we need to specify that - this one does. We do this by adding the appropriate CLOBBER to the - CALL_INSN function usage list. This cannot be done by emitting a - standalone CLOBBER after the call because the latter would be ignored - by at least the delay slot scheduling pass. We do this now instead of - adding to call_fusage before the call to emit_call_1 because TARGET - may be modified in the meantime. */ - if (structure_value_addr != 0 && target != 0 - && GET_CODE (target) == MEM && RTX_UNCHANGING_P (target)) - add_function_usage_to - (last_call_insn (), - gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_CLOBBER (VOIDmode, target), - NULL_RTX)); - insns = get_insns (); end_sequence (); @@ -3509,58 +3061,25 @@ expand_call (tree exp, rtx target, int ignore) normal_call_insns = insns; /* Verify that we've deallocated all the stack we used. */ - if (! (flags & (ECF_NORETURN | ECF_LONGJMP)) - && old_stack_allocated != stack_pointer_delta - - pending_stack_adjust) - abort (); + gcc_assert ((flags & ECF_NORETURN) + || (old_stack_allocated + == stack_pointer_delta - pending_stack_adjust)); } /* If something prevents making this a sibling call, zero out the sequence. */ if (sibcall_failure) tail_call_insns = NULL_RTX; + else + break; } - /* The function optimize_sibling_and_tail_recursive_calls doesn't - handle CALL_PLACEHOLDERs inside other CALL_PLACEHOLDERs. This - can happen if the arguments to this function call an inline - function who's expansion contains another CALL_PLACEHOLDER. - - If there are any C_Ps in any of these sequences, replace them - with their normal call. */ - - for (insn = normal_call_insns; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN - && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER) - replace_call_placeholder (insn, sibcall_use_normal); - - for (insn = tail_call_insns; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN - && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER) - replace_call_placeholder (insn, sibcall_use_normal); - - for (insn = tail_recursion_insns; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == CALL_INSN - && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER) - replace_call_placeholder (insn, sibcall_use_normal); - - /* If this was a potential tail recursion site, then emit a - CALL_PLACEHOLDER with the normal and the tail recursion streams. - One of them will be selected later. */ - if (tail_recursion_insns || tail_call_insns) + /* If tail call production succeeded, we need to remove REG_EQUIV notes on + arguments too, as argument area is now clobbered by the call. */ + if (tail_call_insns) { - /* The tail recursion label must be kept around. We could expose - its use in the CALL_PLACEHOLDER, but that creates unwanted edges - and makes determining true tail recursion sites difficult. - - So we set LABEL_PRESERVE_P here, then clear it when we select - one of the call sequences after rtl generation is complete. */ - if (tail_recursion_insns) - LABEL_PRESERVE_P (tail_recursion_label) = 1; - emit_call_insn (gen_rtx_CALL_PLACEHOLDER (VOIDmode, normal_call_insns, - tail_call_insns, - tail_recursion_insns, - tail_recursion_label)); + emit_insn (tail_call_insns); + cfun->tail_call_emit = true; } else emit_insn (normal_call_insns); @@ -3573,17 +3092,59 @@ expand_call (tree exp, rtx target, int ignore) if (flags & ECF_SP_DEPRESSED) { clear_pending_stack_adjust (); - emit_insn (gen_rtx (CLOBBER, VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_CLOBBER (VOIDmode, stack_pointer_rtx)); emit_move_insn (virtual_stack_dynamic_rtx, stack_pointer_rtx); - save_stack_pointer (); } + if (stack_usage_map_buf) + free (stack_usage_map_buf); + return target; } +/* A sibling call sequence invalidates any REG_EQUIV notes made for + this function's incoming arguments. + + At the start of RTL generation we know the only REG_EQUIV notes + in the rtl chain are those for incoming arguments, so we can look + for REG_EQUIV notes between the start of the function and the + NOTE_INSN_FUNCTION_BEG. + + This is (slight) overkill. We could keep track of the highest + argument we clobber and be more selective in removing notes, but it + does not seem to be worth the effort. */ + +void +fixup_tail_calls (void) +{ + rtx insn; + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + /* There are never REG_EQUIV notes for the incoming arguments + after the NOTE_INSN_FUNCTION_BEG note, so stop if we see it. */ + if (NOTE_P (insn) + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) + break; + + while (1) + { + rtx note = find_reg_note (insn, REG_EQUIV, 0); + if (note) + { + /* Remove the note and keep looking at the notes for + this insn. */ + remove_note (insn, note); + continue; + } + break; + } + } +} + /* Traverse an argument list in VALUES and expand all complex arguments into their components. */ -tree +static tree split_complex_values (tree values) { tree p; @@ -3594,7 +3155,7 @@ split_complex_values (tree values) tree type = TREE_TYPE (TREE_VALUE (p)); if (type && TREE_CODE (type) == COMPLEX_TYPE && targetm.calls.split_complex_arg (type)) - goto found; + goto found; } return values; @@ -3637,7 +3198,7 @@ split_complex_values (tree values) /* Traverse a list of TYPES and expand all complex types into their components. */ -tree +static tree split_complex_types (tree types) { tree p; @@ -3648,7 +3209,7 @@ split_complex_types (tree types) tree type = TREE_VALUE (p); if (TREE_CODE (type) == COMPLEX_TYPE && targetm.calls.split_complex_arg (type)) - goto found; + goto found; } return types; @@ -3732,15 +3293,12 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, /* Size of the stack reserved for parameter registers. */ int initial_highest_arg_in_use = highest_outgoing_arg_in_use; char *initial_stack_usage_map = stack_usage_map; + char *stack_usage_map_buf = NULL; rtx struct_value = targetm.calls.struct_value_rtx (0, 0); #ifdef REG_PARM_STACK_SPACE -#ifdef MAYBE_REG_PARM_STACK_SPACE - reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE; -#else reg_parm_stack_space = REG_PARM_STACK_SPACE ((tree) 0); -#endif #endif /* By default, library functions can not throw. */ @@ -3768,9 +3326,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, case LCT_THROW: flags = ECF_NORETURN; break; - case LCT_ALWAYS_RETURN: - flags = ECF_ALWAYS_RETURN; - break; case LCT_RETURNS_TWICE: flags = ECF_RETURNS_TWICE; break; @@ -3786,19 +3341,19 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, decide where in memory it should come back. */ if (outmode != VOIDmode) { - tfom = (*lang_hooks.types.type_for_mode) (outmode, 0); + tfom = lang_hooks.types.type_for_mode (outmode, 0); if (aggregate_value_p (tfom, 0)) { #ifdef PCC_STATIC_STRUCT_RETURN rtx pointer_reg - = hard_function_value (build_pointer_type (tfom), 0, 0); + = hard_function_value (build_pointer_type (tfom), 0, 0, 0); mem_value = gen_rtx_MEM (outmode, pointer_reg); pcc_struct_value = 1; if (value == 0) value = gen_reg_rtx (outmode); #else /* not PCC_STATIC_STRUCT_RETURN */ struct_value_size = GET_MODE_SIZE (outmode); - if (value != 0 && GET_CODE (value) == MEM) + if (value != 0 && MEM_P (value)) mem_value = value; else mem_value = assign_temp (tfom, 0, 1, 1); @@ -3845,10 +3400,11 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if (mem_value && struct_value == 0 && ! pcc_struct_value) { rtx addr = XEXP (mem_value, 0); + nargs++; /* Make sure it is a reasonable operand for a move or push insn. */ - if (GET_CODE (addr) != REG && GET_CODE (addr) != MEM + if (!REG_P (addr) && !MEM_P (addr) && ! (CONSTANT_P (addr) && LEGITIMATE_CONSTANT_P (addr))) addr = force_operand (addr, NULL_RTX); @@ -3857,14 +3413,12 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, argvec[count].partial = 0; argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1); -#ifdef FUNCTION_ARG_PARTIAL_NREGS - if (FUNCTION_ARG_PARTIAL_NREGS (args_so_far, Pmode, NULL_TREE, 1)) - abort (); -#endif + gcc_assert (targetm.calls.arg_partial_bytes (&args_so_far, Pmode, + NULL_TREE, 1) == 0); locate_and_pad_parm (Pmode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA - 1, + 1, #else argvec[count].reg != 0, #endif @@ -3886,28 +3440,19 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, /* We cannot convert the arg value to the mode the library wants here; must do it earlier where we know the signedness of the arg. */ - if (mode == BLKmode - || (GET_MODE (val) != mode && GET_MODE (val) != VOIDmode)) - abort (); - - /* There's no need to call protect_from_queue, because - either emit_move_insn or emit_push_insn will do that. */ + gcc_assert (mode != BLKmode + && (GET_MODE (val) == mode || GET_MODE (val) == VOIDmode)); /* Make sure it is a reasonable operand for a move or push insn. */ - if (GET_CODE (val) != REG && GET_CODE (val) != MEM + if (!REG_P (val) && !MEM_P (val) && ! (CONSTANT_P (val) && LEGITIMATE_CONSTANT_P (val))) val = force_operand (val, NULL_RTX); -#ifdef FUNCTION_ARG_PASS_BY_REFERENCE - if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, mode, NULL_TREE, 1)) + if (pass_by_reference (&args_so_far, mode, NULL_TREE, 1)) { rtx slot; - int must_copy = 1 -#ifdef FUNCTION_ARG_CALLEE_COPIES - && ! FUNCTION_ARG_CALLEE_COPIES (args_so_far, mode, - NULL_TREE, 1) -#endif - ; + int must_copy + = !reference_callee_copied (&args_so_far, mode, NULL_TREE, 1); /* loop.c won't look at CALL_INSN_FUNCTION_USAGE of const/pure functions, so we have to pretend this isn't such a function. */ @@ -3927,24 +3472,13 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, flags |= ECF_PURE; } - if (GET_MODE (val) == MEM && ! must_copy) + if (GET_MODE (val) == MEM && !must_copy) slot = val; - else if (must_copy) - { - slot = assign_temp ((*lang_hooks.types.type_for_mode) (mode, 0), - 0, 1, 1); - emit_move_insn (slot, val); - } else { - tree type = (*lang_hooks.types.type_for_mode) (mode, 0); - - slot - = gen_rtx_MEM (mode, - expand_expr (build1 (ADDR_EXPR, - build_pointer_type (type), - make_tree (type, val)), - NULL_RTX, VOIDmode, 0)); + slot = assign_temp (lang_hooks.types.type_for_mode (mode, 0), + 0, 1, 1); + emit_move_insn (slot, val); } call_fusage = gen_rtx_EXPR_LIST (VOIDmode, @@ -3959,19 +3493,14 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, mode = Pmode; val = force_operand (XEXP (slot, 0), NULL_RTX); } -#endif argvec[count].value = val; argvec[count].mode = mode; argvec[count].reg = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1); -#ifdef FUNCTION_ARG_PARTIAL_NREGS argvec[count].partial - = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode, NULL_TREE, 1); -#else - argvec[count].partial = 0; -#endif + = targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL_TREE, 1); locate_and_pad_parm (mode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA @@ -3982,8 +3511,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, argvec[count].partial, NULL_TREE, &args_size, &argvec[count].locate); - if (argvec[count].locate.size.var) - abort (); + gcc_assert (!argvec[count].locate.size.var); if (argvec[count].reg == 0 || argvec[count].partial != 0 || reg_parm_stack_space > 0) @@ -3992,10 +3520,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree) 0, 1); } -#ifdef FINAL_REG_PARM_STACK_SPACE - reg_parm_stack_space = FINAL_REG_PARM_STACK_SPACE (args_size.constant, - args_size.var); -#endif /* If this machine requires an external definition for library functions, write one out. */ assemble_external_libcall (fun); @@ -4048,7 +3572,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, needed); #endif - stack_usage_map = alloca (highest_outgoing_arg_in_use); + stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use); + stack_usage_map = stack_usage_map_buf; if (initial_highest_arg_in_use) memcpy (stack_usage_map, initial_stack_usage_map, @@ -4060,7 +3585,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, needed = 0; /* We must be careful to use virtual regs before they're instantiated, - and real regs afterwards. Loop optimization, for example, can create + and real regs afterwards. Loop optimization, for example, can create new libcalls after we've instantiated the virtual regs, and if we use virtuals anyway, they won't match the rtl patterns. */ @@ -4157,11 +3682,11 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, { argvec[argnum].save_area = assign_stack_temp (BLKmode, - argvec[argnum].locate.size.constant, + argvec[argnum].locate.size.constant, 0); emit_block_move (validize_mem (argvec[argnum].save_area), - stack_area, + stack_area, GEN_INT (argvec[argnum].locate.size.constant), BLOCK_OP_CALL_PARM); } @@ -4186,6 +3711,28 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, stack_usage_map[i] = 1; NO_DEFER_POP; + + if (flags & ECF_CONST) + { + rtx use; + + /* Indicate argument access so that alias.c knows that these + values are live. */ + if (argblock) + use = plus_constant (argblock, + argvec[argnum].locate.offset.constant); + else + /* When arguments are pushed, trying to tell alias.c where + exactly this argument is won't work, because the + auto-increment causes confusion. So we merely indicate + that we access something with a known mode somewhere on + the stack. */ + use = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx, + gen_rtx_SCRATCH (Pmode)); + use = gen_rtx_MEM (argvec[argnum].mode, use); + use = gen_rtx_USE (VOIDmode, use); + call_fusage = gen_rtx_EXPR_LIST (VOIDmode, use, call_fusage); + } } } @@ -4200,7 +3747,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, else argnum = 0; - fun = prepare_call_address (fun, NULL_TREE, &call_fusage, 0, 0); + fun = prepare_call_address (fun, NULL, &call_fusage, 0, 0); /* Now load any reg parms into their regs. */ @@ -4208,6 +3755,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, are to be pushed. */ for (count = 0; count < nargs; count++, argnum += inc) { + enum machine_mode mode = argvec[argnum].mode; rtx val = argvec[argnum].value; rtx reg = argvec[argnum].reg; int partial = argvec[argnum].partial; @@ -4215,7 +3763,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, /* Handle calls that pass values in multiple non-contiguous locations. The PA64 has examples of this for library calls. */ if (reg != 0 && GET_CODE (reg) == PARALLEL) - emit_group_load (reg, val, NULL_TREE, GET_MODE_SIZE (GET_MODE (val))); + emit_group_load (reg, val, NULL_TREE, GET_MODE_SIZE (mode)); else if (reg != 0 && partial == 0) emit_move_insn (reg, val); @@ -4239,7 +3787,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, force_reg (Pmode, force_operand (XEXP (mem_value, 0), NULL_RTX))); - if (GET_CODE (struct_value) == REG) + if (REG_P (struct_value)) use_reg (&call_fusage, struct_value); } @@ -4250,8 +3798,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ? hard_libcall_value (outmode) : NULL_RTX); /* Stack must be properly aligned now. */ - if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1)) - abort (); + gcc_assert (!(stack_pointer_delta + & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))); before_call = get_last_insn (); @@ -4262,7 +3810,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, always signed. We also assume that the list of arguments passed has no impact, so we pretend it is unknown. */ - emit_call_1 (fun, + emit_call_1 (fun, NULL, get_identifier (XSTR (orgfun, 0)), build_function_type (tfom, NULL_TREE), original_args_size.constant, args_size.constant, @@ -4275,19 +3823,18 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if nonvolatile values are live. For functions that cannot return, inform flow that control does not fall through. */ - if (flags & (ECF_NORETURN | ECF_LONGJMP)) + if (flags & ECF_NORETURN) { /* The barrier note must be emitted immediately after the CALL_INSN. Some ports emit more than just a CALL_INSN above, so we must search for it here. */ rtx last = get_last_insn (); - while (GET_CODE (last) != CALL_INSN) + while (!CALL_P (last)) { last = PREV_INSN (last); /* There was no CALL_INSN? */ - if (last == before_call) - abort (); + gcc_assert (last != before_call); } emit_barrier_after (last); @@ -4319,7 +3866,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if (GET_CODE (valreg) == PARALLEL) { temp = gen_reg_rtx (outmode); - emit_group_store (temp, valreg, NULL_TREE, + emit_group_store (temp, valreg, NULL_TREE, GET_MODE_SIZE (outmode)); valreg = temp; } @@ -4391,7 +3938,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, if (save_mode == BLKmode) emit_block_move (stack_area, - validize_mem (argvec[count].save_area), + validize_mem (argvec[count].save_area), GEN_INT (argvec[count].locate.size.constant), BLOCK_OP_CALL_PARM); else @@ -4402,6 +3949,9 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, stack_usage_map = initial_stack_usage_map; } + if (stack_usage_map_buf) + free (stack_usage_map_buf); + return value; } @@ -4411,7 +3961,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, for a value of mode OUTMODE, with NARGS different arguments, passed as alternating rtx values and machine_modes to convert them to. - The rtx values should have been passed through protect_from_queue already. FN_TYPE should be LCT_NORMAL for `normal' calls, LCT_CONST for `const' calls, LCT_PURE for `pure' calls, LCT_CONST_MAKE_BLOCK for `const' calls @@ -4541,7 +4090,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, arg->save_area = assign_temp (nt, 0, 1, 1); preserve_temp_slots (arg->save_area); emit_block_move (validize_mem (arg->save_area), stack_area, - expr_size (arg->tree_value), + GEN_INT (arg->locate.size.constant), BLOCK_OP_CALL_PARM); } else @@ -4564,10 +4113,9 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, partial = arg->partial; } - if (reg != 0 && partial == 0) - /* Being passed entirely in a register. We shouldn't be called in - this case. */ - abort (); + /* Being passed entirely in a register. We shouldn't be called in + this case. */ + gcc_assert (reg == 0 || partial != 0); /* If this arg needs special alignment, don't load the registers here. */ @@ -4616,6 +4164,13 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, stack_arg_under_construction--; } + /* Check for overlap with already clobbered argument area. */ + if ((flags & ECF_SIBCALL) + && MEM_P (arg->value) + && mem_overlaps_already_clobbered_arg_p (XEXP (arg->value, 0), + arg->locate.size.constant)) + sibcall_failure = 1; + /* Don't allow anything left on stack from computation of argument to alloca. */ if (flags & ECF_MAY_BE_ALLOCA) @@ -4688,27 +4243,16 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, } else { - /* PUSH_ROUNDING has no effect on us, because - emit_push_insn for BLKmode is careful to avoid it. */ - if (reg && GET_CODE (reg) == PARALLEL) - { - /* Use the size of the elt to compute excess. */ - rtx elt = XEXP (XVECEXP (reg, 0, 0), 0); - excess = (arg->locate.size.constant - - int_size_in_bytes (TREE_TYPE (pval)) - + partial * GET_MODE_SIZE (GET_MODE (elt))); - } - else - excess = (arg->locate.size.constant - - int_size_in_bytes (TREE_TYPE (pval)) - + partial * UNITS_PER_WORD); + /* PUSH_ROUNDING has no effect on us, because emit_push_insn + for BLKmode is careful to avoid it. */ + excess = (arg->locate.size.constant + - int_size_in_bytes (TREE_TYPE (pval)) + + partial); size_rtx = expand_expr (size_in_bytes (TREE_TYPE (pval)), NULL_RTX, TYPE_MODE (sizetype), 0); } - /* Some types will require stricter alignment, which will be - provided for elsewhere in argument layout. */ - parm_align = MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval))); + parm_align = arg->locate.boundary; /* When an argument is padded down, the block is aligned to PARM_BOUNDARY, but the actual argument isn't. */ @@ -4723,7 +4267,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, } } - if ((flags & ECF_SIBCALL) && GET_CODE (arg->value) == MEM) + if ((flags & ECF_SIBCALL) && MEM_P (arg->value)) { /* emit_push_insn might not work properly if arg->value and argblock + arg->locate.offset areas overlap. */ @@ -4740,8 +4284,8 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, i = INTVAL (XEXP (XEXP (x, 0), 1)); /* expand_call should ensure this. */ - if (arg->locate.offset.var || GET_CODE (size_rtx) != CONST_INT) - abort (); + gcc_assert (!arg->locate.offset.var + && GET_CODE (size_rtx) == CONST_INT); if (arg->locate.offset.constant > i) { @@ -4773,6 +4317,14 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, arg->value = arg->stack_slot; } + if (arg->reg && GET_CODE (arg->reg) == PARALLEL) + { + tree type = TREE_TYPE (arg->tree_value); + arg->parallel_value + = emit_group_load_into_temps (arg->reg, arg->value, type, + int_size_in_bytes (type)); + } + /* Mark all slots this store used. */ if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL) && argblock && ! variable_size && arg->stack) @@ -4783,10 +4335,6 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, be deferred during the rest of the arguments. */ NO_DEFER_POP; - /* ANSI doesn't require a sequence point here, - but PCC has one, so this will avoid some problems. */ - emit_queue (); - /* Free any temporary slots made in processing this argument. Show that we might have taken the address of something and pushed that as an operand. */ @@ -4797,24 +4345,33 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, return sibcall_failure; } -/* Nonzero if we do not know how to pass TYPE solely in registers. - We cannot do so in the following cases: - - - if the type has variable size - - if the type is marked as addressable (it is required to be constructed - into the stack) - - if the padding and mode of the type is such that a copy into a register - would put it into the wrong part of the register. - - Which padding can't be supported depends on the byte endianness. - - A value in a register is implicitly padded at the most significant end. - On a big-endian machine, that is the lower end in memory. - So a value padded in memory at the upper end can't go in a register. - For a little-endian machine, the reverse is true. */ +/* Nonzero if we do not know how to pass TYPE solely in registers. */ bool -default_must_pass_in_stack (enum machine_mode mode, tree type) +must_pass_in_stack_var_size (enum machine_mode mode ATTRIBUTE_UNUSED, + tree type) +{ + if (!type) + return false; + + /* If the type has variable size... */ + if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + return true; + + /* If the type is marked as addressable (it is required + to be constructed into the stack)... */ + if (TREE_ADDRESSABLE (type)) + return true; + + return false; +} + +/* Another version of the TARGET_MUST_PASS_IN_STACK hook. This one + takes trailing padding of a structure into account. */ +/* ??? Should be able to merge these two by examining BLOCK_REG_PADDING. */ + +bool +must_pass_in_stack_var_size_or_pad (enum machine_mode mode, tree type) { if (!type) return false; diff --git a/contrib/gcc/cfg.c b/contrib/gcc/cfg.c index 80425853666..aa8eaca9eec 100644 --- a/contrib/gcc/cfg.c +++ b/contrib/gcc/cfg.c @@ -1,6 +1,7 @@ /* Control flow graph manipulation code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +17,8 @@ for more details. 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 contains low level functions to manipulate the CFG and analyze it. All other modules should not transform the data structure @@ -52,7 +53,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree.h" #include "rtl.h" #include "hard-reg-set.h" -#include "basic-block.h" #include "regs.h" #include "flags.h" #include "output.h" @@ -61,126 +61,45 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "tm_p.h" #include "obstack.h" +#include "timevar.h" +#include "tree-pass.h" +#include "ggc.h" +#include "hashtab.h" #include "alloc-pool.h" /* The obstack on which the flow graph components are allocated. */ -struct obstack flow_obstack; -static char *flow_firstobj; - -/* Basic block object pool. */ - -static alloc_pool bb_pool; - -/* Edge object pool. */ - -static alloc_pool edge_pool; - -/* Number of basic blocks in the current function. */ - -int n_basic_blocks; - -/* First free basic block number. */ - -int last_basic_block; - -/* Number of edges in the current function. */ - -int n_edges; - -/* The basic block array. */ - -varray_type basic_block_info; - -/* The special entry and exit blocks. */ - -struct basic_block_def entry_exit_blocks[2] -= {{NULL, /* head */ - NULL, /* end */ - NULL, /* head_tree */ - NULL, /* end_tree */ - NULL, /* pred */ - NULL, /* succ */ - NULL, /* local_set */ - NULL, /* cond_local_set */ - NULL, /* global_live_at_start */ - NULL, /* global_live_at_end */ - NULL, /* aux */ - ENTRY_BLOCK, /* index */ - NULL, /* prev_bb */ - EXIT_BLOCK_PTR, /* next_bb */ - 0, /* loop_depth */ - NULL, /* loop_father */ - { NULL, NULL }, /* dom */ - 0, /* count */ - 0, /* frequency */ - 0, /* flags */ - NULL /* rbi */ - }, - { - NULL, /* head */ - NULL, /* end */ - NULL, /* head_tree */ - NULL, /* end_tree */ - NULL, /* pred */ - NULL, /* succ */ - NULL, /* local_set */ - NULL, /* cond_local_set */ - NULL, /* global_live_at_start */ - NULL, /* global_live_at_end */ - NULL, /* aux */ - EXIT_BLOCK, /* index */ - ENTRY_BLOCK_PTR, /* prev_bb */ - NULL, /* next_bb */ - 0, /* loop_depth */ - NULL, /* loop_father */ - { NULL, NULL }, /* dom */ - 0, /* count */ - 0, /* frequency */ - 0, /* flags */ - NULL /* rbi */ - } -}; +struct bitmap_obstack reg_obstack; void debug_flow_info (void); static void free_edge (edge); +#define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) + /* Called once at initialization time. */ void init_flow (void) { - static int initialized; - + if (!cfun->cfg) + cfun->cfg = ggc_alloc_cleared (sizeof (struct control_flow_graph)); n_edges = 0; - - if (!initialized) - { - gcc_obstack_init (&flow_obstack); - flow_firstobj = obstack_alloc (&flow_obstack, 0); - initialized = 1; - } - else - { - free_alloc_pool (bb_pool); - free_alloc_pool (edge_pool); - obstack_free (&flow_obstack, flow_firstobj); - flow_firstobj = obstack_alloc (&flow_obstack, 0); - } - bb_pool = create_alloc_pool ("Basic block pool", - sizeof (struct basic_block_def), 100); - edge_pool = create_alloc_pool ("Edge pool", - sizeof (struct edge_def), 100); + ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def)); + ENTRY_BLOCK_PTR->index = ENTRY_BLOCK; + EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def)); + EXIT_BLOCK_PTR->index = EXIT_BLOCK; + ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR; + EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR; } /* Helper function for remove_edge and clear_edges. Frees edge structure without actually unlinking it from the pred/succ lists. */ static void -free_edge (edge e) +free_edge (edge e ATTRIBUTE_UNUSED) { n_edges--; - pool_free (edge_pool, e); + ggc_free (e); } /* Free the memory associated with the edge structures. */ @@ -190,37 +109,22 @@ clear_edges (void) { basic_block bb; edge e; + edge_iterator ei; FOR_EACH_BB (bb) { - edge e = bb->succ; - - while (e) - { - edge next = e->succ_next; - - free_edge (e); - e = next; - } - - bb->succ = NULL; - bb->pred = NULL; + FOR_EACH_EDGE (e, ei, bb->succs) + free_edge (e); + VEC_truncate (edge, bb->succs, 0); + VEC_truncate (edge, bb->preds, 0); } - e = ENTRY_BLOCK_PTR->succ; - while (e) - { - edge next = e->succ_next; + FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) + free_edge (e); + VEC_truncate (edge, EXIT_BLOCK_PTR->preds, 0); + VEC_truncate (edge, ENTRY_BLOCK_PTR->succs, 0); - free_edge (e); - e = next; - } - - EXIT_BLOCK_PTR->pred = NULL; - ENTRY_BLOCK_PTR->succ = NULL; - - if (n_edges) - abort (); + gcc_assert (!n_edges); } /* Allocate memory for basic_block. */ @@ -229,8 +133,7 @@ basic_block alloc_block (void) { basic_block bb; - bb = pool_alloc (bb_pool); - memset (bb, 0, sizeof (*bb)); + bb = ggc_alloc_cleared (sizeof (*bb)); return bb; } @@ -250,6 +153,8 @@ unlink_block (basic_block b) { b->next_bb->prev_bb = b->prev_bb; b->prev_bb->next_bb = b->next_bb; + b->prev_bb = NULL; + b->next_bb = NULL; } /* Sequentially order blocks and compact the arrays. */ @@ -259,16 +164,21 @@ compact_blocks (void) int i; basic_block bb; - i = 0; - FOR_EACH_BB (bb) + SET_BASIC_BLOCK (ENTRY_BLOCK, ENTRY_BLOCK_PTR); + SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR); + + i = NUM_FIXED_BLOCKS; + FOR_EACH_BB (bb) { - BASIC_BLOCK (i) = bb; + SET_BASIC_BLOCK (i, bb); bb->index = i; i++; } - if (i != n_basic_blocks) - abort (); + gcc_assert (i == n_basic_blocks); + + for (; i < last_basic_block; i++) + SET_BASIC_BLOCK (i, NULL); last_basic_block = n_basic_blocks; } @@ -279,11 +189,72 @@ void expunge_block (basic_block b) { unlink_block (b); - BASIC_BLOCK (b->index) = NULL; + SET_BASIC_BLOCK (b->index, NULL); n_basic_blocks--; - pool_free (bb_pool, b); + /* We should be able to ggc_free here, but we are not. + The dead SSA_NAMES are left pointing to dead statements that are pointing + to dead basic blocks making garbage collector to die. + We should be able to release all dead SSA_NAMES and at the same time we should + clear out BB pointer of dead statements consistently. */ } +/* Connect E to E->src. */ + +static inline void +connect_src (edge e) +{ + VEC_safe_push (edge, gc, e->src->succs, e); +} + +/* Connect E to E->dest. */ + +static inline void +connect_dest (edge e) +{ + basic_block dest = e->dest; + VEC_safe_push (edge, gc, dest->preds, e); + e->dest_idx = EDGE_COUNT (dest->preds) - 1; +} + +/* Disconnect edge E from E->src. */ + +static inline void +disconnect_src (edge e) +{ + basic_block src = e->src; + edge_iterator ei; + edge tmp; + + for (ei = ei_start (src->succs); (tmp = ei_safe_edge (ei)); ) + { + if (tmp == e) + { + VEC_unordered_remove (edge, src->succs, ei.index); + return; + } + else + ei_next (&ei); + } + + gcc_unreachable (); +} + +/* Disconnect edge E from E->dest. */ + +static inline void +disconnect_dest (edge e) +{ + basic_block dest = e->dest; + unsigned int dest_idx = e->dest_idx; + + VEC_unordered_remove (edge, dest->preds, dest_idx); + + /* If we removed an edge in the middle of the edge vector, we need + to update dest_idx of the edge that moved into the "hole". */ + if (dest_idx < EDGE_COUNT (dest->preds)) + EDGE_PRED (dest, dest_idx)->dest_idx = dest_idx; +} + /* Create an edge connecting SRC and DEST with flags FLAGS. Return newly created edge. Use this only if you are sure that this edge can't possibly already exist. */ @@ -292,18 +263,17 @@ edge unchecked_make_edge (basic_block src, basic_block dst, int flags) { edge e; - e = pool_alloc (edge_pool); - memset (e, 0, sizeof (*e)); + e = ggc_alloc_cleared (sizeof (*e)); n_edges++; - e->succ_next = src->succ; - e->pred_next = dst->pred; e->src = src; e->dest = dst; e->flags = flags; - src->succ = e; - dst->pred = e; + connect_src (e); + connect_dest (e); + + execute_on_growing_pred (e); return e; } @@ -312,45 +282,31 @@ unchecked_make_edge (basic_block src, basic_block dst, int flags) edge cache CACHE. Return the new edge, NULL if already exist. */ edge -cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int flags) +cached_make_edge (sbitmap edge_cache, basic_block src, basic_block dst, int flags) { - int use_edge_cache; - edge e; + if (edge_cache == NULL + || src == ENTRY_BLOCK_PTR + || dst == EXIT_BLOCK_PTR) + return make_edge (src, dst, flags); - /* Don't bother with edge cache for ENTRY or EXIT, if there aren't that - many edges to them, or we didn't allocate memory for it. */ - use_edge_cache = (edge_cache - && src != ENTRY_BLOCK_PTR && dst != EXIT_BLOCK_PTR); - - /* Make sure we don't add duplicate edges. */ - switch (use_edge_cache) + /* Does the requested edge already exist? */ + if (! TEST_BIT (edge_cache, dst->index)) { - default: - /* Quick test for non-existence of the edge. */ - if (! TEST_BIT (edge_cache[src->index], dst->index)) - break; - - /* The edge exists; early exit if no work to do. */ - if (flags == 0) - return NULL; - - /* Fall through. */ - case 0: - for (e = src->succ; e; e = e->succ_next) - if (e->dest == dst) - { - e->flags |= flags; - return NULL; - } - break; + /* The edge does not exist. Create one and update the + cache. */ + SET_BIT (edge_cache, dst->index); + return unchecked_make_edge (src, dst, flags); } - e = unchecked_make_edge (src, dst, flags); + /* At this point, we know that the requested edge exists. Adjust + flags if necessary. */ + if (flags) + { + edge e = find_edge (src, dst); + e->flags |= flags; + } - if (use_edge_cache) - SET_BIT (edge_cache[src->index], dst->index); - - return e; + return NULL; } /* Create an edge connecting SRC and DEST with flags FLAGS. Return newly @@ -359,7 +315,16 @@ cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int fla edge make_edge (basic_block src, basic_block dest, int flags) { - return cached_make_edge (NULL, src, dest, flags); + edge e = find_edge (src, dest); + + /* Make sure we don't add duplicate edges. */ + if (e) + { + e->flags |= flags; + return NULL; + } + + return unchecked_make_edge (src, dest, flags); } /* Create an edge connecting SRC to DEST and set probability by knowing @@ -380,32 +345,11 @@ make_single_succ_edge (basic_block src, basic_block dest, int flags) void remove_edge (edge e) { - edge last_pred = NULL; - edge last_succ = NULL; - edge tmp; - basic_block src, dest; + remove_predictions_associated_with_edge (e); + execute_on_shrinking_pred (e); - src = e->src; - dest = e->dest; - for (tmp = src->succ; tmp && tmp != e; tmp = tmp->succ_next) - last_succ = tmp; - - if (!tmp) - abort (); - if (last_succ) - last_succ->succ_next = e->succ_next; - else - src->succ = e->succ_next; - - for (tmp = dest->pred; tmp && tmp != e; tmp = tmp->pred_next) - last_pred = tmp; - - if (!tmp) - abort (); - if (last_pred) - last_pred->pred_next = e->pred_next; - else - dest->pred = e->pred_next; + disconnect_src (e); + disconnect_dest (e); free_edge (e); } @@ -415,17 +359,16 @@ remove_edge (edge e) void redirect_edge_succ (edge e, basic_block new_succ) { - edge *pe; + execute_on_shrinking_pred (e); - /* Disconnect the edge from the old successor block. */ - for (pe = &e->dest->pred; *pe != e; pe = &(*pe)->pred_next) - continue; - *pe = (*pe)->pred_next; + disconnect_dest (e); + + e->dest = new_succ; /* Reconnect the edge to the new successor block. */ - e->pred_next = new_succ->pred; - new_succ->pred = e; - e->dest = new_succ; + connect_dest (e); + + execute_on_growing_pred (e); } /* Like previous but avoid possible duplicate edge. */ @@ -435,12 +378,8 @@ redirect_edge_succ_nodup (edge e, basic_block new_succ) { edge s; - /* Check whether the edge is already present. */ - for (s = e->src->succ; s; s = s->succ_next) - if (s->dest == new_succ && s != e) - break; - - if (s) + s = find_edge (e->src, new_succ); + if (s && s != e) { s->flags |= e->flags; s->probability += e->probability; @@ -461,94 +400,94 @@ redirect_edge_succ_nodup (edge e, basic_block new_succ) void redirect_edge_pred (edge e, basic_block new_pred) { - edge *pe; + disconnect_src (e); - /* Disconnect the edge from the old predecessor block. */ - for (pe = &e->src->succ; *pe != e; pe = &(*pe)->succ_next) - continue; - - *pe = (*pe)->succ_next; + e->src = new_pred; /* Reconnect the edge to the new predecessor block. */ - e->succ_next = new_pred->succ; - new_pred->succ = e; - e->src = new_pred; + connect_src (e); } +/* Clear all basic block flags, with the exception of partitioning. */ void clear_bb_flags (void) { basic_block bb; FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - bb->flags = 0; + bb->flags = (BB_PARTITION (bb) | (bb->flags & BB_DISABLE_SCHEDULE) + | (bb->flags & BB_RTL)); } +/* Check the consistency of profile information. We can't do that + in verify_flow_info, as the counts may get invalid for incompletely + solved graphs, later eliminating of conditionals or roundoff errors. + It is still practical to have them reported for debugging of simple + testcases. */ void -dump_flow_info (FILE *file) +check_bb_profile (basic_block bb, FILE * file) { - int i; - int max_regno = max_reg_num (); - basic_block bb; - static const char * const reg_class_names[] = REG_CLASS_NAMES; + edge e; + int sum = 0; + gcov_type lsum; + edge_iterator ei; - fprintf (file, "%d registers.\n", max_regno); - if (reg_n_info) - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) - if (REG_N_REFS (i)) - { - enum reg_class class, altclass; + if (profile_status == PROFILE_ABSENT) + return; - fprintf (file, "\nRegister %d used %d times across %d insns", - i, REG_N_REFS (i), REG_LIVE_LENGTH (i)); - if (REG_BASIC_BLOCK (i) >= 0) - fprintf (file, " in block %d", REG_BASIC_BLOCK (i)); - if (REG_N_SETS (i)) - fprintf (file, "; set %d time%s", REG_N_SETS (i), - (REG_N_SETS (i) == 1) ? "" : "s"); - if (regno_reg_rtx[i] != NULL && REG_USERVAR_P (regno_reg_rtx[i])) - fprintf (file, "; user var"); - if (REG_N_DEATHS (i) != 1) - fprintf (file, "; dies in %d places", REG_N_DEATHS (i)); - if (REG_N_CALLS_CROSSED (i) == 1) - fprintf (file, "; crosses 1 call"); - else if (REG_N_CALLS_CROSSED (i)) - fprintf (file, "; crosses %d calls", REG_N_CALLS_CROSSED (i)); - if (regno_reg_rtx[i] != NULL - && PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD) - fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i)); - - class = reg_preferred_class (i); - altclass = reg_alternate_class (i); - if (class != GENERAL_REGS || altclass != ALL_REGS) - { - if (altclass == ALL_REGS || class == ALL_REGS) - fprintf (file, "; pref %s", reg_class_names[(int) class]); - else if (altclass == NO_REGS) - fprintf (file, "; %s or none", reg_class_names[(int) class]); - else - fprintf (file, "; pref %s, else %s", - reg_class_names[(int) class], - reg_class_names[(int) altclass]); - } - - if (regno_reg_rtx[i] != NULL && REG_POINTER (regno_reg_rtx[i])) - fprintf (file, "; pointer"); - fprintf (file, ".\n"); - } - - fprintf (file, "\n%d basic blocks, %d edges.\n", n_basic_blocks, n_edges); - FOR_EACH_BB (bb) + if (bb != EXIT_BLOCK_PTR) { - edge e; - int sum; - gcov_type lsum; + FOR_EACH_EDGE (e, ei, bb->succs) + sum += e->probability; + if (EDGE_COUNT (bb->succs) && abs (sum - REG_BR_PROB_BASE) > 100) + fprintf (file, "Invalid sum of outgoing probabilities %.1f%%\n", + sum * 100.0 / REG_BR_PROB_BASE); + lsum = 0; + FOR_EACH_EDGE (e, ei, bb->succs) + lsum += e->count; + if (EDGE_COUNT (bb->succs) + && (lsum - bb->count > 100 || lsum - bb->count < -100)) + fprintf (file, "Invalid sum of outgoing counts %i, should be %i\n", + (int) lsum, (int) bb->count); + } + if (bb != ENTRY_BLOCK_PTR) + { + sum = 0; + FOR_EACH_EDGE (e, ei, bb->preds) + sum += EDGE_FREQUENCY (e); + if (abs (sum - bb->frequency) > 100) + fprintf (file, + "Invalid sum of incoming frequencies %i, should be %i\n", + sum, bb->frequency); + lsum = 0; + FOR_EACH_EDGE (e, ei, bb->preds) + lsum += e->count; + if (lsum - bb->count > 100 || lsum - bb->count < -100) + fprintf (file, "Invalid sum of incoming counts %i, should be %i\n", + (int) lsum, (int) bb->count); + } +} + +/* Emit basic block information for BB. HEADER is true if the user wants + the generic information and the predecessors, FOOTER is true if they want + the successors. FLAGS is the dump flags of interest; TDF_DETAILS emit + global register liveness information. PREFIX is put in front of every + line. The output is emitted to FILE. */ +void +dump_bb_info (basic_block bb, bool header, bool footer, int flags, + const char *prefix, FILE *file) +{ + edge e; + edge_iterator ei; - fprintf (file, "\nBasic block %d: first insn %d, last %d, ", - bb->index, INSN_UID (BB_HEAD (bb)), INSN_UID (BB_END (bb))); - fprintf (file, "prev %d, next %d, ", - bb->prev_bb->index, bb->next_bb->index); - fprintf (file, "loop_depth %d, count ", bb->loop_depth); + if (header) + { + fprintf (file, "\n%sBasic block %d ", prefix, bb->index); + if (bb->prev_bb) + fprintf (file, ", prev %d", bb->prev_bb->index); + if (bb->next_bb) + fprintf (file, ", next %d", bb->next_bb->index); + fprintf (file, ", loop_depth %d, count ", bb->loop_depth); fprintf (file, HOST_WIDEST_INT_PRINT_DEC, bb->count); fprintf (file, ", freq %i", bb->frequency); if (maybe_hot_bb_p (bb)) @@ -557,52 +496,97 @@ dump_flow_info (FILE *file) fprintf (file, ", probably never executed"); fprintf (file, ".\n"); - fprintf (file, "Predecessors: "); - for (e = bb->pred; e; e = e->pred_next) + fprintf (file, "%sPredecessors: ", prefix); + FOR_EACH_EDGE (e, ei, bb->preds) dump_edge_info (file, e, 0); + } - fprintf (file, "\nSuccessors: "); - for (e = bb->succ; e; e = e->succ_next) + if (footer) + { + fprintf (file, "\n%sSuccessors: ", prefix); + FOR_EACH_EDGE (e, ei, bb->succs) dump_edge_info (file, e, 1); + } - fprintf (file, "\nRegisters live at start:"); - dump_regset (bb->global_live_at_start, file); + if ((flags & TDF_DETAILS) + && (bb->flags & BB_RTL)) + { + if (bb->il.rtl->global_live_at_start && header) + { + fprintf (file, "\n%sRegisters live at start:", prefix); + dump_regset (bb->il.rtl->global_live_at_start, file); + } - fprintf (file, "\nRegisters live at end:"); - dump_regset (bb->global_live_at_end, file); + if (bb->il.rtl->global_live_at_end && footer) + { + fprintf (file, "\n%sRegisters live at end:", prefix); + dump_regset (bb->il.rtl->global_live_at_end, file); + } + } - putc ('\n', file); + putc ('\n', file); +} - /* Check the consistency of profile information. We can't do that - in verify_flow_info, as the counts may get invalid for incompletely - solved graphs, later eliminating of conditionals or roundoff errors. - It is still practical to have them reported for debugging of simple - testcases. */ - sum = 0; - for (e = bb->succ; e; e = e->succ_next) - sum += e->probability; - if (bb->succ && abs (sum - REG_BR_PROB_BASE) > 100) - fprintf (file, "Invalid sum of outgoing probabilities %.1f%%\n", - sum * 100.0 / REG_BR_PROB_BASE); - sum = 0; - for (e = bb->pred; e; e = e->pred_next) - sum += EDGE_FREQUENCY (e); - if (abs (sum - bb->frequency) > 100) - fprintf (file, - "Invalid sum of incomming frequencies %i, should be %i\n", - sum, bb->frequency); - lsum = 0; - for (e = bb->pred; e; e = e->pred_next) - lsum += e->count; - if (lsum - bb->count > 100 || lsum - bb->count < -100) - fprintf (file, "Invalid sum of incomming counts %i, should be %i\n", - (int)lsum, (int)bb->count); - lsum = 0; - for (e = bb->succ; e; e = e->succ_next) - lsum += e->count; - if (bb->succ && (lsum - bb->count > 100 || lsum - bb->count < -100)) - fprintf (file, "Invalid sum of incomming counts %i, should be %i\n", - (int)lsum, (int)bb->count); +void +dump_flow_info (FILE *file, int flags) +{ + basic_block bb; + + /* There are no pseudo registers after reload. Don't dump them. */ + if (reg_n_info && !reload_completed + && (flags & TDF_DETAILS) != 0) + { + unsigned int i, max = max_reg_num (); + fprintf (file, "%d registers.\n", max); + for (i = FIRST_PSEUDO_REGISTER; i < max; i++) + if (REG_N_REFS (i)) + { + enum reg_class class, altclass; + + fprintf (file, "\nRegister %d used %d times across %d insns", + i, REG_N_REFS (i), REG_LIVE_LENGTH (i)); + if (REG_BASIC_BLOCK (i) >= 0) + fprintf (file, " in block %d", REG_BASIC_BLOCK (i)); + if (REG_N_SETS (i)) + fprintf (file, "; set %d time%s", REG_N_SETS (i), + (REG_N_SETS (i) == 1) ? "" : "s"); + if (regno_reg_rtx[i] != NULL && REG_USERVAR_P (regno_reg_rtx[i])) + fprintf (file, "; user var"); + if (REG_N_DEATHS (i) != 1) + fprintf (file, "; dies in %d places", REG_N_DEATHS (i)); + if (REG_N_CALLS_CROSSED (i) == 1) + fprintf (file, "; crosses 1 call"); + else if (REG_N_CALLS_CROSSED (i)) + fprintf (file, "; crosses %d calls", REG_N_CALLS_CROSSED (i)); + if (regno_reg_rtx[i] != NULL + && PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD) + fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i)); + + class = reg_preferred_class (i); + altclass = reg_alternate_class (i); + if (class != GENERAL_REGS || altclass != ALL_REGS) + { + if (altclass == ALL_REGS || class == ALL_REGS) + fprintf (file, "; pref %s", reg_class_names[(int) class]); + else if (altclass == NO_REGS) + fprintf (file, "; %s or none", reg_class_names[(int) class]); + else + fprintf (file, "; pref %s, else %s", + reg_class_names[(int) class], + reg_class_names[(int) altclass]); + } + + if (regno_reg_rtx[i] != NULL && REG_POINTER (regno_reg_rtx[i])) + fprintf (file, "; pointer"); + fprintf (file, ".\n"); + } + } + + fprintf (file, "\n%d basic blocks, %d edges.\n", n_basic_blocks, n_edges); + FOR_EACH_BB (bb) + { + dump_bb_info (bb, true, true, flags, "", file); + check_bb_profile (bb, file); } putc ('\n', file); @@ -611,7 +595,7 @@ dump_flow_info (FILE *file) void debug_flow_info (void) { - dump_flow_info (stderr); + dump_flow_info (stderr, TDF_DETAILS); } void @@ -639,7 +623,8 @@ dump_edge_info (FILE *file, edge e, int do_succ) { static const char * const bitnames[] = { "fallthru", "ab", "abcall", "eh", "fake", "dfs_back", - "can_fallthru", "irreducible", "sibcall", "loop_exit" + "can_fallthru", "irreducible", "sibcall", "loop_exit", + "true", "false", "exec" }; int comma = 0; int i, flags = e->flags; @@ -677,8 +662,7 @@ inline void alloc_aux_for_block (basic_block bb, int size) { /* Verify that aux field is clear. */ - if (bb->aux || !first_block_aux_obj) - abort (); + gcc_assert (!bb->aux && first_block_aux_obj); bb->aux = obstack_alloc (&block_aux_obstack, size); memset (bb->aux, 0, size); } @@ -696,10 +680,10 @@ alloc_aux_for_blocks (int size) gcc_obstack_init (&block_aux_obstack); initialized = 1; } + else + /* Check whether AUX data are still allocated. */ + gcc_assert (!first_block_aux_obj); - /* Check whether AUX data are still allocated. */ - else if (first_block_aux_obj) - abort (); first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0); if (size) { @@ -727,8 +711,7 @@ clear_aux_for_blocks (void) void free_aux_for_blocks (void) { - if (!first_block_aux_obj) - abort (); + gcc_assert (first_block_aux_obj); obstack_free (&block_aux_obstack, first_block_aux_obj); first_block_aux_obj = NULL; @@ -742,8 +725,7 @@ inline void alloc_aux_for_edge (edge e, int size) { /* Verify that aux field is clear. */ - if (e->aux || !first_edge_aux_obj) - abort (); + gcc_assert (!e->aux && first_edge_aux_obj); e->aux = obstack_alloc (&edge_aux_obstack, size); memset (e->aux, 0, size); } @@ -761,10 +743,9 @@ alloc_aux_for_edges (int size) gcc_obstack_init (&edge_aux_obstack); initialized = 1; } - - /* Check whether AUX data are still allocated. */ - else if (first_edge_aux_obj) - abort (); + else + /* Check whether AUX data are still allocated. */ + gcc_assert (!first_edge_aux_obj); first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0); if (size) @@ -774,8 +755,9 @@ alloc_aux_for_edges (int size) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { edge e; + edge_iterator ei; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) alloc_aux_for_edge (e, size); } } @@ -791,7 +773,8 @@ clear_aux_for_edges (void) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - for (e = bb->succ; e; e = e->succ_next) + edge_iterator ei; + FOR_EACH_EDGE (e, ei, bb->succs) e->aux = NULL; } } @@ -802,193 +785,372 @@ clear_aux_for_edges (void) void free_aux_for_edges (void) { - if (!first_edge_aux_obj) - abort (); + gcc_assert (first_edge_aux_obj); obstack_free (&edge_aux_obstack, first_edge_aux_obj); first_edge_aux_obj = NULL; clear_aux_for_edges (); } -/* Verify the CFG consistency. - - Currently it does following checks edge and basic block list correctness - and calls into IL dependent checking then. */ -void -verify_flow_info (void) -{ - size_t *edge_checksum; - int num_bb_notes, err = 0; - basic_block bb, last_bb_seen; - basic_block *last_visited; - - last_visited = xcalloc (last_basic_block + 2, sizeof (basic_block)); - edge_checksum = xcalloc (last_basic_block + 2, sizeof (size_t)); - - /* Check bb chain & numbers. */ - last_bb_seen = ENTRY_BLOCK_PTR; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb) - { - if (bb != EXIT_BLOCK_PTR - && bb != BASIC_BLOCK (bb->index)) - { - error ("bb %d on wrong place", bb->index); - err = 1; - } - - if (bb->prev_bb != last_bb_seen) - { - error ("prev_bb of %d should be %d, not %d", - bb->index, last_bb_seen->index, bb->prev_bb->index); - err = 1; - } - - last_bb_seen = bb; - } - - /* Now check the basic blocks (boundaries etc.) */ - FOR_EACH_BB_REVERSE (bb) - { - int n_fallthru = 0; - edge e; - - if (bb->count < 0) - { - error ("verify_flow_info: Wrong count of block %i %i", - bb->index, (int)bb->count); - err = 1; - } - if (bb->frequency < 0) - { - error ("verify_flow_info: Wrong frequency of block %i %i", - bb->index, bb->frequency); - err = 1; - } - for (e = bb->succ; e; e = e->succ_next) - { - if (last_visited [e->dest->index + 2] == bb) - { - error ("verify_flow_info: Duplicate edge %i->%i", - e->src->index, e->dest->index); - err = 1; - } - if (e->probability < 0 || e->probability > REG_BR_PROB_BASE) - { - error ("verify_flow_info: Wrong probability of edge %i->%i %i", - e->src->index, e->dest->index, e->probability); - err = 1; - } - if (e->count < 0) - { - error ("verify_flow_info: Wrong count of edge %i->%i %i", - e->src->index, e->dest->index, (int)e->count); - err = 1; - } - - last_visited [e->dest->index + 2] = bb; - - if (e->flags & EDGE_FALLTHRU) - n_fallthru++; - - if (e->src != bb) - { - error ("verify_flow_info: Basic block %d succ edge is corrupted", - bb->index); - fprintf (stderr, "Predecessor: "); - dump_edge_info (stderr, e, 0); - fprintf (stderr, "\nSuccessor: "); - dump_edge_info (stderr, e, 1); - fprintf (stderr, "\n"); - err = 1; - } - - edge_checksum[e->dest->index + 2] += (size_t) e; - } - if (n_fallthru > 1) - { - error ("Wrong amount of branch edges after unconditional jump %i", bb->index); - err = 1; - } - - for (e = bb->pred; e; e = e->pred_next) - { - if (e->dest != bb) - { - error ("basic block %d pred edge is corrupted", bb->index); - fputs ("Predecessor: ", stderr); - dump_edge_info (stderr, e, 0); - fputs ("\nSuccessor: ", stderr); - dump_edge_info (stderr, e, 1); - fputc ('\n', stderr); - err = 1; - } - edge_checksum[e->dest->index + 2] -= (size_t) e; - } - } - - /* Complete edge checksumming for ENTRY and EXIT. */ - { - edge e; - - for (e = ENTRY_BLOCK_PTR->succ; e ; e = e->succ_next) - edge_checksum[e->dest->index + 2] += (size_t) e; - - for (e = EXIT_BLOCK_PTR->pred; e ; e = e->pred_next) - edge_checksum[e->dest->index + 2] -= (size_t) e; - } - - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - if (edge_checksum[bb->index + 2]) - { - error ("basic block %i edge lists are corrupted", bb->index); - err = 1; - } - - num_bb_notes = 0; - last_bb_seen = ENTRY_BLOCK_PTR; - - /* Clean up. */ - free (last_visited); - free (edge_checksum); - err |= cfg_hooks->cfgh_verify_flow_info (); - if (err) - internal_error ("verify_flow_info failed"); -} - -/* Print out one basic block with live information at start and end. */ - -void -dump_bb (basic_block bb, FILE *outf) -{ - edge e; - - fprintf (outf, ";; Basic block %d, loop depth %d, count ", - bb->index, bb->loop_depth); - fprintf (outf, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) bb->count); - putc ('\n', outf); - fputs (";; Predecessors: ", outf); - for (e = bb->pred; e; e = e->pred_next) - dump_edge_info (outf, e, 0); - putc ('\n', outf); - - cfg_hooks->dump_bb (bb, outf); - - fputs (";; Successors: ", outf); - for (e = bb->succ; e; e = e->succ_next) - dump_edge_info (outf, e, 1); - putc ('\n', outf); -} - void debug_bb (basic_block bb) { - dump_bb (bb, stderr); + dump_bb (bb, stderr, 0); } basic_block debug_bb_n (int n) { basic_block bb = BASIC_BLOCK (n); - dump_bb (bb, stderr); + dump_bb (bb, stderr, 0); return bb; } + +/* Dumps cfg related information about basic block BB to FILE. */ + +static void +dump_cfg_bb_info (FILE *file, basic_block bb) +{ + unsigned i; + edge_iterator ei; + bool first = true; + static const char * const bb_bitnames[] = + { + "dirty", "new", "reachable", "visited", "irreducible_loop", "superblock" + }; + const unsigned n_bitnames = sizeof (bb_bitnames) / sizeof (char *); + edge e; + + fprintf (file, "Basic block %d", bb->index); + for (i = 0; i < n_bitnames; i++) + if (bb->flags & (1 << i)) + { + if (first) + fprintf (file, " ("); + else + fprintf (file, ", "); + first = false; + fprintf (file, bb_bitnames[i]); + } + if (!first) + fprintf (file, ")"); + fprintf (file, "\n"); + + fprintf (file, "Predecessors: "); + FOR_EACH_EDGE (e, ei, bb->preds) + dump_edge_info (file, e, 0); + + fprintf (file, "\nSuccessors: "); + FOR_EACH_EDGE (e, ei, bb->succs) + dump_edge_info (file, e, 1); + fprintf (file, "\n\n"); +} + +/* Dumps a brief description of cfg to FILE. */ + +void +brief_dump_cfg (FILE *file) +{ + basic_block bb; + + FOR_EACH_BB (bb) + { + dump_cfg_bb_info (file, bb); + } +} + +/* An edge originally destinating BB of FREQUENCY and COUNT has been proved to + leave the block by TAKEN_EDGE. Update profile of BB such that edge E can be + redirected to destination of TAKEN_EDGE. + + This function may leave the profile inconsistent in the case TAKEN_EDGE + frequency or count is believed to be lower than FREQUENCY or COUNT + respectively. */ +void +update_bb_profile_for_threading (basic_block bb, int edge_frequency, + gcov_type count, edge taken_edge) +{ + edge c; + int prob; + edge_iterator ei; + + bb->count -= count; + if (bb->count < 0) + { + if (dump_file) + fprintf (dump_file, "bb %i count became negative after threading", + bb->index); + bb->count = 0; + } + + /* Compute the probability of TAKEN_EDGE being reached via threaded edge. + Watch for overflows. */ + if (bb->frequency) + prob = edge_frequency * REG_BR_PROB_BASE / bb->frequency; + else + prob = 0; + if (prob > taken_edge->probability) + { + if (dump_file) + fprintf (dump_file, "Jump threading proved probability of edge " + "%i->%i too small (it is %i, should be %i).\n", + taken_edge->src->index, taken_edge->dest->index, + taken_edge->probability, prob); + prob = taken_edge->probability; + } + + /* Now rescale the probabilities. */ + taken_edge->probability -= prob; + prob = REG_BR_PROB_BASE - prob; + bb->frequency -= edge_frequency; + if (bb->frequency < 0) + bb->frequency = 0; + if (prob <= 0) + { + if (dump_file) + fprintf (dump_file, "Edge frequencies of bb %i has been reset, " + "frequency of block should end up being 0, it is %i\n", + bb->index, bb->frequency); + EDGE_SUCC (bb, 0)->probability = REG_BR_PROB_BASE; + ei = ei_start (bb->succs); + ei_next (&ei); + for (; (c = ei_safe_edge (ei)); ei_next (&ei)) + c->probability = 0; + } + else if (prob != REG_BR_PROB_BASE) + { + int scale = RDIV (65536 * REG_BR_PROB_BASE, prob); + + FOR_EACH_EDGE (c, ei, bb->succs) + { + c->probability = RDIV (c->probability * scale, 65536); + if (c->probability > REG_BR_PROB_BASE) + c->probability = REG_BR_PROB_BASE; + } + } + + gcc_assert (bb == taken_edge->src); + taken_edge->count -= count; + if (taken_edge->count < 0) + { + if (dump_file) + fprintf (dump_file, "edge %i->%i count became negative after threading", + taken_edge->src->index, taken_edge->dest->index); + taken_edge->count = 0; + } +} + +/* Multiply all frequencies of basic blocks in array BBS of length NBBS + by NUM/DEN, in int arithmetic. May lose some accuracy. */ +void +scale_bbs_frequencies_int (basic_block *bbs, int nbbs, int num, int den) +{ + int i; + edge e; + if (num < 0) + num = 0; + if (num > den) + return; + /* Assume that the users are producing the fraction from frequencies + that never grow far enough to risk arithmetic overflow. */ + gcc_assert (num < 65536); + for (i = 0; i < nbbs; i++) + { + edge_iterator ei; + bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den); + bbs[i]->count = RDIV (bbs[i]->count * num, den); + FOR_EACH_EDGE (e, ei, bbs[i]->succs) + e->count = RDIV (e->count * num, den); + } +} + +/* numbers smaller than this value are safe to multiply without getting + 64bit overflow. */ +#define MAX_SAFE_MULTIPLIER (1 << (sizeof (HOST_WIDEST_INT) * 4 - 1)) + +/* Multiply all frequencies of basic blocks in array BBS of length NBBS + by NUM/DEN, in gcov_type arithmetic. More accurate than previous + function but considerably slower. */ +void +scale_bbs_frequencies_gcov_type (basic_block *bbs, int nbbs, gcov_type num, + gcov_type den) +{ + int i; + edge e; + gcov_type fraction = RDIV (num * 65536, den); + + gcc_assert (fraction >= 0); + + if (num < MAX_SAFE_MULTIPLIER) + for (i = 0; i < nbbs; i++) + { + edge_iterator ei; + bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den); + if (bbs[i]->count <= MAX_SAFE_MULTIPLIER) + bbs[i]->count = RDIV (bbs[i]->count * num, den); + else + bbs[i]->count = RDIV (bbs[i]->count * fraction, 65536); + FOR_EACH_EDGE (e, ei, bbs[i]->succs) + if (bbs[i]->count <= MAX_SAFE_MULTIPLIER) + e->count = RDIV (e->count * num, den); + else + e->count = RDIV (e->count * fraction, 65536); + } + else + for (i = 0; i < nbbs; i++) + { + edge_iterator ei; + if (sizeof (gcov_type) > sizeof (int)) + bbs[i]->frequency = RDIV (bbs[i]->frequency * num, den); + else + bbs[i]->frequency = RDIV (bbs[i]->frequency * fraction, 65536); + bbs[i]->count = RDIV (bbs[i]->count * fraction, 65536); + FOR_EACH_EDGE (e, ei, bbs[i]->succs) + e->count = RDIV (e->count * fraction, 65536); + } +} + +/* Data structures used to maintain mapping between basic blocks and + copies. */ +static htab_t bb_original; +static htab_t bb_copy; +static alloc_pool original_copy_bb_pool; + +struct htab_bb_copy_original_entry +{ + /* Block we are attaching info to. */ + int index1; + /* Index of original or copy (depending on the hashtable) */ + int index2; +}; + +static hashval_t +bb_copy_original_hash (const void *p) +{ + struct htab_bb_copy_original_entry *data + = ((struct htab_bb_copy_original_entry *)p); + + return data->index1; +} +static int +bb_copy_original_eq (const void *p, const void *q) +{ + struct htab_bb_copy_original_entry *data + = ((struct htab_bb_copy_original_entry *)p); + struct htab_bb_copy_original_entry *data2 + = ((struct htab_bb_copy_original_entry *)q); + + return data->index1 == data2->index1; +} + +/* Initialize the data structures to maintain mapping between blocks + and its copies. */ +void +initialize_original_copy_tables (void) +{ + gcc_assert (!original_copy_bb_pool); + original_copy_bb_pool + = create_alloc_pool ("original_copy", + sizeof (struct htab_bb_copy_original_entry), 10); + bb_original = htab_create (10, bb_copy_original_hash, + bb_copy_original_eq, NULL); + bb_copy = htab_create (10, bb_copy_original_hash, bb_copy_original_eq, NULL); +} + +/* Free the data structures to maintain mapping between blocks and + its copies. */ +void +free_original_copy_tables (void) +{ + gcc_assert (original_copy_bb_pool); + htab_delete (bb_copy); + htab_delete (bb_original); + free_alloc_pool (original_copy_bb_pool); + bb_copy = NULL; + bb_original = NULL; + original_copy_bb_pool = NULL; +} + +/* Set original for basic block. Do nothing when data structures are not + initialized so passes not needing this don't need to care. */ +void +set_bb_original (basic_block bb, basic_block original) +{ + if (original_copy_bb_pool) + { + struct htab_bb_copy_original_entry **slot; + struct htab_bb_copy_original_entry key; + + key.index1 = bb->index; + slot = + (struct htab_bb_copy_original_entry **) htab_find_slot (bb_original, + &key, INSERT); + if (*slot) + (*slot)->index2 = original->index; + else + { + *slot = pool_alloc (original_copy_bb_pool); + (*slot)->index1 = bb->index; + (*slot)->index2 = original->index; + } + } +} + +/* Get the original basic block. */ +basic_block +get_bb_original (basic_block bb) +{ + struct htab_bb_copy_original_entry *entry; + struct htab_bb_copy_original_entry key; + + gcc_assert (original_copy_bb_pool); + + key.index1 = bb->index; + entry = (struct htab_bb_copy_original_entry *) htab_find (bb_original, &key); + if (entry) + return BASIC_BLOCK (entry->index2); + else + return NULL; +} + +/* Set copy for basic block. Do nothing when data structures are not + initialized so passes not needing this don't need to care. */ +void +set_bb_copy (basic_block bb, basic_block copy) +{ + if (original_copy_bb_pool) + { + struct htab_bb_copy_original_entry **slot; + struct htab_bb_copy_original_entry key; + + key.index1 = bb->index; + slot = + (struct htab_bb_copy_original_entry **) htab_find_slot (bb_copy, + &key, INSERT); + if (*slot) + (*slot)->index2 = copy->index; + else + { + *slot = pool_alloc (original_copy_bb_pool); + (*slot)->index1 = bb->index; + (*slot)->index2 = copy->index; + } + } +} + +/* Get the copy of basic block. */ +basic_block +get_bb_copy (basic_block bb) +{ + struct htab_bb_copy_original_entry *entry; + struct htab_bb_copy_original_entry key; + + gcc_assert (original_copy_bb_pool); + + key.index1 = bb->index; + entry = (struct htab_bb_copy_original_entry *) htab_find (bb_copy, &key); + if (entry) + return BASIC_BLOCK (entry->index2); + else + return NULL; +} diff --git a/contrib/gcc/cfganal.c b/contrib/gcc/cfganal.c index aa3965cac07..467c399c84c 100644 --- a/contrib/gcc/cfganal.c +++ b/contrib/gcc/cfganal.c @@ -1,6 +1,6 @@ /* Control flow graph analysis code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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 contains various simple utilities to analyze the CFG. */ #include "config.h" @@ -25,12 +25,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "coretypes.h" #include "tm.h" #include "rtl.h" +#include "obstack.h" #include "hard-reg-set.h" #include "basic-block.h" #include "insn-config.h" #include "recog.h" #include "toplev.h" #include "tm_p.h" +#include "timevar.h" /* Store the data structures necessary for depth-first search. */ struct depth_first_search_dsS { @@ -49,10 +51,9 @@ typedef struct depth_first_search_dsS *depth_first_search_ds; static void flow_dfs_compute_reverse_init (depth_first_search_ds); static void flow_dfs_compute_reverse_add_bb (depth_first_search_ds, basic_block); -static basic_block flow_dfs_compute_reverse_execute (depth_first_search_ds); +static basic_block flow_dfs_compute_reverse_execute (depth_first_search_ds, + basic_block); static void flow_dfs_compute_reverse_finish (depth_first_search_ds); -static void remove_fake_successors (basic_block); -static bool need_fake_edge_p (rtx); static bool flow_active_insn_p (rtx); /* Like active_insn_p, except keep the return value clobber around @@ -68,9 +69,9 @@ flow_active_insn_p (rtx insn) programs that fail to return a value. Its effect is to keep the return value from being live across the entire function. If we allow it to be skipped, we introduce the - possibility for register livetime aborts. */ + possibility for register lifetime confusion. */ if (GET_CODE (PATTERN (insn)) == CLOBBER - && GET_CODE (XEXP (PATTERN (insn), 0)) == REG + && REG_P (XEXP (PATTERN (insn), 0)) && REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0))) return true; @@ -86,7 +87,7 @@ forwarder_block_p (basic_block bb) rtx insn; if (bb == EXIT_BLOCK_PTR || bb == ENTRY_BLOCK_PTR - || !bb->succ || bb->succ->succ_next) + || !single_succ_p (bb)) return false; for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) @@ -94,7 +95,7 @@ forwarder_block_p (basic_block bb) return false; return (!INSN_P (insn) - || (GET_CODE (insn) == JUMP_INSN && simplejump_p (insn)) + || (JUMP_P (insn) && simplejump_p (insn)) || !flow_active_insn_p (insn)); } @@ -104,17 +105,44 @@ bool can_fallthru (basic_block src, basic_block target) { rtx insn = BB_END (src); - rtx insn2 = target == EXIT_BLOCK_PTR ? NULL : BB_HEAD (target); + rtx insn2; + edge e; + edge_iterator ei; + if (target == EXIT_BLOCK_PTR) + return true; if (src->next_bb != target) return 0; + FOR_EACH_EDGE (e, ei, src->succs) + if (e->dest == EXIT_BLOCK_PTR + && e->flags & EDGE_FALLTHRU) + return 0; + insn2 = BB_HEAD (target); if (insn2 && !active_insn_p (insn2)) insn2 = next_active_insn (insn2); /* ??? Later we may add code to move jump tables offline. */ return next_active_insn (insn) == insn2; } + +/* Return nonzero if we could reach target from src by falling through, + if the target was made adjacent. If we already have a fall-through + edge to the exit block, we can't do that. */ +bool +could_fall_through (basic_block src, basic_block target) +{ + edge e; + edge_iterator ei; + + if (target == EXIT_BLOCK_PTR) + return true; + FOR_EACH_EDGE (e, ei, src->succs) + if (e->dest == EXIT_BLOCK_PTR + && e->flags & EDGE_FALLTHRU) + return 0; + return true; +} /* Mark the back edges in DFS traversal. Return nonzero if a loop (natural or otherwise) is present. @@ -124,12 +152,12 @@ can_fallthru (basic_block src, basic_block target) Steven Muchnick Morgan Kaufmann, 1997 - and heavily borrowed from flow_depth_first_order_compute. */ + and heavily borrowed from pre_and_rev_post_order_compute. */ bool mark_dfs_back_edges (void) { - edge *stack; + edge_iterator *stack; int *pre; int *post; int sp; @@ -139,11 +167,11 @@ mark_dfs_back_edges (void) bool found = false; /* Allocate the preorder and postorder number arrays. */ - pre = xcalloc (last_basic_block, sizeof (int)); - post = xcalloc (last_basic_block, sizeof (int)); + pre = XCNEWVEC (int, last_basic_block); + post = XCNEWVEC (int, last_basic_block); /* Allocate stack for back-tracking up CFG. */ - stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge)); + stack = XNEWVEC (edge_iterator, n_basic_blocks + 1); sp = 0; /* Allocate bitmap to track nodes that have been visited. */ @@ -153,19 +181,19 @@ mark_dfs_back_edges (void) sbitmap_zero (visited); /* Push the first edge on to the stack. */ - stack[sp++] = ENTRY_BLOCK_PTR->succ; + stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs); while (sp) { - edge e; + edge_iterator ei; basic_block src; basic_block dest; /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - src = e->src; - dest = e->dest; - e->flags &= ~EDGE_DFS_BACK; + ei = stack[sp - 1]; + src = ei_edge (ei)->src; + dest = ei_edge (ei)->dest; + ei_edge (ei)->flags &= ~EDGE_DFS_BACK; /* Check if the edge destination has been visited yet. */ if (dest != EXIT_BLOCK_PTR && ! TEST_BIT (visited, dest->index)) @@ -174,11 +202,11 @@ mark_dfs_back_edges (void) SET_BIT (visited, dest->index); pre[dest->index] = prenum++; - if (dest->succ) + if (EDGE_COUNT (dest->succs) > 0) { /* Since the DEST node has been visited for the first time, check its successors. */ - stack[sp++] = dest->succ; + stack[sp++] = ei_start (dest->succs); } else post[dest->index] = postnum++; @@ -188,13 +216,13 @@ mark_dfs_back_edges (void) if (dest != EXIT_BLOCK_PTR && src != ENTRY_BLOCK_PTR && pre[src->index] >= pre[dest->index] && post[dest->index] == 0) - e->flags |= EDGE_DFS_BACK, found = true; + ei_edge (ei)->flags |= EDGE_DFS_BACK, found = true; - if (! e->succ_next && src != ENTRY_BLOCK_PTR) + if (ei_one_before_end_p (ei) && src != ENTRY_BLOCK_PTR) post[src->index] = postnum++; - if (e->succ_next) - stack[sp - 1] = e->succ_next; + if (!ei_one_before_end_p (ei)) + ei_next (&stack[sp - 1]); else sp--; } @@ -218,8 +246,9 @@ set_edge_can_fallthru_flag (void) FOR_EACH_BB (bb) { edge e; + edge_iterator ei; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { e->flags &= ~EDGE_CAN_FALLTHRU; @@ -230,181 +259,18 @@ set_edge_can_fallthru_flag (void) /* If the BB ends with an invertible condjump all (2) edges are CAN_FALLTHRU edges. */ - if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next) + if (EDGE_COUNT (bb->succs) != 2) continue; if (!any_condjump_p (BB_END (bb))) continue; if (!invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0)) continue; invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0); - bb->succ->flags |= EDGE_CAN_FALLTHRU; - bb->succ->succ_next->flags |= EDGE_CAN_FALLTHRU; + EDGE_SUCC (bb, 0)->flags |= EDGE_CAN_FALLTHRU; + EDGE_SUCC (bb, 1)->flags |= EDGE_CAN_FALLTHRU; } } -/* Return true if we need to add fake edge to exit. - Helper function for the flow_call_edges_add. */ - -static bool -need_fake_edge_p (rtx insn) -{ - if (!INSN_P (insn)) - return false; - - if ((GET_CODE (insn) == CALL_INSN - && !SIBLING_CALL_P (insn) - && !find_reg_note (insn, REG_NORETURN, NULL) - && !find_reg_note (insn, REG_ALWAYS_RETURN, NULL) - && !CONST_OR_PURE_CALL_P (insn))) - return true; - - return ((GET_CODE (PATTERN (insn)) == ASM_OPERANDS - && MEM_VOLATILE_P (PATTERN (insn))) - || (GET_CODE (PATTERN (insn)) == PARALLEL - && asm_noperands (insn) != -1 - && MEM_VOLATILE_P (XVECEXP (PATTERN (insn), 0, 0))) - || GET_CODE (PATTERN (insn)) == ASM_INPUT); -} - -/* Add fake edges to the function exit for any non constant and non noreturn - calls, volatile inline assembly in the bitmap of blocks specified by - BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks - that were split. - - The goal is to expose cases in which entering a basic block does not imply - that all subsequent instructions must be executed. */ - -int -flow_call_edges_add (sbitmap blocks) -{ - int i; - int blocks_split = 0; - int last_bb = last_basic_block; - bool check_last_block = false; - - if (n_basic_blocks == 0) - return 0; - - if (! blocks) - check_last_block = true; - else - check_last_block = TEST_BIT (blocks, EXIT_BLOCK_PTR->prev_bb->index); - - /* In the last basic block, before epilogue generation, there will be - a fallthru edge to EXIT. Special care is required if the last insn - of the last basic block is a call because make_edge folds duplicate - edges, which would result in the fallthru edge also being marked - fake, which would result in the fallthru edge being removed by - remove_fake_edges, which would result in an invalid CFG. - - Moreover, we can't elide the outgoing fake edge, since the block - profiler needs to take this into account in order to solve the minimal - spanning tree in the case that the call doesn't return. - - Handle this by adding a dummy instruction in a new last basic block. */ - if (check_last_block) - { - basic_block bb = EXIT_BLOCK_PTR->prev_bb; - rtx insn = BB_END (bb); - - /* Back up past insns that must be kept in the same block as a call. */ - while (insn != BB_HEAD (bb) - && keep_with_call_p (insn)) - insn = PREV_INSN (insn); - - if (need_fake_edge_p (insn)) - { - edge e; - - for (e = bb->succ; e; e = e->succ_next) - if (e->dest == EXIT_BLOCK_PTR) - { - insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e); - commit_edge_insertions (); - break; - } - } - } - - /* Now add fake edges to the function exit for any non constant - calls since there is no way that we can determine if they will - return or not... */ - - for (i = 0; i < last_bb; i++) - { - basic_block bb = BASIC_BLOCK (i); - rtx libcall_end = NULL_RTX; - rtx insn; - rtx prev_insn; - - if (!bb) - continue; - - if (blocks && !TEST_BIT (blocks, i)) - continue; - - for (insn = BB_END (bb); ; insn = prev_insn) - { - prev_insn = PREV_INSN (insn); - if (need_fake_edge_p (insn)) - { - edge e; - rtx split_at_insn = insn; - - /* Don't split libcalls. */ - if (libcall_end) - split_at_insn = libcall_end; - - /* Don't split the block between a call and an insn that should - remain in the same block as the call. */ - else if (GET_CODE (insn) == CALL_INSN) - while (split_at_insn != BB_END (bb) - && keep_with_call_p (NEXT_INSN (split_at_insn))) - split_at_insn = NEXT_INSN (split_at_insn); - - /* The handling above of the final block before the epilogue - should be enough to verify that there is no edge to the exit - block in CFG already. Calling make_edge in such case would - cause us to mark that edge as fake and remove it later. */ - -#ifdef ENABLE_CHECKING - if (split_at_insn == BB_END (bb)) - for (e = bb->succ; e; e = e->succ_next) - if (e->dest == EXIT_BLOCK_PTR) - abort (); -#endif - - /* Note that the following may create a new basic block - and renumber the existing basic blocks. */ - if (split_at_insn != BB_END (bb)) - { - e = split_block (bb, split_at_insn); - if (e) - blocks_split++; - } - - make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE); - } - - /* Watch out for REG_LIBCALL/REG_RETVAL notes so that we know - whether we are currently in a libcall or not. Remember that - we are scanning backwards! */ - if (find_reg_note (insn, REG_RETVAL, NULL_RTX)) - libcall_end = insn; - if (find_reg_note (insn, REG_LIBCALL, NULL_RTX)) - libcall_end = NULL_RTX; - - if (insn == BB_HEAD (bb)) - break; - } - } - - if (blocks_split) - verify_flow_info (); - - return blocks_split; -} - /* Find unreachable blocks. An unreachable block will have 0 in the reachable bit in block->flags. A nonzero value indicates the block is reachable. */ @@ -413,9 +279,10 @@ void find_unreachable_blocks (void) { edge e; + edge_iterator ei; basic_block *tos, *worklist, bb; - tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks); + tos = worklist = XNEWVEC (basic_block, n_basic_blocks); /* Clear all the reachability flags. */ @@ -426,7 +293,7 @@ find_unreachable_blocks (void) be only one. It isn't inconceivable that we might one day directly support Fortran alternate entry points. */ - for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) { *tos++ = e->dest; @@ -440,12 +307,16 @@ find_unreachable_blocks (void) { basic_block b = *--tos; - for (e = b->succ; e; e = e->succ_next) - if (!(e->dest->flags & BB_REACHABLE)) - { - *tos++ = e->dest; - e->dest->flags |= BB_REACHABLE; - } + FOR_EACH_EDGE (e, ei, b->succs) + { + basic_block dest = e->dest; + + if (!(dest->flags & BB_REACHABLE)) + { + *tos++ = dest; + dest->flags |= BB_REACHABLE; + } + } } free (worklist); @@ -472,8 +343,9 @@ create_edge_list (void) int num_edges; int block_count; basic_block bb; + edge_iterator ei; - block_count = n_basic_blocks + 2; /* Include the entry and exit blocks. */ + block_count = n_basic_blocks; /* Include the entry and exit blocks. */ num_edges = 0; @@ -481,20 +353,19 @@ create_edge_list (void) edges on each basic block. */ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - for (e = bb->succ; e; e = e->succ_next) - num_edges++; + num_edges += EDGE_COUNT (bb->succs); } - elist = xmalloc (sizeof (struct edge_list)); + elist = XNEW (struct edge_list); elist->num_blocks = block_count; elist->num_edges = num_edges; - elist->index_to_edge = xmalloc (sizeof (edge) * num_edges); + elist->index_to_edge = XNEWVEC (edge, num_edges); num_edges = 0; /* Follow successors of blocks, and register these edges. */ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) elist->index_to_edge[num_edges++] = e; return elist; @@ -520,7 +391,7 @@ print_edge_list (FILE *f, struct edge_list *elist) int x; fprintf (f, "Compressed edge list, %d BBs + entry & exit, and %d edges\n", - elist->num_blocks - 2, elist->num_edges); + elist->num_blocks, elist->num_edges); for (x = 0; x < elist->num_edges; x++) { @@ -547,10 +418,11 @@ verify_edge_list (FILE *f, struct edge_list *elist) int pred, succ, index; edge e; basic_block bb, p, s; + edge_iterator ei; FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { pred = e->src->index; succ = e->dest->index; @@ -578,14 +450,14 @@ verify_edge_list (FILE *f, struct edge_list *elist) { int found_edge = 0; - for (e = p->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, p->succs) if (e->dest == s) { found_edge = 1; break; } - for (e = s->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, s->preds) if (e->src == p) { found_edge = 1; @@ -603,6 +475,31 @@ verify_edge_list (FILE *f, struct edge_list *elist) } } +/* Given PRED and SUCC blocks, return the edge which connects the blocks. + If no such edge exists, return NULL. */ + +edge +find_edge (basic_block pred, basic_block succ) +{ + edge e; + edge_iterator ei; + + if (EDGE_COUNT (pred->succs) <= EDGE_COUNT (succ->preds)) + { + FOR_EACH_EDGE (e, ei, pred->succs) + if (e->dest == succ) + return e; + } + else + { + FOR_EACH_EDGE (e, ei, succ->preds) + if (e->src == pred) + return e; + } + + return NULL; +} + /* This routine will determine what, if any, edge there is between a specified predecessor and successor. */ @@ -624,13 +521,15 @@ find_edge_index (struct edge_list *edge_list, basic_block pred, basic_block succ void flow_nodes_print (const char *str, const sbitmap nodes, FILE *file) { - int node; + unsigned int node = 0; + sbitmap_iterator sbi; if (! nodes) return; fprintf (file, "%s { ", str); - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, node, {fprintf (file, "%d ", node);}); + EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, node, sbi) + fprintf (file, "%d ", node); fputs ("}\n", file); } @@ -653,22 +552,22 @@ flow_edge_list_print (const char *str, const edge *edge_list, int num_edges, FIL } -/* This routine will remove any fake successor edges for a basic block. - When the edge is removed, it is also removed from whatever predecessor +/* This routine will remove any fake predecessor edges for a basic block. + When the edge is removed, it is also removed from whatever successor list it is in. */ static void -remove_fake_successors (basic_block bb) +remove_fake_predecessors (basic_block bb) { edge e; + edge_iterator ei; - for (e = bb->succ; e;) + for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); ) { - edge tmp = e; - - e = e->succ_next; - if ((tmp->flags & EDGE_FAKE) == EDGE_FAKE) - remove_edge (tmp); + if ((e->flags & EDGE_FAKE) == EDGE_FAKE) + remove_edge (e); + else + ei_next (&ei); } } @@ -681,10 +580,19 @@ remove_fake_edges (void) { basic_block bb; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - remove_fake_successors (bb); + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb) + remove_fake_predecessors (bb); } +/* This routine will remove all fake edges to the EXIT_BLOCK. */ + +void +remove_fake_exit_edges (void) +{ + remove_fake_predecessors (EXIT_BLOCK_PTR); +} + + /* This function will add a fake edge between any block which has no successors, and the exit block. Some data flow equations require these edges to exist. */ @@ -695,7 +603,7 @@ add_noreturn_fake_exit_edges (void) basic_block bb; FOR_EACH_BB (bb) - if (bb->succ == NULL) + if (EDGE_COUNT (bb->succs) == 0) make_single_succ_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE); } @@ -713,7 +621,7 @@ add_noreturn_fake_exit_edges (void) void connect_infinite_loops_to_exit (void) { - basic_block unvisited_block; + basic_block unvisited_block = EXIT_BLOCK_PTR; struct depth_first_search_dsS dfs_ds; /* Perform depth-first search in the reverse graph to find nodes @@ -724,7 +632,8 @@ connect_infinite_loops_to_exit (void) /* Repeatedly add fake edges, updating the unreachable nodes. */ while (1) { - unvisited_block = flow_dfs_compute_reverse_execute (&dfs_ds); + unvisited_block = flow_dfs_compute_reverse_execute (&dfs_ds, + unvisited_block); if (!unvisited_block) break; @@ -736,18 +645,22 @@ connect_infinite_loops_to_exit (void) return; } -/* Compute reverse top sort order. */ +/* Compute reverse top sort order. + This is computing a post order numbering of the graph. */ -void -flow_reverse_top_sort_order_compute (int *rts_order) +int +post_order_compute (int *post_order, bool include_entry_exit) { - edge *stack; + edge_iterator *stack; int sp; - int postnum = 0; + int post_order_num = 0; sbitmap visited; + if (include_entry_exit) + post_order[post_order_num++] = EXIT_BLOCK; + /* Allocate stack for back-tracking up CFG. */ - stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge)); + stack = XNEWVEC (edge_iterator, n_basic_blocks + 1); sp = 0; /* Allocate bitmap to track nodes that have been visited. */ @@ -757,18 +670,18 @@ flow_reverse_top_sort_order_compute (int *rts_order) sbitmap_zero (visited); /* Push the first edge on to the stack. */ - stack[sp++] = ENTRY_BLOCK_PTR->succ; + stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs); while (sp) { - edge e; + edge_iterator ei; basic_block src; basic_block dest; /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - src = e->src; - dest = e->dest; + ei = stack[sp - 1]; + src = ei_edge (ei)->src; + dest = ei_edge (ei)->dest; /* Check if the edge destination has been visited yet. */ if (dest != EXIT_BLOCK_PTR && ! TEST_BIT (visited, dest->index)) @@ -776,49 +689,69 @@ flow_reverse_top_sort_order_compute (int *rts_order) /* Mark that we have visited the destination. */ SET_BIT (visited, dest->index); - if (dest->succ) + if (EDGE_COUNT (dest->succs) > 0) /* Since the DEST node has been visited for the first time, check its successors. */ - stack[sp++] = dest->succ; + stack[sp++] = ei_start (dest->succs); else - rts_order[postnum++] = dest->index; + post_order[post_order_num++] = dest->index; } else { - if (! e->succ_next && src != ENTRY_BLOCK_PTR) - rts_order[postnum++] = src->index; + if (ei_one_before_end_p (ei) && src != ENTRY_BLOCK_PTR) + post_order[post_order_num++] = src->index; - if (e->succ_next) - stack[sp - 1] = e->succ_next; + if (!ei_one_before_end_p (ei)) + ei_next (&stack[sp - 1]); else sp--; } } + if (include_entry_exit) + post_order[post_order_num++] = ENTRY_BLOCK; + free (stack); sbitmap_free (visited); + return post_order_num; } /* Compute the depth first search order and store in the array - DFS_ORDER if nonzero, marking the nodes visited in VISITED. If - RC_ORDER is nonzero, return the reverse completion number for each + PRE_ORDER if nonzero, marking the nodes visited in VISITED. If + REV_POST_ORDER is nonzero, return the reverse completion number for each node. Returns the number of nodes visited. A depth first search tries to get as far away from the starting point as quickly as - possible. */ + possible. + + pre_order is a really a preorder numbering of the graph. + rev_post_order is really a reverse postorder numbering of the graph. + */ int -flow_depth_first_order_compute (int *dfs_order, int *rc_order) +pre_and_rev_post_order_compute (int *pre_order, int *rev_post_order, + bool include_entry_exit) { - edge *stack; + edge_iterator *stack; int sp; - int dfsnum = 0; - int rcnum = n_basic_blocks - 1; + int pre_order_num = 0; + int rev_post_order_num = n_basic_blocks - 1; sbitmap visited; /* Allocate stack for back-tracking up CFG. */ - stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge)); + stack = XNEWVEC (edge_iterator, n_basic_blocks + 1); sp = 0; + if (include_entry_exit) + { + if (pre_order) + pre_order[pre_order_num] = ENTRY_BLOCK; + pre_order_num++; + if (rev_post_order) + rev_post_order[rev_post_order_num--] = ENTRY_BLOCK; + } + else + rev_post_order_num -= NUM_FIXED_BLOCKS; + /* Allocate bitmap to track nodes that have been visited. */ visited = sbitmap_alloc (last_basic_block); @@ -826,18 +759,18 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order) sbitmap_zero (visited); /* Push the first edge on to the stack. */ - stack[sp++] = ENTRY_BLOCK_PTR->succ; + stack[sp++] = ei_start (ENTRY_BLOCK_PTR->succs); while (sp) { - edge e; + edge_iterator ei; basic_block src; basic_block dest; /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - src = e->src; - dest = e->dest; + ei = stack[sp - 1]; + src = ei_edge (ei)->src; + dest = ei_edge (ei)->dest; /* Check if the edge destination has been visited yet. */ if (dest != EXIT_BLOCK_PTR && ! TEST_BIT (visited, dest->index)) @@ -845,30 +778,30 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order) /* Mark that we have visited the destination. */ SET_BIT (visited, dest->index); - if (dfs_order) - dfs_order[dfsnum] = dest->index; + if (pre_order) + pre_order[pre_order_num] = dest->index; - dfsnum++; + pre_order_num++; - if (dest->succ) + if (EDGE_COUNT (dest->succs) > 0) /* Since the DEST node has been visited for the first time, check its successors. */ - stack[sp++] = dest->succ; - else if (rc_order) + stack[sp++] = ei_start (dest->succs); + else if (rev_post_order) /* There are no successors for the DEST node so assign its reverse completion number. */ - rc_order[rcnum--] = dest->index; + rev_post_order[rev_post_order_num--] = dest->index; } else { - if (! e->succ_next && src != ENTRY_BLOCK_PTR - && rc_order) + if (ei_one_before_end_p (ei) && src != ENTRY_BLOCK_PTR + && rev_post_order) /* There are no more successors for the SRC node so assign its reverse completion number. */ - rc_order[rcnum--] = src->index; + rev_post_order[rev_post_order_num--] = src->index; - if (e->succ_next) - stack[sp - 1] = e->succ_next; + if (!ei_one_before_end_p (ei)) + ei_next (&stack[sp - 1]); else sp--; } @@ -877,140 +810,22 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order) free (stack); sbitmap_free (visited); - /* The number of nodes visited should not be greater than - n_basic_blocks. */ - if (dfsnum > n_basic_blocks) - abort (); - - /* There are some nodes left in the CFG that are unreachable. */ - if (dfsnum < n_basic_blocks) - abort (); - - return dfsnum; -} - -struct dfst_node -{ - unsigned nnodes; - struct dfst_node **node; - struct dfst_node *up; -}; - -/* Compute a preorder transversal ordering such that a sub-tree which - is the source of a cross edge appears before the sub-tree which is - the destination of the cross edge. This allows for easy detection - of all the entry blocks for a loop. - - The ordering is compute by: - - 1) Generating a depth first spanning tree. - - 2) Walking the resulting tree from right to left. */ - -void -flow_preorder_transversal_compute (int *pot_order) -{ - edge e; - edge *stack; - int i; - int max_successors; - int sp; - sbitmap visited; - struct dfst_node *node; - struct dfst_node *dfst; - basic_block bb; - - /* Allocate stack for back-tracking up CFG. */ - stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge)); - sp = 0; - - /* Allocate the tree. */ - dfst = xcalloc (last_basic_block, sizeof (struct dfst_node)); - - FOR_EACH_BB (bb) + if (include_entry_exit) { - max_successors = 0; - for (e = bb->succ; e; e = e->succ_next) - max_successors++; - - dfst[bb->index].node - = (max_successors - ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL); + if (pre_order) + pre_order[pre_order_num] = EXIT_BLOCK; + pre_order_num++; + if (rev_post_order) + rev_post_order[rev_post_order_num--] = EXIT_BLOCK; + /* The number of nodes visited should be the number of blocks. */ + gcc_assert (pre_order_num == n_basic_blocks); } + else + /* The number of nodes visited should be the number of blocks minus + the entry and exit blocks which are not visited here. */ + gcc_assert (pre_order_num == n_basic_blocks - NUM_FIXED_BLOCKS); - /* Allocate bitmap to track nodes that have been visited. */ - visited = sbitmap_alloc (last_basic_block); - - /* None of the nodes in the CFG have been visited yet. */ - sbitmap_zero (visited); - - /* Push the first edge on to the stack. */ - stack[sp++] = ENTRY_BLOCK_PTR->succ; - - while (sp) - { - basic_block src; - basic_block dest; - - /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - src = e->src; - dest = e->dest; - - /* Check if the edge destination has been visited yet. */ - if (dest != EXIT_BLOCK_PTR && ! TEST_BIT (visited, dest->index)) - { - /* Mark that we have visited the destination. */ - SET_BIT (visited, dest->index); - - /* Add the destination to the preorder tree. */ - if (src != ENTRY_BLOCK_PTR) - { - dfst[src->index].node[dfst[src->index].nnodes++] - = &dfst[dest->index]; - dfst[dest->index].up = &dfst[src->index]; - } - - if (dest->succ) - /* Since the DEST node has been visited for the first - time, check its successors. */ - stack[sp++] = dest->succ; - } - - else if (e->succ_next) - stack[sp - 1] = e->succ_next; - else - sp--; - } - - free (stack); - sbitmap_free (visited); - - /* Record the preorder transversal order by - walking the tree from right to left. */ - - i = 0; - node = &dfst[ENTRY_BLOCK_PTR->next_bb->index]; - pot_order[i++] = 0; - - while (node) - { - if (node->nnodes) - { - node = node->node[--node->nnodes]; - pot_order[i++] = node - dfst; - } - else - node = node->up; - } - - /* Free the tree. */ - - for (i = 0; i < last_basic_block; i++) - if (dfst[i].node) - free (dfst[i].node); - - free (dfst); + return pre_order_num; } /* Compute the depth first search order on the _reverse_ graph and @@ -1047,12 +862,11 @@ static void flow_dfs_compute_reverse_init (depth_first_search_ds data) { /* Allocate stack for back-tracking up CFG. */ - data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1)) - * sizeof (basic_block)); + data->stack = XNEWVEC (basic_block, n_basic_blocks); data->sp = 0; /* Allocate bitmap to track nodes that have been visited. */ - data->visited_blocks = sbitmap_alloc (last_basic_block - (INVALID_BLOCK + 1)); + data->visited_blocks = sbitmap_alloc (last_basic_block); /* None of the nodes in the CFG have been visited yet. */ sbitmap_zero (data->visited_blocks); @@ -1068,7 +882,7 @@ static void flow_dfs_compute_reverse_add_bb (depth_first_search_ds data, basic_block bb) { data->stack[data->sp++] = bb; - SET_BIT (data->visited_blocks, bb->index - (INVALID_BLOCK + 1)); + SET_BIT (data->visited_blocks, bb->index); } /* Continue the depth-first search through the reverse graph starting with the @@ -1077,25 +891,26 @@ flow_dfs_compute_reverse_add_bb (depth_first_search_ds data, basic_block bb) available. */ static basic_block -flow_dfs_compute_reverse_execute (depth_first_search_ds data) +flow_dfs_compute_reverse_execute (depth_first_search_ds data, + basic_block last_unvisited) { basic_block bb; edge e; + edge_iterator ei; while (data->sp > 0) { bb = data->stack[--data->sp]; /* Perform depth-first search on adjacent vertices. */ - for (e = bb->pred; e; e = e->pred_next) - if (!TEST_BIT (data->visited_blocks, - e->src->index - (INVALID_BLOCK + 1))) + FOR_EACH_EDGE (e, ei, bb->preds) + if (!TEST_BIT (data->visited_blocks, e->src->index)) flow_dfs_compute_reverse_add_bb (data, e->src); } /* Determine if there are unvisited basic blocks. */ - FOR_BB_BETWEEN (bb, EXIT_BLOCK_PTR, NULL, prev_bb) - if (!TEST_BIT (data->visited_blocks, bb->index - (INVALID_BLOCK + 1))) + FOR_BB_BETWEEN (bb, last_unvisited, NULL, prev_bb) + if (!TEST_BIT (data->visited_blocks, bb->index)) return bb; return NULL; @@ -1121,39 +936,144 @@ dfs_enumerate_from (basic_block bb, int reverse, { basic_block *st, lbb; int sp = 0, tv = 0; + unsigned size; - st = xcalloc (rslt_max, sizeof (basic_block)); + /* A bitmap to keep track of visited blocks. Allocating it each time + this function is called is not possible, since dfs_enumerate_from + is often used on small (almost) disjoint parts of cfg (bodies of + loops), and allocating a large sbitmap would lead to quadratic + behavior. */ + static sbitmap visited; + static unsigned v_size; + +#define MARK_VISITED(BB) (SET_BIT (visited, (BB)->index)) +#define UNMARK_VISITED(BB) (RESET_BIT (visited, (BB)->index)) +#define VISITED_P(BB) (TEST_BIT (visited, (BB)->index)) + + /* Resize the VISITED sbitmap if necessary. */ + size = last_basic_block; + if (size < 10) + size = 10; + + if (!visited) + { + + visited = sbitmap_alloc (size); + sbitmap_zero (visited); + v_size = size; + } + else if (v_size < size) + { + /* Ensure that we increase the size of the sbitmap exponentially. */ + if (2 * v_size > size) + size = 2 * v_size; + + visited = sbitmap_resize (visited, size, 0); + v_size = size; + } + + st = XCNEWVEC (basic_block, rslt_max); rslt[tv++] = st[sp++] = bb; - bb->flags |= BB_VISITED; + MARK_VISITED (bb); while (sp) { edge e; + edge_iterator ei; lbb = st[--sp]; if (reverse) - { - for (e = lbb->pred; e; e = e->pred_next) - if (!(e->src->flags & BB_VISITED) && predicate (e->src, data)) + { + FOR_EACH_EDGE (e, ei, lbb->preds) + if (!VISITED_P (e->src) && predicate (e->src, data)) { - if (tv == rslt_max) - abort (); - rslt[tv++] = st[sp++] = e->src; - e->src->flags |= BB_VISITED; + gcc_assert (tv != rslt_max); + rslt[tv++] = st[sp++] = e->src; + MARK_VISITED (e->src); } - } + } else - { - for (e = lbb->succ; e; e = e->succ_next) - if (!(e->dest->flags & BB_VISITED) && predicate (e->dest, data)) + { + FOR_EACH_EDGE (e, ei, lbb->succs) + if (!VISITED_P (e->dest) && predicate (e->dest, data)) { - if (tv == rslt_max) - abort (); - rslt[tv++] = st[sp++] = e->dest; - e->dest->flags |= BB_VISITED; + gcc_assert (tv != rslt_max); + rslt[tv++] = st[sp++] = e->dest; + MARK_VISITED (e->dest); } } } free (st); for (sp = 0; sp < tv; sp++) - rslt[sp]->flags &= ~BB_VISITED; + UNMARK_VISITED (rslt[sp]); return tv; +#undef MARK_VISITED +#undef UNMARK_VISITED +#undef VISITED_P } + + +/* Compute dominance frontiers, ala Harvey, Ferrante, et al. + + This algorithm can be found in Timothy Harvey's PhD thesis, at + http://www.cs.rice.edu/~harv/dissertation.pdf in the section on iterative + dominance algorithms. + + First, we identify each join point, j (any node with more than one + incoming edge is a join point). + + We then examine each predecessor, p, of j and walk up the dominator tree + starting at p. + + We stop the walk when we reach j's immediate dominator - j is in the + dominance frontier of each of the nodes in the walk, except for j's + immediate dominator. Intuitively, all of the rest of j's dominators are + shared by j's predecessors as well. + Since they dominate j, they will not have j in their dominance frontiers. + + The number of nodes touched by this algorithm is equal to the size + of the dominance frontiers, no more, no less. +*/ + + +static void +compute_dominance_frontiers_1 (bitmap *frontiers) +{ + edge p; + edge_iterator ei; + basic_block b; + FOR_EACH_BB (b) + { + if (EDGE_COUNT (b->preds) >= 2) + { + FOR_EACH_EDGE (p, ei, b->preds) + { + basic_block runner = p->src; + basic_block domsb; + if (runner == ENTRY_BLOCK_PTR) + continue; + + domsb = get_immediate_dominator (CDI_DOMINATORS, b); + while (runner != domsb) + { + if (bitmap_bit_p (frontiers[runner->index], b->index)) + break; + bitmap_set_bit (frontiers[runner->index], + b->index); + runner = get_immediate_dominator (CDI_DOMINATORS, + runner); + } + } + } + } +} + + +void +compute_dominance_frontiers (bitmap *frontiers) +{ + timevar_push (TV_DOM_FRONTIERS); + + compute_dominance_frontiers_1 (frontiers); + + timevar_pop (TV_DOM_FRONTIERS); +} + diff --git a/contrib/gcc/cfgbuild.c b/contrib/gcc/cfgbuild.c index 5805e587ec8..bbd38e1a038 100644 --- a/contrib/gcc/cfgbuild.c +++ b/contrib/gcc/cfgbuild.c @@ -1,6 +1,6 @@ /* Control flow graph building code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ /* find_basic_blocks divides the current function's rtl into basic blocks and constructs the CFG. The blocks are recorded in the @@ -28,9 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA Available functionality: - CFG construction - find_basic_blocks - - Local CFG construction - find_sub_basic_blocks */ + find_basic_blocks */ #include "config.h" #include "system.h" @@ -50,10 +48,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static int count_basic_blocks (rtx); static void find_basic_blocks_1 (rtx); -static rtx find_label_refs (rtx, rtx); -static void make_edges (rtx, basic_block, basic_block, int); -static void make_label_edge (sbitmap *, basic_block, rtx, int); -static void make_eh_edge (sbitmap *, basic_block, rtx); +static void make_edges (basic_block, basic_block, int); +static void make_label_edge (sbitmap, basic_block, rtx, int); static void find_bb_boundaries (basic_block); static void compute_outgoing_frequencies (basic_block); @@ -68,7 +64,7 @@ inside_basic_block_p (rtx insn) case CODE_LABEL: /* Avoid creating of basic block for jumptables. */ return (NEXT_INSN (insn) == 0 - || GET_CODE (NEXT_INSN (insn)) != JUMP_INSN + || !JUMP_P (NEXT_INSN (insn)) || (GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_VEC && GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_DIFF_VEC)); @@ -85,7 +81,7 @@ inside_basic_block_p (rtx insn) return false; default: - abort (); + gcc_unreachable (); } } @@ -109,6 +105,12 @@ control_flow_insn_p (rtx insn) && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC); case CALL_INSN: + /* Noreturn and sibling call instructions terminate the basic blocks + (but only if they happen unconditionally). */ + if ((SIBLING_CALL_P (insn) + || find_reg_note (insn, REG_NORETURN, 0)) + && GET_CODE (PATTERN (insn)) != COND_EXEC) + return true; /* Call insn may return to the nonlocal goto handler. */ return ((nonlocal_goto_handler_labels && (0 == (note = find_reg_note (insn, REG_EH_REGION, @@ -118,16 +120,21 @@ control_flow_insn_p (rtx insn) || can_throw_internal (insn)); case INSN: + /* Treat trap instructions like noreturn calls (same provision). */ + if (GET_CODE (PATTERN (insn)) == TRAP_IF + && XEXP (PATTERN (insn), 0) == const1_rtx) + return true; + return (flag_non_call_exceptions && can_throw_internal (insn)); case BARRIER: /* It is nonsense to reach barrier when looking for the - end of basic block, but before dead code is eliminated - this may happen. */ + end of basic block, but before dead code is eliminated + this may happen. */ return false; default: - abort (); + gcc_unreachable (); } } @@ -136,15 +143,15 @@ control_flow_insn_p (rtx insn) static int count_basic_blocks (rtx f) { - int count = 0; + int count = NUM_FIXED_BLOCKS; bool saw_insn = false; rtx insn; for (insn = f; insn; insn = NEXT_INSN (insn)) { /* Code labels and barriers causes current basic block to be - terminated at previous real insn. */ - if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER) + terminated at previous real insn. */ + if ((LABEL_P (insn) || BARRIER_P (insn)) && saw_insn) count++, saw_insn = false; @@ -162,59 +169,14 @@ count_basic_blocks (rtx f) /* The rest of the compiler works a bit smoother when we don't have to check for the edge case of do-nothing functions with no basic blocks. */ - if (count == 0) + if (count == NUM_FIXED_BLOCKS) { emit_insn (gen_rtx_USE (VOIDmode, const0_rtx)); - count = 1; + count = NUM_FIXED_BLOCKS + 1; } return count; } - -/* Scan a list of insns for labels referred to other than by jumps. - This is used to scan the alternatives of a call placeholder. */ - -static rtx -find_label_refs (rtx f, rtx lvl) -{ - rtx insn; - - for (insn = f; insn; insn = NEXT_INSN (insn)) - if (INSN_P (insn) && GET_CODE (insn) != JUMP_INSN) - { - rtx note; - - /* Make a list of all labels referred to other than by jumps - (which just don't have the REG_LABEL notes). - - Make a special exception for labels followed by an ADDR*VEC, - as this would be a part of the tablejump setup code. - - Make a special exception to registers loaded with label - values just before jump insns that use them. */ - - for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) - if (REG_NOTE_KIND (note) == REG_LABEL) - { - rtx lab = XEXP (note, 0), next; - - if ((next = next_nonnote_insn (lab)) != NULL - && GET_CODE (next) == JUMP_INSN - && (GET_CODE (PATTERN (next)) == ADDR_VEC - || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) - ; - else if (GET_CODE (lab) == NOTE) - ; - else if (GET_CODE (NEXT_INSN (insn)) == JUMP_INSN - && find_reg_note (NEXT_INSN (insn), REG_LABEL, lab)) - ; - else - lvl = alloc_EXPR_LIST (0, XEXP (note, 0), lvl); - } - } - - return lvl; -} /* Create an edge between two basic blocks. FLAGS are auxiliary information about the edge that is accumulated between calls. */ @@ -222,10 +184,9 @@ find_label_refs (rtx f, rtx lvl) /* Create an edge from a basic block to a label. */ static void -make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags) +make_label_edge (sbitmap edge_cache, basic_block src, rtx label, int flags) { - if (GET_CODE (label) != CODE_LABEL) - abort (); + gcc_assert (LABEL_P (label)); /* If the label was never emitted, this insn is junk, but avoid a crash trying to refer to BLOCK_FOR_INSN (label). This can happen @@ -240,10 +201,10 @@ make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags) /* Create the edges generated by INSN in REGION. */ -static void -make_eh_edge (sbitmap *edge_cache, basic_block src, rtx insn) +void +rtl_make_eh_edge (sbitmap edge_cache, basic_block src, rtx insn) { - int is_call = GET_CODE (insn) == CALL_INSN ? EDGE_ABNORMAL_CALL : 0; + int is_call = CALL_P (insn) ? EDGE_ABNORMAL_CALL : 0; rtx handlers, i; handlers = reachable_handlers (insn); @@ -255,55 +216,78 @@ make_eh_edge (sbitmap *edge_cache, basic_block src, rtx insn) free_INSN_LIST_list (&handlers); } -/* Identify the edges between basic blocks MIN to MAX. +/* States of basic block as seen by find_many_sub_basic_blocks. */ +enum state { + /* Basic blocks created via split_block belong to this state. + make_edges will examine these basic blocks to see if we need to + create edges going out of them. */ + BLOCK_NEW = 0, - NONLOCAL_LABEL_LIST is a list of non-local labels in the function. Blocks - that are otherwise unreachable may be reachable with a non-local goto. + /* Basic blocks that do not need examining belong to this state. + These blocks will be left intact. In particular, make_edges will + not create edges going out of these basic blocks. */ + BLOCK_ORIGINAL, - BB_EH_END is an array indexed by basic block number in which we record - the list of exception regions active at the end of the basic block. */ + /* Basic blocks that may need splitting (due to a label appearing in + the middle, etc) belong to this state. After splitting them, + make_edges will create edges going out of them as needed. */ + BLOCK_TO_SPLIT +}; + +#define STATE(BB) (enum state) ((size_t) (BB)->aux) +#define SET_STATE(BB, STATE) ((BB)->aux = (void *) (size_t) (STATE)) + +/* Used internally by purge_dead_tablejump_edges, ORed into state. */ +#define BLOCK_USED_BY_TABLEJUMP 32 +#define FULL_STATE(BB) ((size_t) (BB)->aux) + +/* Identify the edges going out of basic blocks between MIN and MAX, + inclusive, that have their states set to BLOCK_NEW or + BLOCK_TO_SPLIT. + + UPDATE_P should be nonzero if we are updating CFG and zero if we + are building CFG from scratch. */ static void -make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p) +make_edges (basic_block min, basic_block max, int update_p) { basic_block bb; - sbitmap *edge_cache = NULL; - - /* Assume no computed jump; revise as we create edges. */ - current_function_has_computed_jump = 0; + sbitmap edge_cache = NULL; /* Heavy use of computed goto in machine-generated code can lead to nearly fully-connected CFGs. In that case we spend a significant amount of time searching the edge lists for duplicates. */ - if (forced_labels || label_value_list || cfun->max_jumptable_ents > 100) - { - edge_cache = sbitmap_vector_alloc (last_basic_block, last_basic_block); - sbitmap_vector_zero (edge_cache, last_basic_block); - - if (update_p) - FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) - { - edge e; - - for (e = bb->succ; e ; e = e->succ_next) - if (e->dest != EXIT_BLOCK_PTR) - SET_BIT (edge_cache[bb->index], e->dest->index); - } - } + if (forced_labels || cfun->max_jumptable_ents > 100) + edge_cache = sbitmap_alloc (last_basic_block); /* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block is always the entry. */ if (min == ENTRY_BLOCK_PTR->next_bb) - cached_make_edge (edge_cache, ENTRY_BLOCK_PTR, min, - EDGE_FALLTHRU); + make_edge (ENTRY_BLOCK_PTR, min, EDGE_FALLTHRU); FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) { rtx insn, x; enum rtx_code code; - int force_fallthru = 0; + edge e; + edge_iterator ei; - if (GET_CODE (BB_HEAD (bb)) == CODE_LABEL + if (STATE (bb) == BLOCK_ORIGINAL) + continue; + + /* If we have an edge cache, cache edges going out of BB. */ + if (edge_cache) + { + sbitmap_zero (edge_cache); + if (update_p) + { + FOR_EACH_EDGE (e, ei, bb->succs) + if (e->dest != EXIT_BLOCK_PTR) + SET_BIT (edge_cache, e->dest->index); + } + } + + if (LABEL_P (BB_HEAD (bb)) && LABEL_ALT_ENTRY_P (BB_HEAD (bb))) cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0); @@ -320,7 +304,7 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p /* Recognize exception handling placeholders. */ if (GET_CODE (PATTERN (insn)) == RESX) - make_eh_edge (edge_cache, bb, insn); + rtl_make_eh_edge (edge_cache, bb, insn); /* Recognize a non-local goto as a branch outside the current function. */ @@ -351,23 +335,12 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF) make_label_edge (edge_cache, bb, XEXP (XEXP (SET_SRC (tmp), 2), 0), 0); - -#ifdef CASE_DROPS_THROUGH - /* Silly VAXen. The ADDR_VEC is going to be in the way of - us naturally detecting fallthru into the next block. */ - force_fallthru = 1; -#endif } /* If this is a computed jump, then mark it as reaching - everything on the label_value_list and forced_labels list. */ + everything on the forced_labels list. */ else if (computed_jump_p (insn)) { - current_function_has_computed_jump = 1; - - for (x = label_value_list; x; x = XEXP (x, 1)) - make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL); - for (x = forced_labels; x; x = XEXP (x, 1)) make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL); } @@ -379,8 +352,7 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p /* Otherwise, we have a plain conditional or unconditional jump. */ else { - if (! JUMP_LABEL (insn)) - abort (); + gcc_assert (JUMP_LABEL (insn)); make_label_edge (edge_cache, bb, JUMP_LABEL (insn), 0); } } @@ -400,7 +372,7 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p else if (code == CALL_INSN || flag_non_call_exceptions) { /* Add any appropriate EH edges. */ - make_eh_edge (edge_cache, bb, insn); + rtl_make_eh_edge (edge_cache, bb, insn); if (code == CALL_INSN && nonlocal_goto_handler_labels) { @@ -424,16 +396,20 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p /* Find out if we can drop through to the next block. */ insn = NEXT_INSN (insn); + e = find_edge (bb, EXIT_BLOCK_PTR); + if (e && e->flags & EDGE_FALLTHRU) + insn = NULL; + while (insn - && GET_CODE (insn) == NOTE + && NOTE_P (insn) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK) insn = NEXT_INSN (insn); - if (!insn || (bb->next_bb == EXIT_BLOCK_PTR && force_fallthru)) + if (!insn) cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU); else if (bb->next_bb != EXIT_BLOCK_PTR) { - if (force_fallthru || insn == BB_HEAD (bb->next_bb)) + if (insn == BB_HEAD (bb->next_bb)) cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU); } } @@ -452,8 +428,6 @@ find_basic_blocks_1 (rtx f) { rtx insn, next; rtx bb_note = NULL_RTX; - rtx lvl = NULL_RTX; - rtx trll = NULL_RTX; rtx head = NULL_RTX; rtx end = NULL_RTX; basic_block prev = ENTRY_BLOCK_PTR; @@ -470,7 +444,7 @@ find_basic_blocks_1 (rtx f) next = NEXT_INSN (insn); - if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER) + if ((LABEL_P (insn) || BARRIER_P (insn)) && head) { prev = create_basic_block_structure (head, end, bb_note, prev); @@ -514,57 +488,13 @@ find_basic_blocks_1 (rtx f) case CODE_LABEL: case JUMP_INSN: + case CALL_INSN: case INSN: case BARRIER: break; - case CALL_INSN: - if (GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER) - { - /* Scan each of the alternatives for label refs. */ - lvl = find_label_refs (XEXP (PATTERN (insn), 0), lvl); - lvl = find_label_refs (XEXP (PATTERN (insn), 1), lvl); - lvl = find_label_refs (XEXP (PATTERN (insn), 2), lvl); - /* Record its tail recursion label, if any. */ - if (XEXP (PATTERN (insn), 3) != NULL_RTX) - trll = alloc_EXPR_LIST (0, XEXP (PATTERN (insn), 3), trll); - } - break; - default: - abort (); - } - - if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) - { - rtx note; - - /* Make a list of all labels referred to other than by jumps. - - Make a special exception for labels followed by an ADDR*VEC, - as this would be a part of the tablejump setup code. - - Make a special exception to registers loaded with label - values just before jump insns that use them. */ - - for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) - if (REG_NOTE_KIND (note) == REG_LABEL) - { - rtx lab = XEXP (note, 0), next; - - if ((next = next_nonnote_insn (lab)) != NULL - && GET_CODE (next) == JUMP_INSN - && (GET_CODE (PATTERN (next)) == ADDR_VEC - || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) - ; - else if (GET_CODE (lab) == NOTE) - ; - else if (GET_CODE (NEXT_INSN (insn)) == JUMP_INSN - && find_reg_note (NEXT_INSN (insn), REG_LABEL, lab)) - ; - else - lvl = alloc_EXPR_LIST (0, XEXP (note, 0), lvl); - } + gcc_unreachable (); } } @@ -573,22 +503,17 @@ find_basic_blocks_1 (rtx f) else if (bb_note) delete_insn (bb_note); - if (last_basic_block != n_basic_blocks) - abort (); + gcc_assert (last_basic_block == n_basic_blocks); - label_value_list = lvl; - tail_recursion_label_list = trll; clear_aux_for_blocks (); } /* Find basic blocks of the current function. - F is the first insn of the function and NREGS the number of register - numbers in use. */ + F is the first insn of the function. */ void -find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED, - FILE *file ATTRIBUTE_UNUSED) +find_basic_blocks (rtx f) { basic_block bb; @@ -605,14 +530,15 @@ find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED, FOR_EACH_BB (bb) bb->aux = NULL; - VARRAY_FREE (basic_block_info); + basic_block_info = NULL; } n_basic_blocks = count_basic_blocks (f); - last_basic_block = 0; + last_basic_block = NUM_FIXED_BLOCKS; ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR; EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR; + /* Size the basic block table. The actual structures will be allocated by find_basic_blocks_1, since we want to keep the structure pointers stable across calls to find_basic_blocks. */ @@ -621,12 +547,23 @@ find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED, instructions at all until close to the end of compilation when we actually lay them out. */ - VARRAY_BB_INIT (basic_block_info, n_basic_blocks, "basic_block_info"); + basic_block_info = VEC_alloc (basic_block, gc, n_basic_blocks); + VEC_safe_grow (basic_block, gc, basic_block_info, n_basic_blocks); + memset (VEC_address (basic_block, basic_block_info), 0, + sizeof (basic_block) * n_basic_blocks); + SET_BASIC_BLOCK (ENTRY_BLOCK, ENTRY_BLOCK_PTR); + SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR); find_basic_blocks_1 (f); + profile_status = PROFILE_ABSENT; + + /* Tell make_edges to examine every block for out-going edges. */ + FOR_EACH_BB (bb) + SET_STATE (bb, BLOCK_NEW); + /* Discover the edges of our cfg. */ - make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0); + make_edges (ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0); /* Do very simple cleanup now, for the benefit of code that runs between here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns. */ @@ -638,11 +575,58 @@ find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED, timevar_pop (TV_CFG); } -/* State of basic block as seen by find_sub_basic_blocks. */ -enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT}; +static void +mark_tablejump_edge (rtx label) +{ + basic_block bb; -#define STATE(BB) (enum state) ((size_t) (BB)->aux) -#define SET_STATE(BB, STATE) ((BB)->aux = (void *) (size_t) (STATE)) + gcc_assert (LABEL_P (label)); + /* See comment in make_label_edge. */ + if (INSN_UID (label) == 0) + return; + bb = BLOCK_FOR_INSN (label); + SET_STATE (bb, FULL_STATE (bb) | BLOCK_USED_BY_TABLEJUMP); +} + +static void +purge_dead_tablejump_edges (basic_block bb, rtx table) +{ + rtx insn = BB_END (bb), tmp; + rtvec vec; + int j; + edge_iterator ei; + edge e; + + if (GET_CODE (PATTERN (table)) == ADDR_VEC) + vec = XVEC (PATTERN (table), 0); + else + vec = XVEC (PATTERN (table), 1); + + for (j = GET_NUM_ELEM (vec) - 1; j >= 0; --j) + mark_tablejump_edge (XEXP (RTVEC_ELT (vec, j), 0)); + + /* Some targets (eg, ARM) emit a conditional jump that also + contains the out-of-range target. Scan for these and + add an edge if necessary. */ + if ((tmp = single_set (insn)) != NULL + && SET_DEST (tmp) == pc_rtx + && GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE + && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF) + mark_tablejump_edge (XEXP (XEXP (SET_SRC (tmp), 2), 0)); + + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) + { + if (FULL_STATE (e->dest) & BLOCK_USED_BY_TABLEJUMP) + SET_STATE (e->dest, FULL_STATE (e->dest) + & ~(size_t) BLOCK_USED_BY_TABLEJUMP); + else if (!(e->flags & (EDGE_ABNORMAL | EDGE_EH))) + { + remove_edge (e); + continue; + } + ei_next (&ei); + } +} /* Scan basic block BB for possible BB boundaries inside the block and create new basic blocks in the progress. */ @@ -650,15 +634,17 @@ enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT}; static void find_bb_boundaries (basic_block bb) { + basic_block orig_bb = bb; rtx insn = BB_HEAD (bb); rtx end = BB_END (bb); + rtx table; rtx flow_transfer_insn = NULL_RTX; edge fallthru = NULL; if (insn == BB_END (bb)) return; - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) insn = NEXT_INSN (insn); /* Scan insn chain and try to find new basic block boundaries. */ @@ -708,6 +694,11 @@ find_bb_boundaries (basic_block bb) followed by cleanup at fallthru edge, so the outgoing edges may be dead. */ purge_dead_edges (bb); + + /* purge_dead_edges doesn't handle tablejump's, but if we have split the + basic block, we might need to kill some edges. */ + if (bb != orig_bb && tablejump_p (BB_END (bb), NULL, &table)) + purge_dead_tablejump_edges (bb, table); } /* Assume that frequency of basic block B is known. Compute frequencies @@ -717,35 +708,44 @@ static void compute_outgoing_frequencies (basic_block b) { edge e, f; + edge_iterator ei; - if (b->succ && b->succ->succ_next && !b->succ->succ_next->succ_next) + if (EDGE_COUNT (b->succs) == 2) { rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL); int probability; - if (!note) - return; - - probability = INTVAL (XEXP (note, 0)); - e = BRANCH_EDGE (b); - e->probability = probability; - e->count = ((b->count * probability + REG_BR_PROB_BASE / 2) - / REG_BR_PROB_BASE); - f = FALLTHRU_EDGE (b); - f->probability = REG_BR_PROB_BASE - probability; - f->count = b->count - e->count; + if (note) + { + probability = INTVAL (XEXP (note, 0)); + e = BRANCH_EDGE (b); + e->probability = probability; + e->count = ((b->count * probability + REG_BR_PROB_BASE / 2) + / REG_BR_PROB_BASE); + f = FALLTHRU_EDGE (b); + f->probability = REG_BR_PROB_BASE - probability; + f->count = b->count - e->count; + return; + } } - if (b->succ && !b->succ->succ_next) + if (single_succ_p (b)) { - e = b->succ; + e = single_succ_edge (b); e->probability = REG_BR_PROB_BASE; e->count = b->count; + return; } + guess_outgoing_edge_probabilities (b); + if (b->count) + FOR_EACH_EDGE (e, ei, b->succs) + e->count = ((b->count * e->probability + REG_BR_PROB_BASE / 2) + / REG_BR_PROB_BASE); } -/* Assume that someone emitted code with control flow instructions to the - basic block. Update the data structure. */ +/* Assume that some pass has inserted labels or control flow + instructions within a basic block. Split basic blocks as needed + and create edges. */ void find_many_sub_basic_blocks (sbitmap blocks) @@ -771,67 +771,32 @@ find_many_sub_basic_blocks (sbitmap blocks) /* Now re-scan and wire in all edges. This expect simple (conditional) jumps at the end of each new basic blocks. */ - make_edges (NULL, min, max, 1); + make_edges (min, max, 1); /* Update branch probabilities. Expect only (un)conditional jumps to be created with only the forward edges. */ - FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) - { - edge e; + if (profile_status != PROFILE_ABSENT) + FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) + { + edge e; + edge_iterator ei; - if (STATE (bb) == BLOCK_ORIGINAL) - continue; - if (STATE (bb) == BLOCK_NEW) - { - bb->count = 0; - bb->frequency = 0; - for (e = bb->pred; e; e = e->pred_next) - { - bb->count += e->count; - bb->frequency += EDGE_FREQUENCY (e); - } - } + if (STATE (bb) == BLOCK_ORIGINAL) + continue; + if (STATE (bb) == BLOCK_NEW) + { + bb->count = 0; + bb->frequency = 0; + FOR_EACH_EDGE (e, ei, bb->preds) + { + bb->count += e->count; + bb->frequency += EDGE_FREQUENCY (e); + } + } - compute_outgoing_frequencies (bb); - } + compute_outgoing_frequencies (bb); + } FOR_EACH_BB (bb) SET_STATE (bb, 0); } - -/* Like above but for single basic block only. */ - -void -find_sub_basic_blocks (basic_block bb) -{ - basic_block min, max, b; - basic_block next = bb->next_bb; - - min = bb; - find_bb_boundaries (bb); - max = next->prev_bb; - - /* Now re-scan and wire in all edges. This expect simple (conditional) - jumps at the end of each new basic blocks. */ - make_edges (NULL, min, max, 1); - - /* Update branch probabilities. Expect only (un)conditional jumps - to be created with only the forward edges. */ - FOR_BB_BETWEEN (b, min, max->next_bb, next_bb) - { - edge e; - - if (b != min) - { - b->count = 0; - b->frequency = 0; - for (e = b->pred; e; e = e->pred_next) - { - b->count += e->count; - b->frequency += EDGE_FREQUENCY (e); - } - } - - compute_outgoing_frequencies (b); - } -} diff --git a/contrib/gcc/cfgcleanup.c b/contrib/gcc/cfgcleanup.c index 7321b073403..0e13f7a07cf 100644 --- a/contrib/gcc/cfgcleanup.c +++ b/contrib/gcc/cfgcleanup.c @@ -1,6 +1,6 @@ /* Control flow optimization code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,14 +16,14 @@ for more details. 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 contains optimizer of the control flow. The main entrypoint is +/* This file contains optimizer of the control flow. The main entry point is cleanup_cfg. Following optimizations are performed: - Unreachable blocks removal - - Edge forwarding (edge to the forwarder block is forwarded to it's + - Edge forwarding (edge to the forwarder block is forwarded to its successor. Simplification of the branch instruction is performed by underlying infrastructure so branch can be converted to simplejump or eliminated). @@ -37,7 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" #include "hard-reg-set.h" -#include "basic-block.h" +#include "regs.h" #include "timevar.h" #include "output.h" #include "insn-config.h" @@ -48,33 +48,22 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "params.h" #include "tm_p.h" #include "target.h" +#include "cfglayout.h" +#include "emit-rtl.h" +#include "tree-pass.h" +#include "cfgloop.h" #include "expr.h" -/* cleanup_cfg maintains following flags for each basic block. */ - -enum bb_flags -{ - /* Set if BB is the forwarder block to avoid too many - forwarder_block_p calls. */ - BB_FORWARDER_BLOCK = 1, - BB_NONTHREADABLE_BLOCK = 2 -}; - -#define BB_FLAGS(BB) (enum bb_flags) (BB)->aux -#define BB_SET_FLAG(BB, FLAG) \ - (BB)->aux = (void *) (long) ((enum bb_flags) (BB)->aux | (FLAG)) -#define BB_CLEAR_FLAG(BB, FLAG) \ - (BB)->aux = (void *) (long) ((enum bb_flags) (BB)->aux & ~(FLAG)) - -#define FORWARDER_BLOCK_P(BB) (BB_FLAGS (BB) & BB_FORWARDER_BLOCK) +#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) +/* Set to true when we are running first pass of try_optimize_cfg loop. */ +static bool first_pass; static bool try_crossjump_to_edge (int, edge, edge); static bool try_crossjump_bb (int, basic_block); static bool outgoing_edges_match (int, basic_block, basic_block); static int flow_find_cross_jump (int, basic_block, basic_block, rtx *, rtx *); -static bool insns_match_p (int, rtx, rtx); +static bool old_insns_match_p (int, rtx, rtx); -static bool tail_recursion_label_p (rtx); static void merge_blocks_move_predecessor_nojumps (basic_block, basic_block); static void merge_blocks_move_successor_nojumps (basic_block, basic_block); static bool try_optimize_cfg (int); @@ -96,7 +85,7 @@ notice_new_block (basic_block bb) return; if (forwarder_block_p (bb)) - BB_SET_FLAG (bb, BB_FORWARDER_BLOCK); + bb->flags |= BB_FORWARDER_BLOCK; } /* Recompute forwarder flag after block has been modified. */ @@ -105,9 +94,9 @@ static void update_forwarder_flag (basic_block bb) { if (forwarder_block_p (bb)) - BB_SET_FLAG (bb, BB_FORWARDER_BLOCK); + bb->flags |= BB_FORWARDER_BLOCK; else - BB_CLEAR_FLAG (bb, BB_FORWARDER_BLOCK); + bb->flags &= ~BB_FORWARDER_BLOCK; } /* Simplify a conditional jump around an unconditional jump. @@ -119,13 +108,9 @@ try_simplify_condjump (basic_block cbranch_block) basic_block jump_block, jump_dest_block, cbranch_dest_block; edge cbranch_jump_edge, cbranch_fallthru_edge; rtx cbranch_insn; - rtx insn, next; - rtx end; /* Verify that there are exactly two successors. */ - if (!cbranch_block->succ - || !cbranch_block->succ->succ_next - || cbranch_block->succ->succ_next->succ_next) + if (EDGE_COUNT (cbranch_block->succs) != 2) return false; /* Verify that we've got a normal conditional branch at the end @@ -141,25 +126,40 @@ try_simplify_condjump (basic_block cbranch_block) be the last block in the function, and must contain just the unconditional jump. */ jump_block = cbranch_fallthru_edge->dest; - if (jump_block->pred->pred_next + if (!single_pred_p (jump_block) || jump_block->next_bb == EXIT_BLOCK_PTR || !FORWARDER_BLOCK_P (jump_block)) return false; - jump_dest_block = jump_block->succ->dest; + jump_dest_block = single_succ (jump_block); + + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (jump_block) != BB_PARTITION (jump_dest_block) + || (cbranch_jump_edge->flags & EDGE_CROSSING)) + return false; /* The conditional branch must target the block after the unconditional branch. */ cbranch_dest_block = cbranch_jump_edge->dest; - if (!can_fallthru (jump_block, cbranch_dest_block)) + if (cbranch_dest_block == EXIT_BLOCK_PTR + || !can_fallthru (jump_block, cbranch_dest_block)) return false; /* Invert the conditional branch. */ if (!invert_jump (cbranch_insn, block_label (jump_dest_block), 0)) return false; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n", + if (dump_file) + fprintf (dump_file, "Simplifying condjump %i around jump %i\n", INSN_UID (cbranch_insn), INSN_UID (BB_END (jump_block))); /* Success. Update the CFG to match. Note that after this point @@ -173,29 +173,10 @@ try_simplify_condjump (basic_block cbranch_block) cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU; update_br_prob_note (cbranch_block); - end = BB_END (jump_block); - /* Deleting a block may produce unreachable code warning even when we are - not deleting anything live. Suppress it by moving all the line number - notes out of the block. */ - for (insn = BB_HEAD (jump_block); insn != NEXT_INSN (BB_END (jump_block)); - insn = next) - { - next = NEXT_INSN (insn); - if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) - { - if (insn == BB_END (jump_block)) - { - BB_END (jump_block) = PREV_INSN (insn); - if (insn == end) - break; - } - reorder_insns_nobb (insn, insn, end); - end = insn; - } - } /* Delete the block with the unconditional jump, and clean up the mess. */ - delete_block (jump_block); - tidy_fallthru_edge (cbranch_jump_edge, cbranch_block, cbranch_dest_block); + delete_basic_block (jump_block); + tidy_fallthru_edge (cbranch_jump_edge); + update_forwarder_flag (cbranch_block); return true; } @@ -211,7 +192,7 @@ mark_effect (rtx exp, regset nonequal) switch (GET_CODE (exp)) { /* In case we do clobber the register, mark it as equal, as we know the - value is dead so it don't have to match. */ + value is dead so it don't have to match. */ case CLOBBER: if (REG_P (XEXP (exp, 0))) { @@ -220,7 +201,7 @@ mark_effect (rtx exp, regset nonequal) CLEAR_REGNO_REG_SET (nonequal, regno); if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + int n = hard_regno_nregs[regno][GET_MODE (dest)]; while (--n > 0) CLEAR_REGNO_REG_SET (nonequal, regno + n); } @@ -239,7 +220,7 @@ mark_effect (rtx exp, regset nonequal) SET_REGNO_REG_SET (nonequal, regno); if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (dest)); + int n = hard_regno_nregs[regno][GET_MODE (dest)]; while (--n > 0) SET_REGNO_REG_SET (nonequal, regno + n); } @@ -265,7 +246,7 @@ mentions_nonequal_regs (rtx *x, void *data) return 1; if (regno < FIRST_PSEUDO_REGISTER) { - int n = HARD_REGNO_NREGS (regno, GET_MODE (*x)); + int n = hard_regno_nregs[regno][GET_MODE (*x)]; while (--n > 0) if (REGNO_REG_SET_P (nonequal, regno + n)) return 1; @@ -283,20 +264,21 @@ thread_jump (int mode, edge e, basic_block b) rtx set1, set2, cond1, cond2, insn; enum rtx_code code1, code2, reversed_code2; bool reverse1 = false; - int i; + unsigned i; regset nonequal; bool failed = false; + reg_set_iterator rsi; - if (BB_FLAGS (b) & BB_NONTHREADABLE_BLOCK) + if (b->flags & BB_NONTHREADABLE_BLOCK) return NULL; /* At the moment, we do handle only conditional jumps, but later we may want to extend this code to tablejumps and others. */ - if (!e->src->succ->succ_next || e->src->succ->succ_next->succ_next) + if (EDGE_COUNT (e->src->succs) != 2) return NULL; - if (!b->succ || !b->succ->succ_next || b->succ->succ_next->succ_next) + if (EDGE_COUNT (b->succs) != 2) { - BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); + b->flags |= BB_NONTHREADABLE_BLOCK; return NULL; } @@ -306,7 +288,7 @@ thread_jump (int mode, edge e, basic_block b) if (!any_condjump_p (BB_END (b)) || !onlyjump_p (BB_END (b))) { - BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); + b->flags |= BB_NONTHREADABLE_BLOCK; return NULL; } @@ -344,26 +326,28 @@ thread_jump (int mode, edge e, basic_block b) insn = NEXT_INSN (insn)) if (INSN_P (insn) && side_effects_p (PATTERN (insn))) { - BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); + b->flags |= BB_NONTHREADABLE_BLOCK; return NULL; } - cselib_init (); + cselib_init (false); /* First process all values computed in the source basic block. */ - for (insn = NEXT_INSN (BB_HEAD (e->src)); insn != NEXT_INSN (BB_END (e->src)); + for (insn = NEXT_INSN (BB_HEAD (e->src)); + insn != NEXT_INSN (BB_END (e->src)); insn = NEXT_INSN (insn)) if (INSN_P (insn)) cselib_process_insn (insn); - nonequal = BITMAP_XMALLOC(); + nonequal = BITMAP_ALLOC (NULL); CLEAR_REG_SET (nonequal); /* Now assume that we've continued by the edge E to B and continue processing as if it were same basic block. Our goal is to prove that whole block is an NOOP. */ - for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b)) && !failed; + for (insn = NEXT_INSN (BB_HEAD (b)); + insn != NEXT_INSN (BB_END (b)) && !failed; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) @@ -372,7 +356,7 @@ thread_jump (int mode, edge e, basic_block b) if (GET_CODE (pat) == PARALLEL) { - for (i = 0; i < XVECLEN (pat, 0); i++) + for (i = 0; i < (unsigned)XVECLEN (pat, 0); i++) failed |= mark_effect (XVECEXP (pat, 0, i), nonequal); } else @@ -386,7 +370,7 @@ thread_jump (int mode, edge e, basic_block b) have life information in cfg_cleanup. */ if (failed) { - BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK); + b->flags |= BB_NONTHREADABLE_BLOCK; goto failed_exit; } @@ -398,11 +382,12 @@ thread_jump (int mode, edge e, basic_block b) /* In case liveness information is available, we need to prove equivalence only of the live values. */ if (mode & CLEANUP_UPDATE_LIFE) - AND_REG_SET (nonequal, b->global_live_at_end); + AND_REG_SET (nonequal, b->il.rtl->global_live_at_end); - EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, goto failed_exit;); + EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi) + goto failed_exit; - BITMAP_XFREE (nonequal); + BITMAP_FREE (nonequal); cselib_finish (); if ((comparison_dominates_p (code1, code2) != 0) != (XEXP (SET_SRC (set2), 1) == pc_rtx)) @@ -411,7 +396,7 @@ thread_jump (int mode, edge e, basic_block b) return FALLTHRU_EDGE (b); failed_exit: - BITMAP_XFREE (nonequal); + BITMAP_FREE (nonequal); cselib_finish (); return NULL; } @@ -423,52 +408,83 @@ static bool try_forward_edges (int mode, basic_block b) { bool changed = false; - edge e, next, *threaded_edges = NULL; + edge_iterator ei; + edge e, *threaded_edges = NULL; - for (e = b->succ; e; e = next) + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really m + ust be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)) + return false; + + for (ei = ei_start (b->succs); (e = ei_safe_edge (ei)); ) { basic_block target, first; int counter; bool threaded = false; int nthreaded_edges = 0; - - next = e->succ_next; + bool may_thread = first_pass | (b->flags & BB_DIRTY); /* Skip complex edges because we don't know how to update them. - Still handle fallthru edges, as we can succeed to forward fallthru - edge to the same place as the branch edge of conditional branch - and turn conditional branch to an unconditional branch. */ + Still handle fallthru edges, as we can succeed to forward fallthru + edge to the same place as the branch edge of conditional branch + and turn conditional branch to an unconditional branch. */ if (e->flags & EDGE_COMPLEX) - continue; + { + ei_next (&ei); + continue; + } target = first = e->dest; - counter = 0; + counter = NUM_FIXED_BLOCKS; + + /* If we are partitioning hot/cold basic_blocks, we don't want to mess + up jumps that cross between hot/cold sections. + + Basic block partitioning may result in some jumps that appear + to be optimizable (or blocks that appear to be mergeable), but which + really must be left untouched (they are required to make it safely + across partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete + details. */ + + if (first != EXIT_BLOCK_PTR + && find_reg_note (BB_END (first), REG_CROSSING_JUMP, NULL_RTX)) + return false; while (counter < n_basic_blocks) { basic_block new_target = NULL; bool new_target_threaded = false; + may_thread |= target->flags & BB_DIRTY; if (FORWARDER_BLOCK_P (target) - && target->succ->dest != EXIT_BLOCK_PTR) + && !(single_succ_edge (target)->flags & EDGE_CROSSING) + && single_succ (target) != EXIT_BLOCK_PTR) { /* Bypass trivial infinite loops. */ - if (target == target->succ->dest) + new_target = single_succ (target); + if (target == new_target) counter = n_basic_blocks; - new_target = target->succ->dest; } /* Allow to thread only over one edge at time to simplify updating of probabilities. */ - else if (mode & CLEANUP_THREADING) + else if ((mode & CLEANUP_THREADING) && may_thread) { edge t = thread_jump (mode, e, target); if (t) { if (!threaded_edges) - threaded_edges = xmalloc (sizeof (*threaded_edges) - * n_basic_blocks); + threaded_edges = XNEWVEC (edge, n_basic_blocks); else { int i; @@ -489,8 +505,7 @@ try_forward_edges (int mode, basic_block b) if (t->dest == b) break; - if (nthreaded_edges >= n_basic_blocks) - abort (); + gcc_assert (nthreaded_edges < n_basic_blocks - NUM_FIXED_BLOCKS); threaded_edges[nthreaded_edges++] = t; new_target = t->dest; @@ -501,39 +516,6 @@ try_forward_edges (int mode, basic_block b) if (!new_target) break; - /* Avoid killing of loop pre-headers, as it is the place loop - optimizer wants to hoist code to. - - For fallthru forwarders, the LOOP_BEG note must appear between - the header of block and CODE_LABEL of the loop, for non forwarders - it must appear before the JUMP_INSN. */ - if ((mode & CLEANUP_PRE_LOOP) && optimize) - { - rtx insn = (target->succ->flags & EDGE_FALLTHRU - ? BB_HEAD (target) : prev_nonnote_insn (BB_END (target))); - - if (GET_CODE (insn) != NOTE) - insn = NEXT_INSN (insn); - - for (; insn && GET_CODE (insn) != CODE_LABEL && !INSN_P (insn); - insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) - break; - - if (insn && GET_CODE (insn) == NOTE) - break; - - /* Do not clean up branches to just past the end of a loop - at this time; it can mess up the loop optimizer's - recognition of some patterns. */ - - insn = PREV_INSN (BB_HEAD (target)); - if (insn && GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END) - break; - } - counter++; target = new_target; threaded |= new_target_threaded; @@ -541,8 +523,8 @@ try_forward_edges (int mode, basic_block b) if (counter >= n_basic_blocks) { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Infinite loop in BB %i.\n", + if (dump_file) + fprintf (dump_file, "Infinite loop in BB %i.\n", target->index); } else if (target == first) @@ -559,15 +541,16 @@ try_forward_edges (int mode, basic_block b) if (threaded && target != EXIT_BLOCK_PTR) { notice_new_block (redirect_edge_and_branch_force (e, target)); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Conditionals threaded.\n"); + if (dump_file) + fprintf (dump_file, "Conditionals threaded.\n"); } else if (!redirect_edge_and_branch (e, target)) { - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Forwarding edge %i->%i to %i failed.\n", b->index, e->dest->index, target->index); + ei_next (&ei); continue; } @@ -579,48 +562,29 @@ try_forward_edges (int mode, basic_block b) / REG_BR_PROB_BASE); if (!FORWARDER_BLOCK_P (b) && forwarder_block_p (b)) - BB_SET_FLAG (b, BB_FORWARDER_BLOCK); + b->flags |= BB_FORWARDER_BLOCK; do { edge t; - first->count -= edge_count; - if (first->count < 0) - first->count = 0; - first->frequency -= edge_frequency; - if (first->frequency < 0) - first->frequency = 0; - if (first->succ->succ_next) + if (!single_succ_p (first)) { - edge e; - int prob; - if (n >= nthreaded_edges) - abort (); + gcc_assert (n < nthreaded_edges); t = threaded_edges [n++]; - if (t->src != first) - abort (); - if (first->frequency) - prob = edge_frequency * REG_BR_PROB_BASE / first->frequency; - else - prob = 0; - if (prob > t->probability) - prob = t->probability; - t->probability -= prob; - prob = REG_BR_PROB_BASE - prob; - if (prob <= 0) - { - first->succ->probability = REG_BR_PROB_BASE; - first->succ->succ_next->probability = 0; - } - else - for (e = first->succ; e; e = e->succ_next) - e->probability = ((e->probability * REG_BR_PROB_BASE) - / (double) prob); + gcc_assert (t->src == first); + update_bb_profile_for_threading (first, edge_frequency, + edge_count, t); update_br_prob_note (first); } else { + first->count -= edge_count; + if (first->count < 0) + first->count = 0; + first->frequency -= edge_frequency; + if (first->frequency < 0) + first->frequency = 0; /* It is possible that as the result of threading we've removed edge as it is threaded to the fallthru edge. Avoid @@ -628,7 +592,7 @@ try_forward_edges (int mode, basic_block b) if (n < nthreaded_edges && first == threaded_edges [n]->src) n++; - t = first->succ; + t = single_succ_edge (first); } t->count -= edge_count; @@ -639,7 +603,9 @@ try_forward_edges (int mode, basic_block b) while (first != target); changed = true; + continue; } + ei_next (&ei); } if (threaded_edges) @@ -647,19 +613,6 @@ try_forward_edges (int mode, basic_block b) return changed; } -/* Return true if LABEL is used for tail recursion. */ - -static bool -tail_recursion_label_p (rtx label) -{ - rtx x; - - for (x = tail_recursion_label_list; x; x = XEXP (x, 1)) - if (label == XEXP (x, 0)) - return true; - - return false; -} /* Blocks A and B are to be merged into a single block. A has no incoming fallthru edge, so it can be moved before B without adding or modifying @@ -669,10 +622,23 @@ static void merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b) { rtx barrier; + bool only_notes; + + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (a) != BB_PARTITION (b)) + return; barrier = next_nonnote_insn (BB_END (a)); - if (GET_CODE (barrier) != BARRIER) - abort (); + gcc_assert (BARRIER_P (barrier)); delete_insn (barrier); /* Move block and loop notes out of the chain so that we do not @@ -682,16 +648,16 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b) and adjust the block trees appropriately. Even better would be to have a tighter connection between block trees and rtl so that this is not necessary. */ - if (squeeze_notes (&BB_HEAD (a), &BB_END (a))) - abort (); + only_notes = squeeze_notes (&BB_HEAD (a), &BB_END (a)); + gcc_assert (!only_notes); /* Scramble the insn chain. */ if (BB_END (a) != PREV_INSN (BB_HEAD (b))) reorder_insns_nobb (BB_HEAD (a), BB_END (a), PREV_INSN (BB_HEAD (b))); a->flags |= BB_DIRTY; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Moved block %d before %d and merged.\n", + if (dump_file) + fprintf (dump_file, "Moved block %d before %d and merged.\n", a->index, b->index); /* Swap the records for the two blocks around. */ @@ -712,6 +678,20 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) { rtx barrier, real_b_end; rtx label, table; + bool only_notes; + + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (a) != BB_PARTITION (b)) + return; real_b_end = BB_END (b); @@ -725,7 +705,7 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) /* There had better have been a barrier there. Delete it. */ barrier = NEXT_INSN (BB_END (b)); - if (barrier && GET_CODE (barrier) == BARRIER) + if (barrier && BARRIER_P (barrier)) delete_insn (barrier); /* Move block and loop notes out of the chain so that we do not @@ -735,8 +715,9 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) and adjust the block trees appropriately. Even better would be to have a tighter connection between block trees and rtl so that this is not necessary. */ - if (squeeze_notes (&BB_HEAD (b), &BB_END (b))) - abort (); + only_notes = squeeze_notes (&BB_HEAD (b), &BB_END (b)); + gcc_assert (!only_notes); + /* Scramble the insn chain. */ reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a)); @@ -744,8 +725,8 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) /* Restore the real end of b. */ BB_END (b) = real_b_end; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Moved block %d after %d and merged.\n", + if (dump_file) + fprintf (dump_file, "Moved block %d after %d and merged.\n", b->index, a->index); /* Now blocks A and B are contiguous. Merge them. */ @@ -768,15 +749,22 @@ static basic_block merge_blocks_move (edge e, basic_block b, basic_block c, int mode) { basic_block next; - /* If C has a tail recursion label, do not merge. There is no - edge recorded from the call_placeholder back to this label, as - that would make optimize_sibling_and_tail_recursive_calls more - complex for no gain. */ - if ((mode & CLEANUP_PRE_SIBCALL) - && GET_CODE (BB_HEAD (c)) == CODE_LABEL - && tail_recursion_label_p (BB_HEAD (c))) + + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (b) != BB_PARTITION (c)) return NULL; + + /* If B has a fallthru edge to C, no need to move anything. */ if (e->flags & EDGE_FALLTHRU) { @@ -784,8 +772,8 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) merge_blocks (b, c); update_forwarder_flag (b); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Merged %d and %d without moving.\n", + if (dump_file) + fprintf (dump_file, "Merged %d and %d without moving.\n", b_index, c_index); return b->prev_bb == ENTRY_BLOCK_PTR ? b : b->prev_bb; @@ -798,9 +786,10 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) edge tmp_edge, b_fallthru_edge; bool c_has_outgoing_fallthru; bool b_has_incoming_fallthru; + edge_iterator ei; /* Avoid overactive code motion, as the forwarder blocks should be - eliminated by edge redirection instead. One exception might have + eliminated by edge redirection instead. One exception might have been if B is a forwarder block and C has no fallthru edge, but that should be cleaned up by bb-reorder instead. */ if (FORWARDER_BLOCK_P (b) || FORWARDER_BLOCK_P (c)) @@ -810,13 +799,13 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) and loop notes. This is done by squeezing out all the notes and leaving them there to lie. Not ideal, but functional. */ - for (tmp_edge = c->succ; tmp_edge; tmp_edge = tmp_edge->succ_next) + FOR_EACH_EDGE (tmp_edge, ei, c->succs) if (tmp_edge->flags & EDGE_FALLTHRU) break; c_has_outgoing_fallthru = (tmp_edge != NULL); - for (tmp_edge = b->pred; tmp_edge; tmp_edge = tmp_edge->pred_next) + FOR_EACH_EDGE (tmp_edge, ei, b->preds) if (tmp_edge->flags & EDGE_FALLTHRU) break; @@ -832,7 +821,7 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) if (! c_has_outgoing_fallthru) { merge_blocks_move_successor_nojumps (b, c); - return next == ENTRY_BLOCK_PTR ? next->next_bb : next; + return next == ENTRY_BLOCK_PTR ? next->next_bb : next; } /* If B does not have an incoming fallthru, then it can be moved @@ -889,14 +878,16 @@ merge_memattrs (rtx x, rtx y) MEM_ATTRS (y) = 0; else if (! MEM_ATTRS (y)) MEM_ATTRS (x) = 0; - else + else { + rtx mem_size; + if (MEM_ALIAS_SET (x) != MEM_ALIAS_SET (y)) { set_mem_alias_set (x, 0); set_mem_alias_set (y, 0); } - + if (! mem_expr_equal_p (MEM_EXPR (x), MEM_EXPR (y))) { set_mem_expr (x, 0); @@ -909,15 +900,22 @@ merge_memattrs (rtx x, rtx y) set_mem_offset (x, 0); set_mem_offset (y, 0); } - - set_mem_size (x, MAX (MEM_SIZE (x), MEM_SIZE (y))); - set_mem_size (y, MEM_SIZE (x)); + + if (!MEM_SIZE (x)) + mem_size = NULL_RTX; + else if (!MEM_SIZE (y)) + mem_size = NULL_RTX; + else + mem_size = GEN_INT (MAX (INTVAL (MEM_SIZE (x)), + INTVAL (MEM_SIZE (y)))); + set_mem_size (x, mem_size); + set_mem_size (y, mem_size); set_mem_align (x, MIN (MEM_ALIGN (x), MEM_ALIGN (y))); set_mem_align (y, MEM_ALIGN (x)); } } - + fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { @@ -944,7 +942,7 @@ merge_memattrs (rtx x, rtx y) /* Return true if I1 and I2 are equivalent and thus can be crossjumped. */ static bool -insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) +old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) { rtx p1, p2; @@ -968,9 +966,9 @@ insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) ??? We take the simple route for now and assume that if they're equal, they were constructed identically. */ - if (GET_CODE (i1) == CALL_INSN + if (CALL_P (i1) && (!rtx_equal_p (CALL_INSN_FUNCTION_USAGE (i1), - CALL_INSN_FUNCTION_USAGE (i2)) + CALL_INSN_FUNCTION_USAGE (i2)) || SIBLING_CALL_P (i1) != SIBLING_CALL_P (i2))) return false; @@ -982,8 +980,8 @@ insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2) if ((mode & CLEANUP_POST_REGSTACK) && stack_regs_mentioned (i1)) { /* If register stack conversion has already been done, then - death notes must also be compared before it is certain that - the two instruction streams match. */ + death notes must also be compared before it is certain that + the two instruction streams match. */ rtx note; HARD_REG_SET i1_regset, i2_regset; @@ -1098,7 +1096,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, if (i1 == BB_HEAD (bb1) || i2 == BB_HEAD (bb2)) break; - if (!insns_match_p (mode, i1, i2)) + if (!old_insns_match_p (mode, i1, i2)) break; merge_memattrs (i1, i2); @@ -1146,13 +1144,13 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, while (last1 != BB_HEAD (bb1) && !INSN_P (PREV_INSN (last1))) last1 = PREV_INSN (last1); - if (last1 != BB_HEAD (bb1) && GET_CODE (PREV_INSN (last1)) == CODE_LABEL) + if (last1 != BB_HEAD (bb1) && LABEL_P (PREV_INSN (last1))) last1 = PREV_INSN (last1); while (last2 != BB_HEAD (bb2) && !INSN_P (PREV_INSN (last2))) last2 = PREV_INSN (last2); - if (last2 != BB_HEAD (bb2) && GET_CODE (PREV_INSN (last2)) == CODE_LABEL) + if (last2 != BB_HEAD (bb2) && LABEL_P (PREV_INSN (last2))) last2 = PREV_INSN (last2); *f1 = last1; @@ -1162,6 +1160,134 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1, return ninsns; } +/* Return true iff the condbranches at the end of BB1 and BB2 match. */ +bool +condjump_equiv_p (struct equiv_info *info, bool call_init) +{ + basic_block bb1 = info->x_block; + basic_block bb2 = info->y_block; + edge b1 = BRANCH_EDGE (bb1); + edge b2 = BRANCH_EDGE (bb2); + edge f1 = FALLTHRU_EDGE (bb1); + edge f2 = FALLTHRU_EDGE (bb2); + bool reverse, match; + rtx set1, set2, cond1, cond2; + rtx src1, src2; + enum rtx_code code1, code2; + + /* Get around possible forwarders on fallthru edges. Other cases + should be optimized out already. */ + if (FORWARDER_BLOCK_P (f1->dest)) + f1 = single_succ_edge (f1->dest); + + if (FORWARDER_BLOCK_P (f2->dest)) + f2 = single_succ_edge (f2->dest); + + /* To simplify use of this function, return false if there are + unneeded forwarder blocks. These will get eliminated later + during cleanup_cfg. */ + if (FORWARDER_BLOCK_P (f1->dest) + || FORWARDER_BLOCK_P (f2->dest) + || FORWARDER_BLOCK_P (b1->dest) + || FORWARDER_BLOCK_P (b2->dest)) + return false; + + if (f1->dest == f2->dest && b1->dest == b2->dest) + reverse = false; + else if (f1->dest == b2->dest && b1->dest == f2->dest) + reverse = true; + else + return false; + + set1 = pc_set (BB_END (bb1)); + set2 = pc_set (BB_END (bb2)); + if ((XEXP (SET_SRC (set1), 1) == pc_rtx) + != (XEXP (SET_SRC (set2), 1) == pc_rtx)) + reverse = !reverse; + + src1 = SET_SRC (set1); + src2 = SET_SRC (set2); + cond1 = XEXP (src1, 0); + cond2 = XEXP (src2, 0); + code1 = GET_CODE (cond1); + if (reverse) + code2 = reversed_comparison_code (cond2, BB_END (bb2)); + else + code2 = GET_CODE (cond2); + + if (code2 == UNKNOWN) + return false; + + if (call_init && !struct_equiv_init (STRUCT_EQUIV_START | info->mode, info)) + gcc_unreachable (); + /* Make the sources of the pc sets unreadable so that when we call + insns_match_p it won't process them. + The death_notes_match_p from insns_match_p won't see the local registers + used for the pc set, but that could only cause missed optimizations when + there are actually condjumps that use stack registers. */ + SET_SRC (set1) = pc_rtx; + SET_SRC (set2) = pc_rtx; + /* Verify codes and operands match. */ + if (code1 == code2) + { + match = (insns_match_p (BB_END (bb1), BB_END (bb2), info) + && rtx_equiv_p (&XEXP (cond1, 0), XEXP (cond2, 0), 1, info) + && rtx_equiv_p (&XEXP (cond1, 1), XEXP (cond2, 1), 1, info)); + + } + else if (code1 == swap_condition (code2)) + { + match = (insns_match_p (BB_END (bb1), BB_END (bb2), info) + && rtx_equiv_p (&XEXP (cond1, 1), XEXP (cond2, 0), 1, info) + && rtx_equiv_p (&XEXP (cond1, 0), XEXP (cond2, 1), 1, info)); + + } + else + match = false; + SET_SRC (set1) = src1; + SET_SRC (set2) = src2; + match &= verify_changes (0); + + /* If we return true, we will join the blocks. Which means that + we will only have one branch prediction bit to work with. Thus + we require the existing branches to have probabilities that are + roughly similar. */ + if (match + && !optimize_size + && maybe_hot_bb_p (bb1) + && maybe_hot_bb_p (bb2)) + { + int prob2; + + if (b1->dest == b2->dest) + prob2 = b2->probability; + else + /* Do not use f2 probability as f2 may be forwarded. */ + prob2 = REG_BR_PROB_BASE - b2->probability; + + /* Fail if the difference in probabilities is greater than 50%. + This rules out two well-predicted branches with opposite + outcomes. */ + if (abs (b1->probability - prob2) > REG_BR_PROB_BASE / 2) + { + if (dump_file) + fprintf (dump_file, + "Outcomes of branch in bb %i and %i differ too much (%i %i)\n", + bb1->index, bb2->index, b1->probability, prob2); + + match = false; + } + } + + if (dump_file && match) + fprintf (dump_file, "Conditionals in bb %i and %i match.\n", + bb1->index, bb2->index); + + if (!match) + cancel_changes (0); + return match; +} + /* Return true iff outgoing edges of BB1 and BB2 match, together with the branch instruction. This means that if we commonize the control flow before end of the basic block, the semantic remains unchanged. @@ -1174,21 +1300,21 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) int nehedges1 = 0, nehedges2 = 0; edge fallthru1 = 0, fallthru2 = 0; edge e1, e2; + edge_iterator ei; /* If BB1 has only one successor, we may be looking at either an unconditional jump, or a fake edge to exit. */ - if (bb1->succ && !bb1->succ->succ_next - && (bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0 - && (GET_CODE (BB_END (bb1)) != JUMP_INSN || simplejump_p (BB_END (bb1)))) - return (bb2->succ && !bb2->succ->succ_next - && (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0 - && (GET_CODE (BB_END (bb2)) != JUMP_INSN || simplejump_p (BB_END (bb2)))); + if (single_succ_p (bb1) + && (single_succ_edge (bb1)->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0 + && (!JUMP_P (BB_END (bb1)) || simplejump_p (BB_END (bb1)))) + return (single_succ_p (bb2) + && (single_succ_edge (bb2)->flags + & (EDGE_COMPLEX | EDGE_FAKE)) == 0 + && (!JUMP_P (BB_END (bb2)) || simplejump_p (BB_END (bb2)))); /* Match conditional jumps - this may get tricky when fallthru and branch edges are crossed. */ - if (bb1->succ - && bb1->succ->succ_next - && !bb1->succ->succ_next->succ_next + if (EDGE_COUNT (bb1->succs) == 2 && any_condjump_p (BB_END (bb1)) && onlyjump_p (BB_END (bb1))) { @@ -1197,9 +1323,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) rtx set1, set2, cond1, cond2; enum rtx_code code1, code2; - if (!bb2->succ - || !bb2->succ->succ_next - || bb2->succ->succ_next->succ_next + if (EDGE_COUNT (bb2->succs) != 2 || !any_condjump_p (BB_END (bb2)) || !onlyjump_p (BB_END (bb2))) return false; @@ -1210,12 +1334,12 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) f2 = FALLTHRU_EDGE (bb2); /* Get around possible forwarders on fallthru edges. Other cases - should be optimized out already. */ + should be optimized out already. */ if (FORWARDER_BLOCK_P (f1->dest)) - f1 = f1->dest->succ; + f1 = single_succ_edge (f1->dest); if (FORWARDER_BLOCK_P (f2->dest)) - f2 = f2->dest->succ; + f2 = single_succ_edge (f2->dest); /* To simplify use of this function, return false if there are unneeded forwarder blocks. These will get eliminated later @@ -1282,17 +1406,17 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) outcomes. */ if (abs (b1->probability - prob2) > REG_BR_PROB_BASE / 2) { - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Outcomes of branch in bb %i and %i differs to much (%i %i)\n", + if (dump_file) + fprintf (dump_file, + "Outcomes of branch in bb %i and %i differ too much (%i %i)\n", bb1->index, bb2->index, b1->probability, prob2); return false; } } - if (rtl_dump_file && match) - fprintf (rtl_dump_file, "Conditionals in bb %i and %i match.\n", + if (dump_file && match) + fprintf (dump_file, "Conditionals in bb %i and %i match.\n", bb1->index, bb2->index); return match; @@ -1301,7 +1425,6 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* Generic case - we are seeing a computed jump, table jump or trapping instruction. */ -#ifndef CASE_DROPS_THROUGH /* Check whether there are tablejumps in the end of BB1 and BB2. Return true if they are identical. */ { @@ -1315,7 +1438,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* The labels should never be the same rtx. If they really are same the jump tables are same too. So disable crossjumping of blocks BB1 and BB2 because when deleting the common insns in the end of BB1 - by delete_block () the jump table would be deleted too. */ + by delete_basic_block () the jump table would be deleted too. */ /* If LABEL2 is referenced in BB1->END do not do anything because we would loose information when replacing LABEL1 by LABEL2 and then LABEL2 by LABEL1 in BB1->END. */ @@ -1356,9 +1479,9 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) rr.update_label_nuses = false; for_each_rtx (&BB_END (bb1), replace_label, &rr); - match = insns_match_p (mode, BB_END (bb1), BB_END (bb2)); - if (rtl_dump_file && match) - fprintf (rtl_dump_file, + match = old_insns_match_p (mode, BB_END (bb1), BB_END (bb2)); + if (dump_file && match) + fprintf (dump_file, "Tablejumps in bb %i and %i match.\n", bb1->index, bb2->index); @@ -1375,19 +1498,22 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) return false; } } -#endif /* First ensure that the instructions match. There may be many outgoing edges so this test is generally cheaper. */ - if (!insns_match_p (mode, BB_END (bb1), BB_END (bb2))) + if (!old_insns_match_p (mode, BB_END (bb1), BB_END (bb2))) return false; /* Search the outgoing edges, ensure that the counts do match, find possible fallthru and exception handling edges since these needs more validation. */ - for (e1 = bb1->succ, e2 = bb2->succ; e1 && e2; - e1 = e1->succ_next, e2 = e2->succ_next) + if (EDGE_COUNT (bb1->succs) != EDGE_COUNT (bb2->succs)) + return false; + + FOR_EACH_EDGE (e1, ei, bb1->succs) { + e2 = EDGE_SUCC (bb2, ei.index); + if (e1->flags & EDGE_EH) nehedges1++; @@ -1401,8 +1527,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) } /* If number of edges of various types does not match, fail. */ - if (e1 || e2 - || nehedges1 != nehedges2 + if (nehedges1 != nehedges2 || (fallthru1 != 0) != (fallthru2 != 0)) return false; @@ -1410,9 +1535,9 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) if (fallthru1) { basic_block d1 = (forwarder_block_p (fallthru1->dest) - ? fallthru1->dest->succ->dest: fallthru1->dest); + ? single_succ (fallthru1->dest): fallthru1->dest); basic_block d2 = (forwarder_block_p (fallthru2->dest) - ? fallthru2->dest->succ->dest: fallthru2->dest); + ? single_succ (fallthru2->dest): fallthru2->dest); if (d1 != d2) return false; @@ -1430,11 +1555,43 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) return false; } - /* We don't need to match the rest of edges as above checks should be enough - to ensure that they are equivalent. */ + /* The same checks as in try_crossjump_to_edge. It is required for RTL + version of sequence abstraction. */ + FOR_EACH_EDGE (e1, ei, bb2->succs) + { + edge e2; + edge_iterator ei; + basic_block d1 = e1->dest; + + if (FORWARDER_BLOCK_P (d1)) + d1 = EDGE_SUCC (d1, 0)->dest; + + FOR_EACH_EDGE (e2, ei, bb1->succs) + { + basic_block d2 = e2->dest; + if (FORWARDER_BLOCK_P (d2)) + d2 = EDGE_SUCC (d2, 0)->dest; + if (d1 == d2) + break; + } + + if (!e2) + return false; + } + return true; } +/* Returns true if BB basic block has a preserve label. */ + +static bool +block_has_preserve_label (basic_block bb) +{ + return (bb + && block_label (bb) + && LABEL_PRESERVE_P (block_label (bb))); +} + /* E1 and E2 are edges with the same destination block. Search their predecessors for common code. If found, redirect control flow from (maybe the middle of) E1->SRC to (maybe the middle of) E2->SRC. */ @@ -1447,20 +1604,33 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) basic_block redirect_to, redirect_from, to_remove; rtx newpos1, newpos2; edge s; + edge_iterator ei; + + newpos1 = newpos2 = NULL_RTX; + + /* If we have partitioned hot/cold basic blocks, it is a bad idea + to try this optimization. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (flag_reorder_blocks_and_partition && no_new_pseudos) + return false; /* Search backward through forwarder blocks. We don't need to worry about multiple entry or chained forwarders, as they will be optimized away. We do this to look past the unconditional jump following a conditional jump that is required due to the current CFG shape. */ - if (src1->pred - && !src1->pred->pred_next + if (single_pred_p (src1) && FORWARDER_BLOCK_P (src1)) - e1 = src1->pred, src1 = e1->src; + e1 = single_pred_edge (src1), src1 = e1->src; - if (src2->pred - && !src2->pred->pred_next + if (single_pred_p (src2) && FORWARDER_BLOCK_P (src2)) - e2 = src2->pred, src2 = e2->src; + e2 = single_pred_edge (src2), src2 = e2->src; /* Nothing to do if we reach ENTRY, or a common source block. */ if (src1 == ENTRY_BLOCK_PTR || src2 == ENTRY_BLOCK_PTR) @@ -1470,16 +1640,16 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) /* Seeing more than 1 forwarder blocks would confuse us later... */ if (FORWARDER_BLOCK_P (e1->dest) - && FORWARDER_BLOCK_P (e1->dest->succ->dest)) + && FORWARDER_BLOCK_P (single_succ (e1->dest))) return false; if (FORWARDER_BLOCK_P (e2->dest) - && FORWARDER_BLOCK_P (e2->dest->succ->dest)) + && FORWARDER_BLOCK_P (single_succ (e2->dest))) return false; /* Likewise with dead code (possibly newly created by the other optimizations of cfg_cleanup). */ - if (!src1->pred || !src2->pred) + if (EDGE_COUNT (src1->preds) == 0 || EDGE_COUNT (src2->preds) == 0) return false; /* Look for the common insn sequence, part the first ... */ @@ -1488,10 +1658,20 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) /* ... and part the second. */ nmatch = flow_find_cross_jump (mode, src1, src2, &newpos1, &newpos2); - if (!nmatch) + + /* Don't proceed with the crossjump unless we found a sufficient number + of matching instructions or the 'from' block was totally matched + (such that its predecessors will hopefully be redirected and the + block removed). */ + if ((nmatch < PARAM_VALUE (PARAM_MIN_CROSSJUMP_INSNS)) + && (newpos1 != BB_HEAD (src1))) + return false; + + /* Avoid deleting preserve label when redirecting ABNORMAL edges. */ + if (block_has_preserve_label (e1->dest) + && (e1->flags & EDGE_ABNORMAL)) return false; -#ifndef CASE_DROPS_THROUGH /* Here we know that the insns in the end of SRC1 which are common with SRC2 will be deleted. If we have tablejumps in the end of SRC1 and SRC2 @@ -1522,43 +1702,55 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) } } } -#endif - /* Avoid splitting if possible. */ - if (newpos2 == BB_HEAD (src2)) + /* Avoid splitting if possible. We must always split when SRC2 has + EH predecessor edges, or we may end up with basic blocks with both + normal and EH predecessor edges. */ + if (newpos2 == BB_HEAD (src2) + && !(EDGE_PRED (src2, 0)->flags & EDGE_EH)) redirect_to = src2; else { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Splitting bb %i before %i insns\n", + if (newpos2 == BB_HEAD (src2)) + { + /* Skip possible basic block header. */ + if (LABEL_P (newpos2)) + newpos2 = NEXT_INSN (newpos2); + if (NOTE_P (newpos2)) + newpos2 = NEXT_INSN (newpos2); + } + + if (dump_file) + fprintf (dump_file, "Splitting bb %i before %i insns\n", src2->index, nmatch); redirect_to = split_block (src2, PREV_INSN (newpos2))->dest; } - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Cross jumping from bb %i to bb %i; %i common insns\n", src1->index, src2->index, nmatch); redirect_to->count += src1->count; redirect_to->frequency += src1->frequency; - /* We may have some registers visible trought the block. */ + /* We may have some registers visible through the block. */ redirect_to->flags |= BB_DIRTY; /* Recompute the frequencies and counts of outgoing edges. */ - for (s = redirect_to->succ; s; s = s->succ_next) + FOR_EACH_EDGE (s, ei, redirect_to->succs) { edge s2; + edge_iterator ei; basic_block d = s->dest; if (FORWARDER_BLOCK_P (d)) - d = d->succ->dest; + d = single_succ (d); - for (s2 = src1->succ; ; s2 = s2->succ_next) + FOR_EACH_EDGE (s2, ei, src1->succs) { basic_block d2 = s2->dest; if (FORWARDER_BLOCK_P (d2)) - d2 = d2->succ->dest; + d2 = single_succ (d2); if (d == d2) break; } @@ -1566,20 +1758,20 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) s->count += s2->count; /* Take care to update possible forwarder blocks. We verified - that there is no more than one in the chain, so we can't run - into infinite loop. */ + that there is no more than one in the chain, so we can't run + into infinite loop. */ if (FORWARDER_BLOCK_P (s->dest)) { - s->dest->succ->count += s2->count; + single_succ_edge (s->dest)->count += s2->count; s->dest->count += s2->count; s->dest->frequency += EDGE_FREQUENCY (s); } if (FORWARDER_BLOCK_P (s2->dest)) { - s2->dest->succ->count -= s2->count; - if (s2->dest->succ->count < 0) - s2->dest->succ->count = 0; + single_succ_edge (s2->dest)->count -= s2->count; + if (single_succ_edge (s2->dest)->count < 0) + single_succ_edge (s2->dest)->count = 0; s2->dest->count -= s2->count; s2->dest->frequency -= EDGE_FREQUENCY (s); if (s2->dest->frequency < 0) @@ -1602,19 +1794,21 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) /* Edit SRC1 to go to REDIRECT_TO at NEWPOS1. */ /* Skip possible basic block header. */ - if (GET_CODE (newpos1) == CODE_LABEL) + if (LABEL_P (newpos1)) newpos1 = NEXT_INSN (newpos1); - if (GET_CODE (newpos1) == NOTE) + if (NOTE_P (newpos1)) newpos1 = NEXT_INSN (newpos1); redirect_from = split_block (src1, PREV_INSN (newpos1))->src; - to_remove = redirect_from->succ->dest; + to_remove = single_succ (redirect_from); - redirect_edge_and_branch_force (redirect_from->succ, redirect_to); - delete_block (to_remove); + redirect_edge_and_branch_force (single_succ_edge (redirect_from), redirect_to); + delete_basic_block (to_remove); update_forwarder_flag (redirect_from); + if (redirect_to != src2) + update_forwarder_flag (src2); return true; } @@ -1626,12 +1820,36 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) static bool try_crossjump_bb (int mode, basic_block bb) { - edge e, e2, nexte2, nexte, fallthru; + edge e, e2, fallthru; bool changed; - int n = 0, max; + unsigned max, ix, ix2; + basic_block ev, ev2; + edge_iterator ei; /* Nothing to do if there is not at least two incoming edges. */ - if (!bb->pred || !bb->pred->pred_next) + if (EDGE_COUNT (bb->preds) < 2) + return false; + + /* Don't crossjump if this block ends in a computed jump, + unless we are optimizing for size. */ + if (!optimize_size + && bb != EXIT_BLOCK_PTR + && computed_jump_p (BB_END (bb))) + return false; + + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (EDGE_PRED (bb, 0)->src) != + BB_PARTITION (EDGE_PRED (bb, 1)->src) + || (EDGE_PRED (bb, 0)->flags & EDGE_CROSSING)) return false; /* It is always cheapest to redirect a block that ends in a branch to @@ -1639,18 +1857,21 @@ try_crossjump_bb (int mode, basic_block bb) program. We'll try that combination first. */ fallthru = NULL; max = PARAM_VALUE (PARAM_MAX_CROSSJUMP_EDGES); - for (e = bb->pred; e ; e = e->pred_next, n++) + + if (EDGE_COUNT (bb->preds) > max) + return false; + + FOR_EACH_EDGE (e, ei, bb->preds) { if (e->flags & EDGE_FALLTHRU) fallthru = e; - if (n > max) - return false; } changed = false; - for (e = bb->pred; e; e = nexte) + for (ix = 0, ev = bb; ix < EDGE_COUNT (ev->preds); ) { - nexte = e->pred_next; + e = EDGE_PRED (ev, ix); + ix++; /* As noted above, first try with the fallthru predecessor. */ if (fallthru) @@ -1659,11 +1880,18 @@ try_crossjump_bb (int mode, basic_block bb) If there is a match, we'll do it the other way around. */ if (e == fallthru) continue; + /* If nothing changed since the last attempt, there is nothing + we can do. */ + if (!first_pass + && (!(e->src->flags & BB_DIRTY) + && !(fallthru->src->flags & BB_DIRTY))) + continue; if (try_crossjump_to_edge (mode, e, fallthru)) { changed = true; - nexte = bb->pred; + ix = 0; + ev = bb; continue; } } @@ -1680,12 +1908,13 @@ try_crossjump_bb (int mode, basic_block bb) can eliminate redundant checks of crossjump(A,B) by arbitrarily choosing to do the check from the block for which the edge in question is the first successor of A. */ - if (e->src->succ != e) + if (EDGE_SUCC (e->src, 0) != e) continue; - for (e2 = bb->pred; e2; e2 = nexte2) + for (ix2 = 0, ev2 = bb; ix2 < EDGE_COUNT (ev2->preds); ) { - nexte2 = e2->pred_next; + e2 = EDGE_PRED (ev2, ix2); + ix2++; if (e2 == e) continue; @@ -1701,10 +1930,18 @@ try_crossjump_bb (int mode, basic_block bb) if (e->src->index > e2->src->index) continue; + /* If nothing changed since the last attempt, there is nothing + we can do. */ + if (!first_pass + && (!(e->src->flags & BB_DIRTY) + && !(e2->src->flags & BB_DIRTY))) + continue; + if (try_crossjump_to_edge (mode, e, e2)) { changed = true; - nexte = bb->pred; + ev2 = bb; + ix = 0; break; } } @@ -1727,14 +1964,15 @@ try_optimize_cfg (int mode) if (mode & CLEANUP_CROSSJUMP) add_noreturn_fake_exit_edges (); + if (mode & (CLEANUP_UPDATE_LIFE | CLEANUP_CROSSJUMP | CLEANUP_THREADING)) + clear_bb_flags (); + FOR_EACH_BB (bb) update_forwarder_flag (bb); - if (mode & CLEANUP_UPDATE_LIFE) - clear_bb_flags (); - - if (! (* targetm.cannot_modify_jumps_p) ()) + if (! targetm.cannot_modify_jumps_p ()) { + first_pass = true; /* Attempt to merge blocks as made possible by edge removal. If a block has only one successor, and the successor has only one predecessor, they may be combined. */ @@ -1743,8 +1981,8 @@ try_optimize_cfg (int mode) changed = false; iterations++; - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "\n\ntry_optimize_cfg iteration %i\n\n", iterations); @@ -1755,38 +1993,34 @@ try_optimize_cfg (int mode) bool changed_here = false; /* Delete trivially dead basic blocks. */ - while (b->pred == NULL) + while (EDGE_COUNT (b->preds) == 0) { c = b->prev_bb; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Deleting block %i.\n", + if (dump_file) + fprintf (dump_file, "Deleting block %i.\n", b->index); - delete_block (b); + delete_basic_block (b); if (!(mode & CLEANUP_CFGLAYOUT)) changed = true; b = c; } - /* Remove code labels no longer used. Don't do this - before CALL_PLACEHOLDER is removed, as some branches - may be hidden within. */ - if (b->pred->pred_next == NULL - && (b->pred->flags & EDGE_FALLTHRU) - && !(b->pred->flags & EDGE_COMPLEX) - && GET_CODE (BB_HEAD (b)) == CODE_LABEL - && (!(mode & CLEANUP_PRE_SIBCALL) - || !tail_recursion_label_p (BB_HEAD (b))) + /* Remove code labels no longer used. */ + if (single_pred_p (b) + && (single_pred_edge (b)->flags & EDGE_FALLTHRU) + && !(single_pred_edge (b)->flags & EDGE_COMPLEX) + && LABEL_P (BB_HEAD (b)) /* If the previous block ends with a branch to this block, we can't delete the label. Normally this is a condjump that is yet to be simplified, but if CASE_DROPS_THRU, this can be a tablejump with some element going to the same place as the default (fallthru). */ - && (b->pred->src == ENTRY_BLOCK_PTR - || GET_CODE (BB_END (b->pred->src)) != JUMP_INSN + && (single_pred (b) == ENTRY_BLOCK_PTR + || !JUMP_P (BB_END (single_pred (b))) || ! label_is_jump_target_p (BB_HEAD (b), - BB_END (b->pred->src)))) + BB_END (single_pred (b))))) { rtx label = BB_HEAD (b); @@ -1800,39 +2034,40 @@ try_optimize_cfg (int mode) reorder_insns_nobb (label, label, bb_note); BB_HEAD (b) = bb_note; } - if (rtl_dump_file) - fprintf (rtl_dump_file, "Deleted label in block %i.\n", + if (dump_file) + fprintf (dump_file, "Deleted label in block %i.\n", b->index); } /* If we fall through an empty block, we can remove it. */ if (!(mode & CLEANUP_CFGLAYOUT) - && b->pred->pred_next == NULL - && (b->pred->flags & EDGE_FALLTHRU) - && GET_CODE (BB_HEAD (b)) != CODE_LABEL + && single_pred_p (b) + && (single_pred_edge (b)->flags & EDGE_FALLTHRU) + && !LABEL_P (BB_HEAD (b)) && FORWARDER_BLOCK_P (b) /* Note that forwarder_block_p true ensures that there is a successor for this block. */ - && (b->succ->flags & EDGE_FALLTHRU) - && n_basic_blocks > 1) + && (single_succ_edge (b)->flags & EDGE_FALLTHRU) + && n_basic_blocks > NUM_FIXED_BLOCKS + 1) { - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, "Deleting fallthru block %i.\n", b->index); c = b->prev_bb == ENTRY_BLOCK_PTR ? b->next_bb : b->prev_bb; - redirect_edge_succ_nodup (b->pred, b->succ->dest); - delete_block (b); + redirect_edge_succ_nodup (single_pred_edge (b), + single_succ (b)); + delete_basic_block (b); changed = true; b = c; } - if ((s = b->succ) != NULL - && s->succ_next == NULL + if (single_succ_p (b) + && (s = single_succ_edge (b)) && !(s->flags & EDGE_COMPLEX) && (c = s->dest) != EXIT_BLOCK_PTR - && c->pred->pred_next == NULL + && single_pred_p (c) && b != c) { /* When not in cfg_layout mode use code aware of reordering @@ -1840,7 +2075,7 @@ try_optimize_cfg (int mode) does not fit merge_blocks interface and is kept here in hope that it will become useless once more of compiler is transformed to use cfg_layout mode. */ - + if ((mode & CLEANUP_CFGLAYOUT) && can_merge_blocks_p (b, c)) { @@ -1851,10 +2086,12 @@ try_optimize_cfg (int mode) else if (!(mode & CLEANUP_CFGLAYOUT) /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (BB_END (b)) != JUMP_INSN + && (!JUMP_P (BB_END (b)) || (reload_completed ? simplejump_p (BB_END (b)) - : onlyjump_p (BB_END (b)))) + : (onlyjump_p (BB_END (b)) + && !tablejump_p (BB_END (b), + NULL, NULL)))) && (next = merge_blocks_move (s, b, c, mode))) { b = next; @@ -1872,11 +2109,12 @@ try_optimize_cfg (int mode) non-trivial jump instruction without side-effects, we can either delete the jump entirely, or replace it with a simple unconditional jump. */ - if (b->succ - && ! b->succ->succ_next - && b->succ->dest != EXIT_BLOCK_PTR + if (single_succ_p (b) + && single_succ (b) != EXIT_BLOCK_PTR && onlyjump_p (BB_END (b)) - && try_redirect_by_replacing_jump (b->succ, b->succ->dest, + && !find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX) + && try_redirect_by_replacing_jump (single_succ_edge (b), + single_succ (b), (mode & CLEANUP_CFGLAYOUT) != 0)) { update_forwarder_flag (b); @@ -1910,14 +2148,16 @@ try_optimize_cfg (int mode) #endif changed_overall |= changed; + first_pass = false; } while (changed); } if (mode & CLEANUP_CROSSJUMP) - remove_fake_edges (); + remove_fake_exit_edges (); - clear_aux_for_blocks (); + FOR_ALL_BB (b) + b->flags &= ~(BB_FORWARDER_BLOCK | BB_NONTHREADABLE_BLOCK); return changed_overall; } @@ -1940,7 +2180,7 @@ delete_unreachable_blocks (void) if (!(b->flags & BB_REACHABLE)) { - delete_block (b); + delete_basic_block (b); changed = true; } } @@ -1949,6 +2189,31 @@ delete_unreachable_blocks (void) tidy_fallthru_edges (); return changed; } + +/* Merges sequential blocks if possible. */ + +bool +merge_seq_blocks (void) +{ + basic_block bb; + bool changed = false; + + for (bb = ENTRY_BLOCK_PTR->next_bb; bb != EXIT_BLOCK_PTR; ) + { + if (single_succ_p (bb) + && can_merge_blocks_p (bb, single_succ (bb))) + { + /* Merge the blocks and retry. */ + merge_blocks (bb, single_succ (bb)); + changed = true; + continue; + } + + bb = bb->next_bb; + } + + return changed; +} /* Tidy the CFG by deleting unreachable code and whatnot. */ @@ -1963,8 +2228,7 @@ cleanup_cfg (int mode) changed = true; /* We've possibly created trivially dead code. Cleanup it right now to introduce more opportunities for try_optimize_cfg. */ - if (!(mode & (CLEANUP_NO_INSN_DEL - | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL)) + if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_UPDATE_LIFE)) && !reload_completed) delete_trivially_dead_insns (get_insns(), max_reg_num ()); } @@ -1983,11 +2247,11 @@ cleanup_cfg (int mode) PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE - | ((mode & CLEANUP_LOG_LINKS) + | ((mode & CLEANUP_LOG_LINKS) ? PROP_LOG_LINKS : 0))) break; } - else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL)) + else if (!(mode & CLEANUP_NO_INSN_DEL) && (mode & CLEANUP_EXPENSIVE) && !reload_completed) { @@ -1999,9 +2263,85 @@ cleanup_cfg (int mode) delete_dead_jumptables (); } - /* Kill the data we won't maintain. */ - free_EXPR_LIST_list (&label_value_list); timevar_pop (TV_CLEANUP_CFG); return changed; } + +static unsigned int +rest_of_handle_jump (void) +{ + delete_unreachable_blocks (); + + if (cfun->tail_call_emit) + fixup_tail_calls (); + return 0; +} + +struct tree_opt_pass pass_jump = +{ + "sibling", /* name */ + NULL, /* gate */ + rest_of_handle_jump, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_JUMP, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + TODO_ggc_collect, /* todo_flags_start */ + TODO_dump_func | + TODO_verify_flow, /* todo_flags_finish */ + 'i' /* letter */ +}; + + +static unsigned int +rest_of_handle_jump2 (void) +{ + /* Turn NOTE_INSN_EXPECTED_VALUE into REG_BR_PROB. Do this + before jump optimization switches branch directions. */ + if (flag_guess_branch_prob) + expected_value_to_br_prob (); + + delete_trivially_dead_insns (get_insns (), max_reg_num ()); + reg_scan (get_insns (), max_reg_num ()); + if (dump_file) + dump_flow_info (dump_file, dump_flags); + cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) + | (flag_thread_jumps ? CLEANUP_THREADING : 0)); + + purge_line_number_notes (); + + if (optimize) + cleanup_cfg (CLEANUP_EXPENSIVE); + + /* Jump optimization, and the removal of NULL pointer checks, may + have reduced the number of instructions substantially. CSE, and + future passes, allocate arrays whose dimensions involve the + maximum instruction UID, so if we can reduce the maximum UID + we'll save big on memory. */ + renumber_insns (); + return 0; +} + + +struct tree_opt_pass pass_jump2 = +{ + "jump", /* name */ + NULL, /* gate */ + rest_of_handle_jump2, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_JUMP, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + TODO_ggc_collect, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 'j' /* letter */ +}; + + diff --git a/contrib/gcc/cfgexpand.c b/contrib/gcc/cfgexpand.c new file mode 100644 index 00000000000..b688917cc72 --- /dev/null +++ b/contrib/gcc/cfgexpand.c @@ -0,0 +1,1732 @@ +/* A pass for lowering trees to RTL. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "rtl.h" +#include "tm_p.h" +#include "basic-block.h" +#include "function.h" +#include "expr.h" +#include "langhooks.h" +#include "tree-flow.h" +#include "timevar.h" +#include "tree-dump.h" +#include "tree-pass.h" +#include "except.h" +#include "flags.h" +#include "diagnostic.h" +#include "toplev.h" +#include "debug.h" +#include "params.h" + +/* Verify that there is exactly single jump instruction since last and attach + REG_BR_PROB note specifying probability. + ??? We really ought to pass the probability down to RTL expanders and let it + re-distribute it when the conditional expands into multiple conditionals. + This is however difficult to do. */ +static void +add_reg_br_prob_note (rtx last, int probability) +{ + if (profile_status == PROFILE_ABSENT) + return; + for (last = NEXT_INSN (last); last && NEXT_INSN (last); last = NEXT_INSN (last)) + if (JUMP_P (last)) + { + /* It is common to emit condjump-around-jump sequence when we don't know + how to reverse the conditional. Special case this. */ + if (!any_condjump_p (last) + || !JUMP_P (NEXT_INSN (last)) + || !simplejump_p (NEXT_INSN (last)) + || !NEXT_INSN (NEXT_INSN (last)) + || !BARRIER_P (NEXT_INSN (NEXT_INSN (last))) + || !NEXT_INSN (NEXT_INSN (NEXT_INSN (last))) + || !LABEL_P (NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))) + || NEXT_INSN (NEXT_INSN (NEXT_INSN (NEXT_INSN (last))))) + goto failed; + gcc_assert (!find_reg_note (last, REG_BR_PROB, 0)); + REG_NOTES (last) + = gen_rtx_EXPR_LIST (REG_BR_PROB, + GEN_INT (REG_BR_PROB_BASE - probability), + REG_NOTES (last)); + return; + } + if (!last || !JUMP_P (last) || !any_condjump_p (last)) + goto failed; + gcc_assert (!find_reg_note (last, REG_BR_PROB, 0)); + REG_NOTES (last) + = gen_rtx_EXPR_LIST (REG_BR_PROB, + GEN_INT (probability), REG_NOTES (last)); + return; +failed: + if (dump_file) + fprintf (dump_file, "Failed to add probability note\n"); +} + + +#ifndef LOCAL_ALIGNMENT +#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT +#endif + +#ifndef STACK_ALIGNMENT_NEEDED +#define STACK_ALIGNMENT_NEEDED 1 +#endif + + +/* This structure holds data relevant to one variable that will be + placed in a stack slot. */ +struct stack_var +{ + /* The Variable. */ + tree decl; + + /* The offset of the variable. During partitioning, this is the + offset relative to the partition. After partitioning, this + is relative to the stack frame. */ + HOST_WIDE_INT offset; + + /* Initially, the size of the variable. Later, the size of the partition, + if this variable becomes it's partition's representative. */ + HOST_WIDE_INT size; + + /* The *byte* alignment required for this variable. Or as, with the + size, the alignment for this partition. */ + unsigned int alignb; + + /* The partition representative. */ + size_t representative; + + /* The next stack variable in the partition, or EOC. */ + size_t next; +}; + +#define EOC ((size_t)-1) + +/* We have an array of such objects while deciding allocation. */ +static struct stack_var *stack_vars; +static size_t stack_vars_alloc; +static size_t stack_vars_num; + +/* An array of indicies such that stack_vars[stack_vars_sorted[i]].size + is non-decreasing. */ +static size_t *stack_vars_sorted; + +/* We have an interference graph between such objects. This graph + is lower triangular. */ +static bool *stack_vars_conflict; +static size_t stack_vars_conflict_alloc; + +/* The phase of the stack frame. This is the known misalignment of + virtual_stack_vars_rtx from PREFERRED_STACK_BOUNDARY. That is, + (frame_offset+frame_phase) % PREFERRED_STACK_BOUNDARY == 0. */ +static int frame_phase; + +/* Used during expand_used_vars to remember if we saw any decls for + which we'd like to enable stack smashing protection. */ +static bool has_protected_decls; + +/* Used during expand_used_vars. Remember if we say a character buffer + smaller than our cutoff threshold. Used for -Wstack-protector. */ +static bool has_short_buffer; + +/* Discover the byte alignment to use for DECL. Ignore alignment + we can't do with expected alignment of the stack boundary. */ + +static unsigned int +get_decl_align_unit (tree decl) +{ + unsigned int align; + + align = DECL_ALIGN (decl); + align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align); + if (align > PREFERRED_STACK_BOUNDARY) + align = PREFERRED_STACK_BOUNDARY; + if (cfun->stack_alignment_needed < align) + cfun->stack_alignment_needed = align; + + return align / BITS_PER_UNIT; +} + +/* Allocate SIZE bytes at byte alignment ALIGN from the stack frame. + Return the frame offset. */ + +static HOST_WIDE_INT +alloc_stack_frame_space (HOST_WIDE_INT size, HOST_WIDE_INT align) +{ + HOST_WIDE_INT offset, new_frame_offset; + + new_frame_offset = frame_offset; + if (FRAME_GROWS_DOWNWARD) + { + new_frame_offset -= size + frame_phase; + new_frame_offset &= -align; + new_frame_offset += frame_phase; + offset = new_frame_offset; + } + else + { + new_frame_offset -= frame_phase; + new_frame_offset += align - 1; + new_frame_offset &= -align; + new_frame_offset += frame_phase; + offset = new_frame_offset; + new_frame_offset += size; + } + frame_offset = new_frame_offset; + + if (frame_offset_overflow (frame_offset, cfun->decl)) + frame_offset = offset = 0; + + return offset; +} + +/* Accumulate DECL into STACK_VARS. */ + +static void +add_stack_var (tree decl) +{ + if (stack_vars_num >= stack_vars_alloc) + { + if (stack_vars_alloc) + stack_vars_alloc = stack_vars_alloc * 3 / 2; + else + stack_vars_alloc = 32; + stack_vars + = XRESIZEVEC (struct stack_var, stack_vars, stack_vars_alloc); + } + stack_vars[stack_vars_num].decl = decl; + stack_vars[stack_vars_num].offset = 0; + stack_vars[stack_vars_num].size = tree_low_cst (DECL_SIZE_UNIT (decl), 1); + stack_vars[stack_vars_num].alignb = get_decl_align_unit (decl); + + /* All variables are initially in their own partition. */ + stack_vars[stack_vars_num].representative = stack_vars_num; + stack_vars[stack_vars_num].next = EOC; + + /* Ensure that this decl doesn't get put onto the list twice. */ + SET_DECL_RTL (decl, pc_rtx); + + stack_vars_num++; +} + +/* Compute the linear index of a lower-triangular coordinate (I, J). */ + +static size_t +triangular_index (size_t i, size_t j) +{ + if (i < j) + { + size_t t; + t = i, i = j, j = t; + } + return (i * (i + 1)) / 2 + j; +} + +/* Ensure that STACK_VARS_CONFLICT is large enough for N objects. */ + +static void +resize_stack_vars_conflict (size_t n) +{ + size_t size = triangular_index (n-1, n-1) + 1; + + if (size <= stack_vars_conflict_alloc) + return; + + stack_vars_conflict = XRESIZEVEC (bool, stack_vars_conflict, size); + memset (stack_vars_conflict + stack_vars_conflict_alloc, 0, + (size - stack_vars_conflict_alloc) * sizeof (bool)); + stack_vars_conflict_alloc = size; +} + +/* Make the decls associated with luid's X and Y conflict. */ + +static void +add_stack_var_conflict (size_t x, size_t y) +{ + size_t index = triangular_index (x, y); + gcc_assert (index < stack_vars_conflict_alloc); + stack_vars_conflict[index] = true; +} + +/* Check whether the decls associated with luid's X and Y conflict. */ + +static bool +stack_var_conflict_p (size_t x, size_t y) +{ + size_t index = triangular_index (x, y); + gcc_assert (index < stack_vars_conflict_alloc); + return stack_vars_conflict[index]; +} + +/* Returns true if TYPE is or contains a union type. */ + +static bool +aggregate_contains_union_type (tree type) +{ + tree field; + + if (TREE_CODE (type) == UNION_TYPE + || TREE_CODE (type) == QUAL_UNION_TYPE) + return true; + if (TREE_CODE (type) == ARRAY_TYPE) + return aggregate_contains_union_type (TREE_TYPE (type)); + if (TREE_CODE (type) != RECORD_TYPE) + return false; + + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL) + if (aggregate_contains_union_type (TREE_TYPE (field))) + return true; + + return false; +} + +/* A subroutine of expand_used_vars. If two variables X and Y have alias + sets that do not conflict, then do add a conflict for these variables + in the interference graph. We also need to make sure to add conflicts + for union containing structures. Else RTL alias analysis comes along + and due to type based aliasing rules decides that for two overlapping + union temporaries { short s; int i; } accesses to the same mem through + different types may not alias and happily reorders stores across + life-time boundaries of the temporaries (See PR25654). + We also have to mind MEM_IN_STRUCT_P and MEM_SCALAR_P. */ + +static void +add_alias_set_conflicts (void) +{ + size_t i, j, n = stack_vars_num; + + for (i = 0; i < n; ++i) + { + tree type_i = TREE_TYPE (stack_vars[i].decl); + bool aggr_i = AGGREGATE_TYPE_P (type_i); + bool contains_union; + + contains_union = aggregate_contains_union_type (type_i); + for (j = 0; j < i; ++j) + { + tree type_j = TREE_TYPE (stack_vars[j].decl); + bool aggr_j = AGGREGATE_TYPE_P (type_j); + if (aggr_i != aggr_j + /* Either the objects conflict by means of type based + aliasing rules, or we need to add a conflict. */ + || !objects_must_conflict_p (type_i, type_j) + /* In case the types do not conflict ensure that access + to elements will conflict. In case of unions we have + to be careful as type based aliasing rules may say + access to the same memory does not conflict. So play + safe and add a conflict in this case. */ + || contains_union) + add_stack_var_conflict (i, j); + } + } +} + +/* A subroutine of partition_stack_vars. A comparison function for qsort, + sorting an array of indicies by the size of the object. */ + +static int +stack_var_size_cmp (const void *a, const void *b) +{ + HOST_WIDE_INT sa = stack_vars[*(const size_t *)a].size; + HOST_WIDE_INT sb = stack_vars[*(const size_t *)b].size; + unsigned int uida = DECL_UID (stack_vars[*(const size_t *)a].decl); + unsigned int uidb = DECL_UID (stack_vars[*(const size_t *)b].decl); + + if (sa < sb) + return -1; + if (sa > sb) + return 1; + /* For stack variables of the same size use the uid of the decl + to make the sort stable. */ + if (uida < uidb) + return -1; + if (uida > uidb) + return 1; + return 0; +} + +/* A subroutine of partition_stack_vars. The UNION portion of a UNION/FIND + partitioning algorithm. Partitions A and B are known to be non-conflicting. + Merge them into a single partition A. + + At the same time, add OFFSET to all variables in partition B. At the end + of the partitioning process we've have a nice block easy to lay out within + the stack frame. */ + +static void +union_stack_vars (size_t a, size_t b, HOST_WIDE_INT offset) +{ + size_t i, last; + + /* Update each element of partition B with the given offset, + and merge them into partition A. */ + for (last = i = b; i != EOC; last = i, i = stack_vars[i].next) + { + stack_vars[i].offset += offset; + stack_vars[i].representative = a; + } + stack_vars[last].next = stack_vars[a].next; + stack_vars[a].next = b; + + /* Update the required alignment of partition A to account for B. */ + if (stack_vars[a].alignb < stack_vars[b].alignb) + stack_vars[a].alignb = stack_vars[b].alignb; + + /* Update the interference graph and merge the conflicts. */ + for (last = stack_vars_num, i = 0; i < last; ++i) + if (stack_var_conflict_p (b, i)) + add_stack_var_conflict (a, i); +} + +/* A subroutine of expand_used_vars. Binpack the variables into + partitions constrained by the interference graph. The overall + algorithm used is as follows: + + Sort the objects by size. + For each object A { + S = size(A) + O = 0 + loop { + Look for the largest non-conflicting object B with size <= S. + UNION (A, B) + offset(B) = O + O += size(B) + S -= size(B) + } + } +*/ + +static void +partition_stack_vars (void) +{ + size_t si, sj, n = stack_vars_num; + + stack_vars_sorted = XNEWVEC (size_t, stack_vars_num); + for (si = 0; si < n; ++si) + stack_vars_sorted[si] = si; + + if (n == 1) + return; + + qsort (stack_vars_sorted, n, sizeof (size_t), stack_var_size_cmp); + + /* Special case: detect when all variables conflict, and thus we can't + do anything during the partitioning loop. It isn't uncommon (with + C code at least) to declare all variables at the top of the function, + and if we're not inlining, then all variables will be in the same scope. + Take advantage of very fast libc routines for this scan. */ + gcc_assert (sizeof(bool) == sizeof(char)); + if (memchr (stack_vars_conflict, false, stack_vars_conflict_alloc) == NULL) + return; + + for (si = 0; si < n; ++si) + { + size_t i = stack_vars_sorted[si]; + HOST_WIDE_INT isize = stack_vars[i].size; + HOST_WIDE_INT offset = 0; + + for (sj = si; sj-- > 0; ) + { + size_t j = stack_vars_sorted[sj]; + HOST_WIDE_INT jsize = stack_vars[j].size; + unsigned int jalign = stack_vars[j].alignb; + + /* Ignore objects that aren't partition representatives. */ + if (stack_vars[j].representative != j) + continue; + + /* Ignore objects too large for the remaining space. */ + if (isize < jsize) + continue; + + /* Ignore conflicting objects. */ + if (stack_var_conflict_p (i, j)) + continue; + + /* Refine the remaining space check to include alignment. */ + if (offset & (jalign - 1)) + { + HOST_WIDE_INT toff = offset; + toff += jalign - 1; + toff &= -(HOST_WIDE_INT)jalign; + if (isize - (toff - offset) < jsize) + continue; + + isize -= toff - offset; + offset = toff; + } + + /* UNION the objects, placing J at OFFSET. */ + union_stack_vars (i, j, offset); + + isize -= jsize; + if (isize == 0) + break; + } + } +} + +/* A debugging aid for expand_used_vars. Dump the generated partitions. */ + +static void +dump_stack_var_partition (void) +{ + size_t si, i, j, n = stack_vars_num; + + for (si = 0; si < n; ++si) + { + i = stack_vars_sorted[si]; + + /* Skip variables that aren't partition representatives, for now. */ + if (stack_vars[i].representative != i) + continue; + + fprintf (dump_file, "Partition %lu: size " HOST_WIDE_INT_PRINT_DEC + " align %u\n", (unsigned long) i, stack_vars[i].size, + stack_vars[i].alignb); + + for (j = i; j != EOC; j = stack_vars[j].next) + { + fputc ('\t', dump_file); + print_generic_expr (dump_file, stack_vars[j].decl, dump_flags); + fprintf (dump_file, ", offset " HOST_WIDE_INT_PRINT_DEC "\n", + stack_vars[i].offset); + } + } +} + +/* Assign rtl to DECL at frame offset OFFSET. */ + +static void +expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset) +{ + HOST_WIDE_INT align; + rtx x; + + /* If this fails, we've overflowed the stack frame. Error nicely? */ + gcc_assert (offset == trunc_int_for_mode (offset, Pmode)); + + x = plus_constant (virtual_stack_vars_rtx, offset); + x = gen_rtx_MEM (DECL_MODE (decl), x); + + /* Set alignment we actually gave this decl. */ + offset -= frame_phase; + align = offset & -offset; + align *= BITS_PER_UNIT; + if (align > STACK_BOUNDARY || align == 0) + align = STACK_BOUNDARY; + DECL_ALIGN (decl) = align; + DECL_USER_ALIGN (decl) = 0; + + set_mem_attributes (x, decl, true); + SET_DECL_RTL (decl, x); +} + +/* A subroutine of expand_used_vars. Give each partition representative + a unique location within the stack frame. Update each partition member + with that location. */ + +static void +expand_stack_vars (bool (*pred) (tree)) +{ + size_t si, i, j, n = stack_vars_num; + + for (si = 0; si < n; ++si) + { + HOST_WIDE_INT offset; + + i = stack_vars_sorted[si]; + + /* Skip variables that aren't partition representatives, for now. */ + if (stack_vars[i].representative != i) + continue; + + /* Skip variables that have already had rtl assigned. See also + add_stack_var where we perpetrate this pc_rtx hack. */ + if (DECL_RTL (stack_vars[i].decl) != pc_rtx) + continue; + + /* Check the predicate to see whether this variable should be + allocated in this pass. */ + if (pred && !pred (stack_vars[i].decl)) + continue; + + offset = alloc_stack_frame_space (stack_vars[i].size, + stack_vars[i].alignb); + + /* Create rtl for each variable based on their location within the + partition. */ + for (j = i; j != EOC; j = stack_vars[j].next) + expand_one_stack_var_at (stack_vars[j].decl, + stack_vars[j].offset + offset); + } +} + +/* A subroutine of expand_one_var. Called to immediately assign rtl + to a variable to be allocated in the stack frame. */ + +static void +expand_one_stack_var (tree var) +{ + HOST_WIDE_INT size, offset, align; + + size = tree_low_cst (DECL_SIZE_UNIT (var), 1); + align = get_decl_align_unit (var); + offset = alloc_stack_frame_space (size, align); + + expand_one_stack_var_at (var, offset); +} + +/* A subroutine of expand_one_var. Called to assign rtl + to a TREE_STATIC VAR_DECL. */ + +static void +expand_one_static_var (tree var) +{ + /* In unit-at-a-time all the static variables are expanded at the end + of compilation process. */ + if (flag_unit_at_a_time) + return; + /* If this is an inlined copy of a static local variable, + look up the original. */ + var = DECL_ORIGIN (var); + + /* If we've already processed this variable because of that, do nothing. */ + if (TREE_ASM_WRITTEN (var)) + return; + + /* Give the front end a chance to do whatever. In practice, this is + resolving duplicate names for IMA in C. */ + if (lang_hooks.expand_decl (var)) + return; + + /* Otherwise, just emit the variable. */ + rest_of_decl_compilation (var, 0, 0); +} + +/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL + that will reside in a hard register. */ + +static void +expand_one_hard_reg_var (tree var) +{ + rest_of_decl_compilation (var, 0, 0); +} + +/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL + that will reside in a pseudo register. */ + +static void +expand_one_register_var (tree var) +{ + tree type = TREE_TYPE (var); + int unsignedp = TYPE_UNSIGNED (type); + enum machine_mode reg_mode + = promote_mode (type, DECL_MODE (var), &unsignedp, 0); + rtx x = gen_reg_rtx (reg_mode); + + SET_DECL_RTL (var, x); + + /* Note if the object is a user variable. */ + if (!DECL_ARTIFICIAL (var)) + { + mark_user_reg (x); + + /* Trust user variables which have a pointer type to really + be pointers. Do not trust compiler generated temporaries + as our type system is totally busted as it relates to + pointer arithmetic which translates into lots of compiler + generated objects with pointer types, but which are not really + pointers. */ + if (POINTER_TYPE_P (type)) + mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (var)))); + } +} + +/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that + has some associated error, e.g. its type is error-mark. We just need + to pick something that won't crash the rest of the compiler. */ + +static void +expand_one_error_var (tree var) +{ + enum machine_mode mode = DECL_MODE (var); + rtx x; + + if (mode == BLKmode) + x = gen_rtx_MEM (BLKmode, const0_rtx); + else if (mode == VOIDmode) + x = const0_rtx; + else + x = gen_reg_rtx (mode); + + SET_DECL_RTL (var, x); +} + +/* A subroutine of expand_one_var. VAR is a variable that will be + allocated to the local stack frame. Return true if we wish to + add VAR to STACK_VARS so that it will be coalesced with other + variables. Return false to allocate VAR immediately. + + This function is used to reduce the number of variables considered + for coalescing, which reduces the size of the quadratic problem. */ + +static bool +defer_stack_allocation (tree var, bool toplevel) +{ + /* If stack protection is enabled, *all* stack variables must be deferred, + so that we can re-order the strings to the top of the frame. */ + if (flag_stack_protect) + return true; + + /* Variables in the outermost scope automatically conflict with + every other variable. The only reason to want to defer them + at all is that, after sorting, we can more efficiently pack + small variables in the stack frame. Continue to defer at -O2. */ + if (toplevel && optimize < 2) + return false; + + /* Without optimization, *most* variables are allocated from the + stack, which makes the quadratic problem large exactly when we + want compilation to proceed as quickly as possible. On the + other hand, we don't want the function's stack frame size to + get completely out of hand. So we avoid adding scalars and + "small" aggregates to the list at all. */ + if (optimize == 0 && tree_low_cst (DECL_SIZE_UNIT (var), 1) < 32) + return false; + + return true; +} + +/* A subroutine of expand_used_vars. Expand one variable according to + its flavor. Variables to be placed on the stack are not actually + expanded yet, merely recorded. */ + +static void +expand_one_var (tree var, bool toplevel) +{ + if (TREE_CODE (var) != VAR_DECL) + lang_hooks.expand_decl (var); + else if (DECL_EXTERNAL (var)) + ; + else if (DECL_HAS_VALUE_EXPR_P (var)) + ; + else if (TREE_STATIC (var)) + expand_one_static_var (var); + else if (DECL_RTL_SET_P (var)) + ; + else if (TREE_TYPE (var) == error_mark_node) + expand_one_error_var (var); + else if (DECL_HARD_REGISTER (var)) + expand_one_hard_reg_var (var); + else if (use_register_for_decl (var)) + expand_one_register_var (var); + else if (defer_stack_allocation (var, toplevel)) + add_stack_var (var); + else + expand_one_stack_var (var); +} + +/* A subroutine of expand_used_vars. Walk down through the BLOCK tree + expanding variables. Those variables that can be put into registers + are allocated pseudos; those that can't are put on the stack. + + TOPLEVEL is true if this is the outermost BLOCK. */ + +static void +expand_used_vars_for_block (tree block, bool toplevel) +{ + size_t i, j, old_sv_num, this_sv_num, new_sv_num; + tree t; + + old_sv_num = toplevel ? 0 : stack_vars_num; + + /* Expand all variables at this level. */ + for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t)) + if (TREE_USED (t) + /* Force local static variables to be output when marked by + used attribute. For unit-at-a-time, cgraph code already takes + care of this. */ + || (!flag_unit_at_a_time && TREE_STATIC (t) + && DECL_PRESERVE_P (t))) + expand_one_var (t, toplevel); + + this_sv_num = stack_vars_num; + + /* Expand all variables at containing levels. */ + for (t = BLOCK_SUBBLOCKS (block); t ; t = BLOCK_CHAIN (t)) + expand_used_vars_for_block (t, false); + + /* Since we do not track exact variable lifetimes (which is not even + possible for variables whose address escapes), we mirror the block + tree in the interference graph. Here we cause all variables at this + level, and all sublevels, to conflict. Do make certain that a + variable conflicts with itself. */ + if (old_sv_num < this_sv_num) + { + new_sv_num = stack_vars_num; + resize_stack_vars_conflict (new_sv_num); + + for (i = old_sv_num; i < new_sv_num; ++i) + for (j = i < this_sv_num ? i+1 : this_sv_num; j-- > old_sv_num ;) + add_stack_var_conflict (i, j); + } +} + +/* A subroutine of expand_used_vars. Walk down through the BLOCK tree + and clear TREE_USED on all local variables. */ + +static void +clear_tree_used (tree block) +{ + tree t; + + for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t)) + /* if (!TREE_STATIC (t) && !DECL_EXTERNAL (t)) */ + TREE_USED (t) = 0; + + for (t = BLOCK_SUBBLOCKS (block); t ; t = BLOCK_CHAIN (t)) + clear_tree_used (t); +} + +/* Examine TYPE and determine a bit mask of the following features. */ + +#define SPCT_HAS_LARGE_CHAR_ARRAY 1 +#define SPCT_HAS_SMALL_CHAR_ARRAY 2 +#define SPCT_HAS_ARRAY 4 +#define SPCT_HAS_AGGREGATE 8 + +static unsigned int +stack_protect_classify_type (tree type) +{ + unsigned int ret = 0; + tree t; + + switch (TREE_CODE (type)) + { + case ARRAY_TYPE: + t = TYPE_MAIN_VARIANT (TREE_TYPE (type)); + if (t == char_type_node + || t == signed_char_type_node + || t == unsigned_char_type_node) + { + unsigned HOST_WIDE_INT max = PARAM_VALUE (PARAM_SSP_BUFFER_SIZE); + unsigned HOST_WIDE_INT len; + + if (!TYPE_SIZE_UNIT (type) + || !host_integerp (TYPE_SIZE_UNIT (type), 1)) + len = max; + else + len = tree_low_cst (TYPE_SIZE_UNIT (type), 1); + + if (len < max) + ret = SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_ARRAY; + else + ret = SPCT_HAS_LARGE_CHAR_ARRAY | SPCT_HAS_ARRAY; + } + else + ret = SPCT_HAS_ARRAY; + break; + + case UNION_TYPE: + case QUAL_UNION_TYPE: + case RECORD_TYPE: + ret = SPCT_HAS_AGGREGATE; + for (t = TYPE_FIELDS (type); t ; t = TREE_CHAIN (t)) + if (TREE_CODE (t) == FIELD_DECL) + ret |= stack_protect_classify_type (TREE_TYPE (t)); + break; + + default: + break; + } + + return ret; +} + +/* Return nonzero if DECL should be segregated into the "vulnerable" upper + part of the local stack frame. Remember if we ever return nonzero for + any variable in this function. The return value is the phase number in + which the variable should be allocated. */ + +static int +stack_protect_decl_phase (tree decl) +{ + unsigned int bits = stack_protect_classify_type (TREE_TYPE (decl)); + int ret = 0; + + if (bits & SPCT_HAS_SMALL_CHAR_ARRAY) + has_short_buffer = true; + + if (flag_stack_protect == 2) + { + if ((bits & (SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_LARGE_CHAR_ARRAY)) + && !(bits & SPCT_HAS_AGGREGATE)) + ret = 1; + else if (bits & SPCT_HAS_ARRAY) + ret = 2; + } + else + ret = (bits & SPCT_HAS_LARGE_CHAR_ARRAY) != 0; + + if (ret) + has_protected_decls = true; + + return ret; +} + +/* Two helper routines that check for phase 1 and phase 2. These are used + as callbacks for expand_stack_vars. */ + +static bool +stack_protect_decl_phase_1 (tree decl) +{ + return stack_protect_decl_phase (decl) == 1; +} + +static bool +stack_protect_decl_phase_2 (tree decl) +{ + return stack_protect_decl_phase (decl) == 2; +} + +/* Ensure that variables in different stack protection phases conflict + so that they are not merged and share the same stack slot. */ + +static void +add_stack_protection_conflicts (void) +{ + size_t i, j, n = stack_vars_num; + unsigned char *phase; + + phase = XNEWVEC (unsigned char, n); + for (i = 0; i < n; ++i) + phase[i] = stack_protect_decl_phase (stack_vars[i].decl); + + for (i = 0; i < n; ++i) + { + unsigned char ph_i = phase[i]; + for (j = 0; j < i; ++j) + if (ph_i != phase[j]) + add_stack_var_conflict (i, j); + } + + XDELETEVEC (phase); +} + +/* Create a decl for the guard at the top of the stack frame. */ + +static void +create_stack_guard (void) +{ + tree guard = build_decl (VAR_DECL, NULL, ptr_type_node); + TREE_THIS_VOLATILE (guard) = 1; + TREE_USED (guard) = 1; + expand_one_stack_var (guard); + cfun->stack_protect_guard = guard; +} + +/* Expand all variables used in the function. */ + +static void +expand_used_vars (void) +{ + tree t, outer_block = DECL_INITIAL (current_function_decl); + + /* Compute the phase of the stack frame for this function. */ + { + int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; + int off = STARTING_FRAME_OFFSET % align; + frame_phase = off ? align - off : 0; + } + + /* Set TREE_USED on all variables in the unexpanded_var_list. */ + for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) + TREE_USED (TREE_VALUE (t)) = 1; + + /* Clear TREE_USED on all variables associated with a block scope. */ + clear_tree_used (outer_block); + + /* Initialize local stack smashing state. */ + has_protected_decls = false; + has_short_buffer = false; + + /* At this point all variables on the unexpanded_var_list with TREE_USED + set are not associated with any block scope. Lay them out. */ + for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) + { + tree var = TREE_VALUE (t); + bool expand_now = false; + + /* We didn't set a block for static or extern because it's hard + to tell the difference between a global variable (re)declared + in a local scope, and one that's really declared there to + begin with. And it doesn't really matter much, since we're + not giving them stack space. Expand them now. */ + if (TREE_STATIC (var) || DECL_EXTERNAL (var)) + expand_now = true; + + /* Any variable that could have been hoisted into an SSA_NAME + will have been propagated anywhere the optimizers chose, + i.e. not confined to their original block. Allocate them + as if they were defined in the outermost scope. */ + else if (is_gimple_reg (var)) + expand_now = true; + + /* If the variable is not associated with any block, then it + was created by the optimizers, and could be live anywhere + in the function. */ + else if (TREE_USED (var)) + expand_now = true; + + /* Finally, mark all variables on the list as used. We'll use + this in a moment when we expand those associated with scopes. */ + TREE_USED (var) = 1; + + if (expand_now) + expand_one_var (var, true); + } + cfun->unexpanded_var_list = NULL_TREE; + + /* At this point, all variables within the block tree with TREE_USED + set are actually used by the optimized function. Lay them out. */ + expand_used_vars_for_block (outer_block, true); + + if (stack_vars_num > 0) + { + /* Due to the way alias sets work, no variables with non-conflicting + alias sets may be assigned the same address. Add conflicts to + reflect this. */ + add_alias_set_conflicts (); + + /* If stack protection is enabled, we don't share space between + vulnerable data and non-vulnerable data. */ + if (flag_stack_protect) + add_stack_protection_conflicts (); + + /* Now that we have collected all stack variables, and have computed a + minimal interference graph, attempt to save some stack space. */ + partition_stack_vars (); + if (dump_file) + dump_stack_var_partition (); + } + + /* There are several conditions under which we should create a + stack guard: protect-all, alloca used, protected decls present. */ + if (flag_stack_protect == 2 + || (flag_stack_protect + && (current_function_calls_alloca || has_protected_decls))) + create_stack_guard (); + + /* Assign rtl to each variable based on these partitions. */ + if (stack_vars_num > 0) + { + /* Reorder decls to be protected by iterating over the variables + array multiple times, and allocating out of each phase in turn. */ + /* ??? We could probably integrate this into the qsort we did + earlier, such that we naturally see these variables first, + and thus naturally allocate things in the right order. */ + if (has_protected_decls) + { + /* Phase 1 contains only character arrays. */ + expand_stack_vars (stack_protect_decl_phase_1); + + /* Phase 2 contains other kinds of arrays. */ + if (flag_stack_protect == 2) + expand_stack_vars (stack_protect_decl_phase_2); + } + + expand_stack_vars (NULL); + + /* Free up stack variable graph data. */ + XDELETEVEC (stack_vars); + XDELETEVEC (stack_vars_sorted); + XDELETEVEC (stack_vars_conflict); + stack_vars = NULL; + stack_vars_alloc = stack_vars_num = 0; + stack_vars_conflict = NULL; + stack_vars_conflict_alloc = 0; + } + + /* If the target requires that FRAME_OFFSET be aligned, do it. */ + if (STACK_ALIGNMENT_NEEDED) + { + HOST_WIDE_INT align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; + if (!FRAME_GROWS_DOWNWARD) + frame_offset += align - 1; + frame_offset &= -align; + } +} + + +/* If we need to produce a detailed dump, print the tree representation + for STMT to the dump file. SINCE is the last RTX after which the RTL + generated for STMT should have been appended. */ + +static void +maybe_dump_rtl_for_tree_stmt (tree stmt, rtx since) +{ + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "\n;; "); + print_generic_expr (dump_file, stmt, TDF_SLIM); + fprintf (dump_file, "\n"); + + print_rtl (dump_file, since ? NEXT_INSN (since) : since); + } +} + +/* A subroutine of expand_gimple_basic_block. Expand one COND_EXPR. + Returns a new basic block if we've terminated the current basic + block and created a new one. */ + +static basic_block +expand_gimple_cond_expr (basic_block bb, tree stmt) +{ + basic_block new_bb, dest; + edge new_edge; + edge true_edge; + edge false_edge; + tree pred = COND_EXPR_COND (stmt); + tree then_exp = COND_EXPR_THEN (stmt); + tree else_exp = COND_EXPR_ELSE (stmt); + rtx last2, last; + + last2 = last = get_last_insn (); + + extract_true_false_edges_from_block (bb, &true_edge, &false_edge); + if (EXPR_LOCUS (stmt)) + { + emit_line_note (*(EXPR_LOCUS (stmt))); + record_block_change (TREE_BLOCK (stmt)); + } + + /* These flags have no purpose in RTL land. */ + true_edge->flags &= ~EDGE_TRUE_VALUE; + false_edge->flags &= ~EDGE_FALSE_VALUE; + + /* We can either have a pure conditional jump with one fallthru edge or + two-way jump that needs to be decomposed into two basic blocks. */ + if (TREE_CODE (then_exp) == GOTO_EXPR && IS_EMPTY_STMT (else_exp)) + { + jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp))); + add_reg_br_prob_note (last, true_edge->probability); + maybe_dump_rtl_for_tree_stmt (stmt, last); + if (EXPR_LOCUS (then_exp)) + emit_line_note (*(EXPR_LOCUS (then_exp))); + return NULL; + } + if (TREE_CODE (else_exp) == GOTO_EXPR && IS_EMPTY_STMT (then_exp)) + { + jumpifnot (pred, label_rtx (GOTO_DESTINATION (else_exp))); + add_reg_br_prob_note (last, false_edge->probability); + maybe_dump_rtl_for_tree_stmt (stmt, last); + if (EXPR_LOCUS (else_exp)) + emit_line_note (*(EXPR_LOCUS (else_exp))); + return NULL; + } + gcc_assert (TREE_CODE (then_exp) == GOTO_EXPR + && TREE_CODE (else_exp) == GOTO_EXPR); + + jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp))); + add_reg_br_prob_note (last, true_edge->probability); + last = get_last_insn (); + expand_expr (else_exp, const0_rtx, VOIDmode, 0); + + BB_END (bb) = last; + if (BARRIER_P (BB_END (bb))) + BB_END (bb) = PREV_INSN (BB_END (bb)); + update_bb_for_insn (bb); + + new_bb = create_basic_block (NEXT_INSN (last), get_last_insn (), bb); + dest = false_edge->dest; + redirect_edge_succ (false_edge, new_bb); + false_edge->flags |= EDGE_FALLTHRU; + new_bb->count = false_edge->count; + new_bb->frequency = EDGE_FREQUENCY (false_edge); + new_edge = make_edge (new_bb, dest, 0); + new_edge->probability = REG_BR_PROB_BASE; + new_edge->count = new_bb->count; + if (BARRIER_P (BB_END (new_bb))) + BB_END (new_bb) = PREV_INSN (BB_END (new_bb)); + update_bb_for_insn (new_bb); + + maybe_dump_rtl_for_tree_stmt (stmt, last2); + + if (EXPR_LOCUS (else_exp)) + emit_line_note (*(EXPR_LOCUS (else_exp))); + + return new_bb; +} + +/* A subroutine of expand_gimple_basic_block. Expand one CALL_EXPR + that has CALL_EXPR_TAILCALL set. Returns non-null if we actually + generated a tail call (something that might be denied by the ABI + rules governing the call; see calls.c). + + Sets CAN_FALLTHRU if we generated a *conditional* tail call, and + can still reach the rest of BB. The case here is __builtin_sqrt, + where the NaN result goes through the external function (with a + tailcall) and the normal result happens via a sqrt instruction. */ + +static basic_block +expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru) +{ + rtx last2, last; + edge e; + edge_iterator ei; + int probability; + gcov_type count; + + last2 = last = get_last_insn (); + + expand_expr_stmt (stmt); + + for (last = NEXT_INSN (last); last; last = NEXT_INSN (last)) + if (CALL_P (last) && SIBLING_CALL_P (last)) + goto found; + + maybe_dump_rtl_for_tree_stmt (stmt, last2); + + *can_fallthru = true; + return NULL; + + found: + /* ??? Wouldn't it be better to just reset any pending stack adjust? + Any instructions emitted here are about to be deleted. */ + do_pending_stack_adjust (); + + /* Remove any non-eh, non-abnormal edges that don't go to exit. */ + /* ??? I.e. the fallthrough edge. HOWEVER! If there were to be + EH or abnormal edges, we shouldn't have created a tail call in + the first place. So it seems to me we should just be removing + all edges here, or redirecting the existing fallthru edge to + the exit block. */ + + probability = 0; + count = 0; + + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) + { + if (!(e->flags & (EDGE_ABNORMAL | EDGE_EH))) + { + if (e->dest != EXIT_BLOCK_PTR) + { + e->dest->count -= e->count; + e->dest->frequency -= EDGE_FREQUENCY (e); + if (e->dest->count < 0) + e->dest->count = 0; + if (e->dest->frequency < 0) + e->dest->frequency = 0; + } + count += e->count; + probability += e->probability; + remove_edge (e); + } + else + ei_next (&ei); + } + + /* This is somewhat ugly: the call_expr expander often emits instructions + after the sibcall (to perform the function return). These confuse the + find_many_sub_basic_blocks code, so we need to get rid of these. */ + last = NEXT_INSN (last); + gcc_assert (BARRIER_P (last)); + + *can_fallthru = false; + while (NEXT_INSN (last)) + { + /* For instance an sqrt builtin expander expands if with + sibcall in the then and label for `else`. */ + if (LABEL_P (NEXT_INSN (last))) + { + *can_fallthru = true; + break; + } + delete_insn (NEXT_INSN (last)); + } + + e = make_edge (bb, EXIT_BLOCK_PTR, EDGE_ABNORMAL | EDGE_SIBCALL); + e->probability += probability; + e->count += count; + BB_END (bb) = last; + update_bb_for_insn (bb); + + if (NEXT_INSN (last)) + { + bb = create_basic_block (NEXT_INSN (last), get_last_insn (), bb); + + last = BB_END (bb); + if (BARRIER_P (last)) + BB_END (bb) = PREV_INSN (last); + } + + maybe_dump_rtl_for_tree_stmt (stmt, last2); + + return bb; +} + +/* Expand basic block BB from GIMPLE trees to RTL. */ + +static basic_block +expand_gimple_basic_block (basic_block bb) +{ + block_stmt_iterator bsi = bsi_start (bb); + tree stmt = NULL; + rtx note, last; + edge e; + edge_iterator ei; + + if (dump_file) + { + fprintf (dump_file, + "\n;; Generating RTL for tree basic block %d\n", + bb->index); + } + + init_rtl_bb_info (bb); + bb->flags |= BB_RTL; + + if (!bsi_end_p (bsi)) + stmt = bsi_stmt (bsi); + + if (stmt && TREE_CODE (stmt) == LABEL_EXPR) + { + last = get_last_insn (); + + expand_expr_stmt (stmt); + + /* Java emits line number notes in the top of labels. + ??? Make this go away once line number notes are obsoleted. */ + BB_HEAD (bb) = NEXT_INSN (last); + if (NOTE_P (BB_HEAD (bb))) + BB_HEAD (bb) = NEXT_INSN (BB_HEAD (bb)); + bsi_next (&bsi); + note = emit_note_after (NOTE_INSN_BASIC_BLOCK, BB_HEAD (bb)); + + maybe_dump_rtl_for_tree_stmt (stmt, last); + } + else + note = BB_HEAD (bb) = emit_note (NOTE_INSN_BASIC_BLOCK); + + NOTE_BASIC_BLOCK (note) = bb; + + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) + { + /* Clear EDGE_EXECUTABLE. This flag is never used in the backend. */ + e->flags &= ~EDGE_EXECUTABLE; + + /* At the moment not all abnormal edges match the RTL representation. + It is safe to remove them here as find_many_sub_basic_blocks will + rediscover them. In the future we should get this fixed properly. */ + if (e->flags & EDGE_ABNORMAL) + remove_edge (e); + else + ei_next (&ei); + } + + for (; !bsi_end_p (bsi); bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + basic_block new_bb; + + if (!stmt) + continue; + + /* Expand this statement, then evaluate the resulting RTL and + fixup the CFG accordingly. */ + if (TREE_CODE (stmt) == COND_EXPR) + { + new_bb = expand_gimple_cond_expr (bb, stmt); + if (new_bb) + return new_bb; + } + else + { + tree call = get_call_expr_in (stmt); + if (call && CALL_EXPR_TAILCALL (call)) + { + bool can_fallthru; + new_bb = expand_gimple_tailcall (bb, stmt, &can_fallthru); + if (new_bb) + { + if (can_fallthru) + bb = new_bb; + else + return new_bb; + } + } + else + { + last = get_last_insn (); + expand_expr_stmt (stmt); + maybe_dump_rtl_for_tree_stmt (stmt, last); + } + } + } + + do_pending_stack_adjust (); + + /* Find the block tail. The last insn in the block is the insn + before a barrier and/or table jump insn. */ + last = get_last_insn (); + if (BARRIER_P (last)) + last = PREV_INSN (last); + if (JUMP_TABLE_DATA_P (last)) + last = PREV_INSN (PREV_INSN (last)); + BB_END (bb) = last; + + update_bb_for_insn (bb); + + return bb; +} + + +/* Create a basic block for initialization code. */ + +static basic_block +construct_init_block (void) +{ + basic_block init_block, first_block; + edge e = NULL; + int flags; + + /* Multiple entry points not supported yet. */ + gcc_assert (EDGE_COUNT (ENTRY_BLOCK_PTR->succs) == 1); + init_rtl_bb_info (ENTRY_BLOCK_PTR); + init_rtl_bb_info (EXIT_BLOCK_PTR); + ENTRY_BLOCK_PTR->flags |= BB_RTL; + EXIT_BLOCK_PTR->flags |= BB_RTL; + + e = EDGE_SUCC (ENTRY_BLOCK_PTR, 0); + + /* When entry edge points to first basic block, we don't need jump, + otherwise we have to jump into proper target. */ + if (e && e->dest != ENTRY_BLOCK_PTR->next_bb) + { + tree label = tree_block_label (e->dest); + + emit_jump (label_rtx (label)); + flags = 0; + } + else + flags = EDGE_FALLTHRU; + + init_block = create_basic_block (NEXT_INSN (get_insns ()), + get_last_insn (), + ENTRY_BLOCK_PTR); + init_block->frequency = ENTRY_BLOCK_PTR->frequency; + init_block->count = ENTRY_BLOCK_PTR->count; + if (e) + { + first_block = e->dest; + redirect_edge_succ (e, init_block); + e = make_edge (init_block, first_block, flags); + } + else + e = make_edge (init_block, EXIT_BLOCK_PTR, EDGE_FALLTHRU); + e->probability = REG_BR_PROB_BASE; + e->count = ENTRY_BLOCK_PTR->count; + + update_bb_for_insn (init_block); + return init_block; +} + + +/* Create a block containing landing pads and similar stuff. */ + +static void +construct_exit_block (void) +{ + rtx head = get_last_insn (); + rtx end; + basic_block exit_block; + edge e, e2; + unsigned ix; + edge_iterator ei; + + /* Make sure the locus is set to the end of the function, so that + epilogue line numbers and warnings are set properly. */ +#ifdef USE_MAPPED_LOCATION + if (cfun->function_end_locus != UNKNOWN_LOCATION) +#else + if (cfun->function_end_locus.file) +#endif + input_location = cfun->function_end_locus; + + /* The following insns belong to the top scope. */ + record_block_change (DECL_INITIAL (current_function_decl)); + + /* Generate rtl for function exit. */ + expand_function_end (); + + end = get_last_insn (); + if (head == end) + return; + while (NEXT_INSN (head) && NOTE_P (NEXT_INSN (head))) + head = NEXT_INSN (head); + exit_block = create_basic_block (NEXT_INSN (head), end, + EXIT_BLOCK_PTR->prev_bb); + exit_block->frequency = EXIT_BLOCK_PTR->frequency; + exit_block->count = EXIT_BLOCK_PTR->count; + + ix = 0; + while (ix < EDGE_COUNT (EXIT_BLOCK_PTR->preds)) + { + e = EDGE_PRED (EXIT_BLOCK_PTR, ix); + if (!(e->flags & EDGE_ABNORMAL)) + redirect_edge_succ (e, exit_block); + else + ix++; + } + + e = make_edge (exit_block, EXIT_BLOCK_PTR, EDGE_FALLTHRU); + e->probability = REG_BR_PROB_BASE; + e->count = EXIT_BLOCK_PTR->count; + FOR_EACH_EDGE (e2, ei, EXIT_BLOCK_PTR->preds) + if (e2 != e) + { + e->count -= e2->count; + exit_block->count -= e2->count; + exit_block->frequency -= EDGE_FREQUENCY (e2); + } + if (e->count < 0) + e->count = 0; + if (exit_block->count < 0) + exit_block->count = 0; + if (exit_block->frequency < 0) + exit_block->frequency = 0; + update_bb_for_insn (exit_block); +} + +/* Helper function for discover_nonconstant_array_refs. + Look for ARRAY_REF nodes with non-constant indexes and mark them + addressable. */ + +static tree +discover_nonconstant_array_refs_r (tree * tp, int *walk_subtrees, + void *data ATTRIBUTE_UNUSED) +{ + tree t = *tp; + + if (IS_TYPE_OR_DECL_P (t)) + *walk_subtrees = 0; + else if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) + { + while (((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) + && is_gimple_min_invariant (TREE_OPERAND (t, 1)) + && (!TREE_OPERAND (t, 2) + || is_gimple_min_invariant (TREE_OPERAND (t, 2)))) + || (TREE_CODE (t) == COMPONENT_REF + && (!TREE_OPERAND (t,2) + || is_gimple_min_invariant (TREE_OPERAND (t, 2)))) + || TREE_CODE (t) == BIT_FIELD_REF + || TREE_CODE (t) == REALPART_EXPR + || TREE_CODE (t) == IMAGPART_EXPR + || TREE_CODE (t) == VIEW_CONVERT_EXPR + || TREE_CODE (t) == NOP_EXPR + || TREE_CODE (t) == CONVERT_EXPR) + t = TREE_OPERAND (t, 0); + + if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) + { + t = get_base_address (t); + if (t && DECL_P (t)) + TREE_ADDRESSABLE (t) = 1; + } + + *walk_subtrees = 0; + } + + return NULL_TREE; +} + +/* RTL expansion is not able to compile array references with variable + offsets for arrays stored in single register. Discover such + expressions and mark variables as addressable to avoid this + scenario. */ + +static void +discover_nonconstant_array_refs (void) +{ + basic_block bb; + block_stmt_iterator bsi; + + FOR_EACH_BB (bb) + { + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + walk_tree (bsi_stmt_ptr (bsi), discover_nonconstant_array_refs_r, + NULL , NULL); + } +} + +/* Translate the intermediate representation contained in the CFG + from GIMPLE trees to RTL. + + We do conversion per basic block and preserve/update the tree CFG. + This implies we have to do some magic as the CFG can simultaneously + consist of basic blocks containing RTL and GIMPLE trees. This can + confuse the CFG hooks, so be careful to not manipulate CFG during + the expansion. */ + +static unsigned int +tree_expand_cfg (void) +{ + basic_block bb, init_block; + sbitmap blocks; + edge_iterator ei; + edge e; + + /* Some backends want to know that we are expanding to RTL. */ + currently_expanding_to_rtl = 1; + + /* Prepare the rtl middle end to start recording block changes. */ + reset_block_changes (); + + /* Mark arrays indexed with non-constant indices with TREE_ADDRESSABLE. */ + discover_nonconstant_array_refs (); + + /* Expand the variables recorded during gimple lowering. */ + expand_used_vars (); + + /* Honor stack protection warnings. */ + if (warn_stack_protect) + { + if (current_function_calls_alloca) + warning (0, "not protecting local variables: variable length buffer"); + if (has_short_buffer && !cfun->stack_protect_guard) + warning (0, "not protecting function: no buffer at least %d bytes long", + (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE)); + } + + /* Set up parameters and prepare for return, for the function. */ + expand_function_start (current_function_decl); + + /* If this function is `main', emit a call to `__main' + to run global initializers, etc. */ + if (DECL_NAME (current_function_decl) + && MAIN_NAME_P (DECL_NAME (current_function_decl)) + && DECL_FILE_SCOPE_P (current_function_decl)) + expand_main_function (); + + /* Initialize the stack_protect_guard field. This must happen after the + call to __main (if any) so that the external decl is initialized. */ + if (cfun->stack_protect_guard) + stack_protect_prologue (); + + /* Register rtl specific functions for cfg. */ + rtl_register_cfg_hooks (); + + init_block = construct_init_block (); + + /* Clear EDGE_EXECUTABLE on the entry edge(s). It is cleaned from the + remaining edges in expand_gimple_basic_block. */ + FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) + e->flags &= ~EDGE_EXECUTABLE; + + FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb) + bb = expand_gimple_basic_block (bb); + + construct_exit_block (); + + /* We're done expanding trees to RTL. */ + currently_expanding_to_rtl = 0; + + /* Convert tree EH labels to RTL EH labels, and clean out any unreachable + EH regions. */ + convert_from_eh_region_ranges (); + + rebuild_jump_labels (get_insns ()); + find_exception_handler_labels (); + + blocks = sbitmap_alloc (last_basic_block); + sbitmap_ones (blocks); + find_many_sub_basic_blocks (blocks); + purge_all_dead_edges (); + sbitmap_free (blocks); + + compact_blocks (); +#ifdef ENABLE_CHECKING + verify_flow_info(); +#endif + + /* There's no need to defer outputting this function any more; we + know we want to output it. */ + DECL_DEFER_OUTPUT (current_function_decl) = 0; + + /* Now that we're done expanding trees to RTL, we shouldn't have any + more CONCATs anywhere. */ + generating_concat_p = 0; + + finalize_block_changes (); + + if (dump_file) + { + fprintf (dump_file, + "\n\n;;\n;; Full RTL generated for this function:\n;;\n"); + /* And the pass manager will dump RTL for us. */ + } + + /* If we're emitting a nested function, make sure its parent gets + emitted as well. Doing otherwise confuses debug info. */ + { + tree parent; + for (parent = DECL_CONTEXT (current_function_decl); + parent != NULL_TREE; + parent = get_containing_scope (parent)) + if (TREE_CODE (parent) == FUNCTION_DECL) + TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (parent)) = 1; + } + + /* We are now committed to emitting code for this function. Do any + preparation, such as emitting abstract debug info for the inline + before it gets mangled by optimization. */ + if (cgraph_function_possibly_inlined_p (current_function_decl)) + (*debug_hooks->outlining_inline_function) (current_function_decl); + + TREE_ASM_WRITTEN (current_function_decl) = 1; + + /* After expanding, the return labels are no longer needed. */ + return_label = NULL; + naked_return_label = NULL; + return 0; +} + +struct tree_opt_pass pass_expand = +{ + "expand", /* name */ + NULL, /* gate */ + tree_expand_cfg, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_EXPAND, /* tv_id */ + /* ??? If TER is enabled, we actually receive GENERIC. */ + PROP_gimple_leh | PROP_cfg, /* properties_required */ + PROP_rtl, /* properties_provided */ + PROP_trees, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 'r' /* letter */ +}; diff --git a/contrib/gcc/cfghooks.c b/contrib/gcc/cfghooks.c index 525289c04f8..a4cc31c8b61 100644 --- a/contrib/gcc/cfghooks.c +++ b/contrib/gcc/cfghooks.c @@ -1,5 +1,5 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -26,12 +26,12 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "rtl.h" #include "basic-block.h" - -extern struct cfg_hooks rtl_cfg_hooks; -extern struct cfg_hooks cfg_layout_rtl_cfg_hooks; +#include "tree-flow.h" +#include "timevar.h" +#include "toplev.h" /* A pointer to one of the hooks containers. */ -struct cfg_hooks *cfg_hooks; +static struct cfg_hooks *cfg_hooks; /* Initialization of functions specific to the rtl IR. */ void @@ -46,3 +46,845 @@ cfg_layout_rtl_register_cfg_hooks (void) { cfg_hooks = &cfg_layout_rtl_cfg_hooks; } + +/* Initialization of functions specific to the tree IR. */ + +void +tree_register_cfg_hooks (void) +{ + cfg_hooks = &tree_cfg_hooks; +} + +/* Returns current ir type (rtl = 0, trees = 1). */ + +int +ir_type (void) +{ + return cfg_hooks == &tree_cfg_hooks ? 1 : 0; +} + +/* Verify the CFG consistency. + + Currently it does following: checks edge and basic block list correctness + and calls into IL dependent checking then. */ + +void +verify_flow_info (void) +{ + size_t *edge_checksum; + int err = 0; + basic_block bb, last_bb_seen; + basic_block *last_visited; + + timevar_push (TV_CFG_VERIFY); + last_visited = XCNEWVEC (basic_block, last_basic_block); + edge_checksum = XCNEWVEC (size_t, last_basic_block); + + /* Check bb chain & numbers. */ + last_bb_seen = ENTRY_BLOCK_PTR; + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb) + { + if (bb != EXIT_BLOCK_PTR + && bb != BASIC_BLOCK (bb->index)) + { + error ("bb %d on wrong place", bb->index); + err = 1; + } + + if (bb->prev_bb != last_bb_seen) + { + error ("prev_bb of %d should be %d, not %d", + bb->index, last_bb_seen->index, bb->prev_bb->index); + err = 1; + } + + last_bb_seen = bb; + } + + /* Now check the basic blocks (boundaries etc.) */ + FOR_EACH_BB_REVERSE (bb) + { + int n_fallthru = 0; + edge e; + edge_iterator ei; + + if (bb->count < 0) + { + error ("verify_flow_info: Wrong count of block %i %i", + bb->index, (int)bb->count); + err = 1; + } + if (bb->frequency < 0) + { + error ("verify_flow_info: Wrong frequency of block %i %i", + bb->index, bb->frequency); + err = 1; + } + FOR_EACH_EDGE (e, ei, bb->succs) + { + if (last_visited [e->dest->index] == bb) + { + error ("verify_flow_info: Duplicate edge %i->%i", + e->src->index, e->dest->index); + err = 1; + } + if (e->probability < 0 || e->probability > REG_BR_PROB_BASE) + { + error ("verify_flow_info: Wrong probability of edge %i->%i %i", + e->src->index, e->dest->index, e->probability); + err = 1; + } + if (e->count < 0) + { + error ("verify_flow_info: Wrong count of edge %i->%i %i", + e->src->index, e->dest->index, (int)e->count); + err = 1; + } + + last_visited [e->dest->index] = bb; + + if (e->flags & EDGE_FALLTHRU) + n_fallthru++; + + if (e->src != bb) + { + error ("verify_flow_info: Basic block %d succ edge is corrupted", + bb->index); + fprintf (stderr, "Predecessor: "); + dump_edge_info (stderr, e, 0); + fprintf (stderr, "\nSuccessor: "); + dump_edge_info (stderr, e, 1); + fprintf (stderr, "\n"); + err = 1; + } + + edge_checksum[e->dest->index] += (size_t) e; + } + if (n_fallthru > 1) + { + error ("wrong amount of branch edges after unconditional jump %i", bb->index); + err = 1; + } + + FOR_EACH_EDGE (e, ei, bb->preds) + { + if (e->dest != bb) + { + error ("basic block %d pred edge is corrupted", bb->index); + fputs ("Predecessor: ", stderr); + dump_edge_info (stderr, e, 0); + fputs ("\nSuccessor: ", stderr); + dump_edge_info (stderr, e, 1); + fputc ('\n', stderr); + err = 1; + } + + if (ei.index != e->dest_idx) + { + error ("basic block %d pred edge is corrupted", bb->index); + error ("its dest_idx should be %d, not %d", + ei.index, e->dest_idx); + fputs ("Predecessor: ", stderr); + dump_edge_info (stderr, e, 0); + fputs ("\nSuccessor: ", stderr); + dump_edge_info (stderr, e, 1); + fputc ('\n', stderr); + err = 1; + } + + edge_checksum[e->dest->index] -= (size_t) e; + } + } + + /* Complete edge checksumming for ENTRY and EXIT. */ + { + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) + edge_checksum[e->dest->index] += (size_t) e; + + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + edge_checksum[e->dest->index] -= (size_t) e; + } + + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) + if (edge_checksum[bb->index]) + { + error ("basic block %i edge lists are corrupted", bb->index); + err = 1; + } + + last_bb_seen = ENTRY_BLOCK_PTR; + + /* Clean up. */ + free (last_visited); + free (edge_checksum); + + if (cfg_hooks->verify_flow_info) + err |= cfg_hooks->verify_flow_info (); + if (err) + internal_error ("verify_flow_info failed"); + timevar_pop (TV_CFG_VERIFY); +} + +/* Print out one basic block. This function takes care of the purely + graph related information. The cfg hook for the active representation + should dump representation-specific information. */ + +void +dump_bb (basic_block bb, FILE *outf, int indent) +{ + edge e; + edge_iterator ei; + char *s_indent; + + s_indent = alloca ((size_t) indent + 1); + memset (s_indent, ' ', (size_t) indent); + s_indent[indent] = '\0'; + + fprintf (outf, ";;%s basic block %d, loop depth %d, count ", + s_indent, bb->index, bb->loop_depth); + fprintf (outf, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) bb->count); + putc ('\n', outf); + + fprintf (outf, ";;%s prev block ", s_indent); + if (bb->prev_bb) + fprintf (outf, "%d, ", bb->prev_bb->index); + else + fprintf (outf, "(nil), "); + fprintf (outf, "next block "); + if (bb->next_bb) + fprintf (outf, "%d", bb->next_bb->index); + else + fprintf (outf, "(nil)"); + putc ('\n', outf); + + fprintf (outf, ";;%s pred: ", s_indent); + FOR_EACH_EDGE (e, ei, bb->preds) + dump_edge_info (outf, e, 0); + putc ('\n', outf); + + fprintf (outf, ";;%s succ: ", s_indent); + FOR_EACH_EDGE (e, ei, bb->succs) + dump_edge_info (outf, e, 1); + putc ('\n', outf); + + if (cfg_hooks->dump_bb) + cfg_hooks->dump_bb (bb, outf, indent); +} + +/* Redirect edge E to the given basic block DEST and update underlying program + representation. Returns edge representing redirected branch (that may not + be equivalent to E in the case of duplicate edges being removed) or NULL + if edge is not easily redirectable for whatever reason. */ + +edge +redirect_edge_and_branch (edge e, basic_block dest) +{ + edge ret; + + if (!cfg_hooks->redirect_edge_and_branch) + internal_error ("%s does not support redirect_edge_and_branch", + cfg_hooks->name); + + ret = cfg_hooks->redirect_edge_and_branch (e, dest); + + return ret; +} + +/* Redirect the edge E to basic block DEST even if it requires creating + of a new basic block; then it returns the newly created basic block. + Aborts when redirection is impossible. */ + +basic_block +redirect_edge_and_branch_force (edge e, basic_block dest) +{ + basic_block ret; + + if (!cfg_hooks->redirect_edge_and_branch_force) + internal_error ("%s does not support redirect_edge_and_branch_force", + cfg_hooks->name); + + ret = cfg_hooks->redirect_edge_and_branch_force (e, dest); + + return ret; +} + +/* Splits basic block BB after the specified instruction I (but at least after + the labels). If I is NULL, splits just after labels. The newly created edge + is returned. The new basic block is created just after the old one. */ + +edge +split_block (basic_block bb, void *i) +{ + basic_block new_bb; + + if (!cfg_hooks->split_block) + internal_error ("%s does not support split_block", cfg_hooks->name); + + new_bb = cfg_hooks->split_block (bb, i); + if (!new_bb) + return NULL; + + new_bb->count = bb->count; + new_bb->frequency = bb->frequency; + new_bb->loop_depth = bb->loop_depth; + + if (dom_info_available_p (CDI_DOMINATORS)) + { + redirect_immediate_dominators (CDI_DOMINATORS, bb, new_bb); + set_immediate_dominator (CDI_DOMINATORS, new_bb, bb); + } + + return make_single_succ_edge (bb, new_bb, EDGE_FALLTHRU); +} + +/* Splits block BB just after labels. The newly created edge is returned. */ + +edge +split_block_after_labels (basic_block bb) +{ + return split_block (bb, NULL); +} + +/* Moves block BB immediately after block AFTER. Returns false if the + movement was impossible. */ + +bool +move_block_after (basic_block bb, basic_block after) +{ + bool ret; + + if (!cfg_hooks->move_block_after) + internal_error ("%s does not support move_block_after", cfg_hooks->name); + + ret = cfg_hooks->move_block_after (bb, after); + + return ret; +} + +/* Deletes the basic block BB. */ + +void +delete_basic_block (basic_block bb) +{ + if (!cfg_hooks->delete_basic_block) + internal_error ("%s does not support delete_basic_block", cfg_hooks->name); + + cfg_hooks->delete_basic_block (bb); + + /* Remove the edges into and out of this block. Note that there may + indeed be edges in, if we are removing an unreachable loop. */ + while (EDGE_COUNT (bb->preds) != 0) + remove_edge (EDGE_PRED (bb, 0)); + while (EDGE_COUNT (bb->succs) != 0) + remove_edge (EDGE_SUCC (bb, 0)); + + if (dom_computed[CDI_DOMINATORS]) + delete_from_dominance_info (CDI_DOMINATORS, bb); + if (dom_computed[CDI_POST_DOMINATORS]) + delete_from_dominance_info (CDI_POST_DOMINATORS, bb); + + /* Remove the basic block from the array. */ + expunge_block (bb); +} + +/* Splits edge E and returns the newly created basic block. */ + +basic_block +split_edge (edge e) +{ + basic_block ret; + gcov_type count = e->count; + int freq = EDGE_FREQUENCY (e); + edge f; + bool irr = (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0; + + if (!cfg_hooks->split_edge) + internal_error ("%s does not support split_edge", cfg_hooks->name); + + ret = cfg_hooks->split_edge (e); + ret->count = count; + ret->frequency = freq; + single_succ_edge (ret)->probability = REG_BR_PROB_BASE; + single_succ_edge (ret)->count = count; + + if (irr) + { + ret->flags |= BB_IRREDUCIBLE_LOOP; + single_pred_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP; + single_succ_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP; + } + + if (dom_computed[CDI_DOMINATORS]) + set_immediate_dominator (CDI_DOMINATORS, ret, single_pred (ret)); + + if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY) + { + /* There are two cases: + + If the immediate dominator of e->dest is not e->src, it + remains unchanged. + + If immediate dominator of e->dest is e->src, it may become + ret, provided that all other predecessors of e->dest are + dominated by e->dest. */ + + if (get_immediate_dominator (CDI_DOMINATORS, single_succ (ret)) + == single_pred (ret)) + { + edge_iterator ei; + FOR_EACH_EDGE (f, ei, single_succ (ret)->preds) + { + if (f == single_succ_edge (ret)) + continue; + + if (!dominated_by_p (CDI_DOMINATORS, f->src, + single_succ (ret))) + break; + } + + if (!f) + set_immediate_dominator (CDI_DOMINATORS, single_succ (ret), ret); + } + }; + + return ret; +} + +/* Creates a new basic block just after the basic block AFTER. + HEAD and END are the first and the last statement belonging + to the block. If both are NULL, an empty block is created. */ + +basic_block +create_basic_block (void *head, void *end, basic_block after) +{ + basic_block ret; + + if (!cfg_hooks->create_basic_block) + internal_error ("%s does not support create_basic_block", cfg_hooks->name); + + ret = cfg_hooks->create_basic_block (head, end, after); + + if (dom_computed[CDI_DOMINATORS]) + add_to_dominance_info (CDI_DOMINATORS, ret); + if (dom_computed[CDI_POST_DOMINATORS]) + add_to_dominance_info (CDI_POST_DOMINATORS, ret); + + return ret; +} + +/* Creates an empty basic block just after basic block AFTER. */ + +basic_block +create_empty_bb (basic_block after) +{ + return create_basic_block (NULL, NULL, after); +} + +/* Checks whether we may merge blocks BB1 and BB2. */ + +bool +can_merge_blocks_p (basic_block bb1, basic_block bb2) +{ + bool ret; + + if (!cfg_hooks->can_merge_blocks_p) + internal_error ("%s does not support can_merge_blocks_p", cfg_hooks->name); + + ret = cfg_hooks->can_merge_blocks_p (bb1, bb2); + + return ret; +} + +void +predict_edge (edge e, enum br_predictor predictor, int probability) +{ + if (!cfg_hooks->predict_edge) + internal_error ("%s does not support predict_edge", cfg_hooks->name); + + cfg_hooks->predict_edge (e, predictor, probability); +} + +bool +predicted_by_p (basic_block bb, enum br_predictor predictor) +{ + if (!cfg_hooks->predict_edge) + internal_error ("%s does not support predicted_by_p", cfg_hooks->name); + + return cfg_hooks->predicted_by_p (bb, predictor); +} + +/* Merges basic block B into basic block A. */ + +void +merge_blocks (basic_block a, basic_block b) +{ + edge e; + edge_iterator ei; + + if (!cfg_hooks->merge_blocks) + internal_error ("%s does not support merge_blocks", cfg_hooks->name); + + cfg_hooks->merge_blocks (a, b); + + /* Normally there should only be one successor of A and that is B, but + partway though the merge of blocks for conditional_execution we'll + be merging a TEST block with THEN and ELSE successors. Free the + whole lot of them and hope the caller knows what they're doing. */ + + while (EDGE_COUNT (a->succs) != 0) + remove_edge (EDGE_SUCC (a, 0)); + + /* Adjust the edges out of B for the new owner. */ + FOR_EACH_EDGE (e, ei, b->succs) + e->src = a; + a->succs = b->succs; + a->flags |= b->flags; + + /* B hasn't quite yet ceased to exist. Attempt to prevent mishap. */ + b->preds = b->succs = NULL; + + if (dom_computed[CDI_DOMINATORS]) + redirect_immediate_dominators (CDI_DOMINATORS, b, a); + + if (dom_computed[CDI_DOMINATORS]) + delete_from_dominance_info (CDI_DOMINATORS, b); + if (dom_computed[CDI_POST_DOMINATORS]) + delete_from_dominance_info (CDI_POST_DOMINATORS, b); + + expunge_block (b); +} + +/* Split BB into entry part and the rest (the rest is the newly created block). + Redirect those edges for that REDIRECT_EDGE_P returns true to the entry + part. Returns the edge connecting the entry part to the rest. */ + +edge +make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge), + void (*new_bb_cbk) (basic_block)) +{ + edge e, fallthru; + edge_iterator ei; + basic_block dummy, jump; + + if (!cfg_hooks->make_forwarder_block) + internal_error ("%s does not support make_forwarder_block", + cfg_hooks->name); + + fallthru = split_block_after_labels (bb); + dummy = fallthru->src; + bb = fallthru->dest; + + /* Redirect back edges we want to keep. */ + for (ei = ei_start (dummy->preds); (e = ei_safe_edge (ei)); ) + { + if (redirect_edge_p (e)) + { + ei_next (&ei); + continue; + } + + dummy->frequency -= EDGE_FREQUENCY (e); + dummy->count -= e->count; + if (dummy->frequency < 0) + dummy->frequency = 0; + if (dummy->count < 0) + dummy->count = 0; + fallthru->count -= e->count; + if (fallthru->count < 0) + fallthru->count = 0; + + jump = redirect_edge_and_branch_force (e, bb); + if (jump) + new_bb_cbk (jump); + } + + if (dom_info_available_p (CDI_DOMINATORS)) + { + basic_block doms_to_fix[2]; + + doms_to_fix[0] = dummy; + doms_to_fix[1] = bb; + iterate_fix_dominators (CDI_DOMINATORS, doms_to_fix, 2); + } + + cfg_hooks->make_forwarder_block (fallthru); + + return fallthru; +} + +void +tidy_fallthru_edge (edge e) +{ + if (cfg_hooks->tidy_fallthru_edge) + cfg_hooks->tidy_fallthru_edge (e); +} + +/* Fix up edges that now fall through, or rather should now fall through + but previously required a jump around now deleted blocks. Simplify + the search by only examining blocks numerically adjacent, since this + is how find_basic_blocks created them. */ + +void +tidy_fallthru_edges (void) +{ + basic_block b, c; + + if (!cfg_hooks->tidy_fallthru_edge) + return; + + if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR) + return; + + FOR_BB_BETWEEN (b, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, next_bb) + { + edge s; + + c = b->next_bb; + + /* We care about simple conditional or unconditional jumps with + a single successor. + + If we had a conditional branch to the next instruction when + find_basic_blocks was called, then there will only be one + out edge for the block which ended with the conditional + branch (since we do not create duplicate edges). + + Furthermore, the edge will be marked as a fallthru because we + merge the flags for the duplicate edges. So we do not want to + check that the edge is not a FALLTHRU edge. */ + + if (single_succ_p (b)) + { + s = single_succ_edge (b); + if (! (s->flags & EDGE_COMPLEX) + && s->dest == c + && !find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)) + tidy_fallthru_edge (s); + } + } +} + +/* Returns true if we can duplicate basic block BB. */ + +bool +can_duplicate_block_p (basic_block bb) +{ + edge e; + + if (!cfg_hooks->can_duplicate_block_p) + internal_error ("%s does not support can_duplicate_block_p", + cfg_hooks->name); + + if (bb == EXIT_BLOCK_PTR || bb == ENTRY_BLOCK_PTR) + return false; + + /* Duplicating fallthru block to exit would require adding a jump + and splitting the real last BB. */ + e = find_edge (bb, EXIT_BLOCK_PTR); + if (e && (e->flags & EDGE_FALLTHRU)) + return false; + + return cfg_hooks->can_duplicate_block_p (bb); +} + +/* Duplicates basic block BB and redirects edge E to it. Returns the + new basic block. The new basic block is placed after the basic block + AFTER. */ + +basic_block +duplicate_block (basic_block bb, edge e, basic_block after) +{ + edge s, n; + basic_block new_bb; + gcov_type new_count = e ? e->count : 0; + edge_iterator ei; + + if (!cfg_hooks->duplicate_block) + internal_error ("%s does not support duplicate_block", + cfg_hooks->name); + + if (bb->count < new_count) + new_count = bb->count; + +#ifdef ENABLE_CHECKING + gcc_assert (can_duplicate_block_p (bb)); +#endif + + new_bb = cfg_hooks->duplicate_block (bb); + if (after) + move_block_after (new_bb, after); + + new_bb->loop_depth = bb->loop_depth; + new_bb->flags = bb->flags; + FOR_EACH_EDGE (s, ei, bb->succs) + { + /* Since we are creating edges from a new block to successors + of another block (which therefore are known to be disjoint), there + is no need to actually check for duplicated edges. */ + n = unchecked_make_edge (new_bb, s->dest, s->flags); + n->probability = s->probability; + if (e && bb->count) + { + /* Take care for overflows! */ + n->count = s->count * (new_count * 10000 / bb->count) / 10000; + s->count -= n->count; + } + else + n->count = s->count; + n->aux = s->aux; + } + + if (e) + { + new_bb->count = new_count; + bb->count -= new_count; + + new_bb->frequency = EDGE_FREQUENCY (e); + bb->frequency -= EDGE_FREQUENCY (e); + + redirect_edge_and_branch_force (e, new_bb); + + if (bb->count < 0) + bb->count = 0; + if (bb->frequency < 0) + bb->frequency = 0; + } + else + { + new_bb->count = bb->count; + new_bb->frequency = bb->frequency; + } + + set_bb_original (new_bb, bb); + set_bb_copy (bb, new_bb); + + return new_bb; +} + +/* Return 1 if BB ends with a call, possibly followed by some + instructions that must stay with the call, 0 otherwise. */ + +bool +block_ends_with_call_p (basic_block bb) +{ + if (!cfg_hooks->block_ends_with_call_p) + internal_error ("%s does not support block_ends_with_call_p", cfg_hooks->name); + + return (cfg_hooks->block_ends_with_call_p) (bb); +} + +/* Return 1 if BB ends with a conditional branch, 0 otherwise. */ + +bool +block_ends_with_condjump_p (basic_block bb) +{ + if (!cfg_hooks->block_ends_with_condjump_p) + internal_error ("%s does not support block_ends_with_condjump_p", + cfg_hooks->name); + + return (cfg_hooks->block_ends_with_condjump_p) (bb); +} + +/* Add fake edges to the function exit for any non constant and non noreturn + calls, volatile inline assembly in the bitmap of blocks specified by + BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks + that were split. + + The goal is to expose cases in which entering a basic block does not imply + that all subsequent instructions must be executed. */ + +int +flow_call_edges_add (sbitmap blocks) +{ + if (!cfg_hooks->flow_call_edges_add) + internal_error ("%s does not support flow_call_edges_add", + cfg_hooks->name); + + return (cfg_hooks->flow_call_edges_add) (blocks); +} + +/* This function is called immediately after edge E is added to the + edge vector E->dest->preds. */ + +void +execute_on_growing_pred (edge e) +{ + if (cfg_hooks->execute_on_growing_pred) + cfg_hooks->execute_on_growing_pred (e); +} + +/* This function is called immediately before edge E is removed from + the edge vector E->dest->preds. */ + +void +execute_on_shrinking_pred (edge e) +{ + if (cfg_hooks->execute_on_shrinking_pred) + cfg_hooks->execute_on_shrinking_pred (e); +} + +/* This is used inside loop versioning when we want to insert + stmts/insns on the edges, which have a different behavior + in tree's and in RTL, so we made a CFG hook. */ +void +lv_flush_pending_stmts (edge e) +{ + if (cfg_hooks->flush_pending_stmts) + cfg_hooks->flush_pending_stmts (e); +} + +/* Loop versioning uses the duplicate_loop_to_header_edge to create + a new version of the loop basic-blocks, the parameters here are + exactly the same as in duplicate_loop_to_header_edge or + tree_duplicate_loop_to_header_edge; while in tree-ssa there is + additional work to maintain ssa information that's why there is + a need to call the tree_duplicate_loop_to_header_edge rather + than duplicate_loop_to_header_edge when we are in tree mode. */ +bool +cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e, + struct loops *loops, unsigned int ndupl, + sbitmap wont_exit, edge orig, + edge *to_remove, + unsigned int *n_to_remove, int flags) +{ + gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge); + return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e, loops, + ndupl, wont_exit, + orig, to_remove, + n_to_remove, flags); +} + +/* Conditional jumps are represented differently in trees and RTL, + this hook takes a basic block that is known to have a cond jump + at its end and extracts the taken and not taken eges out of it + and store it in E1 and E2 respectively. */ +void +extract_cond_bb_edges (basic_block b, edge *e1, edge *e2) +{ + gcc_assert (cfg_hooks->extract_cond_bb_edges); + cfg_hooks->extract_cond_bb_edges (b, e1, e2); +} + +/* Responsible for updating the ssa info (PHI nodes) on the + new condition basic block that guards the versioned loop. */ +void +lv_adjust_loop_header_phi (basic_block first, basic_block second, + basic_block new, edge e) +{ + if (cfg_hooks->lv_adjust_loop_header_phi) + cfg_hooks->lv_adjust_loop_header_phi (first, second, new, e); +} + +/* Conditions in trees and RTL are different so we need + a different handling when we add the condition to the + versioning code. */ +void +lv_add_condition_to_bb (basic_block first, basic_block second, + basic_block new, void *cond) +{ + gcc_assert (cfg_hooks->lv_add_condition_to_bb); + cfg_hooks->lv_add_condition_to_bb (first, second, new, cond); +} diff --git a/contrib/gcc/cfghooks.h b/contrib/gcc/cfghooks.h index 5ef3b1f5480..fcdc23f4048 100644 --- a/contrib/gcc/cfghooks.h +++ b/contrib/gcc/cfghooks.h @@ -1,5 +1,5 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. @@ -16,18 +16,20 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef GCC_CFGHOOKS_H #define GCC_CFGHOOKS_H struct cfg_hooks { - /* Debugging. Do not use macros to hook these so they can be called from - debugger! */ - int (*cfgh_verify_flow_info) (void); - void (*dump_bb) (basic_block, FILE *); + /* Name of the corresponding ir. */ + const char *name; + + /* Debugging. */ + int (*verify_flow_info) (void); + void (*dump_bb) (basic_block, FILE *, int); /* Basic CFG manipulation. */ @@ -35,20 +37,25 @@ struct cfg_hooks basic_block (*create_basic_block) (void *head, void *end, basic_block after); /* Redirect edge E to the given basic block B and update underlying program - representation. Returns false when edge is not easily redirectable for - whatever reason. */ - bool (*redirect_edge_and_branch) (edge e, basic_block b); + representation. Returns edge representing redirected branch (that may not + be equivalent to E in the case of duplicate edges being removed) or NULL + if edge is not easily redirectable for whatever reason. */ + edge (*redirect_edge_and_branch) (edge e, basic_block b); /* Same as the above but allows redirecting of fallthru edges. In that case - newly created forwarder basic block is returned. It aborts when called - on abnormal edge. */ + newly created forwarder basic block is returned. The edge must + not be abnormal. */ basic_block (*redirect_edge_and_branch_force) (edge, basic_block); - /* Remove given basic block and all edges possibly pointing into it. */ - void (*delete_block) (basic_block); + /* Remove statements corresponding to a given basic block. */ + void (*delete_basic_block) (basic_block); - /* Split basic block B after specified instruction I. */ - edge (*split_block) (basic_block b, void * i); + /* Creates a new basic block just after basic block B by splitting + everything after specified instruction I. */ + basic_block (*split_block) (basic_block b, void * i); + + /* Move block B immediately after block A. */ + bool (*move_block_after) (basic_block b, basic_block a); /* Return true when blocks A and B can be merged into single basic block. */ bool (*can_merge_blocks_p) (basic_block a, basic_block b); @@ -56,28 +63,130 @@ struct cfg_hooks /* Merge blocks A and B. */ void (*merge_blocks) (basic_block a, basic_block b); + /* Predict edge E using PREDICTOR to given PROBABILITY. */ + void (*predict_edge) (edge e, enum br_predictor predictor, int probability); + + /* Return true if the one of outgoing edges is already predicted by + PREDICTOR. */ + bool (*predicted_by_p) (basic_block bb, enum br_predictor predictor); + + /* Return true when block A can be duplicated. */ + bool (*can_duplicate_block_p) (basic_block a); + + /* Duplicate block A. */ + basic_block (*duplicate_block) (basic_block a); + /* Higher level functions representable by primitive operations above if we didn't have some oddities in RTL and Tree representations. */ - basic_block (*cfgh_split_edge) (edge); + basic_block (*split_edge) (edge); + void (*make_forwarder_block) (edge); + + /* Tries to make the edge fallthru. */ + void (*tidy_fallthru_edge) (edge); + + /* Say whether a block ends with a call, possibly followed by some + other code that must stay with the call. */ + bool (*block_ends_with_call_p) (basic_block); + + /* Say whether a block ends with a conditional branch. Switches + and unconditional branches do not qualify. */ + bool (*block_ends_with_condjump_p) (basic_block); + + /* Add fake edges to the function exit for any non constant and non noreturn + calls, volatile inline assembly in the bitmap of blocks specified by + BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks + that were split. + + The goal is to expose cases in which entering a basic block does not imply + that all subsequent instructions must be executed. */ + int (*flow_call_edges_add) (sbitmap); + + /* This function is called immediately after edge E is added to the + edge vector E->dest->preds. */ + void (*execute_on_growing_pred) (edge); + + /* This function is called immediately before edge E is removed from + the edge vector E->dest->preds. */ + void (*execute_on_shrinking_pred) (edge); + + /* A hook for duplicating loop in CFG, currently this is used + in loop versioning. */ + bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e, + struct loops *loops, + unsigned int ndupl, + sbitmap wont_exit, + edge orig, edge *to_remove, + unsigned int *n_to_remove, + int flags); + + /* Add condition to new basic block and update CFG used in loop + versioning. */ + void (*lv_add_condition_to_bb) (basic_block, basic_block, basic_block, + void *); + /* Update the PHI nodes in case of loop versioning. */ + void (*lv_adjust_loop_header_phi) (basic_block, basic_block, + basic_block, edge); + + /* Given a condition BB extract the true/false taken/not taken edges + (depending if we are on tree's or RTL). */ + void (*extract_cond_bb_edges) (basic_block, edge *, edge *); + + + /* Add PHI arguments queued in PENDINT_STMT list on edge E to edge + E->dest (only in tree-ssa loop versioning. */ + void (*flush_pending_stmts) (edge); }; -#define redirect_edge_and_branch(e,b) cfg_hooks->redirect_edge_and_branch (e,b) -#define redirect_edge_and_branch_force(e,b) cfg_hooks->redirect_edge_and_branch_force (e,b) -#define split_block(e,i) cfg_hooks->split_block (e,i) -#define delete_block(b) cfg_hooks->delete_block (b) -#define split_edge(e) cfg_hooks->cfgh_split_edge (e) -#define create_basic_block(h,e,a) cfg_hooks->create_basic_block (h,e,a) -#define can_merge_blocks_p(a,b) cfg_hooks->can_merge_blocks_p (a,b) -#define merge_blocks(a,b) cfg_hooks->merge_blocks (a,b) +extern void verify_flow_info (void); +extern void dump_bb (basic_block, FILE *, int); +extern edge redirect_edge_and_branch (edge, basic_block); +extern basic_block redirect_edge_and_branch_force (edge, basic_block); +extern edge split_block (basic_block, void *); +extern edge split_block_after_labels (basic_block); +extern bool move_block_after (basic_block, basic_block); +extern void delete_basic_block (basic_block); +extern basic_block split_edge (edge); +extern basic_block create_basic_block (void *, void *, basic_block); +extern basic_block create_empty_bb (basic_block); +extern bool can_merge_blocks_p (basic_block, basic_block); +extern void merge_blocks (basic_block, basic_block); +extern edge make_forwarder_block (basic_block, bool (*)(edge), + void (*) (basic_block)); +extern void tidy_fallthru_edge (edge); +extern void tidy_fallthru_edges (void); +extern void predict_edge (edge e, enum br_predictor predictor, int probability); +extern bool predicted_by_p (basic_block bb, enum br_predictor predictor); +extern bool can_duplicate_block_p (basic_block); +extern basic_block duplicate_block (basic_block, edge, basic_block); +extern bool block_ends_with_call_p (basic_block bb); +extern bool block_ends_with_condjump_p (basic_block bb); +extern int flow_call_edges_add (sbitmap); +extern void execute_on_growing_pred (edge); +extern void execute_on_shrinking_pred (edge); +extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge, + struct loops *loops, + unsigned int ndupl, + sbitmap wont_exit, + edge orig, edge *to_remove, + unsigned int *n_to_remove, + int flags); + +extern void lv_flush_pending_stmts (edge); +extern void extract_cond_bb_edges (basic_block, edge *, edge*); +extern void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block, + edge); +extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block, + void *); /* Hooks containers. */ +extern struct cfg_hooks tree_cfg_hooks; extern struct cfg_hooks rtl_cfg_hooks; - -/* A pointer to one of the hooks containers. */ -extern struct cfg_hooks *cfg_hooks; +extern struct cfg_hooks cfg_layout_rtl_cfg_hooks; /* Declarations. */ +extern int ir_type (void); extern void rtl_register_cfg_hooks (void); extern void cfg_layout_rtl_register_cfg_hooks (void); +extern void tree_register_cfg_hooks (void); #endif /* GCC_CFGHOOKS_H */ diff --git a/contrib/gcc/cfglayout.c b/contrib/gcc/cfglayout.c index fa1b82c15d5..cddb0daa5ce 100644 --- a/contrib/gcc/cfglayout.c +++ b/contrib/gcc/cfglayout.c @@ -1,5 +1,5 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -25,22 +25,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree.h" #include "rtl.h" #include "hard-reg-set.h" +#include "obstack.h" #include "basic-block.h" #include "insn-config.h" #include "output.h" #include "function.h" -#include "obstack.h" #include "cfglayout.h" #include "cfgloop.h" #include "target.h" #include "ggc.h" #include "alloc-pool.h" - -/* The contents of the current function definition are allocated - in this obstack, and all are freed at the end of the function. */ -extern struct obstack flow_obstack; - -alloc_pool cfg_layout_pool; +#include "flags.h" +#include "tree-pass.h" +#include "vecprim.h" /* Holds the interesting trailing notes for the function. */ rtx cfg_layout_function_footer, cfg_layout_function_header; @@ -55,8 +52,6 @@ static void change_scope (rtx, tree, tree); void verify_insn_chain (void); static void fixup_fallthru_exit_predecessor (void); -static rtx duplicate_insn_chain (rtx, rtx); -static void break_superblocks (void); static tree insn_scope (rtx); rtx @@ -105,7 +100,6 @@ skip_insns_after_block (basic_block bb) case NOTE: switch (NOTE_LINE_NUMBER (insn)) { - case NOTE_INSN_LOOP_END: case NOTE_INSN_BLOCK_END: last_insn = insn; continue; @@ -121,9 +115,9 @@ skip_insns_after_block (basic_block bb) case CODE_LABEL: if (NEXT_INSN (insn) - && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN + && JUMP_P (NEXT_INSN (insn)) && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC - || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC)) + || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC)) { insn = NEXT_INSN (insn); last_insn = insn; @@ -141,20 +135,19 @@ skip_insns_after_block (basic_block bb) /* It is possible to hit contradictory sequence. For instance: jump_insn - NOTE_INSN_LOOP_BEG + NOTE_INSN_BLOCK_BEG barrier Where barrier belongs to jump_insn, but the note does not. This can be created by removing the basic block originally following - NOTE_INSN_LOOP_BEG. In such case reorder the notes. */ + NOTE_INSN_BLOCK_BEG. In such case reorder the notes. */ for (insn = last_insn; insn != BB_END (bb); insn = prev) { prev = PREV_INSN (insn); - if (GET_CODE (insn) == NOTE) + if (NOTE_P (insn)) switch (NOTE_LINE_NUMBER (insn)) { - case NOTE_INSN_LOOP_END: case NOTE_INSN_BLOCK_END: case NOTE_INSN_DELETED: case NOTE_INSN_DELETED_LABEL: @@ -174,10 +167,10 @@ label_for_bb (basic_block bb) { rtx label = BB_HEAD (bb); - if (GET_CODE (label) != CODE_LABEL) + if (!LABEL_P (label)) { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Emitting label for block %d\n", bb->index); + if (dump_file) + fprintf (dump_file, "Emitting label for block %d\n", bb->index); label = block_label (bb); } @@ -197,12 +190,13 @@ record_effective_endpoints (void) for (insn = get_insns (); insn - && GET_CODE (insn) == NOTE + && NOTE_P (insn) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK; insn = NEXT_INSN (insn)) continue; - if (!insn) - abort (); /* No basic blocks at all? */ + /* No basic blocks at all? */ + gcc_assert (insn); + if (PREV_INSN (insn)) cfg_layout_function_header = unlink_insn_chain (get_insns (), PREV_INSN (insn)); @@ -215,11 +209,11 @@ record_effective_endpoints (void) rtx end; if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb)) - bb->rbi->header = unlink_insn_chain (next_insn, + bb->il.rtl->header = unlink_insn_chain (next_insn, PREV_INSN (BB_HEAD (bb))); end = skip_insns_after_block (bb); if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end) - bb->rbi->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end); + bb->il.rtl->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end); next_insn = NEXT_INSN (BB_END (bb)); } @@ -235,11 +229,11 @@ record_effective_endpoints (void) block_locators_blocks contains the scope block that is used for all insn locator greater than corresponding block_locators_locs value and smaller than the following one. Similarly for the other properties. */ -static GTY(()) varray_type block_locators_locs; -static GTY(()) varray_type block_locators_blocks; -static GTY(()) varray_type line_locators_locs; -static GTY(()) varray_type line_locators_lines; -static GTY(()) varray_type file_locators_locs; +static VEC(int,heap) *block_locators_locs; +static GTY(()) VEC(tree,gc) *block_locators_blocks; +static VEC(int,heap) *line_locators_locs; +static VEC(int,heap) *line_locators_lines; +static VEC(int,heap) *file_locators_locs; static GTY(()) varray_type file_locators_files; int prologue_locator; int epilogue_locator; @@ -248,7 +242,7 @@ int epilogue_locator; represented via INSN_NOTEs. Replace them by representation using INSN_LOCATORs. */ -void +unsigned int insn_locators_initialize (void) { tree block = NULL; @@ -256,85 +250,102 @@ insn_locators_initialize (void) rtx insn, next; int loc = 0; int line_number = 0, last_line_number = 0; - char *file_name = NULL, *last_file_name = NULL; + const char *file_name = NULL, *last_file_name = NULL; prologue_locator = epilogue_locator = 0; - VARRAY_INT_INIT (block_locators_locs, 32, "block_locators_locs"); - VARRAY_TREE_INIT (block_locators_blocks, 32, "block_locators_blocks"); - VARRAY_INT_INIT (line_locators_locs, 32, "line_locators_locs"); - VARRAY_INT_INIT (line_locators_lines, 32, "line_locators_lines"); - VARRAY_INT_INIT (file_locators_locs, 32, "file_locators_locs"); + block_locators_locs = VEC_alloc (int, heap, 32); + block_locators_blocks = VEC_alloc (tree, gc, 32); + line_locators_locs = VEC_alloc (int, heap, 32); + line_locators_lines = VEC_alloc (int, heap, 32); + file_locators_locs = VEC_alloc (int, heap, 32); VARRAY_CHAR_PTR_INIT (file_locators_files, 32, "file_locators_files"); for (insn = get_insns (); insn; insn = next) { + int active = 0; + next = NEXT_INSN (insn); - if ((active_insn_p (insn) - && GET_CODE (PATTERN (insn)) != ADDR_VEC - && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC) - || !NEXT_INSN (insn) + if (NOTE_P (insn)) + { + gcc_assert (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_BEG + && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END); + if (NOTE_LINE_NUMBER (insn) > 0) + { + expanded_location xloc; + NOTE_EXPANDED_LOCATION (xloc, insn); + line_number = xloc.line; + file_name = xloc.file; + } + } + else + active = (active_insn_p (insn) + && GET_CODE (PATTERN (insn)) != ADDR_VEC + && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC); + + check_block_change (insn, &block); + + if (active + || !next || (!prologue_locator && file_name)) { if (last_block != block) { loc++; - VARRAY_PUSH_INT (block_locators_locs, loc); - VARRAY_PUSH_TREE (block_locators_blocks, block); + VEC_safe_push (int, heap, block_locators_locs, loc); + VEC_safe_push (tree, gc, block_locators_blocks, block); last_block = block; } if (last_line_number != line_number) { loc++; - VARRAY_PUSH_INT (line_locators_locs, loc); - VARRAY_PUSH_INT (line_locators_lines, line_number); + VEC_safe_push (int, heap, line_locators_locs, loc); + VEC_safe_push (int, heap, line_locators_lines, line_number); last_line_number = line_number; } if (last_file_name != file_name) { loc++; - VARRAY_PUSH_INT (file_locators_locs, loc); - VARRAY_PUSH_CHAR_PTR (file_locators_files, file_name); + VEC_safe_push (int, heap, file_locators_locs, loc); + VARRAY_PUSH_CHAR_PTR (file_locators_files, (char *) file_name); last_file_name = file_name; } - } - if (!prologue_locator && file_name) - prologue_locator = loc; - if (!NEXT_INSN (insn)) - epilogue_locator = loc; - if (active_insn_p (insn)) - INSN_LOCATOR (insn) = loc; - else if (GET_CODE (insn) == NOTE) - { - switch (NOTE_LINE_NUMBER (insn)) - { - case NOTE_INSN_BLOCK_BEG: - block = NOTE_BLOCK (insn); - delete_insn (insn); - break; - case NOTE_INSN_BLOCK_END: - block = BLOCK_SUPERCONTEXT (block); - if (block && TREE_CODE (block) == FUNCTION_DECL) - block = 0; - delete_insn (insn); - break; - default: - if (NOTE_LINE_NUMBER (insn) > 0) - { - line_number = NOTE_LINE_NUMBER (insn); - file_name = (char *)NOTE_SOURCE_FILE (insn); - } - break; - } + if (!prologue_locator && file_name) + prologue_locator = loc; + if (!next) + epilogue_locator = loc; + if (active) + INSN_LOCATOR (insn) = loc; } } /* Tag the blocks with a depth number so that change_scope can find the common parent easily. */ set_block_levels (DECL_INITIAL (cfun->decl), 0); + + free_block_changes (); + return 0; } +struct tree_opt_pass pass_insn_locators_initialize = +{ + "locators", /* name */ + NULL, /* gate */ + insn_locators_initialize, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func, /* todo_flags_finish */ + 0 /* letter */ +}; + + /* For each lexical block, set BLOCK_NUMBER to the depth at which it is found in the block tree. */ @@ -350,7 +361,7 @@ set_block_levels (tree block, int level) } /* Return sope resulting from combination of S1 and S2. */ -tree +static tree choose_inner_scope (tree s1, tree s2) { if (!s1) @@ -374,8 +385,7 @@ change_scope (rtx orig_insn, tree s1, tree s2) while (ts1 != ts2) { - if (ts1 == NULL || ts2 == NULL) - abort (); + gcc_assert (ts1 && ts2); if (BLOCK_NUMBER (ts1) > BLOCK_NUMBER (ts2)) ts1 = BLOCK_SUPERCONTEXT (ts1); else if (BLOCK_NUMBER (ts1) < BLOCK_NUMBER (ts2)) @@ -411,7 +421,7 @@ change_scope (rtx orig_insn, tree s1, tree s2) static tree insn_scope (rtx insn) { - int max = VARRAY_ACTIVE_SIZE (block_locators_locs); + int max = VEC_length (int, block_locators_locs); int min = 0; int loc = INSN_LOCATOR (insn); @@ -432,7 +442,7 @@ insn_scope (rtx insn) while (1) { int pos = (min + max) / 2; - int tmp = VARRAY_INT (block_locators_locs, pos); + int tmp = VEC_index (int, block_locators_locs, pos); if (tmp <= loc && min != pos) min = pos; @@ -444,14 +454,14 @@ insn_scope (rtx insn) break; } } - return VARRAY_TREE (block_locators_blocks, min); + return VEC_index (tree, block_locators_blocks, min); } /* Return line number of the statement specified by the locator. */ int locator_line (int loc) { - int max = VARRAY_ACTIVE_SIZE (line_locators_locs); + int max = VEC_length (int, line_locators_locs); int min = 0; if (!max || !loc) @@ -459,7 +469,7 @@ locator_line (int loc) while (1) { int pos = (min + max) / 2; - int tmp = VARRAY_INT (line_locators_locs, pos); + int tmp = VEC_index (int, line_locators_locs, pos); if (tmp <= loc && min != pos) min = pos; @@ -471,7 +481,7 @@ locator_line (int loc) break; } } - return VARRAY_INT (line_locators_lines, min); + return VEC_index (int, line_locators_lines, min); } /* Return line number of the statement that produced this insn. */ @@ -485,7 +495,7 @@ insn_line (rtx insn) const char * locator_file (int loc) { - int max = VARRAY_ACTIVE_SIZE (file_locators_locs); + int max = VEC_length (int, file_locators_locs); int min = 0; if (!max || !loc) @@ -493,7 +503,7 @@ locator_file (int loc) while (1) { int pos = (min + max) / 2; - int tmp = VARRAY_INT (file_locators_locs, pos); + int tmp = VEC_index (int, file_locators_locs, pos); if (tmp <= loc && min != pos) min = pos; @@ -531,9 +541,15 @@ reemit_insn_block_notes (void) { tree this_block; + /* Avoid putting scope notes between jump table and its label. */ + if (JUMP_P (insn) + && (GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)) + continue; + this_block = insn_scope (insn); /* For sequences compute scope resulting from merging all scopes - of instructions nested inside. */ + of instructions nested inside. */ if (GET_CODE (PATTERN (insn)) == SEQUENCE) { int i; @@ -582,18 +598,18 @@ fixup_reorder_chain (void) /* First do the bulk reordering -- rechain the blocks without regard to the needed changes to jumps and labels. */ - for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0; + for (bb = ENTRY_BLOCK_PTR->next_bb, index = NUM_FIXED_BLOCKS; bb != 0; - bb = bb->rbi->next, index++) + bb = bb->aux, index++) { - if (bb->rbi->header) + if (bb->il.rtl->header) { if (insn) - NEXT_INSN (insn) = bb->rbi->header; + NEXT_INSN (insn) = bb->il.rtl->header; else - set_first_insn (bb->rbi->header); - PREV_INSN (bb->rbi->header) = insn; - insn = bb->rbi->header; + set_first_insn (bb->il.rtl->header); + PREV_INSN (bb->il.rtl->header) = insn; + insn = bb->il.rtl->header; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); } @@ -603,17 +619,16 @@ fixup_reorder_chain (void) set_first_insn (BB_HEAD (bb)); PREV_INSN (BB_HEAD (bb)) = insn; insn = BB_END (bb); - if (bb->rbi->footer) + if (bb->il.rtl->footer) { - NEXT_INSN (insn) = bb->rbi->footer; - PREV_INSN (bb->rbi->footer) = insn; + NEXT_INSN (insn) = bb->il.rtl->footer; + PREV_INSN (bb->il.rtl->footer) = insn; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); } } - if (index != n_basic_blocks) - abort (); + gcc_assert (index == n_basic_blocks); NEXT_INSN (insn) = cfg_layout_function_footer; if (cfg_layout_function_footer) @@ -631,116 +646,99 @@ fixup_reorder_chain (void) /* Now add jumps and labels as needed to match the blocks new outgoing edges. */ - for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->rbi->next) + for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->aux) { edge e_fall, e_taken, e; rtx bb_end_insn; basic_block nb; + edge_iterator ei; - if (bb->succ == NULL) + if (EDGE_COUNT (bb->succs) == 0) continue; /* Find the old fallthru edge, and another non-EH edge for a taken jump. */ e_taken = e_fall = NULL; - for (e = bb->succ; e ; e = e->succ_next) + + FOR_EACH_EDGE (e, ei, bb->succs) if (e->flags & EDGE_FALLTHRU) e_fall = e; else if (! (e->flags & EDGE_EH)) e_taken = e; bb_end_insn = BB_END (bb); - if (GET_CODE (bb_end_insn) == JUMP_INSN) + if (JUMP_P (bb_end_insn)) { if (any_condjump_p (bb_end_insn)) { /* If the old fallthru is still next, nothing to do. */ - if (bb->rbi->next == e_fall->dest - || (!bb->rbi->next - && e_fall->dest == EXIT_BLOCK_PTR)) + if (bb->aux == e_fall->dest + || e_fall->dest == EXIT_BLOCK_PTR) continue; /* The degenerated case of conditional jump jumping to the next - instruction can happen on target having jumps with side - effects. - - Create temporarily the duplicated edge representing branch. - It will get unidentified by force_nonfallthru_and_redirect - that would otherwise get confused by fallthru edge not pointing - to the next basic block. */ + instruction can happen for jumps with side effects. We need + to construct a forwarder block and this will be done just + fine by force_nonfallthru below. */ if (!e_taken) - { - rtx note; - edge e_fake; + ; - e_fake = unchecked_make_edge (bb, e_fall->dest, 0); - - if (!redirect_jump (BB_END (bb), block_label (bb), 0)) - abort (); - note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX); - if (note) - { - int prob = INTVAL (XEXP (note, 0)); - - e_fake->probability = prob; - e_fake->count = e_fall->count * prob / REG_BR_PROB_BASE; - e_fall->probability -= e_fall->probability; - e_fall->count -= e_fake->count; - if (e_fall->probability < 0) - e_fall->probability = 0; - if (e_fall->count < 0) - e_fall->count = 0; - } - } - /* There is one special case: if *neither* block is next, + /* There is another special case: if *neither* block is next, such as happens at the very end of a function, then we'll need to add a new unconditional jump. Choose the taken edge based on known or assumed probability. */ - else if (bb->rbi->next != e_taken->dest) + else if (bb->aux != e_taken->dest) { rtx note = find_reg_note (bb_end_insn, REG_BR_PROB, 0); if (note && INTVAL (XEXP (note, 0)) < REG_BR_PROB_BASE / 2 && invert_jump (bb_end_insn, - label_for_bb (e_fall->dest), 0)) + (e_fall->dest == EXIT_BLOCK_PTR + ? NULL_RTX + : label_for_bb (e_fall->dest)), 0)) { e_fall->flags &= ~EDGE_FALLTHRU; +#ifdef ENABLE_CHECKING + gcc_assert (could_fall_through + (e_taken->src, e_taken->dest)); +#endif e_taken->flags |= EDGE_FALLTHRU; update_br_prob_note (bb); e = e_fall, e_fall = e_taken, e_taken = e; } } + /* If the "jumping" edge is a crossing edge, and the fall + through edge is non-crossing, leave things as they are. */ + else if ((e_taken->flags & EDGE_CROSSING) + && !(e_fall->flags & EDGE_CROSSING)) + continue; + /* Otherwise we can try to invert the jump. This will basically never fail, however, keep up the pretense. */ else if (invert_jump (bb_end_insn, - label_for_bb (e_fall->dest), 0)) + (e_fall->dest == EXIT_BLOCK_PTR + ? NULL_RTX + : label_for_bb (e_fall->dest)), 0)) { e_fall->flags &= ~EDGE_FALLTHRU; +#ifdef ENABLE_CHECKING + gcc_assert (could_fall_through + (e_taken->src, e_taken->dest)); +#endif e_taken->flags |= EDGE_FALLTHRU; update_br_prob_note (bb); continue; } } - else if (returnjump_p (bb_end_insn)) - continue; else { - /* Otherwise we have some switch or computed jump. In the - 99% case, there should not have been a fallthru edge. */ - if (! e_fall) - continue; - -#ifdef CASE_DROPS_THROUGH - /* Except for VAX. Since we didn't have predication for the - tablejump, the fallthru block should not have moved. */ - if (bb->rbi->next == e_fall->dest) - continue; - bb_end_insn = skip_insns_after_block (bb); -#else - abort (); -#endif + /* Otherwise we have some return, switch or computed + jump. In the 99% case, there should not have been a + fallthru edge. */ + gcc_assert (returnjump_p (bb_end_insn) || !e_fall); + continue; } } else @@ -752,11 +750,11 @@ fixup_reorder_chain (void) continue; /* If the fallthru block is still next, nothing to do. */ - if (bb->rbi->next == e_fall->dest) + if (bb->aux == e_fall->dest) continue; /* A fallthru to exit block. */ - if (!bb->rbi->next && e_fall->dest == EXIT_BLOCK_PTR) + if (e_fall->dest == EXIT_BLOCK_PTR) continue; } @@ -764,42 +762,56 @@ fixup_reorder_chain (void) nb = force_nonfallthru (e_fall); if (nb) { - cfg_layout_initialize_rbi (nb); - nb->rbi->visited = 1; - nb->rbi->next = bb->rbi->next; - bb->rbi->next = nb; + nb->il.rtl->visited = 1; + nb->aux = bb->aux; + bb->aux = nb; /* Don't process this new block. */ bb = nb; + + /* Make sure new bb is tagged for correct section (same as + fall-thru source, since you cannot fall-throu across + section boundaries). */ + BB_COPY_PARTITION (e_fall->src, single_pred (bb)); + if (flag_reorder_blocks_and_partition + && targetm.have_named_sections + && JUMP_P (BB_END (bb)) + && !any_condjump_p (BB_END (bb)) + && (EDGE_SUCC (bb, 0)->flags & EDGE_CROSSING)) + REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST + (REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb))); } } /* Put basic_block_info in the new order. */ - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, "Reordered sequence:\n"); - for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0; bb; bb = bb->rbi->next, index ++) + fprintf (dump_file, "Reordered sequence:\n"); + for (bb = ENTRY_BLOCK_PTR->next_bb, index = NUM_FIXED_BLOCKS; + bb; + bb = bb->aux, index++) { - fprintf (rtl_dump_file, " %i ", index); - if (bb->rbi->original) - fprintf (rtl_dump_file, "duplicate of %i ", - bb->rbi->original->index); - else if (forwarder_block_p (bb) && GET_CODE (BB_HEAD (bb)) != CODE_LABEL) - fprintf (rtl_dump_file, "compensation "); + fprintf (dump_file, " %i ", index); + if (get_bb_original (bb)) + fprintf (dump_file, "duplicate of %i ", + get_bb_original (bb)->index); + else if (forwarder_block_p (bb) + && !LABEL_P (BB_HEAD (bb))) + fprintf (dump_file, "compensation "); else - fprintf (rtl_dump_file, "bb %i ", bb->index); - fprintf (rtl_dump_file, " [%i]\n", bb->frequency); + fprintf (dump_file, "bb %i ", bb->index); + fprintf (dump_file, " [%i]\n", bb->frequency); } } prev_bb = ENTRY_BLOCK_PTR; bb = ENTRY_BLOCK_PTR->next_bb; - index = 0; + index = NUM_FIXED_BLOCKS; - for (; bb; prev_bb = bb, bb = bb->rbi->next, index ++) + for (; bb; prev_bb = bb, bb = bb->aux, index ++) { bb->index = index; - BASIC_BLOCK (index) = bb; + SET_BASIC_BLOCK (index, bb); bb->prev_bb = prev_bb; prev_bb->next_bb = bb; @@ -811,8 +823,12 @@ fixup_reorder_chain (void) FOR_EACH_BB (bb) { edge e; - for (e = bb->succ; e && !(e->flags & EDGE_FALLTHRU); e = e->succ_next) - continue; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->succs) + if (e->flags & EDGE_FALLTHRU) + break; + if (e && !can_fallthru (e->src, e->dest)) force_nonfallthru (e); } @@ -833,35 +849,38 @@ verify_insn_chain (void) for (prevx = NULL, insn_cnt1 = 1, x = get_insns (); x != 0; prevx = x, insn_cnt1++, x = NEXT_INSN (x)) - if (PREV_INSN (x) != prevx) - abort (); + gcc_assert (PREV_INSN (x) == prevx); - if (prevx != get_last_insn ()) - abort (); + gcc_assert (prevx == get_last_insn ()); for (nextx = NULL, insn_cnt2 = 1, x = get_last_insn (); x != 0; nextx = x, insn_cnt2++, x = PREV_INSN (x)) - if (NEXT_INSN (x) != nextx) - abort (); + gcc_assert (NEXT_INSN (x) == nextx); - if (insn_cnt1 != insn_cnt2) - abort (); + gcc_assert (insn_cnt1 == insn_cnt2); } -/* The block falling through to exit must be the last one in the - reordered chain. Ensure that this condition is met. */ +/* If we have assembler epilogues, the block falling through to exit must + be the last one in the reordered chain when we reach final. Ensure + that this condition is met. */ static void fixup_fallthru_exit_predecessor (void) { edge e; + edge_iterator ei; basic_block bb = NULL; - for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) + /* This transformation is not valid before reload, because we might + separate a call from the instruction that copies the return + value. */ + gcc_assert (reload_completed); + + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) if (e->flags & EDGE_FALLTHRU) bb = e->src; - if (bb && bb->rbi->next) + if (bb && bb->aux) { basic_block c = ENTRY_BLOCK_PTR->next_bb; @@ -870,41 +889,35 @@ fixup_fallthru_exit_predecessor (void) if (c == bb) { bb = split_block (bb, NULL)->dest; - cfg_layout_initialize_rbi (bb); - bb->rbi->next = c->rbi->next; - c->rbi->next = bb; - bb->rbi->footer = c->rbi->footer; - c->rbi->footer = NULL; + bb->aux = c->aux; + c->aux = bb; + bb->il.rtl->footer = c->il.rtl->footer; + c->il.rtl->footer = NULL; } - while (c->rbi->next != bb) - c = c->rbi->next; + while (c->aux != bb) + c = c->aux; - c->rbi->next = bb->rbi->next; - while (c->rbi->next) - c = c->rbi->next; + c->aux = bb->aux; + while (c->aux) + c = c->aux; - c->rbi->next = bb; - bb->rbi->next = NULL; + c->aux = bb; + bb->aux = NULL; } } /* Return true in case it is possible to duplicate the basic block BB. */ +/* We do not want to declare the function in a header file, since it should + only be used through the cfghooks interface, and we do not want to move + it to cfgrtl.c since it would require also moving quite a lot of related + code. */ +extern bool cfg_layout_can_duplicate_bb_p (basic_block); + bool cfg_layout_can_duplicate_bb_p (basic_block bb) { - edge s; - - if (bb == EXIT_BLOCK_PTR || bb == ENTRY_BLOCK_PTR) - return false; - - /* Duplicating fallthru block to exit would require adding a jump - and splitting the real last BB. */ - for (s = bb->succ; s; s = s->succ_next) - if (s->dest == EXIT_BLOCK_PTR && s->flags & EDGE_FALLTHRU) - return false; - /* Do not attempt to duplicate tablejumps, as we need to unshare the dispatch table. This is difficult to do, as the instructions computing jump destination may be hoisted outside the basic block. */ @@ -917,7 +930,7 @@ cfg_layout_can_duplicate_bb_p (basic_block bb) rtx insn = BB_HEAD (bb); while (1) { - if (INSN_P (insn) && (*targetm.cannot_copy_insn_p) (insn)) + if (INSN_P (insn) && targetm.cannot_copy_insn_p (insn)) return false; if (insn == BB_END (bb)) break; @@ -928,7 +941,7 @@ cfg_layout_can_duplicate_bb_p (basic_block bb) return true; } -static rtx +rtx duplicate_insn_chain (rtx from, rtx to) { rtx insn, last; @@ -966,169 +979,99 @@ duplicate_insn_chain (rtx from, rtx to) switch (NOTE_LINE_NUMBER (insn)) { /* In case prologue is empty and function contain label - in first BB, we may want to copy the block. */ + in first BB, we may want to copy the block. */ case NOTE_INSN_PROLOGUE_END: - case NOTE_INSN_LOOP_VTOP: - case NOTE_INSN_LOOP_CONT: - case NOTE_INSN_LOOP_BEG: - case NOTE_INSN_LOOP_END: - /* Strip down the loop notes - we don't really want to keep - them consistent in loop copies. */ case NOTE_INSN_DELETED: case NOTE_INSN_DELETED_LABEL: /* No problem to strip these. */ case NOTE_INSN_EPILOGUE_BEG: case NOTE_INSN_FUNCTION_END: /* Debug code expect these notes to exist just once. - Keep them in the master copy. - ??? It probably makes more sense to duplicate them for each - epilogue copy. */ + Keep them in the master copy. + ??? It probably makes more sense to duplicate them for each + epilogue copy. */ case NOTE_INSN_FUNCTION_BEG: /* There is always just single entry to function. */ case NOTE_INSN_BASIC_BLOCK: break; - /* There is no purpose to duplicate prologue. */ - case NOTE_INSN_BLOCK_BEG: - case NOTE_INSN_BLOCK_END: - /* The BLOCK_BEG/BLOCK_END notes should be eliminated when BB - reordering is in the progress. */ - case NOTE_INSN_EH_REGION_BEG: - case NOTE_INSN_EH_REGION_END: - /* Should never exist at BB duplication time. */ - abort (); - break; case NOTE_INSN_REPEATED_LINE_NUMBER: + case NOTE_INSN_SWITCH_TEXT_SECTIONS: emit_note_copy (insn); break; default: - if (NOTE_LINE_NUMBER (insn) < 0) - abort (); + /* All other notes should have already been eliminated. + */ + gcc_assert (NOTE_LINE_NUMBER (insn) >= 0); + /* It is possible that no_line_number is set and the note - won't be emitted. */ + won't be emitted. */ emit_note_copy (insn); } break; default: - abort (); + gcc_unreachable (); } } insn = NEXT_INSN (last); delete_insn (last); return insn; } -/* Create a duplicate of the basic block BB and redirect edge E into it. - If E is not specified, BB is just copied, but updating the frequencies - etc. is left to the caller. */ +/* Create a duplicate of the basic block BB. */ + +/* We do not want to declare the function in a header file, since it should + only be used through the cfghooks interface, and we do not want to move + it to cfgrtl.c since it would require also moving quite a lot of related + code. */ +extern basic_block cfg_layout_duplicate_bb (basic_block); basic_block -cfg_layout_duplicate_bb (basic_block bb, edge e) +cfg_layout_duplicate_bb (basic_block bb) { rtx insn; - edge s, n; basic_block new_bb; - gcov_type new_count = e ? e->count : 0; - - if (bb->count < new_count) - new_count = bb->count; - if (!bb->pred) - abort (); -#ifdef ENABLE_CHECKING - if (!cfg_layout_can_duplicate_bb_p (bb)) - abort (); -#endif insn = duplicate_insn_chain (BB_HEAD (bb), BB_END (bb)); new_bb = create_basic_block (insn, insn ? get_last_insn () : NULL, EXIT_BLOCK_PTR->prev_bb); - if (bb->rbi->header) + BB_COPY_PARTITION (new_bb, bb); + if (bb->il.rtl->header) { - insn = bb->rbi->header; + insn = bb->il.rtl->header; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); - insn = duplicate_insn_chain (bb->rbi->header, insn); + insn = duplicate_insn_chain (bb->il.rtl->header, insn); if (insn) - new_bb->rbi->header = unlink_insn_chain (insn, get_last_insn ()); + new_bb->il.rtl->header = unlink_insn_chain (insn, get_last_insn ()); } - if (bb->rbi->footer) + if (bb->il.rtl->footer) { - insn = bb->rbi->footer; + insn = bb->il.rtl->footer; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); - insn = duplicate_insn_chain (bb->rbi->footer, insn); + insn = duplicate_insn_chain (bb->il.rtl->footer, insn); if (insn) - new_bb->rbi->footer = unlink_insn_chain (insn, get_last_insn ()); + new_bb->il.rtl->footer = unlink_insn_chain (insn, get_last_insn ()); } - if (bb->global_live_at_start) + if (bb->il.rtl->global_live_at_start) { - new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); - new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (new_bb->global_live_at_start, bb->global_live_at_start); - COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end); + new_bb->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + new_bb->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (new_bb->il.rtl->global_live_at_start, + bb->il.rtl->global_live_at_start); + COPY_REG_SET (new_bb->il.rtl->global_live_at_end, + bb->il.rtl->global_live_at_end); } - new_bb->loop_depth = bb->loop_depth; - new_bb->flags = bb->flags; - for (s = bb->succ; s; s = s->succ_next) - { - /* Since we are creating edges from a new block to successors - of another block (which therefore are known to be disjoint), there - is no need to actually check for duplicated edges. */ - n = unchecked_make_edge (new_bb, s->dest, s->flags); - n->probability = s->probability; - if (e && bb->count) - { - /* Take care for overflows! */ - n->count = s->count * (new_count * 10000 / bb->count) / 10000; - s->count -= n->count; - } - else - n->count = s->count; - n->aux = s->aux; - } - - if (e) - { - new_bb->count = new_count; - bb->count -= new_count; - - new_bb->frequency = EDGE_FREQUENCY (e); - bb->frequency -= EDGE_FREQUENCY (e); - - redirect_edge_and_branch_force (e, new_bb); - - if (bb->count < 0) - bb->count = 0; - if (bb->frequency < 0) - bb->frequency = 0; - } - else - { - new_bb->count = bb->count; - new_bb->frequency = bb->frequency; - } - - new_bb->rbi->original = bb; - bb->rbi->copy = new_bb; - return new_bb; } -void -cfg_layout_initialize_rbi (basic_block bb) -{ - if (bb->rbi) - abort (); - bb->rbi = pool_alloc (cfg_layout_pool); - memset (bb->rbi, 0, sizeof (struct reorder_block_def)); -} - /* Main entry point to this module - initialize the datastructures for CFG layout changes. It keeps LOOPS up-to-date if not null. @@ -1139,15 +1082,7 @@ cfg_layout_initialize_rbi (basic_block bb) void cfg_layout_initialize (unsigned int flags) { - basic_block bb; - - /* Our algorithm depends on fact that there are now dead jumptables - around the code. */ - cfg_layout_pool = - create_alloc_pool ("cfg layout pool", sizeof (struct reorder_block_def), - n_basic_blocks + 2); - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - cfg_layout_initialize_rbi (bb); + initialize_original_copy_tables (); cfg_layout_rtl_register_cfg_hooks (); @@ -1157,23 +1092,22 @@ cfg_layout_initialize (unsigned int flags) } /* Splits superblocks. */ -static void +void break_superblocks (void) { sbitmap superblocks; - int i, need; + bool need = false; + basic_block bb; - superblocks = sbitmap_alloc (n_basic_blocks); + superblocks = sbitmap_alloc (last_basic_block); sbitmap_zero (superblocks); - need = 0; - - for (i = 0; i < n_basic_blocks; i++) - if (BASIC_BLOCK(i)->flags & BB_SUPERBLOCK) + FOR_EACH_BB (bb) + if (bb->flags & BB_SUPERBLOCK) { - BASIC_BLOCK(i)->flags &= ~BB_SUPERBLOCK; - SET_BIT (superblocks, i); - need = 1; + bb->flags &= ~BB_SUPERBLOCK; + SET_BIT (superblocks, bb->index); + need = true; } if (need) @@ -1185,8 +1119,8 @@ break_superblocks (void) free (superblocks); } -/* Finalize the changes: reorder insn list according to the sequence, enter - compensation code, rebuild scope forest. */ +/* Finalize the changes: reorder insn list according to the sequence specified + by aux pointers, enter compensation code, rebuild scope forest. */ void cfg_layout_finalize (void) @@ -1197,22 +1131,31 @@ cfg_layout_finalize (void) verify_flow_info (); #endif rtl_register_cfg_hooks (); - fixup_fallthru_exit_predecessor (); + if (reload_completed +#ifdef HAVE_epilogue + && !HAVE_epilogue +#endif + ) + fixup_fallthru_exit_predecessor (); fixup_reorder_chain (); #ifdef ENABLE_CHECKING verify_insn_chain (); #endif - - free_alloc_pool (cfg_layout_pool); FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - bb->rbi = NULL; + { + bb->il.rtl->header = bb->il.rtl->footer = NULL; + bb->aux = NULL; + bb->il.rtl->visited = 0; + } break_superblocks (); #ifdef ENABLE_CHECKING verify_flow_info (); #endif + + free_original_copy_tables (); } /* Checks whether all N blocks in BBS array can be copied. */ @@ -1224,20 +1167,21 @@ can_copy_bbs_p (basic_block *bbs, unsigned n) int ret = true; for (i = 0; i < n; i++) - bbs[i]->rbi->duplicated = 1; + bbs[i]->flags |= BB_DUPLICATED; for (i = 0; i < n; i++) { /* In case we should redirect abnormal edge during duplication, fail. */ - for (e = bbs[i]->succ; e; e = e->succ_next) + edge_iterator ei; + FOR_EACH_EDGE (e, ei, bbs[i]->succs) if ((e->flags & EDGE_ABNORMAL) - && e->dest->rbi->duplicated) + && (e->dest->flags & BB_DUPLICATED)) { ret = false; goto end; } - if (!cfg_layout_can_duplicate_bb_p (bbs[i])) + if (!can_duplicate_block_p (bbs[i])) { ret = false; break; @@ -1246,7 +1190,7 @@ can_copy_bbs_p (basic_block *bbs, unsigned n) end: for (i = 0; i < n; i++) - bbs[i]->rbi->duplicated = 0; + bbs[i]->flags &= ~BB_DUPLICATED; return ret; } @@ -1264,12 +1208,15 @@ end: is copied, we do not set the new blocks as header or latch. Created copies of N_EDGES edges in array EDGES are stored in array NEW_EDGES, - also in the same order. */ + also in the same order. + + Newly created basic blocks are put after the basic block AFTER in the + instruction stream, and the order of the blocks in BBS array is preserved. */ void copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, - edge *edges, unsigned n_edges, edge *new_edges, - struct loop *base) + edge *edges, unsigned num_edges, edge *new_edges, + struct loop *base, basic_block after) { unsigned i, j; basic_block bb, new_bb, dom_bb; @@ -1280,11 +1227,11 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, { /* Duplicate. */ bb = bbs[i]; - new_bb = new_bbs[i] = cfg_layout_duplicate_bb (bb, NULL); - bb->rbi->duplicated = 1; + new_bb = new_bbs[i] = duplicate_block (bb, NULL, after); + after = new_bb; + bb->flags |= BB_DUPLICATED; /* Add to loop. */ add_bb_to_loop (new_bb, bb->loop_father->copy); - add_to_dominance_info (CDI_DOMINATORS, new_bb); /* Possibly set header. */ if (bb->loop_father->header == bb && bb->loop_father != base) new_bb->loop_father->header = new_bb; @@ -1300,36 +1247,37 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, new_bb = new_bbs[i]; dom_bb = get_immediate_dominator (CDI_DOMINATORS, bb); - if (dom_bb->rbi->duplicated) + if (dom_bb->flags & BB_DUPLICATED) { - dom_bb = dom_bb->rbi->copy; + dom_bb = get_bb_copy (dom_bb); set_immediate_dominator (CDI_DOMINATORS, new_bb, dom_bb); } } /* Redirect edges. */ - for (j = 0; j < n_edges; j++) + for (j = 0; j < num_edges; j++) new_edges[j] = NULL; for (i = 0; i < n; i++) { + edge_iterator ei; new_bb = new_bbs[i]; bb = bbs[i]; - for (e = new_bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, new_bb->succs) { - for (j = 0; j < n_edges; j++) + for (j = 0; j < num_edges; j++) if (edges[j] && edges[j]->src == bb && edges[j]->dest == e->dest) new_edges[j] = e; - if (!e->dest->rbi->duplicated) + if (!(e->dest->flags & BB_DUPLICATED)) continue; - redirect_edge_and_branch_force (e, e->dest->rbi->copy); + redirect_edge_and_branch_force (e, get_bb_copy (e->dest)); } } /* Clear information about duplicates. */ for (i = 0; i < n; i++) - bbs[i]->rbi->duplicated = 0; + bbs[i]->flags &= ~BB_DUPLICATED; } #include "gt-cfglayout.h" diff --git a/contrib/gcc/cfglayout.h b/contrib/gcc/cfglayout.h index c0b250ece16..4bc1e6759c8 100644 --- a/contrib/gcc/cfglayout.h +++ b/contrib/gcc/cfglayout.h @@ -1,5 +1,5 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -15,33 +15,24 @@ 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. */ -/* Structure to hold information about the blocks during reordering. */ -typedef struct reorder_block_def -{ - rtx header; - rtx footer; - basic_block next; - basic_block original; - /* Used by loop copying. */ - basic_block copy; - int duplicated; +#ifndef GCC_CFGLAYOUT_H +#define GCC_CFGLAYOUT_H - /* These fields are used by bb-reorder pass. */ - int visited; -} *reorder_block_def; +#include "basic-block.h" extern rtx cfg_layout_function_footer; extern void cfg_layout_initialize (unsigned int); extern void cfg_layout_finalize (void); -extern bool cfg_layout_can_duplicate_bb_p (basic_block); -extern basic_block cfg_layout_duplicate_bb (basic_block, edge); -extern void insn_locators_initialize (void); +extern unsigned int insn_locators_initialize (void); extern void reemit_insn_block_notes (void); extern bool can_copy_bbs_p (basic_block *, unsigned); extern void copy_bbs (basic_block *, unsigned, basic_block *, - edge *, unsigned, edge *, struct loop *); -extern void cfg_layout_initialize_rbi (basic_block); + edge *, unsigned, edge *, struct loop *, + basic_block); +extern rtx duplicate_insn_chain (rtx, rtx); + +#endif /* GCC_CFGLAYOUT_H */ diff --git a/contrib/gcc/cfgloop.c b/contrib/gcc/cfgloop.c index 69097c009a9..9afd48ba217 100644 --- a/contrib/gcc/cfgloop.c +++ b/contrib/gcc/cfgloop.c @@ -1,5 +1,5 @@ /* Natural loop discovery code for GNU compiler. - Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -24,28 +24,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" #include "hard-reg-set.h" +#include "obstack.h" +#include "function.h" #include "basic-block.h" #include "toplev.h" #include "cfgloop.h" #include "flags.h" +#include "tree.h" +#include "tree-flow.h" /* Ratio of frequencies of edges so that one of more latch edges is considered to belong to inner loop with same header. */ #define HEAVY_EDGE_RATIO 8 +#define HEADER_BLOCK(B) (* (int *) (B)->aux) +#define LATCH_EDGE(E) (*(int *) (E)->aux) + static void flow_loops_cfg_dump (const struct loops *, FILE *); -static void flow_loop_entry_edges_find (struct loop *); -static void flow_loop_exit_edges_find (struct loop *); -static int flow_loop_nodes_find (basic_block, struct loop *); -static void flow_loop_pre_header_scan (struct loop *); -static basic_block flow_loop_pre_header_find (basic_block); static int flow_loop_level_compute (struct loop *); -static int flow_loops_level_compute (struct loops *); +static void flow_loops_level_compute (struct loops *); static void establish_preds (struct loop *); -static basic_block make_forwarder_block (basic_block, int, int, edge, int); static void canonicalize_loop_headers (void); static bool glb_enum_p (basic_block, void *); -static void redirect_edge_with_latch_update (edge, basic_block); /* Dump loop related CFG information. */ @@ -61,9 +61,10 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file) FOR_EACH_BB (bb) { edge succ; + edge_iterator ei; fprintf (file, ";; %d succs { ", bb->index); - for (succ = bb->succ; succ; succ = succ->succ_next) + FOR_EACH_EDGE (succ, ei, bb->succs) fprintf (file, "%d ", succ->dest->index); fprintf (file, "}\n"); } @@ -72,7 +73,7 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file) if (loops->cfg.dfs_order) { fputs (";; DFS order: ", file); - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) fprintf (file, "%d ", loops->cfg.dfs_order[i]); fputs ("\n", file); @@ -82,7 +83,7 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file) if (loops->cfg.rc_order) { fputs (";; RC order: ", file); - for (i = 0; i < n_basic_blocks; i++) + for (i = NUM_FIXED_BLOCKS; i < n_basic_blocks; i++) fprintf (file, "%d ", loops->cfg.rc_order[i]); fputs ("\n", file); @@ -94,8 +95,22 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file) bool flow_loop_nested_p (const struct loop *outer, const struct loop *loop) { - return loop->depth > outer->depth - && loop->pred[outer->depth] == outer; + return (loop->depth > outer->depth + && loop->pred[outer->depth] == outer); +} + +/* Returns the loop such that LOOP is nested DEPTH (indexed from zero) + loops within LOOP. */ + +struct loop * +superloop_at_depth (struct loop *loop, unsigned depth) +{ + gcc_assert (depth <= (unsigned) loop->depth); + + if (depth == (unsigned) loop->depth) + return loop; + + return loop->pred[depth]; } /* Dump the loop information specified by LOOP to the stream FILE @@ -112,30 +127,20 @@ flow_loop_dump (const struct loop *loop, FILE *file, if (! loop || ! loop->header) return; - fprintf (file, ";;\n;; Loop %d:%s\n", loop->num, - loop->invalid ? " invalid" : ""); + fprintf (file, ";;\n;; Loop %d\n", loop->num); - fprintf (file, ";; header %d, latch %d, pre-header %d\n", - loop->header->index, loop->latch->index, - loop->pre_header ? loop->pre_header->index : -1); + fprintf (file, ";; header %d, latch %d\n", + loop->header->index, loop->latch->index); fprintf (file, ";; depth %d, level %d, outer %ld\n", loop->depth, loop->level, (long) (loop->outer ? loop->outer->num : -1)); - if (loop->pre_header_edges) - flow_edge_list_print (";; pre-header edges", loop->pre_header_edges, - loop->num_pre_header_edges, file); - - flow_edge_list_print (";; entry edges", loop->entry_edges, - loop->num_entries, file); fprintf (file, ";; nodes:"); bbs = get_loop_body (loop); for (i = 0; i < loop->num_nodes; i++) fprintf (file, " %d", bbs[i]->index); free (bbs); fprintf (file, "\n"); - flow_edge_list_print (";; exit edges", loop->exit_edges, - loop->num_exits, file); if (loop_dump_aux) loop_dump_aux (loop, file, verbose); @@ -154,8 +159,7 @@ flow_loops_dump (const struct loops *loops, FILE *file, void (*loop_dump_aux) (c if (! num_loops || ! file) return; - fprintf (file, ";; %d loops found, %d levels\n", - num_loops, loops->levels); + fprintf (file, ";; %d loops found\n", num_loops); for (i = 0; i < num_loops; i++) { @@ -175,12 +179,6 @@ flow_loops_dump (const struct loops *loops, FILE *file, void (*loop_dump_aux) (c void flow_loop_free (struct loop *loop) { - if (loop->pre_header_edges) - free (loop->pre_header_edges); - if (loop->entry_edges) - free (loop->entry_edges); - if (loop->exit_edges) - free (loop->exit_edges); if (loop->pred) free (loop->pred); free (loop); @@ -195,8 +193,7 @@ flow_loops_free (struct loops *loops) { unsigned i; - if (! loops->num) - abort (); + gcc_assert (loops->num); /* Free the loop descriptors. */ for (i = 0; i < loops->num; i++) @@ -220,94 +217,10 @@ flow_loops_free (struct loops *loops) } } -/* Find the entry edges into the LOOP. */ - -static void -flow_loop_entry_edges_find (struct loop *loop) -{ - edge e; - int num_entries; - - num_entries = 0; - for (e = loop->header->pred; e; e = e->pred_next) - { - if (flow_loop_outside_edge_p (loop, e)) - num_entries++; - } - - if (! num_entries) - abort (); - - loop->entry_edges = xmalloc (num_entries * sizeof (edge *)); - - num_entries = 0; - for (e = loop->header->pred; e; e = e->pred_next) - { - if (flow_loop_outside_edge_p (loop, e)) - loop->entry_edges[num_entries++] = e; - } - - loop->num_entries = num_entries; -} - -/* Find the exit edges from the LOOP. */ - -static void -flow_loop_exit_edges_find (struct loop *loop) -{ - edge e; - basic_block node, *bbs; - unsigned num_exits, i; - - loop->exit_edges = NULL; - loop->num_exits = 0; - - /* Check all nodes within the loop to see if there are any - successors not in the loop. Note that a node may have multiple - exiting edges. */ - num_exits = 0; - bbs = get_loop_body (loop); - for (i = 0; i < loop->num_nodes; i++) - { - node = bbs[i]; - for (e = node->succ; e; e = e->succ_next) - { - basic_block dest = e->dest; - - if (!flow_bb_inside_loop_p (loop, dest)) - num_exits++; - } - } - - if (! num_exits) - { - free (bbs); - return; - } - - loop->exit_edges = xmalloc (num_exits * sizeof (edge *)); - - /* Store all exiting edges into an array. */ - num_exits = 0; - for (i = 0; i < loop->num_nodes; i++) - { - node = bbs[i]; - for (e = node->succ; e; e = e->succ_next) - { - basic_block dest = e->dest; - - if (!flow_bb_inside_loop_p (loop, dest)) - loop->exit_edges[num_exits++] = e; - } - } - free (bbs); - loop->num_exits = num_exits; -} - /* Find the nodes contained within the LOOP with header HEADER. Return the number of nodes within the loop. */ -static int +int flow_loop_nodes_find (basic_block header, struct loop *loop) { basic_block *stack; @@ -319,7 +232,7 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) if (loop->latch->loop_father != loop) { - stack = xmalloc (n_basic_blocks * sizeof (basic_block)); + stack = XNEWVEC (basic_block, n_basic_blocks); sp = 0; num_nodes++; stack[sp++] = loop->latch; @@ -330,10 +243,11 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) { basic_block node; edge e; + edge_iterator ei; node = stack[--sp]; - for (e = node->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, node->preds) { basic_block ancestor = e->src; @@ -352,73 +266,62 @@ flow_loop_nodes_find (basic_block header, struct loop *loop) return num_nodes; } -/* Find the root node of the loop pre-header extended basic block and - the edges along the trace from the root node to the loop header. */ +/* For each loop in the lOOPS tree that has just a single exit + record the exit edge. */ -static void -flow_loop_pre_header_scan (struct loop *loop) +void +mark_single_exit_loops (struct loops *loops) { - int num; - basic_block ebb; + basic_block bb; edge e; + struct loop *loop; + unsigned i; - loop->num_pre_header_edges = 0; - if (loop->num_entries != 1) - return; - - ebb = loop->entry_edges[0]->src; - if (ebb == ENTRY_BLOCK_PTR) - return; - - /* Count number of edges along trace from loop header to - root of pre-header extended basic block. Usually this is - only one or two edges. */ - for (num = 1; ebb->pred->src != ENTRY_BLOCK_PTR && ! ebb->pred->pred_next; - num++) - ebb = ebb->pred->src; - - loop->pre_header_edges = xmalloc (num * sizeof (edge)); - loop->num_pre_header_edges = num; - - /* Store edges in order that they are followed. The source of the first edge - is the root node of the pre-header extended basic block and the - destination of the last last edge is the loop header. */ - for (e = loop->entry_edges[0]; num; e = e->src->pred) - loop->pre_header_edges[--num] = e; -} - -/* Return the block for the pre-header of the loop with header - HEADER. Return NULL if there is no pre-header. */ - -static basic_block -flow_loop_pre_header_find (basic_block header) -{ - basic_block pre_header; - edge e; - - /* If block p is a predecessor of the header and is the only block - that the header does not dominate, then it is the pre-header. */ - pre_header = NULL; - for (e = header->pred; e; e = e->pred_next) + for (i = 1; i < loops->num; i++) { - basic_block node = e->src; + loop = loops->parray[i]; + if (loop) + loop->single_exit = NULL; + } - if (node != ENTRY_BLOCK_PTR - && ! dominated_by_p (CDI_DOMINATORS, node, header)) + FOR_EACH_BB (bb) + { + edge_iterator ei; + if (bb->loop_father == loops->tree_root) + continue; + FOR_EACH_EDGE (e, ei, bb->succs) { - if (pre_header == NULL) - pre_header = node; - else + if (e->dest == EXIT_BLOCK_PTR) + continue; + + if (flow_bb_inside_loop_p (bb->loop_father, e->dest)) + continue; + + for (loop = bb->loop_father; + loop != e->dest->loop_father; + loop = loop->outer) { - /* There are multiple edges into the header from outside - the loop so there is no pre-header block. */ - pre_header = NULL; - break; + /* If we have already seen an exit, mark this by the edge that + surely does not occur as any exit. */ + if (loop->single_exit) + loop->single_exit = single_succ_edge (ENTRY_BLOCK_PTR); + else + loop->single_exit = e; } } } - return pre_header; + for (i = 1; i < loops->num; i++) + { + loop = loops->parray[i]; + if (!loop) + continue; + + if (loop->single_exit == single_succ_edge (ENTRY_BLOCK_PTR)) + loop->single_exit = NULL; + } + + loops->state |= LOOPS_HAVE_MARKED_SINGLE_EXITS; } static void @@ -427,9 +330,13 @@ establish_preds (struct loop *loop) struct loop *ploop, *father = loop->outer; loop->depth = father->depth + 1; + + /* Remember the current loop depth if it is the largest seen so far. */ + cfun->max_loop_depth = MAX (cfun->max_loop_depth, loop->depth); + if (loop->pred) free (loop->pred); - loop->pred = xmalloc (sizeof (struct loop *) * loop->depth); + loop->pred = XNEWVEC (struct loop *, loop->depth); memcpy (loop->pred, father->pred, sizeof (struct loop *) * father->depth); loop->pred[father->depth] = father; @@ -508,136 +415,65 @@ flow_loop_level_compute (struct loop *loop) hierarchy tree specified by LOOPS. Return the maximum enclosed loop level. */ -static int +static void flow_loops_level_compute (struct loops *loops) { - return flow_loop_level_compute (loops->tree_root); + flow_loop_level_compute (loops->tree_root); } -/* Scan a single natural loop specified by LOOP collecting information - about it specified by FLAGS. */ +/* A callback to update latch and header info for basic block JUMP created + by redirecting an edge. */ -int -flow_loop_scan (struct loop *loop, int flags) -{ - if (flags & LOOP_ENTRY_EDGES) - { - /* Find edges which enter the loop header. - Note that the entry edges should only - enter the header of a natural loop. */ - flow_loop_entry_edges_find (loop); - } - - if (flags & LOOP_EXIT_EDGES) - { - /* Find edges which exit the loop. */ - flow_loop_exit_edges_find (loop); - } - - if (flags & LOOP_PRE_HEADER) - { - /* Look to see if the loop has a pre-header node. */ - loop->pre_header = flow_loop_pre_header_find (loop->header); - - /* Find the blocks within the extended basic block of - the loop pre-header. */ - flow_loop_pre_header_scan (loop); - } - - return 1; -} - -#define HEADER_BLOCK(B) (* (int *) (B)->aux) -#define LATCH_EDGE(E) (*(int *) (E)->aux) - -/* Redirect edge and update latch and header info. */ static void -redirect_edge_with_latch_update (edge e, basic_block to) +update_latch_info (basic_block jump) { - basic_block jump; - - jump = redirect_edge_and_branch_force (e, to); - if (jump) - { - alloc_aux_for_block (jump, sizeof (int)); - HEADER_BLOCK (jump) = 0; - alloc_aux_for_edge (jump->pred, sizeof (int)); - LATCH_EDGE (jump->succ) = LATCH_EDGE (e); - LATCH_EDGE (jump->pred) = 0; - } + alloc_aux_for_block (jump, sizeof (int)); + HEADER_BLOCK (jump) = 0; + alloc_aux_for_edge (single_pred_edge (jump), sizeof (int)); + LATCH_EDGE (single_pred_edge (jump)) = 0; + set_immediate_dominator (CDI_DOMINATORS, jump, single_pred (jump)); } -/* Split BB into entry part and rest; if REDIRECT_LATCH, redirect edges - marked as latch into entry part, analogically for REDIRECT_NONLATCH. - In both of these cases, ignore edge EXCEPT. If CONN_LATCH, set edge - between created entry part and BB as latch one. Return created entry - part. */ +/* A callback for make_forwarder block, to redirect all edges except for + MFB_KJ_EDGE to the entry part. E is the edge for that we should decide + whether to redirect it. */ -static basic_block -make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch, edge except, int conn_latch) +static edge mfb_kj_edge; +static bool +mfb_keep_just (edge e) { - edge e, next_e, fallthru; - basic_block dummy; - rtx insn; + return e != mfb_kj_edge; +} - insn = PREV_INSN (first_insn_after_basic_block_note (bb)); +/* A callback for make_forwarder block, to redirect the latch edges into an + entry part. E is the edge for that we should decide whether to redirect + it. */ - /* For empty block split_block will return NULL. */ - if (BB_END (bb) == insn) - emit_note_after (NOTE_INSN_DELETED, insn); - - fallthru = split_block (bb, insn); - dummy = fallthru->src; - bb = fallthru->dest; - - bb->aux = xmalloc (sizeof (int)); - HEADER_BLOCK (dummy) = 0; - HEADER_BLOCK (bb) = 1; - - /* Redirect back edges we want to keep. */ - for (e = dummy->pred; e; e = next_e) - { - next_e = e->pred_next; - if (e == except - || !((redirect_latch && LATCH_EDGE (e)) - || (redirect_nonlatch && !LATCH_EDGE (e)))) - { - dummy->frequency -= EDGE_FREQUENCY (e); - dummy->count -= e->count; - if (dummy->frequency < 0) - dummy->frequency = 0; - if (dummy->count < 0) - dummy->count = 0; - redirect_edge_with_latch_update (e, bb); - } - } - - alloc_aux_for_edge (fallthru, sizeof (int)); - LATCH_EDGE (fallthru) = conn_latch; - - return dummy; +static bool +mfb_keep_nonlatch (edge e) +{ + return LATCH_EDGE (e); } /* Takes care of merging natural loops with shared headers. */ + static void canonicalize_loop_headers (void) { basic_block header; edge e; - /* Compute the dominators. */ - calculate_dominance_info (CDI_DOMINATORS); - alloc_aux_for_blocks (sizeof (int)); alloc_aux_for_edges (sizeof (int)); /* Split blocks so that each loop has only single latch. */ FOR_EACH_BB (header) { + edge_iterator ei; int num_latches = 0; int have_abnormal_edge = 0; - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) { basic_block latch = e->src; @@ -657,48 +493,38 @@ canonicalize_loop_headers (void) HEADER_BLOCK (header) = num_latches; } - free_dominance_info (CDI_DOMINATORS); - - if (HEADER_BLOCK (ENTRY_BLOCK_PTR->succ->dest)) + if (HEADER_BLOCK (single_succ (ENTRY_BLOCK_PTR))) { basic_block bb; /* We could not redirect edges freely here. On the other hand, we can simply split the edge from entry block. */ - bb = split_edge (ENTRY_BLOCK_PTR->succ); + bb = split_edge (single_succ_edge (ENTRY_BLOCK_PTR)); - alloc_aux_for_edge (bb->succ, sizeof (int)); - LATCH_EDGE (bb->succ) = 0; + alloc_aux_for_edge (single_succ_edge (bb), sizeof (int)); + LATCH_EDGE (single_succ_edge (bb)) = 0; alloc_aux_for_block (bb, sizeof (int)); HEADER_BLOCK (bb) = 0; } FOR_EACH_BB (header) { - int num_latch; - int want_join_latch; int max_freq, is_heavy; - edge heavy; + edge heavy, tmp_edge; + edge_iterator ei; - if (!HEADER_BLOCK (header)) - continue; - - num_latch = HEADER_BLOCK (header); - - want_join_latch = (num_latch > 1); - - if (!want_join_latch) + if (HEADER_BLOCK (header) <= 1) continue; /* Find a heavy edge. */ is_heavy = 1; heavy = NULL; max_freq = 0; - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) if (LATCH_EDGE (e) && EDGE_FREQUENCY (e) > max_freq) max_freq = EDGE_FREQUENCY (e); - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) if (LATCH_EDGE (e) && EDGE_FREQUENCY (e) >= max_freq / HEAVY_EDGE_RATIO) { @@ -713,28 +539,59 @@ canonicalize_loop_headers (void) if (is_heavy) { - basic_block new_header = - make_forwarder_block (header, true, true, heavy, 0); - if (num_latch > 2) - make_forwarder_block (new_header, true, false, NULL, 1); + /* Split out the heavy edge, and create inner loop for it. */ + mfb_kj_edge = heavy; + tmp_edge = make_forwarder_block (header, mfb_keep_just, + update_latch_info); + alloc_aux_for_block (tmp_edge->dest, sizeof (int)); + HEADER_BLOCK (tmp_edge->dest) = 1; + alloc_aux_for_edge (tmp_edge, sizeof (int)); + LATCH_EDGE (tmp_edge) = 0; + HEADER_BLOCK (header)--; + } + + if (HEADER_BLOCK (header) > 1) + { + /* Create a new latch block. */ + tmp_edge = make_forwarder_block (header, mfb_keep_nonlatch, + update_latch_info); + alloc_aux_for_block (tmp_edge->dest, sizeof (int)); + HEADER_BLOCK (tmp_edge->src) = 0; + HEADER_BLOCK (tmp_edge->dest) = 1; + alloc_aux_for_edge (tmp_edge, sizeof (int)); + LATCH_EDGE (tmp_edge) = 1; } - else - make_forwarder_block (header, true, false, NULL, 1); } free_aux_for_blocks (); free_aux_for_edges (); + +#ifdef ENABLE_CHECKING + verify_dominators (CDI_DOMINATORS); +#endif +} + +/* Initialize all the parallel_p fields of the loops structure to true. */ + +static void +initialize_loops_parallel_p (struct loops *loops) +{ + unsigned int i; + + for (i = 0; i < loops->num; i++) + { + struct loop *loop = loops->parray[i]; + loop->parallel_p = true; + } } /* Find all the natural loops in the function and save in LOOPS structure and - recalculate loop_depth information in basic block structures. FLAGS - controls which loop information is collected. Return the number of natural - loops found. */ + recalculate loop_depth information in basic block structures. + Return the number of natural loops found. */ int -flow_loops_find (struct loops *loops, int flags) +flow_loops_find (struct loops *loops) { - int i; int b; int num_loops; edge e; @@ -744,28 +601,26 @@ flow_loops_find (struct loops *loops, int flags) basic_block header; basic_block bb; - /* This function cannot be repeatedly called with different - flags to build up the loop information. The loop tree - must always be built if this function is called. */ - if (! (flags & LOOP_TREE)) - abort (); - memset (loops, 0, sizeof *loops); + /* We are going to recount the maximum loop depth, + so throw away the last count. */ + cfun->max_loop_depth = 0; + /* Taking care of this degenerate case makes the rest of this code simpler. */ - if (n_basic_blocks == 0) + if (n_basic_blocks == NUM_FIXED_BLOCKS) return 0; dfs_order = NULL; rc_order = NULL; + /* Ensure that the dominators are computed. */ + calculate_dominance_info (CDI_DOMINATORS); + /* Join loops with shared headers. */ canonicalize_loop_headers (); - /* Compute the dominators. */ - calculate_dominance_info (CDI_DOMINATORS); - /* Count the number of loop headers. This should be the same as the number of natural loops. */ headers = sbitmap_alloc (last_basic_block); @@ -774,24 +629,24 @@ flow_loops_find (struct loops *loops, int flags) num_loops = 0; FOR_EACH_BB (header) { + edge_iterator ei; int more_latches = 0; header->loop_depth = 0; /* If we have an abnormal predecessor, do not consider the loop (not worth the problems). */ - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) if (e->flags & EDGE_ABNORMAL) break; if (e) continue; - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) { basic_block latch = e->src; - if (e->flags & EDGE_ABNORMAL) - abort (); + gcc_assert (!(e->flags & EDGE_ABNORMAL)); /* Look for back edges where a predecessor is dominated by this block. A natural loop has a single entry @@ -802,8 +657,7 @@ flow_loops_find (struct loops *loops, int flags) && dominated_by_p (CDI_DOMINATORS, latch, header)) { /* Shared headers should be eliminated by now. */ - if (more_latches) - abort (); + gcc_assert (!more_latches); more_latches = 1; SET_BIT (headers, header->index); num_loops++; @@ -812,16 +666,16 @@ flow_loops_find (struct loops *loops, int flags) } /* Allocate loop structures. */ - loops->parray = xcalloc (num_loops + 1, sizeof (struct loop *)); + loops->parray = XCNEWVEC (struct loop *, num_loops + 1); /* Dummy loop containing whole function. */ - loops->parray[0] = xcalloc (1, sizeof (struct loop)); + loops->parray[0] = XCNEW (struct loop); loops->parray[0]->next = NULL; loops->parray[0]->inner = NULL; loops->parray[0]->outer = NULL; loops->parray[0]->depth = 0; loops->parray[0]->pred = NULL; - loops->parray[0]->num_nodes = n_basic_blocks + 2; + loops->parray[0]->num_nodes = n_basic_blocks; loops->parray[0]->latch = EXIT_BLOCK_PTR; loops->parray[0]->header = ENTRY_BLOCK_PTR; ENTRY_BLOCK_PTR->loop_father = loops->parray[0]; @@ -839,9 +693,9 @@ flow_loops_find (struct loops *loops, int flags) { /* Compute depth first search order of the CFG so that outer natural loops will be found before inner natural loops. */ - dfs_order = xmalloc (n_basic_blocks * sizeof (int)); - rc_order = xmalloc (n_basic_blocks * sizeof (int)); - flow_depth_first_order_compute (dfs_order, rc_order); + dfs_order = XNEWVEC (int, n_basic_blocks); + rc_order = XNEWVEC (int, n_basic_blocks); + pre_and_rev_post_order_compute (dfs_order, rc_order, false); /* Save CFG derived information to avoid recomputing it. */ loops->cfg.dfs_order = dfs_order; @@ -849,9 +703,10 @@ flow_loops_find (struct loops *loops, int flags) num_loops = 1; - for (b = 0; b < n_basic_blocks; b++) + for (b = 0; b < n_basic_blocks - NUM_FIXED_BLOCKS; b++) { struct loop *loop; + edge_iterator ei; /* Search the nodes of the CFG in reverse completion order so that we can find outer loops first. */ @@ -860,14 +715,14 @@ flow_loops_find (struct loops *loops, int flags) header = BASIC_BLOCK (rc_order[b]); - loop = loops->parray[num_loops] = xcalloc (1, sizeof (struct loop)); + loop = loops->parray[num_loops] = XCNEW (struct loop); loop->header = header; loop->num = num_loops; num_loops++; /* Look for the latch for this header block. */ - for (e = header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, header->preds) { basic_block latch = e->src; @@ -885,17 +740,10 @@ flow_loops_find (struct loops *loops, int flags) /* Assign the loop nesting depth and enclosed loop level for each loop. */ - loops->levels = flow_loops_level_compute (loops); - - /* Scan the loops. */ - for (i = 1; i < num_loops; i++) - flow_loop_scan (loops->parray[i], flags); + flow_loops_level_compute (loops); loops->num = num_loops; - } - else - { - free_dominance_info (CDI_DOMINATORS); + initialize_loops_parallel_p (loops); } sbitmap_free (headers); @@ -909,20 +757,6 @@ flow_loops_find (struct loops *loops, int flags) return loops->num; } -/* Update the information regarding the loops in the CFG - specified by LOOPS. */ - -int -flow_loops_update (struct loops *loops, int flags) -{ - /* One day we may want to update the current loop data. For now - throw away the old stuff and rebuild what we need. */ - if (loops->parray) - flow_loops_free (loops); - - return flow_loops_find (loops, flags); -} - /* Return nonzero if basic block BB belongs to LOOP. */ bool flow_bb_inside_loop_p (const struct loop *loop, const basic_block bb) @@ -936,16 +770,6 @@ flow_bb_inside_loop_p (const struct loop *loop, const basic_block bb) return loop == source_loop || flow_loop_nested_p (loop, source_loop); } -/* Return nonzero if edge E enters header of LOOP from outside of LOOP. */ - -bool -flow_loop_outside_edge_p (const struct loop *loop, edge e) -{ - if (e->dest != loop->header) - abort (); - return !flow_bb_inside_loop_p (loop, e->src); -} - /* Enumeration predicate for get_loop_body. */ static bool glb_enum_p (basic_block bb, void *glb_header) @@ -962,17 +786,15 @@ get_loop_body (const struct loop *loop) basic_block *tovisit, bb; unsigned tv = 0; - if (!loop->num_nodes) - abort (); + gcc_assert (loop->num_nodes); - tovisit = xcalloc (loop->num_nodes, sizeof (basic_block)); + tovisit = XCNEWVEC (basic_block, loop->num_nodes); tovisit[tv++] = loop->header; if (loop->latch == EXIT_BLOCK_PTR) { /* There may be blocks unreachable from EXIT_BLOCK. */ - if (loop->num_nodes != (unsigned) n_basic_blocks + 2) - abort (); + gcc_assert (loop->num_nodes == (unsigned) n_basic_blocks); FOR_EACH_BB (bb) tovisit[tv++] = bb; tovisit[tv++] = EXIT_BLOCK_PTR; @@ -984,33 +806,136 @@ get_loop_body (const struct loop *loop) loop->header) + 1; } - if (tv != loop->num_nodes) - abort (); + gcc_assert (tv == loop->num_nodes); return tovisit; } +/* Fills dominance descendants inside LOOP of the basic block BB into + array TOVISIT from index *TV. */ + +static void +fill_sons_in_loop (const struct loop *loop, basic_block bb, + basic_block *tovisit, int *tv) +{ + basic_block son, postpone = NULL; + + tovisit[(*tv)++] = bb; + for (son = first_dom_son (CDI_DOMINATORS, bb); + son; + son = next_dom_son (CDI_DOMINATORS, son)) + { + if (!flow_bb_inside_loop_p (loop, son)) + continue; + + if (dominated_by_p (CDI_DOMINATORS, loop->latch, son)) + { + postpone = son; + continue; + } + fill_sons_in_loop (loop, son, tovisit, tv); + } + + if (postpone) + fill_sons_in_loop (loop, postpone, tovisit, tv); +} + +/* Gets body of a LOOP (that must be different from the outermost loop) + sorted by dominance relation. Additionally, if a basic block s dominates + the latch, then only blocks dominated by s are be after it. */ + +basic_block * +get_loop_body_in_dom_order (const struct loop *loop) +{ + basic_block *tovisit; + int tv; + + gcc_assert (loop->num_nodes); + + tovisit = XCNEWVEC (basic_block, loop->num_nodes); + + gcc_assert (loop->latch != EXIT_BLOCK_PTR); + + tv = 0; + fill_sons_in_loop (loop, loop->header, tovisit, &tv); + + gcc_assert (tv == (int) loop->num_nodes); + + return tovisit; +} + +/* Get body of a LOOP in breadth first sort order. */ + +basic_block * +get_loop_body_in_bfs_order (const struct loop *loop) +{ + basic_block *blocks; + basic_block bb; + bitmap visited; + unsigned int i = 0; + unsigned int vc = 1; + + gcc_assert (loop->num_nodes); + gcc_assert (loop->latch != EXIT_BLOCK_PTR); + + blocks = XCNEWVEC (basic_block, loop->num_nodes); + visited = BITMAP_ALLOC (NULL); + + bb = loop->header; + while (i < loop->num_nodes) + { + edge e; + edge_iterator ei; + + if (!bitmap_bit_p (visited, bb->index)) + { + /* This basic block is now visited */ + bitmap_set_bit (visited, bb->index); + blocks[i++] = bb; + } + + FOR_EACH_EDGE (e, ei, bb->succs) + { + if (flow_bb_inside_loop_p (loop, e->dest)) + { + if (!bitmap_bit_p (visited, e->dest->index)) + { + bitmap_set_bit (visited, e->dest->index); + blocks[i++] = e->dest; + } + } + } + + gcc_assert (i >= vc); + + bb = blocks[vc++]; + } + + BITMAP_FREE (visited); + return blocks; +} + /* Gets exit edges of a LOOP, returning their number in N_EDGES. */ edge * -get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) +get_loop_exit_edges (const struct loop *loop, unsigned int *num_edges) { edge *edges, e; unsigned i, n; basic_block * body; + edge_iterator ei; - if (loop->latch == EXIT_BLOCK_PTR) - abort (); + gcc_assert (loop->latch != EXIT_BLOCK_PTR); body = get_loop_body (loop); n = 0; for (i = 0; i < loop->num_nodes; i++) - for (e = body[i]->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, body[i]->succs) if (!flow_bb_inside_loop_p (loop, e->dest)) n++; - edges = xmalloc (n * sizeof (edge)); - *n_edges = n; + edges = XNEWVEC (edge, n); + *num_edges = n; n = 0; for (i = 0; i < loop->num_nodes; i++) - for (e = body[i]->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, body[i]->succs) if (!flow_bb_inside_loop_p (loop, e->dest)) edges[n++] = e; free (body); @@ -1018,6 +943,26 @@ get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) return edges; } +/* Counts the number of conditional branches inside LOOP. */ + +unsigned +num_loop_branches (const struct loop *loop) +{ + unsigned i, n; + basic_block * body; + + gcc_assert (loop->latch != EXIT_BLOCK_PTR); + + body = get_loop_body (loop); + n = 0; + for (i = 0; i < loop->num_nodes; i++) + if (EDGE_COUNT (body[i]->succs) >= 2) + n++; + free (body); + + return n; +} + /* Adds basic block BB to LOOP. */ void add_bb_to_loop (basic_block bb, struct loop *loop) @@ -1043,7 +988,7 @@ remove_bb_from_loops (basic_block bb) loop->pred[i]->num_nodes--; bb->loop_father = NULL; bb->loop_depth = 0; - } +} /* Finds nearest common ancestor in loop tree for given loops. */ struct loop * @@ -1066,14 +1011,14 @@ find_common_loop (struct loop *loop_s, struct loop *loop_d) } /* Cancels the LOOP; it must be innermost one. */ -void + +static void cancel_loop (struct loops *loops, struct loop *loop) { basic_block *bbs; unsigned i; - if (loop->inner) - abort (); + gcc_assert (!loop->inner); /* Move blocks up one level (they should be removed as soon as possible). */ bbs = get_loop_body (loop); @@ -1117,7 +1062,7 @@ verify_loop_structure (struct loops *loops) edge e; /* Check sizes. */ - sizes = xcalloc (loops->num, sizeof (int)); + sizes = XCNEWVEC (unsigned, loops->num); sizes[0] = 2; FOR_EACH_BB (bb) @@ -1127,18 +1072,16 @@ verify_loop_structure (struct loops *loops) for (i = 0; i < loops->num; i++) { if (!loops->parray[i]) - continue; + continue; if (loops->parray[i]->num_nodes != sizes[i]) { - error ("Size of loop %d should be %d, not %d.", + error ("size of loop %d should be %d, not %d", i, sizes[i], loops->parray[i]->num_nodes); err = 1; } } - free (sizes); - /* Check get_loop_body. */ for (i = 1; i < loops->num; i++) { @@ -1150,7 +1093,7 @@ verify_loop_structure (struct loops *loops) for (j = 0; j < loop->num_nodes; j++) if (!flow_bb_inside_loop_p (loop, bbs[j])) { - error ("Bb %d do not belong to loop %d.", + error ("bb %d do not belong to loop %d", bbs[j]->index, i); err = 1; } @@ -1165,40 +1108,38 @@ verify_loop_structure (struct loops *loops) continue; if ((loops->state & LOOPS_HAVE_PREHEADERS) - && (!loop->header->pred->pred_next - || loop->header->pred->pred_next->pred_next)) + && EDGE_COUNT (loop->header->preds) != 2) { - error ("Loop %d's header does not have exactly 2 entries.", i); + error ("loop %d's header does not have exactly 2 entries", i); err = 1; } if (loops->state & LOOPS_HAVE_SIMPLE_LATCHES) { - if (!loop->latch->succ - || loop->latch->succ->succ_next) + if (!single_succ_p (loop->latch)) { - error ("Loop %d's latch does not have exactly 1 successor.", i); + error ("loop %d's latch does not have exactly 1 successor", i); err = 1; } - if (loop->latch->succ->dest != loop->header) + if (single_succ (loop->latch) != loop->header) { - error ("Loop %d's latch does not have header as successor.", i); + error ("loop %d's latch does not have header as successor", i); err = 1; } if (loop->latch->loop_father != loop) { - error ("Loop %d's latch does not belong directly to it.", i); + error ("loop %d's latch does not belong directly to it", i); err = 1; } } if (loop->header->loop_father != loop) { - error ("Loop %d's header does not belong directly to it.", i); + error ("loop %d's header does not belong directly to it", i); err = 1; } if ((loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) && (loop_latch_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP)) { - error ("Loop %d's latch is marked as part of irreducible region.", i); + error ("loop %d's latch is marked as part of irreducible region", i); err = 1; } } @@ -1210,11 +1151,12 @@ verify_loop_structure (struct loops *loops) irreds = sbitmap_alloc (last_basic_block); FOR_EACH_BB (bb) { + edge_iterator ei; if (bb->flags & BB_IRREDUCIBLE_LOOP) SET_BIT (irreds, bb->index); else RESET_BIT (irreds, bb->index); - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) if (e->flags & EDGE_IRREDUCIBLE_LOOP) e->flags |= EDGE_ALL_FLAGS + 1; } @@ -1225,31 +1167,33 @@ verify_loop_structure (struct loops *loops) /* Compare. */ FOR_EACH_BB (bb) { + edge_iterator ei; + if ((bb->flags & BB_IRREDUCIBLE_LOOP) && !TEST_BIT (irreds, bb->index)) { - error ("Basic block %d should be marked irreducible.", bb->index); + error ("basic block %d should be marked irreducible", bb->index); err = 1; } else if (!(bb->flags & BB_IRREDUCIBLE_LOOP) && TEST_BIT (irreds, bb->index)) { - error ("Basic block %d should not be marked irreducible.", bb->index); + error ("basic block %d should not be marked irreducible", bb->index); err = 1; } - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if ((e->flags & EDGE_IRREDUCIBLE_LOOP) && !(e->flags & (EDGE_ALL_FLAGS + 1))) { - error ("Edge from %d to %d should be marked irreducible.", + error ("edge from %d to %d should be marked irreducible", e->src->index, e->dest->index); err = 1; } else if (!(e->flags & EDGE_IRREDUCIBLE_LOOP) && (e->flags & (EDGE_ALL_FLAGS + 1))) { - error ("Edge from %d to %d should not be marked irreducible.", + error ("edge from %d to %d should not be marked irreducible", e->src->index, e->dest->index); err = 1; } @@ -1259,20 +1203,78 @@ verify_loop_structure (struct loops *loops) free (irreds); } - if (err) - abort (); + /* Check the single_exit. */ + if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS) + { + memset (sizes, 0, sizeof (unsigned) * loops->num); + FOR_EACH_BB (bb) + { + edge_iterator ei; + if (bb->loop_father == loops->tree_root) + continue; + FOR_EACH_EDGE (e, ei, bb->succs) + { + if (e->dest == EXIT_BLOCK_PTR) + continue; + + if (flow_bb_inside_loop_p (bb->loop_father, e->dest)) + continue; + + for (loop = bb->loop_father; + loop != e->dest->loop_father; + loop = loop->outer) + { + sizes[loop->num]++; + if (loop->single_exit + && loop->single_exit != e) + { + error ("wrong single exit %d->%d recorded for loop %d", + loop->single_exit->src->index, + loop->single_exit->dest->index, + loop->num); + error ("right exit is %d->%d", + e->src->index, e->dest->index); + err = 1; + } + } + } + } + + for (i = 1; i < loops->num; i++) + { + loop = loops->parray[i]; + if (!loop) + continue; + + if (sizes[i] == 1 + && !loop->single_exit) + { + error ("single exit not recorded for loop %d", loop->num); + err = 1; + } + + if (sizes[i] != 1 + && loop->single_exit) + { + error ("loop %d should not have single exit (%d -> %d)", + loop->num, + loop->single_exit->src->index, + loop->single_exit->dest->index); + err = 1; + } + } + } + + gcc_assert (!err); + + free (sizes); } /* Returns latch edge of LOOP. */ edge loop_latch_edge (const struct loop *loop) { - edge e; - - for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next) - continue; - - return e; + return find_edge (loop->latch, loop->header); } /* Returns preheader edge of LOOP. */ @@ -1280,9 +1282,20 @@ edge loop_preheader_edge (const struct loop *loop) { edge e; + edge_iterator ei; - for (e = loop->header->pred; e->src == loop->latch; e = e->pred_next) - continue; + FOR_EACH_EDGE (e, ei, loop->header->preds) + if (e->src != loop->latch) + break; return e; } + +/* Returns true if E is an exit of LOOP. */ + +bool +loop_exit_edge_p (const struct loop *loop, edge e) +{ + return (flow_bb_inside_loop_p (loop, e->src) + && !flow_bb_inside_loop_p (loop, e->dest)); +} diff --git a/contrib/gcc/cfgloop.h b/contrib/gcc/cfgloop.h index 33e906d6a6b..6838677011e 100644 --- a/contrib/gcc/cfgloop.h +++ b/contrib/gcc/cfgloop.h @@ -1,5 +1,5 @@ /* Natural loop functions - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,15 @@ for more details. 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. */ + +#ifndef GCC_CFGLOOP_H +#define GCC_CFGLOOP_H + +#include "basic-block.h" +/* For rtx_code. */ +#include "rtl.h" /* Structure to hold decision about unrolling/peeling. */ enum lpt_dec @@ -36,27 +43,16 @@ struct lpt_decision unsigned times; }; -/* Description of loop for simple loop unrolling. */ -struct loop_desc +/* The structure describing a bound on number of iterations of a loop. */ + +struct nb_iter_bound { - int postincr; /* 1 if increment/decrement is done after loop exit condition. */ - rtx stride; /* Value added to VAR in each iteration. */ - rtx var; /* Loop control variable. */ - enum machine_mode inner_mode; - /* The mode from that it is extended. */ - enum rtx_code extend; /* With this extend. */ - rtx var_alts; /* List of definitions of its initial value. */ - rtx lim; /* Expression var is compared with. */ - rtx lim_alts; /* List of definitions of its initial value. */ - bool const_iter; /* True if it iterates constant number of times. */ - unsigned HOST_WIDE_INT niter; - /* Number of iterations if it is constant. */ - bool may_be_zero; /* If we cannot determine that the first iteration will pass. */ - enum rtx_code cond; /* Exit condition. */ - int neg; /* Set to 1 if loop ends when condition is satisfied. */ - edge out_edge; /* The exit edge. */ - edge in_edge; /* And the other one. */ - int n_branches; /* Number of branches inside the loop. */ + tree bound; /* The constant expression whose value is an upper + bound on the number of executions of ... */ + tree at_stmt; /* ... this statement during one execution of + a loop. */ + struct nb_iter_bound *next; + /* The next bound in a list. */ }; /* Structure to hold information for each natural loop. */ @@ -71,60 +67,18 @@ struct loop /* Basic block of loop latch. */ basic_block latch; - /* Basic block of loop preheader or NULL if it does not exist. */ - basic_block pre_header; - /* For loop unrolling/peeling decision. */ struct lpt_decision lpt_decision; - /* Simple loop description. */ - int simple; - struct loop_desc desc; - int has_desc; - /* Number of loop insns. */ unsigned ninsns; /* Average number of executed insns per iteration. */ unsigned av_ninsns; - /* Array of edges along the preheader extended basic block trace. - The source of the first edge is the root node of preheader - extended basic block, if it exists. */ - edge *pre_header_edges; - - /* Number of edges along the pre_header extended basic block trace. */ - int num_pre_header_edges; - - /* The first block in the loop. This is not necessarily the same as - the loop header. */ - basic_block first; - - /* The last block in the loop. This is not necessarily the same as - the loop latch. */ - basic_block last; - - /* Bitmap of blocks contained within the loop. */ - sbitmap nodes; - /* Number of blocks contained within the loop. */ unsigned num_nodes; - /* Array of edges that enter the loop. */ - edge *entry_edges; - - /* Number of edges that enter the loop. */ - int num_entries; - - /* Array of edges that exit the loop. */ - edge *exit_edges; - - /* Number of edges that exit the loop. */ - int num_exits; - - /* Bitmap of blocks that dominate all exits of the loop. */ - sbitmap exits_doms; - /* The loop nesting depth. */ int depth; @@ -147,55 +101,32 @@ struct loop /* Loop that is copy of this loop. */ struct loop *copy; - /* Nonzero if the loop is invalid (e.g., contains setjmp.). */ - int invalid; - /* Auxiliary info specific to a pass. */ void *aux; - /* The following are currently used by loop.c but they are likely to - disappear as loop.c is converted to use the CFG. */ + /* The probable number of times the loop is executed at runtime. + This is an INTEGER_CST or an expression containing symbolic + names. Don't access this field directly: + number_of_iterations_in_loop computes and caches the computed + information in this field. */ + tree nb_iterations; - /* Nonzero if the loop has a NOTE_INSN_LOOP_VTOP. */ - rtx vtop; + /* An INTEGER_CST estimation of the number of iterations. NULL_TREE + if there is no estimation. */ + tree estimated_nb_iterations; - /* Nonzero if the loop has a NOTE_INSN_LOOP_CONT. - A continue statement will generate a branch to NEXT_INSN (cont). */ - rtx cont; + /* Upper bound on number of iterations of a loop. */ + struct nb_iter_bound *bounds; - /* The dominator of cont. */ - rtx cont_dominator; + /* If not NULL, loop has just single exit edge stored here (edges to the + EXIT_BLOCK_PTR do not count. */ + edge single_exit; - /* The NOTE_INSN_LOOP_BEG. */ - rtx start; - - /* The NOTE_INSN_LOOP_END. */ - rtx end; - - /* For a rotated loop that is entered near the bottom, - this is the label at the top. Otherwise it is zero. */ - rtx top; - - /* Place in the loop where control enters. */ - rtx scan_start; - - /* The position where to sink insns out of the loop. */ - rtx sink; - - /* List of all LABEL_REFs which refer to code labels outside the - loop. Used by routines that need to know all loop exits, such as - final_biv_value and final_giv_value. - - This does not include loop exits due to return instructions. - This is because all bivs and givs are pseudos, and hence must be - dead after a return, so the presence of a return does not affect - any of the optimizations that use this info. It is simpler to - just not include return instructions on this list. */ - rtx exit_labels; - - /* The number of LABEL_REFs on exit_labels for this loop and all - loops nested inside it. */ - int exit_count; + /* True when the loop does not carry data dependences, and + consequently the iterations can be executed in any order. False + when the loop carries data dependences, or when the property is + not decidable. */ + bool parallel_p; }; /* Flags for state of loop structure. */ @@ -203,25 +134,26 @@ enum { LOOPS_HAVE_PREHEADERS = 1, LOOPS_HAVE_SIMPLE_LATCHES = 2, - LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS = 4 + LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS = 4, + LOOPS_HAVE_MARKED_SINGLE_EXITS = 8 }; +#define LOOPS_NORMAL (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES \ + | LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) + /* Structure to hold CFG information about natural loops within a function. */ struct loops { /* Number of natural loops in the function. */ unsigned num; - /* Maximum nested loop level in the function. */ - unsigned levels; + /* State of loops. */ + int state; - /* Array of natural loop descriptors (scanning this array in reverse order - will find the inner loops before their enclosing outer loops). */ - struct loop *array; - - /* The above array is unused in new loop infrastructure and is kept only for - purposes of the old loop optimizer. Instead we store just pointers to - loops here. */ + /* We store just pointers to loops here. + Note that a loop in this array may actually be NULL, if the loop + has been removed and the entire loops structure has not been + recomputed since that time. */ struct loop **parray; /* Pointer to root of loop hierarchy tree. */ @@ -240,45 +172,45 @@ struct loops /* Headers shared by multiple loops that should be merged. */ sbitmap shared_headers; - - /* State of loops. */ - int state; }; -/* Flags for loop discovery. */ +/* The loop tree currently optimized. */ -#define LOOP_TREE 1 /* Build loop hierarchy tree. */ -#define LOOP_PRE_HEADER 2 /* Analyze loop preheader. */ -#define LOOP_ENTRY_EDGES 4 /* Find entry edges. */ -#define LOOP_EXIT_EDGES 8 /* Find exit edges. */ -#define LOOP_EDGES (LOOP_ENTRY_EDGES | LOOP_EXIT_EDGES) -#define LOOP_ALL 15 /* All of the above */ +extern struct loops *current_loops; /* Loop recognition. */ -extern int flow_loops_find (struct loops *, int flags); -extern int flow_loops_update (struct loops *, int flags); +extern int flow_loops_find (struct loops *); extern void flow_loops_free (struct loops *); extern void flow_loops_dump (const struct loops *, FILE *, void (*)(const struct loop *, FILE *, int), int); extern void flow_loop_dump (const struct loop *, FILE *, void (*)(const struct loop *, FILE *, int), int); -extern int flow_loop_scan (struct loop *, int); extern void flow_loop_free (struct loop *); +int flow_loop_nodes_find (basic_block, struct loop *); +void fix_loop_structure (struct loops *, bitmap changed_bbs); void mark_irreducible_loops (struct loops *); +void mark_single_exit_loops (struct loops *); /* Loop data structure manipulation/querying. */ extern void flow_loop_tree_node_add (struct loop *, struct loop *); extern void flow_loop_tree_node_remove (struct loop *); -extern bool flow_loop_outside_edge_p (const struct loop *, edge); extern bool flow_loop_nested_p (const struct loop *, const struct loop *); extern bool flow_bb_inside_loop_p (const struct loop *, const basic_block); extern struct loop * find_common_loop (struct loop *, struct loop *); +struct loop *superloop_at_depth (struct loop *, unsigned); +extern unsigned tree_num_loop_insns (struct loop *); extern int num_loop_insns (struct loop *); extern int average_num_loop_insns (struct loop *); +extern unsigned get_loop_level (const struct loop *); +extern bool loop_exit_edge_p (const struct loop *, edge); +extern void mark_loop_exit_edges (struct loops *); /* Loops & cfg manipulation. */ extern basic_block *get_loop_body (const struct loop *); +extern basic_block *get_loop_body_in_dom_order (const struct loop *); +extern basic_block *get_loop_body_in_bfs_order (const struct loop *); extern edge *get_loop_exit_edges (const struct loop *, unsigned *); +extern unsigned num_loop_branches (const struct loop *); extern edge loop_preheader_edge (const struct loop *); extern edge loop_latch_edge (const struct loop *); @@ -286,7 +218,6 @@ extern edge loop_latch_edge (const struct loop *); extern void add_bb_to_loop (basic_block, struct loop *); extern void remove_bb_from_loops (basic_block); -extern void cancel_loop (struct loops *, struct loop *); extern void cancel_loop_tree (struct loops *, struct loop *); extern basic_block loop_split_edge_with (edge, rtx); @@ -303,28 +234,156 @@ extern void force_single_succ_latches (struct loops *); extern void verify_loop_structure (struct loops *); /* Loop analysis. */ -extern bool simple_loop_p (struct loop *, struct loop_desc *); -extern rtx count_loop_iterations (struct loop_desc *, rtx, rtx); -extern bool just_once_each_iteration_p (struct loop *, basic_block); +extern bool just_once_each_iteration_p (const struct loop *, basic_block); extern unsigned expected_loop_iterations (const struct loop *); +extern rtx doloop_condition_get (rtx); /* Loop manipulation. */ extern bool can_duplicate_loop_p (struct loop *loop); #define DLTHE_FLAG_UPDATE_FREQ 1 /* Update frequencies in duplicate_loop_to_header_edge. */ +#define DLTHE_RECORD_COPY_NUMBER 2 /* Record copy number in the aux + field of newly create BB. */ +#define DLTHE_FLAG_COMPLETTE_PEEL 4 /* Update frequencies expecting + a complete peeling. */ -extern int duplicate_loop_to_header_edge (struct loop *, edge, struct loops *, - unsigned, sbitmap, edge, edge *, - unsigned *, int); -extern struct loop *loopify (struct loops *, edge, edge, basic_block); -extern void unloop (struct loops *, struct loop *); +extern struct loop * duplicate_loop (struct loops *, struct loop *, + struct loop *); +extern bool duplicate_loop_to_header_edge (struct loop *, edge, struct loops *, + unsigned, sbitmap, edge, edge *, + unsigned *, int); +extern struct loop *loopify (struct loops *, edge, edge, + basic_block, edge, edge, bool); +struct loop * loop_version (struct loops *, struct loop *, void *, + basic_block *, bool); extern bool remove_path (struct loops *, edge); -extern edge split_loop_bb (basic_block, rtx); + +/* Induction variable analysis. */ + +/* The description of induction variable. The things are a bit complicated + due to need to handle subregs and extends. The value of the object described + by it can be obtained as follows (all computations are done in extend_mode): + + Value in i-th iteration is + delta + mult * extend_{extend_mode} (subreg_{mode} (base + i * step)). + + If first_special is true, the value in the first iteration is + delta + mult * base + + If extend = UNKNOWN, first_special must be false, delta 0, mult 1 and value is + subreg_{mode} (base + i * step) + + The get_iv_value function can be used to obtain these expressions. + + ??? Add a third mode field that would specify the mode in that inner + computation is done, which would enable it to be different from the + outer one? */ + +struct rtx_iv +{ + /* Its base and step (mode of base and step is supposed to be extend_mode, + see the description above). */ + rtx base, step; + + /* The type of extend applied to it (SIGN_EXTEND, ZERO_EXTEND or UNKNOWN). */ + enum rtx_code extend; + + /* Operations applied in the extended mode. */ + rtx delta, mult; + + /* The mode it is extended to. */ + enum machine_mode extend_mode; + + /* The mode the variable iterates in. */ + enum machine_mode mode; + + /* Whether the first iteration needs to be handled specially. */ + unsigned first_special : 1; +}; + +/* The description of an exit from the loop and of the number of iterations + till we take the exit. */ + +struct niter_desc +{ + /* The edge out of the loop. */ + edge out_edge; + + /* The other edge leading from the condition. */ + edge in_edge; + + /* True if we are able to say anything about number of iterations of the + loop. */ + bool simple_p; + + /* True if the loop iterates the constant number of times. */ + bool const_iter; + + /* Number of iterations if constant. */ + unsigned HOST_WIDEST_INT niter; + + /* Upper bound on the number of iterations. */ + unsigned HOST_WIDEST_INT niter_max; + + /* Assumptions under that the rest of the information is valid. */ + rtx assumptions; + + /* Assumptions under that the loop ends before reaching the latch, + even if value of niter_expr says otherwise. */ + rtx noloop_assumptions; + + /* Condition under that the loop is infinite. */ + rtx infinite; + + /* Whether the comparison is signed. */ + bool signed_p; + + /* The mode in that niter_expr should be computed. */ + enum machine_mode mode; + + /* The number of iterations of the loop. */ + rtx niter_expr; +}; + +extern void iv_analysis_loop_init (struct loop *); +extern bool iv_analyze (rtx, rtx, struct rtx_iv *); +extern bool iv_analyze_result (rtx, rtx, struct rtx_iv *); +extern bool iv_analyze_expr (rtx, rtx, enum machine_mode, struct rtx_iv *); +extern rtx get_iv_value (struct rtx_iv *, rtx); +extern bool biv_p (rtx, rtx); +extern void find_simple_exit (struct loop *, struct niter_desc *); +extern void iv_analysis_done (void); +extern struct df *iv_current_loop_df (void); + +extern struct niter_desc *get_simple_loop_desc (struct loop *loop); +extern void free_simple_loop_desc (struct loop *loop); + +static inline struct niter_desc * +simple_loop_desc (struct loop *loop) +{ + return (struct niter_desc *) loop->aux; +} + +/* The properties of the target. */ + +extern unsigned target_avail_regs; /* Number of available registers. */ +extern unsigned target_res_regs; /* Number of reserved registers. */ +extern unsigned target_small_cost; /* The cost for register when there + is a free one. */ +extern unsigned target_pres_cost; /* The cost for register when there are + not too many free ones. */ +extern unsigned target_spill_cost; /* The cost for register when we need + to spill. */ + +/* Register pressure estimation for induction variable optimizations & loop + invariant motion. */ +extern unsigned global_cost_for_size (unsigned, unsigned, unsigned); +extern void init_set_costs (void); /* Loop optimizer initialization. */ -extern struct loops *loop_optimizer_init (FILE *); -extern void loop_optimizer_finalize (struct loops *, FILE *); +extern struct loops *loop_optimizer_init (unsigned); +extern void loop_optimizer_finalize (struct loops *); /* Optimization passes. */ extern void unswitch_loops (struct loops *); @@ -337,5 +396,8 @@ enum }; extern void unroll_and_peel_loops (struct loops *, int); -extern bool is_bct_cond (rtx); -extern rtx get_var_set_from_bct (rtx); +extern void doloop_optimize_loops (struct loops *); +extern void move_loop_invariants (struct loops *); +extern void record_estimate (struct loop *, tree, tree, tree); + +#endif /* GCC_CFGLOOP_H */ diff --git a/contrib/gcc/cfgloopanal.c b/contrib/gcc/cfgloopanal.c index 6cc8f66c87a..da545838436 100644 --- a/contrib/gcc/cfgloopanal.c +++ b/contrib/gcc/cfgloopanal.c @@ -1,5 +1,5 @@ /* Natural loop analysis code for GNU compiler. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -24,57 +24,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" #include "hard-reg-set.h" +#include "obstack.h" #include "basic-block.h" #include "cfgloop.h" #include "expr.h" #include "output.h" -/* Needed for doloop_condition_get(). */ -#include "loop.h" - -struct unmark_altered_insn_data; -static void unmark_altered (rtx, rtx, regset); -static void blocks_invariant_registers (basic_block *, int, regset); -static void unmark_altered_insn (rtx, rtx, struct unmark_altered_insn_data *); -static void blocks_single_set_registers (basic_block *, int, rtx *); -static int invariant_rtx_wrto_regs_p_helper (rtx *, regset); -static bool invariant_rtx_wrto_regs_p (rtx, regset); -static rtx test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT); -static bool constant_iterations (struct loop_desc *, unsigned HOST_WIDE_INT *, - bool *); -static bool simple_loop_exit_p (struct loop *, edge, regset, - rtx *, struct loop_desc *); -static rtx variable_initial_value (rtx, regset, rtx, rtx *, enum machine_mode); -static rtx variable_initial_values (edge, rtx, enum machine_mode); -static bool simple_condition_p (struct loop *, rtx, regset, - struct loop_desc *); -static basic_block simple_increment (struct loop *, rtx *, struct loop_desc *); -static rtx count_strange_loop_iterations (rtx, rtx, enum rtx_code, - int, rtx, enum machine_mode, - enum machine_mode); -static unsigned HOST_WIDEST_INT inverse (unsigned HOST_WIDEST_INT, int); -static bool fits_in_mode_p (enum machine_mode mode, rtx expr); - -/* Computes inverse to X modulo (1 << MOD). */ -static unsigned HOST_WIDEST_INT -inverse (unsigned HOST_WIDEST_INT x, int mod) -{ - unsigned HOST_WIDEST_INT mask = - ((unsigned HOST_WIDEST_INT) 1 << (mod - 1) << 1) - 1; - unsigned HOST_WIDEST_INT rslt = 1; - int i; - - for (i = 0; i < mod - 1; i++) - { - rslt = (rslt * x) & mask; - x = (x * x) & mask; - } - - return rslt; -} /* Checks whether BB is executed exactly once in each LOOP iteration. */ + bool -just_once_each_iteration_p (struct loop *loop, basic_block bb) +just_once_each_iteration_p (const struct loop *loop, basic_block bb) { /* It must be executed at least once each iteration. */ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb)) @@ -91,1038 +50,207 @@ just_once_each_iteration_p (struct loop *loop, basic_block bb) return true; } +/* Structure representing edge of a graph. */ -/* Unmarks modified registers; helper to blocks_invariant_registers. */ -static void -unmark_altered (rtx what, rtx by ATTRIBUTE_UNUSED, regset regs) +struct edge { - if (GET_CODE (what) == SUBREG) - what = SUBREG_REG (what); - if (!REG_P (what)) - return; - CLEAR_REGNO_REG_SET (regs, REGNO (what)); -} - -/* Marks registers that are invariant inside blocks BBS. */ -static void -blocks_invariant_registers (basic_block *bbs, int nbbs, regset regs) -{ - rtx insn; - int i; - - for (i = 0; i < max_reg_num (); i++) - SET_REGNO_REG_SET (regs, i); - for (i = 0; i < nbbs; i++) - for (insn = BB_HEAD (bbs[i]); - insn != NEXT_INSN (BB_END (bbs[i])); - insn = NEXT_INSN (insn)) - if (INSN_P (insn)) - note_stores (PATTERN (insn), - (void (*) (rtx, rtx, void *)) unmark_altered, - regs); -} - -/* Unmarks modified registers; helper to blocks_single_set_registers. */ -struct unmark_altered_insn_data -{ - rtx *regs; - rtx insn; + int src, dest; /* Source and destination. */ + struct edge *pred_next, *succ_next; + /* Next edge in predecessor and successor lists. */ + void *data; /* Data attached to the edge. */ }; -static void -unmark_altered_insn (rtx what, rtx by ATTRIBUTE_UNUSED, - struct unmark_altered_insn_data *data) -{ - int rn; +/* Structure representing vertex of a graph. */ - if (GET_CODE (what) == SUBREG) - what = SUBREG_REG (what); - if (!REG_P (what)) - return; - rn = REGNO (what); - if (data->regs[rn] == data->insn) - return; - data->regs[rn] = NULL; -} - -/* Marks registers that have just single simple set in BBS; the relevant - insn is returned in REGS. */ -static void -blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs) +struct vertex +{ + struct edge *pred, *succ; + /* Lists of predecessors and successors. */ + int component; /* Number of dfs restarts before reaching the + vertex. */ + int post; /* Postorder number. */ +}; + +/* Structure representing a graph. */ + +struct graph +{ + int n_vertices; /* Number of vertices. */ + struct vertex *vertices; + /* The vertices. */ +}; + +/* Dumps graph G into F. */ + +extern void dump_graph (FILE *, struct graph *); + +void +dump_graph (FILE *f, struct graph *g) { - rtx insn; int i; - struct unmark_altered_insn_data data; + struct edge *e; - for (i = 0; i < max_reg_num (); i++) - regs[i] = NULL; - - for (i = 0; i < nbbs; i++) - for (insn = BB_HEAD (bbs[i]); - insn != NEXT_INSN (BB_END (bbs[i])); - insn = NEXT_INSN (insn)) - { - rtx set = single_set (insn); - - if (!set && is_bct_cond (insn)) - set = get_var_set_from_bct(insn); - - if (!set) - continue; - if (!REG_P (SET_DEST (set))) - continue; - regs[REGNO (SET_DEST (set))] = insn; - } - - data.regs = regs; - for (i = 0; i < nbbs; i++) - for (insn = BB_HEAD (bbs[i]); - insn != NEXT_INSN (BB_END (bbs[i])); - insn = NEXT_INSN (insn)) - { - if (!INSN_P (insn)) - continue; - data.insn = insn; - note_stores (PATTERN (insn), - (void (*) (rtx, rtx, void *)) unmark_altered_insn, - &data); - } -} - -/* Helper for invariant_rtx_wrto_regs_p. */ -static int -invariant_rtx_wrto_regs_p_helper (rtx *expr, regset invariant_regs) -{ - switch (GET_CODE (*expr)) + for (i = 0; i < g->n_vertices; i++) { - case CC0: - case PC: - case UNSPEC_VOLATILE: - return 1; - - case CONST_INT: - case CONST_DOUBLE: - case CONST: - case SYMBOL_REF: - case LABEL_REF: - return 0; - - case ASM_OPERANDS: - return MEM_VOLATILE_P (*expr); - - case MEM: - /* If the memory is not constant, assume it is modified. If it is - constant, we still have to check the address. */ - return !RTX_UNCHANGING_P (*expr); - - case REG: - return !REGNO_REG_SET_P (invariant_regs, REGNO (*expr)); - - default: - return 0; - } -} - -/* Checks that EXPR is invariant provided that INVARIANT_REGS are invariant. */ -static bool -invariant_rtx_wrto_regs_p (rtx expr, regset invariant_regs) -{ - return !for_each_rtx (&expr, (rtx_function) invariant_rtx_wrto_regs_p_helper, - invariant_regs); -} - -/* Checks whether CONDITION is a simple comparison in that one of operands - is register and the other one is invariant in the LOOP. Fills var, lim - and cond fields in DESC. */ -static bool -simple_condition_p (struct loop *loop ATTRIBUTE_UNUSED, rtx condition, - regset invariant_regs, struct loop_desc *desc) -{ - rtx op0, op1; - - /* Check condition. */ - switch (GET_CODE (condition)) - { - case EQ: - case NE: - case LE: - case LT: - case GE: - case GT: - case GEU: - case GTU: - case LEU: - case LTU: - break; - default: - return false; - } - - /* Of integers or pointers. */ - if (GET_MODE_CLASS (GET_MODE (XEXP (condition, 0))) != MODE_INT - && GET_MODE_CLASS (GET_MODE (XEXP (condition, 0))) != MODE_PARTIAL_INT) - return false; - - /* One of operands must be a simple register. */ - op0 = XEXP (condition, 0); - op1 = XEXP (condition, 1); - - /* One of operands must be invariant. */ - if (invariant_rtx_wrto_regs_p (op0, invariant_regs)) - { - /* And the other one must be a register. */ - if (!REG_P (op1)) - return false; - desc->var = op1; - desc->lim = op0; - - desc->cond = swap_condition (GET_CODE (condition)); - if (desc->cond == UNKNOWN) - return false; - return true; - } - - /* Check the other operand. */ - if (!invariant_rtx_wrto_regs_p (op1, invariant_regs)) - return false; - if (!REG_P (op0)) - return false; - - desc->var = op0; - desc->lim = op1; - - desc->cond = GET_CODE (condition); - - return true; -} - -/* Checks whether DESC->var is incremented/decremented exactly once each - iteration. Fills in DESC->stride and returns block in that DESC->var is - modified. */ -static basic_block -simple_increment (struct loop *loop, rtx *simple_increment_regs, - struct loop_desc *desc) -{ - rtx mod_insn, mod_insn1, set, set_src, set_add; - basic_block mod_bb, mod_bb1; - - /* Find insn that modifies var. */ - mod_insn = simple_increment_regs[REGNO (desc->var)]; - if (!mod_insn) - return NULL; - mod_bb = BLOCK_FOR_INSN (mod_insn); - - /* Check that it is executed exactly once each iteration. */ - if (!just_once_each_iteration_p (loop, mod_bb)) - return NULL; - - /* mod_insn must be a simple increment/decrement. */ - set = single_set (mod_insn); - - if (!set && is_bct_cond (mod_insn)) - set = get_var_set_from_bct(mod_insn); - - if (!set) - abort (); - if (!rtx_equal_p (SET_DEST (set), desc->var)) - abort (); - - set_src = find_reg_equal_equiv_note (mod_insn); - if (!set_src) - set_src = SET_SRC (set); - - /* Check for variables that iterate in narrower mode. */ - if (GET_CODE (set_src) == SIGN_EXTEND - || GET_CODE (set_src) == ZERO_EXTEND) - { - /* If we are sign extending variable that is then compared unsigned - or vice versa, there is something weird happening. */ - if (desc->cond != EQ - && desc->cond != NE - && ((desc->cond == LEU - || desc->cond == LTU - || desc->cond == GEU - || desc->cond == GTU) - ^ (GET_CODE (set_src) == ZERO_EXTEND))) - return NULL; - - if (GET_CODE (XEXP (set_src, 0)) != SUBREG - || SUBREG_BYTE (XEXP (set_src, 0)) != 0 - || GET_MODE (SUBREG_REG (XEXP (set_src, 0))) != GET_MODE (desc->var)) - return NULL; - - desc->inner_mode = GET_MODE (XEXP (set_src, 0)); - desc->extend = GET_CODE (set_src); - set_src = SUBREG_REG (XEXP (set_src, 0)); - - if (GET_CODE (set_src) != REG) - return NULL; - - /* Find where the reg is set. */ - mod_insn1 = simple_increment_regs[REGNO (set_src)]; - if (!mod_insn1) - return NULL; - - mod_bb1 = BLOCK_FOR_INSN (mod_insn1); - if (!dominated_by_p (CDI_DOMINATORS, mod_bb, mod_bb1)) - return NULL; - if (mod_bb1 == mod_bb) - { - for (; - mod_insn != PREV_INSN (BB_HEAD (mod_bb)); - mod_insn = PREV_INSN (mod_insn)) - if (mod_insn == mod_insn1) - break; - - if (mod_insn == PREV_INSN (BB_HEAD (mod_bb))) - return NULL; - } - - /* Replace the source with the possible place of increment. */ - set = single_set (mod_insn1); - if (!set) - abort (); - if (!rtx_equal_p (SET_DEST (set), set_src)) - abort (); - - set_src = find_reg_equal_equiv_note (mod_insn1); - if (!set_src) - set_src = SET_SRC (set); - } - else - { - desc->inner_mode = GET_MODE (desc->var); - desc->extend = NIL; - } - - if (GET_CODE (set_src) != PLUS) - return NULL; - if (!rtx_equal_p (XEXP (set_src, 0), desc->var)) - return NULL; - - /* Set desc->stride. */ - set_add = XEXP (set_src, 1); - if (CONSTANT_P (set_add)) - desc->stride = set_add; - else - return NULL; - - return mod_bb; -} - -/* Tries to find initial value of VAR in INSN. This value must be invariant - wrto INVARIANT_REGS. If SET_INSN is not NULL, insn in that var is set is - placed here. INNER_MODE is mode in that induction variable VAR iterates. */ -static rtx -variable_initial_value (rtx insn, regset invariant_regs, - rtx var, rtx *set_insn, enum machine_mode inner_mode) -{ - basic_block bb; - rtx set; - rtx ret = NULL; - - /* Go back through cfg. */ - bb = BLOCK_FOR_INSN (insn); - while (1) - { - for (; insn != BB_HEAD (bb); insn = PREV_INSN (insn)) - { - if (INSN_P (insn)) - note_stores (PATTERN (insn), - (void (*) (rtx, rtx, void *)) unmark_altered, - invariant_regs); - if (modified_between_p (var, PREV_INSN (insn), NEXT_INSN (insn))) - break; - } - - if (insn != BB_HEAD (bb)) - { - /* We found place where var is set. */ - rtx set_dest; - rtx val; - rtx note; - - set = single_set (insn); - if (!set) - return NULL; - set_dest = SET_DEST (set); - if (!rtx_equal_p (set_dest, var)) - return NULL; - - note = find_reg_equal_equiv_note (insn); - if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST) - val = XEXP (note, 0); - else - val = SET_SRC (set); - - /* If we know that the initial value is indeed in range of - the inner mode, record the fact even in case the value itself - is useless. */ - if ((GET_CODE (val) == SIGN_EXTEND - || GET_CODE (val) == ZERO_EXTEND) - && GET_MODE (XEXP (val, 0)) == inner_mode) - ret = gen_rtx_fmt_e (GET_CODE (val), - GET_MODE (var), - gen_rtx_fmt_ei (SUBREG, - inner_mode, - var, 0)); - - if (!invariant_rtx_wrto_regs_p (val, invariant_regs)) - return ret; - - if (set_insn) - *set_insn = insn; - return val; - } - - - if (bb->pred->pred_next || bb->pred->src == ENTRY_BLOCK_PTR) - return NULL; - - bb = bb->pred->src; - insn = BB_END (bb); - } - - return NULL; -} - -/* Returns list of definitions of initial value of VAR at edge E. INNER_MODE - is mode in that induction variable VAR really iterates. */ -static rtx -variable_initial_values (edge e, rtx var, enum machine_mode inner_mode) -{ - rtx set_insn, list; - regset invariant_regs; - regset_head invariant_regs_head; - int i; - - invariant_regs = INITIALIZE_REG_SET (invariant_regs_head); - for (i = 0; i < max_reg_num (); i++) - SET_REGNO_REG_SET (invariant_regs, i); - - list = alloc_EXPR_LIST (0, copy_rtx (var), NULL); - - if (e->src == ENTRY_BLOCK_PTR) - return list; - - set_insn = BB_END (e->src); - while (REG_P (var) - && (var = variable_initial_value (set_insn, invariant_regs, var, - &set_insn, inner_mode))) - list = alloc_EXPR_LIST (0, copy_rtx (var), list); - - FREE_REG_SET (invariant_regs); - return list; -} - -/* Counts constant number of iterations of the loop described by DESC; - returns false if impossible. */ -static bool -constant_iterations (struct loop_desc *desc, unsigned HOST_WIDE_INT *niter, - bool *may_be_zero) -{ - rtx test, expr; - rtx ainit, alim; - - test = test_for_iteration (desc, 0); - if (test == const0_rtx) - { - *niter = 0; - *may_be_zero = false; - return true; - } - - *may_be_zero = (test != const_true_rtx); - - /* It would make a little sense to check every with every when we - know that all but the first alternative are simply registers. */ - for (ainit = desc->var_alts; ainit; ainit = XEXP (ainit, 1)) - { - alim = XEXP (desc->lim_alts, 0); - if (!(expr = count_loop_iterations (desc, XEXP (ainit, 0), alim))) + if (!g->vertices[i].pred + && !g->vertices[i].succ) continue; - if (GET_CODE (expr) == CONST_INT) - { - *niter = INTVAL (expr); - return true; - } + + fprintf (f, "%d (%d)\t<-", i, g->vertices[i].component); + for (e = g->vertices[i].pred; e; e = e->pred_next) + fprintf (f, " %d", e->src); + fprintf (f, "\n"); + + fprintf (f, "\t->"); + for (e = g->vertices[i].succ; e; e = e->succ_next) + fprintf (f, " %d", e->dest); + fprintf (f, "\n"); } - for (alim = XEXP (desc->lim_alts, 1); alim; alim = XEXP (alim, 1)) +} + +/* Creates a new graph with N_VERTICES vertices. */ + +static struct graph * +new_graph (int n_vertices) +{ + struct graph *g = XNEW (struct graph); + + g->n_vertices = n_vertices; + g->vertices = XCNEWVEC (struct vertex, n_vertices); + + return g; +} + +/* Adds an edge from F to T to graph G, with DATA attached. */ + +static void +add_edge (struct graph *g, int f, int t, void *data) +{ + struct edge *e = xmalloc (sizeof (struct edge)); + + e->src = f; + e->dest = t; + e->data = data; + + e->pred_next = g->vertices[t].pred; + g->vertices[t].pred = e; + + e->succ_next = g->vertices[f].succ; + g->vertices[f].succ = e; +} + +/* Runs dfs search over vertices of G, from NQ vertices in queue QS. + The vertices in postorder are stored into QT. If FORWARD is false, + backward dfs is run. */ + +static void +dfs (struct graph *g, int *qs, int nq, int *qt, bool forward) +{ + int i, tick = 0, v, comp = 0, top; + struct edge *e; + struct edge **stack = xmalloc (sizeof (struct edge *) * g->n_vertices); + + for (i = 0; i < g->n_vertices; i++) { - ainit = XEXP (desc->var_alts, 0); - if (!(expr = count_loop_iterations (desc, ainit, XEXP (alim, 0)))) + g->vertices[i].component = -1; + g->vertices[i].post = -1; + } + +#define FST_EDGE(V) (forward ? g->vertices[(V)].succ : g->vertices[(V)].pred) +#define NEXT_EDGE(E) (forward ? (E)->succ_next : (E)->pred_next) +#define EDGE_SRC(E) (forward ? (E)->src : (E)->dest) +#define EDGE_DEST(E) (forward ? (E)->dest : (E)->src) + + for (i = 0; i < nq; i++) + { + v = qs[i]; + if (g->vertices[v].post != -1) continue; - if (GET_CODE (expr) == CONST_INT) + + g->vertices[v].component = comp++; + e = FST_EDGE (v); + top = 0; + + while (1) { - *niter = INTVAL (expr); - return true; - } - } + while (e && g->vertices[EDGE_DEST (e)].component != -1) + e = NEXT_EDGE (e); - return false; -} + if (!e) + { + if (qt) + qt[tick] = v; + g->vertices[v].post = tick++; -/* Attempts to determine a number of iterations of a "strange" loop. - Its induction variable starts with value INIT, is compared by COND - with LIM. If POSTINCR, it is incremented after the test. It is incremented - by STRIDE each iteration, has mode MODE but iterates in INNER_MODE. + if (!top) + break; - By "strange" we mean loops where induction variable increases in the wrong - direction wrto comparison, i.e. for (i = 6; i > 5; i++). */ -static rtx -count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond, - int postincr, rtx stride, enum machine_mode mode, - enum machine_mode inner_mode) -{ - rtx rqmt, n_to_wrap, before_wrap, after_wrap; - rtx mode_min, mode_max; - int size; - - /* This could be handled, but it is not important enough to lose time with - it just now. */ - if (mode != inner_mode) - return NULL_RTX; - - if (!postincr) - init = simplify_gen_binary (PLUS, mode, init, stride); - - /* If we are able to prove that we don't pass the first test, we are - done. */ - rqmt = simplify_relational_operation (cond, mode, init, lim); - if (rqmt == const0_rtx) - return const0_rtx; - - /* And if we don't know we pass it, the things are too complicated for us. */ - if (rqmt != const_true_rtx) - return NULL_RTX; - - switch (cond) - { - case GE: - case GT: - case LE: - case LT: - size = GET_MODE_BITSIZE (mode); - mode_min = gen_int_mode (-((unsigned HOST_WIDEST_INT) 1 << (size - 1)), - mode); - mode_max = gen_int_mode (((unsigned HOST_WIDEST_INT) 1 << (size - 1)) - 1, - mode); - - break; - - case GEU: - case GTU: - case LEU: - case LTU: - case EQ: - mode_min = const0_rtx; - mode_max = simplify_gen_binary (MINUS, mode, const0_rtx, const1_rtx); - break; - - default: - abort (); - } - - switch (cond) - { - case EQ: - /* This iterates once, as init == lim. */ - return const1_rtx; - - /* The behavior is undefined in signed cases. Never mind, we still - try to behave sanely. */ - case GE: - case GT: - case GEU: - case GTU: - if (INTVAL (stride) <= 0) - abort (); - n_to_wrap = simplify_gen_binary (MINUS, mode, mode_max, copy_rtx (init)); - n_to_wrap = simplify_gen_binary (UDIV, mode, n_to_wrap, stride); - before_wrap = simplify_gen_binary (MULT, mode, - copy_rtx (n_to_wrap), stride); - before_wrap = simplify_gen_binary (PLUS, mode, - before_wrap, copy_rtx (init)); - after_wrap = simplify_gen_binary (PLUS, mode, - before_wrap, stride); - if (GET_CODE (after_wrap) != CONST_INT) - { - after_wrap = simplify_gen_binary (PLUS, mode, mode_min, stride); - after_wrap = simplify_gen_binary (MINUS, mode, after_wrap, const1_rtx); - } - break; - - case LE: - case LT: - case LEU: - case LTU: - if (INTVAL (stride) >= 0) - abort (); - stride = simplify_gen_unary (NEG, mode, stride, mode); - n_to_wrap = simplify_gen_binary (MINUS, mode, copy_rtx (init), mode_min); - n_to_wrap = simplify_gen_binary (UDIV, mode, n_to_wrap, stride); - before_wrap = simplify_gen_binary (MULT, mode, - copy_rtx (n_to_wrap), stride); - before_wrap = simplify_gen_binary (MINUS, mode, - copy_rtx (init), before_wrap); - after_wrap = simplify_gen_binary (MINUS, mode, - before_wrap, stride); - if (GET_CODE (after_wrap) != CONST_INT) - { - after_wrap = simplify_gen_binary (MINUS, mode, mode_max, stride); - after_wrap = simplify_gen_binary (PLUS, mode, after_wrap, const1_rtx); - } - break; - default: - abort (); - } - - /* If this is const_true_rtx and we did not take a conservative approximation - of after_wrap above, we might iterate the calculation (but of course we - would have to take care about infinite cases). Ignore this for now. */ - rqmt = simplify_relational_operation (cond, mode, after_wrap, lim); - if (rqmt != const0_rtx) - return NULL_RTX; - - return simplify_gen_binary (PLUS, mode, n_to_wrap, const1_rtx); -} - -/* Checks whether value of EXPR fits into range of MODE. */ -static bool -fits_in_mode_p (enum machine_mode mode, rtx expr) -{ - unsigned HOST_WIDEST_INT val; - int n_bits = 0; - - if (GET_CODE (expr) == CONST_INT) - { - for (val = INTVAL (expr); val; val >>= 1) - n_bits++; - - return n_bits <= GET_MODE_BITSIZE (mode); - } - - if (GET_CODE (expr) == SIGN_EXTEND - || GET_CODE (expr) == ZERO_EXTEND) - return GET_MODE (XEXP (expr, 0)) == mode; - - return false; -} - -/* Return RTX expression representing number of iterations of loop as bounded - by test described by DESC (in the case loop really has multiple exit - edges, fewer iterations may happen in the practice). - - Return NULL if it is unknown. Additionally the value may be invalid for - paradoxical loop (lets define paradoxical loops as loops whose test is - failing at -1th iteration, for instance "for (i=5;i<1;i++);"). - - These cases needs to be either cared by copying the loop test in the front - of loop or keeping the test in first iteration of loop. - - When INIT/LIM are set, they are used instead of var/lim of DESC. */ -rtx -count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim) -{ - enum rtx_code cond = desc->cond; - rtx stride = desc->stride; - rtx mod, exp, ainit, bound; - rtx overflow_check, mx, mxp; - enum machine_mode mode = GET_MODE (desc->var); - unsigned HOST_WIDEST_INT s, size, d; - - /* Give up on floating point modes and friends. It can be possible to do - the job for constant loop bounds, but it is probably not worthwhile. */ - if (!INTEGRAL_MODE_P (mode)) - return NULL; - - init = copy_rtx (init ? init : desc->var); - lim = copy_rtx (lim ? lim : desc->lim); - - /* Ensure that we always handle the condition to stay inside loop. */ - if (desc->neg) - cond = reverse_condition (cond); - - if (desc->inner_mode != mode) - { - /* We have a case when the variable in fact iterates in the narrower - mode. This has following consequences: - - For induction variable itself, if !desc->postincr, it does not mean - anything too special, since we know the variable is already in range - of the inner mode when we compare it (so it is just needed to shorten - it into the mode before calculations are done, so that we don't risk - wrong results). More complicated case is when desc->postincr; then - the first two iterations are special (the first one because the value - may be out of range, the second one because after shortening it to the - range it may have absolutely any value), and we do not handle this in - unrolling. So if we aren't able to prove that the initial value is in - the range, we fail in this case. - - Step is just moduled to fit into inner mode. - - If lim is out of range, then either the loop is infinite (and then - we may unroll however we like to), or exits in the first iteration - (this is also ok, since we handle it specially for this case anyway). - So we may safely assume that it fits into the inner mode. */ - - for (ainit = desc->var_alts; ainit; ainit = XEXP (ainit, 1)) - if (fits_in_mode_p (desc->inner_mode, XEXP (ainit, 0))) - break; - - if (!ainit) - { - if (desc->postincr) - return NULL_RTX; - - init = simplify_gen_unary (desc->extend, - mode, - simplify_gen_subreg (desc->inner_mode, - init, - mode, - 0), - desc->inner_mode); - } - - stride = simplify_gen_subreg (desc->inner_mode, stride, mode, 0); - if (stride == const0_rtx) - return NULL_RTX; - } - - /* Prepare condition to verify that we do not risk overflow. */ - if (stride == const1_rtx - || stride == constm1_rtx - || cond == NE - || cond == EQ) - { - /* Overflow at NE conditions does not occur. EQ condition - is weird and is handled in count_strange_loop_iterations. - If stride is 1, overflow may occur only for <= and >= conditions, - and then they are infinite, so it does not bother us. */ - overflow_check = const0_rtx; - } - else - { - if (cond == LT || cond == LTU) - mx = simplify_gen_binary (MINUS, mode, lim, const1_rtx); - else if (cond == GT || cond == GTU) - mx = simplify_gen_binary (PLUS, mode, lim, const1_rtx); - else - mx = lim; - if (mode != desc->inner_mode) - mxp = simplify_gen_subreg (desc->inner_mode, mx, mode, 0); - else - mxp = mx; - mxp = simplify_gen_binary (PLUS, desc->inner_mode, mxp, stride); - if (mode != desc->inner_mode) - mxp = simplify_gen_unary (desc->extend, mode, mxp, desc->inner_mode); - overflow_check = simplify_gen_relational (cond, SImode, mode, mx, mxp); - } - - /* Compute absolute value of the difference of initial and final value. */ - if (INTVAL (stride) > 0) - { - /* Handle strange tests specially. */ - if (cond == EQ || cond == GE || cond == GT || cond == GEU - || cond == GTU) - return count_strange_loop_iterations (init, lim, cond, desc->postincr, - stride, mode, desc->inner_mode); - exp = simplify_gen_binary (MINUS, mode, lim, init); - } - else - { - if (cond == EQ || cond == LE || cond == LT || cond == LEU - || cond == LTU) - return count_strange_loop_iterations (init, lim, cond, desc->postincr, - stride, mode, desc->inner_mode); - exp = simplify_gen_binary (MINUS, mode, init, lim); - stride = simplify_gen_unary (NEG, mode, stride, mode); - } - - /* If there is a risk of overflow (i.e. when we increment value satisfying - a condition, we may again obtain a value satisfying the condition), - fail. */ - if (overflow_check != const0_rtx) - return NULL_RTX; - - /* Normalize difference so the value is always first examined - and later incremented. Do not do this for a loop ending with a branch - and count register. */ - if (!is_bct_cond (BB_END (desc->out_edge->src)) && (!desc->postincr)) - exp = simplify_gen_binary (MINUS, mode, exp, stride); - - /* Determine delta caused by exit condition. */ - switch (cond) - { - case NE: - /* NE tests are easy to handle, because we just perform simple - arithmetics modulo power of 2. Let's use the fact to compute the - number of iterations exactly. We are now in situation when we want to - solve an equation stride * i = c (mod size of inner_mode). - Let nsd (stride, size of mode) = d. If d does not divide c, the - loop is infinite. Otherwise, the number of iterations is - (inverse(s/d) * (c/d)) mod (size of mode/d). */ - size = GET_MODE_BITSIZE (desc->inner_mode); - s = INTVAL (stride); - d = 1; - while (s % 2 != 1) - { - s /= 2; - d *= 2; - size--; - } - bound = gen_int_mode (((unsigned HOST_WIDEST_INT) 1 << (size - 1 ) << 1) - 1, - mode); - exp = simplify_gen_binary (UDIV, mode, exp, gen_int_mode (d, mode)); - exp = simplify_gen_binary (MULT, mode, - exp, gen_int_mode (inverse (s, size), mode)); - exp = simplify_gen_binary (AND, mode, exp, bound); - break; - - case LT: - case GT: - case LTU: - case GTU: - break; - case LE: - case GE: - case LEU: - case GEU: - exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx); - break; - default: - abort (); - } - - if (cond != NE && stride != const1_rtx) - { - /* Number of iterations is now (EXP + STRIDE - 1 / STRIDE), - but we need to take care for overflows. */ - - mod = simplify_gen_binary (UMOD, mode, exp, stride); - - /* This is dirty trick. When we can't compute number of iterations - to be constant, we simply ignore the possible overflow, as - runtime unroller always use power of 2 amounts and does not - care about possible lost bits. */ - - if (GET_CODE (mod) != CONST_INT) - { - rtx stridem1 = simplify_gen_binary (PLUS, mode, stride, constm1_rtx); - exp = simplify_gen_binary (PLUS, mode, exp, stridem1); - exp = simplify_gen_binary (UDIV, mode, exp, stride); - } - else - { - exp = simplify_gen_binary (UDIV, mode, exp, stride); - if (mod != const0_rtx) - exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx); - } - } - - if (rtl_dump_file) - { - fprintf (rtl_dump_file, "; Number of iterations: "); - print_simple_rtl (rtl_dump_file, exp); - fprintf (rtl_dump_file, "\n"); - } - - return exp; -} - -/* Return simplified RTX expression representing the value of test - described of DESC at given iteration of loop. */ - -static rtx -test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT iter) -{ - enum rtx_code cond = desc->cond; - rtx exp = XEXP (desc->var_alts, 0); - rtx addval; - - /* Give up on floating point modes and friends. It can be possible to do - the job for constant loop bounds, but it is probably not worthwhile. */ - if (!INTEGRAL_MODE_P (GET_MODE (desc->var))) - return NULL; - - /* Ensure that we always handle the condition to stay inside loop. */ - if (desc->neg) - cond = reverse_condition (cond); - - /* Compute the value of induction variable. */ - addval = simplify_gen_binary (MULT, GET_MODE (desc->var), - desc->stride, - gen_int_mode (desc->postincr - ? iter : iter + 1, - GET_MODE (desc->var))); - exp = simplify_gen_binary (PLUS, GET_MODE (desc->var), exp, addval); - /* Test at given condition. */ - exp = simplify_gen_relational (cond, SImode, - GET_MODE (desc->var), exp, desc->lim); - - if (rtl_dump_file) - { - fprintf (rtl_dump_file, "; Conditional to continue loop at " - HOST_WIDE_INT_PRINT_UNSIGNED "th iteration: ", iter); - print_simple_rtl (rtl_dump_file, exp); - fprintf (rtl_dump_file, "\n"); - } - return exp; -} - - -/* Tests whether exit at EXIT_EDGE from LOOP is simple. Returns simple loop - description joined to it in in DESC. INVARIANT_REGS and SINGLE_SET_REGS - are results of blocks_{invariant,single_set}_regs over BODY. */ -static bool -simple_loop_exit_p (struct loop *loop, edge exit_edge, - regset invariant_regs, rtx *single_set_regs, - struct loop_desc *desc) -{ - basic_block mod_bb, exit_bb; - int fallthru_out; - rtx condition; - edge ei, e; - - exit_bb = exit_edge->src; - - fallthru_out = (exit_edge->flags & EDGE_FALLTHRU); - - if (!exit_bb) - return false; - - /* It must be tested (at least) once during any iteration. */ - if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit_bb)) - return false; - - /* It must end in a simple conditional jump. */ - if (!any_condjump_p (BB_END (exit_bb))) - return false; - - ei = exit_bb->succ; - if (ei == exit_edge) - ei = ei->succ_next; - - desc->out_edge = exit_edge; - desc->in_edge = ei; - - /* Condition must be a simple comparison in that one of operands - is register and the other one is invariant. */ - if (!(condition = get_condition (BB_END (exit_bb), NULL, false))) - return false; - - if (!simple_condition_p (loop, condition, invariant_regs, desc)) - return false; - - /* Var must be simply incremented or decremented in exactly one insn that - is executed just once every iteration. */ - if (!(mod_bb = simple_increment (loop, single_set_regs, desc))) - return false; - - /* OK, it is simple loop. Now just fill in remaining info. */ - desc->postincr = !dominated_by_p (CDI_DOMINATORS, exit_bb, mod_bb); - desc->neg = !fallthru_out; - - /* Find initial value of var and alternative values for lim. */ - e = loop_preheader_edge (loop); - desc->var_alts = variable_initial_values (e, desc->var, desc->inner_mode); - desc->lim_alts = variable_initial_values (e, desc->lim, desc->inner_mode); - - /* Number of iterations. */ - desc->const_iter = - constant_iterations (desc, &desc->niter, &desc->may_be_zero); - if (!desc->const_iter && !count_loop_iterations (desc, NULL, NULL)) - return false; - return true; -} - -/* Tests whether LOOP is simple for loop. Returns simple loop description - in DESC. */ -bool -simple_loop_p (struct loop *loop, struct loop_desc *desc) -{ - unsigned i; - basic_block *body; - edge e; - struct loop_desc act; - bool any = false; - regset invariant_regs; - regset_head invariant_regs_head; - rtx *single_set_regs; - int n_branches; - - body = get_loop_body (loop); - - invariant_regs = INITIALIZE_REG_SET (invariant_regs_head); - single_set_regs = xmalloc (max_reg_num () * sizeof (rtx)); - - blocks_invariant_registers (body, loop->num_nodes, invariant_regs); - blocks_single_set_registers (body, loop->num_nodes, single_set_regs); - - n_branches = 0; - for (i = 0; i < loop->num_nodes; i++) - { - for (e = body[i]->succ; e; e = e->succ_next) - if (!flow_bb_inside_loop_p (loop, e->dest) - && simple_loop_exit_p (loop, e, - invariant_regs, single_set_regs, &act)) - { - /* Prefer constant iterations; the less the better. */ - if (!any) - any = true; - else if (!act.const_iter - || (desc->const_iter && act.niter >= desc->niter)) + e = stack[--top]; + v = EDGE_SRC (e); + e = NEXT_EDGE (e); continue; - *desc = act; - } + } - if (body[i]->succ && body[i]->succ->succ_next) - n_branches++; - } - desc->n_branches = n_branches; - - if (rtl_dump_file && any) - { - fprintf (rtl_dump_file, "; Simple loop %i\n", loop->num); - if (desc->postincr) - fprintf (rtl_dump_file, - "; does postincrement after loop exit condition\n"); - - fprintf (rtl_dump_file, "; Induction variable:"); - print_simple_rtl (rtl_dump_file, desc->var); - fputc ('\n', rtl_dump_file); - - fprintf (rtl_dump_file, "; Initial values:"); - print_simple_rtl (rtl_dump_file, desc->var_alts); - fputc ('\n', rtl_dump_file); - - fprintf (rtl_dump_file, "; Stride:"); - print_simple_rtl (rtl_dump_file, desc->stride); - fputc ('\n', rtl_dump_file); - - fprintf (rtl_dump_file, "; Compared with:"); - print_simple_rtl (rtl_dump_file, desc->lim); - fputc ('\n', rtl_dump_file); - - fprintf (rtl_dump_file, "; Alternative values:"); - print_simple_rtl (rtl_dump_file, desc->lim_alts); - fputc ('\n', rtl_dump_file); - - fprintf (rtl_dump_file, "; Exit condition:"); - if (desc->neg) - fprintf (rtl_dump_file, "(negated)"); - fprintf (rtl_dump_file, "%s\n", GET_RTX_NAME (desc->cond)); - - fprintf (rtl_dump_file, "; Number of branches:"); - fprintf (rtl_dump_file, "%d\n", desc->n_branches); - - fputc ('\n', rtl_dump_file); + stack[top++] = e; + v = EDGE_DEST (e); + e = FST_EDGE (v); + g->vertices[v].component = comp - 1; + } } - free (body); - FREE_REG_SET (invariant_regs); - free (single_set_regs); - return any; + free (stack); +} + +/* Marks the edge E in graph G irreducible if it connects two vertices in the + same scc. */ + +static void +check_irred (struct graph *g, struct edge *e) +{ + edge real = e->data; + + /* All edges should lead from a component with higher number to the + one with lower one. */ + gcc_assert (g->vertices[e->src].component >= g->vertices[e->dest].component); + + if (g->vertices[e->src].component != g->vertices[e->dest].component) + return; + + real->flags |= EDGE_IRREDUCIBLE_LOOP; + if (flow_bb_inside_loop_p (real->src->loop_father, real->dest)) + real->src->flags |= BB_IRREDUCIBLE_LOOP; +} + +/* Runs CALLBACK for all edges in G. */ + +static void +for_each_edge (struct graph *g, + void (callback) (struct graph *, struct edge *)) +{ + struct edge *e; + int i; + + for (i = 0; i < g->n_vertices; i++) + for (e = g->vertices[i].succ; e; e = e->succ_next) + callback (g, e); +} + +/* Releases the memory occupied by G. */ + +static void +free_graph (struct graph *g) +{ + struct edge *e, *n; + int i; + + for (i = 0; i < g->n_vertices; i++) + for (e = g->vertices[i].succ; e; e = n) + { + n = e->succ_next; + free (e); + } + free (g->vertices); + free (g); } /* Marks blocks and edges that are part of non-recognized loops; i.e. we @@ -1130,196 +258,102 @@ simple_loop_p (struct loop *loop, struct loop_desc *desc) Everything is a bit complicated due to fact we do not want to do this for parts of cycles that only "pass" through some loop -- i.e. for each cycle, we want to mark blocks that belong directly to innermost - loop containing the whole cycle. */ + loop containing the whole cycle. + + LOOPS is the loop tree. */ + +#define LOOP_REPR(LOOP) ((LOOP)->num + last_basic_block) +#define BB_REPR(BB) ((BB)->index + 1) + void mark_irreducible_loops (struct loops *loops) { - int *dfs_in, *closed, *mr, *mri, *n_edges, *stack; - unsigned i; - edge **edges, e; - edge *estack; basic_block act; - int stack_top, tick, depth; + edge e; + edge_iterator ei; + int i, src, dest; + struct graph *g; + int *queue1 = XNEWVEC (int, last_basic_block + loops->num); + int *queue2 = XNEWVEC (int, last_basic_block + loops->num); + int nq, depth; struct loop *cloop; /* Reset the flags. */ FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { act->flags &= ~BB_IRREDUCIBLE_LOOP; - for (e = act->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, act->succs) e->flags &= ~EDGE_IRREDUCIBLE_LOOP; } - /* The first last_basic_block + 1 entries are for real blocks (including - entry); then we have loops->num - 1 fake blocks for loops to that we - assign edges leading from loops (fake loop 0 is not interesting). */ - dfs_in = xmalloc ((last_basic_block + loops->num) * sizeof (int)); - closed = xmalloc ((last_basic_block + loops->num) * sizeof (int)); - mr = xmalloc ((last_basic_block + loops->num) * sizeof (int)); - mri = xmalloc ((last_basic_block + loops->num) * sizeof (int)); - n_edges = xmalloc ((last_basic_block + loops->num) * sizeof (int)); - edges = xmalloc ((last_basic_block + loops->num) * sizeof (edge *)); - stack = xmalloc ((n_basic_blocks + loops->num) * sizeof (int)); - estack = xmalloc ((n_basic_blocks + loops->num) * sizeof (edge)); - /* Create the edge lists. */ - for (i = 0; i < last_basic_block + loops->num; i++) - n_edges[i] = 0; + g = new_graph (last_basic_block + loops->num); + FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - for (e = act->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, act->succs) { - /* Ignore edges to exit. */ - if (e->dest == EXIT_BLOCK_PTR) + /* Ignore edges to exit. */ + if (e->dest == EXIT_BLOCK_PTR) continue; + /* And latch edges. */ if (e->dest->loop_father->header == e->dest && e->dest->loop_father->latch == act) continue; + /* Edges inside a single loop should be left where they are. Edges to subloop headers should lead to representative of the subloop, - but from the same place. */ - if (act->loop_father == e->dest->loop_father - || act->loop_father == e->dest->loop_father->outer) - { - n_edges[act->index + 1]++; - continue; - } - /* Edges exiting loops remain. They should lead from representative + but from the same place. + + Edges exiting loops should lead from representative of the son of nearest common ancestor of the loops in that act lays. */ - depth = find_common_loop (act->loop_father, e->dest->loop_father)->depth + 1; - if (depth == act->loop_father->depth) - cloop = act->loop_father; - else - cloop = act->loop_father->pred[depth]; - n_edges[cloop->num + last_basic_block]++; - } - for (i = 0; i < last_basic_block + loops->num; i++) - { - edges[i] = xmalloc (n_edges[i] * sizeof (edge)); - n_edges[i] = 0; - } + src = BB_REPR (act); + dest = BB_REPR (e->dest); - FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - for (e = act->succ; e; e = e->succ_next) - { - if (e->dest == EXIT_BLOCK_PTR) - continue; - if (e->dest->loop_father->header == e->dest - && e->dest->loop_father->latch == act) - continue; - if (act->loop_father == e->dest->loop_father - || act->loop_father == e->dest->loop_father->outer) + if (e->dest->loop_father->header == e->dest) + dest = LOOP_REPR (e->dest->loop_father); + + if (!flow_bb_inside_loop_p (act->loop_father, e->dest)) { - edges[act->index + 1][n_edges[act->index + 1]++] = e; - continue; + depth = find_common_loop (act->loop_father, + e->dest->loop_father)->depth + 1; + if (depth == act->loop_father->depth) + cloop = act->loop_father; + else + cloop = act->loop_father->pred[depth]; + + src = LOOP_REPR (cloop); } - depth = find_common_loop (act->loop_father, e->dest->loop_father)->depth + 1; - if (depth == act->loop_father->depth) - cloop = act->loop_father; - else - cloop = act->loop_father->pred[depth]; - i = cloop->num + last_basic_block; - edges[i][n_edges[i]++] = e; + + add_edge (g, src, dest, e); } - /* Compute dfs numbering, starting from loop headers, and mark found - loops. */ - tick = 0; - for (i = 0; i < last_basic_block + loops->num; i++) + /* Find the strongly connected components. Use the algorithm of Tarjan -- + first determine the postorder dfs numbering in reversed graph, then + run the dfs on the original graph in the order given by decreasing + numbers assigned by the previous pass. */ + nq = 0; + FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - dfs_in[i] = -1; - closed[i] = 0; - mr[i] = last_basic_block + loops->num; - mri[i] = -1; + queue1[nq++] = BB_REPR (act); } - - stack_top = 0; - for (i = 0; i < loops->num; i++) + for (i = 1; i < (int) loops->num; i++) if (loops->parray[i]) - { - stack[stack_top] = loops->parray[i]->header->index + 1; - estack[stack_top] = NULL; - stack_top++; - } + queue1[nq++] = LOOP_REPR (loops->parray[i]); + dfs (g, queue1, nq, queue2, false); + for (i = 0; i < nq; i++) + queue1[i] = queue2[nq - i - 1]; + dfs (g, queue1, nq, NULL, true); - while (stack_top) - { - int idx, sidx; + /* Mark the irreducible loops. */ + for_each_edge (g, check_irred); - idx = stack[stack_top - 1]; - if (dfs_in[idx] < 0) - dfs_in[idx] = tick++; + free_graph (g); + free (queue1); + free (queue2); - while (n_edges[idx]) - { - e = edges[idx][--n_edges[idx]]; - sidx = e->dest->loop_father->header == e->dest - ? e->dest->loop_father->num + last_basic_block - : e->dest->index + 1; - if (closed[sidx]) - { - if (mri[sidx] != -1 && !closed[mri[sidx]]) - { - if (mr[sidx] < mr[idx]) - { - mr[idx] = mr[sidx]; - mri[idx] = mri[sidx]; - } - - if (mr[sidx] <= dfs_in[idx]) - e->flags |= EDGE_IRREDUCIBLE_LOOP; - } - continue; - } - if (dfs_in[sidx] < 0) - { - stack[stack_top] = sidx; - estack[stack_top] = e; - stack_top++; - goto next; - } - if (dfs_in[sidx] < mr[idx]) - { - mr[idx] = dfs_in[sidx]; - mri[idx] = sidx; - } - e->flags |= EDGE_IRREDUCIBLE_LOOP; - } - - /* Return back. */ - closed[idx] = 1; - e = estack[stack_top - 1]; - stack_top--; - if (e) - { - /* Propagate information back. */ - sidx = stack[stack_top - 1]; - if (mr[sidx] > mr[idx]) - { - mr[sidx] = mr[idx]; - mri[sidx] = mri[idx]; - } - if (mr[idx] <= dfs_in[sidx]) - e->flags |= EDGE_IRREDUCIBLE_LOOP; - } - /* Mark the block if relevant. */ - if (idx && idx <= last_basic_block && mr[idx] <= dfs_in[idx]) - BASIC_BLOCK (idx - 1)->flags |= BB_IRREDUCIBLE_LOOP; -next:; - } - - free (stack); - free (estack); - free (dfs_in); - free (closed); - free (mr); - free (mri); - for (i = 0; i < last_basic_block + loops->num; i++) - free (edges[i]); - free (edges); - free (n_edges); loops->state |= LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS; } @@ -1385,24 +419,25 @@ unsigned expected_loop_iterations (const struct loop *loop) { edge e; + edge_iterator ei; - if (loop->header->count) + if (loop->latch->count || loop->header->count) { gcov_type count_in, count_latch, expected; count_in = 0; count_latch = 0; - for (e = loop->header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, loop->header->preds) if (e->src == loop->latch) count_latch = e->count; else count_in += e->count; if (count_in == 0) - return 0; - - expected = (count_latch + count_in - 1) / count_in; + expected = count_latch * 2; + else + expected = (count_latch + count_in - 1) / count_in; /* Avoid overflows. */ return (expected > REG_BR_PROB_BASE ? REG_BR_PROB_BASE : expected); @@ -1414,69 +449,147 @@ expected_loop_iterations (const struct loop *loop) freq_in = 0; freq_latch = 0; - for (e = loop->header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, loop->header->preds) if (e->src == loop->latch) freq_latch = EDGE_FREQUENCY (e); else freq_in += EDGE_FREQUENCY (e); if (freq_in == 0) - return 0; + return freq_latch * 2; return (freq_latch + freq_in - 1) / freq_in; } } -/* This function checks if an instruction is a branch and count instruction - no matter if the flag HAVE_doloop_end is enabled or not. An alternative - would be the modification of doloop_condition_get function itself. */ -bool -is_bct_cond (rtx insn) +/* Returns the maximum level of nesting of subloops of LOOP. */ + +unsigned +get_loop_level (const struct loop *loop) { - if (GET_CODE (insn) != JUMP_INSN) - return false; + const struct loop *ploop; + unsigned mx = 0, l; -#ifdef HAVE_doloop_end - if (!doloop_condition_get (PATTERN(insn))) - return false; -#else - return false; -#endif - - return true; + for (ploop = loop->inner; ploop; ploop = ploop->next) + { + l = get_loop_level (ploop); + if (l >= mx) + mx = l + 1; + } + return mx; } -/* Extract the increment of the count register from the branch and count - instruction. */ -rtx -get_var_set_from_bct (rtx insn) +/* Returns estimate on cost of computing SEQ. */ + +static unsigned +seq_cost (rtx seq) { - rtx rhs, lhs, cond; - rtx pattern; + unsigned cost = 0; rtx set; - pattern = PATTERN (insn); - if (!is_bct_cond (insn)) - abort (); + for (; seq; seq = NEXT_INSN (seq)) + { + set = single_set (seq); + if (set) + cost += rtx_cost (set, SET); + else + cost++; + } - set = XVECEXP (pattern, 0, 1); - - /* IA64 has the decrement conditional, i.e. done only when the loop does not - end. We match (set (x (if_then_else (ne x 0) (plus x -1) x))) here. */ - - lhs = XEXP (set, 0); - rhs = XEXP (set, 1); - if (GET_CODE (set) != IF_THEN_ELSE) - return set; - - cond = XEXP (rhs, 0); - if (GET_CODE (cond) != NE - || !rtx_equal_p (XEXP (cond, 0), lhs) - || !rtx_equal_p (XEXP (cond, 1), const0_rtx)) - return set; - - rhs = XEXP (rhs, 1); - - return gen_rtx_SET (GET_MODE (lhs), lhs, rhs); + return cost; +} + +/* The properties of the target. */ + +unsigned target_avail_regs; /* Number of available registers. */ +unsigned target_res_regs; /* Number of reserved registers. */ +unsigned target_small_cost; /* The cost for register when there is a free one. */ +unsigned target_pres_cost; /* The cost for register when there are not too many + free ones. */ +unsigned target_spill_cost; /* The cost for register when we need to spill. */ + +/* Initialize the constants for computing set costs. */ + +void +init_set_costs (void) +{ + rtx seq; + rtx reg1 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER); + rtx reg2 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER + 1); + rtx addr = gen_raw_REG (Pmode, FIRST_PSEUDO_REGISTER + 2); + rtx mem = validize_mem (gen_rtx_MEM (SImode, addr)); + unsigned i; + + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i) + && !fixed_regs[i]) + target_avail_regs++; + + target_res_regs = 3; + + /* These are really just heuristic values. */ + + start_sequence (); + emit_move_insn (reg1, reg2); + seq = get_insns (); + end_sequence (); + target_small_cost = seq_cost (seq); + target_pres_cost = 2 * target_small_cost; + + start_sequence (); + emit_move_insn (mem, reg1); + emit_move_insn (reg2, mem); + seq = get_insns (); + end_sequence (); + target_spill_cost = seq_cost (seq); +} + +/* Calculates cost for having SIZE new loop global variables. REGS_USED is the + number of global registers used in loop. N_USES is the number of relevant + variable uses. */ + +unsigned +global_cost_for_size (unsigned size, unsigned regs_used, unsigned n_uses) +{ + unsigned regs_needed = regs_used + size; + unsigned cost = 0; + + if (regs_needed + target_res_regs <= target_avail_regs) + cost += target_small_cost * size; + else if (regs_needed <= target_avail_regs) + cost += target_pres_cost * size; + else + { + cost += target_pres_cost * size; + cost += target_spill_cost * n_uses * (regs_needed - target_avail_regs) / regs_needed; + } + + return cost; +} + +/* Sets EDGE_LOOP_EXIT flag for all exits of LOOPS. */ + +void +mark_loop_exit_edges (struct loops *loops) +{ + basic_block bb; + edge e; + + if (loops->num <= 1) + return; + + FOR_EACH_BB (bb) + { + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->succs) + { + if (bb->loop_father->outer + && loop_exit_edge_p (bb->loop_father, e)) + e->flags |= EDGE_LOOP_EXIT; + else + e->flags &= ~EDGE_LOOP_EXIT; + } + } } diff --git a/contrib/gcc/cfgloopmanip.c b/contrib/gcc/cfgloopmanip.c index 6a877d83f51..638b2996584 100644 --- a/contrib/gcc/cfgloopmanip.c +++ b/contrib/gcc/cfgloopmanip.c @@ -1,5 +1,5 @@ /* Loop manipulation code for GNU compiler. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -24,13 +24,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm.h" #include "rtl.h" #include "hard-reg-set.h" +#include "obstack.h" #include "basic-block.h" #include "cfgloop.h" #include "cfglayout.h" +#include "cfghooks.h" #include "output.h" -static struct loop * duplicate_loop (struct loops *, struct loop *, - struct loop *); static void duplicate_subloops (struct loops *, struct loop *, struct loop *); static void copy_loops_to (struct loops *, struct loop **, int, struct loop *); @@ -41,35 +41,15 @@ static bool rpe_enum_p (basic_block, void *); static int find_path (edge, basic_block **); static bool alp_enum_p (basic_block, void *); static void add_loop (struct loops *, struct loop *); -static void fix_loop_placements (struct loops *, struct loop *); +static void fix_loop_placements (struct loops *, struct loop *, bool *); static bool fix_bb_placement (struct loops *, basic_block); -static void fix_bb_placements (struct loops *, basic_block); +static void fix_bb_placements (struct loops *, basic_block, bool *); static void place_new_loop (struct loops *, struct loop *); static void scale_loop_frequencies (struct loop *, int, int); -static void scale_bbs_frequencies (basic_block *, int, int, int); static basic_block create_preheader (struct loop *, int); -static void fix_irreducible_loops (basic_block); +static void unloop (struct loops *, struct loop *, bool *); -/* Splits basic block BB after INSN, returns created edge. Updates loops - and dominators. */ -edge -split_loop_bb (basic_block bb, rtx insn) -{ - edge e; - - /* Split the block. */ - e = split_block (bb, insn); - - /* Add dest to loop. */ - add_bb_to_loop (e->dest, e->src->loop_father); - - /* Fix dominators. */ - add_to_dominance_info (CDI_DOMINATORS, e->dest); - redirect_immediate_dominators (CDI_DOMINATORS, e->src, e->dest); - set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); - - return e; -} +#define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) /* Checks whether basic block BB is dominated by DATA. */ static bool @@ -88,8 +68,7 @@ remove_bbs (basic_block *bbs, int nbbs) for (i = 0; i < nbbs; i++) { remove_bb_from_loops (bbs[i]); - delete_from_dominance_info (CDI_DOMINATORS, bbs[i]); - delete_block (bbs[i]); + delete_basic_block (bbs[i]); } } @@ -102,11 +81,10 @@ remove_bbs (basic_block *bbs, int nbbs) static int find_path (edge e, basic_block **bbs) { - if (e->dest->pred->pred_next) - abort (); + gcc_assert (EDGE_COUNT (e->dest->preds) <= 1); /* Find bbs in the path. */ - *bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); + *bbs = XCNEWVEC (basic_block, n_basic_blocks); return dfs_enumerate_from (e->dest, 0, rpe_enum_p, *bbs, n_basic_blocks, e->dest); } @@ -122,9 +100,10 @@ static bool fix_bb_placement (struct loops *loops, basic_block bb) { edge e; + edge_iterator ei; struct loop *loop = loops->tree_root, *act; - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if (e->dest == EXIT_BLOCK_PTR) continue; @@ -153,9 +132,14 @@ fix_bb_placement (struct loops *loops, basic_block bb) its predecessors that may change if placement of FROM changed. Also fix placement of subloops of FROM->loop_father, that might also be altered due to this change; the condition for them is similar, except that instead of - successors we consider edges coming out of the loops. */ + successors we consider edges coming out of the loops. + + If the changes may invalidate the information about irreducible regions, + IRRED_INVALIDATED is set to true. */ + static void -fix_bb_placements (struct loops *loops, basic_block from) +fix_bb_placements (struct loops *loops, basic_block from, + bool *irred_invalidated) { sbitmap in_queue; basic_block *queue, *qtop, *qbeg, *qend; @@ -179,7 +163,7 @@ fix_bb_placements (struct loops *loops, basic_block from) /* Prevent us from going out of the base_loop. */ SET_BIT (in_queue, base_loop->header->index); - queue = xmalloc ((base_loop->num_nodes + 1) * sizeof (basic_block)); + queue = XNEWVEC (basic_block, base_loop->num_nodes + 1); qtop = queue + base_loop->num_nodes + 1; qbeg = queue; qend = queue + 1; @@ -187,6 +171,7 @@ fix_bb_placements (struct loops *loops, basic_block from) while (qbeg != qend) { + edge_iterator ei; from = *qbeg; qbeg++; if (qbeg == qtop) @@ -206,12 +191,21 @@ fix_bb_placements (struct loops *loops, basic_block from) continue; } + FOR_EACH_EDGE (e, ei, from->succs) + { + if (e->flags & EDGE_IRREDUCIBLE_LOOP) + *irred_invalidated = true; + } + /* Something has changed, insert predecessors into queue. */ - for (e = from->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, from->preds) { basic_block pred = e->src; struct loop *nca; + if (e->flags & EDGE_IRREDUCIBLE_LOOP) + *irred_invalidated = true; + if (TEST_BIT (in_queue, pred->index)) continue; @@ -244,78 +238,6 @@ fix_bb_placements (struct loops *loops, basic_block from) free (queue); } -/* Basic block from has lost one or more of its predecessors, so it might - mo longer be part irreducible loop. Fix it and proceed recursively - for its successors if needed. */ -static void -fix_irreducible_loops (basic_block from) -{ - basic_block bb; - basic_block *stack; - int stack_top; - sbitmap on_stack; - edge *edges, e; - unsigned n_edges, i; - - if (!(from->flags & BB_IRREDUCIBLE_LOOP)) - return; - - on_stack = sbitmap_alloc (last_basic_block); - sbitmap_zero (on_stack); - SET_BIT (on_stack, from->index); - stack = xmalloc (from->loop_father->num_nodes * sizeof (basic_block)); - stack[0] = from; - stack_top = 1; - - while (stack_top) - { - bb = stack[--stack_top]; - RESET_BIT (on_stack, bb->index); - - for (e = bb->pred; e; e = e->pred_next) - if (e->flags & EDGE_IRREDUCIBLE_LOOP) - break; - if (e) - continue; - - bb->flags &= ~BB_IRREDUCIBLE_LOOP; - if (bb->loop_father->header == bb) - edges = get_loop_exit_edges (bb->loop_father, &n_edges); - else - { - n_edges = 0; - for (e = bb->succ; e; e = e->succ_next) - n_edges++; - edges = xmalloc (n_edges * sizeof (edge)); - n_edges = 0; - for (e = bb->succ; e; e = e->succ_next) - edges[n_edges++] = e; - } - - for (i = 0; i < n_edges; i++) - { - e = edges[i]; - - if (e->flags & EDGE_IRREDUCIBLE_LOOP) - { - if (!flow_bb_inside_loop_p (from->loop_father, e->dest)) - continue; - - e->flags &= ~EDGE_IRREDUCIBLE_LOOP; - if (TEST_BIT (on_stack, e->dest->index)) - continue; - - SET_BIT (on_stack, e->dest->index); - stack[stack_top++] = e->dest; - } - } - free (edges); - } - - free (on_stack); - free (stack); -} - /* Removes path beginning at edge E, i.e. remove basic blocks dominated by E and update loop structure stored in LOOPS and dominators. Return true if we were able to remove the path, false otherwise (and nothing is affected @@ -327,16 +249,25 @@ remove_path (struct loops *loops, edge e) basic_block *rem_bbs, *bord_bbs, *dom_bbs, from, bb; int i, nrem, n_bord_bbs, n_dom_bbs; sbitmap seen; + bool deleted, irred_invalidated = false; if (!loop_delete_branch_edge (e, 0)) return false; + /* Keep track of whether we need to update information about irreducible + regions. This is the case if the removed area is a part of the + irreducible region, or if the set of basic blocks that belong to a loop + that is inside an irreducible region is changed, or if such a loop is + removed. */ + if (e->flags & EDGE_IRREDUCIBLE_LOOP) + irred_invalidated = true; + /* We need to check whether basic blocks are dominated by the edge e, but we only have basic block dominators. This is easy to fix -- when e->dest has exactly one predecessor, this corresponds to blocks dominated by e->dest, if not, split the edge. */ - if (e->dest->pred->pred_next) - e = loop_split_edge_with (e, NULL_RTX)->pred; + if (!single_pred_p (e->dest)) + e = single_pred_edge (loop_split_edge_with (e, NULL_RTX)); /* It may happen that by removing path we remove one or more loops we belong to. In this case first unloop the loops, then proceed @@ -345,13 +276,13 @@ remove_path (struct loops *loops, edge e) while (e->src->loop_father->outer && dominated_by_p (CDI_DOMINATORS, e->src->loop_father->latch, e->dest)) - unloop (loops, e->src->loop_father); + unloop (loops, e->src->loop_father, &irred_invalidated); /* Identify the path. */ nrem = find_path (e, &rem_bbs); n_bord_bbs = 0; - bord_bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); + bord_bbs = XCNEWVEC (basic_block, n_basic_blocks); seen = sbitmap_alloc (last_basic_block); sbitmap_zero (seen); @@ -360,20 +291,24 @@ remove_path (struct loops *loops, edge e) SET_BIT (seen, rem_bbs[i]->index); for (i = 0; i < nrem; i++) { + edge_iterator ei; bb = rem_bbs[i]; - for (ae = rem_bbs[i]->succ; ae; ae = ae->succ_next) + FOR_EACH_EDGE (ae, ei, rem_bbs[i]->succs) if (ae->dest != EXIT_BLOCK_PTR && !TEST_BIT (seen, ae->dest->index)) { SET_BIT (seen, ae->dest->index); bord_bbs[n_bord_bbs++] = ae->dest; + + if (ae->flags & EDGE_IRREDUCIBLE_LOOP) + irred_invalidated = true; } } /* Remove the path. */ from = e->src; - if (!loop_delete_branch_edge (e, 1)) - abort (); - dom_bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); + deleted = loop_delete_branch_edge (e, 1); + gcc_assert (deleted); + dom_bbs = XCNEWVEC (basic_block, n_basic_blocks); /* Cancel loops contained in the path. */ for (i = 0; i < nrem; i++) @@ -407,17 +342,16 @@ remove_path (struct loops *loops, edge e) /* Recount dominators. */ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); free (dom_bbs); - - /* These blocks have lost some predecessor(s), thus their irreducible - status could be changed. */ - for (i = 0; i < n_bord_bbs; i++) - fix_irreducible_loops (bord_bbs[i]); free (bord_bbs); /* Fix placements of basic blocks inside loops and the placement of loops in the loop tree. */ - fix_bb_placements (loops, from); - fix_loop_placements (loops, from->loop_father); + fix_bb_placements (loops, from, &irred_invalidated); + fix_loop_placements (loops, from->loop_father, &irred_invalidated); + + if (irred_invalidated + && (loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) != 0) + mark_irreducible_loops (loops); return true; } @@ -442,7 +376,7 @@ add_loop (struct loops *loops, struct loop *loop) loop->level = 1; /* Find its nodes. */ - bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); + bbs = XCNEWVEC (basic_block, n_basic_blocks); n = dfs_enumerate_from (loop->latch, 1, alp_enum_p, bbs, n_basic_blocks, loop->header); @@ -453,23 +387,6 @@ add_loop (struct loops *loops, struct loop *loop) free (bbs); } -/* Multiply all frequencies of basic blocks in array BBS of length NBBS - by NUM/DEN. */ -static void -scale_bbs_frequencies (basic_block *bbs, int nbbs, int num, int den) -{ - int i; - edge e; - - for (i = 0; i < nbbs; i++) - { - bbs[i]->frequency = (bbs[i]->frequency * num) / den; - bbs[i]->count = (bbs[i]->count * num) / den; - for (e = bbs[i]->succ; e; e = e->succ_next) - e->count = (e->count * num) /den; - } -} - /* Multiply all frequencies in LOOP by NUM/DEN. */ static void scale_loop_frequencies (struct loop *loop, int num, int den) @@ -477,7 +394,7 @@ scale_loop_frequencies (struct loop *loop, int num, int den) basic_block *bbs; bbs = get_loop_body (loop); - scale_bbs_frequencies (bbs, loop->num_nodes, num, den); + scale_bbs_frequencies_int (bbs, loop->num_nodes, num, den); free (bbs); } @@ -486,42 +403,53 @@ scale_loop_frequencies (struct loop *loop, int num, int den) accordingly. Everything between them plus LATCH_EDGE destination must be dominated by HEADER_EDGE destination, and back-reachable from LATCH_EDGE source. HEADER_EDGE is redirected to basic block SWITCH_BB, - SWITCH_BB->succ to original destination of LATCH_EDGE and - SWITCH_BB->succ->succ_next to original destination of HEADER_EDGE. + FALSE_EDGE of SWITCH_BB to original destination of HEADER_EDGE and + TRUE_EDGE of SWITCH_BB to original destination of LATCH_EDGE. Returns newly created loop. */ + struct loop * -loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block switch_bb) +loopify (struct loops *loops, edge latch_edge, edge header_edge, + basic_block switch_bb, edge true_edge, edge false_edge, + bool redirect_all_edges) { basic_block succ_bb = latch_edge->dest; basic_block pred_bb = header_edge->src; basic_block *dom_bbs, *body; unsigned n_dom_bbs, i; sbitmap seen; - struct loop *loop = xcalloc (1, sizeof (struct loop)); + struct loop *loop = XCNEW (struct loop); struct loop *outer = succ_bb->loop_father->outer; int freq, prob, tot_prob; gcov_type cnt; edge e; + edge_iterator ei; loop->header = header_edge->dest; loop->latch = latch_edge->src; freq = EDGE_FREQUENCY (header_edge); cnt = header_edge->count; - prob = switch_bb->succ->probability; - tot_prob = prob + switch_bb->succ->succ_next->probability; + prob = EDGE_SUCC (switch_bb, 0)->probability; + tot_prob = prob + EDGE_SUCC (switch_bb, 1)->probability; if (tot_prob == 0) tot_prob = 1; /* Redirect edges. */ loop_redirect_edge (latch_edge, loop->header); - loop_redirect_edge (header_edge, switch_bb); - loop_redirect_edge (switch_bb->succ->succ_next, loop->header); - loop_redirect_edge (switch_bb->succ, succ_bb); + loop_redirect_edge (true_edge, succ_bb); + + /* During loop versioning, one of the switch_bb edge is already properly + set. Do not redirect it again unless redirect_all_edges is true. */ + if (redirect_all_edges) + { + loop_redirect_edge (header_edge, switch_bb); + loop_redirect_edge (false_edge, loop->header); + + /* Update dominators. */ + set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb); + set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb); + } - /* Update dominators. */ - set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb); - set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb); set_immediate_dominator (CDI_DOMINATORS, succ_bb, switch_bb); /* Compute new loop. */ @@ -534,13 +462,13 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi /* Fix frequencies. */ switch_bb->frequency = freq; switch_bb->count = cnt; - for (e = switch_bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, switch_bb->succs) e->count = (switch_bb->count * e->probability) / REG_BR_PROB_BASE; scale_loop_frequencies (loop, prob, tot_prob); scale_loop_frequencies (succ_bb->loop_father, tot_prob - prob, tot_prob); /* Update dominators of blocks outside of LOOP. */ - dom_bbs = xcalloc (n_basic_blocks, sizeof (basic_block)); + dom_bbs = XCNEWVEC (basic_block, n_basic_blocks); n_dom_bbs = 0; seen = sbitmap_alloc (last_basic_block); sbitmap_zero (seen); @@ -574,16 +502,22 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi /* Remove the latch edge of a LOOP and update LOOPS tree to indicate that the LOOP was removed. After this function, original loop latch will - have no successor, which caller is expected to fix somehow. */ -void -unloop (struct loops *loops, struct loop *loop) + have no successor, which caller is expected to fix somehow. + + If this may cause the information about irreducible regions to become + invalid, IRRED_INVALIDATED is set to true. */ + +static void +unloop (struct loops *loops, struct loop *loop, bool *irred_invalidated) { basic_block *body; struct loop *ploop; unsigned i, n; basic_block latch = loop->latch; - edge *edges; - unsigned n_edges; + bool dummy = false; + + if (loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP) + *irred_invalidated = true; /* This is relatively straightforward. The dominators are unchanged, as loop header dominates loop latch, so the only thing we have to care of @@ -592,7 +526,6 @@ unloop (struct loops *loops, struct loop *loop) its work. */ body = get_loop_body (loop); - edges = get_loop_exit_edges (loop, &n_edges); n = loop->num_nodes; for (i = 0; i < n; i++) if (body[i]->loop_father == loop) @@ -614,36 +547,31 @@ unloop (struct loops *loops, struct loop *loop) loops->parray[loop->num] = NULL; flow_loop_free (loop); - remove_edge (latch->succ); - fix_bb_placements (loops, latch); + remove_edge (single_succ_edge (latch)); - /* If the loop was inside an irreducible region, we would have to somehow - update the irreducible marks inside its body. While it is certainly - possible to do, it is a bit complicated and this situation should be - very rare, so we just remark all loops in this case. */ - for (i = 0; i < n_edges; i++) - if (edges[i]->flags & EDGE_IRREDUCIBLE_LOOP) - break; - if (i != n_edges) - mark_irreducible_loops (loops); - free (edges); + /* We do not pass IRRED_INVALIDATED to fix_bb_placements here, as even if + there is an irreducible region inside the cancelled loop, the flags will + be still correct. */ + fix_bb_placements (loops, latch, &dummy); } /* Fix placement of LOOP inside loop tree, i.e. find the innermost superloop FATHER of LOOP such that all of the edges coming out of LOOP belong to - FATHER, and set it as outer loop of LOOP. Return 1 if placement of + FATHER, and set it as outer loop of LOOP. Return true if placement of LOOP changed. */ + int fix_loop_placement (struct loop *loop) { basic_block *body; unsigned i; edge e; + edge_iterator ei; struct loop *father = loop->pred[0], *act; body = get_loop_body (loop); for (i = 0; i < loop->num_nodes; i++) - for (e = body[i]->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, body[i]->succs) if (!flow_bb_inside_loop_p (loop, e->dest)) { act = find_common_loop (loop, e->dest->loop_father); @@ -666,9 +594,14 @@ fix_loop_placement (struct loop *loop) /* Fix placement of superloops of LOOP inside loop tree, i.e. ensure that condition stated in description of fix_loop_placement holds for them. It is used in case when we removed some edges coming out of LOOP, which - may cause the right placement of LOOP inside loop tree to change. */ + may cause the right placement of LOOP inside loop tree to change. + + IRRED_INVALIDATED is set to true if a change in the loop structures might + invalidate the information about irreducible regions. */ + static void -fix_loop_placements (struct loops *loops, struct loop *loop) +fix_loop_placements (struct loops *loops, struct loop *loop, + bool *irred_invalidated) { struct loop *outer; @@ -676,14 +609,15 @@ fix_loop_placements (struct loops *loops, struct loop *loop) { outer = loop->outer; if (!fix_loop_placement (loop)) - break; + break; /* Changing the placement of a loop in the loop tree may alter the validity of condition 2) of the description of fix_bb_placement for its preheader, because the successor is the header and belongs to the loop. So call fix_bb_placements to fix up the placement of the preheader and (possibly) of its predecessors. */ - fix_bb_placements (loops, loop_preheader_edge (loop)->src); + fix_bb_placements (loops, loop_preheader_edge (loop)->src, + irred_invalidated); loop = outer; } } @@ -701,11 +635,11 @@ place_new_loop (struct loops *loops, struct loop *loop) /* Copies copy of LOOP as subloop of TARGET loop, placing newly created loop into LOOPS structure. */ -static struct loop * +struct loop * duplicate_loop (struct loops *loops, struct loop *loop, struct loop *target) { struct loop *cloop; - cloop = xcalloc (1, sizeof (struct loop)); + cloop = XCNEW (struct loop); place_new_loop (loops, cloop); /* Initialize copied loop. */ @@ -765,47 +699,37 @@ static bool loop_delete_branch_edge (edge e, int really_delete) { basic_block src = e->src; + basic_block newdest; int irr; edge snd; - if (src->succ->succ_next) - { - basic_block newdest; + gcc_assert (EDGE_COUNT (src->succs) > 1); - /* Cannot handle more than two exit edges. */ - if (src->succ->succ_next->succ_next) - return false; - /* And it must be just a simple branch. */ - if (!any_condjump_p (BB_END (src))) - return false; + /* Cannot handle more than two exit edges. */ + if (EDGE_COUNT (src->succs) > 2) + return false; + /* And it must be just a simple branch. */ + if (!any_condjump_p (BB_END (src))) + return false; - snd = e == src->succ ? src->succ->succ_next : src->succ; - newdest = snd->dest; - if (newdest == EXIT_BLOCK_PTR) - return false; + snd = e == EDGE_SUCC (src, 0) ? EDGE_SUCC (src, 1) : EDGE_SUCC (src, 0); + newdest = snd->dest; + if (newdest == EXIT_BLOCK_PTR) + return false; - /* Hopefully the above conditions should suffice. */ - if (!really_delete) - return true; + /* Hopefully the above conditions should suffice. */ + if (!really_delete) + return true; - /* Redirecting behaves wrongly wrto this flag. */ - irr = snd->flags & EDGE_IRREDUCIBLE_LOOP; + /* Redirecting behaves wrongly wrto this flag. */ + irr = snd->flags & EDGE_IRREDUCIBLE_LOOP; - if (!redirect_edge_and_branch (e, newdest)) - return false; - src->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP; - src->succ->flags |= irr; + if (!redirect_edge_and_branch (e, newdest)) + return false; + single_succ_edge (src)->flags &= ~EDGE_IRREDUCIBLE_LOOP; + single_succ_edge (src)->flags |= irr; - return true; - } - else - { - /* Cannot happen -- we are using this only to remove an edge - from branch. */ - abort (); - } - - return false; /* To avoid warning, cannot get here. */ + return true; } /* Check whether LOOP's body can be duplicated. */ @@ -817,11 +741,34 @@ can_duplicate_loop_p (struct loop *loop) ret = can_copy_bbs_p (bbs, loop->num_nodes); free (bbs); - + return ret; } -#define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) +/* The NBBS blocks in BBS will get duplicated and the copies will be placed + to LOOP. Update the single_exit information in superloops of LOOP. */ + +static void +update_single_exits_after_duplication (basic_block *bbs, unsigned nbbs, + struct loop *loop) +{ + unsigned i; + + for (i = 0; i < nbbs; i++) + bbs[i]->flags |= BB_DUPLICATED; + + for (; loop->outer; loop = loop->outer) + { + if (!loop->single_exit) + continue; + + if (loop->single_exit->src->flags & BB_DUPLICATED) + loop->single_exit = NULL; + } + + for (i = 0; i < nbbs; i++) + bbs[i]->flags &= ~BB_DUPLICATED; +} /* Duplicates body of LOOP to given edge E NDUPL times. Takes care of updating LOOPS structure and dominators. E's destination must be LOOP header for @@ -833,7 +780,7 @@ can_duplicate_loop_p (struct loop *loop) original LOOP body, the other copies are numbered in order given by control flow through them) into TO_REMOVE array. Returns false if duplication is impossible. */ -int +bool duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, unsigned int ndupl, sbitmap wont_exit, edge orig, edge *to_remove, @@ -855,22 +802,22 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, int p, freq_in, freq_le, freq_out_orig; int prob_pass_thru, prob_pass_wont_exit, prob_pass_main; int add_irreducible_flag; + basic_block place_after; - if (e->dest != loop->header) - abort (); - if (ndupl <= 0) - abort (); + gcc_assert (e->dest == loop->header); + gcc_assert (ndupl > 0); if (orig) { /* Orig must be edge out of the loop. */ - if (!flow_bb_inside_loop_p (loop, orig->src)) - abort (); - if (flow_bb_inside_loop_p (loop, orig->dest)) - abort (); + gcc_assert (flow_bb_inside_loop_p (loop, orig->src)); + gcc_assert (!flow_bb_inside_loop_p (loop, orig->dest)); } - bbs = get_loop_body (loop); + n = loop->num_nodes; + bbs = get_loop_body_in_dom_order (loop); + gcc_assert (bbs[0] == loop->header); + gcc_assert (bbs[n - 1] == loop->latch); /* Check whether duplication is possible. */ if (!can_copy_bbs_p (bbs, loop->num_nodes)) @@ -878,13 +825,12 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, free (bbs); return false; } - new_bbs = xmalloc (sizeof (basic_block) * loop->num_nodes); + new_bbs = XNEWVEC (basic_block, loop->num_nodes); /* In case we are doing loop peeling and the loop is in the middle of irreducible region, the peeled copies will be inside it too. */ add_irreducible_flag = e->flags & EDGE_IRREDUCIBLE_LOOP; - if (is_latch && add_irreducible_flag) - abort (); + gcc_assert (!is_latch || !add_irreducible_flag); /* Find edge from latch. */ latch_edge = loop_latch_edge (loop); @@ -906,14 +852,35 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, prob_pass_wont_exit = RDIV (REG_BR_PROB_BASE * (freq_le + freq_out_orig), freq_in); - scale_step = xmalloc (ndupl * sizeof (int)); + scale_step = XNEWVEC (int, ndupl); for (i = 1; i <= ndupl; i++) scale_step[i - 1] = TEST_BIT (wont_exit, i) ? prob_pass_wont_exit : prob_pass_thru; - if (is_latch) + /* Complete peeling is special as the probability of exit in last + copy becomes 1. */ + if (flags & DLTHE_FLAG_COMPLETTE_PEEL) + { + int wanted_freq = EDGE_FREQUENCY (e); + + if (wanted_freq > freq_in) + wanted_freq = freq_in; + + gcc_assert (!is_latch); + /* First copy has frequency of incoming edge. Each subsequent + frequency should be reduced by prob_pass_wont_exit. Caller + should've managed the flags so all except for original loop + has won't exist set. */ + scale_act = RDIV (wanted_freq * REG_BR_PROB_BASE, freq_in); + /* Now simulate the duplication adjustments and compute header + frequency of the last copy. */ + for (i = 0; i < ndupl; i++) + wanted_freq = RDIV (wanted_freq * scale_step[i], REG_BR_PROB_BASE); + scale_main = RDIV (wanted_freq * REG_BR_PROB_BASE, freq_in); + } + else if (is_latch) { prob_pass_main = TEST_BIT (wont_exit, 0) ? prob_pass_wont_exit @@ -936,11 +903,9 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, scale_act = REG_BR_PROB_BASE - prob_pass_thru; } for (i = 0; i < ndupl; i++) - if (scale_step[i] < 0 || scale_step[i] > REG_BR_PROB_BASE) - abort (); - if (scale_main < 0 || scale_main > REG_BR_PROB_BASE - || scale_act < 0 || scale_act > REG_BR_PROB_BASE) - abort (); + gcc_assert (scale_step[i] >= 0 && scale_step[i] <= REG_BR_PROB_BASE); + gcc_assert (scale_main >= 0 && scale_main <= REG_BR_PROB_BASE + && scale_act >= 0 && scale_act <= REG_BR_PROB_BASE); } /* Loop the new bbs will belong to. */ @@ -950,21 +915,23 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, n_orig_loops = 0; for (aloop = loop->inner; aloop; aloop = aloop->next) n_orig_loops++; - orig_loops = xcalloc (n_orig_loops, sizeof (struct loop *)); + orig_loops = XCNEWVEC (struct loop *, n_orig_loops); for (aloop = loop->inner, i = 0; aloop; aloop = aloop->next, i++) orig_loops[i] = aloop; loop->copy = target; - n = loop->num_nodes; - - first_active = xmalloc (n * sizeof (basic_block)); + first_active = XNEWVEC (basic_block, n); if (is_latch) { memcpy (first_active, bbs, n * sizeof (basic_block)); first_active_latch = latch; } + /* Update the information about single exits. */ + if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS) + update_single_exits_after_duplication (bbs, n, target); + /* Record exit edge in original loop body. */ if (orig && TEST_BIT (wont_exit, 0)) to_remove[(*n_to_remove)++] = orig; @@ -972,33 +939,44 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, spec_edges[SE_ORIG] = orig; spec_edges[SE_LATCH] = latch_edge; + place_after = e->src; for (j = 0; j < ndupl; j++) { /* Copy loops. */ copy_loops_to (loops, orig_loops, n_orig_loops, target); /* Copy bbs. */ - copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop); + copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop, + place_after); + place_after = new_spec_edges[SE_LATCH]->src; + + if (flags & DLTHE_RECORD_COPY_NUMBER) + for (i = 0; i < n; i++) + { + gcc_assert (!new_bbs[i]->aux); + new_bbs[i]->aux = (void *)(size_t)(j + 1); + } /* Note whether the blocks and edges belong to an irreducible loop. */ if (add_irreducible_flag) { for (i = 0; i < n; i++) - new_bbs[i]->rbi->duplicated = 1; + new_bbs[i]->flags |= BB_DUPLICATED; for (i = 0; i < n; i++) { + edge_iterator ei; new_bb = new_bbs[i]; if (new_bb->loop_father == target) new_bb->flags |= BB_IRREDUCIBLE_LOOP; - for (ae = new_bb->succ; ae; ae = ae->succ_next) - if (ae->dest->rbi->duplicated + FOR_EACH_EDGE (ae, ei, new_bb->succs) + if ((ae->dest->flags & BB_DUPLICATED) && (ae->src->loop_father == target || ae->dest->loop_father == target)) ae->flags |= EDGE_IRREDUCIBLE_LOOP; } for (i = 0; i < n; i++) - new_bbs[i]->rbi->duplicated = 0; + new_bbs[i]->flags &= ~BB_DUPLICATED; } /* Redirect the special edges. */ @@ -1008,7 +986,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, redirect_edge_and_branch_force (new_spec_edges[SE_LATCH], loop->header); set_immediate_dominator (CDI_DOMINATORS, new_bbs[0], latch); - latch = loop->latch = new_bbs[1]; + latch = loop->latch = new_bbs[n - 1]; e = latch_edge = new_spec_edges[SE_LATCH]; } else @@ -1029,25 +1007,25 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, if (!first_active_latch) { memcpy (first_active, new_bbs, n * sizeof (basic_block)); - first_active_latch = new_bbs[1]; + first_active_latch = new_bbs[n - 1]; } /* Set counts and frequencies. */ if (flags & DLTHE_FLAG_UPDATE_FREQ) { - scale_bbs_frequencies (new_bbs, n, scale_act, REG_BR_PROB_BASE); + scale_bbs_frequencies_int (new_bbs, n, scale_act, REG_BR_PROB_BASE); scale_act = RDIV (scale_act * scale_step[j], REG_BR_PROB_BASE); } } free (new_bbs); free (orig_loops); - + /* Update the original loop. */ if (!is_latch) set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); if (flags & DLTHE_FLAG_UPDATE_FREQ) { - scale_bbs_frequencies (bbs, n, scale_main, REG_BR_PROB_BASE); + scale_bbs_frequencies_int (bbs, n, scale_main, REG_BR_PROB_BASE); free (scale_step); } @@ -1058,6 +1036,8 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, int n_dom_bbs,j; bb = bbs[i]; + bb->aux = 0; + n_dom_bbs = get_dominated_by (CDI_DOMINATORS, bb, &dom_bbs); for (j = 0; j < n_dom_bbs; j++) { @@ -1066,7 +1046,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, continue; dom_bb = nearest_common_dominator ( CDI_DOMINATORS, first_active[i], first_active_latch); - set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb); + set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb); } free (dom_bbs); } @@ -1077,49 +1057,76 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, return true; } +/* A callback for make_forwarder block, to redirect all edges except for + MFB_KJ_EDGE to the entry part. E is the edge for that we should decide + whether to redirect it. */ + +static edge mfb_kj_edge; +static bool +mfb_keep_just (edge e) +{ + return e != mfb_kj_edge; +} + +/* A callback for make_forwarder block, to update data structures for a basic + block JUMP created by redirecting an edge (only the latch edge is being + redirected). */ + +static void +mfb_update_loops (basic_block jump) +{ + struct loop *loop = single_succ (jump)->loop_father; + + if (dom_computed[CDI_DOMINATORS]) + set_immediate_dominator (CDI_DOMINATORS, jump, single_pred (jump)); + add_bb_to_loop (jump, loop); + loop->latch = jump; +} + /* Creates a pre-header for a LOOP. Returns newly created block. Unless CP_SIMPLE_PREHEADERS is set in FLAGS, we only force LOOP to have single entry; otherwise we also force preheader block to have only one successor. - The function also updates dominators stored in DOM. */ + The function also updates dominators. */ + static basic_block create_preheader (struct loop *loop, int flags) { edge e, fallthru; basic_block dummy; - basic_block jump, src = 0; struct loop *cloop, *ploop; int nentry = 0; - rtx insn; + bool irred = false; + bool latch_edge_was_fallthru; + edge one_succ_pred = 0; + edge_iterator ei; cloop = loop->outer; - for (e = loop->header->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, loop->header->preds) { if (e->src == loop->latch) continue; + irred |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0; nentry++; + if (single_succ_p (e->src)) + one_succ_pred = e; } - if (!nentry) - abort (); + gcc_assert (nentry); if (nentry == 1) { - for (e = loop->header->pred; e->src == loop->latch; e = e->pred_next); - if (!(flags & CP_SIMPLE_PREHEADERS) - || !e->src->succ->succ_next) + /* Get an edge that is different from the one from loop->latch + to loop->header. */ + e = EDGE_PRED (loop->header, + EDGE_PRED (loop->header, 0)->src == loop->latch); + + if (!(flags & CP_SIMPLE_PREHEADERS) || single_succ_p (e->src)) return NULL; } - insn = first_insn_after_basic_block_note (loop->header); - if (insn) - insn = PREV_INSN (insn); - else - insn = get_last_insn (); - if (insn == BB_END (loop->header)) - { - /* Split_block would not split block after its end. */ - emit_note_after (NOTE_INSN_DELETED, insn); - } - fallthru = split_block (loop->header, insn); + mfb_kj_edge = loop_latch_edge (loop); + latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0; + fallthru = make_forwarder_block (loop->header, mfb_keep_just, + mfb_update_loops); dummy = fallthru->src; loop->header = fallthru->dest; @@ -1129,37 +1136,35 @@ create_preheader (struct loop *loop, int flags) if (ploop->latch == dummy) ploop->latch = fallthru->dest; - add_to_dominance_info (CDI_DOMINATORS, fallthru->dest); + /* Try to be clever in placing the newly created preheader. The idea is to + avoid breaking any "fallthruness" relationship between blocks. - /* Redirect edges. */ - for (e = dummy->pred; e; e = e->pred_next) + The preheader was created just before the header and all incoming edges + to the header were redirected to the preheader, except the latch edge. + So the only problematic case is when this latch edge was a fallthru + edge: it is not anymore after the preheader creation so we have broken + the fallthruness. We're therefore going to look for a better place. */ + if (latch_edge_was_fallthru) { - src = e->src; - if (src == loop->latch) - break; - } - if (!e) - abort (); + if (one_succ_pred) + e = one_succ_pred; + else + e = EDGE_PRED (dummy, 0); - dummy->frequency -= EDGE_FREQUENCY (e); - dummy->count -= e->count; - fallthru->count -= e->count; - jump = redirect_edge_and_branch_force (e, loop->header); - if (jump) - { - add_to_dominance_info (CDI_DOMINATORS, jump); - set_immediate_dominator (CDI_DOMINATORS, jump, src); - add_bb_to_loop (jump, loop); - loop->latch = jump; + move_block_after (dummy, e->src); } - /* Update structures. */ - redirect_immediate_dominators (CDI_DOMINATORS, dummy, loop->header); - set_immediate_dominator (CDI_DOMINATORS, loop->header, dummy); loop->header->loop_father = loop; add_bb_to_loop (dummy, cloop); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Created preheader block for loop %i\n", + + if (irred) + { + dummy->flags |= BB_IRREDUCIBLE_LOOP; + single_succ_edge (dummy)->flags |= EDGE_IRREDUCIBLE_LOOP; + } + + if (dump_file) + fprintf (dump_file, "Created preheader block for loop %i\n", loop->num); return dummy; @@ -1188,12 +1193,10 @@ force_single_succ_latches (struct loops *loops) for (i = 1; i < loops->num; i++) { loop = loops->parray[i]; - if (loop->latch != loop->header - && !loop->latch->succ->succ_next) + if (loop->latch != loop->header && single_succ_p (loop->latch)) continue; - for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next) - continue; + e = find_edge (loop->latch, loop->header); loop_split_edge_with (e, NULL_RTX); } @@ -1209,7 +1212,6 @@ loop_split_edge_with (edge e, rtx insns) { basic_block src, dest, new_bb; struct loop *loop_c; - edge new_e; src = e->src; dest = e->dest; @@ -1219,26 +1221,268 @@ loop_split_edge_with (edge e, rtx insns) /* Create basic block for it. */ new_bb = split_edge (e); - add_to_dominance_info (CDI_DOMINATORS, new_bb); add_bb_to_loop (new_bb, loop_c); - new_bb->flags = insns ? BB_SUPERBLOCK : 0; - - new_e = new_bb->succ; - if (e->flags & EDGE_IRREDUCIBLE_LOOP) - { - new_bb->flags |= BB_IRREDUCIBLE_LOOP; - new_e->flags |= EDGE_IRREDUCIBLE_LOOP; - } + new_bb->flags |= (insns ? BB_SUPERBLOCK : 0); if (insns) emit_insn_after (insns, BB_END (new_bb)); - set_immediate_dominator (CDI_DOMINATORS, new_bb, src); - set_immediate_dominator (CDI_DOMINATORS, dest, - recount_dominator (CDI_DOMINATORS, dest)); - if (dest->loop_father->latch == src) dest->loop_father->latch = new_bb; return new_bb; } + +/* This function is called from loop_version. It splits the entry edge + of the loop we want to version, adds the versioning condition, and + adjust the edges to the two versions of the loop appropriately. + e is an incoming edge. Returns the basic block containing the + condition. + + --- edge e ---- > [second_head] + + Split it and insert new conditional expression and adjust edges. + + --- edge e ---> [cond expr] ---> [first_head] + | + +---------> [second_head] +*/ + +static basic_block +lv_adjust_loop_entry_edge (basic_block first_head, + basic_block second_head, + edge e, + void *cond_expr) +{ + basic_block new_head = NULL; + edge e1; + + gcc_assert (e->dest == second_head); + + /* Split edge 'e'. This will create a new basic block, where we can + insert conditional expr. */ + new_head = split_edge (e); + + + lv_add_condition_to_bb (first_head, second_head, new_head, + cond_expr); + + /* Don't set EDGE_TRUE_VALUE in RTL mode, as it's invalid there. */ + e1 = make_edge (new_head, first_head, ir_type () ? EDGE_TRUE_VALUE : 0); + set_immediate_dominator (CDI_DOMINATORS, first_head, new_head); + set_immediate_dominator (CDI_DOMINATORS, second_head, new_head); + + /* Adjust loop header phi nodes. */ + lv_adjust_loop_header_phi (first_head, second_head, new_head, e1); + + return new_head; +} + +/* Main entry point for Loop Versioning transformation. + + This transformation given a condition and a loop, creates + -if (condition) { loop_copy1 } else { loop_copy2 }, + where loop_copy1 is the loop transformed in one way, and loop_copy2 + is the loop transformed in another way (or unchanged). 'condition' + may be a run time test for things that were not resolved by static + analysis (overlapping ranges (anti-aliasing), alignment, etc.). + + If PLACE_AFTER is true, we place the new loop after LOOP in the + instruction stream, otherwise it is placed before LOOP. */ + +struct loop * +loop_version (struct loops *loops, struct loop * loop, + void *cond_expr, basic_block *condition_bb, + bool place_after) +{ + basic_block first_head, second_head; + edge entry, latch_edge, exit, true_edge, false_edge; + int irred_flag; + struct loop *nloop; + basic_block cond_bb; + + /* CHECKME: Loop versioning does not handle nested loop at this point. */ + if (loop->inner) + return NULL; + + /* Record entry and latch edges for the loop */ + entry = loop_preheader_edge (loop); + irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP; + entry->flags &= ~EDGE_IRREDUCIBLE_LOOP; + + /* Note down head of loop as first_head. */ + first_head = entry->dest; + + /* Duplicate loop. */ + if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, loops, 1, + NULL, NULL, NULL, NULL, 0)) + return NULL; + + /* After duplication entry edge now points to new loop head block. + Note down new head as second_head. */ + second_head = entry->dest; + + /* Split loop entry edge and insert new block with cond expr. */ + cond_bb = lv_adjust_loop_entry_edge (first_head, second_head, + entry, cond_expr); + if (condition_bb) + *condition_bb = cond_bb; + + if (!cond_bb) + { + entry->flags |= irred_flag; + return NULL; + } + + latch_edge = single_succ_edge (get_bb_copy (loop->latch)); + + extract_cond_bb_edges (cond_bb, &true_edge, &false_edge); + nloop = loopify (loops, + latch_edge, + single_pred_edge (get_bb_copy (loop->header)), + cond_bb, true_edge, false_edge, + false /* Do not redirect all edges. */); + + exit = loop->single_exit; + if (exit) + nloop->single_exit = find_edge (get_bb_copy (exit->src), exit->dest); + + /* loopify redirected latch_edge. Update its PENDING_STMTS. */ + lv_flush_pending_stmts (latch_edge); + + /* loopify redirected condition_bb's succ edge. Update its PENDING_STMTS. */ + extract_cond_bb_edges (cond_bb, &true_edge, &false_edge); + lv_flush_pending_stmts (false_edge); + /* Adjust irreducible flag. */ + if (irred_flag) + { + cond_bb->flags |= BB_IRREDUCIBLE_LOOP; + loop_preheader_edge (loop)->flags |= EDGE_IRREDUCIBLE_LOOP; + loop_preheader_edge (nloop)->flags |= EDGE_IRREDUCIBLE_LOOP; + single_pred_edge (cond_bb)->flags |= EDGE_IRREDUCIBLE_LOOP; + } + + if (place_after) + { + basic_block *bbs = get_loop_body_in_dom_order (nloop), after; + unsigned i; + + after = loop->latch; + + for (i = 0; i < nloop->num_nodes; i++) + { + move_block_after (bbs[i], after); + after = bbs[i]; + } + free (bbs); + } + + /* At this point condition_bb is loop predheader with two successors, + first_head and second_head. Make sure that loop predheader has only + one successor. */ + loop_split_edge_with (loop_preheader_edge (loop), NULL); + loop_split_edge_with (loop_preheader_edge (nloop), NULL); + + return nloop; +} + +/* The structure of LOOPS might have changed. Some loops might get removed + (and their headers and latches were set to NULL), loop exists might get + removed (thus the loop nesting may be wrong), and some blocks and edges + were changed (so the information about bb --> loop mapping does not have + to be correct). But still for the remaining loops the header dominates + the latch, and loops did not get new subloobs (new loops might possibly + get created, but we are not interested in them). Fix up the mess. + + If CHANGED_BBS is not NULL, basic blocks whose loop has changed are + marked in it. */ + +void +fix_loop_structure (struct loops *loops, bitmap changed_bbs) +{ + basic_block bb; + struct loop *loop, *ploop; + unsigned i; + + /* Remove the old bb -> loop mapping. */ + FOR_EACH_BB (bb) + { + bb->aux = (void *) (size_t) bb->loop_father->depth; + bb->loop_father = loops->tree_root; + } + + /* Remove the dead loops from structures. */ + loops->tree_root->num_nodes = n_basic_blocks; + for (i = 1; i < loops->num; i++) + { + loop = loops->parray[i]; + if (!loop) + continue; + + loop->num_nodes = 0; + if (loop->header) + continue; + + while (loop->inner) + { + ploop = loop->inner; + flow_loop_tree_node_remove (ploop); + flow_loop_tree_node_add (loop->outer, ploop); + } + + /* Remove the loop and free its data. */ + flow_loop_tree_node_remove (loop); + loops->parray[loop->num] = NULL; + flow_loop_free (loop); + } + + /* Rescan the bodies of loops, starting from the outermost. */ + loop = loops->tree_root; + while (1) + { + if (loop->inner) + loop = loop->inner; + else + { + while (!loop->next + && loop != loops->tree_root) + loop = loop->outer; + if (loop == loops->tree_root) + break; + + loop = loop->next; + } + + loop->num_nodes = flow_loop_nodes_find (loop->header, loop); + } + + /* Now fix the loop nesting. */ + for (i = 1; i < loops->num; i++) + { + loop = loops->parray[i]; + if (!loop) + continue; + + bb = loop_preheader_edge (loop)->src; + if (bb->loop_father != loop->outer) + { + flow_loop_tree_node_remove (loop); + flow_loop_tree_node_add (bb->loop_father, loop); + } + } + + /* Mark the blocks whose loop has changed. */ + FOR_EACH_BB (bb) + { + if (changed_bbs + && (void *) (size_t) bb->loop_father->depth != bb->aux) + bitmap_set_bit (changed_bbs, bb->index); + + bb->aux = NULL; + } + + if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS) + mark_single_exit_loops (loops); + if (loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) + mark_irreducible_loops (loops); +} diff --git a/contrib/gcc/cfgrtl.c b/contrib/gcc/cfgrtl.c index 42899f4e383..9cc581c1a59 100644 --- a/contrib/gcc/cfgrtl.c +++ b/contrib/gcc/cfgrtl.c @@ -1,6 +1,6 @@ /* Control flow graph manipulation code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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 contains low level functions to manipulate the CFG and analyze it that are aware of the RTL intermediate language. @@ -56,38 +56,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "insn-config.h" #include "cfglayout.h" #include "expr.h" - -/* Stubs in case we don't have a return insn. */ -#ifndef HAVE_return -#define HAVE_return 0 -#define gen_return() NULL_RTX -#endif - -/* The labels mentioned in non-jump rtl. Valid during find_basic_blocks. */ -/* ??? Should probably be using LABEL_NUSES instead. It would take a - bit of surgery to be able to use or co-opt the routines in jump. */ -rtx label_value_list; -rtx tail_recursion_label_list; +#include "target.h" +#include "cfgloop.h" +#include "ggc.h" +#include "tree-pass.h" static int can_delete_note_p (rtx); static int can_delete_label_p (rtx); static void commit_one_edge_insertion (edge, int); -static rtx last_loop_beg_note (rtx); -static bool back_edge_of_syntactic_loop_p (basic_block, basic_block); -basic_block force_nonfallthru_and_redirect (edge, basic_block); static basic_block rtl_split_edge (edge); +static bool rtl_move_block_after (basic_block, basic_block); static int rtl_verify_flow_info (void); -static edge cfg_layout_split_block (basic_block, void *); -static bool cfg_layout_redirect_edge_and_branch (edge, basic_block); +static basic_block cfg_layout_split_block (basic_block, void *); +static edge cfg_layout_redirect_edge_and_branch (edge, basic_block); static basic_block cfg_layout_redirect_edge_and_branch_force (edge, basic_block); static void cfg_layout_delete_block (basic_block); static void rtl_delete_block (basic_block); static basic_block rtl_redirect_edge_and_branch_force (edge, basic_block); -static bool rtl_redirect_edge_and_branch (edge, basic_block); -static edge rtl_split_block (basic_block, void *); -static void rtl_dump_bb (basic_block, FILE *); +static edge rtl_redirect_edge_and_branch (edge, basic_block); +static basic_block rtl_split_block (basic_block, void *); +static void rtl_dump_bb (basic_block, FILE *, int); static int rtl_verify_flow_info_1 (void); -static void mark_killed_regs (rtx, rtx, void *); +static void rtl_make_forwarder_block (edge); /* Return true if NOTE is not one of the ones that must be kept paired, so that we may simply delete it. */ @@ -96,8 +86,7 @@ static int can_delete_note_p (rtx note) { return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED - || NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK - || NOTE_LINE_NUMBER (note) == NOTE_INSN_PREDICTION); + || NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK); } /* True if a given label can be deleted. */ @@ -108,8 +97,7 @@ can_delete_label_p (rtx label) return (!LABEL_PRESERVE_P (label) /* User declared labels must be preserved. */ && LABEL_NAME (label) == 0 - && !in_expr_list_p (forced_labels, label) - && !in_expr_list_p (label_value_list, label)); + && !in_expr_list_p (forced_labels, label)); } /* Delete INSN by patching it out. Return the next insn. */ @@ -121,11 +109,11 @@ delete_insn (rtx insn) rtx note; bool really_delete = true; - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) { /* Some labels can't be directly removed from the INSN chain, as they - might be references via variables, constant pool etc. - Convert them to the special NOTE_INSN_DELETED_LABEL note. */ + might be references via variables, constant pool etc. + Convert them to the special NOTE_INSN_DELETED_LABEL note. */ if (! can_delete_label_p (insn)) { const char *name = LABEL_NAME (insn); @@ -133,7 +121,7 @@ delete_insn (rtx insn) really_delete = false; PUT_CODE (insn, NOTE); NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL; - NOTE_SOURCE_FILE (insn) = name; + NOTE_DELETED_LABEL_NAME (insn) = name; } remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels); @@ -142,31 +130,30 @@ delete_insn (rtx insn) if (really_delete) { /* If this insn has already been deleted, something is very wrong. */ - if (INSN_DELETED_P (insn)) - abort (); + gcc_assert (!INSN_DELETED_P (insn)); remove_insn (insn); INSN_DELETED_P (insn) = 1; } /* If deleting a jump, decrement the use count of the label. Deleting the label itself should happen in the normal course of block merging. */ - if (GET_CODE (insn) == JUMP_INSN + if (JUMP_P (insn) && JUMP_LABEL (insn) - && GET_CODE (JUMP_LABEL (insn)) == CODE_LABEL) + && LABEL_P (JUMP_LABEL (insn))) LABEL_NUSES (JUMP_LABEL (insn))--; /* Also if deleting an insn that references a label. */ else { while ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX - && GET_CODE (XEXP (note, 0)) == CODE_LABEL) + && LABEL_P (XEXP (note, 0))) { LABEL_NUSES (XEXP (note, 0))--; remove_note (insn, note); } } - if (GET_CODE (insn) == JUMP_INSN + if (JUMP_P (insn) && (GET_CODE (PATTERN (insn)) == ADDR_VEC || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)) { @@ -182,7 +169,7 @@ delete_insn (rtx insn) /* When deleting code in bulk (e.g. removing many unreachable blocks) we can delete a label that's a target of the vector before deleting the vector itself. */ - if (GET_CODE (label) != NOTE) + if (!NOTE_P (label)) LABEL_NUSES (label)--; } } @@ -221,7 +208,7 @@ delete_insn_chain (rtx start, rtx finish) while (1) { next = NEXT_INSN (start); - if (GET_CODE (start) == NOTE && !can_delete_note_p (start)) + if (NOTE_P (start) && !can_delete_note_p (start)) ; else next = delete_insn (start); @@ -261,7 +248,6 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after) basic_block bb; if (bb_note - && ! RTX_INTEGRATED_P (bb_note) && (bb = NOTE_BASIC_BLOCK (bb_note)) != NULL && bb->aux == NULL) { @@ -269,7 +255,7 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after) rtx after; - if (GET_CODE (head) == CODE_LABEL) + if (LABEL_P (head)) after = head; else { @@ -286,10 +272,11 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after) bb = alloc_block (); + init_rtl_bb_info (bb); if (!head && !end) head = end = bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, get_last_insn ()); - else if (GET_CODE (head) == CODE_LABEL && end) + else if (LABEL_P (head) && end) { bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, head); if (head == end) @@ -313,10 +300,11 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after) BB_HEAD (bb) = head; BB_END (bb) = end; bb->index = last_basic_block++; - bb->flags = BB_NEW; + bb->flags = BB_NEW | BB_RTL; link_block (bb, after); - BASIC_BLOCK (bb->index) = bb; + SET_BASIC_BLOCK (bb->index, bb); update_bb_for_insn (bb); + BB_SET_PARTITION (bb, BB_UNPARTITIONED); /* Tag the block so that we know it has been used when considering other basic block notes. */ @@ -336,8 +324,16 @@ rtl_create_basic_block (void *headp, void *endp, basic_block after) rtx head = headp, end = endp; basic_block bb; - /* Place the new block just after the end. */ - VARRAY_GROW (basic_block_info, last_basic_block+1); + /* Grow the basic block array if needed. */ + if ((size_t) last_basic_block >= VEC_length (basic_block, basic_block_info)) + { + size_t old_size = VEC_length (basic_block, basic_block_info); + size_t new_size = last_basic_block + (last_basic_block + 3) / 4; + basic_block *p; + VEC_safe_grow (basic_block, gc, basic_block_info, new_size); + p = VEC_address (basic_block, basic_block_info); + memset (&p[old_size], 0, sizeof (basic_block) * (new_size - old_size)); + } n_basic_blocks++; @@ -351,7 +347,6 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) { basic_block newbb = rtl_create_basic_block (head, end, after); - cfg_layout_initialize_rbi (newbb); return newbb; } @@ -366,60 +361,27 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) static void rtl_delete_block (basic_block b) { - rtx insn, end, tmp; + rtx insn, end; /* If the head of this block is a CODE_LABEL, then it might be the - label for an exception handler which can't be reached. - - We need to remove the label from the exception_handler_label list - and remove the associated NOTE_INSN_EH_REGION_BEG and - NOTE_INSN_EH_REGION_END notes. */ - - /* Get rid of all NOTE_INSN_PREDICTIONs and NOTE_INSN_LOOP_CONTs - hanging before the block. */ - - for (insn = PREV_INSN (BB_HEAD (b)); insn; insn = PREV_INSN (insn)) - { - if (GET_CODE (insn) != NOTE) - break; - if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PREDICTION - || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT) - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - } - + label for an exception handler which can't be reached. We need + to remove the label from the exception_handler_label list. */ insn = BB_HEAD (b); - - never_reached_warning (insn, BB_END (b)); - - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) maybe_remove_eh_handler (insn); - /* Include any jump table following the basic block. */ - end = BB_END (b); - if (tablejump_p (end, NULL, &tmp)) - end = tmp; - - /* Include any barrier that may follow the basic block. */ - tmp = next_nonnote_insn (end); - if (tmp && GET_CODE (tmp) == BARRIER) - end = tmp; + end = get_last_bb_insn (b); /* Selectively delete the entire chain. */ BB_HEAD (b) = NULL; delete_insn_chain (insn, end); - - /* Remove the edges into and out of this block. Note that there may - indeed be edges in, if we are removing an unreachable loop. */ - while (b->pred != NULL) - remove_edge (b->pred); - while (b->succ != NULL) - remove_edge (b->succ); - - b->pred = NULL; - b->succ = NULL; - - /* Remove the basic block from the array. */ - expunge_block (b); + if (b->il.rtl->global_live_at_start) + { + FREE_REG_SET (b->il.rtl->global_live_at_start); + FREE_REG_SET (b->il.rtl->global_live_at_end); + b->il.rtl->global_live_at_start = NULL; + b->il.rtl->global_live_at_end = NULL; + } } /* Records the basic block struct in BLOCK_FOR_INSN for every insn. */ @@ -445,13 +407,52 @@ compute_bb_for_insn (void) /* Release the basic_block_for_insn array. */ -void +unsigned int free_bb_for_insn (void) { rtx insn; for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) != BARRIER) + if (!BARRIER_P (insn)) BLOCK_FOR_INSN (insn) = NULL; + return 0; +} + +struct tree_opt_pass pass_free_cfg = +{ + NULL, /* name */ + NULL, /* gate */ + free_bb_for_insn, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + PROP_cfg, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ + 0 /* letter */ +}; + +/* Return RTX to emit after when we want to emit code on the entry of function. */ +rtx +entry_of_function (void) +{ + return (n_basic_blocks > NUM_FIXED_BLOCKS ? + BB_HEAD (ENTRY_BLOCK_PTR->next_bb) : get_insns ()); +} + +/* Emit INSN at the entry point of the function, ensuring that it is only + executed once per function. */ +void +emit_insn_at_entry (rtx insn) +{ + edge_iterator ei = ei_start (ENTRY_BLOCK_PTR->succs); + edge e = ei_safe_edge (ei); + gcc_assert (e->flags & EDGE_FALLTHRU); + + insert_insn_on_edge (insn, e); + commit_edge_insertions (); } /* Update insns block within BB. */ @@ -463,25 +464,23 @@ update_bb_for_insn (basic_block bb) for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn)) { - if (GET_CODE (insn) != BARRIER) + if (!BARRIER_P (insn)) set_block_for_insn (insn, bb); if (insn == BB_END (bb)) break; } } -/* Split a block BB after insn INSN creating a new fallthru edge. - Return the new edge. Note that to keep other parts of the compiler happy, - this function renumbers all the basic blocks so that the new - one has a number one greater than the block split. */ +/* Creates a new basic block just after basic block B by splitting + everything after specified instruction I. */ -static edge +static basic_block rtl_split_block (basic_block bb, void *insnp) { basic_block new_bb; - edge new_edge; - edge e; rtx insn = insnp; + edge e; + edge_iterator ei; if (!insn) { @@ -501,34 +500,30 @@ rtl_split_block (basic_block bb, void *insnp) /* Create the new basic block. */ new_bb = create_basic_block (NEXT_INSN (insn), BB_END (bb), bb); - new_bb->count = bb->count; - new_bb->frequency = bb->frequency; - new_bb->loop_depth = bb->loop_depth; + BB_COPY_PARTITION (new_bb, bb); BB_END (bb) = insn; /* Redirect the outgoing edges. */ - new_bb->succ = bb->succ; - bb->succ = NULL; - for (e = new_bb->succ; e; e = e->succ_next) + new_bb->succs = bb->succs; + bb->succs = NULL; + FOR_EACH_EDGE (e, ei, new_bb->succs) e->src = new_bb; - new_edge = make_single_succ_edge (bb, new_bb, EDGE_FALLTHRU); - - if (bb->global_live_at_start) + if (bb->il.rtl->global_live_at_start) { - new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); - new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end); + new_bb->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + new_bb->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (new_bb->il.rtl->global_live_at_end, bb->il.rtl->global_live_at_end); /* We now have to calculate which registers are live at the end of the split basic block and at the start of the new basic block. Start with those registers that are known to be live at the end of the original basic block and get propagate_block to determine which registers are live. */ - COPY_REG_SET (new_bb->global_live_at_start, bb->global_live_at_end); - propagate_block (new_bb, new_bb->global_live_at_start, NULL, NULL, 0); - COPY_REG_SET (bb->global_live_at_end, - new_bb->global_live_at_start); + COPY_REG_SET (new_bb->il.rtl->global_live_at_start, bb->il.rtl->global_live_at_end); + propagate_block (new_bb, new_bb->il.rtl->global_live_at_start, NULL, NULL, 0); + COPY_REG_SET (bb->il.rtl->global_live_at_end, + new_bb->il.rtl->global_live_at_start); #ifdef HAVE_conditional_execution /* In the presence of conditional execution we are not able to update liveness precisely. */ @@ -540,34 +535,7 @@ rtl_split_block (basic_block bb, void *insnp) #endif } - return new_edge; -} - -/* Assume that the code of basic block B has been merged into A. - Do corresponding CFG updates: redirect edges accordingly etc. */ -static void -update_cfg_after_block_merging (basic_block a, basic_block b) -{ - edge e; - - /* Normally there should only be one successor of A and that is B, but - partway though the merge of blocks for conditional_execution we'll - be merging a TEST block with THEN and ELSE successors. Free the - whole lot of them and hope the caller knows what they're doing. */ - while (a->succ) - remove_edge (a->succ); - - /* Adjust the edges out of B for the new owner. */ - for (e = b->succ; e; e = e->succ_next) - e->src = a; - a->succ = b->succ; - a->flags |= b->flags; - - /* B hasn't quite yet ceased to exist. Attempt to prevent mishap. */ - b->pred = b->succ = NULL; - a->global_live_at_end = b->global_live_at_end; - - expunge_block (b); + return new_bb; } /* Blocks A and B are to be merged into a single block A. The insns @@ -581,8 +549,12 @@ rtl_merge_blocks (basic_block a, basic_block b) int b_empty = 0; /* If there was a CODE_LABEL beginning B, delete it. */ - if (GET_CODE (b_head) == CODE_LABEL) + if (LABEL_P (b_head)) { + /* This might have been an EH label that no longer has incoming + EH edges. Update data structures to match. */ + maybe_remove_eh_handler (b_head); + /* Detect basic blocks with nothing but a label. This can happen in particular at the end of a function. */ if (b_head == b_end) @@ -606,12 +578,12 @@ rtl_merge_blocks (basic_block a, basic_block b) } /* If there was a jump out of A, delete it. */ - if (GET_CODE (a_end) == JUMP_INSN) + if (JUMP_P (a_end)) { rtx prev; for (prev = PREV_INSN (a_end); ; prev = PREV_INSN (prev)) - if (GET_CODE (prev) != NOTE + if (!NOTE_P (prev) || NOTE_LINE_NUMBER (prev) == NOTE_INSN_BASIC_BLOCK || prev == BB_HEAD (a)) break; @@ -634,13 +606,12 @@ rtl_merge_blocks (basic_block a, basic_block b) a_end = PREV_INSN (del_first); } - else if (GET_CODE (NEXT_INSN (a_end)) == BARRIER) + else if (BARRIER_P (NEXT_INSN (a_end))) del_first = NEXT_INSN (a_end); - update_cfg_after_block_merging (a, b); - /* Delete everything marked above as well as crap that might be hanging out between the two blocks. */ + BB_HEAD (b) = NULL; delete_insn_chain (del_first, del_last); /* Reassociate the insns of B with A. */ @@ -657,22 +628,38 @@ rtl_merge_blocks (basic_block a, basic_block b) } BB_END (a) = a_end; + a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end; } /* Return true when block A and B can be merged. */ static bool rtl_can_merge_blocks (basic_block a,basic_block b) { + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (a) != BB_PARTITION (b)) + return false; + /* There must be exactly one edge in between the blocks. */ - return (a->succ && !a->succ->succ_next && a->succ->dest == b - && !b->pred->pred_next && a != b + return (single_succ_p (a) + && single_succ (a) == b + && single_pred_p (b) + && a != b /* Must be simple edge. */ - && !(a->succ->flags & EDGE_COMPLEX) + && !(single_succ_edge (a)->flags & EDGE_COMPLEX) && a->next_bb == b && a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (BB_END (a)) != JUMP_INSN + && (!JUMP_P (BB_END (a)) || (reload_completed ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))); } @@ -686,7 +673,7 @@ block_label (basic_block block) if (block == EXIT_BLOCK_PTR) return NULL_RTX; - if (GET_CODE (BB_HEAD (block)) != CODE_LABEL) + if (!LABEL_P (BB_HEAD (block))) { BB_HEAD (block) = emit_label_before (gen_label_rtx (), BB_HEAD (block)); } @@ -699,29 +686,47 @@ block_label (basic_block block) apply only if all edges now point to the same block. The parameters and return values are equivalent to redirect_edge_and_branch. */ -bool +edge try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) { basic_block src = e->src; rtx insn = BB_END (src), kill_from; - edge tmp; rtx set; int fallthru = 0; - /* Verify that all targets will be TARGET. */ - for (tmp = src->succ; tmp; tmp = tmp->succ_next) - if (tmp->dest != target && tmp != e) - break; + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. - if (tmp || !onlyjump_p (insn)) - return false; + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX) + || BB_PARTITION (src) != BB_PARTITION (target)) + return NULL; + + /* We can replace or remove a complex jump only when we have exactly + two edges. Also, if we have exactly one outgoing edge, we can + redirect that. */ + if (EDGE_COUNT (src->succs) >= 3 + /* Verify that all targets will be TARGET. Specifically, the + edge that is not E must also go to TARGET. */ + || (EDGE_COUNT (src->succs) == 2 + && EDGE_SUCC (src, EDGE_SUCC (src, 0) == e)->dest != target)) + return NULL; + + if (!onlyjump_p (insn)) + return NULL; if ((!optimize || reload_completed) && tablejump_p (insn, NULL, NULL)) - return false; + return NULL; /* Avoid removing branch with side effects. */ set = single_set (insn); if (!set || side_effects_p (set)) - return false; + return NULL; /* In case we zap a conditional jump, we'll need to kill the cc0 setter too. */ @@ -734,57 +739,56 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) /* See if we can create the fallthru edge. */ if (in_cfglayout || can_fallthru (src, target)) { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Removing jump %i.\n", INSN_UID (insn)); + if (dump_file) + fprintf (dump_file, "Removing jump %i.\n", INSN_UID (insn)); fallthru = 1; /* Selectively unlink whole insn chain. */ if (in_cfglayout) { - rtx insn = src->rbi->footer; + rtx insn = src->il.rtl->footer; - delete_insn_chain (kill_from, BB_END (src)); + delete_insn_chain (kill_from, BB_END (src)); /* Remove barriers but keep jumptables. */ while (insn) { - if (GET_CODE (insn) == BARRIER) + if (BARRIER_P (insn)) { if (PREV_INSN (insn)) NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); else - src->rbi->footer = NEXT_INSN (insn); + src->il.rtl->footer = NEXT_INSN (insn); if (NEXT_INSN (insn)) PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); } - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) break; insn = NEXT_INSN (insn); } } else - delete_insn_chain (kill_from, PREV_INSN (BB_HEAD (target))); + delete_insn_chain (kill_from, PREV_INSN (BB_HEAD (target))); } /* If this already is simplejump, redirect it. */ else if (simplejump_p (insn)) { if (e->dest == target) - return false; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Redirecting jump %i from %i to %i.\n", + return NULL; + if (dump_file) + fprintf (dump_file, "Redirecting jump %i from %i to %i.\n", INSN_UID (insn), e->dest->index, target->index); if (!redirect_jump (insn, block_label (target), 0)) { - if (target == EXIT_BLOCK_PTR) - return false; - abort (); + gcc_assert (target == EXIT_BLOCK_PTR); + return NULL; } } /* Cannot do anything for target exit block. */ else if (target == EXIT_BLOCK_PTR) - return false; + return NULL; /* Or replace possibly complicated jump insn by simple jump insn. */ else @@ -795,8 +799,8 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) emit_jump_insn_after_noloc (gen_jump (target_label), insn); JUMP_LABEL (BB_END (src)) = target_label; LABEL_NUSES (target_label)++; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Replacing insn %i by jump %i\n", + if (dump_file) + fprintf (dump_file, "Replacing insn %i by jump %i\n", INSN_UID (insn), INSN_UID (BB_END (src))); @@ -809,7 +813,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) delete_insn_chain (label, table); barrier = next_nonnote_insn (BB_END (src)); - if (!barrier || GET_CODE (barrier) != BARRIER) + if (!barrier || !BARRIER_P (barrier)) emit_barrier_after (BB_END (src)); else { @@ -838,9 +842,11 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) } /* Keep only one edge out and set proper flags. */ - while (src->succ->succ_next) - remove_edge (src->succ); - e = src->succ; + if (!single_succ_p (src)) + remove_edge (e); + gcc_assert (single_succ_p (src)); + + e = single_succ_edge (src); if (fallthru) e->flags = EDGE_FALLTHRU; else @@ -851,40 +857,19 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) /* We don't want a block to end on a line-number note since that has the potential of changing the code between -g and not -g. */ - while (GET_CODE (BB_END (e->src)) == NOTE + while (NOTE_P (BB_END (e->src)) && NOTE_LINE_NUMBER (BB_END (e->src)) >= 0) delete_insn (BB_END (e->src)); if (e->dest != target) redirect_edge_succ (e, target); - return true; + return e; } -/* Return last loop_beg note appearing after INSN, before start of next - basic block. Return INSN if there are no such notes. - - When emitting jump to redirect a fallthru edge, it should always appear - after the LOOP_BEG notes, as loop optimizer expect loop to either start by - fallthru edge or jump following the LOOP_BEG note jumping to the loop exit - test. */ - -static rtx -last_loop_beg_note (rtx insn) -{ - rtx last = insn; - - for (insn = NEXT_INSN (insn); insn && GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK; - insn = NEXT_INSN (insn)) - if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) - last = insn; - - return last; -} - -/* Redirect edge representing branch of (un)conditional jump or tablejump. */ -static bool +/* Redirect edge representing branch of (un)conditional jump or tablejump, + NULL on failure */ +static edge redirect_branch_edge (edge e, basic_block target) { rtx tmp; @@ -894,9 +879,9 @@ redirect_branch_edge (edge e, basic_block target) /* We can only redirect non-fallthru edges of jump insn. */ if (e->flags & EDGE_FALLTHRU) - return false; - else if (GET_CODE (insn) != JUMP_INSN) - return false; + return NULL; + else if (!JUMP_P (insn)) + return NULL; /* Recognize a tablejump and adjust all matching cases. */ if (tablejump_p (insn, NULL, &tmp)) @@ -906,7 +891,7 @@ redirect_branch_edge (edge e, basic_block target) rtx new_label = block_label (target); if (target == EXIT_BLOCK_PTR) - return false; + return NULL; if (GET_CODE (PATTERN (tmp)) == ADDR_VEC) vec = XVEC (PATTERN (tmp), 0); else @@ -927,7 +912,7 @@ redirect_branch_edge (edge e, basic_block target) && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF && XEXP (XEXP (SET_SRC (tmp), 2), 0) == old_label) { - XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (VOIDmode, + XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (Pmode, new_label); --LABEL_NUSES (old_label); ++LABEL_NUSES (new_label); @@ -941,30 +926,28 @@ redirect_branch_edge (edge e, basic_block target) if (computed_jump_p (insn) /* A return instruction can't be redirected. */ || returnjump_p (insn)) - return false; + return NULL; /* If the insn doesn't go where we think, we're confused. */ - if (JUMP_LABEL (insn) != old_label) - abort (); + gcc_assert (JUMP_LABEL (insn) == old_label); /* If the substitution doesn't succeed, die. This can happen if the back end emitted unrecognizable instructions or if target is exit block on some arches. */ if (!redirect_jump (insn, block_label (target), 0)) { - if (target == EXIT_BLOCK_PTR) - return false; - abort (); + gcc_assert (target == EXIT_BLOCK_PTR); + return NULL; } } - if (rtl_dump_file) - fprintf (rtl_dump_file, "Edge %i->%i redirected to %i\n", + if (dump_file) + fprintf (dump_file, "Edge %i->%i redirected to %i\n", e->src->index, e->dest->index, target->index); if (e->dest != target) - redirect_edge_succ_nodup (e, target); - return true; + e = redirect_edge_succ_nodup (e, target); + return e; } /* Attempt to change code to redirect edge E to TARGET. Don't do that on @@ -973,32 +956,41 @@ redirect_branch_edge (edge e, basic_block target) Function can be also called with edge destination equivalent to the TARGET. Then it should try the simplifications and do nothing if none is possible. - Return true if transformation succeeded. We still return false in case E - already destinated TARGET and we didn't managed to simplify instruction - stream. */ + Return edge representing the branch if transformation succeeded. Return NULL + on failure. + We still return NULL in case E already destinated TARGET and we didn't + managed to simplify instruction stream. */ -static bool +static edge rtl_redirect_edge_and_branch (edge e, basic_block target) { + edge ret; + basic_block src = e->src; + if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) - return false; + return NULL; if (e->dest == target) - return true; + return e; - if (try_redirect_by_replacing_jump (e, target, false)) - return true; + if ((ret = try_redirect_by_replacing_jump (e, target, false)) != NULL) + { + src->flags |= BB_DIRTY; + return ret; + } - if (!redirect_branch_edge (e, target)) - return false; + ret = redirect_branch_edge (e, target); + if (!ret) + return NULL; - return true; + src->flags |= BB_DIRTY; + return ret; } /* Like force_nonfallthru below, but additionally performs redirection Used by redirect_edge_and_branch_force. */ -basic_block +static basic_block force_nonfallthru_and_redirect (edge e, basic_block target) { basic_block jump_block, new_bb = NULL, src = e->src; @@ -1011,16 +1003,15 @@ force_nonfallthru_and_redirect (edge e, basic_block target) by creating a basic block afterwards to redirect fallthru edge. */ if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR && any_condjump_p (BB_END (e->src)) - /* When called from cfglayout, fallthru edges do not - necessarily go to the next block. */ - && e->src->next_bb == e->dest && JUMP_LABEL (BB_END (e->src)) == BB_HEAD (e->dest)) { rtx note; edge b = unchecked_make_edge (e->src, target, 0); + bool redirected; + + redirected = redirect_jump (BB_END (e->src), block_label (target), 0); + gcc_assert (redirected); - if (!redirect_jump (BB_END (e->src), block_label (target), 0)) - abort (); note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX); if (note) { @@ -1044,35 +1035,47 @@ force_nonfallthru_and_redirect (edge e, basic_block target) We can't redirect abnormal edge, but we still can split the fallthru one and create separate abnormal edge to original destination. This allows bb-reorder to make such edge non-fallthru. */ - if (e->dest != target) - abort (); + gcc_assert (e->dest == target); abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU); e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU; } - else if (!(e->flags & EDGE_FALLTHRU)) - abort (); - else if (e->src == ENTRY_BLOCK_PTR) + else { - /* We can't redirect the entry block. Create an empty block at the - start of the function which we use to add the new jump. */ - edge *pe1; - basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR); + gcc_assert (e->flags & EDGE_FALLTHRU); + if (e->src == ENTRY_BLOCK_PTR) + { + /* We can't redirect the entry block. Create an empty block + at the start of the function which we use to add the new + jump. */ + edge tmp; + edge_iterator ei; + bool found = false; - /* Change the existing edge's source to be the new block, and add - a new edge from the entry block to the new block. */ - e->src = bb; - for (pe1 = &ENTRY_BLOCK_PTR->succ; *pe1; pe1 = &(*pe1)->succ_next) - if (*pe1 == e) - { - *pe1 = e->succ_next; - break; - } - e->succ_next = 0; - bb->succ = e; - make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU); + basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR); + + /* Change the existing edge's source to be the new block, and add + a new edge from the entry block to the new block. */ + e->src = bb; + for (ei = ei_start (ENTRY_BLOCK_PTR->succs); (tmp = ei_safe_edge (ei)); ) + { + if (tmp == e) + { + VEC_unordered_remove (edge, ENTRY_BLOCK_PTR->succs, ei.index); + found = true; + break; + } + else + ei_next (&ei); + } + + gcc_assert (found); + + VEC_safe_push (edge, gc, bb->succs, e); + make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU); + } } - if (e->src->succ->succ_next || abnormal_edge_flags) + if (EDGE_COUNT (e->src->succs) >= 2 || abnormal_edge_flags) { /* Create the new structures. */ @@ -1081,9 +1084,6 @@ force_nonfallthru_and_redirect (edge e, basic_block target) forward from the last instruction of the old block. */ if (!tablejump_p (BB_END (e->src), NULL, ¬e)) note = BB_END (e->src); - - /* Position the new block correctly relative to loop notes. */ - note = last_loop_beg_note (note); note = NEXT_INSN (note); jump_block = create_basic_block (note, NULL, e->src); @@ -1091,18 +1091,30 @@ force_nonfallthru_and_redirect (edge e, basic_block target) jump_block->frequency = EDGE_FREQUENCY (e); jump_block->loop_depth = target->loop_depth; - if (target->global_live_at_start) + if (target->il.rtl->global_live_at_start) { - jump_block->global_live_at_start - = OBSTACK_ALLOC_REG_SET (&flow_obstack); - jump_block->global_live_at_end - = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (jump_block->global_live_at_start, - target->global_live_at_start); - COPY_REG_SET (jump_block->global_live_at_end, - target->global_live_at_start); + jump_block->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + jump_block->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (jump_block->il.rtl->global_live_at_start, + target->il.rtl->global_live_at_start); + COPY_REG_SET (jump_block->il.rtl->global_live_at_end, + target->il.rtl->global_live_at_start); } + /* Make sure new block ends up in correct hot/cold section. */ + + BB_COPY_PARTITION (jump_block, e->src); + if (flag_reorder_blocks_and_partition + && targetm.have_named_sections + && JUMP_P (BB_END (jump_block)) + && !any_condjump_p (BB_END (jump_block)) + && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING)) + REG_NOTES (BB_END (jump_block)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP, + NULL_RTX, + REG_NOTES + (BB_END + (jump_block))); + /* Wire edge in. */ new_edge = make_edge (e->src, jump_block, EDGE_FALLTHRU); new_edge->probability = e->probability; @@ -1120,10 +1132,11 @@ force_nonfallthru_and_redirect (edge e, basic_block target) e->flags &= ~EDGE_FALLTHRU; if (target == EXIT_BLOCK_PTR) { - if (HAVE_return) +#ifdef HAVE_return emit_jump_insn_after_noloc (gen_return (), BB_END (jump_block)); - else - abort (); +#else + gcc_unreachable (); +#endif } else { @@ -1154,7 +1167,7 @@ force_nonfallthru (edge e) /* Redirect edge even at the expense of creating new jump insn or basic block. Return new basic block if created, NULL otherwise. - Abort if conversion is impossible. */ + Conversion must be possible. */ static basic_block rtl_redirect_edge_and_branch_force (edge e, basic_block target) @@ -1165,20 +1178,22 @@ rtl_redirect_edge_and_branch_force (edge e, basic_block target) /* In case the edge redirection failed, try to force it to be non-fallthru and redirect newly created simplejump. */ + e->src->flags |= BB_DIRTY; return force_nonfallthru_and_redirect (e, target); } /* The given edge should potentially be a fallthru edge. If that is in fact true, delete the jump and barriers that are in the way. */ -void -tidy_fallthru_edge (edge e, basic_block b, basic_block c) +static void +rtl_tidy_fallthru_edge (edge e) { rtx q; + basic_block b = e->src, c = b->next_bb; /* ??? In a late-running flow pass, other folks may have deleted basic blocks by nopping out blocks, leaving multiple BARRIERs between here - and the target label. They ought to be chastized and fixed. + and the target label. They ought to be chastised and fixed. We can also wind up with a sequence of undeletable labels between one block and the next. @@ -1194,10 +1209,10 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c) If block B consisted only of this single jump, turn it into a deleted note. */ q = BB_END (b); - if (GET_CODE (q) == JUMP_INSN + if (JUMP_P (q) && onlyjump_p (q) && (any_uncondjump_p (q) - || (b->succ == e && e->succ_next == NULL))) + || single_succ_p (b))) { #ifdef HAVE_cc0 /* If this was a conditional jump, we need to also delete @@ -1210,7 +1225,7 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c) /* We don't want a block to end on a line-number note since that has the potential of changing the code between -g and not -g. */ - while (GET_CODE (q) == NOTE && NOTE_LINE_NUMBER (q) >= 0) + while (NOTE_P (q) && NOTE_LINE_NUMBER (q) >= 0) q = PREV_INSN (q); } @@ -1220,85 +1235,18 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c) e->flags |= EDGE_FALLTHRU; } - -/* Fix up edges that now fall through, or rather should now fall through - but previously required a jump around now deleted blocks. Simplify - the search by only examining blocks numerically adjacent, since this - is how find_basic_blocks created them. */ - -void -tidy_fallthru_edges (void) -{ - basic_block b, c; - - if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR) - return; - - FOR_BB_BETWEEN (b, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, next_bb) - { - edge s; - - c = b->next_bb; - - /* We care about simple conditional or unconditional jumps with - a single successor. - - If we had a conditional branch to the next instruction when - find_basic_blocks was called, then there will only be one - out edge for the block which ended with the conditional - branch (since we do not create duplicate edges). - - Furthermore, the edge will be marked as a fallthru because we - merge the flags for the duplicate edges. So we do not want to - check that the edge is not a FALLTHRU edge. */ - - if ((s = b->succ) != NULL - && ! (s->flags & EDGE_COMPLEX) - && s->succ_next == NULL - && s->dest == c - /* If the jump insn has side effects, we can't tidy the edge. */ - && (GET_CODE (BB_END (b)) != JUMP_INSN - || onlyjump_p (BB_END (b)))) - tidy_fallthru_edge (s, b, c); - } -} -/* Helper function for split_edge. Return true in case edge BB2 to BB1 - is back edge of syntactic loop. */ +/* Should move basic block BB after basic block AFTER. NIY. */ static bool -back_edge_of_syntactic_loop_p (basic_block bb1, basic_block bb2) +rtl_move_block_after (basic_block bb ATTRIBUTE_UNUSED, + basic_block after ATTRIBUTE_UNUSED) { - rtx insn; - int count = 0; - basic_block bb; - - if (bb1 == bb2) - return true; - - /* ??? Could we guarantee that bb indices are monotone, so that we could - just compare them? */ - for (bb = bb1; bb && bb != bb2; bb = bb->next_bb) - continue; - - if (!bb) - return false; - - for (insn = BB_END (bb1); insn != BB_HEAD (bb2) && count >= 0; - insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == NOTE) - { - if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) - count++; - else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END) - count--; - } - - return count >= 0; + return false; } /* Split a (typically critical) edge. Return the new block. - Abort on abnormal edges. + The edge must not be abnormal. ??? The code generally expects to be called on critical edges. The case of a block ending in an unconditional jump to a @@ -1311,16 +1259,16 @@ rtl_split_edge (edge edge_in) rtx before; /* Abnormal edges cannot be split. */ - if ((edge_in->flags & EDGE_ABNORMAL) != 0) - abort (); + gcc_assert (!(edge_in->flags & EDGE_ABNORMAL)); /* We are going to place the new block in front of edge destination. Avoid existence of fallthru predecessors. */ if ((edge_in->flags & EDGE_FALLTHRU) == 0) { edge e; + edge_iterator ei; - for (e = edge_in->dest->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, edge_in->dest->preds) if (e->flags & EDGE_FALLTHRU) break; @@ -1328,49 +1276,36 @@ rtl_split_edge (edge edge_in) force_nonfallthru (e); } - /* Create the basic block note. - - Where we place the note can have a noticeable impact on the generated - code. Consider this cfg: - - E - | - 0 - / \ - +->1-->2--->E - | | - +--+ - - If we need to insert an insn on the edge from block 0 to block 1, - we want to ensure the instructions we insert are outside of any - loop notes that physically sit between block 0 and block 1. Otherwise - we confuse the loop optimizer into thinking the loop is a phony. */ - - if (edge_in->dest != EXIT_BLOCK_PTR - && PREV_INSN (BB_HEAD (edge_in->dest)) - && GET_CODE (PREV_INSN (BB_HEAD (edge_in->dest))) == NOTE - && (NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (edge_in->dest))) - == NOTE_INSN_LOOP_BEG) - && !back_edge_of_syntactic_loop_p (edge_in->dest, edge_in->src)) - before = PREV_INSN (BB_HEAD (edge_in->dest)); - else if (edge_in->dest != EXIT_BLOCK_PTR) + /* Create the basic block note. */ + if (edge_in->dest != EXIT_BLOCK_PTR) before = BB_HEAD (edge_in->dest); else before = NULL_RTX; - bb = create_basic_block (before, NULL, edge_in->dest->prev_bb); - bb->count = edge_in->count; - bb->frequency = EDGE_FREQUENCY (edge_in); + /* If this is a fall through edge to the exit block, the blocks might be + not adjacent, and the right place is the after the source. */ + if (edge_in->flags & EDGE_FALLTHRU && edge_in->dest == EXIT_BLOCK_PTR) + { + before = NEXT_INSN (BB_END (edge_in->src)); + bb = create_basic_block (before, NULL, edge_in->src); + BB_COPY_PARTITION (bb, edge_in->src); + } + else + { + bb = create_basic_block (before, NULL, edge_in->dest->prev_bb); + /* ??? Why not edge_in->dest->prev_bb here? */ + BB_COPY_PARTITION (bb, edge_in->dest); + } /* ??? This info is likely going to be out of date very soon. */ - if (edge_in->dest->global_live_at_start) + if (edge_in->dest->il.rtl->global_live_at_start) { - bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); - bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (bb->global_live_at_start, - edge_in->dest->global_live_at_start); - COPY_REG_SET (bb->global_live_at_end, - edge_in->dest->global_live_at_start); + bb->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + bb->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (bb->il.rtl->global_live_at_start, + edge_in->dest->il.rtl->global_live_at_start); + COPY_REG_SET (bb->il.rtl->global_live_at_end, + edge_in->dest->il.rtl->global_live_at_start); } make_single_succ_edge (bb, edge_in->dest, EDGE_FALLTHRU); @@ -1379,8 +1314,8 @@ rtl_split_edge (edge edge_in) jump instruction to target our new block. */ if ((edge_in->flags & EDGE_FALLTHRU) == 0) { - if (!redirect_edge_and_branch (edge_in, bb)) - abort (); + edge redirected = redirect_edge_and_branch (edge_in, bb); + gcc_assert (redirected); } else redirect_edge_succ (edge_in, bb); @@ -1397,115 +1332,19 @@ insert_insn_on_edge (rtx pattern, edge e) { /* We cannot insert instructions on an abnormal critical edge. It will be easier to find the culprit if we die now. */ - if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)) - abort (); + gcc_assert (!((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))); - if (e->insns == NULL_RTX) + if (e->insns.r == NULL_RTX) start_sequence (); else - push_to_sequence (e->insns); + push_to_sequence (e->insns.r); emit_insn (pattern); - e->insns = get_insns (); + e->insns.r = get_insns (); end_sequence (); } -/* Called from safe_insert_insn_on_edge through note_stores, marks live - registers that are killed by the store. */ -static void -mark_killed_regs (rtx reg, rtx set ATTRIBUTE_UNUSED, void *data) -{ - regset killed = data; - int regno, i; - - if (GET_CODE (reg) == SUBREG) - reg = SUBREG_REG (reg); - if (!REG_P (reg)) - return; - regno = REGNO (reg); - if (regno >= FIRST_PSEUDO_REGISTER) - SET_REGNO_REG_SET (killed, regno); - else - { - for (i = 0; i < (int) HARD_REGNO_NREGS (regno, GET_MODE (reg)); i++) - SET_REGNO_REG_SET (killed, regno + i); - } -} - -/* Similar to insert_insn_on_edge, tries to put INSN to edge E. Additionally - it checks whether this will not clobber the registers that are live on the - edge (i.e. it requires liveness information to be up-to-date) and if there - are some, then it tries to save and restore them. Returns true if - successful. */ -bool -safe_insert_insn_on_edge (rtx insn, edge e) -{ - rtx x; - regset_head killed_head; - regset killed = INITIALIZE_REG_SET (killed_head); - rtx save_regs = NULL_RTX; - int regno, noccmode; - enum machine_mode mode; - -#ifdef AVOID_CCMODE_COPIES - noccmode = true; -#else - noccmode = false; -#endif - - for (x = insn; x; x = NEXT_INSN (x)) - if (INSN_P (x)) - note_stores (PATTERN (x), mark_killed_regs, killed); - bitmap_operation (killed, killed, e->dest->global_live_at_start, - BITMAP_AND); - - EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, - { - mode = regno < FIRST_PSEUDO_REGISTER - ? reg_raw_mode[regno] - : GET_MODE (regno_reg_rtx[regno]); - if (mode == VOIDmode) - return false; - - if (noccmode && mode == CCmode) - return false; - - save_regs = alloc_EXPR_LIST (0, - alloc_EXPR_LIST (0, - gen_reg_rtx (mode), - gen_raw_REG (mode, regno)), - save_regs); - }); - - if (save_regs) - { - rtx from, to; - - start_sequence (); - for (x = save_regs; x; x = XEXP (x, 1)) - { - from = XEXP (XEXP (x, 0), 1); - to = XEXP (XEXP (x, 0), 0); - emit_move_insn (to, from); - } - emit_insn (insn); - for (x = save_regs; x; x = XEXP (x, 1)) - { - from = XEXP (XEXP (x, 0), 0); - to = XEXP (XEXP (x, 0), 1); - emit_move_insn (to, from); - } - insn = get_insns (); - end_sequence (); - free_EXPR_LIST_list (&save_regs); - } - insert_insn_on_edge (insn, e); - - FREE_REG_SET (killed); - return true; -} - /* Update the CFG for the instructions queued on edge E. */ static void @@ -1515,14 +1354,15 @@ commit_one_edge_insertion (edge e, int watch_calls) basic_block bb = NULL; /* Pull the insns off the edge now since the edge might go away. */ - insns = e->insns; - e->insns = NULL_RTX; + insns = e->insns.r; + e->insns.r = NULL_RTX; /* Special case -- avoid inserting code between call and storing its return value. */ - if (watch_calls && (e->flags & EDGE_FALLTHRU) && !e->dest->pred->pred_next + if (watch_calls && (e->flags & EDGE_FALLTHRU) + && single_pred_p (e->dest) && e->src != ENTRY_BLOCK_PTR - && GET_CODE (BB_END (e->src)) == CALL_INSN) + && CALL_P (BB_END (e->src))) { rtx next = next_nonnote_insn (BB_END (e->src)); @@ -1539,15 +1379,15 @@ commit_one_edge_insertion (edge e, int watch_calls) if (!before && !after) { /* Figure out where to put these things. If the destination has - one predecessor, insert there. Except for the exit block. */ - if (e->dest->pred->pred_next == NULL && e->dest != EXIT_BLOCK_PTR) + one predecessor, insert there. Except for the exit block. */ + if (single_pred_p (e->dest) && e->dest != EXIT_BLOCK_PTR) { bb = e->dest; /* Get the location correct wrt a code label, and "nice" wrt a basic block note, and before everything else. */ tmp = BB_HEAD (bb); - if (GET_CODE (tmp) == CODE_LABEL) + if (LABEL_P (tmp)) tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); @@ -1560,9 +1400,9 @@ commit_one_edge_insertion (edge e, int watch_calls) } /* If the source has one successor and the edge is not abnormal, - insert there. Except for the entry block. */ + insert there. Except for the entry block. */ else if ((e->flags & EDGE_ABNORMAL) == 0 - && e->src->succ->succ_next == NULL + && single_succ_p (e->src) && e->src != ENTRY_BLOCK_PTR) { bb = e->src; @@ -1573,17 +1413,13 @@ commit_one_edge_insertion (edge e, int watch_calls) We know this block has a single successor, so we can just emit the queued insns before the jump. */ - if (GET_CODE (BB_END (bb)) == JUMP_INSN) - for (before = BB_END (bb); - GET_CODE (PREV_INSN (before)) == NOTE - && NOTE_LINE_NUMBER (PREV_INSN (before)) == - NOTE_INSN_LOOP_BEG; before = PREV_INSN (before)) - ; + if (JUMP_P (BB_END (bb))) + before = BB_END (bb); else { - /* We'd better be fallthru, or we've lost track of what's what. */ - if ((e->flags & EDGE_FALLTHRU) == 0) - abort (); + /* We'd better be fallthru, or we've lost track of + what's what. */ + gcc_assert (e->flags & EDGE_FALLTHRU); after = BB_END (bb); } @@ -1593,6 +1429,31 @@ commit_one_edge_insertion (edge e, int watch_calls) { bb = split_edge (e); after = BB_END (bb); + + if (flag_reorder_blocks_and_partition + && targetm.have_named_sections + && e->src != ENTRY_BLOCK_PTR + && BB_PARTITION (e->src) == BB_COLD_PARTITION + && !(e->flags & EDGE_CROSSING)) + { + rtx bb_note, cur_insn; + + bb_note = NULL_RTX; + for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb)); + cur_insn = NEXT_INSN (cur_insn)) + if (NOTE_P (cur_insn) + && NOTE_LINE_NUMBER (cur_insn) == NOTE_INSN_BASIC_BLOCK) + { + bb_note = cur_insn; + break; + } + + if (JUMP_P (BB_END (bb)) + && !any_condjump_p (BB_END (bb)) + && (single_succ_edge (bb)->flags & EDGE_CROSSING)) + REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST + (REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb))); + } } } @@ -1609,14 +1470,13 @@ commit_one_edge_insertion (edge e, int watch_calls) if (returnjump_p (last)) { /* ??? Remove all outgoing edges from BB and add one for EXIT. - This is not currently a problem because this only happens - for the (single) epilogue, which already has a fallthru edge - to EXIT. */ + This is not currently a problem because this only happens + for the (single) epilogue, which already has a fallthru edge + to EXIT. */ - e = bb->succ; - if (e->dest != EXIT_BLOCK_PTR - || e->succ_next != NULL || (e->flags & EDGE_FALLTHRU) == 0) - abort (); + e = single_succ_edge (bb); + gcc_assert (e->dest == EXIT_BLOCK_PTR + && single_succ_p (bb) && (e->flags & EDGE_FALLTHRU)); e->flags &= ~EDGE_FALLTHRU; emit_barrier_after (last); @@ -1624,10 +1484,10 @@ commit_one_edge_insertion (edge e, int watch_calls) if (before) delete_insn (before); } - else if (GET_CODE (last) == JUMP_INSN) - abort (); + else + gcc_assert (!JUMP_P (last)); - /* Mark the basic block for find_sub_basic_blocks. */ + /* Mark the basic block for find_many_sub_basic_blocks. */ bb->aux = &bb->aux; } @@ -1646,17 +1506,15 @@ commit_edge_insertions (void) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - edge e, next; + edge e; + edge_iterator ei; - for (e = bb->succ; e; e = next) - { - next = e->succ_next; - if (e->insns) - { - changed = true; - commit_one_edge_insertion (e, false); - } - } + FOR_EACH_EDGE (e, ei, bb->succs) + if (e->insns.r) + { + changed = true; + commit_one_edge_insertion (e, false); + } } if (!changed) @@ -1667,11 +1525,10 @@ commit_edge_insertions (void) FOR_EACH_BB (bb) if (bb->aux) { - SET_BIT (blocks, bb->index); + SET_BIT (blocks, bb->index); /* Check for forgotten bb->aux values before commit_edge_insertions call. */ - if (bb->aux != &bb->aux) - abort (); + gcc_assert (bb->aux == &bb->aux); bb->aux = NULL; } find_many_sub_basic_blocks (blocks); @@ -1694,17 +1551,15 @@ commit_edge_insertions_watch_calls (void) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) { - edge e, next; + edge e; + edge_iterator ei; - for (e = bb->succ; e; e = next) - { - next = e->succ_next; - if (e->insns) - { - changed = true; - commit_one_edge_insertion (e, true); - } - } + FOR_EACH_EDGE (e, ei, bb->succs) + if (e->insns.r) + { + changed = true; + commit_one_edge_insertion (e, true); + } } if (!changed) @@ -1715,35 +1570,40 @@ commit_edge_insertions_watch_calls (void) FOR_EACH_BB (bb) if (bb->aux) { - SET_BIT (blocks, bb->index); + SET_BIT (blocks, bb->index); /* Check for forgotten bb->aux values before commit_edge_insertions call. */ - if (bb->aux != &bb->aux) - abort (); + gcc_assert (bb->aux == &bb->aux); bb->aux = NULL; } find_many_sub_basic_blocks (blocks); sbitmap_free (blocks); } -/* Print out one basic block with live information at start and end. */ +/* Print out RTL-specific basic block information (live information + at start and end). */ static void -rtl_dump_bb (basic_block bb, FILE *outf) +rtl_dump_bb (basic_block bb, FILE *outf, int indent) { rtx insn; rtx last; + char *s_indent; - fputs (";; Registers live at start:", outf); - dump_regset (bb->global_live_at_start, outf); + s_indent = alloca ((size_t) indent + 1); + memset (s_indent, ' ', (size_t) indent); + s_indent[indent] = '\0'; + + fprintf (outf, ";;%s Registers live at start: ", s_indent); + dump_regset (bb->il.rtl->global_live_at_start, outf); putc ('\n', outf); for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last; insn = NEXT_INSN (insn)) print_rtl_single (outf, insn); - fputs (";; Registers live at end:", outf); - dump_regset (bb->global_live_at_end, outf); + fprintf (outf, ";;%s Registers live at end: ", s_indent); + dump_regset (bb->il.rtl->global_live_at_end, outf); putc ('\n', outf); } @@ -1761,9 +1621,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first) { enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB }; int max_uid = get_max_uid (); - basic_block *start = xcalloc (max_uid, sizeof (basic_block)); - basic_block *end = xcalloc (max_uid, sizeof (basic_block)); - enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state)); + basic_block *start = XCNEWVEC (basic_block, max_uid); + basic_block *end = XCNEWVEC (basic_block, max_uid); + enum bb_state *in_bb_p = XCNEWVEC (enum bb_state, max_uid); basic_block bb; @@ -1794,13 +1654,13 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first) { fprintf (outf, ";; Start of basic block %d, registers live:", bb->index); - dump_regset (bb->global_live_at_start, outf); + dump_regset (bb->il.rtl->global_live_at_start, outf); putc ('\n', outf); } if (in_bb_p[INSN_UID (tmp_rtx)] == NOT_IN_BB - && GET_CODE (tmp_rtx) != NOTE - && GET_CODE (tmp_rtx) != BARRIER) + && !NOTE_P (tmp_rtx) + && !BARRIER_P (tmp_rtx)) fprintf (outf, ";; Insn is not within a basic block\n"); else if (in_bb_p[INSN_UID (tmp_rtx)] == IN_MULTIPLE_BB) fprintf (outf, ";; Insn is in multiple basic blocks\n"); @@ -1811,7 +1671,7 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first) { fprintf (outf, ";; End of basic block %d, registers live:\n", bb->index); - dump_regset (bb->global_live_at_end, outf); + dump_regset (bb->il.rtl->global_live_at_end, outf); putc ('\n', outf); } @@ -1837,13 +1697,36 @@ void update_br_prob_note (basic_block bb) { rtx note; - if (GET_CODE (BB_END (bb)) != JUMP_INSN) + if (!JUMP_P (BB_END (bb))) return; note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX); if (!note || INTVAL (XEXP (note, 0)) == BRANCH_EDGE (bb)->probability) return; XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability); } + +/* Get the last insn associated with block BB (that includes barriers and + tablejumps after BB). */ +rtx +get_last_bb_insn (basic_block bb) +{ + rtx tmp; + rtx end = BB_END (bb); + + /* Include any jump table following the basic block. */ + if (tablejump_p (end, NULL, &tmp)) + end = tmp; + + /* Include any barriers that may follow the basic block. */ + tmp = next_nonnote_insn (end); + while (tmp && BARRIER_P (tmp)) + { + end = tmp; + tmp = next_nonnote_insn (end); + } + + return end; +} /* Verify the CFG and RTL consistency common for both underlying RTL and cfglayout RTL. @@ -1856,9 +1739,11 @@ update_br_prob_note (basic_block bb) - tails of basic blocks (ensure that boundary is necessary) - scans body of the basic block for JUMP_INSN, CODE_LABEL and NOTE_INSN_BASIC_BLOCK + - verify that no fall_thru edge crosses hot/cold partition boundaries In future it can be extended check a lot of other stuff as well (reachability of basic blocks, life information, etc. etc.). */ + static int rtl_verify_flow_info_1 (void) { @@ -1867,12 +1752,9 @@ rtl_verify_flow_info_1 (void) basic_block *bb_info; rtx x; int err = 0; - basic_block bb, last_bb_seen; + basic_block bb; - bb_info = xcalloc (max_uid, sizeof (basic_block)); - - /* Check bb chain & numbers. */ - last_bb_seen = ENTRY_BLOCK_PTR; + bb_info = XCNEWVEC (basic_block, max_uid); FOR_EACH_BB_REVERSE (bb) { @@ -1884,6 +1766,12 @@ rtl_verify_flow_info_1 (void) if (x == end) break; + if (!(bb->flags & BB_RTL)) + { + error ("BB_RTL flag not set for block %d", bb->index); + err = 1; + } + if (!x) { error ("end insn %d for block %d not found in the insn stream", @@ -1926,28 +1814,42 @@ rtl_verify_flow_info_1 (void) int n_fallthru = 0, n_eh = 0, n_call = 0, n_abnormal = 0, n_branch = 0; edge e, fallthru = NULL; rtx note; + edge_iterator ei; - if (INSN_P (BB_END (bb)) + if (JUMP_P (BB_END (bb)) && (note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX)) - && bb->succ && bb->succ->succ_next + && EDGE_COUNT (bb->succs) >= 2 && any_condjump_p (BB_END (bb))) { - if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability) + if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability + && profile_status != PROFILE_ABSENT) { error ("verify_flow_info: REG_BR_PROB does not match cfg %wi %i", INTVAL (XEXP (note, 0)), BRANCH_EDGE (bb)->probability); err = 1; } } - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) { if (e->flags & EDGE_FALLTHRU) - n_fallthru++, fallthru = e; + { + n_fallthru++, fallthru = e; + if ((e->flags & EDGE_CROSSING) + || (BB_PARTITION (e->src) != BB_PARTITION (e->dest) + && e->src != ENTRY_BLOCK_PTR + && e->dest != EXIT_BLOCK_PTR)) + { + error ("fallthru edge crosses section boundary (bb %i)", + e->src->index); + err = 1; + } + } if ((e->flags & ~(EDGE_DFS_BACK | EDGE_CAN_FALLTHRU | EDGE_IRREDUCIBLE_LOOP - | EDGE_LOOP_EXIT)) == 0) + | EDGE_LOOP_EXIT + | EDGE_CROSSING)) == 0) n_branch++; if (e->flags & EDGE_ABNORMAL_CALL) @@ -1962,50 +1864,53 @@ rtl_verify_flow_info_1 (void) if (n_eh && GET_CODE (PATTERN (BB_END (bb))) != RESX && !find_reg_note (BB_END (bb), REG_EH_REGION, NULL_RTX)) { - error ("Missing REG_EH_REGION note in the end of bb %i", bb->index); + error ("missing REG_EH_REGION note in the end of bb %i", bb->index); err = 1; } if (n_branch - && (GET_CODE (BB_END (bb)) != JUMP_INSN + && (!JUMP_P (BB_END (bb)) || (n_branch > 1 && (any_uncondjump_p (BB_END (bb)) || any_condjump_p (BB_END (bb)))))) { - error ("Too many outgoing branch edges from bb %i", bb->index); + error ("too many outgoing branch edges from bb %i", bb->index); err = 1; } if (n_fallthru && any_uncondjump_p (BB_END (bb))) { - error ("Fallthru edge after unconditional jump %i", bb->index); + error ("fallthru edge after unconditional jump %i", bb->index); err = 1; } if (n_branch != 1 && any_uncondjump_p (BB_END (bb))) { - error ("Wrong amount of branch edges after unconditional jump %i", bb->index); + error ("wrong amount of branch edges after unconditional jump %i", bb->index); err = 1; } if (n_branch != 1 && any_condjump_p (BB_END (bb)) && JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest)) { - error ("Wrong amount of branch edges after conditional jump %i", bb->index); + error ("wrong amount of branch edges after conditional jump %i", + bb->index); err = 1; } - if (n_call && GET_CODE (BB_END (bb)) != CALL_INSN) + if (n_call && !CALL_P (BB_END (bb))) { - error ("Call edges for non-call insn in bb %i", bb->index); + error ("call edges for non-call insn in bb %i", bb->index); err = 1; } if (n_abnormal - && (GET_CODE (BB_END (bb)) != CALL_INSN && n_call != n_abnormal) - && (GET_CODE (BB_END (bb)) != JUMP_INSN + && (!CALL_P (BB_END (bb)) && n_call != n_abnormal) + && (!JUMP_P (BB_END (bb)) || any_condjump_p (BB_END (bb)) || any_uncondjump_p (BB_END (bb)))) { - error ("Abnormal edges for no purpose in bb %i", bb->index); + error ("abnormal edges for no purpose in bb %i", bb->index); err = 1; } for (x = BB_HEAD (bb); x != NEXT_INSN (BB_END (bb)); x = NEXT_INSN (x)) - if (BLOCK_FOR_INSN (x) != bb) + /* We may have a barrier inside a basic block before dead code + elimination. There is no BLOCK_FOR_INSN field in a barrier. */ + if (!BARRIER_P (x) && BLOCK_FOR_INSN (x) != bb) { debug_rtx (x); if (! BLOCK_FOR_INSN (x)) @@ -2021,10 +1926,10 @@ rtl_verify_flow_info_1 (void) } /* OK pointers are correct. Now check the header of basic - block. It ought to contain optional CODE_LABEL followed + block. It ought to contain optional CODE_LABEL followed by NOTE_BASIC_BLOCK. */ x = BB_HEAD (bb); - if (GET_CODE (x) == CODE_LABEL) + if (LABEL_P (x)) { if (BB_END (bb) == x) { @@ -2044,7 +1949,7 @@ rtl_verify_flow_info_1 (void) } if (BB_END (bb) == x) - /* Do checks for empty blocks her. e */ + /* Do checks for empty blocks here. */ ; else for (x = NEXT_INSN (x); x; x = NEXT_INSN (x)) @@ -2094,7 +1999,15 @@ rtl_verify_flow_info (void) FOR_EACH_BB_REVERSE (bb) { edge e; - for (e = bb->succ; e; e = e->succ_next) + edge_iterator ei; + + if (bb->predictions) + { + error ("bb prediction set for block %i, but it is not used in RTL land", bb->index); + err = 1; + } + + FOR_EACH_EDGE (e, ei, bb->succs) if (e->flags & EDGE_FALLTHRU) break; if (!e) @@ -2102,10 +2015,10 @@ rtl_verify_flow_info (void) rtx insn; /* Ensure existence of barrier in BB with no fallthru edges. */ - for (insn = BB_END (bb); !insn || GET_CODE (insn) != BARRIER; + for (insn = BB_END (bb); !insn || !BARRIER_P (insn); insn = NEXT_INSN (insn)) if (!insn - || (GET_CODE (insn) == NOTE + || (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)) { error ("missing barrier after block %i", bb->index); @@ -2115,7 +2028,7 @@ rtl_verify_flow_info (void) } else if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR) - { + { rtx insn; if (e->src->next_bb != e->dest) @@ -2128,20 +2041,14 @@ rtl_verify_flow_info (void) else for (insn = NEXT_INSN (BB_END (e->src)); insn != BB_HEAD (e->dest); insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == BARRIER -#ifndef CASE_DROPS_THROUGH - || INSN_P (insn) -#else - || (INSN_P (insn) && ! JUMP_TABLE_DATA_P (insn)) -#endif - ) + if (BARRIER_P (insn) || INSN_P (insn)) { error ("verify_flow_info: Incorrect fallthru %i->%i", e->src->index, e->dest->index); fatal_insn ("wrong insn in the fallthru edge", insn); err = 1; } - } + } } num_bb_notes = 0; @@ -2169,9 +2076,9 @@ rtl_verify_flow_info (void) break; case CODE_LABEL: - /* An addr_vec is placed outside any block block. */ + /* An addr_vec is placed outside any basic block. */ if (NEXT_INSN (x) - && GET_CODE (NEXT_INSN (x)) == JUMP_INSN + && JUMP_P (NEXT_INSN (x)) && (GET_CODE (PATTERN (NEXT_INSN (x))) == ADDR_DIFF_VEC || GET_CODE (PATTERN (NEXT_INSN (x))) == ADDR_VEC)) x = NEXT_INSN (x); @@ -2184,16 +2091,15 @@ rtl_verify_flow_info (void) } } - if (INSN_P (x) - && GET_CODE (x) == JUMP_INSN + if (JUMP_P (x) && returnjump_p (x) && ! condjump_p (x) - && ! (NEXT_INSN (x) && GET_CODE (NEXT_INSN (x)) == BARRIER)) + && ! (NEXT_INSN (x) && BARRIER_P (NEXT_INSN (x)))) fatal_insn ("return not followed by barrier", x); if (curr_bb && x == BB_END (curr_bb)) curr_bb = NULL; } - if (num_bb_notes != n_basic_blocks) + if (num_bb_notes != n_basic_blocks - NUM_FIXED_BLOCKS) internal_error ("number of bb notes in insn chain (%d) != n_basic_blocks (%d)", num_bb_notes, n_basic_blocks); @@ -2208,12 +2114,14 @@ rtl_verify_flow_info (void) bool purge_dead_edges (basic_block bb) { - edge e, next; + edge e; rtx insn = BB_END (bb), note; bool purged = false; + bool found; + edge_iterator ei; /* If this instruction cannot trap, remove REG_EH_REGION notes. */ - if (GET_CODE (insn) == INSN + if (NONJUMP_INSN_P (insn) && (note = find_reg_note (insn, REG_EH_REGION, NULL))) { rtx eqnote; @@ -2225,33 +2133,48 @@ purge_dead_edges (basic_block bb) } /* Cleanup abnormal edges caused by exceptions or non-local gotos. */ - for (e = bb->succ; e; e = next) + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { - next = e->succ_next; + /* There are three types of edges we need to handle correctly here: EH + edges, abnormal call EH edges, and abnormal call non-EH edges. The + latter can appear when nonlocal gotos are used. */ if (e->flags & EDGE_EH) { - if (can_throw_internal (BB_END (bb))) - continue; + if (can_throw_internal (BB_END (bb)) + /* If this is a call edge, verify that this is a call insn. */ + && (! (e->flags & EDGE_ABNORMAL_CALL) + || CALL_P (BB_END (bb)))) + { + ei_next (&ei); + continue; + } } else if (e->flags & EDGE_ABNORMAL_CALL) { - if (GET_CODE (BB_END (bb)) == CALL_INSN + if (CALL_P (BB_END (bb)) && (! (note = find_reg_note (insn, REG_EH_REGION, NULL)) || INTVAL (XEXP (note, 0)) >= 0)) - continue; + { + ei_next (&ei); + continue; + } } else - continue; + { + ei_next (&ei); + continue; + } remove_edge (e); bb->flags |= BB_DIRTY; purged = true; } - if (GET_CODE (insn) == JUMP_INSN) + if (JUMP_P (insn)) { rtx note; edge b,f; + edge_iterator ei; /* We do care only about conditional jumps and simplejumps. */ if (!any_condjump_p (insn) @@ -2270,10 +2193,8 @@ purge_dead_edges (basic_block bb) remove_note (insn, note); } - for (e = bb->succ; e; e = next) + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { - next = e->succ_next; - /* Avoid abnormal flags to leak from computed jumps turned into simplejumps. */ @@ -2283,22 +2204,32 @@ purge_dead_edges (basic_block bb) if ((e->flags & EDGE_FALLTHRU) && any_condjump_p (insn)) /* A conditional jump can fall through into the next block, so we should keep the edge. */ - continue; + { + ei_next (&ei); + continue; + } else if (e->dest != EXIT_BLOCK_PTR && BB_HEAD (e->dest) == JUMP_LABEL (insn)) /* If the destination block is the target of the jump, keep the edge. */ - continue; + { + ei_next (&ei); + continue; + } else if (e->dest == EXIT_BLOCK_PTR && returnjump_p (insn)) /* If the destination block is the exit block, and this instruction is a return, then keep the edge. */ - continue; + { + ei_next (&ei); + continue; + } else if ((e->flags & EDGE_EH) && can_throw_internal (insn)) /* Keep the edges that correspond to exceptions thrown by this instruction and rematerialize the EDGE_ABNORMAL flag we just cleared above. */ { e->flags |= EDGE_ABNORMAL; + ei_next (&ei); continue; } @@ -2308,20 +2239,20 @@ purge_dead_edges (basic_block bb) remove_edge (e); } - if (!bb->succ || !purged) + if (EDGE_COUNT (bb->succs) == 0 || !purged) return purged; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Purged edges from bb %i\n", bb->index); + if (dump_file) + fprintf (dump_file, "Purged edges from bb %i\n", bb->index); if (!optimize) return purged; /* Redistribute probabilities. */ - if (!bb->succ->succ_next) + if (single_succ_p (bb)) { - bb->succ->probability = REG_BR_PROB_BASE; - bb->succ->count = bb->count; + single_succ_edge (bb)->probability = REG_BR_PROB_BASE; + single_succ_edge (bb)->count = bb->count; } else { @@ -2339,16 +2270,15 @@ purge_dead_edges (basic_block bb) return purged; } - else if (GET_CODE (insn) == CALL_INSN && SIBLING_CALL_P (insn)) + else if (CALL_P (insn) && SIBLING_CALL_P (insn)) { /* First, there should not be any EH or ABCALL edges resulting from non-local gotos and the like. If there were, we shouldn't have created the sibcall in the first place. Second, there should of course never have been a fallthru edge. */ - if (!bb->succ || bb->succ->succ_next) - abort (); - if (bb->succ->flags != (EDGE_SIBCALL | EDGE_ABNORMAL)) - abort (); + gcc_assert (single_succ_p (bb)); + gcc_assert (single_succ_edge (bb)->flags + == (EDGE_SIBCALL | EDGE_ABNORMAL)); return 0; } @@ -2358,32 +2288,39 @@ purge_dead_edges (basic_block bb) as these are only created by conditional branches. If we find such an edge we know that there used to be a jump here and can then safely remove all non-fallthru edges. */ - for (e = bb->succ; e && (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU)); - e = e->succ_next) - ; + found = false; + FOR_EACH_EDGE (e, ei, bb->succs) + if (! (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU))) + { + found = true; + break; + } - if (!e) + if (!found) return purged; - for (e = bb->succ; e; e = next) + /* Remove all but the fake and fallthru edges. The fake edge may be + the only successor for this block in the case of noreturn + calls. */ + for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { - next = e->succ_next; - if (!(e->flags & EDGE_FALLTHRU)) + if (!(e->flags & (EDGE_FALLTHRU | EDGE_FAKE))) { bb->flags |= BB_DIRTY; remove_edge (e); purged = true; } + else + ei_next (&ei); } - if (!bb->succ || bb->succ->succ_next) - abort (); + gcc_assert (single_succ_p (bb)); - bb->succ->probability = REG_BR_PROB_BASE; - bb->succ->count = bb->count; + single_succ_edge (bb)->probability = REG_BR_PROB_BASE; + single_succ_edge (bb)->count = bb->count; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Purged non-fallthru edges from bb %i\n", + if (dump_file) + fprintf (dump_file, "Purged non-fallthru edges from bb %i\n", bb->index); return purged; } @@ -2392,77 +2329,66 @@ purge_dead_edges (basic_block bb) true if some edge has been eliminated. */ bool -purge_all_dead_edges (int update_life_p) +purge_all_dead_edges (void) { int purged = false; - sbitmap blocks = 0; basic_block bb; - if (update_life_p) - { - blocks = sbitmap_alloc (last_basic_block); - sbitmap_zero (blocks); - } - FOR_EACH_BB (bb) { bool purged_here = purge_dead_edges (bb); purged |= purged_here; - if (purged_here && update_life_p) - SET_BIT (blocks, bb->index); } - if (update_life_p && purged) - update_life_info (blocks, UPDATE_LIFE_GLOBAL, - PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE - | PROP_KILL_DEAD_CODE); - - if (update_life_p) - sbitmap_free (blocks); return purged; } /* Same as split_block but update cfg_layout structures. */ -static edge + +static basic_block cfg_layout_split_block (basic_block bb, void *insnp) { rtx insn = insnp; + basic_block new_bb = rtl_split_block (bb, insn); - edge fallthru = rtl_split_block (bb, insn); + new_bb->il.rtl->footer = bb->il.rtl->footer; + bb->il.rtl->footer = NULL; - fallthru->dest->rbi->footer = fallthru->src->rbi->footer; - fallthru->src->rbi->footer = NULL; - return fallthru; + return new_bb; } /* Redirect Edge to DEST. */ -static bool +static edge cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) { basic_block src = e->src; - bool ret; + edge ret; if (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)) - return false; + return NULL; if (e->dest == dest) - return true; + return e; if (e->src != ENTRY_BLOCK_PTR - && try_redirect_by_replacing_jump (e, dest, true)) - return true; + && (ret = try_redirect_by_replacing_jump (e, dest, true))) + { + src->flags |= BB_DIRTY; + return ret; + } if (e->src == ENTRY_BLOCK_PTR && (e->flags & EDGE_FALLTHRU) && !(e->flags & EDGE_COMPLEX)) { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Redirecting entry edge from bb %i to %i\n", + if (dump_file) + fprintf (dump_file, "Redirecting entry edge from bb %i to %i\n", e->src->index, dest->index); + e->src->flags |= BB_DIRTY; redirect_edge_succ (e, dest); - return true; + return e; } /* Redirect_edge_and_branch may decide to turn branch into fallthru edge @@ -2472,46 +2398,47 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) if (e->flags & EDGE_FALLTHRU) { /* Redirect any branch edges unified with the fallthru one. */ - if (GET_CODE (BB_END (src)) == JUMP_INSN + if (JUMP_P (BB_END (src)) && label_is_jump_target_p (BB_HEAD (e->dest), BB_END (src))) { - if (rtl_dump_file) - fprintf (rtl_dump_file, "Fallthru edge unified with branch " + edge redirected; + + if (dump_file) + fprintf (dump_file, "Fallthru edge unified with branch " "%i->%i redirected to %i\n", e->src->index, e->dest->index, dest->index); e->flags &= ~EDGE_FALLTHRU; - if (!redirect_branch_edge (e, dest)) - abort (); + redirected = redirect_branch_edge (e, dest); + gcc_assert (redirected); e->flags |= EDGE_FALLTHRU; - return true; + e->src->flags |= BB_DIRTY; + return e; } /* In case we are redirecting fallthru edge to the branch edge - of conditional jump, remove it. */ - if (src->succ->succ_next - && !src->succ->succ_next->succ_next) + of conditional jump, remove it. */ + if (EDGE_COUNT (src->succs) == 2) { - edge s = e->succ_next ? e->succ_next : src->succ; + /* Find the edge that is different from E. */ + edge s = EDGE_SUCC (src, EDGE_SUCC (src, 0) == e); + if (s->dest == dest && any_condjump_p (BB_END (src)) && onlyjump_p (BB_END (src))) delete_insn (BB_END (src)); } - - if (rtl_dump_file) - fprintf (rtl_dump_file, "Fallthru edge %i->%i redirected to %i\n", + ret = redirect_edge_succ_nodup (e, dest); + if (dump_file) + fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n", e->src->index, e->dest->index, dest->index); - redirect_edge_succ_nodup (e, dest); - - ret = true; } else ret = redirect_branch_edge (e, dest); /* We don't want simplejumps in the insn stream during cfglayout. */ - if (simplejump_p (BB_END (src))) - abort (); + gcc_assert (!simplejump_p (BB_END (src))); + src->flags |= BB_DIRTY; return ret; } @@ -2519,55 +2446,57 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) static basic_block cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest) { - if (!cfg_layout_redirect_edge_and_branch (e, dest)) - abort (); + edge redirected = cfg_layout_redirect_edge_and_branch (e, dest); + + gcc_assert (redirected); return NULL; } -/* Same as flow_delete_block but update cfg_layout structures. */ +/* Same as delete_basic_block but update cfg_layout structures. */ + static void cfg_layout_delete_block (basic_block bb) { rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints; - if (bb->rbi->header) + if (bb->il.rtl->header) { next = BB_HEAD (bb); if (prev) - NEXT_INSN (prev) = bb->rbi->header; + NEXT_INSN (prev) = bb->il.rtl->header; else - set_first_insn (bb->rbi->header); - PREV_INSN (bb->rbi->header) = prev; - insn = bb->rbi->header; + set_first_insn (bb->il.rtl->header); + PREV_INSN (bb->il.rtl->header) = prev; + insn = bb->il.rtl->header; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); NEXT_INSN (insn) = next; PREV_INSN (next) = insn; } next = NEXT_INSN (BB_END (bb)); - if (bb->rbi->footer) + if (bb->il.rtl->footer) { - insn = bb->rbi->footer; + insn = bb->il.rtl->footer; while (insn) { - if (GET_CODE (insn) == BARRIER) + if (BARRIER_P (insn)) { if (PREV_INSN (insn)) NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); else - bb->rbi->footer = NEXT_INSN (insn); + bb->il.rtl->footer = NEXT_INSN (insn); if (NEXT_INSN (insn)) PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); } - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) break; insn = NEXT_INSN (insn); } - if (bb->rbi->footer) + if (bb->il.rtl->footer) { insn = BB_END (bb); - NEXT_INSN (insn) = bb->rbi->footer; - PREV_INSN (bb->rbi->footer) = insn; + NEXT_INSN (insn) = bb->il.rtl->footer; + PREV_INSN (bb->il.rtl->footer) = insn; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); NEXT_INSN (insn) = next; @@ -2578,9 +2507,10 @@ cfg_layout_delete_block (basic_block bb) } } if (bb->next_bb != EXIT_BLOCK_PTR) - to = &bb->next_bb->rbi->header; + to = &bb->next_bb->il.rtl->header; else to = &cfg_layout_function_footer; + rtl_delete_block (bb); if (prev) @@ -2609,47 +2539,67 @@ cfg_layout_delete_block (basic_block bb) static bool cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) { + /* If we are partitioning hot/cold basic blocks, we don't want to + mess up unconditional or indirect jumps that cross between hot + and cold sections. + + Basic block partitioning may result in some jumps that appear to + be optimizable (or blocks that appear to be mergeable), but which really + must be left untouched (they are required to make it safely across + partition boundaries). See the comments at the top of + bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ + + if (BB_PARTITION (a) != BB_PARTITION (b)) + return false; + /* There must be exactly one edge in between the blocks. */ - return (a->succ && !a->succ->succ_next && a->succ->dest == b - && !b->pred->pred_next && a != b + return (single_succ_p (a) + && single_succ (a) == b + && single_pred_p (b) == 1 + && a != b /* Must be simple edge. */ - && !(a->succ->flags & EDGE_COMPLEX) + && !(single_succ_edge (a)->flags & EDGE_COMPLEX) && a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR /* If the jump insn has side effects, we can't kill the edge. */ - && (GET_CODE (BB_END (a)) != JUMP_INSN + && (!JUMP_P (BB_END (a)) || (reload_completed ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))); } -/* Merge block A and B, abort when it is not possible. */ +/* Merge block A and B. The blocks must be mergeable. */ + static void cfg_layout_merge_blocks (basic_block a, basic_block b) { #ifdef ENABLE_CHECKING - if (!cfg_layout_can_merge_blocks_p (a, b)) - abort (); + gcc_assert (cfg_layout_can_merge_blocks_p (a, b)); #endif /* If there was a CODE_LABEL beginning B, delete it. */ - if (GET_CODE (BB_HEAD (b)) == CODE_LABEL) - delete_insn (BB_HEAD (b)); + if (LABEL_P (BB_HEAD (b))) + { + /* This might have been an EH label that no longer has incoming + EH edges. Update data structures to match. */ + maybe_remove_eh_handler (BB_HEAD (b)); + + delete_insn (BB_HEAD (b)); + } /* We should have fallthru edge in a, or we can do dummy redirection to get it cleaned up. */ - if (GET_CODE (BB_END (a)) == JUMP_INSN) - try_redirect_by_replacing_jump (a->succ, b, true); - if (GET_CODE (BB_END (a)) == JUMP_INSN) - abort (); + if (JUMP_P (BB_END (a))) + try_redirect_by_replacing_jump (EDGE_SUCC (a, 0), b, true); + gcc_assert (!JUMP_P (BB_END (a))); /* Possible line number notes should appear in between. */ - if (b->rbi->header) + if (b->il.rtl->header) { rtx first = BB_END (a), last; - last = emit_insn_after_noloc (b->rbi->header, BB_END (a)); + last = emit_insn_after_noloc (b->il.rtl->header, BB_END (a)); delete_insn_chain (NEXT_INSN (first), last); - b->rbi->header = NULL; + b->il.rtl->header = NULL; } /* In the case basic blocks are not adjacent, move them around. */ @@ -2661,8 +2611,7 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) /* Skip possible DELETED_LABEL insn. */ if (!NOTE_INSN_BASIC_BLOCK_P (first)) first = NEXT_INSN (first); - if (!NOTE_INSN_BASIC_BLOCK_P (first)) - abort (); + gcc_assert (NOTE_INSN_BASIC_BLOCK_P (first)); BB_HEAD (b) = NULL; delete_insn (first); } @@ -2679,72 +2628,399 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) /* Skip possible DELETED_LABEL insn. */ if (!NOTE_INSN_BASIC_BLOCK_P (insn)) insn = NEXT_INSN (insn); - if (!NOTE_INSN_BASIC_BLOCK_P (insn)) - abort (); + gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn)); BB_HEAD (b) = NULL; BB_END (a) = BB_END (b); delete_insn (insn); } /* Possible tablejumps and barriers should appear after the block. */ - if (b->rbi->footer) + if (b->il.rtl->footer) { - if (!a->rbi->footer) - a->rbi->footer = b->rbi->footer; + if (!a->il.rtl->footer) + a->il.rtl->footer = b->il.rtl->footer; else { - rtx last = a->rbi->footer; + rtx last = a->il.rtl->footer; while (NEXT_INSN (last)) last = NEXT_INSN (last); - NEXT_INSN (last) = b->rbi->footer; - PREV_INSN (b->rbi->footer) = last; + NEXT_INSN (last) = b->il.rtl->footer; + PREV_INSN (b->il.rtl->footer) = last; } - b->rbi->footer = NULL; + b->il.rtl->footer = NULL; } + a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end; - if (rtl_dump_file) - fprintf (rtl_dump_file, "Merged blocks %d and %d.\n", + if (dump_file) + fprintf (dump_file, "Merged blocks %d and %d.\n", a->index, b->index); - - update_cfg_after_block_merging (a, b); } /* Split edge E. */ + static basic_block cfg_layout_split_edge (edge e) { - edge new_e; basic_block new_bb = create_basic_block (e->src != ENTRY_BLOCK_PTR ? NEXT_INSN (BB_END (e->src)) : get_insns (), NULL_RTX, e->src); - new_bb->count = e->count; - new_bb->frequency = EDGE_FREQUENCY (e); - /* ??? This info is likely going to be out of date very soon, but we must create it to avoid getting an ICE later. */ - if (e->dest->global_live_at_start) + if (e->dest->il.rtl->global_live_at_start) { - new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); - new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); - COPY_REG_SET (new_bb->global_live_at_start, - e->dest->global_live_at_start); - COPY_REG_SET (new_bb->global_live_at_end, - e->dest->global_live_at_start); + new_bb->il.rtl->global_live_at_start = ALLOC_REG_SET (®_obstack); + new_bb->il.rtl->global_live_at_end = ALLOC_REG_SET (®_obstack); + COPY_REG_SET (new_bb->il.rtl->global_live_at_start, + e->dest->il.rtl->global_live_at_start); + COPY_REG_SET (new_bb->il.rtl->global_live_at_end, + e->dest->il.rtl->global_live_at_start); } - new_e = make_edge (new_bb, e->dest, EDGE_FALLTHRU); - new_e->probability = REG_BR_PROB_BASE; - new_e->count = e->count; + make_edge (new_bb, e->dest, EDGE_FALLTHRU); redirect_edge_and_branch_force (e, new_bb); return new_bb; } +/* Do postprocessing after making a forwarder block joined by edge FALLTHRU. */ + +static void +rtl_make_forwarder_block (edge fallthru ATTRIBUTE_UNUSED) +{ +} + +/* Return 1 if BB ends with a call, possibly followed by some + instructions that must stay with the call, 0 otherwise. */ + +static bool +rtl_block_ends_with_call_p (basic_block bb) +{ + rtx insn = BB_END (bb); + + while (!CALL_P (insn) + && insn != BB_HEAD (bb) + && keep_with_call_p (insn)) + insn = PREV_INSN (insn); + return (CALL_P (insn)); +} + +/* Return 1 if BB ends with a conditional branch, 0 otherwise. */ + +static bool +rtl_block_ends_with_condjump_p (basic_block bb) +{ + return any_condjump_p (BB_END (bb)); +} + +/* Return true if we need to add fake edge to exit. + Helper function for rtl_flow_call_edges_add. */ + +static bool +need_fake_edge_p (rtx insn) +{ + if (!INSN_P (insn)) + return false; + + if ((CALL_P (insn) + && !SIBLING_CALL_P (insn) + && !find_reg_note (insn, REG_NORETURN, NULL) + && !CONST_OR_PURE_CALL_P (insn))) + return true; + + return ((GET_CODE (PATTERN (insn)) == ASM_OPERANDS + && MEM_VOLATILE_P (PATTERN (insn))) + || (GET_CODE (PATTERN (insn)) == PARALLEL + && asm_noperands (insn) != -1 + && MEM_VOLATILE_P (XVECEXP (PATTERN (insn), 0, 0))) + || GET_CODE (PATTERN (insn)) == ASM_INPUT); +} + +/* Add fake edges to the function exit for any non constant and non noreturn + calls, volatile inline assembly in the bitmap of blocks specified by + BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks + that were split. + + The goal is to expose cases in which entering a basic block does not imply + that all subsequent instructions must be executed. */ + +static int +rtl_flow_call_edges_add (sbitmap blocks) +{ + int i; + int blocks_split = 0; + int last_bb = last_basic_block; + bool check_last_block = false; + + if (n_basic_blocks == NUM_FIXED_BLOCKS) + return 0; + + if (! blocks) + check_last_block = true; + else + check_last_block = TEST_BIT (blocks, EXIT_BLOCK_PTR->prev_bb->index); + + /* In the last basic block, before epilogue generation, there will be + a fallthru edge to EXIT. Special care is required if the last insn + of the last basic block is a call because make_edge folds duplicate + edges, which would result in the fallthru edge also being marked + fake, which would result in the fallthru edge being removed by + remove_fake_edges, which would result in an invalid CFG. + + Moreover, we can't elide the outgoing fake edge, since the block + profiler needs to take this into account in order to solve the minimal + spanning tree in the case that the call doesn't return. + + Handle this by adding a dummy instruction in a new last basic block. */ + if (check_last_block) + { + basic_block bb = EXIT_BLOCK_PTR->prev_bb; + rtx insn = BB_END (bb); + + /* Back up past insns that must be kept in the same block as a call. */ + while (insn != BB_HEAD (bb) + && keep_with_call_p (insn)) + insn = PREV_INSN (insn); + + if (need_fake_edge_p (insn)) + { + edge e; + + e = find_edge (bb, EXIT_BLOCK_PTR); + if (e) + { + insert_insn_on_edge (gen_rtx_USE (VOIDmode, const0_rtx), e); + commit_edge_insertions (); + } + } + } + + /* Now add fake edges to the function exit for any non constant + calls since there is no way that we can determine if they will + return or not... */ + + for (i = NUM_FIXED_BLOCKS; i < last_bb; i++) + { + basic_block bb = BASIC_BLOCK (i); + rtx insn; + rtx prev_insn; + + if (!bb) + continue; + + if (blocks && !TEST_BIT (blocks, i)) + continue; + + for (insn = BB_END (bb); ; insn = prev_insn) + { + prev_insn = PREV_INSN (insn); + if (need_fake_edge_p (insn)) + { + edge e; + rtx split_at_insn = insn; + + /* Don't split the block between a call and an insn that should + remain in the same block as the call. */ + if (CALL_P (insn)) + while (split_at_insn != BB_END (bb) + && keep_with_call_p (NEXT_INSN (split_at_insn))) + split_at_insn = NEXT_INSN (split_at_insn); + + /* The handling above of the final block before the epilogue + should be enough to verify that there is no edge to the exit + block in CFG already. Calling make_edge in such case would + cause us to mark that edge as fake and remove it later. */ + +#ifdef ENABLE_CHECKING + if (split_at_insn == BB_END (bb)) + { + e = find_edge (bb, EXIT_BLOCK_PTR); + gcc_assert (e == NULL); + } +#endif + + /* Note that the following may create a new basic block + and renumber the existing basic blocks. */ + if (split_at_insn != BB_END (bb)) + { + e = split_block (bb, split_at_insn); + if (e) + blocks_split++; + } + + make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE); + } + + if (insn == BB_HEAD (bb)) + break; + } + } + + if (blocks_split) + verify_flow_info (); + + return blocks_split; +} + +/* Add COMP_RTX as a condition at end of COND_BB. FIRST_HEAD is + the conditional branch target, SECOND_HEAD should be the fall-thru + there is no need to handle this here the loop versioning code handles + this. the reason for SECON_HEAD is that it is needed for condition + in trees, and this should be of the same type since it is a hook. */ +static void +rtl_lv_add_condition_to_bb (basic_block first_head , + basic_block second_head ATTRIBUTE_UNUSED, + basic_block cond_bb, void *comp_rtx) +{ + rtx label, seq, jump; + rtx op0 = XEXP ((rtx)comp_rtx, 0); + rtx op1 = XEXP ((rtx)comp_rtx, 1); + enum rtx_code comp = GET_CODE ((rtx)comp_rtx); + enum machine_mode mode; + + + label = block_label (first_head); + mode = GET_MODE (op0); + if (mode == VOIDmode) + mode = GET_MODE (op1); + + start_sequence (); + op0 = force_operand (op0, NULL_RTX); + op1 = force_operand (op1, NULL_RTX); + do_compare_rtx_and_jump (op0, op1, comp, 0, + mode, NULL_RTX, NULL_RTX, label); + jump = get_last_insn (); + JUMP_LABEL (jump) = label; + LABEL_NUSES (label)++; + seq = get_insns (); + end_sequence (); + + /* Add the new cond , in the new head. */ + emit_insn_after(seq, BB_END(cond_bb)); +} + + +/* Given a block B with unconditional branch at its end, get the + store the return the branch edge and the fall-thru edge in + BRANCH_EDGE and FALLTHRU_EDGE respectively. */ +static void +rtl_extract_cond_bb_edges (basic_block b, edge *branch_edge, + edge *fallthru_edge) +{ + edge e = EDGE_SUCC (b, 0); + + if (e->flags & EDGE_FALLTHRU) + { + *fallthru_edge = e; + *branch_edge = EDGE_SUCC (b, 1); + } + else + { + *branch_edge = e; + *fallthru_edge = EDGE_SUCC (b, 1); + } +} + +void +init_rtl_bb_info (basic_block bb) +{ + gcc_assert (!bb->il.rtl); + bb->il.rtl = ggc_alloc_cleared (sizeof (struct rtl_bb_info)); +} + + +/* Add EXPR to the end of basic block BB. */ + +rtx +insert_insn_end_bb_new (rtx pat, basic_block bb) +{ + rtx insn = BB_END (bb); + rtx new_insn; + rtx pat_end = pat; + + while (NEXT_INSN (pat_end) != NULL_RTX) + pat_end = NEXT_INSN (pat_end); + + /* If the last insn is a jump, insert EXPR in front [taking care to + handle cc0, etc. properly]. Similarly we need to care trapping + instructions in presence of non-call exceptions. */ + + if (JUMP_P (insn) + || (NONJUMP_INSN_P (insn) + && (!single_succ_p (bb) + || single_succ_edge (bb)->flags & EDGE_ABNORMAL))) + { +#ifdef HAVE_cc0 + rtx note; +#endif + /* If this is a jump table, then we can't insert stuff here. Since + we know the previous real insn must be the tablejump, we insert + the new instruction just before the tablejump. */ + if (GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC) + insn = prev_real_insn (insn); + +#ifdef HAVE_cc0 + /* FIXME: 'twould be nice to call prev_cc0_setter here but it aborts + if cc0 isn't set. */ + note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX); + if (note) + insn = XEXP (note, 0); + else + { + rtx maybe_cc0_setter = prev_nonnote_insn (insn); + if (maybe_cc0_setter + && INSN_P (maybe_cc0_setter) + && sets_cc0_p (PATTERN (maybe_cc0_setter))) + insn = maybe_cc0_setter; + } +#endif + /* FIXME: What if something in cc0/jump uses value set in new + insn? */ + new_insn = emit_insn_before_noloc (pat, insn); + } + + /* Likewise if the last insn is a call, as will happen in the presence + of exception handling. */ + else if (CALL_P (insn) + && (!single_succ_p (bb) + || single_succ_edge (bb)->flags & EDGE_ABNORMAL)) + { + /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers, + we search backward and place the instructions before the first + parameter is loaded. Do this for everyone for consistency and a + presumption that we'll get better code elsewhere as well. */ + + /* Since different machines initialize their parameter registers + in different orders, assume nothing. Collect the set of all + parameter registers. */ + insn = find_first_parameter_load (insn, BB_HEAD (bb)); + + /* If we found all the parameter loads, then we want to insert + before the first parameter load. + + If we did not find all the parameter loads, then we might have + stopped on the head of the block, which could be a CODE_LABEL. + If we inserted before the CODE_LABEL, then we would be putting + the insn in the wrong basic block. In that case, put the insn + after the CODE_LABEL. Also, respect NOTE_INSN_BASIC_BLOCK. */ + while (LABEL_P (insn) + || NOTE_INSN_BASIC_BLOCK_P (insn)) + insn = NEXT_INSN (insn); + + new_insn = emit_insn_before_noloc (pat, insn); + } + else + new_insn = emit_insn_after_noloc (pat, insn); + + return new_insn; +} + /* Implementation of CFG manipulation for linearized RTL. */ struct cfg_hooks rtl_cfg_hooks = { + "rtl", rtl_verify_flow_info, rtl_dump_bb, rtl_create_basic_block, @@ -2752,16 +3028,42 @@ struct cfg_hooks rtl_cfg_hooks = { rtl_redirect_edge_and_branch_force, rtl_delete_block, rtl_split_block, + rtl_move_block_after, rtl_can_merge_blocks, /* can_merge_blocks_p */ rtl_merge_blocks, - rtl_split_edge + rtl_predict_edge, + rtl_predicted_by_p, + NULL, /* can_duplicate_block_p */ + NULL, /* duplicate_block */ + rtl_split_edge, + rtl_make_forwarder_block, + rtl_tidy_fallthru_edge, + rtl_block_ends_with_call_p, + rtl_block_ends_with_condjump_p, + rtl_flow_call_edges_add, + NULL, /* execute_on_growing_pred */ + NULL, /* execute_on_shrinking_pred */ + NULL, /* duplicate loop for trees */ + NULL, /* lv_add_condition_to_bb */ + NULL, /* lv_adjust_loop_header_phi*/ + NULL, /* extract_cond_bb_edges */ + NULL /* flush_pending_stmts */ }; /* Implementation of CFG manipulation for cfg layout RTL, where basic block connected via fallthru edges does not have to be adjacent. This representation will hopefully become the default one in future version of the compiler. */ + +/* We do not want to declare these functions in a header file, since they + should only be used through the cfghooks interface, and we do not want to + move them here since it would require also moving quite a lot of related + code. */ +extern bool cfg_layout_can_duplicate_bb_p (basic_block); +extern basic_block cfg_layout_duplicate_bb (basic_block); + struct cfg_hooks cfg_layout_rtl_cfg_hooks = { + "cfglayout mode", rtl_verify_flow_info_1, rtl_dump_bb, cfg_layout_create_basic_block, @@ -2769,7 +3071,24 @@ struct cfg_hooks cfg_layout_rtl_cfg_hooks = { cfg_layout_redirect_edge_and_branch_force, cfg_layout_delete_block, cfg_layout_split_block, + rtl_move_block_after, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, - cfg_layout_split_edge + rtl_predict_edge, + rtl_predicted_by_p, + cfg_layout_can_duplicate_bb_p, + cfg_layout_duplicate_bb, + cfg_layout_split_edge, + rtl_make_forwarder_block, + NULL, + rtl_block_ends_with_call_p, + rtl_block_ends_with_condjump_p, + rtl_flow_call_edges_add, + NULL, /* execute_on_growing_pred */ + NULL, /* execute_on_shrinking_pred */ + duplicate_loop_to_header_edge, /* duplicate loop for trees */ + rtl_lv_add_condition_to_bb, /* lv_add_condition_to_bb */ + NULL, /* lv_adjust_loop_header_phi*/ + rtl_extract_cond_bb_edges, /* extract_cond_bb_edges */ + NULL /* flush_pending_stmts */ }; diff --git a/contrib/gcc/cgraph.c b/contrib/gcc/cgraph.c index 775f0a3fe05..fcdc02ea826 100644 --- a/contrib/gcc/cgraph.c +++ b/contrib/gcc/cgraph.c @@ -1,5 +1,5 @@ /* Callgraph handling code. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. @@ -16,14 +16,75 @@ for more details. 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 contains basic routines manipulating call graph and variable pool + +The callgraph: + + The call-graph is data structure designed for intra-procedural optimization + but it is also used in non-unit-at-a-time compilation to allow easier code + sharing. + + The call-graph consist of nodes and edges represented via linked lists. + Each function (external or not) corresponds to the unique node (in + contrast to tree DECL nodes where we can have multiple nodes for each + function). + + The mapping from declarations to call-graph nodes is done using hash table + based on DECL_ASSEMBLER_NAME, so it is essential for assembler name to + not change once the declaration is inserted into the call-graph. + The call-graph nodes are created lazily using cgraph_node function when + called for unknown declaration. + + When built, there is one edge for each direct call. It is possible that + the reference will be later optimized out. The call-graph is built + conservatively in order to make conservative data flow analysis possible. + + The callgraph at the moment does not represent indirect calls or calls + from other compilation unit. Flag NEEDED is set for each node that may + be accessed in such an invisible way and it shall be considered an + entry point to the callgraph. + + Interprocedural information: + + Callgraph is place to store data needed for interprocedural optimization. + All data structures are divided into three components: local_info that + is produced while analyzing the function, global_info that is result + of global walking of the callgraph on the end of compilation and + rtl_info used by RTL backend to propagate data from already compiled + functions to their callers. + + Inlining plans: + + The function inlining information is decided in advance and maintained + in the callgraph as so called inline plan. + For each inlined call, the callee's node is cloned to represent the + new function copy produced by inliner. + Each inlined call gets a unique corresponding clone node of the callee + and the data structure is updated while inlining is performed, so + the clones are eliminated and their callee edges redirected to the + caller. + + Each edge has "inline_failed" field. When the field is set to NULL, + the call will be inlined. When it is non-NULL it contains a reason + why inlining wasn't performed. + + +The varpool data structure: + + Varpool is used to maintain variables in similar manner as call-graph + is used for functions. Most of the API is symmetric replacing cgraph + function prefix by cgraph_varpool */ + #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "tree-inline.h" #include "langhooks.h" #include "hashtab.h" #include "toplev.h" @@ -31,11 +92,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" #include "debug.h" #include "target.h" +#include "basic-block.h" #include "cgraph.h" #include "varray.h" #include "output.h" #include "intl.h" +#include "tree-gimple.h" +#include "tree-dump.h" +static void cgraph_node_remove_callers (struct cgraph_node *node); +static inline void cgraph_edge_remove_caller (struct cgraph_edge *e); +static inline void cgraph_edge_remove_callee (struct cgraph_edge *e); /* Hash table used to convert declarations into nodes. */ static GTY((param_is (struct cgraph_node))) htab_t cgraph_hash; @@ -46,6 +113,11 @@ struct cgraph_node *cgraph_nodes; /* Queue of cgraph nodes scheduled to be lowered. */ struct cgraph_node *cgraph_nodes_queue; +/* Queue of cgraph nodes scheduled to be expanded. This is a + secondary queue used during optimization to accommodate passes that + may generate new functions that need to be optimized and expanded. */ +struct cgraph_node *cgraph_expand_queue; + /* Number of nodes in existence. */ int cgraph_n_nodes; @@ -55,20 +127,32 @@ int cgraph_max_uid; /* Set when whole unit has been analyzed so we can access global info. */ bool cgraph_global_info_ready = false; +/* Set when the cgraph is fully build and the basic flags are computed. */ +bool cgraph_function_flags_ready = false; + /* Hash table used to convert declarations into nodes. */ static GTY((param_is (struct cgraph_varpool_node))) htab_t cgraph_varpool_hash; /* Queue of cgraph nodes scheduled to be lowered and output. */ -struct cgraph_varpool_node *cgraph_varpool_nodes_queue; - -/* Number of nodes in existence. */ -int cgraph_varpool_n_nodes; +struct cgraph_varpool_node *cgraph_varpool_nodes_queue, *cgraph_varpool_first_unanalyzed_node; /* The linked list of cgraph varpool nodes. */ -static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes; +struct cgraph_varpool_node *cgraph_varpool_nodes; + +/* End of the varpool queue. */ +struct cgraph_varpool_node *cgraph_varpool_last_needed_node; + +/* Linked list of cgraph asm nodes. */ +struct cgraph_asm_node *cgraph_asm_nodes; + +/* Last node in cgraph_asm_nodes. */ +static GTY(()) struct cgraph_asm_node *cgraph_asm_last_node; + +/* The order index of the next cgraph node to be created. This is + used so that we can sort the cgraph nodes in order by when we saw + them, to support -fno-toplevel-reorder. */ +int cgraph_order; -static struct cgraph_edge *create_edge (struct cgraph_node *, - struct cgraph_node *); static hashval_t hash_node (const void *); static int eq_node (const void *, const void *); @@ -77,9 +161,8 @@ static int eq_node (const void *, const void *); static hashval_t hash_node (const void *p) { - return ((hashval_t) - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME - (((struct cgraph_node *) p)->decl))); + const struct cgraph_node *n = (const struct cgraph_node *) p; + return (hashval_t) DECL_UID (n->decl); } /* Returns nonzero if P1 and P2 are equal. */ @@ -87,75 +170,222 @@ hash_node (const void *p) static int eq_node (const void *p1, const void *p2) { - return ((DECL_ASSEMBLER_NAME (((struct cgraph_node *) p1)->decl)) == - (tree) p2); + const struct cgraph_node *n1 = (const struct cgraph_node *) p1; + const struct cgraph_node *n2 = (const struct cgraph_node *) p2; + return DECL_UID (n1->decl) == DECL_UID (n2->decl); +} + +/* Allocate new callgraph node and insert it into basic data structures. */ +static struct cgraph_node * +cgraph_create_node (void) +{ + struct cgraph_node *node; + + node = GGC_CNEW (struct cgraph_node); + node->next = cgraph_nodes; + node->uid = cgraph_max_uid++; + node->order = cgraph_order++; + if (cgraph_nodes) + cgraph_nodes->previous = node; + node->previous = NULL; + node->global.estimated_growth = INT_MIN; + cgraph_nodes = node; + cgraph_n_nodes++; + return node; } /* Return cgraph node assigned to DECL. Create new one when needed. */ struct cgraph_node * cgraph_node (tree decl) { - struct cgraph_node *node; - struct cgraph_node **slot; + struct cgraph_node key, *node, **slot; - if (TREE_CODE (decl) != FUNCTION_DECL) - abort (); + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); if (!cgraph_hash) cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL); - slot = (struct cgraph_node **) - htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (decl), - IDENTIFIER_HASH_VALUE - (DECL_ASSEMBLER_NAME (decl)), INSERT); + key.decl = decl; + + slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key, INSERT); + if (*slot) - return *slot; - node = ggc_alloc_cleared (sizeof (*node)); + { + node = *slot; + if (!node->master_clone) + node->master_clone = node; + return node; + } + + node = cgraph_create_node (); node->decl = decl; - node->next = cgraph_nodes; - node->uid = cgraph_max_uid++; - if (cgraph_nodes) - cgraph_nodes->previous = node; - node->previous = NULL; - cgraph_nodes = node; - cgraph_n_nodes++; *slot = node; if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL) { node->origin = cgraph_node (DECL_CONTEXT (decl)); node->next_nested = node->origin->nested; node->origin->nested = node; + node->master_clone = node; } return node; } -/* Try to find existing function for identifier ID. */ -struct cgraph_node * -cgraph_node_for_identifier (tree id) +/* Insert already constructed node into hashtable. */ + +void +cgraph_insert_node_to_hashtable (struct cgraph_node *node) { struct cgraph_node **slot; - if (TREE_CODE (id) != IDENTIFIER_NODE) - abort (); + slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, node, INSERT); - if (!cgraph_hash) - return NULL; + gcc_assert (!*slot); + *slot = node; +} - slot = (struct cgraph_node **) - htab_find_slot_with_hash (cgraph_hash, id, - IDENTIFIER_HASH_VALUE (id), NO_INSERT); - if (!slot) - return NULL; - return *slot; +/* Compare ASMNAME with the DECL_ASSEMBLER_NAME of DECL. */ + +static bool +decl_assembler_name_equal (tree decl, tree asmname) +{ + tree decl_asmname = DECL_ASSEMBLER_NAME (decl); + + if (decl_asmname == asmname) + return true; + + /* If the target assembler name was set by the user, things are trickier. + We have a leading '*' to begin with. After that, it's arguable what + is the correct thing to do with -fleading-underscore. Arguably, we've + historically been doing the wrong thing in assemble_alias by always + printing the leading underscore. Since we're not changing that, make + sure user_label_prefix follows the '*' before matching. */ + if (IDENTIFIER_POINTER (decl_asmname)[0] == '*') + { + const char *decl_str = IDENTIFIER_POINTER (decl_asmname) + 1; + size_t ulp_len = strlen (user_label_prefix); + + if (ulp_len == 0) + ; + else if (strncmp (decl_str, user_label_prefix, ulp_len) == 0) + decl_str += ulp_len; + else + return false; + + return strcmp (decl_str, IDENTIFIER_POINTER (asmname)) == 0; + } + + return false; +} + + +/* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME. + Return NULL if there's no such node. */ + +struct cgraph_node * +cgraph_node_for_asm (tree asmname) +{ + struct cgraph_node *node; + + for (node = cgraph_nodes; node ; node = node->next) + if (decl_assembler_name_equal (node->decl, asmname)) + return node; + + return NULL; +} + +/* Returns a hash value for X (which really is a die_struct). */ + +static hashval_t +edge_hash (const void *x) +{ + return htab_hash_pointer (((struct cgraph_edge *) x)->call_stmt); +} + +/* Return nonzero if decl_id of die_struct X is the same as UID of decl *Y. */ + +static int +edge_eq (const void *x, const void *y) +{ + return ((struct cgraph_edge *) x)->call_stmt == y; +} + +/* Return callgraph edge representing CALL_EXPR statement. */ +struct cgraph_edge * +cgraph_edge (struct cgraph_node *node, tree call_stmt) +{ + struct cgraph_edge *e, *e2; + int n = 0; + + if (node->call_site_hash) + return htab_find_with_hash (node->call_site_hash, call_stmt, + htab_hash_pointer (call_stmt)); + + /* This loop may turn out to be performance problem. In such case adding + hashtables into call nodes with very many edges is probably best + solution. It is not good idea to add pointer into CALL_EXPR itself + because we want to make possible having multiple cgraph nodes representing + different clones of the same body before the body is actually cloned. */ + for (e = node->callees; e; e= e->next_callee) + { + if (e->call_stmt == call_stmt) + break; + n++; + } + if (n > 100) + { + node->call_site_hash = htab_create_ggc (120, edge_hash, edge_eq, NULL); + for (e2 = node->callees; e2; e2 = e2->next_callee) + { + void **slot; + slot = htab_find_slot_with_hash (node->call_site_hash, + e2->call_stmt, + htab_hash_pointer (e2->call_stmt), + INSERT); + gcc_assert (!*slot); + *slot = e2; + } + } + return e; +} + +/* Change call_smtt of edge E to NEW_STMT. */ +void +cgraph_set_call_stmt (struct cgraph_edge *e, tree new_stmt) +{ + if (e->caller->call_site_hash) + { + htab_remove_elt_with_hash (e->caller->call_site_hash, + e->call_stmt, + htab_hash_pointer (e->call_stmt)); + } + e->call_stmt = new_stmt; + if (e->caller->call_site_hash) + { + void **slot; + slot = htab_find_slot_with_hash (e->caller->call_site_hash, + e->call_stmt, + htab_hash_pointer + (e->call_stmt), INSERT); + gcc_assert (!*slot); + *slot = e; + } } /* Create edge from CALLER to CALLEE in the cgraph. */ -static struct cgraph_edge * -create_edge (struct cgraph_node *caller, struct cgraph_node *callee) +struct cgraph_edge * +cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee, + tree call_stmt, gcov_type count, int nest) { - struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge)); - struct cgraph_edge *edge2; + struct cgraph_edge *edge = GGC_NEW (struct cgraph_edge); +#ifdef ENABLE_CHECKING + struct cgraph_edge *e; + + for (e = caller->callees; e; e = e->next_callee) + gcc_assert (e->call_stmt != call_stmt); +#endif + + gcc_assert (get_call_expr_in (call_stmt)); if (!DECL_SAVED_TREE (callee->decl)) edge->inline_failed = N_("function body not available"); @@ -167,45 +397,130 @@ create_edge (struct cgraph_node *caller, struct cgraph_node *callee) else edge->inline_failed = N_("function not inlinable"); - /* At the moment we don't associate calls with specific CALL_EXPRs - as we probably ought to, so we must preserve inline_call flags to - be the same in all copies of the same edge. */ - if (cgraph_global_info_ready) - for (edge2 = caller->callees; edge2; edge2 = edge2->next_callee) - if (edge2->callee == callee) - { - edge->inline_failed = edge2->inline_failed; - break; - } + edge->aux = NULL; edge->caller = caller; edge->callee = callee; + edge->call_stmt = call_stmt; + edge->prev_caller = NULL; edge->next_caller = callee->callers; + if (callee->callers) + callee->callers->prev_caller = edge; + edge->prev_callee = NULL; edge->next_callee = caller->callees; + if (caller->callees) + caller->callees->prev_callee = edge; caller->callees = edge; callee->callers = edge; + edge->count = count; + edge->loop_nest = nest; + if (caller->call_site_hash) + { + void **slot; + slot = htab_find_slot_with_hash (caller->call_site_hash, + edge->call_stmt, + htab_hash_pointer + (edge->call_stmt), + INSERT); + gcc_assert (!*slot); + *slot = edge; + } return edge; } -/* Remove the edge from CALLER to CALLEE in the cgraph. */ +/* Remove the edge E from the list of the callers of the callee. */ + +static inline void +cgraph_edge_remove_callee (struct cgraph_edge *e) +{ + if (e->prev_caller) + e->prev_caller->next_caller = e->next_caller; + if (e->next_caller) + e->next_caller->prev_caller = e->prev_caller; + if (!e->prev_caller) + e->callee->callers = e->next_caller; +} + +/* Remove the edge E from the list of the callees of the caller. */ + +static inline void +cgraph_edge_remove_caller (struct cgraph_edge *e) +{ + if (e->prev_callee) + e->prev_callee->next_callee = e->next_callee; + if (e->next_callee) + e->next_callee->prev_callee = e->prev_callee; + if (!e->prev_callee) + e->caller->callees = e->next_callee; + if (e->caller->call_site_hash) + htab_remove_elt_with_hash (e->caller->call_site_hash, + e->call_stmt, + htab_hash_pointer (e->call_stmt)); +} + +/* Remove the edge E in the cgraph. */ void -cgraph_remove_edge (struct cgraph_node *caller, struct cgraph_node *callee) +cgraph_remove_edge (struct cgraph_edge *e) { - struct cgraph_edge **edge, **edge2; + /* Remove from callers list of the callee. */ + cgraph_edge_remove_callee (e); - for (edge = &callee->callers; *edge && (*edge)->caller != caller; - edge = &((*edge)->next_caller)) - continue; - if (!*edge) - abort (); - *edge = (*edge)->next_caller; - for (edge2 = &caller->callees; *edge2 && (*edge2)->callee != callee; - edge2 = &(*edge2)->next_callee) - continue; - if (!*edge2) - abort (); - *edge2 = (*edge2)->next_callee; + /* Remove from callees list of the callers. */ + cgraph_edge_remove_caller (e); +} + +/* Redirect callee of E to N. The function does not update underlying + call expression. */ + +void +cgraph_redirect_edge_callee (struct cgraph_edge *e, struct cgraph_node *n) +{ + /* Remove from callers list of the current callee. */ + cgraph_edge_remove_callee (e); + + /* Insert to callers list of the new callee. */ + e->prev_caller = NULL; + if (n->callers) + n->callers->prev_caller = e; + e->next_caller = n->callers; + n->callers = e; + e->callee = n; +} + +/* Remove all callees from the node. */ + +void +cgraph_node_remove_callees (struct cgraph_node *node) +{ + struct cgraph_edge *e; + + /* It is sufficient to remove the edges from the lists of callers of + the callees. The callee list of the node can be zapped with one + assignment. */ + for (e = node->callees; e; e = e->next_callee) + cgraph_edge_remove_callee (e); + node->callees = NULL; + if (node->call_site_hash) + { + htab_delete (node->call_site_hash); + node->call_site_hash = NULL; + } +} + +/* Remove all callers from the node. */ + +static void +cgraph_node_remove_callers (struct cgraph_node *node) +{ + struct cgraph_edge *e; + + /* It is sufficient to remove the edges from the lists of callees of + the callers. The caller list of the node can be zapped with one + assignment. */ + for (e = node->callers; e; e = e->next_caller) + cgraph_edge_remove_caller (e); + node->callers = NULL; } /* Remove the node from cgraph. */ @@ -214,10 +529,13 @@ void cgraph_remove_node (struct cgraph_node *node) { void **slot; - while (node->callers) - cgraph_remove_edge (node->callers->caller, node); - while (node->callees) - cgraph_remove_edge (node, node->callees->callee); + bool kill_body = false; + + cgraph_node_remove_callers (node); + cgraph_node_remove_callees (node); + /* Incremental inlining access removed nodes stored in the postorder list. + */ + node->needed = node->reachable = false; while (node->nested) cgraph_remove_node (node->nested); if (node->origin) @@ -234,24 +552,62 @@ cgraph_remove_node (struct cgraph_node *node) cgraph_nodes = node->next; if (node->next) node->next->previous = node->previous; - DECL_SAVED_TREE (node->decl) = NULL; - DECL_SAVED_INSNS (node->decl) = NULL; - DECL_ARGUMENTS (node->decl) = NULL; - DECL_INITIAL (node->decl) = error_mark_node; - slot = - htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (node->decl), - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME - (node->decl)), NO_INSERT); - if (slot == 0) + node->next = NULL; + node->previous = NULL; + slot = htab_find_slot (cgraph_hash, node, NO_INSERT); + if (*slot == node) { - /* We use DECL_ASSEMBLER_NAME as key, which may not work in - all cases. See PR/15666. Gcc 3.5 uses DECL_UID as key, - which doesn't have this problem. */ - if (!DECL_BUILT_IN (node->decl)) - abort (); + if (node->next_clone) + { + struct cgraph_node *new_node = node->next_clone; + struct cgraph_node *n; + + /* Make the next clone be the master clone */ + for (n = new_node; n; n = n->next_clone) + n->master_clone = new_node; + + *slot = new_node; + node->next_clone->prev_clone = NULL; + } + else + { + htab_clear_slot (cgraph_hash, slot); + kill_body = true; + } } else - htab_clear_slot (cgraph_hash, slot); + { + node->prev_clone->next_clone = node->next_clone; + if (node->next_clone) + node->next_clone->prev_clone = node->prev_clone; + } + + /* While all the clones are removed after being proceeded, the function + itself is kept in the cgraph even after it is compiled. Check whether + we are done with this body and reclaim it proactively if this is the case. + */ + if (!kill_body && *slot) + { + struct cgraph_node *n = (struct cgraph_node *) *slot; + if (!n->next_clone && !n->global.inlined_to + && (cgraph_global_info_ready + && (TREE_ASM_WRITTEN (n->decl) || DECL_EXTERNAL (n->decl)))) + kill_body = true; + } + + if (kill_body && flag_unit_at_a_time) + { + DECL_SAVED_TREE (node->decl) = NULL; + DECL_STRUCT_FUNCTION (node->decl) = NULL; + DECL_INITIAL (node->decl) = error_mark_node; + } + node->decl = NULL; + if (node->call_site_hash) + { + htab_delete (node->call_site_hash); + node->call_site_hash = NULL; + } + cgraph_n_nodes--; /* Do not free the structure itself so the walk over chain can continue. */ } @@ -264,19 +620,10 @@ cgraph_mark_reachable_node (struct cgraph_node *node) { notice_global_symbol (node->decl); node->reachable = 1; + gcc_assert (!cgraph_global_info_ready); node->next_needed = cgraph_nodes_queue; cgraph_nodes_queue = node; - - /* At the moment frontend automatically emits all nested functions. */ - if (node->nested) - { - struct cgraph_node *node2; - - for (node2 = node->nested; node2; node2 = node2->next_nested) - if (!node2->reachable) - cgraph_mark_reachable_node (node2); - } } } @@ -290,43 +637,14 @@ cgraph_mark_needed_node (struct cgraph_node *node) cgraph_mark_reachable_node (node); } -/* Record call from CALLER to CALLEE. */ - -struct cgraph_edge * -cgraph_record_call (tree caller, tree callee) -{ - return create_edge (cgraph_node (caller), cgraph_node (callee)); -} - -void -cgraph_remove_call (tree caller, tree callee) -{ - cgraph_remove_edge (cgraph_node (caller), cgraph_node (callee)); -} - -/* Return true when CALLER_DECL calls CALLEE_DECL. */ - -bool -cgraph_calls_p (tree caller_decl, tree callee_decl) -{ - struct cgraph_node *caller = cgraph_node (caller_decl); - struct cgraph_node *callee = cgraph_node (callee_decl); - struct cgraph_edge *edge; - - for (edge = callee->callers; edge && (edge)->caller != caller; - edge = (edge->next_caller)) - continue; - return edge != NULL; -} - /* Return local info for the compiled function. */ struct cgraph_local_info * cgraph_local_info (tree decl) { struct cgraph_node *node; - if (TREE_CODE (decl) != FUNCTION_DECL) - abort (); + + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); node = cgraph_node (decl); return &node->local; } @@ -337,8 +655,8 @@ struct cgraph_global_info * cgraph_global_info (tree decl) { struct cgraph_node *node; - if (TREE_CODE (decl) != FUNCTION_DECL || !cgraph_global_info_ready) - abort (); + + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL && cgraph_global_info_ready); node = cgraph_node (decl); return &node->global; } @@ -349,8 +667,8 @@ struct cgraph_rtl_info * cgraph_rtl_info (tree decl) { struct cgraph_node *node; - if (TREE_CODE (decl) != FUNCTION_DECL) - abort (); + + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); node = cgraph_node (decl); if (decl != current_function_decl && !TREE_ASM_WRITTEN (node->decl)) @@ -362,7 +680,93 @@ cgraph_rtl_info (tree decl) const char * cgraph_node_name (struct cgraph_node *node) { - return (*lang_hooks.decl_printable_name) (node->decl, 2); + return lang_hooks.decl_printable_name (node->decl, 2); +} + +/* Return name of the node used in debug output. */ +static const char * +cgraph_varpool_node_name (struct cgraph_varpool_node *node) +{ + return lang_hooks.decl_printable_name (node->decl, 2); +} + +/* Names used to print out the availability enum. */ +static const char * const availability_names[] = + {"unset", "not_available", "overwrittable", "available", "local"}; + +/* Dump given cgraph node. */ +void +dump_cgraph_node (FILE *f, struct cgraph_node *node) +{ + struct cgraph_edge *edge; + fprintf (f, "%s/%i:", cgraph_node_name (node), node->uid); + if (node->global.inlined_to) + fprintf (f, " (inline copy in %s/%i)", + cgraph_node_name (node->global.inlined_to), + node->global.inlined_to->uid); + if (cgraph_function_flags_ready) + fprintf (f, " availability:%s", + availability_names [cgraph_function_body_availability (node)]); + if (node->master_clone && node->master_clone->uid != node->uid) + fprintf (f, "(%i)", node->master_clone->uid); + if (node->count) + fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x", + (HOST_WIDEST_INT)node->count); + if (node->local.self_insns) + fprintf (f, " %i insns", node->local.self_insns); + if (node->global.insns && node->global.insns != node->local.self_insns) + fprintf (f, " (%i after inlining)", node->global.insns); + if (node->origin) + fprintf (f, " nested in: %s", cgraph_node_name (node->origin)); + if (node->needed) + fprintf (f, " needed"); + else if (node->reachable) + fprintf (f, " reachable"); + if (DECL_SAVED_TREE (node->decl)) + fprintf (f, " tree"); + if (node->output) + fprintf (f, " output"); + if (node->local.local) + fprintf (f, " local"); + if (node->local.externally_visible) + fprintf (f, " externally_visible"); + if (node->local.finalized) + fprintf (f, " finalized"); + if (node->local.disregard_inline_limits) + fprintf (f, " always_inline"); + else if (node->local.inlinable) + fprintf (f, " inlinable"); + if (node->local.redefined_extern_inline) + fprintf (f, " redefined_extern_inline"); + if (TREE_ASM_WRITTEN (node->decl)) + fprintf (f, " asm_written"); + + fprintf (f, "\n called by: "); + for (edge = node->callers; edge; edge = edge->next_caller) + { + fprintf (f, "%s/%i ", cgraph_node_name (edge->caller), + edge->caller->uid); + if (edge->count) + fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ", + (HOST_WIDEST_INT)edge->count); + if (!edge->inline_failed) + fprintf(f, "(inlined) "); + } + + fprintf (f, "\n calls: "); + for (edge = node->callees; edge; edge = edge->next_callee) + { + fprintf (f, "%s/%i ", cgraph_node_name (edge->callee), + edge->callee->uid); + if (!edge->inline_failed) + fprintf(f, "(inlined) "); + if (edge->count) + fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ", + (HOST_WIDEST_INT)edge->count); + if (edge->loop_nest) + fprintf (f, "(nested in %i loops) ", edge->loop_nest); + } + fprintf (f, "\n"); } /* Dump the callgraph. */ @@ -374,104 +778,107 @@ dump_cgraph (FILE *f) fprintf (f, "callgraph:\n\n"); for (node = cgraph_nodes; node; node = node->next) - { - struct cgraph_edge *edge; - fprintf (f, "%s:", cgraph_node_name (node)); - if (node->local.self_insns) - fprintf (f, " %i insns", node->local.self_insns); - if (node->global.insns && node->global.insns != node->local.self_insns) - fprintf (f, " (%i after inlining)", node->global.insns); - if (node->origin) - fprintf (f, " nested in: %s", cgraph_node_name (node->origin)); - if (node->needed) - fprintf (f, " needed"); - else if (node->reachable) - fprintf (f, " reachable"); - if (DECL_SAVED_TREE (node->decl)) - fprintf (f, " tree"); + dump_cgraph_node (f, node); +} - if (node->local.local) - fprintf (f, " local"); - if (node->local.disregard_inline_limits) - fprintf (f, " always_inline"); - else if (node->local.inlinable) - fprintf (f, " inlinable"); - if (node->global.cloned_times > 1) - fprintf (f, " cloned %ix", node->global.cloned_times); +/* Dump given cgraph node. */ +void +dump_cgraph_varpool_node (FILE *f, struct cgraph_varpool_node *node) +{ + fprintf (f, "%s:", cgraph_varpool_node_name (node)); + fprintf (f, " availability:%s", + cgraph_function_flags_ready + ? availability_names[cgraph_variable_initializer_availability (node)] + : "not-ready"); + if (DECL_INITIAL (node->decl)) + fprintf (f, " initialized"); + if (node->needed) + fprintf (f, " needed"); + if (node->analyzed) + fprintf (f, " analyzed"); + if (node->finalized) + fprintf (f, " finalized"); + if (node->output) + fprintf (f, " output"); + if (node->externally_visible) + fprintf (f, " externally_visible"); + fprintf (f, "\n"); +} - fprintf (f, "\n called by: "); - for (edge = node->callers; edge; edge = edge->next_caller) - { - fprintf (f, "%s ", cgraph_node_name (edge->caller)); - if (!edge->inline_failed) - fprintf(f, "(inlined) "); - } +/* Dump the callgraph. */ - fprintf (f, "\n calls: "); - for (edge = node->callees; edge; edge = edge->next_callee) - { - fprintf (f, "%s ", cgraph_node_name (edge->callee)); - if (!edge->inline_failed) - fprintf(f, "(inlined) "); - } - fprintf (f, "\n"); - } +void +dump_varpool (FILE *f) +{ + struct cgraph_varpool_node *node; + + fprintf (f, "variable pool:\n\n"); + for (node = cgraph_varpool_nodes; node; node = node->next_needed) + dump_cgraph_varpool_node (f, node); } /* Returns a hash code for P. */ static hashval_t -cgraph_varpool_hash_node (const void *p) +hash_varpool_node (const void *p) { - return ((hashval_t) - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME - (((struct cgraph_varpool_node *) p)->decl))); + const struct cgraph_varpool_node *n = (const struct cgraph_varpool_node *) p; + return (hashval_t) DECL_UID (n->decl); } /* Returns nonzero if P1 and P2 are equal. */ static int -eq_cgraph_varpool_node (const void *p1, const void *p2) +eq_varpool_node (const void *p1, const void *p2) { - return ((DECL_ASSEMBLER_NAME (((struct cgraph_varpool_node *) p1)->decl)) == - (tree) p2); + const struct cgraph_varpool_node *n1 = + (const struct cgraph_varpool_node *) p1; + const struct cgraph_varpool_node *n2 = + (const struct cgraph_varpool_node *) p2; + return DECL_UID (n1->decl) == DECL_UID (n2->decl); } /* Return cgraph_varpool node assigned to DECL. Create new one when needed. */ struct cgraph_varpool_node * cgraph_varpool_node (tree decl) { - struct cgraph_varpool_node *node; - struct cgraph_varpool_node **slot; + struct cgraph_varpool_node key, *node, **slot; - if (!DECL_P (decl) || TREE_CODE (decl) == FUNCTION_DECL) - abort (); + gcc_assert (DECL_P (decl) && TREE_CODE (decl) != FUNCTION_DECL); if (!cgraph_varpool_hash) - cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node, - eq_cgraph_varpool_node, NULL); + cgraph_varpool_hash = htab_create_ggc (10, hash_varpool_node, + eq_varpool_node, NULL); + key.decl = decl; slot = (struct cgraph_varpool_node **) - htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl), - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (decl)), - INSERT); + htab_find_slot (cgraph_varpool_hash, &key, INSERT); if (*slot) return *slot; - node = ggc_alloc_cleared (sizeof (*node)); + node = GGC_CNEW (struct cgraph_varpool_node); node->decl = decl; - cgraph_varpool_n_nodes++; + node->order = cgraph_order++; + node->next = cgraph_varpool_nodes; cgraph_varpool_nodes = node; *slot = node; return node; } +struct cgraph_varpool_node * +cgraph_varpool_node_for_asm (tree asmname) +{ + struct cgraph_varpool_node *node; + + for (node = cgraph_varpool_nodes; node ; node = node->next) + if (decl_assembler_name_equal (node->decl, asmname)) + return node; + + return NULL; +} + /* Set the DECL_ASSEMBLER_NAME and update cgraph hashtables. */ void change_decl_assembler_name (tree decl, tree name) { - struct cgraph_node *node = NULL; - struct cgraph_varpool_node *vnode = NULL; - void **slot; - if (!DECL_ASSEMBLER_NAME_SET_P (decl)) { SET_DECL_ASSEMBLER_NAME (decl, name); @@ -482,85 +889,34 @@ change_decl_assembler_name (tree decl, tree name) if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) && DECL_RTL_SET_P (decl)) - warning ("%D renamed after being referenced in assembly", decl); + warning (0, "%D renamed after being referenced in assembly", decl); - if (TREE_CODE (decl) == FUNCTION_DECL && cgraph_hash) - { - /* Take a look whether declaration is in the cgraph structure. */ - slot = - htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (decl), - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME - (decl)), NO_INSERT); - if (slot) - node = *slot; - - /* It is, verify that we are the canonical node for this decl. */ - if (node && node->decl == decl) - { - node = *slot; - htab_clear_slot (cgraph_hash, slot); - } - else - node = NULL; - } - if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) && cgraph_varpool_hash) - { - /* Take a look whether declaration is in the cgraph structure. */ - slot = - htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl), - IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME - (decl)), NO_INSERT); - if (slot) - vnode = *slot; - - /* It is, verify that we are the canonical vnode for this decl. */ - if (vnode && vnode->decl == decl) - { - vnode = *slot; - htab_clear_slot (cgraph_varpool_hash, slot); - } - else - vnode = NULL; - } SET_DECL_ASSEMBLER_NAME (decl, name); - if (node) - { - slot = - htab_find_slot_with_hash (cgraph_hash, name, - IDENTIFIER_HASH_VALUE (name), INSERT); - if (*slot) - abort (); - *slot = node; - } - if (vnode) - { - slot = - htab_find_slot_with_hash (cgraph_varpool_hash, name, - IDENTIFIER_HASH_VALUE (name), INSERT); - if (*slot) - abort (); - *slot = vnode; - } } -/* Try to find existing function for identifier ID. */ -struct cgraph_varpool_node * -cgraph_varpool_node_for_identifier (tree id) +/* Helper function for finalization code - add node into lists so it will + be analyzed and compiled. */ +void +cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *node) { - struct cgraph_varpool_node **slot; + if (cgraph_varpool_last_needed_node) + cgraph_varpool_last_needed_node->next_needed = node; + cgraph_varpool_last_needed_node = node; + node->next_needed = NULL; + if (!cgraph_varpool_nodes_queue) + cgraph_varpool_nodes_queue = node; + if (!cgraph_varpool_first_unanalyzed_node) + cgraph_varpool_first_unanalyzed_node = node; + notice_global_symbol (node->decl); +} - if (TREE_CODE (id) != IDENTIFIER_NODE) - abort (); - - if (!cgraph_varpool_hash) - return NULL; - - slot = (struct cgraph_varpool_node **) - htab_find_slot_with_hash (cgraph_varpool_hash, id, - IDENTIFIER_HASH_VALUE (id), NO_INSERT); - if (!slot) - return NULL; - return *slot; +/* Reset the queue of needed nodes. */ +void +cgraph_varpool_reset_queue (void) +{ + cgraph_varpool_last_needed_node = NULL; + cgraph_varpool_nodes_queue = NULL; + cgraph_varpool_first_unanalyzed_node = NULL; } /* Notify finalize_compilation_unit that given node is reachable @@ -568,66 +924,103 @@ cgraph_varpool_node_for_identifier (tree id) void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *node) { - if (!node->needed && node->finalized) - { - node->next_needed = cgraph_varpool_nodes_queue; - cgraph_varpool_nodes_queue = node; - notice_global_symbol (node->decl); - } + if (!node->needed && node->finalized + && !TREE_ASM_WRITTEN (node->decl)) + cgraph_varpool_enqueue_needed_node (node); node->needed = 1; } +/* Determine if variable DECL is needed. That is, visible to something + either outside this translation unit, something magic in the system + configury, or (if not doing unit-at-a-time) to something we haven't + seen yet. */ + +bool +decide_is_variable_needed (struct cgraph_varpool_node *node, tree decl) +{ + /* If the user told us it is used, then it must be so. */ + if (node->externally_visible) + return true; + if (!flag_unit_at_a_time + && lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + return true; + + /* ??? If the assembler name is set by hand, it is possible to assemble + the name later after finalizing the function and the fact is noticed + in assemble_name then. This is arguably a bug. */ + if (DECL_ASSEMBLER_NAME_SET_P (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + return true; + + /* If we decided it was needed before, but at the time we didn't have + the definition available, then it's still needed. */ + if (node->needed) + return true; + + /* Externally visible variables must be output. The exception is + COMDAT variables that must be output only when they are needed. */ + if (TREE_PUBLIC (decl) && !flag_whole_program && !DECL_COMDAT (decl) + && !DECL_EXTERNAL (decl)) + return true; + + /* When not reordering top level variables, we have to assume that + we are going to keep everything. */ + if (flag_unit_at_a_time && flag_toplevel_reorder) + return false; + + /* We want to emit COMDAT variables only when absolutely necessary. */ + if (DECL_COMDAT (decl)) + return false; + return true; +} + void cgraph_varpool_finalize_decl (tree decl) { struct cgraph_varpool_node *node = cgraph_varpool_node (decl); - + /* The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) - return; - if (node->needed) { - node->next_needed = cgraph_varpool_nodes_queue; - cgraph_varpool_nodes_queue = node; - notice_global_symbol (decl); + if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp)) + cgraph_varpool_assemble_pending_decls (); + return; } + if (node->needed) + cgraph_varpool_enqueue_needed_node (node); node->finalized = true; - if (/* Externally visible variables must be output. The exception are - COMDAT functions that must be output only when they are needed. */ - (TREE_PUBLIC (decl) && !DECL_COMDAT (decl)) - /* Function whose name is output to the assembler file must be produced. - It is possible to assemble the name later after finalizing the function - and the fact is noticed in assemble_name then. */ - || (DECL_ASSEMBLER_NAME_SET_P (decl) - && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) - { - cgraph_varpool_mark_needed_node (node); - } + if (decide_is_variable_needed (node, decl)) + cgraph_varpool_mark_needed_node (node); + /* Since we reclaim unreachable nodes at the end of every language + level unit, we need to be conservative about possible entry points + there. */ + else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) + cgraph_varpool_mark_needed_node (node); + if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp)) + cgraph_varpool_assemble_pending_decls (); } -bool -cgraph_varpool_assemble_pending_decls (void) +/* Add a top-level asm statement to the list. */ + +struct cgraph_asm_node * +cgraph_add_asm_node (tree asm_str) { - bool changed = false; + struct cgraph_asm_node *node; - while (cgraph_varpool_nodes_queue) - { - tree decl = cgraph_varpool_nodes_queue->decl; - struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue; - - cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->next_needed; - if (!TREE_ASM_WRITTEN (decl)) - { - assemble_variable (decl, 0, 1, 0); - changed = true; - } - node->next_needed = NULL; - } - return changed; + node = GGC_CNEW (struct cgraph_asm_node); + node->asm_str = asm_str; + node->order = cgraph_order++; + node->next = NULL; + if (cgraph_asm_nodes == NULL) + cgraph_asm_nodes = node; + else + cgraph_asm_last_node->next = node; + cgraph_asm_last_node = node; + return node; } /* Return true when the DECL can possibly be inlined. */ @@ -635,10 +1028,191 @@ bool cgraph_function_possibly_inlined_p (tree decl) { if (!cgraph_global_info_ready) - return (DECL_INLINE (decl) - && (!flag_really_no_inline - || (*lang_hooks.tree_inlining.disregard_inline_limits) (decl))); - return cgraph_node (decl)->global.inlined; + return (DECL_INLINE (decl) && !flag_really_no_inline); + return DECL_POSSIBLY_INLINED (decl); +} + +/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */ +struct cgraph_edge * +cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n, + tree call_stmt, gcov_type count_scale, int loop_nest, + bool update_original) +{ + struct cgraph_edge *new; + + new = cgraph_create_edge (n, e->callee, call_stmt, + e->count * count_scale / REG_BR_PROB_BASE, + e->loop_nest + loop_nest); + + new->inline_failed = e->inline_failed; + if (update_original) + { + e->count -= new->count; + if (e->count < 0) + e->count = 0; + } + return new; +} + +/* Create node representing clone of N executed COUNT times. Decrease + the execution counts from original node too. + + When UPDATE_ORIGINAL is true, the counts are subtracted from the original + function's profile to reflect the fact that part of execution is handled + by node. */ +struct cgraph_node * +cgraph_clone_node (struct cgraph_node *n, gcov_type count, int loop_nest, + bool update_original) +{ + struct cgraph_node *new = cgraph_create_node (); + struct cgraph_edge *e; + gcov_type count_scale; + + new->decl = n->decl; + new->origin = n->origin; + if (new->origin) + { + new->next_nested = new->origin->nested; + new->origin->nested = new; + } + new->analyzed = n->analyzed; + new->local = n->local; + new->global = n->global; + new->rtl = n->rtl; + new->master_clone = n->master_clone; + new->count = count; + if (n->count) + count_scale = new->count * REG_BR_PROB_BASE / n->count; + else + count_scale = 0; + if (update_original) + { + n->count -= count; + if (n->count < 0) + n->count = 0; + } + + for (e = n->callees;e; e=e->next_callee) + cgraph_clone_edge (e, new, e->call_stmt, count_scale, loop_nest, + update_original); + + new->next_clone = n->next_clone; + new->prev_clone = n; + n->next_clone = new; + if (new->next_clone) + new->next_clone->prev_clone = new; + + return new; +} + +/* Return true if N is an master_clone, (see cgraph_master_clone). */ + +bool +cgraph_is_master_clone (struct cgraph_node *n) +{ + return (n == cgraph_master_clone (n)); +} + +struct cgraph_node * +cgraph_master_clone (struct cgraph_node *n) +{ + enum availability avail = cgraph_function_body_availability (n); + + if (avail == AVAIL_NOT_AVAILABLE || avail == AVAIL_OVERWRITABLE) + return NULL; + + if (!n->master_clone) + n->master_clone = cgraph_node (n->decl); + + return n->master_clone; +} + +/* NODE is no longer nested function; update cgraph accordingly. */ +void +cgraph_unnest_node (struct cgraph_node *node) +{ + struct cgraph_node **node2 = &node->origin->nested; + gcc_assert (node->origin); + + while (*node2 != node) + node2 = &(*node2)->next_nested; + *node2 = node->next_nested; + node->origin = NULL; +} + +/* Return function availability. See cgraph.h for description of individual + return values. */ +enum availability +cgraph_function_body_availability (struct cgraph_node *node) +{ + enum availability avail; + gcc_assert (cgraph_function_flags_ready); + if (!node->analyzed) + avail = AVAIL_NOT_AVAILABLE; + else if (node->local.local) + avail = AVAIL_LOCAL; + else if (node->local.externally_visible) + avail = AVAIL_AVAILABLE; + + /* If the function can be overwritten, return OVERWRITABLE. Take + care at least of two notable extensions - the COMDAT functions + used to share template instantiations in C++ (this is symmetric + to code cp_cannot_inline_tree_fn and probably shall be shared and + the inlinability hooks completely eliminated). + + ??? Does the C++ one definition rule allow us to always return + AVAIL_AVAILABLE here? That would be good reason to preserve this + hook Similarly deal with extern inline functions - this is again + necessary to get C++ shared functions having keyed templates + right and in the C extension documentation we probably should + document the requirement of both versions of function (extern + inline and offline) having same side effect characteristics as + good optimization is what this optimization is about. */ + + else if (!(*targetm.binds_local_p) (node->decl) + && !DECL_COMDAT (node->decl) && !DECL_EXTERNAL (node->decl)) + avail = AVAIL_OVERWRITABLE; + else avail = AVAIL_AVAILABLE; + + return avail; +} + +/* Return variable availability. See cgraph.h for description of individual + return values. */ +enum availability +cgraph_variable_initializer_availability (struct cgraph_varpool_node *node) +{ + gcc_assert (cgraph_function_flags_ready); + if (!node->finalized) + return AVAIL_NOT_AVAILABLE; + if (!TREE_PUBLIC (node->decl)) + return AVAIL_AVAILABLE; + /* If the variable can be overwritten, return OVERWRITABLE. Takes + care of at least two notable extensions - the COMDAT variables + used to share template instantiations in C++. */ + if (!(*targetm.binds_local_p) (node->decl) && !DECL_COMDAT (node->decl)) + return AVAIL_OVERWRITABLE; + return AVAIL_AVAILABLE; +} + + +/* Add the function FNDECL to the call graph. FNDECL is assumed to be + in low GIMPLE form and ready to be processed by cgraph_finalize_function. + + When operating in unit-at-a-time, a new callgraph node is added to + CGRAPH_EXPAND_QUEUE, which is processed after all the original + functions in the call graph . + + When not in unit-at-a-time, the new callgraph node is added to + CGRAPH_NODES_QUEUE for cgraph_assemble_pending_functions to + process. */ + +void +cgraph_add_new_function (tree fndecl) +{ + struct cgraph_node *n = cgraph_node (fndecl); + n->next_needed = cgraph_expand_queue; + cgraph_expand_queue = n; } #include "gt-cgraph.h" diff --git a/contrib/gcc/cgraph.h b/contrib/gcc/cgraph.h index b845ef7b597..dccf3ff0223 100644 --- a/contrib/gcc/cgraph.h +++ b/contrib/gcc/cgraph.h @@ -1,5 +1,5 @@ /* Callgraph handling code. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. @@ -16,11 +16,35 @@ for more details. 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. */ #ifndef GCC_CGRAPH_H #define GCC_CGRAPH_H +#include "tree.h" +#include "basic-block.h" + +enum availability +{ + /* Not yet set by cgraph_function_body_availability. */ + AVAIL_UNSET, + /* Function body/variable initializer is unknown. */ + AVAIL_NOT_AVAILABLE, + /* Function body/variable initializer is known but might be replaced + by a different one from other compilation unit and thus needs to + be dealt with a care. Like AVAIL_NOT_AVAILABLE it can have + arbitrary side effects on escaping variables and functions, while + like AVAILABLE it might access static variables. */ + AVAIL_OVERWRITABLE, + /* Function body/variable initializer is known and will be used in final + program. */ + AVAIL_AVAILABLE, + /* Function body/variable initializer is known and all it's uses are explicitly + visible within current unit (ie it's address is never taken and it is not + exported to other units). + Currently used only for functions. */ + AVAIL_LOCAL +}; /* Information about the function collected locally. Available after function is analyzed. */ @@ -31,18 +55,32 @@ struct cgraph_local_info GTY(()) int self_insns; /* Set when function function is visible in current compilation unit only - and it's address is never taken. */ - bool local; + and its address is never taken. */ + unsigned local : 1; + + /* Set when function is visible by other units. */ + unsigned externally_visible : 1; + /* Set once it has been finalized so we consider it to be output. */ - bool finalized; + unsigned finalized : 1; /* False when there something makes inlining impossible (such as va_arg). */ - bool inlinable; - /* True when function should be inlined independently on it's size. */ - bool disregard_inline_limits; + unsigned inlinable : 1; + + /* True when function should be inlined independently on its size. */ + unsigned disregard_inline_limits : 1; + /* True when the function has been originally extern inline, but it is redefined now. */ - bool redefined_extern_inline; + unsigned redefined_extern_inline : 1; + + /* True if statics_read_for_function and + statics_written_for_function contain valid data. */ + unsigned for_functions_valid : 1; + + /* True if the function is going to be emitted in some other translation + unit, referenced from vtable. */ + unsigned vtable_method : 1; }; /* Information about the function that needs to be computed globally @@ -50,21 +88,16 @@ struct cgraph_local_info GTY(()) struct cgraph_global_info GTY(()) { + /* For inline clones this points to the function they will be inlined into. */ + struct cgraph_node *inlined_to; + /* Estimated size of the function after inlining. */ int insns; - /* Number of times given function will be cloned during output. */ - int cloned_times; + /* Estimated growth after inlining. INT_MIN if not computed. */ + int estimated_growth; - /* Set when the function will be inlined exactly once. */ - bool inline_once; - - /* Set to true for all reachable functions before inlining is decided. - Once we inline all calls to the function and the function is local, - it is set to false. */ - bool will_be_output; - - /* Set iff at least one of the caller edges has inline_call flag set. */ + /* Set iff the function has been inlined at least once. */ bool inlined; }; @@ -73,12 +106,9 @@ struct cgraph_global_info GTY(()) struct cgraph_rtl_info GTY(()) { - bool const_function; - bool pure_function; int preferred_incoming_stack_boundary; }; - /* The cgraph data structure. Each function decl has assigned cgraph_node listing callees and callers. */ @@ -97,96 +127,208 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) struct cgraph_node *next_nested; /* Pointer to the next function in cgraph_nodes_queue. */ struct cgraph_node *next_needed; - PTR GTY ((skip (""))) aux; + /* Pointer to the next clone. */ + struct cgraph_node *next_clone; + struct cgraph_node *prev_clone; + /* Pointer to a single unique cgraph node for this function. If the + function is to be output, this is the copy that will survive. */ + struct cgraph_node *master_clone; + /* For functions with many calls sites it holds map from call expression + to the edge to speed up cgraph_edge function. */ + htab_t GTY((param_is (struct cgraph_edge))) call_site_hash; + + PTR GTY ((skip)) aux; struct cgraph_local_info local; struct cgraph_global_info global; struct cgraph_rtl_info rtl; + + /* Expected number of executions: calculated in profile.c. */ + gcov_type count; /* Unique id of the node. */ int uid; + /* Ordering of all cgraph nodes. */ + int order; + /* Set when function must be output - it is externally visible - or it's address is taken. */ - bool needed; + or its address is taken. */ + unsigned needed : 1; /* Set when function is reachable by call from other function that is either reachable or needed. */ - bool reachable; + unsigned reachable : 1; + /* Set once the function is lowered (i.e. its CFG is built). */ + unsigned lowered : 1; /* Set once the function has been instantiated and its callee lists created. */ - bool analyzed; + unsigned analyzed : 1; /* Set when function is scheduled to be assembled. */ - bool output; + unsigned output : 1; + /* Set for aliases once they got through assemble_alias. */ + unsigned alias : 1; + + /* In non-unit-at-a-time mode the function body of inline candidates is saved + into clone before compiling so the function in original form can be + inlined later. This pointer points to the clone. */ + tree inline_decl; }; -struct cgraph_edge GTY(()) +struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) { struct cgraph_node *caller; struct cgraph_node *callee; + struct cgraph_edge *prev_caller; struct cgraph_edge *next_caller; + struct cgraph_edge *prev_callee; struct cgraph_edge *next_callee; + tree call_stmt; + PTR GTY ((skip (""))) aux; /* When NULL, inline this call. When non-NULL, points to the explanation why function was not inlined. */ const char *inline_failed; + /* Expected number of executions: calculated in profile.c. */ + gcov_type count; + /* Depth of loop nest, 1 means no loop nest. */ + int loop_nest; }; +typedef struct cgraph_edge *cgraph_edge_p; + +DEF_VEC_P(cgraph_edge_p); +DEF_VEC_ALLOC_P(cgraph_edge_p,heap); + /* The cgraph_varpool data structure. Each static variable decl has assigned cgraph_varpool_node. */ struct cgraph_varpool_node GTY(()) { tree decl; + /* Pointer to the next function in cgraph_varpool_nodes. */ + struct cgraph_varpool_node *next; /* Pointer to the next function in cgraph_varpool_nodes_queue. */ struct cgraph_varpool_node *next_needed; + /* Ordering of all cgraph nodes. */ + int order; /* Set when function must be output - it is externally visible - or it's address is taken. */ - bool needed; + or its address is taken. */ + unsigned needed : 1; + /* Needed variables might become dead by optimization. This flag + forces the variable to be output even if it appears dead otherwise. */ + unsigned force_output : 1; + /* Set once the variable has been instantiated and its callee + lists created. */ + unsigned analyzed : 1; /* Set once it has been finalized so we consider it to be output. */ - bool finalized; - /* Set when function is scheduled to be assembled. */ - bool output; + unsigned finalized : 1; + /* Set when variable is scheduled to be assembled. */ + unsigned output : 1; + /* Set when function is visible by other units. */ + unsigned externally_visible : 1; + /* Set for aliases once they got through assemble_alias. */ + unsigned alias : 1; +}; + +/* Every top level asm statement is put into a cgraph_asm_node. */ + +struct cgraph_asm_node GTY(()) +{ + /* Next asm node. */ + struct cgraph_asm_node *next; + /* String for this asm node. */ + tree asm_str; + /* Ordering of all cgraph nodes. */ + int order; }; extern GTY(()) struct cgraph_node *cgraph_nodes; extern GTY(()) int cgraph_n_nodes; extern GTY(()) int cgraph_max_uid; extern bool cgraph_global_info_ready; +extern bool cgraph_function_flags_ready; extern GTY(()) struct cgraph_node *cgraph_nodes_queue; -extern FILE *cgraph_dump_file; +extern GTY(()) struct cgraph_node *cgraph_expand_queue; -extern GTY(()) int cgraph_varpool_n_nodes; +extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_first_unanalyzed_node; +extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_last_needed_node; extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue; - +extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes; +extern GTY(()) struct cgraph_asm_node *cgraph_asm_nodes; +extern GTY(()) int cgraph_order; /* In cgraph.c */ void dump_cgraph (FILE *); -void cgraph_remove_edge (struct cgraph_node *, struct cgraph_node *); -void cgraph_remove_call (tree, tree); +void dump_cgraph_node (FILE *, struct cgraph_node *); +void cgraph_insert_node_to_hashtable (struct cgraph_node *node); +void dump_varpool (FILE *); +void dump_cgraph_varpool_node (FILE *, struct cgraph_varpool_node *); +void cgraph_remove_edge (struct cgraph_edge *); void cgraph_remove_node (struct cgraph_node *); -struct cgraph_edge *cgraph_record_call (tree, tree); -struct cgraph_node *cgraph_node (tree decl); -struct cgraph_node *cgraph_node_for_identifier (tree id); -bool cgraph_calls_p (tree, tree); +void cgraph_node_remove_callees (struct cgraph_node *node); +struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, + struct cgraph_node *, + tree, gcov_type, int); +struct cgraph_node *cgraph_node (tree); +struct cgraph_node *cgraph_node_for_asm (tree asmname); +struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree); +void cgraph_set_call_stmt (struct cgraph_edge *, tree); struct cgraph_local_info *cgraph_local_info (tree); struct cgraph_global_info *cgraph_global_info (tree); struct cgraph_rtl_info *cgraph_rtl_info (tree); const char * cgraph_node_name (struct cgraph_node *); +struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *, + struct cgraph_node *, + tree, gcov_type, int, bool); +struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, + int, bool); -struct cgraph_varpool_node *cgraph_varpool_node (tree decl); -struct cgraph_varpool_node *cgraph_varpool_node_for_identifier (tree id); +struct cgraph_varpool_node *cgraph_varpool_node (tree); +struct cgraph_varpool_node *cgraph_varpool_node_for_asm (tree asmname); void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *); void cgraph_varpool_finalize_decl (tree); -bool cgraph_varpool_assemble_pending_decls (void); +void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *); + +struct cgraph_asm_node *cgraph_add_asm_node (tree); bool cgraph_function_possibly_inlined_p (tree); +void cgraph_unnest_node (struct cgraph_node *); +void cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *); +void cgraph_varpool_reset_queue (void); +bool decide_is_variable_needed (struct cgraph_varpool_node *, tree); + +enum availability cgraph_function_body_availability (struct cgraph_node *); +enum availability cgraph_variable_initializer_availability (struct cgraph_varpool_node *); +bool cgraph_is_master_clone (struct cgraph_node *); +struct cgraph_node *cgraph_master_clone (struct cgraph_node *); +void cgraph_add_new_function (tree); /* In cgraphunit.c */ bool cgraph_assemble_pending_functions (void); +bool cgraph_varpool_assemble_pending_decls (void); void cgraph_finalize_function (tree, bool); void cgraph_finalize_compilation_unit (void); -void cgraph_create_edges (tree, tree); void cgraph_optimize (void); void cgraph_mark_needed_node (struct cgraph_node *); void cgraph_mark_reachable_node (struct cgraph_node *); -bool cgraph_inline_p (tree, tree, const char **reason); +bool cgraph_inline_p (struct cgraph_edge *, const char **reason); +bool cgraph_preserve_function_body_p (tree); +void verify_cgraph (void); +void verify_cgraph_node (struct cgraph_node *); +void cgraph_build_static_cdtor (char which, tree body, int priority); +void cgraph_reset_static_var_maps (void); +void init_cgraph (void); +struct cgraph_node *cgraph_function_versioning (struct cgraph_node *, + VEC(cgraph_edge_p,heap)*, + varray_type); +void cgraph_analyze_function (struct cgraph_node *); +struct cgraph_node *save_inline_function_body (struct cgraph_node *); +/* In ipa.c */ +bool cgraph_remove_unreachable_nodes (bool, FILE *); +int cgraph_postorder (struct cgraph_node **); + +/* In ipa-inline.c */ +bool cgraph_decide_inlining_incrementally (struct cgraph_node *, bool); +void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool); +void cgraph_mark_inline_edge (struct cgraph_edge *, bool); +bool cgraph_default_inline_p (struct cgraph_node *, const char **); #endif /* GCC_CGRAPH_H */ diff --git a/contrib/gcc/cgraphunit.c b/contrib/gcc/cgraphunit.c index 75ad3c8135e..0d3ed477f9d 100644 --- a/contrib/gcc/cgraphunit.c +++ b/contrib/gcc/cgraphunit.c @@ -1,5 +1,5 @@ -/* Callgraph based intraprocedural optimizations. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Callgraph based interprocedural optimizations. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. @@ -16,17 +16,139 @@ for more details. 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 module implements main driver of compilation process as well as + few basic interprocedural optimizers. + + The main scope of this file is to act as an interface in between + tree based frontends and the backend (and middle end) + + The front-end is supposed to use following functionality: + + - cgraph_finalize_function + + This function is called once front-end has parsed whole body of function + and it is certain that the function body nor the declaration will change. + + (There is one exception needed for implementing GCC extern inline function.) + + - cgraph_varpool_finalize_variable + + This function has same behavior as the above but is used for static + variables. + + - cgraph_finalize_compilation_unit + + This function is called once compilation unit is finalized and it will + no longer change. + + In the unit-at-a-time the call-graph construction and local function + analysis takes place here. Bodies of unreachable functions are released + to conserve memory usage. + + ??? The compilation unit in this point of view should be compilation + unit as defined by the language - for instance C frontend allows multiple + compilation units to be parsed at once and it should call function each + time parsing is done so we save memory. + + - cgraph_optimize + + In this unit-at-a-time compilation the intra procedural analysis takes + place here. In particular the static functions whose address is never + taken are marked as local. Backend can then use this information to + modify calling conventions, do better inlining or similar optimizations. + + - cgraph_assemble_pending_functions + - cgraph_varpool_assemble_pending_variables + + In non-unit-at-a-time mode these functions can be used to force compilation + of functions or variables that are known to be needed at given stage + of compilation + + - cgraph_mark_needed_node + - cgraph_varpool_mark_needed_node + + When function or variable is referenced by some hidden way (for instance + via assembly code and marked by attribute "used"), the call-graph data structure + must be updated accordingly by this function. + + - analyze_expr callback + + This function is responsible for lowering tree nodes not understood by + generic code into understandable ones or alternatively marking + callgraph and varpool nodes referenced by the as needed. + + ??? On the tree-ssa genericizing should take place here and we will avoid + need for these hooks (replacing them by genericizing hook) + + - expand_function callback + + This function is used to expand function and pass it into RTL back-end. + Front-end should not make any assumptions about when this function can be + called. In particular cgraph_assemble_pending_functions, + cgraph_varpool_assemble_pending_variables, cgraph_finalize_function, + cgraph_varpool_finalize_function, cgraph_optimize can cause arbitrarily + previously finalized functions to be expanded. + + We implement two compilation modes. + + - unit-at-a-time: In this mode analyzing of all functions is deferred + to cgraph_finalize_compilation_unit and expansion into cgraph_optimize. + + In cgraph_finalize_compilation_unit the reachable functions are + analyzed. During analysis the call-graph edges from reachable + functions are constructed and their destinations are marked as + reachable. References to functions and variables are discovered too + and variables found to be needed output to the assembly file. Via + mark_referenced call in assemble_variable functions referenced by + static variables are noticed too. + + The intra-procedural information is produced and its existence + indicated by global_info_ready. Once this flag is set it is impossible + to change function from !reachable to reachable and thus + assemble_variable no longer call mark_referenced. + + Finally the call-graph is topologically sorted and all reachable functions + that has not been completely inlined or are not external are output. + + ??? It is possible that reference to function or variable is optimized + out. We can not deal with this nicely because topological order is not + suitable for it. For tree-ssa we may consider another pass doing + optimization and re-discovering reachable functions. + + ??? Reorganize code so variables are output very last and only if they + really has been referenced by produced code, so we catch more cases + where reference has been optimized out. + + - non-unit-at-a-time + + All functions are variables are output as early as possible to conserve + memory consumption. This may or may not result in less memory used but + it is still needed for some legacy code that rely on particular ordering + of things output from the compiler. + + Varpool data structures are not used and variables are output directly. + + Functions are output early using call of + cgraph_assemble_pending_function from cgraph_finalize_function. The + decision on whether function is needed is made more conservative so + uninlininable static functions are needed too. During the call-graph + construction the edge destinations are not marked as reachable and it + is completely relied upn assemble_variable to mark them. */ + #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "rtl.h" +#include "tree-flow.h" #include "tree-inline.h" #include "langhooks.h" -#include "hashtab.h" +#include "pointer-set.h" #include "toplev.h" #include "flags.h" #include "ggc.h" @@ -40,30 +162,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "c-common.h" #include "intl.h" #include "function.h" - -#define INSNS_PER_CALL 10 +#include "ipa-prop.h" +#include "tree-gimple.h" +#include "tree-pass.h" +#include "output.h" static void cgraph_expand_all_functions (void); static void cgraph_mark_functions_to_output (void); static void cgraph_expand_function (struct cgraph_node *); -static tree record_call_1 (tree *, int *, void *); -static void cgraph_mark_local_functions (void); -static void cgraph_optimize_function (struct cgraph_node *); -static bool cgraph_default_inline_p (struct cgraph_node *n); -static void cgraph_analyze_function (struct cgraph_node *node); -static void cgraph_decide_inlining_incrementally (struct cgraph_node *); +static tree record_reference (tree *, int *, void *); +static void cgraph_output_pending_asms (void); +static void cgraph_increase_alignment (void); -/* Statistics we collect about inlining algorithm. */ -static int ncalls_inlined; -static int nfunctions_inlined; -static int initial_insns; -static int overall_insns; +/* Lists all assembled variables to be sent to debugger output later on. */ +static GTY(()) struct cgraph_varpool_node *cgraph_varpool_assembled_nodes_queue; -/* Records tree nodes seen in cgraph_create_edges. Simply using +/* Records tree nodes seen in record_reference. Simply using walk_tree_without_duplicates doesn't guarantee each node is visited once because it gets a new htab upon each recursive call from - record_calls_1. */ -static htab_t visited_nodes; + record_reference itself. */ +static struct pointer_set_t *visited_nodes; + +static FILE *cgraph_dump_file; /* Determine if function DECL is needed. That is, visible to something either outside this translation unit, something magic in the system @@ -73,24 +193,19 @@ static htab_t visited_nodes; static bool decide_is_function_needed (struct cgraph_node *node, tree decl) { - /* If we decided it was needed before, but at the time we didn't have - the body of the function available, then it's still needed. We have - to go back and re-check its dependencies now. */ - if (node->needed) - return true; - - /* Externally visible functions must be output. The exception is - COMDAT functions that must be output only when they are needed. */ - if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) - return true; - - /* Constructors and destructors are reachable from the runtime by - some mechanism. */ - if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl)) - return true; + tree origin; + if (MAIN_NAME_P (DECL_NAME (decl)) + && TREE_PUBLIC (decl)) + { + node->local.externally_visible = true; + return true; + } /* If the user told us it is used, then it must be so. */ - if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + if (node->local.externally_visible) + return true; + + if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl))) return true; /* ??? If the assembler name is set by hand, it is possible to assemble @@ -100,6 +215,33 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) return true; + /* If we decided it was needed before, but at the time we didn't have + the body of the function available, then it's still needed. We have + to go back and re-check its dependencies now. */ + if (node->needed) + return true; + + /* Externally visible functions must be output. The exception is + COMDAT functions that must be output only when they are needed. + + When not optimizing, also output the static functions. (see + PR24561), but don't do so for always_inline functions, functions + declared inline and nested functions. These was optimized out + in the original implementation and it is unclear whether we want + to change the behavior here. */ + if (((TREE_PUBLIC (decl) + || (!optimize && !node->local.disregard_inline_limits + && !DECL_DECLARED_INLINE_P (decl) + && !node->origin)) + && !flag_whole_program) + && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) + return true; + + /* Constructors and destructors are reachable from the runtime by + some mechanism. */ + if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl)) + return true; + if (flag_unit_at_a_time) return false; @@ -109,6 +251,12 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) /* "extern inline" functions are never output locally. */ if (DECL_EXTERNAL (decl)) return false; + /* Nested functions of extern inline function shall not be emit unless + we inlined the origin. */ + for (origin = decl_function_context (decl); origin; + origin = decl_function_context (origin)) + if (DECL_EXTERNAL (origin)) + return false; /* We want to emit COMDAT functions only when absolutely necessary. */ if (DECL_COMDAT (decl)) return false; @@ -116,13 +264,90 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) || (!node->local.disregard_inline_limits /* When declared inline, defer even the uninlinable functions. This allows them to be eliminated when unused. */ - && !DECL_DECLARED_INLINE_P (decl) - && (!node->local.inlinable || !cgraph_default_inline_p (node)))) + && !DECL_DECLARED_INLINE_P (decl) + && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL)))) return true; return false; } +/* Walk the decls we marked as necessary and see if they reference new + variables or functions and add them into the worklists. */ +static bool +cgraph_varpool_analyze_pending_decls (void) +{ + bool changed = false; + timevar_push (TV_CGRAPH); + + while (cgraph_varpool_first_unanalyzed_node) + { + tree decl = cgraph_varpool_first_unanalyzed_node->decl; + + cgraph_varpool_first_unanalyzed_node->analyzed = true; + + cgraph_varpool_first_unanalyzed_node = cgraph_varpool_first_unanalyzed_node->next_needed; + + /* Compute the alignment early so function body expanders are + already informed about increased alignment. */ + align_variable (decl, 0); + + if (DECL_INITIAL (decl)) + { + visited_nodes = pointer_set_create (); + walk_tree (&DECL_INITIAL (decl), record_reference, NULL, visited_nodes); + pointer_set_destroy (visited_nodes); + visited_nodes = NULL; + } + changed = true; + } + timevar_pop (TV_CGRAPH); + return changed; +} + +/* Optimization of function bodies might've rendered some variables as + unnecessary so we want to avoid these from being compiled. + + This is done by pruning the queue and keeping only the variables that + really appear needed (ie they are either externally visible or referenced + by compiled function). Re-doing the reachability analysis on variables + brings back the remaining variables referenced by these. */ +static void +cgraph_varpool_remove_unreferenced_decls (void) +{ + struct cgraph_varpool_node *next, *node = cgraph_varpool_nodes_queue; + + cgraph_varpool_reset_queue (); + + if (errorcount || sorrycount) + return; + + while (node) + { + tree decl = node->decl; + next = node->next_needed; + node->needed = 0; + + if (node->finalized + && ((DECL_ASSEMBLER_NAME_SET_P (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + || node->force_output + || decide_is_variable_needed (node, decl) + /* ??? Cgraph does not yet rule the world with an iron hand, + and does not control the emission of debug information. + After a variable has its DECL_RTL set, we must assume that + it may be referenced by the debug information, and we can + no longer elide it. */ + || DECL_RTL_SET_P (decl))) + cgraph_varpool_mark_needed_node (node); + + node = next; + } + /* Make sure we mark alias targets as used targets. */ + finish_aliases_1 (); + cgraph_varpool_analyze_pending_decls (); +} + + /* When not doing unit-at-a-time, output all functions enqueued. Return true when such a functions were found. */ @@ -134,21 +359,105 @@ cgraph_assemble_pending_functions (void) if (flag_unit_at_a_time) return false; + cgraph_output_pending_asms (); + while (cgraph_nodes_queue) { struct cgraph_node *n = cgraph_nodes_queue; cgraph_nodes_queue = cgraph_nodes_queue->next_needed; - if (!n->origin && !DECL_EXTERNAL (n->decl)) + n->next_needed = NULL; + if (!n->global.inlined_to + && !n->alias + && !DECL_EXTERNAL (n->decl)) { cgraph_expand_function (n); output = true; } } + /* Process CGRAPH_EXPAND_QUEUE, these are functions created during + the expansion process. Note that this queue may grow as its + being processed, as the new functions may generate new ones. */ + while (cgraph_expand_queue) + { + struct cgraph_node *n = cgraph_expand_queue; + cgraph_expand_queue = cgraph_expand_queue->next_needed; + n->next_needed = NULL; + cgraph_finalize_function (n->decl, false); + output = true; + } + return output; } + +/* As an GCC extension we allow redefinition of the function. The + semantics when both copies of bodies differ is not well defined. + We replace the old body with new body so in unit at a time mode + we always use new body, while in normal mode we may end up with + old body inlined into some functions and new body expanded and + inlined in others. + + ??? It may make more sense to use one body for inlining and other + body for expanding the function but this is difficult to do. */ + +static void +cgraph_reset_node (struct cgraph_node *node) +{ + /* If node->output is set, then this is a unit-at-a-time compilation + and we have already begun whole-unit analysis. This is *not* + testing for whether we've already emitted the function. That + case can be sort-of legitimately seen with real function + redefinition errors. I would argue that the front end should + never present us with such a case, but don't enforce that for now. */ + gcc_assert (!node->output); + + /* Reset our data structures so we can analyze the function again. */ + memset (&node->local, 0, sizeof (node->local)); + memset (&node->global, 0, sizeof (node->global)); + memset (&node->rtl, 0, sizeof (node->rtl)); + node->analyzed = false; + node->local.redefined_extern_inline = true; + node->local.finalized = false; + + if (!flag_unit_at_a_time) + { + struct cgraph_node *n, *next; + + for (n = cgraph_nodes; n; n = next) + { + next = n->next; + if (n->global.inlined_to == node) + cgraph_remove_node (n); + } + } + + cgraph_node_remove_callees (node); + + /* We may need to re-queue the node for assembling in case + we already proceeded it and ignored as not needed. */ + if (node->reachable && !flag_unit_at_a_time) + { + struct cgraph_node *n; + + for (n = cgraph_nodes_queue; n; n = n->next_needed) + if (n == node) + break; + if (!n) + node->reachable = 0; + } +} + +static void +cgraph_lower_function (struct cgraph_node *node) +{ + if (node->lowered) + return; + tree_lowering_passes (node->decl); + node->lowered = true; +} + /* DECL has been parsed. Take it, queue it, compile it at the whim of the logic in effect. If NESTED is true, then our caller cannot stand to have the garbage collector run at the moment. We would need to either create @@ -160,64 +469,33 @@ cgraph_finalize_function (tree decl, bool nested) struct cgraph_node *node = cgraph_node (decl); if (node->local.finalized) - { - /* As an GCC extension we allow redefinition of the function. The - semantics when both copies of bodies differ is not well defined. - We replace the old body with new body so in unit at a time mode - we always use new body, while in normal mode we may end up with - old body inlined into some functions and new body expanded and - inlined in others. - - ??? It may make more sense to use one body for inlining and other - body for expanding the function but this is difficult to do. */ - - /* If node->output is set, then this is a unit-at-a-time compilation - and we have already begun whole-unit analysis. This is *not* - testing for whether we've already emitted the function. That - case can be sort-of legitimately seen with real function - redefinition errors. I would argue that the front end should - never present us with such a case, but don't enforce that for now. */ - if (node->output) - abort (); - - /* Reset our datastructures so we can analyze the function again. */ - memset (&node->local, 0, sizeof (node->local)); - memset (&node->global, 0, sizeof (node->global)); - memset (&node->rtl, 0, sizeof (node->rtl)); - node->analyzed = false; - node->local.redefined_extern_inline = true; - while (node->callees) - cgraph_remove_edge (node, node->callees->callee); - - /* We may need to re-queue the node for assembling in case - we already proceeded it and ignored as not needed. */ - if (node->reachable && !flag_unit_at_a_time) - { - struct cgraph_node *n; - - for (n = cgraph_nodes_queue; n; n = n->next_needed) - if (n == node) - break; - if (!n) - node->reachable = 0; - } - } + cgraph_reset_node (node); notice_global_symbol (decl); node->decl = decl; node->local.finalized = true; + node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL; + if (node->nested) + lower_nested_functions (decl); + gcc_assert (!node->nested); /* If not unit at a time, then we need to create the call graph now, so that called functions can be queued and emitted now. */ if (!flag_unit_at_a_time) { cgraph_analyze_function (node); - cgraph_decide_inlining_incrementally (node); + cgraph_decide_inlining_incrementally (node, false); } if (decide_is_function_needed (node, decl)) cgraph_mark_needed_node (node); + /* Since we reclaim unreachable nodes at the end of every language + level unit, we need to be conservative about possible entry points + there. */ + if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))) + cgraph_mark_reachable_node (node); + /* If not unit at a time, go ahead and emit everything we've found to be reachable at this time. */ if (!nested) @@ -230,15 +508,14 @@ cgraph_finalize_function (tree decl, bool nested) if (!TREE_ASM_WRITTEN (decl)) (*debug_hooks->deferred_inline_function) (decl); - /* We will never really output the function body, clear the SAVED_INSNS array - early then. */ - if (DECL_EXTERNAL (decl)) - DECL_SAVED_INSNS (decl) = NULL; + /* Possibly warn about unused parameters. */ + if (warn_unused_parameter) + do_warn_unused_parameter (decl); } /* Walk tree and record all calls. Called via walk_tree. */ static tree -record_call_1 (tree *tp, int *walk_subtrees, void *data) +record_reference (tree *tp, int *walk_subtrees, void *data) { tree t = *tp; @@ -248,10 +525,16 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) /* ??? Really, we should mark this decl as *potentially* referenced by this function and re-examine whether the decl is actually used after rtl has been generated. */ - if (TREE_STATIC (t)) - cgraph_varpool_mark_needed_node (cgraph_varpool_node (t)); + if (TREE_STATIC (t) || DECL_EXTERNAL (t)) + { + cgraph_varpool_mark_needed_node (cgraph_varpool_node (t)); + if (lang_hooks.callgraph.analyze_expr) + return lang_hooks.callgraph.analyze_expr (tp, walk_subtrees, + data); + } break; + case FDESC_EXPR: case ADDR_EXPR: if (flag_unit_at_a_time) { @@ -263,104 +546,507 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) } break; - case CALL_EXPR: - { - tree decl = get_callee_fndecl (*tp); - if (decl && TREE_CODE (decl) == FUNCTION_DECL) - { - cgraph_record_call (data, decl); - - /* When we see a function call, we don't want to look at the - function reference in the ADDR_EXPR that is hanging from - the CALL_EXPR we're examining here, because we would - conclude incorrectly that the function's address could be - taken by something that is not a function call. So only - walk the function parameter list, skip the other subtrees. */ - - walk_tree (&TREE_OPERAND (*tp, 1), record_call_1, data, - visited_nodes); - *walk_subtrees = 0; - } - break; - } - default: /* Save some cycles by not walking types and declaration as we won't find anything useful there anyway. */ - if (DECL_P (*tp) || TYPE_P (*tp)) + if (IS_TYPE_OR_DECL_P (*tp)) { *walk_subtrees = 0; break; } if ((unsigned int) TREE_CODE (t) >= LAST_AND_UNUSED_TREE_CODE) - return (*lang_hooks.callgraph.analyze_expr) (tp, walk_subtrees, data); + return lang_hooks.callgraph.analyze_expr (tp, walk_subtrees, data); break; } return NULL; } -/* Create cgraph edges for function calls inside BODY from DECL. */ +/* Create cgraph edges for function calls inside BODY from NODE. */ -void -cgraph_create_edges (tree decl, tree body) +static void +cgraph_create_edges (struct cgraph_node *node, tree body) { - /* The nodes we're interested in are never shared, so walk - the tree ignoring duplicates. */ - visited_nodes = htab_create (37, htab_hash_pointer, - htab_eq_pointer, NULL); - walk_tree (&body, record_call_1, decl, visited_nodes); - htab_delete (visited_nodes); + basic_block bb; + + struct function *this_cfun = DECL_STRUCT_FUNCTION (body); + block_stmt_iterator bsi; + tree step; + visited_nodes = pointer_set_create (); + + /* Reach the trees by walking over the CFG, and note the + enclosing basic-blocks in the call edges. */ + FOR_EACH_BB_FN (bb, this_cfun) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + tree call = get_call_expr_in (stmt); + tree decl; + + if (call && (decl = get_callee_fndecl (call))) + { + cgraph_create_edge (node, cgraph_node (decl), stmt, + bb->count, + bb->loop_depth); + walk_tree (&TREE_OPERAND (call, 1), + record_reference, node, visited_nodes); + if (TREE_CODE (stmt) == MODIFY_EXPR) + walk_tree (&TREE_OPERAND (stmt, 0), + record_reference, node, visited_nodes); + } + else + walk_tree (bsi_stmt_ptr (bsi), record_reference, node, visited_nodes); + } + + /* Look for initializers of constant variables and private statics. */ + for (step = DECL_STRUCT_FUNCTION (body)->unexpanded_var_list; + step; + step = TREE_CHAIN (step)) + { + tree decl = TREE_VALUE (step); + if (TREE_CODE (decl) == VAR_DECL + && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) + && flag_unit_at_a_time) + cgraph_varpool_finalize_decl (decl); + else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl)) + walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes); + } + + pointer_set_destroy (visited_nodes); visited_nodes = NULL; } -/* Analyze the function scheduled to be output. */ +/* Give initial reasons why inlining would fail. Those gets + either NULLified or usually overwritten by more precise reason + later. */ static void +initialize_inline_failed (struct cgraph_node *node) +{ + struct cgraph_edge *e; + + for (e = node->callers; e; e = e->next_caller) + { + gcc_assert (!e->callee->global.inlined_to); + gcc_assert (e->inline_failed); + if (node->local.redefined_extern_inline) + e->inline_failed = N_("redefined extern inline functions are not " + "considered for inlining"); + else if (!node->local.inlinable) + e->inline_failed = N_("function not inlinable"); + else + e->inline_failed = N_("function not considered for inlining"); + } +} + +/* Rebuild call edges from current function after a passes not aware + of cgraph updating. */ +static unsigned int +rebuild_cgraph_edges (void) +{ + basic_block bb; + struct cgraph_node *node = cgraph_node (current_function_decl); + block_stmt_iterator bsi; + + cgraph_node_remove_callees (node); + + node->count = ENTRY_BLOCK_PTR->count; + + FOR_EACH_BB (bb) + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + tree call = get_call_expr_in (stmt); + tree decl; + + if (call && (decl = get_callee_fndecl (call))) + cgraph_create_edge (node, cgraph_node (decl), stmt, + bb->count, + bb->loop_depth); + } + initialize_inline_failed (node); + gcc_assert (!node->global.inlined_to); + return 0; +} + +struct tree_opt_pass pass_rebuild_cgraph_edges = +{ + NULL, /* name */ + NULL, /* gate */ + rebuild_cgraph_edges, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + PROP_cfg, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ + 0 /* letter */ +}; + +/* Verify cgraph nodes of given cgraph node. */ +void +verify_cgraph_node (struct cgraph_node *node) +{ + struct cgraph_edge *e; + struct cgraph_node *main_clone; + struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl); + basic_block this_block; + block_stmt_iterator bsi; + bool error_found = false; + + if (errorcount || sorrycount) + return; + + timevar_push (TV_CGRAPH_VERIFY); + for (e = node->callees; e; e = e->next_callee) + if (e->aux) + { + error ("aux field set for edge %s->%s", + cgraph_node_name (e->caller), cgraph_node_name (e->callee)); + error_found = true; + } + if (node->count < 0) + { + error ("Execution count is negative"); + error_found = true; + } + for (e = node->callers; e; e = e->next_caller) + { + if (e->count < 0) + { + error ("caller edge count is negative"); + error_found = true; + } + if (!e->inline_failed) + { + if (node->global.inlined_to + != (e->caller->global.inlined_to + ? e->caller->global.inlined_to : e->caller)) + { + error ("inlined_to pointer is wrong"); + error_found = true; + } + if (node->callers->next_caller) + { + error ("multiple inline callers"); + error_found = true; + } + } + else + if (node->global.inlined_to) + { + error ("inlined_to pointer set for noninline callers"); + error_found = true; + } + } + if (!node->callers && node->global.inlined_to) + { + error ("inlined_to pointer is set but no predecessors found"); + error_found = true; + } + if (node->global.inlined_to == node) + { + error ("inlined_to pointer refers to itself"); + error_found = true; + } + + for (main_clone = cgraph_node (node->decl); main_clone; + main_clone = main_clone->next_clone) + if (main_clone == node) + break; + if (!cgraph_node (node->decl)) + { + error ("node not found in cgraph_hash"); + error_found = true; + } + + if (node->analyzed + && DECL_SAVED_TREE (node->decl) && !TREE_ASM_WRITTEN (node->decl) + && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)) + { + if (this_cfun->cfg) + { + /* The nodes we're interested in are never shared, so walk + the tree ignoring duplicates. */ + visited_nodes = pointer_set_create (); + /* Reach the trees by walking over the CFG, and note the + enclosing basic-blocks in the call edges. */ + FOR_EACH_BB_FN (this_block, this_cfun) + for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi)) + { + tree stmt = bsi_stmt (bsi); + tree call = get_call_expr_in (stmt); + tree decl; + if (call && (decl = get_callee_fndecl (call))) + { + struct cgraph_edge *e = cgraph_edge (node, stmt); + if (e) + { + if (e->aux) + { + error ("shared call_stmt:"); + debug_generic_stmt (stmt); + error_found = true; + } + if (e->callee->decl != cgraph_node (decl)->decl + && e->inline_failed) + { + error ("edge points to wrong declaration:"); + debug_tree (e->callee->decl); + fprintf (stderr," Instead of:"); + debug_tree (decl); + } + e->aux = (void *)1; + } + else + { + error ("missing callgraph edge for call stmt:"); + debug_generic_stmt (stmt); + error_found = true; + } + } + } + pointer_set_destroy (visited_nodes); + visited_nodes = NULL; + } + else + /* No CFG available?! */ + gcc_unreachable (); + + for (e = node->callees; e; e = e->next_callee) + { + if (!e->aux) + { + error ("edge %s->%s has no corresponding call_stmt", + cgraph_node_name (e->caller), + cgraph_node_name (e->callee)); + debug_generic_stmt (e->call_stmt); + error_found = true; + } + e->aux = 0; + } + } + if (error_found) + { + dump_cgraph_node (stderr, node); + internal_error ("verify_cgraph_node failed"); + } + timevar_pop (TV_CGRAPH_VERIFY); +} + +/* Verify whole cgraph structure. */ +void +verify_cgraph (void) +{ + struct cgraph_node *node; + + if (sorrycount || errorcount) + return; + + for (node = cgraph_nodes; node; node = node->next) + verify_cgraph_node (node); +} + +/* Output one variable, if necessary. Return whether we output it. */ +static bool +cgraph_varpool_assemble_decl (struct cgraph_varpool_node *node) +{ + tree decl = node->decl; + + if (!TREE_ASM_WRITTEN (decl) + && !node->alias + && !DECL_EXTERNAL (decl) + && (TREE_CODE (decl) != VAR_DECL || !DECL_HAS_VALUE_EXPR_P (decl))) + { + assemble_variable (decl, 0, 1, 0); + return TREE_ASM_WRITTEN (decl); + } + + return false; +} + +/* Output all variables enqueued to be assembled. */ +bool +cgraph_varpool_assemble_pending_decls (void) +{ + bool changed = false; + + if (errorcount || sorrycount) + return false; + + /* EH might mark decls as needed during expansion. This should be safe since + we don't create references to new function, but it should not be used + elsewhere. */ + cgraph_varpool_analyze_pending_decls (); + + while (cgraph_varpool_nodes_queue) + { + struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue; + + cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->next_needed; + if (cgraph_varpool_assemble_decl (node)) + { + changed = true; + node->next_needed = cgraph_varpool_assembled_nodes_queue; + cgraph_varpool_assembled_nodes_queue = node; + node->finalized = 1; + } + else + node->next_needed = NULL; + } + /* cgraph_varpool_nodes_queue is now empty, clear the pointer to the last + element in the queue. */ + cgraph_varpool_last_needed_node = NULL; + return changed; +} +/* Output all variables enqueued to be assembled. */ +static void +cgraph_varpool_output_debug_info (void) +{ + timevar_push (TV_SYMOUT); + if (errorcount == 0 && sorrycount == 0) + while (cgraph_varpool_assembled_nodes_queue) + { + struct cgraph_varpool_node *node = cgraph_varpool_assembled_nodes_queue; + + /* Local static variables are never seen by check_global_declarations + so we need to output debug info by hand. */ + if (DECL_CONTEXT (node->decl) + && (TREE_CODE (DECL_CONTEXT (node->decl)) == BLOCK + || TREE_CODE (DECL_CONTEXT (node->decl)) == FUNCTION_DECL) + && errorcount == 0 && sorrycount == 0) + (*debug_hooks->global_decl) (node->decl); + cgraph_varpool_assembled_nodes_queue = node->next_needed; + node->next_needed = 0; + } + timevar_pop (TV_SYMOUT); +} + +/* Output all asm statements we have stored up to be output. */ + +static void +cgraph_output_pending_asms (void) +{ + struct cgraph_asm_node *can; + + if (errorcount || sorrycount) + return; + + for (can = cgraph_asm_nodes; can; can = can->next) + assemble_asm (can->asm_str); + cgraph_asm_nodes = NULL; +} + +/* Analyze the function scheduled to be output. */ +void cgraph_analyze_function (struct cgraph_node *node) { tree decl = node->decl; - struct cgraph_edge *e; current_function_decl = decl; + push_cfun (DECL_STRUCT_FUNCTION (decl)); + cgraph_lower_function (node); /* First kill forward declaration so reverse inlining works properly. */ - cgraph_create_edges (decl, DECL_SAVED_TREE (decl)); + cgraph_create_edges (node, decl); node->local.inlinable = tree_inlinable_function_p (decl); - if (!node->local.self_insns) - node->local.self_insns - = (*lang_hooks.tree_inlining.estimate_num_insns) (decl); + if (!flag_unit_at_a_time) + node->local.self_insns = estimate_num_insns (decl); if (node->local.inlinable) node->local.disregard_inline_limits - = (*lang_hooks.tree_inlining.disregard_inline_limits) (decl); - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - { - if (node->local.redefined_extern_inline) - e->inline_failed = N_("redefined extern inline functions are not " - "considered for inlining"); - else if (!node->local.inlinable) - e->inline_failed = N_("function not inlinable"); - else - e->inline_failed = N_("function not considered for inlining"); - } + = lang_hooks.tree_inlining.disregard_inline_limits (decl); + initialize_inline_failed (node); if (flag_really_no_inline && !node->local.disregard_inline_limits) node->local.inlinable = 0; /* Inlining characteristics are maintained by the cgraph_mark_inline. */ node->global.insns = node->local.self_insns; - if (!DECL_EXTERNAL (decl)) - { - node->global.cloned_times = 1; - node->global.will_be_output = true; - } node->analyzed = true; + pop_cfun (); current_function_decl = NULL; +} - /* Possibly warn about unused parameters. */ - if (warn_unused_parameter) - do_warn_unused_parameter (decl); +/* Look for externally_visible and used attributes and mark cgraph nodes + accordingly. + + We cannot mark the nodes at the point the attributes are processed (in + handle_*_attribute) because the copy of the declarations available at that + point may not be canonical. For example, in: + + void f(); + void f() __attribute__((used)); + + the declaration we see in handle_used_attribute will be the second + declaration -- but the front end will subsequently merge that declaration + with the original declaration and discard the second declaration. + + Furthermore, we can't mark these nodes in cgraph_finalize_function because: + + void f() {} + void f() __attribute__((externally_visible)); + + is valid. + + So, we walk the nodes at the end of the translation unit, applying the + attributes at that point. */ + +static void +process_function_and_variable_attributes (struct cgraph_node *first, + struct cgraph_varpool_node *first_var) +{ + struct cgraph_node *node; + struct cgraph_varpool_node *vnode; + + for (node = cgraph_nodes; node != first; node = node->next) + { + tree decl = node->decl; + if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + { + mark_decl_referenced (decl); + if (node->local.finalized) + cgraph_mark_needed_node (node); + } + if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl))) + { + if (! TREE_PUBLIC (node->decl)) + warning (OPT_Wattributes, + "%J% attribute have effect only on public objects", + node->decl); + else + { + if (node->local.finalized) + cgraph_mark_needed_node (node); + node->local.externally_visible = true; + } + } + } + for (vnode = cgraph_varpool_nodes; vnode != first_var; vnode = vnode->next) + { + tree decl = vnode->decl; + if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + { + mark_decl_referenced (decl); + if (vnode->finalized) + cgraph_varpool_mark_needed_node (vnode); + } + if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl))) + { + if (! TREE_PUBLIC (vnode->decl)) + warning (OPT_Wattributes, + "%J% attribute have effect only on public objects", + vnode->decl); + else + { + if (vnode->finalized) + cgraph_varpool_mark_needed_node (vnode); + vnode->externally_visible = true; + } + } + } } /* Analyze the whole compilation unit once it is parsed completely. */ @@ -368,23 +1054,42 @@ cgraph_analyze_function (struct cgraph_node *node) void cgraph_finalize_compilation_unit (void) { - struct cgraph_node *node; + struct cgraph_node *node, *next; + /* Keep track of already processed nodes when called multiple times for + intermodule optimization. */ + static struct cgraph_node *first_analyzed; + struct cgraph_node *first_processed = first_analyzed; + static struct cgraph_varpool_node *first_analyzed_var; + + if (errorcount || sorrycount) + return; + + finish_aliases_1 (); if (!flag_unit_at_a_time) { + cgraph_output_pending_asms (); cgraph_assemble_pending_functions (); + cgraph_varpool_output_debug_info (); return; } - cgraph_varpool_assemble_pending_decls (); if (!quiet_flag) - fprintf (stderr, "\nAnalyzing compilation unit\n"); + { + fprintf (stderr, "\nAnalyzing compilation unit"); + fflush (stderr); + } timevar_push (TV_CGRAPH); + process_function_and_variable_attributes (first_processed, + first_analyzed_var); + first_processed = cgraph_nodes; + first_analyzed_var = cgraph_varpool_nodes; + cgraph_varpool_analyze_pending_decls (); if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Initial entry points:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = node->next) if (node->needed && DECL_SAVED_TREE (node->decl)) fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); fprintf (cgraph_dump_file, "\n"); @@ -401,15 +1106,19 @@ cgraph_finalize_compilation_unit (void) node = cgraph_nodes_queue; cgraph_nodes_queue = cgraph_nodes_queue->next_needed; + node->next_needed = NULL; /* ??? It is possible to create extern inline function and later using - weak alas attribute to kill it's body. See + weak alias attribute to kill its body. See gcc.c-torture/compile/20011119-1.c */ if (!DECL_SAVED_TREE (decl)) - continue; + { + cgraph_reset_node (node); + continue; + } - if (node->analyzed || !node->reachable || !DECL_SAVED_TREE (decl)) - abort (); + gcc_assert (!node->analyzed && node->reachable); + gcc_assert (DECL_SAVED_TREE (decl)); cgraph_analyze_function (node); @@ -417,15 +1126,20 @@ cgraph_finalize_compilation_unit (void) if (!edge->callee->reachable) cgraph_mark_reachable_node (edge->callee); - cgraph_varpool_assemble_pending_decls (); + /* We finalize local static variables during constructing callgraph + edges. Process their attributes too. */ + process_function_and_variable_attributes (first_processed, + first_analyzed_var); + first_processed = cgraph_nodes; + first_analyzed_var = cgraph_varpool_nodes; + cgraph_varpool_analyze_pending_decls (); } /* Collect entry points to the unit. */ - if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Unit entry points:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = node->next) if (node->needed && DECL_SAVED_TREE (node->decl)) fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); fprintf (cgraph_dump_file, "\n\nInitial "); @@ -435,28 +1149,35 @@ cgraph_finalize_compilation_unit (void) if (cgraph_dump_file) fprintf (cgraph_dump_file, "\nReclaiming functions:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = next) { tree decl = node->decl; + next = node->next; + + if (node->local.finalized && !DECL_SAVED_TREE (decl)) + cgraph_reset_node (node); if (!node->reachable && DECL_SAVED_TREE (decl)) { - cgraph_remove_node (node); if (cgraph_dump_file) fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); + cgraph_remove_node (node); + continue; } else node->next_needed = NULL; + gcc_assert (!node->local.finalized || DECL_SAVED_TREE (decl)); + gcc_assert (node->analyzed == node->local.finalized); } if (cgraph_dump_file) { fprintf (cgraph_dump_file, "\n\nReclaimed "); dump_cgraph (cgraph_dump_file); } + first_analyzed = cgraph_nodes; ggc_collect (); timevar_pop (TV_CGRAPH); } - /* Figure out what functions we want to assemble. */ static void @@ -469,8 +1190,7 @@ cgraph_mark_functions_to_output (void) tree decl = node->decl; struct cgraph_edge *e; - if (node->output) - abort (); + gcc_assert (!node->output); for (e = node->callers; e; e = e->next_caller) if (e->inline_failed) @@ -480,47 +1200,31 @@ cgraph_mark_functions_to_output (void) always inlined, as well as those that are reachable from outside the current compilation unit. */ if (DECL_SAVED_TREE (decl) + && !node->global.inlined_to && (node->needed || (e && node->reachable)) - && !TREE_ASM_WRITTEN (decl) && !node->origin + && !TREE_ASM_WRITTEN (decl) && !DECL_EXTERNAL (decl)) node->output = 1; else - DECL_SAVED_INSNS (decl) = NULL; + { + /* We should've reclaimed all functions that are not needed. */ +#ifdef ENABLE_CHECKING + if (!node->global.inlined_to && DECL_SAVED_TREE (decl) + && !DECL_EXTERNAL (decl)) + { + dump_cgraph_node (stderr, node); + internal_error ("failed to reclaim unneeded function"); + } +#endif + gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl) + || DECL_EXTERNAL (decl)); + + } + } } -/* Optimize the function before expansion. */ - -static void -cgraph_optimize_function (struct cgraph_node *node) -{ - tree decl = node->decl; - - timevar_push (TV_INTEGRATION); - /* optimize_inline_calls avoids inlining of current_function_decl. */ - current_function_decl = decl; - if (flag_inline_trees) - { - struct cgraph_edge *e; - - for (e = node->callees; e; e = e->next_callee) - if (!e->inline_failed || warn_inline - || (DECL_DECLARED_INLINE_P (e->callee->decl) - && lookup_attribute ("always_inline", - DECL_ATTRIBUTES (e->callee->decl)))) - break; - if (e) - optimize_inline_calls (decl); - } - if (node->nested) - { - for (node = node->nested; node; node = node->next_nested) - cgraph_optimize_function (node); - } - timevar_pop (TV_INTEGRATION); -} - /* Expand function specified by NODE. */ static void @@ -528,992 +1232,52 @@ cgraph_expand_function (struct cgraph_node *node) { tree decl = node->decl; + /* We ought to not compile any inline clones. */ + gcc_assert (!node->global.inlined_to); + if (flag_unit_at_a_time) announce_function (decl); - cgraph_optimize_function (node); + cgraph_lower_function (node); - /* Generate RTL for the body of DECL. Nested functions are expanded - via lang_expand_decl_stmt. */ - (*lang_hooks.callgraph.expand_function) (decl); - if (DECL_DEFER_OUTPUT (decl)) - abort (); + /* Generate RTL for the body of DECL. */ + lang_hooks.callgraph.expand_function (decl); + + /* Make sure that BE didn't give up on compiling. */ + /* ??? Can happen with nested function of extern inline. */ + gcc_assert (TREE_ASM_WRITTEN (node->decl)); current_function_decl = NULL; + if (!cgraph_preserve_function_body_p (node->decl)) + { + DECL_SAVED_TREE (node->decl) = NULL; + DECL_STRUCT_FUNCTION (node->decl) = NULL; + DECL_INITIAL (node->decl) = error_mark_node; + /* Eliminate all call edges. This is important so the call_expr no longer + points to the dead function body. */ + cgraph_node_remove_callees (node); + } + + cgraph_function_flags_ready = true; } -/* Fill array order with all nodes with output flag set in the reverse - topological order. */ - -static int -cgraph_postorder (struct cgraph_node **order) -{ - struct cgraph_node *node, *node2; - int stack_size = 0; - int order_pos = 0; - struct cgraph_edge *edge, last; - - struct cgraph_node **stack = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - - /* We have to deal with cycles nicely, so use a depth first traversal - output algorithm. Ignore the fact that some functions won't need - to be output and put them into order as well, so we get dependencies - right through intline functions. */ - for (node = cgraph_nodes; node; node = node->next) - node->aux = NULL; - for (node = cgraph_nodes; node; node = node->next) - if (!node->aux) - { - node2 = node; - if (!node->callers) - node->aux = &last; - else - node->aux = node->callers; - while (node2) - { - while (node2->aux != &last) - { - edge = node2->aux; - if (edge->next_caller) - node2->aux = edge->next_caller; - else - node2->aux = &last; - if (!edge->caller->aux) - { - if (!edge->caller->callers) - edge->caller->aux = &last; - else - edge->caller->aux = edge->caller->callers; - stack[stack_size++] = node2; - node2 = edge->caller; - break; - } - } - if (node2->aux == &last) - { - order[order_pos++] = node2; - if (stack_size) - node2 = stack[--stack_size]; - else - node2 = NULL; - } - } - } - free (stack); - return order_pos; -} - -#define INLINED_TIMES(node) ((size_t)(node)->aux) -#define SET_INLINED_TIMES(node,times) ((node)->aux = (void *)(times)) - -/* Return list of nodes we decided to inline NODE into, set their output - flag and compute INLINED_TIMES. - - We do simple backtracing to get INLINED_TIMES right. This should not be - expensive as we limit the amount of inlining. Alternatively we may first - discover set of nodes, topologically sort these and propagate - INLINED_TIMES */ - -static int -cgraph_inlined_into (struct cgraph_node *node, struct cgraph_node **array) -{ - int nfound = 0; - struct cgraph_edge **stack; - struct cgraph_edge *e, *e1; - int sp; - int i; - - /* Fast path: since we traverse in mostly topological order, we will likely - find no edges. */ - for (e = node->callers; e; e = e->next_caller) - if (!e->inline_failed) - break; - - if (!e) - return 0; - - /* Allocate stack for back-tracking up callgraph. */ - stack = xmalloc ((cgraph_n_nodes + 1) * sizeof (struct cgraph_edge)); - sp = 0; - - /* Push the first edge on to the stack. */ - stack[sp++] = e; - - while (sp) - { - struct cgraph_node *caller; - - /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - caller = e->caller; - - /* Check if the caller destination has been visited yet. */ - if (!caller->output) - { - array[nfound++] = e->caller; - /* Mark that we have visited the destination. */ - caller->output = true; - SET_INLINED_TIMES (caller, 0); - } - SET_INLINED_TIMES (caller, INLINED_TIMES (caller) + 1); - - for (e1 = caller->callers; e1; e1 = e1->next_caller) - if (!e1->inline_failed) - break; - - if (e1) - stack[sp++] = e1; - else - { - while (true) - { - for (e1 = e->next_caller; e1; e1 = e1->next_caller) - if (!e1->inline_failed) - break; - - if (e1) - { - stack[sp - 1] = e1; - break; - } - else - { - sp--; - if (!sp) - break; - e = stack[sp - 1]; - } - } - } - } - - free (stack); - - - if (cgraph_dump_file) - { - fprintf (cgraph_dump_file, " Found inline predecesors of %s:", - cgraph_node_name (node)); - for (i = 0; i < nfound; i++) - { - fprintf (cgraph_dump_file, " %s", cgraph_node_name (array[i])); - if (INLINED_TIMES (array[i]) != 1) - fprintf (cgraph_dump_file, " (%i times)", - (int)INLINED_TIMES (array[i])); - } - fprintf (cgraph_dump_file, "\n"); - } - - return nfound; -} - -/* Return list of nodes we decided to inline into NODE, set their output - flag and compute INLINED_TIMES. - - This function is identical to cgraph_inlined_into with callers and callees - nodes swapped. */ - -static int -cgraph_inlined_callees (struct cgraph_node *node, struct cgraph_node **array) -{ - int nfound = 0; - struct cgraph_edge **stack; - struct cgraph_edge *e, *e1; - int sp; - int i; - - /* Fast path: since we traverse in mostly topological order, we will likely - find no edges. */ - for (e = node->callees; e; e = e->next_callee) - if (!e->inline_failed) - break; - - if (!e) - return 0; - - /* Allocate stack for back-tracking up callgraph. */ - stack = xmalloc ((cgraph_n_nodes + 1) * sizeof (struct cgraph_edge)); - sp = 0; - - /* Push the first edge on to the stack. */ - stack[sp++] = e; - - while (sp) - { - struct cgraph_node *callee; - - /* Look at the edge on the top of the stack. */ - e = stack[sp - 1]; - callee = e->callee; - - /* Check if the callee destination has been visited yet. */ - if (!callee->output) - { - array[nfound++] = e->callee; - /* Mark that we have visited the destination. */ - callee->output = true; - SET_INLINED_TIMES (callee, 0); - } - SET_INLINED_TIMES (callee, INLINED_TIMES (callee) + 1); - - for (e1 = callee->callees; e1; e1 = e1->next_callee) - if (!e1->inline_failed) - break; - if (e1) - stack[sp++] = e1; - else - { - while (true) - { - for (e1 = e->next_callee; e1; e1 = e1->next_callee) - if (!e1->inline_failed) - break; - - if (e1) - { - stack[sp - 1] = e1; - break; - } - else - { - sp--; - if (!sp) - break; - e = stack[sp - 1]; - } - } - } - } - - free (stack); - - if (cgraph_dump_file) - { - fprintf (cgraph_dump_file, " Found inline successors of %s:", - cgraph_node_name (node)); - for (i = 0; i < nfound; i++) - { - fprintf (cgraph_dump_file, " %s", cgraph_node_name (array[i])); - if (INLINED_TIMES (array[i]) != 1) - fprintf (cgraph_dump_file, " (%i times)", - (int)INLINED_TIMES (array[i])); - } - fprintf (cgraph_dump_file, "\n"); - } - - return nfound; -} - -/* Perform reachability analysis and reclaim all unreachable nodes. - This function also remove unneeded bodies of extern inline functions - and thus needs to be done only after inlining decisions has been made. */ -static bool -cgraph_remove_unreachable_nodes (void) -{ - struct cgraph_node *first = (void *) 1; - struct cgraph_node *node; - bool changed = false; - int insns = 0; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nReclaiming functions:"); -#ifdef ENABLE_CHECKING - for (node = cgraph_nodes; node; node = node->next) - if (node->aux) - abort (); -#endif - for (node = cgraph_nodes; node; node = node->next) - if (node->needed && (!DECL_EXTERNAL (node->decl) || !node->analyzed)) - { - node->aux = first; - first = node; - } - else if (node->aux) - abort (); - - /* Perform reachability analysis. As a special case do not consider - extern inline functions not inlined as live because we won't output - them at all. */ - while (first != (void *) 1) - { - struct cgraph_edge *e; - node = first; - first = first->aux; - - for (e = node->callees; e; e = e->next_callee) - if (!e->callee->aux - && node->analyzed - && (!e->inline_failed || !e->callee->analyzed - || !DECL_EXTERNAL (e->callee->decl))) - { - e->callee->aux = first; - first = e->callee; - } - } - - /* Remove unreachable nodes. Extern inline functions need special care; - Unreachable extern inline functions shall be removed. - Reachable extern inline functions we never inlined shall get their bodies - elliminated - Reachable extern inline functions we sometimes inlined will be turned into - unanalyzed nodes so they look like for true extern functions to the rest - of code. */ - for (node = cgraph_nodes; node; node = node->next) - { - if (!node->aux) - { - int local_insns; - tree decl = node->decl; - - if (DECL_SAVED_INSNS (decl)) - local_insns = node->local.self_insns; - else - local_insns = 0; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); - if (!node->analyzed || !DECL_EXTERNAL (node->decl)) - cgraph_remove_node (node); - else - { - struct cgraph_edge *e; - - for (e = node->callers; e; e = e->next_caller) - if (e->caller->aux) - break; - if (e || node->needed) - { - DECL_SAVED_TREE (node->decl) = NULL_TREE; - while (node->callees) - cgraph_remove_edge (node, node->callees->callee); - node->analyzed = false; - } - else - cgraph_remove_node (node); - } - if (!DECL_SAVED_TREE (decl)) - insns += local_insns; - changed = true; - } - } - for (node = cgraph_nodes; node; node = node->next) - node->aux = NULL; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nReclaimed %i insns", insns); - return changed; -} - - -/* Estimate size of the function after inlining WHAT into TO. */ - -static int -cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to, - struct cgraph_node *what) -{ - return (what->global.insns - INSNS_PER_CALL) * times + to->global.insns; -} - -/* Estimate the growth caused by inlining NODE into all callees. */ - -static int -cgraph_estimate_growth (struct cgraph_node *node) -{ - int growth = 0; - int calls_saved = 0; - int clones_added = 0; - struct cgraph_edge *e; - - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - { - growth += ((cgraph_estimate_size_after_inlining (1, e->caller, node) - - - e->caller->global.insns) *e->caller->global.cloned_times); - calls_saved += e->caller->global.cloned_times; - clones_added += e->caller->global.cloned_times; - } - - /* ??? Wrong for self recursive functions or cases where we decide to not - inline for different reasons, but it is not big deal as in that case - we will keep the body around, but we will also avoid some inlining. */ - if (!node->needed && !node->origin && !DECL_EXTERNAL (node->decl)) - growth -= node->global.insns, clones_added--; - - if (!calls_saved) - calls_saved = 1; - - return growth; -} - -/* Update insn sizes after inlining WHAT into TO that is already inlined into - all nodes in INLINED array. */ - -static void -cgraph_mark_inline (struct cgraph_node *to, struct cgraph_node *what, - struct cgraph_node **inlined, int ninlined, - struct cgraph_node **inlined_callees, - int ninlined_callees) -{ - int i; - int times = 0; - int clones = 0; - struct cgraph_edge *e; - bool called = false; - int new_insns; - - what->global.inlined = 1; - for (e = what->callers; e; e = e->next_caller) - { - if (e->caller == to) - { - if (!e->inline_failed) - continue; - e->inline_failed = NULL; - times++; - clones += e->caller->global.cloned_times; - } - else if (e->inline_failed) - called = true; - } - if (!times) - abort (); - ncalls_inlined += times; - - new_insns = cgraph_estimate_size_after_inlining (times, to, what); - if (to->global.will_be_output) - overall_insns += new_insns - to->global.insns; - to->global.insns = new_insns; - - if (!called && !what->needed && !what->origin - && flag_unit_at_a_time - && !DECL_EXTERNAL (what->decl)) - { - if (!what->global.will_be_output) - abort (); - clones--; - nfunctions_inlined++; - what->global.will_be_output = 0; - overall_insns -= what->global.insns; - } - what->global.cloned_times += clones; - for (i = 0; i < ninlined; i++) - { - new_insns = - cgraph_estimate_size_after_inlining (INLINED_TIMES (inlined[i]) * - times, inlined[i], what); - if (inlined[i]->global.will_be_output) - overall_insns += new_insns - inlined[i]->global.insns; - inlined[i]->global.insns = new_insns; - } - for (i = 0; i < ninlined_callees; i++) - { - inlined_callees[i]->global.cloned_times += - INLINED_TIMES (inlined_callees[i]) * clones; - } -} - -/* Return false when inlining WHAT into TO is not good idea as it would cause - too large growth of function bodies. */ - -static bool -cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what, - struct cgraph_node **inlined, int ninlined, - const char **reason) -{ - int i; - int times = 0; - struct cgraph_edge *e; - int newsize; - int limit; - - for (e = to->callees; e; e = e->next_callee) - if (e->callee == what) - times++; - - /* When inlining large function body called once into small function, - take the inlined function as base for limiting the growth. */ - if (to->local.self_insns > what->local.self_insns) - limit = to->local.self_insns; - else - limit = what->local.self_insns; - - limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100; - - newsize = cgraph_estimate_size_after_inlining (times, to, what); - if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS) - && newsize > limit) - { - *reason = N_("--param large-function-growth limit reached"); - return false; - } - for (i = 0; i < ninlined; i++) - { - newsize = - cgraph_estimate_size_after_inlining (INLINED_TIMES (inlined[i]) * - times, inlined[i], what); - if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS) - && newsize > - inlined[i]->local.self_insns * - (100 + PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH)) / 100) - { - *reason = N_("--param large-function-growth limit reached while inlining the caller"); - return false; - } - } - return true; -} - -/* Return true when function N is small enough to be inlined. */ - -static bool -cgraph_default_inline_p (struct cgraph_node *n) -{ - if (!DECL_INLINE (n->decl) || !DECL_SAVED_TREE (n->decl)) - return false; - if (DECL_DECLARED_INLINE_P (n->decl)) - return n->global.insns < MAX_INLINE_INSNS_SINGLE; - else - return n->global.insns < MAX_INLINE_INSNS_AUTO; -} - -/* Set inline_failed for all callers of given function to REASON. */ - -static void -cgraph_set_inline_failed (struct cgraph_node *node, const char *reason) -{ - struct cgraph_edge *e; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "Inlining failed: %s\n", reason); - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - e->inline_failed = reason; -} - -/* We use greedy algorithm for inlining of small functions: - All inline candidates are put into prioritized heap based on estimated - growth of the overall number of instructions and then update the estimates. - - INLINED and INLINED_CALEES are just pointers to arrays large enough - to be passed to cgraph_inlined_into and cgraph_inlined_callees. */ - -static void -cgraph_decide_inlining_of_small_functions (struct cgraph_node **inlined, - struct cgraph_node **inlined_callees) -{ - int i; - struct cgraph_node *node; - fibheap_t heap = fibheap_new (); - struct fibnode **heap_node = - xcalloc (cgraph_max_uid, sizeof (struct fibnode *)); - int ninlined, ninlined_callees; - int max_insns = ((HOST_WIDEST_INT) initial_insns - * (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100); - - /* Put all inline candidates into the heap. */ - - for (node = cgraph_nodes; node; node = node->next) - { - if (!node->local.inlinable || !node->callers - || node->local.disregard_inline_limits) - continue; - - if (!cgraph_default_inline_p (node)) - { - cgraph_set_inline_failed (node, - N_("--param max-inline-insns-single limit reached")); - continue; - } - heap_node[node->uid] = - fibheap_insert (heap, cgraph_estimate_growth (node), node); - } - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nDeciding on smaller functions:\n"); - while (overall_insns <= max_insns && (node = fibheap_extract_min (heap))) - { - struct cgraph_edge *e; - int old_insns = overall_insns; - - heap_node[node->uid] = NULL; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s with %i insns\n" - " Estimated growth is %+i insns.\n", - cgraph_node_name (node), node->global.insns, - cgraph_estimate_growth (node)); - if (!cgraph_default_inline_p (node)) - { - cgraph_set_inline_failed (node, - N_("--param max-inline-insns-single limit reached after inlining into the callee")); - continue; - } - ninlined_callees = cgraph_inlined_callees (node, inlined_callees); - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - { - /* Marking recursive function inlinine has sane semantic and - thus we should not warn on it. */ - if (e->caller == node) - { - e->inline_failed = ""; - continue; - } - ninlined = cgraph_inlined_into (e->caller, inlined); - if (e->callee->output) - e->inline_failed = ""; - if (e->callee->output - || !cgraph_check_inline_limits (e->caller, node, inlined, - ninlined, &e->inline_failed)) - { - for (i = 0; i < ninlined; i++) - inlined[i]->output = 0, inlined[i]->aux = 0; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, " Not inlining into %s.\n", - cgraph_node_name (e->caller)); - continue; - } - cgraph_mark_inline (e->caller, node, inlined, ninlined, - inlined_callees, ninlined_callees); - if (heap_node[e->caller->uid]) - fibheap_replace_key (heap, heap_node[e->caller->uid], - cgraph_estimate_growth (e->caller)); - - /* Size of the functions we updated into has changed, so update - the keys. */ - for (i = 0; i < ninlined; i++) - { - inlined[i]->output = 0, inlined[i]->aux = 0; - if (heap_node[inlined[i]->uid]) - fibheap_replace_key (heap, heap_node[inlined[i]->uid], - cgraph_estimate_growth (inlined[i])); - } - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns.\n", - cgraph_node_name (e->caller), - e->caller->global.insns); - } - - /* Similarly all functions called by the function we just inlined - are now called more times; update keys. */ - - for (e = node->callees; e; e = e->next_callee) - if (e->inline_failed && heap_node[e->callee->uid]) - fibheap_replace_key (heap, heap_node[e->callee->uid], - cgraph_estimate_growth (e->callee)); - - for (i = 0; i < ninlined_callees; i++) - { - struct cgraph_edge *e; - - for (e = inlined_callees[i]->callees; e; e = e->next_callee) - if (e->inline_failed && heap_node[e->callee->uid]) - fibheap_replace_key (heap, heap_node[e->callee->uid], - cgraph_estimate_growth (e->callee)); - - inlined_callees[i]->output = 0; - inlined_callees[i]->aux = 0; - } - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined %i times for a net change of %+i insns.\n", - node->global.cloned_times, overall_insns - old_insns); - } - while ((node = fibheap_extract_min (heap)) != NULL) - if (!node->local.disregard_inline_limits) - cgraph_set_inline_failed (node, N_("--param inline-unit-growth limit reached")); - fibheap_delete (heap); - free (heap_node); -} - -/* Decide on the inlining. We do so in the topological order to avoid - expenses on updating datastructures. */ - -static void -cgraph_decide_inlining (void) -{ - struct cgraph_node *node; - int nnodes; - struct cgraph_node **order = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - struct cgraph_node **inlined = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - struct cgraph_node **inlined_callees = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - int ninlined; - int ninlined_callees; - int old_insns = 0; - int i, y; - - for (node = cgraph_nodes; node; node = node->next) - initial_insns += node->local.self_insns; - overall_insns = initial_insns; - - nnodes = cgraph_postorder (order); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nDeciding on inlining. Starting with %i insns.\n", - initial_insns); - - for (node = cgraph_nodes; node; node = node->next) - node->aux = 0; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nInlining always_inline functions:\n"); -#ifdef ENABLE_CHECKING - for (node = cgraph_nodes; node; node = node->next) - if (node->aux || node->output) - abort (); -#endif - - /* In the first pass mark all always_inline edges. Do this with a priority - so none of our later choices will make this impossible. */ - for (i = nnodes - 1; i >= 0; i--) - { - struct cgraph_edge *e; - - node = order[i]; - - for (e = node->callees; e; e = e->next_callee) - if (e->callee->local.disregard_inline_limits) - break; - if (!e) - continue; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s %i insns (always inline)\n", - cgraph_node_name (e->callee), e->callee->global.insns); - ninlined = cgraph_inlined_into (order[i], inlined); - for (; e; e = e->next_callee) - { - old_insns = overall_insns; - if (!e->inline_failed || !e->callee->local.inlinable - || !e->callee->local.disregard_inline_limits) - continue; - if (e->callee->output || e->callee == node) - { - e->inline_failed = N_("recursive inlining"); - continue; - } - ninlined_callees = - cgraph_inlined_callees (e->callee, inlined_callees); - cgraph_mark_inline (node, e->callee, inlined, ninlined, - inlined_callees, ninlined_callees); - for (y = 0; y < ninlined_callees; y++) - inlined_callees[y]->output = 0, inlined_callees[y]->aux = 0; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns.\n", - cgraph_node_name (node->callees->caller), - node->callees->caller->global.insns); - } - if (cgraph_dump_file && node->global.cloned_times > 0) - fprintf (cgraph_dump_file, - " Inlined %i times for a net change of %+i insns.\n", - node->global.cloned_times, overall_insns - old_insns); - for (y = 0; y < ninlined; y++) - inlined[y]->output = 0, inlined[y]->aux = 0; - } -#ifdef ENABLE_CHECKING - for (node = cgraph_nodes; node; node = node->next) - if (node->aux || node->output) - abort (); -#endif - - if (!flag_really_no_inline) - { - cgraph_decide_inlining_of_small_functions (inlined, inlined_callees); -#ifdef ENABLE_CHECKING - for (node = cgraph_nodes; node; node = node->next) - if (node->aux || node->output) - abort (); -#endif - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n"); - - /* And finally decide what functions are called once. */ - - for (i = nnodes - 1; i >= 0; i--) - { - node = order[i]; - - if (node->callers && !node->callers->next_caller && !node->needed - && node->local.inlinable && node->callers->inline_failed - && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl)) - { - bool ok = true; - struct cgraph_node *node1; - - /* Verify that we won't duplicate the caller. */ - for (node1 = node->callers->caller; - node1->callers && !node1->callers->inline_failed - && ok; node1 = node1->callers->caller) - if (node1->callers->next_caller || node1->needed) - ok = false; - if (ok) - { - const char *dummy_reason; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s %i insns.\n" - " Called once from %s %i insns.\n", - cgraph_node_name (node), node->global.insns, - cgraph_node_name (node->callers->caller), - node->callers->caller->global.insns); - ninlined = cgraph_inlined_into (node->callers->caller, - inlined); - old_insns = overall_insns; - - /* Inlining functions once would never cause inlining warnings. */ - if (cgraph_check_inline_limits - (node->callers->caller, node, inlined, ninlined, - &dummy_reason)) - { - ninlined_callees = - cgraph_inlined_callees (node, inlined_callees); - cgraph_mark_inline (node->callers->caller, node, inlined, - ninlined, inlined_callees, - ninlined_callees); - for (y = 0; y < ninlined_callees; y++) - inlined_callees[y]->output = 0, inlined_callees[y]->aux = 0; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns" - " for a net change of %+i insns.\n", - cgraph_node_name (node->callers->caller), - node->callers->caller->global.insns, - overall_insns - old_insns); - } - else - { - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inline limit reached, not inlined.\n"); - } - for (y = 0; y < ninlined; y++) - inlined[y]->output = 0, inlined[y]->aux = 0; - } - } - } - } - cgraph_remove_unreachable_nodes (); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nInlined %i calls, eliminated %i functions, " - "%i insns turned to %i insns.\n\n", - ncalls_inlined, nfunctions_inlined, initial_insns, - overall_insns); - free (order); - free (inlined); - free (inlined_callees); -} - -/* Decide on the inlining. We do so in the topological order to avoid - expenses on updating datastructures. */ - -static void -cgraph_decide_inlining_incrementally (struct cgraph_node *node) -{ - struct cgraph_edge *e; - struct cgraph_node **inlined = - xmalloc (sizeof (struct cgraph_node *) * cgraph_n_nodes); - struct cgraph_node **inlined_callees = - xmalloc (sizeof (struct cgraph_node *) * cgraph_n_nodes); - int ninlined; - int ninlined_callees; - int y; - - ninlined = cgraph_inlined_into (node, inlined); - - /* First of all look for always inline functions. */ - for (e = node->callees; e; e = e->next_callee) - if (e->callee->local.disregard_inline_limits && e->inline_failed - /* ??? It is possible that renaming variable removed the function body - in duplicate_decls. See gcc.c-torture/compile/20011119-2.c */ - && DECL_SAVED_TREE (e->callee->decl)) - { - if (e->callee->output || e->callee == node) - { - e->inline_failed = N_("recursive inlining"); - continue; - } - ninlined_callees = cgraph_inlined_callees (e->callee, inlined_callees); - cgraph_mark_inline (node, e->callee, inlined, ninlined, - inlined_callees, ninlined_callees); - for (y = 0; y < ninlined_callees; y++) - inlined_callees[y]->output = 0, inlined_callees[y]->aux = 0; - } - - if (!flag_really_no_inline) - { - /* Now do the automatic inlining. */ - for (e = node->callees; e; e = e->next_callee) - if (e->callee->local.inlinable && e->inline_failed - && cgraph_default_inline_p (e->callee) - && cgraph_check_inline_limits (node, e->callee, inlined, - ninlined, &e->inline_failed) - && DECL_SAVED_TREE (e->callee->decl)) - { - /* Marking recursive function inlinine has sane semantic and thus - we should not warn on it. */ - if (e->callee->output || e->callee == node) - { - e->inline_failed = ""; - continue; - } - ninlined_callees = cgraph_inlined_callees (e->callee, - inlined_callees); - cgraph_mark_inline (node, e->callee, inlined, ninlined, - inlined_callees, ninlined_callees); - for (y = 0; y < ninlined_callees; y++) - inlined_callees[y]->output = 0, inlined_callees[y]->aux = 0; - } - } - - /* Clear the flags set by cgraph_inlined_into. */ - for (y = 0; y < ninlined; y++) - inlined[y]->output = 0, inlined[y]->aux = 0; - - free (inlined); - free (inlined_callees); -} - - -/* Return true when CALLER_DECL should be inlined into CALLEE_DECL. - When returned false and reason is non-NULL, set it to the reason - why the call was not inlined. */ +/* Return true when CALLER_DECL should be inlined into CALLEE_DECL. */ bool -cgraph_inline_p (tree caller_decl, tree callee_decl, const char **reason) +cgraph_inline_p (struct cgraph_edge *e, const char **reason) { - struct cgraph_node *caller = cgraph_node (caller_decl); - struct cgraph_node *callee = cgraph_node (callee_decl); - struct cgraph_edge *e; - - for (e = caller->callees; e; e = e->next_callee) - if (e->callee == callee) - { - if (e->inline_failed && reason) - *reason = e->inline_failed; - return !e->inline_failed; - } - /* We do not record builtins in the callgraph. Perhaps it would make more - sense to do so and then prune out those not overwritten by explicit - function body. */ - if (reason) - *reason = "originally indirect function calls never inlined"; - return false; + *reason = e->inline_failed; + return !e->inline_failed; } + + + /* Expand all functions that must be output. Attempt to topologically sort the nodes so function is output when all called functions are already assembled to allow data to be propagated across the callgraph. Use a stack to get smaller distance - between a function and it's callees (later we may choose to use a more + between a function and its callees (later we may choose to use a more sophisticated algorithm for function reordering; we will likely want to use subsections to make the output functions appear in top-down order). */ @@ -1522,56 +1286,235 @@ static void cgraph_expand_all_functions (void) { struct cgraph_node *node; - struct cgraph_node **order = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - int order_pos = 0; + struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); + int order_pos = 0, new_order_pos = 0; int i; - cgraph_mark_functions_to_output (); - order_pos = cgraph_postorder (order); + gcc_assert (order_pos == cgraph_n_nodes); - for (i = order_pos - 1; i >= 0; i--) + /* Garbage collector may remove inline clones we eliminate during + optimization. So we must be sure to not reference them. */ + for (i = 0; i < order_pos; i++) + if (order[i]->output) + order[new_order_pos++] = order[i]; + + for (i = new_order_pos - 1; i >= 0; i--) { node = order[i]; if (node->output) { - if (!node->reachable) - abort (); + gcc_assert (node->reachable); node->output = 0; cgraph_expand_function (node); } } + free (order); + + /* Process CGRAPH_EXPAND_QUEUE, these are functions created during + the expansion process. Note that this queue may grow as its + being processed, as the new functions may generate new ones. */ + while (cgraph_expand_queue) + { + node = cgraph_expand_queue; + cgraph_expand_queue = cgraph_expand_queue->next_needed; + node->next_needed = NULL; + node->output = 0; + node->lowered = DECL_STRUCT_FUNCTION (node->decl)->cfg != NULL; + cgraph_expand_function (node); + } } -/* Mark all local functions. +/* This is used to sort the node types by the cgraph order number. */ - A local function is one whose calls can occur only in the - current compilation unit and all it's calls are explicit, - so we can change its calling convention. - We simply mark all static functions whose address is not taken - as local. */ +struct cgraph_order_sort +{ + enum { ORDER_UNDEFINED = 0, ORDER_FUNCTION, ORDER_VAR, ORDER_ASM } kind; + union + { + struct cgraph_node *f; + struct cgraph_varpool_node *v; + struct cgraph_asm_node *a; + } u; +}; + +/* Output all functions, variables, and asm statements in the order + according to their order fields, which is the order in which they + appeared in the file. This implements -fno-toplevel-reorder. In + this mode we may output functions and variables which don't really + need to be output. */ static void -cgraph_mark_local_functions (void) +cgraph_output_in_order (void) +{ + int max; + size_t size; + struct cgraph_order_sort *nodes; + int i; + struct cgraph_node *pf; + struct cgraph_varpool_node *pv; + struct cgraph_asm_node *pa; + + max = cgraph_order; + size = max * sizeof (struct cgraph_order_sort); + nodes = (struct cgraph_order_sort *) alloca (size); + memset (nodes, 0, size); + + cgraph_varpool_analyze_pending_decls (); + + for (pf = cgraph_nodes; pf; pf = pf->next) + { + if (pf->output) + { + i = pf->order; + gcc_assert (nodes[i].kind == ORDER_UNDEFINED); + nodes[i].kind = ORDER_FUNCTION; + nodes[i].u.f = pf; + } + } + + for (pv = cgraph_varpool_nodes_queue; pv; pv = pv->next_needed) + { + i = pv->order; + gcc_assert (nodes[i].kind == ORDER_UNDEFINED); + nodes[i].kind = ORDER_VAR; + nodes[i].u.v = pv; + } + + for (pa = cgraph_asm_nodes; pa; pa = pa->next) + { + i = pa->order; + gcc_assert (nodes[i].kind == ORDER_UNDEFINED); + nodes[i].kind = ORDER_ASM; + nodes[i].u.a = pa; + } + + for (i = 0; i < max; ++i) + { + switch (nodes[i].kind) + { + case ORDER_FUNCTION: + nodes[i].u.f->output = 0; + cgraph_expand_function (nodes[i].u.f); + break; + + case ORDER_VAR: + cgraph_varpool_assemble_decl (nodes[i].u.v); + break; + + case ORDER_ASM: + assemble_asm (nodes[i].u.a->asm_str); + break; + + case ORDER_UNDEFINED: + break; + + default: + gcc_unreachable (); + } + } + + cgraph_asm_nodes = NULL; +} + +/* Mark visibility of all functions. + + A local function is one whose calls can occur only in the current + compilation unit and all its calls are explicit, so we can change + its calling convention. We simply mark all static functions whose + address is not taken as local. + + We also change the TREE_PUBLIC flag of all declarations that are public + in language point of view but we want to overwrite this default + via visibilities for the backend point of view. */ + +static void +cgraph_function_and_variable_visibility (void) { struct cgraph_node *node; + struct cgraph_varpool_node *vnode; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nMarking local functions:"); - - /* Figure out functions we want to assemble. */ for (node = cgraph_nodes; node; node = node->next) { + if (node->reachable + && (DECL_COMDAT (node->decl) + || (!flag_whole_program + && TREE_PUBLIC (node->decl) && !DECL_EXTERNAL (node->decl)))) + node->local.externally_visible = true; + if (!node->local.externally_visible && node->analyzed + && !DECL_EXTERNAL (node->decl)) + { + gcc_assert (flag_whole_program || !TREE_PUBLIC (node->decl)); + TREE_PUBLIC (node->decl) = 0; + } node->local.local = (!node->needed - && DECL_SAVED_TREE (node->decl) - && !TREE_PUBLIC (node->decl)); - if (cgraph_dump_file && node->local.local) - fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); + && node->analyzed + && !DECL_EXTERNAL (node->decl) + && !node->local.externally_visible); } + for (vnode = cgraph_varpool_nodes_queue; vnode; vnode = vnode->next_needed) + { + if (vnode->needed + && !flag_whole_program + && (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl))) + vnode->externally_visible = 1; + if (!vnode->externally_visible) + { + gcc_assert (flag_whole_program || !TREE_PUBLIC (vnode->decl)); + TREE_PUBLIC (vnode->decl) = 0; + } + gcc_assert (TREE_STATIC (vnode->decl)); + } + + /* Because we have to be conservative on the boundaries of source + level units, it is possible that we marked some functions in + reachable just because they might be used later via external + linkage, but after making them local they are really unreachable + now. */ + cgraph_remove_unreachable_nodes (true, cgraph_dump_file); + if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\n\n"); + { + fprintf (cgraph_dump_file, "\nMarking local functions:"); + for (node = cgraph_nodes; node; node = node->next) + if (node->local.local) + fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); + fprintf (cgraph_dump_file, "\n\n"); + fprintf (cgraph_dump_file, "\nMarking externally visible functions:"); + for (node = cgraph_nodes; node; node = node->next) + if (node->local.externally_visible) + fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); + fprintf (cgraph_dump_file, "\n\n"); + } + cgraph_function_flags_ready = true; +} + +/* Return true when function body of DECL still needs to be kept around + for later re-use. */ +bool +cgraph_preserve_function_body_p (tree decl) +{ + struct cgraph_node *node; + if (!cgraph_global_info_ready) + return (flag_really_no_inline + ? lang_hooks.tree_inlining.disregard_inline_limits (decl) + : DECL_INLINE (decl)); + /* Look if there is any clone around. */ + for (node = cgraph_node (decl); node; node = node->next_clone) + if (node->global.inlined_to) + return true; + return false; +} + +static void +ipa_passes (void) +{ + cfun = NULL; + tree_register_cfg_hooks (); + bitmap_obstack_initialize (NULL); + execute_ipa_pass_list (all_ipa_passes); + bitmap_obstack_release (NULL); } /* Perform simple optimizations based on callgraph. */ @@ -1579,35 +1522,412 @@ cgraph_mark_local_functions (void) void cgraph_optimize (void) { - if (!flag_unit_at_a_time) + if (errorcount || sorrycount) return; + +#ifdef ENABLE_CHECKING + verify_cgraph (); +#endif + if (!flag_unit_at_a_time) + { + cgraph_output_pending_asms (); + cgraph_varpool_assemble_pending_decls (); + cgraph_varpool_output_debug_info (); + return; + } + + process_pending_assemble_externals (); + + /* Frontend may output common variables after the unit has been finalized. + It is safe to deal with them here as they are always zero initialized. */ + cgraph_varpool_analyze_pending_decls (); + timevar_push (TV_CGRAPHOPT); if (!quiet_flag) - fprintf (stderr, "Performing intraprocedural optimizations\n"); + fprintf (stderr, "Performing interprocedural optimizations\n"); - cgraph_mark_local_functions (); + cgraph_function_and_variable_visibility (); if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Marked "); dump_cgraph (cgraph_dump_file); } + + /* Don't run the IPA passes if there was any error or sorry messages. */ + if (errorcount == 0 && sorrycount == 0) + ipa_passes (); - cgraph_decide_inlining (); + /* This pass remove bodies of extern inline functions we never inlined. + Do this later so other IPA passes see what is really going on. */ + cgraph_remove_unreachable_nodes (false, dump_file); + cgraph_increase_alignment (); cgraph_global_info_ready = true; if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Optimized "); dump_cgraph (cgraph_dump_file); + dump_varpool (cgraph_dump_file); } timevar_pop (TV_CGRAPHOPT); /* Output everything. */ if (!quiet_flag) fprintf (stderr, "Assembling functions:\n"); - cgraph_expand_all_functions (); +#ifdef ENABLE_CHECKING + verify_cgraph (); +#endif + + cgraph_mark_functions_to_output (); + + if (!flag_toplevel_reorder) + cgraph_output_in_order (); + else + { + cgraph_output_pending_asms (); + + cgraph_expand_all_functions (); + cgraph_varpool_remove_unreferenced_decls (); + + cgraph_varpool_assemble_pending_decls (); + cgraph_varpool_output_debug_info (); + } + if (cgraph_dump_file) { fprintf (cgraph_dump_file, "\nFinal "); dump_cgraph (cgraph_dump_file); } +#ifdef ENABLE_CHECKING + verify_cgraph (); + /* Double check that all inline clones are gone and that all + function bodies have been released from memory. */ + if (flag_unit_at_a_time + && !(sorrycount || errorcount)) + { + struct cgraph_node *node; + bool error_found = false; + + for (node = cgraph_nodes; node; node = node->next) + if (node->analyzed + && (node->global.inlined_to + || DECL_SAVED_TREE (node->decl))) + { + error_found = true; + dump_cgraph_node (stderr, node); + } + if (error_found) + internal_error ("nodes with no released memory found"); + } +#endif } + +/* Increase alignment of global arrays to improve vectorization potential. + TODO: + - Consider also structs that have an array field. + - Use ipa analysis to prune arrays that can't be vectorized? + This should involve global alignment analysis and in the future also + array padding. */ + +static void +cgraph_increase_alignment (void) +{ + if (flag_section_anchors && flag_tree_vectorize) + { + struct cgraph_varpool_node *vnode; + + /* Increase the alignment of all global arrays for vectorization. */ + for (vnode = cgraph_varpool_nodes_queue; + vnode; + vnode = vnode->next_needed) + { + tree vectype, decl = vnode->decl; + unsigned int alignment; + + if (TREE_CODE (TREE_TYPE (decl)) != ARRAY_TYPE) + continue; + vectype = get_vectype_for_scalar_type (TREE_TYPE (TREE_TYPE (decl))); + if (!vectype) + continue; + alignment = TYPE_ALIGN (vectype); + if (DECL_ALIGN (decl) >= alignment) + continue; + + if (vect_can_force_dr_alignment_p (decl, alignment)) + { + DECL_ALIGN (decl) = TYPE_ALIGN (vectype); + DECL_USER_ALIGN (decl) = 1; + if (cgraph_dump_file) + { + fprintf (cgraph_dump_file, "Increasing alignment of decl: "); + print_generic_expr (cgraph_dump_file, decl, TDF_SLIM); + } + } + } + } +} + +/* Generate and emit a static constructor or destructor. WHICH must be + one of 'I' or 'D'. BODY should be a STATEMENT_LIST containing + GENERIC statements. */ + +void +cgraph_build_static_cdtor (char which, tree body, int priority) +{ + static int counter = 0; + char which_buf[16]; + tree decl, name, resdecl; + + sprintf (which_buf, "%c_%d", which, counter++); + name = get_file_function_name_long (which_buf); + + decl = build_decl (FUNCTION_DECL, name, + build_function_type (void_type_node, void_list_node)); + current_function_decl = decl; + + resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (decl) = resdecl; + + allocate_struct_function (decl); + + TREE_STATIC (decl) = 1; + TREE_USED (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; + DECL_SAVED_TREE (decl) = body; + TREE_PUBLIC (decl) = ! targetm.have_ctors_dtors; + DECL_UNINLINABLE (decl) = 1; + + DECL_INITIAL (decl) = make_node (BLOCK); + TREE_USED (DECL_INITIAL (decl)) = 1; + + DECL_SOURCE_LOCATION (decl) = input_location; + cfun->function_end_locus = input_location; + + switch (which) + { + case 'I': + DECL_STATIC_CONSTRUCTOR (decl) = 1; + break; + case 'D': + DECL_STATIC_DESTRUCTOR (decl) = 1; + break; + default: + gcc_unreachable (); + } + + gimplify_function_tree (decl); + + /* ??? We will get called LATE in the compilation process. */ + if (cgraph_global_info_ready) + { + tree_lowering_passes (decl); + tree_rest_of_compilation (decl); + } + else + cgraph_finalize_function (decl, 0); + + if (targetm.have_ctors_dtors) + { + void (*fn) (rtx, int); + + if (which == 'I') + fn = targetm.asm_out.constructor; + else + fn = targetm.asm_out.destructor; + fn (XEXP (DECL_RTL (decl), 0), priority); + } +} + +void +init_cgraph (void) +{ + cgraph_dump_file = dump_begin (TDI_cgraph, NULL); +} + +/* The edges representing the callers of the NEW_VERSION node were + fixed by cgraph_function_versioning (), now the call_expr in their + respective tree code should be updated to call the NEW_VERSION. */ + +static void +update_call_expr (struct cgraph_node *new_version) +{ + struct cgraph_edge *e; + + gcc_assert (new_version); + for (e = new_version->callers; e; e = e->next_caller) + /* Update the call expr on the edges + to call the new version. */ + TREE_OPERAND (TREE_OPERAND (get_call_expr_in (e->call_stmt), 0), 0) = new_version->decl; +} + + +/* Create a new cgraph node which is the new version of + OLD_VERSION node. REDIRECT_CALLERS holds the callers + edges which should be redirected to point to + NEW_VERSION. ALL the callees edges of OLD_VERSION + are cloned to the new version node. Return the new + version node. */ + +static struct cgraph_node * +cgraph_copy_node_for_versioning (struct cgraph_node *old_version, + tree new_decl, + VEC(cgraph_edge_p,heap) *redirect_callers) + { + struct cgraph_node *new_version; + struct cgraph_edge *e, *new_e; + struct cgraph_edge *next_callee; + unsigned i; + + gcc_assert (old_version); + + new_version = cgraph_node (new_decl); + + new_version->analyzed = true; + new_version->local = old_version->local; + new_version->global = old_version->global; + new_version->rtl = new_version->rtl; + new_version->reachable = true; + new_version->count = old_version->count; + + /* Clone the old node callees. Recursive calls are + also cloned. */ + for (e = old_version->callees;e; e=e->next_callee) + { + new_e = cgraph_clone_edge (e, new_version, e->call_stmt, 0, e->loop_nest, true); + new_e->count = e->count; + } + /* Fix recursive calls. + If OLD_VERSION has a recursive call after the + previous edge cloning, the new version will have an edge + pointing to the old version, which is wrong; + Redirect it to point to the new version. */ + for (e = new_version->callees ; e; e = next_callee) + { + next_callee = e->next_callee; + if (e->callee == old_version) + cgraph_redirect_edge_callee (e, new_version); + + if (!next_callee) + break; + } + for (i = 0; VEC_iterate (cgraph_edge_p, redirect_callers, i, e); i++) + { + /* Redirect calls to the old version node to point to its new + version. */ + cgraph_redirect_edge_callee (e, new_version); + } + + return new_version; + } + + /* Perform function versioning. + Function versioning includes copying of the tree and + a callgraph update (creating a new cgraph node and updating + its callees and callers). + + REDIRECT_CALLERS varray includes the edges to be redirected + to the new version. + + TREE_MAP is a mapping of tree nodes we want to replace with + new ones (according to results of prior analysis). + OLD_VERSION_NODE is the node that is versioned. + It returns the new version's cgraph node. */ + +struct cgraph_node * +cgraph_function_versioning (struct cgraph_node *old_version_node, + VEC(cgraph_edge_p,heap) *redirect_callers, + varray_type tree_map) +{ + tree old_decl = old_version_node->decl; + struct cgraph_node *new_version_node = NULL; + tree new_decl; + + if (!tree_versionable_function_p (old_decl)) + return NULL; + + /* Make a new FUNCTION_DECL tree node for the + new version. */ + new_decl = copy_node (old_decl); + + /* Create the new version's call-graph node. + and update the edges of the new node. */ + new_version_node = + cgraph_copy_node_for_versioning (old_version_node, new_decl, + redirect_callers); + + /* Copy the OLD_VERSION_NODE function tree to the new version. */ + tree_function_versioning (old_decl, new_decl, tree_map, false); + /* Update the call_expr on the edges to call the new version node. */ + update_call_expr (new_version_node); + + /* Update the new version's properties. + Make The new version visible only within this translation unit. + ??? We cannot use COMDAT linkage because there is no + ABI support for this. */ + DECL_EXTERNAL (new_version_node->decl) = 0; + DECL_ONE_ONLY (new_version_node->decl) = 0; + TREE_PUBLIC (new_version_node->decl) = 0; + DECL_COMDAT (new_version_node->decl) = 0; + new_version_node->local.externally_visible = 0; + new_version_node->local.local = 1; + new_version_node->lowered = true; + return new_version_node; +} + +/* Produce separate function body for inline clones so the offline copy can be + modified without affecting them. */ +struct cgraph_node * +save_inline_function_body (struct cgraph_node *node) +{ + struct cgraph_node *first_clone; + + gcc_assert (node == cgraph_node (node->decl)); + + cgraph_lower_function (node); + + /* In non-unit-at-a-time we construct full fledged clone we never output to + assembly file. This clone is pointed out by inline_decl of original function + and inlining infrastructure knows how to deal with this. */ + if (!flag_unit_at_a_time) + { + struct cgraph_edge *e; + + first_clone = cgraph_clone_node (node, node->count, 0, false); + first_clone->needed = 0; + first_clone->reachable = 1; + /* Recursively clone all bodies. */ + for (e = first_clone->callees; e; e = e->next_callee) + if (!e->inline_failed) + cgraph_clone_inlined_nodes (e, true, false); + } + else + first_clone = node->next_clone; + + first_clone->decl = copy_node (node->decl); + node->next_clone = NULL; + if (!flag_unit_at_a_time) + node->inline_decl = first_clone->decl; + first_clone->prev_clone = NULL; + cgraph_insert_node_to_hashtable (first_clone); + gcc_assert (first_clone == cgraph_node (first_clone->decl)); + + /* Copy the OLD_VERSION_NODE function tree to the new version. */ + tree_function_versioning (node->decl, first_clone->decl, NULL, true); + + DECL_EXTERNAL (first_clone->decl) = 0; + DECL_ONE_ONLY (first_clone->decl) = 0; + TREE_PUBLIC (first_clone->decl) = 0; + DECL_COMDAT (first_clone->decl) = 0; + + for (node = first_clone->next_clone; node; node = node->next_clone) + node->decl = first_clone->decl; +#ifdef ENABLE_CHECKING + verify_cgraph_node (first_clone); +#endif + return first_clone; +} + +#include "gt-cgraphunit.h" diff --git a/contrib/gcc/collect2.c b/contrib/gcc/collect2.c index 33206f5cf2f..02edde835d5 100644 --- a/contrib/gcc/collect2.c +++ b/contrib/gcc/collect2.c @@ -1,7 +1,7 @@ /* Collect static initialization info into data structures that can be traversed by C++ initialization and finalization routines. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Chris Smith (csmith@convex.com). Heavily modified by Michael Meissner (meissner@cygnus.com), Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com). @@ -20,8 +20,8 @@ for more details. 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. */ /* Build tables of static constructors and destructors and run ld. */ @@ -35,19 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA # define SIGCHLD SIGCLD #endif -#ifdef vfork /* Autoconf may define this to fork for us. */ -# define VFORK_STRING "fork" -#else -# define VFORK_STRING "vfork" -#endif -#ifdef HAVE_VFORK_H -#include -#endif -#ifdef VMS -#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ - lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) -#endif /* VMS */ - #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" #endif @@ -67,7 +54,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA cross-versions are in the proper directories. */ #ifdef CROSS_COMPILE -#undef SUNOS4_SHARED_LIBRARIES #undef OBJECT_FORMAT_COFF #undef MD_EXEC_PREFIX #undef REAL_LD_FILE_NAME @@ -140,7 +126,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA fprintf ((STREAM), "void _GLOBAL__DD() {\n\t%s();\n}\n", (FUNC)) #endif -#if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES +#ifdef LDD_SUFFIX #define SCAN_LIBRARIES #endif @@ -150,10 +136,6 @@ int do_collecting = 1; int do_collecting = 0; #endif -#ifndef COLLECT_PARSE_FLAG -#define COLLECT_PARSE_FLAG(FLAG) -#endif - /* Nonzero if we should suppress the automatic demangling of identifiers in linker error messages. Set from COLLECT_NO_DEMANGLE. */ int no_demangle; @@ -179,13 +161,14 @@ struct head enum pass { PASS_FIRST, /* without constructors */ PASS_OBJ, /* individual objects */ - PASS_LIB, /* looking for shared libraries */ + PASS_LIB, /* looking for shared libraries */ PASS_SECOND /* with constructors linked in */ }; int vflag; /* true if -v */ static int rflag; /* true if -r */ static int strip_flag; /* true if -s */ +static const char *demangle_flag; #ifdef COLLECT_EXPORT_LIST static int export_flag; /* true if -bE */ static int aix64_flag; /* true if -b64 */ @@ -194,21 +177,22 @@ static int aixrtl_flag; /* true if -brtl */ int debug; /* true if -debug */ -static int shared_obj; /* true if -shared */ +static int shared_obj; /* true if -shared */ static const char *c_file; /* .c for constructor/destructor list. */ static const char *o_file; /* .o for constructor/destructor list. */ #ifdef COLLECT_EXPORT_LIST -static const char *export_file; /* .x for AIX export list. */ +static const char *export_file; /* .x for AIX export list. */ #endif -const char *ldout; /* File for ld errors. */ +const char *ldout; /* File for ld stdout. */ +const char *lderrout; /* File for ld stderr. */ static const char *output_file; /* Output file for ld. */ static const char *nm_file_name; /* pathname of nm */ #ifdef LDD_SUFFIX static const char *ldd_file_name; /* pathname of ldd (or equivalent) */ #endif static const char *strip_file_name; /* pathname of strip */ -const char *c_file_name; /* pathname of gcc */ +const char *c_file_name; /* pathname of gcc */ static char *initname, *fininame; /* names of init and fini funcs */ static struct head constructors; /* list of constructors found */ @@ -221,9 +205,6 @@ static struct head frame_tables; /* list of frame unwind info tables */ struct obstack temporary_obstack; char * temporary_firstobj; -/* Holds the return value of pexecute and fork. */ -int pid; - /* Structure to hold all the directories in which to search for files to execute. */ @@ -255,7 +236,7 @@ static char *find_a_file (struct path_prefix *, const char *); static void add_prefix (struct path_prefix *, const char *); static void prefix_from_env (const char *, struct path_prefix *); static void prefix_from_string (const char *, struct path_prefix *); -static void do_wait (const char *); +static void do_wait (const char *, struct pex_obj *); static void fork_execute (const char *, char **); static void maybe_unlink (const char *); static void add_to_list (struct head *, const char *); @@ -290,26 +271,6 @@ static char *resolve_lib_name (const char *); #endif static char *extract_string (const char **); -#ifndef HAVE_DUP2 -static int -dup2 (int oldfd, int newfd) -{ - int fdtmp[256]; - int fdx = 0; - int fd; - - if (oldfd == newfd) - return oldfd; - close (newfd); - while ((fd = dup (oldfd)) != newfd && fd >= 0) /* good enough for low fd's */ - fdtmp[fdx++] = fd; - while (fdx > 0) - close (fdtmp[--fdx]); - - return fd; -} -#endif /* ! HAVE_DUP2 */ - /* Delete tempfiles and exit function. */ void @@ -328,10 +289,16 @@ collect_exit (int status) if (ldout != 0 && ldout[0]) { - dump_file (ldout); + dump_file (ldout, stdout); maybe_unlink (ldout); } + if (lderrout != 0 && lderrout[0]) + { + dump_file (lderrout, stderr); + maybe_unlink (lderrout); + } + if (status != 0 && output_file != 0 && output_file[0]) maybe_unlink (output_file); @@ -341,26 +308,26 @@ collect_exit (int status) /* Notify user of a non-error. */ void -notice (const char *msgid, ...) +notice (const char *cmsgid, ...) { va_list ap; - va_start (ap, msgid); - vfprintf (stderr, _(msgid), ap); + va_start (ap, cmsgid); + vfprintf (stderr, _(cmsgid), ap); va_end (ap); } /* Die when sys call fails. */ void -fatal_perror (const char * msgid, ...) +fatal_perror (const char * cmsgid, ...) { int e = errno; va_list ap; - va_start (ap, msgid); + va_start (ap, cmsgid); fprintf (stderr, "collect2: "); - vfprintf (stderr, _(msgid), ap); + vfprintf (stderr, _(cmsgid), ap); fprintf (stderr, ": %s\n", xstrerror (e)); va_end (ap); @@ -370,13 +337,13 @@ fatal_perror (const char * msgid, ...) /* Just die. */ void -fatal (const char * msgid, ...) +fatal (const char * cmsgid, ...) { va_list ap; - va_start (ap, msgid); + va_start (ap, cmsgid); fprintf (stderr, "collect2: "); - vfprintf (stderr, _(msgid), ap); + vfprintf (stderr, _(cmsgid), ap); fprintf (stderr, "\n"); va_end (ap); @@ -386,13 +353,13 @@ fatal (const char * msgid, ...) /* Write error message. */ void -error (const char * msgid, ...) +error (const char * gmsgid, ...) { va_list ap; - va_start (ap, msgid); + va_start (ap, gmsgid); fprintf (stderr, "collect2: "); - vfprintf (stderr, _(msgid), ap); + vfprintf (stderr, _(gmsgid), ap); fprintf (stderr, "\n"); va_end(ap); } @@ -401,9 +368,9 @@ error (const char * msgid, ...) provide a default entry. */ void -fancy_abort (void) +fancy_abort (const char *file, int line, const char *func) { - fatal ("internal error"); + fatal ("internal gcc abort in %s, at %s:%d", func, file, line); } static void @@ -418,13 +385,16 @@ handler (int signo) if (ldout != 0 && ldout[0]) maybe_unlink (ldout); + if (lderrout != 0 && lderrout[0]) + maybe_unlink (lderrout); + #ifdef COLLECT_EXPORT_LIST if (export_file != 0 && export_file[0]) maybe_unlink (export_file); #endif signal (signo, SIG_DFL); - kill (getpid (), signo); + raise (signo); } @@ -463,11 +433,11 @@ extract_string (const char **pp) obstack_1grow (&temporary_obstack, '\0'); *pp = p; - return obstack_finish (&temporary_obstack); + return XOBFINISH (&temporary_obstack, char *); } void -dump_file (const char *name) +dump_file (const char *name, FILE *to) { FILE *stream = fopen (name, "r"); @@ -484,41 +454,45 @@ dump_file (const char *name) const char *word, *p; char *result; obstack_1grow (&temporary_obstack, '\0'); - word = obstack_finish (&temporary_obstack); + word = XOBFINISH (&temporary_obstack, const char *); if (*word == '.') - ++word, putc ('.', stderr); + ++word, putc ('.', to); p = word; if (!strncmp (p, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX))) p += strlen (USER_LABEL_PREFIX); +#ifdef HAVE_LD_DEMANGLE + result = 0; +#else if (no_demangle) result = 0; else result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE); +#endif if (result) { int diff; - fputs (result, stderr); + fputs (result, to); diff = strlen (word) - strlen (result); while (diff > 0 && c == ' ') - --diff, putc (' ', stderr); + --diff, putc (' ', to); while (diff < 0 && c == ' ') ++diff, c = getc (stream); free (result); } else - fputs (word, stderr); + fputs (word, to); - fflush (stderr); + fflush (to); obstack_free (&temporary_obstack, temporary_firstobj); } if (c == EOF) break; - putc (c, stderr); + putc (c, to); } fclose (stream); } @@ -605,7 +579,7 @@ find_a_file (struct path_prefix *pprefix, const char *name) len += strlen (HOST_EXECUTABLE_SUFFIX); #endif - temp = xmalloc (len); + temp = XNEWVEC (char, len); /* Determine the filename to execute (special case for absolute paths). */ @@ -693,7 +667,7 @@ add_prefix (struct path_prefix *pprefix, const char *prefix) if (len > pprefix->max_len) pprefix->max_len = len; - pl = xmalloc (sizeof (struct prefix_list)); + pl = XNEW (struct prefix_list); pl->prefix = xstrdup (prefix); if (*prev) @@ -720,7 +694,7 @@ static void prefix_from_string (const char *p, struct path_prefix *pprefix) { const char *startp, *endp; - char *nstore = xmalloc (strlen (p) + 3); + char *nstore = XNEWVEC (char, strlen (p) + 3); if (debug) fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR); @@ -837,13 +811,16 @@ main (int argc, char **argv) signal (SIGCHLD, SIG_DFL); #endif + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); /* Do not invoke xcalloc before this point, since locale needs to be set first, in case a diagnostic is issued. */ - ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3)); - ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10)); + ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+4)); + ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+11)); object = (const char **)(object_lst = xcalloc(sizeof (char *), argc)); #ifdef DEBUG @@ -860,7 +837,6 @@ main (int argc, char **argv) { if (! strcmp (argv[i], "-debug")) debug = 1; - COLLECT_PARSE_FLAG (argv[i]); } vflag = debug; } @@ -874,7 +850,9 @@ main (int argc, char **argv) obstack_begin (&temporary_obstack, 0); temporary_firstobj = obstack_alloc (&temporary_obstack, 0); +#ifndef HAVE_LD_DEMANGLE current_demangling_style = auto_demangling; +#endif p = getenv ("COLLECT_GCC_OPTIONS"); while (p && *p) { @@ -1005,6 +983,7 @@ main (int argc, char **argv) export_file = make_temp_file (".x"); #endif ldout = make_temp_file (".ld"); + lderrout = make_temp_file (".le"); *c_ptr++ = c_file_name; *c_ptr++ = "-x"; *c_ptr++ = "c"; @@ -1064,6 +1043,12 @@ main (int argc, char **argv) /* After the first file, put in the c++ rt0. */ first_file = 1; +#ifdef HAVE_LD_DEMANGLE + if (!demangle_flag && !no_demangle) + demangle_flag = "--demangle"; + if (demangle_flag) + *ld1++ = *ld2++ = demangle_flag; +#endif while ((arg = *++argv) != (char *) 0) { *ld1++ = *ld2++ = arg; @@ -1077,7 +1062,7 @@ main (int argc, char **argv) explicitly puts an export list in command line */ case 'b': if (arg[2] == 'E' || strncmp (&arg[2], "export", 6) == 0) - export_flag = 1; + export_flag = 1; else if (arg[2] == '6' && arg[3] == '4') aix64_flag = 1; else if (arg[2] == 'r' && arg[3] == 't' && arg[4] == 'l') @@ -1092,6 +1077,11 @@ main (int argc, char **argv) ld1--; ld2--; } + if (!strcmp (arg, "-dynamic-linker") && argv[1]) + { + ++argv; + *ld1++ = *ld2++ = *argv; + } break; case 'l': @@ -1105,7 +1095,7 @@ main (int argc, char **argv) } #ifdef COLLECT_EXPORT_LIST { - /* Resolving full library name. */ + /* Resolving full library name. */ const char *s = resolve_lib_name (arg+2); /* Saving a full library name. */ @@ -1160,6 +1150,34 @@ main (int argc, char **argv) if (arg[2] == '\0') vflag = 1; break; + + case '-': + if (strcmp (arg, "--no-demangle") == 0) + { + demangle_flag = arg; + no_demangle = 1; + ld1--; + ld2--; + } + else if (strncmp (arg, "--demangle", 10) == 0) + { + demangle_flag = arg; + no_demangle = 0; +#ifndef HAVE_LD_DEMANGLE + if (arg[10] == '=') + { + enum demangling_styles style + = cplus_demangle_name_to_style (arg+11); + if (style == unknown_demangling) + error ("unknown demangling style '%s'", arg+11); + else + current_demangling_style = style; + } +#endif + ld1--; + ld2--; + } + break; } } else if ((p = strrchr (arg, '.')) != (char *) 0 @@ -1187,8 +1205,8 @@ main (int argc, char **argv) else { /* Saving a full library name. */ - add_to_list (&libs, arg); - } + add_to_list (&libs, arg); + } #endif } } @@ -1349,7 +1367,7 @@ main (int argc, char **argv) /* Strip now if it was requested on the command line. */ if (strip_flag) { - char **real_strip_argv = xcalloc (sizeof (char *), 3); + char **real_strip_argv = XCNEWVEC (char *, 3); const char ** strip_argv = (const char **) real_strip_argv; strip_argv[0] = strip_file_name; @@ -1461,11 +1479,14 @@ main (int argc, char **argv) /* Wait for a process to finish, and exit if a nonzero status is found. */ int -collect_wait (const char *prog) +collect_wait (const char *prog, struct pex_obj *pex) { int status; - pwait (pid, &status, 0); + if (!pex_get_status (pex, 1, &status)) + fatal_perror ("can't get program status"); + pex_free (pex); + if (status) { if (WIFSIGNALED (status)) @@ -1484,9 +1505,9 @@ collect_wait (const char *prog) } static void -do_wait (const char *prog) +do_wait (const char *prog, struct pex_obj *pex) { - int ret = collect_wait (prog); + int ret = collect_wait (prog, pex); if (ret != 0) { error ("%s returned %d exit status", prog, ret); @@ -1497,14 +1518,13 @@ do_wait (const char *prog) /* Execute a program, and wait for the reply. */ -void -collect_execute (const char *prog, char **argv, const char *redir) +struct pex_obj * +collect_execute (const char *prog, char **argv, const char *outname, + const char *errname) { - char *errmsg_fmt; - char *errmsg_arg; - int redir_handle = -1; - int stdout_save = -1; - int stderr_save = -1; + struct pex_obj *pex; + const char *errmsg; + int err; if (vflag || debug) { @@ -1529,49 +1549,35 @@ collect_execute (const char *prog, char **argv, const char *redir) since we might not end up needing something that we could not find. */ if (argv[0] == 0) - fatal ("cannot find `%s'", prog); + fatal ("cannot find '%s'", prog); - if (redir) + pex = pex_init (0, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); + + errmsg = pex_run (pex, PEX_LAST | PEX_SEARCH, argv[0], argv, outname, + errname, &err); + if (errmsg != NULL) { - /* Open response file. */ - redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); - - /* Duplicate the stdout and stderr file handles - so they can be restored later. */ - stdout_save = dup (STDOUT_FILENO); - if (stdout_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - stderr_save = dup (STDERR_FILENO); - if (stderr_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - - /* Redirect stdout & stderr to our response file. */ - dup2 (redir_handle, STDOUT_FILENO); - dup2 (redir_handle, STDERR_FILENO); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - pid = pexecute (argv[0], argv, argv[0], NULL, &errmsg_fmt, &errmsg_arg, - (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH)); - - if (redir) - { - /* Restore stdout and stderr to their previous settings. */ - dup2 (stdout_save, STDOUT_FILENO); - dup2 (stderr_save, STDERR_FILENO); - - /* Close response file. */ - close (redir_handle); - } - - if (pid == -1) - fatal_perror (errmsg_fmt, errmsg_arg); + return pex; } static void fork_execute (const char *prog, char **argv) { - collect_execute (prog, argv, NULL); - do_wait (prog); + struct pex_obj *pex; + + pex = collect_execute (prog, argv, NULL, NULL); + do_wait (prog, pex); } /* Unlink a file unless we are debugging. */ @@ -1580,7 +1586,7 @@ static void maybe_unlink (const char *file) { if (!debug) - unlink (file); + unlink_if_ordinary (file); else notice ("[Leaving %s]\n", file); } @@ -1664,7 +1670,7 @@ sort_ids (struct head *head_ptr) || id->sequence > (*id_ptr)->sequence /* Hack: do lexical compare, too. || (id->sequence == (*id_ptr)->sequence - && strcmp (id->name, (*id_ptr)->name) > 0) */ + && strcmp (id->name, (*id_ptr)->name) > 0) */ ) { id->next = *id_ptr; @@ -1795,7 +1801,7 @@ write_c_file_stat (FILE *stream, const char *name ATTRIBUTE_UNUSED) } } /* q points to null at end of the string (or . of the .so version) */ - prefix = xmalloc (q - p + 1); + prefix = XNEWVEC (char, q - p + 1); strncpy (prefix, p, q - p); prefix[q - p] = 0; for (r = prefix; *r; r++) @@ -1993,11 +1999,15 @@ static void scan_prog_file (const char *prog_name, enum pass which_pass) { void (*int_handler) (int); +#ifdef SIGQUIT void (*quit_handler) (int); +#endif char *real_nm_argv[4]; const char **nm_argv = (const char **) real_nm_argv; int argc = 0; - int pipe_fd[2]; + struct pex_obj *pex; + const char *errmsg; + int err; char *p, buf[1024]; FILE *inf; @@ -2006,7 +2016,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) /* If we do not have an `nm', complain. */ if (nm_file_name == 0) - fatal ("cannot find `nm'"); + fatal ("cannot find 'nm'"); nm_argv[argc++] = nm_file_name; if (NM_FLAGS[0] != '\0') @@ -2015,13 +2025,6 @@ scan_prog_file (const char *prog_name, enum pass which_pass) nm_argv[argc++] = prog_name; nm_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) - fatal_perror ("pipe"); - - inf = fdopen (pipe_fd[0], "r"); - if (inf == (FILE *) 0) - fatal_perror ("fdopen"); - /* Trace if needed. */ if (vflag) { @@ -2037,35 +2040,30 @@ scan_prog_file (const char *prog_name, enum pass which_pass) fflush (stdout); fflush (stderr); - /* Spawn child nm on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); + pex = pex_init (PEX_USE_PIPES, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); - if (pid == 0) /* child context */ + errmsg = pex_run (pex, 0, nm_file_name, real_nm_argv, NULL, NULL, &err); + if (errmsg != NULL) { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (nm_file_name, real_nm_argv); - fatal_perror ("execv %s", nm_file_name); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - /* Parent context from here on. */ int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); #ifdef SIGQUIT quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); #endif - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + inf = pex_read_output (pex, 0); + if (inf == NULL) + fatal_perror ("can't open nm output"); if (debug) fprintf (stderr, "\nnm output with constructors/destructors.\n"); @@ -2139,10 +2137,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) if (debug) fprintf (stderr, "\n"); - if (fclose (inf) != 0) - fatal_perror ("fclose"); - - do_wait (nm_file_name); + do_wait (nm_file_name, pex); signal (SIGINT, int_handler); #ifdef SIGQUIT @@ -2150,269 +2145,6 @@ scan_prog_file (const char *prog_name, enum pass which_pass) #endif } -#if SUNOS4_SHARED_LIBRARIES - -/* Routines to scan the SunOS 4 _DYNAMIC structure to find shared libraries - that the output file depends upon and their initialization/finalization - routines, if any. */ - -#include -#include -#include -#include -#include -#include -#include - -/* pointers to the object file */ -unsigned object; /* address of memory mapped file */ -unsigned objsize; /* size of memory mapped to file */ -char * code; /* pointer to code segment */ -char * data; /* pointer to data segment */ -struct nlist *symtab; /* pointer to symbol table */ -struct link_dynamic *ld; -struct link_dynamic_2 *ld_2; -struct head libraries; - -/* Map the file indicated by NAME into memory and store its address. */ - -static void -mapfile (const char *name) -{ - int fp; - struct stat s; - if ((fp = open (name, O_RDONLY)) == -1) - fatal ("unable to open file '%s'", name); - if (fstat (fp, &s) == -1) - fatal ("unable to stat file '%s'", name); - - objsize = s.st_size; - object = (unsigned) mmap (0, objsize, PROT_READ|PROT_WRITE, MAP_PRIVATE, - fp, 0); - if (object == (unsigned)-1) - fatal ("unable to mmap file '%s'", name); - - close (fp); -} - -/* Helpers for locatelib. */ - -static const char *libname; - -static int -libselect (struct direct *d) -{ - return (strncmp (libname, d->d_name, strlen (libname)) == 0); -} - -/* If one file has an additional numeric extension past LIBNAME, then put - that one first in the sort. If both files have additional numeric - extensions, then put the one with the higher number first in the sort. - - We must verify that the extension is numeric, because Sun saves the - original versions of patched libraries with a .FCS extension. Files with - invalid extensions must go last in the sort, so that they will not be used. */ - -static int -libcompare (struct direct **d1, struct direct **d2) -{ - int i1, i2 = strlen (libname); - char *e1 = (*d1)->d_name + i2; - char *e2 = (*d2)->d_name + i2; - - while (*e1 && *e2 && *e1 == '.' && *e2 == '.' - && e1[1] && ISDIGIT (e1[1]) && e2[1] && ISDIGIT (e2[1])) - { - ++e1; - ++e2; - i1 = strtol (e1, &e1, 10); - i2 = strtol (e2, &e2, 10); - if (i1 != i2) - return i1 - i2; - } - - if (*e1) - { - /* It has a valid numeric extension, prefer this one. */ - if (*e1 == '.' && e1[1] && ISDIGIT (e1[1])) - return 1; - /* It has an invalid numeric extension, must prefer the other one. */ - else - return -1; - } - else if (*e2) - { - /* It has a valid numeric extension, prefer this one. */ - if (*e2 == '.' && e2[1] && ISDIGIT (e2[1])) - return -1; - /* It has an invalid numeric extension, must prefer the other one. */ - else - return 1; - } - else - return 0; -} - -/* Given the name NAME of a dynamic dependency, find its pathname and add - it to the list of libraries. */ - -static void -locatelib (const char *name) -{ - static const char **l; - static int cnt; - char buf[MAXPATHLEN]; - char *p, *q; - const char **pp; - - if (l == 0) - { - char *ld_rules; - char *ldr = 0; - /* counting elements in array, need 1 extra for null */ - cnt = 1; - ld_rules = (char *) (ld_2->ld_rules + code); - if (ld_rules) - { - cnt++; - for (; *ld_rules != 0; ld_rules++) - if (*ld_rules == ':') - cnt++; - ld_rules = (char *) (ld_2->ld_rules + code); - ldr = xstrdup (ld_rules); - } - p = getenv ("LD_LIBRARY_PATH"); - q = 0; - if (p) - { - cnt++; - for (q = p ; *q != 0; q++) - if (*q == ':') - cnt++; - q = xstrdup (p); - } - l = xmalloc ((cnt + 3) * sizeof (char *)); - pp = l; - if (ldr) - { - *pp++ = ldr; - for (; *ldr != 0; ldr++) - if (*ldr == ':') - { - *ldr++ = 0; - *pp++ = ldr; - } - } - if (q) - { - *pp++ = q; - for (; *q != 0; q++) - if (*q == ':') - { - *q++ = 0; - *pp++ = q; - } - } - /* built in directories are /lib, /usr/lib, and /usr/local/lib */ - *pp++ = "/lib"; - *pp++ = "/usr/lib"; - *pp++ = "/usr/local/lib"; - *pp = 0; - } - libname = name; - for (pp = l; *pp != 0 ; pp++) - { - struct direct **namelist; - int entries; - if ((entries = scandir (*pp, &namelist, libselect, libcompare)) > 0) - { - sprintf (buf, "%s/%s", *pp, namelist[entries - 1]->d_name); - add_to_list (&libraries, buf); - if (debug) - fprintf (stderr, "%s\n", buf); - break; - } - } - if (*pp == 0) - { - if (debug) - notice ("not found\n"); - else - fatal ("dynamic dependency %s not found", name); - } -} - -/* Scan the _DYNAMIC structure of the output file to find shared libraries - that it depends upon and any constructors or destructors they contain. */ - -static void -scan_libraries (const char *prog_name) -{ - struct exec *header; - char *base; - struct link_object *lo; - char buff[MAXPATHLEN]; - struct id *list; - - mapfile (prog_name); - header = (struct exec *)object; - if (N_BADMAG (*header)) - fatal ("bad magic number in file '%s'", prog_name); - if (header->a_dynamic == 0) - return; - - code = (char *) (N_TXTOFF (*header) + (long) header); - data = (char *) (N_DATOFF (*header) + (long) header); - symtab = (struct nlist *) (N_SYMOFF (*header) + (long) header); - - if (header->a_magic == ZMAGIC && header->a_entry == 0x20) - { - /* shared object */ - ld = (struct link_dynamic *) (symtab->n_value + code); - base = code; - } - else - { - /* executable */ - ld = (struct link_dynamic *) data; - base = code-PAGSIZ; - } - - if (debug) - notice ("dynamic dependencies.\n"); - - ld_2 = (struct link_dynamic_2 *) ((long) ld->ld_un.ld_2 + (long)base); - for (lo = (struct link_object *) ld_2->ld_need; lo; - lo = (struct link_object *) lo->lo_next) - { - char *name; - lo = (struct link_object *) ((long) lo + code); - name = (char *) (code + lo->lo_name); - if (lo->lo_library) - { - if (debug) - fprintf (stderr, "\t-l%s.%d => ", name, lo->lo_major); - sprintf (buff, "lib%s.so.%d.%d", name, lo->lo_major, lo->lo_minor); - locatelib (buff); - } - else - { - if (debug) - fprintf (stderr, "\t%s\n", name); - add_to_list (&libraries, name); - } - } - - if (debug) - fprintf (stderr, "\n"); - - /* Now iterate through the library list adding their symbols to - the list. */ - for (list = libraries.first; list; list = list->next) - scan_prog_file (list->name, PASS_LIB); -} - -#else /* SUNOS4_SHARED_LIBRARIES */ #ifdef LDD_SUFFIX /* Use the List Dynamic Dependencies program to find shared libraries that @@ -2425,18 +2157,22 @@ scan_libraries (const char *prog_name) static struct head libraries; /* list of shared libraries found */ struct id *list; void (*int_handler) (int); +#ifdef SIGQUIT void (*quit_handler) (int); +#endif char *real_ldd_argv[4]; const char **ldd_argv = (const char **) real_ldd_argv; int argc = 0; - int pipe_fd[2]; + struct pex_obj *pex; + const char *errmsg; + int err; char buf[1024]; FILE *inf; /* If we do not have an `ldd', complain. */ if (ldd_file_name == 0) { - error ("cannot find `ldd'"); + error ("cannot find 'ldd'"); return; } @@ -2444,13 +2180,6 @@ scan_libraries (const char *prog_name) ldd_argv[argc++] = prog_name; ldd_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) - fatal_perror ("pipe"); - - inf = fdopen (pipe_fd[0], "r"); - if (inf == (FILE *) 0) - fatal_perror ("fdopen"); - /* Trace if needed. */ if (vflag) { @@ -2466,35 +2195,30 @@ scan_libraries (const char *prog_name) fflush (stdout); fflush (stderr); - /* Spawn child ldd on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); + pex = pex_init (PEX_USE_PIPES, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); - if (pid == 0) /* child context */ + errmsg = pex_run (pex, 0, ldd_file_name, real_ldd_argv, NULL, NULL, &err); + if (errmsg != NULL) { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (ldd_file_name, real_ldd_argv); - fatal_perror ("execv %s", ldd_file_name); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - /* Parent context from here on. */ int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); #ifdef SIGQUIT quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); #endif - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + inf = pex_read_output (pex, 0); + if (inf == NULL) + fatal_perror ("can't open ldd output"); if (debug) notice ("\nldd output with constructors/destructors.\n"); @@ -2522,7 +2246,7 @@ scan_libraries (const char *prog_name) *end = '\0'; if (access (name, R_OK) == 0) - add_to_list (&libraries, name); + add_to_list (&libraries, name); else fatal ("unable to open dynamic dependency '%s'", buf); @@ -2532,10 +2256,7 @@ scan_libraries (const char *prog_name) if (debug) fprintf (stderr, "\n"); - if (fclose (inf) != 0) - fatal_perror ("fclose"); - - do_wait (ldd_file_name); + do_wait (ldd_file_name, pex); signal (SIGINT, int_handler); #ifdef SIGQUIT @@ -2549,7 +2270,6 @@ scan_libraries (const char *prog_name) } #endif /* LDD_SUFFIX */ -#endif /* SUNOS4_SHARED_LIBRARIES */ #endif /* OBJECT_FORMAT_NONE */ @@ -2576,20 +2296,20 @@ scan_libraries (const char *prog_name) # if defined (C_WEAKEXT) # define GCC_OK_SYMBOL(X) \ (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \ - ((X).n_scnum > N_UNDEF) && \ - (aix64_flag \ - || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ - || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) + ((X).n_scnum > N_UNDEF) && \ + (aix64_flag \ + || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ + || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) # define GCC_UNDEF_SYMBOL(X) \ (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \ - ((X).n_scnum == N_UNDEF)) + ((X).n_scnum == N_UNDEF)) # else # define GCC_OK_SYMBOL(X) \ (((X).n_sclass == C_EXT) && \ - ((X).n_scnum > N_UNDEF) && \ - (aix64_flag \ - || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ - || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) + ((X).n_scnum > N_UNDEF) && \ + (aix64_flag \ + || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \ + || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT)))) # define GCC_UNDEF_SYMBOL(X) \ (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF)) # endif @@ -2678,9 +2398,9 @@ scan_prog_file (const char *prog_name, enum pass which_pass) { #endif /* Some platforms (e.g. OSF4) declare ldopen as taking a - non-const char * filename parameter, even though it will not - modify that string. So we must cast away const-ness here, - which will cause -Wcast-qual to burp. */ + non-const char * filename parameter, even though it will not + modify that string. So we must cast away const-ness here, + which will cause -Wcast-qual to burp. */ if ((ldptr = ldopen ((char *)prog_name, ldptr)) != NULL) { if (! MY_ISCOFF (HEADER (ldptr).f_magic)) diff --git a/contrib/gcc/collect2.h b/contrib/gcc/collect2.h index 2434f169be5..f85cf713abe 100644 --- a/contrib/gcc/collect2.h +++ b/contrib/gcc/collect2.h @@ -1,5 +1,5 @@ /* Header file for collect/tlink routines. - Copyright (C) 1998, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,31 +15,32 @@ for more details. 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. */ #ifndef GCC_COLLECT2_H #define GCC_COLLECT2_H extern void do_tlink (char **, char **); -extern void collect_execute (const char *, char **, const char *); +extern struct pex_obj *collect_execute (const char *, char **, const char *, + const char *); extern void collect_exit (int) ATTRIBUTE_NORETURN; -extern int collect_wait (const char *); +extern int collect_wait (const char *, struct pex_obj *); -extern void dump_file (const char *); +extern void dump_file (const char *, FILE *); extern int file_exists (const char *); extern const char *ldout; +extern const char *lderrout; extern const char *c_file_name; extern struct obstack temporary_obstack; extern char *temporary_firstobj; extern int vflag, debug; -extern void fancy_abort (void) ATTRIBUTE_NORETURN; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void notice (const char *, ...) ATTRIBUTE_PRINTF_1; extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; diff --git a/contrib/gcc/combine.c b/contrib/gcc/combine.c index 8f43c23eb18..512882e79d0 100644 --- a/contrib/gcc/combine.c +++ b/contrib/gcc/combine.c @@ -1,6 +1,6 @@ /* Optimize by combining instructions for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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 module is essentially the "combiner" phase of the U. of Arizona Portable Optimizer, but redone to work on our list-structured @@ -53,6 +53,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA flow.c aren't completely updated: - reg_live_length is not updated + - reg_n_refs is not adjusted in the rare case when a register is + no longer required in a computation + - there are extremely rare cases (see distribute_notes) when a + REG_DEAD note is lost - a LOG_LINKS entry that refers to an insn with multiple SETs may be removed because there is no way to know which register it was linking @@ -90,15 +94,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "real.h" #include "toplev.h" #include "target.h" +#include "optabs.h" +#include "insn-codes.h" +#include "rtlhooks-def.h" +/* Include output.h for dump_file. */ +#include "output.h" #include "params.h" - -#ifndef SHIFT_COUNT_TRUNCATED -#define SHIFT_COUNT_TRUNCATED 0 -#endif - -/* It is not safe to use ordinary gen_lowpart in combine. - Use gen_lowpart_for_combine instead. See comments there. */ -#define gen_lowpart dont_use_gen_lowpart_you_dummy +#include "timevar.h" +#include "tree-pass.h" /* Number of attempts to combine instructions in this function. */ @@ -120,6 +123,22 @@ static int combine_successes; static int total_attempts, total_merges, total_extras, total_successes; +/* combine_instructions may try to replace the right hand side of the + second instruction with the value of an associated REG_EQUAL note + before throwing it at try_combine. That is problematic when there + is a REG_DEAD note for a register used in the old right hand side + and can cause distribute_notes to do wrong things. This is the + second instruction if it has been so modified, null otherwise. */ + +static rtx i2mod; + +/* When I2MOD is nonnull, this is a copy of the old right hand side. */ + +static rtx i2mod_old_rhs; + +/* When I2MOD is nonnull, this is a copy of the new right hand side. */ + +static rtx i2mod_new_rhs; /* Vector mapping INSN_UIDs to cuids. The cuids are like uids but increase monotonically always. @@ -136,29 +155,120 @@ static int max_uid_cuid; #define INSN_CUID(INSN) \ (INSN_UID (INSN) > max_uid_cuid ? insn_cuid (INSN) : uid_cuid[INSN_UID (INSN)]) -/* In case BITS_PER_WORD == HOST_BITS_PER_WIDE_INT, shifting by - BITS_PER_WORD would invoke undefined behavior. Work around it. */ - -#define UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD(val) \ - (((unsigned HOST_WIDE_INT) (val) << (BITS_PER_WORD - 1)) << 1) - -#define nonzero_bits(X, M) \ - cached_nonzero_bits (X, M, NULL_RTX, VOIDmode, 0) - -#define num_sign_bit_copies(X, M) \ - cached_num_sign_bit_copies (X, M, NULL_RTX, VOIDmode, 0) - /* Maximum register number, which is the size of the tables below. */ static unsigned int combine_max_regno; -/* Record last point of death of (hard or pseudo) register n. */ +struct reg_stat { + /* Record last point of death of (hard or pseudo) register n. */ + rtx last_death; -static rtx *reg_last_death; + /* Record last point of modification of (hard or pseudo) register n. */ + rtx last_set; -/* Record last point of modification of (hard or pseudo) register n. */ + /* The next group of fields allows the recording of the last value assigned + to (hard or pseudo) register n. We use this information to see if an + operation being processed is redundant given a prior operation performed + on the register. For example, an `and' with a constant is redundant if + all the zero bits are already known to be turned off. -static rtx *reg_last_set; + We use an approach similar to that used by cse, but change it in the + following ways: + + (1) We do not want to reinitialize at each label. + (2) It is useful, but not critical, to know the actual value assigned + to a register. Often just its form is helpful. + + Therefore, we maintain the following fields: + + last_set_value the last value assigned + last_set_label records the value of label_tick when the + register was assigned + last_set_table_tick records the value of label_tick when a + value using the register is assigned + last_set_invalid set to nonzero when it is not valid + to use the value of this register in some + register's value + + To understand the usage of these tables, it is important to understand + the distinction between the value in last_set_value being valid and + the register being validly contained in some other expression in the + table. + + (The next two parameters are out of date). + + reg_stat[i].last_set_value is valid if it is nonzero, and either + reg_n_sets[i] is 1 or reg_stat[i].last_set_label == label_tick. + + Register I may validly appear in any expression returned for the value + of another register if reg_n_sets[i] is 1. It may also appear in the + value for register J if reg_stat[j].last_set_invalid is zero, or + reg_stat[i].last_set_label < reg_stat[j].last_set_label. + + If an expression is found in the table containing a register which may + not validly appear in an expression, the register is replaced by + something that won't match, (clobber (const_int 0)). */ + + /* Record last value assigned to (hard or pseudo) register n. */ + + rtx last_set_value; + + /* Record the value of label_tick when an expression involving register n + is placed in last_set_value. */ + + int last_set_table_tick; + + /* Record the value of label_tick when the value for register n is placed in + last_set_value. */ + + int last_set_label; + + /* These fields are maintained in parallel with last_set_value and are + used to store the mode in which the register was last set, the bits + that were known to be zero when it was last set, and the number of + sign bits copies it was known to have when it was last set. */ + + unsigned HOST_WIDE_INT last_set_nonzero_bits; + char last_set_sign_bit_copies; + ENUM_BITFIELD(machine_mode) last_set_mode : 8; + + /* Set nonzero if references to register n in expressions should not be + used. last_set_invalid is set nonzero when this register is being + assigned to and last_set_table_tick == label_tick. */ + + char last_set_invalid; + + /* Some registers that are set more than once and used in more than one + basic block are nevertheless always set in similar ways. For example, + a QImode register may be loaded from memory in two places on a machine + where byte loads zero extend. + + We record in the following fields if a register has some leading bits + that are always equal to the sign bit, and what we know about the + nonzero bits of a register, specifically which bits are known to be + zero. + + If an entry is zero, it means that we don't know anything special. */ + + unsigned char sign_bit_copies; + + unsigned HOST_WIDE_INT nonzero_bits; + + /* Record the value of the label_tick when the last truncation + happened. The field truncated_to_mode is only valid if + truncation_label == label_tick. */ + + int truncation_label; + + /* Record the last truncation seen for this register. If truncation + is not a nop to this mode we might be able to save an explicit + truncation if we know that value already contains a truncated + value. */ + + ENUM_BITFIELD(machine_mode) truncated_to_mode : 8; +}; + +static struct reg_stat *reg_stat; /* Record the cuid of the last insn that invalidated memory (anything that writes memory, and subroutine calls, but not pushes). */ @@ -206,121 +316,42 @@ static basic_block this_basic_block; those blocks as starting points. */ static sbitmap refresh_blocks; -/* The next group of arrays allows the recording of the last value assigned - to (hard or pseudo) register n. We use this information to see if an - operation being processed is redundant given a prior operation performed - on the register. For example, an `and' with a constant is redundant if - all the zero bits are already known to be turned off. +/* The following array records the insn_rtx_cost for every insn + in the instruction stream. */ - We use an approach similar to that used by cse, but change it in the - following ways: +static int *uid_insn_cost; - (1) We do not want to reinitialize at each label. - (2) It is useful, but not critical, to know the actual value assigned - to a register. Often just its form is helpful. +/* Length of the currently allocated uid_insn_cost array. */ - Therefore, we maintain the following arrays: - - reg_last_set_value the last value assigned - reg_last_set_label records the value of label_tick when the - register was assigned - reg_last_set_table_tick records the value of label_tick when a - value using the register is assigned - reg_last_set_invalid set to nonzero when it is not valid - to use the value of this register in some - register's value - - To understand the usage of these tables, it is important to understand - the distinction between the value in reg_last_set_value being valid - and the register being validly contained in some other expression in the - table. - - Entry I in reg_last_set_value is valid if it is nonzero, and either - reg_n_sets[i] is 1 or reg_last_set_label[i] == label_tick. - - Register I may validly appear in any expression returned for the value - of another register if reg_n_sets[i] is 1. It may also appear in the - value for register J if reg_last_set_label[i] < reg_last_set_label[j] or - reg_last_set_invalid[j] is zero. - - If an expression is found in the table containing a register which may - not validly appear in an expression, the register is replaced by - something that won't match, (clobber (const_int 0)). - - reg_last_set_invalid[i] is set nonzero when register I is being assigned - to and reg_last_set_table_tick[i] == label_tick. */ - -/* Record last value assigned to (hard or pseudo) register n. */ - -static rtx *reg_last_set_value; - -/* Record the value of label_tick when the value for register n is placed in - reg_last_set_value[n]. */ - -static int *reg_last_set_label; - -/* Record the value of label_tick when an expression involving register n - is placed in reg_last_set_value. */ - -static int *reg_last_set_table_tick; - -/* Set nonzero if references to register n in expressions should not be - used. */ - -static char *reg_last_set_invalid; +static int last_insn_cost; /* Incremented for each label. */ static int label_tick; -/* Some registers that are set more than once and used in more than one - basic block are nevertheless always set in similar ways. For example, - a QImode register may be loaded from memory in two places on a machine - where byte loads zero extend. - - We record in the following array what we know about the nonzero - bits of a register, specifically which bits are known to be zero. - - If an entry is zero, it means that we don't know anything special. */ - -static unsigned HOST_WIDE_INT *reg_nonzero_bits; - -/* Mode used to compute significance in reg_nonzero_bits. It is the largest - integer mode that can fit in HOST_BITS_PER_WIDE_INT. */ +/* Mode used to compute significance in reg_stat[].nonzero_bits. It is the + largest integer mode that can fit in HOST_BITS_PER_WIDE_INT. */ static enum machine_mode nonzero_bits_mode; -/* Nonzero if we know that a register has some leading bits that are always - equal to the sign bit. */ - -static unsigned char *reg_sign_bit_copies; - -/* Nonzero when reg_nonzero_bits and reg_sign_bit_copies can be safely used. - It is zero while computing them and after combine has completed. This - former test prevents propagating values based on previously set values, - which can be incorrect if a variable is modified in a loop. */ +/* Nonzero when reg_stat[].nonzero_bits and reg_stat[].sign_bit_copies can + be safely used. It is zero while computing them and after combine has + completed. This former test prevents propagating values based on + previously set values, which can be incorrect if a variable is modified + in a loop. */ static int nonzero_sign_valid; -/* These arrays are maintained in parallel with reg_last_set_value - and are used to store the mode in which the register was last set, - the bits that were known to be zero when it was last set, and the - number of sign bits copies it was known to have when it was last set. */ - -static enum machine_mode *reg_last_set_mode; -static unsigned HOST_WIDE_INT *reg_last_set_nonzero_bits; -static char *reg_last_set_sign_bit_copies; /* Record one modification to rtl structure - to be undone by storing old_contents into *where. - is_int is 1 if the contents are an int. */ + to be undone by storing old_contents into *where. */ struct undo { struct undo *next; - int is_int; - union {rtx r; int i;} old_contents; - union {rtx *r; int *i;} where; + enum { UNDO_RTX, UNDO_INT, UNDO_MODE } kind; + union { rtx r; int i; enum machine_mode m; } old_contents; + union { rtx *r; int *i; } where; }; /* Record a bunch of changes to be undone, up to MAX_UNDO of them. @@ -343,9 +374,16 @@ static struct undobuf undobuf; static int n_occurrences; +static rtx reg_nonzero_bits_for_combine (rtx, enum machine_mode, rtx, + enum machine_mode, + unsigned HOST_WIDE_INT, + unsigned HOST_WIDE_INT *); +static rtx reg_num_sign_bit_copies_for_combine (rtx, enum machine_mode, rtx, + enum machine_mode, + unsigned int, unsigned int *); static void do_SUBST (rtx *, rtx); static void do_SUBST_INT (int *, int); -static void init_reg_last_arrays (void); +static void init_reg_last (void); static void setup_incoming_promotions (void); static void set_nonzero_bits_and_sign_copies (rtx, rtx, void *); static int cant_combine_insn_p (rtx); @@ -357,10 +395,10 @@ static void undo_all (void); static void undo_commit (void); static rtx *find_split_point (rtx *, rtx); static rtx subst (rtx, rtx, rtx, int, int); -static rtx combine_simplify_rtx (rtx, enum machine_mode, int, int); +static rtx combine_simplify_rtx (rtx, enum machine_mode, int); static rtx simplify_if_then_else (rtx); static rtx simplify_set (rtx); -static rtx simplify_logical (rtx, int); +static rtx simplify_logical (rtx); static rtx expand_compound_operation (rtx); static rtx expand_field_assignment (rtx); static rtx make_extraction (enum machine_mode, rtx, HOST_WIDE_INT, @@ -369,37 +407,30 @@ static rtx extract_left_shift (rtx, int); static rtx make_compound_operation (rtx, enum rtx_code); static int get_pos_from_mask (unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT *); +static rtx canon_reg_for_combine (rtx, rtx); static rtx force_to_mode (rtx, enum machine_mode, - unsigned HOST_WIDE_INT, rtx, int); + unsigned HOST_WIDE_INT, int); static rtx if_then_else_cond (rtx, rtx *, rtx *); static rtx known_cond (rtx, enum rtx_code, rtx, rtx); static int rtx_equal_for_field_assignment_p (rtx, rtx); static rtx make_field_assignment (rtx); static rtx apply_distributive_law (rtx); +static rtx distribute_and_simplify_rtx (rtx, int); +static rtx simplify_and_const_int_1 (enum machine_mode, rtx, + unsigned HOST_WIDE_INT); static rtx simplify_and_const_int (rtx, enum machine_mode, rtx, unsigned HOST_WIDE_INT); -static unsigned HOST_WIDE_INT cached_nonzero_bits (rtx, enum machine_mode, - rtx, enum machine_mode, - unsigned HOST_WIDE_INT); -static unsigned HOST_WIDE_INT nonzero_bits1 (rtx, enum machine_mode, rtx, - enum machine_mode, - unsigned HOST_WIDE_INT); -static unsigned int cached_num_sign_bit_copies (rtx, enum machine_mode, rtx, - enum machine_mode, - unsigned int); -static unsigned int num_sign_bit_copies1 (rtx, enum machine_mode, rtx, - enum machine_mode, unsigned int); static int merge_outer_ops (enum rtx_code *, HOST_WIDE_INT *, enum rtx_code, HOST_WIDE_INT, enum machine_mode, int *); -static rtx simplify_shift_const (rtx, enum rtx_code, enum machine_mode, rtx, +static rtx simplify_shift_const_1 (enum rtx_code, enum machine_mode, rtx, int); +static rtx simplify_shift_const (rtx, enum rtx_code, enum machine_mode, rtx, int); static int recog_for_combine (rtx *, rtx, rtx *); static rtx gen_lowpart_for_combine (enum machine_mode, rtx); -static rtx gen_binary (enum rtx_code, enum machine_mode, rtx, rtx); static enum rtx_code simplify_comparison (enum rtx_code, rtx *, rtx *); static void update_table_tick (rtx); static void record_value_for_reg (rtx, rtx, rtx); -static void check_promoted_subreg (rtx, rtx); +static void check_conversions (rtx, rtx); static void record_dead_and_set_regs_1 (rtx, rtx, void *); static void record_dead_and_set_regs (rtx); static int get_last_value_validate (rtx *, rtx, int, int); @@ -409,13 +440,38 @@ static void reg_dead_at_p_1 (rtx, rtx, void *); static int reg_dead_at_p (rtx, rtx); static void move_deaths (rtx, rtx, int, rtx, rtx *); static int reg_bitfield_target_p (rtx, rtx); -static void distribute_notes (rtx, rtx, rtx, rtx); +static void distribute_notes (rtx, rtx, rtx, rtx, rtx, rtx); static void distribute_links (rtx); static void mark_used_regs_combine (rtx); static int insn_cuid (rtx); static void record_promoted_value (rtx, rtx); -static rtx reversed_comparison (rtx, enum machine_mode, rtx, rtx); -static enum rtx_code combine_reversed_comparison_code (rtx); +static int unmentioned_reg_p_1 (rtx *, void *); +static bool unmentioned_reg_p (rtx, rtx); +static void record_truncated_value (rtx); +static bool reg_truncated_to_mode (enum machine_mode, rtx); +static rtx gen_lowpart_or_truncate (enum machine_mode, rtx); + + +/* It is not safe to use ordinary gen_lowpart in combine. + See comments in gen_lowpart_for_combine. */ +#undef RTL_HOOKS_GEN_LOWPART +#define RTL_HOOKS_GEN_LOWPART gen_lowpart_for_combine + +/* Our implementation of gen_lowpart never emits a new pseudo. */ +#undef RTL_HOOKS_GEN_LOWPART_NO_EMIT +#define RTL_HOOKS_GEN_LOWPART_NO_EMIT gen_lowpart_for_combine + +#undef RTL_HOOKS_REG_NONZERO_REG_BITS +#define RTL_HOOKS_REG_NONZERO_REG_BITS reg_nonzero_bits_for_combine + +#undef RTL_HOOKS_REG_NUM_SIGN_BIT_COPIES +#define RTL_HOOKS_REG_NUM_SIGN_BIT_COPIES reg_num_sign_bit_copies_for_combine + +#undef RTL_HOOKS_REG_TRUNCATED_TO_MODE +#define RTL_HOOKS_REG_TRUNCATED_TO_MODE reg_truncated_to_mode + +static const struct rtl_hooks combine_rtl_hooks = RTL_HOOKS_INITIALIZER; + /* Substitute NEWVAL, an rtx expression, into INTO, a place in some insn. The substitution can be undone by undo_all. If INTO is already @@ -442,9 +498,8 @@ do_SUBST (rtx *into, rtx newval) { /* Sanity check that we're replacing oldval with a CONST_INT that is a valid sign-extension for the original mode. */ - if (INTVAL (newval) != trunc_int_for_mode (INTVAL (newval), - GET_MODE (oldval))) - abort (); + gcc_assert (INTVAL (newval) + == trunc_int_for_mode (INTVAL (newval), GET_MODE (oldval))); /* Replacing the operand of a SUBREG or a ZERO_EXTEND with a CONST_INT is not valid, because after the replacement, the @@ -452,19 +507,18 @@ do_SUBST (rtx *into, rtx newval) when do_SUBST is called to replace the operand thereof, so we perform this test on oldval instead, checking whether an invalid replacement took place before we got here. */ - if ((GET_CODE (oldval) == SUBREG - && GET_CODE (SUBREG_REG (oldval)) == CONST_INT) - || (GET_CODE (oldval) == ZERO_EXTEND - && GET_CODE (XEXP (oldval, 0)) == CONST_INT)) - abort (); + gcc_assert (!(GET_CODE (oldval) == SUBREG + && GET_CODE (SUBREG_REG (oldval)) == CONST_INT)); + gcc_assert (!(GET_CODE (oldval) == ZERO_EXTEND + && GET_CODE (XEXP (oldval, 0)) == CONST_INT)); } if (undobuf.frees) buf = undobuf.frees, undobuf.frees = buf->next; else - buf = xmalloc (sizeof (struct undo)); + buf = XNEW (struct undo); - buf->is_int = 0; + buf->kind = UNDO_RTX; buf->where.r = into; buf->old_contents.r = oldval; *into = newval; @@ -490,9 +544,9 @@ do_SUBST_INT (int *into, int newval) if (undobuf.frees) buf = undobuf.frees, undobuf.frees = buf->next; else - buf = xmalloc (sizeof (struct undo)); + buf = XNEW (struct undo); - buf->is_int = 1; + buf->kind = UNDO_INT; buf->where.i = into; buf->old_contents.i = oldval; *into = newval; @@ -501,13 +555,150 @@ do_SUBST_INT (int *into, int newval) } #define SUBST_INT(INTO, NEWVAL) do_SUBST_INT(&(INTO), (NEWVAL)) + +/* Similar to SUBST, but just substitute the mode. This is used when + changing the mode of a pseudo-register, so that any other + references to the entry in the regno_reg_rtx array will change as + well. */ + +static void +do_SUBST_MODE (rtx *into, enum machine_mode newval) +{ + struct undo *buf; + enum machine_mode oldval = GET_MODE (*into); + + if (oldval == newval) + return; + + if (undobuf.frees) + buf = undobuf.frees, undobuf.frees = buf->next; + else + buf = XNEW (struct undo); + + buf->kind = UNDO_MODE; + buf->where.r = into; + buf->old_contents.m = oldval; + PUT_MODE (*into, newval); + + buf->next = undobuf.undos, undobuf.undos = buf; +} + +#define SUBST_MODE(INTO, NEWVAL) do_SUBST_MODE(&(INTO), (NEWVAL)) + +/* Subroutine of try_combine. Determine whether the combine replacement + patterns NEWPAT and NEWI2PAT are cheaper according to insn_rtx_cost + that the original instruction sequence I1, I2 and I3. Note that I1 + and/or NEWI2PAT may be NULL_RTX. This function returns false, if the + costs of all instructions can be estimated, and the replacements are + more expensive than the original sequence. */ + +static bool +combine_validate_cost (rtx i1, rtx i2, rtx i3, rtx newpat, rtx newi2pat) +{ + int i1_cost, i2_cost, i3_cost; + int new_i2_cost, new_i3_cost; + int old_cost, new_cost; + + /* Lookup the original insn_rtx_costs. */ + i2_cost = INSN_UID (i2) <= last_insn_cost + ? uid_insn_cost[INSN_UID (i2)] : 0; + i3_cost = INSN_UID (i3) <= last_insn_cost + ? uid_insn_cost[INSN_UID (i3)] : 0; + + if (i1) + { + i1_cost = INSN_UID (i1) <= last_insn_cost + ? uid_insn_cost[INSN_UID (i1)] : 0; + old_cost = (i1_cost > 0 && i2_cost > 0 && i3_cost > 0) + ? i1_cost + i2_cost + i3_cost : 0; + } + else + { + old_cost = (i2_cost > 0 && i3_cost > 0) ? i2_cost + i3_cost : 0; + i1_cost = 0; + } + + /* Calculate the replacement insn_rtx_costs. */ + new_i3_cost = insn_rtx_cost (newpat); + if (newi2pat) + { + new_i2_cost = insn_rtx_cost (newi2pat); + new_cost = (new_i2_cost > 0 && new_i3_cost > 0) + ? new_i2_cost + new_i3_cost : 0; + } + else + { + new_cost = new_i3_cost; + new_i2_cost = 0; + } + + if (undobuf.other_insn) + { + int old_other_cost, new_other_cost; + + old_other_cost = (INSN_UID (undobuf.other_insn) <= last_insn_cost + ? uid_insn_cost[INSN_UID (undobuf.other_insn)] : 0); + new_other_cost = insn_rtx_cost (PATTERN (undobuf.other_insn)); + if (old_other_cost > 0 && new_other_cost > 0) + { + old_cost += old_other_cost; + new_cost += new_other_cost; + } + else + old_cost = 0; + } + + /* Disallow this recombination if both new_cost and old_cost are + greater than zero, and new_cost is greater than old cost. */ + if (old_cost > 0 + && new_cost > old_cost) + { + if (dump_file) + { + if (i1) + { + fprintf (dump_file, + "rejecting combination of insns %d, %d and %d\n", + INSN_UID (i1), INSN_UID (i2), INSN_UID (i3)); + fprintf (dump_file, "original costs %d + %d + %d = %d\n", + i1_cost, i2_cost, i3_cost, old_cost); + } + else + { + fprintf (dump_file, + "rejecting combination of insns %d and %d\n", + INSN_UID (i2), INSN_UID (i3)); + fprintf (dump_file, "original costs %d + %d = %d\n", + i2_cost, i3_cost, old_cost); + } + + if (newi2pat) + { + fprintf (dump_file, "replacement costs %d + %d = %d\n", + new_i2_cost, new_i3_cost, new_cost); + } + else + fprintf (dump_file, "replacement cost %d\n", new_cost); + } + + return false; + } + + /* Update the uid_insn_cost array with the replacement costs. */ + uid_insn_cost[INSN_UID (i2)] = new_i2_cost; + uid_insn_cost[INSN_UID (i3)] = new_i3_cost; + if (i1) + uid_insn_cost[INSN_UID (i1)] = 0; + + return true; +} /* Main entry point for combiner. F is the first insn of the function. NREGS is the first unused pseudo-reg number. Return nonzero if the combiner has turned an indirect jump instruction into a direct jump. */ -int +static int combine_instructions (rtx f, unsigned int nregs) { rtx insn, next; @@ -515,7 +706,9 @@ combine_instructions (rtx f, unsigned int nregs) rtx prev; #endif int i; + unsigned int j = 0; rtx links, nextlinks; + sbitmap_iterator sbi; int new_direct_jump_p = 0; @@ -526,20 +719,9 @@ combine_instructions (rtx f, unsigned int nregs) combine_max_regno = nregs; - reg_nonzero_bits = xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT)); - reg_sign_bit_copies = xcalloc (nregs, sizeof (unsigned char)); + rtl_hooks = combine_rtl_hooks; - reg_last_death = xmalloc (nregs * sizeof (rtx)); - reg_last_set = xmalloc (nregs * sizeof (rtx)); - reg_last_set_value = xmalloc (nregs * sizeof (rtx)); - reg_last_set_table_tick = xmalloc (nregs * sizeof (int)); - reg_last_set_label = xmalloc (nregs * sizeof (int)); - reg_last_set_invalid = xmalloc (nregs * sizeof (char)); - reg_last_set_mode = xmalloc (nregs * sizeof (enum machine_mode)); - reg_last_set_nonzero_bits = xmalloc (nregs * sizeof (HOST_WIDE_INT)); - reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char)); - - init_reg_last_arrays (); + reg_stat = XCNEWVEC (struct reg_stat, nregs); init_recog_no_volatile (); @@ -549,13 +731,13 @@ combine_instructions (rtx f, unsigned int nregs) if (INSN_UID (insn) > i) i = INSN_UID (insn); - uid_cuid = xmalloc ((i + 1) * sizeof (int)); + uid_cuid = XNEWVEC (int, i + 1); max_uid_cuid = i; nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0); - /* Don't use reg_nonzero_bits when computing it. This can cause problems - when, for example, we have j <<= 1 in a loop. */ + /* Don't use reg_stat[].nonzero_bits when computing it. This can cause + problems when, for example, we have j <<= 1 in a loop. */ nonzero_sign_valid = 0; @@ -577,6 +759,10 @@ combine_instructions (rtx f, unsigned int nregs) refresh_blocks = sbitmap_alloc (last_basic_block); sbitmap_zero (refresh_blocks); + /* Allocate array of current insn_rtx_costs. */ + uid_insn_cost = XCNEWVEC (int, max_uid_cuid + 1); + last_insn_cost = max_uid_cuid; + for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) { uid_cuid[INSN_UID (insn)] = ++i; @@ -595,9 +781,16 @@ combine_instructions (rtx f, unsigned int nregs) set_nonzero_bits_and_sign_copies (XEXP (links, 0), NULL_RTX, NULL); #endif + + /* Record the current insn_rtx_cost of this instruction. */ + if (NONJUMP_INSN_P (insn)) + uid_insn_cost[INSN_UID (insn)] = insn_rtx_cost (PATTERN (insn)); + if (dump_file) + fprintf(dump_file, "insn_cost %d: %d\n", + INSN_UID (insn), uid_insn_cost[INSN_UID (insn)]); } - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) label_tick++; } @@ -608,25 +801,25 @@ combine_instructions (rtx f, unsigned int nregs) label_tick = 1; last_call_cuid = 0; mem_last_set = 0; - init_reg_last_arrays (); + init_reg_last (); setup_incoming_promotions (); FOR_EACH_BB (this_basic_block) { for (insn = BB_HEAD (this_basic_block); - insn != NEXT_INSN (BB_END (this_basic_block)); + insn != NEXT_INSN (BB_END (this_basic_block)); insn = next ? next : NEXT_INSN (insn)) { next = 0; - if (GET_CODE (insn) == CODE_LABEL) + if (LABEL_P (insn)) label_tick++; else if (INSN_P (insn)) { /* See if we know about function return values before this insn based upon SUBREG flags. */ - check_promoted_subreg (insn, PATTERN (insn)); + check_conversions (insn, PATTERN (insn)); /* Try this insn with each insn it links back to. */ @@ -643,7 +836,7 @@ combine_instructions (rtx f, unsigned int nregs) /* If the linked insn has been replaced by a note, then there is no point in pursuing this chain any further. */ - if (GET_CODE (link) == NOTE) + if (NOTE_P (link)) continue; for (nextlinks = LOG_LINKS (link); @@ -663,9 +856,9 @@ combine_instructions (rtx f, unsigned int nregs) We need this special code because data flow connections via CC0 do not get entered in LOG_LINKS. */ - if (GET_CODE (insn) == JUMP_INSN + if (JUMP_P (insn) && (prev = prev_nonnote_insn (insn)) != 0 - && GET_CODE (prev) == INSN + && NONJUMP_INSN_P (prev) && sets_cc0_p (PATTERN (prev))) { if ((next = try_combine (insn, prev, @@ -681,9 +874,9 @@ combine_instructions (rtx f, unsigned int nregs) } /* Do the same for an insn that explicitly references CC0. */ - if (GET_CODE (insn) == INSN + if (NONJUMP_INSN_P (insn) && (prev = prev_nonnote_insn (insn)) != 0 - && GET_CODE (prev) == INSN + && NONJUMP_INSN_P (prev) && sets_cc0_p (PATTERN (prev)) && GET_CODE (PATTERN (insn)) == SET && reg_mentioned_p (cc0_rtx, SET_SRC (PATTERN (insn)))) @@ -704,11 +897,11 @@ combine_instructions (rtx f, unsigned int nregs) explicitly references CC0. If so, try this insn, that insn, and its predecessor if it sets CC0. */ for (links = LOG_LINKS (insn); links; links = XEXP (links, 1)) - if (GET_CODE (XEXP (links, 0)) == INSN + if (NONJUMP_INSN_P (XEXP (links, 0)) && GET_CODE (PATTERN (XEXP (links, 0))) == SET && reg_mentioned_p (cc0_rtx, SET_SRC (PATTERN (XEXP (links, 0)))) && (prev = prev_nonnote_insn (XEXP (links, 0))) != 0 - && GET_CODE (prev) == INSN + && NONJUMP_INSN_P (prev) && sets_cc0_p (PATTERN (prev)) && (next = try_combine (insn, XEXP (links, 0), prev, &new_direct_jump_p)) != 0) @@ -725,7 +918,39 @@ combine_instructions (rtx f, unsigned int nregs) &new_direct_jump_p)) != 0) goto retry; - if (GET_CODE (insn) != NOTE) + /* Try this insn with each REG_EQUAL note it links back to. */ + for (links = LOG_LINKS (insn); links; links = XEXP (links, 1)) + { + rtx set, note; + rtx temp = XEXP (links, 0); + if ((set = single_set (temp)) != 0 + && (note = find_reg_equal_equiv_note (temp)) != 0 + && (note = XEXP (note, 0), GET_CODE (note)) != EXPR_LIST + /* Avoid using a register that may already been marked + dead by an earlier instruction. */ + && ! unmentioned_reg_p (note, SET_SRC (set)) + && (GET_MODE (note) == VOIDmode + ? SCALAR_INT_MODE_P (GET_MODE (SET_DEST (set))) + : GET_MODE (SET_DEST (set)) == GET_MODE (note))) + { + /* Temporarily replace the set's source with the + contents of the REG_EQUAL note. The insn will + be deleted or recognized by try_combine. */ + rtx orig = SET_SRC (set); + SET_SRC (set) = note; + i2mod = temp; + i2mod_old_rhs = copy_rtx (orig); + i2mod_new_rhs = copy_rtx (note); + next = try_combine (insn, i2mod, NULL_RTX, + &new_direct_jump_p); + i2mod = NULL_RTX; + if (next) + goto retry; + SET_SRC (set) = orig; + } + } + + if (!NOTE_P (insn)) record_dead_and_set_regs (insn); retry: @@ -735,10 +960,10 @@ combine_instructions (rtx f, unsigned int nregs) } clear_bb_flags (); - EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i, - BASIC_BLOCK (i)->flags |= BB_DIRTY); - new_direct_jump_p |= purge_all_dead_edges (0); - delete_noop_moves (f); + EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, j, sbi) + BASIC_BLOCK (j)->flags |= BB_DIRTY; + new_direct_jump_p |= purge_all_dead_edges (); + delete_noop_moves (); update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE @@ -746,17 +971,8 @@ combine_instructions (rtx f, unsigned int nregs) /* Clean up. */ sbitmap_free (refresh_blocks); - free (reg_nonzero_bits); - free (reg_sign_bit_copies); - free (reg_last_death); - free (reg_last_set); - free (reg_last_set_value); - free (reg_last_set_table_tick); - free (reg_last_set_label); - free (reg_last_set_invalid); - free (reg_last_set_mode); - free (reg_last_set_nonzero_bits); - free (reg_last_set_sign_bit_copies); + free (uid_insn_cost); + free (reg_stat); free (uid_cuid); { @@ -775,6 +991,7 @@ combine_instructions (rtx f, unsigned int nregs) total_successes += combine_successes; nonzero_sign_valid = 0; + rtl_hooks = general_rtl_hooks; /* Make recognizer allow volatile MEMs again. */ init_recog (); @@ -782,22 +999,14 @@ combine_instructions (rtx f, unsigned int nregs) return new_direct_jump_p; } -/* Wipe the reg_last_xxx arrays in preparation for another pass. */ +/* Wipe the last_xxx fields of reg_stat in preparation for another pass. */ static void -init_reg_last_arrays (void) +init_reg_last (void) { - unsigned int nregs = combine_max_regno; - - memset (reg_last_death, 0, nregs * sizeof (rtx)); - memset (reg_last_set, 0, nregs * sizeof (rtx)); - memset (reg_last_set_value, 0, nregs * sizeof (rtx)); - memset (reg_last_set_table_tick, 0, nregs * sizeof (int)); - memset (reg_last_set_label, 0, nregs * sizeof (int)); - memset (reg_last_set_invalid, 0, nregs * sizeof (char)); - memset (reg_last_set_mode, 0, nregs * sizeof (enum machine_mode)); - memset (reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT)); - memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char)); + unsigned int i; + for (i = 0; i < combine_max_regno; i++) + memset (reg_stat + i, 0, offsetof (struct reg_stat, sign_bit_copies)); } /* Set up any promoted values for incoming argument registers. */ @@ -813,9 +1022,6 @@ setup_incoming_promotions (void) if (targetm.calls.promote_function_args (TREE_TYPE (cfun->decl))) { -#ifndef OUTGOING_REGNO -#define OUTGOING_REGNO(N) N -#endif for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) /* Check whether this register can hold an incoming pointer argument. FUNCTION_ARG_REGNO_P tests outgoing register @@ -849,17 +1055,18 @@ set_nonzero_bits_and_sign_copies (rtx x, rtx set, { unsigned int num; - if (GET_CODE (x) == REG + if (REG_P (x) && REGNO (x) >= FIRST_PSEUDO_REGISTER /* If this register is undefined at the start of the file, we can't say what its contents were. */ - && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, REGNO (x)) + && ! REGNO_REG_SET_P + (ENTRY_BLOCK_PTR->next_bb->il.rtl->global_live_at_start, REGNO (x)) && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT) { if (set == 0 || GET_CODE (set) == CLOBBER) { - reg_nonzero_bits[REGNO (x)] = GET_MODE_MASK (GET_MODE (x)); - reg_sign_bit_copies[REGNO (x)] = 1; + reg_stat[REGNO (x)].nonzero_bits = GET_MODE_MASK (GET_MODE (x)); + reg_stat[REGNO (x)].sign_bit_copies = 1; return; } @@ -881,7 +1088,7 @@ set_nonzero_bits_and_sign_copies (rtx x, rtx set, #ifdef SHORT_IMMEDIATES_SIGN_EXTEND /* If X is narrower than a word and SRC is a non-negative constant that would appear negative in the mode of X, - sign-extend it for use in reg_nonzero_bits because some + sign-extend it for use in reg_stat[].nonzero_bits because some machines (maybe most) will actually do the sign-extension and this is the conservative approach. @@ -900,18 +1107,18 @@ set_nonzero_bits_and_sign_copies (rtx x, rtx set, #endif /* Don't call nonzero_bits if it cannot change anything. */ - if (reg_nonzero_bits[REGNO (x)] != ~(unsigned HOST_WIDE_INT) 0) - reg_nonzero_bits[REGNO (x)] + if (reg_stat[REGNO (x)].nonzero_bits != ~(unsigned HOST_WIDE_INT) 0) + reg_stat[REGNO (x)].nonzero_bits |= nonzero_bits (src, nonzero_bits_mode); num = num_sign_bit_copies (SET_SRC (set), GET_MODE (x)); - if (reg_sign_bit_copies[REGNO (x)] == 0 - || reg_sign_bit_copies[REGNO (x)] > num) - reg_sign_bit_copies[REGNO (x)] = num; + if (reg_stat[REGNO (x)].sign_bit_copies == 0 + || reg_stat[REGNO (x)].sign_bit_copies > num) + reg_stat[REGNO (x)].sign_bit_copies = num; } else { - reg_nonzero_bits[REGNO (x)] = GET_MODE_MASK (GET_MODE (x)); - reg_sign_bit_copies[REGNO (x)] = 1; + reg_stat[REGNO (x)].nonzero_bits = GET_MODE_MASK (GET_MODE (x)); + reg_stat[REGNO (x)].sign_bit_copies = 1; } } } @@ -983,7 +1190,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, something to tell them apart, e.g. different modes. For now, we forgo such complicated tests and simply disallow combining of USES of pseudo registers with any other USE. */ - if (GET_CODE (XEXP (elt, 0)) == REG + if (REG_P (XEXP (elt, 0)) && GET_CODE (PATTERN (i3)) == PARALLEL) { rtx i3pat = PATTERN (i3); @@ -995,7 +1202,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, rtx i3elt = XVECEXP (i3pat, 0, i); if (GET_CODE (i3elt) == USE - && GET_CODE (XEXP (i3elt, 0)) == REG + && REG_P (XEXP (i3elt, 0)) && (REGNO (XEXP (i3elt, 0)) == regno ? reg_set_between_p (XEXP (elt, 0), PREV_INSN (insn), i3) @@ -1058,14 +1265,16 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, /* Can't merge a function call. */ || GET_CODE (src) == CALL /* Don't eliminate a function call argument. */ - || (GET_CODE (i3) == CALL_INSN + || (CALL_P (i3) && (find_reg_fusage (i3, USE, dest) - || (GET_CODE (dest) == REG + || (REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER && global_regs[REGNO (dest)]))) /* Don't substitute into an incremented register. */ || FIND_REG_INC_NOTE (i3, dest) || (succ && FIND_REG_INC_NOTE (succ, dest)) + /* Don't substitute into a non-local goto, this confuses CFG. */ + || (JUMP_P (i3) && find_reg_note (i3, REG_NON_LOCAL_GOTO, NULL_RTX)) #if 0 /* Don't combine the end of a libcall into anything. */ /* ??? This gives worse code, and appears to be unnecessary, since no @@ -1081,13 +1290,13 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, does not use any registers whose values alter in between. However, If the insns are adjacent, a use can't cross a set even though we think it might (this can happen for a sequence of insns each setting - the same destination; reg_last_set of that register might point to + the same destination; last_set of that register might point to a NOTE). If INSN has a REG_EQUIV note, the register is always equivalent to the memory so the substitution is valid even if there are intervening stores. Also, don't move a volatile asm or UNSPEC_VOLATILE across any other insns. */ || (! all_adjacent - && (((GET_CODE (src) != MEM + && (((!MEM_P (src) || ! find_reg_note (insn, REG_EQUIV, src)) && use_crosses_set_p (src, INSN_CUID (insn))) || (GET_CODE (src) == ASM_OPERANDS && MEM_VOLATILE_P (src)) @@ -1105,7 +1314,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, return 0; /* DEST must either be a REG or CC0. */ - if (GET_CODE (dest) == REG) + if (REG_P (dest)) { /* If register alignment is being enforced for multi-word items in all cases except for parameters, it is possible to have a register copy @@ -1116,7 +1325,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, Also, on some machines we don't want to extend the life of a hard register. */ - if (GET_CODE (src) == REG + if (REG_P (src) && ((REGNO (dest) < FIRST_PSEUDO_REGISTER && ! HARD_REGNO_MODE_OK (REGNO (dest), GET_MODE (dest))) /* Don't extend the life of a hard register unless it is @@ -1133,16 +1342,30 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, else if (GET_CODE (dest) != CC0) return 0; - /* Don't substitute for a register intended as a clobberable operand. - Similarly, don't substitute an expression containing a register that - will be clobbered in I3. */ + if (GET_CODE (PATTERN (i3)) == PARALLEL) for (i = XVECLEN (PATTERN (i3), 0) - 1; i >= 0; i--) - if (GET_CODE (XVECEXP (PATTERN (i3), 0, i)) == CLOBBER - && (reg_overlap_mentioned_p (XEXP (XVECEXP (PATTERN (i3), 0, i), 0), - src) - || rtx_equal_p (XEXP (XVECEXP (PATTERN (i3), 0, i), 0), dest))) - return 0; + if (GET_CODE (XVECEXP (PATTERN (i3), 0, i)) == CLOBBER) + { + /* Don't substitute for a register intended as a clobberable + operand. */ + rtx reg = XEXP (XVECEXP (PATTERN (i3), 0, i), 0); + if (rtx_equal_p (reg, dest)) + return 0; + + /* If the clobber represents an earlyclobber operand, we must not + substitute an expression containing the clobbered register. + As we do not analyze the constraint strings here, we have to + make the conservative assumption. However, if the register is + a fixed hard reg, the clobber cannot represent any operand; + we leave it up to the machine description to either accept or + reject use-and-clobber patterns. */ + if (!REG_P (reg) + || REGNO (reg) >= FIRST_PSEUDO_REGISTER + || !fixed_regs[REGNO (reg)]) + if (reg_overlap_mentioned_p (reg, src)) + return 0; + } /* If INSN contains anything volatile, or is an `asm' (whether volatile or not), reject, unless nothing volatile comes between it and I3 */ @@ -1151,10 +1374,10 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, { /* Make sure succ doesn't contain a volatile reference. */ if (succ != 0 && volatile_refs_p (PATTERN (succ))) - return 0; + return 0; for (p = NEXT_INSN (insn); p != i3; p = NEXT_INSN (p)) - if (INSN_P (p) && p != succ && volatile_refs_p (PATTERN (p))) + if (INSN_P (p) && p != succ && volatile_refs_p (PATTERN (p))) return 0; } @@ -1162,7 +1385,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, to be an explicit register variable, and was chosen for a reason. */ if (GET_CODE (src) == ASM_OPERANDS - && GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER) + && REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER) return 0; /* If there are any volatile insns between INSN and I3, reject, because @@ -1172,17 +1395,21 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, if (INSN_P (p) && p != succ && volatile_insn_p (PATTERN (p))) return 0; - /* If INSN or I2 contains an autoincrement or autodecrement, - make sure that register is not used between there and I3, - and not already used in I3 either. + /* If INSN contains an autoincrement or autodecrement, make sure that + register is not used between there and I3, and not already used in + I3 either. Neither must it be used in PRED or SUCC, if they exist. Also insist that I3 not be a jump; if it were one and the incremented register were spilled, we would lose. */ #ifdef AUTO_INC_DEC for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) if (REG_NOTE_KIND (link) == REG_INC - && (GET_CODE (i3) == JUMP_INSN + && (JUMP_P (i3) || reg_used_between_p (XEXP (link, 0), insn, i3) + || (pred != NULL_RTX + && reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (pred))) + || (succ != NULL_RTX + && reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (succ))) || reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (i3)))) return 0; #endif @@ -1198,7 +1425,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, but that would be much slower, and this ought to be equivalent. */ p = prev_nonnote_insn (insn); - if (p && p != pred && GET_CODE (p) == INSN && sets_cc0_p (PATTERN (p)) + if (p && p != pred && NONJUMP_INSN_P (p) && sets_cc0_p (PATTERN (p)) && ! all_adjacent) return 0; #endif @@ -1221,12 +1448,12 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, Consider: - (set (reg:DI 101) (reg:DI 100)) + (set (reg:DI 101) (reg:DI 100)) (set (subreg:SI (reg:DI 101) 0) ) This is NOT equivalent to: - (parallel [(set (subreg:SI (reg:DI 100) 0) ) + (parallel [(set (subreg:SI (reg:DI 100) 0) ) (set (reg:DI 101) (reg:DI 100))]) Not only does this modify 100 (in which case it might still be valid @@ -1261,6 +1488,7 @@ combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest, rtx dest = SET_DEST (set); rtx src = SET_SRC (set); rtx inner_dest = dest; + rtx subdest; while (GET_CODE (inner_dest) == STRICT_LOW_PART || GET_CODE (inner_dest) == SUBREG @@ -1272,7 +1500,7 @@ combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest, into the address of a MEM, so only prevent the combination if i1 or i2 set the same MEM. */ if ((inner_dest != dest && - (GET_CODE (inner_dest) != MEM + (!MEM_P (inner_dest) || rtx_equal_p (i2dest, inner_dest) || (i1dest && rtx_equal_p (i1dest, inner_dest))) && (reg_overlap_mentioned_p (i2dest, inner_dest) @@ -1288,34 +1516,42 @@ combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest, function argument; the all_adjacent test in can_combine_p also checks this; here, we do a more specific test for this case. */ - || (GET_CODE (inner_dest) == REG + || (REG_P (inner_dest) && REGNO (inner_dest) < FIRST_PSEUDO_REGISTER && (! HARD_REGNO_MODE_OK (REGNO (inner_dest), GET_MODE (inner_dest)))) || (i1_not_in_src && reg_overlap_mentioned_p (i1dest, src))) return 0; - /* If DEST is used in I3, it is being killed in this insn, - so record that for later. + /* If DEST is used in I3, it is being killed in this insn, so + record that for later. We have to consider paradoxical + subregs here, since they kill the whole register, but we + ignore partial subregs, STRICT_LOW_PART, etc. Never add REG_DEAD notes for the FRAME_POINTER_REGNUM or the STACK_POINTER_REGNUM, since these are always considered to be live. Similarly for ARG_POINTER_REGNUM if it is fixed. */ - if (pi3dest_killed && GET_CODE (dest) == REG - && reg_referenced_p (dest, PATTERN (i3)) - && REGNO (dest) != FRAME_POINTER_REGNUM + subdest = dest; + if (GET_CODE (subdest) == SUBREG + && (GET_MODE_SIZE (GET_MODE (subdest)) + >= GET_MODE_SIZE (GET_MODE (SUBREG_REG (subdest))))) + subdest = SUBREG_REG (subdest); + if (pi3dest_killed + && REG_P (subdest) + && reg_referenced_p (subdest, PATTERN (i3)) + && REGNO (subdest) != FRAME_POINTER_REGNUM #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - && REGNO (dest) != HARD_FRAME_POINTER_REGNUM + && REGNO (subdest) != HARD_FRAME_POINTER_REGNUM #endif #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM - && (REGNO (dest) != ARG_POINTER_REGNUM - || ! fixed_regs [REGNO (dest)]) + && (REGNO (subdest) != ARG_POINTER_REGNUM + || ! fixed_regs [REGNO (subdest)]) #endif - && REGNO (dest) != STACK_POINTER_REGNUM) + && REGNO (subdest) != STACK_POINTER_REGNUM) { if (*pi3dest_killed) return 0; - *pi3dest_killed = dest; + *pi3dest_killed = subdest; } } @@ -1347,18 +1583,14 @@ contains_muldiv (rtx x) return ! (GET_CODE (XEXP (x, 1)) == CONST_INT && exact_log2 (INTVAL (XEXP (x, 1))) >= 0); default: - switch (GET_RTX_CLASS (GET_CODE (x))) - { - case 'c': case '<': case '2': - return contains_muldiv (XEXP (x, 0)) + if (BINARY_P (x)) + return contains_muldiv (XEXP (x, 0)) || contains_muldiv (XEXP (x, 1)); - case '1': - return contains_muldiv (XEXP (x, 0)); + if (UNARY_P (x)) + return contains_muldiv (XEXP (x, 0)); - default: - return 0; - } + return 0; } } @@ -1381,7 +1613,7 @@ cant_combine_insn_p (rtx insn) /* Never combine loads and stores involving hard regs that are likely to be spilled. The register allocator can usually handle such reg-reg moves by tying. If we allow the combiner to make - substitutions of likely-spilled regs, we may abort in reload. + substitutions of likely-spilled regs, reload might die. As an exception, we allow combinations involving fixed regs; these are not available to the register allocator so there's no risk involved. */ @@ -1406,6 +1638,85 @@ cant_combine_insn_p (rtx insn) return 0; } +struct likely_spilled_retval_info +{ + unsigned regno, nregs; + unsigned mask; +}; + +/* Called via note_stores by likely_spilled_retval_p. Remove from info->mask + hard registers that are known to be written to / clobbered in full. */ +static void +likely_spilled_retval_1 (rtx x, rtx set, void *data) +{ + struct likely_spilled_retval_info *info = data; + unsigned regno, nregs; + unsigned new_mask; + + if (!REG_P (XEXP (set, 0))) + return; + regno = REGNO (x); + if (regno >= info->regno + info->nregs) + return; + nregs = hard_regno_nregs[regno][GET_MODE (x)]; + if (regno + nregs <= info->regno) + return; + new_mask = (2U << (nregs - 1)) - 1; + if (regno < info->regno) + new_mask >>= info->regno - regno; + else + new_mask <<= regno - info->regno; + info->mask &= new_mask; +} + +/* Return nonzero iff part of the return value is live during INSN, and + it is likely spilled. This can happen when more than one insn is needed + to copy the return value, e.g. when we consider to combine into the + second copy insn for a complex value. */ + +static int +likely_spilled_retval_p (rtx insn) +{ + rtx use = BB_END (this_basic_block); + rtx reg, p; + unsigned regno, nregs; + /* We assume here that no machine mode needs more than + 32 hard registers when the value overlaps with a register + for which FUNCTION_VALUE_REGNO_P is true. */ + unsigned mask; + struct likely_spilled_retval_info info; + + if (!NONJUMP_INSN_P (use) || GET_CODE (PATTERN (use)) != USE || insn == use) + return 0; + reg = XEXP (PATTERN (use), 0); + if (!REG_P (reg) || !FUNCTION_VALUE_REGNO_P (REGNO (reg))) + return 0; + regno = REGNO (reg); + nregs = hard_regno_nregs[regno][GET_MODE (reg)]; + if (nregs == 1) + return 0; + mask = (2U << (nregs - 1)) - 1; + + /* Disregard parts of the return value that are set later. */ + info.regno = regno; + info.nregs = nregs; + info.mask = mask; + for (p = PREV_INSN (use); info.mask && p != insn; p = PREV_INSN (p)) + note_stores (PATTERN (insn), likely_spilled_retval_1, &info); + mask = info.mask; + + /* Check if any of the (probably) live return value registers is + likely spilled. */ + nregs --; + do + { + if ((mask & 1 << nregs) + && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno + nregs))) + return 1; + } while (nregs--); + return 0; +} + /* Adjust INSN after we made a change to its destination. Changing the destination can invalidate notes that say something about @@ -1433,6 +1744,50 @@ adjust_for_new_dest (rtx insn) distribute_links (gen_rtx_INSN_LIST (VOIDmode, insn, NULL_RTX)); } +/* Return TRUE if combine can reuse reg X in mode MODE. + ADDED_SETS is nonzero if the original set is still required. */ +static bool +can_change_dest_mode (rtx x, int added_sets, enum machine_mode mode) +{ + unsigned int regno; + + if (!REG_P(x)) + return false; + + regno = REGNO (x); + /* Allow hard registers if the new mode is legal, and occupies no more + registers than the old mode. */ + if (regno < FIRST_PSEUDO_REGISTER) + return (HARD_REGNO_MODE_OK (regno, mode) + && (hard_regno_nregs[regno][GET_MODE (x)] + >= hard_regno_nregs[regno][mode])); + + /* Or a pseudo that is only used once. */ + return (REG_N_SETS (regno) == 1 && !added_sets + && !REG_USERVAR_P (x)); +} + + +/* Check whether X, the destination of a set, refers to part of + the register specified by REG. */ + +static bool +reg_subword_p (rtx x, rtx reg) +{ + /* Check that reg is an integer mode register. */ + if (!REG_P (reg) || GET_MODE_CLASS (GET_MODE (reg)) != MODE_INT) + return false; + + if (GET_CODE (x) == STRICT_LOW_PART + || GET_CODE (x) == ZERO_EXTRACT) + x = XEXP (x, 0); + + return GET_CODE (x) == SUBREG + && SUBREG_REG (x) == reg + && GET_MODE_CLASS (GET_MODE (x)) == MODE_INT; +} + + /* Try to combine the insns I1 and I2 into I3. Here I1 and I2 appear earlier than I3. I1 can be zero; then we combine just I2 into I3. @@ -1454,12 +1809,13 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) { /* New patterns for I3 and I2, respectively. */ rtx newpat, newi2pat = 0; + rtvec newpat_vec_with_clobbers = 0; int substed_i2 = 0, substed_i1 = 0; /* Indicates need to preserve SET in I1 or I2 in I3 if it is not dead. */ int added_sets_1, added_sets_2; /* Total number of SETs to put into I3. */ int total_sets; - /* Nonzero is I2's body now appears in I3. */ + /* Nonzero if I2's body now appears in I3. */ int i2_is_used; /* INSN_CODEs for new I3, new I2, and user of condition code. */ int insn_code_number, i2_code_number = 0, other_code_number = 0; @@ -1469,10 +1825,11 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx i3dest_killed = 0; /* SET_DEST and SET_SRC of I2 and I1. */ rtx i2dest, i2src, i1dest = 0, i1src = 0; - /* PATTERN (I2), or a copy of it in certain cases. */ - rtx i2pat; + /* PATTERN (I1) and PATTERN (I2), or a copy of it in certain cases. */ + rtx i1pat = 0, i2pat = 0; /* Indicates if I2DEST or I1DEST is in I2SRC or I1_SRC. */ int i2dest_in_i2src = 0, i1dest_in_i1src = 0, i2dest_in_i1src = 0; + int i2dest_killed = 0, i1dest_killed = 0; int i1_feeds_i3 = 0; /* Notes that must be added to REG_NOTES in I3 and I2. */ rtx new_i3_notes, new_i2_notes; @@ -1480,6 +1837,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) int i3_subst_into_i2 = 0; /* Notes that I1, I2 or I3 is a MULT operation. */ int have_mult = 0; + int swap_i2i3 = 0; int maxreg; rtx temp; @@ -1491,6 +1849,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (cant_combine_insn_p (i3) || cant_combine_insn_p (i2) || (i1 && cant_combine_insn_p (i1)) + || likely_spilled_retval_p (i3) /* We also can't do anything if I3 has a REG_LIBCALL note since we don't want to disrupt the contiguity of a libcall. */ @@ -1531,8 +1890,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) where I2 and I3 are adjacent to avoid making difficult register usage tests. */ - if (i1 == 0 && GET_CODE (i3) == INSN && GET_CODE (PATTERN (i3)) == SET - && GET_CODE (SET_SRC (PATTERN (i3))) == REG + if (i1 == 0 && NONJUMP_INSN_P (i3) && GET_CODE (PATTERN (i3)) == SET + && REG_P (SET_SRC (PATTERN (i3))) && REGNO (SET_SRC (PATTERN (i3))) >= FIRST_PSEUDO_REGISTER && find_reg_note (i3, REG_DEAD, SET_SRC (PATTERN (i3))) && GET_CODE (PATTERN (i2)) == PARALLEL @@ -1579,6 +1938,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) added_sets_2 = added_sets_1 = 0; i2dest = SET_SRC (PATTERN (i3)); + i2dest_killed = dead_or_set_p (i2, i2dest); /* Replace the dest in I2 with our dest and make the resulting insn the new pattern for I3. Then skip to where we @@ -1592,74 +1952,138 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } } - /* If I2 is setting a double-word pseudo to a constant and I3 is setting - one of those words to another constant, merge them by making a new + /* If I2 is setting a pseudo to a constant and I3 is setting some + sub-part of it to another constant, merge them by making a new constant. */ if (i1 == 0 && (temp = single_set (i2)) != 0 && (GET_CODE (SET_SRC (temp)) == CONST_INT || GET_CODE (SET_SRC (temp)) == CONST_DOUBLE) - && GET_CODE (SET_DEST (temp)) == REG - && GET_MODE_CLASS (GET_MODE (SET_DEST (temp))) == MODE_INT - && GET_MODE_SIZE (GET_MODE (SET_DEST (temp))) == 2 * UNITS_PER_WORD && GET_CODE (PATTERN (i3)) == SET - && GET_CODE (SET_DEST (PATTERN (i3))) == SUBREG - && SUBREG_REG (SET_DEST (PATTERN (i3))) == SET_DEST (temp) - && GET_MODE_CLASS (GET_MODE (SET_DEST (PATTERN (i3)))) == MODE_INT - && GET_MODE_SIZE (GET_MODE (SET_DEST (PATTERN (i3)))) == UNITS_PER_WORD - && GET_CODE (SET_SRC (PATTERN (i3))) == CONST_INT) + && (GET_CODE (SET_SRC (PATTERN (i3))) == CONST_INT + || GET_CODE (SET_SRC (PATTERN (i3))) == CONST_DOUBLE) + && reg_subword_p (SET_DEST (PATTERN (i3)), SET_DEST (temp))) { - HOST_WIDE_INT lo, hi; + rtx dest = SET_DEST (PATTERN (i3)); + int offset = -1; + int width = 0; - if (GET_CODE (SET_SRC (temp)) == CONST_INT) - lo = INTVAL (SET_SRC (temp)), hi = lo < 0 ? -1 : 0; - else + if (GET_CODE (dest) == ZERO_EXTRACT) { - lo = CONST_DOUBLE_LOW (SET_SRC (temp)); - hi = CONST_DOUBLE_HIGH (SET_SRC (temp)); - } - - if (subreg_lowpart_p (SET_DEST (PATTERN (i3)))) - { - /* We don't handle the case of the target word being wider - than a host wide int. */ - if (HOST_BITS_PER_WIDE_INT < BITS_PER_WORD) - abort (); - - lo &= ~(UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1); - lo |= (INTVAL (SET_SRC (PATTERN (i3))) - & (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1)); - } - else if (HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) - hi = INTVAL (SET_SRC (PATTERN (i3))); - else if (HOST_BITS_PER_WIDE_INT >= 2 * BITS_PER_WORD) - { - int sign = -(int) ((unsigned HOST_WIDE_INT) lo - >> (HOST_BITS_PER_WIDE_INT - 1)); - - lo &= ~ (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD - (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1)); - lo |= (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD - (INTVAL (SET_SRC (PATTERN (i3))))); - if (hi == sign) - hi = lo < 0 ? -1 : 0; + if (GET_CODE (XEXP (dest, 1)) == CONST_INT + && GET_CODE (XEXP (dest, 2)) == CONST_INT) + { + width = INTVAL (XEXP (dest, 1)); + offset = INTVAL (XEXP (dest, 2)); + dest = XEXP (dest, 0); + if (BITS_BIG_ENDIAN) + offset = GET_MODE_BITSIZE (GET_MODE (dest)) - width - offset; + } } else - /* We don't handle the case of the higher word not fitting - entirely in either hi or lo. */ - abort (); + { + if (GET_CODE (dest) == STRICT_LOW_PART) + dest = XEXP (dest, 0); + width = GET_MODE_BITSIZE (GET_MODE (dest)); + offset = 0; + } - combine_merges++; - subst_insn = i3; - subst_low_cuid = INSN_CUID (i2); - added_sets_2 = added_sets_1 = 0; - i2dest = SET_DEST (temp); + if (offset >= 0) + { + /* If this is the low part, we're done. */ + if (subreg_lowpart_p (dest)) + ; + /* Handle the case where inner is twice the size of outer. */ + else if (GET_MODE_BITSIZE (GET_MODE (SET_DEST (temp))) + == 2 * GET_MODE_BITSIZE (GET_MODE (dest))) + offset += GET_MODE_BITSIZE (GET_MODE (dest)); + /* Otherwise give up for now. */ + else + offset = -1; + } - SUBST (SET_SRC (temp), - immed_double_const (lo, hi, GET_MODE (SET_DEST (temp)))); + if (offset >= 0) + { + HOST_WIDE_INT mhi, ohi, ihi; + HOST_WIDE_INT mlo, olo, ilo; + rtx inner = SET_SRC (PATTERN (i3)); + rtx outer = SET_SRC (temp); - newpat = PATTERN (i2); - goto validate_replacement; + if (GET_CODE (outer) == CONST_INT) + { + olo = INTVAL (outer); + ohi = olo < 0 ? -1 : 0; + } + else + { + olo = CONST_DOUBLE_LOW (outer); + ohi = CONST_DOUBLE_HIGH (outer); + } + + if (GET_CODE (inner) == CONST_INT) + { + ilo = INTVAL (inner); + ihi = ilo < 0 ? -1 : 0; + } + else + { + ilo = CONST_DOUBLE_LOW (inner); + ihi = CONST_DOUBLE_HIGH (inner); + } + + if (width < HOST_BITS_PER_WIDE_INT) + { + mlo = ((unsigned HOST_WIDE_INT) 1 << width) - 1; + mhi = 0; + } + else if (width < HOST_BITS_PER_WIDE_INT * 2) + { + mhi = ((unsigned HOST_WIDE_INT) 1 + << (width - HOST_BITS_PER_WIDE_INT)) - 1; + mlo = -1; + } + else + { + mlo = -1; + mhi = -1; + } + + ilo &= mlo; + ihi &= mhi; + + if (offset >= HOST_BITS_PER_WIDE_INT) + { + mhi = mlo << (offset - HOST_BITS_PER_WIDE_INT); + mlo = 0; + ihi = ilo << (offset - HOST_BITS_PER_WIDE_INT); + ilo = 0; + } + else if (offset > 0) + { + mhi = (mhi << offset) | ((unsigned HOST_WIDE_INT) mlo + >> (HOST_BITS_PER_WIDE_INT - offset)); + mlo = mlo << offset; + ihi = (ihi << offset) | ((unsigned HOST_WIDE_INT) ilo + >> (HOST_BITS_PER_WIDE_INT - offset)); + ilo = ilo << offset; + } + + olo = (olo & ~mlo) | ilo; + ohi = (ohi & ~mhi) | ihi; + + combine_merges++; + subst_insn = i3; + subst_low_cuid = INSN_CUID (i2); + added_sets_2 = added_sets_1 = 0; + i2dest = SET_DEST (temp); + i2dest_killed = dead_or_set_p (i2, i2dest); + + SUBST (SET_SRC (temp), + immed_double_const (olo, ohi, GET_MODE (SET_DEST (temp)))); + + newpat = PATTERN (i2); + goto validate_replacement; + } } #ifndef HAVE_cc0 @@ -1669,7 +2093,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) make up a dummy I1 that is (set Y OP) and change I2 to be - (set (reg:CC X) (compare:CC Y (const_int 0))) + (set (reg:CC X) (compare:CC Y (const_int 0))) (We can ignore any trailing CLOBBERs.) @@ -1684,7 +2108,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) && GET_CODE (SET_SRC (XVECEXP (PATTERN (i2), 0, 0))) == COMPARE && XEXP (SET_SRC (XVECEXP (PATTERN (i2), 0, 0)), 1) == const0_rtx && GET_CODE (XVECEXP (PATTERN (i2), 0, 1)) == SET - && GET_CODE (SET_DEST (XVECEXP (PATTERN (i2), 0, 1))) == REG + && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 1))) && rtx_equal_p (XEXP (SET_SRC (XVECEXP (PATTERN (i2), 0, 0)), 0), SET_SRC (XVECEXP (PATTERN (i2), 0, 1)))) { @@ -1724,6 +2148,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) i2dest_in_i2src = reg_overlap_mentioned_p (i2dest, i2src); i1dest_in_i1src = i1 && reg_overlap_mentioned_p (i1dest, i1src); i2dest_in_i1src = i1 && reg_overlap_mentioned_p (i2dest, i1src); + i2dest_killed = dead_or_set_p (i2, i2dest); + i1dest_killed = i1 && dead_or_set_p (i1, i1dest); /* See if I1 directly feeds into I3. It does if I1DEST is not used in I2SRC. */ @@ -1756,8 +2182,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) #if 0 if (!(GET_CODE (PATTERN (i3)) == SET - && GET_CODE (SET_SRC (PATTERN (i3))) == REG - && GET_CODE (SET_DEST (PATTERN (i3))) == MEM + && REG_P (SET_SRC (PATTERN (i3))) + && MEM_P (SET_DEST (PATTERN (i3))) && (GET_CODE (XEXP (SET_DEST (PATTERN (i3)), 0)) == POST_INC || GET_CODE (XEXP (SET_DEST (PATTERN (i3)), 0)) == POST_DEC))) /* It's not the exception. */ @@ -1798,12 +2224,21 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx. If I2 is a PARALLEL, we just need the piece that assigns I2SRC to I2DEST. */ - i2pat = (GET_CODE (PATTERN (i2)) == PARALLEL - ? gen_rtx_SET (VOIDmode, i2dest, i2src) - : PATTERN (i2)); - if (added_sets_2) - i2pat = copy_rtx (i2pat); + { + if (GET_CODE (PATTERN (i2)) == PARALLEL) + i2pat = gen_rtx_SET (VOIDmode, i2dest, copy_rtx (i2src)); + else + i2pat = copy_rtx (PATTERN (i2)); + } + + if (added_sets_1) + { + if (GET_CODE (PATTERN (i1)) == PARALLEL) + i1pat = gen_rtx_SET (VOIDmode, i1dest, copy_rtx (i1src)); + else + i1pat = copy_rtx (PATTERN (i1)); + } combine_merges++; @@ -1813,37 +2248,6 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) subst_insn = i3; - /* It is possible that the source of I2 or I1 may be performing an - unneeded operation, such as a ZERO_EXTEND of something that is known - to have the high part zero. Handle that case by letting subst look at - the innermost one of them. - - Another way to do this would be to have a function that tries to - simplify a single insn instead of merging two or more insns. We don't - do this because of the potential of infinite loops and because - of the potential extra memory required. However, doing it the way - we are is a bit of a kludge and doesn't catch all cases. - - But only do this if -fexpensive-optimizations since it slows things down - and doesn't usually win. */ - - if (flag_expensive_optimizations) - { - /* Pass pc_rtx so no substitutions are done, just simplifications. - The cases that we are interested in here do not involve the few - cases were is_replaced is checked. */ - if (i1) - { - subst_low_cuid = INSN_CUID (i1); - i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0); - } - else - { - subst_low_cuid = INSN_CUID (i2); - i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0); - } - } - #ifndef HAVE_cc0 /* Many machines that don't use CC0 have insns that can both perform an arithmetic operation and set the condition code. These operations will @@ -1884,15 +2288,19 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) i2src, const0_rtx)) != GET_MODE (SET_DEST (newpat)))) { - unsigned int regno = REGNO (SET_DEST (newpat)); - rtx new_dest = gen_rtx_REG (compare_mode, regno); - - if (regno < FIRST_PSEUDO_REGISTER - || (REG_N_SETS (regno) == 1 && ! added_sets_2 - && ! REG_USERVAR_P (SET_DEST (newpat)))) + if (can_change_dest_mode(SET_DEST (newpat), added_sets_2, + compare_mode)) { - if (regno >= FIRST_PSEUDO_REGISTER) - SUBST (regno_reg_rtx[regno], new_dest); + unsigned int regno = REGNO (SET_DEST (newpat)); + rtx new_dest; + + if (regno < FIRST_PSEUDO_REGISTER) + new_dest = gen_rtx_REG (compare_mode, regno); + else + { + SUBST_MODE (regno_reg_rtx[regno], compare_mode); + new_dest = regno_reg_rtx[regno]; + } SUBST (SET_DEST (newpat), new_dest); SUBST (XEXP (*cc_use, 0), new_dest); @@ -1907,6 +2315,41 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) else #endif { + /* It is possible that the source of I2 or I1 may be performing + an unneeded operation, such as a ZERO_EXTEND of something + that is known to have the high part zero. Handle that case + by letting subst look at the innermost one of them. + + Another way to do this would be to have a function that tries + to simplify a single insn instead of merging two or more + insns. We don't do this because of the potential of infinite + loops and because of the potential extra memory required. + However, doing it the way we are is a bit of a kludge and + doesn't catch all cases. + + But only do this if -fexpensive-optimizations since it slows + things down and doesn't usually win. + + This is not done in the COMPARE case above because the + unmodified I2PAT is used in the PARALLEL and so a pattern + with a modified I2SRC would not match. */ + + if (flag_expensive_optimizations) + { + /* Pass pc_rtx so no substitutions are done, just + simplifications. */ + if (i1) + { + subst_low_cuid = INSN_CUID (i1); + i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0); + } + else + { + subst_low_cuid = INSN_CUID (i2); + i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0); + } + } + n_occurrences = 0; /* `subst' counts here */ /* If I1 feeds into I2 (not into I3) and I1DEST is in I1SRC, we @@ -1951,8 +2394,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) || (i1 != 0 && FIND_REG_INC_NOTE (i1, NULL_RTX) != 0 && (n_occurrences + added_sets_1 + (added_sets_2 && ! i1_feeds_i3) > 1)) - /* Fail if we tried to make a new register (we used to abort, but there's - really no reason to). */ + /* Fail if we tried to make a new register. */ || max_reg_num () != maxreg /* Fail if we couldn't do something and have a CLOBBER. */ || GET_CODE (newpat) == CLOBBER @@ -1991,9 +2433,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } if (added_sets_1) - XVECEXP (newpat, 0, --total_sets) - = (GET_CODE (PATTERN (i1)) == PARALLEL - ? gen_rtx_SET (VOIDmode, i1dest, i1src) : PATTERN (i1)); + XVECEXP (newpat, 0, --total_sets) = i1pat; if (added_sets_2) { @@ -2016,6 +2456,18 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) /* Note which hard regs this insn has as inputs. */ mark_used_regs_combine (newpat); + /* If recog_for_combine fails, it strips existing clobbers. If we'll + consider splitting this pattern, we might need these clobbers. */ + if (i1 && GET_CODE (newpat) == PARALLEL + && GET_CODE (XVECEXP (newpat, 0, XVECLEN (newpat, 0) - 1)) == CLOBBER) + { + int len = XVECLEN (newpat, 0); + + newpat_vec_with_clobbers = rtvec_alloc (len); + for (i = 0; i < len; i++) + RTVEC_ELT (newpat_vec_with_clobbers, i) = XVECEXP (newpat, 0, i); + } + /* Is the result of combination a valid instruction? */ insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); @@ -2025,11 +2477,21 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) we just need the first SET. This can occur when simplifying a divmod insn. We *must* test for this case here because the code below that splits two independent SETs doesn't handle this case correctly when it - updates the register status. Also check the case where the first - SET's destination is unused. That would not cause incorrect code, but - does cause an unneeded insn to remain. */ + updates the register status. - if (insn_code_number < 0 && GET_CODE (newpat) == PARALLEL + It's pointless doing this if we originally had two sets, one from + i3, and one from i2. Combining then splitting the parallel results + in the original i2 again plus an invalid insn (which we delete). + The net effect is only to move instructions around, which makes + debug info less accurate. + + Also check the case where the first SET's destination is unused. + That would not cause incorrect code, but does cause an unneeded + insn to remain. */ + + if (insn_code_number < 0 + && !(added_sets_2 && i1 == 0) + && GET_CODE (newpat) == PARALLEL && XVECLEN (newpat, 0) == 2 && GET_CODE (XVECEXP (newpat, 0, 0)) == SET && GET_CODE (XVECEXP (newpat, 0, 1)) == SET @@ -2039,7 +2501,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx set1 = XVECEXP (newpat, 0, 1); rtx note; - if (((GET_CODE (SET_DEST (set1)) == REG + if (((REG_P (SET_DEST (set1)) && find_reg_note (i3, REG_UNUSED, SET_DEST (set1))) || (GET_CODE (SET_DEST (set1)) == SUBREG && find_reg_note (i3, REG_UNUSED, SUBREG_REG (SET_DEST (set1))))) @@ -2051,7 +2513,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); } - else if (((GET_CODE (SET_DEST (set0)) == REG + else if (((REG_P (SET_DEST (set0)) && find_reg_note (i3, REG_UNUSED, SET_DEST (set0))) || (GET_CODE (SET_DEST (set0)) == SUBREG && find_reg_note (i3, REG_UNUSED, @@ -2085,7 +2547,6 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) && asm_noperands (newpat) < 0) { rtx m_split, *split; - rtx ni2dest = i2dest; /* See if the MD file can split NEWPAT. If it can't, see if letting it use I2DEST as a scratch register will help. In the latter case, @@ -2100,39 +2561,65 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) possible to try that as a scratch reg. This would require adding more code to make it work though. */ - if (m_split == 0 && ! reg_overlap_mentioned_p (ni2dest, newpat)) + if (m_split == 0 && ! reg_overlap_mentioned_p (i2dest, newpat)) { - /* If I2DEST is a hard register or the only use of a pseudo, - we can change its mode. */ - if (GET_MODE (SET_DEST (newpat)) != GET_MODE (i2dest) - && GET_MODE (SET_DEST (newpat)) != VOIDmode - && GET_CODE (i2dest) == REG - && (REGNO (i2dest) < FIRST_PSEUDO_REGISTER - || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 - && ! REG_USERVAR_P (i2dest)))) - ni2dest = gen_rtx_REG (GET_MODE (SET_DEST (newpat)), - REGNO (i2dest)); + enum machine_mode new_mode = GET_MODE (SET_DEST (newpat)); + /* First try to split using the original register as a + scratch register. */ m_split = split_insns (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, newpat, gen_rtx_CLOBBER (VOIDmode, - ni2dest))), + i2dest))), i3); - /* If the split with the mode-changed register didn't work, try - the original register. */ - if (! m_split && ni2dest != i2dest) + + /* If that didn't work, try changing the mode of I2DEST if + we can. */ + if (m_split == 0 + && new_mode != GET_MODE (i2dest) + && new_mode != VOIDmode + && can_change_dest_mode (i2dest, added_sets_2, new_mode)) { - ni2dest = i2dest; + enum machine_mode old_mode = GET_MODE (i2dest); + rtx ni2dest; + + if (REGNO (i2dest) < FIRST_PSEUDO_REGISTER) + ni2dest = gen_rtx_REG (new_mode, REGNO (i2dest)); + else + { + SUBST_MODE (regno_reg_rtx[REGNO (i2dest)], new_mode); + ni2dest = regno_reg_rtx[REGNO (i2dest)]; + } + m_split = split_insns (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, newpat, gen_rtx_CLOBBER (VOIDmode, - i2dest))), + ni2dest))), i3); + + if (m_split == 0 + && REGNO (i2dest) >= FIRST_PSEUDO_REGISTER) + { + struct undo *buf; + + PUT_MODE (regno_reg_rtx[REGNO (i2dest)], old_mode); + buf = undobuf.undos; + undobuf.undos = buf->next; + buf->next = undobuf.frees; + undobuf.frees = buf; + } } } + /* If recog_for_combine has discarded clobbers, try to use them + again for the split. */ + if (m_split == 0 && newpat_vec_with_clobbers) + m_split + = split_insns (gen_rtx_PARALLEL (VOIDmode, + newpat_vec_with_clobbers), i3); + if (m_split && NEXT_INSN (m_split) == NULL_RTX) { m_split = PATTERN (m_split); @@ -2151,13 +2638,6 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) i3set = single_set (NEXT_INSN (m_split)); i2set = single_set (m_split); - /* In case we changed the mode of I2DEST, replace it in the - pseudo-register table here. We can't do it above in case this - code doesn't get executed and we do a split the other way. */ - - if (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER) - SUBST (regno_reg_rtx[REGNO (i2dest)], ni2dest); - i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes); /* If I2 or I3 has multiple SETs, we won't know how to track @@ -2190,8 +2670,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) || GET_CODE (new_i2_dest) == SUBREG) new_i2_dest = XEXP (new_i2_dest, 0); - if (GET_CODE (new_i3_dest) == REG - && GET_CODE (new_i2_dest) == REG + if (REG_P (new_i3_dest) + && REG_P (new_i2_dest) && REGNO (new_i3_dest) == REGNO (new_i2_dest)) REG_N_SETS (REGNO (new_i2_dest))++; } @@ -2202,15 +2682,16 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) are set between I2 and I3. */ if (insn_code_number < 0 && (split = find_split_point (&newpat, i3)) != 0 #ifdef HAVE_cc0 - && GET_CODE (i2dest) == REG + && REG_P (i2dest) #endif /* We need I2DEST in the proper mode. If it is a hard register - or the only use of a pseudo, we can change its mode. */ + or the only use of a pseudo, we can change its mode. + Make sure we don't change a hard register to have a mode that + isn't valid for it, or change the number of registers. */ && (GET_MODE (*split) == GET_MODE (i2dest) || GET_MODE (*split) == VOIDmode - || REGNO (i2dest) < FIRST_PSEUDO_REGISTER - || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 - && ! REG_USERVAR_P (i2dest))) + || can_change_dest_mode (i2dest, added_sets_2, + GET_MODE (*split))) && (next_real_insn (i2) == i3 || ! use_crosses_set_p (*split, INSN_CUID (i2))) /* We can't overwrite I2DEST if its value is still used by @@ -2220,15 +2701,20 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx newdest = i2dest; enum rtx_code split_code = GET_CODE (*split); enum machine_mode split_mode = GET_MODE (*split); + bool subst_done = false; + newi2pat = NULL_RTX; /* Get NEWDEST as a register in the proper mode. We have already validated that we can do this. */ if (GET_MODE (i2dest) != split_mode && split_mode != VOIDmode) { - newdest = gen_rtx_REG (split_mode, REGNO (i2dest)); - - if (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER) - SUBST (regno_reg_rtx[REGNO (i2dest)], newdest); + if (REGNO (i2dest) < FIRST_PSEUDO_REGISTER) + newdest = gen_rtx_REG (split_mode, REGNO (i2dest)); + else + { + SUBST_MODE (regno_reg_rtx[REGNO (i2dest)], split_mode); + newdest = regno_reg_rtx[REGNO (i2dest)]; + } } /* If *SPLIT is a (mult FOO (const_int pow2)), convert it to @@ -2249,7 +2735,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) #ifdef INSN_SCHEDULING /* If *SPLIT is a paradoxical SUBREG, when we split it, it should be written as a ZERO_EXTEND. */ - if (split_code == SUBREG && GET_CODE (SUBREG_REG (*split)) == MEM) + if (split_code == SUBREG && MEM_P (SUBREG_REG (*split))) { #ifdef LOAD_EXTEND_OP /* Or as a SIGN_EXTEND if LOAD_EXTEND_OP says that that's @@ -2265,10 +2751,85 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } #endif - newi2pat = gen_rtx_SET (VOIDmode, newdest, *split); - SUBST (*split, newdest); + /* Attempt to split binary operators using arithmetic identities. */ + if (BINARY_P (SET_SRC (newpat)) + && split_mode == GET_MODE (SET_SRC (newpat)) + && ! side_effects_p (SET_SRC (newpat))) + { + rtx setsrc = SET_SRC (newpat); + enum machine_mode mode = GET_MODE (setsrc); + enum rtx_code code = GET_CODE (setsrc); + rtx src_op0 = XEXP (setsrc, 0); + rtx src_op1 = XEXP (setsrc, 1); + + /* Split "X = Y op Y" as "Z = Y; X = Z op Z". */ + if (rtx_equal_p (src_op0, src_op1)) + { + newi2pat = gen_rtx_SET (VOIDmode, newdest, src_op0); + SUBST (XEXP (setsrc, 0), newdest); + SUBST (XEXP (setsrc, 1), newdest); + subst_done = true; + } + /* Split "((P op Q) op R) op S" where op is PLUS or MULT. */ + else if ((code == PLUS || code == MULT) + && GET_CODE (src_op0) == code + && GET_CODE (XEXP (src_op0, 0)) == code + && (INTEGRAL_MODE_P (mode) + || (FLOAT_MODE_P (mode) + && flag_unsafe_math_optimizations))) + { + rtx p = XEXP (XEXP (src_op0, 0), 0); + rtx q = XEXP (XEXP (src_op0, 0), 1); + rtx r = XEXP (src_op0, 1); + rtx s = src_op1; + + /* Split both "((X op Y) op X) op Y" and + "((X op Y) op Y) op X" as "T op T" where T is + "X op Y". */ + if ((rtx_equal_p (p,r) && rtx_equal_p (q,s)) + || (rtx_equal_p (p,s) && rtx_equal_p (q,r))) + { + newi2pat = gen_rtx_SET (VOIDmode, newdest, + XEXP (src_op0, 0)); + SUBST (XEXP (setsrc, 0), newdest); + SUBST (XEXP (setsrc, 1), newdest); + subst_done = true; + } + /* Split "((X op X) op Y) op Y)" as "T op T" where + T is "X op Y". */ + else if (rtx_equal_p (p,q) && rtx_equal_p (r,s)) + { + rtx tmp = simplify_gen_binary (code, mode, p, r); + newi2pat = gen_rtx_SET (VOIDmode, newdest, tmp); + SUBST (XEXP (setsrc, 0), newdest); + SUBST (XEXP (setsrc, 1), newdest); + subst_done = true; + } + } + } + + if (!subst_done) + { + newi2pat = gen_rtx_SET (VOIDmode, newdest, *split); + SUBST (*split, newdest); + } + i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes); + /* recog_for_combine might have added CLOBBERs to newi2pat. + Make sure NEWPAT does not depend on the clobbered regs. */ + if (GET_CODE (newi2pat) == PARALLEL) + for (i = XVECLEN (newi2pat, 0) - 1; i >= 0; i--) + if (GET_CODE (XVECEXP (newi2pat, 0, i)) == CLOBBER) + { + rtx reg = XEXP (XVECEXP (newi2pat, 0, i), 0); + if (reg_overlap_mentioned_p (reg, newpat)) + { + undo_all (); + return 0; + } + } + /* If the split point was a MULT and we didn't have one before, don't use one now. */ if (i2_code_number >= 0 && ! (split_code == MULT && ! have_mult)) @@ -2306,19 +2867,19 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != ZERO_EXTRACT && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART && ! (temp = SET_DEST (XVECEXP (newpat, 0, 1)), - (GET_CODE (temp) == REG - && reg_nonzero_bits[REGNO (temp)] != 0 + (REG_P (temp) + && reg_stat[REGNO (temp)].nonzero_bits != 0 && GET_MODE_BITSIZE (GET_MODE (temp)) < BITS_PER_WORD && GET_MODE_BITSIZE (GET_MODE (temp)) < HOST_BITS_PER_INT - && (reg_nonzero_bits[REGNO (temp)] + && (reg_stat[REGNO (temp)].nonzero_bits != GET_MODE_MASK (word_mode)))) && ! (GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) == SUBREG && (temp = SUBREG_REG (SET_DEST (XVECEXP (newpat, 0, 1))), - (GET_CODE (temp) == REG - && reg_nonzero_bits[REGNO (temp)] != 0 + (REG_P (temp) + && reg_stat[REGNO (temp)].nonzero_bits != 0 && GET_MODE_BITSIZE (GET_MODE (temp)) < BITS_PER_WORD && GET_MODE_BITSIZE (GET_MODE (temp)) < HOST_BITS_PER_INT - && (reg_nonzero_bits[REGNO (temp)] + && (reg_stat[REGNO (temp)].nonzero_bits != GET_MODE_MASK (word_mode))))) && ! reg_overlap_mentioned_p (SET_DEST (XVECEXP (newpat, 0, 1)), SET_SRC (XVECEXP (newpat, 0, 1))) @@ -2331,47 +2892,14 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) ni2dest = SET_DEST (XVECEXP (newpat, 0, 0)); newpat = XVECEXP (newpat, 0, 1); SUBST (SET_SRC (newpat), - gen_lowpart_for_combine (GET_MODE (SET_SRC (newpat)), ni2dest)); + gen_lowpart (GET_MODE (SET_SRC (newpat)), ni2dest)); i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes); if (i2_code_number >= 0) insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes); if (insn_code_number >= 0) - { - rtx insn; - rtx link; - - /* If we will be able to accept this, we have made a change to the - destination of I3. This requires us to do a few adjustments. */ - PATTERN (i3) = newpat; - adjust_for_new_dest (i3); - - /* I3 now uses what used to be its destination and which is - now I2's destination. That means we need a LOG_LINK from - I3 to I2. But we used to have one, so we still will. - - However, some later insn might be using I2's dest and have - a LOG_LINK pointing at I3. We must remove this link. - The simplest way to remove the link is to point it at I1, - which we know will be a NOTE. */ - - for (insn = NEXT_INSN (i3); - insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR - || insn != BB_HEAD (this_basic_block->next_bb)); - insn = NEXT_INSN (insn)) - { - if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn))) - { - for (link = LOG_LINKS (insn); link; - link = XEXP (link, 1)) - if (XEXP (link, 0) == i3) - XEXP (link, 0) = i1; - - break; - } - } - } + swap_i2i3 = 1; } /* Similarly, check for a case where we have a PARALLEL of two independent @@ -2390,15 +2918,19 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != STRICT_LOW_PART && ! use_crosses_set_p (SET_SRC (XVECEXP (newpat, 0, 1)), INSN_CUID (i2)) - /* Don't pass sets with (USE (MEM ...)) dests to the following. */ - && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 1))) != USE - && GET_CODE (SET_DEST (XVECEXP (newpat, 0, 0))) != USE && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 1)), XVECEXP (newpat, 0, 0)) && ! reg_referenced_p (SET_DEST (XVECEXP (newpat, 0, 0)), XVECEXP (newpat, 0, 1)) && ! (contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 0))) - && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1))))) + && contains_muldiv (SET_SRC (XVECEXP (newpat, 0, 1)))) +#ifdef HAVE_cc0 + /* We cannot split the parallel into two sets if both sets + reference cc0. */ + && ! (reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)) + && reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1))) +#endif + ) { /* Normally, it doesn't matter which of the two is done first, but it does if one references cc0. In that case, it has to @@ -2462,7 +2994,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (REG_NOTE_KIND (note) == REG_UNUSED && ! reg_set_p (XEXP (note, 0), PATTERN (undobuf.other_insn))) { - if (GET_CODE (XEXP (note, 0)) == REG) + if (REG_P (XEXP (note, 0))) REG_N_DEATHS (REGNO (XEXP (note, 0)))--; remove_note (undobuf.other_insn, note); @@ -2470,18 +3002,18 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } for (note = new_other_notes; note; note = XEXP (note, 1)) - if (GET_CODE (XEXP (note, 0)) == REG) + if (REG_P (XEXP (note, 0))) REG_N_DEATHS (REGNO (XEXP (note, 0)))++; distribute_notes (new_other_notes, undobuf.other_insn, - undobuf.other_insn, NULL_RTX); + undobuf.other_insn, NULL_RTX, NULL_RTX, NULL_RTX); } #ifdef HAVE_cc0 - /* If I2 is the setter CC0 and I3 is the user CC0 then check whether + /* If I2 is the CC0 setter and I3 is the CC0 user then check whether they are adjacent to each other or not. */ { rtx p = prev_nonnote_insn (i3); - if (p && p != i2 && GET_CODE (p) == INSN && newi2pat + if (p && p != i2 && NONJUMP_INSN_P (p) && newi2pat && sets_cc0_p (newi2pat)) { undo_all (); @@ -2490,14 +3022,76 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } #endif + /* Only allow this combination if insn_rtx_costs reports that the + replacement instructions are cheaper than the originals. */ + if (!combine_validate_cost (i1, i2, i3, newpat, newi2pat)) + { + undo_all (); + return 0; + } + /* We now know that we can do this combination. Merge the insns and update the status of registers and LOG_LINKS. */ + if (swap_i2i3) + { + rtx insn; + rtx link; + rtx ni2dest; + + /* I3 now uses what used to be its destination and which is now + I2's destination. This requires us to do a few adjustments. */ + PATTERN (i3) = newpat; + adjust_for_new_dest (i3); + + /* We need a LOG_LINK from I3 to I2. But we used to have one, + so we still will. + + However, some later insn might be using I2's dest and have + a LOG_LINK pointing at I3. We must remove this link. + The simplest way to remove the link is to point it at I1, + which we know will be a NOTE. */ + + /* newi2pat is usually a SET here; however, recog_for_combine might + have added some clobbers. */ + if (GET_CODE (newi2pat) == PARALLEL) + ni2dest = SET_DEST (XVECEXP (newi2pat, 0, 0)); + else + ni2dest = SET_DEST (newi2pat); + + for (insn = NEXT_INSN (i3); + insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR + || insn != BB_HEAD (this_basic_block->next_bb)); + insn = NEXT_INSN (insn)) + { + if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn))) + { + for (link = LOG_LINKS (insn); link; + link = XEXP (link, 1)) + if (XEXP (link, 0) == i3) + XEXP (link, 0) = i1; + + break; + } + } + } + { rtx i3notes, i2notes, i1notes = 0; rtx i3links, i2links, i1links = 0; rtx midnotes = 0; unsigned int regno; + /* Compute which registers we expect to eliminate. newi2pat may be setting + either i3dest or i2dest, so we must check it. Also, i1dest may be the + same as i3dest, in which case newi2pat may be setting i1dest. */ + rtx elim_i2 = ((newi2pat && reg_set_p (i2dest, newi2pat)) + || i2dest_in_i2src || i2dest_in_i1src + || !i2dest_killed + ? 0 : i2dest); + rtx elim_i1 = (i1 == 0 || i1dest_in_i1src + || (newi2pat && reg_set_p (i1dest, newi2pat)) + || !i1dest_killed + ? 0 : i1dest); /* Get the old REG_NOTES and LOG_LINKS from all our insns and clear them. */ @@ -2529,7 +3123,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) INSN_CODE (i3) = insn_code_number; PATTERN (i3) = newpat; - if (GET_CODE (i3) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (i3)) + if (CALL_P (i3) && CALL_INSN_FUNCTION_USAGE (i3)) { rtx call_usage = CALL_INSN_FUNCTION_USAGE (i3); @@ -2560,8 +3154,9 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (i3_subst_into_i2) { for (i = 0; i < XVECLEN (PATTERN (i2), 0); i++) - if (GET_CODE (XVECEXP (PATTERN (i2), 0, i)) != USE - && GET_CODE (SET_DEST (XVECEXP (PATTERN (i2), 0, i))) == REG + if ((GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == SET + || GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == CLOBBER) + && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, i))) && SET_DEST (XVECEXP (PATTERN (i2), 0, i)) != i2dest && ! find_reg_note (i2, REG_UNUSED, SET_DEST (XVECEXP (PATTERN (i2), 0, i)))) @@ -2597,19 +3192,13 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) PATTERN (i2) = newi2pat; } else - { - PUT_CODE (i2, NOTE); - NOTE_LINE_NUMBER (i2) = NOTE_INSN_DELETED; - NOTE_SOURCE_FILE (i2) = 0; - } + SET_INSN_DELETED (i2); if (i1) { LOG_LINKS (i1) = 0; REG_NOTES (i1) = 0; - PUT_CODE (i1, NOTE); - NOTE_LINE_NUMBER (i1) = NOTE_INSN_DELETED; - NOTE_SOURCE_FILE (i1) = 0; + SET_INSN_DELETED (i1); } /* Get death notes for everything that is now used in either I3 or @@ -2628,13 +3217,17 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) /* Distribute all the LOG_LINKS and REG_NOTES from I1, I2, and I3. */ if (i3notes) - distribute_notes (i3notes, i3, i3, newi2pat ? i2 : NULL_RTX); + distribute_notes (i3notes, i3, i3, newi2pat ? i2 : NULL_RTX, + elim_i2, elim_i1); if (i2notes) - distribute_notes (i2notes, i2, i3, newi2pat ? i2 : NULL_RTX); + distribute_notes (i2notes, i2, i3, newi2pat ? i2 : NULL_RTX, + elim_i2, elim_i1); if (i1notes) - distribute_notes (i1notes, i1, i3, newi2pat ? i2 : NULL_RTX); + distribute_notes (i1notes, i1, i3, newi2pat ? i2 : NULL_RTX, + elim_i2, elim_i1); if (midnotes) - distribute_notes (midnotes, NULL_RTX, i3, newi2pat ? i2 : NULL_RTX); + distribute_notes (midnotes, NULL_RTX, i3, newi2pat ? i2 : NULL_RTX, + elim_i2, elim_i1); /* Distribute any notes added to I2 or I3 by recog_for_combine. We know these are REG_UNUSED and want them to go to the desired insn, @@ -2644,19 +3237,19 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (newi2pat && new_i2_notes) { for (temp = new_i2_notes; temp; temp = XEXP (temp, 1)) - if (GET_CODE (XEXP (temp, 0)) == REG) + if (REG_P (XEXP (temp, 0))) REG_N_DEATHS (REGNO (XEXP (temp, 0)))++; - distribute_notes (new_i2_notes, i2, i2, NULL_RTX); + distribute_notes (new_i2_notes, i2, i2, NULL_RTX, NULL_RTX, NULL_RTX); } if (new_i3_notes) { for (temp = new_i3_notes; temp; temp = XEXP (temp, 1)) - if (GET_CODE (XEXP (temp, 0)) == REG) + if (REG_P (XEXP (temp, 0))) REG_N_DEATHS (REGNO (XEXP (temp, 0)))++; - distribute_notes (new_i3_notes, i3, i3, NULL_RTX); + distribute_notes (new_i3_notes, i3, i3, NULL_RTX, NULL_RTX, NULL_RTX); } /* If I3DEST was used in I3SRC, it really died in I3. We may need to @@ -2668,50 +3261,53 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) if (i3dest_killed) { - if (GET_CODE (i3dest_killed) == REG) + if (REG_P (i3dest_killed)) REG_N_DEATHS (REGNO (i3dest_killed))++; if (newi2pat && reg_set_p (i3dest_killed, newi2pat)) distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i3dest_killed, NULL_RTX), - NULL_RTX, i2, NULL_RTX); + NULL_RTX, i2, NULL_RTX, elim_i2, elim_i1); else distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i3dest_killed, NULL_RTX), - NULL_RTX, i3, newi2pat ? i2 : NULL_RTX); + NULL_RTX, i3, newi2pat ? i2 : NULL_RTX, + elim_i2, elim_i1); } if (i2dest_in_i2src) { - if (GET_CODE (i2dest) == REG) + if (REG_P (i2dest)) REG_N_DEATHS (REGNO (i2dest))++; if (newi2pat && reg_set_p (i2dest, newi2pat)) distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i2dest, NULL_RTX), - NULL_RTX, i2, NULL_RTX); + NULL_RTX, i2, NULL_RTX, NULL_RTX, NULL_RTX); else distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i2dest, NULL_RTX), - NULL_RTX, i3, newi2pat ? i2 : NULL_RTX); + NULL_RTX, i3, newi2pat ? i2 : NULL_RTX, + NULL_RTX, NULL_RTX); } if (i1dest_in_i1src) { - if (GET_CODE (i1dest) == REG) + if (REG_P (i1dest)) REG_N_DEATHS (REGNO (i1dest))++; if (newi2pat && reg_set_p (i1dest, newi2pat)) distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i1dest, NULL_RTX), - NULL_RTX, i2, NULL_RTX); + NULL_RTX, i2, NULL_RTX, NULL_RTX, NULL_RTX); else distribute_notes (gen_rtx_EXPR_LIST (REG_DEAD, i1dest, NULL_RTX), - NULL_RTX, i3, newi2pat ? i2 : NULL_RTX); + NULL_RTX, i3, newi2pat ? i2 : NULL_RTX, + NULL_RTX, NULL_RTX); } distribute_links (i3links); distribute_links (i2links); distribute_links (i1links); - if (GET_CODE (i2dest) == REG) + if (REG_P (i2dest)) { rtx link; rtx i2_insn = 0, i2_val = 0, set; @@ -2742,7 +3338,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } } - if (i1 && GET_CODE (i1dest) == REG) + if (i1 && REG_P (i1dest)) { rtx link; rtx i1_insn = 0, i1_val = 0, set; @@ -2759,9 +3355,10 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) REG_N_SETS (regno)--; } - /* Update reg_nonzero_bits et al for any changes that may have been made - to this insn. The order of set_nonzero_bits_and_sign_copies() is - important. Because newi2pat can affect nonzero_bits of newpat */ + /* Update reg_stat[].nonzero_bits et al for any changes that may have + been made to this insn. The order of + set_nonzero_bits_and_sign_copies() is important. Because newi2pat + can affect nonzero_bits of newpat */ if (newi2pat) note_stores (newi2pat, set_nonzero_bits_and_sign_copies, NULL); note_stores (newpat, set_nonzero_bits_and_sign_copies, NULL); @@ -2779,7 +3376,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) mark_jump_label (PATTERN (i3), i3, 0); if ((temp = next_nonnote_insn (i3)) == NULL_RTX - || GET_CODE (temp) != BARRIER) + || !BARRIER_P (temp)) emit_barrier_after (i3); } @@ -2790,7 +3387,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) *new_direct_jump_p = 1; if ((temp = next_nonnote_insn (undobuf.other_insn)) == NULL_RTX - || GET_CODE (temp) != BARRIER) + || !BARRIER_P (temp)) emit_barrier_after (undobuf.other_insn); } @@ -2823,10 +3420,20 @@ undo_all (void) for (undo = undobuf.undos; undo; undo = next) { next = undo->next; - if (undo->is_int) - *undo->where.i = undo->old_contents.i; - else - *undo->where.r = undo->old_contents.r; + switch (undo->kind) + { + case UNDO_RTX: + *undo->where.r = undo->old_contents.r; + break; + case UNDO_INT: + *undo->where.i = undo->old_contents.i; + break; + case UNDO_MODE: + PUT_MODE (*undo->where.r, undo->old_contents.m); + break; + default: + gcc_unreachable (); + } undo->next = undobuf.frees; undobuf.frees = undo; @@ -2851,7 +3458,6 @@ undo_commit (void) } undobuf.undos = 0; } - /* Find the innermost point within the rtx at LOC, possibly LOC itself, where we have an arithmetic expression and return that point. LOC will @@ -2878,7 +3484,7 @@ find_split_point (rtx *loc, rtx insn) #ifdef INSN_SCHEDULING /* If we are making a paradoxical SUBREG invalid, it becomes a split point. */ - if (GET_CODE (SUBREG_REG (x)) == MEM) + if (MEM_P (SUBREG_REG (x))) return loc; #endif return find_split_point (&SUBREG_REG (x), insn); @@ -2919,12 +3525,12 @@ find_split_point (rtx *loc, rtx insn) if (seq && NEXT_INSN (seq) != NULL_RTX && NEXT_INSN (NEXT_INSN (seq)) == NULL_RTX - && GET_CODE (seq) == INSN + && NONJUMP_INSN_P (seq) && GET_CODE (PATTERN (seq)) == SET && SET_DEST (PATTERN (seq)) == reg && ! reg_mentioned_p (reg, SET_SRC (PATTERN (seq))) - && GET_CODE (NEXT_INSN (seq)) == INSN + && NONJUMP_INSN_P (NEXT_INSN (seq)) && GET_CODE (PATTERN (NEXT_INSN (seq))) == SET && SET_DEST (PATTERN (NEXT_INSN (seq))) == reg && memory_address_p (GET_MODE (x), @@ -2958,10 +3564,9 @@ find_split_point (rtx *loc, rtx insn) This will occur on machines that just support REG + CONST and have a constant moved through some previous computation. */ - else if (GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) != 'o' + else if (!OBJECT_P (XEXP (XEXP (x, 0), 0)) && ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (XEXP (x, 0), 0)))) - == 'o'))) + && OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0))))) return &XEXP (XEXP (x, 0), 0); } break; @@ -2976,9 +3581,9 @@ find_split_point (rtx *loc, rtx insn) if (SET_DEST (x) == cc0_rtx && GET_CODE (SET_SRC (x)) != COMPARE && GET_CODE (SET_SRC (x)) != ZERO_EXTRACT - && GET_RTX_CLASS (GET_CODE (SET_SRC (x))) != 'o' + && !OBJECT_P (SET_SRC (x)) && ! (GET_CODE (SET_SRC (x)) == SUBREG - && GET_RTX_CLASS (GET_CODE (SUBREG_REG (SET_SRC (x)))) == 'o')) + && OBJECT_P (SUBREG_REG (SET_SRC (x))))) return &SET_SRC (x); #endif @@ -3011,20 +3616,24 @@ find_split_point (rtx *loc, rtx insn) rtx dest = XEXP (SET_DEST (x), 0); enum machine_mode mode = GET_MODE (dest); unsigned HOST_WIDE_INT mask = ((HOST_WIDE_INT) 1 << len) - 1; + rtx or_mask; if (BITS_BIG_ENDIAN) pos = GET_MODE_BITSIZE (mode) - len - pos; + or_mask = gen_int_mode (src << pos, mode); if (src == mask) SUBST (SET_SRC (x), - gen_binary (IOR, mode, dest, GEN_INT (src << pos))); + simplify_gen_binary (IOR, mode, dest, or_mask)); else - SUBST (SET_SRC (x), - gen_binary (IOR, mode, - gen_binary (AND, mode, dest, - gen_int_mode (~(mask << pos), - mode)), - GEN_INT (src << pos))); + { + rtx negmask = gen_int_mode (~(mask << pos), mode); + SUBST (SET_SRC (x), + simplify_gen_binary (IOR, mode, + simplify_gen_binary (AND, mode, + dest, negmask), + or_mask)); + } SUBST (SET_DEST (x), dest); @@ -3050,9 +3659,9 @@ find_split_point (rtx *loc, rtx insn) be better. */ if (GET_CODE (XEXP (SET_SRC (x), 1)) == CONST_INT - && GET_CODE (XEXP (SET_SRC (x), 0)) == REG + && REG_P (XEXP (SET_SRC (x), 0)) && (pos = exact_log2 (INTVAL (XEXP (SET_SRC (x), 1)))) >= 7 - && GET_CODE (SET_DEST (x)) == REG + && REG_P (SET_DEST (x)) && (split = find_single_use (SET_DEST (x), insn, (rtx*) 0)) != 0 && (GET_CODE (*split) == EQ || GET_CODE (*split) == NE) && XEXP (*split, 0) == SET_DEST (x) @@ -3141,7 +3750,7 @@ find_split_point (rtx *loc, rtx insn) SUBST (SET_SRC (x), gen_rtx_AND (mode, gen_rtx_LSHIFTRT - (mode, gen_lowpart_for_combine (mode, inner), + (mode, gen_lowpart (mode, inner), GEN_INT (pos)), GEN_INT (((HOST_WIDE_INT) 1 << len) - 1))); @@ -3155,7 +3764,7 @@ find_split_point (rtx *loc, rtx insn) gen_rtx_fmt_ee (unsignedp ? LSHIFTRT : ASHIFTRT, mode, gen_rtx_ASHIFT (mode, - gen_lowpart_for_combine (mode, inner), + gen_lowpart (mode, inner), GEN_INT (GET_MODE_BITSIZE (mode) - len - pos)), GEN_INT (GET_MODE_BITSIZE (mode) - len))); @@ -3169,14 +3778,11 @@ find_split_point (rtx *loc, rtx insn) /* See if this is a simple operation with a constant as the second operand. It might be that this constant is out of range and hence could be used as a split point. */ - if ((GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '2' - || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == 'c' - || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '<') + if (BINARY_P (SET_SRC (x)) && CONSTANT_P (XEXP (SET_SRC (x), 1)) - && (GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (x), 0))) == 'o' + && (OBJECT_P (XEXP (SET_SRC (x), 0)) || (GET_CODE (XEXP (SET_SRC (x), 0)) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (SET_SRC (x), 0)))) - == 'o')))) + && OBJECT_P (SUBREG_REG (XEXP (SET_SRC (x), 0)))))) return &XEXP (SET_SRC (x), 1); /* Finally, see if this is a simple operation with its first operand @@ -3184,10 +3790,7 @@ find_split_point (rtx *loc, rtx insn) register, so return it as a split point. We can always do this because if the first operand were another operation, we would have already found it as a split point. */ - if ((GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '2' - || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == 'c' - || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '<' - || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '1') + if ((BINARY_P (SET_SRC (x)) || UNARY_P (SET_SRC (x))) && ! register_operand (XEXP (SET_SRC (x), 0), VOIDmode)) return &XEXP (SET_SRC (x), 0); @@ -3227,20 +3830,21 @@ find_split_point (rtx *loc, rtx insn) /* Otherwise, select our actions depending on our rtx class. */ switch (GET_RTX_CLASS (code)) { - case 'b': /* This is ZERO_EXTRACT and SIGN_EXTRACT. */ - case '3': + case RTX_BITFIELD_OPS: /* This is ZERO_EXTRACT and SIGN_EXTRACT. */ + case RTX_TERNARY: split = find_split_point (&XEXP (x, 2), insn); if (split) return split; /* ... fall through ... */ - case '2': - case 'c': - case '<': + case RTX_BIN_ARITH: + case RTX_COMM_ARITH: + case RTX_COMPARE: + case RTX_COMM_COMPARE: split = find_split_point (&XEXP (x, 1), insn); if (split) return split; /* ... fall through ... */ - case '1': + case RTX_UNARY: /* Some machines have (and (shift ...) ...) insns. If X is not an AND, but XEXP (X, 0) is, use it as our split point. */ if (GET_CODE (x) != AND && GET_CODE (XEXP (x, 0)) == AND) @@ -3250,10 +3854,11 @@ find_split_point (rtx *loc, rtx insn) if (split) return split; return loc; - } - /* Otherwise, we don't have a split point. */ - return 0; + default: + /* Otherwise, we don't have a split point. */ + return 0; + } } /* Throughout X, replace FROM with TO, and return the result. @@ -3290,7 +3895,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) #define COMBINE_RTX_EQUAL_P(X,Y) \ ((X) == (Y) \ - || (GET_CODE (X) == REG && GET_CODE (Y) == REG \ + || (REG_P (X) && REG_P (Y) \ && REGNO (X) == REGNO (Y) && GET_MODE (X) == GET_MODE (Y))) if (! in_dest && COMBINE_RTX_EQUAL_P (x, from)) @@ -3306,13 +3911,13 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) delete the feeding insn, which is incorrect. So force this insn not to match in this (rare) case. */ - if (! in_dest && code == REG && GET_CODE (from) == REG + if (! in_dest && code == REG && REG_P (from) && REGNO (x) == REGNO (from)) return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); /* If this is an object, we are done unless it is a MEM or LO_SUM, both of which may contain things that can be combined. */ - if (code != MEM && code != LO_SUM && GET_RTX_CLASS (code) == 'o') + if (code != MEM && code != LO_SUM && OBJECT_P (x)) return x; /* It is possible to have a subexpression appear twice in the insn. @@ -3350,7 +3955,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) { rtx dest = SET_DEST (XVECEXP (x, 0, i)); - if (GET_CODE (dest) != REG + if (!REG_P (dest) && GET_CODE (dest) != CC0 && GET_CODE (dest) != PC) { @@ -3375,7 +3980,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) where we want to suppress replacing something inside a SET_SRC are handled via the IN_DEST operand. */ if (code == SET - && (GET_CODE (SET_DEST (x)) == REG + && (REG_P (SET_DEST (x)) || GET_CODE (SET_DEST (x)) == CC0 || GET_CODE (SET_DEST (x)) == PC)) fmt = "ie"; @@ -3420,7 +4025,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) if (in_dest && i == 0 && (((code == SUBREG || code == ZERO_EXTRACT) - && GET_CODE (new) == REG) + && REG_P (new)) || code == STRICT_LOW_PART)) ; @@ -3453,7 +4058,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) #ifdef CANNOT_CHANGE_MODE_CLASS if (code == SUBREG - && GET_CODE (to) == REG + && REG_P (to) && REGNO (to) < FIRST_PSEUDO_REGISTER && REG_CANNOT_CHANGE_MODE_P (REGNO (to), GET_MODE (to), @@ -3506,8 +4111,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) { x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), new, GET_MODE (XEXP (x, 0))); - if (! x) - abort (); + gcc_assert (x); } else SUBST (XEXP (x, i), new); @@ -3524,7 +4128,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) /* If X is sufficiently simple, don't bother trying to do anything with it. */ if (code != CONST_INT && code != REG && code != CLOBBER) - x = combine_simplify_rtx (x, op0_mode, i == 3, in_dest); + x = combine_simplify_rtx (x, op0_mode, in_dest); if (GET_CODE (x) == code) break; @@ -3543,23 +4147,20 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) outer level; call `subst' to simplify recursively. Return the new expression. - OP0_MODE is the original mode of XEXP (x, 0); LAST is nonzero if this - will be the iteration even if an expression with a code different from - X is returned; IN_DEST is nonzero if we are inside a SET_DEST. */ + OP0_MODE is the original mode of XEXP (x, 0). IN_DEST is nonzero + if we are inside a SET_DEST. */ static rtx -combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, - int in_dest) +combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) { enum rtx_code code = GET_CODE (x); enum machine_mode mode = GET_MODE (x); rtx temp; - rtx reversed; int i; /* If this is a commutative operation, put a constant last and a complex expression first. We don't need to do this for comparisons here. */ - if (GET_RTX_CLASS (code) == 'c' + if (COMMUTATIVE_ARITH_P (x) && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1))) { temp = XEXP (x, 0); @@ -3567,47 +4168,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, SUBST (XEXP (x, 1), temp); } - /* If this is a PLUS, MINUS, or MULT, and the first operand is the - sign extension of a PLUS with a constant, reverse the order of the sign - extension and the addition. Note that this not the same as the original - code, but overflow is undefined for signed values. Also note that the - PLUS will have been partially moved "inside" the sign-extension, so that - the first operand of X will really look like: - (ashiftrt (plus (ashift A C4) C5) C4). - We convert this to - (plus (ashiftrt (ashift A C4) C2) C4) - and replace the first operand of X with that expression. Later parts - of this function may simplify the expression further. - - For example, if we start with (mult (sign_extend (plus A C1)) C2), - we swap the SIGN_EXTEND and PLUS. Later code will apply the - distributive law to produce (plus (mult (sign_extend X) C1) C3). - - We do this to simplify address expressions. */ - - if ((code == PLUS || code == MINUS || code == MULT) - && GET_CODE (XEXP (x, 0)) == ASHIFTRT - && GET_CODE (XEXP (XEXP (x, 0), 0)) == PLUS - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == ASHIFT - && GET_CODE (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT - && XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 1) == XEXP (XEXP (x, 0), 1) - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == CONST_INT - && (temp = simplify_binary_operation (ASHIFTRT, mode, - XEXP (XEXP (XEXP (x, 0), 0), 1), - XEXP (XEXP (x, 0), 1))) != 0) - { - rtx new - = simplify_shift_const (NULL_RTX, ASHIFT, mode, - XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 0), - INTVAL (XEXP (XEXP (x, 0), 1))); - - new = simplify_shift_const (NULL_RTX, ASHIFTRT, mode, new, - INTVAL (XEXP (XEXP (x, 0), 1))); - - SUBST (XEXP (x, 0), gen_binary (PLUS, mode, new, temp)); - } - /* If this is a simple operation applied to an IF_THEN_ELSE, try applying it to the arms of the IF_THEN_ELSE. This often simplifies things. Check for cases where both arms are testing the same @@ -3615,21 +4175,17 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, Don't do anything if all operands are very simple. */ - if (((GET_RTX_CLASS (code) == '2' || GET_RTX_CLASS (code) == 'c' - || GET_RTX_CLASS (code) == '<') - && ((GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) != 'o' + if ((BINARY_P (x) + && ((!OBJECT_P (XEXP (x, 0)) && ! (GET_CODE (XEXP (x, 0)) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0)))) - == 'o'))) - || (GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) != 'o' + && OBJECT_P (SUBREG_REG (XEXP (x, 0))))) + || (!OBJECT_P (XEXP (x, 1)) && ! (GET_CODE (XEXP (x, 1)) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 1)))) - == 'o'))))) - || (GET_RTX_CLASS (code) == '1' - && ((GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) != 'o' + && OBJECT_P (SUBREG_REG (XEXP (x, 1))))))) + || (UNARY_P (x) + && (!OBJECT_P (XEXP (x, 0)) && ! (GET_CODE (XEXP (x, 0)) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0)))) - == 'o')))))) + && OBJECT_P (SUBREG_REG (XEXP (x, 0))))))) { rtx cond, true_rtx, false_rtx; @@ -3637,14 +4193,13 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, if (cond != 0 /* If everything is a comparison, what we have is highly unlikely to be simpler, so don't use it. */ - && ! (GET_RTX_CLASS (code) == '<' - && (GET_RTX_CLASS (GET_CODE (true_rtx)) == '<' - || GET_RTX_CLASS (GET_CODE (false_rtx)) == '<'))) + && ! (COMPARISON_P (x) + && (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx)))) { rtx cop1 = const0_rtx; enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1); - if (cond_code == NE && GET_RTX_CLASS (GET_CODE (cond)) == '<') + if (cond_code == NE && COMPARISON_P (cond)) return x; /* Simplify the alternative arms; this may collapse the true and @@ -3667,12 +4222,14 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, /* If the result values are STORE_FLAG_VALUE and zero, we can just make the comparison operation. */ if (true_rtx == const_true_rtx && false_rtx == const0_rtx) - x = gen_binary (cond_code, mode, cond, cop1); + x = simplify_gen_relational (cond_code, mode, VOIDmode, + cond, cop1); else if (true_rtx == const0_rtx && false_rtx == const_true_rtx && ((reversed = reversed_comparison_code_parts (cond_code, cond, cop1, NULL)) - != UNKNOWN)) - x = gen_binary (reversed, mode, cond, cop1); + != UNKNOWN)) + x = simplify_gen_relational (reversed, mode, VOIDmode, + cond, cop1); /* Likewise, we can make the negate of a comparison operation if the result values are - STORE_FLAG_VALUE and zero. */ @@ -3680,23 +4237,28 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && INTVAL (true_rtx) == - STORE_FLAG_VALUE && false_rtx == const0_rtx) x = simplify_gen_unary (NEG, mode, - gen_binary (cond_code, mode, cond, - cop1), + simplify_gen_relational (cond_code, + mode, VOIDmode, + cond, cop1), mode); else if (GET_CODE (false_rtx) == CONST_INT && INTVAL (false_rtx) == - STORE_FLAG_VALUE && true_rtx == const0_rtx && ((reversed = reversed_comparison_code_parts (cond_code, cond, cop1, NULL)) - != UNKNOWN)) + != UNKNOWN)) x = simplify_gen_unary (NEG, mode, - gen_binary (reversed, mode, - cond, cop1), + simplify_gen_relational (reversed, + mode, VOIDmode, + cond, cop1), mode); else return gen_rtx_IF_THEN_ELSE (mode, - gen_binary (cond_code, VOIDmode, - cond, cop1), + simplify_gen_relational (cond_code, + mode, + VOIDmode, + cond, + cop1), true_rtx, false_rtx); code = GET_CODE (x); @@ -3710,44 +4272,36 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, temp = 0; switch (GET_RTX_CLASS (code)) { - case '1': + case RTX_UNARY: if (op0_mode == VOIDmode) op0_mode = GET_MODE (XEXP (x, 0)); temp = simplify_unary_operation (code, mode, XEXP (x, 0), op0_mode); break; - case '<': - if (! VECTOR_MODE_P (mode)) - { - enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0)); - if (cmp_mode == VOIDmode) - { - cmp_mode = GET_MODE (XEXP (x, 1)); - if (cmp_mode == VOIDmode) - cmp_mode = op0_mode; - } - temp = simplify_relational_operation (code, cmp_mode, - XEXP (x, 0), XEXP (x, 1)); -#ifdef FLOAT_STORE_FLAG_VALUE - if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT) - { - if (temp == const0_rtx) - temp = CONST0_RTX (mode); - else - temp = CONST_DOUBLE_FROM_REAL_VALUE - (FLOAT_STORE_FLAG_VALUE (mode), mode); - } -#endif - } + case RTX_COMPARE: + case RTX_COMM_COMPARE: + { + enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0)); + if (cmp_mode == VOIDmode) + { + cmp_mode = GET_MODE (XEXP (x, 1)); + if (cmp_mode == VOIDmode) + cmp_mode = op0_mode; + } + temp = simplify_relational_operation (code, mode, cmp_mode, + XEXP (x, 0), XEXP (x, 1)); + } break; - case 'c': - case '2': + case RTX_COMM_ARITH: + case RTX_BIN_ARITH: temp = simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1)); break; - case 'b': - case '3': + case RTX_BITFIELD_OPS: + case RTX_TERNARY: temp = simplify_ternary_operation (code, mode, op0_mode, XEXP (x, 0), XEXP (x, 1), XEXP (x, 2)); break; + default: + break; } if (temp) @@ -3785,7 +4339,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, /* Make sure we pass the constant operand if any as the second one if this is a commutative operation. */ - if (CONSTANT_P (inner_op0) && GET_RTX_CLASS (code) == 'c') + if (CONSTANT_P (inner_op0) && COMMUTATIVE_ARITH_P (x)) { rtx tem = inner_op0; inner_op0 = inner_op1; @@ -3798,7 +4352,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, /* For commutative operations, try the other pair if that one didn't simplify. */ - if (inner == 0 && GET_RTX_CLASS (code) == 'c') + if (inner == 0 && COMMUTATIVE_ARITH_P (x)) { other = XEXP (XEXP (x, 0), 1); inner = simplify_binary_operation (code, mode, @@ -3807,7 +4361,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, } if (inner) - return gen_binary (code, mode, other, inner); + return simplify_gen_binary (code, mode, other, inner); } } @@ -3825,18 +4379,18 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, if (op0_mode == VOIDmode) op0_mode = GET_MODE (SUBREG_REG (x)); - /* simplify_subreg can't use gen_lowpart_for_combine. */ + /* See if this can be moved to simplify_subreg. */ if (CONSTANT_P (SUBREG_REG (x)) && subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x) - /* Don't call gen_lowpart_for_combine if the inner mode + /* Don't call gen_lowpart if the inner mode is VOIDmode and we cannot simplify it, as SUBREG without inner mode is invalid. */ && (GET_MODE (SUBREG_REG (x)) != VOIDmode || gen_lowpart_common (mode, SUBREG_REG (x)))) - return gen_lowpart_for_combine (mode, SUBREG_REG (x)); + return gen_lowpart (mode, SUBREG_REG (x)); if (GET_MODE_CLASS (GET_MODE (SUBREG_REG (x))) == MODE_CC) - break; + break; { rtx temp; temp = simplify_subreg (mode, SUBREG_REG (x), op0_mode, @@ -3847,7 +4401,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, /* Don't change the mode of the MEM if that would change the meaning of the address. */ - if (GET_CODE (SUBREG_REG (x)) == MEM + if (MEM_P (SUBREG_REG (x)) && (MEM_VOLATILE_P (SUBREG_REG (x)) || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0)))) return gen_rtx_CLOBBER (mode, const0_rtx); @@ -3858,59 +4412,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, break; - case NOT: - if (GET_CODE (XEXP (x, 0)) == SUBREG - && subreg_lowpart_p (XEXP (x, 0)) - && (GET_MODE_SIZE (GET_MODE (XEXP (x, 0))) - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (x, 0))))) - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == ASHIFT - && XEXP (SUBREG_REG (XEXP (x, 0)), 0) == const1_rtx) - { - enum machine_mode inner_mode = GET_MODE (SUBREG_REG (XEXP (x, 0))); - - x = gen_rtx_ROTATE (inner_mode, - simplify_gen_unary (NOT, inner_mode, const1_rtx, - inner_mode), - XEXP (SUBREG_REG (XEXP (x, 0)), 1)); - return gen_lowpart_for_combine (mode, x); - } - - /* Apply De Morgan's laws to reduce number of patterns for machines - with negating logical insns (and-not, nand, etc.). If result has - only one NOT, put it first, since that is how the patterns are - coded. */ - - if (GET_CODE (XEXP (x, 0)) == IOR || GET_CODE (XEXP (x, 0)) == AND) - { - rtx in1 = XEXP (XEXP (x, 0), 0), in2 = XEXP (XEXP (x, 0), 1); - enum machine_mode op_mode; - - op_mode = GET_MODE (in1); - in1 = simplify_gen_unary (NOT, op_mode, in1, op_mode); - - op_mode = GET_MODE (in2); - if (op_mode == VOIDmode) - op_mode = mode; - in2 = simplify_gen_unary (NOT, op_mode, in2, op_mode); - - if (GET_CODE (in2) == NOT && GET_CODE (in1) != NOT) - { - rtx tem = in2; - in2 = in1; in1 = tem; - } - - return gen_rtx_fmt_ee (GET_CODE (XEXP (x, 0)) == IOR ? AND : IOR, - mode, in1, in2); - } - break; - case NEG: - /* (neg (xor A 1)) is (plus A -1) if A is known to be either 0 or 1. */ - if (GET_CODE (XEXP (x, 0)) == XOR - && XEXP (XEXP (x, 0), 1) == const1_rtx - && nonzero_bits (XEXP (XEXP (x, 0), 0), mode) == 1) - return gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), constm1_rtx); - temp = expand_compound_operation (XEXP (x, 0)); /* For C equal to the width of MODE minus 1, (neg (ashiftrt X C)) can be @@ -3920,7 +4422,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, if (GET_CODE (temp) == ASHIFTRT && GET_CODE (XEXP (temp, 1)) == CONST_INT && INTVAL (XEXP (temp, 1)) == GET_MODE_BITSIZE (mode) - 1) - return simplify_shift_const (temp, LSHIFTRT, mode, XEXP (temp, 0), + return simplify_shift_const (NULL_RTX, LSHIFTRT, mode, XEXP (temp, 0), INTVAL (XEXP (temp, 1))); /* If X has only a single bit that might be nonzero, say, bit I, convert @@ -3930,9 +4432,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, or a SUBREG of one since we'd be making the expression more complex if it was just a register. */ - if (GET_CODE (temp) != REG + if (!REG_P (temp) && ! (GET_CODE (temp) == SUBREG - && GET_CODE (SUBREG_REG (temp)) == REG) + && REG_P (SUBREG_REG (temp))) && (i = exact_log2 (nonzero_bits (temp, mode))) >= 0) { rtx temp1 = simplify_shift_const @@ -3963,133 +4465,18 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))) SUBST (XEXP (x, 0), force_to_mode (XEXP (x, 0), GET_MODE (XEXP (x, 0)), - GET_MODE_MASK (mode), NULL_RTX, 0)); + GET_MODE_MASK (mode), 0)); - /* (truncate:SI ({sign,zero}_extend:DI foo:SI)) == foo:SI. */ - if ((GET_CODE (XEXP (x, 0)) == SIGN_EXTEND - || GET_CODE (XEXP (x, 0)) == ZERO_EXTEND) - && GET_MODE (XEXP (XEXP (x, 0), 0)) == mode) - return XEXP (XEXP (x, 0), 0); - - /* (truncate:SI (OP:DI ({sign,zero}_extend:DI foo:SI))) is - (OP:SI foo:SI) if OP is NEG or ABS. */ - if ((GET_CODE (XEXP (x, 0)) == ABS - || GET_CODE (XEXP (x, 0)) == NEG) - && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SIGN_EXTEND - || GET_CODE (XEXP (XEXP (x, 0), 0)) == ZERO_EXTEND) - && GET_MODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == mode) - return simplify_gen_unary (GET_CODE (XEXP (x, 0)), mode, - XEXP (XEXP (XEXP (x, 0), 0), 0), mode); - - /* (truncate:SI (subreg:DI (truncate:SI X) 0)) is - (truncate:SI x). */ - if (GET_CODE (XEXP (x, 0)) == SUBREG - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == TRUNCATE - && subreg_lowpart_p (XEXP (x, 0))) - return SUBREG_REG (XEXP (x, 0)); - - /* If we know that the value is already truncated, we can - replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION - is nonzero for the corresponding modes. But don't do this - for an (LSHIFTRT (MULT ...)) since this will cause problems - with the umulXi3_highpart patterns. */ - if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), - GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))) - && num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) - >= (unsigned int) (GET_MODE_BITSIZE (mode) + 1) - && ! (GET_CODE (XEXP (x, 0)) == LSHIFTRT - && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT)) - return gen_lowpart_for_combine (mode, XEXP (x, 0)); - - /* A truncate of a comparison can be replaced with a subreg if - STORE_FLAG_VALUE permits. This is like the previous test, - but it works even if the comparison is done in a mode larger - than HOST_BITS_PER_WIDE_INT. */ - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' - && ((HOST_WIDE_INT) STORE_FLAG_VALUE & ~GET_MODE_MASK (mode)) == 0) - return gen_lowpart_for_combine (mode, XEXP (x, 0)); - - /* Similarly, a truncate of a register whose value is a - comparison can be replaced with a subreg if STORE_FLAG_VALUE - permits. */ + /* Similarly to what we do in simplify-rtx.c, a truncate of a register + whose value is a comparison can be replaced with a subreg if + STORE_FLAG_VALUE permits. */ if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && ((HOST_WIDE_INT) STORE_FLAG_VALUE & ~GET_MODE_MASK (mode)) == 0 && (temp = get_last_value (XEXP (x, 0))) - && GET_RTX_CLASS (GET_CODE (temp)) == '<') - return gen_lowpart_for_combine (mode, XEXP (x, 0)); - + && COMPARISON_P (temp)) + return gen_lowpart (mode, XEXP (x, 0)); break; - case FLOAT_TRUNCATE: - /* (float_truncate:SF (float_extend:DF foo:SF)) = foo:SF. */ - if (GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND - && GET_MODE (XEXP (XEXP (x, 0), 0)) == mode) - return XEXP (XEXP (x, 0), 0); - - /* (float_truncate:SF (float_truncate:DF foo:XF)) - = (float_truncate:SF foo:XF). - This may eliminate double rounding, so it is unsafe. - - (float_truncate:SF (float_extend:XF foo:DF)) - = (float_truncate:SF foo:DF). - - (float_truncate:DF (float_extend:XF foo:SF)) - = (float_extend:SF foo:DF). */ - if ((GET_CODE (XEXP (x, 0)) == FLOAT_TRUNCATE - && flag_unsafe_math_optimizations) - || GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND) - return simplify_gen_unary (GET_MODE_SIZE (GET_MODE (XEXP (XEXP (x, 0), - 0))) - > GET_MODE_SIZE (mode) - ? FLOAT_TRUNCATE : FLOAT_EXTEND, - mode, - XEXP (XEXP (x, 0), 0), mode); - - /* (float_truncate (float x)) is (float x) */ - if (GET_CODE (XEXP (x, 0)) == FLOAT - && (flag_unsafe_math_optimizations - || ((unsigned)significand_size (GET_MODE (XEXP (x, 0))) - >= (GET_MODE_BITSIZE (GET_MODE (XEXP (XEXP (x, 0), 0))) - - num_sign_bit_copies (XEXP (XEXP (x, 0), 0), - GET_MODE (XEXP (XEXP (x, 0), 0))))))) - return simplify_gen_unary (FLOAT, mode, - XEXP (XEXP (x, 0), 0), - GET_MODE (XEXP (XEXP (x, 0), 0))); - - /* (float_truncate:SF (OP:DF (float_extend:DF foo:sf))) is - (OP:SF foo:SF) if OP is NEG or ABS. */ - if ((GET_CODE (XEXP (x, 0)) == ABS - || GET_CODE (XEXP (x, 0)) == NEG) - && GET_CODE (XEXP (XEXP (x, 0), 0)) == FLOAT_EXTEND - && GET_MODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == mode) - return simplify_gen_unary (GET_CODE (XEXP (x, 0)), mode, - XEXP (XEXP (XEXP (x, 0), 0), 0), mode); - - /* (float_truncate:SF (subreg:DF (float_truncate:SF X) 0)) - is (float_truncate:SF x). */ - if (GET_CODE (XEXP (x, 0)) == SUBREG - && subreg_lowpart_p (XEXP (x, 0)) - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == FLOAT_TRUNCATE) - return SUBREG_REG (XEXP (x, 0)); - break; - case FLOAT_EXTEND: - /* (float_extend (float_extend x)) is (float_extend x) - - (float_extend (float x)) is (float x) assuming that double - rounding can't happen. - */ - if (GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND - || (GET_CODE (XEXP (x, 0)) == FLOAT - && ((unsigned)significand_size (GET_MODE (XEXP (x, 0))) - >= (GET_MODE_BITSIZE (GET_MODE (XEXP (XEXP (x, 0), 0))) - - num_sign_bit_copies (XEXP (XEXP (x, 0), 0), - GET_MODE (XEXP (XEXP (x, 0), 0))))))) - return simplify_gen_unary (GET_CODE (XEXP (x, 0)), mode, - XEXP (XEXP (x, 0), 0), - GET_MODE (XEXP (XEXP (x, 0), 0))); - - break; #ifdef HAVE_cc0 case COMPARE: /* Convert (compare FOO (const_int 0)) to FOO unless we aren't @@ -4128,30 +4515,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, #endif case PLUS: - /* Canonicalize (plus (mult (neg B) C) A) to (minus A (mult B C)). - */ - if (GET_CODE (XEXP (x, 0)) == MULT - && GET_CODE (XEXP (XEXP (x, 0), 0)) == NEG) - { - rtx in1, in2; - - in1 = XEXP (XEXP (XEXP (x, 0), 0), 0); - in2 = XEXP (XEXP (x, 0), 1); - return gen_binary (MINUS, mode, XEXP (x, 1), - gen_binary (MULT, mode, in1, in2)); - } - - /* If we have (plus (plus (A const) B)), associate it so that CONST is - outermost. That's because that's the way indexed addresses are - supposed to appear. This code used to check many more cases, but - they are now checked elsewhere. */ - if (GET_CODE (XEXP (x, 0)) == PLUS - && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1))) - return gen_binary (PLUS, mode, - gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), - XEXP (x, 1)), - XEXP (XEXP (x, 0), 1)); - /* (plus (xor (and (const_int pow2 - 1)) ) <-c>) when c is (const_int (pow2 + 1) / 2) is a sign extension of a bit-field and can be replaced by either a sign_extend or a @@ -4178,27 +4541,14 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, GET_MODE_BITSIZE (mode) - (i + 1)), GET_MODE_BITSIZE (mode) - (i + 1)); - /* (plus (comparison A B) C) can become (neg (rev-comp A B)) if - C is 1 and STORE_FLAG_VALUE is -1 or if C is -1 and STORE_FLAG_VALUE - is 1. This produces better code than the alternative immediately - below. */ - if (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' - && ((STORE_FLAG_VALUE == -1 && XEXP (x, 1) == const1_rtx) - || (STORE_FLAG_VALUE == 1 && XEXP (x, 1) == constm1_rtx)) - && (reversed = reversed_comparison (XEXP (x, 0), mode, - XEXP (XEXP (x, 0), 0), - XEXP (XEXP (x, 0), 1)))) - return - simplify_gen_unary (NEG, mode, reversed, mode); - /* If only the low-order bit of X is possibly nonzero, (plus x -1) can become (ashiftrt (ashift (xor x 1) C) C) where C is the bitsize of the mode - 1. This allows simplification of "a = (b & 8) == 0;" */ if (XEXP (x, 1) == constm1_rtx - && GET_CODE (XEXP (x, 0)) != REG + && !REG_P (XEXP (x, 0)) && ! (GET_CODE (XEXP (x, 0)) == SUBREG - && GET_CODE (SUBREG_REG (XEXP (x, 0))) == REG) + && REG_P (SUBREG_REG (XEXP (x, 0)))) && nonzero_bits (XEXP (x, 0), mode) == 1) return simplify_shift_const (NULL_RTX, ASHIFTRT, mode, simplify_shift_const (NULL_RTX, ASHIFT, mode, @@ -4216,8 +4566,8 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, & nonzero_bits (XEXP (x, 1), mode)) == 0) { /* Try to simplify the expression further. */ - rtx tor = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); - temp = combine_simplify_rtx (tor, mode, last, in_dest); + rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); + temp = combine_simplify_rtx (tor, mode, in_dest); /* If we could, great. If not, do not go ahead with the IOR replacement, since PLUS appears in many special purpose @@ -4228,16 +4578,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, break; case MINUS: - /* If STORE_FLAG_VALUE is 1, (minus 1 (comparison foo bar)) can be done - by reversing the comparison code if valid. */ - if (STORE_FLAG_VALUE == 1 - && XEXP (x, 0) == const1_rtx - && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<' - && (reversed = reversed_comparison (XEXP (x, 1), mode, - XEXP (XEXP (x, 1), 0), - XEXP (XEXP (x, 1), 1)))) - return reversed; - /* (minus (and (const_int -pow2))) becomes (and (const_int pow2-1)) */ if (GET_CODE (XEXP (x, 1)) == AND @@ -4246,40 +4586,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && rtx_equal_p (XEXP (XEXP (x, 1), 0), XEXP (x, 0))) return simplify_and_const_int (NULL_RTX, mode, XEXP (x, 0), -INTVAL (XEXP (XEXP (x, 1), 1)) - 1); - - /* Canonicalize (minus A (mult (neg B) C)) to (plus (mult B C) A). - */ - if (GET_CODE (XEXP (x, 1)) == MULT - && GET_CODE (XEXP (XEXP (x, 1), 0)) == NEG) - { - rtx in1, in2; - - in1 = XEXP (XEXP (XEXP (x, 1), 0), 0); - in2 = XEXP (XEXP (x, 1), 1); - return gen_binary (PLUS, mode, gen_binary (MULT, mode, in1, in2), - XEXP (x, 0)); - } - - /* Canonicalize (minus (neg A) (mult B C)) to - (minus (mult (neg B) C) A). */ - if (GET_CODE (XEXP (x, 1)) == MULT - && GET_CODE (XEXP (x, 0)) == NEG) - { - rtx in1, in2; - - in1 = simplify_gen_unary (NEG, mode, XEXP (XEXP (x, 1), 0), mode); - in2 = XEXP (XEXP (x, 1), 1); - return gen_binary (MINUS, mode, gen_binary (MULT, mode, in1, in2), - XEXP (XEXP (x, 0), 0)); - } - - /* Canonicalize (minus A (plus B C)) to (minus (minus A B) C) for - integers. */ - if (GET_CODE (XEXP (x, 1)) == PLUS && INTEGRAL_MODE_P (mode)) - return gen_binary (MINUS, mode, - gen_binary (MINUS, mode, XEXP (x, 0), - XEXP (XEXP (x, 1), 0)), - XEXP (XEXP (x, 1), 1)); break; case MULT: @@ -4289,17 +4595,11 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, if (GET_CODE (XEXP (x, 0)) == PLUS) { - x = apply_distributive_law - (gen_binary (PLUS, mode, - gen_binary (MULT, mode, - XEXP (XEXP (x, 0), 0), XEXP (x, 1)), - gen_binary (MULT, mode, - XEXP (XEXP (x, 0), 1), - copy_rtx (XEXP (x, 1))))); - - if (GET_CODE (x) != MULT) - return x; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } + /* Try simplify a*(b/c) as (a*b)/c. */ if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations && GET_CODE (XEXP (x, 0)) == DIV) @@ -4308,7 +4608,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, XEXP (XEXP (x, 0), 0), XEXP (x, 1)); if (tem) - return gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1)); + return simplify_gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1)); } break; @@ -4365,8 +4665,8 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && op1 == const0_rtx && mode == GET_MODE (op0) && nonzero_bits (op0, mode) == 1) - return gen_lowpart_for_combine (mode, - expand_compound_operation (op0)); + return gen_lowpart (mode, + expand_compound_operation (op0)); else if (STORE_FLAG_VALUE == 1 && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT @@ -4377,7 +4677,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, { op0 = expand_compound_operation (op0); return simplify_gen_unary (NEG, mode, - gen_lowpart_for_combine (mode, op0), + gen_lowpart (mode, op0), mode); } @@ -4388,9 +4688,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && nonzero_bits (op0, mode) == 1) { op0 = expand_compound_operation (op0); - return gen_binary (XOR, mode, - gen_lowpart_for_combine (mode, op0), - const1_rtx); + return simplify_gen_binary (XOR, mode, + gen_lowpart (mode, op0), + const1_rtx); } else if (STORE_FLAG_VALUE == 1 @@ -4401,7 +4701,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, == GET_MODE_BITSIZE (mode))) { op0 = expand_compound_operation (op0); - return plus_constant (gen_lowpart_for_combine (mode, op0), 1); + return plus_constant (gen_lowpart (mode, op0), 1); } /* If STORE_FLAG_VALUE is -1, we have cases similar to @@ -4411,8 +4711,8 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && op1 == const0_rtx && (num_sign_bit_copies (op0, mode) == GET_MODE_BITSIZE (mode))) - return gen_lowpart_for_combine (mode, - expand_compound_operation (op0)); + return gen_lowpart (mode, + expand_compound_operation (op0)); else if (STORE_FLAG_VALUE == -1 && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT @@ -4422,7 +4722,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, { op0 = expand_compound_operation (op0); return simplify_gen_unary (NEG, mode, - gen_lowpart_for_combine (mode, op0), + gen_lowpart (mode, op0), mode); } @@ -4435,7 +4735,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, { op0 = expand_compound_operation (op0); return simplify_gen_unary (NOT, mode, - gen_lowpart_for_combine (mode, op0), + gen_lowpart (mode, op0), mode); } @@ -4447,7 +4747,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, && nonzero_bits (op0, mode) == 1) { op0 = expand_compound_operation (op0); - return plus_constant (gen_lowpart_for_combine (mode, op0), -1); + return plus_constant (gen_lowpart (mode, op0), -1); } /* If STORE_FLAG_VALUE says to just test the sign bit and X has just @@ -4501,54 +4801,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, case AND: case IOR: - case XOR: - return simplify_logical (x, last); - - case ABS: - /* (abs (neg )) -> (abs ) */ - if (GET_CODE (XEXP (x, 0)) == NEG) - SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0)); - - /* If the mode of the operand is VOIDmode (i.e. if it is ASM_OPERANDS), - do nothing. */ - if (GET_MODE (XEXP (x, 0)) == VOIDmode) - break; - - /* If operand is something known to be positive, ignore the ABS. */ - if (GET_CODE (XEXP (x, 0)) == FFS || GET_CODE (XEXP (x, 0)) == ABS - || ((GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - <= HOST_BITS_PER_WIDE_INT) - && ((nonzero_bits (XEXP (x, 0), GET_MODE (XEXP (x, 0))) - & ((HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - 1))) - == 0))) - return XEXP (x, 0); - - /* If operand is known to be only -1 or 0, convert ABS to NEG. */ - if (num_sign_bit_copies (XEXP (x, 0), mode) == GET_MODE_BITSIZE (mode)) - return gen_rtx_NEG (mode, XEXP (x, 0)); - - break; - - case FFS: - /* (ffs (*_extend )) = (ffs ) */ - if (GET_CODE (XEXP (x, 0)) == SIGN_EXTEND - || GET_CODE (XEXP (x, 0)) == ZERO_EXTEND) - SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0)); - break; - - case POPCOUNT: - case PARITY: - /* (pop* (zero_extend )) = (pop* ) */ - if (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND) - SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0)); - break; - - case FLOAT: - /* (float (sign_extend )) = (float ). */ - if (GET_CODE (XEXP (x, 0)) == SIGN_EXTEND) - SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0)); - break; + return simplify_logical (x); case ASHIFT: case LSHIFTRT: @@ -4560,52 +4813,13 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, return simplify_shift_const (x, code, mode, XEXP (x, 0), INTVAL (XEXP (x, 1))); - else if (SHIFT_COUNT_TRUNCATED && GET_CODE (XEXP (x, 1)) != REG) + else if (SHIFT_COUNT_TRUNCATED && !REG_P (XEXP (x, 1))) SUBST (XEXP (x, 1), force_to_mode (XEXP (x, 1), GET_MODE (XEXP (x, 1)), ((HOST_WIDE_INT) 1 << exact_log2 (GET_MODE_BITSIZE (GET_MODE (x)))) - 1, - NULL_RTX, 0)); - break; - - case VEC_SELECT: - { - rtx op0 = XEXP (x, 0); - rtx op1 = XEXP (x, 1); - int len; - - if (GET_CODE (op1) != PARALLEL) - abort (); - len = XVECLEN (op1, 0); - if (len == 1 - && GET_CODE (XVECEXP (op1, 0, 0)) == CONST_INT - && GET_CODE (op0) == VEC_CONCAT) - { - int offset = INTVAL (XVECEXP (op1, 0, 0)) * GET_MODE_SIZE (GET_MODE (x)); - - /* Try to find the element in the VEC_CONCAT. */ - for (;;) - { - if (GET_MODE (op0) == GET_MODE (x)) - return op0; - if (GET_CODE (op0) == VEC_CONCAT) - { - HOST_WIDE_INT op0_size = GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))); - if (op0_size < offset) - op0 = XEXP (op0, 0); - else - { - offset -= op0_size; - op0 = XEXP (op0, 1); - } - } - else - break; - } - } - } - + 0)); break; default: @@ -4625,7 +4839,7 @@ simplify_if_then_else (rtx x) rtx true_rtx = XEXP (x, 1); rtx false_rtx = XEXP (x, 2); enum rtx_code true_code = GET_CODE (cond); - int comparison_p = GET_RTX_CLASS (true_code) == '<'; + int comparison_p = COMPARISON_P (cond); rtx temp; int i; enum rtx_code false_code; @@ -4633,13 +4847,13 @@ simplify_if_then_else (rtx x) /* Simplify storing of the truth value. */ if (comparison_p && true_rtx == const_true_rtx && false_rtx == const0_rtx) - return gen_binary (true_code, mode, XEXP (cond, 0), XEXP (cond, 1)); + return simplify_gen_relational (true_code, mode, VOIDmode, + XEXP (cond, 0), XEXP (cond, 1)); /* Also when the truth value has to be reversed. */ if (comparison_p && true_rtx == const0_rtx && false_rtx == const_true_rtx - && (reversed = reversed_comparison (cond, mode, XEXP (cond, 0), - XEXP (cond, 1)))) + && (reversed = reversed_comparison (cond, mode))) return reversed; /* Sometimes we can simplify the arm of an IF_THEN_ELSE if a register used @@ -4647,9 +4861,9 @@ simplify_if_then_else (rtx x) comparisons and see if that says anything about the value of each arm. */ if (comparison_p - && ((false_code = combine_reversed_comparison_code (cond)) + && ((false_code = reversed_comparison_code (cond, NULL)) != UNKNOWN) - && GET_CODE (XEXP (cond, 0)) == REG) + && REG_P (XEXP (cond, 0))) { HOST_WIDE_INT nzb; rtx from = XEXP (cond, 0); @@ -4705,24 +4919,19 @@ simplify_if_then_else (rtx x) the false arm is more complicated than the true arm. */ if (comparison_p - && combine_reversed_comparison_code (cond) != UNKNOWN + && reversed_comparison_code (cond, NULL) != UNKNOWN && (true_rtx == pc_rtx || (CONSTANT_P (true_rtx) && GET_CODE (false_rtx) != CONST_INT && false_rtx != pc_rtx) || true_rtx == const0_rtx - || (GET_RTX_CLASS (GET_CODE (true_rtx)) == 'o' - && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o') - || (GET_CODE (true_rtx) == SUBREG - && GET_RTX_CLASS (GET_CODE (SUBREG_REG (true_rtx))) == 'o' - && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o') + || (OBJECT_P (true_rtx) && !OBJECT_P (false_rtx)) + || (GET_CODE (true_rtx) == SUBREG && OBJECT_P (SUBREG_REG (true_rtx)) + && !OBJECT_P (false_rtx)) || reg_mentioned_p (true_rtx, false_rtx) || rtx_equal_p (false_rtx, XEXP (cond, 0)))) { true_code = reversed_comparison_code (cond, NULL); - SUBST (XEXP (x, 0), - reversed_comparison (cond, GET_MODE (cond), XEXP (cond, 0), - XEXP (cond, 1))); - + SUBST (XEXP (x, 0), reversed_comparison (cond, GET_MODE (cond))); SUBST (XEXP (x, 1), false_rtx); SUBST (XEXP (x, 2), true_rtx); @@ -4731,7 +4940,7 @@ simplify_if_then_else (rtx x) /* It is possible that the conditional has been simplified out. */ true_code = GET_CODE (cond); - comparison_p = GET_RTX_CLASS (true_code) == '<'; + comparison_p = COMPARISON_P (cond); } /* If the two arms are identical, we don't need the comparison. */ @@ -4785,16 +4994,16 @@ simplify_if_then_else (rtx x) { case GE: case GT: - return gen_binary (SMAX, mode, true_rtx, false_rtx); + return simplify_gen_binary (SMAX, mode, true_rtx, false_rtx); case LE: case LT: - return gen_binary (SMIN, mode, true_rtx, false_rtx); + return simplify_gen_binary (SMIN, mode, true_rtx, false_rtx); case GEU: case GTU: - return gen_binary (UMAX, mode, true_rtx, false_rtx); + return simplify_gen_binary (UMAX, mode, true_rtx, false_rtx); case LEU: case LTU: - return gen_binary (UMIN, mode, true_rtx, false_rtx); + return simplify_gen_binary (UMIN, mode, true_rtx, false_rtx); default: break; } @@ -4815,7 +5024,7 @@ simplify_if_then_else (rtx x) rtx f = make_compound_operation (false_rtx, SET); rtx cond_op0 = XEXP (cond, 0); rtx cond_op1 = XEXP (cond, 1); - enum rtx_code op = NIL, extend_op = NIL; + enum rtx_code op = UNKNOWN, extend_op = UNKNOWN; enum machine_mode m = mode; rtx z = 0, c1 = NULL_RTX; @@ -4907,14 +5116,16 @@ simplify_if_then_else (rtx x) if (z) { - temp = subst (gen_binary (true_code, m, cond_op0, cond_op1), + temp = subst (simplify_gen_relational (true_code, m, VOIDmode, + cond_op0, cond_op1), pc_rtx, pc_rtx, 0, 0); - temp = gen_binary (MULT, m, temp, - gen_binary (MULT, m, c1, const_true_rtx)); + temp = simplify_gen_binary (MULT, m, temp, + simplify_gen_binary (MULT, m, c1, + const_true_rtx)); temp = subst (temp, pc_rtx, pc_rtx, 0, 0); - temp = gen_binary (op, m, gen_lowpart_for_combine (m, z), temp); + temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp); - if (extend_op != NIL) + if (extend_op != UNKNOWN) temp = simplify_gen_unary (extend_op, mode, temp, m); return temp; @@ -4935,7 +5146,7 @@ simplify_if_then_else (rtx x) && (i = exact_log2 (-INTVAL (true_rtx))) >= 0))) return simplify_shift_const (NULL_RTX, ASHIFT, mode, - gen_lowpart_for_combine (mode, XEXP (cond, 0)), i); + gen_lowpart (mode, XEXP (cond, 0)), i); /* (IF_THEN_ELSE (NE REG 0) (0) (8)) is REG for nonzero_bits (REG) == 8. */ if (true_code == NE && XEXP (cond, 1) == const0_rtx @@ -4972,7 +5183,7 @@ simplify_set (rtx x) if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) { - src = force_to_mode (src, mode, ~(HOST_WIDE_INT) 0, NULL_RTX, 0); + src = force_to_mode (src, mode, ~(HOST_WIDE_INT) 0, 0); SUBST (SET_SRC (x), src); } @@ -4984,7 +5195,7 @@ simplify_set (rtx x) || CC0_P (dest)) && (cc_use = find_single_use (dest, subst_insn, &other_insn)) != 0 && (undobuf.other_insn == 0 || other_insn == undobuf.other_insn) - && GET_RTX_CLASS (GET_CODE (*cc_use)) == '<' + && COMPARISON_P (*cc_use) && rtx_equal_p (XEXP (*cc_use, 0), dest)) { enum rtx_code old_code = GET_CODE (*cc_use); @@ -4992,22 +5203,23 @@ simplify_set (rtx x) rtx op0, op1, tmp; int other_changed = 0; enum machine_mode compare_mode = GET_MODE (dest); - enum machine_mode tmp_mode; if (GET_CODE (src) == COMPARE) op0 = XEXP (src, 0), op1 = XEXP (src, 1); else - op0 = src, op1 = const0_rtx; + op0 = src, op1 = CONST0_RTX (GET_MODE (src)); - /* Check whether the comparison is known at compile time. */ - if (GET_MODE (op0) != VOIDmode) - tmp_mode = GET_MODE (op0); - else if (GET_MODE (op1) != VOIDmode) - tmp_mode = GET_MODE (op1); + tmp = simplify_relational_operation (old_code, compare_mode, VOIDmode, + op0, op1); + if (!tmp) + new_code = old_code; + else if (!CONSTANT_P (tmp)) + { + new_code = GET_CODE (tmp); + op0 = XEXP (tmp, 0); + op1 = XEXP (tmp, 1); + } else - tmp_mode = compare_mode; - tmp = simplify_relational_operation (old_code, tmp_mode, op0, op1); - if (tmp != NULL_RTX) { rtx pat = PATTERN (other_insn); undobuf.other_insn = other_insn; @@ -5028,12 +5240,15 @@ simplify_set (rtx x) } /* Simplify our comparison, if possible. */ - new_code = simplify_comparison (old_code, &op0, &op1); + new_code = simplify_comparison (new_code, &op0, &op1); #ifdef SELECT_CC_MODE /* If this machine has CC modes other than CCmode, check to see if we need to use a different CC mode here. */ - compare_mode = SELECT_CC_MODE (new_code, op0, op1); + if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC) + compare_mode = GET_MODE (op0); + else + compare_mode = SELECT_CC_MODE (new_code, op0, op1); #ifndef HAVE_cc0 /* If the mode changed, we have to change SET_DEST, the mode in the @@ -5043,14 +5258,18 @@ simplify_set (rtx x) which case we can safely change its mode. */ if (compare_mode != GET_MODE (dest)) { - unsigned int regno = REGNO (dest); - rtx new_dest = gen_rtx_REG (compare_mode, regno); - - if (regno < FIRST_PSEUDO_REGISTER - || (REG_N_SETS (regno) == 1 && ! REG_USERVAR_P (dest))) + if (can_change_dest_mode (dest, 0, compare_mode)) { - if (regno >= FIRST_PSEUDO_REGISTER) - SUBST (regno_reg_rtx[regno], new_dest); + unsigned int regno = REGNO (dest); + rtx new_dest; + + if (regno < FIRST_PSEUDO_REGISTER) + new_dest = gen_rtx_REG (compare_mode, regno); + else + { + SUBST_MODE (regno_reg_rtx[regno], compare_mode); + new_dest = regno_reg_rtx[regno]; + } SUBST (SET_DEST (x), new_dest); SUBST (XEXP (*cc_use, 0), new_dest); @@ -5093,7 +5312,8 @@ simplify_set (rtx x) PUT_CODE (*cc_use, old_code); other_changed = 0; - op0 = gen_binary (XOR, GET_MODE (op0), op0, GEN_INT (mask)); + op0 = simplify_gen_binary (XOR, GET_MODE (op0), + op0, GEN_INT (mask)); } } } @@ -5119,6 +5339,11 @@ simplify_set (rtx x) SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1)); src = SET_SRC (x); } + else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx) + { + SUBST(SET_SRC (x), op0); + src = SET_SRC (x); + } else { /* Otherwise, update the COMPARE if needed. */ @@ -5147,27 +5372,27 @@ simplify_set (rtx x) as long as M1 and M2 have the same number of words. */ if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src) - && GET_RTX_CLASS (GET_CODE (SUBREG_REG (src))) != 'o' + && !OBJECT_P (SUBREG_REG (src)) && (((GET_MODE_SIZE (GET_MODE (src)) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) #ifndef WORD_REGISTER_OPERATIONS && (GET_MODE_SIZE (GET_MODE (src)) - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))) + < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))) #endif #ifdef CANNOT_CHANGE_MODE_CLASS - && ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER + && ! (REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER && REG_CANNOT_CHANGE_MODE_P (REGNO (dest), GET_MODE (SUBREG_REG (src)), GET_MODE (src))) #endif - && (GET_CODE (dest) == REG + && (REG_P (dest) || (GET_CODE (dest) == SUBREG - && GET_CODE (SUBREG_REG (dest)) == REG))) + && REG_P (SUBREG_REG (dest))))) { SUBST (SET_DEST (x), - gen_lowpart_for_combine (GET_MODE (SUBREG_REG (src)), + gen_lowpart (GET_MODE (SUBREG_REG (src)), dest)); SUBST (SET_SRC (x), SUBREG_REG (src)); @@ -5204,15 +5429,15 @@ simplify_set (rtx x) zero_extend to avoid the reload that would otherwise be required. */ if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src) - && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))) != NIL + && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))) != UNKNOWN && SUBREG_BYTE (src) == 0 && (GET_MODE_SIZE (GET_MODE (src)) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))) - && GET_CODE (SUBREG_REG (src)) == MEM) + && MEM_P (SUBREG_REG (src))) { SUBST (SET_SRC (x), - gen_rtx (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))), - GET_MODE (src), SUBREG_REG (src))); + gen_rtx_fmt_e (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))), + GET_MODE (src), SUBREG_REG (src))); src = SET_SRC (x); } @@ -5257,18 +5482,19 @@ simplify_set (rtx x) && rtx_equal_p (XEXP (false_rtx, 1), true_rtx)) term1 = true_rtx, false_rtx = XEXP (false_rtx, 0), true_rtx = const0_rtx; - term2 = gen_binary (AND, GET_MODE (src), - XEXP (XEXP (src, 0), 0), true_rtx); - term3 = gen_binary (AND, GET_MODE (src), - simplify_gen_unary (NOT, GET_MODE (src), - XEXP (XEXP (src, 0), 0), - GET_MODE (src)), - false_rtx); + term2 = simplify_gen_binary (AND, GET_MODE (src), + XEXP (XEXP (src, 0), 0), true_rtx); + term3 = simplify_gen_binary (AND, GET_MODE (src), + simplify_gen_unary (NOT, GET_MODE (src), + XEXP (XEXP (src, 0), 0), + GET_MODE (src)), + false_rtx); SUBST (SET_SRC (x), - gen_binary (IOR, GET_MODE (src), - gen_binary (IOR, GET_MODE (src), term1, term2), - term3)); + simplify_gen_binary (IOR, GET_MODE (src), + simplify_gen_binary (IOR, GET_MODE (src), + term1, term2), + term3)); src = SET_SRC (x); } @@ -5285,48 +5511,18 @@ simplify_set (rtx x) } /* Simplify, X, and AND, IOR, or XOR operation, and return the simplified - result. LAST is nonzero if this is the last retry. */ + result. */ static rtx -simplify_logical (rtx x, int last) +simplify_logical (rtx x) { enum machine_mode mode = GET_MODE (x); rtx op0 = XEXP (x, 0); rtx op1 = XEXP (x, 1); - rtx reversed; switch (GET_CODE (x)) { case AND: - /* Convert (A ^ B) & A to A & (~B) since the latter is often a single - insn (and may simplify more). */ - if (GET_CODE (op0) == XOR - && rtx_equal_p (XEXP (op0, 0), op1) - && ! side_effects_p (op1)) - x = gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 1), mode), - op1); - - if (GET_CODE (op0) == XOR - && rtx_equal_p (XEXP (op0, 1), op1) - && ! side_effects_p (op1)) - x = gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 0), mode), - op1); - - /* Similarly for (~(A ^ B)) & A. */ - if (GET_CODE (op0) == NOT - && GET_CODE (XEXP (op0, 0)) == XOR - && rtx_equal_p (XEXP (XEXP (op0, 0), 0), op1) - && ! side_effects_p (op1)) - x = gen_binary (AND, mode, XEXP (XEXP (op0, 0), 1), op1); - - if (GET_CODE (op0) == NOT - && GET_CODE (XEXP (op0, 0)) == XOR - && rtx_equal_p (XEXP (XEXP (op0, 0), 1), op1) - && ! side_effects_p (op1)) - x = gen_binary (AND, mode, XEXP (XEXP (op0, 0), 0), op1); - /* We can call simplify_and_const_int only if we don't lose any (sign) bits when converting INTVAL (op1) to "unsigned HOST_WIDE_INT". */ @@ -5335,250 +5531,51 @@ simplify_logical (rtx x, int last) || INTVAL (op1) > 0)) { x = simplify_and_const_int (x, mode, op0, INTVAL (op1)); - - /* If we have (ior (and (X C1) C2)) and the next restart would be - the last, simplify this by making C1 as small as possible - and then exit. */ - if (last - && GET_CODE (x) == IOR && GET_CODE (op0) == AND - && GET_CODE (XEXP (op0, 1)) == CONST_INT - && GET_CODE (op1) == CONST_INT) - return gen_binary (IOR, mode, - gen_binary (AND, mode, XEXP (op0, 0), - GEN_INT (INTVAL (XEXP (op0, 1)) - & ~INTVAL (op1))), op1); - if (GET_CODE (x) != AND) return x; - if (GET_RTX_CLASS (GET_CODE (x)) == 'c' - || GET_RTX_CLASS (GET_CODE (x)) == '2') - op0 = XEXP (x, 0), op1 = XEXP (x, 1); + op0 = XEXP (x, 0); + op1 = XEXP (x, 1); } - /* Convert (A | B) & A to A. */ - if (GET_CODE (op0) == IOR - && (rtx_equal_p (XEXP (op0, 0), op1) - || rtx_equal_p (XEXP (op0, 1), op1)) - && ! side_effects_p (XEXP (op0, 0)) - && ! side_effects_p (XEXP (op0, 1))) - return op1; - - /* In the following group of tests (and those in case IOR below), - we start with some combination of logical operations and apply - the distributive law followed by the inverse distributive law. - Most of the time, this results in no change. However, if some of - the operands are the same or inverses of each other, simplifications - will result. - - For example, (and (ior A B) (not B)) can occur as the result of - expanding a bit field assignment. When we apply the distributive - law to this, we get (ior (and (A (not B))) (and (B (not B)))), - which then simplifies to (and (A (not B))). - - If we have (and (ior A B) C), apply the distributive law and then - the inverse distributive law to see if things simplify. */ - + /* If we have any of (and (ior A B) C) or (and (xor A B) C), + apply the distributive law and then the inverse distributive + law to see if things simplify. */ if (GET_CODE (op0) == IOR || GET_CODE (op0) == XOR) { - x = apply_distributive_law - (gen_binary (GET_CODE (op0), mode, - gen_binary (AND, mode, XEXP (op0, 0), op1), - gen_binary (AND, mode, XEXP (op0, 1), - copy_rtx (op1)))); - if (GET_CODE (x) != AND) - return x; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } - if (GET_CODE (op1) == IOR || GET_CODE (op1) == XOR) - return apply_distributive_law - (gen_binary (GET_CODE (op1), mode, - gen_binary (AND, mode, XEXP (op1, 0), op0), - gen_binary (AND, mode, XEXP (op1, 1), - copy_rtx (op0)))); - - /* Similarly, taking advantage of the fact that - (and (not A) (xor B C)) == (xor (ior A B) (ior A C)) */ - - if (GET_CODE (op0) == NOT && GET_CODE (op1) == XOR) - return apply_distributive_law - (gen_binary (XOR, mode, - gen_binary (IOR, mode, XEXP (op0, 0), XEXP (op1, 0)), - gen_binary (IOR, mode, copy_rtx (XEXP (op0, 0)), - XEXP (op1, 1)))); - - else if (GET_CODE (op1) == NOT && GET_CODE (op0) == XOR) - return apply_distributive_law - (gen_binary (XOR, mode, - gen_binary (IOR, mode, XEXP (op1, 0), XEXP (op0, 0)), - gen_binary (IOR, mode, copy_rtx (XEXP (op1, 0)), XEXP (op0, 1)))); + { + rtx result = distribute_and_simplify_rtx (x, 1); + if (result) + return result; + } break; case IOR: - /* (ior A C) is C if all bits of A that might be nonzero are on in C. */ - if (GET_CODE (op1) == CONST_INT - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) & ~INTVAL (op1)) == 0) - return op1; - - /* Convert (A & B) | A to A. */ - if (GET_CODE (op0) == AND - && (rtx_equal_p (XEXP (op0, 0), op1) - || rtx_equal_p (XEXP (op0, 1), op1)) - && ! side_effects_p (XEXP (op0, 0)) - && ! side_effects_p (XEXP (op0, 1))) - return op1; - /* If we have (ior (and A B) C), apply the distributive law and then the inverse distributive law to see if things simplify. */ if (GET_CODE (op0) == AND) { - x = apply_distributive_law - (gen_binary (AND, mode, - gen_binary (IOR, mode, XEXP (op0, 0), op1), - gen_binary (IOR, mode, XEXP (op0, 1), - copy_rtx (op1)))); - - if (GET_CODE (x) != IOR) - return x; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } if (GET_CODE (op1) == AND) { - x = apply_distributive_law - (gen_binary (AND, mode, - gen_binary (IOR, mode, XEXP (op1, 0), op0), - gen_binary (IOR, mode, XEXP (op1, 1), - copy_rtx (op0)))); - - if (GET_CODE (x) != IOR) - return x; + rtx result = distribute_and_simplify_rtx (x, 1); + if (result) + return result; } - - /* Convert (ior (ashift A CX) (lshiftrt A CY)) where CX+CY equals the - mode size to (rotate A CX). */ - - if (((GET_CODE (op0) == ASHIFT && GET_CODE (op1) == LSHIFTRT) - || (GET_CODE (op1) == ASHIFT && GET_CODE (op0) == LSHIFTRT)) - && rtx_equal_p (XEXP (op0, 0), XEXP (op1, 0)) - && GET_CODE (XEXP (op0, 1)) == CONST_INT - && GET_CODE (XEXP (op1, 1)) == CONST_INT - && (INTVAL (XEXP (op0, 1)) + INTVAL (XEXP (op1, 1)) - == GET_MODE_BITSIZE (mode))) - return gen_rtx_ROTATE (mode, XEXP (op0, 0), - (GET_CODE (op0) == ASHIFT - ? XEXP (op0, 1) : XEXP (op1, 1))); - - /* If OP0 is (ashiftrt (plus ...) C), it might actually be - a (sign_extend (plus ...)). If so, OP1 is a CONST_INT, and the PLUS - does not affect any of the bits in OP1, it can really be done - as a PLUS and we can associate. We do this by seeing if OP1 - can be safely shifted left C bits. */ - if (GET_CODE (op1) == CONST_INT && GET_CODE (op0) == ASHIFTRT - && GET_CODE (XEXP (op0, 0)) == PLUS - && GET_CODE (XEXP (XEXP (op0, 0), 1)) == CONST_INT - && GET_CODE (XEXP (op0, 1)) == CONST_INT - && INTVAL (XEXP (op0, 1)) < HOST_BITS_PER_WIDE_INT) - { - int count = INTVAL (XEXP (op0, 1)); - HOST_WIDE_INT mask = INTVAL (op1) << count; - - if (mask >> count == INTVAL (op1) - && (mask & nonzero_bits (XEXP (op0, 0), mode)) == 0) - { - SUBST (XEXP (XEXP (op0, 0), 1), - GEN_INT (INTVAL (XEXP (XEXP (op0, 0), 1)) | mask)); - return op0; - } - } - break; - - case XOR: - /* If we are XORing two things that have no bits in common, - convert them into an IOR. This helps to detect rotation encoded - using those methods and possibly other simplifications. */ - - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) - & nonzero_bits (op1, mode)) == 0) - return (gen_binary (IOR, mode, op0, op1)); - - /* Convert (XOR (NOT x) (NOT y)) to (XOR x y). - Also convert (XOR (NOT x) y) to (NOT (XOR x y)), similarly for - (NOT y). */ - { - int num_negated = 0; - - if (GET_CODE (op0) == NOT) - num_negated++, op0 = XEXP (op0, 0); - if (GET_CODE (op1) == NOT) - num_negated++, op1 = XEXP (op1, 0); - - if (num_negated == 2) - { - SUBST (XEXP (x, 0), op0); - SUBST (XEXP (x, 1), op1); - } - else if (num_negated == 1) - return - simplify_gen_unary (NOT, mode, gen_binary (XOR, mode, op0, op1), - mode); - } - - /* Convert (xor (and A B) B) to (and (not A) B). The latter may - correspond to a machine insn or result in further simplifications - if B is a constant. */ - - if (GET_CODE (op0) == AND - && rtx_equal_p (XEXP (op0, 1), op1) - && ! side_effects_p (op1)) - return gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 0), mode), - op1); - - else if (GET_CODE (op0) == AND - && rtx_equal_p (XEXP (op0, 0), op1) - && ! side_effects_p (op1)) - return gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 1), mode), - op1); - - /* (xor (comparison foo bar) (const_int 1)) can become the reversed - comparison if STORE_FLAG_VALUE is 1. */ - if (STORE_FLAG_VALUE == 1 - && op1 == const1_rtx - && GET_RTX_CLASS (GET_CODE (op0)) == '<' - && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0), - XEXP (op0, 1)))) - return reversed; - - /* (lshiftrt foo C) where C is the number of bits in FOO minus 1 - is (lt foo (const_int 0)), so we can perform the above - simplification if STORE_FLAG_VALUE is 1. */ - - if (STORE_FLAG_VALUE == 1 - && op1 == const1_rtx - && GET_CODE (op0) == LSHIFTRT - && GET_CODE (XEXP (op0, 1)) == CONST_INT - && INTVAL (XEXP (op0, 1)) == GET_MODE_BITSIZE (mode) - 1) - return gen_rtx_GE (mode, XEXP (op0, 0), const0_rtx); - - /* (xor (comparison foo bar) (const_int sign-bit)) - when STORE_FLAG_VALUE is the sign bit. */ - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && ((STORE_FLAG_VALUE & GET_MODE_MASK (mode)) - == (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)) - && op1 == const_true_rtx - && GET_RTX_CLASS (GET_CODE (op0)) == '<' - && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0), - XEXP (op0, 1)))) - return reversed; - break; default: - abort (); + gcc_unreachable (); } return x; @@ -5650,6 +5647,9 @@ expand_compound_operation (rtx x) case ZERO_EXTRACT: unsignedp = 1; + + /* ... fall through ... */ + case SIGN_EXTRACT: /* If the operand is a CLOBBER, just return it. */ if (GET_CODE (XEXP (x, 0)) == CLOBBER) @@ -5669,11 +5669,9 @@ expand_compound_operation (rtx x) len = INTVAL (XEXP (x, 1)); pos = INTVAL (XEXP (x, 2)); - /* If this goes outside the object being extracted, replace the object - with a (use (mem ...)) construct that only combine understands - and is used only for this purpose. */ + /* This should stay within the object being extracted, fail otherwise. */ if (len + pos > GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))) - SUBST (XEXP (x, 0), gen_rtx_USE (GET_MODE (x), XEXP (x, 0))); + return x; if (BITS_BIG_ENDIAN) pos = GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - len - pos; @@ -5710,8 +5708,8 @@ expand_compound_operation (rtx x) if (GET_CODE (x) == ZERO_EXTEND) { /* (zero_extend:DI (truncate:SI foo:DI)) is just foo:DI if we - know that the last value didn't have any inappropriate bits - set. */ + know that the last value didn't have any inappropriate bits + set. */ if (GET_CODE (XEXP (x, 0)) == TRUNCATE && GET_MODE (XEXP (XEXP (x, 0), 0)) == GET_MODE (x) && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT @@ -5729,12 +5727,12 @@ expand_compound_operation (rtx x) return SUBREG_REG (XEXP (x, 0)); /* (zero_extend:DI (truncate:SI foo:DI)) is just foo:DI when foo - is a comparison and STORE_FLAG_VALUE permits. This is like - the first case, but it works even when GET_MODE (x) is larger - than HOST_WIDE_INT. */ + is a comparison and STORE_FLAG_VALUE permits. This is like + the first case, but it works even when GET_MODE (x) is larger + than HOST_WIDE_INT. */ if (GET_CODE (XEXP (x, 0)) == TRUNCATE && GET_MODE (XEXP (XEXP (x, 0), 0)) == GET_MODE (x) - && GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) == '<' + && COMPARISON_P (XEXP (XEXP (x, 0), 0)) && (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) <= HOST_BITS_PER_WIDE_INT) && ((HOST_WIDE_INT) STORE_FLAG_VALUE @@ -5745,7 +5743,7 @@ expand_compound_operation (rtx x) if (GET_CODE (XEXP (x, 0)) == SUBREG && GET_MODE (SUBREG_REG (XEXP (x, 0))) == GET_MODE (x) && subreg_lowpart_p (XEXP (x, 0)) - && GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0)))) == '<' + && COMPARISON_P (SUBREG_REG (XEXP (x, 0))) && (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) <= HOST_BITS_PER_WIDE_INT) && ((HOST_WIDE_INT) STORE_FLAG_VALUE @@ -5771,14 +5769,16 @@ expand_compound_operation (rtx x) modewidth = GET_MODE_BITSIZE (GET_MODE (x)); if (modewidth + len >= pos) - tem = simplify_shift_const (NULL_RTX, unsignedp ? LSHIFTRT : ASHIFTRT, - GET_MODE (x), - simplify_shift_const (NULL_RTX, ASHIFT, - GET_MODE (x), - XEXP (x, 0), - modewidth - pos - len), - modewidth - len); - + { + enum machine_mode mode = GET_MODE (x); + tem = gen_lowpart (mode, XEXP (x, 0)); + if (!tem || GET_CODE (tem) == CLOBBER) + return x; + tem = simplify_shift_const (NULL_RTX, ASHIFT, mode, + tem, modewidth - pos - len); + tem = simplify_shift_const (NULL_RTX, unsignedp ? LSHIFTRT : ASHIFTRT, + mode, tem, modewidth - len); + } else if (unsignedp && len < HOST_BITS_PER_WIDE_INT) tem = simplify_and_const_int (NULL_RTX, GET_MODE (x), simplify_shift_const (NULL_RTX, LSHIFTRT, @@ -5811,7 +5811,7 @@ expand_field_assignment (rtx x) rtx inner; rtx pos; /* Always counts from low bit. */ int len; - rtx mask; + rtx mask, cleared, masked; enum machine_mode compute_mode; /* Loop until we find something we can't simplify. */ @@ -5831,11 +5831,10 @@ expand_field_assignment (rtx x) len = INTVAL (XEXP (SET_DEST (x), 1)); pos = XEXP (SET_DEST (x), 2); - /* If the position is constant and spans the width of INNER, - surround INNER with a USE to indicate this. */ + /* A constant position should stay within the width of INNER. */ if (GET_CODE (pos) == CONST_INT && INTVAL (pos) + len > GET_MODE_BITSIZE (GET_MODE (inner))) - inner = gen_rtx_USE (GET_MODE (SET_DEST (x)), inner); + break; if (BITS_BIG_ENDIAN) { @@ -5849,10 +5848,11 @@ expand_field_assignment (rtx x) /* If position is ADJUST - X, new position is X. */ pos = XEXP (pos, 0); else - pos = gen_binary (MINUS, GET_MODE (pos), - GEN_INT (GET_MODE_BITSIZE (GET_MODE (inner)) - - len), - pos); + pos = simplify_gen_binary (MINUS, GET_MODE (pos), + GEN_INT (GET_MODE_BITSIZE ( + GET_MODE (inner)) + - len), + pos); } } @@ -5867,7 +5867,7 @@ expand_field_assignment (rtx x) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))) { x = gen_rtx_SET (VOIDmode, SUBREG_REG (SET_DEST (x)), - gen_lowpart_for_combine + gen_lowpart (GET_MODE (SUBREG_REG (SET_DEST (x))), SET_SRC (x))); continue; @@ -5895,34 +5895,34 @@ expand_field_assignment (rtx x) break; compute_mode = imode; - inner = gen_lowpart_for_combine (imode, inner); + inner = gen_lowpart (imode, inner); } /* Compute a mask of LEN bits, if we can do this on the host machine. */ - if (len < HOST_BITS_PER_WIDE_INT) - mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1); - else + if (len >= HOST_BITS_PER_WIDE_INT) break; /* Now compute the equivalent expression. Make a copy of INNER for the SET_DEST in case it is a MEM into which we will substitute; we don't want shared RTL in that case. */ - x = gen_rtx_SET - (VOIDmode, copy_rtx (inner), - gen_binary (IOR, compute_mode, - gen_binary (AND, compute_mode, - simplify_gen_unary (NOT, compute_mode, - gen_binary (ASHIFT, - compute_mode, - mask, pos), - compute_mode), - inner), - gen_binary (ASHIFT, compute_mode, - gen_binary (AND, compute_mode, - gen_lowpart_for_combine - (compute_mode, SET_SRC (x)), - mask), - pos))); + mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1); + cleared = simplify_gen_binary (AND, compute_mode, + simplify_gen_unary (NOT, compute_mode, + simplify_gen_binary (ASHIFT, + compute_mode, + mask, pos), + compute_mode), + inner); + masked = simplify_gen_binary (ASHIFT, compute_mode, + simplify_gen_binary ( + AND, compute_mode, + gen_lowpart (compute_mode, SET_SRC (x)), + mask), + pos); + + x = gen_rtx_SET (VOIDmode, copy_rtx (inner), + simplify_gen_binary (IOR, compute_mode, + cleared, masked)); } return x; @@ -5932,13 +5932,6 @@ expand_field_assignment (rtx x) it is an RTX that represents a variable starting position; otherwise, POS is the (constant) starting bit position (counted from the LSB). - INNER may be a USE. This will occur when we started with a bitfield - that went outside the boundary of the object in memory, which is - allowed on most machines. To isolate this case, we produce a USE - whose mode is wide enough and surround the MEM with it. The only - code that understands the USE is this routine. If it is not removed, - it will cause the resulting insn not to match. - UNSIGNEDP is nonzero for an unsigned reference and zero for a signed reference. @@ -5965,30 +5958,23 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, ignore the POS lowest bits, etc. */ enum machine_mode is_mode = GET_MODE (inner); enum machine_mode inner_mode; - enum machine_mode wanted_inner_mode = byte_mode; + enum machine_mode wanted_inner_mode; enum machine_mode wanted_inner_reg_mode = word_mode; enum machine_mode pos_mode = word_mode; enum machine_mode extraction_mode = word_mode; enum machine_mode tmode = mode_for_size (len, MODE_INT, 1); - int spans_byte = 0; rtx new = 0; rtx orig_pos_rtx = pos_rtx; HOST_WIDE_INT orig_pos; - /* Get some information about INNER and get the innermost object. */ - if (GET_CODE (inner) == USE) - /* (use:SI (mem:QI foo)) stands for (mem:SI foo). */ - /* We don't need to adjust the position because we set up the USE - to pretend that it was a full-word object. */ - spans_byte = 1, inner = XEXP (inner, 0); - else if (GET_CODE (inner) == SUBREG && subreg_lowpart_p (inner)) + if (GET_CODE (inner) == SUBREG && subreg_lowpart_p (inner)) { /* If going from (subreg:SI (mem:QI ...)) to (mem:QI ...), consider just the QI as the memory to extract from. The subreg adds or removes high bits; its mode is irrelevant to the meaning of this extraction, since POS and LEN count from the lsb. */ - if (GET_CODE (SUBREG_REG (inner)) == MEM) + if (MEM_P (SUBREG_REG (inner))) is_mode = GET_MODE (SUBREG_REG (inner)); inner = SUBREG_REG (inner); } @@ -6020,20 +6006,20 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, appropriate STRICT_LOW_PART operation available. For MEM, we can avoid an extract if the field starts on an appropriate - boundary and we can change the mode of the memory reference. However, - we cannot directly access the MEM if we have a USE and the underlying - MEM is not TMODE. This combination means that MEM was being used in a - context where bits outside its mode were being referenced; that is only - valid in bit-field insns. */ + boundary and we can change the mode of the memory reference. */ if (tmode != BLKmode - && ! (spans_byte && inner_mode != tmode) && ((pos_rtx == 0 && (pos % BITS_PER_WORD) == 0 - && GET_CODE (inner) != MEM + && !MEM_P (inner) + && (inner_mode == tmode + || !REG_P (inner) + || TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (tmode), + GET_MODE_BITSIZE (inner_mode)) + || reg_truncated_to_mode (tmode, inner)) && (! in_dest - || (GET_CODE (inner) == REG + || (REG_P (inner) && have_insn_for (STRICT_LOW_PART, tmode)))) - || (GET_CODE (inner) == MEM && pos_rtx == 0 + || (MEM_P (inner) && pos_rtx == 0 && (pos % (STRICT_ALIGNMENT ? GET_MODE_ALIGNMENT (tmode) : BITS_PER_UNIT)) == 0 @@ -6051,7 +6037,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, If INNER is not a MEM, get a piece consisting of just the field of interest (in this case POS % BITS_PER_WORD must be 0). */ - if (GET_CODE (inner) == MEM) + if (MEM_P (inner)) { HOST_WIDE_INT offset; @@ -6063,11 +6049,11 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, new = adjust_address_nv (inner, tmode, offset); } - else if (GET_CODE (inner) == REG) + else if (REG_P (inner)) { if (tmode != inner_mode) { - /* We can't call gen_lowpart_for_combine in a DEST since we + /* We can't call gen_lowpart in a DEST since we always want a SUBREG (see below) and it would sometimes return a new hard register. */ if (pos || in_dest) @@ -6088,13 +6074,13 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, /* Avoid creating invalid subregs, for example when simplifying (x>>32)&255. */ - if (final_word >= GET_MODE_SIZE (inner_mode)) + if (!validate_subreg (tmode, inner_mode, inner, final_word)) return NULL_RTX; new = gen_rtx_SUBREG (tmode, inner, final_word); } else - new = gen_lowpart_for_combine (tmode, inner); + new = gen_lowpart (tmode, inner); } else new = inner; @@ -6104,13 +6090,13 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, len >= HOST_BITS_PER_WIDE_INT ? ~(unsigned HOST_WIDE_INT) 0 : ((unsigned HOST_WIDE_INT) 1 << len) - 1, - NULL_RTX, 0); + 0); /* If this extraction is going into the destination of a SET, make a STRICT_LOW_PART unless we made a MEM. */ if (in_dest) - return (GET_CODE (new) == MEM ? new + return (MEM_P (new) ? new : (GET_CODE (new) != SUBREG ? gen_rtx_CLOBBER (tmode, const0_rtx) : gen_rtx_STRICT_LOW_PART (VOIDmode, new))); @@ -6153,15 +6139,14 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, don't do anything with zero-extending field extracts starting at the low-order bit since they are simple AND operations. */ if (pos_rtx == 0 && pos == 0 && ! in_dest - && ! in_compare && ! spans_byte && unsignedp) + && ! in_compare && unsignedp) return 0; - /* Unless we are allowed to span bytes or INNER is not MEM, reject this if - we would be spanning bytes or if the position is not a constant and the - length is not 1. In all other cases, we would only be going outside - our object in cases when an original shift would have been - undefined. */ - if (! spans_byte && GET_CODE (inner) == MEM + /* Unless INNER is not MEM, reject this if we would be spanning bytes or + if the position is not a constant and the length is not 1. In all + other cases, we would only be going outside our object in cases when + an original shift would have been undefined. */ + if (MEM_P (inner) && ((pos_rtx == 0 && pos + len > GET_MODE_BITSIZE (is_mode)) || (pos_rtx != 0 && len != 1))) return 0; @@ -6201,15 +6186,31 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, && GET_MODE_SIZE (pos_mode) < GET_MODE_SIZE (GET_MODE (pos_rtx))) pos_mode = GET_MODE (pos_rtx); - /* If this is not from memory, the desired mode is wanted_inner_reg_mode; - if we have to change the mode of memory and cannot, the desired mode is - EXTRACTION_MODE. */ - if (GET_CODE (inner) != MEM) + /* If this is not from memory, the desired mode is the preferred mode + for an extraction pattern's first input operand, or word_mode if there + is none. */ + if (!MEM_P (inner)) wanted_inner_mode = wanted_inner_reg_mode; - else if (inner_mode != wanted_inner_mode - && (mode_dependent_address_p (XEXP (inner, 0)) - || MEM_VOLATILE_P (inner))) - wanted_inner_mode = extraction_mode; + else + { + /* Be careful not to go beyond the extracted object and maintain the + natural alignment of the memory. */ + wanted_inner_mode = smallest_mode_for_size (len, MODE_INT); + while (pos % GET_MODE_BITSIZE (wanted_inner_mode) + len + > GET_MODE_BITSIZE (wanted_inner_mode)) + { + wanted_inner_mode = GET_MODE_WIDER_MODE (wanted_inner_mode); + gcc_assert (wanted_inner_mode != VOIDmode); + } + + /* If we have to change the mode of memory and cannot, the desired mode + is EXTRACTION_MODE. */ + if (inner_mode != wanted_inner_mode + && (mode_dependent_address_p (XEXP (inner, 0)) + || MEM_VOLATILE_P (inner) + || pos_rtx)) + wanted_inner_mode = extraction_mode; + } orig_pos = pos; @@ -6222,7 +6223,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, If it's a MEM we need to recompute POS relative to that. However, if we're extracting from (or inserting into) a register, we want to recompute POS relative to wanted_inner_mode. */ - int width = (GET_CODE (inner) == MEM + int width = (MEM_P (inner) ? GET_MODE_BITSIZE (is_mode) : GET_MODE_BITSIZE (wanted_inner_mode)); @@ -6232,18 +6233,19 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, pos_rtx = gen_rtx_MINUS (GET_MODE (pos_rtx), GEN_INT (width - len), pos_rtx); /* POS may be less than 0 now, but we check for that below. - Note that it can only be less than 0 if GET_CODE (inner) != MEM. */ + Note that it can only be less than 0 if !MEM_P (inner). */ } - /* If INNER has a wider mode, make it smaller. If this is a constant - extract, try to adjust the byte to point to the byte containing + /* If INNER has a wider mode, and this is a constant extraction, try to + make it smaller and adjust the byte to point to the byte containing the value. */ if (wanted_inner_mode != VOIDmode + && inner_mode != wanted_inner_mode + && ! pos_rtx && GET_MODE_SIZE (wanted_inner_mode) < GET_MODE_SIZE (is_mode) - && ((GET_CODE (inner) == MEM - && (inner_mode == wanted_inner_mode - || (! mode_dependent_address_p (XEXP (inner, 0)) - && ! MEM_VOLATILE_P (inner)))))) + && MEM_P (inner) + && ! mode_dependent_address_p (XEXP (inner, 0)) + && ! MEM_VOLATILE_P (inner)) { int offset = 0; @@ -6254,44 +6256,42 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, /* If bytes are big endian and we had a paradoxical SUBREG, we must adjust OFFSET to compensate. */ if (BYTES_BIG_ENDIAN - && ! spans_byte && GET_MODE_SIZE (inner_mode) < GET_MODE_SIZE (is_mode)) offset -= GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (inner_mode); - /* If this is a constant position, we can move to the desired byte. */ - if (pos_rtx == 0) - { - offset += pos / BITS_PER_UNIT; - pos %= GET_MODE_BITSIZE (wanted_inner_mode); - } + /* We can now move to the desired byte. */ + offset += (pos / GET_MODE_BITSIZE (wanted_inner_mode)) + * GET_MODE_SIZE (wanted_inner_mode); + pos %= GET_MODE_BITSIZE (wanted_inner_mode); if (BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN - && ! spans_byte && is_mode != wanted_inner_mode) offset = (GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (wanted_inner_mode) - offset); - if (offset != 0 || inner_mode != wanted_inner_mode) - inner = adjust_address_nv (inner, wanted_inner_mode, offset); + inner = adjust_address_nv (inner, wanted_inner_mode, offset); } /* If INNER is not memory, we can always get it into the proper mode. If we are changing its mode, POS must be a constant and smaller than the size of the new mode. */ - else if (GET_CODE (inner) != MEM) + else if (!MEM_P (inner)) { if (GET_MODE (inner) != wanted_inner_mode && (pos_rtx != 0 || orig_pos + len > GET_MODE_BITSIZE (wanted_inner_mode))) return 0; + if (orig_pos < 0) + return 0; + inner = force_to_mode (inner, wanted_inner_mode, pos_rtx || len + orig_pos >= HOST_BITS_PER_WIDE_INT ? ~(unsigned HOST_WIDE_INT) 0 : ((((unsigned HOST_WIDE_INT) 1 << len) - 1) << orig_pos), - NULL_RTX, 0); + 0); } /* Adjust mode of POS_RTX, if needed. If we want a wider mode, we @@ -6324,7 +6324,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, } else if (pos_rtx != 0 && GET_MODE_SIZE (pos_mode) < GET_MODE_SIZE (GET_MODE (pos_rtx))) - pos_rtx = gen_lowpart_for_combine (pos_mode, pos_rtx); + pos_rtx = gen_lowpart (pos_mode, pos_rtx); /* Make POS_RTX unless we already have it and it is correct. If we don't have a POS_RTX but we do have an ORIG_POS_RTX, the latter must @@ -6339,7 +6339,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, new = gen_rtx_fmt_eee (unsignedp ? ZERO_EXTRACT : SIGN_EXTRACT, extraction_mode, inner, GEN_INT (len), pos_rtx); if (! in_dest) - new = gen_lowpart_for_combine (mode, new); + new = gen_lowpart (mode, new); return new; } @@ -6378,8 +6378,8 @@ extract_left_shift (rtx x, int count) if (GET_CODE (XEXP (x, 1)) == CONST_INT && (INTVAL (XEXP (x, 1)) & ((((HOST_WIDE_INT) 1 << count)) - 1)) == 0 && (tem = extract_left_shift (XEXP (x, 0), count)) != 0) - return gen_binary (code, mode, tem, - GEN_INT (INTVAL (XEXP (x, 1)) >> count)); + return simplify_gen_binary (code, mode, tem, + GEN_INT (INTVAL (XEXP (x, 1)) >> count)); break; @@ -6426,7 +6426,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) but once inside, go back to our default of SET. */ next_code = (code == MEM || code == PLUS || code == MINUS ? MEM - : ((code == COMPARE || GET_RTX_CLASS (code) == '<') + : ((code == COMPARE || COMPARISON_P (x)) && XEXP (x, 1) == const0_rtx) ? COMPARE : in_code == COMPARE ? SET : in_code); @@ -6592,9 +6592,9 @@ make_compound_operation (rtx x, enum rtx_code in_code) also do this for some cases of SIGN_EXTRACT, but it doesn't seem worth the effort; the case checked for occurs on Alpha. */ - if (GET_RTX_CLASS (GET_CODE (lhs)) != 'o' + if (!OBJECT_P (lhs) && ! (GET_CODE (lhs) == SUBREG - && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (lhs))) == 'o')) + && (OBJECT_P (SUBREG_REG (lhs)))) && GET_CODE (rhs) == CONST_INT && INTVAL (rhs) < HOST_BITS_PER_WIDE_INT && (new = extract_left_shift (lhs, INTVAL (rhs))) != 0) @@ -6610,41 +6610,33 @@ make_compound_operation (rtx x, enum rtx_code in_code) what it originally did, do this SUBREG as a force_to_mode. */ tem = make_compound_operation (SUBREG_REG (x), in_code); - if (GET_CODE (tem) != GET_CODE (SUBREG_REG (x)) - && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (tem)) - && subreg_lowpart_p (x)) - { - rtx newer = force_to_mode (tem, mode, ~(HOST_WIDE_INT) 0, - NULL_RTX, 0); - /* If we have something other than a SUBREG, we might have - done an expansion, so rerun ourselves. */ - if (GET_CODE (newer) != SUBREG) - newer = make_compound_operation (newer, in_code); + { + rtx simplified; + simplified = simplify_subreg (GET_MODE (x), tem, GET_MODE (tem), + SUBREG_BYTE (x)); - return newer; - } + if (simplified) + tem = simplified; - /* If this is a paradoxical subreg, and the new code is a sign or - zero extension, omit the subreg and widen the extension. If it - is a regular subreg, we can still get rid of the subreg by not - widening so much, or in fact removing the extension entirely. */ - if ((GET_CODE (tem) == SIGN_EXTEND - || GET_CODE (tem) == ZERO_EXTEND) - && subreg_lowpart_p (x)) - { - if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (tem)) - || (GET_MODE_SIZE (mode) > - GET_MODE_SIZE (GET_MODE (XEXP (tem, 0))))) - { - if (! SCALAR_INT_MODE_P (mode)) - break; - tem = gen_rtx_fmt_e (GET_CODE (tem), mode, XEXP (tem, 0)); - } - else - tem = gen_lowpart_for_combine (mode, XEXP (tem, 0)); + if (GET_CODE (tem) != GET_CODE (SUBREG_REG (x)) + && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (tem)) + && subreg_lowpart_p (x)) + { + rtx newer = force_to_mode (tem, mode, ~(HOST_WIDE_INT) 0, + 0); + + /* If we have something other than a SUBREG, we might have + done an expansion, so rerun ourselves. */ + if (GET_CODE (newer) != SUBREG) + newer = make_compound_operation (newer, in_code); + + return newer; + } + + if (simplified) return tem; - } + } break; default: @@ -6653,7 +6645,7 @@ make_compound_operation (rtx x, enum rtx_code in_code) if (new) { - x = gen_lowpart_for_combine (mode, new); + x = gen_lowpart (mode, new); code = GET_CODE (x); } @@ -6666,6 +6658,16 @@ make_compound_operation (rtx x, enum rtx_code in_code) SUBST (XEXP (x, i), new); } + /* If this is a commutative operation, the changes to the operands + may have made it noncanonical. */ + if (COMMUTATIVE_ARITH_P (x) + && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1))) + { + tem = XEXP (x, 0); + SUBST (XEXP (x, 0), XEXP (x, 1)); + SUBST (XEXP (x, 1), tem); + } + return x; } @@ -6681,22 +6683,135 @@ get_pos_from_mask (unsigned HOST_WIDE_INT m, unsigned HOST_WIDE_INT *plen) { /* Get the bit number of the first 1 bit from the right, -1 if none. */ int pos = exact_log2 (m & -m); - int len; + int len = 0; - if (pos < 0) - return -1; - - /* Now shift off the low-order zero bits and see if we have a power of - two minus 1. */ - len = exact_log2 ((m >> pos) + 1); + if (pos >= 0) + /* Now shift off the low-order zero bits and see if we have a + power of two minus 1. */ + len = exact_log2 ((m >> pos) + 1); if (len <= 0) - return -1; + pos = -1; *plen = len; return pos; } +/* If X refers to a register that equals REG in value, replace these + references with REG. */ +static rtx +canon_reg_for_combine (rtx x, rtx reg) +{ + rtx op0, op1, op2; + const char *fmt; + int i; + bool copied; + + enum rtx_code code = GET_CODE (x); + switch (GET_RTX_CLASS (code)) + { + case RTX_UNARY: + op0 = canon_reg_for_combine (XEXP (x, 0), reg); + if (op0 != XEXP (x, 0)) + return simplify_gen_unary (GET_CODE (x), GET_MODE (x), op0, + GET_MODE (reg)); + break; + + case RTX_BIN_ARITH: + case RTX_COMM_ARITH: + op0 = canon_reg_for_combine (XEXP (x, 0), reg); + op1 = canon_reg_for_combine (XEXP (x, 1), reg); + if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) + return simplify_gen_binary (GET_CODE (x), GET_MODE (x), op0, op1); + break; + + case RTX_COMPARE: + case RTX_COMM_COMPARE: + op0 = canon_reg_for_combine (XEXP (x, 0), reg); + op1 = canon_reg_for_combine (XEXP (x, 1), reg); + if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) + return simplify_gen_relational (GET_CODE (x), GET_MODE (x), + GET_MODE (op0), op0, op1); + break; + + case RTX_TERNARY: + case RTX_BITFIELD_OPS: + op0 = canon_reg_for_combine (XEXP (x, 0), reg); + op1 = canon_reg_for_combine (XEXP (x, 1), reg); + op2 = canon_reg_for_combine (XEXP (x, 2), reg); + if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1) || op2 != XEXP (x, 2)) + return simplify_gen_ternary (GET_CODE (x), GET_MODE (x), + GET_MODE (op0), op0, op1, op2); + + case RTX_OBJ: + if (REG_P (x)) + { + if (rtx_equal_p (get_last_value (reg), x) + || rtx_equal_p (reg, get_last_value (x))) + return reg; + else + break; + } + + /* fall through */ + + default: + fmt = GET_RTX_FORMAT (code); + copied = false; + for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) + if (fmt[i] == 'e') + { + rtx op = canon_reg_for_combine (XEXP (x, i), reg); + if (op != XEXP (x, i)) + { + if (!copied) + { + copied = true; + x = copy_rtx (x); + } + XEXP (x, i) = op; + } + } + else if (fmt[i] == 'E') + { + int j; + for (j = 0; j < XVECLEN (x, i); j++) + { + rtx op = canon_reg_for_combine (XVECEXP (x, i, j), reg); + if (op != XVECEXP (x, i, j)) + { + if (!copied) + { + copied = true; + x = copy_rtx (x); + } + XVECEXP (x, i, j) = op; + } + } + } + + break; + } + + return x; +} + +/* Return X converted to MODE. If the value is already truncated to + MODE we can just return a subreg even though in the general case we + would need an explicit truncation. */ + +static rtx +gen_lowpart_or_truncate (enum machine_mode mode, rtx x) +{ + if (GET_MODE_SIZE (GET_MODE (x)) <= GET_MODE_SIZE (mode) + || TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), + GET_MODE_BITSIZE (GET_MODE (x))) + || (REG_P (x) && reg_truncated_to_mode (mode, x))) + return gen_lowpart (mode, x); + else + return simplify_gen_unary (TRUNCATE, mode, x, GET_MODE (x)); +} + /* See if X can be simplified knowing that we will only refer to it in MODE and will only refer to those bits that are nonzero in MASK. If other bits are being computed or if masking operations are done @@ -6706,16 +6821,13 @@ get_pos_from_mask (unsigned HOST_WIDE_INT m, unsigned HOST_WIDE_INT *plen) Return a possibly simplified expression, but always convert X to MODE. If X is a CONST_INT, AND the CONST_INT with MASK. - Also, if REG is nonzero and X is a register equal in value to REG, - replace X with REG. - If JUST_SELECT is nonzero, don't optimize by noticing that bits in MASK are all off in X. This is used when X will be complemented, by either NOT, NEG, or XOR. */ static rtx force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, - rtx reg, int just_select) + int just_select) { enum rtx_code code = GET_CODE (x); int next_select = just_select || code == XOR || code == NOT || code == NEG; @@ -6728,7 +6840,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, expression is VOIDmode. Also do nothing if X is a CLOBBER; this can happen if X was - the return value from a call to gen_lowpart_for_combine. */ + the return value from a call to gen_lowpart. */ if (code == CALL || code == ASM_OPERANDS || code == CLOBBER) return x; @@ -6762,7 +6874,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, nonzero = nonzero_bits (x, mode); /* If none of the bits in X are needed, return a zero. */ - if (! just_select && (nonzero & mask) == 0) + if (!just_select && (nonzero & mask) == 0 && !side_effects_p (x)) x = const0_rtx; /* If X is a CONST_INT, return a new one. Do this here since the @@ -6770,7 +6882,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, if (GET_CODE (x) == CONST_INT) { if (SCALAR_INT_MODE_P (mode)) - return gen_int_mode (INTVAL (x) & mask, mode); + return gen_int_mode (INTVAL (x) & mask, mode); else { x = GEN_INT (INTVAL (x) & mask); @@ -6782,12 +6894,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, get X in the proper mode. */ if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (mode) && (GET_MODE_MASK (GET_MODE (x)) & ~mask) == 0) - return gen_lowpart_for_combine (mode, x); - - /* If we aren't changing the mode, X is not a SUBREG, and all zero bits in - MASK are already known to be zero in X, we need not do anything. */ - if (GET_MODE (x) == mode && code != SUBREG && (~mask & nonzero) == 0) - return x; + return gen_lowpart (mode, x); switch (code) { @@ -6796,28 +6903,13 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, generating something that won't match. */ return x; - case USE: - /* X is a (use (mem ..)) that was made from a bit-field extraction that - spanned the boundary of the MEM. If we are now masking so it is - within that boundary, we don't need the USE any more. */ - if (! BITS_BIG_ENDIAN - && (mask & ~GET_MODE_MASK (GET_MODE (XEXP (x, 0)))) == 0) - return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); - break; - case SIGN_EXTEND: case ZERO_EXTEND: case ZERO_EXTRACT: case SIGN_EXTRACT: x = expand_compound_operation (x); if (GET_CODE (x) != code) - return force_to_mode (x, mode, mask, reg, next_select); - break; - - case REG: - if (reg != 0 && (rtx_equal_p (get_last_value (reg), x) - || rtx_equal_p (reg, get_last_value (x)))) - x = reg; + return force_to_mode (x, mode, mask, next_select); break; case SUBREG: @@ -6830,7 +6922,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, || (0 == (mask & GET_MODE_MASK (GET_MODE (x)) & ~GET_MODE_MASK (GET_MODE (SUBREG_REG (x))))))) - return force_to_mode (SUBREG_REG (x), mode, mask, reg, next_select); + return force_to_mode (SUBREG_REG (x), mode, mask, next_select); break; case AND: @@ -6866,13 +6958,14 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, int width = GET_MODE_BITSIZE (GET_MODE (x)); rtx y; - /* If MODE is narrower that HOST_WIDE_INT and CVAL is a negative + /* If MODE is narrower than HOST_WIDE_INT and CVAL is a negative number, sign extend it. */ if (width > 0 && width < HOST_BITS_PER_WIDE_INT && (cval & ((HOST_WIDE_INT) 1 << (width - 1))) != 0) cval |= (HOST_WIDE_INT) -1 << width; - y = gen_binary (AND, GET_MODE (x), XEXP (x, 0), GEN_INT (cval)); + y = simplify_gen_binary (AND, GET_MODE (x), + XEXP (x, 0), GEN_INT (cval)); if (rtx_cost (y, SET) < rtx_cost (x, SET)) x = y; } @@ -6905,7 +6998,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, && (INTVAL (XEXP (x, 1)) & ~smask) != 0) return force_to_mode (plus_constant (XEXP (x, 0), (INTVAL (XEXP (x, 1)) & smask)), - mode, smask, reg, next_select); + mode, smask, next_select); } /* ... fall through ... */ @@ -6927,7 +7020,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { x = simplify_gen_unary (NEG, GET_MODE (x), XEXP (x, 1), GET_MODE (x)); - return force_to_mode (x, mode, mask, reg, next_select); + return force_to_mode (x, mode, mask, next_select); } /* Similarly, if C contains every bit in the fuller_mask, then we may @@ -6938,7 +7031,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { x = simplify_gen_unary (NOT, GET_MODE (x), XEXP (x, 1), GET_MODE (x)); - return force_to_mode (x, mode, mask, reg, next_select); + return force_to_mode (x, mode, mask, next_select); } mask = fuller_mask; @@ -6964,26 +7057,26 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { temp = GEN_INT ((INTVAL (XEXP (x, 1)) & mask) << INTVAL (XEXP (XEXP (x, 0), 1))); - temp = gen_binary (GET_CODE (x), GET_MODE (x), - XEXP (XEXP (x, 0), 0), temp); - x = gen_binary (LSHIFTRT, GET_MODE (x), temp, - XEXP (XEXP (x, 0), 1)); - return force_to_mode (x, mode, mask, reg, next_select); + temp = simplify_gen_binary (GET_CODE (x), GET_MODE (x), + XEXP (XEXP (x, 0), 0), temp); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), temp, + XEXP (XEXP (x, 0), 1)); + return force_to_mode (x, mode, mask, next_select); } binop: /* For most binary operations, just propagate into the operation and change the mode if we have an operation of that mode. */ - op0 = gen_lowpart_for_combine (op_mode, + op0 = gen_lowpart_or_truncate (op_mode, force_to_mode (XEXP (x, 0), mode, mask, - reg, next_select)); - op1 = gen_lowpart_for_combine (op_mode, + next_select)); + op1 = gen_lowpart_or_truncate (op_mode, force_to_mode (XEXP (x, 1), mode, mask, - reg, next_select)); + next_select)); if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) - x = gen_binary (code, op_mode, op0, op1); + x = simplify_gen_binary (code, op_mode, op0, op1); break; case ASHIFT: @@ -7012,12 +7105,12 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, else mask = fuller_mask; - op0 = gen_lowpart_for_combine (op_mode, + op0 = gen_lowpart_or_truncate (op_mode, force_to_mode (XEXP (x, 0), op_mode, - mask, reg, next_select)); + mask, next_select)); if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0)) - x = gen_binary (code, op_mode, op0, XEXP (x, 1)); + x = simplify_gen_binary (code, op_mode, op0, XEXP (x, 1)); break; case LSHIFTRT: @@ -7037,15 +7130,14 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* We can only change the mode of the shift if we can do arithmetic in the mode of the shift and INNER_MASK is no wider than the - width of OP_MODE. */ - if (GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT - || (inner_mask & ~GET_MODE_MASK (op_mode)) != 0) + width of X's mode. */ + if ((inner_mask & ~GET_MODE_MASK (GET_MODE (x))) != 0) op_mode = GET_MODE (x); - inner = force_to_mode (inner, op_mode, inner_mask, reg, next_select); + inner = force_to_mode (inner, op_mode, inner_mask, next_select); if (GET_MODE (x) != op_mode || inner != XEXP (x, 0)) - x = gen_binary (LSHIFTRT, op_mode, inner, XEXP (x, 1)); + x = simplify_gen_binary (LSHIFTRT, op_mode, inner, XEXP (x, 1)); } /* If we have (and (lshiftrt FOO C1) C2) where the combination of the @@ -7067,9 +7159,9 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* Must be more sign bit copies than the mask needs. */ && ((int) num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) >= exact_log2 (mask + 1))) - x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), - GEN_INT (GET_MODE_BITSIZE (GET_MODE (x)) - - exact_log2 (mask + 1))); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), + GEN_INT (GET_MODE_BITSIZE (GET_MODE (x)) + - exact_log2 (mask + 1))); goto shiftrt; @@ -7079,7 +7171,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, if (GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT && (mask == ((unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (GET_MODE (x)) - 1)))) - return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); + return force_to_mode (XEXP (x, 0), mode, mask, next_select); /* If this is a shift by a constant, get a mask that contains those bits that are not copies of the sign bit. We then have two cases: If @@ -7091,7 +7183,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, if (GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) >= 0 && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT) { - int i = -1; + int i; /* If the considered data is wider than HOST_WIDE_INT, we can't represent a mask for all its bits in a single scalar. @@ -7118,23 +7210,30 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, nonzero >>= INTVAL (XEXP (x, 1)); } - if ((mask & ~nonzero) == 0 - || (i = exact_log2 (mask)) >= 0) + if ((mask & ~nonzero) == 0) + { + x = simplify_shift_const (NULL_RTX, LSHIFTRT, GET_MODE (x), + XEXP (x, 0), INTVAL (XEXP (x, 1))); + if (GET_CODE (x) != ASHIFTRT) + return force_to_mode (x, mode, mask, next_select); + } + + else if ((i = exact_log2 (mask)) >= 0) { x = simplify_shift_const - (x, LSHIFTRT, GET_MODE (x), XEXP (x, 0), - i < 0 ? INTVAL (XEXP (x, 1)) - : GET_MODE_BITSIZE (GET_MODE (x)) - 1 - i); + (NULL_RTX, LSHIFTRT, GET_MODE (x), XEXP (x, 0), + GET_MODE_BITSIZE (GET_MODE (x)) - 1 - i); if (GET_CODE (x) != ASHIFTRT) - return force_to_mode (x, mode, mask, reg, next_select); + return force_to_mode (x, mode, mask, next_select); } } /* If MASK is 1, convert this to an LSHIFTRT. This can be done even if the shift count isn't a constant. */ if (mask == 1) - x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), XEXP (x, 1)); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), + XEXP (x, 0), XEXP (x, 1)); shiftrt: @@ -7150,7 +7249,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, && GET_CODE (XEXP (x, 0)) == ASHIFT && XEXP (XEXP (x, 0), 1) == XEXP (x, 1)) return force_to_mode (XEXP (XEXP (x, 0), 0), mode, mask, - reg, next_select); + next_select); break; @@ -7169,7 +7268,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, if (temp && GET_CODE (temp) == CONST_INT) SUBST (XEXP (x, 0), force_to_mode (XEXP (x, 0), GET_MODE (x), - INTVAL (temp), reg, next_select)); + INTVAL (temp), next_select)); } break; @@ -7177,7 +7276,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* If we just want the low-order bit, the NEG isn't needed since it won't change the low-order bit. */ if (mask == 1) - return force_to_mode (XEXP (x, 0), mode, mask, reg, just_select); + return force_to_mode (XEXP (x, 0), mode, mask, just_select); /* We need any bits less significant than the most significant bit in MASK since carries from those bits will affect the bits we are @@ -7199,10 +7298,12 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { temp = gen_int_mode (mask << INTVAL (XEXP (XEXP (x, 0), 1)), GET_MODE (x)); - temp = gen_binary (XOR, GET_MODE (x), XEXP (XEXP (x, 0), 0), temp); - x = gen_binary (LSHIFTRT, GET_MODE (x), temp, XEXP (XEXP (x, 0), 1)); + temp = simplify_gen_binary (XOR, GET_MODE (x), + XEXP (XEXP (x, 0), 0), temp); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), + temp, XEXP (XEXP (x, 0), 1)); - return force_to_mode (x, mode, mask, reg, next_select); + return force_to_mode (x, mode, mask, next_select); } /* (and (not FOO) CONST) is (not (or FOO (not CONST))), so we must @@ -7210,9 +7311,9 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, mask = fuller_mask; unop: - op0 = gen_lowpart_for_combine (op_mode, + op0 = gen_lowpart_or_truncate (op_mode, force_to_mode (XEXP (x, 0), mode, mask, - reg, next_select)); + next_select)); if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0)) x = simplify_gen_unary (code, op_mode, op0, op_mode); break; @@ -7222,10 +7323,11 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, in STORE_FLAG_VALUE and FOO has a single bit that might be nonzero, which is equal to STORE_FLAG_VALUE. */ if ((mask & ~STORE_FLAG_VALUE) == 0 && XEXP (x, 1) == const0_rtx + && GET_MODE (XEXP (x, 0)) == mode && exact_log2 (nonzero_bits (XEXP (x, 0), mode)) >= 0 && (nonzero_bits (XEXP (x, 0), mode) == (unsigned HOST_WIDE_INT) STORE_FLAG_VALUE)) - return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); + return force_to_mode (XEXP (x, 0), mode, mask, next_select); break; @@ -7234,13 +7336,13 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, written in a narrower mode. We play it safe and do not do so. */ SUBST (XEXP (x, 1), - gen_lowpart_for_combine (GET_MODE (x), + gen_lowpart_or_truncate (GET_MODE (x), force_to_mode (XEXP (x, 1), mode, - mask, reg, next_select))); + mask, next_select))); SUBST (XEXP (x, 2), - gen_lowpart_for_combine (GET_MODE (x), + gen_lowpart_or_truncate (GET_MODE (x), force_to_mode (XEXP (x, 2), mode, - mask, reg, next_select))); + mask, next_select))); break; default: @@ -7248,7 +7350,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, } /* Ensure we return a value of the proper mode. */ - return gen_lowpart_for_combine (mode, x); + return gen_lowpart_or_truncate (mode, x); } /* Return nonzero if X is an expression that has one of two values depending on @@ -7277,7 +7379,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) /* If this is a unary operation whose operand has one of two values, apply our opcode to compute those values. */ - else if (GET_RTX_CLASS (code) == '1' + else if (UNARY_P (x) && (cond0 = if_then_else_cond (XEXP (x, 0), &true0, &false0)) != 0) { *ptrue = simplify_gen_unary (code, mode, true0, GET_MODE (XEXP (x, 0))); @@ -7294,8 +7396,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) /* If this is a binary operation, see if either side has only one of two values. If either one does or if both do and they are conditional on the same value, compute the new true and false values. */ - else if (GET_RTX_CLASS (code) == 'c' || GET_RTX_CLASS (code) == '2' - || GET_RTX_CLASS (code) == '<') + else if (BINARY_P (x)) { cond0 = if_then_else_cond (XEXP (x, 0), &true0, &false0); cond1 = if_then_else_cond (XEXP (x, 1), &true1, &false1); @@ -7311,8 +7412,19 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) else if (cond1 == 0) true1 = copy_rtx (true1); - *ptrue = gen_binary (code, mode, true0, true1); - *pfalse = gen_binary (code, mode, false0, false1); + if (COMPARISON_P (x)) + { + *ptrue = simplify_gen_relational (code, mode, VOIDmode, + true0, true1); + *pfalse = simplify_gen_relational (code, mode, VOIDmode, + false0, false1); + } + else + { + *ptrue = simplify_gen_binary (code, mode, true0, true1); + *pfalse = simplify_gen_binary (code, mode, false0, false1); + } + return cond0 ? cond0 : cond1; } @@ -7331,24 +7443,24 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) cond0 = XEXP (XEXP (x, 0), 0); cond1 = XEXP (XEXP (x, 1), 0); - if (GET_RTX_CLASS (GET_CODE (cond0)) == '<' - && GET_RTX_CLASS (GET_CODE (cond1)) == '<' - && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1) + if (COMPARISON_P (cond0) + && COMPARISON_P (cond1) + && ((GET_CODE (cond0) == reversed_comparison_code (cond1, NULL) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1))) || ((swap_condition (GET_CODE (cond0)) - == combine_reversed_comparison_code (cond1)) + == reversed_comparison_code (cond1, NULL)) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 1)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 0)))) && ! side_effects_p (x)) { - *ptrue = gen_binary (MULT, mode, op0, const_true_rtx); - *pfalse = gen_binary (MULT, mode, - (code == MINUS - ? simplify_gen_unary (NEG, mode, op1, - mode) - : op1), - const_true_rtx); + *ptrue = simplify_gen_binary (MULT, mode, op0, const_true_rtx); + *pfalse = simplify_gen_binary (MULT, mode, + (code == MINUS + ? simplify_gen_unary (NEG, mode, + op1, mode) + : op1), + const_true_rtx); return cond0; } } @@ -7362,13 +7474,13 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) cond0 = XEXP (XEXP (x, 0), 0); cond1 = XEXP (XEXP (x, 1), 0); - if (GET_RTX_CLASS (GET_CODE (cond0)) == '<' - && GET_RTX_CLASS (GET_CODE (cond1)) == '<' - && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1) + if (COMPARISON_P (cond0) + && COMPARISON_P (cond1) + && ((GET_CODE (cond0) == reversed_comparison_code (cond1, NULL) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1))) || ((swap_condition (GET_CODE (cond0)) - == combine_reversed_comparison_code (cond1)) + == reversed_comparison_code (cond1, NULL)) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 1)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 0)))) && ! side_effects_p (x)) @@ -7501,19 +7613,19 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val) /* The only other cases we handle are MIN, MAX, and comparisons if the operands are the same as REG and VAL. */ - else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == 'c') + else if (COMPARISON_P (x) || COMMUTATIVE_ARITH_P (x)) { if (rtx_equal_p (XEXP (x, 0), val)) cond = swap_condition (cond), temp = val, val = reg, reg = temp; if (rtx_equal_p (XEXP (x, 0), reg) && rtx_equal_p (XEXP (x, 1), val)) { - if (GET_RTX_CLASS (code) == '<') + if (COMPARISON_P (x)) { if (comparison_dominates_p (cond, code)) return const_true_rtx; - code = combine_reversed_comparison_code (x); + code = reversed_comparison_code (x, NULL); if (code != UNKNOWN && comparison_dominates_p (cond, code)) return const0_rtx; @@ -7582,7 +7694,7 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val) if (XEXP (x, 0) != r) { /* We must simplify the zero_extend here, before we lose - track of the original inner_mode. */ + track of the original inner_mode. */ new = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), r, inner_mode); if (new) @@ -7623,16 +7735,16 @@ rtx_equal_for_field_assignment_p (rtx x, rtx y) /* Check for a paradoxical SUBREG of a MEM compared with the MEM. Note that all SUBREGs of MEM are paradoxical; otherwise they would have been rewritten. */ - if (GET_CODE (x) == MEM && GET_CODE (y) == SUBREG - && GET_CODE (SUBREG_REG (y)) == MEM + if (MEM_P (x) && GET_CODE (y) == SUBREG + && MEM_P (SUBREG_REG (y)) && rtx_equal_p (SUBREG_REG (y), - gen_lowpart_for_combine (GET_MODE (SUBREG_REG (y)), x))) + gen_lowpart (GET_MODE (SUBREG_REG (y)), x))) return 1; - if (GET_CODE (y) == MEM && GET_CODE (x) == SUBREG - && GET_CODE (SUBREG_REG (x)) == MEM + if (MEM_P (y) && GET_CODE (x) == SUBREG + && MEM_P (SUBREG_REG (x)) && rtx_equal_p (SUBREG_REG (x), - gen_lowpart_for_combine (GET_MODE (SUBREG_REG (x)), y))) + gen_lowpart (GET_MODE (SUBREG_REG (x)), y))) return 1; /* We used to see if get_last_value of X and Y were the same but that's @@ -7678,14 +7790,14 @@ make_field_assignment (rtx x) return x; } - else if (GET_CODE (src) == AND && GET_CODE (XEXP (src, 0)) == SUBREG - && subreg_lowpart_p (XEXP (src, 0)) - && (GET_MODE_SIZE (GET_MODE (XEXP (src, 0))) - < GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (src, 0))))) - && GET_CODE (SUBREG_REG (XEXP (src, 0))) == ROTATE - && GET_CODE (XEXP (SUBREG_REG (XEXP (src, 0)), 0)) == CONST_INT - && INTVAL (XEXP (SUBREG_REG (XEXP (src, 0)), 0)) == -2 - && rtx_equal_for_field_assignment_p (dest, XEXP (src, 1))) + if (GET_CODE (src) == AND && GET_CODE (XEXP (src, 0)) == SUBREG + && subreg_lowpart_p (XEXP (src, 0)) + && (GET_MODE_SIZE (GET_MODE (XEXP (src, 0))) + < GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (src, 0))))) + && GET_CODE (SUBREG_REG (XEXP (src, 0))) == ROTATE + && GET_CODE (XEXP (SUBREG_REG (XEXP (src, 0)), 0)) == CONST_INT + && INTVAL (XEXP (SUBREG_REG (XEXP (src, 0)), 0)) == -2 + && rtx_equal_for_field_assignment_p (dest, XEXP (src, 1))) { assign = make_extraction (VOIDmode, dest, 0, XEXP (SUBREG_REG (XEXP (src, 0)), 1), @@ -7697,9 +7809,9 @@ make_field_assignment (rtx x) /* If SRC is (ior (ashift (const_int 1) POS) DEST), this is a set of a one-bit field. */ - else if (GET_CODE (src) == IOR && GET_CODE (XEXP (src, 0)) == ASHIFT - && XEXP (XEXP (src, 0), 0) == const1_rtx - && rtx_equal_for_field_assignment_p (dest, XEXP (src, 1))) + if (GET_CODE (src) == IOR && GET_CODE (XEXP (src, 0)) == ASHIFT + && XEXP (XEXP (src, 0), 0) == const1_rtx + && rtx_equal_for_field_assignment_p (dest, XEXP (src, 1))) { assign = make_extraction (VOIDmode, dest, 0, XEXP (XEXP (src, 0), 1), 1, 1, 1, 0); @@ -7708,6 +7820,37 @@ make_field_assignment (rtx x) return x; } + /* If DEST is already a field assignment, i.e. ZERO_EXTRACT, and the + SRC is an AND with all bits of that field set, then we can discard + the AND. */ + if (GET_CODE (dest) == ZERO_EXTRACT + && GET_CODE (XEXP (dest, 1)) == CONST_INT + && GET_CODE (src) == AND + && GET_CODE (XEXP (src, 1)) == CONST_INT) + { + HOST_WIDE_INT width = INTVAL (XEXP (dest, 1)); + unsigned HOST_WIDE_INT and_mask = INTVAL (XEXP (src, 1)); + unsigned HOST_WIDE_INT ze_mask; + + if (width >= HOST_BITS_PER_WIDE_INT) + ze_mask = -1; + else + ze_mask = ((unsigned HOST_WIDE_INT)1 << width) - 1; + + /* Complete overlap. We can remove the source AND. */ + if ((and_mask & ze_mask) == ze_mask) + return gen_rtx_SET (VOIDmode, dest, XEXP (src, 0)); + + /* Partial overlap. We can reduce the source AND. */ + if ((and_mask & ze_mask) != and_mask) + { + mode = GET_MODE (src); + src = gen_rtx_AND (mode, XEXP (src, 0), + gen_int_mode (and_mask & ze_mask, mode)); + return gen_rtx_SET (VOIDmode, dest, src); + } + } + /* The other case we handle is assignments into a constant-position field. They look like (ior/xor (and DEST C1) OTHER). If C1 represents a mask that has all one bits except for a group of zero bits and @@ -7751,13 +7894,15 @@ make_field_assignment (rtx x) /* Shift OTHER right POS places and make it the source, restricting it to the proper length and mode. */ - src = force_to_mode (simplify_shift_const (NULL_RTX, LSHIFTRT, - GET_MODE (src), other, pos), - mode, + src = canon_reg_for_combine (simplify_shift_const (NULL_RTX, LSHIFTRT, + GET_MODE (src), + other, pos), + dest); + src = force_to_mode (src, mode, GET_MODE_BITSIZE (mode) >= HOST_BITS_PER_WIDE_INT ? ~(unsigned HOST_WIDE_INT) 0 : ((unsigned HOST_WIDE_INT) 1 << len) - 1, - dest, 0); + 0); /* If SRC is masked by an AND that does not make a difference in the value being stored, strip it. */ @@ -7800,8 +7945,7 @@ apply_distributive_law (rtx x) /* If either operand is a primitive we can't do anything, so get out fast. */ - if (GET_RTX_CLASS (GET_CODE (lhs)) == 'o' - || GET_RTX_CLASS (GET_CODE (rhs)) == 'o') + if (OBJECT_P (lhs) || OBJECT_P (rhs)) return x; lhs = expand_compound_operation (lhs); @@ -7832,14 +7976,15 @@ apply_distributive_law (rtx x) break; case SUBREG: - /* Non-paradoxical SUBREGs distributes over all operations, provided - the inner modes and byte offsets are the same, this is an extraction - of a low-order part, we don't convert an fp operation to int or - vice versa, and we would not be converting a single-word - operation into a multi-word operation. The latter test is not - required, but it prevents generating unneeded multi-word operations. - Some of the previous tests are redundant given the latter test, but - are retained because they are required for correctness. + /* Non-paradoxical SUBREGs distributes over all operations, + provided the inner modes and byte offsets are the same, this + is an extraction of a low-order part, we don't convert an fp + operation to int or vice versa, this is not a vector mode, + and we would not be converting a single-word operation into a + multi-word operation. The latter test is not required, but + it prevents generating unneeded multi-word operations. Some + of the previous tests are redundant given the latter test, + but are retained because they are required for correctness. We produce the result slightly differently in this case. */ @@ -7850,12 +7995,18 @@ apply_distributive_law (rtx x) != GET_MODE_CLASS (GET_MODE (SUBREG_REG (lhs)))) || (GET_MODE_SIZE (GET_MODE (lhs)) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs)))) - || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD) + || VECTOR_MODE_P (GET_MODE (lhs)) + || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD + /* Result might need to be truncated. Don't change mode if + explicit truncation is needed. */ + || !TRULY_NOOP_TRUNCATION + (GET_MODE_BITSIZE (GET_MODE (x)), + GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (lhs))))) return x; - tem = gen_binary (code, GET_MODE (SUBREG_REG (lhs)), - SUBREG_REG (lhs), SUBREG_REG (rhs)); - return gen_lowpart_for_combine (GET_MODE (x), tem); + tem = simplify_gen_binary (code, GET_MODE (SUBREG_REG (lhs)), + SUBREG_REG (lhs), SUBREG_REG (rhs)); + return gen_lowpart (GET_MODE (x), tem); default: return x; @@ -7863,15 +8014,15 @@ apply_distributive_law (rtx x) /* Set LHS and RHS to the inner operands (A and B in the example above) and set OTHER to the common operand (C in the example). - These is only one way to do this unless the inner operation is + There is only one way to do this unless the inner operation is commutative. */ - if (GET_RTX_CLASS (inner_code) == 'c' + if (COMMUTATIVE_ARITH_P (lhs) && rtx_equal_p (XEXP (lhs, 0), XEXP (rhs, 0))) other = XEXP (lhs, 0), lhs = XEXP (lhs, 1), rhs = XEXP (rhs, 1); - else if (GET_RTX_CLASS (inner_code) == 'c' + else if (COMMUTATIVE_ARITH_P (lhs) && rtx_equal_p (XEXP (lhs, 0), XEXP (rhs, 1))) other = XEXP (lhs, 0), lhs = XEXP (lhs, 1), rhs = XEXP (rhs, 0); - else if (GET_RTX_CLASS (inner_code) == 'c' + else if (COMMUTATIVE_ARITH_P (lhs) && rtx_equal_p (XEXP (lhs, 1), XEXP (rhs, 0))) other = XEXP (lhs, 1), lhs = XEXP (lhs, 0), rhs = XEXP (rhs, 1); else if (rtx_equal_p (XEXP (lhs, 1), XEXP (rhs, 1))) @@ -7880,7 +8031,7 @@ apply_distributive_law (rtx x) return x; /* Form the new inner operation, seeing if it simplifies first. */ - tem = gen_binary (code, GET_MODE (x), lhs, rhs); + tem = simplify_gen_binary (code, GET_MODE (x), lhs, rhs); /* There is one exception to the general way of distributing: (a | c) ^ (b | c) -> (a ^ b) & ~c */ @@ -7893,23 +8044,96 @@ apply_distributive_law (rtx x) /* We may be able to continuing distributing the result, so call ourselves recursively on the inner operation before forming the outer operation, which we return. */ - return gen_binary (inner_code, GET_MODE (x), - apply_distributive_law (tem), other); + return simplify_gen_binary (inner_code, GET_MODE (x), + apply_distributive_law (tem), other); +} + +/* See if X is of the form (* (+ A B) C), and if so convert to + (+ (* A C) (* B C)) and try to simplify. + + Most of the time, this results in no change. However, if some of + the operands are the same or inverses of each other, simplifications + will result. + + For example, (and (ior A B) (not B)) can occur as the result of + expanding a bit field assignment. When we apply the distributive + law to this, we get (ior (and (A (not B))) (and (B (not B)))), + which then simplifies to (and (A (not B))). + + Note that no checks happen on the validity of applying the inverse + distributive law. This is pointless since we can do it in the + few places where this routine is called. + + N is the index of the term that is decomposed (the arithmetic operation, + i.e. (+ A B) in the first example above). !N is the index of the term that + is distributed, i.e. of C in the first example above. */ +static rtx +distribute_and_simplify_rtx (rtx x, int n) +{ + enum machine_mode mode; + enum rtx_code outer_code, inner_code; + rtx decomposed, distributed, inner_op0, inner_op1, new_op0, new_op1, tmp; + + decomposed = XEXP (x, n); + if (!ARITHMETIC_P (decomposed)) + return NULL_RTX; + + mode = GET_MODE (x); + outer_code = GET_CODE (x); + distributed = XEXP (x, !n); + + inner_code = GET_CODE (decomposed); + inner_op0 = XEXP (decomposed, 0); + inner_op1 = XEXP (decomposed, 1); + + /* Special case (and (xor B C) (not A)), which is equivalent to + (xor (ior A B) (ior A C)) */ + if (outer_code == AND && inner_code == XOR && GET_CODE (distributed) == NOT) + { + distributed = XEXP (distributed, 0); + outer_code = IOR; + } + + if (n == 0) + { + /* Distribute the second term. */ + new_op0 = simplify_gen_binary (outer_code, mode, inner_op0, distributed); + new_op1 = simplify_gen_binary (outer_code, mode, inner_op1, distributed); + } + else + { + /* Distribute the first term. */ + new_op0 = simplify_gen_binary (outer_code, mode, distributed, inner_op0); + new_op1 = simplify_gen_binary (outer_code, mode, distributed, inner_op1); + } + + tmp = apply_distributive_law (simplify_gen_binary (inner_code, mode, + new_op0, new_op1)); + if (GET_CODE (tmp) != outer_code + && rtx_cost (tmp, SET) < rtx_cost (x, SET)) + return tmp; + + return NULL_RTX; } -/* We have X, a logical `and' of VAROP with the constant CONSTOP, to be done - in MODE. - - Return an equivalent form, if different from X. Otherwise, return X. If - X is zero, we are to always construct the equivalent form. */ +/* Simplify a logical `and' of VAROP with the constant CONSTOP, to be done + in MODE. Return an equivalent form, if different from (and VAROP + (const_int CONSTOP)). Otherwise, return NULL_RTX. */ static rtx -simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, - unsigned HOST_WIDE_INT constop) +simplify_and_const_int_1 (enum machine_mode mode, rtx varop, + unsigned HOST_WIDE_INT constop) { unsigned HOST_WIDE_INT nonzero; + unsigned HOST_WIDE_INT orig_constop; + rtx orig_varop; int i; + orig_varop = varop; + orig_constop = constop; + if (GET_CODE (varop) == CLOBBER) + return NULL_RTX; + /* Simplify VAROP knowing that we will be only looking at some of the bits in it. @@ -7917,7 +8141,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, CONSTOP are not significant and will never be examined. We must ensure that is the case by explicitly masking out those bits before returning. */ - varop = force_to_mode (varop, mode, constop, NULL_RTX, 0); + varop = force_to_mode (varop, mode, constop, 0); /* If VAROP is a CLOBBER, we will fail so return it. */ if (GET_CODE (varop) == CLOBBER) @@ -7926,7 +8150,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, /* If VAROP is a CONST_INT, then we need to apply the mask in CONSTOP to VAROP and return the new constant. */ if (GET_CODE (varop) == CONST_INT) - return GEN_INT (trunc_int_for_mode (INTVAL (varop) & constop, mode)); + return gen_int_mode (INTVAL (varop) & constop, mode); /* See what bits may be nonzero in VAROP. Unlike the general case of a call to nonzero_bits, here we don't care about bits outside @@ -7958,16 +8182,20 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, if (GET_CODE (varop) == IOR || GET_CODE (varop) == XOR) return - gen_lowpart_for_combine + gen_lowpart (mode, apply_distributive_law - (gen_binary (GET_CODE (varop), GET_MODE (varop), - simplify_and_const_int (NULL_RTX, GET_MODE (varop), - XEXP (varop, 0), constop), - simplify_and_const_int (NULL_RTX, GET_MODE (varop), - XEXP (varop, 1), constop)))); + (simplify_gen_binary (GET_CODE (varop), GET_MODE (varop), + simplify_and_const_int (NULL_RTX, + GET_MODE (varop), + XEXP (varop, 0), + constop), + simplify_and_const_int (NULL_RTX, + GET_MODE (varop), + XEXP (varop, 1), + constop)))); - /* If VAROP is PLUS, and the constant is a mask of low bite, distribute + /* If VAROP is PLUS, and the constant is a mask of low bits, distribute the AND and see if one of the operands simplifies to zero. If so, we may eliminate it. */ @@ -7984,620 +8212,118 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, return o0; } - /* Get VAROP in MODE. Try to get a SUBREG if not. Don't make a new SUBREG - if we already had one (just check for the simplest cases). */ - if (x && GET_CODE (XEXP (x, 0)) == SUBREG - && GET_MODE (XEXP (x, 0)) == mode - && SUBREG_REG (XEXP (x, 0)) == varop) - varop = XEXP (x, 0); - else - varop = gen_lowpart_for_combine (mode, varop); - - /* If we can't make the SUBREG, try to return what we were given. */ - if (GET_CODE (varop) == CLOBBER) - return x ? x : varop; + /* Make a SUBREG if necessary. If we can't make it, fail. */ + varop = gen_lowpart (mode, varop); + if (varop == NULL_RTX || GET_CODE (varop) == CLOBBER) + return NULL_RTX; /* If we are only masking insignificant bits, return VAROP. */ if (constop == nonzero) - x = varop; - else - { - /* Otherwise, return an AND. */ - constop = trunc_int_for_mode (constop, mode); - /* See how much, if any, of X we can use. */ - if (x == 0 || GET_CODE (x) != AND || GET_MODE (x) != mode) - x = gen_binary (AND, mode, varop, GEN_INT (constop)); + return varop; - else - { - if (GET_CODE (XEXP (x, 1)) != CONST_INT - || (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) != constop) - SUBST (XEXP (x, 1), GEN_INT (constop)); + if (varop == orig_varop && constop == orig_constop) + return NULL_RTX; - SUBST (XEXP (x, 0), varop); - } - } + /* Otherwise, return an AND. */ + return simplify_gen_binary (AND, mode, varop, gen_int_mode (constop, mode)); +} + +/* We have X, a logical `and' of VAROP with the constant CONSTOP, to be done + in MODE. + + Return an equivalent form, if different from X. Otherwise, return X. If + X is zero, we are to always construct the equivalent form. */ + +static rtx +simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, + unsigned HOST_WIDE_INT constop) +{ + rtx tem = simplify_and_const_int_1 (mode, varop, constop); + if (tem) + return tem; + + if (!x) + x = simplify_gen_binary (AND, GET_MODE (varop), varop, + gen_int_mode (constop, mode)); + if (GET_MODE (x) != mode) + x = gen_lowpart (mode, x); return x; } -#define nonzero_bits_with_known(X, MODE) \ - cached_nonzero_bits (X, MODE, known_x, known_mode, known_ret) - -/* The function cached_nonzero_bits is a wrapper around nonzero_bits1. - It avoids exponential behavior in nonzero_bits1 when X has - identical subexpressions on the first or the second level. */ - -static unsigned HOST_WIDE_INT -cached_nonzero_bits (rtx x, enum machine_mode mode, rtx known_x, - enum machine_mode known_mode, - unsigned HOST_WIDE_INT known_ret) -{ - if (x == known_x && mode == known_mode) - return known_ret; - - /* Try to find identical subexpressions. If found call - nonzero_bits1 on X with the subexpressions as KNOWN_X and the - precomputed value for the subexpression as KNOWN_RET. */ - - if (GET_RTX_CLASS (GET_CODE (x)) == '2' - || GET_RTX_CLASS (GET_CODE (x)) == 'c') - { - rtx x0 = XEXP (x, 0); - rtx x1 = XEXP (x, 1); - - /* Check the first level. */ - if (x0 == x1) - return nonzero_bits1 (x, mode, x0, mode, - nonzero_bits_with_known (x0, mode)); - - /* Check the second level. */ - if ((GET_RTX_CLASS (GET_CODE (x0)) == '2' - || GET_RTX_CLASS (GET_CODE (x0)) == 'c') - && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1))) - return nonzero_bits1 (x, mode, x1, mode, - nonzero_bits_with_known (x1, mode)); - - if ((GET_RTX_CLASS (GET_CODE (x1)) == '2' - || GET_RTX_CLASS (GET_CODE (x1)) == 'c') - && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1))) - return nonzero_bits1 (x, mode, x0, mode, - nonzero_bits_with_known (x0, mode)); - } - - return nonzero_bits1 (x, mode, known_x, known_mode, known_ret); -} - -/* We let num_sign_bit_copies recur into nonzero_bits as that is useful. - We don't let nonzero_bits recur into num_sign_bit_copies, because that - is less useful. We can't allow both, because that results in exponential - run time recursion. There is a nullstone testcase that triggered - this. This macro avoids accidental uses of num_sign_bit_copies. */ -#define cached_num_sign_bit_copies() - -/* Given an expression, X, compute which bits in X can be nonzero. +/* Given a REG, X, compute which bits in X can be nonzero. We don't care about bits outside of those defined in MODE. For most X this is simply GET_MODE_MASK (GET_MODE (MODE)), but if X is a shift, AND, or zero_extract, we can do better. */ -static unsigned HOST_WIDE_INT -nonzero_bits1 (rtx x, enum machine_mode mode, rtx known_x, - enum machine_mode known_mode, - unsigned HOST_WIDE_INT known_ret) +static rtx +reg_nonzero_bits_for_combine (rtx x, enum machine_mode mode, + rtx known_x ATTRIBUTE_UNUSED, + enum machine_mode known_mode ATTRIBUTE_UNUSED, + unsigned HOST_WIDE_INT known_ret ATTRIBUTE_UNUSED, + unsigned HOST_WIDE_INT *nonzero) { - unsigned HOST_WIDE_INT nonzero = GET_MODE_MASK (mode); - unsigned HOST_WIDE_INT inner_nz; - enum rtx_code code; - unsigned int mode_width = GET_MODE_BITSIZE (mode); rtx tem; - /* For floating-point values, assume all bits are needed. */ - if (FLOAT_MODE_P (GET_MODE (x)) || FLOAT_MODE_P (mode)) - return nonzero; + /* If X is a register whose nonzero bits value is current, use it. + Otherwise, if X is a register whose value we can find, use that + value. Otherwise, use the previously-computed global nonzero bits + for this register. */ - /* If X is wider than MODE, use its mode instead. */ - if (GET_MODE_BITSIZE (GET_MODE (x)) > mode_width) + if (reg_stat[REGNO (x)].last_set_value != 0 + && (reg_stat[REGNO (x)].last_set_mode == mode + || (GET_MODE_CLASS (reg_stat[REGNO (x)].last_set_mode) == MODE_INT + && GET_MODE_CLASS (mode) == MODE_INT)) + && (reg_stat[REGNO (x)].last_set_label == label_tick + || (REGNO (x) >= FIRST_PSEUDO_REGISTER + && REG_N_SETS (REGNO (x)) == 1 + && ! REGNO_REG_SET_P + (ENTRY_BLOCK_PTR->next_bb->il.rtl->global_live_at_start, + REGNO (x)))) + && INSN_CUID (reg_stat[REGNO (x)].last_set) < subst_low_cuid) { - mode = GET_MODE (x); - nonzero = GET_MODE_MASK (mode); - mode_width = GET_MODE_BITSIZE (mode); + *nonzero &= reg_stat[REGNO (x)].last_set_nonzero_bits; + return NULL; } - if (mode_width > HOST_BITS_PER_WIDE_INT) - /* Our only callers in this case look for single bit values. So - just return the mode mask. Those tests will then be false. */ - return nonzero; + tem = get_last_value (x); -#ifndef WORD_REGISTER_OPERATIONS - /* If MODE is wider than X, but both are a single word for both the host - and target machines, we can compute this from which bits of the - object might be nonzero in its own mode, taking into account the fact - that on many CISC machines, accessing an object in a wider mode - causes the high-order bits to become undefined. So they are - not known to be zero. */ - - if (GET_MODE (x) != VOIDmode && GET_MODE (x) != mode - && GET_MODE_BITSIZE (GET_MODE (x)) <= BITS_PER_WORD - && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT - && GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (GET_MODE (x))) + if (tem) { - nonzero &= nonzero_bits_with_known (x, GET_MODE (x)); - nonzero |= GET_MODE_MASK (mode) & ~GET_MODE_MASK (GET_MODE (x)); - return nonzero; - } -#endif - - code = GET_CODE (x); - switch (code) - { - case REG: -#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) - /* If pointers extend unsigned and this is a pointer in Pmode, say that - all the bits above ptr_mode are known to be zero. */ - if (POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode - && REG_POINTER (x)) - nonzero &= GET_MODE_MASK (ptr_mode); -#endif - - /* Include declared information about alignment of pointers. */ - /* ??? We don't properly preserve REG_POINTER changes across - pointer-to-integer casts, so we can't trust it except for - things that we know must be pointers. See execute/960116-1.c. */ - if ((x == stack_pointer_rtx - || x == frame_pointer_rtx - || x == arg_pointer_rtx) - && REGNO_POINTER_ALIGN (REGNO (x))) - { - unsigned HOST_WIDE_INT alignment - = REGNO_POINTER_ALIGN (REGNO (x)) / BITS_PER_UNIT; - -#ifdef PUSH_ROUNDING - /* If PUSH_ROUNDING is defined, it is possible for the - stack to be momentarily aligned only to that amount, - so we pick the least alignment. */ - if (x == stack_pointer_rtx && PUSH_ARGS) - alignment = MIN ((unsigned HOST_WIDE_INT) PUSH_ROUNDING (1), - alignment); -#endif - - nonzero &= ~(alignment - 1); - } - - /* If X is a register whose nonzero bits value is current, use it. - Otherwise, if X is a register whose value we can find, use that - value. Otherwise, use the previously-computed global nonzero bits - for this register. */ - - if (reg_last_set_value[REGNO (x)] != 0 - && (reg_last_set_mode[REGNO (x)] == mode - || (GET_MODE_CLASS (reg_last_set_mode[REGNO (x)]) == MODE_INT - && GET_MODE_CLASS (mode) == MODE_INT)) - && (reg_last_set_label[REGNO (x)] == label_tick - || (REGNO (x) >= FIRST_PSEUDO_REGISTER - && REG_N_SETS (REGNO (x)) == 1 - && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, - REGNO (x)))) - && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid) - return reg_last_set_nonzero_bits[REGNO (x)] & nonzero; - - tem = get_last_value (x); - - if (tem) - { #ifdef SHORT_IMMEDIATES_SIGN_EXTEND - /* If X is narrower than MODE and TEM is a non-negative - constant that would appear negative in the mode of X, - sign-extend it for use in reg_nonzero_bits because some - machines (maybe most) will actually do the sign-extension - and this is the conservative approach. + /* If X is narrower than MODE and TEM is a non-negative + constant that would appear negative in the mode of X, + sign-extend it for use in reg_nonzero_bits because some + machines (maybe most) will actually do the sign-extension + and this is the conservative approach. - ??? For 2.5, try to tighten up the MD files in this regard - instead of this kludge. */ + ??? For 2.5, try to tighten up the MD files in this regard + instead of this kludge. */ - if (GET_MODE_BITSIZE (GET_MODE (x)) < mode_width - && GET_CODE (tem) == CONST_INT - && INTVAL (tem) > 0 - && 0 != (INTVAL (tem) - & ((HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (x)) - 1)))) - tem = GEN_INT (INTVAL (tem) - | ((HOST_WIDE_INT) (-1) - << GET_MODE_BITSIZE (GET_MODE (x)))); + if (GET_MODE_BITSIZE (GET_MODE (x)) < GET_MODE_BITSIZE (mode) + && GET_CODE (tem) == CONST_INT + && INTVAL (tem) > 0 + && 0 != (INTVAL (tem) + & ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (GET_MODE (x)) - 1)))) + tem = GEN_INT (INTVAL (tem) + | ((HOST_WIDE_INT) (-1) + << GET_MODE_BITSIZE (GET_MODE (x)))); #endif - return nonzero_bits_with_known (tem, mode) & nonzero; - } - else if (nonzero_sign_valid && reg_nonzero_bits[REGNO (x)]) - { - unsigned HOST_WIDE_INT mask = reg_nonzero_bits[REGNO (x)]; - - if (GET_MODE_BITSIZE (GET_MODE (x)) < mode_width) - /* We don't know anything about the upper bits. */ - mask |= GET_MODE_MASK (mode) ^ GET_MODE_MASK (GET_MODE (x)); - return nonzero & mask; - } - else - return nonzero; - - case CONST_INT: -#ifdef SHORT_IMMEDIATES_SIGN_EXTEND - /* If X is negative in MODE, sign-extend the value. */ - if (INTVAL (x) > 0 && mode_width < BITS_PER_WORD - && 0 != (INTVAL (x) & ((HOST_WIDE_INT) 1 << (mode_width - 1)))) - return (INTVAL (x) | ((HOST_WIDE_INT) (-1) << mode_width)); -#endif - - return INTVAL (x); - - case MEM: -#ifdef LOAD_EXTEND_OP - /* In many, if not most, RISC machines, reading a byte from memory - zeros the rest of the register. Noticing that fact saves a lot - of extra zero-extends. */ - if (LOAD_EXTEND_OP (GET_MODE (x)) == ZERO_EXTEND) - nonzero &= GET_MODE_MASK (GET_MODE (x)); -#endif - break; - - case EQ: case NE: - case UNEQ: case LTGT: - case GT: case GTU: case UNGT: - case LT: case LTU: case UNLT: - case GE: case GEU: case UNGE: - case LE: case LEU: case UNLE: - case UNORDERED: case ORDERED: - - /* If this produces an integer result, we know which bits are set. - Code here used to clear bits outside the mode of X, but that is - now done above. */ - - if (GET_MODE_CLASS (mode) == MODE_INT - && mode_width <= HOST_BITS_PER_WIDE_INT) - nonzero = STORE_FLAG_VALUE; - break; - - case NEG: -#if 0 - /* Disabled to avoid exponential mutual recursion between nonzero_bits - and num_sign_bit_copies. */ - if (num_sign_bit_copies (XEXP (x, 0), GET_MODE (x)) - == GET_MODE_BITSIZE (GET_MODE (x))) - nonzero = 1; -#endif - - if (GET_MODE_SIZE (GET_MODE (x)) < mode_width) - nonzero |= (GET_MODE_MASK (mode) & ~GET_MODE_MASK (GET_MODE (x))); - break; - - case ABS: -#if 0 - /* Disabled to avoid exponential mutual recursion between nonzero_bits - and num_sign_bit_copies. */ - if (num_sign_bit_copies (XEXP (x, 0), GET_MODE (x)) - == GET_MODE_BITSIZE (GET_MODE (x))) - nonzero = 1; -#endif - break; - - case TRUNCATE: - nonzero &= (nonzero_bits_with_known (XEXP (x, 0), mode) - & GET_MODE_MASK (mode)); - break; - - case ZERO_EXTEND: - nonzero &= nonzero_bits_with_known (XEXP (x, 0), mode); - if (GET_MODE (XEXP (x, 0)) != VOIDmode) - nonzero &= GET_MODE_MASK (GET_MODE (XEXP (x, 0))); - break; - - case SIGN_EXTEND: - /* If the sign bit is known clear, this is the same as ZERO_EXTEND. - Otherwise, show all the bits in the outer mode but not the inner - may be nonzero. */ - inner_nz = nonzero_bits_with_known (XEXP (x, 0), mode); - if (GET_MODE (XEXP (x, 0)) != VOIDmode) - { - inner_nz &= GET_MODE_MASK (GET_MODE (XEXP (x, 0))); - if (inner_nz - & (((HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - 1)))) - inner_nz |= (GET_MODE_MASK (mode) - & ~GET_MODE_MASK (GET_MODE (XEXP (x, 0)))); - } - - nonzero &= inner_nz; - break; - - case AND: - nonzero &= (nonzero_bits_with_known (XEXP (x, 0), mode) - & nonzero_bits_with_known (XEXP (x, 1), mode)); - break; - - case XOR: case IOR: - case UMIN: case UMAX: case SMIN: case SMAX: - { - unsigned HOST_WIDE_INT nonzero0 = - nonzero_bits_with_known (XEXP (x, 0), mode); - - /* Don't call nonzero_bits for the second time if it cannot change - anything. */ - if ((nonzero & nonzero0) != nonzero) - nonzero &= (nonzero0 - | nonzero_bits_with_known (XEXP (x, 1), mode)); - } - break; - - case PLUS: case MINUS: - case MULT: - case DIV: case UDIV: - case MOD: case UMOD: - /* We can apply the rules of arithmetic to compute the number of - high- and low-order zero bits of these operations. We start by - computing the width (position of the highest-order nonzero bit) - and the number of low-order zero bits for each value. */ - { - unsigned HOST_WIDE_INT nz0 = - nonzero_bits_with_known (XEXP (x, 0), mode); - unsigned HOST_WIDE_INT nz1 = - nonzero_bits_with_known (XEXP (x, 1), mode); - int sign_index = GET_MODE_BITSIZE (GET_MODE (x)) - 1; - int width0 = floor_log2 (nz0) + 1; - int width1 = floor_log2 (nz1) + 1; - int low0 = floor_log2 (nz0 & -nz0); - int low1 = floor_log2 (nz1 & -nz1); - HOST_WIDE_INT op0_maybe_minusp - = (nz0 & ((HOST_WIDE_INT) 1 << sign_index)); - HOST_WIDE_INT op1_maybe_minusp - = (nz1 & ((HOST_WIDE_INT) 1 << sign_index)); - unsigned int result_width = mode_width; - int result_low = 0; - - switch (code) - { - case PLUS: - result_width = MAX (width0, width1) + 1; - result_low = MIN (low0, low1); - break; - case MINUS: - result_low = MIN (low0, low1); - break; - case MULT: - result_width = width0 + width1; - result_low = low0 + low1; - break; - case DIV: - if (width1 == 0) - break; - if (! op0_maybe_minusp && ! op1_maybe_minusp) - result_width = width0; - break; - case UDIV: - if (width1 == 0) - break; - result_width = width0; - break; - case MOD: - if (width1 == 0) - break; - if (! op0_maybe_minusp && ! op1_maybe_minusp) - result_width = MIN (width0, width1); - result_low = MIN (low0, low1); - break; - case UMOD: - if (width1 == 0) - break; - result_width = MIN (width0, width1); - result_low = MIN (low0, low1); - break; - default: - abort (); - } - - if (result_width < mode_width) - nonzero &= ((HOST_WIDE_INT) 1 << result_width) - 1; - - if (result_low > 0) - nonzero &= ~(((HOST_WIDE_INT) 1 << result_low) - 1); - -#ifdef POINTERS_EXTEND_UNSIGNED - /* If pointers extend unsigned and this is an addition or subtraction - to a pointer in Pmode, all the bits above ptr_mode are known to be - zero. */ - if (POINTERS_EXTEND_UNSIGNED > 0 && GET_MODE (x) == Pmode - && (code == PLUS || code == MINUS) - && GET_CODE (XEXP (x, 0)) == REG && REG_POINTER (XEXP (x, 0))) - nonzero &= GET_MODE_MASK (ptr_mode); -#endif - } - break; - - case ZERO_EXTRACT: - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT) - nonzero &= ((HOST_WIDE_INT) 1 << INTVAL (XEXP (x, 1))) - 1; - break; - - case SUBREG: - /* If this is a SUBREG formed for a promoted variable that has - been zero-extended, we know that at least the high-order bits - are zero, though others might be too. */ - - if (SUBREG_PROMOTED_VAR_P (x) && SUBREG_PROMOTED_UNSIGNED_P (x) > 0) - nonzero = (GET_MODE_MASK (GET_MODE (x)) - & nonzero_bits_with_known (SUBREG_REG (x), GET_MODE (x))); - - /* If the inner mode is a single word for both the host and target - machines, we can compute this from which bits of the inner - object might be nonzero. */ - if (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) <= BITS_PER_WORD - && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - <= HOST_BITS_PER_WIDE_INT)) - { - nonzero &= nonzero_bits_with_known (SUBREG_REG (x), mode); - -#if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP) - /* If this is a typical RISC machine, we only have to worry - about the way loads are extended. */ - if ((LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND - ? (((nonzero - & (((unsigned HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1)))) - != 0)) - : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND) - || GET_CODE (SUBREG_REG (x)) != MEM) -#endif - { - /* On many CISC machines, accessing an object in a wider mode - causes the high-order bits to become undefined. So they are - not known to be zero. */ - if (GET_MODE_SIZE (GET_MODE (x)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) - nonzero |= (GET_MODE_MASK (GET_MODE (x)) - & ~GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))); - } - } - break; - - case ASHIFTRT: - case LSHIFTRT: - case ASHIFT: - case ROTATE: - /* The nonzero bits are in two classes: any bits within MODE - that aren't in GET_MODE (x) are always significant. The rest of the - nonzero bits are those that are significant in the operand of - the shift when shifted the appropriate number of bits. This - shows that high-order bits are cleared by the right shift and - low-order bits by left shifts. */ - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) >= 0 - && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT) - { - enum machine_mode inner_mode = GET_MODE (x); - unsigned int width = GET_MODE_BITSIZE (inner_mode); - int count = INTVAL (XEXP (x, 1)); - unsigned HOST_WIDE_INT mode_mask = GET_MODE_MASK (inner_mode); - unsigned HOST_WIDE_INT op_nonzero = - nonzero_bits_with_known (XEXP (x, 0), mode); - unsigned HOST_WIDE_INT inner = op_nonzero & mode_mask; - unsigned HOST_WIDE_INT outer = 0; - - if (mode_width > width) - outer = (op_nonzero & nonzero & ~mode_mask); - - if (code == LSHIFTRT) - inner >>= count; - else if (code == ASHIFTRT) - { - inner >>= count; - - /* If the sign bit may have been nonzero before the shift, we - need to mark all the places it could have been copied to - by the shift as possibly nonzero. */ - if (inner & ((HOST_WIDE_INT) 1 << (width - 1 - count))) - inner |= (((HOST_WIDE_INT) 1 << count) - 1) << (width - count); - } - else if (code == ASHIFT) - inner <<= count; - else - inner = ((inner << (count % width) - | (inner >> (width - (count % width)))) & mode_mask); - - nonzero &= (outer | inner); - } - break; - - case FFS: - case POPCOUNT: - /* This is at most the number of bits in the mode. */ - nonzero = ((HOST_WIDE_INT) 2 << (floor_log2 (mode_width))) - 1; - break; - - case CLZ: - /* If CLZ has a known value at zero, then the nonzero bits are - that value, plus the number of bits in the mode minus one. */ - if (CLZ_DEFINED_VALUE_AT_ZERO (mode, nonzero)) - nonzero |= ((HOST_WIDE_INT) 1 << (floor_log2 (mode_width))) - 1; - else - nonzero = -1; - break; - - case CTZ: - /* If CTZ has a known value at zero, then the nonzero bits are - that value, plus the number of bits in the mode minus one. */ - if (CTZ_DEFINED_VALUE_AT_ZERO (mode, nonzero)) - nonzero |= ((HOST_WIDE_INT) 1 << (floor_log2 (mode_width))) - 1; - else - nonzero = -1; - break; - - case PARITY: - nonzero = 1; - break; - - case IF_THEN_ELSE: - nonzero &= (nonzero_bits_with_known (XEXP (x, 1), mode) - | nonzero_bits_with_known (XEXP (x, 2), mode)); - break; - - default: - break; + return tem; } - - return nonzero; -} - -/* See the macro definition above. */ -#undef cached_num_sign_bit_copies - -#define num_sign_bit_copies_with_known(X, M) \ - cached_num_sign_bit_copies (X, M, known_x, known_mode, known_ret) - -/* The function cached_num_sign_bit_copies is a wrapper around - num_sign_bit_copies1. It avoids exponential behavior in - num_sign_bit_copies1 when X has identical subexpressions on the - first or the second level. */ - -static unsigned int -cached_num_sign_bit_copies (rtx x, enum machine_mode mode, rtx known_x, - enum machine_mode known_mode, - unsigned int known_ret) -{ - if (x == known_x && mode == known_mode) - return known_ret; - - /* Try to find identical subexpressions. If found call - num_sign_bit_copies1 on X with the subexpressions as KNOWN_X and - the precomputed value for the subexpression as KNOWN_RET. */ - - if (GET_RTX_CLASS (GET_CODE (x)) == '2' - || GET_RTX_CLASS (GET_CODE (x)) == 'c') + else if (nonzero_sign_valid && reg_stat[REGNO (x)].nonzero_bits) { - rtx x0 = XEXP (x, 0); - rtx x1 = XEXP (x, 1); + unsigned HOST_WIDE_INT mask = reg_stat[REGNO (x)].nonzero_bits; - /* Check the first level. */ - if (x0 == x1) - return - num_sign_bit_copies1 (x, mode, x0, mode, - num_sign_bit_copies_with_known (x0, mode)); - - /* Check the second level. */ - if ((GET_RTX_CLASS (GET_CODE (x0)) == '2' - || GET_RTX_CLASS (GET_CODE (x0)) == 'c') - && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1))) - return - num_sign_bit_copies1 (x, mode, x1, mode, - num_sign_bit_copies_with_known (x1, mode)); - - if ((GET_RTX_CLASS (GET_CODE (x1)) == '2' - || GET_RTX_CLASS (GET_CODE (x1)) == 'c') - && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1))) - return - num_sign_bit_copies1 (x, mode, x0, mode, - num_sign_bit_copies_with_known (x0, mode)); + if (GET_MODE_BITSIZE (GET_MODE (x)) < GET_MODE_BITSIZE (mode)) + /* We don't know anything about the upper bits. */ + mask |= GET_MODE_MASK (mode) ^ GET_MODE_MASK (GET_MODE (x)); + *nonzero &= mask; } - return num_sign_bit_copies1 (x, mode, known_x, known_mode, known_ret); + return NULL; } /* Return the number of bits at the high-order end of X that are known to @@ -8605,354 +8331,39 @@ cached_num_sign_bit_copies (rtx x, enum machine_mode mode, rtx known_x, VOIDmode, X will be used in its own mode. The returned value will always be between 1 and the number of bits in MODE. */ -static unsigned int -num_sign_bit_copies1 (rtx x, enum machine_mode mode, rtx known_x, - enum machine_mode known_mode, - unsigned int known_ret) +static rtx +reg_num_sign_bit_copies_for_combine (rtx x, enum machine_mode mode, + rtx known_x ATTRIBUTE_UNUSED, + enum machine_mode known_mode + ATTRIBUTE_UNUSED, + unsigned int known_ret ATTRIBUTE_UNUSED, + unsigned int *result) { - enum rtx_code code = GET_CODE (x); - unsigned int bitwidth; - int num0, num1, result; - unsigned HOST_WIDE_INT nonzero; rtx tem; - /* If we weren't given a mode, use the mode of X. If the mode is still - VOIDmode, we don't know anything. Likewise if one of the modes is - floating-point. */ - - if (mode == VOIDmode) - mode = GET_MODE (x); - - if (mode == VOIDmode || FLOAT_MODE_P (mode) || FLOAT_MODE_P (GET_MODE (x))) - return 1; - - bitwidth = GET_MODE_BITSIZE (mode); - - /* For a smaller object, just ignore the high bits. */ - if (bitwidth < GET_MODE_BITSIZE (GET_MODE (x))) + if (reg_stat[REGNO (x)].last_set_value != 0 + && reg_stat[REGNO (x)].last_set_mode == mode + && (reg_stat[REGNO (x)].last_set_label == label_tick + || (REGNO (x) >= FIRST_PSEUDO_REGISTER + && REG_N_SETS (REGNO (x)) == 1 + && ! REGNO_REG_SET_P + (ENTRY_BLOCK_PTR->next_bb->il.rtl->global_live_at_start, + REGNO (x)))) + && INSN_CUID (reg_stat[REGNO (x)].last_set) < subst_low_cuid) { - num0 = num_sign_bit_copies_with_known (x, GET_MODE (x)); - return MAX (1, - num0 - (int) (GET_MODE_BITSIZE (GET_MODE (x)) - bitwidth)); + *result = reg_stat[REGNO (x)].last_set_sign_bit_copies; + return NULL; } - if (GET_MODE (x) != VOIDmode && bitwidth > GET_MODE_BITSIZE (GET_MODE (x))) - { -#ifndef WORD_REGISTER_OPERATIONS - /* If this machine does not do all register operations on the entire - register and MODE is wider than the mode of X, we can say nothing - at all about the high-order bits. */ - return 1; -#else - /* Likewise on machines that do, if the mode of the object is smaller - than a word and loads of that size don't sign extend, we can say - nothing about the high order bits. */ - if (GET_MODE_BITSIZE (GET_MODE (x)) < BITS_PER_WORD -#ifdef LOAD_EXTEND_OP - && LOAD_EXTEND_OP (GET_MODE (x)) != SIGN_EXTEND -#endif - ) - return 1; -#endif - } + tem = get_last_value (x); + if (tem != 0) + return tem; - switch (code) - { - case REG: + if (nonzero_sign_valid && reg_stat[REGNO (x)].sign_bit_copies != 0 + && GET_MODE_BITSIZE (GET_MODE (x)) == GET_MODE_BITSIZE (mode)) + *result = reg_stat[REGNO (x)].sign_bit_copies; -#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) - /* If pointers extend signed and this is a pointer in Pmode, say that - all the bits above ptr_mode are known to be sign bit copies. */ - if (! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode && mode == Pmode - && REG_POINTER (x)) - return GET_MODE_BITSIZE (Pmode) - GET_MODE_BITSIZE (ptr_mode) + 1; -#endif - - if (reg_last_set_value[REGNO (x)] != 0 - && reg_last_set_mode[REGNO (x)] == mode - && (reg_last_set_label[REGNO (x)] == label_tick - || (REGNO (x) >= FIRST_PSEUDO_REGISTER - && REG_N_SETS (REGNO (x)) == 1 - && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, - REGNO (x)))) - && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid) - return reg_last_set_sign_bit_copies[REGNO (x)]; - - tem = get_last_value (x); - if (tem != 0) - return num_sign_bit_copies_with_known (tem, mode); - - if (nonzero_sign_valid && reg_sign_bit_copies[REGNO (x)] != 0 - && GET_MODE_BITSIZE (GET_MODE (x)) == bitwidth) - return reg_sign_bit_copies[REGNO (x)]; - break; - - case MEM: -#ifdef LOAD_EXTEND_OP - /* Some RISC machines sign-extend all loads of smaller than a word. */ - if (LOAD_EXTEND_OP (GET_MODE (x)) == SIGN_EXTEND) - return MAX (1, ((int) bitwidth - - (int) GET_MODE_BITSIZE (GET_MODE (x)) + 1)); -#endif - break; - - case CONST_INT: - /* If the constant is negative, take its 1's complement and remask. - Then see how many zero bits we have. */ - nonzero = INTVAL (x) & GET_MODE_MASK (mode); - if (bitwidth <= HOST_BITS_PER_WIDE_INT - && (nonzero & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) - nonzero = (~nonzero) & GET_MODE_MASK (mode); - - return (nonzero == 0 ? bitwidth : bitwidth - floor_log2 (nonzero) - 1); - - case SUBREG: - /* If this is a SUBREG for a promoted object that is sign-extended - and we are looking at it in a wider mode, we know that at least the - high-order bits are known to be sign bit copies. */ - - if (SUBREG_PROMOTED_VAR_P (x) && ! SUBREG_PROMOTED_UNSIGNED_P (x)) - { - num0 = num_sign_bit_copies_with_known (SUBREG_REG (x), mode); - return MAX ((int) bitwidth - - (int) GET_MODE_BITSIZE (GET_MODE (x)) + 1, - num0); - } - - /* For a smaller object, just ignore the high bits. */ - if (bitwidth <= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x)))) - { - num0 = num_sign_bit_copies_with_known (SUBREG_REG (x), VOIDmode); - return MAX (1, (num0 - - (int) (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - - bitwidth))); - } - -#ifdef WORD_REGISTER_OPERATIONS -#ifdef LOAD_EXTEND_OP - /* For paradoxical SUBREGs on machines where all register operations - affect the entire register, just look inside. Note that we are - passing MODE to the recursive call, so the number of sign bit copies - will remain relative to that mode, not the inner mode. */ - - /* This works only if loads sign extend. Otherwise, if we get a - reload for the inner part, it may be loaded from the stack, and - then we lose all sign bit copies that existed before the store - to the stack. */ - - if ((GET_MODE_SIZE (GET_MODE (x)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) - && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND - && GET_CODE (SUBREG_REG (x)) == MEM) - return num_sign_bit_copies_with_known (SUBREG_REG (x), mode); -#endif -#endif - break; - - case SIGN_EXTRACT: - if (GET_CODE (XEXP (x, 1)) == CONST_INT) - return MAX (1, (int) bitwidth - INTVAL (XEXP (x, 1))); - break; - - case SIGN_EXTEND: - return (bitwidth - GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - + num_sign_bit_copies_with_known (XEXP (x, 0), VOIDmode)); - - case TRUNCATE: - /* For a smaller object, just ignore the high bits. */ - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), VOIDmode); - return MAX (1, (num0 - (int) (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - - bitwidth))); - - case NOT: - return num_sign_bit_copies_with_known (XEXP (x, 0), mode); - - case ROTATE: case ROTATERT: - /* If we are rotating left by a number of bits less than the number - of sign bit copies, we can just subtract that amount from the - number. */ - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) >= 0 - && INTVAL (XEXP (x, 1)) < (int) bitwidth) - { - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - return MAX (1, num0 - (code == ROTATE ? INTVAL (XEXP (x, 1)) - : (int) bitwidth - INTVAL (XEXP (x, 1)))); - } - break; - - case NEG: - /* In general, this subtracts one sign bit copy. But if the value - is known to be positive, the number of sign bit copies is the - same as that of the input. Finally, if the input has just one bit - that might be nonzero, all the bits are copies of the sign bit. */ - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - if (bitwidth > HOST_BITS_PER_WIDE_INT) - return num0 > 1 ? num0 - 1 : 1; - - nonzero = nonzero_bits (XEXP (x, 0), mode); - if (nonzero == 1) - return bitwidth; - - if (num0 > 1 - && (((HOST_WIDE_INT) 1 << (bitwidth - 1)) & nonzero)) - num0--; - - return num0; - - case IOR: case AND: case XOR: - case SMIN: case SMAX: case UMIN: case UMAX: - /* Logical operations will preserve the number of sign-bit copies. - MIN and MAX operations always return one of the operands. */ - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - num1 = num_sign_bit_copies_with_known (XEXP (x, 1), mode); - return MIN (num0, num1); - - case PLUS: case MINUS: - /* For addition and subtraction, we can have a 1-bit carry. However, - if we are subtracting 1 from a positive number, there will not - be such a carry. Furthermore, if the positive number is known to - be 0 or 1, we know the result is either -1 or 0. */ - - if (code == PLUS && XEXP (x, 1) == constm1_rtx - && bitwidth <= HOST_BITS_PER_WIDE_INT) - { - nonzero = nonzero_bits (XEXP (x, 0), mode); - if ((((HOST_WIDE_INT) 1 << (bitwidth - 1)) & nonzero) == 0) - return (nonzero == 1 || nonzero == 0 ? bitwidth - : bitwidth - floor_log2 (nonzero) - 1); - } - - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - num1 = num_sign_bit_copies_with_known (XEXP (x, 1), mode); - result = MAX (1, MIN (num0, num1) - 1); - -#ifdef POINTERS_EXTEND_UNSIGNED - /* If pointers extend signed and this is an addition or subtraction - to a pointer in Pmode, all the bits above ptr_mode are known to be - sign bit copies. */ - if (! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode - && (code == PLUS || code == MINUS) - && GET_CODE (XEXP (x, 0)) == REG && REG_POINTER (XEXP (x, 0))) - result = MAX ((int) (GET_MODE_BITSIZE (Pmode) - - GET_MODE_BITSIZE (ptr_mode) + 1), - result); -#endif - return result; - - case MULT: - /* The number of bits of the product is the sum of the number of - bits of both terms. However, unless one of the terms if known - to be positive, we must allow for an additional bit since negating - a negative number can remove one sign bit copy. */ - - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - num1 = num_sign_bit_copies_with_known (XEXP (x, 1), mode); - - result = bitwidth - (bitwidth - num0) - (bitwidth - num1); - if (result > 0 - && (bitwidth > HOST_BITS_PER_WIDE_INT - || (((nonzero_bits (XEXP (x, 0), mode) - & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) - && ((nonzero_bits (XEXP (x, 1), mode) - & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0)))) - result--; - - return MAX (1, result); - - case UDIV: - /* The result must be <= the first operand. If the first operand - has the high bit set, we know nothing about the number of sign - bit copies. */ - if (bitwidth > HOST_BITS_PER_WIDE_INT) - return 1; - else if ((nonzero_bits (XEXP (x, 0), mode) - & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) - return 1; - else - return num_sign_bit_copies_with_known (XEXP (x, 0), mode); - - case UMOD: - /* The result must be <= the second operand. */ - return num_sign_bit_copies_with_known (XEXP (x, 1), mode); - - case DIV: - /* Similar to unsigned division, except that we have to worry about - the case where the divisor is negative, in which case we have - to add 1. */ - result = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - if (result > 1 - && (bitwidth > HOST_BITS_PER_WIDE_INT - || (nonzero_bits (XEXP (x, 1), mode) - & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0)) - result--; - - return result; - - case MOD: - result = num_sign_bit_copies_with_known (XEXP (x, 1), mode); - if (result > 1 - && (bitwidth > HOST_BITS_PER_WIDE_INT - || (nonzero_bits (XEXP (x, 1), mode) - & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0)) - result--; - - return result; - - case ASHIFTRT: - /* Shifts by a constant add to the number of bits equal to the - sign bit. */ - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) > 0) - num0 = MIN ((int) bitwidth, num0 + INTVAL (XEXP (x, 1))); - - return num0; - - case ASHIFT: - /* Left shifts destroy copies. */ - if (GET_CODE (XEXP (x, 1)) != CONST_INT - || INTVAL (XEXP (x, 1)) < 0 - || INTVAL (XEXP (x, 1)) >= (int) bitwidth) - return 1; - - num0 = num_sign_bit_copies_with_known (XEXP (x, 0), mode); - return MAX (1, num0 - INTVAL (XEXP (x, 1))); - - case IF_THEN_ELSE: - num0 = num_sign_bit_copies_with_known (XEXP (x, 1), mode); - num1 = num_sign_bit_copies_with_known (XEXP (x, 2), mode); - return MIN (num0, num1); - - case EQ: case NE: case GE: case GT: case LE: case LT: - case UNEQ: case LTGT: case UNGE: case UNGT: case UNLE: case UNLT: - case GEU: case GTU: case LEU: case LTU: - case UNORDERED: case ORDERED: - /* If the constant is negative, take its 1's complement and remask. - Then see how many zero bits we have. */ - nonzero = STORE_FLAG_VALUE; - if (bitwidth <= HOST_BITS_PER_WIDE_INT - && (nonzero & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) - nonzero = (~nonzero) & GET_MODE_MASK (mode); - - return (nonzero == 0 ? bitwidth : bitwidth - floor_log2 (nonzero) - 1); - break; - - default: - break; - } - - /* If we haven't been able to figure it out by one of the above rules, - see if some of the high-order bits are known to be zero. If so, - count those bits and return one less than that amount. If we can't - safely compute the mask for this mode, always return BITWIDTH. */ - - if (bitwidth > HOST_BITS_PER_WIDE_INT) - return 1; - - nonzero = nonzero_bits (x, mode); - return (nonzero & ((HOST_WIDE_INT) 1 << (bitwidth - 1)) - ? 1 : bitwidth - floor_log2 (nonzero) - 1); + return NULL; } /* Return the number of "extended" bits there are in X, when interpreted @@ -8994,7 +8405,7 @@ extended_count (rtx x, enum machine_mode mode, int unsignedp) the width of this mode matter. It is assumed that the width of this mode is smaller than or equal to HOST_BITS_PER_WIDE_INT. - If *POP0 or OP1 are NIL, it means no operation is required. Only NEG, PLUS, + If *POP0 or OP1 are UNKNOWN, it means no operation is required. Only NEG, PLUS, IOR, XOR, and AND are supported. We may set *POP0 to SET if the proper result is simply *PCONST0. @@ -9014,13 +8425,13 @@ merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1, if (op0 == AND) const1 &= const0; - /* If OP0 or OP1 is NIL, this is easy. Similarly if they are the same or + /* If OP0 or OP1 is UNKNOWN, this is easy. Similarly if they are the same or if OP0 is SET. */ - if (op1 == NIL || op0 == SET) + if (op1 == UNKNOWN || op0 == SET) return 1; - else if (op0 == NIL) + else if (op0 == UNKNOWN) op0 = op1, const0 = const1; else if (op0 == op1) @@ -9040,7 +8451,7 @@ merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1, const0 += const1; break; case NEG: - op0 = NIL; + op0 = UNKNOWN; break; default: break; @@ -9093,12 +8504,12 @@ merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1, const0 &= GET_MODE_MASK (mode); if (const0 == 0 && (op0 == IOR || op0 == XOR || op0 == PLUS)) - op0 = NIL; + op0 = UNKNOWN; else if (const0 == 0 && op0 == AND) op0 = SET; else if ((unsigned HOST_WIDE_INT) const0 == GET_MODE_MASK (mode) && op0 == AND) - op0 = NIL; + op0 = UNKNOWN; /* ??? Slightly redundant with the above mask, but not entirely. Moving this above means we'd have to sign-extend the mode mask @@ -9112,31 +8523,29 @@ merge_outer_ops (enum rtx_code *pop0, HOST_WIDE_INT *pconst0, enum rtx_code op1, } /* Simplify a shift of VAROP by COUNT bits. CODE says what kind of shift. - The result of the shift is RESULT_MODE. X, if nonzero, is an expression - that we started with. + The result of the shift is RESULT_MODE. Return NULL_RTX if we cannot + simplify it. Otherwise, return a simplified value. The shift is normally computed in the widest mode we find in VAROP, as long as it isn't a different number of words than RESULT_MODE. Exceptions - are ASHIFTRT and ROTATE, which are always done in their original mode, */ + are ASHIFTRT and ROTATE, which are always done in their original mode. */ static rtx -simplify_shift_const (rtx x, enum rtx_code code, - enum machine_mode result_mode, rtx varop, - int orig_count) +simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, + rtx varop, int orig_count) { enum rtx_code orig_code = code; - unsigned int count; - int signed_count; + rtx orig_varop = varop; + int count; enum machine_mode mode = result_mode; enum machine_mode shift_mode, tmode; unsigned int mode_words = (GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD; /* We form (outer_op (code varop count) (outer_const)). */ - enum rtx_code outer_op = NIL; + enum rtx_code outer_op = UNKNOWN; HOST_WIDE_INT outer_const = 0; - rtx const_rtx; int complement_p = 0; - rtx new; + rtx new, x; /* Make sure and truncate the "natural" shift on the way in. We don't want to do this inside the loop as it makes it more difficult to @@ -9148,12 +8557,7 @@ simplify_shift_const (rtx x, enum rtx_code code, what was requested. */ if (orig_count < 0 || orig_count >= (int) GET_MODE_BITSIZE (mode)) - { - if (x) - return x; - - return gen_rtx_fmt_ee (code, mode, varop, GEN_INT (orig_count)); - } + return NULL_RTX; count = orig_count; @@ -9162,10 +8566,9 @@ simplify_shift_const (rtx x, enum rtx_code code, while (count != 0) { - /* If we have an operand of (clobber (const_int 0)), just return that - value. */ + /* If we have an operand of (clobber (const_int 0)), fail. */ if (GET_CODE (varop) == CLOBBER) - return varop; + return NULL_RTX; /* If we discovered we had to complement VAROP, leave. Making a NOT here would cause an infinite loop. */ @@ -9201,7 +8604,7 @@ simplify_shift_const (rtx x, enum rtx_code code, multiple operations, each of which are defined, we know what the result is supposed to be. */ - if (count > (unsigned int) (GET_MODE_BITSIZE (shift_mode) - 1)) + if (count > (GET_MODE_BITSIZE (shift_mode) - 1)) { if (code == ASHIFTRT) count = GET_MODE_BITSIZE (shift_mode) - 1; @@ -9248,14 +8651,14 @@ simplify_shift_const (rtx x, enum rtx_code code, == 0)) code = LSHIFTRT; - if (code == LSHIFTRT - && GET_MODE_BITSIZE (shift_mode) <= HOST_BITS_PER_WIDE_INT - && !(nonzero_bits (varop, shift_mode) >> count)) - varop = const0_rtx; - if (code == ASHIFT - && GET_MODE_BITSIZE (shift_mode) <= HOST_BITS_PER_WIDE_INT - && !((nonzero_bits (varop, shift_mode) << count) - & GET_MODE_MASK (shift_mode))) + if (((code == LSHIFTRT + && GET_MODE_BITSIZE (shift_mode) <= HOST_BITS_PER_WIDE_INT + && !(nonzero_bits (varop, shift_mode) >> count)) + || (code == ASHIFT + && GET_MODE_BITSIZE (shift_mode) <= HOST_BITS_PER_WIDE_INT + && !((nonzero_bits (varop, shift_mode) << count) + & GET_MODE_MASK (shift_mode)))) + && !side_effects_p (varop)) varop = const0_rtx; switch (GET_CODE (varop)) @@ -9293,33 +8696,6 @@ simplify_shift_const (rtx x, enum rtx_code code, } break; - case USE: - /* Similar to the case above, except that we can only do this if - the resulting mode is the same as that of the underlying - MEM and adjust the address depending on the *bits* endianness - because of the way that bit-field extract insns are defined. */ - if ((code == ASHIFTRT || code == LSHIFTRT) - && (tmode = mode_for_size (GET_MODE_BITSIZE (mode) - count, - MODE_INT, 1)) != BLKmode - && tmode == GET_MODE (XEXP (varop, 0))) - { - if (BITS_BIG_ENDIAN) - new = XEXP (varop, 0); - else - { - new = copy_rtx (XEXP (varop, 0)); - SUBST (XEXP (new, 0), - plus_constant (XEXP (new, 0), - count / BITS_PER_UNIT)); - } - - varop = gen_rtx_fmt_e (code == ASHIFTRT ? SIGN_EXTEND - : ZERO_EXTEND, mode, new); - count = 0; - continue; - } - break; - case SUBREG: /* If VAROP is a SUBREG, strip it as long as the inner operand has the same number of words as what we've seen so far. Then store @@ -9346,8 +8722,10 @@ simplify_shift_const (rtx x, enum rtx_code code, && exact_log2 (INTVAL (XEXP (varop, 1))) >= 0) { varop - = gen_binary (ASHIFT, GET_MODE (varop), XEXP (varop, 0), - GEN_INT (exact_log2 (INTVAL (XEXP (varop, 1))))); + = simplify_gen_binary (ASHIFT, GET_MODE (varop), + XEXP (varop, 0), + GEN_INT (exact_log2 ( + INTVAL (XEXP (varop, 1))))); continue; } break; @@ -9358,8 +8736,10 @@ simplify_shift_const (rtx x, enum rtx_code code, && exact_log2 (INTVAL (XEXP (varop, 1))) >= 0) { varop - = gen_binary (LSHIFTRT, GET_MODE (varop), XEXP (varop, 0), - GEN_INT (exact_log2 (INTVAL (XEXP (varop, 1))))); + = simplify_gen_binary (LSHIFTRT, GET_MODE (varop), + XEXP (varop, 0), + GEN_INT (exact_log2 ( + INTVAL (XEXP (varop, 1))))); continue; } break; @@ -9371,7 +8751,7 @@ simplify_shift_const (rtx x, enum rtx_code code, interpreted as the sign bit in a narrower mode, so, if the result is narrower, don't discard the shift. */ if (code == LSHIFTRT - && count == (unsigned int) (GET_MODE_BITSIZE (result_mode) - 1) + && count == (GET_MODE_BITSIZE (result_mode) - 1) && (GET_MODE_BITSIZE (result_mode) >= GET_MODE_BITSIZE (GET_MODE (varop)))) { @@ -9390,7 +8770,8 @@ simplify_shift_const (rtx x, enum rtx_code code, && INTVAL (XEXP (varop, 1)) >= 0 && INTVAL (XEXP (varop, 1)) < GET_MODE_BITSIZE (GET_MODE (varop)) && GET_MODE_BITSIZE (result_mode) <= HOST_BITS_PER_WIDE_INT - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) + && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT + && !VECTOR_MODE_P (result_mode)) { enum rtx_code first_code = GET_CODE (varop); unsigned int first_count = INTVAL (XEXP (varop, 1)); @@ -9405,8 +8786,7 @@ simplify_shift_const (rtx x, enum rtx_code code, (ashiftrt:M1 (ashift:M1 (and:M1 (subreg:M1 FOO 0 C2) C3) C1). This simplifies certain SIGN_EXTEND operations. */ if (code == ASHIFT && first_code == ASHIFTRT - && count == (unsigned int) - (GET_MODE_BITSIZE (result_mode) + && count == (GET_MODE_BITSIZE (result_mode) - GET_MODE_BITSIZE (GET_MODE (varop)))) { /* C3 has the low-order C1 bits zero. */ @@ -9436,12 +8816,12 @@ simplify_shift_const (rtx x, enum rtx_code code, > first_count)) { varop = XEXP (varop, 0); - - signed_count = count - first_count; - if (signed_count < 0) - count = -signed_count, code = ASHIFT; - else - count = signed_count; + count -= first_count; + if (count < 0) + { + count = -count; + code = ASHIFT; + } continue; } @@ -9489,8 +8869,8 @@ simplify_shift_const (rtx x, enum rtx_code code, mask_rtx = GEN_INT (nonzero_bits (varop, GET_MODE (varop))); mask_rtx - = simplify_binary_operation (code, result_mode, mask_rtx, - GEN_INT (count)); + = simplify_const_binary_operation (code, result_mode, mask_rtx, + GEN_INT (count)); /* Give up if we can't compute an outer operation to use. */ if (mask_rtx == 0 @@ -9502,25 +8882,22 @@ simplify_shift_const (rtx x, enum rtx_code code, /* If the shifts are in the same direction, we add the counts. Otherwise, we subtract them. */ - signed_count = count; if ((code == ASHIFTRT || code == LSHIFTRT) == (first_code == ASHIFTRT || first_code == LSHIFTRT)) - signed_count += first_count; + count += first_count; else - signed_count -= first_count; + count -= first_count; /* If COUNT is positive, the new shift is usually CODE, except for the two exceptions below, in which case it is FIRST_CODE. If the count is negative, FIRST_CODE should always be used */ - if (signed_count > 0 + if (count > 0 && ((first_code == ROTATE && code == ASHIFT) || (first_code == ASHIFTRT && code == LSHIFTRT))) - code = first_code, count = signed_count; - else if (signed_count < 0) - code = first_code, count = -signed_count; - else - count = signed_count; + code = first_code; + else if (count < 0) + code = first_code, count = -count; varop = XEXP (varop, 0); continue; @@ -9531,12 +8908,12 @@ simplify_shift_const (rtx x, enum rtx_code code, B is not a constant. */ else if (GET_CODE (varop) == code - && GET_CODE (XEXP (varop, 1)) != CONST_INT - && 0 != (new - = simplify_binary_operation (code, mode, - XEXP (varop, 0), - GEN_INT (count)))) + && GET_CODE (XEXP (varop, 0)) == CONST_INT + && GET_CODE (XEXP (varop, 1)) != CONST_INT) { + rtx new = simplify_const_binary_operation (code, mode, + XEXP (varop, 0), + GEN_INT (count)); varop = gen_rtx_fmt_ee (code, mode, new, XEXP (varop, 1)); count = 0; continue; @@ -9563,8 +8940,7 @@ simplify_shift_const (rtx x, enum rtx_code code, && XEXP (XEXP (varop, 0), 1) == constm1_rtx && (STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1) && (code == LSHIFTRT || code == ASHIFTRT) - && count == (unsigned int) - (GET_MODE_BITSIZE (GET_MODE (varop)) - 1) + && count == (GET_MODE_BITSIZE (GET_MODE (varop)) - 1) && rtx_equal_p (XEXP (XEXP (varop, 0), 0), XEXP (varop, 1))) { count = 0; @@ -9584,9 +8960,14 @@ simplify_shift_const (rtx x, enum rtx_code code, (and (shift)) insns. */ if (GET_CODE (XEXP (varop, 1)) == CONST_INT - && (new = simplify_binary_operation (code, result_mode, - XEXP (varop, 1), - GEN_INT (count))) != 0 + /* We can't do this if we have (ashiftrt (xor)) and the + constant has its sign bit set in shift_mode. */ + && !(code == ASHIFTRT && GET_CODE (varop) == XOR + && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)), + shift_mode)) + && (new = simplify_const_binary_operation (code, result_mode, + XEXP (varop, 1), + GEN_INT (count))) != 0 && GET_CODE (new) == CONST_INT && merge_outer_ops (&outer_op, &outer_const, GET_CODE (varop), INTVAL (new), result_mode, &complement_p)) @@ -9597,18 +8978,25 @@ simplify_shift_const (rtx x, enum rtx_code code, /* If we can't do that, try to simplify the shift in each arm of the logical expression, make a new logical expression, and apply - the inverse distributive law. */ - { - rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode, - XEXP (varop, 0), count); - rtx rhs = simplify_shift_const (NULL_RTX, code, shift_mode, - XEXP (varop, 1), count); + the inverse distributive law. This also can't be done + for some (ashiftrt (xor)). */ + if (GET_CODE (XEXP (varop, 1)) == CONST_INT + && !(code == ASHIFTRT && GET_CODE (varop) == XOR + && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)), + shift_mode))) + { + rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode, + XEXP (varop, 0), count); + rtx rhs = simplify_shift_const (NULL_RTX, code, shift_mode, + XEXP (varop, 1), count); - varop = gen_binary (GET_CODE (varop), shift_mode, lhs, rhs); - varop = apply_distributive_law (varop); + varop = simplify_gen_binary (GET_CODE (varop), shift_mode, + lhs, rhs); + varop = apply_distributive_law (varop); - count = 0; - } + count = 0; + continue; + } break; case EQ: @@ -9619,11 +9007,9 @@ simplify_shift_const (rtx x, enum rtx_code code, if (code == LSHIFTRT && XEXP (varop, 1) == const0_rtx && GET_MODE (XEXP (varop, 0)) == result_mode - && count == (unsigned int) (GET_MODE_BITSIZE (result_mode) - 1) + && count == (GET_MODE_BITSIZE (result_mode) - 1) && GET_MODE_BITSIZE (result_mode) <= HOST_BITS_PER_WIDE_INT - && ((STORE_FLAG_VALUE - & ((HOST_WIDE_INT) 1 - < (GET_MODE_BITSIZE (result_mode) - 1)))) + && STORE_FLAG_VALUE == -1 && nonzero_bits (XEXP (varop, 0), result_mode) == 1 && merge_outer_ops (&outer_op, &outer_const, XOR, (HOST_WIDE_INT) 1, result_mode, @@ -9639,7 +9025,7 @@ simplify_shift_const (rtx x, enum rtx_code code, /* (lshiftrt (neg A) C) where A is either 0 or 1 and C is one less than the number of bits in the mode is equivalent to A. */ if (code == LSHIFTRT - && count == (unsigned int) (GET_MODE_BITSIZE (result_mode) - 1) + && count == (GET_MODE_BITSIZE (result_mode) - 1) && nonzero_bits (XEXP (varop, 0), result_mode) == 1) { varop = XEXP (varop, 0); @@ -9664,7 +9050,7 @@ simplify_shift_const (rtx x, enum rtx_code code, is one less than the number of bits in the mode is equivalent to (xor A 1). */ if (code == LSHIFTRT - && count == (unsigned int) (GET_MODE_BITSIZE (result_mode) - 1) + && count == (GET_MODE_BITSIZE (result_mode) - 1) && XEXP (varop, 1) == constm1_rtx && nonzero_bits (XEXP (varop, 0), result_mode) == 1 && merge_outer_ops (&outer_op, &outer_const, XOR, @@ -9707,9 +9093,9 @@ simplify_shift_const (rtx x, enum rtx_code code, /* (ashift (plus foo C) N) is (plus (ashift foo N) C'). */ if (code == ASHIFT && GET_CODE (XEXP (varop, 1)) == CONST_INT - && (new = simplify_binary_operation (ASHIFT, result_mode, - XEXP (varop, 1), - GEN_INT (count))) != 0 + && (new = simplify_const_binary_operation (ASHIFT, result_mode, + XEXP (varop, 1), + GEN_INT (count))) != 0 && GET_CODE (new) == CONST_INT && merge_outer_ops (&outer_op, &outer_const, PLUS, INTVAL (new), result_mode, &complement_p)) @@ -9717,6 +9103,26 @@ simplify_shift_const (rtx x, enum rtx_code code, varop = XEXP (varop, 0); continue; } + + /* Check for 'PLUS signbit', which is the canonical form of 'XOR + signbit', and attempt to change the PLUS to an XOR and move it to + the outer operation as is done above in the AND/IOR/XOR case + leg for shift(logical). See details in logical handling above + for reasoning in doing so. */ + if (code == LSHIFTRT + && GET_CODE (XEXP (varop, 1)) == CONST_INT + && mode_signbit_p (result_mode, XEXP (varop, 1)) + && (new = simplify_const_binary_operation (code, result_mode, + XEXP (varop, 1), + GEN_INT (count))) != 0 + && GET_CODE (new) == CONST_INT + && merge_outer_ops (&outer_op, &outer_const, XOR, + INTVAL (new), result_mode, &complement_p)) + { + varop = XEXP (varop, 0); + continue; + } + break; case MINUS: @@ -9729,12 +9135,10 @@ simplify_shift_const (rtx x, enum rtx_code code, if ((STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1) && GET_CODE (XEXP (varop, 0)) == ASHIFTRT - && count == (unsigned int) - (GET_MODE_BITSIZE (GET_MODE (varop)) - 1) + && count == (GET_MODE_BITSIZE (GET_MODE (varop)) - 1) && (code == LSHIFTRT || code == ASHIFTRT) && GET_CODE (XEXP (XEXP (varop, 0), 1)) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (varop, 0), 1)) - == count + && INTVAL (XEXP (XEXP (varop, 0), 1)) == count && rtx_equal_p (XEXP (XEXP (varop, 0), 0), XEXP (varop, 1))) { count = 0; @@ -9789,46 +9193,33 @@ simplify_shift_const (rtx x, enum rtx_code code, /* We have now finished analyzing the shift. The result should be a shift of type CODE with SHIFT_MODE shifting VAROP COUNT places. If - OUTER_OP is non-NIL, it is an operation that needs to be applied + OUTER_OP is non-UNKNOWN, it is an operation that needs to be applied to the result of the shift. OUTER_CONST is the relevant constant, - but we must turn off all bits turned off in the shift. + but we must turn off all bits turned off in the shift. */ - If we were passed a value for X, see if we can use any pieces of - it. If not, make new rtx. */ + if (outer_op == UNKNOWN + && orig_code == code && orig_count == count + && varop == orig_varop + && shift_mode == GET_MODE (varop)) + return NULL_RTX; - if (x && GET_RTX_CLASS (GET_CODE (x)) == '2' - && GET_CODE (XEXP (x, 1)) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) == count) - const_rtx = XEXP (x, 1); - else - const_rtx = GEN_INT (count); - - if (x && GET_CODE (XEXP (x, 0)) == SUBREG - && GET_MODE (XEXP (x, 0)) == shift_mode - && SUBREG_REG (XEXP (x, 0)) == varop) - varop = XEXP (x, 0); - else if (GET_MODE (varop) != shift_mode) - varop = gen_lowpart_for_combine (shift_mode, varop); - - /* If we can't make the SUBREG, try to return what we were given. */ - if (GET_CODE (varop) == CLOBBER) - return x ? x : varop; - - new = simplify_binary_operation (code, shift_mode, varop, const_rtx); - if (new != 0) - x = new; - else - x = gen_rtx_fmt_ee (code, shift_mode, varop, const_rtx); + /* Make a SUBREG if necessary. If we can't make it, fail. */ + varop = gen_lowpart (shift_mode, varop); + if (varop == NULL_RTX || GET_CODE (varop) == CLOBBER) + return NULL_RTX; /* If we have an outer operation and we just made a shift, it is possible that we could have simplified the shift were it not for the outer operation. So try to do the simplification recursively. */ - if (outer_op != NIL && GET_CODE (x) == code - && GET_CODE (XEXP (x, 1)) == CONST_INT) - x = simplify_shift_const (x, code, shift_mode, XEXP (x, 0), - INTVAL (XEXP (x, 1))); + if (outer_op != UNKNOWN) + x = simplify_shift_const_1 (code, shift_mode, varop, count); + else + x = NULL_RTX; + + if (x == NULL_RTX) + x = simplify_gen_binary (code, shift_mode, varop, GEN_INT (count)); /* If we were doing an LSHIFTRT in a wider mode than it was originally, turn off all the bits that the shift would have turned off. */ @@ -9837,14 +9228,14 @@ simplify_shift_const (rtx x, enum rtx_code code, GET_MODE_MASK (result_mode) >> orig_count); /* Do the remainder of the processing in RESULT_MODE. */ - x = gen_lowpart_for_combine (result_mode, x); + x = gen_lowpart_or_truncate (result_mode, x); /* If COMPLEMENT_P is set, we have to complement X before doing the outer operation. */ if (complement_p) x = simplify_gen_unary (NOT, result_mode, x, result_mode); - if (outer_op != NIL) + if (outer_op != UNKNOWN) { if (GET_MODE_BITSIZE (result_mode) < HOST_BITS_PER_WIDE_INT) outer_const = trunc_int_for_mode (outer_const, result_mode); @@ -9852,17 +9243,46 @@ simplify_shift_const (rtx x, enum rtx_code code, if (outer_op == AND) x = simplify_and_const_int (NULL_RTX, result_mode, x, outer_const); else if (outer_op == SET) - /* This means that we have determined that the result is - equivalent to a constant. This should be rare. */ - x = GEN_INT (outer_const); - else if (GET_RTX_CLASS (outer_op) == '1') + { + /* This means that we have determined that the result is + equivalent to a constant. This should be rare. */ + if (!side_effects_p (x)) + x = GEN_INT (outer_const); + } + else if (GET_RTX_CLASS (outer_op) == RTX_UNARY) x = simplify_gen_unary (outer_op, result_mode, x, result_mode); else - x = gen_binary (outer_op, result_mode, x, GEN_INT (outer_const)); + x = simplify_gen_binary (outer_op, result_mode, x, + GEN_INT (outer_const)); } return x; } + +/* Simplify a shift of VAROP by COUNT bits. CODE says what kind of shift. + The result of the shift is RESULT_MODE. If we cannot simplify it, + return X or, if it is NULL, synthesize the expression with + simplify_gen_binary. Otherwise, return a simplified value. + + The shift is normally computed in the widest mode we find in VAROP, as + long as it isn't a different number of words than RESULT_MODE. Exceptions + are ASHIFTRT and ROTATE, which are always done in their original mode. */ + +static rtx +simplify_shift_const (rtx x, enum rtx_code code, enum machine_mode result_mode, + rtx varop, int count) +{ + rtx tem = simplify_shift_const_1 (code, result_mode, varop, count); + if (tem) + return tem; + + if (!x) + x = simplify_gen_binary (code, GET_MODE (varop), varop, GEN_INT (count)); + if (GET_MODE (x) != result_mode) + x = gen_lowpart (result_mode, x); + return x; +} + /* Like recog, but we receive the address of a pointer to a new pattern. We try to match the rtx that the pointer points to. @@ -9957,7 +9377,7 @@ recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes) for (i = XVECLEN (newpat, 0) - num_clobbers_to_add; i < XVECLEN (newpat, 0); i++) { - if (GET_CODE (XEXP (XVECEXP (newpat, 0, i), 0)) == REG + if (REG_P (XEXP (XVECEXP (newpat, 0, i), 0)) && ! reg_dead_at_p (XEXP (XVECEXP (newpat, 0, i), 0), insn)) return -1; notes = gen_rtx_EXPR_LIST (REG_UNUSED, @@ -9972,28 +9392,29 @@ recog_for_combine (rtx *pnewpat, rtx insn, rtx *pnotes) return insn_code_number; } -/* Like gen_lowpart but for use by combine. In combine it is not possible - to create any new pseudoregs. However, it is safe to create - invalid memory addresses, because combine will try to recognize - them and all they will do is make the combine attempt fail. +/* Like gen_lowpart_general but for use by combine. In combine it + is not possible to create any new pseudoregs. However, it is + safe to create invalid memory addresses, because combine will + try to recognize them and all they will do is make the combine + attempt fail. If for some reason this cannot do its job, an rtx (clobber (const_int 0)) is returned. An insn containing that will not be recognized. */ -#undef gen_lowpart - static rtx -gen_lowpart_for_combine (enum machine_mode mode, rtx x) +gen_lowpart_for_combine (enum machine_mode omode, rtx x) { + enum machine_mode imode = GET_MODE (x); + unsigned int osize = GET_MODE_SIZE (omode); + unsigned int isize = GET_MODE_SIZE (imode); rtx result; - if (GET_MODE (x) == mode) + if (omode == imode) return x; - /* Return identity if this is a CONST or symbolic - reference. */ - if (mode == Pmode + /* Return identity if this is a CONST or symbolic reference. */ + if (omode == Pmode && (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)) @@ -10001,25 +9422,33 @@ gen_lowpart_for_combine (enum machine_mode mode, rtx x) /* We can only support MODE being wider than a word if X is a constant integer or has a mode the same size. */ - - if (GET_MODE_SIZE (mode) > UNITS_PER_WORD - && ! ((GET_MODE (x) == VOIDmode + if (GET_MODE_SIZE (omode) > UNITS_PER_WORD + && ! ((imode == VOIDmode && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)) - || GET_MODE_SIZE (GET_MODE (x)) == GET_MODE_SIZE (mode))) - return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); + || isize == osize)) + goto fail; /* X might be a paradoxical (subreg (mem)). In that case, gen_lowpart won't know what to do. So we will strip off the SUBREG here and process normally. */ - if (GET_CODE (x) == SUBREG && GET_CODE (SUBREG_REG (x)) == MEM) + if (GET_CODE (x) == SUBREG && MEM_P (SUBREG_REG (x))) { x = SUBREG_REG (x); - if (GET_MODE (x) == mode) + + /* For use in case we fall down into the address adjustments + further below, we need to adjust the known mode and size of + x; imode and isize, since we just adjusted x. */ + imode = GET_MODE (x); + + if (imode == omode) return x; + + isize = GET_MODE_SIZE (imode); } - result = gen_lowpart_common (mode, x); + result = gen_lowpart_common (omode, x); + #ifdef CANNOT_CHANGE_MODE_CLASS if (result != 0 && GET_CODE (result) == SUBREG) record_subregs_of_mode (result); @@ -10028,40 +9457,36 @@ gen_lowpart_for_combine (enum machine_mode mode, rtx x) if (result) return result; - if (GET_CODE (x) == MEM) + if (MEM_P (x)) { int offset = 0; /* Refuse to work on a volatile memory ref or one with a mode-dependent address. */ if (MEM_VOLATILE_P (x) || mode_dependent_address_p (XEXP (x, 0))) - return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); + goto fail; /* If we want to refer to something bigger than the original memref, - generate a perverse subreg instead. That will force a reload + generate a paradoxical subreg instead. That will force a reload of the original memref X. */ - if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (mode)) - return gen_rtx_SUBREG (mode, x, 0); + if (isize < osize) + return gen_rtx_SUBREG (omode, x, 0); if (WORDS_BIG_ENDIAN) - offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD) - - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)); + offset = MAX (isize, UNITS_PER_WORD) - MAX (osize, UNITS_PER_WORD); + /* Adjust the address so that the address-after-the-data is + unchanged. */ if (BYTES_BIG_ENDIAN) - { - /* Adjust the address so that the address-after-the-data is - unchanged. */ - offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode)) - - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x)))); - } + offset -= MIN (UNITS_PER_WORD, osize) - MIN (UNITS_PER_WORD, isize); - return adjust_address_nv (x, mode, offset); + return adjust_address_nv (x, omode, offset); } /* If X is a comparison operator, rewrite it in a new mode. This probably won't match, but may allow further simplifications. */ - else if (GET_RTX_CLASS (GET_CODE (x)) == '<') - return gen_rtx_fmt_ee (GET_CODE (x), mode, XEXP (x, 0), XEXP (x, 1)); + else if (COMPARISON_P (x)) + return gen_rtx_fmt_ee (GET_CODE (x), omode, XEXP (x, 0), XEXP (x, 1)); /* If we couldn't simplify X any other way, just enclose it in a SUBREG. Normally, this SUBREG won't match, but some patterns may @@ -10070,77 +9495,22 @@ gen_lowpart_for_combine (enum machine_mode mode, rtx x) { int offset = 0; rtx res; - enum machine_mode sub_mode = GET_MODE (x); - offset = subreg_lowpart_offset (mode, sub_mode); - if (sub_mode == VOIDmode) + offset = subreg_lowpart_offset (omode, imode); + if (imode == VOIDmode) { - sub_mode = int_mode_for_mode (mode); - x = gen_lowpart_common (sub_mode, x); - if (x == 0) - return gen_rtx_CLOBBER (VOIDmode, const0_rtx); + imode = int_mode_for_mode (omode); + x = gen_lowpart_common (imode, x); + if (x == NULL) + goto fail; } - res = simplify_gen_subreg (mode, x, sub_mode, offset); + res = simplify_gen_subreg (omode, x, imode, offset); if (res) return res; - return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); } -} - -/* These routines make binary and unary operations by first seeing if they - fold; if not, a new expression is allocated. */ -static rtx -gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0, rtx op1) -{ - rtx result; - rtx tem; - - if (GET_CODE (op0) == CLOBBER) - return op0; - else if (GET_CODE (op1) == CLOBBER) - return op1; - - if (GET_RTX_CLASS (code) == 'c' - && swap_commutative_operands_p (op0, op1)) - tem = op0, op0 = op1, op1 = tem; - - if (GET_RTX_CLASS (code) == '<') - { - enum machine_mode op_mode = GET_MODE (op0); - - /* Strip the COMPARE from (REL_OP (compare X Y) 0) to get - just (REL_OP X Y). */ - if (GET_CODE (op0) == COMPARE && op1 == const0_rtx) - { - op1 = XEXP (op0, 1); - op0 = XEXP (op0, 0); - op_mode = GET_MODE (op0); - } - - if (op_mode == VOIDmode) - op_mode = GET_MODE (op1); - result = simplify_relational_operation (code, op_mode, op0, op1); - } - else - result = simplify_binary_operation (code, mode, op0, op1); - - if (result) - return result; - - /* Put complex operands first and constants second. */ - if (GET_RTX_CLASS (code) == 'c' - && swap_commutative_operands_p (op0, op1)) - return gen_rtx_fmt_ee (code, mode, op1, op0); - - /* If we are turning off bits already known off in OP0, we need not do - an AND. */ - else if (code == AND && GET_CODE (op1) == CONST_INT - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) & ~INTVAL (op1)) == 0) - return op0; - - return gen_rtx_fmt_ee (code, mode, op0, op1); + fail: + return gen_rtx_CLOBBER (imode, const0_rtx); } /* Simplify a comparison between *POP0 and *POP1 where CODE is the @@ -10275,8 +9645,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) tmode != GET_MODE (op0); tmode = GET_MODE_WIDER_MODE (tmode)) if ((unsigned HOST_WIDE_INT) c0 == GET_MODE_MASK (tmode)) { - op0 = gen_lowpart_for_combine (tmode, inner_op0); - op1 = gen_lowpart_for_combine (tmode, inner_op1); + op0 = gen_lowpart (tmode, inner_op0); + op1 = gen_lowpart (tmode, inner_op1); code = unsigned_condition (code); changed = 1; break; @@ -10329,8 +9699,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) if (GET_MODE_CLASS (mode) != MODE_INT && ! (mode == VOIDmode - && (GET_CODE (op0) == COMPARE - || GET_RTX_CLASS (GET_CODE (op0)) == '<'))) + && (GET_CODE (op0) == COMPARE || COMPARISON_P (op0)))) break; /* Get the constant we are comparing against and turn off all bits @@ -10469,7 +9838,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) break; case GEU: - /* >= C is equivalent to < (C - 1). */ + /* >= C is equivalent to > (C - 1). */ if (const_op > 1) { const_op -= 1; @@ -10521,7 +9890,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) op0 = force_to_mode (op0, mode, ((HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)), - NULL_RTX, 0); + 0); /* Now try cases based on the opcode of OP0. If none of the cases does a "continue", we exit this loop immediately after the @@ -10672,16 +10041,22 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) break; case SIGN_EXTEND: - /* Can simplify (compare (zero/sign_extend FOO) CONST) - to (compare FOO CONST) if CONST fits in FOO's mode and we - are either testing inequality or have an unsigned comparison - with ZERO_EXTEND or a signed comparison with SIGN_EXTEND. */ - if (! unsigned_comparison_p - && (GET_MODE_BITSIZE (GET_MODE (XEXP (op0, 0))) - <= HOST_BITS_PER_WIDE_INT) + /* Can simplify (compare (zero/sign_extend FOO) CONST) to + (compare FOO CONST) if CONST fits in FOO's mode and we + are either testing inequality or have an unsigned + comparison with ZERO_EXTEND or a signed comparison with + SIGN_EXTEND. But don't do it if we don't have a compare + insn of the given mode, since we'd have to revert it + later on, and then we wouldn't know whether to sign- or + zero-extend. */ + mode = GET_MODE (XEXP (op0, 0)); + if (mode != VOIDmode && GET_MODE_CLASS (mode) == MODE_INT + && ! unsigned_comparison_p + && (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) && ((unsigned HOST_WIDE_INT) const_op < (((unsigned HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (XEXP (op0, 0))) - 1))))) + << (GET_MODE_BITSIZE (mode) - 1)))) + && cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) { op0 = XEXP (op0, 0); continue; @@ -10720,7 +10095,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) HOST_WIDE_INT c1 = -INTVAL (XEXP (SUBREG_REG (op0), 1)); if ((c1 > 0 - && (unsigned HOST_WIDE_INT) c1 + && (unsigned HOST_WIDE_INT) c1 < (unsigned HOST_WIDE_INT) 1 << (mode_width - 1) && (equality_comparison_p || unsigned_comparison_p) /* (A - C1) zero-extends if it is positive and sign-extends @@ -10743,7 +10118,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) { op0 = SUBREG_REG (op0); continue; - } + } } /* If the inner mode is narrower and we are extracting the low part, @@ -10757,11 +10132,12 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) /* ... fall through ... */ case ZERO_EXTEND: - if ((unsigned_comparison_p || equality_comparison_p) - && (GET_MODE_BITSIZE (GET_MODE (XEXP (op0, 0))) - <= HOST_BITS_PER_WIDE_INT) - && ((unsigned HOST_WIDE_INT) const_op - < GET_MODE_MASK (GET_MODE (XEXP (op0, 0))))) + mode = GET_MODE (XEXP (op0, 0)); + if (mode != VOIDmode && GET_MODE_CLASS (mode) == MODE_INT + && (unsigned_comparison_p || equality_comparison_p) + && (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) + && ((unsigned HOST_WIDE_INT) const_op < GET_MODE_MASK (mode)) + && cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) { op0 = XEXP (op0, 0); continue; @@ -10850,7 +10226,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) case UNEQ: case LTGT: case LT: case LTU: case UNLT: case LE: case LEU: case UNLE: case GT: case GTU: case UNGT: case GE: case GEU: case UNGE: - case UNORDERED: case ORDERED: + case UNORDERED: case ORDERED: /* We can't do anything if OP0 is a condition code value, rather than an actual data value. */ if (const_op != 0 @@ -10878,7 +10254,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) if (code == LT || code == NE) new_code = GET_CODE (op0); else - new_code = combine_reversed_comparison_code (op0); + new_code = reversed_comparison_code (op0, NULL); if (new_code != UNKNOWN) { @@ -10911,9 +10287,9 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) && XEXP (XEXP (op0, 0), 0) == const1_rtx) { op0 = simplify_and_const_int - (op0, mode, gen_rtx_LSHIFTRT (mode, - XEXP (op0, 1), - XEXP (XEXP (op0, 0), 1)), + (NULL_RTX, mode, gen_rtx_LSHIFTRT (mode, + XEXP (op0, 1), + XEXP (XEXP (op0, 0), 1)), (HOST_WIDE_INT) 1); continue; } @@ -10932,9 +10308,9 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) mask = ((INTVAL (XEXP (op0, 1)) & GET_MODE_MASK (mode)) << INTVAL (XEXP (XEXP (op0, 0), 1))); if ((~STORE_FLAG_VALUE & mask) == 0 - && (GET_RTX_CLASS (GET_CODE (XEXP (XEXP (op0, 0), 0))) == '<' + && (COMPARISON_P (XEXP (XEXP (op0, 0), 0)) || ((tem = get_last_value (XEXP (XEXP (op0, 0), 0))) != 0 - && GET_RTX_CLASS (GET_CODE (tem)) == '<'))) + && COMPARISON_P (tem)))) { op0 = XEXP (XEXP (op0, 0), 0); continue; @@ -10959,16 +10335,29 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) /* If this AND operation is really a ZERO_EXTEND from a narrower mode, the constant fits within that mode, and this is either an equality or unsigned comparison, try to do this comparison in - the narrower mode. */ + the narrower mode. + + Note that in: + + (ne:DI (and:DI (reg:DI 4) (const_int 0xffffffff)) (const_int 0)) + -> (ne:DI (reg:SI 4) (const_int 0)) + + unless TRULY_NOOP_TRUNCATION allows it or the register is + known to hold a value of the required mode the + transformation is invalid. */ if ((equality_comparison_p || unsigned_comparison_p) && GET_CODE (XEXP (op0, 1)) == CONST_INT && (i = exact_log2 ((INTVAL (XEXP (op0, 1)) & GET_MODE_MASK (mode)) + 1)) >= 0 && const_op >> i == 0 - && (tmode = mode_for_size (i, MODE_INT, 1)) != BLKmode) + && (tmode = mode_for_size (i, MODE_INT, 1)) != BLKmode + && (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (tmode), + GET_MODE_BITSIZE (GET_MODE (op0))) + || (REG_P (XEXP (op0, 0)) + && reg_truncated_to_mode (tmode, XEXP (op0, 0))))) { - op0 = gen_lowpart_for_combine (tmode, XEXP (op0, 0)); + op0 = gen_lowpart (tmode, XEXP (op0, 0)); continue; } @@ -11005,10 +10394,10 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) && c1 != mask && c1 != GET_MODE_MASK (tmode)) { - op0 = gen_binary (AND, tmode, - SUBREG_REG (XEXP (op0, 0)), - gen_int_mode (c1, tmode)); - op0 = gen_lowpart_for_combine (mode, op0); + op0 = simplify_gen_binary (AND, tmode, + SUBREG_REG (XEXP (op0, 0)), + gen_int_mode (c1, tmode)); + op0 = gen_lowpart (mode, op0); continue; } } @@ -11130,7 +10519,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) + (GET_MODE_MASK (tmode) >> 1) + 1) <= GET_MODE_MASK (tmode))) { - op0 = gen_lowpart_for_combine (tmode, XEXP (XEXP (op0, 0), 0)); + op0 = gen_lowpart (tmode, XEXP (XEXP (op0, 0), 0)); continue; } @@ -11151,12 +10540,12 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) { rtx inner = XEXP (XEXP (XEXP (op0, 0), 0), 0); rtx add_const = XEXP (XEXP (op0, 0), 1); - rtx new_const = gen_binary (ASHIFTRT, GET_MODE (op0), add_const, - XEXP (op0, 1)); + rtx new_const = simplify_gen_binary (ASHIFTRT, GET_MODE (op0), + add_const, XEXP (op0, 1)); - op0 = gen_binary (PLUS, tmode, - gen_lowpart_for_combine (tmode, inner), - new_const); + op0 = simplify_gen_binary (PLUS, tmode, + gen_lowpart (tmode, inner), + new_const); continue; } @@ -11227,7 +10616,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) those bits. 3. SUBREG_REG (op0) is a memory and LOAD_EXTEND_OP is defined and not - NIL. In that case we know those bits are zeros or ones. We must + UNKNOWN. In that case we know those bits are zeros or ones. We must also be sure that they are the same as the upper bits of op1. We can never remove a SUBREG for a non-equality comparison because @@ -11246,10 +10635,10 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) { /* For paradoxical subregs, allow case 1 as above. Case 3 isn't implemented. */ - if (GET_CODE (SUBREG_REG (op0)) == REG) + if (REG_P (SUBREG_REG (op0))) { op0 = SUBREG_REG (op0); - op1 = gen_lowpart_for_combine (GET_MODE (op0), op1); + op1 = gen_lowpart (GET_MODE (op0), op1); } } else if ((GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0))) @@ -11258,7 +10647,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) GET_MODE (SUBREG_REG (op0))) & ~GET_MODE_MASK (GET_MODE (op0))) == 0) { - tem = gen_lowpart_for_combine (GET_MODE (SUBREG_REG (op0)), op1); + tem = gen_lowpart (GET_MODE (SUBREG_REG (op0)), op1); if ((nonzero_bits (tem, GET_MODE (SUBREG_REG (op0))) & ~GET_MODE_MASK (GET_MODE (op0))) == 0) @@ -11309,16 +10698,16 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) make a new AND in the proper mode. */ if (GET_CODE (op0) == AND && !have_insn_for (AND, mode)) - op0 = gen_binary (AND, tmode, - gen_lowpart_for_combine (tmode, - XEXP (op0, 0)), - gen_lowpart_for_combine (tmode, - XEXP (op0, 1))); + op0 = simplify_gen_binary (AND, tmode, + gen_lowpart (tmode, + XEXP (op0, 0)), + gen_lowpart (tmode, + XEXP (op0, 1))); - op0 = gen_lowpart_for_combine (tmode, op0); + op0 = gen_lowpart (tmode, op0); if (zero_extended && GET_CODE (op1) == CONST_INT) op1 = GEN_INT (INTVAL (op1) & GET_MODE_MASK (mode)); - op1 = gen_lowpart_for_combine (tmode, op1); + op1 = gen_lowpart (tmode, op1); break; } @@ -11328,10 +10717,11 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) if (op1 == const0_rtx && (code == LT || code == GE) && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) { - op0 = gen_binary (AND, tmode, - gen_lowpart_for_combine (tmode, op0), - GEN_INT ((HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (mode) - 1))); + op0 = simplify_gen_binary (AND, tmode, + gen_lowpart (tmode, op0), + GEN_INT ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (mode) + - 1))); code = (code == LT) ? NE : EQ; break; } @@ -11349,38 +10739,6 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) return code; } -/* Like jump.c' reversed_comparison_code, but use combine infrastructure for - searching backward. */ -static enum rtx_code -combine_reversed_comparison_code (rtx exp) -{ - enum rtx_code code1 = reversed_comparison_code (exp, NULL); - rtx x; - - if (code1 != UNKNOWN - || GET_MODE_CLASS (GET_MODE (XEXP (exp, 0))) != MODE_CC) - return code1; - /* Otherwise try and find where the condition codes were last set and - use that. */ - x = get_last_value (XEXP (exp, 0)); - if (!x || GET_CODE (x) != COMPARE) - return UNKNOWN; - return reversed_comparison_code_parts (GET_CODE (exp), - XEXP (x, 0), XEXP (x, 1), NULL); -} - -/* Return comparison with reversed code of EXP and operands OP0 and OP1. - Return NULL_RTX in case we fail to do the reversal. */ -static rtx -reversed_comparison (rtx exp, enum machine_mode mode, rtx op0, rtx op1) -{ - enum rtx_code reversed_code = combine_reversed_comparison_code (exp); - if (reversed_code == UNKNOWN) - return NULL_RTX; - else - return gen_binary (reversed_code, mode, op0, op1); -} - /* Utility function for record_value_for_reg. Count number of rtxs in X. */ static int @@ -11423,7 +10781,7 @@ count_rtxs (rtx x) } /* Utility function for following routine. Called when X is part of a value - being stored into reg_last_set_value. Sets reg_last_set_table_tick + being stored into last_set_value. Sets last_set_table_tick for each register mentioned. Similar to mention_regs in cse.c */ static void @@ -11438,11 +10796,11 @@ update_table_tick (rtx x) unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); unsigned int r; for (r = regno; r < endregno; r++) - reg_last_set_table_tick[r] = label_tick; + reg_stat[r].last_set_table_tick = label_tick; return; } @@ -11455,9 +10813,7 @@ update_table_tick (rtx x) /* Check for identical subexpressions. If x contains identical subexpression we only have to traverse one of them. */ - if (i == 0 - && (GET_RTX_CLASS (code) == '2' - || GET_RTX_CLASS (code) == 'c')) + if (i == 0 && ARITHMETIC_P (x)) { /* Note that at this point x1 has already been processed. */ @@ -11472,15 +10828,13 @@ update_table_tick (rtx x) /* If x0 is identical to a subexpression of x1 then while processing x1, x0 has already been processed. Thus we are done with x. */ - if ((GET_RTX_CLASS (GET_CODE (x1)) == '2' - || GET_RTX_CLASS (GET_CODE (x1)) == 'c') + if (ARITHMETIC_P (x1) && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1))) break; /* If x1 is identical to a subexpression of x0 then we still have to process the rest of x0. */ - if ((GET_RTX_CLASS (GET_CODE (x0)) == '2' - || GET_RTX_CLASS (GET_CODE (x0)) == 'c') + if (ARITHMETIC_P (x0) && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1))) { update_table_tick (XEXP (x0, x1 == XEXP (x0, 0) ? 1 : 0)); @@ -11494,8 +10848,9 @@ update_table_tick (rtx x) /* Record that REG is set to VALUE in insn INSN. If VALUE is zero, we are saying that the register is clobbered and we no longer know its - value. If INSN is zero, don't update reg_last_set; this is only permitted - with VALUE also zero and is used to invalidate the register. */ + value. If INSN is zero, don't update reg_stat[].last_set; this is + only permitted with VALUE also zero and is used to invalidate the + register. */ static void record_value_for_reg (rtx reg, rtx insn, rtx value) @@ -11503,7 +10858,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value) unsigned int regno = REGNO (reg); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (reg)) : 1); + ? hard_regno_nregs[regno][GET_MODE (reg)] : 1); unsigned int i; /* If VALUE contains REG and we have a previous value for REG, substitute @@ -11523,8 +10878,7 @@ record_value_for_reg (rtx reg, rtx insn, rtx value) if (tem) { - if ((GET_RTX_CLASS (GET_CODE (tem)) == '2' - || GET_RTX_CLASS (GET_CODE (tem)) == 'c') + if (ARITHMETIC_P (tem) && GET_CODE (XEXP (tem, 0)) == CLOBBER && GET_CODE (XEXP (tem, 1)) == CLOBBER) tem = XEXP (tem, 0); @@ -11547,13 +10901,14 @@ record_value_for_reg (rtx reg, rtx insn, rtx value) for (i = regno; i < endregno; i++) { if (insn) - reg_last_set[i] = insn; + reg_stat[i].last_set = insn; - reg_last_set_value[i] = 0; - reg_last_set_mode[i] = 0; - reg_last_set_nonzero_bits[i] = 0; - reg_last_set_sign_bit_copies[i] = 0; - reg_last_death[i] = 0; + reg_stat[i].last_set_value = 0; + reg_stat[i].last_set_mode = 0; + reg_stat[i].last_set_nonzero_bits = 0; + reg_stat[i].last_set_sign_bit_copies = 0; + reg_stat[i].last_death = 0; + reg_stat[i].truncated_to_mode = 0; } /* Mark registers that are being referenced in this value. */ @@ -11569,40 +10924,40 @@ record_value_for_reg (rtx reg, rtx insn, rtx value) for (i = regno; i < endregno; i++) { - reg_last_set_label[i] = label_tick; - if (value && reg_last_set_table_tick[i] == label_tick) - reg_last_set_invalid[i] = 1; + reg_stat[i].last_set_label = label_tick; + if (!insn || (value && reg_stat[i].last_set_table_tick == label_tick)) + reg_stat[i].last_set_invalid = 1; else - reg_last_set_invalid[i] = 0; + reg_stat[i].last_set_invalid = 0; } /* The value being assigned might refer to X (like in "x++;"). In that case, we must replace it with (clobber (const_int 0)) to prevent infinite loops. */ if (value && ! get_last_value_validate (&value, insn, - reg_last_set_label[regno], 0)) + reg_stat[regno].last_set_label, 0)) { value = copy_rtx (value); if (! get_last_value_validate (&value, insn, - reg_last_set_label[regno], 1)) + reg_stat[regno].last_set_label, 1)) value = 0; } /* For the main register being modified, update the value, the mode, the nonzero bits, and the number of sign bit copies. */ - reg_last_set_value[regno] = value; + reg_stat[regno].last_set_value = value; if (value) { enum machine_mode mode = GET_MODE (reg); subst_low_cuid = INSN_CUID (insn); - reg_last_set_mode[regno] = mode; + reg_stat[regno].last_set_mode = mode; if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) mode = nonzero_bits_mode; - reg_last_set_nonzero_bits[regno] = nonzero_bits (value, mode); - reg_last_set_sign_bit_copies[regno] + reg_stat[regno].last_set_nonzero_bits = nonzero_bits (value, mode); + reg_stat[regno].last_set_sign_bit_copies = num_sign_bit_copies (value, GET_MODE (reg)); } } @@ -11619,7 +10974,14 @@ record_dead_and_set_regs_1 (rtx dest, rtx setter, void *data) if (GET_CODE (dest) == SUBREG) dest = SUBREG_REG (dest); - if (GET_CODE (dest) == REG) + if (!record_dead_insn) + { + if (REG_P (dest)) + record_value_for_reg (dest, NULL_RTX, NULL_RTX); + return; + } + + if (REG_P (dest)) { /* If we are setting the whole register, we know its value. Otherwise show that we don't know the value. We can handle SUBREG in @@ -11632,12 +10994,12 @@ record_dead_and_set_regs_1 (rtx dest, rtx setter, void *data) && GET_MODE_BITSIZE (GET_MODE (dest)) <= BITS_PER_WORD && subreg_lowpart_p (SET_DEST (setter))) record_value_for_reg (dest, record_dead_insn, - gen_lowpart_for_combine (GET_MODE (dest), + gen_lowpart (GET_MODE (dest), SET_SRC (setter))); else record_value_for_reg (dest, record_dead_insn, NULL_RTX); } - else if (GET_CODE (dest) == MEM + else if (MEM_P (dest) /* Ignore pushes, they clobber nothing. */ && ! push_operand (dest, GET_MODE (dest))) mem_last_set = INSN_CUID (record_dead_insn); @@ -11647,11 +11009,11 @@ record_dead_and_set_regs_1 (rtx dest, rtx setter, void *data) for the things done by INSN. This is the last thing done in processing INSN in the combiner loop. - We update reg_last_set, reg_last_set_value, reg_last_set_mode, - reg_last_set_nonzero_bits, reg_last_set_sign_bit_copies, reg_last_death, - and also the similar information mem_last_set (which insn most recently - modified memory) and last_call_cuid (which insn was the most recent - subroutine call). */ + We update reg_stat[], in particular fields last_set, last_set_value, + last_set_mode, last_set_nonzero_bits, last_set_sign_bit_copies, + last_death, and also the similar information mem_last_set (which insn + most recently modified memory) and last_call_cuid (which insn was the + most recent subroutine call). */ static void record_dead_and_set_regs (rtx insn) @@ -11662,44 +11024,44 @@ record_dead_and_set_regs (rtx insn) for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) { if (REG_NOTE_KIND (link) == REG_DEAD - && GET_CODE (XEXP (link, 0)) == REG) + && REG_P (XEXP (link, 0))) { unsigned int regno = REGNO (XEXP (link, 0)); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (XEXP (link, 0))) + ? hard_regno_nregs[regno][GET_MODE (XEXP (link, 0))] : 1); for (i = regno; i < endregno; i++) - reg_last_death[i] = insn; + reg_stat[i].last_death = insn; } else if (REG_NOTE_KIND (link) == REG_INC) record_value_for_reg (XEXP (link, 0), insn, NULL_RTX); } - if (GET_CODE (insn) == CALL_INSN) + if (CALL_P (insn)) { for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) { - reg_last_set_value[i] = 0; - reg_last_set_mode[i] = 0; - reg_last_set_nonzero_bits[i] = 0; - reg_last_set_sign_bit_copies[i] = 0; - reg_last_death[i] = 0; + reg_stat[i].last_set_value = 0; + reg_stat[i].last_set_mode = 0; + reg_stat[i].last_set_nonzero_bits = 0; + reg_stat[i].last_set_sign_bit_copies = 0; + reg_stat[i].last_death = 0; + reg_stat[i].truncated_to_mode = 0; } last_call_cuid = mem_last_set = INSN_CUID (insn); - /* Don't bother recording what this insn does. It might set the - return value register, but we can't combine into a call - pattern anyway, so there's no point trying (and it may cause - a crash, if e.g. we wind up asking for last_set_value of a - SUBREG of the return value register). */ - return; + /* We can't combine into a call pattern. Remember, though, that + the return value register is set at this CUID. We could + still replace a register with the return value from the + wrong subroutine call! */ + note_stores (PATTERN (insn), record_dead_and_set_regs_1, NULL_RTX); } - - note_stores (PATTERN (insn), record_dead_and_set_regs_1, insn); + else + note_stores (PATTERN (insn), record_dead_and_set_regs_1, insn); } /* If a SUBREG has the promoted bit set, it is in fact a property of the @@ -11726,7 +11088,7 @@ record_promoted_value (rtx insn, rtx subreg) insn = XEXP (links, 0); set = single_set (insn); - if (! set || GET_CODE (SET_DEST (set)) != REG + if (! set || !REG_P (SET_DEST (set)) || REGNO (SET_DEST (set)) != regno || GET_MODE (SET_DEST (set)) != GET_MODE (SUBREG_REG (subreg))) { @@ -11734,13 +11096,13 @@ record_promoted_value (rtx insn, rtx subreg) continue; } - if (reg_last_set[regno] == insn) + if (reg_stat[regno].last_set == insn) { if (SUBREG_PROMOTED_UNSIGNED_P (subreg) > 0) - reg_last_set_nonzero_bits[regno] &= GET_MODE_MASK (mode); + reg_stat[regno].last_set_nonzero_bits &= GET_MODE_MASK (mode); } - if (GET_CODE (SET_SRC (set)) == REG) + if (REG_P (SET_SRC (set))) { regno = REGNO (SET_SRC (set)); links = LOG_LINKS (insn); @@ -11750,15 +11112,81 @@ record_promoted_value (rtx insn, rtx subreg) } } -/* Scan X for promoted SUBREGs. For each one found, - note what it implies to the registers used in it. */ +/* Check if X, a register, is known to contain a value already + truncated to MODE. In this case we can use a subreg to refer to + the truncated value even though in the generic case we would need + an explicit truncation. */ + +static bool +reg_truncated_to_mode (enum machine_mode mode, rtx x) +{ + enum machine_mode truncated = reg_stat[REGNO (x)].truncated_to_mode; + + if (truncated == 0 || reg_stat[REGNO (x)].truncation_label != label_tick) + return false; + if (GET_MODE_SIZE (truncated) <= GET_MODE_SIZE (mode)) + return true; + if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), + GET_MODE_BITSIZE (truncated))) + return true; + return false; +} + +/* X is a REG or a SUBREG. If X is some sort of a truncation record + it. For non-TRULY_NOOP_TRUNCATION targets we might be able to turn + a truncate into a subreg using this information. */ static void -check_promoted_subreg (rtx insn, rtx x) +record_truncated_value (rtx x) { - if (GET_CODE (x) == SUBREG && SUBREG_PROMOTED_VAR_P (x) - && GET_CODE (SUBREG_REG (x)) == REG) - record_promoted_value (insn, x); + enum machine_mode truncated_mode; + + if (GET_CODE (x) == SUBREG && REG_P (SUBREG_REG (x))) + { + enum machine_mode original_mode = GET_MODE (SUBREG_REG (x)); + truncated_mode = GET_MODE (x); + + if (GET_MODE_SIZE (original_mode) <= GET_MODE_SIZE (truncated_mode)) + return; + + if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (truncated_mode), + GET_MODE_BITSIZE (original_mode))) + return; + + x = SUBREG_REG (x); + } + /* ??? For hard-regs we now record everything. We might be able to + optimize this using last_set_mode. */ + else if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER) + truncated_mode = GET_MODE (x); + else + return; + + if (reg_stat[REGNO (x)].truncated_to_mode == 0 + || reg_stat[REGNO (x)].truncation_label < label_tick + || (GET_MODE_SIZE (truncated_mode) + < GET_MODE_SIZE (reg_stat[REGNO (x)].truncated_to_mode))) + { + reg_stat[REGNO (x)].truncated_to_mode = truncated_mode; + reg_stat[REGNO (x)].truncation_label = label_tick; + } +} + +/* Scan X for promoted SUBREGs and truncated REGs. For each one + found, note what it implies to the registers used in it. */ + +static void +check_conversions (rtx insn, rtx x) +{ + if (GET_CODE (x) == SUBREG || REG_P (x)) + { + if (GET_CODE (x) == SUBREG + && SUBREG_PROMOTED_VAR_P (x) + && REG_P (SUBREG_REG (x))) + record_promoted_value (insn, x); + + record_truncated_value (x); + } else { const char *format = GET_RTX_FORMAT (GET_CODE (x)); @@ -11768,13 +11196,13 @@ check_promoted_subreg (rtx insn, rtx x) switch (format[i]) { case 'e': - check_promoted_subreg (insn, XEXP (x, i)); + check_conversions (insn, XEXP (x, i)); break; case 'V': case 'E': if (XVEC (x, i) != 0) for (j = 0; j < XVECLEN (x, i); j++) - check_promoted_subreg (insn, XVECEXP (x, i, j)); + check_conversions (insn, XVECEXP (x, i, j)); break; } } @@ -11798,23 +11226,24 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace) int len = GET_RTX_LENGTH (GET_CODE (x)); int i; - if (GET_CODE (x) == REG) + if (REG_P (x)) { unsigned int regno = REGNO (x); unsigned int endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); unsigned int j; for (j = regno; j < endregno; j++) - if (reg_last_set_invalid[j] + if (reg_stat[j].last_set_invalid /* If this is a pseudo-register that was only set once and not live at the beginning of the function, it is always valid. */ || (! (regno >= FIRST_PSEUDO_REGISTER && REG_N_SETS (regno) == 1 && (! REGNO_REG_SET_P - (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno))) - && reg_last_set_label[j] > tick)) + (ENTRY_BLOCK_PTR->next_bb->il.rtl->global_live_at_start, + regno))) + && reg_stat[j].last_set_label > tick)) { if (replace) *loc = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); @@ -11826,7 +11255,7 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace) /* If this is a memory reference, make sure that there were no stores after it that might have clobbered the value. We don't have alias info, so we assume any store invalidates it. */ - else if (GET_CODE (x) == MEM && ! RTX_UNCHANGING_P (x) + else if (MEM_P (x) && !MEM_READONLY_P (x) && INSN_CUID (insn) <= mem_last_set) { if (replace) @@ -11841,9 +11270,7 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace) /* Check for identical subexpressions. If x contains identical subexpression we only have to traverse one of them. */ - if (i == 1 - && (GET_RTX_CLASS (GET_CODE (x)) == '2' - || GET_RTX_CLASS (GET_CODE (x)) == 'c')) + if (i == 1 && ARITHMETIC_P (x)) { /* Note that at this point x0 has already been checked and found valid. */ @@ -11857,15 +11284,13 @@ get_last_value_validate (rtx *loc, rtx insn, int tick, int replace) /* If x1 is identical to a subexpression of x0 then while checking x0, x1 has already been checked. Thus it is valid and so as x. */ - if ((GET_RTX_CLASS (GET_CODE (x0)) == '2' - || GET_RTX_CLASS (GET_CODE (x0)) == 'c') + if (ARITHMETIC_P (x0) && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1))) return 1; /* If x0 is identical to a subexpression of x1 then x is valid iff the rest of x1 is valid. */ - if ((GET_RTX_CLASS (GET_CODE (x1)) == '2' - || GET_RTX_CLASS (GET_CODE (x1)) == 'c') + if (ARITHMETIC_P (x1) && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1))) return get_last_value_validate (&XEXP (x1, @@ -11904,13 +11329,13 @@ get_last_value (rtx x) && (GET_MODE_SIZE (GET_MODE (x)) <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) && (value = get_last_value (SUBREG_REG (x))) != 0) - return gen_lowpart_for_combine (GET_MODE (x), value); + return gen_lowpart (GET_MODE (x), value); - if (GET_CODE (x) != REG) + if (!REG_P (x)) return 0; regno = REGNO (x); - value = reg_last_set_value[regno]; + value = reg_stat[regno].last_set_value; /* If we don't have a value, or if it isn't for this basic block and it's either a hard register, set more than once, or it's a live @@ -11923,29 +11348,30 @@ get_last_value (rtx x) block. */ if (value == 0 - || (reg_last_set_label[regno] != label_tick + || (reg_stat[regno].last_set_label != label_tick && (regno < FIRST_PSEUDO_REGISTER || REG_N_SETS (regno) != 1 || (REGNO_REG_SET_P - (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno))))) + (ENTRY_BLOCK_PTR->next_bb->il.rtl->global_live_at_start, + regno))))) return 0; /* If the value was set in a later insn than the ones we are processing, we can't use it even if the register was only set once. */ - if (INSN_CUID (reg_last_set[regno]) >= subst_low_cuid) + if (INSN_CUID (reg_stat[regno].last_set) >= subst_low_cuid) return 0; /* If the value has all its registers valid, return it. */ - if (get_last_value_validate (&value, reg_last_set[regno], - reg_last_set_label[regno], 0)) + if (get_last_value_validate (&value, reg_stat[regno].last_set, + reg_stat[regno].last_set_label, 0)) return value; /* Otherwise, make a copy and replace any invalid register with (clobber (const_int 0)). If that fails for some reason, return 0. */ value = copy_rtx (value); - if (get_last_value_validate (&value, reg_last_set[regno], - reg_last_set_label[regno], 1)) + if (get_last_value_validate (&value, reg_stat[regno].last_set, + reg_stat[regno].last_set_label, 1)) return value; return 0; @@ -11965,7 +11391,7 @@ use_crosses_set_p (rtx x, int from_cuid) { unsigned int regno = REGNO (x); unsigned endreg = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + ? hard_regno_nregs[regno][GET_MODE (x)] : 1); #ifdef PUSH_ROUNDING /* Don't allow uses of the stack pointer to be moved, @@ -11974,8 +11400,8 @@ use_crosses_set_p (rtx x, int from_cuid) return 1; #endif for (; regno < endreg; regno++) - if (reg_last_set[regno] - && INSN_CUID (reg_last_set[regno]) > from_cuid) + if (reg_stat[regno].last_set + && INSN_CUID (reg_stat[regno].last_set) > from_cuid) return 1; return 0; } @@ -12017,12 +11443,12 @@ reg_dead_at_p_1 (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED) { unsigned int regno, endregno; - if (GET_CODE (dest) != REG) + if (!REG_P (dest)) return; regno = REGNO (dest); endregno = regno + (regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (regno, GET_MODE (dest)) : 1); + ? hard_regno_nregs[regno][GET_MODE (dest)] : 1); if (reg_dead_endregno > regno && reg_dead_regno < endregno) reg_dead_flag = (GET_CODE (x) == CLOBBER) ? 1 : -1; @@ -12045,23 +11471,25 @@ reg_dead_at_p (rtx reg, rtx insn) /* Set variables for reg_dead_at_p_1. */ reg_dead_regno = REGNO (reg); reg_dead_endregno = reg_dead_regno + (reg_dead_regno < FIRST_PSEUDO_REGISTER - ? HARD_REGNO_NREGS (reg_dead_regno, - GET_MODE (reg)) + ? hard_regno_nregs[reg_dead_regno] + [GET_MODE (reg)] : 1); reg_dead_flag = 0; - /* Check that reg isn't mentioned in NEWPAT_USED_REGS. */ + /* Check that reg isn't mentioned in NEWPAT_USED_REGS. For fixed registers + we allow the machine description to decide whether use-and-clobber + patterns are OK. */ if (reg_dead_regno < FIRST_PSEUDO_REGISTER) { for (i = reg_dead_regno; i < reg_dead_endregno; i++) - if (TEST_HARD_REG_BIT (newpat_used_regs, i)) + if (!fixed_regs[i] && TEST_HARD_REG_BIT (newpat_used_regs, i)) return 0; } /* Scan backwards until we find a REG_DEAD note, SET, CLOBBER, label, or beginning of function. */ - for (; insn && GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != BARRIER; + for (; insn && !LABEL_P (insn) && !BARRIER_P (insn); insn = prev_nonnote_insn (insn)) { note_stores (PATTERN (insn), reg_dead_at_p_1, NULL); @@ -12086,7 +11514,7 @@ reg_dead_at_p (rtx reg, rtx insn) } for (i = reg_dead_regno; i < reg_dead_endregno; i++) - if (REGNO_REG_SET_P (block->global_live_at_start, i)) + if (REGNO_REG_SET_P (block->il.rtl->global_live_at_start, i)) return 0; return 1; @@ -12124,7 +11552,7 @@ mark_used_regs_combine (rtx x) case CLOBBER: /* If we are clobbering a MEM, mark any hard registers inside the address as used. */ - if (GET_CODE (XEXP (x, 0)) == MEM) + if (MEM_P (XEXP (x, 0))) mark_used_regs_combine (XEXP (XEXP (x, 0), 0)); return; @@ -12147,7 +11575,7 @@ mark_used_regs_combine (rtx x) || regno == FRAME_POINTER_REGNUM) return; - endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; for (r = regno; r < endregno; r++) SET_HARD_REG_BIT (newpat_used_regs, r); } @@ -12161,11 +11589,10 @@ mark_used_regs_combine (rtx x) while (GET_CODE (testreg) == SUBREG || GET_CODE (testreg) == ZERO_EXTRACT - || GET_CODE (testreg) == SIGN_EXTRACT || GET_CODE (testreg) == STRICT_LOW_PART) testreg = XEXP (testreg, 0); - if (GET_CODE (testreg) == MEM) + if (MEM_P (testreg)) mark_used_regs_combine (XEXP (testreg, 0)); mark_used_regs_combine (SET_SRC (x)); @@ -12235,7 +11662,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, if (code == REG) { unsigned int regno = REGNO (x); - rtx where_dead = reg_last_death[regno]; + rtx where_dead = reg_stat[regno].last_death; rtx before_dead, after_dead; /* Don't move the register if it gets killed in between from and to. */ @@ -12262,7 +11689,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, rtx note = remove_death (regno, where_dead); /* It is possible for the call above to return 0. This can occur - when reg_last_death points to I2 or I1 that we combined with. + when last_death points to I2 or I1 that we combined with. In that case make a new note. We must also check for the case where X is a hard register @@ -12276,10 +11703,10 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, { unsigned int deadregno = REGNO (XEXP (note, 0)); unsigned int deadend - = (deadregno + HARD_REGNO_NREGS (deadregno, - GET_MODE (XEXP (note, 0)))); + = (deadregno + hard_regno_nregs[deadregno] + [GET_MODE (XEXP (note, 0))]); unsigned int ourend - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i; for (i = deadregno; i < deadend; i++) @@ -12300,15 +11727,15 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, && (GET_MODE_SIZE (GET_MODE (XEXP (note, 0))) < GET_MODE_SIZE (GET_MODE (x))))) && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (x)) > 1) + && hard_regno_nregs[regno][GET_MODE (x)] > 1) { unsigned int ourend - = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + = regno + hard_regno_nregs[regno][GET_MODE (x)]; unsigned int i, offset; rtx oldnotes = 0; if (note) - offset = HARD_REGNO_NREGS (regno, GET_MODE (XEXP (note, 0))); + offset = hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))]; else offset = 1; @@ -12364,7 +11791,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_cuid, rtx to_insn, For a REG (the only other possibility), the entire value is being replaced so the old value is not used in this insn. */ - if (GET_CODE (dest) == MEM) + if (MEM_P (dest)) move_deaths (XEXP (dest, 0), maybe_kill_insn, from_cuid, to_insn, pnotes); return; @@ -12414,15 +11841,15 @@ reg_bitfield_target_p (rtx x, rtx body) if (GET_CODE (target) == SUBREG) target = SUBREG_REG (target); - if (GET_CODE (target) != REG) + if (!REG_P (target)) return 0; tregno = REGNO (target), regno = REGNO (x); if (tregno >= FIRST_PSEUDO_REGISTER || regno >= FIRST_PSEUDO_REGISTER) return target == x; - endtregno = tregno + HARD_REGNO_NREGS (tregno, GET_MODE (target)); - endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (x)); + endtregno = tregno + hard_regno_nregs[tregno][GET_MODE (target)]; + endregno = regno + hard_regno_nregs[regno][GET_MODE (x)]; return endregno > tregno && regno < endtregno; } @@ -12439,11 +11866,16 @@ reg_bitfield_target_p (rtx x, rtx body) as appropriate. I3 and I2 are the insns resulting from the combination insns including FROM (I2 may be zero). + ELIM_I2 and ELIM_I1 are either zero or registers that we know will + not need REG_DEAD notes because they are being substituted for. This + saves searching in the most common cases. + Each note in the list is either ignored or placed on some insns, depending on the type of note. */ static void -distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) +distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2, + rtx elim_i1) { rtx note, next_note; rtx tem; @@ -12452,12 +11884,6 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) { rtx place = 0, place2 = 0; - /* If this NOTE references a pseudo register, ensure it references - the latest copy of that register. */ - if (XEXP (note, 0) && GET_CODE (XEXP (note, 0)) == REG - && REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER) - XEXP (note, 0) = regno_reg_rtx[REGNO (XEXP (note, 0))]; - next_note = XEXP (note, 1); switch (REG_NOTE_KIND (note)) { @@ -12473,29 +11899,25 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) /* Just get rid of this note, as it is unused later anyway. */ break; - case REG_VTABLE_REF: - /* ??? Should remain with *a particular* memory load. Given the - nature of vtable data, the last insn seems relatively safe. */ - place = i3; - break; - case REG_NON_LOCAL_GOTO: - if (GET_CODE (i3) == JUMP_INSN) + if (JUMP_P (i3)) place = i3; - else if (i2 && GET_CODE (i2) == JUMP_INSN) - place = i2; else - abort (); + { + gcc_assert (i2 && JUMP_P (i2)); + place = i2; + } break; case REG_EH_REGION: /* These notes must remain with the call or trapping instruction. */ - if (GET_CODE (i3) == CALL_INSN) + if (CALL_P (i3)) place = i3; - else if (i2 && GET_CODE (i2) == CALL_INSN) + else if (i2 && CALL_P (i2)) place = i2; - else if (flag_non_call_exceptions) + else { + gcc_assert (flag_non_call_exceptions); if (may_trap_p (i3)) place = i3; else if (i2 && may_trap_p (i2)) @@ -12504,21 +11926,19 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) can now prove that the instructions can't trap. Drop the note in this case. */ } - else - abort (); break; - case REG_ALWAYS_RETURN: case REG_NORETURN: case REG_SETJMP: /* These notes must remain with the call. It should not be possible for both I2 and I3 to be a call. */ - if (GET_CODE (i3) == CALL_INSN) + if (CALL_P (i3)) place = i3; - else if (i2 && GET_CODE (i2) == CALL_INSN) - place = i2; else - abort (); + { + gcc_assert (i2 && CALL_P (i2)); + place = i2; + } break; case REG_UNUSED: @@ -12544,7 +11964,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) if (from_insn != i3) break; - if (! (GET_CODE (XEXP (note, 0)) == REG + if (! (REG_P (XEXP (note, 0)) ? find_regno_note (i3, REG_UNUSED, REGNO (XEXP (note, 0))) : find_reg_note (i3, REG_UNUSED, XEXP (note, 0)))) place = i3; @@ -12553,7 +11973,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) now dies here, so we must put a REG_DEAD note here unless there is one already. */ else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3)) - && ! (GET_CODE (XEXP (note, 0)) == REG + && ! (REG_P (XEXP (note, 0)) ? find_regno_note (i3, REG_DEAD, REGNO (XEXP (note, 0))) : find_reg_note (i3, REG_DEAD, XEXP (note, 0)))) @@ -12621,22 +12041,34 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) place = i2; } - /* Don't attach REG_LABEL note to a JUMP_INSN which has - JUMP_LABEL already. Instead, decrement LABEL_NUSES. */ - if (place && GET_CODE (place) == JUMP_INSN && JUMP_LABEL (place)) + /* Don't attach REG_LABEL note to a JUMP_INSN. Add + a JUMP_LABEL instead or decrement LABEL_NUSES. */ + if (place && JUMP_P (place)) { - if (JUMP_LABEL (place) != XEXP (note, 0)) - abort (); - if (GET_CODE (JUMP_LABEL (place)) == CODE_LABEL) - LABEL_NUSES (JUMP_LABEL (place))--; + rtx label = JUMP_LABEL (place); + + if (!label) + JUMP_LABEL (place) = XEXP (note, 0); + else + { + gcc_assert (label == XEXP (note, 0)); + if (LABEL_P (label)) + LABEL_NUSES (label)--; + } place = 0; } - if (place2 && GET_CODE (place2) == JUMP_INSN && JUMP_LABEL (place2)) + if (place2 && JUMP_P (place2)) { - if (JUMP_LABEL (place2) != XEXP (note, 0)) - abort (); - if (GET_CODE (JUMP_LABEL (place2)) == CODE_LABEL) - LABEL_NUSES (JUMP_LABEL (place2))--; + rtx label = JUMP_LABEL (place2); + + if (!label) + JUMP_LABEL (place2) = XEXP (note, 0); + else + { + gcc_assert (label == XEXP (note, 0)); + if (LABEL_P (label)) + LABEL_NUSES (label)--; + } place2 = 0; } break; @@ -12652,7 +12084,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) /* If the insn previously containing this note still exists, put it back where it was. Otherwise move it to the previous insn. Adjust the corresponding REG_LIBCALL note. */ - if (GET_CODE (from_insn) != NOTE) + if (!NOTE_P (from_insn)) place = from_insn; else { @@ -12672,7 +12104,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) case REG_LIBCALL: /* This is handled similarly to REG_RETVAL. */ - if (GET_CODE (from_insn) != NOTE) + if (!NOTE_P (from_insn)) place = from_insn; else { @@ -12691,7 +12123,15 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) break; case REG_DEAD: - /* If the register is used as an input in I3, it dies there. + /* If we replaced the right hand side of FROM_INSN with a + REG_EQUAL note, the original use of the dying register + will not have been combined into I3 and I2. In such cases, + FROM_INSN is guaranteed to be the first of the combined + instructions, so we simply need to search back before + FROM_INSN for the previous use or set of this register, + then alter the notes there appropriately. + + If the register is used as an input in I3, it dies there. Similarly for I2, if it is nonzero and adjacent to I3. If the register is not used as an input in either I3 or I2 @@ -12706,20 +12146,34 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) use of A and put the death note there. */ if (from_insn - && GET_CODE (from_insn) == CALL_INSN - && find_reg_fusage (from_insn, USE, XEXP (note, 0))) - place = from_insn; - else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3))) - place = i3; - else if (i2 != 0 && next_nonnote_insn (i2) == i3 - && reg_referenced_p (XEXP (note, 0), PATTERN (i2))) - place = i2; + && from_insn == i2mod + && !reg_overlap_mentioned_p (XEXP (note, 0), i2mod_new_rhs)) + tem = from_insn; + else + { + if (from_insn + && CALL_P (from_insn) + && find_reg_fusage (from_insn, USE, XEXP (note, 0))) + place = from_insn; + else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3))) + place = i3; + else if (i2 != 0 && next_nonnote_insn (i2) == i3 + && reg_referenced_p (XEXP (note, 0), PATTERN (i2))) + place = i2; + else if ((rtx_equal_p (XEXP (note, 0), elim_i2) + && !(i2mod + && reg_overlap_mentioned_p (XEXP (note, 0), + i2mod_old_rhs))) + || rtx_equal_p (XEXP (note, 0), elim_i1)) + break; + tem = i3; + } if (place == 0) { basic_block bb = this_basic_block; - for (tem = PREV_INSN (i3); place == 0; tem = PREV_INSN (tem)) + for (tem = PREV_INSN (tem); place == 0; tem = PREV_INSN (tem)) { if (! INSN_P (tem)) { @@ -12730,7 +12184,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) /* If the register is being set at TEM, see if that is all TEM is doing. If so, delete TEM. Otherwise, make this - into a REG_UNUSED note instead. Don't delete sets to + into a REG_UNUSED note instead. Don't delete sets to global register vars. */ if ((REGNO (XEXP (note, 0)) >= FIRST_PSEUDO_REGISTER || !global_regs[REGNO (XEXP (note, 0))]) @@ -12776,12 +12230,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) PATTERN (tem) = pc_rtx; REG_NOTES (tem) = NULL; - distribute_notes (old_notes, tem, tem, NULL_RTX); + distribute_notes (old_notes, tem, tem, NULL_RTX, + NULL_RTX, NULL_RTX); distribute_links (LOG_LINKS (tem)); - PUT_CODE (tem, NOTE); - NOTE_LINE_NUMBER (tem) = NOTE_INSN_DELETED; - NOTE_SOURCE_FILE (tem) = 0; + SET_INSN_DELETED (tem); #ifdef HAVE_cc0 /* Delete the setter too. */ @@ -12792,36 +12245,24 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) REG_NOTES (cc0_setter) = NULL; distribute_notes (old_notes, cc0_setter, - cc0_setter, NULL_RTX); + cc0_setter, NULL_RTX, + NULL_RTX, NULL_RTX); distribute_links (LOG_LINKS (cc0_setter)); - PUT_CODE (cc0_setter, NOTE); - NOTE_LINE_NUMBER (cc0_setter) - = NOTE_INSN_DELETED; - NOTE_SOURCE_FILE (cc0_setter) = 0; + SET_INSN_DELETED (cc0_setter); } #endif } - /* If the register is both set and used here, put the - REG_DEAD note here, but place a REG_UNUSED note - here too unless there already is one. */ - else if (reg_referenced_p (XEXP (note, 0), - PATTERN (tem))) - { - place = tem; - - if (! find_regno_note (tem, REG_UNUSED, - REGNO (XEXP (note, 0)))) - REG_NOTES (tem) - = gen_rtx_EXPR_LIST (REG_UNUSED, XEXP (note, 0), - REG_NOTES (tem)); - } else { PUT_REG_NOTE_KIND (note, REG_UNUSED); /* If there isn't already a REG_UNUSED note, put one - here. */ + here. Do not place a REG_DEAD note, even if + the register is also used here; that would not + match the algorithm used in lifetime analysis + and can cause the consistency check in the + scheduler to fail. */ if (! find_regno_note (tem, REG_UNUSED, REGNO (XEXP (note, 0)))) place = tem; @@ -12829,7 +12270,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) } } else if (reg_referenced_p (XEXP (note, 0), PATTERN (tem)) - || (GET_CODE (tem) == CALL_INSN + || (CALL_P (tem) && find_reg_fusage (tem, USE, XEXP (note, 0)))) { place = tem; @@ -12863,14 +12304,14 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) was dead, there's nothing left to do. Otherwise, we'll need to do a global life update after combine. */ if (REG_NOTE_KIND (note) == REG_DEAD && place == 0 - && REGNO_REG_SET_P (bb->global_live_at_start, + && REGNO_REG_SET_P (bb->il.rtl->global_live_at_start, REGNO (XEXP (note, 0)))) SET_BIT (refresh_blocks, this_basic_block->index); } /* If the register is set or already dead at PLACE, we needn't do anything with this note if it is still a REG_DEAD note. - We can here if it is set at all, not if is it totally replace, + We check here if it is set at all, not if is it totally replaced, which is what `dead_or_set_p' checks, so also check for it being set partially. */ @@ -12888,14 +12329,14 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) || reg_bitfield_target_p (XEXP (note, 0), PATTERN (place))) { /* Unless the register previously died in PLACE, clear - reg_last_death. [I no longer understand why this is + last_death. [I no longer understand why this is being done.] */ - if (reg_last_death[regno] != place) - reg_last_death[regno] = 0; + if (reg_stat[regno].last_death != place) + reg_stat[regno].last_death = 0; place = 0; } else - reg_last_death[regno] = place; + reg_stat[regno].last_death = place; /* If this is a death note for a hard reg that is occupying multiple registers, ensure that we are still using all @@ -12907,11 +12348,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) the previous insn that used this register. */ if (place && regno < FIRST_PSEUDO_REGISTER - && HARD_REGNO_NREGS (regno, GET_MODE (XEXP (note, 0))) > 1) + && hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] > 1) { unsigned int endregno - = regno + HARD_REGNO_NREGS (regno, - GET_MODE (XEXP (note, 0))); + = regno + hard_regno_nregs[regno] + [GET_MODE (XEXP (note, 0))]; int all_used = 1; unsigned int i; @@ -12927,7 +12368,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) not already dead or set. */ for (i = regno; i < endregno; - i += HARD_REGNO_NREGS (i, reg_raw_mode[i])) + i += hard_regno_nregs[i][reg_raw_mode[i]]) { rtx piece = regno_reg_rtx[i]; basic_block bb = this_basic_block; @@ -12940,7 +12381,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) = gen_rtx_EXPR_LIST (REG_DEAD, piece, NULL_RTX); distribute_notes (new_note, place, place, - NULL_RTX); + NULL_RTX, NULL_RTX, NULL_RTX); } else if (! refers_to_regno_p (i, i + 1, PATTERN (place), 0) @@ -12980,7 +12421,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) default: /* Any other notes should not be present at this point in the compilation. */ - abort (); + gcc_unreachable (); } if (place) @@ -12990,14 +12431,14 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2) } else if ((REG_NOTE_KIND (note) == REG_DEAD || REG_NOTE_KIND (note) == REG_UNUSED) - && GET_CODE (XEXP (note, 0)) == REG) + && REG_P (XEXP (note, 0))) REG_N_DEATHS (REGNO (XEXP (note, 0)))--; if (place2) { if ((REG_NOTE_KIND (note) == REG_DEAD || REG_NOTE_KIND (note) == REG_UNUSED) - && GET_CODE (XEXP (note, 0)) == REG) + && REG_P (XEXP (note, 0))) REG_N_DEATHS (REGNO (XEXP (note, 0)))++; REG_NOTES (place2) = gen_rtx_fmt_ee (GET_CODE (note), @@ -13036,13 +12477,12 @@ distribute_links (rtx links) replace I3, I2, and I1 by I3 and I2. But in that case the destination of I2 also remains unchanged. */ - if (GET_CODE (XEXP (link, 0)) == NOTE + if (NOTE_P (XEXP (link, 0)) || (set = single_set (XEXP (link, 0))) == 0) continue; reg = SET_DEST (set); while (GET_CODE (reg) == SUBREG || GET_CODE (reg) == ZERO_EXTRACT - || GET_CODE (reg) == SIGN_EXTRACT || GET_CODE (reg) == STRICT_LOW_PART) reg = XEXP (reg, 0); @@ -13065,7 +12505,7 @@ distribute_links (rtx links) place = insn; break; } - else if (GET_CODE (insn) == CALL_INSN + else if (CALL_P (insn) && find_reg_fusage (insn, USE, reg)) { place = insn; @@ -13100,17 +12540,43 @@ distribute_links (rtx links) } } +/* Subroutine of unmentioned_reg_p and callback from for_each_rtx. + Check whether the expression pointer to by LOC is a register or + memory, and if so return 1 if it isn't mentioned in the rtx EXPR. + Otherwise return zero. */ + +static int +unmentioned_reg_p_1 (rtx *loc, void *expr) +{ + rtx x = *loc; + + if (x != NULL_RTX + && (REG_P (x) || MEM_P (x)) + && ! reg_mentioned_p (x, (rtx) expr)) + return 1; + return 0; +} + +/* Check for any register or memory mentioned in EQUIV that is not + mentioned in EXPR. This is used to restrict EQUIV to "specializations" + of EXPR where some registers may have been replaced by constants. */ + +static bool +unmentioned_reg_p (rtx equiv, rtx expr) +{ + return for_each_rtx (&equiv, unmentioned_reg_p_1, expr); +} + /* Compute INSN_CUID for INSN, which is an insn made by combine. */ static int insn_cuid (rtx insn) { while (insn != 0 && INSN_UID (insn) > max_uid_cuid - && GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == USE) + && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE) insn = NEXT_INSN (insn); - if (INSN_UID (insn) > max_uid_cuid) - abort (); + gcc_assert (INSN_UID (insn) <= max_uid_cuid); return INSN_CUID (insn); } @@ -13118,7 +12584,7 @@ insn_cuid (rtx insn) void dump_combine_stats (FILE *file) { - fnotice + fprintf (file, ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n\n", combine_attempts, combine_merges, combine_extras, combine_successes); @@ -13127,8 +12593,56 @@ dump_combine_stats (FILE *file) void dump_combine_total_stats (FILE *file) { - fnotice + fprintf (file, "\n;; Combiner totals: %d attempts, %d substitutions (%d requiring new space),\n;; %d successes.\n", total_attempts, total_merges, total_extras, total_successes); } + + +static bool +gate_handle_combine (void) +{ + return (optimize > 0); +} + +/* Try combining insns through substitution. */ +static unsigned int +rest_of_handle_combine (void) +{ + int rebuild_jump_labels_after_combine + = combine_instructions (get_insns (), max_reg_num ()); + + /* Combining insns may have turned an indirect jump into a + direct jump. Rebuild the JUMP_LABEL fields of jumping + instructions. */ + if (rebuild_jump_labels_after_combine) + { + timevar_push (TV_JUMP); + rebuild_jump_labels (get_insns ()); + timevar_pop (TV_JUMP); + + delete_dead_jumptables (); + cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE); + } + return 0; +} + +struct tree_opt_pass pass_combine = +{ + "combine", /* name */ + gate_handle_combine, /* gate */ + rest_of_handle_combine, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_COMBINE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func | + TODO_ggc_collect, /* todo_flags_finish */ + 'c' /* letter */ +}; + diff --git a/contrib/gcc/common.opt b/contrib/gcc/common.opt index 20d1b75abf2..23da331b927 100644 --- a/contrib/gcc/common.opt +++ b/contrib/gcc/common.opt @@ -1,5 +1,6 @@ ; Options for the language- and target-independent parts of the compiler. -; Copyright (C) 2003 Free Software Foundation, Inc. + +; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -7,18 +8,18 @@ ; the terms of the GNU General Public License as published by the Free ; Software Foundation; either version 2, or (at your option) any later ; version. -; +; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY ; WARRANTY; without even the implied warranty of MERCHANTABILITY or ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ; for more details. -; +; ; 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. -; See c.opt for a description of this file's format. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -53,79 +54,115 @@ Common RejectNegative This switch is deprecated; use -Wextra instead Waggregate-return -Common +Common Var(warn_aggregate_return) Warn about returning structures, unions or arrays +Wattributes +Common Var(warn_attributes) Init(1) +Warn about inappropriate attribute usage + Wcast-align -Common +Common Var(warn_cast_align) Warn about pointer casts which increase alignment Wdeprecated-declarations -Common +Common Var(warn_deprecated_decl) Init(1) Warn about uses of __attribute__((deprecated)) declarations Wdisabled-optimization -Common +Common Var(warn_disabled_optimization) Warn when an optimization pass is disabled Werror -Common +Common Var(warnings_are_errors) Treat all warnings as errors +Werror= +Common Joined +Treat specified warning as error + Wextra Common Print extra (possibly unwanted) warnings +Wfatal-errors +Common Var(flag_fatal_errors) +Exit on the first error occurred + Winline -Common +Common Var(warn_inline) Warn when an inlined function cannot be inlined Wlarger-than- Common RejectNegative Joined UInteger -Wlarger-than- Warn if an object is larger than bytes +Wunsafe-loop-optimizations +Common Var(warn_unsafe_loop_optimizations) +Warn if the loop cannot be optimized due to nontrivial assumptions. + Wmissing-noreturn -Common +Common Var(warn_missing_noreturn) Warn about functions which might be candidates for __attribute__((noreturn)) +Woverflow +Common Var(warn_overflow) Init(1) +Warn about overflow in arithmetic expressions + Wpacked -Common +Common Var(warn_packed) Warn when the packed attribute has no effect on struct layout Wpadded -Common +Common Var(warn_padded) Warn when padding is required to align structure members Wshadow -Common +Common Var(warn_shadow) Warn when one local variable shadows another +Wstack-protector +Common Var(warn_stack_protect) +Warn when not issuing stack smashing protection for some reason + Wstrict-aliasing Common Warn about code which might break strict aliasing rules -Wswitch +Wstrict-aliasing= +Common Joined UInteger +Warn about code which might break strict aliasing rules + +Wstrict-overflow Common +Warn about optimizations that assume that signed overflow is undefined + +Wstrict-overflow= +Common Joined UInteger +Warn about optimizations that assume that signed overflow is undefined + +Wswitch +Common Var(warn_switch) Warn about enumerated switches, with no default, missing a case Wswitch-default -Common +Common Var(warn_switch_default) Warn about enumerated switches missing a \"default:\" statement Wswitch-enum -Common +Common Var(warn_switch_enum) Warn about all enumerated switches missing a specific case Wsystem-headers -Common +Common Var(warn_system_headers) Do not suppress warnings from system headers Wuninitialized -Common +Common Var(warn_uninitialized) Warn about uninitialized automatic variables Wunreachable-code -Common +Common Var(warn_notreached) Warn about code that will never be executed Wunused @@ -133,25 +170,29 @@ Common Enable all -Wunused- warnings Wunused-function -Common +Common Var(warn_unused_function) Warn when a function is unused Wunused-label -Common +Common Var(warn_unused_label) Warn when a label is unused Wunused-parameter -Common +Common Var(warn_unused_parameter) Warn when a function parameter is unused Wunused-value -Common +Common Var(warn_unused_value) Warn when an expression value is unused Wunused-variable -Common +Common Var(warn_unused_variable) Warn when a variable is unused +Wvolatile-register-var +Common Var(warn_register_var) +Warn when a register variable is declared volatile + aux-info Common Separate -aux-info Emit declaration information into @@ -173,79 +214,104 @@ dumpbase Common Separate -dumpbase Set the file basename to be used for dumps -fPIC -Common - -fPIE -Common - +; The version of the C++ ABI in use. The following values are allowed: +; +; 0: The version of the ABI believed most conformant with the C++ ABI +; specification. This ABI may change as bugs are discovered and fixed. +; Therefore, 0 will not necessarily indicate the same ABI in different +; versions of G++. +; +; 1: The version of the ABI first used in G++ 3.2. +; +; Additional positive integers will be assigned as new versions of +; the ABI become the default version of the ABI. fabi-version= -Common Joined UInteger +Common Joined UInteger Var(flag_abi_version) Init(2) falign-functions -Common +Common Report Var(align_functions,0) Align the start of functions falign-functions= Common RejectNegative Joined UInteger falign-jumps -Common +Common Report Var(align_jumps,0) Align labels which are only reached by jumping falign-jumps= Common RejectNegative Joined UInteger falign-labels -Common +Common Report Var(align_labels,0) Align all labels falign-labels= Common RejectNegative Joined UInteger falign-loops -Common +Common Report Var(align_loops) Align the start of loops falign-loops= Common RejectNegative Joined UInteger +; This flag is only tested if alias checking is enabled. +; 0 if pointer arguments may alias each other. True in C. +; 1 if pointer arguments may not alias each other but may alias +; global variables. +; 2 if pointer arguments may not alias each other and may not +; alias global variables. +; 3 if pointer arguments may not alias anything. True in Fortran. +; Set by the front end. fargument-alias -Common +Common Report Var(flag_argument_noalias,0) Specify that arguments may alias each other and globals fargument-noalias -Common +Common Report Var(flag_argument_noalias,1) VarExists Assume arguments may alias globals but not each other fargument-noalias-global -Common +Common Report Var(flag_argument_noalias,2) VarExists Assume arguments alias neither each other nor globals +fargument-noalias-anything +Common Report Var(flag_argument_noalias,3) VarExists +Assume arguments alias no other storage + fasynchronous-unwind-tables -Common +Common Report Var(flag_asynchronous_unwind_tables) Generate unwind tables that are exact at each instruction boundary +; -fcheck-bounds causes gcc to generate array bounds checks. +; For C, C++ and ObjC: defaults off. +; For Java: defaults to on. +; For Fortran: defaults to off. fbounds-check -Common +Common Report Var(flag_bounds_check) Generate code to check bounds before indexing arrays fbranch-count-reg -Common +Common Report Var(flag_branch_on_count_reg) Init(1) Replace add, compare, branch with branch on count register fbranch-probabilities -Common +Common Report Var(flag_branch_probabilities) Use profiling information for branch probabilities fbranch-target-load-optimize -Common +Common Report Var(flag_branch_target_load_optimize) Perform branch target load optimization before prologue / epilogue threading fbranch-target-load-optimize2 -Common +Common Report Var(flag_branch_target_load_optimize2) Perform branch target load optimization after prologue / epilogue threading +fbtr-bb-exclusive +Common Report Var(flag_btr_bb_exclusive) +Restrict target load migration not to re-use registers in any basic block + fcall-saved- Common Joined RejectNegative -fcall-saved- Mark as being preserved across functions @@ -254,79 +320,108 @@ fcall-used- Common Joined RejectNegative -fcall-used- Mark as being corrupted by function calls +; Nonzero for -fcaller-saves: allocate values in regs that need to +; be saved across function calls, if that produces overall better code. +; Optional now, so people can test it. fcaller-saves -Common +Common Report Var(flag_caller_saves) Save registers around function calls fcommon -Common +Common Report Var(flag_no_common,0) Do not put uninitialized globals in the common section fcprop-registers -Common +Common Report Var(flag_cprop_registers) Perform a register copy-propagation optimization pass fcrossjumping -Common +Common Report Var(flag_crossjumping) Perform cross-jumping optimization fcse-follow-jumps -Common +Common Report Var(flag_cse_follow_jumps) When running CSE, follow jumps to their targets fcse-skip-blocks -Common +Common Report Var(flag_cse_skip_blocks) When running CSE, follow conditional jumps +fcx-limited-range +Common Report Var(flag_cx_limited_range) +Omit range reduction step when performing complex division + fdata-sections -Common +Common Report Var(flag_data_sections) Place data items into their own section +; Nonzero for -fdefer-pop: don't pop args after each function call +; instead save them up to pop many calls' args with one insns. fdefer-pop -Common +Common Report Var(flag_defer_pop) Defer popping functions args from stack until later fdelayed-branch -Common +Common Report Var(flag_delayed_branch) Attempt to fill delay slots of branch instructions fdelete-null-pointer-checks -Common +Common Report Var(flag_delete_null_pointer_checks) Delete useless null pointer checks fdiagnostics-show-location= Common Joined RejectNegative -fdiagnostics-show-location=[once|every-line] How often to emit source location at the beginning of line-wrapped diagnostics -fdump-unnumbered +fdiagnostics-show-option Common -Suppress output of instruction numbers and line number notes in debugging dumps +Amend appropriate diagnostic messages with the command line option that controls them + +fdump- +Common Joined RejectNegative +-fdump- Dump various compiler internals to a file + +fdump-noaddr +Common Report Var(flag_dump_noaddr) +Suppress output of addresses in debugging dumps + +fdump-unnumbered +Common Report Var(flag_dump_unnumbered) VarExists +Suppress output of instruction numbers, line number notes and addresses in debugging dumps + +fearly-inlining +Common Report Var(flag_early_inlining) Init(1) +Perform early inlining feliminate-dwarf2-dups -Common +Common Report Var(flag_eliminate_dwarf2_dups) Perform DWARF2 duplicate elimination feliminate-unused-debug-symbols -Common +Common Report Var(flag_debug_only_used_symbols) Perform unused type elimination in debug info feliminate-unused-debug-types -Common +Common Report Var(flag_eliminate_unused_debug_types) Init(1) Perform unused type elimination in debug info +femit-class-debug-always +Common Report Var(flag_emit_class_debug_always) Init(1) +Do not suppress C++ class debug information. + fexceptions -Common +Common Report Var(flag_exceptions) Enable exception handling fexpensive-optimizations -Common +Common Report Var(flag_expensive_optimizations) Perform a number of minor, expensive optimizations ffast-math Common ffinite-math-only -Common +Common Report Var(flag_finite_math_only) Assume no NaNs or infinities are generated ffixed- @@ -334,69 +429,99 @@ Common Joined RejectNegative -ffixed- Mark as being unavailable to the compiler ffloat-store -Common -Do not store floats in registers +Common Report Var(flag_float_store) +Don't allocate floats and doubles in extended-precision registers +; Nonzero for -fforce-addr: load memory address into a register before +; reference to memory. This makes better cse but slower compilation. fforce-addr -Common +Common Report Var(flag_force_addr) Copy memory address constants into registers before use +; Nonzero for -fforce-mem: load memory value into a register +; before arithmetic on it. This makes better cse but slower compilation. fforce-mem -Common +Common Report Var(flag_force_mem) Copy memory operands into registers before use +; Nonzero means don't put addresses of constant functions in registers. +; Used for compiling the Unix kernel, where strange substitutions are +; done on the assembly output. ffunction-cse -Common +Common Report Var(flag_no_function_cse,0) Allow function addresses to be held in registers ffunction-sections -Common +Common Report Var(flag_function_sections) Place each function into its own section fgcse -Common +Common Report Var(flag_gcse) Perform global common subexpression elimination fgcse-lm -Common +Common Report Var(flag_gcse_lm) Init(1) Perform enhanced load motion during global common subexpression elimination fgcse-sm -Common +Common Report Var(flag_gcse_sm) Init(0) Perform store motion after global common subexpression elimination fgcse-las -Common -Perform redundant load after store elimination in global common subexpression elimination +Common Report Var(flag_gcse_las) Init(0) +Perform redundant load after store elimination in global common subexpression +elimination + +fgcse-after-reload +Common Report Var(flag_gcse_after_reload) +Perform global common subexpression elimination after register allocation +has finished fguess-branch-probability -Common +Common Report Var(flag_guess_branch_prob) Enable guessing of branch probabilities +; Nonzero means ignore `#ident' directives. 0 means handle them. +; Generate position-independent code for executables if possible +; On SVR4 targets, it also controls whether or not to emit a +; string identifying the compiler. fident -Common +Common Report Var(flag_no_ident,0) Process #ident directives fif-conversion -Common +Common Report Var(flag_if_conversion) Perform conversion of conditional jumps to branchless equivalents fif-conversion2 -Common +Common Report Var(flag_if_conversion2) Perform conversion of conditional jumps to conditional execution +; -finhibit-size-directive inhibits output of .size for ELF. +; This is used only for compiling crtstuff.c, +; and it may be extended to other effects +; needed for crtstuff.c on other systems. finhibit-size-directive -Common +Common Report Var(flag_inhibit_size_directive) Do not generate .size directives +; Nonzero means that functions declared `inline' will be treated +; as `static'. Prevents generation of zillions of copies of unused +; static inline functions; instead, `inlines' are written out +; only when actually used. Used in conjunction with -g. Also +; does the right thing with #pragma interface. finline -Common +Common Report Var(flag_no_inline,0) Init(2) Pay attention to the \"inline\" keyword finline-functions -Common +Common Report Var(flag_inline_functions) Integrate simple functions into their callers +finline-functions-called-once +Common Report Var(flag_inline_functions_called_once) Init(1) +Integrate functions called once into their callers + finline-limit- Common RejectNegative Joined UInteger @@ -405,115 +530,166 @@ Common RejectNegative Joined UInteger -finline-limit= Limit the size of inlined functions to finstrument-functions -Common +Common Report Var(flag_instrument_function_entry_exit) Instrument function entry and exit with profiling calls +fipa-cp +Common Report Var(flag_ipa_cp) +Perform Interprocedural constant propagation + +fipa-pure-const +Common Report Var(flag_ipa_pure_const) Init(0) +Discover pure and const functions + +fipa-pta +Common Report Var(flag_ipa_pta) Init(0) +Perform interprocedural points-to analysis + +fipa-reference +Common Report Var(flag_ipa_reference) Init(0) +Discover readonly and non addressable static variables + +fipa-type-escape +Common Report Var(flag_ipa_type_escape) Init(0) +Type based escape and alias analysis + +fivopts +Common Report Var(flag_ivopts) Init(1) +Optimize induction variables on trees + +fjump-tables +Common Var(flag_jump_tables) Init(1) +Use jump tables for sufficiently large switch statements + fkeep-inline-functions -Common +Common Report Var(flag_keep_inline_functions) Generate code for functions even if they are fully inlined fkeep-static-consts -Common +Common Report Var(flag_keep_static_consts) Init(1) Emit static const variables even if they are not used fleading-underscore -Common +Common Report Var(flag_leading_underscore) Init(-1) Give external symbols a leading underscore floop-optimize Common -Perform loop optimizations +Does nothing. Preserved for backward compatibility. fmath-errno -Common +Common Report Var(flag_errno_math) Init(1) Set errno after built-in math functions fmem-report -Common +Common Report Var(mem_report) Report on permanent memory allocation +; This will attempt to merge constant section constants, if 1 only +; string constants and constants from constant pool, if 2 also constant +; variables. fmerge-all-constants -Common +Common Report Var(flag_merge_constants,2) Init(1) Attempt to merge identical constants and constant variables fmerge-constants -Common +Common Report Var(flag_merge_constants,1) VarExists Attempt to merge identical constants across compilation units fmessage-length= Common RejectNegative Joined UInteger -fmessage-length= Limit diagnostics to characters per line. 0 suppresses line-wrapping -fmove-all-movables -Common -Force all loop invariant computations out of loops +fmodulo-sched +Common Report Var(flag_modulo_sched) +Perform SMS based modulo scheduling before the first scheduling pass -fnew-ra -Common -Use graph-coloring register allocation +fmove-loop-invariants +Common Report Var(flag_move_loop_invariants) Init(1) +Move loop invariant computations out of loops + +fmudflap +Common RejectNegative Report Var(flag_mudflap) +Add mudflap bounds-checking instrumentation for single-threaded program + +fmudflapth +Common RejectNegative Report VarExists Var(flag_mudflap,2) +Add mudflap bounds-checking instrumentation for multi-threaded program + +fmudflapir +Common RejectNegative Report Var(flag_mudflap_ignore_reads) +Ignore read operations when inserting mudflap instrumentation + +freschedule-modulo-scheduled-loops +Common Report Var(flag_resched_modulo_sched) +Enable/Disable the traditional scheduling in loops that already passed modulo scheduling fnon-call-exceptions -Common +Common Report Var(flag_non_call_exceptions) Support synchronous non-call exceptions -fold-unroll-loops -Common -Perform loop unrolling when iteration count is known - -fold-unroll-all-loops -Common -Perform loop unrolling for all loops - fomit-frame-pointer -Common +Common Report Var(flag_omit_frame_pointer) When possible do not generate stack frames foptimize-register-move -Common +Common Report Var(flag_regmove) Do the full register move optimization pass foptimize-sibling-calls -Common +Common Report Var(flag_optimize_sibling_calls) Optimize sibling and tail recursive calls fpack-struct -Common +Common Report Var(flag_pack_struct) Pack structure members together without holes +fpack-struct= +Common RejectNegative Joined UInteger +-fpack-struct= Set initial maximum structure member alignment + fpcc-struct-return -Common +Common Report Var(flag_pcc_struct_return,1) VarExists Return small aggregates in memory, not registers fpeel-loops -Common +Common Report Var(flag_peel_loops) Perform loop peeling fpeephole -Common +Common Report Var(flag_no_peephole,0) Enable machine specific peephole optimizations fpeephole2 -Common +Common Report Var(flag_peephole2) Enable an RTL peephole pass before sched2 +fPIC +Common Report Var(flag_pic,2) +Generate position-independent code if possible (large mode) + +fPIE +Common Report Var(flag_pie,2) +Generate position-independent code for executables if possible (large mode) + fpic -Common -Generate position-independent code if possible +Common Report Var(flag_pic,1) VarExists +Generate position-independent code if possible (small mode) fpie -Common -Generate position-independent code for executables if possible +Common Report Var(flag_pie,1) VarExists +Generate position-independent code for executables if possible (small mode) fprefetch-loop-arrays -Common +Common Report Var(flag_prefetch_loop_arrays) Generate prefetch instructions, if available, for arrays in loops fprofile -Common +Common Report Var(profile_flag) Enable basic program profiling code fprofile-arcs -Common +Common Report Var(profile_arc_flag) Insert arc-based program profiling code fprofile-generate @@ -525,7 +701,7 @@ Common Enable common options for performing profile feedback directed optimizations fprofile-values -Common +Common Report Var(flag_profile_values) Insert code to profile values of expressions frandom-seed @@ -535,56 +711,56 @@ frandom-seed= Common Joined RejectNegative -frandom-seed= Make compile reproducible using -freduce-all-givs -Common -Strength reduce all loop general induction variables - freg-struct-return -Common +Common Report Var(flag_pcc_struct_return,0) VarExists Return small aggregates in registers fregmove -Common +Common Report Var(flag_regmove) Enables a register move optimization frename-registers -Common +Common Report Var(flag_rename_registers) Init(2) Perform a register renaming optimization pass freorder-blocks -Common +Common Report Var(flag_reorder_blocks) Reorder basic blocks to improve code placement +freorder-blocks-and-partition +Common Report Var(flag_reorder_blocks_and_partition) +Reorder basic blocks and partition into hot and cold sections + freorder-functions -Common +Common Report Var(flag_reorder_functions) Reorder functions to improve code placement frerun-cse-after-loop -Common +Common Report Var(flag_rerun_cse_after_loop) Init(2) Add a common subexpression elimination pass after loop optimizations frerun-loop-opt Common -Run the loop optimizer twice +Does nothing. Preserved for backward compatibility. frounding-math -Common +Common Report Var(flag_rounding_math) Disable optimizations that assume default FP rounding behavior fsched-interblock -Common +Common Report Var(flag_schedule_interblock) Init(1) Enable scheduling across basic blocks fsched-spec -Common +Common Report Var(flag_schedule_speculative) Init(1) Allow speculative motion of non-loads fsched-spec-load -Common +Common Report Var(flag_schedule_speculative_load) Allow speculative motion of some loads fsched-spec-load-dangerous -Common +Common Report Var(flag_schedule_speculative_load_dangerous) Allow speculative motion of more loads fsched-verbose= @@ -592,51 +768,79 @@ Common RejectNegative Joined -fsched-verbose= Set the verbosity level of the scheduler fsched2-use-superblocks -Common +Common Report Var(flag_sched2_use_superblocks) If scheduling post reload, do superblock scheduling fsched2-use-traces -Common +Common Report Var(flag_sched2_use_traces) If scheduling post reload, do trace scheduling fschedule-insns -Common +Common Report Var(flag_schedule_insns) Reschedule instructions before register allocation fschedule-insns2 -Common +Common Report Var(flag_schedule_insns_after_reload) Reschedule instructions after register allocation +; sched_stalled_insns means that insns can be moved prematurely from the queue +; of stalled insns into the ready list. fsched-stalled-insns -Common +Common Report Var(flag_sched_stalled_insns) Allow premature scheduling of queued insns fsched-stalled-insns= -Common RejectNegative Joined UInteger --fsched-stalled-insns= Set number of queued insns that can be prematurely scheduled +Common RejectNegative Joined UInteger +-fsched-stalled-insns= Set number of queued insns that can be prematurely scheduled +; sched_stalled_insns_dep controls how many recently scheduled cycles will +; be examined for a dependency on a stalled insn that is candidate for +; premature removal from the queue of stalled insns into the ready list (has +; an effect only if the flag 'sched_stalled_insns' is set). fsched-stalled-insns-dep -Common +Common Report Var(flag_sched_stalled_insns_dep,1) Init(1) Set dependence distance checking in premature scheduling of queued insns fsched-stalled-insns-dep= Common RejectNegative Joined UInteger --fsched-stalled-insns-dep= Set dependence distance checking in premature scheduling of queued insns +-fsched-stalled-insns-dep= Set dependence distance checking in premature scheduling of queued insns -fshared-data -Common -Mark data as shared rather than private +fsection-anchors +Common Report Var(flag_section_anchors) +Access data in the same section from shared anchor points + +frtl-abstract-sequences +Common Report Var(flag_rtl_seqabstr) +Perform sequence abstraction optimization on RTL + +fsee +Common Report Var(flag_see) Init(0) +Eliminate redundant sign extensions using LCM. + +fshow-column +Common C ObjC C++ ObjC++ Report Var(flag_show_column) Init(1) +Show column numbers in diagnostics, when available. Default on fsignaling-nans -Common +Common Report Var(flag_signaling_nans) Disable optimizations observable by IEEE signaling NaNs fsingle-precision-constant -Common +Common Report Var(flag_single_precision_constant) Convert floating point constants to single precision constants +fsplit-ivs-in-unroller +Common Report Var(flag_split_ivs_in_unroller) Init(1) +Split lifetimes of induction variables when loops are unrolled + +fvariable-expansion-in-unroller +Common Report Var(flag_variable_expansion_in_unroller) +Apply variable expansion when loops are unrolled + +; Emit code to probe the stack, to help detect stack overflow; also +; may cause large objects to be allocated dynamically. fstack-check -Common +Common Report Var(flag_stack_check) Insert stack checking code into the program fstack-limit @@ -650,92 +854,241 @@ fstack-limit-symbol= Common RejectNegative Joined -fstack-limit-symbol= Trap if the stack goes past symbol +fstack-protector +Common Report Var(flag_stack_protect, 1) +Use propolice as a stack protection method + +fstack-protector-all +Common Report RejectNegative Var(flag_stack_protect, 2) VarExists +Use a stack protection method for every function + fstrength-reduce Common -Perform strength reduction optimizations +Does nothing. Preserved for backward compatibility. +; Nonzero if we should do (language-dependent) alias analysis. +; Typically, this analysis will assume that expressions of certain +; types do not alias expressions of certain other types. Only used +; if alias analysis (in general) is enabled. fstrict-aliasing -Common +Common Report Var(flag_strict_aliasing) Assume strict aliasing rules apply +fstrict-overflow +Common Report Var(flag_strict_overflow) +Treat signed overflow as undefined + fsyntax-only -Common +Common Report Var(flag_syntax_only) Check for syntax errors, then stop ftest-coverage -Common +Common Report Var(flag_test_coverage) Create data files needed by \"gcov\" fthread-jumps -Common +Common Report Var(flag_thread_jumps) Perform jump threading optimizations ftime-report -Common +Common Report Var(time_report) Report the time taken by each compiler pass ftls-model= Common Joined RejectNegative -ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec] Set the default thread-local storage code generation model +ftoplevel-reorder +Common Report Var(flag_toplevel_reorder) Init(1) +Reorder top level functions, variables, and asms + ftracer -Common +Common Report Var(flag_tracer) Perform superblock formation via tail duplication +; Zero means that floating-point math operations cannot generate a +; (user-visible) trap. This is the case, for example, in nonstop +; IEEE 754 arithmetic. ftrapping-math -Common +Common Report Var(flag_trapping_math) Init(1) Assume floating-point operations can trap ftrapv -Common +Common Report Var(flag_trapv) Trap for signed overflow in addition, subtraction and multiplication +ftree-ccp +Common Report Var(flag_tree_ccp) +Enable SSA-CCP optimization on trees + +ftree-store-ccp +Common Report Var(flag_tree_store_ccp) +Enable SSA-CCP optimization for stores and loads + +ftree-ch +Common Report Var(flag_tree_ch) +Enable loop header copying on trees + +ftree-combine-temps +Common Report Var(flag_tree_combine_temps) +Coalesce memory temporaries in the SSA->normal pass + +ftree-copyrename +Common Report Var(flag_tree_copyrename) +Replace SSA temporaries with better names in copies + +ftree-copy-prop +Common Report Var(flag_tree_copy_prop) +Enable copy propagation on trees + +ftree-store-copy-prop +Common Report Var(flag_tree_store_copy_prop) +Enable copy propagation for stores and loads + +ftree-dce +Common Report Var(flag_tree_dce) +Enable SSA dead code elimination optimization on trees + +ftree-dominator-opts +Common Report Var(flag_tree_dom) +Enable dominator optimizations + +ftree-dse +Common Report Var(flag_tree_dse) +Enable dead store elimination + +ftree-fre +Common Report Var(flag_tree_fre) +Enable Full Redundancy Elimination (FRE) on trees + +ftree-loop-im +Common Report Var(flag_tree_loop_im) Init(1) +Enable loop invariant motion on trees + +ftree-loop-linear +Common Report Var(flag_tree_loop_linear) +Enable linear loop transforms on trees + +ftree-loop-ivcanon +Common Report Var(flag_tree_loop_ivcanon) Init(1) +Create canonical induction variables in loops + +ftree-loop-optimize +Common Report Var(flag_tree_loop_optimize) Init(1) +Enable loop optimizations on tree level + +ftree-pre +Common Report Var(flag_tree_pre) +Enable SSA-PRE optimization on trees + +ftree-salias +Common Report Var(flag_tree_salias) +Perform structural alias analysis + +ftree-sink +Common Report Var(flag_tree_sink) +Enable SSA code sinking on trees + +ftree-sra +Common Report Var(flag_tree_sra) +Perform scalar replacement of aggregates + +ftree-ter +Common Report Var(flag_tree_ter) +Replace temporary expressions in the SSA->normal pass + +ftree-lrs +Common Report Var(flag_tree_live_range_split) +Perform live range splitting during the SSA->normal pass + +ftree-vrp +Common Report Var(flag_tree_vrp) Init(0) +Perform Value Range Propagation on trees + funit-at-a-time -Common +Common Report Var(flag_unit_at_a_time) Compile whole compilation unit at a time funroll-loops -Common +Common Report Var(flag_unroll_loops) Perform loop unrolling when iteration count is known funroll-all-loops -Common +Common Report Var(flag_unroll_all_loops) Perform loop unrolling for all loops +; Nonzero means that loop optimizer may assume that the induction variables +; that control loops do not overflow and that the loops with nontrivial +; exit condition are not infinite +funsafe-loop-optimizations +Common Report Var(flag_unsafe_loop_optimizations) +Allow loop optimizations to assume that the loops behave in normal way + +; Nonzero means that unsafe floating-point math optimizations are allowed +; for the sake of speed. IEEE compliance is not guaranteed, and operations +; are allowed to assume that their arguments and results are "normal" +; (e.g., nonnegative for SQRT). funsafe-math-optimizations -Common +Common Report Var(flag_unsafe_math_optimizations) Allow math optimizations that may violate IEEE or ISO standards funswitch-loops -Common +Common Report Var(flag_unswitch_loops) Perform loop unswitching funwind-tables -Common +Common Report Var(flag_unwind_tables) Just generate unwind tables for exception handling +fvar-tracking +Common Report Var(flag_var_tracking) VarExists +Perform variable tracking + +ftree-vectorize +Common Report Var(flag_tree_vectorize) +Enable loop vectorization on trees + +ftree-vect-loop-version +Common Report Var(flag_tree_vect_loop_version) Init(1) +Enable loop versioning when doing loop vectorization on trees + +ftree-vectorizer-verbose= +Common RejectNegative Joined +-ftree-vectorizer-verbose= Set the verbosity level of the vectorizer + +; -fverbose-asm causes extra commentary information to be produced in +; the generated assembly code (to make it more readable). This option +; is generally only of use to those who actually need to read the +; generated assembly code (perhaps while debugging the compiler itself). +; -fno-verbose-asm, the default, causes the extra information +; to not be added and is useful when comparing two assembler files. fverbose-asm -Common +Common Report Var(flag_verbose_asm) Add extra commentary to assembler output +fvisibility= +Common Joined RejectNegative +-fvisibility=[default|internal|hidden|protected] Set the default symbol visibility + + fvpt -Common +Common Report Var(flag_value_profile_transformations) Use expression value profiles in optimizations fweb -Common +Common Report Var(flag_web) Init(2) Construct webs and split unrelated uses of single variable +fwhole-program +Common Report Var(flag_whole_program) Init(0) +Perform whole program optimizations + fwrapv -Common +Common Report Var(flag_wrapv) Assume signed arithmetic overflow wraps around -fwritable-strings -Common -Store strings in writable data section - fzero-initialized-in-bss -Common +Common Report Var(flag_zero_initialized_in_bss) Init(1) Put zero initialized data in the bss section g @@ -743,11 +1096,11 @@ Common JoinedOrMissing Generate debug information in default format gcoff -Common JoinedOrMissing +Common JoinedOrMissing Negative(gdwarf-2) Generate debug information in COFF format gdwarf-2 -Common JoinedOrMissing +Common JoinedOrMissing Negative(gstabs) Generate debug information in DWARF v2 format ggdb @@ -755,38 +1108,35 @@ Common JoinedOrMissing Generate debug information in default extended format gstabs -Common JoinedOrMissing +Common JoinedOrMissing Negative(gstabs+) Generate debug information in STABS format gstabs+ -Common JoinedOrMissing +Common JoinedOrMissing Negative(gvms) Generate debug information in extended STABS format gvms -Common JoinedOrMissing +Common JoinedOrMissing Negative(gxcoff) Generate debug information in VMS format gxcoff -Common JoinedOrMissing +Common JoinedOrMissing Negative(gxcoff+) Generate debug information in XCOFF format gxcoff+ -Common JoinedOrMissing +Common JoinedOrMissing Negative(gcoff) Generate debug information in extended XCOFF format -m -Common Joined - o Common Joined Separate -o Place output into p -Common +Common Var(profile_flag) Enable function profiling pedantic -Common +Common Var(pedantic) Issue warnings needed for strict compliance to the standard pedantic-errors @@ -794,15 +1144,15 @@ Common Like -pedantic but issue them as errors quiet -Common +Common Var(quiet_flag) Do not display functions compiled or elapsed time version -Common +Common Var(version_flag) Display the compiler's version w -Common +Common Var(inhibit_warnings) Suppress warnings ; This comment is to ensure we retain the blank line above. diff --git a/contrib/gcc/conditions.h b/contrib/gcc/conditions.h index 155c50edf47..9db72235a80 100644 --- a/contrib/gcc/conditions.h +++ b/contrib/gcc/conditions.h @@ -15,8 +15,8 @@ for more details. 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. */ /* None of the things in the files exist if we don't use CC0. */ diff --git a/contrib/gcc/config.build b/contrib/gcc/config.build index 83b126b9dfe..4a8f409e431 100644 --- a/contrib/gcc/config.build +++ b/contrib/gcc/config.build @@ -16,8 +16,8 @@ #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 is the GCC build-specific configuration file # where a configuration type is mapped to different system-specific @@ -90,15 +90,10 @@ case $build in build_install_headers_dir=install-headers-cpio ;; i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4* ) - build_xm_defines="SMALL_ARG_MAX" build_install_headers_dir=install-headers-cpio ;; - i[34567]86-*-solaris2*) - build_xm_defines="SMALL_ARG_MAX" - ;; i[34567]86-*-sysv4*) # Intel x86 running system V r4 - build_xm_defines="SMALL_ARG_MAX" build_install_headers_dir=install-headers-cpio ;; i[34567]86-*-udk*) diff --git a/contrib/gcc/config.gcc b/contrib/gcc/config.gcc index d22f34bc5c4..9a142e25751 100644 --- a/contrib/gcc/config.gcc +++ b/contrib/gcc/config.gcc @@ -1,5 +1,5 @@ # GCC target-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. #This file is part of GCC. @@ -16,8 +16,8 @@ #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 is the GCC target-specific configuration file # where a configuration type is mapped to different system-specific @@ -30,13 +30,18 @@ # # with_* Various variables as set by configure. # -# enable_threads_flag Either the name, yes or no depending on whether +# enable_threads Either the name, yes or no depending on whether # threads support was requested. # # default_use_cxa_atexit -# "no" by default, can be set to "yes" if a target -# wishes to use __cxa_atexit() by default if the -# $enable___cxa_atexit variable is not set. +# The default value for the $enable___cxa_atexit +# variable. enable___cxa_atexit needs to be set to +# "yes" for the correct operation of C++ destructors +# but it relies upon the presence of a non-standard C +# library function called __cxa_atexit. +# Since not all C libraries provide __cxa_atexit the +# default value of $default_use_cxa_atexit is set to +# "no" except for targets which are known to be OK. # # gas_flag Either yes or no depending on whether GNU as was # requested. @@ -58,7 +63,7 @@ # tm_file="${tm_file} dbxelf.h elfos.h svr4.h ${cpu_type.h}/elf.h" # Note that the preferred order is: # - specific target header "${cpu_type}/${cpu_type.h}" -# - generic headers like dbxelf.h elfos.h, netware.h, etc. +# - generic headers like dbxelf.h elfos.h, etc. # - specializing target headers like ${cpu_type.h}/elf.h # This helps to keep OS specific stuff out of the CPU # defining header ${cpu_type}/${cpu_type.h}. @@ -98,6 +103,8 @@ # # extra_programs Like extra_passes, but these are used when linking. # +# extra_options List of target-dependent .opt files. +# # c_target_objs List of extra target-dependent objects that be # linked into the C compiler only. # @@ -127,11 +134,8 @@ # system normally uses GNU as. # # need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide -# for this target. This is true iff -# MAX_LONG_TYPE_SIZE is 64. (The code which -# determines the underlying integral type for -# HOST_WIDE_INT cannot see the definition of -# MAX_LONG_TYPE_SIZE.) +# for this target. This is true iff this target +# supports "long" or "wchar_t" wider than 32 bits. # # configure_default_options # Set to an initializer for configure_default_options @@ -154,6 +158,7 @@ extra_parts= extra_programs= extra_objs= extra_gcc_objs= +extra_options= c_target_objs= cxx_target_objs= tm_defines= @@ -170,7 +175,6 @@ thread_file= # configure entries modify them. gas="$gas_flag" gnu_ld="$gnu_ld_flag" -enable_threads=$enable_threads_flag default_use_cxa_atexit=no target_gtfiles= need_64bit_hwint= @@ -185,23 +189,9 @@ md_file= # Obsolete configurations. case ${target} in - d30v-* | \ - dsp16xx-* | \ - i370-* | \ - i960-* | \ - i?86-moss-msdos | i?86-*-moss* | \ - i?86-ncr-sysv4* | \ - i?86-*-netware | \ - i?86-*-freebsd2* | i?86-*-freebsd*aout* | \ - i?86-*-linux*aout* | \ - i?86-*-linux*libc1* | \ - i?86-*-interix | \ - i?86-*-mach* | \ - i?86-*-udk* | \ - i?86-*-sysv[123]* | \ - i386-*-vsta | \ - m68k-hp-hpux* | m68000-hp-hpux* | \ - m68k-*-sysv4*) + c4x-* \ + | tic4x-* \ + ) if test "x$enable_obsolete" != xyes; then echo "*** Configuration ${target} is obsolete." >&2 echo "*** Specify --enable-obsolete to build it anyway." >&2 @@ -246,6 +236,10 @@ tm_p_file= cpu_type=`echo ${target} | sed 's/-.*$//'` cpu_is_64bit= case ${target} in +m32c*-*-*) + cpu_type=m32c + tmake_file=m32c/t-m32c + ;; alpha*-*-*) cpu_type=alpha need_64bit_hwint=yes @@ -260,20 +254,25 @@ arm*-*-*) cpu_type=arm extra_headers="mmintrin.h" ;; +bfin*-*) + cpu_type=bfin + ;; ep9312*-*-*) cpu_type=arm ;; +frv*) cpu_type=frv + ;; xscale-*-*) cpu_type=arm extra_headers="mmintrin.h" ;; i[34567]86-*-*) cpu_type=i386 - extra_headers="mmintrin.h xmmintrin.h emmintrin.h pmmintrin.h" + extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h" ;; x86_64-*-*) cpu_type=i386 - extra_headers="mmintrin.h xmmintrin.h emmintrin.h pmmintrin.h" + extra_headers="mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h pmmintrin.h" need_64bit_hwint=yes ;; ia64-*-*) @@ -302,7 +301,7 @@ powerpc*-*-*) extra_headers="ppc-asm.h altivec.h spe.h" need_64bit_hwint=yes case x$with_cpu in - xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345]|xrs64a) + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456]|xrs64a) cpu_is_64bit=yes ;; esac @@ -310,6 +309,9 @@ powerpc*-*-*) rs6000*-*-*) need_64bit_hwint=yes ;; +score*-*-*) + cpu_type=score + ;; sparc64*-*-*) cpu_type=sparc need_64bit_hwint=yes @@ -318,10 +320,11 @@ sparc*-*-*) cpu_type=sparc ;; s390*-*-*) + cpu_type=s390 need_64bit_hwint=yes ;; # Note the 'l'; we need to be able to match e.g. "shle" or "shl". -sh[123456789l]*-*-*) +sh[123456789lbe]*-*-*) cpu_type=sh need_64bit_hwint=yes ;; @@ -340,6 +343,10 @@ if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def then extra_modes=${cpu_type}/${cpu_type}-modes.def fi +if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt +then + extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt" +fi case ${target} in x86_64-*-*) @@ -358,13 +365,20 @@ esac case ${target} in *-*-darwin*) tm_file="${tm_file} darwin.h" + case ${target} in + *-*-darwin9*) + tm_file="${tm_file} darwin9.h" + ;; + esac + tm_file="${tm_file} ${cpu_type}/darwin.h" tm_p_file="${tm_p_file} darwin-protos.h" - tmake_file="t-darwin" + tmake_file="t-darwin ${cpu_type}/t-darwin t-slibgcc-darwin" target_gtfiles="\$(srcdir)/config/darwin.c" + extra_options="${extra_options} darwin.opt" c_target_objs="darwin-c.o" cxx_target_objs="darwin-c.o" - extra_parts="crt2.o" extra_objs="darwin.o" + default_use_cxa_atexit=yes case ${enable_threads} in "" | yes | posix) thread_file='posix' ;; esac @@ -433,35 +447,36 @@ case ${target} in ;; esac ;; - *) + *) echo 'Unknown thread configuration for FreeBSD' exit 1 ;; esac fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h" ;; -*-*-kfreebsd*-gnu) - # Must come before *-*-gnu* - xm_defines=POSIX # needed for cross-compiling from FreeBSD? - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" - # GNU tools are the only tools. - gas=yes - gnu_ld=yes - case ${enable_threads} in - "" | yes | posix) thread_file='posix' ;; - esac - ;; *-*-linux*libc1* | *-*-linux*aout*) # Avoid the generic linux case. ;; -*-*-linux*) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) # Must come before *-*-gnu* (because of *-*-linux-gnu* systems). extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + extra_options="${extra_options} linux.opt" gas=yes gnu_ld=yes case ${enable_threads} in "" | yes | posix) thread_file='posix' ;; esac + tmake_file="t-slibgcc-elf-ver t-linux" + case ${target} in + *-*-*uclibc*) + tm_defines="${tm_defines} UCLIBC_DEFAULT=1" + ;; + *) + tm_defines="${tm_defines} UCLIBC_DEFAULT=0" + ;; + esac + # Assume that glibc or uClibc are being used and so __cxa_atexit is provided. + default_use_cxa_atexit=yes ;; *-*-gnu*) # On the Hurd, the setup is just about the same on @@ -483,6 +498,8 @@ case ${target} in tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h gnu.h ${tm_file}" ;; esac + # Assume that glibc is being used and so __cxa_atexit is provided. + default_use_cxa_atexit=yes ;; *-*-netbsd*) tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic" @@ -531,6 +548,10 @@ case ${target} in tmake_file="${tmake_file} t-openbsd-thread" ;; esac + case ${target} in + *-*-openbsd2.*|*-*-openbsd3.[012]) + tm_defines="${tm_defines} HAS_LIBC_R=1" ;; + esac ;; *-*-rtems*) case ${enable_threads} in @@ -539,14 +560,18 @@ case ${target} in ;; *-*-vxworks*) tmake_file=t-vxworks - tm_file="${tm_file} elfos.h svr4.h vxworks.h" + tm_file="${tm_file} elfos.h svr4.h" + xm_defines=POSIX + extra_options="${extra_options} vxworks.opt" case ${enable_threads} in no) ;; "" | yes | vxworks) thread_file='vxworks' ;; *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;; esac - use_collect2=yes - xm_defines=POSIX + ;; +*-*-elf) + # Assume that newlib is being used and so __cxa_atexit is provided. + default_use_cxa_atexit=yes ;; esac @@ -574,7 +599,7 @@ alpha*-*-unicosmk*) alpha*-*-linux*) tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h" target_cpu_default="MASK_GAS" - tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtfm alpha/t-alpha alpha/t-ieee" + tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee alpha/t-linux" ;; alpha*-*-gnu*) target_cpu_default="MASK_GAS" @@ -592,7 +617,7 @@ alpha*-*-netbsd*) tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee" ;; alpha*-*-openbsd*) - tm_defines="OBSD_NO_DYNAMIC_LIBRARIES OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT" + tm_defines="${tm_defines} OBSD_NO_DYNAMIC_LIBRARIES OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT" tm_file="alpha/alpha.h openbsd.h alpha/openbsd.h" # default x-alpha is only appropriate for dec-osf. target_cpu_default="MASK_GAS" @@ -613,15 +638,15 @@ alpha*-dec-osf[45]*) extra_headers=va_list.h case ${target} in *-*-osf4*) - # Set target_cpu_default except on 4.0a. + # Define TARGET_SUPPORT_ARCH except on 4.0a. case ${target} in *-*-osf4.0a) ;; - *) target_cpu_default=MASK_SUPPORT_ARCH + *) tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1" esac ;; *-*-osf5*) tm_file="${tm_file} alpha/osf5.h" - target_cpu_default=MASK_SUPPORT_ARCH + tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1" ;; esac case ${enable_threads} in @@ -652,65 +677,102 @@ arc-*-elf*) ;; arm-*-coff* | armel-*-coff*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h" - tmake_file=arm/t-arm-coff + tmake_file="arm/t-arm arm/t-arm-coff" ;; arm-semi-aof | armel-semi-aof) tm_file="arm/semiaof.h arm/aof.h arm/arm.h" - tmake_file=arm/t-semi + tmake_file="arm/t-arm arm/t-semi" ;; arm-wrs-vxworks) tm_file="dbxelf.h elfos.h svr4.h vxworks.h arm/elf.h arm/aout.h arm/arm.h arm/vxworks.h" - tmake_file="${tmake_file} arm/t-vxworks" + tmake_file="${tmake_file} arm/t-arm arm/t-vxworks" ;; arm*-*-freebsd*|strongarm*-*-freebsd*) tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h arm/aout.h arm/freebsd.h arm/arm.h" - tmake_file="${tmake_file} arm/t-strongarm-elf" + tmake_file="${tmake_file} arm/t-arm arm/t-strongarm-elf" ;; arm*-*-netbsdelf*) tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h" - tmake_file="${tmake_file} arm/t-netbsd" + tmake_file="${tmake_file} arm/t-arm arm/t-netbsd" ;; arm*-*-netbsd*) tm_file="arm/aout.h arm/arm.h netbsd.h netbsd-aout.h arm/netbsd.h" - tmake_file="t-netbsd arm/t-netbsd" + tmake_file="t-netbsd arm/t-arm arm/t-netbsd" extra_parts="" use_collect2=yes ;; arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" - tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes + tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" + tmake_file="${tmake_file} t-linux arm/t-arm" + case ${target} in + arm*-*-linux-*eabi) + tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h" + tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" + # The BPABI long long divmod functions return a 128-bit value in + # registers r0-r3. Correctly modeling that requires the use of + # TImode. + need_64bit_hwint=yes + # The EABI requires the use of __cxa_atexit. + default_use_cxa_atexit=yes + ;; + *) + tmake_file="$tmake_file arm/t-linux" + ;; + esac + tm_file="$tm_file arm/aout.h arm/arm.h" ;; arm*-*-uclinux*) # ARM ucLinux tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h arm/uclinux-elf.h" - tmake_file=arm/t-arm-elf + tmake_file="arm/t-arm arm/t-arm-elf" ;; arm*-*-ecos-elf) tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h" - tmake_file=arm/t-arm-elf + tmake_file="arm/t-arm arm/t-arm-elf" + ;; +arm*-*-eabi* | arm*-*-symbianelf* ) + # The BPABI long long divmod functions return a 128-bit value in + # registers r0-r3. Correctly modeling that requires the use of + # TImode. + need_64bit_hwint=yes + default_use_cxa_atexit=yes + tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h" + tmake_file="arm/t-arm arm/t-arm-elf" + case ${target} in + arm*-*-eabi*) + tmake_file="${tmake_file} arm/t-bpabi" + ;; + arm*-*-symbianelf*) + tm_file="${tm_file} arm/symbian.h" + # We do not include t-bpabi for Symbian OS because the system + # provides its own implementation of the BPABI functions. + tmake_file="${tmake_file} arm/t-symbian" + ;; + esac + tm_file="${tm_file} arm/aout.h arm/arm.h" ;; arm*-*-rtems*) tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/rtems-elf.h rtems.h" - tmake_file="arm/t-arm-elf t-rtems arm/t-rtems" + tmake_file="arm/t-arm arm/t-arm-elf t-rtems arm/t-rtems" ;; arm*-*-elf | ep9312-*-elf) tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h" - tmake_file=arm/t-arm-elf + tmake_file="arm/t-arm arm/t-arm-elf" ;; arm*-wince-pe*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h" - tmake_file=arm/t-wince-pe + tmake_file="arm/t-arm arm/t-wince-pe" + extra_options="${extra_options} arm/pe.opt" extra_objs="pe.o" ;; arm-*-pe*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h" - tmake_file=arm/t-pe + tmake_file="arm/t-arm arm/t-pe" + extra_options="${extra_options} arm/pe.opt" extra_objs="pe.o" ;; arm*-*-kaos*) tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h kaos.h arm/kaos-arm.h" - tmake_file=arm/t-arm-elf + tmake_file="arm/t-arm arm/t-arm-elf" ;; avr-*-rtems*) tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h" @@ -720,6 +782,25 @@ avr-*-*) tm_file="avr/avr.h dbxelf.h" use_fixproto=yes ;; +bfin*-elf*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" + tmake_file=bfin/t-bfin-elf + use_collect2=no + ;; +bfin*-uclinux*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/uclinux.h" + tmake_file=bfin/t-bfin-elf + use_collect2=no + ;; +bfin*-rtems*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h" + tmake_file="bfin/t-bfin t-rtems bfin/t-rtems" + ;; +bfin*-*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" + tmake_file=bfin/t-bfin + use_collect2=no + ;; c4x-*-rtems* | tic4x-*-rtems*) tmake_file="c4x/t-c4x t-rtems c4x/t-rtems" tm_file="c4x/c4x.h c4x/rtems.h rtems.h" @@ -735,21 +816,24 @@ cris-*-aout) tm_file="dbxelf.h ${tm_file} cris/aout.h" gas=yes tmake_file="cris/t-cris cris/t-aout" + extra_options="${extra_options} cris/aout.opt" ;; cris-*-elf | cris-*-none) tm_file="dbxelf.h elfos.h ${tm_file}" tmake_file="cris/t-cris cris/t-elfmulti" gas=yes + extra_options="${extra_options} cris/elf.opt" ;; cris-*-linux*) tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h" + # We need to avoid using t-linux, so override default tmake_file tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux" + extra_options="${extra_options} cris/linux.opt" ;; -d30v-*) - tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" - ;; -dsp16xx-*) - use_fixproto=yes +crx-*-elf) + tm_file="elfos.h ${tm_file}" + extra_parts="crtbegin.o crtend.o" + use_collect2=no ;; fr30-*-elf) tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" @@ -762,10 +846,19 @@ frv-*-elf) tmake_file=frv/t-frv use_fixproto=yes ;; -h8300-*-rtems*) +frv-*-*linux*) + tm_file="dbxelf.h elfos.h svr4.h ${tm_file} \ + linux.h frv/linux.h frv/frv-abi.h" + tmake_file="${tmake_file} frv/t-frv frv/t-linux" + ;; +h8300-*-rtemscoff*) tmake_file="h8300/t-h8300 t-rtems h8300/t-rtems" tm_file="h8300/h8300.h dbxcoff.h h8300/coff.h h8300/rtems.h rtems.h" ;; +h8300-*-rtems*) + tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems" + tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h" + ;; h8300-*-elf*) tmake_file="h8300/t-h8300 h8300/t-elf" tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h" @@ -776,22 +869,23 @@ h8300-*-*) use_fixproto=yes ;; hppa*64*-*-linux* | parisc*64*-*-linux*) - target_cpu_default="(MASK_PA_11 | MASK_PA_20)" + target_cpu_default="MASK_PA_11|MASK_PA_20" tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h svr4.h linux.h \ pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h pa/pa64-linux.h" - tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux64" + tmake_file="${tmake_file} pa/t-linux64" gas=yes gnu_ld=yes need_64bit_hwint=yes ;; hppa*-*-linux* | parisc*-*-linux*) - target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS" + target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS" tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h pa/pa-linux.h \ pa/pa32-regs.h pa/pa32-linux.h" - tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux" - # if not configured with --enable-sjlj-exceptions, bump the - # libgcc version number - if test x$sjlj != x1; then - tmake_file="$tmake_file pa/t-slibgcc-elf-ver" + tmake_file="${tmake_file} pa/t-linux" + # Set the libgcc version number + if test x$sjlj = x1; then + tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver" + else + tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver" fi ;; # port not yet contributed. @@ -799,8 +893,9 @@ hppa*-*-linux* | parisc*-*-linux*) # target_cpu_default="MASK_PA_11" # ;; hppa1.1-*-pro*) - target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)" - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h" + target_cpu_default="MASK_PORTABLE_RUNTIME|MASK_NO_SPACE_REGS|MASK_SOFT_FLOAT" + tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h \ + pa/pa-pro-end.h libgloss.h" tmake_file="pa/t-pro" ;; hppa1.1-*-osf*) @@ -809,137 +904,141 @@ hppa1.1-*-osf*) tmake_file="pa/t-pa" use_collect2=yes ;; -hppa1.1-*-rtems*) - target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)" - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h pa/rtems.h rtems.h" - tmake_file="pa/t-pro t-rtems" - ;; hppa1.1-*-bsd*) - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h" target_cpu_default="MASK_PA_11" + tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h" tmake_file="pa/t-pa" use_collect2=yes ;; -hppa1.1-*-hpux10* | hppa2*-*-hpux10*) - target_cpu_default="MASK_PA_11" - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h" - tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" - if test x$enable_threads = x; then - enable_threads=$have_pthread_h - fi - case x${enable_threads} in - xyes | xdce) - tmake_file="${tmake_file} pa/t-dce-thr" +hppa[12]*-*-hpux10*) + case ${target} in + hppa1.1-*-* | hppa2*-*-*) + target_cpu_default="MASK_PA_11" ;; esac - use_collect2=yes - use_fixproto=yes - ;; -hppa1.0-*-hpux10*) - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h" - tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" - if test x$enable_threads = x; then - enable_threads=$have_pthread_h - fi - case x${enable_threads} in - xyes | xdce) - tmake_file="${tmake_file} pa/t-dce-thr" + tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \ + pa/pa-hpux.h pa/pa-hpux10.h" + extra_options="${extra_options} pa/pa-hpux.opt" + case ${target} in + *-*-hpux10.[1-9]*) + tm_file="${tm_file} pa/pa-hpux1010.h" + extra_options="${extra_options} pa/pa-hpux1010.opt" ;; esac + tmake_file="pa/t-pa-hpux10 pa/t-pa-hpux pa/t-hpux-shlib" + case ${enable_threads} in + "") + if test x$have_pthread_h = xyes ; then + tmake_file="${tmake_file} pa/t-dce-thr" + fi + ;; + yes | dce) + tmake_file="${tmake_file} pa/t-dce-thr" + ;; + esac + # Set the libgcc version number + if test x$sjlj = x1; then + tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver" + else + tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver" + fi use_collect2=yes use_fixproto=yes + gas=yes ;; hppa*64*-*-hpux11*) - if test x$gas = xyes - then - tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \ - pa/pa64-regs.h pa/pa-hpux.h \ - pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h" - else - tm_file="pa/pa64-start.h ${tm_file} dbxelf.h pa/elf.h \ - pa/pa64-regs.h pa/pa-hpux.h \ - pa/pa-hpux11.h pa/pa-64.h pa/pa64-hpux.h" - fi - need_64bit_hwint=yes - tmake_file="pa/t-pa64 pa/t-pa-hpux" - target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)" - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" + target_cpu_default="MASK_PA_11|MASK_PA_20" if test x$gnu_ld = xyes then target_cpu_default="${target_cpu_default}|MASK_GNU_LD" fi - case x${enable_threads} in - xyes | xposix ) - thread_file=posix + tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \ + pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \ + pa/pa-hpux11.h" + case ${target} in + *-*-hpux11.[1-9]*) + tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h" + extra_options="${extra_options} pa/pa-hpux1111.opt" + ;; + *) + tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h" ;; esac - ;; -hppa1.1-*-hpux11* | hppa2*-*-hpux11*) - target_cpu_default="MASK_PA_11" - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h" - tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" + extra_options="${extra_options} pa/pa-hpux.opt \ + pa/pa-hpux1010.opt pa/pa64-hpux.opt" + need_64bit_hwint=yes + tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib" + # Set the libgcc version number + if test x$sjlj = x1; then + tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver" + else + tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver" + fi + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \ + libgcc_stub.a" case x${enable_threads} in - xyes | xposix ) - thread_file=posix + x | xyes | xposix ) + thread_file=posix + ;; + esac + gas=yes + ;; +hppa[12]*-*-hpux11*) + case ${target} in + hppa1.1-*-* | hppa2*-*-*) + target_cpu_default="MASK_PA_11" + ;; + esac + tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \ + pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h" + extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt" + case ${target} in + *-*-hpux11.[1-9]*) + tm_file="${tm_file} pa/pa-hpux1111.h" + extra_options="${extra_options} pa/pa-hpux1111.opt" + ;; + esac + tmake_file="pa/t-pa-hpux11 pa/t-pa-hpux pa/t-hpux-shlib" + # Set the libgcc version number + if test x$sjlj = x1; then + tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver" + else + tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver" + fi + case x${enable_threads} in + x | xyes | xposix ) + thread_file=posix ;; esac use_collect2=yes - ;; -hppa1.0-*-hpux11*) - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h" - tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" - case x${enable_threads} in - xyes | xposix ) - thread_file=posix - ;; - esac - use_collect2=yes - ;; -i370-*-opened*) # IBM 360/370/390 Architecture - xm_defines='FATAL_EXIT_CODE=12' - tm_file="i370/oe.h i370/i370.h" - tmake_file="i370/t-i370" - c_target_objs="i370-c.o" - cxx_target_objs="i370-c.o" - # Don't bother fixing up header files; they're weird. - ;; -i370-*-mvs*) - xm_defines='FATAL_EXIT_CODE=12' - tm_file="i370/mvs.h i370/i370.h" - tmake_file="i370/t-i370" - c_target_objs="i370-c.o" - cxx_target_objs="i370-c.o" - use_fixproto=yes - ;; -i370-*-linux*) - tm_file="dbxelf.h elfos.h svr4.h linux.h i370/linux.h i370/i370.h" - tmake_file="t-slibgcc-elf-ver t-linux" - # broken_install=yes + gas=yes ;; i[34567]86-*-darwin*) - tm_file="${tm_file} i386/darwin.h" + need_64bit_hwint=yes + + # This is so that '.../configure && make' doesn't fail due to + # config.guess deciding that the configuration is i386-*-darwin* and + # then this file using that to set --with-cpu=i386 which has no -m64 + # support. + with_arch=${with_arch:-nocona} + with_cpu=${with_cpu:-generic} + ;; +x86_64-*-darwin*) + with_arch=${with_arch:-nocona} + with_cpu=${with_cpu:-generic} + tmake_file="t-darwin ${cpu_type}/t-darwin64 t-slibgcc-darwin" + tm_file="${tm_file} ${cpu_type}/darwin64.h" ;; i[34567]86-*-elf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h" tmake_file="i386/t-i386elf t-svr4" use_fixproto=yes ;; -i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4 - xm_defines="SMALL_ARG_MAX" - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h" - extra_parts="crtbegin.o crtend.o" - tmake_file=i386/t-crtpic - use_fixproto=yes - ;; -i[34567]86-*-netware) # Intel 80386's running netware - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h netware.h i386/netware.h" - ;; i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*) if test x$gas = xyes then tm_file="${tm_file} usegas.h" fi - xm_defines="SMALL_ARG_MAX" tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ptx4.h i386/ptx4-i.h" tmake_file=t-svr4 extra_parts="crtbegin.o crtend.o" @@ -954,10 +1053,6 @@ i[34567]86-*-beoself* | i[34567]86-*-beos*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/beos-elf.h" extra_parts='crtbegin.o crtend.o' ;; -i[34567]86-*-freebsd2 | i[34567]86-*-freebsd2.* | i[34567]86-*-freebsd*aout*) - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/freebsd-aout.h" - tmake_file=t-freebsd - ;; i[34567]86-*-freebsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h" ;; @@ -976,50 +1071,41 @@ i[34567]86-*-netbsd*) x86_64-*-netbsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" ;; -i[34567]86-*-openbsd*) +i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h" # needed to unconfuse gdb tmake_file="t-libc-ok t-openbsd i386/t-openbsd" # we need collect2 until our bug is fixed... use_collect2=yes ;; +i[34567]86-*-openbsd*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h" + tm_file="${tm_file} openbsd.h i386/openbsdelf.h" + gas=yes + gnu_ld=yes + ;; i[34567]86-*-coff*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h" use_fixproto=yes ;; -i[34567]86-*-linux*aout*) # Intel 80386's running GNU/Linux - # with a.out format - tmake_file="i386/t-crtstuff" - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h linux-aout.h i386/linux-aout.h" - gnu_ld=yes - ;; -i[34567]86-*-linux*libc1) # Intel 80386's running GNU/Linux - # with ELF format using the - # GNU/Linux C library 5 - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 i386/t-crtstuff" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes - if test x$enable_threads = xyes; then - thread_file='single' - fi - ;; -i[34567]86-*-linux*) # Intel 80386's running GNU/Linux +i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu) + # Intel 80386's running GNU/* # with ELF format using glibc 2 - # aka GNU/Linux C library 6 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff" + case ${target} in + i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h i386/knetbsd-gnu.h" ;; + i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;; + esac + tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtfm t-dfprules" ;; -x86_64-*-linux*) +x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \ i386/x86-64.h i386/linux64.h" - tmake_file="t-slibgcc-elf-ver t-linux i386/t-linux64" - ;; -i[34567]86-*-kfreebsd*-gnu) # must be before i[34567]86-*-gnu* - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h kfreebsdgnu.h i386/kfreebsdgnu.h" - tmake_file="t-slibgcc-elf-ver t-kfreebsd-gnu i386/t-crtstuff" - float_format=i386 - use_fixproto=no + case ${target} in + x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;; + x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;; + esac + tmake_file="${tmake_file} i386/t-linux64 i386/t-crtfm t-dfprules" ;; i[34567]86-*-gnu*) ;; @@ -1027,30 +1113,38 @@ i[34567]86-pc-msdosdjgpp*) xm_file=i386/xm-djgpp.h tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h" tmake_file=i386/t-djgpp + extra_options="${extra_options} i386/djgpp.opt" gnu_ld=yes gas=yes ;; -i[34567]86-moss-msdos* | i[34567]86-*-moss*) - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h i386/moss.h" - tmake_file=t-libc-ok - gnu_ld=yes - gas=yes - use_fixproto=yes - ;; i[34567]86-*-lynxos*) - if test x$gas = xyes - then - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h svr3.h lynx.h i386/lynx.h" - else - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h lynx-ng.h i386/lynx-ng.h" - fi - use_fixproto=yes + xm_defines=POSIX + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h" + tmake_file="i386/t-crtstuff t-lynx" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + extra_options="${extra_options} lynx.opt" + thread_file=lynx + gnu_ld=yes + gas=yes ;; -i[34567]86-*-mach*) - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h i386/mach.h" -# tmake_file=t-libc-ok - use_collect2=yes - use_fixproto=yes +i[3456x]86-*-netware*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h tm-dwarf2.h i386/netware.h" + tmake_file=i386/t-netware + extra_objs=netware.o + case /${with_ld} in + */nwld) + extra_objs="$extra_objs nwld.o" + tm_file="${tm_file} i386/nwld.h" + tmake_file="${tmake_file} i386/t-nwld" + extra_parts="crt0.o libgcc.def libc.def libcpre.def posixpre.def" + ;; + esac + case x${enable_threads} in + x | xyes | xposix) thread_file='posix';; + xnks) thread_file='nks';; + xno) ;; + *) echo 'Unknown thread configuration for NetWare' >&2; exit 1;; + esac ;; i[34567]86-*-nto-qnx*) tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/unix.h i386/nto.h" @@ -1071,36 +1165,82 @@ i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5 fi tmake_file=i386/t-sco5 extra_parts="crtbegin.o crtend.o" + extra_options="${extra_options} i386/sco5.opt" use_fixproto=yes ;; i[34567]86-*-solaris2*) - xm_defines="SMALL_ARG_MAX" - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h i386/sol2.h" - tmake_file="i386/t-sol2 t-svr4" + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h" + case ${target} in + *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) + tm_file="${tm_file} sol2-6.h" + ;; + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; + esac + tm_file="${tm_file} i386/sol2.h" + tmake_file="t-sol2 i386/t-sol2 t-svr4" + c_target_objs="sol2-c.o" + cxx_target_objs="sol2-c.o" + extra_objs="sol2.o" + tm_p_file="${tm_p_file} sol2-protos.h" if test x$gnu_ld = xyes; then tmake_file="$tmake_file t-slibgcc-elf-ver" + tm_defines="${tm_defines} TARGET_GNU_LD=1" else tmake_file="$tmake_file t-slibgcc-sld" fi + if test x$gas = xyes; then + tm_file="usegas.h ${tm_file}" + fi case ${target} in - *-*-solaris2.[789] | *-*-solaris2.1[0-9]) + *-*-solaris2.[789] | *-*-solaris2.1[0-9]*) tm_file="$tm_file tm-dwarf2.h" ;; esac - extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o" - if test x${enable_threads} = x; then - enable_threads=$have_pthread_h - if test x${enable_threads} = x; then - enable_threads=$have_thread_h - fi - fi - if test x${enable_threads} = xyes; then - if test x${have_pthread_h} = xyes; then - thread_file='posix' - else - thread_file='solaris' - fi - fi + case ${target} in + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" + tm_defines="${tm_defines} TARGET_BI_ARCH=1" + tmake_file="$tmake_file i386/t-sol2-10" + need_64bit_hwint=yes + # FIXME: -m64 for i[34567]86-*-* should be allowed just + # like -m32 for x86_64-*-*. + case X"${with_cpu}" in + Xgeneric|Xnocona|Xx86-64|Xk8|Xopteron|Xathlon64|Xathlon-fx) + ;; + X) + with_cpu=generic + ;; + *) + echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 + echo "generic nocona x86-64 k8 opteron athlon64 athlon-fx" 1>&2 + exit 1 + ;; + esac + # Solaris 2.10 provides crt1.o, crti.o, crtn.o, and gcrt1.o as + # part of the base system. + extra_parts="gmon.o crtbegin.o crtend.o" + ;; + *) + extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o" + ;; + esac + case ${enable_threads}:${have_pthread_h}:${have_thread_h} in + "":yes:* | yes:yes:* ) + case ${target} in + *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) + thread_file=posix95 + ;; + *) + thread_file=posix + ;; + esac + ;; + "":*:yes | yes:*:yes ) + thread_file=solaris + ;; + esac ;; i[34567]86-*-sysv5*) # Intel x86 on System V Release 5 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv5.h" @@ -1116,7 +1256,6 @@ i[34567]86-*-sysv5*) # Intel x86 on System V Release 5 use_fixproto=yes ;; i[34567]86-*-sysv4*) # Intel 80386's running system V.4 - xm_defines="SMALL_ARG_MAX" tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h" if test x$stabs = xyes then @@ -1126,49 +1265,28 @@ i[34567]86-*-sysv4*) # Intel 80386's running system V.4 extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; -i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit - tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv5.h i386/udk.h" - tmake_file="i386/t-crtpic i386/t-udk t-svr4" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; -i[34567]86-*-sysv*) # Intel 80386's running system V - if test x$gas = xyes - then - if test x$stabs = xyes - then - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/svr3gas.h i386/svr3dbx.h" - tmake_file=i386/t-svr3dbx - extra_parts="svr3.ifile svr3z.ifile" - else - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/svr3gas.h" - extra_parts="crtbegin.o crtend.o" - tmake_file=i386/t-crtstuff - fi - else - tm_file="${tm_file} svr3.h i386/unix.h i386/att.h i386/sysv3.h" - extra_parts="crtbegin.o crtend.o" - tmake_file=i386/t-crtstuff - fi - tmake_file="$tmake_file i386/t-crtpic" - use_fixproto=yes - ;; -i386-*-vsta) # Intel 80386's running VSTa kernel - xm_file="i386/xm-vsta.h" - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/vsta.h" - use_fixproto=yes - ;; -i[4567]86-wrs-vxworks) - tm_file="${tm_file} i386/sysv4.h i386/unix.h i386/vxworks.h" - tmake_file="${tmake_file} i386/t-vxworks" +i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae) + tm_file="${tm_file} i386/sysv4.h i386/unix.h i386/att.h vx-common.h" + case ${target} in + *-vxworksae*) + tm_file="${tm_file} vxworksae.h i386/vxworksae.h" + tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae" + ;; + *) + tm_file="${tm_file} vxworks.h i386/vxworks.h" + tmake_file="${tmake_file} i386/t-vxworks" + ;; + esac ;; i[34567]86-*-pe | i[34567]86-*-cygwin*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h" xm_file=i386/xm-cygwin.h tmake_file="i386/t-cygwin i386/t-cygming" - extra_objs=winnt.o + target_gtfiles="\$(srcdir)/config/i386/winnt.c" + extra_options="${extra_options} i386/cygming.opt" + extra_objs="winnt.o winnt-stubs.o" c_target_objs=cygwin2.o - cxx_target_objs=cygwin2.o + cxx_target_objs="cygwin2.o winnt-cxx.o" extra_gcc_objs=cygwin1.o if test x$enable_threads = xyes; then thread_file='posix' @@ -1178,10 +1296,16 @@ i[34567]86-*-mingw32*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h" xm_file=i386/xm-mingw32.h tmake_file="i386/t-cygming i386/t-mingw32" - extra_objs=winnt.o - if test x$enable_threads = xyes; then - thread_file='win32' - fi + target_gtfiles="\$(srcdir)/config/i386/winnt.c" + extra_options="${extra_options} i386/cygming.opt" + extra_objs="winnt.o winnt-stubs.o" + cxx_target_objs=winnt-cxx.o + case ${enable_threads} in + "" | yes | win32) + thread_file='win32' + tmake_file="${tmake_file} i386/t-gthr-win32" + ;; + esac case ${target} in *mingw32crt*) tm_file="${tm_file} i386/crtdll.h" @@ -1194,6 +1318,8 @@ i[34567]86-*-uwin*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h i386/uwin.h" tmake_file="i386/t-cygwin i386/t-uwin" extra_objs=winnt.o + extra_options="${extra_options} i386/cygming.opt" + target_gtfiles="\$(srcdir)/config/i386/winnt.c" if test x$enable_threads = xyes; then thread_file='win32' fi @@ -1203,17 +1329,7 @@ i[34567]86-*-interix3*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h" tmake_file="i386/t-interix" extra_objs=winnt.o - if test x$enable_threads = xyes ; then - thread_file='posix' - fi - if test x$stabs = xyes ; then - tm_file="${tm_file} dbxcoff.h" - fi - ;; -i[34567]86-*-interix*) - tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h interix.h" - tmake_file="i386/t-interix" - extra_objs=winnt.o + target_gtfiles="\$(srcdir)/config/i386/winnt.c" if test x$enable_threads = xyes ; then thread_file='posix' fi @@ -1225,31 +1341,6 @@ i[34567]86-*-kaos*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h kaos.h i386/kaos-i386.h" tmake_file="i386/t-i386elf t-svr4" ;; -i860-*-sysv4*) - tm_file="${tm_file} elfos.h svr4.h i860/sysv4.h" - tmake_file="i860/t-i860 i860/t-svr4" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; -i960-*-coff*) - tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h" - tmake_file=i960/t-960bare - c_target_objs="i960-c.o" - cxx_target_objs="i960-c.o" - ;; -i960-*-rtems) - tmake_file="i960/t-960bare t-rtems" - tm_file="${tm_file} dbxcoff.h i960/i960-coff.h i960/rtems.h rtems.h" - c_target_objs="i960-c.o" - cxx_target_objs="i960-c.o" - ;; -i960-*-*) # Default i960 environment. - use_collect2=yes - tmake_file=i960/t-960bare - c_target_objs="i960-c.o" - cxx_target_objs="i960-c.o" - use_fixproto=yes - ;; ia64*-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/elf.h" tmake_file="ia64/t-ia64" @@ -1273,7 +1364,7 @@ ia64*-*-freebsd*) ;; ia64*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 t-libunwind ia64/t-glibc" + tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc" if test x$with_system_libunwind != xyes ; then tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind" fi @@ -1292,14 +1383,11 @@ ia64*-*-hpux*) use_collect2=no c_target_objs="ia64-c.o" cxx_target_objs="ia64-c.o" + extra_options="${extra_options} ia64/ilp32.opt" # If we decide to run fixproto we should define FIXPROTO_DEFINES # in ia64/t-hpux, and also fix the definition of putenv in # sys-protos.h (const char not char). ;; -ip2k-*-elf) - tm_file="elfos.h ${tm_file}" - use_fixproto=yes - ;; iq2000*-*-elf*) tm_file="svr4.h elfos.h iq2000/iq2000.h" tmake_file=iq2000/t-iq2000 @@ -1319,8 +1407,8 @@ m32rle-*-elf*) ;; m32r-*-linux*) tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} m32r/linux.h" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - tmake_file="m32r/t-linux" + # We override the tmake_file for linux -- why? + tmake_file="t-slibgcc-elf-ver m32r/t-linux" gnu_ld=yes use_fixproto=yes if test x$enable_threads = xyes; then @@ -1329,8 +1417,8 @@ m32r-*-linux*) ;; m32rle-*-linux*) tm_file="dbxelf.h elfos.h svr4.h linux.h m32r/little.h ${tm_file} m32r/linux.h" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - tmake_file="m32r/t-linux" + # We override the tmake_file for linux -- why? + tmake_file="t-slibgcc-elf-ver m32r/t-linux" gnu_ld=yes use_fixproto=yes if test x$enable_threads = xyes; then @@ -1352,59 +1440,28 @@ m68hc12-*-*|m6812-*-*) md_file="m68hc11/m68hc11.md" out_file="m68hc11/m68hc11.c" tmake_file="m68hc11/t-m68hc11-gas" + extra_options="${extra_options} m68hc11/m68hc11.opt" use_fixproto=yes ;; -m68000-hp-hpux*) # HP 9000 series 300 - tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h m68k/hp310.h" - tm_defines="TARGET_DEFAULT=0" # 68000, no 68881, no bitfield ops - if test x$gas = xyes - then - tm_defines="${tm_defines} DBX_DEBUGGING_INFO=1 USE_GAS" - fi - tmake_file=m68k/t-hp320 - use_collect2=yes - use_fixproto=yes - ;; -m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7. - tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h" - if test x$gas = xyes - then - tm_defines="DBX_DEBUGGING_INFO=1 USE_GAS" - else - tm_defines="NO_DOT_IN_LABEL NO_BUGS" - fi - use_collect2=yes - use_fixproto=yes - ;; -m68k-hp-hpux*) # HP 9000 series 300 - tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h" - if test x$gas = xyes - then - tm_defines="DBX_DEBUGGING_INFO=1 USE_GAS" - fi - use_collect2=yes - use_fixproto=yes - ;; m68k-*-aout*) tmake_file=m68k/t-m68kbare tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h m68k/m68k-aout.h libgloss.h" ;; m68k-*-coff*) tmake_file=m68k/t-m68kbare - tm_defines="MOTOROLA USE_GAS" + tm_defines="${tm_defines} MOTOROLA USE_GAS" tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kemb.h dbxcoff.h m68k/coff.h dbx.h" use_fixproto=yes ;; m68020-*-elf* | m68k-*-elf*) tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h" - tm_defines="MOTOROLA USE_GAS" + tm_defines="${tm_defines} MOTOROLA USE_GAS" tmake_file=m68k/t-m68kelf extra_parts="crtbegin.o crtend.o" - use_fixproto=yes ;; m68010-*-netbsdelf* | m68k*-*-netbsdelf*) tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h" - tm_defines="MOTOROLA USE_GAS" + tm_defines="${tm_defines} MOTOROLA USE_GAS" case ${target} in m68010*) target_cpu_default="0" @@ -1414,37 +1471,17 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*) ;; esac ;; -m68k*-*-netbsd*) - if test "x$enable_obsolete" != xyes; then - echo "*** Configuration ${target} is obsolete." >&2 - echo "*** Specify --enable-obsolete to build it anyway." >&2 - echo "*** Support will be REMOVED in the next major release of GCC," >&2 - echo "*** unless a maintainer comes forward." >&2 - exit 1 - fi - tm_file="m68k/m68k.h netbsd.h netbsd-aout.h m68k/netbsd.h" - tmake_file=t-netbsd - extra_parts="" - use_collect2=yes - ;; m68k*-*-openbsd*) # needed to unconfuse gdb - tm_defines="OBSD_OLD_GAS TARGET_DEFAULT=(MASK_68020|MASK_68881|MASK_BITFIELD)" + tm_defines="${tm_defines} OBSD_OLD_GAS TARGET_DEFAULT=(MASK_68020|MASK_68881|MASK_BITFIELD)" tm_file="m68k/m68k.h openbsd.h m68k/openbsd.h" tmake_file="t-libc-ok t-openbsd m68k/t-openbsd" # we need collect2 until our bug is fixed... use_collect2=yes ;; -m68k-*-sysv4*) # Motorola m68k's running system V.4 - tm_file="m68k/m68k.h m68k/sgs.h dbxelf.h elfos.h svr4.h m68k/m68kv4.h" - tm_defines="MOTOROLA SGS SGS_CMP_ORDER SGS_SWITCH_TABLES" - tmake_file=t-svr4 - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/uclinux.h" - tm_defines="MOTOROLA USE_GAS" + tm_defines="${tm_defines} MOTOROLA USE_GAS" tmake_file=m68k/t-uclinux use_fixproto=no ;; @@ -1452,8 +1489,8 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux # with ELF format using glibc 2 # aka the GNU/Linux C library 6. tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h m68k/linux.h" - tm_defines="MOTOROLA USE_GAS" - tmake_file="t-slibgcc-elf-ver t-linux" + extra_options="${extra_options} m68k/ieee.opt" + tm_defines="${tm_defines} MOTOROLA USE_GAS" # if not configured with --enable-sjlj-exceptions, bump the # libgcc version number if test x$sjlj != x1; then @@ -1463,7 +1500,7 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux m68k-*-rtems*) tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems" tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h" - tm_defines="MOTOROLA USE_GAS" + tm_defines="${tm_defines} MOTOROLA USE_GAS" extra_parts="crtbegin.o crtend.o" ;; mcore-*-elf) @@ -1476,68 +1513,28 @@ mcore-*-pe*) tmake_file=mcore/t-mcore-pe use_fixproto=yes ;; -mips-sgi-irix6*) # SGI System V.4., IRIX 6 - tm_file="${tm_file} mips/iris5.h mips/iris6.h" - tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6" - if test x$gas = xyes - then - tm_file="${tm_file} mips/iris6gas.h" - fi - if test "x$gnu_ld" = xyes - then - tm_file="${tm_file} mips/iris6gld.h" - tmake_file="$tmake_file mips/t-irix-gld" - fi - target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT" - tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" - # See comment in mips/iris5.h file. Only enabled for O32 ABI - # without GNU as. - if test x$gas = xno - then - use_collect2=yes - fi -# if test x$enable_threads = xyes; then -# thread_file='irix' -# fi - use_fixproto=yes - ;; -mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64 - tm_file="${tm_file} mips/iris5.h mips/iris6.h mips/cross64.h" - tmake_file="mips/t-iris mips/t-cross64" - target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT" - tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" - # See comment in mips/iris[56].h files. - use_collect2=yes -# if test x$enable_threads = xyes; then -# thread_file='irix' -# fi - use_fixproto=yes - ;; -mips-sgi-irix5*) # SGI System V.4., IRIX 5 - tm_file="${tm_file} mips/iris5.h" - if test x$gas = xyes - then - tm_file="${tm_file} mips/sdb.h mips/iris5gas.h" - if test x$stabs = xyes - then - tm_file="${tm_file} dbx.h mips/dbxmdebug.h" - fi - tmake_file=mips/t-iris5-gas - else - tmake_file=mips/t-iris5-as - fi - if test "x$gnu_ld" = xyes - then - tm_file="${tm_file} mips/iris5gld.h" - tmake_file="$tmake_file mips/t-irix-gld" - fi - tmake_file="${tmake_file} mips/t-iris mips/t-iris5-6" +mips-sgi-irix[56]*) + tm_file="elfos.h ${tm_file} mips/iris.h" + tmake_file="mips/t-iris mips/t-slibgcc-irix" target_cpu_default="MASK_ABICALLS" - # mips-tfile doesn't work yet - # See comment in mips/iris5.h file. - if test x$gas = xno + case ${target} in + *-*-irix5*) + tm_file="${tm_file} mips/iris5.h" + ;; + + *-*-irix6*) + tm_file="${tm_file} mips/iris6.h" + tmake_file="${tmake_file} mips/t-iris6" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" + ;; + esac + if test "x$stabs" = xyes then - use_collect2=yes + tm_file="${tm_file} dbx.h mips/dbxmdebug.h" + fi + if test "x$gnu_ld" = xyes + then + tm_defines="${tm_defines} IRIX_USING_GNU_LD" fi # if test x$enable_threads = xyes; then # thread_file='irix' @@ -1545,21 +1542,13 @@ mips-sgi-irix5*) # SGI System V.4., IRIX 5 use_fixproto=yes ;; mips*-*-netbsd*) # NetBSD/mips, either endian. - target_cpu_default="MASK_GAS|MASK_ABICALLS" + target_cpu_default="MASK_ABICALLS" tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h" ;; mips64*-*-linux*) tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h mips/linux64.h" - tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux64" - - # This default ABI is a partial lie: t-linux64 overrides the - # DRIVER_SELF_SPEC that sets the default abi, in the spec file - # that is installed. What GCC thinks of as the default must - # remain as ABI_32 such that the SONAMEs of the libgcc shared - # libraries remain compatible with those of mips-linux-gnu. - tm_defines="MIPS_ISA_DEFAULT=1 MIPS_ABI_DEFAULT=ABI_32" - target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + tmake_file="${tmake_file} mips/t-linux64" + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32" gnu_ld=yes gas=yes ;; @@ -1568,82 +1557,79 @@ mips*-*-linux*) # Linux MIPS, either endian. case ${target} in mipsisa32*-*) target_cpu_default="MASK_SOFT_FLOAT" - tm_defines="MIPS_ISA_DEFAULT=32" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32" ;; esac - tmake_file="t-slibgcc-elf-ver t-linux" ;; mips*-*-openbsd*) - tm_defines="OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS" - target_cpu_default="MASK_GAS|MASK_ABICALLS" + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS" + target_cpu_default="MASK_ABICALLS" tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h" case ${target} in - mips*el-*-openbsd*) + mips*el-*-openbsd*) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";; *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";; esac ;; mipsisa32-*-elf* | mipsisa32el-*-elf*) - tm_file="${tm_file} mips/elf.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 - tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_EABI" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_EABI" use_fixproto=yes ;; mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*) - tm_file="${tm_file} mips/elf.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 - tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_EABI" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_EABI" use_fixproto=yes ;; mipsisa64-*-elf* | mipsisa64el-*-elf*) - tm_file="${tm_file} mips/elf.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 - target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" - tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_EABI" + target_cpu_default="MASK_64BIT|MASK_FLOAT64" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_EABI" use_fixproto=yes ;; mipsisa64sr71k-*-elf*) - tm_file="${tm_file} mips/elf.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-sr71k - target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" - tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI" + target_cpu_default="MASK_64BIT|MASK_FLOAT64" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI" use_fixproto=yes ;; mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*) - tm_file="${tm_file} mips/elf.h" - tmake_file=mips/t-elf - target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" - tm_defines="MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64" + tm_file="elfos.h ${tm_file} mips/elf.h" + tmake_file="mips/t-elf mips/t-sb1" + target_cpu_default="MASK_64BIT|MASK_FLOAT64" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64" use_fixproto=yes ;; mips-*-elf* | mipsel-*-elf*) - tm_file="${tm_file} mips/elf.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-elf use_fixproto=yes ;; mips64-*-elf* | mips64el-*-elf*) - tm_file="${tm_file} mips/elf64.h" + tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-elf - target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" - tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" + target_cpu_default="MASK_64BIT|MASK_FLOAT64" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" use_fixproto=yes ;; mips64vr-*-elf* | mips64vrel-*-elf*) - tm_file="mips/vr.h ${tm_file} mips/elf64.h" - tm_defines="MIPS_ABI_DEFAULT=ABI_O64 MIPS_MARCH_CONTROLS_SOFT_FLOAT=1" + tm_file="mips/vr.h elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-vr use_fixproto=yes ;; mips64orion-*-elf* | mips64orionel-*-elf*) - tm_file="${tm_file} mips/elforion.h mips/elf64.h" + tm_file="elfos.h ${tm_file} mips/elforion.h mips/elf.h" tmake_file=mips/t-elf - tmake_file=mips/t-elf - target_cpu_default="MASK_64BIT|MASK_FLOAT64|MASK_GAS" - tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" + target_cpu_default="MASK_64BIT|MASK_FLOAT64" + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64" use_fixproto=yes ;; mips*-*-rtems*) - tm_file="${tm_file} mips/elf.h mips/rtems.h rtems.h" + tm_file="elfos.h ${tm_file} mips/elf.h mips/rtems.h rtems.h" tmake_file="mips/t-elf t-rtems mips/t-rtems" ;; mips-wrs-vxworks) @@ -1651,17 +1637,15 @@ mips-wrs-vxworks) # have to redo the tm_file list from scratch. tm_file="elfos.h mips/mips.h svr4.h mips/elf.h vxworks.h mips/vxworks.h" tmake_file="${tmake_file} mips/t-vxworks" - target_cpu_default="MASK_GAS" ;; mips-wrs-windiss) # Instruction-level simulator for VxWorks. xm_defines=POSIX tm_file="elfos.h mips/mips.h svr4.h mips/elf.h windiss.h mips/windiss.h" tmake_file="${tmake_file} mips/t-elf" - target_cpu_default="MASK_GAS" thread_file= ;; mipstx39-*-elf* | mipstx39el-*-elf*) - tm_file="${tm_file} mips/r3900.h mips/elf.h" + tm_file="elfos.h ${tm_file} mips/r3900.h mips/elf.h" tmake_file=mips/t-r3900 use_fixproto=yes ;; @@ -1677,6 +1661,10 @@ mn10300-*-*) use_collect2=no use_fixproto=yes ;; +mt-*-elf) + tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" + tmake_file="${tmake_file} mt/t-mt" + ;; ns32k-*-netbsdelf*) echo "GCC does not yet support the ${target} target"; exit 1 ;; @@ -1696,7 +1684,7 @@ pdp11-*-*) ;; # port not yet contributed #powerpc-*-openbsd*) -# tmake_file="${tmake_file} rs6000/t-fprules " +# tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-fprules-fpbit " # extra_headers= # ;; powerpc64-*-linux*) @@ -1704,34 +1692,59 @@ powerpc64-*-linux*) test x$with_cpu != x || cpu_is_64bit=yes test x$cpu_is_64bit != xyes || tm_file="${tm_file} rs6000/default64.h" tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" - tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-linux rs6000/t-ppccomm rs6000/t-linux64" + if test x${enable_secureplt} = xyes; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" + tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp" ;; powerpc64-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h" - tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu rs6000/t-linux64" + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" + tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp" ;; powerpc-*-beos*) tm_file="${tm_file} rs6000/aix.h rs6000/beos.h rs6000/xcoff.h" - tmake_file="rs6000/t-fprules rs6000/t-beos" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-beos" extra_headers= use_fixproto=yes ;; powerpc-*-darwin*) - tm_file="${tm_file} rs6000/darwin.h" - tmake_file="t-darwin t-slibgcc-darwin rs6000/t-darwin" + extra_options="${extra_options} rs6000/darwin.opt" + extra_parts="crt2.o" + case ${target} in + *-darwin1[0-9]* | *-darwin[8-9]*) + tmake_file="${tmake_file} rs6000/t-darwin8" + tm_file="${tm_file} rs6000/darwin8.h" + ;; + *-darwin7*) + tm_file="${tm_file} rs6000/darwin7.h" + ;; + *-darwin[0-6]*) + ;; + esac + extra_headers=altivec.h + ;; +powerpc64-*-darwin*) + tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" + extra_options="${extra_options} ${cpu_type}/darwin.opt" + # We're omitting t-darwin8 to avoid building any multilibs extra_headers=altivec.h ;; powerpc*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-netbsd*) tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h" tmake_file="${tmake_file} rs6000/t-netbsd" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-chorusos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h chorus.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" case ${enable_threads} in yes | posix) thread_file='posix' @@ -1741,44 +1754,54 @@ powerpc-*-chorusos*) ;; powerpc-*-eabispe*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabispe.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-spe rs6000/t-ppccomm" ;; powerpc-*-eabisimaltivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm" ;; powerpc-*-eabisim*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" ;; powerpc-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" use_fixproto=yes ;; powerpc-*-eabialtivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcendian rs6000/t-ppccomm" ;; powerpc-*-eabi*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" ;; powerpc-*-rtems*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h rtems.h" - tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-rtems t-rtems rs6000/t-ppccomm" ;; powerpc-*-linux*altivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" ;; powerpc-*-linux*spe*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" ;; powerpc-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="t-dfprules rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" case ${enable_targets}:${cpu_is_64bit} in *powerpc64* | all:* | *:yes) if test x$cpu_is_64bit = xyes; then @@ -1786,69 +1809,103 @@ powerpc-*-linux*) fi tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" tmake_file="$tmake_file rs6000/t-linux64" + extra_options="${extra_options} rs6000/linux64.opt" ;; *) tm_file="${tm_file} rs6000/linux.h" ;; esac + if test x${enable_secureplt} = xyes; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi ;; powerpc-*-gnu-gnualtivec*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" if test x$enable_threads = xyes; then thread_file='posix' fi ;; powerpc-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/gnu.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" if test x$enable_threads = xyes; then thread_file='posix' fi ;; -powerpc-wrs-vxworks*) +powerpc-wrs-vxworks|powerpc-wrs-vxworksae) # We want vxworks.h after rs6000/sysv4.h, which unfortunately # means we have to redo the tm_file list from scratch. tm_file="rs6000/rs6000.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" - tm_file="${tm_file} vxworks.h rs6000/vxworks.h" - tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks" + tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppccomm rs6000/t-vxworks" + extra_options="${extra_options} rs6000/sysv4.opt" extra_headers=ppc-asm.h + case ${target} in + *-vxworksae*) + tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h" + tmake_file="${tmake_file} rs6000/t-vxworksae" + ;; + *-vxworks*) + tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h" + ;; + esac ;; -powerpc-wrs-windiss*) # Instruction-level simulator for VxWorks. +powerpc-wrs-windiss*) # Instruction-level simulator for VxWorks. tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/windiss.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" - thread_file="" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" + thread_file="" use_fixproto=yes - ;; + ;; +powerpc-*-lynxos*) + xm_defines=POSIX + tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h" + tmake_file="t-lynx rs6000/t-lynx" + extra_options="${extra_options} rs6000/sysv4.opt lynx.opt" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + extra_options="${extra_options} lynx.opt" + thread_file=lynx + gnu_ld=yes + gas=yes + ;; powerpcle-*-sysv*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" use_fixproto=yes ;; powerpcle-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" use_fixproto=yes ;; powerpcle-*-eabisim*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpcle-*-eabi*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-kaos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h kaos.h rs6000/kaos-ppc.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpcle-*-kaos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h kaos.h rs6000/kaos-ppc.h" - tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*) tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h" - tmake_file="rs6000/t-fprules rs6000/t-newas" + tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-newas" + extra_options="${extra_options} rs6000/aix41.opt" use_collect2=yes extra_headers= use_fixproto=yes @@ -1856,12 +1913,14 @@ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*) rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*) tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h" tmake_file=rs6000/t-aix43 + extra_options="${extra_options} rs6000/aix64.opt" use_collect2=yes thread_file='aix' extra_headers= ;; rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h" + extra_options="${extra_options} rs6000/aix64.opt" tmake_file=rs6000/t-aix43 use_collect2=yes thread_file='aix' @@ -1870,19 +1929,14 @@ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h" tmake_file=rs6000/t-aix52 + extra_options="${extra_options} rs6000/aix64.opt" use_collect2=yes thread_file='aix' extra_headers= ;; -rs6000-*-lynxos*) - tm_file="svr3.h lynx.h rs6000/lynxbase.h rs6000/rs6000.h rs6000/lynx.h" - tmake_file=rs6000/t-fprules - use_collect2=yes - use_fixproto=yes - ;; s390-*-linux*) tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux s390/t-crtstuff" + tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux" ;; s390x-*-linux*) tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h" @@ -1890,118 +1944,199 @@ s390x-*-linux*) md_file=s390/s390.md extra_modes=s390/s390-modes.def out_file=s390/s390.c - tmake_file="t-slibgcc-elf-ver t-linux s390/t-crtstuff s390/t-linux64" + tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux s390/t-linux64" ;; s390x-ibm-tpf*) - tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h s390/tpf.h" - tm_p_file=s390/s390-protos.h - md_file=s390/s390.md - extra_modes=s390/s390-modes.def - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" - out_file=s390/s390.c - tmake_file="t-slibgcc-elf-ver s390/t-crtstuff s390/t-tpf" + tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h s390/tpf.h" + tm_p_file=s390/s390-protos.h + md_file=s390/s390.md + extra_modes=s390/s390-modes.def + out_file=s390/s390.c + extra_parts="crtbeginS.o crtendS.o" + tmake_file="s390/t-crtstuff s390/t-tpf" + thread_file='tpf' + extra_options="${extra_options} s390/tpf.opt" ;; -sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*) - tmake_file="sh/t-sh sh/t-elf" - case ${target} in - shl* | sh64l*) - tm_file="sh/little.h ${tm_file}" - tmake_file="${tmake_file} sh/t-le" - ;; +score-*-elf) + tm_file="dbxelf.h elfos.h score/elf.h score/score.h" + tmake_file=score/t-score-elf + extra_objs="score-mdaux.o" + ;; +sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ +sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ + sh-*-linux* | sh[346lbe]*-*-linux* | \ + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ + sh64-*-netbsd* | sh64l*-*-netbsd*) + tmake_file="${tmake_file} sh/t-sh sh/t-elf" + if test x${with_endian} = x; then + case ${target} in + sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;; + shbe-*-* | sheb-*-*) with_endian=big,little ;; + sh[1234]l* | sh[34]*-*-linux*) with_endian=little ;; + shl* | sh64l* | sh*-*-linux* | \ + sh5l* | sh-superh-elf) with_endian=little,big ;; + sh[1234]*-*-*) with_endian=big ;; + *) with_endian=big,little ;; + esac + fi + case ${with_endian} in + big|little) tmake_file="${tmake_file} sh/t-1e" ;; + big,little|little,big) ;; + *) echo "with_endian=${with_endian} not supported."; exit 1 ;; esac - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h" + case ${with_endian} in + little*) tm_file="sh/little.h ${tm_file}" ;; + esac + tm_file="${tm_file} dbxelf.h elfos.h" case ${target} in + sh*-*-netbsd*) ;; + *) tm_file="${tm_file} svr4.h" ;; + esac + tm_file="${tm_file} sh/elf.h" + case ${target} in + sh*-*-linux*) tmake_file="${tmake_file} sh/t-linux" + tm_file="${tm_file} linux.h sh/linux.h" ;; + sh*-*-kaos*) tm_file="${tm_file} sh/embed-elf.h kaos.h sh/kaos-sh.h" + ;; + sh*-*-netbsd*) tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h" ;; + sh*-superh-elf) if test x$with_libgloss != xno; then + with_libgloss=yes + tm_file="${tm_file} sh/newlib.h" + fi + tm_file="${tm_file} sh/embed-elf.h" + extra_options="${extra_options} sh/superh.opt" ;; + *) if test x$with_newlib = xyes \ + && test x$with_libgloss = xyes; then + tm_file="${tm_file} sh/newlib.h" + fi + tm_file="${tm_file} sh/embed-elf.h" ;; + esac + case ${target} in + sh5*-*-netbsd*) + # SHmedia, 32-bit ABI + tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd" + ;; + sh64*-netbsd*) + # SHmedia, 64-bit ABI + tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd sh/t-netbsd-sh5-64" + ;; + *-*-netbsd) + tmake_file="${tmake_file} sh/t-netbsd" + ;; + sh64*-*-linux*) + tmake_file="${tmake_file} sh/t-sh64 sh/t-linux64" + tm_file="${tm_file} sh/sh64.h" + extra_headers="shmedia.h ushmedia.h sshmedia.h" + ;; sh64*) tmake_file="${tmake_file} sh/t-sh64" tm_file="${tm_file} sh/sh64.h" extra_headers="shmedia.h ushmedia.h sshmedia.h" ;; - sh4_single*) target_cpu_default="SELECT_SH4_SINGLE" ;; - sh4*) target_cpu_default="SELECT_SH4" ;; - sh3e*) target_cpu_default="SELECT_SH3E" ;; - sh3*) target_cpu_default="SELECT_SH3" ;; - sh2e*) target_cpu_default="SELECT_SH2E" ;; - sh2*) target_cpu_default="SELECT_SH2" ;; + *-*-symbianelf*) + tmake_file="sh/t-symbian" + tm_file="sh/symbian-pre.h sh/little.h ${tm_file} sh/symbian-post.h" + extra_objs="symbian.o" + extra_parts="crt1.o crti.o crtn.o crtbegin.o crtend.o crtbeginS.o crtendS.o" + ;; esac - case ${target} in - sh[234]*) tmake_file="${tmake_file} sh/t-monolib" ;; + # sed el/eb endian suffixes away to avoid confusion with sh[23]e + case `echo ${target} | sed 's/e[lb]-/-/'` in + sh64*-*-netbsd*) sh_cpu_target=sh5-64media ;; + sh64* | sh5*-*-netbsd*) sh_cpu_target=sh5-32media ;; + sh4a_single_only*) sh_cpu_target=sh4a-single-only ;; + sh4a_single*) sh_cpu_target=sh4a-single ;; + sh4a_nofpu*) sh_cpu_target=sh4a-nofpu ;; + sh4al) sh_cpu_target=sh4al ;; + sh4a*) sh_cpu_target=sh4a ;; + sh4_single_only*) sh_cpu_target=sh4-single-only ;; + sh4_single*) sh_cpu_target=sh4-single ;; + sh4_nofpu*) sh_cpu_target=sh4-nofpu ;; + sh4* | sh-superh-*) sh_cpu_target=sh4 ;; + sh3e*) sh_cpu_target=sh3e ;; + sh*-*-netbsd* | sh3*) sh_cpu_target=sh3 ;; + sh2a_single_only*) sh_cpu_target=sh2a-single-only ;; + sh2a_single*) sh_cpu_target=sh2a-single ;; + sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;; + sh2a*) sh_cpu_target=sh2a ;; + sh2e*) sh_cpu_target=sh2e ;; + sh2*) sh_cpu_target=sh2 ;; + *) sh_cpu_target=sh1 ;; esac - case ${target} in - sh*-*-kaos*) tm_file="${tm_file} kaos.h sh/kaos-sh.h" ;; + # did the user say --without-fp ? + if test x$with_fp = xno; then + case ${sh_cpu_target} in + sh5-*media) sh_cpu_target=${sh_cpu_target}-nofpu ;; + sh4al | sh1) ;; + sh4a* ) sh_cpu_target=sh4a-nofpu ;; + sh4*) sh_cpu_target=sh4-nofpu ;; + sh3*) sh_cpu_target=sh3 ;; + sh2a*) sh_cpu_target=sh2a-nofpu ;; + sh2*) sh_cpu_target=sh2 ;; + *) echo --without-fp not available for $target: ignored + esac + tm_defines="$tm_defines STRICT_NOFPU=1" + fi + sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`" + case $sh_cpu_default in + sh5-64media-nofpu | sh5-64media | \ + sh5-32media-nofpu | sh5-32media | sh5-compact-nofpu | sh5-compact | \ + sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \ + sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \ + sh4-single-only | sh4-single | sh4-nofpu | sh4 | \ + sh3e | sh3 | sh2e | sh2 | sh1) ;; + "") sh_cpu_default=${sh_cpu_target} ;; + *) echo "with_cpu=$with_cpu not supported"; exit 1 ;; esac + sh_multilibs=${with_multilib_list} + if test x${sh_multilibs} = x ; then + case ${target} in + sh64-superh-linux* | \ + sh[1234]*) sh_multilibs=${sh_cpu_target} ;; + sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; + sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; + sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; + sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;; + *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;; + esac + if test x$with_fp = xno; then + sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`" + fi + fi + target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_` + tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"' + sh_multilibs=`echo $sh_multilibs,$sh_cpu_default | sed -e 's/[ ,/][ ,]*/ /g' -e 's/ $//' -e 's/^m/sh/' -e 's/ m/ sh/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-` + for sh_multilib in ${sh_multilibs}; do + case ${sh_multilib} in + sh1 | sh2 | sh2e | sh3 | sh3e | \ + sh4 | sh4-single | sh4-single-only | sh4-nofpu | \ + sh4a | sh4a-single | sh4a-single-only | sh4a-nofpu | sh4al | \ + sh2a | sh2a-single | sh2a-single-only | sh2a-nofpu | \ + sh5-64media | sh5-64media-nofpu | \ + sh5-32media | sh5-32media-nofpu | \ + sh5-compact | sh5-compact-nofpu) + tmake_file="${tmake_file} sh/t-mlib-${sh_multilib}" + tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1" + ;; + *) + echo "with_multilib_list=${sh_multilib} not supported." + exit 1 + ;; + esac + done + if test x${enable_incomplete_targets} = xyes ; then + tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1" + fi use_fixproto=yes ;; sh-*-rtemscoff*) - tmake_file="sh/t-sh t-rtems" + tmake_file="sh/t-sh t-rtems sh/t-rtems" tm_file="${tm_file} dbxcoff.h sh/coff.h sh/rtems.h rtems.h" ;; sh-*-rtems*) - tmake_file="sh/t-sh sh/t-elf t-rtems" + tmake_file="sh/t-sh sh/t-elf t-rtems sh/t-rtems" tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h" ;; -sh-*-linux* | sh[2346lbe]*-*-linux*) - tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux" - case ${target} in - sh*be-*-* | sh*eb-*-*) ;; - *) - tm_file="sh/little.h ${tm_file}" - tmake_file="${tmake_file} sh/t-le" - ;; - esac - tmake_file="${tmake_file} sh/t-linux" - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/linux.h" - case ${target} in - sh64*) - tmake_file="${tmake_file} sh/t-sh64" - tm_file="${tm_file} sh/sh64.h" - extra_headers="shmedia.h ushmedia.h sshmedia.h" - ;; - sh4_single*) target_cpu_default="SELECT_SH4_SINGLE" ;; - sh4*) target_cpu_default="SELECT_SH4" ;; - sh3e[lb]e*) target_cpu_default="SELECT_SH3E" ;; - sh3e[lb]*) target_cpu_default="SELECT_SH3" ;; - sh3e*) target_cpu_default="SELECT_SH3E" ;; - sh3*) target_cpu_default="SELECT_SH3" ;; - sh2e[lb]e*) target_cpu_default="SELECT_SH2E" ;; - sh2e[lb]*) target_cpu_default="SELECT_SH2" ;; - sh2e*) target_cpu_default="SELECT_SH2E" ;; - sh2*) target_cpu_default="SELECT_SH2" ;; - esac - case ${target} in - sh[234]*) tmake_file="${tmake_file} sh/t-monolib" ;; - esac - ;; -sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ - sh64-*-netbsd* | sh64l*-*-netbsd*) - tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h netbsd.h netbsd-elf.h sh/netbsd-elf.h" - tmake_file="${tmake_file} sh/t-sh sh/t-elf" - case ${target} in - sh*l*-*) - tm_file="sh/little.h ${tm_file}" - tmake_file="${tmake_file} sh/t-le" - ;; - *) - tmake_file="${tmake_file} sh/t-be" - ;; - esac - case ${target} in - sh5*-*) - # SHmedia, 32-bit ABI - target_cpu_default="SH5_BIT|SH4_BIT|SH3_BIT|SH_E_BIT" - tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd-sh5" - ;; - sh64*-*) - # SHmedia, 64-bit ABI - target_cpu_default="SH5_BIT|SH4_BIT" - tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd-sh5 sh/t-netbsd-sh5-64" - ;; - *) - # SH3, software floating point - target_cpu_default="SH1_BIT|SH2_BIT|SH3_BIT" - tmake_file="${tmake_file} sh/t-netbsd" - ;; - esac - ;; sh-wrs-vxworks) tmake_file="$tmake_file sh/t-sh sh/t-elf sh/t-vxworks" tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/embed-elf.h sh/vxworks.h" @@ -2010,77 +2145,82 @@ sh-*-*) tm_file="${tm_file} dbxcoff.h sh/coff.h" use_fixproto=yes ;; -sparc-tti-*) - tm_file="${tm_file} sparc/pbd.h" - use_fixproto=yes - ;; sparc-*-netbsdelf*) - tm_file="${tm_file} elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" - ;; -sparc-*-openbsd*) - tm_defines=OBSD_OLD_GAS - tm_file="sparc/sparc.h openbsd.h sparc/openbsd.h" - # needed to unconfuse gdb - tmake_file="t-libc-ok t-openbsd sparc/t-openbsd" - # we need collect2 until our bug is fixed... - use_collect2=yes + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" + extra_options="${extra_options} sparc/long-double-switch.opt" ;; sparc64-*-openbsd*) - tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h" + tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h" + extra_options="${extra_options} sparc/little-endian.opt" gas=yes gnu_ld=yes with_cpu=ultrasparc ;; sparc-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-gld.h sparc/elf.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h" tmake_file="sparc/t-elf sparc/t-crtfm" extra_parts="crti.o crtn.o crtbegin.o crtend.o" use_fixproto=yes ;; sparc-*-linux*) # SPARC's running GNU/Linux, libc6 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux sparc/t-crtfm" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm" ;; sparc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-gld.h sparc/elf.h sparc/rtemself.h rtems.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h" tmake_file="sparc/t-elf sparc/t-crtfm t-rtems" extra_parts="crti.o crtn.o crtbegin.o crtend.o" ;; sparc64-*-solaris2* | sparcv9-*-solaris2*) - tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h" + case ${target} in + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; + esac + tm_file="${tm_file} sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h" if test x$gnu_ld = xyes; then tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h" fi if test x$gas = xyes; then - tm_file="${tm_file} sparc/sol2-gas-bi.h" + tm_file="${tm_file} sparc/sol2-gas.h sparc/sol2-gas-bi.h" fi - tmake_file="sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm" + tm_file="${tm_file} tm-dwarf2.h" + tmake_file="t-sol2 sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm" if test x$gnu_ld = xyes; then tmake_file="$tmake_file t-slibgcc-elf-ver" else tmake_file="$tmake_file t-slibgcc-sld" fi + c_target_objs="sol2-c.o" + cxx_target_objs="sol2-c.o" + extra_objs="sol2.o" + tm_p_file="${tm_p_file} sol2-protos.h" extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o" - if test x${enable_threads} = x ; then - enable_threads=$have_pthread_h - if test x${enable_threads} = x ; then - enable_threads=$have_thread_h - fi - fi - if test x${enable_threads} = xyes ; then - if test x${have_pthread_h} = xyes ; then - thread_file='posix' - else - thread_file='solaris' - fi - fi + case ${enable_threads}:${have_pthread_h}:${have_thread_h} in + "":yes:* | yes:yes:* ) thread_file=posix ;; + "":*:yes | yes:*:yes ) thread_file=solaris ;; + esac need_64bit_hwint=yes ;; sparc-*-solaris2*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h" + case ${target} in + *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) + tm_file="${tm_file} sol2-6.h" + ;; + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; + esac + tm_file="${tm_file} sparc/sol2.h" if test x$gnu_ld = xyes; then tm_file="${tm_file} sparc/sol2-gld.h" fi - tmake_file="sparc/t-sol2 sparc/t-crtfm" + if test x$gas = xyes; then + tm_file="${tm_file} sparc/sol2-gas.h" + fi + tmake_file="t-sol2 sparc/t-sol2 sparc/t-crtfm" if test x$gnu_ld = xyes; then tmake_file="$tmake_file t-slibgcc-elf-ver" else @@ -2092,7 +2232,7 @@ sparc-*-solaris2*) tm_file="${tm_file} sparc/sol26-sld.h" fi ;; - *-*-solaris2.[789] | *-*-solaris2.1[0-9]) + *-*-solaris2.[789] | *-*-solaris2.1[0-9]*) tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h" if test x$gnu_ld = xyes; then tm_file="${tm_file} sparc/sol2-gld-bi.h" @@ -2100,24 +2240,32 @@ sparc-*-solaris2*) if test x$gas = xyes; then tm_file="${tm_file} sparc/sol2-gas-bi.h" fi + tm_file="${tm_file} tm-dwarf2.h" tmake_file="$tmake_file sparc/t-sol2-64" need_64bit_hwint=yes + test x$with_cpu != x || with_cpu=v9 ;; esac + c_target_objs="sol2-c.o" + cxx_target_objs="sol2-c.o" + extra_objs="sol2.o" + tm_p_file="${tm_p_file} sol2-protos.h" extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o" - if test x${enable_threads} = x; then - enable_threads=$have_pthread_h - if test x${enable_threads} = x; then - enable_threads=$have_thread_h - fi - fi - if test x${enable_threads} = xyes; then - if test x${have_pthread_h} = xyes; then - thread_file='posix' - else - thread_file='solaris' - fi - fi + case ${enable_threads}:${have_pthread_h}:${have_thread_h} in + "":yes:* | yes:yes:* ) + case ${target} in + *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) + thread_file=posix95 + ;; + *) + thread_file=posix + ;; + esac + ;; + "":*:yes | yes:*:yes ) + thread_file=solaris + ;; + esac ;; sparc-*-sysv4*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sysv4-only.h" @@ -2125,34 +2273,16 @@ sparc-*-sysv4*) extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; -sparclite-*-coff*) - tm_file="${tm_file} sparc/lite.h svr3.h sparc/litecoff.h dbxcoff.h libgloss.h" - tmake_file=sparc/t-sparclite - ;; -sparclite-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-gld.h sparc/elf.h sparc/liteelf.h" - tmake_file="sparc/t-sparclite sparc/t-crtfm" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; -sparc86x-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-gld.h sparc/elf.h sparc/sp86x-elf.h" - tmake_file="sparc/t-sp86x sparc/t-crtfm" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; -sparc64-*-aout*) - tm_file="sparc/sparc.h sparc/aout.h sparc/sp64-aout.h" - use_fixproto=yes - ;; sparc64-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-gld.h sparc/sp64-elf.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h" + extra_options="${extra_options} sparc/little-endian.opt" tmake_file="${tmake_file} sparc/t-crtfm" extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; sparc64-*-freebsd*|ultrasparc-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h" + extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-crtfm" case "x$with_cpu" in xultrasparc) ;; @@ -2162,17 +2292,19 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*) need_64bit_hwint=yes ;; sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux - tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux64 sparc/t-crtfm" tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm" ;; sparc64-*-netbsd*) - tmake_file="${tmake_file} sparc/t-netbsd64" tm_file="sparc/biarch64.h ${tm_file}" tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-netbsd64" ;; strongarm-*-elf*) tm_file="arm/strongarm-elf.h dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h" - tmake_file=arm/t-strongarm-elf + tmake_file="arm/t-arm arm/t-strongarm-elf" out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def @@ -2180,16 +2312,17 @@ strongarm-*-elf*) ;; strongarm-*-pe) tm_file="arm/semi.h arm/aout.h arm/coff.h dbxcoff.h arm/strongarm-coff.h arm/arm.h arm/pe.h arm/strongarm-pe.h" - tmake_file=arm/t-strongarm-pe + tmake_file="arm/t-arm arm/t-strongarm-pe" out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def + extra_options="${extra_options} arm/pe.opt" extra_objs=pe.o use_fixproto=yes ;; strongarm-*-kaos*) tm_file="arm/strongarm-elf.h dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h kaos.h arm/kaos-strongarm.h" - tmake_file=arm/t-strongarm-elf + tmake_file="arm/t-arm arm/t-strongarm-elf" out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def @@ -2201,6 +2334,7 @@ v850e1-*-*) tmake_file=v850/t-v850e md_file=v850/v850.md out_file=v850/v850.c + extra_options="${extra_options} v850/v850.opt" if test x$stabs = xyes then tm_file="${tm_file} dbx.h" @@ -2217,6 +2351,7 @@ v850e-*-*) tmake_file=v850/t-v850e md_file=v850/v850.md out_file=v850/v850.c + extra_options="${extra_options} v850/v850.opt" if test x$stabs = xyes then tm_file="${tm_file} dbx.h" @@ -2241,11 +2376,13 @@ v850-*-*) ;; vax-*-bsd*) # VAXen running BSD tm_file="${tm_file} vax/bsd.h" + tmake_file=vax/t-memfuncs use_collect2=yes use_fixproto=yes ;; vax-*-sysv*) # VAXen running system V tm_file="${tm_file} vax/vaxv.h" + tmake_file=vax/t-memfuncs use_fixproto=yes ;; vax-*-netbsdelf*) @@ -2263,21 +2400,12 @@ vax-*-openbsd*) ;; vax-*-ultrix*) # VAXen running ultrix tm_file="${tm_file} vax/ultrix.h" - use_fixproto=yes - ;; -vax-*-*) # VAX default entry - if test "x$enable_obsolete" != xyes; then - echo "*** Configuration ${target} is obsolete." >&2 - echo "*** Specify --enable-obsolete to build it anyway." >&2 - echo "*** Support will be REMOVED in the next major release of GCC," >&2 - echo "*** unless a maintainer comes forward." >&2 - exit 1 - fi + tmake_file=vax/t-memfuncs use_fixproto=yes ;; xscale-*-elf) tm_file="arm/xscale-elf.h dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h" - tmake_file=arm/t-xscale-elf + tmake_file="arm/t-arm arm/t-xscale-elf" out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def @@ -2285,7 +2413,7 @@ xscale-*-elf) ;; xscale-*-coff) tm_file="arm/semi.h arm/aout.h arm/coff.h dbxcoff.h arm/xscale-coff.h arm/arm.h" - tmake_file=arm/t-xscale-coff + tmake_file="arm/t-arm arm/t-xscale-coff" out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def @@ -2297,6 +2425,7 @@ xstormy16-*-elf) tm_p_file=stormy16/stormy16-protos.h md_file=stormy16/stormy16.md out_file=stormy16/stormy16.c + extra_options=stormy16/stormy16.opt tmake_file="stormy16/t-stormy16" extra_parts="crtbegin.o crtend.o" use_fixproto=yes @@ -2307,21 +2436,39 @@ xtensa-*-elf*) ;; xtensa-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h xtensa/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux xtensa/t-xtensa xtensa/t-linux" + tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux" ;; am33_2.0-*-linux*) tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h mn10300/linux.h" - tmake_file="t-slibgcc-elf-ver t-linux mn10300/t-linux" + tmake_file="${tmake_file} mn10300/t-linux" gas=yes gnu_ld=yes extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" use_collect2=no ;; +m32c-*-elf*) + tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" + c_target_objs="m32c-pragma.o" + cxx_target_objs="m32c-pragma.o" + use_fixproto=yes + ;; *) echo "*** Configuration ${target} not supported" 1>&2 exit 1 ;; esac +case ${target} in +i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1) + tmake_file="${tmake_file} i386/t-gmm_malloc" + ;; +i[34567]86-*-linux* | x86_64-*-linux*) + tmake_file="${tmake_file} i386/t-pmm_malloc" + ;; +i[34567]86-*-* | x86_64-*-*) + tmake_file="${tmake_file} i386/t-gmm_malloc" + ;; +esac + # Support for --with-cpu and related options (and a few unrelated options, # too). case ${with_cpu} in @@ -2339,6 +2486,9 @@ if test x$with_cpu = x ; then # A Cirrus ARM variant. with_cpu="ep9312" ;; + i386-*-*) + with_cpu=i386 + ;; i486-*-*) with_cpu=i486 ;; @@ -2390,13 +2540,26 @@ if test x$with_cpu = x ; then pentium_m-*) with_cpu=pentium-m ;; - *) + pentiumpro-*) with_cpu=pentiumpro ;; + *) + with_cpu=generic + ;; esac ;; x86_64-*-*) - with_cpu=k8 + case ${target_noncanonical} in + k8-*|opteron-*|athlon_64-*) + with_cpu=k8 + ;; + nocona-*) + with_cpu=nocona + ;; + *) + with_cpu=generic + ;; + esac ;; alphaev6[78]*-*-*) with_cpu=ev67 @@ -2413,15 +2576,27 @@ if test x$with_cpu = x ; then alphaev5*-*-*) with_cpu=ev5 ;; + frv-*-*linux* | frv400-*-*linux*) + with_cpu=fr400 + ;; + frv550-*-*linux*) + with_cpu=fr550 + ;; sparc*-*-*) with_cpu="`echo ${target} | sed 's/-.*$//'`" - if [ x$with_cpu = xsparc64 ]; then - with_cpu=v9 - fi ;; esac fi +# Similarly for --with-float +if test x$with_float = x; then + case ${target} in + ep9312-*-*) + with_float=hard + ;; + esac +fi + # Similarly for --with-schedule. if test x$with_schedule = x; then case ${target} in @@ -2459,35 +2634,33 @@ case "${target}" in ;; arm*-*-*) - supported_defaults="arch cpu float tune" + supported_defaults="arch cpu float tune fpu abi mode" for which in cpu tune; do + # See if it matches any of the entries in arm-cores.def eval "val=\$with_$which" - case "$val" in - "" \ - | arm[236789] | arm250 | arm[67][01]0 \ - | arm60 | arm620 | arm7d | arm7di \ - | arm7m | arm7dm | arm7dmi | arm[79]tdmi \ - | arm70 | arm700i | arm710t | arm720 \ - | arm720t | arm740t | arm710c | arm920 \ - | arm920t | arm926ejs | arm940t | arm9e | arm10tdmi \ - | arm7100 | arm7500 | arm7500fe | arm810 \ - | arm1026ejs | arm1020t | arm1136js | arm1136jfs \ - | xscale | iwmmxt \ - | ep9312 \ - | strongarm | strongarm110 | strongarm11[01]0) - # OK - ;; - *) - echo "Unknown CPU used in --with-$which=$val" 1>&2 - exit 1 - ;; - esac + if [ x"$val" = x ] \ + || grep "^ARM_CORE(\"$val\"," \ + ${srcdir}/config/arm/arm-cores.def \ + > /dev/null; then + # Ok + new_val=`grep "^ARM_CORE(\"$val\"," \ + ${srcdir}/config/arm/arm-cores.def | \ + sed -e 's/^[^,]*,[ ]*//' | \ + sed -e 's/,.*$//'` + eval "target_${which}_cname=$new_val" + echo "For $val real value is $new_val" + true + else + echo "Unknown CPU used in --with-$which=$val" 1>&2 + exit 1 + fi done case "$with_arch" in "" \ - | armv[2345] | armv2a | armv3m | armv4t | armv5t \ - | armv5te | armv6j | ep9312) + | armv[23456] | armv2a | armv3m | armv4t | armv5t \ + | armv5te | armv6j |armv6k | armv6z | armv6zk \ + | iwmmxt | ep9312) # OK ;; *) @@ -2498,7 +2671,7 @@ case "${target}" in case "$with_float" in "" \ - | soft | hard) + | soft | hard | softfp) # OK ;; *) @@ -2507,11 +2680,70 @@ case "${target}" in ;; esac + case "$with_fpu" in + "" \ + | fpa | fpe2 | fpe3 | maverick | vfp ) + # OK + ;; + *) + echo "Unknown fpu used in --with-fpu=$with_fpu" 2>&1 + exit 1 + ;; + esac + + case "$with_abi" in + "" \ + | apcs-gnu | atpcs | aapcs | iwmmxt ) + #OK + ;; + *) + echo "Unknown ABI used in --with-abi=$with_abi" + exit 1 + ;; + esac + + case "$with_mode" in + "" \ + | arm | thumb ) + #OK + ;; + *) + echo "Unknown mode used in --with-mode=$with_mode" + exit 1 + ;; + esac + if test "x$with_arch" != x && test "x$with_cpu" != x; then - echo "Warning: --with-arch overrides --with-cpu" 1>&2 + echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2 fi ;; + fr*-*-*linux*) + supported_defaults=cpu + case "$with_cpu" in + fr400) ;; + fr550) ;; + *) + echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2 + exit 1 + ;; + esac + ;; + + m68k*-linux*) + supported_defaults="cpu" + case "$with_cpu" in + "" | "m68020" | "m68030" | "m68040" | "m68060" | "m68020-40" | "m68020-60") + # OK + ;; + *) + echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2 + echo "m68020 m68030 m68040 m68060 m68020-40 m68020-60" 1>&2 + exit 1 + ;; + esac + ;; + hppa*-*-* | parisc*-*-*) supported_defaults="arch schedule" @@ -2541,13 +2773,21 @@ case "${target}" in for which in arch cpu tune; do eval "val=\$with_$which" case ${val} in - "" | i386 | i486 \ + i386 | i486 \ | i586 | pentium | pentium-mmx | winchip-c6 | winchip2 \ | c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \ | pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \ - | athlon-4 | athlon-xp | athlon-mp | k8 | opteron \ - | athlon64 | athlon-fx | prescott | pentium-m \ - | pentium4m | pentium3m| nocona) + | athlon-4 | athlon-xp | athlon-mp \ + | prescott | pentium-m | pentium4m | pentium3m) + case "${target}" in + x86_64-*-*) + echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2 + exit 1 + ;; + esac + # OK + ;; + "" | k8 | opteron | athlon64 | athlon-fx | nocona | generic) # OK ;; *) @@ -2559,7 +2799,7 @@ case "${target}" in ;; mips*-*-*) - supported_defaults="abi arch float tune" + supported_defaults="abi arch float tune divide" case ${with_float} in "" | soft | hard) @@ -2580,6 +2820,34 @@ case "${target}" in exit 1 ;; esac + + case ${with_divide} in + "" | breaks | traps) + # OK + ;; + *) + echo "Unknown division check type use in --with-divide=$with_divide" 1>&2 + exit 1 + esac + ;; + + mt-*-*) + supported_defaults="arch" + + case "$with_arch" in + "" \ + | ms1-64-001 \ + | ms1-16-002 \ + | ms1-16-003 \ + | ms2 \ + | "") + # OK + ;; + *) + echo "Unknown arch used in --with-arch=$with_arch" 1>&2 + exit 1 + ;; + esac ;; powerpc*-*-* | rs6000-*-*) @@ -2592,13 +2860,17 @@ case "${target}" in with_which="with_$which" eval $with_which= ;; + 405cr) + tm_defines="${tm_defines} CONFIG_PPC405CR" + eval "with_$which=405" + ;; "" | common \ - | power | power[2345] | powerpc | powerpc64 \ + | power | power[23456] | powerpc | powerpc64 \ | rios | rios1 | rios2 | rsc | rsc1 | rs64a \ | 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \ | 601 | 602 | 603 | 603e | ec603e | 604 \ | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \ - | 8540 | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5) + | 854[08] | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5) # OK ;; *) @@ -2615,7 +2887,7 @@ case "${target}" in for which in arch tune; do eval "val=\$with_$which" case ${val} in - "" | g5 | g6 | z900 | z990) + "" | g5 | g6 | z900 | z990 | z9-109) # OK ;; *) @@ -2636,6 +2908,25 @@ case "${target}" in esac ;; + sh[123456ble]-*-* | sh-*-*) + supported_defaults="cpu" + case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in + "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu ) + # OK + ;; + m2a | m2a-single | m2a-single-only | m2a-nofpu) + ;; + m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al) + ;; + *) + echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2 + echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2 + echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2 + echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2 + exit 1 + ;; + esac + ;; sparc*-*-*) supported_defaults="cpu float tune" @@ -2645,7 +2936,7 @@ case "${target}" in "" | sparc | sparcv9 | sparc64 | sparc86x \ | v7 | cypress | v8 | supersparc | sparclite | f930 \ | f934 | hypersparc | sparclite86x | sparclet | tsc701 \ - | v9 | ultrasparc | ultrasparc3) + | v9 | ultrasparc | ultrasparc3 | niagara) # OK ;; *) @@ -2691,55 +2982,63 @@ case ${target} in ;; arm*-*-*) + if test x$target_cpu_cname = x + then + target_cpu_default2=TARGET_CPU_generic + else + target_cpu_default2=TARGET_CPU_$target_cpu_cname + fi + ;; + + m68k*-linux*) case "x$with_cpu" in x) # The most generic - target_cpu_default2="TARGET_CPU_generic" + target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)" + ;; + xm68020) + target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)" + ;; + xm68030) + target_cpu_default2="(MASK_68030|MASK_68020|MASK_68881|MASK_BITFIELD)" + ;; + xm68040) + target_cpu_default2="(MASK_68040|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)" + ;; + xm68060) + target_cpu_default2="(MASK_68060|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)" + ;; + xm68020-40) + target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)" + ;; + xm68020-60) + target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040|MASK_68060)" ;; - *) - target_cpu_default2="TARGET_CPU_$with_cpu" + echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2 + exit 1 ;; esac ;; hppa*-*-* | parisc*-*-*) + target_cpu_default2="MASK_BIG_SWITCH" if test x$gas = xyes then - target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY" + target_cpu_default2="${target_cpu_default2}|MASK_GAS|MASK_JUMP_IN_DELAY" fi ;; mips*-*-*) - case ${target} in - mips*-*-ecoff* | mips*-*-elf*) - if test x$gas = xyes - then - if test x$gnu_ld = xyes - then - target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR" - else - target_cpu_default2="MASK_GAS" - fi - fi - ;; - mips*-*-*) - if test x$gas = xyes - then - target_cpu_default2="MASK_GAS" - fi - ;; - esac + if test x$gnu_ld = xyes + then + target_cpu_default2="MASK_SPLIT_ADDRESSES" + fi case ${target} in mips*el-*-*) tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines" ;; esac - case $tm_file in - *mips/elf.h* | *mips/elf64.h*) - tm_defines="OBJECT_FORMAT_ELF $tm_defines" - ;; - esac if test "x$enable_gofast" = xyes then tm_defines="US_SOFTWARE_GOFAST $tm_defines" @@ -2750,10 +3049,6 @@ case ${target} in ;; powerpc*-*-* | rs6000-*-*) - if test x$enable_altivec = xyes - then - tm_file="$tm_file rs6000/altivec-defs.h" - fi # FIXME: The PowerPC port uses the value set at compile time, # although it's only cosmetic. if test "x$with_cpu" != x @@ -2764,6 +3059,16 @@ case ${target} in c_target_objs="${c_target_objs} rs6000-c.o" cxx_target_objs="${cxx_target_objs} rs6000-c.o" tmake_file="rs6000/t-rs6000 ${tmake_file}" + + if test x$enable_e500_double = xyes + then + tm_file="$tm_file rs6000/e500-double.h" + fi + ;; + + sh[123456ble]*-*-* | sh-*-*) + c_target_objs="${c_target_objs} sh-c.o" + cxx_target_objs="${cxx_target_objs} sh-c.o" ;; sparc*-*-*) @@ -2772,15 +3077,12 @@ case ${target} in xsparc) with_cpu=v7 ;; - xsparc86x) - with_cpu=sparclite86x - ;; xsparcv9 | xsparc64) with_cpu=v9 ;; esac - # The Sparc port checks this value at compile-time. + # The SPARC port checks this value at compile-time. target_cpu_default2="TARGET_CPU_$with_cpu" ;; v850*-*-*) @@ -2797,7 +3099,7 @@ case ${target} in esac t= -all_defaults="abi cpu arch tune schedule float mode" +all_defaults="abi cpu arch tune schedule float mode fpu divide" for option in $all_defaults do eval "val=\$with_$option" @@ -2807,6 +3109,7 @@ do ;; *) echo "This target does not support --with-$option." 2>&1 + echo "Valid --with options are: $supported_defaults" 2>&1 exit 1 ;; esac diff --git a/contrib/gcc/config.host b/contrib/gcc/config.host index e4f035731a9..8398ee75836 100644 --- a/contrib/gcc/config.host +++ b/contrib/gcc/config.host @@ -1,5 +1,5 @@ # GCC host-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006 # Free Software Foundation, Inc. #This file is part of GCC. @@ -16,8 +16,8 @@ #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 is the GCC host-specific configuration file # where a configuration type is mapped to different system-specific @@ -49,6 +49,13 @@ # be linked into the gcc driver. # # out_host_hook_obj An object file that provides the host hooks. +# +# host_can_use_collect2 Set to yes normally; to no if the host cannot +# link or otherwise use collect2 +# use_long_long_for_widest_fast_int Set this to 'yes' if 'long long' +# (or '__int64') is wider than 'long' but still +# efficeiently supported by the host hardware. +# Only affects compile speed. Default is 'no'. # When setting any of these variables, check to see if a corresponding # variable is present in config.build; if so, you will likely want to @@ -62,6 +69,8 @@ host_exeext= host_extra_objs= host_extra_gcc_objs= out_host_hook_obj=host-default.o +host_can_use_collect2=yes +use_long_long_for_widest_fast_int=no # Unsupported hosts list. Generally, only include hosts known to fail here, # since we allow hosts not listed to be supported generically. @@ -76,12 +85,35 @@ case ${host} in ;; esac +# Common parts for widely ported systems. +case ${host} in + *-darwin*) + # Generic darwin host support. + out_host_hook_obj=host-darwin.o + host_xmake_file="${host_xmake_file} x-darwin" + ;; +esac + +case ${host} in + i[34567]86-*-* \ + | x86_64-*-* ) + case ${target} in + i[34567]86-*-* \ + | x86_64-*-* ) + host_extra_gcc_objs="driver-i386.o" + host_xmake_file="${host_xmake_file} i386/x-i386" + ;; + esac + ;; +esac + # Machine-specific settings. case ${host} in alpha*-dec-*vms*) host_xm_file=alpha/xm-vms.h - host_xmake_file=alpha/x-vms + host_xmake_file="${host_xmake_file} alpha/x-vms" host_exeext=.exe + host_can_use_collect2=no # This removes the cpu type and manufacturer components and # replaces "." with "_" in the operating system version. target_noncanonical=`echo $host | sed 's/.*-.*-\(.*\)$/\1/' | sed 's/\./_/g'` @@ -89,40 +121,36 @@ case ${host} in local_prefix=/gnu ;; hppa1.1-*-pro*) - host_xmake_file="pa/x-ada" + host_xmake_file="${host_xmake_file} pa/x-ada" ;; hppa1.1-*-osf*) - host_xmake_file="pa/x-ada" + host_xmake_file="${host_xmake_file} pa/x-ada" ;; hppa1.1-*-rtems*) - host_xmake_file="pa/x-ada" + host_xmake_file="${host_xmake_file} pa/x-ada" ;; hppa1.1-*-bsd*) - host_xmake_file="pa/x-ada" + host_xmake_file="${host_xmake_file} pa/x-ada" + ;; + hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10*) + out_host_hook_obj=host-hpux.o + host_xmake_file="${host_xmake_file} pa/x-ada-hpux10 x-hpux" ;; - hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10* | \ hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \ hppa*64*-*-hpux11*) - out_host_hook_obj=pa-host.o - host_xmake_file=pa/x-hpux + out_host_hook_obj=host-hpux.o + host_xmake_file="${host_xmake_file} pa/x-ada x-hpux" ;; hppa*-*-linux*) - out_host_hook_obj=pa-host.o - host_xmake_file=pa/x-linux + out_host_hook_obj=host-hpux.o + host_xmake_file="${host_xmake_file} x-hpux" ;; i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture host_xm_defines='FATAL_EXIT_CODE=12' ;; - i[34567]86-sequent-ptx4*) - host_xm_defines="SMALL_ARG_MAX" - ;; i[34567]86-*-solaris2*) - host_xm_defines="SMALL_ARG_MAX" out_host_hook_obj=host-solaris.o - host_xmake_file=x-solaris - ;; - i[34567]86-*-sysv4*) # Intel 80386's running System V Release 4 - host_xm_defines="SMALL_ARG_MAX" + host_xmake_file="${host_xmake_file} x-solaris" ;; i[34567]86-pc-msdosdjgpp*) host_xm_file=i386/xm-djgpp.h @@ -136,12 +164,15 @@ case ${host} in ;; i[34567]86-*-pe | i[34567]86-*-cygwin*) host_xm_file=i386/xm-cygwin.h + out_host_hook_obj=host-cygwin.o + host_xmake_file="${host_xmake_file} i386/x-cygwin" host_exeext=.exe ;; i[34567]86-*-mingw32*) host_xm_file=i386/xm-mingw32.h - host_xmake_file=i386/x-mingw32 + host_xmake_file="${host_xmake_file} i386/x-mingw32" host_exeext=.exe + out_host_hook_obj=host-mingw32.o ;; i[34567]86-*-uwin*) echo "*** UWIN may not be used as a host platform because" @@ -149,22 +180,34 @@ case ${host} in exit 1 ;; i[34567]86-*-interix3*) - host_xmake_file="x-interix" + host_xmake_file="${host_xmake_file} x-interix" ;; - i860-*-sysv4*) - host_xmake_file=i860/x-sysv4 + i[34567]86-*-darwin* | x86_64-*-darwin*) + out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o" + host_xmake_file="${host_xmake_file} i386/x-darwin" + ;; + powerpc-*-beos*) + host_can_use_collect2=no ;; powerpc-*-darwin*) - # powerpc-darwin host support. - out_host_hook_obj=host-darwin.o - host_xmake_file=rs6000/x-darwin + out_host_hook_obj="${out_host_hook_obj} host-ppc-darwin.o" + host_xmake_file="${host_xmake_file} rs6000/x-darwin" + ;; + powerpc64-*-darwin*) + out_host_hook_obj="${out_host_hook_obj} host-ppc64-darwin.o" + host_xmake_file="${host_xmake_file} rs6000/x-darwin64" ;; *-*-solaris2*) out_host_hook_obj=host-solaris.o - host_xmake_file=x-solaris + host_xmake_file="${host_xmake_file} x-solaris" ;; *-*-linux*) out_host_hook_obj=host-linux.o - host_xmake_file=x-linux + host_xmake_file="${host_xmake_file} x-linux" + ;; + ia64-*-hpux*) + use_long_long_for_widest_fast_int=yes + out_host_hook_obj=host-hpux.o + host_xmake_file="${host_xmake_file} x-hpux" ;; esac diff --git a/contrib/gcc/config.in b/contrib/gcc/config.in index f7971907bea..65b583bea4e 100644 --- a/contrib/gcc/config.in +++ b/contrib/gcc/config.in @@ -1,559 +1,1374 @@ /* config.in. Generated from configure.ac by autoheader. */ -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER - /* Define as the number of bits in a byte, if \`limits.h' doesn't. */ +#ifndef USED_FOR_TARGET #undef CHAR_BIT +#endif + /* Define 0/1 to force the choice for exception handling model. */ +#ifndef USED_FOR_TARGET #undef CONFIG_SJLJ_EXCEPTIONS +#endif + /* Define to enable the use of a default assembler. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_ASSEMBLER +#endif + /* Define to enable the use of a default linker. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_LINKER +#endif + /* Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires __cxa_atexit in libc. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_USE_CXA_ATEXIT +#endif + + +/* Define if you want assertions enabled. This is a cheap check. */ +#ifndef USED_FOR_TARGET +#undef ENABLE_ASSERT_CHECKING +#endif + /* Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks. */ +#ifndef USED_FOR_TARGET #undef ENABLE_CHECKING +#endif + + +/* Define to 1 to enable decimal float extension to C. */ +#ifndef USED_FOR_TARGET +#undef ENABLE_DECIMAL_FLOAT +#endif + /* Define if you want fold checked that it never destructs its argument. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_FOLD_CHECKING +#endif + /* Define if you want the garbage collector to operate in maximally paranoid mode, validating the entire heap and collecting garbage at every opportunity. This is extremely expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_GC_ALWAYS_COLLECT +#endif + /* Define if you want the garbage collector to do object poisoning and other memory allocation checks. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_GC_CHECKING +#endif + /* Define to 1 if translation of program messages to the user's native language is requested. */ +#ifndef USED_FOR_TARGET #undef ENABLE_NLS +#endif + /* Define if you want all operations on RTL (the basic data structure of the optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_RTL_CHECKING +#endif + /* Define if you want RTL flag accesses to be checked against the RTL codes that are supported for each access macro. This is relatively cheap. */ +#ifndef USED_FOR_TARGET #undef ENABLE_RTL_FLAG_CHECKING +#endif + + +/* Define if you want runtime assertions enabled. This is a cheap check. */ +#undef ENABLE_RUNTIME_CHECKING /* Define if you want all operations on trees (the basic data structure of the front ends) to be checked for dynamic type safety at runtime. This is - moderately expensive. */ + moderately expensive. The tree browser debugging routines will also be + enabled by this option. */ +#ifndef USED_FOR_TARGET #undef ENABLE_TREE_CHECKING +#endif + /* Define if you want to run subprograms and generated programs through valgrind (a memory checker). This is extremely expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_VALGRIND_CHECKING +#endif -/* Define to 1 if installation paths should be looked up in Windows32 - Registry. Ignored on non windows32 hosts. */ + +/* Define to 1 if installation paths should be looked up in the Windows + Registry. Ignored on non-Windows hosts. */ +#ifndef USED_FOR_TARGET #undef ENABLE_WIN32_REGISTRY +#endif + /* Define to the name of a file containing a list of extra machine modes for this architecture. */ +#ifndef USED_FOR_TARGET #undef EXTRA_MODES_FILE +#endif + /* Define to enable detailed memory allocation stats gathering. */ +#ifndef USED_FOR_TARGET #undef GATHER_STATISTICS +#endif + /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ +#ifndef USED_FOR_TARGET #undef GETGROUPS_T +#endif + + +/* Define if the zone collector is in use */ +#ifndef USED_FOR_TARGET +#undef GGC_ZONE +#endif + + +/* mcontext_t fields start with __ */ +#ifndef USED_FOR_TARGET +#undef HAS_MCONTEXT_T_UNDERSCORES +#endif + /* Define to 1 if you have the `alphasort' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ALPHASORT +#endif + /* Define if your assembler supports dwarf2 .file/.loc directives, and preserves file table indices exactly as given. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_DWARF2_DEBUG_LINE +#endif + /* Define if your assembler supports explicit relocations. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_EXPLICIT_RELOCS +#endif + + +/* Define if your assembler supports fprnd. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_FPRND +#endif + /* Define if your assembler supports the --gdwarf2 option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GDWARF2_DEBUG_FLAG +#endif + /* Define true if the assembler supports '.long foo@GOTOFF'. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GOTOFF_IN_DATA +#endif + /* Define if your assembler supports the --gstabs option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GSTABS_DEBUG_FLAG +#endif + /* Define if your assembler supports the Sun syntax for cmov. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_IX86_CMOV_SUN_SYNTAX +#endif + + +/* Define if your assembler supports the ffreep mnemonic. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_IX86_FFREEP +#endif + /* Define if your assembler supports the lituse_jsrdirect relocation. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_JSRDIRECT_RELOCS +#endif + /* Define if your assembler supports .sleb128 and .uleb128. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_LEB128 +#endif + /* Define if your assembler supports ltoffx and ldxmov relocations. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_LTOFFX_LDXMOV_RELOCS +#endif + /* Define if your assembler supports mfcr field. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_MFCRF +#endif + /* Define if your assembler supports the -no-mul-bug-abort option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION +#endif + /* Define if your assembler supports offsetable %lo(). */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_OFFSETABLE_LO10 +#endif + + +/* Define if your assembler supports popcntb field. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_POPCNTB +#endif + /* Define if your assembler supports .register. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_REGISTER_PSEUDO_OP +#endif + + +/* Define if your assembler supports R_PPC_REL16 relocs. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_REL16 +#endif + /* Define if your assembler supports -relax option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_RELAX_OPTION +#endif + /* Define if your assembler and linker support unaligned PC relative relocs. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_SPARC_UA_PCREL +#endif + /* Define if your assembler and linker support unaligned PC relative relocs against hidden symbols. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_SPARC_UA_PCREL_HIDDEN +#endif + /* Define if your assembler supports thread-local storage. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_TLS +#endif + /* Define to 1 if you have the `atoll' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ATOLL +#endif + /* Define to 1 if you have the `atoq' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ATOQ +#endif + + +/* Define to 1 if you have the `clearerr_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_CLEARERR_UNLOCKED +#endif + /* Define to 1 if you have the `clock' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_CLOCK +#endif + /* Define if defines clock_t. */ +#ifndef USED_FOR_TARGET #undef HAVE_CLOCK_T +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define 0/1 if your assembler and linker support COMDAT groups. */ +#ifndef USED_FOR_TARGET +#undef HAVE_COMDAT_GROUP +#endif + + +/* Define to 1 if we found a declaration for 'abort', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ABORT +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'asprintf', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_ASPRINTF +#endif + + +/* Define to 1 if we found a declaration for 'atof', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ATOF +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'atol', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ATOL +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'basename', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_BASENAME +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'calloc', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_CALLOC +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'clearerr_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_CLEARERR_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'clock', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_CLOCK +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'errno', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ERRNO +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'feof_unlocked', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FEOF_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'ferror_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FERROR_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fflush_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FFLUSH_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fgetc_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FGETC_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fgets_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FGETS_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fileno_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FILENO_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fprintf_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FPRINTF_UNLOCKED +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'fputc_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FPUTC_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fputs_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FPUTS_UNLOCKED +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'fread_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FREAD_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'free', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FREE +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'fwrite_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FWRITE_UNLOCKED +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getchar_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_GETCHAR_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'getcwd', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETCWD +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getc_unlocked', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_GETC_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'getenv', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETENV +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getopt', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETOPT +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getpagesize', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_GETPAGESIZE +#endif + + +/* Define to 1 if we found a declaration for 'getrlimit', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETRLIMIT +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getrusage', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETRUSAGE +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'getwd', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETWD +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'ldgetname', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_LDGETNAME +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'malloc', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_MALLOC +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_PUTCHAR_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'putc_unlocked', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_PUTC_UNLOCKED +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'realloc', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_REALLOC +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'sbrk', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SBRK +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'setrlimit', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SETRLIMIT +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'sigaltstack', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_SIGALTSTACK +#endif + + +/* Define to 1 if we found a declaration for 'snprintf', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SNPRINTF +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'strsignal', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_STRSIGNAL +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'strstr', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_STRSTR +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'strverscmp', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_STRVERSCMP +#endif + + +/* Define to 1 if we found a declaration for 'times', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_TIMES +#endif -/* Define to 1 if we found this declaration otherwise define to 0. */ + +/* Define to 1 if we found a declaration for 'vasprintf', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_VASPRINTF +#endif + + +/* Define to 1 if we found a declaration for 'vsnprintf', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_VSNPRINTF +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_DIRECT_H +#endif -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_FCNTL_H +#endif + + +/* Define to 1 if you have the `feof_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FEOF_UNLOCKED +#endif + + +/* Define to 1 if you have the `ferror_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FERROR_UNLOCKED +#endif + + +/* Define to 1 if you have the `fflush_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FFLUSH_UNLOCKED +#endif + + +/* Define to 1 if you have the `fgetc_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FGETC_UNLOCKED +#endif + + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FGETS_UNLOCKED +#endif + + +/* Define to 1 if you have the `fileno_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FILENO_UNLOCKED +#endif + /* Define to 1 if you have the `fork' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FORK +#endif + /* Define to 1 if you have the `fprintf_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPRINTF_UNLOCKED +#endif + /* Define to 1 if you have the `fputc_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPUTC_UNLOCKED +#endif + /* Define to 1 if you have the `fputs_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPUTS_UNLOCKED +#endif + + +/* Define to 1 if you have the `fread_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FREAD_UNLOCKED +#endif + /* Define to 1 if you have the `fwrite_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FWRITE_UNLOCKED +#endif + /* Define if your assembler supports .balign and .p2align. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_BALIGN_AND_P2ALIGN +#endif + /* Define if your assembler uses the new HImode fild and fist notation. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_FILDS_FISTS +#endif + /* Define if your assembler and linker support .hidden. */ #undef HAVE_GAS_HIDDEN /* Define if your assembler supports specifying the maximum number of bytes to skip when using the GAS .p2align command. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_MAX_SKIP_P2ALIGN +#endif + /* Define if your assembler supports .nsubspa comdat option. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_NSUBSPA_COMDAT +#endif + + +/* Define if your assembler and linker support 32-bit section relative relocs + via '.secrel32 label'. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GAS_PE_SECREL32_RELOC +#endif + /* Define 0/1 if your assembler supports marking sections with SHF_MERGE flag. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_SHF_MERGE +#endif + /* Define if your assembler supports .subsection and .subsection -1 starts emitting at the beginning of your section. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_SUBSECTION_ORDERING +#endif + /* Define if your assembler supports .weak. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_WEAK +#endif + + +/* Define if your assembler supports .weakref. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GAS_WEAKREF +#endif + + +/* Define to 1 if you have the `getchar_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GETCHAR_UNLOCKED +#endif + + +/* Define to 1 if you have the `getc_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GETC_UNLOCKED +#endif + + +/* Define to 1 if system unwind library has _Unwind_GetIPInfo. */ +#undef HAVE_GETIPINFO /* Define to 1 if you have the `getrlimit' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETRLIMIT +#endif + /* Define to 1 if you have the `getrusage' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETRUSAGE +#endif + /* Define to 1 if you have the `gettimeofday' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETTIMEOFDAY +#endif + /* Define if you have the iconv() function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ICONV +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_ICONV_H +#endif + /* Define .init_array/.fini_array sections are available and working. */ +#ifndef USED_FOR_TARGET #undef HAVE_INITFINI_ARRAY +#endif + /* Define if you have a working header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_INTTYPES_H +#endif + /* Define to 1 if you have the `kill' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_KILL +#endif + + +/* Define if you have and nl_langinfo(CODESET). */ +#ifndef USED_FOR_TARGET +#undef HAVE_LANGINFO_CODESET +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LANGINFO_H +#endif + /* Define if your file defines LC_MESSAGES. */ +#ifndef USED_FOR_TARGET #undef HAVE_LC_MESSAGES +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LDFCN_H +#endif + /* Define if your linker supports --as-needed and --no-as-needed options. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_AS_NEEDED +#endif + + +/* Define if your linker supports --demangle option. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_DEMANGLE +#endif + /* Define if your linker supports --eh-frame-hdr option. */ #undef HAVE_LD_EH_FRAME_HDR +/* Define if your PowerPC64 linker only needs function descriptor syms. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_NO_DOT_SYMS +#endif + + /* Define if your linker supports -pie option. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_PIE +#endif + /* Define if your linker links a mix of read-only and read-write sections into a read-write section. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_RO_RW_SECTION_MIXING +#endif + /* Define if your linker supports -Bstatic/-Bdynamic option. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_STATIC_DYNAMIC +#endif + + +/* Define if your linker supports --sysroot. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_SYSROOT +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LIMITS_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LOCALE_H +#endif -/* Define if your compiler supports the \`long long' type. */ + +/* Define to 1 if the system has the type `long long'. */ +#ifndef USED_FOR_TARGET #undef HAVE_LONG_LONG +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_MALLOC_H +#endif + /* Define to 1 if you have the `mbstowcs' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MBSTOWCS +#endif + /* Define if valgrind's memcheck.h header is installed. */ +#ifndef USED_FOR_TARGET #undef HAVE_MEMCHECK_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_MEMORY_H +#endif + /* Define to 1 if you have the `mincore' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MINCORE +#endif + /* Define to 1 if you have the `mmap' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP +#endif + /* Define if mmap with MAP_ANON(YMOUS) works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_ANON +#endif + /* Define if mmap of /dev/zero works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_DEV_ZERO +#endif + /* Define if read-only mmap of a plain file works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_FILE +#endif + /* Define to 1 if you have the `nl_langinfo' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_NL_LANGINFO +#endif + + +/* Define to 1 if you have the `putchar_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_PUTCHAR_UNLOCKED +#endif -/* Define if printf supports "%p". */ -#undef HAVE_PRINTF_PTR /* Define to 1 if you have the `putc_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_PUTC_UNLOCKED +#endif + /* Define to 1 if you have the `scandir' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SCANDIR +#endif + /* Define to 1 if you have the `setlocale' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SETLOCALE +#endif + /* Define to 1 if you have the `setrlimit' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SETRLIMIT +#endif -/* Define if you have a working header file. */ -#undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDDEF_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDINT_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDLIB_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRINGS_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRING_H +#endif + /* Define to 1 if you have the `strsignal' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRSIGNAL +#endif + /* Define if defines struct tms. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRUCT_TMS +#endif + /* Define to 1 if you have the `sysconf' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYSCONF +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_FILE_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_MMAN_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_PARAM_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_RESOURCE_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_STAT_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TIMES_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TIME_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TYPES_H +#endif + /* Define to 1 if you have that is POSIX.1 compatible. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_WAIT_H +#endif + /* Define to 1 if you have the `times' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_TIMES +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_TIME_H +#endif -/* Define if defines \`uchar'. */ -#undef HAVE_UCHAR /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_UNISTD_H +#endif + /* Define if valgrind's valgrind/memcheck.h header is installed. */ +#ifndef USED_FOR_TARGET #undef HAVE_VALGRIND_MEMCHECK_H +#endif + /* Define to 1 if you have the `vfork' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_VFORK +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_VFORK_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_WCHAR_H +#endif + /* Define to 1 if you have the `wcswidth' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_WCSWIDTH +#endif + /* Define to 1 if `fork' works. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_FORK +#endif + /* Define this macro if mbstowcs does not crash when its first argument is NULL. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_MBSTOWCS +#endif + /* Define to 1 if `vfork' works. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_VFORK +#endif -/* Define if the \`_Bool' type is built-in. */ -#undef HAVE__BOOL -/* Define if your compiler supports the \`__int64' type. */ +/* Define to 1 if the system has the type `__int64'. */ +#ifndef USED_FOR_TARGET #undef HAVE___INT64 +#endif -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN /* Define as const if the declaration of iconv() needs const. */ +#ifndef USED_FOR_TARGET #undef ICONV_CONST +#endif + /* Define if host mkdir takes a single argument. */ +#ifndef USED_FOR_TARGET #undef MKDIR_TAKES_ONE_ARG +#endif + /* Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h). */ +#ifndef USED_FOR_TARGET #undef NEED_64BIT_HOST_WIDE_INT +#endif + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#ifndef USED_FOR_TARGET #undef NO_MINUS_C_MINUS_O +#endif + /* Define to the address where bug reports for this package should be sent. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_BUGREPORT +#endif + /* Define to the full name of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_NAME +#endif + /* Define to the full name and version of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_STRING +#endif + /* Define to the one symbol short name of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_TARNAME +#endif + /* Define to the version of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_VERSION +#endif + /* Define to PREFIX/include if cpp should also search that directory. */ +#ifndef USED_FOR_TARGET #undef PREFIX_INCLUDE_DIR +#endif -/* The number of bytes in type int */ + +/* The size of a `int', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_INT +#endif -/* The number of bytes in type long */ + +/* The size of a `long', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_LONG +#endif -/* The number of bytes in type long long */ + +/* The size of a `long long', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_LONG_LONG +#endif -/* The number of bytes in type short */ + +/* The size of a `short', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_SHORT +#endif -/* The number of bytes in type void * */ + +/* The size of a `void *', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_VOID_P +#endif -/* The number of bytes in type __int64 */ + +/* The size of a `__int64', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF___INT64 +#endif + /* Define to 1 if you have the ANSI C header files. */ +#ifndef USED_FOR_TARGET #undef STDC_HEADERS +#endif + /* Define if you can safely include both and . */ +#ifndef USED_FOR_TARGET #undef STRING_WITH_STRINGS +#endif + + +/* Define if TFmode long double should be the default */ +#ifndef USED_FOR_TARGET +#undef TARGET_DEFAULT_LONG_DOUBLE_128 +#endif + + +/* Define if your target C library provides stack protector support */ +#ifndef USED_FOR_TARGET +#undef TARGET_LIBC_PROVIDES_SSP +#endif + /* Define to 1 if you can safely include both and . */ +#ifndef USED_FOR_TARGET #undef TIME_WITH_SYS_TIME +#endif + /* Define if your assembler mis-optimizes .eh_frame data. */ +#ifndef USED_FOR_TARGET #undef USE_AS_TRADITIONAL_FORMAT +#endif -/* Define to be the last portion of registry key on windows hosts. */ + +/* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but + still efficiently supported by the host hardware. */ +#ifndef USED_FOR_TARGET +#undef USE_LONG_LONG_FOR_WIDEST_FAST_INT +#endif + + +/* Define if location_t is fileline integer cookie. */ +#ifndef USED_FOR_TARGET +#undef USE_MAPPED_LOCATION +#endif + + +/* Define to be the last component of the Windows registry key under which to + look for installation paths. The full key used will be + HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}. + The default is the GCC version number. */ +#ifndef USED_FOR_TARGET #undef WIN32_REGISTRY_KEY +#endif -/* whether byteorder is bigendian */ + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#ifndef USED_FOR_TARGET #undef WORDS_BIGENDIAN +#endif + /* Always define this when using the GNU C Library */ +#ifndef USED_FOR_TARGET #undef _GNU_SOURCE +#endif + /* Define to `int' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef gid_t +#endif + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ @@ -562,16 +1377,31 @@ #endif /* Define to `int' if does not define. */ +#ifndef USED_FOR_TARGET #undef pid_t +#endif + /* Define to \`long' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef rlim_t +#endif + /* Define to `int' if does not define. */ +#ifndef USED_FOR_TARGET #undef ssize_t +#endif + /* Define to `int' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef uid_t +#endif + /* Define as `fork' if `vfork' does not work. */ +#ifndef USED_FOR_TARGET #undef vfork +#endif + diff --git a/contrib/gcc/config/arm/README-interworking b/contrib/gcc/config/arm/README-interworking index 0a03cdc3c9d..d221e155576 100644 --- a/contrib/gcc/config/arm/README-interworking +++ b/contrib/gcc/config/arm/README-interworking @@ -78,7 +78,7 @@ then the following rules must be obeyed: * All externally visible functions which should be entered in Thumb mode must have the .thumb_func pseudo op specified just - before their entry point. eg: + before their entry point. e.g.: .code 16 .global function diff --git a/contrib/gcc/config/arm/aof.h b/contrib/gcc/config/arm/aof.h index 5a6ab2c0e2c..8a1223c45d8 100644 --- a/contrib/gcc/config/arm/aof.h +++ b/contrib/gcc/config/arm/aof.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler, for Advanced RISC Machines ARM compilation, AOF Assembler. - Copyright (C) 1995, 1996, 1997, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2000, 2003, 2004 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@armltd.co.uk) This file is part of GCC. @@ -17,8 +18,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ @@ -34,8 +35,7 @@ #define ENDFILE_SPEC "crtend.o%s" #ifndef ASM_SPEC -#define ASM_SPEC "%{g -g} -arch 4 \ --apcs 3%{mapcs-32:/32bit}%{mapcs-26:/26bit}%{!mapcs-26:%{!macps-32:/26bit}}" +#define ASM_SPEC "%{g -g} -arch 4 -apcs 3/32bit" #endif #ifndef LIB_SPEC @@ -44,48 +44,6 @@ #define LIBGCC_SPEC "libgcc.a%s" -/* Dividing the Output into Sections (Text, Data, ...) */ -/* AOF Assembler syntax is a nightmare when it comes to areas, since once - we change from one area to another, we can't go back again. Instead, - we must create a new area with the same attributes and add the new output - to that. Unfortunately, there is nothing we can do here to guarantee that - two areas with the same attributes will be linked adjacently in the - resulting executable, so we have to be careful not to do pc-relative - addressing across such boundaries. */ -#define TEXT_SECTION_ASM_OP aof_text_section () - -#define DATA_SECTION_ASM_OP aof_data_section () - -#define EXTRA_SECTIONS in_zero_init, in_common - -#define EXTRA_SECTION_FUNCTIONS \ - ZERO_INIT_SECTION \ - COMMON_SECTION - -#define ZERO_INIT_SECTION \ - void \ - zero_init_section () \ - { \ - static int zero_init_count = 1; \ - \ - if (in_section != in_zero_init) \ - { \ - fprintf (asm_out_file, "\tAREA |C$$zidata%d|,NOINIT\n", \ - zero_init_count++); \ - in_section = in_zero_init; \ - } \ - } - -/* Used by ASM_OUTPUT_COMMON (below) to tell varasm.c that we've - changed areas. */ -#define COMMON_SECTION \ - void \ - common_section () \ - { \ - if (in_section != in_common) \ - in_section = in_common; \ - } - #define CTOR_LIST_BEGIN \ asm (CTORS_SECTION_ASM_OP); \ extern func_ptr __CTOR_END__[1]; \ @@ -130,6 +88,8 @@ whole table generation until the end of the function. */ #define JUMP_TABLES_IN_TEXT_SECTION 1 +#define TARGET_ASM_INIT_SECTIONS aof_asm_init_sections + /* Some systems use __main in a way incompatible with its use in gcc, in these cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to give the same symbol without quotes for an alternative entry point. You @@ -159,7 +119,7 @@ /* Output of Uninitialized Variables. */ #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ - (common_section (), \ + (in_section = NULL, \ fprintf ((STREAM), "\tAREA "), \ assemble_name ((STREAM), (NAME)), \ fprintf ((STREAM), ", DATA, COMMON\n\t%% %d\t%s size=%d\n", \ @@ -246,7 +206,12 @@ do { \ "wr0", "wr1", "wr2", "wr3", \ "wr4", "wr5", "wr6", "wr7", \ "wr8", "wr9", "wr10", "wr11", \ - "wr12", "wr13", "wr14", "wr15" \ + "wr12", "wr13", "wr14", "wr15", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \ + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \ + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \ + "vfpcc" \ } #define ADDITIONAL_REGISTER_NAMES \ @@ -266,7 +231,23 @@ do { \ {"r12", 12}, {"ip", 12}, \ {"r13", 13}, {"sp", 13}, \ {"r14", 14}, {"lr", 14}, \ - {"r15", 15}, {"pc", 15} \ + {"r15", 15}, {"pc", 15}, \ + {"d0", 63}, \ + {"d1", 65}, \ + {"d2", 67}, \ + {"d3", 69}, \ + {"d4", 71}, \ + {"d5", 73}, \ + {"d6", 75}, \ + {"d7", 77}, \ + {"d8", 79}, \ + {"d9", 81}, \ + {"d10", 83}, \ + {"d11", 85}, \ + {"d12", 87}, \ + {"d13", 89}, \ + {"d14", 91}, \ + {"d15", 93} \ } #define REGISTER_PREFIX "__" diff --git a/contrib/gcc/config/arm/aout.h b/contrib/gcc/config/arm/aout.h index 1f060fafc7b..903afa70f04 100644 --- a/contrib/gcc/config/arm/aout.h +++ b/contrib/gcc/config/arm/aout.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with a.out - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@armltd.co.uk). @@ -17,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef ASM_APP_ON #define ASM_APP_ON "" @@ -49,7 +49,7 @@ /* The assembler's names for the registers. */ #ifndef REGISTER_NAMES -#define REGISTER_NAMES \ +#define REGISTER_NAMES \ { \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \ @@ -63,7 +63,12 @@ "wr0", "wr1", "wr2", "wr3", \ "wr4", "wr5", "wr6", "wr7", \ "wr8", "wr9", "wr10", "wr11", \ - "wr12", "wr13", "wr14", "wr15" \ + "wr12", "wr13", "wr14", "wr15", \ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \ + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \ + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \ + "vfpcc" \ } #endif @@ -152,7 +157,23 @@ {"mvdx12", 39}, \ {"mvdx13", 40}, \ {"mvdx14", 41}, \ - {"mvdx15", 42} \ + {"mvdx15", 42}, \ + {"d0", 63}, \ + {"d1", 65}, \ + {"d2", 67}, \ + {"d3", 69}, \ + {"d4", 71}, \ + {"d5", 73}, \ + {"d6", 75}, \ + {"d7", 77}, \ + {"d8", 79}, \ + {"d9", 81}, \ + {"d10", 83}, \ + {"d11", 85}, \ + {"d12", 87}, \ + {"d13", 89}, \ + {"d14", 91}, \ + {"d15", 93}, \ } #endif @@ -172,19 +193,6 @@ #define DBX_CONTIN_LENGTH 0 #endif -/* Output a source filename for the debugger. RISCiX dbx insists that the - ``desc'' field is set to compiler version number >= 315 (sic). */ -#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME) \ - do \ - { \ - fprintf (STREAM, ".stabs "); \ - output_quoted_string (STREAM, NAME); \ - fprintf (STREAM, ",%d,0,315,%s\n", N_SO, <ext_label_name[1]); \ - text_section (); \ - (*targetm.asm_out.internal_label) (STREAM, "Ltext", 0); \ - } \ - while (0) - /* Output a function label definition. */ #ifndef ASM_DECLARE_FUNCTION_NAME #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ @@ -265,7 +273,7 @@ #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \ do \ { \ - bss_section (); \ + switch_to_section (bss_section); \ ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \ ASM_OUTPUT_LABEL (STREAM, NAME); \ fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \ diff --git a/contrib/gcc/config/arm/arm-cores.def b/contrib/gcc/config/arm/arm-cores.def new file mode 100644 index 00000000000..3f9b7bad4a8 --- /dev/null +++ b/contrib/gcc/config/arm/arm-cores.def @@ -0,0 +1,117 @@ +/* ARM CPU Cores + Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Written by CodeSourcery, LLC + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* Before using #include to read this file, define a macro: + + ARM_CORE(CORE_NAME, CORE_IDENT, ARCH, FLAGS, COSTS) + + The CORE_NAME is the name of the core, represented as a string constant. + The CORE_IDENT is the name of the core, represented as an identifier. + ARCH is the architecture revision implemented by the chip. + FLAGS are the bitwise-or of the traits that apply to that core. + This need not include flags implied by the architecture. + COSTS is the name of the rtx_costs routine to use. + + If you update this table, you must update the "tune" attribute in + arm.md. + + Some tools assume no whitespace up to the first "," in each entry. */ + +/* V2/V2A Architecture Processors */ +ARM_CORE("arm2", arm2, 2, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm250", arm250, 2, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm3", arm3, 2, FL_CO_PROC | FL_MODE26, slowmul) + +/* V3 Architecture Processors */ +ARM_CORE("arm6", arm6, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm60", arm60, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm600", arm600, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm610", arm610, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm620", arm620, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm7", arm7, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm7d", arm7d, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm7di", arm7di, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm70", arm70, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm700", arm700, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm700i", arm700i, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm710", arm710, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm720", arm720, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm710c", arm710c, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm7100", arm7100, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm7500", arm7500, 3, FL_MODE26 | FL_WBUF, slowmul) +/* Doesn't have an external co-proc, but does have embedded fpa. */ +ARM_CORE("arm7500fe", arm7500fe, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) + +/* V3M Architecture Processors */ +/* arm7m doesn't exist on its own, but only with D, ("and", and I), but + those don't alter the code, so arm7m is sometimes used. */ +ARM_CORE("arm7m", arm7m, 3M, FL_CO_PROC | FL_MODE26, fastmul) +ARM_CORE("arm7dm", arm7dm, 3M, FL_CO_PROC | FL_MODE26, fastmul) +ARM_CORE("arm7dmi", arm7dmi, 3M, FL_CO_PROC | FL_MODE26, fastmul) + +/* V4 Architecture Processors */ +ARM_CORE("arm8", arm8, 4, FL_MODE26 | FL_LDSCHED, fastmul) +ARM_CORE("arm810", arm810, 4, FL_MODE26 | FL_LDSCHED, fastmul) +ARM_CORE("strongarm", strongarm, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE("strongarm110", strongarm110, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE("strongarm1100", strongarm1100, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, fastmul) +ARM_CORE("strongarm1110", strongarm1110, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, fastmul) + +/* V4T Architecture Processors */ +ARM_CORE("arm7tdmi", arm7tdmi, 4T, FL_CO_PROC , fastmul) +ARM_CORE("arm7tdmi-s", arm7tdmis, 4T, FL_CO_PROC , fastmul) +ARM_CORE("arm710t", arm710t, 4T, FL_WBUF, fastmul) +ARM_CORE("arm720t", arm720t, 4T, FL_WBUF, fastmul) +ARM_CORE("arm740t", arm740t, 4T, FL_WBUF, fastmul) +ARM_CORE("arm9", arm9, 4T, FL_LDSCHED, fastmul) +ARM_CORE("arm9tdmi", arm9tdmi, 4T, FL_LDSCHED, fastmul) +ARM_CORE("arm920", arm920, 4T, FL_LDSCHED, fastmul) +ARM_CORE("arm920t", arm920t, 4T, FL_LDSCHED, fastmul) +ARM_CORE("arm922t", arm922t, 4T, FL_LDSCHED, fastmul) +ARM_CORE("arm940t", arm940t, 4T, FL_LDSCHED, fastmul) +ARM_CORE("ep9312", ep9312, 4T, FL_LDSCHED | FL_CIRRUS, fastmul) + +/* V5T Architecture Processors */ +ARM_CORE("arm10tdmi", arm10tdmi, 5T, FL_LDSCHED, fastmul) +ARM_CORE("arm1020t", arm1020t, 5T, FL_LDSCHED, fastmul) + +/* V5TE Architecture Processors */ +ARM_CORE("arm9e", arm9e, 5TE, FL_LDSCHED, 9e) +ARM_CORE("arm946e-s", arm946es, 5TE, FL_LDSCHED, 9e) +ARM_CORE("arm966e-s", arm966es, 5TE, FL_LDSCHED, 9e) +ARM_CORE("arm968e-s", arm968es, 5TE, FL_LDSCHED, 9e) +ARM_CORE("arm10e", arm10e, 5TE, FL_LDSCHED, fastmul) +ARM_CORE("arm1020e", arm1020e, 5TE, FL_LDSCHED, fastmul) +ARM_CORE("arm1022e", arm1022e, 5TE, FL_LDSCHED, fastmul) +ARM_CORE("xscale", xscale, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale) +ARM_CORE("iwmmxt", iwmmxt, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale) + +/* V5TEJ Architecture Processors */ +ARM_CORE("arm926ej-s", arm926ejs, 5TEJ, FL_LDSCHED, 9e) +ARM_CORE("arm1026ej-s", arm1026ejs, 5TEJ, FL_LDSCHED, 9e) + +/* V6 Architecture Processors */ +ARM_CORE("arm1136j-s", arm1136js, 6J, FL_LDSCHED, 9e) +ARM_CORE("arm1136jf-s", arm1136jfs, 6J, FL_LDSCHED | FL_VFPV2, 9e) +ARM_CORE("arm1176jz-s", arm1176jzs, 6ZK, FL_LDSCHED, 9e) +ARM_CORE("arm1176jzf-s", arm1176jzfs, 6ZK, FL_LDSCHED | FL_VFPV2, 9e) +ARM_CORE("mpcorenovfp", mpcorenovfp, 6K, FL_LDSCHED, 9e) +ARM_CORE("mpcore", mpcore, 6K, FL_LDSCHED | FL_VFPV2, 9e) diff --git a/contrib/gcc/config/arm/arm-generic.md b/contrib/gcc/config/arm/arm-generic.md new file mode 100644 index 00000000000..611648648b1 --- /dev/null +++ b/contrib/gcc/config/arm/arm-generic.md @@ -0,0 +1,152 @@ +;; Generic ARM Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +(define_automaton "arm") + +;; Write buffer +; +; Strictly, we should model a 4-deep write buffer for ARM7xx based chips +; +; The write buffer on some of the arm6 processors is hard to model exactly. +; There is room in the buffer for up to two addresses and up to eight words +; of memory, but the two needn't be split evenly. When writing the two +; addresses are fully pipelined. However, a read from memory that is not +; currently in the cache will block until the writes have completed. +; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so +; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous +; (they aren't allowed to be at present) then there is a startup cost of 1MCLK +; cycle to add as well. +(define_cpu_unit "write_buf" "arm") + +;; Write blockage unit +; +; The write_blockage unit models (partially), the fact that reads will stall +; until the write buffer empties. +; The f_mem_r and r_mem_f could also block, but they are to the stack, +; so we don't model them here +(define_cpu_unit "write_blockage" "arm") + +;; Core +; +(define_cpu_unit "core" "arm") + +(define_insn_reservation "r_mem_f_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "r_mem_f"))) + "core+write_buf*3") + +(define_insn_reservation "store_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store1"))) + "core+write_buf*3+write_blockage*5") + +(define_insn_reservation "store2_wbuf" 7 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store2"))) + "core+write_buf*4+write_blockage*7") + +(define_insn_reservation "store3_wbuf" 9 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store3"))) + "core+write_buf*5+write_blockage*9") + +(define_insn_reservation "store4_wbuf" 11 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store4"))) + "core+write_buf*6+write_blockage*11") + +(define_insn_reservation "store2" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store2"))) + "core*3") + +(define_insn_reservation "store3" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store3"))) + "core*4") + +(define_insn_reservation "store4" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store4"))) + "core*5") + +(define_insn_reservation "store_ldsched" 1 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (eq_attr "type" "store1"))) + "core") + +(define_insn_reservation "load_ldsched_xscale" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "yes")))) + "core") + +(define_insn_reservation "load_ldsched" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "no")))) + "core") + +(define_insn_reservation "load_or_store" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "!yes") + (eq_attr "type" "load_byte,load1,load2,load3,load4,store1"))) + "core*2") + +(define_insn_reservation "mult" 16 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "no") (eq_attr "type" "mult"))) + "core*16") + +(define_insn_reservation "mult_ldsched_strongarm" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "yes") + (eq_attr "type" "mult")))) + "core*2") + +(define_insn_reservation "mult_ldsched" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "no") + (eq_attr "type" "mult")))) + "core*4") + +(define_insn_reservation "multi_cycle" 32 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "core_cycles" "multi") + (eq_attr "type" "!mult,load_byte,load1,load2,load3,load4,store1,store2,store3,store4"))) + "core*32") + +(define_insn_reservation "single_cycle" 1 + (and (eq_attr "generic_sched" "yes") + (eq_attr "core_cycles" "single")) + "core") diff --git a/contrib/gcc/config/arm/arm-modes.def b/contrib/gcc/config/arm/arm-modes.def index b8535519141..10ba02576bb 100644 --- a/contrib/gcc/config/arm/arm-modes.def +++ b/contrib/gcc/config/arm/arm-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -19,8 +19,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Extended precision floating point. FIXME What format is this? */ @@ -50,3 +50,11 @@ CC_MODE (CC_DGEU); CC_MODE (CC_DGTU); CC_MODE (CC_C); CC_MODE (CC_N); + +/* Vector modes. */ +VECTOR_MODES (INT, 4); /* V4QI V2HI */ +VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */ +VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */ +VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */ +VECTOR_MODES (FLOAT, 16); /* V8HF V4SF V2DF */ + diff --git a/contrib/gcc/config/arm/arm-protos.h b/contrib/gcc/config/arm/arm-protos.h index 0b28e74ea4f..c8c119e577f 100644 --- a/contrib/gcc/config/arm/arm-protos.h +++ b/contrib/gcc/config/arm/arm-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in arm.c and pe.c - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) @@ -18,8 +18,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef GCC_ARM_PROTOS_H #define GCC_ARM_PROTOS_H @@ -27,76 +27,57 @@ extern void arm_override_options (void); extern int use_return_insn (int, rtx); extern int arm_regno_class (int); -extern void arm_finalize_pic (int); +extern void arm_load_pic_register (unsigned long); extern int arm_volatile_func (void); extern const char *arm_output_epilogue (rtx); extern void arm_expand_prologue (void); -extern HOST_WIDE_INT arm_get_frame_size (void); extern const char *arm_strip_name_encoding (const char *); extern void arm_asm_output_labelref (FILE *, const char *); extern unsigned long arm_current_func_type (void); -extern unsigned int arm_compute_initial_elimination_offset (unsigned int, - unsigned int); +extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int, + unsigned int); +extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int, + unsigned int); +extern unsigned int arm_dbx_register_number (unsigned int); +extern void arm_output_fn_unwind (FILE *, bool); + #ifdef TREE_CODE extern int arm_return_in_memory (tree); extern void arm_encode_call_attribute (tree, int); #endif #ifdef RTX_CODE +extern bool arm_vector_mode_supported_p (enum machine_mode); extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode); extern int const_ok_for_arm (HOST_WIDE_INT); -extern int arm_split_constant (RTX_CODE, enum machine_mode, HOST_WIDE_INT, rtx, - rtx, int); -extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, rtx *); +extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx, + HOST_WIDE_INT, rtx, rtx, int); +extern RTX_CODE arm_canonicalize_comparison (RTX_CODE, enum machine_mode, + rtx *); extern int legitimate_pic_operand_p (rtx); extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx); -extern int arm_legitimate_address_p (enum machine_mode, rtx, int); +extern rtx legitimize_tls_address (rtx, rtx); +extern int arm_legitimate_address_p (enum machine_mode, rtx, RTX_CODE, int); extern int thumb_legitimate_address_p (enum machine_mode, rtx, int); extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT); extern rtx arm_legitimize_address (rtx, rtx, enum machine_mode); -extern int const_double_rtx_ok_for_fpa (rtx); +extern rtx thumb_legitimize_address (rtx, rtx, enum machine_mode); +extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int, + int); +extern int arm_const_double_rtx (rtx); extern int neg_const_double_rtx_ok_for_fpa (rtx); +extern enum reg_class coproc_secondary_reload_class (enum machine_mode, rtx, + bool); +extern bool arm_tls_referenced_p (rtx); -/* Predicates. */ -extern int s_register_operand (rtx, enum machine_mode); -extern int arm_hard_register_operand (rtx, enum machine_mode); -extern int f_register_operand (rtx, enum machine_mode); -extern int reg_or_int_operand (rtx, enum machine_mode); -extern int arm_reload_memory_operand (rtx, enum machine_mode); -extern int arm_rhs_operand (rtx, enum machine_mode); -extern int arm_rhsm_operand (rtx, enum machine_mode); -extern int arm_add_operand (rtx, enum machine_mode); -extern int arm_addimm_operand (rtx, enum machine_mode); -extern int arm_not_operand (rtx, enum machine_mode); -extern int offsettable_memory_operand (rtx, enum machine_mode); -extern int alignable_memory_operand (rtx, enum machine_mode); -extern int bad_signed_byte_operand (rtx, enum machine_mode); -extern int fpa_rhs_operand (rtx, enum machine_mode); -extern int fpa_add_operand (rtx, enum machine_mode); -extern int power_of_two_operand (rtx, enum machine_mode); -extern int nonimmediate_di_operand (rtx, enum machine_mode); -extern int di_operand (rtx, enum machine_mode); -extern int nonimmediate_soft_df_operand (rtx, enum machine_mode); -extern int soft_df_operand (rtx, enum machine_mode); -extern int index_operand (rtx, enum machine_mode); -extern int const_shift_operand (rtx, enum machine_mode); -extern int arm_comparison_operator (rtx, enum machine_mode); -extern int shiftable_operator (rtx, enum machine_mode); -extern int shift_operator (rtx, enum machine_mode); -extern int equality_operator (rtx, enum machine_mode); -extern int minmax_operator (rtx, enum machine_mode); -extern int cc_register (rtx, enum machine_mode); -extern int dominant_cc_register (rtx, enum machine_mode); -extern int logical_binary_operator (rtx, enum machine_mode); -extern int multi_register_push (rtx, enum machine_mode); -extern int load_multiple_operation (rtx, enum machine_mode); -extern int store_multiple_operation (rtx, enum machine_mode); -extern int cirrus_fp_register (rtx, enum machine_mode); -extern int cirrus_general_operand (rtx, enum machine_mode); -extern int cirrus_register_operand (rtx, enum machine_mode); -extern int cirrus_shift_const (rtx, enum machine_mode); extern int cirrus_memory_offset (rtx); +extern int arm_coproc_mem_operand (rtx, bool); +extern int arm_no_early_store_addr_dep (rtx, rtx); +extern int arm_no_early_alu_shift_dep (rtx, rtx); +extern int arm_no_early_alu_shift_value_dep (rtx, rtx); +extern int arm_no_early_mul_dep (rtx, rtx); +extern int tls_mentioned_p (rtx); extern int symbol_mentioned_p (rtx); extern int label_mentioned_p (rtx); extern RTX_CODE minmax_code (rtx); @@ -109,8 +90,7 @@ extern rtx arm_gen_load_multiple (int, int, rtx, int, int, rtx, HOST_WIDE_INT *); extern rtx arm_gen_store_multiple (int, int, rtx, int, int, rtx, HOST_WIDE_INT *); -extern int arm_gen_movstrqi (rtx *); -extern rtx arm_gen_rotated_half_load (rtx); +extern int arm_gen_movmemqi (rtx *); extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx); extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx, HOST_WIDE_INT); @@ -118,6 +98,8 @@ extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx); extern rtx arm_gen_return_addr_mask (void); extern void arm_reload_in_hi (rtx *); extern void arm_reload_out_hi (rtx *); +extern int arm_const_double_inline_cost (rtx); +extern bool arm_const_double_by_parts (rtx); extern const char *fp_immediate_constant (rtx); extern const char *output_call (rtx *); extern const char *output_call_mem (rtx *); @@ -127,7 +109,6 @@ extern const char *output_mov_long_double_arm_from_arm (rtx *); extern const char *output_mov_double_fpa_from_arm (rtx *); extern const char *output_mov_double_arm_from_fpa (rtx *); extern const char *output_move_double (rtx *); -extern const char *output_mov_immediate (rtx *); extern const char *output_add_immediate (rtx *); extern const char *arithmetic_instr (rtx, int); extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int); @@ -141,24 +122,27 @@ extern int arm_debugger_arg_offset (int, rtx); extern int arm_is_longcall_p (rtx, int, int); extern int arm_emit_vector_const (FILE *, rtx); extern const char * arm_output_load_gr (rtx *); +extern const char *vfp_output_fstmx (rtx *); +extern void arm_set_return_address (rtx, rtx); extern int arm_eliminable_register (rtx); +extern bool arm_output_addr_const_extra (FILE *, rtx); + #if defined TREE_CODE extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); -extern rtx arm_va_arg (tree, tree); -extern int arm_function_arg_pass_by_reference (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); +extern bool arm_pad_arg_upward (enum machine_mode, tree); +extern bool arm_pad_reg_upward (enum machine_mode, tree, int); +extern bool arm_needs_doubleword_align (enum machine_mode, tree); +extern rtx arm_function_value(tree, tree); #endif +extern int arm_apply_result_size (void); -#if defined AOF_ASSEMBLER +#if defined AOF_ASSEMBLER extern rtx aof_pic_entry (rtx); -extern char *aof_text_section (void); -extern char *aof_data_section (void); extern void aof_add_import (const char *); extern void aof_delete_import (const char *); extern void zero_init_section (void); -extern void common_section (void); #endif /* AOF_ASSEMBLER */ #endif /* RTX_CODE */ @@ -167,9 +151,7 @@ extern int arm_float_words_big_endian (void); /* Thumb functions. */ extern void arm_init_expanders (void); -extern int thumb_far_jump_used_p (int); extern const char *thumb_unexpanded_epilogue (void); -extern HOST_WIDE_INT thumb_get_frame_size (void); extern void thumb_expand_prologue (void); extern void thumb_expand_epilogue (void); #ifdef TREE_CODE @@ -180,14 +162,13 @@ extern int thumb_shiftable_const (unsigned HOST_WIDE_INT); extern void thumb_final_prescan_insn (rtx); extern const char *thumb_load_double_from_address (rtx *); extern const char *thumb_output_move_mem_multiple (int, rtx *); -extern void thumb_expand_movstrqi (rtx *); -extern int thumb_cmp_operand (rtx, enum machine_mode); -extern int thumb_cbrch_target_operand (rtx, enum machine_mode); -extern rtx *thumb_legitimize_pic_address (rtx, enum machine_mode, rtx); +extern const char *thumb_call_via_reg (rtx); +extern void thumb_expand_movmemqi (rtx *); extern int thumb_go_if_legitimate_address (enum machine_mode, rtx); extern rtx arm_return_addr (int, rtx); extern void thumb_reload_out_hi (rtx *); extern void thumb_reload_in_hi (rtx *); +extern void thumb_set_return_address (rtx, rtx); #endif /* Defined in pe.c. */ diff --git a/contrib/gcc/config/arm/arm-tune.md b/contrib/gcc/config/arm/arm-tune.md new file mode 100644 index 00000000000..950cd912982 --- /dev/null +++ b/contrib/gcc/config/arm/arm-tune.md @@ -0,0 +1,5 @@ +;; -*- buffer-read-only: t -*- +;; Generated automatically by gentune.sh from arm-cores.def +(define_attr "tune" + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore" + (const (symbol_ref "arm_tune"))) diff --git a/contrib/gcc/config/arm/arm.c b/contrib/gcc/config/arm/arm.c index 2f0eaedbe13..dc7aa77b6d6 100644 --- a/contrib/gcc/config/arm/arm.c +++ b/contrib/gcc/config/arm/arm.c @@ -1,6 +1,6 @@ /* Output routines for GCC for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -19,9 +19,9 @@ 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. */ - + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + #include "config.h" #include "system.h" #include "coretypes.h" @@ -51,6 +51,7 @@ #include "target.h" #include "target-def.h" #include "debug.h" +#include "langhooks.h" /* Forward definitions of types. */ typedef struct minipool_node Mnode; @@ -59,34 +60,32 @@ typedef struct minipool_fixup Mfix; const struct attribute_spec arm_attribute_table[]; /* Forward function declarations. */ +static arm_stack_offsets *arm_get_frame_offsets (void); static void arm_add_gc_roots (void); -static int arm_gen_constant (enum rtx_code, enum machine_mode, HOST_WIDE_INT, - rtx, rtx, int, int); +static int arm_gen_constant (enum rtx_code, enum machine_mode, rtx, + HOST_WIDE_INT, rtx, rtx, int, int); static unsigned bit_count (unsigned long); static int arm_address_register_rtx_p (rtx, int); -static int arm_legitimate_index_p (enum machine_mode, rtx, int); +static int arm_legitimate_index_p (enum machine_mode, rtx, RTX_CODE, int); static int thumb_base_register_rtx_p (rtx, enum machine_mode, int); inline static int thumb_index_register_rtx_p (rtx, int); +static int thumb_far_jump_used_p (void); +static bool thumb_force_lr_save (void); static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code); -static rtx emit_multi_reg_push (int); static rtx emit_sfm (int, int); +static int arm_size_return_regs (void); #ifndef AOF_ASSEMBLER static bool arm_assemble_integer (rtx, unsigned int, int); #endif static const char *fp_const_from_val (REAL_VALUE_TYPE *); static arm_cc get_arm_condition_code (rtx); -static void init_fpa_table (void); static HOST_WIDE_INT int_log2 (HOST_WIDE_INT); static rtx is_jump_table (rtx); static const char *output_multi_immediate (rtx *, const char *, const char *, int, HOST_WIDE_INT); -static void print_multi_reg (FILE *, const char *, int, int); static const char *shift_op (rtx, HOST_WIDE_INT *); static struct machine_function *arm_init_machine_status (void); -static int number_of_first_bit_set (int); -static void replace_symbols_in_block (tree, rtx, rtx); -static void thumb_exit (FILE *, int, rtx); -static void thumb_pushpop (FILE *, int, int, int *, int); +static void thumb_exit (FILE *, int); static rtx is_jump_table (rtx); static HOST_WIDE_INT get_jump_table_size (rtx); static Mnode *move_minipool_fix_forward_ref (Mnode *, Mnode *, HOST_WIDE_INT); @@ -110,13 +109,15 @@ static unsigned long arm_isr_value (tree); static unsigned long arm_compute_func_type (void); static tree arm_handle_fndecl_attribute (tree *, tree, tree, int, bool *); static tree arm_handle_isr_attribute (tree *, tree, tree, int, bool *); +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES +static tree arm_handle_notshared_attribute (tree *, tree, tree, int, bool *); +#endif static void arm_output_function_epilogue (FILE *, HOST_WIDE_INT); static void arm_output_function_prologue (FILE *, HOST_WIDE_INT); static void thumb_output_function_prologue (FILE *, HOST_WIDE_INT); static int arm_comp_type_attributes (tree, tree); static void arm_set_default_type_attributes (tree); static int arm_adjust_cost (rtx, rtx, rtx, int); -static int arm_use_dfa_pipeline_interface (void); static int count_insns_for_constant (HOST_WIDE_INT, int); static int arm_get_strip_length (int); static bool arm_function_ok_for_sibcall (tree, tree); @@ -124,7 +125,11 @@ static void arm_internal_label (FILE *, const char *, unsigned long); static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static int arm_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); -static bool arm_rtx_costs (rtx, int, int, int *); +static bool arm_size_rtx_costs (rtx, int, int, int *); +static bool arm_slowmul_rtx_costs (rtx, int, int, int *); +static bool arm_fastmul_rtx_costs (rtx, int, int, int *); +static bool arm_xscale_rtx_costs (rtx, int, int, int *); +static bool arm_9e_rtx_costs (rtx, int, int, int *); static int arm_address_cost (rtx); static bool arm_memory_load_p (rtx); static bool arm_cirrus_insn_p (rtx); @@ -136,24 +141,60 @@ static rtx safe_vector_operand (rtx, enum machine_mode); static rtx arm_expand_binop_builtin (enum insn_code, tree, rtx); static rtx arm_expand_unop_builtin (enum insn_code, tree, rtx, int); static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static void emit_constant_insn (rtx cond, rtx pattern); +static rtx emit_set_insn (rtx, rtx); +static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); #ifdef OBJECT_FORMAT_ELF -static void arm_elf_asm_named_section (const char *, unsigned int); +static void arm_elf_asm_constructor (rtx, int); #endif #ifndef ARM_PE static void arm_encode_section_info (tree, rtx, int); #endif + +static void arm_file_end (void); + #ifdef AOF_ASSEMBLER static void aof_globalize_label (FILE *, const char *); static void aof_dump_imports (FILE *); static void aof_dump_pic_table (FILE *); static void aof_file_start (void); static void aof_file_end (void); +static void aof_asm_init_sections (void); #endif +static void arm_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree, int *, int); +static bool arm_pass_by_reference (CUMULATIVE_ARGS *, + enum machine_mode, tree, bool); +static bool arm_promote_prototypes (tree); +static bool arm_default_short_enums (void); +static bool arm_align_anon_bitfield (void); +static bool arm_return_in_msb (tree); +static bool arm_must_pass_in_stack (enum machine_mode, tree); +#ifdef TARGET_UNWIND_INFO +static void arm_unwind_emit (FILE *, rtx); +static bool arm_output_ttype (rtx); +#endif + +static tree arm_cxx_guard_type (void); +static bool arm_cxx_guard_mask_bit (void); +static tree arm_get_cookie_size (tree); +static bool arm_cookie_has_size (void); +static bool arm_cxx_cdtor_returns_this (void); +static bool arm_cxx_key_method_may_be_inline (void); +static void arm_cxx_determine_class_data_visibility (tree); +static bool arm_cxx_class_data_always_comdat (void); +static bool arm_cxx_use_aeabi_atexit (void); +static void arm_init_libfuncs (void); +static bool arm_handle_option (size_t, const char *, int); +static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); +static bool arm_cannot_copy_insn_p (rtx); +static bool arm_tls_symbol_p (rtx x); /* Initialize the GCC target structure. */ -#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES #undef TARGET_MERGE_DECL_ATTRIBUTES #define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes #endif @@ -161,6 +202,9 @@ static void aof_file_end (void); #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE arm_attribute_table +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END arm_file_end + #ifdef AOF_ASSEMBLER #undef TARGET_ASM_BYTE_OP #define TARGET_ASM_BYTE_OP "\tDCB\t" @@ -187,6 +231,11 @@ static void aof_file_end (void); #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE arm_output_function_epilogue +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION arm_handle_option + #undef TARGET_COMP_TYPE_ATTRIBUTES #define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes @@ -196,9 +245,6 @@ static void aof_file_end (void); #undef TARGET_SCHED_ADJUST_COST #define TARGET_SCHED_ADJUST_COST arm_adjust_cost -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE arm_use_dfa_pipeline_interface - #undef TARGET_ENCODE_SECTION_INFO #ifdef ARM_PE #define TARGET_ENCODE_SECTION_INFO arm_pe_encode_section_info @@ -220,11 +266,17 @@ static void aof_file_end (void); #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall +/* This will be overridden in arm_override_options. */ #undef TARGET_RTX_COSTS -#define TARGET_RTX_COSTS arm_rtx_costs +#define TARGET_RTX_COSTS arm_slowmul_rtx_costs #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST arm_address_cost +#undef TARGET_SHIFT_TRUNCATION_MASK +#define TARGET_SHIFT_TRUNCATION_MASK arm_shift_truncation_mask +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P arm_vector_mode_supported_p + #undef TARGET_MACHINE_DEPENDENT_REORG #define TARGET_MACHINE_DEPENDENT_REORG arm_reorg @@ -233,6 +285,89 @@ static void aof_file_end (void); #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN arm_expand_builtin +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS arm_init_libfuncs + +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES arm_promote_prototypes +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE arm_pass_by_reference +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES arm_arg_partial_bytes + +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs + +#undef TARGET_DEFAULT_SHORT_ENUMS +#define TARGET_DEFAULT_SHORT_ENUMS arm_default_short_enums + +#undef TARGET_ALIGN_ANON_BITFIELD +#define TARGET_ALIGN_ANON_BITFIELD arm_align_anon_bitfield + +#undef TARGET_NARROW_VOLATILE_BITFIELD +#define TARGET_NARROW_VOLATILE_BITFIELD hook_bool_void_false + +#undef TARGET_CXX_GUARD_TYPE +#define TARGET_CXX_GUARD_TYPE arm_cxx_guard_type + +#undef TARGET_CXX_GUARD_MASK_BIT +#define TARGET_CXX_GUARD_MASK_BIT arm_cxx_guard_mask_bit + +#undef TARGET_CXX_GET_COOKIE_SIZE +#define TARGET_CXX_GET_COOKIE_SIZE arm_get_cookie_size + +#undef TARGET_CXX_COOKIE_HAS_SIZE +#define TARGET_CXX_COOKIE_HAS_SIZE arm_cookie_has_size + +#undef TARGET_CXX_CDTOR_RETURNS_THIS +#define TARGET_CXX_CDTOR_RETURNS_THIS arm_cxx_cdtor_returns_this + +#undef TARGET_CXX_KEY_METHOD_MAY_BE_INLINE +#define TARGET_CXX_KEY_METHOD_MAY_BE_INLINE arm_cxx_key_method_may_be_inline + +#undef TARGET_CXX_USE_AEABI_ATEXIT +#define TARGET_CXX_USE_AEABI_ATEXIT arm_cxx_use_aeabi_atexit + +#undef TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY +#define TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY \ + arm_cxx_determine_class_data_visibility + +#undef TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT +#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT arm_cxx_class_data_always_comdat + +#undef TARGET_RETURN_IN_MSB +#define TARGET_RETURN_IN_MSB arm_return_in_msb + +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK arm_must_pass_in_stack + +#ifdef TARGET_UNWIND_INFO +#undef TARGET_UNWIND_EMIT +#define TARGET_UNWIND_EMIT arm_unwind_emit + +/* EABI unwinding tables use a different format for the typeinfo tables. */ +#undef TARGET_ASM_TTYPE +#define TARGET_ASM_TTYPE arm_output_ttype + +#undef TARGET_ARM_EABI_UNWINDER +#define TARGET_ARM_EABI_UNWINDER true +#endif /* TARGET_UNWIND_INFO */ + +#undef TARGET_CANNOT_COPY_INSN_P +#define TARGET_CANNOT_COPY_INSN_P arm_cannot_copy_insn_p + +#ifdef HAVE_AS_TLS +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS true +#endif + +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM arm_tls_referenced_p + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -252,25 +387,37 @@ int making_const_table; stored from the compare operation. */ rtx arm_compare_op0, arm_compare_op1; -/* What type of floating point are we tuning for? */ -enum fputype arm_fpu_tune; +/* The processor for which instructions should be scheduled. */ +enum processor_type arm_tune = arm_none; -/* What type of floating point instructions are available? */ +/* Which floating point model to use. */ +enum arm_fp_model arm_fp_model; + +/* Which floating point hardware is available. */ enum fputype arm_fpu_arch; -/* What program mode is the cpu running in? 26-bit mode or 32-bit mode. */ -enum prog_mode_type arm_prgmode; +/* Which floating point hardware to schedule for. */ +enum fputype arm_fpu_tune; -/* Set by the -mfp=... option. */ -const char * target_fp_name = NULL; +/* Whether to use floating point hardware. */ +enum float_abi_type arm_float_abi; + +/* Which ABI to use. */ +enum arm_abi_type arm_abi; + +/* Which thread pointer model to use. */ +enum arm_tp_type target_thread_pointer = TP_AUTO; /* Used to parse -mstructure_size_boundary command line option. */ -const char * structure_size_string = NULL; int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY; +/* Used for Thumb call_via trampolines. */ +rtx thumb_call_via_label[14]; +static int thumb_call_reg_needed; + /* Bit values used to identify processor capabilities. */ #define FL_CO_PROC (1 << 0) /* Has external co-processor bus */ -#define FL_FAST_MULT (1 << 1) /* Fast multiply */ +#define FL_ARCH3M (1 << 1) /* Extended multiply */ #define FL_MODE26 (1 << 2) /* 26-bit mode support */ #define FL_MODE32 (1 << 3) /* 32-bit mode support */ #define FL_ARCH4 (1 << 4) /* Architecture rel 4 */ @@ -281,41 +428,71 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY; #define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */ #define FL_XSCALE (1 << 10) /* XScale */ #define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */ -#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */ -#define FL_ARCH6J (1 << 12) /* Architecture rel 6. Adds +#define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds media instructions. */ #define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */ +#define FL_WBUF (1 << 14) /* Schedule for write buffer ops. + Note: ARM6 & 7 derivatives only. */ +#define FL_ARCH6K (1 << 15) /* Architecture rel 6 K extensions. */ + +#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */ + +#define FL_FOR_ARCH2 0 +#define FL_FOR_ARCH3 FL_MODE32 +#define FL_FOR_ARCH3M (FL_FOR_ARCH3 | FL_ARCH3M) +#define FL_FOR_ARCH4 (FL_FOR_ARCH3M | FL_ARCH4) +#define FL_FOR_ARCH4T (FL_FOR_ARCH4 | FL_THUMB) +#define FL_FOR_ARCH5 (FL_FOR_ARCH4 | FL_ARCH5) +#define FL_FOR_ARCH5T (FL_FOR_ARCH5 | FL_THUMB) +#define FL_FOR_ARCH5E (FL_FOR_ARCH5 | FL_ARCH5E) +#define FL_FOR_ARCH5TE (FL_FOR_ARCH5E | FL_THUMB) +#define FL_FOR_ARCH5TEJ FL_FOR_ARCH5TE +#define FL_FOR_ARCH6 (FL_FOR_ARCH5TE | FL_ARCH6) +#define FL_FOR_ARCH6J FL_FOR_ARCH6 +#define FL_FOR_ARCH6K (FL_FOR_ARCH6 | FL_ARCH6K) +#define FL_FOR_ARCH6Z FL_FOR_ARCH6 +#define FL_FOR_ARCH6ZK FL_FOR_ARCH6K /* The bits in this mask specify which instructions we are allowed to generate. */ static unsigned long insn_flags = 0; /* The bits in this mask specify which instruction scheduling options should - be used. Note - there is an overlap with the FL_FAST_MULT. For some - hardware we want to be able to generate the multiply instructions, but to - tune as if they were not present in the architecture. */ + be used. */ static unsigned long tune_flags = 0; /* The following are used in the arm.md file as equivalents to bits in the above two flag variables. */ -/* Nonzero if this is an "M" variant of the processor. */ -int arm_fast_multiply = 0; +/* Nonzero if this chip supports the ARM Architecture 3M extensions. */ +int arm_arch3m = 0; /* Nonzero if this chip supports the ARM Architecture 4 extensions. */ int arm_arch4 = 0; +/* Nonzero if this chip supports the ARM Architecture 4t extensions. */ +int arm_arch4t = 0; + /* Nonzero if this chip supports the ARM Architecture 5 extensions. */ int arm_arch5 = 0; /* Nonzero if this chip supports the ARM Architecture 5E extensions. */ int arm_arch5e = 0; +/* Nonzero if this chip supports the ARM Architecture 6 extensions. */ +int arm_arch6 = 0; + +/* Nonzero if this chip supports the ARM 6K extensions. */ +int arm_arch6k = 0; + /* Nonzero if this chip can benefit from load scheduling. */ int arm_ld_sched = 0; /* Nonzero if this chip is a StrongARM. */ -int arm_is_strong = 0; +int arm_tune_strongarm = 0; + +/* Nonzero if this chip is a Cirrus variant. */ +int arm_arch_cirrus = 0; /* Nonzero if this chip supports Intel Wireless MMX technology. */ int arm_arch_iwmmxt = 0; @@ -326,23 +503,27 @@ int arm_arch_xscale = 0; /* Nonzero if tuning for XScale */ int arm_tune_xscale = 0; -/* Nonzero if this chip is an ARM6 or an ARM7. */ -int arm_is_6_or_7 = 0; - -/* Nonzero if this chip is a Cirrus/DSP. */ -int arm_is_cirrus = 0; +/* Nonzero if we want to tune for stores that access the write-buffer. + This typically means an ARM6 or ARM7 with MMU or MPU. */ +int arm_tune_wbuf = 0; /* Nonzero if generating Thumb instructions. */ int thumb_code = 0; +/* Nonzero if we should define __THUMB_INTERWORK__ in the + preprocessor. + XXX This is a bit of a hack, it's intended to help work around + problems in GLD which doesn't understand that armv5t code is + interworking clean. */ +int arm_cpp_interwork = 0; + /* In case of a PRE_INC, POST_INC, PRE_DEC, POST_DEC memory reference, we must report the mode of the memory reference from PRINT_OPERAND to PRINT_OPERAND_ADDRESS. */ enum machine_mode output_memory_reference_mode; /* The register number to be used for the PIC offset register. */ -const char * arm_pic_register_string = NULL; -int arm_pic_register = INVALID_REGNUM; +unsigned arm_pic_register = INVALID_REGNUM; /* Set to 1 when a return insn is output, this means that the epilogue is not needed. */ @@ -375,7 +556,10 @@ static const char * const arm_condition_codes[] = struct processors { const char *const name; + enum processor_type core; + const char *arch; const unsigned long flags; + bool (* rtx_costs) (rtx, int, int, int *); }; /* Not all of these give usefully different compilation alternatives, @@ -383,103 +567,162 @@ struct processors static const struct processors all_cores[] = { /* ARM Cores */ - - {"arm2", FL_CO_PROC | FL_MODE26 }, - {"arm250", FL_CO_PROC | FL_MODE26 }, - {"arm3", FL_CO_PROC | FL_MODE26 }, - {"arm6", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm60", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm600", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm610", FL_MODE26 | FL_MODE32 }, - {"arm620", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* arm7m doesn't exist on its own, but only with D, (and I), but - those don't alter the code, so arm7m is sometimes used. */ - {"arm7m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7d", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dm", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7di", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dmi", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm70", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700i", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm710", FL_MODE26 | FL_MODE32 }, - {"arm720", FL_MODE26 | FL_MODE32 }, - {"arm710c", FL_MODE26 | FL_MODE32 }, - {"arm7100", FL_MODE26 | FL_MODE32 }, - {"arm7500", FL_MODE26 | FL_MODE32 }, - /* Doesn't have an external co-proc, but does have embedded fpa. */ - {"arm7500fe", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* V4 Architecture Processors */ - {"arm7tdmi", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm710t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm720t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm740t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm8", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm810", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm9", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm920", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm920t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm940t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9e", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"strongarm", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1100", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - /* V5 Architecture Processors */ - {"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm926ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"arm1026ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - /* V6 Architecture Processors */ - {"arm1136js", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - {"arm1136jfs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J | FL_VFPV2 }, - {NULL, 0} +#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ + {NAME, arm_none, #ARCH, FLAGS | FL_FOR_ARCH##ARCH, arm_##COSTS##_rtx_costs}, +#include "arm-cores.def" +#undef ARM_CORE + {NULL, arm_none, NULL, 0, NULL} }; static const struct processors all_architectures[] = { /* ARM Architectures */ - - { "armv2", FL_CO_PROC | FL_MODE26 }, - { "armv2a", FL_CO_PROC | FL_MODE26 }, - { "armv3", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - { "armv3m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - { "armv4", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 }, + /* We don't specify rtx_costs here as it will be figured out + from the core. */ + + {"armv2", arm2, "2", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH2, NULL}, + {"armv2a", arm2, "2", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH2, NULL}, + {"armv3", arm6, "3", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH3, NULL}, + {"armv3m", arm7m, "3M", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH3M, NULL}, + {"armv4", arm7tdmi, "4", FL_CO_PROC | FL_MODE26 | FL_FOR_ARCH4, NULL}, /* Strictly, FL_MODE26 is a permitted option for v4t, but there are no implementations that support it, so we will leave it out for now. */ - { "armv4t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - { "armv5", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5te", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - { "armv6j", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - { "ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - { NULL, 0 } + {"armv4t", arm7tdmi, "4T", FL_CO_PROC | FL_FOR_ARCH4T, NULL}, + {"armv5", arm10tdmi, "5", FL_CO_PROC | FL_FOR_ARCH5, NULL}, + {"armv5t", arm10tdmi, "5T", FL_CO_PROC | FL_FOR_ARCH5T, NULL}, + {"armv5e", arm1026ejs, "5E", FL_CO_PROC | FL_FOR_ARCH5E, NULL}, + {"armv5te", arm1026ejs, "5TE", FL_CO_PROC | FL_FOR_ARCH5TE, NULL}, + {"armv6", arm1136js, "6", FL_CO_PROC | FL_FOR_ARCH6, NULL}, + {"armv6j", arm1136js, "6J", FL_CO_PROC | FL_FOR_ARCH6J, NULL}, + {"armv6k", mpcore, "6K", FL_CO_PROC | FL_FOR_ARCH6K, NULL}, + {"armv6z", arm1176jzs, "6Z", FL_CO_PROC | FL_FOR_ARCH6Z, NULL}, + {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC | FL_FOR_ARCH6ZK, NULL}, + {"ep9312", ep9312, "4T", FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL}, + {"iwmmxt", iwmmxt, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL}, + {NULL, arm_none, NULL, 0 , NULL} +}; + +struct arm_cpu_select +{ + const char * string; + const char * name; + const struct processors * processors; }; /* This is a magic structure. The 'string' field is magically filled in with a pointer to the value specified by the user on the command line assuming that the user has specified such a value. */ -struct arm_cpu_select arm_select[] = +static struct arm_cpu_select arm_select[] = { - /* string name processors */ + /* string name processors */ { NULL, "-mcpu=", all_cores }, { NULL, "-march=", all_architectures }, { NULL, "-mtune=", all_cores } }; +/* Defines representing the indexes into the above table. */ +#define ARM_OPT_SET_CPU 0 +#define ARM_OPT_SET_ARCH 1 +#define ARM_OPT_SET_TUNE 2 + +/* The name of the preprocessor macro to define for this architecture. */ + +char arm_arch_name[] = "__ARM_ARCH_0UNK__"; + +struct fpu_desc +{ + const char * name; + enum fputype fpu; +}; + + +/* Available values for -mfpu=. */ + +static const struct fpu_desc all_fpus[] = +{ + {"fpa", FPUTYPE_FPA}, + {"fpe2", FPUTYPE_FPA_EMU2}, + {"fpe3", FPUTYPE_FPA_EMU2}, + {"maverick", FPUTYPE_MAVERICK}, + {"vfp", FPUTYPE_VFP} +}; + + +/* Floating point models used by the different hardware. + See fputype in arm.h. */ + +static const enum fputype fp_model_for_fpu[] = +{ + /* No FP hardware. */ + ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU2 */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */ + ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */ + ARM_FP_MODEL_VFP /* FPUTYPE_VFP */ +}; + + +struct float_abi +{ + const char * name; + enum float_abi_type abi_type; +}; + + +/* Available values for -mfloat-abi=. */ + +static const struct float_abi all_float_abis[] = +{ + {"soft", ARM_FLOAT_ABI_SOFT}, + {"softfp", ARM_FLOAT_ABI_SOFTFP}, + {"hard", ARM_FLOAT_ABI_HARD} +}; + + +struct abi_name +{ + const char *name; + enum arm_abi_type abi_type; +}; + + +/* Available values for -mabi=. */ + +static const struct abi_name arm_all_abis[] = +{ + {"apcs-gnu", ARM_ABI_APCS}, + {"atpcs", ARM_ABI_ATPCS}, + {"aapcs", ARM_ABI_AAPCS}, + {"iwmmxt", ARM_ABI_IWMMXT}, + {"aapcs-linux", ARM_ABI_AAPCS_LINUX} +}; + +/* Supported TLS relocations. */ + +enum tls_reloc { + TLS_GD32, + TLS_LDM32, + TLS_LDO32, + TLS_IE32, + TLS_LE32 +}; + +/* Emit an insn that's a simple single-set. Both the operands must be known + to be valid. */ +inline static rtx +emit_set_insn (rtx x, rtx y) +{ + return emit_insn (gen_rtx_SET (VOIDmode, x, y)); +} + /* Return the number of bits set in VALUE. */ static unsigned bit_count (unsigned long value) { unsigned long count = 0; - + while (value) { count++; @@ -489,18 +732,159 @@ bit_count (unsigned long value) return count; } +/* Set up library functions unique to ARM. */ + +static void +arm_init_libfuncs (void) +{ + /* There are no special library functions unless we are using the + ARM BPABI. */ + if (!TARGET_BPABI) + return; + + /* The functions below are described in Section 4 of the "Run-Time + ABI for the ARM architecture", Version 1.0. */ + + /* Double-precision floating-point arithmetic. Table 2. */ + set_optab_libfunc (add_optab, DFmode, "__aeabi_dadd"); + set_optab_libfunc (sdiv_optab, DFmode, "__aeabi_ddiv"); + set_optab_libfunc (smul_optab, DFmode, "__aeabi_dmul"); + set_optab_libfunc (neg_optab, DFmode, "__aeabi_dneg"); + set_optab_libfunc (sub_optab, DFmode, "__aeabi_dsub"); + + /* Double-precision comparisons. Table 3. */ + set_optab_libfunc (eq_optab, DFmode, "__aeabi_dcmpeq"); + set_optab_libfunc (ne_optab, DFmode, NULL); + set_optab_libfunc (lt_optab, DFmode, "__aeabi_dcmplt"); + set_optab_libfunc (le_optab, DFmode, "__aeabi_dcmple"); + set_optab_libfunc (ge_optab, DFmode, "__aeabi_dcmpge"); + set_optab_libfunc (gt_optab, DFmode, "__aeabi_dcmpgt"); + set_optab_libfunc (unord_optab, DFmode, "__aeabi_dcmpun"); + + /* Single-precision floating-point arithmetic. Table 4. */ + set_optab_libfunc (add_optab, SFmode, "__aeabi_fadd"); + set_optab_libfunc (sdiv_optab, SFmode, "__aeabi_fdiv"); + set_optab_libfunc (smul_optab, SFmode, "__aeabi_fmul"); + set_optab_libfunc (neg_optab, SFmode, "__aeabi_fneg"); + set_optab_libfunc (sub_optab, SFmode, "__aeabi_fsub"); + + /* Single-precision comparisons. Table 5. */ + set_optab_libfunc (eq_optab, SFmode, "__aeabi_fcmpeq"); + set_optab_libfunc (ne_optab, SFmode, NULL); + set_optab_libfunc (lt_optab, SFmode, "__aeabi_fcmplt"); + set_optab_libfunc (le_optab, SFmode, "__aeabi_fcmple"); + set_optab_libfunc (ge_optab, SFmode, "__aeabi_fcmpge"); + set_optab_libfunc (gt_optab, SFmode, "__aeabi_fcmpgt"); + set_optab_libfunc (unord_optab, SFmode, "__aeabi_fcmpun"); + + /* Floating-point to integer conversions. Table 6. */ + set_conv_libfunc (sfix_optab, SImode, DFmode, "__aeabi_d2iz"); + set_conv_libfunc (ufix_optab, SImode, DFmode, "__aeabi_d2uiz"); + set_conv_libfunc (sfix_optab, DImode, DFmode, "__aeabi_d2lz"); + set_conv_libfunc (ufix_optab, DImode, DFmode, "__aeabi_d2ulz"); + set_conv_libfunc (sfix_optab, SImode, SFmode, "__aeabi_f2iz"); + set_conv_libfunc (ufix_optab, SImode, SFmode, "__aeabi_f2uiz"); + set_conv_libfunc (sfix_optab, DImode, SFmode, "__aeabi_f2lz"); + set_conv_libfunc (ufix_optab, DImode, SFmode, "__aeabi_f2ulz"); + + /* Conversions between floating types. Table 7. */ + set_conv_libfunc (trunc_optab, SFmode, DFmode, "__aeabi_d2f"); + set_conv_libfunc (sext_optab, DFmode, SFmode, "__aeabi_f2d"); + + /* Integer to floating-point conversions. Table 8. */ + set_conv_libfunc (sfloat_optab, DFmode, SImode, "__aeabi_i2d"); + set_conv_libfunc (ufloat_optab, DFmode, SImode, "__aeabi_ui2d"); + set_conv_libfunc (sfloat_optab, DFmode, DImode, "__aeabi_l2d"); + set_conv_libfunc (ufloat_optab, DFmode, DImode, "__aeabi_ul2d"); + set_conv_libfunc (sfloat_optab, SFmode, SImode, "__aeabi_i2f"); + set_conv_libfunc (ufloat_optab, SFmode, SImode, "__aeabi_ui2f"); + set_conv_libfunc (sfloat_optab, SFmode, DImode, "__aeabi_l2f"); + set_conv_libfunc (ufloat_optab, SFmode, DImode, "__aeabi_ul2f"); + + /* Long long. Table 9. */ + set_optab_libfunc (smul_optab, DImode, "__aeabi_lmul"); + set_optab_libfunc (sdivmod_optab, DImode, "__aeabi_ldivmod"); + set_optab_libfunc (udivmod_optab, DImode, "__aeabi_uldivmod"); + set_optab_libfunc (ashl_optab, DImode, "__aeabi_llsl"); + set_optab_libfunc (lshr_optab, DImode, "__aeabi_llsr"); + set_optab_libfunc (ashr_optab, DImode, "__aeabi_lasr"); + set_optab_libfunc (cmp_optab, DImode, "__aeabi_lcmp"); + set_optab_libfunc (ucmp_optab, DImode, "__aeabi_ulcmp"); + + /* Integer (32/32->32) division. \S 4.3.1. */ + set_optab_libfunc (sdivmod_optab, SImode, "__aeabi_idivmod"); + set_optab_libfunc (udivmod_optab, SImode, "__aeabi_uidivmod"); + + /* The divmod functions are designed so that they can be used for + plain division, even though they return both the quotient and the + remainder. The quotient is returned in the usual location (i.e., + r0 for SImode, {r0, r1} for DImode), just as would be expected + for an ordinary division routine. Because the AAPCS calling + conventions specify that all of { r0, r1, r2, r3 } are + callee-saved registers, there is no need to tell the compiler + explicitly that those registers are clobbered by these + routines. */ + set_optab_libfunc (sdiv_optab, DImode, "__aeabi_ldivmod"); + set_optab_libfunc (udiv_optab, DImode, "__aeabi_uldivmod"); + + /* For SImode division the ABI provides div-without-mod routines, + which are faster. */ + set_optab_libfunc (sdiv_optab, SImode, "__aeabi_idiv"); + set_optab_libfunc (udiv_optab, SImode, "__aeabi_uidiv"); + + /* We don't have mod libcalls. Fortunately gcc knows how to use the + divmod libcalls instead. */ + set_optab_libfunc (smod_optab, DImode, NULL); + set_optab_libfunc (umod_optab, DImode, NULL); + set_optab_libfunc (smod_optab, SImode, NULL); + set_optab_libfunc (umod_optab, SImode, NULL); +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +arm_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_march_: + arm_select[1].string = arg; + return true; + + case OPT_mcpu_: + arm_select[0].string = arg; + return true; + + case OPT_mhard_float: + target_float_abi_name = "hard"; + return true; + + case OPT_msoft_float: + target_float_abi_name = "soft"; + return true; + + case OPT_mtune_: + arm_select[2].string = arg; + return true; + + default: + return true; + } +} + /* Fix up any incompatible options that the user has specified. This has now turned into a maze. */ void arm_override_options (void) { unsigned i; - + enum processor_type target_arch_cpu = arm_none; + /* Set up the flags based on the cpu/architecture selected by the user. */ for (i = ARRAY_SIZE (arm_select); i--;) { struct arm_cpu_select * ptr = arm_select + i; - + if (ptr->string != NULL && ptr->string[0] != '\0') { const struct processors * sel; @@ -508,21 +892,38 @@ arm_override_options (void) for (sel = ptr->processors; sel->name != NULL; sel++) if (streq (ptr->string, sel->name)) { - if (i == 2) - tune_flags = sel->flags; - else + /* Set the architecture define. */ + if (i != ARM_OPT_SET_TUNE) + sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); + + /* Determine the processor core for which we should + tune code-generation. */ + if (/* -mcpu= is a sensible default. */ + i == ARM_OPT_SET_CPU + /* -mtune= overrides -mcpu= and -march=. */ + || i == ARM_OPT_SET_TUNE) + arm_tune = (enum processor_type) (sel - ptr->processors); + + /* Remember the CPU associated with this architecture. + If no other option is used to set the CPU type, + we'll use this to guess the most suitable tuning + options. */ + if (i == ARM_OPT_SET_ARCH) + target_arch_cpu = sel->core; + + if (i != ARM_OPT_SET_TUNE) { /* If we have been given an architecture and a processor make sure that they are compatible. We only generate a warning though, and we prefer the CPU over the architecture. */ if (insn_flags != 0 && (insn_flags ^ sel->flags)) - warning ("switch -mcpu=%s conflicts with -march= switch", + warning (0, "switch -mcpu=%s conflicts with -march= switch", ptr->string); - + insn_flags = sel->flags; } - + break; } @@ -530,71 +931,41 @@ arm_override_options (void) error ("bad value (%s) for %s switch", ptr->string, ptr->name); } } - + + /* Guess the tuning options from the architecture if necessary. */ + if (arm_tune == arm_none) + arm_tune = target_arch_cpu; + /* If the user did not specify a processor, choose one for them. */ if (insn_flags == 0) { const struct processors * sel; unsigned int sought; - static const struct cpu_default - { - const int cpu; - const char *const name; - } - cpu_defaults[] = - { - { TARGET_CPU_arm2, "arm2" }, - { TARGET_CPU_arm6, "arm6" }, - { TARGET_CPU_arm610, "arm610" }, - { TARGET_CPU_arm710, "arm710" }, - { TARGET_CPU_arm7m, "arm7m" }, - { TARGET_CPU_arm7500fe, "arm7500fe" }, - { TARGET_CPU_arm7tdmi, "arm7tdmi" }, - { TARGET_CPU_arm8, "arm8" }, - { TARGET_CPU_arm810, "arm810" }, - { TARGET_CPU_arm9, "arm9" }, - { TARGET_CPU_strongarm, "strongarm" }, - { TARGET_CPU_xscale, "xscale" }, - { TARGET_CPU_ep9312, "ep9312" }, - { TARGET_CPU_iwmmxt, "iwmmxt" }, - { TARGET_CPU_arm926ej_s, "arm926ej-s" }, - { TARGET_CPU_arm1026ej_s, "arm1026ej-s" }, - { TARGET_CPU_arm1136j_s, "arm1136j_s" }, - { TARGET_CPU_arm1136jf_s, "arm1136jf_s" }, - { TARGET_CPU_generic, "arm" }, - { 0, 0 } - }; - const struct cpu_default * def; - - /* Find the default. */ - for (def = cpu_defaults; def->name; def++) - if (def->cpu == TARGET_CPU_DEFAULT) - break; + enum processor_type cpu; - /* Make sure we found the default CPU. */ - if (def->name == NULL) - abort (); - - /* Find the default CPU's flags. */ - for (sel = all_cores; sel->name != NULL; sel++) - if (streq (def->name, sel->name)) - break; - - if (sel->name == NULL) - abort (); + cpu = TARGET_CPU_DEFAULT; + if (cpu == arm_none) + { +#ifdef SUBTARGET_CPU_DEFAULT + /* Use the subtarget default CPU if none was specified by + configure. */ + cpu = SUBTARGET_CPU_DEFAULT; +#endif + /* Default to ARM6. */ + if (cpu == arm_none) + cpu = arm6; + } + sel = &all_cores[cpu]; insn_flags = sel->flags; - + /* Now check to see if the user has specified some command line switch that require certain abilities from the cpu. */ sought = 0; - + if (TARGET_INTERWORK || TARGET_THUMB) { sought |= (FL_THUMB | FL_MODE32); - - /* Force apcs-32 to be used for interworking. */ - target_flags |= ARM_FLAG_APCS_32; /* There are no ARM processors that support both APCS-26 and interworking. Therefore we force FL_MODE26 to be removed @@ -602,9 +973,7 @@ arm_override_options (void) below will always be able to find a compatible processor. */ insn_flags &= ~FL_MODE26; } - else if (!TARGET_APCS_32) - sought |= FL_MODE26; - + if (sought != 0 && ((sought & insn_flags) != sought)) { /* Try to locate a CPU type that supports all of the abilities @@ -618,7 +987,7 @@ arm_override_options (void) { unsigned current_bit_count = 0; const struct processors * best_fit = NULL; - + /* Ideally we would like to issue an error message here saying that it was not possible to find a CPU compatible with the default CPU, but which also supports the command @@ -626,12 +995,10 @@ arm_override_options (void) ought to use the -mcpu= command line option to override the default CPU type. - Unfortunately this does not work with multilibing. We - need to be able to support multilibs for -mapcs-26 and for - -mthumb-interwork and there is no CPU that can support both - options. Instead if we cannot find a cpu that has both the - characteristics of the default cpu and the given command line - options we scan the array again looking for a best match. */ + If we cannot find a cpu that has both the + characteristics of the default cpu and the given + command line options we scan the array again looking + for a best match. */ for (sel = all_cores; sel->name != NULL; sel++) if ((sel->flags & sought) == sought) { @@ -646,184 +1013,275 @@ arm_override_options (void) } } - if (best_fit == NULL) - abort (); - else - sel = best_fit; + gcc_assert (best_fit); + sel = best_fit; } insn_flags = sel->flags; } + sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); + if (arm_tune == arm_none) + arm_tune = (enum processor_type) (sel - all_cores); } - - /* If tuning has not been specified, tune for whichever processor or - architecture has been selected. */ - if (tune_flags == 0) - tune_flags = insn_flags; + + /* The processor for which we should tune should now have been + chosen. */ + gcc_assert (arm_tune != arm_none); + + tune_flags = all_cores[(int)arm_tune].flags; + if (optimize_size) + targetm.rtx_costs = arm_size_rtx_costs; + else + targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs; /* Make sure that the processor choice does not conflict with any of the other command line choices. */ - if (TARGET_APCS_32 && !(insn_flags & FL_MODE32)) - { - /* If APCS-32 was not the default then it must have been set by the - user, so issue a warning message. If the user has specified - "-mapcs-32 -mcpu=arm2" then we loose here. */ - if ((TARGET_DEFAULT & ARM_FLAG_APCS_32) == 0) - warning ("target CPU does not support APCS-32" ); - target_flags &= ~ARM_FLAG_APCS_32; - } - else if (!TARGET_APCS_32 && !(insn_flags & FL_MODE26)) - { - warning ("target CPU does not support APCS-26" ); - target_flags |= ARM_FLAG_APCS_32; - } - if (TARGET_INTERWORK && !(insn_flags & FL_THUMB)) { - warning ("target CPU does not support interworking" ); - target_flags &= ~ARM_FLAG_INTERWORK; - } - - if (TARGET_THUMB && !(insn_flags & FL_THUMB)) - { - warning ("target CPU does not support THUMB instructions"); - target_flags &= ~ARM_FLAG_THUMB; + warning (0, "target CPU does not support interworking" ); + target_flags &= ~MASK_INTERWORK; } - if (!TARGET_APCS_32) - inform ("future releases of GCC will not support -mapcs-26"); + if (TARGET_THUMB && !(insn_flags & FL_THUMB)) + { + warning (0, "target CPU does not support THUMB instructions"); + target_flags &= ~MASK_THUMB; + } if (TARGET_APCS_FRAME && TARGET_THUMB) { - /* warning ("ignoring -mapcs-frame because -mthumb was used"); */ - target_flags &= ~ARM_FLAG_APCS_FRAME; + /* warning (0, "ignoring -mapcs-frame because -mthumb was used"); */ + target_flags &= ~MASK_APCS_FRAME; } + /* Callee super interworking implies thumb interworking. Adding + this to the flags here simplifies the logic elsewhere. */ + if (TARGET_THUMB && TARGET_CALLEE_INTERWORKING) + target_flags |= MASK_INTERWORK; + /* TARGET_BACKTRACE calls leaf_function_p, which causes a crash if done from here where no function is being compiled currently. */ - if ((target_flags & (THUMB_FLAG_LEAF_BACKTRACE | THUMB_FLAG_BACKTRACE)) - && TARGET_ARM) - warning ("enabling backtrace support is only meaningful when compiling for the Thumb"); + if ((TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME) && TARGET_ARM) + warning (0, "enabling backtrace support is only meaningful when compiling for the Thumb"); if (TARGET_ARM && TARGET_CALLEE_INTERWORKING) - warning ("enabling callee interworking support is only meaningful when compiling for the Thumb"); + warning (0, "enabling callee interworking support is only meaningful when compiling for the Thumb"); if (TARGET_ARM && TARGET_CALLER_INTERWORKING) - warning ("enabling caller interworking support is only meaningful when compiling for the Thumb"); + warning (0, "enabling caller interworking support is only meaningful when compiling for the Thumb"); - /* If interworking is enabled then APCS-32 must be selected as well. */ - if (TARGET_INTERWORK) - { - if (!TARGET_APCS_32) - warning ("interworking forces APCS-32 to be used" ); - target_flags |= ARM_FLAG_APCS_32; - } - if (TARGET_APCS_STACK && !TARGET_APCS_FRAME) { - warning ("-mapcs-stack-check incompatible with -mno-apcs-frame"); - target_flags |= ARM_FLAG_APCS_FRAME; + warning (0, "-mapcs-stack-check incompatible with -mno-apcs-frame"); + target_flags |= MASK_APCS_FRAME; } - + if (TARGET_POKE_FUNCTION_NAME) - target_flags |= ARM_FLAG_APCS_FRAME; - + target_flags |= MASK_APCS_FRAME; + if (TARGET_APCS_REENT && flag_pic) error ("-fpic and -mapcs-reent are incompatible"); - + if (TARGET_APCS_REENT) - warning ("APCS reentrant code not supported. Ignored"); - + warning (0, "APCS reentrant code not supported. Ignored"); + /* If this target is normally configured to use APCS frames, warn if they are turned off and debugging is turned on. */ if (TARGET_ARM && write_symbols != NO_DEBUG && !TARGET_APCS_FRAME - && (TARGET_DEFAULT & ARM_FLAG_APCS_FRAME)) - warning ("-g with -mno-apcs-frame may not give sensible debugging"); - + && (TARGET_DEFAULT & MASK_APCS_FRAME)) + warning (0, "-g with -mno-apcs-frame may not give sensible debugging"); + /* If stack checking is disabled, we can use r10 as the PIC register, which keeps r9 available. */ - if (flag_pic) + if (flag_pic && TARGET_SINGLE_PIC_BASE) arm_pic_register = TARGET_APCS_STACK ? 9 : 10; - + if (TARGET_APCS_FLOAT) - warning ("passing floating point arguments in fp regs not yet supported"); - + warning (0, "passing floating point arguments in fp regs not yet supported"); + /* Initialize boolean versions of the flags, for use in the arm.md file. */ - arm_fast_multiply = (insn_flags & FL_FAST_MULT) != 0; - arm_arch4 = (insn_flags & FL_ARCH4) != 0; - arm_arch5 = (insn_flags & FL_ARCH5) != 0; - arm_arch5e = (insn_flags & FL_ARCH5E) != 0; - arm_arch_xscale = (insn_flags & FL_XSCALE) != 0; + arm_arch3m = (insn_flags & FL_ARCH3M) != 0; + arm_arch4 = (insn_flags & FL_ARCH4) != 0; + arm_arch4t = arm_arch4 & ((insn_flags & FL_THUMB) != 0); + arm_arch5 = (insn_flags & FL_ARCH5) != 0; + arm_arch5e = (insn_flags & FL_ARCH5E) != 0; + arm_arch6 = (insn_flags & FL_ARCH6) != 0; + arm_arch6k = (insn_flags & FL_ARCH6K) != 0; + arm_arch_xscale = (insn_flags & FL_XSCALE) != 0; + arm_arch_cirrus = (insn_flags & FL_CIRRUS) != 0; - arm_ld_sched = (tune_flags & FL_LDSCHED) != 0; - arm_is_strong = (tune_flags & FL_STRONG) != 0; - thumb_code = (TARGET_ARM == 0); - arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32)) - && !(tune_flags & FL_ARCH4))) != 0; - arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; - arm_is_cirrus = (tune_flags & FL_CIRRUS) != 0; - arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; + arm_ld_sched = (tune_flags & FL_LDSCHED) != 0; + arm_tune_strongarm = (tune_flags & FL_STRONG) != 0; + thumb_code = (TARGET_ARM == 0); + arm_tune_wbuf = (tune_flags & FL_WBUF) != 0; + arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; + arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; - if (TARGET_IWMMXT && (! TARGET_ATPCS)) - target_flags |= ARM_FLAG_ATPCS; + /* V5 code we generate is completely interworking capable, so we turn off + TARGET_INTERWORK here to avoid many tests later on. */ - if (arm_is_cirrus) + /* XXX However, we must pass the right pre-processor defines to CPP + or GLD can get confused. This is a hack. */ + if (TARGET_INTERWORK) + arm_cpp_interwork = 1; + + if (arm_arch5) + target_flags &= ~MASK_INTERWORK; + + if (target_abi_name) { - arm_fpu_tune = FPUTYPE_MAVERICK; - - /* Ignore -mhard-float if -mcpu=ep9312. */ - if (TARGET_HARD_FLOAT) - target_flags ^= ARM_FLAG_SOFT_FLOAT; + for (i = 0; i < ARRAY_SIZE (arm_all_abis); i++) + { + if (streq (arm_all_abis[i].name, target_abi_name)) + { + arm_abi = arm_all_abis[i].abi_type; + break; + } + } + if (i == ARRAY_SIZE (arm_all_abis)) + error ("invalid ABI option: -mabi=%s", target_abi_name); } else - /* Default value for floating point code... if no co-processor - bus, then schedule for emulated floating point. Otherwise, - assume the user has an FPA. - Note: this does not prevent use of floating point instructions, - -msoft-float does that. */ - arm_fpu_tune = (tune_flags & FL_CO_PROC) ? FPUTYPE_FPA : FPUTYPE_FPA_EMU3; - - if (target_fp_name) + arm_abi = ARM_DEFAULT_ABI; + + if (TARGET_IWMMXT && !ARM_DOUBLEWORD_ALIGN) + error ("iwmmxt requires an AAPCS compatible ABI for proper operation"); + + if (TARGET_IWMMXT_ABI && !TARGET_IWMMXT) + error ("iwmmxt abi requires an iwmmxt capable cpu"); + + arm_fp_model = ARM_FP_MODEL_UNKNOWN; + if (target_fpu_name == NULL && target_fpe_name != NULL) { - if (streq (target_fp_name, "2")) - arm_fpu_arch = FPUTYPE_FPA_EMU2; - else if (streq (target_fp_name, "3")) - arm_fpu_arch = FPUTYPE_FPA_EMU3; + if (streq (target_fpe_name, "2")) + target_fpu_name = "fpe2"; + else if (streq (target_fpe_name, "3")) + target_fpu_name = "fpe3"; else - error ("invalid floating point emulation option: -mfpe-%s", - target_fp_name); + error ("invalid floating point emulation option: -mfpe=%s", + target_fpe_name); + } + if (target_fpu_name != NULL) + { + /* The user specified a FPU. */ + for (i = 0; i < ARRAY_SIZE (all_fpus); i++) + { + if (streq (all_fpus[i].name, target_fpu_name)) + { + arm_fpu_arch = all_fpus[i].fpu; + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + break; + } + } + if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) + error ("invalid floating point option: -mfpu=%s", target_fpu_name); } else - arm_fpu_arch = FPUTYPE_DEFAULT; - - if (TARGET_FPE) { - if (arm_fpu_tune == FPUTYPE_FPA_EMU3) - arm_fpu_tune = FPUTYPE_FPA_EMU2; - else if (arm_fpu_tune == FPUTYPE_MAVERICK) - warning ("-mfpe switch not supported by ep9312 target cpu - ignored."); - else if (arm_fpu_tune != FPUTYPE_FPA) - arm_fpu_tune = FPUTYPE_FPA_EMU2; +#ifdef FPUTYPE_DEFAULT + /* Use the default if it is specified for this platform. */ + arm_fpu_arch = FPUTYPE_DEFAULT; + arm_fpu_tune = FPUTYPE_DEFAULT; +#else + /* Pick one based on CPU type. */ + /* ??? Some targets assume FPA is the default. + if ((insn_flags & FL_VFP) != 0) + arm_fpu_arch = FPUTYPE_VFP; + else + */ + if (arm_arch_cirrus) + arm_fpu_arch = FPUTYPE_MAVERICK; + else + arm_fpu_arch = FPUTYPE_FPA_EMU2; +#endif + if (tune_flags & FL_CO_PROC && arm_fpu_arch == FPUTYPE_FPA_EMU2) + arm_fpu_tune = FPUTYPE_FPA; + else + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + gcc_assert (arm_fp_model != ARM_FP_MODEL_UNKNOWN); } - + + if (target_float_abi_name != NULL) + { + /* The user specified a FP ABI. */ + for (i = 0; i < ARRAY_SIZE (all_float_abis); i++) + { + if (streq (all_float_abis[i].name, target_float_abi_name)) + { + arm_float_abi = all_float_abis[i].abi_type; + break; + } + } + if (i == ARRAY_SIZE (all_float_abis)) + error ("invalid floating point abi: -mfloat-abi=%s", + target_float_abi_name); + } + else + arm_float_abi = TARGET_DEFAULT_FLOAT_ABI; + + if (arm_float_abi == ARM_FLOAT_ABI_HARD && TARGET_VFP) + sorry ("-mfloat-abi=hard and VFP"); + + /* FPA and iWMMXt are incompatible because the insn encodings overlap. + VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon + will ever exist. GCC makes no attempt to support this combination. */ + if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT) + sorry ("iWMMXt and hardware floating point"); + + /* If soft-float is specified then don't use FPU. */ + if (TARGET_SOFT_FLOAT) + arm_fpu_arch = FPUTYPE_NONE; + /* For arm2/3 there is no need to do any scheduling if there is only a floating point emulator, or we are doing software floating-point. */ - if ((TARGET_SOFT_FLOAT || arm_fpu_tune != FPUTYPE_FPA) + if ((TARGET_SOFT_FLOAT + || arm_fpu_tune == FPUTYPE_FPA_EMU2 + || arm_fpu_tune == FPUTYPE_FPA_EMU3) && (tune_flags & FL_MODE32) == 0) flag_schedule_insns = flag_schedule_insns_after_reload = 0; - - arm_prgmode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26; - + + if (target_thread_switch) + { + if (strcmp (target_thread_switch, "soft") == 0) + target_thread_pointer = TP_SOFT; + else if (strcmp (target_thread_switch, "auto") == 0) + target_thread_pointer = TP_AUTO; + else if (strcmp (target_thread_switch, "cp15") == 0) + target_thread_pointer = TP_CP15; + else + error ("invalid thread pointer option: -mtp=%s", target_thread_switch); + } + + /* Use the cp15 method if it is available. */ + if (target_thread_pointer == TP_AUTO) + { + if (arm_arch6k && !TARGET_THUMB) + target_thread_pointer = TP_CP15; + else + target_thread_pointer = TP_SOFT; + } + + if (TARGET_HARD_TP && TARGET_THUMB) + error ("can not use -mtp=cp15 with -mthumb"); + + /* Override the default structure alignment for AAPCS ABI. */ + if (TARGET_AAPCS_BASED) + arm_structure_size_boundary = 8; + if (structure_size_string != NULL) { int size = strtol (structure_size_string, NULL, 0); - - if (size == 8 || size == 32) + + if (size == 8 || size == 32 + || (ARM_DOUBLEWORD_ALIGN && size == 64)) arm_structure_size_boundary = size; else - warning ("structure size boundary can only be set to 8 or 32"); + warning (0, "structure size boundary can only be set to %s", + ARM_DOUBLEWORD_ALIGN ? "8, 32 or 64": "8 or 32"); } if (arm_pic_register_string != NULL) @@ -831,7 +1289,7 @@ arm_override_options (void) int pic_register = decode_reg_name (arm_pic_register_string); if (!flag_pic) - warning ("-mpic-register= is useless without -fpic"); + warning (0, "-mpic-register= is useless without -fpic"); /* Prevent the user from choosing an obviously stupid PIC register. */ else if (pic_register < 0 || call_used_regs[pic_register] @@ -851,10 +1309,6 @@ arm_override_options (void) if (optimize_size) { - /* There's some dispute as to whether this should be 1 or 2. However, - experiments seem to show that in pathological cases a setting of - 1 degrades less severely than a setting of 2. This could change if - other parts of the compiler change their behavior. */ arm_constant_limit = 1; /* If optimizing for size, bump the number of instructions that we @@ -866,7 +1320,7 @@ arm_override_options (void) /* For processors with load scheduling, it never costs more than 2 cycles to load a constant, and the load scheduler may well reduce that to 1. */ - if (tune_flags & FL_LDSCHED) + if (arm_ld_sched) arm_constant_limit = 1; /* On XScale the longer latency of a load makes it more difficult @@ -877,7 +1331,7 @@ arm_override_options (void) /* StrongARM has early execution of branches, so a sequence that is worth skipping is shorter. */ - if (arm_is_strong) + if (arm_tune_strongarm) max_insns_skipped = 3; } @@ -956,42 +1410,38 @@ arm_compute_func_type (void) unsigned long type = ARM_FT_UNKNOWN; tree a; tree attr; - - if (TREE_CODE (current_function_decl) != FUNCTION_DECL) - abort (); + + gcc_assert (TREE_CODE (current_function_decl) == FUNCTION_DECL); /* Decide if the current function is volatile. Such functions never return, and many memory cycles can be saved by not storing register values that will never be needed again. This optimization was added to speed up context switching in a kernel application. */ if (optimize > 0 - && current_function_nothrow + && (TREE_NOTHROW (current_function_decl) + || !(flag_unwind_tables + || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))) && TREE_THIS_VOLATILE (current_function_decl)) type |= ARM_FT_VOLATILE; - - if (current_function_needs_context) + + if (cfun->static_chain_decl != NULL) type |= ARM_FT_NESTED; attr = DECL_ATTRIBUTES (current_function_decl); - + a = lookup_attribute ("naked", attr); if (a != NULL_TREE) type |= ARM_FT_NAKED; - if (cfun->machine->eh_epilogue_sp_ofs != NULL_RTX) - type |= ARM_FT_EXCEPTION_HANDLER; + a = lookup_attribute ("isr", attr); + if (a == NULL_TREE) + a = lookup_attribute ("interrupt", attr); + + if (a == NULL_TREE) + type |= TARGET_INTERWORK ? ARM_FT_INTERWORKED : ARM_FT_NORMAL; else - { - a = lookup_attribute ("isr", attr); - if (a == NULL_TREE) - a = lookup_attribute ("interrupt", attr); - - if (a == NULL_TREE) - type |= TARGET_INTERWORK ? ARM_FT_INTERWORKED : ARM_FT_NORMAL; - else - type |= arm_isr_value (TREE_VALUE (a)); - } - + type |= arm_isr_value (TREE_VALUE (a)); + return type; } @@ -1006,7 +1456,7 @@ arm_current_func_type (void) return cfun->machine->func_type; } -/* Return 1 if it is possible to return using a single instruction. +/* Return 1 if it is possible to return using a single instruction. If SIBLING is non-null, this is a test for a return before a sibling call. SIBLING is the call insn, so we can examine its register usage. */ @@ -1017,6 +1467,7 @@ use_return_insn (int iscond, rtx sibling) unsigned int func_type; unsigned long saved_int_regs; unsigned HOST_WIDE_INT stack_adjust; + arm_stack_offsets *offsets; /* Never use a return instruction before reload has run. */ if (!reload_completed) @@ -1033,13 +1484,14 @@ use_return_insn (int iscond, rtx sibling) if (IS_INTERRUPT (func_type) && frame_pointer_needed) return 0; - stack_adjust = arm_get_frame_size () + current_function_outgoing_args_size; + offsets = arm_get_frame_offsets (); + stack_adjust = offsets->outgoing_args - offsets->saved_regs; /* As do variadic functions. */ if (current_function_pretend_args_size || cfun->machine->uses_anonymous_args /* Or if the function calls __builtin_eh_return () */ - || ARM_FUNC_TYPE (func_type) == ARM_FT_EXCEPTION_HANDLER + || current_function_calls_eh_return /* Or if the function calls alloca */ || current_function_calls_alloca /* Or if there is a stack adjustment. However, if the stack pointer @@ -1057,7 +1509,7 @@ use_return_insn (int iscond, rtx sibling) pointer won't be correctly restored if the instruction takes a page fault. We work around this problem by popping r3 along with the other registers, since that is never slower than executing - another instruction. + another instruction. We test for !arm_arch5 here, because code for any architecture less than this could potentially be run on one of the buggy @@ -1069,13 +1521,14 @@ use_return_insn (int iscond, rtx sibling) if (!call_used_regs[3]) return 0; - /* ... that it isn't being used for a return value (always true - until we implement return-in-regs), or for a tail-call - argument ... */ + /* ... that it isn't being used for a return value ... */ + if (arm_size_return_regs () >= (4 * UNITS_PER_WORD)) + return 0; + + /* ... or for a tail-call argument ... */ if (sibling) { - if (GET_CODE (sibling) != CALL_INSN) - abort (); + gcc_assert (GET_CODE (sibling) == CALL_INSN); if (find_regno_fusage (sibling, USE, 3)) return 0; @@ -1094,14 +1547,16 @@ use_return_insn (int iscond, rtx sibling) /* On StrongARM, conditional returns are expensive if they aren't taken and multiple registers have been stacked. */ - if (iscond && arm_is_strong) + if (iscond && arm_tune_strongarm) { - /* Conditional return when just the LR is stored is a simple + /* Conditional return when just the LR is stored is a simple conditional-load instruction, that's not expensive. */ if (saved_int_regs != 0 && saved_int_regs != (1 << LR_REGNUM)) return 0; - if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) + if (flag_pic + && arm_pic_register != INVALID_REGNUM + && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) return 0; } @@ -1112,8 +1567,14 @@ use_return_insn (int iscond, rtx sibling) /* Can't be done if any of the FPA regs are pushed, since this also requires an insn. */ - if (TARGET_HARD_FLOAT) - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) + if (TARGET_HARD_FLOAT && TARGET_FPA) + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) + if (regs_ever_live[regno] && !call_used_regs[regno]) + return 0; + + /* Likewise VFP regs. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + for (regno = FIRST_VFP_REGNUM; regno <= LAST_VFP_REGNUM; regno++) if (regs_ever_live[regno] && !call_used_regs[regno]) return 0; @@ -1130,29 +1591,34 @@ use_return_insn (int iscond, rtx sibling) int const_ok_for_arm (HOST_WIDE_INT i) { - unsigned HOST_WIDE_INT mask = ~(unsigned HOST_WIDE_INT)0xFF; + int lowbit; - /* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must + /* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must be all zero, or all one. */ if ((i & ~(unsigned HOST_WIDE_INT) 0xffffffff) != 0 && ((i & ~(unsigned HOST_WIDE_INT) 0xffffffff) != ((~(unsigned HOST_WIDE_INT) 0) & ~(unsigned HOST_WIDE_INT) 0xffffffff))) return FALSE; - - /* Fast return for 0 and powers of 2 */ - if ((i & (i - 1)) == 0) + + i &= (unsigned HOST_WIDE_INT) 0xffffffff; + + /* Fast return for 0 and small values. We must do this for zero, since + the code below can't handle that one case. */ + if ((i & ~(unsigned HOST_WIDE_INT) 0xff) == 0) return TRUE; - do - { - if ((i & mask & (unsigned HOST_WIDE_INT) 0xffffffff) == 0) - return TRUE; - mask = - (mask << 2) | ((mask & (unsigned HOST_WIDE_INT) 0xffffffff) - >> (32 - 2)) | ~(unsigned HOST_WIDE_INT) 0xffffffff; - } - while (mask != ~(unsigned HOST_WIDE_INT) 0xFF); + /* Get the number of trailing zeros, rounded down to the nearest even + number. */ + lowbit = (ffs ((int) i) - 1) & ~1; + + if ((i & ~(((unsigned HOST_WIDE_INT) 0xff) << lowbit)) == 0) + return TRUE; + else if (lowbit <= 4 + && ((i & ~0xc000003f) == 0 + || (i & ~0xf000000f) == 0 + || (i & ~0xfc000003) == 0)) + return TRUE; return FALSE; } @@ -1178,7 +1644,7 @@ const_ok_for_op (HOST_WIDE_INT i, enum rtx_code code) return const_ok_for_arm (ARM_SIGN_EXTEND (~i)); default: - abort (); + gcc_unreachable (); } } @@ -1193,9 +1659,16 @@ const_ok_for_op (HOST_WIDE_INT i, enum rtx_code code) Return value is the number of insns emitted. */ int -arm_split_constant (enum rtx_code code, enum machine_mode mode, +arm_split_constant (enum rtx_code code, enum machine_mode mode, rtx insn, HOST_WIDE_INT val, rtx target, rtx source, int subtargets) { + rtx cond; + + if (insn && GET_CODE (PATTERN (insn)) == COND_EXEC) + cond = COND_EXEC_TEST (PATTERN (insn)); + else + cond = NULL_RTX; + if (subtargets || code == SET || (GET_CODE (target) == REG && GET_CODE (source) == REG && REGNO (target) != REGNO (source))) @@ -1210,35 +1683,37 @@ arm_split_constant (enum rtx_code code, enum machine_mode mode, Ref: gcc -O1 -mcpu=strongarm gcc.c-torture/compile/980506-2.c */ if (!after_arm_reorg - && (arm_gen_constant (code, mode, val, target, source, 1, 0) + && !cond + && (arm_gen_constant (code, mode, NULL_RTX, val, target, source, + 1, 0) > arm_constant_limit + (code != SET))) { if (code == SET) { /* Currently SET is the only monadic value for CODE, all the rest are diadic. */ - emit_insn (gen_rtx_SET (VOIDmode, target, GEN_INT (val))); + emit_set_insn (target, GEN_INT (val)); return 1; } else { rtx temp = subtargets ? gen_reg_rtx (mode) : target; - emit_insn (gen_rtx_SET (VOIDmode, temp, GEN_INT (val))); + emit_set_insn (temp, GEN_INT (val)); /* For MINUS, the value is subtracted from, since we never have subtraction of a constant. */ if (code == MINUS) - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_MINUS (mode, temp, source))); + emit_set_insn (target, gen_rtx_MINUS (mode, temp, source)); else - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx (code, mode, source, temp))); + emit_set_insn (target, + gen_rtx_fmt_ee (code, mode, source, temp)); return 2; } } } - return arm_gen_constant (code, mode, val, target, source, subtargets, 1); + return arm_gen_constant (code, mode, cond, val, target, source, subtargets, + 1); } static int @@ -1249,7 +1724,7 @@ count_insns_for_constant (HOST_WIDE_INT remainder, int i) do { int end; - + if (i <= 0) i += 32; if (remainder & (3 << (i - 2))) @@ -1268,11 +1743,23 @@ count_insns_for_constant (HOST_WIDE_INT remainder, int i) return num_insns; } +/* Emit an instruction with the indicated PATTERN. If COND is + non-NULL, conditionalize the execution of the instruction on COND + being true. */ + +static void +emit_constant_insn (rtx cond, rtx pattern) +{ + if (cond) + pattern = gen_rtx_COND_EXEC (VOIDmode, copy_rtx (cond), pattern); + emit_insn (pattern); +} + /* As above, but extra parameter GENERATE which, if clear, suppresses RTL generation. */ static int -arm_gen_constant (enum rtx_code code, enum machine_mode mode, +arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, HOST_WIDE_INT val, rtx target, rtx source, int subtargets, int generate) { @@ -1310,8 +1797,9 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (remainder == 0xffffffff) { if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, - GEN_INT (ARM_SIGN_EXTEND (val)))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + GEN_INT (ARM_SIGN_EXTEND (val)))); return 1; } if (remainder == 0) @@ -1319,7 +1807,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (reload_completed && rtx_equal_p (target, source)) return 0; if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, source)); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, source)); return 1; } break; @@ -1328,7 +1817,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (remainder == 0) { if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, const0_rtx)); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, const0_rtx)); return 1; } if (remainder == 0xffffffff) @@ -1336,7 +1826,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (reload_completed && rtx_equal_p (target, source)) return 0; if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, source)); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, source)); return 1; } can_invert = 1; @@ -1348,19 +1839,19 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (reload_completed && rtx_equal_p (target, source)) return 0; if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, source)); - return 1; - } - if (remainder == 0xffffffff) - { - if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_NOT (mode, source))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, source)); return 1; } - /* We don't know how to handle this yet below. */ - abort (); + /* We don't know how to handle other cases yet. */ + gcc_assert (remainder == 0xffffffff); + + if (generate) + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NOT (mode, source))); + return 1; case MINUS: /* We treat MINUS as (val - source), since (source - val) is always @@ -1368,16 +1859,18 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (remainder == 0) { if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_NEG (mode, source))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NEG (mode, source))); return 1; } if (const_ok_for_arm (val)) { if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_MINUS (mode, GEN_INT (val), - source))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_MINUS (mode, GEN_INT (val), + source))); return 1; } can_negate = 1; @@ -1385,7 +1878,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, break; default: - abort (); + gcc_unreachable (); } /* If we can do it in one insn get out quickly. */ @@ -1394,10 +1887,12 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, || (can_invert && const_ok_for_arm (~val))) { if (generate) - emit_insn (gen_rtx_SET (VOIDmode, target, - (source ? gen_rtx (code, mode, source, - GEN_INT (val)) - : GEN_INT (val)))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + (source + ? gen_rtx_fmt_ee (code, mode, source, + GEN_INT (val)) + : GEN_INT (val)))); return 1; } @@ -1444,16 +1939,18 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (set_sign_bit_copies > 1) { if (const_ok_for_arm - (temp1 = ARM_SIGN_EXTEND (remainder + (temp1 = ARM_SIGN_EXTEND (remainder << (set_sign_bit_copies - 1)))) { if (generate) { rtx new_src = subtargets ? gen_reg_rtx (mode) : target; - emit_insn (gen_rtx_SET (VOIDmode, new_src, - GEN_INT (temp1))); - emit_insn (gen_ashrsi3 (target, new_src, - GEN_INT (set_sign_bit_copies - 1))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, new_src, + GEN_INT (temp1))); + emit_constant_insn (cond, + gen_ashrsi3 (target, new_src, + GEN_INT (set_sign_bit_copies - 1))); } return 2; } @@ -1465,15 +1962,52 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (generate) { rtx new_src = subtargets ? gen_reg_rtx (mode) : target; - emit_insn (gen_rtx_SET (VOIDmode, new_src, - GEN_INT (temp1))); - emit_insn (gen_ashrsi3 (target, new_src, - GEN_INT (set_sign_bit_copies - 1))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, new_src, + GEN_INT (temp1))); + emit_constant_insn (cond, + gen_ashrsi3 (target, new_src, + GEN_INT (set_sign_bit_copies - 1))); } return 2; } } + /* See if we can calculate the value as the difference between two + valid immediates. */ + if (clear_sign_bit_copies + clear_zero_bit_copies <= 16) + { + int topshift = clear_sign_bit_copies & ~1; + + temp1 = ARM_SIGN_EXTEND ((remainder + (0x00800000 >> topshift)) + & (0xff000000 >> topshift)); + + /* If temp1 is zero, then that means the 9 most significant + bits of remainder were 1 and we've caused it to overflow. + When topshift is 0 we don't need to do anything since we + can borrow from 'bit 32'. */ + if (temp1 == 0 && topshift != 0) + temp1 = 0x80000000 >> (topshift - 1); + + temp2 = ARM_SIGN_EXTEND (temp1 - remainder); + + if (const_ok_for_arm (temp2)) + { + if (generate) + { + rtx new_src = subtargets ? gen_reg_rtx (mode) : target; + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, new_src, + GEN_INT (temp1))); + emit_constant_insn (cond, + gen_addsi3 (target, new_src, + GEN_INT (-temp2))); + } + + return 2; + } + } + /* See if we can generate this by setting the bottom (or the top) 16 bits, and then shifting these into the other half of the word. We only look for the simplest cases, to do more would cost @@ -1493,16 +2027,18 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx new_src = (subtargets ? (generate ? gen_reg_rtx (mode) : NULL_RTX) : target); - insns = arm_gen_constant (code, mode, temp2, new_src, + insns = arm_gen_constant (code, mode, cond, temp2, new_src, source, subtargets, generate); source = new_src; if (generate) - emit_insn (gen_rtx_SET - (VOIDmode, target, - gen_rtx_IOR (mode, - gen_rtx_ASHIFT (mode, source, - GEN_INT (i)), - source))); + emit_constant_insn + (cond, + gen_rtx_SET + (VOIDmode, target, + gen_rtx_IOR (mode, + gen_rtx_ASHIFT (mode, source, + GEN_INT (i)), + source))); return insns + 1; } } @@ -1516,12 +2052,13 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx new_src = (subtargets ? (generate ? gen_reg_rtx (mode) : NULL_RTX) : target); - insns = arm_gen_constant (code, mode, temp1, new_src, + insns = arm_gen_constant (code, mode, cond, temp1, new_src, source, subtargets, generate); source = new_src; if (generate) - emit_insn - (gen_rtx_SET (VOIDmode, target, + emit_constant_insn + (cond, + gen_rtx_SET (VOIDmode, target, gen_rtx_IOR (mode, gen_rtx_LSHIFTRT (mode, source, @@ -1548,9 +2085,13 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, { rtx sub = subtargets ? gen_reg_rtx (mode) : target; - emit_insn (gen_rtx_SET (VOIDmode, sub, GEN_INT (val))); - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx (code, mode, source, sub))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, sub, + GEN_INT (val))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_fmt_ee (code, mode, + source, sub))); } return 2; } @@ -1567,15 +2108,19 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx sub = subtargets ? gen_reg_rtx (mode) : target; rtx shift = GEN_INT (set_sign_bit_copies); - emit_insn (gen_rtx_SET (VOIDmode, sub, - gen_rtx_NOT (mode, - gen_rtx_ASHIFT (mode, - source, - shift)))); - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_NOT (mode, - gen_rtx_LSHIFTRT (mode, sub, - shift)))); + emit_constant_insn + (cond, + gen_rtx_SET (VOIDmode, sub, + gen_rtx_NOT (mode, + gen_rtx_ASHIFT (mode, + source, + shift)))); + emit_constant_insn + (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NOT (mode, + gen_rtx_LSHIFTRT (mode, sub, + shift)))); } return 2; } @@ -1588,15 +2133,19 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx sub = subtargets ? gen_reg_rtx (mode) : target; rtx shift = GEN_INT (set_zero_bit_copies); - emit_insn (gen_rtx_SET (VOIDmode, sub, - gen_rtx_NOT (mode, - gen_rtx_LSHIFTRT (mode, - source, - shift)))); - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_NOT (mode, - gen_rtx_ASHIFT (mode, sub, - shift)))); + emit_constant_insn + (cond, + gen_rtx_SET (VOIDmode, sub, + gen_rtx_NOT (mode, + gen_rtx_LSHIFTRT (mode, + source, + shift)))); + emit_constant_insn + (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NOT (mode, + gen_rtx_ASHIFT (mode, sub, + shift)))); } return 2; } @@ -1606,16 +2155,19 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (generate) { rtx sub = subtargets ? gen_reg_rtx (mode) : target; - emit_insn (gen_rtx_SET (VOIDmode, sub, - gen_rtx_NOT (mode, source))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, sub, + gen_rtx_NOT (mode, source))); source = sub; if (subtargets) sub = gen_reg_rtx (mode); - emit_insn (gen_rtx_SET (VOIDmode, sub, - gen_rtx_AND (mode, source, - GEN_INT (temp1)))); - emit_insn (gen_rtx_SET (VOIDmode, target, - gen_rtx_NOT (mode, sub))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, sub, + gen_rtx_AND (mode, source, + GEN_INT (temp1)))); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NOT (mode, sub))); } return 3; } @@ -1634,14 +2186,16 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (generate) { rtx new_src = subtargets ? gen_reg_rtx (mode) : target; - insns = arm_gen_constant (AND, mode, remainder | shift_mask, + insns = arm_gen_constant (AND, mode, cond, + remainder | shift_mask, new_src, source, subtargets, 1); source = new_src; } else { rtx targ = subtargets ? NULL_RTX : target; - insns = arm_gen_constant (AND, mode, remainder | shift_mask, + insns = arm_gen_constant (AND, mode, cond, + remainder | shift_mask, targ, source, subtargets, 0); } } @@ -1661,14 +2215,15 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, if (clear_zero_bit_copies >= 16 && clear_zero_bit_copies < 24) { HOST_WIDE_INT shift_mask = (1 << clear_zero_bit_copies) - 1; - + if ((remainder | shift_mask) != 0xffffffff) { if (generate) { rtx new_src = subtargets ? gen_reg_rtx (mode) : target; - insns = arm_gen_constant (AND, mode, remainder | shift_mask, + insns = arm_gen_constant (AND, mode, cond, + remainder | shift_mask, new_src, source, subtargets, 1); source = new_src; } @@ -1676,7 +2231,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, { rtx targ = subtargets ? NULL_RTX : target; - insns = arm_gen_constant (AND, mode, remainder | shift_mask, + insns = arm_gen_constant (AND, mode, cond, + remainder | shift_mask, targ, source, subtargets, 0); } } @@ -1763,12 +2319,12 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rather than having to synthesize both large constants from scratch. Therefore, we calculate how many insns would be required to emit - the constant starting from `best_start', and also starting from - zero (ie with bit 31 first to be output). If `best_start' doesn't + the constant starting from `best_start', and also starting from + zero (i.e. with bit 31 first to be output). If `best_start' doesn't yield a shorter sequence, we may as well use zero. */ if (best_start != 0 && ((((unsigned HOST_WIDE_INT) 1) << best_start) < remainder) - && (count_insns_for_constant (remainder, 0) <= + && (count_insns_for_constant (remainder, 0) <= count_insns_for_constant (remainder, best_start))) best_start = 0; @@ -1821,7 +2377,9 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, else temp1_rtx = gen_rtx_fmt_ee (code, mode, source, temp1_rtx); - emit_insn (gen_rtx_SET (VOIDmode, new_src, temp1_rtx)); + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, new_src, + temp1_rtx)); source = new_src; } @@ -1849,9 +2407,12 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, immediate value easier to load. */ enum rtx_code -arm_canonicalize_comparison (enum rtx_code code, rtx * op1) +arm_canonicalize_comparison (enum rtx_code code, enum machine_mode mode, + rtx * op1) { unsigned HOST_WIDE_INT i = INTVAL (*op1); + unsigned HOST_WIDE_INT maxval; + maxval = (((unsigned HOST_WIDE_INT) 1) << (GET_MODE_BITSIZE(mode) - 1)) - 1; switch (code) { @@ -1861,7 +2422,7 @@ arm_canonicalize_comparison (enum rtx_code code, rtx * op1) case GT: case LE: - if (i != ((((unsigned HOST_WIDE_INT) 1) << (HOST_BITS_PER_WIDE_INT - 1)) - 1) + if (i != maxval && (const_ok_for_arm (i + 1) || const_ok_for_arm (-(i + 1)))) { *op1 = GEN_INT (i + 1); @@ -1871,7 +2432,7 @@ arm_canonicalize_comparison (enum rtx_code code, rtx * op1) case GE: case LT: - if (i != (((unsigned HOST_WIDE_INT) 1) << (HOST_BITS_PER_WIDE_INT - 1)) + if (i != ~maxval && (const_ok_for_arm (i - 1) || const_ok_for_arm (-(i - 1)))) { *op1 = GEN_INT (i - 1); @@ -1900,12 +2461,65 @@ arm_canonicalize_comparison (enum rtx_code code, rtx * op1) break; default: - abort (); + gcc_unreachable (); } return code; } + +/* Define how to find the value returned by a function. */ + +rtx +arm_function_value(tree type, tree func ATTRIBUTE_UNUSED) +{ + enum machine_mode mode; + int unsignedp ATTRIBUTE_UNUSED; + rtx r ATTRIBUTE_UNUSED; + + mode = TYPE_MODE (type); + /* Promote integer types. */ + if (INTEGRAL_TYPE_P (type)) + PROMOTE_FUNCTION_MODE (mode, unsignedp, type); + + /* Promotes small structs returned in a register to full-word size + for big-endian AAPCS. */ + if (arm_return_in_msb (type)) + { + HOST_WIDE_INT size = int_size_in_bytes (type); + if (size % UNITS_PER_WORD != 0) + { + size += UNITS_PER_WORD - size % UNITS_PER_WORD; + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); + } + } + + return LIBCALL_VALUE(mode); +} + +/* Determine the amount of memory needed to store the possible return + registers of an untyped call. */ +int +arm_apply_result_size (void) +{ + int size = 16; + + if (TARGET_ARM) + { + if (TARGET_HARD_FLOAT_ABI) + { + if (TARGET_FPA) + size += 12; + if (TARGET_MAVERICK) + size += 8; + } + if (TARGET_IWMMXT_ABI) + size += 8; + } + + return size; +} + /* Decide whether a type should be returned in memory (true) or in a register (false). This is called by the macro RETURN_IN_MEMORY. */ @@ -1914,19 +2528,27 @@ arm_return_in_memory (tree type) { HOST_WIDE_INT size; - if (!AGGREGATE_TYPE_P (type)) - /* All simple types are returned in registers. */ + if (!AGGREGATE_TYPE_P (type) && + (TREE_CODE (type) != VECTOR_TYPE) && + !(TARGET_AAPCS_BASED && TREE_CODE (type) == COMPLEX_TYPE)) + /* All simple types are returned in registers. + For AAPCS, complex types are treated the same as aggregates. */ return 0; size = int_size_in_bytes (type); - if (TARGET_ATPCS) + if (arm_abi != ARM_ABI_APCS) { - /* ATPCS returns aggregate types in memory only if they are + /* ATPCS and later return aggregate types in memory only if they are larger than a word (or are variable size). */ return (size < 0 || size > UNITS_PER_WORD); } - + + /* To maximize backwards compatibility with previous versions of gcc, + return vectors up to 4 words in registers. */ + if (TREE_CODE (type) == VECTOR_TYPE) + return (size < 0 || size > (4 * UNITS_PER_WORD)); + /* For the arm-wince targets we choose to be compatible with Microsoft's ARM and Thumb compilers, which always return aggregates in memory. */ #ifndef ARM_WINCE @@ -1936,7 +2558,7 @@ arm_return_in_memory (tree type) we will want to return it via memory and not in a register. */ if (size < 0 || size > UNITS_PER_WORD) return 1; - + if (TREE_CODE (type) == RECORD_TYPE) { tree field; @@ -1946,14 +2568,14 @@ arm_return_in_memory (tree type) has an offset of zero. For practical purposes this means that the structure can have at most one non bit-field element and that this element must be the first one in the structure. */ - + /* Find the first field, ignoring non FIELD_DECL things which will have been created by C++. */ for (field = TYPE_FIELDS (type); field && TREE_CODE (field) != FIELD_DECL; field = TREE_CHAIN (field)) continue; - + if (field == NULL) return 0; /* An empty structure. Allowed by an extension to ANSI C. */ @@ -1976,14 +2598,14 @@ arm_return_in_memory (tree type) { if (TREE_CODE (field) != FIELD_DECL) continue; - + if (!DECL_BIT_FIELD_TYPE (field)) return 1; } return 0; } - + if (TREE_CODE (type) == UNION_TYPE) { tree field; @@ -1999,15 +2621,15 @@ arm_return_in_memory (tree type) if (FLOAT_TYPE_P (TREE_TYPE (field))) return 1; - + if (RETURN_IN_MEMORY (TREE_TYPE (field))) return 1; } - + return 0; } -#endif /* not ARM_WINCE */ - +#endif /* not ARM_WINCE */ + /* Return all other types in memory. */ return 1; } @@ -2017,15 +2639,14 @@ arm_return_in_memory (tree type) int arm_float_words_big_endian (void) { - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) return 0; /* For FPA, float words are always big-endian. For VFP, floats words follow the memory system mode. */ - if (TARGET_HARD_FLOAT) + if (TARGET_FPA) { - /* FIXME: TARGET_HARD_FLOAT currently implies FPA. */ return 1; } @@ -2039,19 +2660,20 @@ arm_float_words_big_endian (void) for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is NULL. */ void -arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype, +arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype, rtx libname ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNUSED) { /* On the ARM, the offset starts at 0. */ - pcum->nregs = ((fntype && aggregate_value_p (TREE_TYPE (fntype), fntype)) ? 1 : 0); + pcum->nregs = 0; pcum->iwmmxt_nregs = 0; - + pcum->can_split = true; + pcum->call_cookie = CALL_NORMAL; if (TARGET_LONG_CALLS) pcum->call_cookie = CALL_LONG; - + /* Check for long call/short call attributes. The attributes override any command line option. */ if (fntype) @@ -2081,6 +2703,16 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype, } } + +/* Return true if mode/type need doubleword alignment. */ +bool +arm_needs_doubleword_align (enum machine_mode mode, tree type) +{ + return (GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY + || (type && TYPE_ALIGN (type) > PARM_BOUNDARY)); +} + + /* Determine where to put an argument to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. @@ -2096,92 +2728,81 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype, rtx arm_function_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode, - tree type ATTRIBUTE_UNUSED, int named) + tree type, int named) { - if (TARGET_REALLY_IWMMXT) + int nregs; + + /* Varargs vectors are treated the same as long long. + named_count avoids having to change the way arm handles 'named' */ + if (TARGET_IWMMXT_ABI + && arm_vector_mode_supported_p (mode) + && pcum->named_count > pcum->nargs + 1) { - if (VECTOR_MODE_SUPPORTED_P (mode)) + if (pcum->iwmmxt_nregs <= 9) + return gen_rtx_REG (mode, pcum->iwmmxt_nregs + FIRST_IWMMXT_REGNUM); + else { - /* varargs vectors are treated the same as long long. - named_count avoids having to change the way arm handles 'named' */ - if (pcum->named_count <= pcum->nargs + 1) - { - if (pcum->nregs == 1) - pcum->nregs += 1; - if (pcum->nregs <= 2) - return gen_rtx_REG (mode, pcum->nregs); - else - return NULL_RTX; - } - else if (pcum->iwmmxt_nregs <= 9) - return gen_rtx_REG (mode, pcum->iwmmxt_nregs + FIRST_IWMMXT_REGNUM); - else - return NULL_RTX; + pcum->can_split = false; + return NULL_RTX; } - else if ((mode == DImode || mode == DFmode) && pcum->nregs & 1) - pcum->nregs += 1; } + /* Put doubleword aligned quantities in even register pairs. */ + if (pcum->nregs & 1 + && ARM_DOUBLEWORD_ALIGN + && arm_needs_doubleword_align (mode, type)) + pcum->nregs++; + if (mode == VOIDmode) /* Compute operand 2 of the call insn. */ return GEN_INT (pcum->call_cookie); - - if (!named || pcum->nregs >= NUM_ARG_REGS) + + /* Only allow splitting an arg between regs and memory if all preceding + args were allocated to regs. For args passed by reference we only count + the reference pointer. */ + if (pcum->can_split) + nregs = 1; + else + nregs = ARM_NUM_REGS2 (mode, type); + + if (!named || pcum->nregs + nregs > NUM_ARG_REGS) return NULL_RTX; - + return gen_rtx_REG (mode, pcum->nregs); } +static int +arm_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode, + tree type, bool named ATTRIBUTE_UNUSED) +{ + int nregs = pcum->nregs; + + if (arm_vector_mode_supported_p (mode)) + return 0; + + if (NUM_ARG_REGS > nregs + && (NUM_ARG_REGS < nregs + ARM_NUM_REGS2 (mode, type)) + && pcum->can_split) + return (NUM_ARG_REGS - nregs) * UNITS_PER_WORD; + + return 0; +} + /* Variable sized types are passed by reference. This is a GCC extension to the ARM ABI. */ -int -arm_function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED, - tree type, int named ATTRIBUTE_UNUSED) +static bool +arm_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, bool named ATTRIBUTE_UNUSED) { return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; } - -/* Implement va_arg. */ - -rtx -arm_va_arg (tree valist, tree type) -{ - /* Variable sized types are passed by reference. */ - if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) - { - rtx addr = std_expand_builtin_va_arg (valist, build_pointer_type (type)); - return gen_rtx_MEM (ptr_mode, force_reg (Pmode, addr)); - } - - if (FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), NULL) == IWMMXT_ALIGNMENT) - { - tree minus_eight; - tree t; - - /* Maintain 64-bit alignment of the valist pointer by - constructing: valist = ((valist + (8 - 1)) & -8). */ - minus_eight = build_int_2 (- (IWMMXT_ALIGNMENT / BITS_PER_UNIT), -1); - t = build_int_2 ((IWMMXT_ALIGNMENT / BITS_PER_UNIT) - 1, 0); - t = build (PLUS_EXPR, TREE_TYPE (valist), valist, t); - t = build (BIT_AND_EXPR, TREE_TYPE (t), t, minus_eight); - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - - /* This is to stop the combine pass optimizing - away the alignment adjustment. */ - mark_reg_pointer (arg_pointer_rtx, PARM_BOUNDARY); - } - - return std_expand_builtin_va_arg (valist, type); -} /* Encode the current state of the #pragma [no_]long_calls. */ typedef enum { - OFF, /* No #pramgma [no_]long_calls is in effect. */ + OFF, /* No #pragma [no_]long_calls is in effect. */ LONG, /* #pragma long_calls is in effect. */ SHORT /* #pragma no_long_calls is in effect. */ } arm_pragma_enum; @@ -2217,7 +2838,7 @@ const struct attribute_spec arm_attribute_table[] = /* Whereas these functions are always known to reside within the 26 bit addressing range. */ { "short_call", 0, 0, false, true, true, NULL }, - /* Interrupt Service Routines have special prologue and epilogue requirements. */ + /* Interrupt Service Routines have special prologue and epilogue requirements. */ { "isr", 0, 1, false, false, false, arm_handle_isr_attribute }, { "interrupt", 0, 1, false, false, false, arm_handle_isr_attribute }, { "naked", 0, 0, true, false, false, arm_handle_fndecl_attribute }, @@ -2234,6 +2855,10 @@ const struct attribute_spec arm_attribute_table[] = { "dllimport", 0, 0, true, false, false, NULL }, { "dllexport", 0, 0, true, false, false, NULL }, { "interfacearm", 0, 0, true, false, false, arm_handle_fndecl_attribute }, +#elif TARGET_DLLIMPORT_DECL_ATTRIBUTES + { "dllimport", 0, 0, false, false, false, handle_dll_attribute }, + { "dllexport", 0, 0, false, false, false, handle_dll_attribute }, + { "notshared", 0, 0, false, true, false, arm_handle_notshared_attribute }, #endif { NULL, 0, 0, false, false, false, NULL } }; @@ -2246,7 +2871,7 @@ arm_handle_fndecl_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning (OPT_Wattributes, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2264,7 +2889,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("`%s' attribute only applies to functions", + warning (OPT_Wattributes, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2278,7 +2903,8 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (arm_isr_value (args) == ARM_FT_UNKNOWN) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -2287,7 +2913,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, || TREE_CODE (TREE_TYPE (*node)) == METHOD_TYPE) && arm_isr_value (args) != ARM_FT_UNKNOWN) { - *node = build_type_copy (*node); + *node = build_variant_type_copy (*node); TREE_TYPE (*node) = build_type_attribute_variant (TREE_TYPE (*node), tree_cons (name, args, TYPE_ATTRIBUTES (TREE_TYPE (*node)))); @@ -2305,7 +2931,8 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, } else { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); } } } @@ -2313,6 +2940,31 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, return NULL_TREE; } +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES +/* Handle the "notshared" attribute. This attribute is another way of + requesting hidden visibility. ARM's compiler supports + "__declspec(notshared)"; we support the same thing via an + attribute. */ + +static tree +arm_handle_notshared_attribute (tree *node, + tree name ATTRIBUTE_UNUSED, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + tree decl = TYPE_NAME (*node); + + if (decl) + { + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + *no_add_attrs = false; + } + return NULL_TREE; +} +#endif + /* Return 0 if the attributes for two types are incompatible, 1 if they are compatible, and 2 if they are nearly compatible (which causes a warning to be generated). */ @@ -2320,7 +2972,7 @@ static int arm_comp_type_attributes (tree type1, tree type2) { int l1, l2, s1, s2; - + /* Check for mismatch of non-default calling convention. */ if (TREE_CODE (type1) != FUNCTION_TYPE) return 1; @@ -2342,7 +2994,7 @@ arm_comp_type_attributes (tree type1, tree type2) if ((l1 & s2) || (l2 & s1)) return 0; } - + /* Check for mismatched ISR attribute. */ l1 = lookup_attribute ("isr", TYPE_ATTRIBUTES (type1)) != NULL; if (! l1) @@ -2416,7 +3068,7 @@ current_file_function_operand (rtx sym_ref) return 1; /* The current function is always defined within the current compilation - unit. if it s a weak definition however, then this may not be the real + unit. If it s a weak definition however, then this may not be the real definition of the function, and so we have to say no. */ if (sym_ref == XEXP (DECL_RTL (current_function_decl), 0) && !DECL_WEAK (current_function_decl)) @@ -2432,16 +3084,19 @@ current_file_function_operand (rtx sym_ref) a. has an __attribute__((long call)) or b. is within the scope of a #pragma long_calls or c. the -mlong-calls command line switch has been specified + . and either: + 1. -ffunction-sections is in effect + or 2. the current function has __attribute__ ((section)) + or 3. the target function has __attribute__ ((section)) However we do not generate a long call if the function: - + d. has an __attribute__ ((short_call)) or e. is inside the scope of a #pragma no_long_calls - or f. has an __attribute__ ((section)) - or g. is defined within the current compilation unit. - + or f. is defined within the current compilation unit. + This function will be called by C fragments contained in the machine - description file. CALL_REF and CALL_COOKIE correspond to the matched + description file. SYM_REF and CALL_COOKIE correspond to the matched rtl operands. CALL_SYMBOL is used to distinguish between two different callers of the function. It is set to 1 in the "call_symbol" and "call_symbol_value" patterns and to 0 in the "call" @@ -2464,12 +3119,18 @@ arm_is_longcall_p (rtx sym_ref, int call_cookie, int call_symbol) if (call_cookie & CALL_SHORT) return 0; - if (TARGET_LONG_CALLS && flag_function_sections) - return 1; - + if (TARGET_LONG_CALLS) + { + if (flag_function_sections + || DECL_SECTION_NAME (current_function_decl)) + /* c.3 is handled by the definition of the + ARM_DECLARE_FUNCTION_SIZE macro. */ + return 1; + } + if (current_file_function_operand (sym_ref)) return 0; - + return (call_cookie & CALL_LONG) || ENCODED_LONG_CALL_ATTR_P (XSTR (sym_ref, 0)) || TARGET_LONG_CALLS; @@ -2502,7 +3163,7 @@ arm_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) return false; /* If we are interworking and the function is not declared static - then we can't tail-call it unless we know that it exists in this + then we can't tail-call it unless we know that it exists in this compilation unit (since it might be a Thumb routine). */ if (TARGET_INTERWORK && TREE_PUBLIC (decl) && !TREE_ASM_WRITTEN (decl)) return false; @@ -2519,16 +3180,14 @@ arm_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) /* Addressing mode support functions. */ /* Return nonzero if X is a legitimate immediate operand when compiling - for PIC. */ + for PIC. We know that X satisfies CONSTANT_P and flag_pic is true. */ int legitimate_pic_operand_p (rtx x) { - if (CONSTANT_P (x) - && flag_pic - && (GET_CODE (x) == SYMBOL_REF - || (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF))) + if (GET_CODE (x) == SYMBOL_REF + || (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)) return 0; return 1; @@ -2546,12 +3205,53 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) rtx insn; int subregs = 0; + /* If this function doesn't have a pic register, create one now. + A lot of the logic here is made obscure by the fact that this + routine gets called as part of the rtx cost estimation + process. We don't want those calls to affect any assumptions + about the real function; and further, we can't call + entry_of_function() until we start the real expansion + process. */ + if (!current_function_uses_pic_offset_table) + { + gcc_assert (!no_new_pseudos); + if (arm_pic_register != INVALID_REGNUM) + { + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + + /* Play games to avoid marking the function as needing pic + if we are being called as part of the cost-estimation + process. */ + if (!ir_type()) + current_function_uses_pic_offset_table = 1; + } + else + { + rtx seq; + + cfun->machine->pic_reg = gen_reg_rtx (Pmode); + + /* Play games to avoid marking the function as needing pic + if we are being called as part of the cost-estimation + process. */ + if (!ir_type()) + { + current_function_uses_pic_offset_table = 1; + start_sequence (); + + arm_load_pic_register (0UL); + + seq = get_insns (); + end_sequence (); + emit_insn_after (seq, entry_of_function ()); + } + } + } + if (reg == 0) { - if (no_new_pseudos) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); subregs = 1; } @@ -2572,21 +3272,19 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) emit_insn (gen_pic_load_addr_thumb (address, orig)); if ((GET_CODE (orig) == LABEL_REF - || (GET_CODE (orig) == SYMBOL_REF && + || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig))) && NEED_GOT_RELOC) - pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); + pic_ref = gen_rtx_PLUS (Pmode, cfun->machine->pic_reg, address); else { - pic_ref = gen_rtx_MEM (Pmode, - gen_rtx_PLUS (Pmode, pic_offset_table_rtx, - address)); - RTX_UNCHANGING_P (pic_ref) = 1; + pic_ref = gen_const_mem (Pmode, + gen_rtx_PLUS (Pmode, cfun->machine->pic_reg, + address)); } insn = emit_move_insn (reg, pic_ref); #endif - current_function_uses_pic_offset_table = 1; /* Put a REG_EQUAL note on this insn, so that it can be optimized by loop. */ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, @@ -2598,36 +3296,33 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) rtx base, offset; if (GET_CODE (XEXP (orig, 0)) == PLUS - && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) + && XEXP (XEXP (orig, 0), 0) == cfun->machine->pic_reg) + return orig; + + if (GET_CODE (XEXP (orig, 0)) == UNSPEC + && XINT (XEXP (orig, 0), 1) == UNSPEC_TLS) return orig; if (reg == 0) { - if (no_new_pseudos) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); } - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else - abort (); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (offset) == CONST_INT) { /* The base register doesn't really matter, we only want to test the index for the appropriate mode. */ - if (!arm_legitimate_index_p (mode, offset, 0)) + if (!arm_legitimate_index_p (mode, offset, SET, 0)) { - if (!no_new_pseudos) - offset = force_reg (Pmode, offset); - else - abort (); + gcc_assert (!no_new_pseudos); + offset = force_reg (Pmode, offset); } if (GET_CODE (offset) == CONST_INT) @@ -2648,31 +3343,89 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) return orig; } -/* Generate code to load the PIC register. PROLOGUE is true if - called from arm_expand_prologue (in which case we want the - generated insns at the start of the function); false if called - by an exception receiver that needs the PIC register reloaded - (in which case the insns are just dumped at the current location). */ + +/* Find a spare low register to use during the prolog of a function. */ + +static int +thumb_find_work_register (unsigned long pushed_regs_mask) +{ + int reg; + + /* Check the argument registers first as these are call-used. The + register allocation order means that sometimes r3 might be used + but earlier argument registers might not, so check them all. */ + for (reg = LAST_ARG_REGNUM; reg >= 0; reg --) + if (!regs_ever_live[reg]) + return reg; + + /* Before going on to check the call-saved registers we can try a couple + more ways of deducing that r3 is available. The first is when we are + pushing anonymous arguments onto the stack and we have less than 4 + registers worth of fixed arguments(*). In this case r3 will be part of + the variable argument list and so we can be sure that it will be + pushed right at the start of the function. Hence it will be available + for the rest of the prologue. + (*): ie current_function_pretend_args_size is greater than 0. */ + if (cfun->machine->uses_anonymous_args + && current_function_pretend_args_size > 0) + return LAST_ARG_REGNUM; + + /* The other case is when we have fixed arguments but less than 4 registers + worth. In this case r3 might be used in the body of the function, but + it is not being used to convey an argument into the function. In theory + we could just check current_function_args_size to see how many bytes are + being passed in argument registers, but it seems that it is unreliable. + Sometimes it will have the value 0 when in fact arguments are being + passed. (See testcase execute/20021111-1.c for an example). So we also + check the args_info.nregs field as well. The problem with this field is + that it makes no allowances for arguments that are passed to the + function but which are not used. Hence we could miss an opportunity + when a function has an unused argument in r3. But it is better to be + safe than to be sorry. */ + if (! cfun->machine->uses_anonymous_args + && current_function_args_size >= 0 + && current_function_args_size <= (LAST_ARG_REGNUM * UNITS_PER_WORD) + && cfun->args_info.nregs < 4) + return LAST_ARG_REGNUM; + + /* Otherwise look for a call-saved register that is going to be pushed. */ + for (reg = LAST_LO_REGNUM; reg > LAST_ARG_REGNUM; reg --) + if (pushed_regs_mask & (1 << reg)) + return reg; + + /* Something went wrong - thumb_compute_save_reg_mask() + should have arranged for a suitable register to be pushed. */ + gcc_unreachable (); +} + +static GTY(()) int pic_labelno; + +/* Generate code to load the PIC register. In thumb mode SCRATCH is a + low register. */ + void -arm_finalize_pic (int prologue ATTRIBUTE_UNUSED) +arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) { #ifndef AOF_ASSEMBLER - rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx; + rtx l1, labelno, pic_tmp, pic_tmp2, pic_rtx; rtx global_offset_table; if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) return; - if (!flag_pic) - abort (); + gcc_assert (flag_pic); - start_sequence (); - l1 = gen_label_rtx (); + /* We use an UNSPEC rather than a LABEL_REF because this label never appears + in the code stream. */ + + labelno = GEN_INT (pic_labelno++); + l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + l1 = gen_rtx_CONST (VOIDmode, l1); global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); /* On the ARM the PC register contains 'dot + 8' at the time of the addition, on the Thumb it is 'dot + 4'. */ - pic_tmp = plus_constant (gen_rtx_LABEL_REF (Pmode, l1), TARGET_ARM ? 8 : 4); + pic_tmp = plus_constant (l1, TARGET_ARM ? 8 : 4); if (GOT_PCREL) pic_tmp2 = gen_rtx_CONST (VOIDmode, gen_rtx_PLUS (Pmode, global_offset_table, pc_rtx)); @@ -2680,31 +3433,38 @@ arm_finalize_pic (int prologue ATTRIBUTE_UNUSED) pic_tmp2 = gen_rtx_CONST (VOIDmode, global_offset_table); pic_rtx = gen_rtx_CONST (Pmode, gen_rtx_MINUS (Pmode, pic_tmp2, pic_tmp)); - + if (TARGET_ARM) { - emit_insn (gen_pic_load_addr_arm (pic_offset_table_rtx, pic_rtx)); - emit_insn (gen_pic_add_dot_plus_eight (pic_offset_table_rtx, l1)); + emit_insn (gen_pic_load_addr_arm (cfun->machine->pic_reg, pic_rtx)); + emit_insn (gen_pic_add_dot_plus_eight (cfun->machine->pic_reg, + cfun->machine->pic_reg, labelno)); } else { - emit_insn (gen_pic_load_addr_thumb (pic_offset_table_rtx, pic_rtx)); - emit_insn (gen_pic_add_dot_plus_four (pic_offset_table_rtx, l1)); + if (arm_pic_register != INVALID_REGNUM + && REGNO (cfun->machine->pic_reg) > LAST_LO_REGNUM) + { + /* We will have pushed the pic register, so we should always be + able to find a work register. */ + pic_tmp = gen_rtx_REG (SImode, + thumb_find_work_register (saved_regs)); + emit_insn (gen_pic_load_addr_thumb (pic_tmp, pic_rtx)); + emit_insn (gen_movsi (pic_offset_table_rtx, pic_tmp)); + } + else + emit_insn (gen_pic_load_addr_thumb (cfun->machine->pic_reg, pic_rtx)); + emit_insn (gen_pic_add_dot_plus_four (cfun->machine->pic_reg, + cfun->machine->pic_reg, labelno)); } - seq = get_insns (); - end_sequence (); - if (prologue) - emit_insn_after (seq, get_insns ()); - else - emit_insn (seq); - /* Need to emit this whether or not we obey regdecls, since setjmp/longjmp can cause life info to screw up. */ - emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, cfun->machine->pic_reg)); #endif /* AOF_ASSEMBLER */ } + /* Return nonzero if X is valid as an ARM state addressing register. */ static int arm_address_register_rtx_p (rtx x, int strict_p) @@ -2725,28 +3485,62 @@ arm_address_register_rtx_p (rtx x, int strict_p) || regno == ARG_POINTER_REGNUM); } +/* Return TRUE if this rtx is the difference of a symbol and a label, + and will reduce to a PC-relative relocation in the object file. + Expressions like this can be left alone when generating PIC, rather + than forced through the GOT. */ +static int +pcrel_constant_p (rtx x) +{ + if (GET_CODE (x) == MINUS) + return symbol_mentioned_p (XEXP (x, 0)) && label_mentioned_p (XEXP (x, 1)); + + return FALSE; +} + /* Return nonzero if X is a valid ARM state address operand. */ int -arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) +arm_legitimate_address_p (enum machine_mode mode, rtx x, RTX_CODE outer, + int strict_p) { + bool use_ldrd; + enum rtx_code code = GET_CODE (x); + if (arm_address_register_rtx_p (x, strict_p)) return 1; - else if (GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_DEC) + use_ldrd = (TARGET_LDRD + && (mode == DImode + || (mode == DFmode && (TARGET_SOFT_FLOAT || TARGET_VFP)))); + + if (code == POST_INC || code == PRE_DEC + || ((code == PRE_INC || code == POST_DEC) + && (use_ldrd || GET_MODE_SIZE (mode) <= 4))) return arm_address_register_rtx_p (XEXP (x, 0), strict_p); - else if ((GET_CODE (x) == POST_MODIFY || GET_CODE (x) == PRE_MODIFY) - && GET_MODE_SIZE (mode) <= 4 + else if ((code == POST_MODIFY || code == PRE_MODIFY) && arm_address_register_rtx_p (XEXP (x, 0), strict_p) && GET_CODE (XEXP (x, 1)) == PLUS && rtx_equal_p (XEXP (XEXP (x, 1), 0), XEXP (x, 0))) - return arm_legitimate_index_p (mode, XEXP (XEXP (x, 1), 1), strict_p); + { + rtx addend = XEXP (XEXP (x, 1), 1); + + /* Don't allow ldrd post increment by register because it's hard + to fixup invalid register choices. */ + if (use_ldrd + && GET_CODE (x) == POST_MODIFY + && GET_CODE (addend) == REG) + return 0; + + return ((use_ldrd || GET_MODE_SIZE (mode) <= 4) + && arm_legitimate_index_p (mode, addend, outer, strict_p)); + } /* After reload constants split into minipools will have addresses from a LABEL_REF. */ else if (reload_completed - && (GET_CODE (x) == LABEL_REF - || (GET_CODE (x) == CONST + && (code == LABEL_REF + || (code == CONST && GET_CODE (XEXP (x, 0)) == PLUS && GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))) @@ -2755,28 +3549,15 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) else if (mode == TImode) return 0; - else if (mode == DImode || (TARGET_SOFT_FLOAT && mode == DFmode)) - { - if (GET_CODE (x) == PLUS - && arm_address_register_rtx_p (XEXP (x, 0), strict_p) - && GET_CODE (XEXP (x, 1)) == CONST_INT) - { - HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); - - if (val == 4 || val == -4 || val == -8) - return 1; - } - } - - else if (GET_CODE (x) == PLUS) + else if (code == PLUS) { rtx xop0 = XEXP (x, 0); rtx xop1 = XEXP (x, 1); return ((arm_address_register_rtx_p (xop0, strict_p) - && arm_legitimate_index_p (mode, xop1, strict_p)) + && arm_legitimate_index_p (mode, xop1, outer, strict_p)) || (arm_address_register_rtx_p (xop1, strict_p) - && arm_legitimate_index_p (mode, xop0, strict_p))); + && arm_legitimate_index_p (mode, xop0, outer, strict_p))); } #if 0 @@ -2787,20 +3568,16 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) rtx xop1 = XEXP (x, 1); return (arm_address_register_rtx_p (xop0, strict_p) - && arm_legitimate_index_p (mode, xop1, strict_p)); + && arm_legitimate_index_p (mode, xop1, outer, strict_p)); } #endif else if (GET_MODE_CLASS (mode) != MODE_FLOAT - && GET_CODE (x) == SYMBOL_REF + && code == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x) && ! (flag_pic - && symbol_mentioned_p (get_pool_constant (x)))) - return 1; - - else if ((GET_CODE (x) == PRE_INC || GET_CODE (x) == POST_DEC) - && (GET_MODE_SIZE (mode) <= 4) - && arm_address_register_rtx_p (XEXP (x, 0), strict_p)) + && symbol_mentioned_p (get_pool_constant (x)) + && ! pcrel_constant_p (get_pool_constant (x)))) return 1; return 0; @@ -2809,63 +3586,87 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) /* Return nonzero if INDEX is valid for an address index operand in ARM state. */ static int -arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p) +arm_legitimate_index_p (enum machine_mode mode, rtx index, RTX_CODE outer, + int strict_p) { HOST_WIDE_INT range; enum rtx_code code = GET_CODE (index); - if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + /* Standard coprocessor addressing modes. */ + if (TARGET_HARD_FLOAT + && (TARGET_FPA || TARGET_MAVERICK) + && (GET_MODE_CLASS (mode) == MODE_FLOAT + || (TARGET_MAVERICK && mode == DImode))) return (code == CONST_INT && INTVAL (index) < 1024 && INTVAL (index) > -1024 && (INTVAL (index) & 3) == 0); - if (TARGET_CIRRUS - && (GET_MODE_CLASS (mode) == MODE_FLOAT || mode == DImode)) - return (code == CONST_INT - && INTVAL (index) < 255 - && INTVAL (index) > -255); + if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode)) + { + /* For DImode assume values will usually live in core regs + and only allow LDRD addressing modes. */ + if (!TARGET_LDRD || mode != DImode) + return (code == CONST_INT + && INTVAL (index) < 1024 + && INTVAL (index) > -1024 + && (INTVAL (index) & 3) == 0); + } if (arm_address_register_rtx_p (index, strict_p) - && GET_MODE_SIZE (mode) <= 4) + && (GET_MODE_SIZE (mode) <= 4)) return 1; - if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode)) - return (code == CONST_INT - && INTVAL (index) < 256 - && INTVAL (index) > -256); - - /* XXX What about ldrsb? */ - if (GET_MODE_SIZE (mode) <= 4 && code == MULT - && (!arm_arch4 || (mode) != HImode)) + if (mode == DImode || mode == DFmode) { - rtx xiop0 = XEXP (index, 0); - rtx xiop1 = XEXP (index, 1); + if (code == CONST_INT) + { + HOST_WIDE_INT val = INTVAL (index); - return ((arm_address_register_rtx_p (xiop0, strict_p) - && power_of_two_operand (xiop1, SImode)) - || (arm_address_register_rtx_p (xiop1, strict_p) - && power_of_two_operand (xiop0, SImode))); + if (TARGET_LDRD) + return val > -256 && val < 256; + else + return val > -4096 && val < 4092; + } + + return TARGET_LDRD && arm_address_register_rtx_p (index, strict_p); } if (GET_MODE_SIZE (mode) <= 4 - && (code == LSHIFTRT || code == ASHIFTRT - || code == ASHIFT || code == ROTATERT) - && (!arm_arch4 || (mode) != HImode)) + && ! (arm_arch4 + && (mode == HImode + || (mode == QImode && outer == SIGN_EXTEND)))) { - rtx op = XEXP (index, 1); + if (code == MULT) + { + rtx xiop0 = XEXP (index, 0); + rtx xiop1 = XEXP (index, 1); - return (arm_address_register_rtx_p (XEXP (index, 0), strict_p) - && GET_CODE (op) == CONST_INT - && INTVAL (op) > 0 - && INTVAL (op) <= 31); + return ((arm_address_register_rtx_p (xiop0, strict_p) + && power_of_two_operand (xiop1, SImode)) + || (arm_address_register_rtx_p (xiop1, strict_p) + && power_of_two_operand (xiop0, SImode))); + } + else if (code == LSHIFTRT || code == ASHIFTRT + || code == ASHIFT || code == ROTATERT) + { + rtx op = XEXP (index, 1); + + return (arm_address_register_rtx_p (XEXP (index, 0), strict_p) + && GET_CODE (op) == CONST_INT + && INTVAL (op) > 0 + && INTVAL (op) <= 31); + } } - /* XXX For ARM v4 we may be doing a sign-extend operation during the - load, but that has a restricted addressing range and we are unable - to tell here whether that is the case. To be safe we restrict all - loads to that range. */ + /* For ARM v4 we may be doing a sign-extend operation during the + load. */ if (arm_arch4) - range = (mode == HImode || mode == QImode) ? 256 : 4096; + { + if (mode == HImode || (outer == SIGN_EXTEND && mode == QImode)) + range = 256; + else + range = 4096; + } else range = (mode == HImode) ? 4095 : 4096; @@ -2907,7 +3708,7 @@ thumb_index_register_rtx_p (rtx x, int strict_p) } /* Return nonzero if x is a legitimate Thumb-state address. - + The AP may be eliminated to either the SP or the FP, so we use the least common denominator, e.g. SImode, and offsets from 0 to 64. @@ -2944,7 +3745,7 @@ thumb_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) /* This is PC relative data before arm_reorg runs. */ else if (GET_MODE_SIZE (mode) >= 4 && CONSTANT_P (x) && GET_CODE (x) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (x) && ! flag_pic) + && CONSTANT_POOL_ADDRESS_P (x) && !flag_pic) return 1; /* This is PC relative data after arm_reorg runs. */ @@ -3006,8 +3807,9 @@ thumb_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) && GET_MODE_SIZE (mode) == 4 && GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x) - && !(flag_pic - && symbol_mentioned_p (get_pool_constant (x)))) + && ! (flag_pic + && symbol_mentioned_p (get_pool_constant (x)) + && ! pcrel_constant_p (get_pool_constant (x)))) return 1; return 0; @@ -3033,11 +3835,166 @@ thumb_legitimate_offset_p (enum machine_mode mode, HOST_WIDE_INT val) } } +/* Build the SYMBOL_REF for __tls_get_addr. */ + +static GTY(()) rtx tls_get_addr_libfunc; + +static rtx +get_tls_get_addr (void) +{ + if (!tls_get_addr_libfunc) + tls_get_addr_libfunc = init_one_libfunc ("__tls_get_addr"); + return tls_get_addr_libfunc; +} + +static rtx +arm_load_tp (rtx target) +{ + if (!target) + target = gen_reg_rtx (SImode); + + if (TARGET_HARD_TP) + { + /* Can return in any reg. */ + emit_insn (gen_load_tp_hard (target)); + } + else + { + /* Always returned in r0. Immediately copy the result into a pseudo, + otherwise other uses of r0 (e.g. setting up function arguments) may + clobber the value. */ + + rtx tmp; + + emit_insn (gen_load_tp_soft ()); + + tmp = gen_rtx_REG (SImode, 0); + emit_move_insn (target, tmp); + } + return target; +} + +static rtx +load_tls_operand (rtx x, rtx reg) +{ + rtx tmp; + + if (reg == NULL_RTX) + reg = gen_reg_rtx (SImode); + + tmp = gen_rtx_CONST (SImode, x); + + emit_move_insn (reg, tmp); + + return reg; +} + +static rtx +arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) +{ + rtx insns, label, labelno, sum; + + start_sequence (); + + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (reloc), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); + else + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + + *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, LCT_PURE, /* LCT_CONST? */ + Pmode, 1, reg, Pmode); + + insns = get_insns (); + end_sequence (); + + return insns; +} + +rtx +legitimize_tls_address (rtx x, rtx reg) +{ + rtx dest, tp, label, labelno, sum, insns, ret, eqv, addend; + unsigned int model = SYMBOL_REF_TLS_MODEL (x); + + switch (model) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); + dest = gen_reg_rtx (Pmode); + emit_libcall_block (insns, dest, ret, x); + return dest; + + case TLS_MODEL_LOCAL_DYNAMIC: + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); + + /* Attach a unique REG_EQUIV, to allow the RTL optimizers to + share the LDM result with other LD model accesses. */ + eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const1_rtx), + UNSPEC_TLS); + dest = gen_reg_rtx (Pmode); + emit_libcall_block (insns, dest, ret, eqv); + + /* Load the addend. */ + addend = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, x, GEN_INT (TLS_LDO32)), + UNSPEC_TLS); + addend = force_reg (SImode, gen_rtx_CONST (SImode, addend)); + return gen_rtx_PLUS (Pmode, dest, addend); + + case TLS_MODEL_INITIAL_EXEC: + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (TLS_IE32), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); + else + { + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + emit_move_insn (reg, gen_const_mem (SImode, reg)); + } + + tp = arm_load_tp (NULL_RTX); + + return gen_rtx_PLUS (Pmode, tp, reg); + + case TLS_MODEL_LOCAL_EXEC: + tp = arm_load_tp (NULL_RTX); + + reg = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_LE32)), + UNSPEC_TLS); + reg = force_reg (SImode, gen_rtx_CONST (SImode, reg)); + + return gen_rtx_PLUS (Pmode, tp, reg); + + default: + abort (); + } +} + /* Try machine-dependent ways of modifying an illegitimate address to be legitimate. If we find one, return the new, valid address. */ rtx arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) { + if (arm_tls_symbol_p (x)) + return legitimize_tls_address (x, NULL_RTX); + if (GET_CODE (x) == PLUS) { rtx xop0 = XEXP (x, 0); @@ -3056,7 +4013,10 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) rtx base_reg, val; n = INTVAL (xop1); - if (mode == DImode || (TARGET_SOFT_FLOAT && mode == DFmode)) + /* VFP addressing modes actually allow greater offsets, but for + now we just stick with the lowest common denominator. */ + if (mode == DImode + || ((TARGET_SOFT_FLOAT || TARGET_VFP) && mode == DFmode)) { low_n = n & 0x0f; n &= ~0x0f; @@ -3074,11 +4034,9 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) } base_reg = gen_reg_rtx (SImode); - val = force_operand (gen_rtx_PLUS (SImode, xop0, - GEN_INT (n)), NULL_RTX); + val = force_operand (plus_constant (xop0, n), NULL_RTX); emit_move_insn (base_reg, val); - x = (low_n == 0 ? base_reg - : gen_rtx_PLUS (SImode, base_reg, GEN_INT (low_n))); + x = plus_constant (base_reg, low_n); } else if (xop0 != XEXP (x, 0) || xop1 != XEXP (x, 1)) x = gen_rtx_PLUS (SImode, xop0, xop1); @@ -3101,6 +4059,34 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) x = gen_rtx_MINUS (SImode, xop0, xop1); } + /* Make sure to take full advantage of the pre-indexed addressing mode + with absolute addresses which often allows for the base register to + be factorized for multiple adjacent memory references, and it might + even allows for the mini pool to be avoided entirely. */ + else if (GET_CODE (x) == CONST_INT && optimize > 0) + { + unsigned int bits; + HOST_WIDE_INT mask, base, index; + rtx base_reg; + + /* ldr and ldrb can use a 12 bit index, ldrsb and the rest can only + use a 8 bit index. So let's use a 12 bit index for SImode only and + hope that arm_gen_constant will enable ldrb to use more bits. */ + bits = (mode == SImode) ? 12 : 8; + mask = (1 << bits) - 1; + base = INTVAL (x) & ~mask; + index = INTVAL (x) & mask; + if (bit_count (base & 0xffffffff) > (32 - bits)/2) + { + /* It'll most probably be more efficient to generate the base + with more bits set and use a negative index instead. */ + base |= mask; + index -= mask; + } + base_reg = force_reg (SImode, GEN_INT (base)); + x = plus_constant (base_reg, index); + } + if (flag_pic) { /* We need to find and carefully transform any SYMBOL and LABEL @@ -3114,8 +4100,164 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) return x; } - +/* Try machine-dependent ways of modifying an illegitimate Thumb address + to be legitimate. If we find one, return the new, valid address. */ +rtx +thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) +{ + if (arm_tls_symbol_p (x)) + return legitimize_tls_address (x, NULL_RTX); + + if (GET_CODE (x) == PLUS + && GET_CODE (XEXP (x, 1)) == CONST_INT + && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode) + || INTVAL (XEXP (x, 1)) < 0)) + { + rtx xop0 = XEXP (x, 0); + rtx xop1 = XEXP (x, 1); + HOST_WIDE_INT offset = INTVAL (xop1); + + /* Try and fold the offset into a biasing of the base register and + then offsetting that. Don't do this when optimizing for space + since it can cause too many CSEs. */ + if (optimize_size && offset >= 0 + && offset < 256 + 31 * GET_MODE_SIZE (mode)) + { + HOST_WIDE_INT delta; + + if (offset >= 256) + delta = offset - (256 - GET_MODE_SIZE (mode)); + else if (offset < 32 * GET_MODE_SIZE (mode) + 8) + delta = 31 * GET_MODE_SIZE (mode); + else + delta = offset & (~31 * GET_MODE_SIZE (mode)); + + xop0 = force_operand (plus_constant (xop0, offset - delta), + NULL_RTX); + x = plus_constant (xop0, delta); + } + else if (offset < 0 && offset > -256) + /* Small negative offsets are best done with a subtract before the + dereference, forcing these into a register normally takes two + instructions. */ + x = force_operand (x, NULL_RTX); + else + { + /* For the remaining cases, force the constant into a register. */ + xop1 = force_reg (SImode, xop1); + x = gen_rtx_PLUS (SImode, xop0, xop1); + } + } + else if (GET_CODE (x) == PLUS + && s_register_operand (XEXP (x, 1), SImode) + && !s_register_operand (XEXP (x, 0), SImode)) + { + rtx xop0 = force_operand (XEXP (x, 0), NULL_RTX); + + x = gen_rtx_PLUS (SImode, xop0, XEXP (x, 1)); + } + + if (flag_pic) + { + /* We need to find and carefully transform any SYMBOL and LABEL + references; so go back to the original address expression. */ + rtx new_x = legitimize_pic_address (orig_x, mode, NULL_RTX); + + if (new_x != orig_x) + x = new_x; + } + + return x; +} + +rtx +thumb_legitimize_reload_address (rtx *x_p, + enum machine_mode mode, + int opnum, int type, + int ind_levels ATTRIBUTE_UNUSED) +{ + rtx x = *x_p; + + if (GET_CODE (x) == PLUS + && GET_MODE_SIZE (mode) < 4 + && REG_P (XEXP (x, 0)) + && XEXP (x, 0) == stack_pointer_rtx + && GET_CODE (XEXP (x, 1)) == CONST_INT + && !thumb_legitimate_offset_p (mode, INTVAL (XEXP (x, 1)))) + { + rtx orig_x = x; + + x = copy_rtx (x); + push_reload (orig_x, NULL_RTX, x_p, NULL, MODE_BASE_REG_CLASS (mode), + Pmode, VOIDmode, 0, 0, opnum, type); + return x; + } + + /* If both registers are hi-regs, then it's better to reload the + entire expression rather than each register individually. That + only requires one reload register rather than two. */ + if (GET_CODE (x) == PLUS + && REG_P (XEXP (x, 0)) + && REG_P (XEXP (x, 1)) + && !REG_MODE_OK_FOR_REG_BASE_P (XEXP (x, 0), mode) + && !REG_MODE_OK_FOR_REG_BASE_P (XEXP (x, 1), mode)) + { + rtx orig_x = x; + + x = copy_rtx (x); + push_reload (orig_x, NULL_RTX, x_p, NULL, MODE_BASE_REG_CLASS (mode), + Pmode, VOIDmode, 0, 0, opnum, type); + return x; + } + + return NULL; +} + +/* Test for various thread-local symbols. */ + +/* Return TRUE if X is a thread-local symbol. */ + +static bool +arm_tls_symbol_p (rtx x) +{ + if (! TARGET_HAVE_TLS) + return false; + + if (GET_CODE (x) != SYMBOL_REF) + return false; + + return SYMBOL_REF_TLS_MODEL (x) != 0; +} + +/* Helper for arm_tls_referenced_p. */ + +static int +arm_tls_operand_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED) +{ + if (GET_CODE (*x) == SYMBOL_REF) + return SYMBOL_REF_TLS_MODEL (*x) != 0; + + /* Don't recurse into UNSPEC_TLS looking for TLS symbols; these are + TLS offsets, not real symbol references. */ + if (GET_CODE (*x) == UNSPEC + && XINT (*x, 1) == UNSPEC_TLS) + return -1; + + return 0; +} + +/* Return TRUE if X contains any TLS symbol references. */ + +bool +arm_tls_referenced_p (rtx x) +{ + if (! TARGET_HAVE_TLS) + return false; + + return for_each_rtx (&x, arm_tls_operand_p_1, NULL); +} + #define REG_OR_SUBREG_REG(X) \ (GET_CODE (X) == REG \ || (GET_CODE (X) == SUBREG && GET_CODE (SUBREG_REG (X)) == REG)) @@ -3126,6 +4268,124 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) #ifndef COSTS_N_INSNS #define COSTS_N_INSNS(N) ((N) * 4 - 2) #endif +static inline int +thumb_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + case ROTATERT: + case PLUS: + case MINUS: + case COMPARE: + case NEG: + case NOT: + return COSTS_N_INSNS (1); + + case MULT: + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + int cycles = 0; + unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1)); + + while (i) + { + i >>= 2; + cycles++; + } + return COSTS_N_INSNS (2) + cycles; + } + return COSTS_N_INSNS (1) + 16; + + case SET: + return (COSTS_N_INSNS (1) + + 4 * ((GET_CODE (SET_SRC (x)) == MEM) + + GET_CODE (SET_DEST (x)) == MEM)); + + case CONST_INT: + if (outer == SET) + { + if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256) + return 0; + if (thumb_shiftable_const (INTVAL (x))) + return COSTS_N_INSNS (2); + return COSTS_N_INSNS (3); + } + else if ((outer == PLUS || outer == COMPARE) + && INTVAL (x) < 256 && INTVAL (x) > -256) + return 0; + else if (outer == AND + && INTVAL (x) < 256 && INTVAL (x) >= -256) + return COSTS_N_INSNS (1); + else if (outer == ASHIFT || outer == ASHIFTRT + || outer == LSHIFTRT) + return 0; + return COSTS_N_INSNS (2); + + case CONST: + case CONST_DOUBLE: + case LABEL_REF: + case SYMBOL_REF: + return COSTS_N_INSNS (3); + + case UDIV: + case UMOD: + case DIV: + case MOD: + return 100; + + case TRUNCATE: + return 99; + + case AND: + case XOR: + case IOR: + /* XXX guess. */ + return 8; + + case MEM: + /* XXX another guess. */ + /* Memory costs quite a lot for the first word, but subsequent words + load at the equivalent of a single insn each. */ + return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) + + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) + ? 4 : 0)); + + case IF_THEN_ELSE: + /* XXX a guess. */ + if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC) + return 14; + return 2; + + case ZERO_EXTEND: + /* XXX still guessing. */ + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + return (1 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + case HImode: + return (4 + (mode == DImode ? 4 : 0) + + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + case SImode: + return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); + + default: + return 99; + } + + default: + return 99; + } +} + + /* Worker routine for arm_rtx_costs. */ static inline int arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) @@ -3134,121 +4394,6 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) enum rtx_code subcode; int extra_cost; - if (TARGET_THUMB) - { - switch (code) - { - case ASHIFT: - case ASHIFTRT: - case LSHIFTRT: - case ROTATERT: - case PLUS: - case MINUS: - case COMPARE: - case NEG: - case NOT: - return COSTS_N_INSNS (1); - - case MULT: - if (GET_CODE (XEXP (x, 1)) == CONST_INT) - { - int cycles = 0; - unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1)); - - while (i) - { - i >>= 2; - cycles++; - } - return COSTS_N_INSNS (2) + cycles; - } - return COSTS_N_INSNS (1) + 16; - - case SET: - return (COSTS_N_INSNS (1) - + 4 * ((GET_CODE (SET_SRC (x)) == MEM) - + GET_CODE (SET_DEST (x)) == MEM)); - - case CONST_INT: - if (outer == SET) - { - if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256) - return 0; - if (thumb_shiftable_const (INTVAL (x))) - return COSTS_N_INSNS (2); - return COSTS_N_INSNS (3); - } - else if ((outer == PLUS || outer == COMPARE) - && INTVAL (x) < 256 && INTVAL (x) > -256) - return 0; - else if (outer == AND - && INTVAL (x) < 256 && INTVAL (x) >= -256) - return COSTS_N_INSNS (1); - else if (outer == ASHIFT || outer == ASHIFTRT - || outer == LSHIFTRT) - return 0; - return COSTS_N_INSNS (2); - - case CONST: - case CONST_DOUBLE: - case LABEL_REF: - case SYMBOL_REF: - return COSTS_N_INSNS (3); - - case UDIV: - case UMOD: - case DIV: - case MOD: - return 100; - - case TRUNCATE: - return 99; - - case AND: - case XOR: - case IOR: - /* XXX guess. */ - return 8; - - case ADDRESSOF: - case MEM: - /* XXX another guess. */ - /* Memory costs quite a lot for the first word, but subsequent words - load at the equivalent of a single insn each. */ - return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) - + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) - ? 4 : 0)); - - case IF_THEN_ELSE: - /* XXX a guess. */ - if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC) - return 14; - return 2; - - case ZERO_EXTEND: - /* XXX still guessing. */ - switch (GET_MODE (XEXP (x, 0))) - { - case QImode: - return (1 + (mode == DImode ? 4 : 0) - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - - case HImode: - return (4 + (mode == DImode ? 4 : 0) - + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - - case SImode: - return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0)); - - default: - return 99; - } - - default: - return 99; - } - } - switch (code) { case MEM: @@ -3275,7 +4420,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) case ASHIFT: case LSHIFTRT: case ASHIFTRT: if (mode == DImode) return (8 + (GET_CODE (XEXP (x, 1)) == CONST_INT ? 0 : 8) - + ((GET_CODE (XEXP (x, 0)) == REG + + ((GET_CODE (XEXP (x, 0)) == REG || (GET_CODE (XEXP (x, 0)) == SUBREG && GET_CODE (SUBREG_REG (XEXP (x, 0))) == REG)) ? 0 : 8)); @@ -3300,11 +4445,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) if (GET_MODE_CLASS (mode) == MODE_FLOAT) return (2 + ((REG_OR_SUBREG_REG (XEXP (x, 1)) || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 1)))) + && arm_const_double_rtx (XEXP (x, 1)))) ? 0 : 8) + ((REG_OR_SUBREG_REG (XEXP (x, 0)) || (GET_CODE (XEXP (x, 0)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 0)))) + && arm_const_double_rtx (XEXP (x, 0)))) ? 0 : 8)); if (((GET_CODE (XEXP (x, 0)) == CONST_INT @@ -3324,16 +4469,24 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 1; /* Fall through */ - case PLUS: + case PLUS: + if (GET_CODE (XEXP (x, 0)) == MULT) + { + extra_cost = rtx_cost (XEXP (x, 0), code); + if (!REG_OR_SUBREG_REG (XEXP (x, 1))) + extra_cost += 4 * ARM_NUM_REGS (mode); + return extra_cost; + } + if (GET_MODE_CLASS (mode) == MODE_FLOAT) return (2 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8) + ((REG_OR_SUBREG_REG (XEXP (x, 1)) || (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE - && const_double_rtx_ok_for_fpa (XEXP (x, 1)))) + && arm_const_double_rtx (XEXP (x, 1)))) ? 0 : 8)); /* Fall through */ - case AND: case XOR: case IOR: + case AND: case XOR: case IOR: extra_cost = 0; /* Normally the frame registers will be spilt into reg+const during @@ -3379,65 +4532,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 8; case MULT: - /* There is no point basing this on the tuning, since it is always the - fast variant if it exists at all. */ - if (arm_fast_multiply && mode == DImode - && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) - && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND - || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) - return 8; - - if (GET_MODE_CLASS (mode) == MODE_FLOAT - || mode == DImode) - return 30; - - if (GET_CODE (XEXP (x, 1)) == CONST_INT) - { - unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) - & (unsigned HOST_WIDE_INT) 0xffffffff); - int cost, const_ok = const_ok_for_arm (i); - int j, booth_unit_size; - - if (arm_tune_xscale) - { - unsigned HOST_WIDE_INT masked_const; - - /* The cost will be related to two insns. - First a load of the constant (MOV or LDR), then a multiply. */ - cost = 2; - if (! const_ok) - cost += 1; /* LDR is probably more expensive because - of longer result latency. */ - masked_const = i & 0xffff8000; - if (masked_const != 0 && masked_const != 0xffff8000) - { - masked_const = i & 0xf8000000; - if (masked_const == 0 || masked_const == 0xf8000000) - cost += 1; - else - cost += 2; - } - return cost; - } - - /* Tune as appropriate. */ - cost = const_ok ? 4 : 8; - booth_unit_size = ((tune_flags & FL_FAST_MULT) ? 8 : 2); - for (j = 0; i && j < 32; j += booth_unit_size) - { - i >>= booth_unit_size; - cost += 2; - } - - return cost; - } - - return (((tune_flags & FL_FAST_MULT) ? 8 : 30) - + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) - + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4)); + /* This should have been handled by the CPU specific routines. */ + gcc_unreachable (); case TRUNCATE: - if (arm_fast_multiply && mode == SImode + if (arm_arch3m && mode == SImode && GET_CODE (XEXP (x, 0)) == LSHIFTRT && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT && (GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) @@ -3495,48 +4594,527 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 1; default: - break; + gcc_unreachable (); } - abort (); + gcc_unreachable (); - case CONST_INT: - if (const_ok_for_arm (INTVAL (x))) - return outer == SET ? 2 : -1; - else if (outer == AND - && const_ok_for_arm (~INTVAL (x))) - return -1; - else if ((outer == COMPARE - || outer == PLUS || outer == MINUS) - && const_ok_for_arm (-INTVAL (x))) - return -1; - else + case CONST_INT: + if (const_ok_for_arm (INTVAL (x))) + return outer == SET ? 2 : -1; + else if (outer == AND + && const_ok_for_arm (~INTVAL (x))) + return -1; + else if ((outer == COMPARE + || outer == PLUS || outer == MINUS) + && const_ok_for_arm (-INTVAL (x))) + return -1; + else return 5; - - case CONST: - case LABEL_REF: - case SYMBOL_REF: + + case CONST: + case LABEL_REF: + case SYMBOL_REF: return 6; - - case CONST_DOUBLE: - if (const_double_rtx_ok_for_fpa (x)) - return outer == SET ? 2 : -1; - else if ((outer == COMPARE || outer == PLUS) - && neg_const_double_rtx_ok_for_fpa (x)) - return -1; + + case CONST_DOUBLE: + if (arm_const_double_rtx (x)) + return outer == SET ? 2 : -1; + else if ((outer == COMPARE || outer == PLUS) + && neg_const_double_rtx_ok_for_fpa (x)) + return -1; return 7; - + default: return 99; } } +/* RTX costs when optimizing for size. */ static bool -arm_rtx_costs (rtx x, int code, int outer_code, int *total) +arm_size_rtx_costs (rtx x, int code, int outer_code, int *total) { - *total = arm_rtx_costs_1 (x, code, outer_code); - return true; + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + /* XXX TBD. For now, use the standard costs. */ + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MEM: + /* A memory access costs 1 insn if the mode is small, or the address is + a single register, otherwise it costs one insn per word. */ + if (REG_P (XEXP (x, 0))) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + return true; + + case DIV: + case MOD: + case UDIV: + case UMOD: + /* Needs a libcall, so it costs about this. */ + *total = COSTS_N_INSNS (2); + return false; + + case ROTATE: + if (mode == SImode && GET_CODE (XEXP (x, 1)) == REG) + { + *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), code); + return true; + } + /* Fall through */ + case ROTATERT: + case ASHIFT: + case LSHIFTRT: + case ASHIFTRT: + if (mode == DImode && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + *total = COSTS_N_INSNS (3) + rtx_cost (XEXP (x, 0), code); + return true; + } + else if (mode == SImode) + { + *total = COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 0), code); + /* Slightly disparage register shifts, but not by much. */ + if (GET_CODE (XEXP (x, 1)) != CONST_INT) + *total += 1 + rtx_cost (XEXP (x, 1), code); + return true; + } + + /* Needs a libcall. */ + *total = COSTS_N_INSNS (2); + return false; + + case MINUS: + if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + { + *total = COSTS_N_INSNS (1); + return false; + } + + if (mode == SImode) + { + enum rtx_code subcode0 = GET_CODE (XEXP (x, 0)); + enum rtx_code subcode1 = GET_CODE (XEXP (x, 1)); + + if (subcode0 == ROTATE || subcode0 == ROTATERT || subcode0 == ASHIFT + || subcode0 == LSHIFTRT || subcode0 == ASHIFTRT + || subcode1 == ROTATE || subcode1 == ROTATERT + || subcode1 == ASHIFT || subcode1 == LSHIFTRT + || subcode1 == ASHIFTRT) + { + /* It's just the cost of the two operands. */ + *total = 0; + return false; + } + + *total = COSTS_N_INSNS (1); + return false; + } + + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + return false; + + case PLUS: + if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + { + *total = COSTS_N_INSNS (1); + return false; + } + + /* Fall through */ + case AND: case XOR: case IOR: + if (mode == SImode) + { + enum rtx_code subcode = GET_CODE (XEXP (x, 0)); + + if (subcode == ROTATE || subcode == ROTATERT || subcode == ASHIFT + || subcode == LSHIFTRT || subcode == ASHIFTRT + || (code == AND && subcode == NOT)) + { + /* It's just the cost of the two operands. */ + *total = 0; + return false; + } + } + + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + return false; + + case MULT: + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + return false; + + case NEG: + if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + *total = COSTS_N_INSNS (1); + /* Fall through */ + case NOT: + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + + return false; + + case IF_THEN_ELSE: + *total = 0; + return false; + + case COMPARE: + if (cc_register (XEXP (x, 0), VOIDmode)) + * total = 0; + else + *total = COSTS_N_INSNS (1); + return false; + + case ABS: + if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (1 + ARM_NUM_REGS (mode)); + return false; + + case SIGN_EXTEND: + *total = 0; + if (GET_MODE_SIZE (GET_MODE (XEXP (x, 0))) < 4) + { + if (!(arm_arch4 && MEM_P (XEXP (x, 0)))) + *total += COSTS_N_INSNS (arm_arch6 ? 1 : 2); + } + if (mode == DImode) + *total += COSTS_N_INSNS (1); + return false; + + case ZERO_EXTEND: + *total = 0; + if (!(arm_arch4 && MEM_P (XEXP (x, 0)))) + { + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + *total += COSTS_N_INSNS (1); + break; + + case HImode: + *total += COSTS_N_INSNS (arm_arch6 ? 1 : 2); + + case SImode: + break; + + default: + *total += COSTS_N_INSNS (2); + } + } + + if (mode == DImode) + *total += COSTS_N_INSNS (1); + + return false; + + case CONST_INT: + if (const_ok_for_arm (INTVAL (x))) + *total = COSTS_N_INSNS (outer_code == SET ? 1 : 0); + else if (const_ok_for_arm (~INTVAL (x))) + *total = COSTS_N_INSNS (outer_code == AND ? 0 : 1); + else if (const_ok_for_arm (-INTVAL (x))) + { + if (outer_code == COMPARE || outer_code == PLUS + || outer_code == MINUS) + *total = 0; + else + *total = COSTS_N_INSNS (1); + } + else + *total = COSTS_N_INSNS (2); + return true; + + case CONST: + case LABEL_REF: + case SYMBOL_REF: + *total = COSTS_N_INSNS (2); + return true; + + case CONST_DOUBLE: + *total = COSTS_N_INSNS (4); + return true; + + default: + if (mode != VOIDmode) + *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); + else + *total = COSTS_N_INSNS (4); /* How knows? */ + return false; + } } +/* RTX costs for cores with a slow MUL implementation. */ + +static bool +arm_slowmul_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + int j, booth_unit_size; + + /* Tune as appropriate. */ + cost = const_ok ? 4 : 8; + booth_unit_size = 2; + for (j = 0; i && j < 32; j += booth_unit_size) + { + i >>= booth_unit_size; + cost += 2; + } + + *total = cost; + return true; + } + + *total = 30 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} + + +/* RTX cost for cores with a fast multiply unit (M variants). */ + +static bool +arm_fastmul_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 8; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + int j, booth_unit_size; + + /* Tune as appropriate. */ + cost = const_ok ? 4 : 8; + booth_unit_size = 8; + for (j = 0; i && j < 32; j += booth_unit_size) + { + i >>= booth_unit_size; + cost += 2; + } + + *total = cost; + return true; + } + + *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} + + +/* RTX cost for XScale CPUs. */ + +static bool +arm_xscale_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + if (TARGET_THUMB) + { + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 8; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT + || mode == DImode) + { + *total = 30; + return true; + } + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1)) + & (unsigned HOST_WIDE_INT) 0xffffffff); + int cost, const_ok = const_ok_for_arm (i); + unsigned HOST_WIDE_INT masked_const; + + /* The cost will be related to two insns. + First a load of the constant (MOV or LDR), then a multiply. */ + cost = 2; + if (! const_ok) + cost += 1; /* LDR is probably more expensive because + of longer result latency. */ + masked_const = i & 0xffff8000; + if (masked_const != 0 && masked_const != 0xffff8000) + { + masked_const = i & 0xf8000000; + if (masked_const == 0 || masked_const == 0xf8000000) + cost += 1; + else + cost += 2; + } + *total = cost; + return true; + } + + *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4); + return true; + + case COMPARE: + /* A COMPARE of a MULT is slow on XScale; the muls instruction + will stall until the multiplication is complete. */ + if (GET_CODE (XEXP (x, 0)) == MULT) + *total = 4 + rtx_cost (XEXP (x, 0), code); + else + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} + + +/* RTX costs for 9e (and later) cores. */ + +static bool +arm_9e_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + int nonreg_cost; + int cost; + + if (TARGET_THUMB) + { + switch (code) + { + case MULT: + *total = COSTS_N_INSNS (3); + return true; + + default: + *total = thumb_rtx_costs (x, code, outer_code); + return true; + } + } + + switch (code) + { + case MULT: + /* There is no point basing this on the tuning, since it is always the + fast variant if it exists at all. */ + if (mode == DImode + && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1))) + && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND + || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND)) + { + *total = 3; + return true; + } + + + if (GET_MODE_CLASS (mode) == MODE_FLOAT) + { + *total = 30; + return true; + } + if (mode == DImode) + { + cost = 7; + nonreg_cost = 8; + } + else + { + cost = 2; + nonreg_cost = 4; + } + + + *total = cost + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : nonreg_cost) + + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : nonreg_cost); + return true; + + default: + *total = arm_rtx_costs_1 (x, code, outer_code); + return true; + } +} /* All address computations that can be done are free, but rtx cost returns the same for practically all of them. So we weight the different types of address here in the order (most pref first): @@ -3553,13 +5131,10 @@ arm_arm_address_cost (rtx x) if (c == PLUS || c == MINUS) { - char cl0 = GET_RTX_CLASS (GET_CODE (XEXP (x, 0))); - char cl1 = GET_RTX_CLASS (GET_CODE (XEXP (x, 1))); - if (GET_CODE (XEXP (x, 0)) == CONST_INT) return 2; - if (cl0 == '2' || cl0 == 'c' || cl1 == '2' || cl1 == 'c') + if (ARITHMETIC_P (XEXP (x, 0)) || ARITHMETIC_P (XEXP (x, 1))) return 3; return 4; @@ -3589,12 +5164,6 @@ arm_address_cost (rtx x) return TARGET_ARM ? arm_arm_address_cost (x) : arm_thumb_address_cost (x); } -static int -arm_use_dfa_pipeline_interface (void) -{ - return true; -} - static int arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) { @@ -3614,11 +5183,12 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) operand for INSN. If we have a shifted input operand and the instruction we depend on is another ALU instruction, then we may have to account for an additional stall. */ - if (shift_opnum != 0 && attr_type == TYPE_NORMAL) + if (shift_opnum != 0 + && (attr_type == TYPE_ALU_SHIFT || attr_type == TYPE_ALU_SHIFT_REG)) { rtx shifted_operand; int opno; - + /* Get the shifted operand. */ extract_insn (insn); shifted_operand = recog_data.operand[shift_opnum]; @@ -3659,9 +5229,9 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) rtx src_mem = XEXP (SET_SRC (i_pat), 0); /* This is a load after a store, there is no conflict if the load reads from a cached area. Assume that loads from the stack, and from the - constant pool are cached, and that others will miss. This is a + constant pool are cached, and that others will miss. This is a hack. */ - + if ((GET_CODE (src_mem) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (src_mem)) || reg_mentioned_p (stack_pointer_rtx, src_mem) || reg_mentioned_p (frame_pointer_rtx, src_mem) @@ -3672,47 +5242,51 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) return cost; } -static int fpa_consts_inited = 0; +static int fp_consts_inited = 0; -static const char * const strings_fpa[8] = +/* Only zero is valid for VFP. Other values are also valid for FPA. */ +static const char * const strings_fp[8] = { "0", "1", "2", "3", "4", "5", "0.5", "10" }; -static REAL_VALUE_TYPE values_fpa[8]; +static REAL_VALUE_TYPE values_fp[8]; static void -init_fpa_table (void) +init_fp_table (void) { int i; REAL_VALUE_TYPE r; - for (i = 0; i < 8; i++) - { - r = REAL_VALUE_ATOF (strings_fpa[i], DFmode); - values_fpa[i] = r; - } + if (TARGET_VFP) + fp_consts_inited = 1; + else + fp_consts_inited = 8; - fpa_consts_inited = 1; + for (i = 0; i < fp_consts_inited; i++) + { + r = REAL_VALUE_ATOF (strings_fp[i], DFmode); + values_fp[i] = r; + } } -/* Return TRUE if rtx X is a valid immediate FPA constant. */ +/* Return TRUE if rtx X is a valid immediate FP constant. */ int -const_double_rtx_ok_for_fpa (rtx x) +arm_const_double_rtx (rtx x) { REAL_VALUE_TYPE r; int i; - - if (!fpa_consts_inited) - init_fpa_table (); - + + if (!fp_consts_inited) + init_fp_table (); + REAL_VALUE_FROM_CONST_DOUBLE (r, x); if (REAL_VALUE_MINUS_ZERO (r)) return 0; - for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) + for (i = 0; i < fp_consts_inited; i++) + if (REAL_VALUES_EQUAL (r, values_fp[i])) return 1; return 0; @@ -3724,17 +5298,17 @@ neg_const_double_rtx_ok_for_fpa (rtx x) { REAL_VALUE_TYPE r; int i; - - if (!fpa_consts_inited) - init_fpa_table (); - + + if (!fp_consts_inited) + init_fp_table (); + REAL_VALUE_FROM_CONST_DOUBLE (r, x); r = REAL_VALUE_NEGATE (r); if (REAL_VALUE_MINUS_ZERO (r)) return 0; for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) + if (REAL_VALUES_EQUAL (r, values_fp[i])) return 1; return 0; @@ -3742,244 +5316,6 @@ neg_const_double_rtx_ok_for_fpa (rtx x) /* Predicates for `match_operand' and `match_operator'. */ -/* s_register_operand is the same as register_operand, but it doesn't accept - (SUBREG (MEM)...). - - This function exists because at the time it was put in it led to better - code. SUBREG(MEM) always needs a reload in the places where - s_register_operand is used, and this seemed to lead to excessive - reloading. */ -int -s_register_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - /* We don't consider registers whose class is NO_REGS - to be a register operand. */ - /* XXX might have to check for lo regs only for thumb ??? */ - return (GET_CODE (op) == REG - && (REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) != NO_REGS)); -} - -/* A hard register operand (even before reload. */ -int -arm_hard_register_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return 0; - - return (GET_CODE (op) == REG - && REGNO (op) < FIRST_PSEUDO_REGISTER); -} - -/* Only accept reg, subreg(reg), const_int. */ -int -reg_or_int_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return 1; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - /* We don't consider registers whose class is NO_REGS - to be a register operand. */ - return (GET_CODE (op) == REG - && (REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) != NO_REGS)); -} - -/* Return 1 if OP is an item in memory, given that we are in reload. */ -int -arm_reload_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int regno = true_regnum (op); - - return (!CONSTANT_P (op) - && (regno == -1 - || (GET_CODE (op) == REG - && REGNO (op) >= FIRST_PSEUDO_REGISTER))); -} - -/* Return 1 if OP is a valid memory address, but not valid for a signed byte - memory access (architecture V4). - MODE is QImode if called when computing constraints, or VOIDmode when - emitting patterns. In this latter case we cannot use memory_operand() - because it will fail on badly formed MEMs, which is precisely what we are - trying to catch. */ -int -bad_signed_byte_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != MEM) - return 0; - - op = XEXP (op, 0); - - /* A sum of anything more complex than reg + reg or reg + const is bad. */ - if ((GET_CODE (op) == PLUS || GET_CODE (op) == MINUS) - && (!s_register_operand (XEXP (op, 0), VOIDmode) - || (!s_register_operand (XEXP (op, 1), VOIDmode) - && GET_CODE (XEXP (op, 1)) != CONST_INT))) - return 1; - - /* Big constants are also bad. */ - if (GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT - && (INTVAL (XEXP (op, 1)) > 0xff - || -INTVAL (XEXP (op, 1)) > 0xff)) - return 1; - - /* Everything else is good, or can will automatically be made so. */ - return 0; -} - -/* Return TRUE for valid operands for the rhs of an ARM instruction. */ -int -arm_rhs_operand (rtx op, enum machine_mode mode) -{ - return (s_register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && const_ok_for_arm (INTVAL (op)))); -} - -/* Return TRUE for valid operands for the - rhs of an ARM instruction, or a load. */ -int -arm_rhsm_operand (rtx op, enum machine_mode mode) -{ - return (s_register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && const_ok_for_arm (INTVAL (op))) - || memory_operand (op, mode)); -} - -/* Return TRUE for valid operands for the rhs of an ARM instruction, or if a - constant that is valid when negated. */ -int -arm_add_operand (rtx op, enum machine_mode mode) -{ - if (TARGET_THUMB) - return thumb_cmp_operand (op, mode); - - return (s_register_operand (op, mode) - || (GET_CODE (op) == CONST_INT - && (const_ok_for_arm (INTVAL (op)) - || const_ok_for_arm (-INTVAL (op))))); -} - -/* Return TRUE for valid ARM constants (or when valid if negated). */ -int -arm_addimm_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && (const_ok_for_arm (INTVAL (op)) - || const_ok_for_arm (-INTVAL (op)))); -} - -int -arm_not_operand (rtx op, enum machine_mode mode) -{ - return (s_register_operand (op, mode) - || (GET_CODE (op) == CONST_INT - && (const_ok_for_arm (INTVAL (op)) - || const_ok_for_arm (~INTVAL (op))))); -} - -/* Return TRUE if the operand is a memory reference which contains an - offsettable address. */ -int -offsettable_memory_operand (rtx op, enum machine_mode mode) -{ - if (mode == VOIDmode) - mode = GET_MODE (op); - - return (mode == GET_MODE (op) - && GET_CODE (op) == MEM - && offsettable_address_p (reload_completed | reload_in_progress, - mode, XEXP (op, 0))); -} - -/* Return TRUE if the operand is a memory reference which is, or can be - made word aligned by adjusting the offset. */ -int -alignable_memory_operand (rtx op, enum machine_mode mode) -{ - rtx reg; - - if (mode == VOIDmode) - mode = GET_MODE (op); - - if (mode != GET_MODE (op) || GET_CODE (op) != MEM) - return 0; - - op = XEXP (op, 0); - - return ((GET_CODE (reg = op) == REG - || (GET_CODE (op) == SUBREG - && GET_CODE (reg = SUBREG_REG (op)) == REG) - || (GET_CODE (op) == PLUS - && GET_CODE (XEXP (op, 1)) == CONST_INT - && (GET_CODE (reg = XEXP (op, 0)) == REG - || (GET_CODE (XEXP (op, 0)) == SUBREG - && GET_CODE (reg = SUBREG_REG (XEXP (op, 0))) == REG)))) - && REGNO_POINTER_ALIGN (REGNO (reg)) >= 32); -} - -/* Similar to s_register_operand, but does not allow hard integer - registers. */ -int -f_register_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - /* We don't consider registers whose class is NO_REGS - to be a register operand. */ - return (GET_CODE (op) == REG - && (REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) == FPA_REGS)); -} - -/* Return TRUE for valid operands for the rhs of an FPA instruction. */ -int -fpa_rhs_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == CONST_DOUBLE) - return const_double_rtx_ok_for_fpa (op); - - return FALSE; -} - -int -fpa_add_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == CONST_DOUBLE) - return (const_double_rtx_ok_for_fpa (op) - || neg_const_double_rtx_ok_for_fpa (op)); - - return FALSE; -} - /* Return nonzero if OP is a valid Cirrus memory address pattern. */ int cirrus_memory_offset (rtx op) @@ -4017,43 +5353,70 @@ cirrus_memory_offset (rtx op) return 0; } -/* Return nonzero if OP is a Cirrus or general register. */ +/* Return TRUE if OP is a valid coprocessor memory address pattern. + WB if true if writeback address modes are allowed. */ + int -cirrus_register_operand (rtx op, enum machine_mode mode) +arm_coproc_mem_operand (rtx op, bool wb) { - if (GET_MODE (op) != mode && mode != VOIDmode) + rtx ind; + + /* Reject eliminable registers. */ + if (! (reload_in_progress || reload_completed) + && ( reg_mentioned_p (frame_pointer_rtx, op) + || reg_mentioned_p (arg_pointer_rtx, op) + || reg_mentioned_p (virtual_incoming_args_rtx, op) + || reg_mentioned_p (virtual_outgoing_args_rtx, op) + || reg_mentioned_p (virtual_stack_dynamic_rtx, op) + || reg_mentioned_p (virtual_stack_vars_rtx, op))) return FALSE; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - return (GET_CODE (op) == REG - && (REGNO_REG_CLASS (REGNO (op)) == CIRRUS_REGS - || REGNO_REG_CLASS (REGNO (op)) == GENERAL_REGS)); -} - -/* Return nonzero if OP is a cirrus FP register. */ -int -cirrus_fp_register (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) + /* Constants are converted into offsets from labels. */ + if (GET_CODE (op) != MEM) return FALSE; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); + ind = XEXP (op, 0); - return (GET_CODE (op) == REG - && (REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) == CIRRUS_REGS)); -} + if (reload_completed + && (GET_CODE (ind) == LABEL_REF + || (GET_CODE (ind) == CONST + && GET_CODE (XEXP (ind, 0)) == PLUS + && GET_CODE (XEXP (XEXP (ind, 0), 0)) == LABEL_REF + && GET_CODE (XEXP (XEXP (ind, 0), 1)) == CONST_INT))) + return TRUE; -/* Return nonzero if OP is a 6bit constant (0..63). */ -int -cirrus_shift_const (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) >= 0 - && INTVAL (op) < 64); + /* Match: (mem (reg)). */ + if (GET_CODE (ind) == REG) + return arm_address_register_rtx_p (ind, 0); + + /* Autoincremment addressing modes. */ + if (wb + && (GET_CODE (ind) == PRE_INC + || GET_CODE (ind) == POST_INC + || GET_CODE (ind) == PRE_DEC + || GET_CODE (ind) == POST_DEC)) + return arm_address_register_rtx_p (XEXP (ind, 0), 0); + + if (wb + && (GET_CODE (ind) == POST_MODIFY || GET_CODE (ind) == PRE_MODIFY) + && arm_address_register_rtx_p (XEXP (ind, 0), 0) + && GET_CODE (XEXP (ind, 1)) == PLUS + && rtx_equal_p (XEXP (XEXP (ind, 1), 0), XEXP (ind, 0))) + ind = XEXP (ind, 1); + + /* Match: + (plus (reg) + (const)). */ + if (GET_CODE (ind) == PLUS + && GET_CODE (XEXP (ind, 0)) == REG + && REG_MODE_OK_FOR_BASE_P (XEXP (ind, 0), VOIDmode) + && GET_CODE (XEXP (ind, 1)) == CONST_INT + && INTVAL (XEXP (ind, 1)) > -1024 + && INTVAL (XEXP (ind, 1)) < 1024 + && (INTVAL (XEXP (ind, 1)) & 3) == 0) + return TRUE; + + return FALSE; } /* Return true if X is a register that will be eliminated later on. */ @@ -4066,6 +5429,30 @@ arm_eliminable_register (rtx x) && REGNO (x) <= LAST_VIRTUAL_REGISTER)); } +/* Return GENERAL_REGS if a scratch register required to reload x to/from + coprocessor registers. Otherwise return NO_REGS. */ + +enum reg_class +coproc_secondary_reload_class (enum machine_mode mode, rtx x, bool wb) +{ + if (arm_coproc_mem_operand (x, wb) || s_register_operand (x, mode)) + return NO_REGS; + + return GENERAL_REGS; +} + +/* Values which must be returned in the most-significant end of the return + register. */ + +static bool +arm_return_in_msb (tree valtype) +{ + return (TARGET_AAPCS_BASED + && BYTES_BIG_ENDIAN + && (AGGREGATE_TYPE_P (valtype) + || TREE_CODE (valtype) == COMPLEX_TYPE)); +} + /* Returns TRUE if INSN is an "LDR REG, ADDR" instruction. Use by the Cirrus Maverick code which has to workaround a hardware bug triggered by such instructions. */ @@ -4107,7 +5494,7 @@ arm_cirrus_insn_p (rtx insn) { enum attr_cirrus attr; - /* get_attr aborts on USE and CLOBBER. */ + /* get_attr cannot accept USE or CLOBBER. */ if (!insn || GET_CODE (insn) != INSN || GET_CODE (PATTERN (insn)) == USE @@ -4179,10 +5566,11 @@ cirrus_reorg (rtx first) /* Get Arm register number for ldr insn. */ if (GET_CODE (lhs) == REG) arm_regno = REGNO (lhs); - else if (GET_CODE (rhs) == REG) - arm_regno = REGNO (rhs); else - abort (); + { + gcc_assert (GET_CODE (rhs) == REG); + arm_regno = REGNO (rhs); + } /* Next insn. */ first = next_nonnote_insn (first); @@ -4208,7 +5596,7 @@ cirrus_reorg (rtx first) } } - /* get_attr aborts on USE and CLOBBER. */ + /* get_attr cannot accept USE or CLOBBER. */ if (!first || GET_CODE (first) != INSN || GET_CODE (PATTERN (first)) == USE @@ -4238,262 +5626,6 @@ cirrus_reorg (rtx first) } } -/* Return nonzero if OP is a constant power of two. */ -int -power_of_two_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT) - { - HOST_WIDE_INT value = INTVAL (op); - - return value != 0 && (value & (value - 1)) == 0; - } - - return FALSE; -} - -/* Return TRUE for a valid operand of a DImode operation. - Either: REG, SUBREG, CONST_DOUBLE or MEM(DImode_address). - Note that this disallows MEM(REG+REG), but allows - MEM(PRE/POST_INC/DEC(REG)). */ -int -di_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - switch (GET_CODE (op)) - { - case CONST_DOUBLE: - case CONST_INT: - return TRUE; - - case MEM: - return memory_address_p (DImode, XEXP (op, 0)); - - default: - return FALSE; - } -} - -/* Like di_operand, but don't accept constants. */ -int -nonimmediate_di_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) == MEM) - return memory_address_p (DImode, XEXP (op, 0)); - - return FALSE; -} - -/* Return TRUE for a valid operand of a DFmode operation when -msoft-float. - Either: REG, SUBREG, CONST_DOUBLE or MEM(DImode_address). - Note that this disallows MEM(REG+REG), but allows - MEM(PRE/POST_INC/DEC(REG)). */ -int -soft_df_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != mode) - return FALSE; - - if (GET_CODE (op) == SUBREG && CONSTANT_P (SUBREG_REG (op))) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - switch (GET_CODE (op)) - { - case CONST_DOUBLE: - return TRUE; - - case MEM: - return memory_address_p (DFmode, XEXP (op, 0)); - - default: - return FALSE; - } -} - -/* Like soft_df_operand, but don't accept constants. */ -int -nonimmediate_soft_df_operand (rtx op, enum machine_mode mode) -{ - if (s_register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != mode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) == MEM) - return memory_address_p (DFmode, XEXP (op, 0)); - return FALSE; -} - -/* Return TRUE for valid index operands. */ -int -index_operand (rtx op, enum machine_mode mode) -{ - return (s_register_operand (op, mode) - || (immediate_operand (op, mode) - && (GET_CODE (op) != CONST_INT - || (INTVAL (op) < 4096 && INTVAL (op) > -4096)))); -} - -/* Return TRUE for valid shifts by a constant. This also accepts any - power of two on the (somewhat overly relaxed) assumption that the - shift operator in this case was a mult. */ -int -const_shift_operand (rtx op, enum machine_mode mode) -{ - return (power_of_two_operand (op, mode) - || (immediate_operand (op, mode) - && (GET_CODE (op) != CONST_INT - || (INTVAL (op) < 32 && INTVAL (op) > 0)))); -} - -/* Return TRUE for arithmetic operators which can be combined with a multiply - (shift). */ -int -shiftable_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code; - - if (GET_MODE (x) != mode) - return FALSE; - - code = GET_CODE (x); - - return (code == PLUS || code == MINUS - || code == IOR || code == XOR || code == AND); -} - -/* Return TRUE for binary logical operators. */ -int -logical_binary_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code; - - if (GET_MODE (x) != mode) - return FALSE; - - code = GET_CODE (x); - - return (code == IOR || code == XOR || code == AND); -} - -/* Return TRUE for shift operators. */ -int -shift_operator (rtx x,enum machine_mode mode) -{ - enum rtx_code code; - - if (GET_MODE (x) != mode) - return FALSE; - - code = GET_CODE (x); - - if (code == MULT) - return power_of_two_operand (XEXP (x, 1), mode); - - return (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT - || code == ROTATERT); -} - -/* Return TRUE if x is EQ or NE. */ -int -equality_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (x) == EQ || GET_CODE (x) == NE; -} - -/* Return TRUE if x is a comparison operator other than LTGT or UNEQ. */ -int -arm_comparison_operator (rtx x, enum machine_mode mode) -{ - return (comparison_operator (x, mode) - && GET_CODE (x) != LTGT - && GET_CODE (x) != UNEQ); -} - -/* Return TRUE for SMIN SMAX UMIN UMAX operators. */ -int -minmax_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (GET_MODE (x) != mode) - return FALSE; - - return code == SMIN || code == SMAX || code == UMIN || code == UMAX; -} - -/* Return TRUE if this is the condition code register, if we aren't given - a mode, accept any class CCmode register. */ -int -cc_register (rtx x, enum machine_mode mode) -{ - if (mode == VOIDmode) - { - mode = GET_MODE (x); - - if (GET_MODE_CLASS (mode) != MODE_CC) - return FALSE; - } - - if ( GET_MODE (x) == mode - && GET_CODE (x) == REG - && REGNO (x) == CC_REGNUM) - return TRUE; - - return FALSE; -} - -/* Return TRUE if this is the condition code register, if we aren't given - a mode, accept any class CCmode register which indicates a dominance - expression. */ -int -dominant_cc_register (rtx x, enum machine_mode mode) -{ - if (mode == VOIDmode) - { - mode = GET_MODE (x); - - if (GET_MODE_CLASS (mode) != MODE_CC) - return FALSE; - } - - if (mode != CC_DNEmode && mode != CC_DEQmode - && mode != CC_DLEmode && mode != CC_DLTmode - && mode != CC_DGEmode && mode != CC_DGTmode - && mode != CC_DLEUmode && mode != CC_DLTUmode - && mode != CC_DGEUmode && mode != CC_DGTUmode) - return FALSE; - - return cc_register (x, mode); -} - /* Return TRUE if X references a SYMBOL_REF. */ int symbol_mentioned_p (rtx x) @@ -4504,8 +5636,13 @@ symbol_mentioned_p (rtx x) if (GET_CODE (x) == SYMBOL_REF) return 1; + /* UNSPEC_TLS entries for a symbol include the SYMBOL_REF, but they + are constant offsets, not symbols. */ + if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) + return 0; + fmt = GET_RTX_FORMAT (GET_CODE (x)); - + for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) { if (fmt[i] == 'E') @@ -4533,6 +5670,11 @@ label_mentioned_p (rtx x) if (GET_CODE (x) == LABEL_REF) return 1; + /* UNSPEC_TLS entries for a symbol include a LABEL_REF for the referencing + instruction, but they are constant offsets, not symbols. */ + if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) + return 0; + fmt = GET_RTX_FORMAT (GET_CODE (x)); for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) { @@ -4551,27 +5693,76 @@ label_mentioned_p (rtx x) return 0; } +int +tls_mentioned_p (rtx x) +{ + switch (GET_CODE (x)) + { + case CONST: + return tls_mentioned_p (XEXP (x, 0)); + + case UNSPEC: + if (XINT (x, 1) == UNSPEC_TLS) + return 1; + + default: + return 0; + } +} + +/* Must not copy a SET whose source operand is PC-relative. */ + +static bool +arm_cannot_copy_insn_p (rtx insn) +{ + rtx pat = PATTERN (insn); + + if (GET_CODE (pat) == PARALLEL + && GET_CODE (XVECEXP (pat, 0, 0)) == SET) + { + rtx rhs = SET_SRC (XVECEXP (pat, 0, 0)); + + if (GET_CODE (rhs) == UNSPEC + && XINT (rhs, 1) == UNSPEC_PIC_BASE) + return TRUE; + + if (GET_CODE (rhs) == MEM + && GET_CODE (XEXP (rhs, 0)) == UNSPEC + && XINT (XEXP (rhs, 0), 1) == UNSPEC_PIC_BASE) + return TRUE; + } + + return FALSE; +} + enum rtx_code minmax_code (rtx x) { enum rtx_code code = GET_CODE (x); - if (code == SMAX) - return GE; - else if (code == SMIN) - return LE; - else if (code == UMIN) - return LEU; - else if (code == UMAX) - return GEU; - - abort (); + switch (code) + { + case SMAX: + return GE; + case SMIN: + return LE; + case UMIN: + return LEU; + case UMAX: + return GEU; + default: + gcc_unreachable (); + } } /* Return 1 if memory locations are adjacent. */ int adjacent_mem_locations (rtx a, rtx b) { + /* We don't guarantee to preserve the order of these memory refs. */ + if (volatile_refs_p (a) || volatile_refs_p (b)) + return 0; + if ((GET_CODE (XEXP (a, 0)) == REG || (GET_CODE (XEXP (a, 0)) == PLUS && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT)) @@ -4611,6 +5802,17 @@ adjacent_mem_locations (rtx a, rtx b) return 0; val_diff = val1 - val0; + + if (arm_ld_sched) + { + /* If the target has load delay slots, then there's no benefit + to using an ldm instruction unless the offset is zero and + we are optimizing for size. */ + return (optimize_size && (REGNO (reg0) == REGNO (reg1)) + && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4) + && (val_diff == 4 || val_diff == -4)); + } + return ((REGNO (reg0) == REGNO (reg1)) && (val_diff == 4 || val_diff == -4)); } @@ -4618,124 +5820,6 @@ adjacent_mem_locations (rtx a, rtx b) return 0; } -/* Return 1 if OP is a load multiple operation. It is known to be - parallel and the first section will be tested. */ -int -load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT count = XVECLEN (op, 0); - int dest_regno; - rtx src_addr; - HOST_WIDE_INT i = 1, base = 0; - rtx elt; - - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET) - return 0; - - /* Check to see if this might be a write-back. */ - if (GET_CODE (SET_SRC (elt = XVECEXP (op, 0, 0))) == PLUS) - { - i++; - base = 1; - - /* Now check it more carefully. */ - if (GET_CODE (SET_DEST (elt)) != REG - || GET_CODE (XEXP (SET_SRC (elt), 0)) != REG - || GET_CODE (XEXP (SET_SRC (elt), 1)) != CONST_INT - || INTVAL (XEXP (SET_SRC (elt), 1)) != (count - 1) * 4) - return 0; - } - - /* Perform a quick check so we don't blow up below. */ - if (count <= i - || GET_CODE (XVECEXP (op, 0, i - 1)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, i - 1))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, i - 1))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, i - 1))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, i - 1)), 0); - - for (; i < count; i++) - { - elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != SImode - || REGNO (SET_DEST (elt)) != (unsigned int)(dest_regno + i - base) - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != SImode - || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS - || !rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) - || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != (i - base) * 4) - return 0; - } - - return 1; -} - -/* Return 1 if OP is a store multiple operation. It is known to be - parallel and the first section will be tested. */ -int -store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT count = XVECLEN (op, 0); - int src_regno; - rtx dest_addr; - HOST_WIDE_INT i = 1, base = 0; - rtx elt; - - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET) - return 0; - - /* Check to see if this might be a write-back. */ - if (GET_CODE (SET_SRC (elt = XVECEXP (op, 0, 0))) == PLUS) - { - i++; - base = 1; - - /* Now check it more carefully. */ - if (GET_CODE (SET_DEST (elt)) != REG - || GET_CODE (XEXP (SET_SRC (elt), 0)) != REG - || GET_CODE (XEXP (SET_SRC (elt), 1)) != CONST_INT - || INTVAL (XEXP (SET_SRC (elt), 1)) != (count - 1) * 4) - return 0; - } - - /* Perform a quick check so we don't blow up below. */ - if (count <= i - || GET_CODE (XVECEXP (op, 0, i - 1)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, i - 1))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, i - 1))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, i - 1))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, i - 1)), 0); - - for (; i < count; i++) - { - elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != SImode - || REGNO (SET_SRC (elt)) != (unsigned int)(src_regno + i - base) - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != SImode - || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS - || !rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) - || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != (i - base) * 4) - return 0; - } - - return 1; -} - int load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, HOST_WIDE_INT *load_offset) @@ -4748,11 +5832,10 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, /* Can only handle 2, 3, or 4 insns at present, though could be easily extended if required. */ - if (nops < 2 || nops > 4) - abort (); + gcc_assert (nops >= 2 && nops <= 4); /* Loop over the operands and check that the memory references are - suitable (ie immediate offsets from the same base register). At + suitable (i.e. immediate offsets from the same base register). At the same time, extract the target register, and the memory offsets. */ for (i = 0; i < nops; i++) @@ -4764,8 +5847,7 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, if (GET_CODE (operands[nops + i]) == SUBREG) operands[nops + i] = alter_subreg (operands + (nops + i)); - if (GET_CODE (operands[nops + i]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[nops + i]) == MEM); /* Don't reorder volatile memory references; it doesn't seem worth looking for the case where the order is ok anyway. */ @@ -4793,7 +5875,7 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, : REGNO (SUBREG_REG (operands[i]))); order[0] = 0; } - else + else { if (base_reg != (int) REGNO (reg)) /* Not addressed from the same base register. */ @@ -4879,15 +5961,15 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, scratch register (one of the result regs) and then doing a load multiple actually becomes slower (and no smaller in code size). That is the transformation - + ldr rd1, [rbase + offset] ldr rd2, [rbase + offset + 4] - + to - + add rd1, rbase, offset ldmia rd1, {rd1, rd2} - + produces worse code -- '3 cycles + any stalls on rd2' instead of '2 cycles + any stalls on rd2'. On ARMs with only one cache access per cycle, the first sequence could never complete in less @@ -4903,7 +5985,7 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, /* Can't do it without setting up the offset, only do this if it takes no more than one insn. */ - return (const_ok_for_arm (unsorted_offsets[order[0]]) + return (const_ok_for_arm (unsorted_offsets[order[0]]) || const_ok_for_arm (-unsorted_offsets[order[0]])) ? 5 : 0; } @@ -4949,10 +6031,10 @@ emit_ldm_seq (rtx *operands, int nops) break; default: - abort (); + gcc_unreachable (); } - sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, + sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, reg_names[base_reg], REGISTER_PREFIX, reg_names[regs[0]]); for (i = 1; i < nops; i++) @@ -4977,11 +6059,10 @@ store_multiple_sequence (rtx *operands, int nops, int *regs, int *base, /* Can only handle 2, 3, or 4 insns at present, though could be easily extended if required. */ - if (nops < 2 || nops > 4) - abort (); + gcc_assert (nops >= 2 && nops <= 4); /* Loop over the operands and check that the memory references are - suitable (ie immediate offsets from the same base register). At + suitable (i.e. immediate offsets from the same base register). At the same time, extract the target register, and the memory offsets. */ for (i = 0; i < nops; i++) @@ -4993,8 +6074,7 @@ store_multiple_sequence (rtx *operands, int nops, int *regs, int *base, if (GET_CODE (operands[nops + i]) == SUBREG) operands[nops + i] = alter_subreg (operands + (nops + i)); - if (GET_CODE (operands[nops + i]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[nops + i]) == MEM); /* Don't reorder volatile memory references; it doesn't seem worth looking for the case where the order is ok anyway. */ @@ -5022,7 +6102,7 @@ store_multiple_sequence (rtx *operands, int nops, int *regs, int *base, : REGNO (SUBREG_REG (operands[i]))); order[0] = 0; } - else + else { if (base_reg != (int) REGNO (reg)) /* Not addressed from the same base register. */ @@ -5126,10 +6206,10 @@ emit_stm_seq (rtx *operands, int nops) break; default: - abort (); + gcc_unreachable (); } - sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, + sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, reg_names[base_reg], REGISTER_PREFIX, reg_names[regs[0]]); for (i = 1; i < nops; i++) @@ -5141,18 +6221,6 @@ emit_stm_seq (rtx *operands, int nops) output_asm_insn (buf, operands); return ""; } - -int -multi_register_push (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != PARALLEL - || (GET_CODE (XVECEXP (op, 0, 0)) != SET) - || (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC) - || (XINT (SET_SRC (XVECEXP (op, 0, 0)), 1) != UNSPEC_PUSH_MULT)) - return 0; - - return 1; -} /* Routines for use in generating RTL. */ @@ -5167,7 +6235,7 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, rtx mem, addr; /* XScale has load-store double instructions, but they have stricter - alignment requirements than load-store multiple, so we can not + alignment requirements than load-store multiple, so we cannot use them. For XScale ldm requires 2 + NREGS cycles to complete and blocks @@ -5197,9 +6265,9 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, if (arm_tune_xscale && count <= 2 && ! optimize_size) { rtx seq; - + start_sequence (); - + for (i = 0; i < count; i++) { addr = plus_constant (from, i * 4 * sign); @@ -5216,7 +6284,7 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, seq = get_insns (); end_sequence (); - + return seq; } @@ -5225,8 +6293,7 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, if (write_back) { XVECEXP (result, 0, 0) - = gen_rtx_SET (GET_MODE (from), from, - plus_constant (from, count * 4 * sign)); + = gen_rtx_SET (VOIDmode, from, plus_constant (from, count * 4 * sign)); i = 1; count++; } @@ -5261,9 +6328,9 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, if (arm_tune_xscale && count <= 2 && ! optimize_size) { rtx seq; - + start_sequence (); - + for (i = 0; i < count; i++) { addr = plus_constant (to, i * 4 * sign); @@ -5280,7 +6347,7 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, seq = get_insns (); end_sequence (); - + return seq; } @@ -5289,7 +6356,7 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, if (write_back) { XVECEXP (result, 0, 0) - = gen_rtx_SET (GET_MODE (to), to, + = gen_rtx_SET (VOIDmode, to, plus_constant (to, count * 4 * sign)); i = 1; count++; @@ -5311,7 +6378,7 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, } int -arm_gen_movstrqi (rtx *operands) +arm_gen_movmemqi (rtx *operands) { HOST_WIDE_INT in_words_to_go, out_words_to_go, last_bytes; HOST_WIDE_INT srcoffset, dstoffset; @@ -5328,7 +6395,7 @@ arm_gen_movstrqi (rtx *operands) dstbase = operands[0]; srcbase = operands[1]; - + dst = copy_to_mode_reg (SImode, XEXP (dstbase, 0)); src = copy_to_mode_reg (SImode, XEXP (srcbase, 0)); @@ -5336,7 +6403,7 @@ arm_gen_movstrqi (rtx *operands) out_words_to_go = INTVAL (operands[2]) / 4; last_bytes = INTVAL (operands[2]) & 3; dstoffset = srcoffset = 0; - + if (out_words_to_go != in_words_to_go && ((in_words_to_go - 1) & 3) != 0) part_bytes_reg = gen_rtx_REG (SImode, (in_words_to_go - 1) & 3); @@ -5346,7 +6413,7 @@ arm_gen_movstrqi (rtx *operands) emit_insn (arm_gen_load_multiple (0, 4, src, TRUE, TRUE, srcbase, &srcoffset)); else - emit_insn (arm_gen_load_multiple (0, in_words_to_go, src, TRUE, + emit_insn (arm_gen_load_multiple (0, in_words_to_go, src, TRUE, FALSE, srcbase, &srcoffset)); if (out_words_to_go) @@ -5354,10 +6421,9 @@ arm_gen_movstrqi (rtx *operands) if (out_words_to_go > 4) emit_insn (arm_gen_store_multiple (0, 4, dst, TRUE, TRUE, dstbase, &dstoffset)); - else if (out_words_to_go != 1) emit_insn (arm_gen_store_multiple (0, out_words_to_go, - dst, TRUE, + dst, TRUE, (last_bytes == 0 ? FALSE : TRUE), dstbase, &dstoffset)); @@ -5388,22 +6454,19 @@ arm_gen_movstrqi (rtx *operands) mem = adjust_automodify_address (dstbase, SImode, dst, dstoffset); emit_move_insn (mem, sreg); in_words_to_go--; - - if (in_words_to_go) /* Sanity check */ - abort (); + + gcc_assert (!in_words_to_go); /* Sanity check */ } if (in_words_to_go) { - if (in_words_to_go < 0) - abort (); + gcc_assert (in_words_to_go > 0); mem = adjust_automodify_address (srcbase, SImode, src, srcoffset); part_bytes_reg = copy_to_mode_reg (SImode, mem); } - if (last_bytes && part_bytes_reg == NULL) - abort (); + gcc_assert (!last_bytes || part_bytes_reg); if (BYTES_BIG_ENDIAN && last_bytes) { @@ -5413,7 +6476,7 @@ arm_gen_movstrqi (rtx *operands) emit_insn (gen_lshrsi3 (tmp, part_bytes_reg, GEN_INT (8 * (4 - last_bytes)))); part_bytes_reg = tmp; - + while (last_bytes) { mem = adjust_automodify_address (dstbase, QImode, @@ -5428,7 +6491,7 @@ arm_gen_movstrqi (rtx *operands) part_bytes_reg = tmp; } } - + } else { @@ -5440,14 +6503,13 @@ arm_gen_movstrqi (rtx *operands) if (last_bytes) { rtx tmp = gen_reg_rtx (SImode); - - emit_insn (gen_addsi3 (dst, dst, GEN_INT (2))); + emit_insn (gen_addsi3 (dst, dst, const2_rtx)); emit_insn (gen_lshrsi3 (tmp, part_bytes_reg, GEN_INT (16))); part_bytes_reg = tmp; dstoffset += 2; } } - + if (last_bytes) { mem = adjust_automodify_address (dstbase, QImode, dst, dstoffset); @@ -5458,42 +6520,13 @@ arm_gen_movstrqi (rtx *operands) return 1; } -/* Generate a memory reference for a half word, such that it will be loaded - into the top 16 bits of the word. We can assume that the address is - known to be alignable and of the form reg, or plus (reg, const). */ - -rtx -arm_gen_rotated_half_load (rtx memref) -{ - HOST_WIDE_INT offset = 0; - rtx base = XEXP (memref, 0); - - if (GET_CODE (base) == PLUS) - { - offset = INTVAL (XEXP (base, 1)); - base = XEXP (base, 0); - } - - /* If we aren't allowed to generate unaligned addresses, then fail. */ - if (TARGET_MMU_TRAPS - && ((BYTES_BIG_ENDIAN ? 1 : 0) ^ ((offset & 2) == 0))) - return NULL; - - base = gen_rtx_MEM (SImode, plus_constant (base, offset & ~2)); - - if ((BYTES_BIG_ENDIAN ? 1 : 0) ^ ((offset & 2) == 2)) - return base; - - return gen_rtx_ROTATE (SImode, base, GEN_INT (16)); -} - /* Select a dominance comparison mode if possible for a test of the general form (OP (COND_OR (X) (Y)) (const_int 0)). We support three forms. - COND_OR == DOM_CC_X_AND_Y => (X && Y) + COND_OR == DOM_CC_X_AND_Y => (X && Y) COND_OR == DOM_CC_NX_OR_Y => ((! X) || Y) - COND_OR == DOM_CC_X_OR_Y => (X || Y) + COND_OR == DOM_CC_X_OR_Y => (X || Y) In all cases OP will be either EQ or NE, but we don't need to know which - here. If we are unable to support a dominance comparison we return + here. If we are unable to support a dominance comparison we return CC mode. This will then fail to match for the RTL expressions that generate this call. */ enum machine_mode @@ -5519,7 +6552,7 @@ arm_select_dominance_cc_mode (rtx x, rtx y, HOST_WIDE_INT cond_or) /* If the comparisons are not equal, and one doesn't dominate the other, then we can't do this. */ - if (cond1 != cond2 + if (cond1 != cond2 && !comparison_dominates_p (cond1, cond2) && (swapped = 1, !comparison_dominates_p (cond2, cond1))) return CCmode; @@ -5534,78 +6567,108 @@ arm_select_dominance_cc_mode (rtx x, rtx y, HOST_WIDE_INT cond_or) switch (cond1) { case EQ: - if (cond2 == EQ || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DEQmode; switch (cond2) { + case EQ: return CC_DEQmode; case LE: return CC_DLEmode; case LEU: return CC_DLEUmode; case GE: return CC_DGEmode; case GEU: return CC_DGEUmode; - default: break; + default: gcc_unreachable (); } - break; - case LT: - if (cond2 == LT || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DLTmode; - if (cond2 == LE) - return CC_DLEmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case LT: + return CC_DLTmode; + case LE: + return CC_DLEmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } case GT: - if (cond2 == GT || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DGTmode; - if (cond2 == GE) - return CC_DGEmode; - if (cond2 == NE) - return CC_DNEmode; - break; - + + switch (cond2) + { + case GT: + return CC_DGTmode; + case GE: + return CC_DGEmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } + case LTU: - if (cond2 == LTU || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DLTUmode; - if (cond2 == LEU) - return CC_DLEUmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case LTU: + return CC_DLTUmode; + case LEU: + return CC_DLEUmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } case GTU: - if (cond2 == GTU || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DGTUmode; - if (cond2 == GEU) - return CC_DGEUmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case GTU: + return CC_DGTUmode; + case GEU: + return CC_DGEUmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } /* The remaining cases only occur when both comparisons are the same. */ case NE: + gcc_assert (cond1 == cond2); return CC_DNEmode; case LE: + gcc_assert (cond1 == cond2); return CC_DLEmode; case GE: + gcc_assert (cond1 == cond2); return CC_DGEmode; case LEU: + gcc_assert (cond1 == cond2); return CC_DLEUmode; case GEU: + gcc_assert (cond1 == cond2); return CC_DGEUmode; default: - break; + gcc_unreachable (); } - - abort (); } enum machine_mode @@ -5633,15 +6696,15 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) case LE: case GT: case GE: - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) return CCFPmode; return CCFPEmode; default: - abort (); + gcc_unreachable (); } } - + /* A compare with a shifted operand. Because of canonicalization, the comparison will have to be swapped when we emit the assembler. */ if (GET_MODE (y) == SImode && GET_CODE (y) == REG @@ -5650,7 +6713,14 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) || GET_CODE (x) == ROTATERT)) return CC_SWPmode; - /* This is a special case that is used by combine to allow a + /* This operation is performed swapped, but since we only rely on the Z + flag we don't need an additional mode. */ + if (GET_MODE (y) == SImode && REG_P (y) + && GET_CODE (x) == NEG + && (op == EQ || op == NE)) + return CC_Zmode; + + /* This is a special case that is used by combine to allow a comparison of a shifted byte load to be split into a zero-extend followed by a comparison of the shifted integer (only valid for equalities and unsigned inequalities). */ @@ -5672,21 +6742,21 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) if (GET_CODE (x) == IF_THEN_ELSE && (XEXP (x, 2) == const0_rtx || XEXP (x, 2) == const1_rtx) - && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' - && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<') - return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1), + && COMPARISON_P (XEXP (x, 0)) + && COMPARISON_P (XEXP (x, 1))) + return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1), INTVAL (XEXP (x, 2))); /* Alternate canonicalizations of the above. These are somewhat cleaner. */ if (GET_CODE (x) == AND - && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' - && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<') + && COMPARISON_P (XEXP (x, 0)) + && COMPARISON_P (XEXP (x, 1))) return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1), DOM_CC_X_AND_Y); if (GET_CODE (x) == IOR - && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<' - && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<') + && COMPARISON_P (XEXP (x, 0)) + && COMPARISON_P (XEXP (x, 1))) return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1), DOM_CC_X_OR_Y); @@ -5696,7 +6766,8 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) if (TARGET_THUMB && GET_MODE (x) == SImode && (op == EQ || op == NE) - && (GET_CODE (x) == ZERO_EXTRACT)) + && GET_CODE (x) == ZERO_EXTRACT + && XEXP (x, 1) == const1_rtx) return CC_Nmode; /* An operation that sets the condition codes as a side-effect, the @@ -5736,8 +6807,7 @@ arm_gen_compare_reg (enum rtx_code code, rtx x, rtx y) enum machine_mode mode = SELECT_CC_MODE (code, x, y); rtx cc_reg = gen_rtx_REG (mode, CC_REGNUM); - emit_insn (gen_rtx_SET (VOIDmode, cc_reg, - gen_rtx_COMPARE (mode, x, y))); + emit_set_insn (cc_reg, gen_rtx_COMPARE (mode, x, y)); return cc_reg; } @@ -5791,7 +6861,7 @@ arm_reload_in_hi (rtx *operands) { rtx base_plus = gen_rtx_REG (SImode, REGNO (operands[2]) + 1); - emit_insn (gen_rtx_SET (VOIDmode, base_plus, base)); + emit_set_insn (base_plus, base); base = base_plus; } else if (GET_CODE (base) == PLUS) @@ -5818,8 +6888,7 @@ arm_reload_in_hi (rtx *operands) ^ (HOST_WIDE_INT) 0x80000000) - (HOST_WIDE_INT) 0x80000000); - if (hi + lo != offset) - abort (); + gcc_assert (hi + lo == offset); if (hi != 0) { @@ -5846,24 +6915,23 @@ arm_reload_in_hi (rtx *operands) plus_constant (base, offset)))); emit_insn (gen_zero_extendqisi2 (gen_rtx_SUBREG (SImode, operands[0], 0), - gen_rtx_MEM (QImode, + gen_rtx_MEM (QImode, plus_constant (base, offset + 1)))); if (!BYTES_BIG_ENDIAN) - emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_SUBREG (SImode, operands[0], 0), - gen_rtx_IOR (SImode, - gen_rtx_ASHIFT - (SImode, - gen_rtx_SUBREG (SImode, operands[0], 0), - GEN_INT (8)), - scratch))); + emit_set_insn (gen_rtx_SUBREG (SImode, operands[0], 0), + gen_rtx_IOR (SImode, + gen_rtx_ASHIFT + (SImode, + gen_rtx_SUBREG (SImode, operands[0], 0), + GEN_INT (8)), + scratch)); else - emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_SUBREG (SImode, operands[0], 0), - gen_rtx_IOR (SImode, - gen_rtx_ASHIFT (SImode, scratch, - GEN_INT (8)), - gen_rtx_SUBREG (SImode, operands[0], - 0)))); + emit_set_insn (gen_rtx_SUBREG (SImode, operands[0], 0), + gen_rtx_IOR (SImode, + gen_rtx_ASHIFT (SImode, scratch, + GEN_INT (8)), + gen_rtx_SUBREG (SImode, operands[0], 0))); } /* Handle storing a half-word to memory during reload by synthesizing as two @@ -5938,7 +7006,7 @@ arm_reload_out_hi (rtx *operands) } } - emit_insn (gen_rtx_SET (VOIDmode, base_plus, base)); + emit_set_insn (base_plus, base); base = base_plus; } else if (GET_CODE (base) == PLUS) @@ -5965,8 +7033,7 @@ arm_reload_out_hi (rtx *operands) ^ (HOST_WIDE_INT) 0x80000000) - (HOST_WIDE_INT) 0x80000000); - if (hi + lo != offset) - abort (); + gcc_assert (hi + lo == offset); if (hi != 0) { @@ -6008,7 +7075,7 @@ arm_reload_out_hi (rtx *operands) if (BYTES_BIG_ENDIAN) { - emit_insn (gen_movqi (gen_rtx_MEM (QImode, + emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (base, offset + 1)), gen_lowpart (QImode, outval))); emit_insn (gen_lshrsi3 (scratch, @@ -6029,6 +7096,60 @@ arm_reload_out_hi (rtx *operands) gen_lowpart (QImode, scratch))); } } + +/* Return true if a type must be passed in memory. For AAPCS, small aggregates + (padded to the size of a word) should be passed in a register. */ + +static bool +arm_must_pass_in_stack (enum machine_mode mode, tree type) +{ + if (TARGET_AAPCS_BASED) + return must_pass_in_stack_var_size (mode, type); + else + return must_pass_in_stack_var_size_or_pad (mode, type); +} + + +/* For use by FUNCTION_ARG_PADDING (MODE, TYPE). + Return true if an argument passed on the stack should be padded upwards, + i.e. if the least-significant byte has useful data. + For legacy APCS ABIs we use the default. For AAPCS based ABIs small + aggregate types are placed in the lowest memory address. */ + +bool +arm_pad_arg_upward (enum machine_mode mode, tree type) +{ + if (!TARGET_AAPCS_BASED) + return DEFAULT_FUNCTION_ARG_PADDING(mode, type) == upward; + + if (type && BYTES_BIG_ENDIAN && INTEGRAL_TYPE_P (type)) + return false; + + return true; +} + + +/* Similarly, for use by BLOCK_REG_PADDING (MODE, TYPE, FIRST). + For non-AAPCS, return !BYTES_BIG_ENDIAN if the least significant + byte of the register has useful data, and return the opposite if the + most significant byte does. + For AAPCS, small aggregates and small complex types are always padded + upwards. */ + +bool +arm_pad_reg_upward (enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, int first ATTRIBUTE_UNUSED) +{ + if (TARGET_AAPCS_BASED + && BYTES_BIG_ENDIAN + && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE) + && int_size_in_bytes (type) <= 4) + return true; + + /* Otherwise, use default padding. */ + return !BYTES_BIG_ENDIAN; +} + /* Print a symbolic form of X to the debug file, F. */ static void @@ -6205,6 +7326,7 @@ struct minipool_fixup static Mnode * minipool_vector_head; static Mnode * minipool_vector_tail; static rtx minipool_vector_label; +static int minipool_pad; /* The linked list of all minipool fixes required for this function. */ Mfix * minipool_fix_head; @@ -6218,7 +7340,7 @@ static rtx is_jump_table (rtx insn) { rtx table; - + if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn) != NULL && ((table = next_real_insn (JUMP_LABEL (insn))) @@ -6241,11 +7363,7 @@ get_jump_table_size (rtx insn) { /* ADDR_VECs only take room if read-only data does into the text section. */ - if (JUMP_TABLES_IN_TEXT_SECTION -#if !defined(READONLY_DATA_SECTION) && !defined(READONLY_DATA_SECTION_ASM_OP) - || 1 -#endif - ) + if (JUMP_TABLES_IN_TEXT_SECTION || readonly_data_section == text_section) { rtx body = PATTERN (insn); int elt = GET_CODE (body) == ADDR_DIFF_VEC ? 1 : 0; @@ -6263,10 +7381,8 @@ static Mnode * move_minipool_fix_forward_ref (Mnode *mp, Mnode *max_mp, HOST_WIDE_INT max_address) { - /* This should never be true and the code below assumes these are - different. */ - if (mp == max_mp) - abort (); + /* The code below assumes these are different. */ + gcc_assert (mp != max_mp); if (max_mp == NULL) { @@ -6292,7 +7408,7 @@ move_minipool_fix_forward_ref (Mnode *mp, Mnode *max_mp, mp->next = max_mp; mp->prev = max_mp->prev; max_mp->prev = mp; - + if (mp->prev != NULL) mp->prev->next = mp; else @@ -6322,16 +7438,16 @@ add_minipool_forward_ref (Mfix *fix) /* If set, max_mp is the first pool_entry that has a lower constraint than the one we are trying to add. */ Mnode * max_mp = NULL; - HOST_WIDE_INT max_address = fix->address + fix->forwards; + HOST_WIDE_INT max_address = fix->address + fix->forwards - minipool_pad; Mnode * mp; - - /* If this fix's address is greater than the address of the first - entry, then we can't put the fix in this pool. We subtract the - size of the current fix to ensure that if the table is fully - packed we still have enough room to insert this value by suffling - the other fixes forwards. */ + + /* If the minipool starts before the end of FIX->INSN then this FIX + can not be placed into the current pool. Furthermore, adding the + new constant pool entry may cause the pool to start FIX_SIZE bytes + earlier. */ if (minipool_vector_head && - fix->address >= minipool_vector_head->max_address - fix->fix_size) + (fix->address + get_attr_length (fix->insn) + >= minipool_vector_head->max_address - fix->fix_size)) return NULL; /* Scan the pool to see if a constant with the same value has @@ -6361,7 +7477,7 @@ add_minipool_forward_ref (Mfix *fix) we have not already found an insertion point, then make sure that all such 8-byte aligned quantities are placed at the start of the pool. */ - if (TARGET_REALLY_IWMMXT + if (ARM_DOUBLEWORD_ALIGN && max_mp == NULL && fix->fix_size == 8 && mp->fix_size != 8) @@ -6377,7 +7493,7 @@ add_minipool_forward_ref (Mfix *fix) any existing entry. Otherwise, we insert the new fix before MAX_MP and, if necessary, adjust the constraints on the other entries. */ - mp = xmalloc (sizeof (* mp)); + mp = XNEW (Mnode); mp->fix_size = fix->fix_size; mp->mode = fix->mode; mp->value = fix->value; @@ -6438,10 +7554,8 @@ move_minipool_fix_backward_ref (Mnode *mp, Mnode *min_mp, { HOST_WIDE_INT offset; - /* This should never be true, and the code below assumes these are - different. */ - if (mp == min_mp) - abort (); + /* The code below assumes these are different. */ + gcc_assert (mp != min_mp); if (min_mp == NULL) { @@ -6485,10 +7599,10 @@ move_minipool_fix_backward_ref (Mnode *mp, Mnode *min_mp, } return min_mp; -} +} /* Add a constant to the minipool for a backward reference. Returns the - node added or NULL if the constant will not fit in this pool. + node added or NULL if the constant will not fit in this pool. Note that the code for insertion for a backwards reference can be somewhat confusing because the calculated offsets for each fix do @@ -6527,8 +7641,8 @@ add_minipool_backward_ref (Mfix *fix) && rtx_equal_p (fix->value, mp->value) /* Check that there is enough slack to move this entry to the end of the table (this is conservative). */ - && (mp->max_address - > (minipool_barrier->address + && (mp->max_address + > (minipool_barrier->address + minipool_vector_tail->offset + minipool_vector_tail->fix_size))) { @@ -6545,7 +7659,8 @@ add_minipool_backward_ref (Mfix *fix) { /* For now, we do not allow the insertion of 8-byte alignment requiring nodes anywhere but at the start of the pool. */ - if (TARGET_REALLY_IWMMXT && fix->fix_size == 8 && mp->fix_size != 8) + if (ARM_DOUBLEWORD_ALIGN + && fix->fix_size == 8 && mp->fix_size != 8) return NULL; else min_mp = mp; @@ -6564,7 +7679,7 @@ add_minipool_backward_ref (Mfix *fix) we have not already found an insertion point, then make sure that all such 8-byte aligned quantities are placed at the start of the pool. */ - else if (TARGET_REALLY_IWMMXT + else if (ARM_DOUBLEWORD_ALIGN && min_mp == NULL && fix->fix_size == 8 && mp->fix_size < 8) @@ -6576,7 +7691,7 @@ add_minipool_backward_ref (Mfix *fix) } /* We need to create a new entry. */ - mp = xmalloc (sizeof (* mp)); + mp = XNEW (Mnode); mp->fix_size = fix->fix_size; mp->mode = fix->mode; mp->value = fix->value; @@ -6605,7 +7720,7 @@ add_minipool_backward_ref (Mfix *fix) mp->next = min_mp->next; mp->prev = min_mp; min_mp->next = mp; - + if (mp->next != NULL) mp->next->prev = mp; else @@ -6648,7 +7763,7 @@ assign_minipool_offsets (Mfix *barrier) for (mp = minipool_vector_head; mp != NULL; mp = mp->next) { mp->offset = offset; - + if (mp->refcount > 0) offset += mp->fix_size; } @@ -6662,7 +7777,7 @@ dump_minipool (rtx scan) Mnode * nmp; int align64 = 0; - if (TARGET_REALLY_IWMMXT) + if (ARM_DOUBLEWORD_ALIGN) for (mp = minipool_vector_head; mp != NULL; mp = mp->next) if (mp->refcount > 0 && mp->fix_size == 8) { @@ -6670,8 +7785,8 @@ dump_minipool (rtx scan) break; } - if (rtl_dump_file) - fprintf (rtl_dump_file, + if (dump_file) + fprintf (dump_file, ";; Emitting minipool after insn %u; address %ld; align %d (bytes)\n", INSN_UID (scan), (unsigned long) minipool_barrier->address, align64 ? 8 : 4); @@ -6683,14 +7798,14 @@ dump_minipool (rtx scan) { if (mp->refcount > 0) { - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, ";; Offset %u, min %ld, max %ld ", (unsigned) mp->offset, (unsigned long) mp->min_address, (unsigned long) mp->max_address); - arm_print_value (rtl_dump_file, mp->value); - fputc ('\n', rtl_dump_file); + arm_print_value (dump_file, mp->value); + fputc ('\n', dump_file); } switch (mp->fix_size) @@ -6720,8 +7835,7 @@ dump_minipool (rtx scan) #endif default: - abort (); - break; + gcc_unreachable (); } } @@ -6752,7 +7866,7 @@ arm_barrier_cost (rtx insn) case CODE_LABEL: /* It will always be better to place the table before the label, rather than after it. */ - return 50; + return 50; case INSN: case CALL_INSN: @@ -6776,8 +7890,10 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) HOST_WIDE_INT count = 0; rtx barrier; rtx from = fix->insn; - rtx selected = from; + /* The instruction after which we will insert the jump. */ + rtx selected = NULL; int selected_cost; + /* The address at which the jump instruction will be placed. */ HOST_WIDE_INT selected_address; Mfix * new_fix; HOST_WIDE_INT max_count = max_address - fix->address; @@ -6793,8 +7909,7 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) /* This code shouldn't have been called if there was a natural barrier within range. */ - if (GET_CODE (from) == BARRIER) - abort (); + gcc_assert (GET_CODE (from) != BARRIER); /* Count the length of this insn. */ count += get_attr_length (from); @@ -6810,7 +7925,8 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) still put the pool after the table. */ new_cost = arm_barrier_cost (from); - if (count < max_count && new_cost <= selected_cost) + if (count < max_count + && (!selected || new_cost <= selected_cost)) { selected = tmp; selected_cost = new_cost; @@ -6823,8 +7939,9 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) } new_cost = arm_barrier_cost (from); - - if (count < max_count && new_cost <= selected_cost) + + if (count < max_count + && (!selected || new_cost <= selected_cost)) { selected = from; selected_cost = new_cost; @@ -6834,6 +7951,9 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) from = NEXT_INSN (from); } + /* Make sure that we found a place to insert the jump. */ + gcc_assert (selected); + /* Create a new JUMP_INSN that branches around a barrier. */ from = emit_jump_insn_after (gen_jump (label), selected); JUMP_LABEL (from) = label; @@ -6899,32 +8019,30 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc, fix->minipool = NULL; /* If an insn doesn't have a range defined for it, then it isn't - expecting to be reworked by this code. Better to abort now than + expecting to be reworked by this code. Better to stop now than to generate duff assembly code. */ - if (fix->forwards == 0 && fix->backwards == 0) - abort (); + gcc_assert (fix->forwards || fix->backwards); - /* With iWMMXt enabled, the pool is aligned to an 8-byte boundary. - So there might be an empty word before the start of the pool. - Hence we reduce the forward range by 4 to allow for this - possibility. */ - if (TARGET_REALLY_IWMMXT && fix->fix_size == 8) - fix->forwards -= 4; + /* If an entry requires 8-byte alignment then assume all constant pools + require 4 bytes of padding. Trying to do this later on a per-pool + basis is awkward because existing pool entries have to be modified. */ + if (ARM_DOUBLEWORD_ALIGN && fix->fix_size == 8) + minipool_pad = 4; - if (rtl_dump_file) + if (dump_file) { - fprintf (rtl_dump_file, + fprintf (dump_file, ";; %smode fixup for i%d; addr %lu, range (%ld,%ld): ", GET_MODE_NAME (mode), - INSN_UID (insn), (unsigned long) address, + INSN_UID (insn), (unsigned long) address, -1 * (long)fix->backwards, (long)fix->forwards); - arm_print_value (rtl_dump_file, fix->value); - fprintf (rtl_dump_file, "\n"); + arm_print_value (dump_file, fix->value); + fprintf (dump_file, "\n"); } /* Add it to the chain of fixes. */ fix->next = NULL; - + if (minipool_fix_head != NULL) minipool_fix_tail->next = fix; else @@ -6933,9 +8051,72 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc, minipool_fix_tail = fix; } +/* Return the cost of synthesizing a 64-bit constant VAL inline. + Returns the number of insns needed, or 99 if we don't know how to + do it. */ +int +arm_const_double_inline_cost (rtx val) +{ + rtx lowpart, highpart; + enum machine_mode mode; + + mode = GET_MODE (val); + + if (mode == VOIDmode) + mode = DImode; + + gcc_assert (GET_MODE_SIZE (mode) == 8); + + lowpart = gen_lowpart (SImode, val); + highpart = gen_highpart_mode (SImode, mode, val); + + gcc_assert (GET_CODE (lowpart) == CONST_INT); + gcc_assert (GET_CODE (highpart) == CONST_INT); + + return (arm_gen_constant (SET, SImode, NULL_RTX, INTVAL (lowpart), + NULL_RTX, NULL_RTX, 0, 0) + + arm_gen_constant (SET, SImode, NULL_RTX, INTVAL (highpart), + NULL_RTX, NULL_RTX, 0, 0)); +} + +/* Return true if it is worthwhile to split a 64-bit constant into two + 32-bit operations. This is the case if optimizing for size, or + if we have load delay slots, or if one 32-bit part can be done with + a single data operation. */ +bool +arm_const_double_by_parts (rtx val) +{ + enum machine_mode mode = GET_MODE (val); + rtx part; + + if (optimize_size || arm_ld_sched) + return true; + + if (mode == VOIDmode) + mode = DImode; + + part = gen_highpart_mode (SImode, mode, val); + + gcc_assert (GET_CODE (part) == CONST_INT); + + if (const_ok_for_arm (INTVAL (part)) + || const_ok_for_arm (~INTVAL (part))) + return true; + + part = gen_lowpart (SImode, val); + + gcc_assert (GET_CODE (part) == CONST_INT); + + if (const_ok_for_arm (INTVAL (part)) + || const_ok_for_arm (~INTVAL (part))) + return true; + + return false; +} + /* Scan INSN and note any of its operands that need fixing. If DO_PUSHES is false we do not actually push any of the fixups - needed. The function returns TRUE is any fixups were needed/pushed. + needed. The function returns TRUE if any fixups were needed/pushed. This is used by arm_memory_load_p() which needs to know about loads of constants that will be converted into minipool loads. */ static bool @@ -6952,7 +8133,8 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) if (recog_data.n_alternatives == 0) return false; - /* Fill in recog_op_alt with information about the constraints of this insn. */ + /* Fill in recog_op_alt with information about the constraints of + this insn. */ preprocess_constraints (); for (opno = 0; opno < recog_data.n_operands; opno++) @@ -6987,7 +8169,7 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) /* Casting the address of something to a mode narrower than a word can cause avoid_constant_pool_reference() to return the pool reference itself. That's no good to - us here. Lets just hope that we can use the + us here. Lets just hope that we can use the constant pool value directly. */ if (op == cop) cop = get_pool_constant (XEXP (op, 0)); @@ -7021,8 +8203,8 @@ arm_reorg (void) /* The first insn must always be a note, or the code below won't scan it properly. */ insn = get_insns (); - if (GET_CODE (insn) != NOTE) - abort (); + gcc_assert (GET_CODE (insn) == NOTE); + minipool_pad = 0; /* Scan all the insns and record the operands that will need fixing. */ for (insn = next_nonnote_insn (insn); insn; insn = next_nonnote_insn (insn)) @@ -7053,7 +8235,7 @@ arm_reorg (void) } fix = minipool_fix_head; - + /* Now scan the fixups and perform the required changes. */ while (fix) { @@ -7093,7 +8275,7 @@ arm_reorg (void) the next mini-pool. */ if (last_barrier != NULL) { - /* Reduce the refcount for those fixes that won't go into this + /* Reduce the refcount for those fixes that won't go into this pool after all. */ for (fdel = last_barrier->next; fdel && fdel != ftmp; @@ -7116,16 +8298,17 @@ arm_reorg (void) /* The last item on the list of fixes must be a barrier, so we can never run off the end of the list of fixes without last_barrier being set. */ - if (ftmp == NULL) - abort (); + gcc_assert (ftmp); max_address = minipool_vector_head->max_address; /* Check that there isn't another fix that is in range that we couldn't fit into this pool because the pool was already too large: we need to put the pool before such an - instruction. */ + instruction. The pool itself may come just after the + fix because create_fix_barrier also allows space for a + jump instruction. */ if (ftmp->address < max_address) - max_address = ftmp->address; + max_address = ftmp->address + 1; last_barrier = create_fix_barrier (last_added_fix, max_address); } @@ -7149,7 +8332,7 @@ arm_reorg (void) if (GET_CODE (this_fix->insn) != BARRIER) { rtx addr - = plus_constant (gen_rtx_LABEL_REF (VOIDmode, + = plus_constant (gen_rtx_LABEL_REF (VOIDmode, minipool_vector_label), this_fix->minipool->offset); *this_fix->loc = gen_rtx_MEM (this_fix->mode, addr); @@ -7178,16 +8361,16 @@ fp_immediate_constant (rtx x) { REAL_VALUE_TYPE r; int i; - - if (!fpa_consts_inited) - init_fpa_table (); - + + if (!fp_consts_inited) + init_fp_table (); + REAL_VALUE_FROM_CONST_DOUBLE (r, x); for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (r, values_fpa[i])) - return strings_fpa[i]; + if (REAL_VALUES_EQUAL (r, values_fp[i])) + return strings_fp[i]; - abort (); + gcc_unreachable (); } /* As for fp_immediate_constant, but value is passed directly, not in rtx. */ @@ -7196,75 +8379,200 @@ fp_const_from_val (REAL_VALUE_TYPE *r) { int i; - if (!fpa_consts_inited) - init_fpa_table (); + if (!fp_consts_inited) + init_fp_table (); for (i = 0; i < 8; i++) - if (REAL_VALUES_EQUAL (*r, values_fpa[i])) - return strings_fpa[i]; + if (REAL_VALUES_EQUAL (*r, values_fp[i])) + return strings_fp[i]; - abort (); + gcc_unreachable (); } /* Output the operands of a LDM/STM instruction to STREAM. MASK is the ARM register set mask of which only bits 0-15 are important. REG is the base register, either the frame pointer or the stack pointer, INSTR is the possibly suffixed load or store instruction. */ + static void -print_multi_reg (FILE *stream, const char *instr, int reg, int mask) +print_multi_reg (FILE *stream, const char *instr, unsigned reg, + unsigned long mask) { - int i; - int not_first = FALSE; + unsigned i; + bool not_first = FALSE; fputc ('\t', stream); asm_fprintf (stream, instr, reg); fputs (", {", stream); - + for (i = 0; i <= LAST_ARM_REGNUM; i++) if (mask & (1 << i)) { if (not_first) fprintf (stream, ", "); - + asm_fprintf (stream, "%r", i); not_first = TRUE; } - fprintf (stream, "}"); - - /* Add a ^ character for the 26-bit ABI, but only if we were loading - the PC. Otherwise we would generate an UNPREDICTABLE instruction. - Strictly speaking the instruction would be unpredicatble only if - we were writing back the base register as well, but since we never - want to generate an LDM type 2 instruction (register bank switching) - which is what you get if the PC is not being loaded, we do not need - to check for writeback. */ - if (! TARGET_APCS_32 - && ((mask & (1 << PC_REGNUM)) != 0)) - fprintf (stream, "^"); - - fprintf (stream, "\n"); + fprintf (stream, "}\n"); } + +/* Output a FLDMX instruction to STREAM. + BASE if the register containing the address. + REG and COUNT specify the register range. + Extra registers may be added to avoid hardware bugs. */ + +static void +arm_output_fldmx (FILE * stream, unsigned int base, int reg, int count) +{ + int i; + + /* Workaround ARM10 VFPr1 bug. */ + if (count == 2 && !arm_arch6) + { + if (reg == 15) + reg--; + count++; + } + + fputc ('\t', stream); + asm_fprintf (stream, "fldmfdx\t%r!, {", base); + + for (i = reg; i < reg + count; i++) + { + if (i > reg) + fputs (", ", stream); + asm_fprintf (stream, "d%d", i); + } + fputs ("}\n", stream); + +} + + +/* Output the assembly for a store multiple. */ + +const char * +vfp_output_fstmx (rtx * operands) +{ + char pattern[100]; + int p; + int base; + int i; + + strcpy (pattern, "fstmfdx\t%m0!, {%P1"); + p = strlen (pattern); + + gcc_assert (GET_CODE (operands[1]) == REG); + + base = (REGNO (operands[1]) - FIRST_VFP_REGNUM) / 2; + for (i = 1; i < XVECLEN (operands[2], 0); i++) + { + p += sprintf (&pattern[p], ", d%d", base + i); + } + strcpy (&pattern[p], "}"); + + output_asm_insn (pattern, operands); + return ""; +} + + +/* Emit RTL to save block of VFP register pairs to the stack. Returns the + number of bytes pushed. */ + +static int +vfp_emit_fstmx (int base_reg, int count) +{ + rtx par; + rtx dwarf; + rtx tmp, reg; + int i; + + /* Workaround ARM10 VFPr1 bug. Data corruption can occur when exactly two + register pairs are stored by a store multiple insn. We avoid this + by pushing an extra pair. */ + if (count == 2 && !arm_arch6) + { + if (base_reg == LAST_VFP_REGNUM - 3) + base_reg -= 2; + count++; + } + + /* ??? The frame layout is implementation defined. We describe + standard format 1 (equivalent to a FSTMD insn and unused pad word). + We really need some way of representing the whole block so that the + unwinder can figure it out at runtime. */ + par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); + dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1)); + + reg = gen_rtx_REG (DFmode, base_reg); + base_reg += 2; + + XVECEXP (par, 0, 0) + = gen_rtx_SET (VOIDmode, + gen_frame_mem (BLKmode, + gen_rtx_PRE_DEC (BLKmode, + stack_pointer_rtx)), + gen_rtx_UNSPEC (BLKmode, + gen_rtvec (1, reg), + UNSPEC_PUSH_MULT)); + + tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (stack_pointer_rtx, -(count * 8 + 4))); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, 0) = tmp; + + tmp = gen_rtx_SET (VOIDmode, + gen_frame_mem (DFmode, stack_pointer_rtx), + reg); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, 1) = tmp; + + for (i = 1; i < count; i++) + { + reg = gen_rtx_REG (DFmode, base_reg); + base_reg += 2; + XVECEXP (par, 0, i) = gen_rtx_USE (VOIDmode, reg); + + tmp = gen_rtx_SET (VOIDmode, + gen_frame_mem (DFmode, + plus_constant (stack_pointer_rtx, + i * 8)), + reg); + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, i + 1) = tmp; + } + + par = emit_insn (par); + REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, + REG_NOTES (par)); + RTX_FRAME_RELATED_P (par) = 1; + + return count * 8 + 4; +} + + /* Output a 'call' insn. */ const char * output_call (rtx *operands) { - /* Handle calls to lr using ip (which may be clobbered in subr anyway). */ + gcc_assert (!arm_arch5); /* Patterns should call blx directly. */ + /* Handle calls to lr using ip (which may be clobbered in subr anyway). */ if (REGNO (operands[0]) == LR_REGNUM) { operands[0] = gen_rtx_REG (SImode, IP_REGNUM); output_asm_insn ("mov%?\t%0, %|lr", operands); } - + output_asm_insn ("mov%?\t%|lr, %|pc", operands); - - if (TARGET_INTERWORK) + + if (TARGET_INTERWORK || arm_arch4t) output_asm_insn ("bx%?\t%0", operands); else output_asm_insn ("mov%?\t%|pc, %0", operands); - + return ""; } @@ -7272,7 +8580,7 @@ output_call (rtx *operands) const char * output_call_mem (rtx *operands) { - if (TARGET_INTERWORK) + if (TARGET_INTERWORK && !arm_arch5) { output_asm_insn ("ldr%?\t%|ip, %0", operands); output_asm_insn ("mov%?\t%|lr, %|pc", operands); @@ -7284,8 +8592,16 @@ output_call_mem (rtx *operands) first instruction. It's safe to use IP as the target of the load since the call will kill it anyway. */ output_asm_insn ("ldr%?\t%|ip, %0", operands); - output_asm_insn ("mov%?\t%|lr, %|pc", operands); - output_asm_insn ("mov%?\t%|pc, %|ip", operands); + if (arm_arch5) + output_asm_insn ("blx%?\t%|ip", operands); + else + { + output_asm_insn ("mov%?\t%|lr, %|pc", operands); + if (arm_arch4t) + output_asm_insn ("bx%?\t%|ip", operands); + else + output_asm_insn ("mov%?\t%|pc, %|ip", operands); + } } else { @@ -7296,6 +8612,7 @@ output_call_mem (rtx *operands) return ""; } + /* Output a move from arm registers to an fpa registers. OPERANDS[0] is an fpa register. OPERANDS[1] is the first registers of an arm register pair. */ @@ -7305,16 +8622,15 @@ output_mov_long_double_fpa_from_arm (rtx *operands) int arm_reg0 = REGNO (operands[1]); rtx ops[3]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); ops[2] = gen_rtx_REG (SImode, 2 + arm_reg0); - + output_asm_insn ("stm%?fd\t%|sp!, {%0, %1, %2}", ops); output_asm_insn ("ldf%?e\t%0, [%|sp], #12", operands); - + return ""; } @@ -7327,8 +8643,7 @@ output_mov_long_double_arm_from_fpa (rtx *operands) int arm_reg0 = REGNO (operands[0]); rtx ops[3]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -7383,9 +8698,8 @@ output_mov_double_fpa_from_arm (rtx *operands) int arm_reg0 = REGNO (operands[1]); rtx ops[2]; - if (arm_reg0 == IP_REGNUM) - abort (); - + gcc_assert (arm_reg0 != IP_REGNUM); + ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); output_asm_insn ("stm%?fd\t%|sp!, {%0, %1}", ops); @@ -7402,8 +8716,7 @@ output_mov_double_arm_from_fpa (rtx *operands) int arm_reg0 = REGNO (operands[0]); rtx ops[2]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -7427,267 +8740,177 @@ output_move_double (rtx *operands) int reg0 = REGNO (operands[0]); otherops[0] = gen_rtx_REG (SImode, 1 + reg0); - - if (code1 == REG) - { - int reg1 = REGNO (operands[1]); - if (reg1 == IP_REGNUM) - abort (); - /* Ensure the second source is not overwritten. */ - if (reg1 == reg0 + (WORDS_BIG_ENDIAN ? -1 : 1)) - output_asm_insn ("mov%?\t%Q0, %Q1\n\tmov%?\t%R0, %R1", operands); - else - output_asm_insn ("mov%?\t%R0, %R1\n\tmov%?\t%Q0, %Q1", operands); - } - else if (code1 == CONST_VECTOR) - { - HOST_WIDE_INT hint = 0; + gcc_assert (code1 == MEM); /* Constraints should ensure this. */ - switch (GET_MODE (operands[1])) + switch (GET_CODE (XEXP (operands[1], 0))) + { + case REG: + output_asm_insn ("ldm%?ia\t%m1, %M0", operands); + break; + + case PRE_INC: + gcc_assert (TARGET_LDRD); + output_asm_insn ("ldr%?d\t%0, [%m1, #8]!", operands); + break; + + case PRE_DEC: + output_asm_insn ("ldm%?db\t%m1!, %M0", operands); + break; + + case POST_INC: + output_asm_insn ("ldm%?ia\t%m1!, %M0", operands); + break; + + case POST_DEC: + gcc_assert (TARGET_LDRD); + output_asm_insn ("ldr%?d\t%0, [%m1], #-8", operands); + break; + + case PRE_MODIFY: + case POST_MODIFY: + otherops[0] = operands[0]; + otherops[1] = XEXP (XEXP (XEXP (operands[1], 0), 1), 0); + otherops[2] = XEXP (XEXP (XEXP (operands[1], 0), 1), 1); + + if (GET_CODE (XEXP (operands[1], 0)) == PRE_MODIFY) { - case V2SImode: - otherops[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 1))); - operands[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0))); - break; - - case V4HImode: - if (BYTES_BIG_ENDIAN) + if (reg_overlap_mentioned_p (otherops[0], otherops[2])) { - hint = INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); + /* Registers overlap so split out the increment. */ + output_asm_insn ("add%?\t%1, %1, %2", otherops); + output_asm_insn ("ldr%?d\t%0, [%1] @split", otherops); } else { - hint = INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - } - - otherops[1] = GEN_INT (hint); - hint = 0; - - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - } - - operands[1] = GEN_INT (hint); - break; - - case V8QImode: - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4)); - } - - otherops[1] = GEN_INT (hint); - hint = 0; - - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - } - - operands[1] = GEN_INT (hint); - break; - - default: - abort (); - } - output_mov_immediate (operands); - output_mov_immediate (otherops); - } - else if (code1 == CONST_DOUBLE) - { - if (GET_MODE (operands[1]) == DFmode) - { - REAL_VALUE_TYPE r; - long l[2]; - - REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]); - REAL_VALUE_TO_TARGET_DOUBLE (r, l); - otherops[1] = GEN_INT (l[1]); - operands[1] = GEN_INT (l[0]); - } - else if (GET_MODE (operands[1]) != VOIDmode) - abort (); - else if (WORDS_BIG_ENDIAN) - { - otherops[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - } - else - { - otherops[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - } - - output_mov_immediate (operands); - output_mov_immediate (otherops); - } - else if (code1 == CONST_INT) - { -#if HOST_BITS_PER_WIDE_INT > 32 - /* If HOST_WIDE_INT is more than 32 bits, the intval tells us - what the upper word is. */ - if (WORDS_BIG_ENDIAN) - { - otherops[1] = GEN_INT (ARM_SIGN_EXTEND (INTVAL (operands[1]))); - operands[1] = GEN_INT (INTVAL (operands[1]) >> 32); - } - else - { - otherops[1] = GEN_INT (INTVAL (operands[1]) >> 32); - operands[1] = GEN_INT (ARM_SIGN_EXTEND (INTVAL (operands[1]))); - } -#else - /* Sign extend the intval into the high-order word. */ - if (WORDS_BIG_ENDIAN) - { - otherops[1] = operands[1]; - operands[1] = (INTVAL (operands[1]) < 0 - ? constm1_rtx : const0_rtx); - } - else - otherops[1] = INTVAL (operands[1]) < 0 ? constm1_rtx : const0_rtx; -#endif - output_mov_immediate (otherops); - output_mov_immediate (operands); - } - else if (code1 == MEM) - { - switch (GET_CODE (XEXP (operands[1], 0))) - { - case REG: - output_asm_insn ("ldm%?ia\t%m1, %M0", operands); - break; - - case PRE_INC: - abort (); /* Should never happen now. */ - break; - - case PRE_DEC: - output_asm_insn ("ldm%?db\t%m1!, %M0", operands); - break; - - case POST_INC: - output_asm_insn ("ldm%?ia\t%m1!, %M0", operands); - break; - - case POST_DEC: - abort (); /* Should never happen now. */ - break; - - case LABEL_REF: - case CONST: - output_asm_insn ("adr%?\t%0, %1", operands); - output_asm_insn ("ldm%?ia\t%0, %M0", operands); - break; - - default: - if (arm_add_operand (XEXP (XEXP (operands[1], 0), 1), - GET_MODE (XEXP (XEXP (operands[1], 0), 1)))) - { - otherops[0] = operands[0]; - otherops[1] = XEXP (XEXP (operands[1], 0), 0); - otherops[2] = XEXP (XEXP (operands[1], 0), 1); - - if (GET_CODE (XEXP (operands[1], 0)) == PLUS) + /* IWMMXT allows offsets larger than ldrd can handle, + fix these up with a pair of ldr. */ + if (GET_CODE (otherops[2]) == CONST_INT + && (INTVAL(otherops[2]) <= -256 + || INTVAL(otherops[2]) >= 256)) { - if (GET_CODE (otherops[2]) == CONST_INT) - { - switch ((int) INTVAL (otherops[2])) - { - case -8: - output_asm_insn ("ldm%?db\t%1, %M0", otherops); - return ""; - case -4: - output_asm_insn ("ldm%?da\t%1, %M0", otherops); - return ""; - case 4: - output_asm_insn ("ldm%?ib\t%1, %M0", otherops); - return ""; - } + output_asm_insn ("ldr%?\t%0, [%1, %2]!", otherops); + otherops[0] = gen_rtx_REG (SImode, 1 + reg0); + output_asm_insn ("ldr%?\t%0, [%1, #4]", otherops); + } + else + output_asm_insn ("ldr%?d\t%0, [%1, %2]!", otherops); + } + } + else + { + /* IWMMXT allows offsets larger than ldrd can handle, + fix these up with a pair of ldr. */ + if (GET_CODE (otherops[2]) == CONST_INT + && (INTVAL(otherops[2]) <= -256 + || INTVAL(otherops[2]) >= 256)) + { + otherops[0] = gen_rtx_REG (SImode, 1 + reg0); + output_asm_insn ("ldr%?\t%0, [%1, #4]", otherops); + otherops[0] = operands[0]; + output_asm_insn ("ldr%?\t%0, [%1], %2", otherops); + } + else + /* We only allow constant increments, so this is safe. */ + output_asm_insn ("ldr%?d\t%0, [%1], %2", otherops); + } + break; - if (!(const_ok_for_arm (INTVAL (otherops[2])))) - output_asm_insn ("sub%?\t%0, %1, #%n2", otherops); - else - output_asm_insn ("add%?\t%0, %1, %2", otherops); + case LABEL_REF: + case CONST: + output_asm_insn ("adr%?\t%0, %1", operands); + output_asm_insn ("ldm%?ia\t%0, %M0", operands); + break; + + default: + if (arm_add_operand (XEXP (XEXP (operands[1], 0), 1), + GET_MODE (XEXP (XEXP (operands[1], 0), 1)))) + { + otherops[0] = operands[0]; + otherops[1] = XEXP (XEXP (operands[1], 0), 0); + otherops[2] = XEXP (XEXP (operands[1], 0), 1); + + if (GET_CODE (XEXP (operands[1], 0)) == PLUS) + { + if (GET_CODE (otherops[2]) == CONST_INT) + { + switch ((int) INTVAL (otherops[2])) + { + case -8: + output_asm_insn ("ldm%?db\t%1, %M0", otherops); + return ""; + case -4: + output_asm_insn ("ldm%?da\t%1, %M0", otherops); + return ""; + case 4: + output_asm_insn ("ldm%?ib\t%1, %M0", otherops); + return ""; } + } + if (TARGET_LDRD + && (GET_CODE (otherops[2]) == REG + || (GET_CODE (otherops[2]) == CONST_INT + && INTVAL (otherops[2]) > -256 + && INTVAL (otherops[2]) < 256))) + { + if (reg_overlap_mentioned_p (otherops[0], + otherops[2])) + { + /* Swap base and index registers over to + avoid a conflict. */ + otherops[1] = XEXP (XEXP (operands[1], 0), 1); + otherops[2] = XEXP (XEXP (operands[1], 0), 0); + } + /* If both registers conflict, it will usually + have been fixed by a splitter. */ + if (reg_overlap_mentioned_p (otherops[0], otherops[2])) + { + output_asm_insn ("add%?\t%1, %1, %2", otherops); + output_asm_insn ("ldr%?d\t%0, [%1]", + otherops); + } + else + output_asm_insn ("ldr%?d\t%0, [%1, %2]", otherops); + return ""; + } + + if (GET_CODE (otherops[2]) == CONST_INT) + { + if (!(const_ok_for_arm (INTVAL (otherops[2])))) + output_asm_insn ("sub%?\t%0, %1, #%n2", otherops); else output_asm_insn ("add%?\t%0, %1, %2", otherops); } else - output_asm_insn ("sub%?\t%0, %1, %2", otherops); - - return "ldm%?ia\t%0, %M0"; - } - else - { - otherops[1] = adjust_address (operands[1], SImode, 4); - /* Take care of overlapping base/data reg. */ - if (reg_mentioned_p (operands[0], operands[1])) - { - output_asm_insn ("ldr%?\t%0, %1", otherops); - output_asm_insn ("ldr%?\t%0, %1", operands); - } - else - { - output_asm_insn ("ldr%?\t%0, %1", operands); - output_asm_insn ("ldr%?\t%0, %1", otherops); - } + output_asm_insn ("add%?\t%0, %1, %2", otherops); + } + else + output_asm_insn ("sub%?\t%0, %1, %2", otherops); + + return "ldm%?ia\t%0, %M0"; + } + else + { + otherops[1] = adjust_address (operands[1], SImode, 4); + /* Take care of overlapping base/data reg. */ + if (reg_mentioned_p (operands[0], operands[1])) + { + output_asm_insn ("ldr%?\t%0, %1", otherops); + output_asm_insn ("ldr%?\t%0, %1", operands); + } + else + { + output_asm_insn ("ldr%?\t%0, %1", operands); + output_asm_insn ("ldr%?\t%0, %1", otherops); } } } - else - abort (); /* Constraints should prevent this. */ } - else if (code0 == MEM && code1 == REG) + else { - if (REGNO (operands[1]) == IP_REGNUM) - abort (); + /* Constraints should ensure this. */ + gcc_assert (code0 == MEM && code1 == REG); + gcc_assert (REGNO (operands[1]) != IP_REGNUM); switch (GET_CODE (XEXP (operands[0], 0))) { @@ -7696,7 +8919,8 @@ output_move_double (rtx *operands) break; case PRE_INC: - abort (); /* Should never happen now. */ + gcc_assert (TARGET_LDRD); + output_asm_insn ("str%?d\t%1, [%m0, #8]!", operands); break; case PRE_DEC: @@ -7708,11 +8932,47 @@ output_move_double (rtx *operands) break; case POST_DEC: - abort (); /* Should never happen now. */ + gcc_assert (TARGET_LDRD); + output_asm_insn ("str%?d\t%1, [%m0], #-8", operands); + break; + + case PRE_MODIFY: + case POST_MODIFY: + otherops[0] = operands[1]; + otherops[1] = XEXP (XEXP (XEXP (operands[0], 0), 1), 0); + otherops[2] = XEXP (XEXP (XEXP (operands[0], 0), 1), 1); + + /* IWMMXT allows offsets larger than ldrd can handle, + fix these up with a pair of ldr. */ + if (GET_CODE (otherops[2]) == CONST_INT + && (INTVAL(otherops[2]) <= -256 + || INTVAL(otherops[2]) >= 256)) + { + rtx reg1; + reg1 = gen_rtx_REG (SImode, 1 + REGNO (operands[1])); + if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY) + { + output_asm_insn ("ldr%?\t%0, [%1, %2]!", otherops); + otherops[0] = reg1; + output_asm_insn ("ldr%?\t%0, [%1, #4]", otherops); + } + else + { + otherops[0] = reg1; + output_asm_insn ("ldr%?\t%0, [%1, #4]", otherops); + otherops[0] = operands[1]; + output_asm_insn ("ldr%?\t%0, [%1], %2", otherops); + } + } + else if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY) + output_asm_insn ("str%?d\t%0, [%1, %2]!", otherops); + else + output_asm_insn ("str%?d\t%0, [%1], %2", otherops); break; case PLUS: - if (GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT) + otherops[2] = XEXP (XEXP (operands[0], 0), 1); + if (GET_CODE (otherops[2]) == CONST_INT) { switch ((int) INTVAL (XEXP (XEXP (operands[0], 0), 1))) { @@ -7729,6 +8989,17 @@ output_move_double (rtx *operands) return ""; } } + if (TARGET_LDRD + && (GET_CODE (otherops[2]) == REG + || (GET_CODE (otherops[2]) == CONST_INT + && INTVAL (otherops[2]) > -256 + && INTVAL (otherops[2]) < 256))) + { + otherops[0] = operands[1]; + otherops[1] = XEXP (XEXP (operands[0], 0), 0); + output_asm_insn ("str%?d\t%0, [%1, %2]", otherops); + return ""; + } /* Fall through */ default: @@ -7738,46 +9009,6 @@ output_move_double (rtx *operands) output_asm_insn ("str%?\t%1, %0", otherops); } } - else - /* Constraints should prevent this. */ - abort (); - - return ""; -} - - -/* Output an arbitrary MOV reg, #n. - OPERANDS[0] is a register. OPERANDS[1] is a const_int. */ -const char * -output_mov_immediate (rtx *operands) -{ - HOST_WIDE_INT n = INTVAL (operands[1]); - - /* Try to use one MOV. */ - if (const_ok_for_arm (n)) - output_asm_insn ("mov%?\t%0, %1", operands); - - /* Try to use one MVN. */ - else if (const_ok_for_arm (~n)) - { - operands[1] = GEN_INT (~n); - output_asm_insn ("mvn%?\t%0, %1", operands); - } - else - { - int n_ones = 0; - int i; - - /* If all else fails, make it out of ORRs or BICs as appropriate. */ - for (i = 0; i < 32; i++) - if (n & 1 << i) - n_ones++; - - if (n_ones > 16) /* Shorter to use MVN with BIC in this case. */ - output_multi_immediate (operands, "mvn%?\t%0, %1", "bic%?\t%0, %0, %1", 1, ~ n); - else - output_multi_immediate (operands, "mov%?\t%0, %1", "orr%?\t%0, %0, %1", 1, n); - } return ""; } @@ -7841,7 +9072,7 @@ output_multi_immediate (rtx *operands, const char *instr1, const char *instr2, } } } - + return ""; } @@ -7870,7 +9101,7 @@ arithmetic_instr (rtx op, int shift_first_arg) return "and"; default: - abort (); + gcc_unreachable (); } } @@ -7885,12 +9116,20 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) const char * mnem; enum rtx_code code = GET_CODE (op); - if (GET_CODE (XEXP (op, 1)) == REG || GET_CODE (XEXP (op, 1)) == SUBREG) - *amountp = -1; - else if (GET_CODE (XEXP (op, 1)) == CONST_INT) - *amountp = INTVAL (XEXP (op, 1)); - else - abort (); + switch (GET_CODE (XEXP (op, 1))) + { + case REG: + case SUBREG: + *amountp = -1; + break; + + case CONST_INT: + *amountp = INTVAL (XEXP (op, 1)); + break; + + default: + gcc_unreachable (); + } switch (code) { @@ -7906,6 +9145,12 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) mnem = "lsr"; break; + case ROTATE: + gcc_assert (*amountp != -1); + *amountp = 32 - *amountp; + + /* Fall through. */ + case ROTATERT: mnem = "ror"; break; @@ -7913,14 +9158,12 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) case MULT: /* We never have to worry about the amount being other than a power of 2, since this case can never be reloaded from a reg. */ - if (*amountp != -1) - *amountp = int_log2 (*amountp); - else - abort (); + gcc_assert (*amountp != -1); + *amountp = int_log2 (*amountp); return "asl"; default: - abort (); + gcc_unreachable (); } if (*amountp != -1) @@ -7930,7 +9173,7 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) shift. >=32 is not a valid shift for "asl", so we must try and output a shift that produces the correct arithmetical result. Using lsr #32 is identical except for the fact that the carry bit - is not set correctly if we set the flags; but we never use the + is not set correctly if we set the flags; but we never use the carry bit from such an operation, so we can ignore that. */ if (code == ROTATERT) /* Rotate is just modulo 32. */ @@ -7945,7 +9188,7 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) /* Shifts of 0 are no-ops. */ if (*amountp == 0) return NULL; - } + } return mnem; } @@ -7959,16 +9202,21 @@ int_log2 (HOST_WIDE_INT power) while ((((HOST_WIDE_INT) 1 << shift) & power) == 0) { - if (shift > 31) - abort (); + gcc_assert (shift <= 31); shift++; } return shift; } -/* Output a .ascii pseudo-op, keeping track of lengths. This is because - /bin/as is horribly restrictive. */ +/* Output a .ascii pseudo-op, keeping track of lengths. This is + because /bin/as is horribly restrictive. The judgement about + whether or not each character is 'printable' (and can be output as + is) or not (and must be printed with an octal escape) must be made + with reference to the *host* character set -- the situation is + similar to that discussed in the comments above pp_c_char in + c-pretty-print.c. */ + #define MAX_ASCII_LEN 51 void @@ -7978,7 +9226,7 @@ output_ascii_pseudo_op (FILE *stream, const unsigned char *p, int len) int len_so_far = 0; fputs ("\t.ascii\t\"", stream); - + for (i = 0; i < len; i++) { int c = p[i]; @@ -7989,71 +9237,34 @@ output_ascii_pseudo_op (FILE *stream, const unsigned char *p, int len) len_so_far = 0; } - switch (c) + if (ISPRINT (c)) { - case TARGET_TAB: - fputs ("\\t", stream); - len_so_far += 2; - break; - - case TARGET_FF: - fputs ("\\f", stream); - len_so_far += 2; - break; - - case TARGET_BS: - fputs ("\\b", stream); - len_so_far += 2; - break; - - case TARGET_CR: - fputs ("\\r", stream); - len_so_far += 2; - break; - - case TARGET_NEWLINE: - fputs ("\\n", stream); - c = p [i + 1]; - if ((c >= ' ' && c <= '~') - || c == TARGET_TAB) - /* This is a good place for a line break. */ - len_so_far = MAX_ASCII_LEN; - else - len_so_far += 2; - break; - - case '\"': - case '\\': - putc ('\\', stream); - len_so_far++; - /* Drop through. */ - - default: - if (c >= ' ' && c <= '~') + if (c == '\\' || c == '\"') { - putc (c, stream); + putc ('\\', stream); len_so_far++; } - else - { - fprintf (stream, "\\%03o", c); - len_so_far += 4; - } - break; + putc (c, stream); + len_so_far++; + } + else + { + fprintf (stream, "\\%03o", c); + len_so_far += 4; } } fputs ("\"\n", stream); } -/* Compute the register sabe mask for registers 0 through 12 - inclusive. This code is used by both arm_compute_save_reg_mask - and arm_compute_initial_elimination_offset. */ +/* Compute the register save mask for registers 0 through 12 + inclusive. This code is used by arm_compute_save_reg_mask. */ + static unsigned long arm_compute_save_reg0_reg12_mask (void) { unsigned long func_type = arm_current_func_type (); - unsigned int save_reg_mask = 0; + unsigned long save_reg_mask = 0; unsigned int reg; if (IS_INTERRUPT (func_type)) @@ -8074,11 +9285,18 @@ arm_compute_save_reg0_reg12_mask (void) max_reg = 7; else max_reg = 12; - + for (reg = 0; reg <= max_reg; reg++) if (regs_ever_live[reg] || (! current_function_is_leaf && call_used_regs [reg])) save_reg_mask |= (1 << reg); + + /* Also save the pic base register if necessary. */ + if (flag_pic + && !TARGET_SINGLE_PIC_BASE + && arm_pic_register != INVALID_REGNUM + && current_function_uses_pic_offset_table) + save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } else { @@ -8098,11 +9316,27 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ if (flag_pic - && ! TARGET_SINGLE_PIC_BASE - && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) + && !TARGET_SINGLE_PIC_BASE + && arm_pic_register != INVALID_REGNUM + && (regs_ever_live[PIC_OFFSET_TABLE_REGNUM] + || current_function_uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } + /* Save registers so the exception handler can modify them. */ + if (current_function_calls_eh_return) + { + unsigned int i; + + for (i = 0; ; i++) + { + reg = EH_RETURN_DATA_REGNO (i); + if (reg == INVALID_REGNUM) + break; + save_reg_mask |= 1 << reg; + } + } + return save_reg_mask; } @@ -8147,7 +9381,8 @@ arm_compute_save_reg_mask (void) if (regs_ever_live [LR_REGNUM] || (save_reg_mask && optimize_size - && ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL)) + && ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL + && !current_function_calls_eh_return)) save_reg_mask |= 1 << LR_REGNUM; if (cfun->machine->lr_save_eliminated) @@ -8184,6 +9419,97 @@ arm_compute_save_reg_mask (void) return save_reg_mask; } + +/* Compute a bit mask of which registers need to be + saved on the stack for the current function. */ +static unsigned long +thumb_compute_save_reg_mask (void) +{ + unsigned long mask; + unsigned reg; + + mask = 0; + for (reg = 0; reg < 12; reg ++) + if (regs_ever_live[reg] && !call_used_regs[reg]) + mask |= 1 << reg; + + if (flag_pic + && !TARGET_SINGLE_PIC_BASE + && arm_pic_register != INVALID_REGNUM + && current_function_uses_pic_offset_table) + mask |= 1 << PIC_OFFSET_TABLE_REGNUM; + + /* See if we might need r11 for calls to _interwork_r11_call_via_rN(). */ + if (!frame_pointer_needed && CALLER_INTERWORKING_SLOT_SIZE > 0) + mask |= 1 << ARM_HARD_FRAME_POINTER_REGNUM; + + /* LR will also be pushed if any lo regs are pushed. */ + if (mask & 0xff || thumb_force_lr_save ()) + mask |= (1 << LR_REGNUM); + + /* Make sure we have a low work register if we need one. + We will need one if we are going to push a high register, + but we are not currently intending to push a low register. */ + if ((mask & 0xff) == 0 + && ((mask & 0x0f00) || TARGET_BACKTRACE)) + { + /* Use thumb_find_work_register to choose which register + we will use. If the register is live then we will + have to push it. Use LAST_LO_REGNUM as our fallback + choice for the register to select. */ + reg = thumb_find_work_register (1 << LAST_LO_REGNUM); + + if (! call_used_regs[reg]) + mask |= 1 << reg; + } + + return mask; +} + + +/* Return the number of bytes required to save VFP registers. */ +static int +arm_get_vfp_saved_size (void) +{ + unsigned int regno; + int count; + int saved; + + saved = 0; + /* Space for saved VFP registers. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + count = 0; + for (regno = FIRST_VFP_REGNUM; + regno < LAST_VFP_REGNUM; + regno += 2) + { + if ((!regs_ever_live[regno] || call_used_regs[regno]) + && (!regs_ever_live[regno + 1] || call_used_regs[regno + 1])) + { + if (count > 0) + { + /* Workaround ARM10 VFPr1 bug. */ + if (count == 2 && !arm_arch6) + count++; + saved += count * 8 + 4; + } + count = 0; + } + else + count++; + } + if (count > 0) + { + if (count == 2 && !arm_arch6) + count++; + saved += count * 8 + 4; + } + } + return saved; +} + + /* Generate a function exit sequence. If REALLY_RETURN is false, then do everything bar the final return instruction. */ const char * @@ -8191,9 +9517,10 @@ output_return_instruction (rtx operand, int really_return, int reverse) { char conditional[10]; char instr[100]; - int reg; + unsigned reg; unsigned long live_regs_mask; unsigned long func_type; + arm_stack_offsets *offsets; func_type = arm_current_func_type (); @@ -8208,20 +9535,19 @@ output_return_instruction (rtx operand, int really_return, int reverse) if (really_return) { rtx ops[2]; - + /* Otherwise, trap an attempted return by aborting. */ ops[0] = operand; - ops[1] = gen_rtx_SYMBOL_REF (Pmode, NEED_PLT_RELOC ? "abort(PLT)" + ops[1] = gen_rtx_SYMBOL_REF (Pmode, NEED_PLT_RELOC ? "abort(PLT)" : "abort"); assemble_external_libcall (ops[1]); output_asm_insn (reverse ? "bl%D0\t%a1" : "bl%d0\t%a1", ops); } - + return ""; } - if (current_function_calls_alloca && !really_return) - abort (); + gcc_assert (!current_function_calls_alloca || really_return); sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd'); @@ -8233,8 +9559,8 @@ output_return_instruction (rtx operand, int really_return, int reverse) { const char * return_reg; - /* If we do not have any special requirements for function exit - (eg interworking, or ISR) then we can load the return address + /* If we do not have any special requirements for function exit + (e.g. interworking, or ISR) then we can load the return address directly into the PC. Otherwise we must load it into LR. */ if (really_return && ! TARGET_INTERWORK) @@ -8256,11 +9582,7 @@ output_return_instruction (rtx operand, int really_return, int reverse) live_regs_mask |= (1 << SP_REGNUM); } else - { - if (! IS_INTERRUPT (func_type) - && ! TARGET_REALLY_IWMMXT) - abort (); - } + gcc_assert (IS_INTERRUPT (func_type) || TARGET_REALLY_IWMMXT); } /* On some ARM architectures it is faster to use LDR rather than @@ -8269,16 +9591,15 @@ output_return_instruction (rtx operand, int really_return, int reverse) we have to use LDM to load the PC so that the CPSR is also restored. */ for (reg = 0; reg <= LAST_ARM_REGNUM; reg++) - { - if (live_regs_mask == (unsigned int)(1 << reg)) - break; - } + if (live_regs_mask == (1U << reg)) + break; + if (reg <= LAST_ARM_REGNUM && (reg != LR_REGNUM - || ! really_return - || (TARGET_APCS_32 && ! IS_INTERRUPT (func_type)))) + || ! really_return + || ! IS_INTERRUPT (func_type))) { - sprintf (instr, "ldr%s\t%%|%s, [%%|sp], #4", conditional, + sprintf (instr, "ldr%s\t%%|%s, [%%|sp], #4", conditional, (reg == LR_REGNUM) ? return_reg : reg_names[reg]); } else @@ -8292,18 +9613,18 @@ output_return_instruction (rtx operand, int really_return, int reverse) points to the base of the saved core registers. */ if (live_regs_mask & (1 << SP_REGNUM)) { - unsigned HOST_WIDE_INT stack_adjust = - arm_get_frame_size () + current_function_outgoing_args_size; - - if (stack_adjust != 0 && stack_adjust != 4) - abort (); + unsigned HOST_WIDE_INT stack_adjust; + + offsets = arm_get_frame_offsets (); + stack_adjust = offsets->outgoing_args - offsets->saved_regs; + gcc_assert (stack_adjust == 0 || stack_adjust == 4); if (stack_adjust && arm_arch5) sprintf (instr, "ldm%sib\t%%|sp, {", conditional); else { - /* If we can't use ldmib (SA110 bug), then try to pop r3 - instead. */ + /* If we can't use ldmib (SA110 bug), + then try to pop r3 instead. */ if (stack_adjust) live_regs_mask |= 1 << 3; sprintf (instr, "ldm%sfd\t%%|sp, {", conditional); @@ -8331,24 +9652,12 @@ output_return_instruction (rtx operand, int really_return, int reverse) memcpy (p + 2, reg_names[reg], l); p += l + 2; } - + if (live_regs_mask & (1 << LR_REGNUM)) { sprintf (p, "%s%%|%s}", first ? "" : ", ", return_reg); - /* Decide if we need to add the ^ symbol to the end of the - register list. This causes the saved condition codes - register to be copied into the current condition codes - register. We do the copy if we are conforming to the 32-bit - ABI and this is an interrupt function, or if we are - conforming to the 26-bit ABI. There is a special case for - the 26-bit ABI however, which is if we are writing back the - stack pointer but not loading the PC. In this case adding - the ^ symbol would create a type 2 LDM instruction, where - writeback is UNPREDICTABLE. We are safe in leaving the ^ - character off in this case however, since the actual return - instruction will be a MOVS which will restore the CPSR. */ - if ((TARGET_APCS_32 && IS_INTERRUPT (func_type)) - || (! TARGET_APCS_32 && really_return)) + /* If returning from an interrupt, restore the CPSR. */ + if (IS_INTERRUPT (func_type)) strcat (p, "^"); } else @@ -8387,13 +9696,11 @@ output_return_instruction (rtx operand, int really_return, int reverse) break; default: - /* ARMv5 implementations always provide BX, so interworking - is the default unless APCS-26 is in use. */ - if ((insn_flags & FL_ARCH5) != 0 && TARGET_APCS_32) - sprintf (instr, "bx%s\t%%|lr", conditional); + /* Use bx if it's available. */ + if (arm_arch5 || arm_arch4t) + sprintf (instr, "bx%s\t%%|lr", conditional); else - sprintf (instr, "mov%s%s\t%%|pc, %%|lr", - conditional, TARGET_APCS_32 ? "" : "s"); + sprintf (instr, "mov%s\t%%|pc, %%|lr", conditional); break; } @@ -8438,7 +9745,7 @@ arm_poke_function_name (FILE *stream, const char *name) length = strlen (name) + 1; alignlength = ROUND_UP_WORD (length); - + ASM_OUTPUT_ASCII (stream, name, length); ASM_OUTPUT_ALIGN (stream, 2); x = GEN_INT ((unsigned HOST_WIDE_INT) 0xff000000 + alignlength); @@ -8457,13 +9764,12 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) thumb_output_function_prologue (f, frame_size); return; } - + /* Sanity check. */ - if (arm_ccfsm_state || arm_target_insn) - abort (); + gcc_assert (!arm_ccfsm_state && !arm_target_insn); func_type = arm_current_func_type (); - + switch ((int) ARM_FUNC_TYPE (func_type)) { default: @@ -8472,9 +9778,6 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) case ARM_FT_INTERWORKED: asm_fprintf (f, "\t%@ Function supports interworking.\n"); break; - case ARM_FT_EXCEPTION_HANDLER: - asm_fprintf (f, "\t%@ C++ Exception Handler.\n"); - break; case ARM_FT_ISR: asm_fprintf (f, "\t%@ Interrupt Service Routine.\n"); break; @@ -8485,7 +9788,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) asm_fprintf (f, "\t%@ ARM Exception Handler.\n"); break; } - + if (IS_NAKED (func_type)) asm_fprintf (f, "\t%@ Naked Function: prologue and epilogue provided by programmer.\n"); @@ -8494,7 +9797,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) if (IS_NESTED (func_type)) asm_fprintf (f, "\t%@ Nested: function declared inside another function.\n"); - + asm_fprintf (f, "\t%@ args = %d, pretend = %d, frame = %wd\n", current_function_args_size, current_function_pretend_args_size, frame_size); @@ -8506,12 +9809,15 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) if (cfun->machine->lr_save_eliminated) asm_fprintf (f, "\t%@ link register save eliminated.\n"); + if (current_function_calls_eh_return) + asm_fprintf (f, "\t@ Calls __builtin_eh_return.\n"); + #ifdef AOF_ASSEMBLER if (flag_pic) asm_fprintf (f, "\tmov\t%r, %r\n", IP_REGNUM, PIC_OFFSET_TABLE_REGNUM); #endif - return_used_this_function = 0; + return_used_this_function = 0; } const char * @@ -8520,15 +9826,15 @@ arm_output_epilogue (rtx sibling) int reg; unsigned long saved_regs_mask; unsigned long func_type; - /* Floats_offset is the offset from the "virtual" frame. In an APCS + /* Floats_offset is the offset from the "virtual" frame. In an APCS frame that is $fp + 4 for a non-variadic function. */ int floats_offset = 0; rtx operands[3]; - int frame_size = arm_get_frame_size (); FILE * f = asm_out_file; - rtx eh_ofs = cfun->machine->eh_epilogue_sp_ofs; unsigned int lrm_count = 0; int really_return = (sibling == NULL); + int start_reg; + arm_stack_offsets *offsets; /* If we have already generated the return instruction then it is futile to generate anything else. */ @@ -8544,58 +9850,56 @@ arm_output_epilogue (rtx sibling) if (IS_VOLATILE (func_type) && TARGET_ABORT_NORETURN) { rtx op; - + /* A volatile function should never return. Call abort. */ op = gen_rtx_SYMBOL_REF (Pmode, NEED_PLT_RELOC ? "abort(PLT)" : "abort"); assemble_external_libcall (op); output_asm_insn ("bl\t%a0", &op); - + return ""; } - if (ARM_FUNC_TYPE (func_type) == ARM_FT_EXCEPTION_HANDLER - && ! really_return) - /* If we are throwing an exception, then we really must - be doing a return, so we can't tail-call. */ - abort (); - + /* If we are throwing an exception, then we really must be doing a + return, so we can't tail-call. */ + gcc_assert (!current_function_calls_eh_return || really_return); + + offsets = arm_get_frame_offsets (); saved_regs_mask = arm_compute_save_reg_mask (); if (TARGET_IWMMXT) lrm_count = bit_count (saved_regs_mask); - /* XXX We should adjust floats_offset for any anonymous args, and then - re-adjust vfp_offset below to compensate. */ - + floats_offset = offsets->saved_args; /* Compute how far away the floats will be. */ for (reg = 0; reg <= LAST_ARM_REGNUM; reg++) if (saved_regs_mask & (1 << reg)) floats_offset += 4; - + if (frame_pointer_needed) { - int vfp_offset = 4; + /* This variable is for the Virtual Frame Pointer, not VFP regs. */ + int vfp_offset = offsets->frame; if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { floats_offset += 12; - asm_fprintf (f, "\tldfe\t%r, [%r, #-%d]\n", + asm_fprintf (f, "\tldfe\t%r, [%r, #-%d]\n", reg, FP_REGNUM, floats_offset - vfp_offset); } } else { - int start_reg = LAST_ARM_FP_REGNUM; + start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { floats_offset += 12; - + /* We can't unstack more than four registers at once. */ if (start_reg - reg == 3) { @@ -8621,6 +9925,39 @@ arm_output_epilogue (rtx sibling) FP_REGNUM, floats_offset - vfp_offset); } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + int saved_size; + + /* The fldmx insn does not have base+offset addressing modes, + so we use IP to hold the address. */ + saved_size = arm_get_vfp_saved_size (); + + if (saved_size > 0) + { + floats_offset += saved_size; + asm_fprintf (f, "\tsub\t%r, %r, #%d\n", IP_REGNUM, + FP_REGNUM, floats_offset - vfp_offset); + } + start_reg = FIRST_VFP_REGNUM; + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + arm_output_fldmx (f, IP_REGNUM, + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + start_reg = reg + 2; + } + } + if (start_reg != reg) + arm_output_fldmx (f, IP_REGNUM, + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } + if (TARGET_IWMMXT) { /* The frame pointer is guaranteed to be non-double-word aligned. @@ -8631,13 +9968,13 @@ arm_output_epilogue (rtx sibling) We can ignore floats_offset since that was already included in the live_regs_mask. */ lrm_count += (lrm_count % 2 ? 2 : 1); - - for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) + + for (reg = LAST_IWMMXT_REGNUM; reg >= FIRST_IWMMXT_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { - asm_fprintf (f, "\twldrd\t%r, [%r, #-%d]\n", + asm_fprintf (f, "\twldrd\t%r, [%r, #-%d]\n", reg, FP_REGNUM, lrm_count * 4); - lrm_count += 2; + lrm_count += 2; } } @@ -8645,8 +9982,7 @@ arm_output_epilogue (rtx sibling) frame generation actually contains the old stack pointer. So a quick way to unwind the stack is just pop the IP register directly into the stack pointer. */ - if ((saved_regs_mask & (1 << IP_REGNUM)) == 0) - abort (); + gcc_assert (saved_regs_mask & (1 << IP_REGNUM)); saved_regs_mask &= ~ (1 << IP_REGNUM); saved_regs_mask |= (1 << SP_REGNUM); @@ -8654,7 +9990,9 @@ arm_output_epilogue (rtx sibling) only need to restore the LR register (the return address), but to save time we can load it directly into the PC, unless we need a special function exit sequence, or we are not really returning. */ - if (really_return && ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL) + if (really_return + && ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL + && !current_function_calls_eh_return) /* Delete the LR from the register mask, so that the LR on the stack is loaded into the PC in the register mask. */ saved_regs_mask &= ~ (1 << LR_REGNUM); @@ -8670,8 +10008,7 @@ arm_output_epilogue (rtx sibling) be reset correctly to the original value, should an interrupt occur. If the stack pointer already points at the right place, then omit the subtraction. */ - if (((frame_size + current_function_outgoing_args_size + floats_offset) - != 4 * (1 + (int) bit_count (saved_regs_mask))) + if (offsets->outgoing_args != (1 + (int) bit_count (saved_regs_mask)) || current_function_calls_alloca) asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, FP_REGNUM, 4 * bit_count (saved_regs_mask)); @@ -8685,26 +10022,25 @@ arm_output_epilogue (rtx sibling) else { /* Restore stack pointer if necessary. */ - if (frame_size + current_function_outgoing_args_size != 0) + if (offsets->outgoing_args != offsets->saved_regs) { operands[0] = operands[1] = stack_pointer_rtx; - operands[2] = GEN_INT (frame_size - + current_function_outgoing_args_size); + operands[2] = GEN_INT (offsets->outgoing_args - offsets->saved_regs); output_add_immediate (operands); } if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) if (regs_ever_live[reg] && !call_used_regs[reg]) asm_fprintf (f, "\tldfe\t%r, [%r], #12\n", reg, SP_REGNUM); } else { - int start_reg = FIRST_ARM_FP_REGNUM; + start_reg = FIRST_FPA_REGNUM; - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -8721,7 +10057,7 @@ arm_output_epilogue (rtx sibling) asm_fprintf (f, "\tlfmfd\t%r, %d, [%r]!\n", start_reg, reg - start_reg, SP_REGNUM); - + start_reg = reg + 1; } } @@ -8732,16 +10068,37 @@ arm_output_epilogue (rtx sibling) start_reg, reg - start_reg, SP_REGNUM); } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + start_reg = FIRST_VFP_REGNUM; + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + arm_output_fldmx (f, SP_REGNUM, + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + start_reg = reg + 2; + } + } + if (start_reg != reg) + arm_output_fldmx (f, SP_REGNUM, + (start_reg - FIRST_VFP_REGNUM) / 2, + (reg - start_reg) / 2); + } if (TARGET_IWMMXT) for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) if (regs_ever_live[reg] && !call_used_regs[reg]) - asm_fprintf (f, "\twldrd\t%r, [%r, #+8]!\n", reg, SP_REGNUM); + asm_fprintf (f, "\twldrd\t%r, [%r], #8\n", reg, SP_REGNUM); /* If we can, restore the LR into the PC. */ if (ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL && really_return && current_function_pretend_args_size == 0 - && saved_regs_mask & (1 << LR_REGNUM)) + && saved_regs_mask & (1 << LR_REGNUM) + && !current_function_calls_eh_return) { saved_regs_mask &= ~ (1 << LR_REGNUM); saved_regs_mask |= (1 << PC_REGNUM); @@ -8751,18 +10108,13 @@ arm_output_epilogue (rtx sibling) to load use the LDR instruction - it is faster. */ if (saved_regs_mask == (1 << LR_REGNUM)) { - /* The exception handler ignores the LR, so we do - not really need to load it off the stack. */ - if (eh_ofs) - asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); - else - asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); + asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); } else if (saved_regs_mask) { if (saved_regs_mask & (1 << SP_REGNUM)) /* Note - write back to the stack register is not enabled - (ie "ldmfd sp!..."). We know that the stack pointer is + (i.e. "ldmfd sp!..."). We know that the stack pointer is in the list of registers and if we add writeback the instruction becomes UNPREDICTABLE. */ print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); @@ -8779,21 +10131,18 @@ arm_output_epilogue (rtx sibling) } } - if (! really_return - || (ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL - && current_function_pretend_args_size == 0 - && saved_regs_mask & (1 << PC_REGNUM))) + /* We may have already restored PC directly from the stack. */ + if (!really_return || saved_regs_mask & (1 << PC_REGNUM)) return ""; + /* Stack adjustment for exception handler. */ + if (current_function_calls_eh_return) + asm_fprintf (f, "\tadd\t%r, %r, %r\n", SP_REGNUM, SP_REGNUM, + ARM_EH_STACKADJ_REGNUM); + /* Generate the return instruction. */ switch ((int) ARM_FUNC_TYPE (func_type)) { - case ARM_FT_EXCEPTION_HANDLER: - /* Even in 26-bit mode we do a mov (rather than a movs) - because we don't have the PSR bits set in the address. */ - asm_fprintf (f, "\tmov\t%r, %r\n", PC_REGNUM, EXCEPTION_LR_REGNUM); - break; - case ARM_FT_ISR: case ARM_FT_FIQ: asm_fprintf (f, "\tsubs\t%r, %r, #4\n", PC_REGNUM, LR_REGNUM); @@ -8808,21 +10157,10 @@ arm_output_epilogue (rtx sibling) break; default: - if (frame_pointer_needed) - /* If we used the frame pointer then the return address - will have been loaded off the stack directly into the - PC, so there is no need to issue a MOV instruction - here. */ - ; - else if (current_function_pretend_args_size == 0 - && (saved_regs_mask & (1 << LR_REGNUM))) - /* Similarly we may have been able to load LR into the PC - even if we did not create a stack frame. */ - ; - else if (TARGET_APCS_32) - asm_fprintf (f, "\tmov\t%r, %r\n", PC_REGNUM, LR_REGNUM); + if (arm_arch5 || arm_arch4t) + asm_fprintf (f, "\tbx\t%r\n", LR_REGNUM); else - asm_fprintf (f, "\tmovs\t%r, %r\n", PC_REGNUM, LR_REGNUM); + asm_fprintf (f, "\tmov\t%r, %r\n", PC_REGNUM, LR_REGNUM); break; } @@ -8831,10 +10169,29 @@ arm_output_epilogue (rtx sibling) static void arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, - HOST_WIDE_INT frame_size) + HOST_WIDE_INT frame_size ATTRIBUTE_UNUSED) { + arm_stack_offsets *offsets; + if (TARGET_THUMB) { + int regno; + + /* Emit any call-via-reg trampolines that are needed for v4t support + of call_reg and call_value_reg type insns. */ + for (regno = 0; regno < LR_REGNUM; regno++) + { + rtx label = cfun->machine->call_via[regno]; + + if (label != NULL) + { + switch_to_section (function_section (current_function_decl)); + targetm.asm_out.internal_label (asm_out_file, "L", + CODE_LABEL_NUMBER (label)); + asm_fprintf (asm_out_file, "\tbx\t%r\n", regno); + } + } + /* ??? Probably not safe to set this here, since it assumes that a function will be emitted as assembly immediately after we generate RTL for it. This does not happen for inline functions. */ @@ -8843,13 +10200,12 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, else { /* We need to take into account any stack-frame rounding. */ - frame_size = arm_get_frame_size (); + offsets = arm_get_frame_offsets (); - if (use_return_insn (FALSE, NULL) - && return_used_this_function - && (frame_size + current_function_outgoing_args_size) != 0 - && !frame_pointer_needed) - abort (); + gcc_assert (!use_return_insn (FALSE, NULL) + || !return_used_this_function + || offsets->saved_regs == offsets->outgoing_args + || frame_pointer_needed); /* Reset the ARM-specific per-function variables. */ after_arm_reorg = 0; @@ -8861,7 +10217,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, semantics of the operation, we need to annotate the insn for the benefit of DWARF2 frame unwind information. */ static rtx -emit_multi_reg_push (int mask) +emit_multi_reg_push (unsigned long mask) { int num_regs = 0; int num_dwarf_regs; @@ -8875,8 +10231,7 @@ emit_multi_reg_push (int mask) if (mask & (1 << i)) num_regs++; - if (num_regs == 0 || num_regs > 16) - abort (); + gcc_assert (num_regs && num_regs <= 16); /* We don't record the PC in the dwarf frame information. */ num_dwarf_regs = num_regs; @@ -8888,7 +10243,7 @@ emit_multi_reg_push (int mask) by the push_multi pattern in the arm.md file. The insn looks something like this: - (parallel [ + (parallel [ (set (mem:BLK (pre_dec:BLK (reg:SI sp))) (unspec:BLK [(reg:SI r4)] UNSPEC_PUSH_MULT)) (use (reg:SI 11 fp)) @@ -8904,7 +10259,7 @@ emit_multi_reg_push (int mask) stack decrement per instruction. The RTL we generate for the note looks something like this: - (sequence [ + (sequence [ (set (reg:SI sp) (plus:SI (reg:SI sp) (const_int -20))) (set (mem:SI (reg:SI sp)) (reg:SI r4)) (set (mem:SI (plus:SI (reg:SI sp) (const_int 4))) (reg:SI fp)) @@ -8914,7 +10269,7 @@ emit_multi_reg_push (int mask) This sequence is used both by the code to support stack unwinding for exceptions handlers and the code to generate dwarf2 frame debugging. */ - + par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num_regs)); dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (num_dwarf_regs + 1)); dwarf_par_index = 1; @@ -8927,9 +10282,9 @@ emit_multi_reg_push (int mask) XVECEXP (par, 0, 0) = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (BLKmode, - gen_rtx_PRE_DEC (BLKmode, - stack_pointer_rtx)), + gen_frame_mem (BLKmode, + gen_rtx_PRE_DEC (BLKmode, + stack_pointer_rtx)), gen_rtx_UNSPEC (BLKmode, gen_rtvec (1, reg), UNSPEC_PUSH_MULT)); @@ -8937,7 +10292,7 @@ emit_multi_reg_push (int mask) if (i != PC_REGNUM) { tmp = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (SImode, stack_pointer_rtx), + gen_frame_mem (SImode, stack_pointer_rtx), reg); RTX_FRAME_RELATED_P (tmp) = 1; XVECEXP (dwarf, 0, dwarf_par_index) = tmp; @@ -8958,11 +10313,12 @@ emit_multi_reg_push (int mask) if (i != PC_REGNUM) { - tmp = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (SImode, + tmp + = gen_rtx_SET (VOIDmode, + gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, 4 * j)), - reg); + reg); RTX_FRAME_RELATED_P (tmp) = 1; XVECEXP (dwarf, 0, dwarf_par_index++) = tmp; } @@ -8972,20 +10328,32 @@ emit_multi_reg_push (int mask) } par = emit_insn (par); - - tmp = gen_rtx_SET (SImode, + + tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx, - gen_rtx_PLUS (SImode, - stack_pointer_rtx, - GEN_INT (-4 * num_regs))); + plus_constant (stack_pointer_rtx, -4 * num_regs)); RTX_FRAME_RELATED_P (tmp) = 1; XVECEXP (dwarf, 0, 0) = tmp; - + REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, REG_NOTES (par)); return par; } +/* Calculate the size of the return value that is passed in registers. */ +static int +arm_size_return_regs (void) +{ + enum machine_mode mode; + + if (current_function_return_rtx != 0) + mode = GET_MODE (current_function_return_rtx); + else + mode = DECL_MODE (DECL_RESULT (current_function_decl)); + + return GET_MODE_SIZE (mode); +} + static rtx emit_sfm (int base_reg, int count) { @@ -8995,48 +10363,67 @@ emit_sfm (int base_reg, int count) int i; par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); - dwarf = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); + dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1)); reg = gen_rtx_REG (XFmode, base_reg++); XVECEXP (par, 0, 0) - = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (BLKmode, - gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)), + = gen_rtx_SET (VOIDmode, + gen_frame_mem (BLKmode, + gen_rtx_PRE_DEC (BLKmode, + stack_pointer_rtx)), gen_rtx_UNSPEC (BLKmode, gen_rtvec (1, reg), UNSPEC_PUSH_MULT)); - tmp - = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (XFmode, - gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)), - reg); + tmp = gen_rtx_SET (VOIDmode, + gen_frame_mem (XFmode, stack_pointer_rtx), reg); RTX_FRAME_RELATED_P (tmp) = 1; - XVECEXP (dwarf, 0, count - 1) = tmp; - + XVECEXP (dwarf, 0, 1) = tmp; + for (i = 1; i < count; i++) { reg = gen_rtx_REG (XFmode, base_reg++); XVECEXP (par, 0, i) = gen_rtx_USE (VOIDmode, reg); - tmp = gen_rtx_SET (VOIDmode, - gen_rtx_MEM (XFmode, - gen_rtx_PRE_DEC (BLKmode, - stack_pointer_rtx)), + tmp = gen_rtx_SET (VOIDmode, + gen_frame_mem (XFmode, + plus_constant (stack_pointer_rtx, + i * 12)), reg); RTX_FRAME_RELATED_P (tmp) = 1; - XVECEXP (dwarf, 0, count - i - 1) = tmp; + XVECEXP (dwarf, 0, i + 1) = tmp; } + tmp = gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, -12 * count)); + + RTX_FRAME_RELATED_P (tmp) = 1; + XVECEXP (dwarf, 0, 0) = tmp; + par = emit_insn (par); REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, REG_NOTES (par)); return par; } + +/* Return true if the current function needs to save/restore LR. */ + +static bool +thumb_force_lr_save (void) +{ + return !cfun->machine->lr_save_eliminated + && (!leaf_function_p () + || thumb_far_jump_used_p () + || regs_ever_live [LR_REGNUM]); +} + + /* Compute the distance from register FROM to register TO. These can be the arg pointer (26), the soft frame pointer (25), the stack pointer (13) or the hard frame pointer (11). + In thumb mode r7 is used as the soft frame pointer, if needed. Typical stack layout looks like this: old stack pointer -> | | @@ -9059,7 +10446,7 @@ emit_sfm (int base_reg, int count) | | \ | | local | | variables - | | / + locals base pointer -> | | / -- | | \ | | outgoing @@ -9076,60 +10463,131 @@ emit_sfm (int base_reg, int count) The sign of the number returned reflects the direction of stack growth, so the values are positive for all eliminations except - from the soft frame pointer to the hard frame pointer. */ -unsigned int -arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) + from the soft frame pointer to the hard frame pointer. + + SFP may point just inside the local variables block to ensure correct + alignment. */ + + +/* Calculate stack offsets. These are used to calculate register elimination + offsets and in prologue/epilogue code. */ + +static arm_stack_offsets * +arm_get_frame_offsets (void) { - unsigned int local_vars = arm_get_frame_size (); - unsigned int outgoing_args = current_function_outgoing_args_size; - unsigned int stack_frame; - unsigned int call_saved_registers; + struct arm_stack_offsets *offsets; unsigned long func_type; - - func_type = arm_current_func_type (); + int leaf; + int saved; + HOST_WIDE_INT frame_size; - /* Volatile functions never return, so there is - no need to save call saved registers. */ - call_saved_registers = 0; - if (! IS_VOLATILE (func_type)) + offsets = &cfun->machine->stack_offsets; + + /* We need to know if we are a leaf function. Unfortunately, it + is possible to be called after start_sequence has been called, + which causes get_insns to return the insns for the sequence, + not the function, which will cause leaf_function_p to return + the incorrect result. + + to know about leaf functions once reload has completed, and the + frame size cannot be changed after that time, so we can safely + use the cached value. */ + + if (reload_completed) + return offsets; + + /* Initially this is the size of the local variables. It will translated + into an offset once we have determined the size of preceding data. */ + frame_size = ROUND_UP_WORD (get_frame_size ()); + + leaf = leaf_function_p (); + + /* Space for variadic functions. */ + offsets->saved_args = current_function_pretend_args_size; + + offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0); + + if (TARGET_ARM) { - unsigned int reg_mask; - unsigned int reg; + unsigned int regno; - /* Make sure that we compute which registers will be saved - on the stack using the same algorithm that is used by - the prologue creation code. */ - reg_mask = arm_compute_save_reg_mask (); + saved = bit_count (arm_compute_save_reg_mask ()) * 4; - /* Now count the number of bits set in save_reg_mask. - If we have already counted the registers in the stack - frame, do not count them again. Non call-saved registers - might be saved in the call-save area of the stack, if - doing so will preserve the stack's alignment. Hence we - must count them here. For each set bit we need 4 bytes - of stack space. */ - if (frame_pointer_needed) - reg_mask &= 0x07ff; - call_saved_registers += 4 * bit_count (reg_mask); - - /* If the hard floating point registers are going to be - used then they must be saved on the stack as well. - Each register occupies 12 bytes of stack space. */ - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) - if (regs_ever_live[reg] && ! call_used_regs[reg]) - call_saved_registers += 12; + /* We know that SP will be doubleword aligned on entry, and we must + preserve that condition at any subroutine call. We also require the + soft frame pointer to be doubleword aligned. */ if (TARGET_REALLY_IWMMXT) - /* Check for the call-saved iWMMXt registers. */ - for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) - if (regs_ever_live[reg] && ! call_used_regs [reg]) - call_saved_registers += 8; + { + /* Check for the call-saved iWMMXt registers. */ + for (regno = FIRST_IWMMXT_REGNUM; + regno <= LAST_IWMMXT_REGNUM; + regno++) + if (regs_ever_live [regno] && ! call_used_regs [regno]) + saved += 8; + } + + func_type = arm_current_func_type (); + if (! IS_VOLATILE (func_type)) + { + /* Space for saved FPA registers. */ + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) + if (regs_ever_live[regno] && ! call_used_regs[regno]) + saved += 12; + + /* Space for saved VFP registers. */ + if (TARGET_HARD_FLOAT && TARGET_VFP) + saved += arm_get_vfp_saved_size (); + } + } + else /* TARGET_THUMB */ + { + saved = bit_count (thumb_compute_save_reg_mask ()) * 4; + if (TARGET_BACKTRACE) + saved += 16; } - /* The stack frame contains 4 registers - the old frame pointer, - the old stack pointer, the return address and PC of the start - of the function. */ - stack_frame = frame_pointer_needed ? 16 : 0; + /* Saved registers include the stack frame. */ + offsets->saved_regs = offsets->saved_args + saved; + offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE; + /* A leaf function does not need any stack alignment if it has nothing + on the stack. */ + if (leaf && frame_size == 0) + { + offsets->outgoing_args = offsets->soft_frame; + return offsets; + } + + /* Ensure SFP has the correct alignment. */ + if (ARM_DOUBLEWORD_ALIGN + && (offsets->soft_frame & 7)) + offsets->soft_frame += 4; + + offsets->locals_base = offsets->soft_frame + frame_size; + offsets->outgoing_args = (offsets->locals_base + + current_function_outgoing_args_size); + + if (ARM_DOUBLEWORD_ALIGN) + { + /* Ensure SP remains doubleword aligned. */ + if (offsets->outgoing_args & 7) + offsets->outgoing_args += 4; + gcc_assert (!(offsets->outgoing_args & 7)); + } + + return offsets; +} + + +/* Calculate the relative offsets for the different stack pointers. Positive + offsets are in the direction of stack growth. */ + +HOST_WIDE_INT +arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) +{ + arm_stack_offsets *offsets; + + offsets = arm_get_frame_offsets (); /* OK, now we have enough information to compute the distances. There must be an entry in these switch tables for each pair @@ -9146,29 +10604,27 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) case FRAME_POINTER_REGNUM: /* This is the reverse of the soft frame pointer to hard frame pointer elimination below. */ - if (call_saved_registers == 0 && stack_frame == 0) - return 0; - return (call_saved_registers + stack_frame - 4); + return offsets->soft_frame - offsets->saved_args; case ARM_HARD_FRAME_POINTER_REGNUM: /* If there is no stack frame then the hard frame pointer and the arg pointer coincide. */ - if (stack_frame == 0 && call_saved_registers != 0) + if (offsets->frame == offsets->saved_regs) return 0; /* FIXME: Not sure about this. Maybe we should always return 0 ? */ return (frame_pointer_needed - && current_function_needs_context + && cfun->static_chain_decl != NULL && ! cfun->machine->uses_anonymous_args) ? 4 : 0; case STACK_POINTER_REGNUM: /* If nothing has been pushed on the stack at all then this will return -4. This *is* correct! */ - return call_saved_registers + stack_frame + local_vars + outgoing_args - 4; + return offsets->outgoing_args - (offsets->saved_args + 4); default: - abort (); + gcc_unreachable (); } - break; + gcc_unreachable (); case FRAME_POINTER_REGNUM: switch (to) @@ -9181,17 +10637,16 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) stack frame. The soft frame pointer to the bottom entry in the stack frame. If there is no stack frame at all, then they are identical. */ - if (call_saved_registers == 0 && stack_frame == 0) - return 0; - return - (call_saved_registers + stack_frame - 4); + + return offsets->frame - offsets->soft_frame; case STACK_POINTER_REGNUM: - return local_vars + outgoing_args; + return offsets->outgoing_args - offsets->soft_frame; default: - abort (); + gcc_unreachable (); } - break; + gcc_unreachable (); default: /* You cannot eliminate from the stack pointer. @@ -9199,89 +10654,10 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) pointer to the stack pointer, but this will never happen, since if a stack frame is not needed the hard frame pointer will never be used. */ - abort (); + gcc_unreachable (); } } -/* Calculate the size of the stack frame, taking into account any - padding that is required to ensure stack-alignment. */ -HOST_WIDE_INT -arm_get_frame_size (void) -{ - int regno; - - int base_size = ROUND_UP_WORD (get_frame_size ()); - int entry_size = 0; - unsigned long func_type = arm_current_func_type (); - int leaf; - - if (! TARGET_ARM) - abort(); - - if (! TARGET_ATPCS) - return base_size; - - /* We need to know if we are a leaf function. Unfortunately, it - is possible to be called after start_sequence has been called, - which causes get_insns to return the insns for the sequence, - not the function, which will cause leaf_function_p to return - the incorrect result. - - To work around this, we cache the computed frame size. This - works because we will only be calling RTL expanders that need - to know about leaf functions once reload has completed, and the - frame size cannot be changed after that time, so we can safely - use the cached value. */ - - if (reload_completed) - return cfun->machine->frame_size; - - leaf = leaf_function_p (); - - /* A leaf function does not need any stack alignment if it has nothing - on the stack. */ - if (leaf && base_size == 0) - { - cfun->machine->frame_size = 0; - return 0; - } - - /* We know that SP will be word aligned on entry, and we must - preserve that condition at any subroutine call. But those are - the only constraints. */ - - /* Space for variadic functions. */ - if (current_function_pretend_args_size) - entry_size += current_function_pretend_args_size; - - /* Space for saved registers. */ - entry_size += bit_count (arm_compute_save_reg_mask ()) * 4; - - /* Space for saved FPA registers. */ - if (! IS_VOLATILE (func_type)) - { - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) - if (regs_ever_live[regno] && ! call_used_regs[regno]) - entry_size += 12; - } - - if (TARGET_REALLY_IWMMXT) - { - /* Check for the call-saved iWMMXt registers. */ - for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++) - if (regs_ever_live [regno] && ! call_used_regs [regno]) - entry_size += 8; - } - - if ((entry_size + base_size + current_function_outgoing_args_size) & 7) - base_size += 4; - if ((entry_size + base_size + current_function_outgoing_args_size) & 7) - abort (); - - cfun->machine->frame_size = base_size; - - return base_size; -} /* Generate the prologue instructions for entry into an ARM function. */ void @@ -9295,7 +10671,9 @@ arm_expand_prologue (void) unsigned long func_type; int fp_offset = 0; int saved_pretend_args = 0; - unsigned int args_to_push; + int saved_regs = 0; + unsigned HOST_WIDE_INT args_to_push; + arm_stack_offsets *offsets; func_type = arm_current_func_type (); @@ -9305,7 +10683,7 @@ arm_expand_prologue (void) /* Make a copy of c_f_p_a_s as we may need to modify it locally. */ args_to_push = current_function_pretend_args_size; - + /* Compute which register we will have to save onto the stack. */ live_regs_mask = arm_compute_save_reg_mask (); @@ -9325,7 +10703,7 @@ arm_expand_prologue (void) stack decrement per function, and this is not it. If this instruction is labeled as being part of the frame creation sequence then dwarf2out_frame_debug_expr will - abort when it encounters the assignment of IP to FP + die when it encounters the assignment of IP to FP later on, since the use of SP here establishes SP as the CFA register and not IP. @@ -9339,7 +10717,7 @@ arm_expand_prologue (void) To get around this need to find somewhere to store IP whilst the frame is being created. We try the following places in order: - + 1. The last argument register. 2. A slot on the stack above the frame. (This only works if the function is not a varargs function). @@ -9352,25 +10730,19 @@ arm_expand_prologue (void) inherited from the caller. */ if (regs_ever_live[3] == 0) - { - insn = gen_rtx_REG (SImode, 3); - insn = gen_rtx_SET (SImode, insn, ip_rtx); - insn = emit_insn (insn); - } + insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx); else if (args_to_push == 0) { rtx dwarf; - insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx); - insn = gen_rtx_MEM (SImode, insn); - insn = gen_rtx_SET (VOIDmode, insn, ip_rtx); - insn = emit_insn (insn); + insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx); + insn = emit_set_insn (gen_frame_mem (SImode, insn), ip_rtx); fp_offset = 4; /* Just tell the dwarf backend that we adjusted SP. */ dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx, - gen_rtx_PLUS (SImode, stack_pointer_rtx, - GEN_INT (-fp_offset))); + plus_constant (stack_pointer_rtx, + -fp_offset)); RTX_FRAME_RELATED_P (insn) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, REG_NOTES (insn)); @@ -9383,7 +10755,7 @@ arm_expand_prologue (void) ((0xf0 >> (args_to_push / 4)) & 0xf); else insn = emit_insn - (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (- args_to_push))); RTX_FRAME_RELATED_P (insn) = 1; @@ -9393,21 +10765,12 @@ arm_expand_prologue (void) args_to_push = 0; /* Now reuse r3 to preserve IP. */ - insn = gen_rtx_REG (SImode, 3); - insn = gen_rtx_SET (SImode, insn, ip_rtx); - (void) emit_insn (insn); + emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx); } } - if (fp_offset) - { - insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset)); - insn = gen_rtx_SET (SImode, ip_rtx, insn); - } - else - insn = gen_movsi (ip_rtx, stack_pointer_rtx); - - insn = emit_insn (insn); + insn = emit_set_insn (ip_rtx, + plus_constant (stack_pointer_rtx, fp_offset)); RTX_FRAME_RELATED_P (insn) = 1; } @@ -9419,7 +10782,7 @@ arm_expand_prologue (void) ((0xf0 >> (args_to_push / 4)) & 0xf); else insn = emit_insn - (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (- args_to_push))); RTX_FRAME_RELATED_P (insn) = 1; } @@ -9432,50 +10795,53 @@ arm_expand_prologue (void) if ((func_type == ARM_FT_ISR || func_type == ARM_FT_FIQ) && (live_regs_mask & (1 << LR_REGNUM)) != 0 && ! frame_pointer_needed) - emit_insn (gen_rtx_SET (SImode, - gen_rtx_REG (SImode, LR_REGNUM), - gen_rtx_PLUS (SImode, - gen_rtx_REG (SImode, LR_REGNUM), - GEN_INT (-4)))); + { + rtx lr = gen_rtx_REG (SImode, LR_REGNUM); + + emit_set_insn (lr, plus_constant (lr, -4)); + } if (live_regs_mask) { insn = emit_multi_reg_push (live_regs_mask); + saved_regs += bit_count (live_regs_mask) * 4; RTX_FRAME_RELATED_P (insn) = 1; } if (TARGET_IWMMXT) - for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++) + for (reg = LAST_IWMMXT_REGNUM; reg >= FIRST_IWMMXT_REGNUM; reg--) if (regs_ever_live[reg] && ! call_used_regs [reg]) { insn = gen_rtx_PRE_DEC (V2SImode, stack_pointer_rtx); - insn = gen_rtx_MEM (V2SImode, insn); - insn = emit_insn (gen_rtx_SET (VOIDmode, insn, - gen_rtx_REG (V2SImode, reg))); + insn = gen_frame_mem (V2SImode, insn); + insn = emit_set_insn (insn, gen_rtx_REG (V2SImode, reg)); RTX_FRAME_RELATED_P (insn) = 1; + saved_regs += 8; } if (! IS_VOLATILE (func_type)) { + int start_reg; + /* Save any floating point call-saved registers used by this function. */ if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { insn = gen_rtx_PRE_DEC (XFmode, stack_pointer_rtx); - insn = gen_rtx_MEM (XFmode, insn); - insn = emit_insn (gen_rtx_SET (VOIDmode, insn, - gen_rtx_REG (XFmode, reg))); + insn = gen_frame_mem (XFmode, insn); + insn = emit_set_insn (insn, gen_rtx_REG (XFmode, reg)); RTX_FRAME_RELATED_P (insn) = 1; + saved_regs += 12; } } else { - int start_reg = LAST_ARM_FP_REGNUM; + start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -9483,6 +10849,7 @@ arm_expand_prologue (void) { insn = emit_sfm (reg, 4); RTX_FRAME_RELATED_P (insn) = 1; + saved_regs += 48; start_reg = reg - 1; } } @@ -9492,6 +10859,7 @@ arm_expand_prologue (void) { insn = emit_sfm (reg + 1, start_reg - reg); RTX_FRAME_RELATED_P (insn) = 1; + saved_regs += (start_reg - reg) * 12; } start_reg = reg - 1; } @@ -9500,9 +10868,29 @@ arm_expand_prologue (void) if (start_reg != reg) { insn = emit_sfm (reg + 1, start_reg - reg); + saved_regs += (start_reg - reg) * 12; RTX_FRAME_RELATED_P (insn) = 1; } } + if (TARGET_HARD_FLOAT && TARGET_VFP) + { + start_reg = FIRST_VFP_REGNUM; + + for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2) + { + if ((!regs_ever_live[reg] || call_used_regs[reg]) + && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1])) + { + if (start_reg != reg) + saved_regs += vfp_emit_fstmx (start_reg, + (reg - start_reg) / 2); + start_reg = reg + 2; + } + } + if (start_reg != reg) + saved_regs += vfp_emit_fstmx (start_reg, + (reg - start_reg) / 2); + } } if (frame_pointer_needed) @@ -9511,7 +10899,7 @@ arm_expand_prologue (void) insn = GEN_INT (-(4 + args_to_push + fp_offset)); insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn)); RTX_FRAME_RELATED_P (insn) = 1; - + if (IS_NESTED (func_type)) { /* Recover the static chain register. */ @@ -9520,25 +10908,26 @@ arm_expand_prologue (void) insn = gen_rtx_REG (SImode, 3); else /* if (current_function_pretend_args_size == 0) */ { - insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, - GEN_INT (4)); - insn = gen_rtx_MEM (SImode, insn); + insn = plus_constant (hard_frame_pointer_rtx, 4); + insn = gen_frame_mem (SImode, insn); } - emit_insn (gen_rtx_SET (SImode, ip_rtx, insn)); + emit_set_insn (ip_rtx, insn); /* Add a USE to stop propagate_one_insn() from barfing. */ emit_insn (gen_prologue_use (ip_rtx)); } } - amount = GEN_INT (-(arm_get_frame_size () - + current_function_outgoing_args_size)); - - if (amount != const0_rtx) + offsets = arm_get_frame_offsets (); + if (offsets->outgoing_args != offsets->saved_args + saved_regs) { /* This add can produce multiple insns for a large constant, so we need to get tricky. */ rtx last = get_last_insn (); + + amount = GEN_INT (offsets->saved_args + saved_regs + - offsets->outgoing_args); + insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, amount)); do @@ -9556,10 +10945,17 @@ arm_expand_prologue (void) hard_frame_pointer_rtx)); } + + if (flag_pic && arm_pic_register != INVALID_REGNUM) + arm_load_pic_register (0UL); + /* If we are profiling, make sure no instructions are scheduled before the call to mcount. Similarly if the user has requested no - scheduling in the prolog. */ - if (current_function_profile || TARGET_NO_SCHED_PRO) + scheduling in the prolog. Similarly if we want non-call exceptions + using the EABI unwinder, to prevent faulting instructions from being + swapped with a stack adjustment. */ + if (current_function_profile || !TARGET_SCHED_PROLOG + || (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions)) emit_insn (gen_blockage ()); /* If the link register is being kept alive, with the return address in it, @@ -9596,7 +10992,7 @@ arm_print_operand (FILE *stream, rtx x, int code) case '_': fputs (user_label_prefix, stream); return; - + case '|': fputs (REGISTER_PREFIX, stream); return; @@ -9604,8 +11000,17 @@ arm_print_operand (FILE *stream, rtx x, int code) case '?': if (arm_ccfsm_state == 3 || arm_ccfsm_state == 4) { - if (TARGET_THUMB || current_insn_predicate != NULL) - abort (); + if (TARGET_THUMB) + { + output_operand_lossage ("predicated Thumb instruction"); + break; + } + if (current_insn_predicate != NULL) + { + output_operand_lossage + ("predicated instruction in conditional sequence"); + break; + } fputs (arm_condition_codes[arm_current_cc], stream); } @@ -9614,7 +11019,10 @@ arm_print_operand (FILE *stream, rtx x, int code) enum arm_cond_code code; if (TARGET_THUMB) - abort (); + { + output_operand_lossage ("predicated Thumb instruction"); + break; + } code = get_arm_condition_code (current_insn_predicate); fputs (arm_condition_codes[code], stream); @@ -9665,11 +11073,19 @@ arm_print_operand (FILE *stream, rtx x, int code) case 'S': { HOST_WIDE_INT val; - const char * shift = shift_op (x, &val); + const char *shift; + + if (!shift_operator (x, SImode)) + { + output_operand_lossage ("invalid shift operand"); + break; + } + + shift = shift_op (x, &val); if (shift) { - fprintf (stream, ", %s ", shift_op (x, &val)); + fprintf (stream, ", %s ", shift); if (val == -1) arm_print_operand (stream, XEXP (x, 1), 0); else @@ -9679,19 +11095,19 @@ arm_print_operand (FILE *stream, rtx x, int code) return; /* An explanation of the 'Q', 'R' and 'H' register operands: - + In a pair of registers containing a DI or DF value the 'Q' operand returns the register number of the register containing the least significant part of the value. The 'R' operand returns the register number of the register containing the most significant part of the value. - + The 'H' operand returns the higher of the two register numbers. On a run where WORDS_BIG_ENDIAN is true the 'H' operand is the same as the 'Q' operand, since the most significant part of the value is held in the lower number register. The reverse is true on systems where WORDS_BIG_ENDIAN is false. - + The purpose of these operands is to distinguish between cases where the endian-ness of the values is important (for example when they are added together), and cases where the endian-ness @@ -9706,25 +11122,37 @@ arm_print_operand (FILE *stream, rtx x, int code) of the memory location is actually held in one of the registers being overwritten by the load. */ case 'Q': - if (REGNO (x) > LAST_ARM_REGNUM) - abort (); + if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 1 : 0)); return; case 'R': - if (REGNO (x) > LAST_ARM_REGNUM) - abort (); + if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + asm_fprintf (stream, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 0 : 1)); return; case 'H': - if (REGNO (x) > LAST_ARM_REGNUM) - abort (); + if (GET_CODE (x) != REG || REGNO (x) > LAST_ARM_REGNUM) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + asm_fprintf (stream, "%r", REGNO (x) + 1); return; case 'm': - asm_fprintf (stream, "%r", + asm_fprintf (stream, "%r", GET_CODE (XEXP (x, 0)) == REG ? REGNO (XEXP (x, 0)) : REGNO (XEXP (XEXP (x, 0), 0))); return; @@ -9739,16 +11167,30 @@ arm_print_operand (FILE *stream, rtx x, int code) /* CONST_TRUE_RTX means always -- that's the default. */ if (x == const_true_rtx) return; - + + if (!COMPARISON_P (x)) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + fputs (arm_condition_codes[get_arm_condition_code (x)], stream); return; case 'D': - /* CONST_TRUE_RTX means not always -- ie never. We shouldn't ever + /* CONST_TRUE_RTX means not always -- i.e. never. We shouldn't ever want to do that. */ if (x == const_true_rtx) - abort (); + { + output_operand_lossage ("instruction never exectued"); + return; + } + if (!COMPARISON_P (x)) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } fputs (arm_condition_codes[ARM_INVERSE_CONDITION_CODE (get_arm_condition_code (x))], @@ -9764,8 +11206,8 @@ arm_print_operand (FILE *stream, rtx x, int code) case 'X': /* Cirrus register in D mode. */ case 'Y': /* Cirrus register in FX mode. */ case 'Z': /* Cirrus register in DX mode. */ - if (GET_CODE (x) != REG || REGNO_REG_CLASS (REGNO (x)) != CIRRUS_REGS) - abort (); + gcc_assert (GET_CODE (x) == REG + && REGNO_REG_CLASS (REGNO (x)) == CIRRUS_REGS); fprintf (stream, "mv%s%s", code == 'W' ? "f" @@ -9780,7 +11222,10 @@ arm_print_operand (FILE *stream, rtx x, int code) int mode = GET_MODE (x); if (GET_CODE (x) != REG || REGNO_REG_CLASS (REGNO (x)) != CIRRUS_REGS) - abort (); + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } fprintf (stream, "mv%s%s", mode == DFmode ? "d" @@ -9796,7 +11241,11 @@ arm_print_operand (FILE *stream, rtx x, int code) || REGNO (x) < FIRST_IWMMXT_GR_REGNUM || REGNO (x) > LAST_IWMMXT_GR_REGNUM) /* Bad value for wCG register number. */ - abort (); + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + else fprintf (stream, "%d", REGNO (x) - FIRST_IWMMXT_GR_REGNUM); return; @@ -9807,7 +11256,11 @@ arm_print_operand (FILE *stream, rtx x, int code) || INTVAL (x) < 0 || INTVAL (x) >= 16) /* Bad value for wC register number. */ - abort (); + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + else { static const char * wc_reg_names [16] = @@ -9817,30 +11270,68 @@ arm_print_operand (FILE *stream, rtx x, int code) "wCGR0", "wCGR1", "wCGR2", "wCGR3", "wC12", "wC13", "wC14", "wC15" }; - + fprintf (stream, wc_reg_names [INTVAL (x)]); } return; + /* Print a VFP double precision register name. */ + case 'P': + { + int mode = GET_MODE (x); + int num; + + if (mode != DImode && mode != DFmode) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + + if (GET_CODE (x) != REG + || !IS_VFP_REGNUM (REGNO (x))) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + + num = REGNO(x) - FIRST_VFP_REGNUM; + if (num & 1) + { + output_operand_lossage ("invalid operand for code '%c'", code); + return; + } + + fprintf (stream, "d%d", num >> 1); + } + return; + default: if (x == 0) - abort (); - - if (GET_CODE (x) == REG) - asm_fprintf (stream, "%r", REGNO (x)); - else if (GET_CODE (x) == MEM) { + output_operand_lossage ("missing operand"); + return; + } + + switch (GET_CODE (x)) + { + case REG: + asm_fprintf (stream, "%r", REGNO (x)); + break; + + case MEM: output_memory_reference_mode = GET_MODE (x); output_address (XEXP (x, 0)); - } - else if (GET_CODE (x) == CONST_DOUBLE) - fprintf (stream, "#%s", fp_immediate_constant (x)); - else if (GET_CODE (x) == NEG) - abort (); /* This should never happen now. */ - else - { + break; + + case CONST_DOUBLE: + fprintf (stream, "#%s", fp_immediate_constant (x)); + break; + + default: + gcc_assert (GET_CODE (x) != NEG); fputc ('#', stream); output_addr_const (stream, x); + break; } } } @@ -9874,12 +11365,11 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) return true; } - if (VECTOR_MODE_SUPPORTED_P (GET_MODE (x))) + if (arm_vector_mode_supported_p (GET_MODE (x))) { int i, units; - if (GET_CODE (x) != CONST_VECTOR) - abort (); + gcc_assert (GET_CODE (x) == CONST_VECTOR); units = CONST_VECTOR_NUNITS (x); @@ -9889,7 +11379,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) case V4HImode: size = 2; break; case V8QImode: size = 1; break; default: - abort (); + gcc_unreachable (); } for (i = 0; i < units; i++) @@ -9906,6 +11396,26 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) return default_assemble_integer (x, size, aligned_p); } + + +/* Add a function to the list of static constructors. */ + +static void +arm_elf_asm_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) +{ + if (!TARGET_AAPCS_BASED) + { + default_named_section_asm_out_constructor (symbol, priority); + return; + } + + /* Put these in the .init_array section, using a special relocation. */ + switch_to_section (ctors_section); + assemble_align (POINTER_SIZE); + fputs ("\t.word\t", asm_out_file); + output_addr_const (asm_out_file, symbol); + fputs ("(target1)\n", asm_out_file); +} #endif /* A finite state machine takes care of noticing whether or not instructions @@ -9967,8 +11477,7 @@ get_arm_condition_code (rtx comparison) case CC_DLTUmode: code = ARM_CC; dominance: - if (comp_code != EQ && comp_code != NE) - abort (); + gcc_assert (comp_code == EQ || comp_code == NE); if (comp_code == EQ) return ARM_INVERSE_CONDITION_CODE (code); @@ -9981,7 +11490,7 @@ get_arm_condition_code (rtx comparison) case EQ: return ARM_EQ; case GE: return ARM_PL; case LT: return ARM_MI; - default: abort (); + default: gcc_unreachable (); } case CC_Zmode: @@ -9989,7 +11498,7 @@ get_arm_condition_code (rtx comparison) { case NE: return ARM_NE; case EQ: return ARM_EQ; - default: abort (); + default: gcc_unreachable (); } case CC_Nmode: @@ -9997,7 +11506,7 @@ get_arm_condition_code (rtx comparison) { case NE: return ARM_MI; case EQ: return ARM_PL; - default: abort (); + default: gcc_unreachable (); } case CCFPEmode: @@ -10022,7 +11531,7 @@ get_arm_condition_code (rtx comparison) /* UNEQ and LTGT do not have a representation. */ case UNEQ: /* Fall through. */ case LTGT: /* Fall through. */ - default: abort (); + default: gcc_unreachable (); } case CC_SWPmode: @@ -10038,7 +11547,7 @@ get_arm_condition_code (rtx comparison) case GTU: return ARM_CC; case LEU: return ARM_CS; case LTU: return ARM_HI; - default: abort (); + default: gcc_unreachable (); } case CC_Cmode: @@ -10046,9 +11555,9 @@ get_arm_condition_code (rtx comparison) { case LTU: return ARM_CS; case GEU: return ARM_CC; - default: abort (); + default: gcc_unreachable (); } - + case CCmode: switch (comp_code) { @@ -10062,13 +11571,11 @@ get_arm_condition_code (rtx comparison) case GTU: return ARM_HI; case LEU: return ARM_LS; case LTU: return ARM_CC; - default: abort (); + default: gcc_unreachable (); } - default: abort (); + default: gcc_unreachable (); } - - abort (); } void @@ -10086,10 +11593,10 @@ arm_final_prescan_insn (rtx insn) means that we have to grub around within the jump expression to find out what the conditions are when the jump isn't taken. */ int jump_clobbers = 0; - + /* If we start with a return insn, we only succeed if we find another one. */ int seeking_return = 0; - + /* START_INSN will hold the insn from where we start looking. This is the first insn after the following code_label if REVERSE is true. */ rtx start_insn = insn; @@ -10146,12 +11653,11 @@ arm_final_prescan_insn (rtx insn) return; } - if (arm_ccfsm_state != 0 && !reverse) - abort (); + gcc_assert (!arm_ccfsm_state || reverse); if (GET_CODE (insn) != JUMP_INSN) return; - /* This jump might be paralleled with a clobber of the condition codes + /* This jump might be paralleled with a clobber of the condition codes the jump should always come first */ if (GET_CODE (body) == PARALLEL && XVECLEN (body, 0) > 0) body = XVECEXP (body, 0, 0); @@ -10166,14 +11672,14 @@ arm_final_prescan_insn (rtx insn) int then_not_else = TRUE; rtx this_insn = start_insn, label = 0; - /* If the jump cannot be done with one instruction, we cannot + /* If the jump cannot be done with one instruction, we cannot conditionally execute the instruction in the inverse case. */ if (get_attr_conds (insn) == CONDS_JUMP_CLOB) { jump_clobbers = 1; return; } - + /* Register the insn jumped to. */ if (reverse) { @@ -10195,7 +11701,7 @@ arm_final_prescan_insn (rtx insn) then_not_else = FALSE; } else - abort (); + gcc_unreachable (); /* See how many insns this branch skips, and what kind of insns. If all insns are okay, and the label or unconditional branch to the same @@ -10231,8 +11737,8 @@ arm_final_prescan_insn (rtx insn) case BARRIER: /* Succeed if the following insn is the target label. - Otherwise fail. - If return insns are used then the last insn in a function + Otherwise fail. + If return insns are used then the last insn in a function will be a barrier. */ this_insn = next_nonnote_insn (this_insn); if (this_insn && this_insn == label) @@ -10251,32 +11757,37 @@ arm_final_prescan_insn (rtx insn) break; case CALL_INSN: - /* If using 32-bit addresses the cc is not preserved over - calls. */ - if (TARGET_APCS_32) + /* The AAPCS says that conditional calls should not be + used since they make interworking inefficient (the + linker can't transform BL into BLX). That's + only a problem if the machine has BLX. */ + if (arm_arch5) { - /* Succeed if the following insn is the target label, - or if the following two insns are a barrier and - the target label. */ - this_insn = next_nonnote_insn (this_insn); - if (this_insn && GET_CODE (this_insn) == BARRIER) - this_insn = next_nonnote_insn (this_insn); + fail = TRUE; + break; + } - if (this_insn && this_insn == label - && insns_skipped < max_insns_skipped) + /* Succeed if the following insn is the target label, or + if the following two insns are a barrier and the + target label. */ + this_insn = next_nonnote_insn (this_insn); + if (this_insn && GET_CODE (this_insn) == BARRIER) + this_insn = next_nonnote_insn (this_insn); + + if (this_insn && this_insn == label + && insns_skipped < max_insns_skipped) + { + if (jump_clobbers) { - if (jump_clobbers) - { - arm_ccfsm_state = 2; - this_insn = next_nonnote_insn (this_insn); - } - else - arm_ccfsm_state = 1; - succeed = TRUE; + arm_ccfsm_state = 2; + this_insn = next_nonnote_insn (this_insn); } else - fail = TRUE; + arm_ccfsm_state = 1; + succeed = TRUE; } + else + fail = TRUE; break; case JUMP_INSN: @@ -10299,7 +11810,7 @@ arm_final_prescan_insn (rtx insn) else if (GET_CODE (SET_SRC (scanbody)) == IF_THEN_ELSE) fail = TRUE; } - /* Fail if a conditional return is undesirable (eg on a + /* Fail if a conditional return is undesirable (e.g. on a StrongARM), but still allow this if optimizing for size. */ else if (GET_CODE (scanbody) == RETURN && !use_return_insn (TRUE, NULL) @@ -10323,7 +11834,7 @@ arm_final_prescan_insn (rtx insn) } } else - fail = TRUE; /* Unrecognized jump (eg epilogue). */ + fail = TRUE; /* Unrecognized jump (e.g. epilogue). */ break; @@ -10357,14 +11868,16 @@ arm_final_prescan_insn (rtx insn) { if ((!seeking_return) && (arm_ccfsm_state == 1 || reverse)) arm_target_label = CODE_LABEL_NUMBER (label); - else if (seeking_return || arm_ccfsm_state == 2) + else { + gcc_assert (seeking_return || arm_ccfsm_state == 2); + while (this_insn && GET_CODE (PATTERN (this_insn)) == USE) { this_insn = next_nonnote_insn (this_insn); - if (this_insn && (GET_CODE (this_insn) == BARRIER - || GET_CODE (this_insn) == CODE_LABEL)) - abort (); + gcc_assert (!this_insn + || (GET_CODE (this_insn) != BARRIER + && GET_CODE (this_insn) != CODE_LABEL)); } if (!this_insn) { @@ -10376,13 +11889,10 @@ arm_final_prescan_insn (rtx insn) } arm_target_insn = this_insn; } - else - abort (); if (jump_clobbers) { - if (reverse) - abort (); - arm_current_cc = + gcc_assert (!reverse); + arm_current_cc = get_arm_condition_code (XEXP (XEXP (XEXP (SET_SRC (body), 0), 0), 1)); if (GET_CODE (XEXP (XEXP (SET_SRC (body), 0), 0)) == AND) @@ -10402,7 +11912,7 @@ arm_final_prescan_insn (rtx insn) if (reverse || then_not_else) arm_current_cc = ARM_INVERSE_CONDITION_CODE (arm_current_cc); } - + /* Restore recog_data (getting the attributes of other insns can destroy this array, but final.c assumes that it remains intact across this call; since the insn has been recognized already we @@ -10412,13 +11922,15 @@ arm_final_prescan_insn (rtx insn) } /* Returns true if REGNO is a valid register - for holding a quantity of tyoe MODE. */ + for holding a quantity of type MODE. */ int arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) { if (GET_MODE_CLASS (mode) == MODE_CC) - return regno == CC_REGNUM; - + return (regno == CC_REGNUM + || (TARGET_HARD_FLOAT && TARGET_VFP + && regno == VFPCC_REGNUM)); + if (TARGET_THUMB) /* For the Thumb we only allow values bigger than SImode in registers 0 - 6, so that there is always a second low @@ -10427,7 +11939,8 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) start of an even numbered register pair. */ return (ARM_NUM_REGS (mode) < 2) || (regno < LAST_LO_REGNUM); - if (IS_CIRRUS_REGNUM (regno)) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK + && IS_CIRRUS_REGNUM (regno)) /* We have outlawed SI values in Cirrus registers because they reside in the lower 32 bits, but SF values reside in the upper 32 bits. This causes gcc all sorts of grief. We can't @@ -10435,26 +11948,44 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) get sign extended to 64bits-- aldyh. */ return (GET_MODE_CLASS (mode) == MODE_FLOAT) || (mode == DImode); - if (IS_IWMMXT_GR_REGNUM (regno)) - return mode == SImode; + if (TARGET_HARD_FLOAT && TARGET_VFP + && IS_VFP_REGNUM (regno)) + { + if (mode == SFmode || mode == SImode) + return TRUE; - if (IS_IWMMXT_REGNUM (regno)) - return VALID_IWMMXT_REG_MODE (mode); + /* DFmode values are only valid in even register pairs. */ + if (mode == DFmode) + return ((regno - FIRST_VFP_REGNUM) & 1) == 0; + return FALSE; + } + if (TARGET_REALLY_IWMMXT) + { + if (IS_IWMMXT_GR_REGNUM (regno)) + return mode == SImode; + + if (IS_IWMMXT_REGNUM (regno)) + return VALID_IWMMXT_REG_MODE (mode); + } + + /* We allow any value to be stored in the general registers. + Restrict doubleword quantities to even register pairs so that we can + use ldrd. */ if (regno <= LAST_ARM_REGNUM) - /* We allow any value to be stored in the general registers. */ - return 1; + return !(TARGET_LDRD && GET_MODE_SIZE (mode) > 4 && (regno & 1) != 0); - if ( regno == FRAME_POINTER_REGNUM + if (regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM) /* We only allow integers in the fake hard registers. */ return GET_MODE_CLASS (mode) == MODE_INT; /* The only registers left are the FPA registers which we only allow to hold FP values. */ - return GET_MODE_CLASS (mode) == MODE_FLOAT - && regno >= FIRST_ARM_FP_REGNUM - && regno <= LAST_ARM_FP_REGNUM; + return (TARGET_HARD_FLOAT && TARGET_FPA + && GET_MODE_CLASS (mode) == MODE_FLOAT + && regno >= FIRST_FPA_REGNUM + && regno <= LAST_FPA_REGNUM); } int @@ -10475,13 +12006,16 @@ arm_regno_class (int regno) || regno == FRAME_POINTER_REGNUM || regno == ARG_POINTER_REGNUM) return GENERAL_REGS; - - if (regno == CC_REGNUM) + + if (regno == CC_REGNUM || regno == VFPCC_REGNUM) return NO_REGS; if (IS_CIRRUS_REGNUM (regno)) return CIRRUS_REGS; + if (IS_VFP_REGNUM (regno)) + return VFP_REGS; + if (IS_IWMMXT_REGNUM (regno)) return IWMMXT_REGS; @@ -10510,13 +12044,13 @@ arm_debugger_arg_offset (int value, rtx addr) an offset of 0 is correct. */ if (REGNO (addr) == (unsigned) HARD_FRAME_POINTER_REGNUM) return 0; - + /* If we are using the stack pointer to point at the argument, then an offset of 0 is correct. */ if ((TARGET_THUMB || !frame_pointer_needed) && REGNO (addr) == SP_REGNUM) return 0; - + /* Oh dear. The argument is pointed to by a register rather than being held in a register, or being stored at a known offset from the frame pointer. Since GDB only understands @@ -10526,12 +12060,12 @@ arm_debugger_arg_offset (int value, rtx addr) looking to see where this register gets its value. If the register is initialized from the frame pointer plus an offset then we are in luck and we can continue, otherwise we give up. - + This code is exercised by producing debugging information for a function with arguments like this: - + double func (double a, double b, int c, double d) {return d;} - + Without this code the stab for parameter 'd' will be set to an offset of 0 from the frame pointer, rather than 8. */ @@ -10546,10 +12080,10 @@ arm_debugger_arg_offset (int value, rtx addr) a constant integer then... */ - + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { - if ( GET_CODE (insn) == INSN + if ( GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SET && REGNO (XEXP (PATTERN (insn), 0)) == REGNO (addr) && GET_CODE (XEXP (PATTERN (insn), 1)) == PLUS @@ -10559,15 +12093,15 @@ arm_debugger_arg_offset (int value, rtx addr) ) { value = INTVAL (XEXP (XEXP (PATTERN (insn), 1), 1)); - + break; } } - + if (value == 0) { debug_rtx (addr); - warning ("unable to compute real location of stacked parameter"); + warning (0, "unable to compute real location of stacked parameter"); value = 8; /* XXX magic hack */ } @@ -10578,7 +12112,8 @@ arm_debugger_arg_offset (int value, rtx addr) do \ { \ if ((MASK) & insn_flags) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE); \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), \ + BUILT_IN_MD, NULL, NULL_TREE); \ } \ while (0) @@ -10617,8 +12152,8 @@ static const struct builtin_description bdesc_2arg[] = IWMMXT_BUILTIN (ussubv4hi3, "wsubhus", WSUBUSH) IWMMXT_BUILTIN (ussubv2si3, "wsubwus", WSUBUSW) IWMMXT_BUILTIN (mulv4hi3, "wmulul", WMULUL) - IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsh", WMULSH) - IWMMXT_BUILTIN (umulv4hi3_highpart, "wmuluh", WMULUH) + IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsm", WMULSM) + IWMMXT_BUILTIN (umulv4hi3_highpart, "wmulum", WMULUM) IWMMXT_BUILTIN (eqv8qi3, "wcmpeqb", WCMPEQB) IWMMXT_BUILTIN (eqv4hi3, "wcmpeqh", WCMPEQH) IWMMXT_BUILTIN (eqv2si3, "wcmpeqw", WCMPEQW) @@ -10659,7 +12194,7 @@ static const struct builtin_description bdesc_2arg[] = #define IWMMXT_BUILTIN2(code, builtin) \ { FL_IWMMXT, CODE_FOR_##code, NULL, ARM_BUILTIN_##builtin, 0, 0 }, - + IWMMXT_BUILTIN2 (iwmmxt_wpackhss, WPACKHSS) IWMMXT_BUILTIN2 (iwmmxt_wpackwss, WPACKWSS) IWMMXT_BUILTIN2 (iwmmxt_wpackdss, WPACKDSS) @@ -10677,13 +12212,13 @@ static const struct builtin_description bdesc_2arg[] = IWMMXT_BUILTIN2 (lshrv2si3_di, WSRLW) IWMMXT_BUILTIN2 (lshrv2si3, WSRLWI) IWMMXT_BUILTIN2 (lshrdi3_di, WSRLD) - IWMMXT_BUILTIN2 (lshrdi3, WSRLDI) + IWMMXT_BUILTIN2 (lshrdi3_iwmmxt, WSRLDI) IWMMXT_BUILTIN2 (ashrv4hi3_di, WSRAH) IWMMXT_BUILTIN2 (ashrv4hi3, WSRAHI) IWMMXT_BUILTIN2 (ashrv2si3_di, WSRAW) IWMMXT_BUILTIN2 (ashrv2si3, WSRAWI) IWMMXT_BUILTIN2 (ashrdi3_di, WSRAD) - IWMMXT_BUILTIN2 (ashrdi3, WSRADI) + IWMMXT_BUILTIN2 (ashrdi3_iwmmxt, WSRADI) IWMMXT_BUILTIN2 (rorv4hi3_di, WRORH) IWMMXT_BUILTIN2 (rorv4hi3, WRORHI) IWMMXT_BUILTIN2 (rorv2si3_di, WRORW) @@ -10726,6 +12261,10 @@ arm_init_iwmmxt_builtins (void) size_t i; tree endlink = void_list_node; + tree V2SI_type_node = build_vector_type_for_mode (intSI_type_node, V2SImode); + tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode); + tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode); + tree int_ftype_int = build_function_type (integer_type_node, tree_cons (NULL_TREE, integer_type_node, endlink)); @@ -10940,7 +12479,7 @@ arm_init_iwmmxt_builtins (void) break; default: - abort (); + gcc_unreachable (); } def_mbuiltin (d->mask, d->name, type, d->code); @@ -11038,9 +12577,24 @@ arm_init_iwmmxt_builtins (void) def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiatt", di_ftype_di_int_int, ARM_BUILTIN_TMIATT); } +static void +arm_init_tls_builtins (void) +{ + tree ftype; + tree nothrow = tree_cons (get_identifier ("nothrow"), NULL, NULL); + tree const_nothrow = tree_cons (get_identifier ("const"), NULL, nothrow); + + ftype = build_function_type (ptr_type_node, void_list_node); + lang_hooks.builtin_function ("__builtin_thread_pointer", ftype, + ARM_BUILTIN_THREAD_POINTER, BUILT_IN_MD, + NULL, const_nothrow); +} + static void arm_init_builtins (void) { + arm_init_tls_builtins (); + if (TARGET_REALLY_IWMMXT) arm_init_iwmmxt_builtins (); } @@ -11070,8 +12624,8 @@ arm_expand_binop_builtin (enum insn_code icode, rtx pat; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; @@ -11086,10 +12640,7 @@ arm_expand_binop_builtin (enum insn_code icode, || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - /* In case the insn wants input operands in modes different from - the result, abort. */ - if (GET_MODE (op0) != mode0 || GET_MODE (op1) != mode1) - abort (); + gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1); if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); @@ -11111,7 +12662,7 @@ arm_expand_unop_builtin (enum insn_code icode, { rtx pat; tree arg0 = TREE_VALUE (arglist); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; @@ -11184,8 +12735,8 @@ arm_expand_builtin (tree exp, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[2].mode; @@ -11217,9 +12768,9 @@ arm_expand_builtin (tree exp, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[2].mode; @@ -11248,14 +12799,14 @@ arm_expand_builtin (tree exp, case ARM_BUILTIN_SETWCX: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - emit_insn (gen_iwmmxt_tmcr (op0, op1)); + op0 = force_reg (SImode, expand_normal (arg0)); + op1 = expand_normal (arg1); + emit_insn (gen_iwmmxt_tmcr (op1, op0)); return 0; case ARM_BUILTIN_GETWCX: arg0 = TREE_VALUE (arglist); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); target = gen_reg_rtx (SImode); emit_insn (gen_iwmmxt_tmrc (target, op0)); return target; @@ -11264,8 +12815,8 @@ arm_expand_builtin (tree exp, icode = CODE_FOR_iwmmxt_wshufh; arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); tmode = insn_data[icode].operand[0].mode; mode1 = insn_data[icode].operand[1].mode; mode2 = insn_data[icode].operand[2].mode; @@ -11319,9 +12870,9 @@ arm_expand_builtin (tree exp, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[2].mode; @@ -11342,12 +12893,15 @@ arm_expand_builtin (tree exp, return 0; emit_insn (pat); return target; - + case ARM_BUILTIN_WZERO: target = gen_reg_rtx (DImode); emit_insn (gen_iwmmxt_clrdi (target)); return target; + case ARM_BUILTIN_THREAD_POINTER: + return arm_load_tp (target); + default: break; } @@ -11364,42 +12918,11 @@ arm_expand_builtin (tree exp, return NULL_RTX; } -/* Recursively search through all of the blocks in a function - checking to see if any of the variables created in that - function match the RTX called 'orig'. If they do then - replace them with the RTX called 'new'. */ -static void -replace_symbols_in_block (tree block, rtx orig, rtx new) -{ - for (; block; block = BLOCK_CHAIN (block)) - { - tree sym; - - if (!TREE_USED (block)) - continue; - - for (sym = BLOCK_VARS (block); sym; sym = TREE_CHAIN (sym)) - { - if ( (DECL_NAME (sym) == 0 && TREE_CODE (sym) != TYPE_DECL) - || DECL_IGNORED_P (sym) - || TREE_CODE (sym) != VAR_DECL - || DECL_EXTERNAL (sym) - || !rtx_equal_p (DECL_RTL (sym), orig) - ) - continue; - - SET_DECL_RTL (sym, new); - } - - replace_symbols_in_block (BLOCK_SUBBLOCKS (block), orig, new); - } -} - /* Return the number (counting from 0) of the least significant set bit in MASK. */ inline static int -number_of_first_bit_set (int mask) +number_of_first_bit_set (unsigned mask) { int bit; @@ -11411,11 +12934,121 @@ number_of_first_bit_set (int mask) return bit; } +/* Emit code to push or pop registers to or from the stack. F is the + assembly file. MASK is the registers to push or pop. PUSH is + nonzero if we should push, and zero if we should pop. For debugging + output, if pushing, adjust CFA_OFFSET by the amount of space added + to the stack. REAL_REGS should have the same number of bits set as + MASK, and will be used instead (in the same order) to describe which + registers were saved - this is used to mark the save slots when we + push high registers after moving them to low registers. */ +static void +thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset, + unsigned long real_regs) +{ + int regno; + int lo_mask = mask & 0xFF; + int pushed_words = 0; + + gcc_assert (mask); + + if (lo_mask == 0 && !push && (mask & (1 << PC_REGNUM))) + { + /* Special case. Do not generate a POP PC statement here, do it in + thumb_exit() */ + thumb_exit (f, -1); + return; + } + + if (ARM_EABI_UNWIND_TABLES && push) + { + fprintf (f, "\t.save\t{"); + for (regno = 0; regno < 15; regno++) + { + if (real_regs & (1 << regno)) + { + if (real_regs & ((1 << regno) -1)) + fprintf (f, ", "); + asm_fprintf (f, "%r", regno); + } + } + fprintf (f, "}\n"); + } + + fprintf (f, "\t%s\t{", push ? "push" : "pop"); + + /* Look at the low registers first. */ + for (regno = 0; regno <= LAST_LO_REGNUM; regno++, lo_mask >>= 1) + { + if (lo_mask & 1) + { + asm_fprintf (f, "%r", regno); + + if ((lo_mask & ~1) != 0) + fprintf (f, ", "); + + pushed_words++; + } + } + + if (push && (mask & (1 << LR_REGNUM))) + { + /* Catch pushing the LR. */ + if (mask & 0xFF) + fprintf (f, ", "); + + asm_fprintf (f, "%r", LR_REGNUM); + + pushed_words++; + } + else if (!push && (mask & (1 << PC_REGNUM))) + { + /* Catch popping the PC. */ + if (TARGET_INTERWORK || TARGET_BACKTRACE + || current_function_calls_eh_return) + { + /* The PC is never poped directly, instead + it is popped into r3 and then BX is used. */ + fprintf (f, "}\n"); + + thumb_exit (f, -1); + + return; + } + else + { + if (mask & 0xFF) + fprintf (f, ", "); + + asm_fprintf (f, "%r", PC_REGNUM); + } + } + + fprintf (f, "}\n"); + + if (push && pushed_words && dwarf2out_do_frame ()) + { + char *l = dwarf2out_cfi_label (); + int pushed_mask = real_regs; + + *cfa_offset += pushed_words * 4; + dwarf2out_def_cfa (l, SP_REGNUM, *cfa_offset); + + pushed_words = 0; + pushed_mask = real_regs; + for (regno = 0; regno <= 14; regno++, pushed_mask >>= 1) + { + if (pushed_mask & 1) + dwarf2out_reg_save (l, regno, 4 * pushed_words++ - *cfa_offset); + } + } +} + /* Generate code to return from a thumb function. If 'reg_containing_return_addr' is -1, then the return address is actually on the stack, at the stack pointer. */ static void -thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) +thumb_exit (FILE *f, int reg_containing_return_addr) { unsigned regs_available_for_popping; unsigned regs_to_pop; @@ -11430,15 +13063,8 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) regs_to_pop = 0; pops_needed = 0; - /* There is an assumption here, that if eh_ofs is not NULL, the - normal return address will have been pushed. */ - if (reg_containing_return_addr == -1 || eh_ofs) + if (reg_containing_return_addr == -1) { - /* When we are generating a return for __builtin_eh_return, - reg_containing_return_addr must specify the return regno. */ - if (eh_ofs && reg_containing_return_addr == -1) - abort (); - regs_to_pop |= 1 << LR_REGNUM; ++pops_needed; } @@ -11454,8 +13080,8 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) return. */ if (pops_needed == 0) { - if (eh_ofs) - asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, REGNO (eh_ofs)); + if (current_function_calls_eh_return) + asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); return; @@ -11465,17 +13091,10 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) just pop the return address straight into the PC. */ else if (!TARGET_INTERWORK && !TARGET_BACKTRACE - && !is_called_in_ARM_mode (current_function_decl)) + && !is_called_in_ARM_mode (current_function_decl) + && !current_function_calls_eh_return) { - if (eh_ofs) - { - asm_fprintf (f, "\tadd\t%r, #4\n", SP_REGNUM); - asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, REGNO (eh_ofs)); - asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); - } - else - asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM); - + asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM); return; } @@ -11484,11 +13103,10 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) /* If returning via __builtin_eh_return, the bottom three registers all contain information needed for the return. */ - if (eh_ofs) + if (current_function_calls_eh_return) size = 12; else { -#ifdef RTX_CODE /* If we can deduce the registers used from the function's return value. This is more reliable that examining regs_ever_live[] because that will be set if the register is @@ -11498,7 +13116,6 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) if (current_function_return_rtx != 0) mode = GET_MODE (current_function_return_rtx); else -#endif mode = DECL_MODE (DECL_RESULT (current_function_decl)); size = GET_MODE_SIZE (mode); @@ -11538,7 +13155,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) /* If we have any popping registers left over, remove them. */ if (available > 0) regs_available_for_popping &= ~available; - + /* Otherwise if we need another popping register we can use the fourth argument register. */ else if (pops_needed) @@ -11556,15 +13173,15 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) /* Register a4 is being used to hold part of the return value, but we have dire need of a free, low register. */ restore_a4 = TRUE; - + asm_fprintf (f, "\tmov\t%r, %r\n",IP_REGNUM, LAST_ARG_REGNUM); } - + if (reg_containing_return_addr != LAST_ARG_REGNUM) { /* The fourth argument register is available. */ regs_available_for_popping |= 1 << LAST_ARG_REGNUM; - + --pops_needed; } } @@ -11578,7 +13195,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) { /* The return address was popped into the lowest numbered register. */ regs_to_pop &= ~(1 << LR_REGNUM); - + reg_containing_return_addr = number_of_first_bit_set (regs_available_for_popping); @@ -11591,7 +13208,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) if (regs_available_for_popping) { int frame_pointer; - + /* Work out which register currently contains the frame pointer. */ frame_pointer = number_of_first_bit_set (regs_available_for_popping); @@ -11602,18 +13219,18 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) /* (Temporarily) remove it from the mask of popped registers. */ regs_available_for_popping &= ~(1 << frame_pointer); regs_to_pop &= ~(1 << ARM_HARD_FRAME_POINTER_REGNUM); - + if (regs_available_for_popping) { int stack_pointer; - + /* We popped the stack pointer as well, find the register that contains it. */ stack_pointer = number_of_first_bit_set (regs_available_for_popping); /* Move it into the stack register. */ asm_fprintf (f, "\tmov\t%r, %r\n", SP_REGNUM, stack_pointer); - + /* At this point we have popped all necessary registers, so do not worry about restoring regs_available_for_popping to its correct value: @@ -11630,7 +13247,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) regs_available_for_popping |= (1 << frame_pointer); } } - + /* If we still have registers left on the stack, but we no longer have any registers into which we can pop them, then we must move the return address into the link register and make available the register that @@ -11638,10 +13255,10 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) if (regs_available_for_popping == 0 && pops_needed > 0) { regs_available_for_popping |= 1 << reg_containing_return_addr; - + asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, reg_containing_return_addr); - + reg_containing_return_addr = LR_REGNUM; } @@ -11651,7 +13268,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) { int popped_into; int move_to; - + thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, regs_available_for_popping); @@ -11666,13 +13283,13 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) --pops_needed; } - + /* If we still have not popped everything then we must have only had one register available to us and we are now popping the SP. */ if (pops_needed > 0) { int popped_into; - + thumb_pushpop (f, regs_available_for_popping, FALSE, NULL, regs_available_for_popping); @@ -11693,107 +13310,17 @@ thumb_exit (FILE *f, int reg_containing_return_addr, rtx eh_ofs) asm_fprintf (f, "\tmov\t%r, %r\n", LR_REGNUM, LAST_ARG_REGNUM); reg_containing_return_addr = LR_REGNUM; } - + asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM); } - if (eh_ofs) - asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, REGNO (eh_ofs)); + if (current_function_calls_eh_return) + asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM); /* Return to caller. */ asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr); } -/* Emit code to push or pop registers to or from the stack. F is the - assembly file. MASK is the registers to push or pop. PUSH is - non-zero if we should push, and zero if we should pop. For debugging - output, if pushing, adjust CFA_OFFSET by the amount of space added - to the stack. REAL_REGS should have the same number of bits set as - MASK, and will be used instead (in the same order) to describe which - registers were saved - this is used to mark the save slots when we - push high registers after moving them to low registers. */ -static void -thumb_pushpop (FILE *f, int mask, int push, int *cfa_offset, int real_regs) -{ - int regno; - int lo_mask = mask & 0xFF; - int pushed_words = 0; - - if (lo_mask == 0 && !push && (mask & (1 << 15))) - { - /* Special case. Do not generate a POP PC statement here, do it in - thumb_exit() */ - thumb_exit (f, -1, NULL_RTX); - return; - } - - fprintf (f, "\t%s\t{", push ? "push" : "pop"); - - /* Look at the low registers first. */ - for (regno = 0; regno <= LAST_LO_REGNUM; regno++, lo_mask >>= 1) - { - if (lo_mask & 1) - { - asm_fprintf (f, "%r", regno); - - if ((lo_mask & ~1) != 0) - fprintf (f, ", "); - - pushed_words++; - } - } - - if (push && (mask & (1 << LR_REGNUM))) - { - /* Catch pushing the LR. */ - if (mask & 0xFF) - fprintf (f, ", "); - - asm_fprintf (f, "%r", LR_REGNUM); - - pushed_words++; - } - else if (!push && (mask & (1 << PC_REGNUM))) - { - /* Catch popping the PC. */ - if (TARGET_INTERWORK || TARGET_BACKTRACE) - { - /* The PC is never poped directly, instead - it is popped into r3 and then BX is used. */ - fprintf (f, "}\n"); - - thumb_exit (f, -1, NULL_RTX); - - return; - } - else - { - if (mask & 0xFF) - fprintf (f, ", "); - - asm_fprintf (f, "%r", PC_REGNUM); - } - } - - fprintf (f, "}\n"); - - if (push && pushed_words && dwarf2out_do_frame ()) - { - char *l = dwarf2out_cfi_label (); - int pushed_mask = real_regs; - - *cfa_offset += pushed_words * 4; - dwarf2out_def_cfa (l, SP_REGNUM, *cfa_offset); - - pushed_words = 0; - pushed_mask = real_regs; - for (regno = 0; regno <= 14; regno++, pushed_mask >>= 1) - { - if (pushed_mask & 1) - dwarf2out_reg_save (l, regno, 4 * pushed_words++ - *cfa_offset); - } - } -} void thumb_final_prescan_insn (rtx insn) @@ -11811,7 +13338,7 @@ thumb_shiftable_const (unsigned HOST_WIDE_INT val) if (val == 0) /* XXX */ return 0; - + for (i = 0; i < 25; i++) if ((val & (mask << i)) == val) return 1; @@ -11821,14 +13348,14 @@ thumb_shiftable_const (unsigned HOST_WIDE_INT val) /* Returns nonzero if the current function contains, or might contain a far jump. */ -int -thumb_far_jump_used_p (int in_prologue) +static int +thumb_far_jump_used_p (void) { rtx insn; /* This test is only important for leaf functions. */ /* assert (!leaf_function_p ()); */ - + /* If we have already decided that far jumps may be used, do not bother checking again, and always return true even if it turns out that they are not being used. Once we have made @@ -11840,7 +13367,7 @@ thumb_far_jump_used_p (int in_prologue) /* If this function is not being called from the prologue/epilogue generation code then it must be being called from the INITIAL_ELIMINATION_OFFSET macro. */ - if (!in_prologue) + if (!(ARM_DOUBLEWORD_ALIGN || reload_completed)) { /* In this case we know that we are being asked about the elimination of the arg pointer register. If that register is not being used, @@ -11859,7 +13386,10 @@ thumb_far_jump_used_p (int in_prologue) A false negative will not result in bad code being generated, but it will result in a needless push and pop of the link register. We - hope that this does not occur too often. */ + hope that this does not occur too often. + + If we need doubleword stack alignment this could affect the other + elimination offsets so we can't risk getting it wrong. */ if (regs_ever_live [ARG_POINTER_REGNUM]) cfun->machine->arg_pointer_live = 1; else if (!cfun->machine->arg_pointer_live) @@ -11883,7 +13413,7 @@ thumb_far_jump_used_p (int in_prologue) return 1; } } - + return 0; } @@ -11891,14 +13421,13 @@ thumb_far_jump_used_p (int in_prologue) int is_called_in_ARM_mode (tree func) { - if (TREE_CODE (func) != FUNCTION_DECL) - abort (); + gcc_assert (TREE_CODE (func) == FUNCTION_DECL); - /* Ignore the problem about functions whoes address is taken. */ + /* Ignore the problem about functions whose address is taken. */ if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) return TRUE; -#ifdef ARM_PE +#ifdef ARM_PE return lookup_attribute ("interfacearm", DECL_ATTRIBUTES (func)) != NULL_TREE; #else return FALSE; @@ -11910,11 +13439,10 @@ const char * thumb_unexpanded_epilogue (void) { int regno; - int live_regs_mask = 0; + unsigned long live_regs_mask = 0; int high_regs_pushed = 0; - int leaf_function = leaf_function_p (); int had_to_push_lr; - rtx eh_ofs = cfun->machine->eh_epilogue_sp_ofs; + int size; if (return_used_this_function) return ""; @@ -11922,16 +13450,17 @@ thumb_unexpanded_epilogue (void) if (IS_NAKED (arm_current_func_type ())) return ""; - for (regno = 0; regno <= LAST_LO_REGNUM; regno++) - if (THUMB_REG_PUSHED_P (regno)) - live_regs_mask |= 1 << regno; + live_regs_mask = thumb_compute_save_reg_mask (); + high_regs_pushed = bit_count (live_regs_mask & 0x0f00); - for (regno = 8; regno < 13; regno++) - if (THUMB_REG_PUSHED_P (regno)) - high_regs_pushed++; + /* If we can deduce the registers used from the function's return value. + This is more reliable that examining regs_ever_live[] because that + will be set if the register is ever used in the function, not just if + the register is used to hold a return value. */ + size = arm_size_return_regs (); /* The prolog may have pushed some high registers to use as - work registers. eg the testsuite file: + work registers. e.g. the testsuite file: gcc/testsuite/gcc/gcc.c-torture/execute/complex-2.c compiles to produce: push {r4, r5, r6, r7, lr} @@ -11939,41 +13468,27 @@ thumb_unexpanded_epilogue (void) mov r6, r8 push {r6, r7} as part of the prolog. We have to undo that pushing here. */ - + if (high_regs_pushed) { - int mask = live_regs_mask; + unsigned long mask = live_regs_mask & 0xff; int next_hi_reg; - int size; - int mode; - -#ifdef RTX_CODE - /* If we can deduce the registers used from the function's return value. - This is more reliable that examining regs_ever_live[] because that - will be set if the register is ever used in the function, not just if - the register is used to hold a return value. */ - if (current_function_return_rtx != 0) - mode = GET_MODE (current_function_return_rtx); - else -#endif - mode = DECL_MODE (DECL_RESULT (current_function_decl)); - - size = GET_MODE_SIZE (mode); - - /* Unless we are returning a type of size > 12 register r3 is - available. */ - if (size < 13) + /* The available low registers depend on the size of the value we are + returning. */ + if (size <= 12) mask |= 1 << 3; + if (size <= 8) + mask |= 1 << 2; if (mask == 0) /* Oh dear! We have no low registers into which we can pop high registers! */ internal_error ("no low registers available for popping high registers"); - + for (next_hi_reg = 8; next_hi_reg < 13; next_hi_reg++) - if (THUMB_REG_PUSHED_P (next_hi_reg)) + if (live_regs_mask & (1 << next_hi_reg)) break; while (high_regs_pushed) @@ -12000,33 +13515,23 @@ thumb_unexpanded_epilogue (void) { asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg, regno); - + for (next_hi_reg++; next_hi_reg < 13; next_hi_reg++) - if (THUMB_REG_PUSHED_P (next_hi_reg)) + if (live_regs_mask & (1 << next_hi_reg)) break; } } } + live_regs_mask &= ~0x0f00; } - had_to_push_lr = (live_regs_mask || !leaf_function - || thumb_far_jump_used_p (1)); - - if (TARGET_BACKTRACE - && ((live_regs_mask & 0xFF) == 0) - && regs_ever_live [LAST_ARG_REGNUM] != 0) - { - /* The stack backtrace structure creation code had to - push R7 in order to get a work register, so we pop - it now. */ - live_regs_mask |= (1 << LAST_LO_REGNUM); - } - + had_to_push_lr = (live_regs_mask & (1 << LR_REGNUM)) != 0; + live_regs_mask &= 0xff; + if (current_function_pretend_args_size == 0 || TARGET_BACKTRACE) { - if (had_to_push_lr - && !is_called_in_ARM_mode (current_function_decl) - && !eh_ofs) + /* Pop the return address into the PC. */ + if (had_to_push_lr) live_regs_mask |= 1 << PC_REGNUM; /* Either no argument registers were pushed or a backtrace @@ -12035,43 +13540,54 @@ thumb_unexpanded_epilogue (void) if (live_regs_mask) thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, live_regs_mask); - - if (eh_ofs) - thumb_exit (asm_out_file, 2, eh_ofs); + /* We have either just popped the return address into the - PC or it is was kept in LR for the entire function or - it is still on the stack because we do not want to - return by doing a pop {pc}. */ - else if ((live_regs_mask & (1 << PC_REGNUM)) == 0) - thumb_exit (asm_out_file, - (had_to_push_lr - && is_called_in_ARM_mode (current_function_decl)) ? - -1 : LR_REGNUM, NULL_RTX); + PC or it is was kept in LR for the entire function. */ + if (!had_to_push_lr) + thumb_exit (asm_out_file, LR_REGNUM); } else { /* Pop everything but the return address. */ - live_regs_mask &= ~(1 << PC_REGNUM); - if (live_regs_mask) thumb_pushpop (asm_out_file, live_regs_mask, FALSE, NULL, live_regs_mask); if (had_to_push_lr) - /* Get the return address into a temporary register. */ - thumb_pushpop (asm_out_file, 1 << LAST_ARG_REGNUM, 0, NULL, - 1 << LAST_ARG_REGNUM); - + { + if (size > 12) + { + /* We have no free low regs, so save one. */ + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", IP_REGNUM, + LAST_ARG_REGNUM); + } + + /* Get the return address into a temporary register. */ + thumb_pushpop (asm_out_file, 1 << LAST_ARG_REGNUM, 0, NULL, + 1 << LAST_ARG_REGNUM); + + if (size > 12) + { + /* Move the return address to lr. */ + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LR_REGNUM, + LAST_ARG_REGNUM); + /* Restore the low register. */ + asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, + IP_REGNUM); + regno = LR_REGNUM; + } + else + regno = LAST_ARG_REGNUM; + } + else + regno = LR_REGNUM; + /* Remove the argument registers that were pushed onto the stack. */ asm_fprintf (asm_out_file, "\tadd\t%r, %r, #%d\n", SP_REGNUM, SP_REGNUM, current_function_pretend_args_size); - - if (eh_ofs) - thumb_exit (asm_out_file, 2, eh_ofs); - else - thumb_exit (asm_out_file, - had_to_push_lr ? LAST_ARG_REGNUM : LR_REGNUM, NULL_RTX); + + thumb_exit (asm_out_file, regno); } return ""; @@ -12084,7 +13600,7 @@ arm_init_machine_status (void) struct machine_function *machine; machine = (machine_function *) ggc_alloc_cleared (sizeof (machine_function)); -#if ARM_FT_UNKNOWN != 0 +#if ARM_FT_UNKNOWN != 0 machine->func_type = ARM_FT_UNKNOWN; #endif return machine; @@ -12098,14 +13614,7 @@ arm_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) if (count != 0) return NULL_RTX; - if (TARGET_APCS_32) - return get_hard_reg_initial_val (Pmode, LR_REGNUM); - else - { - rtx lr = gen_rtx_AND (Pmode, gen_rtx_REG (Pmode, LR_REGNUM), - GEN_INT (RETURN_ADDR_MASK26)); - return get_func_hard_reg_initial_val (cfun, lr); - } + return get_hard_reg_initial_val (Pmode, LR_REGNUM); } /* Do anything needed before RTL is emitted for each function. */ @@ -12114,106 +13623,86 @@ arm_init_expanders (void) { /* Arrange to initialize and mark the machine per-function status. */ init_machine_status = arm_init_machine_status; + + /* This is to stop the combine pass optimizing away the alignment + adjustment of va_arg. */ + /* ??? It is claimed that this should not be necessary. */ + if (cfun) + mark_reg_pointer (arg_pointer_rtx, PARM_BOUNDARY); } + +/* Like arm_compute_initial_elimination offset. Simpler because there + isn't an ABI specified frame pointer for Thumb. Instead, we set it + to point at the base of the local variables after static stack + space for a function has been allocated. */ + HOST_WIDE_INT -thumb_get_frame_size (void) +thumb_compute_initial_elimination_offset (unsigned int from, unsigned int to) { - int regno; + arm_stack_offsets *offsets; - int base_size = ROUND_UP_WORD (get_frame_size ()); - int count_regs = 0; - int entry_size = 0; - int leaf; + offsets = arm_get_frame_offsets (); - if (! TARGET_THUMB) - abort (); - - if (! TARGET_ATPCS) - return base_size; - - /* We need to know if we are a leaf function. Unfortunately, it - is possible to be called after start_sequence has been called, - which causes get_insns to return the insns for the sequence, - not the function, which will cause leaf_function_p to return - the incorrect result. - - To work around this, we cache the computed frame size. This - works because we will only be calling RTL expanders that need - to know about leaf functions once reload has completed, and the - frame size cannot be changed after that time, so we can safely - use the cached value. */ - - if (reload_completed) - return cfun->machine->frame_size; - - leaf = leaf_function_p (); - - /* A leaf function does not need any stack alignment if it has nothing - on the stack. */ - if (leaf && base_size == 0) + switch (from) { - cfun->machine->frame_size = 0; - return 0; + case ARG_POINTER_REGNUM: + switch (to) + { + case STACK_POINTER_REGNUM: + return offsets->outgoing_args - offsets->saved_args; + + case FRAME_POINTER_REGNUM: + return offsets->soft_frame - offsets->saved_args; + + case ARM_HARD_FRAME_POINTER_REGNUM: + return offsets->saved_regs - offsets->saved_args; + + case THUMB_HARD_FRAME_POINTER_REGNUM: + return offsets->locals_base - offsets->saved_args; + + default: + gcc_unreachable (); + } + break; + + case FRAME_POINTER_REGNUM: + switch (to) + { + case STACK_POINTER_REGNUM: + return offsets->outgoing_args - offsets->soft_frame; + + case ARM_HARD_FRAME_POINTER_REGNUM: + return offsets->saved_regs - offsets->soft_frame; + + case THUMB_HARD_FRAME_POINTER_REGNUM: + return offsets->locals_base - offsets->soft_frame; + + default: + gcc_unreachable (); + } + break; + + default: + gcc_unreachable (); } - - /* We know that SP will be word aligned on entry, and we must - preserve that condition at any subroutine call. But those are - the only constraints. */ - - /* Space for variadic functions. */ - if (current_function_pretend_args_size) - entry_size += current_function_pretend_args_size; - - /* Space for pushed lo registers. */ - for (regno = 0; regno <= LAST_LO_REGNUM; regno++) - if (THUMB_REG_PUSHED_P (regno)) - count_regs++; - - /* Space for backtrace structure. */ - if (TARGET_BACKTRACE) - { - if (count_regs == 0 && regs_ever_live[LAST_ARG_REGNUM] != 0) - entry_size += 20; - else - entry_size += 16; - } - - if (count_regs || !leaf || thumb_far_jump_used_p (1)) - count_regs++; /* LR */ - - entry_size += count_regs * 4; - count_regs = 0; - - /* Space for pushed hi regs. */ - for (regno = 8; regno < 13; regno++) - if (THUMB_REG_PUSHED_P (regno)) - count_regs++; - - entry_size += count_regs * 4; - - if ((entry_size + base_size + current_function_outgoing_args_size) & 7) - base_size += 4; - if ((entry_size + base_size + current_function_outgoing_args_size) & 7) - abort (); - - cfun->machine->frame_size = base_size; - - return base_size; } + /* Generate the rest of a function's prologue. */ void thumb_expand_prologue (void) { rtx insn, dwarf; - HOST_WIDE_INT amount = (thumb_get_frame_size () - + current_function_outgoing_args_size); + HOST_WIDE_INT amount; + arm_stack_offsets *offsets; unsigned long func_type; + int regno; + unsigned long live_regs_mask; func_type = arm_current_func_type (); - + /* Naked functions don't have prologues. */ if (IS_NAKED (func_type)) return; @@ -12224,16 +13713,20 @@ thumb_expand_prologue (void) return; } - if (frame_pointer_needed) - { - insn = emit_insn (gen_movsi (hard_frame_pointer_rtx, stack_pointer_rtx)); - RTX_FRAME_RELATED_P (insn) = 1; - } + live_regs_mask = thumb_compute_save_reg_mask (); + /* Load the pic register before setting the frame pointer, + so we can use r7 as a temporary work register. */ + if (flag_pic && arm_pic_register != INVALID_REGNUM) + arm_load_pic_register (live_regs_mask); + if (!frame_pointer_needed && CALLER_INTERWORKING_SLOT_SIZE > 0) + emit_move_insn (gen_rtx_REG (Pmode, ARM_HARD_FRAME_POINTER_REGNUM), + stack_pointer_rtx); + + offsets = arm_get_frame_offsets (); + amount = offsets->outgoing_args - offsets->saved_regs; if (amount) { - amount = ROUND_UP_WORD (amount); - if (amount < 512) { insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, @@ -12242,7 +13735,6 @@ thumb_expand_prologue (void) } else { - int regno; rtx reg; /* The stack decrement is too big for an immediate value in a single @@ -12260,17 +13752,17 @@ thumb_expand_prologue (void) been pushed at the start of the prologue and so we can corrupt it now. */ for (regno = LAST_ARG_REGNUM + 1; regno <= LAST_LO_REGNUM; regno++) - if (THUMB_REG_PUSHED_P (regno) + if (live_regs_mask & (1 << regno) && !(frame_pointer_needed && (regno == THUMB_HARD_FRAME_POINTER_REGNUM))) break; if (regno > LAST_LO_REGNUM) /* Very unlikely. */ { - rtx spare = gen_rtx (REG, SImode, IP_REGNUM); + rtx spare = gen_rtx_REG (SImode, IP_REGNUM); /* Choose an arbitrary, non-argument low register. */ - reg = gen_rtx (REG, SImode, LAST_LO_REGNUM); + reg = gen_rtx_REG (SImode, LAST_LO_REGNUM); /* Save it by copying it into a high, scratch register. */ emit_insn (gen_movsi (spare, reg)); @@ -12282,9 +13774,9 @@ thumb_expand_prologue (void) insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, reg)); RTX_FRAME_RELATED_P (insn) = 1; - dwarf = gen_rtx_SET (SImode, stack_pointer_rtx, + dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx, plus_constant (stack_pointer_rtx, - GEN_INT (- amount))); + -amount)); RTX_FRAME_RELATED_P (dwarf) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, @@ -12292,7 +13784,7 @@ thumb_expand_prologue (void) /* Restore the low register's original value. */ emit_insn (gen_movsi (reg, spare)); - + /* Emit a USE of the restored scratch register, so that flow analysis will not consider the restore redundant. The register won't be used again in this function and isn't @@ -12301,16 +13793,16 @@ thumb_expand_prologue (void) } else { - reg = gen_rtx (REG, SImode, regno); + reg = gen_rtx_REG (SImode, regno); emit_insn (gen_movsi (reg, GEN_INT (- amount))); insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, reg)); RTX_FRAME_RELATED_P (insn) = 1; - dwarf = gen_rtx_SET (SImode, stack_pointer_rtx, + dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx, plus_constant (stack_pointer_rtx, - GEN_INT (- amount))); + -amount)); RTX_FRAME_RELATED_P (dwarf) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, @@ -12318,46 +13810,90 @@ thumb_expand_prologue (void) } } } - - if (current_function_profile || TARGET_NO_SCHED_PRO) + + if (frame_pointer_needed) + { + amount = offsets->outgoing_args - offsets->locals_base; + + if (amount < 1024) + insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, + stack_pointer_rtx, GEN_INT (amount))); + else + { + emit_insn (gen_movsi (hard_frame_pointer_rtx, GEN_INT (amount))); + insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, + hard_frame_pointer_rtx, + stack_pointer_rtx)); + dwarf = gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx, + plus_constant (stack_pointer_rtx, amount)); + RTX_FRAME_RELATED_P (dwarf) = 1; + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf, + REG_NOTES (insn)); + } + + RTX_FRAME_RELATED_P (insn) = 1; + } + + /* If we are profiling, make sure no instructions are scheduled before + the call to mcount. Similarly if the user has requested no + scheduling in the prolog. Similarly if we want non-call exceptions + using the EABI unwinder, to prevent faulting instructions from being + swapped with a stack adjustment. */ + if (current_function_profile || !TARGET_SCHED_PROLOG + || (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions)) emit_insn (gen_blockage ()); + + cfun->machine->lr_save_eliminated = !thumb_force_lr_save (); + if (live_regs_mask & 0xff) + cfun->machine->lr_save_eliminated = 0; + + /* If the link register is being kept alive, with the return address in it, + then make sure that it does not get reused by the ce2 pass. */ + if (cfun->machine->lr_save_eliminated) + emit_insn (gen_prologue_use (gen_rtx_REG (SImode, LR_REGNUM))); } + void thumb_expand_epilogue (void) { - HOST_WIDE_INT amount = (thumb_get_frame_size () - + current_function_outgoing_args_size); + HOST_WIDE_INT amount; + arm_stack_offsets *offsets; int regno; /* Naked functions don't have prologues. */ if (IS_NAKED (arm_current_func_type ())) return; + offsets = arm_get_frame_offsets (); + amount = offsets->outgoing_args - offsets->saved_regs; + if (frame_pointer_needed) - emit_insn (gen_movsi (stack_pointer_rtx, hard_frame_pointer_rtx)); - else if (amount) { - amount = ROUND_UP_WORD (amount); - + emit_insn (gen_movsi (stack_pointer_rtx, hard_frame_pointer_rtx)); + amount = offsets->locals_base - offsets->saved_regs; + } + + if (amount) + { if (amount < 512) emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (amount))); else { /* r3 is always free in the epilogue. */ - rtx reg = gen_rtx (REG, SImode, LAST_ARG_REGNUM); + rtx reg = gen_rtx_REG (SImode, LAST_ARG_REGNUM); emit_insn (gen_movsi (reg, GEN_INT (amount))); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, reg)); } } - + /* Emit a USE (stack_pointer_rtx), so that the stack adjustment will not be deleted. */ emit_insn (gen_prologue_use (stack_pointer_rtx)); - if (current_function_profile || TARGET_NO_SCHED_PRO) + if (current_function_profile || !TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); /* Emit a clobber for each insn that will be restored in the epilogue, @@ -12373,8 +13909,9 @@ thumb_expand_epilogue (void) static void thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { - int live_regs_mask = 0; - int high_regs_pushed = 0; + unsigned long live_regs_mask = 0; + unsigned long l_mask; + unsigned high_regs_pushed = 0; int cfa_offset = 0; int regno; @@ -12385,12 +13922,11 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { const char * name; - if (GET_CODE (DECL_RTL (current_function_decl)) != MEM) - abort (); - if (GET_CODE (XEXP (DECL_RTL (current_function_decl), 0)) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (DECL_RTL (current_function_decl)) == MEM); + gcc_assert (GET_CODE (XEXP (DECL_RTL (current_function_decl), 0)) + == SYMBOL_REF); name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); - + /* Generate code sequence to switch us into Thumb mode. */ /* The .code 32 directive has already been emitted by ASM_DECLARE_FUNCTION_NAME. */ @@ -12403,29 +13939,34 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) is called from a Thumb encoded function elsewhere in the same file. Hence the definition of STUB_NAME here must agree with the definition in gas/config/tc-arm.c. */ - + #define STUB_NAME ".real_start_of" - + fprintf (f, "\t.code\t16\n"); #ifdef ARM_PE if (arm_dllexport_name_p (name)) name = arm_strip_name_encoding (name); -#endif +#endif asm_fprintf (f, "\t.globl %s%U%s\n", STUB_NAME, name); fprintf (f, "\t.thumb_func\n"); asm_fprintf (f, "%s%U%s:\n", STUB_NAME, name); } - + if (current_function_pretend_args_size) { + /* Output unwind directive for the stack adjustment. */ + if (ARM_EABI_UNWIND_TABLES) + fprintf (f, "\t.pad #%d\n", + current_function_pretend_args_size); + if (cfun->machine->uses_anonymous_args) { int num_pushes; - + fprintf (f, "\tpush\t{"); num_pushes = ARM_NUM_INTS (current_function_pretend_args_size); - + for (regno = LAST_ARG_REGNUM + 1 - num_pushes; regno <= LAST_ARG_REGNUM; regno++) @@ -12435,7 +13976,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) fprintf (f, "}\n"); } else - asm_fprintf (f, "\tsub\t%r, %r, #%d\n", + asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, SP_REGNUM, current_function_pretend_args_size); @@ -12445,31 +13986,31 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) if (dwarf2out_do_frame ()) { char *l = dwarf2out_cfi_label (); + cfa_offset = cfa_offset + current_function_pretend_args_size; dwarf2out_def_cfa (l, SP_REGNUM, cfa_offset); } } - for (regno = 0; regno <= LAST_LO_REGNUM; regno++) - if (THUMB_REG_PUSHED_P (regno)) - live_regs_mask |= 1 << regno; - - if (live_regs_mask || !leaf_function_p () || thumb_far_jump_used_p (1)) - live_regs_mask |= 1 << LR_REGNUM; + /* Get the registers we are going to push. */ + live_regs_mask = thumb_compute_save_reg_mask (); + /* Extract a mask of the ones we can give to the Thumb's push instruction. */ + l_mask = live_regs_mask & 0x40ff; + /* Then count how many other high registers will need to be pushed. */ + high_regs_pushed = bit_count (live_regs_mask & 0x0f00); if (TARGET_BACKTRACE) { - int offset; - int work_register = 0; - int wr; - + unsigned offset; + unsigned work_register; + /* We have been asked to create a stack backtrace structure. The code looks like this: - + 0 .align 2 0 func: 0 sub SP, #16 Reserve space for 4 registers. - 2 push {R7} Get a work register. + 2 push {R7} Push low registers. 4 add R7, SP, #20 Get the stack pointer before the push. 6 str R7, [SP, #8] Store the stack pointer (before reserving the space). 8 mov R7, PC Get hold of the start of this code plus 12. @@ -12481,25 +14022,11 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) 20 add R7, SP, #16 Point at the start of the backtrace structure. 22 mov FP, R7 Put this value into the frame pointer. */ - if ((live_regs_mask & 0xFF) == 0) - { - /* See if the a4 register is free. */ + work_register = thumb_find_work_register (live_regs_mask); - if (regs_ever_live [LAST_ARG_REGNUM] == 0) - work_register = LAST_ARG_REGNUM; - else /* We must push a register of our own. */ - live_regs_mask |= (1 << LAST_LO_REGNUM); - } + if (ARM_EABI_UNWIND_TABLES) + asm_fprintf (f, "\t.pad #16\n"); - if (work_register == 0) - { - /* Select a register from the list that will be pushed to - use as our work register. */ - for (work_register = (LAST_LO_REGNUM + 1); work_register--;) - if ((1 << work_register) & live_regs_mask) - break; - } - asm_fprintf (f, "\tsub\t%r, %r, #16\t%@ Create stack backtrace structure\n", SP_REGNUM, SP_REGNUM); @@ -12507,26 +14034,28 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) if (dwarf2out_do_frame ()) { char *l = dwarf2out_cfi_label (); + cfa_offset = cfa_offset + 16; dwarf2out_def_cfa (l, SP_REGNUM, cfa_offset); } - if (live_regs_mask) - thumb_pushpop (f, live_regs_mask, 1, &cfa_offset, live_regs_mask); - - for (offset = 0, wr = 1 << 15; wr != 0; wr >>= 1) - if (wr & live_regs_mask) - offset += 4; - + if (l_mask) + { + thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask); + offset = bit_count (l_mask) * UNITS_PER_WORD; + } + else + offset = 0; + asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM, offset + 16 + current_function_pretend_args_size); - + asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, offset + 4); /* Make sure that the instruction fetching the PC is in the right place to calculate "start of backtrace creation code + 12". */ - if (live_regs_mask) + if (l_mask) { asm_fprintf (f, "\tmov\t%r, %r\n", work_register, PC_REGNUM); asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, @@ -12546,7 +14075,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, offset + 12); } - + asm_fprintf (f, "\tmov\t%r, %r\n", work_register, LR_REGNUM); asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM, offset + 8); @@ -12555,67 +14084,68 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) asm_fprintf (f, "\tmov\t%r, %r\t\t%@ Backtrace structure created\n", ARM_HARD_FRAME_POINTER_REGNUM, work_register); } - else if (live_regs_mask) - thumb_pushpop (f, live_regs_mask, 1, &cfa_offset, live_regs_mask); - - for (regno = 8; regno < 13; regno++) - if (THUMB_REG_PUSHED_P (regno)) - high_regs_pushed++; + /* Optimization: If we are not pushing any low registers but we are going + to push some high registers then delay our first push. This will just + be a push of LR and we can combine it with the push of the first high + register. */ + else if ((l_mask & 0xff) != 0 + || (high_regs_pushed == 0 && l_mask)) + thumb_pushpop (f, l_mask, 1, &cfa_offset, l_mask); if (high_regs_pushed) { - int pushable_regs = 0; - int mask = live_regs_mask & 0xff; - int next_hi_reg; + unsigned pushable_regs; + unsigned next_hi_reg; for (next_hi_reg = 12; next_hi_reg > LAST_LO_REGNUM; next_hi_reg--) - if (THUMB_REG_PUSHED_P (next_hi_reg)) + if (live_regs_mask & (1 << next_hi_reg)) break; - pushable_regs = mask; + pushable_regs = l_mask & 0xff; if (pushable_regs == 0) - { - /* Desperation time -- this probably will never happen. */ - if (THUMB_REG_PUSHED_P (LAST_ARG_REGNUM)) - asm_fprintf (f, "\tmov\t%r, %r\n", IP_REGNUM, LAST_ARG_REGNUM); - mask = 1 << LAST_ARG_REGNUM; - } + pushable_regs = 1 << thumb_find_work_register (live_regs_mask); while (high_regs_pushed > 0) { - int real_regs_mask = 0; + unsigned long real_regs_mask = 0; - for (regno = LAST_LO_REGNUM; regno >= 0; regno--) + for (regno = LAST_LO_REGNUM; regno >= 0; regno --) { - if (mask & (1 << regno)) + if (pushable_regs & (1 << regno)) { asm_fprintf (f, "\tmov\t%r, %r\n", regno, next_hi_reg); - - high_regs_pushed--; + + high_regs_pushed --; real_regs_mask |= (1 << next_hi_reg); - + if (high_regs_pushed) { - for (next_hi_reg--; next_hi_reg > LAST_LO_REGNUM; - next_hi_reg--) - if (THUMB_REG_PUSHED_P (next_hi_reg)) + for (next_hi_reg --; next_hi_reg > LAST_LO_REGNUM; + next_hi_reg --) + if (live_regs_mask & (1 << next_hi_reg)) break; } else { - mask &= ~((1 << regno) - 1); + pushable_regs &= ~((1 << regno) - 1); break; } } } - thumb_pushpop (f, mask, 1, &cfa_offset, real_regs_mask); + /* If we had to find a work register and we have not yet + saved the LR then add it to the list of regs to push. */ + if (l_mask == (1 << LR_REGNUM)) + { + thumb_pushpop (f, pushable_regs | (1 << LR_REGNUM), + 1, &cfa_offset, + real_regs_mask | (1 << LR_REGNUM)); + l_mask = 0; + } + else + thumb_pushpop (f, pushable_regs, 1, &cfa_offset, real_regs_mask); } - - if (pushable_regs == 0 - && (THUMB_REG_PUSHED_P (LAST_ARG_REGNUM))) - asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM); } } @@ -12630,22 +14160,18 @@ thumb_load_double_from_address (rtx *operands) rtx offset; rtx arg1; rtx arg2; - - if (GET_CODE (operands[0]) != REG) - abort (); - - if (GET_CODE (operands[1]) != MEM) - abort (); + + gcc_assert (GET_CODE (operands[0]) == REG); + gcc_assert (GET_CODE (operands[1]) == MEM); /* Get the memory address. */ addr = XEXP (operands[1], 0); - + /* Work out how the memory address is computed. */ switch (GET_CODE (addr)) { case REG: - operands[2] = gen_rtx (MEM, SImode, - plus_constant (XEXP (operands[1], 0), 4)); + operands[2] = adjust_address (operands[1], SImode, 4); if (REGNO (operands[0]) == REGNO (addr)) { @@ -12658,27 +14184,25 @@ thumb_load_double_from_address (rtx *operands) output_asm_insn ("ldr\t%H0, %2", operands); } break; - + case CONST: /* Compute
+ 4 for the high order load. */ - operands[2] = gen_rtx (MEM, SImode, - plus_constant (XEXP (operands[1], 0), 4)); - + operands[2] = adjust_address (operands[1], SImode, 4); + output_asm_insn ("ldr\t%0, %1", operands); output_asm_insn ("ldr\t%H0, %2", operands); break; - + case PLUS: arg1 = XEXP (addr, 0); arg2 = XEXP (addr, 1); - + if (CONSTANT_P (arg1)) base = arg2, offset = arg1; else base = arg1, offset = arg2; - - if (GET_CODE (base) != REG) - abort (); + + gcc_assert (GET_CODE (base) == REG); /* Catch the case of
= + */ if (GET_CODE (offset) == REG) @@ -12686,17 +14210,17 @@ thumb_load_double_from_address (rtx *operands) int reg_offset = REGNO (offset); int reg_base = REGNO (base); int reg_dest = REGNO (operands[0]); - + /* Add the base and offset registers together into the higher destination register. */ asm_fprintf (asm_out_file, "\tadd\t%r, %r, %r", reg_dest + 1, reg_base, reg_offset); - + /* Load the lower destination register from the address in the higher destination register. */ asm_fprintf (asm_out_file, "\tldr\t%r, [%r, #0]", reg_dest, reg_dest + 1); - + /* Load the higher destination register from its own address plus 4. */ asm_fprintf (asm_out_file, "\tldr\t%r, [%r, #4]", @@ -12705,9 +14229,8 @@ thumb_load_double_from_address (rtx *operands) else { /* Compute
+ 4 for the high order load. */ - operands[2] = gen_rtx (MEM, SImode, - plus_constant (XEXP (operands[1], 0), 4)); - + operands[2] = adjust_address (operands[1], SImode, 4); + /* If the computed address is held in the low order register then load the high order register first, otherwise always load the low order register first. */ @@ -12727,18 +14250,16 @@ thumb_load_double_from_address (rtx *operands) case LABEL_REF: /* With no registers to worry about we can just load the value directly. */ - operands[2] = gen_rtx (MEM, SImode, - plus_constant (XEXP (operands[1], 0), 4)); - + operands[2] = adjust_address (operands[1], SImode, 4); + output_asm_insn ("ldr\t%H0, %2", operands); output_asm_insn ("ldr\t%0, %1", operands); break; - + default: - abort (); - break; + gcc_unreachable (); } - + return ""; } @@ -12779,21 +14300,52 @@ thumb_output_move_mem_multiple (int n, rtx *operands) operands[4] = operands[5]; operands[5] = tmp; } - + output_asm_insn ("ldmia\t%1!, {%4, %5, %6}", operands); output_asm_insn ("stmia\t%0!, {%4, %5, %6}", operands); break; default: - abort (); + gcc_unreachable (); } return ""; } +/* Output a call-via instruction for thumb state. */ +const char * +thumb_call_via_reg (rtx reg) +{ + int regno = REGNO (reg); + rtx *labelp; + + gcc_assert (regno < LR_REGNUM); + + /* If we are in the normal text section we can use a single instance + per compilation unit. If we are doing function sections, then we need + an entry per section, since we can't rely on reachability. */ + if (in_section == text_section) + { + thumb_call_reg_needed = 1; + + if (thumb_call_via_label[regno] == NULL) + thumb_call_via_label[regno] = gen_label_rtx (); + labelp = thumb_call_via_label + regno; + } + else + { + if (cfun->machine->call_via[regno] == NULL) + cfun->machine->call_via[regno] = gen_label_rtx (); + labelp = cfun->machine->call_via + regno; + } + + output_asm_insn ("bl\t%a0", labelp); + return ""; +} + /* Routines for generating rtl. */ void -thumb_expand_movstrqi (rtx *operands) +thumb_expand_movmemqi (rtx *operands) { rtx out = copy_to_mode_reg (SImode, XEXP (operands[0], 0)); rtx in = copy_to_mode_reg (SImode, XEXP (operands[1], 0)); @@ -12805,90 +14357,54 @@ thumb_expand_movstrqi (rtx *operands) emit_insn (gen_movmem12b (out, in, out, in)); len -= 12; } - + if (len >= 8) { emit_insn (gen_movmem8b (out, in, out, in)); len -= 8; } - + if (len >= 4) { rtx reg = gen_reg_rtx (SImode); - emit_insn (gen_movsi (reg, gen_rtx (MEM, SImode, in))); - emit_insn (gen_movsi (gen_rtx (MEM, SImode, out), reg)); + emit_insn (gen_movsi (reg, gen_rtx_MEM (SImode, in))); + emit_insn (gen_movsi (gen_rtx_MEM (SImode, out), reg)); len -= 4; offset += 4; } - + if (len >= 2) { rtx reg = gen_reg_rtx (HImode); - emit_insn (gen_movhi (reg, gen_rtx (MEM, HImode, - plus_constant (in, offset)))); - emit_insn (gen_movhi (gen_rtx (MEM, HImode, plus_constant (out, offset)), + emit_insn (gen_movhi (reg, gen_rtx_MEM (HImode, + plus_constant (in, offset)))); + emit_insn (gen_movhi (gen_rtx_MEM (HImode, plus_constant (out, offset)), reg)); len -= 2; offset += 2; } - + if (len) { rtx reg = gen_reg_rtx (QImode); - emit_insn (gen_movqi (reg, gen_rtx (MEM, QImode, - plus_constant (in, offset)))); - emit_insn (gen_movqi (gen_rtx (MEM, QImode, plus_constant (out, offset)), + emit_insn (gen_movqi (reg, gen_rtx_MEM (QImode, + plus_constant (in, offset)))); + emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (out, offset)), reg)); } } -int -thumb_cmp_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT - && INTVAL (op) < 256 - && INTVAL (op) >= 0) - || s_register_operand (op, mode)); -} - -int -thumb_cmpneg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) < 0 - && INTVAL (op) > -256); -} - -/* Return TRUE if a result can be stored in OP without clobbering the - condition code register. Prior to reload we only accept a - register. After reload we have to be able to handle memory as - well, since a pseudo may not get a hard reg and reload cannot - handle output-reloads on jump insns. - - We could possibly handle mem before reload as well, but that might - complicate things with the need to handle increment - side-effects. */ - -int -thumb_cbrch_target_operand (rtx op, enum machine_mode mode) -{ - return (s_register_operand (op, mode) - || ((reload_in_progress || reload_completed) - && memory_operand (op, mode))); -} - -/* Handle storing a half-word to memory during reload. */ void thumb_reload_out_hi (rtx *operands) { emit_insn (gen_thumb_movhi_clobber (operands[0], operands[1], operands[2])); } -/* Handle reading a half-word from memory during reload. */ +/* Handle reading a half-word from memory during reload. */ void thumb_reload_in_hi (rtx *operands ATTRIBUTE_UNUSED) { - abort (); + gcc_unreachable (); } /* Return the length of a function name prefix @@ -12899,7 +14415,7 @@ arm_get_strip_length (int c) switch (c) { ARM_NAME_ENCODING_LENGTHS - default: return 0; + default: return 0; } } @@ -12909,7 +14425,7 @@ const char * arm_strip_name_encoding (const char *name) { int skip; - + while ((skip = arm_get_strip_length (* name))) name += skip; @@ -12937,6 +14453,31 @@ arm_asm_output_labelref (FILE *stream, const char *name) asm_fprintf (stream, "%U%s", name); } +static void +arm_file_end (void) +{ + int regno; + + if (! thumb_call_reg_needed) + return; + + switch_to_section (text_section); + asm_fprintf (asm_out_file, "\t.code 16\n"); + ASM_OUTPUT_ALIGN (asm_out_file, 1); + + for (regno = 0; regno < LR_REGNUM; regno++) + { + rtx label = thumb_call_via_label[regno]; + + if (label != 0) + { + targetm.asm_out.internal_label (asm_out_file, "L", + CODE_LABEL_NUMBER (label)); + asm_fprintf (asm_out_file, "\tbx\t%r\n", regno); + } + } +} + rtx aof_pic_label; #ifdef AOF_ASSEMBLER @@ -12984,7 +14525,7 @@ aof_dump_pic_table (FILE *f) PIC_OFFSET_TABLE_REGNUM, PIC_OFFSET_TABLE_REGNUM); fputs ("|x$adcons|\n", f); - + for (chain = aof_pic_chain; chain; chain = chain->next) { fputs ("\tDCD\t", f); @@ -12995,25 +14536,56 @@ aof_dump_pic_table (FILE *f) int arm_text_section_count = 1; -char * -aof_text_section (void ) +/* A get_unnamed_section callback for switching to the text section. */ + +static void +aof_output_text_section_asm_op (const void *data ATTRIBUTE_UNUSED) { - static char buf[100]; - sprintf (buf, "\tAREA |C$$code%d|, CODE, READONLY", + fprintf (asm_out_file, "\tAREA |C$$code%d|, CODE, READONLY", arm_text_section_count++); if (flag_pic) - strcat (buf, ", PIC, REENTRANT"); - return buf; + fprintf (asm_out_file, ", PIC, REENTRANT"); + fprintf (asm_out_file, "\n"); } static int arm_data_section_count = 1; -char * -aof_data_section (void) +/* A get_unnamed_section callback for switching to the data section. */ + +static void +aof_output_data_section_asm_op (const void *data ATTRIBUTE_UNUSED) { - static char buf[100]; - sprintf (buf, "\tAREA |C$$data%d|, DATA", arm_data_section_count++); - return buf; + fprintf (asm_out_file, "\tAREA |C$$data%d|, DATA\n", + arm_data_section_count++); +} + +/* Implement TARGET_ASM_INIT_SECTIONS. + + AOF Assembler syntax is a nightmare when it comes to areas, since once + we change from one area to another, we can't go back again. Instead, + we must create a new area with the same attributes and add the new output + to that. Unfortunately, there is nothing we can do here to guarantee that + two areas with the same attributes will be linked adjacently in the + resulting executable, so we have to be careful not to do pc-relative + addressing across such boundaries. */ + +static void +aof_asm_init_sections (void) +{ + text_section = get_unnamed_section (SECTION_CODE, + aof_output_text_section_asm_op, NULL); + data_section = get_unnamed_section (SECTION_WRITE, + aof_output_data_section_asm_op, NULL); + readonly_data_section = text_section; +} + +void +zero_init_section (void) +{ + static int zero_init_count = 1; + + fprintf (asm_out_file, "\tAREA |C$$zidata%d|,NOINIT\n", zero_init_count++); + in_section = NULL; } /* The AOF assembler is religiously strict about declarations of @@ -13074,7 +14646,7 @@ aof_dump_imports (FILE *f) automagically. */ if (arm_main_function) { - text_section (); + switch_to_section (text_section); fputs ("\tIMPORT __main\n", f); fputs ("\tDCD __main\n", f); } @@ -13125,7 +14697,7 @@ aof_file_start (void) fputs ("__f5\tFN\t5\n", asm_out_file); fputs ("__f6\tFN\t6\n", asm_out_file); fputs ("__f7\tFN\t7\n", asm_out_file); - text_section (); + switch_to_section (text_section); } static void @@ -13133,67 +14705,12 @@ aof_file_end (void) { if (flag_pic) aof_dump_pic_table (asm_out_file); + arm_file_end (); aof_dump_imports (asm_out_file); fputs ("\tEND\n", asm_out_file); } #endif /* AOF_ASSEMBLER */ -#ifdef OBJECT_FORMAT_ELF -/* Switch to an arbitrary section NAME with attributes as specified - by FLAGS. ALIGN specifies any known alignment requirements for - the section; 0 if the default should be used. - - Differs from the default elf version only in the prefix character - used before the section type. */ - -static void -arm_elf_asm_named_section (const char *name, unsigned int flags) -{ - char flagchars[10], *f = flagchars; - - if (! named_section_first_declaration (name)) - { - fprintf (asm_out_file, "\t.section\t%s\n", name); - return; - } - - if (!(flags & SECTION_DEBUG)) - *f++ = 'a'; - if (flags & SECTION_WRITE) - *f++ = 'w'; - if (flags & SECTION_CODE) - *f++ = 'x'; - if (flags & SECTION_SMALL) - *f++ = 's'; - if (flags & SECTION_MERGE) - *f++ = 'M'; - if (flags & SECTION_STRINGS) - *f++ = 'S'; - if (flags & SECTION_TLS) - *f++ = 'T'; - *f = '\0'; - - fprintf (asm_out_file, "\t.section\t%s,\"%s\"", name, flagchars); - - if (!(flags & SECTION_NOTYPE)) - { - const char *type; - - if (flags & SECTION_BSS) - type = "nobits"; - else - type = "progbits"; - - fprintf (asm_out_file, ",%%%s", type); - - if (flags & SECTION_ENTSIZE) - fprintf (asm_out_file, ",%d", flags & SECTION_ENTSIZE); - } - - putc ('\n', asm_out_file); -} -#endif - #ifndef ARM_PE /* Symbols in the text segment can be accessed without indirecting via the constant pool; it may take an extra binary operation, but this is still @@ -13207,21 +14724,22 @@ arm_encode_section_info (tree decl, rtx rtl, int first) /* This doesn't work with AOF syntax, since the string table may be in a different AREA. */ #ifndef AOF_ASSEMBLER - if (optimize > 0 && TREE_CONSTANT (decl) - && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST)) + if (optimize > 0 && TREE_CONSTANT (decl)) SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; #endif /* If we are referencing a function that is weak then encode a long call flag in the function name, otherwise if the function is static or or known to be defined in this file then encode a short call flag. */ - if (first && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') + if (first && DECL_P (decl)) { if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl)) arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR); else if (! TREE_PUBLIC (decl)) arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); } + + default_encode_section_info (decl, rtl, first); } #endif /* !ARM_PE */ @@ -13247,6 +14765,7 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, { static int thunk_label = 0; char label[256]; + char labelpc[256]; int mi_delta = delta; const char *const mi_op = mi_delta < 0 ? "sub" : "add"; int shift = 0; @@ -13261,6 +14780,23 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, fputs ("\tldr\tr12, ", file); assemble_name (file, label); fputc ('\n', file); + if (flag_pic) + { + /* If we are generating PIC, the ldr instruction below loads + "(target - 7) - .LTHUNKPCn" into r12. The pc reads as + the address of the add + 8, so we have: + + r12 = (target - 7) - .LTHUNKPCn + (.LTHUNKPCn + 8) + = target + 1. + + Note that we have "+ 1" because some versions of GNU ld + don't set the low bit of the result for R_ARM_REL32 + relocations against thumb function symbols. */ + ASM_GENERATE_INTERNAL_LABEL (labelpc, "LTHUNKPC", labelno); + assemble_name (file, labelpc); + fputs (":\n", file); + fputs ("\tadd\tr12, pc, r12\n", file); + } } while (mi_delta != 0) { @@ -13281,7 +14817,20 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, ASM_OUTPUT_ALIGN (file, 2); assemble_name (file, label); fputs (":\n", file); - assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1); + if (flag_pic) + { + /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */ + rtx tem = XEXP (DECL_RTL (function), 0); + tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7)); + tem = gen_rtx_MINUS (GET_MODE (tem), + tem, + gen_rtx_SYMBOL_REF (Pmode, + ggc_strdup (labelpc))); + assemble_integer (tem, 4, BITS_PER_WORD, 1); + } + else + /* Output ".word .LTHUNKn". */ + assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1); } else { @@ -13299,15 +14848,14 @@ arm_emit_vector_const (FILE *file, rtx x) int i; const char * pattern; - if (GET_CODE (x) != CONST_VECTOR) - abort (); + gcc_assert (GET_CODE (x) == CONST_VECTOR); switch (GET_MODE (x)) { case V2SImode: pattern = "%08x"; break; case V4HImode: pattern = "%04x"; break; case V8QImode: pattern = "%02x"; break; - default: abort (); + default: gcc_unreachable (); } fprintf (file, "0x"); @@ -13329,15 +14877,15 @@ arm_output_load_gr (rtx *operands) rtx offset; rtx wcgr; rtx sum; - + if (GET_CODE (operands [1]) != MEM || GET_CODE (sum = XEXP (operands [1], 0)) != PLUS || GET_CODE (reg = XEXP (sum, 0)) != REG || GET_CODE (offset = XEXP (sum, 1)) != CONST_INT || ((INTVAL (offset) < 1024) && (INTVAL (offset) > -1024))) return "wldrw%?\t%0, %1"; - - /* Fix up an out-of-range load of a GR register. */ + + /* Fix up an out-of-range load of a GR register. */ output_asm_insn ("str%?\t%0, [sp, #-4]!\t@ Start of GR load expansion", & reg); wcgr = operands[0]; operands[0] = reg; @@ -13350,3 +14898,740 @@ arm_output_load_gr (rtx *operands) return ""; } + +/* Worker function for TARGET_SETUP_INCOMING_VARARGS. + + On the ARM, PRETEND_SIZE is set in order to have the prologue push the last + named arg and all anonymous args onto the stack. + XXX I know the prologue shouldn't be pushing registers, but it is faster + that way. */ + +static void +arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + int *pretend_size, + int second_time ATTRIBUTE_UNUSED) +{ + cfun->machine->uses_anonymous_args = 1; + if (cum->nregs < NUM_ARG_REGS) + *pretend_size = (NUM_ARG_REGS - cum->nregs) * UNITS_PER_WORD; +} + +/* Return nonzero if the CONSUMER instruction (a store) does not need + PRODUCER's value to calculate the address. */ + +int +arm_no_early_store_addr_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx addr = PATTERN (consumer); + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (addr) == COND_EXEC) + addr = COND_EXEC_CODE (addr); + if (GET_CODE (addr) == PARALLEL) + addr = XVECEXP (addr, 0, 0); + addr = XEXP (addr, 0); + + return !reg_overlap_mentioned_p (value, addr); +} + +/* Return nonzero if the CONSUMER instruction (an ALU op) does not + have an early register shift value or amount dependency on the + result of PRODUCER. */ + +int +arm_no_early_alu_shift_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the whole shift + operation. */ + if (GET_CODE (early_op) == REG) + early_op = op; + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return nonzero if the CONSUMER instruction (an ALU op) does not + have an early register shift value dependency on the result of + PRODUCER. */ + +int +arm_no_early_alu_shift_value_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the value being + shifted, in either case. */ + if (GET_CODE (early_op) != REG) + early_op = XEXP (early_op, 0); + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return nonzero if the CONSUMER (a mul or mac op) does not + have an early register mult dependency on the result of + PRODUCER. */ + +int +arm_no_early_mul_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + return (GET_CODE (op) == PLUS + && !reg_overlap_mentioned_p (value, XEXP (op, 0))); +} + + +/* We can't rely on the caller doing the proper promotion when + using APCS or ATPCS. */ + +static bool +arm_promote_prototypes (tree t ATTRIBUTE_UNUSED) +{ + return !TARGET_AAPCS_BASED; +} + + +/* AAPCS based ABIs use short enums by default. */ + +static bool +arm_default_short_enums (void) +{ + return TARGET_AAPCS_BASED && arm_abi != ARM_ABI_AAPCS_LINUX; +} + + +/* AAPCS requires that anonymous bitfields affect structure alignment. */ + +static bool +arm_align_anon_bitfield (void) +{ + return TARGET_AAPCS_BASED; +} + + +/* The generic C++ ABI says 64-bit (long long). The EABI says 32-bit. */ + +static tree +arm_cxx_guard_type (void) +{ + return TARGET_AAPCS_BASED ? integer_type_node : long_long_integer_type_node; +} + + +/* The EABI says test the least significant bit of a guard variable. */ + +static bool +arm_cxx_guard_mask_bit (void) +{ + return TARGET_AAPCS_BASED; +} + + +/* The EABI specifies that all array cookies are 8 bytes long. */ + +static tree +arm_get_cookie_size (tree type) +{ + tree size; + + if (!TARGET_AAPCS_BASED) + return default_cxx_get_cookie_size (type); + + size = build_int_cst (sizetype, 8); + return size; +} + + +/* The EABI says that array cookies should also contain the element size. */ + +static bool +arm_cookie_has_size (void) +{ + return TARGET_AAPCS_BASED; +} + + +/* The EABI says constructors and destructors should return a pointer to + the object constructed/destroyed. */ + +static bool +arm_cxx_cdtor_returns_this (void) +{ + return TARGET_AAPCS_BASED; +} + +/* The EABI says that an inline function may never be the key + method. */ + +static bool +arm_cxx_key_method_may_be_inline (void) +{ + return !TARGET_AAPCS_BASED; +} + +static void +arm_cxx_determine_class_data_visibility (tree decl) +{ + if (!TARGET_AAPCS_BASED) + return; + + /* In general, \S 3.2.5.5 of the ARM EABI requires that class data + is exported. However, on systems without dynamic vague linkage, + \S 3.2.5.6 says that COMDAT class data has hidden linkage. */ + if (!TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P && DECL_COMDAT (decl)) + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + else + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; +} + +static bool +arm_cxx_class_data_always_comdat (void) +{ + /* \S 3.2.5.4 of the ARM C++ ABI says that class data only have + vague linkage if the class has no key function. */ + return !TARGET_AAPCS_BASED; +} + + +/* The EABI says __aeabi_atexit should be used to register static + destructors. */ + +static bool +arm_cxx_use_aeabi_atexit (void) +{ + return TARGET_AAPCS_BASED; +} + + +void +arm_set_return_address (rtx source, rtx scratch) +{ + arm_stack_offsets *offsets; + HOST_WIDE_INT delta; + rtx addr; + unsigned long saved_regs; + + saved_regs = arm_compute_save_reg_mask (); + + if ((saved_regs & (1 << LR_REGNUM)) == 0) + emit_move_insn (gen_rtx_REG (Pmode, LR_REGNUM), source); + else + { + if (frame_pointer_needed) + addr = plus_constant(hard_frame_pointer_rtx, -4); + else + { + /* LR will be the first saved register. */ + offsets = arm_get_frame_offsets (); + delta = offsets->outgoing_args - (offsets->frame + 4); + + + if (delta >= 4096) + { + emit_insn (gen_addsi3 (scratch, stack_pointer_rtx, + GEN_INT (delta & ~4095))); + addr = scratch; + delta &= 4095; + } + else + addr = stack_pointer_rtx; + + addr = plus_constant (addr, delta); + } + emit_move_insn (gen_frame_mem (Pmode, addr), source); + } +} + + +void +thumb_set_return_address (rtx source, rtx scratch) +{ + arm_stack_offsets *offsets; + HOST_WIDE_INT delta; + int reg; + rtx addr; + unsigned long mask; + + emit_insn (gen_rtx_USE (VOIDmode, source)); + + mask = thumb_compute_save_reg_mask (); + if (mask & (1 << LR_REGNUM)) + { + offsets = arm_get_frame_offsets (); + + /* Find the saved regs. */ + if (frame_pointer_needed) + { + delta = offsets->soft_frame - offsets->saved_args; + reg = THUMB_HARD_FRAME_POINTER_REGNUM; + } + else + { + delta = offsets->outgoing_args - offsets->saved_args; + reg = SP_REGNUM; + } + /* Allow for the stack frame. */ + if (TARGET_BACKTRACE) + delta -= 16; + /* The link register is always the first saved register. */ + delta -= 4; + + /* Construct the address. */ + addr = gen_rtx_REG (SImode, reg); + if ((reg != SP_REGNUM && delta >= 128) + || delta >= 1024) + { + emit_insn (gen_movsi (scratch, GEN_INT (delta))); + emit_insn (gen_addsi3 (scratch, scratch, stack_pointer_rtx)); + addr = scratch; + } + else + addr = plus_constant (addr, delta); + + emit_move_insn (gen_frame_mem (Pmode, addr), source); + } + else + emit_move_insn (gen_rtx_REG (Pmode, LR_REGNUM), source); +} + +/* Implements target hook vector_mode_supported_p. */ +bool +arm_vector_mode_supported_p (enum machine_mode mode) +{ + if ((mode == V2SImode) + || (mode == V4HImode) + || (mode == V8QImode)) + return true; + + return false; +} + +/* Implement TARGET_SHIFT_TRUNCATION_MASK. SImode shifts use normal + ARM insns and therefore guarantee that the shift count is modulo 256. + DImode shifts (those implemented by lib1funcs.asm or by optabs.c) + guarantee no particular behavior for out-of-range counts. */ + +static unsigned HOST_WIDE_INT +arm_shift_truncation_mask (enum machine_mode mode) +{ + return mode == SImode ? 255 : 0; +} + + +/* Map internal gcc register numbers to DWARF2 register numbers. */ + +unsigned int +arm_dbx_register_number (unsigned int regno) +{ + if (regno < 16) + return regno; + + /* TODO: Legacy targets output FPA regs as registers 16-23 for backwards + compatibility. The EABI defines them as registers 96-103. */ + if (IS_FPA_REGNUM (regno)) + return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM; + + if (IS_VFP_REGNUM (regno)) + return 64 + regno - FIRST_VFP_REGNUM; + + if (IS_IWMMXT_GR_REGNUM (regno)) + return 104 + regno - FIRST_IWMMXT_GR_REGNUM; + + if (IS_IWMMXT_REGNUM (regno)) + return 112 + regno - FIRST_IWMMXT_REGNUM; + + gcc_unreachable (); +} + + +#ifdef TARGET_UNWIND_INFO +/* Emit unwind directives for a store-multiple instruction. This should + only ever be generated by the function prologue code, so we expect it + to have a particular form. */ + +static void +arm_unwind_emit_stm (FILE * asm_out_file, rtx p) +{ + int i; + HOST_WIDE_INT offset; + HOST_WIDE_INT nregs; + int reg_size; + unsigned reg; + unsigned lastreg; + rtx e; + + /* First insn will adjust the stack pointer. */ + e = XVECEXP (p, 0, 0); + if (GET_CODE (e) != SET + || GET_CODE (XEXP (e, 0)) != REG + || REGNO (XEXP (e, 0)) != SP_REGNUM + || GET_CODE (XEXP (e, 1)) != PLUS) + abort (); + + offset = -INTVAL (XEXP (XEXP (e, 1), 1)); + nregs = XVECLEN (p, 0) - 1; + + reg = REGNO (XEXP (XVECEXP (p, 0, 1), 1)); + if (reg < 16) + { + /* The function prologue may also push pc, but not annotate it as it is + never restored. We turn this into a stack pointer adjustment. */ + if (nregs * 4 == offset - 4) + { + fprintf (asm_out_file, "\t.pad #4\n"); + offset -= 4; + } + reg_size = 4; + } + else if (IS_VFP_REGNUM (reg)) + { + /* FPA register saves use an additional word. */ + offset -= 4; + reg_size = 8; + } + else if (reg >= FIRST_FPA_REGNUM && reg <= LAST_FPA_REGNUM) + { + /* FPA registers are done differently. */ + asm_fprintf (asm_out_file, "\t.save %r, %wd\n", reg, nregs); + return; + } + else + /* Unknown register type. */ + abort (); + + /* If the stack increment doesn't match the size of the saved registers, + something has gone horribly wrong. */ + if (offset != nregs * reg_size) + abort (); + + fprintf (asm_out_file, "\t.save {"); + + offset = 0; + lastreg = 0; + /* The remaining insns will describe the stores. */ + for (i = 1; i <= nregs; i++) + { + /* Expect (set (mem ) (reg)). + Where is (reg:SP) or (plus (reg:SP) (const_int)). */ + e = XVECEXP (p, 0, i); + if (GET_CODE (e) != SET + || GET_CODE (XEXP (e, 0)) != MEM + || GET_CODE (XEXP (e, 1)) != REG) + abort (); + + reg = REGNO (XEXP (e, 1)); + if (reg < lastreg) + abort (); + + if (i != 1) + fprintf (asm_out_file, ", "); + /* We can't use %r for vfp because we need to use the + double precision register names. */ + if (IS_VFP_REGNUM (reg)) + asm_fprintf (asm_out_file, "d%d", (reg - FIRST_VFP_REGNUM) / 2); + else + asm_fprintf (asm_out_file, "%r", reg); + +#ifdef ENABLE_CHECKING + /* Check that the addresses are consecutive. */ + e = XEXP (XEXP (e, 0), 0); + if (GET_CODE (e) == PLUS) + { + offset += reg_size; + if (GET_CODE (XEXP (e, 0)) != REG + || REGNO (XEXP (e, 0)) != SP_REGNUM + || GET_CODE (XEXP (e, 1)) != CONST_INT + || offset != INTVAL (XEXP (e, 1))) + abort (); + } + else if (i != 1 + || GET_CODE (e) != REG + || REGNO (e) != SP_REGNUM) + abort (); +#endif + } + fprintf (asm_out_file, "}\n"); +} + +/* Emit unwind directives for a SET. */ + +static void +arm_unwind_emit_set (FILE * asm_out_file, rtx p) +{ + rtx e0; + rtx e1; + + e0 = XEXP (p, 0); + e1 = XEXP (p, 1); + switch (GET_CODE (e0)) + { + case MEM: + /* Pushing a single register. */ + if (GET_CODE (XEXP (e0, 0)) != PRE_DEC + || GET_CODE (XEXP (XEXP (e0, 0), 0)) != REG + || REGNO (XEXP (XEXP (e0, 0), 0)) != SP_REGNUM) + abort (); + + asm_fprintf (asm_out_file, "\t.save "); + if (IS_VFP_REGNUM (REGNO (e1))) + asm_fprintf(asm_out_file, "{d%d}\n", + (REGNO (e1) - FIRST_VFP_REGNUM) / 2); + else + asm_fprintf(asm_out_file, "{%r}\n", REGNO (e1)); + break; + + case REG: + if (REGNO (e0) == SP_REGNUM) + { + /* A stack increment. */ + if (GET_CODE (e1) != PLUS + || GET_CODE (XEXP (e1, 0)) != REG + || REGNO (XEXP (e1, 0)) != SP_REGNUM + || GET_CODE (XEXP (e1, 1)) != CONST_INT) + abort (); + + asm_fprintf (asm_out_file, "\t.pad #%wd\n", + -INTVAL (XEXP (e1, 1))); + } + else if (REGNO (e0) == HARD_FRAME_POINTER_REGNUM) + { + HOST_WIDE_INT offset; + unsigned reg; + + if (GET_CODE (e1) == PLUS) + { + if (GET_CODE (XEXP (e1, 0)) != REG + || GET_CODE (XEXP (e1, 1)) != CONST_INT) + abort (); + reg = REGNO (XEXP (e1, 0)); + offset = INTVAL (XEXP (e1, 1)); + asm_fprintf (asm_out_file, "\t.setfp %r, %r, #%wd\n", + HARD_FRAME_POINTER_REGNUM, reg, + INTVAL (XEXP (e1, 1))); + } + else if (GET_CODE (e1) == REG) + { + reg = REGNO (e1); + asm_fprintf (asm_out_file, "\t.setfp %r, %r\n", + HARD_FRAME_POINTER_REGNUM, reg); + } + else + abort (); + } + else if (GET_CODE (e1) == REG && REGNO (e1) == SP_REGNUM) + { + /* Move from sp to reg. */ + asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0)); + } + else if (GET_CODE (e1) == PLUS + && GET_CODE (XEXP (e1, 0)) == REG + && REGNO (XEXP (e1, 0)) == SP_REGNUM + && GET_CODE (XEXP (e1, 1)) == CONST_INT) + { + /* Set reg to offset from sp. */ + asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n", + REGNO (e0), (int)INTVAL(XEXP (e1, 1))); + } + else + abort (); + break; + + default: + abort (); + } +} + + +/* Emit unwind directives for the given insn. */ + +static void +arm_unwind_emit (FILE * asm_out_file, rtx insn) +{ + rtx pat; + + if (!ARM_EABI_UNWIND_TABLES) + return; + + if (GET_CODE (insn) == NOTE || !RTX_FRAME_RELATED_P (insn)) + return; + + pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX); + if (pat) + pat = XEXP (pat, 0); + else + pat = PATTERN (insn); + + switch (GET_CODE (pat)) + { + case SET: + arm_unwind_emit_set (asm_out_file, pat); + break; + + case SEQUENCE: + /* Store multiple. */ + arm_unwind_emit_stm (asm_out_file, pat); + break; + + default: + abort(); + } +} + + +/* Output a reference from a function exception table to the type_info + object X. The EABI specifies that the symbol should be relocated by + an R_ARM_TARGET2 relocation. */ + +static bool +arm_output_ttype (rtx x) +{ + fputs ("\t.word\t", asm_out_file); + output_addr_const (asm_out_file, x); + /* Use special relocations for symbol references. */ + if (GET_CODE (x) != CONST_INT) + fputs ("(TARGET2)", asm_out_file); + fputc ('\n', asm_out_file); + + return TRUE; +} +#endif /* TARGET_UNWIND_INFO */ + + +/* Output unwind directives for the start/end of a function. */ + +void +arm_output_fn_unwind (FILE * f, bool prologue) +{ + if (!ARM_EABI_UNWIND_TABLES) + return; + + if (prologue) + fputs ("\t.fnstart\n", f); + else + fputs ("\t.fnend\n", f); +} + +static bool +arm_emit_tls_decoration (FILE *fp, rtx x) +{ + enum tls_reloc reloc; + rtx val; + + val = XVECEXP (x, 0, 0); + reloc = INTVAL (XVECEXP (x, 0, 1)); + + output_addr_const (fp, val); + + switch (reloc) + { + case TLS_GD32: + fputs ("(tlsgd)", fp); + break; + case TLS_LDM32: + fputs ("(tlsldm)", fp); + break; + case TLS_LDO32: + fputs ("(tlsldo)", fp); + break; + case TLS_IE32: + fputs ("(gottpoff)", fp); + break; + case TLS_LE32: + fputs ("(tpoff)", fp); + break; + default: + gcc_unreachable (); + } + + switch (reloc) + { + case TLS_GD32: + case TLS_LDM32: + case TLS_IE32: + fputs (" + (. - ", fp); + output_addr_const (fp, XVECEXP (x, 0, 2)); + fputs (" - ", fp); + output_addr_const (fp, XVECEXP (x, 0, 3)); + fputc (')', fp); + break; + default: + break; + } + + return TRUE; +} + +bool +arm_output_addr_const_extra (FILE *fp, rtx x) +{ + if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_TLS) + return arm_emit_tls_decoration (fp, x); + else if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_PIC_LABEL) + { + char label[256]; + int labelno = INTVAL (XVECEXP (x, 0, 0)); + + ASM_GENERATE_INTERNAL_LABEL (label, "LPIC", labelno); + assemble_name_raw (fp, label); + + return TRUE; + } + else if (GET_CODE (x) == CONST_VECTOR) + return arm_emit_vector_const (fp, x); + + return FALSE; +} + +#include "gt-arm.h" diff --git a/contrib/gcc/config/arm/arm.h b/contrib/gcc/config/arm/arm.h index 94d8b943b41..784142cfb77 100644 --- a/contrib/gcc/config/arm/arm.h +++ b/contrib/gcc/config/arm/arm.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -20,19 +20,24 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #ifndef GCC_ARM_H #define GCC_ARM_H +/* The architecture define. */ +extern char arm_arch_name[]; + /* Target CPU builtins. */ #define TARGET_CPU_CPP_BUILTINS() \ do \ { \ - if (TARGET_ARM) \ - builtin_define ("__arm__"); \ - else \ + /* Define __arm__ even when in thumb mode, for \ + consistency with armcc. */ \ + builtin_define ("__arm__"); \ + builtin_define ("__APCS_32__"); \ + if (TARGET_THUMB) \ builtin_define ("__thumb__"); \ \ if (TARGET_BIG_END) \ @@ -50,60 +55,53 @@ builtin_define ("__THUMBEL__"); \ } \ \ - if (TARGET_APCS_32) \ - builtin_define ("__APCS_32__"); \ - else \ - builtin_define ("__APCS_26__"); \ - \ if (TARGET_SOFT_FLOAT) \ builtin_define ("__SOFTFP__"); \ \ - /* FIXME: TARGET_HARD_FLOAT currently implies \ - FPA. */ \ - if (TARGET_VFP && !TARGET_HARD_FLOAT) \ + if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ /* Add a define for interworking. \ Needed when building libgcc.a. */ \ - if (TARGET_INTERWORK) \ + if (arm_cpp_interwork) \ builtin_define ("__THUMB_INTERWORK__"); \ \ builtin_assert ("cpu=arm"); \ builtin_assert ("machine=arm"); \ + \ + builtin_define (arm_arch_name); \ + if (arm_arch_cirrus) \ + builtin_define ("__MAVERICK__"); \ + if (arm_arch_xscale) \ + builtin_define ("__XSCALE__"); \ + if (arm_arch_iwmmxt) \ + builtin_define ("__IWMMXT__"); \ + if (TARGET_AAPCS_BASED) \ + builtin_define ("__ARM_EABI__"); \ } while (0) -#define TARGET_CPU_arm2 0x0000 -#define TARGET_CPU_arm250 0x0000 -#define TARGET_CPU_arm3 0x0000 -#define TARGET_CPU_arm6 0x0001 -#define TARGET_CPU_arm600 0x0001 -#define TARGET_CPU_arm610 0x0002 -#define TARGET_CPU_arm7 0x0001 -#define TARGET_CPU_arm7m 0x0004 -#define TARGET_CPU_arm7dm 0x0004 -#define TARGET_CPU_arm7dmi 0x0004 -#define TARGET_CPU_arm700 0x0001 -#define TARGET_CPU_arm710 0x0002 -#define TARGET_CPU_arm7100 0x0002 -#define TARGET_CPU_arm7500 0x0002 -#define TARGET_CPU_arm7500fe 0x1001 -#define TARGET_CPU_arm7tdmi 0x0008 -#define TARGET_CPU_arm8 0x0010 -#define TARGET_CPU_arm810 0x0020 -#define TARGET_CPU_strongarm 0x0040 -#define TARGET_CPU_strongarm110 0x0040 -#define TARGET_CPU_strongarm1100 0x0040 -#define TARGET_CPU_arm9 0x0080 -#define TARGET_CPU_arm9tdmi 0x0080 -#define TARGET_CPU_xscale 0x0100 -#define TARGET_CPU_ep9312 0x0200 -#define TARGET_CPU_iwmmxt 0x0400 -#define TARGET_CPU_arm926ej_s 0x0800 -#define TARGET_CPU_arm1026ej_s 0x1000 -#define TARGET_CPU_arm1136j_s 0x2000 -#define TARGET_CPU_arm1136jf_s 0x4000 -/* Configure didn't specify. */ -#define TARGET_CPU_generic 0x8000 +/* The various ARM cores. */ +enum processor_type +{ +#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ + IDENT, +#include "arm-cores.def" +#undef ARM_CORE + /* Used to indicate that no processor has been specified. */ + arm_none +}; + +enum target_cpus +{ +#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ + TARGET_CPU_##IDENT, +#include "arm-cores.def" +#undef ARM_CORE + TARGET_CPU_generic +}; + +/* The processor for which instructions should be scheduled. */ +extern enum processor_type arm_tune; typedef enum arm_cond_code { @@ -119,10 +117,6 @@ extern arm_cc arm_current_cc; extern int arm_target_label; extern int arm_ccfsm_state; extern GTY(()) rtx arm_target_insn; -/* Run-time compilation parameters selecting different hardware subsets. */ -extern int target_flags; -/* The floating point instruction architecture, can be 2 or 3 */ -extern const char * target_fp_name; /* Define the information needed to generate branch insns. This is stored from the compare operation. */ extern GTY(()) rtx arm_compare_op0; @@ -140,147 +134,14 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_CPU_DEFAULT TARGET_CPU_generic #endif -/* If the configuration file doesn't specify the cpu, the subtarget may - override it. If it doesn't, then default to an ARM6. */ -#if TARGET_CPU_DEFAULT == TARGET_CPU_generic -#undef TARGET_CPU_DEFAULT - -#ifdef SUBTARGET_CPU_DEFAULT -#define TARGET_CPU_DEFAULT SUBTARGET_CPU_DEFAULT -#else -#define TARGET_CPU_DEFAULT TARGET_CPU_arm6 -#endif -#endif - -#if TARGET_CPU_DEFAULT == TARGET_CPU_arm2 -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_2__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_arm6 || TARGET_CPU_DEFAULT == TARGET_CPU_arm610 || TARGET_CPU_DEFAULT == TARGET_CPU_arm7500fe -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_3__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_arm7m -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_3M__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_arm7tdmi || TARGET_CPU_DEFAULT == TARGET_CPU_arm9 || TARGET_CPU_DEFAULT == TARGET_CPU_arm9tdmi -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4T__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_arm8 || TARGET_CPU_DEFAULT == TARGET_CPU_arm810 || TARGET_CPU_DEFAULT == TARGET_CPU_strongarm || TARGET_CPU_DEFAULT == TARGET_CPU_strongarm110 || TARGET_CPU_DEFAULT == TARGET_CPU_strongarm1100 -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_xscale -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__" -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_ep9312 -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_4T__ -D__MAVERICK__" -/* Set TARGET_DEFAULT to the default, but without soft-float. */ -#ifdef TARGET_DEFAULT -#undef TARGET_DEFAULT -#define TARGET_DEFAULT \ - (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | ARM_FLAG_APCS_FRAME) -#endif -#else -#if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt -#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__" -#else -#error Unrecognized value in TARGET_CPU_DEFAULT. -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif #undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec) \ -%{mapcs-32:%{mapcs-26: \ - %e-mapcs-26 and -mapcs-32 may not be used together}} \ +#define CPP_SPEC "%(subtarget_cpp_spec) \ %{msoft-float:%{mhard-float: \ %e-msoft-float and -mhard_float may not be used together}} \ %{mbig-endian:%{mlittle-endian: \ %e-mbig-endian and -mlittle-endian may not be used together}}" -/* Set the architecture define -- if -march= is set, then it overrides - the -mcpu= setting. */ -#define CPP_CPU_ARCH_SPEC "\ -%{march=arm2:-D__ARM_ARCH_2__} \ -%{march=arm250:-D__ARM_ARCH_2__} \ -%{march=arm3:-D__ARM_ARCH_2__} \ -%{march=arm6:-D__ARM_ARCH_3__} \ -%{march=arm600:-D__ARM_ARCH_3__} \ -%{march=arm610:-D__ARM_ARCH_3__} \ -%{march=arm7:-D__ARM_ARCH_3__} \ -%{march=arm700:-D__ARM_ARCH_3__} \ -%{march=arm710:-D__ARM_ARCH_3__} \ -%{march=arm720:-D__ARM_ARCH_3__} \ -%{march=arm7100:-D__ARM_ARCH_3__} \ -%{march=arm7500:-D__ARM_ARCH_3__} \ -%{march=arm7500fe:-D__ARM_ARCH_3__} \ -%{march=arm7m:-D__ARM_ARCH_3M__} \ -%{march=arm7dm:-D__ARM_ARCH_3M__} \ -%{march=arm7dmi:-D__ARM_ARCH_3M__} \ -%{march=arm7tdmi:-D__ARM_ARCH_4T__} \ -%{march=arm8:-D__ARM_ARCH_4__} \ -%{march=arm810:-D__ARM_ARCH_4__} \ -%{march=arm9:-D__ARM_ARCH_4T__} \ -%{march=arm920:-D__ARM_ARCH_4__} \ -%{march=arm920t:-D__ARM_ARCH_4T__} \ -%{march=arm9tdmi:-D__ARM_ARCH_4T__} \ -%{march=strongarm:-D__ARM_ARCH_4__} \ -%{march=strongarm110:-D__ARM_ARCH_4__} \ -%{march=strongarm1100:-D__ARM_ARCH_4__} \ -%{march=xscale:-D__ARM_ARCH_5TE__} \ -%{march=xscale:-D__XSCALE__} \ -%{march=ep9312:-D__ARM_ARCH_4T__} \ -%{march=ep9312:-D__MAVERICK__} \ -%{march=armv2:-D__ARM_ARCH_2__} \ -%{march=armv2a:-D__ARM_ARCH_2__} \ -%{march=armv3:-D__ARM_ARCH_3__} \ -%{march=armv3m:-D__ARM_ARCH_3M__} \ -%{march=armv4:-D__ARM_ARCH_4__} \ -%{march=armv4t:-D__ARM_ARCH_4T__} \ -%{march=armv5:-D__ARM_ARCH_5__} \ -%{march=armv5t:-D__ARM_ARCH_5T__} \ -%{march=armv5e:-D__ARM_ARCH_5E__} \ -%{march=armv5te:-D__ARM_ARCH_5TE__} \ -%{!march=*: \ - %{mcpu=arm2:-D__ARM_ARCH_2__} \ - %{mcpu=arm250:-D__ARM_ARCH_2__} \ - %{mcpu=arm3:-D__ARM_ARCH_2__} \ - %{mcpu=arm6:-D__ARM_ARCH_3__} \ - %{mcpu=arm600:-D__ARM_ARCH_3__} \ - %{mcpu=arm610:-D__ARM_ARCH_3__} \ - %{mcpu=arm7:-D__ARM_ARCH_3__} \ - %{mcpu=arm700:-D__ARM_ARCH_3__} \ - %{mcpu=arm710:-D__ARM_ARCH_3__} \ - %{mcpu=arm720:-D__ARM_ARCH_3__} \ - %{mcpu=arm7100:-D__ARM_ARCH_3__} \ - %{mcpu=arm7500:-D__ARM_ARCH_3__} \ - %{mcpu=arm7500fe:-D__ARM_ARCH_3__} \ - %{mcpu=arm7m:-D__ARM_ARCH_3M__} \ - %{mcpu=arm7dm:-D__ARM_ARCH_3M__} \ - %{mcpu=arm7dmi:-D__ARM_ARCH_3M__} \ - %{mcpu=arm7tdmi:-D__ARM_ARCH_4T__} \ - %{mcpu=arm8:-D__ARM_ARCH_4__} \ - %{mcpu=arm810:-D__ARM_ARCH_4__} \ - %{mcpu=arm9:-D__ARM_ARCH_4T__} \ - %{mcpu=arm920:-D__ARM_ARCH_4__} \ - %{mcpu=arm920t:-D__ARM_ARCH_4T__} \ - %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__} \ - %{mcpu=strongarm:-D__ARM_ARCH_4__} \ - %{mcpu=strongarm110:-D__ARM_ARCH_4__} \ - %{mcpu=strongarm1100:-D__ARM_ARCH_4__} \ - %{mcpu=xscale:-D__ARM_ARCH_5TE__} \ - %{mcpu=xscale:-D__XSCALE__} \ - %{mcpu=ep9312:-D__ARM_ARCH_4T__} \ - %{mcpu=ep9312:-D__MAVERICK__} \ - %{mcpu=iwmmxt:-D__ARM_ARCH_5TE__} \ - %{mcpu=iwmmxt:-D__XSCALE__} \ - %{mcpu=iwmmxt:-D__IWMMXT__} \ - %{!mcpu*:%(cpp_cpu_arch_default)}} \ -" - #ifndef CC1_SPEC #define CC1_SPEC "" #endif @@ -295,8 +156,6 @@ extern GTY(()) rtx aof_pic_label; Do not define this macro if it does not need to do anything. */ #define EXTRA_SPECS \ - { "cpp_cpu_arch", CPP_CPU_ARCH_SPEC }, \ - { "cpp_cpu_arch_default", CPP_ARCH_DEFAULT_SPEC }, \ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ SUBTARGET_EXTRA_SPECS @@ -313,271 +172,77 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_VERSION fputs (" (ARM/generic)", stderr); #endif -/* Nonzero if the function prologue (and epilogue) should obey - the ARM Procedure Call Standard. */ -#define ARM_FLAG_APCS_FRAME (1 << 0) - -/* Nonzero if the function prologue should output the function name to enable - the post mortem debugger to print a backtrace (very useful on RISCOS, - unused on RISCiX). Specifying this flag also enables - -fno-omit-frame-pointer. - XXX Must still be implemented in the prologue. */ -#define ARM_FLAG_POKE (1 << 1) - -/* Nonzero if floating point instructions are emulated by the FPE, in which - case instruction scheduling becomes very uninteresting. */ -#define ARM_FLAG_FPE (1 << 2) - -/* Nonzero if destined for a processor in 32-bit program mode. Takes out bit - that assume restoration of the condition flags when returning from a - branch and link (ie a function). */ -#define ARM_FLAG_APCS_32 (1 << 3) - -/* FLAGS 0x0008 and 0x0010 are now spare (used to be arm3/6 selection). */ - -/* Nonzero if stack checking should be performed on entry to each function - which allocates temporary variables on the stack. */ -#define ARM_FLAG_APCS_STACK (1 << 4) - -/* Nonzero if floating point parameters should be passed to functions in - floating point registers. */ -#define ARM_FLAG_APCS_FLOAT (1 << 5) - -/* Nonzero if re-entrant, position independent code should be generated. - This is equivalent to -fpic. */ -#define ARM_FLAG_APCS_REENT (1 << 6) - -/* Nonzero if the MMU will trap unaligned word accesses, so shorts must - be loaded using either LDRH or LDRB instructions. */ -#define ARM_FLAG_MMU_TRAPS (1 << 7) - -/* Nonzero if all floating point instructions are missing (and there is no - emulator either). Generate function calls for all ops in this case. */ -#define ARM_FLAG_SOFT_FLOAT (1 << 8) - -/* Nonzero if we should compile with BYTES_BIG_ENDIAN set to 1. */ -#define ARM_FLAG_BIG_END (1 << 9) - -/* Nonzero if we should compile for Thumb interworking. */ -#define ARM_FLAG_INTERWORK (1 << 10) - -/* Nonzero if we should have little-endian words even when compiling for - big-endian (for backwards compatibility with older versions of GCC). */ -#define ARM_FLAG_LITTLE_WORDS (1 << 11) - -/* Nonzero if we need to protect the prolog from scheduling */ -#define ARM_FLAG_NO_SCHED_PRO (1 << 12) - -/* Nonzero if a call to abort should be generated if a noreturn - function tries to return. */ -#define ARM_FLAG_ABORT_NORETURN (1 << 13) - -/* Nonzero if function prologues should not load the PIC register. */ -#define ARM_FLAG_SINGLE_PIC_BASE (1 << 14) - -/* Nonzero if all call instructions should be indirect. */ -#define ARM_FLAG_LONG_CALLS (1 << 15) - -/* Nonzero means that the target ISA is the THUMB, not the ARM. */ -#define ARM_FLAG_THUMB (1 << 16) - -/* Set if a TPCS style stack frame should be generated, for non-leaf - functions, even if they do not need one. */ -#define THUMB_FLAG_BACKTRACE (1 << 17) - -/* Set if a TPCS style stack frame should be generated, for leaf - functions, even if they do not need one. */ -#define THUMB_FLAG_LEAF_BACKTRACE (1 << 18) - -/* Set if externally visible functions should assume that they - might be called in ARM mode, from a non-thumb aware code. */ -#define THUMB_FLAG_CALLEE_SUPER_INTERWORKING (1 << 19) - -/* Set if calls via function pointers should assume that their - destination is non-Thumb aware. */ -#define THUMB_FLAG_CALLER_SUPER_INTERWORKING (1 << 20) - -/* Nonzero means target uses VFP FP. */ -#define ARM_FLAG_VFP (1 << 21) - -/* Nonzero means to use ARM/Thumb Procedure Call Standard conventions. */ -#define ARM_FLAG_ATPCS (1 << 22) - -/* Fix invalid Cirrus instruction combinations by inserting NOPs. */ -#define CIRRUS_FIX_INVALID_INSNS (1 << 23) - -#define TARGET_APCS_FRAME (target_flags & ARM_FLAG_APCS_FRAME) -#define TARGET_POKE_FUNCTION_NAME (target_flags & ARM_FLAG_POKE) -#define TARGET_FPE (target_flags & ARM_FLAG_FPE) -#define TARGET_APCS_32 (target_flags & ARM_FLAG_APCS_32) -#define TARGET_APCS_STACK (target_flags & ARM_FLAG_APCS_STACK) -#define TARGET_APCS_FLOAT (target_flags & ARM_FLAG_APCS_FLOAT) -#define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT) -#define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS) -#define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS) -#define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_CIRRUS (arm_is_cirrus) -#define TARGET_ANY_HARD_FLOAT (TARGET_HARD_FLOAT || TARGET_CIRRUS) +#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT) +/* Use hardware floating point instructions. */ +#define TARGET_HARD_FLOAT (arm_float_abi != ARM_FLOAT_ABI_SOFT) +/* Use hardware floating point calling convention. */ +#define TARGET_HARD_FLOAT_ABI (arm_float_abi == ARM_FLOAT_ABI_HARD) +#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA) +#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK) +#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP) #define TARGET_IWMMXT (arm_arch_iwmmxt) #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM) -#define TARGET_VFP (target_flags & ARM_FLAG_VFP) -#define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END) -#define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK) -#define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS) -#define TARGET_NO_SCHED_PRO (target_flags & ARM_FLAG_NO_SCHED_PRO) -#define TARGET_ABORT_NORETURN (target_flags & ARM_FLAG_ABORT_NORETURN) -#define TARGET_SINGLE_PIC_BASE (target_flags & ARM_FLAG_SINGLE_PIC_BASE) -#define TARGET_LONG_CALLS (target_flags & ARM_FLAG_LONG_CALLS) -#define TARGET_THUMB (target_flags & ARM_FLAG_THUMB) +#define TARGET_IWMMXT_ABI (TARGET_ARM && arm_abi == ARM_ABI_IWMMXT) #define TARGET_ARM (! TARGET_THUMB) #define TARGET_EITHER 1 /* (TARGET_ARM | TARGET_THUMB) */ -#define TARGET_CALLEE_INTERWORKING (target_flags & THUMB_FLAG_CALLEE_SUPER_INTERWORKING) -#define TARGET_CALLER_INTERWORKING (target_flags & THUMB_FLAG_CALLER_SUPER_INTERWORKING) -#define TARGET_BACKTRACE (leaf_function_p () \ - ? (target_flags & THUMB_FLAG_LEAF_BACKTRACE) \ - : (target_flags & THUMB_FLAG_BACKTRACE)) -#define TARGET_CIRRUS_FIX_INVALID_INSNS (target_flags & CIRRUS_FIX_INVALID_INSNS) +#define TARGET_BACKTRACE (leaf_function_p () \ + ? TARGET_TPCS_LEAF_FRAME \ + : TARGET_TPCS_FRAME) +#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN) +#define TARGET_AAPCS_BASED \ + (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS) -/* SUBTARGET_SWITCHES is used to add flags on a per-config basis. */ -#ifndef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES +#define TARGET_HARD_TP (target_thread_pointer == TP_CP15) +#define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT) + +/* True iff the full BPABI is being used. If TARGET_BPABI is true, + then TARGET_AAPCS_BASED must be true -- but the converse does not + hold. TARGET_BPABI implies the use of the BPABI runtime library, + etc., in addition to just the AAPCS calling conventions. */ +#ifndef TARGET_BPABI +#define TARGET_BPABI false #endif -#define TARGET_SWITCHES \ -{ \ - {"apcs", ARM_FLAG_APCS_FRAME, "" }, \ - {"apcs-frame", ARM_FLAG_APCS_FRAME, \ - N_("Generate APCS conformant stack frames") }, \ - {"no-apcs-frame", -ARM_FLAG_APCS_FRAME, "" }, \ - {"poke-function-name", ARM_FLAG_POKE, \ - N_("Store function names in object code") }, \ - {"no-poke-function-name", -ARM_FLAG_POKE, "" }, \ - {"fpe", ARM_FLAG_FPE, "" }, \ - {"apcs-32", ARM_FLAG_APCS_32, \ - N_("Use the 32-bit version of the APCS") }, \ - {"apcs-26", -ARM_FLAG_APCS_32, ""}, \ - {"apcs-stack-check", ARM_FLAG_APCS_STACK, "" }, \ - {"no-apcs-stack-check", -ARM_FLAG_APCS_STACK, "" }, \ - {"apcs-float", ARM_FLAG_APCS_FLOAT, \ - N_("Pass FP arguments in FP registers") }, \ - {"no-apcs-float", -ARM_FLAG_APCS_FLOAT, "" }, \ - {"apcs-reentrant", ARM_FLAG_APCS_REENT, \ - N_("Generate re-entrant, PIC code") }, \ - {"no-apcs-reentrant", -ARM_FLAG_APCS_REENT, "" }, \ - {"alignment-traps", ARM_FLAG_MMU_TRAPS, \ - N_("The MMU will trap on unaligned accesses") }, \ - {"no-alignment-traps", -ARM_FLAG_MMU_TRAPS, "" }, \ - {"soft-float", ARM_FLAG_SOFT_FLOAT, \ - N_("Use library calls to perform FP operations") }, \ - {"hard-float", -ARM_FLAG_SOFT_FLOAT, \ - N_("Use hardware floating point instructions") }, \ - {"big-endian", ARM_FLAG_BIG_END, \ - N_("Assume target CPU is configured as big endian") }, \ - {"little-endian", -ARM_FLAG_BIG_END, \ - N_("Assume target CPU is configured as little endian") }, \ - {"words-little-endian", ARM_FLAG_LITTLE_WORDS, \ - N_("Assume big endian bytes, little endian words") }, \ - {"thumb-interwork", ARM_FLAG_INTERWORK, \ - N_("Support calls between Thumb and ARM instruction sets") }, \ - {"no-thumb-interwork", -ARM_FLAG_INTERWORK, "" }, \ - {"abort-on-noreturn", ARM_FLAG_ABORT_NORETURN, \ - N_("Generate a call to abort if a noreturn function returns")}, \ - {"no-abort-on-noreturn", -ARM_FLAG_ABORT_NORETURN, "" }, \ - {"no-sched-prolog", ARM_FLAG_NO_SCHED_PRO, \ - N_("Do not move instructions into a function's prologue") }, \ - {"sched-prolog", -ARM_FLAG_NO_SCHED_PRO, "" }, \ - {"single-pic-base", ARM_FLAG_SINGLE_PIC_BASE, \ - N_("Do not load the PIC register in function prologues") }, \ - {"no-single-pic-base", -ARM_FLAG_SINGLE_PIC_BASE, "" }, \ - {"long-calls", ARM_FLAG_LONG_CALLS, \ - N_("Generate call insns as indirect calls, if necessary") }, \ - {"no-long-calls", -ARM_FLAG_LONG_CALLS, "" }, \ - {"thumb", ARM_FLAG_THUMB, \ - N_("Compile for the Thumb not the ARM") }, \ - {"no-thumb", -ARM_FLAG_THUMB, "" }, \ - {"arm", -ARM_FLAG_THUMB, "" }, \ - {"tpcs-frame", THUMB_FLAG_BACKTRACE, \ - N_("Thumb: Generate (non-leaf) stack frames even if not needed") }, \ - {"no-tpcs-frame", -THUMB_FLAG_BACKTRACE, "" }, \ - {"tpcs-leaf-frame", THUMB_FLAG_LEAF_BACKTRACE, \ - N_("Thumb: Generate (leaf) stack frames even if not needed") }, \ - {"no-tpcs-leaf-frame", -THUMB_FLAG_LEAF_BACKTRACE, "" }, \ - {"callee-super-interworking", THUMB_FLAG_CALLEE_SUPER_INTERWORKING, \ - N_("Thumb: Assume non-static functions may be called from ARM code") }, \ - {"no-callee-super-interworking", -THUMB_FLAG_CALLEE_SUPER_INTERWORKING, \ - "" }, \ - {"caller-super-interworking", THUMB_FLAG_CALLER_SUPER_INTERWORKING, \ - N_("Thumb: Assume function pointers may go to non-Thumb aware code") }, \ - {"no-caller-super-interworking", -THUMB_FLAG_CALLER_SUPER_INTERWORKING, \ - "" }, \ - {"cirrus-fix-invalid-insns", CIRRUS_FIX_INVALID_INSNS, \ - N_("Cirrus: Place NOPs to avoid invalid instruction combinations") }, \ - {"no-cirrus-fix-invalid-insns", -CIRRUS_FIX_INVALID_INSNS, \ - N_("Cirrus: Do not break up invalid instruction combinations with NOPs") },\ - SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT, "" } \ -} - -#define TARGET_OPTIONS \ -{ \ - {"cpu=", & arm_select[0].string, \ - N_("Specify the name of the target CPU"), 0}, \ - {"arch=", & arm_select[1].string, \ - N_("Specify the name of the target architecture"), 0}, \ - {"tune=", & arm_select[2].string, "", 0}, \ - {"fpe=", & target_fp_name, "" , 0}, \ - {"fp=", & target_fp_name, \ - N_("Specify the version of the floating point emulator"), 0},\ - {"structure-size-boundary=", & structure_size_string, \ - N_("Specify the minimum bit alignment of structures"), 0}, \ - {"pic-register=", & arm_pic_register_string, \ - N_("Specify the register to be used for PIC addressing"), 0} \ -} - /* Support for a compile-time default CPU, et cetera. The rules are: --with-arch is ignored if -march or -mcpu are specified. --with-cpu is ignored if -march or -mcpu are specified, and is overridden by --with-arch. --with-tune is ignored if -mtune or -mcpu are specified (but not affected by -march). - --with-float is ignored if -mhard-float or -msoft-float are - specified. */ + --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are + specified. + --with-fpu is ignored if -mfpu is specified. + --with-abi is ignored is -mabi is specified. */ #define OPTION_DEFAULT_SPECS \ {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \ {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \ - {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" } + {"float", \ + "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \ + {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \ + {"abi", "%{!mabi=*:-mabi=%(VALUE)}"}, \ + {"mode", "%{!marm:%{!mthumb:-m%(VALUE)}}"}, -struct arm_cpu_select +/* Which floating point model to use. */ +enum arm_fp_model { - const char * string; - const char * name; - const struct processors * processors; + ARM_FP_MODEL_UNKNOWN, + /* FPA model (Hardware or software). */ + ARM_FP_MODEL_FPA, + /* Cirrus Maverick floating point model. */ + ARM_FP_MODEL_MAVERICK, + /* VFP floating point model. */ + ARM_FP_MODEL_VFP }; -/* This is a magic array. If the user specifies a command line switch - which matches one of the entries in TARGET_OPTIONS then the corresponding - string pointer will be set to the value specified by the user. */ -extern struct arm_cpu_select arm_select[]; +extern enum arm_fp_model arm_fp_model; -enum prog_mode_type -{ - prog_mode26, - prog_mode32 -}; - -/* Recast the program mode class to be the prog_mode attribute. */ -#define arm_prog_mode ((enum attr_prog_mode) arm_prgmode) - -extern enum prog_mode_type arm_prgmode; - -/* What sort of floating point unit do we have? Hardware or software. - If software, is it issue 2 or issue 3? */ +/* Which floating point hardware is available. Also update + fp_model_for_fpu in arm.c when adding entries to this list. */ enum fputype { - /* Software floating point, FPA style double fmt. */ - FPUTYPE_SOFT_FPA, + /* No FP hardware. */ + FPUTYPE_NONE, /* Full FPA support. */ FPUTYPE_FPA, /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */ @@ -585,7 +250,9 @@ enum fputype /* Emulated FPA hardware, Issue 3 emulator. */ FPUTYPE_FPA_EMU3, /* Cirrus Maverick floating point co-processor. */ - FPUTYPE_MAVERICK + FPUTYPE_MAVERICK, + /* VFP. */ + FPUTYPE_VFP }; /* Recast the floating point class to be the floating point attribute. */ @@ -597,30 +264,62 @@ extern enum fputype arm_fpu_tune; /* What type of floating point instructions are available */ extern enum fputype arm_fpu_arch; -/* Default floating point architecture. Override in sub-target if - necessary. */ -#ifndef FPUTYPE_DEFAULT -#define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU2 +enum float_abi_type +{ + ARM_FLOAT_ABI_SOFT, + ARM_FLOAT_ABI_SOFTFP, + ARM_FLOAT_ABI_HARD +}; + +extern enum float_abi_type arm_float_abi; + +#ifndef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT #endif -#if TARGET_CPU_DEFAULT == TARGET_CPU_ep9312 -#undef FPUTYPE_DEFAULT -#define FPUTYPE_DEFAULT FPUTYPE_MAVERICK +/* Which ABI to use. */ +enum arm_abi_type +{ + ARM_ABI_APCS, + ARM_ABI_ATPCS, + ARM_ABI_AAPCS, + ARM_ABI_IWMMXT, + ARM_ABI_AAPCS_LINUX +}; + +extern enum arm_abi_type arm_abi; + +#ifndef ARM_DEFAULT_ABI +#define ARM_DEFAULT_ABI ARM_ABI_APCS #endif -/* Nonzero if the processor has a fast multiply insn, and one that does - a 64-bit multiply of two 32-bit values. */ -extern int arm_fast_multiply; +/* Which thread pointer access sequence to use. */ +enum arm_tp_type { + TP_AUTO, + TP_SOFT, + TP_CP15 +}; -/* Nonzero if this chip supports the ARM Architecture 4 extensions */ +extern enum arm_tp_type target_thread_pointer; + +/* Nonzero if this chip supports the ARM Architecture 3M extensions. */ +extern int arm_arch3m; + +/* Nonzero if this chip supports the ARM Architecture 4 extensions. */ extern int arm_arch4; -/* Nonzero if this chip supports the ARM Architecture 5 extensions */ +/* Nonzero if this chip supports the ARM Architecture 4T extensions. */ +extern int arm_arch4t; + +/* Nonzero if this chip supports the ARM Architecture 5 extensions. */ extern int arm_arch5; -/* Nonzero if this chip supports the ARM Architecture 5E extensions */ +/* Nonzero if this chip supports the ARM Architecture 5E extensions. */ extern int arm_arch5e; +/* Nonzero if this chip supports the ARM Architecture 6 extensions. */ +extern int arm_arch6; + /* Nonzero if this chip can benefit from load scheduling. */ extern int arm_ld_sched; @@ -628,10 +327,10 @@ extern int arm_ld_sched; extern int thumb_code; /* Nonzero if this chip is a StrongARM. */ -extern int arm_is_strong; +extern int arm_tune_strongarm; /* Nonzero if this chip is a Cirrus variant. */ -extern int arm_is_cirrus; +extern int arm_arch_cirrus; /* Nonzero if this chip supports Intel XScale with Wireless MMX technology. */ extern int arm_arch_iwmmxt; @@ -639,23 +338,27 @@ extern int arm_arch_iwmmxt; /* Nonzero if this chip is an XScale. */ extern int arm_arch_xscale; -/* Nonzero if tuning for XScale */ +/* Nonzero if tuning for XScale. */ extern int arm_tune_xscale; -/* Nonzero if this chip is an ARM6 or an ARM7. */ -extern int arm_is_6_or_7; +/* Nonzero if tuning for stores via the write buffer. */ +extern int arm_tune_wbuf; + +/* Nonzero if we should define __THUMB_INTERWORK__ in the + preprocessor. + XXX This is a bit of a hack, it's intended to help work around + problems in GLD which doesn't understand that armv5t code is + interworking clean. */ +extern int arm_cpp_interwork; #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif /* The frame pointer register used in gcc has nothing to do with debugging; that is controlled by the APCS-FRAME option. */ #define CAN_DEBUG_WITHOUT_FP -#undef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS 1 - #define OVERRIDE_OPTIONS arm_override_options () /* Nonzero if PIC code requires explicit qualifiers to generate @@ -671,13 +374,13 @@ extern int arm_is_6_or_7; /* Nonzero if we need to refer to the GOT with a PC-relative offset. In other words, generate - .word _GLOBAL_OFFSET_TABLE_ - [. - (.Lxx + 8)] + .word _GLOBAL_OFFSET_TABLE_ - [. - (.Lxx + 8)] rather than .word _GLOBAL_OFFSET_TABLE_ - (.Lxx + 8) - The default is true, which matches NetBSD. Subtargets can + The default is true, which matches NetBSD. Subtargets can override this if required. */ #ifndef GOT_PCREL #define GOT_PCREL 1 @@ -701,20 +404,21 @@ extern int arm_is_6_or_7; if (MODE == QImode) \ UNSIGNEDP = 1; \ else if (MODE == HImode) \ - UNSIGNEDP = TARGET_MMU_TRAPS != 0; \ + UNSIGNEDP = 1; \ (MODE) = SImode; \ } -/* Define this macro if the promotion described by `PROMOTE_MODE' - should also be done for outgoing function arguments. */ -/* This is required to ensure that push insns always push a word. */ -#define PROMOTE_FUNCTION_ARGS +#define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \ + if ((GET_MODE_CLASS (MODE) == MODE_INT \ + || GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT) \ + && GET_MODE_SIZE (MODE) < 4) \ + (MODE) = SImode; \ /* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */ #define BITS_BIG_ENDIAN 0 -/* Define this if most significant byte of a word is the lowest numbered. +/* Define this if most significant byte of a word is the lowest numbered. Most ARM processors are run in little endian mode, so that is the default. If you want to have it run-time selectable, change the definition in a cover file to be TARGET_BIG_ENDIAN. */ @@ -740,13 +444,17 @@ extern int arm_is_6_or_7; #define UNITS_PER_WORD 4 +/* True if natural alignment is used for doubleword types. */ +#define ARM_DOUBLEWORD_ALIGN TARGET_AAPCS_BASED + +#define DOUBLEWORD_ALIGNMENT 64 + #define PARM_BOUNDARY 32 -#define IWMMXT_ALIGNMENT 64 +#define STACK_BOUNDARY (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32) -#define STACK_BOUNDARY 32 - -#define PREFERRED_STACK_BOUNDARY (TARGET_ATPCS ? 64 : 32) +#define PREFERRED_STACK_BOUNDARY \ + (arm_abi == ARM_ABI_ATPCS ? 64 : STACK_BOUNDARY) #define FUNCTION_BOUNDARY 32 @@ -757,62 +465,30 @@ extern int arm_is_6_or_7; #define EMPTY_FIELD_BOUNDARY 32 -#define BIGGEST_ALIGNMENT (TARGET_REALLY_IWMMXT ? 64 : 32) - -#define TYPE_NEEDS_IWMMXT_ALIGNMENT(TYPE) \ - (TARGET_REALLY_IWMMXT \ - && ((TREE_CODE (TYPE) == VECTOR_TYPE) || (TYPE_MODE (TYPE) == DImode) || (TYPE_MODE (TYPE) == DFmode))) +#define BIGGEST_ALIGNMENT (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32) /* XXX Blah -- this macro is used directly by libobjc. Since it supports no vector modes, cut out the complexity and fall back on BIGGEST_FIELD_ALIGNMENT. */ #ifdef IN_TARGET_LIBS #define BIGGEST_FIELD_ALIGNMENT 64 -#else -/* An expression for the alignment of a structure field FIELD if the - alignment computed in the usual way is COMPUTED. GCC uses this - value instead of the value in `BIGGEST_ALIGNMENT' or - `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - (TYPE_NEEDS_IWMMXT_ALIGNMENT (TREE_TYPE (FIELD)) \ - ? IWMMXT_ALIGNMENT \ - : (COMPUTED)) #endif -/* If defined, a C expression to compute the alignment for a static variable. - TYPE is the data type, and ALIGN is the alignment that the object - would ordinarily have. The value of this macro is used instead of that - alignment to align the object. - - If this macro is not defined, then ALIGN is used. */ -#define DATA_ALIGNMENT(TYPE, ALIGN) \ - (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN) - -/* If defined, a C expression to compute the alignment for a - variables in the local store. TYPE is the data type, and - BASIC-ALIGN is the alignment that the object would ordinarily - have. The value of this macro is used instead of that alignment - to align the object. - - If this macro is not defined, then BASIC-ALIGN is used. */ -#define LOCAL_ALIGNMENT(TYPE, ALIGN) \ - (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN) - /* Make strings word-aligned so strcpy from constants will be faster. */ #define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_tune_xscale ? 1 : 2) - + #define CONSTANT_ALIGNMENT(EXP, ALIGN) \ - ((TARGET_REALLY_IWMMXT && TREE_CODE (EXP) == VECTOR_TYPE) ? IWMMXT_ALIGNMENT : \ - (TREE_CODE (EXP) == STRING_CST \ - && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \ - ? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN)) + ((TREE_CODE (EXP) == STRING_CST \ + && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \ + ? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN)) /* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the value set in previous versions of this toolchain was 8, which produces more compact structures. The command line option -mstructure_size_boundary= can be used to change this value. For compatibility with the ARM SDK however the value should be left at 32. ARM SDT Reference Manual (ARM DUI - 0020D) page 2-20 says "Structures are aligned on word boundaries". */ + 0020D) page 2-20 says "Structures are aligned on word boundaries". + The AAPCS specifies a value of 8. */ #define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary extern int arm_structure_size_boundary; @@ -824,12 +500,30 @@ extern int arm_structure_size_boundary; #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 32 #endif -/* Used when parsing command line option -mstructure_size_boundary. */ -extern const char * structure_size_string; - /* Nonzero if move instructions will actually fail to work when given unaligned data. */ #define STRICT_ALIGNMENT 1 + +/* wchar_t is unsigned under the AAPCS. */ +#ifndef WCHAR_TYPE +#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "int") + +#define WCHAR_TYPE_SIZE BITS_PER_WORD +#endif + +#ifndef SIZE_TYPE +#define SIZE_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long unsigned int") +#endif + +#ifndef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int") +#endif + +/* AAPCS requires that structure alignment is affected by bitfields. */ +#ifndef PCC_BITFIELD_TYPE_MATTERS +#define PCC_BITFIELD_TYPE_MATTERS TARGET_AAPCS_BASED +#endif + /* Standard register usage. */ @@ -841,7 +535,7 @@ extern const char * structure_size_string; r4-r8 S register variable r9 S (rfp) register variable (real frame pointer) - + r10 F S (sl) stack limit (used by -mapcs-stack-check) r11 F S (fp) argument pointer r12 (ip) temp workspace @@ -872,6 +566,11 @@ extern const char * structure_size_string; mvf1-mvf3 Cirrus floating point scratch mvf4-mvf15 S Cirrus floating point variable. */ +/* s0-s15 VFP scratch (aka d0-d7). + s16-s31 S VFP variable (aka d8-d15). + vfpcc Not a real register. Represents the VFP condition + code flags. */ + /* The stack backtrace structure is as follows: fp points to here: | save code pointer | [fp] | return link value | [fp, #-4] @@ -896,17 +595,22 @@ extern const char * structure_size_string; /* 1 for registers that have pervasive standard uses and are not available for the register allocator. */ -#define FIXED_REGISTERS \ -{ \ - 0,0,0,0,0,0,0,0, \ - 0,0,0,0,0,1,0,1, \ - 0,0,0,0,0,0,0,0, \ +#define FIXED_REGISTERS \ +{ \ + 0,0,0,0,0,0,0,0, \ + 0,0,0,0,0,1,0,1, \ + 0,0,0,0,0,0,0,0, \ 1,1,1, \ 1,1,1,1,1,1,1,1, \ - 1,1,1,1,1,1,1,1, \ - 1,1,1,1,1,1,1,1, \ - 1,1,1,1,1,1,1,1, \ - 1,1,1,1 \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1 \ } /* 1 for registers not available across function calls. @@ -915,7 +619,7 @@ extern const char * structure_size_string; The latter must include the registers where values are returned and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. - The CC is not preserved over function calls on the ARM 6, so it is + The CC is not preserved over function calls on the ARM 6, so it is easier to assume this for all. SFP is preserved, since FP is. */ #define CALL_USED_REGISTERS \ { \ @@ -927,7 +631,12 @@ extern const char * structure_size_string; 1,1,1,1,1,1,1,1, \ 1,1,1,1,1,1,1,1, \ 1,1,1,1,1,1,1,1, \ - 1,1,1,1 \ + 1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1,1,1,1,1,1,1,1, \ + 1 \ } #ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE @@ -938,10 +647,10 @@ extern const char * structure_size_string; { \ int regno; \ \ - if (TARGET_SOFT_FLOAT || TARGET_THUMB) \ + if (TARGET_SOFT_FLOAT || TARGET_THUMB || !TARGET_FPA) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++regno) \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ @@ -961,16 +670,28 @@ extern const char * structure_size_string; if (TARGET_THUMB) \ fixed_regs[LR_REGNUM] = call_used_regs[LR_REGNUM] = 1; \ \ - if (TARGET_CIRRUS) \ + if (TARGET_ARM && TARGET_HARD_FLOAT) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++ regno) \ - fixed_regs[regno] = call_used_regs[regno] = 1; \ - for (regno = FIRST_CIRRUS_FP_REGNUM; \ - regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \ + if (TARGET_MAVERICK) \ { \ - fixed_regs[regno] = 0; \ - call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++ regno) \ + fixed_regs[regno] = call_used_regs[regno] = 1; \ + for (regno = FIRST_CIRRUS_FP_REGNUM; \ + regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \ + { \ + fixed_regs[regno] = 0; \ + call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \ + } \ + } \ + if (TARGET_VFP) \ + { \ + for (regno = FIRST_VFP_REGNUM; \ + regno <= LAST_VFP_REGNUM; ++ regno) \ + { \ + fixed_regs[regno] = 0; \ + call_used_regs[regno] = regno < FIRST_VFP_REGNUM + 16; \ + } \ } \ } \ \ @@ -983,7 +704,7 @@ extern const char * structure_size_string; scratch registers. */ \ for (regno = FIRST_IWMMXT_GR_REGNUM; \ regno <= LAST_IWMMXT_GR_REGNUM; ++ regno) \ - fixed_regs[regno] = call_used_regs[regno] = 0; \ + fixed_regs[regno] = 0; \ /* The XScale ABI has wR0 - wR9 as scratch registers, \ the rest as call-preserved registers. */ \ for (regno = FIRST_IWMMXT_REGNUM; \ @@ -1004,14 +725,21 @@ extern const char * structure_size_string; fixed_regs[10] = 1; \ call_used_regs[10] = 1; \ } \ - if (TARGET_APCS_FRAME) \ + /* -mcaller-super-interworking reserves r11 for calls to \ + _interwork_r11_call_via_rN(). Making the register global \ + is an easy way of ensuring that it remains valid for all \ + calls. */ \ + if (TARGET_APCS_FRAME || TARGET_CALLER_INTERWORKING \ + || TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME) \ { \ fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \ call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \ + if (TARGET_CALLER_INTERWORKING) \ + global_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \ } \ SUBTARGET_CONDITIONAL_REGISTER_USAGE \ } - + /* These are a couple of extensions to the formats accepted by asm_fprintf: %@ prints out ASM_COMMENT_START @@ -1032,7 +760,8 @@ extern const char * structure_size_string; /* Convert fron bytes to ints. */ #define ARM_NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) -/* The number of (integer) registers required to hold a quantity of type MODE. */ +/* The number of (integer) registers required to hold a quantity of type MODE. + Also used for VFP registers. */ #define ARM_NUM_REGS(MODE) \ ARM_NUM_INTS (GET_MODE_SIZE (MODE)) @@ -1047,20 +776,6 @@ extern const char * structure_size_string; /* Return the register number of the N'th (integer) argument. */ #define ARG_REGISTER(N) (N - 1) -#if 0 /* FIXME: The ARM backend has special code to handle structure - returns, and will reserve its own hidden first argument. So - if this macro is enabled a *second* hidden argument will be - reserved, which will break binary compatibility with old - toolchains and also thunk handling. One day this should be - fixed. */ -/* RTX for structure returns. NULL means use a hidden first argument. */ -#define STRUCT_VALUE 0 -#else -/* Register in which address to store a structure value - is passed to a function. */ -#define STRUCT_VALUE_REGNUM ARG_REGISTER (1) -#endif - /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ @@ -1073,8 +788,20 @@ extern const char * structure_size_string; #define FIRST_HI_REGNUM 8 #define LAST_HI_REGNUM 11 +#ifndef TARGET_UNWIND_INFO +/* We use sjlj exceptions for backwards compatibility. */ +#define MUST_USE_SJLJ_EXCEPTIONS 1 +#endif + +/* We can generate DWARF2 Unwind info, even though we don't use it. */ +#define DWARF2_UNWIND_INFO 1 + +/* Use r0 and r1 to pass exception handling information. */ +#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM) + /* The register that holds the return address in exception handlers. */ -#define EXCEPTION_LR_REGNUM 2 +#define ARM_EH_STACKADJ_REGNUM 2 +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, ARM_EH_STACKADJ_REGNUM) /* The native (Norcroft) Pascal compiler for the ARM passes the static chain as an invisible last argument (possible since varargs don't exist in @@ -1111,8 +838,10 @@ extern const char * structure_size_string; #define STACK_POINTER_REGNUM SP_REGNUM /* ARM floating pointer registers. */ -#define FIRST_ARM_FP_REGNUM 16 -#define LAST_ARM_FP_REGNUM 23 +#define FIRST_FPA_REGNUM 16 +#define LAST_FPA_REGNUM 23 +#define IS_FPA_REGNUM(REGNUM) \ + (((REGNUM) >= FIRST_FPA_REGNUM) && ((REGNUM) <= LAST_FPA_REGNUM)) #define FIRST_IWMMXT_GR_REGNUM 43 #define LAST_IWMMXT_GR_REGNUM 46 @@ -1134,19 +863,33 @@ extern const char * structure_size_string; #define IS_CIRRUS_REGNUM(REGNUM) \ (((REGNUM) >= FIRST_CIRRUS_FP_REGNUM) && ((REGNUM) <= LAST_CIRRUS_FP_REGNUM)) +#define FIRST_VFP_REGNUM 63 +#define LAST_VFP_REGNUM 94 +#define IS_VFP_REGNUM(REGNUM) \ + (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM)) + /* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP. */ /* + 16 Cirrus registers take us up to 43. */ /* Intel Wireless MMX Technology registers add 16 + 4 more. */ -#define FIRST_PSEUDO_REGISTER 63 +/* VFP adds 32 + 1 more. */ +#define FIRST_PSEUDO_REGISTER 96 + +#define DBX_REGISTER_NUMBER(REGNO) arm_dbx_register_number (REGNO) /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed - via the stack pointer) in functions that seem suitable. + via the stack pointer) in functions that seem suitable. If we have to have a frame pointer we might as well make use of it. APCS says that the frame pointer does not need to be pushed in leaf functions, or simple tail call functions. */ + +#ifndef SUBTARGET_FRAME_POINTER_REQUIRED +#define SUBTARGET_FRAME_POINTER_REQUIRED 0 +#endif + #define FRAME_POINTER_REQUIRED \ (current_function_has_nonlocal_label \ + || SUBTARGET_FRAME_POINTER_REQUIRED \ || (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ())) /* Return number of consecutive hard regs needed starting at reg REGNO @@ -1158,9 +901,10 @@ extern const char * structure_size_string; mode. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ ((TARGET_ARM \ - && REGNO >= FIRST_ARM_FP_REGNUM \ + && REGNO >= FIRST_FPA_REGNUM \ && REGNO != FRAME_POINTER_REGNUM \ && REGNO != ARG_POINTER_REGNUM) \ + && !IS_VFP_REGNUM (REGNO) \ ? 1 : ARM_NUM_REGS (MODE)) /* Return true if REGNO is suitable for holding a quantity of type MODE. */ @@ -1174,18 +918,16 @@ extern const char * structure_size_string; #define MODES_TIEABLE_P(MODE1, MODE2) \ (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2)) -#define VECTOR_MODE_SUPPORTED_P(MODE) \ - ((MODE) == V2SImode || (MODE) == V4HImode || (MODE) == V8QImode) - #define VALID_IWMMXT_REG_MODE(MODE) \ - (VECTOR_MODE_SUPPORTED_P (MODE) || (MODE) == DImode) + (arm_vector_mode_supported_p (MODE) || (MODE) == DImode) /* The order in which register should be allocated. It is good to use ip since no saving is required (though calls clobber it) and it never contains function parameters. It is quite good to use lr since other calls may - clobber it anyway. Allocate r0 through r3 in reverse order since r3 is + clobber it anyway. Allocate r0 through r3 in reverse order since r3 is least likely to contain a function parameter; in addition results are returned in r0. */ + #define REG_ALLOC_ORDER \ { \ 3, 2, 1, 0, 12, 14, 4, 5, \ @@ -1196,7 +938,12 @@ extern const char * structure_size_string; 43, 44, 45, 46, 47, 48, 49, 50, \ 51, 52, 53, 54, 55, 56, 57, 58, \ 59, 60, 61, 62, \ - 24, 25, 26 \ + 24, 25, 26, \ + 78, 77, 76, 75, 74, 73, 72, 71, \ + 70, 69, 68, 67, 66, 65, 64, 63, \ + 79, 80, 81, 82, 83, 84, 85, 86, \ + 87, 88, 89, 90, 91, 92, 93, 94, \ + 95 \ } /* Interrupt functions can only use registers that have already been @@ -1215,6 +962,7 @@ enum reg_class NO_REGS, FPA_REGS, CIRRUS_REGS, + VFP_REGS, IWMMXT_GR_REGS, IWMMXT_REGS, LO_REGS, @@ -1222,6 +970,7 @@ enum reg_class BASE_REGS, HI_REGS, CC_REG, + VFPCC_REG, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES @@ -1235,6 +984,7 @@ enum reg_class "NO_REGS", \ "FPA_REGS", \ "CIRRUS_REGS", \ + "VFP_REGS", \ "IWMMXT_GR_REGS", \ "IWMMXT_REGS", \ "LO_REGS", \ @@ -1242,6 +992,7 @@ enum reg_class "BASE_REGS", \ "HI_REGS", \ "CC_REG", \ + "VFPCC_REG", \ "GENERAL_REGS", \ "ALL_REGS", \ } @@ -1249,20 +1000,22 @@ enum reg_class /* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */ -#define REG_CLASS_CONTENTS \ -{ \ - { 0x00000000, 0x0 }, /* NO_REGS */ \ - { 0x00FF0000, 0x0 }, /* FPA_REGS */ \ - { 0xF8000000, 0x000007FF }, /* CIRRUS_REGS */ \ - { 0x00000000, 0x00007800 }, /* IWMMXT_GR_REGS */\ - { 0x00000000, 0x7FFF8000 }, /* IWMMXT_REGS */ \ - { 0x000000FF, 0x0 }, /* LO_REGS */ \ - { 0x00002000, 0x0 }, /* STACK_REG */ \ - { 0x000020FF, 0x0 }, /* BASE_REGS */ \ - { 0x0000FF00, 0x0 }, /* HI_REGS */ \ - { 0x01000000, 0x0 }, /* CC_REG */ \ - { 0x0200FFFF, 0x0 }, /* GENERAL_REGS */\ - { 0xFAFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \ +#define REG_CLASS_CONTENTS \ +{ \ + { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ + { 0x00FF0000, 0x00000000, 0x00000000 }, /* FPA_REGS */ \ + { 0xF8000000, 0x000007FF, 0x00000000 }, /* CIRRUS_REGS */ \ + { 0x00000000, 0x80000000, 0x7FFFFFFF }, /* VFP_REGS */ \ + { 0x00000000, 0x00007800, 0x00000000 }, /* IWMMXT_GR_REGS */ \ + { 0x00000000, 0x7FFF8000, 0x00000000 }, /* IWMMXT_REGS */ \ + { 0x000000FF, 0x00000000, 0x00000000 }, /* LO_REGS */ \ + { 0x00002000, 0x00000000, 0x00000000 }, /* STACK_REG */ \ + { 0x000020FF, 0x00000000, 0x00000000 }, /* BASE_REGS */ \ + { 0x0000FF00, 0x00000000, 0x00000000 }, /* HI_REGS */ \ + { 0x01000000, 0x00000000, 0x00000000 }, /* CC_REG */ \ + { 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \ + { 0x0200FFFF, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \ + { 0xFAFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \ } /* The same information, inverted: @@ -1271,11 +1024,21 @@ enum reg_class or could index an array. */ #define REGNO_REG_CLASS(REGNO) arm_regno_class (REGNO) -/* FPA registers can't do dubreg as all values are reformatted to internal - precision. */ +/* FPA registers can't do subreg as all values are reformatted to internal + precision. VFP registers may only be accessed in the mode they + were set. */ #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FPA_REGS, (CLASS)) : 0) + ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \ + || reg_classes_intersect_p (VFP_REGS, (CLASS)) \ + : 0) + +/* We need to define this for LO_REGS on thumb. Otherwise we can end up + using r0-r4 for function arguments, r7 for the stack frame and don't + have enough left over to do doubleword arithmetic. */ +#define CLASS_LIKELY_SPILLED_P(CLASS) \ + ((TARGET_THUMB && (CLASS) == LO_REGS) \ + || (CLASS) == CC_REG) /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS (TARGET_THUMB ? LO_REGS : GENERAL_REGS) @@ -1283,12 +1046,14 @@ enum reg_class /* For the Thumb the high registers cannot be used as base registers when addressing quantities in QI or HI mode; if we don't know the - mode, then we must be conservative. After reload we must also be - conservative, since we can't support SP+reg addressing, and we - can't fix up any bad substitutions. */ + mode, then we must be conservative. */ #define MODE_BASE_REG_CLASS(MODE) \ (TARGET_ARM ? GENERAL_REGS : \ - (((MODE) == SImode && !reload_completed) ? BASE_REGS : LO_REGS)) + (((MODE) == SImode) ? BASE_REGS : LO_REGS)) + +/* For Thumb we can not support SP+reg addressing, so we return LO_REGS + instead of BASE_REGS. */ +#define MODE_BASE_REG_REG_CLASS(MODE) BASE_REG_CLASS /* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows registers explicitly used in the rtl to be used as spill registers @@ -1296,89 +1061,6 @@ enum reg_class registers. */ #define SMALL_REGISTER_CLASSES TARGET_THUMB -/* Get reg_class from a letter such as appears in the machine description. - We only need constraint `f' for FPA_REGS (`r' == GENERAL_REGS) for the - ARM, but several more letters for the Thumb. */ -#define REG_CLASS_FROM_LETTER(C) \ - ( (C) == 'f' ? FPA_REGS \ - : (C) == 'v' ? CIRRUS_REGS \ - : (C) == 'y' ? IWMMXT_REGS \ - : (C) == 'z' ? IWMMXT_GR_REGS \ - : (C) == 'l' ? (TARGET_ARM ? GENERAL_REGS : LO_REGS) \ - : TARGET_ARM ? NO_REGS \ - : (C) == 'h' ? HI_REGS \ - : (C) == 'b' ? BASE_REGS \ - : (C) == 'k' ? STACK_REG \ - : (C) == 'c' ? CC_REG \ - : NO_REGS) - -/* The letters I, J, K, L and M in a register constraint string - can be used to stand for particular ranges of immediate operands. - This macro defines what the ranges are. - C is the letter, and VALUE is a constant value. - Return 1 if VALUE is in the range specified by C. - I: immediate arithmetic operand (i.e. 8 bits shifted as required). - J: valid indexing constants. - K: ~value ok in rhs argument of data operand. - L: -value ok in rhs argument of data operand. - M: 0..32, or a power of 2 (for shifts, or mult done by shift). */ -#define CONST_OK_FOR_ARM_LETTER(VALUE, C) \ - ((C) == 'I' ? const_ok_for_arm (VALUE) : \ - (C) == 'J' ? ((VALUE) < 4096 && (VALUE) > -4096) : \ - (C) == 'K' ? (const_ok_for_arm (~(VALUE))) : \ - (C) == 'L' ? (const_ok_for_arm (-(VALUE))) : \ - (C) == 'M' ? (((VALUE >= 0 && VALUE <= 32)) \ - || (((VALUE) & ((VALUE) - 1)) == 0)) \ - : 0) - -#define CONST_OK_FOR_THUMB_LETTER(VAL, C) \ - ((C) == 'I' ? (unsigned HOST_WIDE_INT) (VAL) < 256 : \ - (C) == 'J' ? (VAL) > -256 && (VAL) < 0 : \ - (C) == 'K' ? thumb_shiftable_const (VAL) : \ - (C) == 'L' ? (VAL) > -8 && (VAL) < 8 : \ - (C) == 'M' ? ((unsigned HOST_WIDE_INT) (VAL) < 1024 \ - && ((VAL) & 3) == 0) : \ - (C) == 'N' ? ((unsigned HOST_WIDE_INT) (VAL) < 32) : \ - (C) == 'O' ? ((VAL) >= -508 && (VAL) <= 508) \ - : 0) - -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ - (TARGET_ARM ? \ - CONST_OK_FOR_ARM_LETTER (VALUE, C) : CONST_OK_FOR_THUMB_LETTER (VALUE, C)) - -/* Constant letter 'G' for the FPA immediate constants. - 'H' means the same constant negated. */ -#define CONST_DOUBLE_OK_FOR_ARM_LETTER(X, C) \ - ((C) == 'G' ? const_double_rtx_ok_for_fpa (X) : \ - (C) == 'H' ? neg_const_double_rtx_ok_for_fpa (X) : 0) - -#define CONST_DOUBLE_OK_FOR_LETTER_P(X, C) \ - (TARGET_ARM ? \ - CONST_DOUBLE_OK_FOR_ARM_LETTER (X, C) : 0) - -/* For the ARM, `Q' means that this is a memory operand that is just - an offset from a register. - `S' means any symbol that has the SYMBOL_REF_FLAG set or a CONSTANT_POOL - address. This means that the symbol is in the text segment and can be - accessed without using a load. */ - -#define EXTRA_CONSTRAINT_ARM(OP, C) \ - ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG : \ - (C) == 'R' ? (GET_CODE (OP) == MEM \ - && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \ - && CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) : \ - (C) == 'S' ? (optimize > 0 && CONSTANT_ADDRESS_P (OP)) : \ - (C) == 'T' ? cirrus_memory_offset (OP) : \ - 0) - -#define EXTRA_CONSTRAINT_THUMB(X, C) \ - ((C) == 'Q' ? (GET_CODE (X) == MEM \ - && GET_CODE (XEXP (X, 0)) == LABEL_REF) : 0) - -#define EXTRA_CONSTRAINT(X, C) \ - (TARGET_ARM ? \ - EXTRA_CONSTRAINT_ARM (X, C) : EXTRA_CONSTRAINT_THUMB (X, C)) - /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. In general this is just CLASS, but for the Thumb we prefer @@ -1406,15 +1088,27 @@ enum reg_class or out of a register in CLASS in MODE. If it can be done directly, NO_REGS is returned. */ #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ - (TARGET_ARM ? \ - (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \ + /* Restrict which direct reloads are allowed for VFP/iWMMXt regs. */ \ + ((TARGET_VFP && TARGET_HARD_FLOAT \ + && (CLASS) == VFP_REGS) \ + ? coproc_secondary_reload_class (MODE, X, FALSE) \ + : (TARGET_IWMMXT && (CLASS) == IWMMXT_REGS) \ + ? coproc_secondary_reload_class (MODE, X, TRUE) \ + : TARGET_ARM \ + ? (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \ ? GENERAL_REGS : NO_REGS) \ : THUMB_SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)) - + /* If we need to load shorts byte-at-a-time, then we need a scratch. */ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ + /* Restrict which direct reloads are allowed for VFP/iWMMXt regs. */ \ + ((TARGET_VFP && TARGET_HARD_FLOAT \ + && (CLASS) == VFP_REGS) \ + ? coproc_secondary_reload_class (MODE, X, FALSE) : \ + (TARGET_IWMMXT && (CLASS) == IWMMXT_REGS) ? \ + coproc_secondary_reload_class (MODE, X, TRUE) : \ /* Cannot load constants into Cirrus registers. */ \ - ((TARGET_CIRRUS \ + (TARGET_MAVERICK && TARGET_HARD_FLOAT \ && (CLASS) == CIRRUS_REGS \ && (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \ ? GENERAL_REGS : \ @@ -1422,7 +1116,7 @@ enum reg_class (((CLASS) == IWMMXT_REGS || (CLASS) == IWMMXT_GR_REGS) \ && CONSTANT_P (X)) \ ? GENERAL_REGS : \ - (((MODE) == HImode && ! arm_arch4 && TARGET_MMU_TRAPS \ + (((MODE) == HImode && ! arm_arch4 \ && (GET_CODE (X) == MEM \ || ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \ && true_regnum (X) == -1))) \ @@ -1448,9 +1142,9 @@ enum reg_class HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ HOST_WIDE_INT low, high; \ \ - if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \ + if (MODE == DImode || (MODE == DFmode && TARGET_SOFT_FLOAT)) \ low = ((val & 0xf) ^ 0x8) - 0x8; \ - else if (TARGET_CIRRUS) \ + else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \ /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (MODE == SImode \ @@ -1462,7 +1156,7 @@ enum reg_class /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \ - && TARGET_HARD_FLOAT) \ + && TARGET_HARD_FLOAT && TARGET_FPA) \ /* Need to be careful, -1024 is not a valid offset. */ \ low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \ else \ @@ -1497,30 +1191,22 @@ enum reg_class /* We could probably achieve better results by defining PROMOTE_MODE to help cope with the variances between the Thumb's signed and unsigned byte and halfword load instructions. */ -#define THUMB_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \ -{ \ - if (GET_CODE (X) == PLUS \ - && GET_MODE_SIZE (MODE) < 4 \ - && GET_CODE (XEXP (X, 0)) == REG \ - && XEXP (X, 0) == stack_pointer_rtx \ - && GET_CODE (XEXP (X, 1)) == CONST_INT \ - && ! thumb_legitimate_offset_p (MODE, INTVAL (XEXP (X, 1)))) \ - { \ - rtx orig_X = X; \ - X = copy_rtx (X); \ - push_reload (orig_X, NULL_RTX, &X, NULL, \ - MODE_BASE_REG_CLASS (MODE), \ - Pmode, VOIDmode, 0, 0, OPNUM, TYPE); \ - goto WIN; \ - } \ -} +#define THUMB_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_L, WIN) \ +do { \ + rtx new_x = thumb_legitimize_reload_address (&X, MODE, OPNUM, TYPE, IND_L); \ + if (new_x) \ + { \ + X = new_x; \ + goto WIN; \ + } \ +} while (0) #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \ if (TARGET_ARM) \ ARM_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN); \ else \ THUMB_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) - + /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. ARM regs are UNITS_PER_WORD bits while FPA regs can hold any FP mode */ @@ -1535,6 +1221,8 @@ enum reg_class (TARGET_ARM ? \ ((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 : \ (FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 : \ + (FROM) == VFP_REGS && (TO) != VFP_REGS ? 10 : \ + (FROM) != VFP_REGS && (TO) == VFP_REGS ? 10 : \ (FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 : \ (FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 : \ (FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 : \ @@ -1550,12 +1238,26 @@ enum reg_class makes the stack pointer a smaller address. */ #define STACK_GROWS_DOWNWARD 1 -/* Define this if the nominal address of the stack frame +/* Define this to nonzero if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. */ #define FRAME_GROWS_DOWNWARD 1 +/* The amount of scratch space needed by _interwork_{r7,r11}_call_via_rN(). + When present, it is one word in size, and sits at the top of the frame, + between the soft frame pointer and either r7 or r11. + + We only need _interwork_rM_call_via_rN() for -mcaller-super-interworking, + and only then if some outgoing arguments are passed on the stack. It would + be tempting to also check whether the stack arguments are passed by indirect + calls, but there seems to be no reason in principle why a post-reload pass + couldn't convert a direct call into an indirect one. */ +#define CALLER_INTERWORKING_SLOT_SIZE \ + (TARGET_CALLER_INTERWORKING \ + && current_function_outgoing_args_size != 0 \ + ? UNITS_PER_WORD : 0) + /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING @@ -1590,11 +1292,13 @@ enum reg_class /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - (TARGET_ARM && TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT \ - ? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \ - : TARGET_ARM && TARGET_CIRRUS && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + (TARGET_ARM && TARGET_HARD_FLOAT_ABI && TARGET_FPA \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \ + : TARGET_ARM && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ ? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \ - : TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \ + : TARGET_IWMMXT_ABI && arm_vector_mode_supported_p (MODE) \ ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \ : gen_rtx_REG (MODE, ARG_REGISTER (1))) @@ -1603,16 +1307,22 @@ enum reg_class If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - LIBCALL_VALUE (TYPE_MODE (VALTYPE)) + arm_function_value (VALTYPE, FUNC); /* 1 if N is a possible register number for a function value. On the ARM, only r0 and f0 can return results. */ /* On a Cirrus chip, mvf0 can return results. */ #define FUNCTION_VALUE_REGNO_P(REGNO) \ ((REGNO) == ARG_REGISTER (1) \ - || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) && TARGET_CIRRUS) \ - || (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \ - || (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT)) + || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \ + && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK) \ + || ((REGNO) == FIRST_IWMMXT_REGNUM && TARGET_IWMMXT_ABI) \ + || (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \ + && TARGET_HARD_FLOAT_ABI && TARGET_FPA)) + +/* Amount of memory needed for an untyped call to save all possible return + registers. */ +#define APPLY_RESULT_SIZE arm_apply_result_size() /* How large values are returned */ /* A C expression which can inhibit the returning of certain function values @@ -1630,7 +1340,7 @@ enum reg_class #define CALL_SHORT 0x00000002 /* Never call indirect. */ /* These bits describe the different types of function supported - by the ARM backend. They are exclusive. ie a function cannot be both a + by the ARM backend. They are exclusive. i.e. a function cannot be both a normal function and an interworked function, for example. Knowing the type of a function is important for determining its prologue and epilogue sequences. @@ -1643,7 +1353,6 @@ enum reg_class #define ARM_FT_UNKNOWN 0 /* Type has not yet been determined. */ #define ARM_FT_NORMAL 1 /* Your normal, straightforward function. */ #define ARM_FT_INTERWORKED 2 /* A function that supports interworking. */ -#define ARM_FT_EXCEPTION_HANDLER 3 /* A C++ exception handler. */ #define ARM_FT_ISR 4 /* An interrupt service routine. */ #define ARM_FT_FIQ 5 /* A fast interrupt service routine. */ #define ARM_FT_EXCEPTION 6 /* An ARM exception handler (subcase of ISR). */ @@ -1664,6 +1373,23 @@ enum reg_class #define IS_NAKED(t) (t & ARM_FT_NAKED) #define IS_NESTED(t) (t & ARM_FT_NESTED) + +/* Structure used to hold the function stack frame layout. Offsets are + relative to the stack pointer on function entry. Positive offsets are + in the direction of stack growth. + Only soft_frame is used in thumb mode. */ + +typedef struct arm_stack_offsets GTY(()) +{ + int saved_args; /* ARG_POINTER_REGNUM. */ + int frame; /* ARM_HARD_FRAME_POINTER_REGNUM. */ + int saved_regs; + int soft_frame; /* FRAME_POINTER_REGNUM. */ + int locals_base; /* THUMB_HARD_FRAME_POINTER_REGNUM. */ + int outgoing_args; /* STACK_POINTER_REGNUM. */ +} +arm_stack_offsets; + /* A C structure for machine-specific, per-function data. This is added to the cfun structure. */ typedef struct machine_function GTY(()) @@ -1677,7 +1403,7 @@ typedef struct machine_function GTY(()) /* Records if the save of LR has been eliminated. */ int lr_save_eliminated; /* The size of the stack frame. Only valid after reload. */ - int frame_size; + arm_stack_offsets stack_offsets; /* Records the type of the current function. */ unsigned long func_type; /* Record if the function has a variable argument list. */ @@ -1685,9 +1411,19 @@ typedef struct machine_function GTY(()) /* Records if sibcalls are blocked because an argument register is needed to preserve stack alignment. */ int sibcall_blocked; + /* The PIC register for this function. This might be a pseudo. */ + rtx pic_reg; + /* Labels for per-function Thumb call-via stubs. One per potential calling + register. We can never call via LR or PC. We can call via SP if a + trampoline happens to be on the top of the stack. */ + rtx call_via[14]; } machine_function; +/* As in the machine_function, a global set of call-via labels, for code + that is in text_section. */ +extern GTY(()) rtx thumb_call_via_label[14]; + /* A C type for declaring a variable that is used as the first argument of `FUNCTION_ARG' and other related values. For some target machines, the type `int' suffices and can hold the number of bytes of argument so far. */ @@ -1701,6 +1437,7 @@ typedef struct int nargs; /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT. */ int call_cookie; + int can_split; } CUMULATIVE_ARGS; /* Define where to put the arguments to a function. @@ -1718,28 +1455,22 @@ typedef struct On the ARM, normally the first 16 bytes are passed in registers r0-r3; all other arguments are passed on the stack. If (NAMED == 0) (which happens - only in assign_parms, since SETUP_INCOMING_VARARGS is defined), say it is - passed in the stack (function_prologue will indeed make it pass in the - stack if necessary). */ + only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is + defined), say it is passed in the stack (function_prologue will + indeed make it pass in the stack if necessary). */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED)) -/* For an arg passed partly in registers and partly in memory, - this is the number of registers used. - For args passed entirely in registers or entirely in memory, zero. */ -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ - (VECTOR_MODE_SUPPORTED_P (MODE) ? 0 : \ - NUM_ARG_REGS > (CUM).nregs \ - && (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE))) \ - ? NUM_ARG_REGS - (CUM).nregs : 0) +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ + (arm_pad_arg_upward (MODE, TYPE) ? upward : downward) -/* A C expression that indicates when an argument must be passed by - reference. If nonzero for an argument, a copy of that argument is - made in memory and a pointer to the argument is passed instead of - the argument itself. The pointer is passed in whatever way is - appropriate for passing a pointer to that type. */ -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - arm_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) +#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ + (arm_pad_reg_upward (MODE, TYPE, FIRST) ? upward : downward) + +/* For AAPCS, padding should never be below the argument. For other ABIs, + * mimic the default. */ +#define PAD_VARARGS_DOWN \ + ((TARGET_AAPCS_BASED) ? 0 : BYTES_BIG_ENDIAN) /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. @@ -1753,52 +1484,28 @@ typedef struct (TYPE is null for libcalls where that information may not be available.) */ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ (CUM).nargs += 1; \ - if (VECTOR_MODE_SUPPORTED_P (MODE)) \ - if ((CUM).named_count <= (CUM).nargs) \ - (CUM).nregs += 2; \ - else \ - (CUM).iwmmxt_nregs += 1; \ + if (arm_vector_mode_supported_p (MODE) \ + && (CUM).named_count > (CUM).nargs) \ + (CUM).iwmmxt_nregs += 1; \ else \ - (CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE) + (CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE) /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, `PARM_BOUNDARY' is used for all arguments. */ #define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \ - (TARGET_REALLY_IWMMXT && (VALID_IWMMXT_REG_MODE (MODE) || ((MODE) == DFmode)) \ - ? IWMMXT_ALIGNMENT : PARM_BOUNDARY) + ((ARM_DOUBLEWORD_ALIGN && arm_needs_doubleword_align (MODE, TYPE)) \ + ? DOUBLEWORD_ALIGNMENT \ + : PARM_BOUNDARY ) /* 1 if N is a possible register number for function argument passing. On the ARM, r0-r3 are used to pass args. */ #define FUNCTION_ARG_REGNO_P(REGNO) \ (IN_RANGE ((REGNO), 0, 3) \ - || (TARGET_REALLY_IWMMXT && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9))) - -/* Implement `va_arg'. */ -#define EXPAND_BUILTIN_VA_ARG(valist, type) \ - arm_va_arg (valist, type) + || (TARGET_IWMMXT_ABI \ + && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9))) -/* Perform any actions needed for a function that is receiving a variable - number of arguments. CUM is as above. MODE and TYPE are the mode and type - of the current parameter. PRETEND_SIZE is a variable that should be set to - the amount of stack that must be pushed by the prolog to pretend that our - caller pushed it. - - Normally, this macro will push all remaining incoming registers on the - stack and set PRETEND_SIZE to the length of the registers pushed. - - On the ARM, PRETEND_SIZE is set in order to have the prologue push the last - named arg and all anonymous args onto the stack. - XXX I know the prologue shouldn't be pushing registers, but it is faster - that way. */ -#define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL) \ -{ \ - cfun->machine->uses_anonymous_args = 1; \ - if ((CUM).nregs < NUM_ARG_REGS) \ - (PRETEND_SIZE) = (NUM_ARG_REGS - (CUM).nregs) * UNITS_PER_WORD; \ -} - /* If your target environment doesn't prefix user functions with an underscore, you may wish to re-define this to prevent any conflicts. e.g. AOF may prefix mcount with an underscore. */ @@ -1836,7 +1543,7 @@ typedef struct assemble_name (STREAM, ARM_MCOUNT_NAME); \ fputc ('\n', STREAM); \ ASM_GENERATE_INTERNAL_LABEL (temp, "LP", LABELNO); \ - sym = gen_rtx (SYMBOL_REF, Pmode, temp); \ + sym = gen_rtx_SYMBOL_REF (Pmode, temp); \ assemble_aligned_integer (UNITS_PER_WORD, sym); \ } #endif @@ -1906,64 +1613,17 @@ typedef struct ((TO) == THUMB_HARD_FRAME_POINTER_REGNUM && TARGET_ARM) ? 0 : \ 1) -#define THUMB_REG_PUSHED_P(reg) \ - (regs_ever_live [reg] \ - && (! call_used_regs [reg] \ - || (flag_pic && (reg) == PIC_OFFSET_TABLE_REGNUM)) \ - && !(TARGET_SINGLE_PIC_BASE && ((reg) == arm_pic_register))) - /* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ -#define ARM_INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ - do \ - { \ - (OFFSET) = arm_compute_initial_elimination_offset (FROM, TO); \ - } \ - while (0) - -/* Note: This macro must match the code in thumb_function_prologue(). */ -#define THUMB_INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ -{ \ - (OFFSET) = 0; \ - if ((FROM) == ARG_POINTER_REGNUM) \ - { \ - int count_regs = 0; \ - int regno; \ - for (regno = 8; regno < 13; regno ++) \ - if (THUMB_REG_PUSHED_P (regno)) \ - count_regs ++; \ - if (count_regs) \ - (OFFSET) += 4 * count_regs; \ - count_regs = 0; \ - for (regno = 0; regno <= LAST_LO_REGNUM; regno ++) \ - if (THUMB_REG_PUSHED_P (regno)) \ - count_regs ++; \ - if (count_regs || ! leaf_function_p () || thumb_far_jump_used_p (0))\ - (OFFSET) += 4 * (count_regs + 1); \ - if (TARGET_BACKTRACE) \ - { \ - if ((count_regs & 0xFF) == 0 && (regs_ever_live[3] != 0)) \ - (OFFSET) += 20; \ - else \ - (OFFSET) += 16; \ - } \ - } \ - if ((TO) == STACK_POINTER_REGNUM) \ - { \ - (OFFSET) += current_function_outgoing_args_size; \ - (OFFSET) += thumb_get_frame_size (); \ - } \ -} - #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ if (TARGET_ARM) \ - ARM_INITIAL_ELIMINATION_OFFSET (FROM, TO, OFFSET); \ + (OFFSET) = arm_compute_initial_elimination_offset (FROM, TO); \ else \ - THUMB_INITIAL_ELIMINATION_OFFSET (FROM, TO, OFFSET) - + (OFFSET) = thumb_compute_initial_elimination_offset (FROM, TO) + /* Special case handling of the location of arguments passed on the stack. */ #define DEBUGGER_ARG_OFFSET(value, addr) value ? value : arm_debugger_arg_offset (value, addr) - + /* Initialize data used by insn expanders. This is called from insn_emit, once for every function before code is generated. */ #define INIT_EXPANDERS arm_init_expanders () @@ -2016,13 +1676,14 @@ typedef struct ARM_TRAMPOLINE_TEMPLATE (FILE) \ else \ THUMB_TRAMPOLINE_TEMPLATE (FILE) - + /* Length in units of the trampoline for entering a nested function. */ #define TRAMPOLINE_SIZE (TARGET_ARM ? 16 : 24) /* Alignment required for a trampoline in bits. */ #define TRAMPOLINE_ALIGNMENT 32 + /* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. */ @@ -2037,6 +1698,9 @@ typedef struct plus_constant (TRAMP, \ TARGET_ARM ? 12 : 20)), \ FNADDR); \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ + 0, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ } #endif @@ -2077,6 +1741,11 @@ typedef struct ? THUMB_REGNO_MODE_OK_FOR_BASE_P (REGNO, MODE) \ : ARM_REGNO_OK_FOR_BASE_P (REGNO)) +/* Nonzero if X can be the base register in a reg+reg addressing mode. + For Thumb, we can not use SP + reg, so reject SP. */ +#define REGNO_MODE_OK_FOR_REG_BASE_P(X, MODE) \ + REGNO_OK_FOR_INDEX_P (X) + /* For ARM code, we don't care about the mode, but for Thumb, the index must be suitable for use in a QImode load. */ #define REGNO_OK_FOR_INDEX_P(REGNO) \ @@ -2109,7 +1778,7 @@ typedef struct On the ARM, allow any integer (invalid ones are removed later by insn patterns), nice doubles and symbol_refs which refer to the function's constant pool XXX. - + When generating pic allow anything. */ #define ARM_LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X)) @@ -2119,8 +1788,10 @@ typedef struct || CONSTANT_ADDRESS_P (X) \ || flag_pic) -#define LEGITIMATE_CONSTANT_P(X) \ - (TARGET_ARM ? ARM_LEGITIMATE_CONSTANT_P (X) : THUMB_LEGITIMATE_CONSTANT_P (X)) +#define LEGITIMATE_CONSTANT_P(X) \ + (!arm_tls_referenced_p (X) \ + && (TARGET_ARM ? ARM_LEGITIMATE_CONSTANT_P (X) \ + : THUMB_LEGITIMATE_CONSTANT_P (X))) /* Special characters prefixed to function names in order to encode attribute like information. @@ -2146,7 +1817,7 @@ typedef struct case SHORT_CALL_FLAG_CHAR: return 1; \ case LONG_CALL_FLAG_CHAR: return 1; \ case '*': return 1; \ - SUBTARGET_NAME_ENCODING_LENGTHS + SUBTARGET_NAME_ENCODING_LENGTHS /* This is how to output a reference to a user-level label named NAME. `assemble_name' uses this. */ @@ -2154,8 +1825,75 @@ typedef struct #define ASM_OUTPUT_LABELREF(FILE, NAME) \ arm_asm_output_labelref (FILE, NAME) +/* The EABI specifies that constructors should go in .init_array. + Other targets use .ctors for compatibility. */ +#ifndef ARM_EABI_CTORS_SECTION_OP +#define ARM_EABI_CTORS_SECTION_OP \ + "\t.section\t.init_array,\"aw\",%init_array" +#endif +#ifndef ARM_EABI_DTORS_SECTION_OP +#define ARM_EABI_DTORS_SECTION_OP \ + "\t.section\t.fini_array,\"aw\",%fini_array" +#endif +#define ARM_CTORS_SECTION_OP \ + "\t.section\t.ctors,\"aw\",%progbits" +#define ARM_DTORS_SECTION_OP \ + "\t.section\t.dtors,\"aw\",%progbits" + +/* Define CTORS_SECTION_ASM_OP. */ +#undef CTORS_SECTION_ASM_OP +#undef DTORS_SECTION_ASM_OP +#ifndef IN_LIBGCC2 +# define CTORS_SECTION_ASM_OP \ + (TARGET_AAPCS_BASED ? ARM_EABI_CTORS_SECTION_OP : ARM_CTORS_SECTION_OP) +# define DTORS_SECTION_ASM_OP \ + (TARGET_AAPCS_BASED ? ARM_EABI_DTORS_SECTION_OP : ARM_DTORS_SECTION_OP) +#else /* !defined (IN_LIBGCC2) */ +/* In libgcc, CTORS_SECTION_ASM_OP must be a compile-time constant, + so we cannot use the definition above. */ +# ifdef __ARM_EABI__ +/* The .ctors section is not part of the EABI, so we do not define + CTORS_SECTION_ASM_OP when in libgcc; that prevents crtstuff + from trying to use it. We do define it when doing normal + compilation, as .init_array can be used instead of .ctors. */ +/* There is no need to emit begin or end markers when using + init_array; the dynamic linker will compute the size of the + array itself based on special symbols created by the static + linker. However, we do need to arrange to set up + exception-handling here. */ +# define CTOR_LIST_BEGIN asm (ARM_EABI_CTORS_SECTION_OP) +# define CTOR_LIST_END /* empty */ +# define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) +# define DTOR_LIST_END /* empty */ +# else /* !defined (__ARM_EABI__) */ +# define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP +# define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif /* !defined (__ARM_EABI__) */ +#endif /* !defined (IN_LIBCC2) */ + +/* True if the operating system can merge entities with vague linkage + (e.g., symbols in COMDAT group) during dynamic linking. */ +#ifndef TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P true +#endif + +/* Set the short-call flag for any function compiled in the current + compilation unit. We skip this for functions with the section + attribute when long-calls are in effect as this tells the compiler + that the section might be placed a long way from the caller. + See arm_is_longcall_p() for more information. */ #define ARM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \ - arm_encode_call_attribute (DECL, SHORT_CALL_FLAG_CHAR) + if (!TARGET_LONG_CALLS || ! DECL_SECTION_NAME (DECL)) \ + arm_encode_call_attribute (DECL, SHORT_CALL_FLAG_CHAR) + +#define ARM_OUTPUT_FN_UNWIND(F, PROLOGUE) arm_output_fn_unwind (F, PROLOGUE) + +#ifdef TARGET_UNWIND_INFO +#define ARM_EABI_UNWIND_TABLES \ + ((!USING_SJLJ_EXCEPTIONS && flag_exceptions) || flag_unwind_tables) +#else +#define ARM_EABI_UNWIND_TABLES 0 +#endif /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. @@ -2214,12 +1952,16 @@ typedef struct ? THUMB_REG_OK_FOR_INDEX_P (X) \ : ARM_REG_OK_FOR_INDEX_P (X)) +/* Nonzero if X can be the base register in a reg+reg addressing mode. + For Thumb, we can not use SP + reg, so reject SP. */ +#define REG_MODE_OK_FOR_REG_BASE_P(X, MODE) \ + REG_OK_FOR_INDEX_P (X) /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a valid memory address for an instruction. The MODE argument is the machine mode for the MEM expression that wants to use this address. */ - + #define ARM_BASE_REGISTER_RTX_P(X) \ (GET_CODE (X) == REG && ARM_REG_OK_FOR_BASE_P (X)) @@ -2228,7 +1970,7 @@ typedef struct #define ARM_GO_IF_LEGITIMATE_ADDRESS(MODE,X,WIN) \ { \ - if (arm_legitimate_address_p (MODE, X, REG_STRICT_P)) \ + if (arm_legitimate_address_p (MODE, X, SET, REG_STRICT_P)) \ goto WIN; \ } @@ -2242,7 +1984,7 @@ typedef struct if (TARGET_ARM) \ ARM_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN) \ else /* if (TARGET_THUMB) */ \ - THUMB_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN) + THUMB_GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN) /* Try machine-dependent ways of modifying an illegitimate address @@ -2250,15 +1992,11 @@ typedef struct #define ARM_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ do { \ X = arm_legitimize_address (X, OLDX, MODE); \ - \ - if (memory_address_p (MODE, X)) \ - goto WIN; \ } while (0) -#define THUMB_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ -do { \ - if (flag_pic) \ - (X) = legitimize_pic_address (OLDX, MODE, NULL_RTX); \ +#define THUMB_LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ +do { \ + X = thumb_legitimize_address (X, OLDX, MODE); \ } while (0) #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \ @@ -2267,8 +2005,11 @@ do { \ ARM_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN); \ else \ THUMB_LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN); \ + \ + if (memory_address_p (MODE, X)) \ + goto WIN; \ } while (0) - + /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ #define ARM_GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ @@ -2281,28 +2022,19 @@ do { \ /* Nothing helpful to do for the Thumb */ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ if (TARGET_ARM) \ - ARM_GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL) + ARM_GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE Pmode -/* Define as C expression which evaluates to nonzero if the tablejump - instruction expects the table to contain offsets from the address of the - table. - Do not define this if the table should contain absolute addresses. */ -/* #define CASE_VECTOR_PC_RELATIVE 1 */ - /* signed 'char' is most compatible, but RISC OS wants it unsigned. unsigned is probably best, but may break some code. */ #ifndef DEFAULT_SIGNED_CHAR #define DEFAULT_SIGNED_CHAR 0 #endif -/* Don't cse the address of the function being compiled. */ -#define NO_RECURSIVE_FUNCTION_CSE 1 - /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX 4 @@ -2317,17 +2049,17 @@ do { \ /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD will either zero-extend or sign-extend. The value of this macro should be the code that says which one of the two operations is implicitly - done, NIL if none. */ + done, UNKNOWN if none. */ #define LOAD_EXTEND_OP(MODE) \ (TARGET_THUMB ? ZERO_EXTEND : \ ((arm_arch4 || (MODE) == QImode) ? ZERO_EXTEND \ - : ((BYTES_BIG_ENDIAN && (MODE) == HImode) ? SIGN_EXTEND : NIL))) + : ((BYTES_BIG_ENDIAN && (MODE) == HImode) ? SIGN_EXTEND : UNKNOWN))) /* Nonzero if access to memory by bytes is slow and undesirable. */ #define SLOW_BYTE_ACCESS 0 #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1 - + /* Immediate shift counts are truncated by the output routines (or was it the assembler?). Shift counts in a register are truncated by ARM. Note that the native compiler puts too large (> 32) immediate shift counts @@ -2345,9 +2077,6 @@ do { \ /* Calling from registers is a massive pain. */ #define NO_FUNCTION_CSE 1 -/* Chars and shorts should be passed as ints. */ -#define PROMOTE_PROTOTYPES 1 - /* The machine modes of pointers and functions */ #define Pmode SImode #define FUNCTION_MODE Pmode @@ -2361,7 +2090,7 @@ do { \ (TARGET_ARM ? 10 : \ ((GET_MODE_SIZE (M) < 4 ? 8 : 2 * GET_MODE_SIZE (M)) \ * (CLASS == LO_REGS ? 1 : 2))) - + /* Try to generate sequences that don't involve branches, we can then use conditional instructions */ #define BRANCH_COST \ @@ -2371,26 +2100,23 @@ do { \ /* We decide which register to use based on the compilation options and the assembler in use; this is more general than the APCS restriction of using sb (r9) all the time. */ -extern int arm_pic_register; - -/* Used when parsing command line option -mpic-register=. */ -extern const char * arm_pic_register_string; +extern unsigned arm_pic_register; /* The register number of the register used to address a table of static data addresses in memory. */ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register -#define FINALIZE_PIC arm_finalize_pic (1) - /* We can't directly access anything that contains a symbol, - nor can we indirect via the constant pool. */ + nor can we indirect via the constant pool. One exception is + UNSPEC_TLS, which is always PIC. */ #define LEGITIMATE_PIC_OPERAND_P(X) \ (!(symbol_mentioned_p (X) \ || label_mentioned_p (X) \ || (GET_CODE (X) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (X) \ && (symbol_mentioned_p (get_pool_constant (X)) \ - || label_mentioned_p (get_pool_constant (X)))))) + || label_mentioned_p (get_pool_constant (X))))) \ + || tls_mentioned_p (X)) /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT @@ -2410,7 +2136,12 @@ extern int making_const_table; #define SELECT_CC_MODE(OP, X, Y) arm_select_cc_mode (OP, X, Y) -#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode) +#define REVERSIBLE_CC_MODE(MODE) 1 + +#define REVERSE_CONDITION(CODE,MODE) \ + (((MODE) == CCFPmode || (MODE) == CCFPEmode) \ + ? reverse_condition_maybe_unordered (code) \ + : reverse_condition (code)) #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \ do \ @@ -2420,7 +2151,8 @@ extern int making_const_table; || (const_ok_for_arm (- INTVAL (OP1))))) \ { \ rtx const_op = OP1; \ - CODE = arm_canonicalize_comparison ((CODE), &const_op); \ + CODE = arm_canonicalize_comparison ((CODE), GET_MODE (OP0), \ + &const_op); \ OP1 = const_op; \ } \ } \ @@ -2593,7 +2325,7 @@ extern int making_const_table; } \ \ default: \ - abort(); \ + gcc_unreachable (); \ } \ } \ else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC \ @@ -2601,8 +2333,7 @@ extern int making_const_table; { \ extern enum machine_mode output_memory_reference_mode; \ \ - if (GET_CODE (XEXP (X, 0)) != REG) \ - abort (); \ + gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \ \ if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \ asm_fprintf (STREAM, "[%r, #%s%d]!", \ @@ -2646,8 +2377,7 @@ extern int making_const_table; asm_fprintf (STREAM, "%r!", REGNO (XEXP (X, 0))); \ else if (GET_CODE (X) == PLUS) \ { \ - if (GET_CODE (XEXP (X, 0)) != REG) \ - abort (); \ + gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \ if (GET_CODE (XEXP (X, 1)) == CONST_INT) \ asm_fprintf (STREAM, "[%r, #%wd]", \ REGNO (XEXP (X, 0)), \ @@ -2667,10 +2397,9 @@ extern int making_const_table; else \ THUMB_PRINT_OPERAND_ADDRESS (STREAM, X) -#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \ - if (GET_CODE (X) != CONST_VECTOR \ - || ! arm_emit_vector_const (FILE, X)) \ - goto FAIL; +#define OUTPUT_ADDR_CONST_EXTRA(file, x, fail) \ + if (arm_output_addr_const_extra (file, x) == FALSE) \ + goto fail /* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. */ @@ -2678,7 +2407,7 @@ extern int making_const_table; #define RETURN_ADDR_RTX(COUNT, FRAME) \ arm_return_addr (COUNT, FRAME) -/* Mask of the bits in the PC that contain the real return address +/* Mask of the bits in the PC that contain the real return address when running in 26-bit mode. */ #define RETURN_ADDR_MASK26 (0x03fffffc) @@ -2695,61 +2424,11 @@ extern int making_const_table; in 26 bit mode, the condition codes must be masked out of the \ return address. This does not apply to ARM6 and later processors \ when running in 32 bit mode. */ \ - ((!TARGET_APCS_32) ? (gen_int_mode (RETURN_ADDR_MASK26, Pmode)) \ - : (arm_arch4 || TARGET_THUMB) ? \ - (gen_int_mode ((unsigned long)0xffffffff, Pmode)) \ + ((arm_arch4 || TARGET_THUMB) \ + ? (gen_int_mode ((unsigned long)0xffffffff, Pmode)) \ : arm_gen_return_addr_mask ()) -/* Define the codes that are matched by predicates in arm.c */ -#define PREDICATE_CODES \ - {"s_register_operand", {SUBREG, REG}}, \ - {"arm_hard_register_operand", {REG}}, \ - {"f_register_operand", {SUBREG, REG}}, \ - {"arm_add_operand", {SUBREG, REG, CONST_INT}}, \ - {"arm_addimm_operand", {CONST_INT}}, \ - {"fpa_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \ - {"fpa_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \ - {"arm_rhs_operand", {SUBREG, REG, CONST_INT}}, \ - {"arm_not_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_int_operand", {SUBREG, REG, CONST_INT}}, \ - {"index_operand", {SUBREG, REG, CONST_INT}}, \ - {"thumb_cmp_operand", {SUBREG, REG, CONST_INT}}, \ - {"thumb_cmpneg_operand", {CONST_INT}}, \ - {"thumb_cbrch_target_operand", {SUBREG, REG, MEM}}, \ - {"offsettable_memory_operand", {MEM}}, \ - {"bad_signed_byte_operand", {MEM}}, \ - {"alignable_memory_operand", {MEM}}, \ - {"shiftable_operator", {PLUS, MINUS, AND, IOR, XOR}}, \ - {"minmax_operator", {SMIN, SMAX, UMIN, UMAX}}, \ - {"shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT, ROTATERT, MULT}}, \ - {"di_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM}}, \ - {"nonimmediate_di_operand", {SUBREG, REG, MEM}}, \ - {"soft_df_operand", {SUBREG, REG, CONST_DOUBLE, MEM}}, \ - {"nonimmediate_soft_df_operand", {SUBREG, REG, MEM}}, \ - {"load_multiple_operation", {PARALLEL}}, \ - {"store_multiple_operation", {PARALLEL}}, \ - {"equality_operator", {EQ, NE}}, \ - {"arm_comparison_operator", {EQ, NE, LE, LT, GE, GT, GEU, GTU, LEU, \ - LTU, UNORDERED, ORDERED, UNLT, UNLE, \ - UNGE, UNGT}}, \ - {"arm_rhsm_operand", {SUBREG, REG, CONST_INT, MEM}}, \ - {"const_shift_operand", {CONST_INT}}, \ - {"multi_register_push", {PARALLEL}}, \ - {"cc_register", {REG}}, \ - {"logical_binary_operator", {AND, IOR, XOR}}, \ - {"cirrus_register_operand", {REG}}, \ - {"cirrus_fp_register", {REG}}, \ - {"cirrus_shift_const", {CONST_INT}}, \ - {"dominant_cc_register", {REG}}, - -/* Define this if you have special predicates that know special things - about modes. Genrecog will warn about certain forms of - match_operand without a mode; if the operand predicate is listed in - SPECIAL_MODE_PREDICATES, the warning will be suppressed. */ -#define SPECIAL_MODE_PREDICATES \ - "cc_register", "dominant_cc_register", - enum arm_builtins { ARM_BUILTIN_GETWCX, @@ -2860,8 +2539,8 @@ enum arm_builtins ARM_BUILTIN_WMINUH, ARM_BUILTIN_WMINUB, - ARM_BUILTIN_WMULUH, - ARM_BUILTIN_WMULSH, + ARM_BUILTIN_WMULUM, + ARM_BUILTIN_WMULSM, ARM_BUILTIN_WMULUL, ARM_BUILTIN_PSADBH, @@ -2912,6 +2591,8 @@ enum arm_builtins ARM_BUILTIN_WUNPCKELUH, ARM_BUILTIN_WUNPCKELUW, + ARM_BUILTIN_THREAD_POINTER, + ARM_BUILTIN_MAX }; #endif /* ! GCC_ARM_H */ diff --git a/contrib/gcc/config/arm/arm.md b/contrib/gcc/config/arm/arm.md index 0a5e647aed0..b28e3d01a57 100644 --- a/contrib/gcc/config/arm/arm.md +++ b/contrib/gcc/config/arm/arm.md @@ -1,6 +1,6 @@ ;;- Machine description for ARM for GNU compiler ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003 2004 Free Software Foundation, Inc. +;; 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -19,8 +19,8 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. @@ -30,12 +30,15 @@ ;; Register numbers (define_constants - [(IP_REGNUM 12) ; Scratch register + [(R0_REGNUM 0) ; First CORE register + (IP_REGNUM 12) ; Scratch register (SP_REGNUM 13) ; Stack pointer (LR_REGNUM 14) ; Return address register (PC_REGNUM 15) ; Program counter (CC_REGNUM 24) ; Condition code pseudo register - (LAST_ARM_REGNUM 15) + (LAST_ARM_REGNUM 15) ; + (FPA_F0_REGNUM 16) ; FIRST_FPA_REGNUM + (FPA_F7_REGNUM 23) ; LAST_FPA_REGNUM ] ) ;; 3rd operand to select_dominance_cc_mode @@ -87,6 +90,9 @@ (UNSPEC_CLRDI 17) ; Used by the intrinsic form of the iWMMXt CLRDI instruction. (UNSPEC_WMADDS 18) ; Used by the intrinsic form of the iWMMXt WMADDS instruction. (UNSPEC_WMADDU 19) ; Used by the intrinsic form of the iWMMXt WMADDU instruction. + (UNSPEC_TLS 20) ; A symbol that has been treated properly for TLS usage. + (UNSPEC_PIC_LABEL 21) ; A label used for PIC access that does not appear in the + ; instruction stream. ] ) @@ -117,6 +123,8 @@ (VUNSPEC_WCMP_EQ 11) ; Used by the iWMMXt WCMPEQ instructions (VUNSPEC_WCMP_GTU 12) ; Used by the iWMMXt WCMPGTU instructions (VUNSPEC_WCMP_GT 13) ; Used by the iwMMXT WCMPGT instructions + (VUNSPEC_EH_RETURN 20); Use to override the return address for exception + ; handling. ] ) @@ -128,24 +136,21 @@ ; patterns that share the same RTL in both ARM and Thumb code. (define_attr "is_thumb" "no,yes" (const (symbol_ref "thumb_code"))) -; PROG_MODE attribute is used to determine whether condition codes are -; clobbered by a call insn: they are if in prog32 mode. This is controlled -; by the -mapcs-{32,26} flag, and possibly the -mcpu=... option. -(define_attr "prog_mode" "prog26,prog32" (const (symbol_ref "arm_prog_mode"))) - ; IS_STRONGARM is set to 'yes' when compiling for StrongARM, it affects ; scheduling decisions for the load unit and the multiplier. -(define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_is_strong"))) +(define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_tune_strongarm"))) + +; IS_XSCALE is set to 'yes' when compiling for XScale. +(define_attr "is_xscale" "no,yes" (const (symbol_ref "arm_tune_xscale"))) ;; Operand number of an input operand that is shifted. Zero if the ;; given instruction does not shift one of its input operands. -(define_attr "is_xscale" "no,yes" (const (symbol_ref "arm_tune_xscale"))) (define_attr "shift" "" (const_int 0)) ; Floating Point Unit. If we only have floating point emulation, then there ; is no point in scheduling the floating point insns. (Well, for best ; performance we should try and group them together). -(define_attr "fpu" "softfpa,fpa,fpe2,fpe3,maverick" +(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp" (const (symbol_ref "arm_fpu_attr"))) ; LENGTH of an instruction (in bytes) @@ -167,13 +172,26 @@ (set_attr "length" "4") (set_attr "pool_range" "250")]) +;; The instruction used to implement a particular pattern. This +;; information is used by pipeline descriptions to provide accurate +;; scheduling information. + +(define_attr "insn" + "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,other" + (const_string "other")) + ; TYPE attribute is used to detect floating point instructions which, if ; running on a co-processor can run in parallel with other, basic instructions ; If write-buffer scheduling is enabled then it can also be used in the ; scheduling of writes. ; Classification of each insn -; normal any data instruction that doesn't hit memory or fp regs +; alu any alu instruction that doesn't hit memory or fp +; regs or have a shifted source operand +; alu_shift any data instruction that doesn't hit memory or fp +; regs, but has a source operand shifted by a constant +; alu_shift_reg any data instruction that doesn't hit memory or fp +; regs, but has a source operand shifted by a register value ; mult a multiply instruction ; block blockage insn, this blocks all functional units ; float a floating point arithmetic operation (subject to expansion) @@ -187,23 +205,35 @@ ; even on a machine with an fpa. ; f_load a floating point load from memory ; f_store a floating point store to memory +; f_load[sd] single/double load from memory +; f_store[sd] single/double store to memory +; f_flag a transfer of co-processor flags to the CPSR ; f_mem_r a transfer of a floating point register to a real reg via mem ; r_mem_f the reverse of f_mem_r ; f_2_r fast transfer float to arm (no memory needed) ; r_2_f fast transfer arm to float +; f_cvt convert floating<->integral +; branch a branch ; call a subroutine call -; load any load from memory -; store1 store 1 word to memory from arm registers +; load_byte load byte(s) from memory to arm registers +; load1 load 1 word from memory to arm registers +; load2 load 2 words from memory to arm registers +; load3 load 3 words from memory to arm registers +; load4 load 4 words from memory to arm registers +; store store 1 word to memory from arm registers ; store2 store 2 words ; store3 store 3 words -; store4 store 4 words +; store4 store 4 (or more) words ; Additions for Cirrus Maverick co-processor: ; mav_farith Floating point arithmetic (4 cycle) ; mav_dmult Double multiplies (7 cycle) ; (define_attr "type" - "normal,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,call,load,store1,store2,store3,store4,mav_farith,mav_dmult" - (const_string "normal")) + "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,f_flag,float_em,f_load,f_store,f_loads,f_loadd,f_stores,f_stored,f_mem_r,r_mem_f,f_2_r,r_2_f,f_cvt,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult" + (if_then_else + (eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals") + (const_string "mult") + (const_string "alu"))) ; Load scheduling, set from the arm_ld_sched variable ; initialized by arm_override_options() @@ -231,8 +261,7 @@ (define_attr "conds" "use,set,clob,jump_clob,nocond" (if_then_else (eq_attr "type" "call") - (if_then_else (eq_attr "prog_mode" "prog32") - (const_string "clob") (const_string "nocond")) + (const_string "clob") (const_string "nocond"))) ; Predicable means that the insn can be conditionally executed based on @@ -245,13 +274,13 @@ ; have one. Later ones, such as StrongARM, have write-back caches, so don't ; suffer blockages enough to warrant modelling this (and it can adversely ; affect the schedule). -(define_attr "model_wbuf" "no,yes" (const (symbol_ref "arm_is_6_or_7"))) +(define_attr "model_wbuf" "no,yes" (const (symbol_ref "arm_tune_wbuf"))) ; WRITE_CONFLICT implies that a read following an unrelated write is likely ; to stall the processor. Used with model_wbuf above. (define_attr "write_conflict" "no,yes" (if_then_else (eq_attr "type" - "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load") + "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load1") (const_string "yes") (const_string "no"))) @@ -259,7 +288,7 @@ ; than one on the main cpu execution unit. (define_attr "core_cycles" "single,multi" (if_then_else (eq_attr "type" - "normal,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") + "alu,alu_shift,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") (const_string "single") (const_string "multi"))) @@ -267,115 +296,47 @@ ;; distant label. Only applicable to Thumb code. (define_attr "far_jump" "yes,no" (const_string "no")) -(define_automaton "arm") -;; Write buffer -; -; Strictly, we should model a 4-deep write buffer for ARM7xx based chips -; -; The write buffer on some of the arm6 processors is hard to model exactly. -; There is room in the buffer for up to two addresses and up to eight words -; of memory, but the two needn't be split evenly. When writing the two -; addresses are fully pipelined. However, a read from memory that is not -; currently in the cache will block until the writes have completed. -; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so -; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous -; (they aren't allowed to be at present) then there is a startup cost of 1MCLK -; cycle to add as well. -(define_cpu_unit "write_buf" "arm") +;;--------------------------------------------------------------------------- +;; Mode macros -;; Write blockage unit -; -; The write_blockage unit models (partially), the fact that reads will stall -; until the write buffer empties. -; The f_mem_r and r_mem_f could also block, but they are to the stack, -; so we don't model them here -(define_cpu_unit "write_blockage" "arm") +; A list of modes that are exactly 64 bits in size. We use this to expand +; some splits that are the same for all modes when operating on ARM +; registers. +(define_mode_macro ANY64 [DI DF V8QI V4HI V2SI V2SF]) -;; Core -; -(define_cpu_unit "core" "arm") +;;--------------------------------------------------------------------------- +;; Predicates -(define_insn_reservation "r_mem_f_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "r_mem_f")) - "core+write_buf*3") +(include "predicates.md") +(include "constraints.md") -(define_insn_reservation "store1_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store1")) - "core+write_buf*3+write_blockage*5") +;;--------------------------------------------------------------------------- +;; Pipeline descriptions -(define_insn_reservation "store2_wbuf" 7 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store2")) - "core+write_buf*4+write_blockage*7") +;; Processor type. This is created automatically from arm-cores.def. +(include "arm-tune.md") -(define_insn_reservation "store3_wbuf" 9 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store3")) - "core+write_buf*5+write_blockage*9") +;; True if the generic scheduling description should be used. -(define_insn_reservation "store4_wbuf" 11 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store4")) - "core+write_buf*6+write_blockage*11") +(define_attr "generic_sched" "yes,no" + (const (if_then_else + (eq_attr "tune" "arm926ejs,arm1020e,arm1026ejs,arm1136js,arm1136jfs") + (const_string "no") + (const_string "yes")))) -(define_insn_reservation "store2" 3 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store2")) - "core*3") +(define_attr "generic_vfp" "yes,no" + (const (if_then_else + (and (eq_attr "fpu" "vfp") + (eq_attr "tune" "!arm1020e,arm1022e")) + (const_string "yes") + (const_string "no")))) -(define_insn_reservation "store3" 4 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store3")) - "core*4") - -(define_insn_reservation "store4" 5 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store4")) - "core*5") - -(define_insn_reservation "store1_ldsched" 1 - (and (eq_attr "ldsched" "yes") (eq_attr "type" "store1")) - "core") - -(define_insn_reservation "load_ldsched_xscale" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "yes")) - "core") - -(define_insn_reservation "load_ldsched" 2 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "no")) - "core") - -(define_insn_reservation "load_or_store" 2 - (and (eq_attr "ldsched" "!yes") (eq_attr "type" "load,store1")) - "core*2") - -(define_insn_reservation "mult" 16 - (and (eq_attr "ldsched" "no") (eq_attr "type" "mult")) - "core*16") - -(define_insn_reservation "mult_ldsched_strongarm" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "yes")) - (eq_attr "type" "mult")) - "core*2") - -(define_insn_reservation "mult_ldsched" 4 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "no")) - (eq_attr "type" "mult")) - "core*4") - -(define_insn_reservation "multi_cycle" 32 - (and (eq_attr "core_cycles" "multi") - (eq_attr "type" "!mult,load,store1,store2,store3,store4")) - "core*32") - -(define_insn_reservation "single_cycle" 1 - (eq_attr "core_cycles" "single") - "core") +(include "arm-generic.md") +(include "arm926ejs.md") +(include "arm1020e.md") +(include "arm1026ejs.md") +(include "arm1136jfs.md") ;;--------------------------------------------------------------------------- @@ -397,7 +358,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], DImode)) operands[0] = force_reg (DImode, operands[0]); @@ -433,7 +394,7 @@ (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0") (match_operand:DI 2 "s_register_operand" "r, 0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -461,7 +422,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -490,7 +451,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -519,9 +480,9 @@ " if (TARGET_ARM && GET_CODE (operands[2]) == CONST_INT) { - arm_split_constant (PLUS, SImode, INTVAL (operands[2]), operands[0], - operands[1], - (no_new_pseudos ? 0 : preserve_subexpressions_p ())); + arm_split_constant (PLUS, SImode, NULL_RTX, + INTVAL (operands[2]), operands[0], operands[1], + optimize && !no_new_pseudos); DONE; } " @@ -531,8 +492,8 @@ ; addition. (define_peephole2 [(match_scratch:SI 3 "r") - (set (match_operand:SI 0 "s_register_operand" "") - (plus:SI (match_operand:SI 1 "s_register_operand" "") + (set (match_operand:SI 0 "arm_general_register_operand" "") + (plus:SI (match_operand:SI 1 "arm_general_register_operand" "") (match_operand:SI 2 "const_int_operand" "")))] "TARGET_ARM && !(const_ok_for_arm (INTVAL (operands[2])) @@ -558,7 +519,8 @@ || const_ok_for_arm (-INTVAL (operands[2])))" [(clobber (const_int 0))] " - arm_split_constant (PLUS, SImode, INTVAL (operands[2]), operands[0], + arm_split_constant (PLUS, SImode, curr_insn, + INTVAL (operands[2]), operands[0], operands[1], 0); DONE; " @@ -598,15 +560,14 @@ ;; Reloading and elimination of the frame pointer can ;; sometimes cause this optimization to be missed. (define_peephole2 - [(set (match_operand:SI 0 "register_operand" "") + [(set (match_operand:SI 0 "arm_general_register_operand" "") (match_operand:SI 1 "const_int_operand" "")) (set (match_dup 0) - (plus:SI (match_dup 0) (match_operand:SI 2 "register_operand" "")))] + (plus:SI (match_dup 0) (reg:SI SP_REGNUM)))] "TARGET_THUMB - && REGNO (operands[2]) == STACK_POINTER_REGNUM && (unsigned HOST_WIDE_INT) (INTVAL (operands[1])) < 1024 && (INTVAL (operands[1]) & 3) == 0" - [(set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))] + [(set (match_dup 0) (plus:SI (reg:SI SP_REGNUM) (match_dup 1)))] "" ) @@ -638,32 +599,13 @@ [(set_attr "conds" "set")] ) -;; These patterns are the same ones as the two regular addsi3_compare0 -;; patterns, except we write them slightly different - the combiner -;; tends to generate them this way. -(define_insn "*addsi3_compare0_for_combiner" - [(set (reg:CC CC_REGNUM) - (compare:CC - (match_operand:SI 1 "s_register_operand" "r,r") - (neg:SI (match_operand:SI 2 "arm_add_operand" "rI,L")))) - (set (match_operand:SI 0 "s_register_operand" "=r,r") - (plus:SI (match_dup 1) (match_dup 2)))] +(define_insn "*compare_negsi_si" + [(set (reg:CC_Z CC_REGNUM) + (compare:CC_Z + (neg:SI (match_operand:SI 0 "s_register_operand" "r")) + (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_ARM" - "@ - add%?s\\t%0, %1, %2 - sub%?s\\t%0, %1, #%n2" - [(set_attr "conds" "set")] -) - -(define_insn "*addsi3_compare0_scratch_for_combiner" - [(set (reg:CC CC_REGNUM) - (compare:CC - (match_operand:SI 0 "s_register_operand" "r,r") - (neg:SI (match_operand:SI 1 "arm_add_operand" "rI,L"))))] - "TARGET_ARM" - "@ - cmn%?\\t%0, %1 - cmp%?\\t%0, #%n1" + "cmn%?\\t%1, %0" [(set_attr "conds" "set")] ) @@ -694,8 +636,8 @@ ;; similarly for the beq variant using bcc. ;; This is a common looping idiom (while (n--)) (define_peephole2 - [(set (match_operand:SI 0 "s_register_operand" "") - (plus:SI (match_operand:SI 1 "s_register_operand" "") + [(set (match_operand:SI 0 "arm_general_register_operand" "") + (plus:SI (match_operand:SI 1 "arm_general_register_operand" "") (const_int -1))) (set (match_operand 2 "cc_register" "") (compare (match_dup 0) (const_int -1))) @@ -801,7 +743,10 @@ (match_operand:SI 1 "s_register_operand" "r"))))] "TARGET_ARM" "adc%?\\t%0, %1, %3%S2" - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*addsi3_carryin_alt1" @@ -864,10 +809,10 @@ (define_expand "addsf3" [(set (match_operand:SF 0 "s_register_operand" "") (plus:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 2 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -875,10 +820,10 @@ (define_expand "adddf3" [(set (match_operand:DF 0 "s_register_operand" "") (plus:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -891,7 +836,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS + if (TARGET_HARD_FLOAT && TARGET_MAVERICK && TARGET_ARM && cirrus_fp_register (operands[0], DImode) && cirrus_fp_register (operands[1], DImode)) @@ -1002,10 +947,9 @@ { if (TARGET_ARM) { - arm_split_constant (MINUS, SImode, INTVAL (operands[1]), operands[0], - operands[2], - (no_new_pseudos ? 0 - : preserve_subexpressions_p ())); + arm_split_constant (MINUS, SImode, NULL_RTX, + INTVAL (operands[1]), operands[0], + operands[2], optimize && !no_new_pseudos); DONE; } else /* TARGET_THUMB */ @@ -1036,8 +980,8 @@ && !const_ok_for_arm (INTVAL (operands[1]))" [(clobber (const_int 0))] " - arm_split_constant (MINUS, SImode, INTVAL (operands[1]), operands[0], - operands[2], 0); + arm_split_constant (MINUS, SImode, curr_insn, + INTVAL (operands[1]), operands[0], operands[2], 0); DONE; " [(set_attr "length" "4,16") @@ -1046,9 +990,9 @@ (define_peephole2 [(match_scratch:SI 3 "r") - (set (match_operand:SI 0 "s_register_operand" "") + (set (match_operand:SI 0 "arm_general_register_operand" "") (minus:SI (match_operand:SI 1 "const_int_operand" "") - (match_operand:SI 2 "s_register_operand" "")))] + (match_operand:SI 2 "arm_general_register_operand" "")))] "TARGET_ARM && !const_ok_for_arm (INTVAL (operands[1])) && const_ok_for_arm (~INTVAL (operands[1]))" @@ -1087,11 +1031,11 @@ (define_expand "subsf3" [(set (match_operand:SF 0 "s_register_operand" "") - (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "") + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], SFmode)) operands[1] = force_reg (SFmode, operands[1]); @@ -1102,11 +1046,11 @@ (define_expand "subdf3" [(set (match_operand:DF 0 "s_register_operand" "") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "") + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[1]); @@ -1133,7 +1077,7 @@ (match_operand:SI 1 "s_register_operand" "%?r,0")))] "TARGET_ARM" "mul%?\\t%0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "mul") (set_attr "predicable" "yes")] ) @@ -1149,12 +1093,12 @@ "TARGET_THUMB" "* if (which_alternative < 2) - return \"mov\\t%0, %1\;mul\\t%0, %0, %2\"; + return \"mov\\t%0, %1\;mul\\t%0, %2\"; else - return \"mul\\t%0, %0, %2\"; + return \"mul\\t%0, %2\"; " [(set_attr "length" "4,4,2") - (set_attr "type" "mult")] + (set_attr "insn" "mul")] ) (define_insn "*mulsi3_compare0" @@ -1165,10 +1109,10 @@ (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=&r,&r") (mult:SI (match_dup 2) (match_dup 1)))] - "TARGET_ARM && !arm_arch_xscale" + "TARGET_ARM" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) (define_insn "*mulsi_compare0_scratch" @@ -1178,10 +1122,10 @@ (match_operand:SI 1 "s_register_operand" "%?r,0")) (const_int 0))) (clobber (match_scratch:SI 0 "=&r,&r"))] - "TARGET_ARM && !arm_arch_xscale" + "TARGET_ARM" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) ;; Unnamed templates to match MLA instruction. @@ -1194,7 +1138,7 @@ (match_operand:SI 3 "s_register_operand" "?r,r,0,0")))] "TARGET_ARM" "mla%?\\t%0, %2, %1, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "mla") (set_attr "predicable" "yes")] ) @@ -1209,10 +1153,10 @@ (set (match_operand:SI 0 "s_register_operand" "=&r,&r,&r,&r") (plus:SI (mult:SI (match_dup 2) (match_dup 1)) (match_dup 3)))] - "TARGET_ARM && !arm_arch_xscale" + "TARGET_ARM" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) (define_insn "*mulsi3addsi_compare0_scratch" @@ -1224,10 +1168,10 @@ (match_operand:SI 3 "s_register_operand" "?r,r,0,0")) (const_int 0))) (clobber (match_scratch:SI 0 "=&r,&r,&r,&r"))] - "TARGET_ARM && !arm_arch_xscale" + "TARGET_ARM" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) ;; Unnamed template to match long long multiply-accumulate (smlal) @@ -1239,9 +1183,9 @@ (sign_extend:DI (match_operand:SI 2 "s_register_operand" "%r")) (sign_extend:DI (match_operand:SI 3 "s_register_operand" "r"))) (match_operand:DI 1 "s_register_operand" "0")))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smlal") (set_attr "predicable" "yes")] ) @@ -1250,9 +1194,9 @@ (mult:DI (sign_extend:DI (match_operand:SI 1 "s_register_operand" "%r")) (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1261,9 +1205,9 @@ (mult:DI (zero_extend:DI (match_operand:SI 1 "s_register_operand" "%r")) (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) @@ -1276,9 +1220,9 @@ (zero_extend:DI (match_operand:SI 2 "s_register_operand" "%r")) (zero_extend:DI (match_operand:SI 3 "s_register_operand" "r"))) (match_operand:DI 1 "s_register_operand" "0")))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umlal") (set_attr "predicable" "yes")] ) @@ -1291,9 +1235,9 @@ (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r,r"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=&r,&r"))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "smull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1306,9 +1250,9 @@ (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r,r"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=&r,&r"))] - "TARGET_ARM && arm_fast_multiply" + "TARGET_ARM && arm_arch3m" "umull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) @@ -1320,7 +1264,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smulbb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1333,7 +1277,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smultb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1346,7 +1290,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smulbt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1360,7 +1304,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smultt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1373,7 +1317,7 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlabb%?\\t%0, %2, %3, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smlaxy") (set_attr "predicable" "yes")] ) @@ -1387,16 +1331,16 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlalbb%?\\t%Q0, %R0, %2, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "smlalxy") (set_attr "predicable" "yes")]) (define_expand "mulsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mult:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -1404,10 +1348,10 @@ (define_expand "muldf3" [(set (match_operand:DF 0 "s_register_operand" "") (mult:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -1416,16 +1360,16 @@ (define_expand "divsf3" [(set (match_operand:SF 0 "s_register_operand" "") - (div:SF (match_operand:SF 1 "fpa_rhs_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "") + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_expand "divdf3" [(set (match_operand:DF 0 "s_register_operand" "") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "") + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") ;; Modulo insns @@ -1433,15 +1377,15 @@ (define_expand "modsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mod:SF (match_operand:SF 1 "s_register_operand" "") - (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_expand "moddf3" [(set (match_operand:DF 0 "s_register_operand" "") (mod:DF (match_operand:DF 1 "s_register_operand" "") - (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; Boolean and,ior,xor insns @@ -1578,10 +1522,10 @@ { if (GET_CODE (operands[2]) == CONST_INT) { - arm_split_constant (AND, SImode, INTVAL (operands[2]), operands[0], - operands[1], - (no_new_pseudos - ? 0 : preserve_subexpressions_p ())); + arm_split_constant (AND, SImode, NULL_RTX, + INTVAL (operands[2]), operands[0], + operands[1], optimize && !no_new_pseudos); + DONE; } } @@ -1645,8 +1589,8 @@ || const_ok_for_arm (~INTVAL (operands[2])))" [(clobber (const_int 0))] " - arm_split_constant (AND, SImode, INTVAL (operands[2]), operands[0], - operands[1], 0); + arm_split_constant (AND, SImode, curr_insn, + INTVAL (operands[2]), operands[0], operands[1], 0); DONE; " [(set_attr "length" "4,4,16") @@ -1712,7 +1656,7 @@ [(set_attr "conds" "set")] ) -(define_insn "*ne_zeroextractsi" +(define_insn_and_split "*ne_zeroextractsi" [(set (match_operand:SI 0 "s_register_operand" "=r") (ne:SI (zero_extract:SI (match_operand:SI 1 "s_register_operand" "r") @@ -1725,11 +1669,112 @@ && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32)" - "* + "#" + "TARGET_ARM + && (INTVAL (operands[3]) >= 0 && INTVAL (operands[3]) < 32 + && INTVAL (operands[2]) > 0 + && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 + && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32)" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (and:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) (and:SI (match_dup 1) (match_dup 2)))]) + (set (match_dup 0) + (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (match_dup 0) (const_int 1)))] + " operands[2] = GEN_INT (((1 << INTVAL (operands[2])) - 1) - << INTVAL (operands[3])); - output_asm_insn (\"ands\\t%0, %1, %2\", operands); - return \"movne\\t%0, #1\"; + << INTVAL (operands[3])); + " + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + +(define_insn_and_split "*ne_zeroextractsi_shifted" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (ne:SI (zero_extract:SI + (match_operand:SI 1 "s_register_operand" "r") + (match_operand:SI 2 "const_int_operand" "n") + (const_int 0)) + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "#" + "TARGET_ARM" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))]) + (set (match_dup 0) + (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (match_dup 0) (const_int 1)))] + " + operands[2] = GEN_INT (32 - INTVAL (operands[2])); + " + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + +(define_insn_and_split "*ite_ne_zeroextractsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (if_then_else:SI (ne (zero_extract:SI + (match_operand:SI 1 "s_register_operand" "r") + (match_operand:SI 2 "const_int_operand" "n") + (match_operand:SI 3 "const_int_operand" "n")) + (const_int 0)) + (match_operand:SI 4 "arm_not_operand" "rIK") + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM + && (INTVAL (operands[3]) >= 0 && INTVAL (operands[3]) < 32 + && INTVAL (operands[2]) > 0 + && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 + && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32) + && !reg_overlap_mentioned_p (operands[0], operands[4])" + "#" + "TARGET_ARM + && (INTVAL (operands[3]) >= 0 && INTVAL (operands[3]) < 32 + && INTVAL (operands[2]) > 0 + && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 + && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32) + && !reg_overlap_mentioned_p (operands[0], operands[4])" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (and:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) (and:SI (match_dup 1) (match_dup 2)))]) + (set (match_dup 0) + (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (match_dup 0) (match_dup 4)))] + " + operands[2] = GEN_INT (((1 << INTVAL (operands[2])) - 1) + << INTVAL (operands[3])); + " + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + +(define_insn_and_split "*ite_ne_zeroextractsi_shifted" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (if_then_else:SI (ne (zero_extract:SI + (match_operand:SI 1 "s_register_operand" "r") + (match_operand:SI 2 "const_int_operand" "n") + (const_int 0)) + (const_int 0)) + (match_operand:SI 3 "arm_not_operand" "rIK") + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM && !reg_overlap_mentioned_p (operands[0], operands[3])" + "#" + "TARGET_ARM && !reg_overlap_mentioned_p (operands[0], operands[3])" + [(parallel [(set (reg:CC_NOOV CC_REGNUM) + (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))]) + (set (match_dup 0) + (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (match_dup 0) (match_dup 3)))] + " + operands[2] = GEN_INT (32 - INTVAL (operands[2])); " [(set_attr "conds" "clob") (set_attr "length" "8")] @@ -1860,9 +1905,10 @@ HOST_WIDE_INT op3_value = mask & INTVAL (operands[3]); HOST_WIDE_INT mask2 = ((mask & ~op3_value) << start_bit); - emit_insn (gen_andsi3 (op1, operands[0], GEN_INT (~mask2))); + emit_insn (gen_andsi3 (op1, operands[0], + gen_int_mode (~mask2, SImode))); emit_insn (gen_iorsi3 (subtarget, op1, - GEN_INT (op3_value << start_bit))); + gen_int_mode (op3_value << start_bit, SImode))); } else if (start_bit == 0 && !(const_ok_for_arm (mask) @@ -1898,7 +1944,7 @@ } else { - rtx op0 = GEN_INT (mask); + rtx op0 = gen_int_mode (mask, SImode); rtx op1 = gen_reg_rtx (SImode); rtx op2 = gen_reg_rtx (SImode); @@ -1917,7 +1963,7 @@ && (const_ok_for_arm (mask << start_bit) || const_ok_for_arm (~(mask << start_bit)))) { - op0 = GEN_INT (~(mask << start_bit)); + op0 = gen_int_mode (~(mask << start_bit), SImode); emit_insn (gen_andsi3 (op2, operands[0], op0)); } else @@ -2048,16 +2094,18 @@ ) (define_insn "andsi_not_shiftsi_si" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (and:SI (not:SI (match_operator:SI 4 "shift_operator" - [(match_operand:SI 2 "s_register_operand" "r") - (match_operand:SI 3 "arm_rhs_operand" "rM")])) - (match_operand:SI 1 "s_register_operand" "r")))] + [(set (match_operand:SI 0 "s_register_operand" "=r") + (and:SI (not:SI (match_operator:SI 4 "shift_operator" + [(match_operand:SI 2 "s_register_operand" "r") + (match_operand:SI 3 "arm_rhs_operand" "rM")])) + (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_ARM" "bic%?\\t%0, %1, %2%S4" [(set_attr "predicable" "yes") (set_attr "shift" "2") - ] + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*andsi_notsi_si_compare0" @@ -2129,10 +2177,9 @@ { if (TARGET_ARM) { - arm_split_constant (IOR, SImode, INTVAL (operands[2]), operands[0], - operands[1], - (no_new_pseudos - ? 0 : preserve_subexpressions_p ())); + arm_split_constant (IOR, SImode, NULL_RTX, + INTVAL (operands[2]), operands[0], operands[1], + optimize && !no_new_pseudos); DONE; } else /* TARGET_THUMB */ @@ -2154,8 +2201,8 @@ && !const_ok_for_arm (INTVAL (operands[2]))" [(clobber (const_int 0))] " - arm_split_constant (IOR, SImode, INTVAL (operands[2]), operands[0], - operands[1], 0); + arm_split_constant (IOR, SImode, curr_insn, + INTVAL (operands[2]), operands[0], operands[1], 0); DONE; " [(set_attr "length" "4,16") @@ -2173,8 +2220,8 @@ (define_peephole2 [(match_scratch:SI 3 "r") - (set (match_operand:SI 0 "s_register_operand" "") - (ior:SI (match_operand:SI 1 "s_register_operand" "") + (set (match_operand:SI 0 "arm_general_register_operand" "") + (ior:SI (match_operand:SI 1 "arm_general_register_operand" "") (match_operand:SI 2 "const_int_operand" "")))] "TARGET_ARM && !const_ok_for_arm (INTVAL (operands[2])) @@ -2427,32 +2474,93 @@ ;; Minimum and maximum insns -(define_insn "smaxsi3" - [(set (match_operand:SI 0 "s_register_operand" "=r,r,r") - (smax:SI (match_operand:SI 1 "s_register_operand" "0,r,?r") - (match_operand:SI 2 "arm_rhs_operand" "rI,0,rI"))) +(define_expand "smaxsi3" + [(parallel [ + (set (match_operand:SI 0 "s_register_operand" "") + (smax:SI (match_operand:SI 1 "s_register_operand" "") + (match_operand:SI 2 "arm_rhs_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "TARGET_ARM" + " + if (operands[2] == const0_rtx || operands[2] == constm1_rtx) + { + /* No need for a clobber of the condition code register here. */ + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SMAX (SImode, operands[1], + operands[2]))); + DONE; + } +") + +(define_insn "*smax_0" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (smax:SI (match_operand:SI 1 "s_register_operand" "r") + (const_int 0)))] + "TARGET_ARM" + "bic%?\\t%0, %1, %1, asr #31" + [(set_attr "predicable" "yes")] +) + +(define_insn "*smax_m1" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (smax:SI (match_operand:SI 1 "s_register_operand" "r") + (const_int -1)))] + "TARGET_ARM" + "orr%?\\t%0, %1, %1, asr #31" + [(set_attr "predicable" "yes")] +) + +(define_insn "*smax_insn" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (smax:SI (match_operand:SI 1 "s_register_operand" "%0,?r") + (match_operand:SI 2 "arm_rhs_operand" "rI,rI"))) (clobber (reg:CC CC_REGNUM))] "TARGET_ARM" "@ cmp\\t%1, %2\;movlt\\t%0, %2 - cmp\\t%1, %2\;movge\\t%0, %1 cmp\\t%1, %2\;movge\\t%0, %1\;movlt\\t%0, %2" [(set_attr "conds" "clob") - (set_attr "length" "8,8,12")] + (set_attr "length" "8,12")] ) -(define_insn "sminsi3" - [(set (match_operand:SI 0 "s_register_operand" "=r,r,r") - (smin:SI (match_operand:SI 1 "s_register_operand" "0,r,?r") - (match_operand:SI 2 "arm_rhs_operand" "rI,0,rI"))) +(define_expand "sminsi3" + [(parallel [ + (set (match_operand:SI 0 "s_register_operand" "") + (smin:SI (match_operand:SI 1 "s_register_operand" "") + (match_operand:SI 2 "arm_rhs_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "TARGET_ARM" + " + if (operands[2] == const0_rtx) + { + /* No need for a clobber of the condition code register here. */ + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SMIN (SImode, operands[1], + operands[2]))); + DONE; + } +") + +(define_insn "*smin_0" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (smin:SI (match_operand:SI 1 "s_register_operand" "r") + (const_int 0)))] + "TARGET_ARM" + "and%?\\t%0, %1, %1, asr #31" + [(set_attr "predicable" "yes")] +) + +(define_insn "*smin_insn" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (smin:SI (match_operand:SI 1 "s_register_operand" "%0,?r") + (match_operand:SI 2 "arm_rhs_operand" "rI,rI"))) (clobber (reg:CC CC_REGNUM))] "TARGET_ARM" "@ cmp\\t%1, %2\;movge\\t%0, %2 - cmp\\t%1, %2\;movlt\\t%0, %1 cmp\\t%1, %2\;movlt\\t%0, %1\;movge\\t%0, %2" [(set_attr "conds" "clob") - (set_attr "length" "8,8,12")] + (set_attr "length" "8,12")] ) (define_insn "umaxsi3" @@ -2491,8 +2599,8 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_ARM" "* - operands[3] = gen_rtx (minmax_code (operands[3]), SImode, operands[1], - operands[2]); + operands[3] = gen_rtx_fmt_ee (minmax_code (operands[3]), SImode, + operands[1], operands[2]); output_asm_insn (\"cmp\\t%1, %2\", operands); output_asm_insn (\"str%d3\\t%1, %0\", operands); output_asm_insn (\"str%D3\\t%2, %0\", operands); @@ -2513,16 +2621,13 @@ (match_operand:SI 3 "arm_rhs_operand" "rI,rI")]) (match_operand:SI 1 "s_register_operand" "0,?r")])) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM - && (GET_CODE (operands[1]) != REG - || (REGNO(operands[1]) != FRAME_POINTER_REGNUM - && REGNO(operands[1]) != ARG_POINTER_REGNUM))" + "TARGET_ARM && !arm_eliminable_register (operands[1])" "* { enum rtx_code code = GET_CODE (operands[4]); - operands[5] = gen_rtx (minmax_code (operands[5]), SImode, operands[2], - operands[3]); + operands[5] = gen_rtx_fmt_ee (minmax_code (operands[5]), SImode, + operands[2], operands[3]); output_asm_insn (\"cmp\\t%2, %3\", operands); output_asm_insn (\"%i4%d5\\t%0, %1, %2\", operands); if (which_alternative != 0 || operands[3] != const0_rtx @@ -2537,6 +2642,41 @@ ;; Shift and rotation insns +(define_expand "ashldi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashift:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashldi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)) + FAIL; + " +) + +(define_insn "arm_ashldi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashift:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashlsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashift:SI (match_operand:SI 1 "s_register_operand" "") @@ -2561,6 +2701,41 @@ [(set_attr "length" "2")] ) +(define_expand "ashrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_ashrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2582,6 +2757,41 @@ [(set_attr "length" "2")] ) +(define_expand "lshrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_lshrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_lshrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "lshrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (lshiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2652,19 +2862,6 @@ [(set_attr "length" "2")] ) -(define_expand "ashldi3" - [(set (match_operand:DI 0 "s_register_operand" "") - (ashift:DI (match_operand:DI 1 "general_operand" "") - (match_operand:SI 2 "general_operand" "")))] - "TARGET_ARM && (TARGET_IWMMXT || TARGET_CIRRUS)" - " - if (! s_register_operand (operands[1], DImode)) - operands[1] = copy_to_mode_reg (DImode, operands[1]); - if (! s_register_operand (operands[2], SImode)) - operands[2] = copy_to_mode_reg (SImode, operands[2]); - " -) - (define_insn "*arm_shiftsi3" [(set (match_operand:SI 0 "s_register_operand" "=r") (match_operator:SI 3 "shift_operator" @@ -2674,7 +2871,9 @@ "mov%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0" @@ -2689,7 +2888,9 @@ "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0_scratch" @@ -2702,8 +2903,7 @@ "TARGET_ARM" "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") - (set_attr "shift" "1") - ] + (set_attr "shift" "1")] ) (define_insn "*notsi_shiftsi" @@ -2715,7 +2915,9 @@ "mvn%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*notsi_shiftsi_compare0" @@ -2730,7 +2932,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*not_shiftsi_compare0_scratch" @@ -2744,7 +2948,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; We don't really have extzv, but defining this using shifts helps @@ -2841,14 +3047,14 @@ (define_expand "negsf2" [(set (match_operand:SF 0 "s_register_operand" "") (neg:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "" ) (define_expand "negdf2" [(set (match_operand:DF 0 "s_register_operand" "") (neg:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") ;; abssi2 doesn't really clobber the condition codes if a different register @@ -2895,25 +3101,25 @@ (define_expand "abssf2" [(set (match_operand:SF 0 "s_register_operand" "") (abs:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "absdf2" [(set (match_operand:DF 0 "s_register_operand" "") (abs:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "sqrtsf2" [(set (match_operand:SF 0 "s_register_operand" "") (sqrt:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_expand "sqrtdf2" [(set (match_operand:DF 0 "s_register_operand" "") (sqrt:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") (define_insn_and_split "one_cmpldi2" @@ -2984,9 +3190,9 @@ (define_expand "floatsisf2" [(set (match_operand:SF 0 "s_register_operand" "") (float:SF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1])); DONE; @@ -2996,9 +3202,9 @@ (define_expand "floatsidf2" [(set (match_operand:DF 0 "s_register_operand" "") (float:DF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1])); DONE; @@ -3008,9 +3214,9 @@ (define_expand "fix_truncsfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], SImode)) operands[0] = force_reg (SImode, operands[0]); @@ -3024,9 +3230,9 @@ (define_expand "fix_truncdfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[0]); @@ -3041,7 +3247,7 @@ [(set (match_operand:SF 0 "s_register_operand" "") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -3070,7 +3276,7 @@ ldr%?b\\t%Q0, %1\;mov%?\\t%R0, #0" [(set_attr "length" "8") (set_attr "predicable" "yes") - (set_attr "type" "*,load") + (set_attr "type" "*,load_byte") (set_attr "pool_range" "*,4092") (set_attr "neg_pool_range" "*,4084")] ) @@ -3099,72 +3305,38 @@ "TARGET_EITHER" " { - if (TARGET_ARM) + if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM) { - if (arm_arch4 && GET_CODE (operands[1]) == MEM) - { - /* Note: We do not have to worry about TARGET_MMU_TRAPS - here because the insn below will generate an LDRH instruction - rather than an LDR instruction, so we cannot get an unaligned - word access. */ - emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_ZERO_EXTEND (SImode, - operands[1]))); - DONE; - } - if (TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM) - { - emit_insn (gen_movhi_bytes (operands[0], operands[1])); - DONE; - } - if (!s_register_operand (operands[1], HImode)) - operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); + DONE; } - else /* TARGET_THUMB */ + + if (TARGET_ARM && GET_CODE (operands[1]) == MEM) { - if (GET_CODE (operands[1]) == MEM) - { - rtx tmp; - - tmp = gen_rtx_ZERO_EXTEND (SImode, operands[1]); - tmp = gen_rtx_SET (VOIDmode, operands[0], tmp); - emit_insn (tmp); - } - else - { - rtx ops[3]; - - if (!s_register_operand (operands[1], HImode)) - operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); - - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_LSHIFTRT (SImode, ops[1], - ops[2]))); - } - DONE; + emit_insn (gen_movhi_bytes (operands[0], operands[1])); + DONE; } + + if (!s_register_operand (operands[1], HImode)) + operands[1] = copy_to_mode_reg (HImode, operands[1]); + + if (arm_arch6) + { + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_ZERO_EXTEND (SImode, operands[1]))); + DONE; + } + + operands[1] = gen_lowpart (SImode, operands[1]); + operands[2] = gen_reg_rtx (SImode); }" ) (define_insn "*thumb_zero_extendhisi2" - [(set (match_operand:SI 0 "register_operand" "=l") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_THUMB" + [(set (match_operand:SI 0 "register_operand" "=l") + (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_THUMB && !arm_arch6" "* rtx mem = XEXP (operands[1], 0); @@ -3199,49 +3371,89 @@ return \"ldrh\\t%0, %1\"; " [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "60")] ) +(define_insn "*thumb_zero_extendhisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))] + "TARGET_THUMB && arm_arch6" + "* + rtx mem; + + if (which_alternative == 0) + return \"uxth\\t%0, %1\"; + + mem = XEXP (operands[1], 0); + + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + + if (GET_CODE (mem) == LABEL_REF) + return \"ldr\\t%0, %1\"; + + if (GET_CODE (mem) == PLUS) + { + rtx a = XEXP (mem, 0); + rtx b = XEXP (mem, 1); + + /* This can happen due to bugs in reload. */ + if (GET_CODE (a) == REG && REGNO (a) == SP_REGNUM) + { + rtx ops[2]; + ops[0] = operands[0]; + ops[1] = a; + + output_asm_insn (\"mov %0, %1\", ops); + + XEXP (mem, 0) = operands[0]; + } + + else if ( GET_CODE (a) == LABEL_REF + && GET_CODE (b) == CONST_INT) + return \"ldr\\t%0, %1\"; + } + + return \"ldrh\\t%0, %1\"; + " + [(set_attr "length" "2,4") + (set_attr "type" "alu_shift,load_byte") + (set_attr "pool_range" "*,60")] +) + (define_insn "*arm_zero_extendhisi2" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" "ldr%?h\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) -(define_split - [(set (match_operand:SI 0 "s_register_operand" "") - (zero_extend:SI (match_operand:HI 1 "alignable_memory_operand" ""))) - (clobber (match_operand:SI 2 "s_register_operand" ""))] - "TARGET_ARM && (!arm_arch4)" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (lshiftrt:SI (match_dup 2) (const_int 16)))] - " - if ((operands[1] = arm_gen_rotated_half_load (operands[1])) == NULL) - FAIL; - " +(define_insn "*arm_zero_extendhisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + uxth%?\\t%0, %1 + ldr%?h\\t%0, %1" + [(set_attr "type" "alu_shift,load_byte") + (set_attr "predicable" "yes") + (set_attr "pool_range" "*,256") + (set_attr "neg_pool_range" "*,244")] ) -(define_split - [(set (match_operand:SI 0 "s_register_operand" "") - (match_operator:SI 3 "shiftable_operator" - [(zero_extend:SI (match_operand:HI 1 "alignable_memory_operand" "")) - (match_operand:SI 4 "s_register_operand" "")])) - (clobber (match_operand:SI 2 "s_register_operand" ""))] - "TARGET_ARM && (!arm_arch4)" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) - (match_op_dup 3 - [(lshiftrt:SI (match_dup 2) (const_int 16)) (match_dup 4)]))] - " - if ((operands[1] = arm_gen_rotated_half_load (operands[1])) == NULL) - FAIL; - " +(define_insn "*arm_zero_extendhisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (zero_extend:SI (match_operand:HI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "uxtah%?\\t%0, %2, %1" + [(set_attr "type" "alu_shift") + (set_attr "predicable" "yes")] ) (define_expand "zero_extendqisi2" @@ -3249,7 +3461,7 @@ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] "TARGET_EITHER" " - if (GET_CODE (operands[1]) != MEM) + if (!arm_arch6 && GET_CODE (operands[1]) != MEM) { if (TARGET_ARM) { @@ -3285,26 +3497,61 @@ ) (define_insn "*thumb_zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=l") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_THUMB" + [(set (match_operand:SI 0 "register_operand" "=l") + (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_THUMB && !arm_arch6" "ldrb\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "32")] ) +(define_insn "*thumb_zero_extendqisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,m")))] + "TARGET_THUMB && arm_arch6" + "@ + uxtb\\t%0, %1 + ldrb\\t%0, %1" + [(set_attr "length" "2,2") + (set_attr "type" "alu_shift,load_byte") + (set_attr "pool_range" "*,32")] +) + (define_insn "*arm_zero_extendqisi2" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ARM" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_ARM && !arm_arch6" "ldr%?b\\t%0, %1\\t%@ zero_extendqisi2" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] ) +(define_insn "*arm_zero_extendqisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + uxtb%?\\t%0, %1 + ldr%?b\\t%0, %1\\t%@ zero_extendqisi2" + [(set_attr "type" "alu_shift,load_byte") + (set_attr "predicable" "yes") + (set_attr "pool_range" "*,4096") + (set_attr "neg_pool_range" "*,4084")] +) + +(define_insn "*arm_zero_extendqisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (zero_extend:SI (match_operand:QI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "uxtab%?\\t%0, %2, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "alu_shift")] +) + (define_split [(set (match_operand:SI 0 "s_register_operand" "") (zero_extend:SI (subreg:QI (match_operand:SI 1 "" "") 0))) @@ -3315,6 +3562,16 @@ "" ) +(define_split + [(set (match_operand:SI 0 "s_register_operand" "") + (zero_extend:SI (subreg:QI (match_operand:SI 1 "" "") 3))) + (clobber (match_operand:SI 2 "s_register_operand" ""))] + "TARGET_ARM && (GET_CODE (operands[1]) != MEM) && BYTES_BIG_ENDIAN" + [(set (match_dup 2) (match_dup 1)) + (set (match_dup 0) (and:SI (match_dup 2) (const_int 255)))] + "" +) + (define_insn "*compareqi_eq0" [(set (reg:CC_Z CC_REGNUM) (compare:CC_Z (match_operand:QI 0 "s_register_operand" "r") @@ -3334,55 +3591,51 @@ "TARGET_EITHER" " { - if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM) + if (GET_CODE (operands[1]) == MEM) { - /* Note: We do not have to worry about TARGET_MMU_TRAPS - here because the insn below will generate an LDRH instruction - rather than an LDR instruction, so we cannot get an unaligned - word access. */ - emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_SIGN_EXTEND (SImode, operands[1]))); - DONE; + if (TARGET_THUMB) + { + emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1])); + DONE; + } + else if (arm_arch4) + { + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; + } } - if (TARGET_ARM && TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM) + if (TARGET_ARM && GET_CODE (operands[1]) == MEM) { emit_insn (gen_extendhisi2_mem (operands[0], operands[1])); DONE; } + if (!s_register_operand (operands[1], HImode)) operands[1] = copy_to_mode_reg (HImode, operands[1]); - operands[1] = gen_lowpart (SImode, operands[1]); - operands[2] = gen_reg_rtx (SImode); - if (TARGET_THUMB) + if (arm_arch6) { - rtx ops[3]; - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); - - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (16); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFTRT (SImode, ops[1], ops[2]))); - + if (TARGET_THUMB) + emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1])); + else + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; } + + operands[1] = gen_lowpart (SImode, operands[1]); + operands[2] = gen_reg_rtx (SImode); }" ) -(define_insn "*thumb_extendhisi2_insn" - [(set (match_operand:SI 0 "register_operand" "=l") - (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))) - (clobber (match_scratch:SI 2 "=&l"))] - "TARGET_THUMB" +(define_insn "thumb_extendhisi2" + [(set (match_operand:SI 0 "register_operand" "=l") + (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))) + (clobber (match_scratch:SI 2 "=&l"))] + "TARGET_THUMB && !arm_arch6" "* { rtx ops[4]; @@ -3419,12 +3672,8 @@ ops[1] = mem; ops[2] = const0_rtx; } - - if (GET_CODE (ops[1]) != REG) - { - debug_rtx (ops[1]); - abort (); - } + + gcc_assert (GET_CODE (ops[1]) == REG); ops[0] = operands[0]; ops[3] = operands[2]; @@ -3432,10 +3681,79 @@ return \"\"; }" [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "1020")] ) +;; We used to have an early-clobber on the scratch register here. +;; However, there's a bug somewhere in reload which means that this +;; can be partially ignored during spill allocation if the memory +;; address also needs reloading; this causes us to die later on when +;; we try to verify the operands. Fortunately, we don't really need +;; the early-clobber: we can always use operand 0 if operand 2 +;; overlaps the address. +(define_insn "*thumb_extendhisi2_insn_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m"))) + (clobber (match_scratch:SI 2 "=X,l"))] + "TARGET_THUMB && arm_arch6" + "* + { + rtx ops[4]; + rtx mem; + + if (which_alternative == 0) + return \"sxth\\t%0, %1\"; + + mem = XEXP (operands[1], 0); + + /* This code used to try to use 'V', and fix the address only if it was + offsettable, but this fails for e.g. REG+48 because 48 is outside the + range of QImode offsets, and offsettable_address_p does a QImode + address check. */ + + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + + if (GET_CODE (mem) == LABEL_REF) + return \"ldr\\t%0, %1\"; + + if (GET_CODE (mem) == PLUS) + { + rtx a = XEXP (mem, 0); + rtx b = XEXP (mem, 1); + + if (GET_CODE (a) == LABEL_REF + && GET_CODE (b) == CONST_INT) + return \"ldr\\t%0, %1\"; + + if (GET_CODE (b) == REG) + return \"ldrsh\\t%0, %1\"; + + ops[1] = a; + ops[2] = b; + } + else + { + ops[1] = mem; + ops[2] = const0_rtx; + } + + gcc_assert (GET_CODE (ops[1]) == REG); + + ops[0] = operands[0]; + if (reg_mentioned_p (operands[2], ops[1])) + ops[3] = ops[0]; + else + ops[3] = operands[2]; + output_asm_insn (\"mov\\t%3, %2\;ldrsh\\t%0, [%1, %3]\", ops); + return \"\"; + }" + [(set_attr "length" "2,4") + (set_attr "type" "alu_shift,load_byte") + (set_attr "pool_range" "*,1020")] +) + (define_expand "extendhisi2_mem" [(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" ""))) (set (match_dup 3) @@ -3449,10 +3767,8 @@ rtx mem1, mem2; rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0)); - mem1 = gen_rtx_MEM (QImode, addr); - MEM_COPY_ATTRIBUTES (mem1, operands[1]); - mem2 = gen_rtx_MEM (QImode, plus_constant (addr, 1)); - MEM_COPY_ATTRIBUTES (mem2, operands[1]); + mem1 = change_address (operands[1], QImode, addr); + mem2 = change_address (operands[1], QImode, plus_constant (addr, 1)); operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = mem1; operands[2] = gen_reg_rtx (SImode); @@ -3473,44 +3789,36 @@ }" ) -(define_insn "*arm_extendhisi_insn" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" +(define_insn "*arm_extendhisi2" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" "ldr%?sh\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) -(define_split - [(set (match_operand:SI 0 "s_register_operand" "") - (sign_extend:SI (match_operand:HI 1 "alignable_memory_operand" ""))) - (clobber (match_operand:SI 2 "s_register_operand" ""))] - "TARGET_ARM && (!arm_arch4)" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (ashiftrt:SI (match_dup 2) (const_int 16)))] - " - if ((operands[1] = arm_gen_rotated_half_load (operands[1])) == NULL) - FAIL; - " +(define_insn "*arm_extendhisi2_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] + "TARGET_ARM && arm_arch6" + "@ + sxth%?\\t%0, %1 + ldr%?sh\\t%0, %1" + [(set_attr "type" "alu_shift,load_byte") + (set_attr "predicable" "yes") + (set_attr "pool_range" "*,256") + (set_attr "neg_pool_range" "*,244")] ) -(define_split - [(set (match_operand:SI 0 "s_register_operand" "") - (match_operator:SI 3 "shiftable_operator" - [(sign_extend:SI (match_operand:HI 1 "alignable_memory_operand" "")) - (match_operand:SI 4 "s_register_operand" "")])) - (clobber (match_operand:SI 2 "s_register_operand" ""))] - "TARGET_ARM && (!arm_arch4)" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) - (match_op_dup 3 - [(ashiftrt:SI (match_dup 2) (const_int 16)) (match_dup 4)]))] - "if ((operands[1] = arm_gen_rotated_half_load (operands[1])) == NULL) - FAIL; - " +(define_insn "*arm_extendhisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (sign_extend:SI (match_operand:HI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "sxtah%?\\t%0, %2, %1" ) (define_expand "extendqihi2" @@ -3538,59 +3846,17 @@ }" ) -; Rather than restricting all byte accesses to memory addresses that ldrsb -; can handle, we fix up the ones that ldrsb can't grok with a split. (define_insn "*extendqihi_insn" - [(set (match_operand:HI 0 "s_register_operand" "=r") - (sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))] + [(set (match_operand:HI 0 "s_register_operand" "=r") + (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))] "TARGET_ARM && arm_arch4" - "* - /* If the address is invalid, this will split the instruction into two. */ - if (bad_signed_byte_operand (operands[1], VOIDmode)) - return \"#\"; - return \"ldr%?sb\\t%0, %1\"; - " - [(set_attr "type" "load") + "ldr%?sb\\t%0, %1" + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") - (set_attr "length" "8") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) -(define_split - [(set (match_operand:HI 0 "s_register_operand" "") - (sign_extend:HI (match_operand:QI 1 "bad_signed_byte_operand" "")))] - "TARGET_ARM && arm_arch4 && reload_completed" - [(set (match_dup 3) (match_dup 1)) - (set (match_dup 0) (sign_extend:HI (match_dup 2)))] - " - { - HOST_WIDE_INT offset; - - operands[3] = gen_rtx_REG (SImode, REGNO (operands[0])); - operands[2] = gen_rtx_MEM (QImode, operands[3]); - MEM_COPY_ATTRIBUTES (operands[2], operands[1]); - operands[1] = XEXP (operands[1], 0); - if (GET_CODE (operands[1]) == PLUS - && GET_CODE (XEXP (operands[1], 1)) == CONST_INT - && !(const_ok_for_arm (offset = INTVAL (XEXP (operands[1], 1))) - || const_ok_for_arm (-offset))) - { - HOST_WIDE_INT low = (offset > 0 - ? (offset & 0xff) : -((-offset) & 0xff)); - XEXP (operands[2], 0) = plus_constant (operands[3], low); - operands[1] = plus_constant (XEXP (operands[1], 0), offset - low); - } - /* Ensure the sum is in correct canonical form. */ - else if (GET_CODE (operands[1]) == PLUS - && GET_CODE (XEXP (operands[1], 1)) != CONST_INT - && !s_register_operand (XEXP (operands[1], 1), VOIDmode)) - operands[1] = gen_rtx_PLUS (GET_MODE (operands[1]), - XEXP (operands[1], 1), - XEXP (operands[1], 0)); - }" -) - (define_expand "extendqisi2" [(set (match_dup 2) (ashift:SI (match_operand:QI 1 "general_operand" "") @@ -3601,97 +3867,66 @@ "TARGET_EITHER" " { - if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM) + if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM) { - emit_insn (gen_rtx_SET (VOIDmode, - operands[0], + emit_insn (gen_rtx_SET (VOIDmode, operands[0], gen_rtx_SIGN_EXTEND (SImode, operands[1]))); DONE; } + if (!s_register_operand (operands[1], QImode)) operands[1] = copy_to_mode_reg (QImode, operands[1]); + + if (arm_arch6) + { + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_SIGN_EXTEND (SImode, operands[1]))); + DONE; + } + operands[1] = gen_lowpart (SImode, operands[1]); operands[2] = gen_reg_rtx (SImode); - - if (TARGET_THUMB) - { - rtx ops[3]; - - ops[0] = operands[2]; - ops[1] = operands[1]; - ops[2] = GEN_INT (24); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFT (SImode, ops[1], ops[2]))); - - ops[0] = operands[0]; - ops[1] = operands[2]; - ops[2] = GEN_INT (24); - - emit_insn (gen_rtx_SET (VOIDmode, ops[0], - gen_rtx_ASHIFTRT (SImode, ops[1], ops[2]))); - - DONE; - } }" ) -; Rather than restricting all byte accesses to memory addresses that ldrsb -; can handle, we fix up the ones that ldrsb can't grok with a split. -(define_insn "*arm_extendqisi_insn" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ARM && arm_arch4" - "* - /* If the address is invalid, this will split the instruction into two. */ - if (bad_signed_byte_operand (operands[1], VOIDmode)) - return \"#\"; - return \"ldr%?sb\\t%0, %1\"; - " - [(set_attr "type" "load") +(define_insn "*arm_extendqisi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))] + "TARGET_ARM && arm_arch4 && !arm_arch6" + "ldr%?sb\\t%0, %1" + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") - (set_attr "length" "8") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] ) -(define_split - [(set (match_operand:SI 0 "s_register_operand" "") - (sign_extend:SI (match_operand:QI 1 "bad_signed_byte_operand" "")))] - "TARGET_ARM && arm_arch4 && reload_completed" - [(set (match_dup 0) (match_dup 1)) - (set (match_dup 0) (sign_extend:SI (match_dup 2)))] - " - { - HOST_WIDE_INT offset; - - operands[2] = gen_rtx_MEM (QImode, operands[0]); - MEM_COPY_ATTRIBUTES (operands[2], operands[1]); - operands[1] = XEXP (operands[1], 0); - if (GET_CODE (operands[1]) == PLUS - && GET_CODE (XEXP (operands[1], 1)) == CONST_INT - && !(const_ok_for_arm (offset = INTVAL (XEXP (operands[1], 1))) - || const_ok_for_arm (-offset))) - { - HOST_WIDE_INT low = (offset > 0 - ? (offset & 0xff) : -((-offset) & 0xff)); - XEXP (operands[2], 0) = plus_constant (operands[0], low); - operands[1] = plus_constant (XEXP (operands[1], 0), offset - low); - } - /* Ensure the sum is in correct canonical form. */ - else if (GET_CODE (operands[1]) == PLUS - && GET_CODE (XEXP (operands[1], 1)) != CONST_INT - && !s_register_operand (XEXP (operands[1], 1), VOIDmode)) - operands[1] = gen_rtx_PLUS (GET_MODE (operands[1]), - XEXP (operands[1], 1), - XEXP (operands[1], 0)); - }" +(define_insn "*arm_extendqisi_v6" + [(set (match_operand:SI 0 "s_register_operand" "=r,r") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))] + "TARGET_ARM && arm_arch6" + "@ + sxtb%?\\t%0, %1 + ldr%?sb\\t%0, %1" + [(set_attr "type" "alu_shift,load_byte") + (set_attr "predicable" "yes") + (set_attr "pool_range" "*,256") + (set_attr "neg_pool_range" "*,244")] ) -(define_insn "*thumb_extendqisi2_insn" - [(set (match_operand:SI 0 "register_operand" "=l,l") - (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))] - "TARGET_THUMB" +(define_insn "*arm_extendqisi2addsi" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (plus:SI (sign_extend:SI (match_operand:QI 1 "s_register_operand" "r")) + (match_operand:SI 2 "s_register_operand" "r")))] + "TARGET_ARM && arm_arch6" + "sxtab%?\\t%0, %2, %1" + [(set_attr "type" "alu_shift") + (set_attr "predicable" "yes")] +) + +(define_insn "*thumb_extendqisi2" + [(set (match_operand:SI 0 "register_operand" "=l,l") + (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))] + "TARGET_THUMB && !arm_arch6" "* { rtx ops[3]; @@ -3733,10 +3968,9 @@ else output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); } - else if (GET_CODE (b) != REG) - abort (); else { + gcc_assert (GET_CODE (b) == REG); if (REGNO (b) == REGNO (ops[0])) { output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops); @@ -3763,14 +3997,94 @@ return \"\"; }" [(set_attr "length" "2,6") - (set_attr "type" "load,load") + (set_attr "type" "load_byte,load_byte") (set_attr "pool_range" "32,32")] ) +(define_insn "*thumb_extendqisi2_v6" + [(set (match_operand:SI 0 "register_operand" "=l,l,l") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,V,m")))] + "TARGET_THUMB && arm_arch6" + "* + { + rtx ops[3]; + rtx mem; + + if (which_alternative == 0) + return \"sxtb\\t%0, %1\"; + + mem = XEXP (operands[1], 0); + + if (GET_CODE (mem) == CONST) + mem = XEXP (mem, 0); + + if (GET_CODE (mem) == LABEL_REF) + return \"ldr\\t%0, %1\"; + + if (GET_CODE (mem) == PLUS + && GET_CODE (XEXP (mem, 0)) == LABEL_REF) + return \"ldr\\t%0, %1\"; + + if (which_alternative == 0) + return \"ldrsb\\t%0, %1\"; + + ops[0] = operands[0]; + + if (GET_CODE (mem) == PLUS) + { + rtx a = XEXP (mem, 0); + rtx b = XEXP (mem, 1); + + ops[1] = a; + ops[2] = b; + + if (GET_CODE (a) == REG) + { + if (GET_CODE (b) == REG) + output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops); + else if (REGNO (a) == REGNO (ops[0])) + { + output_asm_insn (\"ldrb\\t%0, [%1, %2]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + else + { + gcc_assert (GET_CODE (b) == REG); + if (REGNO (b) == REGNO (ops[0])) + { + output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + } + else if (GET_CODE (mem) == REG && REGNO (ops[0]) == REGNO (mem)) + { + output_asm_insn (\"ldrb\\t%0, [%0, #0]\", ops); + output_asm_insn (\"sxtb\\t%0, %0\", ops); + } + else + { + ops[1] = mem; + ops[2] = const0_rtx; + + output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); + } + return \"\"; + }" + [(set_attr "length" "2,2,4") + (set_attr "type" "alu_shift,load_byte,load_byte") + (set_attr "pool_range" "*,32,32")] +) + (define_expand "extendsfdf2" [(set (match_operand:DF 0 "s_register_operand" "") (float_extend:DF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -3840,28 +4154,128 @@ (match_operand:DI 1 "general_operand" ""))] "TARGET_EITHER" " - if (TARGET_THUMB) + if (!no_new_pseudos) { - if (!no_new_pseudos) - { - if (GET_CODE (operands[0]) != REG) - operands[1] = force_reg (DImode, operands[1]); - } + if (GET_CODE (operands[0]) != REG) + operands[1] = force_reg (DImode, operands[1]); } " ) (define_insn "*arm_movdi" - [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>") - (match_operand:DI 1 "di_operand" "rIK,mi,r"))] - "TARGET_ARM && !TARGET_CIRRUS && ! TARGET_IWMMXT" + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m") + (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,r"))] + "TARGET_ARM + && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP)) + && !TARGET_IWMMXT + && ( register_operand (operands[0], DImode) + || register_operand (operands[1], DImode))" "* - return (output_move_double (operands)); + switch (which_alternative) + { + case 0: + case 1: + case 2: + return \"#\"; + default: + return output_move_double (operands); + } + " + [(set_attr "length" "8,12,16,8,8") + (set_attr "type" "*,*,*,load2,store2") + (set_attr "pool_range" "*,*,*,1020,*") + (set_attr "neg_pool_range" "*,*,*,1008,*")] +) + +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "const_double_operand" ""))] + "TARGET_ARM + && reload_completed + && (arm_const_double_inline_cost (operands[1]) + <= ((optimize_size || arm_ld_sched) ? 3 : 4))" + [(const_int 0)] + " + arm_split_constant (SET, SImode, curr_insn, + INTVAL (gen_lowpart (SImode, operands[1])), + gen_lowpart (SImode, operands[0]), NULL_RTX, 0); + arm_split_constant (SET, SImode, curr_insn, + INTVAL (gen_highpart_mode (SImode, + GET_MODE (operands[0]), + operands[1])), + gen_highpart (SImode, operands[0]), NULL_RTX, 0); + DONE; + " +) + +; If optimizing for size, or if we have load delay slots, then +; we want to split the constant into two separate operations. +; In both cases this may split a trivial part into a single data op +; leaving a single complex constant to load. We can also get longer +; offsets in a LDR which means we get better chances of sharing the pool +; entries. Finally, we can normally do a better job of scheduling +; LDR instructions than we can with LDM. +; This pattern will only match if the one above did not. +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "const_double_operand" ""))] + "TARGET_ARM && reload_completed + && arm_const_double_by_parts (operands[1])" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 2) (match_dup 3))] + " + operands[2] = gen_highpart (SImode, operands[0]); + operands[3] = gen_highpart_mode (SImode, GET_MODE (operands[0]), + operands[1]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[1] = gen_lowpart (SImode, operands[1]); + " +) + +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "arm_general_register_operand" ""))] + "TARGET_EITHER && reload_completed" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 2) (match_dup 3))] + " + operands[2] = gen_highpart (SImode, operands[0]); + operands[3] = gen_highpart (SImode, operands[1]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[1] = gen_lowpart (SImode, operands[1]); + + /* Handle a partial overlap. */ + if (rtx_equal_p (operands[0], operands[3])) + { + rtx tmp0 = operands[0]; + rtx tmp1 = operands[1]; + + operands[0] = operands[2]; + operands[1] = operands[3]; + operands[2] = tmp0; + operands[3] = tmp1; + } + " +) + +;; We can't actually do base+index doubleword loads if the index and +;; destination overlap. Split here so that we at least have chance to +;; schedule. +(define_split + [(set (match_operand:DI 0 "s_register_operand" "") + (mem:DI (plus:SI (match_operand:SI 1 "s_register_operand" "") + (match_operand:SI 2 "s_register_operand" ""))))] + "TARGET_LDRD + && reg_overlap_mentioned_p (operands[0], operands[1]) + && reg_overlap_mentioned_p (operands[0], operands[2])" + [(set (match_dup 4) + (plus:SI (match_dup 1) + (match_dup 2))) + (set (match_dup 0) + (mem:DI (match_dup 4)))] + " + operands[4] = gen_rtx_REG (SImode, REGNO(operands[0])); " - [(set_attr "length" "8") - (set_attr "type" "*,load,store2") - (set_attr "pool_range" "*,1020,*") - (set_attr "neg_pool_range" "*,1008,*")] ) ;;; ??? This should have alternatives for constants. @@ -3872,7 +4286,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r") (match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))] "TARGET_THUMB - && !TARGET_CIRRUS + && !(TARGET_HARD_FLOAT && TARGET_MAVERICK) && ( register_operand (operands[0], DImode) || register_operand (operands[1], DImode))" "* @@ -3896,7 +4310,7 @@ case 5: return thumb_load_double_from_address (operands); case 6: - operands[2] = gen_rtx (MEM, SImode, + operands[2] = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), 4)); output_asm_insn (\"str\\t%1, %0\;str\\t%H1, %2\", operands); return \"\"; @@ -3907,7 +4321,7 @@ } }" [(set_attr "length" "4,4,6,2,2,6,4,4") - (set_attr "type" "*,*,*,load,store2,load,store2,*") + (set_attr "type" "*,*,*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,*,*,1020,*,*")] ) @@ -3921,14 +4335,14 @@ /* Everything except mem = const or mem = mem can be done easily. */ if (GET_CODE (operands[0]) == MEM) operands[1] = force_reg (SImode, operands[1]); - if (GET_CODE (operands[1]) == CONST_INT + if (arm_general_register_operand (operands[0], SImode) + && GET_CODE (operands[1]) == CONST_INT && !(const_ok_for_arm (INTVAL (operands[1])) || const_ok_for_arm (~INTVAL (operands[1])))) { - arm_split_constant (SET, SImode, INTVAL (operands[1]), operands[0], - NULL_RTX, - (no_new_pseudos ? 0 - : preserve_subexpressions_p ())); + arm_split_constant (SET, SImode, NULL_RTX, + INTVAL (operands[1]), operands[0], NULL_RTX, + optimize && !no_new_pseudos); DONE; } } @@ -3940,13 +4354,37 @@ operands[1] = force_reg (SImode, operands[1]); } } - - if (flag_pic - && (CONSTANT_P (operands[1]) - || symbol_mentioned_p (operands[1]) - || label_mentioned_p (operands[1]))) - operands[1] = legitimize_pic_address (operands[1], SImode, - (no_new_pseudos ? operands[0] : 0)); + + /* Recognize the case where operand[1] is a reference to thread-local + data and load its address to a register. */ + if (arm_tls_referenced_p (operands[1])) + { + rtx tmp = operands[1]; + rtx addend = NULL; + + if (GET_CODE (tmp) == CONST && GET_CODE (XEXP (tmp, 0)) == PLUS) + { + addend = XEXP (XEXP (tmp, 0), 1); + tmp = XEXP (XEXP (tmp, 0), 0); + } + + gcc_assert (GET_CODE (tmp) == SYMBOL_REF); + gcc_assert (SYMBOL_REF_TLS_MODEL (tmp) != 0); + + tmp = legitimize_tls_address (tmp, no_new_pseudos ? operands[0] : 0); + if (addend) + { + tmp = gen_rtx_PLUS (SImode, tmp, addend); + tmp = force_operand (tmp, operands[0]); + } + operands[1] = tmp; + } + else if (flag_pic + && (CONSTANT_P (operands[1]) + || symbol_mentioned_p (operands[1]) + || label_mentioned_p (operands[1]))) + operands[1] = legitimize_pic_address (operands[1], SImode, + (no_new_pseudos ? operands[0] : 0)); " ) @@ -3954,6 +4392,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m") (match_operand:SI 1 "general_operand" "rI,K,mi,r"))] "TARGET_ARM && ! TARGET_IWMMXT + && !(TARGET_HARD_FLOAT && TARGET_VFP) && ( register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" "@ @@ -3961,22 +4400,22 @@ mvn%?\\t%0, #%B1 ldr%?\\t%0, %1 str%?\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,4096,*") (set_attr "neg_pool_range" "*,*,4084,*")] ) (define_split - [(set (match_operand:SI 0 "s_register_operand" "") + [(set (match_operand:SI 0 "arm_general_register_operand" "") (match_operand:SI 1 "const_int_operand" ""))] "TARGET_ARM && (!(const_ok_for_arm (INTVAL (operands[1])) || const_ok_for_arm (~INTVAL (operands[1]))))" [(clobber (const_int 0))] " - arm_split_constant (SET, SImode, INTVAL (operands[1]), operands[0], - NULL_RTX, 0); + arm_split_constant (SET, SImode, NULL_RTX, + INTVAL (operands[1]), operands[0], NULL_RTX, 0); DONE; " ) @@ -3998,14 +4437,14 @@ str\\t%1, %0 mov\\t%0, %1" [(set_attr "length" "2,2,4,4,2,2,2,2,2") - (set_attr "type" "*,*,*,*,load,store1,load,store1,*") + (set_attr "type" "*,*,*,*,load1,store1,load1,store1,*") (set_attr "pool_range" "*,*,*,*,*,*,1020,*,*")] ) (define_split [(set (match_operand:SI 0 "register_operand" "") (match_operand:SI 1 "const_int_operand" ""))] - "TARGET_THUMB && CONST_OK_FOR_THUMB_LETTER (INTVAL (operands[1]), 'J')" + "TARGET_THUMB && satisfies_constraint_J (operands[1])" [(set (match_dup 0) (match_dup 1)) (set (match_dup 0) (neg:SI (match_dup 0)))] "operands[1] = GEN_INT (- INTVAL (operands[1]));" @@ -4014,7 +4453,7 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (match_operand:SI 1 "const_int_operand" ""))] - "TARGET_THUMB && CONST_OK_FOR_THUMB_LETTER (INTVAL (operands[1]), 'K')" + "TARGET_THUMB && satisfies_constraint_K (operands[1])" [(set (match_dup 0) (match_dup 1)) (set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2)))] " @@ -4050,7 +4489,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_ARM && flag_pic" "ldr%?\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 4096)) (set (attr "neg_pool_range") (const_int 4084))] ) @@ -4060,7 +4499,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_THUMB && flag_pic" "ldr\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 1024))] ) @@ -4070,7 +4509,7 @@ [(set (match_operand:SI 0 "s_register_operand" "") (unspec:SI [(match_operand 1 "" "") (match_dup 2)] UNSPEC_PIC_SYM))] "TARGET_ARM && flag_pic" - "operands[2] = pic_offset_table_rtx;" + "operands[2] = cfun->machine->pic_reg;" ) (define_insn "*pic_load_addr_based_insn" @@ -4078,7 +4517,7 @@ (unspec:SI [(match_operand 1 "" "") (match_operand 2 "s_register_operand" "r")] UNSPEC_PIC_SYM))] - "TARGET_EITHER && flag_pic && operands[2] == pic_offset_table_rtx" + "TARGET_EITHER && flag_pic && operands[2] == cfun->machine->pic_reg" "* #ifdef AOF_ASSEMBLER operands[1] = aof_pic_entry (operands[1]); @@ -4086,7 +4525,7 @@ output_asm_insn (\"ldr%?\\t%0, %a1\", operands); return \"\"; " - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (if_then_else (eq_attr "is_thumb" "yes") (const_int 1024) @@ -4098,41 +4537,79 @@ ) (define_insn "pic_add_dot_plus_four" - [(set (match_operand:SI 0 "register_operand" "+r") - (unspec:SI [(plus:SI (match_dup 0) + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "0") (const (plus:SI (pc) (const_int 4))))] UNSPEC_PIC_BASE)) - (use (label_ref (match_operand 1 "" "")))] - "TARGET_THUMB && flag_pic" + (use (match_operand 2 "" ""))] + "TARGET_THUMB" "* - (*targetm.asm_out.internal_label) (asm_out_file, \"L\", - CODE_LABEL_NUMBER (operands[1])); + (*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\", + INTVAL (operands[2])); return \"add\\t%0, %|pc\"; " [(set_attr "length" "2")] ) (define_insn "pic_add_dot_plus_eight" - [(set (match_operand:SI 0 "register_operand" "+r") - (unspec:SI [(plus:SI (match_dup 0) + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "r") (const (plus:SI (pc) (const_int 8))))] UNSPEC_PIC_BASE)) - (use (label_ref (match_operand 1 "" "")))] - "TARGET_ARM && flag_pic" + (use (match_operand 2 "" ""))] + "TARGET_ARM" "* - (*targetm.asm_out.internal_label) (asm_out_file, \"L\", - CODE_LABEL_NUMBER (operands[1])); - return \"add%?\\t%0, %|pc, %0\"; + (*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\", + INTVAL (operands[2])); + return \"add%?\\t%0, %|pc, %1\"; " [(set_attr "predicable" "yes")] ) +(define_insn "tls_load_dot_plus_eight" + [(set (match_operand:SI 0 "register_operand" "+r") + (mem:SI (unspec:SI [(plus:SI (match_operand:SI 1 "register_operand" "r") + (const (plus:SI (pc) (const_int 8))))] + UNSPEC_PIC_BASE))) + (use (match_operand 2 "" ""))] + "TARGET_ARM" + "* + (*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\", + INTVAL (operands[2])); + return \"ldr%?\\t%0, [%|pc, %1]\t\t@ tls_load_dot_plus_eight\"; + " + [(set_attr "predicable" "yes")] +) + +;; PIC references to local variables can generate pic_add_dot_plus_eight +;; followed by a load. These sequences can be crunched down to +;; tls_load_dot_plus_eight by a peephole. + +(define_peephole2 + [(parallel [(set (match_operand:SI 0 "register_operand" "") + (unspec:SI [(plus:SI (match_operand:SI 3 "register_operand" "") + (const (plus:SI (pc) (const_int 8))))] + UNSPEC_PIC_BASE)) + (use (label_ref (match_operand 1 "" "")))]) + (set (match_operand:SI 2 "register_operand" "") (mem:SI (match_dup 0)))] + "TARGET_ARM && peep2_reg_dead_p (2, operands[0])" + [(parallel [(set (match_dup 2) + (mem:SI (unspec:SI [(plus:SI (match_dup 3) + (const (plus:SI (pc) (const_int 8))))] + UNSPEC_PIC_BASE))) + (use (label_ref (match_dup 1)))])] + "" +) + (define_expand "builtin_setjmp_receiver" [(label_ref (match_operand 0 "" ""))] "flag_pic" " { - arm_finalize_pic (0); + /* r3 is clobbered by set/longjmp, so we can use it as a scratch + register. */ + if (arm_pic_register != INVALID_REGNUM) + arm_load_pic_register (1UL << 3); DONE; }") @@ -4323,7 +4800,7 @@ emit_insn (gen_movsi (reg, GEN_INT (val))); operands[1] = gen_lowpart (HImode, reg); } - else if (arm_arch4 && !no_new_pseudos && optimize > 0 + else if (arm_arch4 && optimize && !no_new_pseudos && GET_CODE (operands[1]) == MEM) { rtx reg = gen_reg_rtx (SImode); @@ -4333,89 +4810,39 @@ } else if (!arm_arch4) { - /* Note: We do not have to worry about TARGET_MMU_TRAPS - for v4 and up architectures because LDRH instructions will - be used to access the HI values, and these cannot generate - unaligned word access faults in the MMU. */ if (GET_CODE (operands[1]) == MEM) { - if (TARGET_MMU_TRAPS) + rtx base; + rtx offset = const0_rtx; + rtx reg = gen_reg_rtx (SImode); + + if ((GET_CODE (base = XEXP (operands[1], 0)) == REG + || (GET_CODE (base) == PLUS + && (GET_CODE (offset = XEXP (base, 1)) + == CONST_INT) + && ((INTVAL(offset) & 1) != 1) + && GET_CODE (base = XEXP (base, 0)) == REG)) + && REGNO_POINTER_ALIGN (REGNO (base)) >= 32) { - rtx base; - rtx offset = const0_rtx; - rtx reg = gen_reg_rtx (SImode); + rtx new; - if ((GET_CODE (base = XEXP (operands[1], 0)) == REG - || (GET_CODE (base) == PLUS - && (GET_CODE (offset = XEXP (base, 1)) - == CONST_INT) - && ((INTVAL(offset) & 1) != 1) - && GET_CODE (base = XEXP (base, 0)) == REG)) - && REGNO_POINTER_ALIGN (REGNO (base)) >= 32) - { - HOST_WIDE_INT new_offset = INTVAL (offset) & ~3; - rtx new; + new = widen_memory_access (operands[1], SImode, + ((INTVAL (offset) & ~3) + - INTVAL (offset))); + emit_insn (gen_movsi (reg, new)); + if (((INTVAL (offset) & 2) != 0) + ^ (BYTES_BIG_ENDIAN ? 1 : 0)) + { + rtx reg2 = gen_reg_rtx (SImode); - new = gen_rtx_MEM (SImode, - plus_constant (base, new_offset)); - MEM_COPY_ATTRIBUTES (new, operands[1]); - emit_insn (gen_movsi (reg, new)); - if (((INTVAL (offset) & 2) != 0) - ^ (BYTES_BIG_ENDIAN ? 1 : 0)) - { - rtx reg2 = gen_reg_rtx (SImode); - - emit_insn (gen_lshrsi3 (reg2, reg, - GEN_INT (16))); - reg = reg2; - } - } - else - emit_insn (gen_movhi_bytes (reg, operands[1])); - - operands[1] = gen_lowpart (HImode, reg); + emit_insn (gen_lshrsi3 (reg2, reg, GEN_INT (16))); + reg = reg2; + } } - else if (BYTES_BIG_ENDIAN) - { - rtx base; - rtx offset = const0_rtx; + else + emit_insn (gen_movhi_bytes (reg, operands[1])); - if ((GET_CODE (base = XEXP (operands[1], 0)) == REG - || (GET_CODE (base) == PLUS - && (GET_CODE (offset = XEXP (base, 1)) - == CONST_INT) - && GET_CODE (base = XEXP (base, 0)) == REG)) - && REGNO_POINTER_ALIGN (REGNO (base)) >= 32) - { - rtx reg = gen_reg_rtx (SImode); - rtx new; - - if ((INTVAL (offset) & 2) == 2) - { - HOST_WIDE_INT new_offset = INTVAL (offset) ^ 2; - new = gen_rtx_MEM (SImode, - plus_constant (base, - new_offset)); - MEM_COPY_ATTRIBUTES (new, operands[1]); - emit_insn (gen_movsi (reg, new)); - } - else - { - new = gen_rtx_MEM (SImode, - XEXP (operands[1], 0)); - MEM_COPY_ATTRIBUTES (new, operands[1]); - emit_insn (gen_rotated_loadsi (reg, new)); - } - - operands[1] = gen_lowpart (HImode, reg); - } - else - { - emit_insn (gen_movhi_bigend (operands[0], - operands[1])); - DONE; - } - } + operands[1] = gen_lowpart (HImode, reg); } } } @@ -4426,8 +4853,7 @@ { /* Writing a constant to memory needs a scratch, which should be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); emit_insn (gen_movsi (operands[0], operands[1])); @@ -4438,8 +4864,13 @@ { if (!no_new_pseudos) { - if (GET_CODE (operands[0]) != REG) - operands[1] = force_reg (HImode, operands[1]); + if (GET_CODE (operands[1]) == CONST_INT) + { + rtx reg = gen_reg_rtx (SImode); + + emit_insn (gen_movsi (reg, operands[1])); + operands[1] = gen_lowpart (HImode, reg); + } /* ??? We shouldn't really get invalid addresses here, but this can happen if we are passed a SP (never OK for HImode/QImode) or @@ -4462,17 +4893,28 @@ operands[1] = replace_equiv_address (operands[1], copy_to_reg (XEXP (operands[1], 0))); + + if (GET_CODE (operands[1]) == MEM && optimize > 0) + { + rtx reg = gen_reg_rtx (SImode); + + emit_insn (gen_zero_extendhisi2 (reg, operands[1])); + operands[1] = gen_lowpart (HImode, reg); + } + + if (GET_CODE (operands[0]) == MEM) + operands[1] = force_reg (HImode, operands[1]); } - /* Handle loading a large integer during reload. */ else if (GET_CODE (operands[1]) == CONST_INT - && !CONST_OK_FOR_THUMB_LETTER (INTVAL (operands[1]), 'I')) + && !satisfies_constraint_I (operands[1])) { + /* Handle loading a large integer during reload. */ + /* Writing a constant to memory needs a scratch, which should be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); - operands[0] = gen_rtx (SUBREG, SImode, operands[0], 0); + operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); emit_insn (gen_movsi (operands[0], operands[1])); DONE; } @@ -4494,7 +4936,7 @@ case 3: return \"mov %0, %1\"; case 4: return \"mov %0, %1\"; case 5: return \"mov %0, %1\"; - default: abort (); + default: gcc_unreachable (); case 1: /* The stack pointer can end up being taken as an index register. Catch this case here and deal with it. */ @@ -4514,28 +4956,10 @@ return \"ldrh %0, %1\"; }" [(set_attr "length" "2,4,2,2,2,2") - (set_attr "type" "*,load,store1,*,*,*")] + (set_attr "type" "*,load1,store1,*,*,*")] ) -(define_insn "rotated_loadsi" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (rotate:SI (match_operand:SI 1 "offsettable_memory_operand" "o") - (const_int 16)))] - "TARGET_ARM && (!TARGET_MMU_TRAPS)" - "* - { - rtx ops[2]; - - ops[0] = operands[0]; - ops[1] = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[1], 0), 2)); - output_asm_insn (\"ldr%?\\t%0, %1\\t%@ load-rotate\", ops); - return \"\"; - }" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - (define_expand "movhi_bytes" [(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" ""))) (set (match_dup 3) @@ -4548,10 +4972,8 @@ rtx mem1, mem2; rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0)); - mem1 = gen_rtx_MEM (QImode, addr); - MEM_COPY_ATTRIBUTES (mem1, operands[1]); - mem2 = gen_rtx_MEM (QImode, plus_constant (addr, 1)); - MEM_COPY_ATTRIBUTES (mem2, operands[1]); + mem1 = change_address (operands[1], QImode, addr); + mem2 = change_address (operands[1], QImode, plus_constant (addr, 1)); operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = mem1; operands[2] = gen_reg_rtx (SImode); @@ -4599,86 +5021,39 @@ "@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi - str%?h\\t%1, %0\\t%@ movhi + str%?h\\t%1, %0\\t%@ movhi ldr%?h\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,store1,load") + [(set_attr "type" "*,*,store1,load1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,*,256") (set_attr "neg_pool_range" "*,*,*,244")] ) -(define_insn "*movhi_insn_littleend" - [(set (match_operand:HI 0 "s_register_operand" "=r,r,r") - (match_operand:HI 1 "general_operand" "rI,K,m"))] - "TARGET_ARM - && !arm_arch4 - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && (GET_CODE (operands[1]) != CONST_INT - || const_ok_for_arm (INTVAL (operands[1])) - || const_ok_for_arm (~INTVAL (operands[1])))" - "@ - mov%?\\t%0, %1\\t%@ movhi - mvn%?\\t%0, #%B1\\t%@ movhi - ldr%?\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,load") - (set_attr "predicable" "yes") - (set_attr "pool_range" "4096") - (set_attr "neg_pool_range" "4084")] -) - -(define_insn "*movhi_insn_bigend" - [(set (match_operand:HI 0 "s_register_operand" "=r,r,r") - (match_operand:HI 1 "general_operand" "rI,K,m"))] - "TARGET_ARM - && !arm_arch4 - && BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && (GET_CODE (operands[1]) != CONST_INT - || const_ok_for_arm (INTVAL (operands[1])) - || const_ok_for_arm (~INTVAL (operands[1])))" - "@ - mov%?\\t%0, %1\\t%@ movhi - mvn%?\\t%0, #%B1\\t%@ movhi - ldr%?\\t%0, %1\\t%@ movhi_bigend\;mov%?\\t%0, %0, asr #16" - [(set_attr "type" "*,*,load") - (set_attr "predicable" "yes") - (set_attr "length" "4,4,8") - (set_attr "pool_range" "*,*,4092") - (set_attr "neg_pool_range" "*,*,4084")] -) - -(define_insn "*loadhi_si_bigend" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (rotate:SI (subreg:SI (match_operand:HI 1 "memory_operand" "m") 0) - (const_int 16)))] - "TARGET_ARM - && BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS" - "ldr%?\\t%0, %1\\t%@ movhi_bigend" - [(set_attr "type" "load") - (set_attr "predicable" "yes") - (set_attr "pool_range" "4096") - (set_attr "neg_pool_range" "4084")] -) - (define_insn "*movhi_bytes" [(set (match_operand:HI 0 "s_register_operand" "=r,r") (match_operand:HI 1 "arm_rhs_operand" "rI,K"))] - "TARGET_ARM && TARGET_MMU_TRAPS" + "TARGET_ARM" "@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi" [(set_attr "predicable" "yes")] ) -(define_insn "thumb_movhi_clobber" - [(set (match_operand:HI 0 "memory_operand" "=m") - (match_operand:HI 1 "register_operand" "l")) - (clobber (match_operand:SI 2 "register_operand" "=&l"))] +(define_expand "thumb_movhi_clobber" + [(set (match_operand:HI 0 "memory_operand" "") + (match_operand:HI 1 "register_operand" "")) + (clobber (match_operand:DI 2 "register_operand" ""))] "TARGET_THUMB" - "* - abort ();" + " + if (strict_memory_address_p (HImode, XEXP (operands[0], 0)) + && REGNO (operands[1]) <= LAST_LO_REGNUM) + { + emit_insn (gen_movhi (operands[0], operands[1])); + DONE; + } + /* XXX Fixme, need to handle other cases here as well. */ + gcc_unreachable (); + " ) ;; We use a DImode scratch because we may occasionally need an additional @@ -4701,7 +5076,7 @@ [(parallel [(match_operand:HI 0 "s_register_operand" "=r") (match_operand:HI 1 "arm_reload_memory_operand" "o") (match_operand:DI 2 "s_register_operand" "=&r")])] - "TARGET_THUMB || (TARGET_ARM && TARGET_MMU_TRAPS)" + "TARGET_EITHER" " if (TARGET_ARM) arm_reload_in_hi (operands); @@ -4715,37 +5090,20 @@ (match_operand:QI 1 "general_operand" ""))] "TARGET_EITHER" " - if (TARGET_ARM) + /* Everything except mem = const or mem = mem can be done easily */ + + if (!no_new_pseudos) { - /* Everything except mem = const or mem = mem can be done easily */ + if (GET_CODE (operands[1]) == CONST_INT) + { + rtx reg = gen_reg_rtx (SImode); - if (!no_new_pseudos) - { - if (GET_CODE (operands[1]) == CONST_INT) - { - rtx reg = gen_reg_rtx (SImode); - - emit_insn (gen_movsi (reg, operands[1])); - operands[1] = gen_lowpart (QImode, reg); - } - if (GET_CODE (operands[1]) == MEM && optimize > 0) - { - rtx reg = gen_reg_rtx (SImode); - - emit_insn (gen_zero_extendqisi2 (reg, operands[1])); - operands[1] = gen_lowpart (QImode, reg); - } - if (GET_CODE (operands[0]) == MEM) - operands[1] = force_reg (QImode, operands[1]); - } - } - else /* TARGET_THUMB */ - { - if (!no_new_pseudos) - { - if (GET_CODE (operands[0]) != REG) - operands[1] = force_reg (QImode, operands[1]); + emit_insn (gen_movsi (reg, operands[1])); + operands[1] = gen_lowpart (QImode, reg); + } + if (TARGET_THUMB) + { /* ??? We shouldn't really get invalid addresses here, but this can happen if we are passed a SP (never OK for HImode/QImode) or virtual register (rejected by GO_IF_LEGITIMATE_ADDRESS for @@ -4766,20 +5124,32 @@ operands[1] = replace_equiv_address (operands[1], copy_to_reg (XEXP (operands[1], 0))); - } - /* Handle loading a large integer during reload. */ - else if (GET_CODE (operands[1]) == CONST_INT - && !CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'I')) - { - /* Writing a constant to memory needs a scratch, which should - be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + } - operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); - emit_insn (gen_movsi (operands[0], operands[1])); - DONE; - } + if (GET_CODE (operands[1]) == MEM && optimize > 0) + { + rtx reg = gen_reg_rtx (SImode); + + emit_insn (gen_zero_extendqisi2 (reg, operands[1])); + operands[1] = gen_lowpart (QImode, reg); + } + + if (GET_CODE (operands[0]) == MEM) + operands[1] = force_reg (QImode, operands[1]); + } + else if (TARGET_THUMB + && GET_CODE (operands[1]) == CONST_INT + && !satisfies_constraint_I (operands[1])) + { + /* Handle loading a large integer during reload. */ + + /* Writing a constant to memory needs a scratch, which should + be handled with SECONDARY_RELOADs. */ + gcc_assert (GET_CODE (operands[0]) == REG); + + operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); + emit_insn (gen_movsi (operands[0], operands[1])); + DONE; } " ) @@ -4796,7 +5166,7 @@ mvn%?\\t%0, #%B1 ldr%?b\\t%0, %1 str%?b\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes")] ) @@ -4814,7 +5184,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,*,*,*") + (set_attr "type" "*,load1,store1,*,*,*") (set_attr "pool_range" "*,32,*,*,*,*")] ) @@ -4839,11 +5209,12 @@ " ) +;; Transform a floating-point move of a constant into a core register into +;; an SImode operation. (define_split - [(set (match_operand:SF 0 "nonimmediate_operand" "") + [(set (match_operand:SF 0 "arm_general_register_operand" "") (match_operand:SF 1 "immediate_operand" ""))] "TARGET_ARM - && !TARGET_HARD_FLOAT && reload_completed && GET_CODE (operands[1]) == CONST_DOUBLE" [(set (match_dup 2) (match_dup 3))] @@ -4859,7 +5230,6 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m") (match_operand:SF 1 "general_operand" "r,mE,r"))] "TARGET_ARM - && !TARGET_CIRRUS && TARGET_SOFT_FLOAT && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" @@ -4869,7 +5239,7 @@ str%?\\t%1, %0\\t%@ float" [(set_attr "length" "4,4,4") (set_attr "predicable" "yes") - (set_attr "type" "*,load,store1") + (set_attr "type" "*,load1,store1") (set_attr "pool_range" "*,4096,*") (set_attr "neg_pool_range" "*,4084,*")] ) @@ -4890,7 +5260,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,load,store1,*,*") + (set_attr "type" "*,load1,store1,load1,store1,*,*") (set_attr "pool_range" "*,*,*,1020,*,*,*")] ) @@ -4948,7 +5318,8 @@ emit_insn (gen_addsi3 (operands[2], XEXP (XEXP (operands[0], 0), 0), XEXP (XEXP (operands[0], 0), 1))); - emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_MEM (DFmode, operands[2]), + emit_insn (gen_rtx_SET (VOIDmode, + replace_equiv_address (operands[0], operands[2]), operands[1])); if (code == POST_DEC) @@ -4959,14 +5330,24 @@ ) (define_insn "*movdf_soft_insn" - [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,m") - (match_operand:DF 1 "soft_df_operand" "r,mF,r"))] + [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,r,r,m") + (match_operand:DF 1 "soft_df_operand" "rDa,Db,Dc,mF,r"))] "TARGET_ARM && TARGET_SOFT_FLOAT - && !TARGET_CIRRUS + && ( register_operand (operands[0], DFmode) + || register_operand (operands[1], DFmode))" + "* + switch (which_alternative) + { + case 0: + case 1: + case 2: + return \"#\"; + default: + return output_move_double (operands); + } " - "* return output_move_double (operands);" - [(set_attr "length" "8,8,8") - (set_attr "type" "*,load,store2") + [(set_attr "length" "8,12,16,8,8") + (set_attr "type" "*,*,*,load2,store2") (set_attr "pool_range" "1020") (set_attr "neg_pool_range" "1008")] ) @@ -4996,8 +5377,8 @@ case 3: return thumb_load_double_from_address (operands); case 4: - operands[2] = gen_rtx (MEM, SImode, - plus_constant (XEXP (operands[0], 0), 4)); + operands[2] = gen_rtx_MEM (SImode, + plus_constant (XEXP (operands[0], 0), 4)); output_asm_insn (\"str\\t%1, %0\;str\\t%H1, %2\", operands); return \"\"; case 5: @@ -5007,10 +5388,20 @@ } " [(set_attr "length" "4,2,2,6,4,4") - (set_attr "type" "*,load,store2,load,store2,*") + (set_attr "type" "*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,1020,*,*")] ) +(define_expand "movxf" + [(set (match_operand:XF 0 "general_operand" "") + (match_operand:XF 1 "general_operand" ""))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" + " + if (GET_CODE (operands[0]) == MEM) + operands[1] = force_reg (XFmode, operands[1]); + " +) + ;; Vector Moves (define_expand "movv2si" [(set (match_operand:V2SI 0 "nonimmediate_operand" "") @@ -5045,7 +5436,7 @@ "TARGET_ARM" { HOST_WIDE_INT offset = 0; - + /* Support only fixed point registers. */ if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 14 @@ -5060,7 +5451,6 @@ = arm_gen_load_multiple (REGNO (operands[0]), INTVAL (operands[2]), force_reg (SImode, XEXP (operands[1], 0)), TRUE, FALSE, operands[1], &offset); - }) ;; Load multiple with write-back @@ -5080,10 +5470,28 @@ (mem:SI (plus:SI (match_dup 2) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 5" "ldm%?ia\\t%1!, {%3, %4, %5, %6}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) +(define_insn "*ldmsi_postinc4_thumb" + [(match_parallel 0 "load_multiple_operation" + [(set (match_operand:SI 1 "s_register_operand" "=l") + (plus:SI (match_operand:SI 2 "s_register_operand" "1") + (const_int 16))) + (set (match_operand:SI 3 "arm_hard_register_operand" "") + (mem:SI (match_dup 2))) + (set (match_operand:SI 4 "arm_hard_register_operand" "") + (mem:SI (plus:SI (match_dup 2) (const_int 4)))) + (set (match_operand:SI 5 "arm_hard_register_operand" "") + (mem:SI (plus:SI (match_dup 2) (const_int 8)))) + (set (match_operand:SI 6 "arm_hard_register_operand" "") + (mem:SI (plus:SI (match_dup 2) (const_int 12))))])] + "TARGET_THUMB && XVECLEN (operands[0], 0) == 5" + "ldmia\\t%1!, {%3, %4, %5, %6}" + [(set_attr "type" "load4")] +) + (define_insn "*ldmsi_postinc3" [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 1 "s_register_operand" "=r") @@ -5097,7 +5505,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1!, {%3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -5112,7 +5520,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1!, {%3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -5130,7 +5538,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1, {%2, %3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) @@ -5144,7 +5552,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1, {%2, %3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -5156,7 +5564,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 2" "ldm%?ia\\t%1, {%2, %3}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -5205,6 +5613,24 @@ (set_attr "type" "store4")] ) +(define_insn "*stmsi_postinc4_thumb" + [(match_parallel 0 "store_multiple_operation" + [(set (match_operand:SI 1 "s_register_operand" "=l") + (plus:SI (match_operand:SI 2 "s_register_operand" "1") + (const_int 16))) + (set (mem:SI (match_dup 2)) + (match_operand:SI 3 "arm_hard_register_operand" "")) + (set (mem:SI (plus:SI (match_dup 2) (const_int 4))) + (match_operand:SI 4 "arm_hard_register_operand" "")) + (set (mem:SI (plus:SI (match_dup 2) (const_int 8))) + (match_operand:SI 5 "arm_hard_register_operand" "")) + (set (mem:SI (plus:SI (match_dup 2) (const_int 12))) + (match_operand:SI 6 "arm_hard_register_operand" ""))])] + "TARGET_THUMB && XVECLEN (operands[0], 0) == 5" + "stmia\\t%1!, {%3, %4, %5, %6}" + [(set_attr "type" "store4")] +) + (define_insn "*stmsi_postinc3" [(match_parallel 0 "store_multiple_operation" [(set (match_operand:SI 1 "s_register_operand" "=r") @@ -5285,7 +5711,7 @@ ;; We could let this apply for blocks of less than this, but it clobbers so ;; many registers that there is then probably a better way. -(define_expand "movstrqi" +(define_expand "movmemqi" [(match_operand:BLK 0 "general_operand" "") (match_operand:BLK 1 "general_operand" "") (match_operand:SI 2 "const_int_operand" "") @@ -5294,7 +5720,7 @@ " if (TARGET_ARM) { - if (arm_gen_movstrqi (operands)) + if (arm_gen_movmemqi (operands)) DONE; FAIL; } @@ -5304,7 +5730,7 @@ || INTVAL (operands[2]) > 48) FAIL; - thumb_expand_movstrqi (operands); + thumb_expand_movmemqi (operands); DONE; } " @@ -5527,7 +5953,7 @@ (define_insn "*negated_cbranchsi4" [(set (pc) (if_then_else - (match_operator 0 "arm_comparison_operator" + (match_operator 0 "equality_operator" [(match_operand:SI 1 "s_register_operand" "l") (neg:SI (match_operand:SI 2 "s_register_operand" "l"))]) (label_ref (match_operand 3 "" "")) @@ -5603,6 +6029,50 @@ (const_int 8))))] ) +(define_insn "*tlobits_cbranch" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(zero_extract:SI (match_operand:SI 1 "s_register_operand" "l") + (match_operand:SI 2 "const_int_operand" "i") + (const_int 0)) + (const_int 0)]) + (label_ref (match_operand 3 "" "")) + (pc))) + (clobber (match_scratch:SI 4 "=l"))] + "TARGET_THUMB" + "* + { + rtx op[3]; + op[0] = operands[4]; + op[1] = operands[1]; + op[2] = GEN_INT (32 - INTVAL (operands[2])); + + output_asm_insn (\"lsl\\t%0, %1, %2\", op); + switch (get_attr_length (insn)) + { + case 4: return \"b%d0\\t%l3\"; + case 6: return \"b%D0\\t.LCB%=\;b\\t%l3\\t%@long jump\\n.LCB%=:\"; + default: return \"b%D0\\t.LCB%=\;bl\\t%l3\\t%@far jump\\n.LCB%=:\"; + } + }" + [(set (attr "far_jump") + (if_then_else + (eq_attr "length" "8") + (const_string "yes") + (const_string "no"))) + (set (attr "length") + (if_then_else + (and (ge (minus (match_dup 3) (pc)) (const_int -250)) + (le (minus (match_dup 3) (pc)) (const_int 256))) + (const_int 4) + (if_then_else + (and (ge (minus (match_dup 3) (pc)) (const_int -2040)) + (le (minus (match_dup 3) (pc)) (const_int 2048))) + (const_int 6) + (const_int 8))))] +) + (define_insn "*tstsi3_cbranch" [(set (pc) (if_then_else @@ -6215,7 +6685,7 @@ (match_operator 3 "comparison_operator" [(plus:SI (match_operand:SI 1 "s_register_operand" "%l,l,l,0") - (match_operand:SI 2 "reg_or_int_operand" "J,l,I,L")) + (match_operand:SI 2 "reg_or_int_operand" "J,l,L,IJ")) (const_int 0)]) (label_ref (match_operand 4 "" "")) (pc))) @@ -6236,10 +6706,16 @@ output_asm_insn (\"cmn\t%1, %2\", operands); break; case 2: - output_asm_insn (\"add\t%0, %1, %2\", operands); + if (INTVAL (operands[2]) < 0) + output_asm_insn (\"sub\t%0, %1, %2\", operands); + else + output_asm_insn (\"add\t%0, %1, %2\", operands); break; case 3: - output_asm_insn (\"add\t%0, %0, %2\", operands); + if (INTVAL (operands[2]) < 0) + output_asm_insn (\"sub\t%0, %0, %2\", operands); + else + output_asm_insn (\"add\t%0, %0, %2\", operands); break; } @@ -6407,12 +6883,9 @@ (define_expand "cmpsf" [(match_operand:SF 0 "s_register_operand" "") - (match_operand:SF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:SF 1 "arm_float_compare_operand" "")] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], SFmode)) - operands[1] = force_reg (SFmode, operands[1]); - arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; DONE; @@ -6421,12 +6894,9 @@ (define_expand "cmpdf" [(match_operand:DF 0 "s_register_operand" "") - (match_operand:DF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + (match_operand:DF 1 "arm_float_compare_operand" "")] + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], DFmode)) - operands[1] = force_reg (DFmode, operands[1]); - arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; DONE; @@ -6454,7 +6924,9 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*cmpsi_shiftsi_swp" @@ -6467,20 +6939,24 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) -(define_insn "*cmpsi_neg_shiftsi" - [(set (reg:CC CC_REGNUM) - (compare:CC (match_operand:SI 0 "s_register_operand" "r") - (neg:SI (match_operator:SI 3 "shift_operator" - [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "arm_rhs_operand" "rM")]))))] +(define_insn "*cmpsi_negshiftsi_si" + [(set (reg:CC_Z CC_REGNUM) + (compare:CC_Z + (neg:SI (match_operator:SI 1 "shift_operator" + [(match_operand:SI 2 "s_register_operand" "r") + (match_operand:SI 3 "reg_or_int_operand" "rM")])) + (match_operand:SI 0 "s_register_operand" "r")))] "TARGET_ARM" - "cmn%?\\t%0, %1%S3" + "cmn%?\\t%0, %2%S1" [(set_attr "conds" "set") - (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; Cirrus SF compare instruction @@ -6488,7 +6964,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "cirrus_fp_register" "v") (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmps%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6499,7 +6975,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "cirrus_fp_register" "v") (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmpd%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6509,7 +6985,7 @@ (define_expand "cmpdi" [(match_operand:DI 0 "cirrus_fp_register" "") (match_operand:DI 1 "cirrus_fp_register" "")] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "{ arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; @@ -6520,7 +6996,7 @@ [(set (reg:CC CC_REGNUM) (compare:CC (match_operand:DI 0 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmp64%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6638,7 +7114,7 @@ (if_then_else (unordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6648,7 +7124,7 @@ (if_then_else (ordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6658,7 +7134,7 @@ (if_then_else (ungt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6667,7 +7143,7 @@ (if_then_else (unlt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6676,7 +7152,7 @@ (if_then_else (unge (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6685,7 +7161,7 @@ (if_then_else (unle (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6696,7 +7172,7 @@ (if_then_else (uneq (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);" ) @@ -6705,7 +7181,7 @@ (if_then_else (ltgt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);" ) @@ -6719,10 +7195,9 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bvs\\t%l0\;beq\\t%l0\"; " @@ -6736,10 +7211,9 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bmi\\t%l0\;bgt\\t%l0\"; " @@ -6762,7 +7236,8 @@ } return \"b%d1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) ; Special pattern to match reversed UNEQ. @@ -6771,10 +7246,9 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bmi\\t%l0\;bgt\\t%l0\"; " @@ -6788,10 +7262,9 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bvs\\t%l0\;beq\\t%l0\"; " @@ -6814,7 +7287,8 @@ } return \"b%D1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) @@ -6894,7 +7368,7 @@ (define_expand "sunordered" [(set (match_operand:SI 0 "s_register_operand" "") (unordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6902,7 +7376,7 @@ (define_expand "sordered" [(set (match_operand:SI 0 "s_register_operand" "") (ordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6910,7 +7384,7 @@ (define_expand "sungt" [(set (match_operand:SI 0 "s_register_operand" "") (ungt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6918,7 +7392,7 @@ (define_expand "sunge" [(set (match_operand:SI 0 "s_register_operand" "") (unge:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6926,7 +7400,7 @@ (define_expand "sunlt" [(set (match_operand:SI 0 "s_register_operand" "") (unlt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6934,7 +7408,7 @@ (define_expand "sunle" [(set (match_operand:SI 0 "s_register_operand" "") (unle:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6945,15 +7419,15 @@ ; (define_expand "suneq" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (uneq:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" -; "abort ();" +; "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" +; "gcc_unreachable ();" ; ) ; ; (define_expand "sltgt" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (ltgt:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" -; "abort ();" +; "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" +; "gcc_unreachable ();" ; ) (define_insn "*mov_scc" @@ -7004,7 +7478,7 @@ FAIL; ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1); - operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); + operands[1] = gen_rtx_fmt_ee (code, VOIDmode, ccreg, const0_rtx); }" ) @@ -7023,13 +7497,13 @@ FAIL; /* When compiling for SOFT_FLOAT, ensure both arms are in registers. - Otherwise, ensure it is a valid FP add operand. */ - if ((!TARGET_HARD_FLOAT) - || (!fpa_add_operand (operands[3], SFmode))) + Otherwise, ensure it is a valid FP add operand */ + if ((!(TARGET_HARD_FLOAT && TARGET_FPA)) + || (!arm_float_add_operand (operands[3], SFmode))) operands[3] = force_reg (SFmode, operands[3]); ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1); - operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); + operands[1] = gen_rtx_fmt_ee (code, VOIDmode, ccreg, const0_rtx); }" ) @@ -7037,8 +7511,8 @@ [(set (match_operand:DF 0 "s_register_operand" "") (if_then_else:DF (match_operand 1 "arm_comparison_operator" "") (match_operand:DF 2 "s_register_operand" "") - (match_operand:DF 3 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 3 "arm_float_add_operand" "")))] + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" " { enum rtx_code code = GET_CODE (operands[1]); @@ -7048,7 +7522,7 @@ FAIL; ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1); - operands[1] = gen_rtx (code, VOIDmode, ccreg, const0_rtx); + operands[1] = gen_rtx_fmt_ee (code, VOIDmode, ccreg, const0_rtx); }" ) @@ -7161,18 +7635,30 @@ invoked it. */ callee = XEXP (operands[0], 0); - if (GET_CODE (callee) != REG - && arm_is_longcall_p (operands[0], INTVAL (operands[2]), 0)) + if ((GET_CODE (callee) == SYMBOL_REF + && arm_is_longcall_p (operands[0], INTVAL (operands[2]), 0)) + || (GET_CODE (callee) != SYMBOL_REF + && GET_CODE (callee) != REG)) XEXP (operands[0], 0) = force_reg (Pmode, callee); }" ) -(define_insn "*call_reg" +(define_insn "*call_reg_armv5" [(call (mem:SI (match_operand:SI 0 "s_register_operand" "r")) (match_operand 1 "" "")) (use (match_operand 2 "" "")) (clobber (reg:SI LR_REGNUM))] - "TARGET_ARM" + "TARGET_ARM && arm_arch5" + "blx%?\\t%0" + [(set_attr "type" "call")] +) + +(define_insn "*call_reg_arm" + [(call (mem:SI (match_operand:SI 0 "s_register_operand" "r")) + (match_operand 1 "" "")) + (use (match_operand 2 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_ARM && !arm_arch5" "* return output_call (operands); " @@ -7182,7 +7668,7 @@ ) (define_insn "*call_mem" - [(call (mem:SI (match_operand:SI 0 "memory_operand" "m")) + [(call (mem:SI (match_operand:SI 0 "call_memory_operand" "m")) (match_operand 1 "" "")) (use (match_operand 2 "" "")) (clobber (reg:SI LR_REGNUM))] @@ -7194,35 +7680,33 @@ (set_attr "type" "call")] ) -(define_insn "*call_indirect" +(define_insn "*call_reg_thumb_v5" [(call (mem:SI (match_operand:SI 0 "register_operand" "l*r")) (match_operand 1 "" "")) (use (match_operand 2 "" "")) (clobber (reg:SI LR_REGNUM))] - "TARGET_THUMB" - "* - { - if (TARGET_CALLER_INTERWORKING) - return \"bl\\t%__interwork_call_via_%0\"; - else - return \"bl\\t%__call_via_%0\"; - }" - [(set_attr "type" "call")] + "TARGET_THUMB && arm_arch5" + "blx\\t%0" + [(set_attr "length" "2") + (set_attr "type" "call")] ) -(define_insn "*call_value_indirect" - [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "register_operand" "l*r")) - (match_operand 2 "" ""))) - (use (match_operand 3 "" "")) +(define_insn "*call_reg_thumb" + [(call (mem:SI (match_operand:SI 0 "register_operand" "l*r")) + (match_operand 1 "" "")) + (use (match_operand 2 "" "")) (clobber (reg:SI LR_REGNUM))] - "TARGET_THUMB" + "TARGET_THUMB && !arm_arch5" "* { - if (TARGET_CALLER_INTERWORKING) - return \"bl\\t%__interwork_call_via_%1\"; + if (!TARGET_CALLER_INTERWORKING) + return thumb_call_via_reg (operands[0]); + else if (operands[1] == const0_rtx) + return \"bl\\t%__interwork_call_via_%0\"; + else if (frame_pointer_needed) + return \"bl\\t%__interwork_r7_call_via_%0\"; else - return \"bl\\t%__call_via_%1\"; + return \"bl\\t%__interwork_r11_call_via_%0\"; }" [(set_attr "type" "call")] ) @@ -7243,19 +7727,32 @@ operands[3] = const0_rtx; /* See the comment in define_expand \"call\". */ - if (GET_CODE (callee) != REG - && arm_is_longcall_p (operands[1], INTVAL (operands[3]), 0)) + if ((GET_CODE (callee) == SYMBOL_REF + && arm_is_longcall_p (operands[1], INTVAL (operands[3]), 0)) + || (GET_CODE (callee) != SYMBOL_REF + && GET_CODE (callee) != REG)) XEXP (operands[1], 0) = force_reg (Pmode, callee); }" ) -(define_insn "*call_value_reg" +(define_insn "*call_value_reg_armv5" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:SI 1 "s_register_operand" "r")) (match_operand 2 "" ""))) (use (match_operand 3 "" "")) (clobber (reg:SI LR_REGNUM))] - "TARGET_ARM" + "TARGET_ARM && arm_arch5" + "blx%?\\t%1" + [(set_attr "type" "call")] +) + +(define_insn "*call_value_reg_arm" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:SI 1 "s_register_operand" "r")) + (match_operand 2 "" ""))) + (use (match_operand 3 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_ARM && !arm_arch5" "* return output_call (&operands[1]); " @@ -7265,7 +7762,7 @@ (define_insn "*call_value_mem" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "memory_operand" "m")) + (call (mem:SI (match_operand:SI 1 "call_memory_operand" "m")) (match_operand 2 "" ""))) (use (match_operand 3 "" "")) (clobber (reg:SI LR_REGNUM))] @@ -7277,6 +7774,39 @@ (set_attr "type" "call")] ) +(define_insn "*call_value_reg_thumb_v5" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:SI 1 "register_operand" "l*r")) + (match_operand 2 "" ""))) + (use (match_operand 3 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_THUMB && arm_arch5" + "blx\\t%1" + [(set_attr "length" "2") + (set_attr "type" "call")] +) + +(define_insn "*call_value_reg_thumb" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:SI 1 "register_operand" "l*r")) + (match_operand 2 "" ""))) + (use (match_operand 3 "" "")) + (clobber (reg:SI LR_REGNUM))] + "TARGET_THUMB && !arm_arch5" + "* + { + if (!TARGET_CALLER_INTERWORKING) + return thumb_call_via_reg (operands[1]); + else if (operands[2] == const0_rtx) + return \"bl\\t%__interwork_call_via_%1\"; + else if (frame_pointer_needed) + return \"bl\\t%__interwork_r7_call_via_%1\"; + else + return \"bl\\t%__interwork_r11_call_via_%1\"; + }" + [(set_attr "type" "call")] +) + ;; Allow calls to SYMBOL_REFs specially as they are not valid general addresses ;; The 'a' causes the operand to be treated as an address, i.e. no '#' output. @@ -7296,7 +7826,7 @@ ) (define_insn "*call_value_symbol" - [(set (match_operand 0 "s_register_operand" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand:SI 1 "" "")) (match_operand:SI 2 "" ""))) (use (match_operand 3 "" "")) @@ -7325,7 +7855,7 @@ ) (define_insn "*call_value_insn" - [(set (match_operand 0 "register_operand" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand 1 "" "")) (match_operand 2 "" ""))) (use (match_operand 3 "" "")) @@ -7353,7 +7883,7 @@ ) (define_expand "sibcall_value" - [(parallel [(set (match_operand 0 "register_operand" "") + [(parallel [(set (match_operand 0 "" "") (call (match_operand 1 "memory_operand" "") (match_operand 2 "general_operand" ""))) (return) @@ -7379,7 +7909,7 @@ ) (define_insn "*sibcall_value_insn" - [(set (match_operand 0 "s_register_operand" "") + [(set (match_operand 0 "" "") (call (mem:SI (match_operand:SI 1 "" "X")) (match_operand 2 "" ""))) (return) @@ -7404,7 +7934,7 @@ } return output_return_instruction (const_true_rtx, TRUE, FALSE); }" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "length" "12") (set_attr "predicable" "yes")] ) @@ -7427,7 +7957,7 @@ }" [(set_attr "conds" "use") (set_attr "length" "12") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) (define_insn "*cond_return_inverted" @@ -7447,7 +7977,8 @@ return output_return_instruction (operands[0], TRUE, TRUE); }" [(set_attr "conds" "use") - (set_attr "type" "load")] + (set_attr "length" "12") + (set_attr "type" "load1")] ) ;; Generate a sequence of instructions to determine if the processor is @@ -7484,18 +8015,59 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_ARM" + "TARGET_EITHER" " { int i; + rtx par = gen_rtx_PARALLEL (VOIDmode, + rtvec_alloc (XVECLEN (operands[2], 0))); + rtx addr = gen_reg_rtx (Pmode); + rtx mem; + int size = 0; - emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx)); + emit_move_insn (addr, XEXP (operands[1], 0)); + mem = change_address (operands[1], BLKmode, addr); for (i = 0; i < XVECLEN (operands[2], 0); i++) { - rtx set = XVECEXP (operands[2], 0, i); + rtx src = SET_SRC (XVECEXP (operands[2], 0, i)); - emit_move_insn (SET_DEST (set), SET_SRC (set)); + /* Default code only uses r0 as a return value, but we could + be using anything up to 4 registers. */ + if (REGNO (src) == R0_REGNUM) + src = gen_rtx_REG (TImode, R0_REGNUM); + + XVECEXP (par, 0, i) = gen_rtx_EXPR_LIST (VOIDmode, src, + GEN_INT (size)); + size += GET_MODE_SIZE (GET_MODE (src)); + } + + emit_call_insn (GEN_CALL_VALUE (par, operands[0], const0_rtx, NULL, + const0_rtx)); + + size = 0; + + for (i = 0; i < XVECLEN (par, 0); i++) + { + HOST_WIDE_INT offset = 0; + rtx reg = XEXP (XVECEXP (par, 0, i), 0); + + if (size != 0) + emit_move_insn (addr, plus_constant (addr, size)); + + mem = change_address (mem, GET_MODE (reg), NULL); + if (REGNO (reg) == R0_REGNUM) + { + /* On thumb we have to use a write-back instruction. */ + emit_insn (arm_gen_store_multiple (R0_REGNUM, 4, addr, TRUE, + TARGET_THUMB ? TRUE : FALSE, mem, &offset)); + size = TARGET_ARM ? 16 : 0; + } + else + { + emit_move_insn (mem, reg); + size = GET_MODE_SIZE (GET_MODE (reg)); + } } /* The optimizer does not know that the call sets the function value @@ -7508,6 +8080,55 @@ }" ) +(define_expand "untyped_return" + [(match_operand:BLK 0 "memory_operand" "") + (match_operand 1 "" "")] + "TARGET_EITHER" + " + { + int i; + rtx addr = gen_reg_rtx (Pmode); + rtx mem; + int size = 0; + + emit_move_insn (addr, XEXP (operands[0], 0)); + mem = change_address (operands[0], BLKmode, addr); + + for (i = 0; i < XVECLEN (operands[1], 0); i++) + { + HOST_WIDE_INT offset = 0; + rtx reg = SET_DEST (XVECEXP (operands[1], 0, i)); + + if (size != 0) + emit_move_insn (addr, plus_constant (addr, size)); + + mem = change_address (mem, GET_MODE (reg), NULL); + if (REGNO (reg) == R0_REGNUM) + { + /* On thumb we have to use a write-back instruction. */ + emit_insn (arm_gen_load_multiple (R0_REGNUM, 4, addr, TRUE, + TARGET_THUMB ? TRUE : FALSE, mem, &offset)); + size = TARGET_ARM ? 16 : 0; + } + else + { + emit_move_insn (reg, mem); + size = GET_MODE_SIZE (GET_MODE (reg)); + } + } + + /* Emit USE insns before the return. */ + for (i = 0; i < XVECLEN (operands[1], 0); i++) + emit_insn (gen_rtx_USE (VOIDmode, + SET_DEST (XVECEXP (operands[1], 0, i)))); + + /* Construct the return. */ + expand_naked_return (); + + DONE; + }" +) + ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and ;; all of memory. This blocks insns from being moved across this point. @@ -7576,6 +8197,7 @@ "" ) +;; NB Never uses BX. (define_insn "*arm_indirect_jump" [(set (pc) (match_operand:SI 0 "s_register_operand" "r"))] @@ -7584,19 +8206,18 @@ [(set_attr "predicable" "yes")] ) -;; Although not supported by the define_expand above, -;; cse/combine may generate this form. (define_insn "*load_indirect_jump" [(set (pc) (match_operand:SI 0 "memory_operand" "m"))] "TARGET_ARM" "ldr%?\\t%|pc, %0\\t%@ indirect memory jump" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084") (set_attr "predicable" "yes")] ) +;; NB Never uses BX. (define_insn "*thumb_indirect_jump" [(set (pc) (match_operand:SI 0 "register_operand" "l*r"))] @@ -7637,7 +8258,9 @@ "%i1%?\\t%0, %2, %4%S3" [(set_attr "predicable" "yes") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_split @@ -7673,7 +8296,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*arith_shiftsi_compare0_scratch" @@ -7689,7 +8314,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi" @@ -7702,7 +8329,9 @@ "sub%?\\t%0, %1, %3%S2" [(set_attr "predicable" "yes") (set_attr "shift" "3") - ] + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0" @@ -7719,8 +8348,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0_scratch" @@ -7735,8 +8366,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) @@ -8609,7 +9242,10 @@ mvn%D5\\t%0, #%B1\;mov%d5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_move_shift" @@ -8645,7 +9281,10 @@ mvn%d5\\t%0, #%B1\;mov%D5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_shift_shift" @@ -8682,7 +9321,12 @@ "mov%d5\\t%0, %1%S6\;mov%D5\\t%0, %3%S7" [(set_attr "conds" "use") (set_attr "shift" "1") - (set_attr "length" "8")] + (set_attr "length" "8") + (set (attr "type") (if_then_else + (and (match_operand 2 "const_int_operand" "") + (match_operand 4 "const_int_operand" "")) + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_not_arith" @@ -8822,7 +9466,8 @@ { rtx ldm[3]; rtx arith[4]; - int val1 = 0, val2 = 0; + rtx base_reg; + HOST_WIDE_INT val1 = 0, val2 = 0; if (REGNO (operands[0]) > REGNO (operands[4])) { @@ -8834,12 +9479,21 @@ ldm[1] = operands[0]; ldm[2] = operands[4]; } - if (GET_CODE (XEXP (operands[2], 0)) != REG) - val1 = INTVAL (XEXP (XEXP (operands[2], 0), 1)); - if (GET_CODE (XEXP (operands[3], 0)) != REG) + + base_reg = XEXP (operands[2], 0); + + if (!REG_P (base_reg)) + { + val1 = INTVAL (XEXP (base_reg, 1)); + base_reg = XEXP (base_reg, 0); + } + + if (!REG_P (XEXP (operands[3], 0))) val2 = INTVAL (XEXP (XEXP (operands[3], 0), 1)); + arith[0] = operands[0]; arith[3] = operands[1]; + if (val1 < val2) { arith[1] = ldm[1]; @@ -8850,21 +9504,41 @@ arith[1] = ldm[2]; arith[2] = ldm[1]; } - if (val1 && val2) + + ldm[0] = base_reg; + if (val1 !=0 && val2 != 0) { rtx ops[3]; - ldm[0] = ops[0] = operands[4]; - ops[1] = XEXP (XEXP (operands[2], 0), 0); - ops[2] = XEXP (XEXP (operands[2], 0), 1); - output_add_immediate (ops); - if (val1 < val2) - output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); + + if (val1 == 4 || val2 == 4) + /* Other val must be 8, since we know they are adjacent and neither + is zero. */ + output_asm_insn (\"ldm%?ib\\t%0, {%1, %2}\", ldm); + else if (const_ok_for_arm (val1) || const_ok_for_arm (-val1)) + { + ldm[0] = ops[0] = operands[4]; + ops[1] = base_reg; + ops[2] = GEN_INT (val1); + output_add_immediate (ops); + if (val1 < val2) + output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); + else + output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); + } else - output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); + { + /* Offset is out of range for a single add, so use two ldr. */ + ops[0] = ldm[1]; + ops[1] = base_reg; + ops[2] = GEN_INT (val1); + output_asm_insn (\"ldr%?\\t%0, [%1, %2]\", ops); + ops[0] = ldm[2]; + ops[2] = GEN_INT (val2); + output_asm_insn (\"ldr%?\\t%0, [%1, %2]\", ops); + } } - else if (val1) + else if (val1 != 0) { - ldm[0] = XEXP (operands[3], 0); if (val1 < val2) output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); else @@ -8872,7 +9546,6 @@ } else { - ldm[0] = XEXP (operands[2], 0); if (val1 < val2) output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); else @@ -8883,516 +9556,17 @@ }" [(set_attr "length" "12") (set_attr "predicable" "yes") - (set_attr "type" "load")] -) - -;; the arm can support extended pre-inc instructions - -;; In all these cases, we use operands 0 and 1 for the register being -;; incremented because those are the operands that local-alloc will -;; tie and these are the pair most likely to be tieable (and the ones -;; that will benefit the most). - -;; We reject the frame pointer if it occurs anywhere in these patterns since -;; elimination will cause too many headaches. - -(define_insn "*strqi_preinc" - [(set (mem:QI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ"))) - (match_operand:QI 3 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "str%?b\\t%3, [%0, %2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*strqi_predec" - [(set (mem:QI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r"))) - (match_operand:QI 3 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "str%?b\\t%3, [%0, -%2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqi_preinc" - [(set (match_operand:QI 3 "s_register_operand" "=r") - (mem:QI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?b\\t%3, [%0, %2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqi_predec" - [(set (match_operand:QI 3 "s_register_operand" "=r") - (mem:QI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?b\\t%3, [%0, -%2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqisi_preinc" - [(set (match_operand:SI 3 "s_register_operand" "=r") - (zero_extend:SI - (mem:QI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ"))))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?b\\t%3, [%0, %2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqisi_predec" - [(set (match_operand:SI 3 "s_register_operand" "=r") - (zero_extend:SI - (mem:QI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r"))))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?b\\t%3, [%0, -%2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*strsi_preinc" - [(set (mem:SI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ"))) - (match_operand:SI 3 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "str%?\\t%3, [%0, %2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*strsi_predec" - [(set (mem:SI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r"))) - (match_operand:SI 3 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "str%?\\t%3, [%0, -%2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadsi_preinc" - [(set (match_operand:SI 3 "s_register_operand" "=r") - (mem:SI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?\\t%3, [%0, %2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadsi_predec" - [(set (match_operand:SI 3 "s_register_operand" "=r") - (mem:SI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?\\t%3, [%0, -%2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadhi_preinc" - [(set (match_operand:HI 3 "s_register_operand" "=r") - (mem:HI (plus:SI (match_operand:SI 1 "s_register_operand" "%0") - (match_operand:SI 2 "index_operand" "rJ")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && !arm_arch4 - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?\\t%3, [%0, %2]!\\t%@ loadhi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadhi_predec" - [(set (match_operand:HI 3 "s_register_operand" "=r") - (mem:HI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operand:SI 2 "s_register_operand" "r")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && !arm_arch4 - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" - "ldr%?\\t%3, [%0, -%2]!\\t%@ loadhi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*strqi_shiftpreinc" - [(set (mem:QI (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]) - (match_operand:SI 1 "s_register_operand" "0"))) - (match_operand:QI 5 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) - (match_dup 1)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "str%?b\\t%5, [%0, %3%S2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*strqi_shiftpredec" - [(set (mem:QI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]))) - (match_operand:QI 5 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) - (match_dup 4)])))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "str%?b\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqi_shiftpreinc" - [(set (match_operand:QI 5 "s_register_operand" "=r") - (mem:QI (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]) - (match_operand:SI 1 "s_register_operand" "0")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) - (match_dup 1)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?b\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadqi_shiftpredec" - [(set (match_operand:QI 5 "s_register_operand" "=r") - (mem:QI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")])))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) - (match_dup 4)])))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?b\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*strsi_shiftpreinc" - [(set (mem:SI (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]) - (match_operand:SI 1 "s_register_operand" "0"))) - (match_operand:SI 5 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) - (match_dup 1)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "str%?\\t%5, [%0, %3%S2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*strsi_shiftpredec" - [(set (mem:SI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]))) - (match_operand:SI 5 "s_register_operand" "r")) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) - (match_dup 4)])))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "str%?\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "store1") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadsi_shiftpreinc" - [(set (match_operand:SI 5 "s_register_operand" "=r") - (mem:SI (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]) - (match_operand:SI 1 "s_register_operand" "0")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) - (match_dup 1)))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadsi_shiftpredec" - [(set (match_operand:SI 5 "s_register_operand" "=r") - (mem:SI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")])))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) - (match_dup 4)])))] - "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") - (set_attr "predicable" "yes")]) - -(define_insn "*loadhi_shiftpreinc" - [(set (match_operand:HI 5 "s_register_operand" "=r") - (mem:HI (plus:SI (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")]) - (match_operand:SI 1 "s_register_operand" "0")))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) - (match_dup 1)))] - "TARGET_ARM - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && !arm_arch4 - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?\\t%5, [%0, %3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -(define_insn "*loadhi_shiftpredec" - [(set (match_operand:HI 5 "s_register_operand" "=r") - (mem:HI (minus:SI (match_operand:SI 1 "s_register_operand" "0") - (match_operator:SI 2 "shift_operator" - [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_shift_operand" "n")])))) - (set (match_operand:SI 0 "s_register_operand" "=r") - (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) - (match_dup 4)])))] - "TARGET_ARM - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && !arm_arch4 - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" - "ldr%?\\t%5, [%0, -%3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") - (set_attr "predicable" "yes")] -) - -; It can also support extended post-inc expressions, but combine doesn't -; try these.... -; It doesn't seem worth adding peepholes for anything but the most common -; cases since, unlike combine, the increment must immediately follow the load -; for this pattern to match. -; We must watch to see that the source/destination register isn't also the -; same as the base address register, and that if the index is a register, -; that it is not the same as the base address register. In such cases the -; instruction that we would generate would have UNPREDICTABLE behavior so -; we cannot use it. - -(define_peephole - [(set (mem:QI (match_operand:SI 0 "s_register_operand" "+r")) - (match_operand:QI 2 "s_register_operand" "r")) - (set (match_dup 0) - (plus:SI (match_dup 0) (match_operand:SI 1 "index_operand" "rJ")))] - "TARGET_ARM - && (REGNO (operands[2]) != REGNO (operands[0])) - && (GET_CODE (operands[1]) != REG - || (REGNO (operands[1]) != REGNO (operands[0])))" - "str%?b\\t%2, [%0], %1" -) - -(define_peephole - [(set (match_operand:QI 0 "s_register_operand" "=r") - (mem:QI (match_operand:SI 1 "s_register_operand" "+r"))) - (set (match_dup 1) - (plus:SI (match_dup 1) (match_operand:SI 2 "index_operand" "rJ")))] - "TARGET_ARM - && REGNO (operands[0]) != REGNO(operands[1]) - && (GET_CODE (operands[2]) != REG - || REGNO(operands[0]) != REGNO (operands[2]))" - "ldr%?b\\t%0, [%1], %2" -) - -(define_peephole - [(set (mem:SI (match_operand:SI 0 "s_register_operand" "+r")) - (match_operand:SI 2 "s_register_operand" "r")) - (set (match_dup 0) - (plus:SI (match_dup 0) (match_operand:SI 1 "index_operand" "rJ")))] - "TARGET_ARM - && (REGNO (operands[2]) != REGNO (operands[0])) - && (GET_CODE (operands[1]) != REG - || (REGNO (operands[1]) != REGNO (operands[0])))" - "str%?\\t%2, [%0], %1" -) - -(define_peephole - [(set (match_operand:HI 0 "s_register_operand" "=r") - (mem:HI (match_operand:SI 1 "s_register_operand" "+r"))) - (set (match_dup 1) - (plus:SI (match_dup 1) (match_operand:SI 2 "index_operand" "rJ")))] - "TARGET_ARM - && !BYTES_BIG_ENDIAN - && !TARGET_MMU_TRAPS - && !arm_arch4 - && REGNO (operands[0]) != REGNO(operands[1]) - && (GET_CODE (operands[2]) != REG - || REGNO(operands[0]) != REGNO (operands[2]))" - "ldr%?\\t%0, [%1], %2\\t%@ loadhi" -) - -(define_peephole - [(set (match_operand:SI 0 "s_register_operand" "=r") - (mem:SI (match_operand:SI 1 "s_register_operand" "+r"))) - (set (match_dup 1) - (plus:SI (match_dup 1) (match_operand:SI 2 "index_operand" "rJ")))] - "TARGET_ARM - && REGNO (operands[0]) != REGNO(operands[1]) - && (GET_CODE (operands[2]) != REG - || REGNO(operands[0]) != REGNO (operands[2]))" - "ldr%?\\t%0, [%1], %2" -) - -(define_peephole - [(set (mem:QI (plus:SI (match_operand:SI 0 "s_register_operand" "+r") - (match_operand:SI 1 "index_operand" "rJ"))) - (match_operand:QI 2 "s_register_operand" "r")) - (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))] - "TARGET_ARM - && (REGNO (operands[2]) != REGNO (operands[0])) - && (GET_CODE (operands[1]) != REG - || (REGNO (operands[1]) != REGNO (operands[0])))" - "str%?b\\t%2, [%0, %1]!" -) - -(define_peephole - [(set (mem:QI (plus:SI (match_operator:SI 4 "shift_operator" - [(match_operand:SI 0 "s_register_operand" "r") - (match_operand:SI 1 "const_int_operand" "n")]) - (match_operand:SI 2 "s_register_operand" "+r"))) - (match_operand:QI 3 "s_register_operand" "r")) - (set (match_dup 2) (plus:SI (match_op_dup 4 [(match_dup 0) (match_dup 1)]) - (match_dup 2)))] - "TARGET_ARM - && (REGNO (operands[3]) != REGNO (operands[2])) - && (REGNO (operands[0]) != REGNO (operands[2]))" - "str%?b\\t%3, [%2, %0%S4]!" + (set_attr "type" "load1")] ) ; This pattern is never tried by combine, so do it as a peephole (define_peephole2 - [(set (match_operand:SI 0 "s_register_operand" "") - (match_operand:SI 1 "s_register_operand" "")) + [(set (match_operand:SI 0 "arm_general_register_operand" "") + (match_operand:SI 1 "arm_general_register_operand" "")) (set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))] - "TARGET_ARM - && (!TARGET_CIRRUS - || (!cirrus_fp_register (operands[0], SImode) - && !cirrus_fp_register (operands[1], SImode))) - " + "TARGET_ARM" [(parallel [(set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0))) (set (match_dup 0) (match_dup 1))])] "" @@ -9527,9 +9701,11 @@ ) (define_expand "epilogue" - [(unspec_volatile [(return)] VUNSPEC_EPILOGUE)] + [(clobber (const_int 0))] "TARGET_EITHER" " + if (current_function_calls_eh_return) + emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, 2))); if (TARGET_THUMB) thumb_expand_epilogue (); else if (USE_RETURN_INSN (FALSE)) @@ -9715,7 +9891,7 @@ enum rtx_code rc = GET_CODE (operands[1]); operands[6] = gen_rtx_REG (mode, CC_REGNUM); - operands[7] = gen_rtx (COMPARE, mode, operands[2], operands[3]); + operands[7] = gen_rtx_COMPARE (mode, operands[2], operands[3]); if (mode == CCFPmode || mode == CCFPEmode) rc = reverse_condition_maybe_unordered (rc); else @@ -9833,7 +10009,7 @@ [(set (match_operand:BLK 0 "memory_operand" "=m") (unspec:BLK [(match_operand:XF 1 "f_register_operand" "f")] UNSPEC_PUSH_MULT))])] - "TARGET_ARM" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* { char pattern[100]; @@ -9858,7 +10034,7 @@ (define_insn "align_8" [(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN8)] - "TARGET_REALLY_IWMMXT" + "TARGET_EITHER" "* assemble_align (64); return \"\"; @@ -9965,6 +10141,7 @@ " ) +;; NB never uses BX. (define_insn "*thumb_tablejump" [(set (pc) (match_operand:SI 0 "register_operand" "l*r")) (use (label_ref (match_operand 1 "" "")))] @@ -10047,9 +10224,81 @@ "%@ %0 needed for prologue" ) + +;; Patterns for exception handling + +(define_expand "eh_return" + [(use (match_operand 0 "general_operand" ""))] + "TARGET_EITHER" + " + { + if (TARGET_ARM) + emit_insn (gen_arm_eh_return (operands[0])); + else + emit_insn (gen_thumb_eh_return (operands[0])); + DONE; + }" +) + +;; We can't expand this before we know where the link register is stored. +(define_insn_and_split "arm_eh_return" + [(unspec_volatile [(match_operand:SI 0 "s_register_operand" "r")] + VUNSPEC_EH_RETURN) + (clobber (match_scratch:SI 1 "=&r"))] + "TARGET_ARM" + "#" + "&& reload_completed" + [(const_int 0)] + " + { + arm_set_return_address (operands[0], operands[1]); + DONE; + }" +) + +(define_insn_and_split "thumb_eh_return" + [(unspec_volatile [(match_operand:SI 0 "s_register_operand" "l")] + VUNSPEC_EH_RETURN) + (clobber (match_scratch:SI 1 "=&l"))] + "TARGET_THUMB" + "#" + "&& reload_completed" + [(const_int 0)] + " + { + thumb_set_return_address (operands[0], operands[1]); + DONE; + }" +) + + +;; TLS support + +(define_insn "load_tp_hard" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(const_int 0)] UNSPEC_TLS))] + "TARGET_HARD_TP" + "mrc%?\\tp15, 0, %0, c13, c0, 3\\t@ load_tp_hard" + [(set_attr "predicable" "yes")] +) + +;; Doesn't clobber R1-R3. Must use r0 for the first operand. +(define_insn "load_tp_soft" + [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (clobber (reg:CC CC_REGNUM))] + "TARGET_SOFT_TP" + "bl\\t__aeabi_read_tp\\t@ load_tp_soft" + [(set_attr "conds" "clob")] +) + ;; Load the FPA co-processor patterns (include "fpa.md") ;; Load the Maverick co-processor patterns (include "cirrus.md") ;; Load the Intel Wireless Multimedia Extension patterns (include "iwmmxt.md") +;; Load the VFP co-processor patterns +(include "vfp.md") + diff --git a/contrib/gcc/config/arm/arm.opt b/contrib/gcc/config/arm/arm.opt new file mode 100644 index 00000000000..8f85ffb050f --- /dev/null +++ b/contrib/gcc/config/arm/arm.opt @@ -0,0 +1,155 @@ +; Options for the ARM port of the compiler. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mabi= +Target RejectNegative Joined Var(target_abi_name) +Specify an ABI + +mabort-on-noreturn +Target Report Mask(ABORT_NORETURN) +Generate a call to abort if a noreturn function returns + +mapcs +Target RejectNegative Mask(APCS_FRAME) MaskExists Undocumented + +mapcs-float +Target Report Mask(APCS_FLOAT) +Pass FP arguments in FP registers + +mapcs-frame +Target Report Mask(APCS_FRAME) +Generate APCS conformant stack frames + +mapcs-reentrant +Target Report Mask(APCS_REENT) +Generate re-entrant, PIC code + +mapcs-stack-check +Target Report Mask(APCS_STACK) Undocumented + +march= +Target RejectNegative Joined +Specify the name of the target architecture + +marm +Target RejectNegative InverseMask(THUMB) Undocumented + +mbig-endian +Target Report RejectNegative Mask(BIG_END) +Assume target CPU is configured as big endian + +mcallee-super-interworking +Target Report Mask(CALLEE_INTERWORKING) +Thumb: Assume non-static functions may be called from ARM code + +mcaller-super-interworking +Target Report Mask(CALLER_INTERWORKING) +Thumb: Assume function pointers may go to non-Thumb aware code + +mcirrus-fix-invalid-insns +Target Report Mask(CIRRUS_FIX_INVALID_INSNS) +Cirrus: Place NOPs to avoid invalid instruction combinations + +mcpu= +Target RejectNegative Joined +Specify the name of the target CPU + +mfloat-abi= +Target RejectNegative Joined Var(target_float_abi_name) +Specify if floating point hardware should be used + +mfp= +Target RejectNegative Joined Undocumented Var(target_fpe_name) + +;; Now ignored. +mfpe +Target RejectNegative Mask(FPE) Undocumented + +mfpe= +Target RejectNegative Joined Undocumented Var(target_fpe_name) + +mfpu= +Target RejectNegative Joined Var(target_fpu_name) +Specify the name of the target floating point hardware/format + +mhard-float +Target RejectNegative +Alias for -mfloat-abi=hard + +mlittle-endian +Target Report RejectNegative InverseMask(BIG_END) +Assume target CPU is configured as little endian + +mlong-calls +Target Report Mask(LONG_CALLS) +Generate call insns as indirect calls, if necessary + +mpic-register= +Target RejectNegative Joined Var(arm_pic_register_string) +Specify the register to be used for PIC addressing + +mpoke-function-name +Target Report Mask(POKE_FUNCTION_NAME) +Store function names in object code + +msched-prolog +Target Report Mask(SCHED_PROLOG) +Permit scheduling of a function's prologue sequence + +msingle-pic-base +Target Report Mask(SINGLE_PIC_BASE) +Do not load the PIC register in function prologues + +msoft-float +Target RejectNegative +Alias for -mfloat-abi=soft + +mstructure-size-boundary= +Target RejectNegative Joined Var(structure_size_string) +Specify the minimum bit alignment of structures + +mthumb +Target Report Mask(THUMB) +Compile for the Thumb not the ARM + +mthumb-interwork +Target Report Mask(INTERWORK) +Support calls between Thumb and ARM instruction sets + +mtp= +Target RejectNegative Joined Var(target_thread_switch) +Specify how to access the thread pointer + +mtpcs-frame +Target Report Mask(TPCS_FRAME) +Thumb: Generate (non-leaf) stack frames even if not needed + +mtpcs-leaf-frame +Target Report Mask(TPCS_LEAF_FRAME) +Thumb: Generate (leaf) stack frames even if not needed + +mtune= +Target RejectNegative Joined +Tune code for the given processor + +mwords-little-endian +Target Report RejectNegative Mask(LITTLE_WORDS) +Assume big endian bytes, little endian words diff --git a/contrib/gcc/config/arm/arm1020e.md b/contrib/gcc/config/arm/arm1020e.md new file mode 100644 index 00000000000..32a5d95e965 --- /dev/null +++ b/contrib/gcc/config/arm/arm1020e.md @@ -0,0 +1,388 @@ +;; ARM 1020E & ARM 1022E Pipeline Description +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Contributed by Richard Earnshaw (richard.earnshaw@arm.com) +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1020E Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1020E core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1020e") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are two pipelines: +;; +;; - An Arithmetic Logic Unit (ALU) pipeline. +;; +;; The ALU pipeline has fetch, issue, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. +;; +;; - A Load-Store Unit (LSU) pipeline. +;; +;; The LSU pipeline has decode, execute, memory, and write stages. +;; We only model the execute, memory and write stages. + +(define_cpu_unit "1020a_e,1020a_m,1020a_w" "arm1020e") +(define_cpu_unit "1020l_e,1020l_m,1020l_w" "arm1020e") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "1020alu_op" 1 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "alu")) + "1020a_e,1020a_m,1020a_w") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "1020alu_shift_op" 1 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "alu_shift")) + "1020a_e,1020a_m,1020a_w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "1020alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "alu_shift_reg")) + "1020a_e*2,1020a_m,1020a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. + +;; The result of the "smul" and "smulw" instructions is not available +;; until after the memory stage. +(define_insn_reservation "1020mult1" 2 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "smulxy,smulwy")) + "1020a_e,1020a_m,1020a_w") + +;; The "smlaxy" and "smlawx" instructions require two iterations through +;; the execute stage; the result is available immediately following +;; the execute stage. +(define_insn_reservation "1020mult2" 2 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "smlaxy,smlalxy,smlawx")) + "1020a_e*2,1020a_m,1020a_w") + +;; The "smlalxy", "mul", and "mla" instructions require two iterations +;; through the execute stage; the result is not available until after +;; the memory stage. +(define_insn_reservation "1020mult3" 3 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "smlalxy,mul,mla")) + "1020a_e*2,1020a_m,1020a_w") + +;; The "muls" and "mlas" instructions loop in the execute stage for +;; four iterations in order to set the flags. The value result is +;; available after three iterations. +(define_insn_reservation "1020mult4" 3 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "muls,mlas")) + "1020a_e*4,1020a_m,1020a_w") + +;; Long multiply instructions that produce two registers of +;; output (such as umull) make their results available in two cycles; +;; the least significant word is available before the most significant +;; word. That fact is not modeled; instead, the instructions are +;; described.as if the entire result was available at the end of the +;; cycle in which both words are available. + +;; The "umull", "umlal", "smull", and "smlal" instructions all take +;; three iterations through the execute cycle, and make their results +;; available after the memory cycle. +(define_insn_reservation "1020mult5" 4 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "1020a_e*3,1020a_m,1020a_w") + +;; The "umulls", "umlals", "smulls", and "smlals" instructions loop in +;; the execute stage for five iterations in order to set the flags. +;; The value result is available after four iterations. +(define_insn_reservation "1020mult6" 4 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "1020a_e*5,1020a_m,1020a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; LSU instructions require six cycles to execute. They use the ALU +;; pipeline in all but the 5th cycle, and the LSU pipeline in cycles +;; three through six. +;; Loads and stores which use a scaled register offset or scaled +;; register pre-indexed addressing mode take three cycles EXCEPT for +;; those that are base + offset with LSL of 0 or 2, or base - offset +;; with LSL of zero. The remainder take 1 cycle to execute. +;; For 4byte loads there is a bypass from the load stage + +(define_insn_reservation "1020load1_op" 2 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "load_byte,load1")) + "1020a_e+1020l_e,1020l_m,1020l_w") + +(define_insn_reservation "1020store1_op" 0 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "store1")) + "1020a_e+1020l_e,1020l_m,1020l_w") + +;; A load's result can be stored by an immediately following store +(define_bypass 1 "1020load1_op" "1020store1_op" "arm_no_early_store_addr_dep") + +;; On a LDM/STM operation, the LSU pipeline iterates until all of the +;; registers have been processed. +;; +;; The time it takes to load the data depends on whether or not the +;; base address is 64-bit aligned; if it is not, an additional cycle +;; is required. This model assumes that the address is always 64-bit +;; aligned. Because the processor can load two registers per cycle, +;; that assumption means that we use the same instruction reservations +;; for loading 2k and 2k - 1 registers. +;; +;; The ALU pipeline is decoupled after the first cycle unless there is +;; a register dependency; the dependency is cleared as soon as the LDM/STM +;; has dealt with the corresponding register. So for example, +;; stmia sp, {r0-r3} +;; add r0, r0, #4 +;; will have one fewer stalls than +;; stmia sp, {r0-r3} +;; add r3, r3, #4 +;; +;; As with ALU operations, if one of the destination registers is the +;; PC, there are additional stalls; that is not modeled. + +(define_insn_reservation "1020load2_op" 2 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "load2")) + "1020a_e+1020l_e,1020l_m,1020l_w") + +(define_insn_reservation "1020store2_op" 0 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "store2")) + "1020a_e+1020l_e,1020l_m,1020l_w") + +(define_insn_reservation "1020load34_op" 3 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "load3,load4")) + "1020a_e+1020l_e,1020l_e+1020l_m,1020l_m,1020l_w") + +(define_insn_reservation "1020store34_op" 0 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "store3,store4")) + "1020a_e+1020l_e,1020l_e+1020l_m,1020l_m,1020l_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "1020branch_op" 0 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "branch")) + "1020a_e") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to positive infinity. + +(define_insn_reservation "1020call_op" 32 + (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "type" "call")) + "1020a_e*32") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; VFP +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_cpu_unit "v10_fmac" "arm1020e") + +(define_cpu_unit "v10_ds" "arm1020e") + +(define_cpu_unit "v10_fmstat" "arm1020e") + +(define_cpu_unit "v10_ls1,v10_ls2,v10_ls3" "arm1020e") + +;; fmstat is a serializing instruction. It will stall the core until +;; the mac and ds units have completed. +(exclusion_set "v10_fmac,v10_ds" "v10_fmstat") + +(define_attr "vfp10" "yes,no" + (const (if_then_else (and (eq_attr "tune" "arm1020e,arm1022e") + (eq_attr "fpu" "vfp")) + (const_string "yes") (const_string "no")))) + +;; The VFP "type" attributes differ from those used in the FPA model. +;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp. +;; farith Most arithmetic insns. +;; fmul Double precision multiply. +;; fdivs Single precision sqrt or division. +;; fdivd Double precision sqrt or division. +;; f_flag fmstat operation +;; f_load Floating point load from memory. +;; f_store Floating point store to memory. +;; f_2_r Transfer vfp to arm reg. +;; r_2_f Transfer arm to vfp reg. + +;; Note, no instruction can issue to the VFP if the core is stalled in the +;; first execute state. We model this by using 1020a_e in the first cycle. +(define_insn_reservation "v10_ffarith" 5 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "ffarith")) + "1020a_e+v10_fmac") + +(define_insn_reservation "v10_farith" 5 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "farith")) + "1020a_e+v10_fmac") + +(define_insn_reservation "v10_cvt" 5 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_cvt")) + "1020a_e+v10_fmac") + +(define_insn_reservation "v10_fmul" 6 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "fmul")) + "1020a_e+v10_fmac*2") + +(define_insn_reservation "v10_fdivs" 18 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "fdivs")) + "1020a_e+v10_ds*14") + +(define_insn_reservation "v10_fdivd" 32 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "fdivd")) + "1020a_e+v10_fmac+v10_ds*28") + +(define_insn_reservation "v10_floads" 4 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_loads")) + "1020a_e+1020l_e+v10_ls1,v10_ls2") + +;; We model a load of a double as needing all the vfp ls* stage in cycle 1. +;; This gives the correct mix between single-and double loads where a flds +;; followed by and fldd will stall for one cycle, but two back-to-back fldd +;; insns stall for two cycles. +(define_insn_reservation "v10_floadd" 5 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_loadd")) + "1020a_e+1020l_e+v10_ls1+v10_ls2+v10_ls3,v10_ls2+v10_ls3,v10_ls3") + +;; Moves to/from arm regs also use the load/store pipeline. + +(define_insn_reservation "v10_c2v" 4 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "r_2_f")) + "1020a_e+1020l_e+v10_ls1,v10_ls2") + +(define_insn_reservation "v10_fstores" 1 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_stores")) + "1020a_e+1020l_e+v10_ls1,v10_ls2") + +(define_insn_reservation "v10_fstored" 1 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_stored")) + "1020a_e+1020l_e+v10_ls1+v10_ls2+v10_ls3,v10_ls2+v10_ls3,v10_ls3") + +(define_insn_reservation "v10_v2c" 1 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_2_r")) + "1020a_e+1020l_e,1020l_m,1020l_w") + +(define_insn_reservation "v10_to_cpsr" 2 + (and (eq_attr "vfp10" "yes") + (eq_attr "type" "f_flag")) + "1020a_e+v10_fmstat,1020a_e+1020l_e,1020l_m,1020l_w") + +;; VFP bypasses + +;; There are bypasses for most operations other than store + +(define_bypass 3 + "v10_c2v,v10_floads" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd,v10_cvt") + +(define_bypass 4 + "v10_floadd" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd") + +;; Arithmetic to other arithmetic saves a cycle due to forwarding +(define_bypass 4 + "v10_ffarith,v10_farith" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd") + +(define_bypass 5 + "v10_fmul" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd") + +(define_bypass 17 + "v10_fdivs" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd") + +(define_bypass 31 + "v10_fdivd" + "v10_ffarith,v10_farith,v10_fmul,v10_fdivs,v10_fdivd") + +;; VFP anti-dependencies. + +;; There is one anti-dependence in the following case (not yet modelled): +;; - After a store: one extra cycle for both fsts and fstd +;; Note, back-to-back fstd instructions will overload the load/store datapath +;; causing a two-cycle stall. diff --git a/contrib/gcc/config/arm/arm1026ejs.md b/contrib/gcc/config/arm/arm1026ejs.md new file mode 100644 index 00000000000..a2404eceaa7 --- /dev/null +++ b/contrib/gcc/config/arm/arm1026ejs.md @@ -0,0 +1,241 @@ +;; ARM 1026EJ-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1026EJ-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1026EJ-S core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are two pipelines: +;; +;; - An Arithmetic Logic Unit (ALU) pipeline. +;; +;; The ALU pipeline has fetch, issue, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. +;; +;; - A Load-Store Unit (LSU) pipeline. +;; +;; The LSU pipeline has decode, execute, memory, and write stages. +;; We only model the execute, memory and write stages. + +(define_cpu_unit "a_e,a_m,a_w" "arm1026ejs") +(define_cpu_unit "l_e,l_m,l_w" "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "alu_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "alu_shift_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift_reg")) + "a_e*2,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. + +;; The result of the "smul" and "smulw" instructions is not available +;; until after the memory stage. +(define_insn_reservation "mult1" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smulxy,smulwy")) + "a_e,a_m,a_w") + +;; The "smlaxy" and "smlawx" instructions require two iterations through +;; the execute stage; the result is available immediately following +;; the execute stage. +(define_insn_reservation "mult2" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlaxy,smlalxy,smlawx")) + "a_e*2,a_m,a_w") + +;; The "smlalxy", "mul", and "mla" instructions require two iterations +;; through the execute stage; the result is not available until after +;; the memory stage. +(define_insn_reservation "mult3" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlalxy,mul,mla")) + "a_e*2,a_m,a_w") + +;; The "muls" and "mlas" instructions loop in the execute stage for +;; four iterations in order to set the flags. The value result is +;; available after three iterations. +(define_insn_reservation "mult4" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "muls,mlas")) + "a_e*4,a_m,a_w") + +;; Long multiply instructions that produce two registers of +;; output (such as umull) make their results available in two cycles; +;; the least significant word is available before the most significant +;; word. That fact is not modeled; instead, the instructions are +;; described.as if the entire result was available at the end of the +;; cycle in which both words are available. + +;; The "umull", "umlal", "smull", and "smlal" instructions all take +;; three iterations through the execute cycle, and make their results +;; available after the memory cycle. +(define_insn_reservation "mult5" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "a_e*3,a_m,a_w") + +;; The "umulls", "umlals", "smulls", and "smlals" instructions loop in +;; the execute stage for five iterations in order to set the flags. +;; The value result is available after four iterations. +(define_insn_reservation "mult6" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "a_e*5,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; LSU instructions require six cycles to execute. They use the ALU +;; pipeline in all but the 5th cycle, and the LSU pipeline in cycles +;; three through six. +;; Loads and stores which use a scaled register offset or scaled +;; register pre-indexed addressing mode take three cycles EXCEPT for +;; those that are base + offset with LSL of 0 or 2, or base - offset +;; with LSL of zero. The remainder take 1 cycle to execute. +;; For 4byte loads there is a bypass from the load stage + +(define_insn_reservation "load1_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load_byte,load1")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store1_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store1")) + "a_e+l_e,l_m,a_w+l_w") + +;; A load's result can be stored by an immediately following store +(define_bypass 1 "load1_op" "store1_op" "arm_no_early_store_addr_dep") + +;; On a LDM/STM operation, the LSU pipeline iterates until all of the +;; registers have been processed. +;; +;; The time it takes to load the data depends on whether or not the +;; base address is 64-bit aligned; if it is not, an additional cycle +;; is required. This model assumes that the address is always 64-bit +;; aligned. Because the processor can load two registers per cycle, +;; that assumption means that we use the same instruction reservations +;; for loading 2k and 2k - 1 registers. +;; +;; The ALU pipeline is stalled until the completion of the last memory +;; stage in the LSU pipeline. That is modeled by keeping the ALU +;; execute stage busy until that point. +;; +;; As with ALU operations, if one of the destination registers is the +;; PC, there are additional stalls; that is not modeled. + +(define_insn_reservation "load2_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store2_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "load34_op" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load3,load4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +(define_insn_reservation "store34_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store3,store4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "branch_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "branch")) + "nothing") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to positive infinity. + +(define_insn_reservation "call_op" 32 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "call")) + "nothing") diff --git a/contrib/gcc/config/arm/arm1136jfs.md b/contrib/gcc/config/arm/arm1136jfs.md new file mode 100644 index 00000000000..308669750c2 --- /dev/null +++ b/contrib/gcc/config/arm/arm1136jfs.md @@ -0,0 +1,377 @@ +;; ARM 1136J[F]-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1136JF-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1136J-S and 1136JF-S cores. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1136jfs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are three distinct pipelines (page 1-26 and following): +;; +;; - A 4-stage decode pipeline, shared by all three. It has fetch (1), +;; fetch (2), decode, and issue stages. Since this is always involved, +;; we do not model it in the scheduler. +;; +;; - A 4-stage ALU pipeline. It has shifter, ALU (main integer operations), +;; and saturation stages. The fourth stage is writeback; see below. +;; +;; - A 4-stage multiply-accumulate pipeline. It has three stages, called +;; MAC1 through MAC3, and a fourth writeback stage. +;; +;; The 4th-stage writeback is shared between the ALU and MAC pipelines, +;; which operate in lockstep. Results from either pipeline will be +;; moved into the writeback stage. Because the two pipelines operate +;; in lockstep, we schedule them as a single "execute" pipeline. +;; +;; - A 4-stage LSU pipeline. It has address generation, data cache (1), +;; data cache (2), and writeback stages. (Note that this pipeline, +;; including the writeback stage, is independent from the ALU & LSU pipes.) + +(define_cpu_unit "e_1,e_2,e_3,e_wb" "arm1136jfs") ; ALU and MAC +; e_1 = Sh/Mac1, e_2 = ALU/Mac2, e_3 = SAT/Mac3 +(define_cpu_unit "l_a,l_dc1,l_dc2,l_wb" "arm1136jfs") ; Load/Store + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require eight cycles to execute, and use the ALU +;; pipeline in each of the eight stages. The results are available +;; after the alu stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modelled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "11_alu_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "11_alu_shift_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the shift stage. +(define_insn_reservation "11_alu_shift_reg_op" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift_reg")) + "e_1*2,e_2,e_3,e_wb") + +;; alu_ops can start sooner, if there is no shifter dependency +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_op") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_op") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the first two execute stages until +;; the instruction has been passed through the multiplier array enough +;; times. + +;; Multiply and multiply-accumulate results are available after four stages. +(define_insn_reservation "11_mult1" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "mul,mla")) + "e_1*2,e_2,e_3,e_wb") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult2" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "muls,mlas")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult1,11_mult2" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_op") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Signed and unsigned multiply long results are available across two cycles; +;; the less significant word is available one cycle before the more significant +;; word. Here we conservatively wait until both are available, which is +;; after three iterations and the memory cycle. The same is also true of +;; the two multiply-accumulate instructions. +(define_insn_reservation "11_mult3" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smull,umull,smlal,umlal")) + "e_1*3,e_2,e_3,e_wb*2") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult4" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulls,umulls,smlals,umlals")) + "e_1*3,e_2,e_3,e_wb*2") + +(define_bypass 4 "11_mult3,11_mult4" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_op") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Various 16x16->32 multiplies and multiply-accumulates, using combinations +;; of high and low halves of the argument registers. They take a single +;; pass through the pipeline and make the result available after three +;; cycles. +(define_insn_reservation "11_mult5" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulxy,smlaxy,smulwy,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx")) + "e_1,e_2,e_3,e_wb") + +(define_bypass 2 "11_mult5" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_mult5" + "11_alu_op") +(define_bypass 2 "11_mult5" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_mult5" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_mult5" + "11_store1" + "arm_no_early_store_addr_dep") + +;; The same idea, then the 32-bit result is added to a 64-bit quantity. +(define_insn_reservation "11_mult6" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smlalxy")) + "e_1*2,e_2,e_3,e_wb*2") + +;; Signed 32x32 multiply, then the most significant 32 bits are extracted +;; and are available after the memory stage. +(define_insn_reservation "11_mult7" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smmul,smmulr")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult6,11_mult7" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_op") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_store1" + "arm_no_early_store_addr_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; These vary greatly depending on their arguments and the results of +;; stat prediction. Cycle count ranges from zero (unconditional branch, +;; folded dynamic prediction) to seven (incorrect predictions, etc). We +;; assume an optimal case for now, because the cost of a cache miss +;; overwhelms the cost of everything else anyhow. + +(define_insn_reservation "11_branches" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "branch")) + "nothing") + +;; Call latencies are not predictable. A semi-arbitrary very large +;; number is used as "positive infinity" so that everything should be +;; finished by the time of return. +(define_insn_reservation "11_call" 32 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "call")) + "nothing") + +;; Branches are predicted. A correctly predicted branch will be no +;; cost, but we're conservative here, and use the timings a +;; late-register would give us. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_branches") +(define_bypass 2 "11_alu_shift_reg_op" + "11_branches") +(define_bypass 2 "11_load1,11_load2" + "11_branches") +(define_bypass 3 "11_load34" + "11_branches") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback. +;; These models assume that all memory references hit in dcache. Also, +;; if the PC is one of the registers involved, there are additional stalls +;; not modelled here. Addressing modes are also not modelled. + +(define_insn_reservation "11_load1" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load byte results are not available until the writeback stage, where +;; the correct byte is extracted. + +(define_insn_reservation "11_loadb" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load_byte")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store1" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store double words into adjacent registers. The timing and +;; latencies are different depending on whether the address is 64-bit +;; aligned. This model assumes that it is. +(define_insn_reservation "11_load2" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store2" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store multiple registers. Two registers are stored per cycle. +;; Actual timing depends on how many registers are affected, so we +;; optimistically schedule a low latency. +(define_insn_reservation "11_load34" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load3,load4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +(define_insn_reservation "11_store34" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store3,store4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +;; A store can start immediately after an alu op, if that alu op does +;; not provide part of the address to access. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_store1" + "arm_no_early_store_addr_dep") + +;; An alu op can start sooner after a load, if that alu op does not +;; have an early register dependency on the load +(define_bypass 2 "11_load1" + "11_alu_op") +(define_bypass 2 "11_load1" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_load1" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 3 "11_loadb" + "11_alu_op") +(define_bypass 3 "11_loadb" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_loadb" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +;; A mul op can start sooner after a load, if that mul op does not +;; have an early multiply dependency +(define_bypass 2 "11_load1" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_load34" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_loadb" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;; A store can start sooner after a load, if that load does not +;; produce part of the address to access +(define_bypass 2 "11_load1" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 3 "11_loadb" + "11_store1" + "arm_no_early_store_addr_dep") diff --git a/contrib/gcc/config/arm/arm926ejs.md b/contrib/gcc/config/arm/arm926ejs.md new file mode 100644 index 00000000000..244e3a91c1b --- /dev/null +++ b/contrib/gcc/config/arm/arm926ejs.md @@ -0,0 +1,188 @@ +;; ARM 926EJ-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 926EJ-S core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm926ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There is a single pipeline +;; +;; The ALU pipeline has fetch, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. + +(define_cpu_unit "e,m,w" "arm926ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "9_alu_op" 1 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "alu,alu_shift")) + "e,m,w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "9_alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "alu_shift_reg")) + "e*2,m,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. Multiply operations occur in both the execute and memory +;; stages of the pipeline + +(define_insn_reservation "9_mult1" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smlalxy,mul,mla")) + "e*2,m,w") + +(define_insn_reservation "9_mult2" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "muls,mlas")) + "e*3,m,w") + +(define_insn_reservation "9_mult3" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "e*3,m,w") + +(define_insn_reservation "9_mult4" 5 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "e*4,m,w") + +(define_insn_reservation "9_mult5" 2 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smulxy,smlaxy,smlawx")) + "e,m,w") + +(define_insn_reservation "9_mult6" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "insn" "smlalxy")) + "e*2,m,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; Loads with a shifted offset take 3 cycles, and are (a) probably the +;; most common and (b) the pessimistic assumption will lead to fewer stalls. +(define_insn_reservation "9_load1_op" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load1,load_byte")) + "e*2,m,w") + +(define_insn_reservation "9_store1_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store1")) + "e,m,w") + +;; multiple word loads and stores +(define_insn_reservation "9_load2_op" 3 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load2")) + "e,m*2,w") + +(define_insn_reservation "9_load3_op" 4 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load3")) + "e,m*3,w") + +(define_insn_reservation "9_load4_op" 5 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "load4")) + "e,m*4,w") + +(define_insn_reservation "9_store2_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store2")) + "e,m*2,w") + +(define_insn_reservation "9_store3_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store3")) + "e,m*3,w") + +(define_insn_reservation "9_store4_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "store4")) + "e,m*4,w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "9_branch_op" 0 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "branch")) + "nothing") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to positive infinity. + +(define_insn_reservation "9_call_op" 32 + (and (eq_attr "tune" "arm926ejs") + (eq_attr "type" "call")) + "nothing") diff --git a/contrib/gcc/config/arm/bpabi.S b/contrib/gcc/config/arm/bpabi.S new file mode 100644 index 00000000000..e492d4be610 --- /dev/null +++ b/contrib/gcc/config/arm/bpabi.S @@ -0,0 +1,95 @@ +/* Miscellaneous BPABI functions. + + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#ifdef __ARMEB__ +#define xxh r0 +#define xxl r1 +#define yyh r2 +#define yyl r3 +#else +#define xxh r1 +#define xxl r0 +#define yyh r3 +#define yyl r2 +#endif + +#ifdef L_aeabi_lcmp + +ARM_FUNC_START aeabi_lcmp + subs ip, xxl, yyl + sbcs ip, xxh, yyh + subeqs ip, xxl, yyl + mov r0, ip + RET + FUNC_END aeabi_lcmp + +#endif /* L_aeabi_lcmp */ + +#ifdef L_aeabi_ulcmp + +ARM_FUNC_START aeabi_ulcmp + cmp xxh, yyh + movlo r0, #-1 + movhi r0, #1 + RETc(ne) + cmp xxl, yyl + movlo r0, #-1 + movhi r0, #1 + moveq r0, #0 + RET + FUNC_END aeabi_ulcmp + +#endif /* L_aeabi_ulcmp */ + +#ifdef L_aeabi_ldivmod + +ARM_FUNC_START aeabi_ldivmod + sub sp, sp, #8 + stmfd sp!, {sp, lr} + bl SYM(__gnu_ldivmod_helper) __PLT__ + ldr lr, [sp, #4] + add sp, sp, #8 + ldmfd sp!, {r2, r3} + RET + +#endif /* L_aeabi_ldivmod */ + +#ifdef L_aeabi_uldivmod + +ARM_FUNC_START aeabi_uldivmod + sub sp, sp, #8 + stmfd sp!, {sp, lr} + bl SYM(__gnu_uldivmod_helper) __PLT__ + ldr lr, [sp, #4] + add sp, sp, #8 + ldmfd sp!, {r2, r3} + RET + +#endif /* L_aeabi_divmod */ + diff --git a/contrib/gcc/config/arm/bpabi.c b/contrib/gcc/config/arm/bpabi.c new file mode 100644 index 00000000000..69f6e4eded9 --- /dev/null +++ b/contrib/gcc/config/arm/bpabi.c @@ -0,0 +1,61 @@ +/* Miscellaneous BPABI functions. + + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +extern long long __divdi3 (long long, long long); +extern unsigned long long __udivdi3 (unsigned long long, + unsigned long long); +extern long long __gnu_ldivmod_helper (long long, long long, long long *); +extern unsigned long long __gnu_uldivmod_helper (unsigned long long, + unsigned long long, + unsigned long long *); + + +long long +__gnu_ldivmod_helper (long long a, + long long b, + long long *remainder) +{ + long long quotient; + + quotient = __divdi3 (a, b); + *remainder = a - b * quotient; + return quotient; +} + +unsigned long long +__gnu_uldivmod_helper (unsigned long long a, + unsigned long long b, + unsigned long long *remainder) +{ + unsigned long long quotient; + + quotient = __udivdi3 (a, b); + *remainder = a - b * quotient; + return quotient; +} diff --git a/contrib/gcc/config/arm/bpabi.h b/contrib/gcc/config/arm/bpabi.h new file mode 100644 index 00000000000..4c730885ec0 --- /dev/null +++ b/contrib/gcc/config/arm/bpabi.h @@ -0,0 +1,118 @@ +/* Configuration file for ARM BPABI targets. + Copyright (C) 2004, 2005 + Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Use the AAPCS ABI by default. */ +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS + +/* Assume that AAPCS ABIs should adhere to the full BPABI. */ +#define TARGET_BPABI (TARGET_AAPCS_BASED) + +/* BPABI targets use EABI frame unwinding tables. */ +#define TARGET_UNWIND_INFO 1 + +/* Section 4.1 of the AAPCS requires the use of VFP format. */ +#undef FPUTYPE_DEFAULT +#define FPUTYPE_DEFAULT FPUTYPE_VFP + +/* EABI targets should enable interworking by default. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT MASK_INTERWORK + +/* The ARM BPABI functions return a boolean; they use no special + calling convention. */ +#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI + +/* The BPABI integer comparison routines return { -1, 0, 1 }. */ +#define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI + +/* Tell the assembler to build BPABI binaries. */ +#undef SUBTARGET_EXTRA_ASM_SPEC +#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}" + +/* The generic link spec in elf.h does not support shared libraries. */ +#undef LINK_SPEC +#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \ + "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \ + "-X" + +#if defined (__thumb__) +#define RENAME_LIBRARY_SET ".thumb_set" +#else +#define RENAME_LIBRARY_SET ".set" +#endif + +/* Make __aeabi_AEABI_NAME an alias for __GCC_NAME. */ +#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \ + __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n" \ + RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME \ + ", __" #GCC_NAME "\n"); + +/* Give some libgcc functions an additional __aeabi name. */ +#ifdef L_muldi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul) +#endif +#ifdef L_muldi3 +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul) +#endif +#ifdef L_fixdfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz) +#endif +#ifdef L_fixunsdfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz) +#endif +#ifdef L_fixsfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz) +#endif +#ifdef L_fixunssfdi +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz) +#endif +#ifdef L_floatdidf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d) +#endif +#ifdef L_floatdisf +#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f) +#endif + +/* The BPABI requires that we always use an out-of-line implementation + of RTTI comparison, even if the target supports weak symbols, + because the same object file might be used on a target that does + not support merging symbols across DLL boundaries. This macro is + broken out separately so that it can be used within + TARGET_OS_CPP_BUILTINS in configuration files for systems based on + the BPABI. */ +#define TARGET_BPABI_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ + } \ + while (false) + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + TARGET_BPABI_CPP_BUILTINS() + +/* The BPABI specifies the use of .{init,fini}_array. Therefore, we + do not want GCC to put anything into the .{init,fini} sections. */ +#undef INIT_SECTION_ASM_OP +#undef FINI_SECTION_ASM_OP +#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP +#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP diff --git a/contrib/gcc/config/arm/cirrus.md b/contrib/gcc/config/arm/cirrus.md index 0da8469ddd2..b857cbb2084 100644 --- a/contrib/gcc/config/arm/cirrus.md +++ b/contrib/gcc/config/arm/cirrus.md @@ -1,5 +1,5 @@ ;; Cirrus EP9312 "Maverick" ARM floating point co-processor description. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; Written by Aldy Hernandez (aldyh@redhat.com) @@ -17,8 +17,8 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ; Cirrus types for invalid insn combinations @@ -34,7 +34,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (plus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadd64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -44,7 +44,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (plus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfadd32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -54,7 +54,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (plus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadds%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -64,7 +64,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (plus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfaddd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -74,7 +74,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (minus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsub64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -84,7 +84,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (minus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsub32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -94,7 +94,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (minus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubs%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -104,7 +104,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (minus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -114,7 +114,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmul32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -124,7 +124,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (mult:DI (match_operand:DI 2 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmul64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -136,7 +136,7 @@ (mult:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")) (match_operand:SI 3 "cirrus_fp_register" "0")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmac32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -149,7 +149,7 @@ (match_operand:SI 1 "cirrus_fp_register" "0") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 3 "cirrus_fp_register" "v"))))] - "0 && TARGET_ARM && TARGET_CIRRUS" + "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmsc32%?\\t%V0, %V2, %V3" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -159,7 +159,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (mult:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuls%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -169,7 +169,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (mult:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuld%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -179,7 +179,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -188,7 +188,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashiftrt:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -197,7 +197,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfrshl32%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -206,7 +206,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfrshl64%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -215,7 +215,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -224,7 +224,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashiftrt:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -232,7 +232,7 @@ (define_insn "*cirrus_absdi2" [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (abs:DI (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabs64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -242,7 +242,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (neg:DI (match_operand:DI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfneg64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -250,7 +250,7 @@ (define_insn "*cirrus_negsi2" [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (neg:SI (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfneg32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -258,7 +258,7 @@ (define_insn "*cirrus_negsf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (neg:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegs%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -266,7 +266,7 @@ (define_insn "*cirrus_negdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (neg:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -276,7 +276,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (abs:SI (match_operand:SI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfabs32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -284,7 +284,7 @@ (define_insn "*cirrus_abssf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (abs:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabss%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -292,7 +292,7 @@ (define_insn "*cirrus_absdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (abs:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -302,7 +302,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -312,7 +312,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -321,14 +321,14 @@ (define_insn "floatdisf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64s%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) (define_insn "floatdidf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64d%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) @@ -336,7 +336,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8") (set_attr "cirrus" "normal")] @@ -346,7 +346,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8")] ) @@ -355,7 +355,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float_truncate:SF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtds%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -363,23 +363,24 @@ (define_insn "*cirrus_extendsfdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float_extend:DF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) (define_insn "*cirrus_arm_movdi" [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,o<>,v,r,v,m,v") - (match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,m,v,v"))] - "TARGET_ARM && TARGET_CIRRUS" + (match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,mi,v,v"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "* { switch (which_alternative) { case 0: + return \"#\"; case 1: case 2: - return (output_move_double (operands)); + return output_move_double (operands); case 3: return \"cfmv64lr%?\\t%V0, %Q1\;cfmv64hr%?\\t%V0, %R1\"; case 4: return \"cfmvr64l%?\\t%Q0, %V1\;cfmvr64h%?\\t%R0, %V1\"; @@ -390,13 +391,13 @@ /* Shifting by 0 will just copy %1 into %0. */ case 7: return \"cfsh64%?\\t%V0, %V1, #0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" " 8, 8, 8, 8, 8, 4, 4, 4") - (set_attr "type" " *,load,store2, *, *, load,store2, *") - (set_attr "pool_range" " *,1020, *, *, *, *, *, *") - (set_attr "neg_pool_range" " *,1012, *, *, *, *, *, *") + (set_attr "type" " *,load2,store2, *, *, load2,store2, *") + (set_attr "pool_range" " *,1020, *, *, *, 1020, *, *") + (set_attr "neg_pool_range" " *,1012, *, *, *, 1008, *, *") (set_attr "cirrus" "not, not, not,move,normal,double,double,normal")] ) @@ -406,7 +407,7 @@ (define_insn "*cirrus_arm_movsi_insn" [(set (match_operand:SI 0 "general_operand" "=r,r,r,m,*v,r,*v,T,*v") (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,*v,T,*v,*v"))] - "TARGET_ARM && TARGET_CIRRUS && 0 + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0 && (register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" "@ @@ -419,7 +420,7 @@ cfldr32%?\\t%V0, %1 cfstr32%?\\t%V1, %0 cfsh32%?\\t%V0, %V1, #0" - [(set_attr "type" "*, *, load,store1, *, *, load,store1, *") + [(set_attr "type" "*, *, load1,store1, *, *, load1,store1, *") (set_attr "pool_range" "*, *, 4096, *, *, *, 1024, *, *") (set_attr "neg_pool_range" "*, *, 4084, *, *, *, 1012, *, *") (set_attr "cirrus" "not,not, not, not,move,normal,normal,normal,normal")] @@ -427,8 +428,8 @@ (define_insn "*cirrus_movsf_hard_insn" [(set (match_operand:SF 0 "nonimmediate_operand" "=v,v,v,r,m,r,r,m") - (match_operand:SF 1 "general_operand" "v,m,r,v,v,r,mE,r"))] - "TARGET_ARM && TARGET_CIRRUS + (match_operand:SF 1 "general_operand" "v,mE,r,v,v,r,mE,r"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -441,17 +442,17 @@ ldr%?\\t%0, %1\\t%@ float str%?\\t%1, %0\\t%@ float" [(set_attr "length" " *, *, *, *, *, 4, 4, 4") - (set_attr "type" " *, load, *, *,store1, *,load,store1") - (set_attr "pool_range" " *, *, *, *, *, *,4096, *") - (set_attr "neg_pool_range" " *, *, *, *, *, *,4084, *") + (set_attr "type" " *, load1, *, *,store1, *,load1,store1") + (set_attr "pool_range" " *, 1020, *, *, *, *,4096, *") + (set_attr "neg_pool_range" " *, 1008, *, *, *, *,4084, *") (set_attr "cirrus" "normal,normal,move,normal,normal,not, not, not")] ) (define_insn "*cirrus_movdf_hard_insn" [(set (match_operand:DF 0 "nonimmediate_operand" "=r,Q,r,m,r,v,v,v,r,m") - (match_operand:DF 1 "general_operand" "Q,r,r,r,mF,v,m,r,v,v"))] + (match_operand:DF 1 "general_operand" "Q,r,r,r,mF,v,mF,r,v,v"))] "TARGET_ARM - && TARGET_CIRRUS + && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -460,19 +461,20 @@ { case 0: return \"ldm%?ia\\t%m1, %M0\\t%@ double\"; case 1: return \"stm%?ia\\t%m0, %M1\\t%@ double\"; - case 2: case 3: case 4: return output_move_double (operands); + case 2: return \"#\"; + case 3: case 4: return output_move_double (operands); case 5: return \"cfcpyd%?\\t%V0, %V1\"; case 6: return \"cfldrd%?\\t%V0, %1\"; case 7: return \"cfmvdlr\\t%V0, %Q1\;cfmvdhr%?\\t%V0, %R1\"; case 8: return \"cfmvrdl%?\\t%Q0, %V1\;cfmvrdh%?\\t%R0, %V1\"; case 9: return \"cfstrd%?\\t%V1, %0\"; - default: abort (); + default: gcc_unreachable (); } }" - [(set_attr "type" "load,store2, *,store2,load, *, load, *, *,store2") + [(set_attr "type" "load1,store2, *,store2,load1, *, load1, *, *,store2") (set_attr "length" " 4, 4, 8, 8, 8, 4, 4, 8, 8, 4") - (set_attr "pool_range" " *, *, *, *, 252, *, *, *, *, *") - (set_attr "neg_pool_range" " *, *, *, *, 244, *, *, *, *, *") + (set_attr "pool_range" " *, *, *, *, 252, *, 1020, *, *, *") + (set_attr "neg_pool_range" " *, *, *, *, 244, *, 1008, *, *, *") (set_attr "cirrus" " not, not,not, not, not,normal,double,move,normal,double")] ) diff --git a/contrib/gcc/config/arm/coff.h b/contrib/gcc/config/arm/coff.h index d6a6651ba90..f4ad4162ea7 100644 --- a/contrib/gcc/config/arm/coff.h +++ b/contrib/gcc/config/arm/coff.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. For ARM with COFF object format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Doug Evans (devans@cygnus.com). @@ -18,8 +18,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Note - it is important that this definition matches the one in tcoff.h. */ #undef USER_LABEL_PREFIX @@ -30,12 +30,15 @@ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (ARM/coff)", stderr) +#undef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #ifndef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } + { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } #endif /* This is COFF, but prefer stabs. */ diff --git a/contrib/gcc/config/arm/constraints.md b/contrib/gcc/config/arm/constraints.md new file mode 100644 index 00000000000..790b7de4a51 --- /dev/null +++ b/contrib/gcc/config/arm/constraints.md @@ -0,0 +1,186 @@ +;; Constraint definitions for ARM and Thumb +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; Contributed by ARM Ltd. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; The following register constraints have been used: +;; - in ARM state: f, v, w, y, z +;; - in Thumb state: h, k, b +;; - in both states: l, c +;; In ARM state, 'l' is an alias for 'r' + +;; The following normal constraints have been used: +;; in ARM state: G, H, I, J, K, L, M +;; in Thumb state: I, J, K, L, M, N, O + +;; The following multi-letter normal constraints have been used: +;; in ARM state: Da, Db, Dc + +;; The following memory constraints have been used: +;; in ARM state: Q, Uq, Uv, Uy + + +(define_register_constraint "f" "TARGET_ARM ? FPA_REGS : NO_REGS" + "Legacy FPA registers @code{f0}-@code{f7}.") + +(define_register_constraint "v" "TARGET_ARM ? CIRRUS_REGS : NO_REGS" + "The Cirrus Maverick co-processor registers.") + +(define_register_constraint "w" "TARGET_ARM ? VFP_REGS : NO_REGS" + "The VFP registers @code{s0}-@code{s31}.") + +(define_register_constraint "y" "TARGET_REALLY_IWMMXT ? IWMMXT_REGS : NO_REGS" + "The Intel iWMMX co-processor registers.") + +(define_register_constraint "z" + "TARGET_REALLY_IWMMXT ? IWMMXT_GR_REGS : NO_REGS" + "The Intel iWMMX GR registers.") + +(define_register_constraint "l" "TARGET_THUMB ? LO_REGS : GENERAL_REGS" + "In Thumb state the core registers @code{r0}-@code{r7}.") + +(define_register_constraint "h" "TARGET_THUMB ? HI_REGS : NO_REGS" + "In Thumb state the core registers @code{r8}-@code{r15}.") + +(define_register_constraint "k" "TARGET_THUMB ? STACK_REG : NO_REGS" + "@internal + Thumb only. The stack register.") + +(define_register_constraint "b" "TARGET_THUMB ? BASE_REGS : NO_REGS" + "@internal + Thumb only. The union of the low registers and the stack register.") + +(define_register_constraint "c" "CC_REG" + "@internal The condition code register.") + +(define_constraint "I" + "In ARM state a constant that can be used as an immediate value in a Data + Processing instruction. In Thumb state a constant in the range 0-255." + (and (match_code "const_int") + (match_test "TARGET_ARM ? const_ok_for_arm (ival) + : ival >= 0 && ival <= 255"))) + +(define_constraint "J" + "In ARM state a constant in the range @minus{}4095-4095. In Thumb state + a constant in the range @minus{}255-@minus{}1." + (and (match_code "const_int") + (match_test "TARGET_ARM ? (ival >= -4095 && ival <= 4095) + : (ival >= -255 && ival <= -1)"))) + +(define_constraint "K" + "In ARM state a constant that satisfies the @code{I} constraint if inverted. + In Thumb state a constant that satisfies the @code{I} constraint multiplied + by any power of 2." + (and (match_code "const_int") + (match_test "TARGET_ARM ? const_ok_for_arm (~ival) + : thumb_shiftable_const (ival)"))) + +(define_constraint "L" + "In ARM state a constant that satisfies the @code{I} constraint if negated. + In Thumb state a constant in the range @minus{}7-7." + (and (match_code "const_int") + (match_test "TARGET_ARM ? const_ok_for_arm (-ival) + : (ival >= -7 && ival <= 7)"))) + +;; The ARM state version is internal... +;; @internal In ARM state a constant in the range 0-32 or any power of 2. +(define_constraint "M" + "In Thumb state a constant that is a multiple of 4 in the range 0-1020." + (and (match_code "const_int") + (match_test "TARGET_ARM ? ((ival >= 0 && ival <= 32) + || ((ival & (ival - 1)) == 0)) + : ((ival >= 0 && ival <= 1020) && ((ival & 3) == 0))"))) + +(define_constraint "N" + "In Thumb state a constant in the range 0-31." + (and (match_code "const_int") + (match_test "TARGET_THUMB && ival >= 0 && ival <= 31"))) + +(define_constraint "O" + "In Thumb state a constant that is a multiple of 4 in the range + @minus{}508-508." + (and (match_code "const_int") + (match_test "TARGET_THUMB && ival >= -508 && ival <= 508 + && ((ival & 3) == 0)"))) + +(define_constraint "G" + "In ARM state a valid FPA immediate constant." + (and (match_code "const_double") + (match_test "TARGET_ARM && arm_const_double_rtx (op)"))) + +(define_constraint "H" + "In ARM state a valid FPA immediate constant when negated." + (and (match_code "const_double") + (match_test "TARGET_ARM && neg_const_double_rtx_ok_for_fpa (op)"))) + +(define_constraint "Da" + "@internal + In ARM state a const_int, const_double or const_vector that can + be generated with two Data Processing insns." + (and (match_code "const_double,const_int,const_vector") + (match_test "TARGET_ARM && arm_const_double_inline_cost (op) == 2"))) + +(define_constraint "Db" + "@internal + In ARM state a const_int, const_double or const_vector that can + be generated with three Data Processing insns." + (and (match_code "const_double,const_int,const_vector") + (match_test "TARGET_ARM && arm_const_double_inline_cost (op) == 3"))) + +(define_constraint "Dc" + "@internal + In ARM state a const_int, const_double or const_vector that can + be generated with four Data Processing insns. This pattern is disabled + if optimizing for space or when we have load-delay slots to fill." + (and (match_code "const_double,const_int,const_vector") + (match_test "TARGET_ARM && arm_const_double_inline_cost (op) == 4 + && !(optimize_size || arm_ld_sched)"))) + +(define_memory_constraint "Uv" + "@internal + In ARM state a valid VFP load/store address." + (and (match_code "mem") + (match_test "TARGET_ARM && arm_coproc_mem_operand (op, FALSE)"))) + +(define_memory_constraint "Uy" + "@internal + In ARM state a valid iWMMX load/store address." + (and (match_code "mem") + (match_test "TARGET_ARM && arm_coproc_mem_operand (op, TRUE)"))) + +(define_memory_constraint "Uq" + "@internal + In ARM state an address valid in ldrsb instructions." + (and (match_code "mem") + (match_test "TARGET_ARM + && arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), + SIGN_EXTEND, 0)"))) + +(define_memory_constraint "Q" + "@internal + In ARM state an address that is a single base register." + (and (match_code "mem") + (match_test "REG_P (XEXP (op, 0))"))) + +;; We used to have constraint letters for S and R in ARM state, but +;; all uses of these now appear to have been removed. + +;; Additionally, we used to have a Q constraint in Thumb state, but +;; this wasn't really a valid memory constraint. Again, all uses of +;; this now seem to have been removed. diff --git a/contrib/gcc/config/arm/crti.asm b/contrib/gcc/config/arm/crti.asm index ac58e44838d..166a3ce34e8 100644 --- a/contrib/gcc/config/arm/crti.asm +++ b/contrib/gcc/config/arm/crti.asm @@ -21,8 +21,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause @@ -35,6 +35,12 @@ # .init sections. Users may put any desired instructions in those # sections. +#ifdef __ELF__ +#define TYPE(x) .type x,function +#else +#define TYPE(x) +#endif + # Note - this macro is complemented by the FUNC_END macro # in crtn.asm. If you change this macro you must also change # that macro match. @@ -42,12 +48,12 @@ #ifdef __thumb__ .thumb - push {r4, r5, r6, r7, lr} + push {r3, r4, r5, r6, r7, lr} #else .arm # Create a stack frame and save any call-preserved registers mov ip, sp - stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc} + stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc} sub fp, ip, #4 #endif .endm @@ -60,6 +66,7 @@ #ifdef __thumb__ .thumb_func #endif + TYPE(_init) _init: FUNC_START @@ -70,6 +77,7 @@ _init: #ifdef __thumb__ .thumb_func #endif + TYPE(_fini) _fini: FUNC_START diff --git a/contrib/gcc/config/arm/crtn.asm b/contrib/gcc/config/arm/crtn.asm index 9ad75e3f2aa..360afae9753 100644 --- a/contrib/gcc/config/arm/crtn.asm +++ b/contrib/gcc/config/arm/crtn.asm @@ -1,4 +1,4 @@ -# Copyright (C) 2001 Free Software Foundation, Inc. +# Copyright (C) 2001, 2004 Free Software Foundation, Inc. # Written By Nick Clifton # # This file is free software; you can redistribute it and/or modify it @@ -21,8 +21,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause @@ -43,28 +43,26 @@ # sequences here, it is just not worth it. Instead keep things # simple. Restore all the save resgisters, including the link # register and then perform the correct function return instruction. + # We also save/restore r3 to ensure stack alignment. .macro FUNC_END #ifdef __thumb__ .thumb - pop {r4, r5, r6, r7} + pop {r3, r4, r5, r6, r7} pop {r3} mov lr, r3 #else .arm - ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr} + sub sp, fp, #40 + ldmfd sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr} #endif #if defined __THUMB_INTERWORK__ || defined __thumb__ bx lr -#else -#ifdef __APCS_26__ - movs pc, lr #else mov pc, lr #endif -#endif .endm diff --git a/contrib/gcc/config/arm/ecos-elf.h b/contrib/gcc/config/arm/ecos-elf.h index d57fe8bb809..22eefe497dd 100644 --- a/contrib/gcc/config/arm/ecos-elf.h +++ b/contrib/gcc/config/arm/ecos-elf.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #undef TARGET_VERSION diff --git a/contrib/gcc/config/arm/elf.h b/contrib/gcc/config/arm/elf.h index cb38264181d..ae3d5338d8f 100644 --- a/contrib/gcc/config/arm/elf.h +++ b/contrib/gcc/config/arm/elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. For ARM with ELF obj format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Philip Blundell and Catherine Moore @@ -19,8 +19,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef OBJECT_FORMAT_ELF #error elf.h included before elfos.h @@ -46,7 +46,7 @@ #ifndef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC "\ -%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}" +%{mapcs-float:-mfloat}" #endif #ifndef ASM_SPEC @@ -58,6 +58,8 @@ %{mapcs-*:-mapcs-%*} \ %(subtarget_asm_float_spec) \ %{mthumb-interwork:-mthumb-interwork} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %(subtarget_extra_asm_spec)" #endif @@ -75,6 +77,7 @@ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ ASM_OUTPUT_LABEL(FILE, NAME); \ + ARM_OUTPUT_FN_UNWIND (FILE, TRUE); \ } \ while (0) @@ -83,6 +86,7 @@ #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ do \ { \ + ARM_OUTPUT_FN_UNWIND (FILE, FALSE); \ ARM_DECLARE_FUNCTION_SIZE (FILE, FNAME, DECL); \ if (!flag_inhibit_size_directive) \ ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ @@ -106,20 +110,21 @@ #endif #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif #ifndef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" } + { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork", "fno-leading-underscore" } #endif #define TARGET_ASM_FILE_START_APP_OFF true #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true -#undef TARGET_ASM_NAMED_SECTION -#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section - + +/* Output an element in the static constructor array. */ +#undef TARGET_ASM_CONSTRUCTOR +#define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor /* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */ #define NEED_PLT_RELOC flag_pic @@ -144,4 +149,5 @@ } \ while (0) -#define SUPPORTS_INIT_PRIORITY 1 +/* The EABI doesn't provide a way of implementing init_priority. */ +#define SUPPORTS_INIT_PRIORITY (!TARGET_AAPCS_BASED) diff --git a/contrib/gcc/config/arm/fpa.md b/contrib/gcc/config/arm/fpa.md index 3b6efbfbbda..b801f5a5391 100644 --- a/contrib/gcc/config/arm/fpa.md +++ b/contrib/gcc/config/arm/fpa.md @@ -1,6 +1,6 @@ ;;- Machine description for FPA co-processor for ARM cpus. ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003 Free Software Foundation, Inc. +;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -19,8 +19,8 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; FPA automaton. (define_automaton "armfp") @@ -100,8 +100,8 @@ (define_insn "*addsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") (plus:SF (match_operand:SF 1 "s_register_operand" "%f,f") - (match_operand:SF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?s\\t%0, %1, %2 suf%?s\\t%0, %1, #%N2" @@ -112,8 +112,8 @@ (define_insn "*adddf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (match_operand:DF 1 "s_register_operand" "%f,f") - (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -125,8 +125,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f,f")) - (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -139,7 +139,7 @@ (plus:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -151,7 +151,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -159,9 +159,9 @@ (define_insn "*subsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") - (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") + (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?s\\t%0, %1, %2 rsf%?s\\t%0, %2, %1" @@ -170,9 +170,9 @@ (define_insn "*subdf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") - (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") + (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -184,8 +184,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -193,10 +193,10 @@ (define_insn "*subdf_df_esfdf_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") + (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f,f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -210,7 +210,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -219,8 +219,8 @@ (define_insn "*mulsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (mult:SF (match_operand:SF 1 "s_register_operand" "f") - (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fml%?s\\t%0, %1, %2" [(set_attr "type" "ffmul") (set_attr "predicable" "yes")] @@ -229,8 +229,8 @@ (define_insn "*muldf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (mult:DF (match_operand:DF 1 "s_register_operand" "f") - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -240,8 +240,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -252,7 +252,7 @@ (mult:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -263,7 +263,7 @@ (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -273,9 +273,9 @@ (define_insn "*divsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f,f") - (div:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") - (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G") + (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ fdv%?s\\t%0, %1, %2 frd%?s\\t%0, %2, %1" @@ -285,9 +285,9 @@ (define_insn "*divdf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f,f") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") - (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G") + (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ dvf%?d\\t%0, %1, %2 rdf%?d\\t%0, %2, %1" @@ -299,8 +299,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (div:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -308,10 +308,10 @@ (define_insn "*divdf_df_esfdf_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") - (div:DF (match_operand:DF 1 "fpa_rhs_operand" "fG") + (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "fG") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rdf%?d\\t%0, %2, %1" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -323,7 +323,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -332,8 +332,8 @@ (define_insn "*modsf3_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (mod:SF (match_operand:SF 1 "s_register_operand" "f") - (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?s\\t%0, %1, %2" [(set_attr "type" "fdivs") (set_attr "predicable" "yes")] @@ -342,8 +342,8 @@ (define_insn "*moddf3_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (mod:DF (match_operand:DF 1 "s_register_operand" "f") - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -353,8 +353,8 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mod:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) - (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 2 "arm_float_rhs_operand" "fG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -365,7 +365,7 @@ (mod:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -377,7 +377,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -386,7 +386,7 @@ (define_insn "*negsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (neg:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -395,7 +395,7 @@ (define_insn "*negdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -405,7 +405,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -414,7 +414,7 @@ (define_insn "*abssf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (abs:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -423,7 +423,7 @@ (define_insn "*absdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -433,7 +433,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -442,7 +442,7 @@ (define_insn "*sqrtsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?s\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -451,7 +451,7 @@ (define_insn "*sqrtdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -461,7 +461,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -470,7 +470,7 @@ (define_insn "*floatsisf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (float:SF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?s\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -479,7 +479,7 @@ (define_insn "*floatsidf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float:DF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?d\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -488,7 +488,7 @@ (define_insn "*fix_truncsfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -497,7 +497,7 @@ (define_insn "*fix_truncdfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -507,7 +507,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -516,7 +516,7 @@ (define_insn "*extendsfdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -526,7 +526,7 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f, m,f,r,r,r, m") (match_operand:SF 1 "general_operand" "fG,H,mE,f,r,f,r,mE,r"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -542,7 +542,7 @@ [(set_attr "length" "4,4,4,4,8,8,4,4,4") (set_attr "predicable" "yes") (set_attr "type" - "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load,store1") + "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1") (set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*") (set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")] ) @@ -553,7 +553,7 @@ (match_operand:DF 1 "general_operand" "Q, r,r,r,mF,fG,H,mF,f,r, f"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -563,7 +563,8 @@ default: case 0: return \"ldm%?ia\\t%m1, %M0\\t%@ double\"; case 1: return \"stm%?ia\\t%m0, %M1\\t%@ double\"; - case 2: case 3: case 4: return output_move_double (operands); + case 2: return \"#\"; + case 3: case 4: return output_move_double (operands); case 5: return \"mvf%?d\\t%0, %1\"; case 6: return \"mnf%?d\\t%0, #%N1\"; case 7: return \"ldf%?d\\t%0, %1\"; @@ -576,45 +577,43 @@ [(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8") (set_attr "predicable" "yes") (set_attr "type" - "load,store2,*,store2,load,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") + "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") (set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*") (set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")] ) -;; Saving and restoring the floating point registers in the prologue should -;; be done in XFmode, even though we don't support that for anything else -;; (Well, strictly it's 'internal representation', but that's effectively -;; XFmode). - +;; We treat XFmode as meaning 'internal format'. It's the right size and we +;; don't use it for anything else. We only support moving between FPA +;; registers and moving an FPA register to/from memory. (define_insn "*movxf_fpa" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,f,m,f,r,r") - (match_operand:XF 1 "general_operand" "fG,H,m,f,r,f,r"))] - "TARGET_ARM && TARGET_HARD_FLOAT && reload_completed" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,m") + (match_operand:XF 1 "general_operand" "f,m,f"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA + && (register_operand (operands[0], XFmode) + || register_operand (operands[1], XFmode))" "* switch (which_alternative) { default: case 0: return \"mvf%?e\\t%0, %1\"; - case 1: return \"mnf%?e\\t%0, #%N1\"; - case 2: return \"ldf%?e\\t%0, %1\"; - case 3: return \"stf%?e\\t%1, %0\"; - case 4: return output_mov_long_double_fpa_from_arm (operands); - case 5: return output_mov_long_double_arm_from_fpa (operands); - case 6: return output_mov_long_double_arm_from_arm (operands); + case 1: if (arm_fpu_arch == FPUTYPE_FPA_EMU2) + return \"ldf%?e\\t%0, %1\"; + return \"lfm%?\\t%0, 1, %1\"; + case 2: if (arm_fpu_arch == FPUTYPE_FPA_EMU2) + return \"stf%?e\\t%1, %0\"; + return \"sfm%?\\t%1, 1, %0\"; } " - [(set_attr "length" "4,4,4,4,8,8,12") + [(set_attr "length" "4,4,4") (set_attr "predicable" "yes") - (set_attr "type" "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*") - (set_attr "pool_range" "*,*,1024,*,*,*,*") - (set_attr "neg_pool_range" "*,*,1004,*,*,*,*")] + (set_attr "type" "ffarith,f_load,f_store")] ) (define_insn "*cmpsf_fpa" [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "s_register_operand" "f,f") - (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -625,8 +624,8 @@ (define_insn "*cmpdf_fpa" [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "s_register_operand" "f,f") - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -638,8 +637,8 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -652,7 +651,7 @@ (compare:CCFP (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -661,8 +660,8 @@ (define_insn "*cmpsf_trap_fpa" [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:SF 0 "s_register_operand" "f,f") - (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -673,8 +672,8 @@ (define_insn "*cmpdf_trap_fpa" [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f,f") - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -686,8 +685,8 @@ [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) - (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -700,7 +699,7 @@ (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?e\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -711,9 +710,9 @@ (if_then_else:SF (match_operator 3 "arm_comparison_operator" [(match_operand 4 "cc_register" "") (const_int 0)]) - (match_operand:SF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") - (match_operand:SF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:SF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") + (match_operand:SF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3s\\t%0, %2 mnf%D3s\\t%0, #%N2 @@ -733,9 +732,9 @@ (if_then_else:DF (match_operator 3 "arm_comparison_operator" [(match_operand 4 "cc_register" "") (const_int 0)]) - (match_operand:DF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") - (match_operand:DF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + (match_operand:DF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H") + (match_operand:DF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3d\\t%0, %2 mnf%D3d\\t%0, #%N2 @@ -749,4 +748,3 @@ (set_attr "type" "ffarith") (set_attr "conds" "use")] ) - diff --git a/contrib/gcc/config/arm/freebsd.h b/contrib/gcc/config/arm/freebsd.h index cc3f72725b6..6bae83def63 100644 --- a/contrib/gcc/config/arm/freebsd.h +++ b/contrib/gcc/config/arm/freebsd.h @@ -16,8 +16,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #undef SUBTARGET_EXTRA_SPECS @@ -30,7 +30,6 @@ #undef LINK_SPEC #define LINK_SPEC " \ %{p:%nconsider using `-pg' instead of `-p' with gprof(1) } \ - %{Wl,*:%*} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/contrib/gcc/config/arm/gentune.sh b/contrib/gcc/config/arm/gentune.sh new file mode 100755 index 00000000000..40c05411052 --- /dev/null +++ b/contrib/gcc/config/arm/gentune.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Generate arm-tune.md, a file containing the tune attribute from the list of +# CPUs in arm-cores.def + +echo ";; -*- buffer-read-only: t -*-" +echo ";; Generated automatically by gentune.sh from arm-cores.def" + +allcores=`awk -F'[(, ]+' '/^ARM_CORE/ { cores = cores$3"," } END { print cores } ' $1` + +echo "(define_attr \"tune\"" +echo " \"$allcores\"" | sed -e 's/,"$/"/' +echo " (const (symbol_ref \"arm_tune\")))" diff --git a/contrib/gcc/config/arm/ieee754-df.S b/contrib/gcc/config/arm/ieee754-df.S index 6a7aab85938..74d9f0d9c4c 100644 --- a/contrib/gcc/config/arm/ieee754-df.S +++ b/contrib/gcc/config/arm/ieee754-df.S @@ -1,6 +1,6 @@ /* ieee754-df.S double-precision floating point support for ARM - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nicolas Pitre (nico@cam.org) This file is free software; you can redistribute it and/or modify it @@ -24,8 +24,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* * Notes: @@ -59,55 +59,52 @@ #ifdef L_negdf2 ARM_FUNC_START negdf2 +ARM_FUNC_ALIAS aeabi_dneg negdf2 + @ flip sign bit eor xh, xh, #0x80000000 RET + FUNC_END aeabi_dneg FUNC_END negdf2 #endif #ifdef L_addsubdf3 +ARM_FUNC_START aeabi_drsub + + eor xh, xh, #0x80000000 @ flip sign bit of first arg + b 1f + ARM_FUNC_START subdf3 - @ flip sign bit of second arg - eor yh, yh, #0x80000000 -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +ARM_FUNC_ALIAS aeabi_dsub subdf3 + + eor yh, yh, #0x80000000 @ flip sign bit of second arg +#if defined(__INTERWORKING_STUBS__) b 1f @ Skip Thumb-code prologue #endif ARM_FUNC_START adddf3 +ARM_FUNC_ALIAS aeabi_dadd adddf3 -1: @ Compare both args, return zero if equal but the sign. - teq xl, yl - eoreq ip, xh, yh - teqeq ip, #0x80000000 - beq LSYM(Lad_z) +1: stmfd sp!, {r4, r5, lr} - @ If first arg is 0 or -0, return second arg. - @ If second arg is 0 or -0, return first arg. - orrs ip, xl, xh, lsl #1 - moveq xl, yl - moveq xh, yh - orrnes ip, yl, yh, lsl #1 - RETc(eq) - - stmfd sp!, {r4, r5, lr} - - @ Mask out exponents. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r4, xh, ip - and r5, yh, ip - - @ If either of them is 0x7ff, result will be INF or NAN - teq r4, ip - teqne r5, ip - beq LSYM(Lad_i) + @ Look for zeroes, equal values, INF, or NAN. + mov r4, xh, lsl #1 + mov r5, yh, lsl #1 + teq r4, r5 + teqeq xl, yl + orrnes ip, r4, xl + orrnes ip, r5, yl + mvnnes ip, r4, asr #21 + mvnnes ip, r5, asr #21 + beq LSYM(Lad_s) @ Compute exponent difference. Make largest exponent in r4, @ corresponding arg in xh-xl, and positive exponent difference in r5. - subs r5, r5, r4 + mov r4, r4, lsr #21 + rsbs r5, r4, r5, lsr #21 rsblt r5, r5, #0 ble 1f add r4, r4, r5 @@ -118,24 +115,24 @@ ARM_FUNC_START adddf3 eor yl, xl, yl eor yh, xh, yh 1: - @ If exponent difference is too large, return largest argument @ already in xh-xl. We need up to 54 bit to handle proper rounding @ of 0x1p54 - 1.1. - cmp r5, #(54 << 20) + cmp r5, #54 RETLDM "r4, r5" hi @ Convert mantissa to signed integer. tst xh, #0x80000000 - bic xh, xh, ip, lsl #1 - orr xh, xh, #0x00100000 + mov xh, xh, lsl #12 + mov ip, #0x00100000 + orr xh, ip, xh, lsr #12 beq 1f rsbs xl, xl, #0 rsc xh, xh, #0 1: tst yh, #0x80000000 - bic yh, yh, ip, lsl #1 - orr yh, yh, #0x00100000 + mov yh, yh, lsl #12 + orr yh, ip, yh, lsr #12 beq 1f rsbs yl, yl, #0 rsc yh, yh, #0 @@ -145,42 +142,30 @@ ARM_FUNC_START adddf3 teq r4, r5 beq LSYM(Lad_d) LSYM(Lad_x): - @ Scale down second arg with exponent difference. - @ Apply shift one bit left to first arg and the rest to second arg - @ to simplify things later, but only if exponent does not become 0. - mov ip, #0 - movs r5, r5, lsr #20 - beq 3f - teq r4, #(1 << 20) - beq 1f - movs xl, xl, lsl #1 - adc xh, ip, xh, lsl #1 - sub r4, r4, #(1 << 20) - subs r5, r5, #1 - beq 3f - @ Shift yh-yl right per r5, keep leftover bits into ip. -1: rsbs lr, r5, #32 - blt 2f + @ Compensate for the exponent overlapping the mantissa MSB added later + sub r4, r4, #1 + + @ Shift yh-yl right per r5, add to xh-xl, keep leftover bits into ip. + rsbs lr, r5, #32 + blt 1f mov ip, yl, lsl lr - mov yl, yl, lsr r5 - orr yl, yl, yh, lsl lr - mov yh, yh, asr r5 - b 3f -2: sub r5, r5, #32 + adds xl, xl, yl, lsr r5 + adc xh, xh, #0 + adds xl, xl, yh, lsl lr + adcs xh, xh, yh, asr r5 + b 2f +1: sub r5, r5, #32 add lr, lr, #32 cmp yl, #1 - adc ip, ip, yh, lsl lr - mov yl, yh, asr r5 - mov yh, yh, asr #32 -3: - @ the actual addition - adds xl, xl, yl - adc xh, xh, yh - + mov ip, yh, lsl lr + orrcs ip, ip, #2 @ 2 not 1, to allow lsr #1 later + adds xl, xl, yh, asr r5 + adcs xh, xh, yh, asr #31 +2: @ We now have a result in xh-xl-ip. - @ Keep absolute value in xh-xl-ip, sign in r5. - ands r5, xh, #0x80000000 + @ Keep absolute value in xh-xl-ip, sign in r5 (the n bit was set above) + and r5, xh, #0x80000000 bpl LSYM(Lad_p) rsbs ip, ip, #0 rscs xl, xl, #0 @@ -189,75 +174,66 @@ LSYM(Lad_x): @ Determine how to normalize the result. LSYM(Lad_p): cmp xh, #0x00100000 - bcc LSYM(Lad_l) + bcc LSYM(Lad_a) cmp xh, #0x00200000 - bcc LSYM(Lad_r0) - cmp xh, #0x00400000 - bcc LSYM(Lad_r1) + bcc LSYM(Lad_e) @ Result needs to be shifted right. movs xh, xh, lsr #1 movs xl, xl, rrx - movs ip, ip, rrx - orrcs ip, ip, #1 - add r4, r4, #(1 << 20) -LSYM(Lad_r1): - movs xh, xh, lsr #1 - movs xl, xl, rrx - movs ip, ip, rrx - orrcs ip, ip, #1 - add r4, r4, #(1 << 20) + mov ip, ip, rrx + add r4, r4, #1 + + @ Make sure we did not bust our exponent. + mov r2, r4, lsl #21 + cmn r2, #(2 << 21) + bcs LSYM(Lad_o) @ Our result is now properly aligned into xh-xl, remaining bits in ip. @ Round with MSB of ip. If halfway between two numbers, round towards @ LSB of xl = 0. -LSYM(Lad_r0): - adds xl, xl, ip, lsr #31 - adc xh, xh, #0 - teq ip, #0x80000000 - biceq xl, xl, #1 - - @ One extreme rounding case may add a new MSB. Adjust exponent. - @ That MSB will be cleared when exponent is merged below. - tst xh, #0x00200000 - addne r4, r4, #(1 << 20) - - @ Make sure we did not bust our exponent. - adds ip, r4, #(1 << 20) - bmi LSYM(Lad_o) - @ Pack final result together. LSYM(Lad_e): - bic xh, xh, #0x00300000 - orr xh, xh, r4 + cmp ip, #0x80000000 + moveqs ip, xl, lsr #1 + adcs xl, xl, #0 + adc xh, xh, r4, lsl #20 orr xh, xh, r5 RETLDM "r4, r5" -LSYM(Lad_l): @ Result must be shifted left and exponent adjusted. - @ No rounding necessary since ip will always be 0. +LSYM(Lad_a): + movs ip, ip, lsl #1 + adcs xl, xl, xl + adc xh, xh, xh + tst xh, #0x00100000 + sub r4, r4, #1 + bne LSYM(Lad_e) + + @ No rounding necessary since ip will always be 0 at this point. +LSYM(Lad_l): + #if __ARM_ARCH__ < 5 teq xh, #0 - movne r3, #-11 - moveq r3, #21 + movne r3, #20 + moveq r3, #52 moveq xh, xl moveq xl, #0 mov r2, xh - movs ip, xh, lsr #16 - moveq r2, r2, lsl #16 - addeq r3, r3, #16 - tst r2, #0xff000000 - moveq r2, r2, lsl #8 - addeq r3, r3, #8 - tst r2, #0xf0000000 - moveq r2, r2, lsl #4 - addeq r3, r3, #4 - tst r2, #0xc0000000 - moveq r2, r2, lsl #2 - addeq r3, r3, #2 - tst r2, #0x80000000 - addeq r3, r3, #1 + cmp r2, #(1 << 16) + movhs r2, r2, lsr #16 + subhs r3, r3, #16 + cmp r2, #(1 << 8) + movhs r2, r2, lsr #8 + subhs r3, r3, #8 + cmp r2, #(1 << 4) + movhs r2, r2, lsr #4 + subhs r3, r3, #4 + cmp r2, #(1 << 2) + subhs r3, r3, #2 + sublo r3, r3, r2, lsr #1 + sub r3, r3, r2, lsr #3 #else @@ -293,13 +269,15 @@ LSYM(Lad_l): movle xl, xl, lsl r2 @ adjust exponent accordingly. -3: subs r4, r4, r3, lsl #20 - bgt LSYM(Lad_e) +3: subs r4, r4, r3 + addge xh, xh, r4, lsl #20 + orrge xh, xh, r5 + RETLDM "r4, r5" ge @ Exponent too small, denormalize result. @ Find out proper shift value. - mvn r4, r4, asr #20 - subs r4, r4, #30 + mvn r4, r4 + subs r4, r4, #31 bge 2f adds r4, r4, #12 bgt 1f @@ -328,23 +306,49 @@ LSYM(Lad_l): RETLDM "r4, r5" @ Adjust exponents for denormalized arguments. + @ Note that r4 must not remain equal to 0. LSYM(Lad_d): teq r4, #0 - eoreq xh, xh, #0x00100000 - addeq r4, r4, #(1 << 20) eor yh, yh, #0x00100000 - subne r5, r5, #(1 << 20) + eoreq xh, xh, #0x00100000 + addeq r4, r4, #1 + subne r5, r5, #1 b LSYM(Lad_x) - @ Result is x - x = 0, unless x = INF or NAN. -LSYM(Lad_z): - sub ip, ip, #0x00100000 @ ip becomes 0x7ff00000 - and r2, xh, ip - teq r2, ip - orreq xh, ip, #0x00080000 + +LSYM(Lad_s): + mvns ip, r4, asr #21 + mvnnes ip, r5, asr #21 + beq LSYM(Lad_i) + + teq r4, r5 + teqeq xl, yl + beq 1f + + @ Result is x + 0.0 = x or 0.0 + y = y. + orrs ip, r4, xl + moveq xh, yh + moveq xl, yl + RETLDM "r4, r5" + +1: teq xh, yh + + @ Result is x - x = 0. movne xh, #0 - mov xl, #0 - RET + movne xl, #0 + RETLDM "r4, r5" ne + + @ Result is x + x = 2x. + movs ip, r4, lsr #21 + bne 2f + movs xl, xl, lsl #1 + adcs xh, xh, xh + orrcs xh, xh, #0x80000000 + RETLDM "r4, r5" +2: adds r4, r4, #(2 << 21) + addcc xh, xh, #(1 << 20) + RETLDM "r4, r5" cc + and r5, xh, #0x80000000 @ Overflow: return INF. LSYM(Lad_o): @@ -358,127 +362,221 @@ LSYM(Lad_o): @ if yh-yl != INF/NAN: return xh-xl (which is INF/NAN) @ if either is NAN: return NAN @ if opposite sign: return NAN - @ return xh-xl (which is INF or -INF) + @ otherwise return xh-xl (which is INF or -INF) LSYM(Lad_i): - teq r4, ip + mvns ip, r4, asr #21 movne xh, yh movne xl, yl - teqeq r5, ip - RETLDM "r4, r5" ne - + mvneqs ip, r5, asr #21 + movne yh, xh + movne yl, xl orrs r4, xl, xh, lsl #12 - orreqs r4, yl, yh, lsl #12 + orreqs r5, yl, yh, lsl #12 teqeq xh, yh - orrne xh, r5, #0x00080000 - movne xl, #0 + orrne xh, xh, #0x00080000 @ quiet NAN RETLDM "r4, r5" + FUNC_END aeabi_dsub FUNC_END subdf3 + FUNC_END aeabi_dadd FUNC_END adddf3 ARM_FUNC_START floatunsidf +ARM_FUNC_ALIAS aeabi_ui2d floatunsidf + teq r0, #0 moveq r1, #0 RETc(eq) stmfd sp!, {r4, r5, lr} - mov r4, #(0x400 << 20) @ initial exponent - add r4, r4, #((52-1) << 20) + mov r4, #0x400 @ initial exponent + add r4, r4, #(52-1 - 1) mov r5, #0 @ sign bit is 0 + .ifnc xl, r0 mov xl, r0 + .endif mov xh, #0 b LSYM(Lad_l) + FUNC_END aeabi_ui2d FUNC_END floatunsidf ARM_FUNC_START floatsidf +ARM_FUNC_ALIAS aeabi_i2d floatsidf + teq r0, #0 moveq r1, #0 RETc(eq) stmfd sp!, {r4, r5, lr} - mov r4, #(0x400 << 20) @ initial exponent - add r4, r4, #((52-1) << 20) + mov r4, #0x400 @ initial exponent + add r4, r4, #(52-1 - 1) ands r5, r0, #0x80000000 @ sign bit in r5 rsbmi r0, r0, #0 @ absolute value + .ifnc xl, r0 mov xl, r0 + .endif mov xh, #0 b LSYM(Lad_l) + FUNC_END aeabi_i2d FUNC_END floatsidf ARM_FUNC_START extendsfdf2 - movs r2, r0, lsl #1 - beq 1f @ value is 0.0 or -0.0 +ARM_FUNC_ALIAS aeabi_f2d extendsfdf2 + + movs r2, r0, lsl #1 @ toss sign bit mov xh, r2, asr #3 @ stretch exponent mov xh, xh, rrx @ retrieve sign bit mov xl, r2, lsl #28 @ retrieve remaining bits - ands r2, r2, #0xff000000 @ isolate exponent - beq 2f @ exponent was 0 but not mantissa - teq r2, #0xff000000 @ check if INF or NAN + andnes r3, r2, #0xff000000 @ isolate exponent + teqne r3, #0xff000000 @ if not 0, check if INF or NAN eorne xh, xh, #0x38000000 @ fixup exponent otherwise. - RET + RETc(ne) @ and return it. -1: mov xh, r0 - mov xl, #0 - RET + teq r2, #0 @ if actually 0 + teqne r3, #0xff000000 @ or INF or NAN + RETc(eq) @ we are done already. -2: @ value was denormalized. We can normalize it now. + @ value was denormalized. We can normalize it now. stmfd sp!, {r4, r5, lr} - mov r4, #(0x380 << 20) @ setup corresponding exponent - add r4, r4, #(1 << 20) + mov r4, #0x380 @ setup corresponding exponent and r5, xh, #0x80000000 @ move sign bit in r5 bic xh, xh, #0x80000000 b LSYM(Lad_l) + FUNC_END aeabi_f2d FUNC_END extendsfdf2 +ARM_FUNC_START floatundidf +ARM_FUNC_ALIAS aeabi_ul2d floatundidf + + orrs r2, r0, r1 +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + mvfeqd f0, #0.0 +#endif + RETc(eq) + +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + @ For hard FPA code we want to return via the tail below so that + @ we can return the result in f0 as well as in r0/r1 for backwards + @ compatibility. + adr ip, LSYM(f0_ret) + stmfd sp!, {r4, r5, ip, lr} +#else + stmfd sp!, {r4, r5, lr} +#endif + + mov r5, #0 + b 2f + +ARM_FUNC_START floatdidf +ARM_FUNC_ALIAS aeabi_l2d floatdidf + + orrs r2, r0, r1 +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + mvfeqd f0, #0.0 +#endif + RETc(eq) + +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + @ For hard FPA code we want to return via the tail below so that + @ we can return the result in f0 as well as in r0/r1 for backwards + @ compatibility. + adr ip, LSYM(f0_ret) + stmfd sp!, {r4, r5, ip, lr} +#else + stmfd sp!, {r4, r5, lr} +#endif + + ands r5, ah, #0x80000000 @ sign bit in r5 + bpl 2f + rsbs al, al, #0 + rsc ah, ah, #0 +2: + mov r4, #0x400 @ initial exponent + add r4, r4, #(52-1 - 1) + + @ FPA little-endian: must swap the word order. + .ifnc xh, ah + mov ip, al + mov xh, ah + mov xl, ip + .endif + + movs ip, xh, lsr #22 + beq LSYM(Lad_p) + + @ The value is too big. Scale it down a bit... + mov r2, #3 + movs ip, ip, lsr #3 + addne r2, r2, #3 + movs ip, ip, lsr #3 + addne r2, r2, #3 + add r2, r2, ip, lsr #3 + + rsb r3, r2, #32 + mov ip, xl, lsl r3 + mov xl, xl, lsr r2 + orr xl, xl, xh, lsl r3 + mov xh, xh, lsr r2 + add r4, r4, r2 + b LSYM(Lad_p) + +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + + @ Legacy code expects the result to be returned in f0. Copy it + @ there as well. +LSYM(f0_ret): + stmfd sp!, {r0, r1} + ldfd f0, [sp], #8 + RETLDM + +#endif + + FUNC_END floatdidf + FUNC_END aeabi_l2d + FUNC_END floatundidf + FUNC_END aeabi_ul2d + #endif /* L_addsubdf3 */ #ifdef L_muldivdf3 ARM_FUNC_START muldf3 - +ARM_FUNC_ALIAS aeabi_dmul muldf3 stmfd sp!, {r4, r5, r6, lr} - @ Mask out exponents. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r4, xh, ip - and r5, yh, ip - - @ Trap any INF/NAN. - teq r4, ip + @ Mask out exponents, trap any zero/denormal/INF/NAN. + mov ip, #0xff + orr ip, ip, #0x700 + ands r4, ip, xh, lsr #20 + andnes r5, ip, yh, lsr #20 + teqne r4, ip teqne r5, ip - beq LSYM(Lml_s) + bleq LSYM(Lml_s) - @ Trap any multiplication by 0. - orrs r6, xl, xh, lsl #1 - orrnes r6, yl, yh, lsl #1 - beq LSYM(Lml_z) + @ Add exponents together + add r4, r4, r5 - @ Shift exponents right one bit to make room for overflow bit. - @ If either of them is 0, scale denormalized arguments off line. - @ Then add both exponents together. - movs r4, r4, lsr #1 - teqne r5, #0 - beq LSYM(Lml_d) -LSYM(Lml_x): - add r4, r4, r5, asr #1 - - @ Preserve final sign in r4 along with exponent for now. - teq xh, yh - orrmi r4, r4, #0x8000 + @ Determine final sign. + eor r6, xh, yh @ Convert mantissa to unsigned integer. - bic xh, xh, ip, lsl #1 - bic yh, yh, ip, lsl #1 + @ If power of two, branch to a separate path. + bic xh, xh, ip, lsl #21 + bic yh, yh, ip, lsl #21 + orrs r5, xl, xh, lsl #12 + orrnes r5, yl, yh, lsl #12 orr xh, xh, #0x00100000 orr yh, yh, #0x00100000 + beq LSYM(Lml_1) #if __ARM_ARCH__ < 4 + @ Put sign bit in r6, which will be restored in yl later. + and r6, r6, #0x80000000 + @ Well, no way to make it shorter without the umull instruction. - @ We must perform that 53 x 53 bit multiplication by hand. - stmfd sp!, {r7, r8, r9, sl, fp} + stmfd sp!, {r6, r7, r8, r9, sl, fp} mov r7, xl, lsr #16 mov r8, yl, lsr #16 mov r9, xh, lsr #16 @@ -530,92 +628,83 @@ LSYM(Lml_x): mul fp, xh, yh adcs r5, r5, fp adc r6, r6, #0 - ldmfd sp!, {r7, r8, r9, sl, fp} + ldmfd sp!, {yl, r7, r8, r9, sl, fp} #else - @ Here is the actual multiplication: 53 bits * 53 bits -> 106 bits. + @ Here is the actual multiplication. umull ip, lr, xl, yl mov r5, #0 - umlal lr, r5, xl, yh umlal lr, r5, xh, yl + and yl, r6, #0x80000000 + umlal lr, r5, xl, yh mov r6, #0 umlal r5, r6, xh, yh #endif @ The LSBs in ip are only significant for the final rounding. - @ Fold them into one bit of lr. + @ Fold them into lr. teq ip, #0 orrne lr, lr, #1 - @ Put final sign in xh. - mov xh, r4, lsl #16 - bic r4, r4, #0x8000 - - @ Adjust result if one extra MSB appeared (one of four times). - tst r6, #(1 << 9) - beq 1f - add r4, r4, #(1 << 19) - movs r6, r6, lsr #1 - movs r5, r5, rrx - movs lr, lr, rrx - orrcs lr, lr, #1 + @ Adjust result upon the MSB position. + sub r4, r4, #0xff + cmp r6, #(1 << (20-11)) + sbc r4, r4, #0x300 + bcs 1f + movs lr, lr, lsl #1 + adcs r5, r5, r5 + adc r6, r6, r6 1: - @ Scale back to 53 bits. - @ xh contains sign bit already. - orr xh, xh, r6, lsl #12 - orr xh, xh, r5, lsr #20 - mov xl, r5, lsl #12 - orr xl, xl, lr, lsr #20 + @ Shift to final position, add sign to result. + orr xh, yl, r6, lsl #11 + orr xh, xh, r5, lsr #21 + mov xl, r5, lsl #11 + orr xl, xl, lr, lsr #21 + mov lr, lr, lsl #11 - @ Apply exponent bias, check range for underflow. - sub r4, r4, #0x00f80000 - subs r4, r4, #0x1f000000 - ble LSYM(Lml_u) + @ Check exponent range for under/overflow. + subs ip, r4, #(254 - 1) + cmphi ip, #0x700 + bhi LSYM(Lml_u) - @ Round the result. - movs lr, lr, lsl #12 - bpl 1f - adds xl, xl, #1 - adc xh, xh, #0 - teq lr, #0x80000000 - biceq xl, xl, #1 - - @ Rounding may have produced an extra MSB here. - @ The extra bit is cleared before merging the exponent below. - tst xh, #0x00200000 - addne r4, r4, #(1 << 19) -1: - @ Check exponent for overflow. - adds ip, r4, #(1 << 19) - tst ip, #(1 << 30) - bne LSYM(Lml_o) - - @ Add final exponent. - bic xh, xh, #0x00300000 - orr xh, xh, r4, lsl #1 + @ Round the result, merge final exponent. + cmp lr, #0x80000000 + moveqs lr, xl, lsr #1 + adcs xl, xl, #0 + adc xh, xh, r4, lsl #20 RETLDM "r4, r5, r6" - @ Result is 0, but determine sign anyway. -LSYM(Lml_z): + @ Multiplication by 0x1p*: let''s shortcut a lot of code. +LSYM(Lml_1): + and r6, r6, #0x80000000 + orr xh, r6, xh + orr xl, xl, yl eor xh, xh, yh -LSYM(Ldv_z): - bic xh, xh, #0x7fffffff - mov xl, #0 - RETLDM "r4, r5, r6" + subs r4, r4, ip, lsr #1 + rsbgts r5, r4, ip + orrgt xh, xh, r4, lsl #20 + RETLDM "r4, r5, r6" gt + + @ Under/overflow: fix things up for the code below. + orr xh, xh, #0x00100000 + mov lr, #0 + subs r4, r4, #1 + +LSYM(Lml_u): + @ Overflow? + bgt LSYM(Lml_o) @ Check if denormalized result is possible, otherwise return signed 0. -LSYM(Lml_u): - cmn r4, #(53 << 19) + cmn r4, #(53 + 1) movle xl, #0 bicle xh, xh, #0x7fffffff RETLDM "r4, r5, r6" le @ Find out proper shift value. -LSYM(Lml_r): - mvn r4, r4, asr #19 - subs r4, r4, #30 + rsb r4, r4, #0 + subs r4, r4, #32 bge 2f adds r4, r4, #12 bgt 1f @@ -626,14 +715,12 @@ LSYM(Lml_r): mov r3, xl, lsl r5 mov xl, xl, lsr r4 orr xl, xl, xh, lsl r5 - movs xh, xh, lsl #1 - mov xh, xh, lsr r4 - mov xh, xh, rrx + and r2, xh, #0x80000000 + bic xh, xh, #0x80000000 adds xl, xl, r3, lsr #31 - adc xh, xh, #0 - teq lr, #0 - teqeq r3, #0x80000000 - biceq xl, xl, #1 + adc xh, r2, xh, lsr r4 + orrs lr, lr, r3, lsl #1 + biceq xl, xl, r3, lsr #31 RETLDM "r4, r5, r6" @ shift result right of 21 to 31 bits, or left 11 to 1 bits after @@ -646,54 +733,71 @@ LSYM(Lml_r): bic xh, xh, #0x7fffffff adds xl, xl, r3, lsr #31 adc xh, xh, #0 - teq lr, #0 - teqeq r3, #0x80000000 - biceq xl, xl, #1 + orrs lr, lr, r3, lsl #1 + biceq xl, xl, r3, lsr #31 RETLDM "r4, r5, r6" @ Shift value right of 32 to 64 bits, or 0 to 32 bits after a switch @ from xh to xl. Leftover bits are in r3-r6-lr for rounding. 2: rsb r5, r4, #32 - mov r6, xl, lsl r5 + orr lr, lr, xl, lsl r5 mov r3, xl, lsr r4 orr r3, r3, xh, lsl r5 mov xl, xh, lsr r4 bic xh, xh, #0x7fffffff bic xl, xl, xh, lsr r4 add xl, xl, r3, lsr #31 - orrs r6, r6, lr - teqeq r3, #0x80000000 - biceq xl, xl, #1 + orrs lr, lr, r3, lsl #1 + biceq xl, xl, r3, lsr #31 RETLDM "r4, r5, r6" @ One or both arguments are denormalized. @ Scale them leftwards and preserve sign bit. LSYM(Lml_d): - mov lr, #0 teq r4, #0 bne 2f and r6, xh, #0x80000000 1: movs xl, xl, lsl #1 - adc xh, lr, xh, lsl #1 + adc xh, xh, xh tst xh, #0x00100000 - subeq r4, r4, #(1 << 19) + subeq r4, r4, #1 beq 1b orr xh, xh, r6 teq r5, #0 - bne LSYM(Lml_x) + movne pc, lr 2: and r6, yh, #0x80000000 3: movs yl, yl, lsl #1 - adc yh, lr, yh, lsl #1 + adc yh, yh, yh tst yh, #0x00100000 - subeq r5, r5, #(1 << 20) + subeq r5, r5, #1 beq 3b orr yh, yh, r6 - b LSYM(Lml_x) + mov pc, lr - @ One or both args are INF or NAN. LSYM(Lml_s): + @ Isolate the INF and NAN cases away + teq r4, ip + and r5, ip, yh, lsr #20 + teqne r5, ip + beq 1f + + @ Here, one or more arguments are either denormalized or zero. orrs r6, xl, xh, lsl #1 orrnes r6, yl, yh, lsl #1 + bne LSYM(Lml_d) + + @ Result is 0, but determine sign anyway. +LSYM(Lml_z): + eor xh, xh, yh + bic xh, xh, #0x7fffffff + mov xl, #0 + RETLDM "r4, r5, r6" + +1: @ One or both args are INF or NAN. + orrs r6, xl, xh, lsl #1 + moveq xl, yl + moveq xh, yh + orrnes r6, yl, yh, lsl #1 beq LSYM(Lml_n) @ 0 * INF or INF * 0 -> NAN teq r4, ip bne 1f @@ -702,6 +806,8 @@ LSYM(Lml_s): 1: teq r5, ip bne LSYM(Lml_i) orrs r6, yl, yh, lsl #12 + movne xl, yl + movne xh, yh bne LSYM(Lml_n) @ * NAN -> NAN @ Result is INF, but we need to determine its sign. @@ -716,53 +822,45 @@ LSYM(Lml_o): mov xl, #0 RETLDM "r4, r5, r6" - @ Return NAN. + @ Return a quiet NAN. LSYM(Lml_n): - mov xh, #0x7f000000 + orr xh, xh, #0x7f000000 orr xh, xh, #0x00f80000 RETLDM "r4, r5, r6" + FUNC_END aeabi_dmul FUNC_END muldf3 ARM_FUNC_START divdf3 - +ARM_FUNC_ALIAS aeabi_ddiv divdf3 + stmfd sp!, {r4, r5, r6, lr} - @ Mask out exponents. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r4, xh, ip - and r5, yh, ip - - @ Trap any INF/NAN or zeroes. - teq r4, ip + @ Mask out exponents, trap any zero/denormal/INF/NAN. + mov ip, #0xff + orr ip, ip, #0x700 + ands r4, ip, xh, lsr #20 + andnes r5, ip, yh, lsr #20 + teqne r4, ip teqne r5, ip - orrnes r6, xl, xh, lsl #1 - orrnes r6, yl, yh, lsl #1 - beq LSYM(Ldv_s) + bleq LSYM(Ldv_s) - @ Shift exponents right one bit to make room for overflow bit. - @ If either of them is 0, scale denormalized arguments off line. - @ Then substract divisor exponent from dividend''s. - movs r4, r4, lsr #1 - teqne r5, #0 - beq LSYM(Ldv_d) -LSYM(Ldv_x): - sub r4, r4, r5, asr #1 + @ Substract divisor exponent from dividend''s. + sub r4, r4, r5 @ Preserve final sign into lr. eor lr, xh, yh @ Convert mantissa to unsigned integer. @ Dividend -> r5-r6, divisor -> yh-yl. - mov r5, #0x10000000 + orrs r5, yl, yh, lsl #12 + mov xh, xh, lsl #12 + beq LSYM(Ldv_1) mov yh, yh, lsl #12 + mov r5, #0x10000000 orr yh, r5, yh, lsr #4 orr yh, yh, yl, lsr #24 - movs yl, yl, lsl #8 - mov xh, xh, lsl #12 - teqeq yh, r5 - beq LSYM(Ldv_1) + mov yl, yl, lsl #8 orr r5, r5, xh, lsr #4 orr r5, r5, xl, lsr #24 mov r6, xl, lsl #8 @@ -771,21 +869,15 @@ LSYM(Ldv_x): and xh, lr, #0x80000000 @ Ensure result will land to known bit position. + @ Apply exponent bias accordingly. cmp r5, yh cmpeq r6, yl + adc r4, r4, #(255 - 2) + add r4, r4, #0x300 bcs 1f - sub r4, r4, #(1 << 19) movs yh, yh, lsr #1 mov yl, yl, rrx 1: - @ Apply exponent bias, check range for over/underflow. - add r4, r4, #0x1f000000 - add r4, r4, #0x00f80000 - cmn r4, #(53 << 19) - ble LSYM(Ldv_z) - cmp r4, ip, lsr #1 - bge LSYM(Lml_o) - @ Perform first substraction to align result to a nibble. subs r6, r6, yl sbc r5, r5, yh @@ -847,73 +939,42 @@ LSYM(Ldv_x): orreq xh, xh, xl moveq xl, #0 3: - @ Check if denormalized result is needed. - cmp r4, #0 - ble LSYM(Ldv_u) + @ Check exponent range for under/overflow. + subs ip, r4, #(254 - 1) + cmphi ip, #0x700 + bhi LSYM(Lml_u) - @ Apply proper rounding. + @ Round the result, merge final exponent. subs ip, r5, yh subeqs ip, r6, yl + moveqs ip, xl, lsr #1 adcs xl, xl, #0 - adc xh, xh, #0 - teq ip, #0 - biceq xl, xl, #1 - - @ Add exponent to result. - bic xh, xh, #0x00100000 - orr xh, xh, r4, lsl #1 + adc xh, xh, r4, lsl #20 RETLDM "r4, r5, r6" @ Division by 0x1p*: shortcut a lot of code. LSYM(Ldv_1): and lr, lr, #0x80000000 orr xh, lr, xh, lsr #12 - add r4, r4, #0x1f000000 - add r4, r4, #0x00f80000 - cmp r4, ip, lsr #1 - bge LSYM(Lml_o) - cmp r4, #0 - orrgt xh, xh, r4, lsl #1 + adds r4, r4, ip, lsr #1 + rsbgts r5, r4, ip + orrgt xh, xh, r4, lsl #20 RETLDM "r4, r5, r6" gt - cmn r4, #(53 << 19) - ble LSYM(Ldv_z) orr xh, xh, #0x00100000 mov lr, #0 - b LSYM(Lml_r) + subs r4, r4, #1 + b LSYM(Lml_u) - @ Result must be denormalized: put remainder in lr for - @ rounding considerations. + @ Result mightt need to be denormalized: put remainder bits + @ in lr for rounding considerations. LSYM(Ldv_u): orr lr, r5, r6 - b LSYM(Lml_r) - - @ One or both arguments are denormalized. - @ Scale them leftwards and preserve sign bit. -LSYM(Ldv_d): - mov lr, #0 - teq r4, #0 - bne 2f - and r6, xh, #0x80000000 -1: movs xl, xl, lsl #1 - adc xh, lr, xh, lsl #1 - tst xh, #0x00100000 - subeq r4, r4, #(1 << 19) - beq 1b - orr xh, xh, r6 - teq r5, #0 - bne LSYM(Ldv_x) -2: and r6, yh, #0x80000000 -3: movs yl, yl, lsl #1 - adc yh, lr, yh, lsl #1 - tst yh, #0x00100000 - subeq r5, r5, #(1 << 20) - beq 3b - orr yh, yh, r6 - b LSYM(Ldv_x) + b LSYM(Lml_u) @ One or both arguments is either INF, NAN or zero. LSYM(Ldv_s): + and r5, ip, yh, lsr #20 teq r4, ip teqeq r5, ip beq LSYM(Lml_n) @ INF/NAN / INF/NAN -> NAN @@ -921,25 +982,38 @@ LSYM(Ldv_s): bne 1f orrs r4, xl, xh, lsl #12 bne LSYM(Lml_n) @ NAN / -> NAN - b LSYM(Lml_i) @ INF / -> INF + teq r5, ip + bne LSYM(Lml_i) @ INF / -> INF + mov xl, yl + mov xh, yh + b LSYM(Lml_n) @ INF / (INF or NAN) -> NAN 1: teq r5, ip bne 2f orrs r5, yl, yh, lsl #12 - bne LSYM(Lml_n) @ / NAN -> NAN - b LSYM(Lml_z) @ / INF -> 0 -2: @ One or both arguments are 0. + beq LSYM(Lml_z) @ / INF -> 0 + mov xl, yl + mov xh, yh + b LSYM(Lml_n) @ / NAN -> NAN +2: @ If both are nonzero, we need to normalize and resume above. + orrs r6, xl, xh, lsl #1 + orrnes r6, yl, yh, lsl #1 + bne LSYM(Lml_d) + @ One or both arguments are 0. orrs r4, xl, xh, lsl #1 bne LSYM(Lml_i) @ / 0 -> INF orrs r5, yl, yh, lsl #1 bne LSYM(Lml_z) @ 0 / -> 0 b LSYM(Lml_n) @ 0 / 0 -> NAN + FUNC_END aeabi_ddiv FUNC_END divdf3 #endif /* L_muldivdf3 */ #ifdef L_cmpdf2 +@ Note: only r0 (return value) and ip are clobbered here. + ARM_FUNC_START gtdf2 ARM_FUNC_ALIAS gedf2 gtdf2 mov ip, #-1 @@ -955,15 +1029,13 @@ ARM_FUNC_ALIAS nedf2 cmpdf2 ARM_FUNC_ALIAS eqdf2 cmpdf2 mov ip, #1 @ how should we specify unordered here? -1: stmfd sp!, {r4, r5, lr} +1: str ip, [sp, #-4] @ Trap any INF/NAN first. - mov lr, #0x7f000000 - orr lr, lr, #0x00f00000 - and r4, xh, lr - and r5, yh, lr - teq r4, lr - teqne r5, lr + mov ip, xh, lsl #1 + mvns ip, ip, asr #21 + mov ip, yh, lsl #1 + mvnnes ip, ip, asr #21 beq 3f @ Test for equality. @@ -973,37 +1045,37 @@ ARM_FUNC_ALIAS eqdf2 cmpdf2 teqne xh, yh @ or xh == yh teqeq xl, yl @ and xl == yl moveq r0, #0 @ then equal. - RETLDM "r4, r5" eq + RETc(eq) - @ Check for sign difference. + @ Clear C flag + cmn r0, #0 + + @ Compare sign, teq xh, yh - movmi r0, xh, asr #31 - orrmi r0, r0, #1 - RETLDM "r4, r5" mi - @ Compare exponents. - cmp r4, r5 - - @ Compare mantissa if exponents are equal. - moveq xh, xh, lsl #12 - cmpeq xh, yh, lsl #12 + @ Compare values if same sign + cmppl xh, yh cmpeq xl, yl + + @ Result: movcs r0, yh, asr #31 mvncc r0, yh, asr #31 orr r0, r0, #1 - RETLDM "r4, r5" + RET @ Look for a NAN. -3: teq r4, lr +3: mov ip, xh, lsl #1 + mvns ip, ip, asr #21 bne 4f - orrs xl, xl, xh, lsl #12 + orrs ip, xl, xh, lsl #12 bne 5f @ x is NAN -4: teq r5, lr +4: mov ip, yh, lsl #1 + mvns ip, ip, asr #21 bne 2b - orrs yl, yl, yh, lsl #12 + orrs ip, yl, yh, lsl #12 beq 2b @ y is not NAN -5: mov r0, ip @ return unordered code from ip - RETLDM "r4, r5" +5: ldr r0, [sp, #-4] @ unordered return code + RET FUNC_END gedf2 FUNC_END gtdf2 @@ -1013,30 +1085,109 @@ ARM_FUNC_ALIAS eqdf2 cmpdf2 FUNC_END eqdf2 FUNC_END cmpdf2 +ARM_FUNC_START aeabi_cdrcmple + + mov ip, r0 + mov r0, r2 + mov r2, ip + mov ip, r1 + mov r1, r3 + mov r3, ip + b 6f + +ARM_FUNC_START aeabi_cdcmpeq +ARM_FUNC_ALIAS aeabi_cdcmple aeabi_cdcmpeq + + @ The status-returning routines are required to preserve all + @ registers except ip, lr, and cpsr. +6: stmfd sp!, {r0, lr} + ARM_CALL cmpdf2 + @ Set the Z flag correctly, and the C flag unconditionally. + cmp r0, #0 + @ Clear the C flag if the return value was -1, indicating + @ that the first operand was smaller than the second. + cmnmi r0, #0 + RETLDM "r0" + + FUNC_END aeabi_cdcmple + FUNC_END aeabi_cdcmpeq + FUNC_END aeabi_cdrcmple + +ARM_FUNC_START aeabi_dcmpeq + + str lr, [sp, #-8]! + ARM_CALL aeabi_cdcmple + moveq r0, #1 @ Equal to. + movne r0, #0 @ Less than, greater than, or unordered. + RETLDM + + FUNC_END aeabi_dcmpeq + +ARM_FUNC_START aeabi_dcmplt + + str lr, [sp, #-8]! + ARM_CALL aeabi_cdcmple + movcc r0, #1 @ Less than. + movcs r0, #0 @ Equal to, greater than, or unordered. + RETLDM + + FUNC_END aeabi_dcmplt + +ARM_FUNC_START aeabi_dcmple + + str lr, [sp, #-8]! + ARM_CALL aeabi_cdcmple + movls r0, #1 @ Less than or equal to. + movhi r0, #0 @ Greater than or unordered. + RETLDM + + FUNC_END aeabi_dcmple + +ARM_FUNC_START aeabi_dcmpge + + str lr, [sp, #-8]! + ARM_CALL aeabi_cdrcmple + movls r0, #1 @ Operand 2 is less than or equal to operand 1. + movhi r0, #0 @ Operand 2 greater than operand 1, or unordered. + RETLDM + + FUNC_END aeabi_dcmpge + +ARM_FUNC_START aeabi_dcmpgt + + str lr, [sp, #-8]! + ARM_CALL aeabi_cdrcmple + movcc r0, #1 @ Operand 2 is less than operand 1. + movcs r0, #0 @ Operand 2 is greater than or equal to operand 1, + @ or they are unordered. + RETLDM + + FUNC_END aeabi_dcmpgt + #endif /* L_cmpdf2 */ #ifdef L_unorddf2 ARM_FUNC_START unorddf2 - str lr, [sp, #-4]! - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and lr, xh, ip - teq lr, ip +ARM_FUNC_ALIAS aeabi_dcmpun unorddf2 + + mov ip, xh, lsl #1 + mvns ip, ip, asr #21 bne 1f - orrs xl, xl, xh, lsl #12 + orrs ip, xl, xh, lsl #12 bne 3f @ x is NAN -1: and lr, yh, ip - teq lr, ip +1: mov ip, yh, lsl #1 + mvns ip, ip, asr #21 bne 2f - orrs yl, yl, yh, lsl #12 + orrs ip, yl, yh, lsl #12 bne 3f @ y is NAN 2: mov r0, #0 @ arguments are ordered. - RETLDM + RET 3: mov r0, #1 @ arguments are unordered. - RETLDM + RET + FUNC_END aeabi_dcmpun FUNC_END unorddf2 #endif /* L_unorddf2 */ @@ -1044,31 +1195,23 @@ ARM_FUNC_START unorddf2 #ifdef L_fixdfsi ARM_FUNC_START fixdfsi - orrs ip, xl, xh, lsl #1 - beq 1f @ value is 0. - - mov r3, r3, rrx @ preserve C flag (the actual sign) +ARM_FUNC_ALIAS aeabi_d2iz fixdfsi @ check exponent range. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r2, xh, ip - teq r2, ip - beq 2f @ value is INF or NAN - bic ip, ip, #0x40000000 - cmp r2, ip - bcc 1f @ value is too small - add ip, ip, #(31 << 20) - cmp r2, ip - bcs 3f @ value is too large + mov r2, xh, lsl #1 + adds r2, r2, #(1 << 21) + bcs 2f @ value is INF or NAN + bpl 1f @ value is too small + mov r3, #(0xfffffc00 + 31) + subs r2, r3, r2, asr #21 + bls 3f @ value is too large - rsb r2, r2, ip - mov ip, xh, lsl #11 - orr ip, ip, #0x80000000 - orr ip, ip, xl, lsr #21 - mov r2, r2, lsr #20 - tst r3, #0x80000000 @ the sign bit - mov r0, ip, lsr r2 + @ scale value + mov r3, xh, lsl #11 + orr r3, r3, #0x80000000 + orr r3, r3, xl, lsr #21 + tst xh, #0x80000000 @ the sign bit + mov r0, r3, lsr r2 rsbne r0, r0, #0 RET @@ -1076,14 +1219,15 @@ ARM_FUNC_START fixdfsi RET 2: orrs xl, xl, xh, lsl #12 - bne 4f @ r0 is NAN. -3: ands r0, r3, #0x80000000 @ the sign bit + bne 4f @ x is NAN. +3: ands r0, xh, #0x80000000 @ the sign bit moveq r0, #0x7fffffff @ maximum signed positive si RET 4: mov r0, #0 @ How should we convert NAN? RET + FUNC_END aeabi_d2iz FUNC_END fixdfsi #endif /* L_fixdfsi */ @@ -1091,29 +1235,23 @@ ARM_FUNC_START fixdfsi #ifdef L_fixunsdfsi ARM_FUNC_START fixunsdfsi - orrs ip, xl, xh, lsl #1 - movcss r0, #0 @ value is negative - RETc(eq) @ or 0 (xl, xh overlap r0) +ARM_FUNC_ALIAS aeabi_d2uiz fixunsdfsi @ check exponent range. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r2, xh, ip - teq r2, ip - beq 2f @ value is INF or NAN - bic ip, ip, #0x40000000 - cmp r2, ip - bcc 1f @ value is too small - add ip, ip, #(31 << 20) - cmp r2, ip - bhi 3f @ value is too large + movs r2, xh, lsl #1 + bcs 1f @ value is negative + adds r2, r2, #(1 << 21) + bcs 2f @ value is INF or NAN + bpl 1f @ value is too small + mov r3, #(0xfffffc00 + 31) + subs r2, r3, r2, asr #21 + bmi 3f @ value is too large - rsb r2, r2, ip - mov ip, xh, lsl #11 - orr ip, ip, #0x80000000 - orr ip, ip, xl, lsr #21 - mov r2, r2, lsr #20 - mov r0, ip, lsr r2 + @ scale value + mov r3, xh, lsl #11 + orr r3, r3, #0x80000000 + orr r3, r3, xl, lsr #21 + mov r0, r3, lsr r2 RET 1: mov r0, #0 @@ -1127,6 +1265,7 @@ ARM_FUNC_START fixunsdfsi 4: mov r0, #0 @ How should we convert NAN? RET + FUNC_END aeabi_d2uiz FUNC_END fixunsdfsi #endif /* L_fixunsdfsi */ @@ -1134,91 +1273,63 @@ ARM_FUNC_START fixunsdfsi #ifdef L_truncdfsf2 ARM_FUNC_START truncdfsf2 - orrs r2, xl, xh, lsl #1 - moveq r0, r2, rrx - RETc(eq) @ value is 0.0 or -0.0 - +ARM_FUNC_ALIAS aeabi_d2f truncdfsf2 + @ check exponent range. - mov ip, #0x7f000000 - orr ip, ip, #0x00f00000 - and r2, ip, xh - teq r2, ip - beq 2f @ value is INF or NAN - bic xh, xh, ip - cmp r2, #(0x380 << 20) - bls 4f @ value is too small + mov r2, xh, lsl #1 + subs r3, r2, #((1023 - 127) << 21) + subcss ip, r3, #(1 << 21) + rsbcss ip, ip, #(254 << 21) + bls 2f @ value is out of range - @ shift and round mantissa -1: movs r3, xl, lsr #29 - adc r3, r3, xh, lsl #3 - - @ if halfway between two numbers, round towards LSB = 0. - mov xl, xl, lsl #3 - teq xl, #0x80000000 - biceq r3, r3, #1 - - @ rounding might have created an extra MSB. If so adjust exponent. - tst r3, #0x00800000 - addne r2, r2, #(1 << 20) - bicne r3, r3, #0x00800000 - - @ check exponent for overflow - mov ip, #(0x400 << 20) - orr ip, ip, #(0x07f << 20) - cmp r2, ip - bcs 3f @ overflow - - @ adjust exponent, merge with sign bit and mantissa. - movs xh, xh, lsl #1 - mov r2, r2, lsl #4 - orr r0, r3, r2, rrx - eor r0, r0, #0x40000000 +1: @ shift and round mantissa + and ip, xh, #0x80000000 + mov r2, xl, lsl #3 + orr xl, ip, xl, lsr #29 + cmp r2, #0x80000000 + adc r0, xl, r3, lsl #2 + biceq r0, r0, #1 RET -2: @ chech for NAN - orrs xl, xl, xh, lsl #12 +2: @ either overflow or underflow + tst xh, #0x40000000 + bne 3f @ overflow + + @ check if denormalized value is possible + adds r2, r3, #(23 << 21) + andlt r0, xh, #0x80000000 @ too small, return signed 0. + RETc(lt) + + @ denormalize value so we can resume with the code above afterwards. + orr xh, xh, #0x00100000 + mov r2, r2, lsr #21 + rsb r2, r2, #24 + rsb ip, r2, #32 + movs r3, xl, lsl ip + mov xl, xl, lsr r2 + orrne xl, xl, #1 @ fold r3 for rounding considerations. + mov r3, xh, lsl #11 + mov r3, r3, lsr #11 + orr xl, xl, r3, lsl ip + mov r3, r3, lsr r2 + mov r3, r3, lsl #1 + b 1b + +3: @ chech for NAN + mvns r3, r2, asr #21 + bne 5f @ simple overflow + orrs r3, xl, xh, lsl #12 movne r0, #0x7f000000 orrne r0, r0, #0x00c00000 RETc(ne) @ return NAN -3: @ return INF with sign +5: @ return INF with sign and r0, xh, #0x80000000 orr r0, r0, #0x7f000000 orr r0, r0, #0x00800000 RET -4: @ check if denormalized value is possible - subs r2, r2, #((0x380 - 24) << 20) - andle r0, xh, #0x80000000 @ too small, return signed 0. - RETc(le) - - @ denormalize value so we can resume with the code above afterwards. - orr xh, xh, #0x00100000 - mov r2, r2, lsr #20 - rsb r2, r2, #25 - cmp r2, #20 - bgt 6f - - rsb ip, r2, #32 - mov r3, xl, lsl ip - mov xl, xl, lsr r2 - orr xl, xl, xh, lsl ip - movs xh, xh, lsl #1 - mov xh, xh, lsr r2 - mov xh, xh, rrx -5: teq r3, #0 @ fold r3 bits into the LSB - orrne xl, xl, #1 @ for rounding considerations. - mov r2, #(0x380 << 20) @ equivalent to the 0 float exponent - b 1b - -6: rsb r2, r2, #(12 + 20) - rsb ip, r2, #32 - mov r3, xl, lsl r2 - mov xl, xl, lsr ip - orr xl, xl, xh, lsl r2 - and xh, xh, #0x80000000 - b 5b - + FUNC_END aeabi_d2f FUNC_END truncdfsf2 #endif /* L_truncdfsf2 */ diff --git a/contrib/gcc/config/arm/ieee754-sf.S b/contrib/gcc/config/arm/ieee754-sf.S index 5c972452954..f74f458dd18 100644 --- a/contrib/gcc/config/arm/ieee754-sf.S +++ b/contrib/gcc/config/arm/ieee754-sf.S @@ -1,6 +1,6 @@ /* ieee754-sf.S single-precision floating point support for ARM - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nicolas Pitre (nico@cam.org) This file is free software; you can redistribute it and/or modify it @@ -24,8 +24,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* * Notes: @@ -41,48 +41,46 @@ #ifdef L_negsf2 ARM_FUNC_START negsf2 +ARM_FUNC_ALIAS aeabi_fneg negsf2 + eor r0, r0, #0x80000000 @ flip sign bit RET + FUNC_END aeabi_fneg FUNC_END negsf2 #endif #ifdef L_addsubsf3 +ARM_FUNC_START aeabi_frsub + + eor r0, r0, #0x80000000 @ flip sign bit of first arg + b 1f + ARM_FUNC_START subsf3 +ARM_FUNC_ALIAS aeabi_fsub subsf3 + eor r1, r1, #0x80000000 @ flip sign bit of second arg -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +#if defined(__INTERWORKING_STUBS__) b 1f @ Skip Thumb-code prologue #endif ARM_FUNC_START addsf3 +ARM_FUNC_ALIAS aeabi_fadd addsf3 -1: @ Compare both args, return zero if equal but the sign. - eor r2, r0, r1 - teq r2, #0x80000000 - beq LSYM(Lad_z) - - @ If first arg is 0 or -0, return second arg. - @ If second arg is 0 or -0, return first arg. - bics r2, r0, #0x80000000 - moveq r0, r1 - bicnes r2, r1, #0x80000000 - RETc(eq) - - @ Mask out exponents. - mov ip, #0xff000000 - and r2, r0, ip, lsr #1 - and r3, r1, ip, lsr #1 - - @ If either of them is 255, result will be INF or NAN - teq r2, ip, lsr #1 - teqne r3, ip, lsr #1 - beq LSYM(Lad_i) +1: @ Look for zeroes, equal values, INF, or NAN. + movs r2, r0, lsl #1 + movnes r3, r1, lsl #1 + teqne r2, r3 + mvnnes ip, r2, asr #24 + mvnnes ip, r3, asr #24 + beq LSYM(Lad_s) @ Compute exponent difference. Make largest exponent in r2, @ corresponding arg in r0, and positive exponent difference in r3. - subs r3, r3, r2 + mov r2, r2, lsr #24 + rsbs r3, r2, r3, lsr #24 addgt r2, r2, r3 eorgt r1, r0, r1 eorgt r0, r1, r0 @@ -92,7 +90,7 @@ ARM_FUNC_START addsf3 @ If exponent difference is too large, return largest argument @ already in r0. We need up to 25 bit to handle proper rounding @ of 0x1p25 - 1.1. - cmp r3, #(25 << 23) + cmp r3, #25 RETc(hi) @ Convert mantissa to signed integer. @@ -111,25 +109,17 @@ ARM_FUNC_START addsf3 beq LSYM(Lad_d) LSYM(Lad_x): - @ Scale down second arg with exponent difference. - @ Apply shift one bit left to first arg and the rest to second arg - @ to simplify things later, but only if exponent does not become 0. - movs r3, r3, lsr #23 - teqne r2, #(1 << 23) - movne r0, r0, lsl #1 - subne r2, r2, #(1 << 23) - subne r3, r3, #1 + @ Compensate for the exponent overlapping the mantissa MSB added later + sub r2, r2, #1 - @ Shift second arg into ip, keep leftover bits into r1. - mov ip, r1, asr r3 + @ Shift and add second arg to first arg in r0. + @ Keep leftover bits into r1. + adds r0, r0, r1, asr r3 rsb r3, r3, #32 mov r1, r1, lsl r3 - add r0, r0, ip @ the actual addition - - @ We now have a 64 bit result in r0-r1. - @ Keep absolute value in r0-r1, sign in r3. - ands r3, r0, #0x80000000 + @ Keep absolute value in r0-r1, sign in r3 (the n bit was set above) + and r3, r0, #0x80000000 bpl LSYM(Lad_p) rsbs r1, r1, #0 rsc r0, r0, #0 @@ -137,104 +127,118 @@ LSYM(Lad_x): @ Determine how to normalize the result. LSYM(Lad_p): cmp r0, #0x00800000 - bcc LSYM(Lad_l) + bcc LSYM(Lad_a) cmp r0, #0x01000000 - bcc LSYM(Lad_r0) - cmp r0, #0x02000000 - bcc LSYM(Lad_r1) + bcc LSYM(Lad_e) @ Result needs to be shifted right. movs r0, r0, lsr #1 mov r1, r1, rrx - add r2, r2, #(1 << 23) -LSYM(Lad_r1): - movs r0, r0, lsr #1 - mov r1, r1, rrx - add r2, r2, #(1 << 23) - - @ Our result is now properly aligned into r0, remaining bits in r1. - @ Round with MSB of r1. If halfway between two numbers, round towards - @ LSB of r0 = 0. -LSYM(Lad_r0): - add r0, r0, r1, lsr #31 - teq r1, #0x80000000 - biceq r0, r0, #1 - - @ Rounding may have added a new MSB. Adjust exponent. - @ That MSB will be cleared when exponent is merged below. - tst r0, #0x01000000 - addne r2, r2, #(1 << 23) + add r2, r2, #1 @ Make sure we did not bust our exponent. - cmp r2, #(254 << 23) - bhi LSYM(Lad_o) + cmp r2, #254 + bhs LSYM(Lad_o) + @ Our result is now properly aligned into r0, remaining bits in r1. @ Pack final result together. + @ Round with MSB of r1. If halfway between two numbers, round towards + @ LSB of r0 = 0. LSYM(Lad_e): - bic r0, r0, #0x01800000 - orr r0, r0, r2 + cmp r1, #0x80000000 + adc r0, r0, r2, lsl #23 + biceq r0, r0, #1 orr r0, r0, r3 RET - @ Result must be shifted left. - @ No rounding necessary since r1 will always be 0. + @ Result must be shifted left and exponent adjusted. +LSYM(Lad_a): + movs r1, r1, lsl #1 + adc r0, r0, r0 + tst r0, #0x00800000 + sub r2, r2, #1 + bne LSYM(Lad_e) + + @ No rounding necessary since r1 will always be 0 at this point. LSYM(Lad_l): #if __ARM_ARCH__ < 5 movs ip, r0, lsr #12 moveq r0, r0, lsl #12 - subeq r2, r2, #(12 << 23) + subeq r2, r2, #12 tst r0, #0x00ff0000 moveq r0, r0, lsl #8 - subeq r2, r2, #(8 << 23) + subeq r2, r2, #8 tst r0, #0x00f00000 moveq r0, r0, lsl #4 - subeq r2, r2, #(4 << 23) + subeq r2, r2, #4 tst r0, #0x00c00000 moveq r0, r0, lsl #2 - subeq r2, r2, #(2 << 23) - tst r0, #0x00800000 - moveq r0, r0, lsl #1 - subeq r2, r2, #(1 << 23) - cmp r2, #0 - bgt LSYM(Lad_e) + subeq r2, r2, #2 + cmp r0, #0x00800000 + movcc r0, r0, lsl #1 + sbcs r2, r2, #0 #else clz ip, r0 sub ip, ip, #8 + subs r2, r2, ip mov r0, r0, lsl ip - subs r2, r2, ip, lsl #23 - bgt LSYM(Lad_e) #endif - @ Exponent too small, denormalize result. - mvn r2, r2, asr #23 - add r2, r2, #2 - orr r0, r3, r0, lsr r2 + @ Final result with sign + @ If exponent negative, denormalize result. + addge r0, r0, r2, lsl #23 + rsblt r2, r2, #0 + orrge r0, r0, r3 + orrlt r0, r3, r0, lsr r2 RET @ Fixup and adjust bit position for denormalized arguments. @ Note that r2 must not remain equal to 0. LSYM(Lad_d): teq r2, #0 - eoreq r0, r0, #0x00800000 - addeq r2, r2, #(1 << 23) eor r1, r1, #0x00800000 - subne r3, r3, #(1 << 23) + eoreq r0, r0, #0x00800000 + addeq r2, r2, #1 + subne r3, r3, #1 b LSYM(Lad_x) - @ Result is x - x = 0, unless x is INF or NAN. -LSYM(Lad_z): - mov ip, #0xff000000 - and r2, r0, ip, lsr #1 - teq r2, ip, lsr #1 - moveq r0, ip, asr #2 - movne r0, #0 +LSYM(Lad_s): + mov r3, r1, lsl #1 + + mvns ip, r2, asr #24 + mvnnes ip, r3, asr #24 + beq LSYM(Lad_i) + + teq r2, r3 + beq 1f + + @ Result is x + 0.0 = x or 0.0 + y = y. + teq r2, #0 + moveq r0, r1 RET +1: teq r0, r1 + + @ Result is x - x = 0. + movne r0, #0 + RETc(ne) + + @ Result is x + x = 2x. + tst r2, #0xff000000 + bne 2f + movs r0, r0, lsl #1 + orrcs r0, r0, #0x80000000 + RET +2: adds r2, r2, #(2 << 24) + addcc r0, r0, #(1 << 23) + RETc(cc) + and r3, r0, #0x80000000 + @ Overflow: return INF. LSYM(Lad_o): orr r0, r3, #0x7f000000 @@ -246,191 +250,271 @@ LSYM(Lad_o): @ if r1 != INF/NAN: return r0 (which is INF/NAN) @ if r0 or r1 is NAN: return NAN @ if opposite sign: return NAN - @ return r0 (which is INF or -INF) + @ otherwise return r0 (which is INF or -INF) LSYM(Lad_i): - teq r2, ip, lsr #1 + mvns r2, r2, asr #24 movne r0, r1 - teqeq r3, ip, lsr #1 - RETc(ne) + mvneqs r3, r3, asr #24 + movne r1, r0 movs r2, r0, lsl #9 - moveqs r2, r1, lsl #9 + moveqs r3, r1, lsl #9 teqeq r0, r1 - orrne r0, r3, #0x00400000 @ NAN + orrne r0, r0, #0x00400000 @ quiet NAN RET + FUNC_END aeabi_frsub + FUNC_END aeabi_fadd FUNC_END addsf3 + FUNC_END aeabi_fsub FUNC_END subsf3 ARM_FUNC_START floatunsisf +ARM_FUNC_ALIAS aeabi_ui2f floatunsisf + mov r3, #0 b 1f ARM_FUNC_START floatsisf +ARM_FUNC_ALIAS aeabi_i2f floatsisf + ands r3, r0, #0x80000000 rsbmi r0, r0, #0 -1: teq r0, #0 +1: movs ip, r0 RETc(eq) - mov r1, #0 - mov r2, #((127 + 23) << 23) - tst r0, #0xfc000000 - beq LSYM(Lad_p) + @ Add initial exponent to sign + orr r3, r3, #((127 + 23) << 23) - @ We need to scale the value a little before branching to code above. - tst r0, #0xf0000000 - movne r1, r0, lsl #28 - movne r0, r0, lsr #4 - addne r2, r2, #(4 << 23) - tst r0, #0x0c000000 - beq LSYM(Lad_p) - mov r1, r1, lsr #2 - orr r1, r1, r0, lsl #30 - mov r0, r0, lsr #2 - add r2, r2, #(2 << 23) - b LSYM(Lad_p) + .ifnc ah, r0 + mov ah, r0 + .endif + mov al, #0 + b 2f + FUNC_END aeabi_i2f FUNC_END floatsisf + FUNC_END aeabi_ui2f FUNC_END floatunsisf +ARM_FUNC_START floatundisf +ARM_FUNC_ALIAS aeabi_ul2f floatundisf + + orrs r2, r0, r1 +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + mvfeqs f0, #0.0 +#endif + RETc(eq) + + mov r3, #0 + b 1f + +ARM_FUNC_START floatdisf +ARM_FUNC_ALIAS aeabi_l2f floatdisf + + orrs r2, r0, r1 +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + mvfeqs f0, #0.0 +#endif + RETc(eq) + + ands r3, ah, #0x80000000 @ sign bit in r3 + bpl 1f + rsbs al, al, #0 + rsc ah, ah, #0 +1: +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + @ For hard FPA code we want to return via the tail below so that + @ we can return the result in f0 as well as in r0 for backwards + @ compatibility. + str lr, [sp, #-8]! + adr lr, LSYM(f0_ret) +#endif + + movs ip, ah + moveq ip, al + moveq ah, al + moveq al, #0 + + @ Add initial exponent to sign + orr r3, r3, #((127 + 23 + 32) << 23) + subeq r3, r3, #(32 << 23) +2: sub r3, r3, #(1 << 23) + +#if __ARM_ARCH__ < 5 + + mov r2, #23 + cmp ip, #(1 << 16) + movhs ip, ip, lsr #16 + subhs r2, r2, #16 + cmp ip, #(1 << 8) + movhs ip, ip, lsr #8 + subhs r2, r2, #8 + cmp ip, #(1 << 4) + movhs ip, ip, lsr #4 + subhs r2, r2, #4 + cmp ip, #(1 << 2) + subhs r2, r2, #2 + sublo r2, r2, ip, lsr #1 + subs r2, r2, ip, lsr #3 + +#else + + clz r2, ip + subs r2, r2, #8 + +#endif + + sub r3, r3, r2, lsl #23 + blt 3f + + add r3, r3, ah, lsl r2 + mov ip, al, lsl r2 + rsb r2, r2, #32 + cmp ip, #0x80000000 + adc r0, r3, al, lsr r2 + biceq r0, r0, #1 + RET + +3: add r2, r2, #32 + mov ip, ah, lsl r2 + rsb r2, r2, #32 + orrs al, al, ip, lsl #1 + adc r0, r3, ah, lsr r2 + biceq r0, r0, ip, lsr #31 + RET + +#if !defined (__VFP_FP__) && !defined(__SOFTFP__) + +LSYM(f0_ret): + str r0, [sp, #-4]! + ldfs f0, [sp], #4 + RETLDM + +#endif + + FUNC_END floatdisf + FUNC_END aeabi_l2f + FUNC_END floatundisf + FUNC_END aeabi_ul2f + #endif /* L_addsubsf3 */ #ifdef L_muldivsf3 ARM_FUNC_START mulsf3 +ARM_FUNC_ALIAS aeabi_fmul mulsf3 - @ Mask out exponents. - mov ip, #0xff000000 - and r2, r0, ip, lsr #1 - and r3, r1, ip, lsr #1 - - @ Trap any INF/NAN. - teq r2, ip, lsr #1 - teqne r3, ip, lsr #1 + @ Mask out exponents, trap any zero/denormal/INF/NAN. + mov ip, #0xff + ands r2, ip, r0, lsr #23 + andnes r3, ip, r1, lsr #23 + teqne r2, ip + teqne r3, ip beq LSYM(Lml_s) - - @ Trap any multiplication by 0. - bics ip, r0, #0x80000000 - bicnes ip, r1, #0x80000000 - beq LSYM(Lml_z) - - @ Shift exponents right one bit to make room for overflow bit. - @ If either of them is 0, scale denormalized arguments off line. - @ Then add both exponents together. - movs r2, r2, lsr #1 - teqne r3, #0 - beq LSYM(Lml_d) LSYM(Lml_x): - add r2, r2, r3, asr #1 - @ Preserve final sign in r2 along with exponent for now. - teq r0, r1 - orrmi r2, r2, #0x8000 + @ Add exponents together + add r2, r2, r3 + + @ Determine final sign. + eor ip, r0, r1 @ Convert mantissa to unsigned integer. - bic r0, r0, #0xff000000 - bic r1, r1, #0xff000000 - orr r0, r0, #0x00800000 - orr r1, r1, #0x00800000 + @ If power of two, branch to a separate path. + @ Make up for final alignment. + movs r0, r0, lsl #9 + movnes r1, r1, lsl #9 + beq LSYM(Lml_1) + mov r3, #0x08000000 + orr r0, r3, r0, lsr #5 + orr r1, r3, r1, lsr #5 #if __ARM_ARCH__ < 4 + @ Put sign bit in r3, which will be restored into r0 later. + and r3, ip, #0x80000000 + @ Well, no way to make it shorter without the umull instruction. - @ We must perform that 24 x 24 -> 48 bit multiplication by hand. - stmfd sp!, {r4, r5} + stmfd sp!, {r3, r4, r5} mov r4, r0, lsr #16 mov r5, r1, lsr #16 - bic r0, r0, #0x00ff0000 - bic r1, r1, #0x00ff0000 + bic r0, r0, r4, lsl #16 + bic r1, r1, r5, lsl #16 mul ip, r4, r5 mul r3, r0, r1 mul r0, r5, r0 mla r0, r4, r1, r0 adds r3, r3, r0, lsl #16 - adc ip, ip, r0, lsr #16 - ldmfd sp!, {r4, r5} + adc r1, ip, r0, lsr #16 + ldmfd sp!, {r0, r4, r5} #else - umull r3, ip, r0, r1 @ The actual multiplication. + @ The actual multiplication. + umull r3, r1, r0, r1 + + @ Put final sign in r0. + and r0, ip, #0x80000000 #endif - @ Put final sign in r0. - mov r0, r2, lsl #16 - bic r2, r2, #0x8000 + @ Adjust result upon the MSB position. + cmp r1, #(1 << 23) + movcc r1, r1, lsl #1 + orrcc r1, r1, r3, lsr #31 + movcc r3, r3, lsl #1 - @ Adjust result if one extra MSB appeared. - @ The LSB may be lost but this never changes the result in this case. - tst ip, #(1 << 15) - addne r2, r2, #(1 << 22) - movnes ip, ip, lsr #1 - movne r3, r3, rrx + @ Add sign to result. + orr r0, r0, r1 - @ Apply exponent bias, check range for underflow. - subs r2, r2, #(127 << 22) - ble LSYM(Lml_u) + @ Apply exponent bias, check for under/overflow. + sbc r2, r2, #127 + cmp r2, #(254 - 1) + bhi LSYM(Lml_u) - @ Scale back to 24 bits with rounding. - @ r0 contains sign bit already. - orrs r0, r0, r3, lsr #23 - adc r0, r0, ip, lsl #9 - - @ If halfway between two numbers, rounding should be towards LSB = 0. - mov r3, r3, lsl #9 - teq r3, #0x80000000 + @ Round the result, merge final exponent. + cmp r3, #0x80000000 + adc r0, r0, r2, lsl #23 biceq r0, r0, #1 - - @ Note: rounding may have produced an extra MSB here. - @ The extra bit is cleared before merging the exponent below. - tst r0, #0x01000000 - addne r2, r2, #(1 << 22) - - @ Check for exponent overflow - cmp r2, #(255 << 22) - bge LSYM(Lml_o) - - @ Add final exponent. - bic r0, r0, #0x01800000 - orr r0, r0, r2, lsl #1 RET - @ Result is 0, but determine sign anyway. -LSYM(Lml_z): - eor r0, r0, r1 - bic r0, r0, #0x7fffffff - RET + @ Multiplication by 0x1p*: let''s shortcut a lot of code. +LSYM(Lml_1): + teq r0, #0 + and ip, ip, #0x80000000 + moveq r1, r1, lsl #9 + orr r0, ip, r0, lsr #9 + orr r0, r0, r1, lsr #9 + subs r2, r2, #127 + rsbgts r3, r2, #255 + orrgt r0, r0, r2, lsl #23 + RETc(gt) + + @ Under/overflow: fix things up for the code below. + orr r0, r0, #0x00800000 + mov r3, #0 + subs r2, r2, #1 + +LSYM(Lml_u): + @ Overflow? + bgt LSYM(Lml_o) @ Check if denormalized result is possible, otherwise return signed 0. -LSYM(Lml_u): - cmn r2, #(24 << 22) + cmn r2, #(24 + 1) + bicle r0, r0, #0x7fffffff RETc(le) - @ Find out proper shift value. - mvn r1, r2, asr #22 - subs r1, r1, #7 - bgt LSYM(Lml_ur) - - @ Shift value left, round, etc. - add r1, r1, #32 - orrs r0, r0, r3, lsr r1 - rsb r1, r1, #32 - adc r0, r0, ip, lsl r1 - mov ip, r3, lsl r1 - teq ip, #0x80000000 - biceq r0, r0, #1 - RET - @ Shift value right, round, etc. - @ Note: r1 must not be 0 otherwise carry does not get set. -LSYM(Lml_ur): - orrs r0, r0, ip, lsr r1 + rsb r2, r2, #0 + movs r1, r0, lsl #1 + mov r1, r1, lsr r2 + rsb r2, r2, #32 + mov ip, r0, lsl r2 + movs r0, r1, rrx adc r0, r0, #0 - rsb r1, r1, #32 - mov ip, ip, lsl r1 - teq r3, #0 - teqeq ip, #0x80000000 - biceq r0, r0, #1 + orrs r3, r3, ip, lsl #1 + biceq r0, r0, ip, lsr #31 RET @ One or both arguments are denormalized. @@ -440,32 +524,51 @@ LSYM(Lml_d): and ip, r0, #0x80000000 1: moveq r0, r0, lsl #1 tsteq r0, #0x00800000 - subeq r2, r2, #(1 << 22) + subeq r2, r2, #1 beq 1b orr r0, r0, ip teq r3, #0 and ip, r1, #0x80000000 2: moveq r1, r1, lsl #1 tsteq r1, #0x00800000 - subeq r3, r3, #(1 << 23) + subeq r3, r3, #1 beq 2b orr r1, r1, ip b LSYM(Lml_x) - @ One or both args are INF or NAN. LSYM(Lml_s): + @ Isolate the INF and NAN cases away + and r3, ip, r1, lsr #23 + teq r2, ip + teqne r3, ip + beq 1f + + @ Here, one or more arguments are either denormalized or zero. + bics ip, r0, #0x80000000 + bicnes ip, r1, #0x80000000 + bne LSYM(Lml_d) + + @ Result is 0, but determine sign anyway. +LSYM(Lml_z): + eor r0, r0, r1 + bic r0, r0, #0x7fffffff + RET + +1: @ One or both args are INF or NAN. teq r0, #0x0 - teqne r1, #0x0 teqne r0, #0x80000000 + moveq r0, r1 + teqne r1, #0x0 teqne r1, #0x80000000 beq LSYM(Lml_n) @ 0 * INF or INF * 0 -> NAN - teq r2, ip, lsr #1 + teq r2, ip bne 1f movs r2, r0, lsl #9 bne LSYM(Lml_n) @ NAN * -> NAN -1: teq r3, ip, lsr #1 +1: teq r3, ip bne LSYM(Lml_i) movs r3, r1, lsl #9 + movne r0, r1 bne LSYM(Lml_n) @ * NAN -> NAN @ Result is INF, but we need to determine its sign. @@ -479,46 +582,39 @@ LSYM(Lml_o): orr r0, r0, #0x00800000 RET - @ Return NAN. + @ Return a quiet NAN. LSYM(Lml_n): - mov r0, #0x7f000000 + orr r0, r0, #0x7f000000 orr r0, r0, #0x00c00000 RET + FUNC_END aeabi_fmul FUNC_END mulsf3 ARM_FUNC_START divsf3 +ARM_FUNC_ALIAS aeabi_fdiv divsf3 - @ Mask out exponents. - mov ip, #0xff000000 - and r2, r0, ip, lsr #1 - and r3, r1, ip, lsr #1 - - @ Trap any INF/NAN or zeroes. - teq r2, ip, lsr #1 - teqne r3, ip, lsr #1 - bicnes ip, r0, #0x80000000 - bicnes ip, r1, #0x80000000 + @ Mask out exponents, trap any zero/denormal/INF/NAN. + mov ip, #0xff + ands r2, ip, r0, lsr #23 + andnes r3, ip, r1, lsr #23 + teqne r2, ip + teqne r3, ip beq LSYM(Ldv_s) - - @ Shift exponents right one bit to make room for overflow bit. - @ If either of them is 0, scale denormalized arguments off line. - @ Then substract divisor exponent from dividend''s. - movs r2, r2, lsr #1 - teqne r3, #0 - beq LSYM(Ldv_d) LSYM(Ldv_x): - sub r2, r2, r3, asr #1 + + @ Substract divisor exponent from dividend''s + sub r2, r2, r3 @ Preserve final sign into ip. eor ip, r0, r1 @ Convert mantissa to unsigned integer. @ Dividend -> r3, divisor -> r1. - mov r3, #0x10000000 movs r1, r1, lsl #9 mov r0, r0, lsl #9 beq LSYM(Ldv_1) + mov r3, #0x10000000 orr r1, r3, r1, lsr #4 orr r3, r3, r0, lsr #4 @@ -526,16 +622,10 @@ LSYM(Ldv_x): and r0, ip, #0x80000000 @ Ensure result will land to known bit position. + @ Apply exponent bias accordingly. cmp r3, r1 - subcc r2, r2, #(1 << 22) movcc r3, r3, lsl #1 - - @ Apply exponent bias, check range for over/underflow. - add r2, r2, #(127 << 22) - cmn r2, #(24 << 22) - RETc(le) - cmp r2, #(255 << 22) - bge LSYM(Lml_o) + adc r2, r2, #(127 - 2) @ The actual division loop. mov ip, #0x00800000 @@ -555,44 +645,29 @@ LSYM(Ldv_x): movnes ip, ip, lsr #4 bne 1b - @ Check if denormalized result is needed. - cmp r2, #0 - ble LSYM(Ldv_u) + @ Check exponent for under/overflow. + cmp r2, #(254 - 1) + bhi LSYM(Lml_u) - @ Apply proper rounding. + @ Round the result, merge final exponent. cmp r3, r1 - addcs r0, r0, #1 + adc r0, r0, r2, lsl #23 biceq r0, r0, #1 - - @ Add exponent to result. - bic r0, r0, #0x00800000 - orr r0, r0, r2, lsl #1 RET @ Division by 0x1p*: let''s shortcut a lot of code. LSYM(Ldv_1): and ip, ip, #0x80000000 orr r0, ip, r0, lsr #9 - add r2, r2, #(127 << 22) - cmp r2, #(255 << 22) - bge LSYM(Lml_o) - cmp r2, #0 - orrgt r0, r0, r2, lsl #1 + adds r2, r2, #127 + rsbgts r3, r2, #255 + orrgt r0, r0, r2, lsl #23 RETc(gt) - cmn r2, #(24 << 22) - movle r0, ip - RETc(le) + orr r0, r0, #0x00800000 mov r3, #0 - - @ Result must be denormalized: prepare parameters to use code above. - @ r3 already contains remainder for rounding considerations. -LSYM(Ldv_u): - bic ip, r0, #0x80000000 - and r0, r0, #0x80000000 - mvn r1, r2, asr #22 - add r1, r1, #2 - b LSYM(Lml_ur) + subs r2, r2, #1 + b LSYM(Lml_u) @ One or both arguments are denormalized. @ Scale them leftwards and preserve sign bit. @@ -601,108 +676,114 @@ LSYM(Ldv_d): and ip, r0, #0x80000000 1: moveq r0, r0, lsl #1 tsteq r0, #0x00800000 - subeq r2, r2, #(1 << 22) + subeq r2, r2, #1 beq 1b orr r0, r0, ip teq r3, #0 and ip, r1, #0x80000000 2: moveq r1, r1, lsl #1 tsteq r1, #0x00800000 - subeq r3, r3, #(1 << 23) + subeq r3, r3, #1 beq 2b orr r1, r1, ip b LSYM(Ldv_x) - @ One or both arguments is either INF, NAN or zero. + @ One or both arguments are either INF, NAN, zero or denormalized. LSYM(Ldv_s): - mov ip, #0xff000000 - teq r2, ip, lsr #1 - teqeq r3, ip, lsr #1 - beq LSYM(Lml_n) @ INF/NAN / INF/NAN -> NAN - teq r2, ip, lsr #1 + and r3, ip, r1, lsr #23 + teq r2, ip bne 1f movs r2, r0, lsl #9 bne LSYM(Lml_n) @ NAN / -> NAN - b LSYM(Lml_i) @ INF / -> INF -1: teq r3, ip, lsr #1 + teq r3, ip + bne LSYM(Lml_i) @ INF / -> INF + mov r0, r1 + b LSYM(Lml_n) @ INF / (INF or NAN) -> NAN +1: teq r3, ip bne 2f movs r3, r1, lsl #9 - bne LSYM(Lml_n) @ / NAN -> NAN - b LSYM(Lml_z) @ / INF -> 0 -2: @ One or both arguments are 0. + beq LSYM(Lml_z) @ / INF -> 0 + mov r0, r1 + b LSYM(Lml_n) @ / NAN -> NAN +2: @ If both are nonzero, we need to normalize and resume above. + bics ip, r0, #0x80000000 + bicnes ip, r1, #0x80000000 + bne LSYM(Ldv_d) + @ One or both arguments are zero. bics r2, r0, #0x80000000 bne LSYM(Lml_i) @ / 0 -> INF bics r3, r1, #0x80000000 bne LSYM(Lml_z) @ 0 / -> 0 b LSYM(Lml_n) @ 0 / 0 -> NAN + FUNC_END aeabi_fdiv FUNC_END divsf3 #endif /* L_muldivsf3 */ #ifdef L_cmpsf2 + @ The return value in r0 is + @ + @ 0 if the operands are equal + @ 1 if the first operand is greater than the second, or + @ the operands are unordered and the operation is + @ CMP, LT, LE, NE, or EQ. + @ -1 if the first operand is less than the second, or + @ the operands are unordered and the operation is GT + @ or GE. + @ + @ The Z flag will be set iff the operands are equal. + @ + @ The following registers are clobbered by this function: + @ ip, r0, r1, r2, r3 + ARM_FUNC_START gtsf2 ARM_FUNC_ALIAS gesf2 gtsf2 - mov r3, #-1 + mov ip, #-1 b 1f ARM_FUNC_START ltsf2 ARM_FUNC_ALIAS lesf2 ltsf2 - mov r3, #1 + mov ip, #1 b 1f ARM_FUNC_START cmpsf2 ARM_FUNC_ALIAS nesf2 cmpsf2 ARM_FUNC_ALIAS eqsf2 cmpsf2 - mov r3, #1 @ how should we specify unordered here? + mov ip, #1 @ how should we specify unordered here? -1: @ Trap any INF/NAN first. - mov ip, #0xff000000 - and r2, r1, ip, lsr #1 - teq r2, ip, lsr #1 - and r2, r0, ip, lsr #1 - teqne r2, ip, lsr #1 +1: str ip, [sp, #-4] + + @ Trap any INF/NAN first. + mov r2, r0, lsl #1 + mov r3, r1, lsl #1 + mvns ip, r2, asr #24 + mvnnes ip, r3, asr #24 beq 3f - @ Test for equality. + @ Compare values. @ Note that 0.0 is equal to -0.0. -2: orr r3, r0, r1 - bics r3, r3, #0x80000000 @ either 0.0 or -0.0 - teqne r0, r1 @ or both the same - moveq r0, #0 - RETc(eq) +2: orrs ip, r2, r3, lsr #1 @ test if both are 0, clear C flag + teqne r0, r1 @ if not 0 compare sign + subpls r0, r2, r3 @ if same sign compare values, set r0 - @ Check for sign difference. The N flag is set if it is the case. - @ If so, return sign of r0. - movmi r0, r0, asr #31 - orrmi r0, r0, #1 - RETc(mi) - - @ Compare exponents. - and r3, r1, ip, lsr #1 - cmp r2, r3 - - @ Compare mantissa if exponents are equal - moveq r0, r0, lsl #9 - cmpeq r0, r1, lsl #9 - movcs r0, r1, asr #31 - mvncc r0, r1, asr #31 - orr r0, r0, #1 + @ Result: + movhi r0, r1, asr #31 + mvnlo r0, r1, asr #31 + orrne r0, r0, #1 RET @ Look for a NAN. -3: and r2, r1, ip, lsr #1 - teq r2, ip, lsr #1 +3: mvns ip, r2, asr #24 bne 4f - movs r2, r1, lsl #9 - bne 5f @ r1 is NAN -4: and r2, r0, ip, lsr #1 - teq r2, ip, lsr #1 - bne 2b movs ip, r0, lsl #9 - beq 2b @ r0 is not NAN -5: mov r0, r3 @ return unordered code from r3. + bne 5f @ r0 is NAN +4: mvns ip, r3, asr #24 + bne 2b + movs ip, r1, lsl #9 + beq 2b @ r1 is not NAN +5: ldr r0, [sp, #-4] @ return unordered code. RET FUNC_END gesf2 @@ -713,27 +794,105 @@ ARM_FUNC_ALIAS eqsf2 cmpsf2 FUNC_END eqsf2 FUNC_END cmpsf2 +ARM_FUNC_START aeabi_cfrcmple + + mov ip, r0 + mov r0, r1 + mov r1, ip + b 6f + +ARM_FUNC_START aeabi_cfcmpeq +ARM_FUNC_ALIAS aeabi_cfcmple aeabi_cfcmpeq + + @ The status-returning routines are required to preserve all + @ registers except ip, lr, and cpsr. +6: stmfd sp!, {r0, r1, r2, r3, lr} + ARM_CALL cmpsf2 + @ Set the Z flag correctly, and the C flag unconditionally. + cmp r0, #0 + @ Clear the C flag if the return value was -1, indicating + @ that the first operand was smaller than the second. + cmnmi r0, #0 + RETLDM "r0, r1, r2, r3" + + FUNC_END aeabi_cfcmple + FUNC_END aeabi_cfcmpeq + FUNC_END aeabi_cfrcmple + +ARM_FUNC_START aeabi_fcmpeq + + str lr, [sp, #-8]! + ARM_CALL aeabi_cfcmple + moveq r0, #1 @ Equal to. + movne r0, #0 @ Less than, greater than, or unordered. + RETLDM + + FUNC_END aeabi_fcmpeq + +ARM_FUNC_START aeabi_fcmplt + + str lr, [sp, #-8]! + ARM_CALL aeabi_cfcmple + movcc r0, #1 @ Less than. + movcs r0, #0 @ Equal to, greater than, or unordered. + RETLDM + + FUNC_END aeabi_fcmplt + +ARM_FUNC_START aeabi_fcmple + + str lr, [sp, #-8]! + ARM_CALL aeabi_cfcmple + movls r0, #1 @ Less than or equal to. + movhi r0, #0 @ Greater than or unordered. + RETLDM + + FUNC_END aeabi_fcmple + +ARM_FUNC_START aeabi_fcmpge + + str lr, [sp, #-8]! + ARM_CALL aeabi_cfrcmple + movls r0, #1 @ Operand 2 is less than or equal to operand 1. + movhi r0, #0 @ Operand 2 greater than operand 1, or unordered. + RETLDM + + FUNC_END aeabi_fcmpge + +ARM_FUNC_START aeabi_fcmpgt + + str lr, [sp, #-8]! + ARM_CALL aeabi_cfrcmple + movcc r0, #1 @ Operand 2 is less than operand 1. + movcs r0, #0 @ Operand 2 is greater than or equal to operand 1, + @ or they are unordered. + RETLDM + + FUNC_END aeabi_fcmpgt + #endif /* L_cmpsf2 */ #ifdef L_unordsf2 ARM_FUNC_START unordsf2 - mov ip, #0xff000000 - and r2, r1, ip, lsr #1 - teq r2, ip, lsr #1 +ARM_FUNC_ALIAS aeabi_fcmpun unordsf2 + + mov r2, r0, lsl #1 + mov r3, r1, lsl #1 + mvns ip, r2, asr #24 bne 1f - movs r2, r1, lsl #9 - bne 3f @ r1 is NAN -1: and r2, r0, ip, lsr #1 - teq r2, ip, lsr #1 - bne 2f - movs r2, r0, lsl #9 + movs ip, r0, lsl #9 bne 3f @ r0 is NAN +1: mvns ip, r3, asr #24 + bne 2f + movs ip, r1, lsl #9 + bne 3f @ r1 is NAN 2: mov r0, #0 @ arguments are ordered. RET 3: mov r0, #1 @ arguments are unordered. RET + FUNC_END aeabi_fcmpun FUNC_END unordsf2 #endif /* L_unordsf2 */ @@ -741,39 +900,39 @@ ARM_FUNC_START unordsf2 #ifdef L_fixsfsi ARM_FUNC_START fixsfsi - movs r0, r0, lsl #1 - RETc(eq) @ value is 0. - - mov r1, r1, rrx @ preserve C flag (the actual sign) +ARM_FUNC_ALIAS aeabi_f2iz fixsfsi @ check exponent range. - and r2, r0, #0xff000000 + mov r2, r0, lsl #1 cmp r2, #(127 << 24) - movcc r0, #0 @ value is too small - RETc(cc) - cmp r2, #((127 + 31) << 24) - bcs 1f @ value is too large + bcc 1f @ value is too small + mov r3, #(127 + 31) + subs r2, r3, r2, lsr #24 + bls 2f @ value is too large - mov r0, r0, lsl #7 - orr r0, r0, #0x80000000 - mov r2, r2, lsr #24 - rsb r2, r2, #(127 + 31) - tst r1, #0x80000000 @ the sign bit - mov r0, r0, lsr r2 + @ scale value + mov r3, r0, lsl #8 + orr r3, r3, #0x80000000 + tst r0, #0x80000000 @ the sign bit + mov r0, r3, lsr r2 rsbne r0, r0, #0 RET -1: teq r2, #0xff000000 - bne 2f - movs r0, r0, lsl #8 - bne 3f @ r0 is NAN. -2: ands r0, r1, #0x80000000 @ the sign bit +1: mov r0, #0 + RET + +2: cmp r2, #(127 + 31 - 0xff) + bne 3f + movs r2, r0, lsl #9 + bne 4f @ r0 is NAN. +3: ands r0, r0, #0x80000000 @ the sign bit moveq r0, #0x7fffffff @ the maximum signed positive si RET -3: mov r0, #0 @ What should we convert NAN to? +4: mov r0, #0 @ What should we convert NAN to? RET + FUNC_END aeabi_f2iz FUNC_END fixsfsi #endif /* L_fixsfsi */ @@ -781,36 +940,37 @@ ARM_FUNC_START fixsfsi #ifdef L_fixunssfsi ARM_FUNC_START fixunssfsi - movs r0, r0, lsl #1 - movcss r0, #0 @ value is negative... - RETc(eq) @ ... or 0. - +ARM_FUNC_ALIAS aeabi_f2uiz fixunssfsi @ check exponent range. - and r2, r0, #0xff000000 + movs r2, r0, lsl #1 + bcs 1f @ value is negative cmp r2, #(127 << 24) - movcc r0, #0 @ value is too small - RETc(cc) - cmp r2, #((127 + 32) << 24) - bcs 1f @ value is too large + bcc 1f @ value is too small + mov r3, #(127 + 31) + subs r2, r3, r2, lsr #24 + bmi 2f @ value is too large - mov r0, r0, lsl #7 - orr r0, r0, #0x80000000 - mov r2, r2, lsr #24 - rsb r2, r2, #(127 + 31) - mov r0, r0, lsr r2 + @ scale the value + mov r3, r0, lsl #8 + orr r3, r3, #0x80000000 + mov r0, r3, lsr r2 RET -1: teq r2, #0xff000000 - bne 2f - movs r0, r0, lsl #8 - bne 3f @ r0 is NAN. -2: mov r0, #0xffffffff @ maximum unsigned si +1: mov r0, #0 RET -3: mov r0, #0 @ What should we convert NAN to? +2: cmp r2, #(127 + 31 - 0xff) + bne 3f + movs r2, r0, lsl #9 + bne 4f @ r0 is NAN. +3: mov r0, #0xffffffff @ maximum unsigned si RET +4: mov r0, #0 @ What should we convert NAN to? + RET + + FUNC_END aeabi_f2uiz FUNC_END fixunssfsi #endif /* L_fixunssfsi */ diff --git a/contrib/gcc/config/arm/iwmmxt.md b/contrib/gcc/config/arm/iwmmxt.md index f8070a88594..380d4b95455 100644 --- a/contrib/gcc/config/arm/iwmmxt.md +++ b/contrib/gcc/config/arm/iwmmxt.md @@ -1,5 +1,5 @@ ;; Patterns for the Intel Wireless MMX technology architecture. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; This file is part of GCC. @@ -16,8 +16,8 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. (define_insn "iwmmxt_iordi3" [(set (match_operand:DI 0 "register_operand" "=y,?&r,?&r") @@ -64,15 +64,19 @@ [(set_attr "predicable" "yes")]) (define_insn "*iwmmxt_arm_movdi" - [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>,y,y,yr,y,yrm") - (match_operand:DI 1 "di_operand" "rIK,mi,r ,y,yr,y,yrm,y"))] - "TARGET_REALLY_IWMMXT" + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, m,y,y,yr,y,yrUy") + (match_operand:DI 1 "di_operand" "rIK,mi,r,y,yr,y,yrUy,y"))] + "TARGET_REALLY_IWMMXT + && ( register_operand (operands[0], DImode) + || register_operand (operands[1], DImode))" "* { switch (which_alternative) { default: return output_move_double (operands); + case 0: + return \"#\"; case 3: return \"wmov%?\\t%0,%1\"; case 4: @@ -86,14 +90,14 @@ } }" [(set_attr "length" "8,8,8,4,4,4,4,4") - (set_attr "type" "*,load,store2,*,*,*,*,*") + (set_attr "type" "*,load1,store2,*,*,*,*,*") (set_attr "pool_range" "*,1020,*,*,*,*,*,*") (set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")] ) (define_insn "*iwmmxt_movsi_insn" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m,z,r,?z,m,z") - (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,z,m,z,z"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m,z,r,?z,Uy,z") + (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,z,Uy,z,z"))] "TARGET_REALLY_IWMMXT && ( register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" @@ -110,7 +114,7 @@ case 7: return \"wstrw\\t%1, %0\"; default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\"; }" - [(set_attr "type" "*,*,load,store1,*,*,load,store1,*") + [(set_attr "type" "*,*,load1,store1,*,*,load1,store1,*") (set_attr "length" "*,*,*, *,*,*, 16, *,8") (set_attr "pool_range" "*,*,4096, *,*,*,1024, *,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*") @@ -148,14 +152,14 @@ case 4: return \"tmcr%?\\t%0, %1\"; default: return \"tmrc%?\\t%0, %1\"; }" - [(set_attr "type" "*,*,load,store1,*,*") + [(set_attr "type" "*,*,load1,store1,*,*") (set_attr "pool_range" "*,*,4096, *,*,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*")] ) (define_insn "movv8qi_internal" [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V8QI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -169,13 +173,13 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) (define_insn "movv4hi_internal" [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V4HI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -189,13 +193,13 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) (define_insn "movv2si_internal" [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V2SI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -209,7 +213,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 24") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -220,12 +224,12 @@ ;; deliberately omitted. (define_insn "movv2si_internal_2" [(set (match_operand:V2SI 0 "nonimmediate_operand" "=?r") - (match_operand 1 "immediate_operand" "i"))] + (match_operand 1 "immediate_operand" "mi"))] "TARGET_REALLY_IWMMXT" "* return output_move_double (operands);" [(set_attr "predicable" "yes") (set_attr "length" "8") - (set_attr "type" "load") + (set_attr "type" "load1") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")]) @@ -1149,7 +1153,7 @@ "wsrawg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "ashrdi3" +(define_insn "ashrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (ashiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] @@ -1173,7 +1177,7 @@ "wsrlwg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "lshrdi3" +(define_insn "lshrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (lshiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] diff --git a/contrib/gcc/config/arm/kaos-arm.h b/contrib/gcc/config/arm/kaos-arm.h index 0d3bf2d1030..b575489b109 100644 --- a/contrib/gcc/config/arm/kaos-arm.h +++ b/contrib/gcc/config/arm/kaos-arm.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (ARM/kaOS[ELF])", stderr); diff --git a/contrib/gcc/config/arm/kaos-strongarm.h b/contrib/gcc/config/arm/kaos-strongarm.h index 8eb9473bf2b..7be215199aa 100644 --- a/contrib/gcc/config/arm/kaos-strongarm.h +++ b/contrib/gcc/config/arm/kaos-strongarm.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (StrongARM/kaOS[ELF])", stderr); diff --git a/contrib/gcc/config/arm/lib1funcs.asm b/contrib/gcc/config/arm/lib1funcs.asm index e72af6cca51..9245b3ca0c0 100644 --- a/contrib/gcc/config/arm/lib1funcs.asm +++ b/contrib/gcc/config/arm/lib1funcs.asm @@ -1,7 +1,7 @@ @ libgcc routines for ARM cpu. @ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk) -/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004 +/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it @@ -25,8 +25,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* ------------------------------------------------------------------------ */ /* We need to know what prefix to add to function names. */ @@ -60,7 +60,7 @@ Boston, MA 02111-1307, USA. */ #define LSYM(x) x #endif -/* Function end macros. Variants for 26 bit APCS and interworking. */ +/* Function end macros. Variants for interworking. */ @ This selects the minimum architecture level required. #define __ARM_ARCH__ 3 @@ -74,27 +74,44 @@ Boston, MA 02111-1307, USA. */ #endif #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \ - || defined(__ARM_ARCH_5TE__) + || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \ + || defined(__ARM_ARCH_5TEJ__) # undef __ARM_ARCH__ # define __ARM_ARCH__ 5 #endif +#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ + || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ + || defined(__ARM_ARCH_6ZK__) +# undef __ARM_ARCH__ +# define __ARM_ARCH__ 6 +#endif + +#ifndef __ARM_ARCH__ +#error Unable to determine architecture. +#endif + /* How to return from a function call depends on the architecture variant. */ -#ifdef __APCS_26__ - -# define RET movs pc, lr -# define RETc(x) mov##x##s pc, lr - -#elif (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__) +#if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__) # define RET bx lr # define RETc(x) bx##x lr -# if (__ARM_ARCH__ == 4) \ - && (defined(__thumb__) || defined(__THUMB_INTERWORK__)) -# define __INTERWORKING__ -# endif +/* Special precautions for interworking on armv4t. */ +# if (__ARM_ARCH__ == 4) + +/* Always use bx, not ldr pc. */ +# if (defined(__thumb__) || defined(__THUMB_INTERWORK__)) +# define __INTERWORKING__ +# endif /* __THUMB__ || __THUMB_INTERWORK__ */ + +/* Include thumb stub before arm mode code. */ +# if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +# define __INTERWORKING_STUBS__ +# endif /* __thumb__ && !__THUMB_INTERWORK__ */ + +#endif /* __ARM_ARCH == 4 */ #else @@ -103,25 +120,82 @@ Boston, MA 02111-1307, USA. */ #endif +.macro cfi_pop advance, reg, cfa_offset +#ifdef __ELF__ + .pushsection .debug_frame + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte \advance + .byte (0xc0 | \reg) /* DW_CFA_restore */ + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 \cfa_offset + .popsection +#endif +.endm +.macro cfi_push advance, reg, offset, cfa_offset +#ifdef __ELF__ + .pushsection .debug_frame + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte \advance + .byte (0x80 | \reg) /* DW_CFA_offset */ + .uleb128 (\offset / -4) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 \cfa_offset + .popsection +#endif +.endm +.macro cfi_start start_label, end_label +#ifdef __ELF__ + .pushsection .debug_frame +LSYM(Lstart_frame): + .4byte LSYM(Lend_cie) - LSYM(Lstart_cie) @ Length of CIE +LSYM(Lstart_cie): + .4byte 0xffffffff @ CIE Identifier Tag + .byte 0x1 @ CIE Version + .ascii "\0" @ CIE Augmentation + .uleb128 0x1 @ CIE Code Alignment Factor + .sleb128 -4 @ CIE Data Alignment Factor + .byte 0xe @ CIE RA Column + .byte 0xc @ DW_CFA_def_cfa + .uleb128 0xd + .uleb128 0x0 + + .align 2 +LSYM(Lend_cie): + .4byte LSYM(Lend_fde)-LSYM(Lstart_fde) @ FDE Length +LSYM(Lstart_fde): + .4byte LSYM(Lstart_frame) @ FDE CIE offset + .4byte \start_label @ FDE initial location + .4byte \end_label-\start_label @ FDE address range + .popsection +#endif +.endm +.macro cfi_end end_label +#ifdef __ELF__ + .pushsection .debug_frame + .align 2 +LSYM(Lend_fde): + .popsection +\end_label: +#endif +.endm + /* Don't pass dirn, it's there just to get token pasting right. */ -.macro RETLDM regs=, cond=, dirn=ia -#ifdef __APCS_26__ +.macro RETLDM regs=, cond=, unwind=, dirn=ia +#if defined (__INTERWORKING__) .ifc "\regs","" - ldm\cond\dirn sp!, {pc}^ - .else - ldm\cond\dirn sp!, {\regs, pc}^ - .endif -#elif defined (__INTERWORKING__) - .ifc "\regs","" - ldr\cond lr, [sp], #4 + ldr\cond lr, [sp], #8 .else ldm\cond\dirn sp!, {\regs, lr} + .endif + .ifnc "\unwind", "" + /* Mark LR as restored. */ +97: cfi_pop 97b - \unwind, 0xe, 0x0 .endif bx\cond lr #else .ifc "\regs","" - ldr\cond pc, [sp], #4 + ldr\cond pc, [sp], #8 .else ldm\cond\dirn sp!, {\regs, pc} .endif @@ -129,25 +203,25 @@ Boston, MA 02111-1307, USA. */ .endm -.macro ARM_LDIV0 -LSYM(Ldiv0): - str lr, [sp, #-4]! +.macro ARM_LDIV0 name + str lr, [sp, #-8]! +98: cfi_push 98b - __\name, 0xe, -0x8, 0x8 bl SYM (__div0) __PLT__ mov r0, #0 @ About as wrong as it could be. - RETLDM + RETLDM unwind=98b .endm -.macro THUMB_LDIV0 -LSYM(Ldiv0): - push { lr } +.macro THUMB_LDIV0 name + push { r1, lr } +98: cfi_push 98b - __\name, 0xe, -0x4, 0x8 bl SYM (__div0) mov r0, #0 @ About as wrong as it could be. #if defined (__INTERWORKING__) - pop { r1 } - bx r1 + pop { r1, r2 } + bx r2 #else - pop { pc } + pop { r1, pc } #endif .endm @@ -156,12 +230,14 @@ LSYM(Ldiv0): .endm .macro DIV_FUNC_END name + cfi_start __\name, LSYM(Lend_div0) LSYM(Ldiv0): #ifdef __thumb__ - THUMB_LDIV0 + THUMB_LDIV0 \name #else - ARM_LDIV0 + ARM_LDIV0 \name #endif + cfi_end LSYM(Lend_div0) FUNC_END \name .endm @@ -195,15 +271,22 @@ SYM (__\name): /* Special function that will always be coded in ARM assembly, even if in Thumb-only compilation. */ -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +#if defined(__INTERWORKING_STUBS__) .macro ARM_FUNC_START name FUNC_START \name bx pc nop .arm -_L__\name: /* A hook to tell gdb that we've switched to ARM */ +/* A hook to tell gdb that we've switched to ARM mode. Also used to call + directly from other local arm routines. */ +_L__\name: .endm #define EQUIV .thumb_set +/* Branch directly to a function declared with ARM_FUNC_START. + Must be called in arm mode. */ +.macro ARM_CALL name + bl _L__\name +.endm #else .macro ARM_FUNC_START name .text @@ -214,11 +297,26 @@ _L__\name: /* A hook to tell gdb that we've switched to ARM */ SYM (__\name): .endm #define EQUIV .set +.macro ARM_CALL name + bl __\name +.endm #endif +.macro FUNC_ALIAS new old + .globl SYM (__\new) +#if defined (__thumb__) + .thumb_set SYM (__\new), SYM (__\old) +#else + .set SYM (__\new), SYM (__\old) +#endif +.endm + .macro ARM_FUNC_ALIAS new old .globl SYM (__\new) EQUIV SYM (__\new), SYM (__\old) +#if defined(__INTERWORKING_STUBS__) + .set SYM (_L__\new), SYM (_L__\old) +#endif .endm #ifdef __thumb__ @@ -243,6 +341,25 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_DIV_BODY dividend, divisor, result, curbit +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \curbit, \dividend + clz \result, \divisor + sub \curbit, \result, \curbit + rsbs \curbit, \curbit, #31 + addne \curbit, \curbit, \curbit, lsl #1 + mov \result, #0 + addne pc, pc, \curbit, lsl #2 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + adc \result, \result, \result + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \curbit, \divisor @@ -253,7 +370,7 @@ pc .req r15 mov \curbit, \curbit, lsl \result mov \result, #0 -#else +#else /* __ARM_ARCH__ < 5 */ @ Initially shift the divisor left 3 bits if possible, @ set curbit accordingly. This allows for curbit to be located @@ -284,7 +401,7 @@ pc .req r15 mov \result, #0 -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Division loop 1: cmp \dividend, \divisor @@ -304,6 +421,8 @@ pc .req r15 movne \divisor, \divisor, lsr #4 bne 1b +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro ARM_DIV2_ORDER divisor, order @@ -338,6 +457,22 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_MOD_BODY dividend, divisor, order, spare +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \order, \divisor + clz \spare, \dividend + sub \order, \order, \spare + rsbs \order, \order, #31 + addne pc, pc, \order, lsl #3 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \order, \divisor @@ -345,7 +480,7 @@ pc .req r15 sub \order, \order, \spare mov \divisor, \divisor, lsl \order -#else +#else /* __ARM_ARCH__ < 5 */ mov \order, #0 @@ -367,7 +502,7 @@ pc .req r15 addlo \order, \order, #1 blo 1b -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Perform all needed substractions to keep only the reminder. @ Do comparisons in batch of 4 first. @@ -404,6 +539,9 @@ pc .req r15 4: cmp \dividend, \divisor subhs \dividend, \dividend, \divisor 5: + +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro THUMB_DIV_MOD_BODY modulo @@ -568,6 +706,7 @@ LSYM(Lgot_result): #ifdef L_udivsi3 FUNC_START udivsi3 + FUNC_ALIAS aeabi_uidiv udivsi3 #ifdef __thumb__ @@ -614,6 +753,24 @@ LSYM(Lgot_result): DIV_FUNC_END udivsi3 +FUNC_START aeabi_uidivmod +#ifdef __thumb__ + push {r0, r1, lr} + bl SYM(__udivsi3) + POP {r1, r2, r3} + mul r2, r0 + sub r1, r1, r2 + bx r3 +#else + stmfd sp!, { r0, r1, lr } + bl SYM(__udivsi3) + ldmfd sp!, { r1, r2, lr } + mul r3, r2, r0 + sub r1, r1, r3 + RET +#endif + FUNC_END aeabi_uidivmod + #endif /* L_udivsi3 */ /* ------------------------------------------------------------------------ */ #ifdef L_umodsi3 @@ -660,6 +817,7 @@ LSYM(Lover10): #ifdef L_divsi3 FUNC_START divsi3 + FUNC_ALIAS aeabi_idiv divsi3 #ifdef __thumb__ cmp divisor, #0 @@ -734,6 +892,24 @@ LSYM(Lover12): DIV_FUNC_END divsi3 +FUNC_START aeabi_idivmod +#ifdef __thumb__ + push {r0, r1, lr} + bl SYM(__divsi3) + POP {r1, r2, r3} + mul r2, r0 + sub r1, r1, r2 + bx r3 +#else + stmfd sp!, { r0, r1, lr } + bl SYM(__divsi3) + ldmfd sp!, { r1, r2, lr } + mul r3, r2, r0 + sub r1, r1, r3 + RET +#endif + FUNC_END aeabi_idivmod + #endif /* L_divsi3 */ /* ------------------------------------------------------------------------ */ #ifdef L_modsi3 @@ -799,9 +975,13 @@ LSYM(Lover12): #ifdef L_dvmd_tls FUNC_START div0 + FUNC_ALIAS aeabi_idiv0 div0 + FUNC_ALIAS aeabi_ldiv0 div0 RET + FUNC_END aeabi_ldiv0 + FUNC_END aeabi_idiv0 FUNC_END div0 #endif /* L_divmodsi_tools */ @@ -809,26 +989,143 @@ LSYM(Lover12): #ifdef L_dvmd_lnx @ GNU/Linux division-by zero handler. Used in place of L_dvmd_tls -/* Constants taken from and */ +/* Constant taken from . */ #define SIGFPE 8 -#define __NR_SYSCALL_BASE 0x900000 -#define __NR_getpid (__NR_SYSCALL_BASE+ 20) -#define __NR_kill (__NR_SYSCALL_BASE+ 37) .code 32 FUNC_START div0 stmfd sp!, {r1, lr} - swi __NR_getpid - cmn r0, #1000 - RETLDM r1 hs - mov r1, #SIGFPE - swi __NR_kill + mov r0, #SIGFPE + bl SYM(raise) __PLT__ RETLDM r1 FUNC_END div0 #endif /* L_dvmd_lnx */ +/* ------------------------------------------------------------------------ */ +/* Dword shift operations. */ +/* All the following Dword shift variants rely on the fact that + shft xxx, Reg + is in fact done as + shft xxx, (Reg & 255) + so for Reg value in (32...63) and (-1...-31) we will get zero (in the + case of logical shifts) or the sign (for asr). */ + +#ifdef __ARMEB__ +#define al r1 +#define ah r0 +#else +#define al r0 +#define ah r1 +#endif + +/* Prevent __aeabi double-word shifts from being produced on SymbianOS. */ +#ifndef __symbian__ + +#ifdef L_lshrdi3 + + FUNC_START lshrdi3 + FUNC_ALIAS aeabi_llsr lshrdi3 + +#ifdef __thumb__ + lsr al, r2 + mov r3, ah + lsr ah, r2 + mov ip, r3 + sub r2, #32 + lsr r3, r2 + orr al, r3 + neg r2, r2 + mov r3, ip + lsl r3, r2 + orr al, r3 + RET +#else + subs r3, r2, #32 + rsb ip, r2, #32 + movmi al, al, lsr r2 + movpl al, ah, lsr r3 + orrmi al, al, ah, lsl ip + mov ah, ah, lsr r2 + RET +#endif + FUNC_END aeabi_llsr + FUNC_END lshrdi3 + +#endif + +#ifdef L_ashrdi3 + + FUNC_START ashrdi3 + FUNC_ALIAS aeabi_lasr ashrdi3 + +#ifdef __thumb__ + lsr al, r2 + mov r3, ah + asr ah, r2 + sub r2, #32 + @ If r2 is negative at this point the following step would OR + @ the sign bit into all of AL. That's not what we want... + bmi 1f + mov ip, r3 + asr r3, r2 + orr al, r3 + mov r3, ip +1: + neg r2, r2 + lsl r3, r2 + orr al, r3 + RET +#else + subs r3, r2, #32 + rsb ip, r2, #32 + movmi al, al, lsr r2 + movpl al, ah, asr r3 + orrmi al, al, ah, lsl ip + mov ah, ah, asr r2 + RET +#endif + + FUNC_END aeabi_lasr + FUNC_END ashrdi3 + +#endif + +#ifdef L_ashldi3 + + FUNC_START ashldi3 + FUNC_ALIAS aeabi_llsl ashldi3 + +#ifdef __thumb__ + lsl ah, r2 + mov r3, al + lsl al, r2 + mov ip, r3 + sub r2, #32 + lsl r3, r2 + orr ah, r3 + neg r2, r2 + mov r3, ip + lsr r3, r2 + orr ah, r3 + RET +#else + subs r3, r2, #32 + rsb ip, r2, #32 + movmi ah, ah, lsl r2 + movpl ah, al, lsl r3 + orrmi ah, ah, al, lsr ip + mov al, al, lsl r2 + RET +#endif + FUNC_END aeabi_llsl + FUNC_END ashldi3 + +#endif + +#endif /* __symbian__ */ + /* ------------------------------------------------------------------------ */ /* These next two sections are here despite the fact that they contain Thumb assembler because their presence allows interworked code to be linked even @@ -836,7 +1133,11 @@ LSYM(Lover12): /* Do not build the interworking functions when the target architecture does not support Thumb instructions. (This can be a multilib option). */ -#if defined L_call_via_rX && (defined __ARM_ARCH_4T__ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__) +#if defined __ARM_ARCH_4T__ || defined __ARM_ARCH_5T__\ + || defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__ \ + || __ARM_ARCH__ >= 6 + +#if defined L_call_via_rX /* These labels & instructions are used by the Arm/Thumb interworking code. The address of function to be called is loaded into a register and then @@ -874,10 +1175,8 @@ LSYM(Lover12): call_via lr #endif /* L_call_via_rX */ -/* ------------------------------------------------------------------------ */ -/* Do not build the interworking functions when the target architecture does - not support Thumb instructions. (This can be a multilib option). */ -#if defined L_interwork_call_via_rX && (defined __ARM_ARCH_4T__ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__) + +#if defined L_interwork_call_via_rX /* These labels & instructions are used by the Arm/Thumb interworking code, when the target address is in an unknown instruction set. The address @@ -888,16 +1187,61 @@ LSYM(Lover12): the target code cannot be relied upon to return via a BX instruction, so instead we have to store the resturn address on the stack and allow the called function to return here instead. Upon return we recover the real - return address and use a BX to get back to Thumb mode. */ + return address and use a BX to get back to Thumb mode. + + There are three variations of this code. The first, + _interwork_call_via_rN(), will push the return address onto the + stack and pop it in _arm_return(). It should only be used if all + arguments are passed in registers. + + The second, _interwork_r7_call_via_rN(), instead stores the return + address at [r7, #-4]. It is the caller's responsibility to ensure + that this address is valid and contains no useful data. + + The third, _interwork_r11_call_via_rN(), works in the same way but + uses r11 instead of r7. It is useful if the caller does not really + need a frame pointer. */ .text .align 0 .code 32 .globl _arm_return +LSYM(Lstart_arm_return): + cfi_start LSYM(Lstart_arm_return) LSYM(Lend_arm_return) + cfi_push 0, 0xe, -0x8, 0x8 + nop @ This nop is for the benefit of debuggers, so that + @ backtraces will use the correct unwind information. _arm_return: - RETLDM - .code 16 + RETLDM unwind=LSYM(Lstart_arm_return) + cfi_end LSYM(Lend_arm_return) + + .globl _arm_return_r7 +_arm_return_r7: + ldr lr, [r7, #-4] + bx lr + + .globl _arm_return_r11 +_arm_return_r11: + ldr lr, [r11, #-4] + bx lr + +.macro interwork_with_frame frame, register, name, return + .code 16 + + THUMB_FUNC_START \name + + bx pc + nop + + .code 32 + tst \register, #1 + streq lr, [\frame, #-4] + adreq lr, _arm_return_\frame + bx \register + + SIZE (\name) +.endm .macro interwork register .code 16 @@ -911,11 +1255,14 @@ _arm_return: .globl LSYM(Lchange_\register) LSYM(Lchange_\register): tst \register, #1 - streq lr, [sp, #-4]! + streq lr, [sp, #-8]! adreq lr, _arm_return bx \register SIZE (_interwork_call_via_\register) + + interwork_with_frame r7,\register,_interwork_r7_call_via_\register + interwork_with_frame r11,\register,_interwork_r11_call_via_\register .endm interwork r0 @@ -945,7 +1292,7 @@ LSYM(Lchange_\register): .globl .Lchange_lr .Lchange_lr: tst lr, #1 - stmeqdb r13!, {lr} + stmeqdb r13!, {lr, pc} mov ip, lr adreq lr, _arm_return bx ip @@ -953,7 +1300,10 @@ LSYM(Lchange_\register): SIZE (_interwork_call_via_lr) #endif /* L_interwork_call_via_rX */ +#endif /* Arch supports thumb. */ +#ifndef __symbian__ #include "ieee754-df.S" #include "ieee754-sf.S" - +#include "bpabi.S" +#endif /* __symbian__ */ diff --git a/contrib/gcc/config/arm/libgcc-bpabi.ver b/contrib/gcc/config/arm/libgcc-bpabi.ver new file mode 100644 index 00000000000..2f259eb646e --- /dev/null +++ b/contrib/gcc/config/arm/libgcc-bpabi.ver @@ -0,0 +1,83 @@ +GCC_3.5 { + # BPABI symbols + __aeabi_cdcmpeq + __aeabi_cdcmple + __aeabi_cdrcmple + __aeabi_cfcmpeq + __aeabi_cfcmple + __aeabi_cfrcmple + __aeabi_d2f + __aeabi_d2iz + __aeabi_d2lz + __aeabi_d2uiz + __aeabi_d2ulz + __aeabi_dadd + __aeabi_dcmpeq + __aeabi_dcmpge + __aeabi_dcmpgt + __aeabi_dcmple + __aeabi_dcmplt + __aeabi_dcmpun + __aeabi_ddiv + __aeabi_dmul + __aeabi_dneg + __aeabi_drsub + __aeabi_dsub + __aeabi_f2d + __aeabi_f2iz + __aeabi_f2lz + __aeabi_f2uiz + __aeabi_f2ulz + __aeabi_fadd + __aeabi_fcmpeq + __aeabi_fcmpge + __aeabi_fcmpgt + __aeabi_fcmple + __aeabi_fcmplt + __aeabi_fcmpun + __aeabi_fdiv + __aeabi_fmul + __aeabi_fneg + __aeabi_frsub + __aeabi_fsub + __aeabi_i2d + __aeabi_i2f + __aeabi_idiv + __aeabi_idiv0 + __aeabi_idivmod + __aeabi_l2d + __aeabi_l2f + __aeabi_lasr + __aeabi_lcmp + __aeabi_ldiv0 + __aeabi_ldivmod + __aeabi_llsl + __aeabi_llsr + __aeabi_lmul + __aeabi_ui2d + __aeabi_ui2f + __aeabi_uidiv + __aeabi_uidivmod + __aeabi_uldivmod + __aeabi_ulcmp + __aeabi_ul2d + __aeabi_ul2f + __aeabi_uread4 + __aeabi_uread8 + __aeabi_uwrite4 + __aeabi_uwrite8 + + # Exception-Handling + # \S 7.5 + _Unwind_Complete + _Unwind_VRS_Get + _Unwind_VRS_Set + _Unwind_VRS_Pop + # \S 9.2 + __aeabi_unwind_cpp_pr0 + __aeabi_unwind_cpp_pr1 + __aeabi_unwind_cpp_pr2 + # The libstdc++ exception-handling personality routine uses this + # GNU-specific entry point. + __gnu_unwind_frame +} diff --git a/contrib/gcc/config/arm/libunwind.S b/contrib/gcc/config/arm/libunwind.S new file mode 100644 index 00000000000..06e13107d2a --- /dev/null +++ b/contrib/gcc/config/arm/libunwind.S @@ -0,0 +1,120 @@ +/* Support functions for the unwinder. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#ifndef __symbian__ + +#include "lib1funcs.asm" + +.macro UNPREFIX name + .global SYM (\name) + EQUIV SYM (\name), SYM (__\name) +.endm + +/* r0 points to a 16-word block. Upload these values to the actual core + state. */ +ARM_FUNC_START restore_core_regs + /* We must use sp as the base register when restoring sp. Push the + last 3 registers onto the top of the current stack to achieve + this. */ + add r1, r0, #52 + ldmia r1, {r3, r4, r5} /* {sp, lr, pc}. */ +#ifdef __INTERWORKING__ + /* Restore pc into ip. */ + mov r2, r5 + stmfd sp!, {r2, r3, r4} +#else + stmfd sp!, {r3, r4, r5} +#endif + /* Don't bother restoring ip. */ + ldmia r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp} + /* Pop the three registers we pushed earlier. */ +#ifdef __INTERWORKING__ + ldmfd sp, {ip, sp, lr} + bx ip +#else + ldmfd sp, {sp, lr, pc} +#endif + FUNC_END restore_core_regs + UNPREFIX restore_core_regs + +/* Load VFP registers d0-d15 from the address in r0. */ +ARM_FUNC_START gnu_Unwind_Restore_VFP + /* Use the generic coprocessor form so that gas doesn't complain + on soft-float targets. */ + ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ + RET + +/* Store VFR regsters d0-d15 to the address in r0. */ +ARM_FUNC_START gnu_Unwind_Save_VFP + /* Use the generic coprocessor form so that gas doesn't complain + on soft-float targets. */ + stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ + RET + +/* Wrappers to save core registers, then call the real routine. */ + +.macro UNWIND_WRAPPER name nargs + ARM_FUNC_START \name + /* Create a phase2_vrs structure. */ + /* Split reg push in two to ensure the correct value for sp. */ + stmfd sp!, {sp, lr, pc} + stmfd sp!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, ip} + + /* Demand-save flags, plus an extra word for alignment. */ + mov r3, #0 + stmfd sp!, {r2, r3} + + /* Point r1 at the block. Pass r[0..nargs) unchanged. */ + add r\nargs, sp, #4 +#if defined(__thumb__) + /* Switch back to thumb mode to avoid interworking hassle. */ + adr ip, .L1_\name + orr ip, ip, #1 + bx ip + .thumb +.L1_\name: + bl SYM (__gnu\name) __PLT__ + ldr r3, [sp, #64] + add sp, #72 + bx r3 +#else + bl SYM (__gnu\name) __PLT__ + ldr lr, [sp, #64] + add sp, sp, #72 + RET +#endif + FUNC_END \name + UNPREFIX \name +.endm + +UNWIND_WRAPPER _Unwind_RaiseException 1 +UNWIND_WRAPPER _Unwind_Resume 1 +UNWIND_WRAPPER _Unwind_Resume_or_Rethrow 1 +UNWIND_WRAPPER _Unwind_ForcedUnwind 3 + +#endif /* __symbian__ */ diff --git a/contrib/gcc/config/arm/linux-eabi.h b/contrib/gcc/config/arm/linux-eabi.h new file mode 100644 index 00000000000..6612f742bf8 --- /dev/null +++ b/contrib/gcc/config/arm/linux-eabi.h @@ -0,0 +1,85 @@ +/* Configuration file for ARM GNU/Linux EABI targets. + Copyright (C) 2004, 2005, 2006 + Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* On EABI GNU/Linux, we want both the BPABI builtins and the + GNU/Linux builtins. */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + TARGET_BPABI_CPP_BUILTINS(); \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ + } \ + while (false) + +/* We default to a soft-float ABI so that binaries can run on all + target hardware. */ +#undef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + +/* We default to the "aapcs-linux" ABI so that enums are int-sized by + default. */ +#undef ARM_DEFAULT_ABI +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX + +/* Default to armv5t so that thumb shared libraries work. + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ +#undef SUBTARGET_CPU_DEFAULT +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi + +#undef SUBTARGET_EXTRA_LINK_SPEC +#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi" + +/* Use ld-linux.so.3 so that it will be possible to run "classic" + GNU/Linux binaries on an EABI system. */ +#undef GLIBC_DYNAMIC_LINKER +#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" + +/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ +#undef LINK_SPEC +#define LINK_SPEC LINUX_TARGET_LINK_SPEC + +/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we + do not use -lfloat. */ +#undef LIBGCC_SPEC + +/* Use the AAPCS type for wchar_t, or the previous Linux default for + non-AAPCS. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int") + +/* Clear the instruction cache from `beg' to `end'. This makes an + inline system call to SYS_cacheflush. It is modified to work with + both the original and EABI-only syscall interfaces. */ +#undef CLEAR_INSN_CACHE +#define CLEAR_INSN_CACHE(BEG, END) \ +{ \ + register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ + register unsigned long _end __asm ("a2") = (unsigned long) (END); \ + register unsigned long _flg __asm ("a3") = 0; \ + register unsigned long _scno __asm ("r7") = 0xf0002; \ + __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \ + : "=r" (_beg) \ + : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno)); \ +} diff --git a/contrib/gcc/config/arm/linux-elf.h b/contrib/gcc/config/arm/linux-elf.h index 9f291c0b49f..acb13cd013f 100644 --- a/contrib/gcc/config/arm/linux-elf.h +++ b/contrib/gcc/config/arm/linux-elf.h @@ -1,5 +1,6 @@ /* Definitions for ARM running Linux-based GNU systems using ELF - Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2006 Free Software Foundation, Inc. Contributed by Philip Blundell @@ -17,8 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ @@ -27,12 +28,11 @@ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr); -/* Do not assume anything about header files. */ -#define NO_IMPLICIT_EXTERN_C +#undef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD -/* Default is to use APCS-32 mode. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (0) #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 @@ -40,13 +40,7 @@ #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } - -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -/* The GNU C++ standard library requires that these macros be defined. */ -#undef CPLUSPLUS_CPP_SPEC -#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" + { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } /* Now we define the strings used to build the spec file. */ #undef LIB_SPEC @@ -55,44 +49,30 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" +#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" -/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add - the GNU/Linux magical crtbegin.o file (see crtstuff.c) which - provides part of the support for getting C++ file-scope static - object constructed before entering `main'. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" +#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" -/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on - the GNU/Linux magical crtend.o file (see crtstuff.c) which - provides part of the support for getting C++ file-scope static - object constructed before entering `main', followed by a normal - GNU/Linux "finalizer" file, `crtn.o'. */ - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" - -#undef LINK_SPEC -#define LINK_SPEC "%{h*} %{version:-v} \ - %{b} %{Wl,*:%*} \ +#define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ + %{b} \ %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \ -X \ %{mbig-endian:-EB}" \ SUBTARGET_EXTRA_LINK_SPEC -#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() +#undef LINK_SPEC +#define LINK_SPEC LINUX_TARGET_LINK_SPEC + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ + } \ + while (0) /* This is how we tell the assembler that two symbols have the same value. */ #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ @@ -113,16 +93,14 @@ #undef ARM_FUNCTION_PROFILER #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \ { \ - fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_RELOC ? "(PLT)" : ""); \ + fprintf (STREAM, "\tbl\tmcount%s\n", \ + (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \ } -/* The linux profiler clobbers the link register. Make sure the +/* The GNU/Linux profiler clobbers the link register. Make sure the prologue knows to save it. */ #define PROFILE_HOOK(X) \ emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM))) -#undef CC1_SPEC -#define CC1_SPEC "%{profile:-p}" - -#define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" +/* The GNU/Linux profiler needs a frame pointer. */ +#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile diff --git a/contrib/gcc/config/arm/linux-gas.h b/contrib/gcc/config/arm/linux-gas.h index 69112841893..a04e0506667 100644 --- a/contrib/gcc/config/arm/linux-gas.h +++ b/contrib/gcc/config/arm/linux-gas.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler. ARM Linux-based GNU systems version. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 + Free Software Foundation, Inc. Contributed by Russell King . This file is part of GCC. @@ -17,8 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* This is how we tell the assembler that a symbol is weak. GAS always supports weak symbols. */ @@ -27,7 +28,7 @@ #define DEFAULT_SIGNED_CHAR 0 #undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{fPIC|fPIE:-D__PIC__ -D__pic__} %{fpic|fpie:-D__PIC__ -D__pic__}" +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -41,19 +42,6 @@ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ -} - /* Clear the instruction cache from `beg' to `end'. This makes an inline system call to SYS_cacheflush. */ #define CLEAR_INSN_CACHE(BEG, END) \ diff --git a/contrib/gcc/config/arm/mmintrin.h b/contrib/gcc/config/arm/mmintrin.h index 4dc1d455ce7..bed6204c24a 100644 --- a/contrib/gcc/config/arm/mmintrin.h +++ b/contrib/gcc/config/arm/mmintrin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -14,8 +14,8 @@ 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. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -31,9 +31,9 @@ typedef unsigned long long __m64, __int64; /* Internal data types for implementing the intrinsics. */ -typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); -typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); -typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); +typedef int __v2si __attribute__ ((vector_size (8))); +typedef short __v4hi __attribute__ ((vector_size (8))); +typedef char __v8qi __attribute__ ((vector_size (8))); /* "Convert" __m64 and __int64 into each other. */ static __inline __m64 @@ -419,7 +419,7 @@ _mm_madd_pu16 (__m64 __m1, __m64 __m2) static __inline __m64 _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_arm_wmulsh ((__v4hi)__m1, (__v4hi)__m2); + return (__m64) __builtin_arm_wmulsm ((__v4hi)__m1, (__v4hi)__m2); } /* Multiply four signed 16-bit values in M1 by four signed 16-bit values in @@ -427,7 +427,7 @@ _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) static __inline __m64 _mm_mulhi_pu16 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_arm_wmuluh ((__v4hi)__m1, (__v4hi)__m2); + return (__m64) __builtin_arm_wmulum ((__v4hi)__m1, (__v4hi)__m2); } /* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce @@ -986,18 +986,18 @@ _mm_setzero_si64 (void) the rest are reserved. */ static __inline void -_mm_setwcx (const int __regno, const int __value) +_mm_setwcx (const int __value, const int __regno) { switch (__regno) { - case 0: __builtin_arm_setwcx (0, __value); break; - case 1: __builtin_arm_setwcx (1, __value); break; - case 2: __builtin_arm_setwcx (2, __value); break; - case 3: __builtin_arm_setwcx (3, __value); break; - case 8: __builtin_arm_setwcx (8, __value); break; - case 9: __builtin_arm_setwcx (9, __value); break; - case 10: __builtin_arm_setwcx (10, __value); break; - case 11: __builtin_arm_setwcx (11, __value); break; + case 0: __builtin_arm_setwcx (__value, 0); break; + case 1: __builtin_arm_setwcx (__value, 1); break; + case 2: __builtin_arm_setwcx (__value, 2); break; + case 3: __builtin_arm_setwcx (__value, 3); break; + case 8: __builtin_arm_setwcx (__value, 8); break; + case 9: __builtin_arm_setwcx (__value, 9); break; + case 10: __builtin_arm_setwcx (__value, 10); break; + case 11: __builtin_arm_setwcx (__value, 11); break; default: break; } } diff --git a/contrib/gcc/config/arm/netbsd-elf.h b/contrib/gcc/config/arm/netbsd-elf.h index a8b43f645d3..8a01b0fcc8d 100644 --- a/contrib/gcc/config/arm/netbsd-elf.h +++ b/contrib/gcc/config/arm/netbsd-elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, NetBSD/arm ELF version. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #undef TARGET_VERSION @@ -35,14 +35,12 @@ /* Default it to use ATPCS with soft-VFP. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (ARM_FLAG_APCS_32 \ - | ARM_FLAG_SOFT_FLOAT \ - | ARM_FLAG_APCS_FRAME \ - | ARM_FLAG_ATPCS \ - | ARM_FLAG_VFP \ - | ARM_FLAG_MMU_TRAPS \ + (MASK_APCS_FRAME \ | TARGET_ENDIAN_DEFAULT) +#undef ARM_DEFAULT_ABI +#define ARM_DEFAULT_ABI ARM_ABI_ATPCS + #define TARGET_OS_CPP_BUILTINS() \ do \ { \ @@ -57,14 +55,11 @@ #define SUBTARGET_EXTRA_ASM_SPEC \ "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}" -/* Default floating point model is soft-VFP. - FIXME: -mhard-float currently implies FPA. */ +/* Default to full VFP if -mhard-float is specified. */ #undef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC \ - "%{mhard-float:-mfpu=fpa} \ - %{msoft-float:-mfpu=softvfp} \ - %{!mhard-float: \ - %{!msoft-float:-mfpu=softvfp}}" + "%{mhard-float:{!mfpu=*:-mfpu=vfp}} \ + %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -102,7 +97,8 @@ { \ asm_fprintf (STREAM, "\tmov\t%Rip, %Rlr\n"); \ asm_fprintf (STREAM, "\tbl\t__mcount%s\n", \ - NEED_PLT_RELOC ? "(PLT)" : ""); \ + (TARGET_ARM && NEED_PLT_RELOC) \ + ? "(PLT)" : ""); \ } /* VERY BIG NOTE: Change of structure alignment for NetBSD/arm. @@ -140,21 +136,6 @@ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -do \ - { \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ - } \ -while (0) - /* Clear the instruction cache from `BEG' to `END'. This makes a call to the ARM_SYNC_ICACHE architecture specific syscall. */ #define CLEAR_INSN_CACHE(BEG, END) \ @@ -171,3 +152,7 @@ do \ (void) sysarch (0, &s); \ } \ while (0) + +#undef FPUTYPE_DEFAULT +#define FPUTYPE_DEFAULT FPUTYPE_VFP + diff --git a/contrib/gcc/config/arm/netbsd.h b/contrib/gcc/config/arm/netbsd.h index 71763e61ea8..4d147442c80 100644 --- a/contrib/gcc/config/arm/netbsd.h +++ b/contrib/gcc/config/arm/netbsd.h @@ -1,5 +1,6 @@ /* NetBSD/arm a.out version. - Copyright (C) 1993, 1994, 1997, 1998, 2003 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Mark Brinicombe (amb@physig.ph.kcl.ac.uk) This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #undef TARGET_VERSION @@ -34,9 +35,8 @@ /* ARM6 family default cpu. */ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 -/* Default is to use APCS-32 mode. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_APCS_FRAME) /* Some defines for CPP. arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */ @@ -55,14 +55,10 @@ #undef CPP_SPEC #define CPP_SPEC "\ -%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) %(cpp_endian) %(netbsd_cpp_spec) \ +%(cpp_cpu_arch) %(cpp_float) %(cpp_endian) %(netbsd_cpp_spec) \ " -/* Because TARGET_DEFAULT sets ARM_FLAG_APCS_32 */ -#undef CPP_APCS_PC_DEFAULT_SPEC -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -/* Because TARGET_DEFAULT sets ARM_FLAG_SOFT_FLOAT */ +/* Because TARGET_DEFAULT sets MASK_SOFT_FLOAT */ #undef CPP_FLOAT_DEFAULT_SPEC #define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__" @@ -142,19 +138,6 @@ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ -} - /* Clear the instruction cache from `BEG' to `END'. This makes a call to the ARM32_SYNC_ICACHE architecture specific syscall. */ #define CLEAR_INSN_CACHE(BEG, END) \ diff --git a/contrib/gcc/config/arm/pe.c b/contrib/gcc/config/arm/pe.c index d25fd0da977..f2f67d5a96f 100644 --- a/contrib/gcc/config/arm/pe.c +++ b/contrib/gcc/config/arm/pe.c @@ -1,5 +1,6 @@ /* Routines for GCC for ARM/pe. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -95,7 +96,7 @@ arm_dllimport_name_p (symbol) } /* Mark a DECL as being dllexport'd. - Note that we override the previous setting (eg: dllimport). */ + Note that we override the previous setting (e.g.: dllimport). */ void arm_mark_dllexport (decl) @@ -107,13 +108,11 @@ arm_mark_dllexport (decl) tree idp; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); + if (arm_dllimport_name_p (oldname)) oldname += 9; else if (arm_dllexport_name_p (oldname)) @@ -130,7 +129,7 @@ arm_mark_dllexport (decl) idp = get_identifier (newname); XEXP (DECL_RTL (decl), 0) = - gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); + gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); } /* Mark a DECL as being dllimport'd. */ @@ -146,17 +145,13 @@ arm_mark_dllimport (decl) rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); - if (arm_dllexport_name_p (oldname)) - abort (); /* this shouldn't happen */ - else if (arm_dllimport_name_p (oldname)) + gcc_assert (!arm_dllexport_name_p (oldname)); + if (arm_dllimport_name_p (oldname)) return; /* already done */ /* ??? One can well ask why we're making these checks here, @@ -167,7 +162,7 @@ arm_mark_dllimport (decl) && !DECL_VIRTUAL_P (decl) && DECL_INITIAL (decl)) { - error ("%Jinitialized variable '%D' is marked dllimport", decl, decl); + error ("initialized variable %q+D is marked dllimport", decl); return; } /* Nor can they be static. */ @@ -176,7 +171,7 @@ arm_mark_dllimport (decl) && !DECL_VIRTUAL_P (decl) && 0 /*???*/) { - error ("%Jstatic variable '%D' is marked dllimport", decl, decl); + error ("static variable %q+D is marked dllimport", decl); return; } @@ -200,9 +195,9 @@ arm_mark_dllimport (decl) /* ??? At least I think that's why we do this. */ idp = get_identifier (newname); - newrtl = gen_rtx (MEM, Pmode, - gen_rtx (SYMBOL_REF, Pmode, - IDENTIFIER_POINTER (idp))); + newrtl = gen_rtx_MEM (Pmode, + gen_rtx_SYMBOL_REF (Pmode, + IDENTIFIER_POINTER (idp))); XEXP (DECL_RTL (decl), 0) = newrtl; } @@ -213,8 +208,7 @@ arm_pe_encode_section_info (decl, rtl, first) int first ATTRIBUTE_UNUSED; { /* This bit is copied from arm_encode_section_info. */ - if (optimize > 0 && TREE_CONSTANT (decl) - && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST)) + if (optimize > 0 && TREE_CONSTANT (decl)) SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; /* Mark the decl so we can tell from the rtl whether the object is @@ -236,7 +230,7 @@ arm_pe_encode_section_info (decl, rtl, first) { const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0); tree idp = get_identifier (oldname + 9); - rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); + rtx newrtl = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); XEXP (DECL_RTL (decl), 0) = newrtl; diff --git a/contrib/gcc/config/arm/pe.h b/contrib/gcc/config/arm/pe.h index e83f97baae0..f96cd66a93d 100644 --- a/contrib/gcc/config/arm/pe.h +++ b/contrib/gcc/config/arm/pe.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM with PE obj format. - Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Enable PE specific code. */ #define ARM_PE 1 @@ -39,44 +40,17 @@ /* Get tree.c to declare a target-specific specialization of merge_decl_attributes. */ -#define TARGET_DLLIMPORT_DECL_ATTRIBUTES +#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 -/* Support the __declspec keyword by turning them into attributes. - We currently only support: naked, dllimport, and dllexport. - Note that the current way we do this may result in a collision with - predefined attributes later on. This can be solved by using one attribute, - say __declspec__, and passing args to it. The problem with that approach - is that args are not accumulated: each new appearance would clobber any - existing args. */ #undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "-D__pe__ -D__declspec(x)=__attribute__((x))" - - -/* Experimental addition for pr 7885. - Ignore dllimport for functions. */ -#define TARGET_FLAG_NOP_FUN (1 << 24) - -#undef TARGET_NOP_FUN_DLLIMPORT -#define TARGET_NOP_FUN_DLLIMPORT (target_flags & TARGET_FLAG_NOP_FUN) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{ "nop-fun-dllimport", TARGET_FLAG_NOP_FUN, \ - N_("Ignore dllimport attribute for functions") }, \ -{ "no-nop-fun-dllimport", - TARGET_FLAG_NOP_FUN, "" }, - -/* Defaulting to APCS-26 support is a legacy issue. It has been done - that way for a long time, so changing it will probably break some - people's worlds. Support for APCS-32 is now enabled as a multilib, - and at some point in the future APCS-32 may become the default. - Possibly when chips that support APCS-26 are no longer made. */ +#define SUBTARGET_CPP_SPEC "-D__pe__" #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "msoft-float", "mapcs-26", "mno-thumb-interwork" } + { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" @@ -90,13 +64,11 @@ call_used_regs [11] = 1; -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* PE/COFF uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 #define TARGET_ASM_UNIQUE_SECTION arm_pe_unique_section +#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section #define SUPPORTS_ONE_ONLY 1 @@ -121,7 +93,7 @@ drectve_section (); \ fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \ arm_strip_name_encoding (NAME)); \ - function_section (DECL); \ + switch_to_section (function_section (DECL)); \ } \ ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \ if (TARGET_THUMB) \ @@ -158,11 +130,11 @@ { \ if (arm_dllexport_name_p (NAME)) \ { \ - enum in_section save_section = in_section; \ + section *save_section = in_section; \ drectve_section (); \ fprintf (STREAM, "\t.ascii \" -export:%s\"\n",\ arm_strip_name_encoding (NAME)); \ - switch_to_section (save_section, (DECL)); \ + switch_to_section (save_section); \ } \ ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ } \ @@ -172,50 +144,6 @@ #define DRECTVE_SECTION_ASM_OP "\t.section .drectve" -/* A list of other sections which the compiler might be "in" at any - given time. */ - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_drectve - -/* A list of extra section function definitions. */ - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - DRECTVE_SECTION_FUNCTION \ - SWITCH_TO_SECTION_FUNCTION - -#define DRECTVE_SECTION_FUNCTION \ -void \ -drectve_section (void) \ -{ \ - if (in_section != in_drectve) \ - { \ - fprintf (asm_out_file, "%s\n", DRECTVE_SECTION_ASM_OP); \ - in_section = in_drectve; \ - } \ -} - -/* Switch to SECTION (an `enum in_section'). - - ??? This facility should be provided by GCC proper. - The problem is that we want to temporarily switch sections in - ASM_DECLARE_OBJECT_NAME and then switch back to the original section - afterwards. */ -#define SWITCH_TO_SECTION_FUNCTION \ -static void \ -switch_to_section (enum in_section section, tree decl) \ -{ \ - switch (section) \ - { \ - case in_text: text_section (); break; \ - case in_data: data_section (); break; \ - case in_named: named_section (decl, NULL, 0); break; \ - case in_readonly_data: readonly_data_section (); break; \ - case in_ctors: ctors_section (); break; \ - case in_dtors: dtors_section (); break; \ - case in_drectve: drectve_section (); break; \ - default: abort (); break; \ - } \ -} - +#define drectve_section() \ + (fprintf (asm_out_file, "%s\n", DRECTVE_SECTION_ASM_OP), \ + in_section = NULL) diff --git a/contrib/gcc/config/arm/pe.opt b/contrib/gcc/config/arm/pe.opt new file mode 100644 index 00000000000..f3d6d8b537d --- /dev/null +++ b/contrib/gcc/config/arm/pe.opt @@ -0,0 +1,24 @@ +; PE-specific options for the ARM port + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mnop-fun-dllimport +Target Report Mask(NOP_FUN_DLLIMPORT) +Ignore dllimport attribute for functions diff --git a/contrib/gcc/config/arm/pr-support.c b/contrib/gcc/config/arm/pr-support.c new file mode 100644 index 00000000000..0e750bf3e09 --- /dev/null +++ b/contrib/gcc/config/arm/pr-support.c @@ -0,0 +1,381 @@ +/* ARM EABI compliant unwinding routines + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ +#include "unwind.h" + +/* We add a prototype for abort here to avoid creating a dependency on + target headers. */ +extern void abort (void); + +typedef struct _ZSt9type_info type_info; /* This names C++ type_info type */ + +/* Misc constants. */ +#define R_IP 12 +#define R_SP 13 +#define R_LR 14 +#define R_PC 15 + +#define uint32_highbit (((_uw) 1) << 31) + +void __attribute__((weak)) __cxa_call_unexpected(_Unwind_Control_Block *ucbp); + +/* Unwind descriptors. */ + +typedef struct +{ + _uw16 length; + _uw16 offset; +} EHT16; + +typedef struct +{ + _uw length; + _uw offset; +} EHT32; + +/* Calculate the address encoded by a 31-bit self-relative offset at address + P. Copy of routine in unwind-arm.c. */ + +static inline _uw +selfrel_offset31 (const _uw *p) +{ + _uw offset; + + offset = *p; + /* Sign extend to 32 bits. */ + if (offset & (1 << 30)) + offset |= 1u << 31; + + return offset + (_uw) p; +} + + +/* Personality routine helper functions. */ + +#define CODE_FINISH (0xb0) + +/* Return the next byte of unwinding information, or CODE_FINISH if there is + no data remaining. */ +static inline _uw8 +next_unwind_byte (__gnu_unwind_state * uws) +{ + _uw8 b; + + if (uws->bytes_left == 0) + { + /* Load another word */ + if (uws->words_left == 0) + return CODE_FINISH; /* Nothing left. */ + uws->words_left--; + uws->data = *(uws->next++); + uws->bytes_left = 3; + } + else + uws->bytes_left--; + + /* Extract the most significant byte. */ + b = (uws->data >> 24) & 0xff; + uws->data <<= 8; + return b; +} + +/* Execute the unwinding instructions described by UWS. */ +_Unwind_Reason_Code +__gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) +{ + _uw op; + int set_pc; + _uw reg; + + set_pc = 0; + for (;;) + { + op = next_unwind_byte (uws); + if (op == CODE_FINISH) + { + /* If we haven't already set pc then copy it from lr. */ + if (!set_pc) + { + _Unwind_VRS_Get (context, _UVRSC_CORE, R_LR, _UVRSD_UINT32, + ®); + _Unwind_VRS_Set (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, + ®); + set_pc = 1; + } + /* Drop out of the loop. */ + break; + } + if ((op & 0x80) == 0) + { + /* vsp = vsp +- (imm6 << 2 + 4). */ + _uw offset; + + offset = ((op & 0x3f) << 2) + 4; + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, ®); + if (op & 0x40) + reg -= offset; + else + reg += offset; + _Unwind_VRS_Set (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, ®); + continue; + } + + if ((op & 0xf0) == 0x80) + { + op = (op << 8) | next_unwind_byte (uws); + if (op == 0x8000) + { + /* Refuse to unwind. */ + return _URC_FAILURE; + } + /* Pop r4-r15 under mask. */ + op = (op << 4) & 0xfff0; + if (_Unwind_VRS_Pop (context, _UVRSC_CORE, op, _UVRSD_UINT32) + != _UVRSR_OK) + return _URC_FAILURE; + if (op & (1 << R_PC)) + set_pc = 1; + continue; + } + if ((op & 0xf0) == 0x90) + { + op &= 0xf; + if (op == 13 || op == 15) + /* Reserved. */ + return _URC_FAILURE; + /* vsp = r[nnnn]. */ + _Unwind_VRS_Get (context, _UVRSC_CORE, op, _UVRSD_UINT32, ®); + _Unwind_VRS_Set (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, ®); + continue; + } + if ((op & 0xf0) == 0xa0) + { + /* Pop r4-r[4+nnn], [lr]. */ + _uw mask; + + mask = (0xff0 >> (7 - (op & 7))) & 0xff0; + if (op & 8) + mask |= (1 << R_LR); + if (_Unwind_VRS_Pop (context, _UVRSC_CORE, mask, _UVRSD_UINT32) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if ((op & 0xf0) == 0xb0) + { + /* op == 0xb0 already handled. */ + if (op == 0xb1) + { + op = next_unwind_byte (uws); + if (op == 0 || ((op & 0xf0) != 0)) + /* Spare. */ + return _URC_FAILURE; + /* Pop r0-r4 under mask. */ + if (_Unwind_VRS_Pop (context, _UVRSC_CORE, op, _UVRSD_UINT32) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if (op == 0xb2) + { + /* vsp = vsp + 0x204 + (uleb128 << 2). */ + int shift; + + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, + ®); + op = next_unwind_byte (uws); + shift = 2; + while (op & 0x80) + { + reg += ((op & 0x7f) << shift); + shift += 7; + op = next_unwind_byte (uws); + } + reg += ((op & 0x7f) << shift) + 0x204; + _Unwind_VRS_Set (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, + ®); + continue; + } + if (op == 0xb3) + { + /* Pop VFP registers with fldmx. */ + op = next_unwind_byte (uws); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_VFPX) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if ((op & 0xfc) == 0xb4) + { + /* Pop FPA E[4]-E[4+nn]. */ + op = 0x40000 | ((op & 3) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_FPA, op, _UVRSD_FPAX) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + /* op & 0xf8 == 0xb8. */ + /* Pop VFP D[8]-D[8+nnn] with fldmx. */ + op = 0x80000 | ((op & 7) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_VFPX) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if ((op & 0xf0) == 0xc0) + { + if (op == 0xc6) + { + /* Pop iWMMXt D registers. */ + op = next_unwind_byte (uws); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_WMMXD, op, _UVRSD_UINT64) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if (op == 0xc7) + { + op = next_unwind_byte (uws); + if (op == 0 || (op & 0xf0) != 0) + /* Spare. */ + return _URC_FAILURE; + /* Pop iWMMXt wCGR{3,2,1,0} under mask. */ + if (_Unwind_VRS_Pop (context, _UVRSC_WMMXC, op, _UVRSD_UINT32) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if ((op & 0xf8) == 0xc0) + { + /* Pop iWMMXt wR[10]-wR[10+nnn]. */ + op = 0xa0000 | ((op & 0xf) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_WMMXD, op, _UVRSD_UINT64) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if (op == 0xc8) + { + /* Pop FPA registers. */ + op = next_unwind_byte (uws); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_FPA, op, _UVRSD_FPAX) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + if (op == 0xc9) + { + /* Pop VFP registers with fldmd. */ + op = next_unwind_byte (uws); + op = ((op & 0xf0) << 12) | ((op & 0xf) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_DOUBLE) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + /* Spare. */ + return _URC_FAILURE; + } + if ((op & 0xf8) == 0xd0) + { + /* Pop VFP D[8]-D[8+nnn] with fldmd. */ + op = 0x80000 | ((op & 7) + 1); + if (_Unwind_VRS_Pop (context, _UVRSC_VFP, op, _UVRSD_DOUBLE) + != _UVRSR_OK) + return _URC_FAILURE; + continue; + } + /* Spare. */ + return _URC_FAILURE; + } + return _URC_OK; +} + + +/* Execute the unwinding instructions associated with a frame. UCBP and + CONTEXT are the current exception object and virtual CPU state + respectively. */ + +_Unwind_Reason_Code +__gnu_unwind_frame (_Unwind_Control_Block * ucbp, _Unwind_Context * context) +{ + _uw *ptr; + __gnu_unwind_state uws; + + ptr = (_uw *) ucbp->pr_cache.ehtp; + /* Skip over the personality routine address. */ + ptr++; + /* Setup the unwinder state. */ + uws.data = (*ptr) << 8; + uws.next = ptr + 1; + uws.bytes_left = 3; + uws.words_left = ((*ptr) >> 24) & 0xff; + + return __gnu_unwind_execute (context, &uws); +} + +/* Get the _Unwind_Control_Block from an _Unwind_Context. */ + +static inline _Unwind_Control_Block * +unwind_UCB_from_context (_Unwind_Context * context) +{ + return (_Unwind_Control_Block *) _Unwind_GetGR (context, R_IP); +} + +/* Get the start address of the function being unwound. */ + +_Unwind_Ptr +_Unwind_GetRegionStart (_Unwind_Context * context) +{ + _Unwind_Control_Block *ucbp; + + ucbp = unwind_UCB_from_context (context); + return (_Unwind_Ptr) ucbp->pr_cache.fnstart; +} + +/* Find the Language specific exception data. */ + +void * +_Unwind_GetLanguageSpecificData (_Unwind_Context * context) +{ + _Unwind_Control_Block *ucbp; + _uw *ptr; + + /* Get a pointer to the exception table entry. */ + ucbp = unwind_UCB_from_context (context); + ptr = (_uw *) ucbp->pr_cache.ehtp; + /* Skip the personality routine address. */ + ptr++; + /* Skip the unwind opcodes. */ + ptr += (((*ptr) >> 24) & 0xff) + 1; + + return ptr; +} + diff --git a/contrib/gcc/config/arm/predicates.md b/contrib/gcc/config/arm/predicates.md new file mode 100644 index 00000000000..4a08204d155 --- /dev/null +++ b/contrib/gcc/config/arm/predicates.md @@ -0,0 +1,458 @@ +;; Predicate definitions for ARM and Thumb +;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Contributed by ARM Ltd. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_predicate "s_register_operand" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + /* We don't consider registers whose class is NO_REGS + to be a register operand. */ + /* XXX might have to check for lo regs only for thumb ??? */ + return (GET_CODE (op) == REG + && (REGNO (op) >= FIRST_PSEUDO_REGISTER + || REGNO_REG_CLASS (REGNO (op)) != NO_REGS)); +}) + +;; Any hard register. +(define_predicate "arm_hard_register_operand" + (match_code "reg") +{ + return REGNO (op) < FIRST_PSEUDO_REGISTER; +}) + +;; Any core register, or any pseudo. */ +(define_predicate "arm_general_register_operand" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return (GET_CODE (op) == REG + && (REGNO (op) <= LAST_ARM_REGNUM + || REGNO (op) >= FIRST_PSEUDO_REGISTER)); +}) + +(define_predicate "f_register_operand" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + /* We don't consider registers whose class is NO_REGS + to be a register operand. */ + return (GET_CODE (op) == REG + && (REGNO (op) >= FIRST_PSEUDO_REGISTER + || REGNO_REG_CLASS (REGNO (op)) == FPA_REGS)); +}) + +;; Reg, subreg(reg) or const_int. +(define_predicate "reg_or_int_operand" + (ior (match_code "const_int") + (match_operand 0 "s_register_operand"))) + +(define_predicate "arm_immediate_operand" + (and (match_code "const_int") + (match_test "const_ok_for_arm (INTVAL (op))"))) + +(define_predicate "arm_neg_immediate_operand" + (and (match_code "const_int") + (match_test "const_ok_for_arm (-INTVAL (op))"))) + +(define_predicate "arm_not_immediate_operand" + (and (match_code "const_int") + (match_test "const_ok_for_arm (~INTVAL (op))"))) + +;; Something valid on the RHS of an ARM data-processing instruction +(define_predicate "arm_rhs_operand" + (ior (match_operand 0 "s_register_operand") + (match_operand 0 "arm_immediate_operand"))) + +(define_predicate "arm_rhsm_operand" + (ior (match_operand 0 "arm_rhs_operand") + (match_operand 0 "memory_operand"))) + +(define_predicate "arm_add_operand" + (ior (match_operand 0 "arm_rhs_operand") + (match_operand 0 "arm_neg_immediate_operand"))) + +(define_predicate "arm_addimm_operand" + (ior (match_operand 0 "arm_immediate_operand") + (match_operand 0 "arm_neg_immediate_operand"))) + +(define_predicate "arm_not_operand" + (ior (match_operand 0 "arm_rhs_operand") + (match_operand 0 "arm_not_immediate_operand"))) + +;; True if the operand is a memory reference which contains an +;; offsettable address. +(define_predicate "offsettable_memory_operand" + (and (match_code "mem") + (match_test + "offsettable_address_p (reload_completed | reload_in_progress, + mode, XEXP (op, 0))"))) + +;; True if the operand is a memory operand that does not have an +;; automodified base register (and thus will not generate output reloads). +(define_predicate "call_memory_operand" + (and (match_code "mem") + (and (match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) + != RTX_AUTOINC") + (match_operand 0 "memory_operand")))) + +(define_predicate "arm_reload_memory_operand" + (and (match_code "mem,reg,subreg") + (match_test "(!CONSTANT_P (op) + && (true_regnum(op) == -1 + || (GET_CODE (op) == REG + && REGNO (op) >= FIRST_PSEUDO_REGISTER)))"))) + +;; True for valid operands for the rhs of an floating point insns. +;; Allows regs or certain consts on FPA, just regs for everything else. +(define_predicate "arm_float_rhs_operand" + (ior (match_operand 0 "s_register_operand") + (and (match_code "const_double") + (match_test "TARGET_FPA && arm_const_double_rtx (op)")))) + +(define_predicate "arm_float_add_operand" + (ior (match_operand 0 "arm_float_rhs_operand") + (and (match_code "const_double") + (match_test "TARGET_FPA && neg_const_double_rtx_ok_for_fpa (op)")))) + +(define_predicate "vfp_compare_operand" + (ior (match_operand 0 "s_register_operand") + (and (match_code "const_double") + (match_test "arm_const_double_rtx (op)")))) + +(define_predicate "arm_float_compare_operand" + (if_then_else (match_test "TARGET_VFP") + (match_operand 0 "vfp_compare_operand") + (match_operand 0 "arm_float_rhs_operand"))) + +;; True for valid index operands. +(define_predicate "index_operand" + (ior (match_operand 0 "s_register_operand") + (and (match_operand 0 "immediate_operand") + (match_test "(GET_CODE (op) != CONST_INT + || (INTVAL (op) < 4096 && INTVAL (op) > -4096))")))) + +;; True for operators that can be combined with a shift in ARM state. +(define_special_predicate "shiftable_operator" + (and (match_code "plus,minus,ior,xor,and") + (match_test "mode == GET_MODE (op)"))) + +;; True for logical binary operators. +(define_special_predicate "logical_binary_operator" + (and (match_code "ior,xor,and") + (match_test "mode == GET_MODE (op)"))) + +;; True for shift operators. +(define_special_predicate "shift_operator" + (and (ior (ior (and (match_code "mult") + (match_test "power_of_two_operand (XEXP (op, 1), mode)")) + (and (match_code "rotate") + (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT + && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32"))) + (match_code "ashift,ashiftrt,lshiftrt,rotatert")) + (match_test "mode == GET_MODE (op)"))) + +;; True for EQ & NE +(define_special_predicate "equality_operator" + (match_code "eq,ne")) + +;; True for comparisons other than LTGT or UNEQ. +(define_special_predicate "arm_comparison_operator" + (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt")) + +(define_special_predicate "minmax_operator" + (and (match_code "smin,smax,umin,umax") + (match_test "mode == GET_MODE (op)"))) + +(define_special_predicate "cc_register" + (and (match_code "reg") + (and (match_test "REGNO (op) == CC_REGNUM") + (ior (match_test "mode == GET_MODE (op)") + (match_test "mode == VOIDmode && GET_MODE_CLASS (GET_MODE (op)) == MODE_CC"))))) + +(define_special_predicate "dominant_cc_register" + (match_code "reg") +{ + if (mode == VOIDmode) + { + mode = GET_MODE (op); + + if (GET_MODE_CLASS (mode) != MODE_CC) + return false; + } + + return (cc_register (op, mode) + && (mode == CC_DNEmode + || mode == CC_DEQmode + || mode == CC_DLEmode + || mode == CC_DLTmode + || mode == CC_DGEmode + || mode == CC_DGTmode + || mode == CC_DLEUmode + || mode == CC_DLTUmode + || mode == CC_DGEUmode + || mode == CC_DGTUmode)); +}) + +(define_special_predicate "arm_extendqisi_mem_op" + (and (match_operand 0 "memory_operand") + (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND, + 0)"))) + +(define_predicate "power_of_two_operand" + (match_code "const_int") +{ + HOST_WIDE_INT value = INTVAL (op); + + return value != 0 && (value & (value - 1)) == 0; +}) + +(define_predicate "nonimmediate_di_operand" + (match_code "reg,subreg,mem") +{ + if (s_register_operand (op, mode)) + return true; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return GET_CODE (op) == MEM && memory_address_p (DImode, XEXP (op, 0)); +}) + +(define_predicate "di_operand" + (ior (match_code "const_int,const_double") + (and (match_code "reg,subreg,mem") + (match_operand 0 "nonimmediate_di_operand")))) + +(define_predicate "nonimmediate_soft_df_operand" + (match_code "reg,subreg,mem") +{ + if (s_register_operand (op, mode)) + return true; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return GET_CODE (op) == MEM && memory_address_p (DFmode, XEXP (op, 0)); +}) + +(define_predicate "soft_df_operand" + (ior (match_code "const_double") + (and (match_code "reg,subreg,mem") + (match_operand 0 "nonimmediate_soft_df_operand")))) + +(define_predicate "const_shift_operand" + (and (match_code "const_int") + (ior (match_operand 0 "power_of_two_operand") + (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 32")))) + + +(define_special_predicate "load_multiple_operation" + (match_code "parallel") +{ + HOST_WIDE_INT count = XVECLEN (op, 0); + int dest_regno; + rtx src_addr; + HOST_WIDE_INT i = 1, base = 0; + rtx elt; + + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET) + return false; + + /* Check to see if this might be a write-back. */ + if (GET_CODE (SET_SRC (elt = XVECEXP (op, 0, 0))) == PLUS) + { + i++; + base = 1; + + /* Now check it more carefully. */ + if (GET_CODE (SET_DEST (elt)) != REG + || GET_CODE (XEXP (SET_SRC (elt), 0)) != REG + || GET_CODE (XEXP (SET_SRC (elt), 1)) != CONST_INT + || INTVAL (XEXP (SET_SRC (elt), 1)) != (count - 1) * 4) + return false; + } + + /* Perform a quick check so we don't blow up below. */ + if (count <= i + || GET_CODE (XVECEXP (op, 0, i - 1)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, i - 1))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, i - 1))) != MEM) + return false; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, i - 1))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, i - 1)), 0); + + for (; i < count; i++) + { + elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != (unsigned int)(dest_regno + i - base) + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || !rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != (i - base) * 4) + return false; + } + + return true; +}) + +(define_special_predicate "store_multiple_operation" + (match_code "parallel") +{ + HOST_WIDE_INT count = XVECLEN (op, 0); + int src_regno; + rtx dest_addr; + HOST_WIDE_INT i = 1, base = 0; + rtx elt; + + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET) + return false; + + /* Check to see if this might be a write-back. */ + if (GET_CODE (SET_SRC (elt = XVECEXP (op, 0, 0))) == PLUS) + { + i++; + base = 1; + + /* Now check it more carefully. */ + if (GET_CODE (SET_DEST (elt)) != REG + || GET_CODE (XEXP (SET_SRC (elt), 0)) != REG + || GET_CODE (XEXP (SET_SRC (elt), 1)) != CONST_INT + || INTVAL (XEXP (SET_SRC (elt), 1)) != (count - 1) * 4) + return false; + } + + /* Perform a quick check so we don't blow up below. */ + if (count <= i + || GET_CODE (XVECEXP (op, 0, i - 1)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, i - 1))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, i - 1))) != REG) + return false; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, i - 1))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, i - 1)), 0); + + for (; i < count; i++) + { + elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != (unsigned int)(src_regno + i - base) + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || !rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != (i - base) * 4) + return false; + } + + return true; +}) + +(define_special_predicate "multi_register_push" + (match_code "parallel") +{ + if ((GET_CODE (XVECEXP (op, 0, 0)) != SET) + || (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC) + || (XINT (SET_SRC (XVECEXP (op, 0, 0)), 1) != UNSPEC_PUSH_MULT)) + return false; + + return true; +}) + +;;------------------------------------------------------------------------- +;; +;; Thumb predicates +;; + +(define_predicate "thumb_cmp_operand" + (ior (and (match_code "reg,subreg") + (match_operand 0 "s_register_operand")) + (and (match_code "const_int") + (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 256")))) + +(define_predicate "thumb_cmpneg_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) < 0 && INTVAL (op) > -256"))) + +;; Return TRUE if a result can be stored in OP without clobbering the +;; condition code register. Prior to reload we only accept a +;; register. After reload we have to be able to handle memory as +;; well, since a pseudo may not get a hard reg and reload cannot +;; handle output-reloads on jump insns. + +;; We could possibly handle mem before reload as well, but that might +;; complicate things with the need to handle increment +;; side-effects. +(define_predicate "thumb_cbrch_target_operand" + (and (match_code "reg,subreg,mem") + (ior (match_operand 0 "s_register_operand") + (and (match_test "reload_in_progress || reload_completed") + (match_operand 0 "memory_operand"))))) + +;;------------------------------------------------------------------------- +;; +;; MAVERICK predicates +;; + +(define_predicate "cirrus_register_operand" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return (GET_CODE (op) == REG + && (REGNO_REG_CLASS (REGNO (op)) == CIRRUS_REGS + || REGNO_REG_CLASS (REGNO (op)) == GENERAL_REGS)); +}) + +(define_predicate "cirrus_fp_register" + (match_code "reg,subreg") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + return (GET_CODE (op) == REG + && (REGNO (op) >= FIRST_PSEUDO_REGISTER + || REGNO_REG_CLASS (REGNO (op)) == CIRRUS_REGS)); +}) + +(define_predicate "cirrus_shift_const" + (and (match_code "const_int") + (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 64"))) + + diff --git a/contrib/gcc/config/arm/rtems-elf.h b/contrib/gcc/config/arm/rtems-elf.h index a736ee1ea10..f71e582ede7 100644 --- a/contrib/gcc/config/arm/rtems-elf.h +++ b/contrib/gcc/config/arm/rtems-elf.h @@ -1,5 +1,5 @@ /* Definitions for RTEMS based ARM systems using ELF - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #undef TARGET_VERSION @@ -29,3 +29,18 @@ builtin_define ("__rtems__"); \ builtin_assert ("system=rtems"); \ } while (0) + +/* + * The default in gcc now is soft-float, but gcc misses it to + * pass it to the assembler. + */ +#undef SUBTARGET_EXTRA_ASM_SPEC +#define SUBTARGET_EXTRA_ASM_SPEC "\ + %{!mhard-float: %{!msoft-float:-mfpu=softfpa}}" + +/* + * The default includes --start-group and --end-group which conflicts + * with how this used to be defined. + */ +#undef LINK_GCC_C_SEQUENCE_SPEC +#define LINK_GCC_C_SEQUENCE_SPEC "%G %L" diff --git a/contrib/gcc/config/arm/semi.h b/contrib/gcc/config/arm/semi.h index 2ab06cbcc3f..0de57d67adb 100644 --- a/contrib/gcc/config/arm/semi.h +++ b/contrib/gcc/config/arm/semi.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler. ARM on semi-hosted platform - Copyright (C) 1994, 1995, 1996, 1997, 2001 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 2001, 2004, 2005 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (richard.earnshaw@arm.com) This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #define STARTFILE_SPEC "crt0.o%s" @@ -37,8 +38,12 @@ #define TARGET_VERSION fputs (" (ARM/semi-hosted)", stderr); #endif +#ifndef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD +#endif + #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif #ifndef SUBTARGET_EXTRA_SPECS @@ -64,10 +69,8 @@ %{mcpu=*:-mcpu=%*} \ %{march=*:-march=%*} \ %{mapcs-float:-mfloat} \ -%{msoft-float:-mfpu=softfpa} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %{mthumb-interwork:-mthumb-interwork} \ %(subtarget_extra_asm_spec)" #endif - -#undef CPP_APCS_PC_DEFAULT_SPEC -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" diff --git a/contrib/gcc/config/arm/semiaof.h b/contrib/gcc/config/arm/semiaof.h index 19a6cf8ea50..9038f0dddd0 100644 --- a/contrib/gcc/config/arm/semiaof.h +++ b/contrib/gcc/config/arm/semiaof.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. ARM on semi-hosted platform AOF Syntax assembler. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2004 Free Software Foundation, Inc. Contributed by Richard Earnshaw (richard.earnshaw@armltd.co.uk) This file is part of GCC. @@ -17,8 +17,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ @@ -26,17 +26,15 @@ builtin_define_std ("semi"); \ } while (0) -#define ASM_SPEC "%{g -g} -arch 4 \ --apcs 3%{mapcs-32:/32bit}%{mapcs-26:/26bit}%{!mapcs-26:%{!macps-32:/32bit}}" +#define ASM_SPEC "%{g -g} -arch 4 -apcs 3/32bit" #define LIB_SPEC "%{Eb: armlib_h.32b%s}%{!Eb: armlib_h.32l%s}" #define TARGET_VERSION fputs (" (ARM/semi-hosted)", stderr); -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD + +#define TARGET_DEFAULT (0) /* The Norcroft C library defines size_t as "unsigned int". */ #define SIZE_TYPE "unsigned int" - -#undef CPP_APCS_PC_DEFAULT_SPEC -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" diff --git a/contrib/gcc/config/arm/strongarm-coff.h b/contrib/gcc/config/arm/strongarm-coff.h index 77dab37ee16..0ba32ceaa7b 100644 --- a/contrib/gcc/config/arm/strongarm-coff.h +++ b/contrib/gcc/config/arm/strongarm-coff.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #ifndef SUBTARGET_CPU_DEFAULT diff --git a/contrib/gcc/config/arm/strongarm-elf.h b/contrib/gcc/config/arm/strongarm-elf.h index 476b2e4f5eb..84c20996ad8 100644 --- a/contrib/gcc/config/arm/strongarm-elf.h +++ b/contrib/gcc/config/arm/strongarm-elf.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #ifndef TARGET_VERSION diff --git a/contrib/gcc/config/arm/strongarm-pe.h b/contrib/gcc/config/arm/strongarm-pe.h index bb123e54ce2..f1a13c0dd59 100644 --- a/contrib/gcc/config/arm/strongarm-pe.h +++ b/contrib/gcc/config/arm/strongarm-pe.h @@ -16,8 +16,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (StrongARM/PE)", stderr); diff --git a/contrib/gcc/config/arm/symbian.h b/contrib/gcc/config/arm/symbian.h new file mode 100644 index 00000000000..af1ba9a64bb --- /dev/null +++ b/contrib/gcc/config/arm/symbian.h @@ -0,0 +1,101 @@ +/* Configuration file for Symbian OS on ARM processors. + Copyright (C) 2004, 2005 + Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Do not expand builtin functions (unless explicitly prefixed with + "__builtin"). Symbian OS code relies on properties of the standard + library that go beyond those guaranteed by the ANSI/ISO standard. + For example, "memcpy" works even with overlapping memory, like + "memmove". We cannot simply set flag_no_builtin in arm.c because + (a) flag_no_builtin is not declared in language-independent code, + and (b) that would prevent users from explicitly overriding the + default with -fbuiltin, which may sometimes be useful. + + Make all symbols hidden by default. Symbian OS expects that all + exported symbols will be explicitly marked with + "__declspec(dllexport)". + + Enumeration types use 4 bytes, even if the enumerals are small, + unless explicitly overridden. + + The wchar_t type is a 2-byte type, unless explicitly + overridden. */ +#define CC1_SPEC \ + "%{!fbuiltin:%{!fno-builtin:-fno-builtin}} " \ + "%{!fvisibility=*:-fvisibility=hidden} " \ + "%{!fshort-enums:%{!fno-short-enums:-fno-short-enums}} " \ + "%{!fshort-wchar:%{!fno-short-wchar:-fshort-wchar}} " +#define CC1PLUS_SPEC CC1_SPEC + +/* Symbian OS does not use crt*.o, unlike the generic unknown-elf + configuration. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "" + +/* Do not link with any libraries by default. On Symbian OS, the user + must supply all required libraries on the command line. */ +#undef LIB_SPEC +#define LIB_SPEC "" + +/* Support the "dllimport" attribute. */ +#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 + +/* Symbian OS assumes ARM V5 or above. Since -march=armv5 is + equivalent to making the ARM 10TDMI core the default, we can set + SUBTARGET_CPU_DEFAULT and get an equivalent effect. */ +#undef SUBTARGET_CPU_DEFAULT +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi + +/* The assembler should assume VFP FPU format, and armv5t. */ +#undef SUBTARGET_ASM_FLOAT_SPEC +#define SUBTARGET_ASM_FLOAT_SPEC \ + "%{!mfpu=*:-mfpu=vfp} %{!mcpu=*:%{!march=*:-march=armv5t}}" + +/* SymbianOS provides the BPABI routines in a separate library. + Therefore, we do not need to define any of them in libgcc. */ +#undef RENAME_LIBRARY +#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) /* empty */ + +/* Define the __symbian__ macro. */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + /* Include the default BPABI stuff. */ \ + TARGET_BPABI_CPP_BUILTINS (); \ + builtin_define ("__symbian__"); \ + } \ + while (false) + +/* On SymbianOS, these sections are not writable, so we use "a", + rather than "aw", for the section attributes. */ +#undef ARM_EABI_CTORS_SECTION_OP +#define ARM_EABI_CTORS_SECTION_OP \ + "\t.section\t.init_array,\"a\",%init_array" +#undef ARM_EABI_DTORS_SECTION_OP +#define ARM_EABI_DTORS_SECTION_OP \ + "\t.section\t.fini_array,\"a\",%fini_array" + +/* SymbianOS cannot merge entities with vague linkage at runtime. */ +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false diff --git a/contrib/gcc/config/arm/t-arm b/contrib/gcc/config/arm/t-arm new file mode 100644 index 00000000000..9fcd187865a --- /dev/null +++ b/contrib/gcc/config/arm/t-arm @@ -0,0 +1,22 @@ +# Rules common to all arm targets + +MD_INCLUDES= $(srcdir)/config/arm/arm-tune.md \ + $(srcdir)/config/arm/predicates.md \ + $(srcdir)/config/arm/arm-generic.md \ + $(srcdir)/config/arm/arm1020e.md \ + $(srcdir)/config/arm/arm1026ejs.md \ + $(srcdir)/config/arm/arm1136jfs.md \ + $(srcdir)/config/arm/arm926ejs.md \ + $(srcdir)/config/arm/cirrus.md \ + $(srcdir)/config/arm/fpa.md \ + $(srcdir)/config/arm/iwmmxt.md \ + $(srcdir)/config/arm/vfp.md + +s-config s-conditions s-flags s-codes s-constants s-emit s-recog s-preds \ + s-opinit s-extract s-peep s-attr s-attrtab s-output: $(MD_INCLUDES) + +$(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/gentune.sh \ + $(srcdir)/config/arm/arm-cores.def + $(SHELL) $(srcdir)/config/arm/gentune.sh \ + $(srcdir)/config/arm/arm-cores.def > \ + $(srcdir)/config/arm/arm-tune.md diff --git a/contrib/gcc/config/arm/t-arm-coff b/contrib/gcc/config/arm/t-arm-coff index 8eef976aaee..763add31dac 100644 --- a/contrib/gcc/config/arm/t-arm-coff +++ b/contrib/gcc/config/arm/t-arm-coff @@ -31,4 +31,4 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline diff --git a/contrib/gcc/config/arm/t-arm-elf b/contrib/gcc/config/arm/t-arm-elf index 3f48f8b81e9..bee4051ac7e 100644 --- a/contrib/gcc/config/arm/t-arm-elf +++ b/contrib/gcc/config/arm/t-arm-elf @@ -1,9 +1,10 @@ LIB1ASMSRC = arm/lib1funcs.asm LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \ _call_via_rX _interwork_call_via_rX \ + _lshrdi3 _ashrdi3 _ashldi3 \ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ - _fixsfsi _fixunssfsi + _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf MULTILIB_OPTIONS = marm/mthumb MULTILIB_DIRNAMES = arm thumb @@ -13,7 +14,7 @@ MULTILIB_MATCHES = # MULTILIB_OPTIONS += mcpu=ep9312 # MULTILIB_DIRNAMES += ep9312 # MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312* - +# # MULTILIB_OPTIONS += mlittle-endian/mbig-endian # MULTILIB_DIRNAMES += le be # MULTILIB_MATCHES += mbig-endian=mbe mlittle-endian=mle @@ -22,13 +23,8 @@ MULTILIB_MATCHES = # MULTILIB_DIRNAMES += fpu soft # MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* # -# MULTILIB_OPTIONS += mapcs-32/mapcs-26 -# MULTILIB_DIRNAMES += 32bit 26bit -# MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26* -# # MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork # MULTILIB_DIRNAMES += normal interwork -# MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork* # # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore # MULTILIB_DIRNAMES += elf under @@ -71,7 +67,7 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) diff --git a/contrib/gcc/config/arm/t-bpabi b/contrib/gcc/config/arm/t-bpabi new file mode 100644 index 00000000000..b5c6a0b6171 --- /dev/null +++ b/contrib/gcc/config/arm/t-bpabi @@ -0,0 +1,16 @@ +# Add the bpabi.S functions. +LIB1ASMFUNCS += _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod + +# Add the BPABI C functions. +LIB2FUNCS_EXTRA = $(srcdir)/config/arm/bpabi.c \ + $(srcdir)/config/arm/unaligned-funcs.c + +UNWIND_H = $(srcdir)/config/arm/unwind-arm.h +LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \ + $(srcdir)/config/arm/libunwind.S \ + $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c +LIB2ADDEHDEP = $(UNWIND_H) $(srcdir)/config/$(LIB1ASMSRC) + +# Add the BPABI names. +SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver + diff --git a/contrib/gcc/config/arm/t-linux b/contrib/gcc/config/arm/t-linux index 1c5f48ae6f5..b2697e66e67 100644 --- a/contrib/gcc/config/arm/t-linux +++ b/contrib/gcc/config/arm/t-linux @@ -9,11 +9,6 @@ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx # MULTILIB_OPTIONS = mhard-float/msoft-float # MULTILIB_DIRNAMES = hard-float soft-float -# If you want to build both APCS variants as multilib options this is how -# to do it. -# MULTILIB_OPTIONS += mapcs-32/mapcs-26 -# MULTILIB_DIRNAMES += apcs-32 apcs-26 - # EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o # LIBGCC = stmp-multilib diff --git a/contrib/gcc/config/arm/t-linux-eabi b/contrib/gcc/config/arm/t-linux-eabi new file mode 100644 index 00000000000..5e8d94d7a28 --- /dev/null +++ b/contrib/gcc/config/arm/t-linux-eabi @@ -0,0 +1,14 @@ +# These functions are included in shared libraries. +TARGET_LIBGCC2_CFLAGS = -fPIC + +# We do not build a Thumb multilib for Linux because the definition of +# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode. +MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = + +# Use a version of div0 which raises SIGFPE. +LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx + +# Multilib the standard Linux files. Don't include crti.o or crtn.o, +# which are provided by glibc. +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o diff --git a/contrib/gcc/config/arm/t-netbsd b/contrib/gcc/config/arm/t-netbsd index 533fab947a1..7d0724cc872 100644 --- a/contrib/gcc/config/arm/t-netbsd +++ b/contrib/gcc/config/arm/t-netbsd @@ -2,6 +2,7 @@ # difference. It is then pointless adding debugging. TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fpic LIBGCC2_DEBUG_CFLAGS = -g0 +LIB2FUNCS_EXTRA = $(srcdir)/config/floatunsidf.c $(srcdir)/config/floatunsisf.c # Build a shared libgcc library. SHLIB_EXT = .so @@ -20,6 +21,8 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME) # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. -SHLIB_INSTALL = $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \ +SHLIB_INSTALL = \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \ + $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \ rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME); \ $(LN_S) $(SHLIB_SONAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME) diff --git a/contrib/gcc/config/arm/t-pe b/contrib/gcc/config/arm/t-pe index 4c20b317973..741e2b85ab7 100644 --- a/contrib/gcc/config/arm/t-pe +++ b/contrib/gcc/config/arm/t-pe @@ -24,9 +24,9 @@ pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c -MULTILIB_OPTIONS = mhard-float mthumb mapcs-32 -MULTILIB_DIRNAMES = fpu thumb apcs32 +MULTILIB_OPTIONS = mhard-float mthumb +MULTILIB_DIRNAMES = fpu thumb LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc +TARGET_LIBGCC2_CFLAGS = \ No newline at end of file diff --git a/contrib/gcc/config/arm/t-semi b/contrib/gcc/config/arm/t-semi index abd642cb02b..f5d8f1a6f5c 100644 --- a/contrib/gcc/config/arm/t-semi +++ b/contrib/gcc/config/arm/t-semi @@ -29,9 +29,9 @@ dp-bit.c: $(srcdir)/config/fp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c echo '#endif' >> dp-bit.c -MULTILIB_OPTIONS = msoft-float mapcs-26 mbig-endian mwords-little-endian -MULTILIB_DIRNAMES = soft apcs26 big wlittle -MULTILIB_EXCEPTIONS = *mapcs-26/*mbig-endian* mwords-little-endian *mapcs-26/mwords-little-endian msoft-float/mwords-little-endian +MULTILIB_OPTIONS = msoft-float mbig-endian mwords-little-endian +MULTILIB_DIRNAMES = soft big wlittle +MULTILIB_EXCEPTIONS = mwords-little-endian msoft-float/mwords-little-endian LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib diff --git a/contrib/gcc/config/arm/t-strongarm-elf b/contrib/gcc/config/arm/t-strongarm-elf index 46e2ac4f615..c8193548a76 100644 --- a/contrib/gcc/config/arm/t-strongarm-elf +++ b/contrib/gcc/config/arm/t-strongarm-elf @@ -32,7 +32,7 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) diff --git a/contrib/gcc/config/arm/t-strongarm-pe b/contrib/gcc/config/arm/t-strongarm-pe index e401666654a..2e4732fb26f 100644 --- a/contrib/gcc/config/arm/t-strongarm-pe +++ b/contrib/gcc/config/arm/t-strongarm-pe @@ -35,4 +35,4 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline diff --git a/contrib/gcc/config/arm/t-symbian b/contrib/gcc/config/arm/t-symbian new file mode 100644 index 00000000000..db891381828 --- /dev/null +++ b/contrib/gcc/config/arm/t-symbian @@ -0,0 +1,32 @@ +LIB1ASMFUNCS = _bb_init_func _call_via_rX _interwork_call_via_rX + +# These functions have __aeabi equivalents and will never be called by GCC. +# By putting them in LIB1ASMFUNCS, we avoid the standard libgcc2.c code being +# used -- and we make sure that definitions are not available in lib1funcs.asm, +# either, so they end up undefined. +LIB1ASMFUNCS += \ + _ashldi3 _ashrdi3 _divdi3 _floatdidf _udivmoddi4 _umoddi3 \ + _udivdi3 _lshrdi3 _moddi3 _muldi3 _negdi2 _cmpdi2 \ + _fixdfdi _fixsfdi _fixunsdfdi _fixunssfdi _floatdisf \ + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ + _fixsfsi _fixunssfsi + +# Include the gcc personality routine +UNWIND_H = $(srcdir)/config/arm/unwind-arm.h +LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c +LIB2ADDEHDEP = $(UNWIND_H) + +# Create a multilib for processors with VFP floating-point, and a +# multilib for those without -- using the soft-float ABI in both +# cases. Symbian OS object should be compiled with interworking +# enabled, so there are no separate thumb-mode libraries. +MULTILIB_OPTIONS = mfloat-abi=softfp +MULTILIB_DIRNAMES = softfp + +# There is no C library to link against on Symbian OS -- at least when +# building GCC. +SHLIB_LC = + +# Symbian OS provides its own startup code. +EXTRA_MULTILIB_PARTS= diff --git a/contrib/gcc/config/arm/t-wince-pe b/contrib/gcc/config/arm/t-wince-pe index 9537a7f75ed..fca9853e75c 100644 --- a/contrib/gcc/config/arm/t-wince-pe +++ b/contrib/gcc/config/arm/t-wince-pe @@ -24,9 +24,9 @@ pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c -MULTILIB_OPTIONS = mhard-float mapcs-26 -MULTILIB_DIRNAMES = fpu apcs26 -# Note - Thumb multilib omitted because Thumb apcs32 support for +MULTILIB_OPTIONS = mhard-float +MULTILIB_DIRNAMES = fpu +# Note - Thumb multilib omitted because Thumb support for # arm-wince-pe target does not appear to be working in binutils # yet... # MULTILIB_OPTIONS += thumb @@ -34,4 +34,4 @@ MULTILIB_DIRNAMES = fpu apcs26 LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc +TARGET_LIBGCC2_CFLAGS = diff --git a/contrib/gcc/config/arm/t-xscale-coff b/contrib/gcc/config/arm/t-xscale-coff index 89f371f4928..e2331a02eda 100644 --- a/contrib/gcc/config/arm/t-xscale-coff +++ b/contrib/gcc/config/arm/t-xscale-coff @@ -20,19 +20,18 @@ dp-bit.c: $(srcdir)/config/fp-bit.c echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -MULTILIB_OPTIONS = mlittle-endian/mbig-endian -MULTILIB_DIRNAMES = le be +MULTILIB_OPTIONS = mbig-endian +MULTILIB_DIRNAMES = be MULTILIB_EXCEPTIONS = MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle -# Note XScale does not support 26 bit APCS. # Note XScale does not support hard FP -MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork -MULTILIB_DIRNAMES += normal interwork +MULTILIB_OPTIONS += mthumb-interwork +MULTILIB_DIRNAMES += interwork -MULTILIB_OPTIONS += marm/mthumb -MULTILIB_DIRNAMES += arm thumb +MULTILIB_OPTIONS += mthumb +MULTILIB_DIRNAMES += thumb MULTILIB_EXCEPTIONS += *mhard-float/*mthumb* MULTILIB_REDUNDANT_DIRS = interwork/thumb=thumb @@ -43,4 +42,4 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline diff --git a/contrib/gcc/config/arm/t-xscale-elf b/contrib/gcc/config/arm/t-xscale-elf index b72c21ce980..d7a8124eea7 100644 --- a/contrib/gcc/config/arm/t-xscale-elf +++ b/contrib/gcc/config/arm/t-xscale-elf @@ -20,26 +20,31 @@ dp-bit.c: $(srcdir)/config/fp-bit.c echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -MULTILIB_OPTIONS = mlittle-endian/mbig-endian -MULTILIB_DIRNAMES = le be +MULTILIB_OPTIONS = mbig-endian +MULTILIB_DIRNAMES = be MULTILIB_EXCEPTIONS = MULTILIB_MATCHES = mbig-endian=mbe mlittle-endian=mle -# Note XScale does not support 26 bit APCS. # Note XScale does not support hard FP -MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork -MULTILIB_DIRNAMES += normal interwork +MULTILIB_OPTIONS += mthumb-interwork +MULTILIB_DIRNAMES += interwork -MULTILIB_OPTIONS += marm/mthumb -MULTILIB_DIRNAMES += arm thumb +MULTILIB_OPTIONS += mthumb +MULTILIB_DIRNAMES += thumb MULTILIB_EXCEPTIONS += *mhard-float/*mthumb* MULTILIB_REDUNDANT_DIRS = interwork/thumb=thumb -MULTILIB_OPTIONS += mcpu=iwmmxt -MULTILIB_DIRNAMES += iwmmxt -MULTILIB_REDUNDANT_DIRS += interwork/thumb/iwmmxt=thumb +# The iWMMXt multilibs are suppressed for now because gcc only +# supports generating them with the IWMMXT or AAPCS ABIs, neither of +# which is the default. Until GCC can generate code for an iWMMXt +# which will work with the default ABI it is not possible to safely +# generate these multilibs. +# +# MULTILIB_OPTIONS += mcpu=iwmmxt +# MULTILIB_DIRNAMES += iwmmxt +# MULTILIB_REDUNDANT_DIRS += interwork/thumb/iwmmxt=thumb EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o @@ -49,7 +54,7 @@ INSTALL_LIBGCC = install-multilib # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) diff --git a/contrib/gcc/config/arm/uclinux-elf.h b/contrib/gcc/config/arm/uclinux-elf.h index e3cd48d4447..9f112cddaa2 100644 --- a/contrib/gcc/config/arm/uclinux-elf.h +++ b/contrib/gcc/config/arm/uclinux-elf.h @@ -1,5 +1,5 @@ /* Definitions for ARM running ucLinux using ELF - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Philip Blundell This file is part of GCC. @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* We don't want a PLT. */ #undef NEED_PLT_RELOC @@ -27,4 +27,48 @@ #define TARGET_VERSION fputs (" (ARM/ELF ucLinux)", stderr); #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | ARM_FLAG_SINGLE_PIC_BASE) +#define TARGET_DEFAULT (MASK_SINGLE_PIC_BASE) + +/* NOTE: The remaining definitions in this file are needed because uclinux + does not use config/linux.h. */ + +/* Do not assume anything about header files. */ +#define NO_IMPLICIT_EXTERN_C + +/* The GNU C++ standard library requires that these macros be defined. */ +#undef CPLUSPLUS_CPP_SPEC +#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" + +/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add + the GNU/Linux magical crtbegin.o file (see crtstuff.c) which + provides part of the support for getting C++ file-scope static + object constructed before entering `main'. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + +/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on + the GNU/Linux magical crtend.o file (see crtstuff.c) which + provides part of the support for getting C++ file-scope static + object constructed before entering `main', followed by a normal + GNU/Linux "finalizer" file, `crtn.o'. */ + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + +#undef CC1_SPEC +#define CC1_SPEC "%{profile:-p}" + +#define LINK_GCC_C_SEQUENCE_SPEC \ + "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" + +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 +#endif diff --git a/contrib/gcc/config/arm/unaligned-funcs.c b/contrib/gcc/config/arm/unaligned-funcs.c new file mode 100644 index 00000000000..66cfd3bbbda --- /dev/null +++ b/contrib/gcc/config/arm/unaligned-funcs.c @@ -0,0 +1,62 @@ +/* EABI unaligned read/write functions. + + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +int __aeabi_uread4 (void *); +int __aeabi_uwrite4 (int, void *); +long long __aeabi_uread8 (void *); +long long __aeabi_uwrite8 (long long, void *); + +struct __attribute__((packed)) u4 { int data; }; +struct __attribute__((packed)) u8 { long long data; }; + +int +__aeabi_uread4 (void *ptr) +{ + return ((struct u4 *) ptr)->data; +} + +int +__aeabi_uwrite4 (int data, void *ptr) +{ + ((struct u4 *) ptr)->data = data; + return data; +} + +long long +__aeabi_uread8 (void *ptr) +{ + return ((struct u8 *) ptr)->data; +} + +long long +__aeabi_uwrite8 (long long data, void *ptr) +{ + ((struct u8 *) ptr)->data = data; + return data; +} diff --git a/contrib/gcc/config/arm/unknown-elf.h b/contrib/gcc/config/arm/unknown-elf.h index 1af799482b4..c9ad9903490 100644 --- a/contrib/gcc/config/arm/unknown-elf.h +++ b/contrib/gcc/config/arm/unknown-elf.h @@ -1,5 +1,5 @@ /* Definitions for non-Linux based ARM systems using ELF - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Catherine Moore @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ @@ -28,9 +28,9 @@ #define TARGET_VERSION fputs (" (ARM/ELF)", stderr); #endif -/* Default to using APCS-32 and software floating point. */ +/* Default to using software floating point. */ #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (0) #endif /* Now we define the strings used to build the spec file. */ @@ -58,9 +58,9 @@ do \ { \ if (IN_NAMED_SECTION (DECL)) \ - named_section (DECL, NULL, 0); \ + switch_to_section (get_named_section (DECL, NULL, 0)); \ else \ - bss_section (); \ + switch_to_section (bss_section); \ \ ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ \ @@ -75,9 +75,9 @@ do \ { \ if ((DECL) != NULL && IN_NAMED_SECTION (DECL)) \ - named_section (DECL, NULL, 0); \ + switch_to_section (get_named_section (DECL, NULL, 0)); \ else \ - bss_section (); \ + switch_to_section (bss_section); \ \ ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ ASM_OUTPUT_LABEL (FILE, NAME); \ @@ -85,11 +85,13 @@ } \ while (0) -#ifndef CPP_APCS_PC_DEFAULT_SPEC -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" -#endif - #ifndef SUBTARGET_CPU_DEFAULT #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi #endif +/* The libgcc udivmod functions may throw exceptions. If newlib is + configured to support long longs in I/O, then printf will depend on + udivmoddi4, which will depend on the exception unwind routines, + which will depend on abort, which is defined in libc. */ +#undef LINK_GCC_C_SEQUENCE_SPEC +#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group" diff --git a/contrib/gcc/config/arm/unwind-arm.c b/contrib/gcc/config/arm/unwind-arm.c new file mode 100644 index 00000000000..9d2513b6897 --- /dev/null +++ b/contrib/gcc/config/arm/unwind-arm.c @@ -0,0 +1,1016 @@ +/* ARM EABI compliant unwinding routines. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ +#include "unwind.h" + +/* We add a prototype for abort here to avoid creating a dependency on + target headers. */ +extern void abort (void); + +/* Definitions for C++ runtime support routines. We make these weak + declarations to avoid pulling in libsupc++ unnecessarily. */ +typedef unsigned char bool; + +typedef struct _ZSt9type_info type_info; /* This names C++ type_info type */ + +void __attribute__((weak)) __cxa_call_unexpected(_Unwind_Control_Block *ucbp); +bool __attribute__((weak)) __cxa_begin_cleanup(_Unwind_Control_Block *ucbp); +bool __attribute__((weak)) __cxa_type_match(_Unwind_Control_Block *ucbp, + const type_info *rttip, + void **matched_object); + +_Unwind_Ptr __attribute__((weak)) +__gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); + +/* Misc constants. */ +#define R_IP 12 +#define R_SP 13 +#define R_LR 14 +#define R_PC 15 + +#define EXIDX_CANTUNWIND 1 +#define uint32_highbit (((_uw) 1) << 31) + +#define UCB_FORCED_STOP_FN(ucbp) ((ucbp)->unwinder_cache.reserved1) +#define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2) +#define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3) +#define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4) + +struct core_regs +{ + _uw r[16]; +}; + +/* We use normal integer types here to avoid the compiler generating + coprocessor instructions. */ +struct vfp_regs +{ + _uw64 d[16]; + _uw pad; +}; + +struct fpa_reg +{ + _uw w[3]; +}; + +struct fpa_regs +{ + struct fpa_reg f[8]; +}; + +/* Unwind descriptors. */ + +typedef struct +{ + _uw16 length; + _uw16 offset; +} EHT16; + +typedef struct +{ + _uw length; + _uw offset; +} EHT32; + +/* The ABI specifies that the unwind routines may only use core registers, + except when actually manipulating coprocessor state. This allows + us to write one implementation that works on all platforms by + demand-saving coprocessor registers. + + During unwinding we hold the coprocessor state in the actual hardware + registers and allocate demand-save areas for use during phase1 + unwinding. */ + +typedef struct +{ + /* The first fields must be the same as a phase2_vrs. */ + _uw demand_save_flags; + struct core_regs core; + _uw prev_sp; /* Only valid during forced unwinding. */ + struct vfp_regs vfp; + struct fpa_regs fpa; +} phase1_vrs; + +#define DEMAND_SAVE_VFP 1 + +/* This must match the structure created by the assembly wrappers. */ +typedef struct +{ + _uw demand_save_flags; + struct core_regs core; +} phase2_vrs; + + +/* An exception index table entry. */ + +typedef struct __EIT_entry +{ + _uw fnoffset; + _uw content; +} __EIT_entry; + +/* Assembly helper functions. */ + +/* Restore core register state. Never returns. */ +void __attribute__((noreturn)) restore_core_regs (struct core_regs *); + + +/* Coprocessor register state manipulation functions. */ + +void __gnu_Unwind_Save_VFP (struct vfp_regs * p); +void __gnu_Unwind_Restore_VFP (struct vfp_regs * p); + +/* Restore coprocessor state after phase1 unwinding. */ +static void +restore_non_core_regs (phase1_vrs * vrs) +{ + if ((vrs->demand_save_flags & DEMAND_SAVE_VFP) == 0) + __gnu_Unwind_Restore_VFP (&vrs->vfp); +} + +/* A better way to do this would probably be to compare the absolute address + with a segment relative relocation of the same symbol. */ + +extern int __text_start; +extern int __data_start; + +/* The exception index table location. */ +extern __EIT_entry __exidx_start; +extern __EIT_entry __exidx_end; + +/* ABI defined personality routines. */ +extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr0 (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *);// __attribute__((weak)); +extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr1 (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *) __attribute__((weak)); +extern _Unwind_Reason_Code __aeabi_unwind_cpp_pr2 (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *) __attribute__((weak)); + +/* ABI defined routine to store a virtual register to memory. */ + +_Unwind_VRS_Result _Unwind_VRS_Get (_Unwind_Context *context, + _Unwind_VRS_RegClass regclass, + _uw regno, + _Unwind_VRS_DataRepresentation representation, + void *valuep) +{ + phase1_vrs *vrs = (phase1_vrs *) context; + + switch (regclass) + { + case _UVRSC_CORE: + if (representation != _UVRSD_UINT32 + || regno > 15) + return _UVRSR_FAILED; + *(_uw *) valuep = vrs->core.r[regno]; + return _UVRSR_OK; + + case _UVRSC_VFP: + case _UVRSC_FPA: + case _UVRSC_WMMXD: + case _UVRSC_WMMXC: + return _UVRSR_NOT_IMPLEMENTED; + + default: + return _UVRSR_FAILED; + } +} + + +/* ABI defined function to load a virtual register from memory. */ + +_Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, + _Unwind_VRS_RegClass regclass, + _uw regno, + _Unwind_VRS_DataRepresentation representation, + void *valuep) +{ + phase1_vrs *vrs = (phase1_vrs *) context; + + switch (regclass) + { + case _UVRSC_CORE: + if (representation != _UVRSD_UINT32 + || regno > 15) + return _UVRSR_FAILED; + + vrs->core.r[regno] = *(_uw *) valuep; + return _UVRSR_OK; + + case _UVRSC_VFP: + case _UVRSC_FPA: + case _UVRSC_WMMXD: + case _UVRSC_WMMXC: + return _UVRSR_NOT_IMPLEMENTED; + + default: + return _UVRSR_FAILED; + } +} + + +/* ABI defined function to pop registers off the stack. */ + +_Unwind_VRS_Result _Unwind_VRS_Pop (_Unwind_Context *context, + _Unwind_VRS_RegClass regclass, + _uw discriminator, + _Unwind_VRS_DataRepresentation representation) +{ + phase1_vrs *vrs = (phase1_vrs *) context; + + switch (regclass) + { + case _UVRSC_CORE: + { + _uw *ptr; + _uw mask; + int i; + + if (representation != _UVRSD_UINT32) + return _UVRSR_FAILED; + + mask = discriminator & 0xffff; + ptr = (_uw *) vrs->core.r[R_SP]; + /* Pop the requested registers. */ + for (i = 0; i < 16; i++) + { + if (mask & (1 << i)) + vrs->core.r[i] = *(ptr++); + } + /* Writeback the stack pointer value if it wasn't restored. */ + if ((mask & (1 << R_SP)) == 0) + vrs->core.r[R_SP] = (_uw) ptr; + } + return _UVRSR_OK; + + case _UVRSC_VFP: + { + _uw start = discriminator >> 16; + _uw count = discriminator & 0xffff; + struct vfp_regs tmp; + _uw *sp; + _uw *dest; + + if ((representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) + || start + count > 16) + return _UVRSR_FAILED; + + if (vrs->demand_save_flags & DEMAND_SAVE_VFP) + { + /* Demand-save resisters for stage1. */ + vrs->demand_save_flags &= ~DEMAND_SAVE_VFP; + __gnu_Unwind_Save_VFP (&vrs->vfp); + } + + /* Restore the registers from the stack. Do this by saving the + current VFP registers to a memory area, moving the in-memory + values into that area, and restoring from the whole area. + For _UVRSD_VFPX we assume FSTMX standard format 1. */ + __gnu_Unwind_Save_VFP (&tmp); + + /* The stack address is only guaranteed to be word aligned, so + we can't use doubleword copies. */ + sp = (_uw *) vrs->core.r[R_SP]; + dest = (_uw *) &tmp.d[start]; + count *= 2; + while (count--) + *(dest++) = *(sp++); + + /* Skip the pad word */ + if (representation == _UVRSD_VFPX) + sp++; + + /* Set the new stack pointer. */ + vrs->core.r[R_SP] = (_uw) sp; + + /* Reload the registers. */ + __gnu_Unwind_Restore_VFP (&tmp); + } + return _UVRSR_OK; + + case _UVRSC_FPA: + case _UVRSC_WMMXD: + case _UVRSC_WMMXC: + return _UVRSR_NOT_IMPLEMENTED; + + default: + return _UVRSR_FAILED; + } +} + + +/* Core unwinding functions. */ + +/* Calculate the address encoded by a 31-bit self-relative offset at address + P. */ +static inline _uw +selfrel_offset31 (const _uw *p) +{ + _uw offset; + + offset = *p; + /* Sign extend to 32 bits. */ + if (offset & (1 << 30)) + offset |= 1u << 31; + else + offset &= ~(1u << 31); + + return offset + (_uw) p; +} + + +/* Perform a binary search for RETURN_ADDRESS in TABLE. The table contains + NREC entries. */ + +static const __EIT_entry * +search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) +{ + _uw next_fn; + _uw this_fn; + int n, left, right; + + if (nrec == 0) + return (__EIT_entry *) 0; + + left = 0; + right = nrec - 1; + + while (1) + { + n = (left + right) / 2; + this_fn = selfrel_offset31 (&table[n].fnoffset); + if (n != nrec - 1) + next_fn = selfrel_offset31 (&table[n + 1].fnoffset) - 1; + else + next_fn = (_uw)0 - 1; + + if (return_address < this_fn) + { + if (n == left) + return (__EIT_entry *) 0; + right = n - 1; + } + else if (return_address <= next_fn) + return &table[n]; + else + left = n + 1; + } +} + +/* Find the exception index table eintry for the given address. + Fill in the relevant fields of the UCB. + Returns _URC_FAILURE if an error occurred, _URC_OK on success. */ + +static _Unwind_Reason_Code +get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) +{ + const __EIT_entry * eitp; + int nrec; + + /* The return address is the address of the instruction following the + call instruction (plus one in thumb mode). If this was the last + instruction in the function the address will lie in the following + function. Subtract 2 from the address so that it points within the call + instruction itself. */ + return_address -= 2; + + if (__gnu_Unwind_Find_exidx) + { + eitp = (const __EIT_entry *) __gnu_Unwind_Find_exidx (return_address, + &nrec); + if (!eitp) + { + UCB_PR_ADDR (ucbp) = 0; + return _URC_FAILURE; + } + } + else + { + eitp = &__exidx_start; + nrec = &__exidx_end - &__exidx_start; + } + + eitp = search_EIT_table (eitp, nrec, return_address); + + if (!eitp) + { + UCB_PR_ADDR (ucbp) = 0; + return _URC_FAILURE; + } + ucbp->pr_cache.fnstart = selfrel_offset31 (&eitp->fnoffset); + + /* Can this frame be unwound at all? */ + if (eitp->content == EXIDX_CANTUNWIND) + { + UCB_PR_ADDR (ucbp) = 0; + return _URC_END_OF_STACK; + } + + /* Obtain the address of the "real" __EHT_Header word. */ + + if (eitp->content & uint32_highbit) + { + /* It is immediate data. */ + ucbp->pr_cache.ehtp = (_Unwind_EHT_Header *)&eitp->content; + ucbp->pr_cache.additional = 1; + } + else + { + /* The low 31 bits of the content field are a self-relative + offset to an _Unwind_EHT_Entry structure. */ + ucbp->pr_cache.ehtp = + (_Unwind_EHT_Header *) selfrel_offset31 (&eitp->content); + ucbp->pr_cache.additional = 0; + } + + /* Discover the personality routine address. */ + if (*ucbp->pr_cache.ehtp & (1u << 31)) + { + /* One of the predefined standard routines. */ + _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf; + if (idx == 0) + UCB_PR_ADDR (ucbp) = (_uw) &__aeabi_unwind_cpp_pr0; + else if (idx == 1) + UCB_PR_ADDR (ucbp) = (_uw) &__aeabi_unwind_cpp_pr1; + else if (idx == 2) + UCB_PR_ADDR (ucbp) = (_uw) &__aeabi_unwind_cpp_pr2; + else + { /* Failed */ + UCB_PR_ADDR (ucbp) = 0; + return _URC_FAILURE; + } + } + else + { + /* Execute region offset to PR */ + UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); + } + return _URC_OK; +} + + +/* Perform phase2 unwinding. VRS is the initial virtual register state. */ + +static void __attribute__((noreturn)) +unwind_phase2 (_Unwind_Control_Block * ucbp, phase2_vrs * vrs) +{ + _Unwind_Reason_Code pr_result; + + do + { + /* Find the entry for this routine. */ + if (get_eit_entry (ucbp, vrs->core.r[R_PC]) != _URC_OK) + abort (); + + UCB_SAVED_CALLSITE_ADDR (ucbp) = vrs->core.r[R_PC]; + + /* Call the pr to decide what to do. */ + pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) + (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); + } + while (pr_result == _URC_CONTINUE_UNWIND); + + if (pr_result != _URC_INSTALL_CONTEXT) + abort(); + + restore_core_regs (&vrs->core); +} + +/* Perform phase2 forced unwinding. */ + +static _Unwind_Reason_Code +unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, + int resuming) +{ + _Unwind_Stop_Fn stop_fn = (_Unwind_Stop_Fn) UCB_FORCED_STOP_FN (ucbp); + void *stop_arg = (void *)UCB_FORCED_STOP_ARG (ucbp); + _Unwind_Reason_Code pr_result = 0; + /* We use phase1_vrs here even though we do not demand save, for the + prev_sp field. */ + phase1_vrs saved_vrs, next_vrs; + + /* Save the core registers. */ + saved_vrs.core = entry_vrs->core; + /* We don't need to demand-save the non-core registers, because we + unwind in a single pass. */ + saved_vrs.demand_save_flags = 0; + + /* Unwind until we reach a propagation barrier. */ + do + { + _Unwind_State action; + _Unwind_Reason_Code entry_code; + _Unwind_Reason_Code stop_code; + + /* Find the entry for this routine. */ + entry_code = get_eit_entry (ucbp, saved_vrs.core.r[R_PC]); + + if (resuming) + { + action = _US_UNWIND_FRAME_RESUME | _US_FORCE_UNWIND; + resuming = 0; + } + else + action = _US_UNWIND_FRAME_STARTING | _US_FORCE_UNWIND; + + if (entry_code == _URC_OK) + { + UCB_SAVED_CALLSITE_ADDR (ucbp) = saved_vrs.core.r[R_PC]; + + next_vrs = saved_vrs; + + /* Call the pr to decide what to do. */ + pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) + (action, ucbp, (void *) &next_vrs); + + saved_vrs.prev_sp = next_vrs.core.r[R_SP]; + } + else + { + /* Treat any failure as the end of unwinding, to cope more + gracefully with missing EH information. Mixed EH and + non-EH within one object will usually result in failure, + because the .ARM.exidx tables do not indicate the end + of the code to which they apply; but mixed EH and non-EH + shared objects should return an unwind failure at the + entry of a non-EH shared object. */ + action |= _US_END_OF_STACK; + + saved_vrs.prev_sp = saved_vrs.core.r[R_SP]; + } + + stop_code = stop_fn (1, action, ucbp->exception_class, ucbp, + (void *)&saved_vrs, stop_arg); + if (stop_code != _URC_NO_REASON) + return _URC_FAILURE; + + if (entry_code != _URC_OK) + return entry_code; + + saved_vrs = next_vrs; + } + while (pr_result == _URC_CONTINUE_UNWIND); + + if (pr_result != _URC_INSTALL_CONTEXT) + { + /* Some sort of failure has occurred in the pr and probably the + pr returned _URC_FAILURE. */ + return _URC_FAILURE; + } + + restore_core_regs (&saved_vrs.core); +} + +/* This is a very limited implementation of _Unwind_GetCFA. It returns + the stack pointer as it is about to be unwound, and is only valid + while calling the stop function during forced unwinding. If the + current personality routine result is going to run a cleanup, this + will not be the CFA; but when the frame is really unwound, it will + be. */ + +_Unwind_Word +_Unwind_GetCFA (_Unwind_Context *context) +{ + return ((phase1_vrs *) context)->prev_sp; +} + +/* Perform phase1 unwinding. UCBP is the exception being thrown, and + entry_VRS is the register state on entry to _Unwind_RaiseException. */ + +_Unwind_Reason_Code +__gnu_Unwind_RaiseException (_Unwind_Control_Block *, phase2_vrs *); + +_Unwind_Reason_Code +__gnu_Unwind_RaiseException (_Unwind_Control_Block * ucbp, + phase2_vrs * entry_vrs) +{ + phase1_vrs saved_vrs; + _Unwind_Reason_Code pr_result; + + /* Set the pc to the call site. */ + entry_vrs->core.r[R_PC] = entry_vrs->core.r[R_LR]; + + /* Save the core registers. */ + saved_vrs.core = entry_vrs->core; + /* Set demand-save flags. */ + saved_vrs.demand_save_flags = ~(_uw) 0; + + /* Unwind until we reach a propagation barrier. */ + do + { + /* Find the entry for this routine. */ + if (get_eit_entry (ucbp, saved_vrs.core.r[R_PC]) != _URC_OK) + return _URC_FAILURE; + + /* Call the pr to decide what to do. */ + pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) + (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); + } + while (pr_result == _URC_CONTINUE_UNWIND); + + /* We've unwound as far as we want to go, so restore the original + register state. */ + restore_non_core_regs (&saved_vrs); + if (pr_result != _URC_HANDLER_FOUND) + { + /* Some sort of failure has occurred in the pr and probably the + pr returned _URC_FAILURE. */ + return _URC_FAILURE; + } + + unwind_phase2 (ucbp, entry_vrs); +} + +/* Resume unwinding after a cleanup has been run. UCBP is the exception + being thrown and ENTRY_VRS is the register state on entry to + _Unwind_Resume. */ +_Unwind_Reason_Code +__gnu_Unwind_ForcedUnwind (_Unwind_Control_Block *, + _Unwind_Stop_Fn, void *, phase2_vrs *); + +_Unwind_Reason_Code +__gnu_Unwind_ForcedUnwind (_Unwind_Control_Block *ucbp, + _Unwind_Stop_Fn stop_fn, void *stop_arg, + phase2_vrs *entry_vrs) +{ + UCB_FORCED_STOP_FN (ucbp) = (_uw) stop_fn; + UCB_FORCED_STOP_ARG (ucbp) = (_uw) stop_arg; + + /* Set the pc to the call site. */ + entry_vrs->core.r[R_PC] = entry_vrs->core.r[R_LR]; + + return unwind_phase2_forced (ucbp, entry_vrs, 0); +} + +_Unwind_Reason_Code +__gnu_Unwind_Resume (_Unwind_Control_Block *, phase2_vrs *); + +_Unwind_Reason_Code +__gnu_Unwind_Resume (_Unwind_Control_Block * ucbp, phase2_vrs * entry_vrs) +{ + _Unwind_Reason_Code pr_result; + + /* Recover the saved address. */ + entry_vrs->core.r[R_PC] = UCB_SAVED_CALLSITE_ADDR (ucbp); + + if (UCB_FORCED_STOP_FN (ucbp)) + { + unwind_phase2_forced (ucbp, entry_vrs, 1); + + /* We can't return failure at this point. */ + abort (); + } + + /* Call the cached PR. */ + pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) + (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); + + switch (pr_result) + { + case _URC_INSTALL_CONTEXT: + /* Upload the registers to enter the landing pad. */ + restore_core_regs (&entry_vrs->core); + + case _URC_CONTINUE_UNWIND: + /* Continue unwinding the next frame. */ + unwind_phase2 (ucbp, entry_vrs); + + default: + abort (); + } +} + +_Unwind_Reason_Code +__gnu_Unwind_Resume_or_Rethrow (_Unwind_Control_Block *, phase2_vrs *); + +_Unwind_Reason_Code +__gnu_Unwind_Resume_or_Rethrow (_Unwind_Control_Block * ucbp, + phase2_vrs * entry_vrs) +{ + if (!UCB_FORCED_STOP_FN (ucbp)) + return __gnu_Unwind_RaiseException (ucbp, entry_vrs); + + /* Set the pc to the call site. */ + entry_vrs->core.r[R_PC] = entry_vrs->core.r[R_LR]; + /* Continue unwinding the next frame. */ + return unwind_phase2_forced (ucbp, entry_vrs, 0); +} + +/* Clean up an exception object when unwinding is complete. */ +void +_Unwind_Complete (_Unwind_Control_Block * ucbp __attribute__((unused))) +{ +} + + +/* Get the _Unwind_Control_Block from an _Unwind_Context. */ + +static inline _Unwind_Control_Block * +unwind_UCB_from_context (_Unwind_Context * context) +{ + return (_Unwind_Control_Block *) _Unwind_GetGR (context, R_IP); +} + + +/* Free an exception. */ + +void +_Unwind_DeleteException (_Unwind_Exception * exc) +{ + if (exc->exception_cleanup) + (*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc); +} + + +/* Common implementation for ARM ABI defined personality routines. + ID is the index of the personality routine, other arguments are as defined + by __aeabi_unwind_cpp_pr{0,1,2}. */ + +static _Unwind_Reason_Code +__gnu_unwind_pr_common (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context, + int id) +{ + __gnu_unwind_state uws; + _uw *data; + _uw offset; + _uw len; + _uw rtti_count; + int phase2_call_unexpected_after_unwind = 0; + int in_range = 0; + int forced_unwind = state & _US_FORCE_UNWIND; + + state &= _US_ACTION_MASK; + + data = (_uw *) ucbp->pr_cache.ehtp; + uws.data = *(data++); + uws.next = data; + if (id == 0) + { + uws.data <<= 8; + uws.words_left = 0; + uws.bytes_left = 3; + } + else + { + uws.words_left = (uws.data >> 16) & 0xff; + uws.data <<= 16; + uws.bytes_left = 2; + data += uws.words_left; + } + + /* Restore the saved pointer. */ + if (state == _US_UNWIND_FRAME_RESUME) + data = (_uw *) ucbp->cleanup_cache.bitpattern[0]; + + if ((ucbp->pr_cache.additional & 1) == 0) + { + /* Process descriptors. */ + while (*data) + { + _uw addr; + _uw fnstart; + + if (id == 2) + { + len = ((EHT32 *) data)->length; + offset = ((EHT32 *) data)->offset; + data += 2; + } + else + { + len = ((EHT16 *) data)->length; + offset = ((EHT16 *) data)->offset; + data++; + } + + fnstart = ucbp->pr_cache.fnstart + (offset & ~1); + addr = _Unwind_GetGR (context, R_PC); + in_range = (fnstart <= addr && addr < fnstart + (len & ~1)); + + switch (((offset & 1) << 1) | (len & 1)) + { + case 0: + /* Cleanup. */ + if (state != _US_VIRTUAL_UNWIND_FRAME + && in_range) + { + /* Cleanup in range, and we are running cleanups. */ + _uw lp; + + /* Landing pad address is 31-bit pc-relative offset. */ + lp = selfrel_offset31 (data); + data++; + /* Save the exception data pointer. */ + ucbp->cleanup_cache.bitpattern[0] = (_uw) data; + if (!__cxa_begin_cleanup (ucbp)) + return _URC_FAILURE; + /* Setup the VRS to enter the landing pad. */ + _Unwind_SetGR (context, R_PC, lp); + return _URC_INSTALL_CONTEXT; + } + /* Cleanup not in range, or we are in stage 1. */ + data++; + break; + + case 1: + /* Catch handler. */ + if (state == _US_VIRTUAL_UNWIND_FRAME) + { + if (in_range) + { + /* Check for a barrier. */ + _uw rtti; + void *matched; + + /* Check for no-throw areas. */ + if (data[1] == (_uw) -2) + return _URC_FAILURE; + + /* The thrown object immediately follows the ECB. */ + matched = (void *)(ucbp + 1); + if (data[1] != (_uw) -1) + { + /* Match a catch specification. */ + rtti = _Unwind_decode_target2 ((_uw) &data[1]); + if (!__cxa_type_match (ucbp, (type_info *) rtti, + &matched)) + matched = (void *)0; + } + + if (matched) + { + ucbp->barrier_cache.sp = + _Unwind_GetGR (context, R_SP); + ucbp->barrier_cache.bitpattern[0] = (_uw) matched; + ucbp->barrier_cache.bitpattern[1] = (_uw) data; + return _URC_HANDLER_FOUND; + } + } + /* Handler out of range, or not matched. */ + } + else if (ucbp->barrier_cache.sp == _Unwind_GetGR (context, R_SP) + && ucbp->barrier_cache.bitpattern[1] == (_uw) data) + { + /* Matched a previous propagation barrier. */ + _uw lp; + + /* Setup for entry to the handler. */ + lp = selfrel_offset31 (data); + _Unwind_SetGR (context, R_PC, lp); + _Unwind_SetGR (context, 0, (_uw) ucbp); + return _URC_INSTALL_CONTEXT; + } + /* Catch handler not matched. Advance to the next descriptor. */ + data += 2; + break; + + case 2: + rtti_count = data[0] & 0x7fffffff; + /* Exception specification. */ + if (state == _US_VIRTUAL_UNWIND_FRAME) + { + if (in_range && (!forced_unwind || !rtti_count)) + { + /* Match against the exception specification. */ + _uw i; + _uw rtti; + void *matched; + + for (i = 0; i < rtti_count; i++) + { + matched = (void *)(ucbp + 1); + rtti = _Unwind_decode_target2 ((_uw) &data[i + 1]); + if (__cxa_type_match (ucbp, (type_info *) rtti, + &matched)) + break; + } + + if (i == rtti_count) + { + /* Exception does not match the spec. */ + ucbp->barrier_cache.sp = + _Unwind_GetGR (context, R_SP); + ucbp->barrier_cache.bitpattern[0] = (_uw) matched; + ucbp->barrier_cache.bitpattern[1] = (_uw) data; + return _URC_HANDLER_FOUND; + } + } + /* Handler out of range, or exception is permitted. */ + } + else if (ucbp->barrier_cache.sp == _Unwind_GetGR (context, R_SP) + && ucbp->barrier_cache.bitpattern[1] == (_uw) data) + { + /* Matched a previous propagation barrier. */ + _uw lp; + /* Record the RTTI list for __cxa_call_unexpected. */ + ucbp->barrier_cache.bitpattern[1] = rtti_count; + ucbp->barrier_cache.bitpattern[2] = 0; + ucbp->barrier_cache.bitpattern[3] = 4; + ucbp->barrier_cache.bitpattern[4] = (_uw) &data[1]; + + if (data[0] & uint32_highbit) + phase2_call_unexpected_after_unwind = 1; + else + { + data += rtti_count + 1; + /* Setup for entry to the handler. */ + lp = selfrel_offset31 (data); + data++; + _Unwind_SetGR (context, R_PC, lp); + _Unwind_SetGR (context, 0, (_uw) ucbp); + return _URC_INSTALL_CONTEXT; + } + } + if (data[0] & uint32_highbit) + data++; + data += rtti_count + 1; + break; + + default: + /* Should never happen. */ + return _URC_FAILURE; + } + /* Finished processing this descriptor. */ + } + } + + if (__gnu_unwind_execute (context, &uws) != _URC_OK) + return _URC_FAILURE; + + if (phase2_call_unexpected_after_unwind) + { + /* Enter __cxa_unexpected as if called from the call site. */ + _Unwind_SetGR (context, R_LR, _Unwind_GetGR (context, R_PC)); + _Unwind_SetGR (context, R_PC, (_uw) &__cxa_call_unexpected); + return _URC_INSTALL_CONTEXT; + } + + return _URC_CONTINUE_UNWIND; +} + + +/* ABI defined personality routine entry points. */ + +_Unwind_Reason_Code +__aeabi_unwind_cpp_pr0 (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + return __gnu_unwind_pr_common (state, ucbp, context, 0); +} + +_Unwind_Reason_Code +__aeabi_unwind_cpp_pr1 (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + return __gnu_unwind_pr_common (state, ucbp, context, 1); +} + +_Unwind_Reason_Code +__aeabi_unwind_cpp_pr2 (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + return __gnu_unwind_pr_common (state, ucbp, context, 2); +} + +/* These two should never be used. */ +_Unwind_Ptr +_Unwind_GetDataRelBase (_Unwind_Context *context __attribute__ ((unused))) +{ + abort (); +} + +_Unwind_Ptr +_Unwind_GetTextRelBase (_Unwind_Context *context __attribute__ ((unused))) +{ + abort (); +} diff --git a/contrib/gcc/config/arm/unwind-arm.h b/contrib/gcc/config/arm/unwind-arm.h new file mode 100644 index 00000000000..a3040d7ad77 --- /dev/null +++ b/contrib/gcc/config/arm/unwind-arm.h @@ -0,0 +1,271 @@ +/* Header file for the ARM EABI unwinder + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Language-independent unwinder header public defines. This contains both + ABI defined objects, and GNU support routines. */ + +#ifndef UNWIND_ARM_H +#define UNWIND_ARM_H + +#define __ARM_EABI_UNWINDER__ 1 + +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); + typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); + typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); + typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + typedef _Unwind_Word _uw; + typedef unsigned _uw64 __attribute__((mode(__DI__))); + typedef unsigned _uw16 __attribute__((mode(__HI__))); + typedef unsigned _uw8 __attribute__((mode(__QI__))); + + typedef enum + { + _URC_OK = 0, /* operation completed successfully */ + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8, + _URC_FAILURE = 9 /* unspecified failure of some kind */ + } + _Unwind_Reason_Code; + + typedef enum + { + _US_VIRTUAL_UNWIND_FRAME = 0, + _US_UNWIND_FRAME_STARTING = 1, + _US_UNWIND_FRAME_RESUME = 2, + _US_ACTION_MASK = 3, + _US_FORCE_UNWIND = 8, + _US_END_OF_STACK = 16 + } + _Unwind_State; + + /* Provided only for for compatibility with existing code. */ + typedef int _Unwind_Action; +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 +#define _URC_NO_REASON _URC_OK + + typedef struct _Unwind_Control_Block _Unwind_Control_Block; + typedef struct _Unwind_Context _Unwind_Context; + typedef _uw _Unwind_EHT_Header; + + + /* UCB: */ + + struct _Unwind_Control_Block + { + char exception_class[8]; + void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); + /* Unwinder cache, private fields for the unwinder's use */ + struct + { + _uw reserved1; /* Forced unwind stop fn, 0 if not forced */ + _uw reserved2; /* Personality routine address */ + _uw reserved3; /* Saved callsite address */ + _uw reserved4; /* Forced unwind stop arg */ + _uw reserved5; + } + unwinder_cache; + /* Propagation barrier cache (valid after phase 1): */ + struct + { + _uw sp; + _uw bitpattern[5]; + } + barrier_cache; + /* Cleanup cache (preserved over cleanup): */ + struct + { + _uw bitpattern[4]; + } + cleanup_cache; + /* Pr cache (for pr's benefit): */ + struct + { + _uw fnstart; /* function start address */ + _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ + _uw additional; /* additional data */ + _uw reserved1; + } + pr_cache; + long long int :0; /* Force alignment to 8-byte boundary */ + }; + + /* Virtual Register Set*/ + + typedef enum + { + _UVRSC_CORE = 0, /* integer register */ + _UVRSC_VFP = 1, /* vfp */ + _UVRSC_FPA = 2, /* fpa */ + _UVRSC_WMMXD = 3, /* Intel WMMX data register */ + _UVRSC_WMMXC = 4 /* Intel WMMX control register */ + } + _Unwind_VRS_RegClass; + + typedef enum + { + _UVRSD_UINT32 = 0, + _UVRSD_VFPX = 1, + _UVRSD_FPAX = 2, + _UVRSD_UINT64 = 3, + _UVRSD_FLOAT = 4, + _UVRSD_DOUBLE = 5 + } + _Unwind_VRS_DataRepresentation; + + typedef enum + { + _UVRSR_OK = 0, + _UVRSR_NOT_IMPLEMENTED = 1, + _UVRSR_FAILED = 2 + } + _Unwind_VRS_Result; + + /* Frame unwinding state. */ + typedef struct + { + /* The current word (bytes packed msb first). */ + _uw data; + /* Pointer to the next word of data. */ + _uw *next; + /* The number of bytes left in this word. */ + _uw8 bytes_left; + /* The number of words pointed to by ptr. */ + _uw8 words_left; + } + __gnu_unwind_state; + + typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *); + + _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation); + + + /* Support functions for the PR. */ +#define _Unwind_Exception _Unwind_Control_Block + typedef char _Unwind_Exception_Class[8]; + + void * _Unwind_GetLanguageSpecificData (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *); + + /* These two should never be used. */ + _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *); + + /* Interface functions: */ + _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp); + void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp); + _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp); + + typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + _Unwind_Control_Block *, struct _Unwind_Context *, void *); + _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *, + _Unwind_Stop_Fn, void *); + _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + void _Unwind_Complete(_Unwind_Control_Block *ucbp); + void _Unwind_DeleteException (_Unwind_Exception *); + + _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *, + _Unwind_Context *); + _Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *, + __gnu_unwind_state *); + + /* Decode an R_ARM_TARGET2 relocation. */ + static inline _Unwind_Word + _Unwind_decode_target2 (_Unwind_Word ptr) + { + _Unwind_Word tmp; + + tmp = *(_Unwind_Word *) ptr; + /* Zero values are always NULL. */ + if (!tmp) + return 0; + +#if defined(linux) || defined(__NetBSD__) + /* Pc-relative indirect. */ + tmp += ptr; + tmp = *(_Unwind_Word *) tmp; +#elif defined(__symbian__) + /* Absolute pointer. Nothing more to do. */ +#else + /* Pc-relative pointer. */ + tmp += ptr; +#endif + return tmp; + } + + static inline _Unwind_Word + _Unwind_GetGR (_Unwind_Context *context, int regno) + { + _uw val; + _Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + return val; + } + + /* Return the address of the instruction, not the actual IP value. */ +#define _Unwind_GetIP(context) \ + (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1) + +#define _Unwind_GetIPInfo(context, ip_before_insn) \ + (*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1) + + static inline void + _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val) + { + _Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + } + + /* The dwarf unwinder doesn't understand arm/thumb state. We assume the + landing pad uses the same instruction set as the call site. */ +#define _Unwind_SetIP(context, val) \ + _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1)) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* defined UNWIND_ARM_H */ diff --git a/contrib/gcc/config/arm/vfp.md b/contrib/gcc/config/arm/vfp.md new file mode 100644 index 00000000000..2380c83cad9 --- /dev/null +++ b/contrib/gcc/config/arm/vfp.md @@ -0,0 +1,841 @@ +;; ARM VFP coprocessor Machine Description +;; Copyright (C) 2003, 2005 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. */ + +;; Additional register numbers +(define_constants + [(VFPCC_REGNUM 95)] +) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipeline description +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_automaton "vfp11") + +;; There are 3 pipelines in the VFP11 unit. +;; +;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from +;; fourth stage for simple operations. +;; +;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns. +;; These insns also uses first execute stage of FMAC pipeline. +;; +;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from +;; second memory stage for loads. + +;; We do not model Write-After-Read hazards. +;; We do not do write scheduling with the arm core, so it is only necessary +;; to model the first stage of each pipeline +;; ??? Need to model LS pipeline properly for load/store multiple? +;; We do not model fmstat properly. This could be done by modeling pipelines +;; properly and defining an absence set between a dummy fmstat unit and all +;; other vfp units. + +(define_cpu_unit "fmac" "vfp11") + +(define_cpu_unit "ds" "vfp11") + +(define_cpu_unit "vfp_ls" "vfp11") + +(define_cpu_unit "fmstat" "vfp11") + +(exclusion_set "fmac,ds" "fmstat") + +;; The VFP "type" attributes differ from those used in the FPA model. +;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp. +;; farith Most arithmetic insns. +;; fmul Double precision multiply. +;; fdivs Single precision sqrt or division. +;; fdivd Double precision sqrt or division. +;; f_flag fmstat operation +;; f_load[sd] Floating point load from memory. +;; f_store[sd] Floating point store to memory. +;; f_2_r Transfer vfp to arm reg. +;; r_2_f Transfer arm to vfp reg. +;; f_cvt Convert floating<->integral + +(define_insn_reservation "vfp_ffarith" 4 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "ffarith")) + "fmac") + +(define_insn_reservation "vfp_farith" 8 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "farith,f_cvt")) + "fmac") + +(define_insn_reservation "vfp_fmul" 9 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "fmul")) + "fmac*2") + +(define_insn_reservation "vfp_fdivs" 19 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "fdivs")) + "ds*15") + +(define_insn_reservation "vfp_fdivd" 33 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "fdivd")) + "fmac+ds*29") + +;; Moves to/from arm regs also use the load/store pipeline. +(define_insn_reservation "vfp_fload" 4 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "f_loads,f_loadd,r_2_f")) + "vfp_ls") + +(define_insn_reservation "vfp_fstore" 4 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "f_stores,f_stored,f_2_r")) + "vfp_ls") + +(define_insn_reservation "vfp_to_cpsr" 4 + (and (eq_attr "generic_vfp" "yes") + (eq_attr "type" "f_flag")) + "fmstat,vfp_ls*3") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Insn pattern +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; SImode moves +;; ??? For now do not allow loading constants into vfp regs. This causes +;; problems because small constants get converted into adds. +(define_insn "*arm_movsi_vfp" + [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r ,m,*w,r,*w,*w, *Uv") + (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,*w,*w,*Uvi,*w"))] + "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT + && ( s_register_operand (operands[0], SImode) + || s_register_operand (operands[1], SImode))" + "@ + mov%?\\t%0, %1 + mvn%?\\t%0, #%B1 + ldr%?\\t%0, %1 + str%?\\t%1, %0 + fmsr%?\\t%0, %1\\t%@ int + fmrs%?\\t%0, %1\\t%@ int + fcpys%?\\t%0, %1\\t%@ int + flds%?\\t%0, %1\\t%@ int + fsts%?\\t%1, %0\\t%@ int" + [(set_attr "predicable" "yes") + (set_attr "type" "*,*,load1,store1,r_2_f,f_2_r,ffarith,f_loads,f_stores") + (set_attr "pool_range" "*,*,4096,*,*,*,*,1020,*") + (set_attr "neg_pool_range" "*,*,4084,*,*,*,*,1008,*")] +) + + +;; DImode moves + +(define_insn "*arm_movdi_vfp" + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,m,w,r,w,w, Uv") + (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP + && ( register_operand (operands[0], DImode) + || register_operand (operands[1], DImode))" + "* + switch (which_alternative) + { + case 0: + return \"#\"; + case 1: + case 2: + return output_move_double (operands); + case 3: + return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\"; + case 4: + return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\"; + case 5: + return \"fcpyd%?\\t%P0, %P1\\t%@ int\"; + case 6: + return \"fldd%?\\t%P0, %1\\t%@ int\"; + case 7: + return \"fstd%?\\t%P1, %0\\t%@ int\"; + default: + gcc_unreachable (); + } + " + [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_loadd,f_stored") + (set_attr "length" "8,8,8,4,4,4,4,4") + (set_attr "pool_range" "*,1020,*,*,*,*,1020,*") + (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")] +) + + +;; SFmode moves +;; Disparage the w<->r cases because reloading an invalid address is +;; preferable to loading the value via integer registers. + +(define_insn "*movsf_vfp" + [(set (match_operand:SF 0 "nonimmediate_operand" "=w,?r,w ,Uv,r ,m,w,r") + (match_operand:SF 1 "general_operand" " ?r,w,UvE,w, mE,r,w,r"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP + && ( s_register_operand (operands[0], SFmode) + || s_register_operand (operands[1], SFmode))" + "@ + fmsr%?\\t%0, %1 + fmrs%?\\t%0, %1 + flds%?\\t%0, %1 + fsts%?\\t%1, %0 + ldr%?\\t%0, %1\\t%@ float + str%?\\t%1, %0\\t%@ float + fcpys%?\\t%0, %1 + mov%?\\t%0, %1\\t%@ float" + [(set_attr "predicable" "yes") + (set_attr "type" "r_2_f,f_2_r,ffarith,*,f_loads,f_stores,load1,store1") + (set_attr "pool_range" "*,*,1020,*,4096,*,*,*") + (set_attr "neg_pool_range" "*,*,1008,*,4080,*,*,*")] +) + + +;; DFmode moves + +(define_insn "*movdf_vfp" + [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,?r,r, m,w ,Uv,w,r") + (match_operand:DF 1 "soft_df_operand" " ?r,w,mF,r,UvF,w, w,r"))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP + && ( register_operand (operands[0], DFmode) + || register_operand (operands[1], DFmode))" + "* + { + switch (which_alternative) + { + case 0: + return \"fmdrr%?\\t%P0, %Q1, %R1\"; + case 1: + return \"fmrrd%?\\t%Q0, %R0, %P1\"; + case 2: case 3: + return output_move_double (operands); + case 4: + return \"fldd%?\\t%P0, %1\"; + case 5: + return \"fstd%?\\t%P1, %0\"; + case 6: + return \"fcpyd%?\\t%P0, %P1\"; + case 7: + return \"#\"; + default: + gcc_unreachable (); + } + } + " + [(set_attr "type" "r_2_f,f_2_r,ffarith,*,load2,store2,f_loadd,f_stored") + (set_attr "length" "4,4,8,8,4,4,4,8") + (set_attr "pool_range" "*,*,1020,*,1020,*,*,*") + (set_attr "neg_pool_range" "*,*,1008,*,1008,*,*,*")] +) + + +;; Conditional move patterns + +(define_insn "*movsfcc_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r") + (if_then_else:SF + (match_operator 3 "arm_comparison_operator" + [(match_operand 4 "cc_register" "") (const_int 0)]) + (match_operand:SF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w") + (match_operand:SF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcpys%D3\\t%0, %2 + fcpys%d3\\t%0, %1 + fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1 + fmsr%D3\\t%0, %2 + fmsr%d3\\t%0, %1 + fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1 + fmrs%D3\\t%0, %2 + fmrs%d3\\t%0, %1 + fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1" + [(set_attr "conds" "use") + (set_attr "length" "4,4,8,4,4,8,4,4,8") + (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")] +) + +(define_insn "*movdfcc_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r") + (if_then_else:DF + (match_operator 3 "arm_comparison_operator" + [(match_operand 4 "cc_register" "") (const_int 0)]) + (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w") + (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcpyd%D3\\t%P0, %P2 + fcpyd%d3\\t%P0, %P1 + fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1 + fmdrr%D3\\t%P0, %Q2, %R2 + fmdrr%d3\\t%P0, %Q1, %R1 + fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1 + fmrrd%D3\\t%Q0, %R0, %P2 + fmrrd%d3\\t%Q0, %R0, %P1 + fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1" + [(set_attr "conds" "use") + (set_attr "length" "4,4,8,4,4,8,4,4,8") + (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")] +) + + +;; Sign manipulation functions + +(define_insn "*abssf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (abs:SF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fabss%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*absdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (abs:DF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fabsd%?\\t%P0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*negsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w,?r") + (neg:SF (match_operand:SF 1 "s_register_operand" "w,r")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fnegs%?\\t%0, %1 + eor%?\\t%0, %1, #-2147483648" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn_and_split "*negdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w,?r,?r") + (neg:DF (match_operand:DF 1 "s_register_operand" "w,0,r")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fnegd%?\\t%P0, %P1 + # + #" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP && reload_completed + && arm_general_register_operand (operands[0], DFmode)" + [(set (match_dup 0) (match_dup 1))] + " + if (REGNO (operands[0]) == REGNO (operands[1])) + { + operands[0] = gen_highpart (SImode, operands[0]); + operands[1] = gen_rtx_XOR (SImode, operands[0], GEN_INT (0x80000000)); + } + else + { + rtx in_hi, in_lo, out_hi, out_lo; + + in_hi = gen_rtx_XOR (SImode, gen_highpart (SImode, operands[1]), + GEN_INT (0x80000000)); + in_lo = gen_lowpart (SImode, operands[1]); + out_hi = gen_highpart (SImode, operands[0]); + out_lo = gen_lowpart (SImode, operands[0]); + + if (REGNO (in_lo) == REGNO (out_hi)) + { + emit_insn (gen_rtx_SET (SImode, out_lo, in_lo)); + operands[0] = out_hi; + operands[1] = in_hi; + } + else + { + emit_insn (gen_rtx_SET (SImode, out_hi, in_hi)); + operands[0] = out_lo; + operands[1] = in_lo; + } + } + " + [(set_attr "predicable" "yes") + (set_attr "length" "4,4,8") + (set_attr "type" "ffarith")] +) + + +;; Arithmetic insns + +(define_insn "*addsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (plus:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fadds%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*adddf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (plus:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "faddd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + + +(define_insn "*subsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsubs%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*subdf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsubd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + + +;; Division insns + +(define_insn "*divsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (div:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fdivs%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivs")] +) + +(define_insn "*divdf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (div:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fdivd%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivd")] +) + + +;; Multiplication insns + +(define_insn "*mulsf3_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (mult:SF (match_operand:SF 1 "s_register_operand" "w") + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmuls%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (mult:DF (match_operand:DF 1 "s_register_operand" "w") + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmuld%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +(define_insn "*mulsf3negsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "+w") + (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "w")) + (match_operand:SF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmuls%?\\t%0, %1, %2" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3negdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "+w") + (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w")) + (match_operand:DF 2 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmuld%?\\t%P0, %P1, %P2" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; Multiply-accumulate insns + +;; 0 = 1 * 2 + 0 +(define_insn "*mulsf3addsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmacs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3adddf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmacd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + +;; 0 = 1 * 2 - 0 +(define_insn "*mulsf3subsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmscs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3subdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmscd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + +;; 0 = -(1 * 2) + 0 +(define_insn "*mulsf3negsfaddsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (match_operand:SF 1 "s_register_operand" "0") + (mult:SF (match_operand:SF 2 "s_register_operand" "w") + (match_operand:SF 3 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmacs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*fmuldf3negdfadddf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (match_operand:DF 1 "s_register_operand" "0") + (mult:DF (match_operand:DF 2 "s_register_operand" "w") + (match_operand:DF 3 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmacd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; 0 = -(1 * 2) - 0 +(define_insn "*mulsf3negsfsubsf_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (minus:SF (mult:SF + (neg:SF (match_operand:SF 2 "s_register_operand" "w")) + (match_operand:SF 3 "s_register_operand" "w")) + (match_operand:SF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmscs%?\\t%0, %2, %3" + [(set_attr "predicable" "yes") + (set_attr "type" "farith")] +) + +(define_insn "*muldf3negdfsubdf_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (minus:DF (mult:DF + (neg:DF (match_operand:DF 2 "s_register_operand" "w")) + (match_operand:DF 3 "s_register_operand" "w")) + (match_operand:DF 1 "s_register_operand" "0")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fnmscd%?\\t%P0, %P2, %P3" + [(set_attr "predicable" "yes") + (set_attr "type" "fmul")] +) + + +;; Conversion routines + +(define_insn "*extendsfdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (float_extend:DF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fcvtds%?\\t%P0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "*truncdfsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (float_truncate:SF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fcvtsd%?\\t%0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "*truncsisf2_vfp" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftosizs%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "*truncsidf2_vfp" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftosizd%?\\t%0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + + +(define_insn "fixuns_truncsfsi2" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (unsigned_fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftouizs%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "fixuns_truncdfsi2" + [(set (match_operand:SI 0 "s_register_operand" "=w") + (unsigned_fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "ftouizd%?\\t%0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + + +(define_insn "*floatsisf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (float:SF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsitos%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "*floatsidf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (float:DF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsitod%?\\t%P0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + + +(define_insn "floatunssisf2" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (unsigned_float:SF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fuitos%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + +(define_insn "floatunssidf2" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (unsigned_float:DF (match_operand:SI 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fuitod%?\\t%P0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "f_cvt")] +) + + +;; Sqrt insns. + +(define_insn "*sqrtsf2_vfp" + [(set (match_operand:SF 0 "s_register_operand" "=w") + (sqrt:SF (match_operand:SF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsqrts%?\\t%0, %1" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivs")] +) + +(define_insn "*sqrtdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w") + (sqrt:DF (match_operand:DF 1 "s_register_operand" "w")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fsqrtd%?\\t%P0, %P1" + [(set_attr "predicable" "yes") + (set_attr "type" "fdivd")] +) + + +;; Patterns to split/copy vfp condition flags. + +(define_insn "*movcc_vfp" + [(set (reg CC_REGNUM) + (reg VFPCC_REGNUM))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "fmstat%?" + [(set_attr "conds" "set") + (set_attr "type" "f_flag")] +) + +(define_insn_and_split "*cmpsf_split_vfp" + [(set (reg:CCFP CC_REGNUM) + (compare:CCFP (match_operand:SF 0 "s_register_operand" "w") + (match_operand:SF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_dup 0) + (match_dup 1))) + (set (reg:CCFP CC_REGNUM) + (reg:CCFP VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpsf_trap_split_vfp" + [(set (reg:CCFPE CC_REGNUM) + (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w") + (match_operand:SF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_dup 0) + (match_dup 1))) + (set (reg:CCFPE CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpdf_split_vfp" + [(set (reg:CCFP CC_REGNUM) + (compare:CCFP (match_operand:DF 0 "s_register_operand" "w") + (match_operand:DF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_dup 0) + (match_dup 1))) + (set (reg:CCFP CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + +(define_insn_and_split "*cmpdf_trap_split_vfp" + [(set (reg:CCFPE CC_REGNUM) + (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w") + (match_operand:DF 1 "vfp_compare_operand" "wG")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "#" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_dup 0) + (match_dup 1))) + (set (reg:CCFPE CC_REGNUM) + (reg:CCFPE VFPCC_REGNUM))] + "" +) + + +;; Comparison patterns + +(define_insn "*cmpsf_vfp" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_operand:SF 0 "s_register_operand" "w,w") + (match_operand:SF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmps%?\\t%0, %1 + fcmpzs%?\\t%0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpsf_trap_vfp" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w,w") + (match_operand:SF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmpes%?\\t%0, %1 + fcmpezs%?\\t%0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpdf_vfp" + [(set (reg:CCFP VFPCC_REGNUM) + (compare:CCFP (match_operand:DF 0 "s_register_operand" "w,w") + (match_operand:DF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmpd%?\\t%P0, %P1 + fcmpzd%?\\t%P0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + +(define_insn "*cmpdf_trap_vfp" + [(set (reg:CCFPE VFPCC_REGNUM) + (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w,w") + (match_operand:DF 1 "vfp_compare_operand" "w,G")))] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "@ + fcmped%?\\t%P0, %P1 + fcmpezd%?\\t%P0" + [(set_attr "predicable" "yes") + (set_attr "type" "ffarith")] +) + + +;; Store multiple insn used in function prologue. + +(define_insn "*push_multi_vfp" + [(match_parallel 2 "multi_register_push" + [(set (match_operand:BLK 0 "memory_operand" "=m") + (unspec:BLK [(match_operand:DF 1 "s_register_operand" "w")] + UNSPEC_PUSH_MULT))])] + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" + "* return vfp_output_fstmx (operands);" + [(set_attr "type" "f_stored")] +) + + +;; Unimplemented insns: +;; fldm* +;; fstm* +;; fmdhr et al (VFPv1) +;; Support for xD (single precision only) variants. +;; fmrrs, fmsrr diff --git a/contrib/gcc/config/arm/vxworks.h b/contrib/gcc/config/arm/vxworks.h index afe6b7043be..319c1e842e7 100644 --- a/contrib/gcc/config/arm/vxworks.h +++ b/contrib/gcc/config/arm/vxworks.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for ARM with targetting the VXWorks run time environment. - Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. Contributed by: Mike Stump Brought up to date by CodeSourcery, LLC. @@ -19,8 +19,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ @@ -46,16 +46,16 @@ Boston, MA 02111-1307, USA. */ #undef CC1_SPEC #define CC1_SPEC \ -"%{t4: -mapcs-32 -mlittle-endian -march=armv4 ; \ - t4be: -mapcs-32 -mbig-endian -march=armv4 ; \ +"%{t4: -mlittle-endian -march=armv4 ; \ + t4be: -mbig-endian -march=armv4 ; \ t4t: -mthumb -mthumb-interwork -mlittle-endian -march=armv4t ; \ t4tbe: -mthumb -mthumb-interwork -mbig-endian -march=armv4t ; \ - t5: -mapcs-32 -mlittle-endian -march=armv5 ; \ - t5be: -mapcs-32 -mbig-endian -march=armv5 ; \ + t5: -mlittle-endian -march=armv5 ; \ + t5be: -mbig-endian -march=armv5 ; \ t5t: -mthumb -mthumb-interwork -mlittle-endian -march=armv5 ; \ t5tbe: -mthumb -mthumb-interwork -mbig-endian -march=armv5 ; \ - txscale: -mapcs-32 -mlittle-endian -mcpu=xscale ; \ - txscalebe: -mapcs-32 -mbig-endian -mcpu=xscale ; \ + txscale: -mlittle-endian -mcpu=xscale ; \ + txscalebe: -mbig-endian -mcpu=xscale ; \ : -march=armv4}" /* The -Q options from svr4.h aren't understood and must be removed. */ diff --git a/contrib/gcc/config/arm/wince-pe.h b/contrib/gcc/config/arm/wince-pe.h index fb474853fdb..530340f9d7c 100644 --- a/contrib/gcc/config/arm/wince-pe.h +++ b/contrib/gcc/config/arm/wince-pe.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with WINCE-PE obj format. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nick Clifton This file is part of GCC. @@ -16,14 +16,12 @@ 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. */ - -/* Override arm/pe.h's default apcs26 support. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SOFT_FLOAT | TARGET_FLAG_NOP_FUN | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } + { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } diff --git a/contrib/gcc/config/arm/xscale-coff.h b/contrib/gcc/config/arm/xscale-coff.h index d8fee7de3d8..e2759434806 100644 --- a/contrib/gcc/config/arm/xscale-coff.h +++ b/contrib/gcc/config/arm/xscale-coff.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Run-time Target Specification. */ #undef SUBTARGET_CPU_DEFAULT diff --git a/contrib/gcc/config/arm/xscale-elf.h b/contrib/gcc/config/arm/xscale-elf.h index aea8360dba8..be7be087b49 100644 --- a/contrib/gcc/config/arm/xscale-elf.h +++ b/contrib/gcc/config/arm/xscale-elf.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Run-time Target Specification. */ #ifndef TARGET_VERSION diff --git a/contrib/gcc/config/darwin-64.c b/contrib/gcc/config/darwin-64.c new file mode 100644 index 00000000000..33094e30785 --- /dev/null +++ b/contrib/gcc/config/darwin-64.c @@ -0,0 +1,77 @@ +/* Functions shipped in the ppc64 and x86_64 version of libgcc_s.1.dylib + in older Mac OS X versions, preserved for backwards compatibility. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#if defined (__ppc64__) || defined (__x86_64__) +/* Many of these functions have probably never been used by anyone + anywhere on these targets, but it's hard to prove this, so they're defined + here. None are actually necessary, as demonstrated below by defining + each function using the operation it implements. */ + +typedef long DI; +typedef unsigned long uDI; +typedef int SI; +typedef unsigned int uSI; +typedef int word_type __attribute__ ((mode (__word__))); + +DI __ashldi3 (DI x, word_type c); +DI __ashrdi3 (DI x, word_type c); +int __clzsi2 (uSI x); +word_type __cmpdi2 (DI x, DI y); +int __ctzsi2 (uSI x); +DI __divdi3 (DI x, DI y); +uDI __lshrdi3 (uDI x, word_type c); +DI __moddi3 (DI x, DI y); +DI __muldi3 (DI x, DI y); +DI __negdi2 (DI x); +int __paritysi2 (uSI x); +int __popcountsi2 (uSI x); +word_type __ucmpdi2 (uDI x, uDI y); +uDI __udivdi3 (uDI x, uDI y); +uDI __udivmoddi4 (uDI x, uDI y, uDI *r); +uDI __umoddi3 (uDI x, uDI y); + +DI __ashldi3 (DI x, word_type c) { return x << c; } +DI __ashrdi3 (DI x, word_type c) { return x >> c; } +int __clzsi2 (uSI x) { return __builtin_clz (x); } +word_type __cmpdi2 (DI x, DI y) { return x < y ? 0 : x == y ? 1 : 2; } +int __ctzsi2 (uSI x) { return __builtin_ctz (x); } +DI __divdi3 (DI x, DI y) { return x / y; } +uDI __lshrdi3 (uDI x, word_type c) { return x >> c; } +DI __moddi3 (DI x, DI y) { return x % y; } +DI __muldi3 (DI x, DI y) { return x * y; } +DI __negdi2 (DI x) { return -x; } +int __paritysi2 (uSI x) { return __builtin_parity (x); } +int __popcountsi2 (uSI x) { return __builtin_popcount (x); } +word_type __ucmpdi2 (uDI x, uDI y) { return x < y ? 0 : x == y ? 1 : 2; } +uDI __udivdi3 (uDI x, uDI y) { return x / y; } +uDI __udivmoddi4 (uDI x, uDI y, uDI *r) { *r = x % y; return x / y; } +uDI __umoddi3 (uDI x, uDI y) { return x % y; } + +#endif /* __ppc64__ || __x86_64__ */ diff --git a/contrib/gcc/config/darwin-c.c b/contrib/gcc/config/darwin-c.c index fb51455ae62..88ce9ef54d5 100644 --- a/contrib/gcc/config/darwin-c.c +++ b/contrib/gcc/config/darwin-c.c @@ -1,5 +1,5 @@ /* Darwin support needed only by C/C++ frontends. - Copyright (C) 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -27,18 +27,30 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "c-pragma.h" #include "c-tree.h" +#include "c-incpath.h" +#include "c-common.h" #include "toplev.h" +#include "flags.h" #include "tm_p.h" +#include "cppdefault.h" +#include "prefix.h" /* Pragmas. */ -#define BAD(msgid) do { warning (msgid); return; } while (0) +#define BAD(gmsgid) do { warning (OPT_Wpragmas, gmsgid); return; } while (0) +#define BAD2(msgid, arg) do { warning (OPT_Wpragmas, msgid, arg); return; } while (0) + +static bool using_frameworks = false; /* Maintain a small stack of alignments. This is similar to pragma pack's stack, but simpler. */ static void push_field_alignment (int); static void pop_field_alignment (void); +static const char *find_subframework_file (const char *, const char *); +static void add_system_framework_path (char *); +static const char *find_subframework_header (cpp_reader *pfile, const char *header, + cpp_dir **dirp); typedef struct align_stack { @@ -51,7 +63,7 @@ static struct align_stack * field_align_stack = NULL; static void push_field_alignment (int bit_alignment) { - align_stack *entry = (align_stack *) xmalloc (sizeof (align_stack)); + align_stack *entry = XNEW (align_stack); entry->alignment = maximum_field_alignment; entry->prev = field_align_stack; @@ -91,18 +103,18 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED) const char *arg; tree t, x; - if (c_lex (&t) != CPP_NAME) + if (pragma_lex (&t) != CPP_NAME) BAD ("malformed '#pragma options', ignoring"); arg = IDENTIFIER_POINTER (t); if (strcmp (arg, "align")) BAD ("malformed '#pragma options', ignoring"); - if (c_lex (&t) != CPP_EQ) + if (pragma_lex (&t) != CPP_EQ) BAD ("malformed '#pragma options', ignoring"); - if (c_lex (&t) != CPP_NAME) + if (pragma_lex (&t) != CPP_NAME) BAD ("malformed '#pragma options', ignoring"); - if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma options'"); + if (pragma_lex (&x) != CPP_EOF) + warning (OPT_Wpragmas, "junk at end of '#pragma options'"); arg = IDENTIFIER_POINTER (t); if (!strcmp (arg, "mac68k")) @@ -112,7 +124,7 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED) else if (!strcmp (arg, "reset")) pop_field_alignment (); else - warning ("malformed '#pragma options align={mac68k|power|reset}', ignoring"); + BAD ("malformed '#pragma options align={mac68k|power|reset}', ignoring"); } /* #pragma unused ([var {, var}*]) */ @@ -123,19 +135,19 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) tree decl, x; int tok; - if (c_lex (&x) != CPP_OPEN_PAREN) + if (pragma_lex (&x) != CPP_OPEN_PAREN) BAD ("missing '(' after '#pragma unused', ignoring"); while (1) { - tok = c_lex (&decl); + tok = pragma_lex (&decl); if (tok == CPP_NAME && decl) { tree local = lookup_name (decl); if (local && (TREE_CODE (local) == PARM_DECL || TREE_CODE (local) == VAR_DECL)) TREE_USED (local) = 1; - tok = c_lex (&x); + tok = pragma_lex (&x); if (tok != CPP_COMMA) break; } @@ -144,6 +156,467 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) if (tok != CPP_CLOSE_PAREN) BAD ("missing ')' after '#pragma unused', ignoring"); - if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma unused'"); + if (pragma_lex (&x) != CPP_EOF) + BAD ("junk at end of '#pragma unused'"); +} + +/* Parse the ms_struct pragma. */ +void +darwin_pragma_ms_struct (cpp_reader *pfile ATTRIBUTE_UNUSED) +{ + const char *arg; + tree t; + + if (pragma_lex (&t) != CPP_NAME) + BAD ("malformed '#pragma ms_struct', ignoring"); + arg = IDENTIFIER_POINTER (t); + + if (!strcmp (arg, "on")) + darwin_ms_struct = true; + else if (!strcmp (arg, "off") || !strcmp (arg, "reset")) + darwin_ms_struct = false; + else + BAD ("malformed '#pragma ms_struct {on|off|reset}', ignoring"); + + if (pragma_lex (&t) != CPP_EOF) + BAD ("junk at end of '#pragma ms_struct'"); +} + +static struct { + size_t len; + const char *name; + cpp_dir* dir; +} *frameworks_in_use; +static int num_frameworks = 0; +static int max_frameworks = 0; + + +/* Remember which frameworks have been seen, so that we can ensure + that all uses of that framework come from the same framework. DIR + is the place where the named framework NAME, which is of length + LEN, was found. We copy the directory name from NAME, as it will be + freed by others. */ + +static void +add_framework (const char *name, size_t len, cpp_dir *dir) +{ + char *dir_name; + int i; + for (i = 0; i < num_frameworks; ++i) + { + if (len == frameworks_in_use[i].len + && strncmp (name, frameworks_in_use[i].name, len) == 0) + { + return; + } + } + if (i >= max_frameworks) + { + max_frameworks = i*2; + max_frameworks += i == 0; + frameworks_in_use = xrealloc (frameworks_in_use, + max_frameworks*sizeof(*frameworks_in_use)); + } + dir_name = XNEWVEC (char, len + 1); + memcpy (dir_name, name, len); + dir_name[len] = '\0'; + frameworks_in_use[num_frameworks].name = dir_name; + frameworks_in_use[num_frameworks].len = len; + frameworks_in_use[num_frameworks].dir = dir; + ++num_frameworks; +} + +/* Recall if we have seen the named framework NAME, before, and where + we saw it. NAME is LEN bytes long. The return value is the place + where it was seen before. */ + +static struct cpp_dir* +find_framework (const char *name, size_t len) +{ + int i; + for (i = 0; i < num_frameworks; ++i) + { + if (len == frameworks_in_use[i].len + && strncmp (name, frameworks_in_use[i].name, len) == 0) + { + return frameworks_in_use[i].dir; + } + } + return 0; +} + +/* There are two directories in a framework that contain header files, + Headers and PrivateHeaders. We search Headers first as it is more + common to upgrade a header from PrivateHeaders to Headers and when + that is done, the old one might hang around and be out of data, + causing grief. */ + +struct framework_header {const char * dirName; int dirNameLen; }; +static struct framework_header framework_header_dirs[] = { + { "Headers", 7 }, + { "PrivateHeaders", 14 }, + { NULL, 0 } +}; + +/* Returns a pointer to a malloced string that contains the real pathname + to the file, given the base name and the name. */ + +static char * +framework_construct_pathname (const char *fname, cpp_dir *dir) +{ + char *buf; + size_t fname_len, frname_len; + cpp_dir *fast_dir; + char *frname; + struct stat st; + int i; + + /* Framework names must have a / in them. */ + buf = strchr (fname, '/'); + if (buf) + fname_len = buf - fname; + else + return 0; + + fast_dir = find_framework (fname, fname_len); + + /* Framework includes must all come from one framework. */ + if (fast_dir && dir != fast_dir) + return 0; + + frname = XNEWVEC (char, strlen (fname) + dir->len + 2 + + strlen(".framework/") + strlen("PrivateHeaders")); + strncpy (&frname[0], dir->name, dir->len); + frname_len = dir->len; + if (frname_len && frname[frname_len-1] != '/') + frname[frname_len++] = '/'; + strncpy (&frname[frname_len], fname, fname_len); + frname_len += fname_len; + strncpy (&frname[frname_len], ".framework/", strlen (".framework/")); + frname_len += strlen (".framework/"); + + if (fast_dir == 0) + { + frname[frname_len-1] = 0; + if (stat (frname, &st) == 0) + { + /* As soon as we find the first instance of the framework, + we stop and never use any later instance of that + framework. */ + add_framework (fname, fname_len, dir); + } + else + { + /* If we can't find the parent directory, no point looking + further. */ + free (frname); + return 0; + } + frname[frname_len-1] = '/'; + } + + /* Append framework_header_dirs and header file name */ + for (i = 0; framework_header_dirs[i].dirName; i++) + { + strncpy (&frname[frname_len], + framework_header_dirs[i].dirName, + framework_header_dirs[i].dirNameLen); + strcpy (&frname[frname_len + framework_header_dirs[i].dirNameLen], + &fname[fname_len]); + + if (stat (frname, &st) == 0) + return frname; + } + + free (frname); + return 0; +} + +/* Search for FNAME in sub-frameworks. pname is the context that we + wish to search in. Return the path the file was found at, + otherwise return 0. */ + +static const char* +find_subframework_file (const char *fname, const char *pname) +{ + char *sfrname; + const char *dot_framework = ".framework/"; + char *bufptr; + int sfrname_len, i, fname_len; + struct cpp_dir *fast_dir; + static struct cpp_dir subframe_dir; + struct stat st; + + bufptr = strchr (fname, '/'); + + /* Subframework files must have / in the name. */ + if (bufptr == 0) + return 0; + + fname_len = bufptr - fname; + fast_dir = find_framework (fname, fname_len); + + /* Sub framework header filename includes parent framework name and + header name in the "CarbonCore/OSUtils.h" form. If it does not + include slash it is not a sub framework include. */ + bufptr = strstr (pname, dot_framework); + + /* If the parent header is not of any framework, then this header + cannot be part of any subframework. */ + if (!bufptr) + return 0; + + /* Now translate. For example, +- bufptr + fname = CarbonCore/OSUtils.h | + pname = /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h + into + sfrname = /System/Library/Frameworks/Foundation.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h */ + + sfrname = XNEWVEC (char, strlen (pname) + strlen (fname) + 2 + + strlen ("Frameworks/") + strlen (".framework/") + + strlen ("PrivateHeaders")); + + bufptr += strlen (dot_framework); + + sfrname_len = bufptr - pname; + + strncpy (&sfrname[0], pname, sfrname_len); + + strncpy (&sfrname[sfrname_len], "Frameworks/", strlen ("Frameworks/")); + sfrname_len += strlen("Frameworks/"); + + strncpy (&sfrname[sfrname_len], fname, fname_len); + sfrname_len += fname_len; + + strncpy (&sfrname[sfrname_len], ".framework/", strlen (".framework/")); + sfrname_len += strlen (".framework/"); + + /* Append framework_header_dirs and header file name */ + for (i = 0; framework_header_dirs[i].dirName; i++) + { + strncpy (&sfrname[sfrname_len], + framework_header_dirs[i].dirName, + framework_header_dirs[i].dirNameLen); + strcpy (&sfrname[sfrname_len + framework_header_dirs[i].dirNameLen], + &fname[fname_len]); + + if (stat (sfrname, &st) == 0) + { + if (fast_dir != &subframe_dir) + { + if (fast_dir) + warning (0, "subframework include %s conflicts with framework include", + fname); + else + add_framework (fname, fname_len, &subframe_dir); + } + + return sfrname; + } + } + free (sfrname); + + return 0; +} + +/* Add PATH to the system includes. PATH must be malloc-ed and + NUL-terminated. System framework paths are C++ aware. */ + +static void +add_system_framework_path (char *path) +{ + int cxx_aware = 1; + cpp_dir *p; + + p = XNEW (cpp_dir); + p->next = NULL; + p->name = path; + p->sysp = 1 + !cxx_aware; + p->construct = framework_construct_pathname; + using_frameworks = 1; + + add_cpp_dir_path (p, SYSTEM); +} + +/* Add PATH to the bracket includes. PATH must be malloc-ed and + NUL-terminated. */ + +void +add_framework_path (char *path) +{ + cpp_dir *p; + + p = XNEW (cpp_dir); + p->next = NULL; + p->name = path; + p->sysp = 0; + p->construct = framework_construct_pathname; + using_frameworks = 1; + + add_cpp_dir_path (p, BRACKET); +} + +static const char *framework_defaults [] = + { + "/System/Library/Frameworks", + "/Library/Frameworks", + }; + +/* Register the GNU objective-C runtime include path if STDINC. */ + +void +darwin_register_objc_includes (const char *sysroot, const char *iprefix, + int stdinc) +{ + const char *fname; + size_t len; + /* We do not do anything if we do not want the standard includes. */ + if (!stdinc) + return; + + fname = GCC_INCLUDE_DIR "-gnu-runtime"; + + /* Register the GNU OBJC runtime include path if we are compiling OBJC + with GNU-runtime. */ + + if (c_dialect_objc () && !flag_next_runtime) + { + char *str; + /* See if our directory starts with the standard prefix. + "Translate" them, i.e. replace /usr/local/lib/gcc... with + IPREFIX and search them first. */ + if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot + && !strncmp (fname, cpp_GCC_INCLUDE_DIR, len)) + { + str = concat (iprefix, fname + len, NULL); + /* FIXME: wrap the headers for C++awareness. */ + add_path (str, SYSTEM, /*c++aware=*/false, false); + } + + /* Should this directory start with the sysroot? */ + if (sysroot) + str = concat (sysroot, fname, NULL); + else + str = update_path (fname, ""); + + add_path (str, SYSTEM, /*c++aware=*/false, false); + } +} + + +/* Register all the system framework paths if STDINC is true and setup + the missing_header callback for subframework searching if any + frameworks had been registered. */ + +void +darwin_register_frameworks (const char *sysroot, + const char *iprefix ATTRIBUTE_UNUSED, int stdinc) +{ + if (stdinc) + { + size_t i; + + /* Setup default search path for frameworks. */ + for (i=0; imissing_header = find_subframework_header; +} + +/* Search for HEADER in context dependent way. The return value is + the malloced name of a header to try and open, if any, or NULL + otherwise. This is called after normal header lookup processing + fails to find a header. We search each file in the include stack, + using FUNC, starting from the most deeply nested include and + finishing with the main input file. We stop searching when FUNC + returns nonzero. */ + +static const char* +find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp) +{ + const char *fname = header; + struct cpp_buffer *b; + const char *n; + + for (b = cpp_get_buffer (pfile); + b && cpp_get_file (b) && cpp_get_path (cpp_get_file (b)); + b = cpp_get_prev (b)) + { + n = find_subframework_file (fname, cpp_get_path (cpp_get_file (b))); + if (n) + { + /* Logically, the place where we found the subframework is + the place where we found the Framework that contains the + subframework. This is useful for tracking wether or not + we are in a system header. */ + *dirp = cpp_get_dir (cpp_get_file (b)); + return n; + } + } + + return 0; +} + +/* Return the value of darwin_macosx_version_min suitable for the + __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, + so '10.4.2' becomes 1042. + Print a warning if the version number is not known. */ +static const char * +version_as_macro (void) +{ + static char result[] = "1000"; + + if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) + goto fail; + if (! ISDIGIT (darwin_macosx_version_min[3])) + goto fail; + result[2] = darwin_macosx_version_min[3]; + if (darwin_macosx_version_min[4] != '\0') + { + if (darwin_macosx_version_min[4] != '.') + goto fail; + if (! ISDIGIT (darwin_macosx_version_min[5])) + goto fail; + if (darwin_macosx_version_min[6] != '\0') + goto fail; + result[3] = darwin_macosx_version_min[5]; + } + else + result[3] = '0'; + + return result; + + fail: + error ("Unknown value %qs of -mmacosx-version-min", + darwin_macosx_version_min); + return "1000"; +} + +/* Define additional CPP flags for Darwin. */ + +#define builtin_define(TXT) cpp_define (pfile, TXT) + +void +darwin_cpp_builtins (cpp_reader *pfile) +{ + builtin_define ("__MACH__"); + builtin_define ("__APPLE__"); + + /* __APPLE_CC__ is defined as some old Apple include files expect it + to be defined and won't work if it isn't. */ + builtin_define_with_value ("__APPLE_CC__", "1", false); + + if (darwin_macosx_version_min) + builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", + version_as_macro(), false); } diff --git a/contrib/gcc/config/darwin-crt2.c b/contrib/gcc/config/darwin-crt2.c index 1ea2413c809..69408d38969 100644 --- a/contrib/gcc/config/darwin-crt2.c +++ b/contrib/gcc/config/darwin-crt2.c @@ -1,5 +1,5 @@ /* KeyMgr backwards-compatibility support for Darwin. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -24,8 +24,8 @@ for more details. 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. */ /* It is incorrect to include config.h here, because this file is being compiled for the target, and hence definitions concerning only the host @@ -34,6 +34,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tconfig.h" #include "tsystem.h" +/* This file doesn't do anything useful on non-powerpc targets, since they + don't have backwards compatibility anyway. */ + +#ifdef __ppc__ + /* Homemade decls substituting for getsect.h and dyld.h, so cross compilation works. */ struct mach_header; @@ -149,3 +154,5 @@ __darwin_gcc3_preregister_frame_info (void) _dyld_register_func_for_add_image (darwin_unwind_dyld_add_image_hook); _dyld_register_func_for_remove_image (darwin_unwind_dyld_remove_image_hook); } + +#endif /* __ppc__ */ diff --git a/contrib/gcc/config/darwin-crt3.c b/contrib/gcc/config/darwin-crt3.c new file mode 100644 index 00000000000..ac5e0398f58 --- /dev/null +++ b/contrib/gcc/config/darwin-crt3.c @@ -0,0 +1,537 @@ +/* __cxa_atexit backwards-compatibility support for Darwin. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* Don't do anything if we are compiling for a kext multilib. */ +#ifdef __PIC__ + +/* It is incorrect to include config.h here, because this file is being + compiled for the target, and hence definitions concerning only the host + do not apply. */ + +#include "tconfig.h" +#include "tsystem.h" + +#include +#include +#include +#include + +/* This file works around two different problems. + + The first problem is that there is no __cxa_atexit on Mac OS versions + before 10.4. It fixes this by providing a complete atexit and + __cxa_atexit emulation called from the regular atexit. + + The second problem is that on all shipping versions of Mac OS, + __cxa_finalize and exit() don't work right: they don't run routines + that were registered while other atexit routines are running. This + is worked around by wrapping each atexit/__cxa_atexit routine with + our own routine which ensures that any __cxa_atexit calls while it + is running are honoured. + + There are still problems which this does not solve. Before 10.4, + shared objects linked with previous compilers won't have their + atexit calls properly interleaved with code compiled with newer + compilers. Also, atexit routines registered from shared objects + linked with previous compilers won't get the bug fix. */ + +typedef int (*cxa_atexit_p)(void (*func) (void*), void* arg, const void* dso); +typedef void (*cxa_finalize_p)(const void *dso); +typedef int (*atexit_p)(void (*func)(void)); + +/* These are from "keymgr.h". */ +extern void *_keymgr_get_and_lock_processwide_ptr (unsigned key); +extern int _keymgr_get_and_lock_processwide_ptr_2 (unsigned, void **); +extern int _keymgr_set_and_unlock_processwide_ptr (unsigned key, void *ptr); + +extern void *__keymgr_global[]; +typedef struct _Sinfo_Node { + unsigned int size ; /*size of this node*/ + unsigned short major_version ; /*API major version.*/ + unsigned short minor_version ; /*API minor version.*/ + } _Tinfo_Node ; + +#ifdef __ppc__ +#define CHECK_KEYMGR_ERROR(e) \ + (((_Tinfo_Node *)__keymgr_global[2])->major_version >= 4 ? (e) : 0) +#else +#define CHECK_KEYMGR_ERROR(e) (e) +#endif + +/* Our globals are stored under this keymgr index. */ +#define KEYMGR_ATEXIT_LIST 14 + +/* The different kinds of callback routines. */ +typedef void (*atexit_callback)(void); +typedef void (*cxa_atexit_callback)(void *); + +/* This structure holds a routine to call. There may be extra fields + at the end of the structure that this code doesn't know about. */ +struct one_atexit_routine +{ + union { + atexit_callback ac; + cxa_atexit_callback cac; + } callback; + /* has_arg is 0/2/4 if 'ac' is live, 1/3/5 if 'cac' is live. + Higher numbers indicate a later version of the structure that this + code doesn't understand and will ignore. */ + int has_arg; + void * arg; +}; + +struct atexit_routine_list +{ + struct atexit_routine_list * next; + struct one_atexit_routine r; +}; + +/* The various possibilities for status of atexit(). */ +enum atexit_status { + atexit_status_unknown = 0, + atexit_status_missing = 1, + atexit_status_broken = 2, + atexit_status_working = 16 +}; + +struct keymgr_atexit_list +{ + /* Version of this list. This code knows only about version 0. + If the version is higher than 0, this code may add new atexit routines + but should not attempt to run the list. */ + short version; + /* 1 if an atexit routine is currently being run by this code, 0 + otherwise. */ + char running_routines; + /* Holds a value from 'enum atexit_status'. */ + unsigned char atexit_status; + /* The list of atexit and cxa_atexit routines registered. If + atexit_status_missing it contains all routines registered while + linked with this code. If atexit_status_broken it contains all + routines registered during cxa_finalize while linked with this + code. */ + struct atexit_routine_list *l; + /* &__cxa_atexit; set if atexit_status >= atexit_status_broken. */ + cxa_atexit_p cxa_atexit_f; + /* &__cxa_finalize; set if atexit_status >= atexit_status_broken. */ + cxa_finalize_p cxa_finalize_f; + /* &atexit; set if atexit_status >= atexit_status_working + or atexit_status == atexit_status_missing. */ + atexit_p atexit_f; +}; + +/* Return 0 if __cxa_atexit has the bug it has in Mac OS 10.4: it + fails to call routines registered while an atexit routine is + running. Return 1 if it works properly, and -1 if an error occurred. */ + +struct atexit_data +{ + int result; + cxa_atexit_p cxa_atexit; +}; + +static void cxa_atexit_check_2 (void *arg) +{ + ((struct atexit_data *)arg)->result = 1; +} + +static void cxa_atexit_check_1 (void *arg) +{ + struct atexit_data * aed = arg; + if (aed->cxa_atexit (cxa_atexit_check_2, arg, arg) != 0) + aed->result = -1; +} + +static int +check_cxa_atexit (cxa_atexit_p cxa_atexit, cxa_finalize_p cxa_finalize) +{ + struct atexit_data aed = { 0, cxa_atexit }; + + /* We re-use &aed as the 'dso' parameter, since it's a unique address. */ + if (cxa_atexit (cxa_atexit_check_1, &aed, &aed) != 0) + return -1; + cxa_finalize (&aed); + if (aed.result == 0) + { + /* Call __cxa_finalize again to make sure that cxa_atexit_check_2 + is removed from the list before AED goes out of scope. */ + cxa_finalize (&aed); + aed.result = 0; + } + return aed.result; +} + +#ifdef __ppc__ +/* This comes from Csu. It works only before 10.4. The prototype has + been altered a bit to avoid casting. */ +extern int _dyld_func_lookup(const char *dyld_func_name, + void *address) __attribute__((visibility("hidden"))); + +static void our_atexit (void); + +/* We're running on 10.3.9. Find the address of the system atexit() + function. So easy to say, so hard to do. */ +static atexit_p +find_atexit_10_3 (void) +{ + unsigned int (*dyld_image_count_fn)(void); + const char *(*dyld_get_image_name_fn)(unsigned int image_index); + const void *(*dyld_get_image_header_fn)(unsigned int image_index); + const void *(*NSLookupSymbolInImage_fn)(const void *image, + const char *symbolName, + unsigned int options); + void *(*NSAddressOfSymbol_fn)(const void *symbol); + unsigned i, count; + + /* Find some dyld functions. */ + _dyld_func_lookup("__dyld_image_count", &dyld_image_count_fn); + _dyld_func_lookup("__dyld_get_image_name", &dyld_get_image_name_fn); + _dyld_func_lookup("__dyld_get_image_header", &dyld_get_image_header_fn); + _dyld_func_lookup("__dyld_NSLookupSymbolInImage", &NSLookupSymbolInImage_fn); + _dyld_func_lookup("__dyld_NSAddressOfSymbol", &NSAddressOfSymbol_fn); + + /* If any of these don't exist, that's an error. */ + if (! dyld_image_count_fn || ! dyld_get_image_name_fn + || ! dyld_get_image_header_fn || ! NSLookupSymbolInImage_fn + || ! NSAddressOfSymbol_fn) + return NULL; + + count = dyld_image_count_fn (); + for (i = 0; i < count; i++) + { + const char * path = dyld_get_image_name_fn (i); + const void * image; + const void * symbol; + + if (strcmp (path, "/usr/lib/libSystem.B.dylib") != 0) + continue; + image = dyld_get_image_header_fn (i); + if (! image) + return NULL; + /* '4' is NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR. */ + symbol = NSLookupSymbolInImage_fn (image, "_atexit", 4); + if (! symbol) + return NULL; + return NSAddressOfSymbol_fn (symbol); + } + return NULL; +} +#endif + +/* Create (if necessary), find, lock, fill in, and return our globals. + Return NULL on error, in which case the globals will not be locked. + The caller should call keymgr_set_and_unlock. */ +static struct keymgr_atexit_list * +get_globals (void) +{ + struct keymgr_atexit_list * r; + +#ifdef __ppc__ + /* 10.3.9 doesn't have _keymgr_get_and_lock_processwide_ptr_2 so the + PPC side can't use it. On 10.4 this just means the error gets + reported a little later when + _keymgr_set_and_unlock_processwide_ptr finds that the key was + never locked. */ + r = _keymgr_get_and_lock_processwide_ptr (KEYMGR_ATEXIT_LIST); +#else + void * rr; + if (_keymgr_get_and_lock_processwide_ptr_2 (KEYMGR_ATEXIT_LIST, &rr)) + return NULL; + r = rr; +#endif + + if (r == NULL) + { + r = calloc (sizeof (struct keymgr_atexit_list), 1); + if (! r) + return NULL; + } + + if (r->atexit_status == atexit_status_unknown) + { + void *handle; + + handle = dlopen ("/usr/lib/libSystem.B.dylib", RTLD_NOLOAD); + if (!handle) + { +#ifdef __ppc__ + r->atexit_status = atexit_status_missing; + r->atexit_f = find_atexit_10_3 (); + if (! r->atexit_f) + goto error; + if (r->atexit_f (our_atexit)) + goto error; +#else + goto error; +#endif + } + else + { + int chk_result; + + r->cxa_atexit_f = (cxa_atexit_p)dlsym (handle, "__cxa_atexit"); + r->cxa_finalize_f = (cxa_finalize_p)dlsym (handle, "__cxa_finalize"); + if (! r->cxa_atexit_f || ! r->cxa_finalize_f) + goto error; + + chk_result = check_cxa_atexit (r->cxa_atexit_f, r->cxa_finalize_f); + if (chk_result == -1) + goto error; + else if (chk_result == 0) + r->atexit_status = atexit_status_broken; + else + { + r->atexit_f = (atexit_p)dlsym (handle, "atexit"); + if (! r->atexit_f) + goto error; + r->atexit_status = atexit_status_working; + } + } + } + + return r; + + error: + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, r); + return NULL; +} + +/* Add TO_ADD to ATEXIT_LIST. ATEXIT_LIST may be NULL but is + always the result of calling _keymgr_get_and_lock_processwide_ptr and + so KEYMGR_ATEXIT_LIST is known to be locked; this routine is responsible + for unlocking it. */ + +static int +add_routine (struct keymgr_atexit_list * g, + const struct one_atexit_routine * to_add) +{ + struct atexit_routine_list * s + = malloc (sizeof (struct atexit_routine_list)); + int result; + + if (!s) + { + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + return -1; + } + s->r = *to_add; + s->next = g->l; + g->l = s; + result = _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + return CHECK_KEYMGR_ERROR (result) == 0 ? 0 : -1; +} + +/* This runs the routines in G->L up to STOP. */ +static struct keymgr_atexit_list * +run_routines (struct keymgr_atexit_list *g, + struct atexit_routine_list *stop) +{ + for (;;) + { + struct atexit_routine_list * cur = g->l; + if (! cur || cur == stop) + break; + g->l = cur->next; + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + + switch (cur->r.has_arg) { + case 0: case 2: case 4: + cur->r.callback.ac (); + break; + case 1: case 3: case 5: + cur->r.callback.cac (cur->r.arg); + break; + default: + /* Don't understand, so don't call it. */ + break; + } + free (cur); + + g = _keymgr_get_and_lock_processwide_ptr (KEYMGR_ATEXIT_LIST); + if (! g) + break; + } + return g; +} + +/* Call the routine described by ROUTINE_PARAM and then call any + routines added to KEYMGR_ATEXIT_LIST while that routine was + running, all with in_cxa_finalize set. */ + +static void +cxa_atexit_wrapper (void* routine_param) +{ + struct one_atexit_routine * routine = routine_param; + struct keymgr_atexit_list *g; + struct atexit_routine_list * base = NULL; + char prev_running = 0; + + g = _keymgr_get_and_lock_processwide_ptr (KEYMGR_ATEXIT_LIST); + if (g) + { + prev_running = g->running_routines; + g->running_routines = 1; + base = g->l; + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + } + + if (routine->has_arg) + routine->callback.cac (routine->arg); + else + routine->callback.ac (); + + if (g) + g = _keymgr_get_and_lock_processwide_ptr (KEYMGR_ATEXIT_LIST); + if (g) + g = run_routines (g, base); + if (g) + { + g->running_routines = prev_running; + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + } +} + +#ifdef __ppc__ +/* This code is used while running on 10.3.9, when __cxa_atexit doesn't + exist in the system library. 10.3.9 only supported regular PowerPC, + so this code isn't necessary on x86 or ppc64. */ + +/* This routine is called from the system atexit(); it runs everything + registered on the KEYMGR_ATEXIT_LIST. */ + +static void +our_atexit (void) +{ + struct keymgr_atexit_list *g; + char prev_running; + + g = _keymgr_get_and_lock_processwide_ptr (KEYMGR_ATEXIT_LIST); + if (! g || g->version != 0 || g->atexit_status != atexit_status_missing) + return; + + prev_running = g->running_routines; + g->running_routines = 1; + g = run_routines (g, NULL); + if (! g) + return; + g->running_routines = prev_running; + _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); +} +#endif + +/* This is our wrapper around atexit and __cxa_atexit. It will return + nonzero if an error occurs, and otherwise: + - if in_cxa_finalize is set, or running on 10.3.9, add R to + KEYMGR_ATEXIT_LIST; or + - call the system __cxa_atexit to add cxa_atexit_wrapper with an argument + that indicates how cxa_atexit_wrapper should call R. */ + +static int +atexit_common (const struct one_atexit_routine *r, const void *dso) +{ + struct keymgr_atexit_list *g = get_globals (); + + if (! g) + return -1; + + if (g->running_routines || g->atexit_status == atexit_status_missing) + return add_routine (g, r); + + if (g->atexit_status >= atexit_status_working) + { + int result; + if (r->has_arg) + { + cxa_atexit_p cxa_atexit = g->cxa_atexit_f; + result = _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, + g); + if (CHECK_KEYMGR_ERROR (result)) + return -1; + return cxa_atexit (r->callback.cac, r->arg, dso); + } + else + { + atexit_p atexit_f = g->atexit_f; + result = _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, + g); + if (CHECK_KEYMGR_ERROR (result)) + return -1; + return atexit_f (r->callback.ac); + } + } + else + { + cxa_atexit_p cxa_atexit = g->cxa_atexit_f; + struct one_atexit_routine *alloced; + int result; + + result = _keymgr_set_and_unlock_processwide_ptr (KEYMGR_ATEXIT_LIST, g); + if (CHECK_KEYMGR_ERROR (result)) + return -1; + + alloced = malloc (sizeof (struct one_atexit_routine)); + if (! alloced) + return -1; + *alloced = *r; + return cxa_atexit (cxa_atexit_wrapper, alloced, dso); + } +} + +/* These are the actual replacement routines; they just funnel into + atexit_common. */ + +int __cxa_atexit (cxa_atexit_callback func, void* arg, + const void* dso) __attribute__((visibility("hidden"))); + +int +__cxa_atexit (cxa_atexit_callback func, void* arg, const void* dso) +{ + struct one_atexit_routine r; + r.callback.cac = func; + r.has_arg = 1; + r.arg = arg; + return atexit_common (&r, dso); +} + +int atexit (atexit_callback func) __attribute__((visibility("hidden"))); + +/* Use __dso_handle to allow even bundles that call atexit() to be unloaded + on 10.4. */ +extern void __dso_handle; + +int +atexit (atexit_callback func) +{ + struct one_atexit_routine r; + r.callback.ac = func; + r.has_arg = 0; + return atexit_common (&r, &__dso_handle); +} + +#endif /* __PIC__ */ diff --git a/contrib/gcc/config/darwin-protos.h b/contrib/gcc/config/darwin-protos.h index 3305112065e..8981eded88b 100644 --- a/contrib/gcc/config/darwin-protos.h +++ b/contrib/gcc/config/darwin-protos.h @@ -1,5 +1,5 @@ /* Prototypes. - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,33 +15,24 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ +extern void darwin_init_sections (void); extern int name_needs_quotes (const char *); -extern void machopic_validate_stub_or_non_lazy_ptr (const char *, int); +extern void machopic_validate_stub_or_non_lazy_ptr (const char *); extern const char *machopic_function_base_name (void); extern void machopic_output_function_base_name (FILE *); -extern const char *machopic_stub_name (const char*); - -extern void machopic_picsymbol_stub_section (void); -extern void machopic_picsymbol_stub1_section (void); -extern void machopic_symbol_stub_section (void); -extern void machopic_symbol_stub1_section (void); -extern void machopic_lazy_symbol_ptr_section (void); -extern void machopic_nl_symbol_ptr_section (void); - -extern void constructor_section (void); -extern void destructor_section (void); -extern void mod_init_section (void); -extern void mod_term_section (void); +extern const char *machopic_indirection_name (rtx, bool); +extern const char *machopic_mcount_stub_name (void); #ifdef RTX_CODE +extern rtx machopic_function_base_sym (void); extern int machopic_operand_p (rtx); -extern enum machopic_addr_class machopic_classify_name (const char*); +extern enum machopic_addr_class machopic_classify_symbol (rtx); extern rtx machopic_indirect_data_reference (rtx, rtx); extern rtx machopic_indirect_call_target (rtx); @@ -53,69 +44,49 @@ extern void machopic_asm_out_destructor (rtx, int); #ifdef TREE_CODE -extern enum machopic_addr_class machopic_classify_ident (tree); -extern void machopic_define_ident (tree); -extern void machopic_define_name (const char*); -extern int machopic_name_defined_p (const char*); -extern int machopic_ident_defined_p (tree); +extern void machopic_define_symbol (rtx); extern void darwin_encode_section_info (tree, rtx, int); -extern const char *darwin_strip_name_encoding (const char *); +extern void darwin_set_default_type_attributes (tree); #endif /* TREE_CODE */ extern void machopic_finish (FILE *); -extern void darwin_exception_section (void); -extern void darwin_eh_frame_section (void); -extern void machopic_select_section (tree, int, unsigned HOST_WIDE_INT); -extern void machopic_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT); +extern int machopic_reloc_rw_mask (void); +extern section *machopic_select_section (tree, int, unsigned HOST_WIDE_INT); +extern section *machopic_select_rtx_section (enum machine_mode, rtx, + unsigned HOST_WIDE_INT); + +extern void darwin_unique_section (tree decl, int reloc); +extern void darwin_asm_named_section (const char *, unsigned int, tree); +extern void darwin_non_lazy_pcrel (FILE *, rtx); + +extern void darwin_emit_unwind_label (FILE *, tree, int, int); +extern void darwin_emit_except_table_label (FILE *); extern void darwin_pragma_ignore (struct cpp_reader *); extern void darwin_pragma_options (struct cpp_reader *); extern void darwin_pragma_unused (struct cpp_reader *); +extern void darwin_pragma_ms_struct (struct cpp_reader *); +extern void darwin_file_start (void); extern void darwin_file_end (void); -/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */ -extern void const_section (void); -extern void const_data_section (void); -extern void cstring_section (void); -extern void literal4_section (void); -extern void literal8_section (void); -extern void constructor_section (void); -extern void mod_init_section (void); -extern void mod_term_section (void); -extern void destructor_section (void); -extern void objc_class_section (void); -extern void objc_meta_class_section (void); -extern void objc_category_section (void); -extern void objc_class_vars_section (void); -extern void objc_instance_vars_section (void); -extern void objc_cls_meth_section (void); -extern void objc_inst_meth_section (void); -extern void objc_cat_cls_meth_section (void); -extern void objc_cat_inst_meth_section (void); -extern void objc_selector_refs_section (void); -extern void objc_selector_fixup_section (void); -extern void objc_symbols_section (void); -extern void objc_module_info_section (void); -extern void objc_image_info_section (void); -extern void objc_protocol_section (void); -extern void objc_string_object_section (void); -extern void objc_constant_string_object_section (void); -extern void objc_class_names_section (void); -extern void objc_meth_var_names_section (void); -extern void objc_meth_var_types_section (void); -extern void objc_cls_refs_section (void); -extern void machopic_lazy_symbol_ptr_section (void); -extern void machopic_nl_symbol_ptr_section (void); -extern void machopic_symbol_stub_section (void); -extern void machopic_picsymbol_stub_section (void); +extern void darwin_mark_decl_preserved (const char *); + +extern tree darwin_handle_kext_attribute (tree *, tree, tree, int, bool *); +extern tree darwin_handle_weak_import_attribute (tree *node, tree name, + tree args, int flags, + bool * no_add_attrs); extern void machopic_output_stub (FILE *, const char *, const char *); -extern void darwin_exception_section (void); -extern void darwin_eh_frame_section (void); extern void darwin_globalize_label (FILE *, const char *); extern void darwin_assemble_visibility (tree, int); extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *, const char *); +extern void darwin_asm_output_dwarf_offset (FILE *, int, const char *, + section *); +extern bool darwin_binds_local_p (tree); +extern void darwin_cpp_builtins (struct cpp_reader *); +extern void darwin_asm_output_anchor (rtx symbol); +extern bool darwin_kextabi_p (void); +extern void darwin_override_options (void); diff --git a/contrib/gcc/config/darwin-sections.def b/contrib/gcc/config/darwin-sections.def new file mode 100644 index 00000000000..148b77511ea --- /dev/null +++ b/contrib/gcc/config/darwin-sections.def @@ -0,0 +1,63 @@ +DEF_SECTION (text_coal_section, SECTION_CODE, + ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", 0) +DEF_SECTION (text_unlikely_coal_section, SECTION_CODE, + ".section __TEXT,__text_unlikely_coal," + "coalesced,pure_instructions", 0) +DEF_SECTION (const_section, 0, ".const", 0) +DEF_SECTION (const_coal_section, 0, + ".section __TEXT,__const_coal,coalesced", 0) +DEF_SECTION (const_data_section, 0, ".const_data", 0) +DEF_SECTION (const_data_coal_section, 0, + ".section __DATA,__const_coal,coalesced", 0) +DEF_SECTION (data_coal_section, SECTION_WRITE, + ".section __DATA,__datacoal_nt,coalesced", 0) +DEF_SECTION (cstring_section, SECTION_MERGE, ".cstring", 0) +DEF_SECTION (literal4_section, SECTION_MERGE, ".literal4", 0) +DEF_SECTION (literal8_section, SECTION_MERGE, ".literal8", 0) +DEF_SECTION (literal16_section, SECTION_MERGE, ".literal16", 0) +DEF_SECTION (constructor_section, 0, ".constructor", 0) +DEF_SECTION (mod_init_section, 0, ".mod_init_func", 0) +DEF_SECTION (mod_term_section, 0, ".mod_term_func", 0) +DEF_SECTION (destructor_section, 0, ".destructor", 0) +DEF_SECTION (objc_class_section, 0, ".objc_class", 1) +DEF_SECTION (objc_meta_class_section, 0, ".objc_meta_class", 1) +DEF_SECTION (objc_category_section, 0, ".objc_category", 1) +DEF_SECTION (objc_class_vars_section, 0, ".objc_class_vars", 1) +DEF_SECTION (objc_instance_vars_section, 0, ".objc_instance_vars", 1) +DEF_SECTION (objc_cls_meth_section, 0, ".objc_cls_meth", 1) +DEF_SECTION (objc_inst_meth_section, 0, ".objc_inst_meth", 1) +DEF_SECTION (objc_cat_cls_meth_section, 0, ".objc_cat_cls_meth", 1) +DEF_SECTION (objc_cat_inst_meth_section, 0, ".objc_cat_inst_meth", 1) +DEF_SECTION (objc_selector_refs_section, SECTION_MERGE, ".objc_message_refs", 1) +DEF_SECTION (objc_selector_fixup_section, 0, + ".section __OBJC, __sel_fixup, regular, no_dead_strip", 1) +DEF_SECTION (objc_symbols_section, 0, ".objc_symbols", 1) +DEF_SECTION (objc_module_info_section, 0, ".objc_module_info", 1) +DEF_SECTION (objc_protocol_section, 0, ".objc_protocol", 1) +DEF_SECTION (objc_string_object_section, 0, ".objc_string_object", 1) +DEF_SECTION (objc_constant_string_object_section, 0, + ".section __OBJC, __cstring_object, regular, no_dead_strip", 1) + +/* Fix-and-Continue image marker. */ +DEF_SECTION (objc_image_info_section, 0, + ".section __OBJC, __image_info, regular, no_dead_strip", 1) +DEF_SECTION (objc_class_names_section, 0, ".objc_class_names", 1) +DEF_SECTION (objc_meth_var_names_section, 0, ".objc_meth_var_names", 1) +DEF_SECTION (objc_meth_var_types_section, 0, ".objc_meth_var_types", 1) +DEF_SECTION (objc_cls_refs_section, SECTION_MERGE, ".objc_cls_refs", 1) + +DEF_SECTION (machopic_lazy_symbol_ptr_section, 0, ".lazy_symbol_pointer", 0) +DEF_SECTION (machopic_nl_symbol_ptr_section, 0, ".non_lazy_symbol_pointer", 0) +DEF_SECTION (machopic_symbol_stub_section, 0, ".symbol_stub", 0) +DEF_SECTION (machopic_symbol_stub1_section, 0, + ".section __TEXT,__symbol_stub1,symbol_stubs," + "pure_instructions,16", 0) +DEF_SECTION (machopic_picsymbol_stub_section, 0, ".picsymbol_stub", 0) +DEF_SECTION (machopic_picsymbol_stub1_section, 0, + ".section __TEXT,__picsymbolstub1,symbol_stubs," + "pure_instructions,32", 0) +DEF_SECTION (darwin_exception_section, 0, + ".section __DATA,__gcc_except_tab", 0) +DEF_SECTION (darwin_eh_frame_section, 0, + ".section " EH_FRAME_SECTION_NAME ",__eh_frame" + EH_FRAME_SECTION_ATTR, 0) diff --git a/contrib/gcc/config/darwin.c b/contrib/gcc/config/darwin.c index c946e591a38..addef1230e0 100644 --- a/contrib/gcc/config/darwin.c +++ b/contrib/gcc/config/darwin.c @@ -1,5 +1,6 @@ /* Functions for generic Darwin as target machine for GNU C compiler. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003 + Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -17,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -40,13 +41,109 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "ggc.h" #include "langhooks.h" +#include "target.h" #include "tm_p.h" -#include "errors.h" +#include "toplev.h" +#include "hashtab.h" -static int machopic_data_defined_p (const char *); -static void update_non_lazy_ptrs (const char *); -static void update_stubs (const char *); -static const char *machopic_non_lazy_ptr_name (const char*); +/* Darwin supports a feature called fix-and-continue, which is used + for rapid turn around debugging. When code is compiled with the + -mfix-and-continue flag, two changes are made to the generated code + that allow the system to do things that it would normally not be + able to do easily. These changes allow gdb to load in + recompilation of a translation unit that has been changed into a + running program and replace existing functions and methods of that + translation unit with versions of those functions and methods + from the newly compiled translation unit. The new functions access + the existing static symbols from the old translation unit, if the + symbol existed in the unit to be replaced, and from the new + translation unit, otherwise. + + The changes are to insert 5 nops at the beginning of all functions + and to use indirection to get at static symbols. The 5 nops + are required by consumers of the generated code. Currently, gdb + uses this to patch in a jump to the overriding function, this + allows all uses of the old name to forward to the replacement, + including existing function pointers and virtual methods. See + rs6000_emit_prologue for the code that handles the nop insertions. + + The added indirection allows gdb to redirect accesses to static + symbols from the newly loaded translation unit to the existing + symbol, if any. @code{static} symbols are special and are handled by + setting the second word in the .non_lazy_symbol_pointer data + structure to symbol. See indirect_data for the code that handles + the extra indirection, and machopic_output_indirection and its use + of MACHO_SYMBOL_STATIC for the code that handles @code{static} + symbol indirection. */ + +/* Section names. */ +section * darwin_sections[NUM_DARWIN_SECTIONS]; + +/* True if we're setting __attribute__ ((ms_struct)). */ +int darwin_ms_struct = false; + +/* A get_unnamed_section callback used to switch to an ObjC section. + DIRECTIVE is as for output_section_asm_op. */ + +static void +output_objc_section_asm_op (const void *directive) +{ + static bool been_here = false; + + if (! been_here) + { + static const enum darwin_section_enum tomark[] = + { + /* written, cold -> hot */ + objc_cat_cls_meth_section, + objc_cat_inst_meth_section, + objc_string_object_section, + objc_constant_string_object_section, + objc_selector_refs_section, + objc_selector_fixup_section, + objc_cls_refs_section, + objc_class_section, + objc_meta_class_section, + /* shared, hot -> cold */ + objc_cls_meth_section, + objc_inst_meth_section, + objc_protocol_section, + objc_class_names_section, + objc_meth_var_types_section, + objc_meth_var_names_section, + objc_category_section, + objc_class_vars_section, + objc_instance_vars_section, + objc_module_info_section, + objc_symbols_section + }; + size_t i; + + been_here = true; + for (i = 0; i < ARRAY_SIZE (tomark); i++) + switch_to_section (darwin_sections[tomark[i]]); + } + output_section_asm_op (directive); +} + +/* Implement TARGET_ASM_INIT_SECTIONS. */ + +void +darwin_init_sections (void) +{ +#define DEF_SECTION(NAME, FLAGS, DIRECTIVE, OBJC) \ + darwin_sections[NAME] = \ + get_unnamed_section (FLAGS, (OBJC \ + ? output_objc_section_asm_op \ + : output_section_asm_op), \ + "\t" DIRECTIVE); +#include "config/darwin-sections.def" +#undef DEF_SECTION + + readonly_data_section = darwin_sections[const_section]; + exception_section = darwin_sections[darwin_exception_section]; + eh_frame_section = darwin_sections[darwin_eh_frame_section]; +} int name_needs_quotes (const char *name) @@ -58,162 +155,114 @@ name_needs_quotes (const char *name) return 0; } -/* - * flag_pic = 1 ... generate only indirections - * flag_pic = 2 ... generate indirections and pure code - */ +/* Return true if SYM_REF can be used without an indirection. */ +static int +machopic_symbol_defined_p (rtx sym_ref) +{ + if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_DEFINED) + return true; + + /* If a symbol references local and is not an extern to this + file, then the symbol might be able to declared as defined. */ + if (SYMBOL_REF_LOCAL_P (sym_ref) && ! SYMBOL_REF_EXTERNAL_P (sym_ref)) + { + /* If the symbol references a variable and the variable is a + common symbol, then this symbol is not defined. */ + if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_VARIABLE) + { + tree decl = SYMBOL_REF_DECL (sym_ref); + if (!decl) + return true; + if (DECL_COMMON (decl)) + return false; + } + return true; + } + return false; +} /* This module assumes that (const (symbol_ref "foo")) is a legal pic reference, which will not be changed. */ -static GTY(()) tree machopic_defined_list; - enum machopic_addr_class -machopic_classify_ident (tree ident) +machopic_classify_symbol (rtx sym_ref) { - const char *name = IDENTIFIER_POINTER (ident); - int lprefix = (((name[0] == '*' || name[0] == '&') - && (name[1] == 'L' || (name[1] == '"' && name[2] == 'L'))) - || ( name[0] == '_' - && name[1] == 'O' - && name[2] == 'B' - && name[3] == 'J' - && name[4] == 'C' - && name[5] == '_')); - tree temp; + int flags; + bool function_p; - /* The PIC base symbol is always defined. */ - if (! strcmp (name, "")) - return MACHOPIC_DEFINED_DATA; - - if (name[0] != '!') - { - /* Here if no special encoding to be found. */ - if (lprefix) - { - const char *name = IDENTIFIER_POINTER (ident); - int len = strlen (name); - - if ((len > 5 && !strcmp (name + len - 5, "$stub")) - || (len > 6 && !strcmp (name + len - 6, "$stub\""))) - return MACHOPIC_DEFINED_FUNCTION; - return MACHOPIC_DEFINED_DATA; - } - - for (temp = machopic_defined_list; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - { - if (ident == TREE_VALUE (temp)) - return MACHOPIC_DEFINED_DATA; - } - - if (TREE_ASM_WRITTEN (ident)) - return MACHOPIC_DEFINED_DATA; - - return MACHOPIC_UNDEFINED; - } - - else if (name[1] == 'D') - return MACHOPIC_DEFINED_DATA; - - else if (name[1] == 'T') - return MACHOPIC_DEFINED_FUNCTION; - - /* It is possible that someone is holding a "stale" name, which has - since been defined. See if there is a "defined" name (i.e, - different from NAME only in having a '!D_' or a '!T_' instead of - a '!d_' or '!t_' prefix) in the identifier hash tables. If so, say - that this identifier is defined. */ - else if (name[1] == 'd' || name[1] == 't') - { - char *new_name; - new_name = (char *)alloca (strlen (name) + 1); - strcpy (new_name, name); - new_name[1] = (name[1] == 'd') ? 'D' : 'T'; - if (maybe_get_identifier (new_name) != NULL) - return (name[1] == 'd') ? MACHOPIC_DEFINED_DATA - : MACHOPIC_DEFINED_FUNCTION; - } - - for (temp = machopic_defined_list; temp != NULL_TREE; temp = TREE_CHAIN (temp)) - { - if (ident == TREE_VALUE (temp)) - { - if (name[1] == 'T') - return MACHOPIC_DEFINED_FUNCTION; - else - return MACHOPIC_DEFINED_DATA; - } - } - - if (name[1] == 't' || name[1] == 'T') - { - if (lprefix) - return MACHOPIC_DEFINED_FUNCTION; - else - return MACHOPIC_UNDEFINED_FUNCTION; - } + flags = SYMBOL_REF_FLAGS (sym_ref); + function_p = SYMBOL_REF_FUNCTION_P (sym_ref); + if (machopic_symbol_defined_p (sym_ref)) + return (function_p + ? MACHOPIC_DEFINED_FUNCTION : MACHOPIC_DEFINED_DATA); else - { - if (lprefix) - return MACHOPIC_DEFINED_DATA; - else - return MACHOPIC_UNDEFINED_DATA; - } + return (function_p + ? MACHOPIC_UNDEFINED_FUNCTION : MACHOPIC_UNDEFINED_DATA); } +#ifndef TARGET_FIX_AND_CONTINUE +#define TARGET_FIX_AND_CONTINUE 0 +#endif -enum machopic_addr_class -machopic_classify_name (const char *name) -{ - return machopic_classify_ident (get_identifier (name)); -} - -int -machopic_ident_defined_p (tree ident) -{ - switch (machopic_classify_ident (ident)) - { - case MACHOPIC_UNDEFINED: - case MACHOPIC_UNDEFINED_DATA: - case MACHOPIC_UNDEFINED_FUNCTION: - return 0; - default: - return 1; - } -} +/* Indicate when fix-and-continue style code generation is being used + and when a reference to data should be indirected so that it can be + rebound in a new translation unit to reference the original instance + of that data. Symbol names that are for code generation local to + the translation unit are bound to the new translation unit; + currently this means symbols that begin with L or _OBJC_; + otherwise, we indicate that an indirect reference should be made to + permit the runtime to rebind new instances of the translation unit + to the original instance of the data. */ static int -machopic_data_defined_p (const char *name) +indirect_data (rtx sym_ref) { - switch (machopic_classify_ident (get_identifier (name))) + int lprefix; + const char *name; + + /* If we aren't generating fix-and-continue code, don't do anything special. */ + if (TARGET_FIX_AND_CONTINUE == 0) + return 0; + + /* Otherwise, all symbol except symbols that begin with L or _OBJC_ + are indirected. Symbols that begin with L and _OBJC_ are always + bound to the current translation unit as they are used for + generated local data of the translation unit. */ + + name = XSTR (sym_ref, 0); + + lprefix = (((name[0] == '*' || name[0] == '&') + && (name[1] == 'L' || (name[1] == '"' && name[2] == 'L'))) + || (strncmp (name, "_OBJC_", 6) == 0)); + + return ! lprefix; +} + + +static int +machopic_data_defined_p (rtx sym_ref) +{ + if (indirect_data (sym_ref)) + return 0; + + switch (machopic_classify_symbol (sym_ref)) { case MACHOPIC_DEFINED_DATA: + case MACHOPIC_DEFINED_FUNCTION: return 1; default: return 0; } } -int -machopic_name_defined_p (const char *name) -{ - return machopic_ident_defined_p (get_identifier (name)); -} - void -machopic_define_ident (tree ident) +machopic_define_symbol (rtx mem) { - if (!machopic_ident_defined_p (ident)) - machopic_defined_list = - tree_cons (NULL_TREE, ident, machopic_defined_list); -} + rtx sym_ref; -void -machopic_define_name (const char *name) -{ - machopic_define_ident (get_identifier (name)); + gcc_assert (GET_CODE (mem) == MEM); + sym_ref = XEXP (mem, 0); + SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED; } static GTY(()) char * function_base; @@ -221,12 +270,8 @@ static GTY(()) char * function_base; const char * machopic_function_base_name (void) { - const char *current_name; /* if dynamic-no-pic is on, we should not get here */ - if (MACHO_DYNAMIC_NO_PIC_P) - abort (); - current_name = - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)); + gcc_assert (!MACHO_DYNAMIC_NO_PIC_P); if (function_base == NULL) function_base = @@ -237,6 +282,30 @@ machopic_function_base_name (void) return function_base; } +/* Return a SYMBOL_REF for the PIC function base. */ + +rtx +machopic_function_base_sym (void) +{ + rtx sym_ref; + + sym_ref = gen_rtx_SYMBOL_REF (Pmode, machopic_function_base_name ()); + SYMBOL_REF_FLAGS (sym_ref) + |= (MACHO_SYMBOL_FLAG_VARIABLE | MACHO_SYMBOL_FLAG_DEFINED); + return sym_ref; +} + +/* Return either ORIG or (const:P (minus:P ORIG PIC_BASE)), depending + on whether pic_base is NULL or not. */ +static inline rtx +gen_pic_offset (rtx orig, rtx pic_base) +{ + if (!pic_base) + return orig; + else + return gen_rtx_CONST (Pmode, gen_rtx_MINUS (Pmode, orig, pic_base)); +} + static GTY(()) const char * function_base_func_name; static GTY(()) int current_pic_label_num; @@ -245,9 +314,8 @@ machopic_output_function_base_name (FILE *file) { const char *current_name; - /* If dynamic-no-pic is on, we should not get here. */ - if (MACHO_DYNAMIC_NO_PIC_P) - abort (); + /* If dynamic-no-pic is on, we should not get here. */ + gcc_assert (!MACHO_DYNAMIC_NO_PIC_P); current_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)); if (function_base_func_name != current_name) @@ -258,180 +326,173 @@ machopic_output_function_base_name (FILE *file) fprintf (file, "\"L%011d$pb\"", current_pic_label_num); } -static GTY(()) tree machopic_non_lazy_pointers; +/* The suffix attached to non-lazy pointer symbols. */ +#define NON_LAZY_POINTER_SUFFIX "$non_lazy_ptr" +/* The suffix attached to stub symbols. */ +#define STUB_SUFFIX "$stub" -/* Return a non-lazy pointer name corresponding to the given name, - either by finding it in our list of pointer names, or by generating - a new one. */ - -static const char * -machopic_non_lazy_ptr_name (const char *name) +typedef struct machopic_indirection GTY (()) { - const char *temp_name; - tree temp, ident = get_identifier (name); + /* The SYMBOL_REF for the entity referenced. */ + rtx symbol; + /* The name of the stub or non-lazy pointer. */ + const char * ptr_name; + /* True iff this entry is for a stub (as opposed to a non-lazy + pointer). */ + bool stub_p; + /* True iff this stub or pointer pointer has been referenced. */ + bool used; +} machopic_indirection; - for (temp = machopic_non_lazy_pointers; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - { - if (ident == TREE_VALUE (temp)) - return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); - } +/* A table mapping stub names and non-lazy pointer names to + SYMBOL_REFs for the stubbed-to and pointed-to entities. */ - name = darwin_strip_name_encoding (name); +static GTY ((param_is (struct machopic_indirection))) htab_t + machopic_indirections; - /* Try again, but comparing names this time. */ - for (temp = machopic_non_lazy_pointers; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - { - if (TREE_VALUE (temp)) - { - temp_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - temp_name = darwin_strip_name_encoding (temp_name); - if (strcmp (name, temp_name) == 0) - return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); - } - } +/* Return a hash value for a SLOT in the indirections hash table. */ - { - char *buffer; - int namelen = strlen (name); - int bufferlen = 0; - tree ptr_name; - - buffer = alloca (namelen + strlen("$non_lazy_ptr") + 5); - - strcpy (buffer, "&L"); - bufferlen = 2; - if (name[0] == '*') - { - memcpy (buffer + bufferlen, name+1, namelen-1+1); - bufferlen += namelen-1; - } - else - { - buffer[bufferlen] = '_'; - memcpy (buffer + bufferlen +1, name, namelen+1); - bufferlen += namelen +1; - } - - memcpy (buffer + bufferlen, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1); - bufferlen += strlen("$non_lazy_ptr"); - ptr_name = get_identifier (buffer); - - machopic_non_lazy_pointers - = tree_cons (ptr_name, ident, machopic_non_lazy_pointers); - - TREE_USED (machopic_non_lazy_pointers) = 0; - - return IDENTIFIER_POINTER (ptr_name); - } +static hashval_t +machopic_indirection_hash (const void *slot) +{ + const machopic_indirection *p = (const machopic_indirection *) slot; + return htab_hash_string (p->ptr_name); } -static GTY(()) tree machopic_stubs; +/* Returns true if the KEY is the same as that associated with + SLOT. */ -/* Return the name of the stub corresponding to the given name, - generating a new stub name if necessary. */ +static int +machopic_indirection_eq (const void *slot, const void *key) +{ + return strcmp (((const machopic_indirection *) slot)->ptr_name, key) == 0; +} + +/* Return the name of the non-lazy pointer (if STUB_P is false) or + stub (if STUB_B is true) corresponding to the given name. */ const char * -machopic_stub_name (const char *name) +machopic_indirection_name (rtx sym_ref, bool stub_p) { - tree temp, ident = get_identifier (name); - const char *tname; + char *buffer; + const char *name = XSTR (sym_ref, 0); + size_t namelen = strlen (name); + machopic_indirection *p; + void ** slot; + bool saw_star = false; + bool needs_quotes; + const char *suffix; + const char *prefix = user_label_prefix; + const char *quote = ""; + tree id; - for (temp = machopic_stubs; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) + id = maybe_get_identifier (name); + if (id) { - if (ident == TREE_VALUE (temp)) - return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); - tname = IDENTIFIER_POINTER (TREE_VALUE (temp)); - if (strcmp (name, tname) == 0) - return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); - /* A library call name might not be section-encoded yet, so try - it against a stripped name. */ - if (name[0] != '!' - && tname[0] == '!' - && strcmp (name, tname + 4) == 0) - return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); + tree id_orig = id; + + while (IDENTIFIER_TRANSPARENT_ALIAS (id)) + id = TREE_CHAIN (id); + if (id != id_orig) + { + name = IDENTIFIER_POINTER (id); + namelen = strlen (name); + } } - name = darwin_strip_name_encoding (name); + if (name[0] == '*') + { + saw_star = true; + prefix = ""; + ++name; + --namelen; + } - { - char *buffer; - int bufferlen = 0; - int namelen = strlen (name); - tree ptr_name; - int needs_quotes = name_needs_quotes (name); + needs_quotes = name_needs_quotes (name); + if (needs_quotes) + { + quote = "\""; + } - buffer = alloca (namelen + 20); + if (stub_p) + suffix = STUB_SUFFIX; + else + suffix = NON_LAZY_POINTER_SUFFIX; - if (needs_quotes) - { - strcpy (buffer, "&\"L"); - bufferlen = strlen("&\"L"); - } - else - { - strcpy (buffer, "&L"); - bufferlen = strlen("&L"); - } - - if (name[0] == '*') - { - memcpy (buffer + bufferlen, name+1, namelen - 1 +1); - bufferlen += namelen - 1; - } - else - { - buffer[bufferlen] = '_'; - memcpy (buffer + bufferlen +1, name, namelen+1); - bufferlen += namelen +1; - } + buffer = alloca (strlen ("&L") + + strlen (prefix) + + namelen + + strlen (suffix) + + 2 * strlen (quote) + + 1 /* '\0' */); - if (needs_quotes) - { - memcpy (buffer + bufferlen, "$stub\"", strlen("$stub\"")+1); - bufferlen += strlen("$stub\""); - } - else - { - memcpy (buffer + bufferlen, "$stub", strlen("$stub")+1); - bufferlen += strlen("$stub"); - } - ptr_name = get_identifier (buffer); + /* Construct the name of the non-lazy pointer or stub. */ + sprintf (buffer, "&%sL%s%s%s%s", quote, prefix, name, suffix, quote); - machopic_stubs = tree_cons (ptr_name, ident, machopic_stubs); - TREE_USED (machopic_stubs) = 0; + if (!machopic_indirections) + machopic_indirections = htab_create_ggc (37, + machopic_indirection_hash, + machopic_indirection_eq, + /*htab_del=*/NULL); - return IDENTIFIER_POINTER (ptr_name); - } + slot = htab_find_slot_with_hash (machopic_indirections, buffer, + htab_hash_string (buffer), INSERT); + if (*slot) + { + p = (machopic_indirection *) *slot; + } + else + { + p = (machopic_indirection *) ggc_alloc (sizeof (machopic_indirection)); + p->symbol = sym_ref; + p->ptr_name = xstrdup (buffer); + p->stub_p = stub_p; + p->used = false; + *slot = p; + } + + return p->ptr_name; } -void -machopic_validate_stub_or_non_lazy_ptr (const char *name, int validate_stub) -{ - const char *real_name; - tree temp, ident = get_identifier (name), id2; +/* Return the name of the stub for the mcount function. */ - for (temp = (validate_stub ? machopic_stubs : machopic_non_lazy_pointers); - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - if (ident == TREE_PURPOSE (temp)) - { - /* Mark both the stub or non-lazy pointer as well as the - original symbol as being referenced. */ - TREE_USED (temp) = 1; - if (TREE_CODE (TREE_VALUE (temp)) == IDENTIFIER_NODE) - mark_referenced (TREE_VALUE (temp)); - real_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - real_name = darwin_strip_name_encoding (real_name); - id2 = maybe_get_identifier (real_name); - if (id2) - mark_referenced (id2); - } +const char* +machopic_mcount_stub_name (void) +{ + rtx symbol = gen_rtx_SYMBOL_REF (Pmode, "*mcount"); + return machopic_indirection_name (symbol, /*stub_p=*/true); +} + +/* If NAME is the name of a stub or a non-lazy pointer , mark the stub + or non-lazy pointer as used -- and mark the object to which the + pointer/stub refers as used as well, since the pointer/stub will + emit a reference to it. */ + +void +machopic_validate_stub_or_non_lazy_ptr (const char *name) +{ + machopic_indirection *p; + + p = ((machopic_indirection *) + (htab_find_with_hash (machopic_indirections, name, + htab_hash_string (name)))); + if (p && ! p->used) + { + const char *real_name; + tree id; + + p->used = true; + + /* Do what output_addr_const will do when we actually call it. */ + if (SYMBOL_REF_DECL (p->symbol)) + mark_decl_referenced (SYMBOL_REF_DECL (p->symbol)); + + real_name = targetm.strip_name_encoding (XSTR (p->symbol, 0)); + + id = maybe_get_identifier (real_name); + if (id) + mark_referenced (id); + } } /* Transform ORIG, which may be any data source, to the corresponding @@ -447,34 +508,32 @@ machopic_indirect_data_reference (rtx orig, rtx reg) if (GET_CODE (orig) == SYMBOL_REF) { - const char *name = XSTR (orig, 0); - int defined = machopic_data_defined_p (name); + int defined = machopic_data_defined_p (orig); if (defined && MACHO_DYNAMIC_NO_PIC_P) { #if defined (TARGET_TOC) - emit_insn (gen_macho_high (reg, orig)); - emit_insn (gen_macho_low (reg, reg, orig)); + /* Create a new register for CSE opportunities. */ + rtx hi_reg = (no_new_pseudos ? reg : gen_reg_rtx (Pmode)); + emit_insn (gen_macho_high (hi_reg, orig)); + emit_insn (gen_macho_low (reg, hi_reg, orig)); #else /* some other cpu -- writeme! */ - abort (); + gcc_unreachable (); #endif return reg; } else if (defined) { #if defined (TARGET_TOC) || defined (HAVE_lo_sum) - rtx pic_base = gen_rtx_SYMBOL_REF (Pmode, - machopic_function_base_name ()); - rtx offset = gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, orig, pic_base)); + rtx pic_base = machopic_function_base_sym (); + rtx offset = gen_pic_offset (orig, pic_base); #endif #if defined (TARGET_TOC) /* i.e., PowerPC */ rtx hi_sum_reg = (no_new_pseudos ? reg : gen_reg_rtx (Pmode)); - if (reg == NULL) - abort (); + gcc_assert (reg); emit_insn (gen_rtx_SET (Pmode, hi_sum_reg, gen_rtx_PLUS (Pmode, pic_offset_table_rtx, @@ -485,7 +544,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) orig = reg; #else #if defined (HAVE_lo_sum) - if (reg == 0) abort (); + gcc_assert (reg); emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_HIGH (Pmode, offset))); @@ -499,11 +558,14 @@ machopic_indirect_data_reference (rtx orig, rtx reg) return orig; } - ptr_ref = gen_rtx_SYMBOL_REF (Pmode, - machopic_non_lazy_ptr_name (name)); + ptr_ref = (gen_rtx_SYMBOL_REF + (Pmode, + machopic_indirection_name (orig, /*stub_p=*/false))); - ptr_ref = gen_rtx_MEM (Pmode, ptr_ref); - RTX_UNCHANGING_P (ptr_ref) = 1; + SYMBOL_REF_DATA (ptr_ref) = SYMBOL_REF_DATA (orig); + + ptr_ref = gen_const_mem (Pmode, ptr_ref); + machopic_define_symbol (ptr_ref); return ptr_ref; } @@ -574,22 +636,20 @@ machopic_indirect_call_target (rtx target) if (GET_CODE (target) != MEM) return target; - if (MACHOPIC_INDIRECT && GET_CODE (XEXP (target, 0)) == SYMBOL_REF) + if (MACHOPIC_INDIRECT + && GET_CODE (XEXP (target, 0)) == SYMBOL_REF + && !(SYMBOL_REF_FLAGS (XEXP (target, 0)) + & MACHO_SYMBOL_FLAG_DEFINED)) { - enum machine_mode mode = GET_MODE (XEXP (target, 0)); - const char *name = XSTR (XEXP (target, 0), 0); + rtx sym_ref = XEXP (target, 0); + const char *stub_name = machopic_indirection_name (sym_ref, + /*stub_p=*/true); + enum machine_mode mode = GET_MODE (sym_ref); - /* If the name is already defined, we need do nothing. */ - if (name[0] == '!' && name[1] == 'T') - return target; - - if (!machopic_name_defined_p (name)) - { - const char *stub_name = machopic_stub_name (name); - - XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name); - RTX_UNCHANGING_P (target) = 1; - } + XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name); + SYMBOL_REF_DATA (XEXP (target, 0)) = SYMBOL_REF_DATA (sym_ref); + MEM_READONLY_P (target) = 1; + MEM_NOTRAP_P (target) = 1; } return target; @@ -623,20 +683,18 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) return reg; } - /* if dynamic-no-pic then use 0 as the pic base */ + /* if dynamic-no-pic we don't have a pic base */ if (MACHO_DYNAMIC_NO_PIC_P) - pic_base = CONST0_RTX (Pmode); + pic_base = NULL; else - pic_base = gen_rtx_SYMBOL_REF (Pmode, machopic_function_base_name ()); + pic_base = machopic_function_base_sym (); if (GET_CODE (orig) == MEM) { if (reg == 0) { - if (reload_in_progress) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!reload_in_progress); + reg = gen_reg_rtx (Pmode); } #ifdef HAVE_lo_sum @@ -650,13 +708,12 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) rtx mem; emit_insn (gen_macho_high (temp_reg, asym)); - mem = gen_rtx_MEM (GET_MODE (orig), - gen_rtx_LO_SUM (Pmode, temp_reg, asym)); - RTX_UNCHANGING_P (mem) = 1; + mem = gen_const_mem (GET_MODE (orig), + gen_rtx_LO_SUM (Pmode, temp_reg, asym)); emit_insn (gen_rtx_SET (VOIDmode, reg, mem)); #else /* Some other CPU -- WriteMe! but right now there are no other platform that can use dynamic-no-pic */ - abort (); + gcc_unreachable (); #endif pic_ref = reg; } @@ -664,41 +721,37 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) if (GET_CODE (XEXP (orig, 0)) == SYMBOL_REF || GET_CODE (XEXP (orig, 0)) == LABEL_REF) { - rtx offset = gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, - XEXP (orig, 0), - pic_base)); + rtx offset = gen_pic_offset (XEXP (orig, 0), pic_base); #if defined (TARGET_TOC) /* i.e., PowerPC */ /* Generating a new reg may expose opportunities for common subexpression elimination. */ - rtx hi_sum_reg = no_new_pseudos ? reg : gen_reg_rtx (SImode); + rtx hi_sum_reg = no_new_pseudos ? reg : gen_reg_rtx (Pmode); rtx mem; rtx insn; rtx sum; - + sum = gen_rtx_HIGH (Pmode, offset); if (! MACHO_DYNAMIC_NO_PIC_P) sum = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, sum); emit_insn (gen_rtx_SET (Pmode, hi_sum_reg, sum)); - mem = gen_rtx_MEM (GET_MODE (orig), - gen_rtx_LO_SUM (Pmode, - hi_sum_reg, offset)); - RTX_UNCHANGING_P (mem) = 1; + mem = gen_const_mem (GET_MODE (orig), + gen_rtx_LO_SUM (Pmode, + hi_sum_reg, offset)); insn = emit_insn (gen_rtx_SET (VOIDmode, reg, mem)); - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref, + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref, REG_NOTES (insn)); pic_ref = reg; #else emit_insn (gen_rtx_USE (VOIDmode, - gen_rtx_REG (Pmode, + gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM))); emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_HIGH (Pmode, - gen_rtx_CONST (Pmode, + gen_rtx_CONST (Pmode, offset)))); emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_LO_SUM (Pmode, reg, @@ -718,23 +771,21 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) } #if 0 emit_insn (gen_rtx_USE (VOIDmode, - gen_rtx_REG (Pmode, + gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM))); #endif - pic_ref = gen_rtx_PLUS (Pmode, - pic, - gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, - XEXP (orig, 0), - pic_base))); + if (reload_in_progress) + regs_ever_live[REGNO (pic)] = 1; + pic_ref = gen_rtx_PLUS (Pmode, pic, + gen_pic_offset (XEXP (orig, 0), + pic_base)); } #if !defined (TARGET_TOC) emit_move_insn (reg, pic_ref); - pic_ref = gen_rtx_MEM (GET_MODE (orig), reg); + pic_ref = gen_const_mem (GET_MODE (orig), reg); #endif - RTX_UNCHANGING_P (pic_ref) = 1; } else { @@ -743,18 +794,14 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF) { - rtx offset = gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, - orig, pic_base)); + rtx offset = gen_pic_offset (orig, pic_base); #if defined (TARGET_TOC) /* i.e., PowerPC */ rtx hi_sum_reg; if (reg == 0) { - if (reload_in_progress) - abort (); - else - reg = gen_reg_rtx (SImode); + gcc_assert (!reload_in_progress); + reg = gen_reg_rtx (Pmode); } hi_sum_reg = reg; @@ -764,13 +811,12 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) ? gen_rtx_HIGH (Pmode, offset) : gen_rtx_PLUS (Pmode, pic_offset_table_rtx, - gen_rtx_HIGH (Pmode, + gen_rtx_HIGH (Pmode, offset)))); emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_LO_SUM (Pmode, hi_sum_reg, offset))); pic_ref = reg; - RTX_UNCHANGING_P (pic_ref) = 1; #else emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_HIGH (Pmode, offset))); @@ -778,13 +824,13 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) gen_rtx_LO_SUM (Pmode, reg, offset))); pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, reg); - RTX_UNCHANGING_P (pic_ref) = 1; #endif } else #endif /* HAVE_lo_sum */ { - if (GET_CODE (orig) == REG) + if (REG_P (orig) + || GET_CODE (orig) == SUBREG) { return orig; } @@ -800,11 +846,11 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx)); #endif + if (reload_in_progress) + regs_ever_live[REGNO (pic)] = 1; pic_ref = gen_rtx_PLUS (Pmode, pic, - gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, - orig, pic_base))); + gen_pic_offset (orig, pic_base)); } } } @@ -852,9 +898,6 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) else pic_ref = gen_rtx_PLUS (Pmode, base, orig); - if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig)) - RTX_UNCHANGING_P (pic_ref) = 1; - if (reg && is_complex) { emit_move_insn (reg, pic_ref); @@ -872,9 +915,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) && GET_CODE (XEXP (orig, 0)) == SYMBOL_REF) { rtx addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg); - - addr = gen_rtx_MEM (GET_MODE (orig), addr); - RTX_UNCHANGING_P (addr) = RTX_UNCHANGING_P (orig); + addr = replace_equiv_address (orig, addr); emit_move_insn (reg, addr); pic_ref = reg; } @@ -882,25 +923,42 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) return pic_ref; } +/* Output the stub or non-lazy pointer in *SLOT, if it has been used. + DATA is the FILE* for assembly output. Called from + htab_traverse. */ -void -machopic_finish (FILE *asm_out_file) +static int +machopic_output_indirection (void **slot, void *data) { - tree temp; + machopic_indirection *p = *((machopic_indirection **) slot); + FILE *asm_out_file = (FILE *) data; + rtx symbol; + const char *sym_name; + const char *ptr_name; - for (temp = machopic_stubs; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) + if (!p->used) + return 1; + + symbol = p->symbol; + sym_name = XSTR (symbol, 0); + ptr_name = p->ptr_name; + + if (p->stub_p) { - const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - const char *stub_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); char *sym; char *stub; + tree id; - if (! TREE_USED (temp)) - continue; + id = maybe_get_identifier (sym_name); + if (id) + { + tree id_orig = id; - sym_name = darwin_strip_name_encoding (sym_name); + while (IDENTIFIER_TRANSPARENT_ALIAS (id)) + id = TREE_CHAIN (id); + if (id != id_orig) + sym_name = IDENTIFIER_POINTER (id); + } sym = alloca (strlen (sym_name) + 2); if (sym_name[0] == '*' || sym_name[0] == '&') @@ -908,50 +966,64 @@ machopic_finish (FILE *asm_out_file) else if (sym_name[0] == '-' || sym_name[0] == '+') strcpy (sym, sym_name); else - sym[0] = '_', strcpy (sym + 1, sym_name); + sprintf (sym, "%s%s", user_label_prefix, sym_name); - stub = alloca (strlen (stub_name) + 2); - if (stub_name[0] == '*' || stub_name[0] == '&') - strcpy (stub, stub_name + 1); + stub = alloca (strlen (ptr_name) + 2); + if (ptr_name[0] == '*' || ptr_name[0] == '&') + strcpy (stub, ptr_name + 1); else - stub[0] = '_', strcpy (stub + 1, stub_name); + sprintf (stub, "%s%s", user_label_prefix, ptr_name); machopic_output_stub (asm_out_file, sym, stub); } - - for (temp = machopic_non_lazy_pointers; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) + else if (! indirect_data (symbol) + && (machopic_symbol_defined_p (symbol) + || SYMBOL_REF_LOCAL_P (symbol))) { - const char *const sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - const char *const lazy_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); - - if (! TREE_USED (temp)) - continue; - - if (machopic_ident_defined_p (TREE_VALUE (temp))) - { - data_section (); - assemble_align (GET_MODE_ALIGNMENT (Pmode)); - assemble_label (lazy_name); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name), - GET_MODE_SIZE (Pmode), - GET_MODE_ALIGNMENT (Pmode), 1); - } - else - { - machopic_nl_symbol_ptr_section (); - assemble_name (asm_out_file, lazy_name); - fprintf (asm_out_file, ":\n"); - - fprintf (asm_out_file, "\t.indirect_symbol "); - assemble_name (asm_out_file, sym_name); - fprintf (asm_out_file, "\n"); - - assemble_integer (const0_rtx, GET_MODE_SIZE (Pmode), - GET_MODE_ALIGNMENT (Pmode), 1); - } + switch_to_section (data_section); + assemble_align (GET_MODE_ALIGNMENT (Pmode)); + assemble_label (ptr_name); + assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name), + GET_MODE_SIZE (Pmode), + GET_MODE_ALIGNMENT (Pmode), 1); } + else + { + rtx init = const0_rtx; + + switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]); + assemble_name (asm_out_file, ptr_name); + fprintf (asm_out_file, ":\n"); + + fprintf (asm_out_file, "\t.indirect_symbol "); + assemble_name (asm_out_file, sym_name); + fprintf (asm_out_file, "\n"); + + /* Variables that are marked with MACHO_SYMBOL_STATIC need to + have their symbol name instead of 0 in the second entry of + the non-lazy symbol pointer data structure when they are + defined. This allows the runtime to rebind newer instances + of the translation unit with the original instance of the + symbol. */ + + if ((SYMBOL_REF_FLAGS (symbol) & MACHO_SYMBOL_STATIC) + && machopic_symbol_defined_p (symbol)) + init = gen_rtx_SYMBOL_REF (Pmode, sym_name); + + assemble_integer (init, GET_MODE_SIZE (Pmode), + GET_MODE_ALIGNMENT (Pmode), 1); + } + + return 1; +} + +void +machopic_finish (FILE *asm_out_file) +{ + if (machopic_indirections) + htab_traverse_noresize (machopic_indirections, + machopic_output_indirection, + asm_out_file); } int @@ -963,7 +1035,7 @@ machopic_operand_p (rtx op) op = XEXP (op, 0); if (GET_CODE (op) == SYMBOL_REF) - return machopic_name_defined_p (XSTR (op, 0)); + return machopic_symbol_defined_p (op); else return 0; } @@ -974,8 +1046,8 @@ machopic_operand_p (rtx op) if (GET_CODE (op) == MINUS && GET_CODE (XEXP (op, 0)) == SYMBOL_REF && GET_CODE (XEXP (op, 1)) == SYMBOL_REF - && machopic_name_defined_p (XSTR (XEXP (op, 0), 0)) - && machopic_name_defined_p (XSTR (XEXP (op, 1), 0))) + && machopic_symbol_defined_p (XEXP (op, 0)) + && machopic_symbol_defined_p (XEXP (op, 1))) return 1; return 0; @@ -988,174 +1060,95 @@ machopic_operand_p (rtx op) void darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) { - char code = '\0'; - int defined = 0; rtx sym_ref; - const char *orig_str; - char *new_str; - size_t len, new_len; /* Do the standard encoding things first. */ default_encode_section_info (decl, rtl, first); - /* With the introduction of symbol_ref flags, some of the following - code has become redundant and should be removed at some point. */ + if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) + return; - if ((TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == VAR_DECL) - && !DECL_EXTERNAL (decl) + sym_ref = XEXP (rtl, 0); + if (TREE_CODE (decl) == VAR_DECL) + SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE; + + if (!DECL_EXTERNAL (decl) + && (!TREE_PUBLIC (decl) || !DECL_WEAK (decl)) + && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)) && ((TREE_STATIC (decl) && (!DECL_COMMON (decl) || !TREE_PUBLIC (decl))) || (!DECL_COMMON (decl) && DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node))) - defined = 1; + SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED; - if (TREE_CODE (decl) == FUNCTION_DECL) - code = (defined ? 'T' : 't'); - else if (TREE_CODE (decl) == VAR_DECL) - code = (defined ? 'D' : 'd'); - - if (code == '\0') - return; - - sym_ref = XEXP (rtl, 0); - orig_str = XSTR (sym_ref, 0); - len = strlen (orig_str) + 1; - - if (orig_str[0] == '!') - { - /* Already encoded; see if we need to change it. */ - if (code == orig_str[1]) - return; - /* Yes, tweak a copy of the name and put it in a new string. */ - new_str = alloca (len); - memcpy (new_str, orig_str, len); - new_str[1] = code; - XSTR (sym_ref, 0) = ggc_alloc_string (new_str, len); - } - else - { - /* Add the encoding. */ - new_len = len + 4; - new_str = alloca (new_len); - new_str[0] = '!'; - new_str[1] = code; - new_str[2] = '_'; - new_str[3] = '_'; - memcpy (new_str + 4, orig_str, len); - XSTR (sym_ref, 0) = ggc_alloc_string (new_str, new_len); - } - /* The non-lazy pointer list may have captured references to the - old encoded name, change them. */ - if (TREE_CODE (decl) == VAR_DECL) - update_non_lazy_ptrs (XSTR (sym_ref, 0)); - else - update_stubs (XSTR (sym_ref, 0)); -} - -/* Undo the effects of the above. */ - -const char * -darwin_strip_name_encoding (const char *str) -{ - return str[0] == '!' ? str + 4 : str; -} - -/* Scan the list of non-lazy pointers and update any recorded names whose - stripped name matches the argument. */ - -static void -update_non_lazy_ptrs (const char *name) -{ - const char *name1, *name2; - tree temp; - - name1 = darwin_strip_name_encoding (name); - - for (temp = machopic_non_lazy_pointers; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - { - const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - - if (*sym_name == '!') - { - name2 = darwin_strip_name_encoding (sym_name); - if (strcmp (name1, name2) == 0) - { - /* FIXME: This breaks the identifier hash table. */ - IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str - = (unsigned char *) name; - break; - } - } - } -} - -/* Scan the list of stubs and update any recorded names whose - stripped name matches the argument. */ - -static void -update_stubs (const char *name) -{ - const char *name1, *name2; - tree temp; - - name1 = darwin_strip_name_encoding (name); - - for (temp = machopic_stubs; - temp != NULL_TREE; - temp = TREE_CHAIN (temp)) - { - const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - - if (*sym_name == '!') - { - name2 = darwin_strip_name_encoding (sym_name); - if (strcmp (name1, name2) == 0) - { - /* FIXME: This breaks the identifier hash table. */ - IDENTIFIER_NODE_CHECK (TREE_VALUE (temp))->identifier.id.str - = (unsigned char *) name; - break; - } - } - } + if (! TREE_PUBLIC (decl)) + SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC; } void +darwin_mark_decl_preserved (const char *name) +{ + fprintf (asm_out_file, ".no_dead_strip "); + assemble_name (asm_out_file, name); + fputc ('\n', asm_out_file); +} + +int +machopic_reloc_rw_mask (void) +{ + return MACHOPIC_INDIRECT ? 3 : 0; +} + +section * machopic_select_section (tree exp, int reloc, unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { - void (*base_function)(void); + section *base_section; + bool weak_p = (DECL_P (exp) && DECL_WEAK (exp) + && (lookup_attribute ("weak", DECL_ATTRIBUTES (exp)) + || ! lookup_attribute ("weak_import", + DECL_ATTRIBUTES (exp)))); - if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT)) - base_function = readonly_data_section; + if (TREE_CODE (exp) == FUNCTION_DECL) + { + if (reloc == 1) + base_section = (weak_p + ? darwin_sections[text_unlikely_coal_section] + : unlikely_text_section ()); + else + base_section = weak_p ? darwin_sections[text_coal_section] : text_section; + } + else if (decl_readonly_section (exp, reloc)) + base_section = weak_p ? darwin_sections[const_coal_section] : darwin_sections[const_section]; else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) - base_function = const_data_section; + base_section = weak_p ? darwin_sections[const_data_coal_section] : darwin_sections[const_data_section]; else - base_function = data_section; + base_section = weak_p ? darwin_sections[data_coal_section] : data_section; if (TREE_CODE (exp) == STRING_CST && ((size_t) TREE_STRING_LENGTH (exp) - == strlen (TREE_STRING_POINTER (exp)) + 1) - && ! flag_writable_strings) - cstring_section (); + == strlen (TREE_STRING_POINTER (exp)) + 1)) + return darwin_sections[cstring_section]; else if ((TREE_CODE (exp) == INTEGER_CST || TREE_CODE (exp) == REAL_CST) && flag_merge_constants) { - tree size = TYPE_SIZE (TREE_TYPE (exp)); + tree size = TYPE_SIZE_UNIT (TREE_TYPE (exp)); if (TREE_CODE (size) == INTEGER_CST && TREE_INT_CST_LOW (size) == 4 && TREE_INT_CST_HIGH (size) == 0) - literal4_section (); + return darwin_sections[literal4_section]; else if (TREE_CODE (size) == INTEGER_CST && TREE_INT_CST_LOW (size) == 8 && TREE_INT_CST_HIGH (size) == 0) - literal8_section (); + return darwin_sections[literal8_section]; + else if (TARGET_64BIT + && TREE_CODE (size) == INTEGER_CST + && TREE_INT_CST_LOW (size) == 16 + && TREE_INT_CST_HIGH (size) == 0) + return darwin_sections[literal16_section]; else - base_function (); + return base_section; } else if (TREE_CODE (exp) == CONSTRUCTOR && TREE_TYPE (exp) @@ -1165,12 +1158,16 @@ machopic_select_section (tree exp, int reloc, tree name = TYPE_NAME (TREE_TYPE (exp)); if (TREE_CODE (name) == TYPE_DECL) name = DECL_NAME (name); - if (!strcmp (IDENTIFIER_POINTER (name), "NSConstantString")) - objc_constant_string_object_section (); - else if (!strcmp (IDENTIFIER_POINTER (name), "NXConstantString")) - objc_string_object_section (); + + if (!strcmp (IDENTIFIER_POINTER (name), "__builtin_ObjCString")) + { + if (flag_next_runtime) + return darwin_sections[objc_constant_string_object_section]; + else + return darwin_sections[objc_string_object_section]; + } else - base_function (); + return base_section; } else if (TREE_CODE (exp) == VAR_DECL && DECL_NAME (exp) && @@ -1181,87 +1178,95 @@ machopic_select_section (tree exp, int reloc, const char *name = IDENTIFIER_POINTER (DECL_NAME (exp)); if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20)) - objc_cls_meth_section (); + return darwin_sections[objc_cls_meth_section]; else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23)) - objc_inst_meth_section (); + return darwin_sections[objc_inst_meth_section]; else if (!strncmp (name, "_OBJC_CATEGORY_CLASS_METHODS_", 20)) - objc_cat_cls_meth_section (); + return darwin_sections[objc_cat_cls_meth_section]; else if (!strncmp (name, "_OBJC_CATEGORY_INSTANCE_METHODS_", 23)) - objc_cat_inst_meth_section (); + return darwin_sections[objc_cat_inst_meth_section]; else if (!strncmp (name, "_OBJC_CLASS_VARIABLES_", 22)) - objc_class_vars_section (); + return darwin_sections[objc_class_vars_section]; else if (!strncmp (name, "_OBJC_INSTANCE_VARIABLES_", 25)) - objc_instance_vars_section (); + return darwin_sections[objc_instance_vars_section]; else if (!strncmp (name, "_OBJC_CLASS_PROTOCOLS_", 22)) - objc_cat_cls_meth_section (); + return darwin_sections[objc_cat_cls_meth_section]; else if (!strncmp (name, "_OBJC_CLASS_NAME_", 17)) - objc_class_names_section (); + return darwin_sections[objc_class_names_section]; else if (!strncmp (name, "_OBJC_METH_VAR_NAME_", 20)) - objc_meth_var_names_section (); + return darwin_sections[objc_meth_var_names_section]; else if (!strncmp (name, "_OBJC_METH_VAR_TYPE_", 20)) - objc_meth_var_types_section (); + return darwin_sections[objc_meth_var_types_section]; else if (!strncmp (name, "_OBJC_CLASS_REFERENCES", 22)) - objc_cls_refs_section (); + return darwin_sections[objc_cls_refs_section]; else if (!strncmp (name, "_OBJC_CLASS_", 12)) - objc_class_section (); + return darwin_sections[objc_class_section]; else if (!strncmp (name, "_OBJC_METACLASS_", 16)) - objc_meta_class_section (); + return darwin_sections[objc_meta_class_section]; else if (!strncmp (name, "_OBJC_CATEGORY_", 15)) - objc_category_section (); + return darwin_sections[objc_category_section]; else if (!strncmp (name, "_OBJC_SELECTOR_REFERENCES", 25)) - objc_selector_refs_section (); + return darwin_sections[objc_selector_refs_section]; else if (!strncmp (name, "_OBJC_SELECTOR_FIXUP", 20)) - objc_selector_fixup_section (); + return darwin_sections[objc_selector_fixup_section]; else if (!strncmp (name, "_OBJC_SYMBOLS", 13)) - objc_symbols_section (); + return darwin_sections[objc_symbols_section]; else if (!strncmp (name, "_OBJC_MODULES", 13)) - objc_module_info_section (); + return darwin_sections[objc_module_info_section]; else if (!strncmp (name, "_OBJC_IMAGE_INFO", 16)) - objc_image_info_section (); + return darwin_sections[objc_image_info_section]; else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32)) - objc_cat_inst_meth_section (); + return darwin_sections[objc_cat_inst_meth_section]; else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29)) - objc_cat_cls_meth_section (); + return darwin_sections[objc_cat_cls_meth_section]; else if (!strncmp (name, "_OBJC_PROTOCOL_REFS_", 20)) - objc_cat_cls_meth_section (); + return darwin_sections[objc_cat_cls_meth_section]; else if (!strncmp (name, "_OBJC_PROTOCOL_", 15)) - objc_protocol_section (); + return darwin_sections[objc_protocol_section]; else - base_function (); + return base_section; } else - base_function (); + return base_section; } /* This can be called with address expressions as "rtx". They must go in "const". */ -void +section * machopic_select_rtx_section (enum machine_mode mode, rtx x, unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { - if (GET_MODE_SIZE (mode) == 8) - literal8_section (); + if (GET_MODE_SIZE (mode) == 8 + && (GET_CODE (x) == CONST_INT + || GET_CODE (x) == CONST_DOUBLE)) + return darwin_sections[literal8_section]; else if (GET_MODE_SIZE (mode) == 4 && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)) - literal4_section (); + return darwin_sections[literal4_section]; + else if (TARGET_64BIT + && GET_MODE_SIZE (mode) == 16 + && (GET_CODE (x) == CONST_INT + || GET_CODE (x) == CONST_DOUBLE + || GET_CODE (x) == CONST_VECTOR)) + return darwin_sections[literal16_section]; else if (MACHOPIC_INDIRECT && (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST || GET_CODE (x) == LABEL_REF)) - const_data_section (); + return darwin_sections[const_data_section]; else - const_section (); + return darwin_sections[const_section]; } void machopic_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) { if (MACHOPIC_INDIRECT) - mod_init_section (); + switch_to_section (darwin_sections[mod_init_section]); else - constructor_section (); + switch_to_section (darwin_sections[constructor_section]); assemble_align (POINTER_SIZE); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); @@ -1273,9 +1278,9 @@ void machopic_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED) { if (MACHOPIC_INDIRECT) - mod_term_section (); + switch_to_section (darwin_sections[mod_term_section]); else - destructor_section (); + switch_to_section (darwin_sections[destructor_section]); assemble_align (POINTER_SIZE); assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); @@ -1290,13 +1295,168 @@ darwin_globalize_label (FILE *stream, const char *name) default_globalize_label (stream, name); } +void +darwin_asm_named_section (const char *name, + unsigned int flags ATTRIBUTE_UNUSED, + tree decl ATTRIBUTE_UNUSED) +{ + fprintf (asm_out_file, "\t.section %s\n", name); +} + +void +darwin_unique_section (tree decl ATTRIBUTE_UNUSED, int reloc ATTRIBUTE_UNUSED) +{ + /* Darwin does not use unique sections. */ +} + +/* Handle __attribute__ ((apple_kext_compatibility)). + This only applies to darwin kexts for 2.95 compatibility -- it shrinks the + vtable for classes with this attribute (and their descendants) by not + outputting the new 3.0 nondeleting destructor. This means that such + objects CANNOT be allocated on the stack or as globals UNLESS they have + a completely empty `operator delete'. + Luckily, this fits in with the Darwin kext model. + + This attribute also disables gcc3's potential overlaying of derived + class data members on the padding at the end of the base class. */ + +tree +darwin_handle_kext_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + /* APPLE KEXT stuff -- only applies with pure static C++ code. */ + if (! TARGET_KEXTABI) + { + warning (0, "%<%s%> 2.95 vtable-compatability attribute applies " + "only when compiling a kext", IDENTIFIER_POINTER (name)); + + *no_add_attrs = true; + } + else if (TREE_CODE (*node) != RECORD_TYPE) + { + warning (0, "%<%s%> 2.95 vtable-compatability attribute applies " + "only to C++ classes", IDENTIFIER_POINTER (name)); + + *no_add_attrs = true; + } + + return NULL_TREE; +} + +/* Handle a "weak_import" attribute; arguments as in + struct attribute_spec.handler. */ + +tree +darwin_handle_weak_import_attribute (tree *node, tree name, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), + bool * no_add_attrs) +{ + if (TREE_CODE (*node) != FUNCTION_DECL && TREE_CODE (*node) != VAR_DECL) + { + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else + declare_weak (*node); + + return NULL_TREE; +} + +static void +no_dead_strip (FILE *file, const char *lab) +{ + fprintf (file, ".no_dead_strip %s\n", lab); +} + +/* Emit a label for an FDE, making it global and/or weak if appropriate. + The third parameter is nonzero if this is for exception handling. + The fourth parameter is nonzero if this is just a placeholder for an + FDE that we are omitting. */ + +void +darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty) +{ + const char *base; + char *lab; + bool need_quotes; + + if (DECL_ASSEMBLER_NAME_SET_P (decl)) + base = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + else + base = IDENTIFIER_POINTER (DECL_NAME (decl)); + + base = targetm.strip_name_encoding (base); + need_quotes = name_needs_quotes (base); + + if (! for_eh) + return; + + lab = concat (need_quotes ? "\"" : "", user_label_prefix, base, ".eh", + need_quotes ? "\"" : "", NULL); + + if (TREE_PUBLIC (decl)) + fprintf (file, "\t%s %s\n", + (DECL_VISIBILITY (decl) != VISIBILITY_HIDDEN + ? ".globl" + : ".private_extern"), + lab); + + if (DECL_WEAK (decl)) + fprintf (file, "\t.weak_definition %s\n", lab); + + if (empty) + { + fprintf (file, "%s = 0\n", lab); + + /* Mark the absolute .eh and .eh1 style labels as needed to + ensure that we don't dead code strip them and keep such + labels from another instantiation point until we can fix this + properly with group comdat support. */ + no_dead_strip (file, lab); + } + else + fprintf (file, "%s:\n", lab); + + free (lab); +} + +static GTY(()) unsigned long except_table_label_num; + +void +darwin_emit_except_table_label (FILE *file) +{ + char section_start_label[30]; + + ASM_GENERATE_INTERNAL_LABEL (section_start_label, "GCC_except_table", + except_table_label_num++); + ASM_OUTPUT_LABEL (file, section_start_label); +} +/* Generate a PC-relative reference to a Mach-O non-lazy-symbol. */ + +void +darwin_non_lazy_pcrel (FILE *file, rtx addr) +{ + const char *nlp_name; + + gcc_assert (GET_CODE (addr) == SYMBOL_REF); + + nlp_name = machopic_indirection_name (addr, /*stub_p=*/false); + fputs ("\t.long\t", file); + ASM_OUTPUT_LABELREF (file, nlp_name); + fputs ("-.", file); +} + /* Emit an assembler directive to set visibility for a symbol. The only supported visibilities are VISIBILITY_DEFAULT and VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private extern". There is no MACH-O equivalent of ELF's VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */ -void +void darwin_assemble_visibility (tree decl, int vis) { if (vis == VISIBILITY_DEFAULT) @@ -1309,8 +1469,8 @@ darwin_assemble_visibility (tree decl, int vis) fputs ("\n", asm_out_file); } else - warning ("internal and protected visibility attributes not supported" - "in this configuration; ignored"); + warning (OPT_Wattributes, "internal and protected visibility attributes " + "not supported in this configuration; ignored"); } /* Output a difference of two labels that will be an assembly time @@ -1323,21 +1483,79 @@ darwin_assemble_visibility (tree decl, int vis) static int darwin_dwarf_label_counter; void -darwin_asm_output_dwarf_delta (FILE *file, int size ATTRIBUTE_UNUSED, +darwin_asm_output_dwarf_delta (FILE *file, int size, const char *lab1, const char *lab2) { - const char *p = lab1 + (lab1[0] == '*'); - int islocaldiff = (p[0] == 'L'); + int islocaldiff = (lab1[0] == '*' && lab1[1] == 'L' + && lab2[0] == '*' && lab2[1] == 'L'); + const char *directive = (size == 8 ? ".quad" : ".long"); if (islocaldiff) fprintf (file, "\t.set L$set$%d,", darwin_dwarf_label_counter); else - fprintf (file, "\t%s\t", ".long"); - assemble_name (file, lab1); + fprintf (file, "\t%s\t", directive); + assemble_name_raw (file, lab1); fprintf (file, "-"); - assemble_name (file, lab2); + assemble_name_raw (file, lab2); if (islocaldiff) - fprintf (file, "\n\t.long L$set$%d", darwin_dwarf_label_counter++); + fprintf (file, "\n\t%s L$set$%d", directive, darwin_dwarf_label_counter++); +} + +/* Output labels for the start of the DWARF sections if necessary. */ +void +darwin_file_start (void) +{ + if (write_symbols == DWARF2_DEBUG) + { + static const char * const debugnames[] = + { + DEBUG_FRAME_SECTION, + DEBUG_INFO_SECTION, + DEBUG_ABBREV_SECTION, + DEBUG_ARANGES_SECTION, + DEBUG_MACINFO_SECTION, + DEBUG_LINE_SECTION, + DEBUG_LOC_SECTION, + DEBUG_PUBNAMES_SECTION, + DEBUG_STR_SECTION, + DEBUG_RANGES_SECTION + }; + size_t i; + + for (i = 0; i < ARRAY_SIZE (debugnames); i++) + { + int namelen; + + switch_to_section (get_section (debugnames[i], SECTION_DEBUG, NULL)); + + gcc_assert (strncmp (debugnames[i], "__DWARF,", 8) == 0); + gcc_assert (strchr (debugnames[i] + 8, ',')); + + namelen = strchr (debugnames[i] + 8, ',') - (debugnames[i] + 8); + fprintf (asm_out_file, "Lsection%.*s:\n", namelen, debugnames[i] + 8); + } + } +} + +/* Output an offset in a DWARF section on Darwin. On Darwin, DWARF section + offsets are not represented using relocs in .o files; either the + section never leaves the .o file, or the linker or other tool is + responsible for parsing the DWARF and updating the offsets. */ + +void +darwin_asm_output_dwarf_offset (FILE *file, int size, const char * lab, + section *base) +{ + char sname[64]; + int namelen; + + gcc_assert (base->common.flags & SECTION_NAMED); + gcc_assert (strncmp (base->named.name, "__DWARF,", 8) == 0); + gcc_assert (strchr (base->named.name + 8, ',')); + + namelen = strchr (base->named.name + 8, ',') - (base->named.name + 8); + sprintf (sname, "*Lsection%.*s", namelen, base->named.name + 8); + darwin_asm_output_dwarf_delta (file, size, lab, sname); } void @@ -1346,10 +1564,81 @@ darwin_file_end (void) machopic_finish (asm_out_file); if (strcmp (lang_hooks.name, "GNU C++") == 0) { - constructor_section (); - destructor_section (); + switch_to_section (darwin_sections[constructor_section]); + switch_to_section (darwin_sections[destructor_section]); ASM_OUTPUT_ALIGN (asm_out_file, 1); } + fprintf (asm_out_file, "\t.subsections_via_symbols\n"); +} + +/* TODO: Add a language hook for identifying if a decl is a vtable. */ +#define DARWIN_VTABLE_P(DECL) 0 + +/* Cross-module name binding. Darwin does not support overriding + functions at dynamic-link time, except for vtables in kexts. */ + +bool +darwin_binds_local_p (tree decl) +{ + return default_binds_local_p_1 (decl, + TARGET_KEXTABI && DARWIN_VTABLE_P (decl)); +} + +#if 0 +/* See TARGET_ASM_OUTPUT_ANCHOR for why we can't do this yet. */ +/* The Darwin's implementation of TARGET_ASM_OUTPUT_ANCHOR. Define the + anchor relative to ".", the current section position. We cannot use + the default one because ASM_OUTPUT_DEF is wrong for Darwin. */ + +void +darwin_asm_output_anchor (rtx symbol) +{ + fprintf (asm_out_file, "\t.set\t"); + assemble_name (asm_out_file, XSTR (symbol, 0)); + fprintf (asm_out_file, ", . + " HOST_WIDE_INT_PRINT_DEC "\n", + SYMBOL_REF_BLOCK_OFFSET (symbol)); +} +#endif + +/* Set the darwin specific attributes on TYPE. */ +void +darwin_set_default_type_attributes (tree type) +{ + if (darwin_ms_struct + && TREE_CODE (type) == RECORD_TYPE) + TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("ms_struct"), + NULL_TREE, + TYPE_ATTRIBUTES (type)); +} + +/* True, iff we're generating code for loadable kernel extentions. */ + +bool +darwin_kextabi_p (void) { + return flag_apple_kext; +} + +void +darwin_override_options (void) +{ + if (flag_apple_kext && strcmp (lang_hooks.name, "GNU C++") != 0) + { + warning (0, "command line option %<-fapple-kext%> is only valid for C++"); + flag_apple_kext = 0; + } + if (flag_mkernel || flag_apple_kext) + { + /* -mkernel implies -fapple-kext for C++ */ + if (strcmp (lang_hooks.name, "GNU C++") == 0) + flag_apple_kext = 1; + + flag_no_common = 1; + + /* No EH in kexts. */ + flag_exceptions = 0; + /* No -fnon-call-exceptions data in kexts. */ + flag_non_call_exceptions = 0; + } } #include "gt-darwin.h" diff --git a/contrib/gcc/config/darwin.h b/contrib/gcc/config/darwin.h index c6ff93f5619..9467badb5fc 100644 --- a/contrib/gcc/config/darwin.h +++ b/contrib/gcc/config/darwin.h @@ -1,5 +1,6 @@ /* Target definitions for Darwin (Mac OS X) systems. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003 + Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -17,8 +18,11 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#ifndef CONFIG_DARWIN_H +#define CONFIG_DARWIN_H /* The definitions in this file are common to all processor types running Darwin, which is the kernel for Mac OS X. Darwin is @@ -30,21 +34,13 @@ Boston, MA 02111-1307, USA. */ /* Although NeXT ran on many different architectures, as of Jan 2001 the only supported Darwin targets are PowerPC and x86. */ -/* Technically, STANDARD_EXEC_PREFIX should be /usr/libexec/, but in - practice this makes it hard to install new compilers elsewhere, so - leave it undefined and expect system builders to set configure args - correctly. */ - /* One of Darwin's NeXT legacies is the Mach-O format, which is partly like a.out and partly like COFF, with additional features like multi-architecture binary support. */ #define OBJECT_FORMAT_MACHO -/* Suppress g++ attempt to link in the math library automatically. - (Some Darwin versions have a libm, but they seem to cause problems - for C++ executables.) */ - +/* Suppress g++ attempt to link in the math library automatically. */ #define MATH_LIBRARY "" /* We have atexit. */ @@ -84,6 +80,9 @@ Boston, MA 02111-1307, USA. */ #undef DEFAULT_PCC_STRUCT_RETURN #define DEFAULT_PCC_STRUCT_RETURN 0 +/* True if pragma ms_struct is in effect. */ +extern GTY(()) int darwin_ms_struct; + /* This table intercepts weirdo options whose names would interfere with normal driver conventions, and either translates them into standardly-named options, or adds a 'Z' so that they can get to @@ -114,27 +113,45 @@ Boston, MA 02111-1307, USA. */ { "-bundle", "-Zbundle" }, \ { "-bundle_loader", "-Zbundle_loader" }, \ { "-weak_reference_mismatches", "-Zweak_reference_mismatches" }, \ + { "-dead_strip", "-Zdead_strip" }, \ + { "-no_dead_strip_inits_and_terms", "-Zno_dead_strip_inits_and_terms" }, \ { "-dependency-file", "-MF" }, \ { "-dylib_file", "-Zdylib_file" }, \ { "-dynamic", "-Zdynamic" }, \ { "-dynamiclib", "-Zdynamiclib" }, \ { "-exported_symbols_list", "-Zexported_symbols_list" }, \ - { "-seg_addr_table_filename", "-Zseg_addr_table_filename" }, \ + { "-gfull", "-g -fno-eliminate-unused-debug-symbols" }, \ + { "-gused", "-g -feliminate-unused-debug-symbols" }, \ + { "-segaddr", "-Zsegaddr" }, \ + { "-segs_read_only_addr", "-Zsegs_read_only_addr" }, \ + { "-segs_read_write_addr", "-Zsegs_read_write_addr" }, \ + { "-seg_addr_table", "-Zseg_addr_table" }, \ + { "-seg_addr_table_filename", "-Zfn_seg_addr_table_filename" }, \ + { "-fapple-kext", "-fapple-kext -static -Wa,-static" }, \ { "-filelist", "-Xlinker -filelist -Xlinker" }, \ + { "-findirect-virtual-calls", "-fapple-kext" }, \ { "-flat_namespace", "-Zflat_namespace" }, \ { "-force_cpusubtype_ALL", "-Zforce_cpusubtype_ALL" }, \ { "-force_flat_namespace", "-Zforce_flat_namespace" }, \ + { "-framework", "-Xlinker -framework -Xlinker" }, \ + { "-fterminated-vtables", "-fapple-kext" }, \ { "-image_base", "-Zimage_base" }, \ { "-init", "-Zinit" }, \ { "-install_name", "-Zinstall_name" }, \ + { "-mkernel", "-mkernel -static -Wa,-static" }, \ { "-multiply_defined_unused", "-Zmultiplydefinedunused" }, \ { "-multiply_defined", "-Zmultiply_defined" }, \ { "-multi_module", "-Zmulti_module" }, \ { "-static", "-static -Wa,-static" }, \ { "-single_module", "-Zsingle_module" }, \ - { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \ + { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \ SUBTARGET_OPTION_TRANSLATE_TABLE +#define SUBSUBTARGET_OVERRIDE_OPTIONS \ + do { \ + darwin_override_options (); \ + } while (0) + /* These compiler options take n arguments. */ #undef WORD_SWITCH_TAKES_ARG @@ -158,10 +175,13 @@ Boston, MA 02111-1307, USA. */ !strcmp (STR, "read_only_relocs") ? 1 : \ !strcmp (STR, "sectcreate") ? 3 : \ !strcmp (STR, "sectorder") ? 3 : \ - !strcmp (STR, "Zseg_addr_table_filename") ?1 :\ + !strcmp (STR, "Zsegaddr") ? 2 : \ + !strcmp (STR, "Zsegs_read_only_addr") ? 1 : \ + !strcmp (STR, "Zsegs_read_write_addr") ? 1 : \ + !strcmp (STR, "Zseg_addr_table") ? 1 : \ + !strcmp (STR, "Zfn_seg_addr_table_filename") ? 1 :\ !strcmp (STR, "seg1addr") ? 1 : \ !strcmp (STR, "segprot") ? 3 : \ - !strcmp (STR, "seg_addr_table") ? 1 : \ !strcmp (STR, "sub_library") ? 1 : \ !strcmp (STR, "sub_umbrella") ? 1 : \ !strcmp (STR, "umbrella") ? 1 : \ @@ -177,10 +197,25 @@ Boston, MA 02111-1307, USA. */ !strcmp (STR, "dylinker_install_name") ? 1 : \ 0) -/* Machine dependent cpp options. */ +#define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do { \ + if (flag_mkernel || flag_apple_kext) \ + { \ + if (flag_use_cxa_atexit == 2) \ + flag_use_cxa_atexit = 0; \ + /* kexts should always be built without the coalesced sections \ + because the kernel loader doesn't grok such sections. */ \ + flag_weak = 0; \ + /* No RTTI in kexts. */ \ + flag_rtti = 0; \ + } \ + } while (0) + +/* Machine dependent cpp options. Don't add more options here, add + them to darwin_cpp_builtins in darwin-c.c. */ #undef CPP_SPEC -#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" +#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" \ + " %{pthread:-D_REENTRANT}" /* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus precomp, libtool, and fat build additions. Also we @@ -193,16 +228,21 @@ Boston, MA 02111-1307, USA. */ #define LINK_COMMAND_SPEC "\ %{!fdump=*:%{!fsyntax-only:%{!precomp:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %{!Zdynamiclib:%(linker)}%{Zdynamiclib:/usr/bin/libtool} \ - %{!Zdynamiclib:-arch %(darwin_arch)} \ - %{Zdynamiclib:-arch_only %(darwin_arch)} \ %l %X %{d} %{s} %{t} %{Z} \ %{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \ %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \ - %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \ - %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \ - %{!nostdlib:%{!nodefaultlibs:%G %L}} \ - %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} \ - %{!--help:%{!no-c++filt|c++filt:| c++filt }} }}}}}}}}" + %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ + %{L*} %{fopenmp:%:include(libgomp.spec)%(link_gomp)} \ + %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \ + %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \ + %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}" + +#ifdef TARGET_SYSTEM_ROOT +#define LINK_SYSROOT_SPEC \ + "%{isysroot*:-syslibroot %*;:-syslibroot " TARGET_SYSTEM_ROOT "}" +#else +#define LINK_SYSROOT_SPEC "%{isysroot*:-syslibroot %*}" +#endif /* Please keep the random linker options in alphabetical order (modulo 'Z' and 'no' prefixes). Options that can only go to one of libtool @@ -213,14 +253,16 @@ Boston, MA 02111-1307, USA. */ their names so all of them get passed. */ #define LINK_SPEC \ "%{static}%{!static:-dynamic} \ + %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\ %{!Zdynamiclib: \ + %{Zforce_cpusubtype_ALL:-arch %(darwin_arch) -force_cpusubtype_ALL} \ + %{!Zforce_cpusubtype_ALL:-arch %(darwin_subarch)} \ %{Zbundle:-bundle} \ %{Zbundle_loader*:-bundle_loader %*} \ %{client_name*} \ %{compatibility_version*:%e-compatibility_version only allowed with -dynamiclib\ } \ %{current_version*:%e-current_version only allowed with -dynamiclib} \ - %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ %{Zforce_flat_namespace:-force_flat_namespace} \ %{Zinstall_name*:%e-install_name only allowed with -dynamiclib} \ %{keep_private_externs} \ @@ -232,7 +274,8 @@ Boston, MA 02111-1307, USA. */ %{client_name*:%e-client_name not allowed with -dynamiclib} \ %{compatibility_version*} \ %{current_version*} \ - %{Zforce_cpusubtype_ALL:%e-force_cpusubtype_ALL not allowed with -dynamiclib} \ + %{Zforce_cpusubtype_ALL:-arch_only %(darwin_arch)} \ + %{!Zforce_cpusubtype_ALL: -arch_only %(darwin_subarch)} \ %{Zforce_flat_namespace:%e-force_flat_namespace not allowed with -dynamiclib} \ %{Zinstall_name*:-install_name %*} \ %{keep_private_externs:%e-keep_private_externs not allowed with -dynamiclib} \ @@ -242,6 +285,8 @@ Boston, MA 02111-1307, USA. */ %{Zallowable_client*:-allowable_client %*} \ %{Zbind_at_load:-bind_at_load} \ %{Zarch_errors_fatal:-arch_errors_fatal} \ + %{Zdead_strip:-dead_strip} \ + %{Zno_dead_strip_inits_and_terms:-no_dead_strip_inits_and_terms} \ %{Zdylib_file*:-dylib_file %*} \ %{Zdynamic:-dynamic}\ %{Zexported_symbols_list*:-exported_symbols_list %*} \ @@ -249,20 +294,31 @@ Boston, MA 02111-1307, USA. */ %{headerpad_max_install_names*} \ %{Zimage_base*:-image_base %*} \ %{Zinit*:-init %*} \ + %{mmacosx-version-min=*:-macosx_version_min %*} \ + %{!mmacosx-version-min=*:%{shared-libgcc:-macosx_version_min 10.3}} \ %{nomultidefs} \ %{Zmulti_module:-multi_module} %{Zsingle_module:-single_module} \ %{Zmultiply_defined*:-multiply_defined %*} \ + %{!Zmultiply_defined*:%{shared-libgcc: \ + %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \ + %:version-compare(< 10.5 mmacosx-version-min= suppress)}} \ %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \ %{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \ %{read_only_relocs} \ - %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} %{seg_addr_table*} \ - %{Zseg_addr_table_filename*:-seg_addr_table_filename %*} \ + %{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \ + %{Zsegaddr*:-segaddr %*} \ + %{Zsegs_read_only_addr*:-segs_read_only_addr %*} \ + %{Zsegs_read_write_addr*:-segs_read_write_addr %*} \ + %{Zseg_addr_table*: -seg_addr_table %*} \ + %{Zfn_seg_addr_table_filename*:-seg_addr_table_filename %*} \ %{sub_library*} %{sub_umbrella*} \ + " LINK_SYSROOT_SPEC " \ %{twolevel_namespace} %{twolevel_namespace_hints} \ %{umbrella*} \ %{undefined*} \ %{Zunexported_symbols_list*:-unexported_symbols_list %*} \ %{Zweak_reference_mismatches*:-weak_reference_mismatches %*} \ + %{!Zweak_reference_mismatches*:-weak_reference_mismatches non-weak} \ %{X} \ %{y*} \ %{w} \ @@ -274,32 +330,80 @@ Boston, MA 02111-1307, USA. */ /* Machine dependent libraries. */ -#undef LIB_SPEC #define LIB_SPEC "%{!static:-lSystem}" -/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ +/* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib + libraries to link against, and by not linking against libgcc_s on + earlier-than-10.3.9. + + Note that by default, -lgcc_eh is not linked against! This is + because in a future version of Darwin the EH frame information may + be in a new format, or the fallback routine might be changed; if + you want to explicitly link against the static version of those + routines, because you know you don't need to unwind through system + libraries, you need to explicitly say -static-libgcc. + + If it is linked against, it has to be before -lgcc, because it may + need symbols from -lgcc. */ +#undef REAL_LIBGCC_SPEC +#define REAL_LIBGCC_SPEC \ + "%{static-libgcc|static: -lgcc_eh -lgcc; \ + shared-libgcc|fexceptions|fgnu-runtime: \ + %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ + %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \ + -lgcc; \ + :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \ + %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_s.10.5) \ + -lgcc}" + +/* We specify crt0.o as -lcrt0.o so that ld will search the library path. + + crt3.o provides __cxa_atexit on systems that don't have it. Since + it's only used with C++, which requires passing -shared-libgcc, key + off that to avoid unnecessarily adding a destructor to every + powerpc program built. */ #undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!Zdynamiclib:%{Zbundle:%{!static:-lbundle1.o}} \ - %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ - %{!static:%{object:-lgcrt0.o} \ - %{!object:%{preload:-lgcrt0.o} \ - %{!preload:-lgcrt1.o -lcrt2.o}}}} \ - %{!pg:%{static:-lcrt0.o} \ - %{!static:%{object:-lcrt0.o} \ - %{!object:%{preload:-lcrt0.o} \ - %{!preload:-lcrt1.o -lcrt2.o}}}}}}" +#define STARTFILE_SPEC \ + "%{!Zdynamiclib:%{Zbundle:%{!static:-lbundle1.o}} \ + %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ + %{!static:%{object:-lgcrt0.o} \ + %{!object:%{preload:-lgcrt0.o} \ + %{!preload:-lgcrt1.o %(darwin_crt2)}}}} \ + %{!pg:%{static:-lcrt0.o} \ + %{!static:%{object:-lcrt0.o} \ + %{!object:%{preload:-lcrt0.o} \ + %{!preload:-lcrt1.o %(darwin_crt2)}}}}}} \ + %{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}" /* The native Darwin linker doesn't necessarily place files in the order that they're specified on the link line. Thus, it is pointless to put anything in ENDFILE_SPEC. */ /* #define ENDFILE_SPEC "" */ +/* Default Darwin ASM_SPEC, very simple. */ +#define ASM_SPEC "-arch %(darwin_arch) \ + %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL}" + /* We use Dbx symbol format. */ #define DBX_DEBUGGING_INFO 1 +/* Also enable Dwarf 2 as an option. */ +#define DWARF2_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + +#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" +#define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug" +#define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug" +#define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug" +#define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug" +#define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug" +#define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug" +#define DEBUG_PUBNAMES_SECTION "__DWARF,__debug_pubnames,regular,debug" +#define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" +#define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" + /* When generating stabs debugging, use N_BINCL entries. */ #define DBX_USE_BINCL @@ -310,12 +414,76 @@ Boston, MA 02111-1307, USA. */ /* gdb needs a null N_SO at the end of each file for scattered loading. */ -#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ -do { text_section (); \ - fprintf (FILE, \ - "\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", "" , N_SO); \ - } while (0) +#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END + +/* GCC's definition of 'one_only' is the same as its definition of 'weak'. */ +#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) + +/* Mach-O supports 'weak imports', and 'weak definitions' in coalesced + sections. machopic_select_section ensures that weak variables go in + coalesced sections. Weak aliases (or any other kind of aliases) are + not supported. Weak symbols that aren't visible outside the .s file + are not supported. */ +#define ASM_WEAKEN_DECL(FILE, DECL, NAME, ALIAS) \ + do { \ + if (ALIAS) \ + { \ + warning (0, "alias definitions not supported in Mach-O; ignored"); \ + break; \ + } \ + \ + if (! DECL_EXTERNAL (DECL) && TREE_PUBLIC (DECL)) \ + targetm.asm_out.globalize_label (FILE, NAME); \ + if (DECL_EXTERNAL (DECL)) \ + fputs ("\t.weak_reference ", FILE); \ + else if (! lookup_attribute ("weak", DECL_ATTRIBUTES (DECL)) \ + && lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL))) \ + break; \ + else if (TREE_PUBLIC (DECL)) \ + fputs ("\t.weak_definition ", FILE); \ + else \ + break; \ + assemble_name (FILE, NAME); \ + fputc ('\n', FILE); \ + } while (0) + +/* Darwin has the pthread routines in libSystem, which every program + links to, so there's no need for weak-ness for that. */ +#define GTHREAD_USE_WEAK 0 + +/* The Darwin linker imposes two limitations on common symbols: they + can't have hidden visibility, and they can't appear in dylibs. As + a consequence, we should never use common symbols to represent + vague linkage. */ +#undef USE_COMMON_FOR_ONE_ONLY +#define USE_COMMON_FOR_ONE_ONLY 0 + +/* The Darwin linker doesn't want coalesced symbols to appear in + a static archive's table of contents. */ +#undef TARGET_WEAK_NOT_IN_ARCHIVE_TOC +#define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 1 + +/* On Darwin, we don't (at the time of writing) have linkonce sections + with names, so it's safe to make the class data not comdat. */ +#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false + +/* We make exception information linkonce. */ +#undef TARGET_USES_WEAK_UNWIND_INFO +#define TARGET_USES_WEAK_UNWIND_INFO 1 + +/* We need to use a nonlocal label for the start of an EH frame: the + Darwin linker requires that a coalesced section start with a label. + Unfortunately, it also requires that 'debug' sections don't contain + labels. */ +#undef FRAME_BEGIN_LABEL +#define FRAME_BEGIN_LABEL (for_eh ? "EH_frame" : "Lframe") + +/* Emit a label for the FDE corresponding to DECL. EMPTY means + emit a label for an empty FDE. */ +#define TARGET_ASM_EMIT_UNWIND_LABEL darwin_emit_unwind_label + +/* Emit a label to separate the exception table. */ +#define TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL darwin_emit_except_table_label /* Our profiling scheme doesn't LP labels and counter words. */ @@ -358,7 +526,7 @@ do { text_section (); \ /* The RTTI data (e.g., __ti4name) is common and public (and static), but it does need to be referenced via indirect PIC data pointers. - The machopic_define_name calls are telling the machopic subsystem + The machopic_define_symbol calls are telling the machopic subsystem that the name *is* defined in this module, so it doesn't need to make them indirect. */ @@ -368,35 +536,37 @@ do { text_section (); \ const char *xname = NAME; \ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ - if ((TREE_STATIC (DECL) \ - && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ - || DECL_INITIAL (DECL)) \ - machopic_define_name (xname); \ + if (! DECL_WEAK (DECL) \ + && ((TREE_STATIC (DECL) \ + && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ + || DECL_INITIAL (DECL))) \ + machopic_define_symbol (DECL_RTL (DECL)); \ if ((TREE_STATIC (DECL) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ || DECL_INITIAL (DECL)) \ (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ ASM_OUTPUT_LABEL (FILE, xname); \ - /* Darwin doesn't support zero-size objects, so give them a \ + /* Darwin doesn't support zero-size objects, so give them a \ byte. */ \ if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0) \ assemble_zeros (1); \ } while (0) -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ +#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { \ - const char *xname = NAME; \ - if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ - xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ - if ((TREE_STATIC (DECL) \ - && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ - || DECL_INITIAL (DECL)) \ - machopic_define_name (xname); \ - if ((TREE_STATIC (DECL) \ - && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ - || DECL_INITIAL (DECL)) \ + const char *xname = NAME; \ + if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ + xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ + if (! DECL_WEAK (DECL) \ + && ((TREE_STATIC (DECL) \ + && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ + || DECL_INITIAL (DECL))) \ + machopic_define_symbol (DECL_RTL (DECL)); \ + if ((TREE_STATIC (DECL) \ + && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ + || DECL_INITIAL (DECL)) \ (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ - ASM_OUTPUT_LABEL (FILE, xname); \ + ASM_OUTPUT_LABEL (FILE, xname); \ } while (0) #define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \ @@ -414,19 +584,24 @@ do { text_section (); \ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF(FILE,NAME) \ do { \ - const char *xname = darwin_strip_name_encoding (NAME); \ + const char *xname = (NAME); \ if (! strcmp (xname, "")) \ machopic_output_function_base_name(FILE); \ else if (xname[0] == '&' || xname[0] == '*') \ { \ int len = strlen (xname); \ if (len > 6 && !strcmp ("$stub", xname + len - 5)) \ - machopic_validate_stub_or_non_lazy_ptr (xname, 1); \ + machopic_validate_stub_or_non_lazy_ptr (xname); \ else if (len > 7 && !strcmp ("$stub\"", xname + len - 6)) \ - machopic_validate_stub_or_non_lazy_ptr (xname, 1); \ + machopic_validate_stub_or_non_lazy_ptr (xname); \ else if (len > 14 && !strcmp ("$non_lazy_ptr", xname + len - 13)) \ - machopic_validate_stub_or_non_lazy_ptr (xname, 0); \ - fputs (&xname[1], FILE); \ + machopic_validate_stub_or_non_lazy_ptr (xname); \ + else if (len > 15 && !strcmp ("$non_lazy_ptr\"", xname + len - 14)) \ + machopic_validate_stub_or_non_lazy_ptr (xname); \ + if (xname[1] != '"' && name_needs_quotes (&xname[1])) \ + fprintf (FILE, "\"%s\"", &xname[1]); \ + else \ + fputs (&xname[1], FILE); \ } \ else if (xname[0] == '+' || xname[0] == '-') \ fprintf (FILE, "\"%s\"", xname); \ @@ -434,18 +609,20 @@ do { text_section (); \ fprintf (FILE, "L%s", xname); \ else if (!strncmp (xname, ".objc_class_name_", 17)) \ fprintf (FILE, "%s", xname); \ + else if (xname[0] != '"' && name_needs_quotes (xname)) \ + fprintf (FILE, "\"%s\"", xname); \ else \ - fprintf (FILE, "_%s", xname); \ + asm_fprintf (FILE, "%U%s", xname); \ } while (0) /* Output before executable code. */ #undef TEXT_SECTION_ASM_OP -#define TEXT_SECTION_ASM_OP ".text" +#define TEXT_SECTION_ASM_OP "\t.text" /* Output before writable data. */ #undef DATA_SECTION_ASM_OP -#define DATA_SECTION_ASM_OP ".data" +#define DATA_SECTION_ASM_OP "\t.data" #undef ALIGN_ASM_OP #define ALIGN_ASM_OP ".align" @@ -460,231 +637,51 @@ do { text_section (); \ #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ do { \ + unsigned HOST_WIDE_INT _new_size = SIZE; \ fputs (".lcomm ", (FILE)); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ + if (_new_size == 0) _new_size = 1; \ + fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", _new_size, \ floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ if ((DECL) && ((TREE_STATIC (DECL) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ || DECL_INITIAL (DECL))) \ - (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ - if ((DECL) && ((TREE_STATIC (DECL) \ - && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ - || DECL_INITIAL (DECL))) \ - machopic_define_name (NAME); \ + { \ + (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ + machopic_define_symbol (DECL_RTL (DECL)); \ + } \ } while (0) -/* The maximum alignment which the object file format can support. - For Mach-O, this is 2^15. */ +/* The maximum alignment which the object file format can support in + bits. For Mach-O, this is 2^15 bytes. */ #undef MAX_OFILE_ALIGNMENT -#define MAX_OFILE_ALIGNMENT 0x8000 +#define MAX_OFILE_ALIGNMENT (0x8000 * 8) -/* Create new Mach-O sections. */ - -#undef SECTION_FUNCTION -#define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, OBJC) \ -extern void FUNCTION (void); \ -void \ -FUNCTION (void) \ -{ \ - if (in_section != SECTION) \ - { \ - if (OBJC) \ - objc_section_init (); \ - data_section (); \ - if (asm_out_file) \ - fprintf (asm_out_file, "%s\n", DIRECTIVE); \ - in_section = SECTION; \ - } \ -} \ - -/* Darwin uses many types of special sections. */ - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS \ - in_const, in_const_data, in_cstring, in_literal4, in_literal8, \ - in_constructor, in_destructor, in_mod_init, in_mod_term, \ - in_objc_class, in_objc_meta_class, in_objc_category, \ - in_objc_class_vars, in_objc_instance_vars, \ - in_objc_cls_meth, in_objc_inst_meth, \ - in_objc_cat_cls_meth, in_objc_cat_inst_meth, \ - in_objc_selector_refs, \ - in_objc_selector_fixup, \ - in_objc_symbols, in_objc_module_info, \ - in_objc_protocol, in_objc_string_object, \ - in_objc_constant_string_object, \ - in_objc_image_info, \ - in_objc_class_names, in_objc_meth_var_names, \ - in_objc_meth_var_types, in_objc_cls_refs, \ - in_machopic_nl_symbol_ptr, \ - in_machopic_lazy_symbol_ptr, \ - in_machopic_symbol_stub, \ - in_machopic_symbol_stub1, \ - in_machopic_picsymbol_stub, \ - in_machopic_picsymbol_stub1, \ - in_darwin_exception, in_darwin_eh_frame, \ - num_sections - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ -static void objc_section_init (void); \ -SECTION_FUNCTION (const_section, \ - in_const, \ - ".const", 0) \ -SECTION_FUNCTION (const_data_section, \ - in_const_data, \ - ".const_data", 0) \ -SECTION_FUNCTION (cstring_section, \ - in_cstring, \ - ".cstring", 0) \ -SECTION_FUNCTION (literal4_section, \ - in_literal4, \ - ".literal4", 0) \ -SECTION_FUNCTION (literal8_section, \ - in_literal8, \ - ".literal8", 0) \ -SECTION_FUNCTION (constructor_section, \ - in_constructor, \ - ".constructor", 0) \ -SECTION_FUNCTION (mod_init_section, \ - in_mod_init, \ - ".mod_init_func", 0) \ -SECTION_FUNCTION (mod_term_section, \ - in_mod_term, \ - ".mod_term_func", 0) \ -SECTION_FUNCTION (destructor_section, \ - in_destructor, \ - ".destructor", 0) \ -SECTION_FUNCTION (objc_class_section, \ - in_objc_class, \ - ".objc_class", 1) \ -SECTION_FUNCTION (objc_meta_class_section, \ - in_objc_meta_class, \ - ".objc_meta_class", 1) \ -SECTION_FUNCTION (objc_category_section, \ - in_objc_category, \ - ".objc_category", 1) \ -SECTION_FUNCTION (objc_class_vars_section, \ - in_objc_class_vars, \ - ".objc_class_vars", 1) \ -SECTION_FUNCTION (objc_instance_vars_section, \ - in_objc_instance_vars, \ - ".objc_instance_vars", 1) \ -SECTION_FUNCTION (objc_cls_meth_section, \ - in_objc_cls_meth, \ - ".objc_cls_meth", 1) \ -SECTION_FUNCTION (objc_inst_meth_section, \ - in_objc_inst_meth, \ - ".objc_inst_meth", 1) \ -SECTION_FUNCTION (objc_cat_cls_meth_section, \ - in_objc_cat_cls_meth, \ - ".objc_cat_cls_meth", 1) \ -SECTION_FUNCTION (objc_cat_inst_meth_section, \ - in_objc_cat_inst_meth, \ - ".objc_cat_inst_meth", 1) \ -SECTION_FUNCTION (objc_selector_refs_section, \ - in_objc_selector_refs, \ - ".objc_message_refs", 1) \ -SECTION_FUNCTION (objc_selector_fixup_section, \ - in_objc_selector_fixup, \ - ".section __OBJC, __sel_fixup", 1) \ -SECTION_FUNCTION (objc_symbols_section, \ - in_objc_symbols, \ - ".objc_symbols", 1) \ -SECTION_FUNCTION (objc_module_info_section, \ - in_objc_module_info, \ - ".objc_module_info", 1) \ -SECTION_FUNCTION (objc_protocol_section, \ - in_objc_protocol, \ - ".objc_protocol", 1) \ -SECTION_FUNCTION (objc_string_object_section, \ - in_objc_string_object, \ - ".objc_string_object", 1) \ -SECTION_FUNCTION (objc_constant_string_object_section, \ - in_objc_constant_string_object, \ - ".section __OBJC, __cstring_object", 1) \ -/* Fix-and-Continue image marker. */ \ -SECTION_FUNCTION (objc_image_info_section, \ - in_objc_image_info, \ - ".section __OBJC, __image_info", 1) \ -SECTION_FUNCTION (objc_class_names_section, \ - in_objc_class_names, \ - ".objc_class_names", 1) \ -SECTION_FUNCTION (objc_meth_var_names_section, \ - in_objc_meth_var_names, \ - ".objc_meth_var_names", 1) \ -SECTION_FUNCTION (objc_meth_var_types_section, \ - in_objc_meth_var_types, \ - ".objc_meth_var_types", 1) \ -SECTION_FUNCTION (objc_cls_refs_section, \ - in_objc_cls_refs, \ - ".objc_cls_refs", 1) \ - \ -SECTION_FUNCTION (machopic_lazy_symbol_ptr_section, \ - in_machopic_lazy_symbol_ptr, \ - ".lazy_symbol_pointer", 0) \ -SECTION_FUNCTION (machopic_nl_symbol_ptr_section, \ - in_machopic_nl_symbol_ptr, \ - ".non_lazy_symbol_pointer", 0) \ -SECTION_FUNCTION (machopic_symbol_stub_section, \ - in_machopic_symbol_stub, \ - ".symbol_stub", 0) \ -SECTION_FUNCTION (machopic_symbol_stub1_section, \ - in_machopic_symbol_stub1, \ - ".section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16", 0)\ -SECTION_FUNCTION (machopic_picsymbol_stub_section, \ - in_machopic_picsymbol_stub, \ - ".picsymbol_stub", 0) \ -SECTION_FUNCTION (machopic_picsymbol_stub1_section, \ - in_machopic_picsymbol_stub1, \ - ".section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32", 0)\ -SECTION_FUNCTION (darwin_exception_section, \ - in_darwin_exception, \ - ".section __DATA,__gcc_except_tab", 0) \ -SECTION_FUNCTION (darwin_eh_frame_section, \ - in_darwin_eh_frame, \ - ".section __TEXT,__eh_frame", 0) \ - \ -static void \ -objc_section_init (void) \ -{ \ - static int been_here = 0; \ - \ - if (been_here == 0) \ - { \ - been_here = 1; \ - /* written, cold -> hot */ \ - objc_cat_cls_meth_section (); \ - objc_cat_inst_meth_section (); \ - objc_string_object_section (); \ - objc_constant_string_object_section (); \ - objc_selector_refs_section (); \ - objc_selector_fixup_section (); \ - objc_cls_refs_section (); \ - objc_class_section (); \ - objc_meta_class_section (); \ - /* shared, hot -> cold */ \ - objc_cls_meth_section (); \ - objc_inst_meth_section (); \ - objc_protocol_section (); \ - objc_class_names_section (); \ - objc_meth_var_types_section (); \ - objc_meth_var_names_section (); \ - objc_category_section (); \ - objc_class_vars_section (); \ - objc_instance_vars_section (); \ - objc_module_info_section (); \ - objc_symbols_section (); \ - } \ -} - -#define READONLY_DATA_SECTION const_section +/* Declare the section variables. */ +#ifndef USED_FOR_TARGET +enum darwin_section_enum { +#define DEF_SECTION(NAME, FLAGS, DIRECTIVE, OBJC) NAME, +#include "darwin-sections.def" +#undef DEF_SECTION + NUM_DARWIN_SECTIONS +}; +extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS]; +#endif #undef TARGET_ASM_SELECT_SECTION #define TARGET_ASM_SELECT_SECTION machopic_select_section +#define USE_SELECT_SECTION_FOR_FUNCTIONS + #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section +#undef TARGET_ASM_UNIQUE_SECTION +#define TARGET_ASM_UNIQUE_SECTION darwin_unique_section +#undef TARGET_ASM_FUNCTION_RODATA_SECTION +#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section +#undef TARGET_ASM_RELOC_RW_MASK +#define TARGET_ASM_RELOC_RW_MASK machopic_reloc_rw_mask + #define ASM_DECLARE_UNRESOLVED_REFERENCE(FILE,NAME) \ do { \ @@ -714,21 +711,40 @@ objc_section_init (void) \ /* Emit an assembler directive to set visibility for a symbol. Used to support visibility attribute and Darwin's private extern - feature. */ + feature. */ #undef TARGET_ASM_ASSEMBLE_VISIBILITY #define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility +/* Extra attributes for Darwin. */ +#define SUBTARGET_ATTRIBUTE_TABLE \ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \ + { "apple_kext_compatibility", 0, 0, false, true, false, \ + darwin_handle_kext_attribute }, \ + { "weak_import", 0, 0, true, false, false, \ + darwin_handle_weak_import_attribute } #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)) -/* Since we have a separate readonly data section, define this so that - jump tables end up in text rather than data. */ +#undef TARGET_ASM_MARK_DECL_PRESERVED +#define TARGET_ASM_MARK_DECL_PRESERVED darwin_mark_decl_preserved -#ifndef JUMP_TABLES_IN_TEXT_SECTION -#define JUMP_TABLES_IN_TEXT_SECTION 1 -#endif +/* Set on a symbol with SYMBOL_FLAG_FUNCTION or + MACHO_SYMBOL_FLAG_VARIABLE to indicate that the function or + variable has been defined in this translation unit. + When porting Mach-O to new architectures you need to make + sure these aren't clobbered by the backend. */ + +#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_MACH_DEP) +#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_MACH_DEP) << 1) + +/* Set on a symbol to indicate when fix-and-continue style code + generation is being used and the symbol refers to a static symbol + that should be rebound from new instances of a translation unit to + the original instance of the data. */ + +#define MACHO_SYMBOL_STATIC ((SYMBOL_FLAG_MACH_DEP) << 2) /* Symbolic names for various things we might know about a symbol. */ @@ -744,13 +760,13 @@ enum machopic_addr_class { #define MACHO_DYNAMIC_NO_PIC_P (TARGET_DYNAMIC_NO_PIC) #define MACHOPIC_INDIRECT (flag_pic || MACHO_DYNAMIC_NO_PIC_P) -#define MACHOPIC_JUST_INDIRECT (flag_pic == 1 || MACHO_DYNAMIC_NO_PIC_P) -#define MACHOPIC_PURE (flag_pic == 2 && ! MACHO_DYNAMIC_NO_PIC_P) +#define MACHOPIC_JUST_INDIRECT (MACHO_DYNAMIC_NO_PIC_P) +#define MACHOPIC_PURE (flag_pic && ! MACHO_DYNAMIC_NO_PIC_P) #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO darwin_encode_section_info #undef TARGET_STRIP_NAME_ENCODING -#define TARGET_STRIP_NAME_ENCODING darwin_strip_name_encoding +#define TARGET_STRIP_NAME_ENCODING default_strip_name_encoding #define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \ do { \ @@ -786,7 +802,7 @@ enum machopic_addr_class { #define GEN_LAZY_PTR_NAME_FOR_SYMBOL(BUF,SYMBOL,SYMBOL_LENGTH) \ do { \ - const char *symbol_ = darwin_strip_name_encoding (SYMBOL); \ + const char *symbol_ = (SYMBOL); \ char *buffer_ = (BUF); \ if (symbol_[0] == '"') \ { \ @@ -808,30 +824,140 @@ enum machopic_addr_class { } \ } while (0) -#define TARGET_ASM_EXCEPTION_SECTION darwin_exception_section +#define EH_FRAME_SECTION_NAME "__TEXT" +#define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support" -#define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section +/* Java runtime class list. */ +#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip" #undef ASM_PREFERRED_EH_DATA_FORMAT #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ (((CODE) == 2 && (GLOBAL) == 1) \ - ? (DW_EH_PE_pcrel | DW_EH_PE_indirect) : \ + ? (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) : \ ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr) #define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2) \ darwin_asm_output_dwarf_delta (FILE, SIZE, LABEL1, LABEL2) +#define ASM_OUTPUT_DWARF_OFFSET(FILE,SIZE,LABEL,BASE) \ + darwin_asm_output_dwarf_offset (FILE, SIZE, LABEL, BASE) + +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(ASM_OUT_FILE, ENCODING, SIZE, ADDR, DONE) \ + if (ENCODING == ASM_PREFERRED_EH_DATA_FORMAT (2, 1)) { \ + darwin_non_lazy_pcrel (ASM_OUT_FILE, ADDR); \ + goto DONE; \ + } + +/* Experimentally, putting jump tables in text is faster on SPEC. + Also this is needed for correctness for coalesced functions. */ + +#ifndef JUMP_TABLES_IN_TEXT_SECTION +#define JUMP_TABLES_IN_TEXT_SECTION 1 +#endif + #define TARGET_TERMINATE_DW2_EH_FRAME_INFO false +#define TARGET_ASM_INIT_SECTIONS darwin_init_sections +#undef TARGET_ASM_NAMED_SECTION +#define TARGET_ASM_NAMED_SECTION darwin_asm_named_section + +/* Handle pragma weak and pragma pack. */ +#define HANDLE_SYSV_PRAGMA 1 + +#define HANDLE_PRAGMA_PACK_PUSH_POP 1 + #define DARWIN_REGISTER_TARGET_PRAGMAS() \ do { \ c_register_pragma (0, "mark", darwin_pragma_ignore); \ c_register_pragma (0, "options", darwin_pragma_options); \ c_register_pragma (0, "segment", darwin_pragma_ignore); \ c_register_pragma (0, "unused", darwin_pragma_unused); \ + c_register_pragma (0, "ms_struct", darwin_pragma_ms_struct); \ } while (0) #undef ASM_APP_ON #define ASM_APP_ON "" #undef ASM_APP_OFF #define ASM_APP_OFF "" + +void darwin_register_frameworks (const char *, const char *, int); +void darwin_register_objc_includes (const char *, const char *, int); +#define TARGET_EXTRA_PRE_INCLUDES darwin_register_objc_includes +#define TARGET_EXTRA_INCLUDES darwin_register_frameworks + +void add_framework_path (char *); +#define TARGET_OPTF add_framework_path + +#define TARGET_POSIX_IO + +/* All new versions of Darwin have C99 functions. */ + +#define TARGET_C99_FUNCTIONS 1 + +#define WINT_TYPE "int" + +/* Every program on darwin links against libSystem which contains the pthread + routines, so there's no need to explicitly call out when doing threaded + work. */ + +#undef GOMP_SELF_SPECS +#define GOMP_SELF_SPECS "" + +/* Darwin can't support anchors until we can cope with the adjustments + to size that ASM_DECLARE_OBJECT_NAME and ASM_DECLARE_CONSTANT_NAME + when outputting members of an anchor block and the linker can be + taught to keep them together or we find some other suitable + code-gen technique. */ + +#if 0 +#define TARGET_ASM_OUTPUT_ANCHOR darwin_asm_output_anchor +#else +#define TARGET_ASM_OUTPUT_ANCHOR NULL +#endif + +/* Attempt to turn on execute permission for the stack. This may be + used by INITIALIZE_TRAMPOLINE of the target needs it (that is, + if the target machine can change execute permissions on a page). + + There is no way to query the execute permission of the stack, so + we always issue the mprotect() call. + + Unfortunately it is not possible to make this namespace-clean. + + Also note that no errors should be emitted by this code; it is + considered dangerous for library calls to send messages to + stdout/stderr. */ + +#define ENABLE_EXECUTE_STACK \ +extern void __enable_execute_stack (void *); \ +void \ +__enable_execute_stack (void *addr) \ +{ \ + extern int mprotect (void *, size_t, int); \ + extern int getpagesize (void); \ + static int size; \ + static long mask; \ + \ + char *page, *end; \ + \ + if (size == 0) \ + { \ + size = getpagesize(); \ + mask = ~((long) size - 1); \ + } \ + \ + page = (char *) (((long) addr) & mask); \ + end = (char *) ((((long) (addr + (TARGET_64BIT ? 48 : 40))) & mask) + size); \ + \ + /* 7 == PROT_READ | PROT_WRITE | PROT_EXEC */ \ + (void) mprotect (page, end - page, 7); \ +} + +/* For Apple KEXTs, we make the constructors return this to match gcc + 2.95. */ +#define TARGET_CXX_CDTOR_RETURNS_THIS (darwin_kextabi_p) +extern int flag_mkernel; +extern int flag_apple_kext; +#define TARGET_KEXTABI flag_apple_kext + +#endif /* CONFIG_DARWIN_H */ diff --git a/contrib/gcc/config/darwin.opt b/contrib/gcc/config/darwin.opt new file mode 100644 index 00000000000..9fee719b1cd --- /dev/null +++ b/contrib/gcc/config/darwin.opt @@ -0,0 +1,40 @@ +; Processor-independent options for Darwin. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mfix-and-continue +Target Report Var(darwin_fix_and_continue) +Generate code suitable for fast turn around debugging + +mmacosx-version-min= +Target Joined Report Var(darwin_macosx_version_min) +The earliest MacOS X version on which this program will run + +mone-byte-bool +Target RejectNegative Report Var(darwin_one_byte_bool) +Set sizeof(bool) to 1 + +fapple-kext +Target Report Var(flag_apple_kext) +Generate code for darwin loadable kernel extentions + +mkernel +Target Report Var(flag_mkernel) +Generate code for the kernel or loadable kernel extentions diff --git a/contrib/gcc/config/darwin9.h b/contrib/gcc/config/darwin9.h new file mode 100644 index 00000000000..2965f191560 --- /dev/null +++ b/contrib/gcc/config/darwin9.h @@ -0,0 +1,13 @@ +/* The linker can generate branch islands. */ +#define DARWIN_LINKER_GENERATES_ISLANDS 1 + +#undef ASM_OUTPUT_ALIGNED_COMMON +#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ + do { \ + unsigned HOST_WIDE_INT _new_size = (SIZE); \ + fprintf ((FILE), ".comm "); \ + assemble_name ((FILE), (NAME)); \ + if (_new_size == 0) _new_size = 1; \ + fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + _new_size, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ + } while (0) diff --git a/contrib/gcc/config/dbx.h b/contrib/gcc/config/dbx.h index eb20452f48d..3c815342827 100644 --- a/contrib/gcc/config/dbx.h +++ b/contrib/gcc/config/dbx.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file causes gcc to prefer using DBX (stabs) debugging information. The configure script will add a #include of this file diff --git a/contrib/gcc/config/dbxcoff.h b/contrib/gcc/config/dbxcoff.h index 76a910f3225..b6eaec9211c 100644 --- a/contrib/gcc/config/dbxcoff.h +++ b/contrib/gcc/config/dbxcoff.h @@ -1,5 +1,5 @@ /* Definitions needed when using stabs embedded in COFF sections. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file may be included by any COFF target which wishes to support -gstabs generating stabs in sections, as produced by gas @@ -34,43 +34,22 @@ Boston, MA 02111-1307, USA. */ /* Be function-relative for block and source line stab directives. */ -#undef DBX_BLOCKS_FUNCTION_RELATIVE #define DBX_BLOCKS_FUNCTION_RELATIVE 1 /* but, to make this work, functions must appear prior to line info. */ -#undef DBX_FUNCTION_FIRST #define DBX_FUNCTION_FIRST /* Generate a blank trailing N_SO to mark the end of the .o file, since we can't depend upon the linker to mark .o file boundaries with embedded stabs. */ -#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ - asm_fprintf (FILE, \ - "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO) +#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END /* Like block addresses, stabs line numbers are relative to the current function. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \ -{ if (write_symbols == SDB_DEBUG) { \ - fprintf ((FILE), "\t.ln\t%d\n", \ - ((sdb_begin_function_line > -1) \ - ? (LINE) - sdb_begin_function_line : 1)); \ - } else if (write_symbols == DBX_DEBUG) { \ - char buffer[256]; \ - ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \ - fprintf (FILE, ".stabn 68,0,%d,", LINE); \ - assemble_name (FILE, buffer); \ - putc ('-', FILE); \ - assemble_name (FILE, \ - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ - putc ('\n', FILE); \ - (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \ - } } +#define DBX_LINES_FUNCTION_RELATIVE 1 /* When generating stabs debugging, use N_BINCL entries. */ diff --git a/contrib/gcc/config/dbxelf.h b/contrib/gcc/config/dbxelf.h index e636daddc87..a3176868c7a 100644 --- a/contrib/gcc/config/dbxelf.h +++ b/contrib/gcc/config/dbxelf.h @@ -1,5 +1,5 @@ /* Definitions needed when using stabs embedded in ELF sections. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file may be included by any ELF target which wishes to support -gstabs generating stabs in sections, as produced by gas @@ -34,17 +34,14 @@ Boston, MA 02111-1307, USA. */ way, gdb expects it, and it reduces the number of relocation entries... */ -#undef DBX_BLOCKS_FUNCTION_RELATIVE #define DBX_BLOCKS_FUNCTION_RELATIVE 1 /* ... but, to make this work, functions must appear prior to line info. */ -#undef DBX_FUNCTION_FIRST #define DBX_FUNCTION_FIRST /* When generating stabs debugging, use N_BINCL entries. */ -#undef DBX_USE_BINCL #define DBX_USE_BINCL /* There is no limit to the length of stabs strings. */ @@ -56,29 +53,12 @@ Boston, MA 02111-1307, USA. */ /* Like block addresses, stabs line numbers are relative to the current function. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \ -do \ - { \ - char temp[256]; \ - ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \ - fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \ - assemble_name (FILE, temp); \ - putc ('-', FILE); \ - assemble_name (FILE, \ - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ - putc ('\n', FILE); \ - (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \ - } \ -while (0) +#define DBX_LINES_FUNCTION_RELATIVE 1 /* Generate a blank trailing N_SO to mark the end of the .o file, since we can't depend upon the linker to mark .o file boundaries with embedded stabs. */ -#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ - asm_fprintf (FILE, \ - "\t.text\n\t.stabs \"\",%d,0,0,%LLetext\n%LLetext:\n", N_SO) +#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END #endif /* ! GCC_DBX_ELF_H */ diff --git a/contrib/gcc/config/dfp-bit.c b/contrib/gcc/config/dfp-bit.c new file mode 100644 index 00000000000..c9374c51f06 --- /dev/null +++ b/contrib/gcc/config/dfp-bit.c @@ -0,0 +1,541 @@ +/* This is a software decimal floating point library. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* This implements IEEE 754R decimal floating point arithmetic, but + does not provide a mechanism for setting the rounding mode, or for + generating or handling exceptions. Conversions between decimal + floating point types and other types depend on C library functions. + + Contributed by Ben Elliston . */ + +/* The intended way to use this file is to make two copies, add `#define ' + to one copy, then compile both copies and add them to libgcc.a. */ + +#include +#include +#include +#include + +#include "config/dfp-bit.h" + +/* Forward declarations. */ +#if WIDTH == 32 || WIDTH_TO == 32 +void __host_to_ieee_32 (_Decimal32 in, decimal32 *out); +void __ieee_to_host_32 (decimal32 in, _Decimal32 *out); +#endif +#if WIDTH == 64 || WIDTH_TO == 64 +void __host_to_ieee_64 (_Decimal64 in, decimal64 *out); +void __ieee_to_host_64 (decimal64 in, _Decimal64 *out); +#endif +#if WIDTH == 128 || WIDTH_TO == 128 +void __host_to_ieee_128 (_Decimal128 in, decimal128 *out); +void __ieee_to_host_128 (decimal128 in, _Decimal128 *out); +#endif + +/* A pointer to a unary decNumber operation. */ +typedef decNumber* (*dfp_unary_func) + (decNumber *, decNumber *, decContext *); + +/* A pointer to a binary decNumber operation. */ +typedef decNumber* (*dfp_binary_func) + (decNumber *, decNumber *, decNumber *, decContext *); + +extern unsigned long __dec_byte_swap (unsigned long); + +/* Unary operations. */ + +static inline DFP_C_TYPE +dfp_unary_op (dfp_unary_func op, DFP_C_TYPE arg) +{ + DFP_C_TYPE result; + decContext context; + decNumber arg1, res; + IEEE_TYPE a, encoded_result; + + HOST_TO_IEEE (arg, &a); + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + TO_INTERNAL (&a, &arg1); + + /* Perform the operation. */ + op (&res, &arg1, &context); + + if (CONTEXT_TRAPS && CONTEXT_ERRORS (context)) + DFP_RAISE (0); + + TO_ENCODED (&encoded_result, &res, &context); + IEEE_TO_HOST (encoded_result, &result); + return result; +} + +/* Binary operations. */ + +static inline DFP_C_TYPE +dfp_binary_op (dfp_binary_func op, DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + DFP_C_TYPE result; + decContext context; + decNumber arg1, arg2, res; + IEEE_TYPE a, b, encoded_result; + + HOST_TO_IEEE (arg_a, &a); + HOST_TO_IEEE (arg_b, &b); + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + TO_INTERNAL (&a, &arg1); + TO_INTERNAL (&b, &arg2); + + /* Perform the operation. */ + op (&res, &arg1, &arg2, &context); + + if (CONTEXT_TRAPS && CONTEXT_ERRORS (context)) + DFP_RAISE (0); + + TO_ENCODED (&encoded_result, &res, &context); + IEEE_TO_HOST (encoded_result, &result); + return result; +} + +/* Comparison operations. */ + +static inline int +dfp_compare_op (dfp_binary_func op, DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + IEEE_TYPE a, b; + decContext context; + decNumber arg1, arg2, res; + int result; + + HOST_TO_IEEE (arg_a, &a); + HOST_TO_IEEE (arg_b, &b); + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + TO_INTERNAL (&a, &arg1); + TO_INTERNAL (&b, &arg2); + + /* Perform the comparison. */ + op (&res, &arg1, &arg2, &context); + + if (CONTEXT_TRAPS && CONTEXT_ERRORS (context)) + DFP_RAISE (0); + + if (decNumberIsNegative (&res)) + result = -1; + else if (decNumberIsZero (&res)) + result = 0; + else + result = 1; + + return result; +} + + +#if defined(L_conv_sd) +void +__host_to_ieee_32 (_Decimal32 in, decimal32 *out) +{ + uint32_t t; + + if (!LIBGCC2_FLOAT_WORDS_BIG_ENDIAN) + { + memcpy (&t, &in, 4); + t = __dec_byte_swap (t); + memcpy (out, &t, 4); + } + else + memcpy (out, &in, 4); +} + +void +__ieee_to_host_32 (decimal32 in, _Decimal32 *out) +{ + uint32_t t; + + if (!LIBGCC2_FLOAT_WORDS_BIG_ENDIAN) + { + memcpy (&t, &in, 4); + t = __dec_byte_swap (t); + memcpy (out, &t, 4); + } + else + memcpy (out, &in, 4); +} +#endif /* L_conv_sd */ + +#if defined(L_conv_dd) +static void +__swap64 (char *src, char *dst) +{ + uint32_t t1, t2; + + if (!LIBGCC2_FLOAT_WORDS_BIG_ENDIAN) + { + memcpy (&t1, src, 4); + memcpy (&t2, src + 4, 4); + t1 = __dec_byte_swap (t1); + t2 = __dec_byte_swap (t2); + memcpy (dst, &t2, 4); + memcpy (dst + 4, &t1, 4); + } + else + memcpy (dst, src, 8); +} + +void +__host_to_ieee_64 (_Decimal64 in, decimal64 *out) +{ + __swap64 ((char *) &in, (char *) out); +} + +void +__ieee_to_host_64 (decimal64 in, _Decimal64 *out) +{ + __swap64 ((char *) &in, (char *) out); +} +#endif /* L_conv_dd */ + +#if defined(L_conv_td) +static void +__swap128 (char *src, char *dst) +{ + uint32_t t1, t2, t3, t4; + + if (!LIBGCC2_FLOAT_WORDS_BIG_ENDIAN) + { + memcpy (&t1, src, 4); + memcpy (&t2, src + 4, 4); + memcpy (&t3, src + 8, 4); + memcpy (&t4, src + 12, 4); + t1 = __dec_byte_swap (t1); + t2 = __dec_byte_swap (t2); + t3 = __dec_byte_swap (t3); + t4 = __dec_byte_swap (t4); + memcpy (dst, &t4, 4); + memcpy (dst + 4, &t3, 4); + memcpy (dst + 8, &t2, 4); + memcpy (dst + 12, &t1, 4); + } + else + memcpy (dst, src, 16); +} + +void +__host_to_ieee_128 (_Decimal128 in, decimal128 *out) +{ + __swap128 ((char *) &in, (char *) out); +} + +void +__ieee_to_host_128 (decimal128 in, _Decimal128 *out) +{ + __swap128 ((char *) &in, (char *) out); +} +#endif /* L_conv_td */ + +#if defined(L_addsub_sd) || defined(L_addsub_dd) || defined(L_addsub_td) +DFP_C_TYPE +DFP_ADD (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + return dfp_binary_op (decNumberAdd, arg_a, arg_b); +} + +DFP_C_TYPE +DFP_SUB (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + return dfp_binary_op (decNumberSubtract, arg_a, arg_b); +} +#endif /* L_addsub */ + +#if defined(L_mul_sd) || defined(L_mul_dd) || defined(L_mul_td) +DFP_C_TYPE +DFP_MULTIPLY (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + return dfp_binary_op (decNumberMultiply, arg_a, arg_b); +} +#endif /* L_mul */ + +#if defined(L_div_sd) || defined(L_div_dd) || defined(L_div_td) +DFP_C_TYPE +DFP_DIVIDE (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + return dfp_binary_op (decNumberDivide, arg_a, arg_b); +} +#endif /* L_div */ + +#if defined (L_eq_sd) || defined (L_eq_dd) || defined (L_eq_td) +CMPtype +DFP_EQ (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For EQ return zero for true, nonzero for false. */ + return stat != 0; +} +#endif /* L_eq */ + +#if defined (L_ne_sd) || defined (L_ne_dd) || defined (L_ne_td) +CMPtype +DFP_NE (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For NE return nonzero for true, zero for false. */ + return stat != 0; +} +#endif /* L_ne */ + +#if defined (L_lt_sd) || defined (L_lt_dd) || defined (L_lt_td) +CMPtype +DFP_LT (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For LT return -1 (<0) for true, 1 for false. */ + return (stat == -1) ? -1 : 1; +} +#endif /* L_lt */ + +#if defined (L_gt_sd) || defined (L_gt_dd) || defined (L_gt_td) +CMPtype +DFP_GT (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For GT return 1 (>0) for true, -1 for false. */ + return (stat == 1) ? 1 : -1; +} +#endif + +#if defined (L_le_sd) || defined (L_le_dd) || defined (L_le_td) +CMPtype +DFP_LE (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For LE return 0 (<= 0) for true, 1 for false. */ + return stat == 1; +} +#endif /* L_le */ + +#if defined (L_ge_sd) || defined (L_ge_dd) || defined (L_ge_td) +CMPtype +DFP_GE (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + int stat; + stat = dfp_compare_op (decNumberCompare, arg_a, arg_b); + /* For GE return 1 (>=0) for true, -1 for false. */ + return (stat != -1) ? 1 : -1; +} +#endif /* L_ge */ + +#define BUFMAX 128 + +#if defined (L_sd_to_dd) || defined (L_sd_to_td) || defined (L_dd_to_sd) \ + || defined (L_dd_to_td) || defined (L_td_to_sd) || defined (L_td_to_dd) +DFP_C_TYPE_TO +DFP_TO_DFP (DFP_C_TYPE f_from) +{ + DFP_C_TYPE_TO f_to; + IEEE_TYPE s_from; + IEEE_TYPE_TO s_to; + decNumber d; + decContext context; + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + HOST_TO_IEEE (f_from, &s_from); + TO_INTERNAL (&s_from, &d); + TO_ENCODED_TO (&s_to, &d, &context); + if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0) + DFP_RAISE (DEC_Inexact); + + IEEE_TO_HOST_TO (s_to, &f_to); + return f_to; +} +#endif + +#if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) \ + || defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) \ + || defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) \ + || defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) +INT_TYPE +DFP_TO_INT (DFP_C_TYPE x) +{ + /* decNumber's decimal* types have the same format as C's _Decimal* + types, but they have different calling conventions. */ + + IEEE_TYPE s; + char buf[BUFMAX]; + char *pos; + decNumber qval, n1, n2; + decContext context; + + decContextDefault (&context, CONTEXT_INIT); + /* Need non-default rounding mode here. */ + context.round = DEC_ROUND_DOWN; + + HOST_TO_IEEE (x, &s); + TO_INTERNAL (&s, &n1); + /* Rescale if the exponent is less than zero. */ + decNumberToIntegralValue (&n2, &n1, &context); + /* Get a value to use for the quantize call. */ + decNumberFromString (&qval, (char *) "1.0", &context); + /* Force the exponent to zero. */ + decNumberQuantize (&n1, &n2, &qval, &context); + /* This is based on text in N1107 section 5.1; it might turn out to be + undefined behavior instead. */ + if (context.status & DEC_Invalid_operation) + { +#if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) + if (decNumberIsNegative(&n2)) + return INT_MIN; + else + return INT_MAX; +#elif defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) + if (decNumberIsNegative(&n2)) + /* Find a defined constant that will work here. */ + return (-9223372036854775807LL - 1LL); + else + /* Find a defined constant that will work here. */ + return 9223372036854775807LL; +#elif defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) + return UINT_MAX; +#elif defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) + /* Find a defined constant that will work here. */ + return 18446744073709551615ULL; +#endif + } + /* Get a string, which at this point will not include an exponent. */ + decNumberToString (&n1, buf); + /* Ignore the fractional part. */ + pos = strchr (buf, '.'); + if (pos) + *pos = 0; + /* Use a C library function to convert to the integral type. */ + return STR_TO_INT (buf, NULL, 10); +} +#endif + +#if defined (L_si_to_sd) || defined (L_si_to_dd) || defined (L_si_to_td) \ + || defined (L_di_to_sd) || defined (L_di_to_dd) || defined (L_di_to_td) \ + || defined (L_usi_to_sd) || defined (L_usi_to_dd) || defined (L_usi_to_td) \ + || defined (L_udi_to_sd) || defined (L_udi_to_dd) || defined (L_udi_to_td) +DFP_C_TYPE +INT_TO_DFP (INT_TYPE i) +{ + DFP_C_TYPE f; + IEEE_TYPE s; + char buf[BUFMAX]; + decContext context; + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + /* Use a C library function to get a floating point string. */ + sprintf (buf, INT_FMT ".0", CAST_FOR_FMT(i)); + /* Convert from the floating point string to a decimal* type. */ + FROM_STRING (&s, buf, &context); + IEEE_TO_HOST (s, &f); + if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0) + DFP_RAISE (DEC_Inexact); + return f; +} +#endif + +#if defined (L_sd_to_sf) || defined (L_dd_to_sf) || defined (L_td_to_sf) \ + || defined (L_sd_to_df) || defined (L_dd_to_df) || defined (L_td_to_df) \ + || ((defined (L_sd_to_xf) || defined (L_dd_to_xf) || defined (L_td_to_xf)) \ + && LIBGCC2_HAS_XF_MODE) +BFP_TYPE +DFP_TO_BFP (DFP_C_TYPE f) +{ + IEEE_TYPE s; + char buf[BUFMAX]; + + HOST_TO_IEEE (f, &s); + /* Write the value to a string. */ + TO_STRING (&s, buf); + /* Read it as the binary floating point type and return that. */ + return STR_TO_BFP (buf, NULL); +} +#endif + +#if defined (L_sf_to_sd) || defined (L_sf_to_dd) || defined (L_sf_to_td) \ + || defined (L_df_to_sd) || defined (L_df_to_dd) || defined (L_df_to_td) \ + || ((defined (L_xf_to_sd) || defined (L_xf_to_dd) || defined (L_xf_to_td)) \ + && LIBGCC2_HAS_XF_MODE) +DFP_C_TYPE +BFP_TO_DFP (BFP_TYPE x) +{ + DFP_C_TYPE f; + IEEE_TYPE s; + char buf[BUFMAX]; + decContext context; + + decContextDefault (&context, CONTEXT_INIT); + context.round = CONTEXT_ROUND; + + /* Use a C library function to write the floating point value to a string. */ +#ifdef BFP_VIA_TYPE + /* FIXME: Is there a better way to output an XFmode variable in C? */ + sprintf (buf, BFP_FMT, (BFP_VIA_TYPE) x); +#else + sprintf (buf, BFP_FMT, x); +#endif + + /* Convert from the floating point string to a decimal* type. */ + FROM_STRING (&s, buf, &context); + IEEE_TO_HOST (s, &f); + if (CONTEXT_TRAPS && (context.status & DEC_Inexact) != 0) + DFP_RAISE (DEC_Inexact); + return f; +} +#endif + +#if defined (L_unord_sd) || defined (L_unord_dd) || defined (L_unord_td) +CMPtype +DFP_UNORD (DFP_C_TYPE arg_a, DFP_C_TYPE arg_b) +{ + decNumber arg1, arg2; + IEEE_TYPE a, b; + + HOST_TO_IEEE (arg_a, &a); + HOST_TO_IEEE (arg_b, &b); + TO_INTERNAL (&a, &arg1); + TO_INTERNAL (&b, &arg2); + return (decNumberIsNaN (&arg1) || decNumberIsNaN (&arg2)); +} +#endif /* L_unord_sd || L_unord_dd || L_unord_td */ diff --git a/contrib/gcc/config/dfp-bit.h b/contrib/gcc/config/dfp-bit.h new file mode 100644 index 00000000000..a6c7798982b --- /dev/null +++ b/contrib/gcc/config/dfp-bit.h @@ -0,0 +1,513 @@ +/* Header file for dfp-bit.c. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#ifndef _DFPBIT_H +#define _DFPBIT_H + +#include "tconfig.h" +#include "coretypes.h" +#include "tm.h" + +#ifndef LIBGCC2_WORDS_BIG_ENDIAN +#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN +#endif + +#ifndef LIBGCC2_FLOAT_WORDS_BIG_ENDIAN +#define LIBGCC2_FLOAT_WORDS_BIG_ENDIAN LIBGCC2_WORDS_BIG_ENDIAN +#endif + +#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE +#endif + +#ifndef LIBGCC2_HAS_XF_MODE +#define LIBGCC2_HAS_XF_MODE \ + (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) +#endif + +/* Depending on WIDTH, define a number of macros: + + DFP_C_TYPE: type of the arguments to the libgcc functions; + (eg _Decimal32) + + IEEE_TYPE: the corresponding (encoded) IEEE754R type; + (eg decimal32) + + TO_INTERNAL: the name of the decNumber function to convert an + encoded value into the decNumber internal representation; + + TO_ENCODED: the name of the decNumber function to convert an + internally represented decNumber into the encoded + representation. + + FROM_STRING: the name of the decNumber function to read an + encoded value from a string. + + TO_STRING: the name of the decNumber function to write an + encoded value to a string. */ + +#if WIDTH == 32 +#define DFP_C_TYPE _Decimal32 +#define IEEE_TYPE decimal32 +#define HOST_TO_IEEE __host_to_ieee_32 +#define IEEE_TO_HOST __ieee_to_host_32 +#define TO_INTERNAL __decimal32ToNumber +#define TO_ENCODED __decimal32FromNumber +#define FROM_STRING __decimal32FromString +#define TO_STRING __decimal32ToString +#elif WIDTH == 64 +#define DFP_C_TYPE _Decimal64 +#define IEEE_TYPE decimal64 +#define HOST_TO_IEEE __host_to_ieee_64 +#define IEEE_TO_HOST __ieee_to_host_64 +#define TO_INTERNAL __decimal64ToNumber +#define TO_ENCODED __decimal64FromNumber +#define FROM_STRING __decimal64FromString +#define TO_STRING __decimal64ToString +#elif WIDTH == 128 +#define DFP_C_TYPE _Decimal128 +#define IEEE_TYPE decimal128 +#define HOST_TO_IEEE __host_to_ieee_128 +#define IEEE_TO_HOST __ieee_to_host_128 +#define TO_INTERNAL __decimal128ToNumber +#define TO_ENCODED __decimal128FromNumber +#define FROM_STRING __decimal128FromString +#define TO_STRING __decimal128ToString +#else +#error invalid decimal float word width +#endif + +/* We define __DEC_EVAL_METHOD__ to 2, saying that we evaluate all + operations and constants to the range and precision of the _Decimal128 + type. Make it so. */ +#if WIDTH == 32 +#define CONTEXT_INIT DEC_INIT_DECIMAL32 +#elif WIDTH == 64 +#define CONTEXT_INIT DEC_INIT_DECIMAL64 +#elif WIDTH == 128 +#define CONTEXT_INIT DEC_INIT_DECIMAL128 +#endif + +/* Define CONTEXT_ROUND to obtain the current decNumber rounding mode. */ +extern enum rounding __decGetRound (void); +#define CONTEXT_ROUND __decGetRound () + +extern int __dfp_traps; +#define CONTEXT_TRAPS __dfp_traps +#define CONTEXT_ERRORS(context) context.status & DEC_Errors +extern void __dfp_raise (int); +#define DFP_RAISE(A) __dfp_raise(A) + +/* Conversions between different decimal float types use WIDTH_TO to + determine additional macros to define. */ + +#if defined (L_dd_to_sd) || defined (L_td_to_sd) +#define WIDTH_TO 32 +#elif defined (L_sd_to_dd) || defined (L_td_to_dd) +#define WIDTH_TO 64 +#elif defined (L_sd_to_td) || defined (L_dd_to_td) +#define WIDTH_TO 128 +#endif + +/* If WIDTH_TO is defined, define additional macros: + + DFP_C_TYPE_TO: type of the result of dfp to dfp conversion. + + IEEE_TYPE_TO: the corresponding (encoded) IEEE754R type. + + TO_ENCODED_TO: the name of the decNumber function to convert an + internally represented decNumber into the encoded representation + for the destination. */ + +#if WIDTH_TO == 32 +#define DFP_C_TYPE_TO _Decimal32 +#define IEEE_TYPE_TO decimal32 +#define TO_ENCODED_TO __decimal32FromNumber +#define IEEE_TO_HOST_TO __ieee_to_host_32 +#elif WIDTH_TO == 64 +#define DFP_C_TYPE_TO _Decimal64 +#define IEEE_TYPE_TO decimal64 +#define TO_ENCODED_TO __decimal64FromNumber +#define IEEE_TO_HOST_TO __ieee_to_host_64 +#elif WIDTH_TO == 128 +#define DFP_C_TYPE_TO _Decimal128 +#define IEEE_TYPE_TO decimal128 +#define TO_ENCODED_TO __decimal128FromNumber +#define IEEE_TO_HOST_TO __ieee_to_host_128 +#endif + +/* Conversions between decimal float types and integral types use INT_KIND + to determine the data type and C functions to use. */ + +#if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) \ + || defined (L_si_to_sd) || defined (L_si_to_dd) || defined (L_si_to_td) +#define INT_KIND 1 +#elif defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) \ + || defined (L_di_to_sd) || defined (L_di_to_dd) || defined (L_di_to_td) +#define INT_KIND 2 +#elif defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) \ + || defined (L_usi_to_sd) || defined (L_usi_to_dd) || defined (L_usi_to_td) +#define INT_KIND 3 +#elif defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) \ + || defined (L_udi_to_sd) || defined (L_udi_to_dd) || defined (L_udi_to_td) +#define INT_KIND 4 +#endif + +/* If INT_KIND is defined, define additional macros: + + INT_TYPE: The integer data type. + + INT_FMT: The format string for writing the integer to a string. + + CAST_FOR_FMT: Cast variable of INT_KIND to C type for sprintf. + This works for ILP32 and LP64, won't for other type size systems. + + STR_TO_INT: The function to read the integer from a string. */ + +#if INT_KIND == 1 +#define INT_TYPE SItype +#define INT_FMT "%d" +#define CAST_FOR_FMT(A) (int)A +#define STR_TO_INT strtol +#elif INT_KIND == 2 +#define INT_TYPE DItype +#define INT_FMT "%lld" +#define CAST_FOR_FMT(A) (long long)A +#define STR_TO_INT strtoll +#elif INT_KIND == 3 +#define INT_TYPE USItype +#define INT_FMT "%u" +#define CAST_FOR_FMT(A) (unsigned int)A +#define STR_TO_INT strtoul +#elif INT_KIND == 4 +#define INT_TYPE UDItype +#define INT_FMT "%llu" +#define CAST_FOR_FMT(A) (unsigned long long)A +#define STR_TO_INT strtoull +#endif + +/* Conversions between decimal float types and binary float types use + BFP_KIND to determine the data type and C functions to use. */ + +#if defined (L_sd_to_sf) || defined (L_dd_to_sf) || defined (L_td_to_sf) \ + || defined (L_sf_to_sd) || defined (L_sf_to_dd) || defined (L_sf_to_td) +#define BFP_KIND 1 +#elif defined (L_sd_to_df) || defined (L_dd_to_df ) || defined (L_td_to_df) \ + || defined (L_df_to_sd) || defined (L_df_to_dd) || defined (L_df_to_td) +#define BFP_KIND 2 +#elif defined (L_sd_to_xf) || defined (L_dd_to_xf ) || defined (L_td_to_xf) \ + || defined (L_xf_to_sd) || defined (L_xf_to_dd) || defined (L_xf_to_td) +#define BFP_KIND 3 +#endif + +/* If BFP_KIND is defined, define additional macros: + + BFP_TYPE: The binary floating point data type. + + BFP_FMT: The format string for writing the value to a string. + + STR_TO_BFP: The function to read the value from a string. */ + +#if BFP_KIND == 1 +/* strtof is declared in only for C99. */ +extern float strtof (const char *, char **); +#define BFP_TYPE SFtype +#define BFP_FMT "%e" +#define STR_TO_BFP strtof + +#elif BFP_KIND == 2 +#define BFP_TYPE DFtype +#define BFP_FMT "%e" +#define STR_TO_BFP strtod + +#elif BFP_KIND == 3 +#if LIBGCC2_HAS_XF_MODE +/* These aren't used if XF mode is not supported. */ +#define BFP_TYPE XFtype +#define BFP_FMT "%e" +#define BFP_VIA_TYPE double +#define STR_TO_BFP strtod +#endif + +#endif /* BFP_KIND */ + +#if WIDTH == 128 || WIDTH_TO == 128 +#include "decimal128.h" +#endif +#if WIDTH == 64 || WIDTH_TO == 64 +#include "decimal64.h" +#endif +#if WIDTH == 32 || WIDTH_TO == 32 +#include "decimal32.h" +#endif +#include "decNumber.h" + +/* Names of arithmetic functions. */ + +#if WIDTH == 32 +#define DFP_ADD __addsd3 +#define DFP_SUB __subsd3 +#define DFP_MULTIPLY __mulsd3 +#define DFP_DIVIDE __divsd3 +#define DFP_EQ __eqsd2 +#define DFP_NE __nesd2 +#define DFP_LT __ltsd2 +#define DFP_GT __gtsd2 +#define DFP_LE __lesd2 +#define DFP_GE __gesd2 +#define DFP_UNORD __unordsd2 +#elif WIDTH == 64 +#define DFP_ADD __adddd3 +#define DFP_SUB __subdd3 +#define DFP_MULTIPLY __muldd3 +#define DFP_DIVIDE __divdd3 +#define DFP_EQ __eqdd2 +#define DFP_NE __nedd2 +#define DFP_LT __ltdd2 +#define DFP_GT __gtdd2 +#define DFP_LE __ledd2 +#define DFP_GE __gedd2 +#define DFP_UNORD __unorddd2 +#elif WIDTH == 128 +#define DFP_ADD __addtd3 +#define DFP_SUB __subtd3 +#define DFP_MULTIPLY __multd3 +#define DFP_DIVIDE __divtd3 +#define DFP_EQ __eqtd2 +#define DFP_NE __netd2 +#define DFP_LT __lttd2 +#define DFP_GT __gttd2 +#define DFP_LE __letd2 +#define DFP_GE __getd2 +#define DFP_UNORD __unordtd2 +#endif + +/* Names of functions to convert between different decimal float types. */ + +#if WIDTH == 32 +#if WIDTH_TO == 64 +#define DFP_TO_DFP __extendsddd2 +#elif WIDTH_TO == 128 +#define DFP_TO_DFP __extendsdtd2 +#endif +#elif WIDTH == 64 +#if WIDTH_TO == 32 +#define DFP_TO_DFP __truncddsd2 +#elif WIDTH_TO == 128 +#define DFP_TO_DFP __extendddtd2 +#endif +#elif WIDTH == 128 +#if WIDTH_TO == 32 +#define DFP_TO_DFP __trunctdsd2 +#elif WIDTH_TO == 64 +#define DFP_TO_DFP __trunctddd2 +#endif +#endif + +/* Names of functions to convert between decimal float and integers. */ + +#if WIDTH == 32 +#if INT_KIND == 1 +#define INT_TO_DFP __floatsisd +#define DFP_TO_INT __fixsdsi +#elif INT_KIND == 2 +#define INT_TO_DFP __floatdisd +#define DFP_TO_INT __fixsddi +#elif INT_KIND == 3 +#define INT_TO_DFP __floatunssisd +#define DFP_TO_INT __fixunssdsi +#elif INT_KIND == 4 +#define INT_TO_DFP __floatunsdisd +#define DFP_TO_INT __fixunssddi +#endif +#elif WIDTH == 64 +#if INT_KIND == 1 +#define INT_TO_DFP __floatsidd +#define DFP_TO_INT __fixddsi +#elif INT_KIND == 2 +#define INT_TO_DFP __floatdidd +#define DFP_TO_INT __fixdddi +#elif INT_KIND == 3 +#define INT_TO_DFP __floatunssidd +#define DFP_TO_INT __fixunsddsi +#elif INT_KIND == 4 +#define INT_TO_DFP __floatunsdidd +#define DFP_TO_INT __fixunsdddi +#endif +#elif WIDTH == 128 +#if INT_KIND == 1 +#define INT_TO_DFP __floatsitd +#define DFP_TO_INT __fixtdsi +#elif INT_KIND == 2 +#define INT_TO_DFP __floatditd +#define DFP_TO_INT __fixtddi +#elif INT_KIND == 3 +#define INT_TO_DFP __floatunssitd +#define DFP_TO_INT __fixunstdsi +#elif INT_KIND == 4 +#define INT_TO_DFP __floatunsditd +#define DFP_TO_INT __fixunstddi +#endif +#endif + +/* Names of functions to convert between decimal float and binary float. */ + +#if WIDTH == 32 +#if BFP_KIND == 1 +#define BFP_TO_DFP __extendsfsd +#define DFP_TO_BFP __truncsdsf +#elif BFP_KIND == 2 +#define BFP_TO_DFP __truncdfsd +#define DFP_TO_BFP __extendsddf +#elif BFP_KIND == 3 +#define BFP_TO_DFP __truncxfsd +#define DFP_TO_BFP __extendsdxf +#endif /* BFP_KIND */ + +#elif WIDTH == 64 +#if BFP_KIND == 1 +#define BFP_TO_DFP __extendsfdd +#define DFP_TO_BFP __truncddsf +#elif BFP_KIND == 2 +#define BFP_TO_DFP __extenddfdd +#define DFP_TO_BFP __truncdddf +#elif BFP_KIND == 3 +#define BFP_TO_DFP __truncxfdd +#define DFP_TO_BFP __extendddxf +#endif /* BFP_KIND */ + +#elif WIDTH == 128 +#if BFP_KIND == 1 +#define BFP_TO_DFP __extendsftd +#define DFP_TO_BFP __trunctdsf +#elif BFP_KIND == 2 +#define BFP_TO_DFP __extenddftd +#define DFP_TO_BFP __trunctddf +#elif BFP_KIND == 3 +#define BFP_TO_DFP __extendxftd +#define DFP_TO_BFP __trunctdxf +#endif /* BFP_KIND */ + +#endif /* WIDTH */ + +/* Some handy typedefs. */ + +typedef float SFtype __attribute__ ((mode (SF))); +typedef float DFtype __attribute__ ((mode (DF))); +#if LIBGCC2_HAS_XF_MODE +typedef float XFtype __attribute__ ((mode (XF))); +#endif /* LIBGCC2_HAS_XF_MODE */ + +typedef int SItype __attribute__ ((mode (SI))); +typedef int DItype __attribute__ ((mode (DI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef unsigned int UDItype __attribute__ ((mode (DI))); + +/* The type of the result of a decimal float comparison. This must + match `word_mode' in GCC for the target. */ + +typedef int CMPtype __attribute__ ((mode (word))); + +/* Prototypes. */ + +#if defined (L_mul_sd) || defined (L_mul_dd) || defined (L_mul_td) +extern DFP_C_TYPE DFP_MULTIPLY (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_div_sd) || defined (L_div_dd) || defined (L_div_td) +extern DFP_C_TYPE DFP_DIVIDE (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_addsub_sd) || defined (L_addsub_dd) || defined (L_addsub_td) +extern DFP_C_TYPE DFP_ADD (DFP_C_TYPE, DFP_C_TYPE); +extern DFP_C_TYPE DFP_SUB (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_eq_sd) || defined (L_eq_dd) || defined (L_eq_td) +extern CMPtype DFP_EQ (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_ne_sd) || defined (L_ne_dd) || defined (L_ne_td) +extern CMPtype DFP_NE (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_lt_sd) || defined (L_lt_dd) || defined (L_lt_td) +extern CMPtype DFP_LT (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_gt_sd) || defined (L_gt_dd) || defined (L_gt_td) +extern CMPtype DFP_GT (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_le_sd) || defined (L_le_dd) || defined (L_le_td) +extern CMPtype DFP_LE (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_ge_sd) || defined (L_ge_dd) || defined (L_ge_td) +extern CMPtype DFP_GE (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_unord_sd) || defined (L_unord_dd) || defined (L_unord_td) +extern CMPtype DFP_UNORD (DFP_C_TYPE, DFP_C_TYPE); +#endif + +#if defined (L_sd_to_dd) || defined (L_sd_to_td) || defined (L_dd_to_sd) \ + || defined (L_dd_to_td) || defined (L_td_to_sd) || defined (L_td_to_dd) +extern DFP_C_TYPE_TO DFP_TO_DFP (DFP_C_TYPE); +#endif + +#if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si) \ + || defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di) \ + || defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi) \ + || defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi) +extern INT_TYPE DFP_TO_INT (DFP_C_TYPE); +#endif + +#if defined (L_si_to_sd) || defined (L_si_to_dd) || defined (L_si_to_td) \ + || defined (L_di_to_sd) || defined (L_di_to_dd) || defined (L_di_to_td) \ + || defined (L_usi_to_sd) || defined (L_usi_to_dd) || defined (L_usi_to_td) \ + || defined (L_udi_to_sd) || defined (L_udi_to_dd) || defined (L_udi_to_td) +extern DFP_C_TYPE INT_TO_DFP (INT_TYPE); +#endif + +#if defined (L_sd_to_sf) || defined (L_dd_to_sf) || defined (L_td_to_sf) \ + || defined (L_sd_to_df) || defined (L_dd_to_df) || defined (L_td_to_df) \ + || ((defined (L_sd_to_xf) || defined (L_dd_to_xf) || defined (L_td_to_xf)) \ + && LIBGCC2_HAS_XF_MODE) +extern BFP_TYPE DFP_TO_BFP (DFP_C_TYPE); +#endif + +#if defined (L_sf_to_sd) || defined (L_sf_to_dd) || defined (L_sf_to_td) \ + || defined (L_df_to_sd) || defined (L_df_to_dd) || defined (L_df_to_td) \ + || ((defined (L_xf_to_sd) || defined (L_xf_to_dd) || defined (L_xf_to_td)) \ + && LIBGCC2_HAS_XF_MODE) +extern DFP_C_TYPE BFP_TO_DFP (BFP_TYPE); +#endif + +#endif /* _DFPBIT_H */ diff --git a/contrib/gcc/config/elfos.h b/contrib/gcc/config/elfos.h index 6a138f9f76f..a2bd49f909a 100644 --- a/contrib/gcc/config/elfos.h +++ b/contrib/gcc/config/elfos.h @@ -1,6 +1,6 @@ /* elfos.h -- operating system specific defines to be used when targeting GCC for some generic ELF system - Copyright (C) 1991, 1994, 1995, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1991, 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Based on svr4.h contributed by Ron Guilmette (rfg@netcom.com). @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OBJFMT_CPP_BUILTINS() \ do \ @@ -58,10 +58,6 @@ Boston, MA 02111-1307, USA. */ #define PCC_BITFIELD_TYPE_MATTERS 1 #endif -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 @@ -225,6 +221,8 @@ Boston, MA 02111-1307, USA. */ #define TARGET_ASM_SELECT_RTX_SECTION default_elf_select_rtx_section #undef TARGET_ASM_SELECT_SECTION #define TARGET_ASM_SELECT_SECTION default_elf_select_section +#undef TARGET_HAVE_SWITCHABLE_BSS_SECTIONS +#define TARGET_HAVE_SWITCHABLE_BSS_SECTIONS true /* Define the strings used for the special svr4 .type and .size directives. These strings generally do not vary from one system running svr4 to @@ -431,14 +429,15 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \ do \ { \ - register const unsigned char *_ascii_bytes = \ + const unsigned char *_ascii_bytes = \ (const unsigned char *) (STR); \ - register const unsigned char *limit = _ascii_bytes + (LENGTH); \ - register unsigned bytes_in_chunk = 0; \ + const unsigned char *limit = _ascii_bytes + (LENGTH); \ + const unsigned char *last_null = NULL; \ + unsigned bytes_in_chunk = 0; \ \ for (; _ascii_bytes < limit; _ascii_bytes++) \ { \ - register const unsigned char *p; \ + const unsigned char *p; \ \ if (bytes_in_chunk >= 60) \ { \ @@ -446,8 +445,14 @@ Boston, MA 02111-1307, USA. */ bytes_in_chunk = 0; \ } \ \ - for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ - continue; \ + if (_ascii_bytes > last_null) \ + { \ + for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \ + continue; \ + last_null = p; \ + } \ + else \ + p = last_null; \ \ if (p < limit && (p - _ascii_bytes) <= (long)STRING_LIMIT) \ { \ diff --git a/contrib/gcc/config/floatunsidf.c b/contrib/gcc/config/floatunsidf.c new file mode 100644 index 00000000000..ff28112502b --- /dev/null +++ b/contrib/gcc/config/floatunsidf.c @@ -0,0 +1,15 @@ +/* Public domain. */ +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef float DFtype __attribute__ ((mode (DF))); + +DFtype +__floatunsidf (USItype u) +{ + SItype s = (SItype) u; + DFtype r = (DFtype) s; + if (s < 0) + r += (DFtype)2.0 * (DFtype) ((USItype) 1 + << (sizeof (USItype) * __CHAR_BIT__ - 1)); + return r; +} diff --git a/contrib/gcc/config/floatunsisf.c b/contrib/gcc/config/floatunsisf.c new file mode 100644 index 00000000000..11d4aa78cbe --- /dev/null +++ b/contrib/gcc/config/floatunsisf.c @@ -0,0 +1,18 @@ +/* Public domain. */ +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef float SFtype __attribute__ ((mode (SF))); + +SFtype +__floatunsisf (USItype u) +{ + SItype s = (SItype) u; + if (s < 0) + { + /* As in expand_float, compute (u & 1) | (u >> 1) to ensure + correct rounding if a nonzero bit is shifted out. */ + return (SFtype) 2.0 * (SFtype) (SItype) ((u & 1) | (u >> 1)); + } + else + return (SFtype) s; +} diff --git a/contrib/gcc/config/floatunsitf.c b/contrib/gcc/config/floatunsitf.c new file mode 100644 index 00000000000..955d67666c5 --- /dev/null +++ b/contrib/gcc/config/floatunsitf.c @@ -0,0 +1,15 @@ +/* Public domain. */ +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef float TFtype __attribute__ ((mode (TF))); + +TFtype +__floatunsitf (USItype u) +{ + SItype s = (SItype) u; + TFtype r = (TFtype) s; + if (s < 0) + r += (TFtype)2.0 * (TFtype) ((USItype) 1 + << (sizeof (USItype) * __CHAR_BIT__ - 1)); + return r; +} diff --git a/contrib/gcc/config/floatunsixf.c b/contrib/gcc/config/floatunsixf.c new file mode 100644 index 00000000000..52511688dad --- /dev/null +++ b/contrib/gcc/config/floatunsixf.c @@ -0,0 +1,15 @@ +/* Public domain. */ +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef float XFtype __attribute__ ((mode (XF))); + +XFtype +__floatunsixf (USItype u) +{ + SItype s = (SItype) u; + XFtype r = (XFtype) s; + if (s < 0) + r += (XFtype)2.0 * (XFtype) ((USItype) 1 + << (sizeof (USItype) * __CHAR_BIT__ - 1)); + return r; +} diff --git a/contrib/gcc/config/fp-bit.c b/contrib/gcc/config/fp-bit.c index e7556c4f849..bdf04ffd312 100644 --- a/contrib/gcc/config/fp-bit.c +++ b/contrib/gcc/config/fp-bit.c @@ -1,37 +1,33 @@ /* This is a software floating point library which can be used for targets without hardware floating point. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. -This file is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. In addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the -compiled version of this file with other programs, and to distribute -those programs without any restriction coming from the use of this -file. (The General Public License restrictions do apply in other -respects; for example, they cover modification of the file, and -distribution when not linked into another program.) +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) -This file is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. You should have received a copy of the GNU General Public License -along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ /* This implements IEEE 754 format arithmetic, but does not provide a mechanism for setting the rounding mode, or for generating or handling @@ -160,14 +156,15 @@ INLINE static int isnan ( fp_number_type * x) { - return x->class == CLASS_SNAN || x->class == CLASS_QNAN; + return __builtin_expect (x->class == CLASS_SNAN || x->class == CLASS_QNAN, + 0); } INLINE static int isinf ( fp_number_type * x) { - return x->class == CLASS_INFINITY; + return __builtin_expect (x->class == CLASS_INFINITY, 0); } #endif /* NO_NANS */ @@ -186,6 +183,22 @@ flip_sign ( fp_number_type * x) x->sign = !x->sign; } +/* Count leading zeroes in N. */ +INLINE +static int +clzusi (USItype n) +{ + extern int __clzsi2 (USItype); + if (sizeof (USItype) == sizeof (unsigned int)) + return __builtin_clz (n); + else if (sizeof (USItype) == sizeof (unsigned long)) + return __builtin_clzl (n); + else if (sizeof (USItype) == sizeof (unsigned long long)) + return __builtin_clzll (n); + else + return __clzsi2 (n); +} + extern FLO_type pack_d ( fp_number_type * ); #if defined(L_pack_df) || defined(L_pack_sf) || defined(L_pack_tf) @@ -233,7 +246,7 @@ pack_d ( fp_number_type * src) } else { - if (src->normal_exp < NORMAL_EXPMIN) + if (__builtin_expect (src->normal_exp < NORMAL_EXPMIN, 0)) { #ifdef NO_DENORMALS /* Go straight to a zero representation if denormals are not @@ -280,7 +293,7 @@ pack_d ( fp_number_type * src) #endif /* NO_DENORMALS */ } else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) - && src->normal_exp > EXPBIAS) + && __builtin_expect (src->normal_exp > EXPBIAS, 0)) { exp = EXPMAX; fraction = 0; @@ -544,7 +557,8 @@ unpack_d (FLO_union_type * src, fp_number_type * dst) dst->fraction.ll = fraction; } } - else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) && exp == EXPMAX) + else if (!LARGEST_EXPONENT_IS_NORMAL (FRAC_NBITS) + && __builtin_expect (exp == EXPMAX, 0)) { /* Huge exponent*/ if (fraction == 0) @@ -633,6 +647,7 @@ _fpadd_parts (fp_number_type * a, they're the same */ { int diff; + int sdiff; a_normal_exp = a->normal_exp; b_normal_exp = b->normal_exp; @@ -640,21 +655,21 @@ _fpadd_parts (fp_number_type * a, b_fraction = b->fraction.ll; diff = a_normal_exp - b_normal_exp; + sdiff = diff; if (diff < 0) diff = -diff; if (diff < FRAC_NBITS) { - /* ??? This does shifts one bit at a time. Optimize. */ - while (a_normal_exp > b_normal_exp) + if (sdiff > 0) { - b_normal_exp++; - LSHIFT (b_fraction); + b_normal_exp += diff; + LSHIFT (b_fraction, diff); } - while (b_normal_exp > a_normal_exp) + else if (sdiff < 0) { - a_normal_exp++; - LSHIFT (a_fraction); + a_normal_exp += diff; + LSHIFT (a_fraction, diff); } } else @@ -715,7 +730,7 @@ _fpadd_parts (fp_number_type * a, if (tmp->fraction.ll >= IMPLICIT_2) { - LSHIFT (tmp->fraction.ll); + LSHIFT (tmp->fraction.ll, 1); tmp->normal_exp++; } return tmp; @@ -899,32 +914,28 @@ _fpmul_parts ( fp_number_type * a, high |= 1; low <<= 1; } - /* rounding is tricky. if we only round if it won't make us round later. */ -#if 0 - if (low & FRACHIGH2) - { - if (((high & GARDMASK) != GARDMSB) - && (((high + 1) & GARDMASK) == GARDMSB)) - { - /* don't round, it gets done again later. */ - } - else - { - high++; - } - } -#endif + if (!ROUND_TOWARDS_ZERO && (high & GARDMASK) == GARDMSB) { if (high & (1 << NGARDS)) { - /* half way, so round to even */ - high += GARDROUND + 1; + /* Because we're half way, we would round to even by adding + GARDROUND + 1, except that's also done in the packing + function, and rounding twice will lose precision and cause + the result to be too far off. Example: 32-bit floats with + bit patterns 0xfff * 0x3f800400 ~= 0xfff (less than 0.5ulp + off), not 0x1000 (more than 0.5ulp off). */ } else if (low) { - /* but we really weren't half way */ + /* We're a further than half way by a small amount corresponding + to the bits set in "low". Knowing that, we round here and + not in pack_d, because there we don't have "low" available + anymore. */ high += GARDROUND + 1; + + /* Avoid further rounding in pack_d. */ + high &= ~(fractype) GARDMASK; } } tmp->fraction.ll = high; @@ -951,7 +962,7 @@ multiply (FLO_type arg_a, FLO_type arg_b) return pack_d (res); } -#endif /* L_mul_sf || L_mul_df */ +#endif /* L_mul_sf || L_mul_df || L_mul_tf */ #if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf) static inline __attribute__ ((__always_inline__)) fp_number_type * @@ -1028,13 +1039,21 @@ _fpdiv_parts (fp_number_type * a, { if (quotient & (1 << NGARDS)) { - /* half way, so round to even */ - quotient += GARDROUND + 1; + /* Because we're half way, we would round to even by adding + GARDROUND + 1, except that's also done in the packing + function, and rounding twice will lose precision and cause + the result to be too far off. */ } else if (numerator) { - /* but we really weren't half way, more bits exist */ + /* We're a further than half way by the small amount + corresponding to the bits set in "numerator". Knowing + that, we round here and not in pack_d, because there we + don't have "numerator" available anymore. */ quotient += GARDROUND + 1; + + /* Avoid further rounding in pack_d. */ + quotient &= ~(fractype) GARDMASK; } } @@ -1330,6 +1349,8 @@ si_to_float (SItype arg_a) } else { + USItype uarg; + int shift; in.normal_exp = FRACBITS + NGARDS; if (in.sign) { @@ -1339,15 +1360,17 @@ si_to_float (SItype arg_a) { return (FLO_type)(- MAX_SI_INT - 1); } - in.fraction.ll = (-arg_a); + uarg = (-arg_a); } else - in.fraction.ll = arg_a; + uarg = arg_a; - while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS))) + in.fraction.ll = uarg; + shift = clzusi (uarg) - (BITS_PER_SI - 1 - FRACBITS - NGARDS); + if (shift > 0) { - in.fraction.ll <<= 1; - in.normal_exp -= 1; + in.fraction.ll <<= shift; + in.normal_exp -= shift; } } return pack_d (&in); @@ -1367,19 +1390,23 @@ usi_to_float (USItype arg_a) } else { + int shift; in.class = CLASS_NUMBER; in.normal_exp = FRACBITS + NGARDS; in.fraction.ll = arg_a; - while (in.fraction.ll > ((fractype)1 << (FRACBITS + NGARDS))) - { - in.fraction.ll >>= 1; - in.normal_exp += 1; - } - while (in.fraction.ll < ((fractype)1 << (FRACBITS + NGARDS))) + shift = clzusi (arg_a) - (BITS_PER_SI - 1 - FRACBITS - NGARDS); + if (shift < 0) { - in.fraction.ll <<= 1; - in.normal_exp -= 1; + fractype guard = in.fraction.ll & (((fractype)1 << -shift) - 1); + in.fraction.ll >>= -shift; + in.fraction.ll |= (guard != 0); + in.normal_exp -= shift; + } + else if (shift > 0) + { + in.fraction.ll <<= shift; + in.normal_exp -= shift; } } return pack_d (&in); diff --git a/contrib/gcc/config/fp-bit.h b/contrib/gcc/config/fp-bit.h index 6221c9ede07..0f03f87ee1a 100644 --- a/contrib/gcc/config/fp-bit.h +++ b/contrib/gcc/config/fp-bit.h @@ -1,30 +1,31 @@ /* Header file for fp-bit.c. */ -/* Copyright (C) 2000, 2002, 2003 - Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of GCC. -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. 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. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ #ifndef GCC_FP_BIT_H #define GCC_FP_BIT_H @@ -88,7 +89,9 @@ Boston, MA 02111-1307, USA. */ #endif /* ! FINE_GRAINED_LIBRARIES */ #if __LDBL_MANT_DIG__ == 113 || __LDBL_MANT_DIG__ == 106 -# define TMODES +# if defined(TFLOAT) || defined(L_sf_to_tf) || defined(L_df_to_tf) +# define TMODES +# endif #endif typedef float SFtype __attribute__ ((mode (SF))); @@ -104,9 +107,10 @@ typedef int DItype __attribute__ ((mode (DI))); typedef int TItype __attribute__ ((mode (TI))); #endif -/* The type of the result of a fp compare */ +/* The type of the result of a floating point comparison. This must + match `word_mode' in GCC for the target. */ #ifndef CMPtype -#define CMPtype SItype +typedef int CMPtype __attribute__ ((mode (word))); #endif typedef unsigned int UHItype __attribute__ ((mode (HI))); @@ -319,7 +323,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #endif /* Preserve the sticky-bit when shifting fractions to the right. */ -#define LSHIFT(a) { a = (a & 1) | (a >> 1); } +#define LSHIFT(a, s) { a = (a >> s) | !!(a & (((fractype) 1 << s) - 1)); } /* numeric parameters */ /* F_D_BITOFF is the number of bits offset between the MSB of the mantissa diff --git a/contrib/gcc/config/freebsd-nthr.h b/contrib/gcc/config/freebsd-nthr.h index 65add9b175e..711ce0e65f6 100644 --- a/contrib/gcc/config/freebsd-nthr.h +++ b/contrib/gcc/config/freebsd-nthr.h @@ -16,7 +16,7 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define FBSD_NO_THREADS diff --git a/contrib/gcc/config/freebsd-spec.h b/contrib/gcc/config/freebsd-spec.h index 8acf0cada94..b3f18e20b65 100644 --- a/contrib/gcc/config/freebsd-spec.h +++ b/contrib/gcc/config/freebsd-spec.h @@ -1,5 +1,5 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify @@ -51,22 +51,7 @@ Boston, MA 02111-1307, USA. */ #define FBSD_TARGET_OS_CPP_BUILTINS() \ do \ { \ - if (FBSD_MAJOR == 9) \ - builtin_define ("__FreeBSD__=9"); \ - else if (FBSD_MAJOR == 8) \ - builtin_define ("__FreeBSD__=8"); \ - if (FBSD_MAJOR == 7) \ - builtin_define ("__FreeBSD__=7"); \ - else if (FBSD_MAJOR == 6) \ - builtin_define ("__FreeBSD__=6"); \ - else if (FBSD_MAJOR == 5) \ - builtin_define ("__FreeBSD__=5"); \ - else if (FBSD_MAJOR == 4) \ - builtin_define ("__FreeBSD__=4"); \ - else if (FBSD_MAJOR == 3) \ - builtin_define ("__FreeBSD__=3"); \ - else \ - builtin_define ("__FreeBSD__"); \ + builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ builtin_define_std ("unix"); \ builtin_define ("__KPRINTF_ATTRIBUTE__"); \ builtin_assert ("system=unix"); \ @@ -76,7 +61,7 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* Define the default FreeBSD-specific per-CPU hook code. */ +/* Define the default FreeBSD-specific per-CPU hook code. */ #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) /* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC @@ -84,7 +69,7 @@ Boston, MA 02111-1307, USA. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ - %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ + %(cpp_arch) \ %{posix:-D_POSIX_SOURCE}" /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add @@ -124,7 +109,7 @@ Boston, MA 02111-1307, USA. */ /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate libc, depending on whether we're doing profiling or need threads support. - (simular to the default, except no -lg, and no -p). */ + (similar to the default, except no -lg, and no -p). */ #ifdef FBSD_NO_THREADS #define FBSD_LIB_SPEC " \ diff --git a/contrib/gcc/config/freebsd.h b/contrib/gcc/config/freebsd.h index 542fd0ba61f..21dc81e6013 100644 --- a/contrib/gcc/config/freebsd.h +++ b/contrib/gcc/config/freebsd.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify @@ -84,4 +84,4 @@ Boston, MA 02111-1307, USA. */ /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. This enables the test coverage code to use file locking when exiting a program, which avoids race conditions if the program has forked. */ -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO diff --git a/contrib/gcc/config/gnu.h b/contrib/gcc/config/gnu.h index 23a8a730ec9..79c64c77ba9 100644 --- a/contrib/gcc/config/gnu.h +++ b/contrib/gcc/config/gnu.h @@ -12,10 +12,6 @@ #undef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/include" -/* Implicit library calls should use memcpy, not bcopy, etc. */ -#undef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS - /* The system headers under GNU are C++-aware. */ #define NO_IMPLICIT_EXTERN_C diff --git a/contrib/gcc/config/gofast.h b/contrib/gcc/config/gofast.h index 81dd9f61b66..67b5c489f82 100644 --- a/contrib/gcc/config/gofast.h +++ b/contrib/gcc/config/gofast.h @@ -1,5 +1,6 @@ /* US Software GOFAST floating point library support. - Copyright (C) 1994, 1998, 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1994, 1998, 1999, 2002, 2003, 2004 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* The US Software GOFAST library requires special optabs support. This file is intended to be included by config/ARCH/ARCH.c. It diff --git a/contrib/gcc/config/host-darwin.c b/contrib/gcc/config/host-darwin.c new file mode 100644 index 00000000000..d8819515476 --- /dev/null +++ b/contrib/gcc/config/host-darwin.c @@ -0,0 +1,79 @@ +/* Darwin host-specific hook definitions. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include +#include "toplev.h" +#include "config/host-darwin.h" + +/* Yes, this is really supposed to work. */ +static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); + +/* Return the address of the PCH address space, if the PCH will fit in it. */ + +void * +darwin_gt_pch_get_address (size_t sz, int fd ATTRIBUTE_UNUSED) +{ + if (sz <= sizeof (pch_address_space)) + return pch_address_space; + else + return NULL; +} + +/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of + pch_address_space beyond SZ. */ + +int +darwin_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) +{ + const size_t pagesize = getpagesize(); + void *mmap_result; + int ret; + + gcc_assert ((size_t)pch_address_space % pagesize == 0 + && sizeof (pch_address_space) % pagesize == 0); + + ret = (addr == pch_address_space && sz <= sizeof (pch_address_space)); + if (! ret) + sz = 0; + + /* Round the size to a whole page size. Normally this is a no-op. */ + sz = (sz + pagesize - 1) / pagesize * pagesize; + + if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0) + fatal_error ("couldn't unmap pch_address_space: %m"); + + if (ret) + { + mmap_result = mmap (addr, sz, + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, + fd, off); + + /* The file might not be mmap-able. */ + ret = mmap_result != (void *) MAP_FAILED; + + /* Sanity check for broken MAP_FIXED. */ + gcc_assert (!ret || mmap_result == addr); + } + + return ret; +} diff --git a/contrib/gcc/config/host-darwin.h b/contrib/gcc/config/host-darwin.h new file mode 100644 index 00000000000..98b2a3fc360 --- /dev/null +++ b/contrib/gcc/config/host-darwin.h @@ -0,0 +1,28 @@ +/* Darwin host-specific hook definitions. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +extern void * darwin_gt_pch_get_address (size_t sz, int fd); +extern int darwin_gt_pch_use_address (void *addr, size_t sz, int fd, + size_t off); + +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS +#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_gt_pch_get_address +#undef HOST_HOOKS_GT_PCH_USE_ADDRESS +#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_gt_pch_use_address diff --git a/contrib/gcc/config/host-hpux.c b/contrib/gcc/config/host-hpux.c new file mode 100644 index 00000000000..2ca5ba9bc49 --- /dev/null +++ b/contrib/gcc/config/host-hpux.c @@ -0,0 +1,136 @@ +/* HP-UX host-specific hook definitions. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include +#include +#include "hosthooks.h" +#include "hosthooks-def.h" + +#ifndef MAP_FAILED +#define MAP_FAILED (void *)-1L +#endif + +static void *hpux_gt_pch_get_address (size_t, int); +static int hpux_gt_pch_use_address (void *, size_t, int, size_t); + +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS +#define HOST_HOOKS_GT_PCH_GET_ADDRESS hpux_gt_pch_get_address +#undef HOST_HOOKS_GT_PCH_USE_ADDRESS +#define HOST_HOOKS_GT_PCH_USE_ADDRESS hpux_gt_pch_use_address + +/* For various ports, try to guess a fixed spot in the vm space + that's probably free. */ +#if (defined(__hppa__) || defined(__ia64__)) && defined(__LP64__) +# define TRY_EMPTY_VM_SPACE 0x8000000000000000 +#elif defined(__hppa__) || defined(__ia64__) +# define TRY_EMPTY_VM_SPACE 0x60000000 +#else +# define TRY_EMPTY_VM_SPACE 0 +#endif + +/* Determine a location where we might be able to reliably allocate + SIZE bytes. FD is the PCH file, though we should return with the + file unmapped. */ + +static void * +hpux_gt_pch_get_address (size_t size, int fd) +{ + void *addr; + + addr = mmap ((void *)TRY_EMPTY_VM_SPACE, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE, fd, 0); + + /* If we failed the map, that means there's *no* free space. */ + if (addr == (void *) MAP_FAILED) + return NULL; + /* Unmap the area before returning. */ + munmap (addr, size); + + return addr; +} + +/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at + mapping the data at BASE, -1 if we couldn't. + + It's not possibly to reliably mmap a file using MAP_PRIVATE to + a specific START address on either hpux or linux. First we see + if mmap with MAP_PRIVATE works. If it does, we are off to the + races. If it doesn't, we try an anonymous private mmap since the + kernel is more likely to honor the BASE address in anonymous maps. + We then copy the data to the anonymous private map. This assumes + of course that we don't need to change the data in the PCH file + after it is created. + + This approach obviously causes a performance penalty but there is + little else we can do given the current PCH implementation. */ + +static int +hpux_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) +{ + void *addr; + + /* We're called with size == 0 if we're not planning to load a PCH + file at all. This allows the hook to free any static space that + we might have allocated at link time. */ + if (size == 0) + return -1; + + /* Try to map the file with MAP_PRIVATE. */ + addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset); + + if (addr == base) + return 1; + + if (addr != (void *) MAP_FAILED) + munmap (addr, size); + + /* Try to make an anonymous private mmap at the desired location. */ + addr = mmap (base, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + if (addr != base) + { + if (addr != (void *) MAP_FAILED) + munmap (addr, size); + return -1; + } + + if (lseek (fd, offset, SEEK_SET) == (off_t)-1) + return -1; + + while (size) + { + ssize_t nbytes; + + nbytes = read (fd, base, MIN (size, SSIZE_MAX)); + if (nbytes <= 0) + return -1; + base = (char *) base + nbytes; + size -= nbytes; + } + + return 1; +} + + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/host-linux.c b/contrib/gcc/config/host-linux.c index d5fea9d79b3..795bb552234 100644 --- a/contrib/gcc/config/host-linux.c +++ b/contrib/gcc/config/host-linux.c @@ -15,8 +15,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "config.h" #include "system.h" diff --git a/contrib/gcc/config/host-solaris.c b/contrib/gcc/config/host-solaris.c index 4fa7a5b1ad0..df5f47391a7 100644 --- a/contrib/gcc/config/host-solaris.c +++ b/contrib/gcc/config/host-solaris.c @@ -15,8 +15,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "config.h" #include "system.h" diff --git a/contrib/gcc/config/i386/athlon.md b/contrib/gcc/config/i386/athlon.md index 4ce9a3812d8..6d92b948b4d 100644 --- a/contrib/gcc/config/i386/athlon.md +++ b/contrib/gcc/config/i386/athlon.md @@ -123,7 +123,7 @@ (define_cpu_unit "athlon-fmul" "athlon_fp") (define_cpu_unit "athlon-fstore" "athlon_fp") (define_reservation "athlon-fany" "(athlon-fstore | athlon-fmul | athlon-fadd)") -(define_reservation "athlon-faddmul" "(athlon-fmul | athlon-fadd)") +(define_reservation "athlon-faddmul" "(athlon-fadd | athlon-fmul)") ;; Vector operations usually consume many of pipes. (define_reservation "athlon-fvector" "(athlon-fadd + athlon-fmul + athlon-fstore)") @@ -131,26 +131,26 @@ ;; Jump instructions are executed in the branch unit completely transparent to us (define_insn_reservation "athlon_branch" 0 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "ibr")) "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_call" 0 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "call,callv")) "athlon-vector,athlon-ieu") ;; Latency of push operation is 3 cycles, but ESP value is available ;; earlier (define_insn_reservation "athlon_push" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "push")) "athlon-direct,athlon-agu,athlon-store") (define_insn_reservation "athlon_pop" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "pop")) "athlon-vector,athlon-load,athlon-ieu") (define_insn_reservation "athlon_pop_k8" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "pop")) "athlon-double,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave" 3 @@ -158,13 +158,13 @@ (eq_attr "type" "leave")) "athlon-vector,(athlon-ieu+athlon-load)") (define_insn_reservation "athlon_leave_k8" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "leave")) "athlon-double,(athlon-ieu+athlon-load)") ;; Lea executes in AGU unit with 2 cycles latency. (define_insn_reservation "athlon_lea" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "lea")) "athlon-direct,athlon-agu,nothing") @@ -176,13 +176,13 @@ "athlon-vector,athlon-ieu0,athlon-mult,nothing,nothing,athlon-ieu0") ;; ??? Widening multiply is vector or double. (define_insn_reservation "athlon_imul_k8_DI" 4 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "none,unknown")))) "athlon-direct0,athlon-ieu0,athlon-mult,nothing,athlon-ieu0") (define_insn_reservation "athlon_imul_k8" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "imul") (eq_attr "memory" "none,unknown"))) "athlon-direct0,athlon-ieu0,athlon-mult,athlon-ieu0") @@ -192,18 +192,18 @@ (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8_DI" 7 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "imul") (and (eq_attr "mode" "DI") (eq_attr "memory" "load,both")))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,nothing,athlon-ieu") (define_insn_reservation "athlon_imul_mem_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "imul") (eq_attr "memory" "load,both"))) "athlon-vector,athlon-load,athlon-ieu,athlon-mult,athlon-ieu") -;; Idiv can not execute in parallel with other instructions. Dealing with it +;; Idiv cannot execute in parallel with other instructions. Dealing with it ;; as with short latency vector instruction is good approximation avoiding ;; scheduler from trying too hard to can hide it's latency by overlap with ;; other instructions. @@ -211,59 +211,59 @@ ;; of the other code (define_insn_reservation "athlon_idiv" 6 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "idiv") (eq_attr "memory" "none,unknown"))) "athlon-vector,(athlon-ieu0*6+(athlon-fpsched,athlon-fvector))") (define_insn_reservation "athlon_idiv_mem" 9 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "idiv") (eq_attr "memory" "load,both"))) "athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))") ;; The parallelism of string instructions is not documented. Model it same way ;; as idiv to create smaller automata. This probably does not matter much. (define_insn_reservation "athlon_str" 6 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "str") (eq_attr "memory" "load,both,store"))) "athlon-vector,athlon-load,athlon-ieu0*6") (define_insn_reservation "athlon_idirect" 1 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-direct,athlon-ieu") (define_insn_reservation "athlon_ivector" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "none,unknown")))) "athlon-vector,athlon-ieu,athlon-ieu") (define_insn_reservation "athlon_idirect_loadmov" 3 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "imov") (eq_attr "memory" "load"))) "athlon-direct,athlon-load") (define_insn_reservation "athlon_idirect_load" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-direct,athlon-load,athlon-ieu") (define_insn_reservation "athlon_ivector_load" 6 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "load")))) "athlon-vector,athlon-load,athlon-ieu,athlon-ieu") (define_insn_reservation "athlon_idirect_movstore" 1 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "imov") (eq_attr "memory" "store"))) "athlon-direct,athlon-agu,athlon-store") (define_insn_reservation "athlon_idirect_both" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "both")))) @@ -271,7 +271,7 @@ athlon-ieu,athlon-store, athlon-store") (define_insn_reservation "athlon_ivector_both" 6 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "both")))) @@ -280,14 +280,14 @@ athlon-ieu, athlon-store") (define_insn_reservation "athlon_idirect_store" 1 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "store")))) "athlon-direct,(athlon-ieu+athlon-agu), athlon-store") (define_insn_reservation "athlon_ivector_store" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "unit" "integer,unknown") (eq_attr "memory" "store")))) @@ -302,7 +302,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,athlon-fpload2,athlon-fvector*9") (define_insn_reservation "athlon_fldxf_k8" 13 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "load") (eq_attr "mode" "XF")))) @@ -314,7 +314,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fany") (define_insn_reservation "athlon_fld_k8" 2 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fmov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") @@ -326,7 +326,7 @@ (eq_attr "mode" "XF")))) "athlon-vector,(athlon-fpsched+athlon-agu),(athlon-store2+(athlon-fvector*7))") (define_insn_reservation "athlon_fstxf_k8" 8 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fmov") (and (eq_attr "memory" "store,both") (eq_attr "mode" "XF")))) @@ -337,16 +337,16 @@ (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fst_k8" 2 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fmov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fist" 4 - (and (eq_attr "cpu" "athlon,k8") - (eq_attr "type" "fistp")) + (and (eq_attr "cpu" "athlon,k8,generic64") + (eq_attr "type" "fistp,fisttp")) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") (define_insn_reservation "athlon_fmov" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fmov")) "athlon-direct,athlon-fpsched,athlon-faddmul") (define_insn_reservation "athlon_fadd_load" 4 @@ -355,12 +355,12 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fadd_load_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fop") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fadd" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fop")) "athlon-direct,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_fmul_load" 4 @@ -369,16 +369,16 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fmul_load_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fmul") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") (define_insn_reservation "athlon_fmul" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fmul")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fsgn" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fsgn")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_load" 24 @@ -387,7 +387,7 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_fdiv_load_k8" 13 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fdiv") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fmul") @@ -396,16 +396,16 @@ (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fdiv_k8" 11 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "fdiv")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_fpspc_load" 103 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "fpspc") (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload,athlon-fvector") (define_insn_reservation "athlon_fpspc" 100 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fpspc")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load" 7 @@ -418,12 +418,12 @@ (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_fcmov_load_k8" 17 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fcmov") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fvector") (define_insn_reservation "athlon_fcmov_k8" 15 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "fcmov")) "athlon-vector,athlon-fpsched,athlon-fvector") ;; fcomi is vector decoded by uses only one pipe. @@ -434,13 +434,13 @@ (eq_attr "memory" "load")))) "athlon-vector,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcomi_load_k8" 5 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fcmp") (and (eq_attr "athlon_decode" "vector") (eq_attr "memory" "load")))) "athlon-vector,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcomi" 3 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "athlon_decode" "vector") (eq_attr "type" "fcmp"))) "athlon-vector,athlon-fpsched,athlon-fadd") @@ -450,18 +450,18 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_fcom_load_k8" 4 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "fcmp") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_fcom" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "fcmp")) "athlon-direct,athlon-fpsched,athlon-fadd") ;; Never seen by the scheduler because we still don't do post reg-stack ;; scheduling. ;(define_insn_reservation "athlon_fxch" 2 -; (and (eq_attr "cpu" "athlon,k8") +; (and (eq_attr "cpu" "athlon,k8,generic64") ; (eq_attr "type" "fxch")) ; "athlon-direct,athlon-fpsched,athlon-fany") @@ -477,8 +477,13 @@ (and (eq_attr "type" "ssemov") (match_operand:DF 1 "memory_operand" ""))) "athlon-direct,athlon-fploadk8,athlon-fstore") +(define_insn_reservation "athlon_movsd_load_generic64" 2 + (and (eq_attr "cpu" "generic64") + (and (eq_attr "type" "ssemov") + (match_operand:DF 1 "memory_operand" ""))) + "athlon-double,athlon-fploadk8,(athlon-fstore+athlon-fmul)") (define_insn_reservation "athlon_movaps_load_k8" 2 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") (and (eq_attr "mode" "V4SF,V2DF,TI") (eq_attr "memory" "load")))) @@ -496,7 +501,7 @@ (eq_attr "memory" "load")))) "athlon-vector,athlon-fpload,(athlon-fany*2)") (define_insn_reservation "athlon_movss_load_k8" 1 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") (and (eq_attr "mode" "SF,DI") (eq_attr "memory" "load")))) @@ -507,57 +512,57 @@ (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fany") (define_insn_reservation "athlon_mmxsseld_k8" 2 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "load"))) "athlon-direct,athlon-fploadk8,athlon-fstore") (define_insn_reservation "athlon_mmxssest" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") (and (eq_attr "mode" "V4SF,V2DF,TI") (eq_attr "memory" "store,both")))) "athlon-vector,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store2)*2)") (define_insn_reservation "athlon_mmxssest_k8" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") (and (eq_attr "mode" "V4SF,V2DF,TI") (eq_attr "memory" "store,both")))) "athlon-double,(athlon-fpsched+athlon-agu),((athlon-fstore+athlon-store2)*2)") (define_insn_reservation "athlon_mmxssest_short" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "mmxmov,ssemov") (eq_attr "memory" "store,both"))) "athlon-direct,(athlon-fpsched+athlon-agu),(athlon-fstore+athlon-store)") -(define_insn_reservation "athlon_movaps" 2 - (and (eq_attr "cpu" "k8") +(define_insn_reservation "athlon_movaps_k8" 2 + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemov") (eq_attr "mode" "V4SF,V2DF,TI"))) - "athlon-double,athlon-fpsched,(athlon-faddmul+athlon-faddmul)") -(define_insn_reservation "athlon_movaps_k8" 2 + "athlon-double,athlon-fpsched,((athlon-faddmul+athlon-faddmul) | (athlon-faddmul, athlon-faddmul))") +(define_insn_reservation "athlon_movaps" 2 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssemov") (eq_attr "mode" "V4SF,V2DF,TI"))) "athlon-vector,athlon-fpsched,(athlon-faddmul+athlon-faddmul)") (define_insn_reservation "athlon_mmxssemov" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "mmxmov,ssemov")) "athlon-direct,athlon-fpsched,athlon-faddmul") (define_insn_reservation "athlon_mmxmul_load" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "mmxmul") (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_mmxmul" 3 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "mmxmul")) "athlon-direct,athlon-fpsched,athlon-fmul") (define_insn_reservation "athlon_mmx_load" 3 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "unit" "mmx") (eq_attr "memory" "load"))) "athlon-direct,athlon-fpload,athlon-faddmul") (define_insn_reservation "athlon_mmx" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "unit" "mmx")) "athlon-direct,athlon-fpsched,athlon-faddmul") ;; SSE operations are handled by the i387 unit as well. The latency @@ -565,23 +570,23 @@ (define_insn_reservation "athlon_sselog_load" 3 (and (eq_attr "cpu" "athlon") - (and (eq_attr "type" "sselog") + (and (eq_attr "type" "sselog,sselog1") (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload2,(athlon-fmul*2)") (define_insn_reservation "athlon_sselog_load_k8" 5 - (and (eq_attr "cpu" "k8") - (and (eq_attr "type" "sselog") + (and (eq_attr "cpu" "k8,generic64") + (and (eq_attr "type" "sselog,sselog1") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fmul*2)") (define_insn_reservation "athlon_sselog" 3 (and (eq_attr "cpu" "athlon") - (eq_attr "type" "sselog")) + (eq_attr "type" "sselog,sselog1")) "athlon-vector,athlon-fpsched,athlon-fmul*2") (define_insn_reservation "athlon_sselog_k8" 3 - (and (eq_attr "cpu" "k8") - (eq_attr "type" "sselog")) + (and (eq_attr "cpu" "k8,generic64") + (eq_attr "type" "sselog,sselog1")) "athlon-double,athlon-fpsched,athlon-fmul") -;; ??? pcmp executes in addmul, probably not wortwhile to brother about that. +;; ??? pcmp executes in addmul, probably not worthwhile to bother about that. (define_insn_reservation "athlon_ssecmp_load" 2 (and (eq_attr "cpu" "athlon") (and (eq_attr "type" "ssecmp") @@ -589,13 +594,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_ssecmp_load_k8" 4 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssecmp") (and (eq_attr "mode" "SF,DF,DI,TI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecmp" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecmp") (eq_attr "mode" "SF,DF,DI,TI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -605,7 +610,7 @@ (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload2,(athlon-fadd*2)") (define_insn_reservation "athlon_ssecmpvector_load_k8" 5 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssecmp") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") @@ -614,7 +619,7 @@ (eq_attr "type" "ssecmp")) "athlon-vector,athlon-fpsched,(athlon-fadd*2)") (define_insn_reservation "athlon_ssecmpvector_k8" 3 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssecmp")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") (define_insn_reservation "athlon_ssecomi_load" 4 @@ -623,12 +628,12 @@ (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_ssecomi_load_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssecomi") (eq_attr "memory" "load"))) "athlon-vector,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_ssecomi" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (eq_attr "type" "ssecmp")) "athlon-vector,athlon-fpsched,athlon-fadd") (define_insn_reservation "athlon_sseadd_load" 4 @@ -638,13 +643,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fadd") (define_insn_reservation "athlon_sseadd_load_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "sseadd") (and (eq_attr "mode" "SF,DF,DI") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fadd") (define_insn_reservation "athlon_sseadd" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "sseadd") (eq_attr "mode" "SF,DF,DI"))) "athlon-direct,athlon-fpsched,athlon-fadd") @@ -654,7 +659,7 @@ (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload2,(athlon-fadd*2)") (define_insn_reservation "athlon_sseaddvector_load_k8" 7 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "sseadd") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fadd*2)") @@ -663,7 +668,7 @@ (eq_attr "type" "sseadd")) "athlon-vector,athlon-fpsched,(athlon-fadd*2)") (define_insn_reservation "athlon_sseaddvector_k8" 5 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "sseadd")) "athlon-double,athlon-fpsched,(athlon-fadd*2)") @@ -673,28 +678,28 @@ ;; cvtss2sd (define_insn_reservation "athlon_ssecvt_cvtss2sd_load_k8" 4 - (and (eq_attr "cpu" "k8,athlon") + (and (eq_attr "cpu" "k8,athlon,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "direct") (and (eq_attr "mode" "DF") (eq_attr "memory" "load"))))) "athlon-direct,athlon-fploadk8,athlon-fstore") (define_insn_reservation "athlon_ssecvt_cvtss2sd" 2 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "direct") (eq_attr "mode" "DF")))) "athlon-direct,athlon-fpsched,athlon-fstore") ;; cvtps2pd. Model same way the other double decoded FP conversions. (define_insn_reservation "athlon_ssecvt_cvtps2pd_load_k8" 5 - (and (eq_attr "cpu" "k8,athlon") + (and (eq_attr "cpu" "k8,athlon,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "double") (and (eq_attr "mode" "V2DF,V4SF,TI") (eq_attr "memory" "load"))))) "athlon-double,athlon-fpload2k8,(athlon-fstore*2)") (define_insn_reservation "athlon_ssecvt_cvtps2pd_k8" 3 - (and (eq_attr "cpu" "k8,athlon") + (and (eq_attr "cpu" "k8,athlon,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "double") (eq_attr "mode" "V2DF,V4SF,TI")))) @@ -717,7 +722,7 @@ (eq_attr "memory" "load"))))) "athlon-vector,athlon-fpload,(athlon-fstore*2)") (define_insn_reservation "athlon_sseicvt_cvtsi2ss_load_k8" 9 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "sseicvt") (and (eq_attr "athlon_decode" "double") (and (eq_attr "mode" "SF,DF") @@ -725,7 +730,7 @@ "athlon-double,athlon-fploadk8,(athlon-fstore*2)") ;; cvtsi2sd reg,reg is double decoded (vector on Athlon) (define_insn_reservation "athlon_sseicvt_cvtsi2sd_k8" 11 - (and (eq_attr "cpu" "k8,athlon") + (and (eq_attr "cpu" "k8,athlon,generic64") (and (eq_attr "type" "sseicvt") (and (eq_attr "athlon_decode" "double") (and (eq_attr "mode" "SF,DF") @@ -733,7 +738,7 @@ "athlon-double,athlon-fploadk8,athlon-fstore") ;; cvtsi2ss reg, reg is doublepath (define_insn_reservation "athlon_sseicvt_cvtsi2ss" 14 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "sseicvt") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "mode" "SF,DF") @@ -741,7 +746,7 @@ "athlon-vector,athlon-fploadk8,(athlon-fvector*2)") ;; cvtsd2ss mem,reg is doublepath, troughput unknown, latency 9 (define_insn_reservation "athlon_ssecvt_cvtsd2ss_load_k8" 9 - (and (eq_attr "cpu" "k8,athlon") + (and (eq_attr "cpu" "k8,athlon,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "double") (and (eq_attr "mode" "SF") @@ -749,14 +754,14 @@ "athlon-double,athlon-fploadk8,(athlon-fstore*3)") ;; cvtsd2ss reg,reg is vectorpath, troughput unknown, latency 12 (define_insn_reservation "athlon_ssecvt_cvtsd2ss" 12 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "mode" "SF") (eq_attr "memory" "none"))))) "athlon-vector,athlon-fpsched,(athlon-fvector*3)") (define_insn_reservation "athlon_ssecvt_cvtpd2ps_load_k8" 8 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "mode" "V4SF,V2DF,TI") @@ -765,7 +770,7 @@ ;; cvtpd2ps mem,reg is vectorpath, troughput unknown, latency 10 ;; ??? Why it is fater than cvtsd2ss? (define_insn_reservation "athlon_ssecvt_cvtpd2ps" 8 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssecvt") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "mode" "V4SF,V2DF,TI") @@ -773,7 +778,7 @@ "athlon-vector,athlon-fpsched,athlon-fvector*2") ;; cvtsd2si mem,reg is doublepath, troughput 1, latency 9 (define_insn_reservation "athlon_secvt_cvtsX2si_load" 9 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "sseicvt") (and (eq_attr "athlon_decode" "vector") (and (eq_attr "mode" "SI,DI") @@ -788,7 +793,7 @@ (eq_attr "memory" "none"))))) "athlon-vector,athlon-fpsched,athlon-fvector") (define_insn_reservation "athlon_ssecvt_cvtsX2si_k8" 9 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "sseicvt") (and (eq_attr "athlon_decode" "double") (and (eq_attr "mode" "SI,DI") @@ -803,13 +808,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fmul") (define_insn_reservation "athlon_ssemul_load_k8" 6 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemul") (and (eq_attr "mode" "SF,DF") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fmul") (define_insn_reservation "athlon_ssemul" 4 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssemul") (eq_attr "mode" "SF,DF"))) "athlon-direct,athlon-fpsched,athlon-fmul") @@ -819,7 +824,7 @@ (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload2,(athlon-fmul*2)") (define_insn_reservation "athlon_ssemulvector_load_k8" 7 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssemul") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,(athlon-fmul*2)") @@ -828,7 +833,7 @@ (eq_attr "type" "ssemul")) "athlon-vector,athlon-fpsched,(athlon-fmul*2)") (define_insn_reservation "athlon_ssemulvector_k8" 5 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssemul")) "athlon-double,athlon-fpsched,(athlon-fmul*2)") ;; divsd timings. divss is faster @@ -839,13 +844,13 @@ (eq_attr "memory" "load")))) "athlon-direct,athlon-fpload,athlon-fmul*17") (define_insn_reservation "athlon_ssediv_load_k8" 22 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssediv") (and (eq_attr "mode" "SF,DF") (eq_attr "memory" "load")))) "athlon-direct,athlon-fploadk8,athlon-fmul*17") (define_insn_reservation "athlon_ssediv" 20 - (and (eq_attr "cpu" "athlon,k8") + (and (eq_attr "cpu" "athlon,k8,generic64") (and (eq_attr "type" "ssediv") (eq_attr "mode" "SF,DF"))) "athlon-direct,athlon-fpsched,athlon-fmul*17") @@ -855,7 +860,7 @@ (eq_attr "memory" "load"))) "athlon-vector,athlon-fpload2,athlon-fmul*34") (define_insn_reservation "athlon_ssedivvector_load_k8" 35 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (and (eq_attr "type" "ssediv") (eq_attr "memory" "load"))) "athlon-double,athlon-fpload2k8,athlon-fmul*34") @@ -864,6 +869,6 @@ (eq_attr "type" "ssediv")) "athlon-vector,athlon-fmul*34") (define_insn_reservation "athlon_ssedivvector_k8" 39 - (and (eq_attr "cpu" "k8") + (and (eq_attr "cpu" "k8,generic64") (eq_attr "type" "ssediv")) "athlon-double,athlon-fmul*34") diff --git a/contrib/gcc/config/i386/att.h b/contrib/gcc/config/i386/att.h index 4ee85ae6305..28d0f6ce27c 100644 --- a/contrib/gcc/config/i386/att.h +++ b/contrib/gcc/config/i386/att.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Define the syntax of instructions and addresses. */ diff --git a/contrib/gcc/config/i386/beos-elf.h b/contrib/gcc/config/i386/beos-elf.h index 50c39264bc0..f1e2cf8c6e1 100644 --- a/contrib/gcc/config/i386/beos-elf.h +++ b/contrib/gcc/config/i386/beos-elf.h @@ -1,5 +1,6 @@ /* Definitions for Intel x86 running BeOS - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (i386 BeOS/ELF)"); @@ -55,6 +56,8 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 16 +#define TARGET_DECLSPEC 1 + #define TARGET_OS_CPP_BUILTINS() \ do \ { \ @@ -63,13 +66,7 @@ Boston, MA 02111-1307, USA. */ builtin_define ("_X86_"); \ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ - builtin_define ("__declspec(x)=__attribute__((x))"); \ builtin_assert ("system=beos"); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) @@ -234,8 +231,5 @@ Boston, MA 02111-1307, USA. */ /* BeOS headers are C++-aware (and often use C++). */ #define NO_IMPLICIT_EXTERN_C -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* BeOS uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 diff --git a/contrib/gcc/config/i386/biarch64.h b/contrib/gcc/config/i386/biarch64.h index 532cfe7013b..46a55b0d188 100644 --- a/contrib/gcc/config/i386/biarch64.h +++ b/contrib/gcc/config/i386/biarch64.h @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_64BIT_DEFAULT MASK_64BIT #define TARGET_BI_ARCH 1 diff --git a/contrib/gcc/config/i386/bsd.h b/contrib/gcc/config/i386/bsd.h index 905b232e3e4..4c323998f52 100644 --- a/contrib/gcc/config/i386/bsd.h +++ b/contrib/gcc/config/i386/bsd.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Use the Sequent Symmetry assembler syntax. */ diff --git a/contrib/gcc/config/i386/constraints.md b/contrib/gcc/config/i386/constraints.md new file mode 100644 index 00000000000..0ab4995f3b8 --- /dev/null +++ b/contrib/gcc/config/i386/constraints.md @@ -0,0 +1,152 @@ +;; Constraint definitions for IA-32 and x86-64. +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Unused letters: +;;; B H TU W +;;; h jk vw z + +;; Integer register constraints. +;; It is not necessary to define 'r' here. +(define_register_constraint "R" "LEGACY_REGS" + "Legacy register---the eight integer registers available on all + i386 processors (@code{a}, @code{b}, @code{c}, @code{d}, + @code{si}, @code{di}, @code{bp}, @code{sp}).") + +(define_register_constraint "q" "TARGET_64BIT ? GENERAL_REGS : Q_REGS" + "Any register accessible as @code{@var{r}l}. In 32-bit mode, @code{a}, + @code{b}, @code{c}, and @code{d}; in 64-bit mode, any integer register.") + +(define_register_constraint "Q" "Q_REGS" + "Any register accessible as @code{@var{r}h}: @code{a}, @code{b}, + @code{c}, and @code{d}.") + +(define_register_constraint "l" "INDEX_REGS" + "@internal Any register that can be used as the index in a base+index + memory access: that is, any general register except the stack pointer.") + +(define_register_constraint "a" "AREG" + "The @code{a} register.") + +(define_register_constraint "b" "BREG" + "The @code{b} register.") + +(define_register_constraint "c" "CREG" + "The @code{c} register.") + +(define_register_constraint "d" "DREG" + "The @code{d} register.") + +(define_register_constraint "S" "SIREG" + "The @code{si} register.") + +(define_register_constraint "D" "DIREG" + "The @code{di} register.") + +(define_register_constraint "A" "AD_REGS" + "The @code{a} and @code{d} registers, as a pair (for instructions + that return half the result in one and half in the other).") + +;; Floating-point register constraints. +(define_register_constraint "f" + "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FLOAT_REGS : NO_REGS" + "Any 80387 floating-point (stack) register.") + +(define_register_constraint "t" + "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FP_TOP_REG : NO_REGS" + "Top of 80387 floating-point stack (@code{%st(0)}).") + +(define_register_constraint "u" + "TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 ? FP_SECOND_REG : NO_REGS" + "Second from top of 80387 floating-point stack (@code{%st(1)}).") + +;; Vector registers (also used for plain floating point nowadays). +(define_register_constraint "y" "TARGET_MMX ? MMX_REGS : NO_REGS" + "Any MMX register.") + +(define_register_constraint "x" "TARGET_SSE ? SSE_REGS : NO_REGS" + "Any SSE register.") + +(define_register_constraint "Y" "TARGET_SSE2? SSE_REGS : NO_REGS" + "@internal Any SSE2 register.") + +;; Integer constant constraints. +(define_constraint "I" + "Integer constant in the range 0 @dots{} 31, for 32-bit shifts." + (and (match_code "const_int") + (match_test "ival >= 0 && ival <= 31"))) + +(define_constraint "J" + "Integer constant in the range 0 @dots{} 63, for 64-bit shifts." + (and (match_code "const_int") + (match_test "ival >= 0 && ival <= 63"))) + +(define_constraint "K" + "Signed 8-bit integer constant." + (and (match_code "const_int") + (match_test "ival >= -128 && ival <= 127"))) + +(define_constraint "L" + "@code{0xFF} or @code{0xFFFF}, for andsi as a zero-extending move." + (and (match_code "const_int") + (match_test "ival == 0xFF || ival == 0xFFFF"))) + +(define_constraint "M" + "0, 1, 2, or 3 (shifts for the @code{lea} instruction)." + (and (match_code "const_int") + (match_test "ival >= 0 && ival <= 3"))) + +(define_constraint "N" + "Unsigned 8-bit integer constant (for @code{in} and @code{out} + instructions)." + (and (match_code "const_int") + (match_test "ival >= 0 && ival <= 255"))) + +(define_constraint "O" + "@internal Integer constant in the range 0 @dots{} 127, for 128-bit shifts." + (and (match_code "const_int") + (match_test "ival >= 0 && ival <= 127"))) + +;; Floating-point constant constraints. +;; We allow constants even if TARGET_80387 isn't set, because the +;; stack register converter may need to load 0.0 into the function +;; value register (top of stack). +(define_constraint "G" + "Standard 80387 floating point constant." + (and (match_code "const_double") + (match_test "standard_80387_constant_p (op)"))) + +;; This can theoretically be any mode's CONST0_RTX. +(define_constraint "C" + "Standard SSE floating point constant." + (match_test "standard_sse_constant_p (op)")) + +;; Constant-or-symbol-reference constraints. + +(define_constraint "e" + "32-bit signed integer constant, or a symbolic reference known + to fit that range (for immediate operands in sign-extending x86-64 + instructions)." + (match_operand 0 "x86_64_immediate_operand")) + +(define_constraint "Z" + "32-bit unsigned integer constant, or a symbolic reference known + to fit that range (for immediate operands in zero-extending x86-64 + instructions)." + (match_operand 0 "x86_64_zext_immediate_operand")) diff --git a/contrib/gcc/config/i386/crtdll.h b/contrib/gcc/config/i386/crtdll.h index afdae5826b6..0ef8561f3ef 100644 --- a/contrib/gcc/config/i386/crtdll.h +++ b/contrib/gcc/config/i386/crtdll.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef EXTRA_OS_CPP_BUILTINS #define EXTRA_OS_CPP_BUILTINS() \ diff --git a/contrib/gcc/config/i386/crtfastmath.c b/contrib/gcc/config/i386/crtfastmath.c new file mode 100644 index 00000000000..5991442686a --- /dev/null +++ b/contrib/gcc/config/i386/crtfastmath.c @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2005 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause + * the resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + */ + +#define MXCSR_DAZ (1 << 6) /* Enable denormals are zero mode */ +#define MXCSR_FTZ (1 << 15) /* Enable flush to zero mode */ + +#define FXSAVE (1 << 24) +#define SSE (1 << 25) + +static void __attribute__((constructor)) +#ifndef __x86_64__ +/* The i386 ABI only requires 4-byte stack alignment, so this is necessary + to make sure the fxsave struct gets correct alignment. + See PR27537 and PR28621. */ +__attribute__ ((force_align_arg_pointer)) +#endif +set_fast_math (void) +{ +#ifndef __x86_64__ + /* All 64-bit targets have SSE and DAZ; only check them explicitly + for 32-bit ones. */ + unsigned int eax, ebx, ecx, edx; + + /* See if we can use cpuid. */ + asm volatile ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" + "pushl %0; popfl; pushfl; popl %0; popfl" + : "=&r" (eax), "=&r" (ebx) + : "i" (0x00200000)); + + if (((eax ^ ebx) & 0x00200000) == 0) + return; + + /* Check the highest input value for eax. */ + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "0" (0)); + + if (eax == 0) + return; + + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "0" (1)); + + if (edx & SSE) + { + unsigned int mxcsr = __builtin_ia32_stmxcsr (); + + mxcsr |= MXCSR_FTZ; + + if (edx & FXSAVE) + { + /* Check if DAZ is available. */ + struct + { + unsigned short int cwd; + unsigned short int swd; + unsigned short int twd; + unsigned short int fop; + long int fip; + long int fcs; + long int foo; + long int fos; + long int mxcsr; + long int mxcsr_mask; + long int st_space[32]; + long int xmm_space[32]; + long int padding[56]; + } __attribute__ ((aligned (16))) fxsave; + + __builtin_memset (&fxsave, 0, sizeof (fxsave)); + + asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave)); + + if (fxsave.mxcsr_mask & MXCSR_DAZ) + mxcsr |= MXCSR_DAZ; + } + + __builtin_ia32_ldmxcsr (mxcsr); + } +#else + unsigned int mxcsr = __builtin_ia32_stmxcsr (); + mxcsr |= MXCSR_DAZ | MXCSR_FTZ; + __builtin_ia32_ldmxcsr (mxcsr); +#endif +} diff --git a/contrib/gcc/config/i386/cygming.h b/contrib/gcc/config/i386/cygming.h index f67e0483ad5..957c02eaf31 100644 --- a/contrib/gcc/config/i386/cygming.h +++ b/contrib/gcc/config/i386/cygming.h @@ -1,6 +1,7 @@ /* Operating system specific defines to be used when targeting GCC for hosting on Windows32, using a Unix style C library and tools. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -17,50 +18,41 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define DBX_DEBUGGING_INFO 1 #define SDB_DEBUGGING_INFO 1 #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG -#define TARGET_EXECUTABLE_SUFFIX ".exe" +#ifdef HAVE_GAS_PE_SECREL32_RELOC +#define DWARF2_DEBUGGING_INFO 1 -#define TARGET_IS_PE_COFF 1 +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) (write_symbols == DWARF2_DEBUG \ + ? svr4_dbx_register_map[n] \ + : dbx_register_map[n]) + +/* Use section relative relocations for debugging offsets. Unlike + other targets that fake this by putting the section VMA at 0, PE + won't allow it. */ +#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \ + do { \ + if (SIZE != 4) \ + abort (); \ + \ + fputs ("\t.secrel32\t", FILE); \ + assemble_name (FILE, LABEL); \ + } while (0) +#endif + +#define TARGET_EXECUTABLE_SUFFIX ".exe" #include -/* Masks for subtarget switches used by other files. */ -#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions */ - -/* Used in winnt.c. */ -#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{ "cygwin", 0, N_("Use the Cygwin interface") }, \ -{ "no-cygwin", 0, N_("Use the Mingw32 interface") }, \ -{ "windows", 0, N_("Create GUI application") }, \ -{ "no-win32", 0, N_("Don't set Windows defines") }, \ -{ "win32", 0, N_("Set Windows defines") }, \ -{ "console", 0, N_("Create console application") },\ -{ "dll", 0, N_("Generate code for a DLL") }, \ -{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, \ - N_("Ignore dllimport for functions") }, \ -{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \ -{ "threads", 0, N_("Use Mingw-specific thread support") }, - #define MAYBE_UWIN_CPP_BUILTINS() /* Nothing. */ -/* Support the __declspec keyword by turning them into attributes. - We currently only support: dllimport and dllexport. - Note that the current way we do this may result in a collision with - predefined attributes later on. This can be solved by using one attribute, - say __declspec__, and passing args to it. The problem with that approach - is that args are not accumulated: each new appearance would clobber any - existing args. */ - #define TARGET_OS_CPP_BUILTINS() \ do \ { \ @@ -69,13 +61,15 @@ Boston, MA 02111-1307, USA. */ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ builtin_define ("__fastcall=__attribute__((__fastcall__))"); \ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ - builtin_define ("__declspec(x)=__attribute__((x))"); \ if (!flag_iso) \ { \ builtin_define ("_stdcall=__attribute__((__stdcall__))"); \ builtin_define ("_fastcall=__attribute__((__fastcall__))"); \ builtin_define ("_cdecl=__attribute__((__cdecl__))"); \ } \ + /* Even though linkonce works with static libs, this is needed \ + to compare typeinfo symbols across dll boundaries. */ \ + builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ MAYBE_UWIN_CPP_BUILTINS (); \ EXTRA_OS_CPP_BUILTINS (); \ } \ @@ -83,7 +77,7 @@ Boston, MA 02111-1307, USA. */ /* Get tree.c to declare a target-specific specialization of merge_decl_attributes. */ -#define TARGET_DLLIMPORT_DECL_ATTRIBUTES +#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1 /* This macro defines names of additional specifications to put in the specs that can be used in various specifications like CC1_SPEC. Its definition @@ -114,52 +108,14 @@ Boston, MA 02111-1307, USA. */ union tree_node; #define TREE union tree_node * -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_drectve - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - DRECTVE_SECTION_FUNCTION \ - SWITCH_TO_SECTION_FUNCTION - -#define DRECTVE_SECTION_FUNCTION \ -void \ -drectve_section (void) \ -{ \ - if (in_section != in_drectve) \ - { \ - fprintf (asm_out_file, "%s\n", "\t.section .drectve\n"); \ - in_section = in_drectve; \ - } \ -} -void drectve_section (void); +#define drectve_section() \ + (fprintf (asm_out_file, "\t.section .drectve\n"), \ + in_section = NULL) /* Older versions of gas don't handle 'r' as data. Explicitly set data flag with 'd'. */ #define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata,\"dr\"" -/* Switch to SECTION (an `enum in_section'). - - ??? This facility should be provided by GCC proper. - The problem is that we want to temporarily switch sections in - ASM_DECLARE_OBJECT_NAME and then switch back to the original section - afterwards. */ -#define SWITCH_TO_SECTION_FUNCTION \ -void switch_to_section (enum in_section, tree); \ -void \ -switch_to_section (enum in_section section, tree decl) \ -{ \ - switch (section) \ - { \ - case in_text: text_section (); break; \ - case in_data: data_section (); break; \ - case in_readonly_data: readonly_data_section (); break; \ - case in_named: named_section (decl, NULL, 0); break; \ - case in_drectve: drectve_section (); break; \ - default: abort (); break; \ - } \ -} - /* Don't allow flag_pic to propagate since gas may produce invalid code otherwise. */ @@ -168,7 +124,7 @@ switch_to_section (enum in_section section, tree decl) \ do { \ if (flag_pic) \ { \ - warning ("-f%s ignored for target (all code is position independent)",\ + warning (0, "-f%s ignored for target (all code is position independent)",\ (flag_pic > 1) ? "PIC" : "pic"); \ flag_pic = 0; \ } \ @@ -191,8 +147,8 @@ do { \ section and we need to set DECL_SECTION_NAME so we do that here. Note that we can be called twice on the same decl. */ -#undef TARGET_ENCODE_SECTION_INFO -#define TARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info +#undef SUBTARGET_ENCODE_SECTION_INFO +#define SUBTARGET_ENCODE_SECTION_INFO i386_pe_encode_section_info #undef TARGET_STRIP_NAME_ENCODING #define TARGET_STRIP_NAME_ENCODING i386_pe_strip_name_encoding_full @@ -200,6 +156,9 @@ do { \ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF i386_pe_output_labelref +#undef COMMON_ASM_OP +#define COMMON_ASM_OP "\t.comm\t" + /* Output a common block. */ #undef ASM_OUTPUT_COMMON #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ @@ -247,14 +206,12 @@ do { \ #define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* Windows uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 extern void i386_pe_unique_section (TREE, int); #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section +#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section #define SUPPORTS_ONE_ONLY 1 @@ -285,7 +242,7 @@ extern void i386_pe_unique_section (TREE, int); do \ { \ if (TREE_CODE (DECL) == FUNCTION_DECL) \ - i386_pe_record_external_function (NAME); \ + i386_pe_record_external_function ((DECL), (NAME)); \ } \ while (0) @@ -317,7 +274,7 @@ extern void i386_pe_unique_section (TREE, int); #define PROFILE_HOOK(LABEL) \ if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \ { \ - emit_call_insn (gen_rtx (CALL, VOIDmode, \ + emit_call_insn (gen_rtx_CALL (VOIDmode, \ gen_rtx_MEM (FUNCTION_MODE, \ gen_rtx_SYMBOL_REF (Pmode, "_monstartup")), \ const0_rtx)); \ @@ -333,7 +290,7 @@ extern void i386_pe_unique_section (TREE, int); /* External function declarations. */ -extern void i386_pe_record_external_function (const char *); +extern void i386_pe_record_external_function (tree, const char *); extern void i386_pe_declare_function_type (FILE *, const char *, int); extern void i386_pe_record_exported_symbol (const char *, int); extern void i386_pe_file_end (void); @@ -353,6 +310,16 @@ extern int i386_pe_dllimport_name_p (const char *); #undef BIGGEST_ALIGNMENT #define BIGGEST_ALIGNMENT 128 +/* Biggest alignment supported by the object file format of this + machine. Use this macro to limit the alignment which can be + specified using the `__attribute__ ((aligned (N)))' construct. If + not defined, the default value is `BIGGEST_ALIGNMENT'. */ +#undef MAX_OFILE_ALIGNMENT +/* IMAGE_SCN_ALIGN_8192BYTES is the largest section alignment flag + specified in the PECOFF60 spec. Native MS compiler also limits + user-specified alignment to 8192 bytes. */ +#define MAX_OFILE_ALIGNMENT (8192 * 8) + /* Native complier aligns internal doubles in structures on dword boundaries. */ #undef BIGGEST_FIELD_ALIGNMENT #define BIGGEST_FIELD_ALIGNMENT 64 @@ -384,6 +351,39 @@ extern int i386_pe_dllimport_name_p (const char *); ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \ } while (0) +/* GNU as supports weak symbols on PECOFF. */ +#ifdef HAVE_GAS_WEAK +#define ASM_WEAKEN_LABEL(FILE, NAME) \ + do \ + { \ + fputs ("\t.weak\t", (FILE)); \ + assemble_name ((FILE), (NAME)); \ + fputc ('\n', (FILE)); \ + } \ + while (0) +#endif /* HAVE_GAS_WEAK */ + +/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true, + but for .jcr section to work we also need crtbegin and crtend + objects. */ +#define TARGET_USE_JCR_SECTION 0 + +/* Decide whether it is safe to use a local alias for a virtual function + when constructing thunks. */ +#undef TARGET_USE_LOCAL_THUNK_ALIAS_P +#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL)) + +#define SUBTARGET_ATTRIBUTE_TABLE \ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \ + { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute } + +/* mcount() does not need a counter variable. */ +#undef NO_PROFILE_COUNTERS +#define NO_PROFILE_COUNTERS 1 + +#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p +#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition + #undef TREE #ifndef BUFSIZ diff --git a/contrib/gcc/config/i386/cygming.opt b/contrib/gcc/config/i386/cygming.opt new file mode 100644 index 00000000000..d430e08bcec --- /dev/null +++ b/contrib/gcc/config/i386/cygming.opt @@ -0,0 +1,48 @@ +; Cygwin- and MinGW-specific options. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mconsole +Target RejectNegative +Create console application + +mcygwin +Target +Use the Cygwin interface + +mdll +Target RejectNegative +Generate code for a DLL + +mnop-fun-dllimport +Target Report Var(TARGET_NOP_FUN_DLLIMPORT) +Ignore dllimport for functions + +mthreads +Target RejectNegative +Use Mingw-specific thread support + +mwin32 +Target +Set Windows defines + +mwindows +Target +Create GUI application diff --git a/contrib/gcc/config/i386/cygwin.asm b/contrib/gcc/config/i386/cygwin.asm index c8378fa575f..5b656892d5f 100644 --- a/contrib/gcc/config/i386/cygwin.asm +++ b/contrib/gcc/config/i386/cygwin.asm @@ -23,8 +23,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/i386/cygwin.h b/contrib/gcc/config/i386/cygwin.h index def39f4d3f5..a7d5e47cdc9 100644 --- a/contrib/gcc/config/i386/cygwin.h +++ b/contrib/gcc/config/i386/cygwin.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)"); @@ -204,7 +204,7 @@ void mingw_scan (int, const char * const *, char **); #define GCC_DRIVER_HOST_INITIALIZATION \ do \ { \ - mingw_scan(argc, argv, (char **) &spec_machine); \ + mingw_scan(argc, (const char * const *) argv, (char **) &spec_machine); \ } \ while (0) #else @@ -224,7 +224,17 @@ do \ add_prefix (&startfile_prefixes,\ concat (standard_startfile_prefix, "w32api", NULL),\ "GCC", PREFIX_PRIORITY_LAST, 0, NULL);\ - mingw_scan(argc, argv, &spec_machine); \ + mingw_scan(argc, (const char * const *) argv, &spec_machine); \ } \ while (0) #endif + +/* Binutils does not handle weak symbols from dlls correctly. For now, + do not use them unnecessarily in gthr-posix.h. */ +#define GTHREAD_USE_WEAK 0 + +/* Every program on cygwin links against cygwin1.dll which contains + the pthread routines. There is no need to explicitly link them + and the -pthread flag is not recognized. */ +#undef GOMP_SELF_SPECS +#define GOMP_SELF_SPECS "" diff --git a/contrib/gcc/config/i386/cygwin1.c b/contrib/gcc/config/i386/cygwin1.c index 88c44fc9fbf..68b38dc3d5c 100644 --- a/contrib/gcc/config/i386/cygwin1.c +++ b/contrib/gcc/config/i386/cygwin1.c @@ -1,6 +1,6 @@ /* Helper routines for cygwin-specific command-line parsing. Contributed by Christopher Faylor (cgf@redhat.com) - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" diff --git a/contrib/gcc/config/i386/cygwin2.c b/contrib/gcc/config/i386/cygwin2.c index 2947f5af454..90738a2e6e2 100644 --- a/contrib/gcc/config/i386/cygwin2.c +++ b/contrib/gcc/config/i386/cygwin2.c @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" diff --git a/contrib/gcc/config/i386/darwin-libgcc.10.4.ver b/contrib/gcc/config/i386/darwin-libgcc.10.4.ver new file mode 100644 index 00000000000..aaeb934fe7d --- /dev/null +++ b/contrib/gcc/config/i386/darwin-libgcc.10.4.ver @@ -0,0 +1,81 @@ +__Unwind_Backtrace +__Unwind_DeleteException +__Unwind_FindEnclosingFunction +__Unwind_Find_FDE +__Unwind_ForcedUnwind +__Unwind_GetCFA +__Unwind_GetDataRelBase +__Unwind_GetGR +__Unwind_GetIP +__Unwind_GetLanguageSpecificData +__Unwind_GetRegionStart +__Unwind_GetTextRelBase +__Unwind_RaiseException +__Unwind_Resume +__Unwind_Resume_or_Rethrow +__Unwind_SetGR +__Unwind_SetIP +___absvdi2 +___absvsi2 +___addvdi3 +___addvsi3 +___ashldi3 +___ashrdi3 +___clear_cache +___clzdi2 +___clzsi2 +___cmpdi2 +___ctzdi2 +___ctzsi2 +___deregister_frame +___deregister_frame_info +___deregister_frame_info_bases +___divdc3 +___divdi3 +___divsc3 +___divxc3 +___enable_execute_stack +___ffsdi2 +___fixdfdi +___fixsfdi +___fixunsdfdi +___fixunsdfsi +___fixunssfdi +___fixunssfsi +___fixunsxfdi +___fixunsxfsi +___fixxfdi +___floatdidf +___floatdisf +___floatdixf +___gcc_personality_v0 +___lshrdi3 +___moddi3 +___muldc3 +___muldi3 +___mulsc3 +___mulvdi3 +___mulvsi3 +___mulxc3 +___negdi2 +___negvdi2 +___negvsi2 +___paritydi2 +___paritysi2 +___popcountdi2 +___popcountsi2 +___powidf2 +___powisf2 +___powixf2 +___register_frame +___register_frame_info +___register_frame_info_bases +___register_frame_info_table +___register_frame_info_table_bases +___register_frame_table +___subvdi3 +___subvsi3 +___ucmpdi2 +___udivdi3 +___udivmoddi4 +___umoddi3 diff --git a/contrib/gcc/config/i386/darwin-libgcc.10.5.ver b/contrib/gcc/config/i386/darwin-libgcc.10.5.ver new file mode 100644 index 00000000000..02a08584360 --- /dev/null +++ b/contrib/gcc/config/i386/darwin-libgcc.10.5.ver @@ -0,0 +1,85 @@ +__Unwind_Backtrace +__Unwind_DeleteException +__Unwind_FindEnclosingFunction +__Unwind_Find_FDE +__Unwind_ForcedUnwind +__Unwind_GetCFA +__Unwind_GetDataRelBase +__Unwind_GetGR +__Unwind_GetIP +__Unwind_GetIPInfo +__Unwind_GetLanguageSpecificData +__Unwind_GetRegionStart +__Unwind_GetTextRelBase +__Unwind_RaiseException +__Unwind_Resume +__Unwind_Resume_or_Rethrow +__Unwind_SetGR +__Unwind_SetIP +___absvdi2 +___absvsi2 +___addvdi3 +___addvsi3 +___ashldi3 +___ashrdi3 +___clear_cache +___clzdi2 +___clzsi2 +___cmpdi2 +___ctzdi2 +___ctzsi2 +___deregister_frame +___deregister_frame_info +___deregister_frame_info_bases +___divdc3 +___divdi3 +___divsc3 +___divxc3 +___enable_execute_stack +___ffsdi2 +___fixdfdi +___fixsfdi +___fixunsdfdi +___fixunsdfsi +___fixunssfdi +___fixunssfsi +___fixunsxfdi +___fixunsxfsi +___fixxfdi +___floatdidf +___floatdisf +___floatdixf +___floatundidf +___floatundisf +___floatundixf +___gcc_personality_v0 +___lshrdi3 +___moddi3 +___muldc3 +___muldi3 +___mulsc3 +___mulvdi3 +___mulvsi3 +___mulxc3 +___negdi2 +___negvdi2 +___negvsi2 +___paritydi2 +___paritysi2 +___popcountdi2 +___popcountsi2 +___powidf2 +___powisf2 +___powixf2 +___register_frame +___register_frame_info +___register_frame_info_bases +___register_frame_info_table +___register_frame_info_table_bases +___register_frame_table +___subvdi3 +___subvsi3 +___ucmpdi2 +___udivdi3 +___udivmoddi4 +___umoddi3 diff --git a/contrib/gcc/config/i386/darwin.h b/contrib/gcc/config/i386/darwin.h index 8246b9eb674..55b55ab2860 100644 --- a/contrib/gcc/config/i386/darwin.h +++ b/contrib/gcc/config/i386/darwin.h @@ -1,5 +1,5 @@ /* Target definitions for x86 running Darwin. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -16,44 +16,79 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Enable Mach-O bits in generic x86 code. */ #undef TARGET_MACHO #define TARGET_MACHO 1 -#define TARGET_VERSION fprintf (stderr, " (i386 Darwin)"); +#define TARGET_VERSION fprintf (stderr, " (i686 Darwin)"); + +#undef TARGET_64BIT +#define TARGET_64BIT (target_flags & MASK_64BIT) + +#ifdef IN_LIBGCC2 +#undef TARGET_64BIT +#ifdef __x86_64__ +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif + +/* Size of the Obj-C jump buffer. */ +#define OBJC_JBLEN ((TARGET_64BIT) ? ((9 * 2) + 3 + 16) : (18)) + +#undef TARGET_FPMATH_DEFAULT +#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387) #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__i386__"); \ builtin_define ("__LITTLE_ENDIAN__"); \ - builtin_define ("__MACH__"); \ - builtin_define ("__APPLE__"); \ + darwin_cpp_builtins (pfile); \ } \ while (0) +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef MAX_BITS_PER_WORD +#define MAX_BITS_PER_WORD 64 + +#undef FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN +#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN (0) + /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ #undef CC1_SPEC -#define CC1_SPEC "%{!static:-fPIC}" +#define CC1_SPEC "%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ + %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}" + +#undef ASM_SPEC +#define ASM_SPEC "-arch %(darwin_arch) -force_cpusubtype_ALL" + +#define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}" +#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "darwin_arch", DARWIN_ARCH_SPEC }, \ + { "darwin_crt2", "" }, \ + { "darwin_subarch", DARWIN_SUBARCH_SPEC }, /* Use the following macro for any Darwin/x86-specific command-line option translation. */ -#define SUBTARGET_OPTION_TRANSLATE_TABLE - -#define ASM_SPEC "-arch i386 \ - %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ - %{!Zforce_cpusubtype_ALL:%{mmmx:-force_cpusubtype_ALL}\ - %{msse:-force_cpusubtype_ALL}\ - %{msse2:-force_cpusubtype_ALL}}" - -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "darwin_arch", "i386" }, +#define SUBTARGET_OPTION_TRANSLATE_TABLE \ + { "", "" } /* The Darwin assembler mostly follows AT&T syntax. */ #undef ASSEMBLER_DIALECT @@ -66,6 +101,10 @@ Boston, MA 02111-1307, USA. */ #define SHIFT_DOUBLE_OMITS_COUNT 0 +extern void darwin_x86_file_end (void); +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END darwin_x86_file_end + /* Define the syntax of pseudo-ops, labels and comments. */ /* String containing the assembler's comment-starter. */ @@ -75,34 +114,39 @@ Boston, MA 02111-1307, USA. */ /* By default, target has a 80387, uses IEEE compatible arithmetic, and returns float values in the 387. */ -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS) - -/* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */ - -#undef TARGET_DEEP_BRANCH_PREDICTION -#define TARGET_DEEP_BRANCH_PREDICTION 0 +#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_128BIT_LONG_DOUBLE) /* For now, disable dynamic-no-pic. We'll need to go through i386.c with a fine-tooth comb looking for refs to flag_pic! */ #define MASK_MACHO_DYNAMIC_NO_PIC 0 #define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC) +#undef GOT_SYMBOL_NAME +#define GOT_SYMBOL_NAME (machopic_function_base_name ()) + /* Define the syntax of pseudo-ops, labels and comments. */ #define LPREFIX "L" +/* These are used by -fbranch-probabilities */ +#define HOT_TEXT_SECTION_NAME "__TEXT,__text,regular,pure_instructions" +#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME \ + "__TEXT,__unlikely,regular,pure_instructions" + /* Assembler pseudos to introduce constants of various size. */ #define ASM_BYTE_OP "\t.byte\t" #define ASM_SHORT "\t.word\t" #define ASM_LONG "\t.long\t" -/* Darwin as doesn't do ".quad". */ +#define ASM_QUAD "\t.quad\t" + +#define SUBTARGET_ENCODE_SECTION_INFO darwin_encode_section_info #undef ASM_OUTPUT_ALIGN #define ASM_OUTPUT_ALIGN(FILE,LOG) \ do { if ((LOG) != 0) \ { \ - if (in_text_section ()) \ + if (in_section == text_section) \ fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \ else \ fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \ @@ -129,11 +173,73 @@ Boston, MA 02111-1307, USA. */ #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(FILE, LABELNO) \ do { \ - if (MACHOPIC_INDIRECT) \ + if (MACHOPIC_INDIRECT && !TARGET_64BIT) \ { \ - const char *name = machopic_stub_name ("*mcount"); \ + const char *name = machopic_mcount_stub_name (); \ fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \ - machopic_validate_stub_or_non_lazy_ptr (name, /*stub:*/1); \ + machopic_validate_stub_or_non_lazy_ptr (name); \ } \ else fprintf (FILE, "\tcall mcount\n"); \ } while (0) + +#define C_COMMON_OVERRIDE_OPTIONS \ + do { \ + SUBTARGET_C_COMMON_OVERRIDE_OPTIONS; \ + } while (0) + +/* Darwin on x86_64 uses dwarf-2 by default. */ +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE (TARGET_64BIT ? DWARF2_DEBUG : DBX_DEBUG) + +/* Darwin uses the standard DWARF register numbers but the default + register numbers for STABS. Fortunately for 64-bit code the + default and the standard are the same. */ +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) \ + (TARGET_64BIT ? dbx64_register_map[n] \ + : write_symbols == DWARF2_DEBUG ? svr4_dbx_register_map[n] \ + : dbx_register_map[n]) + +/* Unfortunately, the 32-bit EH information also doesn't use the standard + DWARF register numbers. */ +#define DWARF2_FRAME_REG_OUT(n, for_eh) \ + (! (for_eh) || write_symbols != DWARF2_DEBUG || TARGET_64BIT ? (n) \ + : (n) == 5 ? 4 \ + : (n) == 4 ? 5 \ + : (n) >= 11 && (n) <= 18 ? (n) + 1 \ + : (n)) + +#undef REGISTER_TARGET_PRAGMAS +#define REGISTER_TARGET_PRAGMAS() DARWIN_REGISTER_TARGET_PRAGMAS() + +#undef TARGET_SET_DEFAULT_TYPE_ATTRIBUTES +#define TARGET_SET_DEFAULT_TYPE_ATTRIBUTES darwin_set_default_type_attributes + +/* For 64-bit, we need to add 4 because @GOTPCREL is relative to the + end of the instruction, but without the 4 we'd only have the right + address for the start of the instruction. */ +#undef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX +#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \ + if (TARGET_64BIT) \ + { \ + if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_pcrel) \ + { \ + fputs (ASM_LONG, FILE); \ + assemble_name (FILE, XSTR (ADDR, 0)); \ + fputs ("+4@GOTPCREL", FILE); \ + goto DONE; \ + } \ + } \ + else \ + { \ + if (ENCODING == ASM_PREFERRED_EH_DATA_FORMAT (2, 1)) \ + { \ + darwin_non_lazy_pcrel (FILE, ADDR); \ + goto DONE; \ + } \ + } + +/* This needs to move since i386 uses the first flag and other flags are + used in Mach-O. */ +#undef MACHO_SYMBOL_FLAG_VARIABLE +#define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3) diff --git a/contrib/gcc/config/i386/darwin64.h b/contrib/gcc/config/i386/darwin64.h new file mode 100644 index 00000000000..01686fa0ed5 --- /dev/null +++ b/contrib/gcc/config/i386/darwin64.h @@ -0,0 +1,35 @@ +/* Target definitions for x86_64 running Darwin. + Copyright (C) 2006 Free Software Foundation, Inc. + Contributed by Apple Computer Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (x86_64 Darwin)"); + +#undef DARWIN_ARCH_SPEC +#define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}" + +#undef DARWIN_SUBARCH_SPEC +#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "darwin_arch", DARWIN_ARCH_SPEC }, \ + { "darwin_crt2", "" }, \ + { "darwin_subarch", DARWIN_SUBARCH_SPEC }, diff --git a/contrib/gcc/config/i386/djgpp.h b/contrib/gcc/config/i386/djgpp.h index cee9480d69c..4e9f471b978 100644 --- a/contrib/gcc/config/i386/djgpp.h +++ b/contrib/gcc/config/i386/djgpp.h @@ -1,5 +1,5 @@ /* Configuration for an i386 running MS-DOS with DJGPP. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Support generation of DWARF2 debugging info. */ #define DWARF2_DEBUGGING_INFO 1 @@ -169,26 +169,16 @@ Boston, MA 02111-1307, USA. */ /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */ #define LIBSTDCXX "-lstdcxx" -/* -mbnu210 is now ignored and obsolete. It was used to enable support for - weak symbols, and .gnu.linkonce support. */ -#undef MASK_BNU210 -#define MASK_BNU210 (0x40000000) - #define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)"); -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)" }, \ - { "bnu210", MASK_BNU210, "Ignored (obsolete)" }, - /* Warn that -mbnu210 is now obsolete. */ #undef SUBTARGET_OVERRIDE_OPTIONS #define SUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (target_flags & MASK_BNU210) \ + if (TARGET_BNU210) \ { \ - warning ("-mbnu210 is ignored (option is obsolete)"); \ + warning (0, "-mbnu210 is ignored (option is obsolete)"); \ } \ } \ while (0) diff --git a/contrib/gcc/config/i386/djgpp.opt b/contrib/gcc/config/i386/djgpp.opt new file mode 100644 index 00000000000..3ef5da3ce8e --- /dev/null +++ b/contrib/gcc/config/i386/djgpp.opt @@ -0,0 +1,26 @@ +; DJGPP-specific options. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +;; -mbnu210 is now ignored and obsolete. It was used to enable support for +;; weak symbols, and .gnu.linkonce support. +mbnu210 +Target Var(TARGET_BNU210) +Ignored (obsolete) diff --git a/contrib/gcc/config/i386/driver-i386.c b/contrib/gcc/config/i386/driver-i386.c new file mode 100644 index 00000000000..ffcee4e553b --- /dev/null +++ b/contrib/gcc/config/i386/driver-i386.c @@ -0,0 +1,300 @@ +/* Subroutines for the gcc driver. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include + +const char *host_detect_local_cpu (int argc, const char **argv); + +#ifdef GCC_VERSION +#define cpuid(num,a,b,c,d) \ + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ + : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ + : "0" (num)) + +#define bit_CMPXCHG8B (1 << 8) +#define bit_CMOV (1 << 15) +#define bit_MMX (1 << 23) +#define bit_SSE (1 << 25) +#define bit_SSE2 (1 << 26) + +#define bit_SSE3 (1 << 0) +#define bit_CMPXCHG16B (1 << 13) + +#define bit_3DNOW (1 << 31) +#define bit_3DNOWP (1 << 30) +#define bit_LM (1 << 29) + +/* This will be called by the spec parser in gcc.c when it sees + a %:local_cpu_detect(args) construct. Currently it will be called + with either "arch" or "tune" as argument depending on if -march=native + or -mtune=native is to be substituted. + + It returns a string containing new command line parameters to be + put at the place of the above two options, depending on what CPU + this is executed. E.g. "-march=k8" on an AMD64 machine + for -march=native. + + ARGC and ARGV are set depending on the actual arguments given + in the spec. */ +const char *host_detect_local_cpu (int argc, const char **argv) +{ + const char *cpu = NULL; + enum processor_type processor = PROCESSOR_I386; + unsigned int eax, ebx, ecx, edx; + unsigned int max_level; + unsigned int vendor; + unsigned int ext_level; + unsigned char has_mmx = 0, has_3dnow = 0, has_3dnowp = 0, has_sse = 0; + unsigned char has_sse2 = 0, has_sse3 = 0, has_cmov = 0; + unsigned char has_longmode = 0, has_cmpxchg8b = 0; + unsigned char is_amd = 0; + unsigned int family = 0; + bool arch; + + if (argc < 1) + return NULL; + + arch = strcmp (argv[0], "arch") == 0; + if (!arch && strcmp (argv[0], "tune")) + return NULL; + +#ifndef __x86_64__ + /* See if we can use cpuid. */ + asm volatile ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" + "pushl %0; popfl; pushfl; popl %0; popfl" + : "=&r" (eax), "=&r" (ebx) + : "i" (0x00200000)); + + if (((eax ^ ebx) & 0x00200000) == 0) + goto done; +#endif + + processor = PROCESSOR_PENTIUM; + + /* Check the highest input value for eax. */ + cpuid (0, eax, ebx, ecx, edx); + max_level = eax; + /* We only look at the first four characters. */ + vendor = ebx; + if (max_level == 0) + goto done; + + cpuid (1, eax, ebx, ecx, edx); + has_cmpxchg8b = !!(edx & bit_CMPXCHG8B); + has_cmov = !!(edx & bit_CMOV); + has_mmx = !!(edx & bit_MMX); + has_sse = !!(edx & bit_SSE); + has_sse2 = !!(edx & bit_SSE2); + has_sse3 = !!(ecx & bit_SSE3); + /* We don't care for extended family. */ + family = (eax >> 8) & ~(1 << 4); + + cpuid (0x80000000, eax, ebx, ecx, edx); + ext_level = eax; + if (ext_level >= 0x80000000) + { + cpuid (0x80000001, eax, ebx, ecx, edx); + has_3dnow = !!(edx & bit_3DNOW); + has_3dnowp = !!(edx & bit_3DNOWP); + has_longmode = !!(edx & bit_LM); + } + + is_amd = vendor == *(unsigned int*)"Auth"; + + if (is_amd) + { + if (has_mmx) + processor = PROCESSOR_K6; + if (has_3dnowp) + processor = PROCESSOR_ATHLON; + if (has_sse2 || has_longmode) + processor = PROCESSOR_K8; + } + else + { + switch (family) + { + case 5: + /* Default is PROCESSOR_PENTIUM. */ + break; + case 6: + processor = PROCESSOR_PENTIUMPRO; + break; + case 15: + processor = PROCESSOR_PENTIUM4; + break; + default: + /* We have no idea. Use something reasonable. */ + if (arch) + { + if (has_sse3) + { + if (has_longmode) + cpu = "nocona"; + else + cpu = "prescott"; + } + else if (has_sse2) + cpu = "pentium4"; + else if (has_cmov) + cpu = "pentiumpro"; + else if (has_mmx) + cpu = "pentium-mmx"; + else if (has_cmpxchg8b) + cpu = "pentium"; + else + cpu = "i386"; + } + else + cpu = "generic"; + goto done; + break; + } + } + + switch (processor) + { + case PROCESSOR_I386: + cpu = "i386"; + break; + case PROCESSOR_I486: + cpu = "i486"; + break; + case PROCESSOR_PENTIUM: + if (has_mmx) + cpu = "pentium-mmx"; + else + cpu = "pentium"; + break; + case PROCESSOR_PENTIUMPRO: + if (arch) + { + if (has_sse3) + { + if (has_longmode) + { + /* It is Core 2 Duo. */ + cpu = "nocona"; + } + else + { + /* It is Core Duo. */ + cpu = "prescott"; + } + } + else if (has_sse2) + { + /* It is Pentium M. */ + cpu = "pentium4"; + } + else if (has_sse) + { + /* It is Pentium III. */ + cpu = "pentium3"; + } + else if (has_mmx) + { + /* It is Pentium II. */ + cpu = "pentium2"; + } + else + { + /* Default to Pentium Pro. */ + cpu = "pentiumpro"; + } + } + else + { + /* For -mtune, we default to -mtune=generic. */ + cpu = "generic"; + } + break; + case PROCESSOR_K6: + if (has_3dnow) + cpu = "k6-3"; + else + cpu = "k6"; + break; + case PROCESSOR_ATHLON: + if (has_sse) + cpu = "athlon-4"; + else + cpu = "athlon"; + break; + case PROCESSOR_PENTIUM4: + if (has_sse3) + { + if (has_longmode) + cpu = "nocona"; + else + cpu = "prescott"; + } + else + cpu = "pentium4"; + break; + case PROCESSOR_K8: + cpu = "k8"; + break; + case PROCESSOR_NOCONA: + cpu = "nocona"; + break; + case PROCESSOR_GENERIC32: + case PROCESSOR_GENERIC64: + cpu = "generic"; + break; + default: + abort (); + break; + } + +done: + return concat ("-m", argv[0], "=", cpu, NULL); +} +#else +/* If we aren't compiling with GCC we just provide a minimal + default value. */ +const char *host_detect_local_cpu (int argc, const char **argv) +{ + const char *cpu; + bool arch; + + if (argc < 1) + return NULL; + + arch = strcmp (argv[0], "arch") == 0; + if (!arch && strcmp (argv[0], "tune")) + return NULL; + + if (arch) + { + /* FIXME: i386 is wrong for 64bit compiler. How can we tell if + we are generating 64bit or 32bit code? */ + cpu = "i386"; + } + else + cpu = "generic"; + + return concat ("-m", argv[0], "=", cpu, NULL); +} +#endif /* GCC_VERSION */ diff --git a/contrib/gcc/config/i386/emmintrin.h b/contrib/gcc/config/i386/emmintrin.h index 286906324a5..d30184bc805 100644 --- a/contrib/gcc/config/i386/emmintrin.h +++ b/contrib/gcc/config/i386/emmintrin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -14,8 +14,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -25,7 +25,7 @@ Public License. */ /* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ + User Guide and Reference, version 9.0. */ #ifndef _EMMINTRIN_H_INCLUDED #define _EMMINTRIN_H_INCLUDED @@ -34,358 +34,395 @@ #include /* SSE2 */ -typedef double __v2df __attribute__ ((mode (V2DF))); -typedef int __v2di __attribute__ ((mode (V2DI))); -typedef int __v4si __attribute__ ((mode (V4SI))); -typedef int __v8hi __attribute__ ((mode (V8HI))); -typedef int __v16qi __attribute__ ((mode (V16QI))); +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); /* Create a selector for use with the SHUFPD instruction. */ #define _MM_SHUFFLE2(fp1,fp0) \ (((fp1) << 1) | (fp0)) -#define __m128i __v2di -#define __m128d __v2df - -/* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128d -_mm_load_sd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadsd (__P); -} - -/* Create a vector with all two elements equal to *P. */ -static __inline __m128d -_mm_load1_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadsd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); -} - -static __inline __m128d -_mm_load_pd1 (double const *__P) -{ - return _mm_load1_pd (__P); -} - -/* Load two DPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128d -_mm_load_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadapd (__P); -} - -/* Load two DPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128d -_mm_loadu_pd (double const *__P) -{ - return (__m128d) __builtin_ia32_loadupd (__P); -} - -/* Load two DPFP values in reverse order. The address must be aligned. */ -static __inline __m128d -_mm_loadr_pd (double const *__P) -{ - __v2df __tmp = __builtin_ia32_loadapd (__P); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); -} - /* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_set_sd (double __F) { - return (__m128d) __builtin_ia32_loadsd (&__F); + return __extension__ (__m128d){ __F, 0 }; } -/* Create a vector with all two elements equal to F. */ -static __inline __m128d +/* Create a vector with both elements equal to F. */ +static __inline __m128d __attribute__((__always_inline__)) _mm_set1_pd (double __F) { - __v2df __tmp = __builtin_ia32_loadsd (&__F); - return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0)); + return __extension__ (__m128d){ __F, __F }; } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_set_pd1 (double __F) { return _mm_set1_pd (__F); } -/* Create the vector [Z Y]. */ -static __inline __m128d -_mm_set_pd (double __Z, double __Y) +/* Create a vector with the lower value X and upper value W. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd (double __W, double __X) { - return (__v2df) {__Y, __Z}; + return __extension__ (__m128d){ __X, __W }; } -/* Create the vector [Y Z]. */ -static __inline __m128d -_mm_setr_pd (double __Z, double __Y) +/* Create a vector with the lower value W and upper value X. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setr_pd (double __W, double __X) { - return _mm_set_pd (__Y, __Z); + return __extension__ (__m128d){ __W, __X }; } /* Create a vector of zeros. */ -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_setzero_pd (void) { - return (__m128d) __builtin_ia32_setzeropd (); -} - -/* Stores the lower DPFP value. */ -static __inline void -_mm_store_sd (double *__P, __m128d __A) -{ - __builtin_ia32_storesd (__P, (__v2df)__A); -} - -/* Store the lower DPFP value across two words. */ -static __inline void -_mm_store1_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,0)); - __builtin_ia32_storeapd (__P, __tmp); -} - -static __inline void -_mm_store_pd1 (double *__P, __m128d __A) -{ - _mm_store1_pd (__P, __A); -} - -/* Store two DPFP values. The address must be 16-byte aligned. */ -static __inline void -_mm_store_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeapd (__P, (__v2df)__A); -} - -/* Store two DPFP values. The address need not be 16-byte aligned. */ -static __inline void -_mm_storeu_pd (double *__P, __m128d __A) -{ - __builtin_ia32_storeupd (__P, (__v2df)__A); -} - -/* Store two DPFP values in reverse order. The address must be aligned. */ -static __inline void -_mm_storer_pd (double *__P, __m128d __A) -{ - __v2df __va = (__v2df)__A; - __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,1)); - __builtin_ia32_storeapd (__P, __tmp); + return __extension__ (__m128d){ 0.0, 0.0 }; } /* Sets the low DPFP value of A from the low value of B. */ -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_move_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); } +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd (double const *__P) +{ + return *(__m128d *)__P; +} -static __inline __m128d +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadu_pd (double const *__P) +{ + return __builtin_ia32_loadupd (__P); +} + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load1_pd (double const *__P) +{ + return _mm_set1_pd (*__P); +} + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_sd (double const *__P) +{ + return _mm_set_sd (*__P); +} + +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd1 (double const *__P) +{ + return _mm_load1_pd (__P); +} + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadr_pd (double const *__P) +{ + __m128d __tmp = _mm_load_pd (__P); + return __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); +} + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_pd (double *__P, __m128d __A) +{ + *(__m128d *)__P = __A; +} + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_pd (double *__P, __m128d __A) +{ + __builtin_ia32_storeupd (__P, __A); +} + +/* Stores the lower DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_sd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 0); +} + +static __inline double __attribute__((__always_inline__)) +_mm_cvtsd_f64 (__m128d __A) +{ + return __builtin_ia32_vec_ext_v2df (__A, 0); +} + +static __inline void __attribute__((__always_inline__)) +_mm_storel_pd (double *__P, __m128d __A) +{ + _mm_store_sd (__P, __A); +} + +/* Stores the upper DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 1); +} + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,0))); +} + +static __inline void __attribute__((__always_inline__)) +_mm_store_pd1 (double *__P, __m128d __A) +{ + _mm_store1_pd (__P, __A); +} + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,1))); +} + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi128_si32 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64x (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} +#endif + +static __inline __m128d __attribute__((__always_inline__)) _mm_add_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_add_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_sub_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_sub_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_mul_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_mul_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_div_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_div_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_sqrt_pd (__m128d __A) { return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); } /* Return pair {sqrt (A[0), B[1]}. */ -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_sqrt_sd (__m128d __A, __m128d __B) { __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_min_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_min_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_max_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_max_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_and_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_andnot_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_or_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_xor_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpeq_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmplt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmple_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpgt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpge_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpneq_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnlt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnle_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpngt_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnge_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpord_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpunord_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpeq_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmplt_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmple_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpgt_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, @@ -395,7 +432,7 @@ _mm_cmpgt_sd (__m128d __A, __m128d __B) __A)); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpge_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, @@ -405,25 +442,25 @@ _mm_cmpge_sd (__m128d __A, __m128d __B) __A)); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpneq_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnlt_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnle_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpngt_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, @@ -433,7 +470,7 @@ _mm_cmpngt_sd (__m128d __A, __m128d __B) __A)); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpnge_sd (__m128d __A, __m128d __B) { return (__m128d) __builtin_ia32_movsd ((__v2df) __A, @@ -443,478 +480,397 @@ _mm_cmpnge_sd (__m128d __A, __m128d __B) __A)); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpord_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cmpunord_sd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comieq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comilt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comile_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comigt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comige_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comineq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomieq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomilt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomile_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomigt_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomige_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomineq_sd (__m128d __A, __m128d __B) { return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); } -/* Create a vector with element 0 as *P and the rest zero. */ +/* Create a vector of Qi, where i is the element number. */ -static __inline __m128i -_mm_load_si128 (__m128i const *__P) +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64x (long long __q1, long long __q0) { - return (__m128i) __builtin_ia32_loaddqa ((char const *)__P); + return __extension__ (__m128i)(__v2di){ __q0, __q1 }; } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +{ + return _mm_set_epi64x ((long long)__q1, (long long)__q0); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +{ + return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 }; +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +{ + return __extension__ (__m128i)(__v8hi){ + __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 }; +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +{ + return __extension__ (__m128i)(__v16qi){ + __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, + __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15 + }; +} + +/* Set all of the elements of the vector to A. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64x (long long __A) +{ + return _mm_set_epi64x (__A, __A); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64 (__m64 __A) +{ + return _mm_set_epi64 (__A, __A); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi32 (int __A) +{ + return _mm_set_epi32 (__A, __A, __A, __A); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi16 (short __A) +{ + return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi8 (char __A) +{ + return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A, + __A, __A, __A, __A, __A, __A, __A, __A); +} + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +{ + return _mm_set_epi64 (__q1, __q0); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +{ + return _mm_set_epi32 (__q3, __q2, __q1, __q0); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +{ + return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +{ + return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08, + __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00); +} + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_load_si128 (__m128i const *__P) +{ + return *__P; +} + +static __inline __m128i __attribute__((__always_inline__)) _mm_loadu_si128 (__m128i const *__P) { return (__m128i) __builtin_ia32_loaddqu ((char const *)__P); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_loadl_epi64 (__m128i const *__P) { - return (__m128i) __builtin_ia32_movq2dq (*(unsigned long long *)__P); + return _mm_set_epi64 ((__m64)0LL, *(__m64 *)__P); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_store_si128 (__m128i *__P, __m128i __B) { - __builtin_ia32_storedqa ((char *)__P, (__v16qi)__B); + *__P = __B; } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storeu_si128 (__m128i *__P, __m128i __B) { __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storel_epi64 (__m128i *__P, __m128i __B) { - *(long long *)__P = __builtin_ia32_movdq2q ((__v2di)__B); + *(long long *)__P = __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_movepi64_pi64 (__m128i __B) { - return (__m64) __builtin_ia32_movdq2q ((__v2di)__B); + return (__m64) __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) +_mm_movpi64_epi64 (__m64 __A) +{ + return _mm_set_epi64 ((__m64)0LL, __A); +} + +static __inline __m128i __attribute__((__always_inline__)) _mm_move_epi64 (__m128i __A) { - return (__m128i) __builtin_ia32_movq ((__v2di)__A); + return _mm_set_epi64 ((__m64)0LL, _mm_movepi64_pi64 (__A)); } /* Create a vector of zeros. */ -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_setzero_si128 (void) { - return (__m128i) __builtin_ia32_setzero128 (); + return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 }; } -static __inline __m128i -_mm_set_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp2, __tmp); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_set_epi32 (int __Z, int __Y, int __X, int __W) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} - -#ifdef __x86_64__ -/* Create the vector [Z Y]. */ -static __inline __m128i -_mm_set_epi64x (long long __Z, long long __Y) -{ - union { - long __a[2]; - __m128i __v; - } __u; - - __u.__a[0] = __Y; - __u.__a[1] = __Z; - - return __u.__v; -} -#endif - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi16 (short __Z, short __Y, short __X, short __W, - short __V, short __U, short __T, short __S) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_set_epi8 (char __Z, char __Y, char __X, char __W, - char __V, char __U, char __T, char __S, - char __Z1, char __Y1, char __X1, char __W1, - char __V1, char __U1, char __T1, char __S1) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128i -_mm_set1_epi64 (__m64 __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp); -} - -static __inline __m128i -_mm_set1_epi32 (int __A) -{ - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__A); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -#ifdef __x86_64__ -static __inline __m128i -_mm_set1_epi64x (long long __A) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - return (__m128i) __builtin_ia32_shufpd ((__v2df)__tmp, (__v2df)__tmp, _MM_SHUFFLE2 (0,0)); -} -#endif - -static __inline __m128i -_mm_set1_epi16 (short __A) -{ - int __Acopy = (unsigned short)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklwd128 ((__v8hi)__tmp, (__v8hi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_set1_epi8 (char __A) -{ - int __Acopy = (unsigned char)__A; - __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp); - return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128i -_mm_setr_epi64 (__m64 __A, __m64 __B) -{ - __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A); - __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B); - return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp2); -} - -/* Create the vector [Z Y X W]. */ -static __inline __m128i -_mm_setr_epi32 (int __W, int __X, int __Y, int __Z) -{ - union { - int __a[4]; - __m128i __v; - } __u; - - __u.__a[0] = __W; - __u.__a[1] = __X; - __u.__a[2] = __Y; - __u.__a[3] = __Z; - - return __u.__v; -} -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi16 (short __S, short __T, short __U, short __V, - short __W, short __X, short __Y, short __Z) -{ - union { - short __a[8]; - __m128i __v; - } __u; - - __u.__a[0] = __S; - __u.__a[1] = __T; - __u.__a[2] = __U; - __u.__a[3] = __V; - __u.__a[4] = __W; - __u.__a[5] = __X; - __u.__a[6] = __Y; - __u.__a[7] = __Z; - - return __u.__v; -} - -/* Create the vector [S T U V Z Y X W]. */ -static __inline __m128i -_mm_setr_epi8 (char __S1, char __T1, char __U1, char __V1, - char __W1, char __X1, char __Y1, char __Z1, - char __S, char __T, char __U, char __V, - char __W, char __X, char __Y, char __Z) -{ - union { - char __a[16]; - __m128i __v; - } __u; - - __u.__a[0] = __S1; - __u.__a[1] = __T1; - __u.__a[2] = __U1; - __u.__a[3] = __V1; - __u.__a[4] = __W1; - __u.__a[5] = __X1; - __u.__a[6] = __Y1; - __u.__a[7] = __Z1; - __u.__a[8] = __S; - __u.__a[9] = __T; - __u.__a[10] = __U; - __u.__a[11] = __V; - __u.__a[12] = __W; - __u.__a[13] = __X; - __u.__a[14] = __Y; - __u.__a[15] = __Z; - - return __u.__v; -} - -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtepi32_pd (__m128i __A) { return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtepi32_ps (__m128i __A) { return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cvtpd_epi32 (__m128d __A) { return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtpd_pi32 (__m128d __A) { return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpd_ps (__m128d __A) { return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cvttpd_epi32 (__m128d __A) { return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvttpd_pi32 (__m128d __A) { return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtpi32_pd (__m64 __A) { return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cvtps_epi32 (__m128 __A) { return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cvttps_epi32 (__m128 __A) { return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtps_pd (__m128 __A) { return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvtsd_si32 (__m128d __A) { return __builtin_ia32_cvtsd2si ((__v2df) __A); } #ifdef __x86_64__ -static __inline long long +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvtsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) _mm_cvtsd_si64x (__m128d __A) { return __builtin_ia32_cvtsd2si64 ((__v2df) __A); } #endif -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvttsd_si32 (__m128d __A) { return __builtin_ia32_cvttsd2si ((__v2df) __A); } #ifdef __x86_64__ -static __inline long long +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvttsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) _mm_cvttsd_si64x (__m128d __A) { return __builtin_ia32_cvttsd2si64 ((__v2df) __A); } #endif -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtsd_ss (__m128 __A, __m128d __B) { return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtsi32_sd (__m128d __A, int __B) { return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); } #ifdef __x86_64__ -static __inline __m128d +/* Intel intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +{ + return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); +} + +/* Microsoft intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtsi64x_sd (__m128d __A, long long __B) { return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); } #endif -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_cvtss_sd (__m128d __A, __m128 __B) { return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); @@ -922,465 +878,496 @@ _mm_cvtss_sd (__m128d __A, __m128 __B) #define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_unpackhi_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_unpacklo_pd (__m128d __A, __m128d __B) { return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_loadh_pd (__m128d __A, double const *__B) { - return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, (__v2si *)__B); + return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B); } -static __inline void -_mm_storeh_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storehpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_loadl_pd (__m128d __A, double const *__B) { - return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, (__v2si *)__B); + return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B); } -static __inline void -_mm_storel_pd (double *__A, __m128d __B) -{ - __builtin_ia32_storelpd ((__v2si *)__A, (__v2df)__B); -} - -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_movemask_pd (__m128d __A) { return __builtin_ia32_movmskpd ((__v2df)__A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_packs_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_packs_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_packus_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpackhi_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpackhi_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpackhi_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpackhi_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpacklo_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpacklo_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpacklo_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_unpacklo_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_add_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_add_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_add_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_add_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_adds_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_adds_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_adds_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_adds_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_sub_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_sub_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_sub_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_sub_epi64 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_subs_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_subs_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_subs_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_subs_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_madd_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_mulhi_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_mullo_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_mul_su32 (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_mul_epu32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i -_mm_sll_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_pslld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sll_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psllq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_sra_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi16 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi32 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v2di)__B); -} - -static __inline __m128i -_mm_srl_epi64 (__m128i __A, __m128i __B) -{ - return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); -} - -static __inline __m128i +#if 0 +static __inline __m128i __attribute__((__always_inline__)) _mm_slli_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_slli_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_slli_epi64 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); } +#else +#define _mm_slli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) +#endif -static __inline __m128i +#if 0 +static __inline __m128i __attribute__((__always_inline__)) _mm_srai_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_srai_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); } +#else +#define _mm_srai_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) +#define _mm_srai_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) +#endif #if 0 static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) +_mm_srli_si128 (__m128i __A, int __B) { - return ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) + return ((__m128i)__builtin_ia32_psrldqi128 (__A, __B * 8)); } static __m128i __attribute__((__always_inline__)) -_mm_srli_si128 (__m128i __A, const int __B) +_mm_srli_si128 (__m128i __A, int __B) { - return ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) + return ((__m128i)__builtin_ia32_pslldqi128 (__A, __B * 8)); } +#else +#define _mm_srli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_psrldqi128 (__A, (__B) * 8)) +#define _mm_slli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_pslldqi128 (__A, (__B) * 8)) #endif -#define _mm_srli_si128(__A, __B) ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) -#define _mm_slli_si128(__A, __B) ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) -static __inline __m128i +#if 0 +static __inline __m128i __attribute__((__always_inline__)) _mm_srli_epi16 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_srli_epi32 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_srli_epi64 (__m128i __A, int __B) { return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); } +#else +#define _mm_srli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrlwi128 ((__v8hi)(__A), __B)) +#define _mm_srli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) +#define _mm_srli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) +#endif -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); +} + +static __inline __m128i __attribute__((__always_inline__)) _mm_and_si128 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_andnot_si128 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_or_si128 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_xor_si128 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpeq_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpeq_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpeq_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmplt_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmplt_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmplt_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpgt_epi8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpgt_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cmpgt_epi32 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B); } -#define _mm_extract_epi16(__A, __B) __builtin_ia32_pextrw128 ((__v8hi)__A, __B) +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +{ + return __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N); +} -#define _mm_insert_epi16(__A, __B, __C) ((__m128i)__builtin_ia32_pinsrw128 ((__v8hi)__A, __B, __C)) +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +{ + return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N); +} +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_max_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_max_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_min_epi16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_min_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_movemask_epi8 (__m128i __A) { return __builtin_ia32_pmovmskb128 ((__v16qi)__A); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_mulhi_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); @@ -1390,101 +1377,125 @@ _mm_mulhi_epu16 (__m128i __A, __m128i __B) #define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) #define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) { __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_avg_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_avg_epu16 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_sad_epu8 (__m128i __A, __m128i __B) { return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_stream_si32 (int *__A, int __B) { __builtin_ia32_movnti (__A, __B); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_stream_si128 (__m128i *__A, __m128i __B) { __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_stream_pd (double *__A, __m128d __B) { __builtin_ia32_movntpd (__A, (__v2df)__B); } -static __inline __m128i -_mm_movpi64_epi64 (__m64 __A) -{ - return (__m128i)__builtin_ia32_movq2dq ((unsigned long long)__A); -} - -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_clflush (void const *__A) { - return __builtin_ia32_clflush (__A); + __builtin_ia32_clflush (__A); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_lfence (void) { __builtin_ia32_lfence (); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_mfence (void) { __builtin_ia32_mfence (); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_cvtsi32_si128 (int __A) { - return (__m128i) __builtin_ia32_loadd (&__A); + return _mm_set_epi32 (0, 0, 0, __A); } #ifdef __x86_64__ -static __inline __m128i +/* Intel intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64_si128 (long long __A) +{ + return _mm_set_epi64x (0, __A); +} + +/* Microsoft intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) _mm_cvtsi64x_si128 (long long __A) { - return (__m128i) __builtin_ia32_movq2dq (__A); + return _mm_set_epi64x (0, __A); } #endif -static __inline int -_mm_cvtsi128_si32 (__m128i __A) +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_castpd_ps(__m128d __A) { - int __tmp; - __builtin_ia32_stored (&__tmp, (__v4si)__A); - return __tmp; + return (__m128) __A; } -#ifdef __x86_64__ -static __inline long long -_mm_cvtsi128_si64x (__m128i __A) +static __inline __m128i __attribute__((__always_inline__)) +_mm_castpd_si128(__m128d __A) { - return __builtin_ia32_movdq2q ((__v2di)__A); + return (__m128i) __A; +} + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castps_pd(__m128 __A) +{ + return (__m128d) __A; +} + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castps_si128(__m128 __A) +{ + return (__m128i) __A; +} + +static __inline __m128 __attribute__((__always_inline__)) +_mm_castsi128_ps(__m128i __A) +{ + return (__m128) __A; +} + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castsi128_pd(__m128i __A) +{ + return (__m128d) __A; } -#endif #endif /* __SSE2__ */ diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index 4fc7a9ae478..deb92120933 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -1,5 +1,5 @@ /* Definitions for Intel 386 running FreeBSD with ELF format - Copyright (C) 1996, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu. Adapted from GNU/Linux version by John Polstra. @@ -19,8 +19,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); @@ -102,7 +102,6 @@ Boston, MA 02111-1307, USA. */ #undef LINK_SPEC #define LINK_SPEC "\ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ - %{Wl,*:%*} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/contrib/gcc/config/i386/freebsd64.h b/contrib/gcc/config/i386/freebsd64.h index 19e9bc25adb..257bdd95c50 100644 --- a/contrib/gcc/config/i386/freebsd64.h +++ b/contrib/gcc/config/i386/freebsd64.h @@ -1,5 +1,5 @@ /* Definitions for AMD x86-64 running FreeBSD with ELF format - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. Contributed by David O'Brien This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION @@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */ #undef LINK_SPEC #define LINK_SPEC "\ %{m32:-m elf_i386_fbsd} \ - %{Wl,*:%*} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ diff --git a/contrib/gcc/config/i386/gas.h b/contrib/gcc/config/i386/gas.h index 78195b97a85..8be55fbc809 100644 --- a/contrib/gcc/config/i386/gas.h +++ b/contrib/gcc/config/i386/gas.h @@ -1,5 +1,6 @@ /* Definitions for Intel 386 using GAS. - Copyright (C) 1988, 1993, 1994, 1996, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 1993, 1994, 1996, 2002, 2004 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Note that i386/seq-gas.h is a GAS configuration that does not use this file. */ @@ -49,10 +50,6 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME); -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - /* In the past there was confusion as to what the argument to .align was in GAS. For the last several years the rule has been this: for a.out file formats that argument is LOG, and for all other file formats the @@ -121,4 +118,8 @@ Boston, MA 02111-1307, USA. */ /* Print opcodes the way that GAS expects them. */ #define GAS_MNEMONICS 1 +/* The comment-starter string as GAS expects it. */ +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "#" + #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true diff --git a/contrib/gcc/config/i386/gmm_malloc.h b/contrib/gcc/config/i386/gmm_malloc.h new file mode 100644 index 00000000000..20d7f5e04d3 --- /dev/null +++ b/contrib/gcc/config/i386/gmm_malloc.h @@ -0,0 +1,77 @@ +/* Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +#ifndef _MM_MALLOC_H_INCLUDED +#define _MM_MALLOC_H_INCLUDED + +#include +#include + +static __inline__ void* +_mm_malloc (size_t size, size_t align) +{ + void * malloc_ptr; + void * aligned_ptr; + + /* Error if align is not a power of two. */ + if (align & (align - 1)) + { + errno = EINVAL; + return ((void*) 0); + } + + if (size == 0) + return ((void *) 0); + + /* Assume malloc'd pointer is aligned at least to sizeof (void*). + If necessary, add another sizeof (void*) to store the value + returned by malloc. Effectively this enforces a minimum alignment + of sizeof double. */ + if (align < 2 * sizeof (void *)) + align = 2 * sizeof (void *); + + malloc_ptr = malloc (size + align); + if (!malloc_ptr) + return ((void *) 0); + + /* Align We have at least sizeof (void *) space below malloc'd ptr. */ + aligned_ptr = (void *) (((size_t) malloc_ptr + align) + & ~((size_t) (align) - 1)); + + /* Store the original pointer just before p. */ + ((void **) aligned_ptr) [-1] = malloc_ptr; + + return aligned_ptr; +} + +static __inline__ void +_mm_free (void * aligned_ptr) +{ + if (aligned_ptr) + free (((void **) aligned_ptr) [-1]); +} + +#endif /* _MM_MALLOC_H_INCLUDED */ diff --git a/contrib/gcc/config/i386/gmon-sol2.c b/contrib/gcc/config/i386/gmon-sol2.c index 8ea242b0a40..fc5a2cf6103 100644 --- a/contrib/gcc/config/i386/gmon-sol2.c +++ b/contrib/gcc/config/i386/gmon-sol2.c @@ -53,22 +53,19 @@ * This code could easily be integrated with the original gmon.c and perhaps * should be. */ +#include "tconfig.h" +#include "tsystem.h" +#include /* for creat() */ -#ifndef lint -static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91"; -#endif /* not lint */ - -#if 0 -#include - -#endif #ifdef DEBUG #include #endif -#if 0 -#include "i386/gmon.h" -#else +static void moncontrol (int); +extern void monstartup (char *, char *); +extern void _mcleanup (void); +extern void internal_mcount (void); + struct phdr { char *lpc; @@ -90,6 +87,7 @@ struct tostruct { long count; unsigned short link; }; + struct rawarc { unsigned long raw_frompc; unsigned long raw_selfpc; @@ -97,14 +95,9 @@ struct rawarc { }; #define ROUNDDOWN(x,y) (((x)/(y))*(y)) #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) -#endif /* char *minbrk; */ -#ifdef __alpha -extern char *sbrk (); -#endif - /* * froms is actually a bunch of unsigned shorts indexing tos */ @@ -126,9 +119,8 @@ static int s_scale; extern int errno; -monstartup(lowpc, highpc) - char *lowpc; - char *highpc; +void +monstartup(char *lowpc, char *highpc) { int monsize; char *buffer; @@ -139,10 +131,10 @@ monstartup(lowpc, highpc) * so the rest of the scaling (here and in gprof) stays in ints. */ lowpc = (char *) - ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER)); + ROUNDDOWN((unsigned long)lowpc, HISTFRACTION*sizeof(HISTCOUNTER)); s_lowpc = lowpc; highpc = (char *) - ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER)); + ROUNDUP((unsigned long)highpc, HISTFRACTION*sizeof(HISTCOUNTER)); s_highpc = highpc; s_textsize = highpc - lowpc; monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr); @@ -203,7 +195,8 @@ monstartup(lowpc, highpc) moncontrol(1); } -_mcleanup() +void +_mcleanup (void) { int fd; int fromindex; @@ -220,7 +213,7 @@ _mcleanup() } # ifdef DEBUG fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); -# endif DEBUG +# endif /* DEBUG */ write( fd , sbuf , ssiz ); endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); @@ -234,7 +227,7 @@ _mcleanup() fprintf( stderr , "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , frompc , tos[toindex].selfpc , tos[toindex].count ); -# endif DEBUG +# endif /* DEBUG */ rawarc.raw_frompc = (unsigned long) frompc; rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; rawarc.raw_count = tos[toindex].count; @@ -249,7 +242,8 @@ asm(".globl _mcount; _mcount: jmp internal_mcount"); /* This is for compatibility with old versions of gcc which used mcount. */ asm(".globl mcount; mcount: jmp internal_mcount"); -internal_mcount() +void +internal_mcount (void) { register char *selfpc; register unsigned short *frompcindex; @@ -271,10 +265,10 @@ internal_mcount() frompcindex = (void *) __builtin_return_address (1); if(!already_setup) { - extern etext(); + extern char etext[]; already_setup = 1; /* monstartup(0, etext); */ - monstartup(0x08040000, etext); + monstartup((char*)0x08040000, etext); #ifdef USE_ONEXIT on_exit(_mcleanup, 0); #else @@ -387,15 +381,15 @@ overflow: * profiling is what mcount checks to see if * all the data structures are ready. */ -moncontrol(mode) - int mode; +static void +moncontrol(int mode) { if (mode) { /* start */ profil((unsigned short *)(sbuf + sizeof(struct phdr)), ssiz - sizeof(struct phdr), - (int)s_lowpc, s_scale); + (long)s_lowpc, s_scale); profiling = 0; } else { diff --git a/contrib/gcc/config/i386/gnu.h b/contrib/gcc/config/i386/gnu.h index cc9994bcaed..d40ff7d664a 100644 --- a/contrib/gcc/config/i386/gnu.h +++ b/contrib/gcc/config/i386/gnu.h @@ -8,11 +8,6 @@ do \ { \ HURD_TARGET_OS_CPP_BUILTINS(); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) @@ -40,4 +35,4 @@ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" /* FIXME: Is a Hurd-specific fallback mechanism necessary? */ -#undef MD_FALLBACK_FRAME_STATE_FOR +#undef MD_UNWIND_SUPPORT diff --git a/contrib/gcc/config/i386/gthr-win32.c b/contrib/gcc/config/i386/gthr-win32.c index c53369bca50..d13b5398c69 100644 --- a/contrib/gcc/config/i386/gthr-win32.c +++ b/contrib/gcc/config/i386/gthr-win32.c @@ -20,8 +20,8 @@ for more details. 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. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, @@ -182,3 +182,73 @@ __gthr_win32_mutex_unlock (__gthread_mutex_t *mutex) else return 0; } + +void +__gthr_win32_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex) +{ + mutex->counter = -1; + mutex->depth = 0; + mutex->owner = 0; + mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL); +} + +int +__gthr_win32_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex) +{ + DWORD me = GetCurrentThreadId(); + if (InterlockedIncrement (&mutex->counter) == 0) + { + mutex->depth = 1; + mutex->owner = me; + } + else if (mutex->owner == me) + { + InterlockedDecrement (&mutex->counter); + ++(mutex->depth); + } + else if (WaitForSingleObject (mutex->sema, INFINITE) == WAIT_OBJECT_0) + { + mutex->depth = 1; + mutex->owner = me; + } + else + { + /* WaitForSingleObject returns WAIT_FAILED, and we can only do + some best-effort cleanup here. */ + InterlockedDecrement (&mutex->counter); + return 1; + } + return 0; +} + +int +__gthr_win32_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex) +{ + DWORD me = GetCurrentThreadId(); + if (__GTHR_W32_InterlockedCompareExchange (&mutex->counter, 0, -1) < 0) + { + mutex->depth = 1; + mutex->owner = me; + } + else if (mutex->owner == me) + ++(mutex->depth); + else + return 1; + + return 0; +} + +int +__gthr_win32_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) +{ + --(mutex->depth); + if (mutex->depth == 0) + { + mutex->owner = 0; + + if (InterlockedDecrement (&mutex->counter) >= 0) + return ReleaseSemaphore (mutex->sema, 1, NULL) ? 0 : 1; + } + + return 0; +} diff --git a/contrib/gcc/config/i386/host-cygwin.c b/contrib/gcc/config/i386/host-cygwin.c new file mode 100755 index 00000000000..15bd2735ce3 --- /dev/null +++ b/contrib/gcc/config/i386/host-cygwin.c @@ -0,0 +1,81 @@ +/* Cygwin host-specific hook definitions. + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include +#include "hosthooks.h" +#include "hosthooks-def.h" +#include "toplev.h" +#include "diagnostic.h" + +static void * cygwin_gt_pch_get_address (size_t, int fd); +static size_t cygwin_gt_pch_alloc_granularity (void); + +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS +#define HOST_HOOKS_GT_PCH_GET_ADDRESS cygwin_gt_pch_get_address +#undef HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY +#define HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY cygwin_gt_pch_alloc_granularity + +/* Granularity for reserving address space. */ +static const size_t va_granularity = 0x10000; + +/* Return the alignment required for allocating virtual memory. */ +static size_t +cygwin_gt_pch_alloc_granularity (void) +{ + return va_granularity; +} + +/* Identify an address that's likely to be free in a subsequent invocation + of the compiler. The area should be able to hold SIZE bytes. FD is an + open file descriptor if the host would like to probe with mmap. */ +static void * +cygwin_gt_pch_get_address (size_t sz, int fd) +{ + void *base; + off_t p = lseek(fd, 0, SEEK_CUR); + + if (p == (off_t) -1) + fatal_error ("can't get position in PCH file: %m"); + + /* Cygwin requires that the underlying file be at least + as large as the requested mapping. */ + if ((size_t) p < sz) + { + if ( ftruncate (fd, sz) == -1 ) + fatal_error ("can't extend PCH file: %m"); + } + + base = mmap (NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); + + if (base == MAP_FAILED) + base = NULL; + else + munmap (base, sz); + + if (lseek (fd, p, SEEK_SET) == (off_t) -1 ) + fatal_error ("can't set position in PCH file: %m"); + + return base; +} + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/i386/host-i386-darwin.c b/contrib/gcc/config/i386/host-i386-darwin.c new file mode 100644 index 00000000000..3025bdae675 --- /dev/null +++ b/contrib/gcc/config/i386/host-i386-darwin.c @@ -0,0 +1,31 @@ +/* i386-darwin host-specific hook definitions. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "hosthooks.h" +#include "hosthooks-def.h" +#include "config/host-darwin.h" + +/* Darwin doesn't do anything special for x86 hosts; this file exists just + to include config/host-darwin.h. */ + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/i386/host-mingw32.c b/contrib/gcc/config/i386/host-mingw32.c new file mode 100644 index 00000000000..a341e27c084 --- /dev/null +++ b/contrib/gcc/config/i386/host-mingw32.c @@ -0,0 +1,148 @@ +/* mingw32 host-specific hook definitions. + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "hosthooks.h" +#include "hosthooks-def.h" +#include "toplev.h" +#include "diagnostic.h" + + +#define WIN32_LEAN_AND_MEAN /* Not so important if we have windows.h.gch. */ +#include + +static void * mingw32_gt_pch_get_address (size_t, int); +static int mingw32_gt_pch_use_address (void *, size_t, int, size_t); +static size_t mingw32_gt_pch_alloc_granularity (void); + +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS +#define HOST_HOOKS_GT_PCH_GET_ADDRESS mingw32_gt_pch_get_address +#undef HOST_HOOKS_GT_PCH_USE_ADDRESS +#define HOST_HOOKS_GT_PCH_USE_ADDRESS mingw32_gt_pch_use_address +#undef HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY +#define HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY mingw32_gt_pch_alloc_granularity + +static inline void w32_error(const char*, const char*, int, const char*); + +/* FIXME: Is this big enough? */ +static const size_t pch_VA_max_size = 128 * 1024 * 1024; + +/* Granularity for reserving address space. */ +static const size_t va_granularity = 0x10000; + +/* Print out the GetLastError() translation. */ +static inline void +w32_error (const char* function, const char* file, int line, + const char* my_msg) +{ + LPSTR w32_msgbuf; + FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS + | FORMAT_MESSAGE_MAX_WIDTH_MASK, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR) &w32_msgbuf, 0, NULL); + fprintf(stderr, "internal error in %s, at %s:%d: %s: %s\n", + function, trim_filename (file), line, my_msg, w32_msgbuf); + LocalFree ((HLOCAL)w32_msgbuf); +} + +/* Granularity for reserving address space. */ +static size_t mingw32_gt_pch_alloc_granularity (void) +{ + return va_granularity; +} + +/* Identify an address that's likely to be free in a subsequent invocation + of the compiler. The area should be able to hold SIZE bytes. FD is an + open file descriptor if the host would like to probe with mmap. */ + +static void * +mingw32_gt_pch_get_address (size_t size, int fd ATTRIBUTE_UNUSED) +{ + void* res; + size = (size + va_granularity - 1) & ~(va_granularity - 1); + if (size > pch_VA_max_size) + return NULL; + + /* FIXME: We let system determine base by setting first arg to NULL. + Allocating at top of available address space avoids unnecessary + fragmentation of "ordinary" (malloc's) address space but may not be safe + with delayed load of system dll's. Preferred addresses for NT system + dlls is in 0x70000000 to 0x78000000 range. + If we allocate at bottom we need to reserve the address as early as possible + and at the same point in each invocation. */ + + res = VirtualAlloc (NULL, pch_VA_max_size, + MEM_RESERVE | MEM_TOP_DOWN, + PAGE_NOACCESS); + if (!res) + w32_error (__FUNCTION__, __FILE__, __LINE__, "VirtualAlloc"); + else + /* We do not need the address space for now, so free it. */ + VirtualFree (res, 0, MEM_RELEASE); + + return res; +} + +/* ADDR is an address returned by gt_pch_get_address. Attempt to allocate + SIZE bytes at the same address and load it with the data from FD at + OFFSET. Return -1 if we couldn't allocate memory at ADDR, return 0 + if the memory is allocated but the data not loaded, return 1 if done. */ + +static int +mingw32_gt_pch_use_address (void *addr, size_t size, int fd, + size_t offset) +{ + void * mmap_addr; + static HANDLE mmap_handle; + + if (size == 0) + return 0; + + /* Offset must be also be a multiple of allocation granularity for + this to work. We can't change the offset. */ + if ((offset & (va_granularity - 1)) != 0 || size > pch_VA_max_size) + return -1; + + mmap_handle = CreateFileMapping ((HANDLE) _get_osfhandle (fd), + NULL, PAGE_WRITECOPY | SEC_COMMIT, + 0, 0, NULL); + if (mmap_handle == NULL) + { + w32_error (__FUNCTION__, __FILE__, __LINE__, "CreateFileMapping"); + return -1; + } + mmap_addr = MapViewOfFileEx (mmap_handle, FILE_MAP_COPY, 0, offset, + size, addr); + if (mmap_addr != addr) + { + w32_error (__FUNCTION__, __FILE__, __LINE__, "MapViewOfFileEx"); + CloseHandle(mmap_handle); + return -1; + } + + return 1; +} + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/i386/i386-aout.h b/contrib/gcc/config/i386/i386-aout.h index 3b8978879d1..9deb3573f3d 100644 --- a/contrib/gcc/config/i386/i386-aout.h +++ b/contrib/gcc/config/i386/i386-aout.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (80386, BSD a.out syntax)"); diff --git a/contrib/gcc/config/i386/i386-coff.h b/contrib/gcc/config/i386/i386-coff.h index 85a519310b4..bea8e19f438 100644 --- a/contrib/gcc/config/i386/i386-coff.h +++ b/contrib/gcc/config/i386/i386-coff.h @@ -1,7 +1,7 @@ /* Definitions for "naked" Intel 386 using coff object format files and coff debugging info. - Copyright (C) 1994, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2000, 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (80386, COFF BSD syntax)"); @@ -60,4 +60,11 @@ Boston, MA 02111-1307, USA. */ #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ sprintf ((BUF), ".%s%ld", (PREFIX), (long)(NUMBER)) +/* GNU as expects alignment to be the number of bytes instead of the log for + COFF targets. */ + +#undef ASM_OUTPUT_ALIGN +#define ASM_OUTPUT_ALIGN(FILE,LOG) \ + if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) + /* end of i386-coff.h */ diff --git a/contrib/gcc/config/i386/i386-interix.h b/contrib/gcc/config/i386/i386-interix.h index 2a99ce549a7..5e9f7dadbc1 100644 --- a/contrib/gcc/config/i386/i386-interix.h +++ b/contrib/gcc/config/i386/i386-interix.h @@ -22,8 +22,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* The rest must follow. */ @@ -54,6 +54,8 @@ Boston, MA 02111-1307, USA. */ #define ASM_LOAD_ADDR(loc, reg) " leal " #loc "," #reg "\n" +#define TARGET_DECLSPEC 1 + /* cpp handles __STDC__ */ #define TARGET_OS_CPP_BUILTINS() \ do \ @@ -64,7 +66,6 @@ Boston, MA 02111-1307, USA. */ builtin_define ("_X86_=1"); \ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ - builtin_define ("__declspec(x)=__attribute__((x))"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=interix"); \ if (preprocessing_asm_p ()) \ @@ -83,7 +84,7 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SPEC /* Write out the correct language type definition for the header files. Unless we have assembler language, write out the symbols for C. - mieee is an Alpha specific variant. Cross polination a bad idea. + mieee is an Alpha specific variant. Cross pollination a bad idea. */ #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \ -isystem %$INTERIX_ROOT/usr/include" @@ -285,7 +286,6 @@ do \ } \ while (0) -#define HOST_PTR_PRINTF "%p" #define HOST_PTR_AS_INT unsigned long #define PCC_BITFIELD_TYPE_MATTERS 1 @@ -336,14 +336,12 @@ while (0) .data$ sections correctly. See corresponding note in i386/interix.c. MK. */ -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* Interix uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 extern void i386_pe_unique_section (tree, int); #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section +#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section #define SUPPORTS_ONE_ONLY 1 #endif /* 0 */ diff --git a/contrib/gcc/config/i386/i386-interix3.h b/contrib/gcc/config/i386/i386-interix3.h index 7ade70a2c22..2c40461f65e 100644 --- a/contrib/gcc/config/i386/i386-interix3.h +++ b/contrib/gcc/config/i386/i386-interix3.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef CPP_SPEC #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" diff --git a/contrib/gcc/config/i386/i386-modes.def b/contrib/gcc/config/i386/i386-modes.def index 36c6d42e2d7..40c12b13c3e 100644 --- a/contrib/gcc/config/i386/i386-modes.def +++ b/contrib/gcc/config/i386/i386-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC for IA-32. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,18 +15,18 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ -/* x86_64 ABI specifies both XF and TF modes. +/* The x86_64 ABI specifies both XF and TF modes. XFmode is __float80 is IEEE extended; TFmode is __float128 - is IEEE quad. + is IEEE quad. */ - IEEE extended is 128 bits wide, except in ILP32 mode, but we - have to say it's 12 bytes so that the bitsize and wider_mode - tables are correctly set up. We correct its size below. */ +FRACTIONAL_FLOAT_MODE (XF, 80, 12, ieee_extended_intel_96_format); +FLOAT_MODE (TF, 16, ieee_quad_format); -FLOAT_MODE (XF, 12, ieee_extended_intel_96_format); +/* In ILP32 mode, XFmode has size 12 and alignment 4. + In LP64 mode, XFmode has size and alignment 16. */ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE ? &ieee_extended_intel_128_format : TARGET_96_ROUND_53_LONG_DOUBLE @@ -34,7 +34,6 @@ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE : &ieee_extended_intel_96_format)); ADJUST_BYTESIZE (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 12); ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4); -FLOAT_MODE (TF, 16, ieee_quad_format); /* Add any extra modes needed to represent the condition code. @@ -62,3 +61,19 @@ CC_MODE (CCNO); CC_MODE (CCZ); CC_MODE (CCFP); CC_MODE (CCFPU); + +/* Vector modes. */ +VECTOR_MODES (INT, 4); /* V4QI V2HI */ +VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */ +VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */ +VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */ +VECTOR_MODES (FLOAT, 16); /* V8HF V4SF V2DF */ +VECTOR_MODE (INT, DI, 4); /* V4DI */ +VECTOR_MODE (INT, SI, 8); /* V8SI */ +VECTOR_MODE (INT, HI, 16); /* V16HI */ +VECTOR_MODE (INT, QI, 32); /* V32QI */ +VECTOR_MODE (FLOAT, DF, 4); /* V4DF */ +VECTOR_MODE (FLOAT, SF, 8); /* V8SF */ + +/* The symbol Pmode stands for one of the above machine modes (usually SImode). + The tm.h file specifies which one. It is not a distinct mode. */ diff --git a/contrib/gcc/config/i386/i386-protos.h b/contrib/gcc/config/i386/i386-protos.h index ea0e8f65158..6b9ed89c75b 100644 --- a/contrib/gcc/config/i386/i386-protos.h +++ b/contrib/gcc/config/i386/i386-protos.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GCC for IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Functions in i386.c */ extern void override_options (void); @@ -42,62 +43,15 @@ extern int standard_80387_constant_p (rtx); extern const char *standard_80387_constant_opcode (rtx); extern rtx standard_80387_constant_rtx (int); extern int standard_sse_constant_p (rtx); +extern const char *standard_sse_constant_opcode (rtx, rtx); extern int symbolic_reference_mentioned_p (rtx); extern bool extended_reg_mentioned_p (rtx); extern bool x86_extended_QIreg_mentioned_p (rtx); extern bool x86_extended_reg_mentioned_p (rtx); - -extern int any_fp_register_operand (rtx, enum machine_mode); -extern int register_and_not_any_fp_reg_operand (rtx, enum machine_mode); - -extern int fp_register_operand (rtx, enum machine_mode); -extern int register_and_not_fp_reg_operand (rtx, enum machine_mode); - -extern int x86_64_general_operand (rtx, enum machine_mode); -extern int x86_64_szext_general_operand (rtx, enum machine_mode); -extern int x86_64_nonmemory_operand (rtx, enum machine_mode); -extern int x86_64_szext_nonmemory_operand (rtx, enum machine_mode); -extern int x86_64_immediate_operand (rtx, enum machine_mode); -extern int x86_64_zext_immediate_operand (rtx, enum machine_mode); -extern int symbolic_operand (rtx, enum machine_mode); -extern int tls_symbolic_operand (rtx, enum machine_mode); -extern int global_dynamic_symbolic_operand (rtx, enum machine_mode); -extern int local_dynamic_symbolic_operand (rtx, enum machine_mode); -extern int initial_exec_symbolic_operand (rtx, enum machine_mode); -extern int local_exec_symbolic_operand (rtx, enum machine_mode); -extern int pic_symbolic_operand (rtx, enum machine_mode); -extern int call_insn_operand (rtx, enum machine_mode); -extern int sibcall_insn_operand (rtx, enum machine_mode); -extern int constant_call_address_operand (rtx, enum machine_mode); -extern int const0_operand (rtx, enum machine_mode); -extern int const1_operand (rtx, enum machine_mode); -extern int const248_operand (rtx, enum machine_mode); -extern int incdec_operand (rtx, enum machine_mode); -extern int reg_no_sp_operand (rtx, enum machine_mode); -extern int mmx_reg_operand (rtx, enum machine_mode); -extern int general_no_elim_operand (rtx, enum machine_mode); -extern int nonmemory_no_elim_operand (rtx, enum machine_mode); -extern int q_regs_operand (rtx, enum machine_mode); -extern int non_q_regs_operand (rtx, enum machine_mode); -extern int sse_comparison_operator (rtx, enum machine_mode); -extern int fcmov_comparison_operator (rtx, enum machine_mode); -extern int cmp_fp_expander_operand (rtx, enum machine_mode); -extern int ix86_comparison_operator (rtx, enum machine_mode); -extern int ext_register_operand (rtx, enum machine_mode); -extern int binary_fp_operator (rtx, enum machine_mode); -extern int mult_operator (rtx, enum machine_mode); -extern int div_operator (rtx, enum machine_mode); -extern int arith_or_logical_operator (rtx, enum machine_mode); -extern int promotable_binary_operator (rtx, enum machine_mode); -extern int memory_displacement_operand (rtx, enum machine_mode); -extern int cmpsi_operand (rtx, enum machine_mode); -extern int long_memory_operand (rtx, enum machine_mode); -extern int aligned_operand (rtx, enum machine_mode); -extern int compare_operator (rtx, enum machine_mode); extern enum machine_mode ix86_cc_mode (enum rtx_code, rtx, rtx); -extern int ix86_expand_movstr (rtx, rtx, rtx, rtx); -extern int ix86_expand_clrstr (rtx, rtx, rtx); +extern int ix86_expand_movmem (rtx, rtx, rtx, rtx); +extern int ix86_expand_clrmem (rtx, rtx, rtx); extern int ix86_expand_strlen (rtx, rtx, rtx, rtx); extern bool legitimate_constant_p (rtx); @@ -105,7 +59,6 @@ extern bool constant_address_p (rtx); extern bool legitimate_pic_operand_p (rtx); extern int legitimate_pic_address_disp_p (rtx); extern int legitimate_address_p (enum machine_mode, rtx, int); -extern rtx legitimize_pic_address (rtx, rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); extern void print_reg (rtx, int, FILE*); @@ -116,22 +69,32 @@ extern bool output_addr_const_extra (FILE*, rtx); extern void split_di (rtx[], int, rtx[], rtx[]); extern void split_ti (rtx[], int, rtx[], rtx[]); -extern const char *output_set_got (rtx); +extern const char *output_set_got (rtx, rtx); extern const char *output_387_binary_op (rtx, rtx*); -extern const char *output_fix_trunc (rtx, rtx*); +extern const char *output_387_reg_move (rtx, rtx*); +extern const char *output_fix_trunc (rtx, rtx*, int); extern const char *output_fp_compare (rtx, rtx*, int, int); -extern void i386_dwarf_output_addr_const (FILE*, rtx); -extern void i386_output_dwarf_dtprel (FILE*, int, rtx); - extern void ix86_expand_clear (rtx); extern void ix86_expand_move (enum machine_mode, rtx[]); extern void ix86_expand_vector_move (enum machine_mode, rtx[]); +extern void ix86_expand_vector_move_misalign (enum machine_mode, rtx[]); +extern void ix86_expand_push (enum machine_mode, rtx); +extern rtx ix86_fixup_binary_operands (enum rtx_code, + enum machine_mode, rtx[]); +extern void ix86_fixup_binary_operands_no_copy (enum rtx_code, + enum machine_mode, rtx[]); extern void ix86_expand_binary_operator (enum rtx_code, enum machine_mode, rtx[]); extern int ix86_binary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); extern void ix86_expand_unary_operator (enum rtx_code, enum machine_mode, rtx[]); +extern rtx ix86_build_signbit_mask (enum machine_mode, bool, bool); +extern void ix86_expand_fp_absneg_operator (enum rtx_code, enum machine_mode, + rtx[]); +extern void ix86_expand_copysign (rtx []); +extern void ix86_split_copysign_const (rtx []); +extern void ix86_split_copysign_var (rtx []); extern int ix86_unary_operator_ok (enum rtx_code, enum machine_mode, rtx[]); extern int ix86_match_ccmode (rtx, enum machine_mode); extern rtx ix86_expand_compare (enum rtx_code, rtx *, rtx *); @@ -140,25 +103,25 @@ extern void ix86_expand_branch (enum rtx_code, rtx); extern int ix86_expand_setcc (enum rtx_code, rtx); extern int ix86_expand_int_movcc (rtx[]); extern int ix86_expand_fp_movcc (rtx[]); +extern bool ix86_expand_fp_vcond (rtx[]); +extern bool ix86_expand_int_vcond (rtx[]); extern int ix86_expand_int_addcc (rtx[]); extern void ix86_expand_call (rtx, rtx, rtx, rtx, rtx, int); extern void x86_initialize_trampoline (rtx, rtx, rtx); extern rtx ix86_zero_extend_to_Pmode (rtx); extern void ix86_split_long_move (rtx[]); -extern void ix86_split_ashldi (rtx *, rtx); -extern void ix86_split_ashrdi (rtx *, rtx); -extern void ix86_split_lshrdi (rtx *, rtx); +extern void ix86_split_ashl (rtx *, rtx, enum machine_mode); +extern void ix86_split_ashr (rtx *, rtx, enum machine_mode); +extern void ix86_split_lshr (rtx *, rtx, enum machine_mode); extern rtx ix86_find_base_term (rtx); extern int ix86_check_movabs (rtx, int); -extern rtx assign_386_stack_local (enum machine_mode, int); +extern rtx assign_386_stack_local (enum machine_mode, enum ix86_stack_slot); extern int ix86_attr_length_immediate_default (rtx, int); extern int ix86_attr_length_address_default (rtx); extern enum machine_mode ix86_fp_compare_mode (enum rtx_code); -extern int x86_64_sign_extended_value (rtx); -extern int x86_64_zero_extended_value (rtx); extern rtx ix86_libcall_value (enum machine_mode); extern bool ix86_function_value_regno_p (int); extern bool ix86_function_arg_regno_p (int); @@ -166,36 +129,40 @@ extern int ix86_function_arg_boundary (enum machine_mode, tree); extern int ix86_return_in_memory (tree); extern void ix86_va_start (tree, rtx); extern rtx ix86_va_arg (tree, tree); -extern void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *, - enum machine_mode, tree, int *, int); extern rtx ix86_force_to_memory (enum machine_mode, rtx); extern void ix86_free_from_memory (enum machine_mode); -extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx, rtx, rtx, rtx); -extern int ix86_hard_regno_mode_ok (int, enum machine_mode); +extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx, + rtx, rtx, rtx, rtx); +extern bool ix86_hard_regno_mode_ok (int, enum machine_mode); +extern bool ix86_modes_tieable_p (enum machine_mode, enum machine_mode); extern int ix86_register_move_cost (enum machine_mode, enum reg_class, enum reg_class); extern int ix86_secondary_memory_needed (enum reg_class, enum reg_class, enum machine_mode, int); +extern bool ix86_cannot_change_mode_class (enum machine_mode, + enum machine_mode, enum reg_class); extern enum reg_class ix86_preferred_reload_class (rtx, enum reg_class); +extern enum reg_class ix86_preferred_output_reload_class (rtx, enum reg_class); extern int ix86_memory_move_cost (enum machine_mode, enum reg_class, int); -extern void emit_i387_cw_initialization (rtx, rtx); +extern int ix86_mode_needed (int, rtx); +extern void emit_i387_cw_initialization (int); extern bool ix86_fp_jump_nontrivial_p (enum rtx_code); extern void x86_order_regs_for_local_alloc (void); extern void x86_function_profiler (FILE *, int); extern void x86_emit_floatuns (rtx [2]); +extern void ix86_emit_fp_unordered_jump (rtx); +extern void ix86_emit_i387_log1p (rtx, rtx); + +extern enum rtx_code ix86_reverse_condition (enum rtx_code, enum machine_mode); #ifdef TREE_CODE extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern int function_arg_pass_by_reference (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern rtx ix86_function_value (tree); -extern void ix86_init_builtins (void); -extern rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +extern rtx ix86_function_value (tree, tree, bool); #endif #endif @@ -206,27 +173,64 @@ extern int ix86_return_pops_args (tree, tree, int); extern int ix86_data_alignment (tree, int); extern int ix86_local_alignment (tree, int); extern int ix86_constant_alignment (tree, int); -extern tree ix86_handle_dll_attribute (tree *, tree, tree, int, bool *); extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *); +extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *); extern unsigned int i386_pe_section_type_flags (tree, const char *, int); -extern void i386_pe_asm_named_section (const char *, unsigned int); +extern void i386_pe_asm_named_section (const char *, unsigned int, tree); extern int x86_field_alignment (tree, int); #endif extern rtx ix86_tls_get_addr (void); -extern bool ix86_must_pass_in_stack (enum machine_mode mode, tree); +extern rtx ix86_tls_module_base (void); + +extern void ix86_expand_vector_init (bool, rtx, rtx); +extern void ix86_expand_vector_set (bool, rtx, rtx, int); +extern void ix86_expand_vector_extract (bool, rtx, rtx, int); +extern void ix86_expand_reduc_v4sf (rtx (*)(rtx, rtx, rtx), rtx, rtx); -extern void ix86_expand_vector_init (rtx, rtx); /* In winnt.c */ extern int i386_pe_dllexport_name_p (const char *); extern int i386_pe_dllimport_name_p (const char *); extern void i386_pe_unique_section (tree, int); extern void i386_pe_declare_function_type (FILE *, const char *, int); -extern void i386_pe_record_external_function (const char *); +extern void i386_pe_record_external_function (tree, const char *); extern void i386_pe_record_exported_symbol (const char *, int); extern void i386_pe_asm_file_end (FILE *); extern void i386_pe_encode_section_info (tree, rtx, int); extern const char *i386_pe_strip_name_encoding (const char *); extern const char *i386_pe_strip_name_encoding_full (const char *); extern void i386_pe_output_labelref (FILE *, const char *); +extern bool i386_pe_valid_dllimport_attribute_p (tree); + +/* In winnt-cxx.c and winnt-stubs.c */ +extern void i386_pe_adjust_class_at_definition (tree); +extern bool i386_pe_type_dllimport_p (tree); +extern bool i386_pe_type_dllexport_p (tree); + +extern rtx maybe_get_pool_constant (rtx); + +extern char internal_label_prefix[16]; +extern int internal_label_prefix_len; + +enum ix86_address_seg { SEG_DEFAULT, SEG_FS, SEG_GS }; +struct ix86_address +{ + rtx base, index, disp; + HOST_WIDE_INT scale; + enum ix86_address_seg seg; +}; + +extern int ix86_decompose_address (rtx, struct ix86_address *); +extern int memory_address_length (rtx addr); +extern void x86_output_aligned_bss (FILE *, tree, const char *, + unsigned HOST_WIDE_INT, int); +extern void x86_elf_aligned_common (FILE *, const char *, + unsigned HOST_WIDE_INT, int); + +#ifdef RTX_CODE +extern void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *, + enum rtx_code *, enum rtx_code *); +extern enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code); +#endif +extern int asm_preferred_eh_data_format (int, int); diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c index e6f71b466f1..29afed7cf01 100644 --- a/contrib/gcc/config/i386/i386.c +++ b/contrib/gcc/config/i386/i386.c @@ -1,6 +1,6 @@ /* Subroutines used for code generation on IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ #include "insn-config.h" #include "conditions.h" #include "output.h" +#include "insn-codes.h" #include "insn-attr.h" #include "flags.h" #include "except.h" @@ -46,6 +47,9 @@ Boston, MA 02111-1307, USA. */ #include "target-def.h" #include "langhooks.h" #include "cgraph.h" +#include "tree-gimple.h" +#include "dwarf2.h" +#include "tm-constrs.h" #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -60,17 +64,28 @@ Boston, MA 02111-1307, USA. */ : 4) /* Processor costs (relative to an add) */ +/* We assume COSTS_N_INSNS is defined as (N)*4 and an addition is 2 bytes. */ +#define COSTS_N_BYTES(N) ((N) * 2) + static const -struct processor_costs size_cost = { /* costs for tunning for size */ - 2, /* cost of an add instruction */ - 3, /* cost of a lea instruction */ - 2, /* variable shift costs */ - 3, /* constant shift costs */ - {3, 3, 3, 3, 5}, /* cost of starting a multiply */ +struct processor_costs size_cost = { /* costs for tuning for size */ + COSTS_N_BYTES (2), /* cost of an add instruction */ + COSTS_N_BYTES (3), /* cost of a lea instruction */ + COSTS_N_BYTES (2), /* variable shift costs */ + COSTS_N_BYTES (3), /* constant shift costs */ + {COSTS_N_BYTES (3), /* cost of starting multiply for QI */ + COSTS_N_BYTES (3), /* HI */ + COSTS_N_BYTES (3), /* SI */ + COSTS_N_BYTES (3), /* DI */ + COSTS_N_BYTES (5)}, /* other */ 0, /* cost of multiply per each bit set */ - {3, 3, 3, 3, 5}, /* cost of a divide/mod */ - 3, /* cost of movsx */ - 3, /* cost of movzx */ + {COSTS_N_BYTES (3), /* cost of a divide/mod for QI */ + COSTS_N_BYTES (3), /* HI */ + COSTS_N_BYTES (3), /* SI */ + COSTS_N_BYTES (3), /* DI */ + COSTS_N_BYTES (5)}, /* other */ + COSTS_N_BYTES (3), /* cost of movsx */ + COSTS_N_BYTES (3), /* cost of movzx */ 0, /* "large" insn */ 2, /* MOVE_RATIO */ 2, /* cost for loading QImode using movzbl */ @@ -81,7 +96,8 @@ struct processor_costs size_cost = { /* costs for tunning for size */ 2, /* cost of reg,reg fld/fst */ {2, 2, 2}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {2, 2, 2}, /* cost of loading integer registers */ + {2, 2, 2}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 3, /* cost of moving MMX register */ {3, 3}, /* cost of loading MMX registers in SImode and DImode */ @@ -95,27 +111,35 @@ struct processor_costs size_cost = { /* costs for tunning for size */ 3, /* MMX or SSE register to integer */ 0, /* size of prefetch block */ 0, /* number of parallel prefetches */ - 1, /* Branch cost */ - 2, /* cost of FADD and FSUB insns. */ - 2, /* cost of FMUL instruction. */ - 2, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 2, /* cost of FSQRT instruction. */ + 2, /* Branch cost */ + COSTS_N_BYTES (2), /* cost of FADD and FSUB insns. */ + COSTS_N_BYTES (2), /* cost of FMUL instruction. */ + COSTS_N_BYTES (2), /* cost of FDIV instruction. */ + COSTS_N_BYTES (2), /* cost of FABS instruction. */ + COSTS_N_BYTES (2), /* cost of FCHS instruction. */ + COSTS_N_BYTES (2), /* cost of FSQRT instruction. */ }; /* Processor costs (relative to an add) */ static const struct processor_costs i386_cost = { /* 386 specific costs */ - 1, /* cost of an add instruction */ - 1, /* cost of a lea instruction */ - 3, /* variable shift costs */ - 2, /* constant shift costs */ - {6, 6, 6, 6, 6}, /* cost of starting a multiply */ - 1, /* cost of multiply per each bit set */ - {23, 23, 23, 23, 23}, /* cost of a divide/mod */ - 3, /* cost of movsx */ - 2, /* cost of movzx */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (3), /* variable shift costs */ + COSTS_N_INSNS (2), /* constant shift costs */ + {COSTS_N_INSNS (6), /* cost of starting multiply for QI */ + COSTS_N_INSNS (6), /* HI */ + COSTS_N_INSNS (6), /* SI */ + COSTS_N_INSNS (6), /* DI */ + COSTS_N_INSNS (6)}, /* other */ + COSTS_N_INSNS (1), /* cost of multiply per each bit set */ + {COSTS_N_INSNS (23), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (23), /* HI */ + COSTS_N_INSNS (23), /* SI */ + COSTS_N_INSNS (23), /* DI */ + COSTS_N_INSNS (23)}, /* other */ + COSTS_N_INSNS (3), /* cost of movsx */ + COSTS_N_INSNS (2), /* cost of movzx */ 15, /* "large" insn */ 3, /* MOVE_RATIO */ 4, /* cost for loading QImode using movzbl */ @@ -126,7 +150,8 @@ struct processor_costs i386_cost = { /* 386 specific costs */ 2, /* cost of reg,reg fld/fst */ {8, 8, 8}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {8, 8, 8}, /* cost of loading integer registers */ + {8, 8, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {4, 8}, /* cost of loading MMX registers in SImode and DImode */ @@ -141,25 +166,33 @@ struct processor_costs i386_cost = { /* 386 specific costs */ 0, /* size of prefetch block */ 0, /* number of parallel prefetches */ 1, /* Branch cost */ - 23, /* cost of FADD and FSUB insns. */ - 27, /* cost of FMUL instruction. */ - 88, /* cost of FDIV instruction. */ - 22, /* cost of FABS instruction. */ - 24, /* cost of FCHS instruction. */ - 122, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (23), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (27), /* cost of FMUL instruction. */ + COSTS_N_INSNS (88), /* cost of FDIV instruction. */ + COSTS_N_INSNS (22), /* cost of FABS instruction. */ + COSTS_N_INSNS (24), /* cost of FCHS instruction. */ + COSTS_N_INSNS (122), /* cost of FSQRT instruction. */ }; static const struct processor_costs i486_cost = { /* 486 specific costs */ - 1, /* cost of an add instruction */ - 1, /* cost of a lea instruction */ - 3, /* variable shift costs */ - 2, /* constant shift costs */ - {12, 12, 12, 12, 12}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (3), /* variable shift costs */ + COSTS_N_INSNS (2), /* constant shift costs */ + {COSTS_N_INSNS (12), /* cost of starting multiply for QI */ + COSTS_N_INSNS (12), /* HI */ + COSTS_N_INSNS (12), /* SI */ + COSTS_N_INSNS (12), /* DI */ + COSTS_N_INSNS (12)}, /* other */ 1, /* cost of multiply per each bit set */ - {40, 40, 40, 40, 40}, /* cost of a divide/mod */ - 3, /* cost of movsx */ - 2, /* cost of movzx */ + {COSTS_N_INSNS (40), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (40), /* HI */ + COSTS_N_INSNS (40), /* SI */ + COSTS_N_INSNS (40), /* DI */ + COSTS_N_INSNS (40)}, /* other */ + COSTS_N_INSNS (3), /* cost of movsx */ + COSTS_N_INSNS (2), /* cost of movzx */ 15, /* "large" insn */ 3, /* MOVE_RATIO */ 4, /* cost for loading QImode using movzbl */ @@ -170,7 +203,8 @@ struct processor_costs i486_cost = { /* 486 specific costs */ 2, /* cost of reg,reg fld/fst */ {8, 8, 8}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {8, 8, 8}, /* cost of loading integer registers */ + {8, 8, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {4, 8}, /* cost of loading MMX registers in SImode and DImode */ @@ -185,25 +219,33 @@ struct processor_costs i486_cost = { /* 486 specific costs */ 0, /* size of prefetch block */ 0, /* number of parallel prefetches */ 1, /* Branch cost */ - 8, /* cost of FADD and FSUB insns. */ - 16, /* cost of FMUL instruction. */ - 73, /* cost of FDIV instruction. */ - 3, /* cost of FABS instruction. */ - 3, /* cost of FCHS instruction. */ - 83, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (16), /* cost of FMUL instruction. */ + COSTS_N_INSNS (73), /* cost of FDIV instruction. */ + COSTS_N_INSNS (3), /* cost of FABS instruction. */ + COSTS_N_INSNS (3), /* cost of FCHS instruction. */ + COSTS_N_INSNS (83), /* cost of FSQRT instruction. */ }; static const struct processor_costs pentium_cost = { - 1, /* cost of an add instruction */ - 1, /* cost of a lea instruction */ - 4, /* variable shift costs */ - 1, /* constant shift costs */ - {11, 11, 11, 11, 11}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (4), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (11), /* cost of starting multiply for QI */ + COSTS_N_INSNS (11), /* HI */ + COSTS_N_INSNS (11), /* SI */ + COSTS_N_INSNS (11), /* DI */ + COSTS_N_INSNS (11)}, /* other */ 0, /* cost of multiply per each bit set */ - {25, 25, 25, 25, 25}, /* cost of a divide/mod */ - 3, /* cost of movsx */ - 2, /* cost of movzx */ + {COSTS_N_INSNS (25), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (25), /* HI */ + COSTS_N_INSNS (25), /* SI */ + COSTS_N_INSNS (25), /* DI */ + COSTS_N_INSNS (25)}, /* other */ + COSTS_N_INSNS (3), /* cost of movsx */ + COSTS_N_INSNS (2), /* cost of movzx */ 8, /* "large" insn */ 6, /* MOVE_RATIO */ 6, /* cost for loading QImode using movzbl */ @@ -214,7 +256,8 @@ struct processor_costs pentium_cost = { 2, /* cost of reg,reg fld/fst */ {2, 2, 6}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {4, 4, 6}, /* cost of loading integer registers */ + {4, 4, 6}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 8, /* cost of moving MMX register */ {8, 8}, /* cost of loading MMX registers in SImode and DImode */ @@ -229,25 +272,33 @@ struct processor_costs pentium_cost = { 0, /* size of prefetch block */ 0, /* number of parallel prefetches */ 2, /* Branch cost */ - 3, /* cost of FADD and FSUB insns. */ - 3, /* cost of FMUL instruction. */ - 39, /* cost of FDIV instruction. */ - 1, /* cost of FABS instruction. */ - 1, /* cost of FCHS instruction. */ - 70, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (3), /* cost of FMUL instruction. */ + COSTS_N_INSNS (39), /* cost of FDIV instruction. */ + COSTS_N_INSNS (1), /* cost of FABS instruction. */ + COSTS_N_INSNS (1), /* cost of FCHS instruction. */ + COSTS_N_INSNS (70), /* cost of FSQRT instruction. */ }; static const struct processor_costs pentiumpro_cost = { - 1, /* cost of an add instruction */ - 1, /* cost of a lea instruction */ - 1, /* variable shift costs */ - 1, /* constant shift costs */ - {4, 4, 4, 4, 4}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (4), /* cost of starting multiply for QI */ + COSTS_N_INSNS (4), /* HI */ + COSTS_N_INSNS (4), /* SI */ + COSTS_N_INSNS (4), /* DI */ + COSTS_N_INSNS (4)}, /* other */ 0, /* cost of multiply per each bit set */ - {17, 17, 17, 17, 17}, /* cost of a divide/mod */ - 1, /* cost of movsx */ - 1, /* cost of movzx */ + {COSTS_N_INSNS (17), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (17), /* HI */ + COSTS_N_INSNS (17), /* SI */ + COSTS_N_INSNS (17), /* DI */ + COSTS_N_INSNS (17)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ 8, /* "large" insn */ 6, /* MOVE_RATIO */ 2, /* cost for loading QImode using movzbl */ @@ -258,7 +309,8 @@ struct processor_costs pentiumpro_cost = { 2, /* cost of reg,reg fld/fst */ {2, 2, 6}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {4, 4, 6}, /* cost of loading integer registers */ + {4, 4, 6}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {2, 2}, /* cost of loading MMX registers in SImode and DImode */ @@ -273,25 +325,33 @@ struct processor_costs pentiumpro_cost = { 32, /* size of prefetch block */ 6, /* number of parallel prefetches */ 2, /* Branch cost */ - 3, /* cost of FADD and FSUB insns. */ - 5, /* cost of FMUL instruction. */ - 56, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 56, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (5), /* cost of FMUL instruction. */ + COSTS_N_INSNS (56), /* cost of FDIV instruction. */ + COSTS_N_INSNS (2), /* cost of FABS instruction. */ + COSTS_N_INSNS (2), /* cost of FCHS instruction. */ + COSTS_N_INSNS (56), /* cost of FSQRT instruction. */ }; static const struct processor_costs k6_cost = { - 1, /* cost of an add instruction */ - 2, /* cost of a lea instruction */ - 1, /* variable shift costs */ - 1, /* constant shift costs */ - {3, 3, 3, 3, 3}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (2), /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (3), /* HI */ + COSTS_N_INSNS (3), /* SI */ + COSTS_N_INSNS (3), /* DI */ + COSTS_N_INSNS (3)}, /* other */ 0, /* cost of multiply per each bit set */ - {18, 18, 18, 18, 18}, /* cost of a divide/mod */ - 2, /* cost of movsx */ - 2, /* cost of movzx */ + {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (18), /* HI */ + COSTS_N_INSNS (18), /* SI */ + COSTS_N_INSNS (18), /* DI */ + COSTS_N_INSNS (18)}, /* other */ + COSTS_N_INSNS (2), /* cost of movsx */ + COSTS_N_INSNS (2), /* cost of movzx */ 8, /* "large" insn */ 4, /* MOVE_RATIO */ 3, /* cost for loading QImode using movzbl */ @@ -302,7 +362,8 @@ struct processor_costs k6_cost = { 4, /* cost of reg,reg fld/fst */ {6, 6, 6}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {4, 4, 4}, /* cost of loading integer registers */ + {4, 4, 4}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {2, 2}, /* cost of loading MMX registers in SImode and DImode */ @@ -317,25 +378,33 @@ struct processor_costs k6_cost = { 32, /* size of prefetch block */ 1, /* number of parallel prefetches */ 1, /* Branch cost */ - 2, /* cost of FADD and FSUB insns. */ - 2, /* cost of FMUL instruction. */ - 56, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 56, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (2), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (2), /* cost of FMUL instruction. */ + COSTS_N_INSNS (56), /* cost of FDIV instruction. */ + COSTS_N_INSNS (2), /* cost of FABS instruction. */ + COSTS_N_INSNS (2), /* cost of FCHS instruction. */ + COSTS_N_INSNS (56), /* cost of FSQRT instruction. */ }; static const struct processor_costs athlon_cost = { - 1, /* cost of an add instruction */ - 2, /* cost of a lea instruction */ - 1, /* variable shift costs */ - 1, /* constant shift costs */ - {5, 5, 5, 5, 5}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (2), /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (5), /* cost of starting multiply for QI */ + COSTS_N_INSNS (5), /* HI */ + COSTS_N_INSNS (5), /* SI */ + COSTS_N_INSNS (5), /* DI */ + COSTS_N_INSNS (5)}, /* other */ 0, /* cost of multiply per each bit set */ - {18, 26, 42, 74, 74}, /* cost of a divide/mod */ - 1, /* cost of movsx */ - 1, /* cost of movzx */ + {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (26), /* HI */ + COSTS_N_INSNS (42), /* SI */ + COSTS_N_INSNS (74), /* DI */ + COSTS_N_INSNS (74)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ 8, /* "large" insn */ 9, /* MOVE_RATIO */ 4, /* cost for loading QImode using movzbl */ @@ -346,7 +415,8 @@ struct processor_costs athlon_cost = { 4, /* cost of reg,reg fld/fst */ {4, 4, 12}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {6, 6, 8}, /* cost of loading integer registers */ + {6, 6, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {4, 4}, /* cost of loading MMX registers in SImode and DImode */ @@ -360,26 +430,34 @@ struct processor_costs athlon_cost = { 5, /* MMX or SSE register to integer */ 64, /* size of prefetch block */ 6, /* number of parallel prefetches */ - 2, /* Branch cost */ - 4, /* cost of FADD and FSUB insns. */ - 4, /* cost of FMUL instruction. */ - 24, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 35, /* cost of FSQRT instruction. */ + 5, /* Branch cost */ + COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (4), /* cost of FMUL instruction. */ + COSTS_N_INSNS (24), /* cost of FDIV instruction. */ + COSTS_N_INSNS (2), /* cost of FABS instruction. */ + COSTS_N_INSNS (2), /* cost of FCHS instruction. */ + COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ }; static const struct processor_costs k8_cost = { - 1, /* cost of an add instruction */ - 2, /* cost of a lea instruction */ - 1, /* variable shift costs */ - 1, /* constant shift costs */ - {3, 4, 3, 4, 5}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (2), /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (4), /* HI */ + COSTS_N_INSNS (3), /* SI */ + COSTS_N_INSNS (4), /* DI */ + COSTS_N_INSNS (5)}, /* other */ 0, /* cost of multiply per each bit set */ - {18, 26, 42, 74, 74}, /* cost of a divide/mod */ - 1, /* cost of movsx */ - 1, /* cost of movzx */ + {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (26), /* HI */ + COSTS_N_INSNS (42), /* SI */ + COSTS_N_INSNS (74), /* DI */ + COSTS_N_INSNS (74)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ 8, /* "large" insn */ 9, /* MOVE_RATIO */ 4, /* cost for loading QImode using movzbl */ @@ -390,7 +468,8 @@ struct processor_costs k8_cost = { 4, /* cost of reg,reg fld/fst */ {4, 4, 12}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {6, 6, 8}, /* cost of loading integer registers */ + {6, 6, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {3, 3}, /* cost of loading MMX registers in SImode and DImode */ @@ -404,26 +483,34 @@ struct processor_costs k8_cost = { 5, /* MMX or SSE register to integer */ 64, /* size of prefetch block */ 6, /* number of parallel prefetches */ - 2, /* Branch cost */ - 4, /* cost of FADD and FSUB insns. */ - 4, /* cost of FMUL instruction. */ - 19, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 35, /* cost of FSQRT instruction. */ + 5, /* Branch cost */ + COSTS_N_INSNS (4), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (4), /* cost of FMUL instruction. */ + COSTS_N_INSNS (19), /* cost of FDIV instruction. */ + COSTS_N_INSNS (2), /* cost of FABS instruction. */ + COSTS_N_INSNS (2), /* cost of FCHS instruction. */ + COSTS_N_INSNS (35), /* cost of FSQRT instruction. */ }; static const struct processor_costs pentium4_cost = { - 1, /* cost of an add instruction */ - 1, /* cost of a lea instruction */ - 4, /* variable shift costs */ - 4, /* constant shift costs */ - {15, 15, 15, 15, 15}, /* cost of starting a multiply */ + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (3), /* cost of a lea instruction */ + COSTS_N_INSNS (4), /* variable shift costs */ + COSTS_N_INSNS (4), /* constant shift costs */ + {COSTS_N_INSNS (15), /* cost of starting multiply for QI */ + COSTS_N_INSNS (15), /* HI */ + COSTS_N_INSNS (15), /* SI */ + COSTS_N_INSNS (15), /* DI */ + COSTS_N_INSNS (15)}, /* other */ 0, /* cost of multiply per each bit set */ - {56, 56, 56, 56, 56}, /* cost of a divide/mod */ - 1, /* cost of movsx */ - 1, /* cost of movzx */ + {COSTS_N_INSNS (56), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (56), /* HI */ + COSTS_N_INSNS (56), /* SI */ + COSTS_N_INSNS (56), /* DI */ + COSTS_N_INSNS (56)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ 16, /* "large" insn */ 6, /* MOVE_RATIO */ 2, /* cost for loading QImode using movzbl */ @@ -434,7 +521,8 @@ struct processor_costs pentium4_cost = { 2, /* cost of reg,reg fld/fst */ {2, 2, 6}, /* cost of loading fp registers in SFmode, DFmode and XFmode */ - {4, 4, 6}, /* cost of loading integer registers */ + {4, 4, 6}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ 2, /* cost of moving MMX register */ {2, 2}, /* cost of loading MMX registers in SImode and DImode */ @@ -449,12 +537,179 @@ struct processor_costs pentium4_cost = { 64, /* size of prefetch block */ 6, /* number of parallel prefetches */ 2, /* Branch cost */ - 5, /* cost of FADD and FSUB insns. */ - 7, /* cost of FMUL instruction. */ - 43, /* cost of FDIV instruction. */ - 2, /* cost of FABS instruction. */ - 2, /* cost of FCHS instruction. */ - 43, /* cost of FSQRT instruction. */ + COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (7), /* cost of FMUL instruction. */ + COSTS_N_INSNS (43), /* cost of FDIV instruction. */ + COSTS_N_INSNS (2), /* cost of FABS instruction. */ + COSTS_N_INSNS (2), /* cost of FCHS instruction. */ + COSTS_N_INSNS (43), /* cost of FSQRT instruction. */ +}; + +static const +struct processor_costs nocona_cost = { + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1), /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (10), /* cost of starting multiply for QI */ + COSTS_N_INSNS (10), /* HI */ + COSTS_N_INSNS (10), /* SI */ + COSTS_N_INSNS (10), /* DI */ + COSTS_N_INSNS (10)}, /* other */ + 0, /* cost of multiply per each bit set */ + {COSTS_N_INSNS (66), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (66), /* HI */ + COSTS_N_INSNS (66), /* SI */ + COSTS_N_INSNS (66), /* DI */ + COSTS_N_INSNS (66)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ + 16, /* "large" insn */ + 17, /* MOVE_RATIO */ + 4, /* cost for loading QImode using movzbl */ + {4, 4, 4}, /* cost of loading integer registers + in QImode, HImode and SImode. + Relative to reg-reg move (2). */ + {4, 4, 4}, /* cost of storing integer registers */ + 3, /* cost of reg,reg fld/fst */ + {12, 12, 12}, /* cost of loading fp registers + in SFmode, DFmode and XFmode */ + {4, 4, 4}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ + 6, /* cost of moving MMX register */ + {12, 12}, /* cost of loading MMX registers + in SImode and DImode */ + {12, 12}, /* cost of storing MMX registers + in SImode and DImode */ + 6, /* cost of moving SSE register */ + {12, 12, 12}, /* cost of loading SSE registers + in SImode, DImode and TImode */ + {12, 12, 12}, /* cost of storing SSE registers + in SImode, DImode and TImode */ + 8, /* MMX or SSE register to integer */ + 128, /* size of prefetch block */ + 8, /* number of parallel prefetches */ + 1, /* Branch cost */ + COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (8), /* cost of FMUL instruction. */ + COSTS_N_INSNS (40), /* cost of FDIV instruction. */ + COSTS_N_INSNS (3), /* cost of FABS instruction. */ + COSTS_N_INSNS (3), /* cost of FCHS instruction. */ + COSTS_N_INSNS (44), /* cost of FSQRT instruction. */ +}; + +/* Generic64 should produce code tuned for Nocona and K8. */ +static const +struct processor_costs generic64_cost = { + COSTS_N_INSNS (1), /* cost of an add instruction */ + /* On all chips taken into consideration lea is 2 cycles and more. With + this cost however our current implementation of synth_mult results in + use of unnecessary temporary registers causing regression on several + SPECfp benchmarks. */ + COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (4), /* HI */ + COSTS_N_INSNS (3), /* SI */ + COSTS_N_INSNS (4), /* DI */ + COSTS_N_INSNS (2)}, /* other */ + 0, /* cost of multiply per each bit set */ + {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (26), /* HI */ + COSTS_N_INSNS (42), /* SI */ + COSTS_N_INSNS (74), /* DI */ + COSTS_N_INSNS (74)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ + 8, /* "large" insn */ + 17, /* MOVE_RATIO */ + 4, /* cost for loading QImode using movzbl */ + {4, 4, 4}, /* cost of loading integer registers + in QImode, HImode and SImode. + Relative to reg-reg move (2). */ + {4, 4, 4}, /* cost of storing integer registers */ + 4, /* cost of reg,reg fld/fst */ + {12, 12, 12}, /* cost of loading fp registers + in SFmode, DFmode and XFmode */ + {6, 6, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ + 2, /* cost of moving MMX register */ + {8, 8}, /* cost of loading MMX registers + in SImode and DImode */ + {8, 8}, /* cost of storing MMX registers + in SImode and DImode */ + 2, /* cost of moving SSE register */ + {8, 8, 8}, /* cost of loading SSE registers + in SImode, DImode and TImode */ + {8, 8, 8}, /* cost of storing SSE registers + in SImode, DImode and TImode */ + 5, /* MMX or SSE register to integer */ + 64, /* size of prefetch block */ + 6, /* number of parallel prefetches */ + /* Benchmarks shows large regressions on K8 sixtrack benchmark when this value + is increased to perhaps more appropriate value of 5. */ + 3, /* Branch cost */ + COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (8), /* cost of FMUL instruction. */ + COSTS_N_INSNS (20), /* cost of FDIV instruction. */ + COSTS_N_INSNS (8), /* cost of FABS instruction. */ + COSTS_N_INSNS (8), /* cost of FCHS instruction. */ + COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ +}; + +/* Generic32 should produce code tuned for Athlon, PPro, Pentium4, Nocona and K8. */ +static const +struct processor_costs generic32_cost = { + COSTS_N_INSNS (1), /* cost of an add instruction */ + COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ + COSTS_N_INSNS (1), /* variable shift costs */ + COSTS_N_INSNS (1), /* constant shift costs */ + {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ + COSTS_N_INSNS (4), /* HI */ + COSTS_N_INSNS (3), /* SI */ + COSTS_N_INSNS (4), /* DI */ + COSTS_N_INSNS (2)}, /* other */ + 0, /* cost of multiply per each bit set */ + {COSTS_N_INSNS (18), /* cost of a divide/mod for QI */ + COSTS_N_INSNS (26), /* HI */ + COSTS_N_INSNS (42), /* SI */ + COSTS_N_INSNS (74), /* DI */ + COSTS_N_INSNS (74)}, /* other */ + COSTS_N_INSNS (1), /* cost of movsx */ + COSTS_N_INSNS (1), /* cost of movzx */ + 8, /* "large" insn */ + 17, /* MOVE_RATIO */ + 4, /* cost for loading QImode using movzbl */ + {4, 4, 4}, /* cost of loading integer registers + in QImode, HImode and SImode. + Relative to reg-reg move (2). */ + {4, 4, 4}, /* cost of storing integer registers */ + 4, /* cost of reg,reg fld/fst */ + {12, 12, 12}, /* cost of loading fp registers + in SFmode, DFmode and XFmode */ + {6, 6, 8}, /* cost of storing fp registers + in SFmode, DFmode and XFmode */ + 2, /* cost of moving MMX register */ + {8, 8}, /* cost of loading MMX registers + in SImode and DImode */ + {8, 8}, /* cost of storing MMX registers + in SImode and DImode */ + 2, /* cost of moving SSE register */ + {8, 8, 8}, /* cost of loading SSE registers + in SImode, DImode and TImode */ + {8, 8, 8}, /* cost of storing SSE registers + in SImode, DImode and TImode */ + 5, /* MMX or SSE register to integer */ + 64, /* size of prefetch block */ + 6, /* number of parallel prefetches */ + 3, /* Branch cost */ + COSTS_N_INSNS (8), /* cost of FADD and FSUB insns. */ + COSTS_N_INSNS (8), /* cost of FMUL instruction. */ + COSTS_N_INSNS (20), /* cost of FDIV instruction. */ + COSTS_N_INSNS (8), /* cost of FABS instruction. */ + COSTS_N_INSNS (8), /* cost of FCHS instruction. */ + COSTS_N_INSNS (40), /* cost of FSQRT instruction. */ }; const struct processor_costs *ix86_cost = &pentium_cost; @@ -469,68 +724,112 @@ const struct processor_costs *ix86_cost = &pentium_cost; #define m_PENT4 (1< */ -const char *ix86_arch_string; /* for -march= */ -const char *ix86_fpmath_string; /* for -mfpmath= */ - -/* # of registers to use to pass arguments. */ -const char *ix86_regparm_string; - /* true if sse prefetch instruction is not NOOP. */ int x86_prefetch_sse; /* ix86_regparm_string as a number */ -int ix86_regparm; +static int ix86_regparm; -/* Alignment to use for loops and jumps: */ - -/* Power of two alignment for loops. */ -const char *ix86_align_loops_string; - -/* Power of two alignment for non-loop jumps. */ -const char *ix86_align_jumps_string; - -/* Power of two alignment for stack boundary in bytes. */ -const char *ix86_preferred_stack_boundary_string; +/* -mstackrealign option */ +extern int ix86_force_align_arg_pointer; +static const char ix86_force_align_arg_pointer_string[] = "force_align_arg_pointer"; /* Preferred alignment for stack boundary in bits. */ -int ix86_preferred_stack_boundary; +unsigned int ix86_preferred_stack_boundary; /* Values 1-5: see jump.c */ int ix86_branch_cost; -const char *ix86_branch_cost_string; -/* Power of two alignment for functions. */ -const char *ix86_align_funcs_string; +/* Variables which are this size or smaller are put in the data/bss + or ldata/lbss sections. */ + +int ix86_section_threshold = 65536; /* Prefix built by ASM_GENERATE_INTERNAL_LABEL. */ -static char internal_label_prefix[16]; -static int internal_label_prefix_len; +char internal_label_prefix[16]; +int internal_label_prefix_len; -static int local_symbolic_operand (rtx, enum machine_mode); -static int tls_symbolic_operand_1 (rtx, enum tls_model); +static bool ix86_handle_option (size_t, const char *, int); static void output_pic_addr_const (FILE *, rtx, int); static void put_condition_code (enum rtx_code, enum machine_mode, int, int, FILE *); static const char *get_some_local_dynamic_name (void); static int get_some_local_dynamic_name_1 (rtx *, void *); -static rtx maybe_get_pool_constant (rtx); static rtx ix86_expand_int_compare (enum rtx_code, rtx, rtx); static enum rtx_code ix86_prepare_fp_compare_args (enum rtx_code, rtx *, rtx *); @@ -807,12 +1084,8 @@ static rtx get_thread_pointer (int); static rtx legitimize_tls_address (rtx, enum tls_model, int); static void get_pc_thunk_name (char [32], unsigned int); static rtx gen_push (rtx); -static int memory_address_length (rtx addr); -static int ix86_flags_dependant (rtx, rtx, enum attr_type); -static int ix86_agi_dependant (rtx, rtx, enum attr_type); -static enum attr_ppro_uops ix86_safe_ppro_uops (rtx); -static void ix86_dump_ppro_packet (FILE *); -static void ix86_reorder_insn (rtx *, rtx *); +static int ix86_flags_dependent (rtx, rtx, enum attr_type); +static int ix86_agi_dependent (rtx, rtx, enum attr_type); static struct machine_function * ix86_init_machine_status (void); static int ix86_split_to_parts (rtx, rtx *, enum machine_mode); static int ix86_nsaved_regs (void); @@ -820,17 +1093,12 @@ static void ix86_emit_save_regs (void); static void ix86_emit_save_regs_using_mov (rtx, HOST_WIDE_INT); static void ix86_emit_restore_regs_using_mov (rtx, HOST_WIDE_INT, int); static void ix86_output_function_epilogue (FILE *, HOST_WIDE_INT); -static void ix86_sched_reorder_ppro (rtx *, rtx *); static HOST_WIDE_INT ix86_GOT_alias_set (void); static void ix86_adjust_counter (rtx, HOST_WIDE_INT); static rtx ix86_expand_aligntest (rtx, int); static void ix86_expand_strlensi_unroll_1 (rtx, rtx, rtx); static int ix86_issue_rate (void); static int ix86_adjust_cost (rtx, rtx, rtx, int); -static void ix86_sched_init (FILE *, int, int); -static int ix86_sched_reorder (FILE *, int, rtx *, int *, int); -static int ix86_variable_issue (FILE *, int, rtx, int); -static int ia32_use_dfa_pipeline_interface (void); static int ia32_multipass_dfa_lookahead (void); static void ix86_init_mmx_sse_builtins (void); static rtx x86_this_parameter (tree); @@ -841,19 +1109,18 @@ static void x86_file_start (void); static void ix86_reorg (void); static bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*); static tree ix86_build_builtin_va_list (void); +static void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree, int *, int); +static tree ix86_gimplify_va_arg (tree, tree, tree *, tree *); +static bool ix86_scalar_mode_supported_p (enum machine_mode); +static bool ix86_vector_mode_supported_p (enum machine_mode); -struct ix86_address -{ - rtx base, index, disp; - HOST_WIDE_INT scale; - enum ix86_address_seg { SEG_DEFAULT, SEG_FS, SEG_GS } seg; -}; - -static int ix86_decompose_address (rtx, struct ix86_address *); static int ix86_address_cost (rtx); static bool ix86_cannot_force_const_mem (rtx); static rtx ix86_delegitimize_address (rtx); +static void i386_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; + struct builtin_description; static rtx ix86_expand_sse_comi (const struct builtin_description *, tree, rtx); @@ -864,9 +1131,6 @@ static rtx ix86_expand_unop_builtin (enum insn_code, tree, rtx, int); static rtx ix86_expand_binop_builtin (enum insn_code, tree, rtx); static rtx ix86_expand_store_builtin (enum insn_code, tree); static rtx safe_vector_operand (rtx, enum machine_mode); -static enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code); -static void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *, - enum rtx_code *, enum rtx_code *); static rtx ix86_expand_fp_compare (enum rtx_code, rtx, rtx, rtx, rtx *, rtx *); static int ix86_fp_comparison_arithmetics_cost (enum rtx_code code); static int ix86_fp_comparison_fcomi_cost (enum rtx_code code); @@ -879,20 +1143,29 @@ static int ix86_comp_type_attributes (tree, tree); static int ix86_function_regparm (tree, tree); const struct attribute_spec ix86_attribute_table[]; static bool ix86_function_ok_for_sibcall (tree, tree); -static tree ix86_handle_cdecl_attribute (tree *, tree, tree, int, bool *); -static tree ix86_handle_regparm_attribute (tree *, tree, tree, int, bool *); -static int ix86_value_regno (enum machine_mode); +static tree ix86_handle_cconv_attribute (tree *, tree, tree, int, bool *); +static int ix86_value_regno (enum machine_mode, tree, tree); static bool contains_128bit_aligned_vector_p (tree); +static rtx ix86_struct_value_rtx (tree, int); static bool ix86_ms_bitfield_layout_p (tree); static tree ix86_handle_struct_attribute (tree *, tree, tree, int, bool *); static int extended_reg_mentioned_1 (rtx *, void *); static bool ix86_rtx_costs (rtx, int, int, int *); static int min_insn_size (rtx); -static void k8_avoid_jump_misspredicts (void); +static tree ix86_md_asm_clobbers (tree outputs, tree inputs, tree clobbers); +static bool ix86_must_pass_in_stack (enum machine_mode mode, tree type); +static bool ix86_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); +static void ix86_init_builtins (void); +static rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static const char *ix86_mangle_fundamental_type (tree); +static tree ix86_stack_protect_fail (void); +static rtx ix86_internal_arg_pointer (void); +static void ix86_dwarf_handle_frame_unspec (const char *, rtx, int); -#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION) -static void ix86_svr3_asm_out_constructor (rtx, int); -#endif +/* This function is only used on Solaris. */ +static void i386_solaris_elf_named_section (const char *, unsigned int, tree) + ATTRIBUTE_UNUSED; /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception @@ -913,29 +1186,31 @@ enum x86_64_reg_class X86_64_SSEUP_CLASS, X86_64_X87_CLASS, X86_64_X87UP_CLASS, + X86_64_COMPLEX_X87_CLASS, X86_64_MEMORY_CLASS }; -static const char * const x86_64_reg_class_name[] = - {"no", "integer", "integerSI", "sse", "sseSF", "sseDF", "sseup", "x87", "x87up", "no"}; +static const char * const x86_64_reg_class_name[] = { + "no", "integer", "integerSI", "sse", "sseSF", "sseDF", + "sseup", "x87", "x87up", "cplx87", "no" +}; #define MAX_CLASSES 4 -static int classify_argument (enum machine_mode, tree, - enum x86_64_reg_class [MAX_CLASSES], int); -static int examine_argument (enum machine_mode, tree, int, int *, int *); -static rtx construct_container (enum machine_mode, tree, int, int, int, - const int *, int); -static enum x86_64_reg_class merge_classes (enum x86_64_reg_class, - enum x86_64_reg_class); /* Table of constants used by fldpi, fldln2, etc.... */ static REAL_VALUE_TYPE ext_80387_constants_table [5]; static bool ext_80387_constants_init = 0; static void init_ext_80387_constants (void); +static bool ix86_in_large_data_p (tree) ATTRIBUTE_UNUSED; +static void ix86_encode_section_info (tree, rtx, int) ATTRIBUTE_UNUSED; +static void x86_64_elf_unique_section (tree decl, int reloc) ATTRIBUTE_UNUSED; +static section *x86_64_elf_select_section (tree decl, int reloc, + unsigned HOST_WIDE_INT align) + ATTRIBUTE_UNUSED; /* Initialize the GCC target structure. */ #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE ix86_attribute_table -#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES # undef TARGET_MERGE_DECL_ATTRIBUTES # define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes #endif @@ -945,13 +1220,19 @@ static void init_ext_80387_constants (void); #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS ix86_init_builtins - #undef TARGET_EXPAND_BUILTIN #define TARGET_EXPAND_BUILTIN ix86_expand_builtin #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE ix86_output_function_epilogue +#undef TARGET_ENCODE_SECTION_INFO +#ifndef SUBTARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO ix86_encode_section_info +#else +#define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO +#endif + #undef TARGET_ASM_OPEN_PAREN #define TARGET_ASM_OPEN_PAREN "" #undef TARGET_ASM_CLOSE_PAREN @@ -977,15 +1258,6 @@ static void init_ext_80387_constants (void); #define TARGET_SCHED_ADJUST_COST ix86_adjust_cost #undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE ix86_issue_rate -#undef TARGET_SCHED_VARIABLE_ISSUE -#define TARGET_SCHED_VARIABLE_ISSUE ix86_variable_issue -#undef TARGET_SCHED_INIT -#define TARGET_SCHED_INIT ix86_sched_init -#undef TARGET_SCHED_REORDER -#define TARGET_SCHED_REORDER ix86_sched_reorder -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \ - ia32_use_dfa_pipeline_interface #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \ ia32_multipass_dfa_lookahead @@ -999,6 +1271,8 @@ static void init_ext_80387_constants (void); #endif #undef TARGET_CANNOT_FORCE_CONST_MEM #define TARGET_CANNOT_FORCE_CONST_MEM ix86_cannot_force_const_mem +#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P +#define TARGET_USE_BLOCKS_FOR_CONSTANT_P hook_bool_mode_rtx_true #undef TARGET_DELEGITIMIZE_ADDRESS #define TARGET_DELEGITIMIZE_ADDRESS ix86_delegitimize_address @@ -1006,6 +1280,11 @@ static void init_ext_80387_constants (void); #undef TARGET_MS_BITFIELD_LAYOUT_P #define TARGET_MS_BITFIELD_LAYOUT_P ix86_ms_bitfield_layout_p +#if TARGET_MACHO +#undef TARGET_BINDS_LOCAL_P +#define TARGET_BINDS_LOCAL_P darwin_binds_local_p +#endif + #undef TARGET_ASM_OUTPUT_MI_THUNK #define TARGET_ASM_OUTPUT_MI_THUNK x86_output_mi_thunk #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK @@ -1014,6 +1293,16 @@ static void init_ext_80387_constants (void); #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START x86_file_start +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (TARGET_DEFAULT \ + | TARGET_64BIT_DEFAULT \ + | TARGET_SUBTARGET_DEFAULT \ + | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT) + +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION ix86_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS ix86_rtx_costs #undef TARGET_ADDRESS_COST @@ -1030,7 +1319,54 @@ static void init_ext_80387_constants (void); #undef TARGET_BUILD_BUILTIN_VA_LIST #define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list +#undef TARGET_MD_ASM_CLOBBERS +#define TARGET_MD_ASM_CLOBBERS ix86_md_asm_clobbers + +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true +#undef TARGET_STRUCT_VALUE_RTX +#define TARGET_STRUCT_VALUE_RTX ix86_struct_value_rtx +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS ix86_setup_incoming_varargs +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK ix86_must_pass_in_stack +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE ix86_pass_by_reference +#undef TARGET_INTERNAL_ARG_POINTER +#define TARGET_INTERNAL_ARG_POINTER ix86_internal_arg_pointer +#undef TARGET_DWARF_HANDLE_FRAME_UNSPEC +#define TARGET_DWARF_HANDLE_FRAME_UNSPEC ix86_dwarf_handle_frame_unspec + +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg + +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P ix86_scalar_mode_supported_p + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P ix86_vector_mode_supported_p + +#ifdef HAVE_AS_TLS +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL +#define TARGET_ASM_OUTPUT_DWARF_DTPREL i386_output_dwarf_dtprel +#endif + +#ifdef SUBTARGET_INSERT_ATTRIBUTES +#undef TARGET_INSERT_ATTRIBUTES +#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES +#endif + +#undef TARGET_MANGLE_FUNDAMENTAL_TYPE +#define TARGET_MANGLE_FUNDAMENTAL_TYPE ix86_mangle_fundamental_type + +#undef TARGET_STACK_PROTECT_FAIL +#define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail + +#undef TARGET_FUNCTION_VALUE +#define TARGET_FUNCTION_VALUE ix86_function_value + struct gcc_target targetm = TARGET_INITIALIZER; + /* The svr4 ABI for the i386 says that records and unions are returned in memory. */ @@ -1038,6 +1374,50 @@ struct gcc_target targetm = TARGET_INITIALIZER; #define DEFAULT_PCC_STRUCT_RETURN 1 #endif +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value) +{ + switch (code) + { + case OPT_m3dnow: + if (!value) + { + target_flags &= ~MASK_3DNOW_A; + target_flags_explicit |= MASK_3DNOW_A; + } + return true; + + case OPT_mmmx: + if (!value) + { + target_flags &= ~(MASK_3DNOW | MASK_3DNOW_A); + target_flags_explicit |= MASK_3DNOW | MASK_3DNOW_A; + } + return true; + + case OPT_msse: + if (!value) + { + target_flags &= ~(MASK_SSE2 | MASK_SSE3); + target_flags_explicit |= MASK_SSE2 | MASK_SSE3; + } + return true; + + case OPT_msse2: + if (!value) + { + target_flags &= ~MASK_SSE3; + target_flags_explicit |= MASK_SSE3; + } + return true; + + default: + return true; + } +} + /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -1051,6 +1431,8 @@ void override_options (void) { int i; + int ix86_tune_defaulted = 0; + /* Comes from final.c -- no real reason to change it. */ #define MAX_CODE_ALIGN 16 @@ -1074,7 +1456,10 @@ override_options (void) {&k6_cost, 0, 0, 32, 7, 32, 7, 32}, {&athlon_cost, 0, 0, 16, 7, 16, 7, 16}, {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0}, - {&k8_cost, 0, 0, 16, 7, 16, 7, 16} + {&k8_cost, 0, 0, 16, 7, 16, 7, 16}, + {&nocona_cost, 0, 0, 0, 0, 0, 0, 0}, + {&generic32_cost, 0, 0, 16, 7, 16, 7, 16}, + {&generic64_cost, 0, 0, 16, 7, 16, 7, 16} }; static const char * const cpu_names[] = TARGET_CPU_DEFAULT_NAMES; @@ -1115,10 +1500,10 @@ override_options (void) | PTA_MMX | PTA_PREFETCH_SSE}, {"pentium4m", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_MMX | PTA_PREFETCH_SSE}, - {"prescott", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_SSE3 + {"prescott", PROCESSOR_NOCONA, PTA_SSE | PTA_SSE2 | PTA_SSE3 + | PTA_MMX | PTA_PREFETCH_SSE}, + {"nocona", PROCESSOR_NOCONA, PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_64BIT | PTA_MMX | PTA_PREFETCH_SSE}, - {"nocona", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_64BIT - | PTA_MMX | PTA_PREFETCH_SSE}, {"k6", PROCESSOR_K6, PTA_MMX}, {"k6-2", PROCESSOR_K6, PTA_MMX | PTA_3DNOW}, {"k6-3", PROCESSOR_K6, PTA_MMX | PTA_3DNOW}, @@ -1142,16 +1527,31 @@ override_options (void) | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, {"athlon-fx", PROCESSOR_K8, PTA_MMX | PTA_PREFETCH_SSE | PTA_3DNOW | PTA_64BIT | PTA_3DNOW_A | PTA_SSE | PTA_SSE2}, + {"generic32", PROCESSOR_GENERIC32, 0 /* flags are only used for -march switch. */ }, + {"generic64", PROCESSOR_GENERIC64, PTA_64BIT /* flags are only used for -march switch. */ }, }; int const pta_size = ARRAY_SIZE (processor_alias_table); +#ifdef SUBTARGET_OVERRIDE_OPTIONS + SUBTARGET_OVERRIDE_OPTIONS; +#endif + +#ifdef SUBSUBTARGET_OVERRIDE_OPTIONS + SUBSUBTARGET_OVERRIDE_OPTIONS; +#endif + + /* -fPIC is the default for x86_64. */ + if (TARGET_MACHO && TARGET_64BIT) + flag_pic = 2; + /* Set the default values for switches whose default depends on TARGET_64BIT in case they weren't overwritten by command line options. */ if (TARGET_64BIT) { + /* Mach-O doesn't support omitting the frame pointer for now. */ if (flag_omit_frame_pointer == 2) - flag_omit_frame_pointer = 1; + flag_omit_frame_pointer = (TARGET_MACHO ? 0 : 1); if (flag_asynchronous_unwind_tables == 2) flag_asynchronous_unwind_tables = 1; if (flag_pcc_struct_return == 2) @@ -1167,29 +1567,69 @@ override_options (void) flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN; } -#ifdef SUBTARGET_OVERRIDE_OPTIONS - SUBTARGET_OVERRIDE_OPTIONS; -#endif + /* Need to check -mtune=generic first. */ + if (ix86_tune_string) + { + if (!strcmp (ix86_tune_string, "generic") + || !strcmp (ix86_tune_string, "i686") + /* As special support for cross compilers we read -mtune=native + as -mtune=generic. With native compilers we won't see the + -mtune=native, as it was changed by the driver. */ + || !strcmp (ix86_tune_string, "native")) + { + if (TARGET_64BIT) + ix86_tune_string = "generic64"; + else + ix86_tune_string = "generic32"; + } + else if (!strncmp (ix86_tune_string, "generic", 7)) + error ("bad value (%s) for -mtune= switch", ix86_tune_string); + } + else + { + if (ix86_arch_string) + ix86_tune_string = ix86_arch_string; + if (!ix86_tune_string) + { + ix86_tune_string = cpu_names [TARGET_CPU_DEFAULT]; + ix86_tune_defaulted = 1; + } + + /* ix86_tune_string is set to ix86_arch_string or defaulted. We + need to use a sensible tune option. */ + if (!strcmp (ix86_tune_string, "generic") + || !strcmp (ix86_tune_string, "x86-64") + || !strcmp (ix86_tune_string, "i686")) + { + if (TARGET_64BIT) + ix86_tune_string = "generic64"; + else + ix86_tune_string = "generic32"; + } + } + if (!strcmp (ix86_tune_string, "x86-64")) + warning (OPT_Wdeprecated, "-mtune=x86-64 is deprecated. Use -mtune=k8 or " + "-mtune=generic instead as appropriate."); - if (!ix86_tune_string && ix86_arch_string) - ix86_tune_string = ix86_arch_string; - if (!ix86_tune_string) - ix86_tune_string = cpu_names [TARGET_CPU_DEFAULT]; if (!ix86_arch_string) ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386"; + if (!strcmp (ix86_arch_string, "generic")) + error ("generic CPU can be used only for -mtune= switch"); + if (!strncmp (ix86_arch_string, "generic", 7)) + error ("bad value (%s) for -march= switch", ix86_arch_string); if (ix86_cmodel_string != 0) { if (!strcmp (ix86_cmodel_string, "small")) ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL; + else if (!strcmp (ix86_cmodel_string, "medium")) + ix86_cmodel = flag_pic ? CM_MEDIUM_PIC : CM_MEDIUM; else if (flag_pic) sorry ("code model %s not supported in PIC mode", ix86_cmodel_string); else if (!strcmp (ix86_cmodel_string, "32")) ix86_cmodel = CM_32; else if (!strcmp (ix86_cmodel_string, "kernel") && !flag_pic) ix86_cmodel = CM_KERNEL; - else if (!strcmp (ix86_cmodel_string, "medium") && !flag_pic) - ix86_cmodel = CM_MEDIUM; else if (!strcmp (ix86_cmodel_string, "large") && !flag_pic) ix86_cmodel = CM_LARGE; else @@ -1203,7 +1643,8 @@ override_options (void) } if (ix86_asm_string != 0) { - if (!strcmp (ix86_asm_string, "intel")) + if (! TARGET_MACHO + && !strcmp (ix86_asm_string, "intel")) ix86_asm_dialect = ASM_INTEL; else if (!strcmp (ix86_asm_string, "att")) ix86_asm_dialect = ASM_ATT; @@ -1211,10 +1652,10 @@ override_options (void) error ("bad value (%s) for -masm= switch", ix86_asm_string); } if ((TARGET_64BIT == 0) != (ix86_cmodel == CM_32)) - error ("code model `%s' not supported in the %s bit mode", + error ("code model %qs not supported in the %s bit mode", ix86_cmodel_string, TARGET_64BIT ? "64" : "32"); if (ix86_cmodel == CM_LARGE) - sorry ("code model `large' not supported yet"); + sorry ("code model % not supported yet"); if ((TARGET_64BIT != 0) != ((target_flags & MASK_64BIT) != 0)) sorry ("%i-bit mode not compiled in", (target_flags & MASK_64BIT) ? 64 : 32); @@ -1246,7 +1687,8 @@ override_options (void) if (processor_alias_table[i].flags & PTA_PREFETCH_SSE) x86_prefetch_sse = true; if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT)) - error ("CPU you selected does not support x86-64 instruction set"); + error ("CPU you selected does not support x86-64 " + "instruction set"); break; } @@ -1258,9 +1700,21 @@ override_options (void) { ix86_tune = processor_alias_table[i].processor; if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT)) - error ("CPU you selected does not support x86-64 instruction set"); - - /* Intel CPUs have always interpreted SSE prefetch instructions as + { + if (ix86_tune_defaulted) + { + ix86_tune_string = "x86-64"; + for (i = 0; i < pta_size; i++) + if (! strcmp (ix86_tune_string, + processor_alias_table[i].name)) + break; + ix86_tune = processor_alias_table[i].processor; + } + else + error ("CPU you selected does not support x86-64 " + "instruction set"); + } + /* Intel CPUs have always interpreted SSE prefetch instructions as NOPs; so, we can enable SSE prefetch instructions even when -mtune (rather than -march) points us to a processor that has them. However, the VIA C3 gives a SIGILL, so we only do that for i686 and @@ -1300,7 +1754,7 @@ override_options (void) Remove this code in GCC 3.2 or later. */ if (ix86_align_loops_string) { - warning ("-malign-loops is obsolete, use -falign-loops"); + warning (0, "-malign-loops is obsolete, use -falign-loops"); if (align_loops == 0) { i = atoi (ix86_align_loops_string); @@ -1313,7 +1767,7 @@ override_options (void) if (ix86_align_jumps_string) { - warning ("-malign-jumps is obsolete, use -falign-jumps"); + warning (0, "-malign-jumps is obsolete, use -falign-jumps"); if (align_jumps == 0) { i = atoi (ix86_align_jumps_string); @@ -1326,7 +1780,7 @@ override_options (void) if (ix86_align_funcs_string) { - warning ("-malign-functions is obsolete, use -falign-functions"); + warning (0, "-malign-functions is obsolete, use -falign-functions"); if (align_functions == 0) { i = atoi (ix86_align_funcs_string); @@ -1353,13 +1807,105 @@ override_options (void) align_functions = processor_target_table[ix86_tune].align_func; } + /* Validate -mbranch-cost= value, or provide default. */ + ix86_branch_cost = ix86_cost->branch_cost; + if (ix86_branch_cost_string) + { + i = atoi (ix86_branch_cost_string); + if (i < 0 || i > 5) + error ("-mbranch-cost=%d is not between 0 and 5", i); + else + ix86_branch_cost = i; + } + if (ix86_section_threshold_string) + { + i = atoi (ix86_section_threshold_string); + if (i < 0) + error ("-mlarge-data-threshold=%d is negative", i); + else + ix86_section_threshold = i; + } + + if (ix86_tls_dialect_string) + { + if (strcmp (ix86_tls_dialect_string, "gnu") == 0) + ix86_tls_dialect = TLS_DIALECT_GNU; + else if (strcmp (ix86_tls_dialect_string, "gnu2") == 0) + ix86_tls_dialect = TLS_DIALECT_GNU2; + else if (strcmp (ix86_tls_dialect_string, "sun") == 0) + ix86_tls_dialect = TLS_DIALECT_SUN; + else + error ("bad value (%s) for -mtls-dialect= switch", + ix86_tls_dialect_string); + } + + /* Keep nonleaf frame pointers. */ + if (flag_omit_frame_pointer) + target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER; + else if (TARGET_OMIT_LEAF_FRAME_POINTER) + flag_omit_frame_pointer = 1; + + /* If we're doing fast math, we don't care about comparison order + wrt NaNs. This lets us use a shorter comparison sequence. */ + if (flag_finite_math_only) + target_flags &= ~MASK_IEEE_FP; + + /* If the architecture always has an FPU, turn off NO_FANCY_MATH_387, + since the insns won't need emulation. */ + if (x86_arch_always_fancy_math_387 & (1 << ix86_arch)) + target_flags &= ~MASK_NO_FANCY_MATH_387; + + /* Likewise, if the target doesn't have a 387, or we've specified + software floating point, don't use 387 inline intrinsics. */ + if (!TARGET_80387) + target_flags |= MASK_NO_FANCY_MATH_387; + + /* Turn on SSE2 builtins for -msse3. */ + if (TARGET_SSE3) + target_flags |= MASK_SSE2; + + /* Turn on SSE builtins for -msse2. */ + if (TARGET_SSE2) + target_flags |= MASK_SSE; + + /* Turn on MMX builtins for -msse. */ + if (TARGET_SSE) + { + target_flags |= MASK_MMX & ~target_flags_explicit; + x86_prefetch_sse = true; + } + + /* Turn on MMX builtins for 3Dnow. */ + if (TARGET_3DNOW) + target_flags |= MASK_MMX; + + if (TARGET_64BIT) + { + if (TARGET_ALIGN_DOUBLE) + error ("-malign-double makes no sense in the 64bit mode"); + if (TARGET_RTD) + error ("-mrtd calling convention not supported in the 64bit mode"); + + /* Enable by default the SSE and MMX builtins. Do allow the user to + explicitly disable any of these. In particular, disabling SSE and + MMX for kernel code is extremely useful. */ + target_flags + |= ((MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE) + & ~target_flags_explicit); + } + else + { + /* i386 ABI does not specify red zone. It still makes sense to use it + when programmer takes care to stack from being destroyed. */ + if (!(target_flags_explicit & MASK_NO_RED_ZONE)) + target_flags |= MASK_NO_RED_ZONE; + } + /* Validate -mpreferred-stack-boundary= value, or provide default. - The default of 128 bits is for Pentium III's SSE __m128, but we - don't want additional code to keep the stack aligned when - optimizing for code size. */ - ix86_preferred_stack_boundary = (optimize_size - ? TARGET_64BIT ? 128 : 32 - : 128); + The default of 128 bits is for Pentium III's SSE __m128. We can't + change it because of optimize_size. Otherwise, we can't mix object + files compiled with -Os and -On. */ + ix86_preferred_stack_boundary = 128; if (ix86_preferred_stack_boundary_string) { i = atoi (ix86_preferred_stack_boundary_string); @@ -1370,68 +1916,12 @@ override_options (void) ix86_preferred_stack_boundary = (1 << i) * BITS_PER_UNIT; } - /* Validate -mbranch-cost= value, or provide default. */ - ix86_branch_cost = processor_target_table[ix86_tune].cost->branch_cost; - if (ix86_branch_cost_string) - { - i = atoi (ix86_branch_cost_string); - if (i < 0 || i > 5) - error ("-mbranch-cost=%d is not between 0 and 5", i); - else - ix86_branch_cost = i; - } + /* Accept -msseregparm only if at least SSE support is enabled. */ + if (TARGET_SSEREGPARM + && ! TARGET_SSE) + error ("-msseregparm used without SSE enabled"); - if (ix86_tls_dialect_string) - { - if (strcmp (ix86_tls_dialect_string, "gnu") == 0) - ix86_tls_dialect = TLS_DIALECT_GNU; - else if (strcmp (ix86_tls_dialect_string, "sun") == 0) - ix86_tls_dialect = TLS_DIALECT_SUN; - else - error ("bad value (%s) for -mtls-dialect= switch", - ix86_tls_dialect_string); - } - - /* Keep nonleaf frame pointers. */ - if (TARGET_OMIT_LEAF_FRAME_POINTER) - flag_omit_frame_pointer = 1; - - /* If we're doing fast math, we don't care about comparison order - wrt NaNs. This lets us use a shorter comparison sequence. */ - if (flag_unsafe_math_optimizations) - target_flags &= ~MASK_IEEE_FP; - - /* If the architecture always has an FPU, turn off NO_FANCY_MATH_387, - since the insns won't need emulation. */ - if (x86_arch_always_fancy_math_387 & (1 << ix86_arch)) - target_flags &= ~MASK_NO_FANCY_MATH_387; - - /* Turn on SSE2 builtins for -msse3. */ - if (TARGET_SSE3) - target_flags |= MASK_SSE2; - - /* Turn on SSE builtins for -msse2. */ - if (TARGET_SSE2) - target_flags |= MASK_SSE; - - if (TARGET_64BIT) - { - if (TARGET_ALIGN_DOUBLE) - error ("-malign-double makes no sense in the 64bit mode"); - if (TARGET_RTD) - error ("-mrtd calling convention not supported in the 64bit mode"); - /* Enable by default the SSE and MMX builtins. */ - target_flags |= (MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE); - ix86_fpmath = FPMATH_SSE; - } - else - { - ix86_fpmath = FPMATH_387; - /* i386 ABI does not specify red zone. It still makes sense to use it - when programmer takes care to stack from being destroyed. */ - if (!(target_flags_explicit & MASK_NO_RED_ZONE)) - target_flags |= MASK_NO_RED_ZONE; - } + ix86_fpmath = TARGET_FPMATH_DEFAULT; if (ix86_fpmath_string != 0) { @@ -1441,7 +1931,7 @@ override_options (void) { if (!TARGET_SSE) { - warning ("SSE instruction set disabled, using 387 arithmetics"); + warning (0, "SSE instruction set disabled, using 387 arithmetics"); ix86_fpmath = FPMATH_387; } else @@ -1452,12 +1942,12 @@ override_options (void) { if (!TARGET_SSE) { - warning ("SSE instruction set disabled, using 387 arithmetics"); + warning (0, "SSE instruction set disabled, using 387 arithmetics"); ix86_fpmath = FPMATH_387; } else if (!TARGET_80387) { - warning ("387 instruction set disabled, using SSE arithmetics"); + warning (0, "387 instruction set disabled, using SSE arithmetics"); ix86_fpmath = FPMATH_SSE; } else @@ -1467,28 +1957,30 @@ override_options (void) error ("bad value (%s) for -mfpmath= switch", ix86_fpmath_string); } - /* It makes no sense to ask for just SSE builtins, so MMX is also turned - on by -msse. */ - if (TARGET_SSE) - { - target_flags |= MASK_MMX; - x86_prefetch_sse = true; - } + /* If the i387 is disabled, then do not return values in it. */ + if (!TARGET_80387) + target_flags &= ~MASK_FLOAT_RETURNS; - /* If it has 3DNow! it also has MMX so MMX is also turned on by -m3dnow */ - if (TARGET_3DNOW) - { - target_flags |= MASK_MMX; - /* If we are targeting the Athlon architecture, enable the 3Dnow/MMX - extensions it adds. */ - if (x86_3dnow_a & (1 << ix86_arch)) - target_flags |= MASK_3DNOW_A; - } if ((x86_accumulate_outgoing_args & TUNEMASK) && !(target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) && !optimize_size) target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; + /* ??? Unwind info is not correct around the CFG unless either a frame + pointer is present or M_A_O_A is set. Fixing this requires rewriting + unwind info generation to be aware of the CFG and propagating states + around edges. */ + if ((flag_unwind_tables || flag_asynchronous_unwind_tables + || flag_exceptions || flag_non_call_exceptions) + && flag_omit_frame_pointer + && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)) + { + if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) + warning (0, "unwind tables currently require either a frame pointer " + "or -maccumulate-outgoing-args for correctness"); + target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; + } + /* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */ { char *p; @@ -1497,8 +1989,191 @@ override_options (void) internal_label_prefix_len = p - internal_label_prefix; *p = '\0'; } + + /* When scheduling description is not available, disable scheduler pass + so it won't slow down the compilation and make x87 code slower. */ + if (!TARGET_SCHEDULE) + flag_schedule_insns_after_reload = flag_schedule_insns = 0; } +/* switch to the appropriate section for output of DECL. + DECL is either a `VAR_DECL' node or a constant of some sort. + RELOC indicates whether forming the initial value of DECL requires + link-time relocations. */ + +static section * +x86_64_elf_select_section (tree decl, int reloc, + unsigned HOST_WIDE_INT align) +{ + if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC) + && ix86_in_large_data_p (decl)) + { + const char *sname = NULL; + unsigned int flags = SECTION_WRITE; + switch (categorize_decl_for_section (decl, reloc)) + { + case SECCAT_DATA: + sname = ".ldata"; + break; + case SECCAT_DATA_REL: + sname = ".ldata.rel"; + break; + case SECCAT_DATA_REL_LOCAL: + sname = ".ldata.rel.local"; + break; + case SECCAT_DATA_REL_RO: + sname = ".ldata.rel.ro"; + break; + case SECCAT_DATA_REL_RO_LOCAL: + sname = ".ldata.rel.ro.local"; + break; + case SECCAT_BSS: + sname = ".lbss"; + flags |= SECTION_BSS; + break; + case SECCAT_RODATA: + case SECCAT_RODATA_MERGE_STR: + case SECCAT_RODATA_MERGE_STR_INIT: + case SECCAT_RODATA_MERGE_CONST: + sname = ".lrodata"; + flags = 0; + break; + case SECCAT_SRODATA: + case SECCAT_SDATA: + case SECCAT_SBSS: + gcc_unreachable (); + case SECCAT_TEXT: + case SECCAT_TDATA: + case SECCAT_TBSS: + /* We don't split these for medium model. Place them into + default sections and hope for best. */ + break; + } + if (sname) + { + /* We might get called with string constants, but get_named_section + doesn't like them as they are not DECLs. Also, we need to set + flags in that case. */ + if (!DECL_P (decl)) + return get_section (sname, flags, NULL); + return get_named_section (decl, sname, reloc); + } + } + return default_elf_select_section (decl, reloc, align); +} + +/* Build up a unique section name, expressed as a + STRING_CST node, and assign it to DECL_SECTION_NAME (decl). + RELOC indicates whether the initial value of EXP requires + link-time relocations. */ + +static void +x86_64_elf_unique_section (tree decl, int reloc) +{ + if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC) + && ix86_in_large_data_p (decl)) + { + const char *prefix = NULL; + /* We only need to use .gnu.linkonce if we don't have COMDAT groups. */ + bool one_only = DECL_ONE_ONLY (decl) && !HAVE_COMDAT_GROUP; + + switch (categorize_decl_for_section (decl, reloc)) + { + case SECCAT_DATA: + case SECCAT_DATA_REL: + case SECCAT_DATA_REL_LOCAL: + case SECCAT_DATA_REL_RO: + case SECCAT_DATA_REL_RO_LOCAL: + prefix = one_only ? ".gnu.linkonce.ld." : ".ldata."; + break; + case SECCAT_BSS: + prefix = one_only ? ".gnu.linkonce.lb." : ".lbss."; + break; + case SECCAT_RODATA: + case SECCAT_RODATA_MERGE_STR: + case SECCAT_RODATA_MERGE_STR_INIT: + case SECCAT_RODATA_MERGE_CONST: + prefix = one_only ? ".gnu.linkonce.lr." : ".lrodata."; + break; + case SECCAT_SRODATA: + case SECCAT_SDATA: + case SECCAT_SBSS: + gcc_unreachable (); + case SECCAT_TEXT: + case SECCAT_TDATA: + case SECCAT_TBSS: + /* We don't split these for medium model. Place them into + default sections and hope for best. */ + break; + } + if (prefix) + { + const char *name; + size_t nlen, plen; + char *string; + plen = strlen (prefix); + + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + name = targetm.strip_name_encoding (name); + nlen = strlen (name); + + string = alloca (nlen + plen + 1); + memcpy (string, prefix, plen); + memcpy (string + plen, name, nlen + 1); + + DECL_SECTION_NAME (decl) = build_string (nlen + plen, string); + return; + } + } + default_unique_section (decl, reloc); +} + +#ifdef COMMON_ASM_OP +/* This says how to output assembler code to declare an + uninitialized external linkage data object. + + For medium model x86-64 we need to use .largecomm opcode for + large objects. */ +void +x86_elf_aligned_common (FILE *file, + const char *name, unsigned HOST_WIDE_INT size, + int align) +{ + if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC) + && size > (unsigned int)ix86_section_threshold) + fprintf (file, ".largecomm\t"); + else + fprintf (file, "%s", COMMON_ASM_OP); + assemble_name (file, name); + fprintf (file, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", + size, align / BITS_PER_UNIT); +} + +/* Utility function for targets to use in implementing + ASM_OUTPUT_ALIGNED_BSS. */ + +void +x86_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED, + const char *name, unsigned HOST_WIDE_INT size, + int align) +{ + if ((ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_MEDIUM_PIC) + && size > (unsigned int)ix86_section_threshold) + switch_to_section (get_named_section (decl, ".lbss", 0)); + else + switch_to_section (bss_section); + ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); +#ifdef ASM_DECLARE_OBJECT_NAME + last_assemble_variable_decl = decl; + ASM_DECLARE_OBJECT_NAME (file, name, decl); +#else + /* Standard thing is just output label for the object. */ + ASM_OUTPUT_LABEL (file, name); +#endif /* ASM_DECLARE_OBJECT_NAME */ + ASM_OUTPUT_SKIP (file, size ? size : 1); +} +#endif + void optimization_options (int level, int size ATTRIBUTE_UNUSED) { @@ -1509,6 +2184,11 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED) flag_schedule_insns = 0; #endif + if (TARGET_MACHO) + /* The Darwin libraries never set errno, so we might as well + avoid calling them when that's the only reason we would. */ + flag_errno_math = 0; + /* The default values of these switches depend on the TARGET_64BIT that is not known at this moment. Mark these values with 2 and let user the to override these. In case there is no command line option @@ -1517,6 +2197,9 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED) flag_omit_frame_pointer = 2; flag_pcc_struct_return = 2; flag_asynchronous_unwind_tables = 2; +#ifdef SUBTARGET_OPTIMIZATION_OPTIONS + SUBTARGET_OPTIMIZATION_OPTIONS; +#endif } /* Table of valid machine attributes. */ @@ -1525,22 +2208,31 @@ const struct attribute_spec ix86_attribute_table[] = /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ /* Stdcall attribute says callee is responsible for popping arguments if they are not variable. */ - { "stdcall", 0, 0, false, true, true, ix86_handle_cdecl_attribute }, + { "stdcall", 0, 0, false, true, true, ix86_handle_cconv_attribute }, /* Fastcall attribute says callee is responsible for popping arguments if they are not variable. */ - { "fastcall", 0, 0, false, true, true, ix86_handle_cdecl_attribute }, + { "fastcall", 0, 0, false, true, true, ix86_handle_cconv_attribute }, /* Cdecl attribute says the callee is a normal C declaration */ - { "cdecl", 0, 0, false, true, true, ix86_handle_cdecl_attribute }, + { "cdecl", 0, 0, false, true, true, ix86_handle_cconv_attribute }, /* Regparm attribute specifies how many integer arguments are to be passed in registers. */ - { "regparm", 1, 1, false, true, true, ix86_handle_regparm_attribute }, -#ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES - { "dllimport", 0, 0, false, false, false, ix86_handle_dll_attribute }, - { "dllexport", 0, 0, false, false, false, ix86_handle_dll_attribute }, + { "regparm", 1, 1, false, true, true, ix86_handle_cconv_attribute }, + /* Sseregparm attribute says we are using x86_64 calling conventions + for FP arguments. */ + { "sseregparm", 0, 0, false, true, true, ix86_handle_cconv_attribute }, + /* force_align_arg_pointer says this function realigns the stack at entry. */ + { (const char *)&ix86_force_align_arg_pointer_string, 0, 0, + false, true, true, ix86_handle_cconv_attribute }, +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES + { "dllimport", 0, 0, false, false, false, handle_dll_attribute }, + { "dllexport", 0, 0, false, false, false, handle_dll_attribute }, { "shared", 0, 0, true, false, false, ix86_handle_shared_attribute }, #endif { "ms_struct", 0, 0, false, false, false, ix86_handle_struct_attribute }, { "gcc_struct", 0, 0, false, false, false, ix86_handle_struct_attribute }, +#ifdef SUBTARGET_ATTRIBUTE_TABLE + SUBTARGET_ATTRIBUTE_TABLE, +#endif { NULL, 0, 0, false, false, false, NULL } }; @@ -1551,19 +2243,44 @@ const struct attribute_spec ix86_attribute_table[] = static bool ix86_function_ok_for_sibcall (tree decl, tree exp) { + tree func; + rtx a, b; + /* If we are generating position-independent code, we cannot sibcall optimize any indirect call, or a direct call to a global function, as the PLT requires %ebx be live. */ - if (!TARGET_64BIT && flag_pic && (!decl || TREE_PUBLIC (decl))) + if (!TARGET_64BIT && flag_pic && (!decl || !targetm.binds_local_p (decl))) return false; - /* If we are returning floats on the 80387 register stack, we cannot + if (decl) + func = decl; + else + { + func = TREE_TYPE (TREE_OPERAND (exp, 0)); + if (POINTER_TYPE_P (func)) + func = TREE_TYPE (func); + } + + /* Check that the return value locations are the same. Like + if we are returning floats on the 80387 register stack, we cannot make a sibcall from a function that doesn't return a float to a function that does or, conversely, from a function that does return a float to a function that doesn't; the necessary stack adjustment - would not be executed. */ - if (STACK_REG_P (ix86_function_value (TREE_TYPE (exp))) - != STACK_REG_P (ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl))))) + would not be executed. This is also the place we notice + differences in the return value ABI. Note that it is ok for one + of the functions to have void return type as long as the return + value of the other is passed in a register. */ + a = ix86_function_value (TREE_TYPE (exp), func, false); + b = ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)), + cfun->decl, false); + if (STACK_REG_P (a) || STACK_REG_P (b)) + { + if (!rtx_equal_p (a, b)) + return false; + } + else if (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (cfun->decl)))) + ; + else if (!rtx_equal_p (a, b)) return false; /* If this call is indirect, we'll need to be able to use a call-clobbered @@ -1586,96 +2303,134 @@ ix86_function_ok_for_sibcall (tree decl, tree exp) } } +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES + /* Dllimport'd functions are also called indirectly. */ + if (decl && DECL_DLLIMPORT_P (decl) + && ix86_function_regparm (TREE_TYPE (decl), NULL) >= 3) + return false; +#endif + + /* If we forced aligned the stack, then sibcalling would unalign the + stack, which may break the called function. */ + if (cfun->machine->force_align_arg_pointer) + return false; + /* Otherwise okay. That also includes certain types of indirect calls. */ return true; } -/* Handle a "cdecl", "stdcall", or "fastcall" attribute; +/* Handle "cdecl", "stdcall", "fastcall", "regparm" and "sseregparm" + calling convention attributes; arguments as in struct attribute_spec.handler. */ + static tree -ix86_handle_cdecl_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +ix86_handle_cconv_attribute (tree *node, tree name, + tree args, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_TYPE && TREE_CODE (*node) != METHOD_TYPE && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning (OPT_Wattributes, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; - } - else - { - if (is_attribute_p ("fastcall", name)) - { - if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node))) - { - error ("fastcall and stdcall attributes are not compatible"); - } - else if (lookup_attribute ("regparm", TYPE_ATTRIBUTES (*node))) - { - error ("fastcall and regparm attributes are not compatible"); - } - } - else if (is_attribute_p ("stdcall", name)) - { - if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node))) - { - error ("fastcall and stdcall attributes are not compatible"); - } - } + return NULL_TREE; } - if (TARGET_64BIT) - { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - *no_add_attrs = true; - } - - return NULL_TREE; -} - -/* Handle a "regparm" attribute; - arguments as in struct attribute_spec.handler. */ -static tree -ix86_handle_regparm_attribute (tree *node, tree name, tree args, - int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) -{ - if (TREE_CODE (*node) != FUNCTION_TYPE - && TREE_CODE (*node) != METHOD_TYPE - && TREE_CODE (*node) != FIELD_DECL - && TREE_CODE (*node) != TYPE_DECL) - { - warning ("`%s' attribute only applies to functions", - IDENTIFIER_POINTER (name)); - *no_add_attrs = true; - } - else + /* Can combine regparm with all attributes but fastcall. */ + if (is_attribute_p ("regparm", name)) { tree cst; + if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node))) + { + error ("fastcall and regparm attributes are not compatible"); + } + cst = TREE_VALUE (args); if (TREE_CODE (cst) != INTEGER_CST) { - warning ("`%s' attribute requires an integer constant argument", + warning (OPT_Wattributes, + "%qs attribute requires an integer constant argument", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (compare_tree_int (cst, REGPARM_MAX) > 0) { - warning ("argument to `%s' attribute larger than %d", + warning (OPT_Wattributes, "argument to %qs attribute larger than %d", IDENTIFIER_POINTER (name), REGPARM_MAX); *no_add_attrs = true; } - if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node))) + if (!TARGET_64BIT + && lookup_attribute (ix86_force_align_arg_pointer_string, + TYPE_ATTRIBUTES (*node)) + && compare_tree_int (cst, REGPARM_MAX-1)) { + error ("%s functions limited to %d register parameters", + ix86_force_align_arg_pointer_string, REGPARM_MAX-1); + } + + return NULL_TREE; + } + + if (TARGET_64BIT) + { + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + return NULL_TREE; + } + + /* Can combine fastcall with stdcall (redundant) and sseregparm. */ + if (is_attribute_p ("fastcall", name)) + { + if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node))) + { + error ("fastcall and cdecl attributes are not compatible"); + } + if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node))) + { + error ("fastcall and stdcall attributes are not compatible"); + } + if (lookup_attribute ("regparm", TYPE_ATTRIBUTES (*node))) + { error ("fastcall and regparm attributes are not compatible"); } } + /* Can combine stdcall with fastcall (redundant), regparm and + sseregparm. */ + else if (is_attribute_p ("stdcall", name)) + { + if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (*node))) + { + error ("stdcall and cdecl attributes are not compatible"); + } + if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node))) + { + error ("stdcall and fastcall attributes are not compatible"); + } + } + + /* Can combine cdecl with regparm and sseregparm. */ + else if (is_attribute_p ("cdecl", name)) + { + if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (*node))) + { + error ("stdcall and cdecl attributes are not compatible"); + } + if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (*node))) + { + error ("fastcall and cdecl attributes are not compatible"); + } + } + + /* Can combine sseregparm with all attributes. */ + return NULL_TREE; } @@ -1692,22 +2447,27 @@ ix86_comp_type_attributes (tree type1, tree type2) if (TREE_CODE (type1) != FUNCTION_TYPE) return 1; - /* Check for mismatched fastcall types */ - if (!lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type1)) - != !lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type2))) + /* Check for mismatched fastcall/regparm types. */ + if ((!lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type1)) + != !lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type2))) + || (ix86_function_regparm (type1, NULL) + != ix86_function_regparm (type2, NULL))) + return 0; + + /* Check for mismatched sseregparm types. */ + if (!lookup_attribute ("sseregparm", TYPE_ATTRIBUTES (type1)) + != !lookup_attribute ("sseregparm", TYPE_ATTRIBUTES (type2))) return 0; /* Check for mismatched return types (cdecl vs stdcall). */ if (!lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type1)) != !lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type2))) return 0; - if (ix86_function_regparm (type1, NULL) - != ix86_function_regparm (type2, NULL)) - return 0; + return 1; } -/* Return the regparm value for a fuctio with the indicated TYPE and DECL. +/* Return the regparm value for a function with the indicated TYPE and DECL. DECL may be NULL when calling function indirectly or considering a libcall. */ @@ -1740,19 +2500,91 @@ ix86_function_regparm (tree type, tree decl) struct cgraph_local_info *i = cgraph_local_info (decl); if (i && i->local) { + int local_regparm, globals = 0, regno; + + /* Make sure no regparm register is taken by a global register + variable. */ + for (local_regparm = 0; local_regparm < 3; local_regparm++) + if (global_regs[local_regparm]) + break; /* We can't use regparm(3) for nested functions as these use static chain pointer in third argument. */ - if (DECL_CONTEXT (decl) && !DECL_NO_STATIC_CHAIN (decl)) - regparm = 2; - else - regparm = 3; + if (local_regparm == 3 + && decl_function_context (decl) + && !DECL_NO_STATIC_CHAIN (decl)) + local_regparm = 2; + /* If the function realigns its stackpointer, the + prologue will clobber %ecx. If we've already + generated code for the callee, the callee + DECL_STRUCT_FUNCTION is gone, so we fall back to + scanning the attributes for the self-realigning + property. */ + if ((DECL_STRUCT_FUNCTION (decl) + && DECL_STRUCT_FUNCTION (decl)->machine->force_align_arg_pointer) + || (!DECL_STRUCT_FUNCTION (decl) + && lookup_attribute (ix86_force_align_arg_pointer_string, + TYPE_ATTRIBUTES (TREE_TYPE (decl))))) + local_regparm = 2; + /* Each global register variable increases register preassure, + so the more global reg vars there are, the smaller regparm + optimization use, unless requested by the user explicitly. */ + for (regno = 0; regno < 6; regno++) + if (global_regs[regno]) + globals++; + local_regparm + = globals < local_regparm ? local_regparm - globals : 0; + + if (local_regparm > regparm) + regparm = local_regparm; } } } return regparm; } -/* Return true if EAX is live at the start of the function. Used by +/* Return 1 or 2, if we can pass up to SSE_REGPARM_MAX SFmode (1) and + DFmode (2) arguments in SSE registers for a function with the + indicated TYPE and DECL. DECL may be NULL when calling function + indirectly or considering a libcall. Otherwise return 0. */ + +static int +ix86_function_sseregparm (tree type, tree decl) +{ + /* Use SSE registers to pass SFmode and DFmode arguments if requested + by the sseregparm attribute. */ + if (TARGET_SSEREGPARM + || (type + && lookup_attribute ("sseregparm", TYPE_ATTRIBUTES (type)))) + { + if (!TARGET_SSE) + { + if (decl) + error ("Calling %qD with attribute sseregparm without " + "SSE/SSE2 enabled", decl); + else + error ("Calling %qT with attribute sseregparm without " + "SSE/SSE2 enabled", type); + return 0; + } + + return 2; + } + + /* For local functions, pass up to SSE_REGPARM_MAX SFmode + (and DFmode for SSE2) arguments in SSE registers, + even for 32-bit targets. */ + if (!TARGET_64BIT && decl + && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag) + { + struct cgraph_local_info *i = cgraph_local_info (decl); + if (i && i->local) + return TARGET_SSE2 ? 2 : 1; + } + + return 0; +} + +/* Return true if EAX is live at the start of the function. Used by ix86_expand_prologue to determine if we need special help before calling allocate_stack_worker. */ @@ -1765,7 +2597,7 @@ ix86_eax_live_at_start_p (void) to correct at this point. This gives false positives for broken functions that might use uninitialized data that happens to be allocated in eax, but who cares? */ - return REGNO_REG_SET_P (ENTRY_BLOCK_PTR->global_live_at_end, 0); + return REGNO_REG_SET_P (ENTRY_BLOCK_PTR->il.rtl->global_live_at_end, 0); } /* Value is the number of bytes of arguments automatically @@ -1808,7 +2640,8 @@ ix86_return_pops_args (tree fundecl, tree funtype, int size) /* Lose any fake structure return argument if it is passed on the stack. */ if (aggregate_value_p (TREE_TYPE (funtype), fundecl) - && !TARGET_64BIT) + && !TARGET_64BIT + && !KEEP_AGGREGATE_RETURN_POINTER) { int nregs = ix86_function_regparm (funtype, fundecl); @@ -1827,10 +2660,29 @@ ix86_function_arg_regno_p (int regno) { int i; if (!TARGET_64BIT) - return (regno < REGPARM_MAX - || (TARGET_SSE && SSE_REGNO_P (regno) && !fixed_regs[regno])); - if (SSE_REGNO_P (regno) && TARGET_SSE) - return true; + { + if (TARGET_MACHO) + return (regno < REGPARM_MAX + || (TARGET_SSE && SSE_REGNO_P (regno) && !fixed_regs[regno])); + else + return (regno < REGPARM_MAX + || (TARGET_MMX && MMX_REGNO_P (regno) + && (regno < FIRST_MMX_REG + MMX_REGPARM_MAX)) + || (TARGET_SSE && SSE_REGNO_P (regno) + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))); + } + + if (TARGET_MACHO) + { + if (SSE_REGNO_P (regno) && TARGET_SSE) + return true; + } + else + { + if (TARGET_SSE && SSE_REGNO_P (regno) + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) + return true; + } /* RAX is used as hidden argument to va_arg functions. */ if (!regno) return true; @@ -1840,6 +2692,21 @@ ix86_function_arg_regno_p (int regno) return false; } +/* Return if we do not know how to pass TYPE solely in registers. */ + +static bool +ix86_must_pass_in_stack (enum machine_mode mode, tree type) +{ + if (must_pass_in_stack_var_size_or_pad (mode, type)) + return true; + + /* For 32-bit, we want TImode aggregates to go on the stack. But watch out! + The layout_type routine is crafty and tries to trick us into passing + currently unsupported vector types on the stack by using TImode. */ + return (!TARGET_64BIT && mode == TImode + && type && TREE_CODE (type) != VECTOR_TYPE); +} + /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ @@ -1870,17 +2737,17 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ *cum = zero_cum; /* Set up the number of registers to use for passing arguments. */ - if (fntype) - cum->nregs = ix86_function_regparm (fntype, fndecl); - else - cum->nregs = ix86_regparm; - cum->sse_nregs = SSE_REGPARM_MAX; - cum->mmx_nregs = MMX_REGPARM_MAX; + cum->nregs = ix86_regparm; + if (TARGET_SSE) + cum->sse_nregs = SSE_REGPARM_MAX; + if (TARGET_MMX) + cum->mmx_nregs = MMX_REGPARM_MAX; cum->warn_sse = true; cum->warn_mmx = true; cum->maybe_vaarg = false; - /* Use ecx and edx registers if function has fastcall attribute */ + /* Use ecx and edx registers if function has fastcall attribute, + else look for regparm information. */ if (fntype && !TARGET_64BIT) { if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (fntype))) @@ -1888,15 +2755,20 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ cum->nregs = 2; cum->fastcall = 1; } + else + cum->nregs = ix86_function_regparm (fntype, fndecl); } + /* Set up the number of SSE registers used for passing SFmode + and DFmode arguments. Warn for mismatching ABI. */ + cum->float_in_sse = ix86_function_sseregparm (fntype, fndecl); /* Determine if this function has variable arguments. This is indicated by the last argument being 'void_type_mode' if there are no variable arguments. If there are variable arguments, then - we won't pass anything in registers */ + we won't pass anything in registers in 32-bit mode. */ - if (cum->nregs || !TARGET_MMX || !TARGET_SSE) + if (cum->nregs || cum->mmx_nregs || cum->sse_nregs) { for (param = (fntype) ? TYPE_ARG_TYPES (fntype) : 0; param != 0; param = next_param) @@ -1912,6 +2784,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ cum->warn_sse = 0; cum->warn_mmx = 0; cum->fastcall = 0; + cum->float_in_sse = 0; } cum->maybe_vaarg = true; } @@ -1919,7 +2792,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ } if ((!fntype && !libname) || (fntype && !TYPE_ARG_TYPES (fntype))) - cum->maybe_vaarg = 1; + cum->maybe_vaarg = true; if (TARGET_DEBUG_ARG) fprintf (stderr, ", nregs=%d )\n", cum->nregs); @@ -1927,6 +2800,71 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ return; } +/* Return the "natural" mode for TYPE. In most cases, this is just TYPE_MODE. + But in the case of vector types, it is some vector mode. + + When we have only some of our vector isa extensions enabled, then there + are some modes for which vector_mode_supported_p is false. For these + modes, the generic vector support in gcc will choose some non-vector mode + in order to implement the type. By computing the natural mode, we'll + select the proper ABI location for the operand and not depend on whatever + the middle-end decides to do with these vector types. */ + +static enum machine_mode +type_natural_mode (tree type) +{ + enum machine_mode mode = TYPE_MODE (type); + + if (TREE_CODE (type) == VECTOR_TYPE && !VECTOR_MODE_P (mode)) + { + HOST_WIDE_INT size = int_size_in_bytes (type); + if ((size == 8 || size == 16) + /* ??? Generic code allows us to create width 1 vectors. Ignore. */ + && TYPE_VECTOR_SUBPARTS (type) > 1) + { + enum machine_mode innermode = TYPE_MODE (TREE_TYPE (type)); + + if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE) + mode = MIN_MODE_VECTOR_FLOAT; + else + mode = MIN_MODE_VECTOR_INT; + + /* Get the mode which has this inner mode and number of units. */ + for (; mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) + if (GET_MODE_NUNITS (mode) == TYPE_VECTOR_SUBPARTS (type) + && GET_MODE_INNER (mode) == innermode) + return mode; + + gcc_unreachable (); + } + } + + return mode; +} + +/* We want to pass a value in REGNO whose "natural" mode is MODE. However, + this may not agree with the mode that the type system has chosen for the + register, which is ORIG_MODE. If ORIG_MODE is not BLKmode, then we can + go ahead and use it. Otherwise we have to build a PARALLEL instead. */ + +static rtx +gen_reg_or_parallel (enum machine_mode mode, enum machine_mode orig_mode, + unsigned int regno) +{ + rtx tmp; + + if (orig_mode != BLKmode) + tmp = gen_rtx_REG (orig_mode, regno); + else + { + tmp = gen_rtx_REG (mode, regno); + tmp = gen_rtx_EXPR_LIST (VOIDmode, tmp, const0_rtx); + tmp = gen_rtx_PARALLEL (orig_mode, gen_rtvec (1, tmp)); + } + + return tmp; +} + /* x86-64 register passing implementation. See x86-64 ABI for details. Goal of this code is to classify each 8bytes of incoming argument by the register class and assign registers accordingly. */ @@ -1960,9 +2898,14 @@ merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) return X86_64_INTEGER_CLASS; - /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ - if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS - || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) + /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class, + MEMORY is used. */ + if (class1 == X86_64_X87_CLASS + || class1 == X86_64_X87UP_CLASS + || class1 == X86_64_COMPLEX_X87_CLASS + || class2 == X86_64_X87_CLASS + || class2 == X86_64_X87UP_CLASS + || class2 == X86_64_COMPLEX_X87_CLASS) return X86_64_MEMORY_CLASS; /* Rule #6: Otherwise class SSE is used. */ @@ -1994,7 +2937,7 @@ classify_argument (enum machine_mode mode, tree type, return 0; if (mode != VOIDmode - && MUST_PASS_IN_STACK (mode, type)) + && targetm.calls.must_pass_in_stack (mode, type)) return 0; if (type && AGGREGATE_TYPE_P (type)) @@ -2019,21 +2962,21 @@ classify_argument (enum machine_mode mode, tree type, } /* Classify each field of record and merge classes. */ - if (TREE_CODE (type) == RECORD_TYPE) + switch (TREE_CODE (type)) { + case RECORD_TYPE: /* For classes first merge in the field of the subclasses. */ - if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL) + if (TYPE_BINFO (type)) { - tree bases = TYPE_BINFO_BASETYPES (type); - int n_bases = TREE_VEC_LENGTH (bases); - int i; + tree binfo, base_binfo; + int basenum; - for (i = 0; i < n_bases; ++i) + for (binfo = TYPE_BINFO (type), basenum = 0; + BINFO_BASE_ITERATE (binfo, basenum, base_binfo); basenum++) { - tree binfo = TREE_VEC_ELT (bases, i); int num; - int offset = tree_low_cst (BINFO_OFFSET (binfo), 0) * 8; - tree type = BINFO_TYPE (binfo); + int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8; + tree type = BINFO_TYPE (base_binfo); num = classify_argument (TYPE_MODE (type), type, subclasses, @@ -2055,13 +2998,16 @@ classify_argument (enum machine_mode mode, tree type, { int num; + if (TREE_TYPE (field) == error_mark_node) + continue; + /* Bitfields are always classified as integer. Handle them early, since later code would consider them to be misaligned integers. */ if (DECL_BIT_FIELD (field)) { - for (i = int_bit_position (field) / 8 / 8; - i < (int_bit_position (field) + for (i = (int_bit_position (field) + (bit_offset % 64)) / 8 / 8; + i < ((int_bit_position (field) + (bit_offset % 64)) + tree_low_cst (DECL_SIZE (field), 0) + 63) / 8 / 8; i++) classes[i] = @@ -2086,61 +3032,45 @@ classify_argument (enum machine_mode mode, tree type, } } } - } - /* Arrays are handled as small records. */ - else if (TREE_CODE (type) == ARRAY_TYPE) - { - int num; - num = classify_argument (TYPE_MODE (TREE_TYPE (type)), - TREE_TYPE (type), subclasses, bit_offset); - if (!num) - return 0; + break; - /* The partial classes are now full classes. */ - if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4) - subclasses[0] = X86_64_SSE_CLASS; - if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4) - subclasses[0] = X86_64_INTEGER_CLASS; + case ARRAY_TYPE: + /* Arrays are handled as small records. */ + { + int num; + num = classify_argument (TYPE_MODE (TREE_TYPE (type)), + TREE_TYPE (type), subclasses, bit_offset); + if (!num) + return 0; - for (i = 0; i < words; i++) - classes[i] = subclasses[i % num]; - } - /* Unions are similar to RECORD_TYPE but offset is always 0. */ - else if (TREE_CODE (type) == UNION_TYPE - || TREE_CODE (type) == QUAL_UNION_TYPE) - { - /* For classes first merge in the field of the subclasses. */ - if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL) - { - tree bases = TYPE_BINFO_BASETYPES (type); - int n_bases = TREE_VEC_LENGTH (bases); - int i; + /* The partial classes are now full classes. */ + if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4) + subclasses[0] = X86_64_SSE_CLASS; + if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4) + subclasses[0] = X86_64_INTEGER_CLASS; - for (i = 0; i < n_bases; ++i) - { - tree binfo = TREE_VEC_ELT (bases, i); - int num; - int offset = tree_low_cst (BINFO_OFFSET (binfo), 0) * 8; - tree type = BINFO_TYPE (binfo); + for (i = 0; i < words; i++) + classes[i] = subclasses[i % num]; - num = classify_argument (TYPE_MODE (type), - type, subclasses, - (offset + (bit_offset % 64)) % 256); - if (!num) - return 0; - for (i = 0; i < num; i++) - { - int pos = (offset + (bit_offset % 64)) / 8 / 8; - classes[i + pos] = - merge_classes (subclasses[i], classes[i + pos]); - } - } - } + break; + } + case UNION_TYPE: + case QUAL_UNION_TYPE: + /* Unions are similar to RECORD_TYPE but offset is always 0. + */ + + /* Unions are not derived. */ + gcc_assert (!TYPE_BINFO (type) + || !BINFO_N_BASE_BINFOS (TYPE_BINFO (type))); for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) { if (TREE_CODE (field) == FIELD_DECL) { int num; + + if (TREE_TYPE (field) == error_mark_node) + continue; + num = classify_argument (TYPE_MODE (TREE_TYPE (field)), TREE_TYPE (field), subclasses, bit_offset); @@ -2150,34 +3080,11 @@ classify_argument (enum machine_mode mode, tree type, classes[i] = merge_classes (subclasses[i], classes[i]); } } + break; + + default: + gcc_unreachable (); } - else if (TREE_CODE (type) == SET_TYPE) - { - if (bytes <= 4) - { - classes[0] = X86_64_INTEGERSI_CLASS; - return 1; - } - else if (bytes <= 8) - { - classes[0] = X86_64_INTEGER_CLASS; - return 1; - } - else if (bytes <= 12) - { - classes[0] = X86_64_INTEGER_CLASS; - classes[1] = X86_64_INTEGERSI_CLASS; - return 2; - } - else - { - classes[0] = X86_64_INTEGER_CLASS; - classes[1] = X86_64_INTEGER_CLASS; - return 2; - } - } - else - abort (); /* Final merger cleanup. */ for (i = 0; i < words; i++) @@ -2218,9 +3125,22 @@ classify_argument (enum machine_mode mode, tree type, return 0; } + /* for V1xx modes, just use the base mode */ + if (VECTOR_MODE_P (mode) + && GET_MODE_SIZE (GET_MODE_INNER (mode)) == bytes) + mode = GET_MODE_INNER (mode); + /* Classification of atomic types. */ switch (mode) { + case SDmode: + case DDmode: + classes[0] = X86_64_SSE_CLASS; + return 1; + case TDmode: + classes[0] = X86_64_SSE_CLASS; + classes[1] = X86_64_SSEUP_CLASS; + return 2; case DImode: case SImode: case HImode: @@ -2238,9 +3158,7 @@ classify_argument (enum machine_mode mode, tree type, classes[0] = classes[1] = X86_64_INTEGER_CLASS; return 2; case CTImode: - classes[0] = classes[1] = X86_64_INTEGER_CLASS; - classes[2] = classes[3] = X86_64_INTEGER_CLASS; - return 4; + return 0; case SFmode: if (!(bit_offset % 64)) classes[0] = X86_64_SSESF_CLASS; @@ -2255,21 +3173,22 @@ classify_argument (enum machine_mode mode, tree type, classes[1] = X86_64_X87UP_CLASS; return 2; case TFmode: - case TCmode: - return 0; - case XCmode: - classes[0] = X86_64_X87_CLASS; - classes[1] = X86_64_X87UP_CLASS; - classes[2] = X86_64_X87_CLASS; - classes[3] = X86_64_X87UP_CLASS; - return 4; - case DCmode: - classes[0] = X86_64_SSEDF_CLASS; - classes[1] = X86_64_SSEDF_CLASS; + classes[0] = X86_64_SSE_CLASS; + classes[1] = X86_64_SSEUP_CLASS; return 2; case SCmode: classes[0] = X86_64_SSE_CLASS; return 1; + case DCmode: + classes[0] = X86_64_SSEDF_CLASS; + classes[1] = X86_64_SSEDF_CLASS; + return 2; + case XCmode: + classes[0] = X86_64_COMPLEX_X87_CLASS; + return 1; + case TCmode: + /* This modes is larger than 16 bytes. */ + return 0; case V4SFmode: case V4SImode: case V16QImode: @@ -2283,12 +3202,25 @@ classify_argument (enum machine_mode mode, tree type, case V2SImode: case V4HImode: case V8QImode: - return 0; + classes[0] = X86_64_SSE_CLASS; + return 1; case BLKmode: case VOIDmode: return 0; default: - abort (); + gcc_assert (VECTOR_MODE_P (mode)); + + if (bytes > 16) + return 0; + + gcc_assert (GET_MODE_CLASS (GET_MODE_INNER (mode)) == MODE_INT); + + if (bit_offset + GET_MODE_BITSIZE (mode) <= 32) + classes[0] = X86_64_INTEGERSI_CLASS; + else + classes[0] = X86_64_INTEGER_CLASS; + classes[1] = X86_64_INTEGER_CLASS; + return 1 + (bytes > 8); } } @@ -2325,18 +3257,27 @@ examine_argument (enum machine_mode mode, tree type, int in_return, if (!in_return) return 0; break; + case X86_64_COMPLEX_X87_CLASS: + return in_return ? 2 : 0; case X86_64_MEMORY_CLASS: - abort (); + gcc_unreachable (); } return 1; } + /* Construct container for the argument used by GCC interface. See FUNCTION_ARG for the detailed description. */ + static rtx -construct_container (enum machine_mode mode, tree type, int in_return, - int nintregs, int nsseregs, const int * intreg, - int sse_regno) +construct_container (enum machine_mode mode, enum machine_mode orig_mode, + tree type, int in_return, int nintregs, int nsseregs, + const int *intreg, int sse_regno) { + /* The following variables hold the static issued_error state. */ + static bool issued_sse_arg_error; + static bool issued_sse_ret_error; + static bool issued_x87_ret_error; + enum machine_mode tmpmode; int bytes = (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); @@ -2365,11 +3306,48 @@ construct_container (enum machine_mode mode, tree type, int in_return, } if (!n) return NULL; - if (!examine_argument (mode, type, in_return, &needed_intregs, &needed_sseregs)) + if (!examine_argument (mode, type, in_return, &needed_intregs, + &needed_sseregs)) return NULL; if (needed_intregs > nintregs || needed_sseregs > nsseregs) return NULL; + /* We allowed the user to turn off SSE for kernel mode. Don't crash if + some less clueful developer tries to use floating-point anyway. */ + if (needed_sseregs && !TARGET_SSE) + { + if (in_return) + { + if (!issued_sse_ret_error) + { + error ("SSE register return with SSE disabled"); + issued_sse_ret_error = true; + } + } + else if (!issued_sse_arg_error) + { + error ("SSE register argument with SSE disabled"); + issued_sse_arg_error = true; + } + return NULL; + } + + /* Likewise, error if the ABI requires us to return values in the + x87 registers and the user specified -mno-80387. */ + if (!TARGET_80387 && in_return) + for (i = 0; i < n; i++) + if (class[i] == X86_64_X87_CLASS + || class[i] == X86_64_X87UP_CLASS + || class[i] == X86_64_COMPLEX_X87_CLASS) + { + if (!issued_x87_ret_error) + { + error ("x87 register return with x87 disabled"); + issued_x87_ret_error = true; + } + return NULL; + } + /* First construct simple cases. Avoid SCmode, since we want to use single register to pass this type. */ if (n == 1 && mode != SCmode) @@ -2381,14 +3359,15 @@ construct_container (enum machine_mode mode, tree type, int in_return, case X86_64_SSE_CLASS: case X86_64_SSESF_CLASS: case X86_64_SSEDF_CLASS: - return gen_rtx_REG (mode, SSE_REGNO (sse_regno)); + return gen_reg_or_parallel (mode, orig_mode, SSE_REGNO (sse_regno)); case X86_64_X87_CLASS: + case X86_64_COMPLEX_X87_CLASS: return gen_rtx_REG (mode, FIRST_STACK_REG); case X86_64_NO_CLASS: /* Zero sized array, struct or class. */ return NULL; default: - abort (); + gcc_unreachable (); } if (n == 2 && class[0] == X86_64_SSE_CLASS && class[1] == X86_64_SSEUP_CLASS && mode != BLKmode) @@ -2401,11 +3380,6 @@ construct_container (enum machine_mode mode, tree type, int in_return, && (mode == CDImode || mode == TImode || mode == TFmode) && intreg[0] + 1 == intreg[1]) return gen_rtx_REG (mode, intreg[0]); - if (n == 4 - && class[0] == X86_64_X87_CLASS && class[1] == X86_64_X87UP_CLASS - && class[2] == X86_64_X87_CLASS && class[3] == X86_64_X87UP_CLASS - && mode != BLKmode) - return gen_rtx_REG (XCmode, FIRST_STACK_REG); /* Otherwise figure out the entries of the PARALLEL. */ for (i = 0; i < n; i++) @@ -2459,9 +3433,14 @@ construct_container (enum machine_mode mode, tree type, int in_return, sse_regno++; break; default: - abort (); + gcc_unreachable (); } } + + /* Empty aligned struct, union or class. */ + if (nexps == 0) + return NULL; + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (nexps)); for (i = 0; i < nexps; i++) XVECEXP (ret, 0, i) = exp [i]; @@ -2473,19 +3452,22 @@ construct_container (enum machine_mode mode, tree type, int in_return, (TYPE is null for libcalls where that information may not be available.) */ void -function_arg_advance (CUMULATIVE_ARGS *cum, /* current arg information */ - enum machine_mode mode, /* current arg mode */ - tree type, /* type of the argument or 0 if lib support */ - int named) /* whether or not the argument was named */ +function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) { int bytes = (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + if (type) + mode = type_natural_mode (type); + if (TARGET_DEBUG_ARG) - fprintf (stderr, - "function_adv (sz=%d, wds=%2d, nregs=%d, ssenregs=%d, mode=%s, named=%d)\n\n", - words, cum->words, cum->nregs, cum->sse_nregs, GET_MODE_NAME (mode), named); + fprintf (stderr, "function_adv (sz=%d, wds=%2d, nregs=%d, ssenregs=%d, " + "mode=%s, named=%d)\n\n", + words, cum->words, cum->nregs, cum->sse_nregs, + GET_MODE_NAME (mode), named); + if (TARGET_64BIT) { int int_nregs, sse_nregs; @@ -2503,32 +3485,20 @@ function_arg_advance (CUMULATIVE_ARGS *cum, /* current arg information */ } else { - if (TARGET_SSE && SSE_REG_MODE_P (mode) - && (!type || !AGGREGATE_TYPE_P (type))) - { - cum->sse_words += words; - cum->sse_nregs -= 1; - cum->sse_regno += 1; - if (cum->sse_nregs <= 0) - { - cum->sse_nregs = 0; - cum->sse_regno = 0; - } - } - else if (TARGET_MMX && MMX_REG_MODE_P (mode) - && (!type || !AGGREGATE_TYPE_P (type))) - { - cum->mmx_words += words; - cum->mmx_nregs -= 1; - cum->mmx_regno += 1; - if (cum->mmx_nregs <= 0) - { - cum->mmx_nregs = 0; - cum->mmx_regno = 0; - } - } - else + switch (mode) { + default: + break; + + case BLKmode: + if (bytes < 0) + break; + /* FALLTHRU */ + + case DImode: + case SImode: + case HImode: + case QImode: cum->words += words; cum->nregs -= words; cum->regno += words; @@ -2538,37 +3508,54 @@ function_arg_advance (CUMULATIVE_ARGS *cum, /* current arg information */ cum->nregs = 0; cum->regno = 0; } + break; + + case DFmode: + if (cum->float_in_sse < 2) + break; + case SFmode: + if (cum->float_in_sse < 1) + break; + /* FALLTHRU */ + + case TImode: + case V16QImode: + case V8HImode: + case V4SImode: + case V2DImode: + case V4SFmode: + case V2DFmode: + if (!type || !AGGREGATE_TYPE_P (type)) + { + cum->sse_words += words; + cum->sse_nregs -= 1; + cum->sse_regno += 1; + if (cum->sse_nregs <= 0) + { + cum->sse_nregs = 0; + cum->sse_regno = 0; + } + } + break; + + case V8QImode: + case V4HImode: + case V2SImode: + case V2SFmode: + if (!type || !AGGREGATE_TYPE_P (type)) + { + cum->mmx_words += words; + cum->mmx_nregs -= 1; + cum->mmx_regno += 1; + if (cum->mmx_nregs <= 0) + { + cum->mmx_nregs = 0; + cum->mmx_regno = 0; + } + } + break; } } - return; -} - -/* A subroutine of function_arg. We want to pass a parameter whose nominal - type is MODE in REGNO. We try to minimize ABI variation, so MODE may not - actually be valid for REGNO with the current ISA. In this case, ALT_MODE - is used instead. It must be the same size as MODE, and must be known to - be valid for REGNO. Finally, ORIG_MODE is the original mode of the - parameter, as seen by the type system. This may be different from MODE - when we're mucking with things minimizing ABI variations. - - Returns a REG or a PARALLEL as appropriate. */ - -static rtx -gen_reg_or_parallel (enum machine_mode mode, enum machine_mode alt_mode, - enum machine_mode orig_mode, unsigned int regno) -{ - rtx tmp; - - if (HARD_REGNO_MODE_OK (regno, mode)) - tmp = gen_rtx_REG (mode, regno); - else - { - tmp = gen_rtx_REG (alt_mode, regno); - tmp = gen_rtx_EXPR_LIST (VOIDmode, tmp, const0_rtx); - tmp = gen_rtx_PARALLEL (orig_mode, gen_rtvec (1, tmp)); - } - - return tmp; } /* Define where to put the arguments to a function. @@ -2595,6 +3582,11 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; static bool warnedsse, warnedmmx; + /* To simplify the code below, represent vector types with a vector mode + even if MMX/SSE are not active. */ + if (type && TREE_CODE (type) == VECTOR_TYPE) + mode = type_natural_mode (type); + /* Handle a hidden AL argument containing number of registers for varargs x86-64 functions. For i386 ABI just return constm1_rtx to avoid any AL settings. */ @@ -2610,7 +3602,8 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, return constm1_rtx; } if (TARGET_64BIT) - ret = construct_container (mode, type, 0, cum->nregs, cum->sse_nregs, + ret = construct_container (mode, orig_mode, type, 0, cum->nregs, + cum->sse_nregs, &x86_64_int_parameter_registers [cum->regno], cum->sse_regno); else @@ -2646,6 +3639,13 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, ret = gen_rtx_REG (mode, regno); } break; + case DFmode: + if (cum->float_in_sse < 2) + break; + case SFmode: + if (cum->float_in_sse < 1) + break; + /* FALLTHRU */ case TImode: case V16QImode: case V8HImode: @@ -2655,14 +3655,14 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, case V2DFmode: if (!type || !AGGREGATE_TYPE_P (type)) { - if (!TARGET_SSE && !warnedmmx && cum->warn_sse) + if (!TARGET_SSE && !warnedsse && cum->warn_sse) { warnedsse = true; - warning ("SSE vector argument without SSE enabled " + warning (0, "SSE vector argument without SSE enabled " "changes the ABI"); } if (cum->sse_nregs) - ret = gen_reg_or_parallel (mode, TImode, orig_mode, + ret = gen_reg_or_parallel (mode, orig_mode, cum->sse_regno + FIRST_SSE_REG); } break; @@ -2675,11 +3675,11 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, if (!TARGET_MMX && !warnedmmx && cum->warn_mmx) { warnedmmx = true; - warning ("MMX vector argument without MMX enabled " + warning (0, "MMX vector argument without MMX enabled " "changes the ABI"); } if (cum->mmx_nregs) - ret = gen_reg_or_parallel (mode, DImode, orig_mode, + ret = gen_reg_or_parallel (mode, orig_mode, cum->mmx_regno + FIRST_MMX_REG); } break; @@ -2708,10 +3708,10 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, the argument itself. The pointer is passed in whatever way is appropriate for passing a pointer to that type. */ -int -function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED, - tree type, int named ATTRIBUTE_UNUSED) +static bool +ix86_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, bool named ATTRIBUTE_UNUSED) { if (!TARGET_64BIT) return 0; @@ -2727,7 +3727,7 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, } /* Return true when TYPE should be 128bit aligned for 32bit argument passing - ABI */ + ABI. Only called if TARGET_SSE. */ static bool contains_128bit_aligned_vector_p (tree type) { @@ -2741,44 +3741,44 @@ contains_128bit_aligned_vector_p (tree type) if (AGGREGATE_TYPE_P (type)) { /* Walk the aggregates recursively. */ - if (TREE_CODE (type) == RECORD_TYPE - || TREE_CODE (type) == UNION_TYPE - || TREE_CODE (type) == QUAL_UNION_TYPE) + switch (TREE_CODE (type)) { - tree field; + case RECORD_TYPE: + case UNION_TYPE: + case QUAL_UNION_TYPE: + { + tree field; - if (TYPE_BINFO (type) != NULL - && TYPE_BINFO_BASETYPES (type) != NULL) - { - tree bases = TYPE_BINFO_BASETYPES (type); - int n_bases = TREE_VEC_LENGTH (bases); - int i; + if (TYPE_BINFO (type)) + { + tree binfo, base_binfo; + int i; - for (i = 0; i < n_bases; ++i) - { - tree binfo = TREE_VEC_ELT (bases, i); - tree type = BINFO_TYPE (binfo); - - if (contains_128bit_aligned_vector_p (type)) + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + if (contains_128bit_aligned_vector_p + (BINFO_TYPE (base_binfo))) return true; - } - } - /* And now merge the fields of structure. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) - { - if (TREE_CODE (field) == FIELD_DECL - && contains_128bit_aligned_vector_p (TREE_TYPE (field))) - return true; - } - } - /* Just for use if some languages passes arrays by value. */ - else if (TREE_CODE (type) == ARRAY_TYPE) - { + } + /* And now merge the fields of structure. */ + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + { + if (TREE_CODE (field) == FIELD_DECL + && contains_128bit_aligned_vector_p (TREE_TYPE (field))) + return true; + } + break; + } + + case ARRAY_TYPE: + /* Just for use if some languages passes arrays by value. */ if (contains_128bit_aligned_vector_p (TREE_TYPE (type))) return true; + break; + + default: + gcc_unreachable (); } - else - abort (); } return false; } @@ -2805,7 +3805,9 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type) The handling here differs from field_alignment. ICC aligns MMX arguments to 4 byte boundaries, while structure fields are aligned to 8 byte boundaries. */ - if (!type) + if (!TARGET_SSE) + align = PARM_BOUNDARY; + else if (!type) { if (!SSE_REG_MODE_P (mode)) align = PARM_BOUNDARY; @@ -2825,15 +3827,31 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type) bool ix86_function_value_regno_p (int regno) { - if (!TARGET_64BIT) + if (TARGET_MACHO) { - return ((regno) == 0 - || ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387) - || ((regno) == FIRST_SSE_REG && TARGET_SSE)); + if (!TARGET_64BIT) + { + return ((regno) == 0 + || ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387) + || ((regno) == FIRST_SSE_REG && TARGET_SSE)); + } + return ((regno) == 0 || (regno) == FIRST_FLOAT_REG + || ((regno) == FIRST_SSE_REG && TARGET_SSE) + || ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)); + } + else + { + if (regno == 0 + || (regno == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387) + || (regno == FIRST_SSE_REG && TARGET_SSE)) + return true; + + if (!TARGET_64BIT + && (regno == FIRST_MMX_REG && TARGET_MMX)) + return true; + + return false; } - return ((regno) == 0 || (regno) == FIRST_FLOAT_REG - || ((regno) == FIRST_SSE_REG && TARGET_SSE) - || ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)); } /* Define how to find the value returned by a function. @@ -2841,30 +3859,40 @@ ix86_function_value_regno_p (int regno) If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ rtx -ix86_function_value (tree valtype) +ix86_function_value (tree valtype, tree fntype_or_decl, + bool outgoing ATTRIBUTE_UNUSED) { + enum machine_mode natmode = type_natural_mode (valtype); + if (TARGET_64BIT) { - rtx ret = construct_container (TYPE_MODE (valtype), valtype, 1, - REGPARM_MAX, SSE_REGPARM_MAX, + rtx ret = construct_container (natmode, TYPE_MODE (valtype), valtype, + 1, REGPARM_MAX, SSE_REGPARM_MAX, x86_64_int_return_registers, 0); - /* For zero sized structures, construct_container return NULL, but we need - to keep rest of compiler happy by returning meaningful value. */ + /* For zero sized structures, construct_container return NULL, but we + need to keep rest of compiler happy by returning meaningful value. */ if (!ret) ret = gen_rtx_REG (TYPE_MODE (valtype), 0); return ret; } else - return gen_rtx_REG (TYPE_MODE (valtype), - ix86_value_regno (TYPE_MODE (valtype))); + { + tree fn = NULL_TREE, fntype; + if (fntype_or_decl + && DECL_P (fntype_or_decl)) + fn = fntype_or_decl; + fntype = fn ? TREE_TYPE (fn) : fntype_or_decl; + return gen_rtx_REG (TYPE_MODE (valtype), + ix86_value_regno (natmode, fn, fntype)); + } } -/* Return false iff type is returned in memory. */ +/* Return true iff type is returned in memory. */ int ix86_return_in_memory (tree type) { int needed_intregs, needed_sseregs, size; - enum machine_mode mode = TYPE_MODE (type); + enum machine_mode mode = type_natural_mode (type); if (TARGET_64BIT) return !examine_argument (mode, type, 1, &needed_intregs, &needed_sseregs); @@ -2883,42 +3911,73 @@ ix86_return_in_memory (tree type) if (size < 8) return 0; - /* MMX/3dNow values are returned on the stack, since we've - got to EMMS/FEMMS before returning. */ + /* MMX/3dNow values are returned in MM0, + except when it doesn't exits. */ if (size == 8) - return 1; + return (TARGET_MMX ? 0 : 1); - /* SSE values are returned in XMM0. */ - /* ??? Except when it doesn't exist? We have a choice of - either (1) being abi incompatible with a -march switch, - or (2) generating an error here. Given no good solution, - I think the safest thing is one warning. The user won't - be able to use -Werror, but.... */ + /* SSE values are returned in XMM0, except when it doesn't exist. */ if (size == 16) - { - static bool warned; - - if (TARGET_SSE) - return 0; - - if (!warned) - { - warned = true; - warning ("SSE vector return without SSE enabled " - "changes the ABI"); - } - return 1; - } + return (TARGET_SSE ? 0 : 1); } if (mode == XFmode) return 0; + if (mode == TDmode) + return 1; + if (size > 12) return 1; return 0; } +/* When returning SSE vector types, we have a choice of either + (1) being abi incompatible with a -march switch, or + (2) generating an error. + Given no good solution, I think the safest thing is one warning. + The user won't be able to use -Werror, but.... + + Choose the STRUCT_VALUE_RTX hook because that's (at present) only + called in response to actually generating a caller or callee that + uses such a type. As opposed to RETURN_IN_MEMORY, which is called + via aggregate_value_p for general type probing from tree-ssa. */ + +static rtx +ix86_struct_value_rtx (tree type, int incoming ATTRIBUTE_UNUSED) +{ + static bool warnedsse, warnedmmx; + + if (type) + { + /* Look at the return type of the function, not the function type. */ + enum machine_mode mode = TYPE_MODE (TREE_TYPE (type)); + + if (!TARGET_SSE && !warnedsse) + { + if (mode == TImode + || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16)) + { + warnedsse = true; + warning (0, "SSE vector return without SSE enabled " + "changes the ABI"); + } + } + + if (!TARGET_MMX && !warnedmmx) + { + if (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 8) + { + warnedmmx = true; + warning (0, "MMX vector return without MMX enabled " + "changes the ABI"); + } + } + } + + return NULL; +} + /* Define how to find the value returned by a library function assuming the value has mode MODE. */ rtx @@ -2932,11 +3991,14 @@ ix86_libcall_value (enum machine_mode mode) case SCmode: case DFmode: case DCmode: + case TFmode: + case SDmode: + case DDmode: + case TDmode: return gen_rtx_REG (mode, FIRST_SSE_REG); case XFmode: case XCmode: return gen_rtx_REG (mode, FIRST_FLOAT_REG); - case TFmode: case TCmode: return NULL; default: @@ -2944,23 +4006,48 @@ ix86_libcall_value (enum machine_mode mode) } } else - return gen_rtx_REG (mode, ix86_value_regno (mode)); + return gen_rtx_REG (mode, ix86_value_regno (mode, NULL, NULL)); } /* Given a mode, return the register to use for a return value. */ static int -ix86_value_regno (enum machine_mode mode) +ix86_value_regno (enum machine_mode mode, tree func, tree fntype) { - /* Floating point return values in %st(0). */ - if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_FLOAT_RETURNS_IN_80387) - return FIRST_FLOAT_REG; + gcc_assert (!TARGET_64BIT); + + /* 8-byte vector modes in %mm0. See ix86_return_in_memory for where + we normally prevent this case when mmx is not available. However + some ABIs may require the result to be returned like DImode. */ + if (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 8) + return TARGET_MMX ? FIRST_MMX_REG : 0; + /* 16-byte vector modes in %xmm0. See ix86_return_in_memory for where - we prevent this case when sse is not available. */ + we prevent this case when sse is not available. However some ABIs + may require the result to be returned like integer TImode. */ if (mode == TImode || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16)) - return FIRST_SSE_REG; - /* Everything else in %eax. */ - return 0; + return TARGET_SSE ? FIRST_SSE_REG : 0; + + /* Decimal floating point values can go in %eax, unlike other float modes. */ + if (DECIMAL_FLOAT_MODE_P (mode)) + return 0; + + /* Most things go in %eax, except (unless -mno-fp-ret-in-387) fp values. */ + if (!SCALAR_FLOAT_MODE_P (mode) || !TARGET_FLOAT_RETURNS_IN_80387) + return 0; + + /* Floating point return values in %st(0), except for local functions when + SSE math is enabled or for functions with sseregparm attribute. */ + if ((func || fntype) + && (mode == SFmode || mode == DFmode)) + { + int sse_level = ix86_function_sseregparm (fntype, func); + if ((sse_level >= 1 && mode == SFmode) + || (sse_level == 2 && mode == DFmode)) + return FIRST_SSE_REG; + } + + return FIRST_FLOAT_REG; } /* Create the va_list data type. */ @@ -2986,6 +4073,9 @@ ix86_build_builtin_va_list (void) f_sav = build_decl (FIELD_DECL, get_identifier ("reg_save_area"), ptr_type_node); + va_list_gpr_counter_field = f_gpr; + va_list_fpr_counter_field = f_fpr; + DECL_FIELD_CONTEXT (f_gpr) = record; DECL_FIELD_CONTEXT (f_fpr) = record; DECL_FIELD_CONTEXT (f_ovf) = record; @@ -3004,21 +4094,9 @@ ix86_build_builtin_va_list (void) return build_array_type (record, build_index_type (size_zero_node)); } -/* Perform any needed actions needed for a function that is receiving a - variable number of arguments. +/* Worker function for TARGET_SETUP_INCOMING_VARARGS. */ - CUM is as above. - - MODE and TYPE are the mode and type of the current parameter. - - PRETEND_SIZE is a variable that should be set to the amount of stack - that must be pushed by the prolog to pretend that our caller pushed - it. - - Normally, this macro will push all remaining incoming registers on the - stack and set PRETEND_SIZE to the length of the registers pushed. */ - -void +static void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) @@ -3037,6 +4115,9 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (!TARGET_64BIT) return; + if (! cfun->va_list_gpr_size && ! cfun->va_list_fpr_size) + return; + /* Indicate to allocate space on the stack for varargs save area. */ ix86_save_varrargs_registers = 1; @@ -3058,16 +4139,20 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, set = get_varargs_alias_set (); - for (i = next_cum.regno; i < ix86_regparm; i++) + for (i = next_cum.regno; + i < ix86_regparm + && i < next_cum.regno + cfun->va_list_gpr_size / UNITS_PER_WORD; + i++) { mem = gen_rtx_MEM (Pmode, plus_constant (save_area, i * UNITS_PER_WORD)); + MEM_NOTRAP_P (mem) = 1; set_mem_alias_set (mem, set); emit_move_insn (mem, gen_rtx_REG (Pmode, x86_64_int_parameter_registers[i])); } - if (next_cum.sse_nregs) + if (next_cum.sse_nregs && cfun->va_list_fpr_size) { /* Now emit code to save SSE registers. The AX parameter contains number of SSE parameter registers used to call this function. We use @@ -3104,6 +4189,7 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, plus_constant (save_area, 8 * REGPARM_MAX + 127))); mem = gen_rtx_MEM (BLKmode, plus_constant (tmp_reg, -127)); + MEM_NOTRAP_P (mem) = 1; set_mem_alias_set (mem, set); set_mem_align (mem, BITS_PER_WORD); @@ -3122,6 +4208,7 @@ ix86_va_start (tree valist, rtx nextarg) HOST_WIDE_INT words, n_gpr, n_fpr; tree f_gpr, f_fpr, f_ovf, f_sav; tree gpr, fpr, ovf, sav, t; + tree type; /* Only 64bit target needs something special. */ if (!TARGET_64BIT) @@ -3136,10 +4223,10 @@ ix86_va_start (tree valist, rtx nextarg) f_sav = TREE_CHAIN (f_ovf); valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); /* Count number of gp and fp argument registers used. */ words = current_function_args_info.words; @@ -3150,96 +4237,106 @@ ix86_va_start (tree valist, rtx nextarg) fprintf (stderr, "va_start: words = %d, n_gpr = %d, n_fpr = %d\n", (int) words, (int) n_gpr, (int) n_fpr); - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, - build_int_2 (n_gpr * 8, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size) + { + type = TREE_TYPE (gpr); + t = build2 (MODIFY_EXPR, type, gpr, + build_int_cst (type, n_gpr * 8)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, - build_int_2 (n_fpr * 16 + 8*REGPARM_MAX, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_fpr_size) + { + type = TREE_TYPE (fpr); + t = build2 (MODIFY_EXPR, type, fpr, + build_int_cst (type, n_fpr * 16 + 8*REGPARM_MAX)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the overflow area. */ - t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); + type = TREE_TYPE (ovf); + t = make_tree (type, virtual_incoming_args_rtx); if (words != 0) - t = build (PLUS_EXPR, TREE_TYPE (ovf), t, - build_int_2 (words * UNITS_PER_WORD, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); + t = build2 (PLUS_EXPR, type, t, + build_int_cst (type, words * UNITS_PER_WORD)); + t = build2 (MODIFY_EXPR, type, ovf, t); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - /* Find the register save area. - Prologue of the function save it right above stack frame. */ - t = make_tree (TREE_TYPE (sav), frame_pointer_rtx); - t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size || cfun->va_list_fpr_size) + { + /* Find the register save area. + Prologue of the function save it right above stack frame. */ + type = TREE_TYPE (sav); + t = make_tree (type, frame_pointer_rtx); + t = build2 (MODIFY_EXPR, type, sav, t); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } } /* Implement va_arg. */ -rtx -ix86_va_arg (tree valist, tree type) + +tree +ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { static const int intreg[6] = { 0, 1, 2, 3, 4, 5 }; tree f_gpr, f_fpr, f_ovf, f_sav; tree gpr, fpr, ovf, sav, t; int size, rsize; - rtx lab_false, lab_over = NULL_RTX; - rtx addr_rtx, r; + tree lab_false, lab_over = NULL_TREE; + tree addr, t2; rtx container; int indirect_p = 0; + tree ptrtype; + enum machine_mode nat_mode; /* Only 64bit target needs something special. */ if (!TARGET_64BIT) - { - return std_expand_builtin_va_arg (valist, type); - } + return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node)); f_fpr = TREE_CHAIN (f_gpr); f_ovf = TREE_CHAIN (f_fpr); f_sav = TREE_CHAIN (f_ovf); - valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + valist = build_va_arg_indirect_ref (valist); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); + indirect_p = pass_by_reference (NULL, TYPE_MODE (type), type, false); + if (indirect_p) + type = build_pointer_type (type); size = int_size_in_bytes (type); - if (size == -1) - { - /* Passed by reference. */ - indirect_p = 1; - type = build_pointer_type (type); - size = int_size_in_bytes (type); - } rsize = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; - container = construct_container (TYPE_MODE (type), type, 0, + nat_mode = type_natural_mode (type); + container = construct_container (nat_mode, TYPE_MODE (type), type, 0, REGPARM_MAX, SSE_REGPARM_MAX, intreg, 0); - /* - * Pull the value out of the saved registers ... - */ - addr_rtx = gen_reg_rtx (Pmode); + /* Pull the value out of the saved registers. */ + + addr = create_tmp_var (ptr_type_node, "addr"); + DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); if (container) { - rtx int_addr_rtx, sse_addr_rtx; int needed_intregs, needed_sseregs; - int need_temp; + bool need_temp; + tree int_addr, sse_addr; - lab_over = gen_label_rtx (); - lab_false = gen_label_rtx (); + lab_false = create_artificial_label (); + lab_over = create_artificial_label (); - examine_argument (TYPE_MODE (type), type, 0, - &needed_intregs, &needed_sseregs); + examine_argument (nat_mode, type, 0, &needed_intregs, &needed_sseregs); - - need_temp = ((needed_intregs && TYPE_ALIGN (type) > 64) - || TYPE_ALIGN (type) > 128); + need_temp = (!REG_P (container) + && ((needed_intregs && TYPE_ALIGN (type) > 64) + || TYPE_ALIGN (type) > 128)); /* In case we are passing structure, verify that it is consecutive block on the register save area. If not we need to do moves. */ @@ -3273,230 +4370,161 @@ ix86_va_arg (tree valist, tree type) } if (!need_temp) { - int_addr_rtx = addr_rtx; - sse_addr_rtx = addr_rtx; + int_addr = addr; + sse_addr = addr; } else { - int_addr_rtx = gen_reg_rtx (Pmode); - sse_addr_rtx = gen_reg_rtx (Pmode); + int_addr = create_tmp_var (ptr_type_node, "int_addr"); + DECL_POINTER_ALIAS_SET (int_addr) = get_varargs_alias_set (); + sse_addr = create_tmp_var (ptr_type_node, "sse_addr"); + DECL_POINTER_ALIAS_SET (sse_addr) = get_varargs_alias_set (); } + /* First ensure that we fit completely in registers. */ if (needed_intregs) { - emit_cmp_and_jump_insns (expand_expr - (gpr, NULL_RTX, SImode, EXPAND_NORMAL), - GEN_INT ((REGPARM_MAX - needed_intregs + - 1) * 8), GE, const1_rtx, SImode, - 1, lab_false); + t = build_int_cst (TREE_TYPE (gpr), + (REGPARM_MAX - needed_intregs + 1) * 8); + t = build2 (GE_EXPR, boolean_type_node, gpr, t); + t2 = build1 (GOTO_EXPR, void_type_node, lab_false); + t = build3 (COND_EXPR, void_type_node, t, t2, NULL_TREE); + gimplify_and_add (t, pre_p); } if (needed_sseregs) { - emit_cmp_and_jump_insns (expand_expr - (fpr, NULL_RTX, SImode, EXPAND_NORMAL), - GEN_INT ((SSE_REGPARM_MAX - - needed_sseregs + 1) * 16 + - REGPARM_MAX * 8), GE, const1_rtx, - SImode, 1, lab_false); + t = build_int_cst (TREE_TYPE (fpr), + (SSE_REGPARM_MAX - needed_sseregs + 1) * 16 + + REGPARM_MAX * 8); + t = build2 (GE_EXPR, boolean_type_node, fpr, t); + t2 = build1 (GOTO_EXPR, void_type_node, lab_false); + t = build3 (COND_EXPR, void_type_node, t, t2, NULL_TREE); + gimplify_and_add (t, pre_p); } /* Compute index to start of area used for integer regs. */ if (needed_intregs) { - t = build (PLUS_EXPR, ptr_type_node, sav, gpr); - r = expand_expr (t, int_addr_rtx, Pmode, EXPAND_NORMAL); - if (r != int_addr_rtx) - emit_move_insn (int_addr_rtx, r); + /* int_addr = gpr + sav; */ + t = fold_convert (ptr_type_node, gpr); + t = build2 (PLUS_EXPR, ptr_type_node, sav, t); + t = build2 (MODIFY_EXPR, void_type_node, int_addr, t); + gimplify_and_add (t, pre_p); } if (needed_sseregs) { - t = build (PLUS_EXPR, ptr_type_node, sav, fpr); - r = expand_expr (t, sse_addr_rtx, Pmode, EXPAND_NORMAL); - if (r != sse_addr_rtx) - emit_move_insn (sse_addr_rtx, r); + /* sse_addr = fpr + sav; */ + t = fold_convert (ptr_type_node, fpr); + t = build2 (PLUS_EXPR, ptr_type_node, sav, t); + t = build2 (MODIFY_EXPR, void_type_node, sse_addr, t); + gimplify_and_add (t, pre_p); } if (need_temp) { int i; - rtx mem; - rtx x; + tree temp = create_tmp_var (type, "va_arg_tmp"); - /* Never use the memory itself, as it has the alias set. */ - x = XEXP (assign_temp (type, 0, 1, 0), 0); - mem = gen_rtx_MEM (BLKmode, x); - force_operand (x, addr_rtx); - set_mem_alias_set (mem, get_varargs_alias_set ()); - set_mem_align (mem, BITS_PER_UNIT); + /* addr = &temp; */ + t = build1 (ADDR_EXPR, build_pointer_type (type), temp); + t = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (t, pre_p); for (i = 0; i < XVECLEN (container, 0); i++) { rtx slot = XVECEXP (container, 0, i); rtx reg = XEXP (slot, 0); enum machine_mode mode = GET_MODE (reg); - rtx src_addr; - rtx src_mem; + tree piece_type = lang_hooks.types.type_for_mode (mode, 1); + tree addr_type = build_pointer_type (piece_type); + tree src_addr, src; int src_offset; - rtx dest_mem; + tree dest_addr, dest; if (SSE_REGNO_P (REGNO (reg))) { - src_addr = sse_addr_rtx; + src_addr = sse_addr; src_offset = (REGNO (reg) - FIRST_SSE_REG) * 16; } else { - src_addr = int_addr_rtx; + src_addr = int_addr; src_offset = REGNO (reg) * 8; } - src_mem = gen_rtx_MEM (mode, src_addr); - set_mem_alias_set (src_mem, get_varargs_alias_set ()); - src_mem = adjust_address (src_mem, mode, src_offset); - dest_mem = adjust_address (mem, mode, INTVAL (XEXP (slot, 1))); - emit_move_insn (dest_mem, src_mem); + src_addr = fold_convert (addr_type, src_addr); + src_addr = fold (build2 (PLUS_EXPR, addr_type, src_addr, + size_int (src_offset))); + src = build_va_arg_indirect_ref (src_addr); + + dest_addr = fold_convert (addr_type, addr); + dest_addr = fold (build2 (PLUS_EXPR, addr_type, dest_addr, + size_int (INTVAL (XEXP (slot, 1))))); + dest = build_va_arg_indirect_ref (dest_addr); + + t = build2 (MODIFY_EXPR, void_type_node, dest, src); + gimplify_and_add (t, pre_p); } } if (needed_intregs) { - t = - build (PLUS_EXPR, TREE_TYPE (gpr), gpr, - build_int_2 (needed_intregs * 8, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr, + build_int_cst (TREE_TYPE (gpr), needed_intregs * 8)); + t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t); + gimplify_and_add (t, pre_p); } if (needed_sseregs) { - t = - build (PLUS_EXPR, TREE_TYPE (fpr), fpr, - build_int_2 (needed_sseregs * 16, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, TREE_TYPE (fpr), fpr, + build_int_cst (TREE_TYPE (fpr), needed_sseregs * 16)); + t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, t); + gimplify_and_add (t, pre_p); } - emit_jump_insn (gen_jump (lab_over)); - emit_barrier (); - emit_label (lab_false); + t = build1 (GOTO_EXPR, void_type_node, lab_over); + gimplify_and_add (t, pre_p); + + t = build1 (LABEL_EXPR, void_type_node, lab_false); + append_to_statement_list (t, pre_p); } /* ... otherwise out of the overflow area. */ /* Care for on-stack alignment if needed. */ - if (FUNCTION_ARG_BOUNDARY (VOIDmode, type) <= 64) + if (FUNCTION_ARG_BOUNDARY (VOIDmode, type) <= 64 + || integer_zerop (TYPE_SIZE (type))) t = ovf; else { HOST_WIDE_INT align = FUNCTION_ARG_BOUNDARY (VOIDmode, type) / 8; - t = build (PLUS_EXPR, TREE_TYPE (ovf), ovf, build_int_2 (align - 1, 0)); - t = build (BIT_AND_EXPR, TREE_TYPE (t), t, build_int_2 (-align, -1)); + t = build2 (PLUS_EXPR, TREE_TYPE (ovf), ovf, + build_int_cst (TREE_TYPE (ovf), align - 1)); + t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, + build_int_cst (TREE_TYPE (t), -align)); } - t = save_expr (t); + gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); - r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); - if (r != addr_rtx) - emit_move_insn (addr_rtx, r); + t2 = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (t2, pre_p); - t = - build (PLUS_EXPR, TREE_TYPE (t), t, - build_int_2 (rsize * UNITS_PER_WORD, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, TREE_TYPE (t), t, + build_int_cst (TREE_TYPE (t), rsize * UNITS_PER_WORD)); + t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); + gimplify_and_add (t, pre_p); if (container) - emit_label (lab_over); - - if (indirect_p) { - r = gen_rtx_MEM (Pmode, addr_rtx); - set_mem_alias_set (r, get_varargs_alias_set ()); - emit_move_insn (addr_rtx, r); + t = build1 (LABEL_EXPR, void_type_node, lab_over); + append_to_statement_list (t, pre_p); } - return addr_rtx; + ptrtype = build_pointer_type (type); + addr = fold_convert (ptrtype, addr); + + if (indirect_p) + addr = build_va_arg_indirect_ref (addr); + return build_va_arg_indirect_ref (addr); } -/* Return nonzero if OP is either a i387 or SSE fp register. */ -int -any_fp_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ANY_FP_REG_P (op); -} - -/* Return nonzero if OP is an i387 fp register. */ -int -fp_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return FP_REG_P (op); -} - -/* Return nonzero if OP is a non-fp register_operand. */ -int -register_and_not_any_fp_reg_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) && !ANY_FP_REG_P (op); -} - -/* Return nonzero if OP is a register operand other than an - i387 fp register. */ -int -register_and_not_fp_reg_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) && !FP_REG_P (op); -} - -/* Return nonzero if OP is general operand representable on x86_64. */ - -int -x86_64_general_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT) - return general_operand (op, mode); - if (nonimmediate_operand (op, mode)) - return 1; - return x86_64_sign_extended_value (op); -} - -/* Return nonzero if OP is general operand representable on x86_64 - as either sign extended or zero extended constant. */ - -int -x86_64_szext_general_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT) - return general_operand (op, mode); - if (nonimmediate_operand (op, mode)) - return 1; - return x86_64_sign_extended_value (op) || x86_64_zero_extended_value (op); -} - -/* Return nonzero if OP is nonmemory operand representable on x86_64. */ - -int -x86_64_nonmemory_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT) - return nonmemory_operand (op, mode); - if (register_operand (op, mode)) - return 1; - return x86_64_sign_extended_value (op); -} - -/* Return nonzero if OP is nonmemory operand acceptable by movabs patterns. */ - -int -x86_64_movabs_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT || !flag_pic) - return nonmemory_operand (op, mode); - if (register_operand (op, mode) || x86_64_sign_extended_value (op)) - return 1; - if (CONSTANT_P (op) && !symbolic_reference_mentioned_p (op)) - return 1; - return 0; -} - /* Return nonzero if OPNUM's MEM should be matched in movabs* patterns. */ @@ -3508,859 +4536,13 @@ ix86_check_movabs (rtx insn, int opnum) set = PATTERN (insn); if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - if (GET_CODE (set) != SET) - abort (); + gcc_assert (GET_CODE (set) == SET); mem = XEXP (set, opnum); while (GET_CODE (mem) == SUBREG) mem = SUBREG_REG (mem); - if (GET_CODE (mem) != MEM) - abort (); + gcc_assert (GET_CODE (mem) == MEM); return (volatile_ok || !MEM_VOLATILE_P (mem)); } - -/* Return nonzero if OP is nonmemory operand representable on x86_64. */ - -int -x86_64_szext_nonmemory_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT) - return nonmemory_operand (op, mode); - if (register_operand (op, mode)) - return 1; - return x86_64_sign_extended_value (op) || x86_64_zero_extended_value (op); -} - -/* Return nonzero if OP is immediate operand representable on x86_64. */ - -int -x86_64_immediate_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_64BIT) - return immediate_operand (op, mode); - return x86_64_sign_extended_value (op); -} - -/* Return nonzero if OP is immediate operand representable on x86_64. */ - -int -x86_64_zext_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return x86_64_zero_extended_value (op); -} - -/* Return nonzero if OP is CONST_INT >= 1 and <= 31 (a valid operand - for shift & compare patterns, as shifting by 0 does not change flags), - else return zero. */ - -int -const_int_1_31_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 1 && INTVAL (op) <= 31); -} - -/* Returns 1 if OP is either a symbol reference or a sum of a symbol - reference and a constant. */ - -int -symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF: - case LABEL_REF: - return 1; - - case CONST: - op = XEXP (op, 0); - if (GET_CODE (op) == SYMBOL_REF - || GET_CODE (op) == LABEL_REF - || (GET_CODE (op) == UNSPEC - && (XINT (op, 1) == UNSPEC_GOT - || XINT (op, 1) == UNSPEC_GOTOFF - || XINT (op, 1) == UNSPEC_GOTPCREL))) - return 1; - if (GET_CODE (op) != PLUS - || GET_CODE (XEXP (op, 1)) != CONST_INT) - return 0; - - op = XEXP (op, 0); - if (GET_CODE (op) == SYMBOL_REF - || GET_CODE (op) == LABEL_REF) - return 1; - /* Only @GOTOFF gets offsets. */ - if (GET_CODE (op) != UNSPEC - || XINT (op, 1) != UNSPEC_GOTOFF) - return 0; - - op = XVECEXP (op, 0, 0); - if (GET_CODE (op) == SYMBOL_REF - || GET_CODE (op) == LABEL_REF) - return 1; - return 0; - - default: - return 0; - } -} - -/* Return true if the operand contains a @GOT or @GOTOFF reference. */ - -int -pic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST) - return 0; - op = XEXP (op, 0); - if (TARGET_64BIT) - { - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_GOTPCREL) - return 1; - if (GET_CODE (op) == PLUS - && GET_CODE (XEXP (op, 0)) == UNSPEC - && XINT (XEXP (op, 0), 1) == UNSPEC_GOTPCREL) - return 1; - } - else - { - if (GET_CODE (op) == UNSPEC) - return 1; - if (GET_CODE (op) != PLUS - || GET_CODE (XEXP (op, 1)) != CONST_INT) - return 0; - op = XEXP (op, 0); - if (GET_CODE (op) == UNSPEC) - return 1; - } - return 0; -} - -/* Return true if OP is a symbolic operand that resolves locally. */ - -static int -local_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST - && GET_CODE (XEXP (op, 0)) == PLUS - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT) - op = XEXP (XEXP (op, 0), 0); - - if (GET_CODE (op) == LABEL_REF) - return 1; - - if (GET_CODE (op) != SYMBOL_REF) - return 0; - - if (SYMBOL_REF_LOCAL_P (op)) - return 1; - - /* There is, however, a not insubstantial body of code in the rest of - the compiler that assumes it can just stick the results of - ASM_GENERATE_INTERNAL_LABEL in a symbol_ref and have done. */ - /* ??? This is a hack. Should update the body of the compiler to - always create a DECL an invoke targetm.encode_section_info. */ - if (strncmp (XSTR (op, 0), internal_label_prefix, - internal_label_prefix_len) == 0) - return 1; - - return 0; -} - -/* Test for various thread-local symbols. */ - -int -tls_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != SYMBOL_REF) - return 0; - return SYMBOL_REF_TLS_MODEL (op); -} - -static inline int -tls_symbolic_operand_1 (rtx op, enum tls_model kind) -{ - if (GET_CODE (op) != SYMBOL_REF) - return 0; - return SYMBOL_REF_TLS_MODEL (op) == kind; -} - -int -global_dynamic_symbolic_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand_1 (op, TLS_MODEL_GLOBAL_DYNAMIC); -} - -int -local_dynamic_symbolic_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_DYNAMIC); -} - -int -initial_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand_1 (op, TLS_MODEL_INITIAL_EXEC); -} - -int -local_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_EXEC); -} - -/* Test for a valid operand for a call instruction. Don't allow the - arg pointer register or virtual regs since they may decay into - reg + const, which the patterns can't handle. */ - -int -call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* Disallow indirect through a virtual register. This leads to - compiler aborts when trying to eliminate them. */ - if (GET_CODE (op) == REG - && (op == arg_pointer_rtx - || op == frame_pointer_rtx - || (REGNO (op) >= FIRST_PSEUDO_REGISTER - && REGNO (op) <= LAST_VIRTUAL_REGISTER))) - return 0; - - /* Disallow `call 1234'. Due to varying assembler lameness this - gets either rejected or translated to `call .+1234'. */ - if (GET_CODE (op) == CONST_INT) - return 0; - - /* Explicitly allow SYMBOL_REF even if pic. */ - if (GET_CODE (op) == SYMBOL_REF) - return 1; - - /* Otherwise we can allow any general_operand in the address. */ - return general_operand (op, Pmode); -} - -/* Test for a valid operand for a call instruction. Don't allow the - arg pointer register or virtual regs since they may decay into - reg + const, which the patterns can't handle. */ - -int -sibcall_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* Disallow indirect through a virtual register. This leads to - compiler aborts when trying to eliminate them. */ - if (GET_CODE (op) == REG - && (op == arg_pointer_rtx - || op == frame_pointer_rtx - || (REGNO (op) >= FIRST_PSEUDO_REGISTER - && REGNO (op) <= LAST_VIRTUAL_REGISTER))) - return 0; - - /* Explicitly allow SYMBOL_REF even if pic. */ - if (GET_CODE (op) == SYMBOL_REF) - return 1; - - /* Otherwise we can only allow register operands. */ - return register_operand (op, Pmode); -} - -int -constant_call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST - && GET_CODE (XEXP (op, 0)) == PLUS - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT) - op = XEXP (XEXP (op, 0), 0); - return GET_CODE (op) == SYMBOL_REF; -} - -/* Match exactly zero and one. */ - -int -const0_operand (rtx op, enum machine_mode mode) -{ - return op == CONST0_RTX (mode); -} - -int -const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return op == const1_rtx; -} - -/* Match 2, 4, or 8. Used for leal multiplicands. */ - -int -const248_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) == 2 || INTVAL (op) == 4 || INTVAL (op) == 8)); -} - -int -const_0_to_3_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 4); -} - -int -const_0_to_7_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 8); -} - -int -const_0_to_15_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 16); -} - -int -const_0_to_255_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 256); -} - - -/* True if this is a constant appropriate for an increment or decrement. */ - -int -incdec_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* On Pentium4, the inc and dec operations causes extra dependency on flag - registers, since carry flag is not set. */ - if (TARGET_PENTIUM4 && !optimize_size) - return 0; - return op == const1_rtx || op == constm1_rtx; -} - -/* Return nonzero if OP is acceptable as operand of DImode shift - expander. */ - -int -shiftdi_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (TARGET_64BIT) - return nonimmediate_operand (op, mode); - else - return register_operand (op, mode); -} - -/* Return false if this is the stack pointer, or any other fake - register eliminable to the stack pointer. Otherwise, this is - a register operand. - - This is used to prevent esp from being used as an index reg. - Which would only happen in pathological cases. */ - -int -reg_no_sp_operand (rtx op, enum machine_mode mode) -{ - rtx t = op; - if (GET_CODE (t) == SUBREG) - t = SUBREG_REG (t); - if (t == stack_pointer_rtx || t == arg_pointer_rtx || t == frame_pointer_rtx) - return 0; - - return register_operand (op, mode); -} - -int -mmx_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return MMX_REG_P (op); -} - -/* Return false if this is any eliminable register. Otherwise - general_operand. */ - -int -general_no_elim_operand (rtx op, enum machine_mode mode) -{ - rtx t = op; - if (GET_CODE (t) == SUBREG) - t = SUBREG_REG (t); - if (t == arg_pointer_rtx || t == frame_pointer_rtx - || t == virtual_incoming_args_rtx || t == virtual_stack_vars_rtx - || t == virtual_stack_dynamic_rtx) - return 0; - if (REG_P (t) - && REGNO (t) >= FIRST_VIRTUAL_REGISTER - && REGNO (t) <= LAST_VIRTUAL_REGISTER) - return 0; - - return general_operand (op, mode); -} - -/* Return false if this is any eliminable register. Otherwise - register_operand or const_int. */ - -int -nonmemory_no_elim_operand (rtx op, enum machine_mode mode) -{ - rtx t = op; - if (GET_CODE (t) == SUBREG) - t = SUBREG_REG (t); - if (t == arg_pointer_rtx || t == frame_pointer_rtx - || t == virtual_incoming_args_rtx || t == virtual_stack_vars_rtx - || t == virtual_stack_dynamic_rtx) - return 0; - - return GET_CODE (op) == CONST_INT || register_operand (op, mode); -} - -/* Return false if this is any eliminable register or stack register, - otherwise work like register_operand. */ - -int -index_register_operand (rtx op, enum machine_mode mode) -{ - rtx t = op; - if (GET_CODE (t) == SUBREG) - t = SUBREG_REG (t); - if (!REG_P (t)) - return 0; - if (t == arg_pointer_rtx - || t == frame_pointer_rtx - || t == virtual_incoming_args_rtx - || t == virtual_stack_vars_rtx - || t == virtual_stack_dynamic_rtx - || REGNO (t) == STACK_POINTER_REGNUM) - return 0; - - return general_operand (op, mode); -} - -/* Return true if op is a Q_REGS class register. */ - -int -q_regs_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - return ANY_QI_REG_P (op); -} - -/* Return true if op is an flags register. */ - -int -flags_reg_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - return REG_P (op) && REGNO (op) == FLAGS_REG && GET_MODE (op) != VOIDmode; -} - -/* Return true if op is a NON_Q_REGS class register. */ - -int -non_q_regs_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - return NON_QI_REG_P (op); -} - -int -zero_extended_scalar_load_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - unsigned n_elts; - if (GET_CODE (op) != MEM) - return 0; - op = maybe_get_pool_constant (op); - if (!op) - return 0; - if (GET_CODE (op) != CONST_VECTOR) - return 0; - n_elts = - (GET_MODE_SIZE (GET_MODE (op)) / - GET_MODE_SIZE (GET_MODE_INNER (GET_MODE (op)))); - for (n_elts--; n_elts > 0; n_elts--) - { - rtx elt = CONST_VECTOR_ELT (op, n_elts); - if (elt != CONST0_RTX (GET_MODE_INNER (GET_MODE (op)))) - return 0; - } - return 1; -} - -/* Return 1 when OP is operand acceptable for standard SSE move. */ -int -vector_move_operand (rtx op, enum machine_mode mode) -{ - if (nonimmediate_operand (op, mode)) - return 1; - if (GET_MODE (op) != mode && mode != VOIDmode) - return 0; - return (op == CONST0_RTX (GET_MODE (op))); -} - -/* Return true if op if a valid address, and does not contain - a segment override. */ - -int -no_seg_address_operand (rtx op, enum machine_mode mode) -{ - struct ix86_address parts; - - if (! address_operand (op, mode)) - return 0; - - if (! ix86_decompose_address (op, &parts)) - abort (); - - return parts.seg == SEG_DEFAULT; -} - -/* Return 1 if OP is a comparison that can be used in the CMPSS/CMPPS - insns. */ -int -sse_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - switch (code) - { - /* Operations supported directly. */ - case EQ: - case LT: - case LE: - case UNORDERED: - case NE: - case UNGE: - case UNGT: - case ORDERED: - return 1; - /* These are equivalent to ones above in non-IEEE comparisons. */ - case UNEQ: - case UNLT: - case UNLE: - case LTGT: - case GE: - case GT: - return !TARGET_IEEE_FP; - default: - return 0; - } -} -/* Return 1 if OP is a valid comparison operator in valid mode. */ -int -ix86_comparison_operator (rtx op, enum machine_mode mode) -{ - enum machine_mode inmode; - enum rtx_code code = GET_CODE (op); - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - if (GET_RTX_CLASS (code) != '<') - return 0; - inmode = GET_MODE (XEXP (op, 0)); - - if (inmode == CCFPmode || inmode == CCFPUmode) - { - enum rtx_code second_code, bypass_code; - ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); - return (bypass_code == NIL && second_code == NIL); - } - switch (code) - { - case EQ: case NE: - return 1; - case LT: case GE: - if (inmode == CCmode || inmode == CCGCmode - || inmode == CCGOCmode || inmode == CCNOmode) - return 1; - return 0; - case LTU: case GTU: case LEU: case ORDERED: case UNORDERED: case GEU: - if (inmode == CCmode) - return 1; - return 0; - case GT: case LE: - if (inmode == CCmode || inmode == CCGCmode || inmode == CCNOmode) - return 1; - return 0; - default: - return 0; - } -} - -/* Return 1 if OP is a valid comparison operator testing carry flag - to be set. */ -int -ix86_carry_flag_operator (rtx op, enum machine_mode mode) -{ - enum machine_mode inmode; - enum rtx_code code = GET_CODE (op); - - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - if (GET_RTX_CLASS (code) != '<') - return 0; - inmode = GET_MODE (XEXP (op, 0)); - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != 17 - || XEXP (op, 1) != const0_rtx) - return 0; - - if (inmode == CCFPmode || inmode == CCFPUmode) - { - enum rtx_code second_code, bypass_code; - - ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); - if (bypass_code != NIL || second_code != NIL) - return 0; - code = ix86_fp_compare_code_to_integer (code); - } - else if (inmode != CCmode) - return 0; - return code == LTU; -} - -/* Return 1 if OP is a comparison operator that can be issued by fcmov. */ - -int -fcmov_comparison_operator (rtx op, enum machine_mode mode) -{ - enum machine_mode inmode; - enum rtx_code code = GET_CODE (op); - - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - if (GET_RTX_CLASS (code) != '<') - return 0; - inmode = GET_MODE (XEXP (op, 0)); - if (inmode == CCFPmode || inmode == CCFPUmode) - { - enum rtx_code second_code, bypass_code; - - ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); - if (bypass_code != NIL || second_code != NIL) - return 0; - code = ix86_fp_compare_code_to_integer (code); - } - /* i387 supports just limited amount of conditional codes. */ - switch (code) - { - case LTU: case GTU: case LEU: case GEU: - if (inmode == CCmode || inmode == CCFPmode || inmode == CCFPUmode) - return 1; - return 0; - case ORDERED: case UNORDERED: - case EQ: case NE: - return 1; - default: - return 0; - } -} - -/* Return 1 if OP is a binary operator that can be promoted to wider mode. */ - -int -promotable_binary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case MULT: - /* Modern CPUs have same latency for HImode and SImode multiply, - but 386 and 486 do HImode multiply faster. */ - return ix86_tune > PROCESSOR_I486; - case PLUS: - case AND: - case IOR: - case XOR: - case ASHIFT: - return 1; - default: - return 0; - } -} - -/* Nearly general operand, but accept any const_double, since we wish - to be able to drop them into memory rather than have them get pulled - into registers. */ - -int -cmp_fp_expander_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (GET_CODE (op) == CONST_DOUBLE) - return 1; - return general_operand (op, mode); -} - -/* Match an SI or HImode register for a zero_extract. */ - -int -ext_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int regno; - if ((!TARGET_64BIT || GET_MODE (op) != DImode) - && GET_MODE (op) != SImode && GET_MODE (op) != HImode) - return 0; - - if (!register_operand (op, VOIDmode)) - return 0; - - /* Be careful to accept only registers having upper parts. */ - regno = REG_P (op) ? REGNO (op) : REGNO (SUBREG_REG (op)); - return (regno > LAST_VIRTUAL_REGISTER || regno < 4); -} - -/* Return 1 if this is a valid binary floating-point operation. - OP is the expression matched, and MODE is its mode. */ - -int -binary_fp_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - switch (GET_CODE (op)) - { - case PLUS: - case MINUS: - case MULT: - case DIV: - return GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT; - - default: - return 0; - } -} - -int -mult_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == MULT; -} - -int -div_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == DIV; -} - -int -arith_or_logical_operator (rtx op, enum machine_mode mode) -{ - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (GET_RTX_CLASS (GET_CODE (op)) == 'c' - || GET_RTX_CLASS (GET_CODE (op)) == '2')); -} - -/* Returns 1 if OP is memory operand with a displacement. */ - -int -memory_displacement_operand (rtx op, enum machine_mode mode) -{ - struct ix86_address parts; - - if (! memory_operand (op, mode)) - return 0; - - if (! ix86_decompose_address (XEXP (op, 0), &parts)) - abort (); - - return parts.disp != NULL_RTX; -} - -/* To avoid problems when jump re-emits comparisons like testqi_ext_ccno_0, - re-recognize the operand to avoid a copy_to_mode_reg that will fail. - - ??? It seems likely that this will only work because cmpsi is an - expander, and no actual insns use this. */ - -int -cmpsi_operand (rtx op, enum machine_mode mode) -{ - if (nonimmediate_operand (op, mode)) - return 1; - - if (GET_CODE (op) == AND - && GET_MODE (op) == SImode - && GET_CODE (XEXP (op, 0)) == ZERO_EXTRACT - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (op, 0), 2)) == CONST_INT - && INTVAL (XEXP (XEXP (op, 0), 1)) == 8 - && INTVAL (XEXP (XEXP (op, 0), 2)) == 8 - && GET_CODE (XEXP (op, 1)) == CONST_INT) - return 1; - - return 0; -} - -/* Returns 1 if OP is memory operand that can not be represented by the - modRM array. */ - -int -long_memory_operand (rtx op, enum machine_mode mode) -{ - if (! memory_operand (op, mode)) - return 0; - - return memory_address_length (op) != 0; -} - -/* Return nonzero if the rtx is known aligned. */ - -int -aligned_operand (rtx op, enum machine_mode mode) -{ - struct ix86_address parts; - - if (!general_operand (op, mode)) - return 0; - - /* Registers and immediate operands are always "aligned". */ - if (GET_CODE (op) != MEM) - return 1; - - /* Don't even try to do any aligned optimizations with volatiles. */ - if (MEM_VOLATILE_P (op)) - return 0; - - op = XEXP (op, 0); - - /* Pushes and pops are only valid on the stack pointer. */ - if (GET_CODE (op) == PRE_DEC - || GET_CODE (op) == POST_INC) - return 1; - - /* Decode the address. */ - if (! ix86_decompose_address (op, &parts)) - abort (); - - /* Look for some component that isn't known to be aligned. */ - if (parts.index) - { - if (parts.scale < 4 - && REGNO_POINTER_ALIGN (REGNO (parts.index)) < 32) - return 0; - } - if (parts.base) - { - if (REGNO_POINTER_ALIGN (REGNO (parts.base)) < 32) - return 0; - } - if (parts.disp) - { - if (GET_CODE (parts.disp) != CONST_INT - || (INTVAL (parts.disp) & 3) != 0) - return 0; - } - - /* Didn't find one -- this must be an aligned address. */ - return 1; -} - -int -compare_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == COMPARE; -} /* Initialize the table of extra 80387 mathematical constants. */ @@ -4402,10 +4584,10 @@ standard_80387_constant_p (rtx x) if (x == CONST1_RTX (GET_MODE (x))) return 2; - /* For XFmode constants, try to find a special 80387 instruction on - those CPUs that benefit from them. */ + /* For XFmode constants, try to find a special 80387 instruction when + optimizing for size or on those CPUs that benefit from them. */ if (GET_MODE (x) == XFmode - && x86_ext_80387_constants & TUNEMASK) + && (optimize_size || x86_ext_80387_constants & TUNEMASK)) { REAL_VALUE_TYPE r; int i; @@ -4444,8 +4626,9 @@ standard_80387_constant_opcode (rtx x) return "fldl2t"; case 7: return "fldpi"; + default: + gcc_unreachable (); } - abort (); } /* Return the CONST_DOUBLE representing the 80387 constant that is @@ -4471,21 +4654,67 @@ standard_80387_constant_rtx (int idx) break; default: - abort (); + gcc_unreachable (); } return CONST_DOUBLE_FROM_REAL_VALUE (ext_80387_constants_table[i], XFmode); } +/* Return 1 if mode is a valid mode for sse. */ +static int +standard_sse_mode_p (enum machine_mode mode) +{ + switch (mode) + { + case V16QImode: + case V8HImode: + case V4SImode: + case V2DImode: + case V4SFmode: + case V2DFmode: + return 1; + + default: + return 0; + } +} + /* Return 1 if X is FP constant we can load to SSE register w/o using memory. */ int standard_sse_constant_p (rtx x) { - if (x == const0_rtx) + enum machine_mode mode = GET_MODE (x); + + if (x == const0_rtx || x == CONST0_RTX (GET_MODE (x))) return 1; - return (x == CONST0_RTX (GET_MODE (x))); + if (vector_all_ones_operand (x, mode) + && standard_sse_mode_p (mode)) + return TARGET_SSE2 ? 2 : -1; + + return 0; +} + +/* Return the opcode of the special instruction to be used to load + the constant X. */ + +const char * +standard_sse_constant_opcode (rtx insn, rtx x) +{ + switch (standard_sse_constant_p (x)) + { + case 1: + if (get_attr_mode (insn) == MODE_V4SF) + return "xorps\t%0, %0"; + else if (get_attr_mode (insn) == MODE_V2DF) + return "xorpd\t%0, %0"; + else + return "pxor\t%0, %0"; + case 2: + return "pcmpeqd\t%0, %0"; + } + gcc_unreachable (); } /* Returns 1 if OP contains a symbol reference */ @@ -4522,24 +4751,13 @@ symbolic_reference_mentioned_p (rtx op) body of a function. Do this only if the epilogue is simple, needing a couple of insns. Prior to reloading, we can't tell how many registers must be saved, so return 0 then. Return 0 if there is no frame - marker to de-allocate. - - If NON_SAVING_SETJMP is defined and true, then it is not possible - for the epilogue to be simple, so return 0. This is a special case - since NON_SAVING_SETJMP will not cause regs_ever_live to change - until final, but jump_optimize may need to know sooner if a - `return' is OK. */ + marker to de-allocate. */ int ix86_can_use_return_insn_p (void) { struct ix86_frame frame; -#ifdef NON_SAVING_SETJMP - if (NON_SAVING_SETJMP && current_function_calls_setjmp) - return 0; -#endif - if (! reload_completed || frame_pointer_needed) return 0; @@ -4553,196 +4771,6 @@ ix86_can_use_return_insn_p (void) return frame.to_allocate == 0 && frame.nregs == 0; } -/* Return 1 if VALUE can be stored in the sign extended immediate field. */ -int -x86_64_sign_extended_value (rtx value) -{ - switch (GET_CODE (value)) - { - /* CONST_DOUBLES never match, since HOST_BITS_PER_WIDE_INT is known - to be at least 32 and this all acceptable constants are - represented as CONST_INT. */ - case CONST_INT: - if (HOST_BITS_PER_WIDE_INT == 32) - return 1; - else - { - HOST_WIDE_INT val = trunc_int_for_mode (INTVAL (value), DImode); - return trunc_int_for_mode (val, SImode) == val; - } - break; - - /* For certain code models, the symbolic references are known to fit. - in CM_SMALL_PIC model we know it fits if it is local to the shared - library. Don't count TLS SYMBOL_REFs here, since they should fit - only if inside of UNSPEC handled below. */ - case SYMBOL_REF: - /* TLS symbols are not constant. */ - if (tls_symbolic_operand (value, Pmode)) - return false; - return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL); - - /* For certain code models, the code is near as well. */ - case LABEL_REF: - return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM - || ix86_cmodel == CM_KERNEL); - - /* We also may accept the offsetted memory references in certain special - cases. */ - case CONST: - if (GET_CODE (XEXP (value, 0)) == UNSPEC) - switch (XINT (XEXP (value, 0), 1)) - { - case UNSPEC_GOTPCREL: - case UNSPEC_DTPOFF: - case UNSPEC_GOTNTPOFF: - case UNSPEC_NTPOFF: - return 1; - default: - break; - } - if (GET_CODE (XEXP (value, 0)) == PLUS) - { - rtx op1 = XEXP (XEXP (value, 0), 0); - rtx op2 = XEXP (XEXP (value, 0), 1); - HOST_WIDE_INT offset; - - if (ix86_cmodel == CM_LARGE) - return 0; - if (GET_CODE (op2) != CONST_INT) - return 0; - offset = trunc_int_for_mode (INTVAL (op2), DImode); - switch (GET_CODE (op1)) - { - case SYMBOL_REF: - /* For CM_SMALL assume that latest object is 16MB before - end of 31bits boundary. We may also accept pretty - large negative constants knowing that all objects are - in the positive half of address space. */ - if (ix86_cmodel == CM_SMALL - && offset < 16*1024*1024 - && trunc_int_for_mode (offset, SImode) == offset) - return 1; - /* For CM_KERNEL we know that all object resist in the - negative half of 32bits address space. We may not - accept negative offsets, since they may be just off - and we may accept pretty large positive ones. */ - if (ix86_cmodel == CM_KERNEL - && offset > 0 - && trunc_int_for_mode (offset, SImode) == offset) - return 1; - break; - case LABEL_REF: - /* These conditions are similar to SYMBOL_REF ones, just the - constraints for code models differ. */ - if ((ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM) - && offset < 16*1024*1024 - && trunc_int_for_mode (offset, SImode) == offset) - return 1; - if (ix86_cmodel == CM_KERNEL - && offset > 0 - && trunc_int_for_mode (offset, SImode) == offset) - return 1; - break; - case UNSPEC: - switch (XINT (op1, 1)) - { - case UNSPEC_DTPOFF: - case UNSPEC_NTPOFF: - if (offset > 0 - && trunc_int_for_mode (offset, SImode) == offset) - return 1; - } - break; - default: - return 0; - } - } - return 0; - default: - return 0; - } -} - -/* Return 1 if VALUE can be stored in the zero extended immediate field. */ -int -x86_64_zero_extended_value (rtx value) -{ - switch (GET_CODE (value)) - { - case CONST_DOUBLE: - if (HOST_BITS_PER_WIDE_INT == 32) - return (GET_MODE (value) == VOIDmode - && !CONST_DOUBLE_HIGH (value)); - else - return 0; - case CONST_INT: - if (HOST_BITS_PER_WIDE_INT == 32) - return INTVAL (value) >= 0; - else - return !(INTVAL (value) & ~(HOST_WIDE_INT) 0xffffffff); - break; - - /* For certain code models, the symbolic references are known to fit. */ - case SYMBOL_REF: - /* TLS symbols are not constant. */ - if (tls_symbolic_operand (value, Pmode)) - return false; - return ix86_cmodel == CM_SMALL; - - /* For certain code models, the code is near as well. */ - case LABEL_REF: - return ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM; - - /* We also may accept the offsetted memory references in certain special - cases. */ - case CONST: - if (GET_CODE (XEXP (value, 0)) == PLUS) - { - rtx op1 = XEXP (XEXP (value, 0), 0); - rtx op2 = XEXP (XEXP (value, 0), 1); - - if (ix86_cmodel == CM_LARGE) - return 0; - switch (GET_CODE (op1)) - { - case SYMBOL_REF: - return 0; - /* For small code model we may accept pretty large positive - offsets, since one bit is available for free. Negative - offsets are limited by the size of NULL pointer area - specified by the ABI. */ - if (ix86_cmodel == CM_SMALL - && GET_CODE (op2) == CONST_INT - && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 - && (trunc_int_for_mode (INTVAL (op2), SImode) - == INTVAL (op2))) - return 1; - /* ??? For the kernel, we may accept adjustment of - -0x10000000, since we know that it will just convert - negative address space to positive, but perhaps this - is not worthwhile. */ - break; - case LABEL_REF: - /* These conditions are similar to SYMBOL_REF ones, just the - constraints for code models differ. */ - if ((ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM) - && GET_CODE (op2) == CONST_INT - && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 - && (trunc_int_for_mode (INTVAL (op2), SImode) - == INTVAL (op2))) - return 1; - break; - default: - return 0; - } - } - return 0; - default: - return 0; - } -} - /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed via the stack pointer) in functions that seem suitable. */ @@ -4764,7 +4792,8 @@ ix86_frame_pointer_required (void) the frame pointer by default. Turn it back on now if we've not got a leaf function. */ if (TARGET_OMIT_LEAF_FRAME_POINTER - && (!current_function_is_leaf)) + && (!current_function_is_leaf + || ix86_current_function_calls_tls_descriptor)) return 1; if (current_function_profile) @@ -4781,7 +4810,7 @@ ix86_setup_frame_addresses (void) cfun->machine->accesses_prev_frame = 1; } -#if defined(HAVE_GAS_HIDDEN) && defined(SUPPORTS_ONE_ONLY) +#if (defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)) || TARGET_MACHO # define USE_HIDDEN_LINKONCE 1 #else # define USE_HIDDEN_LINKONCE 0 @@ -4795,6 +4824,8 @@ static int pic_labels_used; static void get_pc_thunk_name (char name[32], unsigned int regno) { + gcc_assert (!TARGET_64BIT); + if (USE_HIDDEN_LINKONCE) sprintf (name, "__i686.get_pc_thunk.%s", reg_names[regno]); else @@ -4820,6 +4851,19 @@ ix86_file_end (void) get_pc_thunk_name (name, regno); +#if TARGET_MACHO + if (TARGET_MACHO) + { + switch_to_section (darwin_sections[text_coal_section]); + fputs ("\t.weak_definition\t", asm_out_file); + assemble_name (asm_out_file, name); + fputs ("\n\t.private_extern\t", asm_out_file); + assemble_name (asm_out_file, name); + fputs ("\n", asm_out_file); + ASM_OUTPUT_LABEL (asm_out_file, name); + } + else +#endif if (USE_HIDDEN_LINKONCE) { tree decl; @@ -4831,7 +4875,7 @@ ix86_file_end (void) DECL_ONE_ONLY (decl) = 1; (*targetm.asm_out.unique_section) (decl, 0); - named_section (decl, NULL, 0); + switch_to_section (get_named_section (decl, NULL, 0)); (*targetm.asm_out.globalize_label) (asm_out_file, name); fputs ("\t.hidden\t", asm_out_file); @@ -4841,7 +4885,7 @@ ix86_file_end (void) } else { - text_section (); + switch_to_section (text_section); ASM_OUTPUT_LABEL (asm_out_file, name); } @@ -4858,7 +4902,7 @@ ix86_file_end (void) /* Emit code for the SET_GOT patterns. */ const char * -output_set_got (rtx dest) +output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) { rtx xops[3]; @@ -4867,7 +4911,7 @@ output_set_got (rtx dest) if (! TARGET_DEEP_BRANCH_PREDICTION || !flag_pic) { - xops[2] = gen_rtx_LABEL_REF (Pmode, gen_label_rtx ()); + xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ()); if (!flag_pic) output_asm_insn ("mov{l}\t{%2, %0|%0, %2}", xops); @@ -4875,10 +4919,12 @@ output_set_got (rtx dest) output_asm_insn ("call\t%a2", xops); #if TARGET_MACHO - /* Output the "canonical" label name ("Lxx$pb") here too. This - is what will be referred to by the Mach-O PIC subsystem. */ - ASM_OUTPUT_LABEL (asm_out_file, machopic_function_base_name ()); + /* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This + is what will be referenced by the Mach-O PIC subsystem. */ + if (!label) + ASM_OUTPUT_LABEL (asm_out_file, machopic_function_base_name ()); #endif + (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (XEXP (xops[2], 0))); @@ -4894,11 +4940,23 @@ output_set_got (rtx dest) xops[2] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); xops[2] = gen_rtx_MEM (QImode, xops[2]); output_asm_insn ("call\t%X2", xops); + /* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This + is what will be referenced by the Mach-O PIC subsystem. */ +#if TARGET_MACHO + if (!label) + ASM_OUTPUT_LABEL (asm_out_file, machopic_function_base_name ()); + else + targetm.asm_out.internal_label (asm_out_file, "L", + CODE_LABEL_NUMBER (label)); +#endif } + if (TARGET_MACHO) + return ""; + if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION) output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops); - else if (!TARGET_MACHO) + else output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops); return ""; @@ -4922,7 +4980,8 @@ gen_push (rtx arg) static unsigned int ix86_select_alt_pic_regnum (void) { - if (current_function_is_leaf && !current_function_profile) + if (current_function_is_leaf && !current_function_profile + && !ix86_current_function_calls_tls_descriptor) { int i; for (i = 2; i >= 0; --i) @@ -4962,6 +5021,10 @@ ix86_save_reg (unsigned int regno, int maybe_eh_return) } } + if (cfun->machine->force_align_arg_pointer + && regno == REGNO (cfun->machine->force_align_arg_pointer)) + return 1; + return (regs_ever_live[regno] && !call_used_regs[regno] && !fixed_regs[regno] @@ -4998,14 +5061,13 @@ ix86_initial_elimination_offset (int from, int to) return frame.hard_frame_pointer_offset - frame.frame_pointer_offset; else { - if (to != STACK_POINTER_REGNUM) - abort (); - else if (from == ARG_POINTER_REGNUM) + gcc_assert (to == STACK_POINTER_REGNUM); + + if (from == ARG_POINTER_REGNUM) return frame.stack_pointer_offset; - else if (from != FRAME_POINTER_REGNUM) - abort (); - else - return frame.stack_pointer_offset - frame.frame_pointer_offset; + + gcc_assert (from == FRAME_POINTER_REGNUM); + return frame.stack_pointer_offset - frame.frame_pointer_offset; } } @@ -5015,17 +5077,20 @@ static void ix86_compute_frame_layout (struct ix86_frame *frame) { HOST_WIDE_INT total_size; - int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT; + unsigned int stack_alignment_needed; HOST_WIDE_INT offset; - int preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT; + unsigned int preferred_alignment; HOST_WIDE_INT size = get_frame_size (); frame->nregs = ix86_nsaved_regs (); total_size = size; + stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT; + preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT; + /* During reload iteration the amount of registers saved can change. Recompute the value as needed. Do not recompute when amount of registers - didn't change as reload does mutiple calls to the function and does not + didn't change as reload does multiple calls to the function and does not expect the decision to change within single iteration. */ if (!optimize_size && cfun->machine->use_fast_prologue_epilogue_nregs != frame->nregs) @@ -5069,14 +5134,11 @@ ix86_compute_frame_layout (struct ix86_frame *frame) preferred_alignment, since i386 port is the only using those features that may break easily. */ - if (size && !stack_alignment_needed) - abort (); - if (preferred_alignment < STACK_BOUNDARY / BITS_PER_UNIT) - abort (); - if (preferred_alignment > PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) - abort (); - if (stack_alignment_needed > PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) - abort (); + gcc_assert (!size || stack_alignment_needed); + gcc_assert (preferred_alignment >= STACK_BOUNDARY / BITS_PER_UNIT); + gcc_assert (preferred_alignment <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT); + gcc_assert (stack_alignment_needed + <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT); if (stack_alignment_needed < STACK_BOUNDARY / BITS_PER_UNIT) stack_alignment_needed = STACK_BOUNDARY / BITS_PER_UNIT; @@ -5110,7 +5172,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame) expander assumes that last current_function_outgoing_args_size of stack frame are unused. */ if (ACCUMULATE_OUTGOING_ARGS - && (!current_function_is_leaf || current_function_calls_alloca)) + && (!current_function_is_leaf || current_function_calls_alloca + || ix86_current_function_calls_tls_descriptor)) { offset += current_function_outgoing_args_size; frame->outgoing_arguments_size = current_function_outgoing_args_size; @@ -5120,7 +5183,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame) /* Align stack boundary. Only needed if we're calling another function or using alloca. */ - if (!current_function_is_leaf || current_function_calls_alloca) + if (!current_function_is_leaf || current_function_calls_alloca + || ix86_current_function_calls_tls_descriptor) frame->padding2 = ((offset + preferred_alignment - 1) & -preferred_alignment) - offset; else @@ -5141,7 +5205,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame) frame->save_regs_using_mov = false; if (TARGET_RED_ZONE && current_function_sp_is_unchanging - && current_function_is_leaf) + && current_function_is_leaf + && !ix86_current_function_calls_tls_descriptor) { frame->red_zone_size = frame->to_allocate; if (frame->save_regs_using_mov) @@ -5174,10 +5239,10 @@ ix86_compute_frame_layout (struct ix86_frame *frame) static void ix86_emit_save_regs (void) { - int regno; + unsigned int regno; rtx insn; - for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--) + for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0; ) if (ix86_save_reg (regno, true)) { insn = emit_insn (gen_push (gen_rtx_REG (Pmode, regno))); @@ -5190,7 +5255,7 @@ ix86_emit_save_regs (void) static void ix86_emit_save_regs_using_mov (rtx pointer, HOST_WIDE_INT offset) { - int regno; + unsigned int regno; rtx insn; for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) @@ -5226,8 +5291,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style) epilogue and used after the epilogue. ATM indirect sibcall shouldn't be used together with huge frame sizes in one function because of the frame_size check in sibcall.c. */ - if (style == 0) - abort (); + gcc_assert (style); r11 = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 3 /* R11 */); insn = emit_insn (gen_rtx_SET (DImode, r11, offset)); if (style < 0) @@ -5239,6 +5303,64 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style) RTX_FRAME_RELATED_P (insn) = 1; } +/* Handle the TARGET_INTERNAL_ARG_POINTER hook. */ + +static rtx +ix86_internal_arg_pointer (void) +{ + bool has_force_align_arg_pointer = + (0 != lookup_attribute (ix86_force_align_arg_pointer_string, + TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))); + if ((FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN + && DECL_NAME (current_function_decl) + && MAIN_NAME_P (DECL_NAME (current_function_decl)) + && DECL_FILE_SCOPE_P (current_function_decl)) + || ix86_force_align_arg_pointer + || has_force_align_arg_pointer) + { + /* Nested functions can't realign the stack due to a register + conflict. */ + if (DECL_CONTEXT (current_function_decl) + && TREE_CODE (DECL_CONTEXT (current_function_decl)) == FUNCTION_DECL) + { + if (ix86_force_align_arg_pointer) + warning (0, "-mstackrealign ignored for nested functions"); + if (has_force_align_arg_pointer) + error ("%s not supported for nested functions", + ix86_force_align_arg_pointer_string); + return virtual_incoming_args_rtx; + } + cfun->machine->force_align_arg_pointer = gen_rtx_REG (Pmode, 2); + return copy_to_reg (cfun->machine->force_align_arg_pointer); + } + else + return virtual_incoming_args_rtx; +} + +/* Handle the TARGET_DWARF_HANDLE_FRAME_UNSPEC hook. + This is called from dwarf2out.c to emit call frame instructions + for frame-related insns containing UNSPECs and UNSPEC_VOLATILEs. */ +static void +ix86_dwarf_handle_frame_unspec (const char *label, rtx pattern, int index) +{ + rtx unspec = SET_SRC (pattern); + gcc_assert (GET_CODE (unspec) == UNSPEC); + + switch (index) + { + case UNSPEC_REG_SAVE: + dwarf2out_reg_save_reg (label, XVECEXP (unspec, 0, 0), + SET_DEST (pattern)); + break; + case UNSPEC_DEF_CFA: + dwarf2out_def_cfa (label, REGNO (SET_DEST (pattern)), + INTVAL (XVECEXP (unspec, 0, 0))); + break; + default: + gcc_unreachable (); + } +} + /* Expand the prologue into a bunch of separate insns. */ void @@ -5251,6 +5373,52 @@ ix86_expand_prologue (void) ix86_compute_frame_layout (&frame); + if (cfun->machine->force_align_arg_pointer) + { + rtx x, y; + + /* Grab the argument pointer. */ + x = plus_constant (stack_pointer_rtx, 4); + y = cfun->machine->force_align_arg_pointer; + insn = emit_insn (gen_rtx_SET (VOIDmode, y, x)); + RTX_FRAME_RELATED_P (insn) = 1; + + /* The unwind info consists of two parts: install the fafp as the cfa, + and record the fafp as the "save register" of the stack pointer. + The later is there in order that the unwinder can see where it + should restore the stack pointer across the and insn. */ + x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx), UNSPEC_DEF_CFA); + x = gen_rtx_SET (VOIDmode, y, x); + RTX_FRAME_RELATED_P (x) = 1; + y = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, stack_pointer_rtx), + UNSPEC_REG_SAVE); + y = gen_rtx_SET (VOIDmode, cfun->machine->force_align_arg_pointer, y); + RTX_FRAME_RELATED_P (y) = 1; + x = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x, y)); + x = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, x, NULL); + REG_NOTES (insn) = x; + + /* Align the stack. */ + emit_insn (gen_andsi3 (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (-16))); + + /* And here we cheat like madmen with the unwind info. We force the + cfa register back to sp+4, which is exactly what it was at the + start of the function. Re-pushing the return address results in + the return at the same spot relative to the cfa, and thus is + correct wrt the unwind info. */ + x = cfun->machine->force_align_arg_pointer; + x = gen_frame_mem (Pmode, plus_constant (x, -4)); + insn = emit_insn (gen_push (x)); + RTX_FRAME_RELATED_P (insn) = 1; + + x = GEN_INT (4); + x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, x), UNSPEC_DEF_CFA); + x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); + x = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, x, NULL); + REG_NOTES (insn) = x; + } + /* Note: AT&T enter does NOT have reversed args. Enter is probably slower on all targets. Also sdb doesn't like it. */ @@ -5287,9 +5455,9 @@ ix86_expand_prologue (void) /* Only valid for Win32. */ rtx eax = gen_rtx_REG (SImode, 0); bool eax_live = ix86_eax_live_at_start_p (); + rtx t; - if (TARGET_64BIT) - abort (); + gcc_assert (!TARGET_64BIT); if (eax_live) { @@ -5297,15 +5465,24 @@ ix86_expand_prologue (void) allocate -= 4; } - insn = emit_move_insn (eax, GEN_INT (allocate)); - RTX_FRAME_RELATED_P (insn) = 1; + emit_move_insn (eax, GEN_INT (allocate)); insn = emit_insn (gen_allocate_stack_worker (eax)); RTX_FRAME_RELATED_P (insn) = 1; + t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-allocate)); + t = gen_rtx_SET (VOIDmode, stack_pointer_rtx, t); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, + t, REG_NOTES (insn)); if (eax_live) { - rtx t = plus_constant (stack_pointer_rtx, allocate); + if (frame_pointer_needed) + t = plus_constant (hard_frame_pointer_rtx, + allocate + - frame.to_allocate + - frame.nregs * UNITS_PER_WORD); + else + t = plus_constant (stack_pointer_rtx, allocate); emit_move_insn (eax, gen_rtx_MEM (SImode, t)); } } @@ -5334,7 +5511,10 @@ ix86_expand_prologue (void) if (pic_reg_used) { - insn = emit_insn (gen_set_got (pic_offset_table_rtx)); + if (TARGET_64BIT) + insn = emit_insn (gen_set_got_rex64 (pic_offset_table_rtx)); + else + insn = emit_insn (gen_set_got (pic_offset_table_rtx)); /* Even with accurate pre-reload life analysis, we can wind up deleting all references to the pic register after reload. @@ -5486,8 +5666,7 @@ ix86_expand_epilogue (int style) pop the registers. */ if (!sp_valid) { - if (!frame_pointer_needed) - abort (); + gcc_assert (frame_pointer_needed); pro_epilogue_adjust_stack (stack_pointer_rtx, hard_frame_pointer_rtx, GEN_INT (offset), style); @@ -5517,6 +5696,13 @@ ix86_expand_epilogue (int style) } } + if (cfun->machine->force_align_arg_pointer) + { + emit_insn (gen_addsi3 (stack_pointer_rtx, + cfun->machine->force_align_arg_pointer, + GEN_INT (-4))); + } + /* Sibcall epilogues don't want a return instruction. */ if (style == 0) return; @@ -5534,8 +5720,7 @@ ix86_expand_epilogue (int style) rtx ecx = gen_rtx_REG (SImode, 2); /* There is no "pascal" calling convention in 64bit ABI. */ - if (TARGET_64BIT) - abort (); + gcc_assert (!TARGET_64BIT); emit_insn (gen_popsi1 (ecx)); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, popc)); @@ -5556,6 +5741,23 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, { if (pic_offset_table_rtx) REGNO (pic_offset_table_rtx) = REAL_PIC_OFFSET_TABLE_REGNUM; +#if TARGET_MACHO + /* Mach-O doesn't support labels at the end of objects, so if + it looks like we might want one, insert a NOP. */ + { + rtx insn = get_last_insn (); + while (insn + && NOTE_P (insn) + && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL) + insn = PREV_INSN (insn); + if (insn + && (LABEL_P (insn) + || (NOTE_P (insn) + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))) + fputs ("\tnop\n", file); + } +#endif + } /* Extract the parts of an RTL expression that is a valid memory address @@ -5563,12 +5765,11 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, grossly off. Return -1 if the address contains ASHIFT, so it is not strictly valid, but still used for computing length of lea instruction. */ -static int +int ix86_decompose_address (rtx addr, struct ix86_address *out) { - rtx base = NULL_RTX; - rtx index = NULL_RTX; - rtx disp = NULL_RTX; + rtx base = NULL_RTX, index = NULL_RTX, disp = NULL_RTX; + rtx base_reg, index_reg; HOST_WIDE_INT scale = 1; rtx scale_rtx = NULL_RTX; int retval = 1; @@ -5670,34 +5871,37 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) scale = INTVAL (scale_rtx); } + base_reg = base && GET_CODE (base) == SUBREG ? SUBREG_REG (base) : base; + index_reg = index && GET_CODE (index) == SUBREG ? SUBREG_REG (index) : index; + /* Allow arg pointer and stack pointer as index if there is not scaling. */ - if (base && index && scale == 1 - && (index == arg_pointer_rtx - || index == frame_pointer_rtx - || (REG_P (index) && REGNO (index) == STACK_POINTER_REGNUM))) + if (base_reg && index_reg && scale == 1 + && (index_reg == arg_pointer_rtx + || index_reg == frame_pointer_rtx + || (REG_P (index_reg) && REGNO (index_reg) == STACK_POINTER_REGNUM))) { - rtx tmp = base; - base = index; - index = tmp; + rtx tmp; + tmp = base, base = index, index = tmp; + tmp = base_reg, base_reg = index_reg, index_reg = tmp; } /* Special case: %ebp cannot be encoded as a base without a displacement. */ - if ((base == hard_frame_pointer_rtx - || base == frame_pointer_rtx - || base == arg_pointer_rtx) && !disp) + if ((base_reg == hard_frame_pointer_rtx + || base_reg == frame_pointer_rtx + || base_reg == arg_pointer_rtx) && !disp) disp = const0_rtx; /* Special case: on K6, [%esi] makes the instruction vector decoded. Avoid this by transforming to [%esi+0]. */ if (ix86_tune == PROCESSOR_K6 && !optimize_size - && base && !index && !disp - && REG_P (base) - && REGNO_REG_CLASS (REGNO (base)) == SIREG) + && base_reg && !index_reg && !disp + && REG_P (base_reg) + && REGNO_REG_CLASS (REGNO (base_reg)) == SIREG) disp = const0_rtx; /* Special case: encode reg+reg instead of reg*2. */ if (!base && index && scale && scale == 2) - base = index, scale = 1; + base = index, base_reg = index_reg, scale = 1; /* Special case: scaling cannot be encoded without base or displacement. */ if (!base && !disp && index && scale != 1) @@ -5722,9 +5926,14 @@ ix86_address_cost (rtx x) { struct ix86_address parts; int cost = 1; + int ok = ix86_decompose_address (x, &parts); - if (!ix86_decompose_address (x, &parts)) - abort (); + gcc_assert (ok); + + if (parts.base && GET_CODE (parts.base) == SUBREG) + parts.base = SUBREG_REG (parts.base); + if (parts.index && GET_CODE (parts.index) == SUBREG) + parts.index = SUBREG_REG (parts.index); /* More complex memory references are better. */ if (parts.disp && parts.disp != const0_rtx) @@ -5810,6 +6019,28 @@ ix86_find_base_term (rtx x) return term; } + +/* Allow {LABEL | SYMBOL}_REF - SYMBOL_REF-FOR-PICBASE for Mach-O as + this is used for to form addresses to local data when -fPIC is in + use. */ + +static bool +darwin_local_data_pic (rtx disp) +{ + if (GET_CODE (disp) == MINUS) + { + if (GET_CODE (XEXP (disp, 0)) == LABEL_REF + || GET_CODE (XEXP (disp, 0)) == SYMBOL_REF) + if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF) + { + const char *sym_name = XSTR (XEXP (disp, 1), 0); + if (! strcmp (sym_name, "")) + return true; + } + } + + return false; +} /* Determine if a given RTX is a valid constant. We already know this satisfies CONSTANT_P. */ @@ -5829,30 +6060,53 @@ legitimate_constant_p (rtx x) x = XEXP (x, 0); } + if (TARGET_MACHO && darwin_local_data_pic (x)) + return true; + /* Only some unspecs are valid as "constants". */ if (GET_CODE (x) == UNSPEC) switch (XINT (x, 1)) { + case UNSPEC_GOTOFF: + return TARGET_64BIT; case UNSPEC_TPOFF: case UNSPEC_NTPOFF: - return local_exec_symbolic_operand (XVECEXP (x, 0, 0), Pmode); + x = XVECEXP (x, 0, 0); + return (GET_CODE (x) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC); case UNSPEC_DTPOFF: - return local_dynamic_symbolic_operand (XVECEXP (x, 0, 0), Pmode); + x = XVECEXP (x, 0, 0); + return (GET_CODE (x) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC); default: return false; } /* We must have drilled down to a symbol. */ - if (!symbolic_operand (x, Pmode)) + if (GET_CODE (x) == LABEL_REF) + return true; + if (GET_CODE (x) != SYMBOL_REF) return false; /* FALLTHRU */ case SYMBOL_REF: /* TLS symbols are never valid. */ - if (tls_symbolic_operand (x, Pmode)) + if (SYMBOL_REF_TLS_MODEL (x)) return false; break; + case CONST_DOUBLE: + if (GET_MODE (x) == TImode + && x != CONST0_RTX (TImode) + && !TARGET_64BIT) + return false; + break; + + case CONST_VECTOR: + if (x == CONST0_RTX (GET_MODE (x))) + return true; + return false; + default: break; } @@ -5868,6 +6122,17 @@ legitimate_constant_p (rtx x) static bool ix86_cannot_force_const_mem (rtx x) { + /* We can always put integral constants and vectors in memory. */ + switch (GET_CODE (x)) + { + case CONST_INT: + case CONST_DOUBLE: + case CONST_VECTOR: + return false; + + default: + break; + } return !legitimate_constant_p (x); } @@ -5892,13 +6157,20 @@ legitimate_pic_operand_p (rtx x) { case CONST: inner = XEXP (x, 0); + if (GET_CODE (inner) == PLUS + && GET_CODE (XEXP (inner, 1)) == CONST_INT) + inner = XEXP (inner, 0); /* Only some unspecs are valid as "constants". */ if (GET_CODE (inner) == UNSPEC) switch (XINT (inner, 1)) { + case UNSPEC_GOTOFF: + return TARGET_64BIT; case UNSPEC_TPOFF: - return local_exec_symbolic_operand (XVECEXP (inner, 0, 0), Pmode); + x = XVECEXP (inner, 0, 0); + return (GET_CODE (x) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC); default: return false; } @@ -5925,32 +6197,38 @@ legitimate_pic_address_disp_p (rtx disp) when they are not dynamic symbols. */ if (TARGET_64BIT) { - /* TLS references should always be enclosed in UNSPEC. */ - if (tls_symbolic_operand (disp, GET_MODE (disp))) - return 0; - if (GET_CODE (disp) == SYMBOL_REF - && ix86_cmodel == CM_SMALL_PIC - && SYMBOL_REF_LOCAL_P (disp)) - return 1; - if (GET_CODE (disp) == LABEL_REF) - return 1; - if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == PLUS) - { - rtx op0 = XEXP (XEXP (disp, 0), 0); - rtx op1 = XEXP (XEXP (disp, 0), 1); + rtx op0 = disp, op1; + switch (GET_CODE (disp)) + { + case LABEL_REF: + return true; + + case CONST: + if (GET_CODE (XEXP (disp, 0)) != PLUS) + break; + op0 = XEXP (XEXP (disp, 0), 0); + op1 = XEXP (XEXP (disp, 0), 1); + if (GET_CODE (op1) != CONST_INT + || INTVAL (op1) >= 16*1024*1024 + || INTVAL (op1) < -16*1024*1024) + break; + if (GET_CODE (op0) == LABEL_REF) + return true; + if (GET_CODE (op0) != SYMBOL_REF) + break; + /* FALLTHRU */ + + case SYMBOL_REF: /* TLS references should always be enclosed in UNSPEC. */ - if (tls_symbolic_operand (op0, GET_MODE (op0))) - return 0; - if (((GET_CODE (op0) == SYMBOL_REF - && ix86_cmodel == CM_SMALL_PIC - && SYMBOL_REF_LOCAL_P (op0)) - || GET_CODE (op0) == LABEL_REF) - && GET_CODE (op1) == CONST_INT - && INTVAL (op1) < 16*1024*1024 - && INTVAL (op1) >= -16*1024*1024) - return 1; + if (SYMBOL_REF_TLS_MODEL (op0)) + return false; + if (!SYMBOL_REF_FAR_ADDR_P (op0) && SYMBOL_REF_LOCAL_P (op0)) + return true; + break; + + default: + break; } } if (GET_CODE (disp) != CONST) @@ -5962,7 +6240,8 @@ legitimate_pic_address_disp_p (rtx disp) /* We are unsafe to allow PLUS expressions. This limit allowed distance of GOT tables. We should not need these anyway. */ if (GET_CODE (disp) != UNSPEC - || XINT (disp, 1) != UNSPEC_GOTPCREL) + || (XINT (disp, 1) != UNSPEC_GOTPCREL + && XINT (disp, 1) != UNSPEC_GOTOFF)) return 0; if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF @@ -5980,18 +6259,8 @@ legitimate_pic_address_disp_p (rtx disp) saw_plus = true; } - /* Allow {LABEL | SYMBOL}_REF - SYMBOL_REF-FOR-PICBASE for Mach-O. */ - if (TARGET_MACHO && GET_CODE (disp) == MINUS) - { - if (GET_CODE (XEXP (disp, 0)) == LABEL_REF - || GET_CODE (XEXP (disp, 0)) == SYMBOL_REF) - if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF) - { - const char *sym_name = XSTR (XEXP (disp, 1), 0); - if (! strcmp (sym_name, "")) - return 1; - } - } + if (TARGET_MACHO && darwin_local_data_pic (disp)) + return 1; if (GET_CODE (disp) != UNSPEC) return 0; @@ -6003,8 +6272,12 @@ legitimate_pic_address_disp_p (rtx disp) return false; return GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF; case UNSPEC_GOTOFF: - if (GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF - || GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF) + /* Refuse GOTOFF in 64bit mode since it is always 64bit when used. + While ABI specify also 32bit relocation but we don't produce it in + small PIC model at all. */ + if ((GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF + || GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF) + && !TARGET_64BIT) return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode); return false; case UNSPEC_GOTTPOFF: @@ -6012,11 +6285,17 @@ legitimate_pic_address_disp_p (rtx disp) case UNSPEC_INDNTPOFF: if (saw_plus) return false; - return initial_exec_symbolic_operand (XVECEXP (disp, 0, 0), Pmode); + disp = XVECEXP (disp, 0, 0); + return (GET_CODE (disp) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_INITIAL_EXEC); case UNSPEC_NTPOFF: - return local_exec_symbolic_operand (XVECEXP (disp, 0, 0), Pmode); + disp = XVECEXP (disp, 0, 0); + return (GET_CODE (disp) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_EXEC); case UNSPEC_DTPOFF: - return local_dynamic_symbolic_operand (XVECEXP (disp, 0, 0), Pmode); + disp = XVECEXP (disp, 0, 0); + return (GET_CODE (disp) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (disp) == TLS_MODEL_LOCAL_DYNAMIC); } return 0; @@ -6060,15 +6339,23 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) /* Validate base register. - Don't allow SUBREG's here, it can lead to spill failures when the base - is one word out of a two word structure, which is represented internally - as a DImode int. */ + Don't allow SUBREG's that span more than a word here. It can lead to spill + failures when the base is one word out of a two word structure, which is + represented internally as a DImode int. */ if (base) { + rtx reg; reason_rtx = base; - if (GET_CODE (base) != REG) + if (REG_P (base)) + reg = base; + else if (GET_CODE (base) == SUBREG + && REG_P (SUBREG_REG (base)) + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (base))) + <= UNITS_PER_WORD) + reg = SUBREG_REG (base); + else { reason = "base is not a register"; goto report_error; @@ -6080,8 +6367,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) goto report_error; } - if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base)) - || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) + if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) + || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg))) { reason = "base is not valid"; goto report_error; @@ -6090,15 +6377,21 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) /* Validate index register. - Don't allow SUBREG's here, it can lead to spill failures when the index - is one word out of a two word structure, which is represented internally - as a DImode int. */ + Don't allow SUBREG's that span more than a word here -- same as above. */ if (index) { + rtx reg; reason_rtx = index; - if (GET_CODE (index) != REG) + if (REG_P (index)) + reg = index; + else if (GET_CODE (index) == SUBREG + && REG_P (SUBREG_REG (index)) + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (index))) + <= UNITS_PER_WORD) + reg = SUBREG_REG (index); + else { reason = "index is not a register"; goto report_error; @@ -6110,8 +6403,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) goto report_error; } - if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index)) - || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index))) + if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) + || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg))) { reason = "index is not valid"; goto report_error; @@ -6144,11 +6437,19 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) && GET_CODE (XEXP (disp, 0)) == UNSPEC) switch (XINT (XEXP (disp, 0), 1)) { + /* Refuse GOTOFF and GOT in 64bit mode since it is always 64bit when + used. While ABI specify also 32bit relocations, we don't produce + them at all and use IP relative instead. */ case UNSPEC_GOT: case UNSPEC_GOTOFF: + gcc_assert (flag_pic); + if (!TARGET_64BIT) + goto is_legitimate_pic; + reason = "64bit address unspec"; + goto report_error; + case UNSPEC_GOTPCREL: - if (!flag_pic) - abort (); + gcc_assert (flag_pic); goto is_legitimate_pic; case UNSPEC_GOTTPOFF: @@ -6163,12 +6464,16 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) goto report_error; } - else if (flag_pic && (SYMBOLIC_CONST (disp) + else if (SYMBOLIC_CONST (disp) + && (flag_pic + || (TARGET_MACHO #if TARGET_MACHO - && !machopic_operand_p (disp) + && MACHOPIC_INDIRECT + && !machopic_operand_p (disp) #endif - )) + ))) { + is_legitimate_pic: if (TARGET_64BIT && (index || base)) { @@ -6222,7 +6527,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) reason = "displacement is not constant"; goto report_error; } - else if (TARGET_64BIT && !x86_64_sign_extended_value (disp)) + else if (TARGET_64BIT + && !x86_64_immediate_operand (disp, VOIDmode)) { reason = "displacement is out of range"; goto report_error; @@ -6243,7 +6549,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) return FALSE; } -/* Return an unique alias set for the GOT. */ +/* Return a unique alias set for the GOT. */ static HOST_WIDE_INT ix86_GOT_alias_set (void) @@ -6272,7 +6578,7 @@ ix86_GOT_alias_set (void) GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC reg also appears in the address. */ -rtx +static rtx legitimize_pic_address (rtx orig, rtx reg) { rtx addr = orig; @@ -6280,14 +6586,51 @@ legitimize_pic_address (rtx orig, rtx reg) rtx base; #if TARGET_MACHO - if (reg == 0) - reg = gen_reg_rtx (Pmode); - /* Use the generic Mach-O PIC machinery. */ - return machopic_legitimize_pic_address (orig, GET_MODE (orig), reg); + if (TARGET_MACHO && !TARGET_64BIT) + { + if (reg == 0) + reg = gen_reg_rtx (Pmode); + /* Use the generic Mach-O PIC machinery. */ + return machopic_legitimize_pic_address (orig, GET_MODE (orig), reg); + } #endif if (TARGET_64BIT && legitimate_pic_address_disp_p (addr)) new = addr; + else if (TARGET_64BIT + && ix86_cmodel != CM_SMALL_PIC + && local_symbolic_operand (addr, Pmode)) + { + rtx tmpreg; + /* This symbol may be referenced via a displacement from the PIC + base address (@GOTOFF). */ + + if (reload_in_progress) + regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; + if (GET_CODE (addr) == CONST) + addr = XEXP (addr, 0); + if (GET_CODE (addr) == PLUS) + { + new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (addr, 0)), UNSPEC_GOTOFF); + new = gen_rtx_PLUS (Pmode, new, XEXP (addr, 1)); + } + else + new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF); + new = gen_rtx_CONST (Pmode, new); + if (!reg) + tmpreg = gen_reg_rtx (Pmode); + else + tmpreg = reg; + emit_move_insn (tmpreg, new); + + if (reg != 0) + { + new = expand_simple_binop (Pmode, PLUS, reg, pic_offset_table_rtx, + tmpreg, 1, OPTAB_DIRECT); + new = reg; + } + else new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, tmpreg); + } else if (!TARGET_64BIT && local_symbolic_operand (addr, Pmode)) { /* This symbol may be referenced via a displacement from the PIC @@ -6313,14 +6656,13 @@ legitimize_pic_address (rtx orig, rtx reg) new = reg; } } - else if (GET_CODE (addr) == SYMBOL_REF) + else if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (addr) == 0) { if (TARGET_64BIT) { new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTPCREL); new = gen_rtx_CONST (Pmode, new); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); set_mem_alias_set (new, ix86_GOT_alias_set ()); if (reg == 0) @@ -6341,8 +6683,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT); new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); set_mem_alias_set (new, ix86_GOT_alias_set ()); if (reg == 0) @@ -6353,7 +6694,18 @@ legitimize_pic_address (rtx orig, rtx reg) } else { - if (GET_CODE (addr) == CONST) + if (GET_CODE (addr) == CONST_INT + && !x86_64_immediate_operand (addr, VOIDmode)) + { + if (reg) + { + emit_move_insn (reg, addr); + new = reg; + } + else + new = force_reg (Pmode, addr); + } + else if (GET_CODE (addr) == CONST) { addr = XEXP (addr, 0); @@ -6364,8 +6716,7 @@ legitimize_pic_address (rtx orig, rtx reg) || (GET_CODE (addr) == PLUS && GET_CODE (XEXP (addr, 0)) == UNSPEC)) return orig; - if (GET_CODE (addr) != PLUS) - abort (); + gcc_assert (GET_CODE (addr) == PLUS); } if (GET_CODE (addr) == PLUS) { @@ -6396,7 +6747,11 @@ legitimize_pic_address (rtx orig, rtx reg) { if (INTVAL (op1) < -16*1024*1024 || INTVAL (op1) >= 16*1024*1024) - new = gen_rtx_PLUS (Pmode, op0, force_reg (Pmode, op1)); + { + if (!x86_64_immediate_operand (op1, Pmode)) + op1 = force_reg (Pmode, op1); + new = gen_rtx_PLUS (Pmode, force_reg (Pmode, op0), op1); + } } } else @@ -6447,14 +6802,16 @@ get_thread_pointer (int to_reg) static rtx legitimize_tls_address (rtx x, enum tls_model model, int for_mov) { - rtx dest, base, off, pic; + rtx dest, base, off, pic, tp; int type; switch (model) { case TLS_MODEL_GLOBAL_DYNAMIC: dest = gen_reg_rtx (Pmode); - if (TARGET_64BIT) + tp = TARGET_GNU2_TLS ? get_thread_pointer (1) : 0; + + if (TARGET_64BIT && ! TARGET_GNU2_TLS) { rtx rax = gen_rtx_REG (Pmode, 0), insns; @@ -6465,13 +6822,24 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) emit_libcall_block (insns, dest, rax, x); } + else if (TARGET_64BIT && TARGET_GNU2_TLS) + emit_insn (gen_tls_global_dynamic_64 (dest, x)); else emit_insn (gen_tls_global_dynamic_32 (dest, x)); + + if (TARGET_GNU2_TLS) + { + dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest)); + + set_unique_reg_note (get_last_insn (), REG_EQUIV, x); + } break; case TLS_MODEL_LOCAL_DYNAMIC: base = gen_reg_rtx (Pmode); - if (TARGET_64BIT) + tp = TARGET_GNU2_TLS ? get_thread_pointer (1) : 0; + + if (TARGET_64BIT && ! TARGET_GNU2_TLS) { rtx rax = gen_rtx_REG (Pmode, 0), insns, note; @@ -6484,13 +6852,32 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) note = gen_rtx_EXPR_LIST (VOIDmode, ix86_tls_get_addr (), note); emit_libcall_block (insns, base, rax, note); } + else if (TARGET_64BIT && TARGET_GNU2_TLS) + emit_insn (gen_tls_local_dynamic_base_64 (base)); else emit_insn (gen_tls_local_dynamic_base_32 (base)); + if (TARGET_GNU2_TLS) + { + rtx x = ix86_tls_module_base (); + + set_unique_reg_note (get_last_insn (), REG_EQUIV, + gen_rtx_MINUS (Pmode, x, tp)); + } + off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), UNSPEC_DTPOFF); off = gen_rtx_CONST (Pmode, off); - return gen_rtx_PLUS (Pmode, base, off); + dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, base, off)); + + if (TARGET_GNU2_TLS) + { + dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, dest, tp)); + + set_unique_reg_note (get_last_insn (), REG_EQUIV, x); + } + + break; case TLS_MODEL_INITIAL_EXEC: if (TARGET_64BIT) @@ -6503,9 +6890,9 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) if (reload_in_progress) regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; pic = pic_offset_table_rtx; - type = TARGET_GNU_TLS ? UNSPEC_GOTNTPOFF : UNSPEC_GOTTPOFF; + type = TARGET_ANY_GNU_TLS ? UNSPEC_GOTNTPOFF : UNSPEC_GOTTPOFF; } - else if (!TARGET_GNU_TLS) + else if (!TARGET_ANY_GNU_TLS) { pic = gen_reg_rtx (Pmode); emit_insn (gen_set_got (pic)); @@ -6521,11 +6908,10 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) off = gen_rtx_CONST (Pmode, off); if (pic) off = gen_rtx_PLUS (Pmode, pic, off); - off = gen_rtx_MEM (Pmode, off); - RTX_UNCHANGING_P (off) = 1; + off = gen_const_mem (Pmode, off); set_mem_alias_set (off, ix86_GOT_alias_set ()); - if (TARGET_64BIT || TARGET_GNU_TLS) + if (TARGET_64BIT || TARGET_ANY_GNU_TLS) { base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); off = force_reg (Pmode, off); @@ -6541,11 +6927,11 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) case TLS_MODEL_LOCAL_EXEC: off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), - (TARGET_64BIT || TARGET_GNU_TLS) + (TARGET_64BIT || TARGET_ANY_GNU_TLS) ? UNSPEC_NTPOFF : UNSPEC_TPOFF); off = gen_rtx_CONST (Pmode, off); - if (TARGET_64BIT || TARGET_GNU_TLS) + if (TARGET_64BIT || TARGET_ANY_GNU_TLS) { base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); return gen_rtx_PLUS (Pmode, base, off); @@ -6559,7 +6945,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) break; default: - abort (); + gcc_unreachable (); } return dest; @@ -6599,9 +6985,17 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) debug_rtx (x); } - log = tls_symbolic_operand (x, mode); + log = GET_CODE (x) == SYMBOL_REF ? SYMBOL_REF_TLS_MODEL (x) : 0; if (log) return legitimize_tls_address (x, log, false); + if (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF + && (log = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (x, 0), 0)))) + { + rtx t = legitimize_tls_address (XEXP (XEXP (x, 0), 0), log, false); + return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (x, 0), 1)); + } if (flag_pic && SYMBOLIC_CONST (x)) return legitimize_pic_address (x, 0); @@ -6609,9 +7003,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) /* Canonicalize shifts by 0, 1, 2, 3 into multiply */ if (GET_CODE (x) == ASHIFT && GET_CODE (XEXP (x, 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (x, 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) < 4) { changed = 1; + log = INTVAL (XEXP (x, 1)); x = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (x, 0)), GEN_INT (1 << log)); } @@ -6622,9 +7017,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (GET_CODE (XEXP (x, 0)) == ASHIFT && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (XEXP (x, 0), 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (x, 0), 1)) < 4) { changed = 1; + log = INTVAL (XEXP (XEXP (x, 0), 1)); XEXP (x, 0) = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (XEXP (x, 0), 0)), GEN_INT (1 << log)); @@ -6632,9 +7028,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (GET_CODE (XEXP (x, 1)) == ASHIFT && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (XEXP (x, 1), 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (x, 1), 1)) < 4) { changed = 1; + log = INTVAL (XEXP (XEXP (x, 1), 1)); XEXP (x, 1) = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (XEXP (x, 1), 0)), GEN_INT (1 << log)); @@ -6764,14 +7161,28 @@ output_pic_addr_const (FILE *file, rtx x, int code) switch (GET_CODE (x)) { case PC: - if (flag_pic) - putc ('.', file); - else - abort (); + gcc_assert (flag_pic); + putc ('.', file); break; case SYMBOL_REF: - assemble_name (file, XSTR (x, 0)); + if (! TARGET_MACHO || TARGET_64BIT) + output_addr_const (file, x); + else + { + const char *name = XSTR (x, 0); + + /* Mark the decl as referenced so that cgraph will output the function. */ + if (SYMBOL_REF_DECL (x)) + mark_decl_referenced (SYMBOL_REF_DECL (x)); + +#if TARGET_MACHO + if (MACHOPIC_INDIRECT + && machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION) + name = machopic_indirection_name (x, /*stub_p=*/true); +#endif + assemble_name (file, name); + } if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_LOCAL_P (x)) fputs ("@PLT", file); break; @@ -6819,14 +7230,13 @@ output_pic_addr_const (FILE *file, rtx x, int code) putc ('+', file); output_pic_addr_const (file, XEXP (x, 1), code); } - else if (GET_CODE (XEXP (x, 1)) == CONST_INT) + else { + gcc_assert (GET_CODE (XEXP (x, 1)) == CONST_INT); output_pic_addr_const (file, XEXP (x, 1), code); putc ('+', file); output_pic_addr_const (file, XEXP (x, 0), code); } - else - abort (); break; case MINUS: @@ -6840,8 +7250,7 @@ output_pic_addr_const (FILE *file, rtx x, int code) break; case UNSPEC: - if (XVECLEN (x, 0) != 1) - abort (); + gcc_assert (XVECLEN (x, 0) == 1); output_pic_addr_const (file, XVECEXP (x, 0, 0), code); switch (XINT (x, 1)) { @@ -6890,30 +7299,10 @@ output_pic_addr_const (FILE *file, rtx x, int code) } } -/* This is called from dwarfout.c via ASM_OUTPUT_DWARF_ADDR_CONST. - We need to handle our special PIC relocations. */ - -void -i386_dwarf_output_addr_const (FILE *file, rtx x) -{ -#ifdef ASM_QUAD - fprintf (file, "%s", TARGET_64BIT ? ASM_QUAD : ASM_LONG); -#else - if (TARGET_64BIT) - abort (); - fprintf (file, "%s", ASM_LONG); -#endif - if (flag_pic) - output_pic_addr_const (file, x, '\0'); - else - output_addr_const (file, x); - fputc ('\n', file); -} - -/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. +/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. We need to emit DTP-relative relocations. */ -void +static void i386_output_dwarf_dtprel (FILE *file, int size, rtx x) { fputs (ASM_LONG, file); @@ -6927,18 +7316,30 @@ i386_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs (", 0", file); break; default: - abort (); + gcc_unreachable (); } } /* In the name of slightly smaller debug output, and to cater to - general assembler losage, recognize PIC+GOTOFF and turn it back - into a direct symbol reference. */ + general assembler lossage, recognize PIC+GOTOFF and turn it back + into a direct symbol reference. + + On Darwin, this is necessary to avoid a crash, because Darwin + has a different PIC label for each routine but the DWARF debugging + information is not associated with any particular routine, so it's + necessary to remove references to the PIC label from RTL stored by + the DWARF output code. */ static rtx ix86_delegitimize_address (rtx orig_x) { - rtx x = orig_x, y; + rtx x = orig_x; + /* reg_addend is NULL or a multiple of some register. */ + rtx reg_addend = NULL_RTX; + /* const_addend is NULL or a const_int. */ + rtx const_addend = NULL_RTX; + /* This is the result, or NULL. */ + rtx result = NULL_RTX; if (GET_CODE (x) == MEM) x = XEXP (x, 0); @@ -6960,51 +7361,52 @@ ix86_delegitimize_address (rtx orig_x) if (GET_CODE (XEXP (x, 0)) == REG && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM) /* %ebx + GOT/GOTOFF */ - y = NULL; + ; else if (GET_CODE (XEXP (x, 0)) == PLUS) { /* %ebx + %reg * scale + GOT/GOTOFF */ - y = XEXP (x, 0); - if (GET_CODE (XEXP (y, 0)) == REG - && REGNO (XEXP (y, 0)) == PIC_OFFSET_TABLE_REGNUM) - y = XEXP (y, 1); - else if (GET_CODE (XEXP (y, 1)) == REG - && REGNO (XEXP (y, 1)) == PIC_OFFSET_TABLE_REGNUM) - y = XEXP (y, 0); + reg_addend = XEXP (x, 0); + if (GET_CODE (XEXP (reg_addend, 0)) == REG + && REGNO (XEXP (reg_addend, 0)) == PIC_OFFSET_TABLE_REGNUM) + reg_addend = XEXP (reg_addend, 1); + else if (GET_CODE (XEXP (reg_addend, 1)) == REG + && REGNO (XEXP (reg_addend, 1)) == PIC_OFFSET_TABLE_REGNUM) + reg_addend = XEXP (reg_addend, 0); else return orig_x; - if (GET_CODE (y) != REG - && GET_CODE (y) != MULT - && GET_CODE (y) != ASHIFT) + if (GET_CODE (reg_addend) != REG + && GET_CODE (reg_addend) != MULT + && GET_CODE (reg_addend) != ASHIFT) return orig_x; } else return orig_x; x = XEXP (XEXP (x, 1), 0); + if (GET_CODE (x) == PLUS + && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + const_addend = XEXP (x, 1); + x = XEXP (x, 0); + } + if (GET_CODE (x) == UNSPEC && ((XINT (x, 1) == UNSPEC_GOT && GET_CODE (orig_x) == MEM) || (XINT (x, 1) == UNSPEC_GOTOFF && GET_CODE (orig_x) != MEM))) - { - if (y) - return gen_rtx_PLUS (Pmode, y, XVECEXP (x, 0, 0)); - return XVECEXP (x, 0, 0); - } + result = XVECEXP (x, 0, 0); - if (GET_CODE (x) == PLUS - && GET_CODE (XEXP (x, 0)) == UNSPEC - && GET_CODE (XEXP (x, 1)) == CONST_INT - && ((XINT (XEXP (x, 0), 1) == UNSPEC_GOT && GET_CODE (orig_x) == MEM) - || (XINT (XEXP (x, 0), 1) == UNSPEC_GOTOFF - && GET_CODE (orig_x) != MEM))) - { - x = gen_rtx_PLUS (VOIDmode, XVECEXP (XEXP (x, 0), 0, 0), XEXP (x, 1)); - if (y) - return gen_rtx_PLUS (Pmode, y, x); - return x; - } + if (TARGET_MACHO && darwin_local_data_pic (x) + && GET_CODE (orig_x) != MEM) + result = XEXP (x, 0); - return orig_x; + if (! result) + return orig_x; + + if (const_addend) + result = gen_rtx_PLUS (Pmode, result, const_addend); + if (reg_addend) + result = gen_rtx_PLUS (Pmode, reg_addend, result); + return result; } static void @@ -7017,8 +7419,7 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, { enum rtx_code second_code, bypass_code; ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); - if (bypass_code != NIL || second_code != NIL) - abort (); + gcc_assert (bypass_code == UNKNOWN && second_code == UNKNOWN); code = ix86_fp_compare_code_to_integer (code); mode = CCmode; } @@ -7034,52 +7435,64 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, suffix = "ne"; break; case GT: - if (mode != CCmode && mode != CCNOmode && mode != CCGCmode) - abort (); + gcc_assert (mode == CCmode || mode == CCNOmode || mode == CCGCmode); suffix = "g"; break; case GTU: - /* ??? Use "nbe" instead of "a" for fcmov losage on some assemblers. - Those same assemblers have the same but opposite losage on cmov. */ - if (mode != CCmode) - abort (); + /* ??? Use "nbe" instead of "a" for fcmov lossage on some assemblers. + Those same assemblers have the same but opposite lossage on cmov. */ + gcc_assert (mode == CCmode); suffix = fp ? "nbe" : "a"; break; case LT: - if (mode == CCNOmode || mode == CCGOCmode) - suffix = "s"; - else if (mode == CCmode || mode == CCGCmode) - suffix = "l"; - else - abort (); + switch (mode) + { + case CCNOmode: + case CCGOCmode: + suffix = "s"; + break; + + case CCmode: + case CCGCmode: + suffix = "l"; + break; + + default: + gcc_unreachable (); + } break; case LTU: - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = "b"; break; case GE: - if (mode == CCNOmode || mode == CCGOCmode) - suffix = "ns"; - else if (mode == CCmode || mode == CCGCmode) - suffix = "ge"; - else - abort (); + switch (mode) + { + case CCNOmode: + case CCGOCmode: + suffix = "ns"; + break; + + case CCmode: + case CCGCmode: + suffix = "ge"; + break; + + default: + gcc_unreachable (); + } break; case GEU: /* ??? As above. */ - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = fp ? "nb" : "ae"; break; case LE: - if (mode != CCmode && mode != CCGCmode && mode != CCNOmode) - abort (); + gcc_assert (mode == CCmode || mode == CCGCmode || mode == CCNOmode); suffix = "le"; break; case LEU: - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = "be"; break; case UNORDERED: @@ -7089,7 +7502,7 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, suffix = fp ? "nu" : "np"; break; default: - abort (); + gcc_unreachable (); } fputs (suffix, file); } @@ -7099,17 +7512,16 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, If CODE is 'b', pretend the mode is QImode. If CODE is 'k', pretend the mode is SImode. If CODE is 'q', pretend the mode is DImode. - If CODE is 'h', pretend the reg is the `high' byte register. + If CODE is 'h', pretend the reg is the 'high' byte register. If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */ void print_reg (rtx x, int code, FILE *file) { - if (REGNO (x) == ARG_POINTER_REGNUM - || REGNO (x) == FRAME_POINTER_REGNUM - || REGNO (x) == FLAGS_REG - || REGNO (x) == FPSR_REG) - abort (); + gcc_assert (REGNO (x) != ARG_POINTER_REGNUM + && REGNO (x) != FRAME_POINTER_REGNUM + && REGNO (x) != FLAGS_REG + && REGNO (x) != FPSR_REG); if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0) putc ('%', file); @@ -7133,8 +7545,7 @@ print_reg (rtx x, int code, FILE *file) from the normal registers. */ if (REX_INT_REG_P (x)) { - if (!TARGET_64BIT) - abort (); + gcc_assert (TARGET_64BIT); switch (code) { case 0: @@ -7189,7 +7600,7 @@ print_reg (rtx x, int code, FILE *file) fputs (qi_high_reg_name[REGNO (x)], file); break; default: - abort (); + gcc_unreachable (); } } @@ -7210,7 +7621,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } static int @@ -7219,7 +7630,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) rtx x = *px; if (GET_CODE (x) == SYMBOL_REF - && local_dynamic_symbolic_operand (x, Pmode)) + && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC) { cfun->machine->some_ld_name = XSTR (x, 0); return 1; @@ -7253,6 +7664,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) P -- if PIC, print an @PLT suffix. X -- don't print any sort of PIC '@' suffix for a symbol. & -- print some in-use local-dynamic symbol name. + H -- print a memory address offset by 8; used for sse high-parts */ void @@ -7272,10 +7684,13 @@ print_operand (FILE *file, rtx x, int code) return; case 'A': - if (ASSEMBLER_DIALECT == ASM_ATT) - putc ('*', file); - else if (ASSEMBLER_DIALECT == ASM_INTEL) + switch (ASSEMBLER_DIALECT) { + case ASM_ATT: + putc ('*', file); + break; + + case ASM_INTEL: /* Intel syntax. For absolute addresses, registers should not be surrounded by braces. */ if (GET_CODE (x) != REG) @@ -7285,9 +7700,11 @@ print_operand (FILE *file, rtx x, int code) putc (']', file); return; } + break; + + default: + gcc_unreachable (); } - else - abort (); PRINT_OPERAND (file, x, 0); return; @@ -7372,7 +7789,7 @@ print_operand (FILE *file, rtx x, int code) return; default: - abort (); + gcc_unreachable (); } case 'b': @@ -7430,8 +7847,7 @@ print_operand (FILE *file, rtx x, int code) fputs ("ord", file); break; default: - abort (); - break; + gcc_unreachable (); } return; case 'O': @@ -7445,7 +7861,7 @@ print_operand (FILE *file, rtx x, int code) case SFmode: putc ('l', file); break; case DImode: case DFmode: putc ('q', file); break; - default: abort (); + default: gcc_unreachable (); } putc ('.', file); } @@ -7466,7 +7882,7 @@ print_operand (FILE *file, rtx x, int code) case 'c': /* Check to see if argument to %c is really a constant and not a condition code which needs to be reversed. */ - if (GET_RTX_CLASS (GET_CODE (x)) != '<') + if (!COMPARISON_P (x)) { output_operand_lossage ("operand is neither a constant nor a condition code, invalid operand code 'c'"); return; @@ -7480,6 +7896,13 @@ print_operand (FILE *file, rtx x, int code) #endif put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 1, file); return; + + case 'H': + /* It doesn't actually matter what mode we use here, as we're + only going to use this for printing. */ + x = adjust_address_nv (x, DImode, 8); + break; + case '+': { rtx x; @@ -7514,7 +7937,7 @@ print_operand (FILE *file, rtx x, int code) return; } default: - output_operand_lossage ("invalid operand code `%c'", code); + output_operand_lossage ("invalid operand code '%c'", code); } } @@ -7536,7 +7959,7 @@ print_operand (FILE *file, rtx x, int code) case 12: size = "XWORD"; break; case 16: size = "XMMWORD"; break; default: - abort (); + gcc_unreachable (); } /* Check for explicit size override (codes 'b', 'w' and 'k') */ @@ -7595,6 +8018,15 @@ print_operand (FILE *file, rtx x, int code) else { + /* We have patterns that allow zero sets of memory, for instance. + In 64-bit mode, we should probably support all 8-byte vectors, + since we can in fact encode that into an immediate. */ + if (GET_CODE (x) == CONST_VECTOR) + { + gcc_assert (x == CONST0_RTX (GET_MODE (x))); + x = const0_rtx; + } + if (code != 'P') { if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) @@ -7628,9 +8060,9 @@ print_operand_address (FILE *file, rtx addr) struct ix86_address parts; rtx base, index, disp; int scale; + int ok = ix86_decompose_address (addr, &parts); - if (! ix86_decompose_address (addr, &parts)) - abort (); + gcc_assert (ok); base = parts.base; index = parts.index; @@ -7648,7 +8080,7 @@ print_operand_address (FILE *file, rtx addr) fputs ((parts.seg == SEG_FS ? "fs:" : "gs:"), file); break; default: - abort (); + gcc_unreachable (); } if (!base && !index) @@ -7671,16 +8103,17 @@ print_operand_address (FILE *file, rtx addr) output_addr_const (file, disp); /* Use one byte shorter RIP relative addressing for 64bit mode. */ - if (TARGET_64BIT - && ((GET_CODE (disp) == SYMBOL_REF - && ! tls_symbolic_operand (disp, GET_MODE (disp))) - || GET_CODE (disp) == LABEL_REF - || (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == PLUS - && (GET_CODE (XEXP (XEXP (disp, 0), 0)) == SYMBOL_REF - || GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF) - && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT))) - fputs ("(%rip)", file); + if (TARGET_64BIT) + { + if (GET_CODE (disp) == CONST + && GET_CODE (XEXP (disp, 0)) == PLUS + && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) + disp = XEXP (XEXP (disp, 0), 0); + if (GET_CODE (disp) == LABEL_REF + || (GET_CODE (disp) == SYMBOL_REF + && SYMBOL_REF_TLS_MODEL (disp) == 0)) + fputs ("(%rip)", file); + } } else { @@ -7843,7 +8276,7 @@ split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) } } } -/* Split one or more TImode RTL references into pairs of SImode +/* Split one or more TImode RTL references into pairs of DImode references. The RTL can be REG, offsettable MEM, integer constant, or CONST_DOUBLE. "operands" is a pointer to an array of DImode RTL to split and "num" is its length. lo_half and hi_half are output arrays @@ -7894,7 +8327,7 @@ output_387_binary_op (rtx insn, rtx *operands) static char buf[30]; const char *p; const char *ssep; - int is_sse = SSE_REG_P (operands[0]) | SSE_REG_P (operands[1]) | SSE_REG_P (operands[2]); + int is_sse = SSE_REG_P (operands[0]) || SSE_REG_P (operands[1]) || SSE_REG_P (operands[2]); #ifdef ENABLE_CHECKING /* Even if we do not want to check the inputs, this documents input @@ -7908,8 +8341,8 @@ output_387_binary_op (rtx insn, rtx *operands) && (STACK_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM))) && (STACK_TOP_P (operands[1]) || STACK_TOP_P (operands[2]))) ; /* ok */ - else if (!is_sse) - abort (); + else + gcc_assert (is_sse); #endif switch (GET_CODE (operands[3])) @@ -7951,7 +8384,7 @@ output_387_binary_op (rtx insn, rtx *operands) break; default: - abort (); + gcc_unreachable (); } if (is_sse) @@ -8086,29 +8519,153 @@ output_387_binary_op (rtx insn, rtx *operands) break; default: - abort (); + gcc_unreachable (); } strcat (buf, p); return buf; } -/* Output code to initialize control word copies used by - trunc?f?i patterns. NORMAL is set to current control word, while ROUND_DOWN - is set to control word rounding downwards. */ -void -emit_i387_cw_initialization (rtx normal, rtx round_down) +/* Return needed mode for entity in optimize_mode_switching pass. */ + +int +ix86_mode_needed (int entity, rtx insn) { + enum attr_i387_cw mode; + + /* The mode UNINITIALIZED is used to store control word after a + function call or ASM pattern. The mode ANY specify that function + has no requirements on the control word and make no changes in the + bits we are interested in. */ + + if (CALL_P (insn) + || (NONJUMP_INSN_P (insn) + && (asm_noperands (PATTERN (insn)) >= 0 + || GET_CODE (PATTERN (insn)) == ASM_INPUT))) + return I387_CW_UNINITIALIZED; + + if (recog_memoized (insn) < 0) + return I387_CW_ANY; + + mode = get_attr_i387_cw (insn); + + switch (entity) + { + case I387_TRUNC: + if (mode == I387_CW_TRUNC) + return mode; + break; + + case I387_FLOOR: + if (mode == I387_CW_FLOOR) + return mode; + break; + + case I387_CEIL: + if (mode == I387_CW_CEIL) + return mode; + break; + + case I387_MASK_PM: + if (mode == I387_CW_MASK_PM) + return mode; + break; + + default: + gcc_unreachable (); + } + + return I387_CW_ANY; +} + +/* Output code to initialize control word copies used by trunc?f?i and + rounding patterns. CURRENT_MODE is set to current control word, + while NEW_MODE is set to new control word. */ + +void +emit_i387_cw_initialization (int mode) +{ + rtx stored_mode = assign_386_stack_local (HImode, SLOT_CW_STORED); + rtx new_mode; + + int slot; + rtx reg = gen_reg_rtx (HImode); - emit_insn (gen_x86_fnstcw_1 (normal)); - emit_move_insn (reg, normal); - if (!TARGET_PARTIAL_REG_STALL && !optimize_size - && !TARGET_64BIT) - emit_insn (gen_movsi_insv_1 (reg, GEN_INT (0xc))); + emit_insn (gen_x86_fnstcw_1 (stored_mode)); + emit_move_insn (reg, stored_mode); + + if (TARGET_64BIT || TARGET_PARTIAL_REG_STALL || optimize_size) + { + switch (mode) + { + case I387_CW_TRUNC: + /* round toward zero (truncate) */ + emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0c00))); + slot = SLOT_CW_TRUNC; + break; + + case I387_CW_FLOOR: + /* round down toward -oo */ + emit_insn (gen_andhi3 (reg, reg, GEN_INT (~0x0c00))); + emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0400))); + slot = SLOT_CW_FLOOR; + break; + + case I387_CW_CEIL: + /* round up toward +oo */ + emit_insn (gen_andhi3 (reg, reg, GEN_INT (~0x0c00))); + emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0800))); + slot = SLOT_CW_CEIL; + break; + + case I387_CW_MASK_PM: + /* mask precision exception for nearbyint() */ + emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0020))); + slot = SLOT_CW_MASK_PM; + break; + + default: + gcc_unreachable (); + } + } else - emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0xc00))); - emit_move_insn (round_down, reg); + { + switch (mode) + { + case I387_CW_TRUNC: + /* round toward zero (truncate) */ + emit_insn (gen_movsi_insv_1 (reg, GEN_INT (0xc))); + slot = SLOT_CW_TRUNC; + break; + + case I387_CW_FLOOR: + /* round down toward -oo */ + emit_insn (gen_movsi_insv_1 (reg, GEN_INT (0x4))); + slot = SLOT_CW_FLOOR; + break; + + case I387_CW_CEIL: + /* round up toward +oo */ + emit_insn (gen_movsi_insv_1 (reg, GEN_INT (0x8))); + slot = SLOT_CW_CEIL; + break; + + case I387_CW_MASK_PM: + /* mask precision exception for nearbyint() */ + emit_insn (gen_iorhi3 (reg, reg, GEN_INT (0x0020))); + slot = SLOT_CW_MASK_PM; + break; + + default: + gcc_unreachable (); + } + } + + gcc_assert (slot < MAX_386_STACK_LOCALS); + + new_mode = assign_386_stack_local (HImode, slot); + emit_move_insn (new_mode, reg); } /* Output code for INSN to convert a float to a signed int. OPERANDS @@ -8116,50 +8673,87 @@ emit_i387_cw_initialization (rtx normal, rtx round_down) operand may be [SDX]Fmode. */ const char * -output_fix_trunc (rtx insn, rtx *operands) +output_fix_trunc (rtx insn, rtx *operands, int fisttp) { int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; int dimode_p = GET_MODE (operands[0]) == DImode; + int round_mode = get_attr_i387_cw (insn); /* Jump through a hoop or two for DImode, since the hardware has no non-popping instruction. We used to do this a different way, but that was somewhat fragile and broke with post-reload splitters. */ - if (dimode_p && !stack_top_dies) + if ((dimode_p || fisttp) && !stack_top_dies) output_asm_insn ("fld\t%y1", operands); - if (!STACK_TOP_P (operands[1])) - abort (); + gcc_assert (STACK_TOP_P (operands[1])); + gcc_assert (GET_CODE (operands[0]) == MEM); - if (GET_CODE (operands[0]) != MEM) - abort (); - - output_asm_insn ("fldcw\t%3", operands); - if (stack_top_dies || dimode_p) - output_asm_insn ("fistp%z0\t%0", operands); + if (fisttp) + output_asm_insn ("fisttp%z0\t%0", operands); else - output_asm_insn ("fist%z0\t%0", operands); - output_asm_insn ("fldcw\t%2", operands); + { + if (round_mode != I387_CW_ANY) + output_asm_insn ("fldcw\t%3", operands); + if (stack_top_dies || dimode_p) + output_asm_insn ("fistp%z0\t%0", operands); + else + output_asm_insn ("fist%z0\t%0", operands); + if (round_mode != I387_CW_ANY) + output_asm_insn ("fldcw\t%2", operands); + } return ""; } +/* Output code for x87 ffreep insn. The OPNO argument, which may only + have the values zero or one, indicates the ffreep insn's operand + from the OPERANDS array. */ + +static const char * +output_387_ffreep (rtx *operands ATTRIBUTE_UNUSED, int opno) +{ + if (TARGET_USE_FFREEP) +#if HAVE_AS_IX86_FFREEP + return opno ? "ffreep\t%y1" : "ffreep\t%y0"; +#else + switch (REGNO (operands[opno])) + { + case FIRST_STACK_REG + 0: return ".word\t0xc0df"; + case FIRST_STACK_REG + 1: return ".word\t0xc1df"; + case FIRST_STACK_REG + 2: return ".word\t0xc2df"; + case FIRST_STACK_REG + 3: return ".word\t0xc3df"; + case FIRST_STACK_REG + 4: return ".word\t0xc4df"; + case FIRST_STACK_REG + 5: return ".word\t0xc5df"; + case FIRST_STACK_REG + 6: return ".word\t0xc6df"; + case FIRST_STACK_REG + 7: return ".word\t0xc7df"; + } +#endif + + return opno ? "fstp\t%y1" : "fstp\t%y0"; +} + + /* Output code for INSN to compare OPERANDS. EFLAGS_P is 1 when fcomi - should be used and 2 when fnstsw should be used. UNORDERED_P is true - when fucom should be used. */ + should be used. UNORDERED_P is true when fucom should be used. */ const char * output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) { int stack_top_dies; - rtx cmp_op0 = operands[0]; - rtx cmp_op1 = operands[1]; - int is_sse = SSE_REG_P (operands[0]) | SSE_REG_P (operands[1]); + rtx cmp_op0, cmp_op1; + int is_sse = SSE_REG_P (operands[0]) || SSE_REG_P (operands[1]); - if (eflags_p == 2) + if (eflags_p) { - cmp_op0 = cmp_op1; + cmp_op0 = operands[0]; + cmp_op1 = operands[1]; + } + else + { + cmp_op0 = operands[1]; cmp_op1 = operands[2]; } + if (is_sse) { if (GET_MODE (operands[0]) == SFmode) @@ -8174,11 +8768,21 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) return "comisd\t{%1, %0|%0, %1}"; } - if (! STACK_TOP_P (cmp_op0)) - abort (); + gcc_assert (STACK_TOP_P (cmp_op0)); stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; + if (cmp_op1 == CONST0_RTX (GET_MODE (cmp_op1))) + { + if (stack_top_dies) + { + output_asm_insn ("ftst\n\tfnstsw\t%0", operands); + return output_387_ffreep (operands, 1); + } + else + return "ftst\n\tfnstsw\t%0"; + } + if (STACK_REG_P (cmp_op1) && stack_top_dies && find_regno_note (insn, REG_DEAD, REGNO (cmp_op1)) @@ -8188,7 +8792,7 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) is also a stack register that dies, then this must be a `fcompp' float compare */ - if (eflags_p == 1) + if (eflags_p) { /* There is no double popping fcomi variant. Fortunately, eflags is immune from the fstp's cc clobbering. */ @@ -8196,39 +8800,29 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) output_asm_insn ("fucomip\t{%y1, %0|%0, %y1}", operands); else output_asm_insn ("fcomip\t{%y1, %0|%0, %y1}", operands); - return "fstp\t%y0"; + return output_387_ffreep (operands, 0); } else { - if (eflags_p == 2) - { - if (unordered_p) - return "fucompp\n\tfnstsw\t%0"; - else - return "fcompp\n\tfnstsw\t%0"; - } + if (unordered_p) + return "fucompp\n\tfnstsw\t%0"; else - { - if (unordered_p) - return "fucompp"; - else - return "fcompp"; - } + return "fcompp\n\tfnstsw\t%0"; } } else { /* Encoded here as eflags_p | intmode | unordered_p | stack_top_dies. */ - static const char * const alt[24] = + static const char * const alt[16] = { - "fcom%z1\t%y1", - "fcomp%z1\t%y1", - "fucom%z1\t%y1", - "fucomp%z1\t%y1", + "fcom%z2\t%y2\n\tfnstsw\t%0", + "fcomp%z2\t%y2\n\tfnstsw\t%0", + "fucom%z2\t%y2\n\tfnstsw\t%0", + "fucomp%z2\t%y2\n\tfnstsw\t%0", - "ficom%z1\t%y1", - "ficomp%z1\t%y1", + "ficom%z2\t%y2\n\tfnstsw\t%0", + "ficomp%z2\t%y2\n\tfnstsw\t%0", NULL, NULL, @@ -8240,16 +8834,6 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) NULL, NULL, NULL, - NULL, - - "fcom%z2\t%y2\n\tfnstsw\t%0", - "fcomp%z2\t%y2\n\tfnstsw\t%0", - "fucom%z2\t%y2\n\tfnstsw\t%0", - "fucomp%z2\t%y2\n\tfnstsw\t%0", - - "ficom%z2\t%y2\n\tfnstsw\t%0", - "ficomp%z2\t%y2\n\tfnstsw\t%0", - NULL, NULL }; @@ -8257,15 +8841,13 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) const char *ret; mask = eflags_p << 3; - mask |= (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT) << 2; + mask |= (GET_MODE_CLASS (GET_MODE (cmp_op1)) == MODE_INT) << 2; mask |= unordered_p << 1; mask |= stack_top_dies; - if (mask >= 24) - abort (); + gcc_assert (mask < 16); ret = alt[mask]; - if (ret == NULL) - abort (); + gcc_assert (ret); return ret; } @@ -8276,14 +8858,12 @@ ix86_output_addr_vec_elt (FILE *file, int value) { const char *directive = ASM_LONG; - if (TARGET_64BIT) - { #ifdef ASM_QUAD - directive = ASM_QUAD; + if (TARGET_64BIT) + directive = ASM_QUAD; #else - abort (); + gcc_assert (!TARGET_64BIT); #endif - } fprintf (file, "%s%s%d\n", directive, LPREFIX, value); } @@ -8318,8 +8898,7 @@ ix86_expand_clear (rtx dest) rtx tmp; /* We play register width games, which are only valid after reload. */ - if (!reload_completed) - abort (); + gcc_assert (reload_completed); /* Avoid HImode and its attendant prefix byte. */ if (GET_MODE_SIZE (GET_MODE (dest)) < 4) @@ -8340,7 +8919,7 @@ ix86_expand_clear (rtx dest) /* X is an unchanging MEM. If it is a constant pool reference, return the constant pool rtx, else NULL. */ -static rtx +rtx maybe_get_pool_constant (rtx x) { x = ix86_delegitimize_address (XEXP (x, 0)); @@ -8361,46 +8940,62 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) op0 = operands[0]; op1 = operands[1]; - model = tls_symbolic_operand (op1, Pmode); - if (model) + if (GET_CODE (op1) == SYMBOL_REF) { - op1 = legitimize_tls_address (op1, model, true); - op1 = force_operand (op1, op0); - if (op1 == op0) - return; + model = SYMBOL_REF_TLS_MODEL (op1); + if (model) + { + op1 = legitimize_tls_address (op1, model, true); + op1 = force_operand (op1, op0); + if (op1 == op0) + return; + } + } + else if (GET_CODE (op1) == CONST + && GET_CODE (XEXP (op1, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op1, 0), 0)) == SYMBOL_REF) + { + model = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (op1, 0), 0)); + if (model) + { + rtx addend = XEXP (XEXP (op1, 0), 1); + op1 = legitimize_tls_address (XEXP (XEXP (op1, 0), 0), model, true); + op1 = force_operand (op1, NULL); + op1 = expand_simple_binop (Pmode, PLUS, op1, addend, + op0, 1, OPTAB_DIRECT); + if (op1 == op0) + return; + } } if (flag_pic && mode == Pmode && symbolic_operand (op1, Pmode)) { -#if TARGET_MACHO - if (MACHOPIC_PURE) + if (TARGET_MACHO && !TARGET_64BIT) { - rtx temp = ((reload_in_progress - || ((op0 && GET_CODE (op0) == REG) - && mode == Pmode)) - ? op0 : gen_reg_rtx (Pmode)); - op1 = machopic_indirect_data_reference (op1, temp); - op1 = machopic_legitimize_pic_address (op1, mode, - temp == op1 ? 0 : temp); +#if TARGET_MACHO + if (MACHOPIC_PURE) + { + rtx temp = ((reload_in_progress + || ((op0 && GET_CODE (op0) == REG) + && mode == Pmode)) + ? op0 : gen_reg_rtx (Pmode)); + op1 = machopic_indirect_data_reference (op1, temp); + op1 = machopic_legitimize_pic_address (op1, mode, + temp == op1 ? 0 : temp); + } + else if (MACHOPIC_INDIRECT) + op1 = machopic_indirect_data_reference (op1, 0); + if (op0 == op1) + return; +#endif } - else if (MACHOPIC_INDIRECT) - op1 = machopic_indirect_data_reference (op1, 0); - if (op0 == op1) - return; -#else - if (GET_CODE (op0) == MEM) - op1 = force_reg (Pmode, op1); else { - rtx temp = op0; - if (GET_CODE (temp) != REG) - temp = gen_reg_rtx (Pmode); - temp = legitimize_pic_address (op1, temp); - if (temp == op0) - return; - op1 = temp; + if (GET_CODE (op0) == MEM) + op1 = force_reg (Pmode, op1); + else + op1 = legitimize_address (op1, op1, Pmode); } -#endif /* TARGET_MACHO */ } else { @@ -8418,7 +9013,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) to get them CSEed. */ if (TARGET_64BIT && mode == DImode && immediate_operand (op1, mode) - && !x86_64_zero_extended_value (op1) + && !x86_64_zext_immediate_operand (op1, VOIDmode) && !register_operand (op0, mode) && optimize && !reload_completed && !reload_in_progress) op1 = copy_to_mode_reg (mode, op1); @@ -8451,45 +9046,186 @@ ix86_expand_move (enum machine_mode mode, rtx operands[]) void ix86_expand_vector_move (enum machine_mode mode, rtx operands[]) { + rtx op0 = operands[0], op1 = operands[1]; + /* Force constants other than zero into memory. We do not know how the instructions used to build constants modify the upper 64 bits of the register, once we have that information we may be able to handle some of them more efficiently. */ if ((reload_in_progress | reload_completed) == 0 - && register_operand (operands[0], mode) - && CONSTANT_P (operands[1]) && operands[1] != CONST0_RTX (mode)) - operands[1] = validize_mem (force_const_mem (mode, operands[1])); + && register_operand (op0, mode) + && CONSTANT_P (op1) + && standard_sse_constant_p (op1) <= 0) + op1 = validize_mem (force_const_mem (mode, op1)); /* Make operand1 a register if it isn't already. */ if (!no_new_pseudos - && !register_operand (operands[0], mode) - && !register_operand (operands[1], mode)) + && !register_operand (op0, mode) + && !register_operand (op1, mode)) { - rtx temp = force_reg (GET_MODE (operands[1]), operands[1]); - emit_move_insn (operands[0], temp); + emit_move_insn (op0, force_reg (GET_MODE (op0), op1)); return; } - emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); + emit_insn (gen_rtx_SET (VOIDmode, op0, op1)); } -/* Attempt to expand a binary operator. Make the expansion closer to the - actual machine, then just general_operand, which will allow 3 separate - memory references (one output, two input) in a single insn. */ +/* Implement the movmisalign patterns for SSE. Non-SSE modes go + straight to ix86_expand_vector_move. */ void -ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, - rtx operands[]) +ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[]) +{ + rtx op0, op1, m; + + op0 = operands[0]; + op1 = operands[1]; + + if (MEM_P (op1)) + { + /* If we're optimizing for size, movups is the smallest. */ + if (optimize_size) + { + op0 = gen_lowpart (V4SFmode, op0); + op1 = gen_lowpart (V4SFmode, op1); + emit_insn (gen_sse_movups (op0, op1)); + return; + } + + /* ??? If we have typed data, then it would appear that using + movdqu is the only way to get unaligned data loaded with + integer type. */ + if (TARGET_SSE2 && GET_MODE_CLASS (mode) == MODE_VECTOR_INT) + { + op0 = gen_lowpart (V16QImode, op0); + op1 = gen_lowpart (V16QImode, op1); + emit_insn (gen_sse2_movdqu (op0, op1)); + return; + } + + if (TARGET_SSE2 && mode == V2DFmode) + { + rtx zero; + + /* When SSE registers are split into halves, we can avoid + writing to the top half twice. */ + if (TARGET_SSE_SPLIT_REGS) + { + emit_insn (gen_rtx_CLOBBER (VOIDmode, op0)); + zero = op0; + } + else + { + /* ??? Not sure about the best option for the Intel chips. + The following would seem to satisfy; the register is + entirely cleared, breaking the dependency chain. We + then store to the upper half, with a dependency depth + of one. A rumor has it that Intel recommends two movsd + followed by an unpacklpd, but this is unconfirmed. And + given that the dependency depth of the unpacklpd would + still be one, I'm not sure why this would be better. */ + zero = CONST0_RTX (V2DFmode); + } + + m = adjust_address (op1, DFmode, 0); + emit_insn (gen_sse2_loadlpd (op0, zero, m)); + m = adjust_address (op1, DFmode, 8); + emit_insn (gen_sse2_loadhpd (op0, op0, m)); + } + else + { + if (TARGET_SSE_PARTIAL_REG_DEPENDENCY) + emit_move_insn (op0, CONST0_RTX (mode)); + else + emit_insn (gen_rtx_CLOBBER (VOIDmode, op0)); + + if (mode != V4SFmode) + op0 = gen_lowpart (V4SFmode, op0); + m = adjust_address (op1, V2SFmode, 0); + emit_insn (gen_sse_loadlps (op0, op0, m)); + m = adjust_address (op1, V2SFmode, 8); + emit_insn (gen_sse_loadhps (op0, op0, m)); + } + } + else if (MEM_P (op0)) + { + /* If we're optimizing for size, movups is the smallest. */ + if (optimize_size) + { + op0 = gen_lowpart (V4SFmode, op0); + op1 = gen_lowpart (V4SFmode, op1); + emit_insn (gen_sse_movups (op0, op1)); + return; + } + + /* ??? Similar to above, only less clear because of quote + typeless stores unquote. */ + if (TARGET_SSE2 && !TARGET_SSE_TYPELESS_STORES + && GET_MODE_CLASS (mode) == MODE_VECTOR_INT) + { + op0 = gen_lowpart (V16QImode, op0); + op1 = gen_lowpart (V16QImode, op1); + emit_insn (gen_sse2_movdqu (op0, op1)); + return; + } + + if (TARGET_SSE2 && mode == V2DFmode) + { + m = adjust_address (op0, DFmode, 0); + emit_insn (gen_sse2_storelpd (m, op1)); + m = adjust_address (op0, DFmode, 8); + emit_insn (gen_sse2_storehpd (m, op1)); + } + else + { + if (mode != V4SFmode) + op1 = gen_lowpart (V4SFmode, op1); + m = adjust_address (op0, V2SFmode, 0); + emit_insn (gen_sse_storelps (m, op1)); + m = adjust_address (op0, V2SFmode, 8); + emit_insn (gen_sse_storehps (m, op1)); + } + } + else + gcc_unreachable (); +} + +/* Expand a push in MODE. This is some mode for which we do not support + proper push instructions, at least from the registers that we expect + the value to live in. */ + +void +ix86_expand_push (enum machine_mode mode, rtx x) +{ + rtx tmp; + + tmp = expand_simple_binop (Pmode, PLUS, stack_pointer_rtx, + GEN_INT (-GET_MODE_SIZE (mode)), + stack_pointer_rtx, 1, OPTAB_DIRECT); + if (tmp != stack_pointer_rtx) + emit_move_insn (stack_pointer_rtx, tmp); + + tmp = gen_rtx_MEM (mode, stack_pointer_rtx); + emit_move_insn (tmp, x); +} + +/* Fix up OPERANDS to satisfy ix86_binary_operator_ok. Return the + destination to use for the operation. If different from the true + destination in operands[0], a copy operation will be required. */ + +rtx +ix86_fixup_binary_operands (enum rtx_code code, enum machine_mode mode, + rtx operands[]) { int matching_memory; - rtx src1, src2, dst, op, clob; + rtx src1, src2, dst; dst = operands[0]; src1 = operands[1]; src2 = operands[2]; /* Recognize = for commutative operators */ - if (GET_RTX_CLASS (code) == 'c' + if (GET_RTX_CLASS (code) == RTX_COMM_ARITH && (rtx_equal_p (dst, src2) || immediate_operand (src1, mode))) { @@ -8505,7 +9241,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, { if (rtx_equal_p (dst, src1)) matching_memory = 1; - else if (GET_RTX_CLASS (code) == 'c' + else if (GET_RTX_CLASS (code) == RTX_COMM_ARITH && rtx_equal_p (dst, src2)) matching_memory = 2; else @@ -8525,29 +9261,47 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, or non-matching memory. */ if ((CONSTANT_P (src1) || (!matching_memory && GET_CODE (src1) == MEM)) - && GET_RTX_CLASS (code) != 'c') + && GET_RTX_CLASS (code) != RTX_COMM_ARITH) src1 = force_reg (mode, src1); - /* If optimizing, copy to regs to improve CSE */ - if (optimize && ! no_new_pseudos) - { - if (GET_CODE (dst) == MEM) - dst = gen_reg_rtx (mode); - if (GET_CODE (src1) == MEM) - src1 = force_reg (mode, src1); - if (GET_CODE (src2) == MEM) - src2 = force_reg (mode, src2); - } + src1 = operands[1] = src1; + src2 = operands[2] = src2; + return dst; +} - /* Emit the instruction. */ +/* Similarly, but assume that the destination has already been + set up properly. */ + +void +ix86_fixup_binary_operands_no_copy (enum rtx_code code, + enum machine_mode mode, rtx operands[]) +{ + rtx dst = ix86_fixup_binary_operands (code, mode, operands); + gcc_assert (dst == operands[0]); +} + +/* Attempt to expand a binary operator. Make the expansion closer to the + actual machine, then just general_operand, which will allow 3 separate + memory references (one output, two input) in a single insn. */ + +void +ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, + rtx operands[]) +{ + rtx src1, src2, dst, op, clob; + + dst = ix86_fixup_binary_operands (code, mode, operands); + src1 = operands[1]; + src2 = operands[2]; + + /* Emit the instruction. */ op = gen_rtx_SET (VOIDmode, dst, gen_rtx_fmt_ee (code, mode, src1, src2)); if (reload_in_progress) { /* Reload doesn't know about the flags register, and doesn't know that it doesn't want to clobber it. We can only do this with PLUS. */ - if (code != PLUS) - abort (); + gcc_assert (code == PLUS); emit_insn (op); } else @@ -8573,18 +9327,18 @@ ix86_binary_operator_ok (enum rtx_code code, if (GET_CODE (operands[1]) == MEM && GET_CODE (operands[2]) == MEM) return 0; /* If the operation is not commutable, source 1 cannot be a constant. */ - if (CONSTANT_P (operands[1]) && GET_RTX_CLASS (code) != 'c') + if (CONSTANT_P (operands[1]) && GET_RTX_CLASS (code) != RTX_COMM_ARITH) return 0; /* If the destination is memory, we must have a matching source operand. */ if (GET_CODE (operands[0]) == MEM && ! (rtx_equal_p (operands[0], operands[1]) - || (GET_RTX_CLASS (code) == 'c' + || (GET_RTX_CLASS (code) == RTX_COMM_ARITH && rtx_equal_p (operands[0], operands[2])))) return 0; /* If the operation is not commutable and the source 1 is memory, we must have a matching destination. */ if (GET_CODE (operands[1]) == MEM - && GET_RTX_CLASS (code) != 'c' + && GET_RTX_CLASS (code) != RTX_COMM_ARITH && ! rtx_equal_p (operands[0], operands[1])) return 0; return 1; @@ -8607,7 +9361,7 @@ ix86_expand_unary_operator (enum rtx_code code, enum machine_mode mode, /* If the destination is memory, and we do not have matching source operands, do things in registers. */ matching_memory = 0; - if (GET_CODE (dst) == MEM) + if (MEM_P (dst)) { if (rtx_equal_p (dst, src)) matching_memory = 1; @@ -8616,18 +9370,9 @@ ix86_expand_unary_operator (enum rtx_code code, enum machine_mode mode, } /* When source operand is memory, destination must match. */ - if (!matching_memory && GET_CODE (src) == MEM) + if (MEM_P (src) && !matching_memory) src = force_reg (mode, src); - /* If optimizing, copy to regs to improve CSE */ - if (optimize && ! no_new_pseudos) - { - if (GET_CODE (dst) == MEM) - dst = gen_reg_rtx (mode); - if (GET_CODE (src) == MEM) - src = force_reg (mode, src); - } - /* Emit the instruction. */ op = gen_rtx_SET (VOIDmode, dst, gen_rtx_fmt_e (code, mode, src)); @@ -8635,8 +9380,7 @@ ix86_expand_unary_operator (enum rtx_code code, enum machine_mode mode, { /* Reload doesn't know about the flags register, and doesn't know that it doesn't want to clobber it. */ - if (code != NOT) - abort (); + gcc_assert (code == NOT); emit_insn (op); } else @@ -8666,6 +9410,278 @@ ix86_unary_operator_ok (enum rtx_code code ATTRIBUTE_UNUSED, return TRUE; } +/* A subroutine of ix86_expand_fp_absneg_operator and copysign expanders. + Create a mask for the sign bit in MODE for an SSE register. If VECT is + true, then replicate the mask for all elements of the vector register. + If INVERT is true, then create a mask excluding the sign bit. */ + +rtx +ix86_build_signbit_mask (enum machine_mode mode, bool vect, bool invert) +{ + enum machine_mode vec_mode; + HOST_WIDE_INT hi, lo; + int shift = 63; + rtvec v; + rtx mask; + + /* Find the sign bit, sign extended to 2*HWI. */ + if (mode == SFmode) + lo = 0x80000000, hi = lo < 0; + else if (HOST_BITS_PER_WIDE_INT >= 64) + lo = (HOST_WIDE_INT)1 << shift, hi = -1; + else + lo = 0, hi = (HOST_WIDE_INT)1 << (shift - HOST_BITS_PER_WIDE_INT); + + if (invert) + lo = ~lo, hi = ~hi; + + /* Force this value into the low part of a fp vector constant. */ + mask = immed_double_const (lo, hi, mode == SFmode ? SImode : DImode); + mask = gen_lowpart (mode, mask); + + if (mode == SFmode) + { + if (vect) + v = gen_rtvec (4, mask, mask, mask, mask); + else + v = gen_rtvec (4, mask, CONST0_RTX (SFmode), + CONST0_RTX (SFmode), CONST0_RTX (SFmode)); + vec_mode = V4SFmode; + } + else + { + if (vect) + v = gen_rtvec (2, mask, mask); + else + v = gen_rtvec (2, mask, CONST0_RTX (DFmode)); + vec_mode = V2DFmode; + } + + return force_reg (vec_mode, gen_rtx_CONST_VECTOR (vec_mode, v)); +} + +/* Generate code for floating point ABS or NEG. */ + +void +ix86_expand_fp_absneg_operator (enum rtx_code code, enum machine_mode mode, + rtx operands[]) +{ + rtx mask, set, use, clob, dst, src; + bool matching_memory; + bool use_sse = false; + bool vector_mode = VECTOR_MODE_P (mode); + enum machine_mode elt_mode = mode; + + if (vector_mode) + { + elt_mode = GET_MODE_INNER (mode); + use_sse = true; + } + else if (TARGET_SSE_MATH) + use_sse = SSE_FLOAT_MODE_P (mode); + + /* NEG and ABS performed with SSE use bitwise mask operations. + Create the appropriate mask now. */ + if (use_sse) + mask = ix86_build_signbit_mask (elt_mode, vector_mode, code == ABS); + else + mask = NULL_RTX; + + dst = operands[0]; + src = operands[1]; + + /* If the destination is memory, and we don't have matching source + operands or we're using the x87, do things in registers. */ + matching_memory = false; + if (MEM_P (dst)) + { + if (use_sse && rtx_equal_p (dst, src)) + matching_memory = true; + else + dst = gen_reg_rtx (mode); + } + if (MEM_P (src) && !matching_memory) + src = force_reg (mode, src); + + if (vector_mode) + { + set = gen_rtx_fmt_ee (code == NEG ? XOR : AND, mode, src, mask); + set = gen_rtx_SET (VOIDmode, dst, set); + emit_insn (set); + } + else + { + set = gen_rtx_fmt_e (code, mode, src); + set = gen_rtx_SET (VOIDmode, dst, set); + if (mask) + { + use = gen_rtx_USE (VOIDmode, mask); + clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG)); + emit_insn (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (3, set, use, clob))); + } + else + emit_insn (set); + } + + if (dst != operands[0]) + emit_move_insn (operands[0], dst); +} + +/* Expand a copysign operation. Special case operand 0 being a constant. */ + +void +ix86_expand_copysign (rtx operands[]) +{ + enum machine_mode mode, vmode; + rtx dest, op0, op1, mask, nmask; + + dest = operands[0]; + op0 = operands[1]; + op1 = operands[2]; + + mode = GET_MODE (dest); + vmode = mode == SFmode ? V4SFmode : V2DFmode; + + if (GET_CODE (op0) == CONST_DOUBLE) + { + rtvec v; + + if (real_isneg (CONST_DOUBLE_REAL_VALUE (op0))) + op0 = simplify_unary_operation (ABS, mode, op0, mode); + + if (op0 == CONST0_RTX (mode)) + op0 = CONST0_RTX (vmode); + else + { + if (mode == SFmode) + v = gen_rtvec (4, op0, CONST0_RTX (SFmode), + CONST0_RTX (SFmode), CONST0_RTX (SFmode)); + else + v = gen_rtvec (2, op0, CONST0_RTX (DFmode)); + op0 = force_reg (vmode, gen_rtx_CONST_VECTOR (vmode, v)); + } + + mask = ix86_build_signbit_mask (mode, 0, 0); + + if (mode == SFmode) + emit_insn (gen_copysignsf3_const (dest, op0, op1, mask)); + else + emit_insn (gen_copysigndf3_const (dest, op0, op1, mask)); + } + else + { + nmask = ix86_build_signbit_mask (mode, 0, 1); + mask = ix86_build_signbit_mask (mode, 0, 0); + + if (mode == SFmode) + emit_insn (gen_copysignsf3_var (dest, NULL, op0, op1, nmask, mask)); + else + emit_insn (gen_copysigndf3_var (dest, NULL, op0, op1, nmask, mask)); + } +} + +/* Deconstruct a copysign operation into bit masks. Operand 0 is known to + be a constant, and so has already been expanded into a vector constant. */ + +void +ix86_split_copysign_const (rtx operands[]) +{ + enum machine_mode mode, vmode; + rtx dest, op0, op1, mask, x; + + dest = operands[0]; + op0 = operands[1]; + op1 = operands[2]; + mask = operands[3]; + + mode = GET_MODE (dest); + vmode = GET_MODE (mask); + + dest = simplify_gen_subreg (vmode, dest, mode, 0); + x = gen_rtx_AND (vmode, dest, mask); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + + if (op0 != CONST0_RTX (vmode)) + { + x = gen_rtx_IOR (vmode, dest, op0); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } +} + +/* Deconstruct a copysign operation into bit masks. Operand 0 is variable, + so we have to do two masks. */ + +void +ix86_split_copysign_var (rtx operands[]) +{ + enum machine_mode mode, vmode; + rtx dest, scratch, op0, op1, mask, nmask, x; + + dest = operands[0]; + scratch = operands[1]; + op0 = operands[2]; + op1 = operands[3]; + nmask = operands[4]; + mask = operands[5]; + + mode = GET_MODE (dest); + vmode = GET_MODE (mask); + + if (rtx_equal_p (op0, op1)) + { + /* Shouldn't happen often (it's useless, obviously), but when it does + we'd generate incorrect code if we continue below. */ + emit_move_insn (dest, op0); + return; + } + + if (REG_P (mask) && REGNO (dest) == REGNO (mask)) /* alternative 0 */ + { + gcc_assert (REGNO (op1) == REGNO (scratch)); + + x = gen_rtx_AND (vmode, scratch, mask); + emit_insn (gen_rtx_SET (VOIDmode, scratch, x)); + + dest = mask; + op0 = simplify_gen_subreg (vmode, op0, mode, 0); + x = gen_rtx_NOT (vmode, dest); + x = gen_rtx_AND (vmode, x, op0); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + else + { + if (REGNO (op1) == REGNO (scratch)) /* alternative 1,3 */ + { + x = gen_rtx_AND (vmode, scratch, mask); + } + else /* alternative 2,4 */ + { + gcc_assert (REGNO (mask) == REGNO (scratch)); + op1 = simplify_gen_subreg (vmode, op1, mode, 0); + x = gen_rtx_AND (vmode, scratch, op1); + } + emit_insn (gen_rtx_SET (VOIDmode, scratch, x)); + + if (REGNO (op0) == REGNO (dest)) /* alternative 1,2 */ + { + dest = simplify_gen_subreg (vmode, op0, mode, 0); + x = gen_rtx_AND (vmode, dest, nmask); + } + else /* alternative 3,4 */ + { + gcc_assert (REGNO (nmask) == REGNO (dest)); + dest = nmask; + op0 = simplify_gen_subreg (vmode, op0, mode, 0); + x = gen_rtx_AND (vmode, dest, op0); + } + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + + x = gen_rtx_IOR (vmode, dest, scratch); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); +} + /* Return TRUE or FALSE depending on whether the first SET in INSN has source and destination with matching CC modes, and that the CC mode is at least as constrained as REQ_MODE. */ @@ -8679,10 +9695,8 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) set = PATTERN (insn); if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - if (GET_CODE (set) != SET) - abort (); - if (GET_CODE (SET_SRC (set)) != COMPARE) - abort (); + gcc_assert (GET_CODE (set) == SET); + gcc_assert (GET_CODE (SET_SRC (set)) == COMPARE); set_mode = GET_MODE (SET_DEST (set)); switch (set_mode) @@ -8709,7 +9723,7 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) break; default: - abort (); + gcc_unreachable (); } return (GET_MODE (SET_SRC (set)) == set_mode); @@ -8753,7 +9767,7 @@ ix86_fp_compare_mode (enum rtx_code code ATTRIBUTE_UNUSED) enum machine_mode ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1) { - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) + if (SCALAR_FLOAT_MODE_P (GET_MODE (op0))) return ix86_fp_compare_mode (code); switch (code) { @@ -8791,7 +9805,7 @@ ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1) case USE: return CCmode; default: - abort (); + gcc_unreachable (); } } @@ -8825,7 +9839,7 @@ ix86_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2) switch (m1) { default: - abort (); + gcc_unreachable (); case CCmode: case CCGCmode: @@ -8874,15 +9888,20 @@ ix86_prepare_fp_compare_args (enum rtx_code code, rtx *pop0, rtx *pop1) enum machine_mode fpcmp_mode = ix86_fp_compare_mode (code); rtx op0 = *pop0, op1 = *pop1; enum machine_mode op_mode = GET_MODE (op0); - int is_sse = SSE_REG_P (op0) | SSE_REG_P (op1); + int is_sse = TARGET_SSE_MATH && SSE_FLOAT_MODE_P (op_mode); /* All of the unordered compare instructions only work on registers. - The same is true of the XFmode compare instructions. The same is - true of the fcomi compare instructions. */ + The same is true of the fcomi compare instructions. The XFmode + compare instructions require registers except when comparing + against zero or when converting operand 1 from fixed point to + floating point. */ if (!is_sse && (fpcmp_mode == CCFPUmode - || op_mode == XFmode + || (op_mode == XFmode + && ! (standard_80387_constant_p (op0) == 1 + || standard_80387_constant_p (op1) == 1) + && GET_CODE (op1) != FLOAT) || ix86_use_fcomi_compare (code))) { op0 = force_reg (op_mode, op0); @@ -8909,10 +9928,16 @@ ix86_prepare_fp_compare_args (enum rtx_code code, rtx *pop0, rtx *pop1) if (CONSTANT_P (op1)) { - if (standard_80387_constant_p (op1)) - op1 = force_reg (op_mode, op1); - else + int tmp = standard_80387_constant_p (op1); + if (tmp == 0) op1 = validize_mem (force_const_mem (op_mode, op1)); + else if (tmp == 1) + { + if (TARGET_CMOVE) + op1 = force_reg (op_mode, op1); + } + else + op1 = force_reg (op_mode, op1); } } @@ -8936,7 +9961,8 @@ ix86_prepare_fp_compare_args (enum rtx_code code, rtx *pop0, rtx *pop1) /* Convert comparison codes we use to represent FP comparison to integer code that will result in proper branch. Return UNKNOWN if no such code is available. */ -static enum rtx_code + +enum rtx_code ix86_fp_compare_code_to_integer (enum rtx_code code) { switch (code) @@ -8969,16 +9995,17 @@ ix86_fp_compare_code_to_integer (enum rtx_code code) /* Split comparison code CODE into comparisons we can do using branch instructions. BYPASS_CODE is comparison code for branch that will branch around FIRST_CODE and SECOND_CODE. If some of branches - is not required, set value to NIL. + is not required, set value to UNKNOWN. We never require more than two branches. */ -static void + +void ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *bypass_code, enum rtx_code *first_code, enum rtx_code *second_code) { *first_code = code; - *bypass_code = NIL; - *second_code = NIL; + *bypass_code = UNKNOWN; + *second_code = UNKNOWN; /* The fcomi comparison sets flags as follows: @@ -9024,12 +10051,12 @@ ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *bypass_code, *second_code = UNORDERED; break; default: - abort (); + gcc_unreachable (); } if (!TARGET_IEEE_FP) { - *second_code = NIL; - *bypass_code = NIL; + *second_code = UNKNOWN; + *bypass_code = UNKNOWN; } } @@ -9066,7 +10093,7 @@ ix86_fp_comparison_arithmetics_cost (enum rtx_code code) return 6; break; default: - abort (); + gcc_unreachable (); } } @@ -9081,7 +10108,7 @@ ix86_fp_comparison_fcomi_cost (enum rtx_code code) if (!TARGET_CMOVE) return 1024; ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code); - return (bypass_code != NIL || second_code != NIL) + 2; + return (bypass_code != UNKNOWN || second_code != UNKNOWN) + 2; } /* Return cost of comparison done using sahf operation. @@ -9095,7 +10122,7 @@ ix86_fp_comparison_sahf_cost (enum rtx_code code) if (!TARGET_USE_SAHF && !optimize_size) return 1024; ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code); - return (bypass_code != NIL || second_code != NIL) + 3; + return (bypass_code != UNKNOWN || second_code != UNKNOWN) + 3; } /* Compute cost of the comparison done using any method. @@ -9139,8 +10166,8 @@ ix86_expand_fp_compare (enum rtx_code code, rtx op0, rtx op1, rtx scratch, ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code); /* Do fcomi/sahf based test when profitable. */ - if ((bypass_code == NIL || bypass_test) - && (second_code == NIL || second_test) + if ((bypass_code == UNKNOWN || bypass_test) + && (second_code == UNKNOWN || second_test) && ix86_fp_comparison_arithmetics_cost (code) > cost) { if (TARGET_CMOVE) @@ -9163,11 +10190,11 @@ ix86_expand_fp_compare (enum rtx_code code, rtx op0, rtx op1, rtx scratch, /* The FP codes work out to act like unsigned. */ intcmp_mode = fpcmp_mode; code = first_code; - if (bypass_code != NIL) + if (bypass_code != UNKNOWN) *bypass_test = gen_rtx_fmt_ee (bypass_code, VOIDmode, gen_rtx_REG (intcmp_mode, FLAGS_REG), const0_rtx); - if (second_code != NIL) + if (second_code != UNKNOWN) *second_test = gen_rtx_fmt_ee (second_code, VOIDmode, gen_rtx_REG (intcmp_mode, FLAGS_REG), const0_rtx); @@ -9293,7 +10320,7 @@ ix86_expand_fp_compare (enum rtx_code code, rtx op0, rtx op1, rtx scratch, break; default: - abort (); + gcc_unreachable (); } } @@ -9316,7 +10343,12 @@ ix86_expand_compare (enum rtx_code code, rtx *second_test, rtx *bypass_test) if (bypass_test) *bypass_test = NULL_RTX; - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) + if (ix86_compare_emitted) + { + ret = gen_rtx_fmt_ee (code, VOIDmode, ix86_compare_emitted, const0_rtx); + ix86_compare_emitted = NULL_RTX; + } + else if (SCALAR_FLOAT_MODE_P (GET_MODE (op0))) ret = ix86_expand_fp_compare (code, op0, op1, NULL_RTX, second_test, bypass_test); else @@ -9333,7 +10365,7 @@ ix86_fp_jump_nontrivial_p (enum rtx_code code) if (!TARGET_CMOVE) return true; ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code); - return bypass_code != NIL || second_code != NIL; + return bypass_code != UNKNOWN || second_code != UNKNOWN; } void @@ -9341,6 +10373,12 @@ ix86_expand_branch (enum rtx_code code, rtx label) { rtx tmp; + /* If we have emitted a compare insn, go straight to simple. + ix86_expand_compare won't emit anything if ix86_compare_emitted + is non NULL. */ + if (ix86_compare_emitted) + goto simple; + switch (GET_MODE (ix86_compare_op0)) { case QImode: @@ -9370,12 +10408,12 @@ ix86_expand_branch (enum rtx_code code, rtx label) /* Check whether we will use the natural sequence with one jump. If so, we can expand jump early. Otherwise delay expansion by creating compound insn to not confuse optimizers. */ - if (bypass_code == NIL && second_code == NIL + if (bypass_code == UNKNOWN && second_code == UNKNOWN && TARGET_CMOVE) { ix86_split_fp_branch (code, ix86_compare_op0, ix86_compare_op1, gen_rtx_LABEL_REF (VOIDmode, label), - pc_rtx, NULL_RTX); + pc_rtx, NULL_RTX, NULL_RTX); } else { @@ -9405,10 +10443,12 @@ ix86_expand_branch (enum rtx_code code, rtx label) case DImode: if (TARGET_64BIT) goto simple; + case TImode: /* Expand DImode branch into multiple compare+branch. */ { rtx lo[2], hi[2], label2; enum rtx_code code1, code2, code3; + enum machine_mode submode; if (CONSTANT_P (ix86_compare_op0) && ! CONSTANT_P (ix86_compare_op1)) { @@ -9417,8 +10457,18 @@ ix86_expand_branch (enum rtx_code code, rtx label) ix86_compare_op1 = tmp; code = swap_condition (code); } - split_di (&ix86_compare_op0, 1, lo+0, hi+0); - split_di (&ix86_compare_op1, 1, lo+1, hi+1); + if (GET_MODE (ix86_compare_op0) == DImode) + { + split_di (&ix86_compare_op0, 1, lo+0, hi+0); + split_di (&ix86_compare_op1, 1, lo+1, hi+1); + submode = SImode; + } + else + { + split_ti (&ix86_compare_op0, 1, lo+0, hi+0); + split_ti (&ix86_compare_op1, 1, lo+1, hi+1); + submode = DImode; + } /* When comparing for equality, we can use (hi0^hi1)|(lo0^lo1) to avoid two branches. This costs one extra insn, so disable when @@ -9432,15 +10482,15 @@ ix86_expand_branch (enum rtx_code code, rtx label) xor1 = hi[0]; if (hi[1] != const0_rtx) - xor1 = expand_binop (SImode, xor_optab, xor1, hi[1], + xor1 = expand_binop (submode, xor_optab, xor1, hi[1], NULL_RTX, 0, OPTAB_WIDEN); xor0 = lo[0]; if (lo[1] != const0_rtx) - xor0 = expand_binop (SImode, xor_optab, xor0, lo[1], + xor0 = expand_binop (submode, xor_optab, xor0, lo[1], NULL_RTX, 0, OPTAB_WIDEN); - tmp = expand_binop (SImode, ior_optab, xor1, xor0, + tmp = expand_binop (submode, ior_optab, xor1, xor0, NULL_RTX, 0, OPTAB_WIDEN); ix86_compare_op0 = tmp; @@ -9483,11 +10533,11 @@ ix86_expand_branch (enum rtx_code code, rtx label) case LEU: code1 = LTU; code2 = GTU; break; case GEU: code1 = GTU; code2 = LTU; break; - case EQ: code1 = NIL; code2 = NE; break; - case NE: code2 = NIL; break; + case EQ: code1 = UNKNOWN; code2 = NE; break; + case NE: code2 = UNKNOWN; break; default: - abort (); + gcc_unreachable (); } /* @@ -9501,29 +10551,29 @@ ix86_expand_branch (enum rtx_code code, rtx label) ix86_compare_op0 = hi[0]; ix86_compare_op1 = hi[1]; - if (code1 != NIL) + if (code1 != UNKNOWN) ix86_expand_branch (code1, label); - if (code2 != NIL) + if (code2 != UNKNOWN) ix86_expand_branch (code2, label2); ix86_compare_op0 = lo[0]; ix86_compare_op1 = lo[1]; ix86_expand_branch (code3, label); - if (code2 != NIL) + if (code2 != UNKNOWN) emit_label (label2); return; } default: - abort (); + gcc_unreachable (); } } /* Split branch based on floating point condition. */ void ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2, - rtx target1, rtx target2, rtx tmp) + rtx target1, rtx target2, rtx tmp, rtx pushed) { rtx second, bypass; rtx label = NULL_RTX; @@ -9542,6 +10592,10 @@ ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2, condition = ix86_expand_fp_compare (code, op1, op2, tmp, &second, &bypass); + /* Remove pushed operand from stack. */ + if (pushed) + ix86_free_from_memory (GET_MODE (pushed)); + if (split_branch_probability >= 0) { /* Distribute the probabilities across the jumps. @@ -9604,12 +10658,10 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) rtx ret, tmp, tmpreg, equiv; rtx second_test, bypass_test; - if (GET_MODE (ix86_compare_op0) == DImode - && !TARGET_64BIT) + if (GET_MODE (ix86_compare_op0) == (TARGET_64BIT ? TImode : DImode)) return 0; /* FAIL */ - if (GET_MODE (dest) != QImode) - abort (); + gcc_assert (GET_MODE (dest) == QImode); ret = ix86_expand_compare (code, &second_test, &bypass_test); PUT_MODE (ret, QImode); @@ -9625,8 +10677,7 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) rtx tmp2 = gen_reg_rtx (QImode); if (bypass_test) { - if (second_test) - abort (); + gcc_assert (!second_test); test = bypass_test; bypass = 1; PUT_CODE (test, reverse_condition_maybe_unordered (GET_CODE (test))); @@ -9641,10 +10692,13 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) } /* Attach a REG_EQUAL note describing the comparison result. */ - equiv = simplify_gen_relational (code, QImode, - GET_MODE (ix86_compare_op0), - ix86_compare_op0, ix86_compare_op1); - set_unique_reg_note (get_last_insn (), REG_EQUAL, equiv); + if (ix86_compare_op0 && ix86_compare_op1) + { + equiv = simplify_gen_relational (code, QImode, + GET_MODE (ix86_compare_op0), + ix86_compare_op0, ix86_compare_op1); + set_unique_reg_note (get_last_insn (), REG_EQUAL, equiv); + } return 1; /* DONE */ } @@ -9657,9 +10711,9 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) enum machine_mode mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1); - /* Do not handle DImode compares that go trought special path. Also we can't + /* Do not handle DImode compares that go through special path. Also we can't deal with FP compares yet. This is possible to add. */ - if ((mode == DImode && !TARGET_64BIT)) + if (mode == (TARGET_64BIT ? TImode : DImode)) return false; if (FLOAT_MODE_P (mode)) { @@ -9771,8 +10825,7 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) ix86_compare_op0 = op0; ix86_compare_op1 = op1; *pop = ix86_expand_compare (code, NULL, NULL); - if (GET_CODE (*pop) != LTU && GET_CODE (*pop) != GEU) - abort (); + gcc_assert (GET_CODE (*pop) == LTU || GET_CODE (*pop) == GEU); return true; } @@ -9800,7 +10853,7 @@ ix86_expand_int_movcc (rtx operands[]) HImode insns, we'd be swallowed in word prefix ops. */ if ((mode != HImode || TARGET_FAST_PREFIX) - && (mode != DImode || TARGET_64BIT) + && (mode != (TARGET_64BIT ? TImode : DImode)) && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT) { @@ -9975,7 +11028,7 @@ ix86_expand_int_movcc (rtx operands[]) } } - compare_code = NIL; + compare_code = UNKNOWN; if (GET_MODE_CLASS (GET_MODE (ix86_compare_op0)) == MODE_INT && GET_CODE (ix86_compare_op1) == CONST_INT) { @@ -9992,7 +11045,7 @@ ix86_expand_int_movcc (rtx operands[]) } /* Optimize dest = (op0 < 0) ? -1 : cf. */ - if (compare_code != NIL + if (compare_code != UNKNOWN && GET_MODE (ix86_compare_op0) == GET_MODE (out) && (cf == -1 || ct == -1)) { @@ -10033,7 +11086,8 @@ ix86_expand_int_movcc (rtx operands[]) if ((diff == 1 || diff == 2 || diff == 4 || diff == 8 || diff == 3 || diff == 5 || diff == 9) && ((mode != QImode && mode != HImode) || !TARGET_PARTIAL_REG_STALL) - && (mode != DImode || x86_64_sign_extended_value (GEN_INT (cf)))) + && (mode != DImode + || x86_64_immediate_operand (GEN_INT (cf), VOIDmode))) { /* * xorl dest,dest @@ -10119,12 +11173,12 @@ ix86_expand_int_movcc (rtx operands[]) else { code = reverse_condition (code); - if (compare_code != NIL) + if (compare_code != UNKNOWN) compare_code = reverse_condition (compare_code); } } - if (compare_code != NIL) + if (compare_code != UNKNOWN) { /* notl op1 (if needed) sarl $31, op1 @@ -10287,121 +11341,233 @@ ix86_expand_int_movcc (rtx operands[]) return 1; /* DONE */ } +/* Swap, force into registers, or otherwise massage the two operands + to an sse comparison with a mask result. Thus we differ a bit from + ix86_prepare_fp_compare_args which expects to produce a flags result. + + The DEST operand exists to help determine whether to commute commutative + operators. The POP0/POP1 operands are updated in place. The new + comparison code is returned, or UNKNOWN if not implementable. */ + +static enum rtx_code +ix86_prepare_sse_fp_compare_args (rtx dest, enum rtx_code code, + rtx *pop0, rtx *pop1) +{ + rtx tmp; + + switch (code) + { + case LTGT: + case UNEQ: + /* We have no LTGT as an operator. We could implement it with + NE & ORDERED, but this requires an extra temporary. It's + not clear that it's worth it. */ + return UNKNOWN; + + case LT: + case LE: + case UNGT: + case UNGE: + /* These are supported directly. */ + break; + + case EQ: + case NE: + case UNORDERED: + case ORDERED: + /* For commutative operators, try to canonicalize the destination + operand to be first in the comparison - this helps reload to + avoid extra moves. */ + if (!dest || !rtx_equal_p (dest, *pop1)) + break; + /* FALLTHRU */ + + case GE: + case GT: + case UNLE: + case UNLT: + /* These are not supported directly. Swap the comparison operands + to transform into something that is supported. */ + tmp = *pop0; + *pop0 = *pop1; + *pop1 = tmp; + code = swap_condition (code); + break; + + default: + gcc_unreachable (); + } + + return code; +} + +/* Detect conditional moves that exactly match min/max operational + semantics. Note that this is IEEE safe, as long as we don't + interchange the operands. + + Returns FALSE if this conditional move doesn't match a MIN/MAX, + and TRUE if the operation is successful and instructions are emitted. */ + +static bool +ix86_expand_sse_fp_minmax (rtx dest, enum rtx_code code, rtx cmp_op0, + rtx cmp_op1, rtx if_true, rtx if_false) +{ + enum machine_mode mode; + bool is_min; + rtx tmp; + + if (code == LT) + ; + else if (code == UNGE) + { + tmp = if_true; + if_true = if_false; + if_false = tmp; + } + else + return false; + + if (rtx_equal_p (cmp_op0, if_true) && rtx_equal_p (cmp_op1, if_false)) + is_min = true; + else if (rtx_equal_p (cmp_op1, if_true) && rtx_equal_p (cmp_op0, if_false)) + is_min = false; + else + return false; + + mode = GET_MODE (dest); + + /* We want to check HONOR_NANS and HONOR_SIGNED_ZEROS here, + but MODE may be a vector mode and thus not appropriate. */ + if (!flag_finite_math_only || !flag_unsafe_math_optimizations) + { + int u = is_min ? UNSPEC_IEEE_MIN : UNSPEC_IEEE_MAX; + rtvec v; + + if_true = force_reg (mode, if_true); + v = gen_rtvec (2, if_true, if_false); + tmp = gen_rtx_UNSPEC (mode, v, u); + } + else + { + code = is_min ? SMIN : SMAX; + tmp = gen_rtx_fmt_ee (code, mode, if_true, if_false); + } + + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + return true; +} + +/* Expand an sse vector comparison. Return the register with the result. */ + +static rtx +ix86_expand_sse_cmp (rtx dest, enum rtx_code code, rtx cmp_op0, rtx cmp_op1, + rtx op_true, rtx op_false) +{ + enum machine_mode mode = GET_MODE (dest); + rtx x; + + cmp_op0 = force_reg (mode, cmp_op0); + if (!nonimmediate_operand (cmp_op1, mode)) + cmp_op1 = force_reg (mode, cmp_op1); + + if (optimize + || reg_overlap_mentioned_p (dest, op_true) + || reg_overlap_mentioned_p (dest, op_false)) + dest = gen_reg_rtx (mode); + + x = gen_rtx_fmt_ee (code, mode, cmp_op0, cmp_op1); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + + return dest; +} + +/* Expand DEST = CMP ? OP_TRUE : OP_FALSE into a sequence of logical + operations. This is used for both scalar and vector conditional moves. */ + +static void +ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) +{ + enum machine_mode mode = GET_MODE (dest); + rtx t2, t3, x; + + if (op_false == CONST0_RTX (mode)) + { + op_true = force_reg (mode, op_true); + x = gen_rtx_AND (mode, cmp, op_true); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + else if (op_true == CONST0_RTX (mode)) + { + op_false = force_reg (mode, op_false); + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, op_false); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + else + { + op_true = force_reg (mode, op_true); + op_false = force_reg (mode, op_false); + + t2 = gen_reg_rtx (mode); + if (optimize) + t3 = gen_reg_rtx (mode); + else + t3 = dest; + + x = gen_rtx_AND (mode, op_true, cmp); + emit_insn (gen_rtx_SET (VOIDmode, t2, x)); + + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, op_false); + emit_insn (gen_rtx_SET (VOIDmode, t3, x)); + + x = gen_rtx_IOR (mode, t3, t2); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } +} + +/* Expand a floating-point conditional move. Return true if successful. */ + int ix86_expand_fp_movcc (rtx operands[]) { - enum rtx_code code; - rtx tmp; - rtx compare_op, second_test, bypass_test; + enum machine_mode mode = GET_MODE (operands[0]); + enum rtx_code code = GET_CODE (operands[1]); + rtx tmp, compare_op, second_test, bypass_test; - /* For SF/DFmode conditional moves based on comparisons - in same mode, we may want to use SSE min/max instructions. */ - if (((TARGET_SSE_MATH && GET_MODE (operands[0]) == SFmode) - || (TARGET_SSE2 && TARGET_SSE_MATH && GET_MODE (operands[0]) == DFmode)) - && GET_MODE (ix86_compare_op0) == GET_MODE (operands[0]) - /* The SSE comparisons does not support the LTGT/UNEQ pair. */ - && (!TARGET_IEEE_FP - || (GET_CODE (operands[1]) != LTGT && GET_CODE (operands[1]) != UNEQ)) - /* We may be called from the post-reload splitter. */ - && (!REG_P (operands[0]) - || SSE_REG_P (operands[0]) - || REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)) + if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode)) { - rtx op0 = ix86_compare_op0, op1 = ix86_compare_op1; - code = GET_CODE (operands[1]); + enum machine_mode cmode; - /* See if we have (cross) match between comparison operands and - conditional move operands. */ - if (rtx_equal_p (operands[2], op1)) - { - rtx tmp = op0; - op0 = op1; - op1 = tmp; - code = reverse_condition_maybe_unordered (code); - } - if (rtx_equal_p (operands[2], op0) && rtx_equal_p (operands[3], op1)) - { - /* Check for min operation. */ - if (code == LT || code == UNLE) - { - if (code == UNLE) - { - rtx tmp = op0; - op0 = op1; - op1 = tmp; - } - operands[0] = force_reg (GET_MODE (operands[0]), operands[0]); - if (memory_operand (op0, VOIDmode)) - op0 = force_reg (GET_MODE (operands[0]), op0); - if (GET_MODE (operands[0]) == SFmode) - emit_insn (gen_minsf3 (operands[0], op0, op1)); - else - emit_insn (gen_mindf3 (operands[0], op0, op1)); - return 1; - } - /* Check for max operation. */ - if (code == GT || code == UNGE) - { - if (code == UNGE) - { - rtx tmp = op0; - op0 = op1; - op1 = tmp; - } - operands[0] = force_reg (GET_MODE (operands[0]), operands[0]); - if (memory_operand (op0, VOIDmode)) - op0 = force_reg (GET_MODE (operands[0]), op0); - if (GET_MODE (operands[0]) == SFmode) - emit_insn (gen_maxsf3 (operands[0], op0, op1)); - else - emit_insn (gen_maxdf3 (operands[0], op0, op1)); - return 1; - } - } - /* Manage condition to be sse_comparison_operator. In case we are - in non-ieee mode, try to canonicalize the destination operand - to be first in the comparison - this helps reload to avoid extra - moves. */ - if (!sse_comparison_operator (operands[1], VOIDmode) - || (rtx_equal_p (operands[0], ix86_compare_op1) && !TARGET_IEEE_FP)) - { - rtx tmp = ix86_compare_op0; - ix86_compare_op0 = ix86_compare_op1; - ix86_compare_op1 = tmp; - operands[1] = gen_rtx_fmt_ee (swap_condition (GET_CODE (operands[1])), - VOIDmode, ix86_compare_op0, - ix86_compare_op1); - } - /* Similarly try to manage result to be first operand of conditional - move. We also don't support the NE comparison on SSE, so try to - avoid it. */ - if ((rtx_equal_p (operands[0], operands[3]) - && (!TARGET_IEEE_FP || GET_CODE (operands[1]) != EQ)) - || (GET_CODE (operands[1]) == NE && TARGET_IEEE_FP)) - { - rtx tmp = operands[2]; - operands[2] = operands[3]; - operands[3] = tmp; - operands[1] = gen_rtx_fmt_ee (reverse_condition_maybe_unordered - (GET_CODE (operands[1])), - VOIDmode, ix86_compare_op0, - ix86_compare_op1); - } - if (GET_MODE (operands[0]) == SFmode) - emit_insn (gen_sse_movsfcc (operands[0], operands[1], - operands[2], operands[3], - ix86_compare_op0, ix86_compare_op1)); - else - emit_insn (gen_sse_movdfcc (operands[0], operands[1], - operands[2], operands[3], - ix86_compare_op0, ix86_compare_op1)); + /* Since we've no cmove for sse registers, don't force bad register + allocation just to gain access to it. Deny movcc when the + comparison mode doesn't match the move mode. */ + cmode = GET_MODE (ix86_compare_op0); + if (cmode == VOIDmode) + cmode = GET_MODE (ix86_compare_op1); + if (cmode != mode) + return 0; + + code = ix86_prepare_sse_fp_compare_args (operands[0], code, + &ix86_compare_op0, + &ix86_compare_op1); + if (code == UNKNOWN) + return 0; + + if (ix86_expand_sse_fp_minmax (operands[0], code, ix86_compare_op0, + ix86_compare_op1, operands[2], + operands[3])) + return 1; + + tmp = ix86_expand_sse_cmp (operands[0], code, ix86_compare_op0, + ix86_compare_op1, operands[2], operands[3]); + ix86_expand_sse_movcc (operands[0], tmp, operands[2], operands[3]); return 1; } /* The floating point conditional move instructions don't directly support conditions resulting from a signed integer comparison. */ - code = GET_CODE (operands[1]); compare_op = ix86_expand_compare (code, &second_test, &bypass_test); /* The floating point conditional move instructions don't directly @@ -10409,8 +11575,7 @@ ix86_expand_fp_movcc (rtx operands[]) if (!fcmov_comparison_operator (compare_op, VOIDmode)) { - if (second_test != NULL || bypass_test != NULL) - abort (); + gcc_assert (!second_test && !bypass_test); tmp = gen_reg_rtx (QImode); ix86_expand_setcc (code, tmp); code = NE; @@ -10420,38 +11585,160 @@ ix86_expand_fp_movcc (rtx operands[]) } if (bypass_test && reg_overlap_mentioned_p (operands[0], operands[3])) { - tmp = gen_reg_rtx (GET_MODE (operands[0])); + tmp = gen_reg_rtx (mode); emit_move_insn (tmp, operands[3]); operands[3] = tmp; } if (second_test && reg_overlap_mentioned_p (operands[0], operands[2])) { - tmp = gen_reg_rtx (GET_MODE (operands[0])); + tmp = gen_reg_rtx (mode); emit_move_insn (tmp, operands[2]); operands[2] = tmp; } emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]), - compare_op, - operands[2], - operands[3]))); + gen_rtx_IF_THEN_ELSE (mode, compare_op, + operands[2], operands[3]))); if (bypass_test) emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]), - bypass_test, - operands[3], - operands[0]))); + gen_rtx_IF_THEN_ELSE (mode, bypass_test, + operands[3], operands[0]))); if (second_test) emit_insn (gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]), - second_test, - operands[2], - operands[0]))); + gen_rtx_IF_THEN_ELSE (mode, second_test, + operands[2], operands[0]))); return 1; } +/* Expand a floating-point vector conditional move; a vcond operation + rather than a movcc operation. */ + +bool +ix86_expand_fp_vcond (rtx operands[]) +{ + enum rtx_code code = GET_CODE (operands[3]); + rtx cmp; + + code = ix86_prepare_sse_fp_compare_args (operands[0], code, + &operands[4], &operands[5]); + if (code == UNKNOWN) + return false; + + if (ix86_expand_sse_fp_minmax (operands[0], code, operands[4], + operands[5], operands[1], operands[2])) + return true; + + cmp = ix86_expand_sse_cmp (operands[0], code, operands[4], operands[5], + operands[1], operands[2]); + ix86_expand_sse_movcc (operands[0], cmp, operands[1], operands[2]); + return true; +} + +/* Expand a signed integral vector conditional move. */ + +bool +ix86_expand_int_vcond (rtx operands[]) +{ + enum machine_mode mode = GET_MODE (operands[0]); + enum rtx_code code = GET_CODE (operands[3]); + bool negate = false; + rtx x, cop0, cop1; + + cop0 = operands[4]; + cop1 = operands[5]; + + /* Canonicalize the comparison to EQ, GT, GTU. */ + switch (code) + { + case EQ: + case GT: + case GTU: + break; + + case NE: + case LE: + case LEU: + code = reverse_condition (code); + negate = true; + break; + + case GE: + case GEU: + code = reverse_condition (code); + negate = true; + /* FALLTHRU */ + + case LT: + case LTU: + code = swap_condition (code); + x = cop0, cop0 = cop1, cop1 = x; + break; + + default: + gcc_unreachable (); + } + + /* Unsigned parallel compare is not supported by the hardware. Play some + tricks to turn this into a signed comparison against 0. */ + if (code == GTU) + { + cop0 = force_reg (mode, cop0); + + switch (mode) + { + case V4SImode: + { + rtx t1, t2, mask; + + /* Perform a parallel modulo subtraction. */ + t1 = gen_reg_rtx (mode); + emit_insn (gen_subv4si3 (t1, cop0, cop1)); + + /* Extract the original sign bit of op0. */ + mask = GEN_INT (-0x80000000); + mask = gen_rtx_CONST_VECTOR (mode, + gen_rtvec (4, mask, mask, mask, mask)); + mask = force_reg (mode, mask); + t2 = gen_reg_rtx (mode); + emit_insn (gen_andv4si3 (t2, cop0, mask)); + + /* XOR it back into the result of the subtraction. This results + in the sign bit set iff we saw unsigned underflow. */ + x = gen_reg_rtx (mode); + emit_insn (gen_xorv4si3 (x, t1, t2)); + + code = GT; + } + break; + + case V16QImode: + case V8HImode: + /* Perform a parallel unsigned saturating subtraction. */ + x = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, x, + gen_rtx_US_MINUS (mode, cop0, cop1))); + + code = EQ; + negate = !negate; + break; + + default: + gcc_unreachable (); + } + + cop0 = x; + cop1 = CONST0_RTX (mode); + } + + x = ix86_expand_sse_cmp (operands[0], code, cop0, cop1, + operands[1+negate], operands[2-negate]); + + ix86_expand_sse_movcc (operands[0], x, operands[1+negate], + operands[2-negate]); + return true; +} + /* Expand conditional increment or decrement using adb/sbb instructions. The default case using setcc followed by the conditional move can be done by generic code. */ @@ -10509,7 +11796,7 @@ ix86_expand_int_addcc (rtx operands[]) emit_insn (gen_subdi3_carry_rex64 (operands[0], operands[2], val, compare_op)); break; default: - abort (); + gcc_unreachable (); } } else @@ -10529,7 +11816,7 @@ ix86_expand_int_addcc (rtx operands[]) emit_insn (gen_adddi3_carry_rex64 (operands[0], operands[2], val, compare_op)); break; default: - abort (); + gcc_unreachable (); } } return 1; /* DONE */ @@ -10551,14 +11838,12 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) else size = (GET_MODE_SIZE (mode) + 4) / 8; - if (GET_CODE (operand) == REG && MMX_REGNO_P (REGNO (operand))) - abort (); - if (size < 2 || size > 3) - abort (); + gcc_assert (GET_CODE (operand) != REG || !MMX_REGNO_P (REGNO (operand))); + gcc_assert (size >= 2 && size <= 3); /* Optimize constant pool reference to immediates. This is used by fp moves, that force all constants to memory to allow combining. */ - if (GET_CODE (operand) == MEM && RTX_UNCHANGING_P (operand)) + if (GET_CODE (operand) == MEM && MEM_READONLY_P (operand)) { rtx tmp = maybe_get_pool_constant (operand); if (tmp) @@ -10568,14 +11853,28 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) if (GET_CODE (operand) == MEM && !offsettable_memref_p (operand)) { /* The only non-offsetable memories we handle are pushes. */ - if (! push_operand (operand, VOIDmode)) - abort (); + int ok = push_operand (operand, VOIDmode); + + gcc_assert (ok); operand = copy_rtx (operand); PUT_MODE (operand, Pmode); parts[0] = parts[1] = parts[2] = operand; + return size; } - else if (!TARGET_64BIT) + + if (GET_CODE (operand) == CONST_VECTOR) + { + enum machine_mode imode = int_mode_for_mode (mode); + /* Caution: if we looked through a constant pool memory above, + the operand may actually have a different mode now. That's + ok, since we want to pun this all the way back to an integer. */ + operand = simplify_subreg (imode, operand, GET_MODE (operand), 0); + gcc_assert (operand != NULL); + mode = imode; + } + + if (!TARGET_64BIT) { if (mode == DImode) split_di (&operand, 1, &parts[0], &parts[1]); @@ -10583,8 +11882,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) { if (REG_P (operand)) { - if (!reload_completed) - abort (); + gcc_assert (reload_completed); parts[0] = gen_rtx_REG (SImode, REGNO (operand) + 0); parts[1] = gen_rtx_REG (SImode, REGNO (operand) + 1); if (size == 3) @@ -10614,13 +11912,13 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) REAL_VALUE_TO_TARGET_DOUBLE (r, l); break; default: - abort (); + gcc_unreachable (); } parts[1] = gen_int_mode (l[1], SImode); parts[0] = gen_int_mode (l[0], SImode); } else - abort (); + gcc_unreachable (); } } else @@ -10632,8 +11930,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) enum machine_mode upper_mode = mode==XFmode ? SImode : DImode; if (REG_P (operand)) { - if (!reload_completed) - abort (); + gcc_assert (reload_completed); parts[0] = gen_rtx_REG (DImode, REGNO (operand) + 0); parts[1] = gen_rtx_REG (upper_mode, REGNO (operand) + 1); } @@ -10673,7 +11970,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) parts[1] = immed_double_const (l[2], l[3], DImode); } else - abort (); + gcc_unreachable (); } } @@ -10721,9 +12018,9 @@ ix86_split_long_move (rtx operands[]) /* The only non-offsettable memory we handle is push. */ if (push_operand (operands[0], VOIDmode)) push = 1; - else if (GET_CODE (operands[0]) == MEM - && ! offsettable_memref_p (operands[0])) - abort (); + else + gcc_assert (GET_CODE (operands[0]) != MEM + || offsettable_memref_p (operands[0])); nparts = ix86_split_to_parts (operands[1], part[1], GET_MODE (operands[0])); ix86_split_to_parts (operands[0], part[0], GET_MODE (operands[0])); @@ -10804,12 +12101,20 @@ ix86_split_long_move (rtx operands[]) moving of second half of TFmode value. */ if (GET_MODE (part[1][1]) == SImode) { - if (GET_CODE (part[1][1]) == MEM) - part[1][1] = adjust_address (part[1][1], DImode, 0); - else if (REG_P (part[1][1])) - part[1][1] = gen_rtx_REG (DImode, REGNO (part[1][1])); - else - abort (); + switch (GET_CODE (part[1][1])) + { + case MEM: + part[1][1] = adjust_address (part[1][1], DImode, 0); + break; + + case REG: + part[1][1] = gen_rtx_REG (DImode, REGNO (part[1][1])); + break; + + default: + gcc_unreachable (); + } + if (GET_MODE (part[1][0]) == SImode) part[1][0] = part[1][1]; } @@ -10864,6 +12169,33 @@ ix86_split_long_move (rtx operands[]) operands[6] = part[1][1]; } } + + /* If optimizing for size, attempt to locally unCSE nonzero constants. */ + if (optimize_size) + { + if (GET_CODE (operands[5]) == CONST_INT + && operands[5] != const0_rtx + && REG_P (operands[2])) + { + if (GET_CODE (operands[6]) == CONST_INT + && INTVAL (operands[6]) == INTVAL (operands[5])) + operands[6] = operands[2]; + + if (nparts == 3 + && GET_CODE (operands[7]) == CONST_INT + && INTVAL (operands[7]) == INTVAL (operands[5])) + operands[7] = operands[2]; + } + + if (nparts == 3 + && GET_CODE (operands[6]) == CONST_INT + && operands[6] != const0_rtx + && REG_P (operands[3]) + && GET_CODE (operands[7]) == CONST_INT + && INTVAL (operands[7]) == INTVAL (operands[6])) + operands[7] = operands[3]; + } + emit_move_insn (operands[2], operands[5]); emit_move_insn (operands[3], operands[6]); if (nparts == 3) @@ -10872,90 +12204,209 @@ ix86_split_long_move (rtx operands[]) return; } +/* Helper function of ix86_split_ashl used to generate an SImode/DImode + left shift by a constant, either using a single shift or + a sequence of add instructions. */ + +static void +ix86_expand_ashl_const (rtx operand, int count, enum machine_mode mode) +{ + if (count == 1) + { + emit_insn ((mode == DImode + ? gen_addsi3 + : gen_adddi3) (operand, operand, operand)); + } + else if (!optimize_size + && count * ix86_cost->add <= ix86_cost->shift_const) + { + int i; + for (i=0; i= 32) + if (count >= single_width) { emit_move_insn (high[0], low[1]); emit_move_insn (low[0], const0_rtx); - if (count > 32) - emit_insn (gen_ashlsi3 (high[0], high[0], GEN_INT (count - 32))); + if (count > single_width) + ix86_expand_ashl_const (high[0], count - single_width, mode); } else { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn (gen_x86_shld_1 (high[0], low[0], GEN_INT (count))); - emit_insn (gen_ashlsi3 (low[0], low[0], GEN_INT (count))); + emit_insn ((mode == DImode + ? gen_x86_shld_1 + : gen_x86_64_shld) (high[0], low[0], GEN_INT (count))); + ix86_expand_ashl_const (low[0], count, mode); } + return; + } + + (mode == DImode ? split_di : split_ti) (operands, 1, low, high); + + if (operands[1] == const1_rtx) + { + /* Assuming we've chosen a QImode capable registers, then 1 << N + can be done with two 32/64-bit shifts, no branches, no cmoves. */ + if (ANY_QI_REG_P (low[0]) && ANY_QI_REG_P (high[0])) + { + rtx s, d, flags = gen_rtx_REG (CCZmode, FLAGS_REG); + + ix86_expand_clear (low[0]); + ix86_expand_clear (high[0]); + emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (single_width))); + + d = gen_lowpart (QImode, low[0]); + d = gen_rtx_STRICT_LOW_PART (VOIDmode, d); + s = gen_rtx_EQ (QImode, flags, const0_rtx); + emit_insn (gen_rtx_SET (VOIDmode, d, s)); + + d = gen_lowpart (QImode, high[0]); + d = gen_rtx_STRICT_LOW_PART (VOIDmode, d); + s = gen_rtx_NE (QImode, flags, const0_rtx); + emit_insn (gen_rtx_SET (VOIDmode, d, s)); + } + + /* Otherwise, we can get the same results by manually performing + a bit extract operation on bit 5/6, and then performing the two + shifts. The two methods of getting 0/1 into low/high are exactly + the same size. Avoiding the shift in the bit extract case helps + pentium4 a bit; no one else seems to care much either way. */ + else + { + rtx x; + + if (TARGET_PARTIAL_REG_STALL && !optimize_size) + x = gen_rtx_ZERO_EXTEND (mode == DImode ? SImode : DImode, operands[2]); + else + x = gen_lowpart (mode == DImode ? SImode : DImode, operands[2]); + emit_insn (gen_rtx_SET (VOIDmode, high[0], x)); + + emit_insn ((mode == DImode + ? gen_lshrsi3 + : gen_lshrdi3) (high[0], high[0], GEN_INT (mode == DImode ? 5 : 6))); + emit_insn ((mode == DImode + ? gen_andsi3 + : gen_anddi3) (high[0], high[0], GEN_INT (1))); + emit_move_insn (low[0], high[0]); + emit_insn ((mode == DImode + ? gen_xorsi3 + : gen_xordi3) (low[0], low[0], GEN_INT (1))); + } + + emit_insn ((mode == DImode + ? gen_ashlsi3 + : gen_ashldi3) (low[0], low[0], operands[2])); + emit_insn ((mode == DImode + ? gen_ashlsi3 + : gen_ashldi3) (high[0], high[0], operands[2])); + return; + } + + if (operands[1] == constm1_rtx) + { + /* For -1 << N, we can avoid the shld instruction, because we + know that we're shifting 0...31/63 ones into a -1. */ + emit_move_insn (low[0], constm1_rtx); + if (optimize_size) + emit_move_insn (high[0], low[0]); + else + emit_move_insn (high[0], constm1_rtx); } else { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - split_di (operands, 1, low, high); - - emit_insn (gen_x86_shld_1 (high[0], low[0], operands[2])); - emit_insn (gen_ashlsi3 (low[0], low[0], operands[2])); - - if (TARGET_CMOVE && (! no_new_pseudos || scratch)) - { - if (! no_new_pseudos) - scratch = force_reg (SImode, const0_rtx); - else - emit_move_insn (scratch, const0_rtx); - - emit_insn (gen_x86_shift_adj_1 (high[0], low[0], operands[2], - scratch)); - } - else - emit_insn (gen_x86_shift_adj_2 (high[0], low[0], operands[2])); + (mode == DImode ? split_di : split_ti) (operands, 1, low, high); + emit_insn ((mode == DImode + ? gen_x86_shld_1 + : gen_x86_64_shld) (high[0], low[0], operands[2])); } + + emit_insn ((mode == DImode ? gen_ashlsi3 : gen_ashldi3) (low[0], low[0], operands[2])); + + if (TARGET_CMOVE && scratch) + { + ix86_expand_clear (scratch); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_1 + : gen_x86_64_shift_adj) (high[0], low[0], operands[2], scratch)); + } + else + emit_insn (gen_x86_shift_adj_2 (high[0], low[0], operands[2])); } void -ix86_split_ashrdi (rtx *operands, rtx scratch) +ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode) { rtx low[2], high[2]; int count; + const int single_width = mode == DImode ? 32 : 64; if (GET_CODE (operands[2]) == CONST_INT) { - split_di (operands, 2, low, high); - count = INTVAL (operands[2]) & 63; + (mode == DImode ? split_di : split_ti) (operands, 2, low, high); + count = INTVAL (operands[2]) & (single_width * 2 - 1); - if (count >= 32) + if (count == single_width * 2 - 1) + { + emit_move_insn (high[0], high[1]); + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (high[0], high[0], + GEN_INT (single_width - 1))); + emit_move_insn (low[0], high[0]); + + } + else if (count >= single_width) { emit_move_insn (low[0], high[1]); - - if (! reload_completed) - emit_insn (gen_ashrsi3 (high[0], low[0], GEN_INT (31))); - else - { - emit_move_insn (high[0], low[0]); - emit_insn (gen_ashrsi3 (high[0], high[0], GEN_INT (31))); - } - - if (count > 32) - emit_insn (gen_ashrsi3 (low[0], low[0], GEN_INT (count - 32))); + emit_move_insn (high[0], low[0]); + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (high[0], high[0], + GEN_INT (single_width - 1))); + if (count > single_width) + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (low[0], low[0], + GEN_INT (count - single_width))); } else { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn (gen_x86_shrd_1 (low[0], high[0], GEN_INT (count))); - emit_insn (gen_ashrsi3 (high[0], high[0], GEN_INT (count))); + emit_insn ((mode == DImode + ? gen_x86_shrd_1 + : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (high[0], high[0], GEN_INT (count))); } } else @@ -10963,19 +12414,26 @@ ix86_split_ashrdi (rtx *operands, rtx scratch) if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - split_di (operands, 1, low, high); + (mode == DImode ? split_di : split_ti) (operands, 1, low, high); - emit_insn (gen_x86_shrd_1 (low[0], high[0], operands[2])); - emit_insn (gen_ashrsi3 (high[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_x86_shrd_1 + : gen_x86_64_shrd) (low[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (high[0], high[0], operands[2])); - if (TARGET_CMOVE && (! no_new_pseudos || scratch)) + if (TARGET_CMOVE && scratch) { - if (! no_new_pseudos) - scratch = gen_reg_rtx (SImode); emit_move_insn (scratch, high[0]); - emit_insn (gen_ashrsi3 (scratch, scratch, GEN_INT (31))); - emit_insn (gen_x86_shift_adj_1 (low[0], high[0], operands[2], - scratch)); + emit_insn ((mode == DImode + ? gen_ashrsi3 + : gen_ashrdi3) (scratch, scratch, + GEN_INT (single_width - 1))); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_1 + : gen_x86_64_shift_adj) (low[0], high[0], operands[2], + scratch)); } else emit_insn (gen_x86_shift_adj_3 (low[0], high[0], operands[2])); @@ -10983,30 +12441,38 @@ ix86_split_ashrdi (rtx *operands, rtx scratch) } void -ix86_split_lshrdi (rtx *operands, rtx scratch) +ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode) { rtx low[2], high[2]; int count; + const int single_width = mode == DImode ? 32 : 64; if (GET_CODE (operands[2]) == CONST_INT) { - split_di (operands, 2, low, high); - count = INTVAL (operands[2]) & 63; + (mode == DImode ? split_di : split_ti) (operands, 2, low, high); + count = INTVAL (operands[2]) & (single_width * 2 - 1); - if (count >= 32) + if (count >= single_width) { emit_move_insn (low[0], high[1]); - emit_move_insn (high[0], const0_rtx); + ix86_expand_clear (high[0]); - if (count > 32) - emit_insn (gen_lshrsi3 (low[0], low[0], GEN_INT (count - 32))); + if (count > single_width) + emit_insn ((mode == DImode + ? gen_lshrsi3 + : gen_lshrdi3) (low[0], low[0], + GEN_INT (count - single_width))); } else { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - emit_insn (gen_x86_shrd_1 (low[0], high[0], GEN_INT (count))); - emit_insn (gen_lshrsi3 (high[0], high[0], GEN_INT (count))); + emit_insn ((mode == DImode + ? gen_x86_shrd_1 + : gen_x86_64_shrd) (low[0], high[0], GEN_INT (count))); + emit_insn ((mode == DImode + ? gen_lshrsi3 + : gen_lshrdi3) (high[0], high[0], GEN_INT (count))); } } else @@ -11014,21 +12480,23 @@ ix86_split_lshrdi (rtx *operands, rtx scratch) if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); - split_di (operands, 1, low, high); + (mode == DImode ? split_di : split_ti) (operands, 1, low, high); - emit_insn (gen_x86_shrd_1 (low[0], high[0], operands[2])); - emit_insn (gen_lshrsi3 (high[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_x86_shrd_1 + : gen_x86_64_shrd) (low[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_lshrsi3 + : gen_lshrdi3) (high[0], high[0], operands[2])); /* Heh. By reversing the arguments, we can reuse this pattern. */ - if (TARGET_CMOVE && (! no_new_pseudos || scratch)) + if (TARGET_CMOVE && scratch) { - if (! no_new_pseudos) - scratch = force_reg (SImode, const0_rtx); - else - emit_move_insn (scratch, const0_rtx); - - emit_insn (gen_x86_shift_adj_1 (low[0], high[0], operands[2], - scratch)); + ix86_expand_clear (scratch); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_1 + : gen_x86_64_shift_adj) (low[0], high[0], operands[2], + scratch)); } else emit_insn (gen_x86_shift_adj_2 (low[0], high[0], operands[2])); @@ -11076,9 +12544,9 @@ ix86_zero_extend_to_Pmode (rtx exp) } /* Expand string move (memcpy) operation. Use i386 string operations when - profitable. expand_clrstr contains similar code. */ + profitable. expand_clrmem contains similar code. */ int -ix86_expand_movstr (rtx dst, rtx src, rtx count_exp, rtx align_exp) +ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp) { rtx srcreg, destreg, countreg, srcexp, destexp; enum machine_mode counter_mode; @@ -11106,14 +12574,14 @@ ix86_expand_movstr (rtx dst, rtx src, rtx count_exp, rtx align_exp) /* Figure out proper mode for counter. For 32bits it is always SImode, for 64bits use SImode when possible, otherwise DImode. Set count to number of bytes copied when known at compile time. */ - if (!TARGET_64BIT || GET_MODE (count_exp) == SImode - || x86_64_zero_extended_value (count_exp)) + if (!TARGET_64BIT + || GET_MODE (count_exp) == SImode + || x86_64_zext_immediate_operand (count_exp, VOIDmode)) counter_mode = SImode; else counter_mode = DImode; - if (counter_mode != SImode && counter_mode != DImode) - abort (); + gcc_assert (counter_mode == SImode || counter_mode == DImode); destreg = copy_to_mode_reg (Pmode, XEXP (dst, 0)); if (destreg != XEXP (dst, 0)) @@ -11123,9 +12591,20 @@ ix86_expand_movstr (rtx dst, rtx src, rtx count_exp, rtx align_exp) src = replace_equiv_address_nv (src, srcreg); /* When optimizing for size emit simple rep ; movsb instruction for - counts not divisible by 4. */ + counts not divisible by 4, except when (movsl;)*(movsw;)?(movsb;)? + sequence is shorter than mov{b,l} $count, %{ecx,cl}; rep; movsb. + Sice of (movsl;)*(movsw;)?(movsb;)? sequence is + count / 4 + (count & 3), the other sequence is either 4 or 7 bytes, + but we don't know whether upper 24 (resp. 56) bits of %ecx will be + known to be zero or not. The rep; movsb sequence causes higher + register pressure though, so take that into account. */ - if ((!optimize || optimize_size) && (count == 0 || (count & 0x03))) + if ((!optimize || optimize_size) + && (count == 0 + || ((count & 0x03) + && (!optimize_size + || count > 5 * 4 + || (count & 3) + count / 4 > 6)))) { emit_insn (gen_cld ()); countreg = ix86_zero_extend_to_Pmode (count_exp); @@ -11151,19 +12630,36 @@ ix86_expand_movstr (rtx dst, rtx src, rtx count_exp, rtx align_exp) emit_insn (gen_cld ()); if (count & ~(size - 1)) { - countreg = copy_to_mode_reg (counter_mode, - GEN_INT ((count >> (size == 4 ? 2 : 3)) - & (TARGET_64BIT ? -1 : 0x3fffffff))); - countreg = ix86_zero_extend_to_Pmode (countreg); - - destexp = gen_rtx_ASHIFT (Pmode, countreg, - GEN_INT (size == 4 ? 2 : 3)); - srcexp = gen_rtx_PLUS (Pmode, destexp, srcreg); - destexp = gen_rtx_PLUS (Pmode, destexp, destreg); + if ((TARGET_SINGLE_STRINGOP || optimize_size) && count < 5 * 4) + { + enum machine_mode movs_mode = size == 4 ? SImode : DImode; - emit_insn (gen_rep_mov (destreg, dst, srcreg, src, - countreg, destexp, srcexp)); - offset = count & ~(size - 1); + while (offset < (count & ~(size - 1))) + { + srcmem = adjust_automodify_address_nv (src, movs_mode, + srcreg, offset); + dstmem = adjust_automodify_address_nv (dst, movs_mode, + destreg, offset); + emit_insn (gen_strmov (destreg, dstmem, srcreg, srcmem)); + offset += size; + } + } + else + { + countreg = GEN_INT ((count >> (size == 4 ? 2 : 3)) + & (TARGET_64BIT ? -1 : 0x3fffffff)); + countreg = copy_to_mode_reg (counter_mode, countreg); + countreg = ix86_zero_extend_to_Pmode (countreg); + + destexp = gen_rtx_ASHIFT (Pmode, countreg, + GEN_INT (size == 4 ? 2 : 3)); + srcexp = gen_rtx_PLUS (Pmode, destexp, srcreg); + destexp = gen_rtx_PLUS (Pmode, destexp, destreg); + + emit_insn (gen_rep_mov (destreg, dst, srcreg, src, + countreg, destexp, srcexp)); + offset = count & ~(size - 1); + } } if (size == 8 && (count & 0x04)) { @@ -11355,9 +12851,9 @@ ix86_expand_movstr (rtx dst, rtx src, rtx count_exp, rtx align_exp) } /* Expand string clear operation (bzero). Use i386 string operations when - profitable. expand_movstr contains similar code. */ + profitable. expand_movmem contains similar code. */ int -ix86_expand_clrstr (rtx dst, rtx count_exp, rtx align_exp) +ix86_expand_clrmem (rtx dst, rtx count_exp, rtx align_exp) { rtx destreg, zeroreg, countreg, destexp; enum machine_mode counter_mode; @@ -11384,8 +12880,9 @@ ix86_expand_clrstr (rtx dst, rtx count_exp, rtx align_exp) /* Figure out proper mode for counter. For 32bits it is always SImode, for 64bits use SImode when possible, otherwise DImode. Set count to number of bytes copied when known at compile time. */ - if (!TARGET_64BIT || GET_MODE (count_exp) == SImode - || x86_64_zero_extended_value (count_exp)) + if (!TARGET_64BIT + || GET_MODE (count_exp) == SImode + || x86_64_zext_immediate_operand (count_exp, VOIDmode)) counter_mode = SImode; else counter_mode = DImode; @@ -11394,13 +12891,20 @@ ix86_expand_clrstr (rtx dst, rtx count_exp, rtx align_exp) if (destreg != XEXP (dst, 0)) dst = replace_equiv_address_nv (dst, destreg); - emit_insn (gen_cld ()); /* When optimizing for size emit simple rep ; movsb instruction for - counts not divisible by 4. */ + counts not divisible by 4. The movl $N, %ecx; rep; stosb + sequence is 7 bytes long, so if optimizing for size and count is + small enough that some stosl, stosw and stosb instructions without + rep are shorter, fall back into the next if. */ - if ((!optimize || optimize_size) && (count == 0 || (count & 0x03))) + if ((!optimize || optimize_size) + && (count == 0 + || ((count & 0x03) + && (!optimize_size || (count & 0x03) + (count >> 2) > 7)))) { + emit_insn (gen_cld ()); + countreg = ix86_zero_extend_to_Pmode (count_exp); zeroreg = copy_to_mode_reg (QImode, const0_rtx); destexp = gen_rtx_PLUS (Pmode, destreg, countreg); @@ -11414,17 +12918,54 @@ ix86_expand_clrstr (rtx dst, rtx count_exp, rtx align_exp) int size = TARGET_64BIT && !optimize_size ? 8 : 4; unsigned HOST_WIDE_INT offset = 0; + emit_insn (gen_cld ()); + zeroreg = copy_to_mode_reg (size == 4 ? SImode : DImode, const0_rtx); if (count & ~(size - 1)) { - countreg = copy_to_mode_reg (counter_mode, - GEN_INT ((count >> (size == 4 ? 2 : 3)) - & (TARGET_64BIT ? -1 : 0x3fffffff))); - countreg = ix86_zero_extend_to_Pmode (countreg); - destexp = gen_rtx_ASHIFT (Pmode, countreg, GEN_INT (size == 4 ? 2 : 3)); - destexp = gen_rtx_PLUS (Pmode, destexp, destreg); - emit_insn (gen_rep_stos (destreg, countreg, dst, zeroreg, destexp)); - offset = count & ~(size - 1); + unsigned HOST_WIDE_INT repcount; + unsigned int max_nonrep; + + repcount = count >> (size == 4 ? 2 : 3); + if (!TARGET_64BIT) + repcount &= 0x3fffffff; + + /* movl $N, %ecx; rep; stosl is 7 bytes, while N x stosl is N bytes. + movl $N, %ecx; rep; stosq is 8 bytes, while N x stosq is 2xN + bytes. In both cases the latter seems to be faster for small + values of N. */ + max_nonrep = size == 4 ? 7 : 4; + if (!optimize_size) + switch (ix86_tune) + { + case PROCESSOR_PENTIUM4: + case PROCESSOR_NOCONA: + max_nonrep = 3; + break; + default: + break; + } + + if (repcount <= max_nonrep) + while (repcount-- > 0) + { + rtx mem = adjust_automodify_address_nv (dst, + GET_MODE (zeroreg), + destreg, offset); + emit_insn (gen_strset (destreg, mem, zeroreg)); + offset += size; + } + else + { + countreg = copy_to_mode_reg (counter_mode, GEN_INT (repcount)); + countreg = ix86_zero_extend_to_Pmode (countreg); + destexp = gen_rtx_ASHIFT (Pmode, countreg, + GEN_INT (size == 4 ? 2 : 3)); + destexp = gen_rtx_PLUS (Pmode, destexp, destreg); + emit_insn (gen_rep_stos (destreg, countreg, dst, zeroreg, + destexp)); + offset = count & ~(size - 1); + } } if (size == 8 && (count & 0x04)) { @@ -11700,9 +13241,9 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx) emit_cmp_and_jump_insns (align_rtx, const0_rtx, EQ, NULL, Pmode, 1, align_4_label); - emit_cmp_and_jump_insns (align_rtx, GEN_INT (2), EQ, NULL, + emit_cmp_and_jump_insns (align_rtx, const2_rtx, EQ, NULL, Pmode, 1, align_2_label); - emit_cmp_and_jump_insns (align_rtx, GEN_INT (2), GTU, NULL, + emit_cmp_and_jump_insns (align_rtx, const2_rtx, GTU, NULL, Pmode, 1, align_3_label); } else @@ -11710,7 +13251,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx) /* Since the alignment is 2, we have to check 2 or 0 bytes; check if is aligned to 4 - byte. */ - align_rtx = expand_binop (Pmode, and_optab, scratch1, GEN_INT (2), + align_rtx = expand_binop (Pmode, and_optab, scratch1, const2_rtx, NULL_RTX, 0, OPTAB_WIDEN); emit_cmp_and_jump_insns (align_rtx, const0_rtx, EQ, NULL, @@ -11796,7 +13337,7 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx) tmpreg))); /* Emit lea manually to avoid clobbering of flags. */ emit_insn (gen_rtx_SET (SImode, reg2, - gen_rtx_PLUS (Pmode, out, GEN_INT (2)))); + gen_rtx_PLUS (Pmode, out, const2_rtx))); tmp = gen_rtx_REG (CCNOmode, FLAGS_REG); tmp = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); @@ -11823,9 +13364,9 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx) /* Not in the first two. Move two bytes forward. */ emit_insn (gen_lshrsi3 (tmpreg, tmpreg, GEN_INT (16))); if (TARGET_64BIT) - emit_insn (gen_adddi3 (out, out, GEN_INT (2))); + emit_insn (gen_adddi3 (out, out, const2_rtx)); else - emit_insn (gen_addsi3 (out, out, GEN_INT (2))); + emit_insn (gen_addsi3 (out, out, const2_rtx)); emit_label (end_2_label); @@ -11852,18 +13393,23 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, if (pop == const0_rtx) pop = NULL; - if (TARGET_64BIT && pop) - abort (); + gcc_assert (!TARGET_64BIT || !pop); + if (TARGET_MACHO && !TARGET_64BIT) + { #if TARGET_MACHO - if (flag_pic && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF) - fnaddr = machopic_indirect_call_target (fnaddr); -#else - /* Static functions and indirect calls don't need the pic register. */ - if (! TARGET_64BIT && flag_pic - && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF - && ! SYMBOL_REF_LOCAL_P (XEXP (fnaddr, 0))) - use_reg (&use, pic_offset_table_rtx); + if (flag_pic && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF) + fnaddr = machopic_indirect_call_target (fnaddr); +#endif + } + else + { + /* Static functions and indirect calls don't need the pic register. */ + if (! TARGET_64BIT && flag_pic + && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF + && ! SYMBOL_REF_LOCAL_P (XEXP (fnaddr, 0))) + use_reg (&use, pic_offset_table_rtx); + } if (TARGET_64BIT && INTVAL (callarg2) >= 0) { @@ -11871,7 +13417,6 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, emit_move_insn (al, callarg2); use_reg (&use, al); } -#endif /* TARGET_MACHO */ if (! call_insn_operand (XEXP (fnaddr, 0), Pmode)) { @@ -11915,6 +13460,7 @@ ix86_init_machine_status (void) f = ggc_alloc_cleared (sizeof (struct machine_function)); f->use_fast_prologue_epilogue_nregs = -1; + f->tls_descriptor_call_expanded_p = 0; return f; } @@ -11926,12 +13472,11 @@ ix86_init_machine_status (void) which slot to use. */ rtx -assign_386_stack_local (enum machine_mode mode, int n) +assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n) { struct stack_local_entry *s; - if (n < 0 || n >= MAX_386_STACK_LOCALS) - abort (); + gcc_assert (n < MAX_386_STACK_LOCALS); for (s = ix86_stack_locals; s; s = s->next) if (s->mode == mode && s->n == n) @@ -11958,23 +13503,43 @@ ix86_tls_get_addr (void) if (!ix86_tls_symbol) { ix86_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, - (TARGET_GNU_TLS && !TARGET_64BIT) + (TARGET_ANY_GNU_TLS + && !TARGET_64BIT) ? "___tls_get_addr" : "__tls_get_addr"); } return ix86_tls_symbol; } + +/* Construct the SYMBOL_REF for the _TLS_MODULE_BASE_ symbol. */ + +static GTY(()) rtx ix86_tls_module_base_symbol; +rtx +ix86_tls_module_base (void) +{ + + if (!ix86_tls_module_base_symbol) + { + ix86_tls_module_base_symbol = gen_rtx_SYMBOL_REF (Pmode, + "_TLS_MODULE_BASE_"); + SYMBOL_REF_FLAGS (ix86_tls_module_base_symbol) + |= TLS_MODEL_GLOBAL_DYNAMIC << SYMBOL_FLAG_TLS_SHIFT; + } + + return ix86_tls_module_base_symbol; +} /* Calculate the length of the memory address in the instruction encoding. Does not include the one-byte modrm, opcode, or prefix. */ -static int +int memory_address_length (rtx addr) { struct ix86_address parts; rtx base, index, disp; int len; + int ok; if (GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == POST_INC @@ -11982,8 +13547,13 @@ memory_address_length (rtx addr) || GET_CODE (addr) == POST_MODIFY) return 0; - if (! ix86_decompose_address (addr, &parts)) - abort (); + ok = ix86_decompose_address (addr, &parts); + gcc_assert (ok); + + if (parts.base && GET_CODE (parts.base) == SUBREG) + parts.base = SUBREG_REG (parts.base); + if (parts.index && GET_CODE (parts.index) == SUBREG) + parts.index = SUBREG_REG (parts.index); base = parts.base; index = parts.index; @@ -12015,9 +13585,7 @@ memory_address_length (rtx addr) /* Find the length of the displacement constant. */ if (disp) { - if (GET_CODE (disp) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (disp), 'K') - && base) + if (base && satisfies_constraint_K (disp)) len = 1; else len = 4; @@ -12049,11 +13617,8 @@ ix86_attr_length_immediate_default (rtx insn, int shortform) for (i = recog_data.n_operands - 1; i >= 0; --i) if (CONSTANT_P (recog_data.operand[i])) { - if (len) - abort (); - if (shortform - && GET_CODE (recog_data.operand[i]) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (recog_data.operand[i]), 'K')) + gcc_assert (!len); + if (shortform && satisfies_constraint_K (recog_data.operand[i])) len = 1; else { @@ -12088,18 +13653,11 @@ ix86_attr_length_address_default (rtx insn) if (get_attr_type (insn) == TYPE_LEA) { rtx set = PATTERN (insn); - if (GET_CODE (set) == SET) - ; - else if (GET_CODE (set) == PARALLEL - && GET_CODE (XVECEXP (set, 0, 0)) == SET) + + if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - else - { -#ifdef ENABLE_CHECKING - abort (); -#endif - return 0; - } + + gcc_assert (GET_CODE (set) == SET); return memory_address_length (SET_SRC (set)); } @@ -12129,6 +13687,9 @@ ix86_issue_rate (void) case PROCESSOR_PENTIUM4: case PROCESSOR_ATHLON: case PROCESSOR_K8: + case PROCESSOR_NOCONA: + case PROCESSOR_GENERIC32: + case PROCESSOR_GENERIC64: return 3; default: @@ -12140,7 +13701,7 @@ ix86_issue_rate (void) by DEP_INSN and nothing set by DEP_INSN. */ static int -ix86_flags_dependant (rtx insn, rtx dep_insn, enum attr_type insn_type) +ix86_flags_dependent (rtx insn, rtx dep_insn, enum attr_type insn_type) { rtx set, set2; @@ -12185,7 +13746,7 @@ ix86_flags_dependant (rtx insn, rtx dep_insn, enum attr_type insn_type) address with operands set by DEP_INSN. */ static int -ix86_agi_dependant (rtx insn, rtx dep_insn, enum attr_type insn_type) +ix86_agi_dependent (rtx insn, rtx dep_insn, enum attr_type insn_type) { rtx addr; @@ -12193,13 +13754,12 @@ ix86_agi_dependant (rtx insn, rtx dep_insn, enum attr_type insn_type) && TARGET_PENTIUM) { addr = PATTERN (insn); - if (GET_CODE (addr) == SET) - ; - else if (GET_CODE (addr) == PARALLEL - && GET_CODE (XVECEXP (addr, 0, 0)) == SET) + + if (GET_CODE (addr) == PARALLEL) addr = XVECEXP (addr, 0, 0); - else - abort (); + + gcc_assert (GET_CODE (addr) == SET); + addr = SET_SRC (addr); } else @@ -12223,7 +13783,7 @@ static int ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { enum attr_type insn_type, dep_insn_type; - enum attr_memory memory, dep_memory; + enum attr_memory memory; rtx set, set2; int dep_insn_code_number; @@ -12244,30 +13804,22 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { case PROCESSOR_PENTIUM: /* Address Generation Interlock adds a cycle of latency. */ - if (ix86_agi_dependant (insn, dep_insn, insn_type)) + if (ix86_agi_dependent (insn, dep_insn, insn_type)) cost += 1; /* ??? Compares pair with jump/setcc. */ - if (ix86_flags_dependant (insn, dep_insn, insn_type)) + if (ix86_flags_dependent (insn, dep_insn, insn_type)) cost = 0; /* Floating point stores require value to be ready one cycle earlier. */ if (insn_type == TYPE_FMOV && get_attr_memory (insn) == MEMORY_STORE - && !ix86_agi_dependant (insn, dep_insn, insn_type)) + && !ix86_agi_dependent (insn, dep_insn, insn_type)) cost += 1; break; case PROCESSOR_PENTIUMPRO: memory = get_attr_memory (insn); - dep_memory = get_attr_memory (dep_insn); - - /* Since we can't represent delayed latencies of load+operation, - increase the cost here for non-imov insns. */ - if (dep_insn_type != TYPE_IMOV - && dep_insn_type != TYPE_FMOV - && (dep_memory == MEMORY_LOAD || dep_memory == MEMORY_BOTH)) - cost += 1; /* INT->FP conversion is expensive. */ if (get_attr_fp_int_src (dep_insn)) @@ -12285,7 +13837,7 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) in parallel with previous instruction in case previous instruction is not needed to compute the address. */ if ((memory == MEMORY_LOAD || memory == MEMORY_BOTH) - && !ix86_agi_dependant (insn, dep_insn, insn_type)) + && !ix86_agi_dependent (insn, dep_insn, insn_type)) { /* Claim moves to take one cycle, as core can issue one load at time and the next load can start cycle later. */ @@ -12299,18 +13851,13 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) case PROCESSOR_K6: memory = get_attr_memory (insn); - dep_memory = get_attr_memory (dep_insn); + /* The esp dependency is resolved before the instruction is really finished. */ if ((insn_type == TYPE_PUSH || insn_type == TYPE_POP) && (dep_insn_type == TYPE_PUSH || dep_insn_type == TYPE_POP)) return 1; - /* Since we can't represent delayed latencies of load+operation, - increase the cost here for non-imov insns. */ - if (dep_memory == MEMORY_LOAD || dep_memory == MEMORY_BOTH) - cost += (dep_insn_type != TYPE_IMOV) ? 2 : 1; - /* INT->FP conversion is expensive. */ if (get_attr_fp_int_src (dep_insn)) cost += 5; @@ -12319,7 +13866,7 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) in parallel with previous instruction in case previous instruction is not needed to compute the address. */ if ((memory == MEMORY_LOAD || memory == MEMORY_BOTH) - && !ix86_agi_dependant (insn, dep_insn, insn_type)) + && !ix86_agi_dependent (insn, dep_insn, insn_type)) { /* Claim moves to take one cycle, as core can issue one load at time and the next load can start cycle later. */ @@ -12335,14 +13882,15 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) case PROCESSOR_ATHLON: case PROCESSOR_K8: + case PROCESSOR_GENERIC32: + case PROCESSOR_GENERIC64: memory = get_attr_memory (insn); - dep_memory = get_attr_memory (dep_insn); /* Show ability of reorder buffer to hide latency of load by executing in parallel with previous instruction in case previous instruction is not needed to compute the address. */ if ((memory == MEMORY_LOAD || memory == MEMORY_BOTH) - && !ix86_agi_dependant (insn, dep_insn, insn_type)) + && !ix86_agi_dependent (insn, dep_insn, insn_type)) { enum attr_unit unit = get_attr_unit (insn); int loadcost = 3; @@ -12370,248 +13918,6 @@ ix86_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) return cost; } -static union -{ - struct ppro_sched_data - { - rtx decode[3]; - int issued_this_cycle; - } ppro; -} ix86_sched_data; - -static enum attr_ppro_uops -ix86_safe_ppro_uops (rtx insn) -{ - if (recog_memoized (insn) >= 0) - return get_attr_ppro_uops (insn); - else - return PPRO_UOPS_MANY; -} - -static void -ix86_dump_ppro_packet (FILE *dump) -{ - if (ix86_sched_data.ppro.decode[0]) - { - fprintf (dump, "PPRO packet: %d", - INSN_UID (ix86_sched_data.ppro.decode[0])); - if (ix86_sched_data.ppro.decode[1]) - fprintf (dump, " %d", INSN_UID (ix86_sched_data.ppro.decode[1])); - if (ix86_sched_data.ppro.decode[2]) - fprintf (dump, " %d", INSN_UID (ix86_sched_data.ppro.decode[2])); - fputc ('\n', dump); - } -} - -/* We're beginning a new block. Initialize data structures as necessary. */ - -static void -ix86_sched_init (FILE *dump ATTRIBUTE_UNUSED, - int sched_verbose ATTRIBUTE_UNUSED, - int veclen ATTRIBUTE_UNUSED) -{ - memset (&ix86_sched_data, 0, sizeof (ix86_sched_data)); -} - -/* Shift INSN to SLOT, and shift everything else down. */ - -static void -ix86_reorder_insn (rtx *insnp, rtx *slot) -{ - if (insnp != slot) - { - rtx insn = *insnp; - do - insnp[0] = insnp[1]; - while (++insnp != slot); - *insnp = insn; - } -} - -static void -ix86_sched_reorder_ppro (rtx *ready, rtx *e_ready) -{ - rtx decode[3]; - enum attr_ppro_uops cur_uops; - int issued_this_cycle; - rtx *insnp; - int i; - - /* At this point .ppro.decode contains the state of the three - decoders from last "cycle". That is, those insns that were - actually independent. But here we're scheduling for the - decoder, and we may find things that are decodable in the - same cycle. */ - - memcpy (decode, ix86_sched_data.ppro.decode, sizeof (decode)); - issued_this_cycle = 0; - - insnp = e_ready; - cur_uops = ix86_safe_ppro_uops (*insnp); - - /* If the decoders are empty, and we've a complex insn at the - head of the priority queue, let it issue without complaint. */ - if (decode[0] == NULL) - { - if (cur_uops == PPRO_UOPS_MANY) - { - decode[0] = *insnp; - goto ppro_done; - } - - /* Otherwise, search for a 2-4 uop unsn to issue. */ - while (cur_uops != PPRO_UOPS_FEW) - { - if (insnp == ready) - break; - cur_uops = ix86_safe_ppro_uops (*--insnp); - } - - /* If so, move it to the head of the line. */ - if (cur_uops == PPRO_UOPS_FEW) - ix86_reorder_insn (insnp, e_ready); - - /* Issue the head of the queue. */ - issued_this_cycle = 1; - decode[0] = *e_ready--; - } - - /* Look for simple insns to fill in the other two slots. */ - for (i = 1; i < 3; ++i) - if (decode[i] == NULL) - { - if (ready > e_ready) - goto ppro_done; - - insnp = e_ready; - cur_uops = ix86_safe_ppro_uops (*insnp); - while (cur_uops != PPRO_UOPS_ONE) - { - if (insnp == ready) - break; - cur_uops = ix86_safe_ppro_uops (*--insnp); - } - - /* Found one. Move it to the head of the queue and issue it. */ - if (cur_uops == PPRO_UOPS_ONE) - { - ix86_reorder_insn (insnp, e_ready); - decode[i] = *e_ready--; - issued_this_cycle++; - continue; - } - - /* ??? Didn't find one. Ideally, here we would do a lazy split - of 2-uop insns, issue one and queue the other. */ - } - - ppro_done: - if (issued_this_cycle == 0) - issued_this_cycle = 1; - ix86_sched_data.ppro.issued_this_cycle = issued_this_cycle; -} - -/* We are about to being issuing insns for this clock cycle. - Override the default sort algorithm to better slot instructions. */ -static int -ix86_sched_reorder (FILE *dump ATTRIBUTE_UNUSED, - int sched_verbose ATTRIBUTE_UNUSED, rtx *ready, - int *n_readyp, int clock_var ATTRIBUTE_UNUSED) -{ - int n_ready = *n_readyp; - rtx *e_ready = ready + n_ready - 1; - - /* Make sure to go ahead and initialize key items in - ix86_sched_data if we are not going to bother trying to - reorder the ready queue. */ - if (n_ready < 2) - { - ix86_sched_data.ppro.issued_this_cycle = 1; - goto out; - } - - switch (ix86_tune) - { - default: - break; - - case PROCESSOR_PENTIUMPRO: - ix86_sched_reorder_ppro (ready, e_ready); - break; - } - -out: - return ix86_issue_rate (); -} - -/* We are about to issue INSN. Return the number of insns left on the - ready queue that can be issued this cycle. */ - -static int -ix86_variable_issue (FILE *dump, int sched_verbose, rtx insn, - int can_issue_more) -{ - int i; - switch (ix86_tune) - { - default: - return can_issue_more - 1; - - case PROCESSOR_PENTIUMPRO: - { - enum attr_ppro_uops uops = ix86_safe_ppro_uops (insn); - - if (uops == PPRO_UOPS_MANY) - { - if (sched_verbose) - ix86_dump_ppro_packet (dump); - ix86_sched_data.ppro.decode[0] = insn; - ix86_sched_data.ppro.decode[1] = NULL; - ix86_sched_data.ppro.decode[2] = NULL; - if (sched_verbose) - ix86_dump_ppro_packet (dump); - ix86_sched_data.ppro.decode[0] = NULL; - } - else if (uops == PPRO_UOPS_FEW) - { - if (sched_verbose) - ix86_dump_ppro_packet (dump); - ix86_sched_data.ppro.decode[0] = insn; - ix86_sched_data.ppro.decode[1] = NULL; - ix86_sched_data.ppro.decode[2] = NULL; - } - else - { - for (i = 0; i < 3; ++i) - if (ix86_sched_data.ppro.decode[i] == NULL) - { - ix86_sched_data.ppro.decode[i] = insn; - break; - } - if (i == 3) - abort (); - if (i == 2) - { - if (sched_verbose) - ix86_dump_ppro_packet (dump); - ix86_sched_data.ppro.decode[0] = NULL; - ix86_sched_data.ppro.decode[1] = NULL; - ix86_sched_data.ppro.decode[2] = NULL; - } - } - } - return --ix86_sched_data.ppro.issued_this_cycle; - } -} - -static int -ia32_use_dfa_pipeline_interface (void) -{ - if (TARGET_PENTIUM || TARGET_ATHLON_K8) - return 1; - return 0; -} - /* How many alternative schedules to try. This should be as wide as the scheduling freedom in the DFA, but no wider. Making this value too large results extra work for the scheduler. */ @@ -12621,8 +13927,13 @@ ia32_multipass_dfa_lookahead (void) { if (ix86_tune == PROCESSOR_PENTIUM) return 2; + + if (ix86_tune == PROCESSOR_PENTIUMPRO + || ix86_tune == PROCESSOR_K6) + return 1; + else - return 0; + return 0; } @@ -12657,12 +13968,15 @@ ix86_constant_alignment (tree exp, int align) int ix86_data_alignment (tree type, int align) { + int max_align = optimize_size ? BITS_PER_WORD : 256; + if (AGGREGATE_TYPE_P (type) - && TYPE_SIZE (type) - && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 256 - || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 256) - return 256; + && TYPE_SIZE (type) + && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= (unsigned) max_align + || TREE_INT_CST_HIGH (TYPE_SIZE (type))) + && align < max_align) + align = max_align; /* x86-64 ABI requires arrays greater than 16 bytes to be aligned to 16byte boundary. */ @@ -12793,7 +14107,7 @@ x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) /* Try to load address using shorter movl instead of movabs. We may want to support movq for kernel mode, but kernel does not use trampolines at the moment. */ - if (x86_64_zero_extended_value (fnaddr)) + if (x86_64_zext_immediate_operand (fnaddr, VOIDmode)) { fnaddr = copy_to_mode_reg (DImode, fnaddr); emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, offset)), @@ -12822,24 +14136,459 @@ x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, offset+2)), gen_int_mode (0xe3, QImode)); offset += 3; - if (offset > TRAMPOLINE_SIZE) - abort (); + gcc_assert (offset <= TRAMPOLINE_SIZE); } #ifdef ENABLE_EXECUTE_STACK - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif } -#define def_builtin(MASK, NAME, TYPE, CODE) \ -do { \ - if ((MASK) & target_flags \ - && (!((MASK) & MASK_64BIT) || TARGET_64BIT)) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ - NULL, NULL_TREE); \ +/* Codes for all the SSE/MMX builtins. */ +enum ix86_builtins +{ + IX86_BUILTIN_ADDPS, + IX86_BUILTIN_ADDSS, + IX86_BUILTIN_DIVPS, + IX86_BUILTIN_DIVSS, + IX86_BUILTIN_MULPS, + IX86_BUILTIN_MULSS, + IX86_BUILTIN_SUBPS, + IX86_BUILTIN_SUBSS, + + IX86_BUILTIN_CMPEQPS, + IX86_BUILTIN_CMPLTPS, + IX86_BUILTIN_CMPLEPS, + IX86_BUILTIN_CMPGTPS, + IX86_BUILTIN_CMPGEPS, + IX86_BUILTIN_CMPNEQPS, + IX86_BUILTIN_CMPNLTPS, + IX86_BUILTIN_CMPNLEPS, + IX86_BUILTIN_CMPNGTPS, + IX86_BUILTIN_CMPNGEPS, + IX86_BUILTIN_CMPORDPS, + IX86_BUILTIN_CMPUNORDPS, + IX86_BUILTIN_CMPEQSS, + IX86_BUILTIN_CMPLTSS, + IX86_BUILTIN_CMPLESS, + IX86_BUILTIN_CMPNEQSS, + IX86_BUILTIN_CMPNLTSS, + IX86_BUILTIN_CMPNLESS, + IX86_BUILTIN_CMPNGTSS, + IX86_BUILTIN_CMPNGESS, + IX86_BUILTIN_CMPORDSS, + IX86_BUILTIN_CMPUNORDSS, + + IX86_BUILTIN_COMIEQSS, + IX86_BUILTIN_COMILTSS, + IX86_BUILTIN_COMILESS, + IX86_BUILTIN_COMIGTSS, + IX86_BUILTIN_COMIGESS, + IX86_BUILTIN_COMINEQSS, + IX86_BUILTIN_UCOMIEQSS, + IX86_BUILTIN_UCOMILTSS, + IX86_BUILTIN_UCOMILESS, + IX86_BUILTIN_UCOMIGTSS, + IX86_BUILTIN_UCOMIGESS, + IX86_BUILTIN_UCOMINEQSS, + + IX86_BUILTIN_CVTPI2PS, + IX86_BUILTIN_CVTPS2PI, + IX86_BUILTIN_CVTSI2SS, + IX86_BUILTIN_CVTSI642SS, + IX86_BUILTIN_CVTSS2SI, + IX86_BUILTIN_CVTSS2SI64, + IX86_BUILTIN_CVTTPS2PI, + IX86_BUILTIN_CVTTSS2SI, + IX86_BUILTIN_CVTTSS2SI64, + + IX86_BUILTIN_MAXPS, + IX86_BUILTIN_MAXSS, + IX86_BUILTIN_MINPS, + IX86_BUILTIN_MINSS, + + IX86_BUILTIN_LOADUPS, + IX86_BUILTIN_STOREUPS, + IX86_BUILTIN_MOVSS, + + IX86_BUILTIN_MOVHLPS, + IX86_BUILTIN_MOVLHPS, + IX86_BUILTIN_LOADHPS, + IX86_BUILTIN_LOADLPS, + IX86_BUILTIN_STOREHPS, + IX86_BUILTIN_STORELPS, + + IX86_BUILTIN_MASKMOVQ, + IX86_BUILTIN_MOVMSKPS, + IX86_BUILTIN_PMOVMSKB, + + IX86_BUILTIN_MOVNTPS, + IX86_BUILTIN_MOVNTQ, + + IX86_BUILTIN_LOADDQU, + IX86_BUILTIN_STOREDQU, + + IX86_BUILTIN_PACKSSWB, + IX86_BUILTIN_PACKSSDW, + IX86_BUILTIN_PACKUSWB, + + IX86_BUILTIN_PADDB, + IX86_BUILTIN_PADDW, + IX86_BUILTIN_PADDD, + IX86_BUILTIN_PADDQ, + IX86_BUILTIN_PADDSB, + IX86_BUILTIN_PADDSW, + IX86_BUILTIN_PADDUSB, + IX86_BUILTIN_PADDUSW, + IX86_BUILTIN_PSUBB, + IX86_BUILTIN_PSUBW, + IX86_BUILTIN_PSUBD, + IX86_BUILTIN_PSUBQ, + IX86_BUILTIN_PSUBSB, + IX86_BUILTIN_PSUBSW, + IX86_BUILTIN_PSUBUSB, + IX86_BUILTIN_PSUBUSW, + + IX86_BUILTIN_PAND, + IX86_BUILTIN_PANDN, + IX86_BUILTIN_POR, + IX86_BUILTIN_PXOR, + + IX86_BUILTIN_PAVGB, + IX86_BUILTIN_PAVGW, + + IX86_BUILTIN_PCMPEQB, + IX86_BUILTIN_PCMPEQW, + IX86_BUILTIN_PCMPEQD, + IX86_BUILTIN_PCMPGTB, + IX86_BUILTIN_PCMPGTW, + IX86_BUILTIN_PCMPGTD, + + IX86_BUILTIN_PMADDWD, + + IX86_BUILTIN_PMAXSW, + IX86_BUILTIN_PMAXUB, + IX86_BUILTIN_PMINSW, + IX86_BUILTIN_PMINUB, + + IX86_BUILTIN_PMULHUW, + IX86_BUILTIN_PMULHW, + IX86_BUILTIN_PMULLW, + + IX86_BUILTIN_PSADBW, + IX86_BUILTIN_PSHUFW, + + IX86_BUILTIN_PSLLW, + IX86_BUILTIN_PSLLD, + IX86_BUILTIN_PSLLQ, + IX86_BUILTIN_PSRAW, + IX86_BUILTIN_PSRAD, + IX86_BUILTIN_PSRLW, + IX86_BUILTIN_PSRLD, + IX86_BUILTIN_PSRLQ, + IX86_BUILTIN_PSLLWI, + IX86_BUILTIN_PSLLDI, + IX86_BUILTIN_PSLLQI, + IX86_BUILTIN_PSRAWI, + IX86_BUILTIN_PSRADI, + IX86_BUILTIN_PSRLWI, + IX86_BUILTIN_PSRLDI, + IX86_BUILTIN_PSRLQI, + + IX86_BUILTIN_PUNPCKHBW, + IX86_BUILTIN_PUNPCKHWD, + IX86_BUILTIN_PUNPCKHDQ, + IX86_BUILTIN_PUNPCKLBW, + IX86_BUILTIN_PUNPCKLWD, + IX86_BUILTIN_PUNPCKLDQ, + + IX86_BUILTIN_SHUFPS, + + IX86_BUILTIN_RCPPS, + IX86_BUILTIN_RCPSS, + IX86_BUILTIN_RSQRTPS, + IX86_BUILTIN_RSQRTSS, + IX86_BUILTIN_SQRTPS, + IX86_BUILTIN_SQRTSS, + + IX86_BUILTIN_UNPCKHPS, + IX86_BUILTIN_UNPCKLPS, + + IX86_BUILTIN_ANDPS, + IX86_BUILTIN_ANDNPS, + IX86_BUILTIN_ORPS, + IX86_BUILTIN_XORPS, + + IX86_BUILTIN_EMMS, + IX86_BUILTIN_LDMXCSR, + IX86_BUILTIN_STMXCSR, + IX86_BUILTIN_SFENCE, + + /* 3DNow! Original */ + IX86_BUILTIN_FEMMS, + IX86_BUILTIN_PAVGUSB, + IX86_BUILTIN_PF2ID, + IX86_BUILTIN_PFACC, + IX86_BUILTIN_PFADD, + IX86_BUILTIN_PFCMPEQ, + IX86_BUILTIN_PFCMPGE, + IX86_BUILTIN_PFCMPGT, + IX86_BUILTIN_PFMAX, + IX86_BUILTIN_PFMIN, + IX86_BUILTIN_PFMUL, + IX86_BUILTIN_PFRCP, + IX86_BUILTIN_PFRCPIT1, + IX86_BUILTIN_PFRCPIT2, + IX86_BUILTIN_PFRSQIT1, + IX86_BUILTIN_PFRSQRT, + IX86_BUILTIN_PFSUB, + IX86_BUILTIN_PFSUBR, + IX86_BUILTIN_PI2FD, + IX86_BUILTIN_PMULHRW, + + /* 3DNow! Athlon Extensions */ + IX86_BUILTIN_PF2IW, + IX86_BUILTIN_PFNACC, + IX86_BUILTIN_PFPNACC, + IX86_BUILTIN_PI2FW, + IX86_BUILTIN_PSWAPDSI, + IX86_BUILTIN_PSWAPDSF, + + /* SSE2 */ + IX86_BUILTIN_ADDPD, + IX86_BUILTIN_ADDSD, + IX86_BUILTIN_DIVPD, + IX86_BUILTIN_DIVSD, + IX86_BUILTIN_MULPD, + IX86_BUILTIN_MULSD, + IX86_BUILTIN_SUBPD, + IX86_BUILTIN_SUBSD, + + IX86_BUILTIN_CMPEQPD, + IX86_BUILTIN_CMPLTPD, + IX86_BUILTIN_CMPLEPD, + IX86_BUILTIN_CMPGTPD, + IX86_BUILTIN_CMPGEPD, + IX86_BUILTIN_CMPNEQPD, + IX86_BUILTIN_CMPNLTPD, + IX86_BUILTIN_CMPNLEPD, + IX86_BUILTIN_CMPNGTPD, + IX86_BUILTIN_CMPNGEPD, + IX86_BUILTIN_CMPORDPD, + IX86_BUILTIN_CMPUNORDPD, + IX86_BUILTIN_CMPNEPD, + IX86_BUILTIN_CMPEQSD, + IX86_BUILTIN_CMPLTSD, + IX86_BUILTIN_CMPLESD, + IX86_BUILTIN_CMPNEQSD, + IX86_BUILTIN_CMPNLTSD, + IX86_BUILTIN_CMPNLESD, + IX86_BUILTIN_CMPORDSD, + IX86_BUILTIN_CMPUNORDSD, + IX86_BUILTIN_CMPNESD, + + IX86_BUILTIN_COMIEQSD, + IX86_BUILTIN_COMILTSD, + IX86_BUILTIN_COMILESD, + IX86_BUILTIN_COMIGTSD, + IX86_BUILTIN_COMIGESD, + IX86_BUILTIN_COMINEQSD, + IX86_BUILTIN_UCOMIEQSD, + IX86_BUILTIN_UCOMILTSD, + IX86_BUILTIN_UCOMILESD, + IX86_BUILTIN_UCOMIGTSD, + IX86_BUILTIN_UCOMIGESD, + IX86_BUILTIN_UCOMINEQSD, + + IX86_BUILTIN_MAXPD, + IX86_BUILTIN_MAXSD, + IX86_BUILTIN_MINPD, + IX86_BUILTIN_MINSD, + + IX86_BUILTIN_ANDPD, + IX86_BUILTIN_ANDNPD, + IX86_BUILTIN_ORPD, + IX86_BUILTIN_XORPD, + + IX86_BUILTIN_SQRTPD, + IX86_BUILTIN_SQRTSD, + + IX86_BUILTIN_UNPCKHPD, + IX86_BUILTIN_UNPCKLPD, + + IX86_BUILTIN_SHUFPD, + + IX86_BUILTIN_LOADUPD, + IX86_BUILTIN_STOREUPD, + IX86_BUILTIN_MOVSD, + + IX86_BUILTIN_LOADHPD, + IX86_BUILTIN_LOADLPD, + + IX86_BUILTIN_CVTDQ2PD, + IX86_BUILTIN_CVTDQ2PS, + + IX86_BUILTIN_CVTPD2DQ, + IX86_BUILTIN_CVTPD2PI, + IX86_BUILTIN_CVTPD2PS, + IX86_BUILTIN_CVTTPD2DQ, + IX86_BUILTIN_CVTTPD2PI, + + IX86_BUILTIN_CVTPI2PD, + IX86_BUILTIN_CVTSI2SD, + IX86_BUILTIN_CVTSI642SD, + + IX86_BUILTIN_CVTSD2SI, + IX86_BUILTIN_CVTSD2SI64, + IX86_BUILTIN_CVTSD2SS, + IX86_BUILTIN_CVTSS2SD, + IX86_BUILTIN_CVTTSD2SI, + IX86_BUILTIN_CVTTSD2SI64, + + IX86_BUILTIN_CVTPS2DQ, + IX86_BUILTIN_CVTPS2PD, + IX86_BUILTIN_CVTTPS2DQ, + + IX86_BUILTIN_MOVNTI, + IX86_BUILTIN_MOVNTPD, + IX86_BUILTIN_MOVNTDQ, + + /* SSE2 MMX */ + IX86_BUILTIN_MASKMOVDQU, + IX86_BUILTIN_MOVMSKPD, + IX86_BUILTIN_PMOVMSKB128, + + IX86_BUILTIN_PACKSSWB128, + IX86_BUILTIN_PACKSSDW128, + IX86_BUILTIN_PACKUSWB128, + + IX86_BUILTIN_PADDB128, + IX86_BUILTIN_PADDW128, + IX86_BUILTIN_PADDD128, + IX86_BUILTIN_PADDQ128, + IX86_BUILTIN_PADDSB128, + IX86_BUILTIN_PADDSW128, + IX86_BUILTIN_PADDUSB128, + IX86_BUILTIN_PADDUSW128, + IX86_BUILTIN_PSUBB128, + IX86_BUILTIN_PSUBW128, + IX86_BUILTIN_PSUBD128, + IX86_BUILTIN_PSUBQ128, + IX86_BUILTIN_PSUBSB128, + IX86_BUILTIN_PSUBSW128, + IX86_BUILTIN_PSUBUSB128, + IX86_BUILTIN_PSUBUSW128, + + IX86_BUILTIN_PAND128, + IX86_BUILTIN_PANDN128, + IX86_BUILTIN_POR128, + IX86_BUILTIN_PXOR128, + + IX86_BUILTIN_PAVGB128, + IX86_BUILTIN_PAVGW128, + + IX86_BUILTIN_PCMPEQB128, + IX86_BUILTIN_PCMPEQW128, + IX86_BUILTIN_PCMPEQD128, + IX86_BUILTIN_PCMPGTB128, + IX86_BUILTIN_PCMPGTW128, + IX86_BUILTIN_PCMPGTD128, + + IX86_BUILTIN_PMADDWD128, + + IX86_BUILTIN_PMAXSW128, + IX86_BUILTIN_PMAXUB128, + IX86_BUILTIN_PMINSW128, + IX86_BUILTIN_PMINUB128, + + IX86_BUILTIN_PMULUDQ, + IX86_BUILTIN_PMULUDQ128, + IX86_BUILTIN_PMULHUW128, + IX86_BUILTIN_PMULHW128, + IX86_BUILTIN_PMULLW128, + + IX86_BUILTIN_PSADBW128, + IX86_BUILTIN_PSHUFHW, + IX86_BUILTIN_PSHUFLW, + IX86_BUILTIN_PSHUFD, + + IX86_BUILTIN_PSLLW128, + IX86_BUILTIN_PSLLD128, + IX86_BUILTIN_PSLLQ128, + IX86_BUILTIN_PSRAW128, + IX86_BUILTIN_PSRAD128, + IX86_BUILTIN_PSRLW128, + IX86_BUILTIN_PSRLD128, + IX86_BUILTIN_PSRLQ128, + IX86_BUILTIN_PSLLDQI128, + IX86_BUILTIN_PSLLWI128, + IX86_BUILTIN_PSLLDI128, + IX86_BUILTIN_PSLLQI128, + IX86_BUILTIN_PSRAWI128, + IX86_BUILTIN_PSRADI128, + IX86_BUILTIN_PSRLDQI128, + IX86_BUILTIN_PSRLWI128, + IX86_BUILTIN_PSRLDI128, + IX86_BUILTIN_PSRLQI128, + + IX86_BUILTIN_PUNPCKHBW128, + IX86_BUILTIN_PUNPCKHWD128, + IX86_BUILTIN_PUNPCKHDQ128, + IX86_BUILTIN_PUNPCKHQDQ128, + IX86_BUILTIN_PUNPCKLBW128, + IX86_BUILTIN_PUNPCKLWD128, + IX86_BUILTIN_PUNPCKLDQ128, + IX86_BUILTIN_PUNPCKLQDQ128, + + IX86_BUILTIN_CLFLUSH, + IX86_BUILTIN_MFENCE, + IX86_BUILTIN_LFENCE, + + /* Prescott New Instructions. */ + IX86_BUILTIN_ADDSUBPS, + IX86_BUILTIN_HADDPS, + IX86_BUILTIN_HSUBPS, + IX86_BUILTIN_MOVSHDUP, + IX86_BUILTIN_MOVSLDUP, + IX86_BUILTIN_ADDSUBPD, + IX86_BUILTIN_HADDPD, + IX86_BUILTIN_HSUBPD, + IX86_BUILTIN_LDDQU, + + IX86_BUILTIN_MONITOR, + IX86_BUILTIN_MWAIT, + + IX86_BUILTIN_VEC_INIT_V2SI, + IX86_BUILTIN_VEC_INIT_V4HI, + IX86_BUILTIN_VEC_INIT_V8QI, + IX86_BUILTIN_VEC_EXT_V2DF, + IX86_BUILTIN_VEC_EXT_V2DI, + IX86_BUILTIN_VEC_EXT_V4SF, + IX86_BUILTIN_VEC_EXT_V4SI, + IX86_BUILTIN_VEC_EXT_V8HI, + IX86_BUILTIN_VEC_EXT_V2SI, + IX86_BUILTIN_VEC_EXT_V4HI, + IX86_BUILTIN_VEC_SET_V8HI, + IX86_BUILTIN_VEC_SET_V4HI, + + IX86_BUILTIN_MAX +}; + +#define def_builtin(MASK, NAME, TYPE, CODE) \ +do { \ + if ((MASK) & target_flags \ + && (!((MASK) & MASK_64BIT) || TARGET_64BIT)) \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ + NULL, NULL_TREE); \ } while (0) +/* Bits for builtin_description.flag. */ + +/* Set when we don't support the comparison natively, and should + swap_comparison in order to support it. */ +#define BUILTIN_DESC_SWAP_OPERANDS 1 + struct builtin_description { const unsigned int mask; @@ -12885,41 +14634,49 @@ static const struct builtin_description bdesc_2arg[] = { MASK_SSE, CODE_FOR_subv4sf3, "__builtin_ia32_subps", IX86_BUILTIN_SUBPS, 0, 0 }, { MASK_SSE, CODE_FOR_mulv4sf3, "__builtin_ia32_mulps", IX86_BUILTIN_MULPS, 0, 0 }, { MASK_SSE, CODE_FOR_divv4sf3, "__builtin_ia32_divps", IX86_BUILTIN_DIVPS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, 0, 0 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, 0 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, 0 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, 0 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, 1 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, 1 }, - { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, 0 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, EQ, 0 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, LT, 0 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, LE, 0 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, LT, 1 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, LE, 1 }, - { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, UNORDERED, 0 }, - { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, 0 }, - { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, 0 }, - { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, 0 }, - { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, 0 }, - { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, EQ, 0 }, - { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, LT, 0 }, - { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, LE, 0 }, - { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, UNORDERED, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, NE, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, UNGE, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, UNGT, 0 }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, UNGE, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, UNGT, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, ORDERED, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, NE, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, UNGE, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, UNGT, 0 }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngtss", IX86_BUILTIN_CMPNGTSS, UNGE, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngess", IX86_BUILTIN_CMPNGESS, UNGT, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, ORDERED, 0 }, { MASK_SSE, CODE_FOR_sminv4sf3, "__builtin_ia32_minps", IX86_BUILTIN_MINPS, 0, 0 }, { MASK_SSE, CODE_FOR_smaxv4sf3, "__builtin_ia32_maxps", IX86_BUILTIN_MAXPS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, 0, 0 }, - { MASK_SSE, CODE_FOR_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, 0, 0 }, - { MASK_SSE, CODE_FOR_sse_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, 0, 0 }, + { MASK_SSE, CODE_FOR_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, 0, 0 }, { MASK_SSE, CODE_FOR_sse_nandv4sf3, "__builtin_ia32_andnps", IX86_BUILTIN_ANDNPS, 0, 0 }, - { MASK_SSE, CODE_FOR_sse_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, 0, 0 }, - { MASK_SSE, CODE_FOR_sse_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, 0, 0 }, + { MASK_SSE, CODE_FOR_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, 0, 0 }, + { MASK_SSE, CODE_FOR_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, 0, 0 }, { MASK_SSE, CODE_FOR_sse_movss, "__builtin_ia32_movss", IX86_BUILTIN_MOVSS, 0, 0 }, { MASK_SSE, CODE_FOR_sse_movhlps, "__builtin_ia32_movhlps", IX86_BUILTIN_MOVHLPS, 0, 0 }, @@ -12928,47 +14685,47 @@ static const struct builtin_description bdesc_2arg[] = { MASK_SSE, CODE_FOR_sse_unpcklps, "__builtin_ia32_unpcklps", IX86_BUILTIN_UNPCKLPS, 0, 0 }, /* MMX */ - { MASK_MMX, CODE_FOR_addv8qi3, "__builtin_ia32_paddb", IX86_BUILTIN_PADDB, 0, 0 }, - { MASK_MMX, CODE_FOR_addv4hi3, "__builtin_ia32_paddw", IX86_BUILTIN_PADDW, 0, 0 }, - { MASK_MMX, CODE_FOR_addv2si3, "__builtin_ia32_paddd", IX86_BUILTIN_PADDD, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_adddi3, "__builtin_ia32_paddq", IX86_BUILTIN_PADDQ, 0, 0 }, - { MASK_MMX, CODE_FOR_subv8qi3, "__builtin_ia32_psubb", IX86_BUILTIN_PSUBB, 0, 0 }, - { MASK_MMX, CODE_FOR_subv4hi3, "__builtin_ia32_psubw", IX86_BUILTIN_PSUBW, 0, 0 }, - { MASK_MMX, CODE_FOR_subv2si3, "__builtin_ia32_psubd", IX86_BUILTIN_PSUBD, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_subdi3, "__builtin_ia32_psubq", IX86_BUILTIN_PSUBQ, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_addv8qi3, "__builtin_ia32_paddb", IX86_BUILTIN_PADDB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_addv4hi3, "__builtin_ia32_paddw", IX86_BUILTIN_PADDW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_addv2si3, "__builtin_ia32_paddd", IX86_BUILTIN_PADDD, 0, 0 }, + { MASK_SSE2, CODE_FOR_mmx_adddi3, "__builtin_ia32_paddq", IX86_BUILTIN_PADDQ, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_subv8qi3, "__builtin_ia32_psubb", IX86_BUILTIN_PSUBB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_subv4hi3, "__builtin_ia32_psubw", IX86_BUILTIN_PSUBW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_subv2si3, "__builtin_ia32_psubd", IX86_BUILTIN_PSUBD, 0, 0 }, + { MASK_SSE2, CODE_FOR_mmx_subdi3, "__builtin_ia32_psubq", IX86_BUILTIN_PSUBQ, 0, 0 }, - { MASK_MMX, CODE_FOR_ssaddv8qi3, "__builtin_ia32_paddsb", IX86_BUILTIN_PADDSB, 0, 0 }, - { MASK_MMX, CODE_FOR_ssaddv4hi3, "__builtin_ia32_paddsw", IX86_BUILTIN_PADDSW, 0, 0 }, - { MASK_MMX, CODE_FOR_sssubv8qi3, "__builtin_ia32_psubsb", IX86_BUILTIN_PSUBSB, 0, 0 }, - { MASK_MMX, CODE_FOR_sssubv4hi3, "__builtin_ia32_psubsw", IX86_BUILTIN_PSUBSW, 0, 0 }, - { MASK_MMX, CODE_FOR_usaddv8qi3, "__builtin_ia32_paddusb", IX86_BUILTIN_PADDUSB, 0, 0 }, - { MASK_MMX, CODE_FOR_usaddv4hi3, "__builtin_ia32_paddusw", IX86_BUILTIN_PADDUSW, 0, 0 }, - { MASK_MMX, CODE_FOR_ussubv8qi3, "__builtin_ia32_psubusb", IX86_BUILTIN_PSUBUSB, 0, 0 }, - { MASK_MMX, CODE_FOR_ussubv4hi3, "__builtin_ia32_psubusw", IX86_BUILTIN_PSUBUSW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ssaddv8qi3, "__builtin_ia32_paddsb", IX86_BUILTIN_PADDSB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ssaddv4hi3, "__builtin_ia32_paddsw", IX86_BUILTIN_PADDSW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_sssubv8qi3, "__builtin_ia32_psubsb", IX86_BUILTIN_PSUBSB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_sssubv4hi3, "__builtin_ia32_psubsw", IX86_BUILTIN_PSUBSW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_usaddv8qi3, "__builtin_ia32_paddusb", IX86_BUILTIN_PADDUSB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_usaddv4hi3, "__builtin_ia32_paddusw", IX86_BUILTIN_PADDUSW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ussubv8qi3, "__builtin_ia32_psubusb", IX86_BUILTIN_PSUBUSB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ussubv4hi3, "__builtin_ia32_psubusw", IX86_BUILTIN_PSUBUSW, 0, 0 }, - { MASK_MMX, CODE_FOR_mulv4hi3, "__builtin_ia32_pmullw", IX86_BUILTIN_PMULLW, 0, 0 }, - { MASK_MMX, CODE_FOR_smulv4hi3_highpart, "__builtin_ia32_pmulhw", IX86_BUILTIN_PMULHW, 0, 0 }, - { MASK_SSE | MASK_3DNOW_A, CODE_FOR_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_mulv4hi3, "__builtin_ia32_pmullw", IX86_BUILTIN_PMULLW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_smulv4hi3_highpart, "__builtin_ia32_pmulhw", IX86_BUILTIN_PMULHW, 0, 0 }, + { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_anddi3, "__builtin_ia32_pand", IX86_BUILTIN_PAND, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_nanddi3, "__builtin_ia32_pandn", IX86_BUILTIN_PANDN, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_iordi3, "__builtin_ia32_por", IX86_BUILTIN_POR, 0, 0 }, - { MASK_MMX, CODE_FOR_mmx_xordi3, "__builtin_ia32_pxor", IX86_BUILTIN_PXOR, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_andv2si3, "__builtin_ia32_pand", IX86_BUILTIN_PAND, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_nandv2si3, "__builtin_ia32_pandn", IX86_BUILTIN_PANDN, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_iorv2si3, "__builtin_ia32_por", IX86_BUILTIN_POR, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_xorv2si3, "__builtin_ia32_pxor", IX86_BUILTIN_PXOR, 0, 0 }, { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgb", IX86_BUILTIN_PAVGB, 0, 0 }, { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_uavgv4hi3, "__builtin_ia32_pavgw", IX86_BUILTIN_PAVGW, 0, 0 }, - { MASK_MMX, CODE_FOR_eqv8qi3, "__builtin_ia32_pcmpeqb", IX86_BUILTIN_PCMPEQB, 0, 0 }, - { MASK_MMX, CODE_FOR_eqv4hi3, "__builtin_ia32_pcmpeqw", IX86_BUILTIN_PCMPEQW, 0, 0 }, - { MASK_MMX, CODE_FOR_eqv2si3, "__builtin_ia32_pcmpeqd", IX86_BUILTIN_PCMPEQD, 0, 0 }, - { MASK_MMX, CODE_FOR_gtv8qi3, "__builtin_ia32_pcmpgtb", IX86_BUILTIN_PCMPGTB, 0, 0 }, - { MASK_MMX, CODE_FOR_gtv4hi3, "__builtin_ia32_pcmpgtw", IX86_BUILTIN_PCMPGTW, 0, 0 }, - { MASK_MMX, CODE_FOR_gtv2si3, "__builtin_ia32_pcmpgtd", IX86_BUILTIN_PCMPGTD, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_eqv8qi3, "__builtin_ia32_pcmpeqb", IX86_BUILTIN_PCMPEQB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_eqv4hi3, "__builtin_ia32_pcmpeqw", IX86_BUILTIN_PCMPEQW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_eqv2si3, "__builtin_ia32_pcmpeqd", IX86_BUILTIN_PCMPEQD, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_gtv8qi3, "__builtin_ia32_pcmpgtb", IX86_BUILTIN_PCMPGTB, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_gtv4hi3, "__builtin_ia32_pcmpgtw", IX86_BUILTIN_PCMPGTW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_gtv2si3, "__builtin_ia32_pcmpgtd", IX86_BUILTIN_PCMPGTD, 0, 0 }, - { MASK_SSE | MASK_3DNOW_A, CODE_FOR_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, 0, 0 }, - { MASK_SSE | MASK_3DNOW_A, CODE_FOR_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, 0, 0 }, - { MASK_SSE | MASK_3DNOW_A, CODE_FOR_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, 0, 0 }, - { MASK_SSE | MASK_3DNOW_A, CODE_FOR_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, 0, 0 }, + { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, 0, 0 }, + { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, 0, 0 }, + { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, 0, 0 }, + { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_punpckhbw, "__builtin_ia32_punpckhbw", IX86_BUILTIN_PUNPCKHBW, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_punpckhwd, "__builtin_ia32_punpckhwd", IX86_BUILTIN_PUNPCKHWD, 0, 0 }, @@ -12982,28 +14739,28 @@ static const struct builtin_description bdesc_2arg[] = { MASK_MMX, CODE_FOR_mmx_packssdw, 0, IX86_BUILTIN_PACKSSDW, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_packuswb, 0, IX86_BUILTIN_PACKUSWB, 0, 0 }, - { MASK_SSE, CODE_FOR_cvtpi2ps, 0, IX86_BUILTIN_CVTPI2PS, 0, 0 }, - { MASK_SSE, CODE_FOR_cvtsi2ss, 0, IX86_BUILTIN_CVTSI2SS, 0, 0 }, - { MASK_SSE | MASK_64BIT, CODE_FOR_cvtsi2ssq, 0, IX86_BUILTIN_CVTSI642SS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvtpi2ps, 0, IX86_BUILTIN_CVTPI2PS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvtsi2ss, 0, IX86_BUILTIN_CVTSI2SS, 0, 0 }, + { MASK_SSE | MASK_64BIT, CODE_FOR_sse_cvtsi2ssq, 0, IX86_BUILTIN_CVTSI642SS, 0, 0 }, - { MASK_MMX, CODE_FOR_ashlv4hi3, 0, IX86_BUILTIN_PSLLW, 0, 0 }, - { MASK_MMX, CODE_FOR_ashlv4hi3, 0, IX86_BUILTIN_PSLLWI, 0, 0 }, - { MASK_MMX, CODE_FOR_ashlv2si3, 0, IX86_BUILTIN_PSLLD, 0, 0 }, - { MASK_MMX, CODE_FOR_ashlv2si3, 0, IX86_BUILTIN_PSLLDI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashlv4hi3, 0, IX86_BUILTIN_PSLLW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashlv4hi3, 0, IX86_BUILTIN_PSLLWI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashlv2si3, 0, IX86_BUILTIN_PSLLD, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashlv2si3, 0, IX86_BUILTIN_PSLLDI, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_ashldi3, 0, IX86_BUILTIN_PSLLQ, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_ashldi3, 0, IX86_BUILTIN_PSLLQI, 0, 0 }, - { MASK_MMX, CODE_FOR_lshrv4hi3, 0, IX86_BUILTIN_PSRLW, 0, 0 }, - { MASK_MMX, CODE_FOR_lshrv4hi3, 0, IX86_BUILTIN_PSRLWI, 0, 0 }, - { MASK_MMX, CODE_FOR_lshrv2si3, 0, IX86_BUILTIN_PSRLD, 0, 0 }, - { MASK_MMX, CODE_FOR_lshrv2si3, 0, IX86_BUILTIN_PSRLDI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_lshrv4hi3, 0, IX86_BUILTIN_PSRLW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_lshrv4hi3, 0, IX86_BUILTIN_PSRLWI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_lshrv2si3, 0, IX86_BUILTIN_PSRLD, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_lshrv2si3, 0, IX86_BUILTIN_PSRLDI, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_lshrdi3, 0, IX86_BUILTIN_PSRLQ, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_lshrdi3, 0, IX86_BUILTIN_PSRLQI, 0, 0 }, - { MASK_MMX, CODE_FOR_ashrv4hi3, 0, IX86_BUILTIN_PSRAW, 0, 0 }, - { MASK_MMX, CODE_FOR_ashrv4hi3, 0, IX86_BUILTIN_PSRAWI, 0, 0 }, - { MASK_MMX, CODE_FOR_ashrv2si3, 0, IX86_BUILTIN_PSRAD, 0, 0 }, - { MASK_MMX, CODE_FOR_ashrv2si3, 0, IX86_BUILTIN_PSRADI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashrv4hi3, 0, IX86_BUILTIN_PSRAW, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashrv4hi3, 0, IX86_BUILTIN_PSRAWI, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashrv2si3, 0, IX86_BUILTIN_PSRAD, 0, 0 }, + { MASK_MMX, CODE_FOR_mmx_ashrv2si3, 0, IX86_BUILTIN_PSRADI, 0, 0 }, { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_psadbw, 0, IX86_BUILTIN_PSADBW, 0, 0 }, { MASK_MMX, CODE_FOR_mmx_pmaddwd, 0, IX86_BUILTIN_PMADDWD, 0, 0 }, @@ -13013,41 +14770,45 @@ static const struct builtin_description bdesc_2arg[] = { MASK_SSE2, CODE_FOR_subv2df3, "__builtin_ia32_subpd", IX86_BUILTIN_SUBPD, 0, 0 }, { MASK_SSE2, CODE_FOR_mulv2df3, "__builtin_ia32_mulpd", IX86_BUILTIN_MULPD, 0, 0 }, { MASK_SSE2, CODE_FOR_divv2df3, "__builtin_ia32_divpd", IX86_BUILTIN_DIVPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmaddv2df3, "__builtin_ia32_addsd", IX86_BUILTIN_ADDSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmsubv2df3, "__builtin_ia32_subsd", IX86_BUILTIN_SUBSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmmulv2df3, "__builtin_ia32_mulsd", IX86_BUILTIN_MULSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmdivv2df3, "__builtin_ia32_divsd", IX86_BUILTIN_DIVSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmaddv2df3, "__builtin_ia32_addsd", IX86_BUILTIN_ADDSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmsubv2df3, "__builtin_ia32_subsd", IX86_BUILTIN_SUBSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmulv2df3, "__builtin_ia32_mulsd", IX86_BUILTIN_MULSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmdivv2df3, "__builtin_ia32_divsd", IX86_BUILTIN_DIVSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmpeqpd", IX86_BUILTIN_CMPEQPD, EQ, 0 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmpltpd", IX86_BUILTIN_CMPLTPD, LT, 0 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmplepd", IX86_BUILTIN_CMPLEPD, LE, 0 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmpgtpd", IX86_BUILTIN_CMPGTPD, LT, 1 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmpgepd", IX86_BUILTIN_CMPGEPD, LE, 1 }, - { MASK_SSE2, CODE_FOR_maskcmpv2df3, "__builtin_ia32_cmpunordpd", IX86_BUILTIN_CMPUNORDPD, UNORDERED, 0 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpneqpd", IX86_BUILTIN_CMPNEQPD, EQ, 0 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpnltpd", IX86_BUILTIN_CMPNLTPD, LT, 0 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpnlepd", IX86_BUILTIN_CMPNLEPD, LE, 0 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpngtpd", IX86_BUILTIN_CMPNGTPD, LT, 1 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpngepd", IX86_BUILTIN_CMPNGEPD, LE, 1 }, - { MASK_SSE2, CODE_FOR_maskncmpv2df3, "__builtin_ia32_cmpordpd", IX86_BUILTIN_CMPORDPD, UNORDERED, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskcmpv2df3, "__builtin_ia32_cmpeqsd", IX86_BUILTIN_CMPEQSD, EQ, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskcmpv2df3, "__builtin_ia32_cmpltsd", IX86_BUILTIN_CMPLTSD, LT, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskcmpv2df3, "__builtin_ia32_cmplesd", IX86_BUILTIN_CMPLESD, LE, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskcmpv2df3, "__builtin_ia32_cmpunordsd", IX86_BUILTIN_CMPUNORDSD, UNORDERED, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskncmpv2df3, "__builtin_ia32_cmpneqsd", IX86_BUILTIN_CMPNEQSD, EQ, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskncmpv2df3, "__builtin_ia32_cmpnltsd", IX86_BUILTIN_CMPNLTSD, LT, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskncmpv2df3, "__builtin_ia32_cmpnlesd", IX86_BUILTIN_CMPNLESD, LE, 0 }, - { MASK_SSE2, CODE_FOR_vmmaskncmpv2df3, "__builtin_ia32_cmpordsd", IX86_BUILTIN_CMPORDSD, UNORDERED, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpeqpd", IX86_BUILTIN_CMPEQPD, EQ, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpltpd", IX86_BUILTIN_CMPLTPD, LT, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmplepd", IX86_BUILTIN_CMPLEPD, LE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgtpd", IX86_BUILTIN_CMPGTPD, LT, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgepd", IX86_BUILTIN_CMPGEPD, LE, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpunordpd", IX86_BUILTIN_CMPUNORDPD, UNORDERED, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpneqpd", IX86_BUILTIN_CMPNEQPD, NE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnltpd", IX86_BUILTIN_CMPNLTPD, UNGE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnlepd", IX86_BUILTIN_CMPNLEPD, UNGT, 0 }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngtpd", IX86_BUILTIN_CMPNGTPD, UNGE, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngepd", IX86_BUILTIN_CMPNGEPD, UNGT, + BUILTIN_DESC_SWAP_OPERANDS }, + { MASK_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpordpd", IX86_BUILTIN_CMPORDPD, ORDERED, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpeqsd", IX86_BUILTIN_CMPEQSD, EQ, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpltsd", IX86_BUILTIN_CMPLTSD, LT, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmplesd", IX86_BUILTIN_CMPLESD, LE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpunordsd", IX86_BUILTIN_CMPUNORDSD, UNORDERED, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpneqsd", IX86_BUILTIN_CMPNEQSD, NE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnltsd", IX86_BUILTIN_CMPNLTSD, UNGE, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnlesd", IX86_BUILTIN_CMPNLESD, UNGT, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpordsd", IX86_BUILTIN_CMPORDSD, ORDERED, 0 }, { MASK_SSE2, CODE_FOR_sminv2df3, "__builtin_ia32_minpd", IX86_BUILTIN_MINPD, 0, 0 }, { MASK_SSE2, CODE_FOR_smaxv2df3, "__builtin_ia32_maxpd", IX86_BUILTIN_MAXPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmsminv2df3, "__builtin_ia32_minsd", IX86_BUILTIN_MINSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_vmsmaxv2df3, "__builtin_ia32_maxsd", IX86_BUILTIN_MAXSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmsminv2df3, "__builtin_ia32_minsd", IX86_BUILTIN_MINSD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_vmsmaxv2df3, "__builtin_ia32_maxsd", IX86_BUILTIN_MAXSD, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_andv2df3, "__builtin_ia32_andpd", IX86_BUILTIN_ANDPD, 0, 0 }, + { MASK_SSE2, CODE_FOR_andv2df3, "__builtin_ia32_andpd", IX86_BUILTIN_ANDPD, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_nandv2df3, "__builtin_ia32_andnpd", IX86_BUILTIN_ANDNPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_iorv2df3, "__builtin_ia32_orpd", IX86_BUILTIN_ORPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_xorv2df3, "__builtin_ia32_xorpd", IX86_BUILTIN_XORPD, 0, 0 }, + { MASK_SSE2, CODE_FOR_iorv2df3, "__builtin_ia32_orpd", IX86_BUILTIN_ORPD, 0, 0 }, + { MASK_SSE2, CODE_FOR_xorv2df3, "__builtin_ia32_xorpd", IX86_BUILTIN_XORPD, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_movsd, "__builtin_ia32_movsd", IX86_BUILTIN_MOVSD, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_unpckhpd, "__builtin_ia32_unpckhpd", IX86_BUILTIN_UNPCKHPD, 0, 0 }, @@ -13063,34 +14824,32 @@ static const struct builtin_description bdesc_2arg[] = { MASK_SSE2, CODE_FOR_subv4si3, "__builtin_ia32_psubd128", IX86_BUILTIN_PSUBD128, 0, 0 }, { MASK_SSE2, CODE_FOR_subv2di3, "__builtin_ia32_psubq128", IX86_BUILTIN_PSUBQ128, 0, 0 }, - { MASK_MMX, CODE_FOR_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, 0, 0 }, - { MASK_MMX, CODE_FOR_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, 0, 0 }, - { MASK_MMX, CODE_FOR_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, 0, 0 }, - { MASK_MMX, CODE_FOR_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, 0, 0 }, - { MASK_MMX, CODE_FOR_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, 0, 0 }, - { MASK_MMX, CODE_FOR_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, 0, 0 }, - { MASK_MMX, CODE_FOR_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, 0, 0 }, - { MASK_MMX, CODE_FOR_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, 0, 0 }, + { MASK_MMX, CODE_FOR_sse2_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, 0, 0 }, { MASK_SSE2, CODE_FOR_mulv8hi3, "__builtin_ia32_pmullw128", IX86_BUILTIN_PMULLW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_smulv8hi3_highpart, "__builtin_ia32_pmulhw128", IX86_BUILTIN_PMULHW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_umulsidi3, "__builtin_ia32_pmuludq", IX86_BUILTIN_PMULUDQ, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_umulv2siv2di3, "__builtin_ia32_pmuludq128", IX86_BUILTIN_PMULUDQ128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_smulv8hi3_highpart, "__builtin_ia32_pmulhw128", IX86_BUILTIN_PMULHW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_andv2di3, "__builtin_ia32_pand128", IX86_BUILTIN_PAND128, 0, 0 }, + { MASK_SSE2, CODE_FOR_andv2di3, "__builtin_ia32_pand128", IX86_BUILTIN_PAND128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_nandv2di3, "__builtin_ia32_pandn128", IX86_BUILTIN_PANDN128, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_iorv2di3, "__builtin_ia32_por128", IX86_BUILTIN_POR128, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_xorv2di3, "__builtin_ia32_pxor128", IX86_BUILTIN_PXOR128, 0, 0 }, + { MASK_SSE2, CODE_FOR_iorv2di3, "__builtin_ia32_por128", IX86_BUILTIN_POR128, 0, 0 }, + { MASK_SSE2, CODE_FOR_xorv2di3, "__builtin_ia32_pxor128", IX86_BUILTIN_PXOR128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_uavgv16qi3, "__builtin_ia32_pavgb128", IX86_BUILTIN_PAVGB128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_uavgv8hi3, "__builtin_ia32_pavgw128", IX86_BUILTIN_PAVGW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_eqv16qi3, "__builtin_ia32_pcmpeqb128", IX86_BUILTIN_PCMPEQB128, 0, 0 }, - { MASK_SSE2, CODE_FOR_eqv8hi3, "__builtin_ia32_pcmpeqw128", IX86_BUILTIN_PCMPEQW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_eqv4si3, "__builtin_ia32_pcmpeqd128", IX86_BUILTIN_PCMPEQD128, 0, 0 }, - { MASK_SSE2, CODE_FOR_gtv16qi3, "__builtin_ia32_pcmpgtb128", IX86_BUILTIN_PCMPGTB128, 0, 0 }, - { MASK_SSE2, CODE_FOR_gtv8hi3, "__builtin_ia32_pcmpgtw128", IX86_BUILTIN_PCMPGTW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_gtv4si3, "__builtin_ia32_pcmpgtd128", IX86_BUILTIN_PCMPGTD128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_eqv16qi3, "__builtin_ia32_pcmpeqb128", IX86_BUILTIN_PCMPEQB128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_eqv8hi3, "__builtin_ia32_pcmpeqw128", IX86_BUILTIN_PCMPEQW128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_eqv4si3, "__builtin_ia32_pcmpeqd128", IX86_BUILTIN_PCMPEQD128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_gtv16qi3, "__builtin_ia32_pcmpgtb128", IX86_BUILTIN_PCMPGTB128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_gtv8hi3, "__builtin_ia32_pcmpgtw128", IX86_BUILTIN_PCMPGTW128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_gtv4si3, "__builtin_ia32_pcmpgtd128", IX86_BUILTIN_PCMPGTD128, 0, 0 }, { MASK_SSE2, CODE_FOR_umaxv16qi3, "__builtin_ia32_pmaxub128", IX86_BUILTIN_PMAXUB128, 0, 0 }, { MASK_SSE2, CODE_FOR_smaxv8hi3, "__builtin_ia32_pmaxsw128", IX86_BUILTIN_PMAXSW128, 0, 0 }, @@ -13110,42 +14869,37 @@ static const struct builtin_description bdesc_2arg[] = { MASK_SSE2, CODE_FOR_sse2_packssdw, "__builtin_ia32_packssdw128", IX86_BUILTIN_PACKSSDW128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_packuswb, "__builtin_ia32_packuswb128", IX86_BUILTIN_PACKUSWB128, 0, 0 }, - { MASK_SSE2, CODE_FOR_umulv8hi3_highpart, "__builtin_ia32_pmulhuw128", IX86_BUILTIN_PMULHUW128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_umulv8hi3_highpart, "__builtin_ia32_pmulhuw128", IX86_BUILTIN_PMULHUW128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_psadbw, 0, IX86_BUILTIN_PSADBW128, 0, 0 }, - { MASK_SSE2, CODE_FOR_ashlv8hi3_ti, 0, IX86_BUILTIN_PSLLW128, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_umulsidi3, 0, IX86_BUILTIN_PMULUDQ, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_umulv2siv2di3, 0, IX86_BUILTIN_PMULUDQ128, 0, 0 }, + { MASK_SSE2, CODE_FOR_ashlv8hi3, 0, IX86_BUILTIN_PSLLWI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_ashlv4si3_ti, 0, IX86_BUILTIN_PSLLD128, 0, 0 }, { MASK_SSE2, CODE_FOR_ashlv4si3, 0, IX86_BUILTIN_PSLLDI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_ashlv2di3_ti, 0, IX86_BUILTIN_PSLLQ128, 0, 0 }, { MASK_SSE2, CODE_FOR_ashlv2di3, 0, IX86_BUILTIN_PSLLQI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_lshrv8hi3_ti, 0, IX86_BUILTIN_PSRLW128, 0, 0 }, { MASK_SSE2, CODE_FOR_lshrv8hi3, 0, IX86_BUILTIN_PSRLWI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_lshrv4si3_ti, 0, IX86_BUILTIN_PSRLD128, 0, 0 }, { MASK_SSE2, CODE_FOR_lshrv4si3, 0, IX86_BUILTIN_PSRLDI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_lshrv2di3_ti, 0, IX86_BUILTIN_PSRLQ128, 0, 0 }, { MASK_SSE2, CODE_FOR_lshrv2di3, 0, IX86_BUILTIN_PSRLQI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_ashrv8hi3_ti, 0, IX86_BUILTIN_PSRAW128, 0, 0 }, { MASK_SSE2, CODE_FOR_ashrv8hi3, 0, IX86_BUILTIN_PSRAWI128, 0, 0 }, - { MASK_SSE2, CODE_FOR_ashrv4si3_ti, 0, IX86_BUILTIN_PSRAD128, 0, 0 }, { MASK_SSE2, CODE_FOR_ashrv4si3, 0, IX86_BUILTIN_PSRADI128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_pmaddwd, 0, IX86_BUILTIN_PMADDWD128, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtsi2sd, 0, IX86_BUILTIN_CVTSI2SD, 0, 0 }, - { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvtsi2sdq, 0, IX86_BUILTIN_CVTSI642SD, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtsd2ss, 0, IX86_BUILTIN_CVTSD2SS, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtss2sd, 0, IX86_BUILTIN_CVTSS2SD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtsi2sd, 0, IX86_BUILTIN_CVTSI2SD, 0, 0 }, + { MASK_SSE2 | MASK_64BIT, CODE_FOR_sse2_cvtsi2sdq, 0, IX86_BUILTIN_CVTSI642SD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtsd2ss, 0, IX86_BUILTIN_CVTSD2SS, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtss2sd, 0, IX86_BUILTIN_CVTSS2SD, 0, 0 }, /* SSE3 MMX */ - { MASK_SSE3, CODE_FOR_addsubv4sf3, "__builtin_ia32_addsubps", IX86_BUILTIN_ADDSUBPS, 0, 0 }, - { MASK_SSE3, CODE_FOR_addsubv2df3, "__builtin_ia32_addsubpd", IX86_BUILTIN_ADDSUBPD, 0, 0 }, - { MASK_SSE3, CODE_FOR_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, 0, 0 }, - { MASK_SSE3, CODE_FOR_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, 0, 0 }, - { MASK_SSE3, CODE_FOR_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, 0, 0 }, - { MASK_SSE3, CODE_FOR_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, 0, 0 } + { MASK_SSE3, CODE_FOR_sse3_addsubv4sf3, "__builtin_ia32_addsubps", IX86_BUILTIN_ADDSUBPS, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_addsubv2df3, "__builtin_ia32_addsubpd", IX86_BUILTIN_ADDSUBPD, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, 0, 0 } }; static const struct builtin_description bdesc_1arg[] = @@ -13154,52 +14908,47 @@ static const struct builtin_description bdesc_1arg[] = { MASK_SSE, CODE_FOR_sse_movmskps, 0, IX86_BUILTIN_MOVMSKPS, 0, 0 }, { MASK_SSE, CODE_FOR_sqrtv4sf2, 0, IX86_BUILTIN_SQRTPS, 0, 0 }, - { MASK_SSE, CODE_FOR_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS, 0, 0 }, - { MASK_SSE, CODE_FOR_rcpv4sf2, 0, IX86_BUILTIN_RCPPS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_rcpv4sf2, 0, IX86_BUILTIN_RCPPS, 0, 0 }, - { MASK_SSE, CODE_FOR_cvtps2pi, 0, IX86_BUILTIN_CVTPS2PI, 0, 0 }, - { MASK_SSE, CODE_FOR_cvtss2si, 0, IX86_BUILTIN_CVTSS2SI, 0, 0 }, - { MASK_SSE | MASK_64BIT, CODE_FOR_cvtss2siq, 0, IX86_BUILTIN_CVTSS2SI64, 0, 0 }, - { MASK_SSE, CODE_FOR_cvttps2pi, 0, IX86_BUILTIN_CVTTPS2PI, 0, 0 }, - { MASK_SSE, CODE_FOR_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 }, - { MASK_SSE | MASK_64BIT, CODE_FOR_cvttss2siq, 0, IX86_BUILTIN_CVTTSS2SI64, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvtps2pi, 0, IX86_BUILTIN_CVTPS2PI, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvtss2si, 0, IX86_BUILTIN_CVTSS2SI, 0, 0 }, + { MASK_SSE | MASK_64BIT, CODE_FOR_sse_cvtss2siq, 0, IX86_BUILTIN_CVTSS2SI64, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvttps2pi, 0, IX86_BUILTIN_CVTTPS2PI, 0, 0 }, + { MASK_SSE, CODE_FOR_sse_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 }, + { MASK_SSE | MASK_64BIT, CODE_FOR_sse_cvttss2siq, 0, IX86_BUILTIN_CVTTSS2SI64, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB128, 0, 0 }, { MASK_SSE2, CODE_FOR_sse2_movmskpd, 0, IX86_BUILTIN_MOVMSKPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_movq2dq, 0, IX86_BUILTIN_MOVQ2DQ, 0, 0 }, - { MASK_SSE2, CODE_FOR_sse2_movdq2q, 0, IX86_BUILTIN_MOVDQ2Q, 0, 0 }, { MASK_SSE2, CODE_FOR_sqrtv2df2, 0, IX86_BUILTIN_SQRTPD, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtdq2pd, 0, IX86_BUILTIN_CVTDQ2PD, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtdq2ps, 0, IX86_BUILTIN_CVTDQ2PS, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtdq2pd, 0, IX86_BUILTIN_CVTDQ2PD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtdq2ps, 0, IX86_BUILTIN_CVTDQ2PS, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtpd2dq, 0, IX86_BUILTIN_CVTPD2DQ, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtpd2pi, 0, IX86_BUILTIN_CVTPD2PI, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtpd2ps, 0, IX86_BUILTIN_CVTPD2PS, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvttpd2dq, 0, IX86_BUILTIN_CVTTPD2DQ, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvttpd2pi, 0, IX86_BUILTIN_CVTTPD2PI, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtpd2dq, 0, IX86_BUILTIN_CVTPD2DQ, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtpd2pi, 0, IX86_BUILTIN_CVTPD2PI, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtpd2ps, 0, IX86_BUILTIN_CVTPD2PS, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvttpd2dq, 0, IX86_BUILTIN_CVTTPD2DQ, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvttpd2pi, 0, IX86_BUILTIN_CVTTPD2PI, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtpi2pd, 0, IX86_BUILTIN_CVTPI2PD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtpi2pd, 0, IX86_BUILTIN_CVTPI2PD, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtsd2si, 0, IX86_BUILTIN_CVTSD2SI, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvttsd2si, 0, IX86_BUILTIN_CVTTSD2SI, 0, 0 }, - { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvtsd2siq, 0, IX86_BUILTIN_CVTSD2SI64, 0, 0 }, - { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvttsd2siq, 0, IX86_BUILTIN_CVTTSD2SI64, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtsd2si, 0, IX86_BUILTIN_CVTSD2SI, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvttsd2si, 0, IX86_BUILTIN_CVTTSD2SI, 0, 0 }, + { MASK_SSE2 | MASK_64BIT, CODE_FOR_sse2_cvtsd2siq, 0, IX86_BUILTIN_CVTSD2SI64, 0, 0 }, + { MASK_SSE2 | MASK_64BIT, CODE_FOR_sse2_cvttsd2siq, 0, IX86_BUILTIN_CVTTSD2SI64, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtps2dq, 0, IX86_BUILTIN_CVTPS2DQ, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvtps2pd, 0, IX86_BUILTIN_CVTPS2PD, 0, 0 }, - { MASK_SSE2, CODE_FOR_cvttps2dq, 0, IX86_BUILTIN_CVTTPS2DQ, 0, 0 }, - - { MASK_SSE2, CODE_FOR_sse2_movq, 0, IX86_BUILTIN_MOVQ, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtps2dq, 0, IX86_BUILTIN_CVTPS2DQ, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvtps2pd, 0, IX86_BUILTIN_CVTPS2PD, 0, 0 }, + { MASK_SSE2, CODE_FOR_sse2_cvttps2dq, 0, IX86_BUILTIN_CVTTPS2DQ, 0, 0 }, /* SSE3 */ - { MASK_SSE3, CODE_FOR_movshdup, 0, IX86_BUILTIN_MOVSHDUP, 0, 0 }, - { MASK_SSE3, CODE_FOR_movsldup, 0, IX86_BUILTIN_MOVSLDUP, 0, 0 }, - { MASK_SSE3, CODE_FOR_movddup, 0, IX86_BUILTIN_MOVDDUP, 0, 0 } + { MASK_SSE3, CODE_FOR_sse3_movshdup, 0, IX86_BUILTIN_MOVSHDUP, 0, 0 }, + { MASK_SSE3, CODE_FOR_sse3_movsldup, 0, IX86_BUILTIN_MOVSLDUP, 0, 0 }, }; -void +static void ix86_init_builtins (void) { if (TARGET_MMX) @@ -13215,6 +14964,18 @@ ix86_init_mmx_sse_builtins (void) const struct builtin_description * d; size_t i; + tree V16QI_type_node = build_vector_type_for_mode (intQI_type_node, V16QImode); + tree V2SI_type_node = build_vector_type_for_mode (intSI_type_node, V2SImode); + tree V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode); + tree V2DI_type_node + = build_vector_type_for_mode (long_long_integer_type_node, V2DImode); + tree V2DF_type_node = build_vector_type_for_mode (double_type_node, V2DFmode); + tree V4SF_type_node = build_vector_type_for_mode (float_type_node, V4SFmode); + tree V4SI_type_node = build_vector_type_for_mode (intSI_type_node, V4SImode); + tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode); + tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode); + tree V8HI_type_node = build_vector_type_for_mode (intHI_type_node, V8HImode); + tree pchar_type_node = build_pointer_type (char_type_node); tree pcchar_type_node = build_pointer_type ( build_type_variant (char_type_node, 1, 0)); @@ -13251,13 +15012,7 @@ ix86_init_mmx_sse_builtins (void) tree v4sf_ftype_v4sf_v2si = build_function_type_list (V4SF_type_node, V4SF_type_node, V2SI_type_node, NULL_TREE); - tree int_ftype_v4hi_int - = build_function_type_list (integer_type_node, - V4HI_type_node, integer_type_node, NULL_TREE); - tree v4hi_ftype_v4hi_int_int - = build_function_type_list (V4HI_type_node, V4HI_type_node, - integer_type_node, integer_type_node, - NULL_TREE); + /* Miscellaneous. */ tree v8qi_ftype_v4hi_v4hi = build_function_type_list (V8QI_type_node, @@ -13296,10 +15051,6 @@ ix86_init_mmx_sse_builtins (void) NULL_TREE); tree unsigned_ftype_void = build_function_type (unsigned_type_node, void_list_node); - tree di_ftype_void - = build_function_type (long_long_unsigned_type_node, void_list_node); - tree v4sf_ftype_void - = build_function_type (V4SF_type_node, void_list_node); tree v2si_ftype_v4sf = build_function_type_list (V2SI_type_node, V4SF_type_node, NULL_TREE); /* Loads/stores. */ @@ -13363,8 +15114,6 @@ ix86_init_mmx_sse_builtins (void) = build_function_type_list (V2SI_type_node, V2SF_type_node, V2SF_type_node, NULL_TREE); tree pint_type_node = build_pointer_type (integer_type_node); - tree pcint_type_node = build_pointer_type ( - build_type_variant (integer_type_node, 1, 0)); tree pdouble_type_node = build_pointer_type (double_type_node); tree pcdouble_type_node = build_pointer_type ( build_type_variant (double_type_node, 1, 0)); @@ -13372,21 +15121,8 @@ ix86_init_mmx_sse_builtins (void) = build_function_type_list (integer_type_node, V2DF_type_node, V2DF_type_node, NULL_TREE); - tree ti_ftype_void - = build_function_type (intTI_type_node, void_list_node); - tree v2di_ftype_void - = build_function_type (V2DI_type_node, void_list_node); - tree ti_ftype_ti_ti - = build_function_type_list (intTI_type_node, - intTI_type_node, intTI_type_node, NULL_TREE); tree void_ftype_pcvoid = build_function_type_list (void_type_node, const_ptr_type_node, NULL_TREE); - tree v2di_ftype_di - = build_function_type_list (V2DI_type_node, - long_long_unsigned_type_node, NULL_TREE); - tree di_ftype_v2di - = build_function_type_list (long_long_unsigned_type_node, - V2DI_type_node, NULL_TREE); tree v4sf_ftype_v4si = build_function_type_list (V4SF_type_node, V4SI_type_node, NULL_TREE); tree v4si_ftype_v4sf @@ -13426,12 +15162,9 @@ ix86_init_mmx_sse_builtins (void) V2DF_type_node, V2DF_type_node, integer_type_node, NULL_TREE); - tree v2df_ftype_v2df_pv2si + tree v2df_ftype_v2df_pcdouble = build_function_type_list (V2DF_type_node, - V2DF_type_node, pv2si_type_node, NULL_TREE); - tree void_ftype_pv2si_v2df - = build_function_type_list (void_type_node, - pv2si_type_node, V2DF_type_node, NULL_TREE); + V2DF_type_node, pcdouble_type_node, NULL_TREE); tree void_ftype_pdouble_v2df = build_function_type_list (void_type_node, pdouble_type_node, V2DF_type_node, NULL_TREE); @@ -13464,18 +15197,6 @@ ix86_init_mmx_sse_builtins (void) V2DF_type_node, V2DF_type_node, NULL_TREE); tree v2df_ftype_v2df = build_function_type_list (V2DF_type_node, V2DF_type_node, NULL_TREE); - tree v2df_ftype_double - = build_function_type_list (V2DF_type_node, double_type_node, NULL_TREE); - tree v2df_ftype_double_double - = build_function_type_list (V2DF_type_node, - double_type_node, double_type_node, NULL_TREE); - tree int_ftype_v8hi_int - = build_function_type_list (integer_type_node, - V8HI_type_node, integer_type_node, NULL_TREE); - tree v8hi_ftype_v8hi_int_int - = build_function_type_list (V8HI_type_node, - V8HI_type_node, integer_type_node, - integer_type_node, NULL_TREE); tree v2di_ftype_v2di_int = build_function_type_list (V2DI_type_node, V2DI_type_node, integer_type_node, NULL_TREE); @@ -13485,21 +15206,21 @@ ix86_init_mmx_sse_builtins (void) tree v8hi_ftype_v8hi_int = build_function_type_list (V8HI_type_node, V8HI_type_node, integer_type_node, NULL_TREE); - tree v8hi_ftype_v8hi_v2di - = build_function_type_list (V8HI_type_node, - V8HI_type_node, V2DI_type_node, NULL_TREE); - tree v4si_ftype_v4si_v2di - = build_function_type_list (V4SI_type_node, - V4SI_type_node, V2DI_type_node, NULL_TREE); tree v4si_ftype_v8hi_v8hi = build_function_type_list (V4SI_type_node, V8HI_type_node, V8HI_type_node, NULL_TREE); tree di_ftype_v8qi_v8qi = build_function_type_list (long_long_unsigned_type_node, V8QI_type_node, V8QI_type_node, NULL_TREE); + tree di_ftype_v2si_v2si + = build_function_type_list (long_long_unsigned_type_node, + V2SI_type_node, V2SI_type_node, NULL_TREE); tree v2di_ftype_v16qi_v16qi = build_function_type_list (V2DI_type_node, V16QI_type_node, V16QI_type_node, NULL_TREE); + tree v2di_ftype_v4si_v4si + = build_function_type_list (V2DI_type_node, + V4SI_type_node, V4SI_type_node, NULL_TREE); tree int_ftype_v16qi = build_function_type_list (integer_type_node, V16QI_type_node, NULL_TREE); tree v16qi_ftype_pcchar @@ -13507,16 +15228,10 @@ ix86_init_mmx_sse_builtins (void) tree void_ftype_pchar_v16qi = build_function_type_list (void_type_node, pchar_type_node, V16QI_type_node, NULL_TREE); - tree v4si_ftype_pcint - = build_function_type_list (V4SI_type_node, pcint_type_node, NULL_TREE); - tree void_ftype_pcint_v4si - = build_function_type_list (void_type_node, - pcint_type_node, V4SI_type_node, NULL_TREE); - tree v2di_ftype_v2di - = build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE); tree float80_type; tree float128_type; + tree ftype; /* The __float80 type. */ if (TYPE_MODE (long_double_type_node) == XFmode) @@ -13526,15 +15241,18 @@ ix86_init_mmx_sse_builtins (void) { /* The __float80 type. */ float80_type = make_node (REAL_TYPE); - TYPE_PRECISION (float80_type) = 96; + TYPE_PRECISION (float80_type) = 80; layout_type (float80_type); (*lang_hooks.types.register_builtin_type) (float80_type, "__float80"); } - float128_type = make_node (REAL_TYPE); - TYPE_PRECISION (float128_type) = 128; - layout_type (float128_type); - (*lang_hooks.types.register_builtin_type) (float128_type, "__float128"); + if (TARGET_64BIT) + { + float128_type = make_node (REAL_TYPE); + TYPE_PRECISION (float128_type) = 128; + layout_type (float128_type); + (*lang_hooks.types.register_builtin_type) (float128_type, "__float128"); + } /* Add all builtins that are more or less simple operations on two operands. */ @@ -13566,9 +15284,6 @@ ix86_init_mmx_sse_builtins (void) case V2DFmode: type = v2df_ftype_v2df_v2df; break; - case TImode: - type = ti_ftype_ti_ti; - break; case V4SFmode: type = v4sf_ftype_v4sf_v4sf; break; @@ -13586,27 +15301,22 @@ ix86_init_mmx_sse_builtins (void) break; default: - abort (); + gcc_unreachable (); } /* Override for comparisons. */ - if (d->icode == CODE_FOR_maskcmpv4sf3 - || d->icode == CODE_FOR_maskncmpv4sf3 - || d->icode == CODE_FOR_vmmaskcmpv4sf3 - || d->icode == CODE_FOR_vmmaskncmpv4sf3) + if (d->icode == CODE_FOR_sse_maskcmpv4sf3 + || d->icode == CODE_FOR_sse_vmmaskcmpv4sf3) type = v4si_ftype_v4sf_v4sf; - if (d->icode == CODE_FOR_maskcmpv2df3 - || d->icode == CODE_FOR_maskncmpv2df3 - || d->icode == CODE_FOR_vmmaskcmpv2df3 - || d->icode == CODE_FOR_vmmaskncmpv2df3) + if (d->icode == CODE_FOR_sse2_maskcmpv2df3 + || d->icode == CODE_FOR_sse2_vmmaskcmpv2df3) type = v2di_ftype_v2df_v2df; def_builtin (d->mask, d->name, type, d->code); } /* Add the remaining MMX insns with somewhat more complicated types. */ - def_builtin (MASK_MMX, "__builtin_ia32_mmx_zero", di_ftype_void, IX86_BUILTIN_MMX_ZERO); def_builtin (MASK_MMX, "__builtin_ia32_emms", void_ftype_void, IX86_BUILTIN_EMMS); def_builtin (MASK_MMX, "__builtin_ia32_psllw", v4hi_ftype_v4hi_di, IX86_BUILTIN_PSLLW); def_builtin (MASK_MMX, "__builtin_ia32_pslld", v2si_ftype_v2si_di, IX86_BUILTIN_PSLLD); @@ -13619,7 +15329,7 @@ ix86_init_mmx_sse_builtins (void) def_builtin (MASK_MMX, "__builtin_ia32_psraw", v4hi_ftype_v4hi_di, IX86_BUILTIN_PSRAW); def_builtin (MASK_MMX, "__builtin_ia32_psrad", v2si_ftype_v2si_di, IX86_BUILTIN_PSRAD); - def_builtin (MASK_MMX, "__builtin_ia32_pshufw", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSHUFW); + def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pshufw", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSHUFW); def_builtin (MASK_MMX, "__builtin_ia32_pmaddwd", v2si_ftype_v4hi_v4hi, IX86_BUILTIN_PMADDWD); /* comi/ucomi insns. */ @@ -13645,17 +15355,10 @@ ix86_init_mmx_sse_builtins (void) def_builtin (MASK_SSE, "__builtin_ia32_cvttss2si", int_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI); def_builtin (MASK_SSE | MASK_64BIT, "__builtin_ia32_cvttss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI64); - def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pextrw", int_ftype_v4hi_int, IX86_BUILTIN_PEXTRW); - def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pinsrw", v4hi_ftype_v4hi_int_int, IX86_BUILTIN_PINSRW); - def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_maskmovq", void_ftype_v8qi_v8qi_pchar, IX86_BUILTIN_MASKMOVQ); - def_builtin (MASK_SSE, "__builtin_ia32_loadaps", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADAPS); def_builtin (MASK_SSE, "__builtin_ia32_loadups", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADUPS); - def_builtin (MASK_SSE, "__builtin_ia32_loadss", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADSS); - def_builtin (MASK_SSE, "__builtin_ia32_storeaps", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREAPS); def_builtin (MASK_SSE, "__builtin_ia32_storeups", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREUPS); - def_builtin (MASK_SSE, "__builtin_ia32_storess", void_ftype_pfloat_v4sf, IX86_BUILTIN_STORESS); def_builtin (MASK_SSE, "__builtin_ia32_loadhps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADHPS); def_builtin (MASK_SSE, "__builtin_ia32_loadlps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADLPS); @@ -13710,27 +15413,14 @@ ix86_init_mmx_sse_builtins (void) def_builtin (MASK_3DNOW_A, "__builtin_ia32_pswapdsf", v2sf_ftype_v2sf, IX86_BUILTIN_PSWAPDSF); def_builtin (MASK_3DNOW_A, "__builtin_ia32_pswapdsi", v2si_ftype_v2si, IX86_BUILTIN_PSWAPDSI); - def_builtin (MASK_SSE, "__builtin_ia32_setzerops", v4sf_ftype_void, IX86_BUILTIN_SSE_ZERO); - /* SSE2 */ - def_builtin (MASK_SSE2, "__builtin_ia32_pextrw128", int_ftype_v8hi_int, IX86_BUILTIN_PEXTRW128); - def_builtin (MASK_SSE2, "__builtin_ia32_pinsrw128", v8hi_ftype_v8hi_int_int, IX86_BUILTIN_PINSRW128); - def_builtin (MASK_SSE2, "__builtin_ia32_maskmovdqu", void_ftype_v16qi_v16qi_pchar, IX86_BUILTIN_MASKMOVDQU); - def_builtin (MASK_SSE2, "__builtin_ia32_movq2dq", v2di_ftype_di, IX86_BUILTIN_MOVQ2DQ); - def_builtin (MASK_SSE2, "__builtin_ia32_movdq2q", di_ftype_v2di, IX86_BUILTIN_MOVDQ2Q); - def_builtin (MASK_SSE2, "__builtin_ia32_loadapd", v2df_ftype_pcdouble, IX86_BUILTIN_LOADAPD); def_builtin (MASK_SSE2, "__builtin_ia32_loadupd", v2df_ftype_pcdouble, IX86_BUILTIN_LOADUPD); - def_builtin (MASK_SSE2, "__builtin_ia32_loadsd", v2df_ftype_pcdouble, IX86_BUILTIN_LOADSD); - def_builtin (MASK_SSE2, "__builtin_ia32_storeapd", void_ftype_pdouble_v2df, IX86_BUILTIN_STOREAPD); def_builtin (MASK_SSE2, "__builtin_ia32_storeupd", void_ftype_pdouble_v2df, IX86_BUILTIN_STOREUPD); - def_builtin (MASK_SSE2, "__builtin_ia32_storesd", void_ftype_pdouble_v2df, IX86_BUILTIN_STORESD); - def_builtin (MASK_SSE2, "__builtin_ia32_loadhpd", v2df_ftype_v2df_pv2si, IX86_BUILTIN_LOADHPD); - def_builtin (MASK_SSE2, "__builtin_ia32_loadlpd", v2df_ftype_v2df_pv2si, IX86_BUILTIN_LOADLPD); - def_builtin (MASK_SSE2, "__builtin_ia32_storehpd", void_ftype_pv2si_v2df, IX86_BUILTIN_STOREHPD); - def_builtin (MASK_SSE2, "__builtin_ia32_storelpd", void_ftype_pv2si_v2df, IX86_BUILTIN_STORELPD); + def_builtin (MASK_SSE2, "__builtin_ia32_loadhpd", v2df_ftype_v2df_pcdouble, IX86_BUILTIN_LOADHPD); + def_builtin (MASK_SSE2, "__builtin_ia32_loadlpd", v2df_ftype_v2df_pcdouble, IX86_BUILTIN_LOADLPD); def_builtin (MASK_SSE2, "__builtin_ia32_movmskpd", int_ftype_v2df, IX86_BUILTIN_MOVMSKPD); def_builtin (MASK_SSE2, "__builtin_ia32_pmovmskb128", int_ftype_v16qi, IX86_BUILTIN_PMOVMSKB128); @@ -13773,38 +15463,26 @@ ix86_init_mmx_sse_builtins (void) def_builtin (MASK_SSE2, "__builtin_ia32_cvtsd2ss", v4sf_ftype_v4sf_v2df, IX86_BUILTIN_CVTSD2SS); def_builtin (MASK_SSE2, "__builtin_ia32_cvtss2sd", v2df_ftype_v2df_v4sf, IX86_BUILTIN_CVTSS2SD); - def_builtin (MASK_SSE2, "__builtin_ia32_setpd1", v2df_ftype_double, IX86_BUILTIN_SETPD1); - def_builtin (MASK_SSE2, "__builtin_ia32_setpd", v2df_ftype_double_double, IX86_BUILTIN_SETPD); - def_builtin (MASK_SSE2, "__builtin_ia32_setzeropd", ti_ftype_void, IX86_BUILTIN_CLRPD); - def_builtin (MASK_SSE2, "__builtin_ia32_loadpd1", v2df_ftype_pcdouble, IX86_BUILTIN_LOADPD1); - def_builtin (MASK_SSE2, "__builtin_ia32_loadrpd", v2df_ftype_pcdouble, IX86_BUILTIN_LOADRPD); - def_builtin (MASK_SSE2, "__builtin_ia32_storepd1", void_ftype_pdouble_v2df, IX86_BUILTIN_STOREPD1); - def_builtin (MASK_SSE2, "__builtin_ia32_storerpd", void_ftype_pdouble_v2df, IX86_BUILTIN_STORERPD); - def_builtin (MASK_SSE2, "__builtin_ia32_clflush", void_ftype_pcvoid, IX86_BUILTIN_CLFLUSH); def_builtin (MASK_SSE2, "__builtin_ia32_lfence", void_ftype_void, IX86_BUILTIN_LFENCE); def_builtin (MASK_SSE2, "__builtin_ia32_mfence", void_ftype_void, IX86_BUILTIN_MFENCE); - def_builtin (MASK_SSE2, "__builtin_ia32_loaddqa", v16qi_ftype_pcchar, IX86_BUILTIN_LOADDQA); def_builtin (MASK_SSE2, "__builtin_ia32_loaddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LOADDQU); - def_builtin (MASK_SSE2, "__builtin_ia32_loadd", v4si_ftype_pcint, IX86_BUILTIN_LOADD); - def_builtin (MASK_SSE2, "__builtin_ia32_storedqa", void_ftype_pchar_v16qi, IX86_BUILTIN_STOREDQA); def_builtin (MASK_SSE2, "__builtin_ia32_storedqu", void_ftype_pchar_v16qi, IX86_BUILTIN_STOREDQU); - def_builtin (MASK_SSE2, "__builtin_ia32_stored", void_ftype_pcint_v4si, IX86_BUILTIN_STORED); - def_builtin (MASK_SSE2, "__builtin_ia32_movq", v2di_ftype_v2di, IX86_BUILTIN_MOVQ); - def_builtin (MASK_SSE, "__builtin_ia32_setzero128", v2di_ftype_void, IX86_BUILTIN_CLRTI); + def_builtin (MASK_SSE2, "__builtin_ia32_pmuludq", di_ftype_v2si_v2si, IX86_BUILTIN_PMULUDQ); + def_builtin (MASK_SSE2, "__builtin_ia32_pmuludq128", v2di_ftype_v4si_v4si, IX86_BUILTIN_PMULUDQ128); - def_builtin (MASK_SSE2, "__builtin_ia32_psllw128", v8hi_ftype_v8hi_v2di, IX86_BUILTIN_PSLLW128); - def_builtin (MASK_SSE2, "__builtin_ia32_pslld128", v4si_ftype_v4si_v2di, IX86_BUILTIN_PSLLD128); + def_builtin (MASK_SSE2, "__builtin_ia32_psllw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSLLW128); + def_builtin (MASK_SSE2, "__builtin_ia32_pslld128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSLLD128); def_builtin (MASK_SSE2, "__builtin_ia32_psllq128", v2di_ftype_v2di_v2di, IX86_BUILTIN_PSLLQ128); - def_builtin (MASK_SSE2, "__builtin_ia32_psrlw128", v8hi_ftype_v8hi_v2di, IX86_BUILTIN_PSRLW128); - def_builtin (MASK_SSE2, "__builtin_ia32_psrld128", v4si_ftype_v4si_v2di, IX86_BUILTIN_PSRLD128); + def_builtin (MASK_SSE2, "__builtin_ia32_psrlw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSRLW128); + def_builtin (MASK_SSE2, "__builtin_ia32_psrld128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSRLD128); def_builtin (MASK_SSE2, "__builtin_ia32_psrlq128", v2di_ftype_v2di_v2di, IX86_BUILTIN_PSRLQ128); - def_builtin (MASK_SSE2, "__builtin_ia32_psraw128", v8hi_ftype_v8hi_v2di, IX86_BUILTIN_PSRAW128); - def_builtin (MASK_SSE2, "__builtin_ia32_psrad128", v4si_ftype_v4si_v2di, IX86_BUILTIN_PSRAD128); + def_builtin (MASK_SSE2, "__builtin_ia32_psraw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSRAW128); + def_builtin (MASK_SSE2, "__builtin_ia32_psrad128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSRAD128); def_builtin (MASK_SSE2, "__builtin_ia32_pslldqi128", v2di_ftype_v2di_int, IX86_BUILTIN_PSLLDQI128); def_builtin (MASK_SSE2, "__builtin_ia32_psllwi128", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSLLWI128); @@ -13836,10 +15514,77 @@ ix86_init_mmx_sse_builtins (void) IX86_BUILTIN_MOVSLDUP); def_builtin (MASK_SSE3, "__builtin_ia32_lddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LDDQU); - def_builtin (MASK_SSE3, "__builtin_ia32_loadddup", - v2df_ftype_pcdouble, IX86_BUILTIN_LOADDDUP); - def_builtin (MASK_SSE3, "__builtin_ia32_movddup", - v2df_ftype_v2df, IX86_BUILTIN_MOVDDUP); + + /* Access to the vec_init patterns. */ + ftype = build_function_type_list (V2SI_type_node, integer_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_MMX, "__builtin_ia32_vec_init_v2si", + ftype, IX86_BUILTIN_VEC_INIT_V2SI); + + ftype = build_function_type_list (V4HI_type_node, short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, NULL_TREE); + def_builtin (MASK_MMX, "__builtin_ia32_vec_init_v4hi", + ftype, IX86_BUILTIN_VEC_INIT_V4HI); + + ftype = build_function_type_list (V8QI_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, NULL_TREE); + def_builtin (MASK_MMX, "__builtin_ia32_vec_init_v8qi", + ftype, IX86_BUILTIN_VEC_INIT_V8QI); + + /* Access to the vec_extract patterns. */ + ftype = build_function_type_list (double_type_node, V2DF_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2df", + ftype, IX86_BUILTIN_VEC_EXT_V2DF); + + ftype = build_function_type_list (long_long_integer_type_node, + V2DI_type_node, integer_type_node, + NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2di", + ftype, IX86_BUILTIN_VEC_EXT_V2DI); + + ftype = build_function_type_list (float_type_node, V4SF_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v4sf", + ftype, IX86_BUILTIN_VEC_EXT_V4SF); + + ftype = build_function_type_list (intSI_type_node, V4SI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v4si", + ftype, IX86_BUILTIN_VEC_EXT_V4SI); + + ftype = build_function_type_list (intHI_type_node, V8HI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v8hi", + ftype, IX86_BUILTIN_VEC_EXT_V8HI); + + ftype = build_function_type_list (intHI_type_node, V4HI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_vec_ext_v4hi", + ftype, IX86_BUILTIN_VEC_EXT_V4HI); + + ftype = build_function_type_list (intSI_type_node, V2SI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_MMX, "__builtin_ia32_vec_ext_v2si", + ftype, IX86_BUILTIN_VEC_EXT_V2SI); + + /* Access to the vec_set patterns. */ + ftype = build_function_type_list (V8HI_type_node, V8HI_type_node, + intHI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE, "__builtin_ia32_vec_set_v8hi", + ftype, IX86_BUILTIN_VEC_SET_V8HI); + + ftype = build_function_type_list (V4HI_type_node, V4HI_type_node, + intHI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_vec_set_v4hi", + ftype, IX86_BUILTIN_VEC_SET_V4HI); } /* Errors in the source file can cause expand_expr to return const0_rtx @@ -13848,17 +15593,8 @@ ix86_init_mmx_sse_builtins (void) static rtx safe_vector_operand (rtx x, enum machine_mode mode) { - if (x != const0_rtx) - return x; - x = gen_reg_rtx (mode); - - if (VALID_MMX_REG_MODE (mode) || VALID_MMX_REG_MODE_3DNOW (mode)) - emit_insn (gen_mmx_clrdi (mode == DImode ? x - : gen_rtx_SUBREG (DImode, x, 0))); - else - emit_insn (gen_sse_clrv4sf (mode == V4SFmode ? x - : gen_rtx_SUBREG (V4SFmode, x, 0), - CONST0_RTX (V4SFmode))); + if (x == const0_rtx) + x = CONST0_RTX (mode); return x; } @@ -13867,11 +15603,11 @@ safe_vector_operand (rtx x, enum machine_mode mode) static rtx ix86_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) { - rtx pat; + rtx pat, xops[3]; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; @@ -13881,7 +15617,7 @@ ix86_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) if (VECTOR_MODE_P (mode1)) op1 = safe_vector_operand (op1, mode1); - if (! target + if (optimize || !target || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); @@ -13893,22 +15629,35 @@ ix86_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) op1 = gen_lowpart (TImode, x); } - /* In case the insn wants input operands in modes different from - the result, abort. */ - if ((GET_MODE (op0) != mode0 && GET_MODE (op0) != VOIDmode) - || (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode)) - abort (); + /* The insn must want input operands in the same modes as the + result. */ + gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode) + && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode)); - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) + if (!(*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) + if (!(*insn_data[icode].operand[2].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); - /* In the commutative cases, both op0 and op1 are nonimmediate_operand, - yet one of the two must not be a memory. This is normally enforced - by expanders, but we didn't bother to create one here. */ - if (GET_CODE (op0) == MEM && GET_CODE (op1) == MEM) - op0 = copy_to_mode_reg (mode0, op0); + /* ??? Using ix86_fixup_binary_operands is problematic when + we've got mismatched modes. Fake it. */ + + xops[0] = target; + xops[1] = op0; + xops[2] = op1; + + if (tmode == mode0 && tmode == mode1) + { + target = ix86_fixup_binary_operands (UNKNOWN, tmode, xops); + op0 = xops[1]; + op1 = xops[2]; + } + else if (optimize || !ix86_binary_operator_ok (UNKNOWN, tmode, xops)) + { + op0 = force_reg (mode0, op0); + op1 = force_reg (mode1, op1); + target = gen_reg_rtx (tmode); + } pat = GEN_FCN (icode) (target, op0, op1); if (! pat) @@ -13925,8 +15674,8 @@ ix86_expand_store_builtin (enum insn_code icode, tree arglist) rtx pat; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode mode0 = insn_data[icode].operand[0].mode; enum machine_mode mode1 = insn_data[icode].operand[1].mode; @@ -13950,13 +15699,12 @@ ix86_expand_unop_builtin (enum insn_code icode, tree arglist, { rtx pat; tree arg0 = TREE_VALUE (arglist); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; - if (! target + if (optimize || !target || GET_MODE (target) != tmode - || (do_load && GET_CODE (target) == MEM) || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); if (do_load) @@ -13966,7 +15714,8 @@ ix86_expand_unop_builtin (enum insn_code icode, tree arglist, if (VECTOR_MODE_P (mode0)) op0 = safe_vector_operand (op0, mode0); - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) + if ((optimize && !register_operand (op0, mode0)) + || ! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); } @@ -13985,11 +15734,11 @@ ix86_expand_unop1_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; tree arg0 = TREE_VALUE (arglist); - rtx op1, op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op1, op0 = expand_normal (arg0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; - if (! target + if (optimize || !target || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); @@ -13997,7 +15746,8 @@ ix86_expand_unop1_builtin (enum insn_code icode, tree arglist, rtx target) if (VECTOR_MODE_P (mode0)) op0 = safe_vector_operand (op0, mode0); - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) + if ((optimize && !register_operand (op0, mode0)) + || ! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); op1 = op0; @@ -14020,8 +15770,8 @@ ix86_expand_sse_compare (const struct builtin_description *d, tree arglist, rtx pat; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); rtx op2; enum machine_mode tmode = insn_data[d->icode].operand[0].mode; enum machine_mode mode0 = insn_data[d->icode].operand[1].mode; @@ -14035,7 +15785,7 @@ ix86_expand_sse_compare (const struct builtin_description *d, tree arglist, /* Swap operands if we have a comparison that isn't available in hardware. */ - if (d->flag) + if (d->flag & BUILTIN_DESC_SWAP_OPERANDS) { rtx tmp = gen_reg_rtx (mode1); emit_move_insn (tmp, op1); @@ -14043,14 +15793,16 @@ ix86_expand_sse_compare (const struct builtin_description *d, tree arglist, op0 = tmp; } - if (! target + if (optimize || !target || GET_MODE (target) != tmode || ! (*insn_data[d->icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - if (! (*insn_data[d->icode].operand[1].predicate) (op0, mode0)) + if ((optimize && !register_operand (op0, mode0)) + || ! (*insn_data[d->icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[d->icode].operand[2].predicate) (op1, mode1)) + if ((optimize && !register_operand (op1, mode1)) + || ! (*insn_data[d->icode].operand[2].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); op2 = gen_rtx_fmt_ee (comparison, mode0, op0, op1); @@ -14070,8 +15822,8 @@ ix86_expand_sse_comi (const struct builtin_description *d, tree arglist, rtx pat; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); rtx op2; enum machine_mode mode0 = insn_data[d->icode].operand[0].mode; enum machine_mode mode1 = insn_data[d->icode].operand[1].mode; @@ -14084,7 +15836,7 @@ ix86_expand_sse_comi (const struct builtin_description *d, tree arglist, /* Swap operands if we have a comparison that isn't available in hardware. */ - if (d->flag) + if (d->flag & BUILTIN_DESC_SWAP_OPERANDS) { rtx tmp = op1; op1 = op0; @@ -14095,9 +15847,11 @@ ix86_expand_sse_comi (const struct builtin_description *d, tree arglist, emit_move_insn (target, const0_rtx); target = gen_rtx_SUBREG (QImode, target, 0); - if (! (*insn_data[d->icode].operand[0].predicate) (op0, mode0)) + if ((optimize && !register_operand (op0, mode0)) + || !(*insn_data[d->icode].operand[0].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[d->icode].operand[1].predicate) (op1, mode1)) + if ((optimize && !register_operand (op1, mode1)) + || !(*insn_data[d->icode].operand[1].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); op2 = gen_rtx_fmt_ee (comparison, mode0, op0, op1); @@ -14114,13 +15868,136 @@ ix86_expand_sse_comi (const struct builtin_description *d, tree arglist, return SUBREG_REG (target); } +/* Return the integer constant in ARG. Constrain it to be in the range + of the subparts of VEC_TYPE; issue an error if not. */ + +static int +get_element_number (tree vec_type, tree arg) +{ + unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1; + + if (!host_integerp (arg, 1) + || (elt = tree_low_cst (arg, 1), elt > max)) + { + error ("selector must be an integer constant in the range 0..%wi", max); + return 0; + } + + return elt; +} + +/* A subroutine of ix86_expand_builtin. These builtins are a wrapper around + ix86_expand_vector_init. We DO have language-level syntax for this, in + the form of (type){ init-list }. Except that since we can't place emms + instructions from inside the compiler, we can't allow the use of MMX + registers unless the user explicitly asks for it. So we do *not* define + vec_set/vec_extract/vec_init patterns for MMX modes in mmx.md. Instead + we have builtins invoked by mmintrin.h that gives us license to emit + these sorts of instructions. */ + +static rtx +ix86_expand_vec_init_builtin (tree type, tree arglist, rtx target) +{ + enum machine_mode tmode = TYPE_MODE (type); + enum machine_mode inner_mode = GET_MODE_INNER (tmode); + int i, n_elt = GET_MODE_NUNITS (tmode); + rtvec v = rtvec_alloc (n_elt); + + gcc_assert (VECTOR_MODE_P (tmode)); + + for (i = 0; i < n_elt; ++i, arglist = TREE_CHAIN (arglist)) + { + rtx x = expand_normal (TREE_VALUE (arglist)); + RTVEC_ELT (v, i) = gen_lowpart (inner_mode, x); + } + + gcc_assert (arglist == NULL); + + if (!target || !register_operand (target, tmode)) + target = gen_reg_rtx (tmode); + + ix86_expand_vector_init (true, target, gen_rtx_PARALLEL (tmode, v)); + return target; +} + +/* A subroutine of ix86_expand_builtin. These builtins are a wrapper around + ix86_expand_vector_extract. They would be redundant (for non-MMX) if we + had a language-level syntax for referencing vector elements. */ + +static rtx +ix86_expand_vec_ext_builtin (tree arglist, rtx target) +{ + enum machine_mode tmode, mode0; + tree arg0, arg1; + int elt; + rtx op0; + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + + op0 = expand_normal (arg0); + elt = get_element_number (TREE_TYPE (arg0), arg1); + + tmode = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); + mode0 = TYPE_MODE (TREE_TYPE (arg0)); + gcc_assert (VECTOR_MODE_P (mode0)); + + op0 = force_reg (mode0, op0); + + if (optimize || !target || !register_operand (target, tmode)) + target = gen_reg_rtx (tmode); + + ix86_expand_vector_extract (true, target, op0, elt); + + return target; +} + +/* A subroutine of ix86_expand_builtin. These builtins are a wrapper around + ix86_expand_vector_set. They would be redundant (for non-MMX) if we had + a language-level syntax for referencing vector elements. */ + +static rtx +ix86_expand_vec_set_builtin (tree arglist) +{ + enum machine_mode tmode, mode1; + tree arg0, arg1, arg2; + int elt; + rtx op0, op1, target; + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + tmode = TYPE_MODE (TREE_TYPE (arg0)); + mode1 = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); + gcc_assert (VECTOR_MODE_P (tmode)); + + op0 = expand_expr (arg0, NULL_RTX, tmode, 0); + op1 = expand_expr (arg1, NULL_RTX, mode1, 0); + elt = get_element_number (TREE_TYPE (arg0), arg2); + + if (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode) + op1 = convert_modes (mode1, GET_MODE (op1), op1, true); + + op0 = force_reg (tmode, op0); + op1 = force_reg (mode1, op1); + + /* OP0 is the source of these builtin functions and shouldn't be + modified. Create a copy, use it and return it as target. */ + target = gen_reg_rtx (tmode); + emit_move_insn (target, op0); + ix86_expand_vector_set (true, target, op1, elt); + + return target; +} + /* Expand an expression EXP that calls a built-in function, with result going to TARGET if that's convenient (and in mode MODE if that's convenient). SUBTARGET may be used as the target for computing one of EXP's operands. IGNORE is nonzero if the value is to be ignored. */ -rtx +static rtx ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, int ignore ATTRIBUTE_UNUSED) @@ -14138,97 +16015,32 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, switch (fcode) { case IX86_BUILTIN_EMMS: - emit_insn (gen_emms ()); + emit_insn (gen_mmx_emms ()); return 0; case IX86_BUILTIN_SFENCE: - emit_insn (gen_sfence ()); + emit_insn (gen_sse_sfence ()); return 0; - case IX86_BUILTIN_PEXTRW: - case IX86_BUILTIN_PEXTRW128: - icode = (fcode == IX86_BUILTIN_PEXTRW - ? CODE_FOR_mmx_pextrw - : CODE_FOR_sse2_pextrw); - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - tmode = insn_data[icode].operand[0].mode; - mode0 = insn_data[icode].operand[1].mode; - mode1 = insn_data[icode].operand[2].mode; - - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) - op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) - { - error ("selector must be an integer constant in the range 0..%i", - fcode == IX86_BUILTIN_PEXTRW ? 3:7); - return gen_reg_rtx (tmode); - } - if (target == 0 - || GET_MODE (target) != tmode - || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) - target = gen_reg_rtx (tmode); - pat = GEN_FCN (icode) (target, op0, op1); - if (! pat) - return 0; - emit_insn (pat); - return target; - - case IX86_BUILTIN_PINSRW: - case IX86_BUILTIN_PINSRW128: - icode = (fcode == IX86_BUILTIN_PINSRW - ? CODE_FOR_mmx_pinsrw - : CODE_FOR_sse2_pinsrw); - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); - tmode = insn_data[icode].operand[0].mode; - mode0 = insn_data[icode].operand[1].mode; - mode1 = insn_data[icode].operand[2].mode; - mode2 = insn_data[icode].operand[3].mode; - - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) - op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) - op1 = copy_to_mode_reg (mode1, op1); - if (! (*insn_data[icode].operand[3].predicate) (op2, mode2)) - { - error ("selector must be an integer constant in the range 0..%i", - fcode == IX86_BUILTIN_PINSRW ? 15:255); - return const0_rtx; - } - if (target == 0 - || GET_MODE (target) != tmode - || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) - target = gen_reg_rtx (tmode); - pat = GEN_FCN (icode) (target, op0, op1, op2); - if (! pat) - return 0; - emit_insn (pat); - return target; - case IX86_BUILTIN_MASKMOVQ: case IX86_BUILTIN_MASKMOVDQU: icode = (fcode == IX86_BUILTIN_MASKMOVQ - ? (TARGET_64BIT ? CODE_FOR_mmx_maskmovq_rex : CODE_FOR_mmx_maskmovq) - : (TARGET_64BIT ? CODE_FOR_sse2_maskmovdqu_rex64 - : CODE_FOR_sse2_maskmovdqu)); + ? CODE_FOR_mmx_maskmovq + : CODE_FOR_sse2_maskmovdqu); /* Note the arg order is different from the operand order. */ arg1 = TREE_VALUE (arglist); arg2 = TREE_VALUE (TREE_CHAIN (arglist)); arg0 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); mode0 = insn_data[icode].operand[0].mode; mode1 = insn_data[icode].operand[1].mode; mode2 = insn_data[icode].operand[2].mode; + op0 = force_reg (Pmode, op0); + op0 = gen_rtx_MEM (mode1, op0); + if (! (*insn_data[icode].operand[0].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); if (! (*insn_data[icode].operand[1].predicate) (op1, mode1)) @@ -14242,52 +16054,39 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, return 0; case IX86_BUILTIN_SQRTSS: - return ix86_expand_unop1_builtin (CODE_FOR_vmsqrtv4sf2, arglist, target); + return ix86_expand_unop1_builtin (CODE_FOR_sse_vmsqrtv4sf2, arglist, target); case IX86_BUILTIN_RSQRTSS: - return ix86_expand_unop1_builtin (CODE_FOR_vmrsqrtv4sf2, arglist, target); + return ix86_expand_unop1_builtin (CODE_FOR_sse_vmrsqrtv4sf2, arglist, target); case IX86_BUILTIN_RCPSS: - return ix86_expand_unop1_builtin (CODE_FOR_vmrcpv4sf2, arglist, target); - - case IX86_BUILTIN_LOADAPS: - return ix86_expand_unop_builtin (CODE_FOR_sse_movaps, arglist, target, 1); + return ix86_expand_unop1_builtin (CODE_FOR_sse_vmrcpv4sf2, arglist, target); case IX86_BUILTIN_LOADUPS: return ix86_expand_unop_builtin (CODE_FOR_sse_movups, arglist, target, 1); - case IX86_BUILTIN_STOREAPS: - return ix86_expand_store_builtin (CODE_FOR_sse_movaps, arglist); - case IX86_BUILTIN_STOREUPS: return ix86_expand_store_builtin (CODE_FOR_sse_movups, arglist); - case IX86_BUILTIN_LOADSS: - return ix86_expand_unop_builtin (CODE_FOR_sse_loadss, arglist, target, 1); - - case IX86_BUILTIN_STORESS: - return ix86_expand_store_builtin (CODE_FOR_sse_storess, arglist); - case IX86_BUILTIN_LOADHPS: case IX86_BUILTIN_LOADLPS: case IX86_BUILTIN_LOADHPD: case IX86_BUILTIN_LOADLPD: - icode = (fcode == IX86_BUILTIN_LOADHPS ? CODE_FOR_sse_movhps - : fcode == IX86_BUILTIN_LOADLPS ? CODE_FOR_sse_movlps - : fcode == IX86_BUILTIN_LOADHPD ? CODE_FOR_sse2_movhpd - : CODE_FOR_sse2_movsd); + icode = (fcode == IX86_BUILTIN_LOADHPS ? CODE_FOR_sse_loadhps + : fcode == IX86_BUILTIN_LOADLPS ? CODE_FOR_sse_loadlps + : fcode == IX86_BUILTIN_LOADHPD ? CODE_FOR_sse2_loadhpd + : CODE_FOR_sse2_loadlpd); arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[2].mode; - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) - op0 = copy_to_mode_reg (mode0, op0); + op0 = force_reg (mode0, op0); op1 = gen_rtx_MEM (mode1, copy_to_mode_reg (Pmode, op1)); - if (target == 0 + if (optimize || target == 0 || GET_MODE (target) != tmode - || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) + || !register_operand (target, tmode)) target = gen_reg_rtx (tmode); pat = GEN_FCN (icode) (target, op0, op1); if (! pat) @@ -14297,28 +16096,23 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case IX86_BUILTIN_STOREHPS: case IX86_BUILTIN_STORELPS: - case IX86_BUILTIN_STOREHPD: - case IX86_BUILTIN_STORELPD: - icode = (fcode == IX86_BUILTIN_STOREHPS ? CODE_FOR_sse_movhps - : fcode == IX86_BUILTIN_STORELPS ? CODE_FOR_sse_movlps - : fcode == IX86_BUILTIN_STOREHPD ? CODE_FOR_sse2_movhpd - : CODE_FOR_sse2_movsd); + icode = (fcode == IX86_BUILTIN_STOREHPS ? CODE_FOR_sse_storehps + : CODE_FOR_sse_storelps); arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - mode0 = insn_data[icode].operand[1].mode; - mode1 = insn_data[icode].operand[2].mode; + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + mode0 = insn_data[icode].operand[0].mode; + mode1 = insn_data[icode].operand[1].mode; op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0)); - if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) - op1 = copy_to_mode_reg (mode1, op1); + op1 = force_reg (mode1, op1); - pat = GEN_FCN (icode) (op0, op0, op1); + pat = GEN_FCN (icode) (op0, op1); if (! pat) return 0; emit_insn (pat); - return 0; + return const0_rtx; case IX86_BUILTIN_MOVNTPS: return ix86_expand_store_builtin (CODE_FOR_sse_movntv4sf, arglist); @@ -14326,15 +16120,15 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, return ix86_expand_store_builtin (CODE_FOR_sse_movntdi, arglist); case IX86_BUILTIN_LDMXCSR: - op0 = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0); - target = assign_386_stack_local (SImode, 0); + op0 = expand_normal (TREE_VALUE (arglist)); + target = assign_386_stack_local (SImode, SLOT_TEMP); emit_move_insn (target, op0); - emit_insn (gen_ldmxcsr (target)); + emit_insn (gen_sse_ldmxcsr (target)); return 0; case IX86_BUILTIN_STMXCSR: - target = assign_386_stack_local (SImode, 0); - emit_insn (gen_stmxcsr (target)); + target = assign_386_stack_local (SImode, SLOT_TEMP); + emit_insn (gen_sse_stmxcsr (target)); return copy_to_mode_reg (SImode, target); case IX86_BUILTIN_SHUFPS: @@ -14345,9 +16139,9 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; mode1 = insn_data[icode].operand[2].mode; @@ -14355,7 +16149,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[icode].operand[2].predicate) (op1, mode1)) + if ((optimize && !register_operand (op1, mode1)) + || !(*insn_data[icode].operand[2].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); if (! (*insn_data[icode].operand[3].predicate) (op2, mode2)) { @@ -14363,7 +16158,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, error ("mask must be an immediate"); return gen_reg_rtx (tmode); } - if (target == 0 + if (optimize || target == 0 || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); @@ -14383,8 +16178,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, : CODE_FOR_mmx_pshufw); arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); tmode = insn_data[icode].operand[0].mode; mode1 = insn_data[icode].operand[1].mode; mode2 = insn_data[icode].operand[2].mode; @@ -14407,14 +16202,111 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, emit_insn (pat); return target; - case IX86_BUILTIN_PSLLDQI128: - case IX86_BUILTIN_PSRLDQI128: - icode = ( fcode == IX86_BUILTIN_PSLLDQI128 ? CODE_FOR_sse2_ashlti3 - : CODE_FOR_sse2_lshrti3); + case IX86_BUILTIN_PSLLWI128: + icode = CODE_FOR_ashlv8hi3; + goto do_pshifti; + case IX86_BUILTIN_PSLLDI128: + icode = CODE_FOR_ashlv4si3; + goto do_pshifti; + case IX86_BUILTIN_PSLLQI128: + icode = CODE_FOR_ashlv2di3; + goto do_pshifti; + case IX86_BUILTIN_PSRAWI128: + icode = CODE_FOR_ashrv8hi3; + goto do_pshifti; + case IX86_BUILTIN_PSRADI128: + icode = CODE_FOR_ashrv4si3; + goto do_pshifti; + case IX86_BUILTIN_PSRLWI128: + icode = CODE_FOR_lshrv8hi3; + goto do_pshifti; + case IX86_BUILTIN_PSRLDI128: + icode = CODE_FOR_lshrv4si3; + goto do_pshifti; + case IX86_BUILTIN_PSRLQI128: + icode = CODE_FOR_lshrv2di3; + goto do_pshifti; + do_pshifti: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + + if (GET_CODE (op1) != CONST_INT) + { + error ("shift must be an immediate"); + return const0_rtx; + } + if (INTVAL (op1) < 0 || INTVAL (op1) > 255) + op1 = GEN_INT (255); + + tmode = insn_data[icode].operand[0].mode; + mode1 = insn_data[icode].operand[1].mode; + if (! (*insn_data[icode].operand[1].predicate) (op0, mode1)) + op0 = copy_to_reg (op0); + + target = gen_reg_rtx (tmode); + pat = GEN_FCN (icode) (target, op0, op1); + if (!pat) + return 0; + emit_insn (pat); + return target; + + case IX86_BUILTIN_PSLLW128: + icode = CODE_FOR_ashlv8hi3; + goto do_pshift; + case IX86_BUILTIN_PSLLD128: + icode = CODE_FOR_ashlv4si3; + goto do_pshift; + case IX86_BUILTIN_PSLLQ128: + icode = CODE_FOR_ashlv2di3; + goto do_pshift; + case IX86_BUILTIN_PSRAW128: + icode = CODE_FOR_ashrv8hi3; + goto do_pshift; + case IX86_BUILTIN_PSRAD128: + icode = CODE_FOR_ashrv4si3; + goto do_pshift; + case IX86_BUILTIN_PSRLW128: + icode = CODE_FOR_lshrv8hi3; + goto do_pshift; + case IX86_BUILTIN_PSRLD128: + icode = CODE_FOR_lshrv4si3; + goto do_pshift; + case IX86_BUILTIN_PSRLQ128: + icode = CODE_FOR_lshrv2di3; + goto do_pshift; + do_pshift: + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + + tmode = insn_data[icode].operand[0].mode; + mode1 = insn_data[icode].operand[1].mode; + + if (! (*insn_data[icode].operand[1].predicate) (op0, mode1)) + op0 = copy_to_reg (op0); + + op1 = simplify_gen_subreg (TImode, op1, GET_MODE (op1), 0); + if (! (*insn_data[icode].operand[2].predicate) (op1, TImode)) + op1 = copy_to_reg (op1); + + target = gen_reg_rtx (tmode); + pat = GEN_FCN (icode) (target, op0, op1); + if (!pat) + return 0; + emit_insn (pat); + return target; + + case IX86_BUILTIN_PSLLDQI128: + case IX86_BUILTIN_PSRLDQI128: + icode = (fcode == IX86_BUILTIN_PSLLDQI128 ? CODE_FOR_sse2_ashlti3 + : CODE_FOR_sse2_lshrti3); + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); tmode = insn_data[icode].operand[0].mode; mode1 = insn_data[icode].operand[1].mode; mode2 = insn_data[icode].operand[2].mode; @@ -14430,169 +16322,99 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, return const0_rtx; } target = gen_reg_rtx (V2DImode); - pat = GEN_FCN (icode) (simplify_gen_subreg (tmode, target, V2DImode, 0), op0, op1); + pat = GEN_FCN (icode) (simplify_gen_subreg (tmode, target, V2DImode, 0), + op0, op1); if (! pat) return 0; emit_insn (pat); return target; case IX86_BUILTIN_FEMMS: - emit_insn (gen_femms ()); + emit_insn (gen_mmx_femms ()); return NULL_RTX; case IX86_BUILTIN_PAVGUSB: - return ix86_expand_binop_builtin (CODE_FOR_pavgusb, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_uavgv8qi3, arglist, target); case IX86_BUILTIN_PF2ID: - return ix86_expand_unop_builtin (CODE_FOR_pf2id, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_pf2id, arglist, target, 0); case IX86_BUILTIN_PFACC: - return ix86_expand_binop_builtin (CODE_FOR_pfacc, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_haddv2sf3, arglist, target); case IX86_BUILTIN_PFADD: - return ix86_expand_binop_builtin (CODE_FOR_addv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_addv2sf3, arglist, target); case IX86_BUILTIN_PFCMPEQ: - return ix86_expand_binop_builtin (CODE_FOR_eqv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_eqv2sf3, arglist, target); case IX86_BUILTIN_PFCMPGE: - return ix86_expand_binop_builtin (CODE_FOR_gev2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_gev2sf3, arglist, target); case IX86_BUILTIN_PFCMPGT: - return ix86_expand_binop_builtin (CODE_FOR_gtv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_gtv2sf3, arglist, target); case IX86_BUILTIN_PFMAX: - return ix86_expand_binop_builtin (CODE_FOR_pfmaxv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_smaxv2sf3, arglist, target); case IX86_BUILTIN_PFMIN: - return ix86_expand_binop_builtin (CODE_FOR_pfminv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_sminv2sf3, arglist, target); case IX86_BUILTIN_PFMUL: - return ix86_expand_binop_builtin (CODE_FOR_mulv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_mulv2sf3, arglist, target); case IX86_BUILTIN_PFRCP: - return ix86_expand_unop_builtin (CODE_FOR_pfrcpv2sf2, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_rcpv2sf2, arglist, target, 0); case IX86_BUILTIN_PFRCPIT1: - return ix86_expand_binop_builtin (CODE_FOR_pfrcpit1v2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_rcpit1v2sf3, arglist, target); case IX86_BUILTIN_PFRCPIT2: - return ix86_expand_binop_builtin (CODE_FOR_pfrcpit2v2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_rcpit2v2sf3, arglist, target); case IX86_BUILTIN_PFRSQIT1: - return ix86_expand_binop_builtin (CODE_FOR_pfrsqit1v2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_rsqit1v2sf3, arglist, target); case IX86_BUILTIN_PFRSQRT: - return ix86_expand_unop_builtin (CODE_FOR_pfrsqrtv2sf2, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_rsqrtv2sf2, arglist, target, 0); case IX86_BUILTIN_PFSUB: - return ix86_expand_binop_builtin (CODE_FOR_subv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_subv2sf3, arglist, target); case IX86_BUILTIN_PFSUBR: - return ix86_expand_binop_builtin (CODE_FOR_subrv2sf3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_subrv2sf3, arglist, target); case IX86_BUILTIN_PI2FD: - return ix86_expand_unop_builtin (CODE_FOR_floatv2si2, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_floatv2si2, arglist, target, 0); case IX86_BUILTIN_PMULHRW: - return ix86_expand_binop_builtin (CODE_FOR_pmulhrwv4hi3, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_pmulhrwv4hi3, arglist, target); case IX86_BUILTIN_PF2IW: - return ix86_expand_unop_builtin (CODE_FOR_pf2iw, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_pf2iw, arglist, target, 0); case IX86_BUILTIN_PFNACC: - return ix86_expand_binop_builtin (CODE_FOR_pfnacc, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_hsubv2sf3, arglist, target); case IX86_BUILTIN_PFPNACC: - return ix86_expand_binop_builtin (CODE_FOR_pfpnacc, arglist, target); + return ix86_expand_binop_builtin (CODE_FOR_mmx_addsubv2sf3, arglist, target); case IX86_BUILTIN_PI2FW: - return ix86_expand_unop_builtin (CODE_FOR_pi2fw, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_pi2fw, arglist, target, 0); case IX86_BUILTIN_PSWAPDSI: - return ix86_expand_unop_builtin (CODE_FOR_pswapdv2si2, arglist, target, 0); + return ix86_expand_unop_builtin (CODE_FOR_mmx_pswapdv2si2, arglist, target, 0); case IX86_BUILTIN_PSWAPDSF: - return ix86_expand_unop_builtin (CODE_FOR_pswapdv2sf2, arglist, target, 0); - - case IX86_BUILTIN_SSE_ZERO: - target = gen_reg_rtx (V4SFmode); - emit_insn (gen_sse_clrv4sf (target, CONST0_RTX (V4SFmode))); - return target; - - case IX86_BUILTIN_MMX_ZERO: - target = gen_reg_rtx (DImode); - emit_insn (gen_mmx_clrdi (target)); - return target; - - case IX86_BUILTIN_CLRTI: - target = gen_reg_rtx (V2DImode); - emit_insn (gen_sse2_clrti (simplify_gen_subreg (TImode, target, V2DImode, 0))); - return target; - + return ix86_expand_unop_builtin (CODE_FOR_mmx_pswapdv2sf2, arglist, target, 0); case IX86_BUILTIN_SQRTSD: - return ix86_expand_unop1_builtin (CODE_FOR_vmsqrtv2df2, arglist, target); - case IX86_BUILTIN_LOADAPD: - return ix86_expand_unop_builtin (CODE_FOR_sse2_movapd, arglist, target, 1); + return ix86_expand_unop1_builtin (CODE_FOR_sse2_vmsqrtv2df2, arglist, target); case IX86_BUILTIN_LOADUPD: return ix86_expand_unop_builtin (CODE_FOR_sse2_movupd, arglist, target, 1); - - case IX86_BUILTIN_STOREAPD: - return ix86_expand_store_builtin (CODE_FOR_sse2_movapd, arglist); case IX86_BUILTIN_STOREUPD: return ix86_expand_store_builtin (CODE_FOR_sse2_movupd, arglist); - case IX86_BUILTIN_LOADSD: - return ix86_expand_unop_builtin (CODE_FOR_sse2_loadsd, arglist, target, 1); - - case IX86_BUILTIN_STORESD: - return ix86_expand_store_builtin (CODE_FOR_sse2_storesd, arglist); - - case IX86_BUILTIN_SETPD1: - target = assign_386_stack_local (DFmode, 0); - arg0 = TREE_VALUE (arglist); - emit_move_insn (adjust_address (target, DFmode, 0), - expand_expr (arg0, NULL_RTX, VOIDmode, 0)); - op0 = gen_reg_rtx (V2DFmode); - emit_insn (gen_sse2_loadsd (op0, adjust_address (target, V2DFmode, 0))); - emit_insn (gen_sse2_shufpd (op0, op0, op0, GEN_INT (0))); - return op0; - - case IX86_BUILTIN_SETPD: - target = assign_386_stack_local (V2DFmode, 0); - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - emit_move_insn (adjust_address (target, DFmode, 0), - expand_expr (arg0, NULL_RTX, VOIDmode, 0)); - emit_move_insn (adjust_address (target, DFmode, 8), - expand_expr (arg1, NULL_RTX, VOIDmode, 0)); - op0 = gen_reg_rtx (V2DFmode); - emit_insn (gen_sse2_movapd (op0, target)); - return op0; - - case IX86_BUILTIN_LOADRPD: - target = ix86_expand_unop_builtin (CODE_FOR_sse2_movapd, arglist, - gen_reg_rtx (V2DFmode), 1); - emit_insn (gen_sse2_shufpd (target, target, target, GEN_INT (1))); - return target; - - case IX86_BUILTIN_LOADPD1: - target = ix86_expand_unop_builtin (CODE_FOR_sse2_loadsd, arglist, - gen_reg_rtx (V2DFmode), 1); - emit_insn (gen_sse2_shufpd (target, target, target, const0_rtx)); - return target; - - case IX86_BUILTIN_STOREPD1: - return ix86_expand_store_builtin (CODE_FOR_sse2_movapd, arglist); - case IX86_BUILTIN_STORERPD: - return ix86_expand_store_builtin (CODE_FOR_sse2_movapd, arglist); - - case IX86_BUILTIN_CLRPD: - target = gen_reg_rtx (V2DFmode); - emit_insn (gen_sse_clrv2df (target)); - return target; - case IX86_BUILTIN_MFENCE: emit_insn (gen_sse2_mfence ()); return 0; @@ -14602,7 +16424,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case IX86_BUILTIN_CLFLUSH: arg0 = TREE_VALUE (arglist); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); icode = CODE_FOR_sse2_clflush; if (! (*insn_data[icode].operand[0].predicate) (op0, Pmode)) op0 = copy_to_mode_reg (Pmode, op0); @@ -14617,54 +16439,63 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, case IX86_BUILTIN_MOVNTI: return ix86_expand_store_builtin (CODE_FOR_sse2_movntsi, arglist); - case IX86_BUILTIN_LOADDQA: - return ix86_expand_unop_builtin (CODE_FOR_sse2_movdqa, arglist, target, 1); case IX86_BUILTIN_LOADDQU: return ix86_expand_unop_builtin (CODE_FOR_sse2_movdqu, arglist, target, 1); - case IX86_BUILTIN_LOADD: - return ix86_expand_unop_builtin (CODE_FOR_sse2_loadd, arglist, target, 1); - - case IX86_BUILTIN_STOREDQA: - return ix86_expand_store_builtin (CODE_FOR_sse2_movdqa, arglist); case IX86_BUILTIN_STOREDQU: return ix86_expand_store_builtin (CODE_FOR_sse2_movdqu, arglist); - case IX86_BUILTIN_STORED: - return ix86_expand_store_builtin (CODE_FOR_sse2_stored, arglist); case IX86_BUILTIN_MONITOR: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); if (!REG_P (op0)) - op0 = copy_to_mode_reg (SImode, op0); + op0 = copy_to_mode_reg (Pmode, op0); if (!REG_P (op1)) op1 = copy_to_mode_reg (SImode, op1); if (!REG_P (op2)) op2 = copy_to_mode_reg (SImode, op2); - emit_insn (gen_monitor (op0, op1, op2)); + if (!TARGET_64BIT) + emit_insn (gen_sse3_monitor (op0, op1, op2)); + else + emit_insn (gen_sse3_monitor64 (op0, op1, op2)); return 0; case IX86_BUILTIN_MWAIT: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); if (!REG_P (op0)) op0 = copy_to_mode_reg (SImode, op0); if (!REG_P (op1)) op1 = copy_to_mode_reg (SImode, op1); - emit_insn (gen_mwait (op0, op1)); + emit_insn (gen_sse3_mwait (op0, op1)); return 0; - case IX86_BUILTIN_LOADDDUP: - return ix86_expand_unop_builtin (CODE_FOR_loadddup, arglist, target, 1); - case IX86_BUILTIN_LDDQU: - return ix86_expand_unop_builtin (CODE_FOR_lddqu, arglist, target, - 1); + return ix86_expand_unop_builtin (CODE_FOR_sse3_lddqu, arglist, + target, 1); + + case IX86_BUILTIN_VEC_INIT_V2SI: + case IX86_BUILTIN_VEC_INIT_V4HI: + case IX86_BUILTIN_VEC_INIT_V8QI: + return ix86_expand_vec_init_builtin (TREE_TYPE (exp), arglist, target); + + case IX86_BUILTIN_VEC_EXT_V2DF: + case IX86_BUILTIN_VEC_EXT_V2DI: + case IX86_BUILTIN_VEC_EXT_V4SF: + case IX86_BUILTIN_VEC_EXT_V4SI: + case IX86_BUILTIN_VEC_EXT_V8HI: + case IX86_BUILTIN_VEC_EXT_V2SI: + case IX86_BUILTIN_VEC_EXT_V4HI: + return ix86_expand_vec_ext_builtin (arglist, target); + + case IX86_BUILTIN_VEC_SET_V8HI: + case IX86_BUILTIN_VEC_SET_V4HI: + return ix86_expand_vec_set_builtin (arglist); default: break; @@ -14674,14 +16505,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, if (d->code == fcode) { /* Compares are treated specially. */ - if (d->icode == CODE_FOR_maskcmpv4sf3 - || d->icode == CODE_FOR_vmmaskcmpv4sf3 - || d->icode == CODE_FOR_maskncmpv4sf3 - || d->icode == CODE_FOR_vmmaskncmpv4sf3 - || d->icode == CODE_FOR_maskcmpv2df3 - || d->icode == CODE_FOR_vmmaskcmpv2df3 - || d->icode == CODE_FOR_maskncmpv2df3 - || d->icode == CODE_FOR_vmmaskncmpv2df3) + if (d->icode == CODE_FOR_sse_maskcmpv4sf3 + || d->icode == CODE_FOR_sse_vmmaskcmpv4sf3 + || d->icode == CODE_FOR_sse2_maskcmpv2df3 + || d->icode == CODE_FOR_sse2_vmmaskcmpv2df3) return ix86_expand_sse_compare (d, arglist, target); return ix86_expand_binop_builtin (d->icode, arglist, target); @@ -14695,8 +16522,7 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, if (d->code == fcode) return ix86_expand_sse_comi (d, arglist, target); - /* @@@ Should really do something sensible here. */ - return 0; + gcc_unreachable (); } /* Store OPERAND to the memory after reload is completed. This means @@ -14705,8 +16531,8 @@ rtx ix86_force_to_memory (enum machine_mode mode, rtx operand) { rtx result; - if (!reload_completed) - abort (); + + gcc_assert (reload_completed); if (TARGET_RED_ZONE) { result = gen_rtx_MEM (mode, @@ -14732,7 +16558,7 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) operand)); break; default: - abort (); + gcc_unreachable (); } result = gen_rtx_MEM (mode, stack_pointer_rtx); } @@ -14759,9 +16585,8 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) } break; case HImode: - /* It is better to store HImodes as SImodes. */ - if (!TARGET_PARTIAL_REG_STALL) - operand = gen_lowpart (SImode, operand); + /* Store HImodes as SImodes. */ + operand = gen_lowpart (SImode, operand); /* FALLTHRU */ case SImode: emit_insn ( @@ -14772,7 +16597,7 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) operand)); break; default: - abort (); + gcc_unreachable (); } result = gen_rtx_MEM (mode, stack_pointer_rtx); } @@ -14789,8 +16614,6 @@ ix86_free_from_memory (enum machine_mode mode) if (mode == DImode || TARGET_64BIT) size = 8; - else if (mode == HImode && TARGET_PARTIAL_REG_STALL) - size = 2; else size = 4; /* Use LEA to deallocate stack space. In peephole2 it will be converted @@ -14808,34 +16631,99 @@ ix86_free_from_memory (enum machine_mode mode) enum reg_class ix86_preferred_reload_class (rtx x, enum reg_class class) { - if (GET_CODE (x) == CONST_VECTOR && x != CONST0_RTX (GET_MODE (x))) + enum machine_mode mode = GET_MODE (x); + + /* We're only allowed to return a subclass of CLASS. Many of the + following checks fail for NO_REGS, so eliminate that early. */ + if (class == NO_REGS) return NO_REGS; + + /* All classes can load zeros. */ + if (x == CONST0_RTX (mode)) + return class; + + /* Force constants into memory if we are loading a (nonzero) constant into + an MMX or SSE register. This is because there are no MMX/SSE instructions + to load from a constant. */ + if (CONSTANT_P (x) + && (MAYBE_MMX_CLASS_P (class) || MAYBE_SSE_CLASS_P (class))) + return NO_REGS; + + /* Prefer SSE regs only, if we can use them for math. */ + if (TARGET_SSE_MATH && !TARGET_MIX_SSE_I387 && SSE_FLOAT_MODE_P (mode)) + return SSE_CLASS_P (class) ? class : NO_REGS; + + /* Floating-point constants need more complex checks. */ if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) != VOIDmode) { - /* SSE can't load any constant directly yet. */ - if (SSE_CLASS_P (class)) - return NO_REGS; - /* Floats can load 0 and 1. */ - if (MAYBE_FLOAT_CLASS_P (class) && standard_80387_constant_p (x)) - { - /* Limit class to non-SSE. Use GENERAL_REGS if possible. */ - if (MAYBE_SSE_CLASS_P (class)) - return (reg_class_subset_p (class, GENERAL_REGS) - ? GENERAL_REGS : FLOAT_REGS); - else - return class; - } /* General regs can load everything. */ if (reg_class_subset_p (class, GENERAL_REGS)) - return GENERAL_REGS; - /* In case we haven't resolved FLOAT or SSE yet, give up. */ - if (MAYBE_FLOAT_CLASS_P (class) || MAYBE_SSE_CLASS_P (class)) - return NO_REGS; + return class; + + /* Floats can load 0 and 1 plus some others. Note that we eliminated + zero above. We only want to wind up preferring 80387 registers if + we plan on doing computation with them. */ + if (TARGET_80387 + && standard_80387_constant_p (x)) + { + /* Limit class to non-sse. */ + if (class == FLOAT_SSE_REGS) + return FLOAT_REGS; + if (class == FP_TOP_SSE_REGS) + return FP_TOP_REG; + if (class == FP_SECOND_SSE_REGS) + return FP_SECOND_REG; + if (class == FLOAT_INT_REGS || class == FLOAT_REGS) + return class; + } + + return NO_REGS; } - if (MAYBE_MMX_CLASS_P (class) && CONSTANT_P (x)) - return NO_REGS; - if (GET_MODE (x) == QImode && ! reg_class_subset_p (class, Q_REGS)) - return Q_REGS; + + /* Generally when we see PLUS here, it's the function invariant + (plus soft-fp const_int). Which can only be computed into general + regs. */ + if (GET_CODE (x) == PLUS) + return reg_class_subset_p (class, GENERAL_REGS) ? class : NO_REGS; + + /* QImode constants are easy to load, but non-constant QImode data + must go into Q_REGS. */ + if (GET_MODE (x) == QImode && !CONSTANT_P (x)) + { + if (reg_class_subset_p (class, Q_REGS)) + return class; + if (reg_class_subset_p (Q_REGS, class)) + return Q_REGS; + return NO_REGS; + } + + return class; +} + +/* Discourage putting floating-point values in SSE registers unless + SSE math is being used, and likewise for the 387 registers. */ +enum reg_class +ix86_preferred_output_reload_class (rtx x, enum reg_class class) +{ + enum machine_mode mode = GET_MODE (x); + + /* Restrict the output reload class to the register bank that we are doing + math on. If we would like not to return a subset of CLASS, reject this + alternative: if reload cannot do this, it will still use its choice. */ + mode = GET_MODE (x); + if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode)) + return MAYBE_SSE_CLASS_P (class) ? SSE_REGS : NO_REGS; + + if (TARGET_80387 && SCALAR_FLOAT_MODE_P (mode)) + { + if (class == FP_TOP_SSE_REGS) + return FP_TOP_REG; + else if (class == FP_SECOND_SSE_REGS) + return FP_SECOND_REG; + else + return FLOAT_CLASS_P (class) ? class : NO_REGS; + } + return class; } @@ -14849,6 +16737,7 @@ ix86_preferred_reload_class (rtx x, enum reg_class class) When STRICT is false, we are being called from REGISTER_MOVE_COST, so do not enforce these sanity checks. */ + int ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2, enum machine_mode mode, int strict) @@ -14860,23 +16749,86 @@ ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2, || MAYBE_MMX_CLASS_P (class1) != MMX_CLASS_P (class1) || MAYBE_MMX_CLASS_P (class2) != MMX_CLASS_P (class2)) { - if (strict) - abort (); - else - return 1; + gcc_assert (!strict); + return true; } - return (FLOAT_CLASS_P (class1) != FLOAT_CLASS_P (class2) - || ((SSE_CLASS_P (class1) != SSE_CLASS_P (class2) - || MMX_CLASS_P (class1) != MMX_CLASS_P (class2)) - && ((mode != SImode && (mode != DImode || !TARGET_64BIT)) - || (!TARGET_INTER_UNIT_MOVES && !optimize_size)))); + + if (FLOAT_CLASS_P (class1) != FLOAT_CLASS_P (class2)) + return true; + + /* ??? This is a lie. We do have moves between mmx/general, and for + mmx/sse2. But by saying we need secondary memory we discourage the + register allocator from using the mmx registers unless needed. */ + if (MMX_CLASS_P (class1) != MMX_CLASS_P (class2)) + return true; + + if (SSE_CLASS_P (class1) != SSE_CLASS_P (class2)) + { + /* SSE1 doesn't have any direct moves from other classes. */ + if (!TARGET_SSE2) + return true; + + /* If the target says that inter-unit moves are more expensive + than moving through memory, then don't generate them. */ + if (!TARGET_INTER_UNIT_MOVES && !optimize_size) + return true; + + /* Between SSE and general, we have moves no larger than word size. */ + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + return true; + + /* ??? For the cost of one register reformat penalty, we could use + the same instructions to move SFmode and DFmode data, but the + relevant move patterns don't support those alternatives. */ + if (mode == SFmode || mode == DFmode) + return true; + } + + return false; } + +/* Return true if the registers in CLASS cannot represent the change from + modes FROM to TO. */ + +bool +ix86_cannot_change_mode_class (enum machine_mode from, enum machine_mode to, + enum reg_class class) +{ + if (from == to) + return false; + + /* x87 registers can't do subreg at all, as all values are reformatted + to extended precision. */ + if (MAYBE_FLOAT_CLASS_P (class)) + return true; + + if (MAYBE_SSE_CLASS_P (class) || MAYBE_MMX_CLASS_P (class)) + { + /* Vector registers do not support QI or HImode loads. If we don't + disallow a change to these modes, reload will assume it's ok to + drop the subreg from (subreg:SI (reg:HI 100) 0). This affects + the vec_dupv4hi pattern. */ + if (GET_MODE_SIZE (from) < 4) + return true; + + /* Vector registers do not support subreg with nonzero offsets, which + are otherwise valid for integer registers. Since we can't see + whether we have a nonzero offset from here, prohibit all + nonparadoxical subregs changing size. */ + if (GET_MODE_SIZE (to) < GET_MODE_SIZE (from)) + return true; + } + + return false; +} + /* Return the cost of moving data from a register in class CLASS1 to one in class CLASS2. It is not required that the cost always equal 2 when FROM is the same as TO; on some machines it is expensive to move between registers if they are not general registers. */ + int ix86_register_move_cost (enum machine_mode mode, enum reg_class class1, enum reg_class class2) @@ -14923,7 +16875,8 @@ ix86_register_move_cost (enum machine_mode mode, enum reg_class class1, } /* Return 1 if hard register REGNO can hold a value of machine-mode MODE. */ -int + +bool ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) { /* Flags and only flags can only hold CCmode values. */ @@ -14937,15 +16890,9 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) return VALID_FP_MODE_P (mode); if (SSE_REGNO_P (regno)) { - /* HACK! We didn't change all of the constraints for SSE1 for the - scalar modes on the branch. Fortunately, they're not required - for ABI compatibility. */ - if (!TARGET_SSE2 && !VECTOR_MODE_P (mode)) - return VALID_SSE_REG_MODE (mode); - /* We implement the move patterns for all vector modes into and - out of SSE registers, even when no operation instructions - are available. */ + out of SSE registers, even when no operation instructions + are available. */ return (VALID_SSE_REG_MODE (mode) || VALID_SSE2_REG_MODE (mode) || VALID_MMX_REG_MODE (mode) @@ -14954,20 +16901,98 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) if (MMX_REGNO_P (regno)) { /* We implement the move patterns for 3DNOW modes even in MMX mode, - so if the register is available at all, then we can move data of - the given mode into or out of it. */ + so if the register is available at all, then we can move data of + the given mode into or out of it. */ return (VALID_MMX_REG_MODE (mode) || VALID_MMX_REG_MODE_3DNOW (mode)); } - /* We handle both integer and floats in the general purpose registers. - In future we should be able to handle vector modes as well. */ - if (!VALID_INT_MODE_P (mode) && !VALID_FP_MODE_P (mode)) - return 0; - /* Take care for QImode values - they can be in non-QI regs, but then - they do cause partial register stalls. */ - if (regno < 4 || mode != QImode || TARGET_64BIT) + + if (mode == QImode) + { + /* Take care for QImode values - they can be in non-QI regs, + but then they do cause partial register stalls. */ + if (regno < 4 || TARGET_64BIT) + return 1; + if (!TARGET_PARTIAL_REG_STALL) + return 1; + return reload_in_progress || reload_completed; + } + /* We handle both integer and floats in the general purpose registers. */ + else if (VALID_INT_MODE_P (mode)) return 1; - return reload_in_progress || reload_completed || !TARGET_PARTIAL_REG_STALL; + else if (VALID_FP_MODE_P (mode)) + return 1; + /* Lots of MMX code casts 8 byte vector modes to DImode. If we then go + on to use that value in smaller contexts, this can easily force a + pseudo to be allocated to GENERAL_REGS. Since this is no worse than + supporting DImode, allow it. */ + else if (VALID_MMX_REG_MODE_3DNOW (mode) || VALID_MMX_REG_MODE (mode)) + return 1; + + return 0; +} + +/* A subroutine of ix86_modes_tieable_p. Return true if MODE is a + tieable integer mode. */ + +static bool +ix86_tieable_integer_mode_p (enum machine_mode mode) +{ + switch (mode) + { + case HImode: + case SImode: + return true; + + case QImode: + return TARGET_64BIT || !TARGET_PARTIAL_REG_STALL; + + case DImode: + return TARGET_64BIT; + + default: + return false; + } +} + +/* Return true if MODE1 is accessible in a register that can hold MODE2 + without copying. That is, all register classes that can hold MODE2 + can also hold MODE1. */ + +bool +ix86_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2) +{ + if (mode1 == mode2) + return true; + + if (ix86_tieable_integer_mode_p (mode1) + && ix86_tieable_integer_mode_p (mode2)) + return true; + + /* MODE2 being XFmode implies fp stack or general regs, which means we + can tie any smaller floating point modes to it. Note that we do not + tie this with TFmode. */ + if (mode2 == XFmode) + return mode1 == SFmode || mode1 == DFmode; + + /* MODE2 being DFmode implies fp stack, general or sse regs, which means + that we can tie it with SFmode. */ + if (mode2 == DFmode) + return mode1 == SFmode; + + /* If MODE2 is only appropriate for an SSE register, then tie with + any other mode acceptable to SSE registers. */ + if (GET_MODE_SIZE (mode2) >= 8 + && ix86_hard_regno_mode_ok (FIRST_SSE_REG, mode2)) + return ix86_hard_regno_mode_ok (FIRST_SSE_REG, mode1); + + /* If MODE2 is appropriate for an MMX (or SSE) register, then tie + with any other mode acceptable to MMX registers. */ + if (GET_MODE_SIZE (mode2) == 8 + && ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode2)) + return ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode1); + + return false; } /* Return the cost of moving data of mode M between a @@ -15075,9 +17100,9 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) case CONST: case LABEL_REF: case SYMBOL_REF: - if (TARGET_64BIT && !x86_64_sign_extended_value (x)) + if (TARGET_64BIT && !x86_64_immediate_operand (x, VOIDmode)) *total = 3; - else if (TARGET_64BIT && !x86_64_zero_extended_value (x)) + else if (TARGET_64BIT && !x86_64_zext_immediate_operand (x, VOIDmode)) *total = 2; else if (flag_pic && SYMBOLIC_CONST (x) && (!TARGET_64BIT @@ -15119,13 +17144,13 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) && GET_MODE (XEXP (x, 0)) == SImode) *total = 1; else if (TARGET_ZERO_EXTEND_WITH_AND) - *total = COSTS_N_INSNS (ix86_cost->add); + *total = ix86_cost->add; else - *total = COSTS_N_INSNS (ix86_cost->movzx); + *total = ix86_cost->movzx; return false; case SIGN_EXTEND: - *total = COSTS_N_INSNS (ix86_cost->movsx); + *total = ix86_cost->movsx; return false; case ASHIFT: @@ -15135,14 +17160,13 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) HOST_WIDE_INT value = INTVAL (XEXP (x, 1)); if (value == 1) { - *total = COSTS_N_INSNS (ix86_cost->add); + *total = ix86_cost->add; return false; } if ((value == 2 || value == 3) - && !TARGET_DECOMPOSE_LEA && ix86_cost->lea <= ix86_cost->shift_const) { - *total = COSTS_N_INSNS (ix86_cost->lea); + *total = ix86_cost->lea; return false; } } @@ -15157,64 +17181,92 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) if (GET_CODE (XEXP (x, 1)) == CONST_INT) { if (INTVAL (XEXP (x, 1)) > 32) - *total = COSTS_N_INSNS(ix86_cost->shift_const + 2); + *total = ix86_cost->shift_const + COSTS_N_INSNS (2); else - *total = COSTS_N_INSNS(ix86_cost->shift_const * 2); + *total = ix86_cost->shift_const * 2; } else { if (GET_CODE (XEXP (x, 1)) == AND) - *total = COSTS_N_INSNS(ix86_cost->shift_var * 2); + *total = ix86_cost->shift_var * 2; else - *total = COSTS_N_INSNS(ix86_cost->shift_var * 6 + 2); + *total = ix86_cost->shift_var * 6 + COSTS_N_INSNS (2); } } else { if (GET_CODE (XEXP (x, 1)) == CONST_INT) - *total = COSTS_N_INSNS (ix86_cost->shift_const); + *total = ix86_cost->shift_const; else - *total = COSTS_N_INSNS (ix86_cost->shift_var); + *total = ix86_cost->shift_var; } return false; case MULT: if (FLOAT_MODE_P (mode)) - *total = COSTS_N_INSNS (ix86_cost->fmul); - else if (GET_CODE (XEXP (x, 1)) == CONST_INT) { - unsigned HOST_WIDE_INT value = INTVAL (XEXP (x, 1)); - int nbits; - - for (nbits = 0; value != 0; value >>= 1) - nbits++; - - *total = COSTS_N_INSNS (ix86_cost->mult_init[MODE_INDEX (mode)] - + nbits * ix86_cost->mult_bit); + *total = ix86_cost->fmul; + return false; } else { - /* This is arbitrary */ - *total = COSTS_N_INSNS (ix86_cost->mult_init[MODE_INDEX (mode)] - + 7 * ix86_cost->mult_bit); + rtx op0 = XEXP (x, 0); + rtx op1 = XEXP (x, 1); + int nbits; + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT value = INTVAL (XEXP (x, 1)); + for (nbits = 0; value != 0; value &= value - 1) + nbits++; + } + else + /* This is arbitrary. */ + nbits = 7; + + /* Compute costs correctly for widening multiplication. */ + if ((GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op1) == ZERO_EXTEND) + && GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))) * 2 + == GET_MODE_SIZE (mode)) + { + int is_mulwiden = 0; + enum machine_mode inner_mode = GET_MODE (op0); + + if (GET_CODE (op0) == GET_CODE (op1)) + is_mulwiden = 1, op1 = XEXP (op1, 0); + else if (GET_CODE (op1) == CONST_INT) + { + if (GET_CODE (op0) == SIGN_EXTEND) + is_mulwiden = trunc_int_for_mode (INTVAL (op1), inner_mode) + == INTVAL (op1); + else + is_mulwiden = !(INTVAL (op1) & ~GET_MODE_MASK (inner_mode)); + } + + if (is_mulwiden) + op0 = XEXP (op0, 0), mode = GET_MODE (op0); + } + + *total = (ix86_cost->mult_init[MODE_INDEX (mode)] + + nbits * ix86_cost->mult_bit + + rtx_cost (op0, outer_code) + rtx_cost (op1, outer_code)); + + return true; } - return false; case DIV: case UDIV: case MOD: case UMOD: if (FLOAT_MODE_P (mode)) - *total = COSTS_N_INSNS (ix86_cost->fdiv); + *total = ix86_cost->fdiv; else - *total = COSTS_N_INSNS (ix86_cost->divide[MODE_INDEX (mode)]); + *total = ix86_cost->divide[MODE_INDEX (mode)]; return false; case PLUS: if (FLOAT_MODE_P (mode)) - *total = COSTS_N_INSNS (ix86_cost->fadd); - else if (!TARGET_DECOMPOSE_LEA - && GET_MODE_CLASS (mode) == MODE_INT + *total = ix86_cost->fadd; + else if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_BITSIZE (mode) <= GET_MODE_BITSIZE (Pmode)) { if (GET_CODE (XEXP (x, 0)) == PLUS @@ -15225,7 +17277,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) HOST_WIDE_INT val = INTVAL (XEXP (XEXP (XEXP (x, 0), 0), 1)); if (val == 2 || val == 4 || val == 8) { - *total = COSTS_N_INSNS (ix86_cost->lea); + *total = ix86_cost->lea; *total += rtx_cost (XEXP (XEXP (x, 0), 1), outer_code); *total += rtx_cost (XEXP (XEXP (XEXP (x, 0), 0), 0), outer_code); @@ -15239,7 +17291,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) HOST_WIDE_INT val = INTVAL (XEXP (XEXP (x, 0), 1)); if (val == 2 || val == 4 || val == 8) { - *total = COSTS_N_INSNS (ix86_cost->lea); + *total = ix86_cost->lea; *total += rtx_cost (XEXP (XEXP (x, 0), 0), outer_code); *total += rtx_cost (XEXP (x, 1), outer_code); return true; @@ -15247,7 +17299,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) } else if (GET_CODE (XEXP (x, 0)) == PLUS) { - *total = COSTS_N_INSNS (ix86_cost->lea); + *total = ix86_cost->lea; *total += rtx_cost (XEXP (XEXP (x, 0), 0), outer_code); *total += rtx_cost (XEXP (XEXP (x, 0), 1), outer_code); *total += rtx_cost (XEXP (x, 1), outer_code); @@ -15259,7 +17311,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) case MINUS: if (FLOAT_MODE_P (mode)) { - *total = COSTS_N_INSNS (ix86_cost->fadd); + *total = ix86_cost->fadd; return false; } /* FALLTHRU */ @@ -15269,7 +17321,7 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) case XOR: if (!TARGET_64BIT && mode == DImode) { - *total = (COSTS_N_INSNS (ix86_cost->add) * 2 + *total = (ix86_cost->add * 2 + (rtx_cost (XEXP (x, 0), outer_code) << (GET_MODE (XEXP (x, 0)) != DImode)) + (rtx_cost (XEXP (x, 1), outer_code) @@ -15281,33 +17333,63 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) case NEG: if (FLOAT_MODE_P (mode)) { - *total = COSTS_N_INSNS (ix86_cost->fchs); + *total = ix86_cost->fchs; return false; } /* FALLTHRU */ case NOT: if (!TARGET_64BIT && mode == DImode) - *total = COSTS_N_INSNS (ix86_cost->add * 2); + *total = ix86_cost->add * 2; else - *total = COSTS_N_INSNS (ix86_cost->add); + *total = ix86_cost->add; + return false; + + case COMPARE: + if (GET_CODE (XEXP (x, 0)) == ZERO_EXTRACT + && XEXP (XEXP (x, 0), 1) == const1_rtx + && GET_CODE (XEXP (XEXP (x, 0), 2)) == CONST_INT + && XEXP (x, 1) == const0_rtx) + { + /* This kind of construct is implemented using test[bwl]. + Treat it as if we had an AND. */ + *total = (ix86_cost->add + + rtx_cost (XEXP (XEXP (x, 0), 0), outer_code) + + rtx_cost (const1_rtx, outer_code)); + return true; + } return false; case FLOAT_EXTEND: if (!TARGET_SSE_MATH || mode == XFmode || (mode == DFmode && !TARGET_SSE2)) - *total = 0; + /* For standard 80387 constants, raise the cost to prevent + compress_float_constant() to generate load from memory. */ + switch (standard_80387_constant_p (XEXP (x, 0))) + { + case -1: + case 0: + *total = 0; + break; + case 1: /* 0.0 */ + *total = 1; + break; + default: + *total = (x86_ext_80387_constants & TUNEMASK + || optimize_size + ? 1 : 0); + } return false; case ABS: if (FLOAT_MODE_P (mode)) - *total = COSTS_N_INSNS (ix86_cost->fabs); + *total = ix86_cost->fabs; return false; case SQRT: if (FLOAT_MODE_P (mode)) - *total = COSTS_N_INSNS (ix86_cost->fsqrt); + *total = ix86_cost->fsqrt; return false; case UNSPEC: @@ -15320,17 +17402,6 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total) } } -#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION) -static void -ix86_svr3_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) -{ - init_section (); - fputs ("\tpushl $", asm_out_file); - assemble_name (asm_out_file, XSTR (symbol, 0)); - fputc ('\n', asm_out_file); -} -#endif - #if TARGET_MACHO static int current_machopic_label_num; @@ -15345,6 +17416,9 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) char *binder_name, *symbol_name, lazy_ptr_name[32]; int label = ++current_machopic_label_num; + /* For 64-bit we shouldn't get here. */ + gcc_assert (!TARGET_64BIT); + /* Lose our funky encoding stuff so it doesn't contaminate the stub. */ symb = (*targetm.strip_name_encoding) (symb); @@ -15359,39 +17433,46 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) sprintf (lazy_ptr_name, "L%d$lz", label); if (MACHOPIC_PURE) - machopic_picsymbol_stub_section (); + switch_to_section (darwin_sections[machopic_picsymbol_stub_section]); else - machopic_symbol_stub_section (); + switch_to_section (darwin_sections[machopic_symbol_stub_section]); fprintf (file, "%s:\n", stub); fprintf (file, "\t.indirect_symbol %s\n", symbol_name); if (MACHOPIC_PURE) { - fprintf (file, "\tcall LPC$%d\nLPC$%d:\tpopl %%eax\n", label, label); - fprintf (file, "\tmovl %s-LPC$%d(%%eax),%%edx\n", lazy_ptr_name, label); - fprintf (file, "\tjmp %%edx\n"); + fprintf (file, "\tcall\tLPC$%d\nLPC$%d:\tpopl\t%%eax\n", label, label); + fprintf (file, "\tmovl\t%s-LPC$%d(%%eax),%%edx\n", lazy_ptr_name, label); + fprintf (file, "\tjmp\t*%%edx\n"); } else - fprintf (file, "\tjmp *%s\n", lazy_ptr_name); + fprintf (file, "\tjmp\t*%s\n", lazy_ptr_name); fprintf (file, "%s:\n", binder_name); if (MACHOPIC_PURE) { - fprintf (file, "\tlea %s-LPC$%d(%%eax),%%eax\n", lazy_ptr_name, label); - fprintf (file, "\tpushl %%eax\n"); + fprintf (file, "\tlea\t%s-LPC$%d(%%eax),%%eax\n", lazy_ptr_name, label); + fprintf (file, "\tpushl\t%%eax\n"); } else - fprintf (file, "\t pushl $%s\n", lazy_ptr_name); + fprintf (file, "\tpushl\t$%s\n", lazy_ptr_name); - fprintf (file, "\tjmp dyld_stub_binding_helper\n"); + fprintf (file, "\tjmp\tdyld_stub_binding_helper\n"); - machopic_lazy_symbol_ptr_section (); + switch_to_section (darwin_sections[machopic_lazy_symbol_ptr_section]); fprintf (file, "%s:\n", lazy_ptr_name); fprintf (file, "\t.indirect_symbol %s\n", symbol_name); fprintf (file, "\t.long %s\n", binder_name); } + +void +darwin_x86_file_end (void) +{ + darwin_file_end (); + ix86_file_end (); +} #endif /* TARGET_MACHO */ /* Order the registers for register allocator. */ @@ -15438,10 +17519,6 @@ x86_order_regs_for_local_alloc (void) reg_alloc_order [pos++] = 0; } -#ifndef TARGET_USE_MS_BITFIELD_LAYOUT -#define TARGET_USE_MS_BITFIELD_LAYOUT 0 -#endif - /* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in struct attribute_spec.handler. */ static tree @@ -15461,7 +17538,8 @@ ix86_handle_struct_attribute (tree *node, tree name, if (!(type && (TREE_CODE (*type) == RECORD_TYPE || TREE_CODE (*type) == UNION_TYPE))) { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -15470,7 +17548,7 @@ ix86_handle_struct_attribute (tree *node, tree name, || ((is_attribute_p ("gcc_struct", name) && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))))) { - warning ("`%s' incompatible attribute ignored", + warning (OPT_Wattributes, "%qs incompatible attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -15481,7 +17559,7 @@ ix86_handle_struct_attribute (tree *node, tree name, static bool ix86_ms_bitfield_layout_p (tree record_type) { - return (TARGET_USE_MS_BITFIELD_LAYOUT && + return (TARGET_MS_BITFIELD_LAYOUT && !lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type))) || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type)); } @@ -15671,8 +17749,10 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED, #if TARGET_MACHO if (TARGET_MACHO) { - const char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function)); - tmp = gen_rtx_SYMBOL_REF (Pmode, machopic_stub_name (ip)); + rtx sym_ref = XEXP (DECL_RTL (function), 0); + tmp = (gen_rtx_SYMBOL_REF + (Pmode, + machopic_indirection_name (sym_ref, /*stub_p=*/true))); tmp = gen_rtx_MEM (QImode, tmp); xops[0] = tmp; output_asm_insn ("jmp\t%0", xops); @@ -15681,7 +17761,7 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED, #endif /* TARGET_MACHO */ { tmp = gen_rtx_REG (SImode, 2 /* ECX */); - output_set_got (tmp); + output_set_got (tmp, NULL_RTX); xops[1] = tmp; output_asm_insn ("mov{l}\t{%0@GOT(%1), %1|%1, %0@GOT[%1]}", xops); @@ -15694,6 +17774,9 @@ static void x86_file_start (void) { default_file_start (); +#if TARGET_MACHO + darwin_file_start (); +#endif if (X86_FILE_START_VERSION_DIRECTIVE) fputs ("\t.version\t\"01.01\"\n", asm_out_file); if (X86_FILE_START_FLTUSED) @@ -15807,7 +17890,7 @@ min_insn_size (rtx insn) window. */ static void -k8_avoid_jump_misspredicts (void) +ix86_avoid_jump_misspredicts (void) { rtx insn, start = get_insns (); int nbytes = 0, njumps = 0; @@ -15827,8 +17910,8 @@ k8_avoid_jump_misspredicts (void) { nbytes += min_insn_size (insn); - if (rtl_dump_file) - fprintf(rtl_dump_file, "Insn %i estimated to %i bytes\n", + if (dump_file) + fprintf(dump_file, "Insn %i estimated to %i bytes\n", INSN_UID (insn), min_insn_size (insn)); if ((GET_CODE (insn) == JUMP_INSN && GET_CODE (PATTERN (insn)) != ADDR_VEC @@ -15850,75 +17933,85 @@ k8_avoid_jump_misspredicts (void) isjump = 0; nbytes -= min_insn_size (start); } - if (njumps < 0) - abort (); - if (rtl_dump_file) - fprintf(rtl_dump_file, "Interval %i to %i has %i bytes\n", + gcc_assert (njumps >= 0); + if (dump_file) + fprintf (dump_file, "Interval %i to %i has %i bytes\n", INSN_UID (start), INSN_UID (insn), nbytes); if (njumps == 3 && isjump && nbytes < 16) { int padsize = 15 - nbytes + min_insn_size (insn); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Padding insn %i by %i bytes!\n", INSN_UID (insn), padsize); + if (dump_file) + fprintf (dump_file, "Padding insn %i by %i bytes!\n", + INSN_UID (insn), padsize); emit_insn_before (gen_align (GEN_INT (padsize)), insn); } } } -/* Implement machine specific optimizations. - At the moment we implement single transformation: AMD Athlon works faster +/* AMD Athlon works faster when RET is not destination of conditional jump or directly preceded by other jump instruction. We avoid the penalty by inserting NOP just before the RET instructions in such cases. */ static void -ix86_reorg (void) +ix86_pad_returns (void) { edge e; + edge_iterator ei; - if (!TARGET_ATHLON_K8 || !optimize || optimize_size) - return; - for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) - { - basic_block bb = e->src; - rtx ret = BB_END (bb); - rtx prev; - bool replace = false; + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) + { + basic_block bb = e->src; + rtx ret = BB_END (bb); + rtx prev; + bool replace = false; - if (GET_CODE (ret) != JUMP_INSN || GET_CODE (PATTERN (ret)) != RETURN - || !maybe_hot_bb_p (bb)) - continue; - for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev)) - if (active_insn_p (prev) || GET_CODE (prev) == CODE_LABEL) - break; - if (prev && GET_CODE (prev) == CODE_LABEL) - { - edge e; - for (e = bb->pred; e; e = e->pred_next) - if (EDGE_FREQUENCY (e) && e->src->index >= 0 - && !(e->flags & EDGE_FALLTHRU)) + if (GET_CODE (ret) != JUMP_INSN || GET_CODE (PATTERN (ret)) != RETURN + || !maybe_hot_bb_p (bb)) + continue; + for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev)) + if (active_insn_p (prev) || GET_CODE (prev) == CODE_LABEL) + break; + if (prev && GET_CODE (prev) == CODE_LABEL) + { + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, bb->preds) + if (EDGE_FREQUENCY (e) && e->src->index >= 0 + && !(e->flags & EDGE_FALLTHRU)) + replace = true; + } + if (!replace) + { + prev = prev_active_insn (ret); + if (prev + && ((GET_CODE (prev) == JUMP_INSN && any_condjump_p (prev)) + || GET_CODE (prev) == CALL_INSN)) replace = true; - } - if (!replace) - { - prev = prev_active_insn (ret); - if (prev - && ((GET_CODE (prev) == JUMP_INSN && any_condjump_p (prev)) - || GET_CODE (prev) == CALL_INSN)) - replace = true; - /* Empty functions get branch mispredict even when the jump destination - is not visible to us. */ - if (!prev && cfun->function_frequency > FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) - replace = true; - } - if (replace) - { - emit_insn_before (gen_return_internal_long (), ret); - delete_insn (ret); - } - } - k8_avoid_jump_misspredicts (); + /* Empty functions get branch mispredict even when the jump destination + is not visible to us. */ + if (!prev && cfun->function_frequency > FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) + replace = true; + } + if (replace) + { + emit_insn_before (gen_return_internal_long (), ret); + delete_insn (ret); + } + } +} + +/* Implement machine specific optimizations. We implement padding of returns + for K8 CPUs and pass to avoid 4 jumps in the single 16 byte window. */ +static void +ix86_reorg (void) +{ + if (TARGET_PAD_RETURNS && optimize && !optimize_size) + ix86_pad_returns (); + if (TARGET_FOUR_JUMP_LIMIT && optimize && !optimize_size) + ix86_avoid_jump_misspredicts (); } /* Return nonzero when QImode register that must be represented via REX prefix @@ -15965,9 +18058,7 @@ x86_emit_floatuns (rtx operands[2]) enum machine_mode mode, inmode; inmode = GET_MODE (operands[1]); - if (inmode != SImode - && inmode != DImode) - abort (); + gcc_assert (inmode == SImode || inmode == DImode); out = operands[0]; in = force_reg (inmode, operands[1]); @@ -15993,102 +18084,1076 @@ x86_emit_floatuns (rtx operands[2]) emit_label (donelab); } + +/* A subroutine of ix86_expand_vector_init. Store into TARGET a vector + with all elements equal to VAR. Return true if successful. */ -/* Return if we do not know how to pass TYPE solely in registers. */ -bool -ix86_must_pass_in_stack (enum machine_mode mode, tree type) +static bool +ix86_expand_vector_init_duplicate (bool mmx_ok, enum machine_mode mode, + rtx target, rtx val) { - if (default_must_pass_in_stack (mode, type)) - return true; - return (!TARGET_64BIT && type && mode == TImode); + enum machine_mode smode, wsmode, wvmode; + rtx x; + + switch (mode) + { + case V2SImode: + case V2SFmode: + if (!mmx_ok) + return false; + /* FALLTHRU */ + + case V2DFmode: + case V2DImode: + case V4SFmode: + case V4SImode: + val = force_reg (GET_MODE_INNER (mode), val); + x = gen_rtx_VEC_DUPLICATE (mode, val); + emit_insn (gen_rtx_SET (VOIDmode, target, x)); + return true; + + case V4HImode: + if (!mmx_ok) + return false; + if (TARGET_SSE || TARGET_3DNOW_A) + { + val = gen_lowpart (SImode, val); + x = gen_rtx_TRUNCATE (HImode, val); + x = gen_rtx_VEC_DUPLICATE (mode, x); + emit_insn (gen_rtx_SET (VOIDmode, target, x)); + return true; + } + else + { + smode = HImode; + wsmode = SImode; + wvmode = V2SImode; + goto widen; + } + + case V8QImode: + if (!mmx_ok) + return false; + smode = QImode; + wsmode = HImode; + wvmode = V4HImode; + goto widen; + case V8HImode: + if (TARGET_SSE2) + { + rtx tmp1, tmp2; + /* Extend HImode to SImode using a paradoxical SUBREG. */ + tmp1 = gen_reg_rtx (SImode); + emit_move_insn (tmp1, gen_lowpart (SImode, val)); + /* Insert the SImode value as low element of V4SImode vector. */ + tmp2 = gen_reg_rtx (V4SImode); + tmp1 = gen_rtx_VEC_MERGE (V4SImode, + gen_rtx_VEC_DUPLICATE (V4SImode, tmp1), + CONST0_RTX (V4SImode), + const1_rtx); + emit_insn (gen_rtx_SET (VOIDmode, tmp2, tmp1)); + /* Cast the V4SImode vector back to a V8HImode vector. */ + tmp1 = gen_reg_rtx (V8HImode); + emit_move_insn (tmp1, gen_lowpart (V8HImode, tmp2)); + /* Duplicate the low short through the whole low SImode word. */ + emit_insn (gen_sse2_punpcklwd (tmp1, tmp1, tmp1)); + /* Cast the V8HImode vector back to a V4SImode vector. */ + tmp2 = gen_reg_rtx (V4SImode); + emit_move_insn (tmp2, gen_lowpart (V4SImode, tmp1)); + /* Replicate the low element of the V4SImode vector. */ + emit_insn (gen_sse2_pshufd (tmp2, tmp2, const0_rtx)); + /* Cast the V2SImode back to V8HImode, and store in target. */ + emit_move_insn (target, gen_lowpart (V8HImode, tmp2)); + return true; + } + smode = HImode; + wsmode = SImode; + wvmode = V4SImode; + goto widen; + case V16QImode: + if (TARGET_SSE2) + { + rtx tmp1, tmp2; + /* Extend QImode to SImode using a paradoxical SUBREG. */ + tmp1 = gen_reg_rtx (SImode); + emit_move_insn (tmp1, gen_lowpart (SImode, val)); + /* Insert the SImode value as low element of V4SImode vector. */ + tmp2 = gen_reg_rtx (V4SImode); + tmp1 = gen_rtx_VEC_MERGE (V4SImode, + gen_rtx_VEC_DUPLICATE (V4SImode, tmp1), + CONST0_RTX (V4SImode), + const1_rtx); + emit_insn (gen_rtx_SET (VOIDmode, tmp2, tmp1)); + /* Cast the V4SImode vector back to a V16QImode vector. */ + tmp1 = gen_reg_rtx (V16QImode); + emit_move_insn (tmp1, gen_lowpart (V16QImode, tmp2)); + /* Duplicate the low byte through the whole low SImode word. */ + emit_insn (gen_sse2_punpcklbw (tmp1, tmp1, tmp1)); + emit_insn (gen_sse2_punpcklbw (tmp1, tmp1, tmp1)); + /* Cast the V16QImode vector back to a V4SImode vector. */ + tmp2 = gen_reg_rtx (V4SImode); + emit_move_insn (tmp2, gen_lowpart (V4SImode, tmp1)); + /* Replicate the low element of the V4SImode vector. */ + emit_insn (gen_sse2_pshufd (tmp2, tmp2, const0_rtx)); + /* Cast the V2SImode back to V16QImode, and store in target. */ + emit_move_insn (target, gen_lowpart (V16QImode, tmp2)); + return true; + } + smode = QImode; + wsmode = HImode; + wvmode = V8HImode; + goto widen; + widen: + /* Replicate the value once into the next wider mode and recurse. */ + val = convert_modes (wsmode, smode, val, true); + x = expand_simple_binop (wsmode, ASHIFT, val, + GEN_INT (GET_MODE_BITSIZE (smode)), + NULL_RTX, 1, OPTAB_LIB_WIDEN); + val = expand_simple_binop (wsmode, IOR, val, x, x, 1, OPTAB_LIB_WIDEN); + + x = gen_reg_rtx (wvmode); + if (!ix86_expand_vector_init_duplicate (mmx_ok, wvmode, x, val)) + gcc_unreachable (); + emit_move_insn (target, gen_lowpart (mode, x)); + return true; + + default: + return false; + } } -/* Initialize vector TARGET via VALS. */ -void -ix86_expand_vector_init (rtx target, rtx vals) +/* A subroutine of ix86_expand_vector_init. Store into TARGET a vector + whose ONE_VAR element is VAR, and other elements are zero. Return true + if successful. */ + +static bool +ix86_expand_vector_init_one_nonzero (bool mmx_ok, enum machine_mode mode, + rtx target, rtx var, int one_var) { - enum machine_mode mode = GET_MODE (target); - int elt_size = GET_MODE_SIZE (GET_MODE_INNER (mode)); - int n_elts = (GET_MODE_SIZE (mode) / elt_size); - int i; - - for (i = n_elts - 1; i >= 0; i--) - if (GET_CODE (XVECEXP (vals, 0, i)) != CONST_INT - && GET_CODE (XVECEXP (vals, 0, i)) != CONST_DOUBLE) + enum machine_mode vsimode; + rtx new_target; + rtx x, tmp; + + switch (mode) + { + case V2SFmode: + case V2SImode: + if (!mmx_ok) + return false; + /* FALLTHRU */ + + case V2DFmode: + case V2DImode: + if (one_var != 0) + return false; + var = force_reg (GET_MODE_INNER (mode), var); + x = gen_rtx_VEC_CONCAT (mode, var, CONST0_RTX (GET_MODE_INNER (mode))); + emit_insn (gen_rtx_SET (VOIDmode, target, x)); + return true; + + case V4SFmode: + case V4SImode: + if (!REG_P (target) || REGNO (target) < FIRST_PSEUDO_REGISTER) + new_target = gen_reg_rtx (mode); + else + new_target = target; + var = force_reg (GET_MODE_INNER (mode), var); + x = gen_rtx_VEC_DUPLICATE (mode, var); + x = gen_rtx_VEC_MERGE (mode, x, CONST0_RTX (mode), const1_rtx); + emit_insn (gen_rtx_SET (VOIDmode, new_target, x)); + if (one_var != 0) + { + /* We need to shuffle the value to the correct position, so + create a new pseudo to store the intermediate result. */ + + /* With SSE2, we can use the integer shuffle insns. */ + if (mode != V4SFmode && TARGET_SSE2) + { + emit_insn (gen_sse2_pshufd_1 (new_target, new_target, + GEN_INT (1), + GEN_INT (one_var == 1 ? 0 : 1), + GEN_INT (one_var == 2 ? 0 : 1), + GEN_INT (one_var == 3 ? 0 : 1))); + if (target != new_target) + emit_move_insn (target, new_target); + return true; + } + + /* Otherwise convert the intermediate result to V4SFmode and + use the SSE1 shuffle instructions. */ + if (mode != V4SFmode) + { + tmp = gen_reg_rtx (V4SFmode); + emit_move_insn (tmp, gen_lowpart (V4SFmode, new_target)); + } + else + tmp = new_target; + + emit_insn (gen_sse_shufps_1 (tmp, tmp, tmp, + GEN_INT (1), + GEN_INT (one_var == 1 ? 0 : 1), + GEN_INT (one_var == 2 ? 0+4 : 1+4), + GEN_INT (one_var == 3 ? 0+4 : 1+4))); + + if (mode != V4SFmode) + emit_move_insn (target, gen_lowpart (V4SImode, tmp)); + else if (tmp != target) + emit_move_insn (target, tmp); + } + else if (target != new_target) + emit_move_insn (target, new_target); + return true; + + case V8HImode: + case V16QImode: + vsimode = V4SImode; + goto widen; + case V4HImode: + case V8QImode: + if (!mmx_ok) + return false; + vsimode = V2SImode; + goto widen; + widen: + if (one_var != 0) + return false; + + /* Zero extend the variable element to SImode and recurse. */ + var = convert_modes (SImode, GET_MODE_INNER (mode), var, true); + + x = gen_reg_rtx (vsimode); + if (!ix86_expand_vector_init_one_nonzero (mmx_ok, vsimode, x, + var, one_var)) + gcc_unreachable (); + + emit_move_insn (target, gen_lowpart (mode, x)); + return true; + + default: + return false; + } +} + +/* A subroutine of ix86_expand_vector_init. Store into TARGET a vector + consisting of the values in VALS. It is known that all elements + except ONE_VAR are constants. Return true if successful. */ + +static bool +ix86_expand_vector_init_one_var (bool mmx_ok, enum machine_mode mode, + rtx target, rtx vals, int one_var) +{ + rtx var = XVECEXP (vals, 0, one_var); + enum machine_mode wmode; + rtx const_vec, x; + + const_vec = copy_rtx (vals); + XVECEXP (const_vec, 0, one_var) = CONST0_RTX (GET_MODE_INNER (mode)); + const_vec = gen_rtx_CONST_VECTOR (mode, XVEC (const_vec, 0)); + + switch (mode) + { + case V2DFmode: + case V2DImode: + case V2SFmode: + case V2SImode: + /* For the two element vectors, it's just as easy to use + the general case. */ + return false; + + case V4SFmode: + case V4SImode: + case V8HImode: + case V4HImode: break; - /* Few special cases first... - ... constants are best loaded from constant pool. */ - if (i < 0) + case V16QImode: + wmode = V8HImode; + goto widen; + case V8QImode: + wmode = V4HImode; + goto widen; + widen: + /* There's no way to set one QImode entry easily. Combine + the variable value with its adjacent constant value, and + promote to an HImode set. */ + x = XVECEXP (vals, 0, one_var ^ 1); + if (one_var & 1) + { + var = convert_modes (HImode, QImode, var, true); + var = expand_simple_binop (HImode, ASHIFT, var, GEN_INT (8), + NULL_RTX, 1, OPTAB_LIB_WIDEN); + x = GEN_INT (INTVAL (x) & 0xff); + } + else + { + var = convert_modes (HImode, QImode, var, true); + x = gen_int_mode (INTVAL (x) << 8, HImode); + } + if (x != const0_rtx) + var = expand_simple_binop (HImode, IOR, var, x, var, + 1, OPTAB_LIB_WIDEN); + + x = gen_reg_rtx (wmode); + emit_move_insn (x, gen_lowpart (wmode, const_vec)); + ix86_expand_vector_set (mmx_ok, x, var, one_var >> 1); + + emit_move_insn (target, gen_lowpart (mode, x)); + return true; + + default: + return false; + } + + emit_move_insn (target, const_vec); + ix86_expand_vector_set (mmx_ok, target, var, one_var); + return true; +} + +/* A subroutine of ix86_expand_vector_init. Handle the most general case: + all values variable, and none identical. */ + +static void +ix86_expand_vector_init_general (bool mmx_ok, enum machine_mode mode, + rtx target, rtx vals) +{ + enum machine_mode half_mode = GET_MODE_INNER (mode); + rtx op0 = NULL, op1 = NULL; + bool use_vec_concat = false; + + switch (mode) + { + case V2SFmode: + case V2SImode: + if (!mmx_ok && !TARGET_SSE) + break; + /* FALLTHRU */ + + case V2DFmode: + case V2DImode: + /* For the two element vectors, we always implement VEC_CONCAT. */ + op0 = XVECEXP (vals, 0, 0); + op1 = XVECEXP (vals, 0, 1); + use_vec_concat = true; + break; + + case V4SFmode: + half_mode = V2SFmode; + goto half; + case V4SImode: + half_mode = V2SImode; + goto half; + half: + { + rtvec v; + + /* For V4SF and V4SI, we implement a concat of two V2 vectors. + Recurse to load the two halves. */ + + op0 = gen_reg_rtx (half_mode); + v = gen_rtvec (2, XVECEXP (vals, 0, 0), XVECEXP (vals, 0, 1)); + ix86_expand_vector_init (false, op0, gen_rtx_PARALLEL (half_mode, v)); + + op1 = gen_reg_rtx (half_mode); + v = gen_rtvec (2, XVECEXP (vals, 0, 2), XVECEXP (vals, 0, 3)); + ix86_expand_vector_init (false, op1, gen_rtx_PARALLEL (half_mode, v)); + + use_vec_concat = true; + } + break; + + case V8HImode: + case V16QImode: + case V4HImode: + case V8QImode: + break; + + default: + gcc_unreachable (); + } + + if (use_vec_concat) + { + if (!register_operand (op0, half_mode)) + op0 = force_reg (half_mode, op0); + if (!register_operand (op1, half_mode)) + op1 = force_reg (half_mode, op1); + + emit_insn (gen_rtx_SET (VOIDmode, target, + gen_rtx_VEC_CONCAT (mode, op0, op1))); + } + else + { + int i, j, n_elts, n_words, n_elt_per_word; + enum machine_mode inner_mode; + rtx words[4], shift; + + inner_mode = GET_MODE_INNER (mode); + n_elts = GET_MODE_NUNITS (mode); + n_words = GET_MODE_SIZE (mode) / UNITS_PER_WORD; + n_elt_per_word = n_elts / n_words; + shift = GEN_INT (GET_MODE_BITSIZE (inner_mode)); + + for (i = 0; i < n_words; ++i) + { + rtx word = NULL_RTX; + + for (j = 0; j < n_elt_per_word; ++j) + { + rtx elt = XVECEXP (vals, 0, (i+1)*n_elt_per_word - j - 1); + elt = convert_modes (word_mode, inner_mode, elt, true); + + if (j == 0) + word = elt; + else + { + word = expand_simple_binop (word_mode, ASHIFT, word, shift, + word, 1, OPTAB_LIB_WIDEN); + word = expand_simple_binop (word_mode, IOR, word, elt, + word, 1, OPTAB_LIB_WIDEN); + } + } + + words[i] = word; + } + + if (n_words == 1) + emit_move_insn (target, gen_lowpart (mode, words[0])); + else if (n_words == 2) + { + rtx tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_CLOBBER (VOIDmode, tmp)); + emit_move_insn (gen_lowpart (word_mode, tmp), words[0]); + emit_move_insn (gen_highpart (word_mode, tmp), words[1]); + emit_move_insn (target, tmp); + } + else if (n_words == 4) + { + rtx tmp = gen_reg_rtx (V4SImode); + vals = gen_rtx_PARALLEL (V4SImode, gen_rtvec_v (4, words)); + ix86_expand_vector_init_general (false, V4SImode, tmp, vals); + emit_move_insn (target, gen_lowpart (mode, tmp)); + } + else + gcc_unreachable (); + } +} + +/* Initialize vector TARGET via VALS. Suppress the use of MMX + instructions unless MMX_OK is true. */ + +void +ix86_expand_vector_init (bool mmx_ok, rtx target, rtx vals) +{ + enum machine_mode mode = GET_MODE (target); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + int n_elts = GET_MODE_NUNITS (mode); + int n_var = 0, one_var = -1; + bool all_same = true, all_const_zero = true; + int i; + rtx x; + + for (i = 0; i < n_elts; ++i) + { + x = XVECEXP (vals, 0, i); + if (!CONSTANT_P (x)) + n_var++, one_var = i; + else if (x != CONST0_RTX (inner_mode)) + all_const_zero = false; + if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0))) + all_same = false; + } + + /* Constants are best loaded from the constant pool. */ + if (n_var == 0) { emit_move_insn (target, gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0))); return; } - /* ... values where only first field is non-constant are best loaded - from the pool and overwriten via move later. */ - if (!i) - { - rtx op = simplify_gen_subreg (mode, XVECEXP (vals, 0, 0), - GET_MODE_INNER (mode), 0); + /* If all values are identical, broadcast the value. */ + if (all_same + && ix86_expand_vector_init_duplicate (mmx_ok, mode, target, + XVECEXP (vals, 0, 0))) + return; - op = force_reg (mode, op); - XVECEXP (vals, 0, 0) = CONST0_RTX (GET_MODE_INNER (mode)); - emit_move_insn (target, gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0))); - switch (GET_MODE (target)) + /* Values where only one field is non-constant are best loaded from + the pool and overwritten via move later. */ + if (n_var == 1) + { + if (all_const_zero + && ix86_expand_vector_init_one_nonzero (mmx_ok, mode, target, + XVECEXP (vals, 0, one_var), + one_var)) + return; + + if (ix86_expand_vector_init_one_var (mmx_ok, mode, target, vals, one_var)) + return; + } + + ix86_expand_vector_init_general (mmx_ok, mode, target, vals); +} + +void +ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) +{ + enum machine_mode mode = GET_MODE (target); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + bool use_vec_merge = false; + rtx tmp; + + switch (mode) + { + case V2SFmode: + case V2SImode: + if (mmx_ok) { - case V2DFmode: - emit_insn (gen_sse2_movsd (target, target, op)); - break; - case V4SFmode: - emit_insn (gen_sse_movss (target, target, op)); - break; - default: - break; + tmp = gen_reg_rtx (GET_MODE_INNER (mode)); + ix86_expand_vector_extract (true, tmp, target, 1 - elt); + if (elt == 0) + tmp = gen_rtx_VEC_CONCAT (mode, tmp, val); + else + tmp = gen_rtx_VEC_CONCAT (mode, val, tmp); + emit_insn (gen_rtx_SET (VOIDmode, target, tmp)); + return; + } + break; + + case V2DFmode: + case V2DImode: + { + rtx op0, op1; + + /* For the two element vectors, we implement a VEC_CONCAT with + the extraction of the other element. */ + + tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (1, GEN_INT (1 - elt))); + tmp = gen_rtx_VEC_SELECT (inner_mode, target, tmp); + + if (elt == 0) + op0 = val, op1 = tmp; + else + op0 = tmp, op1 = val; + + tmp = gen_rtx_VEC_CONCAT (mode, op0, op1); + emit_insn (gen_rtx_SET (VOIDmode, target, tmp)); + } + return; + + case V4SFmode: + switch (elt) + { + case 0: + use_vec_merge = true; + break; + + case 1: + /* tmp = target = A B C D */ + tmp = copy_to_reg (target); + /* target = A A B B */ + emit_insn (gen_sse_unpcklps (target, target, target)); + /* target = X A B B */ + ix86_expand_vector_set (false, target, val, 0); + /* target = A X C D */ + emit_insn (gen_sse_shufps_1 (target, target, tmp, + GEN_INT (1), GEN_INT (0), + GEN_INT (2+4), GEN_INT (3+4))); + return; + + case 2: + /* tmp = target = A B C D */ + tmp = copy_to_reg (target); + /* tmp = X B C D */ + ix86_expand_vector_set (false, tmp, val, 0); + /* target = A B X D */ + emit_insn (gen_sse_shufps_1 (target, target, tmp, + GEN_INT (0), GEN_INT (1), + GEN_INT (0+4), GEN_INT (3+4))); + return; + + case 3: + /* tmp = target = A B C D */ + tmp = copy_to_reg (target); + /* tmp = X B C D */ + ix86_expand_vector_set (false, tmp, val, 0); + /* target = A B X D */ + emit_insn (gen_sse_shufps_1 (target, target, tmp, + GEN_INT (0), GEN_INT (1), + GEN_INT (2+4), GEN_INT (0+4))); + return; + + default: + gcc_unreachable (); + } + break; + + case V4SImode: + /* Element 0 handled by vec_merge below. */ + if (elt == 0) + { + use_vec_merge = true; + break; + } + + if (TARGET_SSE2) + { + /* With SSE2, use integer shuffles to swap element 0 and ELT, + store into element 0, then shuffle them back. */ + + rtx order[4]; + + order[0] = GEN_INT (elt); + order[1] = const1_rtx; + order[2] = const2_rtx; + order[3] = GEN_INT (3); + order[elt] = const0_rtx; + + emit_insn (gen_sse2_pshufd_1 (target, target, order[0], + order[1], order[2], order[3])); + + ix86_expand_vector_set (false, target, val, 0); + + emit_insn (gen_sse2_pshufd_1 (target, target, order[0], + order[1], order[2], order[3])); + } + else + { + /* For SSE1, we have to reuse the V4SF code. */ + ix86_expand_vector_set (false, gen_lowpart (V4SFmode, target), + gen_lowpart (SFmode, val), elt); } return; + + case V8HImode: + use_vec_merge = TARGET_SSE2; + break; + case V4HImode: + use_vec_merge = mmx_ok && (TARGET_SSE || TARGET_3DNOW_A); + break; + + case V16QImode: + case V8QImode: + default: + break; } - /* And the busy sequence doing rotations. */ - switch (GET_MODE (target)) + if (use_vec_merge) { - case V2DFmode: - { - rtx vecop0 = - simplify_gen_subreg (V2DFmode, XVECEXP (vals, 0, 0), DFmode, 0); - rtx vecop1 = - simplify_gen_subreg (V2DFmode, XVECEXP (vals, 0, 1), DFmode, 0); - - vecop0 = force_reg (V2DFmode, vecop0); - vecop1 = force_reg (V2DFmode, vecop1); - emit_insn (gen_sse2_unpcklpd (target, vecop0, vecop1)); - } - break; - case V4SFmode: - { - rtx vecop0 = - simplify_gen_subreg (V4SFmode, XVECEXP (vals, 0, 0), SFmode, 0); - rtx vecop1 = - simplify_gen_subreg (V4SFmode, XVECEXP (vals, 0, 1), SFmode, 0); - rtx vecop2 = - simplify_gen_subreg (V4SFmode, XVECEXP (vals, 0, 2), SFmode, 0); - rtx vecop3 = - simplify_gen_subreg (V4SFmode, XVECEXP (vals, 0, 3), SFmode, 0); - rtx tmp1 = gen_reg_rtx (V4SFmode); - rtx tmp2 = gen_reg_rtx (V4SFmode); - - vecop0 = force_reg (V4SFmode, vecop0); - vecop1 = force_reg (V4SFmode, vecop1); - vecop2 = force_reg (V4SFmode, vecop2); - vecop3 = force_reg (V4SFmode, vecop3); - emit_insn (gen_sse_unpcklps (tmp1, vecop1, vecop3)); - emit_insn (gen_sse_unpcklps (tmp2, vecop0, vecop2)); - emit_insn (gen_sse_unpcklps (target, tmp2, tmp1)); - } - break; - default: - abort (); + tmp = gen_rtx_VEC_DUPLICATE (mode, val); + tmp = gen_rtx_VEC_MERGE (mode, tmp, target, GEN_INT (1 << elt)); + emit_insn (gen_rtx_SET (VOIDmode, target, tmp)); } + else + { + rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), false); + + emit_move_insn (mem, target); + + tmp = adjust_address (mem, inner_mode, elt*GET_MODE_SIZE (inner_mode)); + emit_move_insn (tmp, val); + + emit_move_insn (target, mem); + } +} + +void +ix86_expand_vector_extract (bool mmx_ok, rtx target, rtx vec, int elt) +{ + enum machine_mode mode = GET_MODE (vec); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + bool use_vec_extr = false; + rtx tmp; + + switch (mode) + { + case V2SImode: + case V2SFmode: + if (!mmx_ok) + break; + /* FALLTHRU */ + + case V2DFmode: + case V2DImode: + use_vec_extr = true; + break; + + case V4SFmode: + switch (elt) + { + case 0: + tmp = vec; + break; + + case 1: + case 3: + tmp = gen_reg_rtx (mode); + emit_insn (gen_sse_shufps_1 (tmp, vec, vec, + GEN_INT (elt), GEN_INT (elt), + GEN_INT (elt+4), GEN_INT (elt+4))); + break; + + case 2: + tmp = gen_reg_rtx (mode); + emit_insn (gen_sse_unpckhps (tmp, vec, vec)); + break; + + default: + gcc_unreachable (); + } + vec = tmp; + use_vec_extr = true; + elt = 0; + break; + + case V4SImode: + if (TARGET_SSE2) + { + switch (elt) + { + case 0: + tmp = vec; + break; + + case 1: + case 3: + tmp = gen_reg_rtx (mode); + emit_insn (gen_sse2_pshufd_1 (tmp, vec, + GEN_INT (elt), GEN_INT (elt), + GEN_INT (elt), GEN_INT (elt))); + break; + + case 2: + tmp = gen_reg_rtx (mode); + emit_insn (gen_sse2_punpckhdq (tmp, vec, vec)); + break; + + default: + gcc_unreachable (); + } + vec = tmp; + use_vec_extr = true; + elt = 0; + } + else + { + /* For SSE1, we have to reuse the V4SF code. */ + ix86_expand_vector_extract (false, gen_lowpart (SFmode, target), + gen_lowpart (V4SFmode, vec), elt); + return; + } + break; + + case V8HImode: + use_vec_extr = TARGET_SSE2; + break; + case V4HImode: + use_vec_extr = mmx_ok && (TARGET_SSE || TARGET_3DNOW_A); + break; + + case V16QImode: + case V8QImode: + /* ??? Could extract the appropriate HImode element and shift. */ + default: + break; + } + + if (use_vec_extr) + { + tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (1, GEN_INT (elt))); + tmp = gen_rtx_VEC_SELECT (inner_mode, vec, tmp); + + /* Let the rtl optimizers know about the zero extension performed. */ + if (inner_mode == HImode) + { + tmp = gen_rtx_ZERO_EXTEND (SImode, tmp); + target = gen_lowpart (SImode, target); + } + + emit_insn (gen_rtx_SET (VOIDmode, target, tmp)); + } + else + { + rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), false); + + emit_move_insn (mem, vec); + + tmp = adjust_address (mem, inner_mode, elt*GET_MODE_SIZE (inner_mode)); + emit_move_insn (target, tmp); + } +} + +/* Expand a vector reduction on V4SFmode for SSE1. FN is the binary + pattern to reduce; DEST is the destination; IN is the input vector. */ + +void +ix86_expand_reduc_v4sf (rtx (*fn) (rtx, rtx, rtx), rtx dest, rtx in) +{ + rtx tmp1, tmp2, tmp3; + + tmp1 = gen_reg_rtx (V4SFmode); + tmp2 = gen_reg_rtx (V4SFmode); + tmp3 = gen_reg_rtx (V4SFmode); + + emit_insn (gen_sse_movhlps (tmp1, in, in)); + emit_insn (fn (tmp2, tmp1, in)); + + emit_insn (gen_sse_shufps_1 (tmp3, tmp2, tmp2, + GEN_INT (1), GEN_INT (1), + GEN_INT (1+4), GEN_INT (1+4))); + emit_insn (fn (dest, tmp2, tmp3)); +} + +/* Target hook for scalar_mode_supported_p. */ +static bool +ix86_scalar_mode_supported_p (enum machine_mode mode) +{ + if (DECIMAL_FLOAT_MODE_P (mode)) + return true; + else + return default_scalar_mode_supported_p (mode); +} + +/* Implements target hook vector_mode_supported_p. */ +static bool +ix86_vector_mode_supported_p (enum machine_mode mode) +{ + if (TARGET_SSE && VALID_SSE_REG_MODE (mode)) + return true; + if (TARGET_SSE2 && VALID_SSE2_REG_MODE (mode)) + return true; + if (TARGET_MMX && VALID_MMX_REG_MODE (mode)) + return true; + if (TARGET_3DNOW && VALID_MMX_REG_MODE_3DNOW (mode)) + return true; + return false; +} + +/* Worker function for TARGET_MD_ASM_CLOBBERS. + + We do this in the new i386 backend to maintain source compatibility + with the old cc0-based compiler. */ + +static tree +ix86_md_asm_clobbers (tree outputs ATTRIBUTE_UNUSED, + tree inputs ATTRIBUTE_UNUSED, + tree clobbers) +{ + clobbers = tree_cons (NULL_TREE, build_string (5, "flags"), + clobbers); + clobbers = tree_cons (NULL_TREE, build_string (4, "fpsr"), + clobbers); + clobbers = tree_cons (NULL_TREE, build_string (7, "dirflag"), + clobbers); + return clobbers; +} + +/* Return true if this goes in small data/bss. */ + +static bool +ix86_in_large_data_p (tree exp) +{ + if (ix86_cmodel != CM_MEDIUM && ix86_cmodel != CM_MEDIUM_PIC) + return false; + + /* Functions are never large data. */ + if (TREE_CODE (exp) == FUNCTION_DECL) + return false; + + if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp)) + { + const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp)); + if (strcmp (section, ".ldata") == 0 + || strcmp (section, ".lbss") == 0) + return true; + return false; + } + else + { + HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp)); + + /* If this is an incomplete type with size 0, then we can't put it + in data because it might be too big when completed. */ + if (!size || size > ix86_section_threshold) + return true; + } + + return false; +} +static void +ix86_encode_section_info (tree decl, rtx rtl, int first) +{ + default_encode_section_info (decl, rtl, first); + + if (TREE_CODE (decl) == VAR_DECL + && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)) + && ix86_in_large_data_p (decl)) + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_FAR_ADDR; +} + +/* Worker function for REVERSE_CONDITION. */ + +enum rtx_code +ix86_reverse_condition (enum rtx_code code, enum machine_mode mode) +{ + return (mode != CCFPmode && mode != CCFPUmode + ? reverse_condition (code) + : reverse_condition_maybe_unordered (code)); +} + +/* Output code to perform an x87 FP register move, from OPERANDS[1] + to OPERANDS[0]. */ + +const char * +output_387_reg_move (rtx insn, rtx *operands) +{ + if (REG_P (operands[1]) + && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + { + if (REGNO (operands[0]) == FIRST_STACK_REG) + return output_387_ffreep (operands, 0); + return "fstp\t%y0"; + } + if (STACK_TOP_P (operands[0])) + return "fld%z1\t%y1"; + return "fst\t%y0"; +} + +/* Output code to perform a conditional jump to LABEL, if C2 flag in + FP status register is set. */ + +void +ix86_emit_fp_unordered_jump (rtx label) +{ + rtx reg = gen_reg_rtx (HImode); + rtx temp; + + emit_insn (gen_x86_fnstsw_1 (reg)); + + if (TARGET_USE_SAHF) + { + emit_insn (gen_x86_sahf_1 (reg)); + + temp = gen_rtx_REG (CCmode, FLAGS_REG); + temp = gen_rtx_UNORDERED (VOIDmode, temp, const0_rtx); + } + else + { + emit_insn (gen_testqi_ext_ccno_0 (reg, GEN_INT (0x04))); + + temp = gen_rtx_REG (CCNOmode, FLAGS_REG); + temp = gen_rtx_NE (VOIDmode, temp, const0_rtx); + } + + temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp, + gen_rtx_LABEL_REF (VOIDmode, label), + pc_rtx); + temp = gen_rtx_SET (VOIDmode, pc_rtx, temp); + emit_jump_insn (temp); +} + +/* Output code to perform a log1p XFmode calculation. */ + +void ix86_emit_i387_log1p (rtx op0, rtx op1) +{ + rtx label1 = gen_label_rtx (); + rtx label2 = gen_label_rtx (); + + rtx tmp = gen_reg_rtx (XFmode); + rtx tmp2 = gen_reg_rtx (XFmode); + + emit_insn (gen_absxf2 (tmp, op1)); + emit_insn (gen_cmpxf (tmp, + CONST_DOUBLE_FROM_REAL_VALUE ( + REAL_VALUE_ATOF ("0.29289321881345247561810596348408353", XFmode), + XFmode))); + emit_jump_insn (gen_bge (label1)); + + emit_move_insn (tmp2, standard_80387_constant_rtx (4)); /* fldln2 */ + emit_insn (gen_fyl2xp1_xf3 (op0, tmp2, op1)); + emit_jump (label2); + + emit_label (label1); + emit_move_insn (tmp, CONST1_RTX (XFmode)); + emit_insn (gen_addxf3 (tmp, op1, tmp)); + emit_move_insn (tmp2, standard_80387_constant_rtx (4)); /* fldln2 */ + emit_insn (gen_fyl2x_xf3 (op0, tmp2, tmp)); + + emit_label (label2); +} + +/* Solaris implementation of TARGET_ASM_NAMED_SECTION. */ + +static void +i386_solaris_elf_named_section (const char *name, unsigned int flags, + tree decl) +{ + /* With Binutils 2.15, the "@unwind" marker must be specified on + every occurrence of the ".eh_frame" section, not just the first + one. */ + if (TARGET_64BIT + && strcmp (name, ".eh_frame") == 0) + { + fprintf (asm_out_file, "\t.section\t%s,\"%s\",@unwind\n", name, + flags & SECTION_WRITE ? "aw" : "a"); + return; + } + default_elf_asm_named_section (name, flags, decl); +} + +/* Return the mangling of TYPE if it is an extended fundamental type. */ + +static const char * +ix86_mangle_fundamental_type (tree type) +{ + switch (TYPE_MODE (type)) + { + case TFmode: + /* __float128 is "g". */ + return "g"; + case XFmode: + /* "long double" or __float80 is "e". */ + return "e"; + default: + return NULL; + } +} + +/* For 32-bit code we can save PIC register setup by using + __stack_chk_fail_local hidden function instead of calling + __stack_chk_fail directly. 64-bit code doesn't need to setup any PIC + register, so it is better to call __stack_chk_fail directly. */ + +static tree +ix86_stack_protect_fail (void) +{ + return TARGET_64BIT + ? default_external_stack_protect_fail () + : default_hidden_stack_protect_fail (); +} + +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. + + ??? All x86 object file formats are capable of representing this. + After all, the relocation needed is the same as for the call insn. + Whether or not a particular assembler allows us to enter such, I + guess we'll have to see. */ +int +asm_preferred_eh_data_format (int code, int global) +{ + if (flag_pic) + { + int type = DW_EH_PE_sdata8; + if (!TARGET_64BIT + || ix86_cmodel == CM_SMALL_PIC + || (ix86_cmodel == CM_MEDIUM_PIC && (global || code))) + type = DW_EH_PE_sdata4; + return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | type; + } + if (ix86_cmodel == CM_SMALL + || (ix86_cmodel == CM_MEDIUM && code)) + return DW_EH_PE_udata4; + return DW_EH_PE_absptr; } #include "gt-i386.h" diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h index 8a912d5f1d1..ba732dc32dd 100644 --- a/contrib/gcc/config/i386/i386.h +++ b/contrib/gcc/config/i386/i386.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC for IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* The purpose of this file is to define the characteristics of the i386, independent of assembler syntax or operating system. @@ -41,10 +41,10 @@ struct processor_costs { const int lea; /* cost of a lea instruction */ const int shift_var; /* variable shift costs */ const int shift_const; /* constant shift costs */ - const int mult_init[5]; /* cost of starting a multiply + const int mult_init[5]; /* cost of starting a multiply in QImode, HImode, SImode, DImode, TImode*/ const int mult_bit; /* cost of multiply per each bit set */ - const int divide[5]; /* cost of a divide/mod + const int divide[5]; /* cost of a divide/mod in QImode, HImode, SImode, DImode, TImode*/ int movsx; /* The cost of movsx operation. */ int movzx; /* The cost of movzx operation. */ @@ -88,117 +88,33 @@ struct processor_costs { extern const struct processor_costs *ix86_cost; -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - /* Macros used in the machine description to test the flags. */ /* configure can arrange to make this 2, to force a 486. */ #ifndef TARGET_CPU_DEFAULT -#ifdef TARGET_64BIT_DEFAULT -#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_k8 -#else -#define TARGET_CPU_DEFAULT 0 -#endif +#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_generic #endif -/* Masks for the -m switches */ -#define MASK_80387 0x00000001 /* Hardware floating point */ -#define MASK_RTD 0x00000002 /* Use ret that pops args */ -#define MASK_ALIGN_DOUBLE 0x00000004 /* align doubles to 2 word boundary */ -#define MASK_SVR3_SHLIB 0x00000008 /* Uninit locals into bss */ -#define MASK_IEEE_FP 0x00000010 /* IEEE fp comparisons */ -#define MASK_FLOAT_RETURNS 0x00000020 /* Return float in st(0) */ -#define MASK_NO_FANCY_MATH_387 0x00000040 /* Disable sin, cos, sqrt */ -#define MASK_OMIT_LEAF_FRAME_POINTER 0x080 /* omit leaf frame pointers */ -#define MASK_STACK_PROBE 0x00000100 /* Enable stack probing */ -#define MASK_NO_ALIGN_STROPS 0x00000200 /* Enable aligning of string ops. */ -#define MASK_INLINE_ALL_STROPS 0x00000400 /* Inline stringops in all cases */ -#define MASK_NO_PUSH_ARGS 0x00000800 /* Use push instructions */ -#define MASK_ACCUMULATE_OUTGOING_ARGS 0x00001000/* Accumulate outgoing args */ -#define MASK_MMX 0x00002000 /* Support MMX regs/builtins */ -#define MASK_SSE 0x00004000 /* Support SSE regs/builtins */ -#define MASK_SSE2 0x00008000 /* Support SSE2 regs/builtins */ -#define MASK_SSE3 0x00010000 /* Support SSE3 regs/builtins */ -#define MASK_3DNOW 0x00020000 /* Support 3Dnow builtins */ -#define MASK_3DNOW_A 0x00040000 /* Support Athlon 3Dnow builtins */ -#define MASK_128BIT_LONG_DOUBLE 0x00080000 /* long double size is 128bit */ -#define MASK_64BIT 0x00100000 /* Produce 64bit code */ -#define MASK_MS_BITFIELD_LAYOUT 0x00200000 /* Use native (MS) bitfield layout */ -#define MASK_TLS_DIRECT_SEG_REFS 0x00400000 /* Avoid adding %gs:0 */ +#ifndef TARGET_FPMATH_DEFAULT +#define TARGET_FPMATH_DEFAULT \ + (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387) +#endif -/* Unused: 0x03e0000 */ - -/* ... overlap with subtarget options starts by 0x04000000. */ -#define MASK_NO_RED_ZONE 0x04000000 /* Do not use red zone */ - -/* Use the floating point instructions */ -#define TARGET_80387 (target_flags & MASK_80387) - -/* Compile using ret insn that pops args. - This will not work unless you use prototypes at least - for all functions that can take varying numbers of args. */ -#define TARGET_RTD (target_flags & MASK_RTD) - -/* Align doubles to a two word boundary. This breaks compatibility with - the published ABI's for structures containing doubles, but produces - faster code on the pentium. */ -#define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE) - -/* Use push instructions to save outgoing args. */ -#define TARGET_PUSH_ARGS (!(target_flags & MASK_NO_PUSH_ARGS)) - -/* Accumulate stack adjustments to prologue/epilogue. */ -#define TARGET_ACCUMULATE_OUTGOING_ARGS \ - (target_flags & MASK_ACCUMULATE_OUTGOING_ARGS) - -/* Put uninitialized locals into bss, not data. - Meaningful only on svr3. */ -#define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB) - -/* Use IEEE floating point comparisons. These handle correctly the cases - where the result of a comparison is unordered. Normally SIGFPE is - generated in such cases, in which case this isn't needed. */ -#define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP) - -/* Functions that return a floating point value may return that value - in the 387 FPU or in 386 integer registers. If set, this flag causes - the 387 to be used, which is compatible with most calling conventions. */ -#define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS) - -/* Long double is 128bit instead of 96bit, even when only 80bits are used. - This mode wastes cache, but avoid misaligned data accesses and simplifies - address calculations. */ -#define TARGET_128BIT_LONG_DOUBLE (target_flags & MASK_128BIT_LONG_DOUBLE) - -/* Disable generation of FP sin, cos and sqrt operations for 387. - This is because FreeBSD lacks these in the math-emulator-code */ -#define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387) - -/* Don't create frame pointers for leaf functions */ -#define TARGET_OMIT_LEAF_FRAME_POINTER \ - (target_flags & MASK_OMIT_LEAF_FRAME_POINTER) - -/* Debug GO_IF_LEGITIMATE_ADDRESS */ -#define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0) - -/* Debug FUNCTION_ARG macros */ -#define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0) +#define TARGET_FLOAT_RETURNS_IN_80387 TARGET_FLOAT_RETURNS /* 64bit Sledgehammer mode. For libgcc2 we make sure this is a compile-time constant. */ #ifdef IN_LIBGCC2 +#undef TARGET_64BIT #ifdef __x86_64__ #define TARGET_64BIT 1 #else #define TARGET_64BIT 0 #endif #else -#ifdef TARGET_BI_ARCH -#define TARGET_64BIT (target_flags & MASK_64BIT) -#else +#ifndef TARGET_BI_ARCH +#undef TARGET_64BIT #if TARGET_64BIT_DEFAULT #define TARGET_64BIT 1 #else @@ -207,8 +123,8 @@ extern int target_flags; #endif #endif -/* Avoid adding %gs:0 in TLS references; use %gs:address directly. */ -#define TARGET_TLS_DIRECT_SEG_REFS (target_flags & MASK_TLS_DIRECT_SEG_REFS) +#define HAS_LONG_COND_BRANCH 1 +#define HAS_LONG_UNCOND_BRANCH 1 #define TARGET_386 (ix86_tune == PROCESSOR_I386) #define TARGET_486 (ix86_tune == PROCESSOR_I486) @@ -219,14 +135,18 @@ extern int target_flags; #define TARGET_PENTIUM4 (ix86_tune == PROCESSOR_PENTIUM4) #define TARGET_K8 (ix86_tune == PROCESSOR_K8) #define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON) +#define TARGET_NOCONA (ix86_tune == PROCESSOR_NOCONA) +#define TARGET_GENERIC32 (ix86_tune == PROCESSOR_GENERIC32) +#define TARGET_GENERIC64 (ix86_tune == PROCESSOR_GENERIC64) +#define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64) #define TUNEMASK (1 << ix86_tune) extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and; extern const int x86_use_bit_test, x86_cmove, x86_deep_branch; extern const int x86_branch_hints, x86_unroll_strlen; extern const int x86_double_with_add, x86_partial_reg_stall, x86_movx; -extern const int x86_use_loop, x86_use_fiop, x86_use_mov0; -extern const int x86_use_cltd, x86_read_modify_write; +extern const int x86_use_himode_fiop, x86_use_simode_fiop; +extern const int x86_use_mov0, x86_use_cltd, x86_read_modify_write; extern const int x86_read_modify, x86_split_long_moves; extern const int x86_promote_QImode, x86_single_stringop, x86_fast_prefix; extern const int x86_himode_math, x86_qimode_math, x86_promote_qi_regs; @@ -236,10 +156,15 @@ extern const int x86_partial_reg_dependency, x86_memory_mismatch_stall; extern const int x86_accumulate_outgoing_args, x86_prologue_using_move; extern const int x86_epilogue_using_move, x86_decompose_lea; extern const int x86_arch_always_fancy_math_387, x86_shift1; -extern const int x86_sse_partial_reg_dependency, x86_sse_partial_regs; +extern const int x86_sse_partial_reg_dependency, x86_sse_split_regs; extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor; -extern const int x86_use_ffreep, x86_sse_partial_regs_for_cvtsd2ss; -extern const int x86_inter_unit_moves; +extern const int x86_use_ffreep; +extern const int x86_inter_unit_moves, x86_schedule; +extern const int x86_use_bt; +extern const int x86_cmpxchg, x86_cmpxchg8b, x86_cmpxchg16b, x86_xadd; +extern const int x86_use_incdec; +extern const int x86_pad_returns; +extern const int x86_partial_flag_reg_stall; extern int x86_prefetch_sse; #define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK) @@ -250,14 +175,16 @@ extern int x86_prefetch_sse; /* For sane SSE instruction set generation we need fcomi instruction. It is safe to enable all CMOVE instructions. */ #define TARGET_CMOVE ((x86_cmove & (1 << ix86_arch)) || TARGET_SSE) +#define TARGET_FISTTP (TARGET_SSE3 && TARGET_80387) #define TARGET_DEEP_BRANCH_PREDICTION (x86_deep_branch & TUNEMASK) #define TARGET_BRANCH_PREDICTION_HINTS (x86_branch_hints & TUNEMASK) #define TARGET_DOUBLE_WITH_ADD (x86_double_with_add & TUNEMASK) #define TARGET_USE_SAHF ((x86_use_sahf & TUNEMASK) && !TARGET_64BIT) #define TARGET_MOVX (x86_movx & TUNEMASK) #define TARGET_PARTIAL_REG_STALL (x86_partial_reg_stall & TUNEMASK) -#define TARGET_USE_LOOP (x86_use_loop & TUNEMASK) -#define TARGET_USE_FIOP (x86_use_fiop & TUNEMASK) +#define TARGET_PARTIAL_FLAG_REG_STALL (x86_partial_flag_reg_stall & TUNEMASK) +#define TARGET_USE_HIMODE_FIOP (x86_use_himode_fiop & TUNEMASK) +#define TARGET_USE_SIMODE_FIOP (x86_use_simode_fiop & TUNEMASK) #define TARGET_USE_MOV0 (x86_use_mov0 & TUNEMASK) #define TARGET_USE_CLTD (x86_use_cltd & TUNEMASK) #define TARGET_SPLIT_LONG_MOVES (x86_split_long_moves & TUNEMASK) @@ -278,157 +205,38 @@ extern int x86_prefetch_sse; #define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & TUNEMASK) #define TARGET_SSE_PARTIAL_REG_DEPENDENCY \ (x86_sse_partial_reg_dependency & TUNEMASK) -#define TARGET_SSE_PARTIAL_REGS (x86_sse_partial_regs & TUNEMASK) -#define TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS \ - (x86_sse_partial_regs_for_cvtsd2ss & TUNEMASK) +#define TARGET_SSE_SPLIT_REGS (x86_sse_split_regs & TUNEMASK) #define TARGET_SSE_TYPELESS_STORES (x86_sse_typeless_stores & TUNEMASK) -#define TARGET_SSE_TYPELESS_LOAD0 (x86_sse_typeless_load0 & TUNEMASK) #define TARGET_SSE_LOAD0_BY_PXOR (x86_sse_load0_by_pxor & TUNEMASK) #define TARGET_MEMORY_MISMATCH_STALL (x86_memory_mismatch_stall & TUNEMASK) #define TARGET_PROLOGUE_USING_MOVE (x86_prologue_using_move & TUNEMASK) #define TARGET_EPILOGUE_USING_MOVE (x86_epilogue_using_move & TUNEMASK) -#define TARGET_DECOMPOSE_LEA (x86_decompose_lea & TUNEMASK) #define TARGET_PREFETCH_SSE (x86_prefetch_sse) #define TARGET_SHIFT1 (x86_shift1 & TUNEMASK) #define TARGET_USE_FFREEP (x86_use_ffreep & TUNEMASK) #define TARGET_REP_MOVL_OPTIMAL (x86_rep_movl_optimal & TUNEMASK) #define TARGET_INTER_UNIT_MOVES (x86_inter_unit_moves & TUNEMASK) - -#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE) - -#define TARGET_ALIGN_STRINGOPS (!(target_flags & MASK_NO_ALIGN_STROPS)) -#define TARGET_INLINE_ALL_STRINGOPS (target_flags & MASK_INLINE_ALL_STROPS) +#define TARGET_FOUR_JUMP_LIMIT (x86_four_jump_limit & TUNEMASK) +#define TARGET_SCHEDULE (x86_schedule & TUNEMASK) +#define TARGET_USE_BT (x86_use_bt & TUNEMASK) +#define TARGET_USE_INCDEC (x86_use_incdec & TUNEMASK) +#define TARGET_PAD_RETURNS (x86_pad_returns & TUNEMASK) #define ASSEMBLER_DIALECT (ix86_asm_dialect) -#define TARGET_SSE ((target_flags & MASK_SSE) != 0) -#define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0) -#define TARGET_SSE3 ((target_flags & MASK_SSE3) != 0) #define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0) #define TARGET_MIX_SSE_I387 ((ix86_fpmath & FPMATH_SSE) \ && (ix86_fpmath & FPMATH_387)) -#define TARGET_MMX ((target_flags & MASK_MMX) != 0) -#define TARGET_3DNOW ((target_flags & MASK_3DNOW) != 0) -#define TARGET_3DNOW_A ((target_flags & MASK_3DNOW_A) != 0) - -#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE)) - -#define TARGET_USE_MS_BITFIELD_LAYOUT (target_flags & MASK_MS_BITFIELD_LAYOUT) #define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU) +#define TARGET_GNU2_TLS (ix86_tls_dialect == TLS_DIALECT_GNU2) +#define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS) #define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN) -/* WARNING: Do not mark empty strings for translation, as calling - gettext on an empty string does NOT return an empty - string. */ - - -#define TARGET_SWITCHES \ -{ { "80387", MASK_80387, N_("Use hardware fp") }, \ - { "no-80387", -MASK_80387, N_("Do not use hardware fp") }, \ - { "hard-float", MASK_80387, N_("Use hardware fp") }, \ - { "soft-float", -MASK_80387, N_("Do not use hardware fp") }, \ - { "no-soft-float", MASK_80387, N_("Use hardware fp") }, \ - { "386", 0, "" /*Deprecated.*/}, \ - { "486", 0, "" /*Deprecated.*/}, \ - { "pentium", 0, "" /*Deprecated.*/}, \ - { "pentiumpro", 0, "" /*Deprecated.*/}, \ - { "pni", 0, "" /*Deprecated.*/}, \ - { "no-pni", 0, "" /*Deprecated.*/}, \ - { "intel-syntax", 0, "" /*Deprecated.*/}, \ - { "no-intel-syntax", 0, "" /*Deprecated.*/}, \ - { "rtd", MASK_RTD, \ - N_("Alternate calling convention") }, \ - { "no-rtd", -MASK_RTD, \ - N_("Use normal calling convention") }, \ - { "align-double", MASK_ALIGN_DOUBLE, \ - N_("Align some doubles on dword boundary") }, \ - { "no-align-double", -MASK_ALIGN_DOUBLE, \ - N_("Align doubles on word boundary") }, \ - { "svr3-shlib", MASK_SVR3_SHLIB, \ - N_("Uninitialized locals in .bss") }, \ - { "no-svr3-shlib", -MASK_SVR3_SHLIB, \ - N_("Uninitialized locals in .data") }, \ - { "ieee-fp", MASK_IEEE_FP, \ - N_("Use IEEE math for fp comparisons") }, \ - { "no-ieee-fp", -MASK_IEEE_FP, \ - N_("Do not use IEEE math for fp comparisons") }, \ - { "fp-ret-in-387", MASK_FLOAT_RETURNS, \ - N_("Return values of functions in FPU registers") }, \ - { "no-fp-ret-in-387", -MASK_FLOAT_RETURNS , \ - N_("Do not return values of functions in FPU registers")}, \ - { "no-fancy-math-387", MASK_NO_FANCY_MATH_387, \ - N_("Do not generate sin, cos, sqrt for FPU") }, \ - { "fancy-math-387", -MASK_NO_FANCY_MATH_387, \ - N_("Generate sin, cos, sqrt for FPU")}, \ - { "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER, \ - N_("Omit the frame pointer in leaf functions") }, \ - { "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER, "" }, \ - { "stack-arg-probe", MASK_STACK_PROBE, \ - N_("Enable stack probing") }, \ - { "no-stack-arg-probe", -MASK_STACK_PROBE, "" }, \ - { "windows", 0, 0 /* undocumented */ }, \ - { "dll", 0, 0 /* undocumented */ }, \ - { "align-stringops", -MASK_NO_ALIGN_STROPS, \ - N_("Align destination of the string operations") }, \ - { "no-align-stringops", MASK_NO_ALIGN_STROPS, \ - N_("Do not align destination of the string operations") }, \ - { "inline-all-stringops", MASK_INLINE_ALL_STROPS, \ - N_("Inline all known string operations") }, \ - { "no-inline-all-stringops", -MASK_INLINE_ALL_STROPS, \ - N_("Do not inline all known string operations") }, \ - { "push-args", -MASK_NO_PUSH_ARGS, \ - N_("Use push instructions to save outgoing arguments") }, \ - { "no-push-args", MASK_NO_PUSH_ARGS, \ - N_("Do not use push instructions to save outgoing arguments") }, \ - { "accumulate-outgoing-args", MASK_ACCUMULATE_OUTGOING_ARGS, \ - N_("Use push instructions to save outgoing arguments") }, \ - { "no-accumulate-outgoing-args",-MASK_ACCUMULATE_OUTGOING_ARGS, \ - N_("Do not use push instructions to save outgoing arguments") }, \ - { "mmx", MASK_MMX, \ - N_("Support MMX built-in functions") }, \ - { "no-mmx", -MASK_MMX, \ - N_("Do not support MMX built-in functions") }, \ - { "3dnow", MASK_3DNOW, \ - N_("Support 3DNow! built-in functions") }, \ - { "no-3dnow", -MASK_3DNOW, \ - N_("Do not support 3DNow! built-in functions") }, \ - { "sse", MASK_SSE, \ - N_("Support MMX and SSE built-in functions and code generation") }, \ - { "no-sse", -MASK_SSE, \ - N_("Do not support MMX and SSE built-in functions and code generation") },\ - { "sse2", MASK_SSE2, \ - N_("Support MMX, SSE and SSE2 built-in functions and code generation") }, \ - { "no-sse2", -MASK_SSE2, \ - N_("Do not support MMX, SSE and SSE2 built-in functions and code generation") }, \ - { "sse3", MASK_SSE3, \ - N_("Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\ - { "no-sse3", -MASK_SSE3, \ - N_("Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\ - { "128bit-long-double", MASK_128BIT_LONG_DOUBLE, \ - N_("sizeof(long double) is 16") }, \ - { "96bit-long-double", -MASK_128BIT_LONG_DOUBLE, \ - N_("sizeof(long double) is 12") }, \ - { "64", MASK_64BIT, \ - N_("Generate 64bit x86-64 code") }, \ - { "32", -MASK_64BIT, \ - N_("Generate 32bit i386 code") }, \ - { "ms-bitfields", MASK_MS_BITFIELD_LAYOUT, \ - N_("Use native (MS) bitfield layout") }, \ - { "no-ms-bitfields", -MASK_MS_BITFIELD_LAYOUT, \ - N_("Use gcc default bitfield layout") }, \ - { "red-zone", -MASK_NO_RED_ZONE, \ - N_("Use red-zone in the x86-64 code") }, \ - { "no-red-zone", MASK_NO_RED_ZONE, \ - N_("Do not use red-zone in the x86-64 code") }, \ - { "tls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS, \ - N_("Use direct references against %gs when accessing tls data") }, \ - { "no-tls-direct-seg-refs", -MASK_TLS_DIRECT_SEG_REFS, \ - N_("Do not use direct references against %gs when accessing tls data") }, \ - SUBTARGET_SWITCHES \ - { "", \ - TARGET_DEFAULT | TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_DEFAULT \ - | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT, 0 }} +#define TARGET_CMPXCHG (x86_cmpxchg & (1 << ix86_arch)) +#define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch)) +#define TARGET_CMPXCHG16B (x86_cmpxchg16b & (1 << ix86_arch)) +#define TARGET_XADD (x86_xadd & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 @@ -451,48 +259,6 @@ extern int x86_prefetch_sse; with the rounding mode forced to 53 bits. */ #define TARGET_96_ROUND_53_LONG_DOUBLE 0 -/* This macro is similar to `TARGET_SWITCHES' but defines names of - command options that have values. Its definition is an - initializer with a subgrouping for each command option. - - Each subgrouping contains a string constant, that defines the - fixed part of the option name, and the address of a variable. The - variable, type `char *', is set to the variable part of the given - option if the fixed part matches. The actual option name is made - by appending `-m' to the specified name. */ -#define TARGET_OPTIONS \ -{ { "tune=", &ix86_tune_string, \ - N_("Schedule code for given CPU"), 0}, \ - { "fpmath=", &ix86_fpmath_string, \ - N_("Generate floating point mathematics using given instruction set"), 0},\ - { "arch=", &ix86_arch_string, \ - N_("Generate code for given CPU"), 0}, \ - { "regparm=", &ix86_regparm_string, \ - N_("Number of registers used to pass integer arguments"), 0},\ - { "align-loops=", &ix86_align_loops_string, \ - N_("Loop code aligned to this power of 2"), 0}, \ - { "align-jumps=", &ix86_align_jumps_string, \ - N_("Jump targets are aligned to this power of 2"), 0}, \ - { "align-functions=", &ix86_align_funcs_string, \ - N_("Function starts are aligned to this power of 2"), 0}, \ - { "preferred-stack-boundary=", \ - &ix86_preferred_stack_boundary_string, \ - N_("Attempt to keep stack aligned to this power of 2"), 0}, \ - { "branch-cost=", &ix86_branch_cost_string, \ - N_("Branches are this expensive (1-5, arbitrary units)"), 0},\ - { "cmodel=", &ix86_cmodel_string, \ - N_("Use given x86-64 code model"), 0}, \ - { "debug-arg", &ix86_debug_arg_string, \ - "" /* Undocumented. */, 0}, \ - { "debug-addr", &ix86_debug_addr_string, \ - "" /* Undocumented. */, 0}, \ - { "asm=", &ix86_asm_string, \ - N_("Use given assembler dialect"), 0}, \ - { "tls-dialect=", &ix86_tls_dialect_string, \ - N_("Use given thread-local storage dialect"), 0}, \ - SUBTARGET_OPTIONS \ -} - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -504,24 +270,33 @@ extern int x86_prefetch_sse; #define OVERRIDE_OPTIONS override_options () -/* These are meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES -#define SUBTARGET_OPTIONS - /* Define this to change the optimizations performed by default. */ #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ optimization_options ((LEVEL), (SIZE)) -/* Support for configure-time defaults of some command line options. */ +/* -march=native handling only makes sense with compiler running on + an x86 or x86_64 chip. If changing this condition, also change + the condition in driver-i386.c. */ +#if defined(__i386__) || defined(__x86_64__) +/* In driver-i386.c. */ +extern const char *host_detect_local_cpu (int argc, const char **argv); +#define EXTRA_SPEC_FUNCTIONS \ + { "local_cpu_detect", host_detect_local_cpu }, +#define HAVE_LOCAL_CPU_DETECT +#endif + +/* Support for configure-time defaults of some command line options. + The order here is important so that -march doesn't squash the + tune or cpu values. */ #define OPTION_DEFAULT_SPECS \ - {"arch", "%{!march=*:-march=%(VALUE)}"}, \ {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ - {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" } + {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \ + {"arch", "%{!march=*:-march=%(VALUE)}"} /* Specs for the compiler proper */ #ifndef CC1_CPU_SPEC -#define CC1_CPU_SPEC "\ +#define CC1_CPU_SPEC_1 "\ %{!mtune*: \ %{m386:mtune=i386 \ %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.\n} \ @@ -534,14 +309,19 @@ extern int x86_prefetch_sse; %{mcpu=*:-mtune=%* \ %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n}} \ % 1) \ + fixed_regs[i] = (fixed_regs[i] == (TARGET_64BIT ? 3 : 2)); \ + if (call_used_regs[i] > 1) \ + call_used_regs[i] = (call_used_regs[i] \ + == (TARGET_64BIT ? 3 : 2)); \ } \ if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ { \ @@ -1022,14 +813,14 @@ do { \ int i; \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (reg_class_contents[(int)MMX_REGS], i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ } \ if (! TARGET_SSE) \ { \ int i; \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (reg_class_contents[(int)SSE_REGS], i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ } \ if (! TARGET_80387 && ! TARGET_FLOAT_RETURNS_IN_80387) \ { \ @@ -1038,7 +829,15 @@ do { \ COPY_HARD_REG_SET (x, reg_class_contents[(int)FLOAT_REGS]); \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (x, i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ + } \ + if (! TARGET_64BIT) \ + { \ + int i; \ + for (i = FIRST_REX_INT_REG; i <= LAST_REX_INT_REG; i++) \ + reg_names[i] = ""; \ + for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) \ + reg_names[i] = ""; \ } \ } while (0) @@ -1061,6 +860,15 @@ do { \ ? (TARGET_64BIT ? 4 : 6) \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))) +#define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) \ + ((TARGET_128BIT_LONG_DOUBLE && !TARGET_64BIT) \ + ? (FP_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \ + ? 0 \ + : ((MODE) == XFmode || (MODE) == XCmode)) \ + : 0) + +#define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) ((MODE) == XFmode ? 4 : 8) + #define VALID_SSE2_REG_MODE(MODE) \ ((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \ || (MODE) == V2DImode || (MODE) == DFmode) @@ -1076,10 +884,9 @@ do { \ ((MODE) == DImode || (MODE) == V8QImode || (MODE) == V4HImode \ || (MODE) == V2SImode || (MODE) == SImode) -#define VECTOR_MODE_SUPPORTED_P(MODE) \ - (VALID_SSE_REG_MODE (MODE) && TARGET_SSE ? 1 \ - : VALID_MMX_REG_MODE (MODE) && TARGET_MMX ? 1 \ - : VALID_MMX_REG_MODE_3DNOW (MODE) && TARGET_3DNOW ? 1 : 0) +/* ??? No autovectorization into MMX or 3DNOW until we can reliably + place emms and femms instructions. */ +#define UNITS_PER_SIMD_WORD (TARGET_SSE ? 16 : UNITS_PER_WORD) #define VALID_FP_MODE_P(MODE) \ ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \ @@ -1099,11 +906,6 @@ do { \ || (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode \ || (MODE) == V4SFmode || (MODE) == V4SImode) -/* Return true for modes passed in MMX registers. */ -#define MMX_REG_MODE_P(MODE) \ - ((MODE) == V8QImode || (MODE) == V4HImode || (MODE) == V2SImode \ - || (MODE) == V2SFmode) - /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ @@ -1114,16 +916,7 @@ do { \ If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */ -#define MODES_TIEABLE_P(MODE1, MODE2) \ - ((MODE1) == (MODE2) \ - || (((MODE1) == HImode || (MODE1) == SImode \ - || ((MODE1) == QImode \ - && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL)) \ - || ((MODE1) == DImode && TARGET_64BIT)) \ - && ((MODE2) == HImode || (MODE2) == SImode \ - || ((MODE2) == QImode \ - && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL)) \ - || ((MODE2) == DImode && TARGET_64BIT)))) +#define MODES_TIEABLE_P(MODE1, MODE2) ix86_modes_tieable_p (MODE1, MODE2) /* It is possible to write patterns to move flags; but until someone does it, */ @@ -1164,10 +957,6 @@ do { \ #define FIRST_STACK_REG FIRST_FLOAT_REG #define LAST_STACK_REG (FIRST_FLOAT_REG + 7) -#define FLAGS_REG 17 -#define FPSR_REG 18 -#define DIRFLAG_REG 19 - #define FIRST_SSE_REG (FRAME_POINTER_REGNUM + 1) #define LAST_SSE_REG (FIRST_SSE_REG + 7) @@ -1186,7 +975,7 @@ do { \ This is computed in `reload', in reload1.c. */ #define FRAME_POINTER_REQUIRED ix86_frame_pointer_required () -/* Override this in other tm.h files to cope with various OS losage +/* Override this in other tm.h files to cope with various OS lossage requiring a frame pointer. */ #ifndef SUBTARGET_FRAME_POINTER_REQUIRED #define SUBTARGET_FRAME_POINTER_REQUIRED 0 @@ -1215,21 +1004,13 @@ do { \ #define REAL_PIC_OFFSET_TABLE_REGNUM 3 #define PIC_OFFSET_TABLE_REGNUM \ - (TARGET_64BIT || !flag_pic ? INVALID_REGNUM \ + ((TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC) \ + || !flag_pic ? INVALID_REGNUM \ : reload_completed ? REGNO (pic_offset_table_rtx) \ : REAL_PIC_OFFSET_TABLE_REGNUM) #define GOT_SYMBOL_NAME "_GLOBAL_OFFSET_TABLE_" -/* Register in which address to store a structure value - arrives in the function. On the 386, the prologue - copies this from the stack to register %eax. */ -#define STRUCT_VALUE_INCOMING 0 - -/* Place in which caller passes the structure value address. - 0 means push the value on the stack like an argument. */ -#define STRUCT_VALUE 0 - /* A C expression which can inhibit the returning of certain function values in registers, based on the type of value. A nonzero value says to return the function value in memory, just as large @@ -1253,6 +1034,8 @@ do { \ /* This is overridden by . */ #define MS_AGGREGATE_RETURN 0 +/* This is overridden by . */ +#define KEEP_AGGREGATE_RETURN_POINTER 0 /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. @@ -1310,9 +1093,9 @@ enum reg_class #define FLOAT_CLASS_P(CLASS) \ reg_class_subset_p ((CLASS), FLOAT_REGS) #define SSE_CLASS_P(CLASS) \ - reg_class_subset_p ((CLASS), SSE_REGS) + ((CLASS) == SSE_REGS) #define MMX_CLASS_P(CLASS) \ - reg_class_subset_p ((CLASS), MMX_REGS) + ((CLASS) == MMX_REGS) #define MAYBE_INTEGER_CLASS_P(CLASS) \ reg_classes_intersect_p ((CLASS), GENERAL_REGS) #define MAYBE_FLOAT_CLASS_P(CLASS) \ @@ -1445,83 +1228,6 @@ enum reg_class #define INDEX_REG_CLASS INDEX_REGS #define BASE_REG_CLASS GENERAL_REGS -/* Get reg_class from a letter such as appears in the machine description. */ - -#define REG_CLASS_FROM_LETTER(C) \ - ((C) == 'r' ? GENERAL_REGS : \ - (C) == 'R' ? LEGACY_REGS : \ - (C) == 'q' ? TARGET_64BIT ? GENERAL_REGS : Q_REGS : \ - (C) == 'Q' ? Q_REGS : \ - (C) == 'f' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \ - ? FLOAT_REGS \ - : NO_REGS) : \ - (C) == 't' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \ - ? FP_TOP_REG \ - : NO_REGS) : \ - (C) == 'u' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387 \ - ? FP_SECOND_REG \ - : NO_REGS) : \ - (C) == 'a' ? AREG : \ - (C) == 'b' ? BREG : \ - (C) == 'c' ? CREG : \ - (C) == 'd' ? DREG : \ - (C) == 'x' ? TARGET_SSE ? SSE_REGS : NO_REGS : \ - (C) == 'Y' ? TARGET_SSE2? SSE_REGS : NO_REGS : \ - (C) == 'y' ? TARGET_MMX ? MMX_REGS : NO_REGS : \ - (C) == 'A' ? AD_REGS : \ - (C) == 'D' ? DIREG : \ - (C) == 'S' ? SIREG : NO_REGS) - -/* The letters I, J, K, L and M in a register constraint string - can be used to stand for particular ranges of immediate operands. - This macro defines what the ranges are. - C is the letter, and VALUE is a constant value. - Return 1 if VALUE is in the range specified by C. - - I is for non-DImode shifts. - J is for DImode shifts. - K is for signed imm8 operands. - L is for andsi as zero-extending move. - M is for shifts that can be executed by the "lea" opcode. - N is for immediate operands for out/in instructions (0-255) - */ - -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 31 \ - : (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 63 \ - : (C) == 'K' ? (VALUE) >= -128 && (VALUE) <= 127 \ - : (C) == 'L' ? (VALUE) == 0xff || (VALUE) == 0xffff \ - : (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 3 \ - : (C) == 'N' ? (VALUE) >= 0 && (VALUE) <= 255 \ - : 0) - -/* Similar, but for floating constants, and defining letters G and H. - Here VALUE is the CONST_DOUBLE rtx itself. We allow constants even if - TARGET_387 isn't set, because the stack register converter may need to - load 0.0 into the function value register. */ - -#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? standard_80387_constant_p (VALUE) \ - : 0) - -/* A C expression that defines the optional machine-dependent - constraint letters that can be used to segregate specific types of - operands, usually memory references, for the target machine. Any - letter that is not elsewhere defined and not matched by - `REG_CLASS_FROM_LETTER' may be used. Normally this macro will not - be defined. - - If it is required for a particular target machine, it should - return 1 if VALUE corresponds to the operand type represented by - the constraint letter C. If C is not defined as an extra - constraint, the value returned should be 0 regardless of VALUE. */ - -#define EXTRA_CONSTRAINT(VALUE, D) \ - ((D) == 'e' ? x86_64_sign_extended_value (VALUE) \ - : (D) == 'Z' ? x86_64_zero_extended_value (VALUE) \ - : (D) == 'C' ? standard_sse_constant_p (VALUE) \ - : 0) - /* Place additional restrictions on the register class to use when it is necessary to be able to hold a value of mode MODE in a reload register for which class CLASS would ordinarily be used. */ @@ -1548,6 +1254,12 @@ enum reg_class #define PREFERRED_RELOAD_CLASS(X, CLASS) \ ix86_preferred_reload_class ((X), (CLASS)) +/* Discourage putting floating-point values in SSE registers unless + SSE math is being used, and likewise for the 387 registers. */ + +#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \ + ix86_preferred_output_reload_class ((X), (CLASS)) + /* If we are copying between general and FP registers, we need a memory location. The same is true for SSE and MMX registers. */ #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ @@ -1599,35 +1311,10 @@ enum reg_class || ((CLASS) == FP_TOP_REG) \ || ((CLASS) == FP_SECOND_REG)) -/* Return a class of registers that cannot change FROM mode to TO mode. - - x87 registers can't do subreg as all values are reformated to extended - precision. XMM registers does not support with nonzero offsets equal - to 4, 8 and 12 otherwise valid for integer registers. Since we can't - determine these, prohibit all nonparadoxical subregs changing size. */ +/* Return a class of registers that cannot change FROM mode to TO mode. */ -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (GET_MODE_SIZE (TO) < GET_MODE_SIZE (FROM) \ - ? reg_classes_intersect_p (FLOAT_SSE_REGS, (CLASS)) \ - || MAYBE_MMX_CLASS_P (CLASS) \ - : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0) - -/* A C statement that adds to CLOBBERS any hard regs the port wishes - to automatically clobber for all asms. - - We do this in the new i386 backend to maintain source compatibility - with the old cc0-based compiler. */ - -#define MD_ASM_CLOBBERS(CLOBBERS) \ - do { \ - (CLOBBERS) = tree_cons (NULL_TREE, build_string (5, "flags"), \ - (CLOBBERS)); \ - (CLOBBERS) = tree_cons (NULL_TREE, build_string (4, "fpsr"), \ - (CLOBBERS)); \ - (CLOBBERS) = tree_cons (NULL_TREE, build_string (7, "dirflag"), \ - (CLOBBERS)); \ - } while (0) +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + ix86_cannot_change_mode_class (FROM, TO, CLASS) /* Stack layout; function entry, exit and calling. */ @@ -1635,11 +1322,11 @@ enum reg_class makes the stack pointer a smaller address. */ #define STACK_GROWS_DOWNWARD -/* Define this if the nominal address of the stack frame +/* Define this to nonzero if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. */ -#define FRAME_GROWS_DOWNWARD +#define FRAME_GROWS_DOWNWARD 1 /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the @@ -1649,9 +1336,10 @@ enum reg_class /* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. - On 386 pushw decrements by exactly 2 no matter what the position was. - On the 386 there is no pushb; we use pushw instead, and this - has the effect of rounding up to 2. + On 386, we have pushw instruction that decrements by exactly 2 no + matter what the position was, there is no pushb. + But as CIE data alignment factor on this arch is -4, we need to make + sure all stack pointer adjustments are in multiple of 4. For 64bit ABI we round up to 8 bytes. */ @@ -1659,7 +1347,7 @@ enum reg_class #define PUSH_ROUNDING(BYTES) \ (TARGET_64BIT \ ? (((BYTES) + 7) & (-8)) \ - : (((BYTES) + 1) & (-2))) + : (((BYTES) + 3) & (-4))) /* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable @@ -1692,13 +1380,6 @@ enum reg_class which. */ #define REG_PARM_STACK_SPACE(FNDECL) 0 -/* Define as a C expression that evaluates to nonzero if we do not know how - to pass TYPE solely in registers. The file expr.h defines a - definition that is usually appropriate, refer to expr.h for additional - documentation. If `REG_PARM_STACK_SPACE' is defined, the argument will be - computed in the stack and then loaded into a register. */ -#define MUST_PASS_IN_STACK(MODE, TYPE) ix86_must_pass_in_stack ((MODE), (TYPE)) - /* Value is the number of bytes of arguments automatically popped when returning from a subroutine call. FUNDECL is the declaration node of the function (as a tree), @@ -1719,13 +1400,6 @@ enum reg_class #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) \ ix86_return_pops_args ((FUNDECL), (FUNTYPE), (SIZE)) -/* Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) \ - ix86_function_value (VALTYPE) - #define FUNCTION_VALUE_REGNO_P(N) \ ix86_function_value_regno_p (N) @@ -1754,7 +1428,7 @@ typedef struct ix86_args { int words; /* # words passed so far */ int nregs; /* # registers available for passing */ int regno; /* next available register number */ - int fastcall; /* fastcall calling convention is used */ + int fastcall; /* fastcall calling convention is used */ int sse_words; /* # sse words passed so far */ int sse_nregs; /* # sse registers available for passing */ int warn_sse; /* True when we want to warn about SSE ABI. */ @@ -1764,6 +1438,8 @@ typedef struct ix86_args { int mmx_nregs; /* # mmx registers available for passing */ int mmx_regno; /* next available mmx register number */ int maybe_vaarg; /* true for calls to possibly vardic fncts. */ + int float_in_sse; /* 1 if in 32-bit mode SFmode (2 for DFmode) should + be passed in SSE registers. Otherwise 0. */ } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS @@ -1796,47 +1472,10 @@ typedef struct ix86_args { #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (&(CUM), (MODE), (TYPE), (NAMED)) -/* For an arg passed partly in registers and partly in memory, - this is the number of registers used. - For args passed entirely in registers or entirely in memory, zero. */ - -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 - -/* A C expression that indicates when an argument must be passed by - reference. If nonzero for an argument, a copy of that argument is - made in memory and a pointer to the argument is passed instead of - the argument itself. The pointer is passed in whatever way is - appropriate for passing a pointer to that type. */ - -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED) - -/* Perform any needed actions needed for a function that is receiving a - variable number of arguments. - - CUM is as above. - - MODE and TYPE are the mode and type of the current parameter. - - PRETEND_SIZE is a variable that should be set to the amount of stack - that must be pushed by the prolog to pretend that our caller pushed - it. - - Normally, this macro will push all remaining incoming registers on the - stack and set PRETEND_SIZE to the length of the registers pushed. */ - -#define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL) \ - ix86_setup_incoming_varargs (&(CUM), (MODE), (TYPE), &(PRETEND_SIZE), \ - (NO_RTL)) - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \ ix86_va_start (VALIST, NEXTARG) -/* Implement `va_arg'. */ -#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \ - ix86_va_arg ((VALIST), (TYPE)) - #define TARGET_ASM_FILE_END ix86_file_end #define NEED_INDICATE_EXEC_STACK 0 @@ -1960,7 +1599,7 @@ typedef struct ix86_args { been eliminated by then. */ -/* Non strict versions, pseudos are ok */ +/* Non strict versions, pseudos are ok. */ #define REG_OK_FOR_INDEX_NONSTRICT_P(X) \ (REGNO (X) < STACK_POINTER_REGNUM \ || (REGNO (X) >= FIRST_REX_INT_REG \ @@ -2087,462 +1726,6 @@ do { \ goto LABEL; \ } while (0) -/* Codes for all the SSE/MMX builtins. */ -enum ix86_builtins -{ - IX86_BUILTIN_ADDPS, - IX86_BUILTIN_ADDSS, - IX86_BUILTIN_DIVPS, - IX86_BUILTIN_DIVSS, - IX86_BUILTIN_MULPS, - IX86_BUILTIN_MULSS, - IX86_BUILTIN_SUBPS, - IX86_BUILTIN_SUBSS, - - IX86_BUILTIN_CMPEQPS, - IX86_BUILTIN_CMPLTPS, - IX86_BUILTIN_CMPLEPS, - IX86_BUILTIN_CMPGTPS, - IX86_BUILTIN_CMPGEPS, - IX86_BUILTIN_CMPNEQPS, - IX86_BUILTIN_CMPNLTPS, - IX86_BUILTIN_CMPNLEPS, - IX86_BUILTIN_CMPNGTPS, - IX86_BUILTIN_CMPNGEPS, - IX86_BUILTIN_CMPORDPS, - IX86_BUILTIN_CMPUNORDPS, - IX86_BUILTIN_CMPNEPS, - IX86_BUILTIN_CMPEQSS, - IX86_BUILTIN_CMPLTSS, - IX86_BUILTIN_CMPLESS, - IX86_BUILTIN_CMPNEQSS, - IX86_BUILTIN_CMPNLTSS, - IX86_BUILTIN_CMPNLESS, - IX86_BUILTIN_CMPORDSS, - IX86_BUILTIN_CMPUNORDSS, - IX86_BUILTIN_CMPNESS, - - IX86_BUILTIN_COMIEQSS, - IX86_BUILTIN_COMILTSS, - IX86_BUILTIN_COMILESS, - IX86_BUILTIN_COMIGTSS, - IX86_BUILTIN_COMIGESS, - IX86_BUILTIN_COMINEQSS, - IX86_BUILTIN_UCOMIEQSS, - IX86_BUILTIN_UCOMILTSS, - IX86_BUILTIN_UCOMILESS, - IX86_BUILTIN_UCOMIGTSS, - IX86_BUILTIN_UCOMIGESS, - IX86_BUILTIN_UCOMINEQSS, - - IX86_BUILTIN_CVTPI2PS, - IX86_BUILTIN_CVTPS2PI, - IX86_BUILTIN_CVTSI2SS, - IX86_BUILTIN_CVTSI642SS, - IX86_BUILTIN_CVTSS2SI, - IX86_BUILTIN_CVTSS2SI64, - IX86_BUILTIN_CVTTPS2PI, - IX86_BUILTIN_CVTTSS2SI, - IX86_BUILTIN_CVTTSS2SI64, - - IX86_BUILTIN_MAXPS, - IX86_BUILTIN_MAXSS, - IX86_BUILTIN_MINPS, - IX86_BUILTIN_MINSS, - - IX86_BUILTIN_LOADAPS, - IX86_BUILTIN_LOADUPS, - IX86_BUILTIN_STOREAPS, - IX86_BUILTIN_STOREUPS, - IX86_BUILTIN_LOADSS, - IX86_BUILTIN_STORESS, - IX86_BUILTIN_MOVSS, - - IX86_BUILTIN_MOVHLPS, - IX86_BUILTIN_MOVLHPS, - IX86_BUILTIN_LOADHPS, - IX86_BUILTIN_LOADLPS, - IX86_BUILTIN_STOREHPS, - IX86_BUILTIN_STORELPS, - - IX86_BUILTIN_MASKMOVQ, - IX86_BUILTIN_MOVMSKPS, - IX86_BUILTIN_PMOVMSKB, - - IX86_BUILTIN_MOVNTPS, - IX86_BUILTIN_MOVNTQ, - - IX86_BUILTIN_LOADDQA, - IX86_BUILTIN_LOADDQU, - IX86_BUILTIN_STOREDQA, - IX86_BUILTIN_STOREDQU, - IX86_BUILTIN_MOVQ, - IX86_BUILTIN_LOADD, - IX86_BUILTIN_STORED, - - IX86_BUILTIN_CLRTI, - - IX86_BUILTIN_PACKSSWB, - IX86_BUILTIN_PACKSSDW, - IX86_BUILTIN_PACKUSWB, - - IX86_BUILTIN_PADDB, - IX86_BUILTIN_PADDW, - IX86_BUILTIN_PADDD, - IX86_BUILTIN_PADDQ, - IX86_BUILTIN_PADDSB, - IX86_BUILTIN_PADDSW, - IX86_BUILTIN_PADDUSB, - IX86_BUILTIN_PADDUSW, - IX86_BUILTIN_PSUBB, - IX86_BUILTIN_PSUBW, - IX86_BUILTIN_PSUBD, - IX86_BUILTIN_PSUBQ, - IX86_BUILTIN_PSUBSB, - IX86_BUILTIN_PSUBSW, - IX86_BUILTIN_PSUBUSB, - IX86_BUILTIN_PSUBUSW, - - IX86_BUILTIN_PAND, - IX86_BUILTIN_PANDN, - IX86_BUILTIN_POR, - IX86_BUILTIN_PXOR, - - IX86_BUILTIN_PAVGB, - IX86_BUILTIN_PAVGW, - - IX86_BUILTIN_PCMPEQB, - IX86_BUILTIN_PCMPEQW, - IX86_BUILTIN_PCMPEQD, - IX86_BUILTIN_PCMPGTB, - IX86_BUILTIN_PCMPGTW, - IX86_BUILTIN_PCMPGTD, - - IX86_BUILTIN_PEXTRW, - IX86_BUILTIN_PINSRW, - - IX86_BUILTIN_PMADDWD, - - IX86_BUILTIN_PMAXSW, - IX86_BUILTIN_PMAXUB, - IX86_BUILTIN_PMINSW, - IX86_BUILTIN_PMINUB, - - IX86_BUILTIN_PMULHUW, - IX86_BUILTIN_PMULHW, - IX86_BUILTIN_PMULLW, - - IX86_BUILTIN_PSADBW, - IX86_BUILTIN_PSHUFW, - - IX86_BUILTIN_PSLLW, - IX86_BUILTIN_PSLLD, - IX86_BUILTIN_PSLLQ, - IX86_BUILTIN_PSRAW, - IX86_BUILTIN_PSRAD, - IX86_BUILTIN_PSRLW, - IX86_BUILTIN_PSRLD, - IX86_BUILTIN_PSRLQ, - IX86_BUILTIN_PSLLWI, - IX86_BUILTIN_PSLLDI, - IX86_BUILTIN_PSLLQI, - IX86_BUILTIN_PSRAWI, - IX86_BUILTIN_PSRADI, - IX86_BUILTIN_PSRLWI, - IX86_BUILTIN_PSRLDI, - IX86_BUILTIN_PSRLQI, - - IX86_BUILTIN_PUNPCKHBW, - IX86_BUILTIN_PUNPCKHWD, - IX86_BUILTIN_PUNPCKHDQ, - IX86_BUILTIN_PUNPCKLBW, - IX86_BUILTIN_PUNPCKLWD, - IX86_BUILTIN_PUNPCKLDQ, - - IX86_BUILTIN_SHUFPS, - - IX86_BUILTIN_RCPPS, - IX86_BUILTIN_RCPSS, - IX86_BUILTIN_RSQRTPS, - IX86_BUILTIN_RSQRTSS, - IX86_BUILTIN_SQRTPS, - IX86_BUILTIN_SQRTSS, - - IX86_BUILTIN_UNPCKHPS, - IX86_BUILTIN_UNPCKLPS, - - IX86_BUILTIN_ANDPS, - IX86_BUILTIN_ANDNPS, - IX86_BUILTIN_ORPS, - IX86_BUILTIN_XORPS, - - IX86_BUILTIN_EMMS, - IX86_BUILTIN_LDMXCSR, - IX86_BUILTIN_STMXCSR, - IX86_BUILTIN_SFENCE, - - /* 3DNow! Original */ - IX86_BUILTIN_FEMMS, - IX86_BUILTIN_PAVGUSB, - IX86_BUILTIN_PF2ID, - IX86_BUILTIN_PFACC, - IX86_BUILTIN_PFADD, - IX86_BUILTIN_PFCMPEQ, - IX86_BUILTIN_PFCMPGE, - IX86_BUILTIN_PFCMPGT, - IX86_BUILTIN_PFMAX, - IX86_BUILTIN_PFMIN, - IX86_BUILTIN_PFMUL, - IX86_BUILTIN_PFRCP, - IX86_BUILTIN_PFRCPIT1, - IX86_BUILTIN_PFRCPIT2, - IX86_BUILTIN_PFRSQIT1, - IX86_BUILTIN_PFRSQRT, - IX86_BUILTIN_PFSUB, - IX86_BUILTIN_PFSUBR, - IX86_BUILTIN_PI2FD, - IX86_BUILTIN_PMULHRW, - - /* 3DNow! Athlon Extensions */ - IX86_BUILTIN_PF2IW, - IX86_BUILTIN_PFNACC, - IX86_BUILTIN_PFPNACC, - IX86_BUILTIN_PI2FW, - IX86_BUILTIN_PSWAPDSI, - IX86_BUILTIN_PSWAPDSF, - - IX86_BUILTIN_SSE_ZERO, - IX86_BUILTIN_MMX_ZERO, - - /* SSE2 */ - IX86_BUILTIN_ADDPD, - IX86_BUILTIN_ADDSD, - IX86_BUILTIN_DIVPD, - IX86_BUILTIN_DIVSD, - IX86_BUILTIN_MULPD, - IX86_BUILTIN_MULSD, - IX86_BUILTIN_SUBPD, - IX86_BUILTIN_SUBSD, - - IX86_BUILTIN_CMPEQPD, - IX86_BUILTIN_CMPLTPD, - IX86_BUILTIN_CMPLEPD, - IX86_BUILTIN_CMPGTPD, - IX86_BUILTIN_CMPGEPD, - IX86_BUILTIN_CMPNEQPD, - IX86_BUILTIN_CMPNLTPD, - IX86_BUILTIN_CMPNLEPD, - IX86_BUILTIN_CMPNGTPD, - IX86_BUILTIN_CMPNGEPD, - IX86_BUILTIN_CMPORDPD, - IX86_BUILTIN_CMPUNORDPD, - IX86_BUILTIN_CMPNEPD, - IX86_BUILTIN_CMPEQSD, - IX86_BUILTIN_CMPLTSD, - IX86_BUILTIN_CMPLESD, - IX86_BUILTIN_CMPNEQSD, - IX86_BUILTIN_CMPNLTSD, - IX86_BUILTIN_CMPNLESD, - IX86_BUILTIN_CMPORDSD, - IX86_BUILTIN_CMPUNORDSD, - IX86_BUILTIN_CMPNESD, - - IX86_BUILTIN_COMIEQSD, - IX86_BUILTIN_COMILTSD, - IX86_BUILTIN_COMILESD, - IX86_BUILTIN_COMIGTSD, - IX86_BUILTIN_COMIGESD, - IX86_BUILTIN_COMINEQSD, - IX86_BUILTIN_UCOMIEQSD, - IX86_BUILTIN_UCOMILTSD, - IX86_BUILTIN_UCOMILESD, - IX86_BUILTIN_UCOMIGTSD, - IX86_BUILTIN_UCOMIGESD, - IX86_BUILTIN_UCOMINEQSD, - - IX86_BUILTIN_MAXPD, - IX86_BUILTIN_MAXSD, - IX86_BUILTIN_MINPD, - IX86_BUILTIN_MINSD, - - IX86_BUILTIN_ANDPD, - IX86_BUILTIN_ANDNPD, - IX86_BUILTIN_ORPD, - IX86_BUILTIN_XORPD, - - IX86_BUILTIN_SQRTPD, - IX86_BUILTIN_SQRTSD, - - IX86_BUILTIN_UNPCKHPD, - IX86_BUILTIN_UNPCKLPD, - - IX86_BUILTIN_SHUFPD, - - IX86_BUILTIN_LOADAPD, - IX86_BUILTIN_LOADUPD, - IX86_BUILTIN_STOREAPD, - IX86_BUILTIN_STOREUPD, - IX86_BUILTIN_LOADSD, - IX86_BUILTIN_STORESD, - IX86_BUILTIN_MOVSD, - - IX86_BUILTIN_LOADHPD, - IX86_BUILTIN_LOADLPD, - IX86_BUILTIN_STOREHPD, - IX86_BUILTIN_STORELPD, - - IX86_BUILTIN_CVTDQ2PD, - IX86_BUILTIN_CVTDQ2PS, - - IX86_BUILTIN_CVTPD2DQ, - IX86_BUILTIN_CVTPD2PI, - IX86_BUILTIN_CVTPD2PS, - IX86_BUILTIN_CVTTPD2DQ, - IX86_BUILTIN_CVTTPD2PI, - - IX86_BUILTIN_CVTPI2PD, - IX86_BUILTIN_CVTSI2SD, - IX86_BUILTIN_CVTSI642SD, - - IX86_BUILTIN_CVTSD2SI, - IX86_BUILTIN_CVTSD2SI64, - IX86_BUILTIN_CVTSD2SS, - IX86_BUILTIN_CVTSS2SD, - IX86_BUILTIN_CVTTSD2SI, - IX86_BUILTIN_CVTTSD2SI64, - - IX86_BUILTIN_CVTPS2DQ, - IX86_BUILTIN_CVTPS2PD, - IX86_BUILTIN_CVTTPS2DQ, - - IX86_BUILTIN_MOVNTI, - IX86_BUILTIN_MOVNTPD, - IX86_BUILTIN_MOVNTDQ, - - IX86_BUILTIN_SETPD1, - IX86_BUILTIN_SETPD, - IX86_BUILTIN_CLRPD, - IX86_BUILTIN_SETRPD, - IX86_BUILTIN_LOADPD1, - IX86_BUILTIN_LOADRPD, - IX86_BUILTIN_STOREPD1, - IX86_BUILTIN_STORERPD, - - /* SSE2 MMX */ - IX86_BUILTIN_MASKMOVDQU, - IX86_BUILTIN_MOVMSKPD, - IX86_BUILTIN_PMOVMSKB128, - IX86_BUILTIN_MOVQ2DQ, - IX86_BUILTIN_MOVDQ2Q, - - IX86_BUILTIN_PACKSSWB128, - IX86_BUILTIN_PACKSSDW128, - IX86_BUILTIN_PACKUSWB128, - - IX86_BUILTIN_PADDB128, - IX86_BUILTIN_PADDW128, - IX86_BUILTIN_PADDD128, - IX86_BUILTIN_PADDQ128, - IX86_BUILTIN_PADDSB128, - IX86_BUILTIN_PADDSW128, - IX86_BUILTIN_PADDUSB128, - IX86_BUILTIN_PADDUSW128, - IX86_BUILTIN_PSUBB128, - IX86_BUILTIN_PSUBW128, - IX86_BUILTIN_PSUBD128, - IX86_BUILTIN_PSUBQ128, - IX86_BUILTIN_PSUBSB128, - IX86_BUILTIN_PSUBSW128, - IX86_BUILTIN_PSUBUSB128, - IX86_BUILTIN_PSUBUSW128, - - IX86_BUILTIN_PAND128, - IX86_BUILTIN_PANDN128, - IX86_BUILTIN_POR128, - IX86_BUILTIN_PXOR128, - - IX86_BUILTIN_PAVGB128, - IX86_BUILTIN_PAVGW128, - - IX86_BUILTIN_PCMPEQB128, - IX86_BUILTIN_PCMPEQW128, - IX86_BUILTIN_PCMPEQD128, - IX86_BUILTIN_PCMPGTB128, - IX86_BUILTIN_PCMPGTW128, - IX86_BUILTIN_PCMPGTD128, - - IX86_BUILTIN_PEXTRW128, - IX86_BUILTIN_PINSRW128, - - IX86_BUILTIN_PMADDWD128, - - IX86_BUILTIN_PMAXSW128, - IX86_BUILTIN_PMAXUB128, - IX86_BUILTIN_PMINSW128, - IX86_BUILTIN_PMINUB128, - - IX86_BUILTIN_PMULUDQ, - IX86_BUILTIN_PMULUDQ128, - IX86_BUILTIN_PMULHUW128, - IX86_BUILTIN_PMULHW128, - IX86_BUILTIN_PMULLW128, - - IX86_BUILTIN_PSADBW128, - IX86_BUILTIN_PSHUFHW, - IX86_BUILTIN_PSHUFLW, - IX86_BUILTIN_PSHUFD, - - IX86_BUILTIN_PSLLW128, - IX86_BUILTIN_PSLLD128, - IX86_BUILTIN_PSLLQ128, - IX86_BUILTIN_PSRAW128, - IX86_BUILTIN_PSRAD128, - IX86_BUILTIN_PSRLW128, - IX86_BUILTIN_PSRLD128, - IX86_BUILTIN_PSRLQ128, - IX86_BUILTIN_PSLLDQI128, - IX86_BUILTIN_PSLLWI128, - IX86_BUILTIN_PSLLDI128, - IX86_BUILTIN_PSLLQI128, - IX86_BUILTIN_PSRAWI128, - IX86_BUILTIN_PSRADI128, - IX86_BUILTIN_PSRLDQI128, - IX86_BUILTIN_PSRLWI128, - IX86_BUILTIN_PSRLDI128, - IX86_BUILTIN_PSRLQI128, - - IX86_BUILTIN_PUNPCKHBW128, - IX86_BUILTIN_PUNPCKHWD128, - IX86_BUILTIN_PUNPCKHDQ128, - IX86_BUILTIN_PUNPCKHQDQ128, - IX86_BUILTIN_PUNPCKLBW128, - IX86_BUILTIN_PUNPCKLWD128, - IX86_BUILTIN_PUNPCKLDQ128, - IX86_BUILTIN_PUNPCKLQDQ128, - - IX86_BUILTIN_CLFLUSH, - IX86_BUILTIN_MFENCE, - IX86_BUILTIN_LFENCE, - - /* Prescott New Instructions. */ - IX86_BUILTIN_ADDSUBPS, - IX86_BUILTIN_HADDPS, - IX86_BUILTIN_HSUBPS, - IX86_BUILTIN_MOVSHDUP, - IX86_BUILTIN_MOVSLDUP, - IX86_BUILTIN_ADDSUBPD, - IX86_BUILTIN_HADDPD, - IX86_BUILTIN_HSUBPD, - IX86_BUILTIN_LOADDDUP, - IX86_BUILTIN_MOVDDUP, - IX86_BUILTIN_LDDQU, - - IX86_BUILTIN_MONITOR, - IX86_BUILTIN_MWAIT, - - IX86_BUILTIN_MAX -}; - /* Max number of args passed in registers. If this is more than 3, we will have problems with ebx (register #4), since it is a caller save register and is also used as the pic register in ELF. So for now, don't allow more than @@ -2559,12 +1742,6 @@ enum ix86_builtins for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE (!TARGET_64BIT || flag_pic ? SImode : DImode) -/* Define as C expression which evaluates to nonzero if the tablejump - instruction expects the table to contain offsets from the address of the - table. - Do not define this if the table should contain absolute addresses. */ -/* #define CASE_VECTOR_PC_RELATIVE 1 */ - /* Define this as 1 if `char' should by default be signed; else as 0. */ #define DEFAULT_SIGNED_CHAR 1 @@ -2584,7 +1761,7 @@ enum ix86_builtins #define MOVE_MAX_PIECES (TARGET_64BIT ? 8 : 4) /* If a memory-to-memory move would take MOVE_RATIO or more simple - move-instruction pairs, we will do a movstr or libcall instead. + move-instruction pairs, we will do a movmem or libcall instead. Increasing the value will always make code faster, but eventually incurs high cost in increased code size. @@ -2592,6 +1769,12 @@ enum ix86_builtins #define MOVE_RATIO (optimize_size ? 3 : ix86_cost->move_ratio) +/* If a clear memory operation would take CLEAR_RATIO or more simple + move-instruction sequences, we will do a clrmem or libcall instead. */ + +#define CLEAR_RATIO (optimize_size ? 2 \ + : ix86_cost->move_ratio > 6 ? 6 : ix86_cost->move_ratio) + /* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension of a shift count. */ @@ -2603,11 +1786,6 @@ enum ix86_builtins is done just by pretending it is already truncated. */ #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 -/* When a prototype says `char' or `short', really pass an `int'. - (The 386 can't easily push less than an int.) */ - -#define PROMOTE_PROTOTYPES 1 - /* A macro to update M and UNSIGNEDP when an object whose type is TYPE and which has the specified mode and signedness is to be stored in a register. This macro is only called when TYPE is a @@ -2701,12 +1879,6 @@ do { \ faster than one with a register address. */ #define NO_FUNCTION_CSE - -/* Define this macro if it is as good or better for a function to call - itself with an explicit address than to call an address kept in a - register. */ - -#define NO_RECURSIVE_FUNCTION_CSE /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. @@ -2726,9 +1898,7 @@ do { \ /* A C expression whose value is reversed condition code of the CODE for comparison done in CC_MODE mode. */ -#define REVERSE_CONDITION(CODE, MODE) \ - ((MODE) != CCFPmode && (MODE) != CCFPUmode ? reverse_condition (CODE) \ - : reverse_condition_maybe_unordered (CODE)) +#define REVERSE_CONDITION(CODE, MODE) ix86_reverse_condition ((CODE), (MODE)) /* Control the assembler format that we output, to the extent @@ -2737,7 +1907,7 @@ do { \ /* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */ -/* In order to refer to the first 8 regs as 32 bit regs prefix an "e" +/* In order to refer to the first 8 regs as 32 bit regs, prefix an "e". For non floating point regs, the following are the HImode names. For float regs, the stack top is sometimes referred to as "%st(0)" @@ -2762,9 +1932,7 @@ do { \ { "rax", 0 }, { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, \ { "rsi", 4 }, { "rdi", 5 }, { "rbp", 6 }, { "rsp", 7 }, \ { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, \ - { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 }, \ - { "mm0", 8}, { "mm1", 9}, { "mm2", 10}, { "mm3", 11}, \ - { "mm4", 12}, { "mm5", 13}, { "mm6", 14}, { "mm7", 15} } + { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 } } /* Note we are omitting these since currently I don't know how to get gcc to use these, since they want the same but different @@ -2819,9 +1987,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; Whether or not a particular assembler allows us to enter such, I guess we'll have to see. */ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ - (flag_pic \ - ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\ - : DW_EH_PE_absptr) + asm_preferred_eh_data_format ((CODE), (GLOBAL)) /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ @@ -2857,24 +2023,13 @@ do { \ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ ix86_output_addr_diff_elt ((FILE), (VALUE), (REL)) -/* Under some conditions we need jump tables in the text section, because - the assembler cannot handle label differences between sections. */ +/* Under some conditions we need jump tables in the text section, + because the assembler cannot handle label differences between + sections. This is the case for x86_64 on Mach-O for example. */ #define JUMP_TABLES_IN_TEXT_SECTION \ - (!TARGET_64BIT && flag_pic && !HAVE_AS_GOTOFF_IN_DATA) - -/* A C statement that outputs an address constant appropriate to - for DWARF debugging. */ - -#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE, X) \ - i386_dwarf_output_addr_const ((FILE), (X)) - -/* Emit a dtp-relative reference to a TLS variable. */ - -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - i386_output_dwarf_dtprel (FILE, SIZE, X) -#endif + (flag_pic && ((TARGET_MACHO && TARGET_64BIT) \ + || (!TARGET_64BIT && !HAVE_AS_GOTOFF_IN_DATA))) /* Switch to init or fini section via SECTION_OP, emit a call to FUNC, and switch back. For x86 we do this only to save a few bytes that @@ -2911,95 +2066,6 @@ do { \ #define RET return "" #define AT_SP(MODE) (gen_rtx_MEM ((MODE), stack_pointer_rtx)) -/* Define the codes that are matched by predicates in i386.c. */ - -#define PREDICATE_CODES \ - {"x86_64_immediate_operand", {CONST_INT, SUBREG, REG, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_nonmemory_operand", {CONST_INT, SUBREG, REG, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_movabs_operand", {CONST_INT, SUBREG, REG, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_szext_nonmemory_operand", {CONST_INT, SUBREG, REG, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_general_operand", {CONST_INT, SUBREG, REG, MEM, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_szext_general_operand", {CONST_INT, SUBREG, REG, MEM, \ - SYMBOL_REF, LABEL_REF, CONST}}, \ - {"x86_64_zext_immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, \ - SYMBOL_REF, LABEL_REF}}, \ - {"shiftdi_operand", {SUBREG, REG, MEM}}, \ - {"const_int_1_31_operand", {CONST_INT}}, \ - {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ - {"aligned_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"pic_symbolic_operand", {CONST}}, \ - {"call_insn_operand", {REG, SUBREG, MEM, SYMBOL_REF}}, \ - {"sibcall_insn_operand", {REG, SUBREG, SYMBOL_REF}}, \ - {"constant_call_address_operand", {SYMBOL_REF, CONST}}, \ - {"const0_operand", {CONST_INT, CONST_DOUBLE}}, \ - {"const1_operand", {CONST_INT}}, \ - {"const248_operand", {CONST_INT}}, \ - {"const_0_to_3_operand", {CONST_INT}}, \ - {"const_0_to_7_operand", {CONST_INT}}, \ - {"const_0_to_15_operand", {CONST_INT}}, \ - {"const_0_to_255_operand", {CONST_INT}}, \ - {"incdec_operand", {CONST_INT}}, \ - {"mmx_reg_operand", {REG}}, \ - {"reg_no_sp_operand", {SUBREG, REG}}, \ - {"general_no_elim_operand", {CONST_INT, CONST_DOUBLE, CONST, \ - SYMBOL_REF, LABEL_REF, SUBREG, REG, MEM}}, \ - {"nonmemory_no_elim_operand", {CONST_INT, REG, SUBREG}}, \ - {"index_register_operand", {SUBREG, REG}}, \ - {"flags_reg_operand", {REG}}, \ - {"q_regs_operand", {SUBREG, REG}}, \ - {"non_q_regs_operand", {SUBREG, REG}}, \ - {"fcmov_comparison_operator", {EQ, NE, LTU, GTU, LEU, GEU, UNORDERED, \ - ORDERED, LT, UNLT, GT, UNGT, LE, UNLE, \ - GE, UNGE, LTGT, UNEQ}}, \ - {"sse_comparison_operator", {EQ, LT, LE, UNORDERED, NE, UNGE, UNGT, \ - ORDERED, UNEQ, UNLT, UNLE, LTGT, GE, GT \ - }}, \ - {"ix86_comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU, \ - GTU, UNORDERED, ORDERED, UNLE, UNLT, \ - UNGE, UNGT, LTGT, UNEQ }}, \ - {"ix86_carry_flag_operator", {LTU, LT, UNLT, GT, UNGT, LE, UNLE, \ - GE, UNGE, LTGT, UNEQ}}, \ - {"cmp_fp_expander_operand", {CONST_DOUBLE, SUBREG, REG, MEM}}, \ - {"ext_register_operand", {SUBREG, REG}}, \ - {"binary_fp_operator", {PLUS, MINUS, MULT, DIV}}, \ - {"mult_operator", {MULT}}, \ - {"div_operator", {DIV}}, \ - {"arith_or_logical_operator", {PLUS, MULT, AND, IOR, XOR, SMIN, SMAX, \ - UMIN, UMAX, COMPARE, MINUS, DIV, MOD, \ - UDIV, UMOD, ASHIFT, ROTATE, ASHIFTRT, \ - LSHIFTRT, ROTATERT}}, \ - {"promotable_binary_operator", {PLUS, MULT, AND, IOR, XOR, ASHIFT}}, \ - {"memory_displacement_operand", {MEM}}, \ - {"cmpsi_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM, AND}}, \ - {"long_memory_operand", {MEM}}, \ - {"tls_symbolic_operand", {SYMBOL_REF}}, \ - {"global_dynamic_symbolic_operand", {SYMBOL_REF}}, \ - {"local_dynamic_symbolic_operand", {SYMBOL_REF}}, \ - {"initial_exec_symbolic_operand", {SYMBOL_REF}}, \ - {"local_exec_symbolic_operand", {SYMBOL_REF}}, \ - {"any_fp_register_operand", {REG}}, \ - {"register_and_not_any_fp_reg_operand", {REG}}, \ - {"fp_register_operand", {REG}}, \ - {"register_and_not_fp_reg_operand", {REG}}, \ - {"zero_extended_scalar_load_operand", {MEM}}, \ - {"vector_move_operand", {CONST_VECTOR, SUBREG, REG, MEM}}, \ - {"no_seg_address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM, PLUS, MULT}}, \ - {"compare_operator", {COMPARE}}, - -/* A list of predicates that do special things with modes, and so - should not elicit warnings for VOIDmode match_operand. */ - -#define SPECIAL_MODE_PREDICATES \ - "ext_register_operand", - /* Which processor to schedule for. The cpu attribute defines a list that mirrors this list, so changes to i386.md must be made at the same time. */ @@ -3013,14 +2079,14 @@ enum processor_type PROCESSOR_ATHLON, PROCESSOR_PENTIUM4, PROCESSOR_K8, + PROCESSOR_NOCONA, + PROCESSOR_GENERIC32, + PROCESSOR_GENERIC64, PROCESSOR_max }; extern enum processor_type ix86_tune; -extern const char *ix86_tune_string; - extern enum processor_type ix86_arch; -extern const char *ix86_arch_string; enum fpmath_unit { @@ -3029,16 +2095,15 @@ enum fpmath_unit }; extern enum fpmath_unit ix86_fpmath; -extern const char *ix86_fpmath_string; enum tls_dialect { TLS_DIALECT_GNU, + TLS_DIALECT_GNU2, TLS_DIALECT_SUN }; extern enum tls_dialect ix86_tls_dialect; -extern const char *ix86_tls_dialect_string; enum cmodel { CM_32, /* The traditional 32-bit ABI. */ @@ -3046,11 +2111,11 @@ enum cmodel { CM_KERNEL, /* Assumes all code and data fits in the high 31 bits. */ CM_MEDIUM, /* Assumes code fits in the low 31 bits; data unlimited. */ CM_LARGE, /* No assumptions. */ - CM_SMALL_PIC /* Assumes code+data+got/plt fits in a 31 bit region. */ + CM_SMALL_PIC, /* Assumes code+data+got/plt fits in a 31 bit region. */ + CM_MEDIUM_PIC /* Assumes code+got/plt fits in a 31 bit region. */ }; extern enum cmodel ix86_cmodel; -extern const char *ix86_cmodel_string; /* Size of the RED_ZONE area. */ #define RED_ZONE_SIZE 128 @@ -3062,31 +2127,16 @@ enum asm_dialect { ASM_INTEL }; -extern const char *ix86_asm_string; extern enum asm_dialect ix86_asm_dialect; - -extern int ix86_regparm; -extern const char *ix86_regparm_string; - -extern int ix86_preferred_stack_boundary; -extern const char *ix86_preferred_stack_boundary_string; - -extern int ix86_branch_cost; -extern const char *ix86_branch_cost_string; - -extern const char *ix86_debug_arg_string; -extern const char *ix86_debug_addr_string; - -/* Obsoleted by -f options. Remove before 3.2 ships. */ -extern const char *ix86_align_loops_string; -extern const char *ix86_align_jumps_string; -extern const char *ix86_align_funcs_string; +extern unsigned int ix86_preferred_stack_boundary; +extern int ix86_branch_cost, ix86_section_threshold; /* Smallest class containing REGNO. */ extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; extern rtx ix86_compare_op0; /* operand 0 for comparisons */ extern rtx ix86_compare_op1; /* operand 1 for comparisons */ +extern rtx ix86_compare_emitted; /* To properly truncate FP values into integers, we need to set i387 control word. We can't emit proper mode switching code before reload, as spills @@ -3103,12 +2153,31 @@ extern rtx ix86_compare_op1; /* operand 1 for comparisons */ Post-reload pass may be later used to eliminate the redundant fildcw if needed. */ -enum fp_cw_mode {FP_CW_STORED, FP_CW_UNINITIALIZED, FP_CW_ANY}; +enum ix86_entity +{ + I387_TRUNC = 0, + I387_FLOOR, + I387_CEIL, + I387_MASK_PM, + MAX_386_ENTITIES +}; + +enum ix86_stack_slot +{ + SLOT_TEMP = 0, + SLOT_CW_STORED, + SLOT_CW_TRUNC, + SLOT_CW_FLOOR, + SLOT_CW_CEIL, + SLOT_CW_MASK_PM, + MAX_386_STACK_LOCALS +}; /* Define this macro if the port needs extra instructions inserted for mode switching in an optimizing compilation. */ -#define OPTIMIZE_MODE_SWITCHING(ENTITY) ix86_optimize_mode_switching +#define OPTIMIZE_MODE_SWITCHING(ENTITY) \ + ix86_optimize_mode_switching[(ENTITY)] /* If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as initializer for an array of integers. Each initializer element N @@ -3118,22 +2187,16 @@ enum fp_cw_mode {FP_CW_STORED, FP_CW_UNINITIALIZED, FP_CW_ANY}; starting counting at zero - determines the integer that is used to refer to the mode-switched entity in question. */ -#define NUM_MODES_FOR_MODE_SWITCHING { FP_CW_ANY } +#define NUM_MODES_FOR_MODE_SWITCHING \ + { I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY } /* ENTITY is an integer specifying a mode-switched entity. If `OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to return an integer value not larger than the corresponding element in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY - must be switched into prior to the execution of INSN. */ + must be switched into prior to the execution of INSN. */ -#define MODE_NEEDED(ENTITY, I) \ - (GET_CODE (I) == CALL_INSN \ - || (GET_CODE (I) == INSN && (asm_noperands (PATTERN (I)) >= 0 \ - || GET_CODE (PATTERN (I)) == ASM_INPUT))\ - ? FP_CW_UNINITIALIZED \ - : recog_memoized (I) < 0 || get_attr_type (I) != TYPE_FISTP \ - ? FP_CW_ANY \ - : FP_CW_STORED) +#define MODE_NEEDED(ENTITY, I) ix86_mode_needed ((ENTITY), (I)) /* This macro specifies the order in which modes for ENTITY are processed. 0 is the highest priority. */ @@ -3145,10 +2208,10 @@ enum fp_cw_mode {FP_CW_STORED, FP_CW_UNINITIALIZED, FP_CW_ANY}; are to be inserted. */ #define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \ - ((MODE) == FP_CW_STORED \ - ? emit_i387_cw_initialization (assign_386_stack_local (HImode, 1), \ - assign_386_stack_local (HImode, 2)), 0\ + ((MODE) != I387_CW_ANY && (MODE) != I387_CW_UNINITIALIZED \ + ? emit_i387_cw_initialization (MODE), 0 \ : 0) + /* Avoid renaming of stack registers, as doing so in combination with scheduling just increases amount of live registers at time and in @@ -3168,25 +2231,49 @@ struct machine_function GTY(()) { struct stack_local_entry *stack_locals; const char *some_ld_name; + rtx force_align_arg_pointer; int save_varrargs_registers; int accesses_prev_frame; - int optimize_mode_switching; + int optimize_mode_switching[MAX_386_ENTITIES]; /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to determine the style used. */ int use_fast_prologue_epilogue; /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed for. */ int use_fast_prologue_epilogue_nregs; + /* If true, the current function needs the default PIC register, not + an alternate register (on x86) and must not use the red zone (on + x86_64), even if it's a leaf function. We don't want the + function to be regarded as non-leaf because TLS calls need not + affect register allocation. This flag is set when a TLS call + instruction is expanded within a function, and never reset, even + if all such instructions are optimized away. Use the + ix86_current_function_calls_tls_descriptor macro for a better + approximation. */ + int tls_descriptor_call_expanded_p; }; #define ix86_stack_locals (cfun->machine->stack_locals) #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers) #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching) +#define ix86_tls_descriptor_calls_expanded_in_cfun \ + (cfun->machine->tls_descriptor_call_expanded_p) +/* Since tls_descriptor_call_expanded is not cleared, even if all TLS + calls are optimized away, we try to detect cases in which it was + optimized away. Since such instructions (use (reg REG_SP)), we can + verify whether there's any such instruction live by testing that + REG_SP is live. */ +#define ix86_current_function_calls_tls_descriptor \ + (ix86_tls_descriptor_calls_expanded_in_cfun && regs_ever_live[SP_REG]) /* Control behavior of x86_file_start. */ #define X86_FILE_START_VERSION_DIRECTIVE false #define X86_FILE_START_FLTUSED false +/* Flag to mark data that is in the large address area. */ +#define SYMBOL_FLAG_FAR_ADDR (SYMBOL_FLAG_MACH_DEP << 0) +#define SYMBOL_REF_FAR_ADDR_P(X) \ + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_FAR_ADDR) != 0) /* Local variables: version-control: t diff --git a/contrib/gcc/config/i386/i386.md b/contrib/gcc/config/i386/i386.md index 0fbe00b66e3..d24b32af42e 100644 --- a/contrib/gcc/config/i386/i386.md +++ b/contrib/gcc/config/i386/i386.md @@ -1,6 +1,6 @@ ;; GCC machine description for IA-32 and x86-64. ;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003, 2004 +;; 2001, 2002, 2003, 2004, 2005, 2006 ;; Free Software Foundation, Inc. ;; Mostly by William Schelter. ;; x86_64 support added by Jan Hubicka @@ -19,8 +19,8 @@ ;; ;; 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. */ +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. */ ;; ;; The original PO technology requires these to be ordered by speed, ;; so that assigner will pick the fastest. @@ -66,76 +66,114 @@ (UNSPEC_STACK_ALLOC 11) (UNSPEC_SET_GOT 12) (UNSPEC_SSE_PROLOGUE_SAVE 13) + (UNSPEC_REG_SAVE 14) + (UNSPEC_DEF_CFA 15) ; TLS support - (UNSPEC_TP 15) - (UNSPEC_TLS_GD 16) - (UNSPEC_TLS_LD_BASE 17) + (UNSPEC_TP 16) + (UNSPEC_TLS_GD 17) + (UNSPEC_TLS_LD_BASE 18) + (UNSPEC_TLSDESC 19) ; Other random patterns (UNSPEC_SCAS 20) - (UNSPEC_SIN 21) - (UNSPEC_COS 22) - (UNSPEC_FNSTSW 24) - (UNSPEC_SAHF 25) - (UNSPEC_FSTCW 26) - (UNSPEC_ADD_CARRY 27) - (UNSPEC_FLDCW 28) + (UNSPEC_FNSTSW 21) + (UNSPEC_SAHF 22) + (UNSPEC_FSTCW 23) + (UNSPEC_ADD_CARRY 24) + (UNSPEC_FLDCW 25) + (UNSPEC_REP 26) + (UNSPEC_EH_RETURN 27) + (UNSPEC_LD_MPIC 28) ; load_macho_picbase ; For SSE/MMX support: - (UNSPEC_FIX 30) - (UNSPEC_MASKMOV 32) - (UNSPEC_MOVMSK 33) - (UNSPEC_MOVNT 34) - (UNSPEC_MOVA 38) - (UNSPEC_MOVU 39) - (UNSPEC_SHUFFLE 41) - (UNSPEC_RCP 42) - (UNSPEC_RSQRT 43) - (UNSPEC_SFENCE 44) - (UNSPEC_NOP 45) ; prevents combiner cleverness - (UNSPEC_PAVGUSB 49) - (UNSPEC_PFRCP 50) - (UNSPEC_PFRCPIT1 51) - (UNSPEC_PFRCPIT2 52) - (UNSPEC_PFRSQRT 53) - (UNSPEC_PFRSQIT1 54) - (UNSPEC_PSHUFLW 55) - (UNSPEC_PSHUFHW 56) - (UNSPEC_MFENCE 59) - (UNSPEC_LFENCE 60) - (UNSPEC_PSADBW 61) - (UNSPEC_ADDSUB 71) - (UNSPEC_HADD 72) - (UNSPEC_HSUB 73) - (UNSPEC_MOVSHDUP 74) - (UNSPEC_MOVSLDUP 75) - (UNSPEC_LDQQU 76) - (UNSPEC_MOVDDUP 77) + (UNSPEC_FIX_NOTRUNC 30) + (UNSPEC_MASKMOV 31) + (UNSPEC_MOVMSK 32) + (UNSPEC_MOVNT 33) + (UNSPEC_MOVU 34) + (UNSPEC_RCP 35) + (UNSPEC_RSQRT 36) + (UNSPEC_SFENCE 37) + (UNSPEC_NOP 38) ; prevents combiner cleverness + (UNSPEC_PFRCP 39) + (UNSPEC_PFRCPIT1 40) + (UNSPEC_PFRCPIT2 41) + (UNSPEC_PFRSQRT 42) + (UNSPEC_PFRSQIT1 43) + (UNSPEC_MFENCE 44) + (UNSPEC_LFENCE 45) + (UNSPEC_PSADBW 46) + (UNSPEC_LDQQU 47) + + ; Generic math support + (UNSPEC_COPYSIGN 50) + (UNSPEC_IEEE_MIN 51) ; not commutative + (UNSPEC_IEEE_MAX 52) ; not commutative ; x87 Floating point - (UNSPEC_FPATAN 65) - (UNSPEC_FYL2X 66) - (UNSPEC_FSCALE 67) - (UNSPEC_FRNDINT 68) - (UNSPEC_F2XM1 69) + (UNSPEC_SIN 60) + (UNSPEC_COS 61) + (UNSPEC_FPATAN 62) + (UNSPEC_FYL2X 63) + (UNSPEC_FYL2XP1 64) + (UNSPEC_FRNDINT 65) + (UNSPEC_FIST 66) + (UNSPEC_F2XM1 67) - ; REP instruction - (UNSPEC_REP 75) + ; x87 Rounding + (UNSPEC_FRNDINT_FLOOR 70) + (UNSPEC_FRNDINT_CEIL 71) + (UNSPEC_FRNDINT_TRUNC 72) + (UNSPEC_FRNDINT_MASK_PM 73) + (UNSPEC_FIST_FLOOR 74) + (UNSPEC_FIST_CEIL 75) + + ; x87 Double output FP + (UNSPEC_SINCOS_COS 80) + (UNSPEC_SINCOS_SIN 81) + (UNSPEC_TAN_ONE 82) + (UNSPEC_TAN_TAN 83) + (UNSPEC_XTRACT_FRACT 84) + (UNSPEC_XTRACT_EXP 85) + (UNSPEC_FSCALE_FRACT 86) + (UNSPEC_FSCALE_EXP 87) + (UNSPEC_FPREM_F 88) + (UNSPEC_FPREM_U 89) + (UNSPEC_FPREM1_F 90) + (UNSPEC_FPREM1_U 91) + + ; SSP patterns + (UNSPEC_SP_SET 100) + (UNSPEC_SP_TEST 101) + (UNSPEC_SP_TLS_SET 102) + (UNSPEC_SP_TLS_TEST 103) ]) (define_constants [(UNSPECV_BLOCKAGE 0) - (UNSPECV_STACK_PROBE 10) - (UNSPECV_EH_RETURN 13) - (UNSPECV_EMMS 31) - (UNSPECV_LDMXCSR 37) - (UNSPECV_STMXCSR 40) - (UNSPECV_FEMMS 46) - (UNSPECV_CLFLUSH 57) - (UNSPECV_ALIGN 68) - (UNSPECV_MONITOR 69) - (UNSPECV_MWAIT 70) + (UNSPECV_STACK_PROBE 1) + (UNSPECV_EMMS 2) + (UNSPECV_LDMXCSR 3) + (UNSPECV_STMXCSR 4) + (UNSPECV_FEMMS 5) + (UNSPECV_CLFLUSH 6) + (UNSPECV_ALIGN 7) + (UNSPECV_MONITOR 8) + (UNSPECV_MWAIT 9) + (UNSPECV_CMPXCHG_1 10) + (UNSPECV_CMPXCHG_2 11) + (UNSPECV_XCHG 12) + (UNSPECV_LOCK 13) + ]) + +;; Registers by name. +(define_constants + [(BP_REG 6) + (SP_REG 7) + (FLAGS_REG 17) + (FPSR_REG 18) + (DIRFLAG_REG 19) ]) ;; Insns whose names begin with "x86_" are emitted by gen_FOO calls @@ -149,7 +187,7 @@ ;; Processor type. This attribute must exactly match the processor_type ;; enumeration in i386.h. -(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6,athlon,pentium4,k8" +(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6,athlon,pentium4,k8,nocona,generic32,generic64" (const (symbol_ref "ix86_tune"))) ;; A basic instruction type. Refinements due to arguments to be @@ -161,22 +199,22 @@ icmp,test,ibr,setcc,icmov, push,pop,call,callv,leave, str,cld, - fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp, - sselog,sseiadd,sseishft,sseimul, + fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint, + sselog,sselog1,sseiadd,sseishft,sseimul, sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv, mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft" (const_string "other")) ;; Main data type used by the insn (define_attr "mode" - "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF" + "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF,V1DF" (const_string "unknown")) ;; The CPU unit operations uses. (define_attr "unit" "integer,i387,sse,mmx,unknown" - (cond [(eq_attr "type" "fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp") + (cond [(eq_attr "type" "fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint") (const_string "i387") - (eq_attr "type" "sselog,sseiadd,sseishft,sseimul, + (eq_attr "type" "sselog,sselog1,sseiadd,sseishft,sseimul, sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv") (const_string "sse") (eq_attr "type" "mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft") @@ -210,7 +248,7 @@ (const_int 1) ] (symbol_ref "/* Update immediate_length and other attributes! */ - abort(),1"))) + gcc_unreachable (),1"))) ;; The (bounding maximum) length of an instruction address. (define_attr "length_address" "" @@ -246,7 +284,7 @@ (const_int 1) (const_int 0))) -;; Set when 0f opcode prefix is used. +;; Set when REX opcode prefix is used. (define_attr "prefix_rex" "" (cond [(and (eq_attr "mode" "DI") (eq_attr "type" "!push,pop,call,callv,leave,ibr")) @@ -278,8 +316,12 @@ (not (match_operand 0 "memory_operand" ""))) (const_int 0) (and (eq_attr "type" "imov") - (and (match_operand 0 "register_operand" "") - (match_operand 1 "immediate_operand" ""))) + (ior (and (match_operand 0 "register_operand" "") + (match_operand 1 "immediate_operand" "")) + (ior (and (match_operand 0 "ax_reg_operand" "") + (match_operand 1 "memory_displacement_only_operand" "")) + (and (match_operand 0 "memory_displacement_only_operand" "") + (match_operand 1 "ax_reg_operand" ""))))) (const_int 0) (and (eq_attr "type" "call") (match_operand 0 "constant_call_address_operand" "")) @@ -291,10 +333,11 @@ (const_int 1))) ;; The (bounding maximum) length of an instruction in bytes. -;; ??? fistp is in fact fldcw/fistp/fldcw sequence. Later we may want -;; to split it and compute proper length as for other insns. +;; ??? fistp and frndint are in fact fldcw/{fistp,frndint}/fldcw sequences. +;; Later we may want to split them and compute proper length as for +;; other insns. (define_attr "length" "" - (cond [(eq_attr "type" "other,multi,fistp") + (cond [(eq_attr "type" "other,multi,fistp,frndint") (const_int 16) (eq_attr "type" "fcmp") (const_int 4) @@ -322,6 +365,8 @@ (const_string "none") (eq_attr "type" "fistp,leave") (const_string "both") + (eq_attr "type" "frndint") + (const_string "load") (eq_attr "type" "push") (if_then_else (match_operand 1 "memory_operand" "") (const_string "both") @@ -351,7 +396,7 @@ (if_then_else (match_operand 1 "constant_call_address_operand" "") (const_string "none") (const_string "load")) - (and (eq_attr "type" "alu1,negnot,ishift1") + (and (eq_attr "type" "alu1,negnot,ishift1,sselog1") (match_operand 1 "memory_operand" "")) (const_string "both") (and (match_operand 0 "memory_operand" "") @@ -365,7 +410,7 @@ "!alu1,negnot,ishift1, imov,imovx,icmp,test, fmov,fcmp,fsgn, - sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt, + sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,sselog1, mmx,mmxmov,mmxcmp,mmxcvt") (match_operand 2 "memory_operand" "")) (const_string "load") @@ -396,15 +441,45 @@ (define_attr "fp_int_src" "false,true" (const_string "false")) +;; Defines rounding mode of an FP operation. + +(define_attr "i387_cw" "trunc,floor,ceil,mask_pm,uninitialized,any" + (const_string "any")) + ;; Describe a user's asm statement. (define_asm_attributes [(set_attr "length" "128") (set_attr "type" "multi")]) + +;; All x87 floating point modes +(define_mode_macro X87MODEF [SF DF XF]) + +;; All integer modes handled by x87 fisttp operator. +(define_mode_macro X87MODEI [HI SI DI]) + +;; All integer modes handled by integer x87 operators. +(define_mode_macro X87MODEI12 [HI SI]) + +;; All SSE floating point modes +(define_mode_macro SSEMODEF [SF DF]) + +;; All integer modes handled by SSE cvtts?2si* operators. +(define_mode_macro SSEMODEI24 [SI DI]) + +;; Scheduling descriptions + (include "pentium.md") (include "ppro.md") (include "k6.md") (include "athlon.md") + + +;; Operand and operator predicates and constraints + +(include "predicates.md") +(include "constraints.md") + ;; Compare instructions. @@ -412,8 +487,21 @@ ;; actually generating RTL. The bCOND or sCOND (emitted immediately ;; after the cmp) will actually emit the cmpM. +(define_expand "cmpti" + [(set (reg:CC FLAGS_REG) + (compare:CC (match_operand:TI 0 "nonimmediate_operand" "") + (match_operand:TI 1 "x86_64_general_operand" "")))] + "TARGET_64BIT" +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + operands[0] = force_reg (TImode, operands[0]); + ix86_compare_op0 = operands[0]; + ix86_compare_op1 = operands[1]; + DONE; +}) + (define_expand "cmpdi" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "x86_64_general_operand" "")))] "" @@ -426,7 +514,7 @@ }) (define_expand "cmpsi" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:SI 0 "cmpsi_operand" "") (match_operand:SI 1 "general_operand" "")))] "" @@ -439,7 +527,7 @@ }) (define_expand "cmphi" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:HI 0 "nonimmediate_operand" "") (match_operand:HI 1 "general_operand" "")))] "" @@ -452,7 +540,7 @@ }) (define_expand "cmpqi" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "general_operand" "")))] "TARGET_QIMODE_MATH" @@ -465,7 +553,7 @@ }) (define_insn "cmpdi_ccno_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:DI 0 "nonimmediate_operand" "r,?mr") (match_operand:DI 1 "const0_operand" "n,n")))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -477,7 +565,7 @@ (set_attr "mode" "DI")]) (define_insn "*cmpdi_minus_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:DI (match_operand:DI 0 "nonimmediate_operand" "rm,r") (match_operand:DI 1 "x86_64_general_operand" "re,mr")) (const_int 0)))] @@ -487,14 +575,14 @@ (set_attr "mode" "DI")]) (define_expand "cmpdi_1_rex64" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" "")))] "TARGET_64BIT" "") (define_insn "cmpdi_1_insn_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:DI 0 "nonimmediate_operand" "mr,r") (match_operand:DI 1 "x86_64_general_operand" "re,mr")))] "TARGET_64BIT && ix86_match_ccmode (insn, CCmode)" @@ -504,7 +592,7 @@ (define_insn "*cmpsi_ccno_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:SI 0 "nonimmediate_operand" "r,?mr") (match_operand:SI 1 "const0_operand" "n,n")))] "ix86_match_ccmode (insn, CCNOmode)" @@ -516,7 +604,7 @@ (set_attr "mode" "SI")]) (define_insn "*cmpsi_minus_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:SI (match_operand:SI 0 "nonimmediate_operand" "rm,r") (match_operand:SI 1 "general_operand" "ri,mr")) (const_int 0)))] @@ -526,14 +614,14 @@ (set_attr "mode" "SI")]) (define_expand "cmpsi_1" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:SI 0 "nonimmediate_operand" "rm,r") (match_operand:SI 1 "general_operand" "ri,mr")))] "" "") (define_insn "*cmpsi_1_insn" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:SI 0 "nonimmediate_operand" "rm,r") (match_operand:SI 1 "general_operand" "ri,mr")))] "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) @@ -543,7 +631,7 @@ (set_attr "mode" "SI")]) (define_insn "*cmphi_ccno_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:HI 0 "nonimmediate_operand" "r,?mr") (match_operand:HI 1 "const0_operand" "n,n")))] "ix86_match_ccmode (insn, CCNOmode)" @@ -555,7 +643,7 @@ (set_attr "mode" "HI")]) (define_insn "*cmphi_minus_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:HI (match_operand:HI 0 "nonimmediate_operand" "rm,r") (match_operand:HI 1 "general_operand" "ri,mr")) (const_int 0)))] @@ -565,7 +653,7 @@ (set_attr "mode" "HI")]) (define_insn "*cmphi_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:HI 0 "nonimmediate_operand" "rm,r") (match_operand:HI 1 "general_operand" "ri,mr")))] "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) @@ -575,7 +663,7 @@ (set_attr "mode" "HI")]) (define_insn "*cmpqi_ccno_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 0 "nonimmediate_operand" "q,?mq") (match_operand:QI 1 "const0_operand" "n,n")))] "ix86_match_ccmode (insn, CCNOmode)" @@ -587,7 +675,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 0 "nonimmediate_operand" "qm,q") (match_operand:QI 1 "general_operand" "qi,mq")))] "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) @@ -597,7 +685,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_minus_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:QI (match_operand:QI 0 "nonimmediate_operand" "qm,q") (match_operand:QI 1 "general_operand" "qi,mq")) (const_int 0)))] @@ -607,7 +695,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_ext_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 0 "general_operand" "Qm") (subreg:QI @@ -621,7 +709,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_ext_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 0 "register_operand" "Q") (subreg:QI @@ -635,7 +723,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_ext_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (subreg:QI (zero_extract:SI @@ -650,7 +738,7 @@ (set_attr "mode" "QI")]) (define_expand "cmpqi_ext_3" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (subreg:QI (zero_extract:SI @@ -662,7 +750,7 @@ "") (define_insn "cmpqi_ext_3_insn" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (subreg:QI (zero_extract:SI @@ -676,7 +764,7 @@ (set_attr "mode" "QI")]) (define_insn "cmpqi_ext_3_insn_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (subreg:QI (zero_extract:SI @@ -690,7 +778,7 @@ (set_attr "mode" "QI")]) (define_insn "*cmpqi_ext_4" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (subreg:QI (zero_extract:SI @@ -713,9 +801,9 @@ ;; the old patterns did, but with many more of them. (define_expand "cmpxf" - [(set (reg:CC 17) - (compare:CC (match_operand:XF 0 "cmp_fp_expander_operand" "") - (match_operand:XF 1 "cmp_fp_expander_operand" "")))] + [(set (reg:CC FLAGS_REG) + (compare:CC (match_operand:XF 0 "nonmemory_operand" "") + (match_operand:XF 1 "nonmemory_operand" "")))] "TARGET_80387" { ix86_compare_op0 = operands[0]; @@ -724,10 +812,10 @@ }) (define_expand "cmpdf" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:DF 0 "cmp_fp_expander_operand" "") (match_operand:DF 1 "cmp_fp_expander_operand" "")))] - "TARGET_80387 || TARGET_SSE2" + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" { ix86_compare_op0 = operands[0]; ix86_compare_op1 = operands[1]; @@ -735,10 +823,10 @@ }) (define_expand "cmpsf" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (compare:CC (match_operand:SF 0 "cmp_fp_expander_operand" "") (match_operand:SF 1 "cmp_fp_expander_operand" "")))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" { ix86_compare_op0 = operands[0]; ix86_compare_op1 = operands[1]; @@ -751,34 +839,22 @@ ;; CCFPmode compare with exceptions ;; CCFPUmode compare with no exceptions -;; %%% It is an unfortunate fact that ftst has no non-popping variant, -;; and that fp moves clobber the condition codes, and that there is -;; currently no way to describe this fact to reg-stack. So there are -;; no splitters yet for this. - -;; %%% YIKES! This scheme does not retain a strong connection between -;; the real compare and the ultimate cc0 user, so CC_REVERSE does not -;; work! Only allow tos/mem with tos in op 0. -;; -;; Hmm, of course, this is what the actual _hardware_ does. Perhaps -;; things aren't as bad as they sound... +;; We may not use "#" to split and emit these, since the REG_DEAD notes +;; used to manage the reg stack popping would not be preserved. (define_insn "*cmpfp_0" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI - [(compare:CCFP (match_operand 1 "register_operand" "f") - (match_operand 2 "const0_operand" "X"))] - UNSPEC_FNSTSW))] + [(compare:CCFP + (match_operand 1 "register_operand" "f") + (match_operand 2 "const0_operand" "X"))] + UNSPEC_FNSTSW))] "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2])" -{ - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "ftst\;fnstsw\t%0\;fstp\t%y0"; - else - return "ftst\;fnstsw\t%0"; -} + "* return output_fp_compare (insn, operands, 0, 0);" [(set_attr "type" "multi") + (set_attr "unit" "i387") (set (attr "mode") (cond [(match_operand:SF 1 "" "") (const_string "SF") @@ -787,20 +863,7 @@ ] (const_string "XF")))]) -;; We may not use "#" to split and emit these, since the REG_DEAD notes -;; used to manage the reg stack popping would not be preserved. - -(define_insn "*cmpfp_2_sf" - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand:SF 0 "register_operand" "f") - (match_operand:SF 1 "nonimmediate_operand" "fm")))] - "TARGET_80387" - "* return output_fp_compare (insn, operands, 0, 0);" - [(set_attr "type" "fcmp") - (set_attr "mode" "SF")]) - -(define_insn "*cmpfp_2_sf_1" +(define_insn "*cmpfp_sf" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI [(compare:CCFP @@ -808,21 +871,12 @@ (match_operand:SF 2 "nonimmediate_operand" "fm"))] UNSPEC_FNSTSW))] "TARGET_80387" - "* return output_fp_compare (insn, operands, 2, 0);" - [(set_attr "type" "fcmp") + "* return output_fp_compare (insn, operands, 0, 0);" + [(set_attr "type" "multi") + (set_attr "unit" "i387") (set_attr "mode" "SF")]) -(define_insn "*cmpfp_2_df" - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand:DF 0 "register_operand" "f") - (match_operand:DF 1 "nonimmediate_operand" "fm")))] - "TARGET_80387" - "* return output_fp_compare (insn, operands, 0, 0);" - [(set_attr "type" "fcmp") - (set_attr "mode" "DF")]) - -(define_insn "*cmpfp_2_df_1" +(define_insn "*cmpfp_df" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI [(compare:CCFP @@ -830,21 +884,12 @@ (match_operand:DF 2 "nonimmediate_operand" "fm"))] UNSPEC_FNSTSW))] "TARGET_80387" - "* return output_fp_compare (insn, operands, 2, 0);" + "* return output_fp_compare (insn, operands, 0, 0);" [(set_attr "type" "multi") + (set_attr "unit" "i387") (set_attr "mode" "DF")]) -(define_insn "*cmpfp_2_xf" - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand:XF 0 "register_operand" "f") - (match_operand:XF 1 "register_operand" "f")))] - "TARGET_80387" - "* return output_fp_compare (insn, operands, 0, 0);" - [(set_attr "type" "fcmp") - (set_attr "mode" "XF")]) - -(define_insn "*cmpfp_2_xf_1" +(define_insn "*cmpfp_xf" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI [(compare:CCFP @@ -852,29 +897,12 @@ (match_operand:XF 2 "register_operand" "f"))] UNSPEC_FNSTSW))] "TARGET_80387" - "* return output_fp_compare (insn, operands, 2, 0);" + "* return output_fp_compare (insn, operands, 0, 0);" [(set_attr "type" "multi") + (set_attr "unit" "i387") (set_attr "mode" "XF")]) -(define_insn "*cmpfp_2u" - [(set (reg:CCFPU 18) - (compare:CCFPU - (match_operand 0 "register_operand" "f") - (match_operand 1 "register_operand" "f")))] - "TARGET_80387 - && FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[1])" - "* return output_fp_compare (insn, operands, 0, 1);" - [(set_attr "type" "fcmp") - (set (attr "mode") - (cond [(match_operand:SF 1 "" "") - (const_string "SF") - (match_operand:DF 1 "" "") - (const_string "DF") - ] - (const_string "XF")))]) - -(define_insn "*cmpfp_2u_1" +(define_insn "*cmpfp_u" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI [(compare:CCFPU @@ -884,8 +912,9 @@ "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2])" - "* return output_fp_compare (insn, operands, 2, 1);" + "* return output_fp_compare (insn, operands, 0, 1);" [(set_attr "type" "multi") + (set_attr "unit" "i387") (set (attr "mode") (cond [(match_operand:SF 1 "" "") (const_string "SF") @@ -894,109 +923,71 @@ ] (const_string "XF")))]) -;; Patterns to match the SImode-in-memory ficom instructions. -;; -;; %%% Play games with accepting gp registers, as otherwise we have to -;; force them to memory during rtl generation, which is no good. We -;; can get rid of this once we teach reload to do memory input reloads -;; via pushes. - -(define_insn "*ficom_1" - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand 0 "register_operand" "f,f") - (float (match_operand:SI 1 "nonimmediate_operand" "m,?r"))))] - "0 && TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (XEXP (SET_SRC (PATTERN (insn)), 1)) == GET_MODE (operands[0])" - "#") - -;; Split the not-really-implemented gp register case into a -;; push-op-pop sequence. -;; -;; %%% This is most efficient, but am I gonna get in trouble -;; for separating cc0_setter and cc0_user? - -(define_split - [(set (reg:CCFP 18) - (compare:CCFP - (match_operand:SF 0 "register_operand" "") - (float (match_operand:SI 1 "register_operand" ""))))] - "0 && TARGET_80387 && reload_completed" - [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 1)) - (set (reg:CCFP 18) (compare:CCFP (match_dup 0) (match_dup 2))) - (parallel [(set (match_dup 1) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] - "operands[2] = gen_rtx_MEM (Pmode, stack_pointer_rtx); - operands[2] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[2]);") +(define_insn "*cmpfp_" + [(set (match_operand:HI 0 "register_operand" "=a") + (unspec:HI + [(compare:CCFP + (match_operand 1 "register_operand" "f") + (match_operator 3 "float_operator" + [(match_operand:X87MODEI12 2 "memory_operand" "m")]))] + UNSPEC_FNSTSW))] + "TARGET_80387 && TARGET_USE_MODE_FIOP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && (GET_MODE (operands [3]) == GET_MODE (operands[1]))" + "* return output_fp_compare (insn, operands, 0, 0);" + [(set_attr "type" "multi") + (set_attr "unit" "i387") + (set_attr "fp_int_src" "true") + (set_attr "mode" "")]) ;; FP compares, step 2 ;; Move the fpsw to ax. -(define_insn "*x86_fnstsw_1" +(define_insn "x86_fnstsw_1" [(set (match_operand:HI 0 "register_operand" "=a") - (unspec:HI [(reg 18)] UNSPEC_FNSTSW))] + (unspec:HI [(reg:CCFP FPSR_REG)] UNSPEC_FNSTSW))] "TARGET_80387" "fnstsw\t%0" [(set_attr "length" "2") (set_attr "mode" "SI") - (set_attr "unit" "i387") - (set_attr "ppro_uops" "few")]) + (set_attr "unit" "i387")]) ;; FP compares, step 3 ;; Get ax into flags, general case. (define_insn "x86_sahf_1" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (unspec:CC [(match_operand:HI 0 "register_operand" "a")] UNSPEC_SAHF))] "!TARGET_64BIT" "sahf" [(set_attr "length" "1") (set_attr "athlon_decode" "vector") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "one")]) + (set_attr "mode" "SI")]) ;; Pentium Pro can do steps 1 through 3 in one go. -(define_insn "*cmpfp_i" - [(set (reg:CCFP 17) - (compare:CCFP (match_operand 0 "register_operand" "f") - (match_operand 1 "register_operand" "f")))] - "TARGET_80387 && TARGET_CMOVE - && !SSE_FLOAT_MODE_P (GET_MODE (operands[0])) - && FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[0])" +(define_insn "*cmpfp_i_mixed" + [(set (reg:CCFP FLAGS_REG) + (compare:CCFP (match_operand 0 "register_operand" "f,x") + (match_operand 1 "nonimmediate_operand" "f,xm")))] + "TARGET_MIX_SSE_I387 + && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) + && GET_MODE (operands[0]) == GET_MODE (operands[1])" "* return output_fp_compare (insn, operands, 1, 0);" - [(set_attr "type" "fcmp") + [(set_attr "type" "fcmp,ssecomi") (set (attr "mode") - (cond [(match_operand:SF 1 "" "") - (const_string "SF") - (match_operand:DF 1 "" "") - (const_string "DF") - ] - (const_string "XF"))) + (if_then_else (match_operand:SF 1 "" "") + (const_string "SF") + (const_string "DF"))) (set_attr "athlon_decode" "vector")]) (define_insn "*cmpfp_i_sse" - [(set (reg:CCFP 17) - (compare:CCFP (match_operand 0 "register_operand" "f#x,x#f") - (match_operand 1 "nonimmediate_operand" "f#x,xm#f")))] - "TARGET_80387 - && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[0])" - "* return output_fp_compare (insn, operands, 1, 0);" - [(set_attr "type" "fcmp,ssecomi") - (set (attr "mode") - (if_then_else (match_operand:SF 1 "" "") - (const_string "SF") - (const_string "DF"))) - (set_attr "athlon_decode" "vector")]) - -(define_insn "*cmpfp_i_sse_only" - [(set (reg:CCFP 17) + [(set (reg:CCFP FLAGS_REG) (compare:CCFP (match_operand 0 "register_operand" "x") (match_operand 1 "nonimmediate_operand" "xm")))] - "SSE_FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[0])" + "TARGET_SSE_MATH + && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) + && GET_MODE (operands[0]) == GET_MODE (operands[1])" "* return output_fp_compare (insn, operands, 1, 0);" [(set_attr "type" "ssecomi") (set (attr "mode") @@ -1005,12 +996,61 @@ (const_string "DF"))) (set_attr "athlon_decode" "vector")]) -(define_insn "*cmpfp_iu" - [(set (reg:CCFPU 17) +(define_insn "*cmpfp_i_i387" + [(set (reg:CCFP FLAGS_REG) + (compare:CCFP (match_operand 0 "register_operand" "f") + (match_operand 1 "register_operand" "f")))] + "TARGET_80387 && TARGET_CMOVE + && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0]))) + && FLOAT_MODE_P (GET_MODE (operands[0])) + && GET_MODE (operands[0]) == GET_MODE (operands[1])" + "* return output_fp_compare (insn, operands, 1, 0);" + [(set_attr "type" "fcmp") + (set (attr "mode") + (cond [(match_operand:SF 1 "" "") + (const_string "SF") + (match_operand:DF 1 "" "") + (const_string "DF") + ] + (const_string "XF"))) + (set_attr "athlon_decode" "vector")]) + +(define_insn "*cmpfp_iu_mixed" + [(set (reg:CCFPU FLAGS_REG) + (compare:CCFPU (match_operand 0 "register_operand" "f,x") + (match_operand 1 "nonimmediate_operand" "f,xm")))] + "TARGET_MIX_SSE_I387 + && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) + && GET_MODE (operands[0]) == GET_MODE (operands[1])" + "* return output_fp_compare (insn, operands, 1, 1);" + [(set_attr "type" "fcmp,ssecomi") + (set (attr "mode") + (if_then_else (match_operand:SF 1 "" "") + (const_string "SF") + (const_string "DF"))) + (set_attr "athlon_decode" "vector")]) + +(define_insn "*cmpfp_iu_sse" + [(set (reg:CCFPU FLAGS_REG) + (compare:CCFPU (match_operand 0 "register_operand" "x") + (match_operand 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE_MATH + && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) + && GET_MODE (operands[0]) == GET_MODE (operands[1])" + "* return output_fp_compare (insn, operands, 1, 1);" + [(set_attr "type" "ssecomi") + (set (attr "mode") + (if_then_else (match_operand:SF 1 "" "") + (const_string "SF") + (const_string "DF"))) + (set_attr "athlon_decode" "vector")]) + +(define_insn "*cmpfp_iu_387" + [(set (reg:CCFPU FLAGS_REG) (compare:CCFPU (match_operand 0 "register_operand" "f") (match_operand 1 "register_operand" "f")))] "TARGET_80387 && TARGET_CMOVE - && !SSE_FLOAT_MODE_P (GET_MODE (operands[0])) + && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0]))) && FLOAT_MODE_P (GET_MODE (operands[0])) && GET_MODE (operands[0]) == GET_MODE (operands[1])" "* return output_fp_compare (insn, operands, 1, 1);" @@ -1023,35 +1063,6 @@ ] (const_string "XF"))) (set_attr "athlon_decode" "vector")]) - -(define_insn "*cmpfp_iu_sse" - [(set (reg:CCFPU 17) - (compare:CCFPU (match_operand 0 "register_operand" "f#x,x#f") - (match_operand 1 "nonimmediate_operand" "f#x,xm#f")))] - "TARGET_80387 - && SSE_FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[1])" - "* return output_fp_compare (insn, operands, 1, 1);" - [(set_attr "type" "fcmp,ssecomi") - (set (attr "mode") - (if_then_else (match_operand:SF 1 "" "") - (const_string "SF") - (const_string "DF"))) - (set_attr "athlon_decode" "vector")]) - -(define_insn "*cmpfp_iu_sse_only" - [(set (reg:CCFPU 17) - (compare:CCFPU (match_operand 0 "register_operand" "x") - (match_operand 1 "nonimmediate_operand" "xm")))] - "SSE_FLOAT_MODE_P (GET_MODE (operands[0])) - && GET_MODE (operands[0]) == GET_MODE (operands[1])" - "* return output_fp_compare (insn, operands, 1, 1);" - [(set_attr "type" "ssecomi") - (set (attr "mode") - (if_then_else (match_operand:SF 1 "" "") - (const_string "SF") - (const_string "DF"))) - (set_attr "athlon_decode" "vector")]) ;; Move instructions. @@ -1100,9 +1111,9 @@ (define_insn "*popsi1_epilogue" [(set (match_operand:SI 0 "nonimmediate_operand" "=r*m") - (mem:SI (reg:SI 7))) - (set (reg:SI 7) - (plus:SI (reg:SI 7) (const_int 4))) + (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) (const_int 4))) (clobber (mem:BLK (scratch)))] "!TARGET_64BIT" "pop{l}\t%0" @@ -1111,9 +1122,9 @@ (define_insn "popsi1" [(set (match_operand:SI 0 "nonimmediate_operand" "=r*m") - (mem:SI (reg:SI 7))) - (set (reg:SI 7) - (plus:SI (reg:SI 7) (const_int 4)))] + (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) (const_int 4)))] "!TARGET_64BIT" "pop{l}\t%0" [(set_attr "type" "pop") @@ -1122,7 +1133,7 @@ (define_insn "*movsi_xor" [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "const0_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_USE_MOV0 || optimize_size)" "xor{l}\t{%0, %0|%0, %0}" [(set_attr "type" "alu1") @@ -1132,7 +1143,7 @@ (define_insn "*movsi_or" [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "immediate_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && operands[1] == constm1_rtx && (TARGET_PENTIUM || optimize_size)" @@ -1145,17 +1156,36 @@ (set_attr "length_immediate" "1")]) (define_insn "*movsi_1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m,!*y,!rm,!*y,!*Y,!rm,!*Y") - (match_operand:SI 1 "general_operand" "rinm,rin,*y,*y,rm,*Y,*Y,rm"))] - "(TARGET_INTER_UNIT_MOVES || optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + [(set (match_operand:SI 0 "nonimmediate_operand" + "=r ,m ,*y,*y,?rm,?*y,*x,*x,?r,m ,?*Y,*x") + (match_operand:SI 1 "general_operand" + "rinm,rin,C ,*y,*y ,rm ,C ,*x,*Y,*x,r ,m "))] + "!(MEM_P (operands[0]) && MEM_P (operands[1]))" { switch (get_attr_type (insn)) { - case TYPE_SSEMOV: + case TYPE_SSELOG1: if (get_attr_mode (insn) == MODE_TI) - return "movdqa\t{%1, %0|%0, %1}"; - return "movd\t{%1, %0|%0, %1}"; + return "pxor\t%0, %0"; + return "xorps\t%0, %0"; + + case TYPE_SSEMOV: + switch (get_attr_mode (insn)) + { + case MODE_TI: + return "movdqa\t{%1, %0|%0, %1}"; + case MODE_V4SF: + return "movaps\t{%1, %0|%0, %1}"; + case MODE_SI: + return "movd\t{%1, %0|%0, %1}"; + case MODE_SF: + return "movss\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } + + case TYPE_MMXADD: + return "pxor\t%0, %0"; case TYPE_MMXMOV: if (get_attr_mode (insn) == MODE_DI) @@ -1166,61 +1196,36 @@ return "lea{l}\t{%1, %0|%0, %1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort(); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); return "mov{l}\t{%1, %0|%0, %1}"; } } [(set (attr "type") - (cond [(eq_attr "alternative" "2,3,4") + (cond [(eq_attr "alternative" "2") + (const_string "mmxadd") + (eq_attr "alternative" "3,4,5") (const_string "mmxmov") - (eq_attr "alternative" "5,6,7") + (eq_attr "alternative" "6") + (const_string "sselog1") + (eq_attr "alternative" "7,8,9,10,11") (const_string "ssemov") - (and (ne (symbol_ref "flag_pic") (const_int 0)) - (match_operand:SI 1 "symbolic_operand" "")) + (match_operand:DI 1 "pic_32bit_operand" "") (const_string "lea") ] (const_string "imov"))) - (set_attr "mode" "SI,SI,DI,SI,SI,TI,SI,SI")]) - -(define_insn "*movsi_1_nointernunit" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m,!*y,!m,!*y,!*Y,!m,!*Y") - (match_operand:SI 1 "general_operand" "rinm,rin,*y,*y,m,*Y,*Y,m"))] - "(!TARGET_INTER_UNIT_MOVES && !optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (get_attr_type (insn)) - { - case TYPE_SSEMOV: - if (get_attr_mode (insn) == MODE_TI) - return "movdqa\t{%1, %0|%0, %1}"; - return "movd\t{%1, %0|%0, %1}"; - - case TYPE_MMXMOV: - if (get_attr_mode (insn) == MODE_DI) - return "movq\t{%1, %0|%0, %1}"; - return "movd\t{%1, %0|%0, %1}"; - - case TYPE_LEA: - return "lea{l}\t{%1, %0|%0, %1}"; - - default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort(); - return "mov{l}\t{%1, %0|%0, %1}"; - } -} - [(set (attr "type") - (cond [(eq_attr "alternative" "2,3,4") - (const_string "mmxmov") - (eq_attr "alternative" "5,6,7") - (const_string "ssemov") - (and (ne (symbol_ref "flag_pic") (const_int 0)) - (match_operand:SI 1 "symbolic_operand" "")) - (const_string "lea") + (set (attr "mode") + (cond [(eq_attr "alternative" "2,3") + (const_string "DI") + (eq_attr "alternative" "6,7") + (if_then_else + (eq (symbol_ref "TARGET_SSE2") (const_int 0)) + (const_string "V4SF") + (const_string "TI")) + (and (eq_attr "alternative" "8,9,10,11") + (eq (symbol_ref "TARGET_SSE2") (const_int 0))) + (const_string "SF") ] - (const_string "imov"))) - (set_attr "mode" "SI,SI,DI,SI,SI,TI,SI,SI")]) + (const_string "SI")))]) ;; Stores and loads of ax to arbitrary constant address. ;; We fake an second form of instruction to force reload to load address @@ -1263,8 +1268,7 @@ [(set_attr "type" "imov") (set_attr "mode" "SI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_expand "movhi" [(set (match_operand:HI 0 "nonimmediate_operand" "") @@ -1273,14 +1277,12 @@ "ix86_expand_move (HImode, operands); DONE;") (define_insn "*pushhi2" - [(set (match_operand:HI 0 "push_operand" "=<,<") - (match_operand:HI 1 "general_no_elim_operand" "n,r*m"))] + [(set (match_operand:HI 0 "push_operand" "=X") + (match_operand:HI 1 "nonmemory_no_elim_operand" "rn"))] "!TARGET_64BIT" - "@ - push{w}\t{|WORD PTR }%1 - push{w}\t%1" + "push{l}\t%k1" [(set_attr "type" "push") - (set_attr "mode" "HI")]) + (set_attr "mode" "SI")]) ;; For 64BIT abi we always round up to 8 bytes. (define_insn "*pushhi2_rex64" @@ -1289,7 +1291,7 @@ "TARGET_64BIT" "push{q}\t%q1" [(set_attr "type" "push") - (set_attr "mode" "QI")]) + (set_attr "mode" "DI")]) (define_insn "*movhi_1" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m") @@ -1310,7 +1312,9 @@ } } [(set (attr "type") - (cond [(and (eq_attr "alternative" "0") + (cond [(ne (symbol_ref "optimize_size") (const_int 0)) + (const_string "imov") + (and (eq_attr "alternative" "0") (ior (eq (symbol_ref "TARGET_PARTIAL_REG_STALL") (const_int 0)) (eq (symbol_ref "TARGET_HIMODE_MATH") @@ -1381,8 +1385,7 @@ [(set_attr "type" "imov") (set_attr "mode" "SI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_insn "*swaphi_2" [(set (match_operand:HI 0 "register_operand" "+r") @@ -1394,8 +1397,7 @@ [(set_attr "type" "imov") (set_attr "mode" "HI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_expand "movstricthi" [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "")) @@ -1419,7 +1421,7 @@ (define_insn "*movstricthi_xor" [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) (match_operand:HI 1 "const0_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ((!TARGET_USE_MOV0 && !TARGET_PARTIAL_REG_STALL) || optimize_size)" "xor{w}\t{%0, %0|%0, %0}" @@ -1434,18 +1436,16 @@ "ix86_expand_move (QImode, operands); DONE;") ;; emit_push_insn when it calls move_by_pieces requires an insn to -;; "push a byte". But actually we use pushw, which has the effect -;; of rounding the amount pushed up to a halfword. +;; "push a byte". But actually we use pushl, which has the effect +;; of rounding the amount pushed up to a word. (define_insn "*pushqi2" - [(set (match_operand:QI 0 "push_operand" "=X,X") - (match_operand:QI 1 "nonmemory_no_elim_operand" "n,r"))] + [(set (match_operand:QI 0 "push_operand" "=X") + (match_operand:QI 1 "nonmemory_no_elim_operand" "rn"))] "!TARGET_64BIT" - "@ - push{w}\t{|word ptr }%1 - push{w}\t%w1" + "push{l}\t%k1" [(set_attr "type" "push") - (set_attr "mode" "HI")]) + (set_attr "mode" "SI")]) ;; For 64BIT abi we always round up to 8 bytes. (define_insn "*pushqi2_rex64" @@ -1454,7 +1454,7 @@ "TARGET_64BIT" "push{q}\t%q1" [(set_attr "type" "push") - (set_attr "mode" "QI")]) + (set_attr "mode" "DI")]) ;; Situation is quite tricky about when to choose full sized (SImode) move ;; over QImode moves. For Q_REG -> Q_REG move we use full size only for @@ -1474,8 +1474,7 @@ switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (!ANY_QI_REG_P (operands[1]) && GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (ANY_QI_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM); return "movz{bl|x}\t{%1, %k0|%k0, %1}"; default: if (get_attr_mode (insn) == MODE_SI) @@ -1485,7 +1484,12 @@ } } [(set (attr "type") - (cond [(and (eq_attr "alternative" "3") + (cond [(and (eq_attr "alternative" "5") + (not (match_operand:QI 1 "aligned_operand" ""))) + (const_string "imovx") + (ne (symbol_ref "optimize_size") (const_int 0)) + (const_string "imov") + (and (eq_attr "alternative" "3") (ior (eq (symbol_ref "TARGET_PARTIAL_REG_STALL") (const_int 0)) (eq (symbol_ref "TARGET_QIMODE_MATH") @@ -1507,13 +1511,17 @@ (eq_attr "type" "imovx") (const_string "SI") (and (eq_attr "type" "imov") - (and (eq_attr "alternative" "0,1,2") - (ne (symbol_ref "TARGET_PARTIAL_REG_DEPENDENCY") - (const_int 0)))) + (and (eq_attr "alternative" "0,1") + (and (ne (symbol_ref "TARGET_PARTIAL_REG_DEPENDENCY") + (const_int 0)) + (and (eq (symbol_ref "optimize_size") + (const_int 0)) + (eq (symbol_ref "TARGET_PARTIAL_REG_STALL") + (const_int 0)))))) (const_string "SI") ;; Avoid partial register stalls when not using QImode arithmetic (and (eq_attr "type" "imov") - (and (eq_attr "alternative" "0,1,2") + (and (eq_attr "alternative" "0,1") (and (ne (symbol_ref "TARGET_PARTIAL_REG_STALL") (const_int 0)) (eq (symbol_ref "TARGET_QIMODE_MATH") @@ -1531,8 +1539,7 @@ rtx op0, op1, op2; op0 = operands[0]; op1 = operands[1]; op2 = operands[2]; - if (reg_overlap_mentioned_p (op2, op0)) - abort (); + gcc_assert (!reg_overlap_mentioned_p (op2, op0)); if (! q_regs_operand (op1, QImode)) { emit_insn (gen_movqi (op2, op1)); @@ -1552,8 +1559,7 @@ [(set_attr "type" "imov") (set_attr "mode" "SI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_insn "*swapqi_2" [(set (match_operand:QI 0 "register_operand" "+q") @@ -1565,8 +1571,7 @@ [(set_attr "type" "imov") (set_attr "mode" "QI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_expand "movstrictqi" [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) @@ -1590,7 +1595,7 @@ (define_insn "*movstrictqi_xor" [(set (strict_low_part (match_operand:QI 0 "q_regs_operand" "+q")) (match_operand:QI 1 "const0_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_USE_MOV0 || optimize_size)" "xor{b}\t{%0, %0|%0, %0}" [(set_attr "type" "alu1") @@ -1702,6 +1707,16 @@ (set_attr "memory" "load") (set_attr "mode" "QI")]) +(define_insn "*movdi_extzv_1" + [(set (match_operand:DI 0 "register_operand" "=R") + (zero_extract:DI (match_operand 1 "ext_register_operand" "Q") + (const_int 8) + (const_int 8)))] + "TARGET_64BIT" + "movz{bl|x}\t{%h1, %k0|%k0, %h1}" + [(set_attr "type" "imovx") + (set_attr "mode" "DI")]) + (define_insn "*movsi_extzv_1" [(set (match_operand:SI 0 "register_operand" "=R") (zero_extract:SI (match_operand 1 "ext_register_operand" "Q") @@ -1808,7 +1823,7 @@ "!TARGET_64BIT" "#") -(define_insn "pushdi2_rex64" +(define_insn "*pushdi2_rex64" [(set (match_operand:DI 0 "push_operand" "=<,!<") (match_operand:DI 1 "general_no_elim_operand" "re*m,n"))] "TARGET_64BIT" @@ -1834,6 +1849,7 @@ ;; We need to define this as both peepholer and splitter for case ;; peephole2 pass is not run. +;; "&& 1" is needed to keep it from matching the previous pattern. (define_peephole2 [(set (match_operand:DI 0 "push_operand" "") (match_operand:DI 1 "immediate_operand" ""))] @@ -1851,7 +1867,7 @@ [(set (match_operand:DI 0 "push_operand" "") (match_operand:DI 1 "immediate_operand" ""))] "TARGET_64BIT && ((optimize > 0 && flag_peephole2) - ? flow2_completed : reload_completed) + ? flow2_completed : reload_completed) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 0) (match_dup 1)) @@ -1873,9 +1889,9 @@ (define_insn "*popdi1_epilogue_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=r*m") - (mem:DI (reg:DI 7))) - (set (reg:DI 7) - (plus:DI (reg:DI 7) (const_int 8))) + (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) + (plus:DI (reg:DI SP_REG) (const_int 8))) (clobber (mem:BLK (scratch)))] "TARGET_64BIT" "pop{q}\t%0" @@ -1884,9 +1900,9 @@ (define_insn "popdi1" [(set (match_operand:DI 0 "nonimmediate_operand" "=r*m") - (mem:DI (reg:DI 7))) - (set (reg:DI 7) - (plus:DI (reg:DI 7) (const_int 8)))] + (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) + (plus:DI (reg:DI SP_REG) (const_int 8)))] "TARGET_64BIT" "pop{q}\t%0" [(set_attr "type" "pop") @@ -1895,7 +1911,7 @@ (define_insn "*movdi_xor_rex64" [(set (match_operand:DI 0 "register_operand" "=r") (match_operand:DI 1 "const0_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (!TARGET_USE_MOV0 || optimize_size) && reload_completed" "xor{l}\t{%k0, %k0|%k0, %k0}" @@ -1906,7 +1922,7 @@ (define_insn "*movdi_or_rex64" [(set (match_operand:DI 0 "register_operand" "=r") (match_operand:DI 1 "const_int_operand" "i")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (TARGET_PENTIUM || optimize_size) && reload_completed && operands[1] == constm1_rtx" @@ -1919,20 +1935,27 @@ (set_attr "length_immediate" "1")]) (define_insn "*movdi_2" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!m*y,!*y,!m,!*Y,!*Y") - (match_operand:DI 1 "general_operand" "riFo,riF,*y,m,*Y,*Y,m"))] - "!TARGET_64BIT - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + [(set (match_operand:DI 0 "nonimmediate_operand" + "=r ,o ,*y,m*y,*y,*Y,m ,*Y,*Y,*x,m ,*x,*x") + (match_operand:DI 1 "general_operand" + "riFo,riF,C ,*y ,m ,C ,*Y,*Y,m ,C ,*x,*x,m "))] + "!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ # # + pxor\t%0, %0 movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1} + pxor\t%0, %0 movq\t{%1, %0|%0, %1} movdqa\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1}" - [(set_attr "type" "*,*,mmx,mmx,ssemov,ssemov,ssemov") - (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI")]) + movq\t{%1, %0|%0, %1} + xorps\t%0, %0 + movlps\t{%1, %0|%0, %1} + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1}" + [(set_attr "type" "*,*,mmx,mmxmov,mmxmov,sselog1,ssemov,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov") + (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,TI,DI,V4SF,V2SF,V4SF,V2SF")]) (define_split [(set (match_operand:DI 0 "push_operand" "") @@ -1953,14 +1976,19 @@ "ix86_split_long_move (operands); DONE;") (define_insn "*movdi_1_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,mr,!mr,!*y,!rm,!*y,!*Y,!rm,!*Y") - (match_operand:DI 1 "general_operand" "Z,rem,i,re,n,*y,*y,rm,*Y,*Y,rm"))] - "TARGET_64BIT - && (TARGET_INTER_UNIT_MOVES || optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + [(set (match_operand:DI 0 "nonimmediate_operand" + "=r,r ,r,m ,!m,*y,*y,?rm,?*y,*x,*x,?rm,?*x,?*x,?*y") + (match_operand:DI 1 "general_operand" + "Z ,rem,i,re,n ,C ,*y,*y ,rm ,C ,*x,*x ,rm ,*y ,*x"))] + "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))" { switch (get_attr_type (insn)) { + case TYPE_SSECVT: + if (which_alternative == 13) + return "movq2dq\t{%1, %0|%0, %1}"; + else + return "movdq2q\t{%1, %0|%0, %1}"; case TYPE_SSEMOV: if (get_attr_mode (insn) == MODE_TI) return "movdqa\t{%1, %0|%0, %1}"; @@ -1971,13 +1999,15 @@ if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) return "movd\t{%1, %0|%0, %1}"; return "movq\t{%1, %0|%0, %1}"; + case TYPE_SSELOG1: + case TYPE_MMXADD: + return "pxor\t%0, %0"; case TYPE_MULTI: return "#"; case TYPE_LEA: return "lea{q}\t{%a1, %0|%0, %a1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort (); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); if (get_attr_mode (insn) == MODE_SI) return "mov{l}\t{%k1, %k0|%k0, %k1}"; else if (which_alternative == 2) @@ -1987,66 +2017,25 @@ } } [(set (attr "type") - (cond [(eq_attr "alternative" "5,6,7") + (cond [(eq_attr "alternative" "5") + (const_string "mmxadd") + (eq_attr "alternative" "6,7,8") (const_string "mmxmov") - (eq_attr "alternative" "8,9,10") + (eq_attr "alternative" "9") + (const_string "sselog1") + (eq_attr "alternative" "10,11,12") (const_string "ssemov") + (eq_attr "alternative" "13,14") + (const_string "ssecvt") (eq_attr "alternative" "4") (const_string "multi") - (and (ne (symbol_ref "flag_pic") (const_int 0)) - (match_operand:DI 1 "symbolic_operand" "")) + (match_operand:DI 1 "pic_32bit_operand" "") (const_string "lea") ] (const_string "imov"))) - (set_attr "modrm" "*,0,0,*,*,*,*,*,*,*,*") - (set_attr "length_immediate" "*,4,8,*,*,*,*,*,*,*,*") - (set_attr "mode" "SI,DI,DI,DI,SI,DI,DI,DI,TI,DI,DI")]) - -(define_insn "*movdi_1_rex64_nointerunit" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,mr,!mr,!*y,!m,!*y,!*Y,!m,!*Y") - (match_operand:DI 1 "general_operand" "Z,rem,i,re,n,*y,*y,m,*Y,*Y,m"))] - "TARGET_64BIT - && (!TARGET_INTER_UNIT_MOVES && !optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (get_attr_type (insn)) - { - case TYPE_SSEMOV: - if (get_attr_mode (insn) == MODE_TI) - return "movdqa\t{%1, %0|%0, %1}"; - /* FALLTHRU */ - case TYPE_MMXMOV: - return "movq\t{%1, %0|%0, %1}"; - case TYPE_MULTI: - return "#"; - case TYPE_LEA: - return "lea{q}\t{%a1, %0|%0, %a1}"; - default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort (); - if (get_attr_mode (insn) == MODE_SI) - return "mov{l}\t{%k1, %k0|%k0, %k1}"; - else if (which_alternative == 2) - return "movabs{q}\t{%1, %0|%0, %1}"; - else - return "mov{q}\t{%1, %0|%0, %1}"; - } -} - [(set (attr "type") - (cond [(eq_attr "alternative" "5,6,7") - (const_string "mmxmov") - (eq_attr "alternative" "8,9,10") - (const_string "ssemov") - (eq_attr "alternative" "4") - (const_string "multi") - (and (ne (symbol_ref "flag_pic") (const_int 0)) - (match_operand:DI 1 "symbolic_operand" "")) - (const_string "lea") - ] - (const_string "imov"))) - (set_attr "modrm" "*,0,0,*,*,*,*,*,*,*,*") - (set_attr "length_immediate" "*,4,8,*,*,*,*,*,*,*,*") - (set_attr "mode" "SI,DI,DI,DI,SI,DI,DI,DI,TI,DI,DI")]) + (set_attr "modrm" "*,0,0,*,*,*,*,*,*,*,*,*,*,*,*") + (set_attr "length_immediate" "*,4,8,*,*,*,*,*,*,*,*,*,*,*,*") + (set_attr "mode" "SI,DI,DI,DI,SI,DI,DI,DI,DI,TI,TI,DI,DI,DI,DI")]) ;; Stores and loads of ax to arbitrary constant address. ;; We fake an second form of instruction to force reload to load address @@ -2094,6 +2083,7 @@ ;; We need to define this as both peepholer and splitter for case ;; peephole2 pass is not run. +;; "&& 1" is needed to keep it from matching the previous pattern. (define_peephole2 [(set (match_operand:DI 0 "memory_operand" "") (match_operand:DI 1 "immediate_operand" ""))] @@ -2107,7 +2097,7 @@ [(set (match_operand:DI 0 "memory_operand" "") (match_operand:DI 1 "immediate_operand" ""))] "TARGET_64BIT && ((optimize > 0 && flag_peephole2) - ? flow2_completed : reload_completed) + ? flow2_completed : reload_completed) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 3)) @@ -2124,8 +2114,105 @@ [(set_attr "type" "imov") (set_attr "mode" "DI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) + +(define_expand "movti" + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (match_operand:TI 1 "nonimmediate_operand" ""))] + "TARGET_SSE || TARGET_64BIT" +{ + if (TARGET_64BIT) + ix86_expand_move (TImode, operands); + else + ix86_expand_vector_move (TImode, operands); + DONE; +}) + +(define_insn "*movti_internal" + [(set (match_operand:TI 0 "nonimmediate_operand" "=x,x,m") + (match_operand:TI 1 "vector_move_operand" "C,xm,x"))] + "TARGET_SSE && !TARGET_64BIT + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" +{ + switch (which_alternative) + { + case 0: + if (get_attr_mode (insn) == MODE_V4SF) + return "xorps\t%0, %0"; + else + return "pxor\t%0, %0"; + case 1: + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movdqa\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sselog1,ssemov,ssemov") + (set (attr "mode") + (cond [(ior (eq (symbol_ref "TARGET_SSE2") (const_int 0)) + (ne (symbol_ref "optimize_size") (const_int 0))) + (const_string "V4SF") + (and (eq_attr "alternative" "2") + (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0))) + (const_string "V4SF")] + (const_string "TI")))]) + +(define_insn "*movti_rex64" + [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o,x,x,xm") + (match_operand:TI 1 "general_operand" "riFo,riF,C,xm,x"))] + "TARGET_64BIT + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" +{ + switch (which_alternative) + { + case 0: + case 1: + return "#"; + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "xorps\t%0, %0"; + else + return "pxor\t%0, %0"; + case 3: + case 4: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movdqa\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "*,*,sselog1,ssemov,ssemov") + (set (attr "mode") + (cond [(eq_attr "alternative" "2,3") + (if_then_else + (ne (symbol_ref "optimize_size") + (const_int 0)) + (const_string "V4SF") + (const_string "TI")) + (eq_attr "alternative" "4") + (if_then_else + (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0)) + (ne (symbol_ref "optimize_size") + (const_int 0))) + (const_string "V4SF") + (const_string "TI"))] + (const_string "DI")))]) + +(define_split + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (match_operand:TI 1 "general_operand" ""))] + "reload_completed && !SSE_REG_P (operands[0]) + && !SSE_REG_P (operands[1])" + [(const_int 0)] + "ix86_split_long_move (operands); DONE;") (define_expand "movsf" [(set (match_operand:SF 0 "nonimmediate_operand" "") @@ -2135,38 +2222,28 @@ (define_insn "*pushsf" [(set (match_operand:SF 0 "push_operand" "=<,<,<") - (match_operand:SF 1 "general_no_elim_operand" "f#rx,rFm#fx,x#rf"))] + (match_operand:SF 1 "general_no_elim_operand" "f,rFm,x"))] "!TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{l}\t%1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{l}\t%1"; } [(set_attr "type" "multi,push,multi") + (set_attr "unit" "i387,*,*") (set_attr "mode" "SF,SI,SF")]) (define_insn "*pushsf_rex64" [(set (match_operand:SF 0 "push_operand" "=X,X,X") - (match_operand:SF 1 "nonmemory_no_elim_operand" "f#rx,rF#fx,x#rf"))] + (match_operand:SF 1 "nonmemory_no_elim_operand" "f,rF,x"))] "TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{q}\t%q1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{q}\t%q1"; } [(set_attr "type" "multi,push,multi") + (set_attr "unit" "i387,*,*") (set_attr "mode" "SF,DI,SF")]) (define_split @@ -2185,21 +2262,22 @@ [(set (match_operand:SF 0 "push_operand" "") (match_operand:SF 1 "any_fp_register_operand" ""))] "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -4))) - (set (mem:SF (reg:SI 7)) (match_dup 1))]) + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4))) + (set (mem:SF (reg:SI SP_REG)) (match_dup 1))]) (define_split [(set (match_operand:SF 0 "push_operand" "") (match_operand:SF 1 "any_fp_register_operand" ""))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -8))) - (set (mem:SF (reg:DI 7)) (match_dup 1))]) + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) + (set (mem:SF (reg:DI SP_REG)) (match_dup 1))]) (define_insn "*movsf_1" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f#xr,m,f#xr,r#xf,m,x#rf,x#rf,x#rf,m,!*y,!rm,!*y") - (match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,Fr#fx,C,x,xm#rf,x#rf,rm,*y,*y"))] - "(TARGET_INTER_UNIT_MOVES || optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) + [(set (match_operand:SF 0 "nonimmediate_operand" + "=f,m ,f,r ,m ,x,x,x ,m ,!*y,!rm,!*y") + (match_operand:SF 1 "general_operand" + "fm,f,G ,rmF,Fr,C ,x ,xm,x,rm ,*y ,*y"))] + "!(MEM_P (operands[0]) && MEM_P (operands[1])) && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE @@ -2208,13 +2286,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) @@ -2250,10 +2322,10 @@ return "movq\t{%1, %0|%0, %1}"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "fmov,fmov,fmov,imov,imov,ssemov,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov") + [(set_attr "type" "fmov,fmov,fmov,imov,imov,sselog1,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov") (set (attr "mode") (cond [(eq_attr "alternative" "3,4,9,10") (const_string "SI") @@ -2281,106 +2353,7 @@ (if_then_else (ior (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") (const_int 0)) - (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS") - (const_int 0))) - (const_string "V4SF") - (const_string "SF")) - (eq_attr "alternative" "11") - (const_string "DI")] - (const_string "SF")))]) - -(define_insn "*movsf_1_nointerunit" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f#xr,m,f#xr,r#xf,m,x#rf,x#rf,x#rf,m,!*y,!m,!*y") - (match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,Fr#fx,C,x,xm#rf,x#rf,m,*y,*y"))] - "(!TARGET_INTER_UNIT_MOVES && !optimize_size) - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && (reload_in_progress || reload_completed - || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) - || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], SFmode))" -{ - switch (which_alternative) - { - case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; - - case 1: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - - case 2: - return standard_80387_constant_opcode (operands[1]); - - case 3: - case 4: - return "mov{l}\t{%1, %0|%0, %1}"; - case 5: - if (get_attr_mode (insn) == MODE_TI) - return "pxor\t%0, %0"; - else - return "xorps\t%0, %0"; - case 6: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movss\t{%1, %0|%0, %1}"; - case 7: - case 8: - return "movss\t{%1, %0|%0, %1}"; - - case 9: - case 10: - return "movd\t{%1, %0|%0, %1}"; - - case 11: - return "movq\t{%1, %0|%0, %1}"; - - default: - abort(); - } -} - [(set_attr "type" "fmov,fmov,fmov,imov,imov,ssemov,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov") - (set (attr "mode") - (cond [(eq_attr "alternative" "3,4,9,10") - (const_string "SI") - (eq_attr "alternative" "5") - (if_then_else - (and (and (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR") - (const_int 0)) - (ne (symbol_ref "TARGET_SSE2") - (const_int 0))) - (eq (symbol_ref "optimize_size") - (const_int 0))) - (const_string "TI") - (const_string "V4SF")) - /* For architectures resolving dependencies on - whole SSE registers use APS move to break dependency - chains, otherwise use short move to avoid extra work. - - Do the same for architectures resolving dependencies on - the parts. While in DF mode it is better to always handle - just register parts, the SF mode is different due to lack - of instructions to load just part of the register. It is - better to maintain the whole registers in single format - to avoid problems on using packed logical operations. */ - (eq_attr "alternative" "6") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") - (const_int 0)) - (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS") + (ne (symbol_ref "TARGET_SSE_SPLIT_REGS") (const_int 0))) (const_string "V4SF") (const_string "SF")) @@ -2389,11 +2362,11 @@ (const_string "SF")))]) (define_insn "*swapsf" - [(set (match_operand:SF 0 "register_operand" "+f") - (match_operand:SF 1 "register_operand" "+f")) + [(set (match_operand:SF 0 "fp_register_operand" "+f") + (match_operand:SF 1 "fp_register_operand" "+f")) (set (match_dup 1) (match_dup 0))] - "reload_completed || !TARGET_SSE" + "reload_completed || TARGET_80387" { if (STACK_TOP_P (operands[0])) return "fxch\t%1"; @@ -2416,24 +2389,26 @@ (define_insn "*pushdf_nointeger" [(set (match_operand:DF 0 "push_operand" "=<,<,<,<") - (match_operand:DF 1 "general_no_elim_operand" "f#Y,Fo#fY,*r#fY,Y#f"))] + (match_operand:DF 1 "general_no_elim_operand" "f,Fo,*r,Y"))] "!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") + (set_attr "unit" "i387,*,*,*") (set_attr "mode" "DF,SI,SI,DF")]) (define_insn "*pushdf_integer" [(set (match_operand:DF 0 "push_operand" "=<,<,<") - (match_operand:DF 1 "general_no_elim_operand" "f#rY,rFo#fY,Y#rf"))] + (match_operand:DF 1 "general_no_elim_operand" "f,rFo,Y"))] "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") + (set_attr "unit" "i387,*,*") (set_attr "mode" "DF,SI,DF")]) ;; %%% Kill this when call knows how to work this out. @@ -2441,16 +2416,16 @@ [(set (match_operand:DF 0 "push_operand" "") (match_operand:DF 1 "any_fp_register_operand" ""))] "!TARGET_64BIT && reload_completed" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -8))) - (set (mem:DF (reg:SI 7)) (match_dup 1))] + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + (set (mem:DF (reg:SI SP_REG)) (match_dup 1))] "") (define_split [(set (match_operand:DF 0 "push_operand" "") (match_operand:DF 1 "any_fp_register_operand" ""))] "TARGET_64BIT && reload_completed" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -8))) - (set (mem:DF (reg:DI 7)) (match_dup 1))] + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) + (set (mem:DF (reg:DI SP_REG)) (match_dup 1))] "") (define_split @@ -2465,8 +2440,10 @@ ;; when optimizing for size. (define_insn "*movdf_nointeger" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Y,m,f#Y,*r,o,Y#f,Y#f,Y#f,m") - (match_operand:DF 1 "general_operand" "fm#Y,f#Y,G,*roF,F*r,C,Y#f,YHm#f,Y#f"))] + [(set (match_operand:DF 0 "nonimmediate_operand" + "=f,m,f,*r ,o ,Y*x,Y*x,Y*x ,m ") + (match_operand:DF 1 "general_operand" + "fm,f,G,*roF,F*r,C ,Y*x,mY*x,Y*x"))] "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && ((optimize_size || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT) && (reload_in_progress || reload_completed @@ -2477,18 +2454,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) @@ -2512,36 +2478,49 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: + case 7: + case 8: switch (get_attr_mode (insn)) { case MODE_V4SF: return "movaps\t{%1, %0|%0, %1}"; case MODE_V2DF: return "movapd\t{%1, %0|%0, %1}"; + case MODE_TI: + return "movdqa\t{%1, %0|%0, %1}"; + case MODE_DI: + return "movq\t{%1, %0|%0, %1}"; case MODE_DF: return "movsd\t{%1, %0|%0, %1}"; + case MODE_V1DF: + return "movlpd\t{%1, %0|%0, %1}"; + case MODE_V2SF: + return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } - case 7: - if (get_attr_mode (insn) == MODE_V2DF) - return "movlpd\t{%1, %0|%0, %1}"; - else - return "movsd\t{%1, %0|%0, %1}"; - case 8: - return "movsd\t{%1, %0|%0, %1}"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") + [(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov") (set (attr "mode") - (cond [(eq_attr "alternative" "3,4") + (cond [(eq_attr "alternative" "0,1,2") + (const_string "DF") + (eq_attr "alternative" "3,4") (const_string "SI") + + /* For SSE1, we have many fewer alternatives. */ + (eq (symbol_ref "TARGET_SSE2") (const_int 0)) + (cond [(eq_attr "alternative" "5,6") + (const_string "V4SF") + ] + (const_string "V2SF")) + /* xorps is one byte shorter. */ (eq_attr "alternative" "5") (cond [(ne (symbol_ref "optimize_size") @@ -2549,8 +2528,10 @@ (const_string "V4SF") (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR") (const_int 0)) - (const_string "TI")] + (const_string "TI") + ] (const_string "V2DF")) + /* For architectures resolving dependencies on whole SSE registers use APD move to break dependency chains, otherwise use short move to avoid extra work. @@ -2558,27 +2539,31 @@ movaps encodes one byte shorter. */ (eq_attr "alternative" "6") (cond - [(ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") - (const_int 0)) - (const_string "V2DF")] + [(ne (symbol_ref "optimize_size") + (const_int 0)) + (const_string "V4SF") + (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") + (const_int 0)) + (const_string "V2DF") + ] (const_string "DF")) /* For architectures resolving dependencies on register parts we may avoid extra work to zero out upper part of register. */ (eq_attr "alternative" "7") (if_then_else - (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS") + (ne (symbol_ref "TARGET_SSE_SPLIT_REGS") (const_int 0)) - (const_string "V2DF") - (const_string "DF"))] - (const_string "DF")))]) + (const_string "V1DF") + (const_string "DF")) + ] + (const_string "DF")))]) (define_insn "*movdf_integer" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Yr,m,f#Yr,r#Yf,o,Y#rf,Y#rf,Y#rf,m") - (match_operand:DF 1 "general_operand" "fm#Yr,f#Yr,G,roF#Yf,Fr#Yf,C,Y#rf,Ym#rf,Y#rf"))] + [(set (match_operand:DF 0 "nonimmediate_operand" + "=f,m,f,r ,o ,Y*x,Y*x,Y*x,m ") + (match_operand:DF 1 "general_operand" + "fm,f,G,roF,Fr,C ,Y*x,m ,Y*x"))] "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && ((!optimize_size && TARGET_INTEGER_DFMODE_MOVES) || TARGET_64BIT) && (reload_in_progress || reload_completed @@ -2589,18 +2574,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) @@ -2625,36 +2599,49 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: + case 7: + case 8: switch (get_attr_mode (insn)) { case MODE_V4SF: return "movaps\t{%1, %0|%0, %1}"; case MODE_V2DF: return "movapd\t{%1, %0|%0, %1}"; + case MODE_TI: + return "movdqa\t{%1, %0|%0, %1}"; + case MODE_DI: + return "movq\t{%1, %0|%0, %1}"; case MODE_DF: return "movsd\t{%1, %0|%0, %1}"; + case MODE_V1DF: + return "movlpd\t{%1, %0|%0, %1}"; + case MODE_V2SF: + return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } - case 7: - if (get_attr_mode (insn) == MODE_V2DF) - return "movlpd\t{%1, %0|%0, %1}"; - else - return "movsd\t{%1, %0|%0, %1}"; - case 8: - return "movsd\t{%1, %0|%0, %1}"; default: - abort(); + gcc_unreachable(); } } - [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") + [(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov") (set (attr "mode") - (cond [(eq_attr "alternative" "3,4") + (cond [(eq_attr "alternative" "0,1,2") + (const_string "DF") + (eq_attr "alternative" "3,4") (const_string "SI") + + /* For SSE1, we have many fewer alternatives. */ + (eq (symbol_ref "TARGET_SSE2") (const_int 0)) + (cond [(eq_attr "alternative" "5,6") + (const_string "V4SF") + ] + (const_string "V2SF")) + /* xorps is one byte shorter. */ (eq_attr "alternative" "5") (cond [(ne (symbol_ref "optimize_size") @@ -2662,32 +2649,36 @@ (const_string "V4SF") (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR") (const_int 0)) - (const_string "TI")] + (const_string "TI") + ] (const_string "V2DF")) + /* For architectures resolving dependencies on whole SSE registers use APD move to break dependency - chains, otherwise use short move to avoid extra work. + chains, otherwise use short move to avoid extra work. movaps encodes one byte shorter. */ (eq_attr "alternative" "6") (cond - [(ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") - (const_int 0)) - (const_string "V2DF")] + [(ne (symbol_ref "optimize_size") + (const_int 0)) + (const_string "V4SF") + (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY") + (const_int 0)) + (const_string "V2DF") + ] (const_string "DF")) /* For architectures resolving dependencies on register parts we may avoid extra work to zero out upper part of register. */ (eq_attr "alternative" "7") (if_then_else - (ne (symbol_ref "TARGET_SSE_PARTIAL_REGS") + (ne (symbol_ref "TARGET_SSE_SPLIT_REGS") (const_int 0)) - (const_string "V2DF") - (const_string "DF"))] - (const_string "DF")))]) + (const_string "V1DF") + (const_string "DF")) + ] + (const_string "DF")))]) (define_split [(set (match_operand:DF 0 "nonimmediate_operand" "") @@ -2704,11 +2695,11 @@ "ix86_split_long_move (operands); DONE;") (define_insn "*swapdf" - [(set (match_operand:DF 0 "register_operand" "+f") - (match_operand:DF 1 "register_operand" "+f")) + [(set (match_operand:DF 0 "fp_register_operand" "+f") + (match_operand:DF 1 "fp_register_operand" "+f")) (set (match_dup 1) (match_dup 0))] - "reload_completed || !TARGET_SSE2" + "reload_completed || TARGET_80387" { if (STACK_TOP_P (operands[0])) return "fxch\t%1"; @@ -2737,20 +2728,22 @@ "optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") + (set_attr "unit" "i387,*,*") (set_attr "mode" "XF,SI,SI")]) (define_insn "*pushxf_integer" [(set (match_operand:XF 0 "push_operand" "=<,<") - (match_operand:XF 1 "general_no_elim_operand" "f#r,ro#f"))] + (match_operand:XF 1 "general_no_elim_operand" "f,ro"))] "!optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") + (set_attr "unit" "i387,*") (set_attr "mode" "XF,SI")]) (define_split @@ -2767,16 +2760,16 @@ [(set (match_operand:XF 0 "push_operand" "") (match_operand:XF 1 "any_fp_register_operand" ""))] "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) - (set (mem:XF (reg:SI 7)) (match_dup 1))] + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 2))) + (set (mem:XF (reg:SI SP_REG)) (match_dup 1))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split [(set (match_operand:XF 0 "push_operand" "") (match_operand:XF 1 "any_fp_register_operand" ""))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) - (set (mem:XF (reg:DI 7)) (match_dup 1))] + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (match_dup 2))) + (set (mem:XF (reg:DI SP_REG)) (match_dup 1))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") ;; Do not use integer registers when optimizing for size @@ -2792,18 +2785,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: /* There is no non-popping store to memory for XFmode. So if @@ -2818,15 +2800,16 @@ case 3: case 4: return "#"; + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) (define_insn "*movxf_integer" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,m,f#r,r#f,o") - (match_operand:XF 1 "general_operand" "fm#r,f#r,G,roF#f,Fr#f"))] + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,r,o") + (match_operand:XF 1 "general_operand" "fm,f,G,roF,Fr"))] "!optimize_size && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed @@ -2836,18 +2819,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - { - if (REGNO (operands[0]) == FIRST_STACK_REG - && TARGET_USE_FFREEP) - return "ffreep\t%y0"; - return "fstp\t%y0"; - } - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: /* There is no non-popping store to memory for XFmode. So if @@ -2862,8 +2834,10 @@ case 3: case 4: return "#"; + + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) @@ -2920,7 +2894,7 @@ (match_operand:XF 1 "register_operand" "+f")) (set (match_dup 1) (match_dup 0))] - "" + "TARGET_80387" { if (STACK_TOP_P (operands[0])) return "fxch\t%1"; @@ -2929,6 +2903,67 @@ } [(set_attr "type" "fxch") (set_attr "mode" "XF")]) + +(define_expand "movtf" + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "nonimmediate_operand" ""))] + "TARGET_64BIT" +{ + ix86_expand_move (TFmode, operands); + DONE; +}) + +(define_insn "*movtf_internal" + [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o,x,x,xm") + (match_operand:TF 1 "general_operand" "riFo,riF,C,xm,x"))] + "TARGET_64BIT + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" +{ + switch (which_alternative) + { + case 0: + case 1: + return "#"; + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "xorps\t%0, %0"; + else + return "pxor\t%0, %0"; + case 3: + case 4: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movdqa\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "*,*,sselog1,ssemov,ssemov") + (set (attr "mode") + (cond [(eq_attr "alternative" "2,3") + (if_then_else + (ne (symbol_ref "optimize_size") + (const_int 0)) + (const_string "V4SF") + (const_string "TI")) + (eq_attr "alternative" "4") + (if_then_else + (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0)) + (ne (symbol_ref "optimize_size") + (const_int 0))) + (const_string "V4SF") + (const_string "TI"))] + (const_string "DI")))]) + +(define_split + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "general_operand" ""))] + "reload_completed && !SSE_REG_P (operands[0]) + && !SSE_REG_P (operands[1])" + [(const_int 0)] + "ix86_split_long_move (operands); DONE;") ;; Zero extension instructions @@ -2948,7 +2983,7 @@ (define_insn "zero_extendhisi2_and" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size" "#" [(set_attr "type" "alu1") @@ -2957,10 +2992,10 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:HI 1 "register_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && TARGET_ZERO_EXTEND_WITH_AND && !optimize_size" [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 65535))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_insn "*zero_extendhisi2_movzwl" @@ -2975,14 +3010,14 @@ [(parallel [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") (define_insn "*zero_extendqihi2_and" [(set (match_operand:HI 0 "register_operand" "=r,?&q") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size" "#" [(set_attr "type" "alu1") @@ -2991,25 +3026,26 @@ (define_insn "*zero_extendqihi2_movzbw_and" [(set (match_operand:HI 0 "register_operand" "=r,r") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm,0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size" "#" [(set_attr "type" "imovx,alu1") (set_attr "mode" "HI")]) -(define_insn "*zero_extendqihi2_movzbw" +; zero extend to SImode here to avoid partial register stalls +(define_insn "*zero_extendqihi2_movzbl" [(set (match_operand:HI 0 "register_operand" "=r") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))] "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && reload_completed" - "movz{bw|x}\t{%1, %0|%0, %1}" + "movz{bl|x}\t{%1, %k0|%k0, %k1}" [(set_attr "type" "imovx") - (set_attr "mode" "HI")]) + (set_attr "mode" "SI")]) ;; For the movzbw case strip only the clobber (define_split [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" @@ -3021,7 +3057,7 @@ (define_split [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ANY_QI_REG_P (operands[0]) && (TARGET_ZERO_EXTEND_WITH_AND && !optimize_size) @@ -3034,25 +3070,25 @@ (define_split [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "register_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && true_regnum (operands[0]) == true_regnum (operands[1])" [(parallel [(set (match_dup 0) (and:HI (match_dup 0) (const_int 255))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_expand "zero_extendqisi2" [(parallel [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") (define_insn "*zero_extendqisi2_and" [(set (match_operand:SI 0 "register_operand" "=r,?&q") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0,qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size" "#" [(set_attr "type" "alu1") @@ -3061,7 +3097,7 @@ (define_insn "*zero_extendqisi2_movzbw_and" [(set (match_operand:SI 0 "register_operand" "=r,r") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm,0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size" "#" [(set_attr "type" "imovx,alu1") @@ -3079,7 +3115,7 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" @@ -3091,7 +3127,7 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ANY_QI_REG_P (operands[0]) && (ANY_QI_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM) @@ -3105,11 +3141,11 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "register_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && true_regnum (operands[0]) == true_regnum (operands[1])" [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 255))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") ;; %%% Kill me once multi-word ops are sane. @@ -3125,24 +3161,10 @@ ") (define_insn "zero_extendsidi2_32" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o,!?y,!?Y") - (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,rm,r,m,m"))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && !TARGET_INTER_UNIT_MOVES" - "@ - # - # - # - movd\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1}" - [(set_attr "mode" "SI,SI,SI,DI,TI") - (set_attr "type" "multi,multi,multi,mmxmov,ssemov")]) - -(define_insn "*zero_extendsidi2_32_1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o,!?y,!?Y") + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?*o,?*y,?*Y") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,rm,r,rm,rm"))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_INTER_UNIT_MOVES" + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT" "@ # # @@ -3153,21 +3175,9 @@ (set_attr "type" "multi,multi,multi,mmxmov,ssemov")]) (define_insn "zero_extendsidi2_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!?y,!?Y") - (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0,m,m")))] - "TARGET_64BIT && !TARGET_INTER_UNIT_MOVES" - "@ - mov\t{%k1, %k0|%k0, %k1} - # - movd\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1}" - [(set_attr "type" "imovx,imov,mmxmov,ssemov") - (set_attr "mode" "SI,DI,DI,TI")]) - -(define_insn "*zero_extendsidi2_rex64_1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!?y,!*?") + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*y,?*Y") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "rm,0,rm,rm")))] - "TARGET_64BIT && TARGET_INTER_UNIT_MOVES" + "TARGET_64BIT" "@ mov\t{%k1, %k0|%k0, %k1} # @@ -3186,7 +3196,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && reload_completed && true_regnum (operands[0]) == true_regnum (operands[1])" [(set (match_dup 4) (const_int 0))] @@ -3195,7 +3205,7 @@ (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && reload_completed && !SSE_REG_P (operands[0]) && !MMX_REG_P (operands[0])" [(set (match_dup 3) (match_dup 1)) @@ -3203,31 +3213,27 @@ "split_di (&operands[0], 1, &operands[3], &operands[4]);") (define_insn "zero_extendhidi2" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "r,m")))] + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "rm")))] "TARGET_64BIT" - "@ - movz{wl|x}\t{%1, %k0|%k0, %1} - movz{wq|x}\t{%1, %0|%0, %1}" + "movz{wl|x}\t{%1, %k0|%k0, %1}" [(set_attr "type" "imovx") - (set_attr "mode" "SI,DI")]) + (set_attr "mode" "DI")]) (define_insn "zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "Q,m")))] + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "rm")))] "TARGET_64BIT" - "@ - movz{bl|x}\t{%1, %k0|%k0, %1} - movz{bq|x}\t{%1, %0|%0, %1}" + "movz{bl|x}\t{%1, %k0|%k0, %1}" [(set_attr "type" "imovx") - (set_attr "mode" "SI,DI")]) + (set_attr "mode" "DI")]) ;; Sign extension instructions (define_expand "extendsidi2" [(parallel [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (match_scratch:SI 2 ""))])] "" { @@ -3241,7 +3247,7 @@ (define_insn "*extendsidi2_1" [(set (match_operand:DI 0 "nonimmediate_operand" "=*A,r,?r,?*o") (sign_extend:DI (match_operand:SI 1 "register_operand" "0,0,r,r"))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (match_scratch:SI 2 "=X,X,X,&r"))] "!TARGET_64BIT" "#") @@ -3278,14 +3284,14 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (match_operand:SI 2 "register_operand" ""))] "(reload_completed && dead_or_set_p (insn, operands[1]) && !reg_mentioned_p (operands[1], operands[0]))" [(set (match_dup 3) (match_dup 1)) (parallel [(set (match_dup 1) (ashiftrt:SI (match_dup 1) (const_int 31))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 4) (match_dup 1))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") @@ -3293,7 +3299,7 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (match_operand:SI 2 "register_operand" ""))] "reload_completed" [(const_int 0)] @@ -3323,7 +3329,7 @@ (define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (match_scratch:SI 2 ""))] "reload_completed" [(const_int 0)] @@ -3460,15 +3466,15 @@ [(set (match_operand:DF 0 "push_operand" "") (float_extend:DF (match_operand:SF 1 "fp_register_operand" "")))] "!TARGET_64BIT" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -8))) - (set (mem:DF (reg:SI 7)) (float_extend:DF (match_dup 1)))]) + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + (set (mem:DF (reg:SI SP_REG)) (float_extend:DF (match_dup 1)))]) (define_split [(set (match_operand:DF 0 "push_operand" "") (float_extend:DF (match_operand:SF 1 "fp_register_operand" "")))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -8))) - (set (mem:DF (reg:DI 7)) (float_extend:DF (match_dup 1)))]) + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) + (set (mem:DF (reg:DI SP_REG)) (float_extend:DF (match_dup 1)))]) (define_insn "*dummy_extendsfxf2" [(set (match_operand:XF 0 "push_operand" "=<") @@ -3480,89 +3486,117 @@ [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))] "" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) - (set (mem:XF (reg:SI 7)) (float_extend:XF (match_dup 1)))] + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 2))) + (set (mem:XF (reg:SI SP_REG)) (float_extend:XF (match_dup 1)))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) - (set (mem:DF (reg:DI 7)) (float_extend:XF (match_dup 1)))] + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (match_dup 2))) + (set (mem:DF (reg:DI SP_REG)) (float_extend:XF (match_dup 1)))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))] "" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2))) - (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))] + [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_dup 2))) + (set (mem:DF (reg:SI SP_REG)) (float_extend:XF (match_dup 1)))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_split [(set (match_operand:XF 0 "push_operand" "") (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))] "TARGET_64BIT" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2))) - (set (mem:XF (reg:DI 7)) (float_extend:XF (match_dup 1)))] + [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (match_dup 2))) + (set (mem:XF (reg:DI SP_REG)) (float_extend:XF (match_dup 1)))] "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);") (define_expand "extendsfdf2" [(set (match_operand:DF 0 "nonimmediate_operand" "") (float_extend:DF (match_operand:SF 1 "general_operand" "")))] - "TARGET_80387 || TARGET_SSE2" + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" { /* ??? Needed for compress_float_constant since all fp constants are LEGITIMATE_CONSTANT_P. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = validize_mem (force_const_mem (SFmode, operands[1])); + { + if ((!TARGET_SSE2 || TARGET_MIX_SSE_I387) + && standard_80387_constant_p (operands[1]) > 0) + { + operands[1] = simplify_const_unary_operation + (FLOAT_EXTEND, DFmode, operands[1], SFmode); + emit_move_insn_1 (operands[0], operands[1]); + DONE; + } + operands[1] = validize_mem (force_const_mem (SFmode, operands[1])); + } if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) operands[1] = force_reg (SFmode, operands[1]); }) -(define_insn "*extendsfdf2_1" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Y,mf#Y,Y#f") - (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm#Y,f#Y,mY#f")))] - "(TARGET_80387 || TARGET_SSE2) +(define_insn "*extendsfdf2_mixed" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,m,Y") + (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,f,mY")))] + "TARGET_SSE2 && TARGET_MIX_SSE_I387 && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" { switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) return "fstp%z0\t%y0"; - else return "fst%z0\t%y0"; + case 2: return "cvtss2sd\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,ssecvt") (set_attr "mode" "SF,XF,DF")]) -(define_insn "*extendsfdf2_1_sse_only" - [(set (match_operand:DF 0 "register_operand" "=Y") +(define_insn "*extendsfdf2_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=Y") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "mY")))] - "!TARGET_80387 && TARGET_SSE2 + "TARGET_SSE2 && TARGET_SSE_MATH && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "cvtss2sd\t{%1, %0|%0, %1}" [(set_attr "type" "ssecvt") (set_attr "mode" "DF")]) +(define_insn "*extendsfdf2_i387" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,m") + (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] + "TARGET_80387 + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" +{ + switch (which_alternative) + { + case 0: + return output_387_reg_move (insn, operands); + + case 1: + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; + + default: + gcc_unreachable (); + } +} + [(set_attr "type" "fmov") + (set_attr "mode" "SF,XF")]) + (define_expand "extendsfxf2" [(set (match_operand:XF 0 "nonimmediate_operand" "") (float_extend:XF (match_operand:SF 1 "general_operand" "")))] @@ -3571,12 +3605,21 @@ /* ??? Needed for compress_float_constant since all fp constants are LEGITIMATE_CONSTANT_P. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = validize_mem (force_const_mem (SFmode, operands[1])); + { + if (standard_80387_constant_p (operands[1]) > 0) + { + operands[1] = simplify_const_unary_operation + (FLOAT_EXTEND, XFmode, operands[1], SFmode); + emit_move_insn_1 (operands[0], operands[1]); + DONE; + } + operands[1] = validize_mem (force_const_mem (SFmode, operands[1])); + } if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) operands[1] = force_reg (SFmode, operands[1]); }) -(define_insn "*extendsfxf2_1" +(define_insn "*extendsfxf2_i387" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] "TARGET_80387 @@ -3585,24 +3628,18 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: /* There is no non-popping store to memory for XFmode. So if we need one, follow the store with a load. */ - if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0\n\tfld%z0\t%y0"; - else + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) return "fstp%z0\t%y0"; + else + return "fstp%z0\t%y0\n\tfld%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3616,12 +3653,21 @@ /* ??? Needed for compress_float_constant since all fp constants are LEGITIMATE_CONSTANT_P. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = validize_mem (force_const_mem (DFmode, operands[1])); + { + if (standard_80387_constant_p (operands[1]) > 0) + { + operands[1] = simplify_const_unary_operation + (FLOAT_EXTEND, XFmode, operands[1], DFmode); + emit_move_insn_1 (operands[0], operands[1]); + DONE; + } + operands[1] = validize_mem (force_const_mem (DFmode, operands[1])); + } if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) operands[1] = force_reg (DFmode, operands[1]); }) -(define_insn "*extenddfxf2_1" +(define_insn "*extenddfxf2_i387" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))] "TARGET_80387 @@ -3630,13 +3676,7 @@ switch (which_alternative) { case 0: - if (REG_P (operands[1]) - && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp\t%y0"; - else if (STACK_TOP_P (operands[0])) - return "fld%z1\t%y1"; - else - return "fst\t%y0"; + return output_387_reg_move (insn, operands); case 1: /* There is no non-popping store to memory for XFmode. So if @@ -3647,7 +3687,7 @@ return "fstp%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3659,28 +3699,40 @@ ;; insn. So we pretend we can output to a reg in order to get better ;; register preferencing, but we really use a stack slot. +;; Conversion from DFmode to SFmode. + (define_expand "truncdfsf2" - [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") - (float_truncate:SF - (match_operand:DF 1 "register_operand" ""))) - (clobber (match_dup 2))])] - "TARGET_80387 || TARGET_SSE2" - " - if (TARGET_80387) - operands[2] = assign_386_stack_local (SFmode, 0); - else - { - emit_insn (gen_truncdfsf2_sse_only (operands[0], operands[1])); - DONE; - } -") - -(define_insn "*truncdfsf2_1" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf") + [(set (match_operand:SF 0 "nonimmediate_operand" "") (float_truncate:SF - (match_operand:DF 1 "register_operand" "f,f,f,f"))) - (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] - "TARGET_80387 && !TARGET_SSE2" + (match_operand:DF 1 "nonimmediate_operand" "")))] + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" +{ + if (MEM_P (operands[0]) && MEM_P (operands[1])) + operands[1] = force_reg (DFmode, operands[1]); + + if (TARGET_SSE2 && TARGET_SSE_MATH && !TARGET_MIX_SSE_I387) + ; + else if (flag_unsafe_math_optimizations) + ; + else + { + rtx temp = assign_386_stack_local (SFmode, SLOT_TEMP); + emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp)); + DONE; + } +}) + +(define_expand "truncdfsf2_with_temp" + [(parallel [(set (match_operand:SF 0 "" "") + (float_truncate:SF (match_operand:DF 1 "" ""))) + (clobber (match_operand:SF 2 "" ""))])] + "") + +(define_insn "*truncdfsf_fast_mixed" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,f,Y") + (float_truncate:SF + (match_operand:DF 1 "nonimmediate_operand" "f ,f,Ym")))] + "TARGET_SSE2 && TARGET_MIX_SSE_I387 && flag_unsafe_math_optimizations" { switch (which_alternative) { @@ -3689,112 +3741,94 @@ return "fstp%z0\t%y0"; else return "fst%z0\t%y0"; - default: - abort (); - } -} - [(set_attr "type" "fmov,multi,multi,multi") - (set_attr "mode" "SF,SF,SF,SF")]) - -(define_insn "*truncdfsf2_1_sse" - [(set (match_operand:SF 0 "nonimmediate_operand" "=*!m#fxr,?f#xr,?r#fx,?x#fr,Y#fr") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "f#Y,f#Y,f#Y,f#Y,mY#f"))) - (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m,X"))] - "TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS" -{ - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - case 4: - return "#"; - default: - abort (); - } -} - [(set_attr "type" "fmov,multi,multi,multi,ssecvt") - (set_attr "mode" "SF,SF,SF,SF,DF")]) - -(define_insn "*truncdfsf2_1_sse_nooverlap" - [(set (match_operand:SF 0 "nonimmediate_operand" "=*!m,?f#rx,?r#fx,?x#rf,&Y") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "f#Y,f#Y,f#Y,f#Y,mY#f"))) - (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m,X"))] - "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS" -{ - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - case 4: - return "#"; - default: - abort (); - } -} - [(set_attr "type" "fmov,multi,multi,multi,ssecvt") - (set_attr "mode" "SF,SF,SF,SF,DF")]) - -(define_insn "*truncdfsf2_2" - [(set (match_operand:SF 0 "nonimmediate_operand" "=Y,Y,!m") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "Y,mY,f#Y")))] - "TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: case 1: - return "cvtsd2ss\t{%1, %0|%0, %1}"; + return output_387_reg_move (insn, operands); case 2: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; + return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } - [(set_attr "type" "ssecvt,ssecvt,fmov") - (set_attr "athlon_decode" "vector,double,*") - (set_attr "mode" "SF,SF,SF")]) + [(set_attr "type" "fmov,fmov,ssecvt") + (set_attr "mode" "SF")]) -(define_insn "*truncdfsf2_2_nooverlap" - [(set (match_operand:SF 0 "nonimmediate_operand" "=&Y,!m") +;; Yes, this one doesn't depend on flag_unsafe_math_optimizations, +;; because nothing we do here is unsafe. +(define_insn "*truncdfsf_fast_sse" + [(set (match_operand:SF 0 "nonimmediate_operand" "=Y") + (float_truncate:SF + (match_operand:DF 1 "nonimmediate_operand" "Ym")))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "cvtsd2ss\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "SF")]) + +(define_insn "*truncdfsf_fast_i387" + [(set (match_operand:SF 0 "nonimmediate_operand" "=fm") + (float_truncate:SF + (match_operand:DF 1 "nonimmediate_operand" "f")))] + "TARGET_80387 && flag_unsafe_math_optimizations" + "* return output_387_reg_move (insn, operands);" + [(set_attr "type" "fmov") + (set_attr "mode" "SF")]) + +(define_insn "*truncdfsf_mixed" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?fx*r,Y") (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "mY,f")))] - "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + (match_operand:DF 1 "nonimmediate_operand" "f ,f ,Ym"))) + (clobber (match_operand:SF 2 "memory_operand" "=X,m ,X"))] + "TARGET_MIX_SSE_I387" { switch (which_alternative) { case 0: - return "#"; - case 1: if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) return "fstp%z0\t%y0"; else return "fst%z0\t%y0"; + case 1: + return "#"; + case 2: + return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } - [(set_attr "type" "ssecvt,fmov") - (set_attr "mode" "DF,SF")]) + [(set_attr "type" "fmov,multi,ssecvt") + (set_attr "unit" "*,i387,*") + (set_attr "mode" "SF")]) -(define_insn "*truncdfsf2_3" +(define_insn "*truncdfsf_i387" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?fx*r") + (float_truncate:SF + (match_operand:DF 1 "nonimmediate_operand" "f,f"))) + (clobber (match_operand:SF 2 "memory_operand" "=X,m"))] + "TARGET_80387" +{ + switch (which_alternative) + { + case 0: + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; + case 1: + return "#"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "fmov,multi") + (set_attr "unit" "*,i387") + (set_attr "mode" "SF")]) + +(define_insn "*truncdfsf2_i387_1" [(set (match_operand:SF 0 "memory_operand" "=m") (float_truncate:SF - (match_operand:DF 1 "register_operand" "f")))] - "TARGET_80387" + (match_operand:DF 1 "register_operand" "f")))] + "TARGET_80387 + && !(TARGET_SSE2 && TARGET_SSE_MATH) + && !TARGET_MIX_SSE_I387" { if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) return "fstp%z0\t%y0"; @@ -3804,94 +3838,19 @@ [(set_attr "type" "fmov") (set_attr "mode" "SF")]) -(define_insn "truncdfsf2_sse_only" - [(set (match_operand:SF 0 "register_operand" "=Y,Y") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "Y,mY")))] - "!TARGET_80387 && TARGET_SSE2 && !TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS" - "cvtsd2ss\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "athlon_decode" "vector,double") - (set_attr "mode" "SF")]) - -(define_insn "*truncdfsf2_sse_only_nooverlap" - [(set (match_operand:SF 0 "register_operand" "=&Y") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "mY")))] - "!TARGET_80387 && TARGET_SSE2 && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS" - "#" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) - -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (float_truncate:SF - (match_operand:DF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387" - [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] - "") - -; Avoid possible reformatting penalty on the destination by first -; zeroing it out -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" ""))) - (clobber (match_operand 2 "" ""))] - "TARGET_80387 && reload_completed - && SSE_REG_P (operands[0]) - && !STACK_REG_P (operands[1])" - [(const_int 0)] -{ - rtx src, dest; - if (!TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS) - emit_insn (gen_truncdfsf2_sse_only (operands[0], operands[1])); - else - { - dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - src = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); - /* simplify_gen_subreg refuses to widen memory references. */ - if (GET_CODE (src) == SUBREG) - alter_subreg (&src); - if (reg_overlap_mentioned_p (operands[0], operands[1])) - abort (); - emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode))); - emit_insn (gen_cvtsd2ss (dest, dest, src)); - } - DONE; -}) - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float_truncate:SF - (match_operand:DF 1 "nonimmediate_operand" "")))] - "TARGET_80387 && reload_completed - && SSE_REG_P (operands[0]) && TARGET_SSE_PARTIAL_REGS_FOR_CVTSD2SS" - [(const_int 0)] -{ - rtx src, dest; - dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - src = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); - /* simplify_gen_subreg refuses to widen memory references. */ - if (GET_CODE (src) == SUBREG) - alter_subreg (&src); - if (reg_overlap_mentioned_p (operands[0], operands[1])) - abort (); - emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode))); - emit_insn (gen_cvtsd2ss (dest, dest, src)); - DONE; -}) - (define_split [(set (match_operand:SF 0 "register_operand" "") (float_truncate:SF (match_operand:DF 1 "fp_register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387 && reload_completed" - [(set (match_dup 2) (float_truncate:SF (match_dup 1))) + (clobber (match_operand 2 "" ""))] + "reload_completed" + [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] - "") +{ + operands[1] = gen_rtx_REG (SFmode, true_regnum (operands[1])); +}) + +;; Conversion from XFmode to SFmode. (define_expand "truncxfsf2" [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") @@ -3899,30 +3858,64 @@ (match_operand:XF 1 "register_operand" ""))) (clobber (match_dup 2))])] "TARGET_80387" - "operands[2] = assign_386_stack_local (SFmode, 0);") +{ + if (flag_unsafe_math_optimizations) + { + rtx reg = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (SFmode); + emit_insn (gen_truncxfsf2_i387_noop (reg, operands[1])); + if (reg != operands[0]) + emit_move_insn (operands[0], reg); + DONE; + } + else + operands[2] = assign_386_stack_local (SFmode, SLOT_TEMP); +}) -(define_insn "*truncxfsf2_1" - [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf") +(define_insn "*truncxfsf2_mixed" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?r,?x") (float_truncate:SF (match_operand:XF 1 "register_operand" "f,f,f,f"))) (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] - "TARGET_80387" + "TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") + (set_attr "unit" "*,i387,i387,i387") (set_attr "mode" "SF")]) -(define_insn "*truncxfsf2_2" +(define_insn "truncxfsf2_i387_noop" + [(set (match_operand:SF 0 "register_operand" "=f") + (float_truncate:SF (match_operand:XF 1 "register_operand" "f")))] + "TARGET_80387 && flag_unsafe_math_optimizations" +{ + return output_387_reg_move (insn, operands); +} + [(set_attr "type" "fmov") + (set_attr "mode" "SF")]) + +(define_insn "*truncxfsf2_i387" + [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?r") + (float_truncate:SF + (match_operand:XF 1 "register_operand" "f,f,f"))) + (clobber (match_operand:SF 2 "memory_operand" "=X,m,m"))] + "TARGET_80387" +{ + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; +} + [(set_attr "type" "fmov,multi,multi") + (set_attr "unit" "*,i387,i387") + (set_attr "mode" "SF")]) + +(define_insn "*truncxfsf2_i387_1" [(set (match_operand:SF 0 "memory_operand" "=m") (float_truncate:SF (match_operand:XF 1 "register_operand" "f")))] @@ -3936,15 +3929,6 @@ [(set_attr "type" "fmov") (set_attr "mode" "SF")]) -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (float_truncate:SF - (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:SF 2 "memory_operand" ""))] - "TARGET_80387" - [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] - "") - (define_split [(set (match_operand:SF 0 "register_operand" "") (float_truncate:SF @@ -3955,37 +3939,81 @@ (set (match_dup 0) (match_dup 2))] "") +(define_split + [(set (match_operand:SF 0 "memory_operand" "") + (float_truncate:SF + (match_operand:XF 1 "register_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" ""))] + "TARGET_80387" + [(set (match_dup 0) (float_truncate:SF (match_dup 1)))] + "") + +;; Conversion from XFmode to DFmode. + (define_expand "truncxfdf2" [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") (float_truncate:DF (match_operand:XF 1 "register_operand" ""))) (clobber (match_dup 2))])] "TARGET_80387" - "operands[2] = assign_386_stack_local (DFmode, 0);") +{ + if (flag_unsafe_math_optimizations) + { + rtx reg = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (DFmode); + emit_insn (gen_truncxfdf2_i387_noop (reg, operands[1])); + if (reg != operands[0]) + emit_move_insn (operands[0], reg); + DONE; + } + else + operands[2] = assign_386_stack_local (DFmode, SLOT_TEMP); +}) -(define_insn "*truncxfdf2_1" - [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f#rY,?r#fY,?Y#rf") +(define_insn "*truncxfdf2_mixed" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f,?r,?Y") (float_truncate:DF (match_operand:XF 1 "register_operand" "f,f,f,f"))) (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))] - "TARGET_80387" + "TARGET_SSE2 && TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } - abort (); + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") + (set_attr "unit" "*,i387,i387,i387") (set_attr "mode" "DF")]) -(define_insn "*truncxfdf2_2" +(define_insn "truncxfdf2_i387_noop" + [(set (match_operand:DF 0 "register_operand" "=f") + (float_truncate:DF (match_operand:XF 1 "register_operand" "f")))] + "TARGET_80387 && flag_unsafe_math_optimizations" +{ + return output_387_reg_move (insn, operands); +} + [(set_attr "type" "fmov") + (set_attr "mode" "DF")]) + +(define_insn "*truncxfdf2_i387" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f,?r") + (float_truncate:DF + (match_operand:XF 1 "register_operand" "f,f,f"))) + (clobber (match_operand:DF 2 "memory_operand" "=X,m,m"))] + "TARGET_80387" +{ + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; +} + [(set_attr "type" "fmov,multi,multi") + (set_attr "unit" "*,i387,i387") + (set_attr "mode" "DF")]) + +(define_insn "*truncxfdf2_i387_1" [(set (match_operand:DF 0 "memory_operand" "=m") (float_truncate:DF (match_operand:XF 1 "register_operand" "f")))] @@ -3999,15 +4027,6 @@ [(set_attr "type" "fmov") (set_attr "mode" "DF")]) -(define_split - [(set (match_operand:DF 0 "memory_operand" "") - (float_truncate:DF - (match_operand:XF 1 "register_operand" ""))) - (clobber (match_operand:DF 2 "memory_operand" ""))] - "TARGET_80387" - [(set (match_dup 0) (float_truncate:DF (match_dup 1)))] - "") - (define_split [(set (match_operand:DF 0 "register_operand" "") (float_truncate:DF @@ -4018,100 +4037,301 @@ (set (match_dup 0) (match_dup 2))] "") +(define_split + [(set (match_operand:DF 0 "memory_operand" "") + (float_truncate:DF + (match_operand:XF 1 "register_operand" ""))) + (clobber (match_operand:DF 2 "memory_operand" ""))] + "TARGET_80387" + [(set (match_dup 0) (float_truncate:DF (match_dup 1)))] + "") -;; %%% Break up all these bad boys. - ;; Signed conversion to DImode. (define_expand "fix_truncxfdi2" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (fix:DI (match_operand:XF 1 "register_operand" "")))] + [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "") + (fix:DI (match_operand:XF 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] "TARGET_80387" +{ + if (TARGET_FISTTP) + { + emit_insn (gen_fix_truncdi_fisttp_i387_1 (operands[0], operands[1])); + DONE; + } +}) + +(define_expand "fix_truncdi2" + [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "") + (fix:DI (match_operand:SSEMODEF 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_80387 || (TARGET_64BIT && SSE_FLOAT_MODE_P (mode))" +{ + if (TARGET_FISTTP + && !(TARGET_64BIT && SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)) + { + emit_insn (gen_fix_truncdi_fisttp_i387_1 (operands[0], operands[1])); + DONE; + } + if (TARGET_64BIT && SSE_FLOAT_MODE_P (mode)) + { + rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (DImode); + emit_insn (gen_fix_truncdi_sse (out, operands[1])); + if (out != operands[0]) + emit_move_insn (operands[0], out); + DONE; + } +}) + +;; Signed conversion to SImode. + +(define_expand "fix_truncxfsi2" + [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") + (fix:SI (match_operand:XF 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_80387" +{ + if (TARGET_FISTTP) + { + emit_insn (gen_fix_truncsi_fisttp_i387_1 (operands[0], operands[1])); + DONE; + } +}) + +(define_expand "fix_truncsi2" + [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") + (fix:SI (match_operand:SSEMODEF 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_80387 || SSE_FLOAT_MODE_P (mode)" +{ + if (TARGET_FISTTP + && !(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)) + { + emit_insn (gen_fix_truncsi_fisttp_i387_1 (operands[0], operands[1])); + DONE; + } + if (SSE_FLOAT_MODE_P (mode)) + { + rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (SImode); + emit_insn (gen_fix_truncsi_sse (out, operands[1])); + if (out != operands[0]) + emit_move_insn (operands[0], out); + DONE; + } +}) + +;; Signed conversion to HImode. + +(define_expand "fix_trunchi2" + [(parallel [(set (match_operand:HI 0 "nonimmediate_operand" "") + (fix:HI (match_operand:X87MODEF 1 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_80387 + && !(SSE_FLOAT_MODE_P (mode) && (!TARGET_FISTTP || TARGET_SSE_MATH))" +{ + if (TARGET_FISTTP) + { + emit_insn (gen_fix_trunchi_fisttp_i387_1 (operands[0], operands[1])); + DONE; + } +}) + +;; When SSE is available, it is always faster to use it! +(define_insn "fix_truncsfdi_sse" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (fix:DI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))] + "TARGET_64BIT && TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)" + "cvttss2si{q}\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "SF") + (set_attr "athlon_decode" "double,vector")]) + +(define_insn "fix_truncdfdi_sse" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (fix:DI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))] + "TARGET_64BIT && TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)" + "cvttsd2si{q}\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DF") + (set_attr "athlon_decode" "double,vector")]) + +(define_insn "fix_truncsfsi_sse" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (fix:SI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))] + "TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)" + "cvttss2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DF") + (set_attr "athlon_decode" "double,vector")]) + +(define_insn "fix_truncdfsi_sse" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (fix:SI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))] + "TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)" + "cvttsd2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DF") + (set_attr "athlon_decode" "double,vector")]) + +;; Avoid vector decoded forms of the instruction. +(define_peephole2 + [(match_scratch:DF 2 "Y") + (set (match_operand:SSEMODEI24 0 "register_operand" "") + (fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))] + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size" + [(set (match_dup 2) (match_dup 1)) + (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))] "") -(define_expand "fix_truncdfdi2" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (fix:DI (match_operand:DF 1 "register_operand" "")))] - "TARGET_80387 || (TARGET_SSE2 && TARGET_64BIT)" -{ - if (TARGET_64BIT && TARGET_SSE2) - { - rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (DImode); - emit_insn (gen_fix_truncdfdi_sse (out, operands[1])); - if (out != operands[0]) - emit_move_insn (operands[0], out); - DONE; - } -}) +(define_peephole2 + [(match_scratch:SF 2 "x") + (set (match_operand:SSEMODEI24 0 "register_operand" "") + (fix:SSEMODEI24 (match_operand:SF 1 "memory_operand" "")))] + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size" + [(set (match_dup 2) (match_dup 1)) + (set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))] + "") -(define_expand "fix_truncsfdi2" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (fix:DI (match_operand:SF 1 "register_operand" "")))] - "TARGET_80387 || (TARGET_SSE && TARGET_64BIT)" -{ - if (TARGET_SSE && TARGET_64BIT) - { - rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (DImode); - emit_insn (gen_fix_truncsfdi_sse (out, operands[1])); - if (out != operands[0]) - emit_move_insn (operands[0], out); - DONE; - } -}) - -;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description -;; of the machinery. -(define_insn_and_split "*fix_truncdi_1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") - (fix:DI (match_operand 1 "register_operand" "f,f")))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !reload_completed && !reload_in_progress - && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)" +(define_insn_and_split "fix_trunc_fisttp_i387_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (fix:X87MODEI (match_operand 1 "register_operand" "f,f")))] + "TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) + && (TARGET_64BIT || mode != DImode)) + && TARGET_SSE_MATH) + && !(reload_completed || reload_in_progress)" "#" "&& 1" [(const_int 0)] { - ix86_optimize_mode_switching = 1; - operands[2] = assign_386_stack_local (HImode, 1); - operands[3] = assign_386_stack_local (HImode, 2); if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fix_truncdi_memory (operands[0], operands[1], - operands[2], operands[3])); + emit_insn (gen_fix_trunc_i387_fisttp (operands[0], operands[1])); else { - operands[4] = assign_386_stack_local (DImode, 0); - emit_insn (gen_fix_truncdi_nomemory (operands[0], operands[1], - operands[2], operands[3], - operands[4])); + operands[2] = assign_386_stack_local (mode, SLOT_TEMP); + emit_insn (gen_fix_trunc_i387_fisttp_with_temp (operands[0], + operands[1], + operands[2])); + } + DONE; +} + [(set_attr "type" "fisttp") + (set_attr "mode" "")]) + +(define_insn "fix_trunc_i387_fisttp" + [(set (match_operand:X87MODEI 0 "memory_operand" "=m") + (fix:X87MODEI (match_operand 1 "register_operand" "f"))) + (clobber (match_scratch:XF 2 "=&1f"))] + "TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) + && (TARGET_64BIT || mode != DImode)) + && TARGET_SSE_MATH)" + "* return output_fix_trunc (insn, operands, 1);" + [(set_attr "type" "fisttp") + (set_attr "mode" "")]) + +(define_insn "fix_trunc_i387_fisttp_with_temp" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (fix:X87MODEI (match_operand 1 "register_operand" "f,f"))) + (clobber (match_operand:X87MODEI 2 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 3 "=&1f,&1f"))] + "TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) + && (TARGET_64BIT || mode != DImode)) + && TARGET_SSE_MATH)" + "#" + [(set_attr "type" "fisttp") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI 0 "register_operand" "") + (fix:X87MODEI (match_operand 1 "register_operand" ""))) + (clobber (match_operand:X87MODEI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 2) (fix:X87MODEI (match_dup 1))) + (clobber (match_dup 3))]) + (set (match_dup 0) (match_dup 2))] + "") + +(define_split + [(set (match_operand:X87MODEI 0 "memory_operand" "") + (fix:X87MODEI (match_operand 1 "register_operand" ""))) + (clobber (match_operand:X87MODEI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (fix:X87MODEI (match_dup 1))) + (clobber (match_dup 3))])] + "") + +;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description +;; of the machinery. Please note the clobber of FLAGS_REG. In i387 control +;; word calculation (inserted by LCM in mode switching pass) a FLAGS_REG +;; clobbering insns can be used. Look at emit_i387_cw_initialization () +;; function in i386.c. +(define_insn_and_split "*fix_trunc_i387_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (fix:X87MODEI (match_operand 1 "register_operand" "f,f"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_80387 && !TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !(SSE_FLOAT_MODE_P (GET_MODE (operands[1])) + && (TARGET_64BIT || mode != DImode)) + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_TRUNC] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_TRUNC); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fix_trunc_i387 (operands[0], operands[1], + operands[2], operands[3])); + else + { + operands[4] = assign_386_stack_local (mode, SLOT_TEMP); + emit_insn (gen_fix_trunc_i387_with_temp (operands[0], operands[1], + operands[2], operands[3], + operands[4])); } DONE; } [(set_attr "type" "fistp") + (set_attr "i387_cw" "trunc") + (set_attr "mode" "")]) + +(define_insn "fix_truncdi_i387" + [(set (match_operand:DI 0 "memory_operand" "=m") + (fix:DI (match_operand 1 "register_operand" "f"))) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m")) + (clobber (match_scratch:XF 4 "=&1f"))] + "TARGET_80387 && !TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) -(define_insn "fix_truncdi_nomemory" +(define_insn "fix_truncdi_i387_with_temp" [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") (fix:DI (match_operand 1 "register_operand" "f,f"))) (use (match_operand:HI 2 "memory_operand" "m,m")) (use (match_operand:HI 3 "memory_operand" "m,m")) (clobber (match_operand:DI 4 "memory_operand" "=m,m")) - (clobber (match_scratch:DF 5 "=&1f,&1f"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)" + (clobber (match_scratch:XF 5 "=&1f,&1f"))] + "TARGET_80387 && !TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))" "#" [(set_attr "type" "fistp") - (set_attr "mode" "DI")]) - -(define_insn "fix_truncdi_memory" - [(set (match_operand:DI 0 "memory_operand" "=m") - (fix:DI (match_operand 1 "register_operand" "f"))) - (use (match_operand:HI 2 "memory_operand" "m")) - (use (match_operand:HI 3 "memory_operand" "m")) - (clobber (match_scratch:DF 4 "=&1f"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)" - "* operands[5] = operands[4]; return output_fix_trunc (insn, operands);" - [(set_attr "type" "fistp") + (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) (define_split @@ -4143,320 +4363,76 @@ (clobber (match_dup 5))])] "") -;; When SSE available, it is always faster to use it! -(define_insn "fix_truncsfdi_sse" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (fix:DI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))] - "TARGET_64BIT && TARGET_SSE" - "cvttss2si{q}\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "SF") - (set_attr "athlon_decode" "double,vector")]) - -;; Avoid vector decoded form of the instruction. -(define_peephole2 - [(match_scratch:SF 2 "x") - (set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:SF 1 "memory_operand" "")))] - "TARGET_K8 && !optimize_size" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:DI (match_dup 2)))] - "") - -(define_insn "fix_truncdfdi_sse" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (fix:DI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))] - "TARGET_64BIT && TARGET_SSE2" - "cvttsd2si{q}\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt,sseicvt") - (set_attr "mode" "DF") - (set_attr "athlon_decode" "double,vector")]) - -;; Avoid vector decoded form of the instruction. -(define_peephole2 - [(match_scratch:DF 2 "Y") - (set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:DF 1 "memory_operand" "")))] - "TARGET_K8 && !optimize_size" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:DI (match_dup 2)))] - "") - -;; Signed conversion to SImode. - -(define_expand "fix_truncxfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (fix:SI (match_operand:XF 1 "register_operand" "")))] - "TARGET_80387" - "") - -(define_expand "fix_truncdfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (fix:SI (match_operand:DF 1 "register_operand" "")))] - "TARGET_80387 || TARGET_SSE2" -{ - if (TARGET_SSE2) - { - rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (SImode); - emit_insn (gen_fix_truncdfsi_sse (out, operands[1])); - if (out != operands[0]) - emit_move_insn (operands[0], out); - DONE; - } -}) - -(define_expand "fix_truncsfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (fix:SI (match_operand:SF 1 "register_operand" "")))] - "TARGET_80387 || TARGET_SSE" -{ - if (TARGET_SSE) - { - rtx out = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (SImode); - emit_insn (gen_fix_truncsfsi_sse (out, operands[1])); - if (out != operands[0]) - emit_move_insn (operands[0], out); - DONE; - } -}) - -;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description -;; of the machinery. -(define_insn_and_split "*fix_truncsi_1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?r") - (fix:SI (match_operand 1 "register_operand" "f,f")))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !reload_completed && !reload_in_progress - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "#" - "&& 1" - [(const_int 0)] -{ - ix86_optimize_mode_switching = 1; - operands[2] = assign_386_stack_local (HImode, 1); - operands[3] = assign_386_stack_local (HImode, 2); - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fix_truncsi_memory (operands[0], operands[1], - operands[2], operands[3])); - else - { - operands[4] = assign_386_stack_local (SImode, 0); - emit_insn (gen_fix_truncsi_nomemory (operands[0], operands[1], - operands[2], operands[3], - operands[4])); - } - DONE; -} - [(set_attr "type" "fistp") - (set_attr "mode" "SI")]) - -(define_insn "fix_truncsi_nomemory" - [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?r") - (fix:SI (match_operand 1 "register_operand" "f,f"))) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:SI 4 "memory_operand" "=m,m"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "#" - [(set_attr "type" "fistp") - (set_attr "mode" "SI")]) - -(define_insn "fix_truncsi_memory" - [(set (match_operand:SI 0 "memory_operand" "=m") - (fix:SI (match_operand 1 "register_operand" "f"))) +(define_insn "fix_trunc_i387" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (fix:X87MODEI12 (match_operand 1 "register_operand" "f"))) (use (match_operand:HI 2 "memory_operand" "m")) (use (match_operand:HI 3 "memory_operand" "m"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) + "TARGET_80387 && !TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "* return output_fix_trunc (insn, operands);" + "* return output_fix_trunc (insn, operands, 0);" [(set_attr "type" "fistp") - (set_attr "mode" "SI")]) + (set_attr "i387_cw" "trunc") + (set_attr "mode" "")]) -;; When SSE available, it is always faster to use it! -(define_insn "fix_truncsfsi_sse" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (fix:SI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))] - "TARGET_SSE" - "cvttss2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "DF") - (set_attr "athlon_decode" "double,vector")]) - -;; Avoid vector decoded form of the instruction. -(define_peephole2 - [(match_scratch:SF 2 "x") - (set (match_operand:SI 0 "register_operand" "") - (fix:SI (match_operand:SF 1 "memory_operand" "")))] - "TARGET_K8 && !optimize_size" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:SI (match_dup 2)))] - "") - -(define_insn "fix_truncdfsi_sse" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (fix:SI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))] - "TARGET_SSE2" - "cvttsd2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "DF") - (set_attr "athlon_decode" "double,vector")]) - -;; Avoid vector decoded form of the instruction. -(define_peephole2 - [(match_scratch:DF 2 "Y") - (set (match_operand:SI 0 "register_operand" "") - (fix:SI (match_operand:DF 1 "memory_operand" "")))] - "TARGET_K8 && !optimize_size" - [(set (match_dup 2) (match_dup 1)) - (set (match_dup 0) (fix:SI (match_dup 2)))] - "") +(define_insn "fix_trunc_i387_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (fix:X87MODEI12 (match_operand 1 "register_operand" "f,f"))) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))] + "TARGET_80387 && !TARGET_FISTTP + && FLOAT_MODE_P (GET_MODE (operands[1])) + && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "trunc") + (set_attr "mode" "")]) (define_split - [(set (match_operand:SI 0 "register_operand" "") - (fix:SI (match_operand 1 "register_operand" ""))) + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) (use (match_operand:HI 3 "memory_operand" "")) - (clobber (match_operand:SI 4 "memory_operand" ""))] + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] "reload_completed" - [(parallel [(set (match_dup 4) (fix:SI (match_dup 1))) + [(parallel [(set (match_dup 4) (fix:X87MODEI12 (match_dup 1))) (use (match_dup 2)) (use (match_dup 3))]) (set (match_dup 0) (match_dup 4))] "") (define_split - [(set (match_operand:SI 0 "memory_operand" "") - (fix:SI (match_operand 1 "register_operand" ""))) + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) (use (match_operand:HI 3 "memory_operand" "")) - (clobber (match_operand:SI 4 "memory_operand" ""))] + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] "reload_completed" - [(parallel [(set (match_dup 0) (fix:SI (match_dup 1))) + [(parallel [(set (match_dup 0) (fix:X87MODEI12 (match_dup 1))) (use (match_dup 2)) (use (match_dup 3))])] "") -;; Signed conversion to HImode. - -(define_expand "fix_truncxfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (fix:HI (match_operand:XF 1 "register_operand" "")))] - "TARGET_80387" - "") - -(define_expand "fix_truncdfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (fix:HI (match_operand:DF 1 "register_operand" "")))] - "TARGET_80387 && !TARGET_SSE2" - "") - -(define_expand "fix_truncsfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (fix:HI (match_operand:SF 1 "register_operand" "")))] - "TARGET_80387 && !TARGET_SSE" - "") - -;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description -;; of the machinery. -(define_insn_and_split "*fix_trunchi_1" - [(set (match_operand:HI 0 "nonimmediate_operand" "=m,?r") - (fix:HI (match_operand 1 "register_operand" "f,f")))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !reload_completed && !reload_in_progress - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "#" - "" - [(const_int 0)] -{ - ix86_optimize_mode_switching = 1; - operands[2] = assign_386_stack_local (HImode, 1); - operands[3] = assign_386_stack_local (HImode, 2); - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fix_trunchi_memory (operands[0], operands[1], - operands[2], operands[3])); - else - { - operands[4] = assign_386_stack_local (HImode, 0); - emit_insn (gen_fix_trunchi_nomemory (operands[0], operands[1], - operands[2], operands[3], - operands[4])); - } - DONE; -} - [(set_attr "type" "fistp") - (set_attr "mode" "HI")]) - -(define_insn "fix_trunchi_nomemory" - [(set (match_operand:HI 0 "nonimmediate_operand" "=m,?r") - (fix:HI (match_operand 1 "register_operand" "f,f"))) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:HI 4 "memory_operand" "=m,m"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "#" - [(set_attr "type" "fistp") - (set_attr "mode" "HI")]) - -(define_insn "fix_trunchi_memory" - [(set (match_operand:HI 0 "memory_operand" "=m") - (fix:HI (match_operand 1 "register_operand" "f"))) - (use (match_operand:HI 2 "memory_operand" "m")) - (use (match_operand:HI 3 "memory_operand" "m"))] - "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "* return output_fix_trunc (insn, operands);" - [(set_attr "type" "fistp") - (set_attr "mode" "HI")]) - -(define_split - [(set (match_operand:HI 0 "memory_operand" "") - (fix:HI (match_operand 1 "register_operand" ""))) - (use (match_operand:HI 2 "memory_operand" "")) - (use (match_operand:HI 3 "memory_operand" "")) - (clobber (match_operand:HI 4 "memory_operand" ""))] - "reload_completed" - [(parallel [(set (match_dup 0) (fix:HI (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3))])] - "") - -(define_split - [(set (match_operand:HI 0 "register_operand" "") - (fix:HI (match_operand 1 "register_operand" ""))) - (use (match_operand:HI 2 "memory_operand" "")) - (use (match_operand:HI 3 "memory_operand" "")) - (clobber (match_operand:HI 4 "memory_operand" ""))] - "reload_completed" - [(parallel [(set (match_dup 4) (fix:HI (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (match_dup 4))]) - (set (match_dup 0) (match_dup 4))] - "") - -;; %% Not used yet. (define_insn "x86_fnstcw_1" [(set (match_operand:HI 0 "memory_operand" "=m") - (unspec:HI [(reg:HI 18)] UNSPEC_FSTCW))] + (unspec:HI [(reg:HI FPSR_REG)] UNSPEC_FSTCW))] "TARGET_80387" "fnstcw\t%0" [(set_attr "length" "2") (set_attr "mode" "HI") - (set_attr "unit" "i387") - (set_attr "ppro_uops" "few")]) + (set_attr "unit" "i387")]) (define_insn "x86_fldcw_1" - [(set (reg:HI 18) + [(set (reg:HI FPSR_REG) (unspec:HI [(match_operand:HI 0 "memory_operand" "m")] UNSPEC_FLDCW))] "TARGET_80387" "fldcw\t%0" [(set_attr "length" "2") (set_attr "mode" "HI") (set_attr "unit" "i387") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) ;; Conversion between fixed point and floating point. @@ -4466,9 +4442,9 @@ (define_expand "floathisf2" [(set (match_operand:SF 0 "register_operand" "") (float:SF (match_operand:HI 1 "nonimmediate_operand" "")))] - "TARGET_SSE || TARGET_80387" + "TARGET_80387 || TARGET_SSE_MATH" { - if (TARGET_SSE && TARGET_SSE_MATH) + if (TARGET_SSE_MATH) { emit_insn (gen_floatsisf2 (operands[0], convert_to_mode (SImode, operands[1], 0))); @@ -4476,27 +4452,28 @@ } }) -(define_insn "*floathisf2_1" +(define_insn "*floathisf2_i387" [(set (match_operand:SF 0 "register_operand" "=f,f") - (float:SF (match_operand:HI 1 "nonimmediate_operand" "m,r")))] - "TARGET_80387 && (!TARGET_SSE || !TARGET_SSE_MATH)" + (float:SF (match_operand:HI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "SF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) (define_expand "floatsisf2" [(set (match_operand:SF 0 "register_operand" "") (float:SF (match_operand:SI 1 "nonimmediate_operand" "")))] - "TARGET_SSE || TARGET_80387" + "TARGET_80387 || TARGET_SSE_MATH" "") -(define_insn "*floatsisf2_i387" - [(set (match_operand:SF 0 "register_operand" "=f#x,?f#x,x#f,x#f") +(define_insn "*floatsisf2_mixed" + [(set (match_operand:SF 0 "register_operand" "=f,?f,x,x") (float:SF (match_operand:SI 1 "nonimmediate_operand" "m,r,r,mr")))] - "TARGET_80387 && (!TARGET_SSE || TARGET_MIX_SSE_I387)" + "TARGET_MIX_SSE_I387" "@ fild%z1\t%1 # @@ -4504,56 +4481,42 @@ cvtsi2ss\t{%1, %0|%0, %1}" [(set_attr "type" "fmov,multi,sseicvt,sseicvt") (set_attr "mode" "SF") + (set_attr "unit" "*,i387,*,*") (set_attr "athlon_decode" "*,*,vector,double") (set_attr "fp_int_src" "true")]) (define_insn "*floatsisf2_sse" [(set (match_operand:SF 0 "register_operand" "=x,x") (float:SF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))] - "TARGET_SSE" + "TARGET_SSE_MATH" "cvtsi2ss\t{%1, %0|%0, %1}" [(set_attr "type" "sseicvt") (set_attr "mode" "SF") (set_attr "athlon_decode" "vector,double") (set_attr "fp_int_src" "true")]) -; Avoid possible reformatting penalty on the destination by first -; zeroing it out -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:SI 1 "nonimmediate_operand" "")))] - "TARGET_80387 && reload_completed && TARGET_SSE_PARTIAL_REGS - && SSE_REG_P (operands[0])" - [(const_int 0)] -{ - rtx dest; - dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode))); - emit_insn (gen_cvtsi2ss (dest, dest, operands[1])); - DONE; -}) - -(define_expand "floatdisf2" - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:DI 1 "nonimmediate_operand" "")))] - "(TARGET_64BIT && TARGET_SSE) || TARGET_80387" - "") - -(define_insn "*floatdisf2_i387_only" - [(set (match_operand:SF 0 "register_operand" "=f,?f") - (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,r")))] - "TARGET_80387 && (!TARGET_SSE || !TARGET_64BIT || TARGET_MIX_SSE_I387)" +(define_insn "*floatsisf2_i387" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (float:SF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "SF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) -(define_insn "*floatdisf2_i387" - [(set (match_operand:SF 0 "register_operand" "=f#x,?f#x,x#f,x#f") +(define_expand "floatdisf2" + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:DI 1 "nonimmediate_operand" "")))] + "TARGET_80387 || (TARGET_64BIT && TARGET_SSE_MATH)" + "") + +(define_insn "*floatdisf2_mixed" + [(set (match_operand:SF 0 "register_operand" "=f,?f,x,x") (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,r,r,mr")))] - "TARGET_64BIT && TARGET_80387 && (!TARGET_SSE || TARGET_MIX_SSE_I387)" + "TARGET_64BIT && TARGET_MIX_SSE_I387" "@ fild%z1\t%1 # @@ -4561,41 +4524,38 @@ cvtsi2ss{q}\t{%1, %0|%0, %1}" [(set_attr "type" "fmov,multi,sseicvt,sseicvt") (set_attr "mode" "SF") + (set_attr "unit" "*,i387,*,*") (set_attr "athlon_decode" "*,*,vector,double") (set_attr "fp_int_src" "true")]) (define_insn "*floatdisf2_sse" [(set (match_operand:SF 0 "register_operand" "=x,x") (float:SF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))] - "TARGET_64BIT && TARGET_SSE" + "TARGET_64BIT && TARGET_SSE_MATH" "cvtsi2ss{q}\t{%1, %0|%0, %1}" [(set_attr "type" "sseicvt") (set_attr "mode" "SF") (set_attr "athlon_decode" "vector,double") (set_attr "fp_int_src" "true")]) -; Avoid possible reformatting penalty on the destination by first -; zeroing it out -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:DI 1 "nonimmediate_operand" "")))] - "TARGET_80387 && reload_completed && TARGET_SSE_PARTIAL_REGS - && SSE_REG_P (operands[0])" - [(const_int 0)] -{ - rtx dest; - dest = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - emit_insn (gen_sse_clrv4sf (dest, CONST0_RTX (V4SFmode))); - emit_insn (gen_cvtsi2ssq (dest, dest, operands[1])); - DONE; -}) +(define_insn "*floatdisf2_i387" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387" + "@ + fild%z1\t%1 + #" + [(set_attr "type" "fmov,multi") + (set_attr "mode" "SF") + (set_attr "unit" "*,i387") + (set_attr "fp_int_src" "true")]) (define_expand "floathidf2" [(set (match_operand:DF 0 "register_operand" "") (float:DF (match_operand:HI 1 "nonimmediate_operand" "")))] - "TARGET_SSE2 || TARGET_80387" + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" { - if (TARGET_SSE && TARGET_SSE_MATH) + if (TARGET_SSE2 && TARGET_SSE_MATH) { emit_insn (gen_floatsidf2 (operands[0], convert_to_mode (SImode, operands[1], 0))); @@ -4603,27 +4563,28 @@ } }) -(define_insn "*floathidf2_1" +(define_insn "*floathidf2_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") - (float:DF (match_operand:HI 1 "nonimmediate_operand" "m,r")))] - "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH)" + (float:DF (match_operand:HI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387 && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "DF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) (define_expand "floatsidf2" [(set (match_operand:DF 0 "register_operand" "") (float:DF (match_operand:SI 1 "nonimmediate_operand" "")))] - "TARGET_80387 || TARGET_SSE2" + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" "") -(define_insn "*floatsidf2_i387" - [(set (match_operand:DF 0 "register_operand" "=f#Y,?f#Y,Y#f,Y#f") +(define_insn "*floatsidf2_mixed" + [(set (match_operand:DF 0 "register_operand" "=f,?f,Y,Y") (float:DF (match_operand:SI 1 "nonimmediate_operand" "m,r,r,mr")))] - "TARGET_80387 && (!TARGET_SSE2 || TARGET_MIX_SSE_I387)" + "TARGET_SSE2 && TARGET_MIX_SSE_I387" "@ fild%z1\t%1 # @@ -4631,40 +4592,42 @@ cvtsi2sd\t{%1, %0|%0, %1}" [(set_attr "type" "fmov,multi,sseicvt,sseicvt") (set_attr "mode" "DF") + (set_attr "unit" "*,i387,*,*") (set_attr "athlon_decode" "*,*,double,direct") (set_attr "fp_int_src" "true")]) (define_insn "*floatsidf2_sse" [(set (match_operand:DF 0 "register_operand" "=Y,Y") (float:DF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))] - "TARGET_SSE2" + "TARGET_SSE2 && TARGET_SSE_MATH" "cvtsi2sd\t{%1, %0|%0, %1}" [(set_attr "type" "sseicvt") (set_attr "mode" "DF") (set_attr "athlon_decode" "double,direct") (set_attr "fp_int_src" "true")]) -(define_expand "floatdidf2" - [(set (match_operand:DF 0 "register_operand" "") - (float:DF (match_operand:DI 1 "nonimmediate_operand" "")))] - "(TARGET_64BIT && TARGET_SSE2) || TARGET_80387" - "") - -(define_insn "*floatdidf2_i387_only" - [(set (match_operand:DF 0 "register_operand" "=f,?f") - (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,r")))] - "TARGET_80387 && (!TARGET_SSE2 || !TARGET_64BIT)" +(define_insn "*floatsidf2_i387" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (float:DF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "DF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) -(define_insn "*floatdidf2_i387" - [(set (match_operand:DF 0 "register_operand" "=f#Y,?f#Y,Y#f,Y#f") +(define_expand "floatdidf2" + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:DI 1 "nonimmediate_operand" "")))] + "TARGET_80387 || (TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH)" + "") + +(define_insn "*floatdidf2_mixed" + [(set (match_operand:DF 0 "register_operand" "=f,?f,Y,Y") (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,r,r,mr")))] - "TARGET_64BIT && TARGET_80387 && (!TARGET_SSE2 || TARGET_MIX_SSE_I387)" + "TARGET_64BIT && TARGET_SSE2 && TARGET_MIX_SSE_I387" "@ fild%z1\t%1 # @@ -4672,57 +4635,75 @@ cvtsi2sd{q}\t{%1, %0|%0, %1}" [(set_attr "type" "fmov,multi,sseicvt,sseicvt") (set_attr "mode" "DF") + (set_attr "unit" "*,i387,*,*") (set_attr "athlon_decode" "*,*,double,direct") (set_attr "fp_int_src" "true")]) (define_insn "*floatdidf2_sse" [(set (match_operand:DF 0 "register_operand" "=Y,Y") (float:DF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))] - "TARGET_SSE2" + "TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH" "cvtsi2sd{q}\t{%1, %0|%0, %1}" [(set_attr "type" "sseicvt") (set_attr "mode" "DF") (set_attr "athlon_decode" "double,direct") (set_attr "fp_int_src" "true")]) +(define_insn "*floatdidf2_i387" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))] + "TARGET_80387" + "@ + fild%z1\t%1 + #" + [(set_attr "type" "fmov,multi") + (set_attr "mode" "DF") + (set_attr "unit" "*,i387") + (set_attr "fp_int_src" "true")]) + (define_insn "floathixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") - (float:XF (match_operand:HI 1 "nonimmediate_operand" "m,r")))] + (float:XF (match_operand:HI 1 "nonimmediate_operand" "m,?r")))] "TARGET_80387" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "XF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) (define_insn "floatsixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") - (float:XF (match_operand:SI 1 "nonimmediate_operand" "m,r")))] + (float:XF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))] "TARGET_80387" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "XF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) (define_insn "floatdixf2" [(set (match_operand:XF 0 "register_operand" "=f,f") - (float:XF (match_operand:DI 1 "nonimmediate_operand" "m,r")))] + (float:XF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))] "TARGET_80387" "@ fild%z1\t%1 #" [(set_attr "type" "fmov,multi") (set_attr "mode" "XF") + (set_attr "unit" "*,i387") (set_attr "fp_int_src" "true")]) ;; %%% Kill these when reload knows how to do it. (define_split [(set (match_operand 0 "fp_register_operand" "") (float (match_operand 1 "register_operand" "")))] - "reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" + "reload_completed + && TARGET_80387 + && FLOAT_MODE_P (GET_MODE (operands[0]))" [(const_int 0)] { operands[2] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]); @@ -4735,188 +4716,62 @@ (define_expand "floatunssisf2" [(use (match_operand:SF 0 "register_operand" "")) (use (match_operand:SI 1 "register_operand" ""))] - "TARGET_SSE && TARGET_SSE_MATH && !TARGET_64BIT" + "!TARGET_64BIT && TARGET_SSE_MATH" "x86_emit_floatuns (operands); DONE;") (define_expand "floatunsdisf2" [(use (match_operand:SF 0 "register_operand" "")) (use (match_operand:DI 1 "register_operand" ""))] - "TARGET_SSE && TARGET_SSE_MATH && TARGET_64BIT" + "TARGET_64BIT && TARGET_SSE_MATH" "x86_emit_floatuns (operands); DONE;") (define_expand "floatunsdidf2" [(use (match_operand:DF 0 "register_operand" "")) (use (match_operand:DI 1 "register_operand" ""))] - "TARGET_SSE2 && TARGET_SSE_MATH && TARGET_64BIT" + "TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH" "x86_emit_floatuns (operands); DONE;") ;; SSE extract/set expanders -(define_expand "vec_setv2df" - [(match_operand:V2DF 0 "register_operand" "") - (match_operand:DF 1 "register_operand" "") - (match_operand 2 "const_int_operand" "")] - "TARGET_SSE2" -{ - switch (INTVAL (operands[2])) - { - case 0: - emit_insn (gen_sse2_movsd (operands[0], operands[0], - simplify_gen_subreg (V2DFmode, operands[1], - DFmode, 0))); - break; - case 1: - { - rtx op1 = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); - - emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], op1)); - } - break; - default: - abort (); - } - DONE; -}) - -(define_expand "vec_extractv2df" - [(match_operand:DF 0 "register_operand" "") - (match_operand:V2DF 1 "register_operand" "") - (match_operand 2 "const_int_operand" "")] - "TARGET_SSE2" -{ - switch (INTVAL (operands[2])) - { - case 0: - emit_move_insn (operands[0], gen_lowpart (DFmode, operands[1])); - break; - case 1: - { - rtx dest = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - - emit_insn (gen_sse2_unpckhpd (dest, operands[1], operands[1])); - } - break; - default: - abort (); - } - DONE; -}) - -(define_expand "vec_initv2df" - [(match_operand:V2DF 0 "register_operand" "") - (match_operand 1 "" "")] - "TARGET_SSE2" -{ - ix86_expand_vector_init (operands[0], operands[1]); - DONE; -}) - -(define_expand "vec_setv4sf" - [(match_operand:V4SF 0 "register_operand" "") - (match_operand:SF 1 "register_operand" "") - (match_operand 2 "const_int_operand" "")] - "TARGET_SSE" -{ - switch (INTVAL (operands[2])) - { - case 0: - emit_insn (gen_sse_movss (operands[0], operands[0], - simplify_gen_subreg (V4SFmode, operands[1], - SFmode, 0))); - break; - case 1: - { - rtx op1 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[0]); - emit_insn (gen_sse_unpcklps (operands[0], operands[0], operands[0])); - emit_insn (gen_sse_movss (operands[0], operands[0], op1)); - emit_insn (gen_sse_shufps (operands[0], operands[0], tmp, - GEN_INT (1 + (0<<2) + (2<<4) + (3<<6)))); - } - case 2: - { - rtx op1 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[0]); - emit_insn (gen_sse_movss (tmp, tmp, op1)); - emit_insn (gen_sse_shufps (operands[0], operands[0], tmp, - GEN_INT (0 + (1<<2) + (0<<4) + (3<<6)))); - } - break; - case 3: - { - rtx op1 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[0]); - emit_insn (gen_sse_movss (tmp, tmp, op1)); - emit_insn (gen_sse_shufps (operands[0], operands[0], tmp, - GEN_INT (0 + (1<<2) + (2<<4) + (0<<6)))); - } - break; - default: - abort (); - } - DONE; -}) - -(define_expand "vec_extractv4sf" - [(match_operand:SF 0 "register_operand" "") - (match_operand:V4SF 1 "register_operand" "") - (match_operand 2 "const_int_operand" "")] - "TARGET_SSE" -{ - switch (INTVAL (operands[2])) - { - case 0: - emit_move_insn (operands[0], gen_lowpart (SFmode, operands[1])); - break; - case 1: - { - rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[1]); - emit_insn (gen_sse_shufps (op0, tmp, tmp, - GEN_INT (1))); - } - case 2: - { - rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[1]); - emit_insn (gen_sse_unpckhps (op0, tmp, tmp)); - } - case 3: - { - rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - rtx tmp = gen_reg_rtx (V4SFmode); - - emit_move_insn (tmp, operands[1]); - emit_insn (gen_sse_shufps (op0, tmp, tmp, - GEN_INT (3))); - } - default: - abort (); - } - DONE; -}) - -(define_expand "vec_initv4sf" - [(match_operand:V4SF 0 "register_operand" "") - (match_operand 1 "" "")] - "TARGET_SSE" -{ - ix86_expand_vector_init (operands[0], operands[1]); - DONE; -}) ;; Add instructions +;; %%% splits for addditi3 + +(define_expand "addti3" + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (plus:TI (match_operand:TI 1 "nonimmediate_operand" "") + (match_operand:TI 2 "x86_64_general_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "ix86_expand_binary_operator (PLUS, TImode, operands); DONE;") + +(define_insn "*addti3_1" + [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o") + (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0,0") + (match_operand:TI 2 "general_operand" "roiF,riF"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && ix86_binary_operator_ok (PLUS, TImode, operands)" + "#") + +(define_split + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (plus:TI (match_operand:TI 1 "nonimmediate_operand" "") + (match_operand:TI 2 "general_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)] + UNSPEC_ADD_CARRY)) + (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]) + (parallel [(set (match_dup 3) + (plus:DI (plus:DI (ltu:DI (reg:CC FLAGS_REG) (const_int 0)) + (match_dup 4)) + (match_dup 5))) + (clobber (reg:CC FLAGS_REG))])] + "split_ti (operands+0, 1, operands+0, operands+3); + split_ti (operands+1, 1, operands+1, operands+4); + split_ti (operands+2, 1, operands+2, operands+5);") + ;; %%% splits for addsidi3 ; [(set (match_operand:DI 0 "nonimmediate_operand" "") ; (plus:DI (match_operand:DI 1 "general_operand" "") @@ -4926,7 +4781,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "x86_64_general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (PLUS, DImode, operands); DONE;") @@ -4934,7 +4789,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "roiF,riF"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)" "#") @@ -4942,16 +4797,16 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && reload_completed" - [(parallel [(set (reg:CC 17) (unspec:CC [(match_dup 1) (match_dup 2)] + [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)] UNSPEC_ADD_CARRY)) (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]) (parallel [(set (match_dup 3) - (plus:SI (plus:SI (ltu:SI (reg:CC 17) (const_int 0)) + (plus:SI (plus:SI (ltu:SI (reg:CC FLAGS_REG) (const_int 0)) (match_dup 4)) (match_dup 5))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "split_di (operands+0, 1, operands+0, operands+3); split_di (operands+1, 1, operands+1, operands+4); split_di (operands+2, 1, operands+2, operands+5);") @@ -4961,16 +4816,15 @@ (plus:DI (plus:DI (match_operand:DI 3 "ix86_carry_flag_operator" "") (match_operand:DI 1 "nonimmediate_operand" "%0,0")) (match_operand:DI 2 "x86_64_general_operand" "re,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)" "adc{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "mode" "DI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "DI")]) (define_insn "*adddi3_cc_rex64" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (unspec:CC [(match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rm")] UNSPEC_ADD_CARRY)) @@ -4986,39 +4840,36 @@ (plus:QI (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "") (match_operand:QI 1 "nonimmediate_operand" "%0,0")) (match_operand:QI 2 "general_operand" "qi,qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, QImode, operands)" "adc{b}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "mode" "QI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "QI")]) (define_insn "addhi3_carry" [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r") (plus:HI (plus:HI (match_operand:HI 3 "ix86_carry_flag_operator" "") (match_operand:HI 1 "nonimmediate_operand" "%0,0")) (match_operand:HI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, HImode, operands)" "adc{w}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "mode" "HI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "HI")]) (define_insn "addsi3_carry" [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0,0")) (match_operand:SI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, SImode, operands)" "adc{l}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "SI")]) (define_insn "*addsi3_carry_zext" [(set (match_operand:DI 0 "register_operand" "=r") @@ -5026,16 +4877,15 @@ (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0")) (match_operand:SI 2 "general_operand" "rim")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" "adc{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "SI")]) (define_insn "*addsi3_cc" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (unspec:CC [(match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "ri,rm")] UNSPEC_ADD_CARRY)) @@ -5047,7 +4897,7 @@ (set_attr "mode" "SI")]) (define_insn "addqi3_cc" - [(set (reg:CC 17) + [(set (reg:CC FLAGS_REG) (unspec:CC [(match_operand:QI 1 "nonimmediate_operand" "%0,0") (match_operand:QI 2 "general_operand" "qi,qm")] UNSPEC_ADD_CARRY)) @@ -5062,7 +4912,7 @@ [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") (plus:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "ix86_expand_binary_operator (PLUS, SImode, operands); DONE;") @@ -5104,7 +4954,7 @@ (define_insn_and_split "*lea_general_1" [(set (match_operand 0 "register_operand" "=r") - (plus (plus (match_operand 1 "index_register_operand" "r") + (plus (plus (match_operand 1 "index_register_operand" "l") (match_operand 2 "register_operand" "r")) (match_operand 3 "immediate_operand" "i")))] "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode @@ -5136,7 +4986,7 @@ (define_insn_and_split "*lea_general_1_zext" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI - (plus:SI (plus:SI (match_operand:SI 1 "index_register_operand" "r") + (plus:SI (plus:SI (match_operand:SI 1 "index_register_operand" "l") (match_operand:SI 2 "register_operand" "r")) (match_operand:SI 3 "immediate_operand" "i"))))] "TARGET_64BIT" @@ -5156,7 +5006,7 @@ (define_insn_and_split "*lea_general_2" [(set (match_operand 0 "register_operand" "=r") - (plus (mult (match_operand 1 "index_register_operand" "r") + (plus (mult (match_operand 1 "index_register_operand" "l") (match_operand 2 "const248_operand" "i")) (match_operand 3 "nonmemory_operand" "ri")))] "(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode @@ -5186,7 +5036,7 @@ (define_insn_and_split "*lea_general_2_zext" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI - (plus:SI (mult:SI (match_operand:SI 1 "index_register_operand" "r") + (plus:SI (mult:SI (match_operand:SI 1 "index_register_operand" "l") (match_operand:SI 2 "const248_operand" "n")) (match_operand:SI 3 "nonmemory_operand" "ri"))))] "TARGET_64BIT" @@ -5205,7 +5055,7 @@ (define_insn_and_split "*lea_general_3" [(set (match_operand 0 "register_operand" "=r") - (plus (plus (mult (match_operand 1 "index_register_operand" "r") + (plus (plus (mult (match_operand 1 "index_register_operand" "l") (match_operand 2 "const248_operand" "i")) (match_operand 3 "register_operand" "r")) (match_operand 4 "immediate_operand" "i")))] @@ -5239,8 +5089,9 @@ (define_insn_and_split "*lea_general_3_zext" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI - (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "index_register_operand" "r") - (match_operand:SI 2 "const248_operand" "n")) + (plus:SI (plus:SI (mult:SI + (match_operand:SI 1 "index_register_operand" "l") + (match_operand:SI 2 "const248_operand" "n")) (match_operand:SI 3 "register_operand" "r")) (match_operand:SI 4 "immediate_operand" "i"))))] "TARGET_64BIT" @@ -5262,8 +5113,8 @@ (define_insn "*adddi_1_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=r,rm,r") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,r") - (match_operand:DI 2 "x86_64_general_operand" "rme,re,re"))) - (clobber (reg:CC 17))] + (match_operand:DI 2 "x86_64_general_operand" "rme,re,le"))) + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)" { switch (get_attr_type (insn)) @@ -5273,18 +5124,17 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5319,7 +5169,7 @@ [(set (match_operand:DI 0 "register_operand" "") (plus:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "x86_64_nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(set (match_dup 0) @@ -5328,7 +5178,7 @@ "") (define_insn "*adddi_2_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rme,re")) @@ -5344,18 +5194,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5380,7 +5229,7 @@ (set_attr "mode" "DI")]) (define_insn "*adddi_3_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (neg:DI (match_operand:DI 2 "x86_64_general_operand" "rme")) (match_operand:DI 1 "x86_64_general_operand" "%0"))) (clobber (match_scratch:DI 0 "=r"))] @@ -5394,18 +5243,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5438,7 +5286,7 @@ ; Also carry flag is reversed compared to cmp, so this conversion is valid ; only for comparisons not depending on it. (define_insn "*adddi_4_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:DI 2 "x86_64_immediate_operand" "e"))) (clobber (match_scratch:DI 0 "=rm"))] @@ -5450,14 +5298,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{q}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5477,7 +5325,7 @@ (set_attr "mode" "DI")]) (define_insn "*adddi_5_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rme")) @@ -5493,18 +5341,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5530,8 +5377,8 @@ (define_insn "*addsi_1" [(set (match_operand:SI 0 "nonimmediate_operand" "=r,rm,r") (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,r") - (match_operand:SI 2 "general_operand" "rmni,rni,rni"))) - (clobber (reg:CC 17))] + (match_operand:SI 2 "general_operand" "rmni,rni,lni"))) + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, SImode, operands)" { switch (get_attr_type (insn)) @@ -5541,18 +5388,17 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5585,7 +5431,7 @@ [(set (match_operand 0 "register_operand" "") (plus (match_operand 1 "register_operand" "") (match_operand 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(const_int 0)] @@ -5615,8 +5461,8 @@ [(set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r") - (match_operand:SI 2 "general_operand" "rmni,rni")))) - (clobber (reg:CC 17))] + (match_operand:SI 2 "general_operand" "rmni,lni")))) + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" { switch (get_attr_type (insn)) @@ -5628,10 +5474,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5666,7 +5513,7 @@ (zero_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "nonmemory_operand" "")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(set (match_dup 0) @@ -5677,7 +5524,7 @@ }) (define_insn "*addsi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rmni,rni")) @@ -5693,18 +5540,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5726,7 +5572,7 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand (define_insn "*addsi_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) @@ -5744,10 +5590,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5770,7 +5617,7 @@ (set_attr "mode" "SI")]) (define_insn "*addsi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (neg:SI (match_operand:SI 2 "general_operand" "rmni")) (match_operand:SI 1 "nonimmediate_operand" "%0"))) (clobber (match_scratch:SI 0 "=r"))] @@ -5783,18 +5630,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5816,7 +5662,7 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand (define_insn "*addsi_3_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (neg:SI (match_operand:SI 2 "general_operand" "rmni")) (match_operand:SI 1 "nonimmediate_operand" "%0"))) (set (match_operand:DI 0 "register_operand" "=r") @@ -5832,10 +5678,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5866,7 +5713,7 @@ ; Also carry flag is reversed compared to cmp, so this conversion is valid ; only for comparisons not depending on it. (define_insn "*addsi_4" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:SI 2 "const_int_operand" "n"))) (clobber (match_scratch:SI 0 "=rm"))] @@ -5878,14 +5725,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{l}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5903,7 +5750,7 @@ (set_attr "mode" "SI")]) (define_insn "*addsi_5" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) @@ -5918,18 +5765,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5953,7 +5799,7 @@ [(parallel [(set (match_operand:HI 0 "nonimmediate_operand" "") (plus:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (PLUS, HImode, operands); DONE;") @@ -5964,8 +5810,8 @@ (define_insn "*addhi_1_lea" [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r,r") (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,r") - (match_operand:HI 2 "general_operand" "ri,rm,rni"))) - (clobber (reg:CC 17))] + (match_operand:HI 2 "general_operand" "ri,rm,lni"))) + (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (PLUS, HImode, operands)" { @@ -5976,9 +5822,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6006,7 +5854,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r") (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (PLUS, HImode, operands)" { @@ -6015,9 +5863,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6040,7 +5890,7 @@ (set_attr "mode" "HI")]) (define_insn "*addhi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmni,rni")) @@ -6055,9 +5905,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6080,7 +5932,7 @@ (set_attr "mode" "HI")]) (define_insn "*addhi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (neg:HI (match_operand:HI 2 "general_operand" "rmni")) (match_operand:HI 1 "nonimmediate_operand" "%0"))) (clobber (match_scratch:HI 0 "=r"))] @@ -6092,9 +5944,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6116,9 +5970,9 @@ (const_string "alu"))) (set_attr "mode" "HI")]) -; See comments above addsi_3_imm for details. +; See comments above addsi_4 for details. (define_insn "*addhi_4" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:HI 2 "const_int_operand" "n"))) (clobber (match_scratch:HI 0 "=rm"))] @@ -6130,14 +5984,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{w}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{w}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{w}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -6156,7 +6010,7 @@ (define_insn "*addhi_5" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rmni")) @@ -6170,9 +6024,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6198,7 +6054,7 @@ [(parallel [(set (match_operand:QI 0 "nonimmediate_operand" "") (plus:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (PLUS, QImode, operands); DONE;") @@ -6206,8 +6062,8 @@ (define_insn "*addqi_1_lea" [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r,r") (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,r") - (match_operand:QI 2 "general_operand" "qn,qmn,rn,rn"))) - (clobber (reg:CC 17))] + (match_operand:QI 2 "general_operand" "qn,qmn,rn,ln"))) + (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (PLUS, QImode, operands)" { @@ -6219,9 +6075,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6255,7 +6113,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r") (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "qn,qmn,rn"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (PLUS, QImode, operands)" { @@ -6265,9 +6123,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6299,7 +6159,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q")) (plus:QI (match_dup 0) (match_operand:QI 1 "general_operand" "qn,qnm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" { @@ -6308,9 +6168,11 @@ case TYPE_INCDEC: if (operands[1] == const1_rtx) return "inc{b}\t%0"; - else if (operands[1] == constm1_rtx) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[1] == constm1_rtx); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. */ @@ -6334,7 +6196,7 @@ (set_attr "mode" "QI")]) (define_insn "*addqi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0") (match_operand:QI 2 "general_operand" "qmni,qni")) @@ -6349,11 +6211,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6373,7 +6237,7 @@ (set_attr "mode" "QI")]) (define_insn "*addqi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (neg:QI (match_operand:QI 2 "general_operand" "qmni")) (match_operand:QI 1 "nonimmediate_operand" "%0"))) (clobber (match_scratch:QI 0 "=q"))] @@ -6385,11 +6249,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6408,9 +6274,9 @@ (const_string "alu"))) (set_attr "mode" "QI")]) -; See comments above addsi_3_imm for details. +; See comments above addsi_4 for details. (define_insn "*addqi_4" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const_int_operand" "n"))) (clobber (match_scratch:QI 0 "=qm"))] @@ -6424,14 +6290,14 @@ || (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255)) return "inc{b}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{b}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{b}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (INTVAL (operands[2]) < 0) { operands[2] = GEN_INT (-INTVAL (operands[2])); @@ -6448,7 +6314,7 @@ (define_insn "*addqi_5" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0") (match_operand:QI 2 "general_operand" "qmni")) @@ -6462,11 +6328,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6496,7 +6364,7 @@ (const_int 8) (const_int 8)) (match_operand:QI 2 "general_operand" "Qmn"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" { switch (get_attr_type (insn)) @@ -6504,11 +6372,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -6530,7 +6400,7 @@ (const_int 8) (const_int 8)) (match_operand:QI 2 "nonmemory_operand" "Qn"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" { switch (get_attr_type (insn)) @@ -6538,11 +6408,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -6567,7 +6439,7 @@ (match_operand 2 "ext_register_operand" "Q") (const_int 8) (const_int 8)))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "add{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") @@ -6598,13 +6470,48 @@ ;; Subtract instructions +;; %%% splits for subditi3 + +(define_expand "subti3" + [(parallel [(set (match_operand:TI 0 "nonimmediate_operand" "") + (minus:TI (match_operand:TI 1 "nonimmediate_operand" "") + (match_operand:TI 2 "x86_64_general_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" + "ix86_expand_binary_operator (MINUS, TImode, operands); DONE;") + +(define_insn "*subti3_1" + [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o") + (minus:TI (match_operand:TI 1 "nonimmediate_operand" "0,0") + (match_operand:TI 2 "general_operand" "roiF,riF"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && ix86_binary_operator_ok (MINUS, TImode, operands)" + "#") + +(define_split + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (minus:TI (match_operand:TI 1 "nonimmediate_operand" "") + (match_operand:TI 2 "general_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2))) + (set (match_dup 0) (minus:DI (match_dup 1) (match_dup 2)))]) + (parallel [(set (match_dup 3) + (minus:DI (match_dup 4) + (plus:DI (ltu:DI (reg:CC FLAGS_REG) (const_int 0)) + (match_dup 5)))) + (clobber (reg:CC FLAGS_REG))])] + "split_ti (operands+0, 1, operands+0, operands+3); + split_ti (operands+1, 1, operands+1, operands+4); + split_ti (operands+2, 1, operands+2, operands+5);") + ;; %%% splits for subsidi3 (define_expand "subdi3" [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "") (minus:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "x86_64_general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "ix86_expand_binary_operator (MINUS, DImode, operands); DONE;") @@ -6612,7 +6519,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o") (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:DI 2 "general_operand" "roiF,riF"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)" "#") @@ -6620,15 +6527,15 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (minus:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && reload_completed" - [(parallel [(set (reg:CC 17) (compare:CC (match_dup 1) (match_dup 2))) + [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2))) (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))]) (parallel [(set (match_dup 3) (minus:SI (match_dup 4) - (plus:SI (ltu:SI (reg:CC 17) (const_int 0)) + (plus:SI (ltu:SI (reg:CC FLAGS_REG) (const_int 0)) (match_dup 5)))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "split_di (operands+0, 1, operands+0, operands+3); split_di (operands+1, 1, operands+1, operands+4); split_di (operands+2, 1, operands+2, operands+5);") @@ -6638,26 +6545,25 @@ (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (plus:DI (match_operand:DI 3 "ix86_carry_flag_operator" "") (match_operand:DI 2 "x86_64_general_operand" "re,rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)" "sbb{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "ppro_uops" "few") (set_attr "mode" "DI")]) (define_insn "*subdi_1_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r") (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)" "sub{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "DI")]) (define_insn "*subdi_2_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rm")) @@ -6671,7 +6577,7 @@ (set_attr "mode" "DI")]) (define_insn "*subdi_3_rex63" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rm"))) (set (match_operand:DI 0 "nonimmediate_operand" "=rm,r") @@ -6687,12 +6593,11 @@ (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "") (match_operand:QI 2 "general_operand" "qi,qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, QImode, operands)" "sbb{b}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "ppro_uops" "few") (set_attr "mode" "QI")]) (define_insn "subhi3_carry" @@ -6700,12 +6605,11 @@ (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (plus:HI (match_operand:HI 3 "ix86_carry_flag_operator" "") (match_operand:HI 2 "general_operand" "ri,rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, HImode, operands)" "sbb{w}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "ppro_uops" "few") (set_attr "mode" "HI")]) (define_insn "subsi3_carry" @@ -6713,12 +6617,11 @@ (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 2 "general_operand" "ri,rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, SImode, operands)" "sbb{l}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "ppro_uops" "few") (set_attr "mode" "SI")]) (define_insn "subsi3_carry_zext" @@ -6727,19 +6630,18 @@ (minus:SI (match_operand:SI 1 "register_operand" "0,0") (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 2 "general_operand" "ri,rm"))))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, SImode, operands)" "sbb{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "pent_pair" "pu") - (set_attr "ppro_uops" "few") (set_attr "mode" "SI")]) (define_expand "subsi3" [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") (minus:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "ix86_expand_binary_operator (MINUS, SImode, operands); DONE;") @@ -6747,7 +6649,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:SI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, SImode, operands)" "sub{l}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") @@ -6758,14 +6660,14 @@ (zero_extend:DI (minus:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "general_operand" "rim")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, SImode, operands)" "sub{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) (define_insn "*subsi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:SI 2 "general_operand" "ri,rm")) @@ -6779,7 +6681,7 @@ (set_attr "mode" "SI")]) (define_insn "*subsi_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "general_operand" "rim")) @@ -6795,7 +6697,7 @@ (set_attr "mode" "SI")]) (define_insn "*subsi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:SI 2 "general_operand" "ri,rm"))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") @@ -6807,7 +6709,7 @@ (set_attr "mode" "SI")]) (define_insn "*subsi_3_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "general_operand" "rim"))) (set (match_operand:DI 0 "register_operand" "=r") @@ -6816,7 +6718,7 @@ (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCmode) && ix86_binary_operator_ok (MINUS, SImode, operands)" - "sub{q}\t{%2, %0|%0, %2}" + "sub{l}\t{%2, %1|%1, %2}" [(set_attr "type" "alu") (set_attr "mode" "DI")]) @@ -6824,7 +6726,7 @@ [(parallel [(set (match_operand:HI 0 "nonimmediate_operand" "") (minus:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (MINUS, HImode, operands); DONE;") @@ -6832,14 +6734,14 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r") (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:HI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, HImode, operands)" "sub{w}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "HI")]) (define_insn "*subhi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:HI 2 "general_operand" "ri,rm")) @@ -6853,7 +6755,7 @@ (set_attr "mode" "HI")]) (define_insn "*subhi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:HI 2 "general_operand" "ri,rm"))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm,r") @@ -6868,7 +6770,7 @@ [(parallel [(set (match_operand:QI 0 "nonimmediate_operand" "") (minus:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (MINUS, QImode, operands); DONE;") @@ -6876,7 +6778,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q") (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "general_operand" "qn,qmn"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, QImode, operands)" "sub{b}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") @@ -6886,7 +6788,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q")) (minus:QI (match_dup 0) (match_operand:QI 1 "general_operand" "qn,qmn"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "sub{b}\t{%1, %0|%0, %1}" @@ -6894,7 +6796,7 @@ (set_attr "mode" "QI")]) (define_insn "*subqi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "general_operand" "qi,qm")) @@ -6908,7 +6810,7 @@ (set_attr "mode" "QI")]) (define_insn "*subqi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "general_operand" "qi,qm"))) (set (match_operand:HI 0 "nonimmediate_operand" "=qm,q") @@ -6948,7 +6850,7 @@ [(parallel [(set (match_operand:DI 0 "register_operand" "") (mult:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "x86_64_general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -6956,7 +6858,7 @@ [(set (match_operand:DI 0 "register_operand" "=r,r,r") (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%rm,rm,0") (match_operand:DI 2 "x86_64_general_operand" "K,e,mr"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "@ @@ -6980,7 +6882,7 @@ [(parallel [(set (match_operand:SI 0 "register_operand" "") (mult:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -6988,7 +6890,7 @@ [(set (match_operand:SI 0 "register_operand" "=r,r,r") (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0") (match_operand:SI 2 "general_operand" "K,i,mr"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM" "@ imul{l}\t{%2, %1, %0|%0, %1, %2} @@ -7012,7 +6914,7 @@ (zero_extend:DI (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0") (match_operand:SI 2 "general_operand" "K,i,mr")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "@ @@ -7036,7 +6938,7 @@ [(parallel [(set (match_operand:HI 0 "register_operand" "") (mult:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_HIMODE_MATH" "") @@ -7044,7 +6946,7 @@ [(set (match_operand:HI 0 "register_operand" "=r,r,r") (mult:HI (match_operand:HI 1 "nonimmediate_operand" "%rm,rm,0") (match_operand:HI 2 "general_operand" "K,i,mr"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM" "@ imul{w}\t{%2, %1, %0|%0, %1, %2} @@ -7064,7 +6966,7 @@ [(parallel [(set (match_operand:QI 0 "register_operand" "") (mult:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "register_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "") @@ -7072,7 +6974,7 @@ [(set (match_operand:QI 0 "register_operand" "=a") (mult:QI (match_operand:QI 1 "nonimmediate_operand" "%0") (match_operand:QI 2 "nonimmediate_operand" "qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{b}\t%2" @@ -7090,7 +6992,7 @@ (match_operand:QI 1 "nonimmediate_operand" "")) (zero_extend:HI (match_operand:QI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "") @@ -7098,7 +7000,7 @@ [(set (match_operand:HI 0 "register_operand" "=a") (mult:HI (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "%0")) (zero_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{b}\t%2" @@ -7114,7 +7016,7 @@ [(parallel [(set (match_operand:HI 0 "register_operand" "") (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")) (sign_extend:HI (match_operand:QI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "") @@ -7122,7 +7024,7 @@ [(set (match_operand:HI 0 "register_operand" "=a") (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "%0")) (sign_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "imul{b}\t%2" @@ -7140,7 +7042,7 @@ (match_operand:DI 1 "nonimmediate_operand" "")) (zero_extend:TI (match_operand:DI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -7148,12 +7050,11 @@ [(set (match_operand:TI 0 "register_operand" "=A") (mult:TI (zero_extend:TI (match_operand:DI 1 "nonimmediate_operand" "%0")) (zero_extend:TI (match_operand:DI 2 "nonimmediate_operand" "rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{q}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set_attr "length_immediate" "0") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") @@ -7168,7 +7069,7 @@ (match_operand:SI 1 "nonimmediate_operand" "")) (zero_extend:DI (match_operand:SI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "!TARGET_64BIT" "") @@ -7176,12 +7077,11 @@ [(set (match_operand:DI 0 "register_operand" "=A") (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "%0")) (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{l}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set_attr "length_immediate" "0") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") @@ -7195,7 +7095,7 @@ (match_operand:DI 1 "nonimmediate_operand" "")) (sign_extend:TI (match_operand:DI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -7203,7 +7103,7 @@ [(set (match_operand:TI 0 "register_operand" "=A") (mult:TI (sign_extend:TI (match_operand:DI 1 "nonimmediate_operand" "%0")) (sign_extend:TI (match_operand:DI 2 "nonimmediate_operand" "rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "imul{q}\t%2" @@ -7221,7 +7121,7 @@ (match_operand:SI 1 "nonimmediate_operand" "")) (sign_extend:DI (match_operand:SI 2 "register_operand" "")))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "!TARGET_64BIT" "") @@ -7229,7 +7129,7 @@ [(set (match_operand:DI 0 "register_operand" "=A") (mult:DI (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "%0")) (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "imul{l}\t%2" @@ -7251,7 +7151,7 @@ (match_operand:DI 2 "register_operand" ""))) (const_int 64)))) (clobber (match_scratch:DI 3 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -7265,12 +7165,11 @@ (match_operand:DI 2 "nonimmediate_operand" "rm"))) (const_int 64)))) (clobber (match_scratch:DI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{q}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set_attr "length_immediate" "0") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") @@ -7288,7 +7187,7 @@ (match_operand:SI 2 "register_operand" ""))) (const_int 32)))) (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -7302,11 +7201,10 @@ (match_operand:SI 2 "nonimmediate_operand" "rm"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM" "mul{l}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set_attr "length_immediate" "0") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") @@ -7324,12 +7222,11 @@ (match_operand:SI 2 "nonimmediate_operand" "rm"))) (const_int 32))))) (clobber (match_scratch:SI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "mul{l}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set_attr "length_immediate" "0") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") @@ -7347,7 +7244,7 @@ (match_operand:DI 2 "register_operand" ""))) (const_int 64)))) (clobber (match_scratch:DI 3 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -7361,12 +7258,11 @@ (match_operand:DI 2 "nonimmediate_operand" "rm"))) (const_int 64)))) (clobber (match_scratch:DI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "imul{q}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") (const_string "vector") @@ -7383,7 +7279,7 @@ (match_operand:SI 2 "register_operand" ""))) (const_int 32)))) (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -7397,11 +7293,10 @@ (match_operand:SI 2 "nonimmediate_operand" "rm"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM" "imul{l}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") (const_string "vector") @@ -7418,12 +7313,11 @@ (match_operand:SI 2 "nonimmediate_operand" "rm"))) (const_int 32))))) (clobber (match_scratch:SI 3 "=1")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "imul{l}\t%2" [(set_attr "type" "imul") - (set_attr "ppro_uops" "few") (set (attr "athlon_decode") (if_then_else (eq_attr "cpu" "athlon") (const_string "vector") @@ -7459,23 +7353,21 @@ [(set (match_operand:QI 0 "register_operand" "=a") (div:QI (match_operand:HI 1 "register_operand" "0") (match_operand:QI 2 "nonimmediate_operand" "qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "idiv{b}\t%2" [(set_attr "type" "idiv") - (set_attr "mode" "QI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "QI")]) (define_insn "udivqi3" [(set (match_operand:QI 0 "register_operand" "=a") (udiv:QI (match_operand:HI 1 "register_operand" "0") (match_operand:QI 2 "nonimmediate_operand" "qm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "div{b}\t%2" [(set_attr "type" "idiv") - (set_attr "mode" "QI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "QI")]) ;; The patterns that match these are at the end of this file. @@ -7508,7 +7400,7 @@ (match_operand:DI 2 "nonimmediate_operand" ""))) (set (match_operand:DI 3 "register_operand" "") (mod:DI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT" "") @@ -7521,7 +7413,7 @@ (match_operand:DI 3 "nonimmediate_operand" "rm,rm"))) (set (match_operand:DI 1 "register_operand" "=&d,&d") (mod:DI (match_dup 2) (match_dup 3))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && !optimize_size && !TARGET_USE_CLTD" "#" [(set_attr "type" "multi")]) @@ -7532,7 +7424,7 @@ (match_operand:DI 3 "nonimmediate_operand" "rm"))) (set (match_operand:DI 1 "register_operand" "=&d") (mod:DI (match_dup 2) (match_dup 3))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (optimize_size || TARGET_USE_CLTD)" "#" [(set_attr "type" "multi")]) @@ -7544,12 +7436,11 @@ (set (match_operand:DI 3 "register_operand" "=d") (mod:DI (match_dup 1) (match_dup 2))) (use (match_operand:DI 4 "register_operand" "3")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "idiv{q}\t%2" [(set_attr "type" "idiv") - (set_attr "mode" "DI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "DI")]) (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -7557,17 +7448,17 @@ (match_operand:DI 2 "nonimmediate_operand" ""))) (set (match_operand:DI 3 "register_operand" "") (mod:DI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed" [(parallel [(set (match_dup 3) (ashiftrt:DI (match_dup 4) (const_int 63))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (div:DI (reg:DI 0) (match_dup 2))) (set (match_dup 3) (mod:DI (reg:DI 0) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { /* Avoid use of cltd in favor of a mov+shift. */ if (!TARGET_USE_CLTD && !optimize_size) @@ -7580,8 +7471,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7593,7 +7483,7 @@ (match_operand:SI 2 "nonimmediate_operand" ""))) (set (match_operand:SI 3 "register_operand" "") (mod:SI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -7606,7 +7496,7 @@ (match_operand:SI 3 "nonimmediate_operand" "rm,rm"))) (set (match_operand:SI 1 "register_operand" "=&d,&d") (mod:SI (match_dup 2) (match_dup 3))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!optimize_size && !TARGET_USE_CLTD" "#" [(set_attr "type" "multi")]) @@ -7617,7 +7507,7 @@ (match_operand:SI 3 "nonimmediate_operand" "rm"))) (set (match_operand:SI 1 "register_operand" "=&d") (mod:SI (match_dup 2) (match_dup 3))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "optimize_size || TARGET_USE_CLTD" "#" [(set_attr "type" "multi")]) @@ -7629,12 +7519,11 @@ (set (match_operand:SI 3 "register_operand" "=d") (mod:SI (match_dup 1) (match_dup 2))) (use (match_operand:SI 4 "register_operand" "3")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "idiv{l}\t%2" [(set_attr "type" "idiv") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "SI")]) (define_split [(set (match_operand:SI 0 "register_operand" "") @@ -7642,17 +7531,17 @@ (match_operand:SI 2 "nonimmediate_operand" ""))) (set (match_operand:SI 3 "register_operand" "") (mod:SI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed" [(parallel [(set (match_dup 3) (ashiftrt:SI (match_dup 4) (const_int 31))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (div:SI (reg:SI 0) (match_dup 2))) (set (match_dup 3) (mod:SI (reg:SI 0) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { /* Avoid use of cltd in favor of a mov+shift. */ if (!TARGET_USE_CLTD && !optimize_size) @@ -7665,8 +7554,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7677,7 +7565,7 @@ (match_operand:HI 2 "nonimmediate_operand" "rm"))) (set (match_operand:HI 3 "register_operand" "=&d") (mod:HI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "cwtd\;idiv{w}\t%2" [(set_attr "type" "multi") @@ -7690,7 +7578,7 @@ (match_operand:DI 2 "nonimmediate_operand" "rm"))) (set (match_operand:DI 3 "register_operand" "=&d") (umod:DI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "xor{q}\t%3, %3\;div{q}\t%2" [(set_attr "type" "multi") @@ -7704,11 +7592,10 @@ (set (match_operand:DI 3 "register_operand" "=d") (umod:DI (match_dup 1) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "div{q}\t%2" [(set_attr "type" "idiv") - (set_attr "ppro_uops" "few") (set_attr "mode" "DI")]) (define_split @@ -7717,7 +7604,7 @@ (match_operand:DI 2 "nonimmediate_operand" ""))) (set (match_operand:DI 3 "register_operand" "") (umod:DI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed" [(set (match_dup 3) (const_int 0)) (parallel [(set (match_dup 0) @@ -7725,7 +7612,7 @@ (set (match_dup 3) (umod:DI (match_dup 1) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_insn "udivmodsi4" @@ -7734,7 +7621,7 @@ (match_operand:SI 2 "nonimmediate_operand" "rm"))) (set (match_operand:SI 3 "register_operand" "=&d") (umod:SI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "xor{l}\t%3, %3\;div{l}\t%2" [(set_attr "type" "multi") @@ -7748,11 +7635,10 @@ (set (match_operand:SI 3 "register_operand" "=d") (umod:SI (match_dup 1) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "div{l}\t%2" [(set_attr "type" "idiv") - (set_attr "ppro_uops" "few") (set_attr "mode" "SI")]) (define_split @@ -7761,7 +7647,7 @@ (match_operand:SI 2 "nonimmediate_operand" ""))) (set (match_operand:SI 3 "register_operand" "") (umod:SI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed" [(set (match_dup 3) (const_int 0)) (parallel [(set (match_dup 0) @@ -7769,7 +7655,7 @@ (set (match_dup 3) (umod:SI (match_dup 1) (match_dup 2))) (use (match_dup 3)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_expand "udivmodhi4" @@ -7780,7 +7666,7 @@ (set (match_operand:HI 3 "register_operand" "") (umod:HI (match_dup 1) (match_dup 2))) (use (match_dup 4)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_HIMODE_MATH" "operands[4] = gen_reg_rtx (HImode);") @@ -7791,14 +7677,13 @@ (set (match_operand:HI 3 "register_operand" "=d") (umod:HI (match_dup 1) (match_dup 2))) (use (match_operand:HI 4 "register_operand" "3")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "div{w}\t%2" [(set_attr "type" "idiv") - (set_attr "mode" "HI") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "HI")]) -;; We can not use div/idiv for double division, because it causes +;; We cannot use div/idiv for double division, because it causes ;; "division by zero" on the overflow and that's not what we expect ;; from truncate. Because true (non truncating) double division is ;; never generated, we can't create this insn anyway. @@ -7812,11 +7697,10 @@ ; (set (match_operand:SI 3 "register_operand" "=d") ; (truncate:SI ; (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2))))) -; (clobber (reg:CC 17))] +; (clobber (reg:CC FLAGS_REG))] ; "" ; "div{l}\t{%2, %0|%0, %2}" -; [(set_attr "type" "idiv") -; (set_attr "ppro_uops" "few")]) +; [(set_attr "type" "idiv")]) ;;- Logical AND instructions @@ -7824,7 +7708,7 @@ ;; Note that this excludes ah. (define_insn "*testdi_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "%!*a,r,!*a,r,rm") (match_operand:DI 1 "x86_64_szext_general_operand" "Z,Z,e,e,re")) @@ -7832,10 +7716,10 @@ "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "@ - test{l}\t{%k1, %k0|%k0, %k1} - test{l}\t{%k1, %k0|%k0, %k1} - test{q}\t{%1, %0|%0, %1} - test{q}\t{%1, %0|%0, %1} + test{l}\t{%k1, %k0|%k0, %k1} + test{l}\t{%k1, %k0|%k0, %k1} + test{q}\t{%1, %0|%0, %1} + test{q}\t{%1, %0|%0, %1} test{q}\t{%1, %0|%0, %1}" [(set_attr "type" "test") (set_attr "modrm" "0,1,0,1,1") @@ -7843,7 +7727,7 @@ (set_attr "pent_pair" "uv,np,uv,np,uv")]) (define_insn "testsi_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "%!*a,r,rm") (match_operand:SI 1 "general_operand" "in,in,rin")) @@ -7857,7 +7741,7 @@ (set_attr "pent_pair" "uv,np,uv")]) (define_expand "testsi_ccno_1" - [(set (reg:CCNO 17) + [(set (reg:CCNO FLAGS_REG) (compare:CCNO (and:SI (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "nonmemory_operand" "")) @@ -7866,7 +7750,7 @@ "") (define_insn "*testhi_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:HI (match_operand:HI 0 "nonimmediate_operand" "%!*a,r,rm") (match_operand:HI 1 "general_operand" "n,n,rn")) (const_int 0)))] @@ -7879,7 +7763,7 @@ (set_attr "pent_pair" "uv,np,uv")]) (define_expand "testqi_ccz_1" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (and:QI (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "nonmemory_operand" "")) (const_int 0)))] @@ -7887,16 +7771,16 @@ "") (define_insn "*testqi_1_maybe_si" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:QI (match_operand:QI 0 "nonimmediate_operand" "%!*a,q,qm,r") (match_operand:QI 1 "general_operand" "n,n,qn,n")) (const_int 0)))] - "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && ix86_match_ccmode (insn, - GET_CODE (operands[1]) == CONST_INT - && INTVAL (operands[1]) >= 0 ? CCNOmode : CCZmode)" + "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) + && ix86_match_ccmode (insn, + GET_CODE (operands[1]) == CONST_INT + && INTVAL (operands[1]) >= 0 ? CCNOmode : CCZmode)" { if (which_alternative == 3) { @@ -7912,7 +7796,7 @@ (set_attr "pent_pair" "uv,np,uv,np")]) (define_insn "*testqi_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:QI (match_operand:QI 0 "nonimmediate_operand" "%!*a,q,qm") @@ -7927,7 +7811,7 @@ (set_attr "pent_pair" "uv,np,uv")]) (define_expand "testqi_ext_ccno_0" - [(set (reg:CCNO 17) + [(set (reg:CCNO FLAGS_REG) (compare:CCNO (and:SI (zero_extract:SI @@ -7940,7 +7824,7 @@ "") (define_insn "*testqi_ext_0" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (zero_extract:SI @@ -7957,7 +7841,7 @@ (set_attr "pent_pair" "np")]) (define_insn "*testqi_ext_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (zero_extract:SI @@ -7974,7 +7858,7 @@ (set_attr "mode" "QI")]) (define_insn "*testqi_ext_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (zero_extract:SI @@ -7990,7 +7874,7 @@ (set_attr "mode" "QI")]) (define_insn "*testqi_ext_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (zero_extract:SI @@ -8009,13 +7893,16 @@ ;; Combine likes to form bit extractions for some tests. Humor it. (define_insn "*testqi_ext_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (zero_extract:SI (match_operand 0 "nonimmediate_operand" "rm") (match_operand:SI 1 "const_int_operand" "") (match_operand:SI 2 "const_int_operand" "")) (const_int 0)))] "ix86_match_ccmode (insn, CCNOmode) + && INTVAL (operands[1]) > 0 + && INTVAL (operands[2]) >= 0 + && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32 && (GET_MODE (operands[0]) == SImode || (TARGET_64BIT && GET_MODE (operands[0]) == DImode) || GET_MODE (operands[0]) == HImode @@ -8023,7 +7910,7 @@ "#") (define_insn "*testqi_ext_3_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (zero_extract:DI (match_operand 0 "nonimmediate_operand" "rm") (match_operand:DI 1 "const_int_operand" "") @@ -8031,8 +7918,8 @@ (const_int 0)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) - /* The code below cannot deal with constants outside HOST_WIDE_INT. */ - && INTVAL (operands[1]) + INTVAL (operands[2]) < HOST_BITS_PER_WIDE_INT + && INTVAL (operands[1]) > 0 + && INTVAL (operands[2]) >= 0 /* Ensure that resulting mask is zero or sign extended operand. */ && (INTVAL (operands[1]) + INTVAL (operands[2]) <= 32 || (INTVAL (operands[1]) + INTVAL (operands[2]) == 64 @@ -8087,8 +7974,11 @@ val = gen_lowpart (QImode, val); } - mask = ((HOST_WIDE_INT)1 << (pos + len)) - 1; - mask &= ~(((HOST_WIDE_INT)1 << pos) - 1); + if (len == HOST_BITS_PER_WIDE_INT) + mask = -1; + else + mask = ((HOST_WIDE_INT)1 << len) - 1; + mask <<= pos; operands[2] = gen_rtx_AND (mode, val, gen_int_mode (mask, mode)); }) @@ -8147,7 +8037,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (and:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "x86_64_szext_general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "ix86_expand_binary_operator (AND, DImode, operands); DONE;") @@ -8155,7 +8045,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,rm,r,r") (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,qm") (match_operand:DI 2 "x86_64_szext_general_operand" "Z,re,rm,L"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (AND, DImode, operands)" { switch (get_attr_type (insn)) @@ -8164,14 +8054,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -8181,8 +8071,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (get_attr_mode (insn) == MODE_SI) return "and{l}\t{%k2, %k0|%k0, %k2}"; else @@ -8194,7 +8083,7 @@ (set_attr "mode" "SI,DI,DI,DI")]) (define_insn "*anddi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0") (match_operand:DI 2 "x86_64_szext_general_operand" "Z,rem,re")) (const_int 0))) @@ -8203,8 +8092,8 @@ "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (AND, DImode, operands)" "@ - and{l}\t{%k2, %k0|%k0, %k2} - and{q}\t{%2, %0|%0, %2} + and{l}\t{%k2, %k0|%k0, %k2} + and{q}\t{%2, %0|%0, %2} and{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI,DI,DI")]) @@ -8213,7 +8102,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (and:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (AND, SImode, operands); DONE;") @@ -8221,7 +8110,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r,r") (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,qm") (match_operand:SI 2 "general_operand" "ri,rm,L"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (AND, SImode, operands)" { switch (get_attr_type (insn)) @@ -8230,14 +8119,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -8247,8 +8136,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{l}\t{%2, %0|%0, %2}"; } } @@ -8260,7 +8148,7 @@ [(set (match_operand 0 "register_operand" "") (and (match_dup 0) (const_int -65536))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "optimize_size || (TARGET_FAST_PREFIX && !TARGET_PARTIAL_REG_STALL)" [(set (strict_low_part (match_dup 1)) (const_int 0))] "operands[1] = gen_lowpart (HImode, operands[0]);") @@ -8269,7 +8157,7 @@ [(set (match_operand 0 "ext_register_operand" "") (and (match_dup 0) (const_int -256))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(optimize_size || !TARGET_PARTIAL_REG_STALL) && reload_completed" [(set (strict_low_part (match_dup 1)) (const_int 0))] "operands[1] = gen_lowpart (QImode, operands[0]);") @@ -8278,7 +8166,7 @@ [(set (match_operand 0 "ext_register_operand" "") (and (match_dup 0) (const_int -65281))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(optimize_size || !TARGET_PARTIAL_REG_STALL) && reload_completed" [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) @@ -8290,7 +8178,7 @@ (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]);") ;; See comment for addsi_1_zext why we do use nonimmediate_operand @@ -8299,14 +8187,14 @@ (zero_extend:DI (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (AND, SImode, operands)" "and{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) (define_insn "*andsi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -8320,7 +8208,7 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand (define_insn "*andsi_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")) (const_int 0))) @@ -8336,7 +8224,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (and:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (AND, HImode, operands); DONE;") @@ -8344,21 +8232,18 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r,r") (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,qm") (match_operand:HI 2 "general_operand" "ri,rm,L"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (AND, HImode, operands)" { switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (GET_CODE (operands[2]) != CONST_INT) - abort (); - if (INTVAL (operands[2]) == 0xff) - return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert (INTVAL (operands[2]) == 0xff); + return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{w}\t{%2, %0|%0, %2}"; } @@ -8368,7 +8253,7 @@ (set_attr "mode" "HI,HI,SI")]) (define_insn "*andhi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -8384,7 +8269,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (and:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (AND, QImode, operands); DONE;") @@ -8393,7 +8278,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q,r") (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "qi,qmi,ri"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (AND, QImode, operands)" "@ and{b}\t{%2, %0|%0, %2} @@ -8406,7 +8291,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q")) (and:QI (match_dup 0) (match_operand:QI 1 "general_operand" "qi,qmi"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "and{b}\t{%1, %0|%0, %1}" @@ -8414,7 +8299,7 @@ (set_attr "mode" "QI")]) (define_insn "*andqi_2_maybe_si" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "qim,qi,i")) @@ -8438,7 +8323,7 @@ (set_attr "mode" "QI,QI,SI")]) (define_insn "*andqi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0") (match_operand:QI 2 "general_operand" "qim,qi")) @@ -8452,7 +8337,7 @@ (set_attr "mode" "QI")]) (define_insn "*andqi_2_slp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm") (match_operand:QI 1 "nonimmediate_operand" "qmi,qi")) @@ -8480,7 +8365,7 @@ (const_int 8) (const_int 8)) (match_operand 2 "const_int_operand" "n"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "and{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") @@ -8491,7 +8376,7 @@ ;; often in fp comparisons. (define_insn "*andqi_ext_0_cc" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (and:SI (zero_extract:SI @@ -8526,7 +8411,7 @@ (const_int 8)) (zero_extend:SI (match_operand:QI 2 "general_operand" "Qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "and{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") @@ -8544,7 +8429,7 @@ (const_int 8)) (zero_extend:SI (match_operand 2 "ext_register_operand" "Q")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "and{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") @@ -8564,7 +8449,7 @@ (match_operand 2 "ext_register_operand" "Q") (const_int 8) (const_int 8)))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "and{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") @@ -8580,7 +8465,7 @@ [(set (match_operand 0 "register_operand" "") (and (match_operand 1 "register_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -8590,7 +8475,7 @@ (and:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]); operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);") @@ -8601,7 +8486,7 @@ [(set (match_operand 0 "register_operand" "") (and (match_operand 1 "general_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ANY_QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -8611,7 +8496,7 @@ [(parallel [(set (strict_low_part (match_dup 0)) (and:QI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (QImode, operands[0]); operands[1] = gen_lowpart (QImode, operands[1]); operands[2] = gen_lowpart (QImode, operands[2]);") @@ -8625,7 +8510,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (ior:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "x86_64_general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "ix86_expand_binary_operator (IOR, DImode, operands); DONE;") @@ -8633,7 +8518,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r") (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rme"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (IOR, DImode, operands)" "or{q}\t{%2, %0|%0, %2}" @@ -8641,7 +8526,7 @@ (set_attr "mode" "DI")]) (define_insn "*iordi_2_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rem,re")) (const_int 0))) @@ -8655,7 +8540,7 @@ (set_attr "mode" "DI")]) (define_insn "*iordi_3_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rem")) (const_int 0))) @@ -8672,7 +8557,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (ior:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (IOR, SImode, operands); DONE;") @@ -8680,7 +8565,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "ri,rmi"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (IOR, SImode, operands)" "or{l}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") @@ -8692,7 +8577,7 @@ (zero_extend:DI (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (IOR, SImode, operands)" "or{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") @@ -8702,14 +8587,14 @@ [(set (match_operand:DI 0 "register_operand" "=rm") (ior:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0")) (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "or{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) (define_insn "*iorsi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -8724,7 +8609,7 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand ;; ??? Special case for immediate operand is missing - it is tricky. (define_insn "*iorsi_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")) (const_int 0))) @@ -8737,7 +8622,7 @@ (set_attr "mode" "SI")]) (define_insn "*iorsi_2_zext_imm" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand 2 "x86_64_zext_immediate_operand" "Z")) (const_int 0))) @@ -8750,7 +8635,7 @@ (set_attr "mode" "SI")]) (define_insn "*iorsi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")) (const_int 0))) @@ -8765,7 +8650,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (ior:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (IOR, HImode, operands); DONE;") @@ -8773,14 +8658,14 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,m") (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmi,ri"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (IOR, HImode, operands)" "or{w}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "HI")]) (define_insn "*iorhi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -8793,7 +8678,7 @@ (set_attr "mode" "HI")]) (define_insn "*iorhi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rim")) (const_int 0))) @@ -8808,7 +8693,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (ior:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (IOR, QImode, operands); DONE;") @@ -8817,7 +8702,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m,r") (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "qmi,qi,ri"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (IOR, QImode, operands)" "@ or{b}\t{%2, %0|%0, %2} @@ -8830,7 +8715,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+q,m")) (ior:QI (match_dup 0) (match_operand:QI 1 "general_operand" "qmi,qi"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "or{b}\t{%1, %0|%0, %1}" @@ -8838,7 +8723,7 @@ (set_attr "mode" "QI")]) (define_insn "*iorqi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0") (match_operand:QI 2 "general_operand" "qim,qi")) (const_int 0))) @@ -8851,7 +8736,7 @@ (set_attr "mode" "QI")]) (define_insn "*iorqi_2_slp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm") (match_operand:QI 1 "general_operand" "qim,qi")) (const_int 0))) @@ -8865,7 +8750,7 @@ (set_attr "mode" "QI")]) (define_insn "*iorqi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0") (match_operand:QI 2 "general_operand" "qim")) (const_int 0))) @@ -8886,7 +8771,7 @@ (const_int 8) (const_int 8)) (match_operand 2 "const_int_operand" "n"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_size)" "or{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") @@ -8904,7 +8789,7 @@ (const_int 8)) (zero_extend:SI (match_operand:QI 2 "general_operand" "Qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_size)" "or{b}\t{%2, %h0|%h0, %2}" @@ -8923,7 +8808,7 @@ (const_int 8)) (zero_extend:SI (match_operand 2 "ext_register_operand" "Q")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_size)" "or{b}\t{%2, %h0|%h0, %2}" @@ -8942,7 +8827,7 @@ (zero_extract:SI (match_operand 2 "ext_register_operand" "Q") (const_int 8) (const_int 8)))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_size)" "ior{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") @@ -8953,7 +8838,7 @@ [(set (match_operand 0 "register_operand" "") (ior (match_operand 1 "register_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -8963,7 +8848,7 @@ (ior:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]); operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);") @@ -8974,7 +8859,7 @@ [(set (match_operand 0 "register_operand" "") (ior (match_operand 1 "general_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ANY_QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -8984,7 +8869,7 @@ [(parallel [(set (strict_low_part (match_dup 0)) (ior:QI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (QImode, operands[0]); operands[1] = gen_lowpart (QImode, operands[1]); operands[2] = gen_lowpart (QImode, operands[2]);") @@ -8998,7 +8883,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "") (xor:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "x86_64_general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "ix86_expand_binary_operator (XOR, DImode, operands); DONE;") @@ -9006,17 +8891,17 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r") (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "re,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (XOR, DImode, operands)" "@ - xor{q}\t{%2, %0|%0, %2} + xor{q}\t{%2, %0|%0, %2} xor{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "DI,DI")]) (define_insn "*xordi_2_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rem,re")) (const_int 0))) @@ -9026,13 +8911,13 @@ && ix86_match_ccmode (insn, CCNOmode) && ix86_binary_operator_ok (XOR, DImode, operands)" "@ - xor{q}\t{%2, %0|%0, %2} + xor{q}\t{%2, %0|%0, %2} xor{q}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "DI,DI")]) (define_insn "*xordi_3_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rem")) (const_int 0))) @@ -9048,7 +8933,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (xor:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (XOR, SImode, operands); DONE;") @@ -9056,7 +8941,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "ri,rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (XOR, SImode, operands)" "xor{l}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") @@ -9069,7 +8954,7 @@ (zero_extend:DI (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (XOR, SImode, operands)" "xor{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") @@ -9079,14 +8964,14 @@ [(set (match_operand:DI 0 "register_operand" "=r") (xor:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0")) (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (XOR, SImode, operands)" "xor{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) (define_insn "*xorsi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -9101,7 +8986,7 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand ;; ??? Special case for immediate operand is missing - it is tricky. (define_insn "*xorsi_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")) (const_int 0))) @@ -9114,7 +8999,7 @@ (set_attr "mode" "SI")]) (define_insn "*xorsi_2_zext_imm" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand 2 "x86_64_zext_immediate_operand" "Z")) (const_int 0))) @@ -9127,7 +9012,7 @@ (set_attr "mode" "SI")]) (define_insn "*xorsi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rim")) (const_int 0))) @@ -9142,7 +9027,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (xor:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (XOR, HImode, operands); DONE;") @@ -9150,14 +9035,14 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=r,m") (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmi,ri"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (XOR, HImode, operands)" "xor{w}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "HI")]) (define_insn "*xorhi_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rim,ri")) (const_int 0))) @@ -9170,7 +9055,7 @@ (set_attr "mode" "HI")]) (define_insn "*xorhi_3" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rim")) (const_int 0))) @@ -9185,7 +9070,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (xor:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (XOR, QImode, operands); DONE;") @@ -9194,7 +9079,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m,r") (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "qmi,qi,ri"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (XOR, QImode, operands)" "@ xor{b}\t{%2, %0|%0, %2} @@ -9207,7 +9092,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q")) (xor:QI (match_dup 0) (match_operand:QI 1 "general_operand" "qi,qmi"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "xor{b}\t{%1, %0|%0, %1}" @@ -9224,7 +9109,7 @@ (const_int 8) (const_int 8)) (match_operand 2 "const_int_operand" "n"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_size)" "xor{b}\t{%2, %h0|%h0, %2}" [(set_attr "type" "alu") @@ -9242,7 +9127,7 @@ (const_int 8)) (zero_extend:SI (match_operand:QI 2 "general_operand" "Qm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_size)" "xor{b}\t{%2, %h0|%h0, %2}" @@ -9261,7 +9146,7 @@ (const_int 8)) (zero_extend:SI (match_operand 2 "ext_register_operand" "Q")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (!TARGET_PARTIAL_REG_STALL || optimize_size)" "xor{b}\t{%2, %h0|%h0, %2}" @@ -9280,7 +9165,7 @@ (zero_extract:SI (match_operand 2 "ext_register_operand" "Q") (const_int 8) (const_int 8)))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_size)" "xor{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") @@ -9288,7 +9173,7 @@ (set_attr "mode" "QI")]) (define_insn "*xorqi_cc_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0") (match_operand:QI 2 "general_operand" "qim,qi")) @@ -9302,7 +9187,7 @@ (set_attr "mode" "QI")]) (define_insn "*xorqi_2_slp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm") (match_operand:QI 1 "general_operand" "qim,qi")) (const_int 0))) @@ -9316,7 +9201,7 @@ (set_attr "mode" "QI")]) (define_insn "*xorqi_cc_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0") (match_operand:QI 2 "general_operand" "qim")) @@ -9329,7 +9214,7 @@ (set_attr "mode" "QI")]) (define_insn "*xorqi_cc_ext_1" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (zero_extract:SI @@ -9350,7 +9235,7 @@ (set_attr "mode" "QI")]) (define_insn "*xorqi_cc_ext_1_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (xor:SI (zero_extract:SI @@ -9372,7 +9257,7 @@ (define_expand "xorqi_cc_ext_1" [(parallel [ - (set (reg:CCNO 17) + (set (reg:CCNO FLAGS_REG) (compare:CCNO (xor:SI (zero_extract:SI @@ -9394,7 +9279,7 @@ [(set (match_operand 0 "register_operand" "") (xor (match_operand 1 "register_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -9404,7 +9289,7 @@ (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]); operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);") @@ -9415,7 +9300,7 @@ [(set (match_operand 0 "register_operand" "") (xor (match_operand 1 "general_operand" "") (match_operand 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && ANY_QI_REG_P (operands[0]) && (!TARGET_PARTIAL_REG_STALL || optimize_size) @@ -9425,24 +9310,61 @@ [(parallel [(set (strict_low_part (match_dup 0)) (xor:QI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (QImode, operands[0]); operands[1] = gen_lowpart (QImode, operands[1]); operands[2] = gen_lowpart (QImode, operands[2]);") ;; Negation instructions +(define_expand "negti2" + [(parallel [(set (match_operand:TI 0 "nonimmediate_operand" "") + (neg:TI (match_operand:TI 1 "nonimmediate_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" + "ix86_expand_unary_operator (NEG, TImode, operands); DONE;") + +(define_insn "*negti2_1" + [(set (match_operand:TI 0 "nonimmediate_operand" "=ro") + (neg:TI (match_operand:TI 1 "general_operand" "0"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT + && ix86_unary_operator_ok (NEG, TImode, operands)" + "#") + +(define_split + [(set (match_operand:TI 0 "nonimmediate_operand" "") + (neg:TI (match_operand:TI 1 "general_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(parallel + [(set (reg:CCZ FLAGS_REG) + (compare:CCZ (neg:DI (match_dup 2)) (const_int 0))) + (set (match_dup 0) (neg:DI (match_dup 2)))]) + (parallel + [(set (match_dup 1) + (plus:DI (plus:DI (ltu:DI (reg:CC FLAGS_REG) (const_int 0)) + (match_dup 3)) + (const_int 0))) + (clobber (reg:CC FLAGS_REG))]) + (parallel + [(set (match_dup 1) + (neg:DI (match_dup 1))) + (clobber (reg:CC FLAGS_REG))])] + "split_ti (operands+1, 1, operands+2, operands+3); + split_ti (operands+0, 1, operands+0, operands+1);") + (define_expand "negdi2" [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "") (neg:DI (match_operand:DI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "ix86_expand_unary_operator (NEG, DImode, operands); DONE;") (define_insn "*negdi2_1" [(set (match_operand:DI 0 "nonimmediate_operand" "=ro") (neg:DI (match_operand:DI 1 "general_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && ix86_unary_operator_ok (NEG, DImode, operands)" "#") @@ -9450,29 +9372,29 @@ (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (neg:DI (match_operand:DI 1 "general_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && reload_completed" [(parallel - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (neg:SI (match_dup 2)) (const_int 0))) (set (match_dup 0) (neg:SI (match_dup 2)))]) (parallel [(set (match_dup 1) - (plus:SI (plus:SI (ltu:SI (reg:CC 17) (const_int 0)) + (plus:SI (plus:SI (ltu:SI (reg:CC FLAGS_REG) (const_int 0)) (match_dup 3)) (const_int 0))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 1) (neg:SI (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "split_di (operands+1, 1, operands+2, operands+3); split_di (operands+0, 1, operands+0, operands+1);") (define_insn "*negdi2_1_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (neg:DI (match_operand:DI 1 "nonimmediate_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_unary_operator_ok (NEG, DImode, operands)" "neg{q}\t%0" [(set_attr "type" "negnot") @@ -9483,7 +9405,7 @@ ;; flag being the only useful item. (define_insn "*negdi2_cmpz_rex64" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (neg:DI (match_operand:DI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=rm") @@ -9497,14 +9419,14 @@ (define_expand "negsi2" [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") (neg:SI (match_operand:SI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "ix86_expand_unary_operator (NEG, SImode, operands); DONE;") (define_insn "*negsi2_1" [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") (neg:SI (match_operand:SI 1 "nonimmediate_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_unary_operator_ok (NEG, SImode, operands)" "neg{l}\t%0" [(set_attr "type" "negnot") @@ -9516,7 +9438,7 @@ (lshiftrt:DI (neg:DI (ashift:DI (match_operand:DI 1 "register_operand" "0") (const_int 32))) (const_int 32))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_unary_operator_ok (NEG, SImode, operands)" "neg{l}\t%k0" [(set_attr "type" "negnot") @@ -9527,7 +9449,7 @@ ;; flag being the only useful item. (define_insn "*negsi2_cmpz" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (neg:SI (match_operand:SI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm") @@ -9538,7 +9460,7 @@ (set_attr "mode" "SI")]) (define_insn "*negsi2_cmpz_zext" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (lshiftrt:DI (neg:DI (ashift:DI (match_operand:DI 1 "register_operand" "0") @@ -9557,21 +9479,21 @@ (define_expand "neghi2" [(parallel [(set (match_operand:HI 0 "nonimmediate_operand" "") (neg:HI (match_operand:HI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_HIMODE_MATH" "ix86_expand_unary_operator (NEG, HImode, operands); DONE;") (define_insn "*neghi2_1" [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (neg:HI (match_operand:HI 1 "nonimmediate_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_unary_operator_ok (NEG, HImode, operands)" "neg{w}\t%0" [(set_attr "type" "negnot") (set_attr "mode" "HI")]) (define_insn "*neghi2_cmpz" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (neg:HI (match_operand:HI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm") @@ -9584,21 +9506,21 @@ (define_expand "negqi2" [(parallel [(set (match_operand:QI 0 "nonimmediate_operand" "") (neg:QI (match_operand:QI 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "TARGET_QIMODE_MATH" "ix86_expand_unary_operator (NEG, QImode, operands); DONE;") (define_insn "*negqi2_1" [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (neg:QI (match_operand:QI 1 "nonimmediate_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_unary_operator_ok (NEG, QImode, operands)" "neg{b}\t%0" [(set_attr "type" "negnot") (set_attr "mode" "QI")]) (define_insn "*negqi2_cmpz" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (neg:QI (match_operand:QI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") @@ -9611,388 +9533,431 @@ ;; Changing of sign for FP values is doable using integer unit too. (define_expand "negsf2" - [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") - (neg:SF (match_operand:SF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + [(set (match_operand:SF 0 "nonimmediate_operand" "") + (neg:SF (match_operand:SF 1 "nonimmediate_operand" "")))] "TARGET_80387 || TARGET_SSE_MATH" - "if (TARGET_SSE_MATH) - { - /* In case operand is in memory, we will not use SSE. */ - if (memory_operand (operands[0], VOIDmode) - && rtx_equal_p (operands[0], operands[1])) - emit_insn (gen_negsf2_memory (operands[0], operands[1])); - else - { - /* Using SSE is tricky, since we need bitwise negation of -0 - in register. */ - rtx reg = gen_reg_rtx (SFmode); - rtx dest = operands[0]; - rtx imm = gen_lowpart (SFmode, gen_int_mode (0x80000000, SImode)); + "ix86_expand_fp_absneg_operator (NEG, SFmode, operands); DONE;") - operands[1] = force_reg (SFmode, operands[1]); - operands[0] = force_reg (SFmode, operands[0]); - reg = force_reg (V4SFmode, - gen_rtx_CONST_VECTOR (V4SFmode, - gen_rtvec (4, imm, CONST0_RTX (SFmode), - CONST0_RTX (SFmode), - CONST0_RTX (SFmode)))); - emit_insn (gen_negsf2_ifs (operands[0], operands[1], reg)); - if (dest != operands[0]) - emit_move_insn (dest, operands[0]); - } - DONE; - } - ix86_expand_unary_operator (NEG, SFmode, operands); DONE;") +(define_expand "abssf2" + [(set (match_operand:SF 0 "nonimmediate_operand" "") + (abs:SF (match_operand:SF 1 "nonimmediate_operand" "")))] + "TARGET_80387 || TARGET_SSE_MATH" + "ix86_expand_fp_absneg_operator (ABS, SFmode, operands); DONE;") -(define_insn "negsf2_memory" - [(set (match_operand:SF 0 "memory_operand" "=m") - (neg:SF (match_operand:SF 1 "memory_operand" "0"))) - (clobber (reg:CC 17))] - "ix86_unary_operator_ok (NEG, SFmode, operands)" +(define_insn "*absnegsf2_mixed" + [(set (match_operand:SF 0 "nonimmediate_operand" "=x ,x,f,rm") + (match_operator:SF 3 "absneg_operator" + [(match_operand:SF 1 "nonimmediate_operand" "0 ,x,0,0 ")])) + (use (match_operand:V4SF 2 "nonimmediate_operand" "xm ,0,X,X ")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_SSE_MATH && TARGET_MIX_SSE_I387 + && ix86_unary_operator_ok (GET_CODE (operands[3]), SFmode, operands)" "#") -(define_insn "negsf2_ifs" - [(set (match_operand:SF 0 "nonimmediate_operand" "=x#fr,x#fr,f#xr,rm#xf") - (neg:SF (match_operand:SF 1 "nonimmediate_operand" "0,x#fr,0,0"))) - (use (match_operand:V4SF 2 "nonimmediate_operand" "xm,0,xm*r,xm*r")) - (clobber (reg:CC 17))] - "TARGET_SSE - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" +(define_insn "*absnegsf2_sse" + [(set (match_operand:SF 0 "nonimmediate_operand" "=x,x,rm") + (match_operator:SF 3 "absneg_operator" + [(match_operand:SF 1 "nonimmediate_operand" "0 ,x,0")])) + (use (match_operand:V4SF 2 "nonimmediate_operand" "xm,0,X")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_SSE_MATH + && ix86_unary_operator_ok (GET_CODE (operands[3]), SFmode, operands)" "#") -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (neg:SF (match_operand:SF 1 "memory_operand" ""))) - (use (match_operand:SF 2 "" "")) - (clobber (reg:CC 17))] - "" - [(parallel [(set (match_dup 0) - (neg:SF (match_dup 1))) - (clobber (reg:CC 17))])]) +(define_insn "*absnegsf2_i387" + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,rm") + (match_operator:SF 3 "absneg_operator" + [(match_operand:SF 1 "nonimmediate_operand" "0,0")])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_80387 && !TARGET_SSE_MATH + && ix86_unary_operator_ok (GET_CODE (operands[3]), SFmode, operands)" + "#") -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (neg:SF (match_operand:SF 1 "register_operand" ""))) - (use (match_operand:V4SF 2 "" "")) - (clobber (reg:CC 17))] - "reload_completed && !SSE_REG_P (operands[0])" - [(parallel [(set (match_dup 0) - (neg:SF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (neg:SF (match_operand:SF 1 "register_operand" ""))) - (use (match_operand:V4SF 2 "nonimmediate_operand" "")) - (clobber (reg:CC 17))] - "reload_completed && SSE_REG_P (operands[0])" - [(set (match_dup 0) - (xor:V4SF (match_dup 1) - (match_dup 2)))] +(define_expand "copysignsf3" + [(match_operand:SF 0 "register_operand" "") + (match_operand:SF 1 "nonmemory_operand" "") + (match_operand:SF 2 "register_operand" "")] + "TARGET_SSE_MATH" { - operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - operands[1] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - if (operands_match_p (operands[0], operands[2])) - { - rtx tmp; - tmp = operands[1]; - operands[1] = operands[2]; - operands[2] = tmp; - } + ix86_expand_copysign (operands); + DONE; }) +(define_insn_and_split "copysignsf3_const" + [(set (match_operand:SF 0 "register_operand" "=x") + (unspec:SF + [(match_operand:V4SF 1 "vector_move_operand" "xmC") + (match_operand:SF 2 "register_operand" "0") + (match_operand:V4SF 3 "nonimmediate_operand" "xm")] + UNSPEC_COPYSIGN))] + "TARGET_SSE_MATH" + "#" + "&& reload_completed" + [(const_int 0)] +{ + ix86_split_copysign_const (operands); + DONE; +}) -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*negsf2_if" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f#r,rm#f") - (neg:SF (match_operand:SF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 - && ix86_unary_operator_ok (NEG, SFmode, operands)" +(define_insn "copysignsf3_var" + [(set (match_operand:SF 0 "register_operand" "=x, x, x, x,x") + (unspec:SF + [(match_operand:SF 2 "register_operand" " x, 0, 0, x,x") + (match_operand:SF 3 "register_operand" " 1, 1, x, 1,x") + (match_operand:V4SF 4 "nonimmediate_operand" " X,xm,xm, 0,0") + (match_operand:V4SF 5 "nonimmediate_operand" " 0,xm, 1,xm,1")] + UNSPEC_COPYSIGN)) + (clobber (match_scratch:V4SF 1 "=x, x, x, x,x"))] + "TARGET_SSE_MATH" "#") (define_split - [(set (match_operand:SF 0 "fp_register_operand" "") - (neg:SF (match_operand:SF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (neg:SF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:SF 0 "register_and_not_fp_reg_operand" "") - (neg:SF (match_operand:SF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (xor:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = gen_int_mode (0x80000000, SImode); - operands[0] = gen_lowpart (SImode, operands[0]);") - -(define_split - [(set (match_operand 0 "memory_operand" "") - (neg (match_operand 1 "memory_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" - [(parallel [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] + [(set (match_operand:SF 0 "register_operand" "") + (unspec:SF + [(match_operand:SF 2 "register_operand" "") + (match_operand:SF 3 "register_operand" "") + (match_operand:V4SF 4 "" "") + (match_operand:V4SF 5 "" "")] + UNSPEC_COPYSIGN)) + (clobber (match_scratch:V4SF 1 ""))] + "TARGET_SSE_MATH && reload_completed" + [(const_int 0)] { - int size = GET_MODE_SIZE (GET_MODE (operands[1])); - - if (GET_MODE (operands[1]) == XFmode) - size = 10; - operands[0] = adjust_address (operands[0], QImode, size - 1); - operands[1] = gen_int_mode (0x80, QImode); + ix86_split_copysign_var (operands); + DONE; }) (define_expand "negdf2" - [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] + [(set (match_operand:DF 0 "nonimmediate_operand" "") + (neg:DF (match_operand:DF 1 "nonimmediate_operand" "")))] "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" - "if (TARGET_SSE2 && TARGET_SSE_MATH) - { - /* In case operand is in memory, we will not use SSE. */ - if (memory_operand (operands[0], VOIDmode) - && rtx_equal_p (operands[0], operands[1])) - emit_insn (gen_negdf2_memory (operands[0], operands[1])); - else - { - /* Using SSE is tricky, since we need bitwise negation of -0 - in register. */ - rtx reg; -#if HOST_BITS_PER_WIDE_INT >= 64 - rtx imm = gen_int_mode (((HOST_WIDE_INT)1) << 63, DImode); -#else - rtx imm = immed_double_const (0, 0x80000000, DImode); -#endif - rtx dest = operands[0]; + "ix86_expand_fp_absneg_operator (NEG, DFmode, operands); DONE;") - operands[1] = force_reg (DFmode, operands[1]); - operands[0] = force_reg (DFmode, operands[0]); - imm = gen_lowpart (DFmode, imm); - reg = force_reg (V2DFmode, - gen_rtx_CONST_VECTOR (V2DFmode, - gen_rtvec (2, imm, CONST0_RTX (DFmode)))); - emit_insn (gen_negdf2_ifs (operands[0], operands[1], reg)); - if (dest != operands[0]) - emit_move_insn (dest, operands[0]); - } - DONE; - } - ix86_expand_unary_operator (NEG, DFmode, operands); DONE;") +(define_expand "absdf2" + [(set (match_operand:DF 0 "nonimmediate_operand" "") + (abs:DF (match_operand:DF 1 "nonimmediate_operand" "")))] + "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" + "ix86_expand_fp_absneg_operator (ABS, DFmode, operands); DONE;") -(define_insn "negdf2_memory" - [(set (match_operand:DF 0 "memory_operand" "=m") - (neg:DF (match_operand:DF 1 "memory_operand" "0"))) - (clobber (reg:CC 17))] - "ix86_unary_operator_ok (NEG, DFmode, operands)" +(define_insn "*absnegdf2_mixed" + [(set (match_operand:DF 0 "nonimmediate_operand" "=Y,Y,f,rm") + (match_operator:DF 3 "absneg_operator" + [(match_operand:DF 1 "nonimmediate_operand" "0 ,Y,0,0")])) + (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,X,X")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_SSE2 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387 + && ix86_unary_operator_ok (GET_CODE (operands[3]), DFmode, operands)" "#") -(define_insn "negdf2_ifs" - [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,f#Yr,rm#Yf") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0,0"))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r,Ym*r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_SSE2 - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" +(define_insn "*absnegdf2_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=Y,Y,rm") + (match_operator:DF 3 "absneg_operator" + [(match_operand:DF 1 "nonimmediate_operand" "0 ,Y,0 ")])) + (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,X ")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_SSE2 && TARGET_SSE_MATH + && ix86_unary_operator_ok (GET_CODE (operands[3]), DFmode, operands)" "#") -(define_insn "*negdf2_ifs_rex64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#f,Y#f,fm#Y") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0"))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r")) - (clobber (reg:CC 17))] - "TARGET_64BIT && TARGET_SSE2 - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" +(define_insn "*absnegdf2_i387" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,rm") + (match_operator:DF 3 "absneg_operator" + [(match_operand:DF 1 "nonimmediate_operand" "0,0")])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH) + && ix86_unary_operator_ok (GET_CODE (operands[3]), DFmode, operands)" "#") -(define_split - [(set (match_operand:DF 0 "memory_operand" "") - (neg:DF (match_operand:DF 1 "memory_operand" ""))) - (use (match_operand:V2DF 2 "" "")) - (clobber (reg:CC 17))] - "" - [(parallel [(set (match_dup 0) - (neg:DF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (neg:DF (match_operand:DF 1 "register_operand" ""))) - (use (match_operand:V2DF 2 "" "")) - (clobber (reg:CC 17))] - "reload_completed && !SSE_REG_P (operands[0]) - && (!TARGET_64BIT || FP_REG_P (operands[0]))" - [(parallel [(set (match_dup 0) - (neg:DF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (neg:DF (match_operand:DF 1 "register_operand" ""))) - (use (match_operand:V2DF 2 "" "")) - (clobber (reg:CC 17))] - "TARGET_64BIT && reload_completed && GENERAL_REG_P (operands[0])" - [(parallel [(set (match_dup 0) - (xor:DI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] - "operands[0] = gen_lowpart (DImode, operands[0]); - operands[1] = gen_lowpart (DImode, operands[1]); - operands[2] = gen_lowpart (DImode, operands[2]);") - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (neg:DF (match_operand:DF 1 "register_operand" ""))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "")) - (clobber (reg:CC 17))] - "reload_completed && SSE_REG_P (operands[0])" - [(set (match_dup 0) - (xor:V2DF (match_dup 1) - (match_dup 2)))] +(define_expand "copysigndf3" + [(match_operand:DF 0 "register_operand" "") + (match_operand:DF 1 "nonmemory_operand" "") + (match_operand:DF 2 "register_operand" "")] + "TARGET_SSE2 && TARGET_SSE_MATH" { - operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - operands[1] = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); - /* Avoid possible reformatting on the operands. */ - if (TARGET_SSE_PARTIAL_REGS && !optimize_size) - emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0])); + ix86_expand_copysign (operands); + DONE; +}) + +(define_insn_and_split "copysigndf3_const" + [(set (match_operand:DF 0 "register_operand" "=x") + (unspec:DF + [(match_operand:V2DF 1 "vector_move_operand" "xmC") + (match_operand:DF 2 "register_operand" "0") + (match_operand:V2DF 3 "nonimmediate_operand" "xm")] + UNSPEC_COPYSIGN))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "#" + "&& reload_completed" + [(const_int 0)] +{ + ix86_split_copysign_const (operands); + DONE; +}) + +(define_insn "copysigndf3_var" + [(set (match_operand:DF 0 "register_operand" "=x, x, x, x,x") + (unspec:DF + [(match_operand:DF 2 "register_operand" " x, 0, 0, x,x") + (match_operand:DF 3 "register_operand" " 1, 1, x, 1,x") + (match_operand:V2DF 4 "nonimmediate_operand" " X,xm,xm, 0,0") + (match_operand:V2DF 5 "nonimmediate_operand" " 0,xm, 1,xm,1")] + UNSPEC_COPYSIGN)) + (clobber (match_scratch:V2DF 1 "=x, x, x, x,x"))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "#") + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF + [(match_operand:DF 2 "register_operand" "") + (match_operand:DF 3 "register_operand" "") + (match_operand:V2DF 4 "" "") + (match_operand:V2DF 5 "" "")] + UNSPEC_COPYSIGN)) + (clobber (match_scratch:V2DF 1 ""))] + "TARGET_SSE2 && TARGET_SSE_MATH && reload_completed" + [(const_int 0)] +{ + ix86_split_copysign_var (operands); + DONE; +}) + +(define_expand "negxf2" + [(set (match_operand:XF 0 "nonimmediate_operand" "") + (neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))] + "TARGET_80387" + "ix86_expand_fp_absneg_operator (NEG, XFmode, operands); DONE;") + +(define_expand "absxf2" + [(set (match_operand:XF 0 "nonimmediate_operand" "") + (abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))] + "TARGET_80387" + "ix86_expand_fp_absneg_operator (ABS, XFmode, operands); DONE;") + +(define_insn "*absnegxf2_i387" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,?rm") + (match_operator:XF 3 "absneg_operator" + [(match_operand:XF 1 "nonimmediate_operand" "0,0")])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_80387 + && ix86_unary_operator_ok (GET_CODE (operands[3]), XFmode, operands)" + "#") + +;; Splitters for fp abs and neg. + +(define_split + [(set (match_operand 0 "fp_register_operand" "") + (match_operator 1 "absneg_operator" [(match_dup 0)])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + [(set (match_dup 0) (match_op_dup 1 [(match_dup 0)]))]) + +(define_split + [(set (match_operand 0 "register_operand" "") + (match_operator 3 "absneg_operator" + [(match_operand 1 "register_operand" "")])) + (use (match_operand 2 "nonimmediate_operand" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed && SSE_REG_P (operands[0])" + [(set (match_dup 0) (match_dup 3))] +{ + enum machine_mode mode = GET_MODE (operands[0]); + enum machine_mode vmode = GET_MODE (operands[2]); + rtx tmp; + + operands[0] = simplify_gen_subreg (vmode, operands[0], mode, 0); + operands[1] = simplify_gen_subreg (vmode, operands[1], mode, 0); if (operands_match_p (operands[0], operands[2])) { - rtx tmp; tmp = operands[1]; operands[1] = operands[2]; operands[2] = tmp; } + if (GET_CODE (operands[3]) == ABS) + tmp = gen_rtx_AND (vmode, operands[1], operands[2]); + else + tmp = gen_rtx_XOR (vmode, operands[1], operands[2]); + operands[3] = tmp; }) -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*negdf2_if" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f#r,rm#f") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_80387 - && ix86_unary_operator_ok (NEG, DFmode, operands)" - "#") - -;; FIXME: We should to allow integer registers here. Problem is that -;; we need another scratch register to get constant from. -;; Forcing constant to mem if no register available in peep2 should be -;; safe even for PIC mode, because of RIP relative addressing. -(define_insn "*negdf2_if_rex64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,mf") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_64BIT && TARGET_80387 - && ix86_unary_operator_ok (NEG, DFmode, operands)" - "#") +(define_split + [(set (match_operand:SF 0 "register_operand" "") + (match_operator:SF 1 "absneg_operator" [(match_dup 0)])) + (use (match_operand:V4SF 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + [(parallel [(set (match_dup 0) (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + rtx tmp; + operands[0] = gen_lowpart (SImode, operands[0]); + if (GET_CODE (operands[1]) == ABS) + { + tmp = gen_int_mode (0x7fffffff, SImode); + tmp = gen_rtx_AND (SImode, operands[0], tmp); + } + else + { + tmp = gen_int_mode (0x80000000, SImode); + tmp = gen_rtx_XOR (SImode, operands[0], tmp); + } + operands[1] = tmp; +}) (define_split - [(set (match_operand:DF 0 "fp_register_operand" "") - (neg:DF (match_operand:DF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (neg:DF (match_dup 1)))] - "") + [(set (match_operand:DF 0 "register_operand" "") + (match_operator:DF 1 "absneg_operator" [(match_dup 0)])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + [(parallel [(set (match_dup 0) (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + rtx tmp; + if (TARGET_64BIT) + { + tmp = gen_lowpart (DImode, operands[0]); + tmp = gen_rtx_ZERO_EXTRACT (DImode, tmp, const1_rtx, GEN_INT (63)); + operands[0] = tmp; + + if (GET_CODE (operands[1]) == ABS) + tmp = const0_rtx; + else + tmp = gen_rtx_NOT (DImode, tmp); + } + else + { + operands[0] = gen_highpart (SImode, operands[0]); + if (GET_CODE (operands[1]) == ABS) + { + tmp = gen_int_mode (0x7fffffff, SImode); + tmp = gen_rtx_AND (SImode, operands[0], tmp); + } + else + { + tmp = gen_int_mode (0x80000000, SImode); + tmp = gen_rtx_XOR (SImode, operands[0], tmp); + } + } + operands[1] = tmp; +}) (define_split - [(set (match_operand:DF 0 "register_and_not_fp_reg_operand" "") - (neg:DF (match_operand:DF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 3) (xor:SI (match_dup 3) (match_dup 4))) - (clobber (reg:CC 17))])] - "operands[4] = gen_int_mode (0x80000000, SImode); - split_di (operands+0, 1, operands+2, operands+3);") - -(define_expand "negxf2" - [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") - (neg:XF (match_operand:XF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_80387" - "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;") - -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*negxf2_if" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f") - (neg:XF (match_operand:XF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 - && ix86_unary_operator_ok (NEG, XFmode, operands)" - "#") + [(set (match_operand:XF 0 "register_operand" "") + (match_operator:XF 1 "absneg_operator" [(match_dup 0)])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + [(parallel [(set (match_dup 0) (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + rtx tmp; + operands[0] = gen_rtx_REG (SImode, + true_regnum (operands[0]) + + (TARGET_64BIT ? 1 : 2)); + if (GET_CODE (operands[1]) == ABS) + { + tmp = GEN_INT (0x7fff); + tmp = gen_rtx_AND (SImode, operands[0], tmp); + } + else + { + tmp = GEN_INT (0x8000); + tmp = gen_rtx_XOR (SImode, operands[0], tmp); + } + operands[1] = tmp; +}) (define_split - [(set (match_operand:XF 0 "fp_register_operand" "") - (neg:XF (match_operand:XF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (neg:XF (match_dup 1)))] - "") + [(set (match_operand 0 "memory_operand" "") + (match_operator 1 "absneg_operator" [(match_dup 0)])) + (use (match_operand 2 "" "")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + [(parallel [(set (match_dup 0) (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])] +{ + enum machine_mode mode = GET_MODE (operands[0]); + int size = mode == XFmode ? 10 : GET_MODE_SIZE (mode); + rtx tmp; -(define_split - [(set (match_operand:XF 0 "register_and_not_fp_reg_operand" "") - (neg:XF (match_operand:XF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (xor:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = GEN_INT (0x8000); - operands[0] = gen_rtx_REG (SImode, - true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") + operands[0] = adjust_address (operands[0], QImode, size - 1); + if (GET_CODE (operands[1]) == ABS) + { + tmp = gen_int_mode (0x7f, QImode); + tmp = gen_rtx_AND (QImode, operands[0], tmp); + } + else + { + tmp = gen_int_mode (0x80, QImode); + tmp = gen_rtx_XOR (QImode, operands[0], tmp); + } + operands[1] = tmp; +}) -;; Conditionalize these after reload. If they matches before reload, we +;; Conditionalize these after reload. If they match before reload, we ;; lose the clobber and ability to use integer instructions. (define_insn "*negsf2_1" [(set (match_operand:SF 0 "register_operand" "=f") (neg:SF (match_operand:SF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" + "TARGET_80387 && (reload_completed || !TARGET_SSE_MATH)" "fchs" [(set_attr "type" "fsgn") - (set_attr "mode" "SF") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "SF")]) (define_insn "*negdf2_1" [(set (match_operand:DF 0 "register_operand" "=f") (neg:DF (match_operand:DF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" + "TARGET_80387 && (reload_completed || !(TARGET_SSE2 && TARGET_SSE_MATH))" "fchs" [(set_attr "type" "fsgn") - (set_attr "mode" "DF") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "DF")]) + +(define_insn "*negxf2_1" + [(set (match_operand:XF 0 "register_operand" "=f") + (neg:XF (match_operand:XF 1 "register_operand" "0")))] + "TARGET_80387" + "fchs" + [(set_attr "type" "fsgn") + (set_attr "mode" "XF")]) + +(define_insn "*abssf2_1" + [(set (match_operand:SF 0 "register_operand" "=f") + (abs:SF (match_operand:SF 1 "register_operand" "0")))] + "TARGET_80387 && (reload_completed || !TARGET_SSE_MATH)" + "fabs" + [(set_attr "type" "fsgn") + (set_attr "mode" "SF")]) + +(define_insn "*absdf2_1" + [(set (match_operand:DF 0 "register_operand" "=f") + (abs:DF (match_operand:DF 1 "register_operand" "0")))] + "TARGET_80387 && (reload_completed || !(TARGET_SSE2 && TARGET_SSE_MATH))" + "fabs" + [(set_attr "type" "fsgn") + (set_attr "mode" "DF")]) + +(define_insn "*absxf2_1" + [(set (match_operand:XF 0 "register_operand" "=f") + (abs:XF (match_operand:XF 1 "register_operand" "0")))] + "TARGET_80387" + "fabs" + [(set_attr "type" "fsgn") + (set_attr "mode" "DF")]) (define_insn "*negextendsfdf2" [(set (match_operand:DF 0 "register_operand" "=f") (neg:DF (float_extend:DF (match_operand:SF 1 "register_operand" "0"))))] - "TARGET_80387" + "TARGET_80387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)" "fchs" [(set_attr "type" "fsgn") - (set_attr "mode" "DF") - (set_attr "ppro_uops" "few")]) - -(define_insn "*negxf2_1" - [(set (match_operand:XF 0 "register_operand" "=f") - (neg:XF (match_operand:XF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" - "fchs" - [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "DF")]) (define_insn "*negextenddfxf2" [(set (match_operand:XF 0 "register_operand" "=f") @@ -10001,8 +9966,7 @@ "TARGET_80387" "fchs" [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) + (set_attr "mode" "XF")]) (define_insn "*negextendsfxf2" [(set (match_operand:XF 0 "register_operand" "=f") @@ -10011,372 +9975,13 @@ "TARGET_80387" "fchs" [(set_attr "type" "fsgn") - (set_attr "mode" "XF") - (set_attr "ppro_uops" "few")]) - -;; Absolute value instructions - -(define_expand "abssf2" - [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") - (neg:SF (match_operand:SF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_80387 || TARGET_SSE_MATH" - "if (TARGET_SSE_MATH) - { - /* In case operand is in memory, we will not use SSE. */ - if (memory_operand (operands[0], VOIDmode) - && rtx_equal_p (operands[0], operands[1])) - emit_insn (gen_abssf2_memory (operands[0], operands[1])); - else - { - /* Using SSE is tricky, since we need bitwise negation of -0 - in register. */ - rtx reg = gen_reg_rtx (V4SFmode); - rtx dest = operands[0]; - rtx imm; - - operands[1] = force_reg (SFmode, operands[1]); - operands[0] = force_reg (SFmode, operands[0]); - imm = gen_lowpart (SFmode, gen_int_mode(~0x80000000, SImode)); - reg = force_reg (V4SFmode, - gen_rtx_CONST_VECTOR (V4SFmode, - gen_rtvec (4, imm, CONST0_RTX (SFmode), - CONST0_RTX (SFmode), - CONST0_RTX (SFmode)))); - emit_insn (gen_abssf2_ifs (operands[0], operands[1], reg)); - if (dest != operands[0]) - emit_move_insn (dest, operands[0]); - } - DONE; - } - ix86_expand_unary_operator (ABS, SFmode, operands); DONE;") - -(define_insn "abssf2_memory" - [(set (match_operand:SF 0 "memory_operand" "=m") - (abs:SF (match_operand:SF 1 "memory_operand" "0"))) - (clobber (reg:CC 17))] - "ix86_unary_operator_ok (ABS, SFmode, operands)" - "#") - -(define_insn "abssf2_ifs" - [(set (match_operand:SF 0 "nonimmediate_operand" "=x#fr,x#fr,f#xr,rm#xf") - (abs:SF (match_operand:SF 1 "nonimmediate_operand" "0,x#fr,0,0"))) - (use (match_operand:V4SF 2 "nonimmediate_operand" "xm,0,xm*r,xm*r")) - (clobber (reg:CC 17))] - "TARGET_SSE - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" - "#") - -(define_split - [(set (match_operand:SF 0 "memory_operand" "") - (abs:SF (match_operand:SF 1 "memory_operand" ""))) - (use (match_operand:V4SF 2 "" "")) - (clobber (reg:CC 17))] - "" - [(parallel [(set (match_dup 0) - (abs:SF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (abs:SF (match_operand:SF 1 "register_operand" ""))) - (use (match_operand:V4SF 2 "" "")) - (clobber (reg:CC 17))] - "reload_completed && !SSE_REG_P (operands[0])" - [(parallel [(set (match_dup 0) - (abs:SF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (abs:SF (match_operand:SF 1 "register_operand" ""))) - (use (match_operand:V4SF 2 "nonimmediate_operand" "")) - (clobber (reg:CC 17))] - "reload_completed && SSE_REG_P (operands[0])" - [(set (match_dup 0) - (and:V4SF (match_dup 1) - (match_dup 2)))] -{ - operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - operands[1] = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0); - if (operands_match_p (operands[0], operands[2])) - { - rtx tmp; - tmp = operands[1]; - operands[1] = operands[2]; - operands[2] = tmp; - } -}) - -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*abssf2_if" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f#r,rm#f") - (abs:SF (match_operand:SF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 && ix86_unary_operator_ok (ABS, SFmode, operands)" - "#") - -(define_split - [(set (match_operand:SF 0 "fp_register_operand" "") - (abs:SF (match_operand:SF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (abs:SF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:SF 0 "register_and_not_fp_reg_operand" "") - (abs:SF (match_operand:SF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = gen_int_mode (~0x80000000, SImode); - operands[0] = gen_lowpart (SImode, operands[0]);") - -(define_split - [(set (match_operand 0 "memory_operand" "") - (abs (match_operand 1 "memory_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" - [(parallel [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] -{ - int size = GET_MODE_SIZE (GET_MODE (operands[1])); - - if (GET_MODE (operands[1]) == XFmode) - size = 10; - operands[0] = adjust_address (operands[0], QImode, size - 1); - operands[1] = gen_int_mode (~0x80, QImode); -}) - -(define_expand "absdf2" - [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") - (neg:DF (match_operand:DF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" - "if (TARGET_SSE2 && TARGET_SSE_MATH) - { - /* In case operand is in memory, we will not use SSE. */ - if (memory_operand (operands[0], VOIDmode) - && rtx_equal_p (operands[0], operands[1])) - emit_insn (gen_absdf2_memory (operands[0], operands[1])); - else - { - /* Using SSE is tricky, since we need bitwise negation of -0 - in register. */ - rtx reg = gen_reg_rtx (V2DFmode); -#if HOST_BITS_PER_WIDE_INT >= 64 - rtx imm = gen_int_mode (~(((HOST_WIDE_INT)1) << 63), DImode); -#else - rtx imm = immed_double_const (~0, ~0x80000000, DImode); -#endif - rtx dest = operands[0]; - - operands[1] = force_reg (DFmode, operands[1]); - operands[0] = force_reg (DFmode, operands[0]); - - /* Produce LONG_DOUBLE with the proper immediate argument. */ - imm = gen_lowpart (DFmode, imm); - reg = force_reg (V2DFmode, - gen_rtx_CONST_VECTOR (V2DFmode, - gen_rtvec (2, imm, CONST0_RTX (DFmode)))); - emit_insn (gen_absdf2_ifs (operands[0], operands[1], reg)); - if (dest != operands[0]) - emit_move_insn (dest, operands[0]); - } - DONE; - } - ix86_expand_unary_operator (ABS, DFmode, operands); DONE;") - -(define_insn "absdf2_memory" - [(set (match_operand:DF 0 "memory_operand" "=m") - (abs:DF (match_operand:DF 1 "memory_operand" "0"))) - (clobber (reg:CC 17))] - "ix86_unary_operator_ok (ABS, DFmode, operands)" - "#") - -(define_insn "absdf2_ifs" - [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,mf#Yr,mr#Yf") - (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0,0"))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r,Ym*r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_SSE2 - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" - "#") - -(define_insn "*absdf2_ifs_rex64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=Y#fr,Y#fr,mf#Yr") - (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,Y#fr,0"))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "Ym,0,Ym*r")) - (clobber (reg:CC 17))] - "TARGET_64BIT && TARGET_SSE2 - && (reload_in_progress || reload_completed - || (register_operand (operands[0], VOIDmode) - && register_operand (operands[1], VOIDmode)))" - "#") - -(define_split - [(set (match_operand:DF 0 "memory_operand" "") - (abs:DF (match_operand:DF 1 "memory_operand" ""))) - (use (match_operand:V2DF 2 "" "")) - (clobber (reg:CC 17))] - "" - [(parallel [(set (match_dup 0) - (abs:DF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (abs:DF (match_operand:DF 1 "register_operand" ""))) - (use (match_operand:V2DF 2 "" "")) - (clobber (reg:CC 17))] - "reload_completed && !SSE_REG_P (operands[0])" - [(parallel [(set (match_dup 0) - (abs:DF (match_dup 1))) - (clobber (reg:CC 17))])]) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (abs:DF (match_operand:DF 1 "register_operand" ""))) - (use (match_operand:V2DF 2 "nonimmediate_operand" "")) - (clobber (reg:CC 17))] - "reload_completed && SSE_REG_P (operands[0])" - [(set (match_dup 0) - (and:V2DF (match_dup 1) - (match_dup 2)))] -{ - operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - operands[1] = simplify_gen_subreg (V2DFmode, operands[1], DFmode, 0); - /* Avoid possible reformatting on the operands. */ - if (TARGET_SSE_PARTIAL_REGS && !optimize_size) - emit_insn (gen_sse2_unpcklpd (operands[0], operands[0], operands[0])); - if (operands_match_p (operands[0], operands[2])) - { - rtx tmp; - tmp = operands[1]; - operands[1] = operands[2]; - operands[2] = tmp; - } -}) - - -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*absdf2_if" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f#r,rm#f") - (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_80387 - && ix86_unary_operator_ok (ABS, DFmode, operands)" - "#") - -;; FIXME: We should to allow integer registers here. Problem is that -;; we need another scratch register to get constant from. -;; Forcing constant to mem if no register available in peep2 should be -;; safe even for PIC mode, because of RIP relative addressing. -(define_insn "*absdf2_if_rex64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,mf") - (abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_64BIT && TARGET_80387 - && ix86_unary_operator_ok (ABS, DFmode, operands)" - "#") - -(define_split - [(set (match_operand:DF 0 "fp_register_operand" "") - (abs:DF (match_operand:DF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (abs:DF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:DF 0 "register_and_not_fp_reg_operand" "") - (abs:DF (match_operand:DF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 3) (and:SI (match_dup 3) (match_dup 4))) - (clobber (reg:CC 17))])] - "operands[4] = gen_int_mode (~0x80000000, SImode); - split_di (operands+0, 1, operands+2, operands+3);") - -(define_expand "absxf2" - [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") - (neg:XF (match_operand:XF 1 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_80387" - "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;") - -;; Keep 'f' and 'r' in separate alternatives to avoid reload problems -;; because of secondary memory needed to reload from class FLOAT_INT_REGS -;; to itself. -(define_insn "*absxf2_if" - [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f") - (abs:XF (match_operand:XF 1 "nonimmediate_operand" "0,0"))) - (clobber (reg:CC 17))] - "TARGET_80387 - && ix86_unary_operator_ok (ABS, XFmode, operands)" - "#") - -(define_split - [(set (match_operand:XF 0 "fp_register_operand" "") - (abs:XF (match_operand:XF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(set (match_dup 0) - (abs:XF (match_dup 1)))] - "") - -(define_split - [(set (match_operand:XF 0 "register_and_not_fp_reg_operand" "") - (abs:XF (match_operand:XF 1 "register_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_80387 && reload_completed" - [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] - "operands[1] = GEN_INT (~0x8000); - operands[0] = gen_rtx_REG (SImode, - true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));") - -(define_insn "*abssf2_1" - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "SF")]) - -(define_insn "*absdf2_1" - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "DF")]) + (set_attr "mode" "XF")]) (define_insn "*absextendsfdf2" [(set (match_operand:DF 0 "register_operand" "=f") (abs:DF (float_extend:DF (match_operand:SF 1 "register_operand" "0"))))] - "TARGET_80387" - "fabs" - [(set_attr "type" "fsgn") - (set_attr "mode" "DF")]) - -(define_insn "*absxf2_1" - [(set (match_operand:XF 0 "register_operand" "=f") - (abs:XF (match_operand:XF 1 "register_operand" "0")))] - "TARGET_80387 && reload_completed" + "TARGET_80387 && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)" "fabs" [(set_attr "type" "fsgn") (set_attr "mode" "DF")]) @@ -10416,7 +10021,7 @@ (set_attr "mode" "DI")]) (define_insn "*one_cmpldi2_2_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (not:DI (match_operand:DI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=rm") @@ -10467,7 +10072,7 @@ (set_attr "mode" "SI")]) (define_insn "*one_cmplsi2_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (not:SI (match_operand:SI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm") @@ -10495,7 +10100,7 @@ ;; ??? Currently never generated - xor is used instead. (define_insn "*one_cmplsi2_2_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (not:SI (match_operand:SI 1 "register_operand" "0")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") @@ -10536,7 +10141,7 @@ (set_attr "mode" "HI")]) (define_insn "*one_cmplhi2_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (not:HI (match_operand:HI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm") @@ -10580,7 +10185,7 @@ (set_attr "mode" "QI,SI")]) (define_insn "*one_cmplqi2_2" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (not:QI (match_operand:QI 1 "nonimmediate_operand" "0")) (const_int 0))) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") @@ -10630,42 +10235,116 @@ ;; shift pair, instead using moves and sign extension for counts greater ;; than 31. -(define_expand "ashldi3" - [(parallel [(set (match_operand:DI 0 "shiftdi_operand" "") - (ashift:DI (match_operand:DI 1 "shiftdi_operand" "") +(define_expand "ashlti3" + [(parallel [(set (match_operand:TI 0 "register_operand" "") + (ashift:TI (match_operand:TI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))])] - "" + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" { - if (!TARGET_64BIT && TARGET_CMOVE && ! immediate_operand (operands[2], QImode)) + if (! immediate_operand (operands[2], QImode)) { - emit_insn (gen_ashldi3_1 (operands[0], operands[1], operands[2])); + emit_insn (gen_ashlti3_1 (operands[0], operands[1], operands[2])); DONE; } - ix86_expand_binary_operator (ASHIFT, DImode, operands); + ix86_expand_binary_operator (ASHIFT, TImode, operands); DONE; }) +(define_insn "ashlti3_1" + [(set (match_operand:TI 0 "register_operand" "=r") + (ashift:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "register_operand" "c"))) + (clobber (match_scratch:DI 3 "=&r")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_insn "*ashlti3_2" + [(set (match_operand:TI 0 "register_operand" "=r") + (ashift:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "immediate_operand" "O"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (ashift:TI (match_operand:TI 1 "nonmemory_operand" "") + (match_operand:QI 2 "register_operand" ""))) + (clobber (match_scratch:DI 3 "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_ashl (operands, operands[3], TImode); DONE;") + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (ashift:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "immediate_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_ashl (operands, NULL_RTX, TImode); DONE;") + +(define_insn "x86_64_shld" + [(set (match_operand:DI 0 "nonimmediate_operand" "+r*m,r*m") + (ior:DI (ashift:DI (match_dup 0) + (match_operand:QI 2 "nonmemory_operand" "J,c")) + (lshiftrt:DI (match_operand:DI 1 "register_operand" "r,r") + (minus:QI (const_int 64) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "@ + shld{q}\t{%2, %1, %0|%0, %1, %2} + shld{q}\t{%s2%1, %0|%0, %1, %2}" + [(set_attr "type" "ishift") + (set_attr "prefix_0f" "1") + (set_attr "mode" "DI") + (set_attr "athlon_decode" "vector")]) + +(define_expand "x86_64_shift_adj" + [(set (reg:CCZ FLAGS_REG) + (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "") + (const_int 64)) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "") + (if_then_else:DI (ne (reg:CCZ FLAGS_REG) (const_int 0)) + (match_operand:DI 1 "register_operand" "") + (match_dup 0))) + (set (match_dup 1) + (if_then_else:DI (ne (reg:CCZ FLAGS_REG) (const_int 0)) + (match_operand:DI 3 "register_operand" "r") + (match_dup 1)))] + "TARGET_64BIT" + "") + +(define_expand "ashldi3" + [(set (match_operand:DI 0 "shiftdi_operand" "") + (ashift:DI (match_operand:DI 1 "ashldi_input_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] + "" + "ix86_expand_binary_operator (ASHIFT, DImode, operands); DONE;") + (define_insn "*ashldi3_1_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r") - (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "0,r") + (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "0,l") (match_operand:QI 2 "nonmemory_operand" "cJ,M"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFT, DImode, operands)" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{q}\t{%0, %0|%0, %0}"; case TYPE_LEA: - if (GET_CODE (operands[2]) != CONST_INT - || (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 3) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) <= 3); operands[1] = gen_rtx_MULT (DImode, operands[1], GEN_INT (1 << INTVAL (operands[2]))); return "lea{q}\t{%a1, %0|%0, %a1}"; @@ -10673,8 +10352,7 @@ default: if (REG_P (operands[2])) return "sal{q}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{q}\t%0"; else @@ -10696,9 +10374,9 @@ ;; Convert lea to the lea pattern to avoid flags dependency. (define_split [(set (match_operand:DI 0 "register_operand" "") - (ashift:DI (match_operand:DI 1 "register_operand" "") + (ashift:DI (match_operand:DI 1 "index_register_operand" "") (match_operand:QI 2 "immediate_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(set (match_dup 0) @@ -10710,7 +10388,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashldi3_cmp_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "immediate_operand" "e")) @@ -10718,20 +10396,23 @@ (set (match_operand:DI 0 "nonimmediate_operand" "=rm") (ashift:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFT, DImode, operands)" + && ix86_binary_operator_ok (ASHIFT, DImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{q}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{q}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{q}\t%0"; else @@ -10748,43 +10429,79 @@ (const_string "ishift"))) (set_attr "mode" "DI")]) -(define_insn "ashldi3_1" - [(set (match_operand:DI 0 "register_operand" "=r") - (ashift:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (match_scratch:SI 3 "=&r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE" - "#" - [(set_attr "type" "multi")]) +(define_insn "*ashldi3_cconly_rex64" + [(set (reg FLAGS_REG) + (compare + (ashift:DI (match_operand:DI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "immediate_operand" "e")) + (const_int 0))) + (clobber (match_scratch:DI 0 "=r"))] + "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFT, DImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || TARGET_DOUBLE_WITH_ADD)))" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + gcc_assert (operands[2] == const1_rtx); + return "add{q}\t{%0, %0|%0, %0}"; -(define_insn "*ashldi3_2" - [(set (match_operand:DI 0 "register_operand" "=r") - (ashift:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (reg:CC 17))] + default: + if (REG_P (operands[2])) + return "sal{q}\t{%b2, %0|%0, %b2}"; + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_size)) + return "sal{q}\t%0"; + else + return "sal{q}\t{%2, %0|%0, %2}"; + } +} + [(set (attr "type") + (cond [(and (and (ne (symbol_ref "TARGET_DOUBLE_WITH_ADD") + (const_int 0)) + (match_operand 0 "register_operand" "")) + (match_operand 2 "const1_operand" "")) + (const_string "alu") + ] + (const_string "ishift"))) + (set_attr "mode" "DI")]) + +(define_insn "*ashldi3_1" + [(set (match_operand:DI 0 "register_operand" "=&r,r") + (ashift:DI (match_operand:DI 1 "reg_or_pm1_operand" "n,0") + (match_operand:QI 2 "nonmemory_operand" "Jc,Jc"))) + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "#" [(set_attr "type" "multi")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (ashift:DI (match_operand:DI 1 "register_operand" "") - (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE && reload_completed" +;; By default we don't ask for a scratch register, because when DImode +;; values are manipulated, registers are already at a premium. But if +;; we have one handy, we won't turn it away. +(define_peephole2 + [(match_scratch:SI 3 "r") + (parallel [(set (match_operand:DI 0 "register_operand" "") + (ashift:DI (match_operand:DI 1 "nonmemory_operand" "") + (match_operand:QI 2 "nonmemory_operand" ""))) + (clobber (reg:CC FLAGS_REG))]) + (match_dup 3)] + "!TARGET_64BIT && TARGET_CMOVE" [(const_int 0)] - "ix86_split_ashldi (operands, operands[3]); DONE;") + "ix86_split_ashl (operands, operands[3], DImode); DONE;") (define_split [(set (match_operand:DI 0 "register_operand" "") - (ashift:DI (match_operand:DI 1 "register_operand" "") + (ashift:DI (match_operand:DI 1 "nonmemory_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && reload_completed" + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && ((optimize > 0 && flag_peephole2) + ? flow2_completed : reload_completed)" [(const_int 0)] - "ix86_split_ashldi (operands, NULL_RTX); DONE;") + "ix86_split_ashl (operands, NULL_RTX, DImode); DONE;") (define_insn "x86_shld_1" [(set (match_operand:SI 0 "nonimmediate_operand" "+r*m,r*m") @@ -10792,7 +10509,7 @@ (match_operand:QI 2 "nonmemory_operand" "I,c")) (lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r") (minus:QI (const_int 32) (match_dup 2))))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "@ shld{l}\t{%2, %1, %0|%0, %1, %2} @@ -10801,20 +10518,19 @@ (set_attr "prefix_0f" "1") (set_attr "mode" "SI") (set_attr "pent_pair" "np") - (set_attr "athlon_decode" "vector") - (set_attr "ppro_uops" "few")]) + (set_attr "athlon_decode" "vector")]) (define_expand "x86_shift_adj_1" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "") (const_int 32)) (const_int 0))) (set (match_operand:SI 0 "register_operand" "") - (if_then_else:SI (ne (reg:CCZ 17) (const_int 0)) + (if_then_else:SI (ne (reg:CCZ FLAGS_REG) (const_int 0)) (match_operand:SI 1 "register_operand" "") (match_dup 0))) (set (match_dup 1) - (if_then_else:SI (ne (reg:CCZ 17) (const_int 0)) + (if_then_else:SI (ne (reg:CCZ FLAGS_REG) (const_int 0)) (match_operand:SI 3 "register_operand" "r") (match_dup 1)))] "TARGET_CMOVE" @@ -10840,7 +10556,7 @@ JUMP_LABEL (tmp) = label; emit_move_insn (operands[0], operands[1]); - emit_move_insn (operands[1], const0_rtx); + ix86_expand_clear (operands[1]); emit_label (label); LABEL_NUSES (label) = 1; @@ -10852,24 +10568,22 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (ASHIFT, SImode, operands); DONE;") (define_insn "*ashlsi3_1" [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r") - (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0,r") + (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0,l") (match_operand:QI 2 "nonmemory_operand" "cI,M"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFT, SImode, operands)" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{l}\t{%0, %0|%0, %0}"; case TYPE_LEA: @@ -10878,8 +10592,7 @@ default: if (REG_P (operands[2])) return "sal{l}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{l}\t%0"; else @@ -10903,15 +10616,21 @@ [(set (match_operand 0 "register_operand" "") (ashift (match_operand 1 "index_register_operand" "") (match_operand:QI 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed - && true_regnum (operands[0]) != true_regnum (operands[1])" + && true_regnum (operands[0]) != true_regnum (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) <= 4" [(const_int 0)] { rtx pat; - operands[0] = gen_lowpart (SImode, operands[0]); - operands[1] = gen_lowpart (Pmode, operands[1]); + enum machine_mode mode = GET_MODE (operands[0]); + + if (GET_MODE_SIZE (mode) < 4) + operands[0] = gen_lowpart (SImode, operands[0]); + if (mode != Pmode) + operands[1] = gen_lowpart (Pmode, operands[1]); operands[2] = gen_int_mode (1 << INTVAL (operands[2]), Pmode); + pat = gen_rtx_MULT (Pmode, operands[1], operands[2]); if (Pmode != SImode) pat = gen_rtx_SUBREG (SImode, pat, 0); @@ -10924,13 +10643,13 @@ [(set (match_operand 0 "register_operand" "") (ashift (match_operand 1 "register_operand" "") (match_operand:QI 2 "const_int_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(const_int 0)] { rtx pat, clob; - emit_move_insn (operands[1], operands[0]); + emit_move_insn (operands[0], operands[1]); pat = gen_rtx_SET (VOIDmode, operands[0], gen_rtx_ASHIFT (GET_MODE (operands[0]), operands[0], operands[2])); @@ -10941,16 +10660,15 @@ (define_insn "*ashlsi3_1_zext" [(set (match_operand:DI 0 "register_operand" "=r,r") - (zero_extend:DI (ashift:SI (match_operand:SI 1 "register_operand" "0,r") + (zero_extend:DI (ashift:SI (match_operand:SI 1 "register_operand" "0,l") (match_operand:QI 2 "nonmemory_operand" "cI,M")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFT, SImode, operands)" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; case TYPE_LEA: @@ -10959,8 +10677,7 @@ default: if (REG_P (operands[2])) return "sal{l}\t{%b2, %k0|%k0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{l}\t%k0"; else @@ -10983,7 +10700,7 @@ [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (ashift (match_operand 1 "register_operand" "") (match_operand:QI 2 "const_int_operand" "")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && reload_completed && true_regnum (operands[0]) != true_regnum (operands[1])" [(set (match_dup 0) (zero_extend:DI @@ -10998,28 +10715,72 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashlsi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm") (ashift:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFT, SImode, operands)" + && ix86_binary_operator_ok (ASHIFT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{l}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_size)) + return "sal{l}\t%0"; + else + return "sal{l}\t{%2, %0|%0, %2}"; + } +} + [(set (attr "type") + (cond [(and (and (ne (symbol_ref "TARGET_DOUBLE_WITH_ADD") + (const_int 0)) + (match_operand 0 "register_operand" "")) + (match_operand 2 "const1_operand" "")) + (const_string "alu") + ] + (const_string "ishift"))) + (set_attr "mode" "SI")]) + +(define_insn "*ashlsi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashift:SI (match_operand:SI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || TARGET_DOUBLE_WITH_ADD)))" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + gcc_assert (operands[2] == const1_rtx); + return "add{l}\t{%0, %0|%0, %0}"; + + default: + if (REG_P (operands[2])) + return "sal{l}\t{%b2, %0|%0, %b2}"; + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{l}\t%0"; else @@ -11037,28 +10798,31 @@ (set_attr "mode" "SI")]) (define_insn "*ashlsi3_cmp_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashift:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (ashift:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFT, SImode, operands)" + && ix86_binary_operator_ok (ASHIFT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || TARGET_DOUBLE_WITH_ADD)))" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; default: if (REG_P (operands[2])) return "sal{l}\t{%b2, %k0|%k0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{l}\t%k0"; else @@ -11078,15 +10842,15 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (ASHIFT, HImode, operands); DONE;") (define_insn "*ashlhi3_1_lea" [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r") - (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "0,r") + (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "0,l") (match_operand:QI 2 "nonmemory_operand" "cI,M"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (ASHIFT, HImode, operands)" { @@ -11095,15 +10859,13 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{w}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{w}\t%0"; else @@ -11126,22 +10888,20 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "nonmemory_operand" "cI"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (ASHIFT, HImode, operands)" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{w}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{w}\t%0"; else @@ -11162,28 +10922,72 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashlhi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm") (ashift:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFT, HImode, operands)" + && ix86_binary_operator_ok (ASHIFT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{w}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_size)) + return "sal{w}\t%0"; + else + return "sal{w}\t{%2, %0|%0, %2}"; + } +} + [(set (attr "type") + (cond [(and (and (ne (symbol_ref "TARGET_DOUBLE_WITH_ADD") + (const_int 0)) + (match_operand 0 "register_operand" "")) + (match_operand 2 "const1_operand" "")) + (const_string "alu") + ] + (const_string "ishift"))) + (set_attr "mode" "HI")]) + +(define_insn "*ashlhi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashift:HI (match_operand:HI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:HI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || TARGET_DOUBLE_WITH_ADD)))" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + gcc_assert (operands[2] == const1_rtx); + return "add{w}\t{%0, %0|%0, %0}"; + + default: + if (REG_P (operands[2])) + return "sal{w}\t{%b2, %0|%0, %b2}"; + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{w}\t%0"; else @@ -11204,7 +11008,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (ASHIFT, QImode, operands); DONE;") @@ -11212,9 +11016,9 @@ (define_insn "*ashlqi3_1_lea" [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,r,r") - (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "0,0,r") + (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "0,0,l") (match_operand:QI 2 "nonmemory_operand" "cI,cI,M"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (ASHIFT, QImode, operands)" { @@ -11223,8 +11027,7 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -11238,8 +11041,7 @@ else return "sal{b}\t{%b2, %0|%0, %b2}"; } - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) { if (get_attr_mode (insn) == MODE_SI) @@ -11272,15 +11074,14 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,r") (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "cI,cI"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_PARTIAL_REG_STALL && ix86_binary_operator_ok (ASHIFT, QImode, operands)" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -11294,8 +11095,7 @@ else return "sal{b}\t{%b2, %0|%0, %b2}"; } - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) { if (get_attr_mode (insn) == MODE_SI) @@ -11326,28 +11126,72 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashlqi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") (ashift:QI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFT, QImode, operands)" + && ix86_binary_operator_ok (ASHIFT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || (TARGET_DOUBLE_WITH_ADD && REG_P (operands[0])))))" { switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{b}\t{%0, %0|%0, %0}"; default: if (REG_P (operands[2])) return "sal{b}\t{%b2, %0|%0, %b2}"; - else if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 1 + else if (operands[2] == const1_rtx + && (TARGET_SHIFT1 || optimize_size)) + return "sal{b}\t%0"; + else + return "sal{b}\t{%2, %0|%0, %2}"; + } +} + [(set (attr "type") + (cond [(and (and (ne (symbol_ref "TARGET_DOUBLE_WITH_ADD") + (const_int 0)) + (match_operand 0 "register_operand" "")) + (match_operand 2 "const1_operand" "")) + (const_string "alu") + ] + (const_string "ishift"))) + (set_attr "mode" "QI")]) + +(define_insn "*ashlqi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashift:QI (match_operand:QI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:QI 0 "=q"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL + || (operands[2] == const1_rtx + && (TARGET_SHIFT1 + || TARGET_DOUBLE_WITH_ADD)))" +{ + switch (get_attr_type (insn)) + { + case TYPE_ALU: + gcc_assert (operands[2] == const1_rtx); + return "add{b}\t{%0, %0|%0, %0}"; + + default: + if (REG_P (operands[2])) + return "sal{b}\t{%b2, %0|%0, %b2}"; + else if (operands[2] == const1_rtx && (TARGET_SHIFT1 || optimize_size)) return "sal{b}\t%0"; else @@ -11366,28 +11210,90 @@ ;; See comment above `ashldi3' about how this works. -(define_expand "ashrdi3" - [(parallel [(set (match_operand:DI 0 "shiftdi_operand" "") - (ashiftrt:DI (match_operand:DI 1 "shiftdi_operand" "") +(define_expand "ashrti3" + [(parallel [(set (match_operand:TI 0 "register_operand" "") + (ashiftrt:TI (match_operand:TI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))])] - "" + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" { - if (!TARGET_64BIT && TARGET_CMOVE && ! immediate_operand (operands[2], QImode)) + if (! immediate_operand (operands[2], QImode)) { - emit_insn (gen_ashrdi3_1 (operands[0], operands[1], operands[2])); + emit_insn (gen_ashrti3_1 (operands[0], operands[1], operands[2])); DONE; } - ix86_expand_binary_operator (ASHIFTRT, DImode, operands); + ix86_expand_binary_operator (ASHIFTRT, TImode, operands); DONE; }) -(define_insn "ashrdi3_63_rex64" +(define_insn "ashrti3_1" + [(set (match_operand:TI 0 "register_operand" "=r") + (ashiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "register_operand" "c"))) + (clobber (match_scratch:DI 3 "=&r")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_insn "*ashrti3_2" + [(set (match_operand:TI 0 "register_operand" "=r") + (ashiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "immediate_operand" "O"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (ashiftrt:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "register_operand" ""))) + (clobber (match_scratch:DI 3 "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_ashr (operands, operands[3], TImode); DONE;") + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (ashiftrt:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "immediate_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_ashr (operands, NULL_RTX, TImode); DONE;") + +(define_insn "x86_64_shrd" + [(set (match_operand:DI 0 "nonimmediate_operand" "+r*m,r*m") + (ior:DI (ashiftrt:DI (match_dup 0) + (match_operand:QI 2 "nonmemory_operand" "J,c")) + (ashift:DI (match_operand:DI 1 "register_operand" "r,r") + (minus:QI (const_int 64) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "@ + shrd{q}\t{%2, %1, %0|%0, %1, %2} + shrd{q}\t{%s2%1, %0|%0, %1, %2}" + [(set_attr "type" "ishift") + (set_attr "prefix_0f" "1") + (set_attr "mode" "DI") + (set_attr "athlon_decode" "vector")]) + +(define_expand "ashrdi3" + [(set (match_operand:DI 0 "shiftdi_operand" "") + (ashiftrt:DI (match_operand:DI 1 "shiftdi_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] + "" + "ix86_expand_binary_operator (ASHIFTRT, DImode, operands); DONE;") + +(define_insn "*ashrdi3_63_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=*d,rm") (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "*a,0") (match_operand:DI 2 "const_int_operand" "i,i"))) - (clobber (reg:CC 17))] - "TARGET_64BIT && INTVAL (operands[2]) == 63 && (TARGET_USE_CLTD || optimize_size) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && INTVAL (operands[2]) == 63 + && (TARGET_USE_CLTD || optimize_size) && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" "@ {cqto|cqo} @@ -11402,7 +11308,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFTRT, DImode, operands) && (TARGET_SHIFT1 || optimize_size)" "sar{q}\t%0" @@ -11416,7 +11322,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "J,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" "@ sar{q}\t{%2, %0|%0, %2} @@ -11428,7 +11334,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrdi3_one_bit_cmp_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -11445,11 +11351,25 @@ (const_string "2") (const_string "*")))]) +(define_insn "*ashrdi3_one_bit_cconly_rex64" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:DI 0 "=r"))] + "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" + "sar{q}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrdi3_cmp_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const_int_operand" "n")) @@ -11457,49 +11377,60 @@ (set (match_operand:DI 0 "nonimmediate_operand" "=rm") (ashiftrt:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" + && ix86_binary_operator_ok (ASHIFTRT, DImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "sar{q}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "DI")]) +(define_insn "*ashrdi3_cconly_rex64" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_int_operand" "n")) + (const_int 0))) + (clobber (match_scratch:DI 0 "=r"))] + "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFTRT, DImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "sar{q}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "DI")]) -(define_insn "ashrdi3_1" +(define_insn "*ashrdi3_1" [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (match_scratch:SI 3 "=&r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE" - "#" - [(set_attr "type" "multi")]) - -(define_insn "*ashrdi3_2" - [(set (match_operand:DI 0 "register_operand" "=r") - (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "#" [(set_attr "type" "multi")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (ashiftrt:DI (match_operand:DI 1 "register_operand" "") - (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE && reload_completed" +;; By default we don't ask for a scratch register, because when DImode +;; values are manipulated, registers are already at a premium. But if +;; we have one handy, we won't turn it away. +(define_peephole2 + [(match_scratch:SI 3 "r") + (parallel [(set (match_operand:DI 0 "register_operand" "") + (ashiftrt:DI (match_operand:DI 1 "register_operand" "") + (match_operand:QI 2 "nonmemory_operand" ""))) + (clobber (reg:CC FLAGS_REG))]) + (match_dup 3)] + "!TARGET_64BIT && TARGET_CMOVE" [(const_int 0)] - "ix86_split_ashrdi (operands, operands[3]); DONE;") + "ix86_split_ashr (operands, operands[3], DImode); DONE;") (define_split [(set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_operand:DI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && reload_completed" + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && ((optimize > 0 && flag_peephole2) + ? flow2_completed : reload_completed)" [(const_int 0)] - "ix86_split_ashrdi (operands, NULL_RTX); DONE;") + "ix86_split_ashr (operands, NULL_RTX, DImode); DONE;") (define_insn "x86_shrd_1" [(set (match_operand:SI 0 "nonimmediate_operand" "+r*m,r*m") @@ -11507,7 +11438,7 @@ (match_operand:QI 2 "nonmemory_operand" "I,c")) (ashift:SI (match_operand:SI 1 "register_operand" "r,r") (minus:QI (const_int 32) (match_dup 2))))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "@ shrd{l}\t{%2, %1, %0|%0, %1, %2} @@ -11515,7 +11446,6 @@ [(set_attr "type" "ishift") (set_attr "prefix_0f" "1") (set_attr "pent_pair" "np") - (set_attr "ppro_uops" "few") (set_attr "mode" "SI")]) (define_expand "x86_shift_adj_3" @@ -11550,7 +11480,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,rm") (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "*a,0") (match_operand:SI 2 "const_int_operand" "i,i"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "INTVAL (operands[2]) == 31 && (TARGET_USE_CLTD || optimize_size) && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "@ @@ -11566,7 +11496,7 @@ [(set (match_operand:DI 0 "register_operand" "=*d,r") (zero_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "*a,0") (match_operand:SI 2 "const_int_operand" "i,i")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && (TARGET_USE_CLTD || optimize_size) && INTVAL (operands[2]) == 31 && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" @@ -11583,7 +11513,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (ASHIFTRT, SImode, operands); DONE;") @@ -11591,7 +11521,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "sar{l}\t%0" @@ -11605,7 +11535,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "const1_operand" "")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFTRT, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "sar{l}\t%k0" @@ -11616,7 +11546,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "@ sar{l}\t{%2, %0|%0, %2} @@ -11628,7 +11558,7 @@ [(set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "@ sar{l}\t{%2, %k0|%k0, %2} @@ -11640,7 +11570,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrsi3_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -11657,8 +11587,22 @@ (const_string "2") (const_string "*")))]) +(define_insn "*ashrsi3_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" + "sar{l}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + (define_insn "*ashrsi3_one_bit_cmp_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -11676,29 +11620,48 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrsi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm") (ashiftrt:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" + && ix86_binary_operator_ok (ASHIFTRT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "sar{l}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "SI")]) + +(define_insn "*ashrsi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFTRT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "sar{l}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "SI")]) (define_insn "*ashrsi3_cmp_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (ashiftrt:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" + && ix86_binary_operator_ok (ASHIFTRT, SImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "sar{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "SI")]) @@ -11707,7 +11670,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (ASHIFTRT, HImode, operands); DONE;") @@ -11715,7 +11678,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "sar{w}\t%0" @@ -11729,7 +11692,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, HImode, operands)" "@ sar{w}\t{%2, %0|%0, %2} @@ -11741,7 +11704,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrhi3_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -11758,19 +11721,50 @@ (const_string "2") (const_string "*")))]) +(define_insn "*ashrhi3_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:HI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)" + "sar{w}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrhi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm") (ashiftrt:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)" + && ix86_binary_operator_ok (ASHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "sar{w}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "HI")]) + +(define_insn "*ashrhi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:HI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "sar{w}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "HI")]) @@ -11779,7 +11773,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (ASHIFTRT, QImode, operands); DONE;") @@ -11787,7 +11781,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, QImode, operands) && (TARGET_SHIFT1 || optimize_size)" "sar{b}\t%0" @@ -11801,7 +11795,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) (ashiftrt:QI (match_dup 0) (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, QImode, operands) && (! TARGET_PARTIAL_REG_STALL || optimize_size) && (TARGET_SHIFT1 || optimize_size)" @@ -11816,7 +11810,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ASHIFTRT, QImode, operands)" "@ sar{b}\t{%2, %0|%0, %2} @@ -11828,7 +11822,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) (ashiftrt:QI (match_dup 0) (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "@ @@ -11841,7 +11835,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrqi3_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "I")) @@ -11858,48 +11852,125 @@ (const_string "2") (const_string "*")))]) +(define_insn "*ashrqi3_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "I")) + (const_int 0))) + (clobber (match_scratch:QI 0 "=q"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)" + "sar{b}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*ashrqi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") (ashiftrt:QI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)" + && ix86_binary_operator_ok (ASHIFTRT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "sar{b}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "QI")]) + +(define_insn "*ashrqi3_cconly" + [(set (reg FLAGS_REG) + (compare + (ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:QI 0 "=q"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (ASHIFTRT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "sar{b}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "QI")]) + ;; Logical shift instructions ;; See comment above `ashldi3' about how this works. -(define_expand "lshrdi3" - [(parallel [(set (match_operand:DI 0 "shiftdi_operand" "") - (lshiftrt:DI (match_operand:DI 1 "shiftdi_operand" "") +(define_expand "lshrti3" + [(parallel [(set (match_operand:TI 0 "register_operand" "") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))])] - "" + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" { - if (!TARGET_64BIT && TARGET_CMOVE && ! immediate_operand (operands[2], QImode)) + if (! immediate_operand (operands[2], QImode)) { - emit_insn (gen_lshrdi3_1 (operands[0], operands[1], operands[2])); + emit_insn (gen_lshrti3_1 (operands[0], operands[1], operands[2])); DONE; } - ix86_expand_binary_operator (LSHIFTRT, DImode, operands); + ix86_expand_binary_operator (LSHIFTRT, TImode, operands); DONE; }) +(define_insn "lshrti3_1" + [(set (match_operand:TI 0 "register_operand" "=r") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "register_operand" "c"))) + (clobber (match_scratch:DI 3 "=&r")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_insn "*lshrti3_2" + [(set (match_operand:TI 0 "register_operand" "=r") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:QI 2 "immediate_operand" "O"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "#" + [(set_attr "type" "multi")]) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "register_operand" ""))) + (clobber (match_scratch:DI 3 "")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_lshr (operands, operands[3], TImode); DONE;") + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "") + (match_operand:QI 2 "immediate_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && reload_completed" + [(const_int 0)] + "ix86_split_lshr (operands, NULL_RTX, TImode); DONE;") + +(define_expand "lshrdi3" + [(set (match_operand:DI 0 "shiftdi_operand" "") + (lshiftrt:DI (match_operand:DI 1 "shiftdi_operand" "") + (match_operand:QI 2 "nonmemory_operand" "")))] + "" + "ix86_expand_binary_operator (LSHIFTRT, DImode, operands); DONE;") + (define_insn "*lshrdi3_1_one_bit_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "shr{q}\t%0" @@ -11913,7 +11984,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "J,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "@ shr{q}\t{%2, %0|%0, %2} @@ -11925,7 +11996,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrdi3_cmp_one_bit_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -11942,11 +12013,25 @@ (const_string "2") (const_string "*")))]) +(define_insn "*lshrdi3_cconly_one_bit_rex64" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:DI 0 "=r"))] + "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + "shr{q}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrdi3_cmp_rex64" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const_int_operand" "e")) @@ -11954,54 +12039,66 @@ (set (match_operand:DI 0 "nonimmediate_operand" "=rm") (lshiftrt:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "shr{q}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "DI")]) -(define_insn "lshrdi3_1" - [(set (match_operand:DI 0 "register_operand" "=r") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (match_scratch:SI 3 "=&r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE" - "#" - [(set_attr "type" "multi")]) +(define_insn "*lshrdi3_cconly_rex64" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_int_operand" "e")) + (const_int 0))) + (clobber (match_scratch:DI 0 "=r"))] + "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "shr{q}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "DI")]) -(define_insn "*lshrdi3_2" +(define_insn "*lshrdi3_1" [(set (match_operand:DI 0 "register_operand" "=r") (lshiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:QI 2 "nonmemory_operand" "Jc"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "#" [(set_attr "type" "multi")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "") - (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_CMOVE && reload_completed" +;; By default we don't ask for a scratch register, because when DImode +;; values are manipulated, registers are already at a premium. But if +;; we have one handy, we won't turn it away. +(define_peephole2 + [(match_scratch:SI 3 "r") + (parallel [(set (match_operand:DI 0 "register_operand" "") + (lshiftrt:DI (match_operand:DI 1 "register_operand" "") + (match_operand:QI 2 "nonmemory_operand" ""))) + (clobber (reg:CC FLAGS_REG))]) + (match_dup 3)] + "!TARGET_64BIT && TARGET_CMOVE" [(const_int 0)] - "ix86_split_lshrdi (operands, operands[3]); DONE;") + "ix86_split_lshr (operands, operands[3], DImode); DONE;") (define_split [(set (match_operand:DI 0 "register_operand" "") (lshiftrt:DI (match_operand:DI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] - "!TARGET_64BIT && reload_completed" + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && ((optimize > 0 && flag_peephole2) + ? flow2_completed : reload_completed)" [(const_int 0)] - "ix86_split_lshrdi (operands, NULL_RTX); DONE;") + "ix86_split_lshr (operands, NULL_RTX, DImode); DONE;") (define_expand "lshrsi3" [(set (match_operand:SI 0 "nonimmediate_operand" "") (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (LSHIFTRT, SImode, operands); DONE;") @@ -12009,7 +12106,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "shr{l}\t%0" @@ -12023,7 +12120,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (lshiftrt:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "0")) (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "shr{l}\t%k0" @@ -12034,7 +12131,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "@ shr{l}\t{%2, %0|%0, %2} @@ -12047,7 +12144,7 @@ (zero_extend:DI (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "@ shr{l}\t{%2, %k0|%k0, %2} @@ -12059,7 +12156,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrsi3_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -12076,8 +12173,22 @@ (const_string "2") (const_string "*")))]) +(define_insn "*lshrsi3_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + "shr{l}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + (define_insn "*lshrsi3_cmp_one_bit_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -12095,29 +12206,48 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrsi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=rm") (lshiftrt:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "shr{l}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "SI")]) + +(define_insn "*lshrsi3_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:SI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "shr{l}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "SI")]) (define_insn "*lshrsi3_cmp_zext" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (lshiftrt:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "shr{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "SI")]) @@ -12126,7 +12256,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (LSHIFTRT, HImode, operands); DONE;") @@ -12134,7 +12264,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "shr{w}\t%0" @@ -12148,7 +12278,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "@ shr{w}\t{%2, %0|%0, %2} @@ -12160,7 +12290,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrhi3_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -12177,19 +12307,50 @@ (const_string "2") (const_string "*")))]) +(define_insn "*lshrhi3_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:HI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + "shr{w}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrhi3_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=rm") (lshiftrt:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "shr{w}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "HI")]) + +(define_insn "*lshrhi3_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:HI 0 "=r"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (LSHIFTRT, HImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "shr{w}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "HI")]) @@ -12198,7 +12359,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (LSHIFTRT, QImode, operands); DONE;") @@ -12206,7 +12367,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, QImode, operands) && (TARGET_SHIFT1 || optimize_size)" "shr{b}\t%0" @@ -12220,7 +12381,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) (lshiftrt:QI (match_dup 0) (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (TARGET_SHIFT1 || optimize_size)" "shr{b}\t%0" @@ -12234,7 +12395,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (LSHIFTRT, QImode, operands)" "@ shr{b}\t{%2, %0|%0, %2} @@ -12246,7 +12407,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) (lshiftrt:QI (match_dup 0) (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "@ @@ -12259,7 +12420,7 @@ ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrqi2_one_bit_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" "")) @@ -12276,19 +12437,50 @@ (const_string "2") (const_string "*")))]) +(define_insn "*lshrqi2_one_bit_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const1_operand" "")) + (const_int 0))) + (clobber (match_scratch:QI 0 "=q"))] + "ix86_match_ccmode (insn, CCGOCmode) + && (TARGET_SHIFT1 || optimize_size) + && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)" + "shr{b}\t%0" + [(set_attr "type" "ishift") + (set_attr "length" "2")]) + ;; This pattern can't accept a variable shift count, since shifts by ;; zero don't affect the flags. We assume that shifts by constant ;; zero are optimized away. (define_insn "*lshrqi2_cmp" - [(set (reg 17) + [(set (reg FLAGS_REG) (compare (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") - (match_operand:QI 2 "const_int_1_31_operand" "I")) + (match_operand:QI 2 "const_1_to_31_operand" "I")) (const_int 0))) (set (match_operand:QI 0 "nonimmediate_operand" "=qm") (lshiftrt:QI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) - && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)" + && ix86_binary_operator_ok (LSHIFTRT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" + "shr{b}\t{%2, %0|%0, %2}" + [(set_attr "type" "ishift") + (set_attr "mode" "QI")]) + +(define_insn "*lshrqi2_cconly" + [(set (reg FLAGS_REG) + (compare + (lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I")) + (const_int 0))) + (clobber (match_scratch:QI 0 "=q"))] + "ix86_match_ccmode (insn, CCGOCmode) + && ix86_binary_operator_ok (LSHIFTRT, QImode, operands) + && (optimize_size + || !TARGET_PARTIAL_FLAG_REG_STALL)" "shr{b}\t{%2, %0|%0, %2}" [(set_attr "type" "ishift") (set_attr "mode" "QI")]) @@ -12296,18 +12488,54 @@ ;; Rotate instructions (define_expand "rotldi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "") + [(set (match_operand:DI 0 "shiftdi_operand" "") + (rotate:DI (match_operand:DI 1 "shiftdi_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_64BIT" - "ix86_expand_binary_operator (ROTATE, DImode, operands); DONE;") + (clobber (reg:CC FLAGS_REG))] + "" +{ + if (TARGET_64BIT) + { + ix86_expand_binary_operator (ROTATE, DImode, operands); + DONE; + } + if (!const_1_to_31_operand (operands[2], VOIDmode)) + FAIL; + emit_insn (gen_ix86_rotldi3 (operands[0], operands[1], operands[2])); + DONE; +}) +;; Implement rotation using two double-precision shift instructions +;; and a scratch register. +(define_insn_and_split "ix86_rotldi3" + [(set (match_operand:DI 0 "register_operand" "=r") + (rotate:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I"))) + (clobber (reg:CC FLAGS_REG)) + (clobber (match_scratch:SI 3 "=&r"))] + "!TARGET_64BIT" + "" + "&& reload_completed" + [(set (match_dup 3) (match_dup 4)) + (parallel + [(set (match_dup 4) + (ior:SI (ashift:SI (match_dup 4) (match_dup 2)) + (lshiftrt:SI (match_dup 5) + (minus:QI (const_int 32) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))]) + (parallel + [(set (match_dup 5) + (ior:SI (ashift:SI (match_dup 5) (match_dup 2)) + (lshiftrt:SI (match_dup 3) + (minus:QI (const_int 32) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))])] + "split_di (operands, 1, operands + 4, operands + 5);") + (define_insn "*rotlsi3_1_one_bit_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, DImode, operands) && (TARGET_SHIFT1 || optimize_size)" "rol{q}\t%0" @@ -12321,7 +12549,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "e,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, DImode, operands)" "@ rol{q}\t{%2, %0|%0, %2} @@ -12333,7 +12561,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (ROTATE, SImode, operands); DONE;") @@ -12341,7 +12569,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "rol{l}\t%0" @@ -12356,7 +12584,7 @@ (zero_extend:DI (rotate:SI (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "const1_operand" "")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "rol{l}\t%k0" @@ -12367,7 +12595,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") (rotate:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, SImode, operands)" "@ rol{l}\t{%2, %0|%0, %2} @@ -12380,7 +12608,7 @@ (zero_extend:DI (rotate:SI (match_operand:SI 1 "register_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, SImode, operands)" "@ rol{l}\t{%2, %k0|%k0, %2} @@ -12392,7 +12620,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (ROTATE, HImode, operands); DONE;") @@ -12400,7 +12628,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "rol{w}\t%0" @@ -12414,7 +12642,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") (rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, HImode, operands)" "@ rol{w}\t{%2, %0|%0, %2} @@ -12426,7 +12654,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (ROTATE, QImode, operands); DONE;") @@ -12434,7 +12662,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) (rotate:QI (match_dup 0) (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (TARGET_SHIFT1 || optimize_size)" "rol{b}\t%0" @@ -12448,7 +12676,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, QImode, operands) && (TARGET_SHIFT1 || optimize_size)" "rol{b}\t%0" @@ -12462,7 +12690,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) (rotate:QI (match_dup 0) (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "@ @@ -12475,7 +12703,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") (rotate:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATE, QImode, operands)" "@ rol{b}\t{%2, %0|%0, %2} @@ -12484,18 +12712,54 @@ (set_attr "mode" "QI")]) (define_expand "rotrdi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (rotatert:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] - "TARGET_64BIT" - "ix86_expand_binary_operator (ROTATERT, DImode, operands); DONE;") + [(set (match_operand:DI 0 "shiftdi_operand" "") + (rotate:DI (match_operand:DI 1 "shiftdi_operand" "") + (match_operand:QI 2 "nonmemory_operand" ""))) + (clobber (reg:CC FLAGS_REG))] + "" +{ + if (TARGET_64BIT) + { + ix86_expand_binary_operator (ROTATERT, DImode, operands); + DONE; + } + if (!const_1_to_31_operand (operands[2], VOIDmode)) + FAIL; + emit_insn (gen_ix86_rotrdi3 (operands[0], operands[1], operands[2])); + DONE; +}) + +;; Implement rotation using two double-precision shift instructions +;; and a scratch register. +(define_insn_and_split "ix86_rotrdi3" + [(set (match_operand:DI 0 "register_operand" "=r") + (rotatert:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:QI 2 "const_1_to_31_operand" "I"))) + (clobber (reg:CC FLAGS_REG)) + (clobber (match_scratch:SI 3 "=&r"))] + "!TARGET_64BIT" + "" + "&& reload_completed" + [(set (match_dup 3) (match_dup 4)) + (parallel + [(set (match_dup 4) + (ior:SI (ashiftrt:SI (match_dup 4) (match_dup 2)) + (ashift:SI (match_dup 5) + (minus:QI (const_int 32) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))]) + (parallel + [(set (match_dup 5) + (ior:SI (ashiftrt:SI (match_dup 5) (match_dup 2)) + (ashift:SI (match_dup 3) + (minus:QI (const_int 32) (match_dup 2))))) + (clobber (reg:CC FLAGS_REG))])] + "split_di (operands, 1, operands + 4, operands + 5);") (define_insn "*rotrdi3_1_one_bit_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (rotatert:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, DImode, operands) && (TARGET_SHIFT1 || optimize_size)" "ror{q}\t%0" @@ -12509,7 +12773,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,rm") (rotatert:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "J,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, DImode, operands)" "@ ror{q}\t{%2, %0|%0, %2} @@ -12521,7 +12785,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "") (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "ix86_expand_binary_operator (ROTATERT, SImode, operands); DONE;") @@ -12529,7 +12793,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm") (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "ror{l}\t%0" @@ -12544,7 +12808,7 @@ (zero_extend:DI (rotatert:SI (match_operand:SI 1 "register_operand" "0") (match_operand:QI 2 "const1_operand" "")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, SImode, operands) && (TARGET_SHIFT1 || optimize_size)" "ror{l}\t%k0" @@ -12558,7 +12822,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm") (rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, SImode, operands)" "@ ror{l}\t{%2, %0|%0, %2} @@ -12571,7 +12835,7 @@ (zero_extend:DI (rotatert:SI (match_operand:SI 1 "register_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, SImode, operands)" "@ ror{l}\t{%2, %k0|%k0, %2} @@ -12583,7 +12847,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "") (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_HIMODE_MATH" "ix86_expand_binary_operator (ROTATERT, HImode, operands); DONE;") @@ -12591,7 +12855,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm") (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, HImode, operands) && (TARGET_SHIFT1 || optimize_size)" "ror{w}\t%0" @@ -12605,7 +12869,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,rm") (rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, HImode, operands)" "@ ror{w}\t{%2, %0|%0, %2} @@ -12617,7 +12881,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "") (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_QIMODE_MATH" "ix86_expand_binary_operator (ROTATERT, QImode, operands); DONE;") @@ -12625,7 +12889,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "0") (match_operand:QI 2 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, QImode, operands) && (TARGET_SHIFT1 || optimize_size)" "ror{b}\t%0" @@ -12639,7 +12903,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) (rotatert:QI (match_dup 0) (match_operand:QI 1 "const1_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (TARGET_SHIFT1 || optimize_size)" "ror{b}\t%0" @@ -12653,7 +12917,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,qm") (rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (ROTATERT, QImode, operands)" "@ ror{b}\t{%2, %0|%0, %2} @@ -12665,7 +12929,7 @@ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,qm")) (rotatert:QI (match_dup 0) (match_operand:QI 1 "nonmemory_operand" "I,c"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "(! TARGET_PARTIAL_REG_STALL || optimize_size) && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" "@ @@ -12679,8 +12943,8 @@ (define_expand "extv" [(set (match_operand:SI 0 "register_operand" "") (sign_extract:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "immediate_operand" "") - (match_operand:SI 3 "immediate_operand" "")))] + (match_operand:SI 2 "const8_operand" "") + (match_operand:SI 3 "const8_operand" "")))] "" { /* Handle extractions from %ah et al. */ @@ -12689,15 +12953,15 @@ /* From mips.md: extract_bit_field doesn't verify that our source matches the predicate, so check it again here. */ - if (! register_operand (operands[1], VOIDmode)) + if (! ext_register_operand (operands[1], VOIDmode)) FAIL; }) (define_expand "extzv" [(set (match_operand:SI 0 "register_operand" "") (zero_extract:SI (match_operand 1 "ext_register_operand" "") - (match_operand:SI 2 "immediate_operand" "") - (match_operand:SI 3 "immediate_operand" "")))] + (match_operand:SI 2 "const8_operand" "") + (match_operand:SI 3 "const8_operand" "")))] "" { /* Handle extractions from %ah et al. */ @@ -12706,24 +12970,24 @@ /* From mips.md: extract_bit_field doesn't verify that our source matches the predicate, so check it again here. */ - if (! register_operand (operands[1], VOIDmode)) + if (! ext_register_operand (operands[1], VOIDmode)) FAIL; }) (define_expand "insv" [(set (zero_extract (match_operand 0 "ext_register_operand" "") - (match_operand 1 "immediate_operand" "") - (match_operand 2 "immediate_operand" "")) + (match_operand 1 "const8_operand" "") + (match_operand 2 "const8_operand" "")) (match_operand 3 "register_operand" ""))] "" { - /* Handle extractions from %ah et al. */ + /* Handle insertions to %ah et al. */ if (INTVAL (operands[1]) != 8 || INTVAL (operands[2]) != 8) FAIL; /* From mips.md: insert_bit_field doesn't verify that our source matches the predicate, so check it again here. */ - if (! register_operand (operands[0], VOIDmode)) + if (! ext_register_operand (operands[0], VOIDmode)) FAIL; if (TARGET_64BIT) @@ -12735,6 +12999,146 @@ }) ;; %%% bts, btr, btc, bt. +;; In general these instructions are *slow* when applied to memory, +;; since they enforce atomic operation. When applied to registers, +;; it depends on the cpu implementation. They're never faster than +;; the corresponding and/ior/xor operations, so with 32-bit there's +;; no point. But in 64-bit, we can't hold the relevant immediates +;; within the instruction itself, so operating on bits in the high +;; 32-bits of a register becomes easier. +;; +;; These are slow on Nocona, but fast on Athlon64. We do require the use +;; of btrq and btcq for corner cases of post-reload expansion of absdf and +;; negdf respectively, so they can never be disabled entirely. + +(define_insn "*btsq" + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (const_int 1)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && (TARGET_USE_BT || reload_completed)" + "bts{q} %1,%0" + [(set_attr "type" "alu1")]) + +(define_insn "*btrq" + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (const_int 0)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && (TARGET_USE_BT || reload_completed)" + "btr{q} %1,%0" + [(set_attr "type" "alu1")]) + +(define_insn "*btcq" + [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (not:DI (zero_extract:DI (match_dup 0) (const_int 1) (match_dup 1)))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && (TARGET_USE_BT || reload_completed)" + "btc{q} %1,%0" + [(set_attr "type" "alu1")]) + +;; Allow Nocona to avoid these instructions if a register is available. + +(define_peephole2 + [(match_scratch:DI 2 "r") + (parallel [(set (zero_extract:DI + (match_operand:DI 0 "register_operand" "") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (const_int 1)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT && !TARGET_USE_BT" + [(const_int 0)] +{ + HOST_WIDE_INT i = INTVAL (operands[1]), hi, lo; + rtx op1; + + if (HOST_BITS_PER_WIDE_INT >= 64) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else if (i < HOST_BITS_PER_WIDE_INT) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else + lo = 0, hi = (HOST_WIDE_INT)1 << (i - HOST_BITS_PER_WIDE_INT); + + op1 = immed_double_const (lo, hi, DImode); + if (i >= 31) + { + emit_move_insn (operands[2], op1); + op1 = operands[2]; + } + + emit_insn (gen_iordi3 (operands[0], operands[0], op1)); + DONE; +}) + +(define_peephole2 + [(match_scratch:DI 2 "r") + (parallel [(set (zero_extract:DI + (match_operand:DI 0 "register_operand" "") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (const_int 0)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT && !TARGET_USE_BT" + [(const_int 0)] +{ + HOST_WIDE_INT i = INTVAL (operands[1]), hi, lo; + rtx op1; + + if (HOST_BITS_PER_WIDE_INT >= 64) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else if (i < HOST_BITS_PER_WIDE_INT) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else + lo = 0, hi = (HOST_WIDE_INT)1 << (i - HOST_BITS_PER_WIDE_INT); + + op1 = immed_double_const (~lo, ~hi, DImode); + if (i >= 32) + { + emit_move_insn (operands[2], op1); + op1 = operands[2]; + } + + emit_insn (gen_anddi3 (operands[0], operands[0], op1)); + DONE; +}) + +(define_peephole2 + [(match_scratch:DI 2 "r") + (parallel [(set (zero_extract:DI + (match_operand:DI 0 "register_operand" "") + (const_int 1) + (match_operand:DI 1 "const_0_to_63_operand" "")) + (not:DI (zero_extract:DI + (match_dup 0) (const_int 1) (match_dup 1)))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT && !TARGET_USE_BT" + [(const_int 0)] +{ + HOST_WIDE_INT i = INTVAL (operands[1]), hi, lo; + rtx op1; + + if (HOST_BITS_PER_WIDE_INT >= 64) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else if (i < HOST_BITS_PER_WIDE_INT) + lo = (HOST_WIDE_INT)1 << i, hi = 0; + else + lo = 0, hi = (HOST_WIDE_INT)1 << (i - HOST_BITS_PER_WIDE_INT); + + op1 = immed_double_const (lo, hi, DImode); + if (i >= 31) + { + emit_move_insn (operands[2], op1); + op1 = operands[2]; + } + + emit_insn (gen_xordi3 (operands[0], operands[0], op1)); + DONE; +}) ;; Store-flag instructions. @@ -12747,125 +13151,125 @@ (define_expand "seq" [(set (match_operand:QI 0 "register_operand" "") - (eq:QI (reg:CC 17) (const_int 0)))] + (eq:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (EQ, operands[0])) DONE; else FAIL;") (define_expand "sne" [(set (match_operand:QI 0 "register_operand" "") - (ne:QI (reg:CC 17) (const_int 0)))] + (ne:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (NE, operands[0])) DONE; else FAIL;") (define_expand "sgt" [(set (match_operand:QI 0 "register_operand" "") - (gt:QI (reg:CC 17) (const_int 0)))] + (gt:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (GT, operands[0])) DONE; else FAIL;") (define_expand "sgtu" [(set (match_operand:QI 0 "register_operand" "") - (gtu:QI (reg:CC 17) (const_int 0)))] + (gtu:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (GTU, operands[0])) DONE; else FAIL;") (define_expand "slt" [(set (match_operand:QI 0 "register_operand" "") - (lt:QI (reg:CC 17) (const_int 0)))] + (lt:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (LT, operands[0])) DONE; else FAIL;") (define_expand "sltu" [(set (match_operand:QI 0 "register_operand" "") - (ltu:QI (reg:CC 17) (const_int 0)))] + (ltu:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (LTU, operands[0])) DONE; else FAIL;") (define_expand "sge" [(set (match_operand:QI 0 "register_operand" "") - (ge:QI (reg:CC 17) (const_int 0)))] + (ge:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (GE, operands[0])) DONE; else FAIL;") (define_expand "sgeu" [(set (match_operand:QI 0 "register_operand" "") - (geu:QI (reg:CC 17) (const_int 0)))] + (geu:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (GEU, operands[0])) DONE; else FAIL;") (define_expand "sle" [(set (match_operand:QI 0 "register_operand" "") - (le:QI (reg:CC 17) (const_int 0)))] + (le:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (LE, operands[0])) DONE; else FAIL;") (define_expand "sleu" [(set (match_operand:QI 0 "register_operand" "") - (leu:QI (reg:CC 17) (const_int 0)))] + (leu:QI (reg:CC FLAGS_REG) (const_int 0)))] "" "if (ix86_expand_setcc (LEU, operands[0])) DONE; else FAIL;") (define_expand "sunordered" [(set (match_operand:QI 0 "register_operand" "") - (unordered:QI (reg:CC 17) (const_int 0)))] + (unordered:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNORDERED, operands[0])) DONE; else FAIL;") (define_expand "sordered" [(set (match_operand:QI 0 "register_operand" "") - (ordered:QI (reg:CC 17) (const_int 0)))] + (ordered:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387" "if (ix86_expand_setcc (ORDERED, operands[0])) DONE; else FAIL;") (define_expand "suneq" [(set (match_operand:QI 0 "register_operand" "") - (uneq:QI (reg:CC 17) (const_int 0)))] + (uneq:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNEQ, operands[0])) DONE; else FAIL;") (define_expand "sunge" [(set (match_operand:QI 0 "register_operand" "") - (unge:QI (reg:CC 17) (const_int 0)))] + (unge:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNGE, operands[0])) DONE; else FAIL;") (define_expand "sungt" [(set (match_operand:QI 0 "register_operand" "") - (ungt:QI (reg:CC 17) (const_int 0)))] + (ungt:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNGT, operands[0])) DONE; else FAIL;") (define_expand "sunle" [(set (match_operand:QI 0 "register_operand" "") - (unle:QI (reg:CC 17) (const_int 0)))] + (unle:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNLE, operands[0])) DONE; else FAIL;") (define_expand "sunlt" [(set (match_operand:QI 0 "register_operand" "") - (unlt:QI (reg:CC 17) (const_int 0)))] + (unlt:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (UNLT, operands[0])) DONE; else FAIL;") (define_expand "sltgt" [(set (match_operand:QI 0 "register_operand" "") - (ltgt:QI (reg:CC 17) (const_int 0)))] + (ltgt:QI (reg:CC FLAGS_REG) (const_int 0)))] "TARGET_80387 || TARGET_SSE" "if (ix86_expand_setcc (LTGT, operands[0])) DONE; else FAIL;") (define_insn "*setcc_1" [(set (match_operand:QI 0 "nonimmediate_operand" "=qm") (match_operator:QI 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]))] + [(reg FLAGS_REG) (const_int 0)]))] "" "set%C1\t%0" [(set_attr "type" "setcc") (set_attr "mode" "QI")]) -(define_insn "setcc_2" +(define_insn "*setcc_2" [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm")) (match_operator:QI 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]))] + [(reg FLAGS_REG) (const_int 0)]))] "" "set%C1\t%0" [(set_attr "type" "setcc") @@ -12882,7 +13286,7 @@ (define_split [(set (match_operand:QI 0 "nonimmediate_operand" "") (ne:QI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] @@ -12893,7 +13297,7 @@ (define_split [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) (ne:QI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] @@ -12904,7 +13308,7 @@ (define_split [(set (match_operand:QI 0 "nonimmediate_operand" "") (eq:QI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] @@ -12912,8 +13316,8 @@ rtx new_op1 = copy_rtx (operands[1]); operands[1] = new_op1; PUT_MODE (new_op1, QImode); - PUT_CODE (new_op1, REVERSE_CONDITION (GET_CODE (new_op1), - GET_MODE (XEXP (new_op1, 0)))); + PUT_CODE (new_op1, ix86_reverse_condition (GET_CODE (new_op1), + GET_MODE (XEXP (new_op1, 0)))); /* Make sure that (a) the CCmode we have for the flags is strong enough for the reversed compare or (b) we have a valid FP compare. */ @@ -12924,7 +13328,7 @@ (define_split [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) (eq:QI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)))] "" [(set (match_dup 0) (match_dup 1))] @@ -12932,8 +13336,8 @@ rtx new_op1 = copy_rtx (operands[1]); operands[1] = new_op1; PUT_MODE (new_op1, QImode); - PUT_CODE (new_op1, REVERSE_CONDITION (GET_CODE (new_op1), - GET_MODE (XEXP (new_op1, 0)))); + PUT_CODE (new_op1, ix86_reverse_condition (GET_CODE (new_op1), + GET_MODE (XEXP (new_op1, 0)))); /* Make sure that (a) the CCmode we have for the flags is strong enough for the reversed compare or (b) we have a valid FP compare. */ @@ -12944,17 +13348,14 @@ ;; The SSE store flag instructions saves 0 or 0xffffffff to the result. ;; subsequent logical operations are used to imitate conditional moves. ;; 0xffffffff is NaN, but not in normalized form, so we can't represent -;; it directly. Further holding this value in pseudo register might bring -;; problem in implicit normalization in spill code. -;; So we don't define FLOAT_STORE_FLAG_VALUE and create these -;; instructions after reload by splitting the conditional move patterns. +;; it directly. (define_insn "*sse_setccsf" [(set (match_operand:SF 0 "register_operand" "=x") (match_operator:SF 1 "sse_comparison_operator" [(match_operand:SF 2 "register_operand" "0") (match_operand:SF 3 "nonimmediate_operand" "xm")]))] - "TARGET_SSE && reload_completed" + "TARGET_SSE" "cmp%D1ss\t{%3, %0|%0, %3}" [(set_attr "type" "ssecmp") (set_attr "mode" "SF")]) @@ -12964,7 +13365,7 @@ (match_operator:DF 1 "sse_comparison_operator" [(match_operand:DF 2 "register_operand" "0") (match_operand:DF 3 "nonimmediate_operand" "Ym")]))] - "TARGET_SSE2 && reload_completed" + "TARGET_SSE2" "cmp%D1sd\t{%3, %0|%0, %3}" [(set_attr "type" "ssecmp") (set_attr "mode" "DF")]) @@ -12973,7 +13374,7 @@ ;; We ignore the overflow flag for signed branch instructions. ;; For all bCOND expanders, also expand the compare or test insn that -;; generates reg 17. Generate an equality comparison if `beq' or `bne'. +;; generates reg FLAGS_REG. Generate an equality comparison if `beq' or `bne'. (define_expand "beq" [(set (pc) @@ -13060,7 +13461,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNORDERED, operands[0]); DONE;") (define_expand "bordered" @@ -13068,7 +13469,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (ORDERED, operands[0]); DONE;") (define_expand "buneq" @@ -13076,7 +13477,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNEQ, operands[0]); DONE;") (define_expand "bunge" @@ -13084,7 +13485,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNGE, operands[0]); DONE;") (define_expand "bungt" @@ -13092,7 +13493,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNGT, operands[0]); DONE;") (define_expand "bunle" @@ -13100,7 +13501,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNLE, operands[0]); DONE;") (define_expand "bunlt" @@ -13108,7 +13509,7 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (UNLT, operands[0]); DONE;") (define_expand "bltgt" @@ -13116,13 +13517,13 @@ (if_then_else (match_dup 1) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_80387 || TARGET_SSE" + "TARGET_80387 || TARGET_SSE_MATH" "ix86_expand_branch (LTGT, operands[0]); DONE;") (define_insn "*jcc_1" [(set (pc) (if_then_else (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (label_ref (match_operand 0 "" "")) (pc)))] "" @@ -13140,7 +13541,7 @@ (define_insn "*jcc_2" [(set (pc) (if_then_else (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (pc) (label_ref (match_operand 0 "" ""))))] "" @@ -13166,7 +13567,7 @@ (define_split [(set (pc) (if_then_else (ne (match_operator 0 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] @@ -13182,7 +13583,7 @@ (define_split [(set (pc) (if_then_else (eq (match_operator 0 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] @@ -13195,8 +13596,8 @@ rtx new_op0 = copy_rtx (operands[0]); operands[0] = new_op0; PUT_MODE (new_op0, VOIDmode); - PUT_CODE (new_op0, REVERSE_CONDITION (GET_CODE (new_op0), - GET_MODE (XEXP (new_op0, 0)))); + PUT_CODE (new_op0, ix86_reverse_condition (GET_CODE (new_op0), + GET_MODE (XEXP (new_op0, 0)))); /* Make sure that (a) the CCmode we have for the flags is strong enough for the reversed compare or (b) we have a valid FP compare. */ @@ -13208,18 +13609,17 @@ ;; during early optimization. Splitting the operation apart early makes ;; for bad code when we want to reverse the operation. -(define_insn "*fp_jcc_1" +(define_insn "*fp_jcc_1_mixed" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" - [(match_operand 1 "register_operand" "f") - (match_operand 2 "register_operand" "f")]) + [(match_operand 1 "register_operand" "f,x") + (match_operand 2 "nonimmediate_operand" "f,xm")]) (label_ref (match_operand 3 "" "")) (pc))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "TARGET_CMOVE && TARGET_80387 - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1])) - && FLOAT_MODE_P (GET_MODE (operands[1])) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_MIX_SSE_I387 + && SSE_FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2]) && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") @@ -13227,44 +13627,44 @@ (define_insn "*fp_jcc_1_sse" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" - [(match_operand 1 "register_operand" "f#x,x#f") - (match_operand 2 "nonimmediate_operand" "f#x,xm#f")]) + [(match_operand 1 "register_operand" "x") + (match_operand 2 "nonimmediate_operand" "xm")]) (label_ref (match_operand 3 "" "")) (pc))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "TARGET_80387 + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_SSE_MATH && SSE_FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2]) && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_1_sse_only" - [(set (pc) - (if_then_else (match_operator 0 "comparison_operator" - [(match_operand 1 "register_operand" "x") - (match_operand 2 "nonimmediate_operand" "xm")]) - (label_ref (match_operand 3 "" "")) - (pc))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "SSE_FLOAT_MODE_P (GET_MODE (operands[1])) - && GET_MODE (operands[1]) == GET_MODE (operands[2]) - && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" - "#") - -(define_insn "*fp_jcc_2" +(define_insn "*fp_jcc_1_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") (match_operand 2 "register_operand" "f")]) + (label_ref (match_operand 3 "" "")) + (pc))) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_CMOVE && TARGET_80387 + && FLOAT_MODE_P (GET_MODE (operands[1])) + && GET_MODE (operands[1]) == GET_MODE (operands[2]) + && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" + "#") + +(define_insn "*fp_jcc_2_mixed" + [(set (pc) + (if_then_else (match_operator 0 "comparison_operator" + [(match_operand 1 "register_operand" "f,x") + (match_operand 2 "nonimmediate_operand" "f,xm")]) (pc) (label_ref (match_operand 3 "" "")))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "TARGET_CMOVE && TARGET_80387 - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1])) - && FLOAT_MODE_P (GET_MODE (operands[1])) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_MIX_SSE_I387 + && SSE_FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2]) && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") @@ -13272,41 +13672,42 @@ (define_insn "*fp_jcc_2_sse" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" - [(match_operand 1 "register_operand" "f#x,x#f") - (match_operand 2 "nonimmediate_operand" "f#x,xm#f")]) + [(match_operand 1 "register_operand" "x") + (match_operand 2 "nonimmediate_operand" "xm")]) (pc) (label_ref (match_operand 3 "" "")))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "TARGET_80387 + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_SSE_MATH && SSE_FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2]) && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_2_sse_only" +(define_insn "*fp_jcc_2_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" - [(match_operand 1 "register_operand" "x") - (match_operand 2 "nonimmediate_operand" "xm")]) + [(match_operand 1 "register_operand" "f") + (match_operand 2 "register_operand" "f")]) (pc) (label_ref (match_operand 3 "" "")))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] - "SSE_FLOAT_MODE_P (GET_MODE (operands[1])) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] + "TARGET_CMOVE && TARGET_80387 + && FLOAT_MODE_P (GET_MODE (operands[1])) && GET_MODE (operands[1]) == GET_MODE (operands[2]) && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_3" +(define_insn "*fp_jcc_3_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") (match_operand 2 "nonimmediate_operand" "fm")]) (label_ref (match_operand 3 "" "")) (pc))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17)) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) (clobber (match_scratch:HI 4 "=a"))] "TARGET_80387 && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode) @@ -13317,15 +13718,15 @@ && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_4" +(define_insn "*fp_jcc_4_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") (match_operand 2 "nonimmediate_operand" "fm")]) (pc) (label_ref (match_operand 3 "" "")))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17)) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) (clobber (match_scratch:HI 4 "=a"))] "TARGET_80387 && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode) @@ -13336,15 +13737,15 @@ && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_5" +(define_insn "*fp_jcc_5_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") (match_operand 2 "register_operand" "f")]) (label_ref (match_operand 3 "" "")) (pc))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17)) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) (clobber (match_scratch:HI 4 "=a"))] "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) @@ -13352,15 +13753,15 @@ && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") -(define_insn "*fp_jcc_6" +(define_insn "*fp_jcc_6_387" [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") (match_operand 2 "register_operand" "f")]) (pc) (label_ref (match_operand 3 "" "")))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17)) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) (clobber (match_scratch:HI 4 "=a"))] "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) @@ -13368,6 +13769,49 @@ && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" "#") +(define_insn "*fp_jcc_7_387" + [(set (pc) + (if_then_else (match_operator 0 "comparison_operator" + [(match_operand 1 "register_operand" "f") + (match_operand 2 "const0_operand" "X")]) + (label_ref (match_operand 3 "" "")) + (pc))) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) + (clobber (match_scratch:HI 4 "=a"))] + "TARGET_80387 + && FLOAT_MODE_P (GET_MODE (operands[1])) + && GET_MODE (operands[1]) == GET_MODE (operands[2]) + && !ix86_use_fcomi_compare (GET_CODE (operands[0])) + && SELECT_CC_MODE (GET_CODE (operands[0]), + operands[1], operands[2]) == CCFPmode + && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))" + "#") + +;; The order of operands in *fp_jcc_8_387 is forced by combine in +;; simplify_comparison () function. Float operator is treated as RTX_OBJ +;; with a precedence over other operators and is always put in the first +;; place. Swap condition and operands to match ficom instruction. + +(define_insn "*fp_jcc_8_387" + [(set (pc) + (if_then_else (match_operator 0 "comparison_operator" + [(match_operator 1 "float_operator" + [(match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r")]) + (match_operand 3 "register_operand" "f,f")]) + (label_ref (match_operand 4 "" "")) + (pc))) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) + (clobber (match_scratch:HI 5 "=a,a"))] + "TARGET_80387 && TARGET_USE_MODE_FIOP + && FLOAT_MODE_P (GET_MODE (operands[3])) + && GET_MODE (operands[1]) == GET_MODE (operands[3]) + && !ix86_use_fcomi_compare (swap_condition (GET_CODE (operands[0]))) + && ix86_fp_compare_mode (swap_condition (GET_CODE (operands[0]))) == CCFPmode + && ix86_fp_jump_nontrivial_p (swap_condition (GET_CODE (operands[0])))" + "#") + (define_split [(set (pc) (if_then_else (match_operator 0 "comparison_operator" @@ -13375,13 +13819,13 @@ (match_operand 2 "nonimmediate_operand" "")]) (match_operand 3 "" "") (match_operand 4 "" ""))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17))] + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG))] "reload_completed" [(const_int 0)] { ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2], - operands[3], operands[4], NULL_RTX); + operands[3], operands[4], NULL_RTX, NULL_RTX); DONE; }) @@ -13389,20 +13833,61 @@ [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "") - (match_operand 2 "nonimmediate_operand" "")]) + (match_operand 2 "general_operand" "")]) (match_operand 3 "" "") (match_operand 4 "" ""))) - (clobber (reg:CCFP 18)) - (clobber (reg:CCFP 17)) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) (clobber (match_scratch:HI 5 "=a"))] "reload_completed" - [(set (pc) - (if_then_else (match_dup 6) - (match_dup 3) - (match_dup 4)))] + [(const_int 0)] { ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2], - operands[3], operands[4], operands[5]); + operands[3], operands[4], operands[5], NULL_RTX); + DONE; +}) + +(define_split + [(set (pc) + (if_then_else (match_operator 0 "comparison_operator" + [(match_operator 1 "float_operator" + [(match_operand:X87MODEI12 2 "memory_operand" "")]) + (match_operand 3 "register_operand" "")]) + (match_operand 4 "" "") + (match_operand 5 "" ""))) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) + (clobber (match_scratch:HI 6 "=a"))] + "reload_completed" + [(const_int 0)] +{ + operands[7] = gen_rtx_FLOAT (GET_MODE (operands[1]), operands[2]); + ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])), + operands[3], operands[7], + operands[4], operands[5], operands[6], NULL_RTX); + DONE; +}) + +;; %%% Kill this when reload knows how to do it. +(define_split + [(set (pc) + (if_then_else (match_operator 0 "comparison_operator" + [(match_operator 1 "float_operator" + [(match_operand:X87MODEI12 2 "register_operand" "")]) + (match_operand 3 "register_operand" "")]) + (match_operand 4 "" "") + (match_operand 5 "" ""))) + (clobber (reg:CCFP FPSR_REG)) + (clobber (reg:CCFP FLAGS_REG)) + (clobber (match_scratch:HI 6 "=a"))] + "reload_completed" + [(const_int 0)] +{ + operands[7] = ix86_force_to_memory (GET_MODE (operands[2]), operands[2]); + operands[7] = gen_rtx_FLOAT (GET_MODE (operands[1]), operands[7]); + ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])), + operands[3], operands[7], + operands[4], operands[5], operands[6], operands[2]); DONE; }) @@ -13494,119 +13979,13 @@ [(set_attr "type" "ibr") (set_attr "length_immediate" "0")]) -;; Loop instruction -;; -;; This is all complicated by the fact that since this is a jump insn -;; we must handle our own reloads. - -(define_expand "doloop_end" - [(use (match_operand 0 "" "")) ; loop pseudo - (use (match_operand 1 "" "")) ; iterations; zero if unknown - (use (match_operand 2 "" "")) ; max iterations - (use (match_operand 3 "" "")) ; loop level - (use (match_operand 4 "" ""))] ; label - "!TARGET_64BIT && TARGET_USE_LOOP" - " -{ - /* Only use cloop on innermost loops. */ - if (INTVAL (operands[3]) > 1) - FAIL; - if (GET_MODE (operands[0]) != SImode) - FAIL; - emit_jump_insn (gen_doloop_end_internal (operands[4], operands[0], - operands[0])); - DONE; -}") - -(define_insn "doloop_end_internal" - [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "c,?*r,?*r") - (const_int 1)) - (label_ref (match_operand 0 "" "")) - (pc))) - (set (match_operand:SI 2 "register_operand" "=1,1,*m*r") - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:SI 3 "=X,X,r")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_USE_LOOP" -{ - if (which_alternative != 0) - return "#"; - if (get_attr_length (insn) == 2) - return "%+loop\t%l0"; - else - return "dec{l}\t%1\;%+jne\t%l0"; -} - [(set_attr "ppro_uops" "many") - (set (attr "length") - (if_then_else (and (eq_attr "alternative" "0") - (and (ge (minus (match_dup 0) (pc)) - (const_int -126)) - (lt (minus (match_dup 0) (pc)) - (const_int 128)))) - (const_int 2) - (const_int 16))) - ;; We don't know the type before shorten branches. Optimistically expect - ;; the loop instruction to match. - (set (attr "type") (const_string "ibr"))]) - -(define_split - [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "") - (const_int 1)) - (match_operand 0 "" "") - (pc))) - (set (match_dup 1) - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:SI 2 "")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_USE_LOOP - && reload_completed - && REGNO (operands[1]) != 2" - [(parallel [(set (reg:CCZ 17) - (compare:CCZ (plus:SI (match_dup 1) (const_int -1)) - (const_int 0))) - (set (match_dup 1) (plus:SI (match_dup 1) (const_int -1)))]) - (set (pc) (if_then_else (ne (reg:CCZ 17) (const_int 0)) - (match_dup 0) - (pc)))] - "") - -(define_split - [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "") - (const_int 1)) - (match_operand 0 "" "") - (pc))) - (set (match_operand:SI 2 "nonimmediate_operand" "") - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 17))] - "!TARGET_64BIT && TARGET_USE_LOOP - && reload_completed - && (! REG_P (operands[2]) - || ! rtx_equal_p (operands[1], operands[2]))" - [(set (match_dup 3) (match_dup 1)) - (parallel [(set (reg:CCZ 17) - (compare:CCZ (plus:SI (match_dup 3) (const_int -1)) - (const_int 0))) - (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) - (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCZ 17) (const_int 0)) - (match_dup 0) - (pc)))] - "") - ;; Convert setcc + movzbl to xor + setcc if operands don't overlap. (define_peephole2 - [(set (reg 17) (match_operand 0 "" "")) + [(set (reg FLAGS_REG) (match_operand 0 "" "")) (set (match_operand:QI 1 "register_operand" "") (match_operator:QI 2 "ix86_comparison_operator" - [(reg 17) (const_int 0)])) + [(reg FLAGS_REG) (const_int 0)])) (set (match_operand 3 "q_regs_operand" "") (zero_extend (match_dup 1)))] "(peep2_reg_dead_p (3, operands[1]) @@ -13616,7 +13995,7 @@ (set (strict_low_part (match_dup 5)) (match_dup 2))] { - operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17); + operands[4] = gen_rtx_REG (GET_MODE (operands[0]), FLAGS_REG); operands[5] = gen_lowpart (QImode, operands[3]); ix86_expand_clear (operands[3]); }) @@ -13624,13 +14003,13 @@ ;; Similar, but match zero_extendhisi2_and, which adds a clobber. (define_peephole2 - [(set (reg 17) (match_operand 0 "" "")) + [(set (reg FLAGS_REG) (match_operand 0 "" "")) (set (match_operand:QI 1 "register_operand" "") (match_operator:QI 2 "ix86_comparison_operator" - [(reg 17) (const_int 0)])) + [(reg FLAGS_REG) (const_int 0)])) (parallel [(set (match_operand 3 "q_regs_operand" "") (zero_extend (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "(peep2_reg_dead_p (3, operands[1]) || operands_match_p (operands[1], operands[3])) && ! reg_overlap_mentioned_p (operands[3], operands[0])" @@ -13638,7 +14017,7 @@ (set (strict_low_part (match_dup 5)) (match_dup 2))] { - operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17); + operands[4] = gen_rtx_REG (GET_MODE (operands[0]), FLAGS_REG); operands[5] = gen_lowpart (QImode, operands[3]); ix86_expand_clear (operands[3]); }) @@ -13654,8 +14033,8 @@ (define_expand "call_pop" [(parallel [(call (match_operand:QI 0 "" "") (match_operand:SI 1 "" "")) - (set (reg:SI 7) - (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) (match_operand:SI 3 "" "")))])] "!TARGET_64BIT" { @@ -13666,7 +14045,7 @@ (define_insn "*call_pop_0" [(call (mem:QI (match_operand:SI 0 "constant_call_address_operand" "")) (match_operand:SI 1 "" "")) - (set (reg:SI 7) (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_operand:SI 2 "immediate_operand" "")))] "!TARGET_64BIT" { @@ -13680,7 +14059,7 @@ (define_insn "*call_pop_1" [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm")) (match_operand:SI 1 "" "")) - (set (reg:SI 7) (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_operand:SI 2 "immediate_operand" "i")))] "!TARGET_64BIT" { @@ -13735,7 +14114,7 @@ (match_operand 1 "" ""))] "!SIBLING_CALL_P (insn) && !TARGET_64BIT" { - if (constant_call_address_operand (operands[0], QImode)) + if (constant_call_address_operand (operands[0], Pmode)) return "call\t%P0"; return "call\t%A0"; } @@ -13746,7 +14125,7 @@ (match_operand 1 "" ""))] "SIBLING_CALL_P (insn) && !TARGET_64BIT" { - if (constant_call_address_operand (operands[0], QImode)) + if (constant_call_address_operand (operands[0], Pmode)) return "jmp\t%P0"; return "jmp\t%A0"; } @@ -13757,7 +14136,7 @@ (match_operand 1 "" ""))] "!SIBLING_CALL_P (insn) && TARGET_64BIT" { - if (constant_call_address_operand (operands[0], QImode)) + if (constant_call_address_operand (operands[0], Pmode)) return "call\t%P0"; return "call\t%A0"; } @@ -13784,8 +14163,8 @@ [(parallel [(set (match_operand 0 "" "") (call (match_operand:QI 1 "" "") (match_operand:SI 2 "" ""))) - (set (reg:SI 7) - (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) (match_operand:SI 4 "" "")))])] "!TARGET_64BIT" { @@ -13925,8 +14304,7 @@ "nop" [(set_attr "length" "1") (set_attr "length_immediate" "0") - (set_attr "modrm" "0") - (set_attr "ppro_uops" "one")]) + (set_attr "modrm" "0")]) ;; Align to 16-byte boundary, max skip in op0. Used to avoid ;; branch prediction penalty for the third jump in a 16-byte @@ -13941,7 +14319,7 @@ #else /* It is tempting to use ASM_OUTPUT_ALIGN here, but we don't want to do that. The align insn is used to avoid 3 jump instructions in the row to improve - branch prediction and the benefits hardly outweight the cost of extra 8 + branch prediction and the benefits hardly outweigh the cost of extra 8 nops on the average inserted by full alignment pseudo operation. */ #endif return ""; @@ -13956,12 +14334,30 @@ (define_insn "set_got" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(const_int 0)] UNSPEC_SET_GOT)) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" - { return output_set_got (operands[0]); } + { return output_set_got (operands[0], NULL_RTX); } [(set_attr "type" "multi") (set_attr "length" "12")]) +(define_insn "set_got_labelled" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(label_ref (match_operand 1 "" ""))] + UNSPEC_SET_GOT)) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT" + { return output_set_got (operands[0], operands[1]); } + [(set_attr "type" "multi") + (set_attr "length" "12")]) + +(define_insn "set_got_rex64" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(const_int 0)] UNSPEC_SET_GOT))] + "TARGET_64BIT" + "lea{q}\t_GLOBAL_OFFSET_TABLE_(%%rip), %0" + [(set_attr "type" "lea") + (set_attr "length" "6")]) + (define_expand "epilogue" [(const_int 1)] "" @@ -13987,16 +14383,17 @@ emit_move_insn (tmp, ra); if (Pmode == SImode) - emit_insn (gen_eh_return_si (sa)); + emit_jump_insn (gen_eh_return_si (sa)); else - emit_insn (gen_eh_return_di (sa)); + emit_jump_insn (gen_eh_return_di (sa)); emit_barrier (); DONE; }) (define_insn_and_split "eh_return_si" - [(unspec_volatile [(match_operand:SI 0 "register_operand" "c")] - UNSPECV_EH_RETURN)] + [(set (pc) + (unspec [(match_operand:SI 0 "register_operand" "c")] + UNSPEC_EH_RETURN))] "!TARGET_64BIT" "#" "reload_completed" @@ -14004,8 +14401,9 @@ "ix86_expand_epilogue (2); DONE;") (define_insn_and_split "eh_return_di" - [(unspec_volatile [(match_operand:DI 0 "register_operand" "c")] - UNSPECV_EH_RETURN)] + [(set (pc) + (unspec [(match_operand:DI 0 "register_operand" "c")] + UNSPEC_EH_RETURN))] "TARGET_64BIT" "#" "reload_completed" @@ -14013,16 +14411,16 @@ "ix86_expand_epilogue (2); DONE;") (define_insn "leave" - [(set (reg:SI 7) (plus:SI (reg:SI 6) (const_int 4))) - (set (reg:SI 6) (mem:SI (reg:SI 6))) + [(set (reg:SI SP_REG) (plus:SI (reg:SI BP_REG) (const_int 4))) + (set (reg:SI BP_REG) (mem:SI (reg:SI BP_REG))) (clobber (mem:BLK (scratch)))] "!TARGET_64BIT" "leave" [(set_attr "type" "leave")]) (define_insn "leave_rex64" - [(set (reg:DI 7) (plus:DI (reg:DI 6) (const_int 8))) - (set (reg:DI 6) (mem:DI (reg:DI 6))) + [(set (reg:DI SP_REG) (plus:DI (reg:DI BP_REG) (const_int 8))) + (set (reg:DI BP_REG) (mem:DI (reg:DI BP_REG))) (clobber (mem:BLK (scratch)))] "TARGET_64BIT" "leave" @@ -14033,7 +14431,7 @@ [(set (match_operand:SI 0 "register_operand" "") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" ""))) (clobber (match_scratch:SI 2 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -14041,73 +14439,118 @@ [(set (match_operand:SI 0 "register_operand" "=r") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))) (clobber (match_scratch:SI 2 "=&r")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_CMOVE" "#" "&& reload_completed" [(set (match_dup 2) (const_int -1)) - (parallel [(set (reg:CCZ 17) (compare:CCZ (match_dup 1) (const_int 0))) + (parallel [(set (reg:CCZ FLAGS_REG) (compare:CCZ (match_dup 1) (const_int 0))) (set (match_dup 0) (ctz:SI (match_dup 1)))]) (set (match_dup 0) (if_then_else:SI - (eq (reg:CCZ 17) (const_int 0)) + (eq (reg:CCZ FLAGS_REG) (const_int 0)) (match_dup 2) (match_dup 0))) (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (const_int 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_insn_and_split "*ffs_no_cmove" [(set (match_operand:SI 0 "nonimmediate_operand" "=r") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))) (clobber (match_scratch:SI 2 "=&q")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "#" "reload_completed" - [(parallel [(set (reg:CCZ 17) (compare:CCZ (match_dup 1) (const_int 0))) + [(parallel [(set (reg:CCZ FLAGS_REG) (compare:CCZ (match_dup 1) (const_int 0))) (set (match_dup 0) (ctz:SI (match_dup 1)))]) (set (strict_low_part (match_dup 3)) - (eq:QI (reg:CCZ 17) (const_int 0))) + (eq:QI (reg:CCZ FLAGS_REG) (const_int 0))) (parallel [(set (match_dup 2) (neg:SI (match_dup 2))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (ior:SI (match_dup 0) (match_dup 2))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (const_int 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { operands[3] = gen_lowpart (QImode, operands[2]); ix86_expand_clear (operands[2]); }) (define_insn "*ffssi_1" - [(set (reg:CCZ 17) + [(set (reg:CCZ FLAGS_REG) (compare:CCZ (match_operand:SI 1 "nonimmediate_operand" "rm") (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") (ctz:SI (match_dup 1)))] "" "bsf{l}\t{%1, %0|%0, %1}" - [(set_attr "prefix_0f" "1") - (set_attr "ppro_uops" "few")]) + [(set_attr "prefix_0f" "1")]) + +(define_expand "ffsdi2" + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (ffs:DI (match_operand:DI 1 "nonimmediate_operand" ""))) + (clobber (match_scratch:DI 2 "")) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT && TARGET_CMOVE" + "") + +(define_insn_and_split "*ffs_rex64" + [(set (match_operand:DI 0 "register_operand" "=r") + (ffs:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))) + (clobber (match_scratch:DI 2 "=&r")) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && TARGET_CMOVE" + "#" + "&& reload_completed" + [(set (match_dup 2) (const_int -1)) + (parallel [(set (reg:CCZ FLAGS_REG) + (compare:CCZ (match_dup 1) (const_int 0))) + (set (match_dup 0) (ctz:DI (match_dup 1)))]) + (set (match_dup 0) (if_then_else:DI + (eq (reg:CCZ FLAGS_REG) (const_int 0)) + (match_dup 2) + (match_dup 0))) + (parallel [(set (match_dup 0) (plus:DI (match_dup 0) (const_int 1))) + (clobber (reg:CC FLAGS_REG))])] + "") + +(define_insn "*ffsdi_1" + [(set (reg:CCZ FLAGS_REG) + (compare:CCZ (match_operand:DI 1 "nonimmediate_operand" "rm") + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=r") + (ctz:DI (match_dup 1)))] + "TARGET_64BIT" + "bsf{q}\t{%1, %0|%0, %1}" + [(set_attr "prefix_0f" "1")]) (define_insn "ctzsi2" [(set (match_operand:SI 0 "register_operand" "=r") (ctz:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "bsf{l}\t{%1, %0|%0, %1}" - [(set_attr "prefix_0f" "1") - (set_attr "ppro_uops" "few")]) + [(set_attr "prefix_0f" "1")]) + +(define_insn "ctzdi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (ctz:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "bsf{q}\t{%1, %0|%0, %1}" + [(set_attr "prefix_0f" "1")]) (define_expand "clzsi2" [(parallel [(set (match_operand:SI 0 "register_operand" "") (minus:SI (const_int 31) (clz:SI (match_operand:SI 1 "nonimmediate_operand" "")))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_dup 0) (xor:SI (match_dup 0) (const_int 31))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -14115,11 +14558,31 @@ [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (const_int 31) (clz:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "bsr{l}\t{%1, %0|%0, %1}" - [(set_attr "prefix_0f" "1") - (set_attr "ppro_uops" "few")]) + [(set_attr "prefix_0f" "1")]) + +(define_expand "clzdi2" + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (const_int 63) + (clz:DI (match_operand:DI 1 "nonimmediate_operand" "")))) + (clobber (reg:CC FLAGS_REG))]) + (parallel + [(set (match_dup 0) (xor:DI (match_dup 0) (const_int 63))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT" + "") + +(define_insn "*bsr_rex64" + [(set (match_operand:DI 0 "register_operand" "=r") + (minus:DI (const_int 63) + (clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "bsr{q}\t{%1, %0|%0, %1}" + [(set_attr "prefix_0f" "1")]) ;; Thread-local storage patterns for ELF. ;; @@ -14134,7 +14597,7 @@ UNSPEC_TLS_GD)) (clobber (match_scratch:SI 4 "=d")) (clobber (match_scratch:SI 5 "=c")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && TARGET_GNU_TLS" "lea{l}\t{%a2@TLSGD(,%1,1), %0|%0, %a2@TLSGD[%1*1]}\;call\t%P3" [(set_attr "type" "multi") @@ -14148,7 +14611,7 @@ UNSPEC_TLS_GD)) (clobber (match_scratch:SI 4 "=d")) (clobber (match_scratch:SI 5 "=c")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && TARGET_SUN_TLS" "lea{l}\t{%a2@DTLNDX(%1), %4|%4, %a2@DTLNDX[%1]} push{l}\t%4\;call\t%a2@TLSPLT\;pop{l}\t%4\;nop" @@ -14164,7 +14627,7 @@ UNSPEC_TLS_GD)) (clobber (match_scratch:SI 4 "")) (clobber (match_scratch:SI 5 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" { if (flag_pic) @@ -14174,13 +14637,19 @@ operands[2] = gen_reg_rtx (Pmode); emit_insn (gen_set_got (operands[2])); } + if (TARGET_GNU2_TLS) + { + emit_insn (gen_tls_dynamic_gnu2_32 + (operands[0], operands[1], operands[2])); + DONE; + } operands[3] = ix86_tls_get_addr (); }) (define_insn "*tls_global_dynamic_64" [(set (match_operand:DI 0 "register_operand" "=a") - (call (mem:QI (match_operand:DI 2 "call_insn_operand" "")) - (match_operand:DI 3 "" ""))) + (call:DI (mem:QI (match_operand:DI 2 "call_insn_operand" "")) + (match_operand:DI 3 "" ""))) (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)] "TARGET_64BIT" @@ -14190,11 +14659,17 @@ (define_expand "tls_global_dynamic_64" [(parallel [(set (match_operand:DI 0 "register_operand" "") - (call (mem:QI (match_dup 2)) (const_int 0))) + (call:DI (mem:QI (match_dup 2)) (const_int 0))) (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)])] "" { + if (TARGET_GNU2_TLS) + { + emit_insn (gen_tls_dynamic_gnu2_64 + (operands[0], operands[1])); + DONE; + } operands[2] = ix86_tls_get_addr (); }) @@ -14205,7 +14680,7 @@ UNSPEC_TLS_LD_BASE)) (clobber (match_scratch:SI 3 "=d")) (clobber (match_scratch:SI 4 "=c")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && TARGET_GNU_TLS" "lea{l}\t{%&@TLSLDM(%1), %0|%0, %&@TLSLDM[%1]}\;call\t%P2" [(set_attr "type" "multi") @@ -14218,7 +14693,7 @@ UNSPEC_TLS_LD_BASE)) (clobber (match_scratch:SI 3 "=d")) (clobber (match_scratch:SI 4 "=c")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && TARGET_SUN_TLS" "lea{l}\t{%&@TMDNX(%1), %3|%3, %&@TMDNX[%1]} push{l}\t%3\;call\t%&@TLSPLT\;pop{l}\t%3" @@ -14231,7 +14706,7 @@ UNSPEC_TLS_LD_BASE)) (clobber (match_scratch:SI 3 "")) (clobber (match_scratch:SI 4 "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" { if (flag_pic) @@ -14241,13 +14716,19 @@ operands[1] = gen_reg_rtx (Pmode); emit_insn (gen_set_got (operands[1])); } + if (TARGET_GNU2_TLS) + { + emit_insn (gen_tls_dynamic_gnu2_32 + (operands[0], ix86_tls_module_base (), operands[1])); + DONE; + } operands[2] = ix86_tls_get_addr (); }) (define_insn "*tls_local_dynamic_base_64" [(set (match_operand:DI 0 "register_operand" "=a") - (call (mem:QI (match_operand:DI 1 "call_insn_operand" "")) - (match_operand:DI 2 "" ""))) + (call:DI (mem:QI (match_operand:DI 1 "call_insn_operand" "")) + (match_operand:DI 2 "" ""))) (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)] "TARGET_64BIT" "lea{q}\t{%&@TLSLD(%%rip), %%rdi|%%rdi, %&@TLSLD[%%rip]}\;call\t%P1" @@ -14256,10 +14737,16 @@ (define_expand "tls_local_dynamic_base_64" [(parallel [(set (match_operand:DI 0 "register_operand" "") - (call (mem:QI (match_dup 1)) (const_int 0))) + (call:DI (mem:QI (match_dup 1)) (const_int 0))) (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])] "" { + if (TARGET_GNU2_TLS) + { + emit_insn (gen_tls_dynamic_gnu2_64 + (operands[0], ix86_tls_module_base ())); + DONE; + } operands[1] = ix86_tls_get_addr (); }) @@ -14276,7 +14763,7 @@ UNSPEC_DTPOFF)))) (clobber (match_scratch:SI 4 "=d")) (clobber (match_scratch:SI 5 "=c")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "#" "" @@ -14285,7 +14772,7 @@ UNSPEC_TLS_GD)) (clobber (match_dup 4)) (clobber (match_dup 5)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") ;; Load and add the thread base pointer from %gs:0. @@ -14305,7 +14792,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (unspec:SI [(const_int 0)] UNSPEC_TP) (match_operand:SI 1 "register_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "add{l}\t{%%gs:0, %0|%0, DWORD PTR %%gs:0}" [(set_attr "type" "alu") @@ -14329,7 +14816,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (unspec:DI [(const_int 0)] UNSPEC_TP) (match_operand:DI 1 "register_operand" "0"))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "add{q}\t{%%fs:0, %0|%0, QWORD PTR %%fs:0}" [(set_attr "type" "alu") @@ -14337,6 +14824,136 @@ (set_attr "length" "7") (set_attr "memory" "load") (set_attr "imm_disp" "false")]) + +;; GNU2 TLS patterns can be split. + +(define_expand "tls_dynamic_gnu2_32" + [(set (match_dup 3) + (plus:SI (match_operand:SI 2 "register_operand" "") + (const:SI + (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")] + UNSPEC_TLSDESC)))) + (parallel + [(set (match_operand:SI 0 "register_operand" "") + (unspec:SI [(match_dup 1) (match_dup 3) + (match_dup 2) (reg:SI SP_REG)] + UNSPEC_TLSDESC)) + (clobber (reg:CC FLAGS_REG))])] + "!TARGET_64BIT && TARGET_GNU2_TLS" +{ + operands[3] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); + ix86_tls_descriptor_calls_expanded_in_cfun = true; +}) + +(define_insn "*tls_dynamic_lea_32" + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_operand:SI 1 "register_operand" "b") + (const:SI + (unspec:SI [(match_operand:SI 2 "tls_symbolic_operand" "")] + UNSPEC_TLSDESC))))] + "!TARGET_64BIT && TARGET_GNU2_TLS" + "lea{l}\t{%a2@TLSDESC(%1), %0|%0, %a2@TLSDESC[%1]}" + [(set_attr "type" "lea") + (set_attr "mode" "SI") + (set_attr "length" "6") + (set_attr "length_address" "4")]) + +(define_insn "*tls_dynamic_call_32" + [(set (match_operand:SI 0 "register_operand" "=a") + (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "") + (match_operand:SI 2 "register_operand" "0") + ;; we have to make sure %ebx still points to the GOT + (match_operand:SI 3 "register_operand" "b") + (reg:SI SP_REG)] + UNSPEC_TLSDESC)) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && TARGET_GNU2_TLS" + "call\t{*%a1@TLSCALL(%2)|[DWORD PTR [%2+%a1@TLSCALL]]}" + [(set_attr "type" "call") + (set_attr "length" "2") + (set_attr "length_address" "0")]) + +(define_insn_and_split "*tls_dynamic_gnu2_combine_32" + [(set (match_operand:SI 0 "register_operand" "=&a") + (plus:SI + (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "") + (match_operand:SI 4 "" "") + (match_operand:SI 2 "register_operand" "b") + (reg:SI SP_REG)] + UNSPEC_TLSDESC) + (const:SI (unspec:SI + [(match_operand:SI 1 "tls_symbolic_operand" "")] + UNSPEC_DTPOFF)))) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && TARGET_GNU2_TLS" + "#" + "" + [(set (match_dup 0) (match_dup 5))] +{ + operands[5] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); + emit_insn (gen_tls_dynamic_gnu2_32 (operands[5], operands[1], operands[2])); +}) + +(define_expand "tls_dynamic_gnu2_64" + [(set (match_dup 2) + (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")] + UNSPEC_TLSDESC)) + (parallel + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_dup 1) (match_dup 2) (reg:DI SP_REG)] + UNSPEC_TLSDESC)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT && TARGET_GNU2_TLS" +{ + operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); + ix86_tls_descriptor_calls_expanded_in_cfun = true; +}) + +(define_insn "*tls_dynamic_lea_64" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")] + UNSPEC_TLSDESC))] + "TARGET_64BIT && TARGET_GNU2_TLS" + "lea{q}\t{%a1@TLSDESC(%%rip), %0|%0, %a1@TLSDESC[%%rip]}" + [(set_attr "type" "lea") + (set_attr "mode" "DI") + (set_attr "length" "7") + (set_attr "length_address" "4")]) + +(define_insn "*tls_dynamic_call_64" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "") + (match_operand:DI 2 "register_operand" "0") + (reg:DI SP_REG)] + UNSPEC_TLSDESC)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && TARGET_GNU2_TLS" + "call\t{*%a1@TLSCALL(%2)|[QWORD PTR [%2+%a1@TLSCALL]]}" + [(set_attr "type" "call") + (set_attr "length" "2") + (set_attr "length_address" "0")]) + +(define_insn_and_split "*tls_dynamic_gnu2_combine_64" + [(set (match_operand:DI 0 "register_operand" "=&a") + (plus:DI + (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "") + (match_operand:DI 3 "" "") + (reg:DI SP_REG)] + UNSPEC_TLSDESC) + (const:DI (unspec:DI + [(match_operand:DI 1 "tls_symbolic_operand" "")] + UNSPEC_DTPOFF)))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && TARGET_GNU2_TLS" + "#" + "" + [(set (match_dup 0) (match_dup 4))] +{ + operands[4] = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode); + emit_insn (gen_tls_dynamic_gnu2_64 (operands[4], operands[1])); +}) + +;; ;; These patterns match the binary 387 instructions for addM3, subM3, ;; mulM3 and divM3. There are three patterns for each of DFmode and @@ -14348,28 +14965,14 @@ ;; Gcc is slightly more smart about handling normal two address instructions ;; so use special patterns for add and mull. -(define_insn "*fop_sf_comm_nosse" - [(set (match_operand:SF 0 "register_operand" "=f") - (match_operator:SF 3 "binary_fp_operator" - [(match_operand:SF 1 "nonimmediate_operand" "%0") - (match_operand:SF 2 "nonimmediate_operand" "fm")]))] - "TARGET_80387 && !TARGET_SSE_MATH - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:SF 3 "mult_operator" "") - (const_string "fmul") - (const_string "fop"))) - (set_attr "mode" "SF")]) -(define_insn "*fop_sf_comm" - [(set (match_operand:SF 0 "register_operand" "=f#x,x#f") +(define_insn "*fop_sf_comm_mixed" + [(set (match_operand:SF 0 "register_operand" "=f,x") (match_operator:SF 3 "binary_fp_operator" [(match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "nonimmediate_operand" "fm#x,xm#f")]))] - "TARGET_80387 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387 - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' + (match_operand:SF 2 "nonimmediate_operand" "fm,xm")]))] + "TARGET_MIX_SSE_I387 + && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -14387,7 +14990,8 @@ (match_operator:SF 3 "binary_fp_operator" [(match_operand:SF 1 "nonimmediate_operand" "%0") (match_operand:SF 2 "nonimmediate_operand" "xm")]))] - "TARGET_SSE_MATH && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' + "TARGET_SSE_MATH + && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -14396,94 +15000,28 @@ (const_string "sseadd"))) (set_attr "mode" "SF")]) -(define_insn "*fop_df_comm_nosse" - [(set (match_operand:DF 0 "register_operand" "=f") - (match_operator:DF 3 "binary_fp_operator" - [(match_operand:DF 1 "nonimmediate_operand" "%0") - (match_operand:DF 2 "nonimmediate_operand" "fm")]))] - "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH) - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' +(define_insn "*fop_sf_comm_i387" + [(set (match_operand:SF 0 "register_operand" "=f") + (match_operator:SF 3 "binary_fp_operator" + [(match_operand:SF 1 "nonimmediate_operand" "%0") + (match_operand:SF 2 "nonimmediate_operand" "fm")]))] + "TARGET_80387 + && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (if_then_else (match_operand:SF 3 "mult_operator" "") (const_string "fmul") (const_string "fop"))) - (set_attr "mode" "DF")]) - -(define_insn "*fop_df_comm" - [(set (match_operand:DF 0 "register_operand" "=f#Y,Y#f") - (match_operator:DF 3 "binary_fp_operator" - [(match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "nonimmediate_operand" "fm#Y,Ym#f")]))] - "TARGET_80387 && TARGET_SSE_MATH && TARGET_SSE2 && TARGET_MIX_SSE_I387 - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (eq_attr "alternative" "1") - (if_then_else (match_operand:SF 3 "mult_operator" "") - (const_string "ssemul") - (const_string "sseadd")) - (if_then_else (match_operand:SF 3 "mult_operator" "") - (const_string "fmul") - (const_string "fop")))) - (set_attr "mode" "DF")]) - -(define_insn "*fop_df_comm_sse" - [(set (match_operand:DF 0 "register_operand" "=Y") - (match_operator:DF 3 "binary_fp_operator" - [(match_operand:DF 1 "nonimmediate_operand" "%0") - (match_operand:DF 2 "nonimmediate_operand" "Ym")]))] - "TARGET_SSE2 && TARGET_SSE_MATH - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c' - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:SF 3 "mult_operator" "") - (const_string "ssemul") - (const_string "sseadd"))) - (set_attr "mode" "DF")]) - -(define_insn "*fop_xf_comm" - [(set (match_operand:XF 0 "register_operand" "=f") - (match_operator:XF 3 "binary_fp_operator" - [(match_operand:XF 1 "register_operand" "%0") - (match_operand:XF 2 "register_operand" "f")]))] - "TARGET_80387 - && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:XF 3 "mult_operator" "") - (const_string "fmul") - (const_string "fop"))) - (set_attr "mode" "XF")]) - -(define_insn "*fop_sf_1_nosse" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (match_operator:SF 3 "binary_fp_operator" - [(match_operand:SF 1 "nonimmediate_operand" "0,fm") - (match_operand:SF 2 "nonimmediate_operand" "fm,0")]))] - "TARGET_80387 && !TARGET_SSE_MATH - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c' - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:SF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_sf_1" +(define_insn "*fop_sf_1_mixed" [(set (match_operand:SF 0 "register_operand" "=f,f,x") (match_operator:SF 3 "binary_fp_operator" [(match_operand:SF 1 "nonimmediate_operand" "0,fm,0") - (match_operand:SF 2 "nonimmediate_operand" "fm,0,xm#f")]))] - "TARGET_80387 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387 - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c' + (match_operand:SF 2 "nonimmediate_operand" "fm,0,xm")]))] + "TARGET_MIX_SSE_I387 + && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -14509,7 +15047,7 @@ [(match_operand:SF 1 "register_operand" "0") (match_operand:SF 2 "nonimmediate_operand" "xm")]))] "TARGET_SSE_MATH - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'" + && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:SF 3 "mult_operator" "") @@ -14520,77 +15058,124 @@ (const_string "sseadd"))) (set_attr "mode" "SF")]) -;; ??? Add SSE splitters for these! -(define_insn "*fop_sf_2" +;; This pattern is not fully shadowed by the pattern above. +(define_insn "*fop_sf_1_i387" [(set (match_operand:SF 0 "register_operand" "=f,f") (match_operator:SF 3 "binary_fp_operator" - [(float:SF (match_operand:SI 1 "nonimmediate_operand" "m,?r")) - (match_operand:SF 2 "register_operand" "0,0")]))] - "TARGET_80387 && TARGET_USE_FIOP && !TARGET_SSE_MATH" - "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:SF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "fp_int_src" "true") - (set_attr "ppro_uops" "many") - (set_attr "mode" "SI")]) - -(define_insn "*fop_sf_3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (match_operator:SF 3 "binary_fp_operator" - [(match_operand:SF 1 "register_operand" "0,0") - (float:SF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))] - "TARGET_80387 && TARGET_USE_FIOP && !TARGET_SSE_MATH" - "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") - (const_string "fmul") - (match_operand:SF 3 "div_operator" "") - (const_string "fdiv") - ] - (const_string "fop"))) - (set_attr "fp_int_src" "true") - (set_attr "ppro_uops" "many") - (set_attr "mode" "SI")]) - -(define_insn "*fop_df_1_nosse" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (match_operator:DF 3 "binary_fp_operator" - [(match_operand:DF 1 "nonimmediate_operand" "0,fm") - (match_operand:DF 2 "nonimmediate_operand" "fm,0")]))] - "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH) - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c' + [(match_operand:SF 1 "nonimmediate_operand" "0,fm") + (match_operand:SF 2 "nonimmediate_operand" "fm,0")]))] + "TARGET_80387 && !TARGET_SSE_MATH + && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + (cond [(match_operand:SF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:SF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) + (set_attr "mode" "SF")]) + +;; ??? Add SSE splitters for these! +(define_insn "*fop_sf_2_i387" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (match_operator:SF 3 "binary_fp_operator" + [(float:SF (match_operand:X87MODEI12 1 "nonimmediate_operand" "m,?r")) + (match_operand:SF 2 "register_operand" "0,0")]))] + "TARGET_80387 && TARGET_USE_MODE_FIOP && !TARGET_SSE_MATH" + "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" + [(set (attr "type") + (cond [(match_operand:SF 3 "mult_operator" "") + (const_string "fmul") + (match_operand:SF 3 "div_operator" "") + (const_string "fdiv") + ] + (const_string "fop"))) + (set_attr "fp_int_src" "true") + (set_attr "mode" "")]) + +(define_insn "*fop_sf_3_i387" + [(set (match_operand:SF 0 "register_operand" "=f,f") + (match_operator:SF 3 "binary_fp_operator" + [(match_operand:SF 1 "register_operand" "0,0") + (float:SF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))] + "TARGET_80387 && TARGET_USE_MODE_FIOP && !TARGET_SSE_MATH" + "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" + [(set (attr "type") + (cond [(match_operand:SF 3 "mult_operator" "") + (const_string "fmul") + (match_operand:SF 3 "div_operator" "") + (const_string "fdiv") + ] + (const_string "fop"))) + (set_attr "fp_int_src" "true") + (set_attr "mode" "")]) + +(define_insn "*fop_df_comm_mixed" + [(set (match_operand:DF 0 "register_operand" "=f,Y") + (match_operator:DF 3 "binary_fp_operator" + [(match_operand:DF 1 "nonimmediate_operand" "%0,0") + (match_operand:DF 2 "nonimmediate_operand" "fm,Ym")]))] + "TARGET_SSE2 && TARGET_MIX_SSE_I387 + && COMMUTATIVE_ARITH_P (operands[3]) + && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" + "* return output_387_binary_op (insn, operands);" + [(set (attr "type") + (if_then_else (eq_attr "alternative" "1") + (if_then_else (match_operand:DF 3 "mult_operator" "") + (const_string "ssemul") + (const_string "sseadd")) + (if_then_else (match_operand:DF 3 "mult_operator" "") + (const_string "fmul") + (const_string "fop")))) (set_attr "mode" "DF")]) +(define_insn "*fop_df_comm_sse" + [(set (match_operand:DF 0 "register_operand" "=Y") + (match_operator:DF 3 "binary_fp_operator" + [(match_operand:DF 1 "nonimmediate_operand" "%0") + (match_operand:DF 2 "nonimmediate_operand" "Ym")]))] + "TARGET_SSE2 && TARGET_SSE_MATH + && COMMUTATIVE_ARITH_P (operands[3]) + && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" + "* return output_387_binary_op (insn, operands);" + [(set (attr "type") + (if_then_else (match_operand:DF 3 "mult_operator" "") + (const_string "ssemul") + (const_string "sseadd"))) + (set_attr "mode" "DF")]) -(define_insn "*fop_df_1" - [(set (match_operand:DF 0 "register_operand" "=f#Y,f#Y,Y#f") +(define_insn "*fop_df_comm_i387" + [(set (match_operand:DF 0 "register_operand" "=f") + (match_operator:DF 3 "binary_fp_operator" + [(match_operand:DF 1 "nonimmediate_operand" "%0") + (match_operand:DF 2 "nonimmediate_operand" "fm")]))] + "TARGET_80387 + && COMMUTATIVE_ARITH_P (operands[3]) + && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" + "* return output_387_binary_op (insn, operands);" + [(set (attr "type") + (if_then_else (match_operand:DF 3 "mult_operator" "") + (const_string "fmul") + (const_string "fop"))) + (set_attr "mode" "DF")]) + +(define_insn "*fop_df_1_mixed" + [(set (match_operand:DF 0 "register_operand" "=f,f,Y") (match_operator:DF 3 "binary_fp_operator" [(match_operand:DF 1 "nonimmediate_operand" "0,fm,0") - (match_operand:DF 2 "nonimmediate_operand" "fm,0,Ym#f")]))] - "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387 - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c' + (match_operand:DF 2 "nonimmediate_operand" "fm,0,Ym")]))] + "TARGET_SSE2 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387 + && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(and (eq_attr "alternative" "2") - (match_operand:SF 3 "mult_operator" "")) + (match_operand:DF 3 "mult_operator" "")) (const_string "ssemul") (and (eq_attr "alternative" "2") - (match_operand:SF 3 "div_operator" "")) + (match_operand:DF 3 "div_operator" "")) (const_string "ssediv") (eq_attr "alternative" "2") (const_string "sseadd") @@ -14608,24 +15193,44 @@ [(match_operand:DF 1 "register_operand" "0") (match_operand:DF 2 "nonimmediate_operand" "Ym")]))] "TARGET_SSE2 && TARGET_SSE_MATH - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'" + && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" [(set_attr "mode" "DF") (set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "ssemul") - (match_operand:SF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "ssediv") ] (const_string "sseadd")))]) -;; ??? Add SSE splitters for these! -(define_insn "*fop_df_2" +;; This pattern is not fully shadowed by the pattern above. +(define_insn "*fop_df_1_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_fp_operator" - [(float:DF (match_operand:SI 1 "nonimmediate_operand" "m,?r")) + [(match_operand:DF 1 "nonimmediate_operand" "0,fm") + (match_operand:DF 2 "nonimmediate_operand" "fm,0")]))] + "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH) + && !COMMUTATIVE_ARITH_P (operands[3]) + && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" + "* return output_387_binary_op (insn, operands);" + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") + (const_string "fmul") + (match_operand:DF 3 "div_operator" "") + (const_string "fdiv") + ] + (const_string "fop"))) + (set_attr "mode" "DF")]) + +;; ??? Add SSE splitters for these! +(define_insn "*fop_df_2_i387" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (match_operator:DF 3 "binary_fp_operator" + [(float:DF (match_operand:X87MODEI12 1 "nonimmediate_operand" "m,?r")) (match_operand:DF 2 "register_operand" "0,0")]))] - "TARGET_80387 && TARGET_USE_FIOP && !(TARGET_SSE2 && TARGET_SSE_MATH)" + "TARGET_80387 && TARGET_USE_MODE_FIOP + && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:DF 3 "mult_operator" "") @@ -14635,15 +15240,15 @@ ] (const_string "fop"))) (set_attr "fp_int_src" "true") - (set_attr "ppro_uops" "many") - (set_attr "mode" "SI")]) + (set_attr "mode" "")]) -(define_insn "*fop_df_3" +(define_insn "*fop_df_3_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_fp_operator" [(match_operand:DF 1 "register_operand" "0,0") - (float:DF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))] - "TARGET_80387 && TARGET_USE_FIOP && !(TARGET_SSE2 && TARGET_SSE_MATH)" + (float:DF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))] + "TARGET_80387 && TARGET_USE_MODE_FIOP + && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:DF 3 "mult_operator" "") @@ -14653,15 +15258,14 @@ ] (const_string "fop"))) (set_attr "fp_int_src" "true") - (set_attr "ppro_uops" "many") - (set_attr "mode" "SI")]) + (set_attr "mode" "")]) -(define_insn "*fop_df_4" +(define_insn "*fop_df_4_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_fp_operator" [(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,0")) (match_operand:DF 2 "register_operand" "0,f")]))] - "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH) + "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" [(set (attr "type") @@ -14673,7 +15277,7 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_df_5" +(define_insn "*fop_df_5_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_fp_operator" [(match_operand:DF 1 "register_operand" "0,f") @@ -14690,7 +15294,7 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_df_6" +(define_insn "*fop_df_6_i387" [(set (match_operand:DF 0 "register_operand" "=f,f") (match_operator:DF 3 "binary_fp_operator" [(float_extend:DF @@ -14708,13 +15312,27 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_xf_1" +(define_insn "*fop_xf_comm_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (match_operator:XF 3 "binary_fp_operator" + [(match_operand:XF 1 "register_operand" "%0") + (match_operand:XF 2 "register_operand" "f")]))] + "TARGET_80387 + && COMMUTATIVE_ARITH_P (operands[3])" + "* return output_387_binary_op (insn, operands);" + [(set (attr "type") + (if_then_else (match_operand:XF 3 "mult_operator" "") + (const_string "fmul") + (const_string "fop"))) + (set_attr "mode" "XF")]) + +(define_insn "*fop_xf_1_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,f") (match_operand:XF 2 "register_operand" "f,0")]))] "TARGET_80387 - && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'" + && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -14725,12 +15343,12 @@ (const_string "fop"))) (set_attr "mode" "XF")]) -(define_insn "*fop_xf_2" +(define_insn "*fop_xf_2_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" - [(float:XF (match_operand:SI 1 "nonimmediate_operand" "m,?r")) + [(float:XF (match_operand:X87MODEI12 1 "nonimmediate_operand" "m,?r")) (match_operand:XF 2 "register_operand" "0,0")]))] - "TARGET_80387 && TARGET_USE_FIOP" + "TARGET_80387 && TARGET_USE_MODE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -14740,15 +15358,14 @@ ] (const_string "fop"))) (set_attr "fp_int_src" "true") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "many")]) + (set_attr "mode" "")]) -(define_insn "*fop_xf_3" +(define_insn "*fop_xf_3_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,0") - (float:XF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))] - "TARGET_80387 && TARGET_USE_FIOP" + (float:XF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))] + "TARGET_80387 && TARGET_USE_MODE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" [(set (attr "type") (cond [(match_operand:XF 3 "mult_operator" "") @@ -14758,10 +15375,9 @@ ] (const_string "fop"))) (set_attr "fp_int_src" "true") - (set_attr "mode" "SI") - (set_attr "ppro_uops" "many")]) + (set_attr "mode" "")]) -(define_insn "*fop_xf_4" +(define_insn "*fop_xf_4_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(float_extend:XF (match_operand 1 "nonimmediate_operand" "fm,0")) @@ -14777,7 +15393,7 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_xf_5" +(define_insn "*fop_xf_5_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(match_operand:XF 1 "register_operand" "0,f") @@ -14794,7 +15410,7 @@ (const_string "fop"))) (set_attr "mode" "SF")]) -(define_insn "*fop_xf_6" +(define_insn "*fop_xf_6_i387" [(set (match_operand:XF 0 "register_operand" "=f,f") (match_operator:XF 3 "binary_fp_operator" [(float_extend:XF @@ -14815,7 +15431,7 @@ (define_split [(set (match_operand 0 "register_operand" "") (match_operator 3 "binary_fp_operator" - [(float (match_operand:SI 1 "register_operand" "")) + [(float (match_operand:X87MODEI12 1 "register_operand" "")) (match_operand 2 "register_operand" "")]))] "TARGET_80387 && reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" @@ -14836,7 +15452,7 @@ [(set (match_operand 0 "register_operand" "") (match_operator 3 "binary_fp_operator" [(match_operand 1 "register_operand" "") - (float (match_operand:SI 2 "register_operand" ""))]))] + (float (match_operand:X87MODEI12 2 "register_operand" ""))]))] "TARGET_80387 && reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" [(const_int 0)] @@ -14857,17 +15473,16 @@ (define_expand "sqrtsf2" [(set (match_operand:SF 0 "register_operand" "") (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "")))] - "(! TARGET_NO_FANCY_MATH_387 && TARGET_80387) || TARGET_SSE_MATH" + "TARGET_USE_FANCY_MATH_387 || TARGET_SSE_MATH" { if (!TARGET_SSE_MATH) operands[1] = force_reg (SFmode, operands[1]); }) -(define_insn "sqrtsf2_1" - [(set (match_operand:SF 0 "register_operand" "=f#x,x#f") - (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "0#x,xm#f")))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && (TARGET_SSE_MATH && TARGET_MIX_SSE_I387)" +(define_insn "*sqrtsf2_mixed" + [(set (match_operand:SF 0 "register_operand" "=f,x") + (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "0,xm")))] + "TARGET_USE_FANCY_MATH_387 && TARGET_MIX_SSE_I387" "@ fsqrt sqrtss\t{%1, %0|%0, %1}" @@ -14875,20 +15490,19 @@ (set_attr "mode" "SF,SF") (set_attr "athlon_decode" "direct,*")]) -(define_insn "sqrtsf2_1_sse_only" +(define_insn "*sqrtsf2_sse" [(set (match_operand:SF 0 "register_operand" "=x") (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "xm")))] - "TARGET_SSE_MATH && (!TARGET_80387 || !TARGET_MIX_SSE_I387)" + "TARGET_SSE_MATH" "sqrtss\t{%1, %0|%0, %1}" [(set_attr "type" "sse") (set_attr "mode" "SF") (set_attr "athlon_decode" "*")]) -(define_insn "sqrtsf2_i387" +(define_insn "*sqrtsf2_i387" [(set (match_operand:SF 0 "register_operand" "=f") (sqrt:SF (match_operand:SF 1 "register_operand" "0")))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && !TARGET_SSE_MATH" + "TARGET_USE_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "SF") @@ -14897,18 +15511,16 @@ (define_expand "sqrtdf2" [(set (match_operand:DF 0 "register_operand" "") (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "")))] - "(! TARGET_NO_FANCY_MATH_387 && TARGET_80387) - || (TARGET_SSE2 && TARGET_SSE_MATH)" + "TARGET_USE_FANCY_MATH_387 || (TARGET_SSE2 && TARGET_SSE_MATH)" { - if (!TARGET_SSE2 || !TARGET_SSE_MATH) + if (!(TARGET_SSE2 && TARGET_SSE_MATH)) operands[1] = force_reg (DFmode, operands[1]); }) -(define_insn "sqrtdf2_1" - [(set (match_operand:DF 0 "register_operand" "=f#Y,Y#f") - (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "0#Y,Ym#f")))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && (TARGET_SSE2 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387)" +(define_insn "*sqrtdf2_mixed" + [(set (match_operand:DF 0 "register_operand" "=f,Y") + (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "0,Ym")))] + "TARGET_USE_FANCY_MATH_387 && TARGET_SSE2 && TARGET_MIX_SSE_I387" "@ fsqrt sqrtsd\t{%1, %0|%0, %1}" @@ -14916,31 +15528,30 @@ (set_attr "mode" "DF,DF") (set_attr "athlon_decode" "direct,*")]) -(define_insn "sqrtdf2_1_sse_only" +(define_insn "*sqrtdf2_sse" [(set (match_operand:DF 0 "register_operand" "=Y") (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "Ym")))] - "TARGET_SSE2 && TARGET_SSE_MATH && (!TARGET_80387 || !TARGET_MIX_SSE_I387)" + "TARGET_SSE2 && TARGET_SSE_MATH" "sqrtsd\t{%1, %0|%0, %1}" [(set_attr "type" "sse") (set_attr "mode" "DF") (set_attr "athlon_decode" "*")]) -(define_insn "sqrtdf2_i387" +(define_insn "*sqrtdf2_i387" [(set (match_operand:DF 0 "register_operand" "=f") (sqrt:DF (match_operand:DF 1 "register_operand" "0")))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && (!TARGET_SSE2 || !TARGET_SSE_MATH)" + "TARGET_USE_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "DF") (set_attr "athlon_decode" "direct")]) -(define_insn "*sqrtextendsfdf2" +(define_insn "*sqrtextendsfdf2_i387" [(set (match_operand:DF 0 "register_operand" "=f") (sqrt:DF (float_extend:DF (match_operand:SF 1 "register_operand" "0"))))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 - && !(TARGET_SSE2 && TARGET_SSE_MATH)" + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "DF") @@ -14949,46 +15560,217 @@ (define_insn "sqrtxf2" [(set (match_operand:XF 0 "register_operand" "=f") (sqrt:XF (match_operand:XF 1 "register_operand" "0")))] - "TARGET_80387 && !TARGET_NO_FANCY_MATH_387 - && (TARGET_IEEE_FP || flag_unsafe_math_optimizations) " + "TARGET_USE_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "XF") (set_attr "athlon_decode" "direct")]) -(define_insn "*sqrtextenddfxf2" - [(set (match_operand:XF 0 "register_operand" "=f") - (sqrt:XF (float_extend:XF - (match_operand:DF 1 "register_operand" "0"))))] - "TARGET_80387 && !TARGET_NO_FANCY_MATH_387" - "fsqrt" - [(set_attr "type" "fpspc") - (set_attr "mode" "XF") - (set_attr "athlon_decode" "direct")]) - -(define_insn "*sqrtextendsfxf2" +(define_insn "*sqrtextendsfxf2_i387" [(set (match_operand:XF 0 "register_operand" "=f") (sqrt:XF (float_extend:XF (match_operand:SF 1 "register_operand" "0"))))] - "TARGET_80387 && !TARGET_NO_FANCY_MATH_387" + "TARGET_USE_FANCY_MATH_387" "fsqrt" [(set_attr "type" "fpspc") (set_attr "mode" "XF") (set_attr "athlon_decode" "direct")]) -(define_insn "sindf2" +(define_insn "*sqrtextenddfxf2_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (sqrt:XF (float_extend:XF + (match_operand:DF 1 "register_operand" "0"))))] + "TARGET_USE_FANCY_MATH_387" + "fsqrt" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF") + (set_attr "athlon_decode" "direct")]) + +(define_insn "fpremxf4" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0") + (match_operand:XF 3 "register_operand" "1")] + UNSPEC_FPREM_F)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2) (match_dup 3)] + UNSPEC_FPREM_U)) + (set (reg:CCFP FPSR_REG) + (unspec:CCFP [(const_int 0)] UNSPEC_NOP))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fprem" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + +(define_expand "fmodsf3" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" "")) + (use (match_operand:SF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); + + emit_insn(gen_extendsfxf2 (op1, operands[1])); + emit_insn(gen_extendsfxf2 (op2, operands[2])); + + emit_label (label); + + emit_insn (gen_fpremxf4 (op1, op2, op1, op2)); + ix86_emit_fp_unordered_jump (label); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op1)); + DONE; +}) + +(define_expand "fmoddf3" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" "")) + (use (match_operand:DF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_extenddfxf2 (op2, operands[2])); + + emit_label (label); + + emit_insn (gen_fpremxf4 (op1, op2, op1, op2)); + ix86_emit_fp_unordered_jump (label); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op1)); + DONE; +}) + +(define_expand "fmodxf3" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" "")) + (use (match_operand:XF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + emit_label (label); + + emit_insn (gen_fpremxf4 (operands[1], operands[2], + operands[1], operands[2])); + ix86_emit_fp_unordered_jump (label); + + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_insn "fprem1xf4" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0") + (match_operand:XF 3 "register_operand" "1")] + UNSPEC_FPREM1_F)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2) (match_dup 3)] + UNSPEC_FPREM1_U)) + (set (reg:CCFP FPSR_REG) + (unspec:CCFP [(const_int 0)] UNSPEC_NOP))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fprem1" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + +(define_expand "dremsf3" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" "")) + (use (match_operand:SF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); + + emit_insn(gen_extendsfxf2 (op1, operands[1])); + emit_insn(gen_extendsfxf2 (op2, operands[2])); + + emit_label (label); + + emit_insn (gen_fprem1xf4 (op1, op2, op1, op2)); + ix86_emit_fp_unordered_jump (label); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op1)); + DONE; +}) + +(define_expand "dremdf3" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" "")) + (use (match_operand:DF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + rtx op1 = gen_reg_rtx (XFmode); + rtx op2 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_extenddfxf2 (op2, operands[2])); + + emit_label (label); + + emit_insn (gen_fprem1xf4 (op1, op2, op1, op2)); + ix86_emit_fp_unordered_jump (label); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op1)); + DONE; +}) + +(define_expand "dremxf3" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" "")) + (use (match_operand:XF 2 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + rtx label = gen_label_rtx (); + + emit_label (label); + + emit_insn (gen_fprem1xf4 (operands[1], operands[2], + operands[1], operands[2])); + ix86_emit_fp_unordered_jump (label); + + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_insn "*sindf2" [(set (match_operand:DF 0 "register_operand" "=f") (unspec:DF [(match_operand:DF 1 "register_operand" "0")] UNSPEC_SIN))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fsin" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) -(define_insn "sinsf2" +(define_insn "*sinsf2" [(set (match_operand:SF 0 "register_operand" "=f") (unspec:SF [(match_operand:SF 1 "register_operand" "0")] UNSPEC_SIN))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fsin" [(set_attr "type" "fpspc") @@ -14999,34 +15781,37 @@ (unspec:DF [(float_extend:DF (match_operand:SF 1 "register_operand" "0"))] UNSPEC_SIN))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fsin" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) -(define_insn "sinxf2" +(define_insn "*sinxf2" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_SIN))] - "TARGET_80387 && !TARGET_NO_FANCY_MATH_387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "fsin" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) -(define_insn "cosdf2" +(define_insn "*cosdf2" [(set (match_operand:DF 0 "register_operand" "=f") (unspec:DF [(match_operand:DF 1 "register_operand" "0")] UNSPEC_COS))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fcos" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) -(define_insn "cossf2" +(define_insn "*cossf2" [(set (match_operand:SF 0 "register_operand" "=f") (unspec:SF [(match_operand:SF 1 "register_operand" "0")] UNSPEC_COS))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fcos" [(set_attr "type" "fpspc") @@ -15037,38 +15822,324 @@ (unspec:DF [(float_extend:DF (match_operand:SF 1 "register_operand" "0"))] UNSPEC_COS))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fcos" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) -(define_insn "cosxf2" +(define_insn "*cosxf2" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_COS))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "fcos" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) +;; With sincos pattern defined, sin and cos builtin function will be +;; expanded to sincos pattern with one of its outputs left unused. +;; Cse pass will detected, if two sincos patterns can be combined, +;; otherwise sincos pattern will be split back to sin or cos pattern, +;; depending on the unused output. + +(define_insn "sincosdf3" + [(set (match_operand:DF 0 "register_operand" "=f") + (unspec:DF [(match_operand:DF 2 "register_operand" "0")] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "=u") + (unspec:DF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "fsincos" + [(set_attr "type" "fpspc") + (set_attr "mode" "DF")]) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(match_operand:DF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "") + (unspec:DF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 1) (unspec:DF [(match_dup 2)] UNSPEC_SIN))] + "") + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(match_operand:DF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "") + (unspec:DF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 0) (unspec:DF [(match_dup 2)] UNSPEC_COS))] + "") + +(define_insn "sincossf3" + [(set (match_operand:SF 0 "register_operand" "=f") + (unspec:SF [(match_operand:SF 2 "register_operand" "0")] + UNSPEC_SINCOS_COS)) + (set (match_operand:SF 1 "register_operand" "=u") + (unspec:SF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "fsincos" + [(set_attr "type" "fpspc") + (set_attr "mode" "SF")]) + +(define_split + [(set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_operand:SF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:SF 1 "register_operand" "") + (unspec:SF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 1) (unspec:SF [(match_dup 2)] UNSPEC_SIN))] + "") + +(define_split + [(set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_operand:SF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:SF 1 "register_operand" "") + (unspec:SF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 0) (unspec:SF [(match_dup 2)] UNSPEC_COS))] + "") + +(define_insn "*sincosextendsfdf3" + [(set (match_operand:DF 0 "register_operand" "=f") + (unspec:DF [(float_extend:DF + (match_operand:SF 2 "register_operand" "0"))] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "=u") + (unspec:DF [(float_extend:DF + (match_dup 2))] UNSPEC_SINCOS_SIN))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "fsincos" + [(set_attr "type" "fpspc") + (set_attr "mode" "DF")]) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(float_extend:DF + (match_operand:SF 2 "register_operand" ""))] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "") + (unspec:DF [(float_extend:DF + (match_dup 2))] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 1) (unspec:DF [(float_extend:DF + (match_dup 2))] UNSPEC_SIN))] + "") + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(float_extend:DF + (match_operand:SF 2 "register_operand" ""))] + UNSPEC_SINCOS_COS)) + (set (match_operand:DF 1 "register_operand" "") + (unspec:DF [(float_extend:DF + (match_dup 2))] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 0) (unspec:DF [(float_extend:DF + (match_dup 2))] UNSPEC_COS))] + "") + +(define_insn "sincosxf3" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0")] + UNSPEC_SINCOS_COS)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fsincos" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_operand:XF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:XF 1 "register_operand" "") + (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[0])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 1) (unspec:XF [(match_dup 2)] UNSPEC_SIN))] + "") + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_operand:XF 2 "register_operand" "")] + UNSPEC_SINCOS_COS)) + (set (match_operand:XF 1 "register_operand" "") + (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))] + "find_regno_note (insn, REG_UNUSED, REGNO (operands[1])) + && !reload_completed && !reload_in_progress" + [(set (match_dup 0) (unspec:XF [(match_dup 2)] UNSPEC_COS))] + "") + +(define_insn "*tandf3_1" + [(set (match_operand:DF 0 "register_operand" "=f") + (unspec:DF [(match_operand:DF 2 "register_operand" "0")] + UNSPEC_TAN_ONE)) + (set (match_operand:DF 1 "register_operand" "=u") + (unspec:DF [(match_dup 2)] UNSPEC_TAN_TAN))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "fptan" + [(set_attr "type" "fpspc") + (set_attr "mode" "DF")]) + +;; optimize sequence: fptan +;; fstp %st(0) +;; fld1 +;; into fptan insn. + +(define_peephole2 + [(parallel[(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(match_operand:DF 2 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:DF 1 "register_operand" "") + (unspec:DF [(match_dup 2)] UNSPEC_TAN_TAN))]) + (set (match_dup 0) + (match_operand:DF 3 "immediate_operand" ""))] + "standard_80387_constant_p (operands[3]) == 2" + [(parallel[(set (match_dup 0) (unspec:DF [(match_dup 2)] UNSPEC_TAN_ONE)) + (set (match_dup 1) (unspec:DF [(match_dup 2)] UNSPEC_TAN_TAN))])] + "") + +(define_expand "tandf2" + [(parallel [(set (match_dup 2) + (unspec:DF [(match_operand:DF 1 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(match_dup 1)] UNSPEC_TAN_TAN))])] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (DFmode); +}) + +(define_insn "*tansf3_1" + [(set (match_operand:SF 0 "register_operand" "=f") + (unspec:SF [(match_operand:SF 2 "register_operand" "0")] + UNSPEC_TAN_ONE)) + (set (match_operand:SF 1 "register_operand" "=u") + (unspec:SF [(match_dup 2)] UNSPEC_TAN_TAN))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "fptan" + [(set_attr "type" "fpspc") + (set_attr "mode" "SF")]) + +;; optimize sequence: fptan +;; fstp %st(0) +;; fld1 +;; into fptan insn. + +(define_peephole2 + [(parallel[(set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_operand:SF 2 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:SF 1 "register_operand" "") + (unspec:SF [(match_dup 2)] UNSPEC_TAN_TAN))]) + (set (match_dup 0) + (match_operand:SF 3 "immediate_operand" ""))] + "standard_80387_constant_p (operands[3]) == 2" + [(parallel[(set (match_dup 0) (unspec:SF [(match_dup 2)] UNSPEC_TAN_ONE)) + (set (match_dup 1) (unspec:SF [(match_dup 2)] UNSPEC_TAN_TAN))])] + "") + +(define_expand "tansf2" + [(parallel [(set (match_dup 2) + (unspec:SF [(match_operand:SF 1 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_dup 1)] UNSPEC_TAN_TAN))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (SFmode); +}) + +(define_insn "*tanxf3_1" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0")] + UNSPEC_TAN_ONE)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2)] UNSPEC_TAN_TAN))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fptan" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + +;; optimize sequence: fptan +;; fstp %st(0) +;; fld1 +;; into fptan insn. + +(define_peephole2 + [(parallel[(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_operand:XF 2 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:XF 1 "register_operand" "") + (unspec:XF [(match_dup 2)] UNSPEC_TAN_TAN))]) + (set (match_dup 0) + (match_operand:XF 3 "immediate_operand" ""))] + "standard_80387_constant_p (operands[3]) == 2" + [(parallel[(set (match_dup 0) (unspec:XF [(match_dup 2)] UNSPEC_TAN_ONE)) + (set (match_dup 1) (unspec:XF [(match_dup 2)] UNSPEC_TAN_TAN))])] + "") + +(define_expand "tanxf2" + [(parallel [(set (match_dup 2) + (unspec:XF [(match_operand:XF 1 "register_operand" "")] + UNSPEC_TAN_ONE)) + (set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 1)] UNSPEC_TAN_TAN))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); +}) + (define_insn "atan2df3_1" [(set (match_operand:DF 0 "register_operand" "=f") (unspec:DF [(match_operand:DF 2 "register_operand" "0") (match_operand:DF 1 "register_operand" "u")] UNSPEC_FPATAN)) (clobber (match_scratch:DF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fpatan" [(set_attr "type" "fpspc") (set_attr "mode" "DF")]) (define_expand "atan2df3" - [(use (match_operand:DF 0 "register_operand" "=f")) - (use (match_operand:DF 2 "register_operand" "0")) - (use (match_operand:DF 1 "register_operand" "u"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 2 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx copy = gen_reg_rtx (DFmode); @@ -15077,23 +16148,39 @@ DONE; }) +(define_expand "atandf2" + [(parallel [(set (match_operand:DF 0 "register_operand" "") + (unspec:DF [(match_dup 2) + (match_operand:DF 1 "register_operand" "")] + UNSPEC_FPATAN)) + (clobber (match_scratch:DF 3 ""))])] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (DFmode); + emit_move_insn (operands[2], CONST1_RTX (DFmode)); /* fld1 */ +}) + (define_insn "atan2sf3_1" [(set (match_operand:SF 0 "register_operand" "=f") (unspec:SF [(match_operand:SF 2 "register_operand" "0") (match_operand:SF 1 "register_operand" "u")] UNSPEC_FPATAN)) (clobber (match_scratch:SF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" "fpatan" [(set_attr "type" "fpspc") (set_attr "mode" "SF")]) (define_expand "atan2sf3" - [(use (match_operand:SF 0 "register_operand" "=f")) - (use (match_operand:SF 2 "register_operand" "0")) - (use (match_operand:SF 1 "register_operand" "u"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 2 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx copy = gen_reg_rtx (SFmode); @@ -15102,23 +16189,37 @@ DONE; }) +(define_expand "atansf2" + [(parallel [(set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_dup 2) + (match_operand:SF 1 "register_operand" "")] + UNSPEC_FPATAN)) + (clobber (match_scratch:SF 3 ""))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (SFmode); + emit_move_insn (operands[2], CONST1_RTX (SFmode)); /* fld1 */ +}) + (define_insn "atan2xf3_1" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 1 "register_operand" "u")] UNSPEC_FPATAN)) (clobber (match_scratch:XF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "fpatan" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) (define_expand "atan2xf3" - [(use (match_operand:XF 0 "register_operand" "=f")) - (use (match_operand:XF 2 "register_operand" "0")) - (use (match_operand:XF 1 "register_operand" "u"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 2 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" { rtx copy = gen_reg_rtx (XFmode); @@ -15127,70 +16228,213 @@ DONE; }) -(define_insn "*fyl2x_sfxf3" - [(set (match_operand:SF 0 "register_operand" "=f") - (unspec:SF [(match_operand:SF 2 "register_operand" "0") - (match_operand:XF 1 "register_operand" "u")] - UNSPEC_FYL2X)) - (clobber (match_scratch:SF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "atanxf2" + [(parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 2) + (match_operand:XF 1 "register_operand" "")] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 3 ""))])] + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" - "fyl2x" - [(set_attr "type" "fpspc") - (set_attr "mode" "SF")]) +{ + operands[2] = gen_reg_rtx (XFmode); + emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ +}) -(define_insn "*fyl2x_dfxf3" - [(set (match_operand:DF 0 "register_operand" "=f") - (unspec:DF [(match_operand:DF 2 "register_operand" "0") - (match_operand:XF 1 "register_operand" "u")] - UNSPEC_FYL2X)) - (clobber (match_scratch:DF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "asindf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 3) (mult:XF (match_dup 2) (match_dup 2))) + (set (match_dup 5) (minus:XF (match_dup 4) (match_dup 3))) + (set (match_dup 6) (sqrt:XF (match_dup 5))) + (parallel [(set (match_dup 7) + (unspec:XF [(match_dup 6) (match_dup 2)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 8 ""))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 7)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" - "fyl2x" - [(set_attr "type" "fpspc") - (set_attr "mode" "DF")]) +{ + int i; -(define_insn "*fyl2x_xf3" + for (i=2; i<8; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[4], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "asinsf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 3) (mult:XF (match_dup 2) (match_dup 2))) + (set (match_dup 5) (minus:XF (match_dup 4) (match_dup 3))) + (set (match_dup 6) (sqrt:XF (match_dup 5))) + (parallel [(set (match_dup 7) + (unspec:XF [(match_dup 6) (match_dup 2)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 8 ""))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 7)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<8; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[4], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "asinxf2" + [(set (match_dup 2) + (mult:XF (match_operand:XF 1 "register_operand" "") + (match_dup 1))) + (set (match_dup 4) (minus:XF (match_dup 3) (match_dup 2))) + (set (match_dup 5) (sqrt:XF (match_dup 4))) + (parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 5) (match_dup 1)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 6 ""))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<6; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[3], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "acosdf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 3) (mult:XF (match_dup 2) (match_dup 2))) + (set (match_dup 5) (minus:XF (match_dup 4) (match_dup 3))) + (set (match_dup 6) (sqrt:XF (match_dup 5))) + (parallel [(set (match_dup 7) + (unspec:XF [(match_dup 2) (match_dup 6)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 8 ""))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 7)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<8; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[4], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "acossf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 3) (mult:XF (match_dup 2) (match_dup 2))) + (set (match_dup 5) (minus:XF (match_dup 4) (match_dup 3))) + (set (match_dup 6) (sqrt:XF (match_dup 5))) + (parallel [(set (match_dup 7) + (unspec:XF [(match_dup 2) (match_dup 6)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 8 ""))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 7)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<8; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[4], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "acosxf2" + [(set (match_dup 2) + (mult:XF (match_operand:XF 1 "register_operand" "") + (match_dup 1))) + (set (match_dup 4) (minus:XF (match_dup 3) (match_dup 2))) + (set (match_dup 5) (sqrt:XF (match_dup 4))) + (parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 1) (match_dup 5)] + UNSPEC_FPATAN)) + (clobber (match_scratch:XF 6 ""))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<6; i++) + operands[i] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[3], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_insn "fyl2x_xf3" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 1 "register_operand" "u")] UNSPEC_FYL2X)) (clobber (match_scratch:XF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "fyl2x" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) (define_expand "logsf2" - [(parallel [(set (match_operand:SF 0 "register_operand" "") - (unspec:SF [(match_operand:SF 1 "register_operand" "") - (match_dup 2)] UNSPEC_FYL2X)) - (clobber (match_scratch:SF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx temp; operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (4); /* fldln2 */ - emit_move_insn (operands[2], temp); + emit_move_insn (operands[3], temp); }) (define_expand "logdf2" - [(parallel [(set (match_operand:DF 0 "register_operand" "") - (unspec:DF [(match_operand:DF 1 "register_operand" "") - (match_dup 2)] UNSPEC_FYL2X)) - (clobber (match_scratch:DF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx temp; operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (4); /* fldln2 */ - emit_move_insn (operands[2], temp); + emit_move_insn (operands[3], temp); }) (define_expand "logxf2" @@ -15198,7 +16442,7 @@ (unspec:XF [(match_operand:XF 1 "register_operand" "") (match_dup 2)] UNSPEC_FYL2X)) (clobber (match_scratch:XF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" { rtx temp; @@ -15208,62 +16452,274 @@ emit_move_insn (operands[2], temp); }) -(define_insn "*fscale_sfxf3" - [(set (match_operand:SF 0 "register_operand" "=f") - (unspec:SF [(match_operand:XF 2 "register_operand" "0") - (match_operand:XF 1 "register_operand" "u")] - UNSPEC_FSCALE)) - (clobber (match_scratch:SF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "log10sf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" - "fscale\;fstp\t%y1" - [(set_attr "type" "fpspc") - (set_attr "mode" "SF")]) +{ + rtx temp; -(define_insn "*fscale_dfxf3" - [(set (match_operand:DF 0 "register_operand" "=f") - (unspec:DF [(match_operand:XF 2 "register_operand" "0") - (match_operand:XF 1 "register_operand" "u")] - UNSPEC_FSCALE)) - (clobber (match_scratch:DF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + + temp = standard_80387_constant_rtx (3); /* fldlg2 */ + emit_move_insn (operands[3], temp); +}) + +(define_expand "log10df2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" - "fscale\;fstp\t%y1" - [(set_attr "type" "fpspc") - (set_attr "mode" "DF")]) +{ + rtx temp; -(define_insn "*fscale_xf3" + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + + temp = standard_80387_constant_rtx (3); /* fldlg2 */ + emit_move_insn (operands[3], temp); +}) + +(define_expand "log10xf2" + [(parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_operand:XF 1 "register_operand" "") + (match_dup 2)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 3 ""))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + rtx temp; + + operands[2] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (3); /* fldlg2 */ + emit_move_insn (operands[2], temp); +}) + +(define_expand "log2sf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[3], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "log2df2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (parallel [(set (match_dup 4) + (unspec:XF [(match_dup 2) + (match_dup 3)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 5 ""))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); + + emit_move_insn (operands[3], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "log2xf2" + [(parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_operand:XF 1 "register_operand" "") + (match_dup 2)] UNSPEC_FYL2X)) + (clobber (match_scratch:XF 3 ""))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_insn "fyl2xp1_xf3" [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 2 "register_operand" "0") + (unspec:XF [(match_operand:XF 2 "register_operand" "0") (match_operand:XF 1 "register_operand" "u")] - UNSPEC_FSCALE)) + UNSPEC_FYL2XP1)) (clobber (match_scratch:XF 3 "=1"))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" - "fscale\;fstp\t%y1" + "fyl2xp1" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) -(define_insn "*frndintxf2" - [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 1 "register_operand" "0")] - UNSPEC_FRNDINT))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "log1psf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" - "frndint" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + ix86_emit_i387_log1p (op0, op1); + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "log1pdf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + ix86_emit_i387_log1p (op0, op1); + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "log1pxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + ix86_emit_i387_log1p (operands[0], operands[1]); + DONE; +}) + +(define_insn "*fxtractxf3" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0")] + UNSPEC_XTRACT_FRACT)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_EXP))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fxtract" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) +(define_expand "logbsf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (parallel [(set (match_dup 3) + (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_FRACT)) + (set (match_dup 4) + (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_EXP))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); +}) + +(define_expand "logbdf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (parallel [(set (match_dup 3) + (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_FRACT)) + (set (match_dup 4) + (unspec:XF [(match_dup 2)] UNSPEC_XTRACT_EXP))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 4)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); + operands[4] = gen_reg_rtx (XFmode); +}) + +(define_expand "logbxf2" + [(parallel [(set (match_dup 2) + (unspec:XF [(match_operand:XF 1 "register_operand" "")] + UNSPEC_XTRACT_FRACT)) + (set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 1)] UNSPEC_XTRACT_EXP))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); +}) + +(define_expand "ilogbsi2" + [(parallel [(set (match_dup 2) + (unspec:XF [(match_operand:XF 1 "register_operand" "")] + UNSPEC_XTRACT_FRACT)) + (set (match_operand:XF 3 "register_operand" "") + (unspec:XF [(match_dup 1)] UNSPEC_XTRACT_EXP))]) + (parallel [(set (match_operand:SI 0 "register_operand" "") + (fix:SI (match_dup 3))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + operands[2] = gen_reg_rtx (XFmode); + operands[3] = gen_reg_rtx (XFmode); +}) + (define_insn "*f2xm1xf2" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_F2XM1))] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" "f2xm1" [(set_attr "type" "fpspc") (set_attr "mode" "XF")]) +(define_insn "*fscalexf4" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 2 "register_operand" "0") + (match_operand:XF 3 "register_operand" "1")] + UNSPEC_FSCALE_FRACT)) + (set (match_operand:XF 1 "register_operand" "=u") + (unspec:XF [(match_dup 2) (match_dup 3)] + UNSPEC_FSCALE_EXP))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fscale" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + (define_expand "expsf2" [(set (match_dup 2) (float_extend:XF (match_operand:SF 1 "register_operand" ""))) @@ -15272,16 +16728,22 @@ (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) (set (match_dup 9) (plus:XF (match_dup 7) (match_dup 8))) - (parallel [(set (match_operand:SF 0 "register_operand" "") - (unspec:SF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE)) - (clobber (match_scratch:SF 5 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + (parallel [(set (match_dup 10) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 11) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 10)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx temp; int i; - for (i=2; i<10; i++) + for (i=2; i<12; i++) operands[i] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (5); /* fldl2e */ emit_move_insn (operands[3], temp); @@ -15296,16 +16758,22 @@ (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) (set (match_dup 9) (plus:XF (match_dup 7) (match_dup 8))) - (parallel [(set (match_operand:DF 0 "register_operand" "") - (unspec:DF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE)) - (clobber (match_scratch:DF 5 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + (parallel [(set (match_dup 10) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 11) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 10)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { rtx temp; int i; - for (i=2; i<10; i++) + for (i=2; i<12; i++) operands[i] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (5); /* fldl2e */ emit_move_insn (operands[3], temp); @@ -15320,89 +16788,1231 @@ (set (match_dup 6) (unspec:XF [(match_dup 5)] UNSPEC_F2XM1)) (set (match_dup 8) (plus:XF (match_dup 6) (match_dup 7))) (parallel [(set (match_operand:XF 0 "register_operand" "") - (unspec:XF [(match_dup 8) (match_dup 4)] UNSPEC_FSCALE)) - (clobber (match_scratch:XF 5 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 + (unspec:XF [(match_dup 8) (match_dup 4)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 8) (match_dup 4)] + UNSPEC_FSCALE_EXP))])] + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" { rtx temp; int i; - for (i=2; i<9; i++) + for (i=2; i<10; i++) operands[i] = gen_reg_rtx (XFmode); temp = standard_80387_constant_rtx (5); /* fldl2e */ emit_move_insn (operands[2], temp); emit_move_insn (operands[7], CONST1_RTX (XFmode)); /* fld1 */ }) -(define_expand "atansf2" - [(parallel [(set (match_operand:SF 0 "register_operand" "") - (unspec:SF [(match_dup 2) - (match_operand:SF 1 "register_operand" "")] - UNSPEC_FPATAN)) - (clobber (match_scratch:SF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "exp10sf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 4) (mult:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_FRNDINT)) + (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) + (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) + (set (match_dup 9) (plus:XF (match_dup 7) (match_dup 8))) + (parallel [(set (match_dup 10) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 11) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 10)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { - operands[2] = gen_reg_rtx (SFmode); - emit_move_insn (operands[2], CONST1_RTX (SFmode)); /* fld1 */ + rtx temp; + int i; + + for (i=2; i<12; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (6); /* fldl2t */ + emit_move_insn (operands[3], temp); + emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */ }) -(define_expand "atandf2" - [(parallel [(set (match_operand:DF 0 "register_operand" "") - (unspec:DF [(match_dup 2) - (match_operand:DF 1 "register_operand" "")] - UNSPEC_FPATAN)) - (clobber (match_scratch:DF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "exp10df2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 4) (mult:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_FRNDINT)) + (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) + (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) + (set (match_dup 9) (plus:XF (match_dup 7) (match_dup 8))) + (parallel [(set (match_dup 10) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 11) + (unspec:XF [(match_dup 9) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 10)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { - operands[2] = gen_reg_rtx (DFmode); - emit_move_insn (operands[2], CONST1_RTX (DFmode)); /* fld1 */ + rtx temp; + int i; + + for (i=2; i<12; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (6); /* fldl2t */ + emit_move_insn (operands[3], temp); + emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */ }) -(define_expand "atanxf2" - [(parallel [(set (match_operand:XF 0 "register_operand" "") - (unspec:XF [(match_dup 2) - (match_operand:XF 1 "register_operand" "")] - UNSPEC_FPATAN)) - (clobber (match_scratch:XF 3 ""))])] - "! TARGET_NO_FANCY_MATH_387 && TARGET_80387 +(define_expand "exp10xf2" + [(set (match_dup 3) (mult:XF (match_operand:XF 1 "register_operand" "") + (match_dup 2))) + (set (match_dup 4) (unspec:XF [(match_dup 3)] UNSPEC_FRNDINT)) + (set (match_dup 5) (minus:XF (match_dup 3) (match_dup 4))) + (set (match_dup 6) (unspec:XF [(match_dup 5)] UNSPEC_F2XM1)) + (set (match_dup 8) (plus:XF (match_dup 6) (match_dup 7))) + (parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 8) (match_dup 4)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 8) (match_dup 4)] + UNSPEC_FSCALE_EXP))])] + "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" { - operands[2] = gen_reg_rtx (XFmode); - emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */ + rtx temp; + int i; + + for (i=2; i<10; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (6); /* fldl2t */ + emit_move_insn (operands[2], temp); + emit_move_insn (operands[7], CONST1_RTX (XFmode)); /* fld1 */ }) + +(define_expand "exp2sf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 3) (unspec:XF [(match_dup 2)] UNSPEC_FRNDINT)) + (set (match_dup 4) (minus:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_F2XM1)) + (set (match_dup 7) (plus:XF (match_dup 5) (match_dup 6))) + (parallel [(set (match_dup 8) + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 8)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<10; i++) + operands[i] = gen_reg_rtx (XFmode); + emit_move_insn (operands[6], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "exp2df2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 3) (unspec:XF [(match_dup 2)] UNSPEC_FRNDINT)) + (set (match_dup 4) (minus:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_F2XM1)) + (set (match_dup 7) (plus:XF (match_dup 5) (match_dup 6))) + (parallel [(set (match_dup 8) + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 8)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<10; i++) + operands[i] = gen_reg_rtx (XFmode); + emit_move_insn (operands[6], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "exp2xf2" + [(set (match_dup 2) (match_operand:XF 1 "register_operand" "")) + (set (match_dup 3) (unspec:XF [(match_dup 2)] UNSPEC_FRNDINT)) + (set (match_dup 4) (minus:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_F2XM1)) + (set (match_dup 7) (plus:XF (match_dup 5) (match_dup 6))) + (parallel [(set (match_operand:XF 0 "register_operand" "") + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 8) + (unspec:XF [(match_dup 7) (match_dup 3)] + UNSPEC_FSCALE_EXP))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=2; i<9; i++) + operands[i] = gen_reg_rtx (XFmode); + emit_move_insn (operands[6], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "expm1df2" + [(set (match_dup 2) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 4) (mult:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_FRNDINT)) + (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) + (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) + (parallel [(set (match_dup 8) + (unspec:XF [(match_dup 7) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 7) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (parallel [(set (match_dup 11) + (unspec:XF [(match_dup 10) (match_dup 9)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 12) + (unspec:XF [(match_dup 10) (match_dup 9)] + UNSPEC_FSCALE_EXP))]) + (set (match_dup 13) (minus:XF (match_dup 11) (match_dup 10))) + (set (match_dup 14) (plus:XF (match_dup 13) (match_dup 8))) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 14)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx temp; + int i; + + for (i=2; i<15; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (5); /* fldl2e */ + emit_move_insn (operands[3], temp); + emit_move_insn (operands[10], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "expm1sf2" + [(set (match_dup 2) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 4) (mult:XF (match_dup 2) (match_dup 3))) + (set (match_dup 5) (unspec:XF [(match_dup 4)] UNSPEC_FRNDINT)) + (set (match_dup 6) (minus:XF (match_dup 4) (match_dup 5))) + (set (match_dup 7) (unspec:XF [(match_dup 6)] UNSPEC_F2XM1)) + (parallel [(set (match_dup 8) + (unspec:XF [(match_dup 7) (match_dup 5)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 9) + (unspec:XF [(match_dup 7) (match_dup 5)] + UNSPEC_FSCALE_EXP))]) + (parallel [(set (match_dup 11) + (unspec:XF [(match_dup 10) (match_dup 9)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 12) + (unspec:XF [(match_dup 10) (match_dup 9)] + UNSPEC_FSCALE_EXP))]) + (set (match_dup 13) (minus:XF (match_dup 11) (match_dup 10))) + (set (match_dup 14) (plus:XF (match_dup 13) (match_dup 8))) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 14)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx temp; + int i; + + for (i=2; i<15; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (5); /* fldl2e */ + emit_move_insn (operands[3], temp); + emit_move_insn (operands[10], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "expm1xf2" + [(set (match_dup 3) (mult:XF (match_operand:XF 1 "register_operand" "") + (match_dup 2))) + (set (match_dup 4) (unspec:XF [(match_dup 3)] UNSPEC_FRNDINT)) + (set (match_dup 5) (minus:XF (match_dup 3) (match_dup 4))) + (set (match_dup 6) (unspec:XF [(match_dup 5)] UNSPEC_F2XM1)) + (parallel [(set (match_dup 7) + (unspec:XF [(match_dup 6) (match_dup 4)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 8) + (unspec:XF [(match_dup 6) (match_dup 4)] + UNSPEC_FSCALE_EXP))]) + (parallel [(set (match_dup 10) + (unspec:XF [(match_dup 9) (match_dup 8)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 11) + (unspec:XF [(match_dup 9) (match_dup 8)] + UNSPEC_FSCALE_EXP))]) + (set (match_dup 12) (minus:XF (match_dup 10) (match_dup 9))) + (set (match_operand:XF 0 "register_operand" "") + (plus:XF (match_dup 12) (match_dup 7)))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + rtx temp; + int i; + + for (i=2; i<13; i++) + operands[i] = gen_reg_rtx (XFmode); + temp = standard_80387_constant_rtx (5); /* fldl2e */ + emit_move_insn (operands[2], temp); + emit_move_insn (operands[9], CONST1_RTX (XFmode)); /* fld1 */ +}) + +(define_expand "ldexpdf3" + [(set (match_dup 3) + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (set (match_dup 4) + (float:XF (match_operand:SI 2 "register_operand" ""))) + (parallel [(set (match_dup 5) + (unspec:XF [(match_dup 3) (match_dup 4)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 6) + (unspec:XF [(match_dup 3) (match_dup 4)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_dup 5)))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=3; i<7; i++) + operands[i] = gen_reg_rtx (XFmode); +}) + +(define_expand "ldexpsf3" + [(set (match_dup 3) + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (set (match_dup 4) + (float:XF (match_operand:SI 2 "register_operand" ""))) + (parallel [(set (match_dup 5) + (unspec:XF [(match_dup 3) (match_dup 4)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 6) + (unspec:XF [(match_dup 3) (match_dup 4)] + UNSPEC_FSCALE_EXP))]) + (set (match_operand:SF 0 "register_operand" "") + (float_truncate:SF (match_dup 5)))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=3; i<7; i++) + operands[i] = gen_reg_rtx (XFmode); +}) + +(define_expand "ldexpxf3" + [(set (match_dup 3) + (float:XF (match_operand:SI 2 "register_operand" ""))) + (parallel [(set (match_operand:XF 0 " register_operand" "") + (unspec:XF [(match_operand:XF 1 "register_operand" "") + (match_dup 3)] + UNSPEC_FSCALE_FRACT)) + (set (match_dup 4) + (unspec:XF [(match_dup 1) (match_dup 3)] + UNSPEC_FSCALE_EXP))])] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + int i; + + for (i=3; i<5; i++) + operands[i] = gen_reg_rtx (XFmode); +}) + + +(define_insn "frndintxf2" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "frndint" + [(set_attr "type" "fpspc") + (set_attr "mode" "XF")]) + +(define_expand "rintdf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2 (op0, op1)); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "rintsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2 (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "rintxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2 (operands[0], operands[1])); + DONE; +}) + +(define_insn_and_split "*fistdi2_1" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fistdi2 (operands[0], operands[1])); + else + { + operands[2] = assign_386_stack_local (DImode, SLOT_TEMP); + emit_insn (gen_fistdi2_with_temp (operands[0], operands[1], + operands[2])); + } + DONE; +} + [(set_attr "type" "fpspc") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST)) + (clobber (match_scratch:XF 2 "=&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fpspc") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 3 "=&1f,&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fpspc") + (set_attr "mode" "DI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 2) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) + (clobber (match_dup 3))]) + (set (match_dup 0) (match_dup 2))] + "") + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) + (clobber (match_dup 3))])] + "") + +(define_insn_and_split "*fist2_1" + [(set (match_operand:X87MODEI12 0 "register_operand" "=r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + operands[2] = assign_386_stack_local (mode, SLOT_TEMP); + emit_insn (gen_fist2_with_temp (operands[0], operands[1], + operands[2])); + DONE; +} + [(set_attr "type" "fpspc") + (set_attr "mode" "")]) + +(define_insn "fist2" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fpspc") + (set_attr "mode" "")]) + +(define_insn "fist2_with_temp" + [(set (match_operand:X87MODEI12 0 "register_operand" "=r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST)) + (clobber (match_operand:X87MODEI12 2 "memory_operand" "=m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fpspc") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:X87MODEI12 2 "memory_operand" ""))] + "reload_completed" + [(set (match_dup 2) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST)) + (set (match_dup 0) (match_dup 2))] + "") + +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:X87MODEI12 2 "memory_operand" ""))] + "reload_completed" + [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST))] + "") + +(define_expand "lrint2" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "") + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_floor" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_FLOOR)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_FLOOR] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_FLOOR); + + emit_insn (gen_frndintxf2_floor_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "floor") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_floor_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "floor") + (set_attr "mode" "XF")]) + +(define_expand "floorxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_floor (operands[0], operands[1])); + DONE; +}) + +(define_expand "floordf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_floor (op0, op1)); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "floorsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_floor (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_insn_and_split "*fist2_floor_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_FLOOR] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_FLOOR); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fist2_floor (operands[0], operands[1], + operands[2], operands[3])); + else + { + operands[4] = assign_386_stack_local (mode, SLOT_TEMP); + emit_insn (gen_fist2_floor_with_temp (operands[0], operands[1], + operands[2], operands[3], + operands[4])); + } + DONE; +} + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_insn "fistdi2_floor" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m")) + (clobber (match_scratch:XF 4 "=&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2_floor_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:DI 4 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 5 "=&1f,&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "DI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:DI [(match_dup 1)] UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))])] + "") + +(define_insn "fist2_floor" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_insn "fist2_floor_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3))])] + "") + +(define_expand "lfloor2" + [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "") + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_ceil" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_CEIL)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_CEIL] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_CEIL); + + emit_insn (gen_frndintxf2_ceil_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_ceil_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "XF")]) + +(define_expand "ceilxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_ceil (operands[0], operands[1])); + DONE; +}) + +(define_expand "ceildf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_ceil (op0, op1)); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "ceilsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_ceil (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_insn_and_split "*fist2_ceil_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_CEIL] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_CEIL); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fist2_ceil (operands[0], operands[1], + operands[2], operands[3])); + else + { + operands[4] = assign_386_stack_local (mode, SLOT_TEMP); + emit_insn (gen_fist2_ceil_with_temp (operands[0], operands[1], + operands[2], operands[3], + operands[4])); + } + DONE; +} + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_insn "fistdi2_ceil" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m")) + (clobber (match_scratch:XF 4 "=&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2_ceil_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:DI 4 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 5 "=&1f,&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "DI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:DI [(match_dup 1)] UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))])] + "") + +(define_insn "fist2_ceil" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_insn "fist2_ceil_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3))])] + "") + +(define_expand "lceil2" + [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "") + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_trunc" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_TRUNC)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_TRUNC] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_TRUNC); + + emit_insn (gen_frndintxf2_trunc_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "trunc") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_trunc_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_TRUNC)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "trunc") + (set_attr "mode" "XF")]) + +(define_expand "btruncxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_trunc (operands[0], operands[1])); + DONE; +}) + +(define_expand "btruncdf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_trunc (op0, op1)); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "btruncsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_trunc (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_mask_pm" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_MASK_PM)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching[I387_MASK_PM] = 1; + + operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); + operands[3] = assign_386_stack_local (HImode, SLOT_CW_MASK_PM); + + emit_insn (gen_frndintxf2_mask_pm_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "mask_pm") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_mask_pm_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_MASK_PM)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfclex\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "mask_pm") + (set_attr "mode" "XF")]) + +(define_expand "nearbyintxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_mask_pm (operands[0], operands[1])); + + DONE; +}) + +(define_expand "nearbyintdf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_mask_pm (op0, op1)); + + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_expand "nearbyintsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_mask_pm (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + ;; Block operation instructions (define_insn "cld" - [(set (reg:SI 19) (const_int 0))] + [(set (reg:SI DIRFLAG_REG) (const_int 0))] "" "cld" [(set_attr "type" "cld")]) -(define_expand "movstrsi" +(define_expand "movmemsi" [(use (match_operand:BLK 0 "memory_operand" "")) (use (match_operand:BLK 1 "memory_operand" "")) (use (match_operand:SI 2 "nonmemory_operand" "")) (use (match_operand:SI 3 "const_int_operand" ""))] - "! optimize_size" + "! optimize_size || TARGET_INLINE_ALL_STRINGOPS" { - if (ix86_expand_movstr (operands[0], operands[1], operands[2], operands[3])) + if (ix86_expand_movmem (operands[0], operands[1], operands[2], operands[3])) DONE; else FAIL; }) -(define_expand "movstrdi" +(define_expand "movmemdi" [(use (match_operand:BLK 0 "memory_operand" "")) (use (match_operand:BLK 1 "memory_operand" "")) (use (match_operand:DI 2 "nonmemory_operand" "")) (use (match_operand:DI 3 "const_int_operand" ""))] "TARGET_64BIT" { - if (ix86_expand_movstr (operands[0], operands[1], operands[2], operands[3])) + if (ix86_expand_movmem (operands[0], operands[1], operands[2], operands[3])) DONE; else FAIL; @@ -15415,9 +18025,9 @@ [(set (match_dup 4) (match_operand 3 "memory_operand" "")) (set (match_operand 1 "memory_operand" "") (match_dup 4)) (parallel [(set (match_operand 0 "register_operand" "") (match_dup 5)) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_operand 2 "register_operand" "") (match_dup 6)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" { rtx adjust = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[1]))); @@ -15445,7 +18055,7 @@ (match_operand 4 "" "")) (set (match_operand 2 "register_operand" "") (match_operand 5 "" "")) - (use (reg:SI 19))])] + (use (reg:SI DIRFLAG_REG))])] "TARGET_SINGLE_STRINGOP || optimize_size" "") @@ -15458,7 +18068,7 @@ (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (match_dup 3) (const_int 8))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "movsq" [(set_attr "type" "str") @@ -15474,7 +18084,7 @@ (set (match_operand:SI 1 "register_operand" "=S") (plus:SI (match_dup 3) (const_int 4))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "{movsl|movsd}" [(set_attr "type" "str") @@ -15490,7 +18100,7 @@ (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (match_dup 3) (const_int 4))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "{movsl|movsd}" [(set_attr "type" "str") @@ -15506,7 +18116,7 @@ (set (match_operand:SI 1 "register_operand" "=S") (plus:SI (match_dup 3) (const_int 2))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "movsw" [(set_attr "type" "str") @@ -15522,7 +18132,7 @@ (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (match_dup 3) (const_int 2))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "movsw" [(set_attr "type" "str") @@ -15538,7 +18148,7 @@ (set (match_operand:SI 1 "register_operand" "=S") (plus:SI (match_dup 3) (const_int 1))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "movsb" [(set_attr "type" "str") @@ -15554,7 +18164,7 @@ (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (match_dup 3) (const_int 1))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "movsb" [(set_attr "type" "str") @@ -15570,7 +18180,7 @@ (set (match_operand 1 "memory_operand" "") (match_operand 3 "memory_operand" "")) (use (match_dup 4)) - (use (reg:SI 19))])] + (use (reg:SI DIRFLAG_REG))])] "" "") @@ -15586,7 +18196,7 @@ (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) (use (match_dup 5)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;movsq|rep movsq}" [(set_attr "type" "str") @@ -15606,7 +18216,7 @@ (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) (use (match_dup 5)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT" "{rep\;movsl|rep movsd}" [(set_attr "type" "str") @@ -15626,7 +18236,7 @@ (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) (use (match_dup 5)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;movsl|rep movsd}" [(set_attr "type" "str") @@ -15644,7 +18254,7 @@ (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) (use (match_dup 5)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT" "{rep\;movsb|rep movsb}" [(set_attr "type" "str") @@ -15662,7 +18272,7 @@ (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) (use (match_dup 5)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;movsb|rep movsb}" [(set_attr "type" "str") @@ -15670,25 +18280,35 @@ (set_attr "memory" "both") (set_attr "mode" "SI")]) -(define_expand "clrstrsi" +(define_expand "setmemsi" [(use (match_operand:BLK 0 "memory_operand" "")) (use (match_operand:SI 1 "nonmemory_operand" "")) - (use (match_operand 2 "const_int_operand" ""))] + (use (match_operand 2 "const_int_operand" "")) + (use (match_operand 3 "const_int_operand" ""))] "" { - if (ix86_expand_clrstr (operands[0], operands[1], operands[2])) + /* If value to set is not zero, use the library routine. */ + if (operands[2] != const0_rtx) + FAIL; + + if (ix86_expand_clrmem (operands[0], operands[1], operands[3])) DONE; else FAIL; }) -(define_expand "clrstrdi" +(define_expand "setmemdi" [(use (match_operand:BLK 0 "memory_operand" "")) (use (match_operand:DI 1 "nonmemory_operand" "")) - (use (match_operand 2 "const_int_operand" ""))] + (use (match_operand 2 "const_int_operand" "")) + (use (match_operand 3 "const_int_operand" ""))] "TARGET_64BIT" { - if (ix86_expand_clrstr (operands[0], operands[1], operands[2])) + /* If value to set is not zero, use the library routine. */ + if (operands[2] != const0_rtx) + FAIL; + + if (ix86_expand_clrmem (operands[0], operands[1], operands[3])) DONE; else FAIL; @@ -15702,7 +18322,7 @@ (match_operand 2 "register_operand" "")) (parallel [(set (match_operand 0 "register_operand" "") (match_dup 3)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" { if (GET_MODE (operands[1]) != GET_MODE (operands[2])) @@ -15726,17 +18346,17 @@ (match_operand 2 "register_operand" "")) (set (match_operand 0 "register_operand" "") (match_operand 3 "" "")) - (use (reg:SI 19))])] + (use (reg:SI DIRFLAG_REG))])] "TARGET_SINGLE_STRINGOP || optimize_size" "") (define_insn "*strsetdi_rex_1" - [(set (mem:SI (match_operand:DI 1 "register_operand" "0")) - (match_operand:SI 2 "register_operand" "a")) + [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) + (match_operand:DI 2 "register_operand" "a")) (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_dup 1) (const_int 8))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "stosq" [(set_attr "type" "str") @@ -15749,7 +18369,7 @@ (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (match_dup 1) (const_int 4))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "{stosl|stosd}" [(set_attr "type" "str") @@ -15762,7 +18382,7 @@ (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_dup 1) (const_int 4))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "{stosl|stosd}" [(set_attr "type" "str") @@ -15775,7 +18395,7 @@ (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (match_dup 1) (const_int 2))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "stosw" [(set_attr "type" "str") @@ -15788,7 +18408,7 @@ (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_dup 1) (const_int 2))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "stosw" [(set_attr "type" "str") @@ -15801,7 +18421,7 @@ (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (match_dup 1) (const_int 1))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "stosb" [(set_attr "type" "str") @@ -15814,7 +18434,7 @@ (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_dup 1) (const_int 1))) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)" "stosb" [(set_attr "type" "str") @@ -15828,7 +18448,7 @@ (set (match_operand 2 "memory_operand" "") (const_int 0)) (use (match_operand 3 "register_operand" "")) (use (match_dup 1)) - (use (reg:SI 19))])] + (use (reg:SI DIRFLAG_REG))])] "" "") @@ -15842,7 +18462,7 @@ (const_int 0)) (use (match_operand:DI 2 "register_operand" "a")) (use (match_dup 4)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;stosq|rep stosq}" [(set_attr "type" "str") @@ -15860,7 +18480,7 @@ (const_int 0)) (use (match_operand:SI 2 "register_operand" "a")) (use (match_dup 4)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT" "{rep\;stosl|rep stosd}" [(set_attr "type" "str") @@ -15878,7 +18498,7 @@ (const_int 0)) (use (match_operand:SI 2 "register_operand" "a")) (use (match_dup 4)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;stosl|rep stosd}" [(set_attr "type" "str") @@ -15895,7 +18515,7 @@ (const_int 0)) (use (match_operand:QI 2 "register_operand" "a")) (use (match_dup 4)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "!TARGET_64BIT" "{rep\;stosb|rep stosb}" [(set_attr "type" "str") @@ -15912,7 +18532,7 @@ (const_int 0)) (use (match_operand:QI 2 "register_operand" "a")) (use (match_dup 4)) - (use (reg:SI 19))] + (use (reg:SI DIRFLAG_REG))] "TARGET_64BIT" "{rep\;stosb|rep stosb}" [(set_attr "type" "str") @@ -15920,7 +18540,7 @@ (set_attr "memory" "store") (set_attr "mode" "QI")]) -(define_expand "cmpstrsi" +(define_expand "cmpstrnsi" [(set (match_operand:SI 0 "register_operand" "") (compare:SI (match_operand:BLK 1 "general_operand" "") (match_operand:BLK 2 "general_operand" ""))) @@ -15961,8 +18581,8 @@ emit_move_insn (operands[0], const0_rtx); DONE; } - emit_insn (gen_cmpstrqi_nz_1 (addr1, addr2, countreg, align, - operands[1], operands[2])); + emit_insn (gen_cmpstrnqi_nz_1 (addr1, addr2, countreg, align, + operands[1], operands[2])); } else { @@ -15970,8 +18590,8 @@ emit_insn (gen_cmpdi_1_rex64 (countreg, countreg)); else emit_insn (gen_cmpsi_1 (countreg, countreg)); - emit_insn (gen_cmpstrqi_1 (addr1, addr2, countreg, align, - operands[1], operands[2])); + emit_insn (gen_cmpstrnqi_1 (addr1, addr2, countreg, align, + operands[1], operands[2])); } outlow = gen_lowpart (QImode, out); @@ -15988,13 +18608,13 @@ (define_expand "cmpintqi" [(set (match_dup 1) - (gtu:QI (reg:CC 17) (const_int 0))) + (gtu:QI (reg:CC FLAGS_REG) (const_int 0))) (set (match_dup 2) - (ltu:QI (reg:CC 17) (const_int 0))) + (ltu:QI (reg:CC FLAGS_REG) (const_int 0))) (parallel [(set (match_operand:QI 0 "register_operand" "") (minus:QI (match_dup 1) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "operands[1] = gen_reg_rtx (QImode); operands[2] = gen_reg_rtx (QImode);") @@ -16002,26 +18622,26 @@ ;; memcmp recognizers. The `cmpsb' opcode does nothing if the count is ;; zero. Emit extra code to make sure that a zero-length compare is EQ. -(define_expand "cmpstrqi_nz_1" - [(parallel [(set (reg:CC 17) +(define_expand "cmpstrnqi_nz_1" + [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_operand 4 "memory_operand" "") (match_operand 5 "memory_operand" ""))) (use (match_operand 2 "register_operand" "")) (use (match_operand:SI 3 "immediate_operand" "")) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand 0 "register_operand" "")) (clobber (match_operand 1 "register_operand" "")) (clobber (match_dup 2))])] "" "") -(define_insn "*cmpstrqi_nz_1" - [(set (reg:CC 17) +(define_insn "*cmpstrnqi_nz_1" + [(set (reg:CC FLAGS_REG) (compare:CC (mem:BLK (match_operand:SI 4 "register_operand" "0")) (mem:BLK (match_operand:SI 5 "register_operand" "1")))) (use (match_operand:SI 6 "register_operand" "2")) (use (match_operand:SI 3 "immediate_operand" "i")) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:SI 0 "register_operand" "=S")) (clobber (match_operand:SI 1 "register_operand" "=D")) (clobber (match_operand:SI 2 "register_operand" "=c"))] @@ -16031,13 +18651,13 @@ (set_attr "mode" "QI") (set_attr "prefix_rep" "1")]) -(define_insn "*cmpstrqi_nz_rex_1" - [(set (reg:CC 17) +(define_insn "*cmpstrnqi_nz_rex_1" + [(set (reg:CC FLAGS_REG) (compare:CC (mem:BLK (match_operand:DI 4 "register_operand" "0")) (mem:BLK (match_operand:DI 5 "register_operand" "1")))) (use (match_operand:DI 6 "register_operand" "2")) (use (match_operand:SI 3 "immediate_operand" "i")) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:DI 0 "register_operand" "=S")) (clobber (match_operand:DI 1 "register_operand" "=D")) (clobber (match_operand:DI 2 "register_operand" "=c"))] @@ -16049,32 +18669,32 @@ ;; The same, but the count is not known to not be zero. -(define_expand "cmpstrqi_1" - [(parallel [(set (reg:CC 17) +(define_expand "cmpstrnqi_1" + [(parallel [(set (reg:CC FLAGS_REG) (if_then_else:CC (ne (match_operand 2 "register_operand" "") (const_int 0)) (compare:CC (match_operand 4 "memory_operand" "") (match_operand 5 "memory_operand" "")) (const_int 0))) (use (match_operand:SI 3 "immediate_operand" "")) - (use (reg:CC 17)) - (use (reg:SI 19)) + (use (reg:CC FLAGS_REG)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand 0 "register_operand" "")) (clobber (match_operand 1 "register_operand" "")) (clobber (match_dup 2))])] "" "") -(define_insn "*cmpstrqi_1" - [(set (reg:CC 17) +(define_insn "*cmpstrnqi_1" + [(set (reg:CC FLAGS_REG) (if_then_else:CC (ne (match_operand:SI 6 "register_operand" "2") (const_int 0)) (compare:CC (mem:BLK (match_operand:SI 4 "register_operand" "0")) (mem:BLK (match_operand:SI 5 "register_operand" "1"))) (const_int 0))) (use (match_operand:SI 3 "immediate_operand" "i")) - (use (reg:CC 17)) - (use (reg:SI 19)) + (use (reg:CC FLAGS_REG)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:SI 0 "register_operand" "=S")) (clobber (match_operand:SI 1 "register_operand" "=D")) (clobber (match_operand:SI 2 "register_operand" "=c"))] @@ -16084,16 +18704,16 @@ (set_attr "mode" "QI") (set_attr "prefix_rep" "1")]) -(define_insn "*cmpstrqi_rex_1" - [(set (reg:CC 17) +(define_insn "*cmpstrnqi_rex_1" + [(set (reg:CC FLAGS_REG) (if_then_else:CC (ne (match_operand:DI 6 "register_operand" "2") (const_int 0)) (compare:CC (mem:BLK (match_operand:DI 4 "register_operand" "0")) (mem:BLK (match_operand:DI 5 "register_operand" "1"))) (const_int 0))) (use (match_operand:SI 3 "immediate_operand" "i")) - (use (reg:CC 17)) - (use (reg:SI 19)) + (use (reg:CC FLAGS_REG)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:DI 0 "register_operand" "=S")) (clobber (match_operand:DI 1 "register_operand" "=D")) (clobber (match_operand:DI 2 "register_operand" "=c"))] @@ -16131,9 +18751,9 @@ (define_expand "strlenqi_1" [(parallel [(set (match_operand 0 "register_operand" "") (match_operand 2 "" "")) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand 1 "register_operand" "")) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") @@ -16143,9 +18763,9 @@ (match_operand:QI 2 "register_operand" "a") (match_operand:SI 3 "immediate_operand" "i") (match_operand:SI 4 "register_operand" "0")] UNSPEC_SCAS)) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:SI 1 "register_operand" "=D")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "repnz{\;| }scasb" [(set_attr "type" "str") @@ -16158,18 +18778,18 @@ (match_operand:QI 2 "register_operand" "a") (match_operand:DI 3 "immediate_operand" "i") (match_operand:DI 4 "register_operand" "0")] UNSPEC_SCAS)) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand:DI 1 "register_operand" "=D")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "repnz{\;| }scasb" [(set_attr "type" "str") (set_attr "mode" "QI") (set_attr "prefix_rep" "1")]) -;; Peephole optimizations to clean up after cmpstr*. This should be +;; Peephole optimizations to clean up after cmpstrn*. This should be ;; handled in combine, but it is not currently up to the task. -;; When used for their truth value, the cmpstr* expanders generate +;; When used for their truth value, the cmpstrn* expanders generate ;; code like this: ;; ;; repz cmpsb @@ -16180,71 +18800,71 @@ ;; ;; The intermediate three instructions are unnecessary. -;; This one handles cmpstr*_nz_1... +;; This one handles cmpstrn*_nz_1... (define_peephole2 [(parallel[ - (set (reg:CC 17) + (set (reg:CC FLAGS_REG) (compare:CC (mem:BLK (match_operand 4 "register_operand" "")) (mem:BLK (match_operand 5 "register_operand" "")))) (use (match_operand 6 "register_operand" "")) (use (match_operand:SI 3 "immediate_operand" "")) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand 0 "register_operand" "")) (clobber (match_operand 1 "register_operand" "")) (clobber (match_operand 2 "register_operand" ""))]) (set (match_operand:QI 7 "register_operand" "") - (gtu:QI (reg:CC 17) (const_int 0))) + (gtu:QI (reg:CC FLAGS_REG) (const_int 0))) (set (match_operand:QI 8 "register_operand" "") - (ltu:QI (reg:CC 17) (const_int 0))) - (set (reg 17) + (ltu:QI (reg:CC FLAGS_REG) (const_int 0))) + (set (reg FLAGS_REG) (compare (match_dup 7) (match_dup 8))) ] "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])" [(parallel[ - (set (reg:CC 17) + (set (reg:CC FLAGS_REG) (compare:CC (mem:BLK (match_dup 4)) (mem:BLK (match_dup 5)))) (use (match_dup 6)) (use (match_dup 3)) - (use (reg:SI 19)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_dup 0)) (clobber (match_dup 1)) (clobber (match_dup 2))])] "") -;; ...and this one handles cmpstr*_1. +;; ...and this one handles cmpstrn*_1. (define_peephole2 [(parallel[ - (set (reg:CC 17) + (set (reg:CC FLAGS_REG) (if_then_else:CC (ne (match_operand 6 "register_operand" "") (const_int 0)) (compare:CC (mem:BLK (match_operand 4 "register_operand" "")) (mem:BLK (match_operand 5 "register_operand" ""))) (const_int 0))) (use (match_operand:SI 3 "immediate_operand" "")) - (use (reg:CC 17)) - (use (reg:SI 19)) + (use (reg:CC FLAGS_REG)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_operand 0 "register_operand" "")) (clobber (match_operand 1 "register_operand" "")) (clobber (match_operand 2 "register_operand" ""))]) (set (match_operand:QI 7 "register_operand" "") - (gtu:QI (reg:CC 17) (const_int 0))) + (gtu:QI (reg:CC FLAGS_REG) (const_int 0))) (set (match_operand:QI 8 "register_operand" "") - (ltu:QI (reg:CC 17) (const_int 0))) - (set (reg 17) + (ltu:QI (reg:CC FLAGS_REG) (const_int 0))) + (set (reg FLAGS_REG) (compare (match_dup 7) (match_dup 8))) ] "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])" [(parallel[ - (set (reg:CC 17) + (set (reg:CC FLAGS_REG) (if_then_else:CC (ne (match_dup 6) (const_int 0)) (compare:CC (mem:BLK (match_dup 4)) (mem:BLK (match_dup 5))) (const_int 0))) (use (match_dup 3)) - (use (reg:CC 17)) - (use (reg:SI 19)) + (use (reg:CC FLAGS_REG)) + (use (reg:SI DIRFLAG_REG)) (clobber (match_dup 0)) (clobber (match_dup 1)) (clobber (match_dup 2))])] @@ -16267,7 +18887,7 @@ (if_then_else:DI (match_operand 1 "ix86_carry_flag_operator" "") (const_int -1) (const_int 0))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT" "sbb{q}\t%0, %0" ; Since we don't have the proper number of operands for an alu insn, @@ -16279,10 +18899,10 @@ (set_attr "mode" "DI") (set_attr "length_immediate" "0")]) -(define_insn "movdicc_c_rex64" +(define_insn "*movdicc_c_rex64" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (match_operand:DI 2 "nonimmediate_operand" "rm,0") (match_operand:DI 3 "nonimmediate_operand" "0,rm")))] "TARGET_64BIT && TARGET_CMOVE @@ -16310,7 +18930,7 @@ (if_then_else:SI (match_operand 1 "ix86_carry_flag_operator" "") (const_int -1) (const_int 0))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "" "sbb{l}\t%0, %0" ; Since we don't have the proper number of operands for an alu insn, @@ -16325,7 +18945,7 @@ (define_insn "*movsicc_noc" [(set (match_operand:SI 0 "register_operand" "=r,r") (if_then_else:SI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (match_operand:SI 2 "nonimmediate_operand" "rm,0") (match_operand:SI 3 "nonimmediate_operand" "0,rm")))] "TARGET_CMOVE @@ -16347,7 +18967,7 @@ (define_insn "*movhicc_noc" [(set (match_operand:HI 0 "register_operand" "=r,r") (if_then_else:HI (match_operator 1 "ix86_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (match_operand:HI 2 "nonimmediate_operand" "rm,0") (match_operand:HI 3 "nonimmediate_operand" "0,rm")))] "TARGET_CMOVE @@ -16369,7 +18989,8 @@ (define_insn_and_split "*movqicc_noc" [(set (match_operand:QI 0 "register_operand" "=r,r") (if_then_else:QI (match_operator 1 "ix86_comparison_operator" - [(match_operand 4 "flags_reg_operand" "") (const_int 0)]) + [(match_operand 4 "flags_reg_operand" "") + (const_int 0)]) (match_operand:QI 2 "register_operand" "r,0") (match_operand:QI 3 "register_operand" "0,r")))] "TARGET_CMOVE && !TARGET_PARTIAL_REG_STALL" @@ -16390,16 +19011,16 @@ (if_then_else:SF (match_operand 1 "comparison_operator" "") (match_operand:SF 2 "register_operand" "") (match_operand:SF 3 "register_operand" "")))] - "TARGET_CMOVE" + "(TARGET_80387 && TARGET_CMOVE) || TARGET_SSE_MATH" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") -(define_insn "*movsfcc_1" - [(set (match_operand:SF 0 "register_operand" "=f#r,f#r,r#f,r#f") +(define_insn "*movsfcc_1_387" + [(set (match_operand:SF 0 "register_operand" "=f,f,r,r") (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" - [(reg 17) (const_int 0)]) - (match_operand:SF 2 "nonimmediate_operand" "f#r,0,rm#f,0") - (match_operand:SF 3 "nonimmediate_operand" "0,f#r,0,rm#f")))] - "TARGET_CMOVE + [(reg FLAGS_REG) (const_int 0)]) + (match_operand:SF 2 "nonimmediate_operand" "f,0,rm,0") + (match_operand:SF 3 "nonimmediate_operand" "0,f,0,rm")))] + "TARGET_80387 && TARGET_CMOVE && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" "@ fcmov%F1\t{%2, %0|%0, %2} @@ -16414,16 +19035,16 @@ (if_then_else:DF (match_operand 1 "comparison_operator" "") (match_operand:DF 2 "register_operand" "") (match_operand:DF 3 "register_operand" "")))] - "TARGET_CMOVE" + "(TARGET_80387 && TARGET_CMOVE) || (TARGET_SSE2 && TARGET_SSE_MATH)" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") (define_insn "*movdfcc_1" - [(set (match_operand:DF 0 "register_operand" "=f#r,f#r,&r#f,&r#f") + [(set (match_operand:DF 0 "register_operand" "=f,f,&r,&r") (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" - [(reg 17) (const_int 0)]) - (match_operand:DF 2 "nonimmediate_operand" "f#r,0,rm#f,0") - (match_operand:DF 3 "nonimmediate_operand" "0,f#r,0,rm#f")))] - "!TARGET_64BIT && TARGET_CMOVE + [(reg FLAGS_REG) (const_int 0)]) + (match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0") + (match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))] + "!TARGET_64BIT && TARGET_80387 && TARGET_CMOVE && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" "@ fcmov%F1\t{%2, %0|%0, %2} @@ -16434,12 +19055,12 @@ (set_attr "mode" "DF")]) (define_insn "*movdfcc_1_rex64" - [(set (match_operand:DF 0 "register_operand" "=f#r,f#r,r#f,r#f") + [(set (match_operand:DF 0 "register_operand" "=f,f,r,r") (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" - [(reg 17) (const_int 0)]) - (match_operand:DF 2 "nonimmediate_operand" "f#r,0#r,rm#f,0#f") - (match_operand:DF 3 "nonimmediate_operand" "0#r,f#r,0#f,rm#f")))] - "TARGET_64BIT && TARGET_CMOVE + [(reg FLAGS_REG) (const_int 0)]) + (match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0") + (match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))] + "TARGET_64BIT && TARGET_80387 && TARGET_CMOVE && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" "@ fcmov%F1\t{%2, %0|%0, %2} @@ -16452,7 +19073,8 @@ (define_split [(set (match_operand:DF 0 "register_and_not_any_fp_reg_operand" "") (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" - [(match_operand 4 "flags_reg_operand" "") (const_int 0)]) + [(match_operand 4 "flags_reg_operand" "") + (const_int 0)]) (match_operand:DF 2 "nonimmediate_operand" "") (match_operand:DF 3 "nonimmediate_operand" "")))] "!TARGET_64BIT && reload_completed" @@ -16473,71 +19095,134 @@ (if_then_else:XF (match_operand 1 "comparison_operator" "") (match_operand:XF 2 "register_operand" "") (match_operand:XF 3 "register_operand" "")))] - "TARGET_CMOVE" + "TARGET_80387 && TARGET_CMOVE" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") (define_insn "*movxfcc_1" [(set (match_operand:XF 0 "register_operand" "=f,f") (if_then_else:XF (match_operator 1 "fcmov_comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (match_operand:XF 2 "register_operand" "f,0") (match_operand:XF 3 "register_operand" "0,f")))] - "TARGET_CMOVE" + "TARGET_80387 && TARGET_CMOVE" "@ fcmov%F1\t{%2, %0|%0, %2} fcmov%f1\t{%3, %0|%0, %3}" [(set_attr "type" "fcmov") (set_attr "mode" "XF")]) -(define_expand "minsf3" - [(parallel [ - (set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (lt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "nonimmediate_operand" "")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))])] - "TARGET_SSE" - "") +;; These versions of the min/max patterns are intentionally ignorant of +;; their behavior wrt -0.0 and NaN (via the commutative operand mark). +;; Since both the tree-level MAX_EXPR and the rtl-level SMAX operator +;; are undefined in this condition, we're certain this is correct. -(define_insn "*minsf" - [(set (match_operand:SF 0 "register_operand" "=x#f,f#x,f#x") - (if_then_else:SF (lt (match_operand:SF 1 "register_operand" "0,0,f#x") - (match_operand:SF 2 "nonimmediate_operand" "xm#f,f#x,0")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE && TARGET_IEEE_FP" - "#") +(define_insn "sminsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (smin:SF (match_operand:SF 1 "nonimmediate_operand" "%0") + (match_operand:SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE_MATH" + "minss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) -(define_insn "*minsf_nonieee" - [(set (match_operand:SF 0 "register_operand" "=x#f,f#x") - (if_then_else:SF (lt (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "nonimmediate_operand" "xm#f,f#x")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE && !TARGET_IEEE_FP - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "#") +(define_insn "smaxsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (smax:SF (match_operand:SF 1 "nonimmediate_operand" "%0") + (match_operand:SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE_MATH" + "maxss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (lt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "nonimmediate_operand" "")) - (match_operand:SF 3 "register_operand" "") - (match_operand:SF 4 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (match_dup 0) - (if_then_else:SF (lt (match_dup 1) - (match_dup 2)) - (match_dup 1) - (match_dup 2)))]) +(define_insn "smindf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (smin:DF (match_operand:DF 1 "nonimmediate_operand" "%0") + (match_operand:DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "minsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_insn "smaxdf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (smax:DF (match_operand:DF 1 "nonimmediate_operand" "%0") + (match_operand:DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "maxsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +;; These versions of the min/max patterns implement exactly the operations +;; min = (op1 < op2 ? op1 : op2) +;; max = (!(op1 < op2) ? op1 : op2) +;; Their operands are not commutative, and thus they may be used in the +;; presence of -0.0 and NaN. + +(define_insn "*ieee_sminsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (unspec:SF [(match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE_MATH" + "minss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_insn "*ieee_smaxsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (unspec:SF [(match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE_MATH" + "maxss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_insn "*ieee_smindf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (unspec:DF [(match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "minsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_insn "*ieee_smaxdf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (unspec:DF [(match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "maxsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +;; Make two stack loads independent: +;; fld aa fld aa +;; fld %st(0) -> fld bb +;; fmul bb fmul %st(1), %st +;; +;; Actually we only match the last two instructions for simplicity. +(define_peephole2 + [(set (match_operand 0 "fp_register_operand" "") + (match_operand 1 "fp_register_operand" "")) + (set (match_dup 0) + (match_operator 2 "binary_fp_operator" + [(match_dup 0) + (match_operand 3 "memory_operand" "")]))] + "REGNO (operands[0]) != REGNO (operands[1])" + [(set (match_dup 0) (match_dup 3)) + (set (match_dup 0) (match_dup 4))] + + ;; The % modifier is not operational anymore in peephole2's, so we have to + ;; swap the operands manually in the case of addition and multiplication. + "if (COMMUTATIVE_ARITH_P (operands[2])) + operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]), GET_MODE (operands[2]), + operands[0], operands[1]); + else + operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[2]), GET_MODE (operands[2]), + operands[1], operands[0]);") ;; Conditional addition patterns (define_expand "addqicc" @@ -16572,282 +19257,6 @@ "TARGET_64BIT" "if (!ix86_expand_int_addcc (operands)) FAIL; DONE;") -;; We can't represent the LT test directly. Do this by swapping the operands. - -(define_split - [(set (match_operand:SF 0 "fp_register_operand" "") - (if_then_else:SF (lt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "register_operand" "")) - (match_operand:SF 3 "register_operand" "") - (match_operand:SF 4 "register_operand" ""))) - (clobber (reg:CC 17))] - "reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (reg:CCFP 17) - (compare:CCFP (match_dup 2) - (match_dup 1))) - (set (match_dup 0) - (if_then_else:SF (ge (reg:CCFP 17) (const_int 0)) - (match_dup 1) - (match_dup 2)))]) - -(define_insn "*minsf_sse" - [(set (match_operand:SF 0 "register_operand" "=x") - (if_then_else:SF (lt (match_operand:SF 1 "register_operand" "0") - (match_operand:SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE && reload_completed" - "minss\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -(define_expand "mindf3" - [(parallel [ - (set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (lt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "nonimmediate_operand" "")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))])] - "TARGET_SSE2 && TARGET_SSE_MATH" - "#") - -(define_insn "*mindf" - [(set (match_operand:DF 0 "register_operand" "=Y#f,f#Y,f#Y") - (if_then_else:DF (lt (match_operand:DF 1 "register_operand" "0,0,f#Y") - (match_operand:DF 2 "nonimmediate_operand" "Ym#f,f#Y,0")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE2 && TARGET_IEEE_FP && TARGET_SSE_MATH" - "#") - -(define_insn "*mindf_nonieee" - [(set (match_operand:DF 0 "register_operand" "=Y#f,f#Y") - (if_then_else:DF (lt (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "nonimmediate_operand" "Ym#f,f#Y")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE2 && TARGET_SSE_MATH && !TARGET_IEEE_FP - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "#") - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (lt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "nonimmediate_operand" "")) - (match_operand:DF 3 "register_operand" "") - (match_operand:DF 4 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (match_dup 0) - (if_then_else:DF (lt (match_dup 1) - (match_dup 2)) - (match_dup 1) - (match_dup 2)))]) - -;; We can't represent the LT test directly. Do this by swapping the operands. -(define_split - [(set (match_operand:DF 0 "fp_register_operand" "") - (if_then_else:DF (lt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "register_operand" "")) - (match_operand:DF 3 "register_operand" "") - (match_operand:DF 4 "register_operand" ""))) - (clobber (reg:CC 17))] - "reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (reg:CCFP 17) - (compare:CCFP (match_dup 2) - (match_dup 1))) - (set (match_dup 0) - (if_then_else:DF (ge (reg:CCFP 17) (const_int 0)) - (match_dup 1) - (match_dup 2)))]) - -(define_insn "*mindf_sse" - [(set (match_operand:DF 0 "register_operand" "=Y") - (if_then_else:DF (lt (match_operand:DF 1 "register_operand" "0") - (match_operand:DF 2 "nonimmediate_operand" "Ym")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE2 && TARGET_SSE_MATH && reload_completed" - "minsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "DF")]) - -(define_expand "maxsf3" - [(parallel [ - (set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (gt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "nonimmediate_operand" "")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))])] - "TARGET_SSE" - "#") - -(define_insn "*maxsf" - [(set (match_operand:SF 0 "register_operand" "=x#f,f#x,f#x") - (if_then_else:SF (gt (match_operand:SF 1 "register_operand" "0,0,f#x") - (match_operand:SF 2 "nonimmediate_operand" "xm#f,f#x,0")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE && TARGET_IEEE_FP" - "#") - -(define_insn "*maxsf_nonieee" - [(set (match_operand:SF 0 "register_operand" "=x#f,f#x") - (if_then_else:SF (gt (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "nonimmediate_operand" "xm#f,f#x")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE && !TARGET_IEEE_FP - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "#") - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (gt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "nonimmediate_operand" "")) - (match_operand:SF 3 "register_operand" "") - (match_operand:SF 4 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (match_dup 0) - (if_then_else:SF (gt (match_dup 1) - (match_dup 2)) - (match_dup 1) - (match_dup 2)))]) - -(define_split - [(set (match_operand:SF 0 "fp_register_operand" "") - (if_then_else:SF (gt (match_operand:SF 1 "register_operand" "") - (match_operand:SF 2 "register_operand" "")) - (match_operand:SF 3 "register_operand" "") - (match_operand:SF 4 "register_operand" ""))) - (clobber (reg:CC 17))] - "reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (reg:CCFP 17) - (compare:CCFP (match_dup 1) - (match_dup 2))) - (set (match_dup 0) - (if_then_else:SF (gt (reg:CCFP 17) (const_int 0)) - (match_dup 1) - (match_dup 2)))]) - -(define_insn "*maxsf_sse" - [(set (match_operand:SF 0 "register_operand" "=x") - (if_then_else:SF (gt (match_operand:SF 1 "register_operand" "0") - (match_operand:SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE && reload_completed" - "maxss\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -(define_expand "maxdf3" - [(parallel [ - (set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (gt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "nonimmediate_operand" "")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))])] - "TARGET_SSE2 && TARGET_SSE_MATH" - "#") - -(define_insn "*maxdf" - [(set (match_operand:DF 0 "register_operand" "=Y#f,f#Y,f#Y") - (if_then_else:DF (gt (match_operand:DF 1 "register_operand" "0,0,f#Y") - (match_operand:DF 2 "nonimmediate_operand" "Ym#f,f#Y,0")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE2 && TARGET_SSE_MATH && TARGET_IEEE_FP" - "#") - -(define_insn "*maxdf_nonieee" - [(set (match_operand:DF 0 "register_operand" "=Y#f,f#Y") - (if_then_else:DF (gt (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "nonimmediate_operand" "Ym#f,f#Y")) - (match_dup 1) - (match_dup 2))) - (clobber (reg:CC 17))] - "TARGET_SSE2 && TARGET_SSE_MATH && !TARGET_IEEE_FP - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "#") - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (gt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "nonimmediate_operand" "")) - (match_operand:DF 3 "register_operand" "") - (match_operand:DF 4 "nonimmediate_operand" ""))) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (match_dup 0) - (if_then_else:DF (gt (match_dup 1) - (match_dup 2)) - (match_dup 1) - (match_dup 2)))]) - -(define_split - [(set (match_operand:DF 0 "fp_register_operand" "") - (if_then_else:DF (gt (match_operand:DF 1 "register_operand" "") - (match_operand:DF 2 "register_operand" "")) - (match_operand:DF 3 "register_operand" "") - (match_operand:DF 4 "register_operand" ""))) - (clobber (reg:CC 17))] - "reload_completed - && ((operands_match_p (operands[1], operands[3]) - && operands_match_p (operands[2], operands[4])) - || (operands_match_p (operands[1], operands[4]) - && operands_match_p (operands[2], operands[3])))" - [(set (reg:CCFP 17) - (compare:CCFP (match_dup 1) - (match_dup 2))) - (set (match_dup 0) - (if_then_else:DF (gt (reg:CCFP 17) (const_int 0)) - (match_dup 1) - (match_dup 2)))]) - -(define_insn "*maxdf_sse" - [(set (match_operand:DF 0 "register_operand" "=Y") - (if_then_else:DF (gt (match_operand:DF 1 "register_operand" "0") - (match_operand:DF 2 "nonimmediate_operand" "Ym")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE2 && TARGET_SSE_MATH && reload_completed" - "maxsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "DF")]) ;; Misc patterns (?) @@ -16864,7 +19273,7 @@ [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "0,r") (match_operand:SI 2 "immediate_operand" "i,i"))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))] "!TARGET_64BIT" { @@ -16889,7 +19298,7 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -16905,7 +19314,7 @@ [(set (match_operand:DI 0 "register_operand" "=r,r") (plus:DI (match_operand:DI 1 "register_operand" "0,r") (match_operand:DI 2 "x86_64_immediate_operand" "e,e"))) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))] "TARGET_64BIT" { @@ -16932,7 +19341,7 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -16949,7 +19358,7 @@ (plus:DI (match_operand:DI 1 "register_operand" "0,r") (match_operand:DI 3 "immediate_operand" "i,i"))) (use (match_operand:DI 2 "register_operand" "r,r")) - (clobber (reg:CC 17)) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))] "TARGET_64BIT" { @@ -16963,372 +19372,12 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "alu,lea") (set_attr "mode" "DI")]) -;; Placeholder for the conditional moves. This one is split either to SSE -;; based moves emulation or to usual cmove sequence. Little bit unfortunate -;; fact is that compares supported by the cmp??ss instructions are exactly -;; swapped of those supported by cmove sequence. -;; The EQ/NE comparisons also needs bit care, since they are not directly -;; supported by i387 comparisons and we do need to emit two conditional moves -;; in tandem. - -(define_insn "sse_movsfcc" - [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf") - (if_then_else:SF (match_operator 1 "sse_comparison_operator" - [(match_operand:SF 4 "nonimmediate_operand" "0#fx,x#fx,f#x,f#x,xm#f,xm#f,f#x,f#x,xm#f,xm#f") - (match_operand:SF 5 "nonimmediate_operand" "xm#f,xm#f,f#x,f#x,x#f,x#f,f#x,f#x,x#f,x#f")]) - (match_operand:SF 2 "nonimmediate_operand" "x#fr,0#fr,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx,0#rx") - (match_operand:SF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx"))) - (clobber (match_scratch:SF 6 "=2,&4,X,X,X,X,X,X,X,X")) - (clobber (reg:CC 17))] - "TARGET_SSE - && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM) - /* Avoid combine from being smart and converting min/max - instruction patterns into conditional moves. */ - && ((GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != GT - && GET_CODE (operands[1]) != UNLE && GET_CODE (operands[1]) != UNGE) - || !rtx_equal_p (operands[4], operands[2]) - || !rtx_equal_p (operands[5], operands[3])) - && (!TARGET_IEEE_FP - || (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))" - "#") - -(define_insn "sse_movsfcc_eq" - [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf") - (if_then_else:SF (eq (match_operand:SF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,xm#f,f#x,xm#f") - (match_operand:SF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,x#f,f#x,x#f")) - (match_operand:SF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx") - (match_operand:SF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx"))) - (clobber (match_scratch:SF 5 "=1,&3,X,X,X,X")) - (clobber (reg:CC 17))] - "TARGET_SSE - && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" - "#") - -(define_insn "sse_movdfcc" - [(set (match_operand:DF 0 "register_operand" "=&Y#rf,Y#rf,?f#Yr,?f#Yr,?f#Yr,?f#Yr,?r#Yf,?r#Yf,?r#Yf,?r#Yf") - (if_then_else:DF (match_operator 1 "sse_comparison_operator" - [(match_operand:DF 4 "nonimmediate_operand" "0#fY,Y#fY,f#Y,f#Y,Ym#f,Ym#f,f#Y,f#Y,Ym#f,Ym#f") - (match_operand:DF 5 "nonimmediate_operand" "Ym#f,Ym#f,f#Y,f#Y,Y#f,Y#f,f#Y,f#Y,Y#f,Y#f")]) - (match_operand:DF 2 "nonimmediate_operand" "Y#fr,0#fr,f#fY,0#fY,f#fY,0#fY,rm#rY,0#rY,rm#rY,0#rY") - (match_operand:DF 3 "nonimmediate_operand" "Y#fr,Y#fr,0#fY,f#fY,0#fY,f#fY,0#fY,rm#rY,0#rY,rm#rY"))) - (clobber (match_scratch:DF 6 "=2,&4,X,X,X,X,X,X,X,X")) - (clobber (reg:CC 17))] - "TARGET_SSE2 - && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM) - /* Avoid combine from being smart and converting min/max - instruction patterns into conditional moves. */ - && ((GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != GT - && GET_CODE (operands[1]) != UNLE && GET_CODE (operands[1]) != UNGE) - || !rtx_equal_p (operands[4], operands[2]) - || !rtx_equal_p (operands[5], operands[3])) - && (!TARGET_IEEE_FP - || (GET_CODE (operands[1]) != EQ && GET_CODE (operands[1]) != NE))" - "#") - -(define_insn "sse_movdfcc_eq" - [(set (match_operand:DF 0 "register_operand" "=&Y#rf,Y#rf,?f#Yr,?f#Yr,?r#Yf,?r#Yf") - (if_then_else:DF (eq (match_operand:DF 3 "nonimmediate_operand" "%0#fY,Y#fY,f#Y,Ym#f,f#Y,Ym#f") - (match_operand:DF 4 "nonimmediate_operand" "Ym#f,Ym#f,f#Y,Y#f,f#Y,Y#f")) - (match_operand:DF 1 "nonimmediate_operand" "Y#fr,0#fr,0#fY,0#fY,0#rY,0#rY") - (match_operand:DF 2 "nonimmediate_operand" "Y#fr,Y#fr,f#fY,f#fY,rm#rY,rm#rY"))) - (clobber (match_scratch:DF 5 "=1,&3,X,X,X,X")) - (clobber (reg:CC 17))] - "TARGET_SSE - && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)" - "#") - -;; For non-sse moves just expand the usual cmove sequence. -(define_split - [(set (match_operand 0 "register_operand" "") - (if_then_else (match_operator 1 "comparison_operator" - [(match_operand 4 "nonimmediate_operand" "") - (match_operand 5 "register_operand" "")]) - (match_operand 2 "nonimmediate_operand" "") - (match_operand 3 "nonimmediate_operand" ""))) - (clobber (match_operand 6 "" "")) - (clobber (reg:CC 17))] - "!SSE_REG_P (operands[0]) && reload_completed - && (GET_MODE (operands[0]) == SFmode - || (TARGET_SSE2 && GET_MODE (operands[0]) == DFmode))" - [(const_int 0)] -{ - ix86_compare_op0 = operands[5]; - ix86_compare_op1 = operands[4]; - operands[1] = gen_rtx_fmt_ee (swap_condition (GET_CODE (operands[1])), - VOIDmode, operands[5], operands[4]); - ix86_expand_fp_movcc (operands); - DONE; -}) - -;; Split SSE based conditional move into sequence: -;; cmpCC op0, op4 - set op0 to 0 or ffffffff depending on the comparison -;; and op2, op0 - zero op2 if comparison was false -;; nand op0, op3 - load op3 to op0 if comparison was false -;; or op2, op0 - get the nonzero one into the result. -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (match_operator 1 "sse_comparison_operator" - [(match_operand:SF 4 "register_operand" "") - (match_operand:SF 5 "nonimmediate_operand" "")]) - (match_operand:SF 2 "register_operand" "") - (match_operand:SF 3 "register_operand" ""))) - (clobber (match_operand 6 "" "")) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed" - [(set (match_dup 4) (match_op_dup 1 [(match_dup 4) (match_dup 5)])) - (set (match_dup 2) (and:V4SF (match_dup 2) - (match_dup 8))) - (set (match_dup 8) (and:V4SF (not:V4SF (match_dup 8)) - (match_dup 3))) - (set (match_dup 0) (ior:V4SF (match_dup 6) - (match_dup 7)))] -{ - /* If op2 == op3, op3 would be clobbered before it is used. */ - if (operands_match_p (operands[2], operands[3])) - { - emit_move_insn (operands[0], operands[2]); - DONE; - } - - PUT_MODE (operands[1], GET_MODE (operands[0])); - if (operands_match_p (operands[0], operands[4])) - operands[6] = operands[4], operands[7] = operands[2]; - else - operands[6] = operands[2], operands[7] = operands[4]; - operands[0] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - operands[2] = simplify_gen_subreg (V4SFmode, operands[2], SFmode, 0); - operands[3] = simplify_gen_subreg (V4SFmode, operands[3], SFmode, 0); - operands[8] = simplify_gen_subreg (V4SFmode, operands[4], SFmode, 0); - operands[6] = simplify_gen_subreg (V4SFmode, operands[6], SFmode, 0); - operands[7] = simplify_gen_subreg (V4SFmode, operands[7], SFmode, 0); -}) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (match_operator 1 "sse_comparison_operator" - [(match_operand:DF 4 "register_operand" "") - (match_operand:DF 5 "nonimmediate_operand" "")]) - (match_operand:DF 2 "register_operand" "") - (match_operand:DF 3 "register_operand" ""))) - (clobber (match_operand 6 "" "")) - (clobber (reg:CC 17))] - "SSE_REG_P (operands[0]) && reload_completed" - [(set (match_dup 4) (match_op_dup 1 [(match_dup 4) (match_dup 5)])) - (set (match_dup 2) (and:V2DF (match_dup 2) - (match_dup 8))) - (set (match_dup 8) (and:V2DF (not:V2DF (match_dup 8)) - (match_dup 3))) - (set (match_dup 0) (ior:V2DF (match_dup 6) - (match_dup 7)))] -{ - if (GET_MODE (operands[2]) == DFmode - && TARGET_SSE_PARTIAL_REGS && !optimize_size) - { - rtx op = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0); - emit_insn (gen_sse2_unpcklpd (op, op, op)); - op = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0); - emit_insn (gen_sse2_unpcklpd (op, op, op)); - } - - /* If op2 == op3, op3 would be clobbered before it is used. */ - if (operands_match_p (operands[2], operands[3])) - { - emit_move_insn (operands[0], operands[2]); - DONE; - } - - PUT_MODE (operands[1], GET_MODE (operands[0])); - if (operands_match_p (operands[0], operands[4])) - operands[6] = operands[4], operands[7] = operands[2]; - else - operands[6] = operands[2], operands[7] = operands[4]; - operands[0] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - operands[2] = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0); - operands[3] = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0); - operands[8] = simplify_gen_subreg (V2DFmode, operands[4], DFmode, 0); - operands[6] = simplify_gen_subreg (V2DFmode, operands[6], DFmode, 0); - operands[7] = simplify_gen_subreg (V2DFmode, operands[7], DFmode, 0); -}) - -;; Special case of conditional move we can handle effectively. -;; Do not brother with the integer/floating point case, since these are -;; bot considerably slower, unlike in the generic case. -(define_insn "*sse_movsfcc_const0_1" - [(set (match_operand:SF 0 "register_operand" "=&x") - (if_then_else:SF (match_operator 1 "sse_comparison_operator" - [(match_operand:SF 4 "register_operand" "0") - (match_operand:SF 5 "nonimmediate_operand" "xm")]) - (match_operand:SF 2 "register_operand" "x") - (match_operand:SF 3 "const0_operand" "X")))] - "TARGET_SSE" - "#") - -(define_insn "*sse_movsfcc_const0_2" - [(set (match_operand:SF 0 "register_operand" "=&x") - (if_then_else:SF (match_operator 1 "sse_comparison_operator" - [(match_operand:SF 4 "register_operand" "0") - (match_operand:SF 5 "nonimmediate_operand" "xm")]) - (match_operand:SF 2 "const0_operand" "X") - (match_operand:SF 3 "register_operand" "x")))] - "TARGET_SSE" - "#") - -(define_insn "*sse_movsfcc_const0_3" - [(set (match_operand:SF 0 "register_operand" "=&x") - (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" - [(match_operand:SF 4 "nonimmediate_operand" "xm") - (match_operand:SF 5 "register_operand" "0")]) - (match_operand:SF 2 "register_operand" "x") - (match_operand:SF 3 "const0_operand" "X")))] - "TARGET_SSE" - "#") - -(define_insn "*sse_movsfcc_const0_4" - [(set (match_operand:SF 0 "register_operand" "=&x") - (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" - [(match_operand:SF 4 "nonimmediate_operand" "xm") - (match_operand:SF 5 "register_operand" "0")]) - (match_operand:SF 2 "const0_operand" "X") - (match_operand:SF 3 "register_operand" "x")))] - "TARGET_SSE" - "#") - -(define_insn "*sse_movdfcc_const0_1" - [(set (match_operand:DF 0 "register_operand" "=&Y") - (if_then_else:DF (match_operator 1 "sse_comparison_operator" - [(match_operand:DF 4 "register_operand" "0") - (match_operand:DF 5 "nonimmediate_operand" "Ym")]) - (match_operand:DF 2 "register_operand" "Y") - (match_operand:DF 3 "const0_operand" "X")))] - "TARGET_SSE2" - "#") - -(define_insn "*sse_movdfcc_const0_2" - [(set (match_operand:DF 0 "register_operand" "=&Y") - (if_then_else:DF (match_operator 1 "sse_comparison_operator" - [(match_operand:DF 4 "register_operand" "0") - (match_operand:DF 5 "nonimmediate_operand" "Ym")]) - (match_operand:DF 2 "const0_operand" "X") - (match_operand:DF 3 "register_operand" "Y")))] - "TARGET_SSE2" - "#") - -(define_insn "*sse_movdfcc_const0_3" - [(set (match_operand:DF 0 "register_operand" "=&Y") - (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" - [(match_operand:DF 4 "nonimmediate_operand" "Ym") - (match_operand:DF 5 "register_operand" "0")]) - (match_operand:DF 2 "register_operand" "Y") - (match_operand:DF 3 "const0_operand" "X")))] - "TARGET_SSE2" - "#") - -(define_insn "*sse_movdfcc_const0_4" - [(set (match_operand:DF 0 "register_operand" "=&Y") - (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" - [(match_operand:DF 4 "nonimmediate_operand" "Ym") - (match_operand:DF 5 "register_operand" "0")]) - (match_operand:DF 2 "const0_operand" "X") - (match_operand:DF 3 "register_operand" "Y")))] - "TARGET_SSE2" - "#") - -(define_split - [(set (match_operand:SF 0 "register_operand" "") - (if_then_else:SF (match_operator 1 "comparison_operator" - [(match_operand:SF 4 "nonimmediate_operand" "") - (match_operand:SF 5 "nonimmediate_operand" "")]) - (match_operand:SF 2 "nonmemory_operand" "") - (match_operand:SF 3 "nonmemory_operand" "")))] - "SSE_REG_P (operands[0]) && reload_completed - && (const0_operand (operands[2], GET_MODE (operands[0])) - || const0_operand (operands[3], GET_MODE (operands[0])))" - [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)])) - (set (match_dup 8) (and:V4SF (match_dup 6) (match_dup 7)))] -{ - PUT_MODE (operands[1], GET_MODE (operands[0])); - if (!sse_comparison_operator (operands[1], VOIDmode) - || !rtx_equal_p (operands[0], operands[4])) - { - rtx tmp = operands[5]; - operands[5] = operands[4]; - operands[4] = tmp; - PUT_CODE (operands[1], swap_condition (GET_CODE (operands[1]))); - } - if (!rtx_equal_p (operands[0], operands[4])) - abort (); - operands[8] = simplify_gen_subreg (V4SFmode, operands[0], SFmode, 0); - if (const0_operand (operands[2], GET_MODE (operands[2]))) - { - operands[7] = operands[3]; - operands[6] = gen_rtx_NOT (V4SFmode, operands[5]); - } - else - { - operands[7] = operands[2]; - operands[6] = operands[8]; - } - operands[7] = simplify_gen_subreg (V4SFmode, operands[7], SFmode, 0); -}) - -(define_split - [(set (match_operand:DF 0 "register_operand" "") - (if_then_else:DF (match_operator 1 "comparison_operator" - [(match_operand:DF 4 "nonimmediate_operand" "") - (match_operand:DF 5 "nonimmediate_operand" "")]) - (match_operand:DF 2 "nonmemory_operand" "") - (match_operand:DF 3 "nonmemory_operand" "")))] - "SSE_REG_P (operands[0]) && reload_completed - && (const0_operand (operands[2], GET_MODE (operands[0])) - || const0_operand (operands[3], GET_MODE (operands[0])))" - [(set (match_dup 0) (match_op_dup 1 [(match_dup 0) (match_dup 5)])) - (set (match_dup 8) (and:V2DF (match_dup 6) (match_dup 7)))] -{ - if (TARGET_SSE_PARTIAL_REGS && !optimize_size - && GET_MODE (operands[2]) == DFmode) - { - if (REG_P (operands[2])) - { - rtx op = simplify_gen_subreg (V2DFmode, operands[2], DFmode, 0); - emit_insn (gen_sse2_unpcklpd (op, op, op)); - } - if (REG_P (operands[3])) - { - rtx op = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0); - emit_insn (gen_sse2_unpcklpd (op, op, op)); - } - } - PUT_MODE (operands[1], GET_MODE (operands[0])); - if (!sse_comparison_operator (operands[1], VOIDmode) - || !rtx_equal_p (operands[0], operands[4])) - { - rtx tmp = operands[5]; - operands[5] = operands[4]; - operands[4] = tmp; - PUT_CODE (operands[1], swap_condition (GET_CODE (operands[1]))); - } - if (!rtx_equal_p (operands[0], operands[4])) - abort (); - operands[8] = simplify_gen_subreg (V2DFmode, operands[0], DFmode, 0); - if (const0_operand (operands[2], GET_MODE (operands[2]))) - { - operands[7] = operands[3]; - operands[6] = gen_rtx_NOT (V2DFmode, operands[8]); - } - else - { - operands[7] = operands[2]; - operands[6] = operands[8]; - } - operands[7] = simplify_gen_subreg (V2DFmode, operands[7], DFmode, 0); -}) - (define_expand "allocate_stack_worker" [(match_operand:SI 0 "register_operand" "")] "TARGET_STACK_PROBE" @@ -17353,9 +19402,9 @@ (define_insn "allocate_stack_worker_1" [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "a")] UNSPECV_STACK_PROBE) - (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0))) + (set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 0))) (clobber (match_scratch:SI 1 "=0")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT && TARGET_STACK_PROBE" "call\t__alloca" [(set_attr "type" "multi") @@ -17364,18 +19413,18 @@ (define_expand "allocate_stack_worker_postreload" [(parallel [(unspec_volatile:SI [(match_operand:SI 0 "register_operand" "a")] UNSPECV_STACK_PROBE) - (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0))) + (set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 0))) (clobber (match_dup 0)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") (define_insn "allocate_stack_worker_rex64" [(unspec_volatile:DI [(match_operand:DI 0 "register_operand" "a")] UNSPECV_STACK_PROBE) - (set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0))) + (set (reg:DI SP_REG) (minus:DI (reg:DI SP_REG) (match_dup 0))) (clobber (match_scratch:DI 1 "=0")) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && TARGET_STACK_PROBE" "call\t__alloca" [(set_attr "type" "multi") @@ -17384,20 +19433,20 @@ (define_expand "allocate_stack_worker_rex64_postreload" [(parallel [(unspec_volatile:DI [(match_operand:DI 0 "register_operand" "a")] UNSPECV_STACK_PROBE) - (set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0))) + (set (reg:DI SP_REG) (minus:DI (reg:DI SP_REG) (match_dup 0))) (clobber (match_dup 0)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "" "") (define_expand "allocate_stack" [(parallel [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (reg:SI 7) + (minus:SI (reg:SI SP_REG) (match_operand:SI 1 "general_operand" ""))) - (clobber (reg:CC 17))]) - (parallel [(set (reg:SI 7) - (minus:SI (reg:SI 7) (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))]) + (parallel [(set (reg:SI SP_REG) + (minus:SI (reg:SI SP_REG) (match_dup 1))) + (clobber (reg:CC FLAGS_REG))])] "TARGET_STACK_PROBE" { #ifdef CHECK_STACK_LIMIT @@ -17418,7 +19467,21 @@ [(label_ref (match_operand 0 "" ""))] "!TARGET_64BIT && flag_pic" { - emit_insn (gen_set_got (pic_offset_table_rtx)); + if (TARGET_MACHO) + { + rtx xops[3]; + rtx picreg = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM); + rtx label_rtx = gen_label_rtx (); + emit_insn (gen_set_got_labelled (pic_offset_table_rtx, label_rtx)); + xops[0] = xops[1] = picreg; + xops[2] = gen_rtx_CONST (SImode, + gen_rtx_MINUS (SImode, + gen_rtx_LABEL_REF (SImode, label_rtx), + gen_rtx_SYMBOL_REF (SImode, GOT_SYMBOL_NAME))); + ix86_expand_binary_operator (MINUS, SImode, xops); + } + else + emit_insn (gen_set_got (pic_offset_table_rtx)); DONE; }) @@ -17429,17 +19492,18 @@ (match_operator 3 "promotable_binary_operator" [(match_operand 1 "register_operand" "") (match_operand 2 "aligned_operand" "")])) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "! TARGET_PARTIAL_REG_STALL && reload_completed && ((GET_MODE (operands[0]) == HImode && ((!optimize_size && !TARGET_FAST_PREFIX) + /* ??? next two lines just !satisfies_constraint_K (...) */ || GET_CODE (operands[2]) != CONST_INT - || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K'))) + || satisfies_constraint_K (operands[2]))) || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 1) (match_dup 2)])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]); if (GET_CODE (operands[3]) != ASHIFT) @@ -17505,14 +19569,14 @@ (define_split [(set (match_operand 0 "register_operand" "") (neg (match_operand 1 "register_operand" ""))) - (clobber (reg:CC 17))] + (clobber (reg:CC FLAGS_REG))] "! TARGET_PARTIAL_REG_STALL && reload_completed && (GET_MODE (operands[0]) == HImode || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(parallel [(set (match_dup 0) (neg:SI (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]);") @@ -17531,7 +19595,7 @@ (define_split [(set (match_operand 0 "register_operand" "") (if_then_else (match_operator 1 "comparison_operator" - [(reg 17) (const_int 0)]) + [(reg FLAGS_REG) (const_int 0)]) (match_operand 2 "register_operand" "") (match_operand 3 "register_operand" "")))] "! TARGET_PARTIAL_REG_STALL && TARGET_CMOVE @@ -17553,7 +19617,8 @@ [(set (match_operand:SI 0 "push_operand" "") (match_operand:SI 1 "memory_operand" "")) (match_scratch:SI 2 "r")] - "! optimize_size && ! TARGET_PUSH_MEMORY" + "!optimize_size && !TARGET_PUSH_MEMORY + && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] "") @@ -17562,7 +19627,8 @@ [(set (match_operand:DI 0 "push_operand" "") (match_operand:DI 1 "memory_operand" "")) (match_scratch:DI 2 "r")] - "! optimize_size && ! TARGET_PUSH_MEMORY" + "!optimize_size && !TARGET_PUSH_MEMORY + && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] "") @@ -17573,7 +19639,8 @@ [(set (match_operand:SF 0 "push_operand" "") (match_operand:SF 1 "memory_operand" "")) (match_scratch:SF 2 "r")] - "! optimize_size && ! TARGET_PUSH_MEMORY" + "!optimize_size && !TARGET_PUSH_MEMORY + && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] "") @@ -17582,7 +19649,8 @@ [(set (match_operand:HI 0 "push_operand" "") (match_operand:HI 1 "memory_operand" "")) (match_scratch:HI 2 "r")] - "! optimize_size && ! TARGET_PUSH_MEMORY" + "!optimize_size && !TARGET_PUSH_MEMORY + && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] "") @@ -17591,7 +19659,8 @@ [(set (match_operand:QI 0 "push_operand" "") (match_operand:QI 1 "memory_operand" "")) (match_scratch:QI 2 "q")] - "! optimize_size && ! TARGET_PUSH_MEMORY" + "!optimize_size && !TARGET_PUSH_MEMORY + && !RTX_FRAME_RELATED_P (peep2_next_insn (0))" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))] "") @@ -17608,7 +19677,7 @@ && get_attr_length (insn) >= ix86_cost->large_insn && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 1) (const_int 0)) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 1))] "") @@ -17622,7 +19691,7 @@ && get_attr_length (insn) >= ix86_cost->large_insn && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 2) (const_int 0)) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 1))] "operands[2] = gen_lowpart (SImode, operands[1]);") @@ -17636,7 +19705,7 @@ && get_attr_length (insn) >= ix86_cost->large_insn && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 2) (const_int 0)) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 1))] "operands[2] = gen_lowpart (SImode, operands[1]);") @@ -17687,7 +19756,7 @@ ;; Don't split NOTs with a displacement operand, because resulting XOR ;; will not be pairable anyway. ;; -;; On AMD K6, NOT is vector decoded with memory operand that can not be +;; On AMD K6, NOT is vector decoded with memory operand that cannot be ;; represented using a modRM byte. The XOR replacement is long decoded, ;; so this split helps here as well. ;; @@ -17705,7 +19774,7 @@ || (TARGET_K6 && long_memory_operand (operands[0], SImode)))" [(parallel [(set (match_dup 0) (xor:SI (match_dup 1) (const_int -1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -17719,7 +19788,7 @@ || (TARGET_K6 && long_memory_operand (operands[0], HImode)))" [(parallel [(set (match_dup 0) (xor:HI (match_dup 1) (const_int -1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -17733,7 +19802,7 @@ || (TARGET_K6 && long_memory_operand (operands[0], QImode)))" [(parallel [(set (match_dup 0) (xor:QI (match_dup 1) (const_int -1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") ;; Non pairable "test imm, reg" instructions can be translated to @@ -17751,8 +19820,7 @@ (const_int 0)]))] "ix86_match_ccmode (insn, CCNOmode) && (true_regnum (operands[2]) != 0 - || (GET_CODE (operands[3]) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'K'))) + || satisfies_constraint_K (operands[3])) && peep2_reg_dead_p (1, operands[2])" [(parallel [(set (match_dup 0) @@ -17824,12 +19892,12 @@ (match_operator:SI 3 "arith_or_logical_operator" [(match_dup 0) (match_operand:SI 1 "memory_operand" "")])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "! optimize_size && ! TARGET_READ_MODIFY" [(set (match_dup 2) (match_dup 1)) (parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 0) (match_dup 2)])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -17838,12 +19906,12 @@ (match_operator:SI 3 "arith_or_logical_operator" [(match_operand:SI 1 "memory_operand" "") (match_dup 0)])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "! optimize_size && ! TARGET_READ_MODIFY" [(set (match_dup 2) (match_dup 1)) (parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 2) (match_dup 0)])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") ; Don't do logical operations with memory outputs @@ -17858,12 +19926,12 @@ (match_operator:SI 3 "arith_or_logical_operator" [(match_dup 0) (match_operand:SI 1 "nonmemory_operand" "")])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "! optimize_size && ! TARGET_READ_MODIFY_WRITE" [(set (match_dup 2) (match_dup 0)) (parallel [(set (match_dup 2) (match_op_dup 3 [(match_dup 2) (match_dup 1)])) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 2))] "") @@ -17873,29 +19941,28 @@ (match_operator:SI 3 "arith_or_logical_operator" [(match_operand:SI 1 "nonmemory_operand" "") (match_dup 0)])) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "! optimize_size && ! TARGET_READ_MODIFY_WRITE" [(set (match_dup 2) (match_dup 0)) (parallel [(set (match_dup 2) (match_op_dup 3 [(match_dup 1) (match_dup 2)])) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (set (match_dup 0) (match_dup 2))] "") ;; Attempt to always use XOR for zeroing registers. (define_peephole2 [(set (match_operand 0 "register_operand" "") - (const_int 0))] - "(GET_MODE (operands[0]) == QImode - || GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == SImode - || (GET_MODE (operands[0]) == DImode && TARGET_64BIT)) + (match_operand 1 "const0_operand" ""))] + "GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD && (! TARGET_USE_MOV0 || optimize_size) + && GENERAL_REG_P (operands[0]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (const_int 0)) - (clobber (reg:CC 17))])] - "operands[0] = gen_lowpart (GET_MODE (operands[0]) == DImode ? DImode : SImode, - operands[0]);") + (clobber (reg:CC FLAGS_REG))])] +{ + operands[0] = gen_lowpart (word_mode, operands[0]); +}) (define_peephole2 [(set (strict_low_part (match_operand 0 "register_operand" "")) @@ -17905,7 +19972,7 @@ && (! TARGET_USE_MOV0 || optimize_size) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (strict_low_part (match_dup 0)) (const_int 0)) - (clobber (reg:CC 17))])]) + (clobber (reg:CC FLAGS_REG))])]) ;; For HI and SI modes, or $-1,reg is smaller than mov $-1,reg. (define_peephole2 @@ -17917,7 +19984,7 @@ && (optimize_size || TARGET_PENTIUM) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (const_int -1)) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[0] = gen_lowpart (GET_MODE (operands[0]) == DImode ? DImode : SImode, operands[0]);") @@ -17929,7 +19996,7 @@ (match_operand:SI 1 "nonmemory_operand" "")))] "peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -17938,7 +20005,7 @@ (match_operand:DI 2 "nonmemory_operand" "")) 0))] "peep2_regno_dead_p (0, FLAGS_REG) && REGNO (operands[0]) == REGNO (operands[1])" [(parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[2] = gen_lowpart (SImode, operands[2]);") (define_peephole2 @@ -17947,7 +20014,7 @@ (match_operand:DI 1 "x86_64_general_operand" "")))] "peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -17957,7 +20024,7 @@ "exact_log2 (INTVAL (operands[1])) >= 0 && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));") (define_peephole2 @@ -17967,7 +20034,7 @@ "exact_log2 (INTVAL (operands[1])) >= 0 && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (ashift:DI (match_dup 0) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));") (define_peephole2 @@ -17978,7 +20045,7 @@ && REGNO (operands[0]) == REGNO (operands[1]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2])));") ;; The ESP adjustments can be done by the push and pop instructions. Resulting @@ -18002,52 +20069,52 @@ (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -4))) - (clobber (reg:CC 17)) + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_SUB_ESP_4" [(clobber (match_dup 0)) - (parallel [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0)) + (parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) (clobber (mem:BLK (scratch)))])]) (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -8))) - (clobber (reg:CC 17)) + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_SUB_ESP_8" [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0)) - (parallel [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0)) + (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) + (parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) (clobber (mem:BLK (scratch)))])]) ;; Convert esp subtractions to push. (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -4))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size || !TARGET_SUB_ESP_4" [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0))]) + (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))]) (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -8))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size || !TARGET_SUB_ESP_8" [(clobber (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0)) - (set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0))]) + (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0)) + (set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))]) ;; Convert epilogue deallocator to pop. (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4))) - (clobber (reg:CC 17)) + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_ADD_ESP_4" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4))) + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) (clobber (mem:BLK (scratch)))])] "") @@ -18056,38 +20123,38 @@ (define_peephole2 [(match_scratch:SI 0 "r") (match_scratch:SI 1 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8))) - (clobber (reg:CC 17)) + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_ADD_ESP_8" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4))) + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 1) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] + (parallel [(set (match_dup 1) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] "") (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8))) - (clobber (reg:CC 17)) + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4))) + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] + (parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] "") ;; Convert esp additions to pop. (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4))) + (clobber (reg:CC FLAGS_REG))])] "" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] "") ;; Two pops case is tricky, since pop causes dependency on destination register. @@ -18095,24 +20162,24 @@ (define_peephole2 [(match_scratch:SI 0 "r") (match_scratch:SI 1 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG))])] "" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))]) - (parallel [(set (match_dup 1) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))]) + (parallel [(set (match_dup 1) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] "") (define_peephole2 [(match_scratch:SI 0 "r") - (parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size" - [(parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))]) - (parallel [(set (match_dup 0) (mem:SI (reg:SI 7))) - (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])] + [(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))]) + (parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG))) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])] "") ;; Convert compares with 1 to shorter inc/dec operations when CF is not @@ -18134,52 +20201,52 @@ (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -8))) - (clobber (reg:CC 17)) + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_SUB_ESP_4" [(clobber (match_dup 0)) - (parallel [(set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0)) + (parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) (clobber (mem:BLK (scratch)))])]) (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16))) - (clobber (reg:CC 17)) + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_SUB_ESP_8" [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0)) - (parallel [(set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0)) + (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) + (parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) (clobber (mem:BLK (scratch)))])]) ;; Convert esp subtractions to push. (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -8))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size || !TARGET_SUB_ESP_4" [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0))]) + (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))]) (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size || !TARGET_SUB_ESP_8" [(clobber (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0)) - (set (mem:DI (pre_dec:DI (reg:DI 7))) (match_dup 0))]) + (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0)) + (set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))]) ;; Convert epilogue deallocator to pop. (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8))) - (clobber (reg:CC 17)) + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_ADD_ESP_4" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8))) + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) (clobber (mem:BLK (scratch)))])] "") @@ -18188,38 +20255,38 @@ (define_peephole2 [(match_scratch:DI 0 "r") (match_scratch:DI 1 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 16))) - (clobber (reg:CC 17)) + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size || !TARGET_ADD_ESP_8" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8))) + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 1) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))])] + (parallel [(set (match_dup 1) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] "") (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 16))) - (clobber (reg:CC 17)) + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) + (clobber (reg:CC FLAGS_REG)) (clobber (mem:BLK (scratch)))])] "optimize_size" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8))) + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) (clobber (mem:BLK (scratch)))]) - (parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))])] + (parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] "") ;; Convert esp additions to pop. (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8))) + (clobber (reg:CC FLAGS_REG))])] "" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))])] + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] "") ;; Two pops case is tricky, since pop causes dependency on destination register. @@ -18227,26 +20294,89 @@ (define_peephole2 [(match_scratch:DI 0 "r") (match_scratch:DI 1 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 16))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) + (clobber (reg:CC FLAGS_REG))])] "" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))]) - (parallel [(set (match_dup 1) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))])] + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))]) + (parallel [(set (match_dup 1) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] "") (define_peephole2 [(match_scratch:DI 0 "r") - (parallel [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 16))) - (clobber (reg:CC 17))])] + (parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16))) + (clobber (reg:CC FLAGS_REG))])] "optimize_size" - [(parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))]) - (parallel [(set (match_dup 0) (mem:DI (reg:DI 7))) - (set (reg:DI 7) (plus:DI (reg:DI 7) (const_int 8)))])] + [(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))]) + (parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG))) + (set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])] "") +;; Convert imul by three, five and nine into lea +(define_peephole2 + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (mult:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "const_int_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "INTVAL (operands[2]) == 3 + || INTVAL (operands[2]) == 5 + || INTVAL (operands[2]) == 9" + [(set (match_dup 0) + (plus:SI (mult:SI (match_dup 1) (match_dup 2)) + (match_dup 1)))] + { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); }) + +(define_peephole2 + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (mult:SI (match_operand:SI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "const_int_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "!optimize_size + && (INTVAL (operands[2]) == 3 + || INTVAL (operands[2]) == 5 + || INTVAL (operands[2]) == 9)" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 0) + (plus:SI (mult:SI (match_dup 0) (match_dup 2)) + (match_dup 0)))] + { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); }) + +(define_peephole2 + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (mult:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "const_int_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT + && (INTVAL (operands[2]) == 3 + || INTVAL (operands[2]) == 5 + || INTVAL (operands[2]) == 9)" + [(set (match_dup 0) + (plus:DI (mult:DI (match_dup 1) (match_dup 2)) + (match_dup 1)))] + { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); }) + +(define_peephole2 + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (mult:DI (match_operand:DI 1 "nonimmediate_operand" "") + (match_operand:DI 2 "const_int_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_64BIT + && !optimize_size + && (INTVAL (operands[2]) == 3 + || INTVAL (operands[2]) == 5 + || INTVAL (operands[2]) == 9)" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 0) + (plus:DI (mult:DI (match_dup 0) (match_dup 2)) + (match_dup 0)))] + { operands[2] = GEN_INT (INTVAL (operands[2]) - 1); }) + ;; Imul $32bit_imm, mem, reg is vector decoded, while ;; imul $32bit_imm, reg, reg is direct decoded. (define_peephole2 @@ -18254,13 +20384,12 @@ (parallel [(set (match_operand:DI 0 "register_operand" "") (mult:DI (match_operand:DI 1 "memory_operand" "") (match_operand:DI 2 "immediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_K8 && !optimize_size - && (GET_CODE (operands[2]) != CONST_INT - || !CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K'))" + (clobber (reg:CC FLAGS_REG))])] + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size + && !satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 1)) (parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -18268,13 +20397,12 @@ (parallel [(set (match_operand:SI 0 "register_operand" "") (mult:SI (match_operand:SI 1 "memory_operand" "") (match_operand:SI 2 "immediate_operand" ""))) - (clobber (reg:CC 17))])] - "TARGET_K8 && !optimize_size - && (GET_CODE (operands[2]) != CONST_INT - || !CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K'))" + (clobber (reg:CC FLAGS_REG))])] + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size + && !satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 1)) (parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") (define_peephole2 @@ -18283,13 +20411,12 @@ (zero_extend:DI (mult:SI (match_operand:SI 1 "memory_operand" "") (match_operand:SI 2 "immediate_operand" "")))) - (clobber (reg:CC 17))])] - "TARGET_K8 && !optimize_size - && (GET_CODE (operands[2]) != CONST_INT - || !CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K'))" + (clobber (reg:CC FLAGS_REG))])] + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size + && !satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 1)) (parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2)))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] "") ;; imul $8/16bit_imm, regmem, reg is vector decoded. @@ -18300,13 +20427,13 @@ [(parallel [(set (match_operand:DI 0 "register_operand" "") (mult:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "const_int_operand" ""))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (match_scratch:DI 3 "r")] - "TARGET_K8 && !optimize_size - && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')" + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size + && satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 2)) (parallel [(set (match_dup 0) (mult:DI (match_dup 0) (match_dup 3))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); @@ -18316,13 +20443,13 @@ [(parallel [(set (match_operand:SI 0 "register_operand" "") (mult:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "const_int_operand" ""))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (match_scratch:SI 3 "r")] - "TARGET_K8 && !optimize_size - && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')" + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size + && satisfies_constraint_K (operands[2])" [(set (match_dup 3) (match_dup 2)) (parallel [(set (match_dup 0) (mult:SI (match_dup 0) (match_dup 3))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); @@ -18332,16 +20459,74 @@ [(parallel [(set (match_operand:HI 0 "register_operand" "") (mult:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "immediate_operand" ""))) - (clobber (reg:CC 17))]) + (clobber (reg:CC FLAGS_REG))]) (match_scratch:HI 3 "r")] - "TARGET_K8 && !optimize_size" + "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size" [(set (match_dup 3) (match_dup 2)) (parallel [(set (match_dup 0) (mult:HI (match_dup 0) (match_dup 3))) - (clobber (reg:CC 17))])] + (clobber (reg:CC FLAGS_REG))])] { if (!rtx_equal_p (operands[0], operands[1])) emit_move_insn (operands[0], operands[1]); }) + +;; After splitting up read-modify operations, array accesses with memory +;; operands might end up in form: +;; sall $2, %eax +;; movl 4(%esp), %edx +;; addl %edx, %eax +;; instead of pre-splitting: +;; sall $2, %eax +;; addl 4(%esp), %eax +;; Turn it into: +;; movl 4(%esp), %edx +;; leal (%edx,%eax,4), %eax + +(define_peephole2 + [(parallel [(set (match_operand 0 "register_operand" "") + (ashift (match_operand 1 "register_operand" "") + (match_operand 2 "const_int_operand" ""))) + (clobber (reg:CC FLAGS_REG))]) + (set (match_operand 3 "register_operand") + (match_operand 4 "x86_64_general_operand" "")) + (parallel [(set (match_operand 5 "register_operand" "") + (plus (match_operand 6 "register_operand" "") + (match_operand 7 "register_operand" ""))) + (clobber (reg:CC FLAGS_REG))])] + "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 3 + /* Validate MODE for lea. */ + && ((!TARGET_PARTIAL_REG_STALL + && (GET_MODE (operands[0]) == QImode + || GET_MODE (operands[0]) == HImode)) + || GET_MODE (operands[0]) == SImode + || (TARGET_64BIT && GET_MODE (operands[0]) == DImode)) + /* We reorder load and the shift. */ + && !rtx_equal_p (operands[1], operands[3]) + && !reg_overlap_mentioned_p (operands[0], operands[4]) + /* Last PLUS must consist of operand 0 and 3. */ + && !rtx_equal_p (operands[0], operands[3]) + && (rtx_equal_p (operands[3], operands[6]) + || rtx_equal_p (operands[3], operands[7])) + && (rtx_equal_p (operands[0], operands[6]) + || rtx_equal_p (operands[0], operands[7])) + /* The intermediate operand 0 must die or be same as output. */ + && (rtx_equal_p (operands[0], operands[5]) + || peep2_reg_dead_p (3, operands[0]))" + [(set (match_dup 3) (match_dup 4)) + (set (match_dup 0) (match_dup 1))] +{ + enum machine_mode mode = GET_MODE (operands[5]) == DImode ? DImode : SImode; + int scale = 1 << INTVAL (operands[2]); + rtx index = gen_lowpart (Pmode, operands[1]); + rtx base = gen_lowpart (Pmode, operands[3]); + rtx dest = gen_lowpart (mode, operands[5]); + + operands[1] = gen_rtx_PLUS (Pmode, base, + gen_rtx_MULT (Pmode, index, GEN_INT (scale))); + if (mode != Pmode) + operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); + operands[0] = dest; +}) ;; Call-value patterns last so that the wildcard operand does not ;; disrupt insn-recog's switch tables. @@ -18350,7 +20535,7 @@ [(set (match_operand 0 "" "") (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" "")) (match_operand:SI 2 "" ""))) - (set (reg:SI 7) (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_operand:SI 3 "immediate_operand" "")))] "!TARGET_64BIT" { @@ -18365,11 +20550,11 @@ [(set (match_operand 0 "" "") (call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm")) (match_operand:SI 2 "" ""))) - (set (reg:SI 7) (plus:SI (reg:SI 7) + (set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (match_operand:SI 3 "immediate_operand" "i")))] "!TARGET_64BIT" { - if (constant_call_address_operand (operands[1], QImode)) + if (constant_call_address_operand (operands[1], Pmode)) { if (SIBLING_CALL_P (insn)) return "jmp\t%P1"; @@ -18415,7 +20600,7 @@ (match_operand:SI 2 "" "")))] "!SIBLING_CALL_P (insn) && !TARGET_64BIT" { - if (constant_call_address_operand (operands[1], QImode)) + if (constant_call_address_operand (operands[1], Pmode)) return "call\t%P1"; return "call\t%A1"; } @@ -18427,7 +20612,7 @@ (match_operand:SI 2 "" "")))] "SIBLING_CALL_P (insn) && !TARGET_64BIT" { - if (constant_call_address_operand (operands[1], QImode)) + if (constant_call_address_operand (operands[1], Pmode)) return "jmp\t%P1"; return "jmp\t%A1"; } @@ -18439,7 +20624,7 @@ (match_operand:DI 2 "" "")))] "!SIBLING_CALL_P (insn) && TARGET_64BIT" { - if (constant_call_address_operand (operands[1], QImode)) + if (constant_call_address_operand (operands[1], Pmode)) return "call\t%P1"; return "call\t%A1"; } @@ -18461,2402 +20646,16 @@ "jmp\t*%%r11" [(set_attr "type" "callv")]) +;; We used to use "int $5", in honor of #BR which maps to interrupt vector 5. +;; That, however, is usually mapped by the OS to SIGSEGV, which is often +;; caught for use by garbage collectors and the like. Using an insn that +;; maps to SIGILL makes it more likely the program will rightfully die. +;; Keeping with tradition, "6" is in honor of #UD. (define_insn "trap" - [(trap_if (const_int 1) (const_int 5))] + [(trap_if (const_int 1) (const_int 6))] "" - "int\t$5") - -;;; ix86 doesn't have conditional trap instructions, but we fake them -;;; for the sake of bounds checking. By emitting bounds checks as -;;; conditional traps rather than as conditional jumps around -;;; unconditional traps we avoid introducing spurious basic-block -;;; boundaries and facilitate elimination of redundant checks. In -;;; honor of the too-inflexible-for-BPs `bound' instruction, we use -;;; interrupt 5. -;;; -;;; FIXME: Static branch prediction rules for ix86 are such that -;;; forward conditional branches predict as untaken. As implemented -;;; below, pseudo conditional traps violate that rule. We should use -;;; .pushsection/.popsection to place all of the `int 5's in a special -;;; section loaded at the end of the text segment and branch forward -;;; there on bounds-failure, and then jump back immediately (in case -;;; the system chooses to ignore bounds violations, or to report -;;; violations and continue execution). - -(define_expand "conditional_trap" - [(trap_if (match_operator 0 "comparison_operator" - [(match_dup 2) (const_int 0)]) - (match_operand 1 "const_int_operand" ""))] - "" -{ - emit_insn (gen_rtx_TRAP_IF (VOIDmode, - ix86_expand_compare (GET_CODE (operands[0]), - NULL, NULL), - operands[1])); - DONE; -}) - -(define_insn "*conditional_trap_1" - [(trap_if (match_operator 0 "comparison_operator" - [(reg 17) (const_int 0)]) - (match_operand 1 "const_int_operand" ""))] - "" -{ - operands[2] = gen_label_rtx (); - output_asm_insn ("j%c0\t%l2\; int\t%1", operands); - (*targetm.asm_out.internal_label) (asm_out_file, "L", - CODE_LABEL_NUMBER (operands[2])); - RET; -}) - - ;; Pentium III SIMD instructions. - -;; Moves for SSE/MMX regs. - -(define_insn "*movv4sf_internal" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V4SF 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "@ - xorps\t%0, %0 - movaps\t{%1, %0|%0, %1} - movaps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "V4SF")]) - -(define_split - [(set (match_operand:V4SF 0 "register_operand" "") - (match_operand:V4SF 1 "zero_extended_scalar_load_operand" ""))] - "TARGET_SSE && reload_completed" - [(set (match_dup 0) - (vec_merge:V4SF - (vec_duplicate:V4SF (match_dup 1)) - (match_dup 2) - (const_int 1)))] -{ - operands[1] = simplify_gen_subreg (SFmode, operands[1], V4SFmode, 0); - operands[2] = CONST0_RTX (V4SFmode); -}) - -(define_insn "*movv4si_internal" - [(set (match_operand:V4SI 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V4SI 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "2") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "TI")))]) - -(define_insn "*movv2di_internal" - [(set (match_operand:V2DI 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V2DI 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "2") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "TI")))]) - -(define_split - [(set (match_operand:V2DF 0 "register_operand" "") - (match_operand:V2DF 1 "zero_extended_scalar_load_operand" ""))] - "TARGET_SSE2 && reload_completed" - [(set (match_dup 0) - (vec_merge:V2DF - (vec_duplicate:V2DF (match_dup 1)) - (match_dup 2) - (const_int 1)))] -{ - operands[1] = simplify_gen_subreg (DFmode, operands[1], V2DFmode, 0); - operands[2] = CONST0_RTX (V2DFmode); -}) - -(define_insn "*movv2si_internal" - [(set (match_operand:V2SI 0 "nonimmediate_operand" - "=y,y ,m,!y,!*Y,*x,?*x,?m") - (match_operand:V2SI 1 "vector_move_operand" - "C ,ym,y,*Y,y ,C ,*xm,*x"))] - "TARGET_MMX - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "@ - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov") - (set_attr "mode" "DI")]) - -(define_insn "*movv4hi_internal" - [(set (match_operand:V4HI 0 "nonimmediate_operand" - "=y,y ,m,!y,!*Y,*x,?*x,?m") - (match_operand:V4HI 1 "vector_move_operand" - "C ,ym,y,*Y,y ,C ,*xm,*x"))] - "TARGET_MMX - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "@ - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov") - (set_attr "mode" "DI")]) - -(define_insn "*movv8qi_internal" - [(set (match_operand:V8QI 0 "nonimmediate_operand" - "=y,y ,m,!y,!*Y,*x,?*x,?m") - (match_operand:V8QI 1 "vector_move_operand" - "C ,ym,y,*Y,y ,C ,*xm,*x"))] - "TARGET_MMX - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "@ - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov") - (set_attr "mode" "DI")]) - -(define_insn "*movv2sf_internal" - [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=y,y ,m,!y,!*Y,*x,?*x,?m") - (match_operand:V2SF 1 "vector_move_operand" - "C ,ym,y,*Y,y ,C ,*xm,*x"))] - "TARGET_MMX - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "@ - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - xorps\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov") - (set_attr "mode" "DI")]) - -(define_expand "movti" - [(set (match_operand:TI 0 "nonimmediate_operand" "") - (match_operand:TI 1 "nonimmediate_operand" ""))] - "TARGET_SSE || TARGET_64BIT" -{ - if (TARGET_64BIT) - ix86_expand_move (TImode, operands); - else - ix86_expand_vector_move (TImode, operands); - DONE; -}) - -(define_expand "movtf" - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "nonimmediate_operand" ""))] - "TARGET_64BIT" -{ - ix86_expand_move (TFmode, operands); - DONE; -}) - -(define_insn "*movv2df_internal" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V2DF 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "xorpd\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movapd\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov") - (set (attr "mode") - (cond [(eq (symbol_ref "TARGET_SSE2") (const_int 0)) - (const_string "V4SF") - (eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "V2DF")) - (eq_attr "alternative" "2") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "V2DF"))] - (const_string "V2DF")))]) - -(define_insn "*movv8hi_internal" - [(set (match_operand:V8HI 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V8HI 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "2") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "TI")))]) - -(define_insn "*movv16qi_internal" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,x,m") - (match_operand:V16QI 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "2") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "TI")))]) - -(define_expand "movv2df" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "") - (match_operand:V2DF 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V2DFmode, operands); - DONE; -}) - -(define_expand "movv8hi" - [(set (match_operand:V8HI 0 "nonimmediate_operand" "") - (match_operand:V8HI 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V8HImode, operands); - DONE; -}) - -(define_expand "movv16qi" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "") - (match_operand:V16QI 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V16QImode, operands); - DONE; -}) - -(define_expand "movv4sf" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "") - (match_operand:V4SF 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V4SFmode, operands); - DONE; -}) - -(define_expand "movv4si" - [(set (match_operand:V4SI 0 "nonimmediate_operand" "") - (match_operand:V4SI 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V4SImode, operands); - DONE; -}) - -(define_expand "movv2di" - [(set (match_operand:V2DI 0 "nonimmediate_operand" "") - (match_operand:V2DI 1 "nonimmediate_operand" ""))] - "TARGET_SSE" -{ - ix86_expand_vector_move (V2DImode, operands); - DONE; -}) - -(define_expand "movv2si" - [(set (match_operand:V2SI 0 "nonimmediate_operand" "") - (match_operand:V2SI 1 "nonimmediate_operand" ""))] - "TARGET_MMX" -{ - ix86_expand_vector_move (V2SImode, operands); - DONE; -}) - -(define_expand "movv4hi" - [(set (match_operand:V4HI 0 "nonimmediate_operand" "") - (match_operand:V4HI 1 "nonimmediate_operand" ""))] - "TARGET_MMX" -{ - ix86_expand_vector_move (V4HImode, operands); - DONE; -}) - -(define_expand "movv8qi" - [(set (match_operand:V8QI 0 "nonimmediate_operand" "") - (match_operand:V8QI 1 "nonimmediate_operand" ""))] - "TARGET_MMX" -{ - ix86_expand_vector_move (V8QImode, operands); - DONE; -}) - -(define_expand "movv2sf" - [(set (match_operand:V2SF 0 "nonimmediate_operand" "") - (match_operand:V2SF 1 "nonimmediate_operand" ""))] - "TARGET_MMX" -{ - ix86_expand_vector_move (V2SFmode, operands); - DONE; -}) - -(define_insn "*pushti" - [(set (match_operand:TI 0 "push_operand" "=<") - (match_operand:TI 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv2df" - [(set (match_operand:V2DF 0 "push_operand" "=<") - (match_operand:V2DF 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv2di" - [(set (match_operand:V2DI 0 "push_operand" "=<") - (match_operand:V2DI 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv8hi" - [(set (match_operand:V8HI 0 "push_operand" "=<") - (match_operand:V8HI 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv16qi" - [(set (match_operand:V16QI 0 "push_operand" "=<") - (match_operand:V16QI 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv4sf" - [(set (match_operand:V4SF 0 "push_operand" "=<") - (match_operand:V4SF 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv4si" - [(set (match_operand:V4SI 0 "push_operand" "=<") - (match_operand:V4SI 1 "register_operand" "x"))] - "TARGET_SSE" - "#") - -(define_insn "*pushv2si" - [(set (match_operand:V2SI 0 "push_operand" "=<") - (match_operand:V2SI 1 "register_operand" "y"))] - "TARGET_MMX" - "#") - -(define_insn "*pushv4hi" - [(set (match_operand:V4HI 0 "push_operand" "=<") - (match_operand:V4HI 1 "register_operand" "y"))] - "TARGET_MMX" - "#") - -(define_insn "*pushv8qi" - [(set (match_operand:V8QI 0 "push_operand" "=<") - (match_operand:V8QI 1 "register_operand" "y"))] - "TARGET_MMX" - "#") - -(define_insn "*pushv2sf" - [(set (match_operand:V2SF 0 "push_operand" "=<") - (match_operand:V2SF 1 "register_operand" "y"))] - "TARGET_MMX" - "#") - -(define_split - [(set (match_operand 0 "push_operand" "") - (match_operand 1 "register_operand" ""))] - "!TARGET_64BIT && reload_completed - && (SSE_REG_P (operands[1]) || MMX_REG_P (operands[1]))" - [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 3))) - (set (match_dup 2) (match_dup 1))] - "operands[2] = change_address (operands[0], GET_MODE (operands[0]), - stack_pointer_rtx); - operands[3] = GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[0])));") - -(define_split - [(set (match_operand 0 "push_operand" "") - (match_operand 1 "register_operand" ""))] - "TARGET_64BIT && reload_completed - && (SSE_REG_P (operands[1]) || MMX_REG_P (operands[1]))" - [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 3))) - (set (match_dup 2) (match_dup 1))] - "operands[2] = change_address (operands[0], GET_MODE (operands[0]), - stack_pointer_rtx); - operands[3] = GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[0])));") - - -(define_insn "*movti_internal" - [(set (match_operand:TI 0 "nonimmediate_operand" "=x,x,m") - (match_operand:TI 1 "vector_move_operand" "C,xm,x"))] - "TARGET_SSE && !TARGET_64BIT - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 1: - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "ssemov,ssemov,ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "0,1") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "2") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI"))] - (const_string "TI")))]) - -(define_insn "*movti_rex64" - [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o,x,x,xm") - (match_operand:TI 1 "general_operand" "riFo,riF,C,xm,x"))] - "TARGET_64BIT - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - case 1: - return "#"; - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 3: - case 4: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "*,*,ssemov,ssemov,ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "2,3") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "4") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "DI")))]) - -(define_insn "*movtf_rex64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o,x,x,xm") - (match_operand:TF 1 "general_operand" "riFo,riF,C,xm,x"))] - "TARGET_64BIT - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" -{ - switch (which_alternative) - { - case 0: - case 1: - return "#"; - case 2: - if (get_attr_mode (insn) == MODE_V4SF) - return "xorps\t%0, %0"; - else - return "pxor\t%0, %0"; - case 3: - case 4: - if (get_attr_mode (insn) == MODE_V4SF) - return "movaps\t{%1, %0|%0, %1}"; - else - return "movdqa\t{%1, %0|%0, %1}"; - default: - abort (); - } -} - [(set_attr "type" "*,*,ssemov,ssemov,ssemov") - (set (attr "mode") - (cond [(eq_attr "alternative" "2,3") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "4") - (if_then_else - (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") - (const_int 0)) - (ne (symbol_ref "optimize_size") - (const_int 0))) - (const_string "V4SF") - (const_string "TI"))] - (const_string "DI")))]) - -(define_split - [(set (match_operand:TI 0 "nonimmediate_operand" "") - (match_operand:TI 1 "general_operand" ""))] - "reload_completed && !SSE_REG_P (operands[0]) - && !SSE_REG_P (operands[1])" - [(const_int 0)] - "ix86_split_long_move (operands); DONE;") - -(define_split - [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "general_operand" ""))] - "reload_completed && !SSE_REG_P (operands[0]) - && !SSE_REG_P (operands[1])" - [(const_int 0)] - "ix86_split_long_move (operands); DONE;") - -;; These two patterns are useful for specifying exactly whether to use -;; movaps or movups -(define_expand "sse_movaps" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "") - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "")] - UNSPEC_MOVA))] - "TARGET_SSE" -{ - if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) - { - rtx tmp = gen_reg_rtx (V4SFmode); - emit_insn (gen_sse_movaps (tmp, operands[1])); - emit_move_insn (operands[0], tmp); - DONE; - } -}) - -(define_insn "*sse_movaps_1" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVA))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movaps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov,ssemov") - (set_attr "mode" "V4SF")]) - -(define_expand "sse_movups" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "") - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "")] - UNSPEC_MOVU))] - "TARGET_SSE" -{ - if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) - { - rtx tmp = gen_reg_rtx (V4SFmode); - emit_insn (gen_sse_movups (tmp, operands[1])); - emit_move_insn (operands[0], tmp); - DONE; - } -}) - -(define_insn "*sse_movups_1" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVU))] - "TARGET_SSE - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movups\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt,ssecvt") - (set_attr "mode" "V4SF")]) - -;; SSE Strange Moves. - -(define_insn "sse_movmskps" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:V4SF 1 "register_operand" "x")] - UNSPEC_MOVMSK))] - "TARGET_SSE" - "movmskps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "mmx_pmovmskb" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] - UNSPEC_MOVMSK))] - "TARGET_SSE || TARGET_3DNOW_A" - "pmovmskb\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - - -(define_insn "mmx_maskmovq" - [(set (mem:V8QI (match_operand:SI 0 "register_operand" "D")) - (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y") - (match_operand:V8QI 2 "register_operand" "y")] - UNSPEC_MASKMOV))] - "(TARGET_SSE || TARGET_3DNOW_A) && !TARGET_64BIT" - ;; @@@ check ordering of operands in intel/nonintel syntax - "maskmovq\t{%2, %1|%1, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_maskmovq_rex" - [(set (mem:V8QI (match_operand:DI 0 "register_operand" "D")) - (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y") - (match_operand:V8QI 2 "register_operand" "y")] - UNSPEC_MASKMOV))] - "(TARGET_SSE || TARGET_3DNOW_A) && TARGET_64BIT" - ;; @@@ check ordering of operands in intel/nonintel syntax - "maskmovq\t{%2, %1|%1, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "sse_movntv4sf" - [(set (match_operand:V4SF 0 "memory_operand" "=m") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "x")] - UNSPEC_MOVNT))] - "TARGET_SSE" - "movntps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "V4SF")]) - -(define_insn "sse_movntdi" - [(set (match_operand:DI 0 "memory_operand" "=m") - (unspec:DI [(match_operand:DI 1 "register_operand" "y")] - UNSPEC_MOVNT))] - "TARGET_SSE || TARGET_3DNOW_A" - "movntq\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxmov") - (set_attr "mode" "DI")]) - -(define_insn "sse_movhlps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0") - (vec_select:V4SF (match_operand:V4SF 2 "register_operand" "x") - (parallel [(const_int 2) - (const_int 3) - (const_int 0) - (const_int 1)])) - (const_int 3)))] - "TARGET_SSE" - "movhlps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "sse_movlhps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0") - (vec_select:V4SF (match_operand:V4SF 2 "register_operand" "x") - (parallel [(const_int 2) - (const_int 3) - (const_int 0) - (const_int 1)])) - (const_int 12)))] - "TARGET_SSE" - "movlhps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "sse_movhps" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") - (vec_merge:V4SF - (match_operand:V4SF 1 "nonimmediate_operand" "0,0") - (match_operand:V4SF 2 "nonimmediate_operand" "m,x") - (const_int 12)))] - "TARGET_SSE - && (GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)" - "movhps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "sse_movlps" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") - (vec_merge:V4SF - (match_operand:V4SF 1 "nonimmediate_operand" "0,0") - (match_operand:V4SF 2 "nonimmediate_operand" "m,x") - (const_int 3)))] - "TARGET_SSE - && (GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)" - "movlps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_expand "sse_loadss" - [(match_operand:V4SF 0 "register_operand" "") - (match_operand:SF 1 "memory_operand" "")] - "TARGET_SSE" -{ - emit_insn (gen_sse_loadss_1 (operands[0], operands[1], - CONST0_RTX (V4SFmode))); - DONE; -}) - -(define_insn "sse_loadss_1" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (vec_duplicate:V4SF (match_operand:SF 1 "memory_operand" "m")) - (match_operand:V4SF 2 "const0_operand" "X") - (const_int 1)))] - "TARGET_SSE" - "movss\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "SF")]) - -(define_insn "sse_movss" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "register_operand" "x") - (const_int 1)))] - "TARGET_SSE" - "movss\t{%2, %0|%0, %2}" - [(set_attr "type" "ssemov") - (set_attr "mode" "SF")]) - -(define_insn "sse_storess" - [(set (match_operand:SF 0 "memory_operand" "=m") - (vec_select:SF - (match_operand:V4SF 1 "register_operand" "x") - (parallel [(const_int 0)])))] - "TARGET_SSE" - "movss\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "SF")]) - -(define_insn "sse_shufps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm") - (match_operand:SI 3 "immediate_operand" "i")] - UNSPEC_SHUFFLE))] - "TARGET_SSE" - ;; @@@ check operand order for intel/nonintel syntax - "shufps\t{%3, %2, %0|%0, %2, %3}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - - -;; SSE arithmetic - -(define_insn "addv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (plus:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "addps\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V4SF")]) - -(define_insn "vmaddv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (plus:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "addss\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "SF")]) - -(define_insn "subv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (minus:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "subps\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V4SF")]) - -(define_insn "vmsubv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (minus:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "subss\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "SF")]) - -(define_insn "mulv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (mult:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "mulps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssemul") - (set_attr "mode" "V4SF")]) - -(define_insn "vmmulv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (mult:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "mulss\t{%2, %0|%0, %2}" - [(set_attr "type" "ssemul") - (set_attr "mode" "SF")]) - -(define_insn "divv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (div:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "divps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssediv") - (set_attr "mode" "V4SF")]) - -(define_insn "vmdivv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (div:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "divss\t{%2, %0|%0, %2}" - [(set_attr "type" "ssediv") - (set_attr "mode" "SF")]) - - -;; SSE square root/reciprocal - -(define_insn "rcpv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF - [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RCP))] - "TARGET_SSE" - "rcpps\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "vmrcpv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] - UNSPEC_RCP) - (match_operand:V4SF 2 "register_operand" "0") - (const_int 1)))] - "TARGET_SSE" - "rcpss\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -(define_insn "rsqrtv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF - [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RSQRT))] - "TARGET_SSE" - "rsqrtps\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "vmrsqrtv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] - UNSPEC_RSQRT) - (match_operand:V4SF 2 "register_operand" "0") - (const_int 1)))] - "TARGET_SSE" - "rsqrtss\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -(define_insn "sqrtv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "sqrtps\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "vmsqrtv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "xm")) - (match_operand:V4SF 2 "register_operand" "0") - (const_int 1)))] - "TARGET_SSE" - "sqrtss\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -;; SSE logical operations. - -;; SSE defines logical operations on floating point values. This brings -;; interesting challenge to RTL representation where logicals are only valid -;; on integral types. We deal with this by representing the floating point -;; logical as logical on arguments casted to TImode as this is what hardware -;; really does. Unfortunately hardware requires the type information to be -;; present and thus we must avoid subregs from being simplified and eliminated -;; in later compilation phases. -;; -;; We have following variants from each instruction: -;; sse_andsf3 - the operation taking V4SF vector operands -;; and doing TImode cast on them -;; *sse_andsf3_memory - the operation taking one memory operand casted to -;; TImode, since backend insist on eliminating casts -;; on memory operands -;; sse_andti3_sf_1 - the operation taking SF scalar operands. -;; We can not accept memory operand here as instruction reads -;; whole scalar. This is generated only post reload by GCC -;; scalar float operations that expands to logicals (fabs) -;; sse_andti3_sf_2 - the operation taking SF scalar input and TImode -;; memory operand. Eventually combine can be able -;; to synthesize these using splitter. -;; sse2_anddf3, *sse2_anddf3_memory -;; -;; -;; These are not called andti3 etc. because we really really don't want -;; the compiler to widen DImode ands to TImode ands and then try to move -;; into DImode subregs of SSE registers, and them together, and move out -;; of DImode subregs again! -;; SSE1 single precision floating point logical operation -(define_expand "sse_andv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "") - (and:V4SF (match_operand:V4SF 1 "register_operand" "") - (match_operand:V4SF 2 "nonimmediate_operand" "")))] - "TARGET_SSE" - "") - -(define_insn "*sse_andv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (and:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "andps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_expand "sse_nandv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "") - (and:V4SF (not:V4SF (match_operand:V4SF 1 "register_operand" "")) - (match_operand:V4SF 2 "nonimmediate_operand" "")))] - "TARGET_SSE" - "") - -(define_insn "*sse_nandv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (and:V4SF (not:V4SF (match_operand:V4SF 1 "register_operand" "0")) - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "andnps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_expand "sse_iorv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "") - (ior:V4SF (match_operand:V4SF 1 "register_operand" "") - (match_operand:V4SF 2 "nonimmediate_operand" "")))] - "TARGET_SSE" - "") - -(define_insn "*sse_iorv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (ior:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "orps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -(define_expand "sse_xorv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "") - (xor:V4SF (match_operand:V4SF 1 "register_operand" "") - (match_operand:V4SF 2 "nonimmediate_operand" "")))] - "TARGET_SSE" - "") - -(define_insn "*sse_xorv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (xor:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "xorps\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V4SF")]) - -;; SSE2 double precision floating point logical operation - -(define_expand "sse2_andv2df3" - [(set (match_operand:V2DF 0 "register_operand" "") - (and:V2DF (match_operand:V2DF 1 "register_operand" "") - (match_operand:V2DF 2 "nonimmediate_operand" "")))] - "TARGET_SSE2" - "") - -(define_insn "*sse2_andv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (and:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "andpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_expand "sse2_nandv2df3" - [(set (match_operand:V2DF 0 "register_operand" "") - (and:V2DF (not:V2DF (match_operand:V2DF 1 "register_operand" "")) - (match_operand:V2DF 2 "nonimmediate_operand" "")))] - "TARGET_SSE2" - "") - -(define_insn "*sse2_nandv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (and:V2DF (not:V2DF (match_operand:V2DF 1 "register_operand" "0")) - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "andnpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_expand "sse2_iorv2df3" - [(set (match_operand:V2DF 0 "register_operand" "") - (ior:V2DF (match_operand:V2DF 1 "register_operand" "") - (match_operand:V2DF 2 "nonimmediate_operand" "")))] - "TARGET_SSE2" - "") - -(define_insn "*sse2_iorv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (ior:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "orpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -(define_expand "sse2_xorv2df3" - [(set (match_operand:V2DF 0 "register_operand" "") - (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") - (match_operand:V2DF 2 "nonimmediate_operand" "")))] - "TARGET_SSE2" - "") - -(define_insn "*sse2_xorv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "xorpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "V2DF")]) - -;; SSE2 integral logicals. These patterns must always come after floating -;; point ones since we don't want compiler to use integer opcodes on floating -;; point SSE values to avoid matching of subregs in the match_operand. -(define_insn "*sse2_andti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (and:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "pand\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "sse2_andv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (and:V2DI (match_operand:V2DI 1 "nonimmediate_operand" "%0") - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "pand\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "*sse2_nandti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (and:TI (not:TI (match_operand:TI 1 "register_operand" "0")) - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pandn\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "sse2_nandv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (and:V2DI (not:V2DI (match_operand:V2DI 1 "register_operand" "0")) - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "pandn\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "*sse2_iorti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (ior:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "por\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "sse2_iorv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (ior:V2DI (match_operand:V2DI 1 "nonimmediate_operand" "%0") - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "por\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "*sse2_xorti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (xor:TI (match_operand:TI 1 "nonimmediate_operand" "%0") - (match_operand:TI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "pxor\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -(define_insn "sse2_xorv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (xor:V2DI (match_operand:V2DI 1 "nonimmediate_operand" "%0") - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 - && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" - "pxor\t{%2, %0|%0, %2}" - [(set_attr "type" "sselog") - (set_attr "mode" "TI")]) - -;; Use xor, but don't show input operands so they aren't live before -;; this insn. -(define_insn "sse_clrv4sf" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (match_operand:V4SF 1 "const0_operand" "X"))] - "TARGET_SSE" -{ - if (get_attr_mode (insn) == MODE_TI) - return "pxor\t{%0, %0|%0, %0}"; - else - return "xorps\t{%0, %0|%0, %0}"; -} - [(set_attr "type" "sselog") - (set_attr "memory" "none") - (set (attr "mode") - (if_then_else - (and (and (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR") - (const_int 0)) - (ne (symbol_ref "TARGET_SSE2") - (const_int 0))) - (eq (symbol_ref "optimize_size") - (const_int 0))) - (const_string "TI") - (const_string "V4SF")))]) - -;; Use xor, but don't show input operands so they aren't live before -;; this insn. -(define_insn "sse_clrv2df" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (unspec:V2DF [(const_int 0)] UNSPEC_NOP))] - "TARGET_SSE2" - "xorpd\t{%0, %0|%0, %0}" - [(set_attr "type" "sselog") - (set_attr "memory" "none") - (set_attr "mode" "V4SF")]) - -;; SSE mask-generating compares - -(define_insn "maskcmpv4sf3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (match_operator:V4SI 3 "sse_comparison_operator" - [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "register_operand" "x")]))] - "TARGET_SSE" - "cmp%D3ps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "V4SF")]) - -(define_insn "maskncmpv4sf3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (not:V4SI - (match_operator:V4SI 3 "sse_comparison_operator" - [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "register_operand" "x")])))] - "TARGET_SSE" -{ - if (GET_CODE (operands[3]) == UNORDERED) - return "cmpordps\t{%2, %0|%0, %2}"; - else - return "cmpn%D3ps\t{%2, %0|%0, %2}"; -} - [(set_attr "type" "ssecmp") - (set_attr "mode" "V4SF")]) - -(define_insn "vmmaskcmpv4sf3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_merge:V4SI - (match_operator:V4SI 3 "sse_comparison_operator" - [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "register_operand" "x")]) - (subreg:V4SI (match_dup 1) 0) - (const_int 1)))] - "TARGET_SSE" - "cmp%D3ss\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "SF")]) - -(define_insn "vmmaskncmpv4sf3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_merge:V4SI - (not:V4SI - (match_operator:V4SI 3 "sse_comparison_operator" - [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "register_operand" "x")])) - (subreg:V4SI (match_dup 1) 0) - (const_int 1)))] - "TARGET_SSE" -{ - if (GET_CODE (operands[3]) == UNORDERED) - return "cmpordss\t{%2, %0|%0, %2}"; - else - return "cmpn%D3ss\t{%2, %0|%0, %2}"; -} - [(set_attr "type" "ssecmp") - (set_attr "mode" "SF")]) - -(define_insn "sse_comi" - [(set (reg:CCFP 17) - (compare:CCFP (vec_select:SF - (match_operand:V4SF 0 "register_operand" "x") - (parallel [(const_int 0)])) - (vec_select:SF - (match_operand:V4SF 1 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE" - "comiss\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecomi") - (set_attr "mode" "SF")]) - -(define_insn "sse_ucomi" - [(set (reg:CCFPU 17) - (compare:CCFPU (vec_select:SF - (match_operand:V4SF 0 "register_operand" "x") - (parallel [(const_int 0)])) - (vec_select:SF - (match_operand:V4SF 1 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE" - "ucomiss\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecomi") - (set_attr "mode" "SF")]) - - -;; SSE unpack - -(define_insn "sse_unpckhps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (vec_select:V4SF (match_operand:V4SF 1 "register_operand" "0") - (parallel [(const_int 2) - (const_int 0) - (const_int 3) - (const_int 1)])) - (vec_select:V4SF (match_operand:V4SF 2 "register_operand" "x") - (parallel [(const_int 0) - (const_int 2) - (const_int 1) - (const_int 3)])) - (const_int 5)))] - "TARGET_SSE" - "unpckhps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "sse_unpcklps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (vec_select:V4SF (match_operand:V4SF 1 "register_operand" "0") - (parallel [(const_int 0) - (const_int 2) - (const_int 1) - (const_int 3)])) - (vec_select:V4SF (match_operand:V4SF 2 "register_operand" "x") - (parallel [(const_int 2) - (const_int 0) - (const_int 3) - (const_int 1)])) - (const_int 5)))] - "TARGET_SSE" - "unpcklps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - - -;; SSE min/max - -(define_insn "smaxv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (smax:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "maxps\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "vmsmaxv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (smax:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "maxss\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -(define_insn "sminv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (smin:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE" - "minps\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "vmsminv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (smin:V4SF (match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE" - "minss\t{%2, %0|%0, %2}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -;; SSE <-> integer/MMX conversions - -(define_insn "cvtpi2ps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0") - (vec_duplicate:V4SF - (float:V2SF (match_operand:V2SI 2 "nonimmediate_operand" "ym"))) - (const_int 12)))] - "TARGET_SSE" - "cvtpi2ps\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "cvtps2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (vec_select:V2SI - (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")) - (parallel [(const_int 0) (const_int 1)])))] - "TARGET_SSE" - "cvtps2pi\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "cvttps2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (vec_select:V2SI - (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] - UNSPEC_FIX) - (parallel [(const_int 0) (const_int 1)])))] - "TARGET_SSE" - "cvttps2pi\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "SF")]) - -(define_insn "cvtsi2ss" - [(set (match_operand:V4SF 0 "register_operand" "=x,x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0,0") - (vec_duplicate:V4SF - (float:SF (match_operand:SI 2 "nonimmediate_operand" "r,rm"))) - (const_int 14)))] - "TARGET_SSE" - "cvtsi2ss\t{%2, %0|%0, %2}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "vector,double") - (set_attr "mode" "SF")]) - -(define_insn "cvtsi2ssq" - [(set (match_operand:V4SF 0 "register_operand" "=x,x") - (vec_merge:V4SF - (match_operand:V4SF 1 "register_operand" "0,0") - (vec_duplicate:V4SF - (float:SF (match_operand:DI 2 "nonimmediate_operand" "r,rm"))) - (const_int 14)))] - "TARGET_SSE && TARGET_64BIT" - "cvtsi2ssq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "vector,double") - (set_attr "mode" "SF")]) - -(define_insn "cvtss2si" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (vec_select:SI - (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "x,m")) - (parallel [(const_int 0)])))] - "TARGET_SSE" - "cvtss2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "double,vector") - (set_attr "mode" "SI")]) - -(define_insn "cvtss2siq" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (vec_select:DI - (fix:V4DI (match_operand:V4SF 1 "nonimmediate_operand" "x,m")) - (parallel [(const_int 0)])))] - "TARGET_SSE" - "cvtss2siq\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "double,vector") - (set_attr "mode" "DI")]) - -(define_insn "cvttss2si" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (vec_select:SI - (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "x,xm")] - UNSPEC_FIX) - (parallel [(const_int 0)])))] - "TARGET_SSE" - "cvttss2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "SF") - (set_attr "athlon_decode" "double,vector")]) - -(define_insn "cvttss2siq" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (vec_select:DI - (unspec:V4DI [(match_operand:V4SF 1 "nonimmediate_operand" "x,xm")] - UNSPEC_FIX) - (parallel [(const_int 0)])))] - "TARGET_SSE && TARGET_64BIT" - "cvttss2siq\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "SF") - (set_attr "athlon_decode" "double,vector")]) - - -;; MMX insns - -;; MMX arithmetic - -(define_insn "addv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (plus:V8QI (match_operand:V8QI 1 "register_operand" "%0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "addv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (plus:V4HI (match_operand:V4HI 1 "register_operand" "%0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "addv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (plus:V2SI (match_operand:V2SI 1 "register_operand" "%0") - (match_operand:V2SI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "mmx_adddi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(plus:DI (match_operand:DI 1 "register_operand" "%0") - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "paddq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "ssaddv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (ss_plus:V8QI (match_operand:V8QI 1 "register_operand" "%0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddsb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "ssaddv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (ss_plus:V4HI (match_operand:V4HI 1 "register_operand" "%0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddsw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "usaddv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (us_plus:V8QI (match_operand:V8QI 1 "register_operand" "%0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddusb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "usaddv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (us_plus:V4HI (match_operand:V4HI 1 "register_operand" "%0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "paddusw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "subv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (minus:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "subv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (minus:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "subv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (minus:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:V2SI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "mmx_subdi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(minus:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "psubq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "sssubv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (ss_minus:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubsb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "sssubv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (ss_minus:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubsw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "ussubv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (us_minus:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubusb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "ussubv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (us_minus:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "psubusw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "mulv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (mult:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pmullw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "DI")]) - -(define_insn "smulv4hi3_highpart" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (truncate:V4HI - (lshiftrt:V4SI - (mult:V4SI (sign_extend:V4SI - (match_operand:V4HI 1 "register_operand" "0")) - (sign_extend:V4SI - (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) - (const_int 16))))] - "TARGET_MMX" - "pmulhw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "DI")]) - -(define_insn "umulv4hi3_highpart" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (truncate:V4HI - (lshiftrt:V4SI - (mult:V4SI (zero_extend:V4SI - (match_operand:V4HI 1 "register_operand" "0")) - (zero_extend:V4SI - (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) - (const_int 16))))] - "TARGET_SSE || TARGET_3DNOW_A" - "pmulhuw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "DI")]) - -(define_insn "mmx_pmaddwd" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (plus:V2SI - (mult:V2SI - (sign_extend:V2SI - (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "0") - (parallel [(const_int 0) (const_int 2)]))) - (sign_extend:V2SI - (vec_select:V2HI (match_operand:V4HI 2 "nonimmediate_operand" "ym") - (parallel [(const_int 0) (const_int 2)])))) - (mult:V2SI - (sign_extend:V2SI (vec_select:V2HI (match_dup 1) - (parallel [(const_int 1) - (const_int 3)]))) - (sign_extend:V2SI (vec_select:V2HI (match_dup 2) - (parallel [(const_int 1) - (const_int 3)]))))))] - "TARGET_MMX" - "pmaddwd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "DI")]) - - -;; MMX logical operations -;; Note we don't want to declare these as regular iordi3 insns to prevent -;; normal code that also wants to use the FPU from getting broken. -;; The UNSPECs are there to prevent the combiner from getting overly clever. -(define_insn "mmx_iordi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(ior:DI (match_operand:DI 1 "register_operand" "%0") - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "por\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "mmx_xordi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(xor:DI (match_operand:DI 1 "register_operand" "%0") - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "pxor\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI") - (set_attr "memory" "none")]) - -;; Same as pxor, but don't show input operands so that we don't think -;; they are live. -(define_insn "mmx_clrdi" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI [(const_int 0)] UNSPEC_NOP))] - "TARGET_MMX" - "pxor\t{%0, %0|%0, %0}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI") - (set_attr "memory" "none")]) - -(define_insn "mmx_anddi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(and:DI (match_operand:DI 1 "register_operand" "%0") - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "pand\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "mmx_nanddi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(and:DI (not:DI (match_operand:DI 1 "register_operand" "0")) - (match_operand:DI 2 "nonimmediate_operand" "ym"))] - UNSPEC_NOP))] - "TARGET_MMX" - "pandn\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - - -;; MMX unsigned averages/sum of absolute differences - -(define_insn "mmx_uavgv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (ashiftrt:V8QI - (plus:V8QI (plus:V8QI - (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")) - (const_vector:V8QI [(const_int 1) - (const_int 1) - (const_int 1) - (const_int 1) - (const_int 1) - (const_int 1) - (const_int 1) - (const_int 1)])) - (const_int 1)))] - "TARGET_SSE || TARGET_3DNOW_A" - "pavgb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "mmx_uavgv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (ashiftrt:V4HI - (plus:V4HI (plus:V4HI - (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")) - (const_vector:V4HI [(const_int 1) - (const_int 1) - (const_int 1) - (const_int 1)])) - (const_int 1)))] - "TARGET_SSE || TARGET_3DNOW_A" - "pavgw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "mmx_psadbw" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI [(match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")] - UNSPEC_PSADBW))] - "TARGET_SSE || TARGET_3DNOW_A" - "psadbw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - - -;; MMX insert/extract/shuffle - -(define_insn "mmx_pinsrw" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (vec_merge:V4HI (match_operand:V4HI 1 "register_operand" "0") - (vec_duplicate:V4HI - (truncate:HI (match_operand:SI 2 "nonimmediate_operand" "rm"))) - (match_operand:SI 3 "const_0_to_15_operand" "N")))] - "TARGET_SSE || TARGET_3DNOW_A" - "pinsrw\t{%3, %2, %0|%0, %2, %3}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_pextrw" - [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y") - (parallel - [(match_operand:SI 2 "const_0_to_3_operand" "N")]))))] - "TARGET_SSE || TARGET_3DNOW_A" - "pextrw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_pshufw" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "0") - (match_operand:SI 2 "immediate_operand" "i")] - UNSPEC_SHUFFLE))] - "TARGET_SSE || TARGET_3DNOW_A" - "pshufw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - - -;; MMX mask-generating comparisons - -(define_insn "eqv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (eq:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpeqb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - -(define_insn "eqv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (eq:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpeqw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - -(define_insn "eqv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (eq:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:V2SI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpeqd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - -(define_insn "gtv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (gt:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpgtb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - -(define_insn "gtv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (gt:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpgtw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - -(define_insn "gtv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (gt:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:V2SI 2 "nonimmediate_operand" "ym")))] - "TARGET_MMX" - "pcmpgtd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "DI")]) - - -;; MMX max/min insns - -(define_insn "umaxv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (umax:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_SSE || TARGET_3DNOW_A" - "pmaxub\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "smaxv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (smax:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_SSE || TARGET_3DNOW_A" - "pmaxsw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "uminv8qi3" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (umin:V8QI (match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] - "TARGET_SSE || TARGET_3DNOW_A" - "pminub\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - -(define_insn "sminv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (smin:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] - "TARGET_SSE || TARGET_3DNOW_A" - "pminsw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "DI")]) - - -;; MMX shifts - -(define_insn "ashrv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (ashiftrt:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "psraw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "ashrv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (ashiftrt:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "psrad\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "lshrv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (lshiftrt:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "psrlw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "lshrv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (lshiftrt:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "psrld\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -;; See logical MMX insns. -(define_insn "mmx_lshrdi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(lshiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi"))] - UNSPEC_NOP))] - "TARGET_MMX" - "psrlq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "ashlv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (ashift:V4HI (match_operand:V4HI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "psllw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "ashlv2si3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (ashift:V2SI (match_operand:V2SI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi")))] - "TARGET_MMX" - "pslld\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -;; See logical MMX insns. -(define_insn "mmx_ashldi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (unspec:DI - [(ashift:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:DI 2 "nonmemory_operand" "yi"))] - UNSPEC_NOP))] - "TARGET_MMX" - "psllq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - - -;; MMX pack/unpack insns. - -(define_insn "mmx_packsswb" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (vec_concat:V8QI - (ss_truncate:V4QI (match_operand:V4HI 1 "register_operand" "0")) - (ss_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))] - "TARGET_MMX" - "packsswb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "mmx_packssdw" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (vec_concat:V4HI - (ss_truncate:V2HI (match_operand:V2SI 1 "register_operand" "0")) - (ss_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))] - "TARGET_MMX" - "packssdw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "mmx_packuswb" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (vec_concat:V8QI - (us_truncate:V4QI (match_operand:V4HI 1 "register_operand" "0")) - (us_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))] - "TARGET_MMX" - "packuswb\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpckhbw" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (vec_merge:V8QI - (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "0") - (parallel [(const_int 4) - (const_int 0) - (const_int 5) - (const_int 1) - (const_int 6) - (const_int 2) - (const_int 7) - (const_int 3)])) - (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y") - (parallel [(const_int 0) - (const_int 4) - (const_int 1) - (const_int 5) - (const_int 2) - (const_int 6) - (const_int 3) - (const_int 7)])) - (const_int 85)))] - "TARGET_MMX" - "punpckhbw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpckhwd" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (vec_merge:V4HI - (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "0") - (parallel [(const_int 0) - (const_int 2) - (const_int 1) - (const_int 3)])) - (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y") - (parallel [(const_int 2) - (const_int 0) - (const_int 3) - (const_int 1)])) - (const_int 5)))] - "TARGET_MMX" - "punpckhwd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpckhdq" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (vec_merge:V2SI - (match_operand:V2SI 1 "register_operand" "0") - (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y") - (parallel [(const_int 1) - (const_int 0)])) - (const_int 1)))] - "TARGET_MMX" - "punpckhdq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpcklbw" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (vec_merge:V8QI - (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "0") - (parallel [(const_int 0) - (const_int 4) - (const_int 1) - (const_int 5) - (const_int 2) - (const_int 6) - (const_int 3) - (const_int 7)])) - (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y") - (parallel [(const_int 4) - (const_int 0) - (const_int 5) - (const_int 1) - (const_int 6) - (const_int 2) - (const_int 7) - (const_int 3)])) - (const_int 85)))] - "TARGET_MMX" - "punpcklbw\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpcklwd" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (vec_merge:V4HI - (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "0") - (parallel [(const_int 2) - (const_int 0) - (const_int 3) - (const_int 1)])) - (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y") - (parallel [(const_int 0) - (const_int 2) - (const_int 1) - (const_int 3)])) - (const_int 5)))] - "TARGET_MMX" - "punpcklwd\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - -(define_insn "mmx_punpckldq" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (vec_merge:V2SI - (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "0") - (parallel [(const_int 1) - (const_int 0)])) - (match_operand:V2SI 2 "register_operand" "y") - (const_int 1)))] - "TARGET_MMX" - "punpckldq\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "DI")]) - - -;; Miscellaneous stuff - -(define_insn "emms" - [(unspec_volatile [(const_int 0)] UNSPECV_EMMS) - (clobber (reg:XF 8)) - (clobber (reg:XF 9)) - (clobber (reg:XF 10)) - (clobber (reg:XF 11)) - (clobber (reg:XF 12)) - (clobber (reg:XF 13)) - (clobber (reg:XF 14)) - (clobber (reg:XF 15)) - (clobber (reg:DI 29)) - (clobber (reg:DI 30)) - (clobber (reg:DI 31)) - (clobber (reg:DI 32)) - (clobber (reg:DI 33)) - (clobber (reg:DI 34)) - (clobber (reg:DI 35)) - (clobber (reg:DI 36))] - "TARGET_MMX" - "emms" - [(set_attr "type" "mmx") - (set_attr "memory" "unknown")]) - -(define_insn "ldmxcsr" - [(unspec_volatile [(match_operand:SI 0 "memory_operand" "m")] - UNSPECV_LDMXCSR)] - "TARGET_SSE" - "ldmxcsr\t%0" - [(set_attr "type" "sse") - (set_attr "memory" "load")]) - -(define_insn "stmxcsr" - [(set (match_operand:SI 0 "memory_operand" "=m") - (unspec_volatile:SI [(const_int 0)] UNSPECV_STMXCSR))] - "TARGET_SSE" - "stmxcsr\t%0" - [(set_attr "type" "sse") - (set_attr "memory" "store")]) - -(define_expand "sfence" - [(set (match_dup 0) - (unspec:BLK [(match_dup 0)] UNSPEC_SFENCE))] - "TARGET_SSE || TARGET_3DNOW_A" -{ - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); - MEM_VOLATILE_P (operands[0]) = 1; -}) - -(define_insn "*sfence_insn" - [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_dup 0)] UNSPEC_SFENCE))] - "TARGET_SSE || TARGET_3DNOW_A" - "sfence" - [(set_attr "type" "sse") - (set_attr "memory" "unknown")]) + { return ASM_SHORT "0x0b0f"; } + [(set_attr "length" "2")]) (define_expand "sse_prologue_save" [(parallel [(set (match_operand:BLK 0 "" "") @@ -20919,311 +20718,6 @@ (set_attr "modrm" "0") (set_attr "mode" "DI")]) -;; 3Dnow! instructions - -(define_insn "addv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (plus:V2SF (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfadd\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "subv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (minus:V2SF (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfsub\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "subrv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (minus:V2SF (match_operand:V2SF 2 "nonimmediate_operand" "ym") - (match_operand:V2SF 1 "register_operand" "0")))] - "TARGET_3DNOW" - "pfsubr\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "gtv2sf3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (gt:V2SI (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfcmpgt\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "V2SF")]) - -(define_insn "gev2sf3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (ge:V2SI (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfcmpge\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "V2SF")]) - -(define_insn "eqv2sf3" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (eq:V2SI (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfcmpeq\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxcmp") - (set_attr "mode" "V2SF")]) - -(define_insn "pfmaxv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (smax:V2SF (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfmax\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "pfminv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (smin:V2SF (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfmin\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "mulv2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (mult:V2SF (match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pfmul\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "V2SF")]) - -(define_insn "femms" - [(unspec_volatile [(const_int 0)] UNSPECV_FEMMS) - (clobber (reg:XF 8)) - (clobber (reg:XF 9)) - (clobber (reg:XF 10)) - (clobber (reg:XF 11)) - (clobber (reg:XF 12)) - (clobber (reg:XF 13)) - (clobber (reg:XF 14)) - (clobber (reg:XF 15)) - (clobber (reg:DI 29)) - (clobber (reg:DI 30)) - (clobber (reg:DI 31)) - (clobber (reg:DI 32)) - (clobber (reg:DI 33)) - (clobber (reg:DI 34)) - (clobber (reg:DI 35)) - (clobber (reg:DI 36))] - "TARGET_3DNOW" - "femms" - [(set_attr "type" "mmx") - (set_attr "memory" "none")]) - -(define_insn "pf2id" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (fix:V2SI (match_operand:V2SF 1 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pf2id\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "V2SF")]) - -(define_insn "pf2iw" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (sign_extend:V2SI - (ss_truncate:V2HI - (fix:V2SI (match_operand:V2SF 1 "nonimmediate_operand" "ym")))))] - "TARGET_3DNOW_A" - "pf2iw\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "V2SF")]) - -(define_insn "pfacc" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (vec_concat:V2SF - (plus:SF - (vec_select:SF (match_operand:V2SF 1 "register_operand" "0") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 1) - (parallel [(const_int 1)]))) - (plus:SF - (vec_select:SF (match_operand:V2SF 2 "nonimmediate_operand" "y") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 2) - (parallel [(const_int 1)])))))] - "TARGET_3DNOW" - "pfacc\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "pfnacc" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (vec_concat:V2SF - (minus:SF - (vec_select:SF (match_operand:V2SF 1 "register_operand" "0") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 1) - (parallel [(const_int 1)]))) - (minus:SF - (vec_select:SF (match_operand:V2SF 2 "nonimmediate_operand" "y") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 2) - (parallel [(const_int 1)])))))] - "TARGET_3DNOW_A" - "pfnacc\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "pfpnacc" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (vec_concat:V2SF - (minus:SF - (vec_select:SF (match_operand:V2SF 1 "register_operand" "0") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 1) - (parallel [(const_int 1)]))) - (plus:SF - (vec_select:SF (match_operand:V2SF 2 "nonimmediate_operand" "y") - (parallel [(const_int 0)])) - (vec_select:SF (match_dup 2) - (parallel [(const_int 1)])))))] - "TARGET_3DNOW_A" - "pfpnacc\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxadd") - (set_attr "mode" "V2SF")]) - -(define_insn "pi2fw" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (float:V2SF - (vec_concat:V2SI - (sign_extend:SI - (truncate:HI - (vec_select:SI (match_operand:V2SI 1 "nonimmediate_operand" "ym") - (parallel [(const_int 0)])))) - (sign_extend:SI - (truncate:HI - (vec_select:SI (match_dup 1) - (parallel [(const_int 1)])))))))] - "TARGET_3DNOW_A" - "pi2fw\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "V2SF")]) - -(define_insn "floatv2si2" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (float:V2SF (match_operand:V2SI 1 "nonimmediate_operand" "ym")))] - "TARGET_3DNOW" - "pi2fd\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "V2SF")]) - -;; This insn is identical to pavgb in operation, but the opcode is -;; different. To avoid accidentally matching pavgb, use an unspec. - -(define_insn "pavgusb" - [(set (match_operand:V8QI 0 "register_operand" "=y") - (unspec:V8QI - [(match_operand:V8QI 1 "register_operand" "0") - (match_operand:V8QI 2 "nonimmediate_operand" "ym")] - UNSPEC_PAVGUSB))] - "TARGET_3DNOW" - "pavgusb\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxshft") - (set_attr "mode" "TI")]) - -;; 3DNow reciprocal and sqrt - -(define_insn "pfrcpv2sf2" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (unspec:V2SF [(match_operand:V2SF 1 "nonimmediate_operand" "ym")] - UNSPEC_PFRCP))] - "TARGET_3DNOW" - "pfrcp\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmx") - (set_attr "mode" "TI")]) - -(define_insn "pfrcpit1v2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")] - UNSPEC_PFRCPIT1))] - "TARGET_3DNOW" - "pfrcpit1\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmx") - (set_attr "mode" "TI")]) - -(define_insn "pfrcpit2v2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")] - UNSPEC_PFRCPIT2))] - "TARGET_3DNOW" - "pfrcpit2\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmx") - (set_attr "mode" "TI")]) - -(define_insn "pfrsqrtv2sf2" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (unspec:V2SF [(match_operand:V2SF 1 "nonimmediate_operand" "ym")] - UNSPEC_PFRSQRT))] - "TARGET_3DNOW" - "pfrsqrt\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmx") - (set_attr "mode" "TI")]) - -(define_insn "pfrsqit1v2sf3" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") - (match_operand:V2SF 2 "nonimmediate_operand" "ym")] - UNSPEC_PFRSQIT1))] - "TARGET_3DNOW" - "pfrsqit1\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmx") - (set_attr "mode" "TI")]) - -(define_insn "pmulhrwv4hi3" - [(set (match_operand:V4HI 0 "register_operand" "=y") - (truncate:V4HI - (lshiftrt:V4SI - (plus:V4SI - (mult:V4SI - (sign_extend:V4SI - (match_operand:V4HI 1 "register_operand" "0")) - (sign_extend:V4SI - (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) - (const_vector:V4SI [(const_int 32768) - (const_int 32768) - (const_int 32768) - (const_int 32768)])) - (const_int 16))))] - "TARGET_3DNOW" - "pmulhrw\\t{%2, %0|%0, %2}" - [(set_attr "type" "mmxmul") - (set_attr "mode" "TI")]) - -(define_insn "pswapdv2si2" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (vec_select:V2SI (match_operand:V2SI 1 "nonimmediate_operand" "ym") - (parallel [(const_int 1) (const_int 0)])))] - "TARGET_3DNOW_A" - "pswapd\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "TI")]) - -(define_insn "pswapdv2sf2" - [(set (match_operand:V2SF 0 "register_operand" "=y") - (vec_select:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "ym") - (parallel [(const_int 1) (const_int 0)])))] - "TARGET_3DNOW_A" - "pswapd\\t{%1, %0|%0, %1}" - [(set_attr "type" "mmxcvt") - (set_attr "mode" "TI")]) - (define_expand "prefetch" [(prefetch (match_operand 0 "address_operand" "") (match_operand:SI 1 "const_int_operand" "") @@ -21233,15 +20727,13 @@ int rw = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (rw != 0 && rw != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); - if (GET_MODE (operands[0]) != Pmode && GET_MODE (operands[0]) != VOIDmode) - abort (); + gcc_assert (rw == 0 || rw == 1); + gcc_assert (locality >= 0 && locality <= 3); + gcc_assert (GET_MODE (operands[0]) == Pmode + || GET_MODE (operands[0]) == VOIDmode); /* Use 3dNOW prefetch in case we are asking for write prefetch not - suported by SSE counterpart or the SSE prefetch is not available + supported by SSE counterpart or the SSE prefetch is not available (K6 machines). Otherwise use SSE prefetch as it allows specifying of locality. */ if (TARGET_3DNOW && (!TARGET_PREFETCH_SSE || rw)) @@ -21261,8 +20753,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } @@ -21280,8 +20771,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } @@ -21316,1706 +20806,147 @@ [(set_attr "type" "mmx") (set_attr "memory" "none")]) -;; SSE2 support - -(define_insn "addv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (plus:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "addpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "vmaddv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (plus:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "addsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) - -(define_insn "subv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (minus:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "subpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "vmsubv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (minus:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "subsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) - -(define_insn "mulv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (mult:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "mulpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssemul") - (set_attr "mode" "V2DF")]) - -(define_insn "vmmulv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (mult:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "mulsd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssemul") - (set_attr "mode" "DF")]) - -(define_insn "divv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (div:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "divpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssediv") - (set_attr "mode" "V2DF")]) - -(define_insn "vmdivv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (div:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "divsd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssediv") - (set_attr "mode" "DF")]) - -;; SSE min/max - -(define_insn "smaxv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (smax:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "maxpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "vmsmaxv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (smax:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "maxsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) - -(define_insn "sminv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (smin:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "minpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "vmsminv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (smin:V2DF (match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (const_int 1)))] - "TARGET_SSE2" - "minsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) -;; SSE2 square root. There doesn't appear to be an extension for the -;; reciprocal/rsqrt instructions if the Intel manual is to be believed. - -(define_insn "sqrtv2df2" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (sqrt:V2DF (match_operand:V2DF 1 "register_operand" "xm")))] - "TARGET_SSE2" - "sqrtpd\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V2DF")]) - -(define_insn "vmsqrtv2df2" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (sqrt:V2DF (match_operand:V2DF 1 "register_operand" "xm")) - (match_operand:V2DF 2 "register_operand" "0") - (const_int 1)))] - "TARGET_SSE2" - "sqrtsd\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "SF")]) - -;; SSE mask-generating compares - -(define_insn "maskcmpv2df3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (match_operator:V2DI 3 "sse_comparison_operator" - [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "x")]))] - "TARGET_SSE2" - "cmp%D3pd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "V2DF")]) - -(define_insn "maskncmpv2df3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (not:V2DI - (match_operator:V2DI 3 "sse_comparison_operator" - [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "x")])))] - "TARGET_SSE2" +(define_expand "stack_protect_set" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "")] + "" { - if (GET_CODE (operands[3]) == UNORDERED) - return "cmpordps\t{%2, %0|%0, %2}"; +#ifdef TARGET_THREAD_SSP_OFFSET + if (TARGET_64BIT) + emit_insn (gen_stack_tls_protect_set_di (operands[0], + GEN_INT (TARGET_THREAD_SSP_OFFSET))); else - return "cmpn%D3pd\t{%2, %0|%0, %2}"; -} - [(set_attr "type" "ssecmp") - (set_attr "mode" "V2DF")]) - -(define_insn "vmmaskcmpv2df3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (vec_merge:V2DI - (match_operator:V2DI 3 "sse_comparison_operator" - [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "x")]) - (subreg:V2DI (match_dup 1) 0) - (const_int 1)))] - "TARGET_SSE2" - "cmp%D3sd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "DF")]) - -(define_insn "vmmaskncmpv2df3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (vec_merge:V2DI - (not:V2DI - (match_operator:V2DI 3 "sse_comparison_operator" - [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "x")])) - (subreg:V2DI (match_dup 1) 0) - (const_int 1)))] - "TARGET_SSE2" -{ - if (GET_CODE (operands[3]) == UNORDERED) - return "cmpordsd\t{%2, %0|%0, %2}"; + emit_insn (gen_stack_tls_protect_set_si (operands[0], + GEN_INT (TARGET_THREAD_SSP_OFFSET))); +#else + if (TARGET_64BIT) + emit_insn (gen_stack_protect_set_di (operands[0], operands[1])); else - return "cmpn%D3sd\t{%2, %0|%0, %2}"; -} - [(set_attr "type" "ssecmp") - (set_attr "mode" "DF")]) - -(define_insn "sse2_comi" - [(set (reg:CCFP 17) - (compare:CCFP (vec_select:DF - (match_operand:V2DF 0 "register_operand" "x") - (parallel [(const_int 0)])) - (vec_select:DF - (match_operand:V2DF 1 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE2" - "comisd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecomi") - (set_attr "mode" "DF")]) - -(define_insn "sse2_ucomi" - [(set (reg:CCFPU 17) - (compare:CCFPU (vec_select:DF - (match_operand:V2DF 0 "register_operand" "x") - (parallel [(const_int 0)])) - (vec_select:DF - (match_operand:V2DF 1 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE2" - "ucomisd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecomi") - (set_attr "mode" "DF")]) - -;; SSE Strange Moves. - -(define_insn "sse2_movmskpd" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:V2DF 1 "register_operand" "x")] - UNSPEC_MOVMSK))] - "TARGET_SSE2" - "movmskpd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_pmovmskb" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:V16QI 1 "register_operand" "x")] - UNSPEC_MOVMSK))] - "TARGET_SSE2" - "pmovmskb\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_maskmovdqu" - [(set (mem:V16QI (match_operand:SI 0 "register_operand" "D")) - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x") - (match_operand:V16QI 2 "register_operand" "x")] - UNSPEC_MASKMOV))] - "TARGET_SSE2" - ;; @@@ check ordering of operands in intel/nonintel syntax - "maskmovdqu\t{%2, %1|%1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_maskmovdqu_rex64" - [(set (mem:V16QI (match_operand:DI 0 "register_operand" "D")) - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x") - (match_operand:V16QI 2 "register_operand" "x")] - UNSPEC_MASKMOV))] - "TARGET_SSE2" - ;; @@@ check ordering of operands in intel/nonintel syntax - "maskmovdqu\t{%2, %1|%1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movntv2df" - [(set (match_operand:V2DF 0 "memory_operand" "=m") - (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "x")] - UNSPEC_MOVNT))] - "TARGET_SSE2" - "movntpd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_movntv2di" - [(set (match_operand:V2DI 0 "memory_operand" "=m") - (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")] - UNSPEC_MOVNT))] - "TARGET_SSE2" - "movntdq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movntsi" - [(set (match_operand:SI 0 "memory_operand" "=m") - (unspec:SI [(match_operand:SI 1 "register_operand" "r")] - UNSPEC_MOVNT))] - "TARGET_SSE2" - "movnti\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -;; SSE <-> integer/MMX conversions - -;; Conversions between SI and SF - -(define_insn "cvtdq2ps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (float:V4SF (match_operand:V4SI 1 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "cvtdq2ps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "cvtps2dq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "cvtps2dq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "cvttps2dq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] - UNSPEC_FIX))] - "TARGET_SSE2" - "cvttps2dq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -;; Conversions between SI and DF - -(define_insn "cvtdq2pd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (float:V2DF (vec_select:V2SI - (match_operand:V4SI 1 "nonimmediate_operand" "xm") - (parallel - [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE2" - "cvtdq2pd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "cvtpd2dq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_concat:V4SI - (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "xm")) - (const_vector:V2SI [(const_int 0) (const_int 0)])))] - "TARGET_SSE2" - "cvtpd2dq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "cvttpd2dq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_concat:V4SI - (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "xm")] - UNSPEC_FIX) - (const_vector:V2SI [(const_int 0) (const_int 0)])))] - "TARGET_SSE2" - "cvttpd2dq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "cvtpd2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "cvtpd2pi\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "cvttpd2pi" - [(set (match_operand:V2SI 0 "register_operand" "=y") - (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "xm")] - UNSPEC_FIX))] - "TARGET_SSE2" - "cvttpd2pi\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "cvtpi2pd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (float:V2DF (match_operand:V2SI 1 "nonimmediate_operand" "ym")))] - "TARGET_SSE2" - "cvtpi2pd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -;; Conversions between SI and DF - -(define_insn "cvtsd2si" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (fix:SI (vec_select:DF (match_operand:V2DF 1 "register_operand" "x,m") - (parallel [(const_int 0)]))))] - "TARGET_SSE2" - "cvtsd2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "double,vector") - (set_attr "mode" "SI")]) - -(define_insn "cvtsd2siq" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (fix:DI (vec_select:DF (match_operand:V2DF 1 "register_operand" "x,m") - (parallel [(const_int 0)]))))] - "TARGET_SSE2 && TARGET_64BIT" - "cvtsd2siq\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "athlon_decode" "double,vector") - (set_attr "mode" "DI")]) - -(define_insn "cvttsd2si" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (unspec:SI [(vec_select:DF (match_operand:V2DF 1 "register_operand" "x,xm") - (parallel [(const_int 0)]))] UNSPEC_FIX))] - "TARGET_SSE2" - "cvttsd2si\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "SI") - (set_attr "athlon_decode" "double,vector")]) - -(define_insn "cvttsd2siq" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (unspec:DI [(vec_select:DF (match_operand:V2DF 1 "register_operand" "x,xm") - (parallel [(const_int 0)]))] UNSPEC_FIX))] - "TARGET_SSE2 && TARGET_64BIT" - "cvttsd2siq\t{%1, %0|%0, %1}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "DI") - (set_attr "athlon_decode" "double,vector")]) - -(define_insn "cvtsi2sd" - [(set (match_operand:V2DF 0 "register_operand" "=x,x") - (vec_merge:V2DF (match_operand:V2DF 1 "register_operand" "0,0") - (vec_duplicate:V2DF - (float:DF - (match_operand:SI 2 "nonimmediate_operand" "r,rm"))) - (const_int 2)))] - "TARGET_SSE2" - "cvtsi2sd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "DF") - (set_attr "athlon_decode" "double,direct")]) - -(define_insn "cvtsi2sdq" - [(set (match_operand:V2DF 0 "register_operand" "=x,x") - (vec_merge:V2DF (match_operand:V2DF 1 "register_operand" "0,0") - (vec_duplicate:V2DF - (float:DF - (match_operand:DI 2 "nonimmediate_operand" "r,rm"))) - (const_int 2)))] - "TARGET_SSE2 && TARGET_64BIT" - "cvtsi2sdq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseicvt") - (set_attr "mode" "DF") - (set_attr "athlon_decode" "double,direct")]) - -;; Conversions between SF and DF - -(define_insn "cvtsd2ss" - [(set (match_operand:V4SF 0 "register_operand" "=x,x") - (vec_merge:V4SF (match_operand:V4SF 1 "register_operand" "0,0") - (vec_duplicate:V4SF - (float_truncate:V2SF - (match_operand:V2DF 2 "nonimmediate_operand" "x,xm"))) - (const_int 14)))] - "TARGET_SSE2" - "cvtsd2ss\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "athlon_decode" "vector,double") - (set_attr "mode" "SF")]) - -(define_insn "cvtss2sd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF (match_operand:V2DF 1 "register_operand" "0") - (float_extend:V2DF - (vec_select:V2SF - (match_operand:V4SF 2 "nonimmediate_operand" "xm") - (parallel [(const_int 0) - (const_int 1)]))) - (const_int 2)))] - "TARGET_SSE2" - "cvtss2sd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) - -(define_insn "cvtpd2ps" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (subreg:V4SF - (vec_concat:V4SI - (subreg:V2SI (float_truncate:V2SF - (match_operand:V2DF 1 "nonimmediate_operand" "xm")) 0) - (const_vector:V2SI [(const_int 0) (const_int 0)])) 0))] - "TARGET_SSE2" - "cvtpd2ps\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V4SF")]) - -(define_insn "cvtps2pd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (float_extend:V2DF - (vec_select:V2SF (match_operand:V4SF 1 "nonimmediate_operand" "xm") - (parallel [(const_int 0) - (const_int 1)]))))] - "TARGET_SSE2" - "cvtps2pd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -;; SSE2 variants of MMX insns - -;; MMX arithmetic - -(define_insn "addv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (plus:V16QI (match_operand:V16QI 1 "register_operand" "%0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "addv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (plus:V8HI (match_operand:V8HI 1 "register_operand" "%0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "addv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (plus:V4SI (match_operand:V4SI 1 "register_operand" "%0") - (match_operand:V4SI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "addv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (plus:V2DI (match_operand:V2DI 1 "register_operand" "%0") - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "ssaddv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (ss_plus:V16QI (match_operand:V16QI 1 "register_operand" "%0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddsb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "ssaddv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ss_plus:V8HI (match_operand:V8HI 1 "register_operand" "%0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddsw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "usaddv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (us_plus:V16QI (match_operand:V16QI 1 "register_operand" "%0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddusb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "usaddv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (us_plus:V8HI (match_operand:V8HI 1 "register_operand" "%0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "paddusw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "subv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (minus:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "subv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (minus:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "subv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (minus:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:V4SI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "subv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (minus:V2DI (match_operand:V2DI 1 "register_operand" "0") - (match_operand:V2DI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "sssubv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (ss_minus:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubsb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "sssubv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ss_minus:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubsw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "ussubv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (us_minus:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubusb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "ussubv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (us_minus:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "psubusw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "mulv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (mult:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pmullw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "mode" "TI")]) - -(define_insn "smulv8hi3_highpart" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (truncate:V8HI - (lshiftrt:V8SI - (mult:V8SI (sign_extend:V8SI (match_operand:V8HI 1 "register_operand" "0")) - (sign_extend:V8SI (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) - (const_int 16))))] - "TARGET_SSE2" - "pmulhw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "mode" "TI")]) - -(define_insn "umulv8hi3_highpart" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (truncate:V8HI - (lshiftrt:V8SI - (mult:V8SI (zero_extend:V8SI (match_operand:V8HI 1 "register_operand" "0")) - (zero_extend:V8SI (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) - (const_int 16))))] - "TARGET_SSE2" - "pmulhuw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "mode" "TI")]) - -(define_insn "sse2_umulsidi3" - [(set (match_operand:DI 0 "register_operand" "=y") - (mult:DI (zero_extend:DI (vec_select:SI - (match_operand:V2SI 1 "register_operand" "0") - (parallel [(const_int 0)]))) - (zero_extend:DI (vec_select:SI - (match_operand:V2SI 2 "nonimmediate_operand" "ym") - (parallel [(const_int 0)])))))] - "TARGET_SSE2" - "pmuludq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "mode" "TI")]) - -(define_insn "sse2_umulv2siv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (mult:V2DI (zero_extend:V2DI - (vec_select:V2SI - (match_operand:V4SI 1 "register_operand" "0") - (parallel [(const_int 0) (const_int 2)]))) - (zero_extend:V2DI - (vec_select:V2SI - (match_operand:V4SI 2 "nonimmediate_operand" "xm") - (parallel [(const_int 0) (const_int 2)])))))] - "TARGET_SSE2" - "pmuludq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseimul") - (set_attr "mode" "TI")]) - -(define_insn "sse2_pmaddwd" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (plus:V4SI - (mult:V4SI - (sign_extend:V4SI (vec_select:V4HI (match_operand:V8HI 1 "register_operand" "0") - (parallel [(const_int 0) - (const_int 2) - (const_int 4) - (const_int 6)]))) - (sign_extend:V4SI (vec_select:V4HI (match_operand:V8HI 2 "nonimmediate_operand" "xm") - (parallel [(const_int 0) - (const_int 2) - (const_int 4) - (const_int 6)])))) - (mult:V4SI - (sign_extend:V4SI (vec_select:V4HI (match_dup 1) - (parallel [(const_int 1) - (const_int 3) - (const_int 5) - (const_int 7)]))) - (sign_extend:V4SI (vec_select:V4HI (match_dup 2) - (parallel [(const_int 1) - (const_int 3) - (const_int 5) - (const_int 7)]))))))] - "TARGET_SSE2" - "pmaddwd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -;; Same as pxor, but don't show input operands so that we don't think -;; they are live. -(define_insn "sse2_clrti" - [(set (match_operand:TI 0 "register_operand" "=x") (const_int 0))] - "TARGET_SSE2" -{ - if (get_attr_mode (insn) == MODE_TI) - return "pxor\t%0, %0"; - else - return "xorps\t%0, %0"; -} - [(set_attr "type" "ssemov") - (set_attr "memory" "none") - (set (attr "mode") - (if_then_else - (ne (symbol_ref "optimize_size") - (const_int 0)) - (const_string "V4SF") - (const_string "TI")))]) - -;; MMX unsigned averages/sum of absolute differences - -(define_insn "sse2_uavgv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (ashiftrt:V16QI - (plus:V16QI (plus:V16QI - (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")) - (const_vector:V16QI [(const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1)])) - (const_int 1)))] - "TARGET_SSE2" - "pavgb\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "sse2_uavgv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ashiftrt:V8HI - (plus:V8HI (plus:V8HI - (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")) - (const_vector:V8HI [(const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1) - (const_int 1) (const_int 1)])) - (const_int 1)))] - "TARGET_SSE2" - "pavgw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -;; @@@ this isn't the right representation. -(define_insn "sse2_psadbw" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (unspec:V2DI [(match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")] - UNSPEC_PSADBW))] - "TARGET_SSE2" - "psadbw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - - -;; MMX insert/extract/shuffle - -(define_insn "sse2_pinsrw" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (vec_merge:V8HI (match_operand:V8HI 1 "register_operand" "0") - (vec_duplicate:V8HI - (truncate:HI - (match_operand:SI 2 "nonimmediate_operand" "rm"))) - (match_operand:SI 3 "const_0_to_255_operand" "N")))] - "TARGET_SSE2" - "pinsrw\t{%3, %2, %0|%0, %2, %3}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_pextrw" - [(set (match_operand:SI 0 "register_operand" "=r") - (zero_extend:SI - (vec_select:HI (match_operand:V8HI 1 "register_operand" "x") - (parallel - [(match_operand:SI 2 "const_0_to_7_operand" "N")]))))] - "TARGET_SSE2" - "pextrw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_pshufd" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0") - (match_operand:SI 2 "immediate_operand" "i")] - UNSPEC_SHUFFLE))] - "TARGET_SSE2" - "pshufd\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_pshuflw" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "0") - (match_operand:SI 2 "immediate_operand" "i")] - UNSPEC_PSHUFLW))] - "TARGET_SSE2" - "pshuflw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_pshufhw" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "0") - (match_operand:SI 2 "immediate_operand" "i")] - UNSPEC_PSHUFHW))] - "TARGET_SSE2" - "pshufhw\t{%2, %1, %0|%0, %1, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -;; MMX mask-generating comparisons - -(define_insn "eqv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (eq:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpeqb\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - -(define_insn "eqv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (eq:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpeqw\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - -(define_insn "eqv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (eq:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:V4SI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpeqd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - -(define_insn "gtv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (gt:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpgtb\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - -(define_insn "gtv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (gt:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpgtw\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - -(define_insn "gtv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (gt:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:V4SI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pcmpgtd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecmp") - (set_attr "mode" "TI")]) - - -;; MMX max/min insns - -(define_insn "umaxv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (umax:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pmaxub\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "smaxv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (smax:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pmaxsw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "uminv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (umin:V16QI (match_operand:V16QI 1 "register_operand" "0") - (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pminub\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - -(define_insn "sminv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (smin:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2" - "pminsw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseiadd") - (set_attr "mode" "TI")]) - - -;; MMX shifts - -(define_insn "ashrv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ashiftrt:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psraw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashrv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (ashiftrt:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psrad\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (lshiftrt:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psrlw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (lshiftrt:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psrld\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (lshiftrt:V2DI (match_operand:V2DI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psrlq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ashift:V8HI (match_operand:V8HI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psllw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (ashift:V4SI (match_operand:V4SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "pslld\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv2di3" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (ashift:V2DI (match_operand:V2DI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "xi")))] - "TARGET_SSE2" - "psllq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashrv8hi3_ti" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ashiftrt:V8HI (match_operand:V8HI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psraw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashrv4si3_ti" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (ashiftrt:V4SI (match_operand:V4SI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psrad\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv8hi3_ti" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (lshiftrt:V8HI (match_operand:V8HI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psrlw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv4si3_ti" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (lshiftrt:V4SI (match_operand:V4SI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psrld\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "lshrv2di3_ti" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (lshiftrt:V2DI (match_operand:V2DI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psrlq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv8hi3_ti" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (ashift:V8HI (match_operand:V8HI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psllw\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv4si3_ti" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (ashift:V4SI (match_operand:V4SI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "pslld\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "ashlv2di3_ti" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (ashift:V2DI (match_operand:V2DI 1 "register_operand" "0") - (subreg:SI (match_operand:V2DI 2 "nonmemory_operand" "xi") 0)))] - "TARGET_SSE2" - "psllq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -;; See logical MMX insns for the reason for the unspec. Strictly speaking -;; we wouldn't need here it since we never generate TImode arithmetic. - -;; There has to be some kind of prize for the weirdest new instruction... -(define_insn "sse2_ashlti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (unspec:TI - [(ashift:TI (match_operand:TI 1 "register_operand" "0") - (mult:SI (match_operand:SI 2 "immediate_operand" "i") - (const_int 8)))] UNSPEC_NOP))] - "TARGET_SSE2" - "pslldq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -(define_insn "sse2_lshrti3" - [(set (match_operand:TI 0 "register_operand" "=x") - (unspec:TI - [(lshiftrt:TI (match_operand:TI 1 "register_operand" "0") - (mult:SI (match_operand:SI 2 "immediate_operand" "i") - (const_int 8)))] UNSPEC_NOP))] - "TARGET_SSE2" - "psrldq\t{%2, %0|%0, %2}" - [(set_attr "type" "sseishft") - (set_attr "mode" "TI")]) - -;; SSE unpack - -(define_insn "sse2_unpckhpd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_concat:V2DF - (vec_select:DF (match_operand:V2DF 1 "register_operand" "0") - (parallel [(const_int 1)])) - (vec_select:DF (match_operand:V2DF 2 "register_operand" "x") - (parallel [(const_int 1)]))))] - "TARGET_SSE2" - "unpckhpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_unpcklpd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_concat:V2DF - (vec_select:DF (match_operand:V2DF 1 "register_operand" "0") - (parallel [(const_int 0)])) - (vec_select:DF (match_operand:V2DF 2 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE2" - "unpcklpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -;; MMX pack/unpack insns. - -(define_insn "sse2_packsswb" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (vec_concat:V16QI - (ss_truncate:V8QI (match_operand:V8HI 1 "register_operand" "0")) - (ss_truncate:V8QI (match_operand:V8HI 2 "register_operand" "x"))))] - "TARGET_SSE2" - "packsswb\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_packssdw" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (vec_concat:V8HI - (ss_truncate:V4HI (match_operand:V4SI 1 "register_operand" "0")) - (ss_truncate:V4HI (match_operand:V4SI 2 "register_operand" "x"))))] - "TARGET_SSE2" - "packssdw\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_packuswb" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (vec_concat:V16QI - (us_truncate:V8QI (match_operand:V8HI 1 "register_operand" "0")) - (us_truncate:V8QI (match_operand:V8HI 2 "register_operand" "x"))))] - "TARGET_SSE2" - "packuswb\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpckhbw" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (vec_merge:V16QI - (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "0") - (parallel [(const_int 8) (const_int 0) - (const_int 9) (const_int 1) - (const_int 10) (const_int 2) - (const_int 11) (const_int 3) - (const_int 12) (const_int 4) - (const_int 13) (const_int 5) - (const_int 14) (const_int 6) - (const_int 15) (const_int 7)])) - (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "x") - (parallel [(const_int 0) (const_int 8) - (const_int 1) (const_int 9) - (const_int 2) (const_int 10) - (const_int 3) (const_int 11) - (const_int 4) (const_int 12) - (const_int 5) (const_int 13) - (const_int 6) (const_int 14) - (const_int 7) (const_int 15)])) - (const_int 21845)))] - "TARGET_SSE2" - "punpckhbw\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpckhwd" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (vec_merge:V8HI - (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "0") - (parallel [(const_int 4) (const_int 0) - (const_int 5) (const_int 1) - (const_int 6) (const_int 2) - (const_int 7) (const_int 3)])) - (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "x") - (parallel [(const_int 0) (const_int 4) - (const_int 1) (const_int 5) - (const_int 2) (const_int 6) - (const_int 3) (const_int 7)])) - (const_int 85)))] - "TARGET_SSE2" - "punpckhwd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpckhdq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_merge:V4SI - (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "0") - (parallel [(const_int 2) (const_int 0) - (const_int 3) (const_int 1)])) - (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "x") - (parallel [(const_int 0) (const_int 2) - (const_int 1) (const_int 3)])) - (const_int 5)))] - "TARGET_SSE2" - "punpckhdq\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpcklbw" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (vec_merge:V16QI - (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "0") - (parallel [(const_int 0) (const_int 8) - (const_int 1) (const_int 9) - (const_int 2) (const_int 10) - (const_int 3) (const_int 11) - (const_int 4) (const_int 12) - (const_int 5) (const_int 13) - (const_int 6) (const_int 14) - (const_int 7) (const_int 15)])) - (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "x") - (parallel [(const_int 8) (const_int 0) - (const_int 9) (const_int 1) - (const_int 10) (const_int 2) - (const_int 11) (const_int 3) - (const_int 12) (const_int 4) - (const_int 13) (const_int 5) - (const_int 14) (const_int 6) - (const_int 15) (const_int 7)])) - (const_int 21845)))] - "TARGET_SSE2" - "punpcklbw\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpcklwd" - [(set (match_operand:V8HI 0 "register_operand" "=x") - (vec_merge:V8HI - (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "0") - (parallel [(const_int 0) (const_int 4) - (const_int 1) (const_int 5) - (const_int 2) (const_int 6) - (const_int 3) (const_int 7)])) - (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "x") - (parallel [(const_int 4) (const_int 0) - (const_int 5) (const_int 1) - (const_int 6) (const_int 2) - (const_int 7) (const_int 3)])) - (const_int 85)))] - "TARGET_SSE2" - "punpcklwd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpckldq" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_merge:V4SI - (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "0") - (parallel [(const_int 0) (const_int 2) - (const_int 1) (const_int 3)])) - (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "x") - (parallel [(const_int 2) (const_int 0) - (const_int 3) (const_int 1)])) - (const_int 5)))] - "TARGET_SSE2" - "punpckldq\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpcklqdq" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (vec_merge:V2DI - (vec_select:V2DI (match_operand:V2DI 2 "register_operand" "x") - (parallel [(const_int 1) - (const_int 0)])) - (match_operand:V2DI 1 "register_operand" "0") - (const_int 1)))] - "TARGET_SSE2" - "punpcklqdq\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_punpckhqdq" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (vec_merge:V2DI - (match_operand:V2DI 1 "register_operand" "0") - (vec_select:V2DI (match_operand:V2DI 2 "register_operand" "x") - (parallel [(const_int 1) - (const_int 0)])) - (const_int 1)))] - "TARGET_SSE2" - "punpckhqdq\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -;; SSE2 moves - -(define_insn "sse2_movapd" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m") - (unspec:V2DF [(match_operand:V2DF 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVA))] - "TARGET_SSE2 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movapd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_movupd" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m") - (unspec:V2DF [(match_operand:V2DF 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVU))] - "TARGET_SSE2 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movupd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_insn "sse2_movdqa" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m") - (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVA))] - "TARGET_SSE2 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movdqa\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movdqu" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m") - (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")] - UNSPEC_MOVU))] - "TARGET_SSE2 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" - "movdqu\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movdq2q" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,y") - (vec_select:DI (match_operand:V2DI 1 "register_operand" "x,x") - (parallel [(const_int 0)])))] - "TARGET_SSE2 && !TARGET_64BIT" - "@ - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movdq2q_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,y,r") - (vec_select:DI (match_operand:V2DI 1 "register_operand" "x,x,x") - (parallel [(const_int 0)])))] - "TARGET_SSE2 && TARGET_64BIT" - "@ - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movq2dq" - [(set (match_operand:V2DI 0 "register_operand" "=x,?x") - (vec_concat:V2DI (match_operand:DI 1 "nonimmediate_operand" "m,y") - (const_int 0)))] - "TARGET_SSE2 && !TARGET_64BIT" - "@ - movq\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt,ssemov") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movq2dq_rex64" - [(set (match_operand:V2DI 0 "register_operand" "=x,?x,?x") - (vec_concat:V2DI (match_operand:DI 1 "nonimmediate_operand" "m,y,r") - (const_int 0)))] - "TARGET_SSE2 && TARGET_64BIT" - "@ - movq\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt,ssemov,ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movq" - [(set (match_operand:V2DI 0 "register_operand" "=x") - (vec_concat:V2DI (vec_select:DI - (match_operand:V2DI 1 "nonimmediate_operand" "xm") - (parallel [(const_int 0)])) - (const_int 0)))] - "TARGET_SSE2" - "movq\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "TI")]) - -(define_insn "sse2_loadd" - [(set (match_operand:V4SI 0 "register_operand" "=x") - (vec_merge:V4SI - (vec_duplicate:V4SI (match_operand:SI 1 "nonimmediate_operand" "mr")) - (const_vector:V4SI [(const_int 0) - (const_int 0) - (const_int 0) - (const_int 0)]) - (const_int 1)))] - "TARGET_SSE2" - "movd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "TI")]) - -(define_insn "sse2_stored" - [(set (match_operand:SI 0 "nonimmediate_operand" "=mr") - (vec_select:SI - (match_operand:V4SI 1 "register_operand" "x") - (parallel [(const_int 0)])))] - "TARGET_SSE2" - "movd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssemov") - (set_attr "mode" "TI")]) - -(define_insn "sse2_movhpd" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m") - (vec_merge:V2DF - (match_operand:V2DF 1 "nonimmediate_operand" "0,0") - (match_operand:V2DF 2 "nonimmediate_operand" "m,x") - (const_int 2)))] - "TARGET_SSE2 && (GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)" - "movhpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) - -(define_expand "sse2_loadsd" - [(match_operand:V2DF 0 "register_operand" "") - (match_operand:DF 1 "memory_operand" "")] - "TARGET_SSE2" -{ - emit_insn (gen_sse2_loadsd_1 (operands[0], operands[1], - CONST0_RTX (V2DFmode))); + emit_insn (gen_stack_protect_set_si (operands[0], operands[1])); +#endif DONE; }) -(define_insn "sse2_loadsd_1" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_merge:V2DF - (vec_duplicate:V2DF (match_operand:DF 1 "memory_operand" "m")) - (match_operand:V2DF 2 "const0_operand" "X") - (const_int 1)))] - "TARGET_SSE2" - "movsd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) +(define_insn "stack_protect_set_si" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec:SI [(match_operand:SI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:SI 2 "=&r") (const_int 0)) + (clobber (reg:CC FLAGS_REG))] + "" + "mov{l}\t{%1, %2|%2, %1}\;mov{l}\t{%2, %0|%0, %2}\;xor{l}\t%2, %2" + [(set_attr "type" "multi")]) -(define_insn "sse2_movsd" - [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m") - (vec_merge:V2DF - (match_operand:V2DF 1 "nonimmediate_operand" "0,0,0") - (match_operand:V2DF 2 "nonimmediate_operand" "x,m,x") - (const_int 1)))] - "TARGET_SSE2 && ix86_binary_operator_ok (UNKNOWN, V2DFmode, operands)" - "@movsd\t{%2, %0|%0, %2} - movlpd\t{%2, %0|%0, %2} - movlpd\t{%2, %0|%0, %2}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF,V2DF,V2DF")]) +(define_insn "stack_protect_set_di" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:DI 2 "=&r") (const_int 0)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + "mov{q}\t{%1, %2|%2, %1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2" + [(set_attr "type" "multi")]) -(define_insn "sse2_storesd" - [(set (match_operand:DF 0 "memory_operand" "=m") - (vec_select:DF - (match_operand:V2DF 1 "register_operand" "x") - (parallel [(const_int 0)])))] - "TARGET_SSE2" - "movsd\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) +(define_insn "stack_tls_protect_set_si" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec:SI [(match_operand:SI 1 "const_int_operand" "i")] UNSPEC_SP_TLS_SET)) + (set (match_scratch:SI 2 "=&r") (const_int 0)) + (clobber (reg:CC FLAGS_REG))] + "" + "mov{l}\t{%%gs:%P1, %2|%2, DWORD PTR %%gs:%P1}\;mov{l}\t{%2, %0|%0, %2}\;xor{l}\t%2, %2" + [(set_attr "type" "multi")]) -(define_insn "sse2_shufpd" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm") - (match_operand:SI 3 "immediate_operand" "i")] - UNSPEC_SHUFFLE))] - "TARGET_SSE2" - ;; @@@ check operand order for intel/nonintel syntax - "shufpd\t{%3, %2, %0|%0, %2, %3}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "V2DF")]) +(define_insn "stack_tls_protect_set_di" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:DI 1 "const_int_operand" "i")] UNSPEC_SP_TLS_SET)) + (set (match_scratch:DI 2 "=&r") (const_int 0)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT" + { + /* The kernel uses a different segment register for performance reasons; a + system call would not have to trash the userspace segment register, + which would be expensive */ + if (ix86_cmodel != CM_KERNEL) + return "mov{q}\t{%%fs:%P1, %2|%2, QWORD PTR %%fs:%P1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"; + else + return "mov{q}\t{%%gs:%P1, %2|%2, QWORD PTR %%gs:%P1}\;mov{q}\t{%2, %0|%0, %2}\;xor{l}\t%k2, %k2"; + } + [(set_attr "type" "multi")]) -(define_insn "sse2_clflush" - [(unspec_volatile [(match_operand 0 "address_operand" "p")] - UNSPECV_CLFLUSH)] - "TARGET_SSE2" - "clflush %0" - [(set_attr "type" "sse") - (set_attr "memory" "unknown")]) - -(define_expand "sse2_mfence" - [(set (match_dup 0) - (unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))] - "TARGET_SSE2" +(define_expand "stack_protect_test" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "") + (match_operand 2 "" "")] + "" { - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); - MEM_VOLATILE_P (operands[0]) = 1; + rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG); + ix86_compare_op0 = operands[0]; + ix86_compare_op1 = operands[1]; + ix86_compare_emitted = flags; + +#ifdef TARGET_THREAD_SSP_OFFSET + if (TARGET_64BIT) + emit_insn (gen_stack_tls_protect_test_di (flags, operands[0], + GEN_INT (TARGET_THREAD_SSP_OFFSET))); + else + emit_insn (gen_stack_tls_protect_test_si (flags, operands[0], + GEN_INT (TARGET_THREAD_SSP_OFFSET))); +#else + if (TARGET_64BIT) + emit_insn (gen_stack_protect_test_di (flags, operands[0], operands[1])); + else + emit_insn (gen_stack_protect_test_si (flags, operands[0], operands[1])); +#endif + emit_jump_insn (gen_beq (operands[2])); + DONE; }) -(define_insn "*mfence_insn" - [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))] - "TARGET_SSE2" - "mfence" - [(set_attr "type" "sse") - (set_attr "memory" "unknown")]) +(define_insn "stack_protect_test_si" + [(set (match_operand:CCZ 0 "flags_reg_operand" "") + (unspec:CCZ [(match_operand:SI 1 "memory_operand" "m") + (match_operand:SI 2 "memory_operand" "m")] + UNSPEC_SP_TEST)) + (clobber (match_scratch:SI 3 "=&r"))] + "" + "mov{l}\t{%1, %3|%3, %1}\;xor{l}\t{%2, %3|%3, %2}" + [(set_attr "type" "multi")]) -(define_expand "sse2_lfence" - [(set (match_dup 0) - (unspec:BLK [(match_dup 0)] UNSPEC_LFENCE))] - "TARGET_SSE2" -{ - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); - MEM_VOLATILE_P (operands[0]) = 1; -}) +(define_insn "stack_protect_test_di" + [(set (match_operand:CCZ 0 "flags_reg_operand" "") + (unspec:CCZ [(match_operand:DI 1 "memory_operand" "m") + (match_operand:DI 2 "memory_operand" "m")] + UNSPEC_SP_TEST)) + (clobber (match_scratch:DI 3 "=&r"))] + "TARGET_64BIT" + "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%2, %3|%3, %2}" + [(set_attr "type" "multi")]) -(define_insn "*lfence_insn" - [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_dup 0)] UNSPEC_LFENCE))] - "TARGET_SSE2" - "lfence" - [(set_attr "type" "sse") - (set_attr "memory" "unknown")]) +(define_insn "stack_tls_protect_test_si" + [(set (match_operand:CCZ 0 "flags_reg_operand" "") + (unspec:CCZ [(match_operand:SI 1 "memory_operand" "m") + (match_operand:SI 2 "const_int_operand" "i")] + UNSPEC_SP_TLS_TEST)) + (clobber (match_scratch:SI 3 "=r"))] + "" + "mov{l}\t{%1, %3|%3, %1}\;xor{l}\t{%%gs:%P2, %3|%3, DWORD PTR %%gs:%P2}" + [(set_attr "type" "multi")]) -;; SSE3 +(define_insn "stack_tls_protect_test_di" + [(set (match_operand:CCZ 0 "flags_reg_operand" "") + (unspec:CCZ [(match_operand:DI 1 "memory_operand" "m") + (match_operand:DI 2 "const_int_operand" "i")] + UNSPEC_SP_TLS_TEST)) + (clobber (match_scratch:DI 3 "=r"))] + "TARGET_64BIT" + { + /* The kernel uses a different segment register for performance reasons; a + system call would not have to trash the userspace segment register, + which would be expensive */ + if (ix86_cmodel != CM_KERNEL) + return "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%%fs:%P2, %3|%3, QWORD PTR %%fs:%P2}"; + else + return "mov{q}\t{%1, %3|%3, %1}\;xor{q}\t{%%gs:%P2, %3|%3, QWORD PTR %%gs:%P2}"; + } + [(set_attr "type" "multi")]) -(define_insn "mwait" - [(unspec_volatile [(match_operand:SI 0 "register_operand" "a") - (match_operand:SI 1 "register_operand" "c")] - UNSPECV_MWAIT)] - "TARGET_SSE3" - "mwait\t%0, %1" - [(set_attr "length" "3")]) - -(define_insn "monitor" - [(unspec_volatile [(match_operand:SI 0 "register_operand" "a") - (match_operand:SI 1 "register_operand" "c") - (match_operand:SI 2 "register_operand" "d")] - UNSPECV_MONITOR)] - "TARGET_SSE3" - "monitor\t%0, %1, %2" - [(set_attr "length" "3")]) - -;; SSE3 arithmetic - -(define_insn "addsubv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")] - UNSPEC_ADDSUB))] - "TARGET_SSE3" - "addsubps\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V4SF")]) - -(define_insn "addsubv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")] - UNSPEC_ADDSUB))] - "TARGET_SSE3" - "addsubpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "haddv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")] - UNSPEC_HADD))] - "TARGET_SSE3" - "haddps\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V4SF")]) - -(define_insn "haddv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")] - UNSPEC_HADD))] - "TARGET_SSE3" - "haddpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "hsubv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") - (match_operand:V4SF 2 "nonimmediate_operand" "xm")] - UNSPEC_HSUB))] - "TARGET_SSE3" - "hsubps\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V4SF")]) - -(define_insn "hsubv2df3" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") - (match_operand:V2DF 2 "nonimmediate_operand" "xm")] - UNSPEC_HSUB))] - "TARGET_SSE3" - "hsubpd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "V2DF")]) - -(define_insn "movshdup" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF - [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_MOVSHDUP))] - "TARGET_SSE3" - "movshdup\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "movsldup" - [(set (match_operand:V4SF 0 "register_operand" "=x") - (unspec:V4SF - [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_MOVSLDUP))] - "TARGET_SSE3" - "movsldup\t{%1, %0|%0, %1}" - [(set_attr "type" "sse") - (set_attr "mode" "V4SF")]) - -(define_insn "lddqu" - [(set (match_operand:V16QI 0 "register_operand" "=x") - (unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "m")] - UNSPEC_LDQQU))] - "TARGET_SSE3" - "lddqu\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "TI")]) - -(define_insn "loadddup" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_duplicate:V2DF (match_operand:DF 1 "memory_operand" "m")))] - "TARGET_SSE3" - "movddup\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) - -(define_insn "movddup" - [(set (match_operand:V2DF 0 "register_operand" "=x") - (vec_duplicate:V2DF - (vec_select:DF (match_operand:V2DF 1 "register_operand" "x") - (parallel [(const_int 0)]))))] - "TARGET_SSE3" - "movddup\t{%1, %0|%0, %1}" - [(set_attr "type" "ssecvt") - (set_attr "mode" "DF")]) +(include "sse.md") +(include "mmx.md") +(include "sync.md") diff --git a/contrib/gcc/config/i386/i386.opt b/contrib/gcc/config/i386/i386.opt new file mode 100644 index 00000000000..2922f5d2fe0 --- /dev/null +++ b/contrib/gcc/config/i386/i386.opt @@ -0,0 +1,229 @@ +; Options for the IA-32 and AMD64 ports of the compiler. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +m128bit-long-double +Target RejectNegative Report Mask(128BIT_LONG_DOUBLE) +sizeof(long double) is 16 + +m32 +Target RejectNegative Negative(m64) Report InverseMask(64BIT) +Generate 32bit i386 code + +m386 +Target RejectNegative Undocumented +;; Deprecated + +m3dnow +Target Report Mask(3DNOW) +Support 3DNow! built-in functions + +m486 +Target RejectNegative Undocumented +;; Deprecated + +m64 +Target RejectNegative Negative(m32) Report Mask(64BIT) +Generate 64bit x86-64 code + +m80387 +Target Report Mask(80387) +Use hardware fp + +m96bit-long-double +Target RejectNegative Report InverseMask(128BIT_LONG_DOUBLE) +sizeof(long double) is 12 + +maccumulate-outgoing-args +Target Report Mask(ACCUMULATE_OUTGOING_ARGS) +Reserve space for outgoing arguments in the function prologue + +malign-double +Target Report Mask(ALIGN_DOUBLE) +Align some doubles on dword boundary + +malign-functions= +Target RejectNegative Joined Var(ix86_align_funcs_string) +Function starts are aligned to this power of 2 + +malign-jumps= +Target RejectNegative Joined Var(ix86_align_jumps_string) +Jump targets are aligned to this power of 2 + +malign-loops= +Target RejectNegative Joined Var(ix86_align_loops_string) +Loop code aligned to this power of 2 + +malign-stringops +Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS) +Align destination of the string operations + +march= +Target RejectNegative Joined Var(ix86_arch_string) +Generate code for given CPU + +masm= +Target RejectNegative Joined Var(ix86_asm_string) +Use given assembler dialect + +mbranch-cost= +Target RejectNegative Joined Var(ix86_branch_cost_string) +Branches are this expensive (1-5, arbitrary units) + +mlarge-data-threshold= +Target RejectNegative Joined Var(ix86_section_threshold_string) +Data greater than given threshold will go into .ldata section in x86-64 medium model + +mcmodel= +Target RejectNegative Joined Var(ix86_cmodel_string) +Use given x86-64 code model + +mdebug-addr +Target RejectNegative Var(TARGET_DEBUG_ADDR) Undocumented + +mdebug-arg +Target RejectNegative Var(TARGET_DEBUG_ARG) Undocumented + +mfancy-math-387 +Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) +Generate sin, cos, sqrt for FPU + +mfp-ret-in-387 +Target Report Mask(FLOAT_RETURNS) +Return values of functions in FPU registers + +mfpmath= +Target RejectNegative Joined Var(ix86_fpmath_string) +Generate floating point mathematics using given instruction set + +mhard-float +Target RejectNegative Mask(80387) MaskExists +Use hardware fp + +mieee-fp +Target Report Mask(IEEE_FP) +Use IEEE math for fp comparisons + +minline-all-stringops +Target Report Mask(INLINE_ALL_STRINGOPS) +Inline all known string operations + +mintel-syntax +Target Undocumented +;; Deprecated + +mmmx +Target Report Mask(MMX) +Support MMX built-in functions + +mms-bitfields +Target Report Mask(MS_BITFIELD_LAYOUT) +Use native (MS) bitfield layout + +mno-align-stringops +Target RejectNegative Report Mask(NO_ALIGN_STRINGOPS) Undocumented + +mno-fancy-math-387 +Target RejectNegative Report Mask(NO_FANCY_MATH_387) Undocumented + +mno-push-args +Target RejectNegative Report Mask(NO_PUSH_ARGS) Undocumented + +mno-red-zone +Target RejectNegative Report Mask(NO_RED_ZONE) Undocumented + +momit-leaf-frame-pointer +Target Report Mask(OMIT_LEAF_FRAME_POINTER) +Omit the frame pointer in leaf functions + +mpentium +Target RejectNegative Undocumented +;; Deprecated + +mpentiumpro +Target RejectNegative Undocumented +;; Deprecated + +mpreferred-stack-boundary= +Target RejectNegative Joined Var(ix86_preferred_stack_boundary_string) +Attempt to keep stack aligned to this power of 2 + +mpush-args +Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS) +Use push instructions to save outgoing arguments + +mred-zone +Target RejectNegative Report InverseMask(NO_RED_ZONE, RED_ZONE) +Use red-zone in the x86-64 code + +mregparm= +Target RejectNegative Joined Var(ix86_regparm_string) +Number of registers used to pass integer arguments + +mrtd +Target Report Mask(RTD) +Alternate calling convention + +msoft-float +Target InverseMask(80387) +Do not use hardware fp + +msse +Target Report Mask(SSE) +Support MMX and SSE built-in functions and code generation + +msse2 +Target Report Mask(SSE2) +Support MMX, SSE and SSE2 built-in functions and code generation + +msse3 +Target Report Mask(SSE3) +Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation + +msseregparm +Target RejectNegative Mask(SSEREGPARM) +Use SSE register passing conventions for SF and DF mode + +mstackrealign +Target Report Var(ix86_force_align_arg_pointer) +Realign stack in prologue + +msvr3-shlib +Target Report Mask(SVR3_SHLIB) +Uninitialized locals in .bss + +mstack-arg-probe +Target Report Mask(STACK_PROBE) +Enable stack probing + +mtls-dialect= +Target RejectNegative Joined Var(ix86_tls_dialect_string) +Use given thread-local storage dialect + +mtls-direct-seg-refs +Target Report Mask(TLS_DIRECT_SEG_REFS) +Use direct references against %gs when accessing tls data + +mtune= +Target RejectNegative Joined Var(ix86_tune_string) +Schedule code for given CPU + +;; Support Athlon 3Dnow builtins +Mask(3DNOW_A) diff --git a/contrib/gcc/config/i386/i386elf.h b/contrib/gcc/config/i386/i386elf.h index ed6b41aa9b3..d99fe62392a 100644 --- a/contrib/gcc/config/i386/i386elf.h +++ b/contrib/gcc/config/i386/i386elf.h @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Use stabs instead of DWARF debug format. */ #undef PREFERRED_DEBUGGING_TYPE diff --git a/contrib/gcc/config/i386/k6.md b/contrib/gcc/config/i386/k6.md index edd12f63c5c..e0006aebb50 100644 --- a/contrib/gcc/config/i386/k6.md +++ b/contrib/gcc/config/i386/k6.md @@ -1,5 +1,6 @@ ;; AMD K6/K6-2 Scheduling -;; Copyright (C) 2002 ;; Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004 +;; Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,122 +16,253 @@ ;; ;; 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. */ +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; -;; The K6 has similar architecture to PPro. Important difference is, that -;; there are only two decoders and they seems to be much slower than execution -;; units. So we have to pay much more attention to proper decoding for -;; schedulers. We share most of scheduler code for PPro in i386.c +;; The K6 architecture is quite similar to PPro. Important difference is +;; that there are only two decoders and they seems to be much slower than +;; any of the execution units. So we have to pay much more attention to +;; proper scheduling for the decoders. +;; FIXME: We don't do that right now. A good start would be to sort the +;; instructions based on length. ;; -;; The fp unit is not pipelined and do one operation per two cycles including -;; the FXCH. +;; This description is based on data from the following documents: ;; -;; alu describes both ALU units (ALU-X and ALU-Y). -;; alux describes X alu unit -;; fpu describes FPU unit -;; load describes load unit. -;; branch describes branch unit. -;; store describes store unit. This unit is not modelled completely and only -;; used to model lea operation. Otherwise it lie outside of the critical -;; path. +;; "AMD-K6 Processor Data Sheet (Preliminary information)" +;; Advanced Micro Devices, Inc., 1998. +;; +;; "AMD-K6 Processor Code Optimization Application Note" +;; Advanced Micro Devices, Inc., 2000. +;; +;; CPU execution units of the K6: +;; +;; store describes the Store unit. This unit is not modelled +;; completely and it is only used to model lea operation. +;; Otherwise it lies outside of any critical path. +;; load describes the Load unit +;; alux describes the Integer X unit +;; mm describes the Multimedia unit, which shares a pipe +;; with the Integer X unit. This unit is used for MMX, +;; which is not implemented for K6. +;; aluy describes the Integer Y unit +;; fpu describes the FPU unit +;; branch describes the Branch unit +;; +;; The fp unit is not pipelined, and it can only do one operation per two +;; cycles, including fxcg. +;; +;; Generally this is a very poor description, but at least no worse than +;; the old description, and a lot easier to extend to something more +;; reasonable if anyone still cares enough about this architecture in 2004. ;; ;; ??? fxch isn't handled; not an issue until sched3 after reg-stack is real. -;; The decoder specification is in the PPro section above! +(define_automaton "k6_decoder,k6_load_unit,k6_store_unit,k6_integer_units,k6_fpu_unit,k6_branch_unit") -;; Shift instructions and certain arithmetic are issued only to X pipe. -(define_function_unit "k6_alux" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "ishift,ishift1,rotate,rotate1,alu1,negnot,cld")) - 1 1) +;; The K6 instruction decoding begins before the on-chip instruction cache is +;; filled. Depending on the length of the instruction, two simple instructions +;; can be decoded in two parallel short decoders, or one complex instruction can +;; be decoded in either the long or the vector decoder. For all practical +;; purposes, the long and vector decoder can be modelled as one decoder. +(define_cpu_unit "k6_decode_short0" "k6_decoder") +(define_cpu_unit "k6_decode_short1" "k6_decoder") +(define_cpu_unit "k6_decode_long" "k6_decoder") +(exclusion_set "k6_decode_long" "k6_decode_short0,k6_decode_short1") +(define_reservation "k6_decode_short" "k6_decode_short0|k6_decode_short1") +(define_reservation "k6_decode_vector" "k6_decode_long") -;; The QI mode arithmetic is issued to X pipe only. -(define_function_unit "k6_alux" 1 0 - (and (eq_attr "cpu" "k6") - (and (eq_attr "type" "alu,alu1,negnot,icmp,test,imovx,incdec") - (eq_attr "mode" "QI"))) - 1 1) +(define_cpu_unit "k6_store" "k6_store_unit") +(define_cpu_unit "k6_load" "k6_load_unit") +(define_cpu_unit "k6_alux,k6_aluy" "k6_integer_units") +(define_cpu_unit "k6_fpu" "k6_fpu_unit") +(define_cpu_unit "k6_branch" "k6_branch_unit") -(define_function_unit "k6_alu" 2 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "ishift,ishift1,rotate,rotate1,alu1,negnot,alu,icmp,test,imovx,incdec,setcc,lea")) - 1 1) +;; Shift instructions and certain arithmetic are issued only on Integer X. +(define_insn_reservation "k6_alux_only" 1 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "ishift,ishift1,rotate,rotate1,alu1,negnot,cld") + (eq_attr "memory" "none"))) + "k6_decode_short,k6_alux") -(define_function_unit "k6_alu" 2 0 - (and (eq_attr "cpu" "k6") - (and (eq_attr "type" "imov") - (eq_attr "memory" "none"))) - 1 1) +(define_insn_reservation "k6_alux_only_load" 3 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "ishift,ishift1,rotate,rotate1,alu1,negnot,cld") + (eq_attr "memory" "load"))) + "k6_decode_short,k6_load,k6_alux") -(define_function_unit "k6_branch" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "call,callv,ibr")) - 1 1) +(define_insn_reservation "k6_alux_only_store" 3 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "ishift,ishift1,rotate,rotate1,alu1,negnot,cld") + (eq_attr "memory" "store,both,unknown"))) + "k6_decode_long,k6_load,k6_alux,k6_store") -;; Load unit have two cycle latency, but we take care for it in adjust_cost -(define_function_unit "k6_load" 1 0 - (and (eq_attr "cpu" "k6") - (ior (eq_attr "type" "pop,leave") - (eq_attr "memory" "load,both"))) - 1 1) +;; Integer divide and multiply can only be issued on Integer X, too. +(define_insn_reservation "k6_alu_imul" 2 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "imul")) + "k6_decode_vector,k6_alux*3") -(define_function_unit "k6_load" 1 0 - (and (eq_attr "cpu" "k6") - (and (eq_attr "type" "str") - (eq_attr "memory" "load,both"))) - 10 10) +(define_insn_reservation "k6_alu_imul_load" 4 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imul") + (eq_attr "memory" "load"))) + "k6_decode_vector,k6_load,k6_alux*3") -;; Lea have two instructions, so latency is probably 2 -(define_function_unit "k6_store" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "lea")) - 2 1) +(define_insn_reservation "k6_alu_imul_store" 4 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imul") + (eq_attr "memory" "store,both,unknown"))) + "k6_decode_vector,k6_load,k6_alux*3,k6_store") -(define_function_unit "k6_store" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "str")) - 10 10) +;; ??? Guessed latencies based on the old pipeline description. +(define_insn_reservation "k6_alu_idiv" 17 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "idiv") + (eq_attr "memory" "none"))) + "k6_decode_vector,k6_alux*17") -(define_function_unit "k6_store" 1 0 - (and (eq_attr "cpu" "k6") - (ior (eq_attr "type" "push") - (eq_attr "memory" "store,both"))) - 1 1) +(define_insn_reservation "k6_alu_idiv_mem" 19 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "idiv") + (eq_attr "memory" "!none"))) + "k6_decode_vector,k6_load,k6_alux*17") -(define_function_unit "k6_fpu" 1 1 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "fop,fmov,fcmp,fistp")) - 2 2) +;; Basic word and doubleword ALU ops can be issued on both Integer units. +(define_insn_reservation "k6_alu" 1 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "alu,alu1,negnot,icmp,test,imovx,incdec,setcc") + (eq_attr "memory" "none"))) + "k6_decode_short,k6_alux|k6_aluy") -(define_function_unit "k6_fpu" 1 1 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "fmul")) - 2 2) +(define_insn_reservation "k6_alu_load" 3 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "alu,alu1,negnot,icmp,test,imovx,incdec,setcc") + (eq_attr "memory" "load"))) + "k6_decode_short,k6_load,k6_alux|k6_aluy") -;; ??? Guess -(define_function_unit "k6_fpu" 1 1 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "fdiv,fpspc")) - 56 56) +(define_insn_reservation "k6_alu_store" 3 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "alu,alu1,negnot,icmp,test,imovx,incdec,setcc") + (eq_attr "memory" "store,both,unknown"))) + "k6_decode_long,k6_load,k6_alux|k6_aluy,k6_store") -(define_function_unit "k6_alu" 2 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "imul")) - 2 2) +;; A "load immediate" operation does not require execution at all, +;; it is available immediately after decoding. Special-case this. +(define_insn_reservation "k6_alu_imov" 1 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imov") + (and (eq_attr "memory" "none") + (match_operand 1 "nonimmediate_operand")))) + "k6_decode_short,k6_alux|k6_aluy") -(define_function_unit "k6_alux" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "imul")) - 2 2) +(define_insn_reservation "k6_alu_imov_imm" 0 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imov") + (and (eq_attr "memory" "none") + (match_operand 1 "immediate_operand")))) + "k6_decode_short") -;; ??? Guess -(define_function_unit "k6_alu" 2 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "idiv")) - 17 17) +(define_insn_reservation "k6_alu_imov_load" 2 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imov") + (eq_attr "memory" "load"))) + "k6_decode_short,k6_load") + +(define_insn_reservation "k6_alu_imov_store" 1 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imov") + (eq_attr "memory" "store"))) + "k6_decode_short,k6_store") + +(define_insn_reservation "k6_alu_imov_both" 2 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "imov") + (eq_attr "memory" "both,unknown"))) + "k6_decode_long,k6_load,k6_alux|k6_aluy") + +;; The branch unit. +(define_insn_reservation "k6_branch_call" 1 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "call,callv")) + "k6_decode_vector,k6_branch") + +(define_insn_reservation "k6_branch_branch" 1 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "ibr")) + "k6_decode_short,k6_branch") + +;; The load and units have two pipeline stages. The load latency is +;; two cycles. +(define_insn_reservation "k6_load_pop" 3 + (and (eq_attr "cpu" "k6") + (ior (eq_attr "type" "pop") + (eq_attr "memory" "load,both"))) + "k6_decode_short,k6_load") + +(define_insn_reservation "k6_load_leave" 5 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "leave")) + "k6_decode_long,k6_load,(k6_alux|k6_aluy)*2") + +;; ??? From the old pipeline description. Egad! +;; ??? Apparently we take care of this reservation in adjust_cost. +(define_insn_reservation "k6_load_str" 10 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "str") + (eq_attr "memory" "load,both"))) + "k6_decode_vector,k6_load*10") + +;; The store unit handles lea and push. It is otherwise unmodelled. +(define_insn_reservation "k6_store_lea" 2 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "lea")) + "k6_decode_short,k6_store,k6_alux|k6_aluy") + +(define_insn_reservation "k6_store_push" 2 + (and (eq_attr "cpu" "k6") + (ior (eq_attr "type" "push") + (eq_attr "memory" "store,both"))) + "k6_decode_short,k6_store") + +(define_insn_reservation "k6_store_str" 10 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "str")) + "k6_store*10") + +;; Most FPU instructions have latency 2 and throughput 2. +(define_insn_reservation "k6_fpu" 2 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "fop,fmov,fcmp,fistp") + (eq_attr "memory" "none"))) + "k6_decode_vector,k6_fpu*2") + +(define_insn_reservation "k6_fpu_load" 6 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "fop,fmov,fcmp,fistp") + (eq_attr "memory" "load,both"))) + "k6_decode_short,k6_load,k6_fpu*2") + +(define_insn_reservation "k6_fpu_store" 6 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "fop,fmov,fcmp,fistp") + (eq_attr "memory" "store"))) + "k6_decode_short,k6_store,k6_fpu*2") + +(define_insn_reservation "k6_fpu_fmul" 2 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "fmul") + (eq_attr "memory" "none"))) + "k6_decode_short,k6_fpu*2") + +(define_insn_reservation "k6_fpu_fmul_load" 2 + (and (eq_attr "cpu" "k6") + (and (eq_attr "type" "fmul") + (eq_attr "memory" "load,both"))) + "k6_decode_short,k6_load,k6_fpu*2") + +;; ??? Guessed latencies from the old pipeline description. +(define_insn_reservation "k6_fpu_expensive" 56 + (and (eq_attr "cpu" "k6") + (eq_attr "type" "fdiv,fpspc")) + "k6_decode_short,k6_fpu*56") -(define_function_unit "k6_alux" 1 0 - (and (eq_attr "cpu" "k6") - (eq_attr "type" "idiv")) - 17 17) diff --git a/contrib/gcc/config/i386/kaos-i386.h b/contrib/gcc/config/i386/kaos-i386.h index 3fdf883101a..fdf9ad2736c 100644 --- a/contrib/gcc/config/i386/kaos-i386.h +++ b/contrib/gcc/config/i386/kaos-i386.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (i386/kaOS[ELF])", stderr); diff --git a/contrib/gcc/config/i386/kfreebsd-gnu.h b/contrib/gcc/config/i386/kfreebsd-gnu.h new file mode 100644 index 00000000000..5e73815b0fa --- /dev/null +++ b/contrib/gcc/config/i386/kfreebsd-gnu.h @@ -0,0 +1,26 @@ +/* Definitions for Intel 386 running kFreeBSD-based GNU systems with ELF format + Copyright (C) 2004 + Free Software Foundation, Inc. + Contributed by Robert Millan. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef LINK_EMULATION +#define LINK_EMULATION "elf_i386_fbsd" +#undef REG_NAME +#define REG_NAME(reg) sc_ ## reg diff --git a/contrib/gcc/config/i386/knetbsd-gnu.h b/contrib/gcc/config/i386/knetbsd-gnu.h new file mode 100644 index 00000000000..4892c3fd81e --- /dev/null +++ b/contrib/gcc/config/i386/knetbsd-gnu.h @@ -0,0 +1,24 @@ +/* Definitions for Intel 386 running kNetBSD-based GNU systems with ELF format + Copyright (C) 2004 + Free Software Foundation, Inc. + Contributed by Robert Millan. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef REG_NAME +#define REG_NAME(reg) sc_ ## reg diff --git a/contrib/gcc/config/i386/linux-unwind.h b/contrib/gcc/config/i386/linux-unwind.h new file mode 100644 index 00000000000..07979d319b6 --- /dev/null +++ b/contrib/gcc/config/i386/linux-unwind.h @@ -0,0 +1,181 @@ +/* DWARF2 EH unwinding support for AMD x86-64 and x86. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. + Don't use this at all if inhibit_libc is used. */ + +#ifndef inhibit_libc + +#ifdef __x86_64__ + +#include +#include + +#define MD_FALLBACK_FRAME_STATE_FOR x86_64_fallback_frame_state + +static _Unwind_Reason_Code +x86_64_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned char *pc = context->ra; + struct sigcontext *sc; + long new_cfa; + + /* movq __NR_rt_sigreturn, %rax ; syscall */ + if (*(unsigned char *)(pc+0) == 0x48 + && *(unsigned long *)(pc+1) == 0x050f0000000fc0c7) + { + struct ucontext *uc_ = context->cfa; + /* The void * cast is necessary to avoid an aliasing warning. + The aliasing warning is correct, but should not be a problem + because it does not alias anything. */ + sc = (struct sigcontext *) (void *) &uc_->uc_mcontext; + } + else + return _URC_END_OF_STACK; + + new_cfa = sc->rsp; + fs->cfa_how = CFA_REG_OFFSET; + /* Register 7 is rsp */ + fs->cfa_reg = 7; + fs->cfa_offset = new_cfa - (long) context->cfa; + + /* The SVR4 register numbering macros aren't usable in libgcc. */ + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = (long)&sc->rax - new_cfa; + fs->regs.reg[1].how = REG_SAVED_OFFSET; + fs->regs.reg[1].loc.offset = (long)&sc->rdx - new_cfa; + fs->regs.reg[2].how = REG_SAVED_OFFSET; + fs->regs.reg[2].loc.offset = (long)&sc->rcx - new_cfa; + fs->regs.reg[3].how = REG_SAVED_OFFSET; + fs->regs.reg[3].loc.offset = (long)&sc->rbx - new_cfa; + fs->regs.reg[4].how = REG_SAVED_OFFSET; + fs->regs.reg[4].loc.offset = (long)&sc->rsi - new_cfa; + fs->regs.reg[5].how = REG_SAVED_OFFSET; + fs->regs.reg[5].loc.offset = (long)&sc->rdi - new_cfa; + fs->regs.reg[6].how = REG_SAVED_OFFSET; + fs->regs.reg[6].loc.offset = (long)&sc->rbp - new_cfa; + fs->regs.reg[8].how = REG_SAVED_OFFSET; + fs->regs.reg[8].loc.offset = (long)&sc->r8 - new_cfa; + fs->regs.reg[9].how = REG_SAVED_OFFSET; + fs->regs.reg[9].loc.offset = (long)&sc->r9 - new_cfa; + fs->regs.reg[10].how = REG_SAVED_OFFSET; + fs->regs.reg[10].loc.offset = (long)&sc->r10 - new_cfa; + fs->regs.reg[11].how = REG_SAVED_OFFSET; + fs->regs.reg[11].loc.offset = (long)&sc->r11 - new_cfa; + fs->regs.reg[12].how = REG_SAVED_OFFSET; + fs->regs.reg[12].loc.offset = (long)&sc->r12 - new_cfa; + fs->regs.reg[13].how = REG_SAVED_OFFSET; + fs->regs.reg[13].loc.offset = (long)&sc->r13 - new_cfa; + fs->regs.reg[14].how = REG_SAVED_OFFSET; + fs->regs.reg[14].loc.offset = (long)&sc->r14 - new_cfa; + fs->regs.reg[15].how = REG_SAVED_OFFSET; + fs->regs.reg[15].loc.offset = (long)&sc->r15 - new_cfa; + fs->regs.reg[16].how = REG_SAVED_OFFSET; + fs->regs.reg[16].loc.offset = (long)&sc->rip - new_cfa; + fs->retaddr_column = 16; + fs->signal_frame = 1; + return _URC_NO_REASON; +} + +#else /* ifdef __x86_64__ */ + +/* There's no sys/ucontext.h for glibc 2.0, so no + signal-turned-exceptions for them. There's also no configure-run for + the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the + target libc version macro should be enough. */ +#if !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0) + +#include +#include + +#define MD_FALLBACK_FRAME_STATE_FOR x86_fallback_frame_state + +static _Unwind_Reason_Code +x86_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned char *pc = context->ra; + struct sigcontext *sc; + long new_cfa; + + /* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ + if (*(unsigned short *)(pc+0) == 0xb858 + && *(unsigned int *)(pc+2) == 119 + && *(unsigned short *)(pc+6) == 0x80cd) + sc = context->cfa + 4; + /* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ + else if (*(unsigned char *)(pc+0) == 0xb8 + && *(unsigned int *)(pc+1) == 173 + && *(unsigned short *)(pc+5) == 0x80cd) + { + struct rt_sigframe { + int sig; + struct siginfo *pinfo; + void *puc; + struct siginfo info; + struct ucontext uc; + } *rt_ = context->cfa; + /* The void * cast is necessary to avoid an aliasing warning. + The aliasing warning is correct, but should not be a problem + because it does not alias anything. */ + sc = (struct sigcontext *) (void *) &rt_->uc.uc_mcontext; + } + else + return _URC_END_OF_STACK; + + new_cfa = sc->REG_NAME(esp); + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 4; + fs->cfa_offset = new_cfa - (long) context->cfa; + + /* The SVR4 register numbering macros aren't usable in libgcc. */ + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = (long)&sc->REG_NAME(eax) - new_cfa; + fs->regs.reg[3].how = REG_SAVED_OFFSET; + fs->regs.reg[3].loc.offset = (long)&sc->REG_NAME(ebx) - new_cfa; + fs->regs.reg[1].how = REG_SAVED_OFFSET; + fs->regs.reg[1].loc.offset = (long)&sc->REG_NAME(ecx) - new_cfa; + fs->regs.reg[2].how = REG_SAVED_OFFSET; + fs->regs.reg[2].loc.offset = (long)&sc->REG_NAME(edx) - new_cfa; + fs->regs.reg[6].how = REG_SAVED_OFFSET; + fs->regs.reg[6].loc.offset = (long)&sc->REG_NAME(esi) - new_cfa; + fs->regs.reg[7].how = REG_SAVED_OFFSET; + fs->regs.reg[7].loc.offset = (long)&sc->REG_NAME(edi) - new_cfa; + fs->regs.reg[5].how = REG_SAVED_OFFSET; + fs->regs.reg[5].loc.offset = (long)&sc->REG_NAME(ebp) - new_cfa; + fs->regs.reg[8].how = REG_SAVED_OFFSET; + fs->regs.reg[8].loc.offset = (long)&sc->REG_NAME(eip) - new_cfa; + fs->retaddr_column = 8; + fs->signal_frame = 1; + return _URC_NO_REASON; +} +#endif /* not glibc 2.0 */ +#endif /* ifdef __x86_64__ */ +#endif /* ifdef inhibit_libc */ diff --git a/contrib/gcc/config/i386/linux.h b/contrib/gcc/config/i386/linux.h index e7d19ec181a..7eb2395b6d9 100644 --- a/contrib/gcc/config/i386/linux.h +++ b/contrib/gcc/config/i386/linux.h @@ -1,6 +1,6 @@ /* Definitions for Intel 386 running Linux-based GNU systems with ELF format. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 - Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2004, 2005, + 2006 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu. @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ @@ -74,20 +74,11 @@ Boston, MA 02111-1307, USA. */ do \ { \ LINUX_TARGET_OS_CPP_BUILTINS(); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) #undef CPP_SPEC -#ifdef USE_GNULIBC_1 -#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" -#else #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" -#endif #undef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) %{profile:-p}" @@ -108,24 +99,29 @@ Boston, MA 02111-1307, USA. */ /* If ELF is the default format, we should not use /lib/elf. */ +/* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */ +#define LINK_EMULATION "elf_i386" +#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "link_emulation", LINK_EMULATION },\ + { "dynamic_linker", LINUX_DYNAMIC_LINKER } + #undef LINK_SPEC -#ifdef USE_GNULIBC_1 -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \ +#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ %{!shared: \ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \ + %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \ %{static:-static}}}" -#else -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \ - %{!shared: \ - %{!ibcs: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ - %{static:-static}}}" -#endif + +/* Similar to standard Linux, but adding -ffast-math support. */ +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" /* A C statement (sans semicolon) to output to the stdio stream FILE the assembler definition of uninitialized global DECL named @@ -151,24 +147,6 @@ Boston, MA 02111-1307, USA. */ } while (0) #endif -#if defined(__PIC__) && defined (USE_GNULIBC_1) -/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, - __environ and atexit. We have to make sure they are in the .dynsym - section. We do this by forcing the assembler to create undefined - references to these symbols in the object file. */ -#undef CRT_CALL_STATIC_FUNCTION -#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ - asm (SECTION_OP "\n\t" \ - "call " USER_LABEL_PREFIX #FUNC "\n" \ - TEXT_SECTION_ASM_OP "\n\t" \ - ".extern ___brk_addr\n\t" \ - ".type ___brk_addr,@object\n\t" \ - ".extern __environ\n\t" \ - ".type __environ,@object\n\t" \ - ".extern atexit\n\t" \ - ".type atexit,@function"); -#endif - /* Handle special EH pointer encodings. Absolute, pc-relative, and indirect are handled automatically. */ #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \ @@ -205,70 +183,12 @@ Boston, MA 02111-1307, USA. */ #undef NEED_INDICATE_EXEC_STACK #define NEED_INDICATE_EXEC_STACK 1 -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ +#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h" -#ifdef IN_LIBGCC2 -/* There's no sys/ucontext.h for some (all?) libc1, so no - signal-turned-exceptions for them. There's also no configure-run for - the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the - target libc1 macro should be enough. */ -#if !(defined (USE_GNULIBC_1) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)) -#include -#include +/* This macro may be overridden in i386/k*bsd-gnu.h. */ +#define REG_NAME(reg) reg -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - \ - /* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ \ - if (*(unsigned short *)(pc_+0) == 0xb858 \ - && *(unsigned int *)(pc_+2) == 119 \ - && *(unsigned short *)(pc_+6) == 0x80cd) \ - sc_ = (CONTEXT)->cfa + 4; \ - /* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ \ - else if (*(unsigned char *)(pc_+0) == 0xb8 \ - && *(unsigned int *)(pc_+1) == 173 \ - && *(unsigned short *)(pc_+5) == 0x80cd) \ - { \ - struct rt_sigframe { \ - int sig; \ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ - struct ucontext uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->esp; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 4; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - /* The SVR4 register numbering macros aren't usable in libgcc. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \ - (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \ - (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \ - (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \ - (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \ - (FS)->regs.reg[7].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \ - (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \ - (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \ - (FS)->retaddr_column = 8; \ - goto SUCCESS; \ - } while (0) -#endif /* not USE_GNULIBC_1 */ -#endif /* IN_LIBGCC2 */ +#ifdef TARGET_LIBC_PROVIDES_SSP +/* i386 glibc provides __stack_chk_guard in %gs:0x14. */ +#define TARGET_THREAD_SSP_OFFSET 0x14 +#endif diff --git a/contrib/gcc/config/i386/linux64.h b/contrib/gcc/config/i386/linux64.h index 98536c19bd3..cc8ed16f229 100644 --- a/contrib/gcc/config/i386/linux64.h +++ b/contrib/gcc/config/i386/linux64.h @@ -1,5 +1,5 @@ /* Definitions for AMD x86-64 running Linux-based GNU systems with ELF format. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Jan Hubicka , based on linux.h. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)"); @@ -25,11 +25,6 @@ Boston, MA 02111-1307, USA. */ do \ { \ LINUX_TARGET_OS_CPP_BUILTINS(); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) @@ -54,143 +49,37 @@ Boston, MA 02111-1307, USA. */ When the -shared link option is used a final link is not being done. */ +#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #undef LINK_SPEC #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ - %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \ + %{m32:%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}} \ + %{!m32:%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}} \ %{static:-static}}" +/* Similar to standard Linux, but adding -ffast-math support. */ +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" + #define MULTILIB_DEFAULTS { "m64" } #undef NEED_INDICATE_EXEC_STACK #define NEED_INDICATE_EXEC_STACK 1 -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. - Don't use this at all if inhibit_libc is used. */ +#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h" -#ifndef inhibit_libc -#ifdef IN_LIBGCC2 -#include -#include +/* This macro may be overridden in i386/k*bsd-gnu.h. */ +#define REG_NAME(reg) reg + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* i386 glibc provides __stack_chk_guard in %gs:0x14, + x86_64 glibc provides it in %fs:0x28. */ +#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) #endif - -#ifdef __x86_64__ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - \ - /* movq __NR_rt_sigreturn, %rax ; syscall */ \ - if (*(unsigned char *)(pc_+0) == 0x48 \ - && *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7) \ - { \ - struct ucontext *uc_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &uc_->uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->rsp; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - /* Register 7 is rsp */ \ - (FS)->cfa_reg = 7; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - /* The SVR4 register numbering macros aren't usable in libgcc. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = (long)&sc_->rax - new_cfa_; \ - (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[1].loc.offset = (long)&sc_->rdx - new_cfa_; \ - (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[2].loc.offset = (long)&sc_->rcx - new_cfa_; \ - (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[3].loc.offset = (long)&sc_->rbx - new_cfa_; \ - (FS)->regs.reg[4].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[4].loc.offset = (long)&sc_->rsi - new_cfa_; \ - (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[5].loc.offset = (long)&sc_->rdi - new_cfa_; \ - (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[6].loc.offset = (long)&sc_->rbp - new_cfa_; \ - (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[8].loc.offset = (long)&sc_->r8 - new_cfa_; \ - (FS)->regs.reg[9].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[9].loc.offset = (long)&sc_->r9 - new_cfa_; \ - (FS)->regs.reg[10].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[10].loc.offset = (long)&sc_->r10 - new_cfa_; \ - (FS)->regs.reg[11].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[11].loc.offset = (long)&sc_->r11 - new_cfa_; \ - (FS)->regs.reg[12].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[12].loc.offset = (long)&sc_->r12 - new_cfa_; \ - (FS)->regs.reg[13].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[13].loc.offset = (long)&sc_->r13 - new_cfa_; \ - (FS)->regs.reg[14].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[14].loc.offset = (long)&sc_->r14 - new_cfa_; \ - (FS)->regs.reg[15].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[15].loc.offset = (long)&sc_->r15 - new_cfa_; \ - (FS)->regs.reg[16].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[16].loc.offset = (long)&sc_->rip - new_cfa_; \ - (FS)->retaddr_column = 16; \ - goto SUCCESS; \ - } while (0) -#else /* ifdef __x86_64__ */ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - struct sigcontext *sc_; \ - long new_cfa_; \ - \ - /* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ \ - if (*(unsigned short *)(pc_+0) == 0xb858 \ - && *(unsigned int *)(pc_+2) == 119 \ - && *(unsigned short *)(pc_+6) == 0x80cd) \ - sc_ = (CONTEXT)->cfa + 4; \ - /* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ \ - else if (*(unsigned char *)(pc_+0) == 0xb8 \ - && *(unsigned int *)(pc_+1) == 173 \ - && *(unsigned short *)(pc_+5) == 0x80cd) \ - { \ - struct rt_sigframe { \ - int sig; \ - struct siginfo *pinfo; \ - void *puc; \ - struct siginfo info; \ - struct ucontext uc; \ - } *rt_ = (CONTEXT)->cfa; \ - sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \ - } \ - else \ - break; \ - \ - new_cfa_ = sc_->esp; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 4; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - \ - /* The SVR4 register numbering macros aren't usable in libgcc. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \ - (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \ - (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \ - (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \ - (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \ - (FS)->regs.reg[7].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \ - (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \ - (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \ - (FS)->retaddr_column = 8; \ - goto SUCCESS; \ - } while (0) -#endif /* ifdef __x86_64__ */ -#endif /* ifdef inhibit_libc */ diff --git a/contrib/gcc/config/i386/lynx.h b/contrib/gcc/config/i386/lynx.h index a926d14067c..799225abc97 100644 --- a/contrib/gcc/config/i386/lynx.h +++ b/contrib/gcc/config/i386/lynx.h @@ -1,5 +1,6 @@ -/* Definitions for Intel 386 running LynxOS. - Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc. +/* Definitions for LynxOS on i386. + Copyright (C) 1993, 1995, 1996, 2002, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,57 +16,76 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ -#define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)"); +#define TARGET_VERSION fputs (" (i386/LynxOS)", stderr); #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("I386"); \ - builtin_define_std ("Lynx"); \ - builtin_define_std ("IBITS32"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=lynx"); \ + builtin_define ("__LITTLE_ENDIAN__"); \ + builtin_define ("__x86__"); \ } \ while (0) -/* The prefix to add to user-visible assembler symbols. */ +/* The svr4 ABI for the i386 says that records and unions are returned + in memory. */ -/* Override the svr3 convention of adding a leading underscore. */ +#define DEFAULT_PCC_STRUCT_RETURN 1 -#undef USER_LABEL_PREFIX -#define USER_LABEL_PREFIX "" +/* BSS_SECTION_ASM_OP gets defined i386/unix.h. */ -/* Apparently LynxOS clobbers ebx when you call into the OS. */ +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) -#undef CALL_USED_REGISTERS -#define CALL_USED_REGISTERS \ -/*ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \ -{ 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } +/* LynxOS's GDB counts the floating point registers from 16. */ -/* Prefix for internally generated assembler labels. If we aren't using - underscores, we are using prefix `.'s to identify labels that should - be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) \ + (TARGET_64BIT ? dbx64_register_map[n] \ + : (n) == 0 ? 0 \ + : (n) == 1 ? 2 \ + : (n) == 2 ? 1 \ + : (n) == 3 ? 3 \ + : (n) == 4 ? 6 \ + : (n) == 5 ? 7 \ + : (n) == 6 ? 5 \ + : (n) == 7 ? 4 \ + : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n) + 8 \ + : (-1)) + +/* A C statement to output to the stdio stream FILE an assembler + command to advance the location counter to a multiple of 1< + +/* Internal data types for implementing the intrinsics. */ +typedef float __v2sf __attribute__ ((__vector_size__ (8))); + +static __inline void +_m_femms (void) +{ + __builtin_ia32_femms(); +} + +static __inline __m64 +_m_pavgusb (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pavgusb ((__v8qi)__A, (__v8qi)__B); +} + +static __inline __m64 +_m_pf2id (__m64 __A) +{ + return (__m64)__builtin_ia32_pf2id ((__v2sf)__A); +} + +static __inline __m64 +_m_pfacc (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfacc ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfadd (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfadd ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfcmpeq (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfcmpeq ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfcmpge (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfcmpge ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfcmpgt (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfcmpgt ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfmax (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfmax ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfmin (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfmin ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfmul (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfmul ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfrcp (__m64 __A) +{ + return (__m64)__builtin_ia32_pfrcp ((__v2sf)__A); +} + +static __inline __m64 +_m_pfrcpit1 (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfrcpit1 ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfrcpit2 (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfrcpit2 ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfrsqrt (__m64 __A) +{ + return (__m64)__builtin_ia32_pfrsqrt ((__v2sf)__A); +} + +static __inline __m64 +_m_pfrsqit1 (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfrsqit1 ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfsub (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfsub ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfsubr (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfsubr ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pi2fd (__m64 __A) +{ + return (__m64)__builtin_ia32_pi2fd ((__v2si)__A); +} + +static __inline __m64 +_m_pmulhrw (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pmulhrw ((__v4hi)__A, (__v4hi)__B); +} + +static __inline void +_m_prefetch (void *__P) +{ + __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); +} + +static __inline void +_m_prefetchw (void *__P) +{ + __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); +} + +static __inline __m64 +_m_from_float (float __A) +{ + return (__m64)(__v2sf){ __A, 0 }; +} + +static __inline float +_m_to_float (__m64 __A) +{ + union { __v2sf v; float a[2]; } __tmp = { (__v2sf)__A }; + return __tmp.a[0]; +} + +#ifdef __3dNOW_A__ + +static __inline __m64 +_m_pf2iw (__m64 __A) +{ + return (__m64)__builtin_ia32_pf2iw ((__v2sf)__A); +} + +static __inline __m64 +_m_pfnacc (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfnacc ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pfpnacc (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pfpnacc ((__v2sf)__A, (__v2sf)__B); +} + +static __inline __m64 +_m_pi2fw (__m64 __A) +{ + return (__m64)__builtin_ia32_pi2fw ((__v2si)__A); +} + +static __inline __m64 +_m_pswapd (__m64 __A) +{ + return (__m64)__builtin_ia32_pswapdsf ((__v2sf)__A); +} + +#endif /* __3dNOW_A__ */ +#endif /* __3dNOW__ */ + +#endif /* _MM3DNOW_H_INCLUDED */ diff --git a/contrib/gcc/config/i386/mmintrin.h b/contrib/gcc/config/i386/mmintrin.h index bd775e8e3a6..052198d71d9 100644 --- a/contrib/gcc/config/i386/mmintrin.h +++ b/contrib/gcc/config/i386/mmintrin.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. @@ -14,8 +15,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -25,7 +26,7 @@ Public License. */ /* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ + User Guide and Reference, version 9.0. */ #ifndef _MMINTRIN_H_INCLUDED #define _MMINTRIN_H_INCLUDED @@ -33,36 +34,36 @@ #ifndef __MMX__ # error "MMX instruction set not enabled" #else -/* The data type intended for user use. */ -typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); /* Internal data types for implementing the intrinsics. */ -typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); -typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); -typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); /* Empty the multimedia state. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_empty (void) { __builtin_ia32_emms (); } -static __inline void +static __inline void __attribute__((__always_inline__)) _m_empty (void) { _mm_empty (); } /* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtsi32_si64 (int __i) { - long long __tmp = (unsigned int)__i; - return (__m64) __tmp; + return (__m64) __builtin_ia32_vec_init_v2si (__i, 0); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_from_int (int __i) { return _mm_cvtsi32_si64 (__i); @@ -70,14 +71,28 @@ _m_from_int (int __i) #ifdef __x86_64__ /* Convert I to a __m64 object. */ -static __inline __m64 + +/* Intel intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int64 (long long __i) +{ + return (__m64) __i; +} + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64_m64 (long long __i) +{ + return (__m64) __i; +} + +/* Microsoft intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtsi64x_si64 (long long __i) { return (__m64) __i; } -/* Convert I to a __m64 object. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set_pi64x (long long __i) { return (__m64) __i; @@ -85,22 +100,36 @@ _mm_set_pi64x (long long __i) #endif /* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvtsi64_si32 (__m64 __i) { - long long __tmp = (long long)__i; - return __tmp; + return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0); } -static __inline int +static __inline int __attribute__((__always_inline__)) _m_to_int (__m64 __i) { return _mm_cvtsi64_si32 (__i); } #ifdef __x86_64__ -/* Convert the lower 32 bits of the __m64 object into an integer. */ -static __inline long long +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_m_to_int64 (__m64 __i) +{ + return (long long)__i; +} + +static __inline long long __attribute__((__always_inline__)) +_mm_cvtm64_si64 (__m64 __i) +{ + return (long long)__i; +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) _mm_cvtsi64_si64x (__m64 __i) { return (long long)__i; @@ -110,13 +139,13 @@ _mm_cvtsi64_si64x (__m64 __i) /* Pack the four 16-bit values from M1 into the lower four 8-bit values of the result, and the four 16-bit values from M2 into the upper four 8-bit values of the result, all with signed saturation. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_packs_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_packsswb (__m64 __m1, __m64 __m2) { return _mm_packs_pi16 (__m1, __m2); @@ -125,13 +154,13 @@ _m_packsswb (__m64 __m1, __m64 __m2) /* Pack the two 32-bit values from M1 in to the lower two 16-bit values of the result, and the two 32-bit values from M2 into the upper two 16-bit values of the result, all with signed saturation. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_packs_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_packssdw (__m64 __m1, __m64 __m2) { return _mm_packs_pi32 (__m1, __m2); @@ -140,13 +169,13 @@ _m_packssdw (__m64 __m1, __m64 __m2) /* Pack the four 16-bit values from M1 into the lower four 8-bit values of the result, and the four 16-bit values from M2 into the upper four 8-bit values of the result, all with unsigned saturation. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_packs_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_packuswb (__m64 __m1, __m64 __m2) { return _mm_packs_pu16 (__m1, __m2); @@ -154,13 +183,13 @@ _m_packuswb (__m64 __m1, __m64 __m2) /* Interleave the four 8-bit values from the high half of M1 with the four 8-bit values from the high half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpckhbw (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi8 (__m1, __m2); @@ -168,13 +197,13 @@ _m_punpckhbw (__m64 __m1, __m64 __m2) /* Interleave the two 16-bit values from the high half of M1 with the two 16-bit values from the high half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpckhwd (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi16 (__m1, __m2); @@ -182,13 +211,13 @@ _m_punpckhwd (__m64 __m1, __m64 __m2) /* Interleave the 32-bit value from the high half of M1 with the 32-bit value from the high half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpckhdq (__m64 __m1, __m64 __m2) { return _mm_unpackhi_pi32 (__m1, __m2); @@ -196,13 +225,13 @@ _m_punpckhdq (__m64 __m1, __m64 __m2) /* Interleave the four 8-bit values from the low half of M1 with the four 8-bit values from the low half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpcklbw (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi8 (__m1, __m2); @@ -210,13 +239,13 @@ _m_punpcklbw (__m64 __m1, __m64 __m2) /* Interleave the two 16-bit values from the low half of M1 with the two 16-bit values from the low half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpcklwd (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi16 (__m1, __m2); @@ -224,73 +253,75 @@ _m_punpcklwd (__m64 __m1, __m64 __m2) /* Interleave the 32-bit value from the low half of M1 with the 32-bit value from the low half of M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_punpckldq (__m64 __m1, __m64 __m2) { return _mm_unpacklo_pi32 (__m1, __m2); } /* Add the 8-bit values in M1 to the 8-bit values in M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_add_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddb (__m64 __m1, __m64 __m2) { return _mm_add_pi8 (__m1, __m2); } /* Add the 16-bit values in M1 to the 16-bit values in M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_add_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddw (__m64 __m1, __m64 __m2) { return _mm_add_pi16 (__m1, __m2); } /* Add the 32-bit values in M1 to the 32-bit values in M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_add_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddd (__m64 __m1, __m64 __m2) { return _mm_add_pi32 (__m1, __m2); } /* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 +#ifdef __SSE2__ +static __inline __m64 __attribute__((__always_inline__)) _mm_add_si64 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); } +#endif /* Add the 8-bit values in M1 to the 8-bit values in M2 using signed saturated arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_adds_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddsb (__m64 __m1, __m64 __m2) { return _mm_adds_pi8 (__m1, __m2); @@ -298,13 +329,13 @@ _m_paddsb (__m64 __m1, __m64 __m2) /* Add the 16-bit values in M1 to the 16-bit values in M2 using signed saturated arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_adds_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddsw (__m64 __m1, __m64 __m2) { return _mm_adds_pi16 (__m1, __m2); @@ -312,13 +343,13 @@ _m_paddsw (__m64 __m1, __m64 __m2) /* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned saturated arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_adds_pu8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddusb (__m64 __m1, __m64 __m2) { return _mm_adds_pu8 (__m1, __m2); @@ -326,73 +357,75 @@ _m_paddusb (__m64 __m1, __m64 __m2) /* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned saturated arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_adds_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_paddusw (__m64 __m1, __m64 __m2) { return _mm_adds_pu16 (__m1, __m2); } /* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sub_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubb (__m64 __m1, __m64 __m2) { return _mm_sub_pi8 (__m1, __m2); } /* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sub_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubw (__m64 __m1, __m64 __m2) { return _mm_sub_pi16 (__m1, __m2); } /* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sub_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubd (__m64 __m1, __m64 __m2) { return _mm_sub_pi32 (__m1, __m2); } /* Add the 64-bit values in M1 to the 64-bit values in M2. */ -static __inline __m64 +#ifdef __SSE2__ +static __inline __m64 __attribute__((__always_inline__)) _mm_sub_si64 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2); } +#endif /* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed saturating arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_subs_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubsb (__m64 __m1, __m64 __m2) { return _mm_subs_pi8 (__m1, __m2); @@ -400,13 +433,13 @@ _m_psubsb (__m64 __m1, __m64 __m2) /* Subtract the 16-bit values in M2 from the 16-bit values in M1 using signed saturating arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_subs_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubsw (__m64 __m1, __m64 __m2) { return _mm_subs_pi16 (__m1, __m2); @@ -414,13 +447,13 @@ _m_psubsw (__m64 __m1, __m64 __m2) /* Subtract the 8-bit values in M2 from the 8-bit values in M1 using unsigned saturating arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_subs_pu8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubusb (__m64 __m1, __m64 __m2) { return _mm_subs_pu8 (__m1, __m2); @@ -428,13 +461,13 @@ _m_psubusb (__m64 __m1, __m64 __m2) /* Subtract the 16-bit values in M2 from the 16-bit values in M1 using unsigned saturating arithmetic. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_subs_pu16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psubusw (__m64 __m1, __m64 __m2) { return _mm_subs_pu16 (__m1, __m2); @@ -443,13 +476,13 @@ _m_psubusw (__m64 __m1, __m64 __m2) /* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing four 32-bit intermediate results, which are then summed by pairs to produce two 32-bit results. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_madd_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmaddwd (__m64 __m1, __m64 __m2) { return _mm_madd_pi16 (__m1, __m2); @@ -457,13 +490,13 @@ _m_pmaddwd (__m64 __m1, __m64 __m2) /* Multiply four signed 16-bit values in M1 by four signed 16-bit values in M2 and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_mulhi_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmulhw (__m64 __m1, __m64 __m2) { return _mm_mulhi_pi16 (__m1, __m2); @@ -471,226 +504,226 @@ _m_pmulhw (__m64 __m1, __m64 __m2) /* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce the low 16 bits of the results. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_mullo_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmullw (__m64 __m1, __m64 __m2) { return _mm_mullo_pi16 (__m1, __m2); } /* Shift four 16-bit values in M left by COUNT. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sll_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psllw (__m64 __m, __m64 __count) { return _mm_sll_pi16 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_slli_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psllwi (__m64 __m, int __count) { return _mm_slli_pi16 (__m, __count); } /* Shift two 32-bit values in M left by COUNT. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sll_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pslld (__m64 __m, __m64 __count) { return _mm_sll_pi32 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_slli_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pslldi (__m64 __m, int __count) { return _mm_slli_pi32 (__m, __count); } /* Shift the 64-bit value in M left by COUNT. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sll_si64 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psllq (__m64 __m, __m64 __count) { return _mm_sll_si64 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_slli_si64 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psllqi (__m64 __m, int __count) { return _mm_slli_si64 (__m, __count); } /* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sra_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psraw (__m64 __m, __m64 __count) { return _mm_sra_pi16 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srai_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrawi (__m64 __m, int __count) { return _mm_srai_pi16 (__m, __count); } /* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sra_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrad (__m64 __m, __m64 __count) { return _mm_sra_pi32 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srai_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psradi (__m64 __m, int __count) { return _mm_srai_pi32 (__m, __count); } /* Shift four 16-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srl_pi16 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrlw (__m64 __m, __m64 __count) { return _mm_srl_pi16 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srli_pi16 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrlwi (__m64 __m, int __count) { return _mm_srli_pi16 (__m, __count); } /* Shift two 32-bit values in M right by COUNT; shift in zeros. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srl_pi32 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrld (__m64 __m, __m64 __count) { return _mm_srl_pi32 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srli_pi32 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrldi (__m64 __m, int __count) { return _mm_srli_pi32 (__m, __count); } /* Shift the 64-bit value in M left by COUNT; shift in zeros. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srl_si64 (__m64 __m, __m64 __count) { return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrlq (__m64 __m, __m64 __count) { return _mm_srl_si64 (__m, __count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_srli_si64 (__m64 __m, int __count) { return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psrlqi (__m64 __m, int __count) { return _mm_srli_si64 (__m, __count); } /* Bit-wise AND the 64-bit values in M1 and M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_and_si64 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2); + return __builtin_ia32_pand (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pand (__m64 __m1, __m64 __m2) { return _mm_and_si64 (__m1, __m2); @@ -698,39 +731,39 @@ _m_pand (__m64 __m1, __m64 __m2) /* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the 64-bit value in M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_andnot_si64 (__m64 __m1, __m64 __m2) { - return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2); + return __builtin_ia32_pandn (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pandn (__m64 __m1, __m64 __m2) { return _mm_andnot_si64 (__m1, __m2); } /* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_or_si64 (__m64 __m1, __m64 __m2) { - return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2); + return __builtin_ia32_por (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_por (__m64 __m1, __m64 __m2) { return _mm_or_si64 (__m1, __m2); } /* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_xor_si64 (__m64 __m1, __m64 __m2) { - return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2); + return __builtin_ia32_pxor (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pxor (__m64 __m1, __m64 __m2) { return _mm_xor_si64 (__m1, __m2); @@ -738,25 +771,25 @@ _m_pxor (__m64 __m1, __m64 __m2) /* Compare eight 8-bit values. The result of the comparison is 0xFF if the test is true and zero if false. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpeqb (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi8 (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpgtb (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi8 (__m1, __m2); @@ -764,25 +797,25 @@ _m_pcmpgtb (__m64 __m1, __m64 __m2) /* Compare four 16-bit values. The result of the comparison is 0xFFFF if the test is true and zero if false. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpeqw (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi16 (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpgtw (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi16 (__m1, __m2); @@ -790,99 +823,74 @@ _m_pcmpgtw (__m64 __m1, __m64 __m2) /* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if the test is true and zero if false. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpeqd (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi32 (__m1, __m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pcmpgtd (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi32 (__m1, __m2); } /* Creates a 64-bit zero. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_setzero_si64 (void) { - return (__m64)__builtin_ia32_mmx_zero (); + return (__m64)0LL; } /* Creates a vector of two 32-bit values; I0 is least significant. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set_pi32 (int __i1, int __i0) { - union { - __m64 __q; - struct { - unsigned int __i0; - unsigned int __i1; - } __s; - } __u; - - __u.__s.__i0 = __i0; - __u.__s.__i1 = __i1; - - return __u.__q; + return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1); } /* Creates a vector of four 16-bit values; W0 is least significant. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) { - unsigned int __i1 = (unsigned short)__w3 << 16 | (unsigned short)__w2; - unsigned int __i0 = (unsigned short)__w1 << 16 | (unsigned short)__w0; - return _mm_set_pi32 (__i1, __i0); - + return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3); } /* Creates a vector of eight 8-bit values; B0 is least significant. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) { - unsigned int __i1, __i0; - - __i1 = (unsigned char)__b7; - __i1 = __i1 << 8 | (unsigned char)__b6; - __i1 = __i1 << 8 | (unsigned char)__b5; - __i1 = __i1 << 8 | (unsigned char)__b4; - - __i0 = (unsigned char)__b3; - __i0 = __i0 << 8 | (unsigned char)__b2; - __i0 = __i0 << 8 | (unsigned char)__b1; - __i0 = __i0 << 8 | (unsigned char)__b0; - - return _mm_set_pi32 (__i1, __i0); + return (__m64) __builtin_ia32_vec_init_v8qi (__b0, __b1, __b2, __b3, + __b4, __b5, __b6, __b7); } /* Similar, but with the arguments in reverse order. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_setr_pi32 (int __i0, int __i1) { return _mm_set_pi32 (__i1, __i0); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) { return _mm_set_pi16 (__w3, __w2, __w1, __w0); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7) { @@ -890,27 +898,24 @@ _mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, } /* Creates a vector of two 32-bit values, both elements containing I. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set1_pi32 (int __i) { return _mm_set_pi32 (__i, __i); } /* Creates a vector of four 16-bit values, all elements containing W. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set1_pi16 (short __w) { - unsigned int __i = (unsigned short)__w << 16 | (unsigned short)__w; - return _mm_set1_pi32 (__i); + return _mm_set_pi16 (__w, __w, __w, __w); } /* Creates a vector of eight 8-bit values, all elements containing B. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_set1_pi8 (char __b) { - unsigned int __w = (unsigned char)__b << 8 | (unsigned char)__b; - unsigned int __i = __w << 16 | __w; - return _mm_set1_pi32 (__i); + return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b); } #endif /* __MMX__ */ diff --git a/contrib/gcc/config/i386/mmx.md b/contrib/gcc/config/i386/mmx.md new file mode 100644 index 00000000000..4f0ab2ca3ee --- /dev/null +++ b/contrib/gcc/config/i386/mmx.md @@ -0,0 +1,1433 @@ +;; GCC machine description for MMX and 3dNOW! instructions +;; Copyright (C) 2005 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; The MMX and 3dNOW! patterns are in the same file because they use +;; the same register file, and 3dNOW! adds a number of extensions to +;; the base integer MMX isa. + +;; Note! Except for the basic move instructions, *all* of these +;; patterns are outside the normal optabs namespace. This is because +;; use of these registers requires the insertion of emms or femms +;; instructions to return to normal fpu mode. The compiler doesn't +;; know how to do that itself, which means it's up to the user. Which +;; means that we should never use any of these patterns except at the +;; direction of the user via a builtin. + +;; 8 byte integral modes handled by MMX (and by extension, SSE) +(define_mode_macro MMXMODEI [V8QI V4HI V2SI]) + +;; All 8-byte vector modes handled by MMX +(define_mode_macro MMXMODE [V8QI V4HI V2SI V2SF]) + +;; Mix-n-match +(define_mode_macro MMXMODE12 [V8QI V4HI]) +(define_mode_macro MMXMODE24 [V4HI V2SI]) + +;; Mapping from integer vector mode to mnemonic suffix +(define_mode_attr mmxvecsize [(V8QI "b") (V4HI "w") (V2SI "d") (DI "q")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Move patterns +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; All of these patterns are enabled for MMX as well as 3dNOW. +;; This is essential for maintaining stable calling conventions. + +(define_expand "mov" + [(set (match_operand:MMXMODEI 0 "nonimmediate_operand" "") + (match_operand:MMXMODEI 1 "nonimmediate_operand" ""))] + "TARGET_MMX" +{ + ix86_expand_vector_move (mode, operands); + DONE; +}) + +(define_insn "*mov_internal_rex64" + [(set (match_operand:MMXMODEI 0 "nonimmediate_operand" + "=rm,r,*y,*y ,m ,*y,Y ,x,x ,m,r,x") + (match_operand:MMXMODEI 1 "vector_move_operand" + "Cr ,m,C ,*ym,*y,Y ,*y,C,xm,x,x,r"))] + "TARGET_64BIT && TARGET_MMX + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + "@ + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + movdq2q\t{%1, %0|%0, %1} + movq2dq\t{%1, %0|%0, %1} + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov") + (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*") + (set_attr "mode" "DI")]) + +(define_insn "*mov_internal" + [(set (match_operand:MMXMODEI 0 "nonimmediate_operand" + "=*y,*y ,m ,*y,*Y,*Y,*Y ,m ,*x,*x,*x,m ,?r ,?m") + (match_operand:MMXMODEI 1 "vector_move_operand" + "C ,*ym,*y,*Y,*y,C ,*Ym,*Y,C ,*x,m ,*x,irm,r"))] + "TARGET_MMX + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + "@ + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + movdq2q\t{%1, %0|%0, %1} + movq2dq\t{%1, %0|%0, %1} + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + xorps\t%0, %0 + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + # + #" + [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + +(define_expand "movv2sf" + [(set (match_operand:V2SF 0 "nonimmediate_operand" "") + (match_operand:V2SF 1 "nonimmediate_operand" ""))] + "TARGET_MMX" +{ + ix86_expand_vector_move (V2SFmode, operands); + DONE; +}) + +(define_insn "*movv2sf_internal_rex64" + [(set (match_operand:V2SF 0 "nonimmediate_operand" + "=rm,r,*y ,*y ,m ,*y,Y ,x,x,x,m,r,x") + (match_operand:V2SF 1 "vector_move_operand" + "Cr ,m ,C ,*ym,*y,Y ,*y,C,x,m,x,x,r"))] + "TARGET_64BIT && TARGET_MMX + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + "@ + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + movdq2q\t{%1, %0|%0, %1} + movq2dq\t{%1, %0|%0, %1} + xorps\t%0, %0 + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov") + (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + +(define_insn "*movv2sf_internal" + [(set (match_operand:V2SF 0 "nonimmediate_operand" + "=*y,*y ,m,*y,*Y,*x,*x,*x,m ,?r ,?m") + (match_operand:V2SF 1 "vector_move_operand" + "C ,*ym,*y,*Y,*y,C ,*x,m ,*x,irm,r"))] + "TARGET_MMX + && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + "@ + pxor\t%0, %0 + movq\t{%1, %0|%0, %1} + movq\t{%1, %0|%0, %1} + movdq2q\t{%1, %0|%0, %1} + movq2dq\t{%1, %0|%0, %1} + xorps\t%0, %0 + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1} + # + #" + [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*") + (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*") + (set_attr "mode" "DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) + +;; %%% This multiword shite has got to go. +(define_split + [(set (match_operand:MMXMODE 0 "nonimmediate_operand" "") + (match_operand:MMXMODE 1 "general_operand" ""))] + "!TARGET_64BIT && reload_completed + && (!MMX_REG_P (operands[0]) && !SSE_REG_P (operands[0])) + && (!MMX_REG_P (operands[1]) && !SSE_REG_P (operands[1]))" + [(const_int 0)] + "ix86_split_long_move (operands); DONE;") + +(define_expand "push1" + [(match_operand:MMXMODE 0 "register_operand" "")] + "TARGET_MMX" +{ + ix86_expand_push (mode, operands[0]); + DONE; +}) + +(define_expand "movmisalign" + [(set (match_operand:MMXMODE 0 "nonimmediate_operand" "") + (match_operand:MMXMODE 1 "nonimmediate_operand" ""))] + "TARGET_MMX" +{ + ix86_expand_vector_move (mode, operands); + DONE; +}) + +(define_insn "sse_movntdi" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:DI 1 "register_operand" "y")] + UNSPEC_MOVNT))] + "TARGET_SSE || TARGET_3DNOW_A" + "movntq\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxmov") + (set_attr "mode" "DI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point arithmetic +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_addv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (plus:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "%0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW && ix86_binary_operator_ok (PLUS, V2SFmode, operands)" + "pfadd\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_subv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y,y") + (minus:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "0,ym") + (match_operand:V2SF 2 "nonimmediate_operand" "ym,0")))] + "TARGET_3DNOW && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + pfsub\\t{%2, %0|%0, %2} + pfsubr\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_expand "mmx_subrv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "") + (minus:V2SF (match_operand:V2SF 2 "nonimmediate_operand" "") + (match_operand:V2SF 1 "nonimmediate_operand" "")))] + "TARGET_3DNOW && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "") + +(define_insn "mmx_mulv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (mult:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "%0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW && ix86_binary_operator_ok (MULT, V2SFmode, operands)" + "pfmul\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_smaxv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (smax:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "%0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW && ix86_binary_operator_ok (SMAX, V2SFmode, operands)" + "pfmax\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_sminv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (smin:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "%0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW && ix86_binary_operator_ok (SMIN, V2SFmode, operands)" + "pfmin\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_rcpv2sf2" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (unspec:V2SF [(match_operand:V2SF 1 "nonimmediate_operand" "ym")] + UNSPEC_PFRCP))] + "TARGET_3DNOW" + "pfrcp\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmx") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_rcpit1v2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")] + UNSPEC_PFRCPIT1))] + "TARGET_3DNOW" + "pfrcpit1\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmx") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_rcpit2v2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")] + UNSPEC_PFRCPIT2))] + "TARGET_3DNOW" + "pfrcpit2\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmx") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_rsqrtv2sf2" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (unspec:V2SF [(match_operand:V2SF 1 "nonimmediate_operand" "ym")] + UNSPEC_PFRSQRT))] + "TARGET_3DNOW" + "pfrsqrt\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmx") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_rsqit1v2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")] + UNSPEC_PFRSQIT1))] + "TARGET_3DNOW" + "pfrsqit1\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmx") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_haddv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (vec_concat:V2SF + (plus:SF + (vec_select:SF + (match_operand:V2SF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 1)]))) + (plus:SF + (vec_select:SF + (match_operand:V2SF 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_3DNOW" + "pfacc\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_hsubv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (vec_concat:V2SF + (minus:SF + (vec_select:SF + (match_operand:V2SF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 1)]))) + (minus:SF + (vec_select:SF + (match_operand:V2SF 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_3DNOW_A" + "pfnacc\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_addsubv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (vec_merge:V2SF + (plus:V2SF + (match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")) + (minus:V2SF (match_dup 1) (match_dup 2)) + (const_int 1)))] + "TARGET_3DNOW_A" + "pfpnacc\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "V2SF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point comparisons +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_gtv2sf3" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (gt:V2SI (match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW" + "pfcmpgt\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcmp") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_gev2sf3" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (ge:V2SI (match_operand:V2SF 1 "register_operand" "0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW" + "pfcmpge\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcmp") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_eqv2sf3" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (eq:V2SI (match_operand:V2SF 1 "nonimmediate_operand" "%0") + (match_operand:V2SF 2 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW && ix86_binary_operator_ok (EQ, V2SFmode, operands)" + "pfcmpeq\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcmp") + (set_attr "mode" "V2SF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point conversion operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_pf2id" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (fix:V2SI (match_operand:V2SF 1 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW" + "pf2id\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_pf2iw" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (sign_extend:V2SI + (ss_truncate:V2HI + (fix:V2SI + (match_operand:V2SF 1 "nonimmediate_operand" "ym")))))] + "TARGET_3DNOW_A" + "pf2iw\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_pi2fw" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (float:V2SF + (sign_extend:V2SI + (truncate:V2HI + (match_operand:V2SI 1 "nonimmediate_operand" "ym")))))] + "TARGET_3DNOW_A" + "pi2fw\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "V2SF")]) + +(define_insn "mmx_floatv2si2" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (float:V2SF (match_operand:V2SI 1 "nonimmediate_operand" "ym")))] + "TARGET_3DNOW" + "pi2fd\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "V2SF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point element swizzling +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_pswapdv2sf2" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (vec_select:V2SF (match_operand:V2SF 1 "nonimmediate_operand" "ym") + (parallel [(const_int 1) (const_int 0)])))] + "TARGET_3DNOW_A" + "pswapd\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "V2SF")]) + +(define_insn "*vec_dupv2sf" + [(set (match_operand:V2SF 0 "register_operand" "=y") + (vec_duplicate:V2SF + (match_operand:SF 1 "register_operand" "0")))] + "TARGET_MMX" + "punpckldq\t%0, %0" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "*mmx_concatv2sf" + [(set (match_operand:V2SF 0 "register_operand" "=y,y") + (vec_concat:V2SF + (match_operand:SF 1 "nonimmediate_operand" " 0,rm") + (match_operand:SF 2 "vector_move_operand" "ym,C")))] + "TARGET_MMX && !TARGET_SSE" + "@ + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt,mmxmov") + (set_attr "mode" "DI")]) + +(define_expand "vec_setv2sf" + [(match_operand:V2SF 0 "register_operand" "") + (match_operand:SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_insn_and_split "*vec_extractv2sf_0" + [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y,m,m,frxy") + (vec_select:SF + (match_operand:V2SF 1 "nonimmediate_operand" " x,y,x,y,m") + (parallel [(const_int 0)])))] + "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rtx op1 = operands[1]; + if (REG_P (op1)) + op1 = gen_rtx_REG (SFmode, REGNO (op1)); + else + op1 = gen_lowpart (SFmode, op1); + emit_move_insn (operands[0], op1); + DONE; +}) + +(define_insn "*vec_extractv2sf_1" + [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x,frxy") + (vec_select:SF + (match_operand:V2SF 1 "nonimmediate_operand" " 0,0,o") + (parallel [(const_int 1)])))] + "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + punpckhdq\t%0, %0 + unpckhps\t%0, %0 + #" + [(set_attr "type" "mmxcvt,sselog1,*") + (set_attr "mode" "DI,V4SF,SI")]) + +(define_split + [(set (match_operand:SF 0 "register_operand" "") + (vec_select:SF + (match_operand:V2SF 1 "memory_operand" "") + (parallel [(const_int 1)])))] + "TARGET_MMX && reload_completed" + [(const_int 0)] +{ + operands[1] = adjust_address (operands[1], SFmode, 4); + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_extractv2sf" + [(match_operand:SF 0 "register_operand" "") + (match_operand:V2SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv2sf" + [(match_operand:V2SF 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral arithmetic +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_add3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (plus:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (PLUS, mode, operands)" + "padd\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_adddi3" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI + [(plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") + (match_operand:DI 2 "nonimmediate_operand" "ym"))] + UNSPEC_NOP))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, DImode, operands)" + "paddq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ssadd3" + [(set (match_operand:MMXMODE12 0 "register_operand" "=y") + (ss_plus:MMXMODE12 + (match_operand:MMXMODE12 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODE12 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "padds\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_usadd3" + [(set (match_operand:MMXMODE12 0 "register_operand" "=y") + (us_plus:MMXMODE12 + (match_operand:MMXMODE12 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODE12 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "paddus\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_sub3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (minus:MMXMODEI + (match_operand:MMXMODEI 1 "register_operand" "0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "psub\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_subdi3" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI + [(minus:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "nonimmediate_operand" "ym"))] + UNSPEC_NOP))] + "TARGET_SSE2" + "psubq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_sssub3" + [(set (match_operand:MMXMODE12 0 "register_operand" "=y") + (ss_minus:MMXMODE12 + (match_operand:MMXMODE12 1 "register_operand" "0") + (match_operand:MMXMODE12 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "psubs\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ussub3" + [(set (match_operand:MMXMODE12 0 "register_operand" "=y") + (us_minus:MMXMODE12 + (match_operand:MMXMODE12 1 "register_operand" "0") + (match_operand:MMXMODE12 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "psubus\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_mulv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (mult:V4HI (match_operand:V4HI 1 "nonimmediate_operand" "%0") + (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmullw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "mmx_smulv4hi3_highpart" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (truncate:V4HI + (lshiftrt:V4SI + (mult:V4SI (sign_extend:V4SI + (match_operand:V4HI 1 "nonimmediate_operand" "%0")) + (sign_extend:V4SI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) + (const_int 16))))] + "TARGET_MMX && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmulhw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "mmx_umulv4hi3_highpart" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (truncate:V4HI + (lshiftrt:V4SI + (mult:V4SI (zero_extend:V4SI + (match_operand:V4HI 1 "nonimmediate_operand" "%0")) + (zero_extend:V4SI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) + (const_int 16))))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmulhuw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "mmx_pmaddwd" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (plus:V2SI + (mult:V2SI + (sign_extend:V2SI + (vec_select:V2HI + (match_operand:V4HI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0) (const_int 2)]))) + (sign_extend:V2SI + (vec_select:V2HI + (match_operand:V4HI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0) (const_int 2)])))) + (mult:V2SI + (sign_extend:V2SI + (vec_select:V2HI (match_dup 1) + (parallel [(const_int 1) (const_int 3)]))) + (sign_extend:V2SI + (vec_select:V2HI (match_dup 2) + (parallel [(const_int 1) (const_int 3)]))))))] + "TARGET_MMX && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmaddwd\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "mmx_pmulhrwv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (truncate:V4HI + (lshiftrt:V4SI + (plus:V4SI + (mult:V4SI + (sign_extend:V4SI + (match_operand:V4HI 1 "nonimmediate_operand" "%0")) + (sign_extend:V4SI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) + (const_vector:V4SI [(const_int 32768) (const_int 32768) + (const_int 32768) (const_int 32768)])) + (const_int 16))))] + "TARGET_3DNOW && ix86_binary_operator_ok (MULT, V4HImode, operands)" + "pmulhrw\\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "sse2_umulsidi3" + [(set (match_operand:DI 0 "register_operand" "=y") + (mult:DI + (zero_extend:DI + (vec_select:SI + (match_operand:V2SI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0)]))) + (zero_extend:DI + (vec_select:SI + (match_operand:V2SI 2 "nonimmediate_operand" "ym") + (parallel [(const_int 0)])))))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V2SImode, operands)" + "pmuludq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxmul") + (set_attr "mode" "DI")]) + +(define_insn "mmx_umaxv8qi3" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (umax:V8QI (match_operand:V8QI 1 "nonimmediate_operand" "%0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (UMAX, V8QImode, operands)" + "pmaxub\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_smaxv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (smax:V4HI (match_operand:V4HI 1 "nonimmediate_operand" "%0") + (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (SMAX, V4HImode, operands)" + "pmaxsw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_uminv8qi3" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (umin:V8QI (match_operand:V8QI 1 "nonimmediate_operand" "%0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (UMIN, V8QImode, operands)" + "pminub\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_sminv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (smin:V4HI (match_operand:V4HI 1 "nonimmediate_operand" "%0") + (match_operand:V4HI 2 "nonimmediate_operand" "ym")))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (SMIN, V4HImode, operands)" + "pminsw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ashr3" + [(set (match_operand:MMXMODE24 0 "register_operand" "=y") + (ashiftrt:MMXMODE24 + (match_operand:MMXMODE24 1 "register_operand" "0") + (match_operand:DI 2 "nonmemory_operand" "yi")))] + "TARGET_MMX" + "psra\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_lshr3" + [(set (match_operand:MMXMODE24 0 "register_operand" "=y") + (lshiftrt:MMXMODE24 + (match_operand:MMXMODE24 1 "register_operand" "0") + (match_operand:DI 2 "nonmemory_operand" "yi")))] + "TARGET_MMX" + "psrl\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_lshrdi3" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI + [(lshiftrt:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "nonmemory_operand" "yi"))] + UNSPEC_NOP))] + "TARGET_MMX" + "psrlq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ashl3" + [(set (match_operand:MMXMODE24 0 "register_operand" "=y") + (ashift:MMXMODE24 + (match_operand:MMXMODE24 1 "register_operand" "0") + (match_operand:DI 2 "nonmemory_operand" "yi")))] + "TARGET_MMX" + "psll\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ashldi3" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI + [(ashift:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "nonmemory_operand" "yi"))] + UNSPEC_NOP))] + "TARGET_MMX" + "psllq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral comparisons +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_eq3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (eq:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (EQ, mode, operands)" + "pcmpeq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcmp") + (set_attr "mode" "DI")]) + +(define_insn "mmx_gt3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (gt:MMXMODEI + (match_operand:MMXMODEI 1 "register_operand" "0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "pcmpgt\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcmp") + (set_attr "mode" "DI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral logical operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_and3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (and:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (AND, mode, operands)" + "pand\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_nand3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (and:MMXMODEI + (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand" "0")) + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX" + "pandn\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_ior3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (ior:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (IOR, mode, operands)" + "por\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI")]) + +(define_insn "mmx_xor3" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (xor:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "%0") + (match_operand:MMXMODEI 2 "nonimmediate_operand" "ym")))] + "TARGET_MMX && ix86_binary_operator_ok (XOR, mode, operands)" + "pxor\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxadd") + (set_attr "mode" "DI") + (set_attr "memory" "none")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral element swizzling +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_packsswb" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (vec_concat:V8QI + (ss_truncate:V4QI + (match_operand:V4HI 1 "register_operand" "0")) + (ss_truncate:V4QI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))))] + "TARGET_MMX" + "packsswb\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_packssdw" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_concat:V4HI + (ss_truncate:V2HI + (match_operand:V2SI 1 "register_operand" "0")) + (ss_truncate:V2HI + (match_operand:V2SI 2 "nonimmediate_operand" "ym"))))] + "TARGET_MMX" + "packssdw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_packuswb" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (vec_concat:V8QI + (us_truncate:V4QI + (match_operand:V4HI 1 "register_operand" "0")) + (us_truncate:V4QI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))))] + "TARGET_MMX" + "packuswb\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpckhbw" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "register_operand" "0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 4) (const_int 12) + (const_int 5) (const_int 13) + (const_int 6) (const_int 14) + (const_int 7) (const_int 15)])))] + "TARGET_MMX" + "punpckhbw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpcklbw" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "register_operand" "0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 0) (const_int 8) + (const_int 1) (const_int 9) + (const_int 2) (const_int 10) + (const_int 3) (const_int 11)])))] + "TARGET_MMX" + "punpcklbw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpckhwd" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "register_operand" "0") + (match_operand:V4HI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 2) (const_int 6) + (const_int 3) (const_int 7)])))] + "TARGET_MMX" + "punpckhwd\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpcklwd" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "register_operand" "0") + (match_operand:V4HI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 0) (const_int 4) + (const_int 1) (const_int 5)])))] + "TARGET_MMX" + "punpcklwd\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpckhdq" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_select:V2SI + (vec_concat:V4SI + (match_operand:V2SI 1 "register_operand" "0") + (match_operand:V2SI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 1) + (const_int 3)])))] + "TARGET_MMX" + "punpckhdq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_punpckldq" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_select:V2SI + (vec_concat:V4SI + (match_operand:V2SI 1 "register_operand" "0") + (match_operand:V2SI 2 "nonimmediate_operand" "ym")) + (parallel [(const_int 0) + (const_int 2)])))] + "TARGET_MMX" + "punpckldq\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_expand "mmx_pinsrw" + [(set (match_operand:V4HI 0 "register_operand" "") + (vec_merge:V4HI + (vec_duplicate:V4HI + (match_operand:SI 2 "nonimmediate_operand" "")) + (match_operand:V4HI 1 "register_operand" "") + (match_operand:SI 3 "const_0_to_3_operand" "")))] + "TARGET_SSE || TARGET_3DNOW_A" +{ + operands[2] = gen_lowpart (HImode, operands[2]); + operands[3] = GEN_INT (1 << INTVAL (operands[3])); +}) + +(define_insn "*mmx_pinsrw" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_merge:V4HI + (vec_duplicate:V4HI + (match_operand:HI 2 "nonimmediate_operand" "rm")) + (match_operand:V4HI 1 "register_operand" "0") + (match_operand:SI 3 "const_pow2_1_to_8_operand" "n")))] + "TARGET_SSE || TARGET_3DNOW_A" +{ + operands[3] = GEN_INT (exact_log2 (INTVAL (operands[3]))); + return "pinsrw\t{%3, %k2, %0|%0, %k2, %3}"; +} + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_pextrw" + [(set (match_operand:SI 0 "register_operand" "=r") + (zero_extend:SI + (vec_select:HI + (match_operand:V4HI 1 "register_operand" "y") + (parallel [(match_operand:SI 2 "const_0_to_3_operand" "n")]))))] + "TARGET_SSE || TARGET_3DNOW_A" + "pextrw\t{%2, %1, %0|%0, %1, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_expand "mmx_pshufw" + [(match_operand:V4HI 0 "register_operand" "") + (match_operand:V4HI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "const_int_operand" "")] + "TARGET_SSE || TARGET_3DNOW_A" +{ + int mask = INTVAL (operands[2]); + emit_insn (gen_mmx_pshufw_1 (operands[0], operands[1], + GEN_INT ((mask >> 0) & 3), + GEN_INT ((mask >> 2) & 3), + GEN_INT ((mask >> 4) & 3), + GEN_INT ((mask >> 6) & 3))); + DONE; +}) + +(define_insn "mmx_pshufw_1" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_select:V4HI + (match_operand:V4HI 1 "nonimmediate_operand" "ym") + (parallel [(match_operand 2 "const_0_to_3_operand" "") + (match_operand 3 "const_0_to_3_operand" "") + (match_operand 4 "const_0_to_3_operand" "") + (match_operand 5 "const_0_to_3_operand" "")])))] + "TARGET_SSE || TARGET_3DNOW_A" +{ + int mask = 0; + mask |= INTVAL (operands[2]) << 0; + mask |= INTVAL (operands[3]) << 2; + mask |= INTVAL (operands[4]) << 4; + mask |= INTVAL (operands[5]) << 6; + operands[2] = GEN_INT (mask); + + return "pshufw\t{%2, %1, %0|%0, %1, %2}"; +} + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_pswapdv2si2" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_select:V2SI + (match_operand:V2SI 1 "nonimmediate_operand" "ym") + (parallel [(const_int 1) (const_int 0)])))] + "TARGET_3DNOW_A" + "pswapd\\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "*vec_dupv4hi" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (vec_duplicate:V4HI + (truncate:HI + (match_operand:SI 1 "register_operand" "0"))))] + "TARGET_SSE || TARGET_3DNOW_A" + "pshufw\t{$0, %0, %0|%0, %0, 0}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "*vec_dupv2si" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_duplicate:V2SI + (match_operand:SI 1 "register_operand" "0")))] + "TARGET_MMX" + "punpckldq\t%0, %0" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "*mmx_concatv2si" + [(set (match_operand:V2SI 0 "register_operand" "=y,y") + (vec_concat:V2SI + (match_operand:SI 1 "nonimmediate_operand" " 0,rm") + (match_operand:SI 2 "vector_move_operand" "ym,C")))] + "TARGET_MMX && !TARGET_SSE" + "@ + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt,mmxmov") + (set_attr "mode" "DI")]) + +(define_expand "vec_setv2si" + [(match_operand:V2SI 0 "register_operand" "") + (match_operand:SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_insn_and_split "*vec_extractv2si_0" + [(set (match_operand:SI 0 "nonimmediate_operand" "=x,y,m,m,frxy") + (vec_select:SI + (match_operand:V2SI 1 "nonimmediate_operand" " x,y,x,y,m") + (parallel [(const_int 0)])))] + "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rtx op1 = operands[1]; + if (REG_P (op1)) + op1 = gen_rtx_REG (SImode, REGNO (op1)); + else + op1 = gen_lowpart (SImode, op1); + emit_move_insn (operands[0], op1); + DONE; +}) + +(define_insn "*vec_extractv2si_1" + [(set (match_operand:SI 0 "nonimmediate_operand" "=y,Y,Y,x,frxy") + (vec_select:SI + (match_operand:V2SI 1 "nonimmediate_operand" " 0,0,Y,0,o") + (parallel [(const_int 1)])))] + "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + punpckhdq\t%0, %0 + punpckhdq\t%0, %0 + pshufd\t{$85, %1, %0|%0, %1, 85} + unpckhps\t%0, %0 + #" + [(set_attr "type" "mmxcvt,sselog1,sselog1,sselog1,*") + (set_attr "mode" "DI,TI,TI,V4SF,SI")]) + +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (vec_select:SI + (match_operand:V2SI 1 "memory_operand" "") + (parallel [(const_int 1)])))] + "TARGET_MMX && reload_completed" + [(const_int 0)] +{ + operands[1] = adjust_address (operands[1], SImode, 4); + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_extractv2si" + [(match_operand:SI 0 "register_operand" "") + (match_operand:V2SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv2si" + [(match_operand:V2SI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv4hi" + [(match_operand:V4HI 0 "register_operand" "") + (match_operand:HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv4hi" + [(match_operand:HI 0 "register_operand" "") + (match_operand:V4HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv4hi" + [(match_operand:V4HI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv8qi" + [(match_operand:V8QI 0 "register_operand" "") + (match_operand:QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv8qi" + [(match_operand:QI 0 "register_operand" "") + (match_operand:V8QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_MMX" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv8qi" + [(match_operand:V8QI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Miscellaneous +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "mmx_uavgv8qi3" + [(set (match_operand:V8QI 0 "register_operand" "=y") + (truncate:V8QI + (lshiftrt:V8HI + (plus:V8HI + (plus:V8HI + (zero_extend:V8HI + (match_operand:V8QI 1 "nonimmediate_operand" "%0")) + (zero_extend:V8HI + (match_operand:V8QI 2 "nonimmediate_operand" "ym"))) + (const_vector:V8HI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "(TARGET_SSE || TARGET_3DNOW) + && ix86_binary_operator_ok (PLUS, V8QImode, operands)" +{ + /* These two instructions have the same operation, but their encoding + is different. Prefer the one that is de facto standard. */ + if (TARGET_SSE || TARGET_3DNOW_A) + return "pavgb\t{%2, %0|%0, %2}"; + else + return "pavgusb\\t{%2, %0|%0, %2}"; +} + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_uavgv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=y") + (truncate:V4HI + (lshiftrt:V4SI + (plus:V4SI + (plus:V4SI + (zero_extend:V4SI + (match_operand:V4HI 1 "nonimmediate_operand" "%0")) + (zero_extend:V4SI + (match_operand:V4HI 2 "nonimmediate_operand" "ym"))) + (const_vector:V4SI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "(TARGET_SSE || TARGET_3DNOW_A) + && ix86_binary_operator_ok (PLUS, V4HImode, operands)" + "pavgw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_psadbw" + [(set (match_operand:DI 0 "register_operand" "=y") + (unspec:DI [(match_operand:V8QI 1 "register_operand" "0") + (match_operand:V8QI 2 "nonimmediate_operand" "ym")] + UNSPEC_PSADBW))] + "TARGET_SSE || TARGET_3DNOW_A" + "psadbw\t{%2, %0|%0, %2}" + [(set_attr "type" "mmxshft") + (set_attr "mode" "DI")]) + +(define_insn "mmx_pmovmskb" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] + UNSPEC_MOVMSK))] + "TARGET_SSE || TARGET_3DNOW_A" + "pmovmskb\t{%1, %0|%0, %1}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_expand "mmx_maskmovq" + [(set (match_operand:V8QI 0 "memory_operand" "") + (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y") + (match_operand:V8QI 2 "register_operand" "y") + (match_dup 0)] + UNSPEC_MASKMOV))] + "TARGET_SSE || TARGET_3DNOW_A" + "") + +(define_insn "*mmx_maskmovq" + [(set (mem:V8QI (match_operand:SI 0 "register_operand" "D")) + (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y") + (match_operand:V8QI 2 "register_operand" "y") + (mem:V8QI (match_dup 0))] + UNSPEC_MASKMOV))] + "(TARGET_SSE || TARGET_3DNOW_A) && !TARGET_64BIT" + ;; @@@ check ordering of operands in intel/nonintel syntax + "maskmovq\t{%2, %1|%1, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "*mmx_maskmovq_rex" + [(set (mem:V8QI (match_operand:DI 0 "register_operand" "D")) + (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y") + (match_operand:V8QI 2 "register_operand" "y") + (mem:V8QI (match_dup 0))] + UNSPEC_MASKMOV))] + "(TARGET_SSE || TARGET_3DNOW_A) && TARGET_64BIT" + ;; @@@ check ordering of operands in intel/nonintel syntax + "maskmovq\t{%2, %1|%1, %2}" + [(set_attr "type" "mmxcvt") + (set_attr "mode" "DI")]) + +(define_insn "mmx_emms" + [(unspec_volatile [(const_int 0)] UNSPECV_EMMS) + (clobber (reg:XF 8)) + (clobber (reg:XF 9)) + (clobber (reg:XF 10)) + (clobber (reg:XF 11)) + (clobber (reg:XF 12)) + (clobber (reg:XF 13)) + (clobber (reg:XF 14)) + (clobber (reg:XF 15)) + (clobber (reg:DI 29)) + (clobber (reg:DI 30)) + (clobber (reg:DI 31)) + (clobber (reg:DI 32)) + (clobber (reg:DI 33)) + (clobber (reg:DI 34)) + (clobber (reg:DI 35)) + (clobber (reg:DI 36))] + "TARGET_MMX" + "emms" + [(set_attr "type" "mmx") + (set_attr "memory" "unknown")]) + +(define_insn "mmx_femms" + [(unspec_volatile [(const_int 0)] UNSPECV_FEMMS) + (clobber (reg:XF 8)) + (clobber (reg:XF 9)) + (clobber (reg:XF 10)) + (clobber (reg:XF 11)) + (clobber (reg:XF 12)) + (clobber (reg:XF 13)) + (clobber (reg:XF 14)) + (clobber (reg:XF 15)) + (clobber (reg:DI 29)) + (clobber (reg:DI 30)) + (clobber (reg:DI 31)) + (clobber (reg:DI 32)) + (clobber (reg:DI 33)) + (clobber (reg:DI 34)) + (clobber (reg:DI 35)) + (clobber (reg:DI 36))] + "TARGET_3DNOW" + "femms" + [(set_attr "type" "mmx") + (set_attr "memory" "none")]) diff --git a/contrib/gcc/config/i386/netbsd-elf.h b/contrib/gcc/config/i386/netbsd-elf.h index bd2e9de55e7..d03afa8ffcc 100644 --- a/contrib/gcc/config/i386/netbsd-elf.h +++ b/contrib/gcc/config/i386/netbsd-elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for i386/ELF NetBSD systems. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by matthew green This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ diff --git a/contrib/gcc/config/i386/netbsd64.h b/contrib/gcc/config/i386/netbsd64.h index 66f31e03290..df72e70549d 100644 --- a/contrib/gcc/config/i386/netbsd64.h +++ b/contrib/gcc/config/i386/netbsd64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for x86-64/ELF NetBSD systems. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ diff --git a/contrib/gcc/config/i386/netware-crt0.c b/contrib/gcc/config/i386/netware-crt0.c new file mode 100644 index 00000000000..3b4a11583bf --- /dev/null +++ b/contrib/gcc/config/i386/netware-crt0.c @@ -0,0 +1,80 @@ +/* Startup routines for NetWare. + Contributed by Jan Beulich (jbeulich@novell.com) + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include +#include +#include "unwind-dw2-fde.h" + +int __init_environment (void *); +int __deinit_environment (void *); + + +#define SECTION_DECL(name, decl) decl __attribute__((__section__(name))) + +SECTION_DECL(".ctors", void(*const __CTOR_LIST__)(void)) + = (void(*)(void))(intptr_t)-1; +SECTION_DECL(".ctors$_", void(*const __CTOR_END__)(void)) = NULL; + +SECTION_DECL(".dtors", void(*const __DTOR_LIST__)(void)) + = (void(*)(void))(intptr_t)-1; +SECTION_DECL(".dtors$_", void(*const __DTOR_END__)(void)) = NULL; + +/* No need to use the __[de]register_frame_info_bases functions since + for us the bases are NULL always anyway. */ +void __register_frame_info (const void *, struct object *) + __attribute__((__weak__)); +void *__deregister_frame_info (const void *) __attribute__((__weak__)); + +SECTION_DECL(".eh_frame", /*const*/ uint32_t __EH_FRAME_BEGIN__[]) = { }; +SECTION_DECL(".eh_frame$_", /*const*/ uint32_t __EH_FRAME_END__[]) = {0}; + +int +__init_environment (void *unused __attribute__((__unused__))) +{ + void (* const * pctor)(void); + static struct object object; + + if (__register_frame_info) + __register_frame_info (__EH_FRAME_BEGIN__, &object); + + for (pctor = &__CTOR_END__ - 1; pctor > &__CTOR_LIST__; --pctor) + if (*pctor != NULL) + (*pctor)(); + + return 0; +} + +int +__deinit_environment (void *unused __attribute__((__unused__))) +{ + /* This should be static to prevent calling the same destructor + twice (just in case where we get here multiple times). */ + static void (* const * pdtor)(void) = &__DTOR_LIST__ + 1; + + while (pdtor < &__DTOR_END__) + if (*pdtor++ != NULL) + pdtor[-1] (); + + if (__deregister_frame_info) + __deregister_frame_info(__EH_FRAME_BEGIN__); + + return 0; +} diff --git a/contrib/gcc/config/i386/netware-libgcc.c b/contrib/gcc/config/i386/netware-libgcc.c new file mode 100644 index 00000000000..6ad9669da86 --- /dev/null +++ b/contrib/gcc/config/i386/netware-libgcc.c @@ -0,0 +1,59 @@ +/* Startup code for libgcc_s.nlm, necessary because we can't allow + libgcc_s to use libc's malloc & Co., which associate allocations + with the NLM owning the current (application) thread. + Contributed by Jan Beulich (jbeulich@novell.com) + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include +#include +#include +#include + +static rtag_t allocRTag; + +BOOL +DllMain (HINSTANCE libraryId __attribute__ ((__unused__)), + DWORD reason, void *hModule) +{ + switch (reason) + { + case DLL_NLM_STARTUP: + allocRTag = AllocateResourceTag (hModule, + "libgcc memory", AllocSignature); + return allocRTag != NULL; + case DLL_NLM_SHUTDOWN: + /* This does not recover resources associated with the tag... + ReturnResourceTag (allocRTag, 0); */ + break; + } + return 1; +} + +void * +malloc (size_t size) +{ + return AllocSleepOK (size, allocRTag, NULL); +} + +void +free (void *ptr) +{ + Free (ptr); +} diff --git a/contrib/gcc/config/i386/netware-libgcc.def b/contrib/gcc/config/i386/netware-libgcc.def new file mode 100644 index 00000000000..a545631b111 --- /dev/null +++ b/contrib/gcc/config/i386/netware-libgcc.def @@ -0,0 +1,2 @@ +description "gcc runtime and intrinsics support" +copyright "Copyright (C) 1989-2005 Free Software Foundation, Inc." diff --git a/contrib/gcc/config/i386/netware-libgcc.exp b/contrib/gcc/config/i386/netware-libgcc.exp new file mode 100644 index 00000000000..a3498c0e720 --- /dev/null +++ b/contrib/gcc/config/i386/netware-libgcc.exp @@ -0,0 +1,74 @@ +# libgcc_s.nlm exports + (libgcc2), + __absvdi2, + __absvsi2, + __addvdi3, + __addvsi3, +# __ashldi3, +# __ashrdi3, + __clzdi2, + __clzsi2, + __ctzdi2, + __ctzsi2, + __deregister_frame, + __deregister_frame_info, + __deregister_frame_info_bases, + __divdc3, +# __divdi3, + __divsc3, +# __divtc3, + __divxc3, + __ffsdi2, + __ffssi2, + __fixunsdfdi, + __fixunssfdi, +# __fixunstfdi, + __fixunsxfdi, + __gcc_bcmp, + __gcc_personality_v0, +# __lshrdi3, +# __moddi3, + __muldc3, +# __muldi3, + __mulsc3, +# __multc3, + __mulvdi3, + __mulvsi3, + __mulxc3, + __negvdi2, + __negvsi2, + __paritydi2, + __paritysi2, + __popcountdi2, + __popcountsi2, + __powidf2 + __powisf2 +# __powitf2 + __powixf2 + __register_frame, + __register_frame_info, + __register_frame_info_bases, + __register_frame_info_table, + __register_frame_info_table_bases, + __register_frame_table, + __subvdi3, + __subvsi3, +# __umoddi3, +# __udivdi3, + _Unwind_Backtrace, + _Unwind_DeleteException, + _Unwind_FindEnclosingFunction, + _Unwind_Find_FDE, + _Unwind_ForcedUnwind, + _Unwind_GetCFA, + _Unwind_GetDataRelBase, + _Unwind_GetGR, + _Unwind_GetIP, + _Unwind_GetLanguageSpecificData, + _Unwind_GetRegionStart, + _Unwind_GetTextRelBase, + _Unwind_RaiseException, + _Unwind_Resume, + _Unwind_Resume_or_Rethrow, + _Unwind_SetGR, + _Unwind_SetIP diff --git a/contrib/gcc/config/i386/netware.c b/contrib/gcc/config/i386/netware.c new file mode 100644 index 00000000000..c26d63436a3 --- /dev/null +++ b/contrib/gcc/config/i386/netware.c @@ -0,0 +1,194 @@ +/* Subroutines for insn-output.c for NetWare. + Contributed by Jan Beulich (jbeulich@novell.com) + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "output.h" +#include "tree.h" +#include "flags.h" +#include "tm_p.h" +#include "toplev.h" +#include "ggc.h" + + +/* Return string which is the former assembler name modified with an + underscore prefix and a suffix consisting of an atsign (@) followed + by the number of bytes of arguments */ + +static tree +gen_stdcall_or_fastcall_decoration (tree decl, char prefix) +{ + unsigned total = 0; + /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead + of DECL_ASSEMBLER_NAME. */ + const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + char *newsym; + tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + + if (formal_type != NULL_TREE) + { + /* These attributes are ignored for variadic functions in + i386.c:ix86_return_pops_args. For compatibility with MS + compiler do not add @0 suffix here. */ + if (TREE_VALUE (tree_last (formal_type)) != void_type_node) + return NULL_TREE; + + /* Quit if we hit an incomplete type. Error is reported + by convert_arguments in c-typeck.c or cp/typeck.c. */ + while (TREE_VALUE (formal_type) != void_type_node + && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) + { + unsigned parm_size + = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + + /* Must round up to include padding. This is done the same + way as in store_one_arg. */ + parm_size = ((parm_size + PARM_BOUNDARY - 1) + / PARM_BOUNDARY * PARM_BOUNDARY); + total += parm_size; + formal_type = TREE_CHAIN (formal_type); + } + } + + newsym = alloca (1 + strlen (asmname) + 1 + 10 + 1); + return get_identifier_with_length (newsym, + sprintf (newsym, + "%c%s@%u", + prefix, + asmname, + total / BITS_PER_UNIT)); +} + +/* Return string which is the former assembler name modified with an + _n@ prefix where n represents the number of arguments passed in + registers */ + +static tree +gen_regparm_prefix (tree decl, unsigned nregs) +{ + unsigned total = 0; + /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead + of DECL_ASSEMBLER_NAME. */ + const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + char *newsym; + tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + + if (formal_type != NULL_TREE) + { + /* This attribute is ignored for variadic functions. */ + if (TREE_VALUE (tree_last (formal_type)) != void_type_node) + return NULL_TREE; + + /* Quit if we hit an incomplete type. Error is reported + by convert_arguments in c-typeck.c or cp/typeck.c. */ + while (TREE_VALUE (formal_type) != void_type_node + && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) + { + unsigned parm_size + = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + + /* Must round up to include padding. This is done the same + way as in store_one_arg. */ + parm_size = ((parm_size + PARM_BOUNDARY - 1) + / PARM_BOUNDARY * PARM_BOUNDARY); + total += parm_size; + formal_type = TREE_CHAIN (formal_type); + } + } + + if (nregs > total / BITS_PER_WORD) + nregs = total / BITS_PER_WORD; + gcc_assert (nregs <= 9); + newsym = alloca (3 + strlen (asmname) + 1); + return get_identifier_with_length (newsym, + sprintf (newsym, + "_%u@%s", + nregs, + asmname)); +} + +void +i386_nlm_encode_section_info (tree decl, rtx rtl, int first) +{ + default_encode_section_info (decl, rtl, first); + + if (first + && TREE_CODE (decl) == FUNCTION_DECL + && *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*' + && !strchr (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), '@')) + { + tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl)); + tree newid; + + if (lookup_attribute ("stdcall", type_attributes)) + newid = gen_stdcall_or_fastcall_decoration (decl, '_'); + else if (lookup_attribute ("fastcall", type_attributes)) + newid = gen_stdcall_or_fastcall_decoration (decl, FASTCALL_PREFIX); + else if ((newid = lookup_attribute ("regparm", type_attributes)) != NULL_TREE) + newid = gen_regparm_prefix (decl, + TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (newid)))); + if (newid != NULL_TREE) + { + rtx rtlname = XEXP (rtl, 0); + + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + XSTR (rtlname, 0) = IDENTIFIER_POINTER (newid); + /* These attributes must be present on first declaration, + change_decl_assembler_name will warn if they are added + later and the decl has been referenced, but duplicate_decls + should catch the mismatch before this is called. */ + change_decl_assembler_name (decl, newid); + } + } +} + +/* Strip the stdcall/fastcall/regparm pre-/suffix. */ + +const char * +i386_nlm_strip_name_encoding (const char *str) +{ + const char *name = default_strip_name_encoding (str); + + if (*str != '*' && (*name == '_' || *name == '@')) + { + const char *p = strchr (name + 1, '@'); + + if (p) + { + ++name; + if (ISDIGIT (p[1])) + name = ggc_alloc_string (name, p - name); + else + { + gcc_assert (ISDIGIT (*name)); + name++; + gcc_assert (name == p); + } + } + } + return name; +} diff --git a/contrib/gcc/config/i386/nto.h b/contrib/gcc/config/i386/nto.h index 8860c8becf5..1095a631319 100644 --- a/contrib/gcc/config/i386/nto.h +++ b/contrib/gcc/config/i386/nto.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef DEFAULT_PCC_STRUCT_RETURN #define DEFAULT_PCC_STRUCT_RETURN 1 @@ -37,11 +37,6 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("system=qnxnto"); \ builtin_assert ("system=nto"); \ builtin_assert ("system=unix"); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) diff --git a/contrib/gcc/config/i386/nwld.c b/contrib/gcc/config/i386/nwld.c new file mode 100644 index 00000000000..4688ca0108c --- /dev/null +++ b/contrib/gcc/config/i386/nwld.c @@ -0,0 +1,74 @@ +/* Subroutines for insn-output.c for NetWare. + Contributed by Jan Beulich (jbeulich@novell.com) + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "output.h" +#include "tree.h" +#include "flags.h" +#include "tm_p.h" +#include "toplev.h" + +void +nwld_named_section_asm_out_constructor (rtx symbol, int priority) +{ +#if !SUPPORTS_INIT_PRIORITY + const char section[] = ".ctors"TARGET_SUB_SECTION_SEPARATOR; +#else + char section[20]; + + sprintf (section, + ".ctors"TARGET_SUB_SECTION_SEPARATOR"%.5u", + /* Invert the numbering so the linker puts us in the proper + order; constructors are run from right to left, and the + linker sorts in increasing order. */ + MAX_INIT_PRIORITY - priority); +#endif + + switch_to_section (get_section (section, 0, NULL)); + assemble_align (POINTER_SIZE); + assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); +} + +void +nwld_named_section_asm_out_destructor (rtx symbol, int priority) +{ +#if !SUPPORTS_INIT_PRIORITY + const char section[] = ".dtors"TARGET_SUB_SECTION_SEPARATOR; +#else + char section[20]; + + sprintf (section, ".dtors"TARGET_SUB_SECTION_SEPARATOR"%.5u", + /* Invert the numbering so the linker puts us in the proper + order; destructors are run from left to right, and the + linker sorts in increasing order. */ + MAX_INIT_PRIORITY - priority); +#endif + + switch_to_section (get_section (section, 0, NULL)); + assemble_align (POINTER_SIZE); + assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); +} diff --git a/contrib/gcc/config/i386/nwld.h b/contrib/gcc/config/i386/nwld.h new file mode 100644 index 00000000000..fe132afbf84 --- /dev/null +++ b/contrib/gcc/config/i386/nwld.h @@ -0,0 +1,63 @@ +/* nwld.h -- defines to be used when targeting GCC for some generic NetWare + system while using the Novell linker. + Copyright (C) 2004 Free Software Foundation, Inc. + + Written by Jan Beulich (jbeulich@novell.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef LIB_SPEC +#define LIB_SPEC "-lc --def-file libc.def%s" + +#undef LIBGCC_SPEC +#define LIBGCC_SPEC "-lgcc %{!static-libgcc:--def-file libgcc.def%s}" + +#undef LINKER_NAME +#define LINKER_NAME "nwld" + +#undef LINK_SPEC +#define LINK_SPEC "--format:NLM --extensions:GNU" \ + " %{static:%{!nostdlib:%{!nodefaultlib:%eStatic linking is not supported.\n}}}" + +#undef LINK_GCC_C_SEQUENCE_SPEC +#define LINK_GCC_C_SEQUENCE_SPEC "%L %G" + +/* In order to permit the linker to derive the output filename from the first + input file, put the common startup code as the last object. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crt0%O%s ../imports/%{!posix:libc}%{posix:posix}pre.gcc%O%s" \ + " --def-file %{!posix:libc}%{posix:posix}pre.def%s" + +#define DRIVER_SELF_SPECS "%{!static-libgcc:-shared-libgcc}" + +#define TARGET_SUB_SECTION_SEPARATOR "$" + +void nwld_named_section_asm_out_constructor (rtx, int); +void nwld_named_section_asm_out_destructor (rtx, int); + +#define TARGET_ASM_CONSTRUCTOR nwld_named_section_asm_out_constructor +#define TARGET_ASM_DESTRUCTOR nwld_named_section_asm_out_destructor + +#undef EH_FRAME_SECTION_NAME +#define EH_FRAME_SECTION_NAME ".eh_frame"TARGET_SUB_SECTION_SEPARATOR + +/* nwld does not currently support stabs debug info */ +#undef DBX_DEBUGGING_INFO diff --git a/contrib/gcc/config/i386/openbsd.h b/contrib/gcc/config/i386/openbsd.h index 14de0188c80..6c5be7262bd 100644 --- a/contrib/gcc/config/i386/openbsd.h +++ b/contrib/gcc/config/i386/openbsd.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (OpenBSD/i386)"); diff --git a/contrib/gcc/config/i386/openbsdelf.h b/contrib/gcc/config/i386/openbsdelf.h new file mode 100644 index 00000000000..9323121118d --- /dev/null +++ b/contrib/gcc/config/i386/openbsdelf.h @@ -0,0 +1,132 @@ +/* Configuration for an OpenBSD i386 target. + + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using + libraries compiled with the native cc, so undef it. */ +#undef NO_DOLLAR_IN_LABEL + +/* Override the default comment-starter of "/". */ +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "#" + +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n] + +/* This goes away when the math-emulator is fixed */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT \ + (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387) + +/* Run-time target specifications */ + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + OPENBSD_OS_CPP_BUILTINS(); \ + } \ + while (0) + +/* As an elf system, we need crtbegin/crtend stuff. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "\ + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \ + crtbegin%O%s} %{shared:crtbeginS%O%s}" +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}" + +/* Layout of source language data types. */ + +/* This must agree with */ +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE BITS_PER_WORD + +/* Assembler format: overall framework. */ + +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" + +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" + +#undef SET_ASM_OP +#define SET_ASM_OP "\t.set\t" + +/* The following macros were originally stolen from i386v4.h. + These have to be defined to get PIC code correct. */ + +/* Assembler format: dispatch tables. */ + +/* Assembler format: sections. */ + +/* Stack & calling: aggregate returns. */ + +/* Don't default to pcc-struct-return, because gcc is the only compiler, and + we want to retain compatibility with older gcc versions. */ +#define DEFAULT_PCC_STRUCT_RETURN 0 + +/* Assembler format: alignment output. */ + +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ + if ((LOG) != 0) {\ + if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ + } +#endif + +/* Stack & calling: profiling. */ + +/* OpenBSD's profiler recovers all information from the stack pointer. + The icky part is not here, but in machine/profile.h. */ +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(FILE, LABELNO) \ + fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE); + +/* Assembler format: exception region output. */ + +/* our configuration still doesn't handle dwarf2 correctly */ +#define DWARF2_UNWIND_INFO 0 + +/* Assembler format: alignment output. */ + +/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */ + +/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */ + +#undef LINK_SPEC +#define LINK_SPEC \ + "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \ + %{shared:-shared} %{R*} \ + %{static:-Bstatic} \ + %{!static:-Bdynamic} \ + %{assert*} \ + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}" + +#define OBSD_HAS_CORRECT_SPECS diff --git a/contrib/gcc/config/i386/pentium.md b/contrib/gcc/config/i386/pentium.md index 5fec8113b73..1f994dd60ae 100644 --- a/contrib/gcc/config/i386/pentium.md +++ b/contrib/gcc/config/i386/pentium.md @@ -15,8 +15,8 @@ ;; ;; 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. */ +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. */ ;; ;; The Pentium is an in-order core with two integer pipelines. diff --git a/contrib/gcc/config/i386/pmm_malloc.h b/contrib/gcc/config/i386/pmm_malloc.h new file mode 100644 index 00000000000..744ac6d41cc --- /dev/null +++ b/contrib/gcc/config/i386/pmm_malloc.h @@ -0,0 +1,60 @@ +/* Copyright (C) 2004, 2006 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +#ifndef _MM_MALLOC_H_INCLUDED +#define _MM_MALLOC_H_INCLUDED + +#include + +/* We can't depend on since the prototype of posix_memalign + may not be visible. */ +#ifndef __cplusplus +extern int posix_memalign (void **, size_t, size_t); +#else +extern "C" int posix_memalign (void **, size_t, size_t) throw (); +#endif + +static __inline void * +_mm_malloc (size_t size, size_t alignment) +{ + void *ptr; + if (alignment == 1) + return malloc (size); + if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4)) + alignment = sizeof (void *); + if (posix_memalign (&ptr, alignment, size) == 0) + return ptr; + else + return NULL; +} + +static __inline void +_mm_free (void * ptr) +{ + free (ptr); +} + +#endif /* _MM_MALLOC_H_INCLUDED */ diff --git a/contrib/gcc/config/i386/pmmintrin.h b/contrib/gcc/config/i386/pmmintrin.h index 3b18e2a11bd..7dbf03043fb 100644 --- a/contrib/gcc/config/i386/pmmintrin.h +++ b/contrib/gcc/config/i386/pmmintrin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -14,8 +14,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -25,7 +25,7 @@ Public License. */ /* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ + User Guide and Reference, version 9.0. */ #ifndef _PMMINTRIN_H_INCLUDED #define _PMMINTRIN_H_INCLUDED @@ -44,88 +44,83 @@ #define _MM_GET_DENORMALS_ZERO_MODE() \ (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_addsub_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_hadd_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_hsub_ps (__m128 __X, __m128 __Y) { return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_movehdup_ps (__m128 __X) { return (__m128) __builtin_ia32_movshdup ((__v4sf)__X); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_moveldup_ps (__m128 __X) { return (__m128) __builtin_ia32_movsldup ((__v4sf)__X); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_addsub_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_hadd_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_hsub_pd (__m128d __X, __m128d __Y) { return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_loaddup_pd (double const *__P) { - return (__m128d) __builtin_ia32_loadddup (__P); + return _mm_load1_pd (__P); } -static __inline __m128d +static __inline __m128d __attribute__((__always_inline__)) _mm_movedup_pd (__m128d __X) { - return (__m128d) __builtin_ia32_movddup ((__v2df)__X); + return _mm_shuffle_pd (__X, __X, _MM_SHUFFLE2 (0,0)); } -static __inline __m128i +static __inline __m128i __attribute__((__always_inline__)) _mm_lddqu_si128 (__m128i const *__P) { return (__m128i) __builtin_ia32_lddqu ((char const *)__P); } -#if 0 -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_monitor (void const * __P, unsigned int __E, unsigned int __H) { __builtin_ia32_monitor (__P, __E, __H); } -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_mwait (unsigned int __E, unsigned int __H) { __builtin_ia32_mwait (__E, __H); } -#else -#define _mm_monitor(P, E, H) __builtin_ia32_monitor ((P), (E), (H)) -#define _mm_mwait(E, H) __builtin_ia32_mwait ((E), (H)) -#endif #endif /* __SSE3__ */ diff --git a/contrib/gcc/config/i386/ppro.md b/contrib/gcc/config/i386/ppro.md index 911bf3bd92d..9f069891484 100644 --- a/contrib/gcc/config/i386/ppro.md +++ b/contrib/gcc/config/i386/ppro.md @@ -1,5 +1,5 @@ -;; Pentium Pro/PII Scheduling -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Scheduling for the Intel P6 family of processors +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,136 +15,750 @@ ;; ;; 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. */ - -;; Categorize how many uops an ia32 instruction evaluates to: -;; one -- an instruction with 1 uop can be decoded by any of the -;; three decoders. -;; few -- an instruction with 1 to 4 uops can be decoded only by -;; decoder 0. -;; many -- a complex instruction may take an unspecified number of -;; cycles to decode in decoder 0. - -(define_attr "ppro_uops" "one,few,many" - (cond [(eq_attr "type" "other,multi,call,callv,fpspc,str") - (const_string "many") - (eq_attr "type" "icmov,fcmov,str,cld,leave") - (const_string "few") - (eq_attr "type" "imov") - (if_then_else (eq_attr "memory" "store,both") - (const_string "few") - (const_string "one")) - (eq_attr "memory" "!none") - (const_string "few") - ] - (const_string "one"))) +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. */ +;; The P6 family includes the Pentium Pro, Pentium II, Pentium III, Celeron +;; and Xeon lines of CPUs. The DFA scheduler description in this file is +;; based on information that can be found in the following three documents: ;; -;; The PPro has an out-of-order core, but the instruction decoders are -;; naturally in-order and asymmetric. We get best performance by scheduling -;; for the decoders, for in doing so we give the oo execution unit the -;; most choices. +;; "P6 Family of Processors Hardware Developer's Manual", +;; Intel, September 1999. ;; -;; Rough readiness numbers. Fine tuning happens in i386.c. +;; "Intel Architecture Optimization Manual", +;; Intel, 1999 (Order Number: 245127-001). ;; -;; p0 describes port 0. -;; p01 describes ports 0 and 1 as a pair; alu insns can issue to either. -;; p2 describes port 2 for loads. -;; p34 describes ports 3 and 4 for stores. -;; fpu describes the fpu accessed via port 0. -;; ??? It is less than clear if there are separate fadd and fmul units -;; that could operate in parallel. +;; "How to optimize for the Pentium family of microprocessors", +;; by Agner Fog, PhD. ;; -;; ??? fxch isn't handled; not an issue until sched3 after reg-stack is real. +;; The P6 pipeline has three major components: +;; 1) the FETCH/DECODE unit, an in-order issue front-end +;; 2) the DISPATCH/EXECUTE unit, which is the out-of-order core +;; 3) the RETIRE unit, an in-order retirement unit +;; +;; So, the P6 CPUs have out-of-order cores, but the instruction decoder and +;; retirement unit are naturally in-order. +;; +;; BUS INTERFACE UNIT +;; / \ +;; L1 ICACHE L1 DCACHE +;; / | \ | \ +;; DECODER0 DECODER1 DECODER2 DISP/EXEC RETIRE +;; \ | / | | +;; INSTRUCTION POOL __________|_______/ +;; (inc. reorder buffer) +;; +;; Since the P6 CPUs execute instructions out-of-order, the most important +;; consideration in performance tuning is making sure enough micro-ops are +;; ready for execution in the out-of-order core, while not stalling the +;; decoder. +;; +;; TODO: +;; - Find a less crude way to model complex instructions, in +;; particular how many cycles they take to be decoded. +;; - Include decoder latencies in the total reservation latencies. +;; This isn't necessary right now because we assume for every +;; instruction that it never blocks a decoder. +;; - Figure out where the p0 and p1 reservations come from. These +;; appear not to be in the manual (e.g. why is cld "(p0+p1)*2" +;; better than "(p0|p1)*4" ???) +;; - Lots more because I'm sure this is still far from optimal :-) -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "ishift,rotate,ishift1,rotate1,lea,ibr,cld")) - 1 1) +;; The ppro_idiv and ppro_fdiv automata are used to model issue +;; latencies of idiv and fdiv type insns. +(define_automaton "ppro_decoder,ppro_core,ppro_idiv,ppro_fdiv,ppro_load,ppro_store") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "imul")) - 4 1) +;; Simple instructions of the register-register form have only one uop. +;; Load instructions are also only one uop. Store instructions decode to +;; two uops, and simple read-modify instructions also take two uops. +;; Simple instructions of the register-memory form have two to three uops. +;; Simple read-modify-write instructions have four uops. The rules for +;; the decoder are simple: +;; - an instruction with 1 uop can be decoded by any of the three +;; decoders in one cycle. +;; - an instruction with 1 to 4 uops can be decoded only by decoder 0 +;; but still in only one cycle. +;; - a complex (microcode) instruction can also only be decoded by +;; decoder 0, and this takes an unspecified number of cycles. +;; +;; The goal is to schedule such that we have a few-one-one uops sequence +;; in each cycle, to decode as many instructions per cycle as possible. +(define_cpu_unit "decoder0" "ppro_decoder") +(define_cpu_unit "decoder1" "ppro_decoder") +(define_cpu_unit "decoder2" "ppro_decoder") -;; ??? Does the divider lock out the pipe while it works, -;; or is there a disconnected unit? -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "idiv")) - 17 17) +;; We first wish to find an instruction for decoder0, so exclude +;; decoder1 and decoder2 from being reserved until decoder 0 is +;; reserved. +(presence_set "decoder1" "decoder0") +(presence_set "decoder2" "decoder0") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fop,fsgn,fistp")) - 3 1) +;; Most instructions can be decoded on any of the three decoders. +(define_reservation "decodern" "(decoder0|decoder1|decoder2)") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fcmov")) - 2 1) +;; The out-of-order core has five pipelines. During each cycle, the core +;; may dispatch zero or one uop on the port of any of the five pipelines +;; so the maximum number of dispatched uops per cycle is 5. In practicer, +;; 3 uops per cycle is more realistic. +;; +;; Two of the five pipelines contain several execution units: +;; +;; Port 0 Port 1 Port 2 Port 3 Port 4 +;; ALU ALU LOAD SAC SDA +;; FPU JUE +;; AGU MMX +;; MMX P3FPU +;; P3FPU +;; +;; (SAC=Store Address Calculation, SDA=Store Data Unit, P3FPU = SSE unit, +;; JUE = Jump Execution Unit, AGU = Address Generation Unit) +;; +(define_cpu_unit "p0,p1" "ppro_core") +(define_cpu_unit "p2" "ppro_load") +(define_cpu_unit "p3,p4" "ppro_store") +(define_cpu_unit "idiv" "ppro_idiv") +(define_cpu_unit "fdiv" "ppro_fdiv") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fcmp")) - 1 1) +;; Only the irregular instructions have to be modeled here. A load +;; increases the latency by 2 or 3, or by nothing if the manual gives +;; a latency already. Store latencies are not accounted for. +;; +;; The simple instructions follow a very regular pattern of 1 uop per +;; reg-reg operation, 1 uop per load on port 2. and 2 uops per store +;; on port 4 and port 3. These instructions are modelled at the bottom +;; of this file. +;; +;; For microcoded instructions we don't know how many uops are produced. +;; These instructions are the "complex" ones in the Intel manuals. All +;; we _do_ know is that they typically produce four or more uops, so +;; they can only be decoded on decoder0. Modelling their latencies +;; doesn't make sense because we don't know how these instructions are +;; executed in the core. So we just model that they can only be decoded +;; on decoder 0, and say that it takes a little while before the result +;; is available. +(define_insn_reservation "ppro_complex_insn" 6 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "other,multi,call,callv,str")) + "decoder0") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fmov")) - 1 1) +;; imov with memory operands does not use the integer units. +(define_insn_reservation "ppro_imov" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "imov"))) + "decodern,(p0|p1)") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fmul")) - 5 1) +(define_insn_reservation "ppro_imov_load" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "imov"))) + "decodern,p2") -(define_function_unit "ppro_p0" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fdiv,fpspc")) - 56 1) +(define_insn_reservation "ppro_imov_store" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (eq_attr "type" "imov"))) + "decoder0,p4+p3") -(define_function_unit "ppro_p01" 2 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "!imov,fmov")) - 1 1) +;; imovx always decodes to one uop, and also doesn't use the integer +;; units if it has memory operands. +(define_insn_reservation "ppro_imovx" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "imovx"))) + "decodern,(p0|p1)") -(define_function_unit "ppro_p01" 2 0 - (and (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "imov,fmov")) - (eq_attr "memory" "none")) - 1 1) +(define_insn_reservation "ppro_imovx_load" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "imovx"))) + "decodern,p2") -(define_function_unit "ppro_p2" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (ior (eq_attr "type" "pop,leave") - (eq_attr "memory" "load,both"))) - 3 1) +;; lea executes on port 0 with latency one and throughput 1. +(define_insn_reservation "ppro_lea" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "lea"))) + "decodern,p0") -(define_function_unit "ppro_p34" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (ior (eq_attr "type" "push") - (eq_attr "memory" "store,both"))) - 1 1) +;; Shift and rotate execute on port 0 with latency and throughput 1. +;; The load and store units need to be reserved when memory operands +;; are involved. +(define_insn_reservation "ppro_shift_rotate" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "ishift,ishift1,rotate,rotate1"))) + "decodern,p0") -(define_function_unit "fpu" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fop,fsgn,fmov,fcmp,fcmov,fistp")) - 1 1) +(define_insn_reservation "ppro_shift_rotate_mem" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "!none") + (eq_attr "type" "ishift,ishift1,rotate,rotate1"))) + "decoder0,p2+p0,p4+p3") -(define_function_unit "fpu" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fmul")) - 5 2) +(define_insn_reservation "ppro_cld" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "cld")) + "decoder0,(p0+p1)*2") -(define_function_unit "fpu" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "fdiv,fpspc")) - 56 56) +;; The P6 has a sophisticated branch prediction mechanism to minimize +;; latencies due to branching. In particular, it has a fast way to +;; execute branches that are taken multiple times (such as in loops). +;; Branches not taken suffer no penalty, and correctly predicted +;; branches cost only one fetch cycle. Mispredicted branches are very +;; costly: typically 15 cycles and possibly as many as 26 cycles. +;; +;; Unfortunately all this makes it quite difficult to properly model +;; the latencies for the compiler. Here I've made the choice to be +;; optimistic and assume branches are often predicted correctly, so +;; they have latency 1, and the decoders are not blocked. +;; +;; In addition, the model assumes a branch always decodes to only 1 uop, +;; which is not exactly true because there are a few instructions that +;; decode to 2 uops or microcode. But this probably gives the best +;; results because we can assume these instructions can decode on all +;; decoders. +(define_insn_reservation "ppro_branch" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "ibr"))) + "decodern,p1") + +;; ??? Indirect branches probably have worse latency than this. +(define_insn_reservation "ppro_indirect_branch" 6 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "!none") + (eq_attr "type" "ibr"))) + "decoder0,p2+p1") + +(define_insn_reservation "ppro_leave" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "leave")) + "decoder0,p2+(p0|p1),(p0|p1)") + +;; imul has throughput one, but latency 4, and can only execute on port 0. +(define_insn_reservation "ppro_imul" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "imul"))) + "decodern,p0") + +(define_insn_reservation "ppro_imul_mem" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "!none") + (eq_attr "type" "imul"))) + "decoder0,p2+p0") + +;; div and idiv are very similar, so we model them the same. +;; QI, HI, and SI have issue latency 12, 21, and 37, respectively. +;; These issue latencies are modelled via the ppro_div automaton. +(define_insn_reservation "ppro_idiv_QI" 19 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "QI") + (eq_attr "type" "idiv")))) + "decoder0,(p0+idiv)*2,(p0|p1)+idiv,idiv*9") + +(define_insn_reservation "ppro_idiv_QI_load" 19 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "QI") + (eq_attr "type" "idiv")))) + "decoder0,p2+p0+idiv,p0+idiv,(p0|p1)+idiv,idiv*9") + +(define_insn_reservation "ppro_idiv_HI" 23 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "HI") + (eq_attr "type" "idiv")))) + "decoder0,(p0+idiv)*3,(p0|p1)+idiv,idiv*17") + +(define_insn_reservation "ppro_idiv_HI_load" 23 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "HI") + (eq_attr "type" "idiv")))) + "decoder0,p2+p0+idiv,p0+idiv,(p0|p1)+idiv,idiv*18") + +(define_insn_reservation "ppro_idiv_SI" 39 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SI") + (eq_attr "type" "idiv")))) + "decoder0,(p0+idiv)*3,(p0|p1)+idiv,idiv*33") + +(define_insn_reservation "ppro_idiv_SI_load" 39 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SI") + (eq_attr "type" "idiv")))) + "decoder0,p2+p0+idiv,p0+idiv,(p0|p1)+idiv,idiv*34") + +;; Floating point operations always execute on port 0. +;; ??? where do these latencies come from? fadd has latency 3 and +;; has throughput "1/cycle (align with FADD)". What do they +;; mean and how can we model that? +(define_insn_reservation "ppro_fop" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none,unknown") + (eq_attr "type" "fop"))) + "decodern,p0") + +(define_insn_reservation "ppro_fop_load" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "fop"))) + "decoder0,p2+p0,p0") + +(define_insn_reservation "ppro_fop_store" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (eq_attr "type" "fop"))) + "decoder0,p0,p0,p0+p4+p3") + +(define_insn_reservation "ppro_fop_both" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "both") + (eq_attr "type" "fop"))) + "decoder0,p2+p0,p0+p4+p3") + +(define_insn_reservation "ppro_fsgn" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "fsgn")) + "decodern,p0") + +(define_insn_reservation "ppro_fistp" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "fistp")) + "decoder0,p0*2,p4+p3") + +(define_insn_reservation "ppro_fcmov" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (eq_attr "type" "fcmov")) + "decoder0,p0*2") + +(define_insn_reservation "ppro_fcmp" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "fcmp"))) + "decodern,p0") + +(define_insn_reservation "ppro_fcmp_load" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "fcmp"))) + "decoder0,p2+p0") + +(define_insn_reservation "ppro_fmov" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "fmov"))) + "decodern,p0") + +(define_insn_reservation "ppro_fmov_load" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "!XF") + (eq_attr "type" "fmov")))) + "decodern,p2") + +(define_insn_reservation "ppro_fmov_XF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "XF") + (eq_attr "type" "fmov")))) + "decoder0,(p2+p0)*2") + +(define_insn_reservation "ppro_fmov_store" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (and (eq_attr "mode" "!XF") + (eq_attr "type" "fmov")))) + "decodern,p0") + +(define_insn_reservation "ppro_fmov_XF_store" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (and (eq_attr "mode" "XF") + (eq_attr "type" "fmov")))) + "decoder0,(p0+p4),(p0+p3)") + +;; fmul executes on port 0 with latency 5. It has issue latency 2, +;; but we don't model this. +(define_insn_reservation "ppro_fmul" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "fmul"))) + "decoder0,p0*2") + +(define_insn_reservation "ppro_fmul_load" 6 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "fmul"))) + "decoder0,p2+p0,p0") + +;; fdiv latencies depend on the mode of the operands. XFmode gives +;; a latency of 38 cycles, DFmode gives 32, and SFmode gives latency 18. +;; Division by a power of 2 takes only 9 cycles, but we cannot model +;; that. Throughput is equal to latency - 1, which we model using the +;; ppro_div automaton. +(define_insn_reservation "ppro_fdiv_SF" 18 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "fdiv,fpspc")))) + "decodern,p0+fdiv,fdiv*16") + +(define_insn_reservation "ppro_fdiv_SF_load" 19 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "fdiv,fpspc")))) + "decoder0,p2+p0+fdiv,fdiv*16") + +(define_insn_reservation "ppro_fdiv_DF" 32 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "DF") + (eq_attr "type" "fdiv,fpspc")))) + "decodern,p0+fdiv,fdiv*30") + +(define_insn_reservation "ppro_fdiv_DF_load" 33 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "DF") + (eq_attr "type" "fdiv,fpspc")))) + "decoder0,p2+p0+fdiv,fdiv*30") + +(define_insn_reservation "ppro_fdiv_XF" 38 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "XF") + (eq_attr "type" "fdiv,fpspc")))) + "decodern,p0+fdiv,fdiv*36") + +(define_insn_reservation "ppro_fdiv_XF_load" 39 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "XF") + (eq_attr "type" "fdiv,fpspc")))) + "decoder0,p2+p0+fdiv,fdiv*36") + +;; MMX instructions can execute on either port 0 or port 1 with a +;; throughput of 1/cycle. +;; on port 0: - ALU (latency 1) +;; - Multiplier Unit (latency 3) +;; on port 1: - ALU (latency 1) +;; - Shift Unit (latency 1) +;; +;; MMX instructions are either of the type reg-reg, or read-modify, and +;; except for mmxshft and mmxmul they can execute on port 0 or port 1, +;; so they behave as "simple" instructions that need no special modelling. +;; We only have to model mmxshft and mmxmul. +(define_insn_reservation "ppro_mmx_shft" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "mmxshft"))) + "decodern,p1") + +(define_insn_reservation "ppro_mmx_shft_load" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "mmxshft"))) + "decoder0,p2+p1") + +(define_insn_reservation "ppro_mmx_mul" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "mmxmul"))) + "decodern,p0") + +(define_insn_reservation "ppro_mmx_mul_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (eq_attr "type" "mmxmul"))) + "decoder0,p2+p0") + +(define_insn_reservation "ppro_sse_mmxcvt" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "mode" "DI") + (eq_attr "type" "mmxcvt"))) + "decodern,p1") + +;; FIXME: These are Pentium III only, but we cannot tell here if +;; we're generating code for PentiumPro/Pentium II or Pentium III +;; (define_insn_reservation "ppro_sse_mmxshft" 2 +;; (and (eq_attr "cpu" "pentiumpro,generic32") +;; (and (eq_attr "mode" "DI") +;; (eq_attr "type" "mmxshft"))) +;; "decodern,p0") + +;; SSE is very complicated, and takes a bit more effort. +;; ??? I assumed that all SSE instructions decode on decoder0, +;; but is this correct? + +;; The sfence instruction. +(define_insn_reservation "ppro_sse_sfence" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "unknown") + (eq_attr "type" "sse"))) + "decoder0,p4+p3") + +;; FIXME: This reservation is all wrong when we're scheduling sqrtss. +(define_insn_reservation "ppro_sse_SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "mode" "SF") + (eq_attr "type" "sse"))) + "decodern,p0") + +(define_insn_reservation "ppro_sse_add_SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "sseadd")))) + "decodern,p1") + +(define_insn_reservation "ppro_sse_add_SF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "sseadd")))) + "decoder0,p2+p1") + +(define_insn_reservation "ppro_sse_cmp_SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssecmp")))) + "decoder0,p1") + +(define_insn_reservation "ppro_sse_cmp_SF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssecmp")))) + "decoder0,p2+p1") + +(define_insn_reservation "ppro_sse_comi_SF" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssecomi")))) + "decodern,p0") + +(define_insn_reservation "ppro_sse_comi_SF_load" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssecomi")))) + "decoder0,p2+p0") + +(define_insn_reservation "ppro_sse_mul_SF" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssemul")))) + "decodern,p0") + +(define_insn_reservation "ppro_sse_mul_SF_load" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssemul")))) + "decoder0,p2+p0") + +;; FIXME: ssediv doesn't close p0 for 17 cycles, surely??? +(define_insn_reservation "ppro_sse_div_SF" 18 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssediv")))) + "decoder0,p0*17") + +(define_insn_reservation "ppro_sse_div_SF_load" 18 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssediv")))) + "decoder0,(p2+p0),p0*16") + +(define_insn_reservation "ppro_sse_icvt_SF" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "mode" "SF") + (eq_attr "type" "sseicvt"))) + "decoder0,(p2+p1)*2") + +(define_insn_reservation "ppro_sse_icvt_SI" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "mode" "SI") + (eq_attr "type" "sseicvt"))) + "decoder0,(p2+p1)") + +(define_insn_reservation "ppro_sse_mov_SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssemov")))) + "decoder0,(p0|p1)") + +(define_insn_reservation "ppro_sse_mov_SF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssemov")))) + "decoder0,p2+(p0|p1)") + +(define_insn_reservation "ppro_sse_mov_SF_store" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (and (eq_attr "mode" "SF") + (eq_attr "type" "ssemov")))) + "decoder0,p4+p3") + +(define_insn_reservation "ppro_sse_V4SF" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "sse"))) + "decoder0,p1*2") + +(define_insn_reservation "ppro_sse_add_V4SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "sseadd")))) + "decoder0,p1*2") + +(define_insn_reservation "ppro_sse_add_V4SF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "sseadd")))) + "decoder0,(p2+p1)*2") + +(define_insn_reservation "ppro_sse_cmp_V4SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssecmp")))) + "decoder0,p1*2") + +(define_insn_reservation "ppro_sse_cmp_V4SF_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssecmp")))) + "decoder0,(p2+p1)*2") + +(define_insn_reservation "ppro_sse_cvt_V4SF" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none,unknown") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssecvt")))) + "decoder0,p1*2") + +(define_insn_reservation "ppro_sse_cvt_V4SF_other" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "!none,unknown") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssecmp")))) + "decoder0,p1,p4+p3") + +(define_insn_reservation "ppro_sse_mul_V4SF" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssemul")))) + "decoder0,p0*2") + +(define_insn_reservation "ppro_sse_mul_V4SF_load" 5 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssemul")))) + "decoder0,(p2+p0)*2") + +;; FIXME: p0 really closed this long??? +(define_insn_reservation "ppro_sse_div_V4SF" 48 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssediv")))) + "decoder0,p0*34") + +(define_insn_reservation "ppro_sse_div_V4SF_load" 48 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssediv")))) + "decoder0,(p2+p0)*2,p0*32") + +(define_insn_reservation "ppro_sse_log_V4SF" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "sselog,sselog1")))) + "decodern,p1") + +(define_insn_reservation "ppro_sse_log_V4SF_load" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "sselog,sselog1")))) + "decoder0,(p2+p1)") + +(define_insn_reservation "ppro_sse_mov_V4SF" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssemov")))) + "decoder0,(p0|p1)*2") + +(define_insn_reservation "ppro_sse_mov_V4SF_load" 2 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssemov")))) + "decoder0,p2*2") + +(define_insn_reservation "ppro_sse_mov_V4SF_store" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (and (eq_attr "mode" "V4SF") + (eq_attr "type" "ssemov")))) + "decoder0,(p4+p3)*2") + +;; All other instructions are modelled as simple instructions. +;; We have already modelled all i387 floating point instructions, so all +;; other instructions execute on either port 0 or port 1. This includes +;; the ALU units, and the MMX units. +;; +;; reg-reg instructions produce 1 uop so they can be decoded on any of +;; the three decoders. +(define_insn_reservation "ppro_insn" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "none,unknown") + (eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp"))) + "decodern,(p0|p1)") + +;; read-modify and register-memory instructions have 2 or three uops, +;; so they have to be decoded on decoder0. +(define_insn_reservation "ppro_insn_load" 3 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "load") + (eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp"))) + "decoder0,p2+(p0|p1)") + +(define_insn_reservation "ppro_insn_store" 1 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "store") + (eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp"))) + "decoder0,(p0|p1),p4+p3") + +;; read-modify-store instructions produce 4 uops so they have to be +;; decoded on decoder0 as well. +(define_insn_reservation "ppro_insn_both" 4 + (and (eq_attr "cpu" "pentiumpro,generic32") + (and (eq_attr "memory" "both") + (eq_attr "type" "alu,alu1,negnot,incdec,icmp,test,setcc,icmov,push,pop,fxch,sseiadd,sseishft,sseimul,mmx,mmxadd,mmxcmp"))) + "decoder0,p2+(p0|p1),p4+p3") -;; imul uses the fpu. ??? does it have the same throughput as fmul? -(define_function_unit "fpu" 1 0 - (and (eq_attr "cpu" "pentiumpro") - (eq_attr "type" "imul")) - 4 1) diff --git a/contrib/gcc/config/i386/predicates.md b/contrib/gcc/config/i386/predicates.md new file mode 100644 index 00000000000..52011918100 --- /dev/null +++ b/contrib/gcc/config/i386/predicates.md @@ -0,0 +1,990 @@ +;; Predicate definitions for IA-32 and x86-64. +;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Return nonzero if OP is either a i387 or SSE fp register. +(define_predicate "any_fp_register_operand" + (and (match_code "reg") + (match_test "ANY_FP_REGNO_P (REGNO (op))"))) + +;; Return nonzero if OP is an i387 fp register. +(define_predicate "fp_register_operand" + (and (match_code "reg") + (match_test "FP_REGNO_P (REGNO (op))"))) + +;; Return nonzero if OP is a non-fp register_operand. +(define_predicate "register_and_not_any_fp_reg_operand" + (and (match_code "reg") + (not (match_test "ANY_FP_REGNO_P (REGNO (op))")))) + +;; Return nonzero if OP is a register operand other than an i387 fp register. +(define_predicate "register_and_not_fp_reg_operand" + (and (match_code "reg") + (not (match_test "FP_REGNO_P (REGNO (op))")))) + +;; True if the operand is an MMX register. +(define_predicate "mmx_reg_operand" + (and (match_code "reg") + (match_test "MMX_REGNO_P (REGNO (op))"))) + +;; True if the operand is a Q_REGS class register. +(define_predicate "q_regs_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + return ANY_QI_REG_P (op); +}) + +;; Return true if op is a NON_Q_REGS class register. +(define_predicate "non_q_regs_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + return NON_QI_REG_P (op); +}) + +;; Match an SI or HImode register for a zero_extract. +(define_special_predicate "ext_register_operand" + (match_operand 0 "register_operand") +{ + if ((!TARGET_64BIT || GET_MODE (op) != DImode) + && GET_MODE (op) != SImode && GET_MODE (op) != HImode) + return 0; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + /* Be careful to accept only registers having upper parts. */ + return REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) < 4; +}) + +;; Return true if op is the AX register. +(define_predicate "ax_reg_operand" + (and (match_code "reg") + (match_test "REGNO (op) == 0"))) + +;; Return true if op is the flags register. +(define_predicate "flags_reg_operand" + (and (match_code "reg") + (match_test "REGNO (op) == FLAGS_REG"))) + +;; Return 1 if VALUE can be stored in a sign extended immediate field. +(define_predicate "x86_64_immediate_operand" + (match_code "const_int,symbol_ref,label_ref,const") +{ + if (!TARGET_64BIT) + return immediate_operand (op, mode); + + switch (GET_CODE (op)) + { + case CONST_INT: + /* CONST_DOUBLES never match, since HOST_BITS_PER_WIDE_INT is known + to be at least 32 and this all acceptable constants are + represented as CONST_INT. */ + if (HOST_BITS_PER_WIDE_INT == 32) + return 1; + else + { + HOST_WIDE_INT val = trunc_int_for_mode (INTVAL (op), DImode); + return trunc_int_for_mode (val, SImode) == val; + } + break; + + case SYMBOL_REF: + /* For certain code models, the symbolic references are known to fit. + in CM_SMALL_PIC model we know it fits if it is local to the shared + library. Don't count TLS SYMBOL_REFs here, since they should fit + only if inside of UNSPEC handled below. */ + /* TLS symbols are not constant. */ + if (SYMBOL_REF_TLS_MODEL (op)) + return false; + return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL + || (ix86_cmodel == CM_MEDIUM && !SYMBOL_REF_FAR_ADDR_P (op))); + + case LABEL_REF: + /* For certain code models, the code is near as well. */ + return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM + || ix86_cmodel == CM_KERNEL); + + case CONST: + /* We also may accept the offsetted memory references in certain + special cases. */ + if (GET_CODE (XEXP (op, 0)) == UNSPEC) + switch (XINT (XEXP (op, 0), 1)) + { + case UNSPEC_GOTPCREL: + case UNSPEC_DTPOFF: + case UNSPEC_GOTNTPOFF: + case UNSPEC_NTPOFF: + return 1; + default: + break; + } + + if (GET_CODE (XEXP (op, 0)) == PLUS) + { + rtx op1 = XEXP (XEXP (op, 0), 0); + rtx op2 = XEXP (XEXP (op, 0), 1); + HOST_WIDE_INT offset; + + if (ix86_cmodel == CM_LARGE) + return 0; + if (GET_CODE (op2) != CONST_INT) + return 0; + offset = trunc_int_for_mode (INTVAL (op2), DImode); + switch (GET_CODE (op1)) + { + case SYMBOL_REF: + /* TLS symbols are not constant. */ + if (SYMBOL_REF_TLS_MODEL (op1)) + return 0; + /* For CM_SMALL assume that latest object is 16MB before + end of 31bits boundary. We may also accept pretty + large negative constants knowing that all objects are + in the positive half of address space. */ + if ((ix86_cmodel == CM_SMALL + || (ix86_cmodel == CM_MEDIUM + && !SYMBOL_REF_FAR_ADDR_P (op1))) + && offset < 16*1024*1024 + && trunc_int_for_mode (offset, SImode) == offset) + return 1; + /* For CM_KERNEL we know that all object resist in the + negative half of 32bits address space. We may not + accept negative offsets, since they may be just off + and we may accept pretty large positive ones. */ + if (ix86_cmodel == CM_KERNEL + && offset > 0 + && trunc_int_for_mode (offset, SImode) == offset) + return 1; + break; + + case LABEL_REF: + /* These conditions are similar to SYMBOL_REF ones, just the + constraints for code models differ. */ + if ((ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM) + && offset < 16*1024*1024 + && trunc_int_for_mode (offset, SImode) == offset) + return 1; + if (ix86_cmodel == CM_KERNEL + && offset > 0 + && trunc_int_for_mode (offset, SImode) == offset) + return 1; + break; + + case UNSPEC: + switch (XINT (op1, 1)) + { + case UNSPEC_DTPOFF: + case UNSPEC_NTPOFF: + if (offset > 0 + && trunc_int_for_mode (offset, SImode) == offset) + return 1; + } + break; + + default: + break; + } + } + break; + + default: + gcc_unreachable (); + } + + return 0; +}) + +;; Return 1 if VALUE can be stored in the zero extended immediate field. +(define_predicate "x86_64_zext_immediate_operand" + (match_code "const_double,const_int,symbol_ref,label_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST_DOUBLE: + if (HOST_BITS_PER_WIDE_INT == 32) + return (GET_MODE (op) == VOIDmode && !CONST_DOUBLE_HIGH (op)); + else + return 0; + + case CONST_INT: + if (HOST_BITS_PER_WIDE_INT == 32) + return INTVAL (op) >= 0; + else + return !(INTVAL (op) & ~(HOST_WIDE_INT) 0xffffffff); + + case SYMBOL_REF: + /* For certain code models, the symbolic references are known to fit. */ + /* TLS symbols are not constant. */ + if (SYMBOL_REF_TLS_MODEL (op)) + return false; + return (ix86_cmodel == CM_SMALL + || (ix86_cmodel == CM_MEDIUM + && !SYMBOL_REF_FAR_ADDR_P (op))); + + case LABEL_REF: + /* For certain code models, the code is near as well. */ + return ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM; + + case CONST: + /* We also may accept the offsetted memory references in certain + special cases. */ + if (GET_CODE (XEXP (op, 0)) == PLUS) + { + rtx op1 = XEXP (XEXP (op, 0), 0); + rtx op2 = XEXP (XEXP (op, 0), 1); + + if (ix86_cmodel == CM_LARGE) + return 0; + switch (GET_CODE (op1)) + { + case SYMBOL_REF: + /* TLS symbols are not constant. */ + if (SYMBOL_REF_TLS_MODEL (op1)) + return 0; + /* For small code model we may accept pretty large positive + offsets, since one bit is available for free. Negative + offsets are limited by the size of NULL pointer area + specified by the ABI. */ + if ((ix86_cmodel == CM_SMALL + || (ix86_cmodel == CM_MEDIUM + && !SYMBOL_REF_FAR_ADDR_P (op1))) + && GET_CODE (op2) == CONST_INT + && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 + && trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2)) + return 1; + /* ??? For the kernel, we may accept adjustment of + -0x10000000, since we know that it will just convert + negative address space to positive, but perhaps this + is not worthwhile. */ + break; + + case LABEL_REF: + /* These conditions are similar to SYMBOL_REF ones, just the + constraints for code models differ. */ + if ((ix86_cmodel == CM_SMALL || ix86_cmodel == CM_MEDIUM) + && GET_CODE (op2) == CONST_INT + && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000 + && trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2)) + return 1; + break; + + default: + return 0; + } + } + break; + + default: + gcc_unreachable (); + } + return 0; +}) + +;; Return nonzero if OP is general operand representable on x86_64. +(define_predicate "x86_64_general_operand" + (if_then_else (match_test "TARGET_64BIT") + (ior (match_operand 0 "nonimmediate_operand") + (match_operand 0 "x86_64_immediate_operand")) + (match_operand 0 "general_operand"))) + +;; Return nonzero if OP is general operand representable on x86_64 +;; as either sign extended or zero extended constant. +(define_predicate "x86_64_szext_general_operand" + (if_then_else (match_test "TARGET_64BIT") + (ior (match_operand 0 "nonimmediate_operand") + (ior (match_operand 0 "x86_64_immediate_operand") + (match_operand 0 "x86_64_zext_immediate_operand"))) + (match_operand 0 "general_operand"))) + +;; Return nonzero if OP is nonmemory operand representable on x86_64. +(define_predicate "x86_64_nonmemory_operand" + (if_then_else (match_test "TARGET_64BIT") + (ior (match_operand 0 "register_operand") + (match_operand 0 "x86_64_immediate_operand")) + (match_operand 0 "nonmemory_operand"))) + +;; Return nonzero if OP is nonmemory operand representable on x86_64. +(define_predicate "x86_64_szext_nonmemory_operand" + (if_then_else (match_test "TARGET_64BIT") + (ior (match_operand 0 "register_operand") + (ior (match_operand 0 "x86_64_immediate_operand") + (match_operand 0 "x86_64_zext_immediate_operand"))) + (match_operand 0 "nonmemory_operand"))) + +;; Return true when operand is PIC expression that can be computed by lea +;; operation. +(define_predicate "pic_32bit_operand" + (match_code "const,symbol_ref,label_ref") +{ + if (!flag_pic) + return 0; + /* Rule out relocations that translate into 64bit constants. */ + if (TARGET_64BIT && GET_CODE (op) == CONST) + { + op = XEXP (op, 0); + if (GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) + op = XEXP (op, 0); + if (GET_CODE (op) == UNSPEC + && (XINT (op, 1) == UNSPEC_GOTOFF + || XINT (op, 1) == UNSPEC_GOT)) + return 0; + } + return symbolic_operand (op, mode); +}) + + +;; Return nonzero if OP is nonmemory operand acceptable by movabs patterns. +(define_predicate "x86_64_movabs_operand" + (if_then_else (match_test "!TARGET_64BIT || !flag_pic") + (match_operand 0 "nonmemory_operand") + (ior (match_operand 0 "register_operand") + (and (match_operand 0 "const_double_operand") + (match_test "GET_MODE_SIZE (mode) <= 8"))))) + +;; Returns nonzero if OP is either a symbol reference or a sum of a symbol +;; reference and a constant. +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + case LABEL_REF: + return 1; + + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) == SYMBOL_REF + || GET_CODE (op) == LABEL_REF + || (GET_CODE (op) == UNSPEC + && (XINT (op, 1) == UNSPEC_GOT + || XINT (op, 1) == UNSPEC_GOTOFF + || XINT (op, 1) == UNSPEC_GOTPCREL))) + return 1; + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return 0; + + op = XEXP (op, 0); + if (GET_CODE (op) == SYMBOL_REF + || GET_CODE (op) == LABEL_REF) + return 1; + /* Only @GOTOFF gets offsets. */ + if (GET_CODE (op) != UNSPEC + || XINT (op, 1) != UNSPEC_GOTOFF) + return 0; + + op = XVECEXP (op, 0, 0); + if (GET_CODE (op) == SYMBOL_REF + || GET_CODE (op) == LABEL_REF) + return 1; + return 0; + + default: + gcc_unreachable (); + } +}) + +;; Return true if the operand contains a @GOT or @GOTOFF reference. +(define_predicate "pic_symbolic_operand" + (match_code "const") +{ + op = XEXP (op, 0); + if (TARGET_64BIT) + { + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_GOTPCREL) + return 1; + if (GET_CODE (op) == PLUS + && GET_CODE (XEXP (op, 0)) == UNSPEC + && XINT (XEXP (op, 0), 1) == UNSPEC_GOTPCREL) + return 1; + } + else + { + if (GET_CODE (op) == UNSPEC) + return 1; + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return 0; + op = XEXP (op, 0); + if (GET_CODE (op) == UNSPEC) + return 1; + } + return 0; +}) + +;; Return true if OP is a symbolic operand that resolves locally. +(define_predicate "local_symbolic_operand" + (match_code "const,label_ref,symbol_ref") +{ + if (GET_CODE (op) == CONST + && GET_CODE (XEXP (op, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT) + op = XEXP (XEXP (op, 0), 0); + + if (GET_CODE (op) == LABEL_REF) + return 1; + + if (GET_CODE (op) != SYMBOL_REF) + return 0; + + if (SYMBOL_REF_TLS_MODEL (op) != 0) + return 0; + + if (SYMBOL_REF_LOCAL_P (op)) + return 1; + + /* There is, however, a not insubstantial body of code in the rest of + the compiler that assumes it can just stick the results of + ASM_GENERATE_INTERNAL_LABEL in a symbol_ref and have done. */ + /* ??? This is a hack. Should update the body of the compiler to + always create a DECL an invoke targetm.encode_section_info. */ + if (strncmp (XSTR (op, 0), internal_label_prefix, + internal_label_prefix_len) == 0) + return 1; + + return 0; +}) + +;; Test for various thread-local symbols. +(define_predicate "tls_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) != 0"))) + +(define_predicate "tls_modbase_operand" + (and (match_code "symbol_ref") + (match_test "op == ix86_tls_module_base ()"))) + +(define_predicate "tp_or_register_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "unspec") + (match_test "XINT (op, 1) == UNSPEC_TP")))) + +;; Test for a pc-relative call operand +(define_predicate "constant_call_address_operand" + (ior (match_code "symbol_ref") + (match_operand 0 "local_symbolic_operand"))) + +;; True for any non-virtual or eliminable register. Used in places where +;; instantiation of such a register may cause the pattern to not be recognized. +(define_predicate "register_no_elim_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + return !(op == arg_pointer_rtx + || op == frame_pointer_rtx + || (REGNO (op) >= FIRST_PSEUDO_REGISTER + && REGNO (op) <= LAST_VIRTUAL_REGISTER)); +}) + +;; Similarly, but include the stack pointer. This is used to prevent esp +;; from being used as an index reg. +(define_predicate "index_register_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + if (reload_in_progress || reload_completed) + return REG_OK_FOR_INDEX_STRICT_P (op); + else + return REG_OK_FOR_INDEX_NONSTRICT_P (op); +}) + +;; Return false if this is any eliminable register. Otherwise general_operand. +(define_predicate "general_no_elim_operand" + (if_then_else (match_code "reg,subreg") + (match_operand 0 "register_no_elim_operand") + (match_operand 0 "general_operand"))) + +;; Return false if this is any eliminable register. Otherwise +;; register_operand or a constant. +(define_predicate "nonmemory_no_elim_operand" + (ior (match_operand 0 "register_no_elim_operand") + (match_operand 0 "immediate_operand"))) + +;; Test for a valid operand for a call instruction. +(define_predicate "call_insn_operand" + (ior (match_operand 0 "constant_call_address_operand") + (ior (match_operand 0 "register_no_elim_operand") + (match_operand 0 "memory_operand")))) + +;; Similarly, but for tail calls, in which we cannot allow memory references. +(define_predicate "sibcall_insn_operand" + (ior (match_operand 0 "constant_call_address_operand") + (match_operand 0 "register_no_elim_operand"))) + +;; Match exactly zero. +(define_predicate "const0_operand" + (match_code "const_int,const_double,const_vector") +{ + if (mode == VOIDmode) + mode = GET_MODE (op); + return op == CONST0_RTX (mode); +}) + +;; Match exactly one. +(define_predicate "const1_operand" + (and (match_code "const_int") + (match_test "op == const1_rtx"))) + +;; Match exactly eight. +(define_predicate "const8_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 8"))) + +;; Match 2, 4, or 8. Used for leal multiplicands. +(define_predicate "const248_operand" + (match_code "const_int") +{ + HOST_WIDE_INT i = INTVAL (op); + return i == 2 || i == 4 || i == 8; +}) + +;; Match 0 or 1. +(define_predicate "const_0_to_1_operand" + (and (match_code "const_int") + (match_test "op == const0_rtx || op == const1_rtx"))) + +;; Match 0 to 3. +(define_predicate "const_0_to_3_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 3"))) + +;; Match 0 to 7. +(define_predicate "const_0_to_7_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 7"))) + +;; Match 0 to 15. +(define_predicate "const_0_to_15_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 15"))) + +;; Match 0 to 63. +(define_predicate "const_0_to_63_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 63"))) + +;; Match 0 to 255. +(define_predicate "const_0_to_255_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 255"))) + +;; Match (0 to 255) * 8 +(define_predicate "const_0_to_255_mul_8_operand" + (match_code "const_int") +{ + unsigned HOST_WIDE_INT val = INTVAL (op); + return val <= 255*8 && val % 8 == 0; +}) + +;; Return nonzero if OP is CONST_INT >= 1 and <= 31 (a valid operand +;; for shift & compare patterns, as shifting by 0 does not change flags). +(define_predicate "const_1_to_31_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 1 && INTVAL (op) <= 31"))) + +;; Match 2 or 3. +(define_predicate "const_2_to_3_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 2 || INTVAL (op) == 3"))) + +;; Match 4 to 7. +(define_predicate "const_4_to_7_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 4 && INTVAL (op) <= 7"))) + +;; Match exactly one bit in 4-bit mask. +(define_predicate "const_pow2_1_to_8_operand" + (match_code "const_int") +{ + unsigned int log = exact_log2 (INTVAL (op)); + return log <= 3; +}) + +;; Match exactly one bit in 8-bit mask. +(define_predicate "const_pow2_1_to_128_operand" + (match_code "const_int") +{ + unsigned int log = exact_log2 (INTVAL (op)); + return log <= 7; +}) + +;; True if this is a constant appropriate for an increment or decrement. +(define_predicate "incdec_operand" + (match_code "const_int") +{ + /* On Pentium4, the inc and dec operations causes extra dependency on flag + registers, since carry flag is not set. */ + if (!TARGET_USE_INCDEC && !optimize_size) + return 0; + return op == const1_rtx || op == constm1_rtx; +}) + +;; True for registers, or 1 or -1. Used to optimize double-word shifts. +(define_predicate "reg_or_pm1_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "op == const1_rtx || op == constm1_rtx")))) + +;; True if OP is acceptable as operand of DImode shift expander. +(define_predicate "shiftdi_operand" + (if_then_else (match_test "TARGET_64BIT") + (match_operand 0 "nonimmediate_operand") + (match_operand 0 "register_operand"))) + +(define_predicate "ashldi_input_operand" + (if_then_else (match_test "TARGET_64BIT") + (match_operand 0 "nonimmediate_operand") + (match_operand 0 "reg_or_pm1_operand"))) + +;; Return true if OP is a vector load from the constant pool with just +;; the first element nonzero. +(define_predicate "zero_extended_scalar_load_operand" + (match_code "mem") +{ + unsigned n_elts; + op = maybe_get_pool_constant (op); + if (!op) + return 0; + if (GET_CODE (op) != CONST_VECTOR) + return 0; + n_elts = + (GET_MODE_SIZE (GET_MODE (op)) / + GET_MODE_SIZE (GET_MODE_INNER (GET_MODE (op)))); + for (n_elts--; n_elts > 0; n_elts--) + { + rtx elt = CONST_VECTOR_ELT (op, n_elts); + if (elt != CONST0_RTX (GET_MODE_INNER (GET_MODE (op)))) + return 0; + } + return 1; +}) + +/* Return true if operand is a vector constant that is all ones. */ +(define_predicate "vector_all_ones_operand" + (match_code "const_vector") +{ + int nunits = GET_MODE_NUNITS (mode); + + if (GET_CODE (op) == CONST_VECTOR + && CONST_VECTOR_NUNITS (op) == nunits) + { + int i; + for (i = 0; i < nunits; ++i) + { + rtx x = CONST_VECTOR_ELT (op, i); + if (x != constm1_rtx) + return 0; + } + return 1; + } + + return 0; +}) + +; Return 1 when OP is operand acceptable for standard SSE move. +(define_predicate "vector_move_operand" + (ior (match_operand 0 "nonimmediate_operand") + (match_operand 0 "const0_operand"))) + +;; Return 1 when OP is nonimmediate or standard SSE constant. +(define_predicate "nonimmediate_or_sse_const_operand" + (match_operand 0 "general_operand") +{ + if (nonimmediate_operand (op, mode)) + return 1; + if (standard_sse_constant_p (op) > 0) + return 1; + return 0; +}) + +;; Return true if OP is a register or a zero. +(define_predicate "reg_or_0_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "const0_operand"))) + +;; Return true if op if a valid address, and does not contain +;; a segment override. +(define_special_predicate "no_seg_address_operand" + (match_operand 0 "address_operand") +{ + struct ix86_address parts; + int ok; + + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); + return parts.seg == SEG_DEFAULT; +}) + +;; Return nonzero if the rtx is known to be at least 32 bits aligned. +(define_predicate "aligned_operand" + (match_operand 0 "general_operand") +{ + struct ix86_address parts; + int ok; + + /* Registers and immediate operands are always "aligned". */ + if (GET_CODE (op) != MEM) + return 1; + + /* All patterns using aligned_operand on memory operands ends up + in promoting memory operand to 64bit and thus causing memory mismatch. */ + if (TARGET_MEMORY_MISMATCH_STALL && !optimize_size) + return 0; + + /* Don't even try to do any aligned optimizations with volatiles. */ + if (MEM_VOLATILE_P (op)) + return 0; + + if (MEM_ALIGN (op) >= 32) + return 1; + + op = XEXP (op, 0); + + /* Pushes and pops are only valid on the stack pointer. */ + if (GET_CODE (op) == PRE_DEC + || GET_CODE (op) == POST_INC) + return 1; + + /* Decode the address. */ + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); + + /* Look for some component that isn't known to be aligned. */ + if (parts.index) + { + if (REGNO_POINTER_ALIGN (REGNO (parts.index)) * parts.scale < 32) + return 0; + } + if (parts.base) + { + if (REGNO_POINTER_ALIGN (REGNO (parts.base)) < 32) + return 0; + } + if (parts.disp) + { + if (GET_CODE (parts.disp) != CONST_INT + || (INTVAL (parts.disp) & 3) != 0) + return 0; + } + + /* Didn't find one -- this must be an aligned address. */ + return 1; +}) + +;; Returns 1 if OP is memory operand with a displacement. +(define_predicate "memory_displacement_operand" + (match_operand 0 "memory_operand") +{ + struct ix86_address parts; + int ok; + + ok = ix86_decompose_address (XEXP (op, 0), &parts); + gcc_assert (ok); + return parts.disp != NULL_RTX; +}) + +;; Returns 1 if OP is memory operand with a displacement only. +(define_predicate "memory_displacement_only_operand" + (match_operand 0 "memory_operand") +{ + struct ix86_address parts; + int ok; + + ok = ix86_decompose_address (XEXP (op, 0), &parts); + gcc_assert (ok); + + if (parts.base || parts.index) + return 0; + + return parts.disp != NULL_RTX; +}) + +;; Returns 1 if OP is memory operand that cannot be represented +;; by the modRM array. +(define_predicate "long_memory_operand" + (and (match_operand 0 "memory_operand") + (match_test "memory_address_length (op) != 0"))) + +;; Return 1 if OP is a comparison operator that can be issued by fcmov. +(define_predicate "fcmov_comparison_operator" + (match_operand 0 "comparison_operator") +{ + enum machine_mode inmode = GET_MODE (XEXP (op, 0)); + enum rtx_code code = GET_CODE (op); + + if (inmode == CCFPmode || inmode == CCFPUmode) + { + enum rtx_code second_code, bypass_code; + ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); + if (bypass_code != UNKNOWN || second_code != UNKNOWN) + return 0; + code = ix86_fp_compare_code_to_integer (code); + } + /* i387 supports just limited amount of conditional codes. */ + switch (code) + { + case LTU: case GTU: case LEU: case GEU: + if (inmode == CCmode || inmode == CCFPmode || inmode == CCFPUmode) + return 1; + return 0; + case ORDERED: case UNORDERED: + case EQ: case NE: + return 1; + default: + return 0; + } +}) + +;; Return 1 if OP is a comparison that can be used in the CMPSS/CMPPS insns. +;; The first set are supported directly; the second set can't be done with +;; full IEEE support, i.e. NaNs. +;; +;; ??? It would seem that we have a lot of uses of this predicate that pass +;; it the wrong mode. We got away with this because the old function didn't +;; check the mode at all. Mirror that for now by calling this a special +;; predicate. + +(define_special_predicate "sse_comparison_operator" + (match_code "eq,lt,le,unordered,ne,unge,ungt,ordered")) + +;; Return 1 if OP is a valid comparison operator in valid mode. +(define_predicate "ix86_comparison_operator" + (match_operand 0 "comparison_operator") +{ + enum machine_mode inmode = GET_MODE (XEXP (op, 0)); + enum rtx_code code = GET_CODE (op); + + if (inmode == CCFPmode || inmode == CCFPUmode) + { + enum rtx_code second_code, bypass_code; + ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); + return (bypass_code == UNKNOWN && second_code == UNKNOWN); + } + switch (code) + { + case EQ: case NE: + return 1; + case LT: case GE: + if (inmode == CCmode || inmode == CCGCmode + || inmode == CCGOCmode || inmode == CCNOmode) + return 1; + return 0; + case LTU: case GTU: case LEU: case ORDERED: case UNORDERED: case GEU: + if (inmode == CCmode) + return 1; + return 0; + case GT: case LE: + if (inmode == CCmode || inmode == CCGCmode || inmode == CCNOmode) + return 1; + return 0; + default: + return 0; + } +}) + +;; Return 1 if OP is a valid comparison operator testing carry flag to be set. +(define_predicate "ix86_carry_flag_operator" + (match_code "ltu,lt,unlt,gt,ungt,le,unle,ge,unge,ltgt,uneq") +{ + enum machine_mode inmode = GET_MODE (XEXP (op, 0)); + enum rtx_code code = GET_CODE (op); + + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != FLAGS_REG + || XEXP (op, 1) != const0_rtx) + return 0; + + if (inmode == CCFPmode || inmode == CCFPUmode) + { + enum rtx_code second_code, bypass_code; + ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); + if (bypass_code != UNKNOWN || second_code != UNKNOWN) + return 0; + code = ix86_fp_compare_code_to_integer (code); + } + else if (inmode != CCmode) + return 0; + + return code == LTU; +}) + +;; Nearly general operand, but accept any const_double, since we wish +;; to be able to drop them into memory rather than have them get pulled +;; into registers. +(define_predicate "cmp_fp_expander_operand" + (ior (match_code "const_double") + (match_operand 0 "general_operand"))) + +;; Return true if this is a valid binary floating-point operation. +(define_predicate "binary_fp_operator" + (match_code "plus,minus,mult,div")) + +;; Return true if this is a multiply operation. +(define_predicate "mult_operator" + (match_code "mult")) + +;; Return true if this is a division operation. +(define_predicate "div_operator" + (match_code "div")) + +;; Return true if this is a float extend operation. +(define_predicate "float_operator" + (match_code "float")) + +;; Return true for ARITHMETIC_P. +(define_predicate "arith_or_logical_operator" + (match_code "plus,mult,and,ior,xor,smin,smax,umin,umax,compare,minus,div, + mod,udiv,umod,ashift,rotate,ashiftrt,lshiftrt,rotatert")) + +;; Return 1 if OP is a binary operator that can be promoted to wider mode. +;; Modern CPUs have same latency for HImode and SImode multiply, +;; but 386 and 486 do HImode multiply faster. */ +(define_predicate "promotable_binary_operator" + (ior (match_code "plus,and,ior,xor,ashift") + (and (match_code "mult") + (match_test "ix86_tune > PROCESSOR_I486")))) + +;; To avoid problems when jump re-emits comparisons like testqi_ext_ccno_0, +;; re-recognize the operand to avoid a copy_to_mode_reg that will fail. +;; +;; ??? It seems likely that this will only work because cmpsi is an +;; expander, and no actual insns use this. + +(define_predicate "cmpsi_operand" + (ior (match_operand 0 "nonimmediate_operand") + (and (match_code "and") + (match_code "zero_extract" "0") + (match_code "const_int" "1") + (match_code "const_int" "01") + (match_code "const_int" "02") + (match_test "INTVAL (XEXP (XEXP (op, 0), 1)) == 8") + (match_test "INTVAL (XEXP (XEXP (op, 0), 2)) == 8") + ))) + +(define_predicate "compare_operator" + (match_code "compare")) + +(define_predicate "absneg_operator" + (match_code "abs,neg")) diff --git a/contrib/gcc/config/i386/ptx4-i.h b/contrib/gcc/config/i386/ptx4-i.h index 5fcd074f48b..d17cb8717f6 100644 --- a/contrib/gcc/config/i386/ptx4-i.h +++ b/contrib/gcc/config/i386/ptx4-i.h @@ -19,8 +19,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)"); diff --git a/contrib/gcc/config/i386/rtemself.h b/contrib/gcc/config/i386/rtemself.h index 6f5299dc050..b468f1a98de 100644 --- a/contrib/gcc/config/i386/rtemself.h +++ b/contrib/gcc/config/i386/rtemself.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Specify predefined symbols in preprocessor. */ diff --git a/contrib/gcc/config/i386/sco5.h b/contrib/gcc/config/i386/sco5.h index bb872d5ec15..026ffd832fb 100644 --- a/contrib/gcc/config/i386/sco5.h +++ b/contrib/gcc/config/i386/sco5.h @@ -1,5 +1,5 @@ /* Definitions for Intel 386 running SCO Unix System V 3.2 Version 5. - Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 + Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Kean Johnston (jkj@sco.com) @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (i386, SCO OpenServer 5 Syntax)"); @@ -96,13 +96,11 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE #undef WCHAR_TYPE_SIZE #undef WINT_TYPE -#undef LONG_DOUBLE_TYPE_SIZE #define SIZE_TYPE "unsigned int" #define PTRDIFF_TYPE "int" #define WCHAR_TYPE "long int" #define WCHAR_TYPE_SIZE BITS_PER_WORD #define WINT_TYPE "long int" -#define LONG_DOUBLE_TYPE_SIZE 96 /* * New for multilib support. Set the default switches for multilib, @@ -223,11 +221,6 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("system=svr3"); \ if (flag_iso) \ cpp_define (pfile, "_STRICT_ANSI"); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) @@ -260,7 +253,7 @@ Boston, MA 02111-1307, USA. */ #undef LINK_SPEC #define LINK_SPEC \ "%{!shared:%{!symbolic:%{!G:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF}}} \ - %{Wl,*:%*} %{YP,*} %{YL,*} %{YU,*} \ + %{YP,*} %{YL,*} %{YU,*} \ %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \ %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \ %{h*} %{static:-dn -Bstatic %{G:%e-G and -static are mutually exclusive}} \ @@ -283,14 +276,6 @@ Boston, MA 02111-1307, USA. */ #define LIBGCC_SPEC \ "%{!shared:%{!G:-lgcc}}" -/* Here for legacy support only so we still accept -melf flag */ -#define MASK_COFF 010000000000 /* Mask for COFF generation */ -#define TARGET_ELF (1) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "elf", -MASK_COFF, N_("Generate ELF output") }, - /* Handle special EH pointer encodings. Absolute, pc-relative, and indirect are handled automatically. */ #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \ diff --git a/contrib/gcc/config/i386/sco5.opt b/contrib/gcc/config/i386/sco5.opt new file mode 100644 index 00000000000..03780ca9088 --- /dev/null +++ b/contrib/gcc/config/i386/sco5.opt @@ -0,0 +1,25 @@ +; SCO Unix-specific options. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +;; Legacy option +melf +Target RejectNegative +Generate ELF output diff --git a/contrib/gcc/config/i386/sol2-10.h b/contrib/gcc/config/i386/sol2-10.h new file mode 100644 index 00000000000..af51b4cb376 --- /dev/null +++ b/contrib/gcc/config/i386/sol2-10.h @@ -0,0 +1,114 @@ +/* Solaris 10 configuration. + Copyright (C) 2004 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "/" + +/* binutils' GNU as understands --32 and --64, but the native Solaris + assembler requires -xarch=generic or -xarch=generic64 instead. */ +#undef ASM_SPEC +#ifdef USE_GAS +#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \ + "%{Wa,*:%*} %{m32:--32} %{m64:--64} -s %(asm_cpu)" +#else +#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \ + "%{Wa,*:%*} %{m32:-xarch=generic} %{m64:-xarch=generic64} " \ + "-s %(asm_cpu)" +#endif + +#undef NO_PROFILE_COUNTERS + +#undef MCOUNT_NAME +#define MCOUNT_NAME "_mcount" + +#undef WCHAR_TYPE +#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int") +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef WINT_TYPE +#define WINT_TYPE (TARGET_64BIT ? "int" : "long int") +#undef WINT_TYPE_SIZE +#define WINT_TYPE_SIZE 32 + +#define SUBTARGET_OVERRIDE_OPTIONS \ + do \ + { \ + if (flag_omit_frame_pointer == 2) \ + flag_omit_frame_pointer = 0; \ + } \ + while (0) + +#undef TARGET_SUBTARGET_DEFAULT +#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP \ + | MASK_FLOAT_RETURNS) + +#define SUBTARGET_OPTIMIZATION_OPTIONS \ + do \ + { \ + if (optimize >= 1) \ + target_flags |= MASK_OMIT_LEAF_FRAME_POINTER; \ + } \ + while (0) + +#define MULTILIB_DEFAULTS { "m32" } + +#undef LINK_ARCH64_SPEC_BASE +#define LINK_ARCH64_SPEC_BASE \ + "%{G:-G} \ + %{YP,*} \ + %{R*} \ + %{compat-bsd: \ + %{!YP,*:%{p|pg:-Y P,/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64} \ + %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}} \ + -R /usr/ucblib/64} \ + %{!compat-bsd: \ + %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/64:/lib/64:/usr/lib/64} \ + %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}}}" + +#undef LINK_ARCH64_SPEC +#define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE + +#ifdef TARGET_GNU_LD +#define TARGET_LD_EMULATION "%{m64:-m elf_x86_64}%{!m64:-m elf_i386} " +#else +#define TARGET_LD_EMULATION "" +#endif + +#undef LINK_ARCH_SPEC +#define LINK_ARCH_SPEC TARGET_LD_EMULATION \ + "%{m64:" LINK_ARCH64_SPEC "}%{!m64:" LINK_ARCH32_SPEC "}" + +/* We do not need to search a special directory for startup files. */ +#undef MD_STARTFILE_PREFIX + +#undef TARGET_ASM_NAMED_SECTION +#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section + +/* In 32-bit mode, follow the SVR4 ABI definition; in 64-bit mode, use + the AMD64 ABI definition. */ +#undef RETURN_IN_MEMORY +#define RETURN_IN_MEMORY(TYPE) \ + (TARGET_64BIT \ + ? ix86_return_in_memory (TYPE) \ + : (TYPE_MODE (TYPE) == BLKmode \ + || (VECTOR_MODE_P (TYPE_MODE (TYPE)) \ + && int_size_in_bytes (TYPE) == 8))) diff --git a/contrib/gcc/config/i386/sol2-c1.asm b/contrib/gcc/config/i386/sol2-c1.asm index b17f57d9d34..af1ab3141f0 100644 --- a/contrib/gcc/config/i386/sol2-c1.asm +++ b/contrib/gcc/config/i386/sol2-c1.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/i386/sol2-ci.asm b/contrib/gcc/config/i386/sol2-ci.asm index 439c709ba68..c7a17445fcc 100644 --- a/contrib/gcc/config/i386/sol2-ci.asm +++ b/contrib/gcc/config/i386/sol2-ci.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/i386/sol2-cn.asm b/contrib/gcc/config/i386/sol2-cn.asm index 3f3bad93300..acd266ac070 100644 --- a/contrib/gcc/config/i386/sol2-cn.asm +++ b/contrib/gcc/config/i386/sol2-cn.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/i386/sol2-gc1.asm b/contrib/gcc/config/i386/sol2-gc1.asm index 81b56d4469c..abe9ed6aae6 100644 --- a/contrib/gcc/config/i386/sol2-gc1.asm +++ b/contrib/gcc/config/i386/sol2-gc1.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/i386/sol2.h b/contrib/gcc/config/i386/sol2.h index 78b2985cb7a..7593071030e 100644 --- a/contrib/gcc/config/i386/sol2.h +++ b/contrib/gcc/config/i386/sol2.h @@ -1,5 +1,6 @@ /* Target definitions for GCC for Intel 80386 running Solaris 2 - Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004 Free Software Foundation, Inc. Contributed by Fred Fish (fnf@cygnus.com). @@ -17,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* The Solaris 2.0 x86 linker botches alignment of code sections. It tries to align to a 16 byte boundary by padding with 0x00000090 @@ -30,14 +31,24 @@ Boston, MA 02111-1307, USA. */ it knows what it is doing. */ #define FORCE_CODE_SECTION_ALIGN asm(ALIGN_ASM_OP "16"); -/* Select a format to encode pointers in exception handling data. CODE - is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is - true if the symbol may be affected by dynamic relocations. */ +/* Old versions of the Solaris assembler can not handle the difference of + labels in different sections, so force DW_EH_PE_datarel. */ #undef ASM_PREFERRED_EH_DATA_FORMAT #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ - (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \ + (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0) \ + | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4 \ + : DW_EH_PE_datarel)) \ : DW_EH_PE_absptr) +/* The Solaris linker will not merge a read-only .eh_frame section + with a read-write .eh_frame section. None of the encodings used + with non-PIC code require runtime relocations. In 64-bit mode, + since there is no backwards compatibility issue, we use a read-only + section for .eh_frame. In 32-bit mode, we use a writable .eh_frame + section in order to be compatible with G++ for Solaris x86. */ +#undef EH_TABLES_CAN_BE_READ_ONLY +#define EH_TABLES_CAN_BE_READ_ONLY (TARGET_64BIT) + /* Solaris 2/Intel as chokes on #line directives. */ #undef CPP_SPEC #define CPP_SPEC "%{.S:-P} %(cpp_subtarget)" @@ -62,8 +73,10 @@ Boston, MA 02111-1307, USA. */ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* The Solaris assembler does not support .quad. Do not use it. */ +/* The 32-bit Solaris assembler does not support .quad. Do not use it. */ +#ifndef TARGET_BI_ARCH #undef ASM_QUAD +#endif /* The Solaris assembler wants a .local for non-exported aliases. */ #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \ @@ -79,3 +92,22 @@ Boston, MA 02111-1307, USA. */ fprintf ((FILE), "\n"); \ } \ } while (0) + +/* Solaris-specific #pragmas are implemented on top of attributes. Hook in + the bits from config/sol2.c. */ +#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes +#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE + +/* Output a simple call for .init/.fini. */ +#define ASM_OUTPUT_CALL(FILE, FN) \ + do \ + { \ + fprintf (FILE, "\tcall\t"); \ + print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \ + fprintf (FILE, "\n"); \ + } \ + while (0) + +/* We do not need NT_VERSION notes. */ +#undef X86_FILE_START_VERSION_DIRECTIVE +#define X86_FILE_START_VERSION_DIRECTIVE false diff --git a/contrib/gcc/config/i386/sse.md b/contrib/gcc/config/i386/sse.md new file mode 100644 index 00000000000..96361e0b6ca --- /dev/null +++ b/contrib/gcc/config/i386/sse.md @@ -0,0 +1,3950 @@ +;; GCC machine description for SSE instructions +;; Copyright (C) 2005, 2006 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;; 16 byte integral modes handled by SSE, minus TImode, which gets +;; special-cased for TARGET_64BIT. +(define_mode_macro SSEMODEI [V16QI V8HI V4SI V2DI]) + +;; All 16-byte vector modes handled by SSE +(define_mode_macro SSEMODE [V16QI V8HI V4SI V2DI V4SF V2DF]) + +;; Mix-n-match +(define_mode_macro SSEMODE12 [V16QI V8HI]) +(define_mode_macro SSEMODE24 [V8HI V4SI]) +(define_mode_macro SSEMODE14 [V16QI V4SI]) +(define_mode_macro SSEMODE124 [V16QI V8HI V4SI]) +(define_mode_macro SSEMODE248 [V8HI V4SI V2DI]) + +;; Mapping from integer vector mode to mnemonic suffix +(define_mode_attr ssevecsize [(V16QI "b") (V8HI "w") (V4SI "d") (V2DI "q")]) + +;; Patterns whose name begins with "sse{,2,3}_" are invoked by intrinsics. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Move patterns +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; All of these patterns are enabled for SSE1 as well as SSE2. +;; This is essential for maintaining stable calling conventions. + +(define_expand "mov" + [(set (match_operand:SSEMODEI 0 "nonimmediate_operand" "") + (match_operand:SSEMODEI 1 "nonimmediate_operand" ""))] + "TARGET_SSE" +{ + ix86_expand_vector_move (mode, operands); + DONE; +}) + +(define_insn "*mov_internal" + [(set (match_operand:SSEMODEI 0 "nonimmediate_operand" "=x,x ,m") + (match_operand:SSEMODEI 1 "nonimmediate_or_sse_const_operand" "C ,xm,x"))] + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" +{ + switch (which_alternative) + { + case 0: + return standard_sse_constant_opcode (insn, operands[1]); + case 1: + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movdqa\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sselog1,ssemov,ssemov") + (set (attr "mode") + (if_then_else + (ior (ior (ne (symbol_ref "optimize_size") (const_int 0)) + (eq (symbol_ref "TARGET_SSE2") (const_int 0))) + (and (eq_attr "alternative" "2") + (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0)))) + (const_string "V4SF") + (const_string "TI")))]) + +(define_expand "movv4sf" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "") + (match_operand:V4SF 1 "nonimmediate_operand" ""))] + "TARGET_SSE" +{ + ix86_expand_vector_move (V4SFmode, operands); + DONE; +}) + +(define_insn "*movv4sf_internal" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m") + (match_operand:V4SF 1 "nonimmediate_or_sse_const_operand" "C,xm,x"))] + "TARGET_SSE" +{ + switch (which_alternative) + { + case 0: + return standard_sse_constant_opcode (insn, operands[1]); + case 1: + case 2: + return "movaps\t{%1, %0|%0, %1}"; + default: + abort(); + } +} + [(set_attr "type" "sselog1,ssemov,ssemov") + (set_attr "mode" "V4SF")]) + +(define_split + [(set (match_operand:V4SF 0 "register_operand" "") + (match_operand:V4SF 1 "zero_extended_scalar_load_operand" ""))] + "TARGET_SSE && reload_completed" + [(set (match_dup 0) + (vec_merge:V4SF + (vec_duplicate:V4SF (match_dup 1)) + (match_dup 2) + (const_int 1)))] +{ + operands[1] = simplify_gen_subreg (SFmode, operands[1], V4SFmode, 0); + operands[2] = CONST0_RTX (V4SFmode); +}) + +(define_expand "movv2df" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "") + (match_operand:V2DF 1 "nonimmediate_operand" ""))] + "TARGET_SSE" +{ + ix86_expand_vector_move (V2DFmode, operands); + DONE; +}) + +(define_insn "*movv2df_internal" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m") + (match_operand:V2DF 1 "nonimmediate_or_sse_const_operand" "C,xm,x"))] + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" +{ + switch (which_alternative) + { + case 0: + return standard_sse_constant_opcode (insn, operands[1]); + case 1: + case 2: + if (get_attr_mode (insn) == MODE_V4SF) + return "movaps\t{%1, %0|%0, %1}"; + else + return "movapd\t{%1, %0|%0, %1}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sselog1,ssemov,ssemov") + (set (attr "mode") + (if_then_else + (ior (ior (ne (symbol_ref "optimize_size") (const_int 0)) + (eq (symbol_ref "TARGET_SSE2") (const_int 0))) + (and (eq_attr "alternative" "2") + (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES") + (const_int 0)))) + (const_string "V4SF") + (const_string "V2DF")))]) + +(define_split + [(set (match_operand:V2DF 0 "register_operand" "") + (match_operand:V2DF 1 "zero_extended_scalar_load_operand" ""))] + "TARGET_SSE2 && reload_completed" + [(set (match_dup 0) (vec_concat:V2DF (match_dup 1) (match_dup 2)))] +{ + operands[1] = simplify_gen_subreg (DFmode, operands[1], V2DFmode, 0); + operands[2] = CONST0_RTX (DFmode); +}) + +(define_expand "push1" + [(match_operand:SSEMODE 0 "register_operand" "")] + "TARGET_SSE" +{ + ix86_expand_push (mode, operands[0]); + DONE; +}) + +(define_expand "movmisalign" + [(set (match_operand:SSEMODE 0 "nonimmediate_operand" "") + (match_operand:SSEMODE 1 "nonimmediate_operand" ""))] + "TARGET_SSE" +{ + ix86_expand_vector_move_misalign (mode, operands); + DONE; +}) + +(define_insn "sse_movups" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,m") + (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm,x")] + UNSPEC_MOVU))] + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "movups\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_movupd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,m") + (unspec:V2DF [(match_operand:V2DF 1 "nonimmediate_operand" "xm,x")] + UNSPEC_MOVU))] + "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "movupd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_movdqu" + [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m") + (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")] + UNSPEC_MOVU))] + "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "movdqu\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "TI")]) + +(define_insn "sse_movntv4sf" + [(set (match_operand:V4SF 0 "memory_operand" "=m") + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "x")] + UNSPEC_MOVNT))] + "TARGET_SSE" + "movntps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V4SF")]) + +(define_insn "sse2_movntv2df" + [(set (match_operand:V2DF 0 "memory_operand" "=m") + (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "x")] + UNSPEC_MOVNT))] + "TARGET_SSE2" + "movntpd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_movntv2di" + [(set (match_operand:V2DI 0 "memory_operand" "=m") + (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")] + UNSPEC_MOVNT))] + "TARGET_SSE2" + "movntdq\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_insn "sse2_movntsi" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec:SI [(match_operand:SI 1 "register_operand" "r")] + UNSPEC_MOVNT))] + "TARGET_SSE2" + "movnti\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_insn "sse3_lddqu" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "m")] + UNSPEC_LDQQU))] + "TARGET_SSE3" + "lddqu\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point arithmetic +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "negv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "") + (neg:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_expand_fp_absneg_operator (NEG, V4SFmode, operands); DONE;") + +(define_expand "absv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "") + (abs:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_expand_fp_absneg_operator (ABS, V4SFmode, operands); DONE;") + +(define_expand "addv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (plus:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (PLUS, V4SFmode, operands);") + +(define_insn "*addv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (plus:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && ix86_binary_operator_ok (PLUS, V4SFmode, operands)" + "addps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmaddv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (plus:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE && ix86_binary_operator_ok (PLUS, V4SFmode, operands)" + "addss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_expand "subv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (minus:V4SF (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (MINUS, V4SFmode, operands);") + +(define_insn "*subv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (minus:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "subps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmsubv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (minus:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE" + "subss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_expand "mulv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (mult:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (MULT, V4SFmode, operands);") + +(define_insn "*mulv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (mult:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && ix86_binary_operator_ok (MULT, V4SFmode, operands)" + "mulps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemul") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmmulv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (mult:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE && ix86_binary_operator_ok (MULT, V4SFmode, operands)" + "mulss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemul") + (set_attr "mode" "SF")]) + +(define_expand "divv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (div:V4SF (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (DIV, V4SFmode, operands);") + +(define_insn "*divv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (div:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "divps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssediv") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmdivv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (div:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE" + "divss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssediv") + (set_attr "mode" "SF")]) + +(define_insn "sse_rcpv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (unspec:V4SF + [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RCP))] + "TARGET_SSE" + "rcpps\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmrcpv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] + UNSPEC_RCP) + (match_operand:V4SF 2 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE" + "rcpss\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "SF")]) + +(define_insn "sse_rsqrtv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (unspec:V4SF + [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RSQRT))] + "TARGET_SSE" + "rsqrtps\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmrsqrtv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] + UNSPEC_RSQRT) + (match_operand:V4SF 2 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE" + "rsqrtss\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "SF")]) + +(define_insn "sqrtv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "sqrtps\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmsqrtv4sf2" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "xm")) + (match_operand:V4SF 2 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE" + "sqrtss\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "SF")]) + +;; ??? For !flag_finite_math_only, the representation with SMIN/SMAX +;; isn't really correct, as those rtl operators aren't defined when +;; applied to NaNs. Hopefully the optimizers won't get too smart on us. + +(define_expand "smaxv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (smax:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" +{ + if (!flag_finite_math_only) + operands[1] = force_reg (V4SFmode, operands[1]); + ix86_fixup_binary_operands_no_copy (SMAX, V4SFmode, operands); +}) + +(define_insn "*smaxv4sf3_finite" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (smax:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && flag_finite_math_only + && ix86_binary_operator_ok (SMAX, V4SFmode, operands)" + "maxps\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "*smaxv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (smax:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "maxps\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmsmaxv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (smax:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE" + "maxss\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "SF")]) + +(define_expand "sminv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (smin:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" +{ + if (!flag_finite_math_only) + operands[1] = force_reg (V4SFmode, operands[1]); + ix86_fixup_binary_operands_no_copy (SMIN, V4SFmode, operands); +}) + +(define_insn "*sminv4sf3_finite" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (smin:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && flag_finite_math_only + && ix86_binary_operator_ok (SMIN, V4SFmode, operands)" + "minps\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "*sminv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (smin:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "minps\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmsminv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (smin:V4SF (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE" + "minss\t{%2, %0|%0, %2}" + [(set_attr "type" "sse") + (set_attr "mode" "SF")]) + +;; These versions of the min/max patterns implement exactly the operations +;; min = (op1 < op2 ? op1 : op2) +;; max = (!(op1 < op2) ? op1 : op2) +;; Their operands are not commutative, and thus they may be used in the +;; presence of -0.0 and NaN. + +(define_insn "*ieee_sminv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE" + "minps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "*ieee_smaxv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE" + "maxps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "*ieee_sminv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE2" + "minpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "*ieee_smaxv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE2" + "maxpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse3_addsubv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (plus:V4SF + (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (minus:V4SF (match_dup 1) (match_dup 2)) + (const_int 5)))] + "TARGET_SSE3" + "addsubps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "sse3_haddv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_concat:V4SF + (vec_concat:V2SF + (plus:SF + (vec_select:SF + (match_operand:V4SF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 1)]))) + (plus:SF + (vec_select:SF (match_dup 1) (parallel [(const_int 2)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2SF + (plus:SF + (vec_select:SF + (match_operand:V4SF 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 1)]))) + (plus:SF + (vec_select:SF (match_dup 2) (parallel [(const_int 2)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSE3" + "haddps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_insn "sse3_hsubv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_concat:V4SF + (vec_concat:V2SF + (minus:SF + (vec_select:SF + (match_operand:V4SF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 1)]))) + (minus:SF + (vec_select:SF (match_dup 1) (parallel [(const_int 2)])) + (vec_select:SF (match_dup 1) (parallel [(const_int 3)])))) + (vec_concat:V2SF + (minus:SF + (vec_select:SF + (match_operand:V4SF 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 1)]))) + (minus:SF + (vec_select:SF (match_dup 2) (parallel [(const_int 2)])) + (vec_select:SF (match_dup 2) (parallel [(const_int 3)]))))))] + "TARGET_SSE3" + "hsubps\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V4SF")]) + +(define_expand "reduc_splus_v4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "")] + "TARGET_SSE" +{ + if (TARGET_SSE3) + { + rtx tmp = gen_reg_rtx (V4SFmode); + emit_insn (gen_sse3_haddv4sf3 (tmp, operands[1], operands[1])); + emit_insn (gen_sse3_haddv4sf3 (operands[0], tmp, tmp)); + } + else + ix86_expand_reduc_v4sf (gen_addv4sf3, operands[0], operands[1]); + DONE; +}) + +(define_expand "reduc_smax_v4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "")] + "TARGET_SSE" +{ + ix86_expand_reduc_v4sf (gen_smaxv4sf3, operands[0], operands[1]); + DONE; +}) + +(define_expand "reduc_smin_v4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "")] + "TARGET_SSE" +{ + ix86_expand_reduc_v4sf (gen_sminv4sf3, operands[0], operands[1]); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point comparisons +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse_maskcmpv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (match_operator:V4SF 3 "sse_comparison_operator" + [(match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")]))] + "TARGET_SSE" + "cmp%D3ps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_vmmaskcmpv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (match_operator:V4SF 3 "sse_comparison_operator" + [(match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "register_operand" "x")]) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE" + "cmp%D3ss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "SF")]) + +(define_insn "sse_comi" + [(set (reg:CCFP FLAGS_REG) + (compare:CCFP + (vec_select:SF + (match_operand:V4SF 0 "register_operand" "x") + (parallel [(const_int 0)])) + (vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0)]))))] + "TARGET_SSE" + "comiss\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecomi") + (set_attr "mode" "SF")]) + +(define_insn "sse_ucomi" + [(set (reg:CCFPU FLAGS_REG) + (compare:CCFPU + (vec_select:SF + (match_operand:V4SF 0 "register_operand" "x") + (parallel [(const_int 0)])) + (vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0)]))))] + "TARGET_SSE" + "ucomiss\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecomi") + (set_attr "mode" "SF")]) + +(define_expand "vcondv4sf" + [(set (match_operand:V4SF 0 "register_operand" "") + (if_then_else:V4SF + (match_operator 3 "" + [(match_operand:V4SF 4 "nonimmediate_operand" "") + (match_operand:V4SF 5 "nonimmediate_operand" "")]) + (match_operand:V4SF 1 "general_operand" "") + (match_operand:V4SF 2 "general_operand" "")))] + "TARGET_SSE" +{ + if (ix86_expand_fp_vcond (operands)) + DONE; + else + FAIL; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point logical operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "andv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (and:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (AND, V4SFmode, operands);") + +(define_insn "*andv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (and:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && ix86_binary_operator_ok (AND, V4SFmode, operands)" + "andps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_nandv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (and:V4SF (not:V4SF (match_operand:V4SF 1 "register_operand" "0")) + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE" + "andnps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_expand "iorv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (ior:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (IOR, V4SFmode, operands);") + +(define_insn "*iorv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (ior:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && ix86_binary_operator_ok (IOR, V4SFmode, operands)" + "orps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_expand "xorv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "") + (xor:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "")))] + "TARGET_SSE" + "ix86_fixup_binary_operands_no_copy (XOR, V4SFmode, operands);") + +(define_insn "*xorv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (xor:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "%0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE && ix86_binary_operator_ok (XOR, V4SFmode, operands)" + "xorps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +;; Also define scalar versions. These are used for abs, neg, and +;; conditional move. Using subregs into vector modes causes register +;; allocation lossage. These patterns do not allow memory operands +;; because the native instructions read the full 128-bits. + +(define_insn "*andsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (and:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "andps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*nandsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (and:SF (not:SF (match_operand:SF 1 "register_operand" "0")) + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "andnps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*iorsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (ior:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "orps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*xorsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (xor:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "xorps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point conversion operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse_cvtpi2ps" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (vec_duplicate:V4SF + (float:V2SF (match_operand:V2SI 2 "nonimmediate_operand" "ym"))) + (match_operand:V4SF 1 "register_operand" "0") + (const_int 3)))] + "TARGET_SSE" + "cvtpi2ps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_cvtps2pi" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_select:V2SI + (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] + UNSPEC_FIX_NOTRUNC) + (parallel [(const_int 0) (const_int 1)])))] + "TARGET_SSE" + "cvtps2pi\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "unit" "mmx") + (set_attr "mode" "DI")]) + +(define_insn "sse_cvttps2pi" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (vec_select:V2SI + (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) (const_int 1)])))] + "TARGET_SSE" + "cvttps2pi\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "unit" "mmx") + (set_attr "mode" "SF")]) + +(define_insn "sse_cvtsi2ss" + [(set (match_operand:V4SF 0 "register_operand" "=x,x") + (vec_merge:V4SF + (vec_duplicate:V4SF + (float:SF (match_operand:SI 2 "nonimmediate_operand" "r,m"))) + (match_operand:V4SF 1 "register_operand" "0,0") + (const_int 1)))] + "TARGET_SSE" + "cvtsi2ss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "vector,double") + (set_attr "mode" "SF")]) + +(define_insn "sse_cvtsi2ssq" + [(set (match_operand:V4SF 0 "register_operand" "=x,x") + (vec_merge:V4SF + (vec_duplicate:V4SF + (float:SF (match_operand:DI 2 "nonimmediate_operand" "r,rm"))) + (match_operand:V4SF 1 "register_operand" "0,0") + (const_int 1)))] + "TARGET_SSE && TARGET_64BIT" + "cvtsi2ssq\t{%2, %0|%0, %2}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "vector,double") + (set_attr "mode" "SF")]) + +(define_insn "sse_cvtss2si" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (unspec:SI + [(vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE" + "cvtss2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "SI")]) + +(define_insn "sse_cvtss2siq" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (unspec:DI + [(vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE && TARGET_64BIT" + "cvtss2siq\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "DI")]) + +(define_insn "sse_cvttss2si" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (fix:SI + (vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))))] + "TARGET_SSE" + "cvttss2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "SI")]) + +(define_insn "sse_cvttss2siq" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (fix:DI + (vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))))] + "TARGET_SSE && TARGET_64BIT" + "cvttss2siq\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "DI")]) + +(define_insn "sse2_cvtdq2ps" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (float:V4SF (match_operand:V4SI 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "cvtdq2ps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_cvtps2dq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE2" + "cvtps2dq\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_insn "sse2_cvttps2dq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "cvttps2dq\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel single-precision floating point element swizzling +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse_movhlps" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "nonimmediate_operand" " 0,0,0") + (match_operand:V4SF 2 "nonimmediate_operand" " x,o,x")) + (parallel [(const_int 6) + (const_int 7) + (const_int 2) + (const_int 3)])))] + "TARGET_SSE && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + movhlps\t{%2, %0|%0, %2} + movlps\t{%H2, %0|%0, %H2} + movhps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V4SF,V2SF,V2SF")]) + +(define_insn "sse_movlhps" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "nonimmediate_operand" " 0,0,0") + (match_operand:V4SF 2 "nonimmediate_operand" " x,m,x")) + (parallel [(const_int 0) + (const_int 1) + (const_int 4) + (const_int 5)])))] + "TARGET_SSE && ix86_binary_operator_ok (UNKNOWN, V4SFmode, operands)" + "@ + movlhps\t{%2, %0|%0, %2} + movhps\t{%2, %0|%0, %2} + movlps\t{%2, %H0|%H0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V4SF,V2SF,V2SF")]) + +(define_insn "sse_unpckhps" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 2) (const_int 6) + (const_int 3) (const_int 7)])))] + "TARGET_SSE" + "unpckhps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_unpcklps" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) (const_int 4) + (const_int 1) (const_int 5)])))] + "TARGET_SSE" + "unpcklps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +;; These are modeled with the same vec_concat as the others so that we +;; capture users of shufps that can use the new instructions +(define_insn "sse3_movshdup" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (match_dup 1)) + (parallel [(const_int 1) + (const_int 1) + (const_int 7) + (const_int 7)])))] + "TARGET_SSE3" + "movshdup\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_insn "sse3_movsldup" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (match_dup 1)) + (parallel [(const_int 0) + (const_int 0) + (const_int 6) + (const_int 6)])))] + "TARGET_SSE3" + "movsldup\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V4SF")]) + +(define_expand "sse_shufps" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "") + (match_operand:V4SF 2 "nonimmediate_operand" "") + (match_operand:SI 3 "const_int_operand" "")] + "TARGET_SSE" +{ + int mask = INTVAL (operands[3]); + emit_insn (gen_sse_shufps_1 (operands[0], operands[1], operands[2], + GEN_INT ((mask >> 0) & 3), + GEN_INT ((mask >> 2) & 3), + GEN_INT (((mask >> 4) & 3) + 4), + GEN_INT (((mask >> 6) & 3) + 4))); + DONE; +}) + +(define_insn "sse_shufps_1" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_select:V4SF + (vec_concat:V8SF + (match_operand:V4SF 1 "register_operand" "0") + (match_operand:V4SF 2 "nonimmediate_operand" "xm")) + (parallel [(match_operand 3 "const_0_to_3_operand" "") + (match_operand 4 "const_0_to_3_operand" "") + (match_operand 5 "const_4_to_7_operand" "") + (match_operand 6 "const_4_to_7_operand" "")])))] + "TARGET_SSE" +{ + int mask = 0; + mask |= INTVAL (operands[3]) << 0; + mask |= INTVAL (operands[4]) << 2; + mask |= (INTVAL (operands[5]) - 4) << 4; + mask |= (INTVAL (operands[6]) - 4) << 6; + operands[3] = GEN_INT (mask); + + return "shufps\t{%3, %2, %0|%0, %2, %3}"; +} + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "sse_storehps" + [(set (match_operand:V2SF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,x,o") + (parallel [(const_int 2) (const_int 3)])))] + "TARGET_SSE" + "@ + movhps\t{%1, %0|%0, %1} + movhlps\t{%1, %0|%0, %1} + movlps\t{%H1, %0|%0, %H1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "sse_loadhps" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o") + (vec_concat:V4SF + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "0,0,0") + (parallel [(const_int 0) (const_int 1)])) + (match_operand:V2SF 2 "nonimmediate_operand" "m,x,x")))] + "TARGET_SSE" + "@ + movhps\t{%2, %0|%0, %2} + movlhps\t{%2, %0|%0, %2} + movlps\t{%2, %H0|%H0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "sse_storelps" + [(set (match_operand:V2SF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,x,m") + (parallel [(const_int 0) (const_int 1)])))] + "TARGET_SSE" + "@ + movlps\t{%1, %0|%0, %1} + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "sse_loadlps" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m") + (vec_concat:V4SF + (match_operand:V2SF 2 "nonimmediate_operand" "0,m,x") + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "x,0,0") + (parallel [(const_int 2) (const_int 3)]))))] + "TARGET_SSE" + "@ + shufps\t{$0xe4, %1, %0|%0, %1, 0xe4} + movlps\t{%2, %0|%0, %2} + movlps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog,ssemov,ssemov") + (set_attr "mode" "V4SF,V2SF,V2SF")]) + +(define_insn "sse_movss" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_merge:V4SF + (match_operand:V4SF 2 "register_operand" "x") + (match_operand:V4SF 1 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE" + "movss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "SF")]) + +(define_insn "*vec_dupv4sf" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_duplicate:V4SF + (match_operand:SF 1 "register_operand" "0")))] + "TARGET_SSE" + "shufps\t{$0, %0, %0|%0, %0, 0}" + [(set_attr "type" "sselog1") + (set_attr "mode" "V4SF")]) + +;; ??? In theory we can match memory for the MMX alternative, but allowing +;; nonimmediate_operand for operand 2 and *not* allowing memory for the SSE +;; alternatives pretty much forces the MMX alternative to be chosen. +(define_insn "*sse_concatv2sf" + [(set (match_operand:V2SF 0 "register_operand" "=x,x,*y,*y") + (vec_concat:V2SF + (match_operand:SF 1 "nonimmediate_operand" " 0,m, 0, m") + (match_operand:SF 2 "reg_or_0_operand" " x,C,*y, C")))] + "TARGET_SSE" + "@ + unpcklps\t{%2, %0|%0, %2} + movss\t{%1, %0|%0, %1} + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog,ssemov,mmxcvt,mmxmov") + (set_attr "mode" "V4SF,SF,DI,DI")]) + +(define_insn "*sse_concatv4sf" + [(set (match_operand:V4SF 0 "register_operand" "=x,x") + (vec_concat:V4SF + (match_operand:V2SF 1 "register_operand" " 0,0") + (match_operand:V2SF 2 "nonimmediate_operand" " x,m")))] + "TARGET_SSE" + "@ + movlhps\t{%2, %0|%0, %2} + movhps\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V4SF,V2SF")]) + +(define_expand "vec_initv4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_insn "*vec_setv4sf_0" + [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,Y ,m") + (vec_merge:V4SF + (vec_duplicate:V4SF + (match_operand:SF 2 "general_operand" " x,m,*r,x*rfF")) + (match_operand:V4SF 1 "vector_move_operand" " 0,C,C ,0") + (const_int 1)))] + "TARGET_SSE" + "@ + movss\t{%2, %0|%0, %2} + movss\t{%2, %0|%0, %2} + movd\t{%2, %0|%0, %2} + #" + [(set_attr "type" "ssemov") + (set_attr "mode" "SF")]) + +(define_split + [(set (match_operand:V4SF 0 "memory_operand" "") + (vec_merge:V4SF + (vec_duplicate:V4SF + (match_operand:SF 1 "nonmemory_operand" "")) + (match_dup 0) + (const_int 1)))] + "TARGET_SSE && reload_completed" + [(const_int 0)] +{ + emit_move_insn (adjust_address (operands[0], SFmode, 0), operands[1]); + DONE; +}) + +(define_expand "vec_setv4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_insn_and_split "*vec_extractv4sf_0" + [(set (match_operand:SF 0 "nonimmediate_operand" "=x,m,fr") + (vec_select:SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm,x,m") + (parallel [(const_int 0)])))] + "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rtx op1 = operands[1]; + if (REG_P (op1)) + op1 = gen_rtx_REG (SFmode, REGNO (op1)); + else + op1 = gen_lowpart (SFmode, op1); + emit_move_insn (operands[0], op1); + DONE; +}) + +(define_expand "vec_extractv4sf" + [(match_operand:SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel double-precision floating point arithmetic +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "negv2df2" + [(set (match_operand:V2DF 0 "register_operand" "") + (neg:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_expand_fp_absneg_operator (NEG, V2DFmode, operands); DONE;") + +(define_expand "absv2df2" + [(set (match_operand:V2DF 0 "register_operand" "") + (abs:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_expand_fp_absneg_operator (ABS, V2DFmode, operands); DONE;") + +(define_expand "addv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (plus:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (PLUS, V2DFmode, operands);") + +(define_insn "*addv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (plus:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, V2DFmode, operands)" + "addpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmaddv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (plus:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, V4SFmode, operands)" + "addsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_expand "subv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (minus:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (MINUS, V2DFmode, operands);") + +(define_insn "*subv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (minus:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "subpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmsubv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (minus:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2" + "subsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_expand "mulv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (mult:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (MULT, V2DFmode, operands);") + +(define_insn "*mulv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (mult:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V2DFmode, operands)" + "mulpd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemul") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmmulv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (mult:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V2DFmode, operands)" + "mulsd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemul") + (set_attr "mode" "DF")]) + +(define_expand "divv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (div:V2DF (match_operand:V2DF 1 "register_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (DIV, V2DFmode, operands);") + +(define_insn "*divv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (div:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "divpd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssediv") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmdivv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (div:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2" + "divsd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssediv") + (set_attr "mode" "DF")]) + +(define_insn "sqrtv2df2" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (sqrt:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "sqrtpd\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmsqrtv2df2" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (sqrt:V2DF (match_operand:V2DF 1 "register_operand" "xm")) + (match_operand:V2DF 2 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE2" + "sqrtsd\t{%1, %0|%0, %1}" + [(set_attr "type" "sse") + (set_attr "mode" "DF")]) + +;; ??? For !flag_finite_math_only, the representation with SMIN/SMAX +;; isn't really correct, as those rtl operators aren't defined when +;; applied to NaNs. Hopefully the optimizers won't get too smart on us. + +(define_expand "smaxv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (smax:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" +{ + if (!flag_finite_math_only) + operands[1] = force_reg (V2DFmode, operands[1]); + ix86_fixup_binary_operands_no_copy (SMAX, V2DFmode, operands); +}) + +(define_insn "*smaxv2df3_finite" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (smax:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && flag_finite_math_only + && ix86_binary_operator_ok (SMAX, V2DFmode, operands)" + "maxpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "*smaxv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (smax:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "maxpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmsmaxv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (smax:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2" + "maxsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_expand "sminv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (smin:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" +{ + if (!flag_finite_math_only) + operands[1] = force_reg (V2DFmode, operands[1]); + ix86_fixup_binary_operands_no_copy (SMIN, V2DFmode, operands); +}) + +(define_insn "*sminv2df3_finite" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (smin:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && flag_finite_math_only + && ix86_binary_operator_ok (SMIN, V2DFmode, operands)" + "minpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "*sminv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (smin:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "minpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmsminv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (smin:V2DF (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2" + "minsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_insn "sse3_addsubv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (plus:V2DF + (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (minus:V2DF (match_dup 1) (match_dup 2)) + (const_int 1)))] + "TARGET_SSE3" + "addsubpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse3_haddv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_concat:V2DF + (plus:DF + (vec_select:DF + (match_operand:V2DF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:DF (match_dup 1) (parallel [(const_int 1)]))) + (plus:DF + (vec_select:DF + (match_operand:V2DF 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:DF (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_SSE3" + "haddpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_insn "sse3_hsubv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_concat:V2DF + (minus:DF + (vec_select:DF + (match_operand:V2DF 1 "register_operand" "0") + (parallel [(const_int 0)])) + (vec_select:DF (match_dup 1) (parallel [(const_int 1)]))) + (minus:DF + (vec_select:DF + (match_operand:V2DF 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0)])) + (vec_select:DF (match_dup 2) (parallel [(const_int 1)])))))] + "TARGET_SSE3" + "hsubpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "V2DF")]) + +(define_expand "reduc_splus_v2df" + [(match_operand:V2DF 0 "register_operand" "") + (match_operand:V2DF 1 "register_operand" "")] + "TARGET_SSE3" +{ + emit_insn (gen_sse3_haddv2df3 (operands[0], operands[1], operands[1])); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel double-precision floating point comparisons +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_maskcmpv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (match_operator:V2DF 3 "sse_comparison_operator" + [(match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")]))] + "TARGET_SSE2" + "cmp%D3pd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_vmmaskcmpv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (match_operator:V2DF 3 "sse_comparison_operator" + [(match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")]) + (match_dup 1) + (const_int 1)))] + "TARGET_SSE2" + "cmp%D3sd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "DF")]) + +(define_insn "sse2_comi" + [(set (reg:CCFP FLAGS_REG) + (compare:CCFP + (vec_select:DF + (match_operand:V2DF 0 "register_operand" "x") + (parallel [(const_int 0)])) + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0)]))))] + "TARGET_SSE2" + "comisd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecomi") + (set_attr "mode" "DF")]) + +(define_insn "sse2_ucomi" + [(set (reg:CCFPU FLAGS_REG) + (compare:CCFPU + (vec_select:DF + (match_operand:V2DF 0 "register_operand" "x") + (parallel [(const_int 0)])) + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0)]))))] + "TARGET_SSE2" + "ucomisd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecomi") + (set_attr "mode" "DF")]) + +(define_expand "vcondv2df" + [(set (match_operand:V2DF 0 "register_operand" "") + (if_then_else:V2DF + (match_operator 3 "" + [(match_operand:V2DF 4 "nonimmediate_operand" "") + (match_operand:V2DF 5 "nonimmediate_operand" "")]) + (match_operand:V2DF 1 "general_operand" "") + (match_operand:V2DF 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_fp_vcond (operands)) + DONE; + else + FAIL; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel double-precision floating point logical operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "andv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (and:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (AND, V2DFmode, operands);") + +(define_insn "*andv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (and:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (AND, V2DFmode, operands)" + "andpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_nandv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (and:V2DF (not:V2DF (match_operand:V2DF 1 "register_operand" "0")) + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "andnpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_expand "iorv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (ior:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (IOR, V2DFmode, operands);") + +(define_insn "*iorv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (ior:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (IOR, V2DFmode, operands)" + "orpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_expand "xorv2df3" + [(set (match_operand:V2DF 0 "register_operand" "") + (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (XOR, V2DFmode, operands);") + +(define_insn "*xorv2df3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (xor:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (XOR, V2DFmode, operands)" + "xorpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +;; Also define scalar versions. These are used for abs, neg, and +;; conditional move. Using subregs into vector modes causes register +;; allocation lossage. These patterns do not allow memory operands +;; because the native instructions read the full 128-bits. + +(define_insn "*anddf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (and:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "andpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*nanddf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (and:DF (not:DF (match_operand:DF 1 "register_operand" "0")) + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "andnpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*iordf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (ior:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "orpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*xordf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (xor:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "xorpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel double-precision floating point conversion operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_cvtpi2pd" + [(set (match_operand:V2DF 0 "register_operand" "=x,x") + (float:V2DF (match_operand:V2SI 1 "nonimmediate_operand" "y,m")))] + "TARGET_SSE2" + "cvtpi2pd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "unit" "mmx,*") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_cvtpd2pi" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "xm")] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE2" + "cvtpd2pi\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "unit" "mmx") + (set_attr "mode" "DI")]) + +(define_insn "sse2_cvttpd2pi" + [(set (match_operand:V2SI 0 "register_operand" "=y") + (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "cvttpd2pi\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "unit" "mmx") + (set_attr "mode" "TI")]) + +(define_insn "sse2_cvtsi2sd" + [(set (match_operand:V2DF 0 "register_operand" "=x,x") + (vec_merge:V2DF + (vec_duplicate:V2DF + (float:DF (match_operand:SI 2 "nonimmediate_operand" "r,m"))) + (match_operand:V2DF 1 "register_operand" "0,0") + (const_int 1)))] + "TARGET_SSE2" + "cvtsi2sd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DF") + (set_attr "athlon_decode" "double,direct")]) + +(define_insn "sse2_cvtsi2sdq" + [(set (match_operand:V2DF 0 "register_operand" "=x,x") + (vec_merge:V2DF + (vec_duplicate:V2DF + (float:DF (match_operand:DI 2 "nonimmediate_operand" "r,m"))) + (match_operand:V2DF 1 "register_operand" "0,0") + (const_int 1)))] + "TARGET_SSE2 && TARGET_64BIT" + "cvtsi2sdq\t{%2, %0|%0, %2}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DF") + (set_attr "athlon_decode" "double,direct")]) + +(define_insn "sse2_cvtsd2si" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (unspec:SI + [(vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE2" + "cvtsd2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "SI")]) + +(define_insn "sse2_cvtsd2siq" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (unspec:DI + [(vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))] + UNSPEC_FIX_NOTRUNC))] + "TARGET_SSE2 && TARGET_64BIT" + "cvtsd2siq\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "athlon_decode" "double,vector") + (set_attr "mode" "DI")]) + +(define_insn "sse2_cvttsd2si" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (fix:SI + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))))] + "TARGET_SSE2" + "cvttsd2si\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "SI") + (set_attr "athlon_decode" "double,vector")]) + +(define_insn "sse2_cvttsd2siq" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (fix:DI + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,m") + (parallel [(const_int 0)]))))] + "TARGET_SSE2 && TARGET_64BIT" + "cvttsd2siq\t{%1, %0|%0, %1}" + [(set_attr "type" "sseicvt") + (set_attr "mode" "DI") + (set_attr "athlon_decode" "double,vector")]) + +(define_insn "sse2_cvtdq2pd" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (float:V2DF + (vec_select:V2SI + (match_operand:V4SI 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0) (const_int 1)]))))] + "TARGET_SSE2" + "cvtdq2pd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_expand "sse2_cvtpd2dq" + [(set (match_operand:V4SI 0 "register_operand" "") + (vec_concat:V4SI + (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "")] + UNSPEC_FIX_NOTRUNC) + (match_dup 2)))] + "TARGET_SSE2" + "operands[2] = CONST0_RTX (V2SImode);") + +(define_insn "*sse2_cvtpd2dq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_concat:V4SI + (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "xm")] + UNSPEC_FIX_NOTRUNC) + (match_operand:V2SI 2 "const0_operand" "")))] + "TARGET_SSE2" + "cvtpd2dq\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_expand "sse2_cvttpd2dq" + [(set (match_operand:V4SI 0 "register_operand" "") + (vec_concat:V4SI + (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "")) + (match_dup 2)))] + "TARGET_SSE2" + "operands[2] = CONST0_RTX (V2SImode);") + +(define_insn "*sse2_cvttpd2dq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_concat:V4SI + (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "xm")) + (match_operand:V2SI 2 "const0_operand" "")))] + "TARGET_SSE2" + "cvttpd2dq\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_insn "sse2_cvtsd2ss" + [(set (match_operand:V4SF 0 "register_operand" "=x,x") + (vec_merge:V4SF + (vec_duplicate:V4SF + (float_truncate:V2SF + (match_operand:V2DF 2 "nonimmediate_operand" "x,m"))) + (match_operand:V4SF 1 "register_operand" "0,0") + (const_int 1)))] + "TARGET_SSE2" + "cvtsd2ss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecvt") + (set_attr "athlon_decode" "vector,double") + (set_attr "mode" "SF")]) + +(define_insn "sse2_cvtss2sd" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_merge:V2DF + (float_extend:V2DF + (vec_select:V2SF + (match_operand:V4SF 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0) (const_int 1)]))) + (match_operand:V2DF 1 "register_operand" "0") + (const_int 1)))] + "TARGET_SSE2" + "cvtss2sd\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "DF")]) + +(define_expand "sse2_cvtpd2ps" + [(set (match_operand:V4SF 0 "register_operand" "") + (vec_concat:V4SF + (float_truncate:V2SF + (match_operand:V2DF 1 "nonimmediate_operand" "xm")) + (match_dup 2)))] + "TARGET_SSE2" + "operands[2] = CONST0_RTX (V2SFmode);") + +(define_insn "*sse2_cvtpd2ps" + [(set (match_operand:V4SF 0 "register_operand" "=x") + (vec_concat:V4SF + (float_truncate:V2SF + (match_operand:V2DF 1 "nonimmediate_operand" "xm")) + (match_operand:V2SF 2 "const0_operand" "")))] + "TARGET_SSE2" + "cvtpd2ps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V4SF")]) + +(define_insn "sse2_cvtps2pd" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (float_extend:V2DF + (vec_select:V2SF + (match_operand:V4SF 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0) (const_int 1)]))))] + "TARGET_SSE2" + "cvtps2pd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel double-precision floating point element swizzling +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_unpckhpd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m") + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "nonimmediate_operand" " 0,o,x") + (match_operand:V2DF 2 "nonimmediate_operand" " x,0,0")) + (parallel [(const_int 1) + (const_int 3)])))] + "TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + unpckhpd\t{%2, %0|%0, %2} + movlpd\t{%H1, %0|%0, %H1} + movhpd\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog,ssemov,ssemov") + (set_attr "mode" "V2DF,V1DF,V1DF")]) + +(define_insn "*sse3_movddup" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,o") + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "nonimmediate_operand" "xm,x") + (match_dup 1)) + (parallel [(const_int 0) + (const_int 2)])))] + "TARGET_SSE3 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + movddup\t{%1, %0|%0, %1} + #" + [(set_attr "type" "sselog,ssemov") + (set_attr "mode" "V2DF")]) + +(define_split + [(set (match_operand:V2DF 0 "memory_operand" "") + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "register_operand" "") + (match_dup 1)) + (parallel [(const_int 0) + (const_int 2)])))] + "TARGET_SSE3 && reload_completed" + [(const_int 0)] +{ + rtx low = gen_rtx_REG (DFmode, REGNO (operands[1])); + emit_move_insn (adjust_address (operands[0], DFmode, 0), low); + emit_move_insn (adjust_address (operands[0], DFmode, 8), low); + DONE; +}) + +(define_insn "sse2_unpcklpd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,o") + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "nonimmediate_operand" " 0,0,0") + (match_operand:V2DF 2 "nonimmediate_operand" " x,m,x")) + (parallel [(const_int 0) + (const_int 2)])))] + "TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + unpcklpd\t{%2, %0|%0, %2} + movhpd\t{%2, %0|%0, %2} + movlpd\t{%2, %H0|%H0, %2}" + [(set_attr "type" "sselog,ssemov,ssemov") + (set_attr "mode" "V2DF,V1DF,V1DF")]) + +(define_expand "sse2_shufpd" + [(match_operand:V2DF 0 "register_operand" "") + (match_operand:V2DF 1 "register_operand" "") + (match_operand:V2DF 2 "nonimmediate_operand" "") + (match_operand:SI 3 "const_int_operand" "")] + "TARGET_SSE2" +{ + int mask = INTVAL (operands[3]); + emit_insn (gen_sse2_shufpd_1 (operands[0], operands[1], operands[2], + GEN_INT (mask & 1), + GEN_INT (mask & 2 ? 3 : 2))); + DONE; +}) + +(define_insn "sse2_shufpd_1" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "register_operand" "0") + (match_operand:V2DF 2 "nonimmediate_operand" "xm")) + (parallel [(match_operand 3 "const_0_to_1_operand" "") + (match_operand 4 "const_2_to_3_operand" "")])))] + "TARGET_SSE2" +{ + int mask; + mask = INTVAL (operands[3]); + mask |= (INTVAL (operands[4]) - 2) << 1; + operands[3] = GEN_INT (mask); + + return "shufpd\t{%3, %2, %0|%0, %2, %3}"; +} + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_storehpd" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x*fr") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" " x,0,o") + (parallel [(const_int 1)])))] + "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movhpd\t{%1, %0|%0, %1} + unpckhpd\t%0, %0 + #" + [(set_attr "type" "ssemov,sselog1,ssemov") + (set_attr "mode" "V1DF,V2DF,DF")]) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (vec_select:DF + (match_operand:V2DF 1 "memory_operand" "") + (parallel [(const_int 1)])))] + "TARGET_SSE2 && reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + operands[1] = adjust_address (operands[1], DFmode, 8); +}) + +(define_insn "sse2_storelpd" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x*fr") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" " x,x,m") + (parallel [(const_int 0)])))] + "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movlpd\t{%1, %0|%0, %1} + # + #" + [(set_attr "type" "ssemov") + (set_attr "mode" "V1DF,DF,DF")]) + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "") + (parallel [(const_int 0)])))] + "TARGET_SSE2 && reload_completed" + [(const_int 0)] +{ + rtx op1 = operands[1]; + if (REG_P (op1)) + op1 = gen_rtx_REG (DFmode, REGNO (op1)); + else + op1 = gen_lowpart (DFmode, op1); + emit_move_insn (operands[0], op1); + DONE; +}) + +(define_insn "sse2_loadhpd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,o") + (vec_concat:V2DF + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" " 0,0,x,0") + (parallel [(const_int 0)])) + (match_operand:DF 2 "nonimmediate_operand" " m,x,0,x*fr")))] + "TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + movhpd\t{%2, %0|%0, %2} + unpcklpd\t{%2, %0|%0, %2} + shufpd\t{$1, %1, %0|%0, %1, 1} + #" + [(set_attr "type" "ssemov,sselog,sselog,other") + (set_attr "mode" "V1DF,V2DF,V2DF,DF")]) + +(define_split + [(set (match_operand:V2DF 0 "memory_operand" "") + (vec_concat:V2DF + (vec_select:DF (match_dup 0) (parallel [(const_int 0)])) + (match_operand:DF 1 "register_operand" "")))] + "TARGET_SSE2 && reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + operands[0] = adjust_address (operands[0], DFmode, 8); +}) + +(define_insn "sse2_loadlpd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,x,x,m") + (vec_concat:V2DF + (match_operand:DF 2 "nonimmediate_operand" " m,m,x,0,0,x*fr") + (vec_select:DF + (match_operand:V2DF 1 "vector_move_operand" " C,0,0,x,o,0") + (parallel [(const_int 1)]))))] + "TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "@ + movsd\t{%2, %0|%0, %2} + movlpd\t{%2, %0|%0, %2} + movsd\t{%2, %0|%0, %2} + shufpd\t{$2, %2, %0|%0, %2, 2} + movhpd\t{%H1, %0|%0, %H1} + #" + [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,other") + (set_attr "mode" "DF,V1DF,V1DF,V2DF,V1DF,DF")]) + +(define_split + [(set (match_operand:V2DF 0 "memory_operand" "") + (vec_concat:V2DF + (match_operand:DF 1 "register_operand" "") + (vec_select:DF (match_dup 0) (parallel [(const_int 1)]))))] + "TARGET_SSE2 && reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + operands[0] = adjust_address (operands[0], DFmode, 8); +}) + +;; Not sure these two are ever used, but it doesn't hurt to have +;; them. -aoliva +(define_insn "*vec_extractv2df_1_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,x,o") + (parallel [(const_int 1)])))] + "!TARGET_SSE2 && TARGET_SSE + && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movhps\t{%1, %0|%0, %1} + movhlps\t{%1, %0|%0, %1} + movlps\t{%H1, %0|%0, %H1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "*vec_extractv2df_0_sse" + [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "x,x,m") + (parallel [(const_int 0)])))] + "!TARGET_SSE2 && TARGET_SSE + && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movlps\t{%1, %0|%0, %1} + movaps\t{%1, %0|%0, %1} + movlps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "sse2_movsd" + [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m,x,x,o") + (vec_merge:V2DF + (match_operand:V2DF 2 "nonimmediate_operand" " x,m,x,0,0,0") + (match_operand:V2DF 1 "nonimmediate_operand" " 0,0,0,x,o,x") + (const_int 1)))] + "TARGET_SSE2" + "@ + movsd\t{%2, %0|%0, %2} + movlpd\t{%2, %0|%0, %2} + movlpd\t{%2, %0|%0, %2} + shufpd\t{$2, %2, %0|%0, %2, 2} + movhps\t{%H1, %0|%0, %H1} + movhps\t{%1, %H0|%H0, %1}" + [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov") + (set_attr "mode" "DF,V1DF,V1DF,V2DF,V1DF,V1DF")]) + +(define_insn "*vec_dupv2df_sse3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_duplicate:V2DF + (match_operand:DF 1 "nonimmediate_operand" "xm")))] + "TARGET_SSE3" + "movddup\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog1") + (set_attr "mode" "DF")]) + +(define_insn "*vec_dupv2df" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_duplicate:V2DF + (match_operand:DF 1 "register_operand" "0")))] + "TARGET_SSE2" + "unpcklpd\t%0, %0" + [(set_attr "type" "sselog1") + (set_attr "mode" "V4SF")]) + +(define_insn "*vec_concatv2df_sse3" + [(set (match_operand:V2DF 0 "register_operand" "=x") + (vec_concat:V2DF + (match_operand:DF 1 "nonimmediate_operand" "xm") + (match_dup 1)))] + "TARGET_SSE3" + "movddup\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog1") + (set_attr "mode" "DF")]) + +(define_insn "*vec_concatv2df" + [(set (match_operand:V2DF 0 "register_operand" "=Y,Y,Y,x,x") + (vec_concat:V2DF + (match_operand:DF 1 "nonimmediate_operand" " 0,0,m,0,0") + (match_operand:DF 2 "vector_move_operand" " Y,m,C,x,m")))] + "TARGET_SSE" + "@ + unpcklpd\t{%2, %0|%0, %2} + movhpd\t{%2, %0|%0, %2} + movsd\t{%1, %0|%0, %1} + movlhps\t{%2, %0|%0, %2} + movhps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog,ssemov,ssemov,ssemov,ssemov") + (set_attr "mode" "V2DF,V1DF,DF,V4SF,V2SF")]) + +(define_expand "vec_setv2df" + [(match_operand:V2DF 0 "register_operand" "") + (match_operand:DF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv2df" + [(match_operand:DF 0 "register_operand" "") + (match_operand:V2DF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv2df" + [(match_operand:V2DF 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral arithmetic +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "neg2" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (minus:SSEMODEI + (match_dup 2) + (match_operand:SSEMODEI 1 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "operands[2] = force_reg (mode, CONST0_RTX (mode));") + +(define_expand "add3" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (plus:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (PLUS, mode, operands);") + +(define_insn "*add3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (plus:SSEMODEI + (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, mode, operands)" + "padd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse2_ssadd3" + [(set (match_operand:SSEMODE12 0 "register_operand" "=x") + (ss_plus:SSEMODE12 + (match_operand:SSEMODE12 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (SS_PLUS, mode, operands)" + "padds\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse2_usadd3" + [(set (match_operand:SSEMODE12 0 "register_operand" "=x") + (us_plus:SSEMODE12 + (match_operand:SSEMODE12 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (US_PLUS, mode, operands)" + "paddus\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "sub3" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (minus:SSEMODEI (match_operand:SSEMODEI 1 "register_operand" "") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (MINUS, mode, operands);") + +(define_insn "*sub3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (minus:SSEMODEI + (match_operand:SSEMODEI 1 "register_operand" "0") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "psub\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse2_sssub3" + [(set (match_operand:SSEMODE12 0 "register_operand" "=x") + (ss_minus:SSEMODE12 + (match_operand:SSEMODE12 1 "register_operand" "0") + (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "psubs\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse2_ussub3" + [(set (match_operand:SSEMODE12 0 "register_operand" "=x") + (us_minus:SSEMODE12 + (match_operand:SSEMODE12 1 "register_operand" "0") + (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "psubus\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "mulv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "") + (mult:V16QI (match_operand:V16QI 1 "register_operand" "") + (match_operand:V16QI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t[12], op0; + int i; + + for (i = 0; i < 12; ++i) + t[i] = gen_reg_rtx (V16QImode); + + /* Unpack data such that we've got a source byte in each low byte of + each word. We don't care what goes into the high byte of each word. + Rather than trying to get zero in there, most convenient is to let + it be a copy of the low byte. */ + emit_insn (gen_sse2_punpckhbw (t[0], operands[1], operands[1])); + emit_insn (gen_sse2_punpckhbw (t[1], operands[2], operands[2])); + emit_insn (gen_sse2_punpcklbw (t[2], operands[1], operands[1])); + emit_insn (gen_sse2_punpcklbw (t[3], operands[2], operands[2])); + + /* Multiply words. The end-of-line annotations here give a picture of what + the output of that instruction looks like. Dot means don't care; the + letters are the bytes of the result with A being the most significant. */ + emit_insn (gen_mulv8hi3 (gen_lowpart (V8HImode, t[4]), /* .A.B.C.D.E.F.G.H */ + gen_lowpart (V8HImode, t[0]), + gen_lowpart (V8HImode, t[1]))); + emit_insn (gen_mulv8hi3 (gen_lowpart (V8HImode, t[5]), /* .I.J.K.L.M.N.O.P */ + gen_lowpart (V8HImode, t[2]), + gen_lowpart (V8HImode, t[3]))); + + /* Extract the relevant bytes and merge them back together. */ + emit_insn (gen_sse2_punpckhbw (t[6], t[5], t[4])); /* ..AI..BJ..CK..DL */ + emit_insn (gen_sse2_punpcklbw (t[7], t[5], t[4])); /* ..EM..FN..GO..HP */ + emit_insn (gen_sse2_punpckhbw (t[8], t[7], t[6])); /* ....AEIM....BFJN */ + emit_insn (gen_sse2_punpcklbw (t[9], t[7], t[6])); /* ....CGKO....DHLP */ + emit_insn (gen_sse2_punpckhbw (t[10], t[9], t[8])); /* ........ACEGIKMO */ + emit_insn (gen_sse2_punpcklbw (t[11], t[9], t[8])); /* ........BDFHJLNP */ + + op0 = operands[0]; + emit_insn (gen_sse2_punpcklbw (op0, t[11], t[10])); /* ABCDEFGHIJKLMNOP */ + DONE; +}) + +(define_expand "mulv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "") + (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:V8HI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);") + +(define_insn "*mulv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" + "pmullw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "TI")]) + +(define_insn "sse2_smulv8hi3_highpart" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (truncate:V8HI + (lshiftrt:V8SI + (mult:V8SI + (sign_extend:V8SI + (match_operand:V8HI 1 "nonimmediate_operand" "%0")) + (sign_extend:V8SI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) + (const_int 16))))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" + "pmulhw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "TI")]) + +(define_insn "sse2_umulv8hi3_highpart" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (truncate:V8HI + (lshiftrt:V8SI + (mult:V8SI + (zero_extend:V8SI + (match_operand:V8HI 1 "nonimmediate_operand" "%0")) + (zero_extend:V8SI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) + (const_int 16))))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" + "pmulhuw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "TI")]) + +(define_insn "sse2_umulv2siv2di3" + [(set (match_operand:V2DI 0 "register_operand" "=x") + (mult:V2DI + (zero_extend:V2DI + (vec_select:V2SI + (match_operand:V4SI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0) (const_int 2)]))) + (zero_extend:V2DI + (vec_select:V2SI + (match_operand:V4SI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0) (const_int 2)])))))] + "TARGET_SSE2 && ix86_binary_operator_ok (MULT, V8HImode, operands)" + "pmuludq\t{%2, %0|%0, %2}" + [(set_attr "type" "sseimul") + (set_attr "mode" "TI")]) + +(define_insn "sse2_pmaddwd" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (plus:V4SI + (mult:V4SI + (sign_extend:V4SI + (vec_select:V4HI + (match_operand:V8HI 1 "nonimmediate_operand" "%0") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6)]))) + (sign_extend:V4SI + (vec_select:V4HI + (match_operand:V8HI 2 "nonimmediate_operand" "xm") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6)])))) + (mult:V4SI + (sign_extend:V4SI + (vec_select:V4HI (match_dup 1) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7)]))) + (sign_extend:V4SI + (vec_select:V4HI (match_dup 2) + (parallel [(const_int 1) + (const_int 3) + (const_int 5) + (const_int 7)]))))))] + "TARGET_SSE2" + "pmaddwd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "mulv4si3" + [(set (match_operand:V4SI 0 "register_operand" "") + (mult:V4SI (match_operand:V4SI 1 "register_operand" "") + (match_operand:V4SI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t1, t2, t3, t4, t5, t6, thirtytwo; + rtx op0, op1, op2; + + op0 = operands[0]; + op1 = operands[1]; + op2 = operands[2]; + t1 = gen_reg_rtx (V4SImode); + t2 = gen_reg_rtx (V4SImode); + t3 = gen_reg_rtx (V4SImode); + t4 = gen_reg_rtx (V4SImode); + t5 = gen_reg_rtx (V4SImode); + t6 = gen_reg_rtx (V4SImode); + thirtytwo = GEN_INT (32); + + /* Multiply elements 2 and 0. */ + emit_insn (gen_sse2_umulv2siv2di3 (gen_lowpart (V2DImode, t1), op1, op2)); + + /* Shift both input vectors down one element, so that elements 3 and 1 + are now in the slots for elements 2 and 0. For K8, at least, this is + faster than using a shuffle. */ + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t2), + gen_lowpart (TImode, op1), thirtytwo)); + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t3), + gen_lowpart (TImode, op2), thirtytwo)); + + /* Multiply elements 3 and 1. */ + emit_insn (gen_sse2_umulv2siv2di3 (gen_lowpart (V2DImode, t4), t2, t3)); + + /* Move the results in element 2 down to element 1; we don't care what + goes in elements 2 and 3. */ + emit_insn (gen_sse2_pshufd_1 (t5, t1, const0_rtx, const2_rtx, + const0_rtx, const0_rtx)); + emit_insn (gen_sse2_pshufd_1 (t6, t4, const0_rtx, const2_rtx, + const0_rtx, const0_rtx)); + + /* Merge the parts back together. */ + emit_insn (gen_sse2_punpckldq (op0, t5, t6)); + DONE; +}) + +(define_expand "mulv2di3" + [(set (match_operand:V2DI 0 "register_operand" "") + (mult:V2DI (match_operand:V2DI 1 "register_operand" "") + (match_operand:V2DI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t1, t2, t3, t4, t5, t6, thirtytwo; + rtx op0, op1, op2; + + op0 = operands[0]; + op1 = operands[1]; + op2 = operands[2]; + t1 = gen_reg_rtx (V2DImode); + t2 = gen_reg_rtx (V2DImode); + t3 = gen_reg_rtx (V2DImode); + t4 = gen_reg_rtx (V2DImode); + t5 = gen_reg_rtx (V2DImode); + t6 = gen_reg_rtx (V2DImode); + thirtytwo = GEN_INT (32); + + /* Multiply low parts. */ + emit_insn (gen_sse2_umulv2siv2di3 (t1, gen_lowpart (V4SImode, op1), + gen_lowpart (V4SImode, op2))); + + /* Shift input vectors left 32 bits so we can multiply high parts. */ + emit_insn (gen_lshrv2di3 (t2, op1, thirtytwo)); + emit_insn (gen_lshrv2di3 (t3, op2, thirtytwo)); + + /* Multiply high parts by low parts. */ + emit_insn (gen_sse2_umulv2siv2di3 (t4, gen_lowpart (V4SImode, op1), + gen_lowpart (V4SImode, t3))); + emit_insn (gen_sse2_umulv2siv2di3 (t5, gen_lowpart (V4SImode, op2), + gen_lowpart (V4SImode, t2))); + + /* Shift them back. */ + emit_insn (gen_ashlv2di3 (t4, t4, thirtytwo)); + emit_insn (gen_ashlv2di3 (t5, t5, thirtytwo)); + + /* Add the three parts together. */ + emit_insn (gen_addv2di3 (t6, t1, t4)); + emit_insn (gen_addv2di3 (op0, t6, t5)); + DONE; +}) + +(define_expand "sdot_prodv8hi" + [(match_operand:V4SI 0 "register_operand" "") + (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:V8HI 2 "nonimmediate_operand" "") + (match_operand:V4SI 3 "register_operand" "")] + "TARGET_SSE2" +{ + rtx t = gen_reg_rtx (V4SImode); + emit_insn (gen_sse2_pmaddwd (t, operands[1], operands[2])); + emit_insn (gen_addv4si3 (operands[0], operands[3], t)); + DONE; +}) + +(define_expand "udot_prodv4si" + [(match_operand:V2DI 0 "register_operand" "") + (match_operand:V4SI 1 "register_operand" "") + (match_operand:V4SI 2 "register_operand" "") + (match_operand:V2DI 3 "register_operand" "")] + "TARGET_SSE2" +{ + rtx t1, t2, t3, t4; + + t1 = gen_reg_rtx (V2DImode); + emit_insn (gen_sse2_umulv2siv2di3 (t1, operands[1], operands[2])); + emit_insn (gen_addv2di3 (t1, t1, operands[3])); + + t2 = gen_reg_rtx (V4SImode); + t3 = gen_reg_rtx (V4SImode); + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t2), + gen_lowpart (TImode, operands[1]), + GEN_INT (32))); + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t3), + gen_lowpart (TImode, operands[2]), + GEN_INT (32))); + + t4 = gen_reg_rtx (V2DImode); + emit_insn (gen_sse2_umulv2siv2di3 (t4, t2, t3)); + + emit_insn (gen_addv2di3 (operands[0], t1, t4)); + DONE; +}) + +(define_insn "ashr3" + [(set (match_operand:SSEMODE24 0 "register_operand" "=x") + (ashiftrt:SSEMODE24 + (match_operand:SSEMODE24 1 "register_operand" "0") + (match_operand:TI 2 "nonmemory_operand" "xn")))] + "TARGET_SSE2" + "psra\t{%2, %0|%0, %2}" + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_insn "lshr3" + [(set (match_operand:SSEMODE248 0 "register_operand" "=x") + (lshiftrt:SSEMODE248 + (match_operand:SSEMODE248 1 "register_operand" "0") + (match_operand:TI 2 "nonmemory_operand" "xn")))] + "TARGET_SSE2" + "psrl\t{%2, %0|%0, %2}" + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_insn "ashl3" + [(set (match_operand:SSEMODE248 0 "register_operand" "=x") + (ashift:SSEMODE248 + (match_operand:SSEMODE248 1 "register_operand" "0") + (match_operand:TI 2 "nonmemory_operand" "xn")))] + "TARGET_SSE2" + "psll\t{%2, %0|%0, %2}" + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_insn "sse2_ashlti3" + [(set (match_operand:TI 0 "register_operand" "=x") + (ashift:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))] + "TARGET_SSE2" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) / 8); + return "pslldq\t{%2, %0|%0, %2}"; +} + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_expand "vec_shl_" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (ashift:TI (match_operand:SSEMODEI 1 "register_operand" "") + (match_operand:SI 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (!const_0_to_255_mul_8_operand (operands[2], SImode)) + FAIL; + operands[0] = gen_lowpart (TImode, operands[0]); + operands[1] = gen_lowpart (TImode, operands[1]); +}) + +(define_insn "sse2_lshrti3" + [(set (match_operand:TI 0 "register_operand" "=x") + (lshiftrt:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))] + "TARGET_SSE2" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) / 8); + return "psrldq\t{%2, %0|%0, %2}"; +} + [(set_attr "type" "sseishft") + (set_attr "mode" "TI")]) + +(define_expand "vec_shr_" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (lshiftrt:TI (match_operand:SSEMODEI 1 "register_operand" "") + (match_operand:SI 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (!const_0_to_255_mul_8_operand (operands[2], SImode)) + FAIL; + operands[0] = gen_lowpart (TImode, operands[0]); + operands[1] = gen_lowpart (TImode, operands[1]); +}) + +(define_expand "umaxv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "") + (umax:V16QI (match_operand:V16QI 1 "nonimmediate_operand" "") + (match_operand:V16QI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (UMAX, V16QImode, operands);") + +(define_insn "*umaxv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (umax:V16QI (match_operand:V16QI 1 "nonimmediate_operand" "%0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (UMAX, V16QImode, operands)" + "pmaxub\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "smaxv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "") + (smax:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:V8HI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (SMAX, V8HImode, operands);") + +(define_insn "*smaxv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (smax:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (SMAX, V8HImode, operands)" + "pmaxsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "umaxv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (us_minus:V8HI (match_operand:V8HI 1 "register_operand" "0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) + (set (match_dup 3) + (plus:V8HI (match_dup 0) (match_dup 2)))] + "TARGET_SSE2" +{ + operands[3] = operands[0]; + if (rtx_equal_p (operands[0], operands[2])) + operands[0] = gen_reg_rtx (V8HImode); +}) + +(define_expand "smax3" + [(set (match_operand:SSEMODE14 0 "register_operand" "") + (smax:SSEMODE14 (match_operand:SSEMODE14 1 "register_operand" "") + (match_operand:SSEMODE14 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[1]; + xops[2] = operands[2]; + xops[3] = gen_rtx_GT (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; +}) + +(define_expand "umaxv4si3" + [(set (match_operand:V4SI 0 "register_operand" "") + (umax:V4SI (match_operand:V4SI 1 "register_operand" "") + (match_operand:V4SI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[1]; + xops[2] = operands[2]; + xops[3] = gen_rtx_GTU (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; +}) + +(define_expand "uminv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "") + (umin:V16QI (match_operand:V16QI 1 "nonimmediate_operand" "") + (match_operand:V16QI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (UMIN, V16QImode, operands);") + +(define_insn "*uminv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (umin:V16QI (match_operand:V16QI 1 "nonimmediate_operand" "%0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (UMIN, V16QImode, operands)" + "pminub\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "sminv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "") + (smin:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:V8HI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (SMIN, V8HImode, operands);") + +(define_insn "*sminv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (smin:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (SMIN, V8HImode, operands)" + "pminsw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_expand "smin3" + [(set (match_operand:SSEMODE14 0 "register_operand" "") + (smin:SSEMODE14 (match_operand:SSEMODE14 1 "register_operand" "") + (match_operand:SSEMODE14 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[2]; + xops[2] = operands[1]; + xops[3] = gen_rtx_GT (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; +}) + +(define_expand "umin3" + [(set (match_operand:SSEMODE24 0 "register_operand" "") + (umin:SSEMODE24 (match_operand:SSEMODE24 1 "register_operand" "") + (match_operand:SSEMODE24 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx xops[6]; + bool ok; + + xops[0] = operands[0]; + xops[1] = operands[2]; + xops[2] = operands[1]; + xops[3] = gen_rtx_GTU (VOIDmode, operands[1], operands[2]); + xops[4] = operands[1]; + xops[5] = operands[2]; + ok = ix86_expand_int_vcond (xops); + gcc_assert (ok); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral comparisons +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_eq3" + [(set (match_operand:SSEMODE124 0 "register_operand" "=x") + (eq:SSEMODE124 + (match_operand:SSEMODE124 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (EQ, mode, operands)" + "pcmpeq\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "TI")]) + +(define_insn "sse2_gt3" + [(set (match_operand:SSEMODE124 0 "register_operand" "=x") + (gt:SSEMODE124 + (match_operand:SSEMODE124 1 "register_operand" "0") + (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "pcmpgt\t{%2, %0|%0, %2}" + [(set_attr "type" "ssecmp") + (set_attr "mode" "TI")]) + +(define_expand "vcond" + [(set (match_operand:SSEMODE124 0 "register_operand" "") + (if_then_else:SSEMODE124 + (match_operator 3 "" + [(match_operand:SSEMODE124 4 "nonimmediate_operand" "") + (match_operand:SSEMODE124 5 "nonimmediate_operand" "")]) + (match_operand:SSEMODE124 1 "general_operand" "") + (match_operand:SSEMODE124 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_int_vcond (operands)) + DONE; + else + FAIL; +}) + +(define_expand "vcondu" + [(set (match_operand:SSEMODE124 0 "register_operand" "") + (if_then_else:SSEMODE124 + (match_operator 3 "" + [(match_operand:SSEMODE124 4 "nonimmediate_operand" "") + (match_operand:SSEMODE124 5 "nonimmediate_operand" "")]) + (match_operand:SSEMODE124 1 "general_operand" "") + (match_operand:SSEMODE124 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_int_vcond (operands)) + DONE; + else + FAIL; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral logical operations +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_expand "one_cmpl2" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (xor:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "") + (match_dup 2)))] + "TARGET_SSE2" +{ + int i, n = GET_MODE_NUNITS (mode); + rtvec v = rtvec_alloc (n); + + for (i = 0; i < n; ++i) + RTVEC_ELT (v, i) = constm1_rtx; + + operands[2] = force_reg (mode, gen_rtx_CONST_VECTOR (mode, v)); +}) + +(define_expand "and3" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (and:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (AND, mode, operands);") + +(define_insn "*and3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (and:SSEMODEI + (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (AND, mode, operands)" + "pand\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_nand3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (and:SSEMODEI + (not:SSEMODEI (match_operand:SSEMODEI 1 "register_operand" "0")) + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2" + "pandn\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "ior3" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (ior:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (IOR, mode, operands);") + +(define_insn "*ior3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (ior:SSEMODEI + (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (IOR, mode, operands)" + "por\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "xor3" + [(set (match_operand:SSEMODEI 0 "register_operand" "") + (xor:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))] + "TARGET_SSE2" + "ix86_fixup_binary_operands_no_copy (XOR, mode, operands);") + +(define_insn "*xor3" + [(set (match_operand:SSEMODEI 0 "register_operand" "=x") + (xor:SSEMODEI + (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0") + (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))] + "TARGET_SSE2 && ix86_binary_operator_ok (XOR, mode, operands)" + "pxor\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Parallel integral element swizzling +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_packsswb" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (vec_concat:V16QI + (ss_truncate:V8QI + (match_operand:V8HI 1 "register_operand" "0")) + (ss_truncate:V8QI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))))] + "TARGET_SSE2" + "packsswb\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_packssdw" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_concat:V8HI + (ss_truncate:V4HI + (match_operand:V4SI 1 "register_operand" "0")) + (ss_truncate:V4HI + (match_operand:V4SI 2 "nonimmediate_operand" "xm"))))] + "TARGET_SSE2" + "packssdw\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_packuswb" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (vec_concat:V16QI + (us_truncate:V8QI + (match_operand:V8HI 1 "register_operand" "0")) + (us_truncate:V8QI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))))] + "TARGET_SSE2" + "packuswb\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpckhbw" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (vec_select:V16QI + (vec_concat:V32QI + (match_operand:V16QI 1 "register_operand" "0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 8) (const_int 24) + (const_int 9) (const_int 25) + (const_int 10) (const_int 26) + (const_int 11) (const_int 27) + (const_int 12) (const_int 28) + (const_int 13) (const_int 29) + (const_int 14) (const_int 30) + (const_int 15) (const_int 31)])))] + "TARGET_SSE2" + "punpckhbw\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpcklbw" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (vec_select:V16QI + (vec_concat:V32QI + (match_operand:V16QI 1 "register_operand" "0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) (const_int 16) + (const_int 1) (const_int 17) + (const_int 2) (const_int 18) + (const_int 3) (const_int 19) + (const_int 4) (const_int 20) + (const_int 5) (const_int 21) + (const_int 6) (const_int 22) + (const_int 7) (const_int 23)])))] + "TARGET_SSE2" + "punpcklbw\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpckhwd" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_select:V8HI + (vec_concat:V16HI + (match_operand:V8HI 1 "register_operand" "0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 4) (const_int 12) + (const_int 5) (const_int 13) + (const_int 6) (const_int 14) + (const_int 7) (const_int 15)])))] + "TARGET_SSE2" + "punpckhwd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpcklwd" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_select:V8HI + (vec_concat:V16HI + (match_operand:V8HI 1 "register_operand" "0") + (match_operand:V8HI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) (const_int 8) + (const_int 1) (const_int 9) + (const_int 2) (const_int 10) + (const_int 3) (const_int 11)])))] + "TARGET_SSE2" + "punpcklwd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpckhdq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_select:V4SI + (vec_concat:V8SI + (match_operand:V4SI 1 "register_operand" "0") + (match_operand:V4SI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 2) (const_int 6) + (const_int 3) (const_int 7)])))] + "TARGET_SSE2" + "punpckhdq\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpckldq" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_select:V4SI + (vec_concat:V8SI + (match_operand:V4SI 1 "register_operand" "0") + (match_operand:V4SI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) (const_int 4) + (const_int 1) (const_int 5)])))] + "TARGET_SSE2" + "punpckldq\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpckhqdq" + [(set (match_operand:V2DI 0 "register_operand" "=x") + (vec_select:V2DI + (vec_concat:V4DI + (match_operand:V2DI 1 "register_operand" "0") + (match_operand:V2DI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 1) + (const_int 3)])))] + "TARGET_SSE2" + "punpckhqdq\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_punpcklqdq" + [(set (match_operand:V2DI 0 "register_operand" "=x") + (vec_select:V2DI + (vec_concat:V4DI + (match_operand:V2DI 1 "register_operand" "0") + (match_operand:V2DI 2 "nonimmediate_operand" "xm")) + (parallel [(const_int 0) + (const_int 2)])))] + "TARGET_SSE2" + "punpcklqdq\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "sse2_pinsrw" + [(set (match_operand:V8HI 0 "register_operand" "") + (vec_merge:V8HI + (vec_duplicate:V8HI + (match_operand:SI 2 "nonimmediate_operand" "")) + (match_operand:V8HI 1 "register_operand" "") + (match_operand:SI 3 "const_0_to_7_operand" "")))] + "TARGET_SSE2" +{ + operands[2] = gen_lowpart (HImode, operands[2]); + operands[3] = GEN_INT ((1 << INTVAL (operands[3]))); +}) + +(define_insn "*sse2_pinsrw" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_merge:V8HI + (vec_duplicate:V8HI + (match_operand:HI 2 "nonimmediate_operand" "rm")) + (match_operand:V8HI 1 "register_operand" "0") + (match_operand:SI 3 "const_pow2_1_to_128_operand" "n")))] + "TARGET_SSE2" +{ + operands[3] = GEN_INT (exact_log2 (INTVAL (operands[3]))); + return "pinsrw\t{%3, %k2, %0|%0, %k2, %3}"; +} + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_insn "sse2_pextrw" + [(set (match_operand:SI 0 "register_operand" "=r") + (zero_extend:SI + (vec_select:HI + (match_operand:V8HI 1 "register_operand" "x") + (parallel [(match_operand:SI 2 "const_0_to_7_operand" "n")]))))] + "TARGET_SSE2" + "pextrw\t{%2, %1, %0|%0, %1, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "sse2_pshufd" + [(match_operand:V4SI 0 "register_operand" "") + (match_operand:V4SI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "const_int_operand" "")] + "TARGET_SSE2" +{ + int mask = INTVAL (operands[2]); + emit_insn (gen_sse2_pshufd_1 (operands[0], operands[1], + GEN_INT ((mask >> 0) & 3), + GEN_INT ((mask >> 2) & 3), + GEN_INT ((mask >> 4) & 3), + GEN_INT ((mask >> 6) & 3))); + DONE; +}) + +(define_insn "sse2_pshufd_1" + [(set (match_operand:V4SI 0 "register_operand" "=x") + (vec_select:V4SI + (match_operand:V4SI 1 "nonimmediate_operand" "xm") + (parallel [(match_operand 2 "const_0_to_3_operand" "") + (match_operand 3 "const_0_to_3_operand" "") + (match_operand 4 "const_0_to_3_operand" "") + (match_operand 5 "const_0_to_3_operand" "")])))] + "TARGET_SSE2" +{ + int mask = 0; + mask |= INTVAL (operands[2]) << 0; + mask |= INTVAL (operands[3]) << 2; + mask |= INTVAL (operands[4]) << 4; + mask |= INTVAL (operands[5]) << 6; + operands[2] = GEN_INT (mask); + + return "pshufd\t{%2, %1, %0|%0, %1, %2}"; +} + [(set_attr "type" "sselog1") + (set_attr "mode" "TI")]) + +(define_expand "sse2_pshuflw" + [(match_operand:V8HI 0 "register_operand" "") + (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "const_int_operand" "")] + "TARGET_SSE2" +{ + int mask = INTVAL (operands[2]); + emit_insn (gen_sse2_pshuflw_1 (operands[0], operands[1], + GEN_INT ((mask >> 0) & 3), + GEN_INT ((mask >> 2) & 3), + GEN_INT ((mask >> 4) & 3), + GEN_INT ((mask >> 6) & 3))); + DONE; +}) + +(define_insn "sse2_pshuflw_1" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_select:V8HI + (match_operand:V8HI 1 "nonimmediate_operand" "xm") + (parallel [(match_operand 2 "const_0_to_3_operand" "") + (match_operand 3 "const_0_to_3_operand" "") + (match_operand 4 "const_0_to_3_operand" "") + (match_operand 5 "const_0_to_3_operand" "") + (const_int 4) + (const_int 5) + (const_int 6) + (const_int 7)])))] + "TARGET_SSE2" +{ + int mask = 0; + mask |= INTVAL (operands[2]) << 0; + mask |= INTVAL (operands[3]) << 2; + mask |= INTVAL (operands[4]) << 4; + mask |= INTVAL (operands[5]) << 6; + operands[2] = GEN_INT (mask); + + return "pshuflw\t{%2, %1, %0|%0, %1, %2}"; +} + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "sse2_pshufhw" + [(match_operand:V8HI 0 "register_operand" "") + (match_operand:V8HI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "const_int_operand" "")] + "TARGET_SSE2" +{ + int mask = INTVAL (operands[2]); + emit_insn (gen_sse2_pshufhw_1 (operands[0], operands[1], + GEN_INT (((mask >> 0) & 3) + 4), + GEN_INT (((mask >> 2) & 3) + 4), + GEN_INT (((mask >> 4) & 3) + 4), + GEN_INT (((mask >> 6) & 3) + 4))); + DONE; +}) + +(define_insn "sse2_pshufhw_1" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (vec_select:V8HI + (match_operand:V8HI 1 "nonimmediate_operand" "xm") + (parallel [(const_int 0) + (const_int 1) + (const_int 2) + (const_int 3) + (match_operand 2 "const_4_to_7_operand" "") + (match_operand 3 "const_4_to_7_operand" "") + (match_operand 4 "const_4_to_7_operand" "") + (match_operand 5 "const_4_to_7_operand" "")])))] + "TARGET_SSE2" +{ + int mask = 0; + mask |= (INTVAL (operands[2]) - 4) << 0; + mask |= (INTVAL (operands[3]) - 4) << 2; + mask |= (INTVAL (operands[4]) - 4) << 4; + mask |= (INTVAL (operands[5]) - 4) << 6; + operands[2] = GEN_INT (mask); + + return "pshufhw\t{%2, %1, %0|%0, %1, %2}"; +} + [(set_attr "type" "sselog") + (set_attr "mode" "TI")]) + +(define_expand "sse2_loadd" + [(set (match_operand:V4SI 0 "register_operand" "") + (vec_merge:V4SI + (vec_duplicate:V4SI + (match_operand:SI 1 "nonimmediate_operand" "")) + (match_dup 2) + (const_int 1)))] + "TARGET_SSE" + "operands[2] = CONST0_RTX (V4SImode);") + +(define_insn "sse2_loadld" + [(set (match_operand:V4SI 0 "register_operand" "=Y,x,x") + (vec_merge:V4SI + (vec_duplicate:V4SI + (match_operand:SI 2 "nonimmediate_operand" "mr,m,x")) + (match_operand:V4SI 1 "reg_or_0_operand" " C,C,0") + (const_int 1)))] + "TARGET_SSE" + "@ + movd\t{%2, %0|%0, %2} + movss\t{%2, %0|%0, %2} + movss\t{%2, %0|%0, %2}" + [(set_attr "type" "ssemov") + (set_attr "mode" "TI,V4SF,SF")]) + +;; ??? The hardware supports more, but TARGET_INTER_UNIT_MOVES must +;; be taken into account, and movdi isn't fully populated even without. +(define_insn_and_split "sse2_stored" + [(set (match_operand:SI 0 "nonimmediate_operand" "=mx") + (vec_select:SI + (match_operand:V4SI 1 "register_operand" "x") + (parallel [(const_int 0)])))] + "TARGET_SSE" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + operands[1] = gen_rtx_REG (SImode, REGNO (operands[1])); +}) + +(define_expand "sse_storeq" + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (vec_select:DI + (match_operand:V2DI 1 "register_operand" "") + (parallel [(const_int 0)])))] + "TARGET_SSE" + "") + +;; ??? The hardware supports more, but TARGET_INTER_UNIT_MOVES must +;; be taken into account, and movdi isn't fully populated even without. +(define_insn "*sse2_storeq" + [(set (match_operand:DI 0 "nonimmediate_operand" "=mx") + (vec_select:DI + (match_operand:V2DI 1 "register_operand" "x") + (parallel [(const_int 0)])))] + "TARGET_SSE" + "#") + +(define_split + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (vec_select:DI + (match_operand:V2DI 1 "register_operand" "") + (parallel [(const_int 0)])))] + "TARGET_SSE && reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + operands[1] = gen_rtx_REG (DImode, REGNO (operands[1])); +}) + +(define_insn "*vec_extractv2di_1_sse2" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DI + (match_operand:V2DI 1 "nonimmediate_operand" "x,0,o") + (parallel [(const_int 1)])))] + "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movhps\t{%1, %0|%0, %1} + psrldq\t{$4, %0|%0, 4} + movq\t{%H1, %0|%0, %H1}" + [(set_attr "type" "ssemov,sseishft,ssemov") + (set_attr "mode" "V2SF,TI,TI")]) + +;; Not sure this is ever used, but it doesn't hurt to have it. -aoliva +(define_insn "*vec_extractv2di_1_sse" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x") + (vec_select:DI + (match_operand:V2DI 1 "nonimmediate_operand" "x,x,o") + (parallel [(const_int 1)])))] + "!TARGET_SSE2 && TARGET_SSE + && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "@ + movhps\t{%1, %0|%0, %1} + movhlps\t{%1, %0|%0, %1} + movlps\t{%H1, %0|%0, %H1}" + [(set_attr "type" "ssemov") + (set_attr "mode" "V2SF,V4SF,V2SF")]) + +(define_insn "*vec_dupv4si" + [(set (match_operand:V4SI 0 "register_operand" "=Y,x") + (vec_duplicate:V4SI + (match_operand:SI 1 "register_operand" " Y,0")))] + "TARGET_SSE" + "@ + pshufd\t{$0, %1, %0|%0, %1, 0} + shufps\t{$0, %0, %0|%0, %0, 0}" + [(set_attr "type" "sselog1") + (set_attr "mode" "TI,V4SF")]) + +(define_insn "*vec_dupv2di" + [(set (match_operand:V2DI 0 "register_operand" "=Y,x") + (vec_duplicate:V2DI + (match_operand:DI 1 "register_operand" " 0,0")))] + "TARGET_SSE" + "@ + punpcklqdq\t%0, %0 + movlhps\t%0, %0" + [(set_attr "type" "sselog1,ssemov") + (set_attr "mode" "TI,V4SF")]) + +;; ??? In theory we can match memory for the MMX alternative, but allowing +;; nonimmediate_operand for operand 2 and *not* allowing memory for the SSE +;; alternatives pretty much forces the MMX alternative to be chosen. +(define_insn "*sse2_concatv2si" + [(set (match_operand:V2SI 0 "register_operand" "=Y, Y,*y,*y") + (vec_concat:V2SI + (match_operand:SI 1 "nonimmediate_operand" " 0,rm, 0,rm") + (match_operand:SI 2 "reg_or_0_operand" " Y, C,*y, C")))] + "TARGET_SSE2" + "@ + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1} + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog,ssemov,mmxcvt,mmxmov") + (set_attr "mode" "TI,TI,DI,DI")]) + +(define_insn "*sse1_concatv2si" + [(set (match_operand:V2SI 0 "register_operand" "=x,x,*y,*y") + (vec_concat:V2SI + (match_operand:SI 1 "nonimmediate_operand" " 0,m, 0,*rm") + (match_operand:SI 2 "reg_or_0_operand" " x,C,*y,C")))] + "TARGET_SSE" + "@ + unpcklps\t{%2, %0|%0, %2} + movss\t{%1, %0|%0, %1} + punpckldq\t{%2, %0|%0, %2} + movd\t{%1, %0|%0, %1}" + [(set_attr "type" "sselog,ssemov,mmxcvt,mmxmov") + (set_attr "mode" "V4SF,V4SF,DI,DI")]) + +(define_insn "*vec_concatv4si_1" + [(set (match_operand:V4SI 0 "register_operand" "=Y,x,x") + (vec_concat:V4SI + (match_operand:V2SI 1 "register_operand" " 0,0,0") + (match_operand:V2SI 2 "nonimmediate_operand" " Y,x,m")))] + "TARGET_SSE" + "@ + punpcklqdq\t{%2, %0|%0, %2} + movlhps\t{%2, %0|%0, %2} + movhps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog,ssemov,ssemov") + (set_attr "mode" "TI,V4SF,V2SF")]) + +(define_insn "*vec_concatv2di" + [(set (match_operand:V2DI 0 "register_operand" "=Y,?Y,Y,x,x,x") + (vec_concat:V2DI + (match_operand:DI 1 "nonimmediate_operand" " m,*y,0,0,0,m") + (match_operand:DI 2 "vector_move_operand" " C, C,Y,x,m,0")))] + "TARGET_SSE" + "@ + movq\t{%1, %0|%0, %1} + movq2dq\t{%1, %0|%0, %1} + punpcklqdq\t{%2, %0|%0, %2} + movlhps\t{%2, %0|%0, %2} + movhps\t{%2, %0|%0, %2} + movlps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssemov,ssemov,sselog,ssemov,ssemov,ssemov") + (set_attr "mode" "TI,TI,TI,V4SF,V2SF,V2SF")]) + +(define_expand "vec_setv2di" + [(match_operand:V2DI 0 "register_operand" "") + (match_operand:DI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv2di" + [(match_operand:DI 0 "register_operand" "") + (match_operand:V2DI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv2di" + [(match_operand:V2DI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv4si" + [(match_operand:V4SI 0 "register_operand" "") + (match_operand:SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv4si" + [(match_operand:SI 0 "register_operand" "") + (match_operand:V4SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv4si" + [(match_operand:V4SI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv8hi" + [(match_operand:V8HI 0 "register_operand" "") + (match_operand:HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv8hi" + [(match_operand:HI 0 "register_operand" "") + (match_operand:V8HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv8hi" + [(match_operand:V8HI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv16qi" + [(match_operand:V16QI 0 "register_operand" "") + (match_operand:QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_set (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv16qi" + [(match_operand:QI 0 "register_operand" "") + (match_operand:V16QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_SSE" +{ + ix86_expand_vector_extract (false, operands[0], operands[1], + INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_initv16qi" + [(match_operand:V16QI 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_SSE" +{ + ix86_expand_vector_init (false, operands[0], operands[1]); + DONE; +}) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Miscellaneous +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define_insn "sse2_uavgv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "=x") + (truncate:V16QI + (lshiftrt:V16HI + (plus:V16HI + (plus:V16HI + (zero_extend:V16HI + (match_operand:V16QI 1 "nonimmediate_operand" "%0")) + (zero_extend:V16HI + (match_operand:V16QI 2 "nonimmediate_operand" "xm"))) + (const_vector:V16QI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, V16QImode, operands)" + "pavgb\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse2_uavgv8hi3" + [(set (match_operand:V8HI 0 "register_operand" "=x") + (truncate:V8HI + (lshiftrt:V8SI + (plus:V8SI + (plus:V8SI + (zero_extend:V8SI + (match_operand:V8HI 1 "nonimmediate_operand" "%0")) + (zero_extend:V8SI + (match_operand:V8HI 2 "nonimmediate_operand" "xm"))) + (const_vector:V8HI [(const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1) + (const_int 1) (const_int 1)])) + (const_int 1))))] + "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, V8HImode, operands)" + "pavgw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +;; The correct representation for this is absolutely enormous, and +;; surely not generally useful. +(define_insn "sse2_psadbw" + [(set (match_operand:V2DI 0 "register_operand" "=x") + (unspec:V2DI [(match_operand:V16QI 1 "register_operand" "0") + (match_operand:V16QI 2 "nonimmediate_operand" "xm")] + UNSPEC_PSADBW))] + "TARGET_SSE2" + "psadbw\t{%2, %0|%0, %2}" + [(set_attr "type" "sseiadd") + (set_attr "mode" "TI")]) + +(define_insn "sse_movmskps" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:V4SF 1 "register_operand" "x")] + UNSPEC_MOVMSK))] + "TARGET_SSE" + "movmskps\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V4SF")]) + +(define_insn "sse2_movmskpd" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:V2DF 1 "register_operand" "x")] + UNSPEC_MOVMSK))] + "TARGET_SSE2" + "movmskpd\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_insn "sse2_pmovmskb" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:V16QI 1 "register_operand" "x")] + UNSPEC_MOVMSK))] + "TARGET_SSE2" + "pmovmskb\t{%1, %0|%0, %1}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "V2DF")]) + +(define_expand "sse2_maskmovdqu" + [(set (match_operand:V16QI 0 "memory_operand" "") + (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x") + (match_operand:V16QI 2 "register_operand" "x") + (match_dup 0)] + UNSPEC_MASKMOV))] + "TARGET_SSE2" + "") + +(define_insn "*sse2_maskmovdqu" + [(set (mem:V16QI (match_operand:SI 0 "register_operand" "D")) + (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x") + (match_operand:V16QI 2 "register_operand" "x") + (mem:V16QI (match_dup 0))] + UNSPEC_MASKMOV))] + "TARGET_SSE2 && !TARGET_64BIT" + ;; @@@ check ordering of operands in intel/nonintel syntax + "maskmovdqu\t{%2, %1|%1, %2}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_insn "*sse2_maskmovdqu_rex64" + [(set (mem:V16QI (match_operand:DI 0 "register_operand" "D")) + (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x") + (match_operand:V16QI 2 "register_operand" "x") + (mem:V16QI (match_dup 0))] + UNSPEC_MASKMOV))] + "TARGET_SSE2 && TARGET_64BIT" + ;; @@@ check ordering of operands in intel/nonintel syntax + "maskmovdqu\t{%2, %1|%1, %2}" + [(set_attr "type" "ssecvt") + (set_attr "mode" "TI")]) + +(define_insn "sse_ldmxcsr" + [(unspec_volatile [(match_operand:SI 0 "memory_operand" "m")] + UNSPECV_LDMXCSR)] + "TARGET_SSE" + "ldmxcsr\t%0" + [(set_attr "type" "sse") + (set_attr "memory" "load")]) + +(define_insn "sse_stmxcsr" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec_volatile:SI [(const_int 0)] UNSPECV_STMXCSR))] + "TARGET_SSE" + "stmxcsr\t%0" + [(set_attr "type" "sse") + (set_attr "memory" "store")]) + +(define_expand "sse_sfence" + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_SFENCE))] + "TARGET_SSE || TARGET_3DNOW_A" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*sse_sfence" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_dup 0)] UNSPEC_SFENCE))] + "TARGET_SSE || TARGET_3DNOW_A" + "sfence" + [(set_attr "type" "sse") + (set_attr "memory" "unknown")]) + +(define_insn "sse2_clflush" + [(unspec_volatile [(match_operand 0 "address_operand" "p")] + UNSPECV_CLFLUSH)] + "TARGET_SSE2" + "clflush\t%a0" + [(set_attr "type" "sse") + (set_attr "memory" "unknown")]) + +(define_expand "sse2_mfence" + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))] + "TARGET_SSE2" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*sse2_mfence" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_dup 0)] UNSPEC_MFENCE))] + "TARGET_SSE2" + "mfence" + [(set_attr "type" "sse") + (set_attr "memory" "unknown")]) + +(define_expand "sse2_lfence" + [(set (match_dup 0) + (unspec:BLK [(match_dup 0)] UNSPEC_LFENCE))] + "TARGET_SSE2" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*sse2_lfence" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_dup 0)] UNSPEC_LFENCE))] + "TARGET_SSE2" + "lfence" + [(set_attr "type" "sse") + (set_attr "memory" "unknown")]) + +(define_insn "sse3_mwait" + [(unspec_volatile [(match_operand:SI 0 "register_operand" "a") + (match_operand:SI 1 "register_operand" "c")] + UNSPECV_MWAIT)] + "TARGET_SSE3" +;; 64bit version is "mwait %rax,%rcx". But only lower 32bits are used. +;; Since 32bit register operands are implicitly zero extended to 64bit, +;; we only need to set up 32bit registers. + "mwait" + [(set_attr "length" "3")]) + +(define_insn "sse3_monitor" + [(unspec_volatile [(match_operand:SI 0 "register_operand" "a") + (match_operand:SI 1 "register_operand" "c") + (match_operand:SI 2 "register_operand" "d")] + UNSPECV_MONITOR)] + "TARGET_SSE3 && !TARGET_64BIT" + "monitor\t%0, %1, %2" + [(set_attr "length" "3")]) + +(define_insn "sse3_monitor64" + [(unspec_volatile [(match_operand:DI 0 "register_operand" "a") + (match_operand:SI 1 "register_operand" "c") + (match_operand:SI 2 "register_operand" "d")] + UNSPECV_MONITOR)] + "TARGET_SSE3 && TARGET_64BIT" +;; 64bit version is "monitor %rax,%rcx,%rdx". But only lower 32bits in +;; RCX and RDX are used. Since 32bit register operands are implicitly +;; zero extended to 64bit, we only need to set up 32bit registers. + "monitor" + [(set_attr "length" "3")]) diff --git a/contrib/gcc/config/i386/sync.md b/contrib/gcc/config/i386/sync.md new file mode 100644 index 00000000000..8c2fdb230b0 --- /dev/null +++ b/contrib/gcc/config/i386/sync.md @@ -0,0 +1,291 @@ +;; GCC machine description for i386 synchronization instructions. +;; Copyright (C) 2005, 2006 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_mode_macro IMODE [QI HI SI (DI "TARGET_64BIT")]) +(define_mode_attr modesuffix [(QI "b") (HI "w") (SI "l") (DI "q")]) +(define_mode_attr modeconstraint [(QI "q") (HI "r") (SI "r") (DI "r")]) +(define_mode_attr immconstraint [(QI "i") (HI "i") (SI "i") (DI "e")]) + +(define_mode_macro CASMODE [QI HI SI (DI "TARGET_64BIT || TARGET_CMPXCHG8B") + (TI "TARGET_64BIT && TARGET_CMPXCHG16B")]) +(define_mode_macro DCASMODE + [(DI "!TARGET_64BIT && TARGET_CMPXCHG8B && !flag_pic") + (TI "TARGET_64BIT && TARGET_CMPXCHG16B")]) +(define_mode_attr doublemodesuffix [(DI "8") (TI "16")]) +(define_mode_attr DCASHMODE [(DI "SI") (TI "DI")]) + +;; ??? It would be possible to use cmpxchg8b on pentium for DImode +;; changes. It's complicated because the insn uses ecx:ebx as the +;; new value; note that the registers are reversed from the order +;; that they'd be in with (reg:DI 2 ecx). Similarly for TImode +;; data in 64-bit mode. + +(define_expand "sync_compare_and_swap" + [(parallel + [(set (match_operand:CASMODE 0 "register_operand" "") + (match_operand:CASMODE 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:CASMODE + [(match_dup 1) + (match_operand:CASMODE 2 "register_operand" "") + (match_operand:CASMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_CMPXCHG" +{ + if ((mode == DImode && !TARGET_64BIT) || mode == TImode) + { + enum machine_mode hmode = mode == DImode ? SImode : DImode; + rtx low = simplify_gen_subreg (hmode, operands[3], mode, 0); + rtx high = simplify_gen_subreg (hmode, operands[3], mode, + GET_MODE_SIZE (hmode)); + low = force_reg (hmode, low); + high = force_reg (hmode, high); + if (mode == DImode) + emit_insn (gen_sync_double_compare_and_swapdi + (operands[0], operands[1], operands[2], low, high)); + else if (mode == TImode) + emit_insn (gen_sync_double_compare_and_swapti + (operands[0], operands[1], operands[2], low, high)); + else + gcc_unreachable (); + DONE; + } +}) + +(define_insn "*sync_compare_and_swap" + [(set (match_operand:IMODE 0 "register_operand" "=a") + (match_operand:IMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:IMODE + [(match_dup 1) + (match_operand:IMODE 2 "register_operand" "a") + (match_operand:IMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_CMPXCHG" + "lock\;cmpxchg{}\t{%3, %1|%1, %3}") + +(define_insn "sync_double_compare_and_swap" + [(set (match_operand:DCASMODE 0 "register_operand" "=A") + (match_operand:DCASMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:DCASMODE + [(match_dup 1) + (match_operand:DCASMODE 2 "register_operand" "A") + (match_operand: 3 "register_operand" "b") + (match_operand: 4 "register_operand" "c")] + UNSPECV_CMPXCHG_1)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;cmpxchgb\t%1") + +;; Theoretically we'd like to use constraint "r" (any reg) for operand +;; 3, but that includes ecx. If operand 3 and 4 are the same (like when +;; the input is -1LL) GCC might chose to allocate operand 3 to ecx, like +;; operand 4. This breaks, as the xchg will move the PIC register contents +;; to %ecx then --> boom. Operands 3 and 4 really need to be different +;; registers, which in this case means operand 3 must not be ecx. +;; Instead of playing tricks with fake early clobbers or the like we +;; just enumerate all regs possible here, which (as this is !TARGET_64BIT) +;; are just esi and edi. +(define_insn "*sync_double_compare_and_swapdi_pic" + [(set (match_operand:DI 0 "register_operand" "=A") + (match_operand:DI 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:DI + [(match_dup 1) + (match_operand:DI 2 "register_operand" "A") + (match_operand:SI 3 "register_operand" "SD") + (match_operand:SI 4 "register_operand" "c")] + UNSPECV_CMPXCHG_1)) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT && TARGET_CMPXCHG8B && flag_pic" + "xchg{l}\t%%ebx, %3\;lock\;cmpxchg8b\t%1\;xchg{l}\t%%ebx, %3") + +(define_expand "sync_compare_and_swap_cc" + [(parallel + [(set (match_operand:CASMODE 0 "register_operand" "") + (match_operand:CASMODE 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:CASMODE + [(match_dup 1) + (match_operand:CASMODE 2 "register_operand" "") + (match_operand:CASMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (set (match_dup 4) + (compare:CCZ + (unspec_volatile:CASMODE + [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG_2) + (match_dup 2)))])] + "TARGET_CMPXCHG" +{ + operands[4] = gen_rtx_REG (CCZmode, FLAGS_REG); + ix86_compare_op0 = operands[3]; + ix86_compare_op1 = NULL; + ix86_compare_emitted = operands[4]; + if ((mode == DImode && !TARGET_64BIT) || mode == TImode) + { + enum machine_mode hmode = mode == DImode ? SImode : DImode; + rtx low = simplify_gen_subreg (hmode, operands[3], mode, 0); + rtx high = simplify_gen_subreg (hmode, operands[3], mode, + GET_MODE_SIZE (hmode)); + low = force_reg (hmode, low); + high = force_reg (hmode, high); + if (mode == DImode) + emit_insn (gen_sync_double_compare_and_swap_ccdi + (operands[0], operands[1], operands[2], low, high)); + else if (mode == TImode) + emit_insn (gen_sync_double_compare_and_swap_ccti + (operands[0], operands[1], operands[2], low, high)); + else + gcc_unreachable (); + DONE; + } +}) + +(define_insn "*sync_compare_and_swap_cc" + [(set (match_operand:IMODE 0 "register_operand" "=a") + (match_operand:IMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:IMODE + [(match_dup 1) + (match_operand:IMODE 2 "register_operand" "a") + (match_operand:IMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (set (reg:CCZ FLAGS_REG) + (compare:CCZ + (unspec_volatile:IMODE + [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG_2) + (match_dup 2)))] + "TARGET_CMPXCHG" + "lock\;cmpxchg{}\t{%3, %1|%1, %3}") + +(define_insn "sync_double_compare_and_swap_cc" + [(set (match_operand:DCASMODE 0 "register_operand" "=A") + (match_operand:DCASMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:DCASMODE + [(match_dup 1) + (match_operand:DCASMODE 2 "register_operand" "A") + (match_operand: 3 "register_operand" "b") + (match_operand: 4 "register_operand" "c")] + UNSPECV_CMPXCHG_1)) + (set (reg:CCZ FLAGS_REG) + (compare:CCZ + (unspec_volatile:DCASMODE + [(match_dup 1) (match_dup 2) (match_dup 3) (match_dup 4)] + UNSPECV_CMPXCHG_2) + (match_dup 2)))] + "" + "lock\;cmpxchgb\t%1") + +;; See above for the explanation of using the constraint "SD" for +;; operand 3. +(define_insn "*sync_double_compare_and_swap_ccdi_pic" + [(set (match_operand:DI 0 "register_operand" "=A") + (match_operand:DI 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:DI + [(match_dup 1) + (match_operand:DI 2 "register_operand" "A") + (match_operand:SI 3 "register_operand" "SD") + (match_operand:SI 4 "register_operand" "c")] + UNSPECV_CMPXCHG_1)) + (set (reg:CCZ FLAGS_REG) + (compare:CCZ + (unspec_volatile:DI + [(match_dup 1) (match_dup 2) (match_dup 3) (match_dup 4)] + UNSPECV_CMPXCHG_2) + (match_dup 2)))] + "!TARGET_64BIT && TARGET_CMPXCHG8B && flag_pic" + "xchg{l}\t%%ebx, %3\;lock\;cmpxchg8b\t%1\;xchg{l}\t%%ebx, %3") + +(define_insn "sync_old_add" + [(set (match_operand:IMODE 0 "register_operand" "=") + (unspec_volatile:IMODE + [(match_operand:IMODE 1 "memory_operand" "+m")] UNSPECV_XCHG)) + (set (match_dup 1) + (plus:IMODE (match_dup 1) + (match_operand:IMODE 2 "register_operand" "0"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_XADD" + "lock\;xadd{}\t{%0, %1|%1, %0}") + +;; Recall that xchg implicitly sets LOCK#, so adding it again wastes space. +(define_insn "sync_lock_test_and_set" + [(set (match_operand:IMODE 0 "register_operand" "=") + (unspec_volatile:IMODE + [(match_operand:IMODE 1 "memory_operand" "+m")] UNSPECV_XCHG)) + (set (match_dup 1) + (match_operand:IMODE 2 "register_operand" "0"))] + "" + "xchg{}\t{%1, %0|%0, %1}") + +(define_insn "sync_add" + [(set (match_operand:IMODE 0 "memory_operand" "+m") + (unspec_volatile:IMODE + [(plus:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" ""))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;add{}\t{%1, %0|%0, %1}") + +(define_insn "sync_sub" + [(set (match_operand:IMODE 0 "memory_operand" "+m") + (unspec_volatile:IMODE + [(minus:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" ""))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;sub{}\t{%1, %0|%0, %1}") + +(define_insn "sync_ior" + [(set (match_operand:IMODE 0 "memory_operand" "+m") + (unspec_volatile:IMODE + [(ior:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" ""))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;or{}\t{%1, %0|%0, %1}") + +(define_insn "sync_and" + [(set (match_operand:IMODE 0 "memory_operand" "+m") + (unspec_volatile:IMODE + [(and:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" ""))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;and{}\t{%1, %0|%0, %1}") + +(define_insn "sync_xor" + [(set (match_operand:IMODE 0 "memory_operand" "+m") + (unspec_volatile:IMODE + [(xor:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" ""))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;xor{}\t{%1, %0|%0, %1}") diff --git a/contrib/gcc/config/i386/sysv4-cpp.h b/contrib/gcc/config/i386/sysv4-cpp.h index 6ec751af0f7..c53b1da86bd 100644 --- a/contrib/gcc/config/i386/sysv4-cpp.h +++ b/contrib/gcc/config/i386/sysv4-cpp.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ diff --git a/contrib/gcc/config/i386/sysv4.h b/contrib/gcc/config/i386/sysv4.h index 244700637ec..acbd69eaeda 100644 --- a/contrib/gcc/config/i386/sysv4.h +++ b/contrib/gcc/config/i386/sysv4.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)"); diff --git a/contrib/gcc/config/i386/sysv5.h b/contrib/gcc/config/i386/sysv5.h index c4edd7123a3..34b00c657b6 100644 --- a/contrib/gcc/config/i386/sysv5.h +++ b/contrib/gcc/config/i386/sysv5.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Dwarf2 is supported by native debuggers */ diff --git a/contrib/gcc/config/i386/t-crtfm b/contrib/gcc/config/i386/t-crtfm new file mode 100644 index 00000000000..fc4b58784ca --- /dev/null +++ b/contrib/gcc/config/i386/t-crtfm @@ -0,0 +1,6 @@ +EXTRA_PARTS += crtfastmath.o + +$(T)crtfastmath.o: $(srcdir)/config/i386/crtfastmath.c $(GCC_PASSES) + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -msse -c \ + $(srcdir)/config/i386/crtfastmath.c \ + -o $(T)crtfastmath$(objext) diff --git a/contrib/gcc/config/i386/t-cygming b/contrib/gcc/config/i386/t-cygming index aa6ff61ca03..c001a8b0f61 100644 --- a/contrib/gcc/config/i386/t-cygming +++ b/contrib/gcc/config/i386/t-cygming @@ -16,4 +16,17 @@ winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/i386/winnt.c +winnt-cxx.o: $(srcdir)/config/i386/winnt-cxx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/winnt-cxx.c + + +winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/winnt-stubs.c + STMP_FIXINC=stmp-fixinc diff --git a/contrib/gcc/config/i386/t-darwin b/contrib/gcc/config/i386/t-darwin new file mode 100644 index 00000000000..e79f3355aaa --- /dev/null +++ b/contrib/gcc/config/i386/t-darwin @@ -0,0 +1,5 @@ +SHLIB_VERPFX = $(srcdir)/config/i386/darwin-libgcc +MULTILIB_OPTIONS = m64 +MULTILIB_DIRNAMES = x86_64 +LIB2_SIDITI_CONV_FUNCS=yes +LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c diff --git a/contrib/gcc/config/i386/t-darwin64 b/contrib/gcc/config/i386/t-darwin64 new file mode 100644 index 00000000000..e7875864b18 --- /dev/null +++ b/contrib/gcc/config/i386/t-darwin64 @@ -0,0 +1,3 @@ +SHLIB_VERPFX = $(srcdir)/config/i386/darwin-libgcc +LIB2_SIDITI_CONV_FUNCS=yes +LIB2FUNCS_EXTRA = $(srcdir)/config/darwin-64.c diff --git a/contrib/gcc/config/i386/t-gmm_malloc b/contrib/gcc/config/i386/t-gmm_malloc new file mode 100644 index 00000000000..c37f8a75985 --- /dev/null +++ b/contrib/gcc/config/i386/t-gmm_malloc @@ -0,0 +1,6 @@ +# Install gmm_malloc.h as mm_malloc.h. + +EXTRA_HEADERS += mm_malloc.h +mm_malloc.h: $(srcdir)/config/i386/gmm_malloc.h + rm -f $@ + cat $^ > $@ diff --git a/contrib/gcc/config/i386/t-gthr-win32 b/contrib/gcc/config/i386/t-gthr-win32 new file mode 100644 index 00000000000..204a485bcd1 --- /dev/null +++ b/contrib/gcc/config/i386/t-gthr-win32 @@ -0,0 +1,3 @@ +# We hide calls to w32api needed for w32 thread support here: +LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c + diff --git a/contrib/gcc/config/i386/t-linux64 b/contrib/gcc/config/i386/t-linux64 index 3b109d8b0ce..aac59a08e36 100644 --- a/contrib/gcc/config/i386/t-linux64 +++ b/contrib/gcc/config/i386/t-linux64 @@ -11,7 +11,8 @@ MULTILIB_OSDIRNAMES = ../lib64 ../lib LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \ + crtbeginT.o crtfastmath.o # The pushl in CTOR initialization interferes with frame pointer elimination. # crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, diff --git a/contrib/gcc/config/i386/t-mingw32 b/contrib/gcc/config/i386/t-mingw32 index 28096f8c48d..6d043a37f6a 100644 --- a/contrib/gcc/config/i386/t-mingw32 +++ b/contrib/gcc/config/i386/t-mingw32 @@ -1,7 +1,2 @@ -# -# collect2 doesn't work for i386-mingw32* yet. -# -USE_COLLECT2= - -# We hide calls to w32api needed for w32 thread support here: -LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c +# Match SYSTEM_INCLUDE_DIR +NATIVE_SYSTEM_HEADER_DIR = /mingw/include diff --git a/contrib/gcc/config/i386/t-nwld b/contrib/gcc/config/i386/t-nwld new file mode 100644 index 00000000000..6f6905541ec --- /dev/null +++ b/contrib/gcc/config/i386/t-nwld @@ -0,0 +1,61 @@ +CRTSTUFF_T_CFLAGS = -mpreferred-stack-boundary=2 +CRT0STUFF_T_CFLAGS = -mpreferred-stack-boundary=2 $(INCLUDES) +# this is a slight misuse (it's not an assembler file) +CRT0_S = $(srcdir)/config/i386/netware-crt0.c +MCRT0_S = $(srcdir)/config/i386/netware-crt0.c + +libgcc.def: $(srcdir)/config/i386/t-nwld + echo "module libgcc_s" >$@ + +libc.def: $(srcdir)/config/i386/t-nwld + echo "module libc" >$@ + +libcpre.def: $(srcdir)/config/i386/t-nwld + echo "start _LibCPrelude" >$@ + echo "exit _LibCPostlude" >>$@ + echo "check _LibCCheckUnload" >>$@ + +posixpre.def: $(srcdir)/config/i386/t-nwld + echo "start POSIX_Start" >$@ + echo "exit POSIX_Stop" >>$@ + echo "check POSIX_CheckUnload" >>$@ + +nwld.o: $(srcdir)/config/i386/nwld.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/nwld.c + + +s-crt0: $(srcdir)/unwind-dw2-fde.h + +# Build a shared libgcc library for NetWare. + +SHLIB_EXT = .nlm +SHLIB_NAME = @shlib_base_name@.nlm +SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ +SHLIB_DEF = $(srcdir)/config/i386/netware-libgcc.def +SHLIB_MAP = $(srcdir)/config/i386/netware-libgcc.exp +SHLIB_SRC = $(srcdir)/config/i386/netware-libgcc.c + +SHLIB_LINK = set -e; \ + cat $(SHLIB_DEF) >@shlib_base_name@.def; \ + echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \ + echo "version $(version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \ + touch libgcc/build; \ + echo "build $$$$(expr $$$$(>@shlib_base_name@.def; \ + echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \ + if mpkxdc -n -p @shlib_base_name@.xdc; \ + then echo "xdcdata @shlib_base_name@.xdc" >>@shlib_base_name@.def; \ + else echo "WARNING: $(SHLIB_NAME) built without XDC data will not work well." 1>&2; \ + fi; \ + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -o $(SHLIB_NAME) \ + $(SHLIB_SRC) -posix -static-libgcc -lnetware \ + -Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_base_name@.def; \ + rm -f @shlib_base_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_base_name@.imp; \ + rm -f libgcc.imp; $(LN_S) @shlib_base_name@.imp libgcc.imp; \ + expr $$$$(libgcc/build + +# $(slibdir) double quoted to protect it from expansion while building +# libgcc.mk. We want this delayed until actual install time. +SHLIB_INSTALL = \ + $$(SHELL) $(srcdir)/mkinstalldirs $$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $$(INSTALL_DATA) $(SHLIB_NAME) $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \ + $$(INSTALL_DATA) @shlib_base_name@.imp $$(DESTDIR)$$(libsubdir)/ diff --git a/contrib/gcc/config/i386/t-pmm_malloc b/contrib/gcc/config/i386/t-pmm_malloc new file mode 100644 index 00000000000..109009fbfc5 --- /dev/null +++ b/contrib/gcc/config/i386/t-pmm_malloc @@ -0,0 +1,6 @@ +# Install pmm_malloc.h as mm_malloc.h. + +EXTRA_HEADERS += mm_malloc.h +mm_malloc.h: $(srcdir)/config/i386/pmm_malloc.h + rm -f $@ + cat $^ > $@ diff --git a/contrib/gcc/config/i386/t-rtems-i386 b/contrib/gcc/config/i386/t-rtems-i386 index d32928c53aa..9400be8f508 100644 --- a/contrib/gcc/config/i386/t-rtems-i386 +++ b/contrib/gcc/config/i386/t-rtems-i386 @@ -36,17 +36,14 @@ xp-bit.c: $(srcdir)/config/fp-bit.c echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c cat $(srcdir)/config/fp-bit.c >> xp-bit.c -MULTILIB_OPTIONS = mtune=i486/mtune=pentium/mtune=pentiumpro/mtune=k6/mtune=athlon \ -msoft-float mno-fp-ret-in-387 -MULTILIB_DIRNAMES= m486 mpentium mpentiumpro k6 athlon soft-float nofp +MULTILIB_OPTIONS = mtune=i486/mtune=pentium/mtune=pentiumpro \ +msoft-float +MULTILIB_DIRNAMES= m486 mpentium mpentiumpro soft-float MULTILIB_MATCHES = msoft-float=mno-m80387 +MULTILIB_MATCHES += mtune?pentium=mtune?k6 mtune?pentiumpro=mtune?mathlon MULTILIB_EXCEPTIONS = \ -mno-fp-ret-in-387 \ -mtune=i486/*mno-fp-ret-in-387* \ -mtune=pentium/*msoft-float* mtune=pentium/*mno-fp-ret-in-387* \ -mtune=pentiumpro/*msoft-float* mtune=pentiumpro/*mno-fp-ret-in-387* \ -mtune=k6/*msoft-float* mtune=k6/*mno-fp-ret-in-387* \ -mtune=athlon/*msoft-float* mtune=athlon/*mno-fp-ret-in-387* +mtune=pentium/*msoft-float* \ +mtune=pentiumpro/*msoft-float* EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o diff --git a/contrib/gcc/config/i386/t-sol2 b/contrib/gcc/config/i386/t-sol2 index 5d7522c3dab..0eec96f1f05 100644 --- a/contrib/gcc/config/i386/t-sol2 +++ b/contrib/gcc/config/i386/t-sol2 @@ -1,24 +1,24 @@ # gmon build rule: -gmon.o: $(srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) - $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \ - -c $(srcdir)/config/i386/gmon-sol2.c -o gmon.o +$(T)gmon.o: $(srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \ + -c $(srcdir)/config/i386/gmon-sol2.c -o $(T)gmon.o # Assemble startup files. # Apparently Sun believes that assembler files don't need comments, because no # single ASCII character is valid (tried them all). So we manually strip out # the comments with sed. This bug may only be in the Early Access releases. -gcrt1.o: $(srcdir)/config/i386/sol2-gc1.asm +$(T)gcrt1.o: $(srcdir)/config/i386/sol2-gc1.asm $(GCC_PASSES) sed -e '/^!/d' <$(srcdir)/config/i386/sol2-gc1.asm >gcrt1.s - $(AS) -o gcrt1.o gcrt1.s -crt1.o: $(srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1.o gcrt1.s +$(T)crt1.o: $(srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES) sed -e '/^!/d' <$(srcdir)/config/i386/sol2-c1.asm >crt1.s - $(GCC_FOR_TARGET) -c -o crt1.o crt1.s -crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o crt1.s +$(T)crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES) sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s - $(GCC_FOR_TARGET) -c -o crti.o crti.s -crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o crti.s +$(T)crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES) sed -e '/^!/d' <$(srcdir)/config/i386/sol2-cn.asm >crtn.s - $(GCC_FOR_TARGET) -c -o crtn.o crtn.s + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o crtn.s # We need to use -fPIC when we are using gcc to compile the routines in # crtstuff.c. This is only really needed when we are going to use gcc/g++ diff --git a/contrib/gcc/config/i386/t-sol2-10 b/contrib/gcc/config/i386/t-sol2-10 new file mode 100644 index 00000000000..64e5928caa3 --- /dev/null +++ b/contrib/gcc/config/i386/t-sol2-10 @@ -0,0 +1,11 @@ +MULTILIB_OPTIONS = m32/m64 +MULTILIB_DIRNAMES = 32 amd64 +MULTILIB_OSDIRNAMES = . amd64 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +# GCC contains i386 assembler sources for some of the startfiles +# which aren't appropriate for amd64. Just use the installed +# versions of: crt1.o crti.o crtn.o gcrt1.o +EXTRA_MULTILIB_PARTS=gmon.o crtbegin.o crtend.o diff --git a/contrib/gcc/config/i386/t-vxworks b/contrib/gcc/config/i386/t-vxworks index 609399502e7..c440b1f9031 100644 --- a/contrib/gcc/config/i386/t-vxworks +++ b/contrib/gcc/config/i386/t-vxworks @@ -1,8 +1,8 @@ # Multilibs for VxWorks. -#GCC does not have an arch=pentium3 setting, so we cannot build PENTIUM3gnu -MULTILIB_OPTIONS = \ - march=i486/march=pentium/march=pentiumpro/march=pentium4 -MULTILIB_DIRNAMES = \ - I80486 PENTIUMgnu PENTIUM2gnu PENTIUM4gnu +# Build multilibs for normal, -mrtp, and -mrtp -fPIC. +MULTILIB_OPTIONS = mrtp fPIC +MULTILIB_DIRNAMES = +MULTILIB_MATCHES = fPIC=fpic +MULTILIB_EXCEPTIONS = fPIC diff --git a/contrib/gcc/config/i386/t-vxworksae b/contrib/gcc/config/i386/t-vxworksae new file mode 100644 index 00000000000..0cea2bbf331 --- /dev/null +++ b/contrib/gcc/config/i386/t-vxworksae @@ -0,0 +1,5 @@ +# Multilibs for VxWorks AE. + +MULTILIB_OPTIONS = mvthreads +MULTILIB_MATCHES = +MULTILIB_EXCEPTIONS = diff --git a/contrib/gcc/config/i386/unix.h b/contrib/gcc/config/i386/unix.h index 102afe0da30..abb4e054038 100644 --- a/contrib/gcc/config/i386/unix.h +++ b/contrib/gcc/config/i386/unix.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file defines the aspects of assembler syntax that are the same for all the i386 Unix systems diff --git a/contrib/gcc/config/i386/uwin.h b/contrib/gcc/config/i386/uwin.h index d2553c92f5f..38d218ef6e6 100644 --- a/contrib/gcc/config/i386/uwin.h +++ b/contrib/gcc/config/i386/uwin.h @@ -2,7 +2,7 @@ hosting on U/WIN (Windows32), using GNU tools and the Windows32 API Library, as distinct from winnt.h, which is used to build GCC for use with a windows style library and tool set and uses the Microsoft tools. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Mumit Khan . This file is part of GCC. @@ -19,8 +19,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Most of this is the same as for Cygwin32, except for changing some specs. */ @@ -55,9 +55,6 @@ Boston, MA 02111-1307, USA. */ #define LIB_SPEC \ "%{pg:-lgmon} %{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32" -/* This is needed in g77spec.c for now. Will be removed in the future. */ -#define WIN32_UWIN_TARGET 1 - /* Include in the mingw32 libraries with libgcc */ #undef LIBGCC_SPEC #define LIBGCC_SPEC "-lgnuwin -lposix -lgcc -last -lmoldname -lmsvcrt" diff --git a/contrib/gcc/config/i386/vxworks.h b/contrib/gcc/config/i386/vxworks.h index 5ded098b9d3..dd4164ec96f 100644 --- a/contrib/gcc/config/i386/vxworks.h +++ b/contrib/gcc/config/i386/vxworks.h @@ -1,5 +1,6 @@ -/* Definitions of target machine for GCC. VxWorks i586 version. - Copyright (C) 2003 Free Software Foundation, Inc. +/* IA32 VxWorks target definitions for GNU compiler. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Updated by CodeSourcery, LLC. This file is part of GCC. @@ -15,60 +16,70 @@ GNU General Public License for more details. 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. */ - +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define HANDLE_SYSV_PRAGMA 1 #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (80586, VxWorks syntax)"); -/* Prefix for internally generated assembler labels. If we aren't using - underscores, we are using prefix `.'s to identify labels that should - be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ - -#define LPREFIX "L" - -/* Assembler pseudos to introduce constants of various size. */ - -#define ASM_SHORT "\t.word\t" -#define ASM_LONG "\t.long\t" -#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */ - - -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG)) - #undef ASM_SPEC -#define ASM_SPEC "%{v:-V} %{Qy:} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" +#define ASM_SPEC "%{v:-v} %{Qy:} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("__vxworks"); \ - builtin_assert ("system=unix"); \ - \ - if (TARGET_386) \ - builtin_define ("CPU=I80386"); \ - else if (TARGET_486) \ - builtin_define ("CPU=I80486"); \ - else if (TARGET_PENTIUM) \ - { \ - builtin_define ("CPU=PENTIUM"); \ - builtin_define ("CPU_VARIANT=PENTIUM"); \ - } \ - else if (TARGET_PENTIUMPRO) \ - { \ - builtin_define ("CPU=PENTIUM2"); \ - builtin_define ("CPU_VARIANT=PENTIUMPRO"); \ - } \ - else if (TARGET_PENTIUM4) \ - { \ - builtin_define ("CPU=PENTIUM4"); \ - builtin_define ("CPU_VARIANT=PENTIUM4"); \ - } \ - } \ +#define VXWORKS_CPU_DEFINE() \ + do \ + { \ + if (TARGET_386) \ + builtin_define ("CPU=I80386"); \ + else if (TARGET_486) \ + builtin_define ("CPU=I80486"); \ + else if (TARGET_PENTIUM) \ + { \ + builtin_define ("CPU=PENTIUM"); \ + builtin_define ("CPU_VARIANT=PENTIUM"); \ + } \ + else if (TARGET_PENTIUMPRO) \ + { \ + builtin_define ("CPU=PENTIUM2"); \ + builtin_define ("CPU_VARIANT=PENTIUMPRO"); \ + } \ + else if (TARGET_PENTIUM4) \ + { \ + builtin_define ("CPU=PENTIUM4"); \ + builtin_define ("CPU_VARIANT=PENTIUM4"); \ + } \ + } \ while (0) +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__vxworks"); \ + builtin_define ("__VXWORKS__"); \ + builtin_assert ("system=unix"); \ + \ + VXWORKS_CPU_DEFINE(); \ + } \ + while (0) +#undef CPP_SPEC +#define CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC +#undef LIB_SPEC +#define LIB_SPEC VXWORKS_LIB_SPEC +#undef STARTFILE_SPEC +#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC +#undef ENDFILE_SPEC +#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC +#undef LINK_SPEC +#define LINK_SPEC VXWORKS_LINK_SPEC + +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES EXTRA_SUBTARGET_SWITCHES + +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS VXWORKS_OVERRIDE_OPTIONS + +/* No _mcount profiling on VxWorks. */ +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO) diff --git a/contrib/gcc/config/i386/vxworksae.h b/contrib/gcc/config/i386/vxworksae.h new file mode 100644 index 00000000000..0fd80c4ce90 --- /dev/null +++ b/contrib/gcc/config/i386/vxworksae.h @@ -0,0 +1,27 @@ +/* IA32 VxWorks AE target definitions for GNU compiler. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* On VxWorks AE, we only want SIMNT. */ +#undef VXWORKS_CPU_DEFINE +#define VXWORKS_CPU_DEFINE() \ + do \ + builtin_define ("CPU=SIMNT"); \ + while (0) diff --git a/contrib/gcc/config/i386/winnt-cxx.c b/contrib/gcc/config/i386/winnt-cxx.c new file mode 100755 index 00000000000..6123ebbcdc3 --- /dev/null +++ b/contrib/gcc/config/i386/winnt-cxx.c @@ -0,0 +1,167 @@ +/* Target support for C++ classes on Windows. + Contributed by Danny Smith (dannysmith@users.sourceforge.net) + Copyright (C) 2005 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "output.h" +#include "tree.h" +#include "cp/cp-tree.h" /* this is why we're a separate module */ +#include "flags.h" +#include "tm_p.h" +#include "toplev.h" +#include "hashtab.h" + +bool +i386_pe_type_dllimport_p (tree decl) +{ + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL); + + if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL) + return false; + + /* We ignore the dllimport attribute for inline member functions. + This differs from MSVC behavior which treats it like GNUC + 'extern inline' extension. Also ignore for template + instantiations with linkonce semantics and artificial methods. */ + if (TREE_CODE (decl) == FUNCTION_DECL + && (DECL_DECLARED_INLINE_P (decl) + || DECL_TEMPLATE_INSTANTIATION (decl) + || DECL_ARTIFICIAL (decl))) + return false; + + /* Since we can't treat a pointer to a dllimport'd symbol as a + constant address, we turn off the attribute on C++ virtual + methods to allow creation of vtables using thunks. */ + else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE + && DECL_VIRTUAL_P (decl)) + { + /* Even though we ignore the attribute from the start, warn if we later see + an out-of class definition, as we do for other member functions in + tree.c:merge_dllimport_decl_attributes. If this is the key method, the + definition may affect the import-export status of vtables, depending + on how we handle MULTIPLE_SYMBOL_SPACES in cp/decl2.c. */ + if (DECL_INITIAL (decl)) + { + warning (OPT_Wattributes, "%q+D redeclared without dllimport attribute: " + "previous dllimport ignored", decl); +#ifdef PE_DLL_DEBUG + if (decl == CLASSTYPE_KEY_METHOD (DECL_CONTEXT (decl))) + warning (OPT_Wattributes, "key method %q+D of dllimport'd class defined" + decl); +#endif + } + return false; + } + + /* Don't mark defined functions as dllimport. This code will only be + reached if we see a non-inline function defined out-of-class. */ + else if (TREE_CODE (decl) == FUNCTION_DECL + && (DECL_INITIAL (decl))) + return false; + + /* Don't allow definitions of static data members in dllimport class, + If vtable data is marked as DECL_EXTERNAL, import it; otherwise just + ignore the class attribute. */ + else if (TREE_CODE (decl) == VAR_DECL + && TREE_STATIC (decl) && TREE_PUBLIC (decl) + && !DECL_EXTERNAL (decl)) + { + if (!DECL_VIRTUAL_P (decl)) + error ("definition of static data member %q+D of " + "dllimport'd class", decl); + return false; + } + + return true; +} + + +bool +i386_pe_type_dllexport_p (tree decl) +{ + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL); + /* Avoid exporting compiler-generated default dtors and copy ctors. + The only artificial methods that need to be exported are virtual + and non-virtual thunks. */ + if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE + && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl)) + return false; + return true; +} + +static inline void maybe_add_dllimport (tree decl) +{ + if (i386_pe_type_dllimport_p (decl)) + DECL_DLLIMPORT_P (decl) = 1; +} + +void +i386_pe_adjust_class_at_definition (tree t) +{ + tree member; + + gcc_assert (CLASS_TYPE_P (t)); + + /* We only look at dllimport. The only thing that dllexport does is + add stuff to a '.drectiv' section at end-of-file, so no need to do + anything for dllexport'd classes until we generate RTL. */ + if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (t)) == NULL_TREE) + return; + + /* We don't actually add the attribute to the decl, just set the flag + that signals that the address of this symbol is not a compile-time + constant. Any subsequent out-of-class declaration of members wil + cause the DECL_DLLIMPORT_P flag to be unset. + (See tree.c: merge_dllimport_decl_attributes). + That is just right since out-of class declarations can only be a + definition. We recheck the class members at RTL generation to + emit warnings if this has happened. Definition of static data member + of dllimport'd class always causes an error (as per MS compiler). + */ + + /* Check static VAR_DECL's. */ + for (member = TYPE_FIELDS (t); member; member = TREE_CHAIN (member)) + if (TREE_CODE (member) == VAR_DECL) + maybe_add_dllimport (member); + + /* Check FUNCTION_DECL's. */ + for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member)) + if (TREE_CODE (member) == FUNCTION_DECL) + maybe_add_dllimport (member); + + /* Check vtables */ + for (member = CLASSTYPE_VTABLES (t); member; member = TREE_CHAIN (member)) + if (TREE_CODE (member) == VAR_DECL) + maybe_add_dllimport (member); + +/* We leave typeinfo tables alone. We can't mark TI objects as + dllimport, since the address of a secondary VTT may be needed + for static initialization of a primary VTT. VTT's of + dllimport'd classes should always be link-once COMDAT. */ +} diff --git a/contrib/gcc/config/i386/winnt-stubs.c b/contrib/gcc/config/i386/winnt-stubs.c new file mode 100755 index 00000000000..c196f7501c1 --- /dev/null +++ b/contrib/gcc/config/i386/winnt-stubs.c @@ -0,0 +1,53 @@ +/* Dummy subroutines for language-specific support on Windows. + Contributed by Danny Smith (dannysmith@users.sourceforge.net) + Copyright (C) 2005 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "output.h" +#include "tree.h" +#include "flags.h" +#include "tm_p.h" +#include "toplev.h" +#include "hashtab.h" + +bool +i386_pe_type_dllimport_p (tree decl ATTRIBUTE_UNUSED) +{ + return false; +} + + +bool +i386_pe_type_dllexport_p (tree decl ATTRIBUTE_UNUSED) +{ + return false; +} + + +void +i386_pe_adjust_class_at_definition (tree t ATTRIBUTE_UNUSED) +{ } diff --git a/contrib/gcc/config/i386/winnt.c b/contrib/gcc/config/i386/winnt.c index f8621b4f8f0..a46fc5b2b02 100644 --- a/contrib/gcc/config/i386/winnt.c +++ b/contrib/gcc/config/i386/winnt.c @@ -1,7 +1,7 @@ /* Subroutines for insn-output.c for Windows NT. Contributed by Douglas Rupp (drupp@cs.washington.edu) - Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -17,8 +17,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -47,10 +47,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA */ static tree associated_type (tree); -static const char * gen_stdcall_suffix (tree); -static const char * gen_fastcall_suffix (tree); -static int i386_pe_dllexport_p (tree); -static int i386_pe_dllimport_p (tree); +static tree gen_stdcall_or_fastcall_suffix (tree, bool); +static bool i386_pe_dllexport_p (tree); +static bool i386_pe_dllimport_p (tree); static void i386_pe_mark_dllexport (tree); static void i386_pe_mark_dllimport (tree); @@ -63,80 +62,6 @@ static void i386_pe_mark_dllimport (tree); #define DLL_EXPORT_PREFIX "#e." #endif -/* Handle a "dllimport" or "dllexport" attribute; - arguments as in struct attribute_spec.handler. */ -tree -ix86_handle_dll_attribute (tree * pnode, tree name, tree args, int flags, - bool *no_add_attrs) -{ - tree node = *pnode; - - /* These attributes may apply to structure and union types being created, - but otherwise should pass to the declaration involved. */ - if (!DECL_P (node)) - { - if (flags & ((int) ATTR_FLAG_DECL_NEXT | (int) ATTR_FLAG_FUNCTION_NEXT - | (int) ATTR_FLAG_ARRAY_NEXT)) - { - *no_add_attrs = true; - return tree_cons (name, args, NULL_TREE); - } - if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE) - { - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - *no_add_attrs = true; - } - - return NULL_TREE; - } - - /* Report error on dllimport ambiguities seen now before they cause - any damage. */ - else if (is_attribute_p ("dllimport", name)) - { - /* Like MS, treat definition of dllimported variables and - non-inlined functions on declaration as syntax errors. - We allow the attribute for function definitions if declared - inline, but just ignore it in i386_pe_dllimport_p. */ - if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node) - && !DECL_INLINE (node)) - { - error ("%Jfunction `%D' definition is marked dllimport.", node, node); - *no_add_attrs = true; - } - - else if (TREE_CODE (node) == VAR_DECL) - { - if (DECL_INITIAL (node)) - { - error ("%Jvariable `%D' definition is marked dllimport.", - node, node); - *no_add_attrs = true; - } - - /* `extern' needn't be specified with dllimport. - Specify `extern' now and hope for the best. Sigh. */ - DECL_EXTERNAL (node) = 1; - /* Also, implicitly give dllimport'd variables declared within - a function global scope, unless declared static. */ - if (current_function_decl != NULL_TREE && !TREE_STATIC (node)) - TREE_PUBLIC (node) = 1; - } - } - - /* Report error if symbol is not accessible at global scope. */ - if (!TREE_PUBLIC (node) - && (TREE_CODE (node) == VAR_DECL - || TREE_CODE (node) == FUNCTION_DECL)) - { - error ("%Jexternal linkage required for symbol '%D' because of " - "'%s' attribute.", node, node, IDENTIFIER_POINTER (name)); - *no_add_attrs = true; - } - - return NULL_TREE; -} - /* Handle a "shared" attribute; arguments as in struct attribute_spec.handler. */ tree @@ -146,13 +71,36 @@ ix86_handle_shared_attribute (tree *node, tree name, { if (TREE_CODE (*node) != VAR_DECL) { - warning ("`%s' attribute only applies to variables", + warning (OPT_Wattributes, "%qs attribute only applies to variables", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } return NULL_TREE; } + +/* Handle a "selectany" attribute; + arguments as in struct attribute_spec.handler. */ +tree +ix86_handle_selectany_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + /* The attribute applies only to objects that are initialized and have + external linkage. However, we may not know about initialization + until the language frontend has processed the decl. We'll check for + initialization later in encode_section_info. */ + if (TREE_CODE (*node) != VAR_DECL || !TREE_PUBLIC (*node)) + { + error ("%qs attribute applies only to initialized variables" + " with external linkage", IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Return the type that we should use to determine if DECL is imported or exported. */ @@ -160,132 +108,73 @@ ix86_handle_shared_attribute (tree *node, tree name, static tree associated_type (tree decl) { - tree t = NULL_TREE; - - /* In the C++ frontend, DECL_CONTEXT for a method doesn't actually refer - to the containing class. So we look at the 'this' arg. */ - if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) - { - /* Artificial methods are not affected by the import/export status - of their class unless they are COMDAT. Implicit copy ctor's and - dtor's are not affected by class status but virtual and - non-virtual thunks are. */ - if (!DECL_ARTIFICIAL (decl) || DECL_COMDAT (decl)) - t = TYPE_MAIN_VARIANT - (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))))); - } - else if (DECL_CONTEXT (decl) - && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (decl))) == 't') - t = DECL_CONTEXT (decl); - - return t; + return (DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl))) + ? DECL_CONTEXT (decl) : NULL_TREE; } -/* Return nonzero if DECL is a dllexport'd object. */ -static int +/* Return true if DECL is a dllexport'd object. */ + +static bool i386_pe_dllexport_p (tree decl) { - tree exp; - if (TREE_CODE (decl) != VAR_DECL - && TREE_CODE (decl) != FUNCTION_DECL) - return 0; - exp = lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)); - if (exp) - return 1; + && TREE_CODE (decl) != FUNCTION_DECL) + return false; - /* Class members get the dllexport status of their class. */ - if (associated_type (decl)) - { - exp = lookup_attribute ("dllexport", - TYPE_ATTRIBUTES (associated_type (decl))); - if (exp) - return 1; - } + if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl))) + return true; - return 0; + /* Also mark class members of exported classes with dllexport. */ + if (associated_type (decl) + && lookup_attribute ("dllexport", + TYPE_ATTRIBUTES (associated_type (decl)))) + return i386_pe_type_dllexport_p (decl); + + return false; } -/* Return nonzero if DECL is a dllimport'd object. */ - -static int +static bool i386_pe_dllimport_p (tree decl) { - tree imp; - int context_imp = 0; - - if (TREE_CODE (decl) == FUNCTION_DECL - && TARGET_NOP_FUN_DLLIMPORT) - return 0; - if (TREE_CODE (decl) != VAR_DECL - && TREE_CODE (decl) != FUNCTION_DECL) - return 0; + && TREE_CODE (decl) != FUNCTION_DECL) + return false; - imp = lookup_attribute ("dllimport", DECL_ATTRIBUTES (decl)); - - /* Class members get the dllimport status of their class. */ - if (!imp && associated_type (decl)) + /* Lookup the attribute in addition to checking the DECL_DLLIMPORT_P flag. + We may need to override an earlier decision. */ + if (DECL_DLLIMPORT_P (decl) + && lookup_attribute ("dllimport", DECL_ATTRIBUTES (decl))) { - imp = lookup_attribute ("dllimport", - TYPE_ATTRIBUTES (associated_type (decl))); - if (imp) - context_imp = 1; - } - - if (imp) - { - /* Don't mark defined functions as dllimport. If the definition - itself was marked with dllimport, than ix86_handle_dll_attribute - reports an error. This handles the case when the definition - overrides an earlier declaration. */ - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) - && !DECL_INLINE (decl)) + /* Make a final check to see if this is a definition before we generate + RTL for an indirect reference. */ + if (!DECL_EXTERNAL (decl)) { - /* Don't warn about artificial methods. */ - if (!DECL_ARTIFICIAL (decl)) - warning ("%Jfunction '%D' is defined after prior declaration " - "as dllimport: attribute ignored", decl, decl); - return 0; - } - - /* We ignore the dllimport attribute for inline member functions. - This differs from MSVC behavior which treats it like GNUC - 'extern inline' extension. */ - else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) - { - if (extra_warnings) - warning ("%Jinline function '%D' is declared as dllimport: " - "attribute ignored.", decl, decl); - return 0; - } - - /* Don't allow definitions of static data members in dllimport class, - Just ignore attribute for vtable data. */ - else if (TREE_CODE (decl) == VAR_DECL - && TREE_STATIC (decl) && TREE_PUBLIC (decl) - && !DECL_EXTERNAL (decl) && context_imp) - { - if (!DECL_VIRTUAL_P (decl)) - error ("%Jdefinition of static data member '%D' of " - "dllimport'd class.", decl, decl); - return 0; - } - - /* Since we can't treat a pointer to a dllimport'd symbol as a - constant address, we turn off the attribute on C++ virtual - methods to allow creation of vtables using thunks. Don't mark - artificial methods either (in associated_type, only COMDAT - artificial method get import status from class context). */ - else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE - && (DECL_VIRTUAL_P (decl) || DECL_ARTIFICIAL (decl))) - return 0; - - return 1; + error ("%q+D: definition is marked as dllimport", decl); + DECL_DLLIMPORT_P (decl) = 0; + return false; + } + return true; } + /* The DECL_DLLIMPORT_P flag was set for decls in the class definition + by targetm.cxx.adjust_class_at_definition. Check again to emit + warnings if the class attribute has been overridden by an + out-of-class definition. */ + else if (associated_type (decl) + && lookup_attribute ("dllimport", + TYPE_ATTRIBUTES (associated_type (decl)))) + return i386_pe_type_dllimport_p (decl); - return 0; + return false; +} + +/* Handle the -mno-fun-dllimport target switch. */ +bool +i386_pe_valid_dllimport_attribute_p (tree decl) +{ + if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL) + return false; + return true; } /* Return nonzero if SYMBOL is marked as being dllexport'd. */ @@ -307,7 +196,7 @@ i386_pe_dllimport_name_p (const char *symbol) } /* Mark a DECL as being dllexport'd. - Note that we override the previous setting (eg: dllimport). */ + Note that we override the previous setting (e.g.: dllimport). */ static void i386_pe_mark_dllexport (tree decl) @@ -315,23 +204,20 @@ i386_pe_mark_dllexport (tree decl) const char *oldname; char *newname; rtx rtlname; + rtx symref; tree idp; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (i386_pe_dllimport_name_p (oldname)) { - warning ("%Jinconsistent dll linkage for '%D', dllexport assumed.", - decl, decl); + warning (0, "inconsistent dll linkage for %q+D, dllexport assumed", + decl); /* Remove DLL_IMPORT_PREFIX. */ oldname += strlen (DLL_IMPORT_PREFIX); - DECL_NON_ADDR_CONST_P (decl) = 0; } else if (i386_pe_dllexport_name_p (oldname)) return; /* already done */ @@ -345,8 +231,9 @@ i386_pe_mark_dllexport (tree decl) identical. */ idp = get_identifier (newname); - XEXP (DECL_RTL (decl), 0) = - gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); + symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); + SET_SYMBOL_REF_DECL (symref, decl); + XEXP (DECL_RTL (decl), 0) = symref; } /* Mark a DECL as being dllimport'd. */ @@ -358,30 +245,25 @@ i386_pe_mark_dllimport (tree decl) char *newname; tree idp; rtx rtlname, newrtl; + rtx symref; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (i386_pe_dllexport_name_p (oldname)) { - error ("`%s' declared as both exported to and imported from a DLL", + error ("%qs declared as both exported to and imported from a DLL", IDENTIFIER_POINTER (DECL_NAME (decl))); return; } else if (i386_pe_dllimport_name_p (oldname)) { - /* Already done, but do a sanity check to prevent assembler errors. */ - if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) - { - error ("%Jfailure in redeclaration of '%D': dllimport'd " - "symbol lacks external linkage.", decl, decl); - abort(); - } + /* Already done, but do a sanity check to prevent assembler + errors. */ + gcc_assert (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl) + && DECL_DLLIMPORT_P (decl)); return; } @@ -394,93 +276,65 @@ i386_pe_mark_dllimport (tree decl) identical. */ idp = get_identifier (newname); - newrtl = gen_rtx (MEM, Pmode, - gen_rtx (SYMBOL_REF, Pmode, - IDENTIFIER_POINTER (idp))); + symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); + SET_SYMBOL_REF_DECL (symref, decl); + newrtl = gen_rtx_MEM (Pmode,symref); XEXP (DECL_RTL (decl), 0) = newrtl; - /* Can't treat a pointer to this as a constant address */ - DECL_NON_ADDR_CONST_P (decl) = 1; -} - -/* Return string which is the former assembler name modified with a - prefix consisting of FASTCALL_PREFIX and a suffix consisting of an - atsign (@) followed by the number of bytes of arguments. */ - -static const char * -gen_fastcall_suffix (tree decl) -{ - int total = 0; - const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - char *newsym; - - if (TYPE_ARG_TYPES (TREE_TYPE (decl))) - if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) - == void_type_node) - { - tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); - - /* Quit if we hit an incomplete type. Error is reported - by convert_arguments in c-typeck.c or cp/typeck.c. */ - while (TREE_VALUE (formal_type) != void_type_node - && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) - { - int parm_size - = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); - /* Must round up to include padding. This is done the same - way as in store_one_arg. */ - parm_size = ((parm_size + PARM_BOUNDARY - 1) - / PARM_BOUNDARY * PARM_BOUNDARY); - total += parm_size; - formal_type = TREE_CHAIN (formal_type); - } - } - - /* Assume max of 8 base 10 digits in the suffix. */ - newsym = xmalloc (1 + strlen (asmname) + 1 + 8 + 1); - sprintf (newsym, "%c%s@%d", FASTCALL_PREFIX, asmname, total/BITS_PER_UNIT); - return IDENTIFIER_POINTER (get_identifier (newsym)); + DECL_DLLIMPORT_P (decl) = 1; } /* Return string which is the former assembler name modified with a suffix consisting of an atsign (@) followed by the number of bytes of - arguments */ + arguments. If FASTCALL is true, also add the FASTCALL_PREFIX. */ -static const char * -gen_stdcall_suffix (tree decl) +static tree +gen_stdcall_or_fastcall_suffix (tree decl, bool fastcall) { int total = 0; /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead of DECL_ASSEMBLER_NAME. */ - const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); char *newsym; + char *p; + tree formal_type; - if (TYPE_ARG_TYPES (TREE_TYPE (decl))) - if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) - == void_type_node) - { - tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + /* Do not change the identifier if a verbatim asmspec or already done. */ + if (*asmname == '*' || strchr (asmname, '@')) + return DECL_ASSEMBLER_NAME (decl); - /* Quit if we hit an incomplete type. Error is reported - by convert_arguments in c-typeck.c or cp/typeck.c. */ - while (TREE_VALUE (formal_type) != void_type_node - && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) - { - int parm_size - = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); + if (formal_type != NULL_TREE) + { + /* These attributes are ignored for variadic functions in + i386.c:ix86_return_pops_args. For compatibility with MS + compiler do not add @0 suffix here. */ + if (TREE_VALUE (tree_last (formal_type)) != void_type_node) + return DECL_ASSEMBLER_NAME (decl); + + /* Quit if we hit an incomplete type. Error is reported + by convert_arguments in c-typeck.c or cp/typeck.c. */ + while (TREE_VALUE (formal_type) != void_type_node + && COMPLETE_TYPE_P (TREE_VALUE (formal_type))) + { + int parm_size + = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); /* Must round up to include padding. This is done the same way as in store_one_arg. */ - parm_size = ((parm_size + PARM_BOUNDARY - 1) - / PARM_BOUNDARY * PARM_BOUNDARY); - total += parm_size; - formal_type = TREE_CHAIN (formal_type); - } - } + parm_size = ((parm_size + PARM_BOUNDARY - 1) + / PARM_BOUNDARY * PARM_BOUNDARY); + total += parm_size; + formal_type = TREE_CHAIN (formal_type);\ + } + } /* Assume max of 8 base 10 digits in the suffix. */ - newsym = xmalloc (strlen (asmname) + 1 + 8 + 1); - sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT); - return IDENTIFIER_POINTER (get_identifier (newsym)); + newsym = alloca (1 + strlen (asmname) + 1 + 8 + 1); + p = newsym; + if (fastcall) + *p++ = FASTCALL_PREFIX; + sprintf (p, "%s@%d", asmname, total/BITS_PER_UNIT); + return get_identifier (newsym); } void @@ -488,58 +342,65 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first) { default_encode_section_info (decl, rtl, first); - if (TREE_CODE (decl) == FUNCTION_DECL) + if (first && TREE_CODE (decl) == FUNCTION_DECL) { - if (lookup_attribute ("stdcall", - TYPE_ATTRIBUTES (TREE_TYPE (decl)))) - XEXP (DECL_RTL (decl), 0) = - gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (decl)); - else if (lookup_attribute ("fastcall", - TYPE_ATTRIBUTES (TREE_TYPE (decl)))) - XEXP (DECL_RTL (decl), 0) = - gen_rtx (SYMBOL_REF, Pmode, gen_fastcall_suffix (decl)); + tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl)); + tree newid = NULL_TREE; + + if (lookup_attribute ("stdcall", type_attributes)) + newid = gen_stdcall_or_fastcall_suffix (decl, false); + else if (lookup_attribute ("fastcall", type_attributes)) + newid = gen_stdcall_or_fastcall_suffix (decl, true); + if (newid != NULL_TREE) + { + rtx rtlname = XEXP (rtl, 0); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + XSTR (rtlname, 0) = IDENTIFIER_POINTER (newid); + /* These attributes must be present on first declaration, + change_decl_assembler_name will warn if they are added + later and the decl has been referenced, but duplicate_decls + should catch the mismatch before this is called. */ + change_decl_assembler_name (decl, newid); + } + } + + else if (TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("selectany", DECL_ATTRIBUTES (decl))) + { + if (DECL_INITIAL (decl) + /* If an object is initialized with a ctor, the static + initialization and destruction code for it is present in + each unit defining the object. The code that calls the + ctor is protected by a link-once guard variable, so that + the object still has link-once semantics, */ + || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) + make_decl_one_only (decl); + else + error ("%q+D:'selectany' attribute applies only to initialized objects", + decl); } /* Mark the decl so we can tell from the rtl whether the object is - dllexport'd or dllimport'd. This also handles dllexport/dllimport - override semantics. */ + dllexport'd or dllimport'd. tree.c: merge_dllimport_decl_attributes + handles dllexport/dllimport override semantics. */ if (i386_pe_dllexport_p (decl)) i386_pe_mark_dllexport (decl); else if (i386_pe_dllimport_p (decl)) i386_pe_mark_dllimport (decl); - /* It might be that DECL has already been marked as dllimport, but a - subsequent definition nullified that. The attribute is gone but - DECL_RTL still has (DLL_IMPORT_PREFIX) prefixed. We need to remove - that. Ditto for the DECL_NON_ADDR_CONST_P flag. */ - else if ((TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == VAR_DECL) - && DECL_RTL (decl) != NULL_RTX - && GET_CODE (DECL_RTL (decl)) == MEM - && GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM - && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF - && i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0))) - { - const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0); - - /* Remove DLL_IMPORT_PREFIX. */ - tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX)); - rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); - - if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl)) - warning ("%J'%D' defined locally after being " - "referenced with dllimport linkage", decl, decl); - else - warning ("%J'%D' redeclared without dllimport attribute " - "after being referenced with dllimport linkage", decl, decl); - - XEXP (DECL_RTL (decl), 0) = newrtl; - - DECL_NON_ADDR_CONST_P (decl) = 0; - - /* We previously set TREE_PUBLIC and DECL_EXTERNAL. - We leave these alone for now. */ - } + /* It might be that DECL has been declared as dllimport, but a + subsequent definition nullified that. Assert that + tree.c: merge_dllimport_decl_attributes has removed the attribute + before the RTL name was marked with the DLL_IMPORT_PREFIX. */ + else + gcc_assert (!((TREE_CODE (decl) == FUNCTION_DECL + || TREE_CODE (decl) == VAR_DECL) + && rtl != NULL_RTX + && GET_CODE (rtl) == MEM + && GET_CODE (XEXP (rtl, 0)) == MEM + && GET_CODE (XEXP (XEXP (rtl, 0), 0)) == SYMBOL_REF + && i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (rtl, 0), 0), 0)))); } /* Strip only the leading encoding, leaving the stdcall suffix and fastcall @@ -559,7 +420,7 @@ i386_pe_strip_name_encoding (const char *str) return str; } -/* Also strip the stdcall suffix. */ +/* Also strip the fastcall prefix and stdcall suffix. */ const char * i386_pe_strip_name_encoding_full (const char *str) @@ -567,6 +428,11 @@ i386_pe_strip_name_encoding_full (const char *str) const char *p; const char *name = i386_pe_strip_name_encoding (str); + /* Strip leading '@' on fastcall symbols. */ + if (*name == '@') + name++; + + /* Strip trailing "@n". */ p = strchr (name, '@'); if (p) return ggc_alloc_string (name, p - name); @@ -598,9 +464,9 @@ void i386_pe_output_labelref (FILE *stream, const char *name) } } else if ((name[0] == FASTCALL_PREFIX) - || (strncmp (name, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX) + || (strncmp (name, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX)) == 0 - && name[strlen (DLL_EXPORT_PREFIX)] == FASTCALL_PREFIX))) + && name[strlen (DLL_EXPORT_PREFIX)] == FASTCALL_PREFIX)) /* A fastcall symbol. */ { fprintf (stream, "%s", @@ -668,7 +534,7 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) unsigned int **slot; /* The names we put in the hashtable will always be the unique - versions gived to us by the stringtable, so we can just use + versions given to us by the stringtable, so we can just use their addresses as the keys. */ if (!htab) htab = htab_create (31, htab_hash_pointer, htab_eq_pointer, NULL); @@ -699,14 +565,15 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) else { if (decl && **slot != flags) - error ("%J'%D' causes a section type conflict", decl, decl); + error ("%q+D causes a section type conflict", decl); } return flags; } void -i386_pe_asm_named_section (const char *name, unsigned int flags) +i386_pe_asm_named_section (const char *name, unsigned int flags, + tree decl) { char flagchars[8], *f = flagchars; @@ -733,10 +600,16 @@ i386_pe_asm_named_section (const char *name, unsigned int flags) if (flags & SECTION_LINKONCE) { /* Functions may have been compiled at various levels of - optimization so we can't use `same_size' here. - Instead, have the linker pick one. */ + optimization so we can't use `same_size' here. + Instead, have the linker pick one, without warning. + If 'selectany' attribute has been specified, MS compiler + sets 'discard' characteristic, rather than telling linker + to warn of size or content mismatch, so do the same. */ + bool discard = (flags & SECTION_CODE) + || lookup_attribute ("selectany", + DECL_ATTRIBUTES (decl)); fprintf (asm_out_file, "\t.linkonce %s\n", - (flags & SECTION_CODE ? "discard" : "same_size")); + (discard ? "discard" : "same_size")); } } @@ -764,13 +637,14 @@ i386_pe_declare_function_type (FILE *file, const char *name, int public) /* Keep a list of external functions. */ -struct extern_list +struct extern_list GTY(()) { struct extern_list *next; + tree decl; const char *name; }; -static struct extern_list *extern_head; +static GTY(()) struct extern_list *extern_head; /* Assemble an external function reference. We need to keep a list of these, so that we can output the function types at the end of the @@ -779,26 +653,27 @@ static struct extern_list *extern_head; for it then. */ void -i386_pe_record_external_function (const char *name) +i386_pe_record_external_function (tree decl, const char *name) { struct extern_list *p; - p = (struct extern_list *) xmalloc (sizeof *p); + p = (struct extern_list *) ggc_alloc (sizeof *p); p->next = extern_head; + p->decl = decl; p->name = name; extern_head = p; } /* Keep a list of exported symbols. */ -struct export_list +struct export_list GTY(()) { struct export_list *next; const char *name; int is_data; /* used to type tag exported symbols. */ }; -static struct export_list *export_head; +static GTY(()) struct export_list *export_head; /* Assemble an export symbol entry. We need to keep a list of these, so that we can output the export list at the end of the @@ -811,7 +686,7 @@ i386_pe_record_exported_symbol (const char *name, int is_data) { struct export_list *p; - p = (struct export_list *) xmalloc (sizeof *p); + p = (struct export_list *) ggc_alloc (sizeof *p); p->next = export_head; p->name = name; p->is_data = is_data; @@ -833,10 +708,11 @@ i386_pe_file_end (void) { tree decl; - decl = get_identifier (p->name); + decl = p->decl; /* Positively ensure only one declaration for any given symbol. */ - if (! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl)) + if (! TREE_ASM_WRITTEN (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) { TREE_ASM_WRITTEN (decl) = 1; i386_pe_declare_function_type (asm_out_file, p->name, @@ -856,3 +732,5 @@ i386_pe_file_end (void) } } } + +#include "gt-winnt.h" diff --git a/contrib/gcc/config/i386/x-cygwin b/contrib/gcc/config/i386/x-cygwin new file mode 100644 index 00000000000..cfd7758cfb3 --- /dev/null +++ b/contrib/gcc/config/i386/x-cygwin @@ -0,0 +1,4 @@ +host-cygwin.o : $(srcdir)/config/i386/host-cygwin.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h diagnostic.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/host-cygwin.c diff --git a/contrib/gcc/config/i386/x-darwin b/contrib/gcc/config/i386/x-darwin new file mode 100644 index 00000000000..9a3b0f262ce --- /dev/null +++ b/contrib/gcc/config/i386/x-darwin @@ -0,0 +1,4 @@ +host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c \ + $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) \ + config/host-darwin.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/contrib/gcc/config/i386/x-i386 b/contrib/gcc/config/i386/x-i386 new file mode 100644 index 00000000000..e156bcde3c9 --- /dev/null +++ b/contrib/gcc/config/i386/x-i386 @@ -0,0 +1,3 @@ +driver-i386.o : $(srcdir)/config/i386/driver-i386.c \ + $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/contrib/gcc/config/i386/x-mingw32 b/contrib/gcc/config/i386/x-mingw32 index 04593aa727f..7ae61522a56 100644 --- a/contrib/gcc/config/i386/x-mingw32 +++ b/contrib/gcc/config/i386/x-mingw32 @@ -2,3 +2,12 @@ # Make local_includedir relative to EXEC_PREFIX # local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include + +# On MinGW, we use "%IA64d" to print 64-bit integers, and the format-checking +# code does not handle that, so we have to disable checking here. +WERROR_FLAGS += -Wno-format + +host-mingw32.o : $(srcdir)/config/i386/host-mingw32.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/host-mingw32.c diff --git a/contrib/gcc/config/i386/x86-64.h b/contrib/gcc/config/i386/x86-64.h index 16b06331b98..cb92a21f652 100644 --- a/contrib/gcc/config/i386/x86-64.h +++ b/contrib/gcc/config/i386/x86-64.h @@ -1,5 +1,5 @@ /* OS independent definitions for AMD x86-64. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2005 Free Software Foundation, Inc. Contributed by Bo Thorsen . This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef ASM_COMMENT_START #define ASM_COMMENT_START "#" @@ -49,13 +49,19 @@ Boston, MA 02111-1307, USA. */ #undef ASM_SPEC #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ - %{Wa,*:%*} %{m32:--32}" + %{Wa,*:%*} %{m32:--32} %{m64:--64}" +#undef ASM_OUTPUT_ALIGNED_BSS #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ - asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) + x86_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) + +#undef ASM_OUTPUT_ALIGNED_COMMON +#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ + x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN); /* This is used to align code labels according to Intel recommendations. */ +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ do { \ if ((LOG) != 0) { \ @@ -63,6 +69,7 @@ Boston, MA 02111-1307, USA. */ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ } \ } while (0) +#endif /* i386 System V Release 4 uses DWARF debugging info. @@ -70,9 +77,12 @@ Boston, MA 02111-1307, USA. */ #define DWARF2_DEBUGGING_INFO 1 #define DWARF2_UNWIND_INFO 1 -/* Incorrectly autodetected in cross compilation. */ -#undef HAVE_AS_DWARF2_DEBUG_LINE -#define HAVE_AS_DWARF2_DEBUG_LINE 1 #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +#undef TARGET_ASM_SELECT_SECTION +#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section + +#undef TARGET_ASM_UNIQUE_SECTION +#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section diff --git a/contrib/gcc/config/i386/xm-cygwin.h b/contrib/gcc/config/i386/xm-cygwin.h index 1ecb00cfbe1..c3d6a2cf3ea 100644 --- a/contrib/gcc/config/i386/xm-cygwin.h +++ b/contrib/gcc/config/i386/xm-cygwin.h @@ -16,7 +16,7 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define HOST_EXECUTABLE_SUFFIX ".exe" diff --git a/contrib/gcc/config/i386/xm-djgpp.h b/contrib/gcc/config/i386/xm-djgpp.h index 9bb520da8ef..a93befcad76 100644 --- a/contrib/gcc/config/i386/xm-djgpp.h +++ b/contrib/gcc/config/i386/xm-djgpp.h @@ -1,5 +1,6 @@ /* Configuration for GCC for Intel 80386 running DJGPP. - Copyright (C) 1988, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1988, 1996, 1998, 1999, 2000, 2001, 2004 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Use semicolons to separate elements of a path. */ #define PATH_SEPARATOR ';' diff --git a/contrib/gcc/config/i386/xm-mingw32.h b/contrib/gcc/config/i386/xm-mingw32.h index 888196697be..053947ec8f0 100644 --- a/contrib/gcc/config/i386/xm-mingw32.h +++ b/contrib/gcc/config/i386/xm-mingw32.h @@ -17,8 +17,8 @@ for more details. 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. */ #define HOST_EXECUTABLE_SUFFIX ".exe" @@ -27,3 +27,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* This is the name of the null device on windows. */ #define HOST_BIT_BUCKET "nul" + +/* The st_ino field of struct stat is always 0. */ +#define HOST_LACKS_INODE_NUMBERS + +/* MSVCRT does not support the "ll" format specifier for printing + "long long" values. Instead, we use "I64". */ +#define HOST_LONG_LONG_FORMAT "I64" diff --git a/contrib/gcc/config/i386/xmmintrin.h b/contrib/gcc/config/i386/xmmintrin.h index 921806f706a..87ec195e8ca 100644 --- a/contrib/gcc/config/i386/xmmintrin.h +++ b/contrib/gcc/config/i386/xmmintrin.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. @@ -14,8 +15,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -25,7 +26,7 @@ Public License. */ /* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 8.0. */ + User Guide and Reference, version 9.0. */ #ifndef _XMMINTRIN_H_INCLUDED #define _XMMINTRIN_H_INCLUDED @@ -37,11 +38,15 @@ /* We need type definitions from the MMX header file. */ #include -/* The data type intended for user use. */ -typedef float __m128 __attribute__ ((__mode__(__V4SF__))); +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); /* Internal data types for implementing the intrinsics. */ -typedef float __v4sf __attribute__ ((__mode__(__V4SF__))); +typedef float __v4sf __attribute__ ((__vector_size__ (16))); /* Create a selector for use with the SHUFPS instruction. */ #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ @@ -83,59 +88,66 @@ enum _mm_hint #define _MM_FLUSH_ZERO_ON 0x8000 #define _MM_FLUSH_ZERO_OFF 0x0000 +/* Create a vector of zeros. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setzero_ps (void) +{ + return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f }; +} + /* Perform the respective operation on the lower SPFP (single-precision floating-point) values of A and B; the upper three SPFP values are passed through from A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_add_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_sub_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_mul_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_div_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_sqrt_ss (__m128 __A) { return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_rcp_ss (__m128 __A) { return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_rsqrt_ss (__m128 __A) { return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_min_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_max_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); @@ -143,55 +155,55 @@ _mm_max_ss (__m128 __A, __m128 __B) /* Perform the respective operation on the four SPFP values in A and B. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_add_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_sub_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_mul_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_div_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_sqrt_ps (__m128 __A) { return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_rcp_ps (__m128 __A) { return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_rsqrt_ps (__m128 __A) { return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_min_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_max_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); @@ -199,25 +211,25 @@ _mm_max_ps (__m128 __A, __m128 __B) /* Perform logical bit-wise operations on 128-bit values. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_and_ps (__m128 __A, __m128 __B) { return __builtin_ia32_andps (__A, __B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_andnot_ps (__m128 __A, __m128 __B) { return __builtin_ia32_andnps (__A, __B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_or_ps (__m128 __A, __m128 __B) { return __builtin_ia32_orps (__A, __B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_xor_ps (__m128 __A, __m128 __B) { return __builtin_ia32_xorps (__A, __B); @@ -227,25 +239,25 @@ _mm_xor_ps (__m128 __A, __m128 __B) comparison is true, place a mask of all ones in the result, otherwise a mask of zeros. The upper three SPFP values are passed through from A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpeq_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmplt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmple_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpgt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, @@ -255,7 +267,7 @@ _mm_cmpgt_ss (__m128 __A, __m128 __B) __A)); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpge_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, @@ -265,25 +277,25 @@ _mm_cmpge_ss (__m128 __A, __m128 __B) __A)); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpneq_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnlt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnle_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpngt_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, @@ -293,7 +305,7 @@ _mm_cmpngt_ss (__m128 __A, __m128 __B) __A)); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnge_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf) __A, @@ -303,13 +315,13 @@ _mm_cmpnge_ss (__m128 __A, __m128 __B) __A)); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpord_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpunord_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); @@ -319,73 +331,73 @@ _mm_cmpunord_ss (__m128 __A, __m128 __B) element, if the comparison is true, place a mask of all ones in the result, otherwise a mask of zeros. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpeq_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmplt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmple_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpgt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpge_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpneq_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnlt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnle_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpngt_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpnge_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpord_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cmpunord_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); @@ -394,73 +406,73 @@ _mm_cmpunord_ps (__m128 __A, __m128 __B) /* Compare the lower SPFP values of A and B and return 1 if true and 0 if false. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comieq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comilt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comile_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comigt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comige_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_comineq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomieq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomilt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomile_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomigt_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomige_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_ucomineq_ss (__m128 __A, __m128 __B) { return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); @@ -468,22 +480,31 @@ _mm_ucomineq_ss (__m128 __A, __m128 __B) /* Convert the lower SPFP value to a 32-bit integer according to the current rounding mode. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvtss_si32 (__m128 __A) { return __builtin_ia32_cvtss2si ((__v4sf) __A); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvt_ss2si (__m128 __A) { return _mm_cvtss_si32 (__A); } #ifdef __x86_64__ -/* Convert the lower SPFP value to a 32-bit integer according to the current - rounding mode. */ -static __inline long long +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64 (__m128 __A) +{ + return __builtin_ia32_cvtss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) _mm_cvtss_si64x (__m128 __A) { return __builtin_ia32_cvtss2si64 ((__v4sf) __A); @@ -492,26 +513,26 @@ _mm_cvtss_si64x (__m128 __A) /* Convert the two lower SPFP values to 32-bit integers according to the current rounding mode. Return the integers in packed form. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtps_pi32 (__m128 __A) { return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvt_ps2pi (__m128 __A) { return _mm_cvtps_pi32 (__A); } /* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvttss_si32 (__m128 __A) { return __builtin_ia32_cvttss2si ((__v4sf) __A); } -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_cvtt_ss2si (__m128 __A) { return _mm_cvttss_si32 (__A); @@ -519,7 +540,16 @@ _mm_cvtt_ss2si (__m128 __A) #ifdef __x86_64__ /* Truncate the lower SPFP value to a 32-bit integer. */ -static __inline long long + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64 (__m128 __A) +{ + return __builtin_ia32_cvttss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) _mm_cvttss_si64x (__m128 __A) { return __builtin_ia32_cvttss2si64 ((__v4sf) __A); @@ -528,26 +558,26 @@ _mm_cvttss_si64x (__m128 __A) /* Truncate the two lower SPFP values to 32-bit integers. Return the integers in packed form. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvttps_pi32 (__m128 __A) { return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtt_ps2pi (__m128 __A) { return _mm_cvttps_pi32 (__A); } /* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtsi32_ss (__m128 __A, int __B) { return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvt_si2ss (__m128 __A, int __B) { return _mm_cvtsi32_ss (__A, __B); @@ -555,7 +585,16 @@ _mm_cvt_si2ss (__m128 __A, int __B) #ifdef __x86_64__ /* Convert B to a SPFP value and insert it as element zero in A. */ -static __inline __m128 + +/* Intel intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +{ + return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); +} + +/* Microsoft intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtsi64x_ss (__m128 __A, long long __B) { return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); @@ -564,20 +603,20 @@ _mm_cvtsi64x_ss (__m128 __A, long long __B) /* Convert the two 32-bit values in B to SPFP form and insert them as the two lower elements in A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpi32_ps (__m128 __A, __m64 __B) { return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvt_pi2ps (__m128 __A, __m64 __B) { return _mm_cvtpi32_ps (__A, __B); } /* Convert the four signed 16-bit values in A to SPFP form. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpi16_ps (__m64 __A) { __v4hi __sign; @@ -587,15 +626,14 @@ _mm_cvtpi16_ps (__m64 __A) /* This comparison against zero gives us a mask that can be used to fill in the missing sign bits in the unpack operations below, so that we get signed values after unpacking. */ - __sign = (__v4hi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtw (__sign, (__v4hi)__A); + __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A); /* Convert the four words to doublewords. */ __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); + __r = (__v4sf) _mm_setzero_ps (); __r = __builtin_ia32_cvtpi2ps (__r, __hisi); __r = __builtin_ia32_movlhps (__r, __r); __r = __builtin_ia32_cvtpi2ps (__r, __losi); @@ -604,19 +642,18 @@ _mm_cvtpi16_ps (__m64 __A) } /* Convert the four unsigned 16-bit values in A to SPFP form. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpu16_ps (__m64 __A) { - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); __v2si __hisi, __losi; __v4sf __r; /* Convert the four words to doublewords. */ - __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __zero); - __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __zero); + __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL); + __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL); /* Convert the doublewords to floating point two at a time. */ - __r = (__v4sf) __builtin_ia32_setzerops (); + __r = (__v4sf) _mm_setzero_ps (); __r = __builtin_ia32_cvtpi2ps (__r, __hisi); __r = __builtin_ia32_movlhps (__r, __r); __r = __builtin_ia32_cvtpi2ps (__r, __losi); @@ -625,7 +662,7 @@ _mm_cvtpu16_ps (__m64 __A) } /* Convert the low four signed 8-bit values in A to SPFP form. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpi8_ps (__m64 __A) { __v8qi __sign; @@ -633,8 +670,7 @@ _mm_cvtpi8_ps (__m64 __A) /* This comparison against zero gives us a mask that can be used to fill in the missing sign bits in the unpack operations below, so that we get signed values after unpacking. */ - __sign = (__v8qi) __builtin_ia32_mmx_zero (); - __sign = __builtin_ia32_pcmpgtb (__sign, (__v8qi)__A); + __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A); /* Convert the four low bytes to words. */ __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); @@ -643,26 +679,25 @@ _mm_cvtpi8_ps (__m64 __A) } /* Convert the low four unsigned 8-bit values in A to SPFP form. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpu8_ps(__m64 __A) { - __v8qi __zero = (__v8qi) __builtin_ia32_mmx_zero (); - __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __zero); + __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL); return _mm_cvtpu16_ps(__A); } /* Convert the four signed 32-bit values in A and B to SPFP form. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_cvtpi32x2_ps(__m64 __A, __m64 __B) { - __v4sf __zero = (__v4sf) __builtin_ia32_setzerops (); + __v4sf __zero = (__v4sf) _mm_setzero_ps (); __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); __v4sf __sfb = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__B); return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); } /* Convert the four SPFP values in A to four signed 16-bit integers. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtps_pi16(__m128 __A) { __v4sf __hisf = (__v4sf)__A; @@ -673,17 +708,16 @@ _mm_cvtps_pi16(__m128 __A) } /* Convert the four SPFP values in A to four signed 8-bit integers. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_cvtps_pi8(__m128 __A) { __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); - __v4hi __zero = (__v4hi) __builtin_ia32_mmx_zero (); - return (__m64) __builtin_ia32_packsswb (__tmp, __zero); + return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL); } /* Selects four specific SPFP values from A and B based on MASK. */ #if 0 -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) { return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); @@ -695,14 +729,14 @@ _mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) /* Selects and interleaves the upper two SPFP values from A and B. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_unpackhi_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); } /* Selects and interleaves the lower two SPFP values from A and B. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_unpacklo_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); @@ -710,28 +744,28 @@ _mm_unpacklo_ps (__m128 __A, __m128 __B) /* Sets the upper two SPFP values with 64-bits of data loaded from P; the lower two values are passed through from A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_loadh_pi (__m128 __A, __m64 const *__P) { return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (__v2si *)__P); } /* Stores the upper two SPFP values of A into P. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storeh_pi (__m64 *__P, __m128 __A) { __builtin_ia32_storehps ((__v2si *)__P, (__v4sf)__A); } /* Moves the upper two values of B into the lower two values of A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_movehl_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); } /* Moves the lower two values of B into the upper two values of A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_movelh_ps (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); @@ -739,222 +773,219 @@ _mm_movelh_ps (__m128 __A, __m128 __B) /* Sets the lower two SPFP values with 64-bits of data loaded from P; the upper two values are passed through from A. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_loadl_pi (__m128 __A, __m64 const *__P) { return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (__v2si *)__P); } /* Stores the lower two SPFP values of A into P. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storel_pi (__m64 *__P, __m128 __A) { __builtin_ia32_storelps ((__v2si *)__P, (__v4sf)__A); } /* Creates a 4-bit mask from the most significant bits of the SPFP values. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_movemask_ps (__m128 __A) { return __builtin_ia32_movmskps ((__v4sf)__A); } /* Return the contents of the control register. */ -static __inline unsigned int +static __inline unsigned int __attribute__((__always_inline__)) _mm_getcsr (void) { return __builtin_ia32_stmxcsr (); } /* Read exception bits from the control register. */ -static __inline unsigned int +static __inline unsigned int __attribute__((__always_inline__)) _MM_GET_EXCEPTION_STATE (void) { return _mm_getcsr() & _MM_EXCEPT_MASK; } -static __inline unsigned int +static __inline unsigned int __attribute__((__always_inline__)) _MM_GET_EXCEPTION_MASK (void) { return _mm_getcsr() & _MM_MASK_MASK; } -static __inline unsigned int +static __inline unsigned int __attribute__((__always_inline__)) _MM_GET_ROUNDING_MODE (void) { return _mm_getcsr() & _MM_ROUND_MASK; } -static __inline unsigned int +static __inline unsigned int __attribute__((__always_inline__)) _MM_GET_FLUSH_ZERO_MODE (void) { return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; } /* Set the control register to I. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_setcsr (unsigned int __I) { __builtin_ia32_ldmxcsr (__I); } /* Set exception bits in the control register. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _MM_SET_EXCEPTION_STATE(unsigned int __mask) { _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); } -static __inline void +static __inline void __attribute__((__always_inline__)) _MM_SET_EXCEPTION_MASK (unsigned int __mask) { _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); } -static __inline void +static __inline void __attribute__((__always_inline__)) _MM_SET_ROUNDING_MODE (unsigned int __mode) { _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); } -static __inline void +static __inline void __attribute__((__always_inline__)) _MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) { _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); } +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ss (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, 0, 0, 0 }; +} + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set1_ps (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F }; +} + +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps1 (float __F) +{ + return _mm_set1_ps (__F); +} + /* Create a vector with element 0 as *P and the rest zero. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_load_ss (float const *__P) { - return (__m128) __builtin_ia32_loadss (__P); + return _mm_set_ss (*__P); } /* Create a vector with all four elements equal to *P. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_load1_ps (float const *__P) { - __v4sf __tmp = __builtin_ia32_loadss (__P); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); + return _mm_set1_ps (*__P); } -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_load_ps1 (float const *__P) { return _mm_load1_ps (__P); } /* Load four SPFP values from P. The address must be 16-byte aligned. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_load_ps (float const *__P) { - return (__m128) __builtin_ia32_loadaps (__P); + return (__m128) *(__v4sf *)__P; } /* Load four SPFP values from P. The address need not be 16-byte aligned. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_loadu_ps (float const *__P) { return (__m128) __builtin_ia32_loadups (__P); } /* Load four SPFP values in reverse order. The address must be aligned. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_loadr_ps (float const *__P) { - __v4sf __tmp = __builtin_ia32_loadaps (__P); + __v4sf __tmp = *(__v4sf *)__P; return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); } -/* Create a vector with element 0 as F and the rest zero. */ -static __inline __m128 -_mm_set_ss (float __F) -{ - return (__m128) __builtin_ia32_loadss (&__F); -} - -/* Create a vector with all four elements equal to F. */ -static __inline __m128 -_mm_set1_ps (float __F) -{ - __v4sf __tmp = __builtin_ia32_loadss (&__F); - return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,0,0,0)); -} - -static __inline __m128 -_mm_set_ps1 (float __F) -{ - return _mm_set1_ps (__F); -} - /* Create the vector [Z Y X W]. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) { - return (__v4sf) {__W, __X, __Y, __Z}; + return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z }; } /* Create the vector [W X Y Z]. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_setr_ps (float __Z, float __Y, float __X, float __W) { - return _mm_set_ps (__W, __X, __Y, __Z); -} - -/* Create a vector of zeros. */ -static __inline __m128 -_mm_setzero_ps (void) -{ - return (__m128) __builtin_ia32_setzerops (); + return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W }; } /* Stores the lower SPFP value. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_store_ss (float *__P, __m128 __A) { - __builtin_ia32_storess (__P, (__v4sf)__A); + *__P = __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); } -/* Store the lower SPFP value across four words. */ -static __inline void -_mm_store1_ps (float *__P, __m128 __A) +static __inline float __attribute__((__always_inline__)) +_mm_cvtss_f32 (__m128 __A) { - __v4sf __va = (__v4sf)__A; - __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); - __builtin_ia32_storeaps (__P, __tmp); -} - -static __inline void -_mm_store_ps1 (float *__P, __m128 __A) -{ - _mm_store1_ps (__P, __A); + return __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); } /* Store four SPFP values. The address must be 16-byte aligned. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_store_ps (float *__P, __m128 __A) { - __builtin_ia32_storeaps (__P, (__v4sf)__A); + *(__v4sf *)__P = (__v4sf)__A; } /* Store four SPFP values. The address need not be 16-byte aligned. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storeu_ps (float *__P, __m128 __A) { __builtin_ia32_storeups (__P, (__v4sf)__A); } +/* Store the lower SPFP value across four words. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_ps (float *__P, __m128 __A) +{ + __v4sf __va = (__v4sf)__A; + __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); + _mm_storeu_ps (__P, __tmp); +} + +static __inline void __attribute__((__always_inline__)) +_mm_store_ps1 (float *__P, __m128 __A) +{ + _mm_store1_ps (__P, __A); +} + /* Store four SPFP values in reverse order. The address must be aligned. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_storer_ps (float *__P, __m128 __A) { __v4sf __va = (__v4sf)__A; __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); - __builtin_ia32_storeaps (__P, __tmp); + _mm_store_ps (__P, __tmp); } /* Sets the low SPFP value of A from the low value of B. */ -static __inline __m128 +static __inline __m128 __attribute__((__always_inline__)) _mm_move_ss (__m128 __A, __m128 __B) { return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B); @@ -962,103 +993,102 @@ _mm_move_ss (__m128 __A, __m128 __B) /* Extracts one of the four words of A. The selector N must be immediate. */ #if 0 -static __inline int -_mm_extract_pi16 (__m64 __A, int __N) +static __inline int __attribute__((__always_inline__)) +_mm_extract_pi16 (__m64 const __A, int const __N) { - return __builtin_ia32_pextrw ((__v4hi)__A, __N); + return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N); } -static __inline int -_m_pextrw (__m64 __A, int __N) +static __inline int __attribute__((__always_inline__)) +_m_pextrw (__m64 const __A, int const __N) { return _mm_extract_pi16 (__A, __N); } #else -#define _mm_extract_pi16(A, N) \ - __builtin_ia32_pextrw ((__v4hi)(A), (N)) +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) #define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) #endif /* Inserts word D into one of four words of A. The selector N must be immediate. */ #if 0 -static __inline __m64 -_mm_insert_pi16 (__m64 __A, int __D, int __N) +static __inline __m64 __attribute__((__always_inline__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) { - return (__m64)__builtin_ia32_pinsrw ((__v4hi)__A, __D, __N); + return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N); } -static __inline __m64 -_m_pinsrw (__m64 __A, int __D, int __N) +static __inline __m64 __attribute__((__always_inline__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) { return _mm_insert_pi16 (__A, __D, __N); } #else #define _mm_insert_pi16(A, D, N) \ - ((__m64) __builtin_ia32_pinsrw ((__v4hi)(A), (D), (N))) + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) #define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) #endif /* Compute the element-wise maximum of signed 16-bit values. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_max_pi16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmaxsw (__m64 __A, __m64 __B) { return _mm_max_pi16 (__A, __B); } /* Compute the element-wise maximum of unsigned 8-bit values. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_max_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmaxub (__m64 __A, __m64 __B) { return _mm_max_pu8 (__A, __B); } /* Compute the element-wise minimum of signed 16-bit values. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_min_pi16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pminsw (__m64 __A, __m64 __B) { return _mm_min_pi16 (__A, __B); } /* Compute the element-wise minimum of unsigned 8-bit values. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_min_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pminub (__m64 __A, __m64 __B) { return _mm_min_pu8 (__A, __B); } /* Create an 8-bit mask of the signs of 8-bit values. */ -static __inline int +static __inline int __attribute__((__always_inline__)) _mm_movemask_pi8 (__m64 __A) { return __builtin_ia32_pmovmskb ((__v8qi)__A); } -static __inline int +static __inline int __attribute__((__always_inline__)) _m_pmovmskb (__m64 __A) { return _mm_movemask_pi8 (__A); @@ -1066,13 +1096,13 @@ _m_pmovmskb (__m64 __A) /* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values in B and produce the high 16 bits of the 32-bit results. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_mulhi_pu16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pmulhuw (__m64 __A, __m64 __B) { return _mm_mulhi_pu16 (__A, __B); @@ -1081,13 +1111,13 @@ _m_pmulhuw (__m64 __A, __m64 __B) /* Return a combination of the four 16-bit values in A. The selector must be an immediate. */ #if 0 -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_shuffle_pi16 (__m64 __A, int __N) { return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pshufw (__m64 __A, int __N) { return _mm_shuffle_pi16 (__A, __N); @@ -1101,39 +1131,39 @@ _m_pshufw (__m64 __A, int __N) /* Conditionally store byte elements of A into P. The high bit of each byte in the selector N determines whether the corresponding byte from A is stored. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) { __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); } -static __inline void +static __inline void __attribute__((__always_inline__)) _m_maskmovq (__m64 __A, __m64 __N, char *__P) { _mm_maskmove_si64 (__A, __N, __P); } /* Compute the rounded averages of the unsigned 8-bit values in A and B. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_avg_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pavgb (__m64 __A, __m64 __B) { return _mm_avg_pu8 (__A, __B); } /* Compute the rounded averages of the unsigned 16-bit values in A and B. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_avg_pu16 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_pavgw (__m64 __A, __m64 __B) { return _mm_avg_pu16 (__A, __B); @@ -1142,13 +1172,13 @@ _m_pavgw (__m64 __A, __m64 __B) /* Compute the sum of the absolute differences of the unsigned 8-bit values in A and B. Return the value in the lower 16-bit word; the upper words are cleared. */ -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _mm_sad_pu8 (__m64 __A, __m64 __B) { return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); } -static __inline __m64 +static __inline __m64 __attribute__((__always_inline__)) _m_psadbw (__m64 __A, __m64 __B) { return _mm_sad_pu8 (__A, __B); @@ -1157,7 +1187,7 @@ _m_psadbw (__m64 __A, __m64 __B) /* Loads one cache line from address P to a location "closer" to the processor. The selector I specifies the type of prefetch operation. */ #if 0 -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_prefetch (void *__P, enum _mm_hint __I) { __builtin_prefetch (__P, 0, __I); @@ -1168,14 +1198,14 @@ _mm_prefetch (void *__P, enum _mm_hint __I) #endif /* Stores the data in A to the address P without polluting the caches. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_stream_pi (__m64 *__P, __m64 __A) { __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); } /* Likewise. The address must be 16-byte aligned. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_stream_ps (float *__P, __m128 __A) { __builtin_ia32_movntps (__P, (__v4sf)__A); @@ -1183,7 +1213,7 @@ _mm_stream_ps (float *__P, __m128 __A) /* Guarantees that every preceding store is globally visible before any subsequent store. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_sfence (void) { __builtin_ia32_sfence (); @@ -1192,7 +1222,7 @@ _mm_sfence (void) /* The execution of the next instruction is delayed by an implementation specific amount of time. The instruction does not modify the architectural state. */ -static __inline void +static __inline void __attribute__((__always_inline__)) _mm_pause (void) { __asm__ __volatile__ ("rep; nop" : : ); @@ -1202,14 +1232,14 @@ _mm_pause (void) #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ do { \ __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ - __v4sf __t0 = __builtin_ia32_shufps (__r0, __r1, 0x44); \ - __v4sf __t2 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \ - __v4sf __t1 = __builtin_ia32_shufps (__r2, __r3, 0x44); \ - __v4sf __t3 = __builtin_ia32_shufps (__r2, __r3, 0xEE); \ - (row0) = __builtin_ia32_shufps (__t0, __t1, 0x88); \ - (row1) = __builtin_ia32_shufps (__t0, __t1, 0xDD); \ - (row2) = __builtin_ia32_shufps (__t2, __t3, 0x88); \ - (row3) = __builtin_ia32_shufps (__t2, __t3, 0xDD); \ + __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \ + __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \ + __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \ + __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \ + (row0) = __builtin_ia32_movlhps (__t0, __t1); \ + (row1) = __builtin_ia32_movhlps (__t1, __t0); \ + (row2) = __builtin_ia32_movlhps (__t2, __t3); \ + (row3) = __builtin_ia32_movhlps (__t3, __t2); \ } while (0) /* For backward source compatibility. */ diff --git a/contrib/gcc/config/ia64/crtbegin.asm b/contrib/gcc/config/ia64/crtbegin.asm index 494def7fd81..e040916b14e 100644 --- a/contrib/gcc/config/ia64/crtbegin.asm +++ b/contrib/gcc/config/ia64/crtbegin.asm @@ -1,20 +1,29 @@ -/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. Contributed by Jes Sorensen, - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This file is part of GCC. - The GNU C Library is distributed in the hope that it will be useful, + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ #include "auto-host.h" diff --git a/contrib/gcc/config/ia64/crtend.asm b/contrib/gcc/config/ia64/crtend.asm index 8984d88f3d6..66eaa01b501 100644 --- a/contrib/gcc/config/ia64/crtend.asm +++ b/contrib/gcc/config/ia64/crtend.asm @@ -1,20 +1,29 @@ -/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. Contributed by Jes Sorensen, - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This file is part of GCC. - The GNU C Library is distributed in the hope that it will be useful, + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ #include "auto-host.h" diff --git a/contrib/gcc/config/ia64/crtfastmath.c b/contrib/gcc/config/ia64/crtfastmath.c index aa0d12021c7..e5b32cb5448 100644 --- a/contrib/gcc/config/ia64/crtfastmath.c +++ b/contrib/gcc/config/ia64/crtfastmath.c @@ -1,29 +1,29 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2005 Free Software Foundation, Inc. Contributed by David Mosberger . - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This file is part of GCC. - The GNU C Library is distributed in the hope that it will be useful, + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ -/* In addition to the permissions in the GNU General Public License, the - Free Software Foundation gives you unlimited permission to link the - compiled version of this file into combinations with other programs, - and to distribute those combinations without any restriction coming - from the use of this file. (The General Public License restrictions - do apply in other respects; for example, they cover modification of - the file, and distribution when not linked into a combine - executable.) */ +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ /* We could call fesetenv() here but that would create a confusing dependency on libm (since that is where fesetenv() gets defined. diff --git a/contrib/gcc/config/ia64/crti.asm b/contrib/gcc/config/ia64/crti.asm index 4b48e3d40e8..a2d1e1221cc 100644 --- a/contrib/gcc/config/ia64/crti.asm +++ b/contrib/gcc/config/ia64/crti.asm @@ -21,8 +21,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/ia64/crtn.asm b/contrib/gcc/config/ia64/crtn.asm index 48a9a03fdc6..52ec47c582e 100644 --- a/contrib/gcc/config/ia64/crtn.asm +++ b/contrib/gcc/config/ia64/crtn.asm @@ -21,8 +21,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/ia64/fde-glibc.c b/contrib/gcc/config/ia64/fde-glibc.c index 15e19270f03..7506c17c2de 100644 --- a/contrib/gcc/config/ia64/fde-glibc.c +++ b/contrib/gcc/config/ia64/fde-glibc.c @@ -15,8 +15,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, diff --git a/contrib/gcc/config/ia64/freebsd.h b/contrib/gcc/config/ia64/freebsd.h index d5977ff4661..23739105d50 100644 --- a/contrib/gcc/config/ia64/freebsd.h +++ b/contrib/gcc/config/ia64/freebsd.h @@ -16,7 +16,8 @@ GNU General Public License for more details. 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -24,7 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define LINK_SPEC " \ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ - %{Wl,*:%*} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ %{symbolic:-Bsymbolic} \ diff --git a/contrib/gcc/config/ia64/hpux.h b/contrib/gcc/config/ia64/hpux.h index 09fb53f44b0..996b7d21aa0 100644 --- a/contrib/gcc/config/ia64/hpux.h +++ b/contrib/gcc/config/ia64/hpux.h @@ -1,5 +1,6 @@ /* Definitions of target machine GNU compiler. IA-64 version. - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Steve Ellcey and Reva Cuthbertson @@ -17,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This macro is a C statement to print on `stderr' a string describing the particular machine description choice. */ @@ -29,6 +30,12 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_HPUX #define TARGET_HPUX 1 +#undef WCHAR_TYPE +#define WCHAR_TYPE "unsigned int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + /* Target OS builtins. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ @@ -46,6 +53,7 @@ do { \ builtin_define("_HPUX_SOURCE"); \ builtin_define("__STDC_EXT__"); \ builtin_define("__STDCPP__"); \ + builtin_define("_INCLUDE__STDC_A1_SOURCE"); \ } \ if (TARGET_ILP32) \ builtin_define("_ILP32"); \ @@ -64,11 +72,13 @@ do { \ #undef ENDFILE_SPEC #undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s}}" +#define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \ + %{mlp64:/usr/lib/hpux64/unix98%O%s} \ + %{!mlp64:/usr/lib/hpux32/unix98%O%s}}" #undef LINK_SPEC #define LINK_SPEC \ - "+Accept TypeMismatch \ + "-z +Accept TypeMismatch \ %{shared:-b} \ %{!shared: \ -u main \ @@ -84,11 +94,6 @@ do { \ %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \ %{!symbolic:-lc}}" -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "ilp32", MASK_ILP32, "Generate ILP32 code" }, \ - { "lp64", -MASK_ILP32, "Generate LP64 code" }, - #define MULTILIB_DEFAULTS { "milp32" } /* A C expression whose value is zero if pointers that need to be extended @@ -101,16 +106,11 @@ do { \ #define JMP_BUF_SIZE (8 * 76) #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32) +#define TARGET_DEFAULT \ + (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32) -/* This needs to be set to force structure arguments with a single - integer field to be treated as structures and not as the type of - their field. Without this a structure with a single char will be - returned just like a char variable, instead of being returned at the - top of the register as specified for big-endian IA64. */ - -#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \ - (!FLOAT_MODE_P (MODE) || (MODE) == TFmode) +/* ??? Might not be needed anymore. */ +#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) ((MODE) == TFmode) /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call, but that doesn't put out the @function type information which causes @@ -178,19 +178,45 @@ do { \ /* It is illegal to have relocations in shared segments on HPUX. Pretend flag_pic is always set. */ -#undef TARGET_ASM_SELECT_SECTION -#define TARGET_ASM_SELECT_SECTION ia64_rwreloc_select_section -#undef TARGET_ASM_UNIQUE_SECTION -#define TARGET_ASM_UNIQUE_SECTION ia64_rwreloc_unique_section -#undef TARGET_ASM_SELECT_RTX_SECTION -#define TARGET_ASM_SELECT_RTX_SECTION ia64_rwreloc_select_rtx_section -#undef TARGET_SECTION_TYPE_FLAGS -#define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags +#undef TARGET_ASM_RELOC_RW_MASK +#define TARGET_ASM_RELOC_RW_MASK ia64_hpux_reloc_rw_mask /* ia64 HPUX has the float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS 1 +#undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode) + +/* Put all *xf routines in libgcc, regardless of long double size. */ +#undef LIBGCC2_HAS_XF_MODE +#define LIBGCC2_HAS_XF_MODE 1 +#define XF_SIZE 64 + +/* Put all *tf routines in libgcc, regardless of long double size. */ +#undef LIBGCC2_HAS_TF_MODE +#define LIBGCC2_HAS_TF_MODE 1 +#define TF_SIZE 113 + +/* HP-UX headers are C++-compatible. */ +#define NO_IMPLICIT_EXTERN_C + +/* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a + FUNCTION_PROFILER defined because its use is not ifdefed. When using + PROFILE_HOOK, the profile call comes after the prologue. */ + +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0) + +#undef PROFILE_HOOK +#define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL) + +#undef PROFILE_BEFORE_PROLOGUE + +#undef NO_PROFILE_COUNTERS +#define NO_PROFILE_COUNTERS 0 + +#undef HANDLE_PRAGMA_PACK_PUSH_POP +#define HANDLE_PRAGMA_PACK_PUSH_POP diff --git a/contrib/gcc/config/ia64/ia64-c.c b/contrib/gcc/config/ia64/ia64-c.c index 422fc865b2a..9bb2a800755 100644 --- a/contrib/gcc/config/ia64/ia64-c.c +++ b/contrib/gcc/config/ia64/ia64-c.c @@ -1,5 +1,5 @@ /* Definitions of C specific functions for GNU compiler. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Ellcey This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -40,16 +40,16 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED) enum cpp_ttype type; tree x; - type = c_lex (&x); + type = pragma_lex (&x); while (type == CPP_NAME) { ia64_hpux_add_pragma_builtin (x); - type = c_lex (&x); + type = pragma_lex (&x); if (type == CPP_COMMA) - type = c_lex (&x); + type = pragma_lex (&x); } if (type != CPP_EOF) - warning ("malformed #pragma builtin"); + warning (OPT_Wpragmas, "malformed #pragma builtin"); } /* List of standard math functions which do not set matherr by default @@ -60,7 +60,7 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED) typedef struct c89_mathlib_names { const char *realname; /* User visible function name. */ - const char *c89name; /* libm special name needed to set errno. */ + const char *c89name; /* libm special name needed to set errno. */ } c89_mathlib_names; static const c89_mathlib_names c89_mathlib_name_list [] = diff --git a/contrib/gcc/config/ia64/ia64-modes.def b/contrib/gcc/config/ia64/ia64-modes.def index 17688bd9b85..c7e992777a4 100644 --- a/contrib/gcc/config/ia64/ia64-modes.def +++ b/contrib/gcc/config/ia64/ia64-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine GNU compiler. IA-64 version. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by James E. Wilson and David Mosberger . @@ -17,43 +17,52 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* IA64 requires both XF and TF modes. XFmode is __float80 is IEEE extended; TFmode is __float128 - is IEEE quad. + is IEEE quad. Both these modes occupy 16 bytes, but XFmode + only has 80 significant bits. RFmode is __fpreg is IA64 internal + register format with 82 significant bits but otherwise handled like + XFmode. */ - IEEE extended is 128 bits wide, except in ILP32 mode, but we - have to say it's 12 bytes so that the bitsize and wider_mode - tables are correctly set up. We correct its size below. */ - -FLOAT_MODE (XF, 12, ieee_extended_intel_128_format); +FRACTIONAL_FLOAT_MODE (XF, 80, 16, ieee_extended_intel_128_format); +FRACTIONAL_FLOAT_MODE (RF, 82, 16, ieee_extended_intel_128_format); FLOAT_MODE (TF, 16, ieee_quad_format); /* The above produces: mode ILP32 size/align LP64 size/align - XF 12/4 12/4 + XF 16/16 16/16 TF 16/16 16/16 psABI expectations: mode ILP32 size/align LP64 size/align - XF - 16/16 + XF 12/4 - TF - - HPUX expectations: mode ILP32 size/align LP64 size/align - XF 16/16 16/16 + XF - - TF 16/8 - We fix this up here. */ +ADJUST_FLOAT_FORMAT (XF, (TARGET_ILP32 && !TARGET_HPUX) + ? &ieee_extended_intel_96_format + : &ieee_extended_intel_128_format); ADJUST_BYTESIZE (XF, (TARGET_ILP32 && !TARGET_HPUX) ? 12 : 16); ADJUST_ALIGNMENT (XF, (TARGET_ILP32 && !TARGET_HPUX) ? 4 : 16); +ADJUST_FLOAT_FORMAT (RF, (TARGET_ILP32 && !TARGET_HPUX) + ? &ieee_extended_intel_96_format + : &ieee_extended_intel_128_format); +ADJUST_BYTESIZE (RF, (TARGET_ILP32 && !TARGET_HPUX) ? 12 : 16); +ADJUST_ALIGNMENT (RF, (TARGET_ILP32 && !TARGET_HPUX) ? 4 : 16); + ADJUST_ALIGNMENT (TF, (TARGET_ILP32 && TARGET_HPUX) ? 8 : 16); /* 256-bit integer mode is needed for STACK_SAVEAREA_MODE. */ @@ -66,3 +75,13 @@ INT_MODE (OI, 32); so that flow doesn't do something stupid. */ CC_MODE (CCI); + +/* Vector modes. */ +VECTOR_MODES (INT, 4); /* V4QI V2HI */ +VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */ +VECTOR_MODE (INT, QI, 16); +VECTOR_MODE (INT, HI, 8); +VECTOR_MODE (INT, SI, 4); +VECTOR_MODE (FLOAT, SF, 2); +VECTOR_MODE (FLOAT, SF, 4); + diff --git a/contrib/gcc/config/ia64/ia64-protos.h b/contrib/gcc/config/ia64/ia64-protos.h index 7825616491e..c4bf61d9829 100644 --- a/contrib/gcc/config/ia64/ia64-protos.h +++ b/contrib/gcc/config/ia64/ia64-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler for IA-64. - Copyright (C) 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Variables defined in ia64.c. */ @@ -33,74 +33,44 @@ extern int bundling_p; extern int ia64_st_address_bypass_p (rtx, rtx); extern int ia64_ld_address_bypass_p (rtx, rtx); extern int ia64_produce_address_p (rtx); -extern int call_operand (rtx, enum machine_mode); -extern int sdata_symbolic_operand (rtx, enum machine_mode); -extern int got_symbolic_operand (rtx, enum machine_mode); -extern int symbolic_operand (rtx, enum machine_mode); -extern int tls_symbolic_operand (rtx, enum machine_mode); -extern int function_operand (rtx, enum machine_mode); -extern int setjmp_operand (rtx, enum machine_mode); -extern int move_operand (rtx, enum machine_mode); -extern int gr_register_operand (rtx, enum machine_mode); -extern int fr_register_operand (rtx, enum machine_mode); -extern int grfr_register_operand (rtx, enum machine_mode); -extern int gr_nonimmediate_operand (rtx, enum machine_mode); -extern int fr_nonimmediate_operand (rtx, enum machine_mode); -extern int grfr_nonimmediate_operand (rtx, enum machine_mode); -extern int gr_reg_or_0_operand (rtx, enum machine_mode); -extern int gr_reg_or_5bit_operand (rtx, enum machine_mode); -extern int gr_reg_or_6bit_operand (rtx, enum machine_mode); -extern int gr_reg_or_8bit_operand (rtx, enum machine_mode); -extern int grfr_reg_or_8bit_operand (rtx, enum machine_mode); -extern int gr_reg_or_8bit_adjusted_operand (rtx, enum machine_mode); -extern int gr_reg_or_8bit_and_adjusted_operand (rtx, enum machine_mode); -extern int gr_reg_or_14bit_operand (rtx, enum machine_mode); -extern int gr_reg_or_22bit_operand (rtx, enum machine_mode); -extern int shift_count_operand (rtx, enum machine_mode); -extern int shift_32bit_count_operand (rtx, enum machine_mode); -extern int shladd_operand (rtx, enum machine_mode); -extern int fetchadd_operand (rtx, enum machine_mode); -extern int fr_reg_or_fp01_operand (rtx, enum machine_mode); -extern int normal_comparison_operator (rtx, enum machine_mode); -extern int adjusted_comparison_operator (rtx, enum machine_mode); -extern int signed_inequality_operator (rtx, enum machine_mode); -extern int destination_operand (rtx, enum machine_mode); -extern int not_postinc_memory_operand (rtx, enum machine_mode); -extern int predicate_operator (rtx, enum machine_mode); -extern int ar_lc_reg_operand (rtx, enum machine_mode); -extern int ar_ccv_reg_operand (rtx, enum machine_mode); -extern int ar_pfs_reg_operand (rtx, enum machine_mode); -extern int general_xfmode_operand (rtx, enum machine_mode); -extern int destination_xfmode_operand (rtx, enum machine_mode); -extern int xfreg_or_fp01_operand (rtx, enum machine_mode); -extern int basereg_operand (rtx, enum machine_mode); + +extern bool ia64_const_ok_for_letter_p (HOST_WIDE_INT, char); +extern bool ia64_const_double_ok_for_letter_p (rtx, char); +extern bool ia64_extra_constraint (rtx, char); +extern bool ia64_legitimate_constant_p (rtx); extern rtx ia64_expand_move (rtx, rtx); extern int ia64_move_ok (rtx, rtx); +extern int ia64_load_pair_ok (rtx, rtx); extern int addp4_optimize_ok (rtx, rtx); extern void ia64_emit_cond_move (rtx, rtx, rtx); extern int ia64_depz_field_mask (rtx, rtx); extern void ia64_split_tmode_move (rtx[]); -extern rtx spill_xfmode_operand (rtx, int); +extern bool ia64_expand_movxf_movrf (enum machine_mode, rtx[]); extern rtx ia64_expand_compare (enum rtx_code, enum machine_mode); +extern void ia64_expand_vecint_cmov (rtx[]); +extern bool ia64_expand_vecint_minmax (enum rtx_code, enum machine_mode, rtx[]); +extern void ia64_expand_widen_sum (rtx[], bool); +extern void ia64_expand_dot_prod_v8qi (rtx[], bool); extern void ia64_expand_call (rtx, rtx, rtx, int); extern void ia64_split_call (rtx, rtx, rtx, rtx, rtx, int, int); extern void ia64_reload_gp (void); +extern void ia64_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx); extern HOST_WIDE_INT ia64_initial_elimination_offset (int, int); extern void ia64_expand_prologue (void); extern void ia64_expand_epilogue (int); extern int ia64_direct_return (void); -extern void ia64_expand_load_address (rtx, rtx); +extern bool ia64_expand_load_address (rtx, rtx); extern int ia64_hard_regno_rename_ok (int, int); extern void ia64_initialize_trampoline (rtx, rtx, rtx); extern void ia64_print_operand_address (FILE *, rtx); extern void ia64_print_operand (FILE *, rtx, int); +extern enum reg_class ia64_preferred_reload_class (rtx, enum reg_class); extern enum reg_class ia64_secondary_reload_class (enum reg_class, enum machine_mode, rtx); -extern void ia64_output_dwarf_dtprel (FILE*, int, rtx); extern void process_for_unwind_directive (FILE *, rtx); extern const char *get_bundle_name (int); #endif /* RTX_CODE */ @@ -114,15 +84,9 @@ extern rtx ia64_va_arg (tree, tree); extern rtx ia64_function_value (tree, tree); #endif /* RTX_CODE */ -extern void ia64_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, - int *, int); -extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern int ia64_function_arg_pass_by_reference (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern int ia64_return_in_memory (tree); +extern int ia64_function_arg_boundary (enum machine_mode, tree); extern void ia64_asm_output_external (FILE *, tree, const char *); #endif /* TREE_CODE */ @@ -138,17 +102,13 @@ extern int ia64_dbx_register_number (int); extern rtx ia64_return_addr_rtx (HOST_WIDE_INT, rtx); extern void ia64_split_return_addr_rtx (rtx); -#ifdef SDATA_SECTION_ASM_OP -extern void sdata_section (void); -#endif - -#ifdef SBSS_SECTION_ASM_OP -extern void sbss_section (void); -#endif - #ifdef ARGS_SIZE_RTX /* expr.h defines ARGS_SIZE_RTX and `enum direction'. */ extern enum direction ia64_hpux_function_arg_padding (enum machine_mode, tree); #endif /* ARGS_SIZE_RTX */ extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *); +extern void ia64_output_function_profiler (FILE *, int); +extern void ia64_profile_hook (int); + +extern void ia64_optimization_options (int, int); diff --git a/contrib/gcc/config/ia64/ia64.c b/contrib/gcc/config/ia64/ia64.c index c215b19d868..6ddff326a5c 100644 --- a/contrib/gcc/config/ia64/ia64.c +++ b/contrib/gcc/config/ia64/ia64.c @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by James E. Wilson and David Mosberger . @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -51,6 +51,10 @@ Boston, MA 02111-1307, USA. */ #include "hashtab.h" #include "langhooks.h" #include "cfglayout.h" +#include "tree-gimple.h" +#include "intl.h" +#include "debug.h" +#include "params.h" /* This is used for communication between ASM_OUTPUT_LABEL and ASM_OUTPUT_LABELREF. */ @@ -97,26 +101,17 @@ static const char * const ia64_local_reg_names[80] = static const char * const ia64_output_reg_names[8] = { "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7" }; -/* String used with the -mfixed-range= option. */ -const char *ia64_fixed_range_string; - -/* Determines whether we use adds, addl, or movl to generate our - TLS immediate offsets. */ -int ia64_tls_size = 22; - -/* String used with the -mtls-size= option. */ -const char *ia64_tls_size_string; - /* Which cpu are we scheduling for. */ -enum processor_type ia64_tune; - -/* String used with the -tune= option. */ -const char *ia64_tune_string; +enum processor_type ia64_tune = PROCESSOR_ITANIUM2; /* Determines whether we run our final scheduling pass or not. We always avoid the normal second scheduling pass. */ static int ia64_flag_schedule_insns2; +/* Determines whether we run variable tracking in machine dependent + reorganization. */ +static int ia64_flag_var_tracking; + /* Variables which are this size or smaller are put in the sdata/sbss sections. */ @@ -159,16 +154,24 @@ struct ia64_frame_info /* Current frame information calculated by ia64_compute_frame_size. */ static struct ia64_frame_info current_frame_info; -static int ia64_use_dfa_pipeline_interface (void); static int ia64_first_cycle_multipass_dfa_lookahead (void); static void ia64_dependencies_evaluation_hook (rtx, rtx); static void ia64_init_dfa_pre_cycle_insn (void); static rtx ia64_dfa_pre_cycle_insn (void); static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx); +static bool ia64_first_cycle_multipass_dfa_lookahead_guard_spec (rtx); static int ia64_dfa_new_cycle (FILE *, int, rtx, int, int, int *); +static void ia64_h_i_d_extended (void); +static int ia64_mode_to_int (enum machine_mode); +static void ia64_set_sched_flags (spec_info_t); +static int ia64_speculate_insn (rtx, ds_t, rtx *); +static rtx ia64_gen_spec_insn (rtx, ds_t, int, bool, bool); +static bool ia64_needs_block_p (rtx); +static rtx ia64_gen_check (rtx, rtx, bool); +static int ia64_spec_check_p (rtx); +static int ia64_spec_check_src_p (rtx); static rtx gen_tls_get_addr (void); static rtx gen_thread_pointer (void); -static rtx ia64_expand_tls_address (enum tls_model, rtx, rtx); static int find_gr_spill (int); static int next_scratch_gr_reg (void); static void mark_reg_gr_used_mask (rtx, void *); @@ -182,10 +185,16 @@ static rtx gen_movdi_x (rtx, rtx, rtx); static rtx gen_fr_spill_x (rtx, rtx, rtx); static rtx gen_fr_restore_x (rtx, rtx, rtx); -static enum machine_mode hfa_element_mode (tree, int); +static enum machine_mode hfa_element_mode (tree, bool); +static void ia64_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree, int *, int); +static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); static bool ia64_function_ok_for_sibcall (tree, tree); +static bool ia64_return_in_memory (tree, tree); static bool ia64_rtx_costs (rtx, int, int, int *); static void fix_range (const char *); +static bool ia64_handle_option (size_t, const char *, int); static struct machine_function * ia64_init_machine_status (void); static void emit_insn_group_barriers (FILE *); static void emit_all_insn_group_barriers (FILE *); @@ -193,23 +202,19 @@ static void final_emit_insn_group_barriers (FILE *); static void emit_predicate_relation_info (void); static void ia64_reorg (void); static bool ia64_in_small_data_p (tree); -static void process_epilogue (void); -static int process_set (FILE *, rtx); +static void process_epilogue (FILE *, rtx, bool, bool); +static int process_set (FILE *, rtx, rtx, bool, bool); -static rtx ia64_expand_fetch_and_op (optab, enum machine_mode, tree, rtx); -static rtx ia64_expand_op_and_fetch (optab, enum machine_mode, tree, rtx); -static rtx ia64_expand_compare_and_swap (enum machine_mode, enum machine_mode, - int, tree, rtx); -static rtx ia64_expand_lock_test_and_set (enum machine_mode, tree, rtx); -static rtx ia64_expand_lock_release (enum machine_mode, tree, rtx); static bool ia64_assemble_integer (rtx, unsigned int, int); static void ia64_output_function_prologue (FILE *, HOST_WIDE_INT); static void ia64_output_function_epilogue (FILE *, HOST_WIDE_INT); static void ia64_output_function_end_prologue (FILE *); static int ia64_issue_rate (void); -static int ia64_adjust_cost (rtx, rtx, rtx, int); +static int ia64_adjust_cost_2 (rtx, int, rtx, int); static void ia64_sched_init (FILE *, int, int); +static void ia64_sched_init_global (FILE *, int, int); +static void ia64_sched_finish_global (FILE *, int); static void ia64_sched_finish (FILE *, int); static int ia64_dfa_sched_reorder (FILE *, int, rtx *, int *, int, int); static int ia64_sched_reorder (FILE *, int, rtx *, int *, int); @@ -238,31 +243,37 @@ static void ia64_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static void ia64_file_start (void); -static void ia64_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT); -static void ia64_rwreloc_select_section (tree, int, unsigned HOST_WIDE_INT) +static int ia64_hpux_reloc_rw_mask (void) ATTRIBUTE_UNUSED; +static int ia64_reloc_rw_mask (void) ATTRIBUTE_UNUSED; +static section *ia64_select_rtx_section (enum machine_mode, rtx, + unsigned HOST_WIDE_INT); +static void ia64_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; -static void ia64_rwreloc_unique_section (tree, int) - ATTRIBUTE_UNUSED; -static void ia64_rwreloc_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT) - ATTRIBUTE_UNUSED; -static unsigned int ia64_rwreloc_section_type_flags (tree, const char *, int) - ATTRIBUTE_UNUSED; - +static unsigned int ia64_section_type_flags (tree, const char *, int); static void ia64_hpux_add_extern_decl (tree decl) ATTRIBUTE_UNUSED; static void ia64_hpux_file_end (void) ATTRIBUTE_UNUSED; +static void ia64_init_libfuncs (void) + ATTRIBUTE_UNUSED; static void ia64_hpux_init_libfuncs (void) ATTRIBUTE_UNUSED; +static void ia64_sysv4_init_libfuncs (void) + ATTRIBUTE_UNUSED; static void ia64_vms_init_libfuncs (void) ATTRIBUTE_UNUSED; static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *); static void ia64_encode_section_info (tree, rtx, int); static rtx ia64_struct_value_rtx (tree, int); - +static tree ia64_gimplify_va_arg (tree, tree, tree *, tree *); +static bool ia64_scalar_mode_supported_p (enum machine_mode mode); +static bool ia64_vector_mode_supported_p (enum machine_mode mode); +static bool ia64_cannot_force_const_mem (rtx); +static const char *ia64_mangle_fundamental_type (tree); +static const char *ia64_invalid_conversion (tree, tree); +static const char *ia64_invalid_unary_op (int, tree); +static const char *ia64_invalid_binary_op (int, tree, tree); /* Table of valid machine attributes. */ static const struct attribute_spec ia64_attribute_table[] = @@ -310,8 +321,8 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_IN_SMALL_DATA_P #define TARGET_IN_SMALL_DATA_P ia64_in_small_data_p -#undef TARGET_SCHED_ADJUST_COST -#define TARGET_SCHED_ADJUST_COST ia64_adjust_cost +#undef TARGET_SCHED_ADJUST_COST_2 +#define TARGET_SCHED_ADJUST_COST_2 ia64_adjust_cost_2 #undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE ia64_issue_rate #undef TARGET_SCHED_VARIABLE_ISSUE @@ -320,6 +331,10 @@ static const struct attribute_spec ia64_attribute_table[] = #define TARGET_SCHED_INIT ia64_sched_init #undef TARGET_SCHED_FINISH #define TARGET_SCHED_FINISH ia64_sched_finish +#undef TARGET_SCHED_INIT_GLOBAL +#define TARGET_SCHED_INIT_GLOBAL ia64_sched_init_global +#undef TARGET_SCHED_FINISH_GLOBAL +#define TARGET_SCHED_FINISH_GLOBAL ia64_sched_finish_global #undef TARGET_SCHED_REORDER #define TARGET_SCHED_REORDER ia64_sched_reorder #undef TARGET_SCHED_REORDER2 @@ -328,9 +343,6 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK #define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK ia64_dependencies_evaluation_hook -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE ia64_use_dfa_pipeline_interface - #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ia64_first_cycle_multipass_dfa_lookahead @@ -346,8 +358,29 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_SCHED_DFA_NEW_CYCLE #define TARGET_SCHED_DFA_NEW_CYCLE ia64_dfa_new_cycle +#undef TARGET_SCHED_H_I_D_EXTENDED +#define TARGET_SCHED_H_I_D_EXTENDED ia64_h_i_d_extended + +#undef TARGET_SCHED_SET_SCHED_FLAGS +#define TARGET_SCHED_SET_SCHED_FLAGS ia64_set_sched_flags + +#undef TARGET_SCHED_SPECULATE_INSN +#define TARGET_SCHED_SPECULATE_INSN ia64_speculate_insn + +#undef TARGET_SCHED_NEEDS_BLOCK_P +#define TARGET_SCHED_NEEDS_BLOCK_P ia64_needs_block_p + +#undef TARGET_SCHED_GEN_CHECK +#define TARGET_SCHED_GEN_CHECK ia64_gen_check + +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC\ + ia64_first_cycle_multipass_dfa_lookahead_guard_spec + #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL ia64_function_ok_for_sibcall +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES ia64_arg_partial_bytes #undef TARGET_ASM_OUTPUT_MI_THUNK #define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk @@ -368,640 +401,79 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO ia64_encode_section_info +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS ia64_section_type_flags + +#ifdef HAVE_AS_TLS +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL +#define TARGET_ASM_OUTPUT_DWARF_DTPREL ia64_output_dwarf_dtprel +#endif + +/* ??? ABI doesn't allow us to define this. */ +#if 0 +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#endif + +/* ??? ABI doesn't allow us to define this. */ +#if 0 +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true +#endif + +/* ??? Investigate. */ +#if 0 +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true +#endif + #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY ia64_return_in_memory +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS ia64_setup_incoming_varargs +#undef TARGET_STRICT_ARGUMENT_NAMING +#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size + +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg + +#undef TARGET_UNWIND_EMIT +#define TARGET_UNWIND_EMIT process_for_unwind_directive + +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P ia64_vector_mode_supported_p + +/* ia64 architecture manual 4.4.7: ... reads, writes, and flushes may occur + in an order different from the specified program order. */ +#undef TARGET_RELAXED_ORDERING +#define TARGET_RELAXED_ORDERING true + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION ia64_handle_option + +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM ia64_cannot_force_const_mem + +#undef TARGET_MANGLE_FUNDAMENTAL_TYPE +#define TARGET_MANGLE_FUNDAMENTAL_TYPE ia64_mangle_fundamental_type + +#undef TARGET_INVALID_CONVERSION +#define TARGET_INVALID_CONVERSION ia64_invalid_conversion +#undef TARGET_INVALID_UNARY_OP +#define TARGET_INVALID_UNARY_OP ia64_invalid_unary_op +#undef TARGET_INVALID_BINARY_OP +#define TARGET_INVALID_BINARY_OP ia64_invalid_binary_op struct gcc_target targetm = TARGET_INITIALIZER; -/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */ - -int -call_operand (rtx op, enum machine_mode mode) -{ - if (mode != GET_MODE (op) && mode != VOIDmode) - return 0; - - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG - || (GET_CODE (op) == SUBREG && GET_CODE (XEXP (op, 0)) == REG)); -} - -/* Return 1 if OP refers to a symbol in the sdata section. */ - -int -sdata_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT offset = 0, size = 0; - - switch (GET_CODE (op)) - { - case CONST: - op = XEXP (op, 0); - if (GET_CODE (op) != PLUS - || GET_CODE (XEXP (op, 0)) != SYMBOL_REF - || GET_CODE (XEXP (op, 1)) != CONST_INT) - break; - offset = INTVAL (XEXP (op, 1)); - op = XEXP (op, 0); - /* FALLTHRU */ - - case SYMBOL_REF: - if (CONSTANT_POOL_ADDRESS_P (op)) - { - size = GET_MODE_SIZE (get_pool_mode (op)); - if (size > ia64_section_threshold) - return false; - } - else - { - tree t; - - if (!SYMBOL_REF_LOCAL_P (op) || !SYMBOL_REF_SMALL_P (op)) - return false; - - /* Note that in addition to DECLs, we can get various forms - of constants here. */ - t = SYMBOL_REF_DECL (op); - if (DECL_P (t)) - t = DECL_SIZE_UNIT (t); - else - t = TYPE_SIZE_UNIT (TREE_TYPE (t)); - if (t && host_integerp (t, 0)) - { - size = tree_low_cst (t, 0); - if (size < 0) - size = 0; - } - } - - /* Deny the stupid user trick of addressing outside the object. Such - things quickly result in GPREL22 relocation overflows. Of course, - they're also highly undefined. From a pure pedant's point of view - they deserve a slap on the wrist (such as provided by a relocation - overflow), but that just leads to bugzilla noise. */ - return (offset >= 0 && offset <= size); - - default: - break; - } - - return 0; -} - -int -small_addr_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return SYMBOL_REF_SMALL_ADDR_P (op); -} - -/* Return 1 if OP refers to a symbol, and is appropriate for a GOT load. */ - -int -got_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case CONST: - op = XEXP (op, 0); - if (GET_CODE (op) != PLUS) - return 0; - if (GET_CODE (XEXP (op, 0)) != SYMBOL_REF) - return 0; - op = XEXP (op, 1); - if (GET_CODE (op) != CONST_INT) - return 0; - - return 1; - - /* Ok if we're not using GOT entries at all. */ - if (TARGET_NO_PIC || TARGET_AUTO_PIC) - return 1; - - /* "Ok" while emitting rtl, since otherwise we won't be provided - with the entire offset during emission, which makes it very - hard to split the offset into high and low parts. */ - if (rtx_equal_function_value_matters) - return 1; - - /* Force the low 14 bits of the constant to zero so that we do not - use up so many GOT entries. */ - return (INTVAL (op) & 0x3fff) == 0; - - case SYMBOL_REF: - if (SYMBOL_REF_SMALL_ADDR_P (op)) - return 0; - case LABEL_REF: - return 1; - - default: - break; - } - return 0; -} - -/* Return 1 if OP refers to a symbol. */ - -int -symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case CONST: - case SYMBOL_REF: - case LABEL_REF: - return 1; - - default: - break; - } - return 0; -} - -/* Return tls_model if OP refers to a TLS symbol. */ - -int -tls_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != SYMBOL_REF) - return 0; - return SYMBOL_REF_TLS_MODEL (op); -} - - -/* Return 1 if OP refers to a function. */ - -int -function_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (op)) - return 1; - else - return 0; -} - -/* Return 1 if OP is setjmp or a similar function. */ - -/* ??? This is an unsatisfying solution. Should rethink. */ - -int -setjmp_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - const char *name; - int retval = 0; - - if (GET_CODE (op) != SYMBOL_REF) - return 0; - - name = XSTR (op, 0); - - /* The following code is borrowed from special_function_p in calls.c. */ - - /* Disregard prefix _, __ or __x. */ - if (name[0] == '_') - { - if (name[1] == '_' && name[2] == 'x') - name += 3; - else if (name[1] == '_') - name += 2; - else - name += 1; - } - - if (name[0] == 's') - { - retval - = ((name[1] == 'e' - && (! strcmp (name, "setjmp") - || ! strcmp (name, "setjmp_syscall"))) - || (name[1] == 'i' - && ! strcmp (name, "sigsetjmp")) - || (name[1] == 'a' - && ! strcmp (name, "savectx"))); - } - else if ((name[0] == 'q' && name[1] == 's' - && ! strcmp (name, "qsetjmp")) - || (name[0] == 'v' && name[1] == 'f' - && ! strcmp (name, "vfork"))) - retval = 1; - - return retval; -} - -/* Return 1 if OP is a general operand, excluding tls symbolic operands. */ - -int -move_operand (rtx op, enum machine_mode mode) -{ - return general_operand (op, mode) && !tls_symbolic_operand (op, mode); -} - -/* Return 1 if OP is a register operand that is (or could be) a GR reg. */ - -int -gr_register_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return GENERAL_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a register operand that is (or could be) an FR reg. */ - -int -fr_register_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return FR_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a register operand that is (or could be) a GR/FR reg. */ - -int -grfr_register_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return GENERAL_REGNO_P (regno) || FR_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a nonimmediate operand that is (or could be) a GR reg. */ - -int -gr_nonimmediate_operand (rtx op, enum machine_mode mode) -{ - if (! nonimmediate_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return GENERAL_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a nonimmediate operand that is (or could be) a FR reg. */ - -int -fr_nonimmediate_operand (rtx op, enum machine_mode mode) -{ - if (! nonimmediate_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return FR_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a nonimmediate operand that is a GR/FR reg. */ - -int -grfr_nonimmediate_operand (rtx op, enum machine_mode mode) -{ - if (! nonimmediate_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) == REG) - { - unsigned int regno = REGNO (op); - if (regno < FIRST_PSEUDO_REGISTER) - return GENERAL_REGNO_P (regno) || FR_REGNO_P (regno); - } - return 1; -} - -/* Return 1 if OP is a GR register operand, or zero. */ - -int -gr_reg_or_0_operand (rtx op, enum machine_mode mode) -{ - return (op == const0_rtx || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a GR register operand, or a 5 bit immediate operand. */ - -int -gr_reg_or_5bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 32) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a GR register operand, or a 6 bit immediate operand. */ - -int -gr_reg_or_6bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a GR register operand, or an 8 bit immediate operand. */ - -int -gr_reg_or_8bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a GR/FR register operand, or an 8 bit immediate. */ - -int -grfr_reg_or_8bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || grfr_register_operand (op, mode)); -} - -/* Return 1 if OP is a register operand, or an 8 bit adjusted immediate - operand. */ - -int -gr_reg_or_8bit_adjusted_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_L (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a register operand, or is valid for both an 8 bit - immediate and an 8 bit adjusted immediate operand. This is necessary - because when we emit a compare, we don't know what the condition will be, - so we need the union of the immediates accepted by GT and LT. */ - -int -gr_reg_or_8bit_and_adjusted_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op)) - && CONST_OK_FOR_L (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a register operand, or a 14 bit immediate operand. */ - -int -gr_reg_or_14bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_I (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a register operand, or a 22 bit immediate operand. */ - -int -gr_reg_or_22bit_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_J (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX - || gr_register_operand (op, mode)); -} - -/* Return 1 if OP is a 6 bit immediate operand. */ - -int -shift_count_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op))) - || GET_CODE (op) == CONSTANT_P_RTX); -} - -/* Return 1 if OP is a 5 bit immediate operand. */ - -int -shift_32bit_count_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT - && (INTVAL (op) >= 0 && INTVAL (op) < 32)) - || GET_CODE (op) == CONSTANT_P_RTX); -} - -/* Return 1 if OP is a 2, 4, 8, or 16 immediate operand. */ - -int -shladd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) == 2 || INTVAL (op) == 4 - || INTVAL (op) == 8 || INTVAL (op) == 16)); -} - -/* Return 1 if OP is a -16, -8, -4, -1, 1, 4, 8, or 16 immediate operand. */ - -int -fetchadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) == -16 || INTVAL (op) == -8 || - INTVAL (op) == -4 || INTVAL (op) == -1 || - INTVAL (op) == 1 || INTVAL (op) == 4 || - INTVAL (op) == 8 || INTVAL (op) == 16)); -} - -/* Return 1 if OP is a floating-point constant zero, one, or a register. */ - -int -fr_reg_or_fp01_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_OK_FOR_G (op)) - || fr_register_operand (op, mode)); -} - -/* Like nonimmediate_operand, but don't allow MEMs that try to use a - POST_MODIFY with a REG as displacement. */ - -int -destination_operand (rtx op, enum machine_mode mode) -{ - if (! nonimmediate_operand (op, mode)) - return 0; - if (GET_CODE (op) == MEM - && GET_CODE (XEXP (op, 0)) == POST_MODIFY - && GET_CODE (XEXP (XEXP (XEXP (op, 0), 1), 1)) == REG) - return 0; - return 1; -} - -/* Like memory_operand, but don't allow post-increments. */ - -int -not_postinc_memory_operand (rtx op, enum machine_mode mode) -{ - return (memory_operand (op, mode) - && GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != 'a'); -} - -/* Return 1 if this is a comparison operator, which accepts a normal 8-bit - signed immediate operand. */ - -int -normal_comparison_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (code == EQ || code == NE - || code == GT || code == LE || code == GTU || code == LEU)); -} - -/* Return 1 if this is a comparison operator, which accepts an adjusted 8-bit - signed immediate operand. */ - -int -adjusted_comparison_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (code == LT || code == GE || code == LTU || code == GEU)); -} - -/* Return 1 if this is a signed inequality operator. */ - -int -signed_inequality_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (code == GE || code == GT - || code == LE || code == LT)); -} - -/* Return 1 if this operator is valid for predication. */ - -int -predicate_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - return ((GET_MODE (op) == mode || mode == VOIDmode) - && (code == EQ || code == NE)); -} - -/* Return 1 if this operator can be used in a conditional operation. */ - -int -condop_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - return ((GET_MODE (op) == mode || mode == VOIDmode) - && (code == PLUS || code == MINUS || code == AND - || code == IOR || code == XOR)); -} - -/* Return 1 if this is the ar.lc register. */ - -int -ar_lc_reg_operand (register rtx op, enum machine_mode mode) -{ - return (GET_MODE (op) == DImode - && (mode == DImode || mode == VOIDmode) - && GET_CODE (op) == REG - && REGNO (op) == AR_LC_REGNUM); -} - -/* Return 1 if this is the ar.ccv register. */ - -int -ar_ccv_reg_operand (register rtx op, enum machine_mode mode) -{ - return ((GET_MODE (op) == mode || mode == VOIDmode) - && GET_CODE (op) == REG - && REGNO (op) == AR_CCV_REGNUM); -} - -/* Return 1 if this is the ar.pfs register. */ - -int -ar_pfs_reg_operand (register rtx op, enum machine_mode mode) -{ - return ((GET_MODE (op) == mode || mode == VOIDmode) - && GET_CODE (op) == REG - && REGNO (op) == AR_PFS_REGNUM); -} - -/* Like general_operand, but don't allow (mem (addressof)). */ - -int -general_xfmode_operand (rtx op, enum machine_mode mode) -{ - if (! general_operand (op, mode)) - return 0; - if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == ADDRESSOF) - return 0; - return 1; -} - -/* Similarly. */ - -int -destination_xfmode_operand (rtx op, enum machine_mode mode) -{ - if (! destination_operand (op, mode)) - return 0; - if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == ADDRESSOF) - return 0; - return 1; -} - -/* Similarly. */ - -int -xfreg_or_fp01_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == SUBREG) - return 0; - return fr_reg_or_fp01_operand (op, mode); -} - -/* Return 1 if OP is valid as a base register in a reg + offset address. */ - -int -basereg_operand (rtx op, enum machine_mode mode) -{ - /* ??? Should I copy the flag_omit_frame_pointer and cse_not_expected - checks from pa.c basereg_operand as well? Seems to be OK without them - in test runs. */ - - return (register_operand (op, mode) && - REG_POINTER ((GET_CODE (op) == SUBREG) ? SUBREG_REG (op) : op)); -} - typedef enum { ADDR_AREA_NORMAL, /* normal address area */ @@ -1043,7 +515,8 @@ ia64_get_addr_area (tree decl) } static tree -ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +ia64_handle_model_attribute (tree *node, tree name, tree args, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) { ia64_addr_area addr_area = ADDR_AREA_NORMAL; ia64_addr_area area; @@ -1057,7 +530,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBU } else { - warning ("invalid argument of `%s' attribute", + warning (OPT_Wattributes, "invalid argument of %qs attribute", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1070,26 +543,27 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, int flags ATTRIBU && !TREE_STATIC (decl)) { error ("%Jan address area attribute cannot be specified for " - "local variables", decl, decl); + "local variables", decl); *no_add_attrs = true; } area = ia64_get_addr_area (decl); if (area != ADDR_AREA_NORMAL && addr_area != area) { - error ("%Jaddress area of '%s' conflicts with previous " - "declaration", decl, decl); + error ("address area of %q+D conflicts with previous " + "declaration", decl); *no_add_attrs = true; } break; case FUNCTION_DECL: error ("%Jaddress area attribute cannot be specified for functions", - decl, decl); + decl); *no_add_attrs = true; break; default: - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); *no_add_attrs = true; break; } @@ -1107,7 +581,7 @@ ia64_encode_addr_area (tree decl, rtx symbol) { case ADDR_AREA_NORMAL: break; case ADDR_AREA_SMALL: flags |= SYMBOL_FLAG_SMALL_ADDR; break; - default: abort (); + default: gcc_unreachable (); } SYMBOL_REF_FLAGS (symbol) = flags; } @@ -1125,6 +599,102 @@ ia64_encode_section_info (tree decl, rtx rtl, int first) ia64_encode_addr_area (decl, XEXP (rtl, 0)); } +/* Implement CONST_OK_FOR_LETTER_P. */ + +bool +ia64_const_ok_for_letter_p (HOST_WIDE_INT value, char c) +{ + switch (c) + { + case 'I': + return CONST_OK_FOR_I (value); + case 'J': + return CONST_OK_FOR_J (value); + case 'K': + return CONST_OK_FOR_K (value); + case 'L': + return CONST_OK_FOR_L (value); + case 'M': + return CONST_OK_FOR_M (value); + case 'N': + return CONST_OK_FOR_N (value); + case 'O': + return CONST_OK_FOR_O (value); + case 'P': + return CONST_OK_FOR_P (value); + default: + return false; + } +} + +/* Implement CONST_DOUBLE_OK_FOR_LETTER_P. */ + +bool +ia64_const_double_ok_for_letter_p (rtx value, char c) +{ + switch (c) + { + case 'G': + return CONST_DOUBLE_OK_FOR_G (value); + default: + return false; + } +} + +/* Implement EXTRA_CONSTRAINT. */ + +bool +ia64_extra_constraint (rtx value, char c) +{ + switch (c) + { + case 'Q': + /* Non-volatile memory for FP_REG loads/stores. */ + return memory_operand(value, VOIDmode) && !MEM_VOLATILE_P (value); + + case 'R': + /* 1..4 for shladd arguments. */ + return (GET_CODE (value) == CONST_INT + && INTVAL (value) >= 1 && INTVAL (value) <= 4); + + case 'S': + /* Non-post-inc memory for asms and other unsavory creatures. */ + return (GET_CODE (value) == MEM + && GET_RTX_CLASS (GET_CODE (XEXP (value, 0))) != RTX_AUTOINC + && (reload_in_progress || memory_operand (value, VOIDmode))); + + case 'T': + /* Symbol ref to small-address-area. */ + return small_addr_symbolic_operand (value, VOIDmode); + + case 'U': + /* Vector zero. */ + return value == CONST0_RTX (GET_MODE (value)); + + case 'W': + /* An integer vector, such that conversion to an integer yields a + value appropriate for an integer 'J' constraint. */ + if (GET_CODE (value) == CONST_VECTOR + && GET_MODE_CLASS (GET_MODE (value)) == MODE_VECTOR_INT) + { + value = simplify_subreg (DImode, value, GET_MODE (value), 0); + return ia64_const_ok_for_letter_p (INTVAL (value), 'J'); + } + return false; + + case 'Y': + /* A V2SF vector containing elements that satisfy 'G'. */ + return + (GET_CODE (value) == CONST_VECTOR + && GET_MODE (value) == V2SFmode + && ia64_const_double_ok_for_letter_p (XVECEXP (value, 0, 0), 'G') + && ia64_const_double_ok_for_letter_p (XVECEXP (value, 0, 1), 'G')); + + default: + return false; + } +} + /* Return 1 if the operands of a move are ok. */ int @@ -1148,6 +718,37 @@ ia64_move_ok (rtx dst, rtx src) return GET_CODE (src) == CONST_DOUBLE && CONST_DOUBLE_OK_FOR_G (src); } +/* Return 1 if the operands are ok for a floating point load pair. */ + +int +ia64_load_pair_ok (rtx dst, rtx src) +{ + if (GET_CODE (dst) != REG || !FP_REGNO_P (REGNO (dst))) + return 0; + if (GET_CODE (src) != MEM || MEM_VOLATILE_P (src)) + return 0; + switch (GET_CODE (XEXP (src, 0))) + { + case REG: + case POST_INC: + break; + case POST_DEC: + return 0; + case POST_MODIFY: + { + rtx adjust = XEXP (XEXP (XEXP (src, 0), 1), 1); + + if (GET_CODE (adjust) != CONST_INT + || INTVAL (adjust) != GET_MODE_SIZE (GET_MODE (src))) + return 0; + } + break; + default: + abort (); + } + return 1; +} + int addp4_optimize_ok (rtx op1, rtx op2) { @@ -1171,72 +772,158 @@ ia64_depz_field_mask (rtx rop, rtx rshift) return exact_log2 (op + 1); } +/* Return the TLS model to use for ADDR. */ + +static enum tls_model +tls_symbolic_operand_type (rtx addr) +{ + enum tls_model tls_kind = 0; + + if (GET_CODE (addr) == CONST) + { + if (GET_CODE (XEXP (addr, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF) + tls_kind = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (addr, 0), 0)); + } + else if (GET_CODE (addr) == SYMBOL_REF) + tls_kind = SYMBOL_REF_TLS_MODEL (addr); + + return tls_kind; +} + +/* Return true if X is a constant that is valid for some immediate + field in an instruction. */ + +bool +ia64_legitimate_constant_p (rtx x) +{ + switch (GET_CODE (x)) + { + case CONST_INT: + case LABEL_REF: + return true; + + case CONST_DOUBLE: + if (GET_MODE (x) == VOIDmode) + return true; + return CONST_DOUBLE_OK_FOR_G (x); + + case CONST: + case SYMBOL_REF: + /* ??? Short term workaround for PR 28490. We must make the code here + match the code in ia64_expand_move and move_operand, even though they + are both technically wrong. */ + if (tls_symbolic_operand_type (x) == 0) + { + HOST_WIDE_INT addend = 0; + rtx op = x; + + if (GET_CODE (op) == CONST + && GET_CODE (XEXP (op, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT) + { + addend = INTVAL (XEXP (XEXP (op, 0), 1)); + op = XEXP (XEXP (op, 0), 0); + } + + if (any_offset_symbol_operand (op, GET_MODE (op)) + || function_operand (op, GET_MODE (op))) + return true; + if (aligned_offset_symbol_operand (op, GET_MODE (op))) + return (addend & 0x3fff) == 0; + return false; + } + return false; + + case CONST_VECTOR: + { + enum machine_mode mode = GET_MODE (x); + + if (mode == V2SFmode) + return ia64_extra_constraint (x, 'Y'); + + return (GET_MODE_CLASS (mode) == MODE_VECTOR_INT + && GET_MODE_SIZE (mode) <= 8); + } + + default: + return false; + } +} + +/* Don't allow TLS addresses to get spilled to memory. */ + +static bool +ia64_cannot_force_const_mem (rtx x) +{ + return tls_symbolic_operand_type (x) != 0; +} + /* Expand a symbolic constant load. */ -void +bool ia64_expand_load_address (rtx dest, rtx src) { - if (tls_symbolic_operand (src, VOIDmode)) - abort (); - if (GET_CODE (dest) != REG) - abort (); + gcc_assert (GET_CODE (dest) == REG); /* ILP32 mode still loads 64-bits of data from the GOT. This avoids having to pointer-extend the value afterward. Other forms of address computation below are also more natural to compute as 64-bit quantities. If we've been given an SImode destination register, change it. */ if (GET_MODE (dest) != Pmode) - dest = gen_rtx_REG (Pmode, REGNO (dest)); + dest = gen_rtx_REG_offset (dest, Pmode, REGNO (dest), 0); - if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_SMALL_ADDR_P (src)) - { - emit_insn (gen_rtx_SET (VOIDmode, dest, src)); - return; - } - else if (TARGET_AUTO_PIC) - { - emit_insn (gen_load_gprel64 (dest, src)); - return; - } + if (TARGET_NO_PIC) + return false; + if (small_addr_symbolic_operand (src, VOIDmode)) + return false; + + if (TARGET_AUTO_PIC) + emit_insn (gen_load_gprel64 (dest, src)); else if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (src)) - { - emit_insn (gen_load_fptr (dest, src)); - return; - } + emit_insn (gen_load_fptr (dest, src)); else if (sdata_symbolic_operand (src, VOIDmode)) - { - emit_insn (gen_load_gprel (dest, src)); - return; - } - - if (GET_CODE (src) == CONST - && GET_CODE (XEXP (src, 0)) == PLUS - && GET_CODE (XEXP (XEXP (src, 0), 1)) == CONST_INT - && (INTVAL (XEXP (XEXP (src, 0), 1)) & 0x1fff) != 0) - { - rtx sym = XEXP (XEXP (src, 0), 0); - HOST_WIDE_INT ofs, hi, lo; - - /* Split the offset into a sign extended 14-bit low part - and a complementary high part. */ - ofs = INTVAL (XEXP (XEXP (src, 0), 1)); - lo = ((ofs & 0x3fff) ^ 0x2000) - 0x2000; - hi = ofs - lo; - - ia64_expand_load_address (dest, plus_constant (sym, hi)); - emit_insn (gen_adddi3 (dest, dest, GEN_INT (lo))); - } + emit_insn (gen_load_gprel (dest, src)); else { + HOST_WIDE_INT addend = 0; rtx tmp; + /* We did split constant offsets in ia64_expand_move, and we did try + to keep them split in move_operand, but we also allowed reload to + rematerialize arbitrary constants rather than spill the value to + the stack and reload it. So we have to be prepared here to split + them apart again. */ + if (GET_CODE (src) == CONST) + { + HOST_WIDE_INT hi, lo; + + hi = INTVAL (XEXP (XEXP (src, 0), 1)); + lo = ((hi & 0x3fff) ^ 0x2000) - 0x2000; + hi = hi - lo; + + if (lo != 0) + { + addend = lo; + src = plus_constant (XEXP (XEXP (src, 0), 0), hi); + } + } + tmp = gen_rtx_HIGH (Pmode, src); tmp = gen_rtx_PLUS (Pmode, tmp, pic_offset_table_rtx); emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); - tmp = gen_rtx_LO_SUM (GET_MODE (dest), dest, src); + tmp = gen_rtx_LO_SUM (Pmode, dest, src); emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + + if (addend) + { + tmp = gen_rtx_PLUS (Pmode, dest, GEN_INT (addend)); + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + } } + + return true; } static GTY(()) rtx gen_tls_tga; @@ -1253,18 +940,17 @@ static rtx gen_thread_pointer (void) { if (!thread_pointer_rtx) - { - thread_pointer_rtx = gen_rtx_REG (Pmode, 13); - RTX_UNCHANGING_P (thread_pointer_rtx) = 1; - } + thread_pointer_rtx = gen_rtx_REG (Pmode, 13); return thread_pointer_rtx; } static rtx -ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) +ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1, + rtx orig_op1, HOST_WIDE_INT addend) { rtx tga_op1, tga_op2, tga_ret, tga_eqv, tmp, insns; rtx orig_op0 = op0; + HOST_WIDE_INT addend_lo, addend_hi; switch (tls_kind) { @@ -1272,14 +958,10 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) start_sequence (); tga_op1 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); - tga_op1 = gen_rtx_MEM (Pmode, tga_op1); - RTX_UNCHANGING_P (tga_op1) = 1; + emit_insn (gen_load_dtpmod (tga_op1, op1)); tga_op2 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtprel (tga_op2, op1)); - tga_op2 = gen_rtx_MEM (Pmode, tga_op2); - RTX_UNCHANGING_P (tga_op2) = 1; + emit_insn (gen_load_dtprel (tga_op2, op1)); tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX, LCT_CONST, Pmode, 2, tga_op1, @@ -1301,9 +983,7 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) start_sequence (); tga_op1 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); - tga_op1 = gen_rtx_MEM (Pmode, tga_op1); - RTX_UNCHANGING_P (tga_op1) = 1; + emit_insn (gen_load_dtpmod (tga_op1, op1)); tga_op2 = const0_rtx; @@ -1327,15 +1007,18 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) emit_insn (gen_adddi3 (op0, tmp, op0)); } else - emit_insn (gen_add_dtprel (op0, tmp, op1)); + emit_insn (gen_add_dtprel (op0, op1, tmp)); break; case TLS_MODEL_INITIAL_EXEC: + addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000; + addend_hi = addend - addend_lo; + + op1 = plus_constant (op1, addend_hi); + addend = addend_lo; + tmp = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_tprel (tmp, op1)); - tmp = gen_rtx_MEM (Pmode, tmp); - RTX_UNCHANGING_P (tmp) = 1; - tmp = force_reg (Pmode, tmp); + emit_insn (gen_load_tprel (tmp, op1)); if (!register_operand (op0, Pmode)) op0 = gen_reg_rtx (Pmode); @@ -1345,19 +1028,25 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) case TLS_MODEL_LOCAL_EXEC: if (!register_operand (op0, Pmode)) op0 = gen_reg_rtx (Pmode); + + op1 = orig_op1; + addend = 0; if (TARGET_TLS64) { emit_insn (gen_load_tprel (op0, op1)); - emit_insn (gen_adddi3 (op0, gen_thread_pointer (), op0)); + emit_insn (gen_adddi3 (op0, op0, gen_thread_pointer ())); } else - emit_insn (gen_add_tprel (op0, gen_thread_pointer (), op1)); + emit_insn (gen_add_tprel (op0, op1, gen_thread_pointer ())); break; default: - abort (); + gcc_unreachable (); } + if (addend) + op0 = expand_simple_binop (Pmode, PLUS, op0, GEN_INT (addend), + orig_op0, 1, OPTAB_DIRECT); if (orig_op0 == op0) return NULL_RTX; if (GET_MODE (orig_op0) == Pmode) @@ -1375,14 +1064,60 @@ ia64_expand_move (rtx op0, rtx op1) if ((mode == Pmode || mode == ptr_mode) && symbolic_operand (op1, VOIDmode)) { + HOST_WIDE_INT addend = 0; enum tls_model tls_kind; - if ((tls_kind = tls_symbolic_operand (op1, VOIDmode))) - return ia64_expand_tls_address (tls_kind, op0, op1); + rtx sym = op1; - if (!TARGET_NO_PIC && reload_completed) + if (GET_CODE (op1) == CONST + && GET_CODE (XEXP (op1, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op1, 0), 1)) == CONST_INT) { - ia64_expand_load_address (op0, op1); - return NULL_RTX; + addend = INTVAL (XEXP (XEXP (op1, 0), 1)); + sym = XEXP (XEXP (op1, 0), 0); + } + + tls_kind = tls_symbolic_operand_type (sym); + if (tls_kind) + return ia64_expand_tls_address (tls_kind, op0, sym, op1, addend); + + if (any_offset_symbol_operand (sym, mode)) + addend = 0; + else if (aligned_offset_symbol_operand (sym, mode)) + { + HOST_WIDE_INT addend_lo, addend_hi; + + addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000; + addend_hi = addend - addend_lo; + + if (addend_lo != 0) + { + op1 = plus_constant (sym, addend_hi); + addend = addend_lo; + } + else + addend = 0; + } + else + op1 = sym; + + if (reload_completed) + { + /* We really should have taken care of this offset earlier. */ + gcc_assert (addend == 0); + if (ia64_expand_load_address (op0, op1)) + return NULL_RTX; + } + + if (addend) + { + rtx subtarget = no_new_pseudos ? op0 : gen_reg_rtx (mode); + + emit_insn (gen_rtx_SET (VOIDmode, subtarget, op1)); + + op1 = expand_simple_binop (mode, PLUS, subtarget, + GEN_INT (addend), op0, 1, OPTAB_DIRECT); + if (op0 == op1) + return NULL_RTX; } } @@ -1434,7 +1169,7 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) case CONST_INT: case CONST_DOUBLE: /* Cannot occur reversed. */ - if (reversed) abort (); + gcc_assert (!reversed); if (GET_MODE (in) != TFmode) split_double (in, &out[0], &out[1]); @@ -1491,14 +1226,16 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) break; case POST_INC: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Just do the increment in two steps. */ out[0] = adjust_automodify_address (in, DImode, 0, 0); out[1] = adjust_automodify_address (in, DImode, 0, 8); break; case POST_DEC: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Add 8, subtract 24. */ base = XEXP (base, 0); out[0] = adjust_automodify_address @@ -1510,7 +1247,8 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) break; case POST_MODIFY: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Extract and adjust the modification. This case is trickier than the others, because we might have an index register, or we might have a combined offset that @@ -1529,38 +1267,41 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) out[1] = adjust_automodify_address (in, DImode, 0, 8); fixup = gen_adddi3 (base, base, GEN_INT (-8)); } - else if (GET_CODE (XEXP (offset, 1)) != CONST_INT) - abort (); - else if (INTVAL (XEXP (offset, 1)) < -256 + 8) - { - /* Again the postmodify cannot be made to match, but - in this case it's more efficient to get rid of the - postmodify entirely and fix up with an add insn. */ - out[1] = adjust_automodify_address (in, DImode, base, 8); - fixup = gen_adddi3 (base, base, - GEN_INT (INTVAL (XEXP (offset, 1)) - 8)); - } else { - /* Combined offset still fits in the displacement field. - (We cannot overflow it at the high end.) */ - out[1] = adjust_automodify_address - (in, DImode, - gen_rtx_POST_MODIFY (Pmode, base, - gen_rtx_PLUS (Pmode, base, - GEN_INT (INTVAL (XEXP (offset, 1)) - 8))), - 8); + gcc_assert (GET_CODE (XEXP (offset, 1)) == CONST_INT); + if (INTVAL (XEXP (offset, 1)) < -256 + 8) + { + /* Again the postmodify cannot be made to match, + but in this case it's more efficient to get rid + of the postmodify entirely and fix up with an + add insn. */ + out[1] = adjust_automodify_address (in, DImode, base, 8); + fixup = gen_adddi3 + (base, base, GEN_INT (INTVAL (XEXP (offset, 1)) - 8)); + } + else + { + /* Combined offset still fits in the displacement field. + (We cannot overflow it at the high end.) */ + out[1] = adjust_automodify_address + (in, DImode, gen_rtx_POST_MODIFY + (Pmode, base, gen_rtx_PLUS + (Pmode, base, + GEN_INT (INTVAL (XEXP (offset, 1)) - 8))), + 8); + } } break; default: - abort (); + gcc_unreachable (); } break; } default: - abort (); + gcc_unreachable (); } return fixup; @@ -1580,7 +1321,7 @@ ia64_split_tmode_move (rtx operands[]) the value it points to. In that case we have to do the loads in the appropriate order so that the pointer is not destroyed too early. Also we must not generate a postmodify for that second - load, or rws_access_regno will abort. */ + load, or rws_access_regno will die. */ if (GET_CODE (operands[1]) == MEM && reg_overlap_mentioned_p (operands[0], operands[1])) { @@ -1637,28 +1378,159 @@ ia64_split_tmode_move (rtx operands[]) This solution attempts to prevent this situation from occurring. When we see something like the above, we spill the inner register to memory. */ -rtx -spill_xfmode_operand (rtx in, int force) +static rtx +spill_xfmode_rfmode_operand (rtx in, int force, enum machine_mode mode) { if (GET_CODE (in) == SUBREG && GET_MODE (SUBREG_REG (in)) == TImode && GET_CODE (SUBREG_REG (in)) == REG) { - rtx mem = gen_mem_addressof (SUBREG_REG (in), NULL_TREE, /*rescan=*/true); - return gen_rtx_MEM (XFmode, copy_to_reg (XEXP (mem, 0))); + rtx memt = assign_stack_temp (TImode, 16, 0); + emit_move_insn (memt, SUBREG_REG (in)); + return adjust_address (memt, mode, 0); } else if (force && GET_CODE (in) == REG) { - rtx mem = gen_mem_addressof (in, NULL_TREE, /*rescan=*/true); - return gen_rtx_MEM (XFmode, copy_to_reg (XEXP (mem, 0))); + rtx memx = assign_stack_temp (mode, 16, 0); + emit_move_insn (memx, in); + return memx; } - else if (GET_CODE (in) == MEM - && GET_CODE (XEXP (in, 0)) == ADDRESSOF) - return change_address (in, XFmode, copy_to_reg (XEXP (in, 0))); else return in; } +/* Expand the movxf or movrf pattern (MODE says which) with the given + OPERANDS, returning true if the pattern should then invoke + DONE. */ + +bool +ia64_expand_movxf_movrf (enum machine_mode mode, rtx operands[]) +{ + rtx op0 = operands[0]; + + if (GET_CODE (op0) == SUBREG) + op0 = SUBREG_REG (op0); + + /* We must support XFmode loads into general registers for stdarg/vararg, + unprototyped calls, and a rare case where a long double is passed as + an argument after a float HFA fills the FP registers. We split them into + DImode loads for convenience. We also need to support XFmode stores + for the last case. This case does not happen for stdarg/vararg routines, + because we do a block store to memory of unnamed arguments. */ + + if (GET_CODE (op0) == REG && GR_REGNO_P (REGNO (op0))) + { + rtx out[2]; + + /* We're hoping to transform everything that deals with XFmode + quantities and GR registers early in the compiler. */ + gcc_assert (!no_new_pseudos); + + /* Struct to register can just use TImode instead. */ + if ((GET_CODE (operands[1]) == SUBREG + && GET_MODE (SUBREG_REG (operands[1])) == TImode) + || (GET_CODE (operands[1]) == REG + && GR_REGNO_P (REGNO (operands[1])))) + { + rtx op1 = operands[1]; + + if (GET_CODE (op1) == SUBREG) + op1 = SUBREG_REG (op1); + else + op1 = gen_rtx_REG (TImode, REGNO (op1)); + + emit_move_insn (gen_rtx_REG (TImode, REGNO (op0)), op1); + return true; + } + + if (GET_CODE (operands[1]) == CONST_DOUBLE) + { + /* Don't word-swap when reading in the constant. */ + emit_move_insn (gen_rtx_REG (DImode, REGNO (op0)), + operand_subword (operands[1], WORDS_BIG_ENDIAN, + 0, mode)); + emit_move_insn (gen_rtx_REG (DImode, REGNO (op0) + 1), + operand_subword (operands[1], !WORDS_BIG_ENDIAN, + 0, mode)); + return true; + } + + /* If the quantity is in a register not known to be GR, spill it. */ + if (register_operand (operands[1], mode)) + operands[1] = spill_xfmode_rfmode_operand (operands[1], 1, mode); + + gcc_assert (GET_CODE (operands[1]) == MEM); + + /* Don't word-swap when reading in the value. */ + out[0] = gen_rtx_REG (DImode, REGNO (op0)); + out[1] = gen_rtx_REG (DImode, REGNO (op0) + 1); + + emit_move_insn (out[0], adjust_address (operands[1], DImode, 0)); + emit_move_insn (out[1], adjust_address (operands[1], DImode, 8)); + return true; + } + + if (GET_CODE (operands[1]) == REG && GR_REGNO_P (REGNO (operands[1]))) + { + /* We're hoping to transform everything that deals with XFmode + quantities and GR registers early in the compiler. */ + gcc_assert (!no_new_pseudos); + + /* Op0 can't be a GR_REG here, as that case is handled above. + If op0 is a register, then we spill op1, so that we now have a + MEM operand. This requires creating an XFmode subreg of a TImode reg + to force the spill. */ + if (register_operand (operands[0], mode)) + { + rtx op1 = gen_rtx_REG (TImode, REGNO (operands[1])); + op1 = gen_rtx_SUBREG (mode, op1, 0); + operands[1] = spill_xfmode_rfmode_operand (op1, 0, mode); + } + + else + { + rtx in[2]; + + gcc_assert (GET_CODE (operands[0]) == MEM); + + /* Don't word-swap when writing out the value. */ + in[0] = gen_rtx_REG (DImode, REGNO (operands[1])); + in[1] = gen_rtx_REG (DImode, REGNO (operands[1]) + 1); + + emit_move_insn (adjust_address (operands[0], DImode, 0), in[0]); + emit_move_insn (adjust_address (operands[0], DImode, 8), in[1]); + return true; + } + } + + if (!reload_in_progress && !reload_completed) + { + operands[1] = spill_xfmode_rfmode_operand (operands[1], 0, mode); + + if (GET_MODE (op0) == TImode && GET_CODE (op0) == REG) + { + rtx memt, memx, in = operands[1]; + if (CONSTANT_P (in)) + in = validize_mem (force_const_mem (mode, in)); + if (GET_CODE (in) == MEM) + memt = adjust_address (in, TImode, 0); + else + { + memt = assign_stack_temp (TImode, 16, 0); + memx = adjust_address (memt, mode, 0); + emit_move_insn (memx, in); + } + emit_move_insn (op0, memt); + return true; + } + + if (!ia64_move_ok (operands[0], operands[1])) + operands[1] = force_reg (mode, operands[1]); + } + + return false; +} + /* Emit comparison instruction if necessary, returning the expression that holds the compare result in the proper mode. */ @@ -1674,15 +1546,13 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) do not need to emit another comparison. */ if (GET_MODE (op0) == BImode) { - if ((code == NE || code == EQ) && op1 == const0_rtx) - cmp = op0; - else - abort (); + gcc_assert ((code == NE || code == EQ) && op1 == const0_rtx); + cmp = op0; } /* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a magic number as its third argument, that indicates what to do. The return value is an integer to be compared against zero. */ - else if (TARGET_HPUX && GET_MODE (op0) == TFmode) + else if (GET_MODE (op0) == TFmode) { enum qfcmp_magic { QCMP_INV = 1, /* Raise FP_INVALID on SNaN as a side effect. */ @@ -1693,8 +1563,8 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) } magic; enum rtx_code ncode; rtx ret, insns; - if (GET_MODE (op1) != TFmode) - abort (); + + gcc_assert (cmptf_libfunc && GET_MODE (op1) == TFmode); switch (code) { /* 1 = equal, 0 = not equal. Equality operators do @@ -1703,6 +1573,7 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) case NE: magic = QCMP_EQ; ncode = EQ; break; /* isunordered() from C99. */ case UNORDERED: magic = QCMP_UNORD; ncode = NE; break; + case ORDERED: magic = QCMP_UNORD; ncode = EQ; break; /* Relational operators raise FP_INVALID when given an SNaN operand. */ case LT: magic = QCMP_LT |QCMP_INV; ncode = NE; break; @@ -1712,7 +1583,7 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) /* FUTURE: Implement UNEQ, UNLT, UNLE, UNGT, UNGE, LTGT. Expanders for buneq etc. weuld have to be added to ia64.md for this to be useful. */ - default: abort (); + default: gcc_unreachable (); } start_sequence (); @@ -1743,6 +1614,316 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) return gen_rtx_fmt_ee (code, mode, cmp, const0_rtx); } +/* Generate an integral vector comparison. Return true if the condition has + been reversed, and so the sense of the comparison should be inverted. */ + +static bool +ia64_expand_vecint_compare (enum rtx_code code, enum machine_mode mode, + rtx dest, rtx op0, rtx op1) +{ + bool negate = false; + rtx x; + + /* Canonicalize the comparison to EQ, GT, GTU. */ + switch (code) + { + case EQ: + case GT: + case GTU: + break; + + case NE: + case LE: + case LEU: + code = reverse_condition (code); + negate = true; + break; + + case GE: + case GEU: + code = reverse_condition (code); + negate = true; + /* FALLTHRU */ + + case LT: + case LTU: + code = swap_condition (code); + x = op0, op0 = op1, op1 = x; + break; + + default: + gcc_unreachable (); + } + + /* Unsigned parallel compare is not supported by the hardware. Play some + tricks to turn this into a signed comparison against 0. */ + if (code == GTU) + { + switch (mode) + { + case V2SImode: + { + rtx t1, t2, mask; + + /* Perform a parallel modulo subtraction. */ + t1 = gen_reg_rtx (V2SImode); + emit_insn (gen_subv2si3 (t1, op0, op1)); + + /* Extract the original sign bit of op0. */ + mask = GEN_INT (-0x80000000); + mask = gen_rtx_CONST_VECTOR (V2SImode, gen_rtvec (2, mask, mask)); + mask = force_reg (V2SImode, mask); + t2 = gen_reg_rtx (V2SImode); + emit_insn (gen_andv2si3 (t2, op0, mask)); + + /* XOR it back into the result of the subtraction. This results + in the sign bit set iff we saw unsigned underflow. */ + x = gen_reg_rtx (V2SImode); + emit_insn (gen_xorv2si3 (x, t1, t2)); + + code = GT; + op0 = x; + op1 = CONST0_RTX (mode); + } + break; + + case V8QImode: + case V4HImode: + /* Perform a parallel unsigned saturating subtraction. */ + x = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET (VOIDmode, x, + gen_rtx_US_MINUS (mode, op0, op1))); + + code = EQ; + op0 = x; + op1 = CONST0_RTX (mode); + negate = !negate; + break; + + default: + gcc_unreachable (); + } + } + + x = gen_rtx_fmt_ee (code, mode, op0, op1); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + + return negate; +} + +/* Emit an integral vector conditional move. */ + +void +ia64_expand_vecint_cmov (rtx operands[]) +{ + enum machine_mode mode = GET_MODE (operands[0]); + enum rtx_code code = GET_CODE (operands[3]); + bool negate; + rtx cmp, x, ot, of; + + cmp = gen_reg_rtx (mode); + negate = ia64_expand_vecint_compare (code, mode, cmp, + operands[4], operands[5]); + + ot = operands[1+negate]; + of = operands[2-negate]; + + if (ot == CONST0_RTX (mode)) + { + if (of == CONST0_RTX (mode)) + { + emit_move_insn (operands[0], ot); + return; + } + + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, of); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], x)); + } + else if (of == CONST0_RTX (mode)) + { + x = gen_rtx_AND (mode, cmp, ot); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], x)); + } + else + { + rtx t, f; + + t = gen_reg_rtx (mode); + x = gen_rtx_AND (mode, cmp, operands[1+negate]); + emit_insn (gen_rtx_SET (VOIDmode, t, x)); + + f = gen_reg_rtx (mode); + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, operands[2-negate]); + emit_insn (gen_rtx_SET (VOIDmode, f, x)); + + x = gen_rtx_IOR (mode, t, f); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], x)); + } +} + +/* Emit an integral vector min or max operation. Return true if all done. */ + +bool +ia64_expand_vecint_minmax (enum rtx_code code, enum machine_mode mode, + rtx operands[]) +{ + rtx xops[6]; + + /* These four combinations are supported directly. */ + if (mode == V8QImode && (code == UMIN || code == UMAX)) + return false; + if (mode == V4HImode && (code == SMIN || code == SMAX)) + return false; + + /* This combination can be implemented with only saturating subtraction. */ + if (mode == V4HImode && code == UMAX) + { + rtx x, tmp = gen_reg_rtx (mode); + + x = gen_rtx_US_MINUS (mode, operands[1], operands[2]); + emit_insn (gen_rtx_SET (VOIDmode, tmp, x)); + + emit_insn (gen_addv4hi3 (operands[0], tmp, operands[2])); + return true; + } + + /* Everything else implemented via vector comparisons. */ + xops[0] = operands[0]; + xops[4] = xops[1] = operands[1]; + xops[5] = xops[2] = operands[2]; + + switch (code) + { + case UMIN: + code = LTU; + break; + case UMAX: + code = GTU; + break; + case SMIN: + code = LT; + break; + case SMAX: + code = GT; + break; + default: + gcc_unreachable (); + } + xops[3] = gen_rtx_fmt_ee (code, VOIDmode, operands[1], operands[2]); + + ia64_expand_vecint_cmov (xops); + return true; +} + +/* Emit an integral vector widening sum operations. */ + +void +ia64_expand_widen_sum (rtx operands[3], bool unsignedp) +{ + rtx l, h, x, s; + enum machine_mode wmode, mode; + rtx (*unpack_l) (rtx, rtx, rtx); + rtx (*unpack_h) (rtx, rtx, rtx); + rtx (*plus) (rtx, rtx, rtx); + + wmode = GET_MODE (operands[0]); + mode = GET_MODE (operands[1]); + + switch (mode) + { + case V8QImode: + unpack_l = gen_unpack1_l; + unpack_h = gen_unpack1_h; + plus = gen_addv4hi3; + break; + case V4HImode: + unpack_l = gen_unpack2_l; + unpack_h = gen_unpack2_h; + plus = gen_addv2si3; + break; + default: + gcc_unreachable (); + } + + /* Fill in x with the sign extension of each element in op1. */ + if (unsignedp) + x = CONST0_RTX (mode); + else + { + bool neg; + + x = gen_reg_rtx (mode); + + neg = ia64_expand_vecint_compare (LT, mode, x, operands[1], + CONST0_RTX (mode)); + gcc_assert (!neg); + } + + l = gen_reg_rtx (wmode); + h = gen_reg_rtx (wmode); + s = gen_reg_rtx (wmode); + + emit_insn (unpack_l (gen_lowpart (mode, l), operands[1], x)); + emit_insn (unpack_h (gen_lowpart (mode, h), operands[1], x)); + emit_insn (plus (s, l, operands[2])); + emit_insn (plus (operands[0], h, s)); +} + +/* Emit a signed or unsigned V8QI dot product operation. */ + +void +ia64_expand_dot_prod_v8qi (rtx operands[4], bool unsignedp) +{ + rtx l1, l2, h1, h2, x1, x2, p1, p2, p3, p4, s1, s2, s3; + + /* Fill in x1 and x2 with the sign extension of each element. */ + if (unsignedp) + x1 = x2 = CONST0_RTX (V8QImode); + else + { + bool neg; + + x1 = gen_reg_rtx (V8QImode); + x2 = gen_reg_rtx (V8QImode); + + neg = ia64_expand_vecint_compare (LT, V8QImode, x1, operands[1], + CONST0_RTX (V8QImode)); + gcc_assert (!neg); + neg = ia64_expand_vecint_compare (LT, V8QImode, x2, operands[2], + CONST0_RTX (V8QImode)); + gcc_assert (!neg); + } + + l1 = gen_reg_rtx (V4HImode); + l2 = gen_reg_rtx (V4HImode); + h1 = gen_reg_rtx (V4HImode); + h2 = gen_reg_rtx (V4HImode); + + emit_insn (gen_unpack1_l (gen_lowpart (V8QImode, l1), operands[1], x1)); + emit_insn (gen_unpack1_l (gen_lowpart (V8QImode, l2), operands[2], x2)); + emit_insn (gen_unpack1_h (gen_lowpart (V8QImode, h1), operands[1], x1)); + emit_insn (gen_unpack1_h (gen_lowpart (V8QImode, h2), operands[2], x2)); + + p1 = gen_reg_rtx (V2SImode); + p2 = gen_reg_rtx (V2SImode); + p3 = gen_reg_rtx (V2SImode); + p4 = gen_reg_rtx (V2SImode); + emit_insn (gen_pmpy2_r (p1, l1, l2)); + emit_insn (gen_pmpy2_l (p2, l1, l2)); + emit_insn (gen_pmpy2_r (p3, h1, h2)); + emit_insn (gen_pmpy2_l (p4, h1, h2)); + + s1 = gen_reg_rtx (V2SImode); + s2 = gen_reg_rtx (V2SImode); + s3 = gen_reg_rtx (V2SImode); + emit_insn (gen_addv2si3 (s1, p1, p2)); + emit_insn (gen_addv2si3 (s2, p3, p4)); + emit_insn (gen_addv2si3 (s3, s1, operands[3])); + emit_insn (gen_addv2si3 (operands[0], s2, s3)); +} + /* Emit the appropriate sequence for a call. */ void @@ -1884,12 +2065,129 @@ ia64_split_call (rtx retval, rtx addr, rtx retaddr, rtx scratch_r, if ((!TARGET_CONST_GP || is_desc) && !noreturn_p && !sibcall_p) ia64_reload_gp (); } + +/* Expand an atomic operation. We want to perform MEM = VAL atomically. + + This differs from the generic code in that we know about the zero-extending + properties of cmpxchg, and the zero-extending requirements of ar.ccv. We + also know that ld.acq+cmpxchg.rel equals a full barrier. + + The loop we want to generate looks like + + cmp_reg = mem; + label: + old_reg = cmp_reg; + new_reg = cmp_reg op val; + cmp_reg = compare-and-swap(mem, old_reg, new_reg) + if (cmp_reg != old_reg) + goto label; + + Note that we only do the plain load from memory once. Subsequent + iterations use the value loaded by the compare-and-swap pattern. */ + +void +ia64_expand_atomic_op (enum rtx_code code, rtx mem, rtx val, + rtx old_dst, rtx new_dst) +{ + enum machine_mode mode = GET_MODE (mem); + rtx old_reg, new_reg, cmp_reg, ar_ccv, label; + enum insn_code icode; + + /* Special case for using fetchadd. */ + if ((mode == SImode || mode == DImode) + && (code == PLUS || code == MINUS) + && fetchadd_operand (val, mode)) + { + if (code == MINUS) + val = GEN_INT (-INTVAL (val)); + + if (!old_dst) + old_dst = gen_reg_rtx (mode); + + emit_insn (gen_memory_barrier ()); + + if (mode == SImode) + icode = CODE_FOR_fetchadd_acq_si; + else + icode = CODE_FOR_fetchadd_acq_di; + emit_insn (GEN_FCN (icode) (old_dst, mem, val)); + + if (new_dst) + { + new_reg = expand_simple_binop (mode, PLUS, old_dst, val, new_dst, + true, OPTAB_WIDEN); + if (new_reg != new_dst) + emit_move_insn (new_dst, new_reg); + } + return; + } + + /* Because of the volatile mem read, we get an ld.acq, which is the + front half of the full barrier. The end half is the cmpxchg.rel. */ + gcc_assert (MEM_VOLATILE_P (mem)); + + old_reg = gen_reg_rtx (DImode); + cmp_reg = gen_reg_rtx (DImode); + label = gen_label_rtx (); + + if (mode != DImode) + { + val = simplify_gen_subreg (DImode, val, mode, 0); + emit_insn (gen_extend_insn (cmp_reg, mem, DImode, mode, 1)); + } + else + emit_move_insn (cmp_reg, mem); + + emit_label (label); + + ar_ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); + emit_move_insn (old_reg, cmp_reg); + emit_move_insn (ar_ccv, cmp_reg); + + if (old_dst) + emit_move_insn (old_dst, gen_lowpart (mode, cmp_reg)); + + new_reg = cmp_reg; + if (code == NOT) + { + new_reg = expand_simple_unop (DImode, NOT, new_reg, NULL_RTX, true); + code = AND; + } + new_reg = expand_simple_binop (DImode, code, new_reg, val, NULL_RTX, + true, OPTAB_DIRECT); + + if (mode != DImode) + new_reg = gen_lowpart (mode, new_reg); + if (new_dst) + emit_move_insn (new_dst, new_reg); + + switch (mode) + { + case QImode: icode = CODE_FOR_cmpxchg_rel_qi; break; + case HImode: icode = CODE_FOR_cmpxchg_rel_hi; break; + case SImode: icode = CODE_FOR_cmpxchg_rel_si; break; + case DImode: icode = CODE_FOR_cmpxchg_rel_di; break; + default: + gcc_unreachable (); + } + + emit_insn (GEN_FCN (icode) (cmp_reg, mem, ar_ccv, new_reg)); + + emit_cmp_and_jump_insns (cmp_reg, old_reg, NE, NULL, DImode, true, label); +} /* Begin the assembly file. */ static void ia64_file_start (void) { + /* Variable tracking should be run after all optimizations which change order + of insns. It also needs a valid CFG. This can't be done in + ia64_override_options, because flag_var_tracking is finalized after + that. */ + ia64_flag_var_tracking = flag_var_tracking; + flag_var_tracking = 0; + default_file_start (); emit_safe_across_calls (); } @@ -2000,7 +2298,7 @@ next_scratch_gr_reg (void) } /* There must be _something_ available. */ - abort (); + gcc_unreachable (); } /* Helper function for ia64_compute_frame_size, called through @@ -2012,7 +2310,7 @@ mark_reg_gr_used_mask (rtx reg, void *data ATTRIBUTE_UNUSED) unsigned int regno = REGNO (reg); if (regno < 32) { - unsigned int i, n = HARD_REGNO_NREGS (regno, GET_MODE (reg)); + unsigned int i, n = hard_regno_nregs[regno][GET_MODE (reg)]; for (i = 0; i < n; ++i) current_frame_info.gr_used_mask |= 1 << (regno + i); } @@ -2084,12 +2382,14 @@ ia64_compute_frame_size (HOST_WIDE_INT size) break; i = regno - OUT_REG (0) + 1; +#ifndef PROFILE_HOOK /* When -p profiling, we need one output register for the mcount argument. Likewise for -a profiling for the bb_init_func argument. For -ax profiling, we need two output registers for the two bb_init_trace_func arguments. */ if (current_function_profile) i = MAX (i, 1); +#endif current_frame_info.n_output_regs = i; /* ??? No rotating register support yet. */ @@ -2152,7 +2452,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size) current_frame_info.reg_save_b0 = find_gr_spill (1); if (current_frame_info.reg_save_b0 == 0) { - spill_size += 8; + extra_spill_size += 8; n_spilled += 1; } @@ -2181,7 +2481,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size) if (regs_ever_live[BR_REG (0)] && ! call_used_regs[BR_REG (0)]) { SET_HARD_REG_BIT (mask, BR_REG (0)); - spill_size += 8; + extra_spill_size += 8; n_spilled += 1; } @@ -2297,39 +2597,49 @@ ia64_initial_elimination_offset (int from, int to) switch (from) { case FRAME_POINTER_REGNUM: - if (to == HARD_FRAME_POINTER_REGNUM) + switch (to) { + case HARD_FRAME_POINTER_REGNUM: if (current_function_is_leaf) offset = -current_frame_info.total_size; else offset = -(current_frame_info.total_size - current_function_outgoing_args_size - 16); - } - else if (to == STACK_POINTER_REGNUM) - { + break; + + case STACK_POINTER_REGNUM: if (current_function_is_leaf) offset = 0; else offset = 16 + current_function_outgoing_args_size; + break; + + default: + gcc_unreachable (); } - else - abort (); break; case ARG_POINTER_REGNUM: /* Arguments start above the 16 byte save area, unless stdarg in which case we store through the 16 byte save area. */ - if (to == HARD_FRAME_POINTER_REGNUM) - offset = 16 - current_function_pretend_args_size; - else if (to == STACK_POINTER_REGNUM) - offset = (current_frame_info.total_size - + 16 - current_function_pretend_args_size); - else - abort (); + switch (to) + { + case HARD_FRAME_POINTER_REGNUM: + offset = 16 - current_function_pretend_args_size; + break; + + case STACK_POINTER_REGNUM: + offset = (current_frame_info.total_size + + 16 - current_function_pretend_args_size); + break; + + default: + gcc_unreachable (); + } break; default: - abort (); + gcc_unreachable (); } return offset; @@ -2619,8 +2929,9 @@ ia64_expand_prologue (void) if (optimize) { edge e; + edge_iterator ei; - for (e = EXIT_BLOCK_PTR->pred; e ; e = e->pred_next) + FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) if ((e->flags & EDGE_FAKE) == 0 && (e->flags & EDGE_FALLTHRU) != 0) break; @@ -2860,35 +3171,7 @@ ia64_expand_prologue (void) } } - if (current_frame_info.reg_save_gp) - { - insn = emit_move_insn (gen_rtx_REG (DImode, - current_frame_info.reg_save_gp), - pic_offset_table_rtx); - /* We don't know for sure yet if this is actually needed, since - we've not split the PIC call patterns. If all of the calls - are indirect, and not followed by any uses of the gp, then - this save is dead. Allow it to go away. */ - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, REG_NOTES (insn)); - } - - /* We should now be at the base of the gr/br/fr spill area. */ - if (cfa_off != (current_frame_info.spill_cfa_off - + current_frame_info.spill_size)) - abort (); - - /* Spill all general registers. */ - for (regno = GR_REG (1); regno <= GR_REG (31); ++regno) - if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) - { - reg = gen_rtx_REG (DImode, regno); - do_spill (gen_gr_spill, reg, cfa_off, reg); - cfa_off -= 8; - } - - /* Handle BR0 specially -- it may be getting stored permanently in - some GR register. */ + /* Save the return pointer. */ if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0))) { reg = gen_rtx_REG (DImode, BR_REG (0)); @@ -2913,6 +3196,32 @@ ia64_expand_prologue (void) } } + if (current_frame_info.reg_save_gp) + { + insn = emit_move_insn (gen_rtx_REG (DImode, + current_frame_info.reg_save_gp), + pic_offset_table_rtx); + /* We don't know for sure yet if this is actually needed, since + we've not split the PIC call patterns. If all of the calls + are indirect, and not followed by any uses of the gp, then + this save is dead. Allow it to go away. */ + REG_NOTES (insn) + = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, REG_NOTES (insn)); + } + + /* We should now be at the base of the gr/br/fr spill area. */ + gcc_assert (cfa_off == (current_frame_info.spill_cfa_off + + current_frame_info.spill_size)); + + /* Spill all general registers. */ + for (regno = GR_REG (1); regno <= GR_REG (31); ++regno) + if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) + { + reg = gen_rtx_REG (DImode, regno); + do_spill (gen_gr_spill, reg, cfa_off, reg); + cfa_off -= 8; + } + /* Spill the rest of the BR registers. */ for (regno = BR_REG (1); regno <= BR_REG (7); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) @@ -2929,15 +3238,13 @@ ia64_expand_prologue (void) for (regno = FR_REG (2); regno <= FR_REG (127); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) { - if (cfa_off & 15) - abort (); + gcc_assert (!(cfa_off & 15)); reg = gen_rtx_REG (XFmode, regno); do_spill (gen_fr_spill_x, reg, cfa_off, reg); cfa_off -= 16; } - if (cfa_off != current_frame_info.spill_cfa_off) - abort (); + gcc_assert (cfa_off == current_frame_info.spill_cfa_off); finish_spill_pointers (); } @@ -3048,27 +3355,7 @@ ia64_expand_epilogue (int sibcall_p) emit_move_insn (reg, alt_reg); } - /* We should now be at the base of the gr/br/fr spill area. */ - if (cfa_off != (current_frame_info.spill_cfa_off - + current_frame_info.spill_size)) - abort (); - - /* The GP may be stored on the stack in the prologue, but it's - never restored in the epilogue. Skip the stack slot. */ - if (TEST_HARD_REG_BIT (current_frame_info.mask, GR_REG (1))) - cfa_off -= 8; - - /* Restore all general registers. */ - for (regno = GR_REG (2); regno <= GR_REG (31); ++regno) - if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) - { - reg = gen_rtx_REG (DImode, regno); - do_restore (gen_gr_restore, reg, cfa_off); - cfa_off -= 8; - } - - /* Restore the branch registers. Handle B0 specially, as it may - have gotten stored in some GR register. */ + /* Restore the return pointer. */ if (TEST_HARD_REG_BIT (current_frame_info.mask, BR_REG (0))) { if (current_frame_info.reg_save_b0 != 0) @@ -3084,6 +3371,25 @@ ia64_expand_epilogue (int sibcall_p) emit_move_insn (reg, alt_reg); } + /* We should now be at the base of the gr/br/fr spill area. */ + gcc_assert (cfa_off == (current_frame_info.spill_cfa_off + + current_frame_info.spill_size)); + + /* The GP may be stored on the stack in the prologue, but it's + never restored in the epilogue. Skip the stack slot. */ + if (TEST_HARD_REG_BIT (current_frame_info.mask, GR_REG (1))) + cfa_off -= 8; + + /* Restore all general registers. */ + for (regno = GR_REG (2); regno <= GR_REG (31); ++regno) + if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) + { + reg = gen_rtx_REG (DImode, regno); + do_restore (gen_gr_restore, reg, cfa_off); + cfa_off -= 8; + } + + /* Restore the branch registers. */ for (regno = BR_REG (1); regno <= BR_REG (7); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) { @@ -3099,8 +3405,7 @@ ia64_expand_epilogue (int sibcall_p) for (regno = FR_REG (2); regno <= FR_REG (127); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) { - if (cfa_off & 15) - abort (); + gcc_assert (!(cfa_off & 15)); reg = gen_rtx_REG (XFmode, regno); do_restore (gen_fr_restore_x, reg, cfa_off); cfa_off -= 16; @@ -3113,8 +3418,7 @@ ia64_expand_epilogue (int sibcall_p) emit_move_insn (reg, ar_unat_save_reg); } - if (cfa_off != current_frame_info.spill_cfa_off) - abort (); + gcc_assert (cfa_off == current_frame_info.spill_cfa_off); finish_spill_pointers (); @@ -3488,6 +3792,11 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) } } + /* Make sure addresses are Pmode even if we are in ILP32 mode. */ + addr = convert_memory_address (Pmode, addr); + fnaddr = convert_memory_address (Pmode, fnaddr); + static_chain = convert_memory_address (Pmode, static_chain); + /* Load up our iterator. */ addr_reg = gen_reg_rtx (Pmode); emit_move_insn (addr_reg, addr); @@ -3515,17 +3824,19 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) We generate the actual spill instructions during prologue generation. */ -void -ia64_setup_incoming_varargs (CUMULATIVE_ARGS cum, int int_mode, tree type, - int * pretend_size, +static void +ia64_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int * pretend_size, int second_time ATTRIBUTE_UNUSED) { - /* Skip the current argument. */ - ia64_function_arg_advance (&cum, int_mode, type, 1); + CUMULATIVE_ARGS next_cum = *cum; - if (cum.words < MAX_ARGUMENT_SLOTS) + /* Skip the current argument. */ + ia64_function_arg_advance (&next_cum, mode, type, 1); + + if (next_cum.words < MAX_ARGUMENT_SLOTS) { - int n = MAX_ARGUMENT_SLOTS - cum.words; + int n = MAX_ARGUMENT_SLOTS - next_cum.words; *pretend_size = n * UNITS_PER_WORD; cfun->machine->n_varargs = n; } @@ -3537,10 +3848,14 @@ ia64_setup_incoming_varargs (CUMULATIVE_ARGS cum, int int_mode, tree type, An aggregate is a homogeneous floating point aggregate is if all fields/elements in it have the same floating point type (e.g, - SFmode). 128-bit quad-precision floats are excluded. */ + SFmode). 128-bit quad-precision floats are excluded. + + Variable sized aggregates should never arrive here, since we should + have already decided to pass them by reference. Top-level zero-sized + aggregates are excluded because our parallels crash the middle-end. */ static enum machine_mode -hfa_element_mode (tree type, int nested) +hfa_element_mode (tree type, bool nested) { enum machine_mode element_mode = VOIDmode; enum machine_mode mode; @@ -3548,13 +3863,15 @@ hfa_element_mode (tree type, int nested) int know_element_mode = 0; tree t; + if (!nested && (!TYPE_SIZE (type) || integer_zerop (TYPE_SIZE (type)))) + return VOIDmode; + switch (code) { case VOID_TYPE: case INTEGER_TYPE: case ENUMERAL_TYPE: - case BOOLEAN_TYPE: case CHAR_TYPE: case POINTER_TYPE: + case BOOLEAN_TYPE: case POINTER_TYPE: case OFFSET_TYPE: case REFERENCE_TYPE: case METHOD_TYPE: - case FILE_TYPE: case SET_TYPE: case LANG_TYPE: - case FUNCTION_TYPE: + case LANG_TYPE: case FUNCTION_TYPE: return VOIDmode; /* Fortran complex types are supposed to be HFAs, so we need to handle @@ -3756,13 +4073,7 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else if (gr_size > UNITS_PER_WORD) int_regs += gr_size / UNITS_PER_WORD; } - - /* If we ended up using just one location, just return that one loc, but - change the mode back to the argument mode. */ - if (i == 1) - return gen_rtx_REG (mode, REGNO (XEXP (loc[0], 0))); - else - return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); + return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } /* Integral and aggregates go in general registers. If we have run out of @@ -3830,13 +4141,13 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, } } -/* Return number of words, at the beginning of the argument, that must be +/* Return number of bytes, at the beginning of the argument, that must be put in registers. 0 is the argument is entirely in registers or entirely in memory. */ -int -ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named ATTRIBUTE_UNUSED) +static int +ia64_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, bool named ATTRIBUTE_UNUSED) { int words = ia64_function_arg_words (type, mode); int offset = ia64_function_arg_offset (cum, type, words); @@ -3853,7 +4164,7 @@ ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (words + cum->words + offset <= MAX_ARGUMENT_SLOTS) return 0; - return MAX_ARGUMENT_SLOTS - cum->words - offset; + return (MAX_ARGUMENT_SLOTS - cum->words - offset) * UNITS_PER_WORD; } /* Update CUM to point after this argument. This is patterned after @@ -3913,10 +4224,11 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, cum->fp_regs = fp_regs; } - /* Integral and aggregates go in general registers. If we have run out of - FR registers, then FP values must also go in general registers. This can - happen when we have a SFmode HFA. */ - else if (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS) + /* Integral and aggregates go in general registers. So do TFmode FP values. + If we have run out of FR registers, then other FP values must also go in + general registers. This can happen when we have a SFmode HFA. */ + else if (mode == TFmode || mode == TCmode + || (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS)) cum->int_regs = cum->words; /* If there is a prototype, then FP values go in a FR register when @@ -3939,15 +4251,29 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, } } -/* Variable sized types are passed by reference. */ -/* ??? At present this is a GCC extension to the IA-64 ABI. */ +/* Arguments with alignment larger than 8 bytes start at the next even + boundary. On ILP32 HPUX, TFmode arguments start on next even boundary + even though their normal alignment is 8 bytes. See ia64_function_arg. */ int -ia64_function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED, - tree type, int named ATTRIBUTE_UNUSED) +ia64_function_arg_boundary (enum machine_mode mode, tree type) { - return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; + + if (mode == TFmode && TARGET_HPUX && TARGET_ILP32) + return PARM_BOUNDARY * 2; + + if (type) + { + if (TYPE_ALIGN (type) > PARM_BOUNDARY) + return PARM_BOUNDARY * 2; + else + return PARM_BOUNDARY; + } + + if (GET_MODE_BITSIZE (mode) > PARM_BOUNDARY) + return PARM_BOUNDARY * 2; + else + return PARM_BOUNDARY; } /* True if it is OK to do sibling call optimization for the specified @@ -3970,20 +4296,15 @@ ia64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) /* Implement va_arg. */ -rtx -ia64_va_arg (tree valist, tree type) +static tree +ia64_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { - tree t; - /* Variable sized types are passed by reference. */ - if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) { - rtx addr = force_reg (ptr_mode, - std_expand_builtin_va_arg (valist, build_pointer_type (type))); -#ifdef POINTERS_EXTEND_UNSIGNED - addr = convert_memory_address (Pmode, addr); -#endif - return gen_rtx_MEM (ptr_mode, addr); + tree ptrtype = build_pointer_type (type); + tree addr = std_gimplify_va_arg_expr (valist, ptrtype, pre_p, post_p); + return build_va_arg_indirect_ref (addr); } /* Aggregate arguments with alignment larger than 8 bytes start at @@ -3993,23 +4314,22 @@ ia64_va_arg (tree valist, tree type) if ((TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == INTEGER_TYPE) ? int_size_in_bytes (type) > 8 : TYPE_ALIGN (type) > 8 * BITS_PER_UNIT) { - t = build (PLUS_EXPR, TREE_TYPE (valist), valist, - build_int_2 (2 * UNITS_PER_WORD - 1, 0)); - t = build (BIT_AND_EXPR, TREE_TYPE (t), t, - build_int_2 (-2 * UNITS_PER_WORD, -1)); - t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + tree t = build2 (PLUS_EXPR, TREE_TYPE (valist), valist, + build_int_cst (NULL_TREE, 2 * UNITS_PER_WORD - 1)); + t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, + build_int_cst (NULL_TREE, -2 * UNITS_PER_WORD)); + t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t); + gimplify_and_add (t, pre_p); } - return std_expand_builtin_va_arg (valist, type); + return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); } /* Return 1 if function return value returned in memory. Return 0 if it is in a register. */ -int -ia64_return_in_memory (tree valtype) +static bool +ia64_return_in_memory (tree valtype, tree fntype ATTRIBUTE_UNUSED) { enum machine_mode mode; enum machine_mode hfa_mode; @@ -4021,7 +4341,7 @@ ia64_return_in_memory (tree valtype) { byte_size = int_size_in_bytes (valtype); if (byte_size < 0) - return 1; + return true; } /* Hfa's with up to 8 elements are returned in the FP argument registers. */ @@ -4032,14 +4352,14 @@ ia64_return_in_memory (tree valtype) int hfa_size = GET_MODE_SIZE (hfa_mode); if (byte_size / hfa_size > MAX_ARGUMENT_SLOTS) - return 1; + return true; else - return 0; + return false; } else if (byte_size > UNITS_PER_WORD * MAX_INT_RETURN_SLOTS) - return 1; + return true; else - return 0; + return false; } /* Return rtx for register that holds the function return value. */ @@ -4072,18 +4392,30 @@ ia64_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) GEN_INT (offset)); offset += hfa_size; } - - if (i == 1) - return XEXP (loc[0], 0); - else - return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); + return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } else if (FLOAT_TYPE_P (valtype) && mode != TFmode && mode != TCmode) return gen_rtx_REG (mode, FR_ARG_FIRST); else { + bool need_parallel = false; + + /* In big-endian mode, we need to manage the layout of aggregates + in the registers so that we get the bits properly aligned in + the highpart of the registers. */ if (BYTES_BIG_ENDIAN && (mode == BLKmode || (valtype && AGGREGATE_TYPE_P (valtype)))) + need_parallel = true; + + /* Something like struct S { long double x; char a[0] } is not an + HFA structure, and therefore doesn't go in fp registers. But + the middle-end will give it XFmode anyway, and XFmode values + don't normally fit in integer registers. So we need to smuggle + the value inside a parallel. */ + else if (mode == XFmode || mode == XCmode || mode == RFmode) + need_parallel = true; + + if (need_parallel) { rtx loc[8]; int offset; @@ -4092,6 +4424,10 @@ ia64_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) offset = 0; bytesize = int_size_in_bytes (valtype); + /* An empty PARALLEL is invalid here, but the return value + doesn't matter for empty structs. */ + if (bytesize == 0) + return gen_rtx_REG (mode, GR_RET_FIRST); for (i = 0; offset < bytesize; i++) { loc[i] = gen_rtx_EXPR_LIST (VOIDmode, @@ -4102,20 +4438,22 @@ ia64_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) } return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } - else - return gen_rtx_REG (mode, GR_RET_FIRST); + + return gen_rtx_REG (mode, GR_RET_FIRST); } } -/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. +/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. We need to emit DTP-relative relocations. */ -void +static void ia64_output_dwarf_dtprel (FILE *file, int size, rtx x) { - if (size != 8) - abort (); - fputs ("\tdata8.ua\t@dtprel(", file); + gcc_assert (size == 4 || size == 8); + if (size == 4) + fputs ("\tdata4.ua\t@dtprel(", file); + else + fputs ("\tdata8.ua\t@dtprel(", file); output_addr_const (file, x); fputs (")", file); } @@ -4149,8 +4487,11 @@ ia64_print_operand_address (FILE * stream ATTRIBUTE_UNUSED, for Intel assembler. U Print an 8-bit sign extended number (K) as a 64-bit unsigned number for Intel assembler. + X A pair of floating point registers. r Print register name, or constant 0 as r0. HP compatibility for - Linux kernel. */ + Linux kernel. + v Print vector constant value as an 8-byte integer value. */ + void ia64_print_operand (FILE * file, rtx x, int code) { @@ -4201,10 +4542,11 @@ ia64_print_operand (FILE * file, rtx x, int code) str = reg_names [FR_REG (0)]; else if (x == CONST1_RTX (GET_MODE (x))) str = reg_names [FR_REG (1)]; - else if (GET_CODE (x) == REG) - str = reg_names [REGNO (x)]; else - abort (); + { + gcc_assert (GET_CODE (x) == REG); + str = reg_names [REGNO (x)]; + } fputs (str, file); return; @@ -4242,13 +4584,12 @@ ia64_print_operand (FILE * file, rtx x, int code) x = XEXP (XEXP (XEXP (x, 0), 1), 1); if (GET_CODE (x) == CONST_INT) value = INTVAL (x); - else if (GET_CODE (x) == REG) + else { + gcc_assert (GET_CODE (x) == REG); fprintf (file, ", %s", reg_names[REGNO (x)]); return; } - else - abort (); break; case POST_INC: @@ -4295,6 +4636,13 @@ ia64_print_operand (FILE * file, rtx x, int code) } break; + case 'X': + { + unsigned int regno = REGNO (x); + fprintf (file, "%s, %s", reg_names [regno], reg_names [regno + 1]); + } + return; + case 'r': /* If this operand is the constant zero, write it as register zero. Any register, zero, or CONST_INT value is OK here. */ @@ -4308,6 +4656,11 @@ ia64_print_operand (FILE * file, rtx x, int code) output_operand_lossage ("invalid %%r value"); return; + case 'v': + gcc_assert (GET_CODE (x) == CONST_VECTOR); + x = simplify_subreg (DImode, x, GET_MODE (x), 0); + break; + case '+': { const char *which; @@ -4320,11 +4673,13 @@ ia64_print_operand (FILE * file, rtx x, int code) int pred_val = INTVAL (XEXP (x, 0)); /* Guess top and bottom 10% statically predicted. */ - if (pred_val < REG_BR_PROB_BASE / 50) + if (pred_val < REG_BR_PROB_BASE / 50 + && br_prob_note_reliable_p (x)) which = ".spnt"; else if (pred_val < REG_BR_PROB_BASE / 2) which = ".dpnt"; - else if (pred_val < REG_BR_PROB_BASE / 100 * 98) + else if (pred_val < REG_BR_PROB_BASE / 100 * 98 + || !br_prob_note_reliable_p (x)) which = ".dptk"; else which = ".sptk"; @@ -4370,7 +4725,7 @@ ia64_print_operand (FILE * file, rtx x, int code) case MEM: { rtx addr = XEXP (x, 0); - if (GET_RTX_CLASS (GET_CODE (addr)) == 'a') + if (GET_RTX_CLASS (GET_CODE (addr)) == RTX_AUTOINC) addr = XEXP (addr, 0); fprintf (file, "[%s]", reg_names [REGNO (addr)]); break; @@ -4485,7 +4840,7 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from, so that we get secondary memory reloads. Between FR_REGS, we have to make this at least as expensive as MEMORY_MOVE_COST to avoid spectacularly poor register class preferencing. */ - if (mode == XFmode) + if (mode == XFmode || mode == RFmode) { if (to != GR_REGS || from != GR_REGS) return MEMORY_MOVE_COST (mode, to, 0); @@ -4519,18 +4874,53 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from, case GR_REGS: case FR_REGS: + case FP_REGS: case GR_AND_FR_REGS: case GR_AND_BR_REGS: case ALL_REGS: break; default: - abort (); + gcc_unreachable (); } return 2; } +/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on CLASS + to use when copying X into that class. */ + +enum reg_class +ia64_preferred_reload_class (rtx x, enum reg_class class) +{ + switch (class) + { + case FR_REGS: + case FP_REGS: + /* Don't allow volatile mem reloads into floating point registers. + This is defined to force reload to choose the r/m case instead + of the f/f case when reloading (set (reg fX) (mem/v)). */ + if (MEM_P (x) && MEM_VOLATILE_P (x)) + return NO_REGS; + + /* Force all unrecognized constants into the constant pool. */ + if (CONSTANT_P (x)) + return NO_REGS; + break; + + case AR_M_REGS: + case AR_I_REGS: + if (!OBJECT_P (x)) + return NO_REGS; + break; + + default: + break; + } + + return class; +} + /* This function returns the register class required for a secondary register when copying between one of the registers in CLASS, and X, using MODE. A return value of NO_REGS means that no secondary register @@ -4572,6 +4962,7 @@ ia64_secondary_reload_class (enum reg_class class, break; case FR_REGS: + case FP_REGS: /* Need to go through general registers to get to other class regs. */ if (regno >= 0 && ! (FR_REGNO_P (regno) || GENERAL_REGNO_P (regno))) return GR_REGS; @@ -4690,7 +5081,7 @@ fix_range (const char *const_str) dash = strchr (str, '-'); if (!dash) { - warning ("value of -mfixed-range must have form REG1-REG2"); + warning (0, "value of -mfixed-range must have form REG1-REG2"); return; } *dash = '\0'; @@ -4702,14 +5093,14 @@ fix_range (const char *const_str) first = decode_reg_name (str); if (first < 0) { - warning ("unknown register name: %s", str); + warning (0, "unknown register name: %s", str); return; } last = decode_reg_name (dash + 1); if (last < 0) { - warning ("unknown register name: %s", dash + 1); + warning (0, "unknown register name: %s", dash + 1); return; } @@ -4717,7 +5108,7 @@ fix_range (const char *const_str) if (first > last) { - warning ("%s-%s is an empty range", str, dash + 1); + warning (0, "%s-%s is an empty range", str, dash + 1); return; } @@ -4732,87 +5123,70 @@ fix_range (const char *const_str) } } -static struct machine_function * -ia64_init_machine_status (void) +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +ia64_handle_option (size_t code, const char *arg, int value) { - return ggc_alloc_cleared (sizeof (struct machine_function)); + switch (code) + { + case OPT_mfixed_range_: + fix_range (arg); + return true; + + case OPT_mtls_size_: + if (value != 14 && value != 22 && value != 64) + error ("bad value %<%s%> for -mtls-size= switch", arg); + return true; + + case OPT_mtune_: + { + static struct pta + { + const char *name; /* processor name or nickname. */ + enum processor_type processor; + } + const processor_alias_table[] = + { + {"itanium", PROCESSOR_ITANIUM}, + {"itanium1", PROCESSOR_ITANIUM}, + {"merced", PROCESSOR_ITANIUM}, + {"itanium2", PROCESSOR_ITANIUM2}, + {"mckinley", PROCESSOR_ITANIUM2}, + }; + int const pta_size = ARRAY_SIZE (processor_alias_table); + int i; + + for (i = 0; i < pta_size; i++) + if (!strcmp (arg, processor_alias_table[i].name)) + { + ia64_tune = processor_alias_table[i].processor; + break; + } + if (i == pta_size) + error ("bad value %<%s%> for -mtune= switch", arg); + return true; + } + + default: + return true; + } } -/* Handle TARGET_OPTIONS switches. */ +/* Implement OVERRIDE_OPTIONS. */ void ia64_override_options (void) { - static struct pta - { - const char *const name; /* processor name or nickname. */ - const enum processor_type processor; - } - const processor_alias_table[] = - { - {"itanium", PROCESSOR_ITANIUM}, - {"itanium1", PROCESSOR_ITANIUM}, - {"merced", PROCESSOR_ITANIUM}, - {"itanium2", PROCESSOR_ITANIUM2}, - {"mckinley", PROCESSOR_ITANIUM2}, - }; - - int const pta_size = ARRAY_SIZE (processor_alias_table); - int i; - if (TARGET_AUTO_PIC) target_flags |= MASK_CONST_GP; - if (TARGET_INLINE_FLOAT_DIV_LAT && TARGET_INLINE_FLOAT_DIV_THR) + if (TARGET_INLINE_SQRT == INL_MIN_LAT) { - warning ("cannot optimize floating point division for both latency and throughput"); - target_flags &= ~MASK_INLINE_FLOAT_DIV_THR; + warning (0, "not yet implemented: latency-optimized inline square root"); + TARGET_INLINE_SQRT = INL_MAX_THR; } - if (TARGET_INLINE_INT_DIV_LAT && TARGET_INLINE_INT_DIV_THR) - { - warning ("cannot optimize integer division for both latency and throughput"); - target_flags &= ~MASK_INLINE_INT_DIV_THR; - } - - if (TARGET_INLINE_SQRT_LAT && TARGET_INLINE_SQRT_THR) - { - warning ("cannot optimize square root for both latency and throughput"); - target_flags &= ~MASK_INLINE_SQRT_THR; - } - - if (TARGET_INLINE_SQRT_LAT) - { - warning ("not yet implemented: latency-optimized inline square root"); - target_flags &= ~MASK_INLINE_SQRT_LAT; - } - - if (ia64_fixed_range_string) - fix_range (ia64_fixed_range_string); - - if (ia64_tls_size_string) - { - char *end; - unsigned long tmp = strtoul (ia64_tls_size_string, &end, 10); - if (*end || (tmp != 14 && tmp != 22 && tmp != 64)) - error ("bad value (%s) for -mtls-size= switch", ia64_tls_size_string); - else - ia64_tls_size = tmp; - } - - if (!ia64_tune_string) - ia64_tune_string = "itanium2"; - - for (i = 0; i < pta_size; i++) - if (! strcmp (ia64_tune_string, processor_alias_table[i].name)) - { - ia64_tune = processor_alias_table[i].processor; - break; - } - - if (i == pta_size) - error ("bad value (%s) for -tune= switch", ia64_tune_string); - ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload; flag_schedule_insns_after_reload = 0; @@ -4820,6 +5194,12 @@ ia64_override_options (void) init_machine_status = ia64_init_machine_status; } + +static struct machine_function * +ia64_init_machine_status (void) +{ + return ggc_alloc_cleared (sizeof (struct machine_function)); +} static enum attr_itanium_class ia64_safe_itanium_class (rtx); static enum attr_type ia64_safe_type (rtx); @@ -4851,7 +5231,6 @@ ia64_safe_type (rtx insn) never explicitly used in gcc generated code, it seems wasteful to do so (plus it would make the call and return patterns needlessly complex). */ -#define REG_GP (GR_REG (1)) #define REG_RP (BR_REG (0)) #define REG_AR_CFM (FIRST_PSEUDO_REGISTER + 1) /* This is used for volatile asms which may require a stop bit immediately @@ -4896,8 +5275,8 @@ struct reg_write_state rws_sum[NUM_REGS]; struct reg_write_state rws_insn[NUM_REGS]; /* Indicates whether this is the first instruction after a stop bit, - in which case we don't need another stop bit. Without this, we hit - the abort in ia64_variable_issue when scheduling an alloc. */ + in which case we don't need another stop bit. Without this, + ia64_variable_issue will die when scheduling an alloc. */ static int first_instruction; /* Misc flags needed to compute RAW/WAW dependencies while we are traversing @@ -4915,12 +5294,12 @@ struct reg_flags static void rws_update (struct reg_write_state *, int, struct reg_flags, int); static int rws_access_regno (int, struct reg_flags, int); static int rws_access_reg (rtx, struct reg_flags, int); -static void update_set_flags (rtx, struct reg_flags *, int *, rtx *); -static int set_src_needs_barrier (rtx, struct reg_flags, int, rtx); +static void update_set_flags (rtx, struct reg_flags *); +static int set_src_needs_barrier (rtx, struct reg_flags, int); static int rtx_needs_barrier (rtx, struct reg_flags, int); static void init_insn_group_barriers (void); -static int group_barrier_needed_p (rtx); -static int safe_group_barrier_needed_p (rtx); +static int group_barrier_needed (rtx); +static int safe_group_barrier_needed (rtx); /* Update *RWS for REGNO, which is being written by the current instruction, with predicate PRED, and associated register flags in FLAGS. */ @@ -4948,8 +5327,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) { int need_barrier = 0; - if (regno >= NUM_REGS) - abort (); + gcc_assert (regno < NUM_REGS); if (! PR_REGNO_P (regno)) flags.is_and = flags.is_or = 0; @@ -4959,8 +5337,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) int write_count; /* One insn writes same reg multiple times? */ - if (rws_insn[regno].write_count > 0) - abort (); + gcc_assert (!rws_insn[regno].write_count); /* Update info for current instruction. */ rws_update (rws_insn, regno, flags, pred); @@ -5001,7 +5378,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } } else @@ -5054,7 +5431,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } } @@ -5082,62 +5459,31 @@ rws_access_reg (rtx reg, struct reg_flags flags, int pred) the condition, stored in *PFLAGS, *PPRED and *PCOND. */ static void -update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond) +update_set_flags (rtx x, struct reg_flags *pflags) { rtx src = SET_SRC (x); - *pcond = 0; - switch (GET_CODE (src)) { case CALL: return; case IF_THEN_ELSE: - if (SET_DEST (x) == pc_rtx) - /* X is a conditional branch. */ - return; - else - { - int is_complemented = 0; - - /* X is a conditional move. */ - rtx cond = XEXP (src, 0); - if (GET_CODE (cond) == EQ) - is_complemented = 1; - cond = XEXP (cond, 0); - if (GET_CODE (cond) != REG - && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS) - abort (); - *pcond = cond; - if (XEXP (src, 1) == SET_DEST (x) - || XEXP (src, 2) == SET_DEST (x)) - { - /* X is a conditional move that conditionally writes the - destination. */ - - /* We need another complement in this case. */ - if (XEXP (src, 1) == SET_DEST (x)) - is_complemented = ! is_complemented; - - *ppred = REGNO (cond); - if (is_complemented) - ++*ppred; - } - - /* ??? If this is a conditional write to the dest, then this - instruction does not actually read one source. This probably - doesn't matter, because that source is also the dest. */ - /* ??? Multiple writes to predicate registers are allowed - if they are all AND type compares, or if they are all OR - type compares. We do not generate such instructions - currently. */ - } - /* ... fall through ... */ + /* There are four cases here: + (1) The destination is (pc), in which case this is a branch, + nothing here applies. + (2) The destination is ar.lc, in which case this is a + doloop_end_internal, + (3) The destination is an fp register, in which case this is + an fselect instruction. + (4) The condition has (unspec [(reg)] UNSPEC_LDC), in which case + this is a check load. + In all cases, nothing we do in this function applies. */ + return; default: - if (GET_RTX_CLASS (GET_CODE (src)) == '<' - && GET_MODE_CLASS (GET_MODE (XEXP (src, 0))) == MODE_FLOAT) + if (COMPARISON_P (src) + && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (src, 0)))) /* Set pflags->is_fp to 1 so that we know we're dealing with a floating point comparison when processing the destination of the SET. */ @@ -5161,7 +5507,7 @@ update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond) for this insn. */ static int -set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond) +set_src_needs_barrier (rtx x, struct reg_flags flags, int pred) { int need_barrier = 0; rtx dst; @@ -5176,22 +5522,29 @@ set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond) /* X is a conditional branch. */ /* ??? This seems redundant, as the caller sets this bit for all JUMP_INSNs. */ - flags.is_branch = 1; + if (!ia64_spec_check_src_p (src)) + flags.is_branch = 1; return rtx_needs_barrier (src, flags, pred); } - need_barrier = rtx_needs_barrier (src, flags, pred); + if (ia64_spec_check_src_p (src)) + /* Avoid checking one register twice (in condition + and in 'then' section) for ldc pattern. */ + { + gcc_assert (REG_P (XEXP (src, 2))); + need_barrier = rtx_needs_barrier (XEXP (src, 2), flags, pred); + + /* We process MEM below. */ + src = XEXP (src, 1); + } - /* This instruction unconditionally uses a predicate register. */ - if (cond) - need_barrier |= rws_access_reg (cond, flags, 0); + need_barrier |= rtx_needs_barrier (src, flags, pred); dst = SET_DEST (x); if (GET_CODE (dst) == ZERO_EXTRACT) { need_barrier |= rtx_needs_barrier (XEXP (dst, 1), flags, pred); need_barrier |= rtx_needs_barrier (XEXP (dst, 2), flags, pred); - dst = XEXP (dst, 0); } return need_barrier; } @@ -5208,7 +5561,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) int need_barrier = 0; const char *format_ptr; struct reg_flags new_flags; - rtx cond = 0; + rtx cond; if (! x) return 0; @@ -5218,8 +5571,8 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) switch (GET_CODE (x)) { case SET: - update_set_flags (x, &new_flags, &pred, &cond); - need_barrier = set_src_needs_barrier (x, new_flags, pred, cond); + update_set_flags (x, &new_flags); + need_barrier = set_src_needs_barrier (x, new_flags, pred); if (GET_CODE (SET_SRC (x)) != CALL) { new_flags.is_write = 1; @@ -5232,7 +5585,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) need_barrier |= rws_access_regno (AR_EC_REGNUM, new_flags, pred); /* Avoid multiple register writes, in case this is a pattern with - multiple CALL rtx. This avoids an abort in rws_access_reg. */ + multiple CALL rtx. This avoids a failure in rws_access_reg. */ if (! flags.is_sibcall && ! rws_insn[REG_AR_CFM].write_count) { new_flags.is_write = 1; @@ -5246,16 +5599,14 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) /* X is a predicated instruction. */ cond = COND_EXEC_TEST (x); - if (pred) - abort (); + gcc_assert (!pred); need_barrier = rtx_needs_barrier (cond, flags, 0); if (GET_CODE (cond) == EQ) is_complemented = 1; cond = XEXP (cond, 0); - if (GET_CODE (cond) != REG - && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS) - abort (); + gcc_assert (GET_CODE (cond) == REG + && REGNO_REG_CLASS (REGNO (cond)) == PR_REGS); pred = REGNO (cond); if (is_complemented) ++pred; @@ -5276,7 +5627,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) || (MEM_VOLATILE_P (x) && TARGET_VOL_ASM_STOP)) { /* Avoid writing the register multiple times if we have multiple - asm outputs. This avoids an abort in rws_access_reg. */ + asm outputs. This avoids a failure in rws_access_reg. */ if (! rws_insn[REG_VOLATILE].write_count) { new_flags.is_write = 1; @@ -5286,7 +5637,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) } /* For all ASM_OPERANDS, we must traverse the vector of input operands. - We can not just fall through here since then we would be confused + We cannot just fall through here since then we would be confused by the ASM_INPUT rtx inside ASM_OPERANDS, which do not indicate traditional asms unlike their normal usage. */ @@ -5299,17 +5650,26 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) for (i = XVECLEN (x, 0) - 1; i >= 0; --i) { rtx pat = XVECEXP (x, 0, i); - if (GET_CODE (pat) == SET) + switch (GET_CODE (pat)) { - update_set_flags (pat, &new_flags, &pred, &cond); - need_barrier |= set_src_needs_barrier (pat, new_flags, pred, cond); + case SET: + update_set_flags (pat, &new_flags); + need_barrier |= set_src_needs_barrier (pat, new_flags, pred); + break; + + case USE: + case CALL: + case ASM_OPERANDS: + need_barrier |= rtx_needs_barrier (pat, flags, pred); + break; + + case CLOBBER: + case RETURN: + break; + + default: + gcc_unreachable (); } - else if (GET_CODE (pat) == USE - || GET_CODE (pat) == CALL - || GET_CODE (pat) == ASM_OPERANDS) - need_barrier |= rtx_needs_barrier (pat, flags, pred); - else if (GET_CODE (pat) != CLOBBER && GET_CODE (pat) != RETURN) - abort (); } for (i = XVECLEN (x, 0) - 1; i >= 0; --i) { @@ -5329,8 +5689,8 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; case SUBREG: - x = SUBREG_REG (x); - /* FALLTHRU */ + need_barrier |= rtx_needs_barrier (SUBREG_REG (x), flags, pred); + break; case REG: if (REGNO (x) == AR_UNAT_REGNUM) { @@ -5347,14 +5707,13 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) need_barrier = rtx_needs_barrier (XEXP (x, 0), new_flags, pred); break; - case CONST_INT: case CONST_DOUBLE: + case CONST_INT: case CONST_DOUBLE: case CONST_VECTOR: case SYMBOL_REF: case LABEL_REF: case CONST: break; /* Operators with side-effects. */ case POST_INC: case POST_DEC: - if (GET_CODE (XEXP (x, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == REG); new_flags.is_write = 0; need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred); @@ -5363,8 +5722,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; case POST_MODIFY: - if (GET_CODE (XEXP (x, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == REG); new_flags.is_write = 0; need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred); @@ -5391,6 +5749,14 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) need_barrier = rtx_needs_barrier (XEXP (x, 0), flags, pred); break; + case VEC_SELECT: + /* VEC_SELECT's second argument is a PARALLEL with integers that + describe the elements selected. On ia64, those integers are + always constants. Avoid walking the PARALLEL so that we don't + get confused with "normal" parallels and then die. */ + need_barrier = rtx_needs_barrier (XEXP (x, 0), flags, pred); + break; + case UNSPEC: switch (XINT (x, 1)) { @@ -5415,7 +5781,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) HOST_WIDE_INT bit = (offset >> 3) & 63; need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred); - new_flags.is_write = (XINT (x, 1) == 1); + new_flags.is_write = (XINT (x, 1) == UNSPEC_GR_SPILL); need_barrier |= rws_access_regno (AR_UNAT_BIT_0 + bit, new_flags, pred); break; @@ -5427,10 +5793,17 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) case UNSPEC_SETF_EXP: case UNSPEC_ADDP4: case UNSPEC_FR_SQRT_RECIP_APPROX: + case UNSPEC_LDA: + case UNSPEC_LDS: + case UNSPEC_LDSA: + case UNSPEC_CHKACLR: + case UNSPEC_CHKS: need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred); break; case UNSPEC_FR_RECIP_APPROX: + case UNSPEC_SHRP: + case UNSPEC_COPYSIGN: need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred); need_barrier |= rtx_needs_barrier (XVECEXP (x, 0, 1), flags, pred); break; @@ -5441,7 +5814,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } break; @@ -5474,7 +5847,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) return 0; default: - abort (); + gcc_unreachable (); } break; @@ -5513,14 +5886,14 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } break; } return need_barrier; } -/* Clear out the state for group_barrier_needed_p at the start of a +/* Clear out the state for group_barrier_needed at the start of a sequence of insns. */ static void @@ -5530,12 +5903,12 @@ init_insn_group_barriers (void) first_instruction = 1; } -/* Given the current state, recorded by previous calls to this function, - determine whether a group barrier (a stop bit) is necessary before INSN. - Return nonzero if so. */ +/* Given the current state, determine whether a group barrier (a stop bit) is + necessary before INSN. Return nonzero if so. This modifies the state to + include the effects of INSN as a side-effect. */ static int -group_barrier_needed_p (rtx insn) +group_barrier_needed (rtx insn) { rtx pat; int need_barrier = 0; @@ -5572,7 +5945,8 @@ group_barrier_needed_p (rtx insn) break; case JUMP_INSN: - flags.is_branch = 1; + if (!ia64_spec_check_p (insn)) + flags.is_branch = 1; /* Don't bundle a jump following a call. */ if ((pat = prev_active_insn (insn)) @@ -5628,7 +6002,7 @@ group_barrier_needed_p (rtx insn) break; default: - abort (); + gcc_unreachable (); } if (first_instruction && INSN_P (insn) @@ -5643,10 +6017,10 @@ group_barrier_needed_p (rtx insn) return need_barrier; } -/* Like group_barrier_needed_p, but do not clobber the current state. */ +/* Like group_barrier_needed, but do not clobber the current state. */ static int -safe_group_barrier_needed_p (rtx insn) +safe_group_barrier_needed (rtx insn) { struct reg_write_state rws_saved[NUM_REGS]; int saved_first_instruction; @@ -5655,7 +6029,7 @@ safe_group_barrier_needed_p (rtx insn) memcpy (rws_saved, rws_sum, NUM_REGS * sizeof *rws_saved); saved_first_instruction = first_instruction; - t = group_barrier_needed_p (insn); + t = group_barrier_needed (insn); memcpy (rws_sum, rws_saved, NUM_REGS * sizeof *rws_saved); first_instruction = saved_first_instruction; @@ -5705,7 +6079,7 @@ emit_insn_group_barriers (FILE *dump) { insns_since_last_label = 1; - if (group_barrier_needed_p (insn)) + if (group_barrier_needed (insn)) { if (last_label) { @@ -5753,157 +6127,16 @@ emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) { if (recog_memoized (insn) == CODE_FOR_insn_group_barrier) init_insn_group_barriers (); - else if (group_barrier_needed_p (insn)) + else if (group_barrier_needed (insn)) { emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); init_insn_group_barriers (); - group_barrier_needed_p (insn); + group_barrier_needed (insn); } } } } - -static int errata_find_address_regs (rtx *, void *); -static void errata_emit_nops (rtx); -static void fixup_errata (void); - -/* This structure is used to track some details about the previous insns - groups so we can determine if it may be necessary to insert NOPs to - workaround hardware errata. */ -static struct group -{ - HARD_REG_SET p_reg_set; - HARD_REG_SET gr_reg_conditionally_set; -} last_group[2]; - -/* Index into the last_group array. */ -static int group_idx; - -/* Called through for_each_rtx; determines if a hard register that was - conditionally set in the previous group is used as an address register. - It ensures that for_each_rtx returns 1 in that case. */ -static int -errata_find_address_regs (rtx *xp, void *data ATTRIBUTE_UNUSED) -{ - rtx x = *xp; - if (GET_CODE (x) != MEM) - return 0; - x = XEXP (x, 0); - if (GET_CODE (x) == POST_MODIFY) - x = XEXP (x, 0); - if (GET_CODE (x) == REG) - { - struct group *prev_group = last_group + (group_idx ^ 1); - if (TEST_HARD_REG_BIT (prev_group->gr_reg_conditionally_set, - REGNO (x))) - return 1; - return -1; - } - return 0; -} - -/* Called for each insn; this function keeps track of the state in - last_group and emits additional NOPs if necessary to work around - an Itanium A/B step erratum. */ -static void -errata_emit_nops (rtx insn) -{ - struct group *this_group = last_group + group_idx; - struct group *prev_group = last_group + (group_idx ^ 1); - rtx pat = PATTERN (insn); - rtx cond = GET_CODE (pat) == COND_EXEC ? COND_EXEC_TEST (pat) : 0; - rtx real_pat = cond ? COND_EXEC_CODE (pat) : pat; - enum attr_type type; - rtx set = real_pat; - - if (GET_CODE (real_pat) == USE - || GET_CODE (real_pat) == CLOBBER - || GET_CODE (real_pat) == ASM_INPUT - || GET_CODE (real_pat) == ADDR_VEC - || GET_CODE (real_pat) == ADDR_DIFF_VEC - || asm_noperands (PATTERN (insn)) >= 0) - return; - - /* single_set doesn't work for COND_EXEC insns, so we have to duplicate - parts of it. */ - - if (GET_CODE (set) == PARALLEL) - { - int i; - set = XVECEXP (real_pat, 0, 0); - for (i = 1; i < XVECLEN (real_pat, 0); i++) - if (GET_CODE (XVECEXP (real_pat, 0, i)) != USE - && GET_CODE (XVECEXP (real_pat, 0, i)) != CLOBBER) - { - set = 0; - break; - } - } - - if (set && GET_CODE (set) != SET) - set = 0; - - type = get_attr_type (insn); - - if (type == TYPE_F - && set && REG_P (SET_DEST (set)) && PR_REGNO_P (REGNO (SET_DEST (set)))) - SET_HARD_REG_BIT (this_group->p_reg_set, REGNO (SET_DEST (set))); - - if ((type == TYPE_M || type == TYPE_A) && cond && set - && REG_P (SET_DEST (set)) - && GET_CODE (SET_SRC (set)) != PLUS - && GET_CODE (SET_SRC (set)) != MINUS - && (GET_CODE (SET_SRC (set)) != ASHIFT - || !shladd_operand (XEXP (SET_SRC (set), 1), VOIDmode)) - && (GET_CODE (SET_SRC (set)) != MEM - || GET_CODE (XEXP (SET_SRC (set), 0)) != POST_MODIFY) - && GENERAL_REGNO_P (REGNO (SET_DEST (set)))) - { - if (GET_RTX_CLASS (GET_CODE (cond)) != '<' - || ! REG_P (XEXP (cond, 0))) - abort (); - - if (TEST_HARD_REG_BIT (prev_group->p_reg_set, REGNO (XEXP (cond, 0)))) - SET_HARD_REG_BIT (this_group->gr_reg_conditionally_set, REGNO (SET_DEST (set))); - } - if (for_each_rtx (&real_pat, errata_find_address_regs, NULL)) - { - emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); - emit_insn_before (gen_nop (), insn); - emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); - group_idx = 0; - memset (last_group, 0, sizeof last_group); - } -} - -/* Emit extra nops if they are required to work around hardware errata. */ - -static void -fixup_errata (void) -{ - rtx insn; - - if (! TARGET_B_STEP) - return; - - group_idx = 0; - memset (last_group, 0, sizeof last_group); - - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - { - if (!INSN_P (insn)) - continue; - - if (ia64_safe_type (insn) == TYPE_S) - { - group_idx ^= 1; - memset (last_group + group_idx, 0, sizeof last_group[group_idx]); - } - else - errata_emit_nops (insn); - } -} /* Instruction scheduling support. */ @@ -5932,7 +6165,7 @@ static const char *bundle_name [NR_BUNDLES] = int ia64_final_schedule = 0; -/* Codes of the corresponding quieryied units: */ +/* Codes of the corresponding queried units: */ static int _0mii_, _0mmi_, _0mfi_, _0mmf_; static int _0bbb_, _0mbb_, _0mib_, _0mmb_, _0mfb_, _0mlx_; @@ -5967,7 +6200,15 @@ static state_t prev_cycle_state = NULL; /* The following array element values are TRUE if the corresponding insn requires to add stop bits before it. */ -static char *stops_p; +static char *stops_p = NULL; + +/* The following array element values are ZERO for non-speculative + instructions and hold corresponding speculation check number for + speculative instructions. */ +static int *spec_check_no = NULL; + +/* Size of spec_check_no array. */ +static int max_uid = 0; /* The following variable is used to set up the mentioned above array. */ @@ -5989,6 +6230,9 @@ static int *clocks; static int *add_cycles; +/* The following variable value is number of data speculations in progress. */ +static int pending_data_specs = 0; + static rtx ia64_single_set (rtx); static void ia64_emit_insn_before (rtx, rtx); @@ -6038,16 +6282,18 @@ ia64_single_set (rtx insn) return ret; } -/* Adjust the cost of a scheduling dependency. Return the new cost of - a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ +/* Adjust the cost of a scheduling dependency. + Return the new cost of a dependency of type DEP_TYPE or INSN on DEP_INSN. + COST is the current cost. */ static int -ia64_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) +ia64_adjust_cost_2 (rtx insn, int dep_type1, rtx dep_insn, int cost) { + enum reg_note dep_type = (enum reg_note) dep_type1; enum attr_itanium_class dep_class; enum attr_itanium_class insn_class; - if (REG_NOTE_KIND (link) != REG_DEP_OUTPUT) + if (dep_type != REG_DEP_OUTPUT) return cost; insn_class = ia64_safe_itanium_class (insn); @@ -6078,6 +6324,12 @@ ia64_dependencies_evaluation_hook (rtx head, rtx tail) { rtx insn, link, next, next_tail; + /* Before reload, which_alternative is not set, which means that + ia64_safe_itanium_class will produce wrong results for (at least) + move instructions. */ + if (!reload_completed) + return; + next_tail = NEXT_INSN (tail); for (insn = head; insn != next_tail; insn = NEXT_INSN (insn)) if (INSN_P (insn)) @@ -6088,14 +6340,19 @@ ia64_dependencies_evaluation_hook (rtx head, rtx tail) { for (link = INSN_DEPEND (insn); link != 0; link = XEXP (link, 1)) { + enum attr_itanium_class c; + + if (REG_NOTE_KIND (link) != REG_DEP_TRUE) + continue; next = XEXP (link, 0); - if ((ia64_safe_itanium_class (next) == ITANIUM_CLASS_ST - || ia64_safe_itanium_class (next) == ITANIUM_CLASS_STF) + c = ia64_safe_itanium_class (next); + if ((c == ITANIUM_CLASS_ST + || c == ITANIUM_CLASS_STF) && ia64_st_address_bypass_p (insn, next)) break; - else if ((ia64_safe_itanium_class (next) == ITANIUM_CLASS_LD - || ia64_safe_itanium_class (next) - == ITANIUM_CLASS_FLD) + else if ((c == ITANIUM_CLASS_LD + || c == ITANIUM_CLASS_FLD + || c == ITANIUM_CLASS_FLDP) && ia64_ld_address_bypass_p (insn, next)) break; } @@ -6117,13 +6374,32 @@ ia64_sched_init (FILE *dump ATTRIBUTE_UNUSED, for (insn = NEXT_INSN (current_sched_info->prev_head); insn != current_sched_info->next_tail; insn = NEXT_INSN (insn)) - if (SCHED_GROUP_P (insn)) - abort (); + gcc_assert (!SCHED_GROUP_P (insn)); #endif last_scheduled_insn = NULL_RTX; init_insn_group_barriers (); } +/* We're beginning a scheduling pass. Check assertion. */ + +static void +ia64_sched_init_global (FILE *dump ATTRIBUTE_UNUSED, + int sched_verbose ATTRIBUTE_UNUSED, + int max_ready ATTRIBUTE_UNUSED) +{ + gcc_assert (!pending_data_specs); +} + +/* Scheduling pass is now finished. Free/reset static variable. */ +static void +ia64_sched_finish_global (FILE *dump ATTRIBUTE_UNUSED, + int sched_verbose ATTRIBUTE_UNUSED) +{ + free (spec_check_no); + spec_check_no = 0; + max_uid = 0; +} + /* We are about to being issuing insns for this clock cycle. Override the default sort algorithm to better slot instructions. */ @@ -6185,7 +6461,7 @@ ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, int nr_need_stop = 0; for (insnp = ready; insnp < e_ready; insnp++) - if (safe_group_barrier_needed_p (*insnp)) + if (safe_group_barrier_needed (*insnp)) nr_need_stop++; if (reorder_type == 1 && n_ready == nr_need_stop) @@ -6199,7 +6475,7 @@ ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, while (insnp >= ready + deleted) { rtx insn = *insnp; - if (! safe_group_barrier_needed_p (insn)) + if (! safe_group_barrier_needed (insn)) break; memmove (ready + 1, ready, (insnp - ready) * sizeof (rtx)); *ready = insn; @@ -6246,12 +6522,23 @@ ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED, int can_issue_more ATTRIBUTE_UNUSED) { + if (current_sched_info->flags & DO_SPECULATION) + /* Modulo scheduling does not extend h_i_d when emitting + new instructions. Deal with it. */ + { + if (DONE_SPEC (insn) & BEGIN_DATA) + pending_data_specs++; + if (CHECK_SPEC (insn) & BEGIN_DATA) + pending_data_specs--; + } + last_scheduled_insn = insn; memcpy (prev_cycle_state, curr_state, dfa_state_size); if (reload_completed) { - if (group_barrier_needed_p (insn)) - abort (); + int needed = group_barrier_needed (insn); + + gcc_assert (!needed); if (GET_CODE (insn) == CALL_INSN) init_insn_group_barriers (); stops_p [INSN_UID (insn)] = stop_before_p; @@ -6266,10 +6553,23 @@ ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED, static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx insn) { - if (insn == NULL_RTX || !INSN_P (insn)) - abort (); - return (!reload_completed - || !safe_group_barrier_needed_p (insn)); + gcc_assert (insn && INSN_P (insn)); + return ((!reload_completed + || !safe_group_barrier_needed (insn)) + && ia64_first_cycle_multipass_dfa_lookahead_guard_spec (insn)); +} + +/* We are choosing insn from the ready queue. Return nonzero if INSN + can be chosen. */ + +static bool +ia64_first_cycle_multipass_dfa_lookahead_guard_spec (rtx insn) +{ + gcc_assert (insn && INSN_P (insn)); + /* Size of ALAT is 32. As far as we perform conservative data speculation, + we keep ALAT half-empty. */ + return (pending_data_specs < 16 + || !(TODO_SPEC (insn) & BEGIN_DATA)); } /* The following variable value is pseudo-insn used by the DFA insn @@ -6278,7 +6578,7 @@ ia64_first_cycle_multipass_dfa_lookahead_guard (rtx insn) static rtx dfa_pre_cycle_insn; -/* We are about to being issuing INSN. Return nonzero if we can not +/* We are about to being issuing INSN. Return nonzero if we cannot issue it on given cycle CLOCK and return zero if we should not sort the ready queue on the next clock start. */ @@ -6288,9 +6588,8 @@ ia64_dfa_new_cycle (FILE *dump, int verbose, rtx insn, int last_clock, { int setup_clocks_p = FALSE; - if (insn == NULL_RTX || !INSN_P (insn)) - abort (); - if ((reload_completed && safe_group_barrier_needed_p (insn)) + gcc_assert (insn && INSN_P (insn)); + if ((reload_completed && safe_group_barrier_needed (insn)) || (last_scheduled_insn && (GET_CODE (last_scheduled_insn) == CALL_INSN || GET_CODE (PATTERN (last_scheduled_insn)) == ASM_INPUT @@ -6358,6 +6657,590 @@ ia64_dfa_new_cycle (FILE *dump, int verbose, rtx insn, int last_clock, return 0; } +/* Implement targetm.sched.h_i_d_extended hook. + Extend internal data structures. */ +static void +ia64_h_i_d_extended (void) +{ + if (current_sched_info->flags & DO_SPECULATION) + { + int new_max_uid = get_max_uid () + 1; + + spec_check_no = xrecalloc (spec_check_no, new_max_uid, + max_uid, sizeof (*spec_check_no)); + max_uid = new_max_uid; + } + + if (stops_p != NULL) + { + int new_clocks_length = get_max_uid () + 1; + + stops_p = xrecalloc (stops_p, new_clocks_length, clocks_length, 1); + + if (ia64_tune == PROCESSOR_ITANIUM) + { + clocks = xrecalloc (clocks, new_clocks_length, clocks_length, + sizeof (int)); + add_cycles = xrecalloc (add_cycles, new_clocks_length, clocks_length, + sizeof (int)); + } + + clocks_length = new_clocks_length; + } +} + +/* Constants that help mapping 'enum machine_mode' to int. */ +enum SPEC_MODES + { + SPEC_MODE_INVALID = -1, + SPEC_MODE_FIRST = 0, + SPEC_MODE_FOR_EXTEND_FIRST = 1, + SPEC_MODE_FOR_EXTEND_LAST = 3, + SPEC_MODE_LAST = 8 + }; + +/* Return index of the MODE. */ +static int +ia64_mode_to_int (enum machine_mode mode) +{ + switch (mode) + { + case BImode: return 0; /* SPEC_MODE_FIRST */ + case QImode: return 1; /* SPEC_MODE_FOR_EXTEND_FIRST */ + case HImode: return 2; + case SImode: return 3; /* SPEC_MODE_FOR_EXTEND_LAST */ + case DImode: return 4; + case SFmode: return 5; + case DFmode: return 6; + case XFmode: return 7; + case TImode: + /* ??? This mode needs testing. Bypasses for ldfp8 instruction are not + mentioned in itanium[12].md. Predicate fp_register_operand also + needs to be defined. Bottom line: better disable for now. */ + return SPEC_MODE_INVALID; + default: return SPEC_MODE_INVALID; + } +} + +/* Provide information about speculation capabilities. */ +static void +ia64_set_sched_flags (spec_info_t spec_info) +{ + unsigned int *flags = &(current_sched_info->flags); + + if (*flags & SCHED_RGN + || *flags & SCHED_EBB) + { + int mask = 0; + + if ((mflag_sched_br_data_spec && !reload_completed && optimize > 0) + || (mflag_sched_ar_data_spec && reload_completed)) + { + mask |= BEGIN_DATA; + + if ((mflag_sched_br_in_data_spec && !reload_completed) + || (mflag_sched_ar_in_data_spec && reload_completed)) + mask |= BE_IN_DATA; + } + + if (mflag_sched_control_spec) + { + mask |= BEGIN_CONTROL; + + if (mflag_sched_in_control_spec) + mask |= BE_IN_CONTROL; + } + + gcc_assert (*flags & USE_GLAT); + + if (mask) + { + *flags |= USE_DEPS_LIST | DETACH_LIFE_INFO | DO_SPECULATION; + + spec_info->mask = mask; + spec_info->flags = 0; + + if ((mask & DATA_SPEC) && mflag_sched_prefer_non_data_spec_insns) + spec_info->flags |= PREFER_NON_DATA_SPEC; + + if ((mask & CONTROL_SPEC) + && mflag_sched_prefer_non_control_spec_insns) + spec_info->flags |= PREFER_NON_CONTROL_SPEC; + + if (mflag_sched_spec_verbose) + { + if (sched_verbose >= 1) + spec_info->dump = sched_dump; + else + spec_info->dump = stderr; + } + else + spec_info->dump = 0; + + if (mflag_sched_count_spec_in_critical_path) + spec_info->flags |= COUNT_SPEC_IN_CRITICAL_PATH; + } + } +} + +/* Implement targetm.sched.speculate_insn hook. + Check if the INSN can be TS speculative. + If 'no' - return -1. + If 'yes' - generate speculative pattern in the NEW_PAT and return 1. + If current pattern of the INSN already provides TS speculation, return 0. */ +static int +ia64_speculate_insn (rtx insn, ds_t ts, rtx *new_pat) +{ + rtx pat, reg, mem, mem_reg; + int mode_no, gen_p = 1; + bool extend_p; + + gcc_assert (!(ts & ~BEGIN_SPEC) && ts); + + pat = PATTERN (insn); + + if (GET_CODE (pat) == COND_EXEC) + pat = COND_EXEC_CODE (pat); + + /* This should be a SET ... */ + if (GET_CODE (pat) != SET) + return -1; + + reg = SET_DEST (pat); + /* ... to the general/fp register ... */ + if (!REG_P (reg) || !(GR_REGNO_P (REGNO (reg)) || FP_REGNO_P (REGNO (reg)))) + return -1; + + /* ... from the mem ... */ + mem = SET_SRC (pat); + + /* ... that can, possibly, be a zero_extend ... */ + if (GET_CODE (mem) == ZERO_EXTEND) + { + mem = XEXP (mem, 0); + extend_p = true; + } + else + extend_p = false; + + /* ... or a speculative load. */ + if (GET_CODE (mem) == UNSPEC) + { + int code; + + code = XINT (mem, 1); + if (code != UNSPEC_LDA && code != UNSPEC_LDS && code != UNSPEC_LDSA) + return -1; + + if ((code == UNSPEC_LDA && !(ts & BEGIN_CONTROL)) + || (code == UNSPEC_LDS && !(ts & BEGIN_DATA)) + || code == UNSPEC_LDSA) + gen_p = 0; + + mem = XVECEXP (mem, 0, 0); + gcc_assert (MEM_P (mem)); + } + + /* Source should be a mem ... */ + if (!MEM_P (mem)) + return -1; + + /* ... addressed by a register. */ + mem_reg = XEXP (mem, 0); + if (!REG_P (mem_reg)) + return -1; + + /* We should use MEM's mode since REG's mode in presence of ZERO_EXTEND + will always be DImode. */ + mode_no = ia64_mode_to_int (GET_MODE (mem)); + + if (mode_no == SPEC_MODE_INVALID + || (extend_p + && !(SPEC_MODE_FOR_EXTEND_FIRST <= mode_no + && mode_no <= SPEC_MODE_FOR_EXTEND_LAST))) + return -1; + + extract_insn_cached (insn); + gcc_assert (reg == recog_data.operand[0] && mem == recog_data.operand[1]); + + *new_pat = ia64_gen_spec_insn (insn, ts, mode_no, gen_p != 0, extend_p); + + return gen_p; +} + +enum + { + /* Offset to reach ZERO_EXTEND patterns. */ + SPEC_GEN_EXTEND_OFFSET = SPEC_MODE_LAST - SPEC_MODE_FOR_EXTEND_FIRST + 1, + /* Number of patterns for each speculation mode. */ + SPEC_N = (SPEC_MODE_LAST + + SPEC_MODE_FOR_EXTEND_LAST - SPEC_MODE_FOR_EXTEND_FIRST + 2) + }; + +enum SPEC_GEN_LD_MAP + { + /* Offset to ld.a patterns. */ + SPEC_GEN_A = 0 * SPEC_N, + /* Offset to ld.s patterns. */ + SPEC_GEN_S = 1 * SPEC_N, + /* Offset to ld.sa patterns. */ + SPEC_GEN_SA = 2 * SPEC_N, + /* Offset to ld.sa patterns. For this patterns corresponding ld.c will + mutate to chk.s. */ + SPEC_GEN_SA_FOR_S = 3 * SPEC_N + }; + +/* These offsets are used to get (4 * SPEC_N). */ +enum SPEC_GEN_CHECK_OFFSET + { + SPEC_GEN_CHKA_FOR_A_OFFSET = 4 * SPEC_N - SPEC_GEN_A, + SPEC_GEN_CHKA_FOR_SA_OFFSET = 4 * SPEC_N - SPEC_GEN_SA + }; + +/* If GEN_P is true, calculate the index of needed speculation check and return + speculative pattern for INSN with speculative mode TS, machine mode + MODE_NO and with ZERO_EXTEND (if EXTEND_P is true). + If GEN_P is false, just calculate the index of needed speculation check. */ +static rtx +ia64_gen_spec_insn (rtx insn, ds_t ts, int mode_no, bool gen_p, bool extend_p) +{ + rtx pat, new_pat; + int load_no; + int shift = 0; + + static rtx (* const gen_load[]) (rtx, rtx) = { + gen_movbi_advanced, + gen_movqi_advanced, + gen_movhi_advanced, + gen_movsi_advanced, + gen_movdi_advanced, + gen_movsf_advanced, + gen_movdf_advanced, + gen_movxf_advanced, + gen_movti_advanced, + gen_zero_extendqidi2_advanced, + gen_zero_extendhidi2_advanced, + gen_zero_extendsidi2_advanced, + + gen_movbi_speculative, + gen_movqi_speculative, + gen_movhi_speculative, + gen_movsi_speculative, + gen_movdi_speculative, + gen_movsf_speculative, + gen_movdf_speculative, + gen_movxf_speculative, + gen_movti_speculative, + gen_zero_extendqidi2_speculative, + gen_zero_extendhidi2_speculative, + gen_zero_extendsidi2_speculative, + + gen_movbi_speculative_advanced, + gen_movqi_speculative_advanced, + gen_movhi_speculative_advanced, + gen_movsi_speculative_advanced, + gen_movdi_speculative_advanced, + gen_movsf_speculative_advanced, + gen_movdf_speculative_advanced, + gen_movxf_speculative_advanced, + gen_movti_speculative_advanced, + gen_zero_extendqidi2_speculative_advanced, + gen_zero_extendhidi2_speculative_advanced, + gen_zero_extendsidi2_speculative_advanced, + + gen_movbi_speculative_advanced, + gen_movqi_speculative_advanced, + gen_movhi_speculative_advanced, + gen_movsi_speculative_advanced, + gen_movdi_speculative_advanced, + gen_movsf_speculative_advanced, + gen_movdf_speculative_advanced, + gen_movxf_speculative_advanced, + gen_movti_speculative_advanced, + gen_zero_extendqidi2_speculative_advanced, + gen_zero_extendhidi2_speculative_advanced, + gen_zero_extendsidi2_speculative_advanced + }; + + load_no = extend_p ? mode_no + SPEC_GEN_EXTEND_OFFSET : mode_no; + + if (ts & BEGIN_DATA) + { + /* We don't need recovery because even if this is ld.sa + ALAT entry will be allocated only if NAT bit is set to zero. + So it is enough to use ld.c here. */ + + if (ts & BEGIN_CONTROL) + { + load_no += SPEC_GEN_SA; + + if (!mflag_sched_ldc) + shift = SPEC_GEN_CHKA_FOR_SA_OFFSET; + } + else + { + load_no += SPEC_GEN_A; + + if (!mflag_sched_ldc) + shift = SPEC_GEN_CHKA_FOR_A_OFFSET; + } + } + else if (ts & BEGIN_CONTROL) + { + /* ld.sa can be used instead of ld.s to avoid basic block splitting. */ + if (!mflag_control_ldc) + load_no += SPEC_GEN_S; + else + { + gcc_assert (mflag_sched_ldc); + load_no += SPEC_GEN_SA_FOR_S; + } + } + else + gcc_unreachable (); + + /* Set the desired check index. We add '1', because zero element in this + array means, that instruction with such uid is non-speculative. */ + spec_check_no[INSN_UID (insn)] = load_no + shift + 1; + + if (!gen_p) + return 0; + + new_pat = gen_load[load_no] (copy_rtx (recog_data.operand[0]), + copy_rtx (recog_data.operand[1])); + + pat = PATTERN (insn); + if (GET_CODE (pat) == COND_EXEC) + new_pat = gen_rtx_COND_EXEC (VOIDmode, copy_rtx + (COND_EXEC_TEST (pat)), new_pat); + + return new_pat; +} + +/* Offset to branchy checks. */ +enum { SPEC_GEN_CHECK_MUTATION_OFFSET = 5 * SPEC_N }; + +/* Return nonzero, if INSN needs branchy recovery check. */ +static bool +ia64_needs_block_p (rtx insn) +{ + int check_no; + + check_no = spec_check_no[INSN_UID(insn)] - 1; + gcc_assert (0 <= check_no && check_no < SPEC_GEN_CHECK_MUTATION_OFFSET); + + return ((SPEC_GEN_S <= check_no && check_no < SPEC_GEN_S + SPEC_N) + || (4 * SPEC_N <= check_no && check_no < 4 * SPEC_N + SPEC_N)); +} + +/* Generate (or regenerate, if (MUTATE_P)) recovery check for INSN. + If (LABEL != 0 || MUTATE_P), generate branchy recovery check. + Otherwise, generate a simple check. */ +static rtx +ia64_gen_check (rtx insn, rtx label, bool mutate_p) +{ + rtx op1, pat, check_pat; + + static rtx (* const gen_check[]) (rtx, rtx) = { + gen_movbi_clr, + gen_movqi_clr, + gen_movhi_clr, + gen_movsi_clr, + gen_movdi_clr, + gen_movsf_clr, + gen_movdf_clr, + gen_movxf_clr, + gen_movti_clr, + gen_zero_extendqidi2_clr, + gen_zero_extendhidi2_clr, + gen_zero_extendsidi2_clr, + + gen_speculation_check_bi, + gen_speculation_check_qi, + gen_speculation_check_hi, + gen_speculation_check_si, + gen_speculation_check_di, + gen_speculation_check_sf, + gen_speculation_check_df, + gen_speculation_check_xf, + gen_speculation_check_ti, + gen_speculation_check_di, + gen_speculation_check_di, + gen_speculation_check_di, + + gen_movbi_clr, + gen_movqi_clr, + gen_movhi_clr, + gen_movsi_clr, + gen_movdi_clr, + gen_movsf_clr, + gen_movdf_clr, + gen_movxf_clr, + gen_movti_clr, + gen_zero_extendqidi2_clr, + gen_zero_extendhidi2_clr, + gen_zero_extendsidi2_clr, + + gen_movbi_clr, + gen_movqi_clr, + gen_movhi_clr, + gen_movsi_clr, + gen_movdi_clr, + gen_movsf_clr, + gen_movdf_clr, + gen_movxf_clr, + gen_movti_clr, + gen_zero_extendqidi2_clr, + gen_zero_extendhidi2_clr, + gen_zero_extendsidi2_clr, + + gen_advanced_load_check_clr_bi, + gen_advanced_load_check_clr_qi, + gen_advanced_load_check_clr_hi, + gen_advanced_load_check_clr_si, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_sf, + gen_advanced_load_check_clr_df, + gen_advanced_load_check_clr_xf, + gen_advanced_load_check_clr_ti, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + + /* Following checks are generated during mutation. */ + gen_advanced_load_check_clr_bi, + gen_advanced_load_check_clr_qi, + gen_advanced_load_check_clr_hi, + gen_advanced_load_check_clr_si, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_sf, + gen_advanced_load_check_clr_df, + gen_advanced_load_check_clr_xf, + gen_advanced_load_check_clr_ti, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + + 0,0,0,0,0,0,0,0,0,0,0,0, + + gen_advanced_load_check_clr_bi, + gen_advanced_load_check_clr_qi, + gen_advanced_load_check_clr_hi, + gen_advanced_load_check_clr_si, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_sf, + gen_advanced_load_check_clr_df, + gen_advanced_load_check_clr_xf, + gen_advanced_load_check_clr_ti, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + gen_advanced_load_check_clr_di, + + gen_speculation_check_bi, + gen_speculation_check_qi, + gen_speculation_check_hi, + gen_speculation_check_si, + gen_speculation_check_di, + gen_speculation_check_sf, + gen_speculation_check_df, + gen_speculation_check_xf, + gen_speculation_check_ti, + gen_speculation_check_di, + gen_speculation_check_di, + gen_speculation_check_di + }; + + extract_insn_cached (insn); + + if (label) + { + gcc_assert (mutate_p || ia64_needs_block_p (insn)); + op1 = label; + } + else + { + gcc_assert (!mutate_p && !ia64_needs_block_p (insn)); + op1 = copy_rtx (recog_data.operand[1]); + } + + if (mutate_p) + /* INSN is ld.c. + Find the speculation check number by searching for original + speculative load in the RESOLVED_DEPS list of INSN. + As long as patterns are unique for each instruction, this can be + accomplished by matching ORIG_PAT fields. */ + { + rtx link; + int check_no = 0; + rtx orig_pat = ORIG_PAT (insn); + + for (link = RESOLVED_DEPS (insn); link; link = XEXP (link, 1)) + { + rtx x = XEXP (link, 0); + + if (ORIG_PAT (x) == orig_pat) + check_no = spec_check_no[INSN_UID (x)]; + } + gcc_assert (check_no); + + spec_check_no[INSN_UID (insn)] = (check_no + + SPEC_GEN_CHECK_MUTATION_OFFSET); + } + + check_pat = (gen_check[spec_check_no[INSN_UID (insn)] - 1] + (copy_rtx (recog_data.operand[0]), op1)); + + pat = PATTERN (insn); + if (GET_CODE (pat) == COND_EXEC) + check_pat = gen_rtx_COND_EXEC (VOIDmode, copy_rtx (COND_EXEC_TEST (pat)), + check_pat); + + return check_pat; +} + +/* Return nonzero, if X is branchy recovery check. */ +static int +ia64_spec_check_p (rtx x) +{ + x = PATTERN (x); + if (GET_CODE (x) == COND_EXEC) + x = COND_EXEC_CODE (x); + if (GET_CODE (x) == SET) + return ia64_spec_check_src_p (SET_SRC (x)); + return 0; +} + +/* Return nonzero, if SRC belongs to recovery check. */ +static int +ia64_spec_check_src_p (rtx src) +{ + if (GET_CODE (src) == IF_THEN_ELSE) + { + rtx t; + + t = XEXP (src, 0); + if (GET_CODE (t) == NE) + { + t = XEXP (t, 0); + + if (GET_CODE (t) == UNSPEC) + { + int code; + + code = XINT (t, 1); + + if (code == UNSPEC_CHKACLR + || code == UNSPEC_CHKS + || code == UNSPEC_LDCCLR) + { + gcc_assert (code != 0); + return code; + } + } + } + } + return 0; +} /* The following page contains abstract data `bundle states' which are @@ -6617,12 +7500,10 @@ issue_nops_and_insn (struct bundle_state *originator, int before_nops_num, curr_state->accumulated_insns_num = originator->accumulated_insns_num + before_nops_num; curr_state->branch_deviation = originator->branch_deviation; - if (insn == NULL_RTX) - abort (); - else if (INSN_CODE (insn) == CODE_FOR_insn_group_barrier) + gcc_assert (insn); + if (INSN_CODE (insn) == CODE_FOR_insn_group_barrier) { - if (GET_MODE (insn) == TImode) - abort (); + gcc_assert (GET_MODE (insn) != TImode); if (!try_issue_nops (curr_state, before_nops_num)) return; if (!try_issue_insn (curr_state, insn)) @@ -6642,14 +7523,25 @@ issue_nops_and_insn (struct bundle_state *originator, int before_nops_num, if (!try_issue_insn (curr_state, insn)) return; curr_state->accumulated_insns_num++; - if (GET_CODE (PATTERN (insn)) == ASM_INPUT - || asm_noperands (PATTERN (insn)) >= 0) - abort (); + gcc_assert (GET_CODE (PATTERN (insn)) != ASM_INPUT + && asm_noperands (PATTERN (insn)) < 0); + if (ia64_safe_type (insn) == TYPE_L) curr_state->accumulated_insns_num++; } else { + /* If this is an insn that must be first in a group, then don't allow + nops to be emitted before it. Currently, alloc is the only such + supported instruction. */ + /* ??? The bundling automatons should handle this for us, but they do + not yet have support for the first_insn attribute. */ + if (before_nops_num > 0 && get_attr_first_insn (insn) == FIRST_INSN_YES) + { + free_bundle_state (curr_state); + return; + } + state_transition (curr_state->dfa_state, dfa_pre_cycle_insn); state_transition (curr_state->dfa_state, NULL); curr_state->cost++; @@ -6728,7 +7620,13 @@ get_max_pos (state_t state) /* The function returns code of a possible template for given position and state. The function should be called only with 2 values of - position equal to 3 or 6. */ + position equal to 3 or 6. We avoid generating F NOPs by putting + templates containing F insns at the end of the template search + because undocumented anomaly in McKinley derived cores which can + cause stalls if an F-unit insn (including a NOP) is issued within a + six-cycle window after reading certain application registers (such + as ar.bsp). Furthermore, power-considerations also argue against + the use of F-unit instructions unless they're really needed. */ static int get_template (state_t state, int pos) @@ -6736,53 +7634,53 @@ get_template (state_t state, int pos) switch (pos) { case 3: - if (cpu_unit_reservation_p (state, _0mii_)) - return 0; - else if (cpu_unit_reservation_p (state, _0mmi_)) + if (cpu_unit_reservation_p (state, _0mmi_)) return 1; - else if (cpu_unit_reservation_p (state, _0mfi_)) - return 2; - else if (cpu_unit_reservation_p (state, _0mmf_)) - return 3; - else if (cpu_unit_reservation_p (state, _0bbb_)) - return 4; - else if (cpu_unit_reservation_p (state, _0mbb_)) - return 5; - else if (cpu_unit_reservation_p (state, _0mib_)) - return 6; + else if (cpu_unit_reservation_p (state, _0mii_)) + return 0; else if (cpu_unit_reservation_p (state, _0mmb_)) return 7; + else if (cpu_unit_reservation_p (state, _0mib_)) + return 6; + else if (cpu_unit_reservation_p (state, _0mbb_)) + return 5; + else if (cpu_unit_reservation_p (state, _0bbb_)) + return 4; + else if (cpu_unit_reservation_p (state, _0mmf_)) + return 3; + else if (cpu_unit_reservation_p (state, _0mfi_)) + return 2; else if (cpu_unit_reservation_p (state, _0mfb_)) return 8; else if (cpu_unit_reservation_p (state, _0mlx_)) return 9; else - abort (); + gcc_unreachable (); case 6: - if (cpu_unit_reservation_p (state, _1mii_)) - return 0; - else if (cpu_unit_reservation_p (state, _1mmi_)) + if (cpu_unit_reservation_p (state, _1mmi_)) return 1; - else if (cpu_unit_reservation_p (state, _1mfi_)) - return 2; - else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_)) - return 3; - else if (cpu_unit_reservation_p (state, _1bbb_)) - return 4; - else if (cpu_unit_reservation_p (state, _1mbb_)) - return 5; - else if (cpu_unit_reservation_p (state, _1mib_)) - return 6; + else if (cpu_unit_reservation_p (state, _1mii_)) + return 0; else if (cpu_unit_reservation_p (state, _1mmb_)) return 7; + else if (cpu_unit_reservation_p (state, _1mib_)) + return 6; + else if (cpu_unit_reservation_p (state, _1mbb_)) + return 5; + else if (cpu_unit_reservation_p (state, _1bbb_)) + return 4; + else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_)) + return 3; + else if (cpu_unit_reservation_p (state, _1mfi_)) + return 2; else if (cpu_unit_reservation_p (state, _1mfb_)) return 8; else if (cpu_unit_reservation_p (state, _1mlx_)) return 9; else - abort (); + gcc_unreachable (); default: - abort (); + gcc_unreachable (); } } @@ -6801,6 +7699,53 @@ get_next_important_insn (rtx insn, rtx tail) return NULL_RTX; } +/* Add a bundle selector TEMPLATE0 before INSN. */ + +static void +ia64_add_bundle_selector_before (int template0, rtx insn) +{ + rtx b = gen_bundle_selector (GEN_INT (template0)); + + ia64_emit_insn_before (b, insn); +#if NR_BUNDLES == 10 + if ((template0 == 4 || template0 == 5) + && (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))) + { + int i; + rtx note = NULL_RTX; + + /* In .mbb and .bbb bundles, check if CALL_INSN isn't in the + first or second slot. If it is and has REG_EH_NOTE set, copy it + to following nops, as br.call sets rp to the address of following + bundle and therefore an EH region end must be on a bundle + boundary. */ + insn = PREV_INSN (insn); + for (i = 0; i < 3; i++) + { + do + insn = next_active_insn (insn); + while (GET_CODE (insn) == INSN + && get_attr_empty (insn) == EMPTY_YES); + if (GET_CODE (insn) == CALL_INSN) + note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); + else if (note) + { + int code; + + gcc_assert ((code = recog_memoized (insn)) == CODE_FOR_nop + || code == CODE_FOR_nop_b); + if (find_reg_note (insn, REG_EH_REGION, NULL_RTX)) + note = NULL_RTX; + else + REG_NOTES (insn) + = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (note, 0), + REG_NOTES (insn)); + } + } + } +#endif +} + /* The following function does insn bundling. Bundling means inserting templates and nop insns to fit insn groups into permitted templates. Instruction scheduling uses NDFA (non-deterministic @@ -6813,7 +7758,7 @@ get_next_important_insn (rtx insn, rtx tail) automata only says that we can issue an insn possibly inserting some nops before it and using some template. Therefore insn bundling in this function is implemented by using DFA - (deterministic finite automata). We follows all possible insn + (deterministic finite automata). We follow all possible insn sequences by inserting 0-2 nops (that is what the NDFA describe for insn scheduling) before/after each insn being bundled. We know the start of simulated processor cycle from insn scheduling (insn @@ -6827,7 +7772,7 @@ get_next_important_insn (rtx insn, rtx tail) by structure bundle_state (see above). If we generate the same bundle state (key is automaton state after issuing the insns and nops for it), we reuse already generated one. As consequence we - reject some decisions which can not improve the solution and + reject some decisions which cannot improve the solution and reduce memory for the algorithm. When we reach the end of EBB (extended basic block), we choose the @@ -6866,7 +7811,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) initiate_bundle_state_table (); index_to_bundle_states = xmalloc ((insn_num + 2) * sizeof (struct bundle_state *)); - /* First (forward) pass -- generation of bundle states. */ + /* First (forward) pass -- generation of bundle states. */ curr_state = get_free_bundle_state (); curr_state->insn = NULL; curr_state->before_nops_num = 0; @@ -6903,16 +7848,15 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) break; } } - /* Froward pass: generation of bundle states. */ + /* Forward pass: generation of bundle states. */ for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail); insn != NULL_RTX; insn = next_insn) { - if (!INSN_P (insn) - || ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IGNORE - || GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER) - abort (); + gcc_assert (INSN_P (insn) + && ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER); type = ia64_safe_type (insn); next_insn = get_next_important_insn (NEXT_INSN (insn), tail); insn_num++; @@ -6952,8 +7896,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) issue_nops_and_insn (curr_state, 0, insn, bundle_end_p, only_bundle_end_p); } - if (index_to_bundle_states [insn_num] == NULL) - abort (); + gcc_assert (index_to_bundle_states [insn_num]); for (curr_state = index_to_bundle_states [insn_num]; curr_state != NULL; curr_state = curr_state->next) @@ -6986,10 +7929,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) INSN_UID (insn)); } } - if (index_to_bundle_states [insn_num] == NULL) - /* We should find a solution because the 2nd insn scheduling has - found one. */ - abort (); + + /* We should find a solution because the 2nd insn scheduling has + found one. */ + gcc_assert (index_to_bundle_states [insn_num]); /* Find a state corresponding to the best insn sequence. */ best_state = NULL; for (curr_state = index_to_bundle_states [insn_num]; @@ -7067,8 +8010,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) if (max_pos > 3 && template1 < 0) /* It may happen when we have the stop inside a bundle. */ { - if (pos > 3) - abort (); + gcc_assert (pos <= 3); template1 = get_template (curr_state->dfa_state, 3); pos += 3; } @@ -7079,16 +8021,13 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) nop = gen_nop (); emit_insn_after (nop, insn); pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0) { /* We are at the start of a bundle: emit the template (it should be defined). */ - if (template0 < 0) - abort (); - b = gen_bundle_selector (GEN_INT (template0)); - ia64_emit_insn_before (b, nop); + gcc_assert (template0 >= 0); + ia64_add_bundle_selector_before (template0, nop); /* If we have two bundle window, we make one bundle rotation. Otherwise template0 will be undefined (negative value). */ @@ -7105,8 +8044,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) /* Long insn takes 2 slots. */ if (ia64_safe_type (insn) == TYPE_L) pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0 && INSN_CODE (insn) != CODE_FOR_insn_group_barrier && GET_CODE (PATTERN (insn)) != ASM_INPUT @@ -7114,13 +8052,11 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) { /* The current insn is at the bundle start: emit the template. */ - if (template0 < 0) - abort (); - b = gen_bundle_selector (GEN_INT (template0)); - ia64_emit_insn_before (b, insn); + gcc_assert (template0 >= 0); + ia64_add_bundle_selector_before (template0, insn); b = PREV_INSN (insn); insn = b; - /* See comment above in analogous place for emiting nops + /* See comment above in analogous place for emitting nops after the insn. */ template0 = template1; template1 = -1; @@ -7133,16 +8069,13 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) nop = PREV_INSN (insn); insn = nop; pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0) { - /* See comment above in analogous place for emiting nops + /* See comment above in analogous place for emitting nops after the insn. */ - if (template0 < 0) - abort (); - b = gen_bundle_selector (GEN_INT (template0)); - ia64_emit_insn_before (b, insn); + gcc_assert (template0 >= 0); + ia64_add_bundle_selector_before (template0, insn); b = PREV_INSN (insn); insn = b; template0 = template1; @@ -7160,11 +8093,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) insn != NULL_RTX; insn = next_insn) { - if (!INSN_P (insn) - || ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IGNORE - || GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER) - abort (); + gcc_assert (INSN_P (insn) + && ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER); next_insn = get_next_important_insn (NEXT_INSN (insn), tail); if (INSN_UID (insn) < clocks_length && add_cycles [INSN_UID (insn)]) /* We found a MM-insn which needs additional cycles. */ @@ -7191,7 +8123,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) onto MFI because we will add nops before the insn. It simplifies subsequent code a lot. */ PATTERN (last) - = gen_bundle_selector (GEN_INT (2)); /* -> MFI */ + = gen_bundle_selector (const2_rtx); /* -> MFI */ break; } else if (recog_memoized (last) != CODE_FOR_insn_group_barrier @@ -7202,9 +8134,9 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) bundle start, there are no more 3 insns in the bundle, and the MM-insn is not at the start of bundle with template MLX. */ - if ((pred_stop_p && n == 0) || n > 2 - || (template0 == 9 && n != 0)) - abort (); + gcc_assert ((!pred_stop_p || n) + && n <= 2 + && (template0 != 9 || !n)); /* Put nops after the insn in the bundle. */ for (j = 3 - n; j > 0; j --) ia64_emit_insn_before (gen_nop (), insn); @@ -7219,7 +8151,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) for (i = add_cycles [INSN_UID (insn)]; i > 0; i--) { /* Insert "MII;" template. */ - ia64_emit_insn_before (gen_bundle_selector (GEN_INT (0)), + ia64_emit_insn_before (gen_bundle_selector (const0_rtx), insn); ia64_emit_insn_before (gen_nop (), insn); ia64_emit_insn_before (gen_nop (), insn); @@ -7237,8 +8169,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) } /* Put the MM-insn in the same slot of a bundle with the same template as the original one. */ - ia64_emit_insn_before (gen_bundle_selector (GEN_INT (template0)), - insn); + ia64_add_bundle_selector_before (template0, insn); /* To put the insn in the same slot, add necessary number of nops. */ for (j = n; j > 0; j --) @@ -7318,7 +8249,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) need_barrier_p = 0; prev_insn = NULL_RTX; } - else if (need_barrier_p || group_barrier_needed_p (insn)) + else if (need_barrier_p || group_barrier_needed (insn)) { if (TARGET_EARLY_STOP_BITS) { @@ -7342,7 +8273,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) last != insn; last = NEXT_INSN (last)) if (INSN_P (last)) - group_barrier_needed_p (last); + group_barrier_needed (last); } else { @@ -7350,7 +8281,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) insn); init_insn_group_barriers (); } - group_barrier_needed_p (insn); + group_barrier_needed (insn); prev_insn = NULL_RTX; } else if (recog_memoized (insn) >= 0) @@ -7364,16 +8295,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) -/* If the following function returns TRUE, we will use the the DFA - insn scheduler. */ - -static int -ia64_use_dfa_pipeline_interface (void) -{ - return 1; -} - -/* If the following function returns TRUE, we will use the the DFA +/* If the following function returns TRUE, we will use the DFA insn scheduler. */ static int @@ -7418,18 +8340,19 @@ ia64_st_address_bypass_p (rtx producer, rtx consumer) { rtx dest, reg, mem; - if (producer == NULL_RTX || consumer == NULL_RTX) - abort (); + gcc_assert (producer && consumer); dest = ia64_single_set (producer); - if (dest == NULL_RTX || (reg = SET_DEST (dest)) == NULL_RTX - || (GET_CODE (reg) != REG && GET_CODE (reg) != SUBREG)) - abort (); + gcc_assert (dest); + reg = SET_DEST (dest); + gcc_assert (reg); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg); + gcc_assert (GET_CODE (reg) == REG); + dest = ia64_single_set (consumer); - if (dest == NULL_RTX || (mem = SET_DEST (dest)) == NULL_RTX - || GET_CODE (mem) != MEM) - abort (); + gcc_assert (dest); + mem = SET_DEST (dest); + gcc_assert (mem && GET_CODE (mem) == MEM); return reg_mentioned_p (reg, mem); } @@ -7441,32 +8364,49 @@ ia64_ld_address_bypass_p (rtx producer, rtx consumer) { rtx dest, src, reg, mem; - if (producer == NULL_RTX || consumer == NULL_RTX) - abort (); + gcc_assert (producer && consumer); dest = ia64_single_set (producer); - if (dest == NULL_RTX || (reg = SET_DEST (dest)) == NULL_RTX - || (GET_CODE (reg) != REG && GET_CODE (reg) != SUBREG)) - abort (); + gcc_assert (dest); + reg = SET_DEST (dest); + gcc_assert (reg); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg); + gcc_assert (GET_CODE (reg) == REG); + src = ia64_single_set (consumer); - if (src == NULL_RTX || (mem = SET_SRC (src)) == NULL_RTX) - abort (); + gcc_assert (src); + mem = SET_SRC (src); + gcc_assert (mem); + if (GET_CODE (mem) == UNSPEC && XVECLEN (mem, 0) > 0) mem = XVECEXP (mem, 0, 0); + else if (GET_CODE (mem) == IF_THEN_ELSE) + /* ??? Is this bypass necessary for ld.c? */ + { + gcc_assert (XINT (XEXP (XEXP (mem, 0), 0), 1) == UNSPEC_LDCCLR); + mem = XEXP (mem, 1); + } + while (GET_CODE (mem) == SUBREG || GET_CODE (mem) == ZERO_EXTEND) mem = XEXP (mem, 0); + if (GET_CODE (mem) == UNSPEC) + { + int c = XINT (mem, 1); + + gcc_assert (c == UNSPEC_LDA || c == UNSPEC_LDS || c == UNSPEC_LDSA); + mem = XVECEXP (mem, 0, 0); + } + /* Note that LO_SUM is used for GOT loads. */ - if (GET_CODE (mem) != LO_SUM && GET_CODE (mem) != MEM) - abort (); + gcc_assert (GET_CODE (mem) == LO_SUM || GET_CODE (mem) == MEM); return reg_mentioned_p (reg, mem); } /* The following function returns TRUE if INSN produces address for a load/store insn. We will place such insns into M slot because it - decreases its latency time. */ + decreases its latency time. */ int ia64_produce_address_p (rtx insn) @@ -7497,8 +8437,10 @@ emit_predicate_relation_info (void) && NOTE_LINE_NUMBER (NEXT_INSN (head)) == NOTE_INSN_BASIC_BLOCK) head = NEXT_INSN (head); - for (r = PR_REG (0); r < PR_REG (64); r += 2) - if (REGNO_REG_SET_P (bb->global_live_at_start, r)) + /* Skip p0, which may be thought to be live due to (reg:DI p0) + grabbing the entire block of predicate registers. */ + for (r = PR_REG (2); r < PR_REG (64); r += 2) + if (REGNO_REG_SET_P (bb->il.rtl->global_live_at_start, r)) { rtx p = gen_rtx_REG (BImode, r); rtx n = emit_insn_after (gen_pred_rel_mutex (p), head); @@ -7554,7 +8496,7 @@ ia64_reorg (void) non-optimizing bootstrap. */ update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES); - if (ia64_flag_schedule_insns2) + if (optimize && ia64_flag_schedule_insns2) { timevar_push (TV_SCHED2); ia64_final_schedule = 1; @@ -7628,7 +8570,7 @@ ia64_reorg (void) _1mfb_ = get_cpu_unit_code ("1b_1mfb."); _1mlx_ = get_cpu_unit_code ("1b_1mlx."); } - schedule_ebbs (rtl_dump_file); + schedule_ebbs (); finish_bundle_states (); if (ia64_tune == PROCESSOR_ITANIUM) { @@ -7636,13 +8578,14 @@ ia64_reorg (void) free (clocks); } free (stops_p); - emit_insn_group_barriers (rtl_dump_file); + stops_p = NULL; + emit_insn_group_barriers (dump_file); ia64_final_schedule = 0; timevar_pop (TV_SCHED2); } else - emit_all_insn_group_barriers (rtl_dump_file); + emit_all_insn_group_barriers (dump_file); /* A call must not be the last instruction in a function, so that the return address is still within the function, so that unwinding works @@ -7672,8 +8615,14 @@ ia64_reorg (void) } } - fixup_errata (); emit_predicate_relation_info (); + + if (ia64_flag_var_tracking) + { + timevar_push (TV_VAR_TRACKING); + variable_tracking_main (); + timevar_pop (TV_VAR_TRACKING); + } } /* Return true if REGNO is used by the epilogue. */ @@ -7766,8 +8715,13 @@ ia64_in_small_data_p (tree exp) if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp)) { const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp)); + if (strcmp (section, ".sdata") == 0 - || strcmp (section, ".sbss") == 0) + || strncmp (section, ".sdata.", 7) == 0 + || strncmp (section, ".gnu.linkonce.s.", 16) == 0 + || strcmp (section, ".sbss") == 0 + || strncmp (section, ".sbss.", 6) == 0 + || strncmp (section, ".gnu.linkonce.sb.", 17) == 0) return true; } else @@ -7793,28 +8747,84 @@ static bool last_block; static bool need_copy_state; +#ifndef MAX_ARTIFICIAL_LABEL_BYTES +# define MAX_ARTIFICIAL_LABEL_BYTES 30 +#endif + +/* Emit a debugging label after a call-frame-related insn. We'd + rather output the label right away, but we'd have to output it + after, not before, the instruction, and the instruction has not + been output yet. So we emit the label after the insn, delete it to + avoid introducing basic blocks, and mark it as preserved, such that + it is still output, given that it is referenced in debug info. */ + +static const char * +ia64_emit_deleted_label_after_insn (rtx insn) +{ + char label[MAX_ARTIFICIAL_LABEL_BYTES]; + rtx lb = gen_label_rtx (); + rtx label_insn = emit_label_after (lb, insn); + + LABEL_PRESERVE_P (lb) = 1; + + delete_insn (label_insn); + + ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (label_insn)); + + return xstrdup (label); +} + +/* Define the CFA after INSN with the steady-state definition. */ + +static void +ia64_dwarf2out_def_steady_cfa (rtx insn) +{ + rtx fp = frame_pointer_needed + ? hard_frame_pointer_rtx + : stack_pointer_rtx; + + dwarf2out_def_cfa + (ia64_emit_deleted_label_after_insn (insn), + REGNO (fp), + ia64_initial_elimination_offset + (REGNO (arg_pointer_rtx), REGNO (fp)) + + ARG_POINTER_CFA_OFFSET (current_function_decl)); +} + +/* The generic dwarf2 frame debug info generator does not define a + separate region for the very end of the epilogue, so refrain from + doing so in the IA64-specific code as well. */ + +#define IA64_CHANGE_CFA_IN_EPILOGUE 0 + /* The function emits unwind directives for the start of an epilogue. */ static void -process_epilogue (void) +process_epilogue (FILE *asm_out_file, rtx insn, bool unwind, bool frame) { /* If this isn't the last block of the function, then we need to label the current state, and copy it back in at the start of the next block. */ if (!last_block) { - fprintf (asm_out_file, "\t.label_state 1\n"); + if (unwind) + fprintf (asm_out_file, "\t.label_state %d\n", + ++cfun->machine->state_num); need_copy_state = true; } - fprintf (asm_out_file, "\t.restore sp\n"); + if (unwind) + fprintf (asm_out_file, "\t.restore sp\n"); + if (IA64_CHANGE_CFA_IN_EPILOGUE && frame) + dwarf2out_def_cfa (ia64_emit_deleted_label_after_insn (insn), + STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET); } /* This function processes a SET pattern looking for specific patterns which result in emitting an assembly directive required for unwinding. */ static int -process_set (FILE *asm_out_file, rtx pat) +process_set (FILE *asm_out_file, rtx pat, rtx insn, bool unwind, bool frame) { rtx src = SET_SRC (pat); rtx dest = SET_DEST (pat); @@ -7830,8 +8840,11 @@ process_set (FILE *asm_out_file, rtx pat) /* If this is the final destination for ar.pfs, then this must be the alloc in the prologue. */ if (dest_regno == current_frame_info.reg_save_ar_pfs) - fprintf (asm_out_file, "\t.save ar.pfs, r%d\n", - ia64_dbx_register_number (dest_regno)); + { + if (unwind) + fprintf (asm_out_file, "\t.save ar.pfs, r%d\n", + ia64_dbx_register_number (dest_regno)); + } else { /* This must be an alloc before a sibcall. We must drop the @@ -7842,8 +8855,9 @@ process_set (FILE *asm_out_file, rtx pat) sp" now. */ if (current_frame_info.total_size == 0 && !frame_pointer_needed) /* if haven't done process_epilogue() yet, do it now */ - process_epilogue (); - fprintf (asm_out_file, "\t.prologue\n"); + process_epilogue (asm_out_file, insn, unwind, frame); + if (unwind) + fprintf (asm_out_file, "\t.prologue\n"); } return 1; } @@ -7855,22 +8869,27 @@ process_set (FILE *asm_out_file, rtx pat) { rtx op0 = XEXP (src, 0); rtx op1 = XEXP (src, 1); - if (op0 == dest && GET_CODE (op1) == CONST_INT) + + gcc_assert (op0 == dest && GET_CODE (op1) == CONST_INT); + + if (INTVAL (op1) < 0) { - if (INTVAL (op1) < 0) + gcc_assert (!frame_pointer_needed); + if (unwind) fprintf (asm_out_file, "\t.fframe "HOST_WIDE_INT_PRINT_DEC"\n", -INTVAL (op1)); - else - process_epilogue (); + if (frame) + ia64_dwarf2out_def_steady_cfa (insn); } else - abort (); + process_epilogue (asm_out_file, insn, unwind, frame); } - else if (GET_CODE (src) == REG - && REGNO (src) == HARD_FRAME_POINTER_REGNUM) - process_epilogue (); else - abort (); + { + gcc_assert (GET_CODE (src) == REG + && REGNO (src) == HARD_FRAME_POINTER_REGNUM); + process_epilogue (asm_out_file, insn, unwind, frame); + } return 1; } @@ -7885,44 +8904,46 @@ process_set (FILE *asm_out_file, rtx pat) { case BR_REG (0): /* Saving return address pointer. */ - if (dest_regno != current_frame_info.reg_save_b0) - abort (); - fprintf (asm_out_file, "\t.save rp, r%d\n", - ia64_dbx_register_number (dest_regno)); + gcc_assert (dest_regno == current_frame_info.reg_save_b0); + if (unwind) + fprintf (asm_out_file, "\t.save rp, r%d\n", + ia64_dbx_register_number (dest_regno)); return 1; case PR_REG (0): - if (dest_regno != current_frame_info.reg_save_pr) - abort (); - fprintf (asm_out_file, "\t.save pr, r%d\n", - ia64_dbx_register_number (dest_regno)); + gcc_assert (dest_regno == current_frame_info.reg_save_pr); + if (unwind) + fprintf (asm_out_file, "\t.save pr, r%d\n", + ia64_dbx_register_number (dest_regno)); return 1; case AR_UNAT_REGNUM: - if (dest_regno != current_frame_info.reg_save_ar_unat) - abort (); - fprintf (asm_out_file, "\t.save ar.unat, r%d\n", - ia64_dbx_register_number (dest_regno)); + gcc_assert (dest_regno == current_frame_info.reg_save_ar_unat); + if (unwind) + fprintf (asm_out_file, "\t.save ar.unat, r%d\n", + ia64_dbx_register_number (dest_regno)); return 1; case AR_LC_REGNUM: - if (dest_regno != current_frame_info.reg_save_ar_lc) - abort (); - fprintf (asm_out_file, "\t.save ar.lc, r%d\n", - ia64_dbx_register_number (dest_regno)); + gcc_assert (dest_regno == current_frame_info.reg_save_ar_lc); + if (unwind) + fprintf (asm_out_file, "\t.save ar.lc, r%d\n", + ia64_dbx_register_number (dest_regno)); return 1; case STACK_POINTER_REGNUM: - if (dest_regno != HARD_FRAME_POINTER_REGNUM - || ! frame_pointer_needed) - abort (); - fprintf (asm_out_file, "\t.vframe r%d\n", - ia64_dbx_register_number (dest_regno)); + gcc_assert (dest_regno == HARD_FRAME_POINTER_REGNUM + && frame_pointer_needed); + if (unwind) + fprintf (asm_out_file, "\t.vframe r%d\n", + ia64_dbx_register_number (dest_regno)); + if (frame) + ia64_dwarf2out_def_steady_cfa (insn); return 1; default: /* Everything else should indicate being stored to memory. */ - abort (); + gcc_unreachable (); } } @@ -7938,64 +8959,65 @@ process_set (FILE *asm_out_file, rtx pat) base = XEXP (dest, 0); off = 0; } - else if (GET_CODE (XEXP (dest, 0)) == PLUS - && GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT) + else { + gcc_assert (GET_CODE (XEXP (dest, 0)) == PLUS + && GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT); base = XEXP (XEXP (dest, 0), 0); off = INTVAL (XEXP (XEXP (dest, 0), 1)); } - else - abort (); if (base == hard_frame_pointer_rtx) { saveop = ".savepsp"; off = - off; } - else if (base == stack_pointer_rtx) - saveop = ".savesp"; else - abort (); + { + gcc_assert (base == stack_pointer_rtx); + saveop = ".savesp"; + } src_regno = REGNO (src); switch (src_regno) { case BR_REG (0): - if (current_frame_info.reg_save_b0 != 0) - abort (); - fprintf (asm_out_file, "\t%s rp, %ld\n", saveop, off); + gcc_assert (!current_frame_info.reg_save_b0); + if (unwind) + fprintf (asm_out_file, "\t%s rp, %ld\n", saveop, off); return 1; case PR_REG (0): - if (current_frame_info.reg_save_pr != 0) - abort (); - fprintf (asm_out_file, "\t%s pr, %ld\n", saveop, off); + gcc_assert (!current_frame_info.reg_save_pr); + if (unwind) + fprintf (asm_out_file, "\t%s pr, %ld\n", saveop, off); return 1; case AR_LC_REGNUM: - if (current_frame_info.reg_save_ar_lc != 0) - abort (); - fprintf (asm_out_file, "\t%s ar.lc, %ld\n", saveop, off); + gcc_assert (!current_frame_info.reg_save_ar_lc); + if (unwind) + fprintf (asm_out_file, "\t%s ar.lc, %ld\n", saveop, off); return 1; case AR_PFS_REGNUM: - if (current_frame_info.reg_save_ar_pfs != 0) - abort (); - fprintf (asm_out_file, "\t%s ar.pfs, %ld\n", saveop, off); + gcc_assert (!current_frame_info.reg_save_ar_pfs); + if (unwind) + fprintf (asm_out_file, "\t%s ar.pfs, %ld\n", saveop, off); return 1; case AR_UNAT_REGNUM: - if (current_frame_info.reg_save_ar_unat != 0) - abort (); - fprintf (asm_out_file, "\t%s ar.unat, %ld\n", saveop, off); + gcc_assert (!current_frame_info.reg_save_ar_unat); + if (unwind) + fprintf (asm_out_file, "\t%s ar.unat, %ld\n", saveop, off); return 1; case GR_REG (4): case GR_REG (5): case GR_REG (6): case GR_REG (7): - fprintf (asm_out_file, "\t.save.g 0x%x\n", - 1 << (src_regno - GR_REG (4))); + if (unwind) + fprintf (asm_out_file, "\t.save.g 0x%x\n", + 1 << (src_regno - GR_REG (4))); return 1; case BR_REG (1): @@ -8003,24 +9025,27 @@ process_set (FILE *asm_out_file, rtx pat) case BR_REG (3): case BR_REG (4): case BR_REG (5): - fprintf (asm_out_file, "\t.save.b 0x%x\n", - 1 << (src_regno - BR_REG (1))); + if (unwind) + fprintf (asm_out_file, "\t.save.b 0x%x\n", + 1 << (src_regno - BR_REG (1))); return 1; case FR_REG (2): case FR_REG (3): case FR_REG (4): case FR_REG (5): - fprintf (asm_out_file, "\t.save.f 0x%x\n", - 1 << (src_regno - FR_REG (2))); + if (unwind) + fprintf (asm_out_file, "\t.save.f 0x%x\n", + 1 << (src_regno - FR_REG (2))); return 1; case FR_REG (16): case FR_REG (17): case FR_REG (18): case FR_REG (19): case FR_REG (20): case FR_REG (21): case FR_REG (22): case FR_REG (23): case FR_REG (24): case FR_REG (25): case FR_REG (26): case FR_REG (27): case FR_REG (28): case FR_REG (29): case FR_REG (30): case FR_REG (31): - fprintf (asm_out_file, "\t.save.gf 0x0, 0x%x\n", - 1 << (src_regno - FR_REG (12))); + if (unwind) + fprintf (asm_out_file, "\t.save.gf 0x0, 0x%x\n", + 1 << (src_regno - FR_REG (12))); return 1; default: @@ -8037,8 +9062,11 @@ process_set (FILE *asm_out_file, rtx pat) void process_for_unwind_directive (FILE *asm_out_file, rtx insn) { - if (flag_unwind_tables - || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)) + bool unwind = (flag_unwind_tables + || (flag_exceptions && !USING_SJLJ_EXCEPTIONS)); + bool frame = dwarf2out_do_frame (); + + if (unwind || frame) { rtx pat; @@ -8050,8 +9078,14 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn) /* Restore unwind state from immediately before the epilogue. */ if (need_copy_state) { - fprintf (asm_out_file, "\t.body\n"); - fprintf (asm_out_file, "\t.copy_state 1\n"); + if (unwind) + { + fprintf (asm_out_file, "\t.body\n"); + fprintf (asm_out_file, "\t.copy_state %d\n", + cfun->machine->state_num); + } + if (IA64_CHANGE_CFA_IN_EPILOGUE && frame) + ia64_dwarf2out_def_steady_cfa (insn); need_copy_state = false; } } @@ -8068,7 +9102,7 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn) switch (GET_CODE (pat)) { case SET: - process_set (asm_out_file, pat); + process_set (asm_out_file, pat, insn, unwind, frame); break; case PARALLEL: @@ -8079,77 +9113,39 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn) { rtx x = XVECEXP (pat, 0, par_index); if (GET_CODE (x) == SET) - process_set (asm_out_file, x); + process_set (asm_out_file, x, insn, unwind, frame); } break; } default: - abort (); + gcc_unreachable (); } } } +enum ia64_builtins +{ + IA64_BUILTIN_BSP, + IA64_BUILTIN_FLUSHRS +}; + void ia64_init_builtins (void) { - tree psi_type_node = build_pointer_type (integer_type_node); - tree pdi_type_node = build_pointer_type (long_integer_type_node); - - /* __sync_val_compare_and_swap_si, __sync_bool_compare_and_swap_si */ - tree si_ftype_psi_si_si - = build_function_type_list (integer_type_node, - psi_type_node, integer_type_node, - integer_type_node, NULL_TREE); - - /* __sync_val_compare_and_swap_di */ - tree di_ftype_pdi_di_di - = build_function_type_list (long_integer_type_node, - pdi_type_node, long_integer_type_node, - long_integer_type_node, NULL_TREE); - /* __sync_bool_compare_and_swap_di */ - tree si_ftype_pdi_di_di - = build_function_type_list (integer_type_node, - pdi_type_node, long_integer_type_node, - long_integer_type_node, NULL_TREE); - /* __sync_synchronize */ - tree void_ftype_void - = build_function_type (void_type_node, void_list_node); - - /* __sync_lock_test_and_set_si */ - tree si_ftype_psi_si - = build_function_type_list (integer_type_node, - psi_type_node, integer_type_node, NULL_TREE); - - /* __sync_lock_test_and_set_di */ - tree di_ftype_pdi_di - = build_function_type_list (long_integer_type_node, - pdi_type_node, long_integer_type_node, - NULL_TREE); - - /* __sync_lock_release_si */ - tree void_ftype_psi - = build_function_type_list (void_type_node, psi_type_node, NULL_TREE); - - /* __sync_lock_release_di */ - tree void_ftype_pdi - = build_function_type_list (void_type_node, pdi_type_node, NULL_TREE); - tree fpreg_type; tree float80_type; /* The __fpreg type. */ fpreg_type = make_node (REAL_TYPE); - /* ??? The back end should know to load/save __fpreg variables using - the ldf.fill and stf.spill instructions. */ - TYPE_PRECISION (fpreg_type) = 96; + TYPE_PRECISION (fpreg_type) = 82; layout_type (fpreg_type); (*lang_hooks.types.register_builtin_type) (fpreg_type, "__fpreg"); /* The __float80 type. */ float80_type = make_node (REAL_TYPE); - TYPE_PRECISION (float80_type) = 96; + TYPE_PRECISION (float80_type) = 80; layout_type (float80_type); (*lang_hooks.types.register_builtin_type) (float80_type, "__float80"); @@ -8166,29 +9162,9 @@ ia64_init_builtins (void) (*lang_hooks.types.register_builtin_type) (long_double_type_node, "__float128"); -#define def_builtin(name, type, code) \ - builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL_TREE) - - def_builtin ("__sync_val_compare_and_swap_si", si_ftype_psi_si_si, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI); - def_builtin ("__sync_val_compare_and_swap_di", di_ftype_pdi_di_di, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI); - def_builtin ("__sync_bool_compare_and_swap_si", si_ftype_psi_si_si, - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI); - def_builtin ("__sync_bool_compare_and_swap_di", si_ftype_pdi_di_di, - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI); - - def_builtin ("__sync_synchronize", void_ftype_void, - IA64_BUILTIN_SYNCHRONIZE); - - def_builtin ("__sync_lock_test_and_set_si", si_ftype_psi_si, - IA64_BUILTIN_LOCK_TEST_AND_SET_SI); - def_builtin ("__sync_lock_test_and_set_di", di_ftype_pdi_di, - IA64_BUILTIN_LOCK_TEST_AND_SET_DI); - def_builtin ("__sync_lock_release_si", void_ftype_psi, - IA64_BUILTIN_LOCK_RELEASE_SI); - def_builtin ("__sync_lock_release_di", void_ftype_pdi, - IA64_BUILTIN_LOCK_RELEASE_DI); +#define def_builtin(name, type, code) \ + lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, \ + NULL, NULL_TREE) def_builtin ("__builtin_ia64_bsp", build_function_type (ptr_type_node, void_list_node), @@ -8198,322 +9174,9 @@ ia64_init_builtins (void) build_function_type (void_type_node, void_list_node), IA64_BUILTIN_FLUSHRS); - def_builtin ("__sync_fetch_and_add_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_ADD_SI); - def_builtin ("__sync_fetch_and_sub_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_SUB_SI); - def_builtin ("__sync_fetch_and_or_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_OR_SI); - def_builtin ("__sync_fetch_and_and_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_AND_SI); - def_builtin ("__sync_fetch_and_xor_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_XOR_SI); - def_builtin ("__sync_fetch_and_nand_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_NAND_SI); - - def_builtin ("__sync_add_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_ADD_AND_FETCH_SI); - def_builtin ("__sync_sub_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_SUB_AND_FETCH_SI); - def_builtin ("__sync_or_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_OR_AND_FETCH_SI); - def_builtin ("__sync_and_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_AND_AND_FETCH_SI); - def_builtin ("__sync_xor_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_XOR_AND_FETCH_SI); - def_builtin ("__sync_nand_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_NAND_AND_FETCH_SI); - - def_builtin ("__sync_fetch_and_add_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_ADD_DI); - def_builtin ("__sync_fetch_and_sub_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_SUB_DI); - def_builtin ("__sync_fetch_and_or_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_OR_DI); - def_builtin ("__sync_fetch_and_and_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_AND_DI); - def_builtin ("__sync_fetch_and_xor_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_XOR_DI); - def_builtin ("__sync_fetch_and_nand_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_NAND_DI); - - def_builtin ("__sync_add_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_ADD_AND_FETCH_DI); - def_builtin ("__sync_sub_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_SUB_AND_FETCH_DI); - def_builtin ("__sync_or_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_OR_AND_FETCH_DI); - def_builtin ("__sync_and_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_AND_AND_FETCH_DI); - def_builtin ("__sync_xor_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_XOR_AND_FETCH_DI); - def_builtin ("__sync_nand_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_NAND_AND_FETCH_DI); - #undef def_builtin } -/* Expand fetch_and_op intrinsics. The basic code sequence is: - - mf - tmp = [ptr]; - do { - ret = tmp; - ar.ccv = tmp; - tmp = value; - cmpxchgsz.acq tmp = [ptr], tmp - } while (tmp != ret) -*/ - -static rtx -ia64_expand_fetch_and_op (optab binoptab, enum machine_mode mode, - tree arglist, rtx target) -{ - rtx ret, label, tmp, ccv, insn, mem, value; - tree arg0, arg1; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, Pmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE(mem) != Pmode) - mem = convert_memory_address (Pmode, mem); -#endif - value = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (Pmode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (target && register_operand (target, mode)) - ret = target; - else - ret = gen_reg_rtx (mode); - - emit_insn (gen_mf ()); - - /* Special case for fetchadd instructions. */ - if (binoptab == add_optab && fetchadd_operand (value, VOIDmode)) - { - if (mode == SImode) - insn = gen_fetchadd_acq_si (ret, mem, value); - else - insn = gen_fetchadd_acq_di (ret, mem, value); - emit_insn (insn); - return ret; - } - - tmp = gen_reg_rtx (mode); - /* ar.ccv must always be loaded with a zero-extended DImode value. */ - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - emit_move_insn (tmp, mem); - - label = gen_label_rtx (); - emit_label (label); - emit_move_insn (ret, tmp); - convert_move (ccv, tmp, /*unsignedp=*/1); - - /* Perform the specific operation. Special case NAND by noticing - one_cmpl_optab instead. */ - if (binoptab == one_cmpl_optab) - { - tmp = expand_unop (mode, binoptab, tmp, NULL, OPTAB_WIDEN); - binoptab = and_optab; - } - tmp = expand_binop (mode, binoptab, tmp, value, tmp, 1, OPTAB_WIDEN); - - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, tmp, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, tmp, ccv); - emit_insn (insn); - - emit_cmp_and_jump_insns (tmp, ret, NE, 0, mode, 1, label); - - return ret; -} - -/* Expand op_and_fetch intrinsics. The basic code sequence is: - - mf - tmp = [ptr]; - do { - old = tmp; - ar.ccv = tmp; - ret = tmp value; - cmpxchgsz.acq tmp = [ptr], ret - } while (tmp != old) -*/ - -static rtx -ia64_expand_op_and_fetch (optab binoptab, enum machine_mode mode, - tree arglist, rtx target) -{ - rtx old, label, tmp, ret, ccv, insn, mem, value; - tree arg0, arg1; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, Pmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE(mem) != Pmode) - mem = convert_memory_address (Pmode, mem); -#endif - - value = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (Pmode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (target && ! register_operand (target, mode)) - target = NULL_RTX; - - emit_insn (gen_mf ()); - tmp = gen_reg_rtx (mode); - old = gen_reg_rtx (mode); - /* ar.ccv must always be loaded with a zero-extended DImode value. */ - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - - emit_move_insn (tmp, mem); - - label = gen_label_rtx (); - emit_label (label); - emit_move_insn (old, tmp); - convert_move (ccv, tmp, /*unsignedp=*/1); - - /* Perform the specific operation. Special case NAND by noticing - one_cmpl_optab instead. */ - if (binoptab == one_cmpl_optab) - { - tmp = expand_unop (mode, binoptab, tmp, NULL, OPTAB_WIDEN); - binoptab = and_optab; - } - ret = expand_binop (mode, binoptab, tmp, value, target, 1, OPTAB_WIDEN); - - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, ret, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, ret, ccv); - emit_insn (insn); - - emit_cmp_and_jump_insns (tmp, old, NE, 0, mode, 1, label); - - return ret; -} - -/* Expand val_ and bool_compare_and_swap. For val_ we want: - - ar.ccv = oldval - mf - cmpxchgsz.acq ret = [ptr], newval, ar.ccv - return ret - - For bool_ it's the same except return ret == oldval. -*/ - -static rtx -ia64_expand_compare_and_swap (enum machine_mode rmode, enum machine_mode mode, - int boolp, tree arglist, rtx target) -{ - tree arg0, arg1, arg2; - rtx mem, old, new, ccv, tmp, insn; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - old = expand_expr (arg1, NULL_RTX, mode, 0); - new = expand_expr (arg2, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (GET_MODE (old) != mode) - old = convert_to_mode (mode, old, /*unsignedp=*/1); - if (GET_MODE (new) != mode) - new = convert_to_mode (mode, new, /*unsignedp=*/1); - - if (! register_operand (old, mode)) - old = copy_to_mode_reg (mode, old); - if (! register_operand (new, mode)) - new = copy_to_mode_reg (mode, new); - - if (! boolp && target && register_operand (target, mode)) - tmp = target; - else - tmp = gen_reg_rtx (mode); - - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - convert_move (ccv, old, /*unsignedp=*/1); - emit_insn (gen_mf ()); - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, new, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, new, ccv); - emit_insn (insn); - - if (boolp) - { - if (! target) - target = gen_reg_rtx (rmode); - return emit_store_flag_force (target, EQ, tmp, old, mode, 1, 1); - } - else - return tmp; -} - -/* Expand lock_test_and_set. I.e. `xchgsz ret = [ptr], new'. */ - -static rtx -ia64_expand_lock_test_and_set (enum machine_mode mode, tree arglist, - rtx target) -{ - tree arg0, arg1; - rtx mem, new, ret, insn; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - new = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - if (! register_operand (new, mode)) - new = copy_to_mode_reg (mode, new); - - if (target && register_operand (target, mode)) - ret = target; - else - ret = gen_reg_rtx (mode); - - if (mode == SImode) - insn = gen_xchgsi (ret, mem, new); - else - insn = gen_xchgdi (ret, mem, new); - emit_insn (insn); - - return ret; -} - -/* Expand lock_release. I.e. `stsz.rel [ptr] = r0'. */ - -static rtx -ia64_expand_lock_release (enum machine_mode mode, tree arglist, - rtx target ATTRIBUTE_UNUSED) -{ - tree arg0; - rtx mem; - - arg0 = TREE_VALUE (arglist); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - - emit_move_insn (mem, const0_rtx); - - return const0_rtx; -} - rtx ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, @@ -8521,89 +9184,9 @@ ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, { tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); unsigned int fcode = DECL_FUNCTION_CODE (fndecl); - tree arglist = TREE_OPERAND (exp, 1); - enum machine_mode rmode = VOIDmode; switch (fcode) { - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: - mode = SImode; - rmode = SImode; - break; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_SI: - case IA64_BUILTIN_LOCK_RELEASE_SI: - case IA64_BUILTIN_FETCH_AND_ADD_SI: - case IA64_BUILTIN_FETCH_AND_SUB_SI: - case IA64_BUILTIN_FETCH_AND_OR_SI: - case IA64_BUILTIN_FETCH_AND_AND_SI: - case IA64_BUILTIN_FETCH_AND_XOR_SI: - case IA64_BUILTIN_FETCH_AND_NAND_SI: - case IA64_BUILTIN_ADD_AND_FETCH_SI: - case IA64_BUILTIN_SUB_AND_FETCH_SI: - case IA64_BUILTIN_OR_AND_FETCH_SI: - case IA64_BUILTIN_AND_AND_FETCH_SI: - case IA64_BUILTIN_XOR_AND_FETCH_SI: - case IA64_BUILTIN_NAND_AND_FETCH_SI: - mode = SImode; - break; - - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: - mode = DImode; - rmode = SImode; - break; - - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: - mode = DImode; - rmode = DImode; - break; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_DI: - case IA64_BUILTIN_LOCK_RELEASE_DI: - case IA64_BUILTIN_FETCH_AND_ADD_DI: - case IA64_BUILTIN_FETCH_AND_SUB_DI: - case IA64_BUILTIN_FETCH_AND_OR_DI: - case IA64_BUILTIN_FETCH_AND_AND_DI: - case IA64_BUILTIN_FETCH_AND_XOR_DI: - case IA64_BUILTIN_FETCH_AND_NAND_DI: - case IA64_BUILTIN_ADD_AND_FETCH_DI: - case IA64_BUILTIN_SUB_AND_FETCH_DI: - case IA64_BUILTIN_OR_AND_FETCH_DI: - case IA64_BUILTIN_AND_AND_FETCH_DI: - case IA64_BUILTIN_XOR_AND_FETCH_DI: - case IA64_BUILTIN_NAND_AND_FETCH_DI: - mode = DImode; - break; - - default: - break; - } - - switch (fcode) - { - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: - return ia64_expand_compare_and_swap (rmode, mode, 1, arglist, - target); - - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: - return ia64_expand_compare_and_swap (rmode, mode, 0, arglist, - target); - - case IA64_BUILTIN_SYNCHRONIZE: - emit_insn (gen_mf ()); - return const0_rtx; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_SI: - case IA64_BUILTIN_LOCK_TEST_AND_SET_DI: - return ia64_expand_lock_test_and_set (mode, arglist, target); - - case IA64_BUILTIN_LOCK_RELEASE_SI: - case IA64_BUILTIN_LOCK_RELEASE_DI: - return ia64_expand_lock_release (mode, arglist, target); - case IA64_BUILTIN_BSP: if (! target || ! register_operand (target, DImode)) target = gen_reg_rtx (DImode); @@ -8617,54 +9200,6 @@ ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, emit_insn (gen_flushrs ()); return const0_rtx; - case IA64_BUILTIN_FETCH_AND_ADD_SI: - case IA64_BUILTIN_FETCH_AND_ADD_DI: - return ia64_expand_fetch_and_op (add_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_SUB_SI: - case IA64_BUILTIN_FETCH_AND_SUB_DI: - return ia64_expand_fetch_and_op (sub_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_OR_SI: - case IA64_BUILTIN_FETCH_AND_OR_DI: - return ia64_expand_fetch_and_op (ior_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_AND_SI: - case IA64_BUILTIN_FETCH_AND_AND_DI: - return ia64_expand_fetch_and_op (and_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_XOR_SI: - case IA64_BUILTIN_FETCH_AND_XOR_DI: - return ia64_expand_fetch_and_op (xor_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_NAND_SI: - case IA64_BUILTIN_FETCH_AND_NAND_DI: - return ia64_expand_fetch_and_op (one_cmpl_optab, mode, arglist, target); - - case IA64_BUILTIN_ADD_AND_FETCH_SI: - case IA64_BUILTIN_ADD_AND_FETCH_DI: - return ia64_expand_op_and_fetch (add_optab, mode, arglist, target); - - case IA64_BUILTIN_SUB_AND_FETCH_SI: - case IA64_BUILTIN_SUB_AND_FETCH_DI: - return ia64_expand_op_and_fetch (sub_optab, mode, arglist, target); - - case IA64_BUILTIN_OR_AND_FETCH_SI: - case IA64_BUILTIN_OR_AND_FETCH_DI: - return ia64_expand_op_and_fetch (ior_optab, mode, arglist, target); - - case IA64_BUILTIN_AND_AND_FETCH_SI: - case IA64_BUILTIN_AND_AND_FETCH_DI: - return ia64_expand_op_and_fetch (and_optab, mode, arglist, target); - - case IA64_BUILTIN_XOR_AND_FETCH_SI: - case IA64_BUILTIN_XOR_AND_FETCH_DI: - return ia64_expand_op_and_fetch (xor_optab, mode, arglist, target); - - case IA64_BUILTIN_NAND_AND_FETCH_SI: - case IA64_BUILTIN_NAND_AND_FETCH_DI: - return ia64_expand_op_and_fetch (one_cmpl_optab, mode, arglist, target); - default: break; } @@ -8722,8 +9257,7 @@ ia64_hpux_file_end (void) tree decl = p->decl; tree id = DECL_ASSEMBLER_NAME (decl); - if (!id) - abort (); + gcc_assert (id); if (!TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (id)) { @@ -8740,19 +9274,72 @@ ia64_hpux_file_end (void) extern_func_head = 0; } +/* Set SImode div/mod functions, init_integral_libfuncs only initializes + modes of word_mode and larger. Rename the TFmode libfuncs using the + HPUX conventions. __divtf3 is used for XFmode. We need to keep it for + backward compatibility. */ + +static void +ia64_init_libfuncs (void) +{ + set_optab_libfunc (sdiv_optab, SImode, "__divsi3"); + set_optab_libfunc (udiv_optab, SImode, "__udivsi3"); + set_optab_libfunc (smod_optab, SImode, "__modsi3"); + set_optab_libfunc (umod_optab, SImode, "__umodsi3"); + + set_optab_libfunc (add_optab, TFmode, "_U_Qfadd"); + set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub"); + set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy"); + set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv"); + set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg"); + + set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad"); + set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad"); + set_conv_libfunc (sext_optab, TFmode, XFmode, "_U_Qfcnvff_f80_to_quad"); + set_conv_libfunc (trunc_optab, SFmode, TFmode, "_U_Qfcnvff_quad_to_sgl"); + set_conv_libfunc (trunc_optab, DFmode, TFmode, "_U_Qfcnvff_quad_to_dbl"); + set_conv_libfunc (trunc_optab, XFmode, TFmode, "_U_Qfcnvff_quad_to_f80"); + + set_conv_libfunc (sfix_optab, SImode, TFmode, "_U_Qfcnvfxt_quad_to_sgl"); + set_conv_libfunc (sfix_optab, DImode, TFmode, "_U_Qfcnvfxt_quad_to_dbl"); + set_conv_libfunc (sfix_optab, TImode, TFmode, "_U_Qfcnvfxt_quad_to_quad"); + set_conv_libfunc (ufix_optab, SImode, TFmode, "_U_Qfcnvfxut_quad_to_sgl"); + set_conv_libfunc (ufix_optab, DImode, TFmode, "_U_Qfcnvfxut_quad_to_dbl"); + + set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad"); + set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad"); + set_conv_libfunc (sfloat_optab, TFmode, TImode, "_U_Qfcnvxf_quad_to_quad"); + /* HP-UX 11.23 libc does not have a function for unsigned + SImode-to-TFmode conversion. */ + set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxuf_dbl_to_quad"); +} + /* Rename all the TFmode libfuncs using the HPUX conventions. */ static void ia64_hpux_init_libfuncs (void) { - set_optab_libfunc (add_optab, TFmode, "_U_Qfadd"); - set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub"); - set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy"); - set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv"); + ia64_init_libfuncs (); + + /* The HP SI millicode division and mod functions expect DI arguments. + By turning them off completely we avoid using both libgcc and the + non-standard millicode routines and use the HP DI millicode routines + instead. */ + + set_optab_libfunc (sdiv_optab, SImode, 0); + set_optab_libfunc (udiv_optab, SImode, 0); + set_optab_libfunc (smod_optab, SImode, 0); + set_optab_libfunc (umod_optab, SImode, 0); + + set_optab_libfunc (sdiv_optab, DImode, "__milli_divI"); + set_optab_libfunc (udiv_optab, DImode, "__milli_divU"); + set_optab_libfunc (smod_optab, DImode, "__milli_remI"); + set_optab_libfunc (umod_optab, DImode, "__milli_remU"); + + /* HP-UX libc has TF min/max/abs routines in it. */ set_optab_libfunc (smin_optab, TFmode, "_U_Qfmin"); set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax"); set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs"); - set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg"); /* ia64_expand_compare uses this. */ cmptf_libfunc = init_one_libfunc ("_U_Qfcmp"); @@ -8764,21 +9351,6 @@ ia64_hpux_init_libfuncs (void) set_optab_libfunc (ge_optab, TFmode, 0); set_optab_libfunc (lt_optab, TFmode, 0); set_optab_libfunc (le_optab, TFmode, 0); - - set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad"); - set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad"); - set_conv_libfunc (sext_optab, TFmode, XFmode, "_U_Qfcnvff_f80_to_quad"); - set_conv_libfunc (trunc_optab, SFmode, TFmode, "_U_Qfcnvff_quad_to_sgl"); - set_conv_libfunc (trunc_optab, DFmode, TFmode, "_U_Qfcnvff_quad_to_dbl"); - set_conv_libfunc (trunc_optab, XFmode, TFmode, "_U_Qfcnvff_quad_to_f80"); - - set_conv_libfunc (sfix_optab, SImode, TFmode, "_U_Qfcnvfxt_quad_to_sgl"); - set_conv_libfunc (sfix_optab, DImode, TFmode, "_U_Qfcnvfxt_quad_to_dbl"); - set_conv_libfunc (ufix_optab, SImode, TFmode, "_U_Qfcnvfxut_quad_to_sgl"); - set_conv_libfunc (ufix_optab, DImode, TFmode, "_U_Qfcnvfxut_quad_to_dbl"); - - set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad"); - set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad"); } /* Rename the division and modulus functions in VMS. */ @@ -8795,50 +9367,79 @@ ia64_vms_init_libfuncs (void) set_optab_libfunc (umod_optab, SImode, "OTS$REM_UI"); set_optab_libfunc (umod_optab, DImode, "OTS$REM_UL"); } - -/* Switch to the section to which we should output X. The only thing - special we do here is to honor small data. */ + +/* Rename the TFmode libfuncs available from soft-fp in glibc using + the HPUX conventions. */ static void +ia64_sysv4_init_libfuncs (void) +{ + ia64_init_libfuncs (); + + /* These functions are not part of the HPUX TFmode interface. We + use them instead of _U_Qfcmp, which doesn't work the way we + expect. */ + set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq"); + set_optab_libfunc (ne_optab, TFmode, "_U_Qfne"); + set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt"); + set_optab_libfunc (ge_optab, TFmode, "_U_Qfge"); + set_optab_libfunc (lt_optab, TFmode, "_U_Qflt"); + set_optab_libfunc (le_optab, TFmode, "_U_Qfle"); + + /* We leave out _U_Qfmin, _U_Qfmax and _U_Qfabs since soft-fp in + glibc doesn't have them. */ +} + +/* For HPUX, it is illegal to have relocations in shared segments. */ + +static int +ia64_hpux_reloc_rw_mask (void) +{ + return 3; +} + +/* For others, relax this so that relocations to local data goes in + read-only segments, but we still cannot allow global relocations + in read-only segments. */ + +static int +ia64_reloc_rw_mask (void) +{ + return flag_pic ? 3 : 2; +} + +/* Return the section to use for X. The only special thing we do here + is to honor small data. */ + +static section * ia64_select_rtx_section (enum machine_mode mode, rtx x, unsigned HOST_WIDE_INT align) { if (GET_MODE_SIZE (mode) > 0 - && GET_MODE_SIZE (mode) <= ia64_section_threshold) - sdata_section (); + && GET_MODE_SIZE (mode) <= ia64_section_threshold + && !TARGET_NO_SDATA) + return sdata_section; else - default_elf_select_rtx_section (mode, x, align); -} - -/* It is illegal to have relocations in shared segments on AIX and HPUX. - Pretend flag_pic is always set. */ - -static void -ia64_rwreloc_select_section (tree exp, int reloc, unsigned HOST_WIDE_INT align) -{ - default_elf_select_section_1 (exp, reloc, align, true); -} - -static void -ia64_rwreloc_unique_section (tree decl, int reloc) -{ - default_unique_section_1 (decl, reloc, true); -} - -static void -ia64_rwreloc_select_rtx_section (enum machine_mode mode, rtx x, - unsigned HOST_WIDE_INT align) -{ - int save_pic = flag_pic; - flag_pic = 1; - ia64_select_rtx_section (mode, x, align); - flag_pic = save_pic; + return default_elf_select_rtx_section (mode, x, align); } static unsigned int -ia64_rwreloc_section_type_flags (tree decl, const char *name, int reloc) +ia64_section_type_flags (tree decl, const char *name, int reloc) { - return default_section_type_flags_1 (decl, name, reloc, true); + unsigned int flags = 0; + + if (strcmp (name, ".sdata") == 0 + || strncmp (name, ".sdata.", 7) == 0 + || strncmp (name, ".gnu.linkonce.s.", 16) == 0 + || strncmp (name, ".sdata2.", 8) == 0 + || strncmp (name, ".gnu.linkonce.s2.", 17) == 0 + || strcmp (name, ".sbss") == 0 + || strncmp (name, ".sbss.", 6) == 0 + || strncmp (name, ".gnu.linkonce.sb.", 17) == 0) + flags = SECTION_SMALL; + + flags |= default_section_type_flags (decl, name, reloc); + return flags; } /* Returns true if FNTYPE (a FUNCTION_TYPE or a METHOD_TYPE) returns a @@ -8881,6 +9482,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, reload_completed = 1; epilogue_completed = 1; no_new_pseudos = 1; + reset_block_changes (); /* Set things up as ia64_expand_prologue might. */ last_scratch_gr_reg = 15; @@ -9003,7 +9605,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, insn = get_insns (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; @@ -9022,4 +9624,216 @@ ia64_struct_value_rtx (tree fntype, return gen_rtx_REG (Pmode, GR_REG (8)); } +static bool +ia64_scalar_mode_supported_p (enum machine_mode mode) +{ + switch (mode) + { + case QImode: + case HImode: + case SImode: + case DImode: + case TImode: + return true; + + case SFmode: + case DFmode: + case XFmode: + case RFmode: + return true; + + case TFmode: + return TARGET_HPUX; + + default: + return false; + } +} + +static bool +ia64_vector_mode_supported_p (enum machine_mode mode) +{ + switch (mode) + { + case V8QImode: + case V4HImode: + case V2SImode: + return true; + + case V2SFmode: + return true; + + default: + return false; + } +} + +/* Implement the FUNCTION_PROFILER macro. */ + +void +ia64_output_function_profiler (FILE *file, int labelno) +{ + bool indirect_call; + + /* If the function needs a static chain and the static chain + register is r15, we use an indirect call so as to bypass + the PLT stub in case the executable is dynamically linked, + because the stub clobbers r15 as per 5.3.6 of the psABI. + We don't need to do that in non canonical PIC mode. */ + + if (cfun->static_chain_decl && !TARGET_NO_PIC && !TARGET_AUTO_PIC) + { + gcc_assert (STATIC_CHAIN_REGNUM == 15); + indirect_call = true; + } + else + indirect_call = false; + + if (TARGET_GNU_AS) + fputs ("\t.prologue 4, r40\n", file); + else + fputs ("\t.prologue\n\t.save ar.pfs, r40\n", file); + fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", file); + + if (NO_PROFILE_COUNTERS) + fputs ("\tmov out3 = r0\n", file); + else + { + char buf[20]; + ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); + + if (TARGET_AUTO_PIC) + fputs ("\tmovl out3 = @gprel(", file); + else + fputs ("\taddl out3 = @ltoff(", file); + assemble_name (file, buf); + if (TARGET_AUTO_PIC) + fputs (")\n", file); + else + fputs ("), r1\n", file); + } + + if (indirect_call) + fputs ("\taddl r14 = @ltoff(@fptr(_mcount)), r1\n", file); + fputs ("\t;;\n", file); + + fputs ("\t.save rp, r42\n", file); + fputs ("\tmov out2 = b0\n", file); + if (indirect_call) + fputs ("\tld8 r14 = [r14]\n\t;;\n", file); + fputs ("\t.body\n", file); + fputs ("\tmov out1 = r1\n", file); + if (indirect_call) + { + fputs ("\tld8 r16 = [r14], 8\n\t;;\n", file); + fputs ("\tmov b6 = r16\n", file); + fputs ("\tld8 r1 = [r14]\n", file); + fputs ("\tbr.call.sptk.many b0 = b6\n\t;;\n", file); + } + else + fputs ("\tbr.call.sptk.many b0 = _mcount\n\t;;\n", file); +} + +static GTY(()) rtx mcount_func_rtx; +static rtx +gen_mcount_func_rtx (void) +{ + if (!mcount_func_rtx) + mcount_func_rtx = init_one_libfunc ("_mcount"); + return mcount_func_rtx; +} + +void +ia64_profile_hook (int labelno) +{ + rtx label, ip; + + if (NO_PROFILE_COUNTERS) + label = const0_rtx; + else + { + char buf[30]; + const char *label_name; + ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); + label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf)); + label = gen_rtx_SYMBOL_REF (Pmode, label_name); + SYMBOL_REF_FLAGS (label) = SYMBOL_FLAG_LOCAL; + } + ip = gen_reg_rtx (Pmode); + emit_insn (gen_ip_value (ip)); + emit_library_call (gen_mcount_func_rtx (), LCT_NORMAL, + VOIDmode, 3, + gen_rtx_REG (Pmode, BR_REG (0)), Pmode, + ip, Pmode, + label, Pmode); +} + +/* Return the mangling of TYPE if it is an extended fundamental type. */ + +static const char * +ia64_mangle_fundamental_type (tree type) +{ + /* On HP-UX, "long double" is mangled as "e" so __float128 is + mangled as "e". */ + if (!TARGET_HPUX && TYPE_MODE (type) == TFmode) + return "g"; + /* On HP-UX, "e" is not available as a mangling of __float80 so use + an extended mangling. Elsewhere, "e" is available since long + double is 80 bits. */ + if (TYPE_MODE (type) == XFmode) + return TARGET_HPUX ? "u9__float80" : "e"; + if (TYPE_MODE (type) == RFmode) + return "u7__fpreg"; + return NULL; +} + +/* Return the diagnostic message string if conversion from FROMTYPE to + TOTYPE is not allowed, NULL otherwise. */ +static const char * +ia64_invalid_conversion (tree fromtype, tree totype) +{ + /* Reject nontrivial conversion to or from __fpreg. */ + if (TYPE_MODE (fromtype) == RFmode + && TYPE_MODE (totype) != RFmode + && TYPE_MODE (totype) != VOIDmode) + return N_("invalid conversion from %<__fpreg%>"); + if (TYPE_MODE (totype) == RFmode + && TYPE_MODE (fromtype) != RFmode) + return N_("invalid conversion to %<__fpreg%>"); + return NULL; +} + +/* Return the diagnostic message string if the unary operation OP is + not permitted on TYPE, NULL otherwise. */ +static const char * +ia64_invalid_unary_op (int op, tree type) +{ + /* Reject operations on __fpreg other than unary + or &. */ + if (TYPE_MODE (type) == RFmode + && op != CONVERT_EXPR + && op != ADDR_EXPR) + return N_("invalid operation on %<__fpreg%>"); + return NULL; +} + +/* Return the diagnostic message string if the binary operation OP is + not permitted on TYPE1 and TYPE2, NULL otherwise. */ +static const char * +ia64_invalid_binary_op (int op ATTRIBUTE_UNUSED, tree type1, tree type2) +{ + /* Reject operations on __fpreg. */ + if (TYPE_MODE (type1) == RFmode || TYPE_MODE (type2) == RFmode) + return N_("invalid operation on %<__fpreg%>"); + return NULL; +} + +/* Implement overriding of the optimization options. */ +void +ia64_optimization_options (int level ATTRIBUTE_UNUSED, + int size ATTRIBUTE_UNUSED) +{ + /* Let the scheduler form additional regions. */ + set_param_value ("max-sched-extend-regions-iters", 2); +} + #include "gt-ia64.h" diff --git a/contrib/gcc/config/ia64/ia64.h b/contrib/gcc/config/ia64/ia64.h index 9f7dd055df6..c9bb4171662 100644 --- a/contrib/gcc/config/ia64/ia64.h +++ b/contrib/gcc/config/ia64/ia64.h @@ -1,5 +1,6 @@ /* Definitions of target machine GNU compiler. IA-64 version. - Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by James E. Wilson and David Mosberger . @@ -17,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* ??? Look at ABI group documents for list of preprocessor macros and other features required for ABI compliance. */ @@ -26,8 +27,6 @@ Boston, MA 02111-1307, USA. */ /* ??? Functions containing a non-local goto target save many registers. Why? See for instance execute/920428-2.c. */ -/* ??? Add support for short data/bss sections. */ - /* Run-time target specifications */ @@ -55,95 +54,9 @@ do { \ #define ASM_EXTRA_SPEC "" - -/* This declaration should be present. */ -extern int target_flags; - -/* This series of macros is to allow compiler command arguments to enable or - disable the use of optional features of the target machine. */ - -#define MASK_BIG_ENDIAN 0x00000001 /* Generate big endian code. */ - -#define MASK_GNU_AS 0x00000002 /* Generate code for GNU as. */ - -#define MASK_GNU_LD 0x00000004 /* Generate code for GNU ld. */ - -#define MASK_NO_PIC 0x00000008 /* Generate code without GP reg. */ - -#define MASK_VOL_ASM_STOP 0x00000010 /* Emit stop bits for vol ext asm. */ - -#define MASK_ILP32 0x00000020 /* Generate ILP32 code. */ - -#define MASK_B_STEP 0x00000040 /* Emit code for Itanium B step. */ - -#define MASK_REG_NAMES 0x00000080 /* Use in/loc/out register names. */ - -#define MASK_NO_SDATA 0x00000100 /* Disable sdata/scommon/sbss. */ - -#define MASK_CONST_GP 0x00000200 /* treat gp as program-wide constant */ - -#define MASK_AUTO_PIC 0x00000400 /* generate automatically PIC */ - -#define MASK_INLINE_FLOAT_DIV_LAT 0x00000800 /* inline div, min latency. */ - -#define MASK_INLINE_FLOAT_DIV_THR 0x00001000 /* inline div, max throughput. */ - -#define MASK_INLINE_INT_DIV_LAT 0x00000800 /* inline div, min latency. */ - -#define MASK_INLINE_INT_DIV_THR 0x00001000 /* inline div, max throughput. */ - -#define MASK_INLINE_SQRT_LAT 0x00002000 /* inline sqrt, min latency. */ - -#define MASK_INLINE_SQRT_THR 0x00004000 /* inline sqrt, max throughput. */ - -#define MASK_DWARF2_ASM 0x40000000 /* test dwarf2 line info via gas. */ - -#define MASK_EARLY_STOP_BITS 0x00002000 /* tune stop bits for the model. */ - -#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN) - -#define TARGET_GNU_AS (target_flags & MASK_GNU_AS) - -#define TARGET_GNU_LD (target_flags & MASK_GNU_LD) - -#define TARGET_NO_PIC (target_flags & MASK_NO_PIC) - -#define TARGET_VOL_ASM_STOP (target_flags & MASK_VOL_ASM_STOP) - -#define TARGET_ILP32 (target_flags & MASK_ILP32) - -#define TARGET_B_STEP (target_flags & MASK_B_STEP) - -#define TARGET_REG_NAMES (target_flags & MASK_REG_NAMES) - -#define TARGET_NO_SDATA (target_flags & MASK_NO_SDATA) - -#define TARGET_CONST_GP (target_flags & MASK_CONST_GP) - -#define TARGET_AUTO_PIC (target_flags & MASK_AUTO_PIC) - -#define TARGET_INLINE_FLOAT_DIV_LAT (target_flags & MASK_INLINE_FLOAT_DIV_LAT) - -#define TARGET_INLINE_FLOAT_DIV_THR (target_flags & MASK_INLINE_FLOAT_DIV_THR) - -#define TARGET_INLINE_INT_DIV_LAT (target_flags & MASK_INLINE_INT_DIV_LAT) - -#define TARGET_INLINE_INT_DIV_THR (target_flags & MASK_INLINE_INT_DIV_THR) - -#define TARGET_INLINE_FLOAT_DIV \ - (target_flags & (MASK_INLINE_FLOAT_DIV_LAT | MASK_INLINE_FLOAT_DIV_THR)) - -#define TARGET_INLINE_INT_DIV \ - (target_flags & (MASK_INLINE_INT_DIV_LAT | MASK_INLINE_INT_DIV_THR)) - -#define TARGET_INLINE_SQRT_LAT (target_flags & MASK_INLINE_SQRT_LAT) - -#define TARGET_INLINE_SQRT_THR (target_flags & MASK_INLINE_SQRT_THR) - -#define TARGET_INLINE_SQRT \ - (target_flags & (MASK_INLINE_SQRT_LAT | MASK_INLINE_SQRT_THR)) - -#define TARGET_DWARF2_ASM (target_flags & MASK_DWARF2_ASM) +/* Variables which are this size or smaller are put in the sdata/sbss + sections. */ +extern unsigned int ia64_section_threshold; /* If the assembler supports thread-local storage, assume that the system does as well. If a particular target system has an @@ -154,126 +67,54 @@ extern int target_flags; #define TARGET_HAVE_TLS true #endif -extern int ia64_tls_size; #define TARGET_TLS14 (ia64_tls_size == 14) #define TARGET_TLS22 (ia64_tls_size == 22) #define TARGET_TLS64 (ia64_tls_size == 64) -#define TARGET_EARLY_STOP_BITS (target_flags & MASK_EARLY_STOP_BITS) #define TARGET_HPUX 0 #define TARGET_HPUX_LD 0 +#ifndef TARGET_ILP32 +#define TARGET_ILP32 0 +#endif + #ifndef HAVE_AS_LTOFFX_LDXMOV_RELOCS #define HAVE_AS_LTOFFX_LDXMOV_RELOCS 0 #endif -/* This macro defines names of command options to set and clear bits in - `target_flags'. Its definition is an initializer with a subgrouping for - each command option. */ +/* Values for TARGET_INLINE_FLOAT_DIV, TARGET_INLINE_INT_DIV, and + TARGET_INLINE_SQRT. */ -#define TARGET_SWITCHES \ -{ \ - { "big-endian", MASK_BIG_ENDIAN, \ - N_("Generate big endian code") }, \ - { "little-endian", -MASK_BIG_ENDIAN, \ - N_("Generate little endian code") }, \ - { "gnu-as", MASK_GNU_AS, \ - N_("Generate code for GNU as") }, \ - { "no-gnu-as", -MASK_GNU_AS, \ - N_("Generate code for Intel as") }, \ - { "gnu-ld", MASK_GNU_LD, \ - N_("Generate code for GNU ld") }, \ - { "no-gnu-ld", -MASK_GNU_LD, \ - N_("Generate code for Intel ld") }, \ - { "no-pic", MASK_NO_PIC, \ - N_("Generate code without GP reg") }, \ - { "volatile-asm-stop", MASK_VOL_ASM_STOP, \ - N_("Emit stop bits before and after volatile extended asms") }, \ - { "no-volatile-asm-stop", -MASK_VOL_ASM_STOP, \ - N_("Don't emit stop bits before and after volatile extended asms") }, \ - { "b-step", MASK_B_STEP, \ - N_("Emit code for Itanium (TM) processor B step")}, \ - { "register-names", MASK_REG_NAMES, \ - N_("Use in/loc/out register names")}, \ - { "no-sdata", MASK_NO_SDATA, \ - N_("Disable use of sdata/scommon/sbss")}, \ - { "sdata", -MASK_NO_SDATA, \ - N_("Enable use of sdata/scommon/sbss")}, \ - { "constant-gp", MASK_CONST_GP, \ - N_("gp is constant (but save/restore gp on indirect calls)") }, \ - { "auto-pic", MASK_AUTO_PIC, \ - N_("Generate self-relocatable code") }, \ - { "inline-float-divide-min-latency", MASK_INLINE_FLOAT_DIV_LAT, \ - N_("Generate inline floating point division, optimize for latency") },\ - { "inline-float-divide-max-throughput", MASK_INLINE_FLOAT_DIV_THR, \ - N_("Generate inline floating point division, optimize for throughput") },\ - { "inline-int-divide-min-latency", MASK_INLINE_INT_DIV_LAT, \ - N_("Generate inline integer division, optimize for latency") }, \ - { "inline-int-divide-max-throughput", MASK_INLINE_INT_DIV_THR, \ - N_("Generate inline integer division, optimize for throughput") },\ - { "inline-sqrt-min-latency", MASK_INLINE_SQRT_LAT, \ - N_("Generate inline square root, optimize for latency") }, \ - { "inline-sqrt-max-throughput", MASK_INLINE_SQRT_THR, \ - N_("Generate inline square root, optimize for throughput") }, \ - { "dwarf2-asm", MASK_DWARF2_ASM, \ - N_("Enable Dwarf 2 line debug info via GNU as")}, \ - { "no-dwarf2-asm", -MASK_DWARF2_ASM, \ - N_("Disable Dwarf 2 line debug info via GNU as")}, \ - { "early-stop-bits", MASK_EARLY_STOP_BITS, \ - N_("Enable earlier placing stop bits for better scheduling")}, \ - { "no-early-stop-bits", -MASK_EARLY_STOP_BITS, \ - N_("Disable earlier placing stop bits")}, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \ - NULL } \ -} +enum ia64_inline_type +{ + INL_NO = 0, + INL_MIN_LAT = 1, + INL_MAX_THR = 2 +}; /* Default target_flags if no switches are specified */ #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_DWARF2_ASM +#define TARGET_DEFAULT (MASK_DWARF2_ASM) #endif #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT 0 #endif -#ifndef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES -#endif - -/* This macro is similar to `TARGET_SWITCHES' but defines names of command - options that have values. Its definition is an initializer with a - subgrouping for each command option. */ - -extern const char *ia64_fixed_range_string; -extern const char *ia64_tls_size_string; - /* Which processor to schedule for. The cpu attribute defines a list - that mirrors this list, so changes to i64.md must be made at the + that mirrors this list, so changes to ia64.md must be made at the same time. */ enum processor_type { - PROCESSOR_ITANIUM, /* Original Itanium. */ + PROCESSOR_ITANIUM, /* Original Itanium. */ PROCESSOR_ITANIUM2, PROCESSOR_max }; extern enum processor_type ia64_tune; -extern const char *ia64_tune_string; - -#define TARGET_OPTIONS \ -{ \ - { "fixed-range=", &ia64_fixed_range_string, \ - N_("Specify range of registers to make fixed"), 0}, \ - { "tls-size=", &ia64_tls_size_string, \ - N_("Specify bit size of immediate TLS offsets"), 0}, \ - { "tune=", &ia64_tune_string, \ - N_("Schedule code for given CPU"), 0}, \ -} - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if defined, is executed once just after @@ -349,12 +190,6 @@ do \ } \ while (0) -/* ??? ABI doesn't allow us to define this. */ -/* #define PROMOTE_FUNCTION_ARGS */ - -/* ??? ABI doesn't allow us to define this. */ -/* #define PROMOTE_FUNCTION_RETURN */ - #define PARM_BOUNDARY 64 /* Define this macro if you wish to preserve a certain alignment for the stack @@ -439,8 +274,6 @@ while (0) #define LONG_TYPE_SIZE (TARGET_ILP32 ? 32 : 64) -#define MAX_LONG_TYPE_SIZE 64 - #define LONG_LONG_TYPE_SIZE 64 #define FLOAT_TYPE_SIZE 32 @@ -448,10 +281,10 @@ while (0) #define DOUBLE_TYPE_SIZE 64 /* long double is XFmode normally, TFmode for HPUX. */ -#define LONG_DOUBLE_TYPE_SIZE (TARGET_HPUX ? 128 : 96) +#define LONG_DOUBLE_TYPE_SIZE (TARGET_HPUX ? 128 : 80) /* We always want the XFmode operations from libgcc2.c. */ -#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96 +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80 #define DEFAULT_SIGNED_CHAR 1 @@ -491,6 +324,7 @@ while (0) #define ADDL_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 3) #define GR_REGNO_P(REGNO) ((unsigned HOST_WIDE_INT) (REGNO) <= 127) #define FR_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 255) +#define FP_REGNO_P(REGNO) ((REGNO) >= 128 && (REGNO) <= 254 && (REGNO) != 159) #define PR_REGNO_P(REGNO) ((REGNO) >= 256 && (REGNO) <= 319) #define BR_REGNO_P(REGNO) ((REGNO) >= 320 && (REGNO) <= 327) #define GENERAL_REGNO_P(REGNO) \ @@ -620,7 +454,7 @@ while (0) #define CALL_REALLY_USED_REGISTERS \ { /* General registers. */ \ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, \ + 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -629,7 +463,7 @@ while (0) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \ /* Floating-point registers. */ \ - 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ @@ -638,7 +472,7 @@ while (0) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ /* Predicate registers. */ \ - 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -672,9 +506,7 @@ while (0) #define LOCAL_REGNO(REGNO) \ (IN_REGNO_P (REGNO) || LOC_REGNO_P (REGNO)) -/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, - return the mode to be used for the comparison. Must be defined if - EXTRA_CC_MODES is defined. */ +/* We define CCImode in ia64-modes.def so we need a selector. */ #define SELECT_CC_MODE(OP,X,Y) CCmode @@ -810,6 +642,7 @@ while (0) : PR_REGNO_P (REGNO) && (MODE) == BImode ? 2 \ : PR_REGNO_P (REGNO) && (MODE) == CCImode ? 1 \ : FR_REGNO_P (REGNO) && (MODE) == XFmode ? 1 \ + : FR_REGNO_P (REGNO) && (MODE) == XCmode ? 2 \ : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) /* A C expression that is nonzero if it is permissible to store a value of mode @@ -819,12 +652,12 @@ while (0) #define HARD_REGNO_MODE_OK(REGNO, MODE) \ (FR_REGNO_P (REGNO) ? \ GET_MODE_CLASS (MODE) != MODE_CC && \ - (MODE) != TImode && \ (MODE) != BImode && \ (MODE) != TFmode \ : PR_REGNO_P (REGNO) ? \ (MODE) == BImode || GET_MODE_CLASS (MODE) == MODE_CC \ - : GR_REGNO_P (REGNO) ? (MODE) != CCImode && (MODE) != XFmode \ + : GR_REGNO_P (REGNO) ? \ + (MODE) != CCImode && (MODE) != XFmode && (MODE) != XCmode \ : AR_REGNO_P (REGNO) ? (MODE) == DImode \ : BR_REGNO_P (REGNO) ? (MODE) == DImode \ : 0) @@ -841,7 +674,8 @@ while (0) we can't tie it with any other modes. */ #define MODES_TIEABLE_P(MODE1, MODE2) \ (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2) \ - && (((MODE1) == XFmode) == ((MODE2) == XFmode)) \ + && ((((MODE1) == XFmode) || ((MODE1) == XCmode)) \ + == (((MODE2) == XFmode) || ((MODE2) == XCmode))) \ && (((MODE1) == BImode) == ((MODE2) == BImode))) /* Specify the modes required to caller save a given hard regno. @@ -887,6 +721,7 @@ enum reg_class AR_I_REGS, ADDL_REGS, GR_REGS, + FP_REGS, FR_REGS, GR_AND_BR_REGS, GR_AND_FR_REGS, @@ -903,7 +738,7 @@ enum reg_class constants. These names are used in writing some of the debugging dumps. */ #define REG_CLASS_NAMES \ { "NO_REGS", "PR_REGS", "BR_REGS", "AR_M_REGS", "AR_I_REGS", \ - "ADDL_REGS", "GR_REGS", "FR_REGS", \ + "ADDL_REGS", "GR_REGS", "FP_REGS", "FR_REGS", \ "GR_AND_BR_REGS", "GR_AND_FR_REGS", "ALL_REGS" } /* An initializer containing the contents of the register classes, as integers @@ -940,6 +775,10 @@ enum reg_class { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \ 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ 0x00000000, 0x00000000, 0x0100 }, \ + /* FP_REGS. */ \ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ + 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF, \ + 0x00000000, 0x00000000, 0x0000 }, \ /* FR_REGS. */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, \ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, \ @@ -967,7 +806,8 @@ enum reg_class #define REGNO_REG_CLASS(REGNO) \ (ADDL_REGNO_P (REGNO) ? ADDL_REGS \ : GENERAL_REGNO_P (REGNO) ? GR_REGS \ - : FR_REGNO_P (REGNO) ? FR_REGS \ + : FR_REGNO_P (REGNO) ? (REGNO) != R_FR (31) \ + && (REGNO) != R_FR(127) ? FP_REGS : FR_REGS \ : PR_REGNO_P (REGNO) ? PR_REGS \ : BR_REGNO_P (REGNO) ? BR_REGS \ : AR_M_REGNO_P (REGNO) ? AR_M_REGS \ @@ -998,6 +838,7 @@ enum reg_class : (CHAR) == 'c' ? PR_REGS \ : (CHAR) == 'd' ? AR_M_REGS \ : (CHAR) == 'e' ? AR_I_REGS \ + : (CHAR) == 'x' ? FP_REGS \ : NO_REGS) /* A C expression which is nonzero if register number NUM is suitable for use @@ -1017,18 +858,8 @@ enum reg_class The value is a register class; perhaps CLASS, or perhaps another, smaller class. */ -/* Don't allow volatile mem reloads into floating point registers. This - is defined to force reload to choose the r/m case instead of the f/f case - when reloading (set (reg fX) (mem/v)). - - Do not reload expressions into AR regs. */ - #define PREFERRED_RELOAD_CLASS(X, CLASS) \ - (CLASS == FR_REGS && GET_CODE (X) == MEM && MEM_VOLATILE_P (X) ? NO_REGS \ - : CLASS == FR_REGS && GET_CODE (X) == CONST_DOUBLE ? NO_REGS \ - : GET_RTX_CLASS (GET_CODE (X)) != 'o' \ - && (CLASS == AR_M_REGS || CLASS == AR_I_REGS) ? NO_REGS \ - : CLASS) + ia64_preferred_reload_class (X, CLASS) /* You should define this macro to indicate to the reload phase that it may need to allocate at least one register for a reload in addition to the @@ -1053,8 +884,9 @@ enum reg_class with unions should be solved with the addressof fiddling done by movxf and friends. */ #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ - ((MODE) == XFmode && (((CLASS1) == GR_REGS && (CLASS2) == FR_REGS) \ - || ((CLASS1) == FR_REGS && (CLASS2) == GR_REGS))) + (((MODE) == XFmode || (MODE) == XCmode) \ + && (((CLASS1) == GR_REGS && (CLASS2) == FR_REGS) \ + || ((CLASS1) == FR_REGS && (CLASS2) == GR_REGS))) #endif /* A C expression for the maximum number of consecutive registers of @@ -1063,14 +895,15 @@ enum reg_class #define CLASS_MAX_NREGS(CLASS, MODE) \ ((MODE) == BImode && (CLASS) == PR_REGS ? 2 \ - : ((CLASS) == FR_REGS && (MODE) == XFmode) ? 1 \ + : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XFmode) ? 1 \ + : (((CLASS) == FR_REGS || (CLASS) == FP_REGS) && (MODE) == XCmode) ? 2 \ : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) -/* In FP regs, we can't change FP values to integer values and vice - versa, but we can change e.g. DImode to SImode. */ +/* In FP regs, we can't change FP values to integer values and vice versa, + but we can change e.g. DImode to SImode, and V2SFmode into DImode. */ -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (GET_MODE_CLASS (FROM) != GET_MODE_CLASS (TO) \ +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (SCALAR_FLOAT_MODE_P (FROM) != SCALAR_FLOAT_MODE_P (TO) \ ? reg_classes_intersect_p (CLASS, FR_REGS) : 0) /* A C expression that defines the machine-dependent operand constraint @@ -1097,15 +930,7 @@ enum reg_class #define CONST_OK_FOR_P(VALUE) ((VALUE) == 0 || (VALUE) == -1) #define CONST_OK_FOR_LETTER_P(VALUE, C) \ -((C) == 'I' ? CONST_OK_FOR_I (VALUE) \ - : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \ - : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \ - : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \ - : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \ - : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \ - : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \ - : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \ - : 0) + ia64_const_ok_for_letter_p (VALUE, C) /* A C expression that defines the machine-dependent operand constraint letters (`G', `H') that specify particular ranges of `const_double' values. */ @@ -1116,33 +941,21 @@ enum reg_class || (VALUE) == CONST1_RTX (GET_MODE (VALUE))) #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) : 0) + ia64_const_double_ok_for_letter_p (VALUE, C) /* A C expression that defines the optional machine-dependent constraint letters (`Q', `R', `S', `T', `U') that can be used to segregate specific types of operands, usually memory references, for the target machine. */ -/* Non-volatile memory for FP_REG loads/stores. */ -#define CONSTRAINT_OK_FOR_Q(VALUE) \ - (memory_operand((VALUE), VOIDmode) && ! MEM_VOLATILE_P (VALUE)) -/* 1..4 for shladd arguments. */ -#define CONSTRAINT_OK_FOR_R(VALUE) \ - (GET_CODE (VALUE) == CONST_INT && INTVAL (VALUE) >= 1 && INTVAL (VALUE) <= 4) -/* Non-post-inc memory for asms and other unsavory creatures. */ -#define CONSTRAINT_OK_FOR_S(VALUE) \ - (GET_CODE (VALUE) == MEM \ - && GET_RTX_CLASS (GET_CODE (XEXP ((VALUE), 0))) != 'a' \ - && (reload_in_progress || memory_operand ((VALUE), VOIDmode))) -/* Symbol ref to small-address-area: */ -#define CONSTRAINT_OK_FOR_T(VALUE) \ - (GET_CODE (VALUE) == SYMBOL_REF && SYMBOL_REF_SMALL_ADDR_P (VALUE)) - #define EXTRA_CONSTRAINT(VALUE, C) \ - ((C) == 'Q' ? CONSTRAINT_OK_FOR_Q (VALUE) \ - : (C) == 'R' ? CONSTRAINT_OK_FOR_R (VALUE) \ - : (C) == 'S' ? CONSTRAINT_OK_FOR_S (VALUE) \ - : (C) == 'T' ? CONSTRAINT_OK_FOR_T (VALUE) \ - : 0) + ia64_extra_constraint (VALUE, C) + +/* Document the constraints that can accept reloaded memory operands. This is + needed by the extended asm support, and by reload. 'Q' accepts mem, but + only non-volatile mem. Since we can't reload a volatile mem into a + non-volatile mem, it can not be listed here. */ + +#define EXTRA_MEMORY_CONSTRAINT(C, STR) ((C) == 'S') /* Basic Stack Layout */ @@ -1150,9 +963,9 @@ enum reg_class to a smaller address. */ #define STACK_GROWS_DOWNWARD 1 -/* Define this macro if the addresses of local variable slots are at negative - offsets from the frame pointer. */ -/* #define FRAME_GROWS_DOWNWARD */ +/* Define this macro to nonzero if the addresses of local variable slots + are at negative offsets from the frame pointer. */ +#define FRAME_GROWS_DOWNWARD 0 /* Offset from the frame pointer to the first local variable slot to be allocated. */ @@ -1203,7 +1016,12 @@ enum reg_class beginning of any function, before the prologue. The top of the frame is defined to be the value of the stack pointer in the previous frame, just before the call instruction. */ -#define INCOMING_FRAME_SP_OFFSET 0 +/* The CFA is past the red zone, not at the entry-point stack + pointer. */ +#define INCOMING_FRAME_SP_OFFSET STACK_POINTER_OFFSET + +/* We shorten debug info by using CFA-16 as DW_AT_frame_base. */ +#define CFA_FRAME_BASE_OFFSET(FUNDECL) (-INCOMING_FRAME_SP_OFFSET) /* Register That Address the Stack Frame. */ @@ -1279,13 +1097,6 @@ enum reg_class /* Passing Function Arguments on the Stack */ -/* Define this macro if an argument declared in a prototype as an integral type - smaller than `int' should actually be passed as an `int'. In addition to - avoiding errors in certain cases of mismatch, it also makes for better code - on certain machines. */ -/* ??? Investigate. */ -/* #define PROMOTE_PROTOTYPES */ - /* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `current_function_outgoing_args_size'. */ @@ -1324,29 +1135,6 @@ enum reg_class #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ ia64_function_arg (&CUM, MODE, TYPE, NAMED, 1) -/* A C expression for the number of words, at the beginning of an argument, - must be put in registers. The value must be zero for arguments that are - passed entirely in registers or that are entirely pushed on the stack. */ - -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ - ia64_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) - -/* A C expression that indicates when an argument must be passed by reference. - If nonzero for an argument, a copy of that argument is made in memory and a - pointer to the argument is passed instead of the argument itself. The - pointer is passed in whatever way is appropriate for passing a pointer to - that type. */ - -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - ia64_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED) - -/* Nonzero if we do not know how to pass TYPE solely in registers. */ - -#define MUST_PASS_IN_STACK(MODE, TYPE) \ - ((TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE))) - /* A C type for declaring a variable that is used as the first argument of `FUNCTION_ARG' and other related values. For some target machines, the type `int' suffices and can hold the number of bytes of argument so far. */ @@ -1395,15 +1183,11 @@ do { \ /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. */ -/* Arguments with alignment larger than 8 bytes start at the next even - boundary. See ia64_function_arg. */ +/* Return the alignment boundary in bits for an argument with a specified + mode and type. */ #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ - (((TYPE) ? (TYPE_ALIGN (TYPE) > 8 * BITS_PER_UNIT) \ - : (((((MODE) == BLKmode \ - ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \ - + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1)) \ - ? 128 : PARM_BOUNDARY) + ia64_function_arg_boundary (MODE, TYPE) /* A C expression that is nonzero if REGNO is the number of a hard register in which function arguments are sometimes passed. This does *not* include @@ -1414,10 +1198,6 @@ do { \ (((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \ || ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS))) -/* Implement `va_arg'. */ -#define EXPAND_BUILTIN_VA_ARG(valist, type) \ - ia64_va_arg (valist, type) - /* How Scalar Function Values are Returned */ /* A C expression to create an RTX representing the place where a function @@ -1446,15 +1226,6 @@ do { \ /* How Large Values are Returned */ -/* A nonzero value says to return the function value in memory, just as large - structures are always returned. */ - -#define RETURN_IN_MEMORY(TYPE) \ - ia64_return_in_memory (TYPE) - -/* If you define this macro to be 0, then the conventions used for structure - and union return values are decided by the `RETURN_IN_MEMORY' macro. */ - #define DEFAULT_PCC_STRUCT_RETURN 0 @@ -1499,6 +1270,7 @@ do { \ fputs ("\tdata8.ua @iplt(", FILE); \ else \ fputs ("\tdata16.ua @iplt(", FILE); \ + mark_decl_referenced (DECL); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \ fputs (")\n", FILE); \ if (TARGET_ILP32) \ @@ -1512,39 +1284,11 @@ do { \ call the profiling subroutine `mcount'. */ #undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -do { \ - char buf[20]; \ - ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO); \ - fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE); \ - if (TARGET_AUTO_PIC) \ - fputs ("\tmovl out3 = @gprel(", FILE); \ - else \ - fputs ("\taddl out3 = @ltoff(", FILE); \ - assemble_name (FILE, buf); \ - if (TARGET_AUTO_PIC) \ - fputs (");;\n", FILE); \ - else \ - fputs ("), r1;;\n", FILE); \ - fputs ("\tmov out1 = r1\n", FILE); \ - fputs ("\tmov out2 = b0\n", FILE); \ - fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE); \ -} while (0) - -/* Implementing the Varargs Macros. */ - -/* Define this macro to store the anonymous register arguments into the stack - so that all the arguments appear to have been passed consecutively on the - stack. */ - -#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \ - ia64_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE, SECOND_TIME) - -/* Define this macro if the location where a function argument is passed - depends on whether or not it is a named argument. */ - -#define STRICT_ARGUMENT_NAMING 1 +#define FUNCTION_PROFILER(FILE, LABELNO) \ + ia64_output_function_profiler(FILE, LABELNO) +/* Neither hpux nor linux use profile counters. */ +#define NO_PROFILE_COUNTERS 1 /* Trampolines for Nested Functions. */ @@ -1591,15 +1335,6 @@ do { \ #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \ ia64_initialize_trampoline((ADDR), (FNADDR), (STATIC_CHAIN)) - -/* Implicit Calls to Library Routines */ - -/* Define this macro if GCC should generate calls to the System V (and ANSI - C) library functions `memcpy' and `memset' rather than the BSD functions - `bcopy' and `bzero'. */ - -#define TARGET_MEM_FUNCTIONS - /* Addressing Modes */ @@ -1666,13 +1401,6 @@ do { \ #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) -/* A C compound statement that attempts to replace X with a valid memory - address for an operand of mode MODE. - - This must be present, but there is nothing useful to be done here. */ - -#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) - /* A C statement or compound statement with a conditional `goto LABEL;' executed if memory address X (an RTX) can have different meanings depending on the machine mode of the memory reference it is used for or if the address @@ -1685,10 +1413,7 @@ do { \ /* A C expression that is nonzero if X is a legitimate constant for an immediate operand on the target machine. */ -#define LEGITIMATE_CONSTANT_P(X) \ - (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \ - || GET_MODE (X) == DImode || CONST_DOUBLE_OK_FOR_G (X)) \ - +#define LEGITIMATE_CONSTANT_P(X) ia64_legitimate_constant_p (X) /* Condition Code Status */ @@ -1708,7 +1433,7 @@ do { \ /* A C expression for the cost of moving data of mode M between a register and memory. */ #define MEMORY_MOVE_COST(MODE,CLASS,IN) \ - ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS \ + ((CLASS) == GENERAL_REGS || (CLASS) == FR_REGS || (CLASS) == FP_REGS \ || (CLASS) == GR_AND_FR_REGS ? 4 : 10) /* A C expression for the cost of a branch instruction. A value of 1 is the @@ -2014,13 +1739,6 @@ do { \ { "loc79", LOC_REG (79) }, \ } -/* Emit a dtp-relative reference to a TLS variable. */ - -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - ia64_output_dwarf_dtprel (FILE, SIZE, X) -#endif - /* A C compound statement to output to stdio stream STREAM the assembler syntax for an instruction operand X. X is an RTL expression. */ @@ -2066,11 +1784,6 @@ do { \ fprintf (STREAM, "\tdata8 @pcrel(.L%d)\n", VALUE); \ } while (0) -/* This is how to output an element of a case-vector that is absolute. - (Ia64 does not use such vectors, but we must define this macro anyway.) */ - -#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) abort () - /* Jump tables only need 8 byte alignment. */ #define ADDR_VEC_ALIGN(ADDR_VEC) 3 @@ -2159,6 +1872,12 @@ do { \ #define DWARF2_DEBUGGING_INFO 1 +/* We do not want call-frame info to be output, since debuggers are + supposed to use the target unwind info. Leave this undefined it + TARGET_UNWIND_INFO might ever be false. */ + +#define DWARF2_FRAME_INFO 0 + #define DWARF2_ASM_LINE_DEBUG_INFO (TARGET_DWARF2_ASM) /* Use tags for debug info labels, so that they don't break instruction @@ -2172,12 +1891,12 @@ do { \ /* Use section-relative relocations for debugging offsets. Unlike other targets that fake this by putting the section VMA at 0, IA-64 has proper relocations for them. */ -#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL) \ - do { \ - fputs (integer_asm_op (SIZE, FALSE), FILE); \ - fputs ("@secrel(", FILE); \ - assemble_name (FILE, LABEL); \ - fputc (')', FILE); \ +#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \ + do { \ + fputs (integer_asm_op (SIZE, FALSE), FILE); \ + fputs ("@secrel(", FILE); \ + assemble_name (FILE, LABEL); \ + fputc (')', FILE); \ } while (0) /* Emit a PC-relative relocation. */ @@ -2206,58 +1925,6 @@ do { \ #define SYMBOL_REF_SMALL_ADDR_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SMALL_ADDR) != 0) -/* Define this if you have defined special-purpose predicates in the file - `MACHINE.c'. For each predicate, list all rtl codes that can be in - expressions matched by the predicate. */ - -#define PREDICATE_CODES \ -{ "call_operand", {SUBREG, REG, SYMBOL_REF}}, \ -{ "got_symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \ -{ "sdata_symbolic_operand", {SYMBOL_REF, CONST}}, \ -{ "small_addr_symbolic_operand", {SYMBOL_REF}}, \ -{ "symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \ -{ "function_operand", {SYMBOL_REF}}, \ -{ "setjmp_operand", {SYMBOL_REF}}, \ -{ "destination_operand", {SUBREG, REG, MEM}}, \ -{ "not_postinc_memory_operand", {MEM}}, \ -{ "move_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \ - CONSTANT_P_RTX, SYMBOL_REF, CONST, LABEL_REF}}, \ -{ "gr_register_operand", {SUBREG, REG}}, \ -{ "fr_register_operand", {SUBREG, REG}}, \ -{ "grfr_register_operand", {SUBREG, REG}}, \ -{ "gr_nonimmediate_operand", {SUBREG, REG, MEM}}, \ -{ "fr_nonimmediate_operand", {SUBREG, REG, MEM}}, \ -{ "grfr_nonimmediate_operand", {SUBREG, REG, MEM}}, \ -{ "gr_reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \ -{ "gr_reg_or_5bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "gr_reg_or_6bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "gr_reg_or_8bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "grfr_reg_or_8bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "gr_reg_or_8bit_adjusted_operand", {SUBREG, REG, CONST_INT, \ - CONSTANT_P_RTX}}, \ -{ "gr_reg_or_8bit_and_adjusted_operand", {SUBREG, REG, CONST_INT, \ - CONSTANT_P_RTX}}, \ -{ "gr_reg_or_14bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "gr_reg_or_22bit_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "shift_count_operand", {SUBREG, REG, CONST_INT, CONSTANT_P_RTX}}, \ -{ "shift_32bit_count_operand", {SUBREG, REG, CONST_INT, \ - CONSTANT_P_RTX}}, \ -{ "shladd_operand", {CONST_INT}}, \ -{ "fetchadd_operand", {CONST_INT}}, \ -{ "fr_reg_or_fp01_operand", {SUBREG, REG, CONST_DOUBLE}}, \ -{ "normal_comparison_operator", {EQ, NE, GT, LE, GTU, LEU}}, \ -{ "adjusted_comparison_operator", {LT, GE, LTU, GEU}}, \ -{ "signed_inequality_operator", {GE, GT, LE, LT}}, \ -{ "predicate_operator", {NE, EQ}}, \ -{ "condop_operator", {PLUS, MINUS, IOR, XOR, AND}}, \ -{ "ar_lc_reg_operand", {REG}}, \ -{ "ar_ccv_reg_operand", {REG}}, \ -{ "ar_pfs_reg_operand", {REG}}, \ -{ "general_xfmode_operand", {SUBREG, REG, CONST_DOUBLE, MEM}}, \ -{ "destination_xfmode_operand", {SUBREG, REG, MEM}}, \ -{ "xfreg_or_fp01_operand", {REG, CONST_DOUBLE}}, \ -{ "basereg_operand", {SUBREG, REG}}, - /* An alias for a machine mode name. This is the machine mode that elements of a jump-table should have. */ @@ -2336,8 +2003,9 @@ do { \ extern int ia64_final_schedule; -#define IA64_UNWIND_INFO 1 -#define IA64_UNWIND_EMIT(f,i) process_for_unwind_directive (f,i) +#define TARGET_UNWIND_INFO 1 + +#define TARGET_UNWIND_TABLES_DEFAULT true #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM) @@ -2355,66 +2023,9 @@ struct machine_function GTY(()) /* The number of varargs registers to save. */ int n_varargs; -}; - -enum ia64_builtins -{ - IA64_BUILTIN_SYNCHRONIZE, - - IA64_BUILTIN_FETCH_AND_ADD_SI, - IA64_BUILTIN_FETCH_AND_SUB_SI, - IA64_BUILTIN_FETCH_AND_OR_SI, - IA64_BUILTIN_FETCH_AND_AND_SI, - IA64_BUILTIN_FETCH_AND_XOR_SI, - IA64_BUILTIN_FETCH_AND_NAND_SI, - - IA64_BUILTIN_ADD_AND_FETCH_SI, - IA64_BUILTIN_SUB_AND_FETCH_SI, - IA64_BUILTIN_OR_AND_FETCH_SI, - IA64_BUILTIN_AND_AND_FETCH_SI, - IA64_BUILTIN_XOR_AND_FETCH_SI, - IA64_BUILTIN_NAND_AND_FETCH_SI, - - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI, - - IA64_BUILTIN_SYNCHRONIZE_SI, - - IA64_BUILTIN_LOCK_TEST_AND_SET_SI, - - IA64_BUILTIN_LOCK_RELEASE_SI, - - IA64_BUILTIN_FETCH_AND_ADD_DI, - IA64_BUILTIN_FETCH_AND_SUB_DI, - IA64_BUILTIN_FETCH_AND_OR_DI, - IA64_BUILTIN_FETCH_AND_AND_DI, - IA64_BUILTIN_FETCH_AND_XOR_DI, - IA64_BUILTIN_FETCH_AND_NAND_DI, - - IA64_BUILTIN_ADD_AND_FETCH_DI, - IA64_BUILTIN_SUB_AND_FETCH_DI, - IA64_BUILTIN_OR_AND_FETCH_DI, - IA64_BUILTIN_AND_AND_FETCH_DI, - IA64_BUILTIN_XOR_AND_FETCH_DI, - IA64_BUILTIN_NAND_AND_FETCH_DI, - - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI, - - IA64_BUILTIN_SYNCHRONIZE_DI, - - IA64_BUILTIN_LOCK_TEST_AND_SET_DI, - - IA64_BUILTIN_LOCK_RELEASE_DI, - - IA64_BUILTIN_BSP, - IA64_BUILTIN_FLUSHRS -}; - -/* Codes for expand_compare_and_swap and expand_swap_and_compare. */ -enum fetchop_code { - IA64_ADD_OP, IA64_SUB_OP, IA64_OR_OP, IA64_AND_OP, IA64_XOR_OP, IA64_NAND_OP + /* The number of the next unwind state to copy. */ + int state_num; }; #define DONT_USE_BUILTIN_SETJMP @@ -2424,9 +2035,16 @@ enum fetchop_code { #undef PROFILE_BEFORE_PROLOGUE #define PROFILE_BEFORE_PROLOGUE 1 +/* Initialize library function table. */ +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS ia64_init_libfuncs /* Switch on code for querying unit reservations. */ #define CPU_UNITS_QUERY 1 +/* Define this to change the optimizations performed by default. */ +#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ + ia64_optimization_options ((LEVEL), (SIZE)) + /* End of ia64.h */ diff --git a/contrib/gcc/config/ia64/ia64.md b/contrib/gcc/config/ia64/ia64.md index 4bda8f4d3d0..e573c55653c 100644 --- a/contrib/gcc/config/ia64/ia64.md +++ b/contrib/gcc/config/ia64/ia64.md @@ -1,5 +1,5 @@ ;; IA-64 Machine description template -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by James E. Wilson and ;; David Mosberger . @@ -18,8 +18,8 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. @@ -56,6 +56,7 @@ (UNSPEC_DTPREL 2) (UNSPEC_LTOFF_TPREL 3) (UNSPEC_TPREL 4) + (UNSPEC_DTPMOD 5) (UNSPEC_LD_BASE 9) (UNSPEC_GR_SPILL 10) @@ -77,6 +78,15 @@ (UNSPEC_RET_ADDR 26) (UNSPEC_SETF_EXP 27) (UNSPEC_FR_SQRT_RECIP_APPROX 28) + (UNSPEC_SHRP 29) + (UNSPEC_COPYSIGN 30) + (UNSPEC_VECT_EXTR 31) + (UNSPEC_LDA 40) + (UNSPEC_LDS 41) + (UNSPEC_LDSA 42) + (UNSPEC_LDCCLR 43) + (UNSPEC_CHKACLR 45) + (UNSPEC_CHKS 47) ]) (define_constants @@ -89,6 +99,8 @@ (UNSPECV_PSAC_NORMAL 6) (UNSPECV_SETJMP_RECEIVER 7) ]) + +(include "predicates.md") ;; :::::::::::::::::::: ;; :: @@ -117,19 +129,21 @@ ;; which emit instruction that can go in any slot (e.g. nop). (define_attr "itanium_class" "unknown,ignore,stop_bit,br,fcmp,fcvtfx,fld, - fmac,fmisc,frar_i,frar_m,frbr,frfr,frpr,ialu,icmp,ilog,ishf,ld, - chk_s,long_i,mmmul,mmshf,mmshfi,rse_m,scall,sem,stf,st,syst_m0, - syst_m,tbit,toar_i,toar_m,tobr,tofr,topr,xmpy,xtd,nop,nop_b,nop_f, - nop_i,nop_m,nop_x,lfetch,pre_cycle" + fldp,fmac,fmisc,frar_i,frar_m,frbr,frfr,frpr,ialu,icmp,ilog,ishf, + ld,chk_s_i,chk_s_f,chk_a,long_i,mmalua,mmmul,mmshf,mmshfi,rse_m,scall,sem,stf, + st,syst_m0, syst_m,tbit,toar_i,toar_m,tobr,tofr,topr,xmpy,xtd,nop, + nop_b,nop_f,nop_i,nop_m,nop_x,lfetch,pre_cycle" (const_string "unknown")) -;; chk_s has an I and an M form; use type A for convenience. +;; chk_s_i has an I and an M form; use type A for convenience. (define_attr "type" "unknown,A,I,M,F,B,L,X,S" - (cond [(eq_attr "itanium_class" "ld,st,fld,stf,sem,nop_m") (const_string "M") + (cond [(eq_attr "itanium_class" "ld,st,fld,fldp,stf,sem,nop_m") (const_string "M") (eq_attr "itanium_class" "rse_m,syst_m,syst_m0") (const_string "M") (eq_attr "itanium_class" "frar_m,toar_m,frfr,tofr") (const_string "M") (eq_attr "itanium_class" "lfetch") (const_string "M") - (eq_attr "itanium_class" "chk_s,ialu,icmp,ilog") (const_string "A") + (eq_attr "itanium_class" "chk_s_f,chk_a") (const_string "M") + (eq_attr "itanium_class" "chk_s_i,ialu,icmp,ilog,mmalua") + (const_string "A") (eq_attr "itanium_class" "fmisc,fmac,fcmp,xmpy") (const_string "F") (eq_attr "itanium_class" "fcvtfx,nop_f") (const_string "F") (eq_attr "itanium_class" "frar_i,toar_i,frbr,tobr") (const_string "I") @@ -158,8 +172,18 @@ (define_attr "empty" "no,yes" (const_string "no")) - +;; True iff this insn must be the first insn of an instruction group. +;; This is true for the alloc instruction, and will also be true of others +;; when we have full intrinsics support. +(define_attr "first_insn" "no,yes" (const_string "no")) + +(define_attr "data_speculative" "no,yes" (const_string "no")) + +(define_attr "control_speculative" "no,yes" (const_string "no")) + +(define_attr "check_load" "no,yes" (const_string "no")) + ;; DFA descriptions of ia64 processors used for insn scheduling and ;; bundling. @@ -170,9 +194,6 @@ (automata_option "w") -;;(automata_option "no-minimization") - - (include "itanium1.md") (include "itanium2.md") @@ -198,8 +219,8 @@ (set_attr "predicable" "no")]) (define_insn "movbi" - [(set (match_operand:BI 0 "nonimmediate_operand" "=c,c,?c,?*r, c,*r,*r,*m,*r") - (match_operand:BI 1 "move_operand" " O,n, c, c,*r, n,*m,*r,*r"))] + [(set (match_operand:BI 0 "destination_operand" "=c,c,?c,?*r, c,*r,*r,*m,*r") + (match_operand:BI 1 "move_operand" " O,n, c, c,*r, n,*m,*r,*r"))] "" "@ cmp.ne %0, %I0 = r0, r0 @@ -357,65 +378,252 @@ "mov pr = %1, -1" }; - if (which_alternative == 2 && ! TARGET_NO_PIC - && symbolic_operand (operands[1], VOIDmode)) - abort (); + gcc_assert (which_alternative != 2 || TARGET_NO_PIC + || !symbolic_operand (operands[1], VOIDmode)); return alt[which_alternative]; } [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,frfr,tofr,fmisc,fld,stf,frbr,tobr,frar_i,toar_i,frar_m,toar_m,frpr,topr")]) +(define_mode_macro MODE [BI QI HI SI DI SF DF XF TI]) +(define_mode_macro MODE_FOR_EXTEND [QI HI SI]) + +(define_mode_attr output_a [ + (BI "ld1.a %0 = %1%P1") + (QI "ld1.a %0 = %1%P1") + (HI "ld2.a %0 = %1%P1") + (SI "ld4.a %0 = %1%P1") + (DI + "@ + ld8.a %0 = %1%P1 + ldf8.a %0 = %1%P1") + (SF + "@ + ldfs.a %0 = %1%P1 + ld4.a %0 = %1%P1") + (DF + "@ + ldfd.a %0 = %1%P1 + ld8.a %0 = %1%P1") + (XF "ldfe.a %0 = %1%P1") + (TI "ldfp8.a %X0 = %1%P1")]) + +(define_mode_attr output_s [ + (BI "ld1.s %0 = %1%P1") + (QI "ld1.s %0 = %1%P1") + (HI "ld2.s %0 = %1%P1") + (SI "ld4.s %0 = %1%P1") + (DI + "@ + ld8.s %0 = %1%P1 + ldf8.s %0 = %1%P1") + (SF + "@ + ldfs.s %0 = %1%P1 + ld4.s %0 = %1%P1") + (DF + "@ + ldfd.s %0 = %1%P1 + ld8.s %0 = %1%P1") + (XF "ldfe.s %0 = %1%P1") + (TI "ldfp8.s %X0 = %1%P1")]) + +(define_mode_attr output_sa [ + (BI "ld1.sa %0 = %1%P1") + (QI "ld1.sa %0 = %1%P1") + (HI "ld2.sa %0 = %1%P1") + (SI "ld4.sa %0 = %1%P1") + (DI + "@ + ld8.sa %0 = %1%P1 + ldf8.sa %0 = %1%P1") + (SF + "@ + ldfs.sa %0 = %1%P1 + ld4.sa %0 = %1%P1") + (DF + "@ + ldfd.sa %0 = %1%P1 + ld8.sa %0 = %1%P1") + (XF "ldfe.sa %0 = %1%P1") + (TI "ldfp8.sa %X0 = %1%P1")]) + +(define_mode_attr output_c_clr [ + (BI "ld1.c.clr%O1 %0 = %1%P1") + (QI "ld1.c.clr%O1 %0 = %1%P1") + (HI "ld2.c.clr%O1 %0 = %1%P1") + (SI "ld4.c.clr%O1 %0 = %1%P1") + (DI + "@ + ld8.c.clr%O1 %0 = %1%P1 + ldf8.c.clr %0 = %1%P1") + (SF + "@ + ldfs.c.clr %0 = %1%P1 + ld4.c.clr%O1 %0 = %1%P1") + (DF + "@ + ldfd.c.clr %0 = %1%P1 + ld8.c.clr%O1 %0 = %1%P1") + (XF "ldfe.c.clr %0 = %1%P1") + (TI "ldfp8.c.clr %X0 = %1%P1")]) + +(define_mode_attr ld_reg_constr [(BI "=*r") (QI "=r") (HI "=r") (SI "=r") (DI "=r,*f") (SF "=f,*r") (DF "=f,*r") (XF "=f") (TI "=*x")]) +(define_mode_attr ldc_reg_constr [(BI "+*r") (QI "+r") (HI "+r") (SI "+r") (DI "+r,*f") (SF "+f,*r") (DF "+f,*r") (XF "+f") (TI "+*x")]) +(define_mode_attr chk_reg_constr [(BI "*r") (QI "r") (HI "r") (SI "r") (DI "r,*f") (SF "f,*r") (DF "f,*r") (XF "f") (TI "*x")]) + +(define_mode_attr mem_constr [(BI "*m") (QI "m") (HI "m") (SI "m") (DI "m,Q") (SF "Q,m") (DF "Q,m") (XF "m") (TI "Q")]) + +;; Define register predicate prefix. +;; We can generate speculative loads only for general and fp registers - this +;; is constrainted in ia64.c: ia64_speculate_insn (). +(define_mode_attr reg_pred_prefix [(BI "gr") (QI "gr") (HI "gr") (SI "gr") (DI "grfr") (SF "grfr") (DF "grfr") (XF "fr") (TI "fr")]) + +(define_mode_attr ld_class [(BI "ld") (QI "ld") (HI "ld") (SI "ld") (DI "ld,fld") (SF "fld,ld") (DF "fld,ld") (XF "fld") (TI "fldp")]) +(define_mode_attr chka_class [(BI "chk_a") (QI "chk_a") (HI "chk_a") (SI "chk_a") (DI "chk_a,chk_a") (SF "chk_a,chk_a") (DF "chk_a,chk_a") (XF "chk_a") (TI "chk_a")]) +(define_mode_attr chks_class [(BI "chk_s_i") (QI "chk_s_i") (HI "chk_s_i") (SI "chk_s_i") (DI "chk_s_i,chk_s_f") (SF "chk_s_f,chk_s_i") (DF "chk_s_f,chk_s_i") (XF "chk_s_f") (TI "chk_s_i")]) + +(define_mode_attr attr_yes [(BI "yes") (QI "yes") (HI "yes") (SI "yes") (DI "yes,yes") (SF "yes,yes") (DF "yes,yes") (XF "yes") (TI "yes")]) + +(define_insn "mov_advanced" + [(set (match_operand:MODE 0 "_register_operand" "") + (unspec:MODE [(match_operand:MODE 1 "memory_operand" "")] UNSPEC_LDA))] + "ia64_move_ok (operands[0], operands[1])" + "" + [(set_attr "itanium_class" "") + (set_attr "data_speculative" "")]) + +(define_insn "zero_extenddi2_advanced" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (zero_extend:DI (unspec:MODE_FOR_EXTEND [(match_operand:MODE_FOR_EXTEND 1 "memory_operand" "")] UNSPEC_LDA)))] + "" + "" + [(set_attr "itanium_class" "") + (set_attr "data_speculative" "")]) + +(define_insn "mov_speculative" + [(set (match_operand:MODE 0 "_register_operand" "") + (unspec:MODE [(match_operand:MODE 1 "memory_operand" "")] UNSPEC_LDS))] + "ia64_move_ok (operands[0], operands[1])" + "" + [(set_attr "itanium_class" "") + (set_attr "control_speculative" "")]) + +(define_insn "zero_extenddi2_speculative" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (zero_extend:DI (unspec:MODE_FOR_EXTEND [(match_operand:MODE_FOR_EXTEND 1 "memory_operand" "")] UNSPEC_LDS)))] + "" + "" + [(set_attr "itanium_class" "") + (set_attr "control_speculative" "")]) + +(define_insn "mov_speculative_advanced" + [(set (match_operand:MODE 0 "_register_operand" "") + (unspec:MODE [(match_operand:MODE 1 "memory_operand" "")] UNSPEC_LDSA))] + "ia64_move_ok (operands[0], operands[1])" + "" + [(set_attr "itanium_class" "") + (set_attr "data_speculative" "") + (set_attr "control_speculative" "")]) + +(define_insn "zero_extenddi2_speculative_advanced" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (zero_extend:DI (unspec:MODE_FOR_EXTEND [(match_operand:MODE_FOR_EXTEND 1 "memory_operand" "")] UNSPEC_LDSA)))] + "" + "" + [(set_attr "itanium_class" "") + (set_attr "data_speculative" "") + (set_attr "control_speculative" "")]) + +(define_insn "mov_clr" + [(set (match_operand:MODE 0 "_register_operand" "") + (if_then_else:MODE (ne (unspec [(match_dup 0)] UNSPEC_LDCCLR) (const_int 0)) + (match_operand:MODE 1 "memory_operand" "") + (match_dup 0)))] + "ia64_move_ok (operands[0], operands[1])" + "" + [(set_attr "itanium_class" "") + (set_attr "check_load" "")]) + +(define_insn "zero_extenddi2_clr" + [(set (match_operand:DI 0 "gr_register_operand" "+r") + (if_then_else:DI (ne (unspec [(match_dup 0)] UNSPEC_LDCCLR) (const_int 0)) + (zero_extend:DI (match_operand:MODE_FOR_EXTEND 1 "memory_operand" "")) + (match_dup 0)))] + "" + "" + [(set_attr "itanium_class" "") + (set_attr "check_load" "")]) + +(define_insn "advanced_load_check_clr_" + [(set (pc) + (if_then_else (ne (unspec [(match_operand:MODE 0 "_register_operand" "")] UNSPEC_CHKACLR) (const_int 0)) + (pc) + (label_ref (match_operand 1 "" ""))))] + "" + "chk.a.clr %0, %l1" + [(set_attr "itanium_class" "")]) + +(define_insn "speculation_check_" + [(set (pc) + (if_then_else (ne (unspec [(match_operand:MODE 0 "_register_operand" "")] UNSPEC_CHKS) (const_int 0)) + (pc) + (label_ref (match_operand 1 "" ""))))] + "" + "chk.s %0, %l1" + [(set_attr "itanium_class" "")]) + (define_split [(set (match_operand 0 "register_operand" "") (match_operand 1 "symbolic_operand" ""))] - "reload_completed && ! TARGET_NO_PIC" + "reload_completed" [(const_int 0)] { - ia64_expand_load_address (operands[0], operands[1]); - DONE; + if (ia64_expand_load_address (operands[0], operands[1])) + DONE; + else + FAIL; }) (define_expand "load_fptr" - [(set (match_dup 2) - (plus:DI (reg:DI 1) (match_operand 1 "function_operand" ""))) - (set (match_operand:DI 0 "register_operand" "") (match_dup 3))] - "" + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_dup 2) (match_operand 1 "function_operand" ""))) + (set (match_dup 0) (match_dup 3))] + "reload_completed" { - operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); - operands[3] = gen_rtx_MEM (DImode, operands[2]); - RTX_UNCHANGING_P (operands[3]) = 1; + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); }) (define_insn "*load_fptr_internal1" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (reg:DI 1) (match_operand 1 "function_operand" "s")))] - "" + "reload_completed" "addl %0 = @ltoff(@fptr(%1)), gp" [(set_attr "itanium_class" "ialu")]) (define_insn "load_gprel" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (reg:DI 1) (match_operand 1 "sdata_symbolic_operand" "s")))] - "" + "reload_completed" "addl %0 = @gprel(%1), gp" [(set_attr "itanium_class" "ialu")]) -(define_insn "gprel64_offset" +(define_insn "*gprel64_offset" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_operand:DI 1 "symbolic_operand" "") (reg:DI 1)))] - "" + "reload_completed" "movl %0 = @gprel(%1)" [(set_attr "itanium_class" "long_i")]) (define_expand "load_gprel64" - [(set (match_dup 2) - (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 3))) - (set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_dup 3) (match_dup 2)))] - "" + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 2))) + (set (match_dup 0) + (plus:DI (match_dup 2) (match_dup 0)))] + "reload_completed" { - operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); - operands[3] = pic_offset_table_rtx; + operands[2] = pic_offset_table_rtx; }) ;; This is used as a placeholder for the return address during early @@ -441,7 +649,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (high:DI (match_operand 1 "got_symbolic_operand" "s")) (match_operand:DI 2 "register_operand" "a")))] - "" + "reload_completed" { if (HAVE_AS_LTOFFX_LDXMOV_RELOCS) return "%,addl %0 = @ltoffx(%1), %2"; @@ -454,7 +662,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (lo_sum:DI (match_operand:DI 1 "register_operand" "r") (match_operand 2 "got_symbolic_operand" "s")))] - "" + "reload_completed" { if (HAVE_AS_LTOFFX_LDXMOV_RELOCS) return "%,ld8.mov %0 = [%1], %2"; @@ -463,34 +671,41 @@ } [(set_attr "itanium_class" "ld")]) -(define_insn "load_ltoff_dtpmod" +(define_insn_and_split "load_dtpmod" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_DTPMOD)))] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_DTPMOD))] "" - "addl %0 = @ltoff(@dtpmod(%1)), gp" - [(set_attr "itanium_class" "ialu")]) + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_DTPMOD) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) -(define_insn "load_ltoff_dtprel" +(define_insn "*load_ltoff_dtpmod" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_DTPREL)))] - "" - "addl %0 = @ltoff(@dtprel(%1)), gp" + (plus:DI (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_LTOFF_DTPMOD) + (match_operand:DI 2 "register_operand" "a")))] + "reload_completed" + "addl %0 = @ltoff(@dtpmod(%1)), %2" [(set_attr "itanium_class" "ialu")]) (define_expand "load_dtprel" [(set (match_operand:DI 0 "register_operand" "") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_DTPREL))] "" "") (define_insn "*load_dtprel64" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] UNSPEC_DTPREL))] "TARGET_TLS64" "movl %0 = @dtprel(%1)" @@ -498,57 +713,73 @@ (define_insn "*load_dtprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] UNSPEC_DTPREL))] "" "addl %0 = @dtprel(%1), r0" [(set_attr "itanium_class" "ialu")]) +(define_insn_and_split "*load_dtprel_gd" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_DTPREL))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_DTPREL) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) + +(define_insn "*load_ltoff_dtprel" + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_LTOFF_DTPREL) + (match_operand:DI 2 "register_operand" "a")))] + "" + "addl %0 = @ltoff(@dtprel(%1)), %2" + [(set_attr "itanium_class" "ialu")]) + (define_expand "add_dtprel" [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_operand:DI 1 "register_operand" "") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "")))] "!TARGET_TLS64" "") (define_insn "*add_dtprel14" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "r") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "r")))] "TARGET_TLS14" - "adds %0 = @dtprel(%2), %1" + "adds %0 = @dtprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_insn "*add_dtprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "a") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "a")))] "TARGET_TLS22" - "addl %0 = @dtprel(%2), %1" - [(set_attr "itanium_class" "ialu")]) - -(define_insn "load_ltoff_tprel" - [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_TPREL)))] - "" - "addl %0 = @ltoff(@tprel(%1)), gp" + "addl %0 = @dtprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_expand "load_tprel" [(set (match_operand:DI 0 "register_operand" "") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_TPREL))] "" "") (define_insn "*load_tprel64" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] UNSPEC_TPREL))] "TARGET_TLS64" "movl %0 = @tprel(%1)" @@ -556,36 +787,61 @@ (define_insn "*load_tprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] UNSPEC_TPREL))] "" "addl %0 = @tprel(%1), r0" [(set_attr "itanium_class" "ialu")]) +(define_insn_and_split "*load_tprel_ie" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand 1 "ie_tls_symbolic_operand" "")] + UNSPEC_TPREL))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_TPREL) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) + +(define_insn "*load_ltoff_tprel" + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (unspec:DI [(match_operand 1 "ie_tls_symbolic_operand" "")] + UNSPEC_LTOFF_TPREL) + (match_operand:DI 2 "register_operand" "a")))] + "" + "addl %0 = @ltoff(@tprel(%1)), %2" + [(set_attr "itanium_class" "ialu")]) + (define_expand "add_tprel" [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_operand:DI 1 "register_operand" "") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "")))] "!TARGET_TLS64" "") (define_insn "*add_tprel14" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "r") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "r")))] "TARGET_TLS14" - "adds %0 = @tprel(%2), %1" + "adds %0 = @tprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_insn "*add_tprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "a") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "a")))] "TARGET_TLS22" - "addl %0 = @tprel(%2), %1" + "addl %0 = @tprel(%1), %2" [(set_attr "itanium_class" "ialu")]) ;; With no offsettable memory references, we've got to have a scratch @@ -604,18 +860,22 @@ }) (define_insn_and_split "*movti_internal" - [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m") - (match_operand:TI 1 "general_operand" "ri,m,r"))] + [(set (match_operand:TI 0 "destination_operand" "=r, *fm,*x,*f, Q") + (match_operand:TI 1 "general_operand" "r*fim,r, Q, *fOQ,*f"))] "ia64_move_ok (operands[0], operands[1])" - "#" - "reload_completed" + "@ + # + # + ldfp8 %X0 = %1%P1 + # + #" + "reload_completed && !ia64_load_pair_ok(operands[0], operands[1])" [(const_int 0)] { ia64_split_tmode_move (operands); DONE; } - [(set_attr "itanium_class" "unknown") - (set_attr "predicable" "no")]) + [(set_attr "itanium_class" "unknown,unknown,fldp,unknown,unknown")]) ;; Floating Point Moves ;; @@ -681,72 +941,15 @@ (match_operand:XF 1 "general_operand" ""))] "" { - /* We must support XFmode loads into general registers for stdarg/vararg - and unprototyped calls. We split them into DImode loads for convenience. - We don't need XFmode stores from general regs, because a stdarg/vararg - routine does a block store to memory of unnamed arguments. */ - if (GET_CODE (operands[0]) == REG - && GR_REGNO_P (REGNO (operands[0]))) - { - /* We're hoping to transform everything that deals with XFmode - quantities and GR registers early in the compiler. */ - if (no_new_pseudos) - abort (); - - /* Struct to register can just use TImode instead. */ - if ((GET_CODE (operands[1]) == SUBREG - && GET_MODE (SUBREG_REG (operands[1])) == TImode) - || (GET_CODE (operands[1]) == REG - && GR_REGNO_P (REGNO (operands[1])))) - { - emit_move_insn (gen_rtx_REG (TImode, REGNO (operands[0])), - SUBREG_REG (operands[1])); - DONE; - } - - if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0])), - operand_subword (operands[1], 0, 0, XFmode)); - emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0]) + 1), - operand_subword (operands[1], 1, 0, XFmode)); - DONE; - } - - /* If the quantity is in a register not known to be GR, spill it. */ - if (register_operand (operands[1], XFmode)) - operands[1] = spill_xfmode_operand (operands[1], 1); - - if (GET_CODE (operands[1]) == MEM) - { - rtx out[2]; - - out[WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[0])); - out[!WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[0])+1); - - emit_move_insn (out[0], adjust_address (operands[1], DImode, 0)); - emit_move_insn (out[1], adjust_address (operands[1], DImode, 8)); - DONE; - } - - abort (); - } - - if (! reload_in_progress && ! reload_completed) - { - operands[0] = spill_xfmode_operand (operands[0], 0); - operands[1] = spill_xfmode_operand (operands[1], 0); - - if (! ia64_move_ok (operands[0], operands[1])) - operands[1] = force_reg (XFmode, operands[1]); - } + if (ia64_expand_movxf_movrf (XFmode, operands)) + DONE; }) ;; ??? There's no easy way to mind volatile acquire/release semantics. (define_insn "*movxf_internal" - [(set (match_operand:XF 0 "destination_xfmode_operand" "=f,f, m") - (match_operand:XF 1 "general_xfmode_operand" "fG,m,fG"))] + [(set (match_operand:XF 0 "destination_operand" "=f,f, m") + (match_operand:XF 1 "general_operand" "fG,m,fG"))] "ia64_move_ok (operands[0], operands[1])" "@ mov %0 = %F1 @@ -754,6 +957,26 @@ stfe %0 = %F1%P0" [(set_attr "itanium_class" "fmisc,fld,stf")]) +;; Same as for movxf, but for RFmode. +(define_expand "movrf" + [(set (match_operand:RF 0 "general_operand" "") + (match_operand:RF 1 "general_operand" ""))] + "" +{ + if (ia64_expand_movxf_movrf (RFmode, operands)) + DONE; +}) + +(define_insn "*movrf_internal" + [(set (match_operand:RF 0 "destination_operand" "=f,f, m") + (match_operand:RF 1 "general_operand" "fG,m,fG"))] + "ia64_move_ok (operands[0], operands[1])" + "@ + mov %0 = %F1 + ldf.fill %0 = %1%P1 + stf.spill %0 = %F1%P0" + [(set_attr "itanium_class" "fmisc,fld,stf")]) + ;; Better code generation via insns that deal with TFmode register pairs ;; directly. Same concerns apply as for TImode. (define_expand "movtf" @@ -768,7 +991,7 @@ }) (define_insn_and_split "*movtf_internal" - [(set (match_operand:TF 0 "nonimmediate_operand" "=r,r,m") + [(set (match_operand:TF 0 "destination_operand" "=r,r,m") (match_operand:TF 1 "general_operand" "ri,m,r"))] "ia64_move_ok (operands[0], operands[1])" "#" @@ -839,10 +1062,10 @@ (match_operand:SI 1 "grfr_nonimmediate_operand" "r,m,f")))] "" "@ - zxt4 %0 = %1 + addp4 %0 = %1, r0 ld4%O1 %0 = %1%P1 fmix.r %0 = f0, %1" - [(set_attr "itanium_class" "xtd,ld,fmisc")]) + [(set_attr "itanium_class" "ialu,ld,fmisc")]) ;; Convert between floating point types of different sizes. @@ -1001,8 +1224,8 @@ (define_insn "extv" [(set (match_operand:DI 0 "gr_register_operand" "=r") (sign_extract:DI (match_operand:DI 1 "gr_register_operand" "r") - (match_operand:DI 2 "const_int_operand" "n") - (match_operand:DI 3 "const_int_operand" "n")))] + (match_operand:DI 2 "extr_len_operand" "n") + (match_operand:DI 3 "shift_count_operand" "M")))] "" "extr %0 = %1, %3, %2" [(set_attr "itanium_class" "ishf")]) @@ -1010,8 +1233,8 @@ (define_insn "extzv" [(set (match_operand:DI 0 "gr_register_operand" "=r") (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") - (match_operand:DI 2 "const_int_operand" "n") - (match_operand:DI 3 "const_int_operand" "n")))] + (match_operand:DI 2 "extr_len_operand" "n") + (match_operand:DI 3 "shift_count_operand" "M")))] "" "extr.u %0 = %1, %3, %2" [(set_attr "itanium_class" "ishf")]) @@ -1111,6 +1334,15 @@ [(set_attr "itanium_class" "ishf")]) ;; Combine doesn't like to create bit-field insertions into zero. +(define_insn "*shladdp4_internal" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (and:DI (ashift:DI (match_operand:DI 1 "gr_register_operand" "r") + (match_operand:DI 2 "shladd_log2_operand" "n")) + (match_operand:DI 3 "const_int_operand" "n")))] + "ia64_depz_field_mask (operands[3], operands[2]) + INTVAL (operands[2]) == 32" + "shladdp4 %0 = %1, %2, r0" + [(set_attr "itanium_class" "ialu")]) + (define_insn "*depz_internal" [(set (match_operand:DI 0 "gr_register_operand" "=r") (and:DI (ashift:DI (match_operand:DI 1 "gr_register_operand" "r") @@ -1138,18 +1370,7 @@ (const_int 32) (const_int 0)) (match_operand:DI 1 "register_operand" "")) (clobber (match_operand:DI 2 "register_operand" ""))] - "reload_completed" - [(set (match_dup 3) (ashift:DI (match_dup 1) (const_int 32))) - (set (zero_extract:DI (match_dup 0) (const_int 32) (const_int 0)) - (lshiftrt:DI (match_dup 3) (const_int 32)))] - "operands[3] = operands[2];") - -(define_split - [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "") - (const_int 32) (const_int 0)) - (match_operand:DI 1 "register_operand" "")) - (clobber (match_operand:DI 2 "register_operand" ""))] - "! reload_completed" + "" [(set (match_dup 3) (ashift:DI (match_dup 1) (const_int 32))) (set (zero_extract:DI (match_dup 0) (const_int 32) (const_int 0)) (lshiftrt:DI (match_dup 3) (const_int 32)))] @@ -1409,7 +1630,7 @@ (and:BI (ne:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "const_int_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" @@ -1421,7 +1642,7 @@ (and:BI (eq:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "const_int_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" @@ -1533,7 +1754,7 @@ (ior:BI (ne:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "const_int_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" @@ -1545,7 +1766,7 @@ (ior:BI (eq:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "const_int_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" @@ -1855,8 +2076,7 @@ (match_operand:SI 2 "general_operand" "")))] "TARGET_INLINE_INT_DIV" { - rtx op1_xf, op2_xf, op0_xf, op0_di, twon34; - REAL_VALUE_TYPE twon34_r; + rtx op1_xf, op2_xf, op0_xf, op0_di, twon34, twon34_exp; op0_xf = gen_reg_rtx (XFmode); op0_di = gen_reg_rtx (DImode); @@ -1872,10 +2092,14 @@ expand_float (op2_xf, operands[2], 0); /* 2^-34 */ - real_2expN (&twon34_r, -34); - twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, XFmode); - twon34 = force_reg (XFmode, twon34); + twon34_exp = gen_reg_rtx (DImode); + emit_move_insn (twon34_exp, GEN_INT (65501)); + twon34 = gen_reg_rtx (XFmode); + emit_insn (gen_setf_exp_xf (twon34, twon34_exp)); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (SImode), + CONST1_RTX (SImode))); + emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34)); emit_insn (gen_fix_truncxfdi2_alts (op0_di, op0_xf, const1_rtx)); @@ -1912,8 +2136,7 @@ (match_operand:SI 2 "general_operand" "")))] "TARGET_INLINE_INT_DIV" { - rtx op1_xf, op2_xf, op0_xf, op0_di, twon34; - REAL_VALUE_TYPE twon34_r; + rtx op1_xf, op2_xf, op0_xf, op0_di, twon34, twon34_exp; op0_xf = gen_reg_rtx (XFmode); op0_di = gen_reg_rtx (DImode); @@ -1929,10 +2152,14 @@ expand_float (op2_xf, operands[2], 1); /* 2^-34 */ - real_2expN (&twon34_r, -34); - twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, XFmode); - twon34 = force_reg (XFmode, twon34); + twon34_exp = gen_reg_rtx (DImode); + emit_move_insn (twon34_exp, GEN_INT (65501)); + twon34 = gen_reg_rtx (XFmode); + emit_insn (gen_setf_exp_xf (twon34, twon34_exp)); + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (SImode), + CONST1_RTX (SImode))); + emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34)); emit_insn (gen_fixuns_truncxfdi2_alts (op0_di, op0_xf, const1_rtx)); @@ -1983,8 +2210,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 7))) + (minus:XF (match_dup 7) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) @@ -2124,9 +2351,6 @@ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] "") -;; ??? There are highpart multiply and add instructions, but we have no way -;; to generate them. - (define_insn "smuldi3_highpart" [(set (match_operand:DI 0 "fr_register_operand" "=f") (truncate:DI @@ -2294,7 +2518,10 @@ op2_xf = gen_reg_rtx (XFmode); expand_float (op2_xf, operands[2], 0); - if (TARGET_INLINE_INT_DIV_LAT) + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (DImode), + CONST1_RTX (DImode))); + + if (TARGET_INLINE_INT_DIV == INL_MIN_LAT) emit_insn (gen_divdi3_internal_lat (op0_xf, op1_xf, op2_xf)); else emit_insn (gen_divdi3_internal_thr (op0_xf, op1_xf, op2_xf)); @@ -2340,7 +2567,10 @@ op2_xf = gen_reg_rtx (XFmode); expand_float (op2_xf, operands[2], 1); - if (TARGET_INLINE_INT_DIV_LAT) + emit_insn (gen_cond_trap (EQ, operands[2], CONST0_RTX (DImode), + CONST1_RTX (DImode))); + + if (TARGET_INLINE_INT_DIV == INL_MIN_LAT) emit_insn (gen_divdi3_internal_lat (op0_xf, op1_xf, op2_xf)); else emit_insn (gen_divdi3_internal_thr (op0_xf, op1_xf, op2_xf)); @@ -2374,7 +2604,7 @@ (clobber (match_scratch:XF 4 "=&f")) (clobber (match_scratch:XF 5 "=&f")) (clobber (match_scratch:BI 6 "=c"))] - "TARGET_INLINE_INT_DIV_LAT" + "TARGET_INLINE_INT_DIV == INL_MIN_LAT" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) @@ -2383,8 +2613,8 @@ (use (const_int 1))]) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 7))) + (minus:XF (match_dup 7) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) (mult:XF (match_dup 1) (match_dup 0))) @@ -2414,8 +2644,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 3))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 0) @@ -2433,7 +2663,7 @@ (clobber (match_scratch:XF 3 "=&f")) (clobber (match_scratch:XF 4 "=f")) (clobber (match_scratch:BI 5 "=c"))] - "TARGET_INLINE_INT_DIV_THR" + "TARGET_INLINE_INT_DIV == INL_MAX_THR" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) @@ -2442,8 +2672,8 @@ (use (const_int 1))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 6))) + (minus:XF (match_dup 6) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 0) @@ -2463,8 +2693,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 3))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 0) @@ -2477,6 +2707,200 @@ ;; :::::::::::::::::::: ;; :: +;; :: 128 bit Integer arithmetic +;; :: +;; :::::::::::::::::::: + +(define_insn "addti3" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (plus:TI (match_operand:TI 1 "gr_register_operand" "%r") + (match_operand:TI 2 "gr_reg_or_14bit_operand" "rI"))) + (clobber (match_scratch:BI 3 "=&c"))] + "" + "#" + [(set_attr "itanium_class" "unknown")]) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (plus:TI (match_operand:TI 1 "register_operand" "") + (match_operand:TI 2 "register_operand" ""))) + (clobber (match_scratch:BI 3 ""))] + "reload_completed" + [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (ltu:BI (match_dup 0) (match_dup 1))) + (cond_exec (eq (match_dup 3) (const_int 0)) + (set (match_dup 4) (plus:DI (match_dup 5) (match_dup 6)))) + (cond_exec (ne (match_dup 3) (const_int 0)) + (set (match_dup 4) + (plus:DI (plus:DI (match_dup 5) (match_dup 6)) + (const_int 1))))] +{ + operands[4] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); + operands[5] = gen_highpart (DImode, operands[1]); + operands[1] = gen_lowpart (DImode, operands[1]); + operands[6] = gen_highpart (DImode, operands[2]); + operands[2] = gen_lowpart (DImode, operands[2]); +}) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (plus:TI (match_operand:TI 1 "register_operand" "") + (match_operand:TI 2 "immediate_operand" ""))) + (clobber (match_scratch:BI 3 ""))] + "reload_completed" + [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (ltu:BI (match_dup 0) (match_dup 1))) + (cond_exec (eq (match_dup 3) (const_int 0)) + (set (match_dup 4) + (plus:DI (match_dup 5) (match_dup 6)))) + (cond_exec (ne (match_dup 3) (const_int 0)) + (set (match_dup 4) + (plus:DI (match_dup 5) (match_dup 7))))] +{ + operands[4] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); + operands[5] = gen_highpart (DImode, operands[1]); + operands[1] = gen_lowpart (DImode, operands[1]); + operands[6] = INTVAL (operands[2]) < 0 ? constm1_rtx : const0_rtx; + operands[7] = INTVAL (operands[2]) < 0 ? const0_rtx : const1_rtx; +}) + +(define_insn "subti3" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (minus:TI (match_operand:TI 1 "gr_reg_or_8bit_operand" "rK") + (match_operand:TI 2 "gr_register_operand" "r"))) + (clobber (match_scratch:BI 3 "=&c"))] + "" + "#" + [(set_attr "itanium_class" "unknown")]) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (minus:TI (match_operand:TI 1 "register_operand" "") + (match_operand:TI 2 "register_operand" ""))) + (clobber (match_scratch:BI 3 "=&c"))] + "reload_completed" + [(set (match_dup 0) (minus:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (ltu:BI (match_dup 1) (match_dup 0))) + (cond_exec (eq (match_dup 3) (const_int 0)) + (set (match_dup 4) (minus:DI (match_dup 5) (match_dup 6)))) + (cond_exec (ne (match_dup 3) (const_int 0)) + (set (match_dup 4) + (plus:DI (not:DI (match_dup 6)) (match_dup 5))))] +{ + operands[4] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); + operands[5] = gen_highpart (DImode, operands[1]); + operands[1] = gen_lowpart (DImode, operands[1]); + operands[6] = gen_highpart (DImode, operands[2]); + operands[2] = gen_lowpart (DImode, operands[2]); +}) + +(define_split + [(set (match_operand:TI 0 "register_operand" "") + (minus:TI (match_operand:TI 1 "immediate_operand" "") + (match_operand:TI 2 "register_operand" ""))) + (clobber (match_scratch:BI 3 "=&c"))] + "reload_completed && CONST_OK_FOR_K (INTVAL (operands[1]))" + [(set (match_dup 0) (minus:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (gtu:BI (match_dup 0) (match_dup 1))) + (cond_exec (ne (match_dup 3) (const_int 0)) + (set (match_dup 4) (minus:DI (match_dup 6) (match_dup 5)))) + (cond_exec (eq (match_dup 3) (const_int 0)) + (set (match_dup 4) (minus:DI (match_dup 7) (match_dup 5))))] +{ + operands[4] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); + operands[5] = gen_highpart (DImode, operands[2]); + operands[2] = gen_lowpart (DImode, operands[2]); + operands[6] = INTVAL (operands[1]) < 0 ? GEN_INT (-2) : constm1_rtx; + operands[7] = INTVAL (operands[1]) < 0 ? constm1_rtx : const0_rtx; +}) + +(define_expand "mulditi3" + [(set (match_operand:TI 0 "fr_register_operand" "") + (mult:TI (sign_extend:TI + (match_operand:DI 1 "fr_register_operand" "")) + (sign_extend:TI + (match_operand:DI 2 "fr_register_operand" ""))))] + "" + "") + +(define_insn_and_split "*mulditi3_internal" + [(set (match_operand:TI 0 "fr_register_operand" "=&f") + (mult:TI (sign_extend:TI + (match_operand:DI 1 "fr_register_operand" "%f")) + (sign_extend:TI + (match_operand:DI 2 "fr_register_operand" "f"))))] + "" + "#" + "reload_completed" + [(set (match_dup 0) (mult:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (truncate:DI + (lshiftrt:TI + (mult:TI (sign_extend:TI (match_dup 1)) + (sign_extend:TI (match_dup 2))) + (const_int 64))))] +{ + operands[3] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); +} + [(set_attr "itanium_class" "unknown")]) + +(define_expand "umulditi3" + [(set (match_operand:TI 0 "fr_register_operand" "") + (mult:TI (zero_extend:TI + (match_operand:DI 1 "fr_register_operand" "")) + (zero_extend:TI + (match_operand:DI 2 "fr_register_operand" ""))))] + "" + "") + +(define_insn_and_split "*umulditi3_internal" + [(set (match_operand:TI 0 "fr_register_operand" "=&f") + (mult:TI (zero_extend:TI + (match_operand:DI 1 "fr_register_operand" "%f")) + (zero_extend:TI + (match_operand:DI 2 "fr_register_operand" "f"))))] + "" + "#" + "reload_completed" + [(set (match_dup 0) (mult:DI (match_dup 1) (match_dup 2))) + (set (match_dup 3) (truncate:DI + (lshiftrt:TI + (mult:TI (zero_extend:TI (match_dup 1)) + (zero_extend:TI (match_dup 2))) + (const_int 64))))] +{ + operands[3] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); +} + [(set_attr "itanium_class" "unknown")]) + +(define_insn_and_split "negti2" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (neg:TI (match_operand:TI 1 "gr_register_operand" "r"))) + (clobber (match_scratch:BI 2 "=&c"))] + "" + "#" + "reload_completed" + [(set (match_dup 2) (eq:BI (match_dup 1) (const_int 0))) + (set (match_dup 0) (minus:DI (const_int 0) (match_dup 1))) + (cond_exec (eq (match_dup 2) (const_int 0)) + (set (match_dup 3) (minus:DI (const_int -1) (match_dup 4)))) + (cond_exec (ne (match_dup 2) (const_int 0)) + (set (match_dup 3) (minus:DI (const_int 0) (match_dup 4))))] +{ + operands[3] = gen_highpart (DImode, operands[0]); + operands[0] = gen_lowpart (DImode, operands[0]); + operands[4] = gen_highpart (DImode, operands[1]); + operands[1] = gen_lowpart (DImode, operands[1]); +} + [(set_attr "itanium_class" "unknown")]) + +;; :::::::::::::::::::: +;; :: ;; :: 32 bit floating point arithmetic ;; :: ;; :::::::::::::::::::: @@ -2526,7 +2950,25 @@ "fnegabs %0 = %1" [(set_attr "itanium_class" "fmisc")]) -(define_insn "minsf3" +(define_insn "copysignsf3" + [(set (match_operand:SF 0 "register_operand" "=f") + (unspec:SF [(match_operand:SF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN))] + "" + "fmerge.s %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*ncopysignsf3" + [(set (match_operand:SF 0 "register_operand" "=f") + (neg:SF (unspec:SF [(match_operand:SF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN)))] + "" + "fmerge.ns %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "sminsf3" [(set (match_operand:SF 0 "fr_register_operand" "=f") (smin:SF (match_operand:SF 1 "fr_register_operand" "f") (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))] @@ -2534,7 +2976,7 @@ "fmin %0 = %1, %F2" [(set_attr "itanium_class" "fmisc")]) -(define_insn "maxsf3" +(define_insn "smaxsf3" [(set (match_operand:SF 0 "fr_register_operand" "=f") (smax:SF (match_operand:SF 1 "fr_register_operand" "f") (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))] @@ -2568,18 +3010,25 @@ "fnmpy.s %0 = %1, %2" [(set_attr "itanium_class" "fmac")]) -;; ??? Is it possible to canonicalize this as (minus (reg) (mult))? - (define_insn "*nmaddsf4" [(set (match_operand:SF 0 "fr_register_operand" "=f") - (plus:SF (neg:SF (mult:SF - (match_operand:SF 1 "fr_register_operand" "f") - (match_operand:SF 2 "fr_register_operand" "f"))) - (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG")))] + (minus:SF (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG") + (mult:SF (match_operand:SF 1 "fr_register_operand" "f") + (match_operand:SF 2 "fr_register_operand" "f"))))] "" "fnma.s %0 = %1, %2, %F3" [(set_attr "itanium_class" "fmac")]) +(define_insn "*nmaddsf4_alts" + [(set (match_operand:SF 0 "fr_register_operand" "=f") + (minus:SF (match_operand:SF 3 "fr_reg_or_fp01_operand" "fG") + (mult:SF (match_operand:SF 1 "fr_register_operand" "f") + (match_operand:SF 2 "fr_register_operand" "f")))) + (use (match_operand:SI 4 "const_int_operand" ""))] + "" + "fnma.s.s%4 %0 = %1, %2, %F3" + [(set_attr "itanium_class" "fmac")]) + (define_expand "divsf3" [(set (match_operand:SF 0 "fr_register_operand" "") (div:SF (match_operand:SF 1 "fr_register_operand" "") @@ -2587,7 +3036,7 @@ "TARGET_INLINE_FLOAT_DIV" { rtx insn; - if (TARGET_INLINE_FLOAT_DIV_LAT) + if (TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT) insn = gen_divsf3_internal_lat (operands[0], operands[1], operands[2]); else insn = gen_divsf3_internal_thr (operands[0], operands[1], operands[2]); @@ -2602,20 +3051,20 @@ (clobber (match_scratch:XF 3 "=&f")) (clobber (match_scratch:XF 4 "=f")) (clobber (match_scratch:BI 5 "=c"))] - "TARGET_INLINE_FLOAT_DIV_LAT" + "TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT" "#" "&& reload_completed" [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) (mult:XF (match_dup 7) (match_dup 6))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 6))) - (match_dup 10))) + (minus:XF (match_dup 10) + (mult:XF (match_dup 8) (match_dup 6)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) @@ -2659,17 +3108,17 @@ (clobber (match_scratch:XF 3 "=&f")) (clobber (match_scratch:XF 4 "=f")) (clobber (match_scratch:BI 5 "=c"))] - "TARGET_INLINE_FLOAT_DIV_THR" + "TARGET_INLINE_FLOAT_DIV == INL_MAX_THR" "#" "&& reload_completed" [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 6))) - (match_dup 10))) + (minus:XF (match_dup 10) + (mult:XF (match_dup 8) (match_dup 6)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) @@ -2688,8 +3137,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 3))) - (match_dup 7))) + (minus:XF (match_dup 7) + (mult:XF (match_dup 8) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (set (match_dup 0) @@ -2720,7 +3169,7 @@ [(set_attr "itanium_class" "fmisc") (set_attr "predicable" "no")]) -(define_insn "*setf_exp_xf" +(define_insn "setf_exp_xf" [(set (match_operand:XF 0 "fr_register_operand" "=f") (unspec:XF [(match_operand:DI 1 "register_operand" "r")] UNSPEC_SETF_EXP))] @@ -2734,14 +3183,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtsf2_internal_lat (operands[0], operands[1]); -#else - abort (); -#endif else - insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]); +#else + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); +#endif + insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -2764,7 +3213,7 @@ (clobber (match_scratch:XF 5 "=&f")) ;; Register p6 in optimization guide. (clobber (match_scratch:BI 6 "=c"))] - "TARGET_INLINE_SQRT_THR" + "TARGET_INLINE_SQRT == INL_MAX_THR" "#" "&& reload_completed" [ ;; exponent of +1/2 in r2 @@ -2799,8 +3248,8 @@ ;; d = 1/2 - S0 * H0 in f10 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 4))) - (match_dup 3))) + (minus:XF (match_dup 3) + (mult:XF (match_dup 7) (match_dup 4)))) (use (const_int 1))])) ;; Step 5 ;; d' = d + 1/2 * d in f8 @@ -2835,8 +3284,8 @@ ;; d1 = a - S1 * S1 in f9 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) - (match_dup 8))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 7) (match_dup 7)))) (use (const_int 1))])) ;; Step 10 ;; S = S1 + d1 * H1 in f7 @@ -2933,7 +3382,25 @@ "fnegabs %0 = %1" [(set_attr "itanium_class" "fmisc")]) -(define_insn "mindf3" +(define_insn "copysigndf3" + [(set (match_operand:DF 0 "register_operand" "=f") + (unspec:DF [(match_operand:DF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN))] + "" + "fmerge.s %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*ncopysigndf3" + [(set (match_operand:DF 0 "register_operand" "=f") + (neg:DF (unspec:DF [(match_operand:DF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN)))] + "" + "fmerge.ns %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "smindf3" [(set (match_operand:DF 0 "fr_register_operand" "=f") (smin:DF (match_operand:DF 1 "fr_register_operand" "f") (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))] @@ -2941,7 +3408,7 @@ "fmin %0 = %1, %F2" [(set_attr "itanium_class" "fmisc")]) -(define_insn "maxdf3" +(define_insn "smaxdf3" [(set (match_operand:DF 0 "fr_register_operand" "=f") (smax:DF (match_operand:DF 1 "fr_register_operand" "f") (match_operand:DF 2 "fr_reg_or_fp01_operand" "fG")))] @@ -3004,40 +3471,46 @@ "fnmpy.s %0 = %1, %2" [(set_attr "itanium_class" "fmac")]) -;; ??? Is it possible to canonicalize this as (minus (reg) (mult))? - (define_insn "*nmadddf4" [(set (match_operand:DF 0 "fr_register_operand" "=f") - (plus:DF (neg:DF (mult:DF - (match_operand:DF 1 "fr_register_operand" "f") - (match_operand:DF 2 "fr_register_operand" "f"))) - (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG")))] + (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG") + (mult:DF (match_operand:DF 1 "fr_register_operand" "f") + (match_operand:DF 2 "fr_register_operand" "f"))))] "" "fnma.d %0 = %1, %2, %F3" [(set_attr "itanium_class" "fmac")]) (define_insn "*nmadddf4_alts" [(set (match_operand:DF 0 "fr_register_operand" "=f") - (plus:DF (neg:DF (mult:DF - (match_operand:DF 1 "fr_register_operand" "f") - (match_operand:DF 2 "fr_register_operand" "f"))) - (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))) + (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG") + (mult:DF (match_operand:DF 1 "fr_register_operand" "f") + (match_operand:DF 2 "fr_register_operand" "f")))) (use (match_operand:SI 4 "const_int_operand" ""))] "" "fnma.d.s%4 %0 = %1, %2, %F3" [(set_attr "itanium_class" "fmac")]) -(define_insn "*nmadddf4_trunc" +(define_insn "*nmadddf4_truncsf" [(set (match_operand:SF 0 "fr_register_operand" "=f") (float_truncate:SF - (plus:DF (neg:DF (mult:DF - (match_operand:DF 1 "fr_register_operand" "f") - (match_operand:DF 2 "fr_register_operand" "f"))) - (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG"))))] + (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG") + (mult:DF (match_operand:DF 1 "fr_register_operand" "f") + (match_operand:DF 2 "fr_register_operand" "f")))))] "" "fnma.s %0 = %1, %2, %F3" [(set_attr "itanium_class" "fmac")]) +(define_insn "*nmadddf4_truncsf_alts" + [(set (match_operand:SF 0 "fr_register_operand" "=f") + (float_truncate:SF + (minus:DF (match_operand:DF 3 "fr_reg_or_fp01_operand" "fG") + (mult:DF (match_operand:DF 1 "fr_register_operand" "f") + (match_operand:DF 2 "fr_register_operand" "f"))))) + (use (match_operand:SI 4 "const_int_operand" ""))] + "" + "fnma.s.s%4 %0 = %1, %2, %F3" + [(set_attr "itanium_class" "fmac")]) + (define_expand "divdf3" [(set (match_operand:DF 0 "fr_register_operand" "") (div:DF (match_operand:DF 1 "fr_register_operand" "") @@ -3045,7 +3518,7 @@ "TARGET_INLINE_FLOAT_DIV" { rtx insn; - if (TARGET_INLINE_FLOAT_DIV_LAT) + if (TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT) insn = gen_divdf3_internal_lat (operands[0], operands[1], operands[2]); else insn = gen_divdf3_internal_thr (operands[0], operands[1], operands[2]); @@ -3061,20 +3534,20 @@ (clobber (match_scratch:XF 4 "=&f")) (clobber (match_scratch:XF 5 "=&f")) (clobber (match_scratch:BI 6 "=c"))] - "TARGET_INLINE_FLOAT_DIV_LAT" + "TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT" "#" "&& reload_completed" [(parallel [(set (match_dup 7) (div:XF (const_int 1) (match_dup 9))) (set (match_dup 6) (unspec:BI [(match_dup 8) (match_dup 9)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 3) (mult:XF (match_dup 8) (match_dup 7))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 9) (match_dup 7))) - (match_dup 12))) + (minus:XF (match_dup 12) + (mult:XF (match_dup 9) (match_dup 7)))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 3) @@ -3116,8 +3589,8 @@ (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 11) (float_truncate:DF - (plus:XF (neg:XF (mult:XF (match_dup 9) (match_dup 3))) - (match_dup 8)))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 9) (match_dup 3))))) (use (const_int 1))])) (cond_exec (ne (match_dup 6) (const_int 0)) (set (match_dup 0) @@ -3141,17 +3614,17 @@ (clobber (match_scratch:XF 3 "=&f")) (clobber (match_scratch:DF 4 "=f")) (clobber (match_scratch:BI 5 "=c"))] - "TARGET_INLINE_FLOAT_DIV_THR" + "TARGET_INLINE_FLOAT_DIV == INL_MAX_THR" "#" "&& reload_completed" [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 6))) - (match_dup 10))) + (minus:XF (match_dup 10) + (mult:XF (match_dup 8) (match_dup 6)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 6) @@ -3179,12 +3652,12 @@ (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 9) (float_truncate:DF - (mult:XF (match_dup 7) (match_dup 3)))) + (mult:XF (match_dup 7) (match_dup 6)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:DF (neg:DF (mult:DF (match_dup 2) (match_dup 9))) - (match_dup 1))) + (minus:DF (match_dup 1) + (mult:DF (match_dup 2) (match_dup 9)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (set (match_dup 0) @@ -3208,14 +3681,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtdf2_internal_lat (operands[0], operands[1]); -#else - abort (); -#endif else - insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]); +#else + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); +#endif + insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -3238,7 +3711,7 @@ (clobber (match_scratch:XF 5 "=&f")) ;; Register p6 in optimization guide. (clobber (match_scratch:BI 6 "=c"))] - "TARGET_INLINE_SQRT_THR" + "TARGET_INLINE_SQRT == INL_MAX_THR" "#" "&& reload_completed" [ ;; exponent of +1/2 in r2 @@ -3273,8 +3746,8 @@ ;; r0 = 1/2 - G0 * H0 in f9 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3))) - (match_dup 5))) + (minus:XF (match_dup 5) + (mult:XF (match_dup 7) (match_dup 3)))) (use (const_int 1))])) ;; Step 5 ;; H1 = H0 + r0 * H0 in f8 @@ -3294,8 +3767,8 @@ ;; r1 = 1/2 - G1 * H1 in f9 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3))) - (match_dup 5))) + (minus:XF (match_dup 5) + (mult:XF (match_dup 7) (match_dup 3)))) (use (const_int 1))])) ;; Step 8 ;; H2 = H1 + r1 * H1 in f8 @@ -3315,8 +3788,8 @@ ;; d2 = a - G2 * G2 in f9 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) - (match_dup 8))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 7) (match_dup 7)))) (use (const_int 1))])) ;; Step 11 ;; G3 = G2 + d2 * H2 in f7 @@ -3329,8 +3802,8 @@ ;; d3 = a - G3 * G3 in f9 (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7))) - (match_dup 8))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 7) (match_dup 7)))) (use (const_int 1))])) ;; Step 13 ;; S = G3 + d3 * H2 in f7 @@ -3483,7 +3956,25 @@ "fnegabs %0 = %F1" [(set_attr "itanium_class" "fmisc")]) -(define_insn "minxf3" +(define_insn "copysignxf3" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:XF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN))] + "" + "fmerge.s %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*ncopysignxf3" + [(set (match_operand:XF 0 "register_operand" "=f") + (neg:XF (unspec:XF [(match_operand:XF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:XF 2 "fr_reg_or_fp01_operand" "fG")] + UNSPEC_COPYSIGN)))] + "" + "fmerge.ns %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "sminxf3" [(set (match_operand:XF 0 "fr_register_operand" "=f") (smin:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")))] @@ -3491,7 +3982,7 @@ "fmin %0 = %F1, %F2" [(set_attr "itanium_class" "fmisc")]) -(define_insn "maxxf3" +(define_insn "smaxxf3" [(set (match_operand:XF 0 "fr_register_operand" "=f") (smax:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") (match_operand:XF 2 "xfreg_or_fp01_operand" "fG")))] @@ -3617,14 +4108,12 @@ "fnmpy.d %0 = %F1, %F2" [(set_attr "itanium_class" "fmac")]) -;; ??? Is it possible to canonicalize this as (minus (reg) (mult))? - (define_insn "*nmaddxf4" [(set (match_operand:XF 0 "fr_register_operand" "=f") - (plus:XF (neg:XF (mult:XF - (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") - (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))) - (match_operand:XF 3 "xfreg_or_fp01_operand" "fG")))] + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + )))] "" "fnma %0 = %F1, %F2, %F3" [(set_attr "itanium_class" "fmac")]) @@ -3632,10 +4121,10 @@ (define_insn "*nmaddxf4_truncsf" [(set (match_operand:SF 0 "fr_register_operand" "=f") (float_truncate:SF - (plus:XF (neg:XF (mult:XF - (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") - (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))) - (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))] + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + ))))] "" "fnma.s %0 = %F1, %F2, %F3" [(set_attr "itanium_class" "fmac")]) @@ -3643,33 +4132,44 @@ (define_insn "*nmaddxf4_truncdf" [(set (match_operand:DF 0 "fr_register_operand" "=f") (float_truncate:DF - (plus:XF (neg:XF (mult:XF - (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") - (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))) - (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))] + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + ))))] "" "fnma.d %0 = %F1, %F2, %F3" [(set_attr "itanium_class" "fmac")]) (define_insn "*nmaddxf4_alts" [(set (match_operand:XF 0 "fr_register_operand" "=f") - (plus:XF (neg:XF (mult:XF - (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") - (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))) - (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))) + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + ))) (use (match_operand:SI 4 "const_int_operand" ""))] "" "fnma.s%4 %0 = %F1, %F2, %F3" [(set_attr "itanium_class" "fmac")]) +(define_insn "*nmaddxf4_truncsf_alts" + [(set (match_operand:SF 0 "fr_register_operand" "=f") + (float_truncate:SF + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + )))) + (use (match_operand:SI 4 "const_int_operand" ""))] + "" + "fnma.s.s%4 %0 = %F1, %F2, %F3" + [(set_attr "itanium_class" "fmac")]) + (define_insn "*nmaddxf4_truncdf_alts" [(set (match_operand:DF 0 "fr_register_operand" "=f") (float_truncate:DF - (plus:XF (neg:XF - (mult:XF - (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") - (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))) - (match_operand:XF 3 "xfreg_or_fp01_operand" "fG")))) + (minus:XF (match_operand:XF 3 "xfreg_or_fp01_operand" "fG") + (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG") + (match_operand:XF 2 "xfreg_or_fp01_operand" "fG") + )))) (use (match_operand:SI 4 "const_int_operand" ""))] "" "fnma.d.s%4 %0 = %F1, %F2, %F3" @@ -3682,7 +4182,7 @@ "TARGET_INLINE_FLOAT_DIV" { rtx insn; - if (TARGET_INLINE_FLOAT_DIV_LAT) + if (TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT) insn = gen_divxf3_internal_lat (operands[0], operands[1], operands[2]); else insn = gen_divxf3_internal_thr (operands[0], operands[1], operands[2]); @@ -3699,17 +4199,17 @@ (clobber (match_scratch:XF 5 "=&f")) (clobber (match_scratch:XF 6 "=&f")) (clobber (match_scratch:BI 7 "=c"))] - "TARGET_INLINE_FLOAT_DIV_LAT" + "TARGET_INLINE_FLOAT_DIV == INL_MIN_LAT" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) (set (match_dup 7) (unspec:BI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 8))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 4) (mult:XF (match_dup 1) (match_dup 0))) @@ -3739,8 +4239,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 4))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 4)))) (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 3) @@ -3749,8 +4249,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 8))) + (minus:XF (match_dup 8) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 0) @@ -3759,8 +4259,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 3))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 7) (const_int 0)) (set (match_dup 0) @@ -3777,17 +4277,17 @@ (clobber (match_scratch:XF 3 "=&f")) (clobber (match_scratch:XF 4 "=&f")) (clobber (match_scratch:BI 5 "=c"))] - "TARGET_INLINE_FLOAT_DIV_THR" + "TARGET_INLINE_FLOAT_DIV == INL_MAX_THR" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) (set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 6))) + (minus:XF (match_dup 6) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) @@ -3807,8 +4307,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 0) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 3))) - (match_dup 6))) + (minus:XF (match_dup 6) + (mult:XF (match_dup 2) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 0) @@ -3817,8 +4317,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 4))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 4)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) @@ -3827,8 +4327,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 0))) - (match_dup 6))) + (minus:XF (match_dup 6) + (mult:XF (match_dup 2) (match_dup 0)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 0) @@ -3837,8 +4337,8 @@ (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 4) - (plus:XF (neg:XF (mult:XF (match_dup 2) (match_dup 3))) - (match_dup 1))) + (minus:XF (match_dup 1) + (mult:XF (match_dup 2) (match_dup 3)))) (use (const_int 1))])) (cond_exec (ne (match_dup 5) (const_int 0)) (set (match_dup 0) @@ -3856,14 +4356,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtxf2_internal_lat (operands[0], operands[1]); -#else - abort (); -#endif else - insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]); +#else + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); +#endif + insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -3888,7 +4388,7 @@ (clobber (match_scratch:XF 6 "=&f")) ;; Register p6 in optimization guide. (clobber (match_scratch:BI 7 "=c"))] - "TARGET_INLINE_SQRT_THR" + "TARGET_INLINE_SQRT == INL_MAX_THR" "#" "&& reload_completed" [ ;; exponent of +1/2 in r2 @@ -3923,8 +4423,8 @@ ;; d0 = 1/2 - S0 * H0 in f10 (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) - (match_dup 3))) + (minus:XF (match_dup 3) + (mult:XF (match_dup 8) (match_dup 4)))) (use (const_int 1))])) ;; Step 5 ;; H1 = H0 + d0 * H0 in f9 @@ -3944,8 +4444,8 @@ ;; d1 = 1/2 - S1 * H1 in f10 (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) - (match_dup 3))) + (minus:XF (match_dup 3) + (mult:XF (match_dup 8) (match_dup 4)))) (use (const_int 1))])) ;; Step 8 ;; H2 = H1 + d1 * H1 in f9 @@ -3965,15 +4465,15 @@ ;; d2 = 1/2 - S2 * H2 in f10 (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 5) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4))) - (match_dup 3))) + (minus:XF (match_dup 3) + (mult:XF (match_dup 8) (match_dup 4)))) (use (const_int 1))])) ;; Step 11 ;; e2 = a - S2 * S2 in f8 (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8))) - (match_dup 9))) + (minus:XF (match_dup 9) + (mult:XF (match_dup 8) (match_dup 8)))) (use (const_int 1))])) ;; Step 12 ;; S3 = S2 + e2 * H2 in f7 @@ -3993,8 +4493,8 @@ ;; e3 = a - S3 * S3 in f8 (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 3) - (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8))) - (match_dup 9))) + (minus:XF (match_dup 9) + (mult:XF (match_dup 8) (match_dup 8)))) (use (const_int 1))])) ;; Step 15 ;; S = S3 + e3 * H3 in f7 @@ -4154,8 +4654,8 @@ (rotate:SI (match_operand:SI 1 "gr_register_operand" "r") (match_operand:SI 2 "shift_32bit_count_operand" "n")))] "" - "#" - "reload_completed" + "mux2 %0 = %1, 0xe1" + "reload_completed && INTVAL (operands[2]) != 16" [(set (match_dup 3) (ior:DI (zero_extend:DI (match_dup 1)) (ashift:DI (zero_extend:DI (match_dup 1)) (const_int 32)))) @@ -4164,7 +4664,8 @@ { operands[3] = gen_rtx_REG (DImode, REGNO (operands[0])); operands[2] = GEN_INT (32 - INTVAL (operands[2])); -}) +} + [(set_attr "itanium_class" "mmshf")]) ;; :::::::::::::::::::: ;; :: @@ -4209,7 +4710,7 @@ (match_operand:DI 3 "nonmemory_operand" "r")) (match_operand:DI 4 "nonmemory_operand" "rI")))] "reload_in_progress" - "* abort ();" + "* gcc_unreachable ();" "reload_completed" [(set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (match_dup 2)) (match_dup 3))) @@ -4280,6 +4781,199 @@ ;; :::::::::::::::::::: ;; :: +;; :: 128 bit Integer Shifts and Rotates +;; :: +;; :::::::::::::::::::: + +(define_expand "ashlti3" + [(set (match_operand:TI 0 "gr_register_operand" "") + (ashift:TI (match_operand:TI 1 "gr_register_operand" "") + (match_operand:DI 2 "nonmemory_operand" "")))] + "" +{ + if (!dshift_count_operand (operands[2], DImode)) + FAIL; +}) + +(define_insn_and_split "*ashlti3_internal" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (ashift:TI (match_operand:TI 1 "gr_register_operand" "r") + (match_operand:DI 2 "dshift_count_operand" "n")))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + HOST_WIDE_INT shift = INTVAL (operands[2]); + rtx rl = gen_lowpart (DImode, operands[0]); + rtx rh = gen_highpart (DImode, operands[0]); + rtx lo = gen_lowpart (DImode, operands[1]); + rtx shiftlo = GEN_INT (shift & 63); + + if (shift & 64) + { + emit_move_insn (rl, const0_rtx); + if (shift & 63) + emit_insn (gen_ashldi3 (rh, lo, shiftlo)); + else + emit_move_insn (rh, lo); + } + else + { + rtx hi = gen_highpart (DImode, operands[1]); + + emit_insn (gen_shrp (rh, hi, lo, GEN_INT (-shift & 63))); + emit_insn (gen_ashldi3 (rl, lo, shiftlo)); + } + DONE; +}) + +(define_expand "ashrti3" + [(set (match_operand:TI 0 "gr_register_operand" "") + (ashiftrt:TI (match_operand:TI 1 "gr_register_operand" "") + (match_operand:DI 2 "nonmemory_operand" "")))] + "" +{ + if (!dshift_count_operand (operands[2], DImode)) + FAIL; +}) + +(define_insn_and_split "*ashrti3_internal" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (ashiftrt:TI (match_operand:TI 1 "gr_register_operand" "r") + (match_operand:DI 2 "dshift_count_operand" "n")))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + HOST_WIDE_INT shift = INTVAL (operands[2]); + rtx rl = gen_lowpart (DImode, operands[0]); + rtx rh = gen_highpart (DImode, operands[0]); + rtx hi = gen_highpart (DImode, operands[1]); + rtx shiftlo = GEN_INT (shift & 63); + + if (shift & 64) + { + if (shift & 63) + emit_insn (gen_ashrdi3 (rl, hi, shiftlo)); + else + emit_move_insn (rl, hi); + emit_insn (gen_ashrdi3 (rh, hi, GEN_INT (63))); + } + else + { + rtx lo = gen_lowpart (DImode, operands[1]); + + emit_insn (gen_shrp (rl, hi, lo, shiftlo)); + emit_insn (gen_ashrdi3 (rh, hi, shiftlo)); + } + DONE; +}) + +(define_expand "lshrti3" + [(set (match_operand:TI 0 "gr_register_operand" "") + (lshiftrt:TI (match_operand:TI 1 "gr_register_operand" "") + (match_operand:DI 2 "nonmemory_operand" "")))] + "" +{ + if (!dshift_count_operand (operands[2], DImode)) + FAIL; +}) + +(define_insn_and_split "*lshrti3_internal" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (lshiftrt:TI (match_operand:TI 1 "gr_register_operand" "r") + (match_operand:DI 2 "dshift_count_operand" "n")))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + HOST_WIDE_INT shift = INTVAL (operands[2]); + rtx rl = gen_lowpart (DImode, operands[0]); + rtx rh = gen_highpart (DImode, operands[0]); + rtx hi = gen_highpart (DImode, operands[1]); + rtx shiftlo = GEN_INT (shift & 63); + + if (shift & 64) + { + if (shift & 63) + emit_insn (gen_lshrdi3 (rl, hi, shiftlo)); + else + emit_move_insn (rl, hi); + emit_move_insn (rh, const0_rtx); + } + else + { + rtx lo = gen_lowpart (DImode, operands[1]); + + emit_insn (gen_shrp (rl, hi, lo, shiftlo)); + emit_insn (gen_lshrdi3 (rh, hi, shiftlo)); + } + DONE; +}) + +(define_expand "rotlti3" + [(set (match_operand:TI 0 "gr_register_operand" "") + (rotate:TI (match_operand:TI 1 "gr_register_operand" "") + (match_operand:DI 2 "nonmemory_operand" "")))] + "" +{ + if (! dshift_count_operand (operands[2], DImode)) + FAIL; +}) + +(define_insn_and_split "*rotlti3_internal" + [(set (match_operand:TI 0 "gr_register_operand" "=&r") + (rotate:TI (match_operand:TI 1 "gr_register_operand" "r") + (match_operand:DI 2 "dshift_count_operand" "n")))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + HOST_WIDE_INT count = INTVAL (operands[2]); + rtx rl = gen_lowpart (DImode, operands[0]); + rtx rh = gen_highpart (DImode, operands[0]); + rtx lo = gen_lowpart (DImode, operands[1]); + rtx hi = gen_highpart (DImode, operands[1]); + rtx countlo = GEN_INT (-count & 63); + + if (count & 64) + { + if (count & 63) + { + emit_insn (gen_shrp (rl, hi, lo, countlo)); + emit_insn (gen_shrp (rh, lo, hi, countlo)); + } + else + { + emit_move_insn (rl, hi); + emit_move_insn (rh, lo); + } + } + else + { + emit_insn (gen_shrp (rl, lo, hi, countlo)); + emit_insn (gen_shrp (rh, hi, lo, countlo)); + } + DONE; +} + [(set_attr "itanium_class" "unknown")]) + +(define_insn "shrp" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gr_register_operand" "r") + (match_operand:DI 2 "gr_register_operand" "r") + (match_operand:DI 3 "shift_count_operand" "M")] + UNSPEC_SHRP))] + "" + "shrp %0 = %1, %2, %3" + [(set_attr "itanium_class" "ishf")]) + +;; :::::::::::::::::::: +;; :: ;; :: 32 bit Integer Logical operations ;; :: ;; :::::::::::::::::::: @@ -4516,7 +5210,7 @@ [(set (match_operand:BI 0 "register_operand" "=c") (eq:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "immediate_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)))] "" "tbit.z %0, %I0 = %1, %2" @@ -4526,7 +5220,7 @@ [(set (match_operand:BI 0 "register_operand" "=c") (ne:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) - (match_operand:DI 2 "immediate_operand" "n")) + (match_operand:DI 2 "shift_count_operand" "M")) (const_int 0)))] "" "tbit.nz %0, %I0 = %1, %2" @@ -4816,7 +5510,7 @@ "rim,rim,rim, rim, *f, *b,*d*e,*f,*b,*d*e,rO,*f,rOQ,rO, rK")))] "ia64_move_ok (operands[0], operands[2]) && ia64_move_ok (operands[0], operands[3])" - { abort (); } + { gcc_unreachable (); } [(set_attr "predicable" "no")]) (define_split @@ -4919,7 +5613,7 @@ "rim*f,rO,rO,0,0,0,rim*f,rO,rO")))] "ia64_move_ok (operands[0], operands[2]) && ia64_move_ok (operands[0], operands[3])" - { abort (); } + { gcc_unreachable (); } [(set_attr "predicable" "no")]) (define_insn "*abssi2_internal" @@ -5318,12 +6012,10 @@ start_sequence (); set = single_set (last); - if (! rtx_equal_p (SET_DEST (set), op0) - || GET_CODE (SET_SRC (set)) != MEM) - abort (); + gcc_assert (rtx_equal_p (SET_DEST (set), op0) + && GET_CODE (SET_SRC (set)) == MEM); addr = XEXP (SET_SRC (set), 0); - if (rtx_equal_p (addr, op0)) - abort (); + gcc_assert (!rtx_equal_p (addr, op0)); } /* Jump table elements are stored pc-relative. That is, a displacement @@ -5421,7 +6113,8 @@ "" "alloc %0 = ar.pfs, %1, %2, %3, %4" [(set_attr "itanium_class" "syst_m0") - (set_attr "predicable" "no")]) + (set_attr "predicable" "no") + (set_attr "first_insn" "yes")]) ;; Modifies ar.unat (define_expand "gr_spill" @@ -5434,7 +6127,7 @@ "operands[3] = gen_rtx_REG (DImode, AR_UNAT_REGNUM);") (define_insn "gr_spill_internal" - [(set (match_operand:DI 0 "memory_operand" "=m") + [(set (match_operand:DI 0 "destination_operand" "=m") (unspec:DI [(match_operand:DI 1 "register_operand" "r") (match_operand:DI 2 "const_int_operand" "")] UNSPEC_GR_SPILL)) @@ -5468,7 +6161,7 @@ [(set_attr "itanium_class" "ld")]) (define_insn "fr_spill" - [(set (match_operand:XF 0 "memory_operand" "=m") + [(set (match_operand:XF 0 "destination_operand" "=m") (unspec:XF [(match_operand:XF 1 "register_operand" "f")] UNSPEC_FR_SPILL))] "" @@ -5622,7 +6315,7 @@ [(trap_if (const_int 1) (match_operand 0 "const_int_operand" ""))] "" "break %0" - [(set_attr "itanium_class" "chk_s")]) + [(set_attr "itanium_class" "chk_s_i")]) (define_expand "conditional_trap" [(trap_if (match_operand 0 "" "") (match_operand 1 "" ""))] @@ -5638,7 +6331,7 @@ (match_operand 2 "const_int_operand" ""))] "" "(%J0) break %2" - [(set_attr "itanium_class" "chk_s") + [(set_attr "itanium_class" "chk_s_i") (set_attr "predicable" "no")]) (define_insn "break_f" @@ -5670,10 +6363,8 @@ int i = (INTVAL (operands[1])); int j = (INTVAL (operands[2])); - if (i != 0 && i != 1) - abort (); - if (j < 0 || j > 3) - abort (); + gcc_assert (i == 0 || i == 1); + gcc_assert (j >= 0 && j <= 3); return alt[i][j]; } [(set_attr "itanium_class" "lfetch")]) @@ -5759,88 +6450,6 @@ DONE; }) - -;;; Intrinsics support. - -(define_expand "mf" - [(set (mem:BLK (match_dup 0)) - (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_MF))] - "" -{ - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); - MEM_VOLATILE_P (operands[0]) = 1; -}) - -(define_insn "*mf_internal" - [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_MF))] - "" - "mf" - [(set_attr "itanium_class" "syst_m")]) - -(define_insn "fetchadd_acq_si" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:SI [(match_dup 1) - (match_operand:SI 2 "fetchadd_operand" "n")] - UNSPEC_FETCHADD_ACQ))] - "" - "fetchadd4.acq %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "fetchadd_acq_di" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:DI [(match_dup 1) - (match_operand:DI 2 "fetchadd_operand" "n")] - UNSPEC_FETCHADD_ACQ))] - "" - "fetchadd8.acq %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "cmpxchg_acq_si" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:SI [(match_dup 1) - (match_operand:SI 2 "gr_register_operand" "r") - (match_operand:DI 3 "ar_ccv_reg_operand" "")] - UNSPEC_CMPXCHG_ACQ))] - "" - "cmpxchg4.acq %0 = %1, %2, %3" - [(set_attr "itanium_class" "sem")]) - -(define_insn "cmpxchg_acq_di" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:DI [(match_dup 1) - (match_operand:DI 2 "gr_register_operand" "r") - (match_operand:DI 3 "ar_ccv_reg_operand" "")] - UNSPEC_CMPXCHG_ACQ))] - "" - "cmpxchg8.acq %0 = %1, %2, %3" - [(set_attr "itanium_class" "sem")]) - -(define_insn "xchgsi" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (match_operand:SI 2 "gr_register_operand" "r"))] - "" - "xchg4 %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "xchgdi" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (match_operand:DI 2 "gr_register_operand" "r"))] - "" - "xchg8 %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) ;; Predication. @@ -5909,3 +6518,18 @@ "addp4_optimize_ok (operands[1], operands[2])" "addp4 %0 = %1, %2" [(set_attr "itanium_class" "ialu")]) + +;; +;; Get instruction pointer + +(define_insn "ip_value" + [(set (match_operand:DI 0 "register_operand" "=r") + (pc))] + "" + "mov %0 = ip" + [(set_attr "itanium_class" "ialu")]) + +;; Vector operations +(include "vect.md") +;; Atomic operations +(include "sync.md") diff --git a/contrib/gcc/config/ia64/ia64.opt b/contrib/gcc/config/ia64/ia64.opt new file mode 100644 index 00000000000..2ff3d5984a3 --- /dev/null +++ b/contrib/gcc/config/ia64/ia64.opt @@ -0,0 +1,147 @@ +mbig-endian +Target Report RejectNegative Mask(BIG_ENDIAN) +Generate big endian code + +mlittle-endian +Target Report RejectNegative InverseMask(BIG_ENDIAN) +Generate little endian code + +mgnu-as +Target Report Mask(GNU_AS) +Generate code for GNU as + +mgnu-ld +Target Report Mask(GNU_LD) +Generate code for GNU ld + +mvolatile-asm-stop +Target Report Mask(VOL_ASM_STOP) +Emit stop bits before and after volatile extended asms + +mregister-names +Target Mask(REG_NAMES) +Use in/loc/out register names + +mno-sdata +Target Report RejectNegative Mask(NO_SDATA) + +msdata +Target Report RejectNegative InverseMask(NO_SDATA) +Enable use of sdata/scommon/sbss + +mno-pic +Target Report RejectNegative Mask(NO_PIC) +Generate code without GP reg + +mconstant-gp +Target Report RejectNegative Mask(CONST_GP) +gp is constant (but save/restore gp on indirect calls) + +mauto-pic +Target Report RejectNegative Mask(AUTO_PIC) +Generate self-relocatable code + +minline-float-divide-min-latency +Target Report RejectNegative Var(TARGET_INLINE_FLOAT_DIV, 1) +Generate inline floating point division, optimize for latency + +minline-float-divide-max-throughput +Target Report RejectNegative Var(TARGET_INLINE_FLOAT_DIV, 2) Init(2) +Generate inline floating point division, optimize for throughput + +mno-inline-float-divide +Target Report RejectNegative Var(TARGET_INLINE_FLOAT_DIV, 0) + +minline-int-divide-min-latency +Target Report RejectNegative Var(TARGET_INLINE_INT_DIV, 1) +Generate inline integer division, optimize for latency + +minline-int-divide-max-throughput +Target Report RejectNegative Var(TARGET_INLINE_INT_DIV, 2) +Generate inline integer division, optimize for throughput + +mno-inline-int-divide +Target Report RejectNegative Var(TARGET_INLINE_INT_DIV, 0) +Do not inline integer division + +minline-sqrt-min-latency +Target Report RejectNegative Var(TARGET_INLINE_SQRT, 1) +Generate inline square root, optimize for latency + +minline-sqrt-max-throughput +Target Report RejectNegative Var(TARGET_INLINE_SQRT, 2) +Generate inline square root, optimize for throughput + +mno-inline-sqrt +Target Report RejectNegative Var(TARGET_INLINE_SQRT, 0) +Do not inline square root + +mdwarf2-asm +Target Report Mask(DWARF2_ASM) +Enable Dwarf 2 line debug info via GNU as + +mearly-stop-bits +Target Report Mask(EARLY_STOP_BITS) +Enable earlier placing stop bits for better scheduling + +mfixed-range= +Target RejectNegative Joined +Specify range of registers to make fixed + +mtls-size= +Target RejectNegative Joined UInteger Var(ia64_tls_size) Init(22) +Specify bit size of immediate TLS offsets + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +msched-br-data-spec +Target Report Var(mflag_sched_br_data_spec) Init(0) +Use data speculation before reload + +msched-ar-data-spec +Target Report Var(mflag_sched_ar_data_spec) Init(1) +Use data speculation after reload + +msched-control-spec +Target Report Var(mflag_sched_control_spec) Init(0) +Use control speculation + +msched-br-in-data-spec +Target Report Var(mflag_sched_br_in_data_spec) Init(1) +Use in block data speculation before reload + +msched-ar-in-data-spec +Target Report Var(mflag_sched_ar_in_data_spec) Init(1) +Use in block data speculation after reload + +msched-in-control-spec +Target Report Var(mflag_sched_in_control_spec) Init(1) +Use in block control speculation + +msched-ldc +Target Report Var(mflag_sched_ldc) Init(1) +Use simple data speculation check + +msched-control-ldc +Target Report Var(mflag_control_ldc) Init(0) +Use simple data speculation check for control speculation + +msched-spec-verbose +Common Report Var(mflag_sched_spec_verbose) Init(0) +Print information about speculative motions. + +msched-prefer-non-data-spec-insns +Common Report Var(mflag_sched_prefer_non_data_spec_insns) Init(0) +If set, data speculative instructions will be chosen for schedule only if there are no other choices at the moment + +msched-prefer-non-control-spec-insns +Common Report Var(mflag_sched_prefer_non_control_spec_insns) Init(0) +If set, control speculative instructions will be chosen for schedule only if there are no other choices at the moment + +msched-count-spec-in-critical-path +Common Report Var(mflag_sched_count_spec_in_critical_path) Init(0) +Count speculative dependencies while calculating priority of instructions + +; This comment is to ensure we retain the blank line above. diff --git a/contrib/gcc/config/ia64/ia64intrin.h b/contrib/gcc/config/ia64/ia64intrin.h index 262dc20e4d0..fba7296aacb 100644 --- a/contrib/gcc/config/ia64/ia64intrin.h +++ b/contrib/gcc/config/ia64/ia64intrin.h @@ -1,130 +1,2 @@ -#ifndef _IA64INTRIN_H_INCLUDED -#define _IA64INTRIN_H_INCLUDED - -/* Actually, everything is a compiler builtin, but just so - there's no confusion... */ -#ifdef __cplusplus -extern "C" { -#endif - -extern void __sync_synchronize (void); - -extern int __sync_val_compare_and_swap_si (int *, int, int); -extern long __sync_val_compare_and_swap_di (long *, long, long); -#define __sync_val_compare_and_swap(PTR, OLD, NEW) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \ - : (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW))) - -extern int __sync_bool_compare_and_swap_si (int *, int, int); -extern int __sync_bool_compare_and_swap_di (long *, long, long); -#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \ - : __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW))) - -extern void __sync_lock_release_si (int *); -extern void __sync_lock_release_di (long *); -#define __sync_lock_release(PTR) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_lock_release_si((int *)(PTR)) \ - : __sync_lock_release_di((long *)(PTR))) - -extern int __sync_lock_test_and_set_si (int *, int); -extern long __sync_lock_test_and_set_di (long *, long); -#define __sync_lock_test_and_set(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_add_si (int *, int); -extern long __sync_fetch_and_add_di (long *, long); -#define __sync_fetch_and_add(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_sub_si (int *, int); -extern long __sync_fetch_and_sub_di (long *, long); -#define __sync_fetch_and_sub(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_and_si (int *, int); -extern long __sync_fetch_and_and_di (long *, long); -#define __sync_fetch_and_and(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_or_si (int *, int); -extern long __sync_fetch_and_or_di (long *, long); -#define __sync_fetch_and_or(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_xor_si (int *, int); -extern long __sync_fetch_and_xor_di (long *, long); -#define __sync_fetch_and_xor(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_nand_si (int *, int); -extern long __sync_fetch_and_nand_di (long *, long); -#define __sync_fetch_and_nand(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(PTR),(long)(VAL))) - -extern int __sync_add_and_fetch_si (int *, int); -extern long __sync_add_and_fetch_di (long *, long); -#define __sync_add_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(PTR),(long)(VAL))) - -extern int __sync_sub_and_fetch_si (int *, int); -extern long __sync_sub_and_fetch_di (long *, long); -#define __sync_sub_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(PTR),(long)(VAL))) - -extern int __sync_and_and_fetch_si (int *, int); -extern long __sync_and_and_fetch_di (long *, long); -#define __sync_and_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(PTR),(long)(VAL))) - -extern int __sync_or_and_fetch_si (int *, int); -extern long __sync_or_and_fetch_di (long *, long); -#define __sync_or_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(PTR),(long)(VAL))) - -extern int __sync_xor_and_fetch_si (int *, int); -extern long __sync_xor_and_fetch_di (long *, long); -#define __sync_xor_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(PTR),(long)(VAL))) - -extern int __sync_nand_and_fetch_si (int *, int); -extern long __sync_nand_and_fetch_di (long *, long); -#define __sync_nand_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(PTR),(long)(VAL))) - -#ifdef __cplusplus -} -#endif - -#endif +/* Overloaded builtins have been ported to C++: nothing is needed + in the header anymore. This file intentionally left void. */ diff --git a/contrib/gcc/config/ia64/ilp32.opt b/contrib/gcc/config/ia64/ilp32.opt new file mode 100644 index 00000000000..bcb64737eb9 --- /dev/null +++ b/contrib/gcc/config/ia64/ilp32.opt @@ -0,0 +1,7 @@ +milp32 +Target Report RejectNegative Mask(ILP32) +Generate ILP32 code + +mlp64 +Target Report RejectNegative InverseMask(ILP32) +Generate LP64 code diff --git a/contrib/gcc/config/ia64/itanium1.md b/contrib/gcc/config/ia64/itanium1.md index 2b844115160..f9b7f91a9cd 100644 --- a/contrib/gcc/config/ia64/itanium1.md +++ b/contrib/gcc/config/ia64/itanium1.md @@ -1,6 +1,6 @@ ;; Itanium1 (original Itanium) DFA descriptions for insn scheduling ;; and bundling. -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Vladimir Makarov . ;; ;; This file is part of GCC. @@ -17,8 +17,8 @@ ;; ;; 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. */ +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. */ ;; @@ -33,10 +33,10 @@ DEFINE_AUTOMATON). All define_reservations and define_cpu_units should have unique - names which can not be "nothing". + names which cannot be "nothing". o (exclusion_set string string) means that each CPU function unit - in the first string can not be reserved simultaneously with each + in the first string cannot be reserved simultaneously with each unit whose name is in the second string and vise versa. CPU units in the string are separated by commas. For example, it is useful for description CPU with fully pipelined floating point @@ -44,7 +44,7 @@ floating point insns or only double floating point insns. o (presence_set string string) means that each CPU function unit in - the first string can not be reserved unless at least one of + the first string cannot be reserved unless at least one of pattern of units whose names are in the second string is reserved. This is an asymmetric relation. CPU units or unit patterns in the strings are separated by commas. Pattern is one @@ -92,13 +92,13 @@ string are separated by commas. Pattern is one unit name or unit names separated by white-spaces. - For example, it is useful for description that slot0 can not be + For example, it is useful for description that slot0 cannot be reserved after slot1 or slot2 reservation for a VLIW processor. We could describe it by the following construction (absence_set "slot2" "slot0, slot1") - Or slot2 can not be reserved if slot0 and unit b0 are reserved or + Or slot2 cannot be reserved if slot0 and unit b0 are reserved or slot1 and unit b1 are reserved . In this case we could write (absence_set "slot2" "slot0 b0, slot1 b1") @@ -140,7 +140,7 @@ case, you describe common part and use one its name (the 1st parameter) in regular expression in define_insn_reservation. All define_reservations, define results and define_cpu_units should - have unique names which can not be "nothing". + have unique names which cannot be "nothing". o (define_insn_reservation name default_latency condition regexpr) describes reservation of cpu functional units (the 3nd operand) @@ -525,10 +525,29 @@ (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "fcvtfx")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_F") + (define_insn_reservation "1_fld" 9 - (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "fld")) + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "no")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") +(define_insn_reservation "1_fldc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") + +(define_insn_reservation "1_fldp" 9 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "no")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") +(define_insn_reservation "1_fldpc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") + (define_insn_reservation "1_fmac" 5 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "fmac")) @@ -589,14 +608,25 @@ (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "ilog")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_A") +(define_insn_reservation "1_mmalua" 2 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "mmalua")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "1_A") (define_insn_reservation "1_ishf" 1 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "ishf")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_I+1_not_ui1") (define_insn_reservation "1_ld" 2 - (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "ld")) + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "no")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") +(define_insn_reservation "1_ldc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "yes")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") (define_insn_reservation "1_long_i" 1 (and (and (eq_attr "cpu" "itanium") @@ -687,10 +717,19 @@ (eq_attr "itanium_class" "xtd")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_I") -(define_insn_reservation "1_chk_s" 0 +(define_insn_reservation "1_chk_s_i" 0 (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "chk_s")) + (eq_attr "itanium_class" "chk_s_i")) (eq (symbol_ref "bundling_p") (const_int 0))) "1_A") +(define_insn_reservation "1_chk_s_f" 0 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "chk_s_f")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") +(define_insn_reservation "1_chk_a" 0 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "chk_a")) + (eq (symbol_ref "bundling_p") (const_int 0))) "1_M") + (define_insn_reservation "1_lfetch" 0 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "lfetch")) @@ -920,7 +959,7 @@ ;; There is only one insn `mov ar.pfs =' for toar_i. (define_bypass 0 "1_tobr,1_topr,1_toar_i" "1_br,1_scall") -(define_bypass 3 "1_ialu,1_ialu_addr" "1_mmmul,1_mmshf") +(define_bypass 3 "1_ialu,1_ialu_addr" "1_mmmul,1_mmshf,1_mmalua") ;; ??? howto describe ialu for I slot only. We use ialu_addr for that ;;(define_bypass 2 "1_ialu" "1_ld" "ia64_ld_address_bypass_p") ;; ??? howto describe ialu st/address for I slot only. We use ialu_addr @@ -934,15 +973,15 @@ (define_bypass 2 "1_ilog,1_xtd" "1_ld" "ia64_ld_address_bypass_p") (define_bypass 2 "1_ilog,1_xtd" "1_st" "ia64_st_address_bypass_p") -(define_bypass 3 "1_ld" "1_mmmul,1_mmshf") +(define_bypass 3 "1_ld,1_ldc" "1_mmmul,1_mmshf") (define_bypass 3 "1_ld" "1_ld" "ia64_ld_address_bypass_p") (define_bypass 3 "1_ld" "1_st" "ia64_st_address_bypass_p") ;; Intel docs say only LD, ST, IALU, ILOG, ISHF consumers have latency 4, ;; but HP engineers say any non-MM operation. -(define_bypass 4 "1_mmmul,1_mmshf" - "1_br,1_fcmp,1_fcvtfx,1_fld,1_fmac,1_fmisc,1_frar_i,1_frar_m,\ - 1_frbr,1_frfr,1_frpr,1_ialu,1_icmp,1_ilog,1_ishf,1_ld,1_chk_s,\ +(define_bypass 4 "1_mmmul,1_mmshf,1_mmalua" + "1_br,1_fcmp,1_fcvtfx,1_fld,1_fldc,1_fmac,1_fmisc,1_frar_i,1_frar_m,\ + 1_frbr,1_frfr,1_frpr,1_ialu,1_icmp,1_ilog,1_ishf,1_ld,1_ldc,1_chk_s_i,1_chk_s_f,1_chk_a,\ 1_long_i,1_rse_m,1_sem,1_stf,1_st,1_syst_m0,1_syst_m,\ 1_tbit,1_toar_i,1_toar_m,1_tobr,1_tofr,1_topr,1_xmpy,1_xtd") @@ -956,15 +995,15 @@ (define_bypass 8 "1_fmisc,1_fcvtfx,1_fmac,1_xmpy" "1_stf") ;; We don't use here fcmp because scall may be predicated. -(define_bypass 0 "1_fcvtfx,1_fld,1_fmac,1_fmisc,1_frar_i,1_frar_m,\ +(define_bypass 0 "1_fcvtfx,1_fld,1_fldc,1_fmac,1_fmisc,1_frar_i,1_frar_m,\ 1_frbr,1_frfr,1_frpr,1_ialu,1_ialu_addr,1_ilog,1_ishf,\ - 1_ld,1_long_i,1_mmmul,1_mmshf,1_mmshfi,1_toar_m,1_tofr,\ - 1_xmpy,1_xtd" "1_scall") + 1_ld,1_ldc,1_long_i,1_mmalua,1_mmmul,1_mmshf,1_mmshfi,\ + 1_toar_m,1_tofr,1_xmpy,1_xtd" "1_scall") (define_bypass 0 "1_unknown,1_ignore,1_stop_bit,1_br,1_fcmp,1_fcvtfx,\ - 1_fld,1_fmac,1_fmisc,1_frar_i,1_frar_m,1_frbr,1_frfr,\ - 1_frpr,1_ialu,1_ialu_addr,1_icmp,1_ilog,1_ishf,1_ld,\ - 1_chk_s,1_long_i,1_mmmul,1_mmshf,1_mmshfi,1_nop,\ + 1_fld,1_fldc,1_fmac,1_fmisc,1_frar_i,1_frar_m,1_frbr,1_frfr,\ + 1_frpr,1_ialu,1_ialu_addr,1_icmp,1_ilog,1_ishf,1_ld,1_ldc,\ + 1_chk_s_i,1_chk_s_f,1_chk_a,1_long_i,1_mmalua,1_mmmul,1_mmshf,1_mmshfi,1_nop,\ 1_nop_b,1_nop_f,1_nop_i,1_nop_m,1_nop_x,1_rse_m,1_scall,\ 1_sem,1_stf,1_st,1_syst_m0,1_syst_m,1_tbit,1_toar_i,\ 1_toar_m,1_tobr,1_tofr,1_topr,1_xmpy,1_xtd,1_lfetch" @@ -1398,10 +1437,29 @@ (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "fcvtfx")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_F") + (define_insn_reservation "1b_fld" 9 - (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "fld")) + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "no")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") +(define_insn_reservation "1b_fldc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") + +(define_insn_reservation "1b_fldp" 9 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "no")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") +(define_insn_reservation "1b_fldpc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") + (define_insn_reservation "1b_fmac" 5 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "fmac")) @@ -1458,15 +1516,27 @@ (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "ilog")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_A") +(define_insn_reservation "1b_mmalua" 2 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "mmalua")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_A") (define_insn_reservation "1b_ishf" 1 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "ishf")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_I+1b_not_ui1") + (define_insn_reservation "1b_ld" 2 - (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "ld")) + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "no")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") +(define_insn_reservation "1b_ldc" 0 + (and (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") + (define_insn_reservation "1b_long_i" 1 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "long_i")) @@ -1549,10 +1619,20 @@ (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "xtd")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_I") -(define_insn_reservation "1b_chk_s" 0 + +(define_insn_reservation "1b_chk_s_i" 0 (and (and (eq_attr "cpu" "itanium") - (eq_attr "itanium_class" "chk_s")) + (eq_attr "itanium_class" "chk_s_i")) (ne (symbol_ref "bundling_p") (const_int 0))) "1b_A") +(define_insn_reservation "1b_chk_s_f" 0 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "chk_s_f")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") +(define_insn_reservation "1b_chk_a" 0 + (and (and (eq_attr "cpu" "itanium") + (eq_attr "itanium_class" "chk_a")) + (ne (symbol_ref "bundling_p") (const_int 0))) "1b_M") + (define_insn_reservation "1b_lfetch" 0 (and (and (eq_attr "cpu" "itanium") (eq_attr "itanium_class" "lfetch")) diff --git a/contrib/gcc/config/ia64/itanium2.md b/contrib/gcc/config/ia64/itanium2.md index 0cdb0701346..a10971df7de 100644 --- a/contrib/gcc/config/ia64/itanium2.md +++ b/contrib/gcc/config/ia64/itanium2.md @@ -1,5 +1,5 @@ ;; Itanium2 DFA descriptions for insn scheduling and bundling. -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Vladimir Makarov . ;; ;; This file is part of GCC. @@ -16,8 +16,8 @@ ;; ;; 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. */ +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. */ ;; /* This is description of pipeline hazards based on DFA. The @@ -31,10 +31,10 @@ DEFINE_AUTOMATON). All define_reservations and define_cpu_units should have unique - names which can not be "nothing". + names which cannot be "nothing". o (exclusion_set string string) means that each CPU function unit - in the first string can not be reserved simultaneously with each + in the first string cannot be reserved simultaneously with each unit whose name is in the second string and vise versa. CPU units in the string are separated by commas. For example, it is useful for description CPU with fully pipelined floating point @@ -42,7 +42,7 @@ floating point insns or only double floating point insns. o (presence_set string string) means that each CPU function unit in - the first string can not be reserved unless at least one of + the first string cannot be reserved unless at least one of pattern of units whose names are in the second string is reserved. This is an asymmetric relation. CPU units or unit patterns in the strings are separated by commas. Pattern is one @@ -90,13 +90,13 @@ string are separated by commas. Pattern is one unit name or unit names separated by white-spaces. - For example, it is useful for description that slot0 can not be + For example, it is useful for description that slot0 cannot be reserved after slot1 or slot2 reservation for a VLIW processor. We could describe it by the following construction (absence_set "slot2" "slot0, slot1") - Or slot2 can not be reserved if slot0 and unit b0 are reserved or + Or slot2 cannot be reserved if slot0 and unit b0 are reserved or slot1 and unit b1 are reserved . In this case we could write (absence_set "slot2" "slot0 b0, slot1 b1") @@ -138,7 +138,7 @@ case, you describe common part and use one its name (the 1st parameter) in regular expression in define_insn_reservation. All define_reservations, define results and define_cpu_units should - have unique names which can not be "nothing". + have unique names which cannot be "nothing". o (define_insn_reservation name default_latency condition regexpr) describes reservation of cpu functional units (the 3nd operand) @@ -398,7 +398,7 @@ "2_stop") ;; The issue logic can reorder M slot insns between different subtypes -;; but can not reorder insn within the same subtypes. The following +;; but cannot reorder insn within the same subtypes. The following ;; constraint is enough to describe this. (final_presence_set "2_um1" "2_um0") (final_presence_set "2_um3" "2_um2") @@ -484,7 +484,7 @@ (define_reservation "2_M_only_um01" "2_M0_only_um01|2_M1_only_um01") ;; I instruction is dispersed to the lowest numbered I unit -;; not already in use. Remeber about possible splitting. +;; not already in use. Remember about possible splitting. (define_reservation "2_I0" "2_0mi.i+2_ui0|2_0mii.+(2_ui0|2_ui1)|2_0mmi.+2_ui0\ |2_0mfi.+2_ui0|2_0mi.b+2_ui0|(2_1mi.i|2_1mi.b)+(2_ui0|2_ui1)\ @@ -731,9 +731,38 @@ (eq_attr "itanium_class" "fcvtfx")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_F") (define_insn_reservation "2_fld" 6 - (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "fld")) - (eq (symbol_ref "bundling_p") (const_int 0))) "2_M") + (and (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "data_speculative" "no")) + (eq_attr "check_load" "no")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M") +(define_insn_reservation "2_flda" 6 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "data_speculative" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") +(define_insn_reservation "2_fldc" 0 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") + +(define_insn_reservation "2_fldp" 6 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "no")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") +(define_insn_reservation "2_fldpc" 0 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") + (define_insn_reservation "2_fmac" 4 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "fmac")) @@ -786,17 +815,29 @@ (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "ilog")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_A") +(define_insn_reservation "2_mmalua" 2 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "mmalua")) + (eq (symbol_ref "bundling_p") (const_int 0))) "2_A") ;; Latency time ??? (define_insn_reservation "2_ishf" 1 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "ishf")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_I+2_only_ui0") + (define_insn_reservation "2_ld" 1 - (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "ld")) + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "no")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_M_only_um01") +(define_insn_reservation "2_ldc" 0 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "check_load" "yes")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") + (define_insn_reservation "2_long_i" 1 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "long_i")) @@ -900,11 +941,22 @@ (eq_attr "itanium_class" "xtd")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_I") -(define_insn_reservation "2_chk_s" 0 +(define_insn_reservation "2_chk_s_i" 0 (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "chk_s")) + (eq_attr "itanium_class" "chk_s_i")) (eq (symbol_ref "bundling_p") (const_int 0))) "2_I|2_M_only_um23") +(define_insn_reservation "2_chk_s_f" 0 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "chk_s_f")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um23") +(define_insn_reservation "2_chk_a" 0 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "chk_a")) + (eq (symbol_ref "bundling_p") (const_int 0))) + "2_M_only_um01") + (define_insn_reservation "2_lfetch" 0 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "lfetch")) @@ -1016,23 +1068,24 @@ (define_bypass 0 "2_tbit" "2_br,2_scall") (define_bypass 2 "2_ld" "2_ld" "ia64_ld_address_bypass_p") (define_bypass 2 "2_ld" "2_st" "ia64_st_address_bypass_p") -(define_bypass 2 "2_ld" "2_mmmul,2_mmshf") -(define_bypass 3 "2_ilog" "2_mmmul,2_mmshf") -(define_bypass 3 "2_ialu" "2_mmmul,2_mmshf") -(define_bypass 3 "2_mmmul,2_mmshf" "2_ialu,2_ilog,2_ishf,2_st,2_ld") +(define_bypass 2 "2_ld,2_ldc" "2_mmalua,2_mmmul,2_mmshf") +(define_bypass 3 "2_ilog" "2_mmalua,2_mmmul,2_mmshf") +(define_bypass 3 "2_ialu" "2_mmalua,2_mmmul,2_mmshf") +(define_bypass 3 "2_mmalua,2_mmmul,2_mmshf" "2_ialu,2_ilog,2_ishf,2_st,2_ld,2_ldc") (define_bypass 6 "2_tofr" "2_frfr,2_stf") (define_bypass 7 "2_fmac" "2_frfr,2_stf") ;; We don't use here fcmp because scall may be predicated. -(define_bypass 0 "2_fcvtfx,2_fld,2_fmac,2_fmisc,2_frar_i,2_frar_m,\ - 2_frbr,2_frfr,2_frpr,2_ialu,2_ilog,2_ishf,2_ld,2_long_i,\ - 2_mmmul,2_mmshf,2_mmshfi,2_toar_m,2_tofr,2_xmpy,2_xtd" +(define_bypass 0 "2_fcvtfx,2_fld,2_flda,2_fldc,2_fmac,2_fmisc,2_frar_i,2_frar_m,\ + 2_frbr,2_frfr,2_frpr,2_ialu,2_ilog,2_ishf,2_ld,2_ldc,2_long_i,\ + 2_mmalua,2_mmmul,2_mmshf,2_mmshfi,2_toar_m,2_tofr,\ + 2_xmpy,2_xtd" "2_scall") -(define_bypass 0 "2_unknown,2_ignore,2_stop_bit,2_br,2_fcmp,2_fcvtfx,2_fld,\ +(define_bypass 0 "2_unknown,2_ignore,2_stop_bit,2_br,2_fcmp,2_fcvtfx,2_fld,2_flda,2_fldc,\ 2_fmac,2_fmisc,2_frar_i,2_frar_m,2_frbr,2_frfr,2_frpr,\ - 2_ialu,2_icmp,2_ilog,2_ishf,2_ld,2_chk_s,\ - 2_long_i,2_mmmul,2_mmshf,2_mmshfi,2_nop,2_nop_b,2_nop_f,\ + 2_ialu,2_icmp,2_ilog,2_ishf,2_ld,2_ldc,2_chk_s_i,2_chk_s_f,2_chk_a,2_long_i,\ + 2_mmalua,2_mmmul,2_mmshf,2_mmshfi,2_nop,2_nop_b,2_nop_f,\ 2_nop_i,2_nop_m,2_nop_x,2_rse_m,2_scall,2_sem,2_stf,2_st,\ 2_syst_m0,2_syst_m,2_tbit,2_toar_i,2_toar_m,2_tobr,2_tofr,\ 2_topr,2_xmpy,2_xtd,2_lfetch" "2_ignore") @@ -1274,7 +1327,7 @@ "2b_stop") ;; The issue logic can reorder M slot insns between different subtypes -;; but can not reorder insn within the same subtypes. The following +;; but cannot reorder insn within the same subtypes. The following ;; constraint is enough to describe this. (final_presence_set "2b_um1" "2b_um0") (final_presence_set "2b_um3" "2b_um2") @@ -1335,7 +1388,7 @@ +(2b_um2|2b_um3)") ;; I instruction is dispersed to the lowest numbered I unit -;; not already in use. Remeber about possible splitting. +;; not already in use. Remember about possible splitting. (define_reservation "2b_I" "2b_0mi.i+2_2+2b_ui0|2b_0mii.+2_3+(2b_ui0|2b_ui1)|2b_0mmi.+2_3+2b_ui0\ |2b_0mfi.+2_3+2b_ui0|2b_0mi.b+2_2+2b_ui0\ @@ -1533,9 +1586,38 @@ (eq_attr "itanium_class" "fcvtfx")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_F") (define_insn_reservation "2b_fld" 6 - (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "fld")) - (ne (symbol_ref "bundling_p") (const_int 0))) "2b_M") + (and (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "data_speculative" "no")) + (eq_attr "check_load" "no")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M") +(define_insn_reservation "2b_flda" 6 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "data_speculative" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") +(define_insn_reservation "2b_fldc" 0 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fld")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") + +(define_insn_reservation "2b_fldp" 6 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "no")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") +(define_insn_reservation "2b_fldpc" 0 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "fldp")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") + (define_insn_reservation "2b_fmac" 4 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "fmac")) @@ -1586,17 +1668,30 @@ (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "ilog")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_A") +(define_insn_reservation "2b_mmalua" 2 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "mmalua")) + (ne (symbol_ref "bundling_p") (const_int 0))) "2b_A") ;; Latency time ??? (define_insn_reservation "2b_ishf" 1 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "ishf")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_I+2b_only_ui0") + (define_insn_reservation "2b_ld" 1 - (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "ld")) + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "no")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_M_only_um01") +(define_insn_reservation "2b_ldc" 0 + (and (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "ld")) + (eq_attr "check_load" "yes")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") + (define_insn_reservation "2b_long_i" 1 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "long_i")) @@ -1695,11 +1790,23 @@ (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "xtd")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_I") -(define_insn_reservation "2b_chk_s" 0 + +(define_insn_reservation "2b_chk_s_i" 0 (and (and (eq_attr "cpu" "itanium2") - (eq_attr "itanium_class" "chk_s")) + (eq_attr "itanium_class" "chk_s_i")) (ne (symbol_ref "bundling_p") (const_int 0))) "2b_I|2b_M_only_um23") +(define_insn_reservation "2b_chk_s_f" 0 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "chk_s_f")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um23") +(define_insn_reservation "2b_chk_a" 0 + (and (and (eq_attr "cpu" "itanium2") + (eq_attr "itanium_class" "chk_a")) + (ne (symbol_ref "bundling_p") (const_int 0))) + "2b_M_only_um01") + (define_insn_reservation "2b_lfetch" 0 (and (and (eq_attr "cpu" "itanium2") (eq_attr "itanium_class" "lfetch")) diff --git a/contrib/gcc/config/ia64/lib1funcs.asm b/contrib/gcc/config/ia64/lib1funcs.asm index e3d348ba722..245a8bb1595 100644 --- a/contrib/gcc/config/ia64/lib1funcs.asm +++ b/contrib/gcc/config/ia64/lib1funcs.asm @@ -1,3 +1,30 @@ +/* Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. + Contributed by James E. Wilson . + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + 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, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + #ifdef L__divxf3 // Compute a 80-bit IEEE double-extended quotient. // @@ -139,10 +166,13 @@ __divdi3: // Transfer inputs to FP registers. setf.sig f8 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; // Convert the inputs to FP, so that they won't be treated as unsigned. fcvt.xf f8 = f8 fcvt.xf f9 = f9 +(p7) break 1 ;; // Compute the reciprocal approximation. frcpa.s1 f10, p6 = f8, f9 @@ -189,10 +219,13 @@ __moddi3: // Transfer inputs to FP registers. setf.sig f14 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; // Convert the inputs to FP, so that they won't be treated as unsigned. fcvt.xf f8 = f14 fcvt.xf f9 = f9 +(p7) break 1 ;; // Compute the reciprocal approximation. frcpa.s1 f10, p6 = f8, f9 @@ -243,10 +276,13 @@ __udivdi3: // Transfer inputs to FP registers. setf.sig f8 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; // Convert the inputs to FP, to avoid FP software-assist faults. fcvt.xuf.s1 f8 = f8 fcvt.xuf.s1 f9 = f9 +(p7) break 1 ;; // Compute the reciprocal approximation. frcpa.s1 f10, p6 = f8, f9 @@ -293,10 +329,13 @@ __umoddi3: // Transfer inputs to FP registers. setf.sig f14 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; // Convert the inputs to FP, to avoid FP software assist faults. fcvt.xuf.s1 f8 = f14 fcvt.xuf.s1 f9 = f9 +(p7) break 1; ;; // Compute the reciprocal approximation. frcpa.s1 f10, p6 = f8, f9 @@ -345,11 +384,14 @@ __umoddi3: .proc __divsi3 __divsi3: .regstk 2,0,0,0 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 sxt4 in0 = in0 sxt4 in1 = in1 ;; setf.sig f8 = in0 setf.sig f9 = in1 +(p7) break 1 ;; mov r2 = 0x0ffdd fcvt.xf f8 = f8 @@ -394,6 +436,8 @@ __modsi3: ;; setf.sig f13 = r32 setf.sig f9 = r33 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; sub in1 = r0, in1 fcvt.xf f8 = f13 @@ -401,6 +445,7 @@ __modsi3: ;; setf.exp f11 = r2 frcpa.s1 f10, p6 = f8, f9 +(p7) break 1 ;; (p6) fmpy.s1 f12 = f8, f10 (p6) fnma.s1 f10 = f9, f10, f1 @@ -441,9 +486,12 @@ __udivsi3: ;; setf.sig f8 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; fcvt.xf f8 = f8 fcvt.xf f9 = f9 +(p7) break 1 ;; setf.exp f11 = r2 frcpa.s1 f10, p6 = f8, f9 @@ -484,6 +532,8 @@ __umodsi3: ;; setf.sig f13 = in0 setf.sig f9 = in1 + // Check divide by zero. + cmp.ne.unc p0,p7=0,in1 ;; sub in1 = r0, in1 fcvt.xf f8 = f13 @@ -491,6 +541,7 @@ __umodsi3: ;; setf.exp f11 = r2 frcpa.s1 f10, p6 = f8, f9 +(p7) break 1; ;; (p6) fmpy.s1 f12 = f8, f10 (p6) fnma.s1 f10 = f9, f10, f1 @@ -706,9 +757,8 @@ __ia64_trampoline: .endp __ia64_trampoline #endif -#ifdef L__compat // Thunks for backward compatibility. - +#ifdef L_fixtfdi .text .align 16 .global __fixtfti @@ -719,7 +769,8 @@ __fixtfti: ;; } .endp __fixtfti - +#endif +#ifdef L_fixunstfdi .align 16 .global __fixunstfti .proc __fixunstfti @@ -729,7 +780,8 @@ __fixunstfti: ;; } .endp __fixunstfti - +#endif +#if L_floatditf .align 16 .global __floattitf .proc __floattitf @@ -739,5 +791,4 @@ __floattitf: ;; } .endp __floattitf - #endif diff --git a/contrib/gcc/config/ia64/linux-unwind.h b/contrib/gcc/config/ia64/linux-unwind.h new file mode 100644 index 00000000000..8b2878e923a --- /dev/null +++ b/contrib/gcc/config/ia64/linux-unwind.h @@ -0,0 +1,193 @@ +/* DWARF2 EH unwinding support for IA64 Linux. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + In addition to the permissions in the GNU General Public License, + the Free Software Foundation gives you unlimited permission to link + the compiled version of this file with other programs, and to + distribute those programs without any restriction coming from the + use of this file. (The General Public License restrictions do + apply in other respects; for example, they cover modification of + the file, and distribution when not linked into another program.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +/* This works only for glibc-2.3 and later, because sigcontext is different + in glibc-2.2.4. */ + +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) +#include +#include + +#define IA64_GATE_AREA_START 0xa000000000000100LL +#define IA64_GATE_AREA_END 0xa000000000030000LL + +#define MD_FALLBACK_FRAME_STATE_FOR ia64_fallback_frame_state + +static _Unwind_Reason_Code +ia64_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + if (context->rp >= IA64_GATE_AREA_START + && context->rp < IA64_GATE_AREA_END) + { + struct sigframe { + char scratch[16]; + unsigned long sig_number; + struct siginfo *info; + struct sigcontext *sc; + } *frame_ = (struct sigframe *)context->psp; + struct sigcontext *sc = frame_->sc; + + /* Restore scratch registers in case the unwinder needs to + refer to a value stored in one of them. */ + { + int i; + + for (i = 2; i < 4; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + for (i = 8; i < 12; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + for (i = 14; i < 32; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + } + + context->fpsr_loc = &(sc->sc_ar_fpsr); + context->pfs_loc = &(sc->sc_ar_pfs); + context->lc_loc = &(sc->sc_ar_lc); + context->unat_loc = &(sc->sc_ar_unat); + context->br_loc[0] = &(sc->sc_br[0]); + context->br_loc[6] = &(sc->sc_br[6]); + context->br_loc[7] = &(sc->sc_br[7]); + context->pr = sc->sc_pr; + context->psp = sc->sc_gr[12]; + context->gp = sc->sc_gr[1]; + /* Signal frame doesn't have an associated reg. stack frame + other than what we adjust for below. */ + fs -> no_reg_stack_frame = 1; + + if (sc->sc_rbs_base) + { + /* Need to switch from alternate register backing store. */ + long ndirty, loadrs = sc->sc_loadrs >> 16; + unsigned long alt_bspstore = context->bsp - loadrs; + unsigned long bspstore; + unsigned long *ar_bsp = (unsigned long *)(sc->sc_ar_bsp); + + ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, + (unsigned long *) context->bsp); + bspstore = (unsigned long) + ia64_rse_skip_regs (ar_bsp, -ndirty); + ia64_copy_rbs (context, bspstore, alt_bspstore, loadrs, + sc->sc_ar_rnat); + } + + /* Don't touch the branch registers o.t. b0, b6 and b7. + The kernel doesn't pass the preserved branch registers + in the sigcontext but leaves them intact, so there's no + need to do anything with them here. */ + { + unsigned long sof = sc->sc_cfm & 0x7f; + context->bsp = (unsigned long) + ia64_rse_skip_regs ((unsigned long *)(sc->sc_ar_bsp), -sof); + } + + fs->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL; + fs->curr.reg[UNW_REG_RP].val + = (unsigned long)&(sc->sc_ip) - context->psp; + fs->curr.reg[UNW_REG_RP].when = -1; + + return _URC_NO_REASON; + } + return _URC_END_OF_STACK; +} + +#define MD_HANDLE_UNWABI ia64_handle_unwabi + +static void +ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs) +{ + if (fs->unwabi == ((3 << 8) | 's') + || fs->unwabi == ((0 << 8) | 's')) + { + struct sigframe { + char scratch[16]; + unsigned long sig_number; + struct siginfo *info; + struct sigcontext *sc; + } *frame = (struct sigframe *)context->psp; + struct sigcontext *sc = frame->sc; + + /* Restore scratch registers in case the unwinder needs to + refer to a value stored in one of them. */ + { + int i; + + for (i = 2; i < 4; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + for (i = 8; i < 12; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + for (i = 14; i < 32; i++) + context->ireg[i - 2].loc = &sc->sc_gr[i]; + } + + context->pfs_loc = &(sc->sc_ar_pfs); + context->lc_loc = &(sc->sc_ar_lc); + context->unat_loc = &(sc->sc_ar_unat); + context->br_loc[0] = &(sc->sc_br[0]); + context->br_loc[6] = &(sc->sc_br[6]); + context->br_loc[7] = &(sc->sc_br[7]); + context->pr = sc->sc_pr; + context->gp = sc->sc_gr[1]; + /* Signal frame doesn't have an associated reg. stack frame + other than what we adjust for below. */ + fs -> no_reg_stack_frame = 1; + + if (sc->sc_rbs_base) + { + /* Need to switch from alternate register backing store. */ + long ndirty, loadrs = sc->sc_loadrs >> 16; + unsigned long alt_bspstore = context->bsp - loadrs; + unsigned long bspstore; + unsigned long *ar_bsp = (unsigned long *)(sc->sc_ar_bsp); + + ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, + (unsigned long *) context->bsp); + bspstore = (unsigned long) ia64_rse_skip_regs (ar_bsp, -ndirty); + ia64_copy_rbs (context, bspstore, alt_bspstore, loadrs, + sc->sc_ar_rnat); + } + + /* Don't touch the branch registers o.t. b0, b6 and b7. + The kernel doesn't pass the preserved branch registers + in the sigcontext but leaves them intact, so there's no + need to do anything with them here. */ + { + unsigned long sof = sc->sc_cfm & 0x7f; + context->bsp = (unsigned long) + ia64_rse_skip_regs ((unsigned long *)(sc->sc_ar_bsp), -sof); + } + + /* pfs_loc already set above. Without this pfs_loc would point + incorrectly to sc_cfm instead of sc_ar_pfs. */ + fs->curr.reg[UNW_REG_PFS].where = UNW_WHERE_NONE; + } +} +#endif /* glibc-2.3 or better */ diff --git a/contrib/gcc/config/ia64/linux.h b/contrib/gcc/config/ia64/linux.h index 5c73b0c25ef..cecae0dfe32 100644 --- a/contrib/gcc/config/ia64/linux.h +++ b/contrib/gcc/config/ia64/linux.h @@ -37,15 +37,18 @@ do { \ /* Define this for shared library support because it isn't in the main linux.h file. */ +#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2" + #undef LINK_SPEC #define LINK_SPEC "\ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \ %{static:-static}}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" #define JMP_BUF_SIZE 76 @@ -55,161 +58,4 @@ do { \ #undef LINK_EH_SPEC #define LINK_EH_SPEC "" -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -/* This works only for glibc-2.3 and later, because sigcontext is different - in glibc-2.2.4. */ - -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) - -#ifdef IN_LIBGCC2 -#include -#include - -#define IA64_GATE_AREA_START 0xa000000000000100LL -#define IA64_GATE_AREA_END 0xa000000000030000LL - -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - if ((CONTEXT)->rp >= IA64_GATE_AREA_START \ - && (CONTEXT)->rp < IA64_GATE_AREA_END) \ - { \ - struct sigframe { \ - char scratch[16]; \ - unsigned long sig_number; \ - struct siginfo *info; \ - struct sigcontext *sc; \ - } *frame_ = (struct sigframe *)(CONTEXT)->psp; \ - struct sigcontext *sc_ = frame_->sc; \ - \ - /* Restore scratch registers in case the unwinder needs to \ - refer to a value stored in one of them. */ \ - { \ - int i_; \ - \ - for (i_ = 2; i_ < 4; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - for (i_ = 8; i_ < 12; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - for (i_ = 14; i_ < 32; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - } \ - \ - (CONTEXT)->fpsr_loc = &(sc_->sc_ar_fpsr); \ - (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \ - (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \ - (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \ - (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \ - (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \ - (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \ - (CONTEXT)->pr = sc_->sc_pr; \ - (CONTEXT)->psp = sc_->sc_gr[12]; \ - (CONTEXT)->gp = sc_->sc_gr[1]; \ - /* Signal frame doesn't have an associated reg. stack frame \ - other than what we adjust for below. */ \ - (FS) -> no_reg_stack_frame = 1; \ - \ - if (sc_->sc_rbs_base) \ - { \ - /* Need to switch from alternate register backing store. */ \ - long ndirty, loadrs = sc_->sc_loadrs >> 16; \ - unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \ - unsigned long bspstore; \ - unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \ - \ - ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \ - (unsigned long *) (CONTEXT)->bsp);\ - bspstore = (unsigned long) \ - ia64_rse_skip_regs (ar_bsp, -ndirty); \ - ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \ - sc_->sc_ar_rnat); \ - } \ - \ - /* Don't touch the branch registers o.t. b0, b6 and b7. \ - The kernel doesn't pass the preserved branch registers \ - in the sigcontext but leaves them intact, so there's no \ - need to do anything with them here. */ \ - { \ - unsigned long sof = sc_->sc_cfm & 0x7f; \ - (CONTEXT)->bsp = (unsigned long) \ - ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \ - } \ - \ - (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL; \ - (FS)->curr.reg[UNW_REG_RP].val \ - = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp; \ - (FS)->curr.reg[UNW_REG_RP].when = -1; \ - \ - goto SUCCESS; \ - } - -#define MD_HANDLE_UNWABI(CONTEXT, FS) \ - if ((FS)->unwabi == ((3 << 8) | 's') \ - || (FS)->unwabi == ((0 << 8) | 's')) \ - { \ - struct sigframe { \ - char scratch[16]; \ - unsigned long sig_number; \ - struct siginfo *info; \ - struct sigcontext *sc; \ - } *frame_ = (struct sigframe *)(CONTEXT)->psp; \ - struct sigcontext *sc_ = frame_->sc; \ - \ - /* Restore scratch registers in case the unwinder needs to \ - refer to a value stored in one of them. */ \ - { \ - int i_; \ - \ - for (i_ = 2; i_ < 4; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - for (i_ = 8; i_ < 12; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - for (i_ = 14; i_ < 32; i_++) \ - (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \ - } \ - \ - (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \ - (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \ - (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \ - (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \ - (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \ - (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \ - (CONTEXT)->pr = sc_->sc_pr; \ - (CONTEXT)->gp = sc_->sc_gr[1]; \ - /* Signal frame doesn't have an associated reg. stack frame \ - other than what we adjust for below. */ \ - (FS) -> no_reg_stack_frame = 1; \ - \ - if (sc_->sc_rbs_base) \ - { \ - /* Need to switch from alternate register backing store. */ \ - long ndirty, loadrs = sc_->sc_loadrs >> 16; \ - unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \ - unsigned long bspstore; \ - unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \ - \ - ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \ - (unsigned long *) (CONTEXT)->bsp);\ - bspstore = (unsigned long) \ - ia64_rse_skip_regs (ar_bsp, -ndirty); \ - ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \ - sc_->sc_ar_rnat); \ - } \ - \ - /* Don't touch the branch registers o.t. b0, b6 and b7. \ - The kernel doesn't pass the preserved branch registers \ - in the sigcontext but leaves them intact, so there's no \ - need to do anything with them here. */ \ - { \ - unsigned long sof = sc_->sc_cfm & 0x7f; \ - (CONTEXT)->bsp = (unsigned long) \ - ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \ - } \ - \ - /* pfs_loc already set above. Without this pfs_loc would point \ - incorrectly to sc_cfm instead of sc_ar_pfs. */ \ - (FS)->curr.reg[UNW_REG_PFS].where = UNW_WHERE_NONE; \ - } - -#endif /* IN_LIBGCC2 */ -#endif /* glibc-2.3 or better */ +#define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" diff --git a/contrib/gcc/config/ia64/predicates.md b/contrib/gcc/config/ia64/predicates.md new file mode 100644 index 00000000000..657c1501ddb --- /dev/null +++ b/contrib/gcc/config/ia64/predicates.md @@ -0,0 +1,591 @@ +;; Predicate definitions for IA-64. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; True if OP is a valid operand for the MEM of a CALL insn. +(define_predicate "call_operand" + (ior (match_code "symbol_ref") + (match_operand 0 "register_operand"))) + +;; True if OP refers to any kind of symbol. +;; For roughly the same reasons that pmode_register_operand exists, this +;; predicate ignores its mode argument. +(define_special_predicate "symbolic_operand" + (match_code "symbol_ref,const,label_ref")) + +;; True if OP is a SYMBOL_REF which refers to a function. +(define_predicate "function_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_FUNCTION_P (op)"))) + +;; True if OP refers to a symbol in the sdata section. +(define_predicate "sdata_symbolic_operand" + (match_code "symbol_ref,const") +{ + HOST_WIDE_INT offset = 0, size = 0; + + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + offset = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + if (CONSTANT_POOL_ADDRESS_P (op)) + { + size = GET_MODE_SIZE (get_pool_mode (op)); + if (size > ia64_section_threshold) + return false; + } + else + { + tree t; + + if (!SYMBOL_REF_LOCAL_P (op) || !SYMBOL_REF_SMALL_P (op)) + return false; + + /* Note that in addition to DECLs, we can get various forms + of constants here. */ + t = SYMBOL_REF_DECL (op); + if (DECL_P (t)) + t = DECL_SIZE_UNIT (t); + else + t = TYPE_SIZE_UNIT (TREE_TYPE (t)); + if (t && host_integerp (t, 0)) + { + size = tree_low_cst (t, 0); + if (size < 0) + size = 0; + } + } + + /* Deny the stupid user trick of addressing outside the object. Such + things quickly result in GPREL22 relocation overflows. Of course, + they're also highly undefined. From a pure pedant's point of view + they deserve a slap on the wrist (such as provided by a relocation + overflow), but that just leads to bugzilla noise. */ + return (offset >= 0 && offset <= size); + + default: + gcc_unreachable (); + } +}) + +;; True if OP refers to a symbol in the small address area. +(define_predicate "small_addr_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_SMALL_ADDR_P (op); + + default: + gcc_unreachable (); + } +}) + +;; True if OP refers to a symbol with which we may use any offset. +(define_predicate "any_offset_symbol_operand" + (match_code "symbol_ref") +{ + if (TARGET_NO_PIC || TARGET_AUTO_PIC) + return true; + if (SYMBOL_REF_SMALL_ADDR_P (op)) + return true; + if (SYMBOL_REF_FUNCTION_P (op)) + return false; + if (sdata_symbolic_operand (op, mode)) + return true; + return false; +}) + +;; True if OP refers to a symbol with which we may use 14-bit aligned offsets. +;; False if OP refers to a symbol with which we may not use any offset at any +;; time. +(define_predicate "aligned_offset_symbol_operand" + (and (match_code "symbol_ref") + (match_test "! SYMBOL_REF_FUNCTION_P (op)"))) + +;; True if OP refers to a symbol, and is appropriate for a GOT load. +(define_predicate "got_symbolic_operand" + (match_operand 0 "symbolic_operand" "") +{ + HOST_WIDE_INT addend = 0; + + switch (GET_CODE (op)) + { + case LABEL_REF: + return true; + + case CONST: + /* Accept only (plus (symbol_ref) (const_int)). */ + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + addend = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + /* These symbols shouldn't be used with got loads. */ + if (SYMBOL_REF_SMALL_ADDR_P (op)) + return false; + if (SYMBOL_REF_TLS_MODEL (op) != 0) + return false; + + if (any_offset_symbol_operand (op, mode)) + return true; + + /* The low 14 bits of the constant have been forced to zero + so that we do not use up so many GOT entries. Prevent cse + from undoing this. */ + if (aligned_offset_symbol_operand (op, mode)) + return (addend & 0x3fff) == 0; + + return addend == 0; + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a valid thread local storage symbolic operand. +(define_predicate "tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) != 0; + + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + /* We only allow certain offsets for certain tls models. */ + switch (SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + case TLS_MODEL_LOCAL_DYNAMIC: + return false; + + case TLS_MODEL_INITIAL_EXEC: + return (INTVAL (XEXP (op, 1)) & 0x3fff) == 0; + + case TLS_MODEL_LOCAL_EXEC: + return true; + + default: + return false; + } + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a local-dynamic thread local storage symbolic operand. +(define_predicate "ld_tls_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_DYNAMIC"))) + +;; Return true if OP is an initial-exec thread local storage symbolic operand. +(define_predicate "ie_tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT + || (INTVAL (XEXP (op, 1)) & 0x3fff) != 0) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_INITIAL_EXEC; + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a local-exec thread local storage symbolic operand. +(define_predicate "le_tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC; + + default: + gcc_unreachable (); + } +}) + +;; Like nonimmediate_operand, but don't allow MEMs that try to use a +;; POST_MODIFY with a REG as displacement. +(define_predicate "destination_operand" + (and (match_operand 0 "nonimmediate_operand") + (match_test "GET_CODE (op) != MEM + || GET_CODE (XEXP (op, 0)) != POST_MODIFY + || GET_CODE (XEXP (XEXP (XEXP (op, 0), 1), 1)) != REG"))) + +;; Like memory_operand, but don't allow post-increments. +(define_predicate "not_postinc_memory_operand" + (and (match_operand 0 "memory_operand") + (match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC"))) + +;; True if OP is a general operand, with some restrictions on symbols. +(define_predicate "move_operand" + (match_operand 0 "general_operand") +{ + switch (GET_CODE (op)) + { + case CONST: + { + HOST_WIDE_INT addend; + + /* Accept only (plus (symbol_ref) (const_int)). */ + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + addend = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + + /* After reload, we want to allow any offset whatsoever. This + allows reload the opportunity to avoid spilling addresses to + the stack, and instead simply substitute in the value from a + REG_EQUIV. We'll split this up again when splitting the insn. */ + if (reload_in_progress || reload_completed) + return true; + + /* Some symbol types we allow to use with any offset. */ + if (any_offset_symbol_operand (op, mode)) + return true; + + /* Some symbol types we allow offsets with the low 14 bits of the + constant forced to zero so that we do not use up so many GOT + entries. We want to prevent cse from undoing this. */ + if (aligned_offset_symbol_operand (op, mode)) + return (addend & 0x3fff) == 0; + + /* The remaining symbol types may never be used with an offset. */ + return false; + } + + default: + return true; + } +}) + +;; True if OP is a register operand that is (or could be) a GR reg. +(define_predicate "gr_register_operand" + (match_operand 0 "register_operand") +{ + unsigned int regno; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER || GENERAL_REGNO_P (regno)); +}) + +;; True if OP is a register operand that is (or could be) an FR reg. +(define_predicate "fr_register_operand" + (match_operand 0 "register_operand") +{ + unsigned int regno; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER || FR_REGNO_P (regno)); +}) + +;; True if OP is a register operand that is (or could be) a GR/FR reg. +(define_predicate "grfr_register_operand" + (match_operand 0 "register_operand") +{ + unsigned int regno; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER + || GENERAL_REGNO_P (regno) + || FR_REGNO_P (regno)); +}) + +;; True if OP is a nonimmediate operand that is (or could be) a GR reg. +(define_predicate "gr_nonimmediate_operand" + (match_operand 0 "nonimmediate_operand") +{ + unsigned int regno; + + if (GET_CODE (op) == MEM) + return true; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER || GENERAL_REGNO_P (regno)); +}) + +;; True if OP is a nonimmediate operand that is (or could be) a FR reg. +(define_predicate "fr_nonimmediate_operand" + (match_operand 0 "nonimmediate_operand") +{ + unsigned int regno; + + if (GET_CODE (op) == MEM) + return true; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER || FR_REGNO_P (regno)); +}) + +;; True if OP is a nonimmediate operand that is (or could be) a GR/FR reg. +(define_predicate "grfr_nonimmediate_operand" + (match_operand 0 "nonimmediate_operand") +{ + unsigned int regno; + + if (GET_CODE (op) == MEM) + return true; + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + regno = REGNO (op); + return (regno >= FIRST_PSEUDO_REGISTER + || GENERAL_REGNO_P (regno) + || FR_REGNO_P (regno)); +}) + +;; True if OP is a GR register operand, or zero. +(define_predicate "gr_reg_or_0_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (GET_MODE (op))")))) + +;; True if OP is a GR register operand, or a 5 bit immediate operand. +(define_predicate "gr_reg_or_5bit_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) < 32")))) + +;; True if OP is a GR register operand, or a 6 bit immediate operand. +(define_predicate "gr_reg_or_6bit_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_M (INTVAL (op))")))) + +;; True if OP is a GR register operand, or an 8 bit immediate operand. +(define_predicate "gr_reg_or_8bit_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_K (INTVAL (op))")))) + +;; True if OP is a GR/FR register operand, or an 8 bit immediate operand. +(define_predicate "grfr_reg_or_8bit_operand" + (ior (match_operand 0 "grfr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_K (INTVAL (op))")))) + +;; True if OP is a register operand, or an 8 bit adjusted immediate operand. +(define_predicate "gr_reg_or_8bit_adjusted_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_L (INTVAL (op))")))) + +;; True if OP is a register operand, or is valid for both an 8 bit +;; immediate and an 8 bit adjusted immediate operand. This is necessary +;; because when we emit a compare, we don't know what the condition will be, +;; so we need the union of the immediates accepted by GT and LT. +(define_predicate "gr_reg_or_8bit_and_adjusted_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_K (INTVAL (op)) + && CONST_OK_FOR_L (INTVAL (op))")))) + +;; True if OP is a register operand, or a 14 bit immediate operand. +(define_predicate "gr_reg_or_14bit_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_I (INTVAL (op))")))) + +;; True if OP is a register operand, or a 22 bit immediate operand. +(define_predicate "gr_reg_or_22bit_operand" + (ior (match_operand 0 "gr_register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_J (INTVAL (op))")))) + +;; True if OP is a 7 bit immediate operand. +(define_predicate "dshift_count_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) < 128"))) + +;; True if OP is a 6 bit immediate operand. +(define_predicate "shift_count_operand" + (and (match_code "const_int") + (match_test "CONST_OK_FOR_M (INTVAL (op))"))) + +;; True if OP-1 is a 6 bit immediate operand, used in extr instruction. +(define_predicate "extr_len_operand" + (and (match_code "const_int") + (match_test "CONST_OK_FOR_M (INTVAL (op) - 1)"))) + +;; True if OP is a 5 bit immediate operand. +(define_predicate "shift_32bit_count_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) < 32"))) + +;; True if OP is one of the immediate values 2, 4, 8, or 16. +(define_predicate "shladd_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 2 || INTVAL (op) == 4 || + INTVAL (op) == 8 || INTVAL (op) == 16"))) + +;; True if OP is one of the immediate values 1, 2, 3, or 4. +(define_predicate "shladd_log2_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 1 && INTVAL (op) <= 4"))) + +;; True if OP is one of the immediate values -16, -8, -4, -1, 1, 4, 8, 16. +(define_predicate "fetchadd_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == -16 || INTVAL (op) == -8 || + INTVAL (op) == -4 || INTVAL (op) == -1 || + INTVAL (op) == 1 || INTVAL (op) == 4 || + INTVAL (op) == 8 || INTVAL (op) == 16"))) + +;; True if OP is 0..3. +(define_predicate "const_int_2bit_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 3"))) + +;; True if OP is a floating-point constant zero, one, or a register. +(define_predicate "fr_reg_or_fp01_operand" + (ior (match_operand 0 "fr_register_operand") + (and (match_code "const_double") + (match_test "CONST_DOUBLE_OK_FOR_G (op)")))) + +;; Like fr_reg_or_fp01_operand, but don't allow any SUBREGs. +(define_predicate "xfreg_or_fp01_operand" + (and (match_operand 0 "fr_reg_or_fp01_operand") + (not (match_code "subreg")))) + +;; True if OP is a constant zero, or a register. +(define_predicate "fr_reg_or_0_operand" + (ior (match_operand 0 "fr_register_operand") + (and (match_code "const_double,const_vector") + (match_test "op == CONST0_RTX (GET_MODE (op))")))) + +;; True if this is a comparison operator, which accepts a normal 8-bit +;; signed immediate operand. +(define_predicate "normal_comparison_operator" + (match_code "eq,ne,gt,le,gtu,leu")) + +;; True if this is a comparison operator, which accepts an adjusted 8-bit +;; signed immediate operand. +(define_predicate "adjusted_comparison_operator" + (match_code "lt,ge,ltu,geu")) + +;; True if this is a signed inequality operator. +(define_predicate "signed_inequality_operator" + (match_code "ge,gt,le,lt")) + +;; True if this operator is valid for predication. +(define_predicate "predicate_operator" + (match_code "eq,ne")) + +;; True if this operator can be used in a conditional operation. +(define_predicate "condop_operator" + (match_code "plus,minus,ior,xor,and")) + +;; These three are hardware registers that can only be addressed in +;; DImode. It's not strictly necessary to test mode == DImode here, +;; but it makes decent insurance against someone writing a +;; match_operand wrong. + +;; True if this is the ar.lc register. +(define_predicate "ar_lc_reg_operand" + (and (match_code "reg") + (match_test "mode == DImode && REGNO (op) == AR_LC_REGNUM"))) + +;; True if this is the ar.ccv register. +(define_predicate "ar_ccv_reg_operand" + (and (match_code "reg") + (match_test "mode == DImode && REGNO (op) == AR_CCV_REGNUM"))) + +;; True if this is the ar.pfs register. +(define_predicate "ar_pfs_reg_operand" + (and (match_code "reg") + (match_test "mode == DImode && REGNO (op) == AR_PFS_REGNUM"))) + +;; True if OP is valid as a base register in a reg + offset address. +;; ??? Should I copy the flag_omit_frame_pointer and cse_not_expected +;; checks from pa.c basereg_operand as well? Seems to be OK without them +;; in test runs. +(define_predicate "basereg_operand" + (match_operand 0 "register_operand") +{ + return REG_P (op) && REG_POINTER (op); +}) + diff --git a/contrib/gcc/config/ia64/quadlib.c b/contrib/gcc/config/ia64/quadlib.c index cc367ea03cf..e4bff7839e5 100644 --- a/contrib/gcc/config/ia64/quadlib.c +++ b/contrib/gcc/config/ia64/quadlib.c @@ -24,8 +24,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ extern int _U_Qfcmp (long double a, long double b, int); diff --git a/contrib/gcc/config/ia64/sync.md b/contrib/gcc/config/ia64/sync.md new file mode 100644 index 00000000000..43ad28bbd7b --- /dev/null +++ b/contrib/gcc/config/ia64/sync.md @@ -0,0 +1,178 @@ +;; GCC machine description for IA-64 synchronization instructions. +;; Copyright (C) 2005 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_mode_macro IMODE [QI HI SI DI]) +(define_mode_macro I124MODE [QI HI SI]) +(define_mode_macro I48MODE [SI DI]) +(define_mode_attr modesuffix [(QI "1") (HI "2") (SI "4") (DI "8")]) + +(define_code_macro FETCHOP [plus minus ior xor and]) +(define_code_attr fetchop_name + [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) + +(define_insn "memory_barrier" + [(set (mem:BLK (match_scratch:DI 0 "X")) + (unspec:BLK [(mem:BLK (match_scratch:DI 1 "X"))] UNSPEC_MF))] + "" + "mf" + [(set_attr "itanium_class" "syst_m")]) + +(define_insn "fetchadd_acq_" + [(set (match_operand:I48MODE 0 "gr_register_operand" "=r") + (match_operand:I48MODE 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (unspec:I48MODE [(match_dup 1) + (match_operand:I48MODE 2 "fetchadd_operand" "n")] + UNSPEC_FETCHADD_ACQ))] + "" + "fetchadd.acq %0 = %1, %2" + [(set_attr "itanium_class" "sem")]) + +(define_expand "sync_" + [(set (match_operand:IMODE 0 "memory_operand" "") + (FETCHOP:IMODE (match_dup 0) + (match_operand:IMODE 1 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[0], operands[1], NULL, NULL); + DONE; +}) + +(define_expand "sync_nand" + [(set (match_operand:IMODE 0 "memory_operand" "") + (and:IMODE (not:IMODE (match_dup 0)) + (match_operand:IMODE 1 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[0], operands[1], NULL, NULL); + DONE; +}) + +(define_expand "sync_old_" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (FETCHOP:IMODE + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[1], operands[2], operands[0], NULL); + DONE; +}) + +(define_expand "sync_old_nand" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (and:IMODE + (not:IMODE (match_operand:IMODE 1 "memory_operand" "")) + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[1], operands[2], operands[0], NULL); + DONE; +}) + +(define_expand "sync_new_" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (FETCHOP:IMODE + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[1], operands[2], NULL, operands[0]); + DONE; +}) + +(define_expand "sync_new_nand" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (and:IMODE + (not:IMODE (match_operand:IMODE 1 "memory_operand" "")) + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[1], operands[2], NULL, operands[0]); + DONE; +}) + +(define_expand "sync_compare_and_swap" + [(match_operand:IMODE 0 "gr_register_operand" "") + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "gr_register_operand" "") + (match_operand:IMODE 3 "gr_register_operand" "")] + "" +{ + rtx ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); + rtx dst; + + convert_move (ccv, operands[2], 1); + + dst = operands[0]; + if (GET_MODE (dst) != DImode) + dst = gen_reg_rtx (DImode); + + emit_insn (gen_memory_barrier ()); + emit_insn (gen_cmpxchg_rel_ (dst, operands[1], ccv, operands[3])); + + if (dst != operands[0]) + emit_move_insn (operands[0], gen_lowpart (mode, dst)); + DONE; +}) + +(define_insn "cmpxchg_rel_" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (zero_extend:DI + (match_operand:I124MODE 1 "not_postinc_memory_operand" "+S"))) + (set (match_dup 1) + (unspec:I124MODE + [(match_dup 1) + (match_operand:DI 2 "ar_ccv_reg_operand" "") + (match_operand:I124MODE 3 "gr_register_operand" "r")] + UNSPEC_CMPXCHG_ACQ))] + "" + "cmpxchg.rel %0 = %1, %3, %2" + [(set_attr "itanium_class" "sem")]) + +(define_insn "cmpxchg_rel_di" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (match_operand:DI 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (unspec:DI [(match_dup 1) + (match_operand:DI 2 "ar_ccv_reg_operand" "") + (match_operand:DI 3 "gr_register_operand" "r")] + UNSPEC_CMPXCHG_ACQ))] + "" + "cmpxchg8.rel %0 = %1, %3, %2" + [(set_attr "itanium_class" "sem")]) + +(define_insn "sync_lock_test_and_set" + [(set (match_operand:IMODE 0 "gr_register_operand" "=r") + (match_operand:IMODE 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (match_operand:IMODE 2 "gr_register_operand" "r"))] + "" + "xchg %0 = %1, %2" + [(set_attr "itanium_class" "sem")]) + +(define_expand "sync_lock_release" + [(set (match_operand:IMODE 0 "memory_operand" "") + (match_operand:IMODE 1 "gr_reg_or_0_operand" ""))] + "" +{ + gcc_assert (MEM_VOLATILE_P (operands[0])); +}) diff --git a/contrib/gcc/config/ia64/sysv4.h b/contrib/gcc/config/ia64/sysv4.h index 15a57d924cd..795b6ea7559 100644 --- a/contrib/gcc/config/ia64/sysv4.h +++ b/contrib/gcc/config/ia64/sysv4.h @@ -1,5 +1,8 @@ /* Override definitions in elfos.h/svr4.h to be correct for IA64. */ +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS ia64_sysv4_init_libfuncs + /* We want DWARF2 as specified by the IA64 ABI. */ #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG @@ -43,9 +46,9 @@ extern int size_directive_output; #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ do { \ if ((DECL) && sdata_symbolic_operand (XEXP (DECL_RTL (DECL), 0), Pmode)) \ - sbss_section (); \ + switch_to_section (sbss_section); \ else \ - bss_section (); \ + switch_to_section (bss_section); \ ASM_OUTPUT_ALIGN (FILE, floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \ ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \ @@ -118,39 +121,10 @@ do { \ } while (0) /* Override default elf definition. */ +#undef TARGET_ASM_RELOC_RW_MASK +#define TARGET_ASM_RELOC_RW_MASK ia64_reloc_rw_mask #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION ia64_select_rtx_section -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_sdata, in_sbss - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - SDATA_SECTION_FUNCTION \ - SBSS_SECTION_FUNCTION - #define SDATA_SECTION_ASM_OP "\t.sdata" - -#define SDATA_SECTION_FUNCTION \ -void \ -sdata_section (void) \ -{ \ - if (in_section != in_sdata) \ - { \ - fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ - in_section = in_sdata; \ - } \ -} - #define SBSS_SECTION_ASM_OP "\t.sbss" - -#define SBSS_SECTION_FUNCTION \ -void \ -sbss_section (void) \ -{ \ - if (in_section != in_sbss) \ - { \ - fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ - in_section = in_sbss; \ - } \ -} diff --git a/contrib/gcc/config/ia64/t-hpux b/contrib/gcc/config/ia64/t-hpux index d89f174592c..b925c73a512 100644 --- a/contrib/gcc/config/ia64/t-hpux +++ b/contrib/gcc/config/ia64/t-hpux @@ -7,9 +7,15 @@ MULTILIB_OPTIONS = milp32/mlp64 MULTILIB_DIRNAMES = hpux32 hpux64 MULTILIB_MATCHES = +# On HP-UX we do not want _fixtfdi, _fixunstfdi, or _floatditf from +# LIB1ASMSRC. These functions map the 128 bit conversion function names +# to 80 bit conversions and were done for Linux backwards compatibility. + +LIB1ASMFUNCS := $(filter-out _fixtfdi _fixunstfdi _floatditf,$(LIB1ASMFUNCS)) + # Support routines for HP-UX 128 bit floats. -LIB2FUNCS_EXTRA=quadlib.c +LIB2FUNCS_EXTRA=quadlib.c $(srcdir)/config/floatunsitf.c quadlib.c: $(srcdir)/config/ia64/quadlib.c cat $(srcdir)/config/ia64/quadlib.c > quadlib.c @@ -32,14 +38,19 @@ SHLIB_EXT = .so # DT_NEEDED entry for libunwind. SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ -Wl,+h,@shlib_base_name@.so.0 \ - -o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lunwind -lc && \ - rm -f @shlib_base_name@.so.0 && \ - $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0 + -o @multilib_dir@/@shlib_base_name@.so @multilib_flags@ \ + @shlib_objs@ -lunwind -lc && \ + rm -f @multilib_dir@/@shlib_base_name@.so.0 && \ + $(LN_S) @shlib_base_name@.so @multilib_dir@/@shlib_base_name@.so.0 # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. -SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so.0; \ - rm -f $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so; \ - $(LN_S) @shlib_base_name@.so.0 $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so; \ - chmod +x $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so +SHLIB_INSTALL = \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \ + $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so \ + $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so.0; \ + rm -f $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \ + $(LN_S) @shlib_base_name@.so.0 \ + $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \ + chmod +x $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk diff --git a/contrib/gcc/config/ia64/t-ia64 b/contrib/gcc/config/ia64/t-ia64 index 21d37a79a92..60535882bb7 100644 --- a/contrib/gcc/config/ia64/t-ia64 +++ b/contrib/gcc/config/ia64/t-ia64 @@ -8,7 +8,8 @@ LIB1ASMSRC = ia64/lib1funcs.asm LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \ __divdi3 __moddi3 __udivdi3 __umoddi3 \ __divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \ - __nonlocal_goto __restore_stack_nonlocal __trampoline __compat + __nonlocal_goto __restore_stack_nonlocal __trampoline \ + _fixtfdi _fixunstfdi _floatditf # ??? Hack to get -P option used when compiling lib1funcs.asm, because Intel # assembler does not accept # line number as a comment. @@ -41,7 +42,7 @@ crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES) $(srcdir)/config/ia64/crtfastmath.c LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \ - $(srcdir)/unwind-c.c $(srcdir)/gthr-gnat.c + $(srcdir)/unwind-c.c ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h @@ -49,3 +50,5 @@ ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \ # genattrtab generates very long string literals. insn-attrtab.o-warn = -Wno-error + +ia64.o: debug.h $(PARAMS_H) diff --git a/contrib/gcc/config/ia64/unwind-ia64.c b/contrib/gcc/config/ia64/unwind-ia64.c index a49652e99ab..fc7b20701cd 100644 --- a/contrib/gcc/config/ia64/unwind-ia64.c +++ b/contrib/gcc/config/ia64/unwind-ia64.c @@ -1,6 +1,6 @@ /* Subroutines needed for unwinding IA-64 standard format stack frame info for exception handling. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Andrew MacLeod Andrew Haley @@ -20,8 +20,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, @@ -44,6 +44,7 @@ #undef ENABLE_MALLOC_CHECKING #ifndef __USING_SJLJ_EXCEPTIONS__ + #define UNW_VER(x) ((x) >> 48) #define UNW_FLAG_MASK 0x0000ffff00000000 #define UNW_FLAG_OSMASK 0x0000f00000000000 @@ -284,10 +285,10 @@ atomic_free (unsigned int *mask, int bit) #define PTR_IN(X, P) ((P) >= (X) && (P) < (X) + SIZE (X)) static struct unw_reg_state emergency_reg_state[32]; -static int emergency_reg_state_free = MASK_FOR (emergency_reg_state); +static unsigned int emergency_reg_state_free = MASK_FOR (emergency_reg_state); static struct unw_labeled_state emergency_labeled_state[8]; -static int emergency_labeled_state_free = MASK_FOR (emergency_labeled_state); +static unsigned int emergency_labeled_state_free = MASK_FOR (emergency_labeled_state); #ifdef ENABLE_MALLOC_CHECKING static int reg_state_alloced; @@ -1703,6 +1704,13 @@ _Unwind_GetIP (struct _Unwind_Context *context) return context->rp; } +inline _Unwind_Ptr +_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn) +{ + *ip_before_insn = 0; + return context->rp; +} + /* Overwrite the return address for CONTEXT with VAL. */ inline void @@ -1754,6 +1762,9 @@ _Unwind_GetBSP (struct _Unwind_Context *context) return (_Unwind_Ptr) context->bsp; } +#ifdef MD_UNWIND_SUPPORT +#include MD_UNWIND_SUPPORT +#endif static _Unwind_Reason_Code uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) @@ -1777,7 +1788,8 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) os-specific fallback mechanism. This will necessarily not provide a personality routine or LSDA. */ #ifdef MD_FALLBACK_FRAME_STATE_FOR - MD_FALLBACK_FRAME_STATE_FOR (context, fs, success); + if (MD_FALLBACK_FRAME_STATE_FOR (context, fs) == _URC_NO_REASON) + return _URC_NO_REASON; /* [SCRA 11.4.1] A leaf function with no memory stack, no exception handlers, and which keeps the return value in B0 does not need @@ -1792,15 +1804,10 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) fs->curr.reg[UNW_REG_RP].where = UNW_WHERE_BR; fs->curr.reg[UNW_REG_RP].when = -1; fs->curr.reg[UNW_REG_RP].val = 0; - goto success; + return _URC_NO_REASON; } - - return _URC_END_OF_STACK; - success: - return _URC_NO_REASON; -#else - return _URC_END_OF_STACK; #endif + return _URC_END_OF_STACK; } context->region_start = ent->start_offset + segment_base; @@ -2060,6 +2067,12 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs) } } +static void +uw_advance_context (struct _Unwind_Context *context, _Unwind_FrameState *fs) +{ + uw_update_context (context, fs); +} + /* Fill in CONTEXT for top-of-stack. The only valid registers at this level will be the return address and the CFA. Note that CFA = SP+16. */ @@ -2111,7 +2124,7 @@ uw_init_context_1 (struct _Unwind_Context *context, void *bsp) uw_update_context (context, &fs); } -/* Install (ie longjmp to) the contents of TARGET. */ +/* Install (i.e. longjmp to) the contents of TARGET. */ static void __attribute__((noreturn)) uw_install_context (struct _Unwind_Context *current __attribute__((unused)), @@ -2389,7 +2402,6 @@ uw_identify_context (struct _Unwind_Context *context) alias (_Unwind_Backtrace); alias (_Unwind_DeleteException); alias (_Unwind_FindEnclosingFunction); -alias (_Unwind_FindTableEntry); alias (_Unwind_ForcedUnwind); alias (_Unwind_GetBSP); alias (_Unwind_GetCFA); diff --git a/contrib/gcc/config/ia64/unwind-ia64.h b/contrib/gcc/config/ia64/unwind-ia64.h index 053829f11e9..09b4a98faec 100644 --- a/contrib/gcc/config/ia64/unwind-ia64.h +++ b/contrib/gcc/config/ia64/unwind-ia64.h @@ -16,8 +16,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ struct unw_table_entry { diff --git a/contrib/gcc/config/ia64/vect.md b/contrib/gcc/config/ia64/vect.md new file mode 100644 index 00000000000..94380bfcc49 --- /dev/null +++ b/contrib/gcc/config/ia64/vect.md @@ -0,0 +1,1304 @@ +;; IA-64 machine description for vector operations. +;; Copyright (C) 2004, 2005 +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;; Integer vector operations + +(define_mode_macro VECINT [V8QI V4HI V2SI]) +(define_mode_macro VECINT12 [V8QI V4HI]) +(define_mode_macro VECINT24 [V4HI V2SI]) +(define_mode_attr vecsize [(V8QI "1") (V4HI "2") (V2SI "4")]) + +(define_expand "mov" + [(set (match_operand:VECINT 0 "general_operand" "") + (match_operand:VECINT 1 "general_operand" ""))] + "" +{ + rtx op1 = ia64_expand_move (operands[0], operands[1]); + if (!op1) + DONE; + operands[1] = op1; +}) + +(define_insn "*mov_internal" + [(set (match_operand:VECINT 0 "destination_operand" + "=r,r,r,r,m ,*f ,*f,Q ,r ,*f") + (match_operand:VECINT 1 "move_operand" + "rU,W,i,m,rU,U*f,Q ,*f,*f,r "))] + "ia64_move_ok (operands[0], operands[1])" + "@ + mov %0 = %r1 + addl %0 = %v1, r0 + movl %0 = %v1 + ld8%O1 %0 = %1%P1 + st8%Q0 %0 = %r1%P0 + mov %0 = %F1 + ldf8 %0 = %1%P1 + stf8 %0 = %1%P0 + getf.sig %0 = %1 + setf.sig %0 = %1" + [(set_attr "itanium_class" "ialu,ialu,long_i,ld,st,fmisc,fld,stf,frfr,tofr")]) + +(define_insn "one_cmpl2" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (not:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))] + "" + "andcm %0 = -1, %1" + [(set_attr "itanium_class" "ilog")]) + +(define_insn "and3" + [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f") + (and:VECINT + (match_operand:VECINT 1 "grfr_register_operand" "r,*f") + (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))] + "" + "@ + and %0 = %2, %1 + fand %0 = %2, %1" + [(set_attr "itanium_class" "ilog,fmisc")]) + +(define_insn "*andnot" + [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f") + (and:VECINT + (not:VECINT (match_operand:VECINT 1 "grfr_register_operand" "r,*f")) + (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))] + "" + "@ + andcm %0 = %2, %1 + fandcm %0 = %2, %1" + [(set_attr "itanium_class" "ilog,fmisc")]) + +(define_insn "ior3" + [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f") + (ior:VECINT + (match_operand:VECINT 1 "grfr_register_operand" "r,*f") + (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))] + "" + "@ + or %0 = %2, %1 + for %0 = %2, %1" + [(set_attr "itanium_class" "ilog,fmisc")]) + +(define_insn "xor3" + [(set (match_operand:VECINT 0 "grfr_register_operand" "=r,*f") + (xor:VECINT + (match_operand:VECINT 1 "grfr_register_operand" "r,*f") + (match_operand:VECINT 2 "grfr_reg_or_8bit_operand" "r,*f")))] + "" + "@ + xor %0 = %2, %1 + fxor %0 = %2, %1" + [(set_attr "itanium_class" "ilog,fmisc")]) + +(define_insn "neg2" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (neg:VECINT (match_operand:VECINT 1 "gr_register_operand" "r")))] + "" + "psub %0 = r0, %1" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "add3" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (plus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r") + (match_operand:VECINT 2 "gr_register_operand" "r")))] + "" + "padd %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "*ssadd3" + [(set (match_operand:VECINT12 0 "gr_register_operand" "=r") + (ss_plus:VECINT12 + (match_operand:VECINT12 1 "gr_register_operand" "r") + (match_operand:VECINT12 2 "gr_register_operand" "r")))] + "" + "padd.sss %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "*usadd3" + [(set (match_operand:VECINT12 0 "gr_register_operand" "=r") + (us_plus:VECINT12 + (match_operand:VECINT12 1 "gr_register_operand" "r") + (match_operand:VECINT12 2 "gr_register_operand" "r")))] + "" + "padd.uuu %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "sub3" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (minus:VECINT (match_operand:VECINT 1 "gr_register_operand" "r") + (match_operand:VECINT 2 "gr_register_operand" "r")))] + "" + "psub %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "*sssub3" + [(set (match_operand:VECINT12 0 "gr_register_operand" "=r") + (ss_minus:VECINT12 + (match_operand:VECINT12 1 "gr_register_operand" "r") + (match_operand:VECINT12 2 "gr_register_operand" "r")))] + "" + "psub.sss %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "*ussub3" + [(set (match_operand:VECINT12 0 "gr_register_operand" "=r") + (us_minus:VECINT12 + (match_operand:VECINT12 1 "gr_register_operand" "r") + (match_operand:VECINT12 2 "gr_register_operand" "r")))] + "" + "psub.uuu %0 = %1, %2" + [(set_attr "itanium_class" "mmalua")]) + +(define_expand "mulv8qi3" + [(set (match_operand:V8QI 0 "gr_register_operand" "") + (mult:V8QI (match_operand:V8QI 1 "gr_register_operand" "r") + (match_operand:V8QI 2 "gr_register_operand" "r")))] + "" +{ + rtx r1, l1, r2, l2, rm, lm; + + r1 = gen_reg_rtx (V4HImode); + l1 = gen_reg_rtx (V4HImode); + r2 = gen_reg_rtx (V4HImode); + l2 = gen_reg_rtx (V4HImode); + + /* Zero-extend the QImode elements into two words of HImode elements + by interleaving them with zero bytes. */ + emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r1), + operands[1], CONST0_RTX (V8QImode))); + emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r2), + operands[2], CONST0_RTX (V8QImode))); + emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l1), + operands[1], CONST0_RTX (V8QImode))); + emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l2), + operands[2], CONST0_RTX (V8QImode))); + + /* Multiply. */ + rm = gen_reg_rtx (V4HImode); + lm = gen_reg_rtx (V4HImode); + emit_insn (gen_mulv4hi3 (rm, r1, r2)); + emit_insn (gen_mulv4hi3 (lm, l1, l2)); + + /* Zap the high order bytes of the HImode elements by overwriting those + in one part with the low order bytes of the other. */ + emit_insn (gen_mix1_r (operands[0], + gen_lowpart (V8QImode, rm), + gen_lowpart (V8QImode, lm))); + DONE; +}) + +(define_insn "mulv4hi3" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (mult:V4HI (match_operand:V4HI 1 "gr_register_operand" "r") + (match_operand:V4HI 2 "gr_register_operand" "r")))] + "" + "pmpyshr2 %0 = %1, %2, 0" + [(set_attr "itanium_class" "mmmul")]) + +(define_insn "pmpy2_r" + [(set (match_operand:V2SI 0 "gr_register_operand" "=r") + (mult:V2SI + (vec_select:V2SI + (sign_extend:V4SI + (match_operand:V4HI 1 "gr_register_operand" "r")) + (parallel [(const_int 0) (const_int 2)])) + (vec_select:V2SI + (sign_extend:V4SI + (match_operand:V4HI 2 "gr_register_operand" "r")) + (parallel [(const_int 0) (const_int 2)]))))] + "" + "pmpy2.r %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "pmpy2_l" + [(set (match_operand:V2SI 0 "gr_register_operand" "=r") + (mult:V2SI + (vec_select:V2SI + (sign_extend:V4SI + (match_operand:V4HI 1 "gr_register_operand" "r")) + (parallel [(const_int 1) (const_int 3)])) + (vec_select:V2SI + (sign_extend:V4SI + (match_operand:V4HI 2 "gr_register_operand" "r")) + (parallel [(const_int 1) (const_int 3)]))))] + "" + "pmpy2.l %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_expand "umax3" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (umax:VECINT (match_operand:VECINT 1 "gr_register_operand" "") + (match_operand:VECINT 2 "gr_register_operand" "")))] + "" +{ + if (ia64_expand_vecint_minmax (UMAX, mode, operands)) + DONE; +}) + +(define_expand "smax3" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (smax:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))] + "" +{ + if (ia64_expand_vecint_minmax (SMAX, mode, operands)) + DONE; +}) + +(define_expand "umin3" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (umin:VECINT (match_operand:VECINT 1 "gr_register_operand" "") + (match_operand:VECINT 2 "gr_register_operand" "")))] + "" +{ + if (ia64_expand_vecint_minmax (UMIN, mode, operands)) + DONE; +}) + +(define_expand "smin3" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (smin:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))] + "" +{ + if (ia64_expand_vecint_minmax (SMIN, mode, operands)) + DONE; +}) + +(define_insn "*umaxv8qi3" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (umax:V8QI (match_operand:V8QI 1 "gr_register_operand" "r") + (match_operand:V8QI 2 "gr_register_operand" "r")))] + "" + "pmax1.u %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*smaxv4hi3" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (smax:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))] + "" + "pmax2 %0 = %r1, %r2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*uminv8qi3" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (umin:V8QI (match_operand:V8QI 1 "gr_register_operand" "r") + (match_operand:V8QI 2 "gr_register_operand" "r")))] + "" + "pmin1.u %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*sminv4hi3" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (smin:V4HI (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")))] + "" + "pmin2 %0 = %r1, %r2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "ashl3" + [(set (match_operand:VECINT24 0 "gr_register_operand" "=r") + (ashift:VECINT24 + (match_operand:VECINT24 1 "gr_register_operand" "r") + (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))] + "" + "pshl %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "ashr3" + [(set (match_operand:VECINT24 0 "gr_register_operand" "=r") + (ashiftrt:VECINT24 + (match_operand:VECINT24 1 "gr_register_operand" "r") + (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))] + "" + "pshr %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "lshr3" + [(set (match_operand:VECINT24 0 "gr_register_operand" "=r") + (lshiftrt:VECINT24 + (match_operand:VECINT24 1 "gr_register_operand" "r") + (match_operand:DI 2 "gr_reg_or_5bit_operand" "rn")))] + "" + "pshr.u %0 = %1, %2" + [(set_attr "itanium_class" "mmshf")]) + +(define_expand "vec_shl_" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (ashift:DI (match_operand:VECINT 1 "gr_register_operand" "") + (match_operand:DI 2 "gr_reg_or_6bit_operand" "")))] + "" +{ + operands[0] = gen_lowpart (DImode, operands[0]); + operands[1] = gen_lowpart (DImode, operands[1]); +}) + +(define_expand "vec_shr_" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (lshiftrt:DI (match_operand:VECINT 1 "gr_register_operand" "") + (match_operand:DI 2 "gr_reg_or_6bit_operand" "")))] + "" +{ + operands[0] = gen_lowpart (DImode, operands[0]); + operands[1] = gen_lowpart (DImode, operands[1]); +}) + +(define_expand "widen_usumv8qi3" + [(match_operand:V4HI 0 "gr_register_operand" "") + (match_operand:V8QI 1 "gr_register_operand" "") + (match_operand:V4HI 2 "gr_register_operand" "")] + "" +{ + ia64_expand_widen_sum (operands, true); + DONE; +}) + +(define_expand "widen_usumv4hi3" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand:V4HI 1 "gr_register_operand" "") + (match_operand:V2SI 2 "gr_register_operand" "")] + "" +{ + ia64_expand_widen_sum (operands, true); + DONE; +}) + +(define_expand "widen_ssumv8qi3" + [(match_operand:V4HI 0 "gr_register_operand" "") + (match_operand:V8QI 1 "gr_register_operand" "") + (match_operand:V4HI 2 "gr_register_operand" "")] + "" +{ + ia64_expand_widen_sum (operands, false); + DONE; +}) + +(define_expand "widen_ssumv4hi3" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand:V4HI 1 "gr_register_operand" "") + (match_operand:V2SI 2 "gr_register_operand" "")] + "" +{ + ia64_expand_widen_sum (operands, false); + DONE; +}) + +(define_expand "udot_prodv8qi" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand:V8QI 1 "gr_register_operand" "") + (match_operand:V8QI 2 "gr_register_operand" "") + (match_operand:V2SI 3 "gr_register_operand" "")] + "" +{ + ia64_expand_dot_prod_v8qi (operands, true); + DONE; +}) + +(define_expand "sdot_prodv8qi" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand:V8QI 1 "gr_register_operand" "") + (match_operand:V8QI 2 "gr_register_operand" "") + (match_operand:V2SI 3 "gr_register_operand" "")] + "" +{ + ia64_expand_dot_prod_v8qi (operands, false); + DONE; +}) + +(define_expand "sdot_prodv4hi" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand:V4HI 1 "gr_register_operand" "") + (match_operand:V4HI 2 "gr_register_operand" "") + (match_operand:V2SI 3 "gr_register_operand" "")] + "" +{ + rtx l, r, t; + + r = gen_reg_rtx (V2SImode); + l = gen_reg_rtx (V2SImode); + t = gen_reg_rtx (V2SImode); + + emit_insn (gen_pmpy2_r (r, operands[1], operands[2])); + emit_insn (gen_pmpy2_l (l, operands[1], operands[2])); + emit_insn (gen_addv2si3 (t, r, operands[3])); + emit_insn (gen_addv2si3 (operands[0], t, l)); + DONE; +}) + +(define_expand "vcond" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (if_then_else:VECINT + (match_operator 3 "" + [(match_operand:VECINT 4 "gr_reg_or_0_operand" "") + (match_operand:VECINT 5 "gr_reg_or_0_operand" "")]) + (match_operand:VECINT 1 "gr_reg_or_0_operand" "") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))] + "" +{ + ia64_expand_vecint_cmov (operands); + DONE; +}) + +(define_expand "vcondu" + [(set (match_operand:VECINT 0 "gr_register_operand" "") + (if_then_else:VECINT + (match_operator 3 "" + [(match_operand:VECINT 4 "gr_reg_or_0_operand" "") + (match_operand:VECINT 5 "gr_reg_or_0_operand" "")]) + (match_operand:VECINT 1 "gr_reg_or_0_operand" "") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "")))] + "" +{ + ia64_expand_vecint_cmov (operands); + DONE; +}) + +(define_insn "*cmpeq_" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (eq:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))] + "" + "pcmp.eq %0 = %r1, %r2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "*cmpgt_" + [(set (match_operand:VECINT 0 "gr_register_operand" "=r") + (gt:VECINT (match_operand:VECINT 1 "gr_reg_or_0_operand" "rU") + (match_operand:VECINT 2 "gr_reg_or_0_operand" "rU")))] + "" + "pcmp.gt %0 = %r1, %r2" + [(set_attr "itanium_class" "mmalua")]) + +(define_insn "pack2_sss" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_concat:V8QI + (ss_truncate:V4QI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")) + (ss_truncate:V4QI + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))] + "" + "pack2.sss %0 = %r1, %r2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*pack2_uss" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_concat:V8QI + (us_truncate:V4QI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")) + (us_truncate:V4QI + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))] + "" + "pack2.uss %0 = %r1, %r2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "pack4_sss" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_concat:V4HI + (ss_truncate:V2HI + (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")) + (ss_truncate:V2HI + (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))))] + "" + "pack4.sss %0 = %r1, %r2" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "unpack1_l" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 0) + (const_int 1) + (const_int 2) + (const_int 3) + (const_int 8) + (const_int 9) + (const_int 10) + (const_int 11)])))] + "" + "unpack1.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "unpack1_h" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 4) + (const_int 5) + (const_int 6) + (const_int 7) + (const_int 12) + (const_int 13) + (const_int 14) + (const_int 15)])))] + "" + "unpack1.h %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "mix1_r" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 0) + (const_int 8) + (const_int 2) + (const_int 10) + (const_int 4) + (const_int 12) + (const_int 6) + (const_int 14)])))] + "" + "mix1.r %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "mix1_l" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (vec_concat:V16QI + (match_operand:V8QI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V8QI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 1) + (const_int 9) + (const_int 3) + (const_int 11) + (const_int 5) + (const_int 13) + (const_int 7) + (const_int 15)])))] + "" + "mix1.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_rev" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (match_operand:V8QI 1 "gr_register_operand" "r") + (parallel [(const_int 7) + (const_int 6) + (const_int 5) + (const_int 4) + (const_int 3) + (const_int 2) + (const_int 1) + (const_int 0)])))] + "" + "mux1 %0 = %1, @rev" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_mix" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (match_operand:V8QI 1 "gr_register_operand" "r") + (parallel [(const_int 0) + (const_int 4) + (const_int 2) + (const_int 6) + (const_int 1) + (const_int 5) + (const_int 3) + (const_int 7)])))] + "" + "mux1 %0 = %1, @mix" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_shuf" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (match_operand:V8QI 1 "gr_register_operand" "r") + (parallel [(const_int 0) + (const_int 4) + (const_int 1) + (const_int 5) + (const_int 2) + (const_int 6) + (const_int 3) + (const_int 7)])))] + "" + "mux1 %0 = %1, @shuf" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_alt" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (match_operand:V8QI 1 "gr_register_operand" "r") + (parallel [(const_int 0) + (const_int 2) + (const_int 4) + (const_int 6) + (const_int 1) + (const_int 3) + (const_int 5) + (const_int 7)])))] + "" + "mux1 %0 = %1, @alt" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_brcst_v8qi" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_select:V8QI + (match_operand:V8QI 1 "gr_register_operand" "r") + (parallel [(const_int 0) + (const_int 0) + (const_int 0) + (const_int 0) + (const_int 0) + (const_int 0) + (const_int 0) + (const_int 0)])))] + "" + "mux1 %0 = %1, @brcst" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux1_brcst_qi" + [(set (match_operand:V8QI 0 "gr_register_operand" "=r") + (vec_duplicate:V8QI + (match_operand:QI 1 "gr_register_operand" "r")))] + "" + "mux1 %0 = %1, @brcst" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "unpack2_l" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 0) + (const_int 4) + (const_int 1) + (const_int 5)])))] + "" + "unpack2.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "unpack2_h" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 2) + (const_int 6) + (const_int 3) + (const_int 7)])))] + "" + "unpack2.h %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mix2_r" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 0) + (const_int 4) + (const_int 2) + (const_int 6)])))] + "" + "mix2.r %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mix2_l" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_select:V4HI + (vec_concat:V8HI + (match_operand:V4HI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V4HI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 1) + (const_int 5) + (const_int 3) + (const_int 7)])))] + "" + "mix2.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux2" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_select:V4HI + (match_operand:V4HI 1 "gr_register_operand" "r") + (parallel [(match_operand 2 "const_int_2bit_operand" "") + (match_operand 3 "const_int_2bit_operand" "") + (match_operand 4 "const_int_2bit_operand" "") + (match_operand 5 "const_int_2bit_operand" "")])))] + "" +{ + int mask; + mask = INTVAL (operands[2]); + mask |= INTVAL (operands[3]) << 2; + mask |= INTVAL (operands[4]) << 4; + mask |= INTVAL (operands[5]) << 6; + operands[2] = GEN_INT (mask); + return "%,mux2 %0 = %1, %2"; +} + [(set_attr "itanium_class" "mmshf")]) + +(define_insn "*mux2_brcst_hi" + [(set (match_operand:V4HI 0 "gr_register_operand" "=r") + (vec_duplicate:V4HI + (match_operand:HI 1 "gr_register_operand" "r")))] + "" + "mux2 %0 = %1, 0" + [(set_attr "itanium_class" "mmshf")]) + +;; Note that mix4.r performs the exact same operation. +(define_insn "*unpack4_l" + [(set (match_operand:V2SI 0 "gr_register_operand" "=r") + (vec_select:V2SI + (vec_concat:V4SI + (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 0) + (const_int 2)])))] + "" + "unpack4.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +;; Note that mix4.l performs the exact same operation. +(define_insn "*unpack4_h" + [(set (match_operand:V2SI 0 "gr_register_operand" "=r") + (vec_select:V2SI + (vec_concat:V4SI + (match_operand:V2SI 1 "gr_reg_or_0_operand" "rU") + (match_operand:V2SI 2 "gr_reg_or_0_operand" "rU")) + (parallel [(const_int 1) + (const_int 3)])))] + "" + "unpack4.h %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +(define_expand "vec_initv2si" + [(match_operand:V2SI 0 "gr_register_operand" "") + (match_operand 1 "" "")] + "" +{ + rtx op1 = XVECEXP (operands[1], 0, 0); + rtx op2 = XVECEXP (operands[1], 0, 1); + rtx x; + + if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT) + { + rtvec v = rtvec_alloc (2); + RTVEC_ELT (v, 0) = TARGET_BIG_ENDIAN ? op2 : op1; + RTVEC_ELT (v, 1) = TARGET_BIG_ENDIAN ? op1 : op2;; + x = gen_rtx_CONST_VECTOR (V2SImode, v); + emit_move_insn (operands[0], x); + DONE; + } + + if (!gr_reg_or_0_operand (op1, SImode)) + op1 = force_reg (SImode, op1); + if (!gr_reg_or_0_operand (op2, SImode)) + op2 = force_reg (SImode, op2); + + if (TARGET_BIG_ENDIAN) + x = gen_rtx_VEC_CONCAT (V2SImode, op2, op1); + else + x = gen_rtx_VEC_CONCAT (V2SImode, op1, op2); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], x)); + DONE; +}) + +(define_insn "*vecinit_v2si" + [(set (match_operand:V2SI 0 "gr_register_operand" "=r") + (vec_concat:V2SI + (match_operand:SI 1 "gr_reg_or_0_operand" "rO") + (match_operand:SI 2 "gr_reg_or_0_operand" "rO")))] + "" + "unpack4.l %0 = %r2, %r1" + [(set_attr "itanium_class" "mmshf")]) + +;; Missing operations +;; padd.uus +;; pavg +;; pavgsub +;; pmpyshr, general form +;; psad +;; pshladd +;; pshradd +;; psub.uus + +;; Floating point vector operations + +(define_expand "movv2sf" + [(set (match_operand:V2SF 0 "general_operand" "") + (match_operand:V2SF 1 "general_operand" ""))] + "" +{ + rtx op1 = ia64_expand_move (operands[0], operands[1]); + if (!op1) + DONE; + operands[1] = op1; +}) + +(define_insn "*movv2sf_internal" + [(set (match_operand:V2SF 0 "destination_operand" + "=f,f,f,Q,*r ,*r,*r,*r,m ,f ,*r") + (match_operand:V2SF 1 "move_operand" + "fU,Y,Q,f,U*r,W ,i ,m ,*r,*r,f "))] + "ia64_move_ok (operands[0], operands[1])" +{ + static const char * const alt[] = { + "%,mov %0 = %F1", + "%,fpack %0 = %F2, %F1", + "%,ldf8 %0 = %1%P1", + "%,stf8 %0 = %1%P0", + "%,mov %0 = %r1", + "%,addl %0 = %v1, r0", + "%,movl %0 = %v1", + "%,ld8%O1 %0 = %1%P1", + "%,st8%Q0 %0 = %r1%P0", + "%,setf.sig %0 = %1", + "%,getf.sig %0 = %1" + }; + + if (which_alternative == 1) + { + operands[2] = XVECEXP (operands[1], 0, 1); + operands[1] = XVECEXP (operands[1], 0, 0); + } + + return alt[which_alternative]; +} + [(set_attr "itanium_class" "fmisc,fmisc,fld,stf,ialu,ialu,long_i,ld,st,tofr,frfr")]) + +(define_insn "absv2sf2" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))] + "" + "fpabs %0 = %1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "negv2sf2" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (neg:V2SF (match_operand:V2SF 1 "fr_register_operand" "f")))] + "" + "fpneg %0 = %1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*negabsv2sf2" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (neg:V2SF + (abs:V2SF (match_operand:V2SF 1 "fr_register_operand" "f"))))] + "" + "fpnegabs %0 = %1" + [(set_attr "itanium_class" "fmisc")]) + +;; In order to convince combine to merge plus and mult to a useful fpma, +;; we need a couple of extra patterns. +(define_expand "addv2sf3" + [(parallel + [(set (match_operand:V2SF 0 "fr_register_operand" "") + (plus:V2SF (match_operand:V2SF 1 "fr_register_operand" "") + (match_operand:V2SF 2 "fr_register_operand" ""))) + (use (match_dup 3))])] + "" +{ + rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode)); + operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v)); +}) + +;; The split condition here could be combine_completed, if we had such. +(define_insn_and_split "*addv2sf3_1" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (plus:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f"))) + (use (match_operand:V2SF 3 "fr_register_operand" "f"))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (plus:V2SF + (mult:V2SF (match_dup 1) (match_dup 3)) + (match_dup 2)))] + "") + +(define_insn_and_split "*addv2sf3_2" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (plus:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")) + (match_operand:V2SF 3 "fr_register_operand" "f"))) + (use (match_operand:V2SF 4 "" "X"))] + "" + "#" + "" + [(set (match_dup 0) + (plus:V2SF + (mult:V2SF (match_dup 1) (match_dup 2)) + (match_dup 3)))] + "") + +;; In order to convince combine to merge minus and mult to a useful fpms, +;; we need a couple of extra patterns. +(define_expand "subv2sf3" + [(parallel + [(set (match_operand:V2SF 0 "fr_register_operand" "") + (minus:V2SF (match_operand:V2SF 1 "fr_register_operand" "") + (match_operand:V2SF 2 "fr_register_operand" ""))) + (use (match_dup 3))])] + "" +{ + rtvec v = gen_rtvec (2, CONST1_RTX (SFmode), CONST1_RTX (SFmode)); + operands[3] = force_reg (V2SFmode, gen_rtx_CONST_VECTOR (V2SFmode, v)); +}) + +;; The split condition here could be combine_completed, if we had such. +(define_insn_and_split "*subv2sf3_1" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (minus:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f"))) + (use (match_operand:V2SF 3 "fr_register_operand" "f"))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (minus:V2SF + (mult:V2SF (match_dup 1) (match_dup 3)) + (match_dup 2)))] + "") + +(define_insn_and_split "*subv2sf3_2" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (minus:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")) + (match_operand:V2SF 3 "fr_register_operand" "f"))) + (use (match_operand:V2SF 4 "" "X"))] + "" + "#" + "" + [(set (match_dup 0) + (minus:V2SF + (mult:V2SF (match_dup 1) (match_dup 2)) + (match_dup 3)))] + "") + +(define_insn "mulv2sf3" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")))] + "" + "fpmpy %0 = %1, %2" + [(set_attr "itanium_class" "fmac")]) + +(define_insn "*fpma" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (plus:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")) + (match_operand:V2SF 3 "fr_register_operand" "f")))] + "" + "fpma %0 = %1, %2, %3" + [(set_attr "itanium_class" "fmac")]) + +(define_insn "*fpms" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (minus:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")) + (match_operand:V2SF 3 "fr_register_operand" "f")))] + "" + "fpms %0 = %1, %2, %3" + [(set_attr "itanium_class" "fmac")]) + +(define_insn "*fpnmpy" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (neg:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f"))))] + "" + "fpnmpy %0 = %1, %2" + [(set_attr "itanium_class" "fmac")]) + +(define_insn "*fpnma" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (plus:V2SF + (neg:V2SF + (mult:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f"))) + (match_operand:V2SF 3 "fr_register_operand" "f")))] + "" + "fpnma %0 = %1, %2, %3" + [(set_attr "itanium_class" "fmac")]) + +(define_insn "smaxv2sf3" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (smax:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")))] + "" + "fpmax %0 = %1, %2" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "sminv2sf3" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (smin:V2SF (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_register_operand" "f")))] + "" + "fpmin %0 = %1, %2" + [(set_attr "itanium_class" "fmisc")]) + +(define_expand "reduc_splus_v2sf" + [(match_operand:V2SF 0 "fr_register_operand" "") + (match_operand:V2SF 1 "fr_register_operand" "")] + "" +{ + rtx tmp = gen_reg_rtx (V2SFmode); + emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode))); + emit_insn (gen_addv2sf3 (operands[0], operands[1], tmp)); + DONE; +}) + +(define_expand "reduc_smax_v2sf" + [(match_operand:V2SF 0 "fr_register_operand" "") + (match_operand:V2SF 1 "fr_register_operand" "")] + "" +{ + rtx tmp = gen_reg_rtx (V2SFmode); + emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode))); + emit_insn (gen_smaxv2sf3 (operands[0], operands[1], tmp)); + DONE; +}) + +(define_expand "reduc_smin_v2sf" + [(match_operand:V2SF 0 "fr_register_operand" "") + (match_operand:V2SF 1 "fr_register_operand" "")] + "" +{ + rtx tmp = gen_reg_rtx (V2SFmode); + emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode))); + emit_insn (gen_sminv2sf3 (operands[0], operands[1], tmp)); + DONE; +}) + +(define_expand "vcondv2sf" + [(set (match_operand:V2SF 0 "fr_register_operand" "") + (if_then_else:V2SF + (match_operator 3 "" + [(match_operand:V2SF 4 "fr_reg_or_0_operand" "") + (match_operand:V2SF 5 "fr_reg_or_0_operand" "")]) + (match_operand:V2SF 1 "fr_reg_or_0_operand" "") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "")))] + "" +{ + rtx x, cmp; + + cmp = gen_reg_rtx (V2SFmode); + PUT_MODE (operands[3], V2SFmode); + emit_insn (gen_rtx_SET (VOIDmode, cmp, operands[3])); + + x = gen_rtx_IF_THEN_ELSE (V2SFmode, cmp, operands[1], operands[2]); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], x)); + DONE; +}) + +(define_insn "*fpcmp" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (match_operator:V2SF 3 "comparison_operator" + [(match_operand:V2SF 1 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")]))] + "" + "fpcmp.%D3 %0 = %F1, %F2" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*fselect" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (if_then_else:V2SF + (match_operand:V2SF 1 "fr_register_operand" "f") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 3 "fr_reg_or_0_operand" "fU")))] + "" + "fselect %0 = %F2, %F3, %1" + [(set_attr "itanium_class" "fmisc")]) + +(define_expand "vec_initv2sf" + [(match_operand:V2SF 0 "fr_register_operand" "") + (match_operand 1 "" "")] + "" +{ + rtx op1 = XVECEXP (operands[1], 0, 0); + rtx op2 = XVECEXP (operands[1], 0, 1); + rtx x; + + if (GET_CODE (op1) == CONST_DOUBLE && GET_CODE (op2) == CONST_DOUBLE) + { + x = gen_rtx_CONST_VECTOR (V2SFmode, XVEC (operands[1], 0)); + emit_move_insn (operands[0], x); + DONE; + } + + if (!fr_reg_or_fp01_operand (op1, SFmode)) + op1 = force_reg (SFmode, op1); + if (!fr_reg_or_fp01_operand (op2, SFmode)) + op2 = force_reg (SFmode, op2); + + if (TARGET_BIG_ENDIAN) + emit_insn (gen_fpack (operands[0], op2, op1)); + else + emit_insn (gen_fpack (operands[0], op1, op2)); + DONE; +}) + +(define_insn "fpack" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (vec_concat:V2SF + (match_operand:SF 1 "fr_reg_or_fp01_operand" "fG") + (match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))] + "" + "fpack %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "fswap" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (vec_select:V2SF + (vec_concat:V4SF + (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")) + (parallel [(const_int 1) (const_int 2)])))] + "" + "fswap %0 = %F1, %F2" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "*fmix_l" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (vec_select:V2SF + (vec_concat:V4SF + (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")) + (parallel [(const_int 1) (const_int 3)])))] + "" + "fmix.l %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "fmix_r" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (vec_select:V2SF + (vec_concat:V4SF + (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")) + (parallel [(const_int 0) (const_int 2)])))] + "" + "fmix.r %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_insn "fmix_lr" + [(set (match_operand:V2SF 0 "fr_register_operand" "=f") + (vec_select:V2SF + (vec_concat:V4SF + (match_operand:V2SF 1 "fr_reg_or_0_operand" "fU") + (match_operand:V2SF 2 "fr_reg_or_0_operand" "fU")) + (parallel [(const_int 0) (const_int 3)])))] + "" + "fmix.lr %0 = %F2, %F1" + [(set_attr "itanium_class" "fmisc")]) + +(define_expand "vec_setv2sf" + [(match_operand:V2SF 0 "fr_register_operand" "") + (match_operand:SF 1 "fr_register_operand" "") + (match_operand 2 "const_int_operand" "")] + "" +{ + rtx tmp = gen_reg_rtx (V2SFmode); + emit_insn (gen_fpack (tmp, operands[1], CONST0_RTX (SFmode))); + + switch (INTVAL (operands[2])) + { + case 0: + emit_insn (gen_fmix_lr (operands[0], tmp, operands[0])); + break; + case 1: + emit_insn (gen_fmix_r (operands[0], operands[0], tmp)); + break; + default: + gcc_unreachable (); + } + DONE; +}) + +(define_insn_and_split "*vec_extractv2sf_0_le" + [(set (match_operand:SF 0 "nonimmediate_operand" "=r,f,m") + (unspec:SF [(match_operand:V2SF 1 "nonimmediate_operand" "rfm,rm,r") + (const_int 0)] + UNSPEC_VECT_EXTR))] + "!TARGET_BIG_ENDIAN" + "#" + "reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + if (REG_P (operands[1]) && FR_REGNO_P (REGNO (operands[1]))) + operands[0] = gen_rtx_REG (V2SFmode, REGNO (operands[0])); + else if (MEM_P (operands[1])) + operands[1] = adjust_address (operands[1], SFmode, 0); + else + operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1])); +}) + +(define_insn_and_split "*vec_extractv2sf_0_be" + [(set (match_operand:SF 0 "register_operand" "=r,f") + (unspec:SF [(match_operand:V2SF 1 "register_operand" "rf,r") + (const_int 0)] + UNSPEC_VECT_EXTR))] + "TARGET_BIG_ENDIAN" + "#" + "reload_completed" + [(set (match_dup 0) (match_dup 1))] +{ + if (REG_P (operands[1]) && FR_REGNO_P (REGNO (operands[1]))) + operands[0] = gen_rtx_REG (V2SFmode, REGNO (operands[0])); + else + operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1])); +}) + +(define_insn_and_split "*vec_extractv2sf_1" + [(set (match_operand:SF 0 "register_operand" "=r") + (unspec:SF [(match_operand:V2SF 1 "register_operand" "r") + (const_int 1)] + UNSPEC_VECT_EXTR))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + operands[0] = gen_rtx_REG (DImode, REGNO (operands[0])); + operands[1] = gen_rtx_REG (DImode, REGNO (operands[1])); + if (TARGET_BIG_ENDIAN) + emit_move_insn (operands[0], operands[1]); + else + emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32))); + DONE; +}) + +(define_expand "vec_extractv2sf" + [(set (match_operand:SF 0 "register_operand" "") + (unspec:SF [(match_operand:V2SF 1 "register_operand" "") + (match_operand:DI 2 "const_int_operand" "")] + UNSPEC_VECT_EXTR))] + "" + "") + +;; Missing operations +;; fprcpa +;; fpsqrta diff --git a/contrib/gcc/config/interix.h b/contrib/gcc/config/interix.h index 9d05f1bcc0a..0fa5dee87a3 100644 --- a/contrib/gcc/config/interix.h +++ b/contrib/gcc/config/interix.h @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for Interix - Copyright (C) 1994, 1995, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1999, 2002, 2004 Free Software Foundation, Inc. Donn Terry, Softway Systems, Inc. (donn@softway.com) Modified from code Contributed by Douglas B. Rupp (drupp@cs.washington.edu). @@ -19,12 +19,8 @@ GNU General Public License for more details. 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. */ - -#ifndef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS -#endif +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* POSIX/Uni-thread only for now. Look at the winnt version for windows/multi thread */ diff --git a/contrib/gcc/config/interix3.h b/contrib/gcc/config/interix3.h index 9e2cc35a4ef..f7c3aa6123f 100644 --- a/contrib/gcc/config/interix3.h +++ b/contrib/gcc/config/interix3.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Interix 3.x has a single rooted file system and properly named libraries, so LIB_SPEC can be simplified */ diff --git a/contrib/gcc/config/kaos.h b/contrib/gcc/config/kaos.h index 45938da75c1..2425fd4eafc 100644 --- a/contrib/gcc/config/kaos.h +++ b/contrib/gcc/config/kaos.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Specify predefined symbols in preprocessor. */ #define TARGET_OS_CPP_BUILTINS() \ diff --git a/contrib/gcc/config/kfreebsd-gnu.h b/contrib/gcc/config/kfreebsd-gnu.h new file mode 100644 index 00000000000..8c11ca50137 --- /dev/null +++ b/contrib/gcc/config/kfreebsd-gnu.h @@ -0,0 +1,38 @@ +/* Definitions for kFreeBSD-based GNU systems with ELF format + Copyright (C) 2004, 2006 + Free Software Foundation, Inc. + Contributed by Robert Millan. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef LINUX_TARGET_OS_CPP_BUILTINS +#define LINUX_TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__FreeBSD_kernel__"); \ + builtin_define ("__GLIBC__"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } \ + while (0) + +#ifdef GLIBC_DYNAMIC_LINKER +#undef GLIBC_DYNAMIC_LINKER +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" +#endif diff --git a/contrib/gcc/config/knetbsd-gnu.h b/contrib/gcc/config/knetbsd-gnu.h new file mode 100644 index 00000000000..e1ff325b87c --- /dev/null +++ b/contrib/gcc/config/knetbsd-gnu.h @@ -0,0 +1,39 @@ +/* Definitions for kNetBSD-based GNU systems with ELF format + Copyright (C) 2004, 2006 + Free Software Foundation, Inc. + Contributed by Robert Millan. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef LINUX_TARGET_OS_CPP_BUILTINS +#define LINUX_TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__NetBSD_kernel__"); \ + builtin_define ("__GLIBC__"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + } \ + while (0) + + +#ifdef GLIBC_DYNAMIC_LINKER +#undef GLIBC_DYNAMIC_LINKER +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" +#endif diff --git a/contrib/gcc/config/libgloss.h b/contrib/gcc/config/libgloss.h index 3f9bf6c9ef2..82de626c359 100644 --- a/contrib/gcc/config/libgloss.h +++ b/contrib/gcc/config/libgloss.h @@ -1,6 +1,6 @@ /* libgloss.h -- operating system specific defines to be used when targeting GCC for Libgloss supported targets. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file should not be used for ELF targets, as this definition of STARTFILE_SPEC is all wrong. */ @@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */ /* This file used to force LINK_SPEC to be the null string, but that is not correct. LINK_SPEC is used to pass machine specific arguments to the - linker and hence can not be redefined here. LINK_SPEC is never used to + linker and hence cannot be redefined here. LINK_SPEC is never used to specify startup files or libraries, so it should never conflict with libgloss. */ diff --git a/contrib/gcc/config/linux.h b/contrib/gcc/config/linux.h index 0f7ba1777e8..59e3e8538f9 100644 --- a/contrib/gcc/config/linux.h +++ b/contrib/gcc/config/linux.h @@ -1,5 +1,5 @@ /* Definitions for Linux-based GNU systems with ELF format - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C @@ -39,14 +39,7 @@ Boston, MA 02111-1307, USA. */ object constructed before entering `main'. */ #undef STARTFILE_SPEC -#ifdef USE_GNULIBC_1 -#define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" -#elif defined HAVE_LD_PIE +#if defined HAVE_LD_PIE #define STARTFILE_SPEC \ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" @@ -76,26 +69,10 @@ Boston, MA 02111-1307, USA. */ #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" #undef LIB_SPEC -/* We no longer link with libc_p.a or libg.a by default. If you - want to profile or debug the GNU/Linux C library, please add - -profile or -ggdb to LDFLAGS at the link time, respectively. */ -#if 1 -#ifdef USE_GNULIBC_1 -#define LIB_SPEC \ - "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \ - %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}" -#else #define LIB_SPEC \ "%{pthread:-lpthread} \ %{shared:-lc} \ %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" -#endif -#else -#define LIB_SPEC \ - "%{!shared: \ - %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \ - %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}" -#endif #define LINUX_TARGET_OS_CPP_BUILTINS() \ do { \ @@ -107,7 +84,7 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("system=posix"); \ } while (0) -#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR) +#if defined(HAVE_LD_EH_FRAME_HDR) #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif @@ -117,10 +94,36 @@ Boston, MA 02111-1307, USA. */ #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -/* Determine whether the the entire c99 runtime - is present in the runtime library. */ -#ifndef USE_GNULIBC_1 -#define TARGET_C99_FUNCTIONS 1 +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 #endif -#define TARGET_HAS_F_SETLKW +/* Determine which dynamic linker to use depending on whether GLIBC or + uClibc is the default C library and whether -muclibc or -mglibc has + been passed to change the default. */ +#if UCLIBC_DEFAULT +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" +#else +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#endif + +/* For most targets the following definitions suffice; + GLIBC_DYNAMIC_LINKER must be defined for each target using them, or + GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets + supporting both 32-bit and 64-bit compilation. */ +#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#define LINUX_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) +#define LINUX_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) +#define LINUX_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + +/* Determine whether the entire c99 runtime + is present in the runtime library. */ +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) + +#define TARGET_POSIX_IO diff --git a/contrib/gcc/config/linux.opt b/contrib/gcc/config/linux.opt new file mode 100644 index 00000000000..3f615bb5154 --- /dev/null +++ b/contrib/gcc/config/linux.opt @@ -0,0 +1,29 @@ +; Processor-independent options for GNU/Linux. +; +; Copyright (C) 2006 Free Software Foundation, Inc. +; Contributed by CodeSourcery. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +muclibc +Target RejectNegative Report Mask(UCLIBC) Var(linux_uclibc) Init(UCLIBC_DEFAULT ? OPTION_MASK_UCLIBC : 0) +Use uClibc instead of GNU libc + +mglibc +Target RejectNegative Report InverseMask(UCLIBC, GLIBC) Var(linux_uclibc) VarExists +Use GNU libc instead of uClibc diff --git a/contrib/gcc/config/lynx.h b/contrib/gcc/config/lynx.h index a2366d106da..271fb626df3 100644 --- a/contrib/gcc/config/lynx.h +++ b/contrib/gcc/config/lynx.h @@ -1,5 +1,5 @@ -/* Target independent definitions for LynxOS using gas and gnu ld. - Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003 +/* Target independent definitions for LynxOS. + Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -16,128 +16,163 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ -/* LynxOS is a multi-platform Unix, similar to SVR3, but not identical. */ +/* In this file we set up defaults that can be chosen by + /lynx.h files. A target-specific lynx.h file can decide + either to define and override these definitions or to use them by + ensuring they are undefined at this point. If we were to #undef + them here we might accidentally disable some target-specific + defines. */ -/* Define various macros, depending on the combination of flags. */ +#ifndef EXTRA_OS_LYNX_TARGET_SPECS +# define EXTRA_OS_LYNX_TARGET_SPECS +#endif -#undef CPP_SPEC -#define CPP_SPEC "%{mthreads:-D_MULTITHREADED} \ - %{mposix:-D_POSIX_SOURCE} \ - %{msystem-v:-I/usr/include_v}" +#ifndef EXTRA_OS_LYNX_SPECS +# define EXTRA_OS_LYNX_SPECS \ + { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \ + { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \ + { "link_os_lynx", LINK_OS_LYNX_SPEC }, \ + { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \ + { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \ + EXTRA_OS_LYNX_TARGET_SPECS +#endif -/* No asm spec needed, since using GNU assembler always. */ +#ifndef SUBTARGET_EXTRA_SPECS +# define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS +#endif -/* No linker spec needed, since using GNU linker always. */ +#ifndef CPP_SPEC +# define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)" +#endif -#undef LIB_SPEC -#define LIB_SPEC "%{mthreads:-L/lib/thread/} \ - %{msystem-v:-lc_v} \ - %{!msystem-v:%{mposix:-lc_p} -lc -lm}" +#ifndef LIB_SPEC +# define LIB_SPEC "%(lib_os_lynx)" +#endif -/* Set the appropriate names for the Lynx startfiles. */ +#ifndef LINK_SPEC +# define LINK_SPEC "%(link_os_lynx)" +#endif -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{p:%{mthreads:thread/pinit1.o%s}%{!mthreads:pinit1.o%s}}%{!p:%{msystem-v:vinit1.o%s -e_start}%{!msystem-v:%{mthreads:thread/init1.o%s}%{!mthreads:init1.o%s}}}" +#ifndef STARTFILE_SPEC +# define STARTFILE_SPEC "%(startfile_os_lynx)" +#endif -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}" +#ifndef ENDFILE_SPEC +# define ENDFILE_SPEC "%(endfile_os_lynx)" +#endif -/* Override the svr3 versions. */ +#ifndef CPP_OS_LYNX_SPEC +# define CPP_OS_LYNX_SPEC \ +"%{mthreads: \ + %{mlegacy-threads: \ + %ecannot use mthreads and mlegacy-threads together}} \ + %{mthreads: -D_MULTITHREADED} \ + %{mlegacy-threads: -D_THREADS_POSIX4ad4} \ + -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__" +#endif -#undef WCHAR_TYPE -#define WCHAR_TYPE "int" +#ifndef LIB_OS_LYNX_SPEC +# define LIB_OS_LYNX_SPEC \ +"%{mlegacy-threads:-lposix-pre1c} -lm -lc" +#endif -#undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "long int" +/* We link static executables for LynxOS by default unless -mshared is + used when linking an executable. Along the same line, we link to + shared libraries when linking a shared object by default unless + -static is used. -/* We want to output DBX (stabs) debugging information normally. */ + We have to pass in our -L options here otherwise the translated + startfile directories (%D) will take priority over this. + Furthermore since we have to pass in -L options here we have to + make sure that -L options provided by the user take priority over + everything we specify. */ -#define DBX_DEBUGGING_INFO 1 -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG +#ifndef LINK_OS_LYNX_SPEC +# define LINK_OS_LYNX_SPEC \ +"%{shared} %{static} \ + %{mshared: %{static: %ecannot use mshared and static together}} \ + %{!mshared: %{!shared: %{!static: -static}}} \ + %{L*} \ + %{mthreads: \ + %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \ + %{shared: \ + %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \ + %{!mshared: -L/lib/thread}} \ + %{shared: %{static: -L/lib/thread}}} \ + %{!mthreads: \ + %{mshared: -L/lib/shlib -rpath /lib/shlib} \ + %{shared: -L/lib/shlib -rpath /lib/shlib}} \ + %{mlegacy-threads:-lposix-pre1c} -lm -lc" +#endif -/* It is convenient to be able to generate standard coff debugging - if requested via -gcoff. */ +#ifndef STARTFILE_OS_LYNX_SPEC +# define STARTFILE_OS_LYNX_SPEC \ +"%{!shared: \ + %{!mthreads: \ + %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \ + %{!p:%{!pg:crt1.o%s}}} \ + %{mthreads: \ + %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \ + %{!p:%{!pg:thread/crt1.o%s }}}}\ + %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \ + %{!shared: crtbegin.o%s} \ + %{shared: crtbeginS.o%s}" +#endif -#define SDB_DEBUGGING_INFO 1 +#ifndef ENDFILE_OS_LYNX_SPEC +# define ENDFILE_OS_LYNX_SPEC \ +"%{!shared: crtend.o%s} \ + %{shared: crtendS.o%s} \ + %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}" +#endif -/* Be function-relative for block and source line stab directives. */ +/* Define the actual types of some ANSI-mandated types. */ -#define DBX_BLOCKS_FUNCTION_RELATIVE 1 +#ifndef SIZE_TYPE +# define SIZE_TYPE "unsigned int" +#endif -/* but, to make this work, functions must appear prior to line info */ +#ifndef PTRDIFF_TYPE +# define PTRDIFF_TYPE "int" +#endif -#define DBX_FUNCTION_FIRST +#ifndef WCHAR_TYPE +# define WCHAR_TYPE "long int" +#endif -/* Generate a blank trailing N_SO to mark the end of the .o file, since - we can't depend upon the linker to mark .o file boundaries with - embedded stabs. */ +#ifndef WCHAR_TYPE_SIZE +# define WCHAR_TYPE_SIZE BITS_PER_WORD +#endif -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ - fprintf (FILE, \ - "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO) +/* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that + the .align directive with GAS. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \ - { fprintf (file, ".stabn 68,0,%d,.LM%d-", \ - line, counter); \ - assemble_name (file, \ - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ - fprintf (file, "\n.LM%d:\n", counter); } +#ifndef ASM_OUTPUT_ALIGN +# define ASM_OUTPUT_ALIGN(FILE, LOG) \ + do \ + { \ + if ((LOG) != 0) \ + fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \ + } \ + while (0) +#endif -/* Handle #pragma pack and sometimes #pragma weak. */ +/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is + the default on LynxOS. */ -#define HANDLE_SYSV_PRAGMA 1 +#ifndef PREFERRED_DEBUGGING_TYPE +# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG +#endif -/* Some additional command-line options. */ +/* We have C++ support in our system headers. */ -#define TARGET_THREADS (target_flags & MASK_THREADS) -#define MASK_THREADS 0x40000000 +#ifndef NO_IMPLICIT_EXTERN_C +# define NO_IMPLICIT_EXTERN_C +#endif -#define TARGET_POSIX (target_flags & MASK_POSIX) -#define MASK_POSIX 0x20000000 - -#define TARGET_SYSTEM_V (target_flags & MASK_SYSTEM_V) -#define MASK_SYSTEM_V 0x10000000 - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"threads", MASK_THREADS}, \ - {"posix", MASK_POSIX}, \ - {"system-v", MASK_SYSTEM_V}, - -#undef SUBTARGET_OVERRIDE_OPTIONS -#define SUBTARGET_OVERRIDE_OPTIONS \ -do { \ - if (TARGET_SYSTEM_V && profile_flag) \ - warning ("-msystem-v and -p are incompatible"); \ - if (TARGET_SYSTEM_V && TARGET_THREADS) \ - warning ("-msystem-v and -mthreads are incompatible"); \ -} while (0) - -/* Since init.o et al put all sorts of stuff into the init section, - we can't use the standard init section support in crtbegin.o. */ - -#undef INIT_SECTION_ASM_OP - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_fini - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - FINI_SECTION_FUNCTION - -#undef CTORS_SECTION_ASM_OP -#define CTORS_SECTION_ASM_OP "\t.section\t.ctors" -#undef DTORS_SECTION_ASM_OP -#define DTORS_SECTION_ASM_OP "\t.section\t.dtors" - -#undef DO_GLOBAL_CTORS_BODY -#undef DO_GLOBAL_DTORS_BODY - -/* LynxOS doesn't have mcount. */ -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(file, profile_label_no) +#ifndef TARGET_POSIX_IO +# define TARGET_POSIX_IO +#endif diff --git a/contrib/gcc/config/lynx.opt b/contrib/gcc/config/lynx.opt new file mode 100644 index 00000000000..d576ef84fc3 --- /dev/null +++ b/contrib/gcc/config/lynx.opt @@ -0,0 +1,32 @@ +; Processor-independent options for LynxOS. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mlegacy-threads +Target RejectNegative +Support legacy multi-threading + +mshared +Target RejectNegative +Use shared libraries + +mthreads +Target RejectNegative +Support multi-threading diff --git a/contrib/gcc/config/memcmp.c b/contrib/gcc/config/memcmp.c new file mode 100644 index 00000000000..2348afe1d27 --- /dev/null +++ b/contrib/gcc/config/memcmp.c @@ -0,0 +1,16 @@ +/* Public domain. */ +#include + +int +memcmp (const void *str1, const void *str2, size_t count) +{ + const unsigned char *s1 = str1; + const unsigned char *s2 = str2; + + while (count-- > 0) + { + if (*s1++ != *s2++) + return s1[-1] < s2[-1] ? -1 : 1; + } + return 0; +} diff --git a/contrib/gcc/config/memcpy.c b/contrib/gcc/config/memcpy.c new file mode 100644 index 00000000000..58b1e405627 --- /dev/null +++ b/contrib/gcc/config/memcpy.c @@ -0,0 +1,12 @@ +/* Public domain. */ +#include + +void * +memcpy (void *dest, const void *src, size_t len) +{ + char *d = dest; + const char *s = src; + while (len--) + *d++ = *s++; + return dest; +} diff --git a/contrib/gcc/config/memmove.c b/contrib/gcc/config/memmove.c new file mode 100644 index 00000000000..13b340af6a0 --- /dev/null +++ b/contrib/gcc/config/memmove.c @@ -0,0 +1,20 @@ +/* Public domain. */ +#include + +void * +memmove (void *dest, const void *src, size_t len) +{ + char *d = dest; + const char *s = src; + if (d < s) + while (len--) + *d++ = *s++; + else + { + char *lasts = s + (len-1); + char *lastd = d + (len-1); + while (len--) + *lastd-- = *lasts--; + } + return dest; +} diff --git a/contrib/gcc/config/memset.c b/contrib/gcc/config/memset.c new file mode 100644 index 00000000000..3e7025ee394 --- /dev/null +++ b/contrib/gcc/config/memset.c @@ -0,0 +1,11 @@ +/* Public domain. */ +#include + +void * +memset (void *dest, int val, size_t len) +{ + unsigned char *ptr = dest; + while (len-- > 0) + *ptr++ = val; + return dest; +} diff --git a/contrib/gcc/config/mips/24k.md b/contrib/gcc/config/mips/24k.md new file mode 100644 index 00000000000..0dbb9f04f09 --- /dev/null +++ b/contrib/gcc/config/mips/24k.md @@ -0,0 +1,455 @@ +;; DFA-based pipeline descriptions for MIPS Technologies 24K core. +;; Contributed by Chao-ying Fu (fu@mips.com), Nigel Stephens (nigel@mips.com) +;; and David Ung (davidu@mips.com) +;; +;; The 24K is a single-issue processor with a half-clocked fpu. +;; The 24Kx is 24k with 1:1 clocked fpu. +;; +;; References: +;; "MIPS32 24K Processor Core Family Software User's Manual, Rev 3.04." +;; +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +(define_automaton "r24k_cpu, r24k_mdu, r24k_fpu") + +;; Integer execution unit. +(define_cpu_unit "r24k_iss" "r24k_cpu") +(define_cpu_unit "r24k_ixu_arith" "r24k_cpu") +(define_cpu_unit "r24k_mul3a" "r24k_mdu") +(define_cpu_unit "r24k_mul3b" "r24k_mdu") +(define_cpu_unit "r24k_mul3c" "r24k_mdu") + +;; -------------------------------------------------------------- +;; Producers +;; -------------------------------------------------------------- + +;; 1. Loads: lb, lbu, lh, lhu, ll, lw, lwl, lwr, lwpc, lwxs +(define_insn_reservation "r24k_int_load" 2 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "load")) + "r24k_iss+r24k_ixu_arith") + + +;; 2. Arithmetic: add, addi, addiu, addiupc, addu, and, andi, clo, clz, +;; ext, ins, lui, movn, movz, nor, or, ori, rotr, rotrv, seb, seh, sll, +;; sllv, slt, slti, sltiu, sltu, sra, srav, srl, srlv, sub, subu, wsbh, +;; xor, xori +;; (movn/movz is not matched, we'll need to split condmov to +;; differentiate between integer/float moves) +(define_insn_reservation "r24k_int_arith" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "arith,const,nop,shift,slt")) + "r24k_iss+r24k_ixu_arith") + + +;; 3. Links: bgezal, bgezall, bltzal, bltzall, jal, jalr, jalx +;; 3a. jr/jalr consumer +(define_insn_reservation "r24k_int_jump" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "call,jump")) + "r24k_iss+r24k_ixu_arith") + +;; 3b. branch consumer +(define_insn_reservation "r24k_int_branch" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "branch")) + "r24k_iss+r24k_ixu_arith") + + +;; 4. MDU: fully pipelined multiplier +;; mult - delivers result to hi/lo in 1 cycle (pipelined) +(define_insn_reservation "r24k_int_mult" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imul")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; madd, msub - delivers result to hi/lo in 1 cycle (pipelined) +(define_insn_reservation "r24k_int_madd" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imadd")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; mul - delivers result to gpr in 5 cycles +(define_insn_reservation "r24k_int_mul3" 5 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imul3")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)*5") + +;; mfhi, mflo, mflhxu - deliver result to gpr in 5 cycles +(define_insn_reservation "r24k_int_mfhilo" 5 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "mfhilo")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; mthi, mtlo, mtlhx - deliver result to hi/lo, thence madd, handled as bypass +(define_insn_reservation "r24k_int_mthilo" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "mthilo")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; div - default to 36 cycles for 32bit operands. Faster for 24bit, 16bit and +;; 8bit, but is tricky to identify. +(define_insn_reservation "r24k_int_div" 36 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "idiv")) + "r24k_iss+(r24k_mul3a+r24k_mul3b+r24k_mul3c)*36") + + +;; 5. Cop: cfc1, di, ei, mfc0, mtc0 +;; (Disabled until we add proper cop0 support) +;;(define_insn_reservation "r24k_int_cop" 3 +;; (and (eq_attr "cpu" "24k,24kx") +;; (eq_attr "type" "cop0")) +;; "r24k_iss+r24k_ixu_arith") + + +;; 6. Store +(define_insn_reservation "r24k_int_store" 1 + (and (eq_attr "cpu" "24k,24kx") + (and (eq_attr "type" "store") + (eq_attr "mode" "!unknown"))) + "r24k_iss+r24k_ixu_arith") + +;; 6.1 Special case - matches the cprestore pattern which don't set the mode +;; attrib. This avoids being set as r24k_int_store and have it checked +;; against store_data_bypass_p, which would then fail because cprestore +;; does not have a normal SET pattern. +(define_insn_reservation "r24k_unknown_store" 1 + (and (eq_attr "cpu" "24k,24kx") + (and (eq_attr "type" "store") + (eq_attr "mode" "unknown"))) + "r24k_iss+r24k_ixu_arith") + + +;; 7. Multiple instructions +(define_insn_reservation "r24k_int_multi" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "multi")) + "r24k_iss+r24k_ixu_arith+r24k_fpu_arith+(r24k_mul3a+r24k_mul3b+r24k_mul3c)") + + +;; 8. Unknowns - Currently these include blockage, consttable and alignment +;; rtls. They do not really affect scheduling latency, (blockage affects +;; scheduling via log links, but not used here). +(define_insn_reservation "r24k_int_unknown" 0 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "unknown")) + "r24k_iss") + + +;; 9. Prefetch +(define_insn_reservation "r24k_int_prefetch" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "prefetch,prefetchx")) + "r24k_iss+r24k_ixu_arith") + + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- + +;; load->next use : 2 cycles (Default) +;; load->load base: 3 cycles +;; load->store base: 3 cycles +;; load->prefetch: 3 cycles +(define_bypass 3 "r24k_int_load" "r24k_int_load") +(define_bypass 3 "r24k_int_load" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 3 "r24k_int_load" "r24k_int_prefetch") + +;; arith->next use : 1 cycles (Default) +;; arith->load base: 2 cycles +;; arith->store base: 2 cycles +;; arith->prefetch: 2 cycles +(define_bypass 2 "r24k_int_arith" "r24k_int_load") +(define_bypass 2 "r24k_int_arith" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 2 "r24k_int_arith" "r24k_int_prefetch") + +;; mul3->next use : 5 cycles (default) +;; mul3->l/s base : 6 cycles +;; mul3->prefetch : 6 cycles +(define_bypass 6 "r24k_int_mul3" "r24k_int_load") +(define_bypass 6 "r24k_int_mul3" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24k_int_mul3" "r24k_int_prefetch") + +;; mfhilo->next use : 5 cycles (default) +;; mfhilo->l/s base : 6 cycles +;; mfhilo->prefetch : 6 cycles +;; mthilo->madd/msub : 2 cycle (only for mthi/lo not mfhi/lo) +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_load") +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_prefetch") +(define_bypass 2 "r24k_int_mthilo" "r24k_int_madd") + +;; cop->next use : 3 cycles (Default) +;; cop->l/s base : 4 cycles +;; (define_bypass 4 "r24k_int_cop" "r24k_int_load") +;; (define_bypass 4 "r24k_int_cop" "r24k_int_store" "!store_data_bypass_p") + +;; multi->next use : 1 cycles (Default) +;; multi->l/s base : 2 cycles +;; multi->prefetch : 2 cycles +(define_bypass 2 "r24k_int_multi" "r24k_int_load") +(define_bypass 2 "r24k_int_multi" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 2 "r24k_int_multi" "r24k_int_prefetch") + + +;; -------------------------------------------------------------- +;; Floating Point Instructions +;; -------------------------------------------------------------- + +(define_cpu_unit "r24k_fpu_arith" "r24k_fpu") + +;; The 24k is a single issue cpu, and the fpu runs at half clock speed, +;; so each fpu instruction ties up the shared instruction scheduler for +;; 1 cycle, and the fpu scheduler for 2 cycles. +;; +;; These timings are therefore twice the values in the 24K manual, +;; which are quoted in fpu clocks. +;; +;; The 24kx is a 24k configured with 1:1 cpu and fpu, so use +;; the unscaled timings + +(define_reservation "r24k_fpu_iss" "r24k_iss+(r24k_fpu_arith*2)") + +;; fadd, fabs, fneg +(define_insn_reservation "r24k_fadd" 8 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fadd,fabs,fneg")) + "r24k_fpu_iss") + +;; fmove, fcmove +(define_insn_reservation "r24k_fmove" 8 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fmove,condmove")) + "r24k_fpu_iss") + +;; fload +(define_insn_reservation "r24k_fload" 6 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fpload,fpidxload")) + "r24k_fpu_iss") + +;; fstore +(define_insn_reservation "r24k_fstore" 2 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fpstore")) + "r24k_fpu_iss") + +;; fmul, fmadd +(define_insn_reservation "r24k_fmul_sf" 8 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "r24k_fpu_iss") + +(define_insn_reservation "r24k_fmul_df" 10 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*2)") + + +;; fdiv, fsqrt, frsqrt +(define_insn_reservation "r24k_fdiv_sf" 34 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "r24k_fpu_iss,(r24k_fpu_arith*26)") + +(define_insn_reservation "r24k_fdiv_df" 64 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fdiv,fsqrt") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*56)") + +;; frsqrt +(define_insn_reservation "r24k_frsqrt_df" 70 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*60)") + +;; fcmp +(define_insn_reservation "r24k_fcmp" 4 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fcmp")) + "r24k_fpu_iss") + +;; fcmp -> movf.fmt & movt.fmt bypass (dependency must be on the condition) +(define_bypass 2 "r24k_fcmp" "r24k_fmove") + +;; fcvt (cvt.d.s, cvt.[sd].[wl]) +(define_insn_reservation "r24k_fcvt_i2f_s2d" 8 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "I2S,I2D,S2D"))) + "r24k_fpu_iss") + +;; fcvt (cvt.s.d) +(define_insn_reservation "r24k_fcvt_s2d" 12 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "D2S"))) + "r24k_fpu_iss") + +;; fcvt (cvt.[wl].[sd], etc) +(define_insn_reservation "r24k_fcvt_f2i" 10 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "S2I,D2I"))) + "r24k_fpu_iss") + +;; fxfer (mfc1, mfhc1, mtc1, mthc1) +(define_insn_reservation "r24k_fxfer" 4 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "xfer")) + "r24k_fpu_iss") + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- +;; r24k_fcvt_f2i->l/s base : 11 cycles +;; r24k_fcvt_f2i->prefetch : 11 cycles +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_load") +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_prefetch") + +;; r24k_fxfer->l/s base : 5 cycles +;; r24k_fxfer->prefetch : 5 cycles +(define_bypass 5 "r24k_fxfer" "r24k_int_load") +(define_bypass 5 "r24k_fxfer" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 5 "r24k_fxfer" "r24k_int_prefetch") + +;; -------------------------------------------------------------- +;; The 24kx is a 24k configured with 1:1 cpu and fpu, so use +;; the unscaled timings +;; -------------------------------------------------------------- + +(define_reservation "r24kx_fpu_iss" "r24k_iss+r24k_fpu_arith") + +;; fadd, fabs, fneg +(define_insn_reservation "r24kx_fadd" 4 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fadd,fabs,fneg")) + "r24kx_fpu_iss") + +;; fmove, fcmove +(define_insn_reservation "r24kx_fmove" 4 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fmove,condmove")) + "r24kx_fpu_iss") + +;; fload +(define_insn_reservation "r24kx_fload" 3 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fpload,fpidxload")) + "r24kx_fpu_iss") + +;; fstore +(define_insn_reservation "r24kx_fstore" 1 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fpstore")) + "r24kx_fpu_iss") + +;; fmul, fmadd +(define_insn_reservation "r24kx_fmul_sf" 4 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "r24kx_fpu_iss") + +(define_insn_reservation "r24kx_fmul_df" 5 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,r24k_fpu_arith") + + +;; fdiv, fsqrt, frsqrt +(define_insn_reservation "r24kx_fdiv_sf" 17 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*13)") + +(define_insn_reservation "r24kx_fdiv_df" 32 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fdiv,fsqrt") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*28)") + +;; frsqrt +(define_insn_reservation "r24kx_frsqrt_df" 35 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*30)") + +;; fcmp +(define_insn_reservation "r24kx_fcmp" 2 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fcmp")) + "r24kx_fpu_iss") + +;; fcmp -> movf.fmt & movt.fmt bypass (dependency must be on the condition) +(define_bypass 1 "r24kx_fcmp" "r24kx_fmove") + +;; fcvt (cvt.d.s, cvt.[sd].[wl]) +(define_insn_reservation "r24kx_fcvt_i2f_s2d" 4 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "I2S,I2D,S2D"))) + "r24kx_fpu_iss") + +;; fcvt (cvt.s.d) +(define_insn_reservation "r24kx_fcvt_s2d" 6 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "D2S"))) + "r24kx_fpu_iss") + +;; fcvt (cvt.[wl].[sd], etc) +(define_insn_reservation "r24kx_fcvt_f2i" 5 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "S2I,D2I"))) + "r24kx_fpu_iss") + +;; fxfer (mfc1, mfhc1, mtc1, mthc1) +(define_insn_reservation "r24kx_fxfer" 2 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "xfer")) + "r24kx_fpu_iss") + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- +;; r24kx_fcvt_f2i->l/s base : 6 cycles +;; r24kx_fcvt_f2i->prefetch : 6 cycles +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_load") +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_prefetch") + +;; r24kx_fxfer->l/s base : 3 cycles +;; r24kx_fxfer->prefetch : 3 cycles +(define_bypass 3 "r24kx_fxfer" "r24k_int_load") +(define_bypass 3 "r24kx_fxfer" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 3 "r24kx_fxfer" "r24k_int_prefetch") + diff --git a/contrib/gcc/config/mips/3000.md b/contrib/gcc/config/mips/3000.md new file mode 100644 index 00000000000..67c7ac05cd1 --- /dev/null +++ b/contrib/gcc/config/mips/3000.md @@ -0,0 +1,72 @@ +;; R3000 and TX39 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r3k_load" 2 + (and (eq_attr "cpu" "r3000,r3900") + (eq_attr "type" "load,fpload,fpidxload")) + "alu") + +(define_insn_reservation "r3k_imul" 12 + (and (eq_attr "cpu" "r3000,r3900") + (eq_attr "type" "imul,imul3,imadd")) + "imuldiv*12") + +(define_insn_reservation "r3k_idiv" 35 + (and (eq_attr "cpu" "r3000,r3900") + (eq_attr "type" "idiv")) + "imuldiv*35") + +(define_insn_reservation "r3k_fmove" 1 + (and (eq_attr "cpu" "r3000,r3900") + (eq_attr "type" "fabs,fneg,fmove")) + "alu") + +(define_insn_reservation "r3k_fadd" 2 + (and (eq_attr "cpu" "r3000,r3900") + (eq_attr "type" "fcmp,fadd")) + "alu") + +(define_insn_reservation "r3k_fmul_single" 4 + (and (eq_attr "cpu" "r3000,r3900") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r3k_fmul_double" 5 + (and (eq_attr "cpu" "r3000,r3900") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "alu") + +(define_insn_reservation "r3k_fdiv_single" 12 + (and (eq_attr "cpu" "r3000,r3900") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r3k_fdiv_double" 19 + (and (eq_attr "cpu" "r3000,r3900") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF"))) + "alu") diff --git a/contrib/gcc/config/mips/4000.md b/contrib/gcc/config/mips/4000.md new file mode 100644 index 00000000000..1e2875f36ef --- /dev/null +++ b/contrib/gcc/config/mips/4000.md @@ -0,0 +1,33 @@ +;; R4000 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r4k_imul" 10 + (and (eq_attr "cpu" "r4000") + (eq_attr "type" "imul,imul3,imadd")) + "imuldiv*10") + +(define_insn_reservation "r4k_idiv" 69 + (and (eq_attr "cpu" "r4000") + (eq_attr "type" "idiv")) + "imuldiv*69") diff --git a/contrib/gcc/config/mips/4100.md b/contrib/gcc/config/mips/4100.md new file mode 100644 index 00000000000..c7314d89277 --- /dev/null +++ b/contrib/gcc/config/mips/4100.md @@ -0,0 +1,52 @@ +;; VR4100 and VR4120 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r4100_load" 2 + (and (eq_attr "cpu" "r4100,r4120") + (eq_attr "type" "load,fpload,fpidxload,xfer")) + "alu") + +(define_insn_reservation "r4100_imul_si" 1 + (and (eq_attr "cpu" "r4100,r4120") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "imuldiv") + +(define_insn_reservation "r4100_imul_di" 4 + (and (eq_attr "cpu" "r4100,r4120") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "imuldiv*4") + +(define_insn_reservation "r4100_idiv_si" 35 + (and (eq_attr "cpu" "r4100,r4120") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "imuldiv*35") + +(define_insn_reservation "r4100_idiv_di" 67 + (and (eq_attr "cpu" "r4100,r4120") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "imuldiv*67") diff --git a/contrib/gcc/config/mips/4130.md b/contrib/gcc/config/mips/4130.md new file mode 100644 index 00000000000..6feeab38bbf --- /dev/null +++ b/contrib/gcc/config/mips/4130.md @@ -0,0 +1,136 @@ +;; +;; Pipeline description for the VR4130 family. +;; +;; The processor issues each 8-byte aligned pair of instructions together, +;; stalling the second instruction if it depends on the first. Thus, if we +;; want two instructions to issue in parallel, we need to make sure that the +;; first one is 8-byte aligned. +;; +;; For the purposes of this pipeline description, we treat the processor +;; like a standard two-way superscalar architecture. If scheduling were +;; the last pass to run, we could use the scheduler hooks to vary the +;; issue rate depending on whether an instruction is at an aligned or +;; unaligned address. Unfortunately, delayed branch scheduling and +;; hazard avoidance are done after the final scheduling pass, and they +;; can change the addresses of many instructions. +;; +;; We get around this in two ways: +;; +;; (1) By running an extra pass at the end of compilation. This pass goes +;; through the function looking for pairs of instructions that could +;; execute in parallel. It makes sure that the first instruction in +;; each pair is suitably aligned, inserting nops if necessary. Doing +;; this gives the same kind of pipeline behavior we would see on a +;; normal superscalar target. +;; +;; This pass is generally a speed improvement, but the extra nops will +;; obviously make the program bigger. It is therefore unsuitable for +;; -Os (at the very least). +;; +;; (2) By modifying the scheduler hooks so that, where possible: +;; +;; (a) dependent instructions are separated by a non-dependent +;; instruction; +;; +;; (b) instructions that use the multiplication unit are separated +;; by non-multiplication instructions; and +;; +;; (c) memory access instructions are separated by non-memory +;; instructions. +;; +;; The idea is to keep conflicting instructions apart wherever possible +;; and thus make the schedule less dependent on alignment. + +(define_automaton "vr4130_main, vr4130_muldiv, vr4130_mulpre") + +(define_cpu_unit "vr4130_alu1, vr4130_alu2, vr4130_dcache" "vr4130_main") +(define_cpu_unit "vr4130_muldiv" "vr4130_muldiv") + +;; This is a fake unit for pre-reload scheduling of multiplications. +;; It enforces the true post-reload repeat rate. +(define_cpu_unit "vr4130_mulpre" "vr4130_mulpre") + +;; The scheduling hooks use this attribute for (b) above. +(define_attr "vr4130_class" "mul,mem,alu" + (cond [(eq_attr "type" "load,store") + (const_string "mem") + + (eq_attr "type" "mfhilo,mthilo,imul,imul3,imadd,idiv") + (const_string "mul")] + (const_string "alu"))) + +(define_insn_reservation "vr4130_multi" 1 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "multi,unknown")) + "vr4130_alu1 + vr4130_alu2 + vr4130_dcache + vr4130_muldiv") + +(define_insn_reservation "vr4130_int" 1 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "const,arith,shift,slt,nop")) + "vr4130_alu1 | vr4130_alu2") + +(define_insn_reservation "vr4130_load" 3 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "load")) + "vr4130_dcache") + +(define_insn_reservation "vr4130_store" 1 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "store")) + "vr4130_dcache") + +(define_insn_reservation "vr4130_mfhilo" 3 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "mfhilo")) + "vr4130_muldiv") + +(define_insn_reservation "vr4130_mthilo" 1 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "mthilo")) + "vr4130_muldiv") + +;; The product is available in LO & HI after one cycle. Moving the result +;; into an integer register will take an additional three cycles, see mflo +;; & mfhi above. Note that the same latencies and repeat rates apply if we +;; use "mtlo; macc" instead of "mult; mflo". +(define_insn_reservation "vr4130_mulsi" 4 + (and (eq_attr "cpu" "r4130") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "SI"))) + "vr4130_muldiv + (vr4130_mulpre * 2)") + +;; As for vr4130_mulsi, but the product is available in LO and HI +;; after 3 cycles. +(define_insn_reservation "vr4130_muldi" 6 + (and (eq_attr "cpu" "r4130") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "(vr4130_muldiv * 3) + (vr4130_mulpre * 4)") + +;; maccs can execute in consecutive cycles without stalling, but it +;; is 3 cycles before the integer destination can be read. +(define_insn_reservation "vr4130_macc" 3 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "imadd")) + "vr4130_muldiv") + +(define_bypass 1 "vr4130_mulsi,vr4130_macc" "vr4130_macc" "mips_linked_madd_p") +(define_bypass 1 "vr4130_mulsi,vr4130_macc" "vr4130_mfhilo") +(define_bypass 3 "vr4130_muldi" "vr4130_mfhilo") + +(define_insn_reservation "vr4130_divsi" 36 + (and (eq_attr "cpu" "r4130") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "vr4130_muldiv * 36") + +(define_insn_reservation "vr4130_divdi" 72 + (and (eq_attr "cpu" "r4130") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "vr4130_muldiv * 72") + +(define_insn_reservation "vr4130_branch" 0 + (and (eq_attr "cpu" "r4130") + (eq_attr "type" "branch,jump,call")) + "vr4130_alu1 | vr4130_alu2") diff --git a/contrib/gcc/config/mips/4300.md b/contrib/gcc/config/mips/4300.md new file mode 100644 index 00000000000..7453f4c320b --- /dev/null +++ b/contrib/gcc/config/mips/4300.md @@ -0,0 +1,86 @@ +;; VR4300 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r4300_load" 2 + (and (eq_attr "cpu" "r4300") + (eq_attr "type" "load,fpload,fpidxload,xfer")) + "alu") + +(define_insn_reservation "r4300_imul_si" 5 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "imuldiv*5") + +(define_insn_reservation "r4300_imul_di" 8 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "imuldiv*8") + +(define_insn_reservation "r4300_idiv_si" 37 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "imuldiv*37") + +(define_insn_reservation "r4300_idiv_di" 69 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "imuldiv*69") + +(define_insn_reservation "r4300_fmove" 1 + (and (eq_attr "cpu" "r4300") + (eq_attr "type" "fcmp,fabs,fneg,fmove")) + "imuldiv") + +(define_insn_reservation "r4300_fadd" 3 + (and (eq_attr "cpu" "r4300") + (eq_attr "type" "fadd")) + "imuldiv*3") + +(define_insn_reservation "r4300_fmul_single" 5 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "imuldiv*5") + +(define_insn_reservation "r4300_fmul_double" 8 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "imuldiv*8") + +(define_insn_reservation "r4300_fdiv_single" 29 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "imuldiv*29") + +(define_insn_reservation "r4300_fdiv_double" 58 + (and (eq_attr "cpu" "r4300") + (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") + (eq_attr "mode" "DF"))) + "imuldiv*58") diff --git a/contrib/gcc/config/mips/4600.md b/contrib/gcc/config/mips/4600.md new file mode 100644 index 00000000000..df3f72d6bf4 --- /dev/null +++ b/contrib/gcc/config/mips/4600.md @@ -0,0 +1,88 @@ +;; R4600 and R4650 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. +;; +;; We handle the R4600 and R4650 in much the same way. The only difference +;; is in the integer multiplication and division costs. + +(define_insn_reservation "r4600_imul" 10 + (and (eq_attr "cpu" "r4600") + (eq_attr "type" "imul,imul3,imadd")) + "imuldiv*10") + +(define_insn_reservation "r4600_idiv" 42 + (and (eq_attr "cpu" "r4600") + (eq_attr "type" "idiv")) + "imuldiv*42") + + +(define_insn_reservation "r4650_imul" 4 + (and (eq_attr "cpu" "r4650") + (eq_attr "type" "imul,imul3,imadd")) + "imuldiv*4") + +(define_insn_reservation "r4650_idiv" 36 + (and (eq_attr "cpu" "r4650") + (eq_attr "type" "idiv")) + "imuldiv*36") + + +(define_insn_reservation "r4600_load" 2 + (and (eq_attr "cpu" "r4600,r4650") + (eq_attr "type" "load,fpload,fpidxload")) + "alu") + +(define_insn_reservation "r4600_fmove" 1 + (and (eq_attr "cpu" "r4600,r4650") + (eq_attr "type" "fabs,fneg,fmove")) + "alu") + +(define_insn_reservation "r4600_fmul_single" 8 + (and (eq_attr "cpu" "r4600,r4650") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r4600_fdiv_single" 32 + (and (eq_attr "cpu" "r4600,r4650") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r4600_fdiv_double" 61 + (and (eq_attr "cpu" "r4600,r4650") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF"))) + "alu") + +(define_insn_reservation "r4600_fsqrt_single" 31 + (and (eq_attr "cpu" "r4600,r4650") + (and (eq_attr "type" "fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r4600_fsqrt_double" 60 + (and (eq_attr "cpu" "r4600,r4650") + (and (eq_attr "type" "fsqrt,frsqrt") + (eq_attr "mode" "DF"))) + "alu") diff --git a/contrib/gcc/config/mips/4k.md b/contrib/gcc/config/mips/4k.md new file mode 100644 index 00000000000..6f7d6d1d979 --- /dev/null +++ b/contrib/gcc/config/mips/4k.md @@ -0,0 +1,154 @@ +;; DFA-based pipeline descriptions for MIPS32 4K processor family +;; Contributed by Nigel Stephens (nigel@mips.com) +;; and David Ung (davidu@mips.com) +;; +;; References: +;; "MIPS32 4K Processor Core Family Software User's Manual, +;; Doc no: MD00016, Rev 1.18, Nov 15, 2004." +;; +;; 4Kc - pipelined multiplier and translation lookaside buffer (TLB) +;; 4km - pipelined multiplier and block address translator (BAT) +;; 4kp - non-pipelined multiplier and block address translator (BAT) +;; +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +(define_automaton "r4k_cpu, r4k_mdu") + +;; Integer execution unit. +(define_cpu_unit "r4k_ixu_arith" "r4k_cpu") +(define_cpu_unit "r4k_ixu_mpydiv" "r4k_mdu") + +(define_insn_reservation "r4k_int_load" 2 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "load")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_prefetch" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "prefetch")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_store" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "store")) + "r4k_ixu_arith") + +;; 4Kc/4Km +;; unsigned divide - 8/16/24/32 bit operand have latencies 9/17/25/33 +;; signed divide - 8/16/24/32 bit operand have latencies 10/18/26/34 +(define_insn_reservation "r4k_idiv_4kc" 34 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*34)") + +;; 4Kp +;; unsigned divide - 33 +;; signed divide - 33-35 +(define_insn_reservation "r4k_idiv_4kp" 35 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*35)") + +;; 4Kc/4Km fast 32x32 multiply +;; 16x32 is faster, but there's no way to detect this +(define_insn_reservation "r4k_mult_4kc" 2 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*2)") + +;; 4Kc/4Km MUL has 2 cycle latency, but has the special property that it will +;; stall the integer unit pipeline. MUL 16x16 or 32x16 forces 1 cycle stall, +;; while MUL 32x32 forces 2 cycle stall. If next insn use the result, an +;; additional stall is forced. +(define_insn_reservation "r4k_mul_4kc" 4 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "(r4k_ixu_arith+r4k_ixu_mpydiv)*3") + +;; 4Kp slow iterative 2-op MULT +;; Latency of 32 if next insn is MADD/MSUB,MFHI/MFLO. +;; Repeat rate of 33 cycles. +(define_insn_reservation "r4k_mult_4kp" 32 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imul") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*32)") + +;; 4Kp slow iterative 3-op MUL +;; Latency of 32 cycles, but stalls the whole pipeline until complete. +(define_insn_reservation "r4k_mul_4kp" 32 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "(r4k_ixu_arith+r4k_ixu_mpydiv)*32") + +;; 4Kp slow iterative MADD +;; Latency of 34 if next use insn is MADD/MSUB,MFHI/MFLO. +;; Repeat rate of 35 cycles. +(define_insn_reservation "r4k_madd_4kp" 34 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imadd") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*34)") + +;; Move to HI/LO -> MADD/MSUB,MFHI/MFLO has a 1 cycle latency. +(define_insn_reservation "r4k_int_mthilo" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "mthilo")) + "r4k_ixu_arith+r4k_ixu_mpydiv") + +;; Move from HI/LO -> integer operation has a 2 cycle latency. +(define_insn_reservation "r4k_int_mfhilo" 2 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "mfhilo")) + "r4k_ixu_arith+r4k_ixu_mpydiv") + +;; All other integer insns. +(define_insn_reservation "r4k_int_alu" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "arith,condmove,shift,const,nop,slt")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_branch" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "branch")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_jump_4k" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "jump,call")) + "r4k_ixu_arith") + +;; mfcx/mtcx - non FPU +;; (Disabled until we add cop0 support) +;; (define_insn_reservation "r4k_int_cop" 2 +;; (and (eq_attr "cpu" "4kc,4kp") +;; (eq_attr "type" "cop0")) +;; "r4k_ixu_arith") + +;; Unknown or multi - single issue +(define_insn_reservation "r4k_unknown" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "unknown,multi")) + "r4k_ixu_arith+r4k_ixu_mpydiv") diff --git a/contrib/gcc/config/mips/5000.md b/contrib/gcc/config/mips/5000.md new file mode 100644 index 00000000000..4d9c98cbc68 --- /dev/null +++ b/contrib/gcc/config/mips/5000.md @@ -0,0 +1,81 @@ +;; VR5000 pipeline description. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r5k_load" 2 + (and (eq_attr "cpu" "r5000") + (eq_attr "type" "load,fpload,fpidxload,xfer")) + "alu") + +(define_insn_reservation "r5k_imul_si" 5 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "imuldiv*5") + +(define_insn_reservation "r5k_imul_di" 9 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "imuldiv*9") + +(define_insn_reservation "r5k_idiv_si" 36 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "imuldiv*36") + +(define_insn_reservation "r5k_idiv_di" 68 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "imuldiv*68") + +(define_insn_reservation "r5k_fmove" 1 + (and (eq_attr "cpu" "r5000") + (eq_attr "type" "fcmp,fabs,fneg,fmove")) + "alu") + +(define_insn_reservation "r5k_fmul_single" 4 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r5k_fmul_double" 5 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "alu") + +(define_insn_reservation "r5k_fdiv_single" 21 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r5k_fsqrt_double" 36 + (and (eq_attr "cpu" "r5000") + (and (eq_attr "type" "fsqrt,frsqrt") + (eq_attr "mode" "DF"))) + "alu") diff --git a/contrib/gcc/config/mips/5400.md b/contrib/gcc/config/mips/5400.md new file mode 100644 index 00000000000..8571308c96e --- /dev/null +++ b/contrib/gcc/config/mips/5400.md @@ -0,0 +1,166 @@ +;; DFA-based pipeline description for 5400 +(define_automaton "vr54") +(define_cpu_unit "vr54_dp0" "vr54") +(define_cpu_unit "vr54_dp1" "vr54") +(define_cpu_unit "vr54_mem" "vr54") +(define_cpu_unit "vr54_mac" "vr54") + +;; +;; The ordering of the instruction-execution-path/resource-usage +;; descriptions (also known as reservation RTL) is roughly ordered +;; based on the define attribute RTL for the "type" classification. +;; When modifying, remember that the first test that matches is the +;; reservation used! +;; + +(define_insn_reservation "ir_vr54_unknown" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "unknown")) + "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac") + +;; Assume prediction fails. +(define_insn_reservation "ir_vr54_branch" 3 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "branch,jump,call")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_load" 2 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "load,fpload,fpidxload")) + "vr54_mem") + +(define_insn_reservation "ir_vr54_store" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "store")) + "vr54_mem") + +(define_insn_reservation "ir_vr54_fstore" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "fpstore,fpidxstore")) + "vr54_mem") + + +;; This reservation is for conditional move based on integer +;; or floating point CC. +(define_insn_reservation "ir_vr54_condmove" 4 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "condmove")) + "vr54_dp0|vr54_dp1") + +;; Move to/from FPU registers +(define_insn_reservation "ir_vr54_xfer" 2 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "xfer")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_hilo" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "mthilo,mfhilo")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_arith" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "arith,shift,slt,clz,const,nop,trap")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_imul_si" 3 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "SI"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_imul_di" 4 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_imadd_si" 3 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "imul,imul3")) + "vr54_mac") + +(define_insn_reservation "ir_vr54_idiv_si" 42 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_idiv_di" 74 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fadd" 4 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "fadd")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fmul_sf" 5 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fmul") + (eq_attr "mode" "SF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fmul_df" 6 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fmul") + (eq_attr "mode" "DF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fmadd_sf" 9 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fmadd") + (eq_attr "mode" "SF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fmadd_df" 10 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fmadd") + (eq_attr "mode" "DF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fdiv_sf" 42 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "SF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fdiv_df" 72 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "DF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fabs" 2 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "fabs,fneg,fmove")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fcmp" 2 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "fcmp")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_fcvt" 6 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "fcvt")) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_frsqrt_sf" 61 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_frsqrt_df" 121 + (and (eq_attr "cpu" "r5400") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "vr54_dp0|vr54_dp1") + +(define_insn_reservation "ir_vr54_multi" 1 + (and (eq_attr "cpu" "r5400") + (eq_attr "type" "multi")) + "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac") diff --git a/contrib/gcc/config/mips/5500.md b/contrib/gcc/config/mips/5500.md new file mode 100644 index 00000000000..881cbcb4cff --- /dev/null +++ b/contrib/gcc/config/mips/5500.md @@ -0,0 +1,209 @@ +;; DFA-based pipeline description for 5500 +(define_automaton "vr55") +(define_cpu_unit "vr55_dp0" "vr55") +(define_cpu_unit "vr55_dp1" "vr55") +(define_cpu_unit "vr55_mem" "vr55") +(define_cpu_unit "vr55_mac" "vr55") +(define_cpu_unit "vr55_fp" "vr55") +(define_cpu_unit "vr55_bru" "vr55") + +;; +;; The ordering of the instruction-execution-path/resource-usage +;; descriptions (also known as reservation RTL) is roughly ordered +;; based on the define attribute RTL for the "type" classification. +;; When modifying, remember that the first test that matches is the +;; reservation used! +;; + +(define_insn_reservation "ir_vr55_unknown" 1 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "unknown")) + "vr55_dp0+vr55_dp1+vr55_mem+vr55_mac+vr55_fp+vr55_bru") + +;; Assume prediction fails. +(define_insn_reservation "ir_vr55_branch" 2 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "branch,jump,call")) + "vr55_bru") + +(define_insn_reservation "ir_vr55_load" 3 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "load,fpload,fpidxload")) + "vr55_mem") + +(define_bypass 4 + "ir_vr55_load" + "ir_vr55_mthilo,ir_vr55_imul_si,ir_vr55_imul_di,ir_vr55_imadd, + ir_vr55_idiv_si,ir_vr55_idiv_di") + +(define_insn_reservation "ir_vr55_store" 0 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "store,fpstore,fpidxstore")) + "vr55_mem") + +;; This reservation is for conditional move based on integer +;; or floating point CC. +(define_insn_reservation "ir_vr55_condmove" 2 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "condmove")) + "vr55_dp0|vr55_dp1") + +;; Move to/from FPU registers +(define_insn_reservation "ir_vr55_xfer" 2 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "xfer")) + "vr55_dp0|vr55_dp1") + +(define_insn_reservation "ir_vr55_arith" 1 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "arith,shift,slt,clz,const,nop,trap")) + "vr55_dp0|vr55_dp1") + +(define_bypass 2 + "ir_vr55_arith" + "ir_vr55_mthilo,ir_vr55_imul_si,ir_vr55_imul_di,ir_vr55_imadd, + ir_vr55_idiv_si,ir_vr55_idiv_di") + +(define_insn_reservation "ir_vr55_mthilo" 1 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "mthilo")) + "vr55_mac") + +(define_insn_reservation "ir_vr55_mfhilo" 5 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "mfhilo")) + "vr55_mac") + +;; The default latency is for the GPR result of a mul. Bypasses handle the +;; latency of {mul,mult}->{mfhi,mflo}. +(define_insn_reservation "ir_vr55_imul_si" 5 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "SI"))) + "vr55_mac") + +;; The default latency is for pre-reload scheduling and handles the case +;; where a pseudo destination will be stored in a GPR (as it usually is). +;; The delay includes the latency of the dmult itself and the anticipated +;; mflo or mfhi. +;; +;; Once the mflo or mfhi has been created, bypasses handle the latency +;; between it and the dmult. +(define_insn_reservation "ir_vr55_imul_di" 9 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "vr55_mac*4") + +;; The default latency is as for ir_vr55_imul_si. +(define_insn_reservation "ir_vr55_imadd" 5 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "imadd")) + "vr55_mac") + +(define_bypass 1 + "ir_vr55_imul_si,ir_vr55_imadd" + "ir_vr55_imadd" + "mips_linked_madd_p") + +(define_bypass 2 + "ir_vr55_imul_si,ir_vr55_imadd" + "ir_vr55_mfhilo") + +(define_bypass 4 + "ir_vr55_imul_di" + "ir_vr55_mfhilo") + +;; Divide algorithm is early out with best latency of 7 pcycles. +;; Use worst case for scheduling purposes. +(define_insn_reservation "ir_vr55_idiv_si" 42 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_idiv_di" 74 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fadd" 4 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "fadd")) + "vr55_fp") + +(define_insn_reservation "ir_vr55_fmul_sf" 5 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fmul") + (eq_attr "mode" "SF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fmul_df" 6 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fmul") + (eq_attr "mode" "DF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fmadd_sf" 9 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fmadd") + (eq_attr "mode" "SF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fmadd_df" 10 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fmadd") + (eq_attr "mode" "DF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fdiv_sf" 30 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "SF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fdiv_df" 59 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "DF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_fabs" 2 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "fabs,fneg,fmove")) + "vr55_fp") + +(define_insn_reservation "ir_vr55_fcmp" 2 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "fcmp")) + "vr55_fp") + +(define_insn_reservation "ir_vr55_fcvt_sf" 4 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fcvt") + (eq_attr "mode" "SF"))) + "vr55_fp") + +(define_insn_reservation "ir_vr55_fcvt_df" 6 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "fcvt") + (eq_attr "mode" "DF"))) + "vr55_fp") + +(define_insn_reservation "ir_vr55_frsqrt_sf" 60 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_frsqrt_df" 118 + (and (eq_attr "cpu" "r5500") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "vr55_mac") + +(define_insn_reservation "ir_vr55_multi" 1 + (and (eq_attr "cpu" "r5500") + (eq_attr "type" "multi")) + "vr55_dp0+vr55_dp1+vr55_mem+vr55_mac+vr55_fp+vr55_bru") diff --git a/contrib/gcc/config/mips/5k.md b/contrib/gcc/config/mips/5k.md new file mode 100644 index 00000000000..0fa588ac6dc --- /dev/null +++ b/contrib/gcc/config/mips/5k.md @@ -0,0 +1,230 @@ +;; DFA-based pipeline descriptions for MIPS32 5K processor family +;; Contributed by David Ung (davidu@mips.com) +;; and Nigel Stephens (nigel@mips.com) +;; +;; References: +;; "MIPS64 5K Processor Core Family Software User's Manual, +;; Doc no: MD00012, Rev 2.09, Jan 28, 2005." +;; +;; 5Kc - Single issue with no floating point unit. +;; 5kf - Separate floating point pipe which can dual-issue with the +;; integer pipe. +;; +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +(define_automaton "r5k_cpu, r5k_mdu, r5k_fpu") + +;; Integer execution unit. +(define_cpu_unit "r5k_ixu_arith" "r5k_cpu") +(define_cpu_unit "r5k_ixu_mpydiv" "r5k_mdu") +(define_cpu_unit "r5kf_fpu_arith" "r5k_fpu") + +(define_insn_reservation "r5k_int_load" 2 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "load")) + "r5k_ixu_arith") + +(define_insn_reservation "r5k_int_prefetch" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "prefetch,prefetchx")) + "r5k_ixu_arith") + +(define_insn_reservation "r5k_int_store" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "store")) + "r5k_ixu_arith") + +;; Divides +(define_insn_reservation "r5k_int_divsi" 34 + (and (eq_attr "cpu" "5kc,5kf") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "r5k_ixu_arith+(r5k_ixu_mpydiv*34)") + +(define_insn_reservation "r5k_int_divdi" 66 + (and (eq_attr "cpu" "5kc,5kf") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "r5k_ixu_arith+(r5k_ixu_mpydiv*66)") + +;; 32x32 multiply +;; 32x16 is faster, but there's no way to detect this +(define_insn_reservation "r5k_int_mult" 2 + (and (eq_attr "cpu" "5kc,5kf") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "SI"))) + "r5k_ixu_arith+(r5k_ixu_mpydiv*2)") + +;; 64x64 multiply +(define_insn_reservation "r5k_int_mult_64" 9 + (and (eq_attr "cpu" "5kc,5kf") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "DI"))) + "r5k_ixu_arith+(r5k_ixu_mpydiv*2)") + +;; 3 operand MUL 32x32 +(define_insn_reservation "r5k_int_mul" 4 + (and (eq_attr "cpu" "5kc,5kf") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "r5k_ixu_arith+(r5k_ixu_mpydiv*2)") + +;; Move to HI/LO -> MADD/MSUB,MFHI/MFLO has a 1 cycle latency. +(define_insn_reservation "r5k_int_mthilo" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "mthilo")) + "r5k_ixu_arith+r5k_ixu_mpydiv") + +;; Move from HI/LO -> integer operation has a 2 cycle latency. +(define_insn_reservation "r5k_int_mfhilo" 2 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "mfhilo")) + "r5k_ixu_arith+r5k_ixu_mpydiv") + +;; All other integer insns. +(define_insn_reservation "r5k_int_alu" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "arith,condmove,shift,const,nop,slt")) + "r5k_ixu_arith") + +(define_insn_reservation "r5k_int_branch" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "branch")) + "r5k_ixu_arith") + +;; JR/JALR always cause one pipeline bubble because of interlock. +(define_insn_reservation "r5k_int_jump" 2 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "jump,call")) + "r5k_ixu_arith") + +;; Any -> JR/JALR (without dependency) : 1 clock issue delay +;; Any -> JR/JALR (with dependency) : 2 clock issue delay +;; load -> JR/JALR (with dependency) : 3 clock issue delay +;; mfhilo -> JR/JALR (with dependency) : 3 clock issue delay +;; mul -> JR/JALR (with dependency) : 3 clock issue delay +(define_bypass 2 "r5k_int_alu" "r5k_int_jump") +(define_bypass 3 "r5k_int_load" "r5k_int_jump") +(define_bypass 3 "r5k_int_mfhilo" "r5k_int_jump") +(define_bypass 3 "r5k_int_mul" "r5k_int_jump") + +;; Unknown or multi - single issue +(define_insn_reservation "r5k_int_unknown" 1 + (and (eq_attr "cpu" "5kc,5kf") + (eq_attr "type" "unknown,multi")) + "r5k_ixu_arith+r5k_ixu_mpydiv") + + +;; Floating Point Instructions +;; The 5Kf is a partial dual-issue cpu which can dual issue an integer +;; and floating-point instruction in the same cycle. + +;; fadd, fabs, fneg +(define_insn_reservation "r5kf_fadd" 4 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "fadd,fabs,fneg")) + "r5kf_fpu_arith") + +;; fmove, fcmove +(define_insn_reservation "r5kf_fmove" 4 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "fmove")) + "r5kf_fpu_arith") + +;; fload +(define_insn_reservation "r5kf_fload" 3 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "fpload,fpidxload")) + "r5kf_fpu_arith") + +;; fstore +(define_insn_reservation "r5kf_fstore" 1 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "fpstore")) + "r5kf_fpu_arith") + +;; fmul, fmadd +(define_insn_reservation "r5kf_fmul_sf" 4 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "r5kf_fpu_arith") + +(define_insn_reservation "r5kf_fmul_df" 5 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "r5kf_fpu_arith*2") + +;; fdiv, fsqrt, frsqrt +(define_insn_reservation "r5kf_fdiv_sf" 17 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "r5kf_fpu_arith*14") + +(define_insn_reservation "r5kf_fdiv_df" 32 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fdiv,fsqrt") + (eq_attr "mode" "DF"))) + "r5kf_fpu_arith*29") + +;; frsqrt +(define_insn_reservation "r5kf_frsqrt_df" 35 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "r5kf_fpu_arith*31") + +;; fcmp +(define_insn_reservation "r5kf_fcmp" 2 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "fcmp")) + "r5kf_fpu_arith") + +;; fcmp -> movf.fmt & movt.fmt bypass (dependency must be on condition) +(define_bypass 1 "r5kf_fcmp" "r5kf_fmove") + +;; fcvt (cvt.d.s, cvt.[sd].[wl] +(define_insn_reservation "r5kf_fcvt_d2s" 4 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "I2S,I2D,S2D"))) + "r5kf_fpu_arith") + +;; fcvt (cvt.s.d) +(define_insn_reservation "r5kf_fcvt_s2d" 6 + (and (eq_attr "cpu" "5kc") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "D2S"))) + "r5kf_fpu_arith") + +;; fcvt (cvt.[wl].[sd], etc) +(define_insn_reservation "r5kf_fcvt_f2i" 5 + (and (eq_attr "cpu" "5kf") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "S2I,D2I"))) + "r5kf_fpu_arith") + +;; fxfer (mfc1, mfhc1, mtc1, mthc1) - single issue +(define_insn_reservation "r5kf_fxfer" 2 + (and (eq_attr "cpu" "5kf") + (eq_attr "type" "xfer")) + "r5k_ixu_arith+r5kf_fpu_arith") diff --git a/contrib/gcc/config/mips/6000.md b/contrib/gcc/config/mips/6000.md new file mode 100644 index 00000000000..ac06e7adbd9 --- /dev/null +++ b/contrib/gcc/config/mips/6000.md @@ -0,0 +1,57 @@ +;; R6000 pipeline description. +;; Copyright (C) 2004 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file overrides parts of generic.md. It is derived from the +;; old define_function_unit description. + +(define_insn_reservation "r6k_fcmp" 2 + (and (eq_attr "cpu" "r6000") + (eq_attr "type" "fcmp")) + "alu") + +(define_insn_reservation "r6k_fadd" 3 + (and (eq_attr "cpu" "r6000") + (eq_attr "type" "fadd")) + "alu") + +(define_insn_reservation "r6k_fmul_single" 5 + (and (eq_attr "cpu" "r6000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r6k_fmul_double" 6 + (and (eq_attr "cpu" "r6000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "alu") + +(define_insn_reservation "r6k_fdiv_single" 15 + (and (eq_attr "cpu" "r6000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF"))) + "alu") + +(define_insn_reservation "r6k_fdiv_double" 16 + (and (eq_attr "cpu" "r6000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF"))) + "alu") diff --git a/contrib/gcc/config/mips/7000.md b/contrib/gcc/config/mips/7000.md new file mode 100644 index 00000000000..a67851ced57 --- /dev/null +++ b/contrib/gcc/config/mips/7000.md @@ -0,0 +1,215 @@ +;; DFA-based pipeline description for the RM7000. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +;; ......................... +;; +;; The RM7000 is a dual-issue processor that can bundle instructions as: +;; {arith|load|store}{arith|imul|idiv|branch|float} +;; +;; Reference: +;; "RM7000 Family User Manual, PMC-2002296" +;; +;; ......................... + +;; Use three automata to isolate long latency operations, reducing space. +(define_automaton "rm7000_other, rm7000_fdiv, rm7000_idiv") + +;; +;; Describe the resources. +;; + +;; Global +(define_cpu_unit "rm7_iss0,rm7_iss1" "rm7000_other") + +;; Integer execution unit (M-Pipe). +(define_cpu_unit "ixum_addsub_agen" "rm7000_other") + +;; Integer execution unit (F-Pipe). +(define_cpu_unit "ixuf_addsub" "rm7000_other") +(define_cpu_unit "ixuf_branch" "rm7000_other") +(define_cpu_unit "ixuf_mpydiv" "rm7000_other") +(define_cpu_unit "ixuf_mpydiv_iter" "rm7000_idiv") +;; Floating-point unit (F-Pipe). +(define_cpu_unit "fxuf_add" "rm7000_other") +(define_cpu_unit "fxuf_mpy" "rm7000_other") +(define_cpu_unit "fxuf_mpy_iter" "rm7000_fdiv") +(define_cpu_unit "fxuf_divsqrt" "rm7000_other") +(define_cpu_unit "fxuf_divsqrt_iter" "rm7000_fdiv") + +(exclusion_set "ixuf_addsub" + "ixuf_branch,ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt") +(exclusion_set "ixuf_branch" "ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt") +(exclusion_set "ixuf_mpydiv" "fxuf_add,fxuf_mpy,fxuf_divsqrt") +(exclusion_set "fxuf_add" "fxuf_mpy,fxuf_divsqrt") +(exclusion_set "fxuf_mpy" "fxuf_divsqrt") + +;; After branch any insn cannot be issued. +(absence_set "rm7_iss0,rm7_iss1" "ixuf_branch") + +;; +;; Define reservations for unit name mnemonics or combinations. +;; + +(define_reservation "rm7_iss" "rm7_iss0|rm7_iss1") +(define_reservation "rm7_single_dispatch" "rm7_iss0+rm7_iss1") + +(define_reservation "rm7_iaddsub" "rm7_iss+(ixum_addsub_agen|ixuf_addsub)") +(define_reservation "rm7_imem" "rm7_iss+ixum_addsub_agen") +(define_reservation "rm7_impydiv" "rm7_iss+ixuf_mpydiv") +(define_reservation "rm7_impydiv_iter" "ixuf_mpydiv_iter") +(define_reservation "rm7_branch" "rm7_iss+ixuf_branch") + +(define_reservation "rm7_fpadd" "rm7_iss+fxuf_add") +(define_reservation "rm7_fpmpy" "rm7_iss+fxuf_mpy") +(define_reservation "rm7_fpmpy_iter" "fxuf_mpy_iter") +(define_reservation "rm7_fpdivsqr" "rm7_iss+fxuf_divsqrt") +(define_reservation "rm7_fpdivsqr_iter" "fxuf_divsqrt_iter") + +;; +;; Describe instruction reservations for integer operations. +;; + +(define_insn_reservation "rm7_int_other" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "arith,shift,slt,clz,const,condmove,nop,trap")) + "rm7_iaddsub") + +(define_insn_reservation "rm7_ld" 2 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "load,fpload,fpidxload")) + "rm7_imem") + +(define_insn_reservation "rm7_st" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "store,fpstore,fpidxstore")) + "rm7_imem") + +(define_insn_reservation "rm7_idiv_si" 36 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "rm7_impydiv+(rm7_impydiv_iter*36)") + +(define_insn_reservation "rm7_idiv_di" 68 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "rm7_impydiv+(rm7_impydiv_iter*68)") + +(define_insn_reservation "rm7_impy_si_mult" 5 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "SI"))) + "rm7_impydiv+(rm7_impydiv_iter*3)") + +;; There are an additional 2 stall cycles. +(define_insn_reservation "rm7_impy_si_mul" 2 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "rm7_impydiv") + +(define_insn_reservation "rm7_impy_di" 9 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "rm7_impydiv+(rm7_impydiv_iter*8)") + +;; Move to/from HI/LO. +(define_insn_reservation "rm7_mthilo" 3 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "mthilo")) + "rm7_impydiv") + +(define_insn_reservation "rm7_mfhilo" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "mfhilo")) + "rm7_impydiv") + +;; Move to/from fp coprocessor. +(define_insn_reservation "rm7_ixfer" 2 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "xfer")) + "rm7_iaddsub") + +(define_insn_reservation "rm7_ibr" 3 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "branch,jump,call")) + "rm7_branch") + +;; +;; Describe instruction reservations for the floating-point operations. +;; +(define_insn_reservation "rm7_fp_quick" 4 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fneg,fcmp,fabs,fmove")) + "rm7_fpadd") + +(define_insn_reservation "rm7_fp_other" 4 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fadd")) + "rm7_fpadd") + +(define_insn_reservation "rm7_fp_cvt" 4 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fcvt")) + "rm7_fpadd") + +(define_insn_reservation "rm7_fp_divsqrt_df" 36 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "DF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*36)") + +(define_insn_reservation "rm7_fp_divsqrt_sf" 21 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "SF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*21)") + +(define_insn_reservation "rm7_fp_rsqrt_df" 68 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*68)") + +(define_insn_reservation "rm7_fp_rsqrt_sf" 38 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*38)") + +(define_insn_reservation "rm7_fp_mpy_sf" 4 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "rm7_fpmpy+rm7_fpmpy_iter") + +(define_insn_reservation "rm7_fp_mpy_df" 5 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "rm7_fpmpy+(rm7_fpmpy_iter*2)") + +;; Force single-dispatch for unknown or multi. +(define_insn_reservation "rm7_unknown" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "unknown,multi")) + "rm7_single_dispatch") diff --git a/contrib/gcc/config/mips/9000.md b/contrib/gcc/config/mips/9000.md new file mode 100644 index 00000000000..04ddc8cc05c --- /dev/null +++ b/contrib/gcc/config/mips/9000.md @@ -0,0 +1,152 @@ +;; DFA-based pipeline description for the RM9000. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +(define_automaton "rm9k_main, rm9k_imul, rm9k_fdiv") + +;; These units are for insns that can issue in either pipe. We don't +;; want to use constructs like "rm9k_m | rm9k_f_int" since that would +;; needlessly make an insn prefer the M pipe. +(define_cpu_unit "rm9k_any1" "rm9k_main") +(define_cpu_unit "rm9k_any2" "rm9k_main") + +;; F and M pipe units, for instructions that must be issued by a +;; particular pipe. Split the F pipe into two units so that integer +;; instructions can issue while the FPU is busy. We don't need to +;; split M because it is only ever reserved for a single cycle. +(define_cpu_unit "rm9k_m" "rm9k_main") +(define_cpu_unit "rm9k_f_int" "rm9k_main") +(define_cpu_unit "rm9k_f_float" "rm9k_main") + +(exclusion_set "rm9k_f_int" "rm9k_f_float") + +;; Multiply/divide units. +(define_cpu_unit "rm9k_imul" "rm9k_imul") +(define_cpu_unit "rm9k_fdiv" "rm9k_fdiv") + +(define_insn_reservation "rm9k_load" 3 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "load,fpload,fpidxload")) + "rm9k_m") + +(define_insn_reservation "rm9k_store" 1 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "store,fpstore,fpidxstore")) + "rm9k_m") + +(define_insn_reservation "rm9k_int" 1 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "arith,shift,slt,clz,const,nop,trap")) + "rm9k_any1 | rm9k_any2") + +(define_insn_reservation "rm9k_int_cmove" 2 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "condmove") + (eq_attr "mode" "SI,DI"))) + "rm9k_any1 | rm9k_any2") + +;; This applies to both 'mul' and 'mult'. +(define_insn_reservation "rm9k_mulsi" 3 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "!DI"))) + "rm9k_f_int") + +(define_insn_reservation "rm9k_muldi" 7 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "rm9k_f_int + rm9k_imul * 7") + +(define_insn_reservation "rm9k_divsi" 38 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "rm9k_f_int + rm9k_imul * 38") + +(define_insn_reservation "rm9k_divdi" 70 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "rm9k_f_int + rm9k_imul * 70") + +(define_insn_reservation "rm9k_mfhilo" 1 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "mfhilo")) + "rm9k_f_int") + +(define_insn_reservation "rm9k_mthilo" 5 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "mthilo")) + "rm9k_f_int") + +(define_insn_reservation "rm9k_xfer" 2 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "xfer")) + "rm9k_m") + +(define_insn_reservation "rm9k_fquick" 2 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "fabs,fneg,fcmp,fmove")) + "rm9k_f_float") + +(define_insn_reservation "rm9k_fcmove" 2 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "condmove") + (eq_attr "mode" "SF,DF"))) + "rm9k_m") + +(define_insn_reservation "rm9k_fadd" 6 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "fadd,fcvt")) + "rm9k_f_float") + +(define_insn_reservation "rm9k_fmuls" 6 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "rm9k_f_float") + +(define_insn_reservation "rm9k_fmuld" 9 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "rm9k_f_float * 3") + +(define_insn_reservation "rm9k_fdivs" 22 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "rm9k_f_float + rm9k_fdiv * 22") + +(define_insn_reservation "rm9k_fdivd" 37 + (and (eq_attr "cpu" "r9000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt,frsqrt") + (eq_attr "mode" "DF"))) + "rm9k_f_float + rm9k_fdiv * 37") + +(define_insn_reservation "rm9k_branch" 2 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "branch,jump,call")) + "rm9k_any1 | rm9k_any2") + +(define_insn_reservation "rm9k_unknown" 1 + (and (eq_attr "cpu" "r9000") + (eq_attr "type" "unknown,multi")) + "rm9k_m + rm9k_f_int + rm9k_any1 + rm9k_any2") diff --git a/contrib/gcc/config/mips/constraints.md b/contrib/gcc/config/mips/constraints.md new file mode 100644 index 00000000000..711aa1587f9 --- /dev/null +++ b/contrib/gcc/config/mips/constraints.md @@ -0,0 +1,195 @@ +;; Constraint definitions for MIPS. +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Register constraints + +(define_register_constraint "d" "BASE_REG_CLASS" + "An address register. This is equivalent to @code{r} unless + generating MIPS16 code.") + +(define_register_constraint "t" "T_REG" + "@internal") + +(define_register_constraint "f" "TARGET_HARD_FLOAT ? FP_REGS : NO_REGS" + "A floating-point register (if available).") + +(define_register_constraint "h" "HI_REG" + "The @code{hi} register.") + +(define_register_constraint "l" "LO_REG" + "The @code{lo} register.") + +(define_register_constraint "x" "MD_REGS" + "The @code{hi} and @code{lo} registers.") + +(define_register_constraint "b" "ALL_REGS" + "@internal") + +(define_register_constraint "c" "TARGET_ABICALLS ? PIC_FN_ADDR_REG + : TARGET_MIPS16 ? M16_NA_REGS + : GR_REGS" + "A register suitable for use in an indirect jump. This will always be + @code{$25} for @option{-mabicalls}.") + +(define_register_constraint "e" "LEA_REGS" + "@internal") + +(define_register_constraint "j" "PIC_FN_ADDR_REG" + "@internal") + +(define_register_constraint "v" "V1_REG" + "@internal") + +(define_register_constraint "y" "GR_REGS" + "Equivalent to @code{r}; retained for backwards compatibility.") + +(define_register_constraint "z" "ST_REGS" + "A floating-point condition code register.") + +(define_register_constraint "A" "DSP_ACC_REGS" + "@internal") + +(define_register_constraint "a" "ACC_REGS" + "@internal") + +(define_register_constraint "B" "COP0_REGS" + "@internal") + +(define_register_constraint "C" "COP2_REGS" + "@internal") + +(define_register_constraint "D" "COP3_REGS" + "@internal") + +;; Integer constraints + +(define_constraint "I" + "A signed 16-bit constant (for arithmetic instructions)." + (and (match_code "const_int") + (match_test "SMALL_OPERAND (ival)"))) + +(define_constraint "J" + "Integer zero." + (and (match_code "const_int") + (match_test "ival == 0"))) + +(define_constraint "K" + "An unsigned 16-bit constant (for logic instructions)." + (and (match_code "const_int") + (match_test "SMALL_OPERAND_UNSIGNED (ival)"))) + +(define_constraint "L" + "A signed 32-bit constant in which the lower 16 bits are zero. + Such constants can be loaded using @code{lui}." + (and (match_code "const_int") + (match_test "LUI_OPERAND (ival)"))) + +(define_constraint "M" + "A constant that cannot be loaded using @code{lui}, @code{addiu} + or @code{ori}." + (and (match_code "const_int") + (match_test "!SMALL_OPERAND (ival)") + (match_test "!SMALL_OPERAND_UNSIGNED (ival)") + (match_test "!LUI_OPERAND (ival)"))) + +(define_constraint "N" + "A constant in the range -65535 to -1 (inclusive)." + (and (match_code "const_int") + (match_test "ival >= -0xffff && ival < 0"))) + +(define_constraint "O" + "A signed 15-bit constant." + (and (match_code "const_int") + (match_test "ival >= -0x4000 && ival < 0x4000"))) + +(define_constraint "P" + "A constant in the range 1 to 65535 (inclusive)." + (and (match_code "const_int") + (match_test "ival > 0 && ival < 0x10000"))) + +;; Floating-point constraints + +(define_constraint "G" + "Floating-point zero." + (and (match_code "const_double") + (match_test "op == CONST0_RTX (mode)"))) + +;; General constraints + +(define_constraint "Q" + "@internal" + (match_operand 0 "const_arith_operand")) + +(define_memory_constraint "R" + "An address that can be used in a non-macro load or store." + (and (match_code "mem") + (match_test "mips_fetch_insns (op) == 1"))) + +(define_constraint "S" + "@internal + A constant call address." + (and (match_operand 0 "call_insn_operand") + (match_test "CONSTANT_P (op)"))) + +(define_constraint "T" + "@internal + A constant @code{move_operand} that cannot be safely loaded into @code{$25} + using @code{la}." + (and (match_operand 0 "move_operand") + (match_test "CONSTANT_P (op)") + (match_test "mips_dangerous_for_la25_p (op)"))) + +(define_constraint "U" + "@internal + A constant @code{move_operand} that can be safely loaded into @code{$25} + using @code{la}." + (and (match_operand 0 "move_operand") + (match_test "CONSTANT_P (op)") + (match_test "!mips_dangerous_for_la25_p (op)"))) + +(define_memory_constraint "W" + "@internal + A memory address based on a member of @code{BASE_REG_CLASS}. This is + true for all non-mips16 references (although it can sometimes be implicit + if @samp{!TARGET_EXPLICIT_RELOCS}). For MIPS16, it excludes stack and + constant-pool references." + (and (match_code "mem") + (match_operand 0 "memory_operand") + (ior (match_test "!TARGET_MIPS16") + (and (not (match_operand 0 "stack_operand")) + (not (match_test "CONSTANT_P (XEXP (op, 0))")))))) + +(define_constraint "YG" + "@internal + A vector zero." + (and (match_code "const_vector") + (match_test "op == CONST0_RTX (mode)"))) + +(define_constraint "YA" + "@internal + An unsigned 6-bit constant." + (and (match_code "const_int") + (match_test "UIMM6_OPERAND (ival)"))) + +(define_constraint "YB" + "@internal + A signed 10-bit constant." + (and (match_code "const_int") + (match_test "IMM10_OPERAND (ival)"))) diff --git a/contrib/gcc/config/mips/crti.asm b/contrib/gcc/config/mips/crti.asm new file mode 100644 index 00000000000..f4bef6ff92b --- /dev/null +++ b/contrib/gcc/config/mips/crti.asm @@ -0,0 +1,26 @@ +/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + + .section .init,"ax",@progbits + .globl _init + .type _init,@function +_init: +#ifdef __mips64 + daddu $sp,$sp,-48 + sd $31,40($sp) +#else + addu $sp,$sp,-32 + sw $31,20($sp) +#endif + + .section .fini,"ax",@progbits + .globl _fini + .type _fini,@function +_fini: +#ifdef __mips64 + daddu $sp,$sp,-48 + sd $31,40($sp) +#else + addu $sp,$sp,-32 + sw $31,20($sp) +#endif diff --git a/contrib/gcc/config/mips/crtn.asm b/contrib/gcc/config/mips/crtn.asm new file mode 100644 index 00000000000..5d41d3d7ecb --- /dev/null +++ b/contrib/gcc/config/mips/crtn.asm @@ -0,0 +1,29 @@ +/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +#ifdef __mips16 +#define RA $7 +#else +#define RA $31 +#endif + + .section .init,"ax",@progbits +#ifdef __mips64 + ld RA,40($sp) + daddu $sp,$sp,48 +#else + lw RA,20($sp) + addu $sp,$sp,32 +#endif + j RA + + .section .fini,"ax",@progbits +#ifdef __mips64 + ld RA,40($sp) + daddu $sp,$sp,48 +#else + lw RA,20($sp) + addu $sp,$sp,32 +#endif + j RA + diff --git a/contrib/gcc/config/mips/dbxmdebug.h b/contrib/gcc/config/mips/dbxmdebug.h new file mode 100644 index 00000000000..230e2ea6450 --- /dev/null +++ b/contrib/gcc/config/mips/dbxmdebug.h @@ -0,0 +1,6 @@ +/* Definitions of target machine for GNU compiler, for MIPS running IRIX 5 + or IRIX 6 (O32 ABI) using the GNU assembler with stabs-in-mdebug. */ + +/* Override iris5gas.h version again to retain mips.h default. */ +#undef MDEBUG_ASM_SPEC +#define MDEBUG_ASM_SPEC "%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}" diff --git a/contrib/gcc/config/mips/elf.h b/contrib/gcc/config/mips/elf.h new file mode 100644 index 00000000000..9d7259e790d --- /dev/null +++ b/contrib/gcc/config/mips/elf.h @@ -0,0 +1,54 @@ +/* Target macros for mips*-elf targets. + Copyright (C) 1994, 1997, 1999, 2000, 2002, 2003, 2004 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* MIPS assemblers don't have the usual .set foo,bar construct; + .set is used for assembler options instead. */ +#undef SET_ASM_OP +#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \ + do \ + { \ + fputc ('\t', FILE); \ + assemble_name (FILE, LABEL1); \ + fputs (" = ", FILE); \ + assemble_name (FILE, LABEL2); \ + fputc ('\n', FILE); \ + } \ + while (0) + +#undef ASM_DECLARE_OBJECT_NAME +#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name + +#undef ASM_FINISH_DECLARE_OBJECT +#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object + +/* Leave the linker script to choose the appropriate libraries. */ +#undef LIB_SPEC +#define LIB_SPEC "" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crti%O%s crtbegin%O%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend%O%s crtn%O%s" + +#define NO_IMPLICIT_EXTERN_C 1 + +#define HANDLE_PRAGMA_PACK_PUSH_POP 1 diff --git a/contrib/gcc/config/mips/elforion.h b/contrib/gcc/config/mips/elforion.h new file mode 100644 index 00000000000..9ff3a4f0eb1 --- /dev/null +++ b/contrib/gcc/config/mips/elforion.h @@ -0,0 +1,22 @@ +/* Definitions of target machine for GNU compiler. MIPS ORION version with + GOFAST floating point library. + Copyright (C) 1994, 1998 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#define MIPS_CPU_STRING_DEFAULT "orion" diff --git a/contrib/gcc/config/mips/generic.md b/contrib/gcc/config/mips/generic.md new file mode 100644 index 00000000000..f5641a98443 --- /dev/null +++ b/contrib/gcc/config/mips/generic.md @@ -0,0 +1,106 @@ +;; Generic DFA-based pipeline description for MIPS targets +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + + +;; This file is derived from the old define_function_unit description. +;; Each reservation can be overridden on a processor-by-processor basis. + +(define_insn_reservation "generic_alu" 1 + (eq_attr "type" "unknown,prefetch,prefetchx,condmove,const,arith, + shift,slt,clz,trap,multi,nop") + "alu") + +(define_insn_reservation "generic_load" 3 + (eq_attr "type" "load,fpload,fpidxload") + "alu") + +(define_insn_reservation "generic_store" 1 + (eq_attr "type" "store,fpstore,fpidxstore") + "alu") + +(define_insn_reservation "generic_xfer" 2 + (eq_attr "type" "xfer") + "alu") + +(define_insn_reservation "generic_branch" 1 + (eq_attr "type" "branch,jump,call") + "alu") + +(define_insn_reservation "generic_hilo" 1 + (eq_attr "type" "mfhilo,mthilo") + "imuldiv*3") + +(define_insn_reservation "generic_imul" 17 + (eq_attr "type" "imul,imul3,imadd") + "imuldiv*17") + +(define_insn_reservation "generic_idiv" 38 + (eq_attr "type" "idiv") + "imuldiv*38") + +(define_insn_reservation "generic_fcvt" 1 + (eq_attr "type" "fcvt") + "alu") + +(define_insn_reservation "generic_fmove" 2 + (eq_attr "type" "fabs,fneg,fmove") + "alu") + +(define_insn_reservation "generic_fcmp" 3 + (eq_attr "type" "fcmp") + "alu") + +(define_insn_reservation "generic_fadd" 4 + (eq_attr "type" "fadd") + "alu") + +(define_insn_reservation "generic_fmul_single" 7 + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF")) + "alu") + +(define_insn_reservation "generic_fmul_double" 8 + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF")) + "alu") + +(define_insn_reservation "generic_fdiv_single" 23 + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF")) + "alu") + +(define_insn_reservation "generic_fdiv_double" 36 + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF")) + "alu") + +(define_insn_reservation "generic_fsqrt_single" 54 + (and (eq_attr "type" "fsqrt,frsqrt") + (eq_attr "mode" "SF")) + "alu") + +(define_insn_reservation "generic_fsqrt_double" 112 + (and (eq_attr "type" "fsqrt,frsqrt") + (eq_attr "mode" "DF")) + "alu") + +(define_insn_reservation "generic_frecip_fsqrt_step" 5 + (eq_attr "type" "frdiv1,frdiv2,frsqrt1,frsqrt2") + "alu") diff --git a/contrib/gcc/config/mips/iris.h b/contrib/gcc/config/mips/iris.h new file mode 100644 index 00000000000..dbde9d1aba6 --- /dev/null +++ b/contrib/gcc/config/mips/iris.h @@ -0,0 +1,222 @@ +/* Definitions of target machine for GNU compiler. Generic IRIX version. + Copyright (C) 1993, 1995, 1996, 1998, 2000, + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* We are compiling for IRIX now. */ +#undef TARGET_IRIX +#define TARGET_IRIX 1 + +/* The size in bytes of a DWARF field indicating an offset or length + relative to a debug info section, specified to be 4 bytes in the DWARF-2 + specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */ +#define DWARF_OFFSET_SIZE PTR_SIZE + +/* The size in bytes of the initial length field in a debug info + section. The DWARF 3 (draft) specification defines this to be + either 4 or 12 (with a 4-byte "escape" word when it's 12), but the + SGI/MIPS ABI predates this standard and defines it to be the same + as DWARF_OFFSET_SIZE. */ +#define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE + +/* MIPS assemblers don't have the usual .set foo,bar construct; + .set is used for assembler options instead. */ +#undef SET_ASM_OP +#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \ + do \ + { \ + fputc ('\t', FILE); \ + assemble_name (FILE, LABEL1); \ + fputs (" = ", FILE); \ + assemble_name (FILE, LABEL2); \ + fputc ('\n', FILE); \ + } \ + while (0) + +/* The MIPSpro o32 linker warns about not linking .comment sections. */ +#undef IDENT_ASM_OP + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX (TARGET_NEWABI ? "." : "$") + +#undef ASM_DECLARE_OBJECT_NAME +#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name + +#undef ASM_FINISH_DECLARE_OBJECT +#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object + +/* Also do this for libcalls. */ +#undef TARGET_ASM_EXTERNAL_LIBCALL +#define TARGET_ASM_EXTERNAL_LIBCALL irix_output_external_libcall + +/* The linker needs a space after "-o". */ +#define SWITCHES_NEED_SPACES "o" + +/* Specify wchar_t types. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int") + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE INT_TYPE_SIZE + +/* Same for wint_t. */ +#undef WINT_TYPE +#define WINT_TYPE (Pmode == DImode ? "int" : "long int") + +#undef WINT_TYPE_SIZE +#define WINT_TYPE_SIZE 32 + +/* Plain char is unsigned in the SGI compiler. */ +#undef DEFAULT_SIGNED_CHAR +#define DEFAULT_SIGNED_CHAR 0 + +#define WORD_SWITCH_TAKES_ARG(STR) \ + (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ + || strcmp (STR, "rpath") == 0) + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("host_mips"); \ + builtin_define_std ("sgi"); \ + builtin_define_std ("unix"); \ + builtin_define_std ("SYSTYPE_SVR4"); \ + builtin_define ("_MODERN_C"); \ + builtin_define ("_SVR4_SOURCE"); \ + builtin_define ("__DSO__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=svr4"); \ + builtin_assert ("machine=sgi"); \ + \ + if (mips_abi == ABI_32) \ + { \ + builtin_define ("_ABIO32=1"); \ + builtin_define ("_MIPS_SIM=_ABIO32"); \ + builtin_define ("_MIPS_SZINT=32"); \ + builtin_define ("_MIPS_SZLONG=32"); \ + builtin_define ("_MIPS_SZPTR=32"); \ + } \ + else if (mips_abi == ABI_64) \ + { \ + builtin_define ("_ABI64=3"); \ + builtin_define ("_MIPS_SIM=_ABI64"); \ + builtin_define ("_MIPS_SZINT=32"); \ + builtin_define ("_MIPS_SZLONG=64"); \ + builtin_define ("_MIPS_SZPTR=64"); \ + } \ + else \ + { \ + builtin_define ("_ABIN32=2"); \ + builtin_define ("_MIPS_SIM=_ABIN32"); \ + builtin_define ("_MIPS_SZINT=32"); \ + builtin_define ("_MIPS_SZLONG=32"); \ + builtin_define ("_MIPS_SZPTR=32"); \ + } \ + \ + if (!ISA_MIPS1 && !ISA_MIPS2) \ + builtin_define ("_COMPILER_VERSION=601"); \ + \ + if (!TARGET_FLOAT64) \ + builtin_define ("_MIPS_FPSET=16"); \ + else \ + builtin_define ("_MIPS_FPSET=32"); \ + \ + /* We must always define _LONGLONG, even when -ansi is \ + used, because IRIX 5 system header files require it. \ + This is OK, because gcc never warns when long long \ + is used in system header files. \ + \ + An alternative would be to support the SGI builtin \ + type __long_long. */ \ + builtin_define ("_LONGLONG"); \ + \ + /* IRIX 6.5.18 and above provide many ISO C99 \ + features protected by the __c99 macro. \ + libstdc++ v3 needs them as well. */ \ + if (TARGET_IRIX6) \ + if (flag_isoc99 || c_dialect_cxx ()) \ + builtin_define ("__c99"); \ + \ + /* The GNU C++ standard library requires that \ + __EXTENSIONS__ and _SGI_SOURCE be defined on at \ + least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \ + We don't need this on IRIX 6.5 itself, but it \ + shouldn't hurt other than the namespace pollution. */ \ + if (!flag_iso || (TARGET_IRIX6 && c_dialect_cxx ())) \ + { \ + builtin_define ("__EXTENSIONS__"); \ + builtin_define ("_SGI_SOURCE"); \ + } \ + } \ + while (0) + +#undef SUBTARGET_CC1_SPEC +#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}" + +#undef INIT_SECTION_ASM_OP +#define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits" + +#undef FINI_SECTION_ASM_OP +#define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits" + +#ifdef IRIX_USING_GNU_LD +#define IRIX_NO_UNRESOLVED "" +#else +#define IRIX_NO_UNRESOLVED "-no_unresolved" +#endif + +/* Generic part of the LINK_SPEC. */ +#undef LINK_SPEC +#define LINK_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \ +%{bestGnum} %{shared} %{non_shared} \ +%{call_shared} %{no_archive} %{exact_version} \ +%{!shared: \ + %{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \ +%{rpath} -init __gcc_init -fini __gcc_fini " IRIX_SUBTARGET_LINK_SPEC + +/* A linker error can empirically be avoided by removing duplicate + library search directories. */ +#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1 + +/* Add -g to mips.h default to avoid confusing gas with local symbols + generated from stabs info. */ +#undef NM_FLAGS +#define NM_FLAGS "-Bng" + +/* The system header files are C++ aware. */ +/* ??? Unfortunately, most but not all of the headers are C++ aware. + Specifically, curses.h is not, and as a consequence, defining this + used to prevent libg++ building. This is no longer the case so + define it again to prevent other problems, e.g. with getopt in + unistd.h. We still need some way to fix just those files that need + fixing. */ +#define NO_IMPLICIT_EXTERN_C 1 + +/* -G is incompatible with -KPIC which is the default, so only allow objects + in the small data section if the user explicitly asks for it. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 + +/* The native o32 IRIX linker does not support merging without a + special elspec(5) file. */ +#ifndef IRIX_USING_GNU_LD +#undef HAVE_GAS_SHF_MERGE +#define HAVE_GAS_SHF_MERGE 0 +#endif diff --git a/contrib/gcc/config/mips/iris5.h b/contrib/gcc/config/mips/iris5.h new file mode 100644 index 00000000000..10c28302c8d --- /dev/null +++ b/contrib/gcc/config/mips/iris5.h @@ -0,0 +1,45 @@ +/* Definitions of target machine for GNU compiler. IRIX version 5. + Copyright (C) 1993, 1995, 1996, 1998, 2000, + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#ifdef IRIX_USING_GNU_LD +#define IRIX_SUBTARGET_LINK_SPEC "-melf32bsmip" +#else +#define IRIX_SUBTARGET_LINK_SPEC "-_SYSTYPE_SVR4" +#endif + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "\ +%{!static: \ + %{!shared:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}}} \ +%{static: \ + %{pg:gcrt1.o%s} \ + %{!pg:%{p:/usr/lib/nonshared/mcrt1.o%s libprof1.a%s} \ + %{!p:/usr/lib/nonshared/crt1.o%s}}} \ +irix-crti.o%s crtbegin.o%s" + +#undef LIB_SPEC +#define LIB_SPEC "%{!shared:%{p:-lprof1} %{pg:-lprof1} -lc}" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s irix-crtn.o%s %{!shared:crtn.o%s}" + +#undef MACHINE_TYPE +#define MACHINE_TYPE "SGI running IRIX 5.x" diff --git a/contrib/gcc/config/mips/iris6.h b/contrib/gcc/config/mips/iris6.h new file mode 100644 index 00000000000..8686b14fa94 --- /dev/null +++ b/contrib/gcc/config/mips/iris6.h @@ -0,0 +1,118 @@ +/* Definitions of target machine for GNU compiler. IRIX version 6. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, + 2005, 2006 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Allow some special handling for IRIX 6. */ +#undef TARGET_IRIX6 +#define TARGET_IRIX6 1 + +/* Default to -mabi=n32 and -mips3. */ +#undef MULTILIB_DEFAULTS +#define MULTILIB_DEFAULTS { "mabi=n32" } + +/* Force the default ABI onto the command line in order to make the specs + easier to write. Default to the mips2 ISA for the O32 ABI. */ +#define DRIVER_SELF_SPECS \ + "%{!mabi=*: -mabi=n32}", \ + "%{mabi=32: %{!mips*: %{!march*: -mips2}}}" + +/* Force the generation of dwarf .debug_frame sections even if not + compiling -g. This guarantees that we can unwind the stack. */ +#define DWARF2_FRAME_INFO 1 + +/* The system unwinder in libexc requires a specific dwarf return address + column to work. */ +#undef DWARF_FRAME_RETURN_COLUMN +#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1) + +#undef MACHINE_TYPE +#define MACHINE_TYPE "SGI running IRIX 6.x" + +#ifdef IRIX_USING_GNU_LD +#define IRIX_SUBTARGET_LINK_SPEC \ + "%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}" +#else +#define IRIX_SUBTARGET_LINK_SPEC \ + "%{w} -_SYSTYPE_SVR4 -woff 131 \ + %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}" +#endif + +/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC \ + "%{!shared: \ + %{mabi=32:%{pg:gcrt1.o%s} \ + %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \ + %{mabi=n32: \ + %{mips4:%{pg:/usr/lib32/mips4/gcrt1.o%s} \ + %{!pg:%{p:/usr/lib32/mips4/mcrt1.o%s /usr/lib32/mips4/libprof1.a%s} \ + %{!p:/usr/lib32/mips4/crt1.o%s}}} \ + %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \ + %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \ + %{!p:/usr/lib32/mips3/crt1.o%s}}}} \ + %{mabi=64: \ + %{mips4:%{pg:/usr/lib64/mips4/gcrt1.o} \ + %{!pg:%{p:/usr/lib64/mips4/mcrt1.o /usr/lib64/mips4/libprof1.a} \ + %{!p:/usr/lib64/mips4/crt1.o}}} \ + %{!mips4:%{pg:/usr/lib64/mips3/gcrt1.o} \ + %{!pg:%{p:/usr/lib64/mips3/mcrt1.o /usr/lib64/mips3/libprof1.a} \ + %{!p:/usr/lib64/mips3/crt1.o}}}}} \ + irix-crti.o%s crtbegin.o%s" + +#ifdef IRIX_USING_GNU_LD +#define SUBTARGET_DONT_WARN_UNUSED_SPEC "" +#define SUBTARGET_WARN_UNUSED_SPEC "" +#else +#define SUBTARGET_DONT_WARN_UNUSED_SPEC "-dont_warn_unused" +#define SUBTARGET_WARN_UNUSED_SPEC "-warn_unused" +#endif + +#undef LIB_SPEC +#define LIB_SPEC \ + "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \ + -L/usr/lib32} \ + %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \ + -L/usr/lib64} \ + %{!shared:" \ + SUBTARGET_DONT_WARN_UNUSED_SPEC \ + " %{pthread:-lpthread} %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc " \ + SUBTARGET_WARN_UNUSED_SPEC "}" + +/* Avoid getting two warnings for libgcc.a everytime we link. */ +#undef LIBGCC_SPEC +#define LIBGCC_SPEC \ + SUBTARGET_DONT_WARN_UNUSED_SPEC " -lgcc " SUBTARGET_WARN_UNUSED_SPEC + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "crtend.o%s irix-crtn.o%s \ + %{!shared: \ + %{mabi=32:crtn.o%s}\ + %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\ + %{!mips4:/usr/lib32/mips3/crtn.o%s}}\ + %{mabi=64:%{mips4:/usr/lib64/mips4/crtn.o%s}\ + %{!mips4:/usr/lib64/mips3/crtn.o%s}}}" + +#define MIPS_TFMODE_FORMAT mips_extended_format + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}" + diff --git a/contrib/gcc/config/mips/irix-crti.asm b/contrib/gcc/config/mips/irix-crti.asm new file mode 100644 index 00000000000..d6888bbf014 --- /dev/null +++ b/contrib/gcc/config/mips/irix-crti.asm @@ -0,0 +1,51 @@ + .abicalls + .set noreorder + .set nomacro + +/* The GNU and SGI linkers differ in their implementation of -init and -fini. + With the GNU linker, there can only be a single -init option, and the + linker simply sets DT_INIT to that value. gcc's initialization and + finalization code can go directly in .init, with the prologue and + epilogue of the main initialization routine being provided by external + object files (*crti.o and *crtn.o in this case). + + The SGI linker instead accepts several -init options. It will set DT_INIT + to a linker-created function (placed in .init) that calls each of the -init + functions in turn. If there is any user code in .init, this linker-created + function will be placed after it. Note that such user code is not treated + specially; it will only be called if the -init options arrange for it to + be called. + + In theory, the SGI model should allow the crti, crtn and intermediate code + to go in .init, just like it can with the GNU linker. However, doing this + seems to confuse the linker and triggers an internal error: + + ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup() + text section overflow! + + (seen with MIPSpro 7.30). We therefore put everything in a special + .gcc_init section instead. */ + + .section .gcc_init,"ax",@progbits + .globl __gcc_init +__gcc_init: +#if _MIPS_SIM == _ABIO32 + addiu $sp,$sp,-16 + sw $31,0($sp) +#else + daddiu $sp,$sp,-16 + sd $31,0($sp) + sd $28,8($sp) +#endif + + .section .gcc_fini,"ax",@progbits + .globl __gcc_fini +__gcc_fini: +#if _MIPS_SIM == _ABIO32 + addiu $sp,$sp,-16 + sw $31,0($sp) +#else + daddiu $sp,$sp,-16 + sd $31,0($sp) + sd $28,8($sp) +#endif diff --git a/contrib/gcc/config/mips/irix-crtn.asm b/contrib/gcc/config/mips/irix-crtn.asm new file mode 100644 index 00000000000..600576cb1d7 --- /dev/null +++ b/contrib/gcc/config/mips/irix-crtn.asm @@ -0,0 +1,27 @@ + .abicalls + .set noreorder + .set nomacro + + .section .gcc_init,"ax",@progbits +#if _MIPS_SIM == _ABIO32 + lw $31,0($sp) + jr $31 + addiu $sp,$sp,16 +#else + ld $31,0($sp) + ld $28,8($sp) + jr $31 + daddiu $sp,$sp,16 +#endif + + .section .gcc_fini,"ax",@progbits +#if _MIPS_SIM == _ABIO32 + lw $31,0($sp) + jr $31 + addiu $sp,$sp,16 +#else + ld $31,0($sp) + ld $28,8($sp) + jr $31 + daddiu $sp,$sp,16 +#endif diff --git a/contrib/gcc/config/mips/linux-unwind.h b/contrib/gcc/config/mips/linux-unwind.h new file mode 100644 index 00000000000..4f96e95e940 --- /dev/null +++ b/contrib/gcc/config/mips/linux-unwind.h @@ -0,0 +1,112 @@ +/* DWARF2 EH unwinding support for MIPS Linux. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#ifndef inhibit_libc +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +#include +#include + +/* The third parameter to the signal handler points to something with + * this structure defined in asm/ucontext.h, but the name clashes with + * struct ucontext from sys/ucontext.h so this private copy is used. */ +typedef struct _sig_ucontext { + unsigned long uc_flags; + struct _sig_ucontext *uc_link; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; +} _sig_ucontext_t; + +#define MD_FALLBACK_FRAME_STATE_FOR mips_fallback_frame_state + +static _Unwind_Reason_Code +mips_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + u_int32_t *pc = (u_int32_t *) context->ra; + struct sigcontext *sc; + _Unwind_Ptr new_cfa; + int i; + + /* 24021061 li v0, 0x1061 (rt_sigreturn)*/ + /* 0000000c syscall */ + /* or */ + /* 24021017 li v0, 0x1017 (sigreturn) */ + /* 0000000c syscall */ + if (pc[1] != 0x0000000c) + return _URC_END_OF_STACK; +#if _MIPS_SIM == _ABIO32 + if (pc[0] == (0x24020000 | __NR_sigreturn)) + { + struct sigframe { + u_int32_t trampoline[2]; + struct sigcontext sigctx; + } *rt_ = context->ra; + sc = &rt_->sigctx; + } + else +#endif + if (pc[0] == (0x24020000 | __NR_rt_sigreturn)) + { + struct rt_sigframe { + u_int32_t trampoline[2]; + struct siginfo info; + _sig_ucontext_t uc; + } *rt_ = context->ra; + sc = &rt_->uc.uc_mcontext; + } + else + return _URC_END_OF_STACK; + + new_cfa = (_Unwind_Ptr)sc; + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = STACK_POINTER_REGNUM; + fs->cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa; + +#if _MIPS_SIM == _ABIO32 && defined __MIPSEB__ + /* On o32 Linux, the register save slots in the sigcontext are + eight bytes. We need the lower half of each register slot, + so slide our view of the structure back four bytes. */ + new_cfa -= 4; +#endif + + for (i = 0; i < 32; i++) { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset + = (_Unwind_Ptr)&(sc->sc_regs[i]) - new_cfa; + } + fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].how = REG_SAVED_OFFSET; + fs->regs.reg[SIGNAL_UNWIND_RETURN_COLUMN].loc.offset + = (_Unwind_Ptr)&(sc->sc_pc) - new_cfa; + fs->retaddr_column = SIGNAL_UNWIND_RETURN_COLUMN; + + return _URC_NO_REASON; +} +#endif diff --git a/contrib/gcc/config/mips/linux.h b/contrib/gcc/config/mips/linux.h new file mode 100644 index 00000000000..ff268d4465d --- /dev/null +++ b/contrib/gcc/config/mips/linux.h @@ -0,0 +1,181 @@ +/* Definitions for MIPS running Linux-based GNU systems with ELF format. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +/* If defined, a C expression whose value is a string containing the + assembler operation to identify the following data as + uninitialized global data. If not defined, and neither + `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined, + uninitialized global data will be output in the data section if + `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be + used. */ +#define BSS_SECTION_ASM_OP "\t.section\t.bss" + +#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss + +#undef ASM_DECLARE_OBJECT_NAME +#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name + +#undef TARGET_VERSION +#if TARGET_ENDIAN_DEFAULT == 0 +#define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)"); +#else +#define TARGET_VERSION fprintf (stderr, " (MIPS GNU/Linux with ELF)"); +#endif + +#undef MD_EXEC_PREFIX +#undef MD_STARTFILE_PREFIX + +/* If we don't set MASK_ABICALLS, we can't default to PIC. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT MASK_ABICALLS + +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ + /* The GNU C++ standard library requires this. */ \ + if (c_dialect_cxx ()) \ + builtin_define ("_GNU_SOURCE"); \ + \ + if (mips_abi == ABI_N32) \ + { \ + builtin_define ("_ABIN32=2"); \ + builtin_define ("_MIPS_SIM=_ABIN32"); \ + builtin_define ("_MIPS_SZLONG=32"); \ + builtin_define ("_MIPS_SZPTR=32"); \ + } \ + else if (mips_abi == ABI_64) \ + { \ + builtin_define ("_ABI64=3"); \ + builtin_define ("_MIPS_SIM=_ABI64"); \ + builtin_define ("_MIPS_SZLONG=64"); \ + builtin_define ("_MIPS_SZPTR=64"); \ + } \ + else \ + { \ + builtin_define ("_ABIO32=1"); \ + builtin_define ("_MIPS_SIM=_ABIO32"); \ + builtin_define ("_MIPS_SZLONG=32"); \ + builtin_define ("_MIPS_SZPTR=32"); \ + } \ + if (TARGET_FLOAT64) \ + builtin_define ("_MIPS_FPSET=32"); \ + else \ + builtin_define ("_MIPS_FPSET=16"); \ + \ + builtin_define ("_MIPS_SZINT=32"); \ + } while (0) + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + +/* A standard GNU/Linux mapping. On most targets, it is included in + CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC + and provides this hook instead. */ +#undef SUBTARGET_CC1_SPEC +#define SUBTARGET_CC1_SPEC "%{profile:-p}" + +/* From iris5.h */ +/* -G is incompatible with -KPIC which is the default, so only allow objects + in the small data section if the user explicitly asks for it. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 + +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +/* Borrowed from sparc/linux.h */ +#undef LINK_SPEC +#define LINK_SPEC \ + "%(endian_spec) \ + %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \ + %{static:-static}}}" + +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}" + +/* The MIPS assembler has different syntax for .set. We set it to + .dummy to trap any errors. */ +#undef SET_ASM_OP +#define SET_ASM_OP "\t.dummy\t" + +#undef ASM_OUTPUT_DEF +#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ + do { \ + fputc ( '\t', FILE); \ + assemble_name (FILE, LABEL1); \ + fputs ( " = ", FILE); \ + assemble_name (FILE, LABEL2); \ + fputc ( '\n', FILE); \ + } while (0) + +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ + do { \ + if (!flag_inhibit_size_directive) \ + { \ + fputs ("\t.ent\t", STREAM); \ + assemble_name (STREAM, NAME); \ + putc ('\n', STREAM); \ + } \ + ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, NAME, "function"); \ + assemble_name (STREAM, NAME); \ + fputs (":\n", STREAM); \ + } while (0) + +#undef ASM_DECLARE_FUNCTION_SIZE +#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \ + do { \ + if (!flag_inhibit_size_directive) \ + { \ + fputs ("\t.end\t", STREAM); \ + assemble_name (STREAM, NAME); \ + putc ('\n', STREAM); \ + } \ + } while (0) + +/* Tell function_prologue in mips.c that we have already output the .ent/.end + pseudo-ops. */ +#undef FUNCTION_NAME_ALREADY_DECLARED +#define FUNCTION_NAME_ALREADY_DECLARED 1 + +/* The glibc _mcount stub will save $v0 for us. Don't mess with saving + it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the + presence of $gp-relative calls. */ +#undef ASM_OUTPUT_REG_PUSH +#undef ASM_OUTPUT_REG_POP + +#undef LIB_SPEC +#define LIB_SPEC "\ +%{shared: -lc} \ +%{!shared: %{pthread:-lpthread} \ + %{profile:-lc_p} %{!profile: -lc}}" + +#define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h" diff --git a/contrib/gcc/config/mips/linux64.h b/contrib/gcc/config/mips/linux64.h new file mode 100644 index 00000000000..4ccf9385397 --- /dev/null +++ b/contrib/gcc/config/mips/linux64.h @@ -0,0 +1,72 @@ +/* Definitions for MIPS running Linux-based GNU systems with ELF format + using n32/64 abi. + Copyright 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Force the default endianness and ABI flags onto the command line + in order to make the other specs easier to write. */ +#define DRIVER_SELF_SPECS \ +"%{!EB:%{!EL:%(endian_spec)}}", \ +"%{!mabi=*: -mabi=n32}" + +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "\ +%{!fno-PIC:%{!fno-pic:-KPIC}} \ +%{fno-PIC:-non_shared} %{fno-pic:-non_shared}" + +#undef LIB_SPEC +#define LIB_SPEC "\ +%{shared: -lc} \ +%{!shared: %{pthread:-lpthread} \ + %{profile:-lc_p} %{!profile: -lc}}" + +#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1" +#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" +#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" +#define LINUX_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32) + +#undef LINK_SPEC +#define LINK_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \ +%{bestGnum} %{shared} %{non_shared} \ +%{call_shared} %{no_archive} %{exact_version} \ + %(endian_spec) \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker: \ + %{mabi=n32: -dynamic-linker " LINUX_DYNAMIC_LINKERN32 "} \ + %{mabi=64: -dynamic-linker " LINUX_DYNAMIC_LINKER64 "} \ + %{mabi=32: -dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}} \ + %{static:-static}}} \ +%{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \ +%{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \ +%{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".") + +/* GNU/Linux doesn't use the same floating-point format that IRIX uses + for long double. There's no need to override this here, since + ieee_quad_format is the default, but let's put this here to make + sure nobody thinks we just forgot to set it to something else. */ +#define MIPS_TFMODE_FORMAT mips_quad_format diff --git a/contrib/gcc/config/mips/mips-dsp.md b/contrib/gcc/config/mips/mips-dsp.md new file mode 100644 index 00000000000..3fdcc593001 --- /dev/null +++ b/contrib/gcc/config/mips/mips-dsp.md @@ -0,0 +1,1057 @@ +(define_constants + [(CCDSP_PO_REGNUM 182) + (CCDSP_SC_REGNUM 183) + (CCDSP_CA_REGNUM 184) + (CCDSP_OU_REGNUM 185) + (CCDSP_CC_REGNUM 186) + (CCDSP_EF_REGNUM 187)]) + +;; This mode macro allows si, v2hi, v4qi for all possible modes in DSP ASE. +(define_mode_macro DSP [(SI "TARGET_DSP") + (V2HI "TARGET_DSP") + (V4QI "TARGET_DSP")]) + +;; This mode macro allows v2hi, v4qi for vector/SIMD data. +(define_mode_macro DSPV [(V2HI "TARGET_DSP") + (V4QI "TARGET_DSP")]) + +;; This mode macro allows si, v2hi for Q31 and V2Q15 fixed-point data. +(define_mode_macro DSPQ [(SI "TARGET_DSP") + (V2HI "TARGET_DSP")]) + +;; DSP instructions use q for fixed-point data, and u for integer in the infix. +(define_mode_attr dspfmt1 [(SI "q") (V2HI "q") (V4QI "u")]) + +;; DSP instructions use nothing for fixed-point data, and u for integer in +;; the infix. +(define_mode_attr dspfmt1_1 [(SI "") (V2HI "") (V4QI "u")]) + +;; DSP instructions use w, ph, qb in the postfix. +(define_mode_attr dspfmt2 [(SI "w") (V2HI "ph") (V4QI "qb")]) + +;; DSP shift masks for SI, V2HI, V4QI. +(define_mode_attr dspshift_mask [(SI "0x1f") (V2HI "0xf") (V4QI "0x7")]) + +;; MIPS DSP ASE Revision 0.98 3/24/2005 +;; Table 2-1. MIPS DSP ASE Instructions: Arithmetic +;; ADDQ* +(define_insn "add3" + [(parallel + [(set (match_operand:DSPV 0 "register_operand" "=d") + (plus:DSPV (match_operand:DSPV 1 "register_operand" "d") + (match_operand:DSPV 2 "register_operand" "d"))) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDQ))])] + "" + "add.\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_add_s_" + [(parallel + [(set (match_operand:DSP 0 "register_operand" "=d") + (unspec:DSP [(match_operand:DSP 1 "register_operand" "d") + (match_operand:DSP 2 "register_operand" "d")] + UNSPEC_ADDQ_S)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDQ_S))])] + "" + "add_s.\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; SUBQ* +(define_insn "sub3" + [(parallel + [(set (match_operand:DSPV 0 "register_operand" "=d") + (minus:DSPV (match_operand:DSPV 1 "register_operand" "d") + (match_operand:DSPV 2 "register_operand" "d"))) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBQ))])] + "TARGET_DSP" + "sub.\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_sub_s_" + [(parallel + [(set (match_operand:DSP 0 "register_operand" "=d") + (unspec:DSP [(match_operand:DSP 1 "register_operand" "d") + (match_operand:DSP 2 "register_operand" "d")] + UNSPEC_SUBQ_S)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SUBQ_S))])] + "TARGET_DSP" + "sub_s.\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; ADDSC +(define_insn "mips_addsc" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")] + UNSPEC_ADDSC)) + (set (reg:CCDSP CCDSP_CA_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDSC))])] + "TARGET_DSP" + "addsc\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; ADDWC +(define_insn "mips_addwc" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d") + (reg:CCDSP CCDSP_CA_REGNUM)] + UNSPEC_ADDWC)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_ADDWC))])] + "TARGET_DSP" + "addwc\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; MODSUB +(define_insn "mips_modsub" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")] + UNSPEC_MODSUB))] + "TARGET_DSP" + "modsub\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; RADDU* +(define_insn "mips_raddu_w_qb" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_RADDU_W_QB))] + "TARGET_DSP" + "raddu.w.qb\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; ABSQ* +(define_insn "mips_absq_s_" + [(parallel + [(set (match_operand:DSPQ 0 "register_operand" "=d") + (unspec:DSPQ [(match_operand:DSPQ 1 "register_operand" "d")] + UNSPEC_ABSQ_S)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1)] UNSPEC_ABSQ_S))])] + "TARGET_DSP" + "absq_s.\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PRECRQ* +(define_insn "mips_precrq_qb_ph" + [(set (match_operand:V4QI 0 "register_operand" "=d") + (unspec:V4QI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_PRECRQ_QB_PH))] + "TARGET_DSP" + "precrq.qb.ph\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_precrq_ph_w" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")] + UNSPEC_PRECRQ_PH_W))] + "TARGET_DSP" + "precrq.ph.w\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_precrq_rs_ph_w" + [(parallel + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")] + UNSPEC_PRECRQ_RS_PH_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] + UNSPEC_PRECRQ_RS_PH_W))])] + "TARGET_DSP" + "precrq_rs.ph.w\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PRECRQU* +(define_insn "mips_precrqu_s_qb_ph" + [(parallel + [(set (match_operand:V4QI 0 "register_operand" "=d") + (unspec:V4QI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_PRECRQU_S_QB_PH)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] + UNSPEC_PRECRQU_S_QB_PH))])] + "TARGET_DSP" + "precrqu_s.qb.ph\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PRECEQ* +(define_insn "mips_preceq_w_phl" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V2HI 1 "register_operand" "d")] + UNSPEC_PRECEQ_W_PHL))] + "TARGET_DSP" + "preceq.w.phl\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_preceq_w_phr" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V2HI 1 "register_operand" "d")] + UNSPEC_PRECEQ_W_PHR))] + "TARGET_DSP" + "preceq.w.phr\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PRECEQU* +(define_insn "mips_precequ_ph_qbl" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEQU_PH_QBL))] + "TARGET_DSP" + "precequ.ph.qbl\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_precequ_ph_qbr" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEQU_PH_QBR))] + "TARGET_DSP" + "precequ.ph.qbr\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_precequ_ph_qbla" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEQU_PH_QBLA))] + "TARGET_DSP" + "precequ.ph.qbla\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_precequ_ph_qbra" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEQU_PH_QBRA))] + "TARGET_DSP" + "precequ.ph.qbra\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PRECEU* +(define_insn "mips_preceu_ph_qbl" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEU_PH_QBL))] + "TARGET_DSP" + "preceu.ph.qbl\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_preceu_ph_qbr" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEU_PH_QBR))] + "TARGET_DSP" + "preceu.ph.qbr\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_preceu_ph_qbla" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEU_PH_QBLA))] + "TARGET_DSP" + "preceu.ph.qbla\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_preceu_ph_qbra" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d")] + UNSPEC_PRECEU_PH_QBRA))] + "TARGET_DSP" + "preceu.ph.qbra\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; Table 2-2. MIPS DSP ASE Instructions: Shift +;; SHLL* +(define_insn "mips_shll_" + [(parallel + [(set (match_operand:DSPV 0 "register_operand" "=d,d") + (unspec:DSPV [(match_operand:DSPV 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHLL)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SHLL))])] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) + & ~(unsigned HOST_WIDE_INT) ) + operands[2] = GEN_INT (INTVAL (operands[2]) & ); + return "shll.\t%0,%1,%2"; + } + return "shllv.\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +(define_insn "mips_shll_s_" + [(parallel + [(set (match_operand:DSPQ 0 "register_operand" "=d,d") + (unspec:DSPQ [(match_operand:DSPQ 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHLL_S)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_SHLL_S))])] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) + & ~(unsigned HOST_WIDE_INT) ) + operands[2] = GEN_INT (INTVAL (operands[2]) & ); + return "shll_s.\t%0,%1,%2"; + } + return "shllv_s.\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +;; SHRL* +(define_insn "mips_shrl_qb" + [(set (match_operand:V4QI 0 "register_operand" "=d,d") + (unspec:V4QI [(match_operand:V4QI 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHRL_QB))] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x7) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x7); + return "shrl.qb\t%0,%1,%2"; + } + return "shrlv.qb\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +;; SHRA* +(define_insn "mips_shra_ph" + [(set (match_operand:V2HI 0 "register_operand" "=d,d") + (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHRA_PH))] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0xf) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xf); + return "shra.ph\t%0,%1,%2"; + } + return "shrav.ph\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +(define_insn "mips_shra_r_" + [(set (match_operand:DSPQ 0 "register_operand" "=d,d") + (unspec:DSPQ [(match_operand:DSPQ 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHRA_R))] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) + & ~(unsigned HOST_WIDE_INT) ) + operands[2] = GEN_INT (INTVAL (operands[2]) & ); + return "shra_r.\t%0,%1,%2"; + } + return "shrav_r.\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +;; Table 2-3. MIPS DSP ASE Instructions: Multiply +;; MULEU* +(define_insn "mips_muleu_s_ph_qbl" + [(parallel + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_MULEU_S_PH_QBL)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_MULEU_S_PH_QBL)) + (clobber (match_scratch:DI 3 "=x"))])] + "TARGET_DSP" + "muleu_s.ph.qbl\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "SI")]) + +(define_insn "mips_muleu_s_ph_qbr" + [(parallel + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V4QI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_MULEU_S_PH_QBR)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_MULEU_S_PH_QBR)) + (clobber (match_scratch:DI 3 "=x"))])] + "TARGET_DSP" + "muleu_s.ph.qbr\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "SI")]) + +;; MULQ* +(define_insn "mips_mulq_rs_ph" + [(parallel + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_MULQ_RS_PH)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_MULQ_RS_PH)) + (clobber (match_scratch:DI 3 "=x"))])] + "TARGET_DSP" + "mulq_rs.ph\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "SI")]) + +;; MULEQ* +(define_insn "mips_muleq_s_w_phl" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_MULEQ_S_W_PHL)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_MULEQ_S_W_PHL)) + (clobber (match_scratch:DI 3 "=x"))])] + "TARGET_DSP" + "muleq_s.w.phl\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "SI")]) + +(define_insn "mips_muleq_s_w_phr" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_MULEQ_S_W_PHR)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_MULEQ_S_W_PHR)) + (clobber (match_scratch:DI 3 "=x"))])] + "TARGET_DSP" + "muleq_s.w.phr\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "SI")]) + +;; DPAU* +(define_insn "mips_dpau_h_qbl" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V4QI 2 "register_operand" "d") + (match_operand:V4QI 3 "register_operand" "d")] + UNSPEC_DPAU_H_QBL))] + "TARGET_DSP && !TARGET_64BIT" + "dpau.h.qbl\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "mips_dpau_h_qbr" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V4QI 2 "register_operand" "d") + (match_operand:V4QI 3 "register_operand" "d")] + UNSPEC_DPAU_H_QBR))] + "TARGET_DSP && !TARGET_64BIT" + "dpau.h.qbr\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; DPSU* +(define_insn "mips_dpsu_h_qbl" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V4QI 2 "register_operand" "d") + (match_operand:V4QI 3 "register_operand" "d")] + UNSPEC_DPSU_H_QBL))] + "TARGET_DSP && !TARGET_64BIT" + "dpsu.h.qbl\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "mips_dpsu_h_qbr" + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V4QI 2 "register_operand" "d") + (match_operand:V4QI 3 "register_operand" "d")] + UNSPEC_DPSU_H_QBR))] + "TARGET_DSP && !TARGET_64BIT" + "dpsu.h.qbr\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; DPAQ* +(define_insn "mips_dpaq_s_w_ph" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_DPAQ_S_W_PH)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_DPAQ_S_W_PH))])] + "TARGET_DSP && !TARGET_64BIT" + "dpaq_s.w.ph\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; DPSQ* +(define_insn "mips_dpsq_s_w_ph" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_DPSQ_S_W_PH)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_DPSQ_S_W_PH))])] + "TARGET_DSP && !TARGET_64BIT" + "dpsq_s.w.ph\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; MULSAQ* +(define_insn "mips_mulsaq_s_w_ph" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_MULSAQ_S_W_PH)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_MULSAQ_S_W_PH))])] + "TARGET_DSP && !TARGET_64BIT" + "mulsaq_s.w.ph\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; DPAQ* +(define_insn "mips_dpaq_sa_l_w" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d")] + UNSPEC_DPAQ_SA_L_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_DPAQ_SA_L_W))])] + "TARGET_DSP && !TARGET_64BIT" + "dpaq_sa.l.w\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; DPSQ* +(define_insn "mips_dpsq_sa_l_w" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d")] + UNSPEC_DPSQ_SA_L_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_DPSQ_SA_L_W))])] + "TARGET_DSP && !TARGET_64BIT" + "dpsq_sa.l.w\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; MAQ* +(define_insn "mips_maq_s_w_phl" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_MAQ_S_W_PHL)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_MAQ_S_W_PHL))])] + "TARGET_DSP && !TARGET_64BIT" + "maq_s.w.phl\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "mips_maq_s_w_phr" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_MAQ_S_W_PHR)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_MAQ_S_W_PHR))])] + "TARGET_DSP && !TARGET_64BIT" + "maq_s.w.phr\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; MAQ_SA* +(define_insn "mips_maq_sa_w_phl" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_MAQ_SA_W_PHL)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_MAQ_SA_W_PHL))])] + "TARGET_DSP && !TARGET_64BIT" + "maq_sa.w.phl\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "mips_maq_sa_w_phr" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:V2HI 2 "register_operand" "d") + (match_operand:V2HI 3 "register_operand" "d")] + UNSPEC_MAQ_SA_W_PHR)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) (match_dup 3)] + UNSPEC_MAQ_SA_W_PHR))])] + "TARGET_DSP && !TARGET_64BIT" + "maq_sa.w.phr\t%q0,%2,%3" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; Table 2-4. MIPS DSP ASE Instructions: General Bit/Manipulation +;; BITREV +(define_insn "mips_bitrev" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "register_operand" "d")] + UNSPEC_BITREV))] + "TARGET_DSP" + "bitrev\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; INSV +(define_insn "mips_insv" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "register_operand" "0") + (match_operand:SI 2 "register_operand" "d") + (reg:CCDSP CCDSP_SC_REGNUM) + (reg:CCDSP CCDSP_PO_REGNUM)] + UNSPEC_INSV))] + "TARGET_DSP" + "insv\t%0,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; REPL* +(define_insn "mips_repl_qb" + [(set (match_operand:V4QI 0 "register_operand" "=d,d") + (unspec:V4QI [(match_operand:SI 1 "arith_operand" "I,d")] + UNSPEC_REPL_QB))] + "TARGET_DSP" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[1]) & ~(unsigned HOST_WIDE_INT) 0xff) + operands[1] = GEN_INT (INTVAL (operands[1]) & 0xff); + return "repl.qb\t%0,%1"; + } + return "replv.qb\t%0,%1"; +} + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_repl_ph" + [(set (match_operand:V2HI 0 "register_operand" "=d,d") + (unspec:V2HI [(match_operand:SI 1 "reg_imm10_operand" "YB,d")] + UNSPEC_REPL_PH))] + "TARGET_DSP" + "@ + repl.ph\t%0,%1 + replv.ph\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; Table 2-5. MIPS DSP ASE Instructions: Compare-Pick +;; CMPU.* CMP.* +(define_insn "mips_cmp_eq_" + [(set (reg:CCDSP CCDSP_CC_REGNUM) + (unspec:CCDSP [(match_operand:DSPV 0 "register_operand" "d") + (match_operand:DSPV 1 "register_operand" "d") + (reg:CCDSP CCDSP_CC_REGNUM)] + UNSPEC_CMP_EQ))] + "TARGET_DSP" + "cmp.eq.\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_cmp_lt_" + [(set (reg:CCDSP CCDSP_CC_REGNUM) + (unspec:CCDSP [(match_operand:DSPV 0 "register_operand" "d") + (match_operand:DSPV 1 "register_operand" "d") + (reg:CCDSP CCDSP_CC_REGNUM)] + UNSPEC_CMP_LT))] + "TARGET_DSP" + "cmp.lt.\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_cmp_le_" + [(set (reg:CCDSP CCDSP_CC_REGNUM) + (unspec:CCDSP [(match_operand:DSPV 0 "register_operand" "d") + (match_operand:DSPV 1 "register_operand" "d") + (reg:CCDSP CCDSP_CC_REGNUM)] + UNSPEC_CMP_LE))] + "TARGET_DSP" + "cmp.le.\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_cmpgu_eq_qb" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V4QI 1 "register_operand" "d") + (match_operand:V4QI 2 "register_operand" "d")] + UNSPEC_CMPGU_EQ_QB))] + "TARGET_DSP" + "cmpgu.eq.qb\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_cmpgu_lt_qb" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V4QI 1 "register_operand" "d") + (match_operand:V4QI 2 "register_operand" "d")] + UNSPEC_CMPGU_LT_QB))] + "TARGET_DSP" + "cmpgu.lt.qb\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "mips_cmpgu_le_qb" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:V4QI 1 "register_operand" "d") + (match_operand:V4QI 2 "register_operand" "d")] + UNSPEC_CMPGU_LE_QB))] + "TARGET_DSP" + "cmpgu.le.qb\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PICK* +(define_insn "mips_pick_" + [(set (match_operand:DSPV 0 "register_operand" "=d") + (unspec:DSPV [(match_operand:DSPV 1 "register_operand" "d") + (match_operand:DSPV 2 "register_operand" "d") + (reg:CCDSP CCDSP_CC_REGNUM)] + UNSPEC_PICK))] + "TARGET_DSP" + "pick.\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; PACKRL* +(define_insn "mips_packrl_ph" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (unspec:V2HI [(match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")] + UNSPEC_PACKRL_PH))] + "TARGET_DSP" + "packrl.ph\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; Table 2-6. MIPS DSP ASE Instructions: Accumulator and DSPControl Access +;; EXTR* +(define_insn "mips_extr_w" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_EXTR_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTR_W))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extr.w\t%0,%q1,%2"; + } + return "extrv.w\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +(define_insn "mips_extr_r_w" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_EXTR_R_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTR_R_W))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extr_r.w\t%0,%q1,%2"; + } + return "extrv_r.w\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +(define_insn "mips_extr_rs_w" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_EXTR_RS_W)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTR_RS_W))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extr_rs.w\t%0,%q1,%2"; + } + return "extrv_rs.w\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +;; EXTR*_S.H +(define_insn "mips_extr_s_h" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_EXTR_S_H)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTR_S_H))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extr_s.h\t%0,%q1,%2"; + } + return "extrv_s.h\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +;; EXTP* +(define_insn "mips_extp" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d") + (reg:CCDSP CCDSP_PO_REGNUM)] + UNSPEC_EXTP)) + (set (reg:CCDSP CCDSP_EF_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTP))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extp\t%0,%q1,%2"; + } + return "extpv\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +(define_insn "mips_extpdp" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d,d") + (unspec:SI [(match_operand:DI 1 "register_operand" "a,a") + (match_operand:SI 2 "arith_operand" "I,d") + (reg:CCDSP CCDSP_PO_REGNUM)] + UNSPEC_EXTPDP)) + (set (reg:CCDSP CCDSP_PO_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) + (reg:CCDSP CCDSP_PO_REGNUM)] UNSPEC_EXTPDP)) + (set (reg:CCDSP CCDSP_EF_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2)] UNSPEC_EXTPDP))])] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) & ~(unsigned HOST_WIDE_INT) 0x1f) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "extpdp\t%0,%q1,%2"; + } + return "extpdpv\t%0,%q1,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +;; SHILO* +(define_insn "mips_shilo" + [(set (match_operand:DI 0 "register_operand" "=a,a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0,0") + (match_operand:SI 2 "arith_operand" "I,d")] + UNSPEC_SHILO))] + "TARGET_DSP && !TARGET_64BIT" +{ + if (which_alternative == 0) + { + if (INTVAL (operands[2]) < -32 || INTVAL (operands[2]) > 31) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); + return "shilo\t%q0,%2"; + } + return "shilov\t%q0,%2"; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +;; MTHLIP* +(define_insn "mips_mthlip" + [(parallel + [(set (match_operand:DI 0 "register_operand" "=a") + (unspec:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "register_operand" "d") + (reg:CCDSP CCDSP_PO_REGNUM)] + UNSPEC_MTHLIP)) + (set (reg:CCDSP CCDSP_PO_REGNUM) + (unspec:CCDSP [(match_dup 1) (match_dup 2) + (reg:CCDSP CCDSP_PO_REGNUM)] UNSPEC_MTHLIP))])] + "TARGET_DSP && !TARGET_64BIT" + "mthlip\t%2,%q0" + [(set_attr "type" "mfhilo") + (set_attr "mode" "SI")]) + +;; WRDSP +(define_insn "mips_wrdsp" + [(parallel + [(set (reg:CCDSP CCDSP_PO_REGNUM) + (unspec:CCDSP [(match_operand:SI 0 "register_operand" "d") + (match_operand:SI 1 "const_uimm6_operand" "YA")] + UNSPEC_WRDSP)) + (set (reg:CCDSP CCDSP_SC_REGNUM) + (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP)) + (set (reg:CCDSP CCDSP_CA_REGNUM) + (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP)) + (set (reg:CCDSP CCDSP_OU_REGNUM) + (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP)) + (set (reg:CCDSP CCDSP_CC_REGNUM) + (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP)) + (set (reg:CCDSP CCDSP_EF_REGNUM) + (unspec:CCDSP [(match_dup 0) (match_dup 1)] UNSPEC_WRDSP))])] + "TARGET_DSP" + "wrdsp\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; RDDSP +(define_insn "mips_rddsp" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:SI 1 "const_uimm6_operand" "YA") + (reg:CCDSP CCDSP_PO_REGNUM) + (reg:CCDSP CCDSP_SC_REGNUM) + (reg:CCDSP CCDSP_CA_REGNUM) + (reg:CCDSP CCDSP_OU_REGNUM) + (reg:CCDSP CCDSP_CC_REGNUM) + (reg:CCDSP CCDSP_EF_REGNUM)] + UNSPEC_RDDSP))] + "TARGET_DSP" + "rddsp\t%0,%1" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; Table 2-7. MIPS DSP ASE Instructions: Indexed-Load +;; L*X +(define_insn "mips_lbux" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (mem:QI (plus:SI (match_operand:SI 1 + "register_operand" "d") + (match_operand:SI 2 + "register_operand" "d")))))] + "TARGET_DSP" + "lbux\t%0,%2(%1)" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "4")]) + +(define_insn "mips_lhx" + [(set (match_operand:SI 0 "register_operand" "=d") + (sign_extend:SI (mem:HI (plus:SI (match_operand:SI 1 + "register_operand" "d") + (match_operand:SI 2 + "register_operand" "d")))))] + "TARGET_DSP" + "lhx\t%0,%2(%1)" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "4")]) + +(define_insn "mips_lwx" + [(set (match_operand:SI 0 "register_operand" "=d") + (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d"))))] + "TARGET_DSP" + "lwx\t%0,%2(%1)" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "4")]) + +;; Table 2-8. MIPS DSP ASE Instructions: Branch +;; BPOSGE32 +(define_insn "mips_bposge" + [(set (pc) + (if_then_else (ge (reg:CCDSP CCDSP_PO_REGNUM) + (match_operand:SI 0 "immediate_operand" "I")) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_DSP" + "%*bposge%0\t%1%/" + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + diff --git a/contrib/gcc/config/mips/mips-modes.def b/contrib/gcc/config/mips/mips-modes.def new file mode 100644 index 00000000000..39c2f164978 --- /dev/null +++ b/contrib/gcc/config/mips/mips-modes.def @@ -0,0 +1,43 @@ +/* MIPS extra machine modes. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* MIPS has a quirky almost-IEEE format for all its + floating point. */ +RESET_FLOAT_FORMAT (SF, mips_single_format); +RESET_FLOAT_FORMAT (DF, mips_double_format); + +/* Irix6 will override this via MIPS_TFMODE_FORMAT. */ +FLOAT_MODE (TF, 16, mips_quad_format); + +/* Vector modes. */ +VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */ +VECTOR_MODES (INT, 4); /* V4QI V2HI */ + +/* Paired single comparison instructions use 2 or 4 CC. */ +CC_MODE (CCV2); +ADJUST_BYTESIZE (CCV2, 8); +ADJUST_ALIGNMENT (CCV2, 8); + +CC_MODE (CCV4); +ADJUST_BYTESIZE (CCV4, 16); +ADJUST_ALIGNMENT (CCV4, 16); + +/* For MIPS DSP control registers. */ +CC_MODE (CCDSP); diff --git a/contrib/gcc/config/mips/mips-protos.h b/contrib/gcc/config/mips/mips-protos.h new file mode 100644 index 00000000000..da1ccea80cb --- /dev/null +++ b/contrib/gcc/config/mips/mips-protos.h @@ -0,0 +1,255 @@ +/* Prototypes of target machine for GNU compiler. MIPS version. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by A. Lichnewsky (lich@inria.inria.fr). + Changed by Michael Meissner (meissner@osf.org). + 64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and + Brendan Eich (brendan@microunity.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#ifndef GCC_MIPS_PROTOS_H +#define GCC_MIPS_PROTOS_H + +/* Classifies a SYMBOL_REF, LABEL_REF or UNSPEC address. + + SYMBOL_GENERAL + Used when none of the below apply. + + SYMBOL_SMALL_DATA + The symbol refers to something in a small data section. + + SYMBOL_CONSTANT_POOL + The symbol refers to something in the mips16 constant pool. + + SYMBOL_GOT_LOCAL + The symbol refers to local data that will be found using + the global offset table. + + SYMBOL_GOT_GLOBAL + Likewise non-local data. + + SYMBOL_GOTOFF_PAGE + An UNSPEC wrapper around a SYMBOL_GOT_LOCAL. It represents the + offset from _gp of a GOT page entry. + + SYMBOL_GOTOFF_GLOBAL + An UNSPEC wrapper around a SYMBOL_GOT_GLOBAL. It represents the + the offset from _gp of the symbol's GOT entry. + + SYMBOL_GOTOFF_CALL + Like SYMBOL_GOTOFF_GLOBAL, but used when calling a global function. + The GOT entry is allowed to point to a stub rather than to the + function itself. + + SYMBOL_GOTOFF_LOADGP + An UNSPEC wrapper around a function's address. It represents the + offset of _gp from the start of the function. + + SYMBOL_TLS + A thread-local symbol. + + SYMBOL_TLSGD + SYMBOL_TLSLDM + SYMBOL_DTPREL + SYMBOL_GOTTPREL + SYMBOL_TPREL + UNSPEC wrappers around SYMBOL_TLS, corresponding to the + thread-local storage relocation operators. + + SYMBOL_64_HIGH + For a 64-bit symbolic address X, this is the value of + (%highest(X) << 16) + %higher(X). + + SYMBOL_64_MID + For a 64-bit symbolic address X, this is the value of + (%higher(X) << 16) + %hi(X). + + SYMBOL_64_LOW + For a 64-bit symbolic address X, this is the value of + (%hi(X) << 16) + %lo(X). */ +enum mips_symbol_type { + SYMBOL_GENERAL, + SYMBOL_SMALL_DATA, + SYMBOL_CONSTANT_POOL, + SYMBOL_GOT_LOCAL, + SYMBOL_GOT_GLOBAL, + SYMBOL_GOTOFF_PAGE, + SYMBOL_GOTOFF_GLOBAL, + SYMBOL_GOTOFF_CALL, + SYMBOL_GOTOFF_LOADGP, + SYMBOL_TLS, + SYMBOL_TLSGD, + SYMBOL_TLSLDM, + SYMBOL_DTPREL, + SYMBOL_GOTTPREL, + SYMBOL_TPREL, + SYMBOL_64_HIGH, + SYMBOL_64_MID, + SYMBOL_64_LOW +}; +#define NUM_SYMBOL_TYPES (SYMBOL_64_LOW + 1) + +/* Identifiers a style of $gp initialization sequence. + + LOADGP_NONE + No initialization sequence is needed. + + LOADGP_OLDABI + The o32 and o64 PIC sequence (the kind traditionally generated + by .cpload). + + LOADGP_NEWABI + The n32 and n64 PIC sequence (the kind traditionally generated + by .cpsetup). + + LOADGP_ABSOLUTE + The GNU absolute sequence, as generated by loadgp_noshared. */ +enum mips_loadgp_style { + LOADGP_NONE, + LOADGP_OLDABI, + LOADGP_NEWABI, + LOADGP_ABSOLUTE +}; + +extern bool mips_symbolic_constant_p (rtx, enum mips_symbol_type *); +extern int mips_regno_mode_ok_for_base_p (int, enum machine_mode, int); +extern bool mips_stack_address_p (rtx, enum machine_mode); +extern int mips_address_insns (rtx, enum machine_mode); +extern int mips_const_insns (rtx); +extern int mips_fetch_insns (rtx); +extern int mips_idiv_insns (void); +extern int fp_register_operand (rtx, enum machine_mode); +extern int lo_operand (rtx, enum machine_mode); +extern bool mips_legitimate_address_p (enum machine_mode, rtx, int); +extern rtx mips_split_symbol (rtx, rtx); +extern rtx mips_unspec_address (rtx, enum mips_symbol_type); +extern bool mips_legitimize_address (rtx *, enum machine_mode); +extern void mips_move_integer (rtx, rtx, unsigned HOST_WIDE_INT); +extern bool mips_legitimize_move (enum machine_mode, rtx, rtx); + +extern int m16_uimm3_b (rtx, enum machine_mode); +extern int m16_simm4_1 (rtx, enum machine_mode); +extern int m16_nsimm4_1 (rtx, enum machine_mode); +extern int m16_simm5_1 (rtx, enum machine_mode); +extern int m16_nsimm5_1 (rtx, enum machine_mode); +extern int m16_uimm5_4 (rtx, enum machine_mode); +extern int m16_nuimm5_4 (rtx, enum machine_mode); +extern int m16_simm8_1 (rtx, enum machine_mode); +extern int m16_nsimm8_1 (rtx, enum machine_mode); +extern int m16_uimm8_1 (rtx, enum machine_mode); +extern int m16_nuimm8_1 (rtx, enum machine_mode); +extern int m16_uimm8_m1_1 (rtx, enum machine_mode); +extern int m16_uimm8_4 (rtx, enum machine_mode); +extern int m16_nuimm8_4 (rtx, enum machine_mode); +extern int m16_simm8_8 (rtx, enum machine_mode); +extern int m16_nsimm8_8 (rtx, enum machine_mode); + +extern rtx mips_subword (rtx, int); +extern bool mips_split_64bit_move_p (rtx, rtx); +extern void mips_split_64bit_move (rtx, rtx); +extern const char *mips_output_move (rtx, rtx); +extern void mips_restore_gp (void); +#ifdef RTX_CODE +extern bool mips_emit_scc (enum rtx_code, rtx); +extern void gen_conditional_branch (rtx *, enum rtx_code); +extern void mips_expand_vcondv2sf (rtx, rtx, rtx, enum rtx_code, rtx, rtx); +#endif +extern void gen_conditional_move (rtx *); +extern void mips_gen_conditional_trap (rtx *); +extern void mips_expand_call (rtx, rtx, rtx, rtx, int); +extern void mips_emit_fcc_reload (rtx, rtx, rtx); +extern void mips_set_return_address (rtx, rtx); +extern bool mips_expand_block_move (rtx, rtx, rtx); + +extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx); +extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + tree, int); +extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *, + enum machine_mode, tree, int); +extern int function_arg_boundary (enum machine_mode, tree); +extern bool mips_pad_arg_upward (enum machine_mode, tree); +extern bool mips_pad_reg_upward (enum machine_mode, tree); +extern void mips_va_start (tree, rtx); + +extern bool mips_expand_unaligned_load (rtx, rtx, unsigned int, int); +extern bool mips_expand_unaligned_store (rtx, rtx, unsigned int, int); +extern bool mips_mem_fits_mode_p (enum machine_mode mode, rtx x); +extern void override_options (void); +extern void mips_conditional_register_usage (void); +extern void mips_order_regs_for_local_alloc (void); +extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT); + +extern void print_operand (FILE *, rtx, int); +extern void print_operand_address (FILE *, rtx); +extern int mips_output_external (FILE *, tree, const char *); +extern void mips_output_filename (FILE *, const char *); +extern void mips_output_ascii (FILE *, const char *, size_t, const char *); +extern void mips_output_aligned_bss (FILE *, tree, const char *, + unsigned HOST_WIDE_INT, int); +extern void mips_output_aligned_decl_common (FILE *, tree, const char *, + unsigned HOST_WIDE_INT, + unsigned int); +extern void mips_declare_common_object (FILE *, const char *, + const char *, unsigned HOST_WIDE_INT, + unsigned int, bool); +extern void mips_declare_object (FILE *, const char *, const char *, + const char *, ...) ATTRIBUTE_PRINTF_4; +extern void mips_declare_object_name (FILE *, const char *, tree); +extern void mips_finish_declare_object (FILE *, tree, int, int); + +extern bool mips_small_data_pattern_p (rtx); +extern rtx mips_rewrite_small_data (rtx); +extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT); +extern HOST_WIDE_INT mips_initial_elimination_offset (int, int); +extern rtx mips_return_addr (int, rtx); +extern enum mips_loadgp_style mips_current_loadgp_style (void); +extern void mips_expand_prologue (void); +extern void mips_expand_epilogue (int); +extern int mips_can_use_return_insn (void); +extern struct rtx_def *mips_function_value (tree, tree, enum machine_mode); + +extern bool mips_cannot_change_mode_class (enum machine_mode, + enum machine_mode, enum reg_class); +extern bool mips_dangerous_for_la25_p (rtx); +extern enum reg_class mips_preferred_reload_class (rtx, enum reg_class); +extern enum reg_class mips_secondary_reload_class (enum reg_class, + enum machine_mode, + rtx, int); +extern int mips_class_max_nregs (enum reg_class, enum machine_mode); +extern int build_mips16_call_stub (rtx, rtx, rtx, int); +extern int mips_register_move_cost (enum machine_mode, enum reg_class, + enum reg_class); + +extern int mips_adjust_insn_length (rtx, int); +extern const char *mips_output_load_label (void); +extern const char *mips_output_conditional_branch (rtx, rtx *, const char *, + const char *); +extern const char *mips_output_order_conditional_branch (rtx, rtx *, bool); +extern const char *mips_output_division (const char *, rtx *); +extern unsigned int mips_hard_regno_nregs (int, enum machine_mode); +extern bool mips_linked_madd_p (rtx, rtx); +extern int mips_store_data_bypass_p (rtx, rtx); +extern rtx mips_prefetch_cookie (rtx, rtx); + +extern void irix_asm_output_align (FILE *, unsigned); +extern const char *current_section_name (void); +extern unsigned int current_section_flags (void); +extern bool mips_use_ins_ext_p (rtx, rtx, rtx); + +#endif /* ! GCC_MIPS_PROTOS_H */ diff --git a/contrib/gcc/config/mips/mips-ps-3d.md b/contrib/gcc/config/mips/mips-ps-3d.md new file mode 100644 index 00000000000..c817f4df69e --- /dev/null +++ b/contrib/gcc/config/mips/mips-ps-3d.md @@ -0,0 +1,618 @@ +;; MIPS Paired-Single Floating and MIPS-3D Instructions. +;; Copyright (C) 2004 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_insn "*movcc_v2sf_" + [(set (match_operand:V2SF 0 "register_operand" "=f,f") + (if_then_else:V2SF + (match_operator:GPR 4 "equality_operator" + [(match_operand:GPR 1 "register_operand" "d,d") + (const_int 0)]) + (match_operand:V2SF 2 "register_operand" "f,0") + (match_operand:V2SF 3 "register_operand" "0,f")))] + "TARGET_PAIRED_SINGLE_FLOAT" + "@ + mov%T4.ps\t%0,%2,%1 + mov%t4.ps\t%0,%3,%1" + [(set_attr "type" "condmove") + (set_attr "mode" "SF")]) + +(define_insn "mips_cond_move_tf_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f,f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f,0") + (match_operand:V2SF 2 "register_operand" "0,f") + (match_operand:CCV2 3 "register_operand" "z,z")] + UNSPEC_MOVE_TF_PS))] + "TARGET_PAIRED_SINGLE_FLOAT" + "@ + movt.ps\t%0,%1,%3 + movf.ps\t%0,%2,%3" + [(set_attr "type" "condmove") + (set_attr "mode" "SF")]) + +(define_expand "movv2sfcc" + [(set (match_dup 4) (match_operand 1 "comparison_operator")) + (set (match_operand:V2SF 0 "register_operand") + (if_then_else:V2SF (match_dup 5) + (match_operand:V2SF 2 "register_operand") + (match_operand:V2SF 3 "register_operand")))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + /* We can only support MOVN.PS and MOVZ.PS. + NOTE: MOVT.PS and MOVF.PS have different semantics from MOVN.PS and + MOVZ.PS. MOVT.PS and MOVF.PS depend on two CC values and move + each item independently. */ + + if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) != MODE_INT) + FAIL; + + gen_conditional_move (operands); + DONE; +}) + +; pul.ps - Pair Upper Lower +(define_insn "mips_pul_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (vec_merge:V2SF + (match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (const_int 2)))] + "TARGET_PAIRED_SINGLE_FLOAT" + "pul.ps\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "SF")]) + +; puu.ps - Pair upper upper +(define_insn "mips_puu_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (vec_merge:V2SF + (match_operand:V2SF 1 "register_operand" "f") + (vec_select:V2SF (match_operand:V2SF 2 "register_operand" "f") + (parallel [(const_int 1) + (const_int 0)])) + (const_int 2)))] + "TARGET_PAIRED_SINGLE_FLOAT" + "puu.ps\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "SF")]) + +; pll.ps - Pair Lower Lower +(define_insn "mips_pll_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (vec_merge:V2SF + (vec_select:V2SF (match_operand:V2SF 1 "register_operand" "f") + (parallel [(const_int 1) + (const_int 0)])) + (match_operand:V2SF 2 "register_operand" "f") + (const_int 2)))] + "TARGET_PAIRED_SINGLE_FLOAT" + "pll.ps\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "SF")]) + +; plu.ps - Pair Lower Upper +(define_insn "mips_plu_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (vec_merge:V2SF + (vec_select:V2SF (match_operand:V2SF 1 "register_operand" "f") + (parallel [(const_int 1) + (const_int 0)])) + (vec_select:V2SF (match_operand:V2SF 2 "register_operand" "f") + (parallel [(const_int 1) + (const_int 0)])) + (const_int 2)))] + "TARGET_PAIRED_SINGLE_FLOAT" + "plu.ps\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "SF")]) + +; vec_init +(define_expand "vec_initv2sf" + [(match_operand:V2SF 0 "register_operand") + (match_operand:V2SF 1 "")] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + rtx op0 = force_reg (SFmode, XVECEXP (operands[1], 0, 0)); + rtx op1 = force_reg (SFmode, XVECEXP (operands[1], 0, 1)); + emit_insn (gen_vec_initv2sf_internal (operands[0], op0, op1)); + DONE; +}) + +(define_insn "vec_initv2sf_internal" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (vec_concat:V2SF + (match_operand:SF 1 "register_operand" "f") + (match_operand:SF 2 "register_operand" "f")))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + if (BYTES_BIG_ENDIAN) + return "cvt.ps.s\t%0,%1,%2"; + else + return "cvt.ps.s\t%0,%2,%1"; +} + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) + +;; ??? This is only generated if we perform a vector operation that has to be +;; emulated. There is no other way to get a vector mode bitfield extract +;; currently. + +(define_insn "vec_extractv2sf" + [(set (match_operand:SF 0 "register_operand" "=f") + (vec_select:SF (match_operand:V2SF 1 "register_operand" "f") + (parallel + [(match_operand 2 "const_0_or_1_operand" "")])))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + if (INTVAL (operands[2]) == !BYTES_BIG_ENDIAN) + return "cvt.s.pu\t%0,%1"; + else + return "cvt.s.pl\t%0,%1"; +} + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) + +;; ??? This is only generated if we disable the vec_init pattern. There is +;; no other way to get a vector mode bitfield store currently. + +(define_expand "vec_setv2sf" + [(match_operand:V2SF 0 "register_operand") + (match_operand:SF 1 "register_operand") + (match_operand 2 "const_0_or_1_operand")] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + rtx temp; + + /* We don't have an insert instruction, so we duplicate the float, and + then use a PUL instruction. */ + temp = gen_reg_rtx (V2SFmode); + emit_insn (gen_mips_cvt_ps_s (temp, operands[1], operands[1])); + if (INTVAL (operands[2]) == !BYTES_BIG_ENDIAN) + emit_insn (gen_mips_pul_ps (operands[0], temp, operands[0])); + else + emit_insn (gen_mips_pul_ps (operands[0], operands[0], temp)); + DONE; +}) + +; cvt.ps.s - Floating Point Convert Pair to Paired Single +(define_expand "mips_cvt_ps_s" + [(match_operand:V2SF 0 "register_operand") + (match_operand:SF 1 "register_operand") + (match_operand:SF 2 "register_operand")] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + if (BYTES_BIG_ENDIAN) + emit_insn (gen_vec_initv2sf_internal (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_vec_initv2sf_internal (operands[0], operands[2], + operands[1])); + DONE; +}) + +; cvt.s.pl - Floating Point Convert Pair Lower to Single Floating Point +(define_expand "mips_cvt_s_pl" + [(set (match_operand:SF 0 "register_operand") + (vec_select:SF (match_operand:V2SF 1 "register_operand") + (parallel [(match_dup 2)])))] + "TARGET_PAIRED_SINGLE_FLOAT" + { operands[2] = GEN_INT (BYTES_BIG_ENDIAN); }) + +; cvt.s.pu - Floating Point Convert Pair Upper to Single Floating Point +(define_expand "mips_cvt_s_pu" + [(set (match_operand:SF 0 "register_operand") + (vec_select:SF (match_operand:V2SF 1 "register_operand") + (parallel [(match_dup 2)])))] + "TARGET_PAIRED_SINGLE_FLOAT" + { operands[2] = GEN_INT (!BYTES_BIG_ENDIAN); }) + +; alnv.ps - Floating Point Align Variable +(define_insn "mips_alnv_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (match_operand:SI 3 "register_operand" "d")] + UNSPEC_ALNV_PS))] + "TARGET_PAIRED_SINGLE_FLOAT" + "alnv.ps\t%0,%1,%2,%3" + [(set_attr "type" "fmove") + (set_attr "mode" "SF")]) + +; addr.ps - Floating Point Reduction Add +(define_insn "mips_addr_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f")] + UNSPEC_ADDR_PS))] + "TARGET_MIPS3D" + "addr.ps\t%0,%1,%2" + [(set_attr "type" "fadd") + (set_attr "mode" "SF")]) + +; cvt.pw.ps - Floating Point Convert Paired Single to Paired Word +(define_insn "mips_cvt_pw_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")] + UNSPEC_CVT_PW_PS))] + "TARGET_MIPS3D" + "cvt.pw.ps\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) + +; cvt.ps.pw - Floating Point Convert Paired Word to Paired Single +(define_insn "mips_cvt_ps_pw" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")] + UNSPEC_CVT_PS_PW))] + "TARGET_MIPS3D" + "cvt.ps.pw\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) + +; mulr.ps - Floating Point Reduction Multiply +(define_insn "mips_mulr_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f")] + UNSPEC_MULR_PS))] + "TARGET_MIPS3D" + "mulr.ps\t%0,%1,%2" + [(set_attr "type" "fmul") + (set_attr "mode" "SF")]) + +; abs.ps +(define_expand "mips_abs_ps" + [(set (match_operand:V2SF 0 "register_operand") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand")] + UNSPEC_ABS_PS))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + /* If we can ignore NaNs, this operation is equivalent to the + rtl ABS code. */ + if (!HONOR_NANS (V2SFmode)) + { + emit_insn (gen_absv2sf2 (operands[0], operands[1])); + DONE; + } +}) + +(define_insn "*mips_abs_ps" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")] + UNSPEC_ABS_PS))] + "TARGET_PAIRED_SINGLE_FLOAT" + "abs.ps\t%0,%1" + [(set_attr "type" "fabs") + (set_attr "mode" "SF")]) + +;---------------------------------------------------------------------------- +; Floating Point Comparisons for Scalars +;---------------------------------------------------------------------------- + +(define_insn "mips_cabs_cond_" + [(set (match_operand:CC 0 "register_operand" "=z") + (unspec:CC [(match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f") + (match_operand 3 "const_int_operand" "")] + UNSPEC_CABS))] + "TARGET_MIPS3D" + "cabs.%Y3.\t%0,%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + + +;---------------------------------------------------------------------------- +; Floating Point Comparisons for Four Singles +;---------------------------------------------------------------------------- + +(define_insn_and_split "mips_c_cond_4s" + [(set (match_operand:CCV4 0 "register_operand" "=z") + (unspec:CCV4 [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (match_operand:V2SF 3 "register_operand" "f") + (match_operand:V2SF 4 "register_operand" "f") + (match_operand 5 "const_int_operand" "")] + UNSPEC_C))] + "TARGET_PAIRED_SINGLE_FLOAT" + "#" + "&& reload_completed" + [(set (match_dup 6) + (unspec:CCV2 [(match_dup 1) + (match_dup 2) + (match_dup 5)] + UNSPEC_C)) + (set (match_dup 7) + (unspec:CCV2 [(match_dup 3) + (match_dup 4) + (match_dup 5)] + UNSPEC_C))] +{ + operands[6] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 0); + operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8); +} + [(set_attr "type" "fcmp") + (set_attr "length" "8") + (set_attr "mode" "FPSW")]) + +(define_insn_and_split "mips_cabs_cond_4s" + [(set (match_operand:CCV4 0 "register_operand" "=z") + (unspec:CCV4 [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (match_operand:V2SF 3 "register_operand" "f") + (match_operand:V2SF 4 "register_operand" "f") + (match_operand 5 "const_int_operand" "")] + UNSPEC_CABS))] + "TARGET_MIPS3D" + "#" + "&& reload_completed" + [(set (match_dup 6) + (unspec:CCV2 [(match_dup 1) + (match_dup 2) + (match_dup 5)] + UNSPEC_CABS)) + (set (match_dup 7) + (unspec:CCV2 [(match_dup 3) + (match_dup 4) + (match_dup 5)] + UNSPEC_CABS))] +{ + operands[6] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 0); + operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8); +} + [(set_attr "type" "fcmp") + (set_attr "length" "8") + (set_attr "mode" "FPSW")]) + + +;---------------------------------------------------------------------------- +; Floating Point Comparisons for Paired Singles +;---------------------------------------------------------------------------- + +(define_insn "mips_c_cond_ps" + [(set (match_operand:CCV2 0 "register_operand" "=z") + (unspec:CCV2 [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (match_operand 3 "const_int_operand" "")] + UNSPEC_C))] + "TARGET_PAIRED_SINGLE_FLOAT" + "c.%Y3.ps\t%0,%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +(define_insn "mips_cabs_cond_ps" + [(set (match_operand:CCV2 0 "register_operand" "=z") + (unspec:CCV2 [(match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f") + (match_operand 3 "const_int_operand" "")] + UNSPEC_CABS))] + "TARGET_MIPS3D" + "cabs.%Y3.ps\t%0,%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +;; An expander for generating an scc operation. +(define_expand "scc_ps" + [(set (match_operand:CCV2 0) + (unspec:CCV2 [(match_operand 1)] UNSPEC_SCC))]) + +(define_insn "s_ps" + [(set (match_operand:CCV2 0 "register_operand" "=z") + (unspec:CCV2 + [(fcond (match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f"))] + UNSPEC_SCC))] + "TARGET_PAIRED_SINGLE_FLOAT" + "c..ps\t%0,%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +(define_insn "s_ps" + [(set (match_operand:CCV2 0 "register_operand" "=z") + (unspec:CCV2 + [(swapped_fcond (match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f"))] + UNSPEC_SCC))] + "TARGET_PAIRED_SINGLE_FLOAT" + "c..ps\t%0,%2,%1" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +;---------------------------------------------------------------------------- +; Floating Point Branch Instructions. +;---------------------------------------------------------------------------- + +; Branch on Any of Four Floating Point Condition Codes True +(define_insn "bc1any4t" + [(set (pc) + (if_then_else (ne (match_operand:CCV4 0 "register_operand" "z") + (const_int 0)) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_MIPS3D" + "%*bc1any4t\t%0,%1%/" + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +; Branch on Any of Four Floating Point Condition Codes False +(define_insn "bc1any4f" + [(set (pc) + (if_then_else (ne (match_operand:CCV4 0 "register_operand" "z") + (const_int -1)) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_MIPS3D" + "%*bc1any4f\t%0,%1%/" + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +; Branch on Any of Two Floating Point Condition Codes True +(define_insn "bc1any2t" + [(set (pc) + (if_then_else (ne (match_operand:CCV2 0 "register_operand" "z") + (const_int 0)) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_MIPS3D" + "%*bc1any2t\t%0,%1%/" + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +; Branch on Any of Two Floating Point Condition Codes False +(define_insn "bc1any2f" + [(set (pc) + (if_then_else (ne (match_operand:CCV2 0 "register_operand" "z") + (const_int -1)) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_MIPS3D" + "%*bc1any2f\t%0,%1%/" + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +; Used to access one register in a CCV2 pair. Operand 0 is the register +; pair and operand 1 is the index of the register we want (a CONST_INT). +(define_expand "single_cc" + [(ne (unspec:CC [(match_operand 0) (match_operand 1)] UNSPEC_SINGLE_CC) + (const_int 0))]) + +; This is a normal floating-point branch pattern, but rather than check +; a single CCmode register, it checks one register in a CCV2 pair. +; Operand 2 is the register pair and operand 3 is the index of the +; register we want. +(define_insn "*branch_upper_lower" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(unspec:CC [(match_operand:CCV2 2 "register_operand" "z") + (match_operand 3 "const_int_operand")] + UNSPEC_SINGLE_CC) + (const_int 0)]) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_HARD_FLOAT" +{ + operands[2] + = gen_rtx_REG (CCmode, REGNO (operands[2]) + INTVAL (operands[3])); + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%F0", "%2,%1"), + MIPS_BRANCH ("b%W0", "%2,%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +; As above, but with the sense of the condition reversed. +(define_insn "*branch_upper_lower_inverted" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(unspec:CC [(match_operand:CCV2 2 "register_operand" "z") + (match_operand 3 "const_int_operand")] + UNSPEC_SINGLE_CC) + (const_int 0)]) + (pc) + (label_ref (match_operand 1 "" ""))))] + "TARGET_HARD_FLOAT" +{ + operands[2] + = gen_rtx_REG (CCmode, REGNO (operands[2]) + INTVAL (operands[3])); + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%W0", "%2,%1"), + MIPS_BRANCH ("b%F0", "%2,%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +;---------------------------------------------------------------------------- +; Floating Point Reduced Precision Reciprocal Square Root Instructions. +;---------------------------------------------------------------------------- + +(define_insn "mips_rsqrt1_" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")] + UNSPEC_RSQRT1))] + "TARGET_MIPS3D" + "rsqrt1.\t%0,%1" + [(set_attr "type" "frsqrt1") + (set_attr "mode" "")]) + +(define_insn "mips_rsqrt2_" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")] + UNSPEC_RSQRT2))] + "TARGET_MIPS3D" + "rsqrt2.\t%0,%1,%2" + [(set_attr "type" "frsqrt2") + (set_attr "mode" "")]) + +(define_insn "mips_recip1_" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")] + UNSPEC_RECIP1))] + "TARGET_MIPS3D" + "recip1.\t%0,%1" + [(set_attr "type" "frdiv1") + (set_attr "mode" "")]) + +(define_insn "mips_recip2_" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")] + UNSPEC_RECIP2))] + "TARGET_MIPS3D" + "recip2.\t%0,%1,%2" + [(set_attr "type" "frdiv2") + (set_attr "mode" "")]) + +(define_expand "vcondv2sf" + [(set (match_operand:V2SF 0 "register_operand") + (if_then_else:V2SF + (match_operator 3 "" + [(match_operand:V2SF 4 "register_operand") + (match_operand:V2SF 5 "register_operand")]) + (match_operand:V2SF 1 "register_operand") + (match_operand:V2SF 2 "register_operand")))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + mips_expand_vcondv2sf (operands[0], operands[1], operands[2], + GET_CODE (operands[3]), operands[4], operands[5]); + DONE; +}) + +(define_expand "sminv2sf3" + [(set (match_operand:V2SF 0 "register_operand") + (smin:V2SF (match_operand:V2SF 1 "register_operand") + (match_operand:V2SF 2 "register_operand")))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + mips_expand_vcondv2sf (operands[0], operands[1], operands[2], + LE, operands[1], operands[2]); + DONE; +}) + +(define_expand "smaxv2sf3" + [(set (match_operand:V2SF 0 "register_operand") + (smax:V2SF (match_operand:V2SF 1 "register_operand") + (match_operand:V2SF 2 "register_operand")))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + mips_expand_vcondv2sf (operands[0], operands[1], operands[2], + LE, operands[2], operands[1]); + DONE; +}) diff --git a/contrib/gcc/config/mips/mips.c b/contrib/gcc/config/mips/mips.c new file mode 100644 index 00000000000..05498c2c21d --- /dev/null +++ b/contrib/gcc/config/mips/mips.c @@ -0,0 +1,10840 @@ +/* Subroutines used for MIPS code generation. + Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by A. Lichnewsky, lich@inria.inria.fr. + Changes by Michael Meissner, meissner@osf.org. + 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and + Brendan Eich, brendan@microunity.com. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "real.h" +#include "insn-config.h" +#include "conditions.h" +#include "insn-attr.h" +#include "recog.h" +#include "toplev.h" +#include "output.h" +#include "tree.h" +#include "function.h" +#include "expr.h" +#include "optabs.h" +#include "flags.h" +#include "reload.h" +#include "tm_p.h" +#include "ggc.h" +#include "gstab.h" +#include "hashtab.h" +#include "debug.h" +#include "target.h" +#include "target-def.h" +#include "integrate.h" +#include "langhooks.h" +#include "cfglayout.h" +#include "sched-int.h" +#include "tree-gimple.h" +#include "bitmap.h" + +/* True if X is an unspec wrapper around a SYMBOL_REF or LABEL_REF. */ +#define UNSPEC_ADDRESS_P(X) \ + (GET_CODE (X) == UNSPEC \ + && XINT (X, 1) >= UNSPEC_ADDRESS_FIRST \ + && XINT (X, 1) < UNSPEC_ADDRESS_FIRST + NUM_SYMBOL_TYPES) + +/* Extract the symbol or label from UNSPEC wrapper X. */ +#define UNSPEC_ADDRESS(X) \ + XVECEXP (X, 0, 0) + +/* Extract the symbol type from UNSPEC wrapper X. */ +#define UNSPEC_ADDRESS_TYPE(X) \ + ((enum mips_symbol_type) (XINT (X, 1) - UNSPEC_ADDRESS_FIRST)) + +/* The maximum distance between the top of the stack frame and the + value $sp has when we save & restore registers. + + Use a maximum gap of 0x100 in the mips16 case. We can then use + unextended instructions to save and restore registers, and to + allocate and deallocate the top part of the frame. + + The value in the !mips16 case must be a SMALL_OPERAND and must + preserve the maximum stack alignment. */ +#define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7ff0) + +/* True if INSN is a mips.md pattern or asm statement. */ +#define USEFUL_INSN_P(INSN) \ + (INSN_P (INSN) \ + && GET_CODE (PATTERN (INSN)) != USE \ + && GET_CODE (PATTERN (INSN)) != CLOBBER \ + && GET_CODE (PATTERN (INSN)) != ADDR_VEC \ + && GET_CODE (PATTERN (INSN)) != ADDR_DIFF_VEC) + +/* If INSN is a delayed branch sequence, return the first instruction + in the sequence, otherwise return INSN itself. */ +#define SEQ_BEGIN(INSN) \ + (INSN_P (INSN) && GET_CODE (PATTERN (INSN)) == SEQUENCE \ + ? XVECEXP (PATTERN (INSN), 0, 0) \ + : (INSN)) + +/* Likewise for the last instruction in a delayed branch sequence. */ +#define SEQ_END(INSN) \ + (INSN_P (INSN) && GET_CODE (PATTERN (INSN)) == SEQUENCE \ + ? XVECEXP (PATTERN (INSN), 0, XVECLEN (PATTERN (INSN), 0) - 1) \ + : (INSN)) + +/* Execute the following loop body with SUBINSN set to each instruction + between SEQ_BEGIN (INSN) and SEQ_END (INSN) inclusive. */ +#define FOR_EACH_SUBINSN(SUBINSN, INSN) \ + for ((SUBINSN) = SEQ_BEGIN (INSN); \ + (SUBINSN) != NEXT_INSN (SEQ_END (INSN)); \ + (SUBINSN) = NEXT_INSN (SUBINSN)) + +/* Classifies an address. + + ADDRESS_REG + A natural register + offset address. The register satisfies + mips_valid_base_register_p and the offset is a const_arith_operand. + + ADDRESS_LO_SUM + A LO_SUM rtx. The first operand is a valid base register and + the second operand is a symbolic address. + + ADDRESS_CONST_INT + A signed 16-bit constant address. + + ADDRESS_SYMBOLIC: + A constant symbolic address (equivalent to CONSTANT_SYMBOLIC). */ +enum mips_address_type { + ADDRESS_REG, + ADDRESS_LO_SUM, + ADDRESS_CONST_INT, + ADDRESS_SYMBOLIC +}; + +/* Classifies the prototype of a builtin function. */ +enum mips_function_type +{ + MIPS_V2SF_FTYPE_V2SF, + MIPS_V2SF_FTYPE_V2SF_V2SF, + MIPS_V2SF_FTYPE_V2SF_V2SF_INT, + MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, + MIPS_V2SF_FTYPE_SF_SF, + MIPS_INT_FTYPE_V2SF_V2SF, + MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, + MIPS_INT_FTYPE_SF_SF, + MIPS_INT_FTYPE_DF_DF, + MIPS_SF_FTYPE_V2SF, + MIPS_SF_FTYPE_SF, + MIPS_SF_FTYPE_SF_SF, + MIPS_DF_FTYPE_DF, + MIPS_DF_FTYPE_DF_DF, + + /* For MIPS DSP ASE */ + MIPS_DI_FTYPE_DI_SI, + MIPS_DI_FTYPE_DI_SI_SI, + MIPS_DI_FTYPE_DI_V2HI_V2HI, + MIPS_DI_FTYPE_DI_V4QI_V4QI, + MIPS_SI_FTYPE_DI_SI, + MIPS_SI_FTYPE_PTR_SI, + MIPS_SI_FTYPE_SI, + MIPS_SI_FTYPE_SI_SI, + MIPS_SI_FTYPE_V2HI, + MIPS_SI_FTYPE_V2HI_V2HI, + MIPS_SI_FTYPE_V4QI, + MIPS_SI_FTYPE_V4QI_V4QI, + MIPS_SI_FTYPE_VOID, + MIPS_V2HI_FTYPE_SI, + MIPS_V2HI_FTYPE_SI_SI, + MIPS_V2HI_FTYPE_V2HI, + MIPS_V2HI_FTYPE_V2HI_SI, + MIPS_V2HI_FTYPE_V2HI_V2HI, + MIPS_V2HI_FTYPE_V4QI, + MIPS_V2HI_FTYPE_V4QI_V2HI, + MIPS_V4QI_FTYPE_SI, + MIPS_V4QI_FTYPE_V2HI_V2HI, + MIPS_V4QI_FTYPE_V4QI_SI, + MIPS_V4QI_FTYPE_V4QI_V4QI, + MIPS_VOID_FTYPE_SI_SI, + MIPS_VOID_FTYPE_V2HI_V2HI, + MIPS_VOID_FTYPE_V4QI_V4QI, + + /* The last type. */ + MIPS_MAX_FTYPE_MAX +}; + +/* Specifies how a builtin function should be converted into rtl. */ +enum mips_builtin_type +{ + /* The builtin corresponds directly to an .md pattern. The return + value is mapped to operand 0 and the arguments are mapped to + operands 1 and above. */ + MIPS_BUILTIN_DIRECT, + + /* The builtin corresponds directly to an .md pattern. There is no return + value and the arguments are mapped to operands 0 and above. */ + MIPS_BUILTIN_DIRECT_NO_TARGET, + + /* The builtin corresponds to a comparison instruction followed by + a mips_cond_move_tf_ps pattern. The first two arguments are the + values to compare and the second two arguments are the vector + operands for the movt.ps or movf.ps instruction (in assembly order). */ + MIPS_BUILTIN_MOVF, + MIPS_BUILTIN_MOVT, + + /* The builtin corresponds to a V2SF comparison instruction. Operand 0 + of this instruction is the result of the comparison, which has mode + CCV2 or CCV4. The function arguments are mapped to operands 1 and + above. The function's return value is an SImode boolean that is + true under the following conditions: + + MIPS_BUILTIN_CMP_ANY: one of the registers is true + MIPS_BUILTIN_CMP_ALL: all of the registers are true + MIPS_BUILTIN_CMP_LOWER: the first register is true + MIPS_BUILTIN_CMP_UPPER: the second register is true. */ + MIPS_BUILTIN_CMP_ANY, + MIPS_BUILTIN_CMP_ALL, + MIPS_BUILTIN_CMP_UPPER, + MIPS_BUILTIN_CMP_LOWER, + + /* As above, but the instruction only sets a single $fcc register. */ + MIPS_BUILTIN_CMP_SINGLE, + + /* For generating bposge32 branch instructions in MIPS32 DSP ASE. */ + MIPS_BUILTIN_BPOSGE32 +}; + +/* Invokes MACRO (COND) for each c.cond.fmt condition. */ +#define MIPS_FP_CONDITIONS(MACRO) \ + MACRO (f), \ + MACRO (un), \ + MACRO (eq), \ + MACRO (ueq), \ + MACRO (olt), \ + MACRO (ult), \ + MACRO (ole), \ + MACRO (ule), \ + MACRO (sf), \ + MACRO (ngle), \ + MACRO (seq), \ + MACRO (ngl), \ + MACRO (lt), \ + MACRO (nge), \ + MACRO (le), \ + MACRO (ngt) + +/* Enumerates the codes above as MIPS_FP_COND_. */ +#define DECLARE_MIPS_COND(X) MIPS_FP_COND_ ## X +enum mips_fp_condition { + MIPS_FP_CONDITIONS (DECLARE_MIPS_COND) +}; + +/* Index X provides the string representation of MIPS_FP_COND_. */ +#define STRINGIFY(X) #X +static const char *const mips_fp_conditions[] = { + MIPS_FP_CONDITIONS (STRINGIFY) +}; + +/* A function to save or store a register. The first argument is the + register and the second is the stack slot. */ +typedef void (*mips_save_restore_fn) (rtx, rtx); + +struct mips16_constant; +struct mips_arg_info; +struct mips_address_info; +struct mips_integer_op; +struct mips_sim; + +static enum mips_symbol_type mips_classify_symbol (rtx); +static void mips_split_const (rtx, rtx *, HOST_WIDE_INT *); +static bool mips_offset_within_object_p (rtx, HOST_WIDE_INT); +static bool mips_valid_base_register_p (rtx, enum machine_mode, int); +static bool mips_symbolic_address_p (enum mips_symbol_type, enum machine_mode); +static bool mips_classify_address (struct mips_address_info *, rtx, + enum machine_mode, int); +static bool mips_cannot_force_const_mem (rtx); +static bool mips_use_blocks_for_constant_p (enum machine_mode, rtx); +static int mips_symbol_insns (enum mips_symbol_type); +static bool mips16_unextended_reference_p (enum machine_mode mode, rtx, rtx); +static rtx mips_force_temporary (rtx, rtx); +static rtx mips_unspec_offset_high (rtx, rtx, rtx, enum mips_symbol_type); +static rtx mips_add_offset (rtx, rtx, HOST_WIDE_INT); +static unsigned int mips_build_shift (struct mips_integer_op *, HOST_WIDE_INT); +static unsigned int mips_build_lower (struct mips_integer_op *, + unsigned HOST_WIDE_INT); +static unsigned int mips_build_integer (struct mips_integer_op *, + unsigned HOST_WIDE_INT); +static void mips_legitimize_const_move (enum machine_mode, rtx, rtx); +static int m16_check_op (rtx, int, int, int); +static bool mips_rtx_costs (rtx, int, int, int *); +static int mips_address_cost (rtx); +static void mips_emit_compare (enum rtx_code *, rtx *, rtx *, bool); +static void mips_load_call_address (rtx, rtx, int); +static bool mips_function_ok_for_sibcall (tree, tree); +static void mips_block_move_straight (rtx, rtx, HOST_WIDE_INT); +static void mips_adjust_block_mem (rtx, HOST_WIDE_INT, rtx *, rtx *); +static void mips_block_move_loop (rtx, rtx, HOST_WIDE_INT); +static void mips_arg_info (const CUMULATIVE_ARGS *, enum machine_mode, + tree, int, struct mips_arg_info *); +static bool mips_get_unaligned_mem (rtx *, unsigned int, int, rtx *, rtx *); +static void mips_set_architecture (const struct mips_cpu_info *); +static void mips_set_tune (const struct mips_cpu_info *); +static bool mips_handle_option (size_t, const char *, int); +static struct machine_function *mips_init_machine_status (void); +static void print_operand_reloc (FILE *, rtx, const char **); +#if TARGET_IRIX +static void irix_output_external_libcall (rtx); +#endif +static void mips_file_start (void); +static void mips_file_end (void); +static bool mips_rewrite_small_data_p (rtx); +static int mips_small_data_pattern_1 (rtx *, void *); +static int mips_rewrite_small_data_1 (rtx *, void *); +static bool mips_function_has_gp_insn (void); +static unsigned int mips_global_pointer (void); +static bool mips_save_reg_p (unsigned int); +static void mips_save_restore_reg (enum machine_mode, int, HOST_WIDE_INT, + mips_save_restore_fn); +static void mips_for_each_saved_reg (HOST_WIDE_INT, mips_save_restore_fn); +static void mips_output_cplocal (void); +static void mips_emit_loadgp (void); +static void mips_output_function_prologue (FILE *, HOST_WIDE_INT); +static void mips_set_frame_expr (rtx); +static rtx mips_frame_set (rtx, rtx); +static void mips_save_reg (rtx, rtx); +static void mips_output_function_epilogue (FILE *, HOST_WIDE_INT); +static void mips_restore_reg (rtx, rtx); +static void mips_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, + HOST_WIDE_INT, tree); +static int symbolic_expression_p (rtx); +static section *mips_select_rtx_section (enum machine_mode, rtx, + unsigned HOST_WIDE_INT); +static section *mips_function_rodata_section (tree); +static bool mips_in_small_data_p (tree); +static bool mips_use_anchors_for_symbol_p (rtx); +static int mips_fpr_return_fields (tree, tree *); +static bool mips_return_in_msb (tree); +static rtx mips_return_fpr_pair (enum machine_mode mode, + enum machine_mode mode1, HOST_WIDE_INT, + enum machine_mode mode2, HOST_WIDE_INT); +static rtx mips16_gp_pseudo_reg (void); +static void mips16_fp_args (FILE *, int, int); +static void build_mips16_function_stub (FILE *); +static rtx dump_constants_1 (enum machine_mode, rtx, rtx); +static void dump_constants (struct mips16_constant *, rtx); +static int mips16_insn_length (rtx); +static int mips16_rewrite_pool_refs (rtx *, void *); +static void mips16_lay_out_constants (void); +static void mips_sim_reset (struct mips_sim *); +static void mips_sim_init (struct mips_sim *, state_t); +static void mips_sim_next_cycle (struct mips_sim *); +static void mips_sim_wait_reg (struct mips_sim *, rtx, rtx); +static int mips_sim_wait_regs_2 (rtx *, void *); +static void mips_sim_wait_regs_1 (rtx *, void *); +static void mips_sim_wait_regs (struct mips_sim *, rtx); +static void mips_sim_wait_units (struct mips_sim *, rtx); +static void mips_sim_wait_insn (struct mips_sim *, rtx); +static void mips_sim_record_set (rtx, rtx, void *); +static void mips_sim_issue_insn (struct mips_sim *, rtx); +static void mips_sim_issue_nop (struct mips_sim *); +static void mips_sim_finish_insn (struct mips_sim *, rtx); +static void vr4130_avoid_branch_rt_conflict (rtx); +static void vr4130_align_insns (void); +static void mips_avoid_hazard (rtx, rtx, int *, rtx *, rtx); +static void mips_avoid_hazards (void); +static void mips_reorg (void); +static bool mips_strict_matching_cpu_name_p (const char *, const char *); +static bool mips_matching_cpu_name_p (const char *, const char *); +static const struct mips_cpu_info *mips_parse_cpu (const char *); +static const struct mips_cpu_info *mips_cpu_info_from_isa (int); +static bool mips_return_in_memory (tree, tree); +static bool mips_strict_argument_naming (CUMULATIVE_ARGS *); +static void mips_macc_chains_record (rtx); +static void mips_macc_chains_reorder (rtx *, int); +static void vr4130_true_reg_dependence_p_1 (rtx, rtx, void *); +static bool vr4130_true_reg_dependence_p (rtx); +static bool vr4130_swap_insns_p (rtx, rtx); +static void vr4130_reorder (rtx *, int); +static void mips_promote_ready (rtx *, int, int); +static int mips_sched_reorder (FILE *, int, rtx *, int *, int); +static int mips_variable_issue (FILE *, int, rtx, int); +static int mips_adjust_cost (rtx, rtx, rtx, int); +static int mips_issue_rate (void); +static int mips_multipass_dfa_lookahead (void); +static void mips_init_libfuncs (void); +static void mips_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree, int *, int); +static tree mips_build_builtin_va_list (void); +static tree mips_gimplify_va_arg_expr (tree, tree, tree *, tree *); +static bool mips_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode mode, + tree, bool); +static bool mips_callee_copies (CUMULATIVE_ARGS *, enum machine_mode mode, + tree, bool); +static int mips_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode mode, + tree, bool); +static bool mips_valid_pointer_mode (enum machine_mode); +static bool mips_vector_mode_supported_p (enum machine_mode); +static rtx mips_prepare_builtin_arg (enum insn_code, unsigned int, tree *); +static rtx mips_prepare_builtin_target (enum insn_code, unsigned int, rtx); +static rtx mips_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static void mips_init_builtins (void); +static rtx mips_expand_builtin_direct (enum insn_code, rtx, tree, bool); +static rtx mips_expand_builtin_movtf (enum mips_builtin_type, + enum insn_code, enum mips_fp_condition, + rtx, tree); +static rtx mips_expand_builtin_compare (enum mips_builtin_type, + enum insn_code, enum mips_fp_condition, + rtx, tree); +static rtx mips_expand_builtin_bposge (enum mips_builtin_type, rtx); +static void mips_encode_section_info (tree, rtx, int); +static void mips_extra_live_on_entry (bitmap); +static int mips_mode_rep_extended (enum machine_mode, enum machine_mode); + +/* Structure to be filled in by compute_frame_size with register + save masks, and offsets for the current function. */ + +struct mips_frame_info GTY(()) +{ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* # bytes that variables take up */ + HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */ + HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */ + HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ + HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ + HOST_WIDE_INT gp_save_offset; /* offset from vfp to store gp registers */ + HOST_WIDE_INT fp_save_offset; /* offset from vfp to store fp registers */ + HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */ + HOST_WIDE_INT fp_sp_offset; /* offset from new sp to store fp registers */ + bool initialized; /* true if frame size already calculated */ + int num_gp; /* number of gp registers saved */ + int num_fp; /* number of fp registers saved */ +}; + +struct machine_function GTY(()) { + /* Pseudo-reg holding the value of $28 in a mips16 function which + refers to GP relative global variables. */ + rtx mips16_gp_pseudo_rtx; + + /* The number of extra stack bytes taken up by register varargs. + This area is allocated by the callee at the very top of the frame. */ + int varargs_size; + + /* Current frame information, calculated by compute_frame_size. */ + struct mips_frame_info frame; + + /* The register to use as the global pointer within this function. */ + unsigned int global_pointer; + + /* True if mips_adjust_insn_length should ignore an instruction's + hazard attribute. */ + bool ignore_hazard_length_p; + + /* True if the whole function is suitable for .set noreorder and + .set nomacro. */ + bool all_noreorder_p; + + /* True if the function is known to have an instruction that needs $gp. */ + bool has_gp_insn_p; +}; + +/* Information about a single argument. */ +struct mips_arg_info +{ + /* True if the argument is passed in a floating-point register, or + would have been if we hadn't run out of registers. */ + bool fpr_p; + + /* The number of words passed in registers, rounded up. */ + unsigned int reg_words; + + /* For EABI, the offset of the first register from GP_ARG_FIRST or + FP_ARG_FIRST. For other ABIs, the offset of the first register from + the start of the ABI's argument structure (see the CUMULATIVE_ARGS + comment for details). + + The value is MAX_ARGS_IN_REGISTERS if the argument is passed entirely + on the stack. */ + unsigned int reg_offset; + + /* The number of words that must be passed on the stack, rounded up. */ + unsigned int stack_words; + + /* The offset from the start of the stack overflow area of the argument's + first stack word. Only meaningful when STACK_WORDS is nonzero. */ + unsigned int stack_offset; +}; + + +/* Information about an address described by mips_address_type. + + ADDRESS_CONST_INT + No fields are used. + + ADDRESS_REG + REG is the base register and OFFSET is the constant offset. + + ADDRESS_LO_SUM + REG is the register that contains the high part of the address, + OFFSET is the symbolic address being referenced and SYMBOL_TYPE + is the type of OFFSET's symbol. + + ADDRESS_SYMBOLIC + SYMBOL_TYPE is the type of symbol being referenced. */ + +struct mips_address_info +{ + enum mips_address_type type; + rtx reg; + rtx offset; + enum mips_symbol_type symbol_type; +}; + + +/* One stage in a constant building sequence. These sequences have + the form: + + A = VALUE[0] + A = A CODE[1] VALUE[1] + A = A CODE[2] VALUE[2] + ... + + where A is an accumulator, each CODE[i] is a binary rtl operation + and each VALUE[i] is a constant integer. */ +struct mips_integer_op { + enum rtx_code code; + unsigned HOST_WIDE_INT value; +}; + + +/* The largest number of operations needed to load an integer constant. + The worst accepted case for 64-bit constants is LUI,ORI,SLL,ORI,SLL,ORI. + When the lowest bit is clear, we can try, but reject a sequence with + an extra SLL at the end. */ +#define MIPS_MAX_INTEGER_OPS 7 + + +/* Global variables for machine-dependent things. */ + +/* Threshold for data being put into the small data/bss area, instead + of the normal data area. */ +int mips_section_threshold = -1; + +/* Count the number of .file directives, so that .loc is up to date. */ +int num_source_filenames = 0; + +/* Count the number of sdb related labels are generated (to find block + start and end boundaries). */ +int sdb_label_count = 0; + +/* Next label # for each statement for Silicon Graphics IRIS systems. */ +int sym_lineno = 0; + +/* Linked list of all externals that are to be emitted when optimizing + for the global pointer if they haven't been declared by the end of + the program with an appropriate .comm or initialization. */ + +struct extern_list GTY (()) +{ + struct extern_list *next; /* next external */ + const char *name; /* name of the external */ + int size; /* size in bytes */ +}; + +static GTY (()) struct extern_list *extern_head = 0; + +/* Name of the file containing the current function. */ +const char *current_function_file = ""; + +/* Number of nested .set noreorder, noat, nomacro, and volatile requests. */ +int set_noreorder; +int set_noat; +int set_nomacro; +int set_volatile; + +/* The next branch instruction is a branch likely, not branch normal. */ +int mips_branch_likely; + +/* The operands passed to the last cmpMM expander. */ +rtx cmp_operands[2]; + +/* The target cpu for code generation. */ +enum processor_type mips_arch; +const struct mips_cpu_info *mips_arch_info; + +/* The target cpu for optimization and scheduling. */ +enum processor_type mips_tune; +const struct mips_cpu_info *mips_tune_info; + +/* Which instruction set architecture to use. */ +int mips_isa; + +/* Which ABI to use. */ +int mips_abi = MIPS_ABI_DEFAULT; + +/* Cost information to use. */ +const struct mips_rtx_cost_data *mips_cost; + +/* Whether we are generating mips16 hard float code. In mips16 mode + we always set TARGET_SOFT_FLOAT; this variable is nonzero if + -msoft-float was not specified by the user, which means that we + should arrange to call mips32 hard floating point code. */ +int mips16_hard_float; + +/* The architecture selected by -mipsN. */ +static const struct mips_cpu_info *mips_isa_info; + +/* If TRUE, we split addresses into their high and low parts in the RTL. */ +int mips_split_addresses; + +/* Mode used for saving/restoring general purpose registers. */ +static enum machine_mode gpr_mode; + +/* Array giving truth value on whether or not a given hard register + can support a given mode. */ +char mips_hard_regno_mode_ok[(int)MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER]; + +/* List of all MIPS punctuation characters used by print_operand. */ +char mips_print_operand_punct[256]; + +/* Map GCC register number to debugger register number. */ +int mips_dbx_regno[FIRST_PSEUDO_REGISTER]; + +/* A copy of the original flag_delayed_branch: see override_options. */ +static int mips_flag_delayed_branch; + +static GTY (()) int mips_output_filename_first_time = 1; + +/* mips_split_p[X] is true if symbols of type X can be split by + mips_split_symbol(). */ +bool mips_split_p[NUM_SYMBOL_TYPES]; + +/* mips_lo_relocs[X] is the relocation to use when a symbol of type X + appears in a LO_SUM. It can be null if such LO_SUMs aren't valid or + if they are matched by a special .md file pattern. */ +static const char *mips_lo_relocs[NUM_SYMBOL_TYPES]; + +/* Likewise for HIGHs. */ +static const char *mips_hi_relocs[NUM_SYMBOL_TYPES]; + +/* Map hard register number to register class */ +const enum reg_class mips_regno_to_class[] = +{ + LEA_REGS, LEA_REGS, M16_NA_REGS, V1_REG, + M16_REGS, M16_REGS, M16_REGS, M16_REGS, + LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS, + LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS, + M16_NA_REGS, M16_NA_REGS, LEA_REGS, LEA_REGS, + LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS, + T_REG, PIC_FN_ADDR_REG, LEA_REGS, LEA_REGS, + LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + HI_REG, LO_REG, NO_REGS, ST_REGS, + ST_REGS, ST_REGS, ST_REGS, ST_REGS, + ST_REGS, ST_REGS, ST_REGS, NO_REGS, + NO_REGS, ALL_REGS, ALL_REGS, NO_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP0_REGS, COP0_REGS, COP0_REGS, COP0_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP2_REGS, COP2_REGS, COP2_REGS, COP2_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + COP3_REGS, COP3_REGS, COP3_REGS, COP3_REGS, + DSP_ACC_REGS, DSP_ACC_REGS, DSP_ACC_REGS, DSP_ACC_REGS, + DSP_ACC_REGS, DSP_ACC_REGS, ALL_REGS, ALL_REGS, + ALL_REGS, ALL_REGS, ALL_REGS, ALL_REGS +}; + +/* Table of machine dependent attributes. */ +const struct attribute_spec mips_attribute_table[] = +{ + { "long_call", 0, 0, false, true, true, NULL }, + { NULL, 0, 0, false, false, false, NULL } +}; + +/* A table describing all the processors gcc knows about. Names are + matched in the order listed. The first mention of an ISA level is + taken as the canonical name for that ISA. + + To ease comparison, please keep this table in the same order as + gas's mips_cpu_info_table[]. */ +const struct mips_cpu_info mips_cpu_info_table[] = { + /* Entries for generic ISAs */ + { "mips1", PROCESSOR_R3000, 1 }, + { "mips2", PROCESSOR_R6000, 2 }, + { "mips3", PROCESSOR_R4000, 3 }, + { "mips4", PROCESSOR_R8000, 4 }, + { "mips32", PROCESSOR_4KC, 32 }, + { "mips32r2", PROCESSOR_M4K, 33 }, + { "mips64", PROCESSOR_5KC, 64 }, + + /* MIPS I */ + { "r3000", PROCESSOR_R3000, 1 }, + { "r2000", PROCESSOR_R3000, 1 }, /* = r3000 */ + { "r3900", PROCESSOR_R3900, 1 }, + + /* MIPS II */ + { "r6000", PROCESSOR_R6000, 2 }, + + /* MIPS III */ + { "r4000", PROCESSOR_R4000, 3 }, + { "vr4100", PROCESSOR_R4100, 3 }, + { "vr4111", PROCESSOR_R4111, 3 }, + { "vr4120", PROCESSOR_R4120, 3 }, + { "vr4130", PROCESSOR_R4130, 3 }, + { "vr4300", PROCESSOR_R4300, 3 }, + { "r4400", PROCESSOR_R4000, 3 }, /* = r4000 */ + { "r4600", PROCESSOR_R4600, 3 }, + { "orion", PROCESSOR_R4600, 3 }, /* = r4600 */ + { "r4650", PROCESSOR_R4650, 3 }, + + /* MIPS IV */ + { "r8000", PROCESSOR_R8000, 4 }, + { "vr5000", PROCESSOR_R5000, 4 }, + { "vr5400", PROCESSOR_R5400, 4 }, + { "vr5500", PROCESSOR_R5500, 4 }, + { "rm7000", PROCESSOR_R7000, 4 }, + { "rm9000", PROCESSOR_R9000, 4 }, + + /* MIPS32 */ + { "4kc", PROCESSOR_4KC, 32 }, + { "4km", PROCESSOR_4KC, 32 }, /* = 4kc */ + { "4kp", PROCESSOR_4KP, 32 }, + + /* MIPS32 Release 2 */ + { "m4k", PROCESSOR_M4K, 33 }, + { "24k", PROCESSOR_24K, 33 }, + { "24kc", PROCESSOR_24K, 33 }, /* 24K no FPU */ + { "24kf", PROCESSOR_24K, 33 }, /* 24K 1:2 FPU */ + { "24kx", PROCESSOR_24KX, 33 }, /* 24K 1:1 FPU */ + + /* MIPS64 */ + { "5kc", PROCESSOR_5KC, 64 }, + { "5kf", PROCESSOR_5KF, 64 }, + { "20kc", PROCESSOR_20KC, 64 }, + { "sb1", PROCESSOR_SB1, 64 }, + { "sb1a", PROCESSOR_SB1A, 64 }, + { "sr71000", PROCESSOR_SR71000, 64 }, + + /* End marker */ + { 0, 0, 0 } +}; + +/* Default costs. If these are used for a processor we should look + up the actual costs. */ +#define DEFAULT_COSTS COSTS_N_INSNS (6), /* fp_add */ \ + COSTS_N_INSNS (7), /* fp_mult_sf */ \ + COSTS_N_INSNS (8), /* fp_mult_df */ \ + COSTS_N_INSNS (23), /* fp_div_sf */ \ + COSTS_N_INSNS (36), /* fp_div_df */ \ + COSTS_N_INSNS (10), /* int_mult_si */ \ + COSTS_N_INSNS (10), /* int_mult_di */ \ + COSTS_N_INSNS (69), /* int_div_si */ \ + COSTS_N_INSNS (69), /* int_div_di */ \ + 2, /* branch_cost */ \ + 4 /* memory_latency */ + +/* Need to replace these with the costs of calling the appropriate + libgcc routine. */ +#define SOFT_FP_COSTS COSTS_N_INSNS (256), /* fp_add */ \ + COSTS_N_INSNS (256), /* fp_mult_sf */ \ + COSTS_N_INSNS (256), /* fp_mult_df */ \ + COSTS_N_INSNS (256), /* fp_div_sf */ \ + COSTS_N_INSNS (256) /* fp_div_df */ + +static struct mips_rtx_cost_data const mips_rtx_cost_data[PROCESSOR_MAX] = + { + { /* R3000 */ + COSTS_N_INSNS (2), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (5), /* fp_mult_df */ + COSTS_N_INSNS (12), /* fp_div_sf */ + COSTS_N_INSNS (19), /* fp_div_df */ + COSTS_N_INSNS (12), /* int_mult_si */ + COSTS_N_INSNS (12), /* int_mult_di */ + COSTS_N_INSNS (35), /* int_div_si */ + COSTS_N_INSNS (35), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + + }, + { /* 4KC */ + SOFT_FP_COSTS, + COSTS_N_INSNS (6), /* int_mult_si */ + COSTS_N_INSNS (6), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (36), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* 4KP */ + SOFT_FP_COSTS, + COSTS_N_INSNS (36), /* int_mult_si */ + COSTS_N_INSNS (36), /* int_mult_di */ + COSTS_N_INSNS (37), /* int_div_si */ + COSTS_N_INSNS (37), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* 5KC */ + SOFT_FP_COSTS, + COSTS_N_INSNS (4), /* int_mult_si */ + COSTS_N_INSNS (11), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (68), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* 5KF */ + COSTS_N_INSNS (4), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (5), /* fp_mult_df */ + COSTS_N_INSNS (17), /* fp_div_sf */ + COSTS_N_INSNS (32), /* fp_div_df */ + COSTS_N_INSNS (4), /* int_mult_si */ + COSTS_N_INSNS (11), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (68), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* 20KC */ + DEFAULT_COSTS + }, + { /* 24k */ + COSTS_N_INSNS (8), /* fp_add */ + COSTS_N_INSNS (8), /* fp_mult_sf */ + COSTS_N_INSNS (10), /* fp_mult_df */ + COSTS_N_INSNS (34), /* fp_div_sf */ + COSTS_N_INSNS (64), /* fp_div_df */ + COSTS_N_INSNS (5), /* int_mult_si */ + COSTS_N_INSNS (5), /* int_mult_di */ + COSTS_N_INSNS (41), /* int_div_si */ + COSTS_N_INSNS (41), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* 24kx */ + COSTS_N_INSNS (4), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (5), /* fp_mult_df */ + COSTS_N_INSNS (17), /* fp_div_sf */ + COSTS_N_INSNS (32), /* fp_div_df */ + COSTS_N_INSNS (5), /* int_mult_si */ + COSTS_N_INSNS (5), /* int_mult_di */ + COSTS_N_INSNS (41), /* int_div_si */ + COSTS_N_INSNS (41), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* M4k */ + DEFAULT_COSTS + }, + { /* R3900 */ + COSTS_N_INSNS (2), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (5), /* fp_mult_df */ + COSTS_N_INSNS (12), /* fp_div_sf */ + COSTS_N_INSNS (19), /* fp_div_df */ + COSTS_N_INSNS (2), /* int_mult_si */ + COSTS_N_INSNS (2), /* int_mult_di */ + COSTS_N_INSNS (35), /* int_div_si */ + COSTS_N_INSNS (35), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R6000 */ + COSTS_N_INSNS (3), /* fp_add */ + COSTS_N_INSNS (5), /* fp_mult_sf */ + COSTS_N_INSNS (6), /* fp_mult_df */ + COSTS_N_INSNS (15), /* fp_div_sf */ + COSTS_N_INSNS (16), /* fp_div_df */ + COSTS_N_INSNS (17), /* int_mult_si */ + COSTS_N_INSNS (17), /* int_mult_di */ + COSTS_N_INSNS (38), /* int_div_si */ + COSTS_N_INSNS (38), /* int_div_di */ + 2, /* branch_cost */ + 6 /* memory_latency */ + }, + { /* R4000 */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (7), /* fp_mult_sf */ + COSTS_N_INSNS (8), /* fp_mult_df */ + COSTS_N_INSNS (23), /* fp_div_sf */ + COSTS_N_INSNS (36), /* fp_div_df */ + COSTS_N_INSNS (10), /* int_mult_si */ + COSTS_N_INSNS (10), /* int_mult_di */ + COSTS_N_INSNS (69), /* int_div_si */ + COSTS_N_INSNS (69), /* int_div_di */ + 2, /* branch_cost */ + 6 /* memory_latency */ + }, + { /* R4100 */ + DEFAULT_COSTS + }, + { /* R4111 */ + DEFAULT_COSTS + }, + { /* R4120 */ + DEFAULT_COSTS + }, + { /* R4130 */ + /* The only costs that appear to be updated here are + integer multiplication. */ + SOFT_FP_COSTS, + COSTS_N_INSNS (4), /* int_mult_si */ + COSTS_N_INSNS (6), /* int_mult_di */ + COSTS_N_INSNS (69), /* int_div_si */ + COSTS_N_INSNS (69), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R4300 */ + DEFAULT_COSTS + }, + { /* R4600 */ + DEFAULT_COSTS + }, + { /* R4650 */ + DEFAULT_COSTS + }, + { /* R5000 */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (5), /* fp_mult_df */ + COSTS_N_INSNS (23), /* fp_div_sf */ + COSTS_N_INSNS (36), /* fp_div_df */ + COSTS_N_INSNS (5), /* int_mult_si */ + COSTS_N_INSNS (5), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (36), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R5400 */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (5), /* fp_mult_sf */ + COSTS_N_INSNS (6), /* fp_mult_df */ + COSTS_N_INSNS (30), /* fp_div_sf */ + COSTS_N_INSNS (59), /* fp_div_df */ + COSTS_N_INSNS (3), /* int_mult_si */ + COSTS_N_INSNS (4), /* int_mult_di */ + COSTS_N_INSNS (42), /* int_div_si */ + COSTS_N_INSNS (74), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R5500 */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (5), /* fp_mult_sf */ + COSTS_N_INSNS (6), /* fp_mult_df */ + COSTS_N_INSNS (30), /* fp_div_sf */ + COSTS_N_INSNS (59), /* fp_div_df */ + COSTS_N_INSNS (5), /* int_mult_si */ + COSTS_N_INSNS (9), /* int_mult_di */ + COSTS_N_INSNS (42), /* int_div_si */ + COSTS_N_INSNS (74), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R7000 */ + /* The only costs that are changed here are + integer multiplication. */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (7), /* fp_mult_sf */ + COSTS_N_INSNS (8), /* fp_mult_df */ + COSTS_N_INSNS (23), /* fp_div_sf */ + COSTS_N_INSNS (36), /* fp_div_df */ + COSTS_N_INSNS (5), /* int_mult_si */ + COSTS_N_INSNS (9), /* int_mult_di */ + COSTS_N_INSNS (69), /* int_div_si */ + COSTS_N_INSNS (69), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* R8000 */ + DEFAULT_COSTS + }, + { /* R9000 */ + /* The only costs that are changed here are + integer multiplication. */ + COSTS_N_INSNS (6), /* fp_add */ + COSTS_N_INSNS (7), /* fp_mult_sf */ + COSTS_N_INSNS (8), /* fp_mult_df */ + COSTS_N_INSNS (23), /* fp_div_sf */ + COSTS_N_INSNS (36), /* fp_div_df */ + COSTS_N_INSNS (3), /* int_mult_si */ + COSTS_N_INSNS (8), /* int_mult_di */ + COSTS_N_INSNS (69), /* int_div_si */ + COSTS_N_INSNS (69), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* SB1 */ + /* These costs are the same as the SB-1A below. */ + COSTS_N_INSNS (4), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (4), /* fp_mult_df */ + COSTS_N_INSNS (24), /* fp_div_sf */ + COSTS_N_INSNS (32), /* fp_div_df */ + COSTS_N_INSNS (3), /* int_mult_si */ + COSTS_N_INSNS (4), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (68), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* SB1-A */ + /* These costs are the same as the SB-1 above. */ + COSTS_N_INSNS (4), /* fp_add */ + COSTS_N_INSNS (4), /* fp_mult_sf */ + COSTS_N_INSNS (4), /* fp_mult_df */ + COSTS_N_INSNS (24), /* fp_div_sf */ + COSTS_N_INSNS (32), /* fp_div_df */ + COSTS_N_INSNS (3), /* int_mult_si */ + COSTS_N_INSNS (4), /* int_mult_di */ + COSTS_N_INSNS (36), /* int_div_si */ + COSTS_N_INSNS (68), /* int_div_di */ + 1, /* branch_cost */ + 4 /* memory_latency */ + }, + { /* SR71000 */ + DEFAULT_COSTS + }, + }; + + +/* Nonzero if -march should decide the default value of MASK_SOFT_FLOAT. */ +#ifndef MIPS_MARCH_CONTROLS_SOFT_FLOAT +#define MIPS_MARCH_CONTROLS_SOFT_FLOAT 0 +#endif + +/* Initialize the GCC target structure. */ +#undef TARGET_ASM_ALIGNED_HI_OP +#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t" +#undef TARGET_ASM_ALIGNED_SI_OP +#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t" +#undef TARGET_ASM_ALIGNED_DI_OP +#define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t" + +#undef TARGET_ASM_FUNCTION_PROLOGUE +#define TARGET_ASM_FUNCTION_PROLOGUE mips_output_function_prologue +#undef TARGET_ASM_FUNCTION_EPILOGUE +#define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue +#undef TARGET_ASM_SELECT_RTX_SECTION +#define TARGET_ASM_SELECT_RTX_SECTION mips_select_rtx_section +#undef TARGET_ASM_FUNCTION_RODATA_SECTION +#define TARGET_ASM_FUNCTION_RODATA_SECTION mips_function_rodata_section + +#undef TARGET_SCHED_REORDER +#define TARGET_SCHED_REORDER mips_sched_reorder +#undef TARGET_SCHED_VARIABLE_ISSUE +#define TARGET_SCHED_VARIABLE_ISSUE mips_variable_issue +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST mips_adjust_cost +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE mips_issue_rate +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \ + mips_multipass_dfa_lookahead + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (TARGET_DEFAULT \ + | TARGET_CPU_DEFAULT \ + | TARGET_ENDIAN_DEFAULT \ + | TARGET_FP_EXCEPTIONS_DEFAULT \ + | MASK_CHECK_ZERO_DIV \ + | MASK_FUSED_MADD) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION mips_handle_option + +#undef TARGET_FUNCTION_OK_FOR_SIBCALL +#define TARGET_FUNCTION_OK_FOR_SIBCALL mips_function_ok_for_sibcall + +#undef TARGET_VALID_POINTER_MODE +#define TARGET_VALID_POINTER_MODE mips_valid_pointer_mode +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS mips_rtx_costs +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST mips_address_cost + +#undef TARGET_IN_SMALL_DATA_P +#define TARGET_IN_SMALL_DATA_P mips_in_small_data_p + +#undef TARGET_MACHINE_DEPENDENT_REORG +#define TARGET_MACHINE_DEPENDENT_REORG mips_reorg + +#undef TARGET_ASM_FILE_START +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_START mips_file_start +#define TARGET_ASM_FILE_END mips_file_end +#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE +#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true + +#undef TARGET_INIT_LIBFUNCS +#define TARGET_INIT_LIBFUNCS mips_init_libfuncs + +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST mips_build_builtin_va_list +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR mips_gimplify_va_arg_expr + +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true + +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY mips_return_in_memory +#undef TARGET_RETURN_IN_MSB +#define TARGET_RETURN_IN_MSB mips_return_in_msb + +#undef TARGET_ASM_OUTPUT_MI_THUNK +#define TARGET_ASM_OUTPUT_MI_THUNK mips_output_mi_thunk +#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true + +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS mips_setup_incoming_varargs +#undef TARGET_STRICT_ARGUMENT_NAMING +#define TARGET_STRICT_ARGUMENT_NAMING mips_strict_argument_naming +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE mips_pass_by_reference +#undef TARGET_CALLEE_COPIES +#define TARGET_CALLEE_COPIES mips_callee_copies +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES mips_arg_partial_bytes + +#undef TARGET_MODE_REP_EXTENDED +#define TARGET_MODE_REP_EXTENDED mips_mode_rep_extended + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P mips_vector_mode_supported_p + +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS mips_init_builtins +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN mips_expand_builtin + +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS HAVE_AS_TLS + +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM mips_cannot_force_const_mem + +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info + +#undef TARGET_ATTRIBUTE_TABLE +#define TARGET_ATTRIBUTE_TABLE mips_attribute_table + +#undef TARGET_EXTRA_LIVE_ON_ENTRY +#define TARGET_EXTRA_LIVE_ON_ENTRY mips_extra_live_on_entry + +#undef TARGET_MIN_ANCHOR_OFFSET +#define TARGET_MIN_ANCHOR_OFFSET -32768 +#undef TARGET_MAX_ANCHOR_OFFSET +#define TARGET_MAX_ANCHOR_OFFSET 32767 +#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P +#define TARGET_USE_BLOCKS_FOR_CONSTANT_P mips_use_blocks_for_constant_p +#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P +#define TARGET_USE_ANCHORS_FOR_SYMBOL_P mips_use_anchors_for_symbol_p + +struct gcc_target targetm = TARGET_INITIALIZER; + +/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */ + +static enum mips_symbol_type +mips_classify_symbol (rtx x) +{ + if (GET_CODE (x) == LABEL_REF) + { + if (TARGET_MIPS16) + return SYMBOL_CONSTANT_POOL; + if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS) + return SYMBOL_GOT_LOCAL; + return SYMBOL_GENERAL; + } + + gcc_assert (GET_CODE (x) == SYMBOL_REF); + + if (SYMBOL_REF_TLS_MODEL (x)) + return SYMBOL_TLS; + + if (CONSTANT_POOL_ADDRESS_P (x)) + { + if (TARGET_MIPS16) + return SYMBOL_CONSTANT_POOL; + + if (GET_MODE_SIZE (get_pool_mode (x)) <= mips_section_threshold) + return SYMBOL_SMALL_DATA; + } + + /* Do not use small-data accesses for weak symbols; they may end up + being zero. */ + if (SYMBOL_REF_SMALL_P (x) + && !SYMBOL_REF_WEAK (x)) + return SYMBOL_SMALL_DATA; + + if (TARGET_ABICALLS) + { + if (SYMBOL_REF_DECL (x) == 0) + { + if (!SYMBOL_REF_LOCAL_P (x)) + return SYMBOL_GOT_GLOBAL; + } + else + { + /* Don't use GOT accesses for locally-binding symbols if + TARGET_ABSOLUTE_ABICALLS. Otherwise, there are three + cases to consider: + + - o32 PIC (either with or without explicit relocs) + - n32/n64 PIC without explicit relocs + - n32/n64 PIC with explicit relocs + + In the first case, both local and global accesses will use an + R_MIPS_GOT16 relocation. We must correctly predict which of + the two semantics (local or global) the assembler and linker + will apply. The choice doesn't depend on the symbol's + visibility, so we deliberately ignore decl_visibility and + binds_local_p here. + + In the second case, the assembler will not use R_MIPS_GOT16 + relocations, but it chooses between local and global accesses + in the same way as for o32 PIC. + + In the third case we have more freedom since both forms of + access will work for any kind of symbol. However, there seems + little point in doing things differently. */ + if (DECL_P (SYMBOL_REF_DECL (x)) + && TREE_PUBLIC (SYMBOL_REF_DECL (x)) + && !(TARGET_ABSOLUTE_ABICALLS + && targetm.binds_local_p (SYMBOL_REF_DECL (x)))) + return SYMBOL_GOT_GLOBAL; + } + + if (!TARGET_ABSOLUTE_ABICALLS) + return SYMBOL_GOT_LOCAL; + } + + return SYMBOL_GENERAL; +} + + +/* Split X into a base and a constant offset, storing them in *BASE + and *OFFSET respectively. */ + +static void +mips_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset) +{ + *offset = 0; + + if (GET_CODE (x) == CONST) + { + x = XEXP (x, 0); + if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + *offset += INTVAL (XEXP (x, 1)); + x = XEXP (x, 0); + } + } + *base = x; +} + + +/* Return true if SYMBOL is a SYMBOL_REF and OFFSET + SYMBOL points + to the same object as SYMBOL, or to the same object_block. */ + +static bool +mips_offset_within_object_p (rtx symbol, HOST_WIDE_INT offset) +{ + if (GET_CODE (symbol) != SYMBOL_REF) + return false; + + if (CONSTANT_POOL_ADDRESS_P (symbol) + && offset >= 0 + && offset < (int) GET_MODE_SIZE (get_pool_mode (symbol))) + return true; + + if (SYMBOL_REF_DECL (symbol) != 0 + && offset >= 0 + && offset < int_size_in_bytes (TREE_TYPE (SYMBOL_REF_DECL (symbol)))) + return true; + + if (SYMBOL_REF_HAS_BLOCK_INFO_P (symbol) + && SYMBOL_REF_BLOCK (symbol) + && SYMBOL_REF_BLOCK_OFFSET (symbol) >= 0 + && ((unsigned HOST_WIDE_INT) offset + SYMBOL_REF_BLOCK_OFFSET (symbol) + < (unsigned HOST_WIDE_INT) SYMBOL_REF_BLOCK (symbol)->size)) + return true; + + return false; +} + + +/* Return true if X is a symbolic constant that can be calculated in + the same way as a bare symbol. If it is, store the type of the + symbol in *SYMBOL_TYPE. */ + +bool +mips_symbolic_constant_p (rtx x, enum mips_symbol_type *symbol_type) +{ + HOST_WIDE_INT offset; + + mips_split_const (x, &x, &offset); + if (UNSPEC_ADDRESS_P (x)) + *symbol_type = UNSPEC_ADDRESS_TYPE (x); + else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) + { + *symbol_type = mips_classify_symbol (x); + if (*symbol_type == SYMBOL_TLS) + return false; + } + else + return false; + + if (offset == 0) + return true; + + /* Check whether a nonzero offset is valid for the underlying + relocations. */ + switch (*symbol_type) + { + case SYMBOL_GENERAL: + case SYMBOL_64_HIGH: + case SYMBOL_64_MID: + case SYMBOL_64_LOW: + /* If the target has 64-bit pointers and the object file only + supports 32-bit symbols, the values of those symbols will be + sign-extended. In this case we can't allow an arbitrary offset + in case the 32-bit value X + OFFSET has a different sign from X. */ + if (Pmode == DImode && !ABI_HAS_64BIT_SYMBOLS) + return mips_offset_within_object_p (x, offset); + + /* In other cases the relocations can handle any offset. */ + return true; + + case SYMBOL_CONSTANT_POOL: + /* Allow constant pool references to be converted to LABEL+CONSTANT. + In this case, we no longer have access to the underlying constant, + but the original symbol-based access was known to be valid. */ + if (GET_CODE (x) == LABEL_REF) + return true; + + /* Fall through. */ + + case SYMBOL_SMALL_DATA: + /* Make sure that the offset refers to something within the + underlying object. This should guarantee that the final + PC- or GP-relative offset is within the 16-bit limit. */ + return mips_offset_within_object_p (x, offset); + + case SYMBOL_GOT_LOCAL: + case SYMBOL_GOTOFF_PAGE: + /* The linker should provide enough local GOT entries for a + 16-bit offset. Larger offsets may lead to GOT overflow. */ + return SMALL_OPERAND (offset); + + case SYMBOL_GOT_GLOBAL: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + case SYMBOL_TLSGD: + case SYMBOL_TLSLDM: + case SYMBOL_DTPREL: + case SYMBOL_TPREL: + case SYMBOL_GOTTPREL: + case SYMBOL_TLS: + return false; + } + gcc_unreachable (); +} + + +/* This function is used to implement REG_MODE_OK_FOR_BASE_P. */ + +int +mips_regno_mode_ok_for_base_p (int regno, enum machine_mode mode, int strict) +{ + if (regno >= FIRST_PSEUDO_REGISTER) + { + if (!strict) + return true; + regno = reg_renumber[regno]; + } + + /* These fake registers will be eliminated to either the stack or + hard frame pointer, both of which are usually valid base registers. + Reload deals with the cases where the eliminated form isn't valid. */ + if (regno == ARG_POINTER_REGNUM || regno == FRAME_POINTER_REGNUM) + return true; + + /* In mips16 mode, the stack pointer can only address word and doubleword + values, nothing smaller. There are two problems here: + + (a) Instantiating virtual registers can introduce new uses of the + stack pointer. If these virtual registers are valid addresses, + the stack pointer should be too. + + (b) Most uses of the stack pointer are not made explicit until + FRAME_POINTER_REGNUM and ARG_POINTER_REGNUM have been eliminated. + We don't know until that stage whether we'll be eliminating to the + stack pointer (which needs the restriction) or the hard frame + pointer (which doesn't). + + All in all, it seems more consistent to only enforce this restriction + during and after reload. */ + if (TARGET_MIPS16 && regno == STACK_POINTER_REGNUM) + return !strict || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; + + return TARGET_MIPS16 ? M16_REG_P (regno) : GP_REG_P (regno); +} + + +/* Return true if X is a valid base register for the given mode. + Allow only hard registers if STRICT. */ + +static bool +mips_valid_base_register_p (rtx x, enum machine_mode mode, int strict) +{ + if (!strict && GET_CODE (x) == SUBREG) + x = SUBREG_REG (x); + + return (REG_P (x) + && mips_regno_mode_ok_for_base_p (REGNO (x), mode, strict)); +} + + +/* Return true if symbols of type SYMBOL_TYPE can directly address a value + with mode MODE. This is used for both symbolic and LO_SUM addresses. */ + +static bool +mips_symbolic_address_p (enum mips_symbol_type symbol_type, + enum machine_mode mode) +{ + switch (symbol_type) + { + case SYMBOL_GENERAL: + return !TARGET_MIPS16; + + case SYMBOL_SMALL_DATA: + return true; + + case SYMBOL_CONSTANT_POOL: + /* PC-relative addressing is only available for lw and ld. */ + return GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8; + + case SYMBOL_GOT_LOCAL: + return true; + + case SYMBOL_GOT_GLOBAL: + /* The address will have to be loaded from the GOT first. */ + return false; + + case SYMBOL_GOTOFF_PAGE: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + case SYMBOL_TLS: + case SYMBOL_TLSGD: + case SYMBOL_TLSLDM: + case SYMBOL_DTPREL: + case SYMBOL_GOTTPREL: + case SYMBOL_TPREL: + case SYMBOL_64_HIGH: + case SYMBOL_64_MID: + case SYMBOL_64_LOW: + return true; + } + gcc_unreachable (); +} + + +/* Return true if X is a valid address for machine mode MODE. If it is, + fill in INFO appropriately. STRICT is true if we should only accept + hard base registers. */ + +static bool +mips_classify_address (struct mips_address_info *info, rtx x, + enum machine_mode mode, int strict) +{ + switch (GET_CODE (x)) + { + case REG: + case SUBREG: + info->type = ADDRESS_REG; + info->reg = x; + info->offset = const0_rtx; + return mips_valid_base_register_p (info->reg, mode, strict); + + case PLUS: + info->type = ADDRESS_REG; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (mips_valid_base_register_p (info->reg, mode, strict) + && const_arith_operand (info->offset, VOIDmode)); + + case LO_SUM: + info->type = ADDRESS_LO_SUM; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (mips_valid_base_register_p (info->reg, mode, strict) + && mips_symbolic_constant_p (info->offset, &info->symbol_type) + && mips_symbolic_address_p (info->symbol_type, mode) + && mips_lo_relocs[info->symbol_type] != 0); + + case CONST_INT: + /* Small-integer addresses don't occur very often, but they + are legitimate if $0 is a valid base register. */ + info->type = ADDRESS_CONST_INT; + return !TARGET_MIPS16 && SMALL_INT (x); + + case CONST: + case LABEL_REF: + case SYMBOL_REF: + info->type = ADDRESS_SYMBOLIC; + return (mips_symbolic_constant_p (x, &info->symbol_type) + && mips_symbolic_address_p (info->symbol_type, mode) + && !mips_split_p[info->symbol_type]); + + default: + return false; + } +} + +/* Return true if X is a thread-local symbol. */ + +static bool +mips_tls_operand_p (rtx x) +{ + return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0; +} + +/* Return true if X can not be forced into a constant pool. */ + +static int +mips_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) +{ + return mips_tls_operand_p (*x); +} + +/* Return true if X can not be forced into a constant pool. */ + +static bool +mips_cannot_force_const_mem (rtx x) +{ + rtx base; + HOST_WIDE_INT offset; + + if (!TARGET_MIPS16) + { + /* As an optimization, reject constants that mips_legitimize_move + can expand inline. + + Suppose we have a multi-instruction sequence that loads constant C + into register R. If R does not get allocated a hard register, and + R is used in an operand that allows both registers and memory + references, reload will consider forcing C into memory and using + one of the instruction's memory alternatives. Returning false + here will force it to use an input reload instead. */ + if (GET_CODE (x) == CONST_INT) + return true; + + mips_split_const (x, &base, &offset); + if (symbolic_operand (base, VOIDmode) && SMALL_OPERAND (offset)) + return true; + } + + if (TARGET_HAVE_TLS && for_each_rtx (&x, &mips_tls_symbol_ref_1, 0)) + return true; + + return false; +} + +/* Implement TARGET_USE_BLOCKS_FOR_CONSTANT_P. MIPS16 uses per-function + constant pools, but normal-mode code doesn't need to. */ + +static bool +mips_use_blocks_for_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x ATTRIBUTE_UNUSED) +{ + return !TARGET_MIPS16; +} + +/* Return the number of instructions needed to load a symbol of the + given type into a register. If valid in an address, the same number + of instructions are needed for loads and stores. Treat extended + mips16 instructions as two instructions. */ + +static int +mips_symbol_insns (enum mips_symbol_type type) +{ + switch (type) + { + case SYMBOL_GENERAL: + /* In mips16 code, general symbols must be fetched from the + constant pool. */ + if (TARGET_MIPS16) + return 0; + + /* When using 64-bit symbols, we need 5 preparatory instructions, + such as: + + lui $at,%highest(symbol) + daddiu $at,$at,%higher(symbol) + dsll $at,$at,16 + daddiu $at,$at,%hi(symbol) + dsll $at,$at,16 + + The final address is then $at + %lo(symbol). With 32-bit + symbols we just need a preparatory lui. */ + return (ABI_HAS_64BIT_SYMBOLS ? 6 : 2); + + case SYMBOL_SMALL_DATA: + return 1; + + case SYMBOL_CONSTANT_POOL: + /* This case is for mips16 only. Assume we'll need an + extended instruction. */ + return 2; + + case SYMBOL_GOT_LOCAL: + case SYMBOL_GOT_GLOBAL: + /* Unless -funit-at-a-time is in effect, we can't be sure whether + the local/global classification is accurate. See override_options + for details. + + The worst cases are: + + (1) For local symbols when generating o32 or o64 code. The assembler + will use: + + lw $at,%got(symbol) + nop + + ...and the final address will be $at + %lo(symbol). + + (2) For global symbols when -mxgot. The assembler will use: + + lui $at,%got_hi(symbol) + (d)addu $at,$at,$gp + + ...and the final address will be $at + %got_lo(symbol). */ + return 3; + + case SYMBOL_GOTOFF_PAGE: + case SYMBOL_GOTOFF_GLOBAL: + case SYMBOL_GOTOFF_CALL: + case SYMBOL_GOTOFF_LOADGP: + case SYMBOL_64_HIGH: + case SYMBOL_64_MID: + case SYMBOL_64_LOW: + case SYMBOL_TLSGD: + case SYMBOL_TLSLDM: + case SYMBOL_DTPREL: + case SYMBOL_GOTTPREL: + case SYMBOL_TPREL: + /* Check whether the offset is a 16- or 32-bit value. */ + return mips_split_p[type] ? 2 : 1; + + case SYMBOL_TLS: + /* We don't treat a bare TLS symbol as a constant. */ + return 0; + } + gcc_unreachable (); +} + +/* Return true if X is a legitimate $sp-based address for mode MDOE. */ + +bool +mips_stack_address_p (rtx x, enum machine_mode mode) +{ + struct mips_address_info addr; + + return (mips_classify_address (&addr, x, mode, false) + && addr.type == ADDRESS_REG + && addr.reg == stack_pointer_rtx); +} + +/* Return true if a value at OFFSET bytes from BASE can be accessed + using an unextended mips16 instruction. MODE is the mode of the + value. + + Usually the offset in an unextended instruction is a 5-bit field. + The offset is unsigned and shifted left once for HIs, twice + for SIs, and so on. An exception is SImode accesses off the + stack pointer, which have an 8-bit immediate field. */ + +static bool +mips16_unextended_reference_p (enum machine_mode mode, rtx base, rtx offset) +{ + if (TARGET_MIPS16 + && GET_CODE (offset) == CONST_INT + && INTVAL (offset) >= 0 + && (INTVAL (offset) & (GET_MODE_SIZE (mode) - 1)) == 0) + { + if (GET_MODE_SIZE (mode) == 4 && base == stack_pointer_rtx) + return INTVAL (offset) < 256 * GET_MODE_SIZE (mode); + return INTVAL (offset) < 32 * GET_MODE_SIZE (mode); + } + return false; +} + + +/* Return the number of instructions needed to load or store a value + of mode MODE at X. Return 0 if X isn't valid for MODE. + + For mips16 code, count extended instructions as two instructions. */ + +int +mips_address_insns (rtx x, enum machine_mode mode) +{ + struct mips_address_info addr; + int factor; + + if (mode == BLKmode) + /* BLKmode is used for single unaligned loads and stores. */ + factor = 1; + else + /* Each word of a multi-word value will be accessed individually. */ + factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + if (mips_classify_address (&addr, x, mode, false)) + switch (addr.type) + { + case ADDRESS_REG: + if (TARGET_MIPS16 + && !mips16_unextended_reference_p (mode, addr.reg, addr.offset)) + return factor * 2; + return factor; + + case ADDRESS_LO_SUM: + return (TARGET_MIPS16 ? factor * 2 : factor); + + case ADDRESS_CONST_INT: + return factor; + + case ADDRESS_SYMBOLIC: + return factor * mips_symbol_insns (addr.symbol_type); + } + return 0; +} + + +/* Likewise for constant X. */ + +int +mips_const_insns (rtx x) +{ + struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS]; + enum mips_symbol_type symbol_type; + HOST_WIDE_INT offset; + + switch (GET_CODE (x)) + { + case HIGH: + if (TARGET_MIPS16 + || !mips_symbolic_constant_p (XEXP (x, 0), &symbol_type) + || !mips_split_p[symbol_type]) + return 0; + + return 1; + + case CONST_INT: + if (TARGET_MIPS16) + /* Unsigned 8-bit constants can be loaded using an unextended + LI instruction. Unsigned 16-bit constants can be loaded + using an extended LI. Negative constants must be loaded + using LI and then negated. */ + return (INTVAL (x) >= 0 && INTVAL (x) < 256 ? 1 + : SMALL_OPERAND_UNSIGNED (INTVAL (x)) ? 2 + : INTVAL (x) > -256 && INTVAL (x) < 0 ? 2 + : SMALL_OPERAND_UNSIGNED (-INTVAL (x)) ? 3 + : 0); + + return mips_build_integer (codes, INTVAL (x)); + + case CONST_DOUBLE: + case CONST_VECTOR: + return (!TARGET_MIPS16 && x == CONST0_RTX (GET_MODE (x)) ? 1 : 0); + + case CONST: + if (CONST_GP_P (x)) + return 1; + + /* See if we can refer to X directly. */ + if (mips_symbolic_constant_p (x, &symbol_type)) + return mips_symbol_insns (symbol_type); + + /* Otherwise try splitting the constant into a base and offset. + 16-bit offsets can be added using an extra addiu. Larger offsets + must be calculated separately and then added to the base. */ + mips_split_const (x, &x, &offset); + if (offset != 0) + { + int n = mips_const_insns (x); + if (n != 0) + { + if (SMALL_OPERAND (offset)) + return n + 1; + else + return n + 1 + mips_build_integer (codes, offset); + } + } + return 0; + + case SYMBOL_REF: + case LABEL_REF: + return mips_symbol_insns (mips_classify_symbol (x)); + + default: + return 0; + } +} + + +/* Return the number of instructions needed for memory reference X. + Count extended mips16 instructions as two instructions. */ + +int +mips_fetch_insns (rtx x) +{ + gcc_assert (MEM_P (x)); + return mips_address_insns (XEXP (x, 0), GET_MODE (x)); +} + + +/* Return the number of instructions needed for an integer division. */ + +int +mips_idiv_insns (void) +{ + int count; + + count = 1; + if (TARGET_CHECK_ZERO_DIV) + { + if (GENERATE_DIVIDE_TRAPS) + count++; + else + count += 2; + } + + if (TARGET_FIX_R4000 || TARGET_FIX_R4400) + count++; + return count; +} + +/* This function is used to implement GO_IF_LEGITIMATE_ADDRESS. It + returns a nonzero value if X is a legitimate address for a memory + operand of the indicated MODE. STRICT is nonzero if this function + is called during reload. */ + +bool +mips_legitimate_address_p (enum machine_mode mode, rtx x, int strict) +{ + struct mips_address_info addr; + + return mips_classify_address (&addr, x, mode, strict); +} + + +/* Copy VALUE to a register and return that register. If new psuedos + are allowed, copy it into a new register, otherwise use DEST. */ + +static rtx +mips_force_temporary (rtx dest, rtx value) +{ + if (!no_new_pseudos) + return force_reg (Pmode, value); + else + { + emit_move_insn (copy_rtx (dest), value); + return dest; + } +} + + +/* Return a LO_SUM expression for ADDR. TEMP is as for mips_force_temporary + and is used to load the high part into a register. */ + +rtx +mips_split_symbol (rtx temp, rtx addr) +{ + rtx high; + + if (TARGET_MIPS16) + high = mips16_gp_pseudo_reg (); + else + high = mips_force_temporary (temp, gen_rtx_HIGH (Pmode, copy_rtx (addr))); + return gen_rtx_LO_SUM (Pmode, high, addr); +} + + +/* Return an UNSPEC address with underlying address ADDRESS and symbol + type SYMBOL_TYPE. */ + +rtx +mips_unspec_address (rtx address, enum mips_symbol_type symbol_type) +{ + rtx base; + HOST_WIDE_INT offset; + + mips_split_const (address, &base, &offset); + base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), + UNSPEC_ADDRESS_FIRST + symbol_type); + return plus_constant (gen_rtx_CONST (Pmode, base), offset); +} + + +/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the + high part to BASE and return the result. Just return BASE otherwise. + TEMP is available as a temporary register if needed. + + The returned expression can be used as the first operand to a LO_SUM. */ + +static rtx +mips_unspec_offset_high (rtx temp, rtx base, rtx addr, + enum mips_symbol_type symbol_type) +{ + if (mips_split_p[symbol_type]) + { + addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type)); + addr = mips_force_temporary (temp, addr); + return mips_force_temporary (temp, gen_rtx_PLUS (Pmode, addr, base)); + } + return base; +} + + +/* Return a legitimate address for REG + OFFSET. TEMP is as for + mips_force_temporary; it is only needed when OFFSET is not a + SMALL_OPERAND. */ + +static rtx +mips_add_offset (rtx temp, rtx reg, HOST_WIDE_INT offset) +{ + if (!SMALL_OPERAND (offset)) + { + rtx high; + if (TARGET_MIPS16) + { + /* Load the full offset into a register so that we can use + an unextended instruction for the address itself. */ + high = GEN_INT (offset); + offset = 0; + } + else + { + /* Leave OFFSET as a 16-bit offset and put the excess in HIGH. */ + high = GEN_INT (CONST_HIGH_PART (offset)); + offset = CONST_LOW_PART (offset); + } + high = mips_force_temporary (temp, high); + reg = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg)); + } + return plus_constant (reg, offset); +} + +/* Emit a call to __tls_get_addr. SYM is the TLS symbol we are + referencing, and TYPE is the symbol type to use (either global + dynamic or local dynamic). V0 is an RTX for the return value + location. The entire insn sequence is returned. */ + +static GTY(()) rtx mips_tls_symbol; + +static rtx +mips_call_tls_get_addr (rtx sym, enum mips_symbol_type type, rtx v0) +{ + rtx insn, loc, tga, a0; + + a0 = gen_rtx_REG (Pmode, GP_ARG_FIRST); + + if (!mips_tls_symbol) + mips_tls_symbol = init_one_libfunc ("__tls_get_addr"); + + loc = mips_unspec_address (sym, type); + + start_sequence (); + + emit_insn (gen_rtx_SET (Pmode, a0, + gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, loc))); + tga = gen_rtx_MEM (Pmode, mips_tls_symbol); + insn = emit_call_insn (gen_call_value (v0, tga, const0_rtx, const0_rtx)); + CONST_OR_PURE_CALL_P (insn) = 1; + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), v0); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0); + insn = get_insns (); + + end_sequence (); + + return insn; +} + +/* Generate the code to access LOC, a thread local SYMBOL_REF. The + return value will be a valid address and move_operand (either a REG + or a LO_SUM). */ + +static rtx +mips_legitimize_tls_address (rtx loc) +{ + rtx dest, insn, v0, v1, tmp1, tmp2, eqv; + enum tls_model model; + + v0 = gen_rtx_REG (Pmode, GP_RETURN); + v1 = gen_rtx_REG (Pmode, GP_RETURN + 1); + + model = SYMBOL_REF_TLS_MODEL (loc); + /* Only TARGET_ABICALLS code can have more than one module; other + code must be be static and should not use a GOT. All TLS models + reduce to local exec in this situation. */ + if (!TARGET_ABICALLS) + model = TLS_MODEL_LOCAL_EXEC; + + switch (model) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + insn = mips_call_tls_get_addr (loc, SYMBOL_TLSGD, v0); + dest = gen_reg_rtx (Pmode); + emit_libcall_block (insn, dest, v0, loc); + break; + + case TLS_MODEL_LOCAL_DYNAMIC: + insn = mips_call_tls_get_addr (loc, SYMBOL_TLSLDM, v0); + tmp1 = gen_reg_rtx (Pmode); + + /* Attach a unique REG_EQUIV, to allow the RTL optimizers to + share the LDM result with other LD model accesses. */ + eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), + UNSPEC_TLS_LDM); + emit_libcall_block (insn, tmp1, v0, eqv); + + tmp2 = mips_unspec_offset_high (NULL, tmp1, loc, SYMBOL_DTPREL); + dest = gen_rtx_LO_SUM (Pmode, tmp2, + mips_unspec_address (loc, SYMBOL_DTPREL)); + break; + + case TLS_MODEL_INITIAL_EXEC: + tmp1 = gen_reg_rtx (Pmode); + tmp2 = mips_unspec_address (loc, SYMBOL_GOTTPREL); + if (Pmode == DImode) + { + emit_insn (gen_tls_get_tp_di (v1)); + emit_insn (gen_load_gotdi (tmp1, pic_offset_table_rtx, tmp2)); + } + else + { + emit_insn (gen_tls_get_tp_si (v1)); + emit_insn (gen_load_gotsi (tmp1, pic_offset_table_rtx, tmp2)); + } + dest = gen_reg_rtx (Pmode); + emit_insn (gen_add3_insn (dest, tmp1, v1)); + break; + + case TLS_MODEL_LOCAL_EXEC: + if (Pmode == DImode) + emit_insn (gen_tls_get_tp_di (v1)); + else + emit_insn (gen_tls_get_tp_si (v1)); + + tmp1 = mips_unspec_offset_high (NULL, v1, loc, SYMBOL_TPREL); + dest = gen_rtx_LO_SUM (Pmode, tmp1, + mips_unspec_address (loc, SYMBOL_TPREL)); + break; + + default: + gcc_unreachable (); + } + + return dest; +} + +/* This function is used to implement LEGITIMIZE_ADDRESS. If *XLOC can + be legitimized in a way that the generic machinery might not expect, + put the new address in *XLOC and return true. MODE is the mode of + the memory being accessed. */ + +bool +mips_legitimize_address (rtx *xloc, enum machine_mode mode) +{ + enum mips_symbol_type symbol_type; + + if (mips_tls_operand_p (*xloc)) + { + *xloc = mips_legitimize_tls_address (*xloc); + return true; + } + + /* See if the address can split into a high part and a LO_SUM. */ + if (mips_symbolic_constant_p (*xloc, &symbol_type) + && mips_symbolic_address_p (symbol_type, mode) + && mips_split_p[symbol_type]) + { + *xloc = mips_split_symbol (0, *xloc); + return true; + } + + if (GET_CODE (*xloc) == PLUS && GET_CODE (XEXP (*xloc, 1)) == CONST_INT) + { + /* Handle REG + CONSTANT using mips_add_offset. */ + rtx reg; + + reg = XEXP (*xloc, 0); + if (!mips_valid_base_register_p (reg, mode, 0)) + reg = copy_to_mode_reg (Pmode, reg); + *xloc = mips_add_offset (0, reg, INTVAL (XEXP (*xloc, 1))); + return true; + } + + return false; +} + + +/* Subroutine of mips_build_integer (with the same interface). + Assume that the final action in the sequence should be a left shift. */ + +static unsigned int +mips_build_shift (struct mips_integer_op *codes, HOST_WIDE_INT value) +{ + unsigned int i, shift; + + /* Shift VALUE right until its lowest bit is set. Shift arithmetically + since signed numbers are easier to load than unsigned ones. */ + shift = 0; + while ((value & 1) == 0) + value /= 2, shift++; + + i = mips_build_integer (codes, value); + codes[i].code = ASHIFT; + codes[i].value = shift; + return i + 1; +} + + +/* As for mips_build_shift, but assume that the final action will be + an IOR or PLUS operation. */ + +static unsigned int +mips_build_lower (struct mips_integer_op *codes, unsigned HOST_WIDE_INT value) +{ + unsigned HOST_WIDE_INT high; + unsigned int i; + + high = value & ~(unsigned HOST_WIDE_INT) 0xffff; + if (!LUI_OPERAND (high) && (value & 0x18000) == 0x18000) + { + /* The constant is too complex to load with a simple lui/ori pair + so our goal is to clear as many trailing zeros as possible. + In this case, we know bit 16 is set and that the low 16 bits + form a negative number. If we subtract that number from VALUE, + we will clear at least the lowest 17 bits, maybe more. */ + i = mips_build_integer (codes, CONST_HIGH_PART (value)); + codes[i].code = PLUS; + codes[i].value = CONST_LOW_PART (value); + } + else + { + i = mips_build_integer (codes, high); + codes[i].code = IOR; + codes[i].value = value & 0xffff; + } + return i + 1; +} + + +/* Fill CODES with a sequence of rtl operations to load VALUE. + Return the number of operations needed. */ + +static unsigned int +mips_build_integer (struct mips_integer_op *codes, + unsigned HOST_WIDE_INT value) +{ + if (SMALL_OPERAND (value) + || SMALL_OPERAND_UNSIGNED (value) + || LUI_OPERAND (value)) + { + /* The value can be loaded with a single instruction. */ + codes[0].code = UNKNOWN; + codes[0].value = value; + return 1; + } + else if ((value & 1) != 0 || LUI_OPERAND (CONST_HIGH_PART (value))) + { + /* Either the constant is a simple LUI/ORI combination or its + lowest bit is set. We don't want to shift in this case. */ + return mips_build_lower (codes, value); + } + else if ((value & 0xffff) == 0) + { + /* The constant will need at least three actions. The lowest + 16 bits are clear, so the final action will be a shift. */ + return mips_build_shift (codes, value); + } + else + { + /* The final action could be a shift, add or inclusive OR. + Rather than use a complex condition to select the best + approach, try both mips_build_shift and mips_build_lower + and pick the one that gives the shortest sequence. + Note that this case is only used once per constant. */ + struct mips_integer_op alt_codes[MIPS_MAX_INTEGER_OPS]; + unsigned int cost, alt_cost; + + cost = mips_build_shift (codes, value); + alt_cost = mips_build_lower (alt_codes, value); + if (alt_cost < cost) + { + memcpy (codes, alt_codes, alt_cost * sizeof (codes[0])); + cost = alt_cost; + } + return cost; + } +} + + +/* Load VALUE into DEST, using TEMP as a temporary register if need be. */ + +void +mips_move_integer (rtx dest, rtx temp, unsigned HOST_WIDE_INT value) +{ + struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS]; + enum machine_mode mode; + unsigned int i, cost; + rtx x; + + mode = GET_MODE (dest); + cost = mips_build_integer (codes, value); + + /* Apply each binary operation to X. Invariant: X is a legitimate + source operand for a SET pattern. */ + x = GEN_INT (codes[0].value); + for (i = 1; i < cost; i++) + { + if (no_new_pseudos) + { + emit_insn (gen_rtx_SET (VOIDmode, temp, x)); + x = temp; + } + else + x = force_reg (mode, x); + x = gen_rtx_fmt_ee (codes[i].code, mode, x, GEN_INT (codes[i].value)); + } + + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); +} + + +/* Subroutine of mips_legitimize_move. Move constant SRC into register + DEST given that SRC satisfies immediate_operand but doesn't satisfy + move_operand. */ + +static void +mips_legitimize_const_move (enum machine_mode mode, rtx dest, rtx src) +{ + rtx base; + HOST_WIDE_INT offset; + + /* Split moves of big integers into smaller pieces. */ + if (splittable_const_int_operand (src, mode)) + { + mips_move_integer (dest, dest, INTVAL (src)); + return; + } + + /* Split moves of symbolic constants into high/low pairs. */ + if (splittable_symbolic_operand (src, mode)) + { + emit_insn (gen_rtx_SET (VOIDmode, dest, mips_split_symbol (dest, src))); + return; + } + + if (mips_tls_operand_p (src)) + { + emit_move_insn (dest, mips_legitimize_tls_address (src)); + return; + } + + /* If we have (const (plus symbol offset)), load the symbol first + and then add in the offset. This is usually better than forcing + the constant into memory, at least in non-mips16 code. */ + mips_split_const (src, &base, &offset); + if (!TARGET_MIPS16 + && offset != 0 + && (!no_new_pseudos || SMALL_OPERAND (offset))) + { + base = mips_force_temporary (dest, base); + emit_move_insn (dest, mips_add_offset (0, base, offset)); + return; + } + + src = force_const_mem (mode, src); + + /* When using explicit relocs, constant pool references are sometimes + not legitimate addresses. */ + if (!memory_operand (src, VOIDmode)) + src = replace_equiv_address (src, mips_split_symbol (dest, XEXP (src, 0))); + emit_move_insn (dest, src); +} + + +/* If (set DEST SRC) is not a valid instruction, emit an equivalent + sequence that is valid. */ + +bool +mips_legitimize_move (enum machine_mode mode, rtx dest, rtx src) +{ + if (!register_operand (dest, mode) && !reg_or_0_operand (src, mode)) + { + emit_move_insn (dest, force_reg (mode, src)); + return true; + } + + /* Check for individual, fully-reloaded mflo and mfhi instructions. */ + if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD + && REG_P (src) && MD_REG_P (REGNO (src)) + && REG_P (dest) && GP_REG_P (REGNO (dest))) + { + int other_regno = REGNO (src) == HI_REGNUM ? LO_REGNUM : HI_REGNUM; + if (GET_MODE_SIZE (mode) <= 4) + emit_insn (gen_mfhilo_si (gen_rtx_REG (SImode, REGNO (dest)), + gen_rtx_REG (SImode, REGNO (src)), + gen_rtx_REG (SImode, other_regno))); + else + emit_insn (gen_mfhilo_di (gen_rtx_REG (DImode, REGNO (dest)), + gen_rtx_REG (DImode, REGNO (src)), + gen_rtx_REG (DImode, other_regno))); + return true; + } + + /* We need to deal with constants that would be legitimate + immediate_operands but not legitimate move_operands. */ + if (CONSTANT_P (src) && !move_operand (src, mode)) + { + mips_legitimize_const_move (mode, dest, src); + set_unique_reg_note (get_last_insn (), REG_EQUAL, copy_rtx (src)); + return true; + } + return false; +} + +/* We need a lot of little routines to check constant values on the + mips16. These are used to figure out how long the instruction will + be. It would be much better to do this using constraints, but + there aren't nearly enough letters available. */ + +static int +m16_check_op (rtx op, int low, int high, int mask) +{ + return (GET_CODE (op) == CONST_INT + && INTVAL (op) >= low + && INTVAL (op) <= high + && (INTVAL (op) & mask) == 0); +} + +int +m16_uimm3_b (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, 0x1, 0x8, 0); +} + +int +m16_simm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x8, 0x7, 0); +} + +int +m16_nsimm4_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x7, 0x8, 0); +} + +int +m16_simm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x10, 0xf, 0); +} + +int +m16_nsimm5_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0xf, 0x10, 0); +} + +int +m16_uimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, (- 0x10) << 2, 0xf << 2, 3); +} + +int +m16_nuimm5_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, (- 0xf) << 2, 0x10 << 2, 3); +} + +int +m16_simm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x80, 0x7f, 0); +} + +int +m16_nsimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x7f, 0x80, 0); +} + +int +m16_uimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, 0x0, 0xff, 0); +} + +int +m16_nuimm8_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0xff, 0x0, 0); +} + +int +m16_uimm8_m1_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, - 0x1, 0xfe, 0); +} + +int +m16_uimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, 0x0, 0xff << 2, 3); +} + +int +m16_nuimm8_4 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, (- 0xff) << 2, 0x0, 3); +} + +int +m16_simm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, (- 0x80) << 3, 0x7f << 3, 7); +} + +int +m16_nsimm8_8 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return m16_check_op (op, (- 0x7f) << 3, 0x80 << 3, 7); +} + +static bool +mips_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + bool float_mode_p = FLOAT_MODE_P (mode); + + switch (code) + { + case CONST_INT: + if (TARGET_MIPS16) + { + /* A number between 1 and 8 inclusive is efficient for a shift. + Otherwise, we will need an extended instruction. */ + if ((outer_code) == ASHIFT || (outer_code) == ASHIFTRT + || (outer_code) == LSHIFTRT) + { + if (INTVAL (x) >= 1 && INTVAL (x) <= 8) + *total = 0; + else + *total = COSTS_N_INSNS (1); + return true; + } + + /* We can use cmpi for an xor with an unsigned 16 bit value. */ + if ((outer_code) == XOR + && INTVAL (x) >= 0 && INTVAL (x) < 0x10000) + { + *total = 0; + return true; + } + + /* We may be able to use slt or sltu for a comparison with a + signed 16 bit value. (The boundary conditions aren't quite + right, but this is just a heuristic anyhow.) */ + if (((outer_code) == LT || (outer_code) == LE + || (outer_code) == GE || (outer_code) == GT + || (outer_code) == LTU || (outer_code) == LEU + || (outer_code) == GEU || (outer_code) == GTU) + && INTVAL (x) >= -0x8000 && INTVAL (x) < 0x8000) + { + *total = 0; + return true; + } + + /* Equality comparisons with 0 are cheap. */ + if (((outer_code) == EQ || (outer_code) == NE) + && INTVAL (x) == 0) + { + *total = 0; + return true; + } + + /* Constants in the range 0...255 can be loaded with an unextended + instruction. They are therefore as cheap as a register move. + + Given the choice between "li R1,0...255" and "move R1,R2" + (where R2 is a known constant), it is usually better to use "li", + since we do not want to unnecessarily extend the lifetime + of R2. */ + if (outer_code == SET + && INTVAL (x) >= 0 + && INTVAL (x) < 256) + { + *total = 0; + return true; + } + } + else + { + /* These can be used anywhere. */ + *total = 0; + return true; + } + + /* Otherwise fall through to the handling below because + we'll need to construct the constant. */ + + case CONST: + case SYMBOL_REF: + case LABEL_REF: + case CONST_DOUBLE: + if (LEGITIMATE_CONSTANT_P (x)) + { + *total = COSTS_N_INSNS (1); + return true; + } + else + { + /* The value will need to be fetched from the constant pool. */ + *total = CONSTANT_POOL_COST; + return true; + } + + case MEM: + { + /* If the address is legitimate, return the number of + instructions it needs, otherwise use the default handling. */ + int n = mips_address_insns (XEXP (x, 0), GET_MODE (x)); + if (n > 0) + { + *total = COSTS_N_INSNS (n + 1); + return true; + } + return false; + } + + case FFS: + *total = COSTS_N_INSNS (6); + return true; + + case NOT: + *total = COSTS_N_INSNS ((mode == DImode && !TARGET_64BIT) ? 2 : 1); + return true; + + case AND: + case IOR: + case XOR: + if (mode == DImode && !TARGET_64BIT) + { + *total = COSTS_N_INSNS (2); + return true; + } + return false; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + if (mode == DImode && !TARGET_64BIT) + { + *total = COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT) + ? 4 : 12); + return true; + } + return false; + + case ABS: + if (float_mode_p) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (4); + return true; + + case LO_SUM: + *total = COSTS_N_INSNS (1); + return true; + + case PLUS: + case MINUS: + if (float_mode_p) + { + *total = mips_cost->fp_add; + return true; + } + + else if (mode == DImode && !TARGET_64BIT) + { + *total = COSTS_N_INSNS (4); + return true; + } + return false; + + case NEG: + if (mode == DImode && !TARGET_64BIT) + { + *total = COSTS_N_INSNS (4); + return true; + } + return false; + + case MULT: + if (mode == SFmode) + *total = mips_cost->fp_mult_sf; + + else if (mode == DFmode) + *total = mips_cost->fp_mult_df; + + else if (mode == SImode) + *total = mips_cost->int_mult_si; + + else + *total = mips_cost->int_mult_di; + + return true; + + case DIV: + case MOD: + if (float_mode_p) + { + if (mode == SFmode) + *total = mips_cost->fp_div_sf; + else + *total = mips_cost->fp_div_df; + + return true; + } + /* Fall through. */ + + case UDIV: + case UMOD: + if (mode == DImode) + *total = mips_cost->int_div_di; + else + *total = mips_cost->int_div_si; + + return true; + + case SIGN_EXTEND: + /* A sign extend from SImode to DImode in 64 bit mode is often + zero instructions, because the result can often be used + directly by another instruction; we'll call it one. */ + if (TARGET_64BIT && mode == DImode + && GET_MODE (XEXP (x, 0)) == SImode) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); + return true; + + case ZERO_EXTEND: + if (TARGET_64BIT && mode == DImode + && GET_MODE (XEXP (x, 0)) == SImode) + *total = COSTS_N_INSNS (2); + else + *total = COSTS_N_INSNS (1); + return true; + + case FLOAT: + case UNSIGNED_FLOAT: + case FIX: + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + case SQRT: + *total = mips_cost->fp_add; + return true; + + default: + return false; + } +} + +/* Provide the costs of an addressing mode that contains ADDR. + If ADDR is not a valid address, its cost is irrelevant. */ + +static int +mips_address_cost (rtx addr) +{ + return mips_address_insns (addr, SImode); +} + +/* Return one word of double-word value OP, taking into account the fixed + endianness of certain registers. HIGH_P is true to select the high part, + false to select the low part. */ + +rtx +mips_subword (rtx op, int high_p) +{ + unsigned int byte; + enum machine_mode mode; + + mode = GET_MODE (op); + if (mode == VOIDmode) + mode = DImode; + + if (TARGET_BIG_ENDIAN ? !high_p : high_p) + byte = UNITS_PER_WORD; + else + byte = 0; + + if (REG_P (op)) + { + if (FP_REG_P (REGNO (op))) + return gen_rtx_REG (word_mode, high_p ? REGNO (op) + 1 : REGNO (op)); + if (ACC_HI_REG_P (REGNO (op))) + return gen_rtx_REG (word_mode, high_p ? REGNO (op) : REGNO (op) + 1); + } + + if (MEM_P (op)) + return mips_rewrite_small_data (adjust_address (op, word_mode, byte)); + + return simplify_gen_subreg (word_mode, op, mode, byte); +} + + +/* Return true if a 64-bit move from SRC to DEST should be split into two. */ + +bool +mips_split_64bit_move_p (rtx dest, rtx src) +{ + if (TARGET_64BIT) + return false; + + /* FP->FP moves can be done in a single instruction. */ + if (FP_REG_RTX_P (src) && FP_REG_RTX_P (dest)) + return false; + + /* Check for floating-point loads and stores. They can be done using + ldc1 and sdc1 on MIPS II and above. */ + if (mips_isa > 1) + { + if (FP_REG_RTX_P (dest) && MEM_P (src)) + return false; + if (FP_REG_RTX_P (src) && MEM_P (dest)) + return false; + } + return true; +} + + +/* Split a 64-bit move from SRC to DEST assuming that + mips_split_64bit_move_p holds. + + Moves into and out of FPRs cause some difficulty here. Such moves + will always be DFmode, since paired FPRs are not allowed to store + DImode values. The most natural representation would be two separate + 32-bit moves, such as: + + (set (reg:SI $f0) (mem:SI ...)) + (set (reg:SI $f1) (mem:SI ...)) + + However, the second insn is invalid because odd-numbered FPRs are + not allowed to store independent values. Use the patterns load_df_low, + load_df_high and store_df_high instead. */ + +void +mips_split_64bit_move (rtx dest, rtx src) +{ + if (FP_REG_RTX_P (dest)) + { + /* Loading an FPR from memory or from GPRs. */ + emit_insn (gen_load_df_low (copy_rtx (dest), mips_subword (src, 0))); + emit_insn (gen_load_df_high (dest, mips_subword (src, 1), + copy_rtx (dest))); + } + else if (FP_REG_RTX_P (src)) + { + /* Storing an FPR into memory or GPRs. */ + emit_move_insn (mips_subword (dest, 0), mips_subword (src, 0)); + emit_insn (gen_store_df_high (mips_subword (dest, 1), src)); + } + else + { + /* The operation can be split into two normal moves. Decide in + which order to do them. */ + rtx low_dest; + + low_dest = mips_subword (dest, 0); + if (REG_P (low_dest) + && reg_overlap_mentioned_p (low_dest, src)) + { + emit_move_insn (mips_subword (dest, 1), mips_subword (src, 1)); + emit_move_insn (low_dest, mips_subword (src, 0)); + } + else + { + emit_move_insn (low_dest, mips_subword (src, 0)); + emit_move_insn (mips_subword (dest, 1), mips_subword (src, 1)); + } + } +} + +/* Return the appropriate instructions to move SRC into DEST. Assume + that SRC is operand 1 and DEST is operand 0. */ + +const char * +mips_output_move (rtx dest, rtx src) +{ + enum rtx_code dest_code, src_code; + bool dbl_p; + + dest_code = GET_CODE (dest); + src_code = GET_CODE (src); + dbl_p = (GET_MODE_SIZE (GET_MODE (dest)) == 8); + + if (dbl_p && mips_split_64bit_move_p (dest, src)) + return "#"; + + if ((src_code == REG && GP_REG_P (REGNO (src))) + || (!TARGET_MIPS16 && src == CONST0_RTX (GET_MODE (dest)))) + { + if (dest_code == REG) + { + if (GP_REG_P (REGNO (dest))) + return "move\t%0,%z1"; + + if (MD_REG_P (REGNO (dest))) + return "mt%0\t%z1"; + + if (DSP_ACC_REG_P (REGNO (dest))) + { + static char retval[] = "mt__\t%z1,%q0"; + retval[2] = reg_names[REGNO (dest)][4]; + retval[3] = reg_names[REGNO (dest)][5]; + return retval; + } + + if (FP_REG_P (REGNO (dest))) + return (dbl_p ? "dmtc1\t%z1,%0" : "mtc1\t%z1,%0"); + + if (ALL_COP_REG_P (REGNO (dest))) + { + static char retval[] = "dmtc_\t%z1,%0"; + + retval[4] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (dest)); + return (dbl_p ? retval : retval + 1); + } + } + if (dest_code == MEM) + return (dbl_p ? "sd\t%z1,%0" : "sw\t%z1,%0"); + } + if (dest_code == REG && GP_REG_P (REGNO (dest))) + { + if (src_code == REG) + { + if (DSP_ACC_REG_P (REGNO (src))) + { + static char retval[] = "mf__\t%0,%q1"; + retval[2] = reg_names[REGNO (src)][4]; + retval[3] = reg_names[REGNO (src)][5]; + return retval; + } + + if (ST_REG_P (REGNO (src)) && ISA_HAS_8CC) + return "lui\t%0,0x3f80\n\tmovf\t%0,%.,%1"; + + if (FP_REG_P (REGNO (src))) + return (dbl_p ? "dmfc1\t%0,%1" : "mfc1\t%0,%1"); + + if (ALL_COP_REG_P (REGNO (src))) + { + static char retval[] = "dmfc_\t%0,%1"; + + retval[4] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (src)); + return (dbl_p ? retval : retval + 1); + } + } + + if (src_code == MEM) + return (dbl_p ? "ld\t%0,%1" : "lw\t%0,%1"); + + if (src_code == CONST_INT) + { + /* Don't use the X format, because that will give out of + range numbers for 64 bit hosts and 32 bit targets. */ + if (!TARGET_MIPS16) + return "li\t%0,%1\t\t\t# %X1"; + + if (INTVAL (src) >= 0 && INTVAL (src) <= 0xffff) + return "li\t%0,%1"; + + if (INTVAL (src) < 0 && INTVAL (src) >= -0xffff) + return "#"; + } + + if (src_code == HIGH) + return "lui\t%0,%h1"; + + if (CONST_GP_P (src)) + return "move\t%0,%1"; + + if (symbolic_operand (src, VOIDmode)) + return (dbl_p ? "dla\t%0,%1" : "la\t%0,%1"); + } + if (src_code == REG && FP_REG_P (REGNO (src))) + { + if (dest_code == REG && FP_REG_P (REGNO (dest))) + { + if (GET_MODE (dest) == V2SFmode) + return "mov.ps\t%0,%1"; + else + return (dbl_p ? "mov.d\t%0,%1" : "mov.s\t%0,%1"); + } + + if (dest_code == MEM) + return (dbl_p ? "sdc1\t%1,%0" : "swc1\t%1,%0"); + } + if (dest_code == REG && FP_REG_P (REGNO (dest))) + { + if (src_code == MEM) + return (dbl_p ? "ldc1\t%0,%1" : "lwc1\t%0,%1"); + } + if (dest_code == REG && ALL_COP_REG_P (REGNO (dest)) && src_code == MEM) + { + static char retval[] = "l_c_\t%0,%1"; + + retval[1] = (dbl_p ? 'd' : 'w'); + retval[3] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (dest)); + return retval; + } + if (dest_code == MEM && src_code == REG && ALL_COP_REG_P (REGNO (src))) + { + static char retval[] = "s_c_\t%1,%0"; + + retval[1] = (dbl_p ? 'd' : 'w'); + retval[3] = COPNUM_AS_CHAR_FROM_REGNUM (REGNO (src)); + return retval; + } + gcc_unreachable (); +} + +/* Restore $gp from its save slot. Valid only when using o32 or + o64 abicalls. */ + +void +mips_restore_gp (void) +{ + rtx address, slot; + + gcc_assert (TARGET_ABICALLS && TARGET_OLDABI); + + address = mips_add_offset (pic_offset_table_rtx, + frame_pointer_needed + ? hard_frame_pointer_rtx + : stack_pointer_rtx, + current_function_outgoing_args_size); + slot = gen_rtx_MEM (Pmode, address); + + emit_move_insn (pic_offset_table_rtx, slot); + if (!TARGET_EXPLICIT_RELOCS) + emit_insn (gen_blockage ()); +} + +/* Emit an instruction of the form (set TARGET (CODE OP0 OP1)). */ + +static void +mips_emit_binary (enum rtx_code code, rtx target, rtx op0, rtx op1) +{ + emit_insn (gen_rtx_SET (VOIDmode, target, + gen_rtx_fmt_ee (code, GET_MODE (target), op0, op1))); +} + +/* Return true if CMP1 is a suitable second operand for relational + operator CODE. See also the *sCC patterns in mips.md. */ + +static bool +mips_relational_operand_ok_p (enum rtx_code code, rtx cmp1) +{ + switch (code) + { + case GT: + case GTU: + return reg_or_0_operand (cmp1, VOIDmode); + + case GE: + case GEU: + return !TARGET_MIPS16 && cmp1 == const1_rtx; + + case LT: + case LTU: + return arith_operand (cmp1, VOIDmode); + + case LE: + return sle_operand (cmp1, VOIDmode); + + case LEU: + return sleu_operand (cmp1, VOIDmode); + + default: + gcc_unreachable (); + } +} + +/* Canonicalize LE or LEU comparisons into LT comparisons when + possible to avoid extra instructions or inverting the + comparison. */ + +static bool +mips_canonicalize_comparison (enum rtx_code *code, rtx *cmp1, + enum machine_mode mode) +{ + HOST_WIDE_INT original, plus_one; + + if (GET_CODE (*cmp1) != CONST_INT) + return false; + + original = INTVAL (*cmp1); + plus_one = trunc_int_for_mode ((unsigned HOST_WIDE_INT) original + 1, mode); + + switch (*code) + { + case LE: + if (original < plus_one) + { + *code = LT; + *cmp1 = force_reg (mode, GEN_INT (plus_one)); + return true; + } + break; + + case LEU: + if (plus_one != 0) + { + *code = LTU; + *cmp1 = force_reg (mode, GEN_INT (plus_one)); + return true; + } + break; + + default: + return false; + } + + return false; + +} + +/* Compare CMP0 and CMP1 using relational operator CODE and store the + result in TARGET. CMP0 and TARGET are register_operands that have + the same integer mode. If INVERT_PTR is nonnull, it's OK to set + TARGET to the inverse of the result and flip *INVERT_PTR instead. */ + +static void +mips_emit_int_relational (enum rtx_code code, bool *invert_ptr, + rtx target, rtx cmp0, rtx cmp1) +{ + /* First see if there is a MIPS instruction that can do this operation + with CMP1 in its current form. If not, try to canonicalize the + comparison to LT. If that fails, try doing the same for the + inverse operation. If that also fails, force CMP1 into a register + and try again. */ + if (mips_relational_operand_ok_p (code, cmp1)) + mips_emit_binary (code, target, cmp0, cmp1); + else if (mips_canonicalize_comparison (&code, &cmp1, GET_MODE (target))) + mips_emit_binary (code, target, cmp0, cmp1); + else + { + enum rtx_code inv_code = reverse_condition (code); + if (!mips_relational_operand_ok_p (inv_code, cmp1)) + { + cmp1 = force_reg (GET_MODE (cmp0), cmp1); + mips_emit_int_relational (code, invert_ptr, target, cmp0, cmp1); + } + else if (invert_ptr == 0) + { + rtx inv_target = gen_reg_rtx (GET_MODE (target)); + mips_emit_binary (inv_code, inv_target, cmp0, cmp1); + mips_emit_binary (XOR, target, inv_target, const1_rtx); + } + else + { + *invert_ptr = !*invert_ptr; + mips_emit_binary (inv_code, target, cmp0, cmp1); + } + } +} + +/* Return a register that is zero iff CMP0 and CMP1 are equal. + The register will have the same mode as CMP0. */ + +static rtx +mips_zero_if_equal (rtx cmp0, rtx cmp1) +{ + if (cmp1 == const0_rtx) + return cmp0; + + if (uns_arith_operand (cmp1, VOIDmode)) + return expand_binop (GET_MODE (cmp0), xor_optab, + cmp0, cmp1, 0, 0, OPTAB_DIRECT); + + return expand_binop (GET_MODE (cmp0), sub_optab, + cmp0, cmp1, 0, 0, OPTAB_DIRECT); +} + +/* Convert *CODE into a code that can be used in a floating-point + scc instruction (c..). Return true if the values of + the condition code registers will be inverted, with 0 indicating + that the condition holds. */ + +static bool +mips_reverse_fp_cond_p (enum rtx_code *code) +{ + switch (*code) + { + case NE: + case LTGT: + case ORDERED: + *code = reverse_condition_maybe_unordered (*code); + return true; + + default: + return false; + } +} + +/* Convert a comparison into something that can be used in a branch or + conditional move. cmp_operands[0] and cmp_operands[1] are the values + being compared and *CODE is the code used to compare them. + + Update *CODE, *OP0 and *OP1 so that they describe the final comparison. + If NEED_EQ_NE_P, then only EQ/NE comparisons against zero are possible, + otherwise any standard branch condition can be used. The standard branch + conditions are: + + - EQ/NE between two registers. + - any comparison between a register and zero. */ + +static void +mips_emit_compare (enum rtx_code *code, rtx *op0, rtx *op1, bool need_eq_ne_p) +{ + if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_INT) + { + if (!need_eq_ne_p && cmp_operands[1] == const0_rtx) + { + *op0 = cmp_operands[0]; + *op1 = cmp_operands[1]; + } + else if (*code == EQ || *code == NE) + { + if (need_eq_ne_p) + { + *op0 = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]); + *op1 = const0_rtx; + } + else + { + *op0 = cmp_operands[0]; + *op1 = force_reg (GET_MODE (*op0), cmp_operands[1]); + } + } + else + { + /* The comparison needs a separate scc instruction. Store the + result of the scc in *OP0 and compare it against zero. */ + bool invert = false; + *op0 = gen_reg_rtx (GET_MODE (cmp_operands[0])); + *op1 = const0_rtx; + mips_emit_int_relational (*code, &invert, *op0, + cmp_operands[0], cmp_operands[1]); + *code = (invert ? EQ : NE); + } + } + else + { + enum rtx_code cmp_code; + + /* Floating-point tests use a separate c.cond.fmt comparison to + set a condition code register. The branch or conditional move + will then compare that register against zero. + + Set CMP_CODE to the code of the comparison instruction and + *CODE to the code that the branch or move should use. */ + cmp_code = *code; + *code = mips_reverse_fp_cond_p (&cmp_code) ? EQ : NE; + *op0 = (ISA_HAS_8CC + ? gen_reg_rtx (CCmode) + : gen_rtx_REG (CCmode, FPSW_REGNUM)); + *op1 = const0_rtx; + mips_emit_binary (cmp_code, *op0, cmp_operands[0], cmp_operands[1]); + } +} + +/* Try comparing cmp_operands[0] and cmp_operands[1] using rtl code CODE. + Store the result in TARGET and return true if successful. + + On 64-bit targets, TARGET may be wider than cmp_operands[0]. */ + +bool +mips_emit_scc (enum rtx_code code, rtx target) +{ + if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) != MODE_INT) + return false; + + target = gen_lowpart (GET_MODE (cmp_operands[0]), target); + if (code == EQ || code == NE) + { + rtx zie = mips_zero_if_equal (cmp_operands[0], cmp_operands[1]); + mips_emit_binary (code, target, zie, const0_rtx); + } + else + mips_emit_int_relational (code, 0, target, + cmp_operands[0], cmp_operands[1]); + return true; +} + +/* Emit the common code for doing conditional branches. + operand[0] is the label to jump to. + The comparison operands are saved away by cmp{si,di,sf,df}. */ + +void +gen_conditional_branch (rtx *operands, enum rtx_code code) +{ + rtx op0, op1, condition; + + mips_emit_compare (&code, &op0, &op1, TARGET_MIPS16); + condition = gen_rtx_fmt_ee (code, VOIDmode, op0, op1); + emit_jump_insn (gen_condjump (condition, operands[0])); +} + +/* Implement: + + (set temp (COND:CCV2 CMP_OP0 CMP_OP1)) + (set DEST (unspec [TRUE_SRC FALSE_SRC temp] UNSPEC_MOVE_TF_PS)) */ + +void +mips_expand_vcondv2sf (rtx dest, rtx true_src, rtx false_src, + enum rtx_code cond, rtx cmp_op0, rtx cmp_op1) +{ + rtx cmp_result; + bool reversed_p; + + reversed_p = mips_reverse_fp_cond_p (&cond); + cmp_result = gen_reg_rtx (CCV2mode); + emit_insn (gen_scc_ps (cmp_result, + gen_rtx_fmt_ee (cond, VOIDmode, cmp_op0, cmp_op1))); + if (reversed_p) + emit_insn (gen_mips_cond_move_tf_ps (dest, false_src, true_src, + cmp_result)); + else + emit_insn (gen_mips_cond_move_tf_ps (dest, true_src, false_src, + cmp_result)); +} + +/* Emit the common code for conditional moves. OPERANDS is the array + of operands passed to the conditional move define_expand. */ + +void +gen_conditional_move (rtx *operands) +{ + enum rtx_code code; + rtx op0, op1; + + code = GET_CODE (operands[1]); + mips_emit_compare (&code, &op0, &op1, true); + emit_insn (gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_IF_THEN_ELSE (GET_MODE (operands[0]), + gen_rtx_fmt_ee (code, + GET_MODE (op0), + op0, op1), + operands[2], operands[3]))); +} + +/* Emit a conditional trap. OPERANDS is the array of operands passed to + the conditional_trap expander. */ + +void +mips_gen_conditional_trap (rtx *operands) +{ + rtx op0, op1; + enum rtx_code cmp_code = GET_CODE (operands[0]); + enum machine_mode mode = GET_MODE (cmp_operands[0]); + + /* MIPS conditional trap machine instructions don't have GT or LE + flavors, so we must invert the comparison and convert to LT and + GE, respectively. */ + switch (cmp_code) + { + case GT: cmp_code = LT; break; + case LE: cmp_code = GE; break; + case GTU: cmp_code = LTU; break; + case LEU: cmp_code = GEU; break; + default: break; + } + if (cmp_code == GET_CODE (operands[0])) + { + op0 = cmp_operands[0]; + op1 = cmp_operands[1]; + } + else + { + op0 = cmp_operands[1]; + op1 = cmp_operands[0]; + } + op0 = force_reg (mode, op0); + if (!arith_operand (op1, mode)) + op1 = force_reg (mode, op1); + + emit_insn (gen_rtx_TRAP_IF (VOIDmode, + gen_rtx_fmt_ee (cmp_code, mode, op0, op1), + operands[1])); +} + +/* Load function address ADDR into register DEST. SIBCALL_P is true + if the address is needed for a sibling call. */ + +static void +mips_load_call_address (rtx dest, rtx addr, int sibcall_p) +{ + /* If we're generating PIC, and this call is to a global function, + try to allow its address to be resolved lazily. This isn't + possible for NewABI sibcalls since the value of $gp on entry + to the stub would be our caller's gp, not ours. */ + if (TARGET_EXPLICIT_RELOCS + && !(sibcall_p && TARGET_NEWABI) + && global_got_operand (addr, VOIDmode)) + { + rtx high, lo_sum_symbol; + + high = mips_unspec_offset_high (dest, pic_offset_table_rtx, + addr, SYMBOL_GOTOFF_CALL); + lo_sum_symbol = mips_unspec_address (addr, SYMBOL_GOTOFF_CALL); + if (Pmode == SImode) + emit_insn (gen_load_callsi (dest, high, lo_sum_symbol)); + else + emit_insn (gen_load_calldi (dest, high, lo_sum_symbol)); + } + else + emit_move_insn (dest, addr); +} + + +/* Expand a call or call_value instruction. RESULT is where the + result will go (null for calls), ADDR is the address of the + function, ARGS_SIZE is the size of the arguments and AUX is + the value passed to us by mips_function_arg. SIBCALL_P is true + if we are expanding a sibling call, false if we're expanding + a normal call. */ + +void +mips_expand_call (rtx result, rtx addr, rtx args_size, rtx aux, int sibcall_p) +{ + rtx orig_addr, pattern, insn; + + orig_addr = addr; + if (!call_insn_operand (addr, VOIDmode)) + { + addr = gen_reg_rtx (Pmode); + mips_load_call_address (addr, orig_addr, sibcall_p); + } + + if (TARGET_MIPS16 + && mips16_hard_float + && build_mips16_call_stub (result, addr, args_size, + aux == 0 ? 0 : (int) GET_MODE (aux))) + return; + + if (result == 0) + pattern = (sibcall_p + ? gen_sibcall_internal (addr, args_size) + : gen_call_internal (addr, args_size)); + else if (GET_CODE (result) == PARALLEL && XVECLEN (result, 0) == 2) + { + rtx reg1, reg2; + + reg1 = XEXP (XVECEXP (result, 0, 0), 0); + reg2 = XEXP (XVECEXP (result, 0, 1), 0); + pattern = + (sibcall_p + ? gen_sibcall_value_multiple_internal (reg1, addr, args_size, reg2) + : gen_call_value_multiple_internal (reg1, addr, args_size, reg2)); + } + else + pattern = (sibcall_p + ? gen_sibcall_value_internal (result, addr, args_size) + : gen_call_value_internal (result, addr, args_size)); + + insn = emit_call_insn (pattern); + + /* Lazy-binding stubs require $gp to be valid on entry. */ + if (global_got_operand (orig_addr, VOIDmode)) + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); +} + + +/* We can handle any sibcall when TARGET_SIBCALLS is true. */ + +static bool +mips_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED, + tree exp ATTRIBUTE_UNUSED) +{ + return TARGET_SIBCALLS; +} + +/* Emit code to move general operand SRC into condition-code + register DEST. SCRATCH is a scratch TFmode float register. + The sequence is: + + FP1 = SRC + FP2 = 0.0f + DEST = FP2 < FP1 + + where FP1 and FP2 are single-precision float registers + taken from SCRATCH. */ + +void +mips_emit_fcc_reload (rtx dest, rtx src, rtx scratch) +{ + rtx fp1, fp2; + + /* Change the source to SFmode. */ + if (MEM_P (src)) + src = adjust_address (src, SFmode, 0); + else if (REG_P (src) || GET_CODE (src) == SUBREG) + src = gen_rtx_REG (SFmode, true_regnum (src)); + + fp1 = gen_rtx_REG (SFmode, REGNO (scratch)); + fp2 = gen_rtx_REG (SFmode, REGNO (scratch) + FP_INC); + + emit_move_insn (copy_rtx (fp1), src); + emit_move_insn (copy_rtx (fp2), CONST0_RTX (SFmode)); + emit_insn (gen_slt_sf (dest, fp2, fp1)); +} + +/* Emit code to change the current function's return address to + ADDRESS. SCRATCH is available as a scratch register, if needed. + ADDRESS and SCRATCH are both word-mode GPRs. */ + +void +mips_set_return_address (rtx address, rtx scratch) +{ + rtx slot_address; + + compute_frame_size (get_frame_size ()); + gcc_assert ((cfun->machine->frame.mask >> 31) & 1); + slot_address = mips_add_offset (scratch, stack_pointer_rtx, + cfun->machine->frame.gp_sp_offset); + + emit_move_insn (gen_rtx_MEM (GET_MODE (address), slot_address), address); +} + +/* Emit straight-line code to move LENGTH bytes from SRC to DEST. + Assume that the areas do not overlap. */ + +static void +mips_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length) +{ + HOST_WIDE_INT offset, delta; + unsigned HOST_WIDE_INT bits; + int i; + enum machine_mode mode; + rtx *regs; + + /* Work out how many bits to move at a time. If both operands have + half-word alignment, it is usually better to move in half words. + For instance, lh/lh/sh/sh is usually better than lwl/lwr/swl/swr + and lw/lw/sw/sw is usually better than ldl/ldr/sdl/sdr. + Otherwise move word-sized chunks. */ + if (MEM_ALIGN (src) == BITS_PER_WORD / 2 + && MEM_ALIGN (dest) == BITS_PER_WORD / 2) + bits = BITS_PER_WORD / 2; + else + bits = BITS_PER_WORD; + + mode = mode_for_size (bits, MODE_INT, 0); + delta = bits / BITS_PER_UNIT; + + /* Allocate a buffer for the temporary registers. */ + regs = alloca (sizeof (rtx) * length / delta); + + /* Load as many BITS-sized chunks as possible. Use a normal load if + the source has enough alignment, otherwise use left/right pairs. */ + for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++) + { + regs[i] = gen_reg_rtx (mode); + if (MEM_ALIGN (src) >= bits) + emit_move_insn (regs[i], adjust_address (src, mode, offset)); + else + { + rtx part = adjust_address (src, BLKmode, offset); + if (!mips_expand_unaligned_load (regs[i], part, bits, 0)) + gcc_unreachable (); + } + } + + /* Copy the chunks to the destination. */ + for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++) + if (MEM_ALIGN (dest) >= bits) + emit_move_insn (adjust_address (dest, mode, offset), regs[i]); + else + { + rtx part = adjust_address (dest, BLKmode, offset); + if (!mips_expand_unaligned_store (part, regs[i], bits, 0)) + gcc_unreachable (); + } + + /* Mop up any left-over bytes. */ + if (offset < length) + { + src = adjust_address (src, BLKmode, offset); + dest = adjust_address (dest, BLKmode, offset); + move_by_pieces (dest, src, length - offset, + MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), 0); + } +} + +#define MAX_MOVE_REGS 4 +#define MAX_MOVE_BYTES (MAX_MOVE_REGS * UNITS_PER_WORD) + + +/* Helper function for doing a loop-based block operation on memory + reference MEM. Each iteration of the loop will operate on LENGTH + bytes of MEM. + + Create a new base register for use within the loop and point it to + the start of MEM. Create a new memory reference that uses this + register. Store them in *LOOP_REG and *LOOP_MEM respectively. */ + +static void +mips_adjust_block_mem (rtx mem, HOST_WIDE_INT length, + rtx *loop_reg, rtx *loop_mem) +{ + *loop_reg = copy_addr_to_reg (XEXP (mem, 0)); + + /* Although the new mem does not refer to a known location, + it does keep up to LENGTH bytes of alignment. */ + *loop_mem = change_address (mem, BLKmode, *loop_reg); + set_mem_align (*loop_mem, MIN (MEM_ALIGN (mem), length * BITS_PER_UNIT)); +} + + +/* Move LENGTH bytes from SRC to DEST using a loop that moves MAX_MOVE_BYTES + per iteration. LENGTH must be at least MAX_MOVE_BYTES. Assume that the + memory regions do not overlap. */ + +static void +mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length) +{ + rtx label, src_reg, dest_reg, final_src; + HOST_WIDE_INT leftover; + + leftover = length % MAX_MOVE_BYTES; + length -= leftover; + + /* Create registers and memory references for use within the loop. */ + mips_adjust_block_mem (src, MAX_MOVE_BYTES, &src_reg, &src); + mips_adjust_block_mem (dest, MAX_MOVE_BYTES, &dest_reg, &dest); + + /* Calculate the value that SRC_REG should have after the last iteration + of the loop. */ + final_src = expand_simple_binop (Pmode, PLUS, src_reg, GEN_INT (length), + 0, 0, OPTAB_WIDEN); + + /* Emit the start of the loop. */ + label = gen_label_rtx (); + emit_label (label); + + /* Emit the loop body. */ + mips_block_move_straight (dest, src, MAX_MOVE_BYTES); + + /* Move on to the next block. */ + emit_move_insn (src_reg, plus_constant (src_reg, MAX_MOVE_BYTES)); + emit_move_insn (dest_reg, plus_constant (dest_reg, MAX_MOVE_BYTES)); + + /* Emit the loop condition. */ + if (Pmode == DImode) + emit_insn (gen_cmpdi (src_reg, final_src)); + else + emit_insn (gen_cmpsi (src_reg, final_src)); + emit_jump_insn (gen_bne (label)); + + /* Mop up any left-over bytes. */ + if (leftover) + mips_block_move_straight (dest, src, leftover); +} + +/* Expand a movmemsi instruction. */ + +bool +mips_expand_block_move (rtx dest, rtx src, rtx length) +{ + if (GET_CODE (length) == CONST_INT) + { + if (INTVAL (length) <= 2 * MAX_MOVE_BYTES) + { + mips_block_move_straight (dest, src, INTVAL (length)); + return true; + } + else if (optimize) + { + mips_block_move_loop (dest, src, INTVAL (length)); + return true; + } + } + return false; +} + +/* Argument support functions. */ + +/* Initialize CUMULATIVE_ARGS for a function. */ + +void +init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, + rtx libname ATTRIBUTE_UNUSED) +{ + static CUMULATIVE_ARGS zero_cum; + tree param, next_param; + + *cum = zero_cum; + cum->prototype = (fntype && TYPE_ARG_TYPES (fntype)); + + /* Determine if this function has variable arguments. This is + indicated by the last argument being 'void_type_mode' if there + are no variable arguments. The standard MIPS calling sequence + passes all arguments in the general purpose registers in this case. */ + + for (param = fntype ? TYPE_ARG_TYPES (fntype) : 0; + param != 0; param = next_param) + { + next_param = TREE_CHAIN (param); + if (next_param == 0 && TREE_VALUE (param) != void_type_node) + cum->gp_reg_found = 1; + } +} + + +/* Fill INFO with information about a single argument. CUM is the + cumulative state for earlier arguments. MODE is the mode of this + argument and TYPE is its type (if known). NAMED is true if this + is a named (fixed) argument rather than a variable one. */ + +static void +mips_arg_info (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named, struct mips_arg_info *info) +{ + bool doubleword_aligned_p; + unsigned int num_bytes, num_words, max_regs; + + /* Work out the size of the argument. */ + num_bytes = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + num_words = (num_bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + /* Decide whether it should go in a floating-point register, assuming + one is free. Later code checks for availability. + + The checks against UNITS_PER_FPVALUE handle the soft-float and + single-float cases. */ + switch (mips_abi) + { + case ABI_EABI: + /* The EABI conventions have traditionally been defined in terms + of TYPE_MODE, regardless of the actual type. */ + info->fpr_p = ((GET_MODE_CLASS (mode) == MODE_FLOAT + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) + && GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE); + break; + + case ABI_32: + case ABI_O64: + /* Only leading floating-point scalars are passed in + floating-point registers. We also handle vector floats the same + say, which is OK because they are not covered by the standard ABI. */ + info->fpr_p = (!cum->gp_reg_found + && cum->arg_number < 2 + && (type == 0 || SCALAR_FLOAT_TYPE_P (type) + || VECTOR_FLOAT_TYPE_P (type)) + && (GET_MODE_CLASS (mode) == MODE_FLOAT + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) + && GET_MODE_SIZE (mode) <= UNITS_PER_FPVALUE); + break; + + case ABI_N32: + case ABI_64: + /* Scalar and complex floating-point types are passed in + floating-point registers. */ + info->fpr_p = (named + && (type == 0 || FLOAT_TYPE_P (type)) + && (GET_MODE_CLASS (mode) == MODE_FLOAT + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) + && GET_MODE_UNIT_SIZE (mode) <= UNITS_PER_FPVALUE); + + /* ??? According to the ABI documentation, the real and imaginary + parts of complex floats should be passed in individual registers. + The real and imaginary parts of stack arguments are supposed + to be contiguous and there should be an extra word of padding + at the end. + + This has two problems. First, it makes it impossible to use a + single "void *" va_list type, since register and stack arguments + are passed differently. (At the time of writing, MIPSpro cannot + handle complex float varargs correctly.) Second, it's unclear + what should happen when there is only one register free. + + For now, we assume that named complex floats should go into FPRs + if there are two FPRs free, otherwise they should be passed in the + same way as a struct containing two floats. */ + if (info->fpr_p + && GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT + && GET_MODE_UNIT_SIZE (mode) < UNITS_PER_FPVALUE) + { + if (cum->num_gprs >= MAX_ARGS_IN_REGISTERS - 1) + info->fpr_p = false; + else + num_words = 2; + } + break; + + default: + gcc_unreachable (); + } + + /* See whether the argument has doubleword alignment. */ + doubleword_aligned_p = FUNCTION_ARG_BOUNDARY (mode, type) > BITS_PER_WORD; + + /* Set REG_OFFSET to the register count we're interested in. + The EABI allocates the floating-point registers separately, + but the other ABIs allocate them like integer registers. */ + info->reg_offset = (mips_abi == ABI_EABI && info->fpr_p + ? cum->num_fprs + : cum->num_gprs); + + /* Advance to an even register if the argument is doubleword-aligned. */ + if (doubleword_aligned_p) + info->reg_offset += info->reg_offset & 1; + + /* Work out the offset of a stack argument. */ + info->stack_offset = cum->stack_words; + if (doubleword_aligned_p) + info->stack_offset += info->stack_offset & 1; + + max_regs = MAX_ARGS_IN_REGISTERS - info->reg_offset; + + /* Partition the argument between registers and stack. */ + info->reg_words = MIN (num_words, max_regs); + info->stack_words = num_words - info->reg_words; +} + + +/* Implement FUNCTION_ARG_ADVANCE. */ + +void +function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct mips_arg_info info; + + mips_arg_info (cum, mode, type, named, &info); + + if (!info.fpr_p) + cum->gp_reg_found = true; + + /* See the comment above the cumulative args structure in mips.h + for an explanation of what this code does. It assumes the O32 + ABI, which passes at most 2 arguments in float registers. */ + if (cum->arg_number < 2 && info.fpr_p) + cum->fp_code += (mode == SFmode ? 1 : 2) << ((cum->arg_number - 1) * 2); + + if (mips_abi != ABI_EABI || !info.fpr_p) + cum->num_gprs = info.reg_offset + info.reg_words; + else if (info.reg_words > 0) + cum->num_fprs += FP_INC; + + if (info.stack_words > 0) + cum->stack_words = info.stack_offset + info.stack_words; + + cum->arg_number++; +} + +/* Implement FUNCTION_ARG. */ + +struct rtx_def * +function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct mips_arg_info info; + + /* We will be called with a mode of VOIDmode after the last argument + has been seen. Whatever we return will be passed to the call + insn. If we need a mips16 fp_code, return a REG with the code + stored as the mode. */ + if (mode == VOIDmode) + { + if (TARGET_MIPS16 && cum->fp_code != 0) + return gen_rtx_REG ((enum machine_mode) cum->fp_code, 0); + + else + return 0; + } + + mips_arg_info (cum, mode, type, named, &info); + + /* Return straight away if the whole argument is passed on the stack. */ + if (info.reg_offset == MAX_ARGS_IN_REGISTERS) + return 0; + + if (type != 0 + && TREE_CODE (type) == RECORD_TYPE + && TARGET_NEWABI + && TYPE_SIZE_UNIT (type) + && host_integerp (TYPE_SIZE_UNIT (type), 1) + && named) + { + /* The Irix 6 n32/n64 ABIs say that if any 64 bit chunk of the + structure contains a double in its entirety, then that 64 bit + chunk is passed in a floating point register. */ + tree field; + + /* First check to see if there is any such field. */ + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL + && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE + && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD + && host_integerp (bit_position (field), 0) + && int_bit_position (field) % BITS_PER_WORD == 0) + break; + + if (field != 0) + { + /* Now handle the special case by returning a PARALLEL + indicating where each 64 bit chunk goes. INFO.REG_WORDS + chunks are passed in registers. */ + unsigned int i; + HOST_WIDE_INT bitpos; + rtx ret; + + /* assign_parms checks the mode of ENTRY_PARM, so we must + use the actual mode here. */ + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (info.reg_words)); + + bitpos = 0; + field = TYPE_FIELDS (type); + for (i = 0; i < info.reg_words; i++) + { + rtx reg; + + for (; field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL + && int_bit_position (field) >= bitpos) + break; + + if (field + && int_bit_position (field) == bitpos + && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE + && !TARGET_SOFT_FLOAT + && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD) + reg = gen_rtx_REG (DFmode, FP_ARG_FIRST + info.reg_offset + i); + else + reg = gen_rtx_REG (DImode, GP_ARG_FIRST + info.reg_offset + i); + + XVECEXP (ret, 0, i) + = gen_rtx_EXPR_LIST (VOIDmode, reg, + GEN_INT (bitpos / BITS_PER_UNIT)); + + bitpos += BITS_PER_WORD; + } + return ret; + } + } + + /* Handle the n32/n64 conventions for passing complex floating-point + arguments in FPR pairs. The real part goes in the lower register + and the imaginary part goes in the upper register. */ + if (TARGET_NEWABI + && info.fpr_p + && GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) + { + rtx real, imag; + enum machine_mode inner; + int reg; + + inner = GET_MODE_INNER (mode); + reg = FP_ARG_FIRST + info.reg_offset; + if (info.reg_words * UNITS_PER_WORD == GET_MODE_SIZE (inner)) + { + /* Real part in registers, imaginary part on stack. */ + gcc_assert (info.stack_words == info.reg_words); + return gen_rtx_REG (inner, reg); + } + else + { + gcc_assert (info.stack_words == 0); + real = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (inner, reg), + const0_rtx); + imag = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (inner, + reg + info.reg_words / 2), + GEN_INT (GET_MODE_SIZE (inner))); + return gen_rtx_PARALLEL (mode, gen_rtvec (2, real, imag)); + } + } + + if (!info.fpr_p) + return gen_rtx_REG (mode, GP_ARG_FIRST + info.reg_offset); + else if (info.reg_offset == 1) + /* This code handles the special o32 case in which the second word + of the argument structure is passed in floating-point registers. */ + return gen_rtx_REG (mode, FP_ARG_FIRST + FP_INC); + else + return gen_rtx_REG (mode, FP_ARG_FIRST + info.reg_offset); +} + + +/* Implement TARGET_ARG_PARTIAL_BYTES. */ + +static int +mips_arg_partial_bytes (CUMULATIVE_ARGS *cum, + enum machine_mode mode, tree type, bool named) +{ + struct mips_arg_info info; + + mips_arg_info (cum, mode, type, named, &info); + return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0; +} + + +/* Implement FUNCTION_ARG_BOUNDARY. Every parameter gets at least + PARM_BOUNDARY bits of alignment, but will be given anything up + to STACK_BOUNDARY bits if the type requires it. */ + +int +function_arg_boundary (enum machine_mode mode, tree type) +{ + unsigned int alignment; + + alignment = type ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode); + if (alignment < PARM_BOUNDARY) + alignment = PARM_BOUNDARY; + if (alignment > STACK_BOUNDARY) + alignment = STACK_BOUNDARY; + return alignment; +} + +/* Return true if FUNCTION_ARG_PADDING (MODE, TYPE) should return + upward rather than downward. In other words, return true if the + first byte of the stack slot has useful data, false if the last + byte does. */ + +bool +mips_pad_arg_upward (enum machine_mode mode, tree type) +{ + /* On little-endian targets, the first byte of every stack argument + is passed in the first byte of the stack slot. */ + if (!BYTES_BIG_ENDIAN) + return true; + + /* Otherwise, integral types are padded downward: the last byte of a + stack argument is passed in the last byte of the stack slot. */ + if (type != 0 + ? INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type) + : GET_MODE_CLASS (mode) == MODE_INT) + return false; + + /* Big-endian o64 pads floating-point arguments downward. */ + if (mips_abi == ABI_O64) + if (type != 0 ? FLOAT_TYPE_P (type) : GET_MODE_CLASS (mode) == MODE_FLOAT) + return false; + + /* Other types are padded upward for o32, o64, n32 and n64. */ + if (mips_abi != ABI_EABI) + return true; + + /* Arguments smaller than a stack slot are padded downward. */ + if (mode != BLKmode) + return (GET_MODE_BITSIZE (mode) >= PARM_BOUNDARY); + else + return (int_size_in_bytes (type) >= (PARM_BOUNDARY / BITS_PER_UNIT)); +} + + +/* Likewise BLOCK_REG_PADDING (MODE, TYPE, ...). Return !BYTES_BIG_ENDIAN + if the least significant byte of the register has useful data. Return + the opposite if the most significant byte does. */ + +bool +mips_pad_reg_upward (enum machine_mode mode, tree type) +{ + /* No shifting is required for floating-point arguments. */ + if (type != 0 ? FLOAT_TYPE_P (type) : GET_MODE_CLASS (mode) == MODE_FLOAT) + return !BYTES_BIG_ENDIAN; + + /* Otherwise, apply the same padding to register arguments as we do + to stack arguments. */ + return mips_pad_arg_upward (mode, type); +} + +static void +mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int *pretend_size ATTRIBUTE_UNUSED, + int no_rtl) +{ + CUMULATIVE_ARGS local_cum; + int gp_saved, fp_saved; + + /* The caller has advanced CUM up to, but not beyond, the last named + argument. Advance a local copy of CUM past the last "real" named + argument, to find out how many registers are left over. */ + + local_cum = *cum; + FUNCTION_ARG_ADVANCE (local_cum, mode, type, 1); + + /* Found out how many registers we need to save. */ + gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs; + fp_saved = (EABI_FLOAT_VARARGS_P + ? MAX_ARGS_IN_REGISTERS - local_cum.num_fprs + : 0); + + if (!no_rtl) + { + if (gp_saved > 0) + { + rtx ptr, mem; + + ptr = plus_constant (virtual_incoming_args_rtx, + REG_PARM_STACK_SPACE (cfun->decl) + - gp_saved * UNITS_PER_WORD); + mem = gen_rtx_MEM (BLKmode, ptr); + set_mem_alias_set (mem, get_varargs_alias_set ()); + + move_block_from_reg (local_cum.num_gprs + GP_ARG_FIRST, + mem, gp_saved); + } + if (fp_saved > 0) + { + /* We can't use move_block_from_reg, because it will use + the wrong mode. */ + enum machine_mode mode; + int off, i; + + /* Set OFF to the offset from virtual_incoming_args_rtx of + the first float register. The FP save area lies below + the integer one, and is aligned to UNITS_PER_FPVALUE bytes. */ + off = -gp_saved * UNITS_PER_WORD; + off &= ~(UNITS_PER_FPVALUE - 1); + off -= fp_saved * UNITS_PER_FPREG; + + mode = TARGET_SINGLE_FLOAT ? SFmode : DFmode; + + for (i = local_cum.num_fprs; i < MAX_ARGS_IN_REGISTERS; i += FP_INC) + { + rtx ptr, mem; + + ptr = plus_constant (virtual_incoming_args_rtx, off); + mem = gen_rtx_MEM (mode, ptr); + set_mem_alias_set (mem, get_varargs_alias_set ()); + emit_move_insn (mem, gen_rtx_REG (mode, FP_ARG_FIRST + i)); + off += UNITS_PER_HWFPVALUE; + } + } + } + if (REG_PARM_STACK_SPACE (cfun->decl) == 0) + cfun->machine->varargs_size = (gp_saved * UNITS_PER_WORD + + fp_saved * UNITS_PER_FPREG); +} + +/* Create the va_list data type. + We keep 3 pointers, and two offsets. + Two pointers are to the overflow area, which starts at the CFA. + One of these is constant, for addressing into the GPR save area below it. + The other is advanced up the stack through the overflow region. + The third pointer is to the GPR save area. Since the FPR save area + is just below it, we can address FPR slots off this pointer. + We also keep two one-byte offsets, which are to be subtracted from the + constant pointers to yield addresses in the GPR and FPR save areas. + These are downcounted as float or non-float arguments are used, + and when they get to zero, the argument must be obtained from the + overflow region. + If !EABI_FLOAT_VARARGS_P, then no FPR save area exists, and a single + pointer is enough. It's started at the GPR save area, and is + advanced, period. + Note that the GPR save area is not constant size, due to optimization + in the prologue. Hence, we can't use a design with two pointers + and two offsets, although we could have designed this with two pointers + and three offsets. */ + +static tree +mips_build_builtin_va_list (void) +{ + if (EABI_FLOAT_VARARGS_P) + { + tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff, f_res, record; + tree array, index; + + record = (*lang_hooks.types.make_type) (RECORD_TYPE); + + f_ovfl = build_decl (FIELD_DECL, get_identifier ("__overflow_argptr"), + ptr_type_node); + f_gtop = build_decl (FIELD_DECL, get_identifier ("__gpr_top"), + ptr_type_node); + f_ftop = build_decl (FIELD_DECL, get_identifier ("__fpr_top"), + ptr_type_node); + f_goff = build_decl (FIELD_DECL, get_identifier ("__gpr_offset"), + unsigned_char_type_node); + f_foff = build_decl (FIELD_DECL, get_identifier ("__fpr_offset"), + unsigned_char_type_node); + /* Explicitly pad to the size of a pointer, so that -Wpadded won't + warn on every user file. */ + index = build_int_cst (NULL_TREE, GET_MODE_SIZE (ptr_mode) - 2 - 1); + array = build_array_type (unsigned_char_type_node, + build_index_type (index)); + f_res = build_decl (FIELD_DECL, get_identifier ("__reserved"), array); + + DECL_FIELD_CONTEXT (f_ovfl) = record; + DECL_FIELD_CONTEXT (f_gtop) = record; + DECL_FIELD_CONTEXT (f_ftop) = record; + DECL_FIELD_CONTEXT (f_goff) = record; + DECL_FIELD_CONTEXT (f_foff) = record; + DECL_FIELD_CONTEXT (f_res) = record; + + TYPE_FIELDS (record) = f_ovfl; + TREE_CHAIN (f_ovfl) = f_gtop; + TREE_CHAIN (f_gtop) = f_ftop; + TREE_CHAIN (f_ftop) = f_goff; + TREE_CHAIN (f_goff) = f_foff; + TREE_CHAIN (f_foff) = f_res; + + layout_type (record); + return record; + } + else if (TARGET_IRIX && TARGET_IRIX6) + /* On IRIX 6, this type is 'char *'. */ + return build_pointer_type (char_type_node); + else + /* Otherwise, we use 'void *'. */ + return ptr_type_node; +} + +/* Implement va_start. */ + +void +mips_va_start (tree valist, rtx nextarg) +{ + if (EABI_FLOAT_VARARGS_P) + { + const CUMULATIVE_ARGS *cum; + tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff; + tree ovfl, gtop, ftop, goff, foff; + tree t; + int gpr_save_area_size; + int fpr_save_area_size; + int fpr_offset; + + cum = ¤t_function_args_info; + gpr_save_area_size + = (MAX_ARGS_IN_REGISTERS - cum->num_gprs) * UNITS_PER_WORD; + fpr_save_area_size + = (MAX_ARGS_IN_REGISTERS - cum->num_fprs) * UNITS_PER_FPREG; + + f_ovfl = TYPE_FIELDS (va_list_type_node); + f_gtop = TREE_CHAIN (f_ovfl); + f_ftop = TREE_CHAIN (f_gtop); + f_goff = TREE_CHAIN (f_ftop); + f_foff = TREE_CHAIN (f_goff); + + ovfl = build3 (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl, + NULL_TREE); + gtop = build3 (COMPONENT_REF, TREE_TYPE (f_gtop), valist, f_gtop, + NULL_TREE); + ftop = build3 (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop, + NULL_TREE); + goff = build3 (COMPONENT_REF, TREE_TYPE (f_goff), valist, f_goff, + NULL_TREE); + foff = build3 (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff, + NULL_TREE); + + /* Emit code to initialize OVFL, which points to the next varargs + stack argument. CUM->STACK_WORDS gives the number of stack + words used by named arguments. */ + t = make_tree (TREE_TYPE (ovfl), virtual_incoming_args_rtx); + if (cum->stack_words > 0) + t = build2 (PLUS_EXPR, TREE_TYPE (ovfl), t, + build_int_cst (NULL_TREE, + cum->stack_words * UNITS_PER_WORD)); + t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t); + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + + /* Emit code to initialize GTOP, the top of the GPR save area. */ + t = make_tree (TREE_TYPE (gtop), virtual_incoming_args_rtx); + t = build2 (MODIFY_EXPR, TREE_TYPE (gtop), gtop, t); + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + + /* Emit code to initialize FTOP, the top of the FPR save area. + This address is gpr_save_area_bytes below GTOP, rounded + down to the next fp-aligned boundary. */ + t = make_tree (TREE_TYPE (ftop), virtual_incoming_args_rtx); + fpr_offset = gpr_save_area_size + UNITS_PER_FPVALUE - 1; + fpr_offset &= ~(UNITS_PER_FPVALUE - 1); + if (fpr_offset) + t = build2 (PLUS_EXPR, TREE_TYPE (ftop), t, + build_int_cst (NULL_TREE, -fpr_offset)); + t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t); + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + + /* Emit code to initialize GOFF, the offset from GTOP of the + next GPR argument. */ + t = build2 (MODIFY_EXPR, TREE_TYPE (goff), goff, + build_int_cst (NULL_TREE, gpr_save_area_size)); + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + + /* Likewise emit code to initialize FOFF, the offset from FTOP + of the next FPR argument. */ + t = build2 (MODIFY_EXPR, TREE_TYPE (foff), foff, + build_int_cst (NULL_TREE, fpr_save_area_size)); + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } + else + { + nextarg = plus_constant (nextarg, -cfun->machine->varargs_size); + std_expand_builtin_va_start (valist, nextarg); + } +} + +/* Implement va_arg. */ + +static tree +mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) +{ + HOST_WIDE_INT size, rsize; + tree addr; + bool indirect; + + indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0); + + if (indirect) + type = build_pointer_type (type); + + size = int_size_in_bytes (type); + rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; + + if (mips_abi != ABI_EABI || !EABI_FLOAT_VARARGS_P) + addr = std_gimplify_va_arg_expr (valist, type, pre_p, post_p); + else + { + /* Not a simple merged stack. */ + + tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff; + tree ovfl, top, off, align; + HOST_WIDE_INT osize; + tree t, u; + + f_ovfl = TYPE_FIELDS (va_list_type_node); + f_gtop = TREE_CHAIN (f_ovfl); + f_ftop = TREE_CHAIN (f_gtop); + f_goff = TREE_CHAIN (f_ftop); + f_foff = TREE_CHAIN (f_goff); + + /* We maintain separate pointers and offsets for floating-point + and integer arguments, but we need similar code in both cases. + Let: + + TOP be the top of the register save area; + OFF be the offset from TOP of the next register; + ADDR_RTX be the address of the argument; + RSIZE be the number of bytes used to store the argument + when it's in the register save area; + OSIZE be the number of bytes used to store it when it's + in the stack overflow area; and + PADDING be (BYTES_BIG_ENDIAN ? OSIZE - RSIZE : 0) + + The code we want is: + + 1: off &= -rsize; // round down + 2: if (off != 0) + 3: { + 4: addr_rtx = top - off; + 5: off -= rsize; + 6: } + 7: else + 8: { + 9: ovfl += ((intptr_t) ovfl + osize - 1) & -osize; + 10: addr_rtx = ovfl + PADDING; + 11: ovfl += osize; + 14: } + + [1] and [9] can sometimes be optimized away. */ + + ovfl = build3 (COMPONENT_REF, TREE_TYPE (f_ovfl), valist, f_ovfl, + NULL_TREE); + + if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_FLOAT + && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_FPVALUE) + { + top = build3 (COMPONENT_REF, TREE_TYPE (f_ftop), valist, f_ftop, + NULL_TREE); + off = build3 (COMPONENT_REF, TREE_TYPE (f_foff), valist, f_foff, + NULL_TREE); + + /* When floating-point registers are saved to the stack, + each one will take up UNITS_PER_HWFPVALUE bytes, regardless + of the float's precision. */ + rsize = UNITS_PER_HWFPVALUE; + + /* Overflow arguments are padded to UNITS_PER_WORD bytes + (= PARM_BOUNDARY bits). This can be different from RSIZE + in two cases: + + (1) On 32-bit targets when TYPE is a structure such as: + + struct s { float f; }; + + Such structures are passed in paired FPRs, so RSIZE + will be 8 bytes. However, the structure only takes + up 4 bytes of memory, so OSIZE will only be 4. + + (2) In combinations such as -mgp64 -msingle-float + -fshort-double. Doubles passed in registers + will then take up 4 (UNITS_PER_HWFPVALUE) bytes, + but those passed on the stack take up + UNITS_PER_WORD bytes. */ + osize = MAX (GET_MODE_SIZE (TYPE_MODE (type)), UNITS_PER_WORD); + } + else + { + top = build3 (COMPONENT_REF, TREE_TYPE (f_gtop), valist, f_gtop, + NULL_TREE); + off = build3 (COMPONENT_REF, TREE_TYPE (f_goff), valist, f_goff, + NULL_TREE); + if (rsize > UNITS_PER_WORD) + { + /* [1] Emit code for: off &= -rsize. */ + t = build2 (BIT_AND_EXPR, TREE_TYPE (off), off, + build_int_cst (NULL_TREE, -rsize)); + t = build2 (MODIFY_EXPR, TREE_TYPE (off), off, t); + gimplify_and_add (t, pre_p); + } + osize = rsize; + } + + /* [2] Emit code to branch if off == 0. */ + t = build2 (NE_EXPR, boolean_type_node, off, + build_int_cst (TREE_TYPE (off), 0)); + addr = build3 (COND_EXPR, ptr_type_node, t, NULL_TREE, NULL_TREE); + + /* [5] Emit code for: off -= rsize. We do this as a form of + post-increment not available to C. Also widen for the + coming pointer arithmetic. */ + t = fold_convert (TREE_TYPE (off), build_int_cst (NULL_TREE, rsize)); + t = build2 (POSTDECREMENT_EXPR, TREE_TYPE (off), off, t); + t = fold_convert (sizetype, t); + t = fold_convert (TREE_TYPE (top), t); + + /* [4] Emit code for: addr_rtx = top - off. On big endian machines, + the argument has RSIZE - SIZE bytes of leading padding. */ + t = build2 (MINUS_EXPR, TREE_TYPE (top), top, t); + if (BYTES_BIG_ENDIAN && rsize > size) + { + u = fold_convert (TREE_TYPE (t), build_int_cst (NULL_TREE, + rsize - size)); + t = build2 (PLUS_EXPR, TREE_TYPE (t), t, u); + } + COND_EXPR_THEN (addr) = t; + + if (osize > UNITS_PER_WORD) + { + /* [9] Emit: ovfl += ((intptr_t) ovfl + osize - 1) & -osize. */ + u = fold_convert (TREE_TYPE (ovfl), + build_int_cst (NULL_TREE, osize - 1)); + t = build2 (PLUS_EXPR, TREE_TYPE (ovfl), ovfl, u); + u = fold_convert (TREE_TYPE (ovfl), + build_int_cst (NULL_TREE, -osize)); + t = build2 (BIT_AND_EXPR, TREE_TYPE (ovfl), t, u); + align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t); + } + else + align = NULL; + + /* [10, 11]. Emit code to store ovfl in addr_rtx, then + post-increment ovfl by osize. On big-endian machines, + the argument has OSIZE - SIZE bytes of leading padding. */ + u = fold_convert (TREE_TYPE (ovfl), + build_int_cst (NULL_TREE, osize)); + t = build2 (POSTINCREMENT_EXPR, TREE_TYPE (ovfl), ovfl, u); + if (BYTES_BIG_ENDIAN && osize > size) + { + u = fold_convert (TREE_TYPE (t), + build_int_cst (NULL_TREE, osize - size)); + t = build2 (PLUS_EXPR, TREE_TYPE (t), t, u); + } + + /* String [9] and [10,11] together. */ + if (align) + t = build2 (COMPOUND_EXPR, TREE_TYPE (t), align, t); + COND_EXPR_ELSE (addr) = t; + + addr = fold_convert (build_pointer_type (type), addr); + addr = build_va_arg_indirect_ref (addr); + } + + if (indirect) + addr = build_va_arg_indirect_ref (addr); + + return addr; +} + +/* Return true if it is possible to use left/right accesses for a + bitfield of WIDTH bits starting BITPOS bits into *OP. When + returning true, update *OP, *LEFT and *RIGHT as follows: + + *OP is a BLKmode reference to the whole field. + + *LEFT is a QImode reference to the first byte if big endian or + the last byte if little endian. This address can be used in the + left-side instructions (lwl, swl, ldl, sdl). + + *RIGHT is a QImode reference to the opposite end of the field and + can be used in the patterning right-side instruction. */ + +static bool +mips_get_unaligned_mem (rtx *op, unsigned int width, int bitpos, + rtx *left, rtx *right) +{ + rtx first, last; + + /* Check that the operand really is a MEM. Not all the extv and + extzv predicates are checked. */ + if (!MEM_P (*op)) + return false; + + /* Check that the size is valid. */ + if (width != 32 && (!TARGET_64BIT || width != 64)) + return false; + + /* We can only access byte-aligned values. Since we are always passed + a reference to the first byte of the field, it is not necessary to + do anything with BITPOS after this check. */ + if (bitpos % BITS_PER_UNIT != 0) + return false; + + /* Reject aligned bitfields: we want to use a normal load or store + instead of a left/right pair. */ + if (MEM_ALIGN (*op) >= width) + return false; + + /* Adjust *OP to refer to the whole field. This also has the effect + of legitimizing *OP's address for BLKmode, possibly simplifying it. */ + *op = adjust_address (*op, BLKmode, 0); + set_mem_size (*op, GEN_INT (width / BITS_PER_UNIT)); + + /* Get references to both ends of the field. We deliberately don't + use the original QImode *OP for FIRST since the new BLKmode one + might have a simpler address. */ + first = adjust_address (*op, QImode, 0); + last = adjust_address (*op, QImode, width / BITS_PER_UNIT - 1); + + /* Allocate to LEFT and RIGHT according to endianness. LEFT should + be the upper word and RIGHT the lower word. */ + if (TARGET_BIG_ENDIAN) + *left = first, *right = last; + else + *left = last, *right = first; + + return true; +} + + +/* Try to emit the equivalent of (set DEST (zero_extract SRC WIDTH BITPOS)). + Return true on success. We only handle cases where zero_extract is + equivalent to sign_extract. */ + +bool +mips_expand_unaligned_load (rtx dest, rtx src, unsigned int width, int bitpos) +{ + rtx left, right, temp; + + /* If TARGET_64BIT, the destination of a 32-bit load will be a + paradoxical word_mode subreg. This is the only case in which + we allow the destination to be larger than the source. */ + if (GET_CODE (dest) == SUBREG + && GET_MODE (dest) == DImode + && SUBREG_BYTE (dest) == 0 + && GET_MODE (SUBREG_REG (dest)) == SImode) + dest = SUBREG_REG (dest); + + /* After the above adjustment, the destination must be the same + width as the source. */ + if (GET_MODE_BITSIZE (GET_MODE (dest)) != width) + return false; + + if (!mips_get_unaligned_mem (&src, width, bitpos, &left, &right)) + return false; + + temp = gen_reg_rtx (GET_MODE (dest)); + if (GET_MODE (dest) == DImode) + { + emit_insn (gen_mov_ldl (temp, src, left)); + emit_insn (gen_mov_ldr (dest, copy_rtx (src), right, temp)); + } + else + { + emit_insn (gen_mov_lwl (temp, src, left)); + emit_insn (gen_mov_lwr (dest, copy_rtx (src), right, temp)); + } + return true; +} + + +/* Try to expand (set (zero_extract DEST WIDTH BITPOS) SRC). Return + true on success. */ + +bool +mips_expand_unaligned_store (rtx dest, rtx src, unsigned int width, int bitpos) +{ + rtx left, right; + enum machine_mode mode; + + if (!mips_get_unaligned_mem (&dest, width, bitpos, &left, &right)) + return false; + + mode = mode_for_size (width, MODE_INT, 0); + src = gen_lowpart (mode, src); + + if (mode == DImode) + { + emit_insn (gen_mov_sdl (dest, src, left)); + emit_insn (gen_mov_sdr (copy_rtx (dest), copy_rtx (src), right)); + } + else + { + emit_insn (gen_mov_swl (dest, src, left)); + emit_insn (gen_mov_swr (copy_rtx (dest), copy_rtx (src), right)); + } + return true; +} + +/* Return true if X is a MEM with the same size as MODE. */ + +bool +mips_mem_fits_mode_p (enum machine_mode mode, rtx x) +{ + rtx size; + + if (!MEM_P (x)) + return false; + + size = MEM_SIZE (x); + return size && INTVAL (size) == GET_MODE_SIZE (mode); +} + +/* Return true if (zero_extract OP SIZE POSITION) can be used as the + source of an "ext" instruction or the destination of an "ins" + instruction. OP must be a register operand and the following + conditions must hold: + + 0 <= POSITION < GET_MODE_BITSIZE (GET_MODE (op)) + 0 < SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) + 0 < POSITION + SIZE <= GET_MODE_BITSIZE (GET_MODE (op)) + + Also reject lengths equal to a word as they are better handled + by the move patterns. */ + +bool +mips_use_ins_ext_p (rtx op, rtx size, rtx position) +{ + HOST_WIDE_INT len, pos; + + if (!ISA_HAS_EXT_INS + || !register_operand (op, VOIDmode) + || GET_MODE_BITSIZE (GET_MODE (op)) > BITS_PER_WORD) + return false; + + len = INTVAL (size); + pos = INTVAL (position); + + if (len <= 0 || len >= GET_MODE_BITSIZE (GET_MODE (op)) + || pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (op))) + return false; + + return true; +} + +/* Set up globals to generate code for the ISA or processor + described by INFO. */ + +static void +mips_set_architecture (const struct mips_cpu_info *info) +{ + if (info != 0) + { + mips_arch_info = info; + mips_arch = info->cpu; + mips_isa = info->isa; + } +} + + +/* Likewise for tuning. */ + +static void +mips_set_tune (const struct mips_cpu_info *info) +{ + if (info != 0) + { + mips_tune_info = info; + mips_tune = info->cpu; + } +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mabi_: + if (strcmp (arg, "32") == 0) + mips_abi = ABI_32; + else if (strcmp (arg, "o64") == 0) + mips_abi = ABI_O64; + else if (strcmp (arg, "n32") == 0) + mips_abi = ABI_N32; + else if (strcmp (arg, "64") == 0) + mips_abi = ABI_64; + else if (strcmp (arg, "eabi") == 0) + mips_abi = ABI_EABI; + else + return false; + return true; + + case OPT_march_: + case OPT_mtune_: + return mips_parse_cpu (arg) != 0; + + case OPT_mips: + mips_isa_info = mips_parse_cpu (ACONCAT (("mips", arg, NULL))); + return mips_isa_info != 0; + + case OPT_mno_flush_func: + mips_cache_flush_func = NULL; + return true; + + default: + return true; + } +} + +/* Set up the threshold for data to go into the small data area, instead + of the normal data area, and detect any conflicts in the switches. */ + +void +override_options (void) +{ + int i, start, regno; + enum machine_mode mode; + + mips_section_threshold = g_switch_set ? g_switch_value : MIPS_DEFAULT_GVALUE; + + /* The following code determines the architecture and register size. + Similar code was added to GAS 2.14 (see tc-mips.c:md_after_parse_args()). + The GAS and GCC code should be kept in sync as much as possible. */ + + if (mips_arch_string != 0) + mips_set_architecture (mips_parse_cpu (mips_arch_string)); + + if (mips_isa_info != 0) + { + if (mips_arch_info == 0) + mips_set_architecture (mips_isa_info); + else if (mips_arch_info->isa != mips_isa_info->isa) + error ("-%s conflicts with the other architecture options, " + "which specify a %s processor", + mips_isa_info->name, + mips_cpu_info_from_isa (mips_arch_info->isa)->name); + } + + if (mips_arch_info == 0) + { +#ifdef MIPS_CPU_STRING_DEFAULT + mips_set_architecture (mips_parse_cpu (MIPS_CPU_STRING_DEFAULT)); +#else + mips_set_architecture (mips_cpu_info_from_isa (MIPS_ISA_DEFAULT)); +#endif + } + + if (ABI_NEEDS_64BIT_REGS && !ISA_HAS_64BIT_REGS) + error ("-march=%s is not compatible with the selected ABI", + mips_arch_info->name); + + /* Optimize for mips_arch, unless -mtune selects a different processor. */ + if (mips_tune_string != 0) + mips_set_tune (mips_parse_cpu (mips_tune_string)); + + if (mips_tune_info == 0) + mips_set_tune (mips_arch_info); + + /* Set cost structure for the processor. */ + mips_cost = &mips_rtx_cost_data[mips_tune]; + + if ((target_flags_explicit & MASK_64BIT) != 0) + { + /* The user specified the size of the integer registers. Make sure + it agrees with the ABI and ISA. */ + if (TARGET_64BIT && !ISA_HAS_64BIT_REGS) + error ("-mgp64 used with a 32-bit processor"); + else if (!TARGET_64BIT && ABI_NEEDS_64BIT_REGS) + error ("-mgp32 used with a 64-bit ABI"); + else if (TARGET_64BIT && ABI_NEEDS_32BIT_REGS) + error ("-mgp64 used with a 32-bit ABI"); + } + else + { + /* Infer the integer register size from the ABI and processor. + Restrict ourselves to 32-bit registers if that's all the + processor has, or if the ABI cannot handle 64-bit registers. */ + if (ABI_NEEDS_32BIT_REGS || !ISA_HAS_64BIT_REGS) + target_flags &= ~MASK_64BIT; + else + target_flags |= MASK_64BIT; + } + + if ((target_flags_explicit & MASK_FLOAT64) != 0) + { + /* Really, -mfp32 and -mfp64 are ornamental options. There's + only one right answer here. */ + if (TARGET_64BIT && TARGET_DOUBLE_FLOAT && !TARGET_FLOAT64) + error ("unsupported combination: %s", "-mgp64 -mfp32 -mdouble-float"); + else if (!TARGET_64BIT && TARGET_FLOAT64) + error ("unsupported combination: %s", "-mgp32 -mfp64"); + else if (TARGET_SINGLE_FLOAT && TARGET_FLOAT64) + error ("unsupported combination: %s", "-mfp64 -msingle-float"); + } + else + { + /* -msingle-float selects 32-bit float registers. Otherwise the + float registers should be the same size as the integer ones. */ + if (TARGET_64BIT && TARGET_DOUBLE_FLOAT) + target_flags |= MASK_FLOAT64; + else + target_flags &= ~MASK_FLOAT64; + } + + /* End of code shared with GAS. */ + + if ((target_flags_explicit & MASK_LONG64) == 0) + { + if ((mips_abi == ABI_EABI && TARGET_64BIT) || mips_abi == ABI_64) + target_flags |= MASK_LONG64; + else + target_flags &= ~MASK_LONG64; + } + + if (MIPS_MARCH_CONTROLS_SOFT_FLOAT + && (target_flags_explicit & MASK_SOFT_FLOAT) == 0) + { + /* For some configurations, it is useful to have -march control + the default setting of MASK_SOFT_FLOAT. */ + switch ((int) mips_arch) + { + case PROCESSOR_R4100: + case PROCESSOR_R4111: + case PROCESSOR_R4120: + case PROCESSOR_R4130: + target_flags |= MASK_SOFT_FLOAT; + break; + + default: + target_flags &= ~MASK_SOFT_FLOAT; + break; + } + } + + if (!TARGET_OLDABI) + flag_pcc_struct_return = 0; + + if ((target_flags_explicit & MASK_BRANCHLIKELY) == 0) + { + /* If neither -mbranch-likely nor -mno-branch-likely was given + on the command line, set MASK_BRANCHLIKELY based on the target + architecture. + + By default, we enable use of Branch Likely instructions on + all architectures which support them with the following + exceptions: when creating MIPS32 or MIPS64 code, and when + tuning for architectures where their use tends to hurt + performance. + + The MIPS32 and MIPS64 architecture specifications say "Software + is strongly encouraged to avoid use of Branch Likely + instructions, as they will be removed from a future revision + of the [MIPS32 and MIPS64] architecture." Therefore, we do not + issue those instructions unless instructed to do so by + -mbranch-likely. */ + if (ISA_HAS_BRANCHLIKELY + && !(ISA_MIPS32 || ISA_MIPS32R2 || ISA_MIPS64) + && !(TUNE_MIPS5500 || TUNE_SB1)) + target_flags |= MASK_BRANCHLIKELY; + else + target_flags &= ~MASK_BRANCHLIKELY; + } + if (TARGET_BRANCHLIKELY && !ISA_HAS_BRANCHLIKELY) + warning (0, "generation of Branch Likely instructions enabled, but not supported by architecture"); + + /* The effect of -mabicalls isn't defined for the EABI. */ + if (mips_abi == ABI_EABI && TARGET_ABICALLS) + { + error ("unsupported combination: %s", "-mabicalls -mabi=eabi"); + target_flags &= ~MASK_ABICALLS; + } + + if (TARGET_ABICALLS) + { + /* We need to set flag_pic for executables as well as DSOs + because we may reference symbols that are not defined in + the final executable. (MIPS does not use things like + copy relocs, for example.) + + Also, there is a body of code that uses __PIC__ to distinguish + between -mabicalls and -mno-abicalls code. */ + flag_pic = 1; + if (mips_section_threshold > 0) + warning (0, "%<-G%> is incompatible with %<-mabicalls%>"); + } + + /* mips_split_addresses is a half-way house between explicit + relocations and the traditional assembler macros. It can + split absolute 32-bit symbolic constants into a high/lo_sum + pair but uses macros for other sorts of access. + + Like explicit relocation support for REL targets, it relies + on GNU extensions in the assembler and the linker. + + Although this code should work for -O0, it has traditionally + been treated as an optimization. */ + if (!TARGET_MIPS16 && TARGET_SPLIT_ADDRESSES + && optimize && !flag_pic + && !ABI_HAS_64BIT_SYMBOLS) + mips_split_addresses = 1; + else + mips_split_addresses = 0; + + /* -mvr4130-align is a "speed over size" optimization: it usually produces + faster code, but at the expense of more nops. Enable it at -O3 and + above. */ + if (optimize > 2 && (target_flags_explicit & MASK_VR4130_ALIGN) == 0) + target_flags |= MASK_VR4130_ALIGN; + + /* When compiling for the mips16, we cannot use floating point. We + record the original hard float value in mips16_hard_float. */ + if (TARGET_MIPS16) + { + if (TARGET_SOFT_FLOAT) + mips16_hard_float = 0; + else + mips16_hard_float = 1; + target_flags |= MASK_SOFT_FLOAT; + + /* Don't run the scheduler before reload, since it tends to + increase register pressure. */ + flag_schedule_insns = 0; + + /* Don't do hot/cold partitioning. The constant layout code expects + the whole function to be in a single section. */ + flag_reorder_blocks_and_partition = 0; + + /* Silently disable -mexplicit-relocs since it doesn't apply + to mips16 code. Even so, it would overly pedantic to warn + about "-mips16 -mexplicit-relocs", especially given that + we use a %gprel() operator. */ + target_flags &= ~MASK_EXPLICIT_RELOCS; + } + + /* When using explicit relocs, we call dbr_schedule from within + mips_reorg. */ + if (TARGET_EXPLICIT_RELOCS) + { + mips_flag_delayed_branch = flag_delayed_branch; + flag_delayed_branch = 0; + } + +#ifdef MIPS_TFMODE_FORMAT + REAL_MODE_FORMAT (TFmode) = &MIPS_TFMODE_FORMAT; +#endif + + /* Make sure that the user didn't turn off paired single support when + MIPS-3D support is requested. */ + if (TARGET_MIPS3D && (target_flags_explicit & MASK_PAIRED_SINGLE_FLOAT) + && !TARGET_PAIRED_SINGLE_FLOAT) + error ("-mips3d requires -mpaired-single"); + + /* If TARGET_MIPS3D, enable MASK_PAIRED_SINGLE_FLOAT. */ + if (TARGET_MIPS3D) + target_flags |= MASK_PAIRED_SINGLE_FLOAT; + + /* Make sure that when TARGET_PAIRED_SINGLE_FLOAT is true, TARGET_FLOAT64 + and TARGET_HARD_FLOAT are both true. */ + if (TARGET_PAIRED_SINGLE_FLOAT && !(TARGET_FLOAT64 && TARGET_HARD_FLOAT)) + error ("-mips3d/-mpaired-single must be used with -mfp64 -mhard-float"); + + /* Make sure that the ISA supports TARGET_PAIRED_SINGLE_FLOAT when it is + enabled. */ + if (TARGET_PAIRED_SINGLE_FLOAT && !ISA_MIPS64) + error ("-mips3d/-mpaired-single must be used with -mips64"); + + if (TARGET_MIPS16 && TARGET_DSP) + error ("-mips16 and -mdsp cannot be used together"); + + mips_print_operand_punct['?'] = 1; + mips_print_operand_punct['#'] = 1; + mips_print_operand_punct['/'] = 1; + mips_print_operand_punct['&'] = 1; + mips_print_operand_punct['!'] = 1; + mips_print_operand_punct['*'] = 1; + mips_print_operand_punct['@'] = 1; + mips_print_operand_punct['.'] = 1; + mips_print_operand_punct['('] = 1; + mips_print_operand_punct[')'] = 1; + mips_print_operand_punct['['] = 1; + mips_print_operand_punct[']'] = 1; + mips_print_operand_punct['<'] = 1; + mips_print_operand_punct['>'] = 1; + mips_print_operand_punct['{'] = 1; + mips_print_operand_punct['}'] = 1; + mips_print_operand_punct['^'] = 1; + mips_print_operand_punct['$'] = 1; + mips_print_operand_punct['+'] = 1; + mips_print_operand_punct['~'] = 1; + + /* Set up array to map GCC register number to debug register number. + Ignore the special purpose register numbers. */ + + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + mips_dbx_regno[i] = -1; + + start = GP_DBX_FIRST - GP_REG_FIRST; + for (i = GP_REG_FIRST; i <= GP_REG_LAST; i++) + mips_dbx_regno[i] = i + start; + + start = FP_DBX_FIRST - FP_REG_FIRST; + for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++) + mips_dbx_regno[i] = i + start; + + mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0; + mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1; + + /* Set up array giving whether a given register can hold a given mode. */ + + for (mode = VOIDmode; + mode != MAX_MACHINE_MODE; + mode = (enum machine_mode) ((int)mode + 1)) + { + register int size = GET_MODE_SIZE (mode); + register enum mode_class class = GET_MODE_CLASS (mode); + + for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) + { + register int temp; + + if (mode == CCV2mode) + temp = (ISA_HAS_8CC + && ST_REG_P (regno) + && (regno - ST_REG_FIRST) % 2 == 0); + + else if (mode == CCV4mode) + temp = (ISA_HAS_8CC + && ST_REG_P (regno) + && (regno - ST_REG_FIRST) % 4 == 0); + + else if (mode == CCmode) + { + if (! ISA_HAS_8CC) + temp = (regno == FPSW_REGNUM); + else + temp = (ST_REG_P (regno) || GP_REG_P (regno) + || FP_REG_P (regno)); + } + + else if (GP_REG_P (regno)) + temp = ((regno & 1) == 0 || size <= UNITS_PER_WORD); + + else if (FP_REG_P (regno)) + temp = ((regno % FP_INC) == 0) + && (((class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT + || class == MODE_VECTOR_FLOAT) + && size <= UNITS_PER_FPVALUE) + /* Allow integer modes that fit into a single + register. We need to put integers into FPRs + when using instructions like cvt and trunc. + We can't allow sizes smaller than a word, + the FPU has no appropriate load/store + instructions for those. */ + || (class == MODE_INT + && size >= MIN_UNITS_PER_WORD + && size <= UNITS_PER_FPREG) + /* Allow TFmode for CCmode reloads. */ + || (ISA_HAS_8CC && mode == TFmode)); + + else if (ACC_REG_P (regno)) + temp = (INTEGRAL_MODE_P (mode) + && (size <= UNITS_PER_WORD + || (ACC_HI_REG_P (regno) + && size == 2 * UNITS_PER_WORD))); + + else if (ALL_COP_REG_P (regno)) + temp = (class == MODE_INT && size <= UNITS_PER_WORD); + else + temp = 0; + + mips_hard_regno_mode_ok[(int)mode][regno] = temp; + } + } + + /* Save GPR registers in word_mode sized hunks. word_mode hasn't been + initialized yet, so we can't use that here. */ + gpr_mode = TARGET_64BIT ? DImode : SImode; + + /* Provide default values for align_* for 64-bit targets. */ + if (TARGET_64BIT && !TARGET_MIPS16) + { + if (align_loops == 0) + align_loops = 8; + if (align_jumps == 0) + align_jumps = 8; + if (align_functions == 0) + align_functions = 8; + } + + /* Function to allocate machine-dependent function status. */ + init_machine_status = &mips_init_machine_status; + + if (ABI_HAS_64BIT_SYMBOLS) + { + if (TARGET_EXPLICIT_RELOCS) + { + mips_split_p[SYMBOL_64_HIGH] = true; + mips_hi_relocs[SYMBOL_64_HIGH] = "%highest("; + mips_lo_relocs[SYMBOL_64_HIGH] = "%higher("; + + mips_split_p[SYMBOL_64_MID] = true; + mips_hi_relocs[SYMBOL_64_MID] = "%higher("; + mips_lo_relocs[SYMBOL_64_MID] = "%hi("; + + mips_split_p[SYMBOL_64_LOW] = true; + mips_hi_relocs[SYMBOL_64_LOW] = "%hi("; + mips_lo_relocs[SYMBOL_64_LOW] = "%lo("; + + mips_split_p[SYMBOL_GENERAL] = true; + mips_lo_relocs[SYMBOL_GENERAL] = "%lo("; + } + } + else + { + if (TARGET_EXPLICIT_RELOCS || mips_split_addresses) + { + mips_split_p[SYMBOL_GENERAL] = true; + mips_hi_relocs[SYMBOL_GENERAL] = "%hi("; + mips_lo_relocs[SYMBOL_GENERAL] = "%lo("; + } + } + + if (TARGET_MIPS16) + { + /* The high part is provided by a pseudo copy of $gp. */ + mips_split_p[SYMBOL_SMALL_DATA] = true; + mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gprel("; + } + + if (TARGET_EXPLICIT_RELOCS) + { + /* Small data constants are kept whole until after reload, + then lowered by mips_rewrite_small_data. */ + mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gp_rel("; + + mips_split_p[SYMBOL_GOT_LOCAL] = true; + if (TARGET_NEWABI) + { + mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got_page("; + mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%got_ofst("; + } + else + { + mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got("; + mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%lo("; + } + + if (TARGET_XGOT) + { + /* The HIGH and LO_SUM are matched by special .md patterns. */ + mips_split_p[SYMBOL_GOT_GLOBAL] = true; + + mips_split_p[SYMBOL_GOTOFF_GLOBAL] = true; + mips_hi_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_hi("; + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_lo("; + + mips_split_p[SYMBOL_GOTOFF_CALL] = true; + mips_hi_relocs[SYMBOL_GOTOFF_CALL] = "%call_hi("; + mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call_lo("; + } + else + { + if (TARGET_NEWABI) + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_disp("; + else + mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got("; + mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call16("; + } + } + + if (TARGET_NEWABI) + { + mips_split_p[SYMBOL_GOTOFF_LOADGP] = true; + mips_hi_relocs[SYMBOL_GOTOFF_LOADGP] = "%hi(%neg(%gp_rel("; + mips_lo_relocs[SYMBOL_GOTOFF_LOADGP] = "%lo(%neg(%gp_rel("; + } + + /* Thread-local relocation operators. */ + mips_lo_relocs[SYMBOL_TLSGD] = "%tlsgd("; + mips_lo_relocs[SYMBOL_TLSLDM] = "%tlsldm("; + mips_split_p[SYMBOL_DTPREL] = 1; + mips_hi_relocs[SYMBOL_DTPREL] = "%dtprel_hi("; + mips_lo_relocs[SYMBOL_DTPREL] = "%dtprel_lo("; + mips_lo_relocs[SYMBOL_GOTTPREL] = "%gottprel("; + mips_split_p[SYMBOL_TPREL] = 1; + mips_hi_relocs[SYMBOL_TPREL] = "%tprel_hi("; + mips_lo_relocs[SYMBOL_TPREL] = "%tprel_lo("; + + /* We don't have a thread pointer access instruction on MIPS16, or + appropriate TLS relocations. */ + if (TARGET_MIPS16) + targetm.have_tls = false; + + /* Default to working around R4000 errata only if the processor + was selected explicitly. */ + if ((target_flags_explicit & MASK_FIX_R4000) == 0 + && mips_matching_cpu_name_p (mips_arch_info->name, "r4000")) + target_flags |= MASK_FIX_R4000; + + /* Default to working around R4400 errata only if the processor + was selected explicitly. */ + if ((target_flags_explicit & MASK_FIX_R4400) == 0 + && mips_matching_cpu_name_p (mips_arch_info->name, "r4400")) + target_flags |= MASK_FIX_R4400; +} + +/* Implement CONDITIONAL_REGISTER_USAGE. */ + +void +mips_conditional_register_usage (void) +{ + if (!TARGET_DSP) + { + int regno; + + for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + } + if (!TARGET_HARD_FLOAT) + { + int regno; + + for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + } + else if (! ISA_HAS_8CC) + { + int regno; + + /* We only have a single condition code register. We + implement this by hiding all the condition code registers, + and generating RTL that refers directly to ST_REG_FIRST. */ + for (regno = ST_REG_FIRST; regno <= ST_REG_LAST; regno++) + fixed_regs[regno] = call_used_regs[regno] = 1; + } + /* In mips16 mode, we permit the $t temporary registers to be used + for reload. We prohibit the unused $s registers, since they + are caller saved, and saving them via a mips16 register would + probably waste more time than just reloading the value. */ + if (TARGET_MIPS16) + { + fixed_regs[18] = call_used_regs[18] = 1; + fixed_regs[19] = call_used_regs[19] = 1; + fixed_regs[20] = call_used_regs[20] = 1; + fixed_regs[21] = call_used_regs[21] = 1; + fixed_regs[22] = call_used_regs[22] = 1; + fixed_regs[23] = call_used_regs[23] = 1; + fixed_regs[26] = call_used_regs[26] = 1; + fixed_regs[27] = call_used_regs[27] = 1; + fixed_regs[30] = call_used_regs[30] = 1; + } + /* fp20-23 are now caller saved. */ + if (mips_abi == ABI_64) + { + int regno; + for (regno = FP_REG_FIRST + 20; regno < FP_REG_FIRST + 24; regno++) + call_really_used_regs[regno] = call_used_regs[regno] = 1; + } + /* Odd registers from fp21 to fp31 are now caller saved. */ + if (mips_abi == ABI_N32) + { + int regno; + for (regno = FP_REG_FIRST + 21; regno <= FP_REG_FIRST + 31; regno+=2) + call_really_used_regs[regno] = call_used_regs[regno] = 1; + } +} + +/* Allocate a chunk of memory for per-function machine-dependent data. */ +static struct machine_function * +mips_init_machine_status (void) +{ + return ((struct machine_function *) + ggc_alloc_cleared (sizeof (struct machine_function))); +} + +/* On the mips16, we want to allocate $24 (T_REG) before other + registers for instructions for which it is possible. This helps + avoid shuffling registers around in order to set up for an xor, + encouraging the compiler to use a cmp instead. */ + +void +mips_order_regs_for_local_alloc (void) +{ + register int i; + + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + reg_alloc_order[i] = i; + + if (TARGET_MIPS16) + { + /* It really doesn't matter where we put register 0, since it is + a fixed register anyhow. */ + reg_alloc_order[0] = 24; + reg_alloc_order[24] = 0; + } +} + + +/* The MIPS debug format wants all automatic variables and arguments + to be in terms of the virtual frame pointer (stack pointer before + any adjustment in the function), while the MIPS 3.0 linker wants + the frame pointer to be the stack pointer after the initial + adjustment. So, we do the adjustment here. The arg pointer (which + is eliminated) points to the virtual frame pointer, while the frame + pointer (which may be eliminated) points to the stack pointer after + the initial adjustments. */ + +HOST_WIDE_INT +mips_debugger_offset (rtx addr, HOST_WIDE_INT offset) +{ + rtx offset2 = const0_rtx; + rtx reg = eliminate_constant_term (addr, &offset2); + + if (offset == 0) + offset = INTVAL (offset2); + + if (reg == stack_pointer_rtx || reg == frame_pointer_rtx + || reg == hard_frame_pointer_rtx) + { + HOST_WIDE_INT frame_size = (!cfun->machine->frame.initialized) + ? compute_frame_size (get_frame_size ()) + : cfun->machine->frame.total_size; + + /* MIPS16 frame is smaller */ + if (frame_pointer_needed && TARGET_MIPS16) + frame_size -= cfun->machine->frame.args_size; + + offset = offset - frame_size; + } + + /* sdbout_parms does not want this to crash for unrecognized cases. */ +#if 0 + else if (reg != arg_pointer_rtx) + fatal_insn ("mips_debugger_offset called with non stack/frame/arg pointer", + addr); +#endif + + return offset; +} + +/* Implement the PRINT_OPERAND macro. The MIPS-specific operand codes are: + + 'X' OP is CONST_INT, prints 32 bits in hexadecimal format = "0x%08x", + 'x' OP is CONST_INT, prints 16 bits in hexadecimal format = "0x%04x", + 'h' OP is HIGH, prints %hi(X), + 'd' output integer constant in decimal, + 'z' if the operand is 0, use $0 instead of normal operand. + 'D' print second part of double-word register or memory operand. + 'L' print low-order register of double-word register operand. + 'M' print high-order register of double-word register operand. + 'C' print part of opcode for a branch condition. + 'F' print part of opcode for a floating-point branch condition. + 'N' print part of opcode for a branch condition, inverted. + 'W' print part of opcode for a floating-point branch condition, inverted. + 'T' print 'f' for (eq:CC ...), 't' for (ne:CC ...), + 'z' for (eq:?I ...), 'n' for (ne:?I ...). + 't' like 'T', but with the EQ/NE cases reversed + 'Y' for a CONST_INT X, print mips_fp_conditions[X] + 'Z' print the operand and a comma for ISA_HAS_8CC, otherwise print nothing + 'R' print the reloc associated with LO_SUM + 'q' print DSP accumulator registers + + The punctuation characters are: + + '(' Turn on .set noreorder + ')' Turn on .set reorder + '[' Turn on .set noat + ']' Turn on .set at + '<' Turn on .set nomacro + '>' Turn on .set macro + '{' Turn on .set volatile (not GAS) + '}' Turn on .set novolatile (not GAS) + '&' Turn on .set noreorder if filling delay slots + '*' Turn on both .set noreorder and .set nomacro if filling delay slots + '!' Turn on .set nomacro if filling delay slots + '#' Print nop if in a .set noreorder section. + '/' Like '#', but does nothing within a delayed branch sequence + '?' Print 'l' if we are to use a branch likely instead of normal branch. + '@' Print the name of the assembler temporary register (at or $1). + '.' Print the name of the register with a hard-wired zero (zero or $0). + '^' Print the name of the pic call-through register (t9 or $25). + '$' Print the name of the stack pointer register (sp or $29). + '+' Print the name of the gp register (usually gp or $28). + '~' Output a branch alignment to LABEL_ALIGN(NULL). */ + +void +print_operand (FILE *file, rtx op, int letter) +{ + register enum rtx_code code; + + if (PRINT_OPERAND_PUNCT_VALID_P (letter)) + { + switch (letter) + { + case '?': + if (mips_branch_likely) + putc ('l', file); + break; + + case '@': + fputs (reg_names [GP_REG_FIRST + 1], file); + break; + + case '^': + fputs (reg_names [PIC_FUNCTION_ADDR_REGNUM], file); + break; + + case '.': + fputs (reg_names [GP_REG_FIRST + 0], file); + break; + + case '$': + fputs (reg_names[STACK_POINTER_REGNUM], file); + break; + + case '+': + fputs (reg_names[PIC_OFFSET_TABLE_REGNUM], file); + break; + + case '&': + if (final_sequence != 0 && set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); + break; + + case '*': + if (final_sequence != 0) + { + if (set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); + + if (set_nomacro++ == 0) + fputs (".set\tnomacro\n\t", file); + } + break; + + case '!': + if (final_sequence != 0 && set_nomacro++ == 0) + fputs ("\n\t.set\tnomacro", file); + break; + + case '#': + if (set_noreorder != 0) + fputs ("\n\tnop", file); + break; + + case '/': + /* Print an extra newline so that the delayed insn is separated + from the following ones. This looks neater and is consistent + with non-nop delayed sequences. */ + if (set_noreorder != 0 && final_sequence == 0) + fputs ("\n\tnop\n", file); + break; + + case '(': + if (set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); + break; + + case ')': + if (set_noreorder == 0) + error ("internal error: %%) found without a %%( in assembler pattern"); + + else if (--set_noreorder == 0) + fputs ("\n\t.set\treorder", file); + + break; + + case '[': + if (set_noat++ == 0) + fputs (".set\tnoat\n\t", file); + break; + + case ']': + if (set_noat == 0) + error ("internal error: %%] found without a %%[ in assembler pattern"); + else if (--set_noat == 0) + fputs ("\n\t.set\tat", file); + + break; + + case '<': + if (set_nomacro++ == 0) + fputs (".set\tnomacro\n\t", file); + break; + + case '>': + if (set_nomacro == 0) + error ("internal error: %%> found without a %%< in assembler pattern"); + else if (--set_nomacro == 0) + fputs ("\n\t.set\tmacro", file); + + break; + + case '{': + if (set_volatile++ == 0) + fputs ("#.set\tvolatile\n\t", file); + break; + + case '}': + if (set_volatile == 0) + error ("internal error: %%} found without a %%{ in assembler pattern"); + else if (--set_volatile == 0) + fputs ("\n\t#.set\tnovolatile", file); + + break; + + case '~': + { + if (align_labels_log > 0) + ASM_OUTPUT_ALIGN (file, align_labels_log); + } + break; + + default: + error ("PRINT_OPERAND: unknown punctuation '%c'", letter); + break; + } + + return; + } + + if (! op) + { + error ("PRINT_OPERAND null pointer"); + return; + } + + code = GET_CODE (op); + + if (letter == 'C') + switch (code) + { + case EQ: fputs ("eq", file); break; + case NE: fputs ("ne", file); break; + case GT: fputs ("gt", file); break; + case GE: fputs ("ge", file); break; + case LT: fputs ("lt", file); break; + case LE: fputs ("le", file); break; + case GTU: fputs ("gtu", file); break; + case GEU: fputs ("geu", file); break; + case LTU: fputs ("ltu", file); break; + case LEU: fputs ("leu", file); break; + default: + fatal_insn ("PRINT_OPERAND, invalid insn for %%C", op); + } + + else if (letter == 'N') + switch (code) + { + case EQ: fputs ("ne", file); break; + case NE: fputs ("eq", file); break; + case GT: fputs ("le", file); break; + case GE: fputs ("lt", file); break; + case LT: fputs ("ge", file); break; + case LE: fputs ("gt", file); break; + case GTU: fputs ("leu", file); break; + case GEU: fputs ("ltu", file); break; + case LTU: fputs ("geu", file); break; + case LEU: fputs ("gtu", file); break; + default: + fatal_insn ("PRINT_OPERAND, invalid insn for %%N", op); + } + + else if (letter == 'F') + switch (code) + { + case EQ: fputs ("c1f", file); break; + case NE: fputs ("c1t", file); break; + default: + fatal_insn ("PRINT_OPERAND, invalid insn for %%F", op); + } + + else if (letter == 'W') + switch (code) + { + case EQ: fputs ("c1t", file); break; + case NE: fputs ("c1f", file); break; + default: + fatal_insn ("PRINT_OPERAND, invalid insn for %%W", op); + } + + else if (letter == 'h') + { + if (GET_CODE (op) == HIGH) + op = XEXP (op, 0); + + print_operand_reloc (file, op, mips_hi_relocs); + } + + else if (letter == 'R') + print_operand_reloc (file, op, mips_lo_relocs); + + else if (letter == 'Y') + { + if (GET_CODE (op) == CONST_INT + && ((unsigned HOST_WIDE_INT) INTVAL (op) + < ARRAY_SIZE (mips_fp_conditions))) + fputs (mips_fp_conditions[INTVAL (op)], file); + else + output_operand_lossage ("invalid %%Y value"); + } + + else if (letter == 'Z') + { + if (ISA_HAS_8CC) + { + print_operand (file, op, 0); + fputc (',', file); + } + } + + else if (letter == 'q') + { + int regnum; + + if (code != REG) + fatal_insn ("PRINT_OPERAND, invalid insn for %%q", op); + + regnum = REGNO (op); + if (MD_REG_P (regnum)) + fprintf (file, "$ac0"); + else if (DSP_ACC_REG_P (regnum)) + fprintf (file, "$ac%c", reg_names[regnum][3]); + else + fatal_insn ("PRINT_OPERAND, invalid insn for %%q", op); + } + + else if (code == REG || code == SUBREG) + { + register int regnum; + + if (code == REG) + regnum = REGNO (op); + else + regnum = true_regnum (op); + + if ((letter == 'M' && ! WORDS_BIG_ENDIAN) + || (letter == 'L' && WORDS_BIG_ENDIAN) + || letter == 'D') + regnum++; + + fprintf (file, "%s", reg_names[regnum]); + } + + else if (code == MEM) + { + if (letter == 'D') + output_address (plus_constant (XEXP (op, 0), 4)); + else + output_address (XEXP (op, 0)); + } + + else if (letter == 'x' && GET_CODE (op) == CONST_INT) + fprintf (file, HOST_WIDE_INT_PRINT_HEX, 0xffff & INTVAL(op)); + + else if (letter == 'X' && GET_CODE(op) == CONST_INT) + fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (op)); + + else if (letter == 'd' && GET_CODE(op) == CONST_INT) + fprintf (file, HOST_WIDE_INT_PRINT_DEC, (INTVAL(op))); + + else if (letter == 'z' && op == CONST0_RTX (GET_MODE (op))) + fputs (reg_names[GP_REG_FIRST], file); + + else if (letter == 'd' || letter == 'x' || letter == 'X') + output_operand_lossage ("invalid use of %%d, %%x, or %%X"); + + else if (letter == 'T' || letter == 't') + { + int truth = (code == NE) == (letter == 'T'); + fputc ("zfnt"[truth * 2 + (GET_MODE (op) == CCmode)], file); + } + + else if (CONST_GP_P (op)) + fputs (reg_names[GLOBAL_POINTER_REGNUM], file); + + else + output_addr_const (file, op); +} + + +/* Print symbolic operand OP, which is part of a HIGH or LO_SUM. + RELOCS is the array of relocations to use. */ + +static void +print_operand_reloc (FILE *file, rtx op, const char **relocs) +{ + enum mips_symbol_type symbol_type; + const char *p; + rtx base; + HOST_WIDE_INT offset; + + if (!mips_symbolic_constant_p (op, &symbol_type) || relocs[symbol_type] == 0) + fatal_insn ("PRINT_OPERAND, invalid operand for relocation", op); + + /* If OP uses an UNSPEC address, we want to print the inner symbol. */ + mips_split_const (op, &base, &offset); + if (UNSPEC_ADDRESS_P (base)) + op = plus_constant (UNSPEC_ADDRESS (base), offset); + + fputs (relocs[symbol_type], file); + output_addr_const (file, op); + for (p = relocs[symbol_type]; *p != 0; p++) + if (*p == '(') + fputc (')', file); +} + +/* Output address operand X to FILE. */ + +void +print_operand_address (FILE *file, rtx x) +{ + struct mips_address_info addr; + + if (mips_classify_address (&addr, x, word_mode, true)) + switch (addr.type) + { + case ADDRESS_REG: + print_operand (file, addr.offset, 0); + fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); + return; + + case ADDRESS_LO_SUM: + print_operand (file, addr.offset, 'R'); + fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]); + return; + + case ADDRESS_CONST_INT: + output_addr_const (file, x); + fprintf (file, "(%s)", reg_names[0]); + return; + + case ADDRESS_SYMBOLIC: + output_addr_const (file, x); + return; + } + gcc_unreachable (); +} + +/* When using assembler macros, keep track of all of small-data externs + so that mips_file_end can emit the appropriate declarations for them. + + In most cases it would be safe (though pointless) to emit .externs + for other symbols too. One exception is when an object is within + the -G limit but declared by the user to be in a section other + than .sbss or .sdata. */ + +int +mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name) +{ + register struct extern_list *p; + + if (!TARGET_EXPLICIT_RELOCS && mips_in_small_data_p (decl)) + { + p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); + p->next = extern_head; + p->name = name; + p->size = int_size_in_bytes (TREE_TYPE (decl)); + extern_head = p; + } + + if (TARGET_IRIX && mips_abi == ABI_32 && TREE_CODE (decl) == FUNCTION_DECL) + { + p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); + p->next = extern_head; + p->name = name; + p->size = -1; + extern_head = p; + } + + return 0; +} + +#if TARGET_IRIX +static void +irix_output_external_libcall (rtx fun) +{ + register struct extern_list *p; + + if (mips_abi == ABI_32) + { + p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); + p->next = extern_head; + p->name = XSTR (fun, 0); + p->size = -1; + extern_head = p; + } +} +#endif + +/* Emit a new filename to a stream. If we are smuggling stabs, try to + put out a MIPS ECOFF file and a stab. */ + +void +mips_output_filename (FILE *stream, const char *name) +{ + + /* If we are emitting DWARF-2, let dwarf2out handle the ".file" + directives. */ + if (write_symbols == DWARF2_DEBUG) + return; + else if (mips_output_filename_first_time) + { + mips_output_filename_first_time = 0; + num_source_filenames += 1; + current_function_file = name; + fprintf (stream, "\t.file\t%d ", num_source_filenames); + output_quoted_string (stream, name); + putc ('\n', stream); + } + + /* If we are emitting stabs, let dbxout.c handle this (except for + the mips_output_filename_first_time case). */ + else if (write_symbols == DBX_DEBUG) + return; + + else if (name != current_function_file + && strcmp (name, current_function_file) != 0) + { + num_source_filenames += 1; + current_function_file = name; + fprintf (stream, "\t.file\t%d ", num_source_filenames); + output_quoted_string (stream, name); + putc ('\n', stream); + } +} + +/* Output an ASCII string, in a space-saving way. PREFIX is the string + that should be written before the opening quote, such as "\t.ascii\t" + for real string data or "\t# " for a comment. */ + +void +mips_output_ascii (FILE *stream, const char *string_param, size_t len, + const char *prefix) +{ + size_t i; + int cur_pos = 17; + register const unsigned char *string = + (const unsigned char *)string_param; + + fprintf (stream, "%s\"", prefix); + for (i = 0; i < len; i++) + { + register int c = string[i]; + + if (ISPRINT (c)) + { + if (c == '\\' || c == '\"') + { + putc ('\\', stream); + cur_pos++; + } + putc (c, stream); + cur_pos++; + } + else + { + fprintf (stream, "\\%03o", c); + cur_pos += 4; + } + + if (cur_pos > 72 && i+1 < len) + { + cur_pos = 17; + fprintf (stream, "\"\n%s\"", prefix); + } + } + fprintf (stream, "\"\n"); +} + +/* Implement TARGET_ASM_FILE_START. */ + +static void +mips_file_start (void) +{ + default_file_start (); + + if (!TARGET_IRIX) + { + /* Generate a special section to describe the ABI switches used to + produce the resultant binary. This used to be done by the assembler + setting bits in the ELF header's flags field, but we have run out of + bits. GDB needs this information in order to be able to correctly + debug these binaries. See the function mips_gdbarch_init() in + gdb/mips-tdep.c. This is unnecessary for the IRIX 5/6 ABIs and + causes unnecessary IRIX 6 ld warnings. */ + const char * abi_string = NULL; + + switch (mips_abi) + { + case ABI_32: abi_string = "abi32"; break; + case ABI_N32: abi_string = "abiN32"; break; + case ABI_64: abi_string = "abi64"; break; + case ABI_O64: abi_string = "abiO64"; break; + case ABI_EABI: abi_string = TARGET_64BIT ? "eabi64" : "eabi32"; break; + default: + gcc_unreachable (); + } + /* Note - we use fprintf directly rather than calling switch_to_section + because in this way we can avoid creating an allocated section. We + do not want this section to take up any space in the running + executable. */ + fprintf (asm_out_file, "\t.section .mdebug.%s\n", abi_string); + + /* There is no ELF header flag to distinguish long32 forms of the + EABI from long64 forms. Emit a special section to help tools + such as GDB. Do the same for o64, which is sometimes used with + -mlong64. */ + if (mips_abi == ABI_EABI || mips_abi == ABI_O64) + fprintf (asm_out_file, "\t.section .gcc_compiled_long%d\n", + TARGET_LONG64 ? 64 : 32); + + /* Restore the default section. */ + fprintf (asm_out_file, "\t.previous\n"); + } + + /* Generate the pseudo ops that System V.4 wants. */ + if (TARGET_ABICALLS) + fprintf (asm_out_file, "\t.abicalls\n"); + + if (TARGET_MIPS16) + fprintf (asm_out_file, "\t.set\tmips16\n"); + + if (flag_verbose_asm) + fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n", + ASM_COMMENT_START, + mips_section_threshold, mips_arch_info->name, mips_isa); +} + +#ifdef BSS_SECTION_ASM_OP +/* Implement ASM_OUTPUT_ALIGNED_BSS. This differs from the default only + in the use of sbss. */ + +void +mips_output_aligned_bss (FILE *stream, tree decl, const char *name, + unsigned HOST_WIDE_INT size, int align) +{ + extern tree last_assemble_variable_decl; + + if (mips_in_small_data_p (decl)) + switch_to_section (get_named_section (NULL, ".sbss", 0)); + else + switch_to_section (bss_section); + ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT)); + last_assemble_variable_decl = decl; + ASM_DECLARE_OBJECT_NAME (stream, name, decl); + ASM_OUTPUT_SKIP (stream, size != 0 ? size : 1); +} +#endif + +/* Implement TARGET_ASM_FILE_END. When using assembler macros, emit + .externs for any small-data variables that turned out to be external. */ + +static void +mips_file_end (void) +{ + tree name_tree; + struct extern_list *p; + + if (extern_head) + { + fputs ("\n", asm_out_file); + + for (p = extern_head; p != 0; p = p->next) + { + name_tree = get_identifier (p->name); + + /* Positively ensure only one .extern for any given symbol. */ + if (!TREE_ASM_WRITTEN (name_tree) + && TREE_SYMBOL_REFERENCED (name_tree)) + { + TREE_ASM_WRITTEN (name_tree) = 1; + /* In IRIX 5 or IRIX 6 for the O32 ABI, we must output a + `.global name .text' directive for every used but + undefined function. If we don't, the linker may perform + an optimization (skipping over the insns that set $gp) + when it is unsafe. */ + if (TARGET_IRIX && mips_abi == ABI_32 && p->size == -1) + { + fputs ("\t.globl ", asm_out_file); + assemble_name (asm_out_file, p->name); + fputs (" .text\n", asm_out_file); + } + else + { + fputs ("\t.extern\t", asm_out_file); + assemble_name (asm_out_file, p->name); + fprintf (asm_out_file, ", %d\n", p->size); + } + } + } + } +} + +/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as the + elfos.h version, but we also need to handle -muninit-const-in-rodata. */ + +void +mips_output_aligned_decl_common (FILE *stream, tree decl, const char *name, + unsigned HOST_WIDE_INT size, + unsigned int align) +{ + /* If the target wants uninitialized const declarations in + .rdata then don't put them in .comm. */ + if (TARGET_EMBEDDED_DATA && TARGET_UNINIT_CONST_IN_RODATA + && TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl) + && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)) + { + if (TREE_PUBLIC (decl) && DECL_NAME (decl)) + targetm.asm_out.globalize_label (stream, name); + + switch_to_section (readonly_data_section); + ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT)); + mips_declare_object (stream, name, "", + ":\n\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED "\n", + size); + } + else + mips_declare_common_object (stream, name, "\n\t.comm\t", + size, align, true); +} + +/* Declare a common object of SIZE bytes using asm directive INIT_STRING. + NAME is the name of the object and ALIGN is the required alignment + in bytes. TAKES_ALIGNMENT_P is true if the directive takes a third + alignment argument. */ + +void +mips_declare_common_object (FILE *stream, const char *name, + const char *init_string, + unsigned HOST_WIDE_INT size, + unsigned int align, bool takes_alignment_p) +{ + if (!takes_alignment_p) + { + size += (align / BITS_PER_UNIT) - 1; + size -= size % (align / BITS_PER_UNIT); + mips_declare_object (stream, name, init_string, + "," HOST_WIDE_INT_PRINT_UNSIGNED "\n", size); + } + else + mips_declare_object (stream, name, init_string, + "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", + size, align / BITS_PER_UNIT); +} + +/* Emit either a label, .comm, or .lcomm directive. When using assembler + macros, mark the symbol as written so that mips_file_end won't emit an + .extern for it. STREAM is the output file, NAME is the name of the + symbol, INIT_STRING is the string that should be written before the + symbol and FINAL_STRING is the string that should be written after it. + FINAL_STRING is a printf() format that consumes the remaining arguments. */ + +void +mips_declare_object (FILE *stream, const char *name, const char *init_string, + const char *final_string, ...) +{ + va_list ap; + + fputs (init_string, stream); + assemble_name (stream, name); + va_start (ap, final_string); + vfprintf (stream, final_string, ap); + va_end (ap); + + if (!TARGET_EXPLICIT_RELOCS) + { + tree name_tree = get_identifier (name); + TREE_ASM_WRITTEN (name_tree) = 1; + } +} + +#ifdef ASM_OUTPUT_SIZE_DIRECTIVE +extern int size_directive_output; + +/* Implement ASM_DECLARE_OBJECT_NAME. This is like most of the standard ELF + definitions except that it uses mips_declare_object() to emit the label. */ + +void +mips_declare_object_name (FILE *stream, const char *name, + tree decl ATTRIBUTE_UNUSED) +{ +#ifdef ASM_OUTPUT_TYPE_DIRECTIVE + ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object"); +#endif + + size_directive_output = 0; + if (!flag_inhibit_size_directive && DECL_SIZE (decl)) + { + HOST_WIDE_INT size; + + size_directive_output = 1; + size = int_size_in_bytes (TREE_TYPE (decl)); + ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size); + } + + mips_declare_object (stream, name, "", ":\n"); +} + +/* Implement ASM_FINISH_DECLARE_OBJECT. This is generic ELF stuff. */ + +void +mips_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end) +{ + const char *name; + + name = XSTR (XEXP (DECL_RTL (decl), 0), 0); + if (!flag_inhibit_size_directive + && DECL_SIZE (decl) != 0 + && !at_end && top_level + && DECL_INITIAL (decl) == error_mark_node + && !size_directive_output) + { + HOST_WIDE_INT size; + + size_directive_output = 1; + size = int_size_in_bytes (TREE_TYPE (decl)); + ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size); + } +} +#endif + +/* Return true if X is a small data address that can be rewritten + as a LO_SUM. */ + +static bool +mips_rewrite_small_data_p (rtx x) +{ + enum mips_symbol_type symbol_type; + + return (TARGET_EXPLICIT_RELOCS + && mips_symbolic_constant_p (x, &symbol_type) + && symbol_type == SYMBOL_SMALL_DATA); +} + + +/* A for_each_rtx callback for mips_small_data_pattern_p. */ + +static int +mips_small_data_pattern_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + if (GET_CODE (*loc) == LO_SUM) + return -1; + + return mips_rewrite_small_data_p (*loc); +} + +/* Return true if OP refers to small data symbols directly, not through + a LO_SUM. */ + +bool +mips_small_data_pattern_p (rtx op) +{ + return for_each_rtx (&op, mips_small_data_pattern_1, 0); +} + +/* A for_each_rtx callback, used by mips_rewrite_small_data. */ + +static int +mips_rewrite_small_data_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + if (mips_rewrite_small_data_p (*loc)) + *loc = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, *loc); + + if (GET_CODE (*loc) == LO_SUM) + return -1; + + return 0; +} + +/* If possible, rewrite OP so that it refers to small data using + explicit relocations. */ + +rtx +mips_rewrite_small_data (rtx op) +{ + op = copy_insn (op); + for_each_rtx (&op, mips_rewrite_small_data_1, 0); + return op; +} + +/* Return true if the current function has an insn that implicitly + refers to $gp. */ + +static bool +mips_function_has_gp_insn (void) +{ + /* Don't bother rechecking if we found one last time. */ + if (!cfun->machine->has_gp_insn_p) + { + rtx insn; + + push_topmost_sequence (); + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn) + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER + && (get_attr_got (insn) != GOT_UNSET + || small_data_pattern (PATTERN (insn), VOIDmode))) + break; + pop_topmost_sequence (); + + cfun->machine->has_gp_insn_p = (insn != 0); + } + return cfun->machine->has_gp_insn_p; +} + + +/* Return the register that should be used as the global pointer + within this function. Return 0 if the function doesn't need + a global pointer. */ + +static unsigned int +mips_global_pointer (void) +{ + unsigned int regno; + + /* $gp is always available in non-abicalls code. */ + if (!TARGET_ABICALLS) + return GLOBAL_POINTER_REGNUM; + + /* We must always provide $gp when it is used implicitly. */ + if (!TARGET_EXPLICIT_RELOCS) + return GLOBAL_POINTER_REGNUM; + + /* FUNCTION_PROFILER includes a jal macro, so we need to give it + a valid gp. */ + if (current_function_profile) + return GLOBAL_POINTER_REGNUM; + + /* If the function has a nonlocal goto, $gp must hold the correct + global pointer for the target function. */ + if (current_function_has_nonlocal_goto) + return GLOBAL_POINTER_REGNUM; + + /* If the gp is never referenced, there's no need to initialize it. + Note that reload can sometimes introduce constant pool references + into a function that otherwise didn't need them. For example, + suppose we have an instruction like: + + (set (reg:DF R1) (float:DF (reg:SI R2))) + + If R2 turns out to be constant such as 1, the instruction may have a + REG_EQUAL note saying that R1 == 1.0. Reload then has the option of + using this constant if R2 doesn't get allocated to a register. + + In cases like these, reload will have added the constant to the pool + but no instruction will yet refer to it. */ + if (!regs_ever_live[GLOBAL_POINTER_REGNUM] + && !current_function_uses_const_pool + && !mips_function_has_gp_insn ()) + return 0; + + /* We need a global pointer, but perhaps we can use a call-clobbered + register instead of $gp. */ + if (TARGET_NEWABI && current_function_is_leaf) + for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) + if (!regs_ever_live[regno] + && call_used_regs[regno] + && !fixed_regs[regno] + && regno != PIC_FUNCTION_ADDR_REGNUM) + return regno; + + return GLOBAL_POINTER_REGNUM; +} + + +/* Return true if the current function must save REGNO. */ + +static bool +mips_save_reg_p (unsigned int regno) +{ + /* We only need to save $gp for NewABI PIC. */ + if (regno == GLOBAL_POINTER_REGNUM) + return (TARGET_ABICALLS && TARGET_NEWABI + && cfun->machine->global_pointer == regno); + + /* Check call-saved registers. */ + if (regs_ever_live[regno] && !call_used_regs[regno]) + return true; + + /* We need to save the old frame pointer before setting up a new one. */ + if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) + return true; + + /* We need to save the incoming return address if it is ever clobbered + within the function. */ + if (regno == GP_REG_FIRST + 31 && regs_ever_live[regno]) + return true; + + if (TARGET_MIPS16) + { + tree return_type; + + return_type = DECL_RESULT (current_function_decl); + + /* $18 is a special case in mips16 code. It may be used to call + a function which returns a floating point value, but it is + marked in call_used_regs. */ + if (regno == GP_REG_FIRST + 18 && regs_ever_live[regno]) + return true; + + /* $31 is also a special case. It will be used to copy a return + value into the floating point registers if the return value is + floating point. */ + if (regno == GP_REG_FIRST + 31 + && mips16_hard_float + && !aggregate_value_p (return_type, current_function_decl) + && GET_MODE_CLASS (DECL_MODE (return_type)) == MODE_FLOAT + && GET_MODE_SIZE (DECL_MODE (return_type)) <= UNITS_PER_FPVALUE) + return true; + } + + return false; +} + + +/* Return the bytes needed to compute the frame pointer from the current + stack pointer. SIZE is the size (in bytes) of the local variables. + + MIPS stack frames look like: + + Before call After call + +-----------------------+ +-----------------------+ + high | | | | + mem. | | | | + | caller's temps. | | caller's temps. | + | | | | + +-----------------------+ +-----------------------+ + | | | | + | arguments on stack. | | arguments on stack. | + | | | | + +-----------------------+ +-----------------------+ + | 4 words to save | | 4 words to save | + | arguments passed | | arguments passed | + | in registers, even | | in registers, even | + SP->| if not passed. | VFP->| if not passed. | + +-----------------------+ +-----------------------+ + | | + | fp register save | + | | + +-----------------------+ + | | + | gp register save | + | | + +-----------------------+ + | | + | local variables | + | | + +-----------------------+ + | | + | alloca allocations | + | | + +-----------------------+ + | | + | GP save for V.4 abi | + | | + +-----------------------+ + | | + | arguments on stack | + | | + +-----------------------+ + | 4 words to save | + | arguments passed | + | in registers, even | + low SP->| if not passed. | + memory +-----------------------+ + +*/ + +HOST_WIDE_INT +compute_frame_size (HOST_WIDE_INT size) +{ + unsigned int regno; + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* # bytes that variables take up */ + HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */ + HOST_WIDE_INT cprestore_size; /* # bytes that the cprestore slot takes up */ + HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */ + HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ + HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ + + cfun->machine->global_pointer = mips_global_pointer (); + + gp_reg_size = 0; + fp_reg_size = 0; + mask = 0; + fmask = 0; + var_size = MIPS_STACK_ALIGN (size); + args_size = current_function_outgoing_args_size; + cprestore_size = MIPS_STACK_ALIGN (STARTING_FRAME_OFFSET) - args_size; + + /* The space set aside by STARTING_FRAME_OFFSET isn't needed in leaf + functions. If the function has local variables, we're committed + to allocating it anyway. Otherwise reclaim it here. */ + if (var_size == 0 && current_function_is_leaf) + cprestore_size = args_size = 0; + + /* The MIPS 3.0 linker does not like functions that dynamically + allocate the stack and have 0 for STACK_DYNAMIC_OFFSET, since it + looks like we are trying to create a second frame pointer to the + function, so allocate some stack space to make it happy. */ + + if (args_size == 0 && current_function_calls_alloca) + args_size = 4 * UNITS_PER_WORD; + + total_size = var_size + args_size + cprestore_size; + + /* Calculate space needed for gp registers. */ + for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) + if (mips_save_reg_p (regno)) + { + gp_reg_size += GET_MODE_SIZE (gpr_mode); + mask |= 1 << (regno - GP_REG_FIRST); + } + + /* We need to restore these for the handler. */ + if (current_function_calls_eh_return) + { + unsigned int i; + for (i = 0; ; ++i) + { + regno = EH_RETURN_DATA_REGNO (i); + if (regno == INVALID_REGNUM) + break; + gp_reg_size += GET_MODE_SIZE (gpr_mode); + mask |= 1 << (regno - GP_REG_FIRST); + } + } + + /* This loop must iterate over the same space as its companion in + save_restore_insns. */ + for (regno = (FP_REG_LAST - FP_INC + 1); + regno >= FP_REG_FIRST; + regno -= FP_INC) + { + if (mips_save_reg_p (regno)) + { + fp_reg_size += FP_INC * UNITS_PER_FPREG; + fmask |= ((1 << FP_INC) - 1) << (regno - FP_REG_FIRST); + } + } + + gp_reg_rounded = MIPS_STACK_ALIGN (gp_reg_size); + total_size += gp_reg_rounded + MIPS_STACK_ALIGN (fp_reg_size); + + /* Add in the space required for saving incoming register arguments. */ + total_size += current_function_pretend_args_size; + total_size += MIPS_STACK_ALIGN (cfun->machine->varargs_size); + + /* Save other computed information. */ + cfun->machine->frame.total_size = total_size; + cfun->machine->frame.var_size = var_size; + cfun->machine->frame.args_size = args_size; + cfun->machine->frame.cprestore_size = cprestore_size; + cfun->machine->frame.gp_reg_size = gp_reg_size; + cfun->machine->frame.fp_reg_size = fp_reg_size; + cfun->machine->frame.mask = mask; + cfun->machine->frame.fmask = fmask; + cfun->machine->frame.initialized = reload_completed; + cfun->machine->frame.num_gp = gp_reg_size / UNITS_PER_WORD; + cfun->machine->frame.num_fp = fp_reg_size / (FP_INC * UNITS_PER_FPREG); + + if (mask) + { + HOST_WIDE_INT offset; + + offset = (args_size + cprestore_size + var_size + + gp_reg_size - GET_MODE_SIZE (gpr_mode)); + cfun->machine->frame.gp_sp_offset = offset; + cfun->machine->frame.gp_save_offset = offset - total_size; + } + else + { + cfun->machine->frame.gp_sp_offset = 0; + cfun->machine->frame.gp_save_offset = 0; + } + + if (fmask) + { + HOST_WIDE_INT offset; + + offset = (args_size + cprestore_size + var_size + + gp_reg_rounded + fp_reg_size + - FP_INC * UNITS_PER_FPREG); + cfun->machine->frame.fp_sp_offset = offset; + cfun->machine->frame.fp_save_offset = offset - total_size; + } + else + { + cfun->machine->frame.fp_sp_offset = 0; + cfun->machine->frame.fp_save_offset = 0; + } + + /* Ok, we're done. */ + return total_size; +} + +/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame + pointer or argument pointer. TO is either the stack pointer or + hard frame pointer. */ + +HOST_WIDE_INT +mips_initial_elimination_offset (int from, int to) +{ + HOST_WIDE_INT offset; + + compute_frame_size (get_frame_size ()); + + /* Set OFFSET to the offset from the stack pointer. */ + switch (from) + { + case FRAME_POINTER_REGNUM: + offset = 0; + break; + + case ARG_POINTER_REGNUM: + offset = (cfun->machine->frame.total_size + - current_function_pretend_args_size); + break; + + default: + gcc_unreachable (); + } + + if (TARGET_MIPS16 && to == HARD_FRAME_POINTER_REGNUM) + offset -= cfun->machine->frame.args_size; + + return offset; +} + +/* Implement RETURN_ADDR_RTX. Note, we do not support moving + back to a previous frame. */ +rtx +mips_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) +{ + if (count != 0) + return const0_rtx; + + return get_hard_reg_initial_val (Pmode, GP_REG_FIRST + 31); +} + +/* Use FN to save or restore register REGNO. MODE is the register's + mode and OFFSET is the offset of its save slot from the current + stack pointer. */ + +static void +mips_save_restore_reg (enum machine_mode mode, int regno, + HOST_WIDE_INT offset, mips_save_restore_fn fn) +{ + rtx mem; + + mem = gen_frame_mem (mode, plus_constant (stack_pointer_rtx, offset)); + + fn (gen_rtx_REG (mode, regno), mem); +} + + +/* Call FN for each register that is saved by the current function. + SP_OFFSET is the offset of the current stack pointer from the start + of the frame. */ + +static void +mips_for_each_saved_reg (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn) +{ +#define BITSET_P(VALUE, BIT) (((VALUE) & (1L << (BIT))) != 0) + + enum machine_mode fpr_mode; + HOST_WIDE_INT offset; + int regno; + + /* Save registers starting from high to low. The debuggers prefer at least + the return register be stored at func+4, and also it allows us not to + need a nop in the epilog if at least one register is reloaded in + addition to return address. */ + offset = cfun->machine->frame.gp_sp_offset - sp_offset; + for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--) + if (BITSET_P (cfun->machine->frame.mask, regno - GP_REG_FIRST)) + { + mips_save_restore_reg (gpr_mode, regno, offset, fn); + offset -= GET_MODE_SIZE (gpr_mode); + } + + /* This loop must iterate over the same space as its companion in + compute_frame_size. */ + offset = cfun->machine->frame.fp_sp_offset - sp_offset; + fpr_mode = (TARGET_SINGLE_FLOAT ? SFmode : DFmode); + for (regno = (FP_REG_LAST - FP_INC + 1); + regno >= FP_REG_FIRST; + regno -= FP_INC) + if (BITSET_P (cfun->machine->frame.fmask, regno - FP_REG_FIRST)) + { + mips_save_restore_reg (fpr_mode, regno, offset, fn); + offset -= GET_MODE_SIZE (fpr_mode); + } +#undef BITSET_P +} + +/* If we're generating n32 or n64 abicalls, and the current function + does not use $28 as its global pointer, emit a cplocal directive. + Use pic_offset_table_rtx as the argument to the directive. */ + +static void +mips_output_cplocal (void) +{ + if (!TARGET_EXPLICIT_RELOCS + && cfun->machine->global_pointer > 0 + && cfun->machine->global_pointer != GLOBAL_POINTER_REGNUM) + output_asm_insn (".cplocal %+", 0); +} + +/* Return the style of GP load sequence that is being used for the + current function. */ + +enum mips_loadgp_style +mips_current_loadgp_style (void) +{ + if (!TARGET_ABICALLS || cfun->machine->global_pointer == 0) + return LOADGP_NONE; + + if (TARGET_ABSOLUTE_ABICALLS) + return LOADGP_ABSOLUTE; + + return TARGET_NEWABI ? LOADGP_NEWABI : LOADGP_OLDABI; +} + +/* The __gnu_local_gp symbol. */ + +static GTY(()) rtx mips_gnu_local_gp; + +/* If we're generating n32 or n64 abicalls, emit instructions + to set up the global pointer. */ + +static void +mips_emit_loadgp (void) +{ + rtx addr, offset, incoming_address; + + switch (mips_current_loadgp_style ()) + { + case LOADGP_ABSOLUTE: + if (mips_gnu_local_gp == NULL) + { + mips_gnu_local_gp = gen_rtx_SYMBOL_REF (Pmode, "__gnu_local_gp"); + SYMBOL_REF_FLAGS (mips_gnu_local_gp) |= SYMBOL_FLAG_LOCAL; + } + emit_insn (gen_loadgp_noshared (mips_gnu_local_gp)); + break; + + case LOADGP_NEWABI: + addr = XEXP (DECL_RTL (current_function_decl), 0); + offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP); + incoming_address = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); + emit_insn (gen_loadgp (offset, incoming_address)); + if (!TARGET_EXPLICIT_RELOCS) + emit_insn (gen_loadgp_blockage ()); + break; + + default: + break; + } +} + +/* Set up the stack and frame (if desired) for the function. */ + +static void +mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + const char *fnname; + HOST_WIDE_INT tsize = cfun->machine->frame.total_size; + +#ifdef SDB_DEBUGGING_INFO + if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG) + SDB_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl)); +#endif + + /* In mips16 mode, we may need to generate a 32 bit to handle + floating point arguments. The linker will arrange for any 32 bit + functions to call this stub, which will then jump to the 16 bit + function proper. */ + if (TARGET_MIPS16 && !TARGET_SOFT_FLOAT + && current_function_args_info.fp_code != 0) + build_mips16_function_stub (file); + + if (!FUNCTION_NAME_ALREADY_DECLARED) + { + /* Get the function name the same way that toplev.c does before calling + assemble_start_function. This is needed so that the name used here + exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */ + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + + if (!flag_inhibit_size_directive) + { + fputs ("\t.ent\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } + + assemble_name (file, fnname); + fputs (":\n", file); + } + + /* Stop mips_file_end from treating this function as external. */ + if (TARGET_IRIX && mips_abi == ABI_32) + TREE_ASM_WRITTEN (DECL_NAME (cfun->decl)) = 1; + + if (!flag_inhibit_size_directive) + { + /* .frame FRAMEREG, FRAMESIZE, RETREG */ + fprintf (file, + "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s\t\t" + "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d/%d" + ", args= " HOST_WIDE_INT_PRINT_DEC + ", gp= " HOST_WIDE_INT_PRINT_DEC "\n", + (reg_names[(frame_pointer_needed) + ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]), + ((frame_pointer_needed && TARGET_MIPS16) + ? tsize - cfun->machine->frame.args_size + : tsize), + reg_names[GP_REG_FIRST + 31], + cfun->machine->frame.var_size, + cfun->machine->frame.num_gp, + cfun->machine->frame.num_fp, + cfun->machine->frame.args_size, + cfun->machine->frame.cprestore_size); + + /* .mask MASK, GPOFFSET; .fmask FPOFFSET */ + fprintf (file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", + cfun->machine->frame.mask, + cfun->machine->frame.gp_save_offset); + fprintf (file, "\t.fmask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", + cfun->machine->frame.fmask, + cfun->machine->frame.fp_save_offset); + + /* Require: + OLD_SP == *FRAMEREG + FRAMESIZE => can find old_sp from nominated FP reg. + HIGHEST_GP_SAVED == *FRAMEREG + FRAMESIZE + GPOFFSET => can find saved regs. */ + } + + if (mips_current_loadgp_style () == LOADGP_OLDABI) + { + /* Handle the initialization of $gp for SVR4 PIC. */ + if (!cfun->machine->all_noreorder_p) + output_asm_insn ("%(.cpload\t%^%)", 0); + else + output_asm_insn ("%(.cpload\t%^\n\t%<", 0); + } + else if (cfun->machine->all_noreorder_p) + output_asm_insn ("%(%<", 0); + + /* Tell the assembler which register we're using as the global + pointer. This is needed for thunks, since they can use either + explicit relocs or assembler macros. */ + mips_output_cplocal (); +} + +/* Make the last instruction frame related and note that it performs + the operation described by FRAME_PATTERN. */ + +static void +mips_set_frame_expr (rtx frame_pattern) +{ + rtx insn; + + insn = get_last_insn (); + RTX_FRAME_RELATED_P (insn) = 1; + REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR, + frame_pattern, + REG_NOTES (insn)); +} + + +/* Return a frame-related rtx that stores REG at MEM. + REG must be a single register. */ + +static rtx +mips_frame_set (rtx mem, rtx reg) +{ + rtx set; + + /* If we're saving the return address register and the dwarf return + address column differs from the hard register number, adjust the + note reg to refer to the former. */ + if (REGNO (reg) == GP_REG_FIRST + 31 + && DWARF_FRAME_RETURN_COLUMN != GP_REG_FIRST + 31) + reg = gen_rtx_REG (GET_MODE (reg), DWARF_FRAME_RETURN_COLUMN); + + set = gen_rtx_SET (VOIDmode, mem, reg); + RTX_FRAME_RELATED_P (set) = 1; + + return set; +} + + +/* Save register REG to MEM. Make the instruction frame-related. */ + +static void +mips_save_reg (rtx reg, rtx mem) +{ + if (GET_MODE (reg) == DFmode && !TARGET_FLOAT64) + { + rtx x1, x2; + + if (mips_split_64bit_move_p (mem, reg)) + mips_split_64bit_move (mem, reg); + else + emit_move_insn (mem, reg); + + x1 = mips_frame_set (mips_subword (mem, 0), mips_subword (reg, 0)); + x2 = mips_frame_set (mips_subword (mem, 1), mips_subword (reg, 1)); + mips_set_frame_expr (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x1, x2))); + } + else + { + if (TARGET_MIPS16 + && REGNO (reg) != GP_REG_FIRST + 31 + && !M16_REG_P (REGNO (reg))) + { + /* Save a non-mips16 register by moving it through a temporary. + We don't need to do this for $31 since there's a special + instruction for it. */ + emit_move_insn (MIPS_PROLOGUE_TEMP (GET_MODE (reg)), reg); + emit_move_insn (mem, MIPS_PROLOGUE_TEMP (GET_MODE (reg))); + } + else + emit_move_insn (mem, reg); + + mips_set_frame_expr (mips_frame_set (mem, reg)); + } +} + + +/* Expand the prologue into a bunch of separate insns. */ + +void +mips_expand_prologue (void) +{ + HOST_WIDE_INT size; + + if (cfun->machine->global_pointer > 0) + REGNO (pic_offset_table_rtx) = cfun->machine->global_pointer; + + size = compute_frame_size (get_frame_size ()); + + /* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP + bytes beforehand; this is enough to cover the register save area + without going out of range. */ + if ((cfun->machine->frame.mask | cfun->machine->frame.fmask) != 0) + { + HOST_WIDE_INT step1; + + step1 = MIN (size, MIPS_MAX_FIRST_STACK_STEP); + RTX_FRAME_RELATED_P (emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (-step1)))) = 1; + size -= step1; + mips_for_each_saved_reg (size, mips_save_reg); + } + + /* Allocate the rest of the frame. */ + if (size > 0) + { + if (SMALL_OPERAND (-size)) + RTX_FRAME_RELATED_P (emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (-size)))) = 1; + else + { + emit_move_insn (MIPS_PROLOGUE_TEMP (Pmode), GEN_INT (size)); + if (TARGET_MIPS16) + { + /* There are no instructions to add or subtract registers + from the stack pointer, so use the frame pointer as a + temporary. We should always be using a frame pointer + in this case anyway. */ + gcc_assert (frame_pointer_needed); + emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx); + emit_insn (gen_sub3_insn (hard_frame_pointer_rtx, + hard_frame_pointer_rtx, + MIPS_PROLOGUE_TEMP (Pmode))); + emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx); + } + else + emit_insn (gen_sub3_insn (stack_pointer_rtx, + stack_pointer_rtx, + MIPS_PROLOGUE_TEMP (Pmode))); + + /* Describe the combined effect of the previous instructions. */ + mips_set_frame_expr + (gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (stack_pointer_rtx, -size))); + } + } + + /* Set up the frame pointer, if we're using one. In mips16 code, + we point the frame pointer ahead of the outgoing argument area. + This should allow more variables & incoming arguments to be + accessed with unextended instructions. */ + if (frame_pointer_needed) + { + if (TARGET_MIPS16 && cfun->machine->frame.args_size != 0) + { + rtx offset = GEN_INT (cfun->machine->frame.args_size); + if (SMALL_OPERAND (cfun->machine->frame.args_size)) + RTX_FRAME_RELATED_P + (emit_insn (gen_add3_insn (hard_frame_pointer_rtx, + stack_pointer_rtx, + offset))) = 1; + else + { + emit_move_insn (MIPS_PROLOGUE_TEMP (Pmode), offset); + emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx); + emit_insn (gen_add3_insn (hard_frame_pointer_rtx, + hard_frame_pointer_rtx, + MIPS_PROLOGUE_TEMP (Pmode))); + mips_set_frame_expr + (gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx, + plus_constant (stack_pointer_rtx, + cfun->machine->frame.args_size))); + } + } + else + RTX_FRAME_RELATED_P (emit_move_insn (hard_frame_pointer_rtx, + stack_pointer_rtx)) = 1; + } + + mips_emit_loadgp (); + + /* If generating o32/o64 abicalls, save $gp on the stack. */ + if (TARGET_ABICALLS && !TARGET_NEWABI && !current_function_is_leaf) + emit_insn (gen_cprestore (GEN_INT (current_function_outgoing_args_size))); + + /* If we are profiling, make sure no instructions are scheduled before + the call to mcount. */ + + if (current_function_profile) + emit_insn (gen_blockage ()); +} + +/* Do any necessary cleanup after a function to restore stack, frame, + and regs. */ + +#define RA_MASK BITMASK_HIGH /* 1 << 31 */ + +static void +mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + /* Reinstate the normal $gp. */ + REGNO (pic_offset_table_rtx) = GLOBAL_POINTER_REGNUM; + mips_output_cplocal (); + + if (cfun->machine->all_noreorder_p) + { + /* Avoid using %>%) since it adds excess whitespace. */ + output_asm_insn (".set\tmacro", 0); + output_asm_insn (".set\treorder", 0); + set_noreorder = set_nomacro = 0; + } + + if (!FUNCTION_NAME_ALREADY_DECLARED && !flag_inhibit_size_directive) + { + const char *fnname; + + /* Get the function name the same way that toplev.c does before calling + assemble_start_function. This is needed so that the name used here + exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */ + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + fputs ("\t.end\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } +} + +/* Emit instructions to restore register REG from slot MEM. */ + +static void +mips_restore_reg (rtx reg, rtx mem) +{ + /* There's no mips16 instruction to load $31 directly. Load into + $7 instead and adjust the return insn appropriately. */ + if (TARGET_MIPS16 && REGNO (reg) == GP_REG_FIRST + 31) + reg = gen_rtx_REG (GET_MODE (reg), 7); + + if (TARGET_MIPS16 && !M16_REG_P (REGNO (reg))) + { + /* Can't restore directly; move through a temporary. */ + emit_move_insn (MIPS_EPILOGUE_TEMP (GET_MODE (reg)), mem); + emit_move_insn (reg, MIPS_EPILOGUE_TEMP (GET_MODE (reg))); + } + else + emit_move_insn (reg, mem); +} + + +/* Expand the epilogue into a bunch of separate insns. SIBCALL_P is true + if this epilogue precedes a sibling call, false if it is for a normal + "epilogue" pattern. */ + +void +mips_expand_epilogue (int sibcall_p) +{ + HOST_WIDE_INT step1, step2; + rtx base, target; + + if (!sibcall_p && mips_can_use_return_insn ()) + { + emit_jump_insn (gen_return ()); + return; + } + + /* Split the frame into two. STEP1 is the amount of stack we should + deallocate before restoring the registers. STEP2 is the amount we + should deallocate afterwards. + + Start off by assuming that no registers need to be restored. */ + step1 = cfun->machine->frame.total_size; + step2 = 0; + + /* Work out which register holds the frame address. Account for the + frame pointer offset used by mips16 code. */ + if (!frame_pointer_needed) + base = stack_pointer_rtx; + else + { + base = hard_frame_pointer_rtx; + if (TARGET_MIPS16) + step1 -= cfun->machine->frame.args_size; + } + + /* If we need to restore registers, deallocate as much stack as + possible in the second step without going out of range. */ + if ((cfun->machine->frame.mask | cfun->machine->frame.fmask) != 0) + { + step2 = MIN (step1, MIPS_MAX_FIRST_STACK_STEP); + step1 -= step2; + } + + /* Set TARGET to BASE + STEP1. */ + target = base; + if (step1 > 0) + { + rtx adjust; + + /* Get an rtx for STEP1 that we can add to BASE. */ + adjust = GEN_INT (step1); + if (!SMALL_OPERAND (step1)) + { + emit_move_insn (MIPS_EPILOGUE_TEMP (Pmode), adjust); + adjust = MIPS_EPILOGUE_TEMP (Pmode); + } + + /* Normal mode code can copy the result straight into $sp. */ + if (!TARGET_MIPS16) + target = stack_pointer_rtx; + + emit_insn (gen_add3_insn (target, base, adjust)); + } + + /* Copy TARGET into the stack pointer. */ + if (target != stack_pointer_rtx) + emit_move_insn (stack_pointer_rtx, target); + + /* If we're using addressing macros for n32/n64 abicalls, $gp is + implicitly used by all SYMBOL_REFs. We must emit a blockage + insn before restoring it. */ + if (TARGET_ABICALLS && TARGET_NEWABI && !TARGET_EXPLICIT_RELOCS) + emit_insn (gen_blockage ()); + + /* Restore the registers. */ + mips_for_each_saved_reg (cfun->machine->frame.total_size - step2, + mips_restore_reg); + + /* Deallocate the final bit of the frame. */ + if (step2 > 0) + emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (step2))); + + /* Add in the __builtin_eh_return stack adjustment. We need to + use a temporary in mips16 code. */ + if (current_function_calls_eh_return) + { + if (TARGET_MIPS16) + { + emit_move_insn (MIPS_EPILOGUE_TEMP (Pmode), stack_pointer_rtx); + emit_insn (gen_add3_insn (MIPS_EPILOGUE_TEMP (Pmode), + MIPS_EPILOGUE_TEMP (Pmode), + EH_RETURN_STACKADJ_RTX)); + emit_move_insn (stack_pointer_rtx, MIPS_EPILOGUE_TEMP (Pmode)); + } + else + emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + EH_RETURN_STACKADJ_RTX)); + } + + if (!sibcall_p) + { + /* The mips16 loads the return address into $7, not $31. */ + if (TARGET_MIPS16 && (cfun->machine->frame.mask & RA_MASK) != 0) + emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, + GP_REG_FIRST + 7))); + else + emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, + GP_REG_FIRST + 31))); + } +} + +/* Return nonzero if this function is known to have a null epilogue. + This allows the optimizer to omit jumps to jumps if no stack + was created. */ + +int +mips_can_use_return_insn (void) +{ + tree return_type; + + if (! reload_completed) + return 0; + + if (regs_ever_live[31] || current_function_profile) + return 0; + + return_type = DECL_RESULT (current_function_decl); + + /* In mips16 mode, a function which returns a floating point value + needs to arrange to copy the return value into the floating point + registers. */ + if (TARGET_MIPS16 + && mips16_hard_float + && ! aggregate_value_p (return_type, current_function_decl) + && GET_MODE_CLASS (DECL_MODE (return_type)) == MODE_FLOAT + && GET_MODE_SIZE (DECL_MODE (return_type)) <= UNITS_PER_FPVALUE) + return 0; + + if (cfun->machine->frame.initialized) + return cfun->machine->frame.total_size == 0; + + return compute_frame_size (get_frame_size ()) == 0; +} + +/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text + in order to avoid duplicating too much logic from elsewhere. */ + +static void +mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, + tree function) +{ + rtx this, temp1, temp2, insn, fnaddr; + + /* Pretend to be a post-reload pass while generating rtl. */ + no_new_pseudos = 1; + reload_completed = 1; + reset_block_changes (); + + /* Pick a global pointer for -mabicalls. Use $15 rather than $28 + for TARGET_NEWABI since the latter is a call-saved register. */ + if (TARGET_ABICALLS) + cfun->machine->global_pointer + = REGNO (pic_offset_table_rtx) + = TARGET_NEWABI ? 15 : GLOBAL_POINTER_REGNUM; + + /* Set up the global pointer for n32 or n64 abicalls. */ + mips_emit_loadgp (); + + /* We need two temporary registers in some cases. */ + temp1 = gen_rtx_REG (Pmode, 2); + temp2 = gen_rtx_REG (Pmode, 3); + + /* Find out which register contains the "this" pointer. */ + if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)) + this = gen_rtx_REG (Pmode, GP_ARG_FIRST + 1); + else + this = gen_rtx_REG (Pmode, GP_ARG_FIRST); + + /* Add DELTA to THIS. */ + if (delta != 0) + { + rtx offset = GEN_INT (delta); + if (!SMALL_OPERAND (delta)) + { + emit_move_insn (temp1, offset); + offset = temp1; + } + emit_insn (gen_add3_insn (this, this, offset)); + } + + /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */ + if (vcall_offset != 0) + { + rtx addr; + + /* Set TEMP1 to *THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, this)); + + /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */ + addr = mips_add_offset (temp2, temp1, vcall_offset); + + /* Load the offset and add it to THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, addr)); + emit_insn (gen_add3_insn (this, this, temp1)); + } + + /* Jump to the target function. Use a sibcall if direct jumps are + allowed, otherwise load the address into a register first. */ + fnaddr = XEXP (DECL_RTL (function), 0); + if (TARGET_MIPS16 || TARGET_ABICALLS || TARGET_LONG_CALLS) + { + /* This is messy. gas treats "la $25,foo" as part of a call + sequence and may allow a global "foo" to be lazily bound. + The general move patterns therefore reject this combination. + + In this context, lazy binding would actually be OK for o32 and o64, + but it's still wrong for n32 and n64; see mips_load_call_address. + We must therefore load the address via a temporary register if + mips_dangerous_for_la25_p. + + If we jump to the temporary register rather than $25, the assembler + can use the move insn to fill the jump's delay slot. */ + if (TARGET_ABICALLS && !mips_dangerous_for_la25_p (fnaddr)) + temp1 = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); + mips_load_call_address (temp1, fnaddr, true); + + if (TARGET_ABICALLS && REGNO (temp1) != PIC_FUNCTION_ADDR_REGNUM) + emit_move_insn (gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM), temp1); + emit_jump_insn (gen_indirect_jump (temp1)); + } + else + { + insn = emit_call_insn (gen_sibcall_internal (fnaddr, const0_rtx)); + SIBLING_CALL_P (insn) = 1; + } + + /* Run just enough of rest_of_compilation. This sequence was + "borrowed" from alpha.c. */ + insn = get_insns (); + insn_locators_initialize (); + split_all_insns_noflow (); + if (TARGET_MIPS16) + mips16_lay_out_constants (); + shorten_branches (insn); + final_start_function (insn, file, 1); + final (insn, file, 1); + final_end_function (); + + /* Clean up the vars set above. Note that final_end_function resets + the global pointer for us. */ + reload_completed = 0; + no_new_pseudos = 0; +} + +/* Returns nonzero if X contains a SYMBOL_REF. */ + +static int +symbolic_expression_p (rtx x) +{ + if (GET_CODE (x) == SYMBOL_REF) + return 1; + + if (GET_CODE (x) == CONST) + return symbolic_expression_p (XEXP (x, 0)); + + if (UNARY_P (x)) + return symbolic_expression_p (XEXP (x, 0)); + + if (ARITHMETIC_P (x)) + return (symbolic_expression_p (XEXP (x, 0)) + || symbolic_expression_p (XEXP (x, 1))); + + return 0; +} + +/* Choose the section to use for the constant rtx expression X that has + mode MODE. */ + +static section * +mips_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align) +{ + if (TARGET_MIPS16) + { + /* In mips16 mode, the constant table always goes in the same section + as the function, so that constants can be loaded using PC relative + addressing. */ + return function_section (current_function_decl); + } + else if (TARGET_EMBEDDED_DATA) + { + /* For embedded applications, always put constants in read-only data, + in order to reduce RAM usage. */ + return mergeable_constant_section (mode, align, 0); + } + else + { + /* For hosted applications, always put constants in small data if + possible, as this gives the best performance. */ + /* ??? Consider using mergeable small data sections. */ + + if (GET_MODE_SIZE (mode) <= (unsigned) mips_section_threshold + && mips_section_threshold > 0) + return get_named_section (NULL, ".sdata", 0); + else if (flag_pic && symbolic_expression_p (x)) + return get_named_section (NULL, ".data.rel.ro", 3); + else + return mergeable_constant_section (mode, align, 0); + } +} + +/* Implement TARGET_ASM_FUNCTION_RODATA_SECTION. + + The complication here is that, with the combination TARGET_ABICALLS + && !TARGET_GPWORD, jump tables will use absolute addresses, and should + therefore not be included in the read-only part of a DSO. Handle such + cases by selecting a normal data section instead of a read-only one. + The logic apes that in default_function_rodata_section. */ + +static section * +mips_function_rodata_section (tree decl) +{ + if (!TARGET_ABICALLS || TARGET_GPWORD) + return default_function_rodata_section (decl); + + if (decl && DECL_SECTION_NAME (decl)) + { + const char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + if (DECL_ONE_ONLY (decl) && strncmp (name, ".gnu.linkonce.t.", 16) == 0) + { + char *rname = ASTRDUP (name); + rname[14] = 'd'; + return get_section (rname, SECTION_LINKONCE | SECTION_WRITE, decl); + } + else if (flag_function_sections && flag_data_sections + && strncmp (name, ".text.", 6) == 0) + { + char *rname = ASTRDUP (name); + memcpy (rname + 1, "data", 4); + return get_section (rname, SECTION_WRITE, decl); + } + } + return data_section; +} + +/* Implement TARGET_IN_SMALL_DATA_P. This function controls whether + locally-defined objects go in a small data section. It also controls + the setting of the SYMBOL_REF_SMALL_P flag, which in turn helps + mips_classify_symbol decide when to use %gp_rel(...)($gp) accesses. */ + +static bool +mips_in_small_data_p (tree decl) +{ + HOST_WIDE_INT size; + + if (TREE_CODE (decl) == STRING_CST || TREE_CODE (decl) == FUNCTION_DECL) + return false; + + /* We don't yet generate small-data references for -mabicalls. See related + -G handling in override_options. */ + if (TARGET_ABICALLS) + return false; + + if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0) + { + const char *name; + + /* Reject anything that isn't in a known small-data section. */ + name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0) + return false; + + /* If a symbol is defined externally, the assembler will use the + usual -G rules when deciding how to implement macros. */ + if (TARGET_EXPLICIT_RELOCS || !DECL_EXTERNAL (decl)) + return true; + } + else if (TARGET_EMBEDDED_DATA) + { + /* Don't put constants into the small data section: we want them + to be in ROM rather than RAM. */ + if (TREE_CODE (decl) != VAR_DECL) + return false; + + if (TREE_READONLY (decl) + && !TREE_SIDE_EFFECTS (decl) + && (!DECL_INITIAL (decl) || TREE_CONSTANT (DECL_INITIAL (decl)))) + return false; + } + + size = int_size_in_bytes (TREE_TYPE (decl)); + return (size > 0 && size <= mips_section_threshold); +} + +/* Implement TARGET_USE_ANCHORS_FOR_SYMBOL_P. We don't want to use + anchors for small data: the GP register acts as an anchor in that + case. We also don't want to use them for PC-relative accesses, + where the PC acts as an anchor. */ + +static bool +mips_use_anchors_for_symbol_p (rtx symbol) +{ + switch (mips_classify_symbol (symbol)) + { + case SYMBOL_CONSTANT_POOL: + case SYMBOL_SMALL_DATA: + return false; + + default: + return true; + } +} + +/* See whether VALTYPE is a record whose fields should be returned in + floating-point registers. If so, return the number of fields and + list them in FIELDS (which should have two elements). Return 0 + otherwise. + + For n32 & n64, a structure with one or two fields is returned in + floating-point registers as long as every field has a floating-point + type. */ + +static int +mips_fpr_return_fields (tree valtype, tree *fields) +{ + tree field; + int i; + + if (!TARGET_NEWABI) + return 0; + + if (TREE_CODE (valtype) != RECORD_TYPE) + return 0; + + i = 0; + for (field = TYPE_FIELDS (valtype); field != 0; field = TREE_CHAIN (field)) + { + if (TREE_CODE (field) != FIELD_DECL) + continue; + + if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE) + return 0; + + if (i == 2) + return 0; + + fields[i++] = field; + } + return i; +} + + +/* Implement TARGET_RETURN_IN_MSB. For n32 & n64, we should return + a value in the most significant part of $2/$3 if: + + - the target is big-endian; + + - the value has a structure or union type (we generalize this to + cover aggregates from other languages too); and + + - the structure is not returned in floating-point registers. */ + +static bool +mips_return_in_msb (tree valtype) +{ + tree fields[2]; + + return (TARGET_NEWABI + && TARGET_BIG_ENDIAN + && AGGREGATE_TYPE_P (valtype) + && mips_fpr_return_fields (valtype, fields) == 0); +} + + +/* Return a composite value in a pair of floating-point registers. + MODE1 and OFFSET1 are the mode and byte offset for the first value, + likewise MODE2 and OFFSET2 for the second. MODE is the mode of the + complete value. + + For n32 & n64, $f0 always holds the first value and $f2 the second. + Otherwise the values are packed together as closely as possible. */ + +static rtx +mips_return_fpr_pair (enum machine_mode mode, + enum machine_mode mode1, HOST_WIDE_INT offset1, + enum machine_mode mode2, HOST_WIDE_INT offset2) +{ + int inc; + + inc = (TARGET_NEWABI ? 2 : FP_INC); + return gen_rtx_PARALLEL + (mode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode1, FP_RETURN), + GEN_INT (offset1)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode2, FP_RETURN + inc), + GEN_INT (offset2)))); + +} + + +/* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls, + VALTYPE is the return type and MODE is VOIDmode. For libcalls, + VALTYPE is null and MODE is the mode of the return value. */ + +rtx +mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, + enum machine_mode mode) +{ + if (valtype) + { + tree fields[2]; + int unsignedp; + + mode = TYPE_MODE (valtype); + unsignedp = TYPE_UNSIGNED (valtype); + + /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns + true, we must promote the mode just as PROMOTE_MODE does. */ + mode = promote_mode (valtype, mode, &unsignedp, 1); + + /* Handle structures whose fields are returned in $f0/$f2. */ + switch (mips_fpr_return_fields (valtype, fields)) + { + case 1: + return gen_rtx_REG (mode, FP_RETURN); + + case 2: + return mips_return_fpr_pair (mode, + TYPE_MODE (TREE_TYPE (fields[0])), + int_byte_position (fields[0]), + TYPE_MODE (TREE_TYPE (fields[1])), + int_byte_position (fields[1])); + } + + /* If a value is passed in the most significant part of a register, see + whether we have to round the mode up to a whole number of words. */ + if (mips_return_in_msb (valtype)) + { + HOST_WIDE_INT size = int_size_in_bytes (valtype); + if (size % UNITS_PER_WORD != 0) + { + size += UNITS_PER_WORD - size % UNITS_PER_WORD; + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); + } + } + + /* For EABI, the class of return register depends entirely on MODE. + For example, "struct { some_type x; }" and "union { some_type x; }" + are returned in the same way as a bare "some_type" would be. + Other ABIs only use FPRs for scalar, complex or vector types. */ + if (mips_abi != ABI_EABI && !FLOAT_TYPE_P (valtype)) + return gen_rtx_REG (mode, GP_RETURN); + } + + if ((GET_MODE_CLASS (mode) == MODE_FLOAT + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) + && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE) + return gen_rtx_REG (mode, FP_RETURN); + + /* Handle long doubles for n32 & n64. */ + if (mode == TFmode) + return mips_return_fpr_pair (mode, + DImode, 0, + DImode, GET_MODE_SIZE (mode) / 2); + + if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT + && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2) + return mips_return_fpr_pair (mode, + GET_MODE_INNER (mode), 0, + GET_MODE_INNER (mode), + GET_MODE_SIZE (mode) / 2); + + return gen_rtx_REG (mode, GP_RETURN); +} + +/* Return nonzero when an argument must be passed by reference. */ + +static bool +mips_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode, tree type, + bool named ATTRIBUTE_UNUSED) +{ + if (mips_abi == ABI_EABI) + { + int size; + + /* ??? How should SCmode be handled? */ + if (mode == DImode || mode == DFmode) + return 0; + + size = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + return size == -1 || size > UNITS_PER_WORD; + } + else + { + /* If we have a variable-sized parameter, we have no choice. */ + return targetm.calls.must_pass_in_stack (mode, type); + } +} + +static bool +mips_callee_copies (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, bool named) +{ + return mips_abi == ABI_EABI && named; +} + +/* Return true if registers of class CLASS cannot change from mode FROM + to mode TO. */ + +bool +mips_cannot_change_mode_class (enum machine_mode from, + enum machine_mode to, enum reg_class class) +{ + if (MIN (GET_MODE_SIZE (from), GET_MODE_SIZE (to)) <= UNITS_PER_WORD + && MAX (GET_MODE_SIZE (from), GET_MODE_SIZE (to)) > UNITS_PER_WORD) + { + if (TARGET_BIG_ENDIAN) + { + /* When a multi-word value is stored in paired floating-point + registers, the first register always holds the low word. + We therefore can't allow FPRs to change between single-word + and multi-word modes. */ + if (FP_INC > 1 && reg_classes_intersect_p (FP_REGS, class)) + return true; + } + else + { + /* LO_REGNO == HI_REGNO + 1, so if a multi-word value is stored + in LO and HI, the high word always comes first. We therefore + can't allow values stored in HI to change between single-word + and multi-word modes. + This rule applies to both the original HI/LO pair and the new + DSP accumulators. */ + if (reg_classes_intersect_p (ACC_REGS, class)) + return true; + } + } + /* Loading a 32-bit value into a 64-bit floating-point register + will not sign-extend the value, despite what LOAD_EXTEND_OP says. + We can't allow 64-bit float registers to change from SImode to + to a wider mode. */ + if (TARGET_FLOAT64 + && from == SImode + && GET_MODE_SIZE (to) >= UNITS_PER_WORD + && reg_classes_intersect_p (FP_REGS, class)) + return true; + return false; +} + +/* Return true if X should not be moved directly into register $25. + We need this because many versions of GAS will treat "la $25,foo" as + part of a call sequence and so allow a global "foo" to be lazily bound. */ + +bool +mips_dangerous_for_la25_p (rtx x) +{ + HOST_WIDE_INT offset; + + if (TARGET_EXPLICIT_RELOCS) + return false; + + mips_split_const (x, &x, &offset); + return global_got_operand (x, VOIDmode); +} + +/* Implement PREFERRED_RELOAD_CLASS. */ + +enum reg_class +mips_preferred_reload_class (rtx x, enum reg_class class) +{ + if (mips_dangerous_for_la25_p (x) && reg_class_subset_p (LEA_REGS, class)) + return LEA_REGS; + + if (TARGET_HARD_FLOAT + && FLOAT_MODE_P (GET_MODE (x)) + && reg_class_subset_p (FP_REGS, class)) + return FP_REGS; + + if (reg_class_subset_p (GR_REGS, class)) + class = GR_REGS; + + if (TARGET_MIPS16 && reg_class_subset_p (M16_REGS, class)) + class = M16_REGS; + + return class; +} + +/* This function returns the register class required for a secondary + register when copying between one of the registers in CLASS, and X, + using MODE. If IN_P is nonzero, the copy is going from X to the + register, otherwise the register is the source. A return value of + NO_REGS means that no secondary register is required. */ + +enum reg_class +mips_secondary_reload_class (enum reg_class class, + enum machine_mode mode, rtx x, int in_p) +{ + enum reg_class gr_regs = TARGET_MIPS16 ? M16_REGS : GR_REGS; + int regno = -1; + int gp_reg_p; + + if (REG_P (x)|| GET_CODE (x) == SUBREG) + regno = true_regnum (x); + + gp_reg_p = TARGET_MIPS16 ? M16_REG_P (regno) : GP_REG_P (regno); + + if (mips_dangerous_for_la25_p (x)) + { + gr_regs = LEA_REGS; + if (TEST_HARD_REG_BIT (reg_class_contents[(int) class], 25)) + return gr_regs; + } + + /* Copying from HI or LO to anywhere other than a general register + requires a general register. + This rule applies to both the original HI/LO pair and the new + DSP accumulators. */ + if (reg_class_subset_p (class, ACC_REGS)) + { + if (TARGET_MIPS16 && in_p) + { + /* We can't really copy to HI or LO at all in mips16 mode. */ + return M16_REGS; + } + return gp_reg_p ? NO_REGS : gr_regs; + } + if (ACC_REG_P (regno)) + { + if (TARGET_MIPS16 && ! in_p) + { + /* We can't really copy to HI or LO at all in mips16 mode. */ + return M16_REGS; + } + return class == gr_regs ? NO_REGS : gr_regs; + } + + /* We can only copy a value to a condition code register from a + floating point register, and even then we require a scratch + floating point register. We can only copy a value out of a + condition code register into a general register. */ + if (class == ST_REGS) + { + if (in_p) + return FP_REGS; + return gp_reg_p ? NO_REGS : gr_regs; + } + if (ST_REG_P (regno)) + { + if (! in_p) + return FP_REGS; + return class == gr_regs ? NO_REGS : gr_regs; + } + + if (class == FP_REGS) + { + if (MEM_P (x)) + { + /* In this case we can use lwc1, swc1, ldc1 or sdc1. */ + return NO_REGS; + } + else if (CONSTANT_P (x) && GET_MODE_CLASS (mode) == MODE_FLOAT) + { + /* We can use the l.s and l.d macros to load floating-point + constants. ??? For l.s, we could probably get better + code by returning GR_REGS here. */ + return NO_REGS; + } + else if (gp_reg_p || x == CONST0_RTX (mode)) + { + /* In this case we can use mtc1, mfc1, dmtc1 or dmfc1. */ + return NO_REGS; + } + else if (FP_REG_P (regno)) + { + /* In this case we can use mov.s or mov.d. */ + return NO_REGS; + } + else + { + /* Otherwise, we need to reload through an integer register. */ + return gr_regs; + } + } + + /* In mips16 mode, going between memory and anything but M16_REGS + requires an M16_REG. */ + if (TARGET_MIPS16) + { + if (class != M16_REGS && class != M16_NA_REGS) + { + if (gp_reg_p) + return NO_REGS; + return M16_REGS; + } + if (! gp_reg_p) + { + if (class == M16_REGS || class == M16_NA_REGS) + return NO_REGS; + return M16_REGS; + } + } + + return NO_REGS; +} + +/* Implement CLASS_MAX_NREGS. + + Usually all registers are word-sized. The only supported exception + is -mgp64 -msingle-float, which has 64-bit words but 32-bit float + registers. A word-based calculation is correct even in that case, + since -msingle-float disallows multi-FPR values. + + The FP status registers are an exception to this rule. They are always + 4 bytes wide as they only hold condition code modes, and CCmode is always + considered to be 4 bytes wide. */ + +int +mips_class_max_nregs (enum reg_class class ATTRIBUTE_UNUSED, + enum machine_mode mode) +{ + if (class == ST_REGS) + return (GET_MODE_SIZE (mode) + 3) / 4; + else + return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; +} + +static bool +mips_valid_pointer_mode (enum machine_mode mode) +{ + return (mode == SImode || (TARGET_64BIT && mode == DImode)); +} + +/* Target hook for vector_mode_supported_p. */ + +static bool +mips_vector_mode_supported_p (enum machine_mode mode) +{ + switch (mode) + { + case V2SFmode: + return TARGET_PAIRED_SINGLE_FLOAT; + + case V2HImode: + case V4QImode: + return TARGET_DSP; + + default: + return false; + } +} + +/* If we can access small data directly (using gp-relative relocation + operators) return the small data pointer, otherwise return null. + + For each mips16 function which refers to GP relative symbols, we + use a pseudo register, initialized at the start of the function, to + hold the $gp value. */ + +static rtx +mips16_gp_pseudo_reg (void) +{ + if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX) + { + rtx unspec; + rtx insn, scan; + + cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode); + + /* We want to initialize this to a value which gcc will believe + is constant. */ + start_sequence (); + unspec = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx), UNSPEC_GP); + emit_move_insn (cfun->machine->mips16_gp_pseudo_rtx, + gen_rtx_CONST (Pmode, unspec)); + insn = get_insns (); + end_sequence (); + + push_topmost_sequence (); + /* We need to emit the initialization after the FUNCTION_BEG + note, so that it will be integrated. */ + for (scan = get_insns (); scan != NULL_RTX; scan = NEXT_INSN (scan)) + if (NOTE_P (scan) + && NOTE_LINE_NUMBER (scan) == NOTE_INSN_FUNCTION_BEG) + break; + if (scan == NULL_RTX) + scan = get_insns (); + insn = emit_insn_after (insn, scan); + pop_topmost_sequence (); + } + + return cfun->machine->mips16_gp_pseudo_rtx; +} + +/* Write out code to move floating point arguments in or out of + general registers. Output the instructions to FILE. FP_CODE is + the code describing which arguments are present (see the comment at + the definition of CUMULATIVE_ARGS in mips.h). FROM_FP_P is nonzero if + we are copying from the floating point registers. */ + +static void +mips16_fp_args (FILE *file, int fp_code, int from_fp_p) +{ + const char *s; + int gparg, fparg; + unsigned int f; + + /* This code only works for the original 32 bit ABI and the O64 ABI. */ + gcc_assert (TARGET_OLDABI); + + if (from_fp_p) + s = "mfc1"; + else + s = "mtc1"; + gparg = GP_ARG_FIRST; + fparg = FP_ARG_FIRST; + for (f = (unsigned int) fp_code; f != 0; f >>= 2) + { + if ((f & 3) == 1) + { + if ((fparg & 1) != 0) + ++fparg; + fprintf (file, "\t%s\t%s,%s\n", s, + reg_names[gparg], reg_names[fparg]); + } + else if ((f & 3) == 2) + { + if (TARGET_64BIT) + fprintf (file, "\td%s\t%s,%s\n", s, + reg_names[gparg], reg_names[fparg]); + else + { + if ((fparg & 1) != 0) + ++fparg; + if (TARGET_BIG_ENDIAN) + fprintf (file, "\t%s\t%s,%s\n\t%s\t%s,%s\n", s, + reg_names[gparg], reg_names[fparg + 1], s, + reg_names[gparg + 1], reg_names[fparg]); + else + fprintf (file, "\t%s\t%s,%s\n\t%s\t%s,%s\n", s, + reg_names[gparg], reg_names[fparg], s, + reg_names[gparg + 1], reg_names[fparg + 1]); + ++gparg; + ++fparg; + } + } + else + gcc_unreachable (); + + ++gparg; + ++fparg; + } +} + +/* Build a mips16 function stub. This is used for functions which + take arguments in the floating point registers. It is 32 bit code + that moves the floating point args into the general registers, and + then jumps to the 16 bit code. */ + +static void +build_mips16_function_stub (FILE *file) +{ + const char *fnname; + char *secname, *stubname; + tree stubid, stubdecl; + int need_comma; + unsigned int f; + + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + secname = (char *) alloca (strlen (fnname) + 20); + sprintf (secname, ".mips16.fn.%s", fnname); + stubname = (char *) alloca (strlen (fnname) + 20); + sprintf (stubname, "__fn_stub_%s", fnname); + stubid = get_identifier (stubname); + stubdecl = build_decl (FUNCTION_DECL, stubid, + build_function_type (void_type_node, NULL_TREE)); + DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname); + + fprintf (file, "\t# Stub function for %s (", current_function_name ()); + need_comma = 0; + for (f = (unsigned int) current_function_args_info.fp_code; f != 0; f >>= 2) + { + fprintf (file, "%s%s", + need_comma ? ", " : "", + (f & 3) == 1 ? "float" : "double"); + need_comma = 1; + } + fprintf (file, ")\n"); + + fprintf (file, "\t.set\tnomips16\n"); + switch_to_section (function_section (stubdecl)); + ASM_OUTPUT_ALIGN (file, floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT)); + + /* ??? If FUNCTION_NAME_ALREADY_DECLARED is defined, then we are + within a .ent, and we cannot emit another .ent. */ + if (!FUNCTION_NAME_ALREADY_DECLARED) + { + fputs ("\t.ent\t", file); + assemble_name (file, stubname); + fputs ("\n", file); + } + + assemble_name (file, stubname); + fputs (":\n", file); + + /* We don't want the assembler to insert any nops here. */ + fprintf (file, "\t.set\tnoreorder\n"); + + mips16_fp_args (file, current_function_args_info.fp_code, 1); + + fprintf (asm_out_file, "\t.set\tnoat\n"); + fprintf (asm_out_file, "\tla\t%s,", reg_names[GP_REG_FIRST + 1]); + assemble_name (file, fnname); + fprintf (file, "\n"); + fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 1]); + fprintf (asm_out_file, "\t.set\tat\n"); + + /* Unfortunately, we can't fill the jump delay slot. We can't fill + with one of the mfc1 instructions, because the result is not + available for one instruction, so if the very first instruction + in the function refers to the register, it will see the wrong + value. */ + fprintf (file, "\tnop\n"); + + fprintf (file, "\t.set\treorder\n"); + + if (!FUNCTION_NAME_ALREADY_DECLARED) + { + fputs ("\t.end\t", file); + assemble_name (file, stubname); + fputs ("\n", file); + } + + fprintf (file, "\t.set\tmips16\n"); + + switch_to_section (function_section (current_function_decl)); +} + +/* We keep a list of functions for which we have already built stubs + in build_mips16_call_stub. */ + +struct mips16_stub +{ + struct mips16_stub *next; + char *name; + int fpret; +}; + +static struct mips16_stub *mips16_stubs; + +/* Build a call stub for a mips16 call. A stub is needed if we are + passing any floating point values which should go into the floating + point registers. If we are, and the call turns out to be to a 32 + bit function, the stub will be used to move the values into the + floating point registers before calling the 32 bit function. The + linker will magically adjust the function call to either the 16 bit + function or the 32 bit stub, depending upon where the function call + is actually defined. + + Similarly, we need a stub if the return value might come back in a + floating point register. + + RETVAL is the location of the return value, or null if this is + a call rather than a call_value. FN is the address of the + function and ARG_SIZE is the size of the arguments. FP_CODE + is the code built by function_arg. This function returns a nonzero + value if it builds the call instruction itself. */ + +int +build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code) +{ + int fpret; + const char *fnname; + char *secname, *stubname; + struct mips16_stub *l; + tree stubid, stubdecl; + int need_comma; + unsigned int f; + + /* We don't need to do anything if we aren't in mips16 mode, or if + we were invoked with the -msoft-float option. */ + if (! TARGET_MIPS16 || ! mips16_hard_float) + return 0; + + /* Figure out whether the value might come back in a floating point + register. */ + fpret = (retval != 0 + && GET_MODE_CLASS (GET_MODE (retval)) == MODE_FLOAT + && GET_MODE_SIZE (GET_MODE (retval)) <= UNITS_PER_FPVALUE); + + /* We don't need to do anything if there were no floating point + arguments and the value will not be returned in a floating point + register. */ + if (fp_code == 0 && ! fpret) + return 0; + + /* We don't need to do anything if this is a call to a special + mips16 support function. */ + if (GET_CODE (fn) == SYMBOL_REF + && strncmp (XSTR (fn, 0), "__mips16_", 9) == 0) + return 0; + + /* This code will only work for o32 and o64 abis. The other ABI's + require more sophisticated support. */ + gcc_assert (TARGET_OLDABI); + + /* We can only handle SFmode and DFmode floating point return + values. */ + if (fpret) + gcc_assert (GET_MODE (retval) == SFmode || GET_MODE (retval) == DFmode); + + /* If we're calling via a function pointer, then we must always call + via a stub. There are magic stubs provided in libgcc.a for each + of the required cases. Each of them expects the function address + to arrive in register $2. */ + + if (GET_CODE (fn) != SYMBOL_REF) + { + char buf[30]; + tree id; + rtx stub_fn, insn; + + /* ??? If this code is modified to support other ABI's, we need + to handle PARALLEL return values here. */ + + sprintf (buf, "__mips16_call_stub_%s%d", + (fpret + ? (GET_MODE (retval) == SFmode ? "sf_" : "df_") + : ""), + fp_code); + id = get_identifier (buf); + stub_fn = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (id)); + + emit_move_insn (gen_rtx_REG (Pmode, 2), fn); + + if (retval == NULL_RTX) + insn = gen_call_internal (stub_fn, arg_size); + else + insn = gen_call_value_internal (retval, stub_fn, arg_size); + insn = emit_call_insn (insn); + + /* Put the register usage information on the CALL. */ + CALL_INSN_FUNCTION_USAGE (insn) = + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 2)), + CALL_INSN_FUNCTION_USAGE (insn)); + + /* If we are handling a floating point return value, we need to + save $18 in the function prologue. Putting a note on the + call will mean that regs_ever_live[$18] will be true if the + call is not eliminated, and we can check that in the prologue + code. */ + if (fpret) + CALL_INSN_FUNCTION_USAGE (insn) = + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_USE (VOIDmode, + gen_rtx_REG (word_mode, 18)), + CALL_INSN_FUNCTION_USAGE (insn)); + + /* Return 1 to tell the caller that we've generated the call + insn. */ + return 1; + } + + /* We know the function we are going to call. If we have already + built a stub, we don't need to do anything further. */ + + fnname = XSTR (fn, 0); + for (l = mips16_stubs; l != NULL; l = l->next) + if (strcmp (l->name, fnname) == 0) + break; + + if (l == NULL) + { + /* Build a special purpose stub. When the linker sees a + function call in mips16 code, it will check where the target + is defined. If the target is a 32 bit call, the linker will + search for the section defined here. It can tell which + symbol this section is associated with by looking at the + relocation information (the name is unreliable, since this + might be a static function). If such a section is found, the + linker will redirect the call to the start of the magic + section. + + If the function does not return a floating point value, the + special stub section is named + .mips16.call.FNNAME + + If the function does return a floating point value, the stub + section is named + .mips16.call.fp.FNNAME + */ + + secname = (char *) alloca (strlen (fnname) + 40); + sprintf (secname, ".mips16.call.%s%s", + fpret ? "fp." : "", + fnname); + stubname = (char *) alloca (strlen (fnname) + 20); + sprintf (stubname, "__call_stub_%s%s", + fpret ? "fp_" : "", + fnname); + stubid = get_identifier (stubname); + stubdecl = build_decl (FUNCTION_DECL, stubid, + build_function_type (void_type_node, NULL_TREE)); + DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname); + + fprintf (asm_out_file, "\t# Stub function to call %s%s (", + (fpret + ? (GET_MODE (retval) == SFmode ? "float " : "double ") + : ""), + fnname); + need_comma = 0; + for (f = (unsigned int) fp_code; f != 0; f >>= 2) + { + fprintf (asm_out_file, "%s%s", + need_comma ? ", " : "", + (f & 3) == 1 ? "float" : "double"); + need_comma = 1; + } + fprintf (asm_out_file, ")\n"); + + fprintf (asm_out_file, "\t.set\tnomips16\n"); + assemble_start_function (stubdecl, stubname); + + if (!FUNCTION_NAME_ALREADY_DECLARED) + { + fputs ("\t.ent\t", asm_out_file); + assemble_name (asm_out_file, stubname); + fputs ("\n", asm_out_file); + + assemble_name (asm_out_file, stubname); + fputs (":\n", asm_out_file); + } + + /* We build the stub code by hand. That's the only way we can + do it, since we can't generate 32 bit code during a 16 bit + compilation. */ + + /* We don't want the assembler to insert any nops here. */ + fprintf (asm_out_file, "\t.set\tnoreorder\n"); + + mips16_fp_args (asm_out_file, fp_code, 0); + + if (! fpret) + { + fprintf (asm_out_file, "\t.set\tnoat\n"); + fprintf (asm_out_file, "\tla\t%s,%s\n", reg_names[GP_REG_FIRST + 1], + fnname); + fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 1]); + fprintf (asm_out_file, "\t.set\tat\n"); + /* Unfortunately, we can't fill the jump delay slot. We + can't fill with one of the mtc1 instructions, because the + result is not available for one instruction, so if the + very first instruction in the function refers to the + register, it will see the wrong value. */ + fprintf (asm_out_file, "\tnop\n"); + } + else + { + fprintf (asm_out_file, "\tmove\t%s,%s\n", + reg_names[GP_REG_FIRST + 18], reg_names[GP_REG_FIRST + 31]); + fprintf (asm_out_file, "\tjal\t%s\n", fnname); + /* As above, we can't fill the delay slot. */ + fprintf (asm_out_file, "\tnop\n"); + if (GET_MODE (retval) == SFmode) + fprintf (asm_out_file, "\tmfc1\t%s,%s\n", + reg_names[GP_REG_FIRST + 2], reg_names[FP_REG_FIRST + 0]); + else + { + if (TARGET_BIG_ENDIAN) + { + fprintf (asm_out_file, "\tmfc1\t%s,%s\n", + reg_names[GP_REG_FIRST + 2], + reg_names[FP_REG_FIRST + 1]); + fprintf (asm_out_file, "\tmfc1\t%s,%s\n", + reg_names[GP_REG_FIRST + 3], + reg_names[FP_REG_FIRST + 0]); + } + else + { + fprintf (asm_out_file, "\tmfc1\t%s,%s\n", + reg_names[GP_REG_FIRST + 2], + reg_names[FP_REG_FIRST + 0]); + fprintf (asm_out_file, "\tmfc1\t%s,%s\n", + reg_names[GP_REG_FIRST + 3], + reg_names[FP_REG_FIRST + 1]); + } + } + fprintf (asm_out_file, "\tj\t%s\n", reg_names[GP_REG_FIRST + 18]); + /* As above, we can't fill the delay slot. */ + fprintf (asm_out_file, "\tnop\n"); + } + + fprintf (asm_out_file, "\t.set\treorder\n"); + +#ifdef ASM_DECLARE_FUNCTION_SIZE + ASM_DECLARE_FUNCTION_SIZE (asm_out_file, stubname, stubdecl); +#endif + + if (!FUNCTION_NAME_ALREADY_DECLARED) + { + fputs ("\t.end\t", asm_out_file); + assemble_name (asm_out_file, stubname); + fputs ("\n", asm_out_file); + } + + fprintf (asm_out_file, "\t.set\tmips16\n"); + + /* Record this stub. */ + l = (struct mips16_stub *) xmalloc (sizeof *l); + l->name = xstrdup (fnname); + l->fpret = fpret; + l->next = mips16_stubs; + mips16_stubs = l; + } + + /* If we expect a floating point return value, but we've built a + stub which does not expect one, then we're in trouble. We can't + use the existing stub, because it won't handle the floating point + value. We can't build a new stub, because the linker won't know + which stub to use for the various calls in this object file. + Fortunately, this case is illegal, since it means that a function + was declared in two different ways in a single compilation. */ + if (fpret && ! l->fpret) + error ("cannot handle inconsistent calls to %qs", fnname); + + /* If we are calling a stub which handles a floating point return + value, we need to arrange to save $18 in the prologue. We do + this by marking the function call as using the register. The + prologue will later see that it is used, and emit code to save + it. */ + + if (l->fpret) + { + rtx insn; + + if (retval == NULL_RTX) + insn = gen_call_internal (fn, arg_size); + else + insn = gen_call_value_internal (retval, fn, arg_size); + insn = emit_call_insn (insn); + + CALL_INSN_FUNCTION_USAGE (insn) = + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_USE (VOIDmode, gen_rtx_REG (word_mode, 18)), + CALL_INSN_FUNCTION_USAGE (insn)); + + /* Return 1 to tell the caller that we've generated the call + insn. */ + return 1; + } + + /* Return 0 to let the caller generate the call insn. */ + return 0; +} + +/* An entry in the mips16 constant pool. VALUE is the pool constant, + MODE is its mode, and LABEL is the CODE_LABEL associated with it. */ + +struct mips16_constant { + struct mips16_constant *next; + rtx value; + rtx label; + enum machine_mode mode; +}; + +/* Information about an incomplete mips16 constant pool. FIRST is the + first constant, HIGHEST_ADDRESS is the highest address that the first + byte of the pool can have, and INSN_ADDRESS is the current instruction + address. */ + +struct mips16_constant_pool { + struct mips16_constant *first; + int highest_address; + int insn_address; +}; + +/* Add constant VALUE to POOL and return its label. MODE is the + value's mode (used for CONST_INTs, etc.). */ + +static rtx +add_constant (struct mips16_constant_pool *pool, + rtx value, enum machine_mode mode) +{ + struct mips16_constant **p, *c; + bool first_of_size_p; + + /* See whether the constant is already in the pool. If so, return the + existing label, otherwise leave P pointing to the place where the + constant should be added. + + Keep the pool sorted in increasing order of mode size so that we can + reduce the number of alignments needed. */ + first_of_size_p = true; + for (p = &pool->first; *p != 0; p = &(*p)->next) + { + if (mode == (*p)->mode && rtx_equal_p (value, (*p)->value)) + return (*p)->label; + if (GET_MODE_SIZE (mode) < GET_MODE_SIZE ((*p)->mode)) + break; + if (GET_MODE_SIZE (mode) == GET_MODE_SIZE ((*p)->mode)) + first_of_size_p = false; + } + + /* In the worst case, the constant needed by the earliest instruction + will end up at the end of the pool. The entire pool must then be + accessible from that instruction. + + When adding the first constant, set the pool's highest address to + the address of the first out-of-range byte. Adjust this address + downwards each time a new constant is added. */ + if (pool->first == 0) + /* For pc-relative lw, addiu and daddiu instructions, the base PC value + is the address of the instruction with the lowest two bits clear. + The base PC value for ld has the lowest three bits clear. Assume + the worst case here. */ + pool->highest_address = pool->insn_address - (UNITS_PER_WORD - 2) + 0x8000; + pool->highest_address -= GET_MODE_SIZE (mode); + if (first_of_size_p) + /* Take into account the worst possible padding due to alignment. */ + pool->highest_address -= GET_MODE_SIZE (mode) - 1; + + /* Create a new entry. */ + c = (struct mips16_constant *) xmalloc (sizeof *c); + c->value = value; + c->mode = mode; + c->label = gen_label_rtx (); + c->next = *p; + *p = c; + + return c->label; +} + +/* Output constant VALUE after instruction INSN and return the last + instruction emitted. MODE is the mode of the constant. */ + +static rtx +dump_constants_1 (enum machine_mode mode, rtx value, rtx insn) +{ + switch (GET_MODE_CLASS (mode)) + { + case MODE_INT: + { + rtx size = GEN_INT (GET_MODE_SIZE (mode)); + return emit_insn_after (gen_consttable_int (value, size), insn); + } + + case MODE_FLOAT: + return emit_insn_after (gen_consttable_float (value), insn); + + case MODE_VECTOR_FLOAT: + case MODE_VECTOR_INT: + { + int i; + for (i = 0; i < CONST_VECTOR_NUNITS (value); i++) + insn = dump_constants_1 (GET_MODE_INNER (mode), + CONST_VECTOR_ELT (value, i), insn); + return insn; + } + + default: + gcc_unreachable (); + } +} + + +/* Dump out the constants in CONSTANTS after INSN. */ + +static void +dump_constants (struct mips16_constant *constants, rtx insn) +{ + struct mips16_constant *c, *next; + int align; + + align = 0; + for (c = constants; c != NULL; c = next) + { + /* If necessary, increase the alignment of PC. */ + if (align < GET_MODE_SIZE (c->mode)) + { + int align_log = floor_log2 (GET_MODE_SIZE (c->mode)); + insn = emit_insn_after (gen_align (GEN_INT (align_log)), insn); + } + align = GET_MODE_SIZE (c->mode); + + insn = emit_label_after (c->label, insn); + insn = dump_constants_1 (c->mode, c->value, insn); + + next = c->next; + free (c); + } + + emit_barrier_after (insn); +} + +/* Return the length of instruction INSN. */ + +static int +mips16_insn_length (rtx insn) +{ + if (JUMP_P (insn)) + { + rtx body = PATTERN (insn); + if (GET_CODE (body) == ADDR_VEC) + return GET_MODE_SIZE (GET_MODE (body)) * XVECLEN (body, 0); + if (GET_CODE (body) == ADDR_DIFF_VEC) + return GET_MODE_SIZE (GET_MODE (body)) * XVECLEN (body, 1); + } + return get_attr_length (insn); +} + +/* Rewrite *X so that constant pool references refer to the constant's + label instead. DATA points to the constant pool structure. */ + +static int +mips16_rewrite_pool_refs (rtx *x, void *data) +{ + struct mips16_constant_pool *pool = data; + if (GET_CODE (*x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (*x)) + *x = gen_rtx_LABEL_REF (Pmode, add_constant (pool, + get_pool_constant (*x), + get_pool_mode (*x))); + return 0; +} + +/* Build MIPS16 constant pools. */ + +static void +mips16_lay_out_constants (void) +{ + struct mips16_constant_pool pool; + rtx insn, barrier; + + barrier = 0; + memset (&pool, 0, sizeof (pool)); + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + /* Rewrite constant pool references in INSN. */ + if (INSN_P (insn)) + for_each_rtx (&PATTERN (insn), mips16_rewrite_pool_refs, &pool); + + pool.insn_address += mips16_insn_length (insn); + + if (pool.first != NULL) + { + /* If there are no natural barriers between the first user of + the pool and the highest acceptable address, we'll need to + create a new instruction to jump around the constant pool. + In the worst case, this instruction will be 4 bytes long. + + If it's too late to do this transformation after INSN, + do it immediately before INSN. */ + if (barrier == 0 && pool.insn_address + 4 > pool.highest_address) + { + rtx label, jump; + + label = gen_label_rtx (); + + jump = emit_jump_insn_before (gen_jump (label), insn); + JUMP_LABEL (jump) = label; + LABEL_NUSES (label) = 1; + barrier = emit_barrier_after (jump); + + emit_label_after (label, barrier); + pool.insn_address += 4; + } + + /* See whether the constant pool is now out of range of the first + user. If so, output the constants after the previous barrier. + Note that any instructions between BARRIER and INSN (inclusive) + will use negative offsets to refer to the pool. */ + if (pool.insn_address > pool.highest_address) + { + dump_constants (pool.first, barrier); + pool.first = NULL; + barrier = 0; + } + else if (BARRIER_P (insn)) + barrier = insn; + } + } + dump_constants (pool.first, get_last_insn ()); +} + +/* A temporary variable used by for_each_rtx callbacks, etc. */ +static rtx mips_sim_insn; + +/* A structure representing the state of the processor pipeline. + Used by the mips_sim_* family of functions. */ +struct mips_sim { + /* The maximum number of instructions that can be issued in a cycle. + (Caches mips_issue_rate.) */ + unsigned int issue_rate; + + /* The current simulation time. */ + unsigned int time; + + /* How many more instructions can be issued in the current cycle. */ + unsigned int insns_left; + + /* LAST_SET[X].INSN is the last instruction to set register X. + LAST_SET[X].TIME is the time at which that instruction was issued. + INSN is null if no instruction has yet set register X. */ + struct { + rtx insn; + unsigned int time; + } last_set[FIRST_PSEUDO_REGISTER]; + + /* The pipeline's current DFA state. */ + state_t dfa_state; +}; + +/* Reset STATE to the initial simulation state. */ + +static void +mips_sim_reset (struct mips_sim *state) +{ + state->time = 0; + state->insns_left = state->issue_rate; + memset (&state->last_set, 0, sizeof (state->last_set)); + state_reset (state->dfa_state); +} + +/* Initialize STATE before its first use. DFA_STATE points to an + allocated but uninitialized DFA state. */ + +static void +mips_sim_init (struct mips_sim *state, state_t dfa_state) +{ + state->issue_rate = mips_issue_rate (); + state->dfa_state = dfa_state; + mips_sim_reset (state); +} + +/* Advance STATE by one clock cycle. */ + +static void +mips_sim_next_cycle (struct mips_sim *state) +{ + state->time++; + state->insns_left = state->issue_rate; + state_transition (state->dfa_state, 0); +} + +/* Advance simulation state STATE until instruction INSN can read + register REG. */ + +static void +mips_sim_wait_reg (struct mips_sim *state, rtx insn, rtx reg) +{ + unsigned int i; + + for (i = 0; i < HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)); i++) + if (state->last_set[REGNO (reg) + i].insn != 0) + { + unsigned int t; + + t = state->last_set[REGNO (reg) + i].time; + t += insn_latency (state->last_set[REGNO (reg) + i].insn, insn); + while (state->time < t) + mips_sim_next_cycle (state); + } +} + +/* A for_each_rtx callback. If *X is a register, advance simulation state + DATA until mips_sim_insn can read the register's value. */ + +static int +mips_sim_wait_regs_2 (rtx *x, void *data) +{ + if (REG_P (*x)) + mips_sim_wait_reg (data, mips_sim_insn, *x); + return 0; +} + +/* Call mips_sim_wait_regs_2 (R, DATA) for each register R mentioned in *X. */ + +static void +mips_sim_wait_regs_1 (rtx *x, void *data) +{ + for_each_rtx (x, mips_sim_wait_regs_2, data); +} + +/* Advance simulation state STATE until all of INSN's register + dependencies are satisfied. */ + +static void +mips_sim_wait_regs (struct mips_sim *state, rtx insn) +{ + mips_sim_insn = insn; + note_uses (&PATTERN (insn), mips_sim_wait_regs_1, state); +} + +/* Advance simulation state STATE until the units required by + instruction INSN are available. */ + +static void +mips_sim_wait_units (struct mips_sim *state, rtx insn) +{ + state_t tmp_state; + + tmp_state = alloca (state_size ()); + while (state->insns_left == 0 + || (memcpy (tmp_state, state->dfa_state, state_size ()), + state_transition (tmp_state, insn) >= 0)) + mips_sim_next_cycle (state); +} + +/* Advance simulation state STATE until INSN is ready to issue. */ + +static void +mips_sim_wait_insn (struct mips_sim *state, rtx insn) +{ + mips_sim_wait_regs (state, insn); + mips_sim_wait_units (state, insn); +} + +/* mips_sim_insn has just set X. Update the LAST_SET array + in simulation state DATA. */ + +static void +mips_sim_record_set (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data) +{ + struct mips_sim *state; + unsigned int i; + + state = data; + if (REG_P (x)) + for (i = 0; i < HARD_REGNO_NREGS (REGNO (x), GET_MODE (x)); i++) + { + state->last_set[REGNO (x) + i].insn = mips_sim_insn; + state->last_set[REGNO (x) + i].time = state->time; + } +} + +/* Issue instruction INSN in scheduler state STATE. Assume that INSN + can issue immediately (i.e., that mips_sim_wait_insn has already + been called). */ + +static void +mips_sim_issue_insn (struct mips_sim *state, rtx insn) +{ + state_transition (state->dfa_state, insn); + state->insns_left--; + + mips_sim_insn = insn; + note_stores (PATTERN (insn), mips_sim_record_set, state); +} + +/* Simulate issuing a NOP in state STATE. */ + +static void +mips_sim_issue_nop (struct mips_sim *state) +{ + if (state->insns_left == 0) + mips_sim_next_cycle (state); + state->insns_left--; +} + +/* Update simulation state STATE so that it's ready to accept the instruction + after INSN. INSN should be part of the main rtl chain, not a member of a + SEQUENCE. */ + +static void +mips_sim_finish_insn (struct mips_sim *state, rtx insn) +{ + /* If INSN is a jump with an implicit delay slot, simulate a nop. */ + if (JUMP_P (insn)) + mips_sim_issue_nop (state); + + switch (GET_CODE (SEQ_BEGIN (insn))) + { + case CODE_LABEL: + case CALL_INSN: + /* We can't predict the processor state after a call or label. */ + mips_sim_reset (state); + break; + + case JUMP_INSN: + /* The delay slots of branch likely instructions are only executed + when the branch is taken. Therefore, if the caller has simulated + the delay slot instruction, STATE does not really reflect the state + of the pipeline for the instruction after the delay slot. Also, + branch likely instructions tend to incur a penalty when not taken, + so there will probably be an extra delay between the branch and + the instruction after the delay slot. */ + if (INSN_ANNULLED_BRANCH_P (SEQ_BEGIN (insn))) + mips_sim_reset (state); + break; + + default: + break; + } +} + +/* The VR4130 pipeline issues aligned pairs of instructions together, + but it stalls the second instruction if it depends on the first. + In order to cut down the amount of logic required, this dependence + check is not based on a full instruction decode. Instead, any non-SPECIAL + instruction is assumed to modify the register specified by bits 20-16 + (which is usually the "rt" field). + + In beq, beql, bne and bnel instructions, the rt field is actually an + input, so we can end up with a false dependence between the branch + and its delay slot. If this situation occurs in instruction INSN, + try to avoid it by swapping rs and rt. */ + +static void +vr4130_avoid_branch_rt_conflict (rtx insn) +{ + rtx first, second; + + first = SEQ_BEGIN (insn); + second = SEQ_END (insn); + if (JUMP_P (first) + && NONJUMP_INSN_P (second) + && GET_CODE (PATTERN (first)) == SET + && GET_CODE (SET_DEST (PATTERN (first))) == PC + && GET_CODE (SET_SRC (PATTERN (first))) == IF_THEN_ELSE) + { + /* Check for the right kind of condition. */ + rtx cond = XEXP (SET_SRC (PATTERN (first)), 0); + if ((GET_CODE (cond) == EQ || GET_CODE (cond) == NE) + && REG_P (XEXP (cond, 0)) + && REG_P (XEXP (cond, 1)) + && reg_referenced_p (XEXP (cond, 1), PATTERN (second)) + && !reg_referenced_p (XEXP (cond, 0), PATTERN (second))) + { + /* SECOND mentions the rt register but not the rs register. */ + rtx tmp = XEXP (cond, 0); + XEXP (cond, 0) = XEXP (cond, 1); + XEXP (cond, 1) = tmp; + } + } +} + +/* Implement -mvr4130-align. Go through each basic block and simulate the + processor pipeline. If we find that a pair of instructions could execute + in parallel, and the first of those instruction is not 8-byte aligned, + insert a nop to make it aligned. */ + +static void +vr4130_align_insns (void) +{ + struct mips_sim state; + rtx insn, subinsn, last, last2, next; + bool aligned_p; + + dfa_start (); + + /* LAST is the last instruction before INSN to have a nonzero length. + LAST2 is the last such instruction before LAST. */ + last = 0; + last2 = 0; + + /* ALIGNED_P is true if INSN is known to be at an aligned address. */ + aligned_p = true; + + mips_sim_init (&state, alloca (state_size ())); + for (insn = get_insns (); insn != 0; insn = next) + { + unsigned int length; + + next = NEXT_INSN (insn); + + /* See the comment above vr4130_avoid_branch_rt_conflict for details. + This isn't really related to the alignment pass, but we do it on + the fly to avoid a separate instruction walk. */ + vr4130_avoid_branch_rt_conflict (insn); + + if (USEFUL_INSN_P (insn)) + FOR_EACH_SUBINSN (subinsn, insn) + { + mips_sim_wait_insn (&state, subinsn); + + /* If we want this instruction to issue in parallel with the + previous one, make sure that the previous instruction is + aligned. There are several reasons why this isn't worthwhile + when the second instruction is a call: + + - Calls are less likely to be performance critical, + - There's a good chance that the delay slot can execute + in parallel with the call. + - The return address would then be unaligned. + + In general, if we're going to insert a nop between instructions + X and Y, it's better to insert it immediately after X. That + way, if the nop makes Y aligned, it will also align any labels + between X and Y. */ + if (state.insns_left != state.issue_rate + && !CALL_P (subinsn)) + { + if (subinsn == SEQ_BEGIN (insn) && aligned_p) + { + /* SUBINSN is the first instruction in INSN and INSN is + aligned. We want to align the previous instruction + instead, so insert a nop between LAST2 and LAST. + + Note that LAST could be either a single instruction + or a branch with a delay slot. In the latter case, + LAST, like INSN, is already aligned, but the delay + slot must have some extra delay that stops it from + issuing at the same time as the branch. We therefore + insert a nop before the branch in order to align its + delay slot. */ + emit_insn_after (gen_nop (), last2); + aligned_p = false; + } + else if (subinsn != SEQ_BEGIN (insn) && !aligned_p) + { + /* SUBINSN is the delay slot of INSN, but INSN is + currently unaligned. Insert a nop between + LAST and INSN to align it. */ + emit_insn_after (gen_nop (), last); + aligned_p = true; + } + } + mips_sim_issue_insn (&state, subinsn); + } + mips_sim_finish_insn (&state, insn); + + /* Update LAST, LAST2 and ALIGNED_P for the next instruction. */ + length = get_attr_length (insn); + if (length > 0) + { + /* If the instruction is an asm statement or multi-instruction + mips.md patern, the length is only an estimate. Insert an + 8 byte alignment after it so that the following instructions + can be handled correctly. */ + if (NONJUMP_INSN_P (SEQ_BEGIN (insn)) + && (recog_memoized (insn) < 0 || length >= 8)) + { + next = emit_insn_after (gen_align (GEN_INT (3)), insn); + next = NEXT_INSN (next); + mips_sim_next_cycle (&state); + aligned_p = true; + } + else if (length & 4) + aligned_p = !aligned_p; + last2 = last; + last = insn; + } + + /* See whether INSN is an aligned label. */ + if (LABEL_P (insn) && label_to_alignment (insn) >= 3) + aligned_p = true; + } + dfa_finish (); +} + +/* Subroutine of mips_reorg. If there is a hazard between INSN + and a previous instruction, avoid it by inserting nops after + instruction AFTER. + + *DELAYED_REG and *HILO_DELAY describe the hazards that apply at + this point. If *DELAYED_REG is non-null, INSN must wait a cycle + before using the value of that register. *HILO_DELAY counts the + number of instructions since the last hilo hazard (that is, + the number of instructions since the last mflo or mfhi). + + After inserting nops for INSN, update *DELAYED_REG and *HILO_DELAY + for the next instruction. + + LO_REG is an rtx for the LO register, used in dependence checking. */ + +static void +mips_avoid_hazard (rtx after, rtx insn, int *hilo_delay, + rtx *delayed_reg, rtx lo_reg) +{ + rtx pattern, set; + int nops, ninsns; + + if (!INSN_P (insn)) + return; + + pattern = PATTERN (insn); + + /* Do not put the whole function in .set noreorder if it contains + an asm statement. We don't know whether there will be hazards + between the asm statement and the gcc-generated code. */ + if (GET_CODE (pattern) == ASM_INPUT || asm_noperands (pattern) >= 0) + cfun->machine->all_noreorder_p = false; + + /* Ignore zero-length instructions (barriers and the like). */ + ninsns = get_attr_length (insn) / 4; + if (ninsns == 0) + return; + + /* Work out how many nops are needed. Note that we only care about + registers that are explicitly mentioned in the instruction's pattern. + It doesn't matter that calls use the argument registers or that they + clobber hi and lo. */ + if (*hilo_delay < 2 && reg_set_p (lo_reg, pattern)) + nops = 2 - *hilo_delay; + else if (*delayed_reg != 0 && reg_referenced_p (*delayed_reg, pattern)) + nops = 1; + else + nops = 0; + + /* Insert the nops between this instruction and the previous one. + Each new nop takes us further from the last hilo hazard. */ + *hilo_delay += nops; + while (nops-- > 0) + emit_insn_after (gen_hazard_nop (), after); + + /* Set up the state for the next instruction. */ + *hilo_delay += ninsns; + *delayed_reg = 0; + if (INSN_CODE (insn) >= 0) + switch (get_attr_hazard (insn)) + { + case HAZARD_NONE: + break; + + case HAZARD_HILO: + *hilo_delay = 0; + break; + + case HAZARD_DELAY: + set = single_set (insn); + gcc_assert (set != 0); + *delayed_reg = SET_DEST (set); + break; + } +} + + +/* Go through the instruction stream and insert nops where necessary. + See if the whole function can then be put into .set noreorder & + .set nomacro. */ + +static void +mips_avoid_hazards (void) +{ + rtx insn, last_insn, lo_reg, delayed_reg; + int hilo_delay, i; + + /* Force all instructions to be split into their final form. */ + split_all_insns_noflow (); + + /* Recalculate instruction lengths without taking nops into account. */ + cfun->machine->ignore_hazard_length_p = true; + shorten_branches (get_insns ()); + + cfun->machine->all_noreorder_p = true; + + /* Profiled functions can't be all noreorder because the profiler + support uses assembler macros. */ + if (current_function_profile) + cfun->machine->all_noreorder_p = false; + + /* Code compiled with -mfix-vr4120 can't be all noreorder because + we rely on the assembler to work around some errata. */ + if (TARGET_FIX_VR4120) + cfun->machine->all_noreorder_p = false; + + /* The same is true for -mfix-vr4130 if we might generate mflo or + mfhi instructions. Note that we avoid using mflo and mfhi if + the VR4130 macc and dmacc instructions are available instead; + see the *mfhilo_{si,di}_macc patterns. */ + if (TARGET_FIX_VR4130 && !ISA_HAS_MACCHI) + cfun->machine->all_noreorder_p = false; + + last_insn = 0; + hilo_delay = 2; + delayed_reg = 0; + lo_reg = gen_rtx_REG (SImode, LO_REGNUM); + + for (insn = get_insns (); insn != 0; insn = NEXT_INSN (insn)) + if (INSN_P (insn)) + { + if (GET_CODE (PATTERN (insn)) == SEQUENCE) + for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) + mips_avoid_hazard (last_insn, XVECEXP (PATTERN (insn), 0, i), + &hilo_delay, &delayed_reg, lo_reg); + else + mips_avoid_hazard (last_insn, insn, &hilo_delay, + &delayed_reg, lo_reg); + + last_insn = insn; + } +} + + +/* Implement TARGET_MACHINE_DEPENDENT_REORG. */ + +static void +mips_reorg (void) +{ + if (TARGET_MIPS16) + mips16_lay_out_constants (); + else if (TARGET_EXPLICIT_RELOCS) + { + if (mips_flag_delayed_branch) + dbr_schedule (get_insns ()); + mips_avoid_hazards (); + if (TUNE_MIPS4130 && TARGET_VR4130_ALIGN) + vr4130_align_insns (); + } +} + +/* This function does three things: + + - Register the special divsi3 and modsi3 functions if -mfix-vr4120. + - Register the mips16 hardware floating point stubs. + - Register the gofast functions if selected using --enable-gofast. */ + +#include "config/gofast.h" + +static void +mips_init_libfuncs (void) +{ + if (TARGET_FIX_VR4120) + { + set_optab_libfunc (sdiv_optab, SImode, "__vr4120_divsi3"); + set_optab_libfunc (smod_optab, SImode, "__vr4120_modsi3"); + } + + if (TARGET_MIPS16 && mips16_hard_float) + { + set_optab_libfunc (add_optab, SFmode, "__mips16_addsf3"); + set_optab_libfunc (sub_optab, SFmode, "__mips16_subsf3"); + set_optab_libfunc (smul_optab, SFmode, "__mips16_mulsf3"); + set_optab_libfunc (sdiv_optab, SFmode, "__mips16_divsf3"); + + set_optab_libfunc (eq_optab, SFmode, "__mips16_eqsf2"); + set_optab_libfunc (ne_optab, SFmode, "__mips16_nesf2"); + set_optab_libfunc (gt_optab, SFmode, "__mips16_gtsf2"); + set_optab_libfunc (ge_optab, SFmode, "__mips16_gesf2"); + set_optab_libfunc (lt_optab, SFmode, "__mips16_ltsf2"); + set_optab_libfunc (le_optab, SFmode, "__mips16_lesf2"); + + set_conv_libfunc (sfix_optab, SImode, SFmode, "__mips16_fix_truncsfsi"); + set_conv_libfunc (sfloat_optab, SFmode, SImode, "__mips16_floatsisf"); + + if (TARGET_DOUBLE_FLOAT) + { + set_optab_libfunc (add_optab, DFmode, "__mips16_adddf3"); + set_optab_libfunc (sub_optab, DFmode, "__mips16_subdf3"); + set_optab_libfunc (smul_optab, DFmode, "__mips16_muldf3"); + set_optab_libfunc (sdiv_optab, DFmode, "__mips16_divdf3"); + + set_optab_libfunc (eq_optab, DFmode, "__mips16_eqdf2"); + set_optab_libfunc (ne_optab, DFmode, "__mips16_nedf2"); + set_optab_libfunc (gt_optab, DFmode, "__mips16_gtdf2"); + set_optab_libfunc (ge_optab, DFmode, "__mips16_gedf2"); + set_optab_libfunc (lt_optab, DFmode, "__mips16_ltdf2"); + set_optab_libfunc (le_optab, DFmode, "__mips16_ledf2"); + + set_conv_libfunc (sext_optab, DFmode, SFmode, "__mips16_extendsfdf2"); + set_conv_libfunc (trunc_optab, SFmode, DFmode, "__mips16_truncdfsf2"); + + set_conv_libfunc (sfix_optab, SImode, DFmode, "__mips16_fix_truncdfsi"); + set_conv_libfunc (sfloat_optab, DFmode, SImode, "__mips16_floatsidf"); + } + } + else + gofast_maybe_init_libfuncs (); +} + +/* Return a number assessing the cost of moving a register in class + FROM to class TO. The classes are expressed using the enumeration + values such as `GENERAL_REGS'. A value of 2 is the default; other + values are interpreted relative to that. + + It is not required that the cost always equal 2 when FROM is the + same as TO; on some machines it is expensive to move between + registers if they are not general registers. + + If reload sees an insn consisting of a single `set' between two + hard registers, and if `REGISTER_MOVE_COST' applied to their + classes returns a value of 2, reload does not check to ensure that + the constraints of the insn are met. Setting a cost of other than + 2 will allow reload to verify that the constraints are met. You + should do this if the `movM' pattern's constraints do not allow + such copying. + + ??? We make the cost of moving from HI/LO into general + registers the same as for one of moving general registers to + HI/LO for TARGET_MIPS16 in order to prevent allocating a + pseudo to HI/LO. This might hurt optimizations though, it + isn't clear if it is wise. And it might not work in all cases. We + could solve the DImode LO reg problem by using a multiply, just + like reload_{in,out}si. We could solve the SImode/HImode HI reg + problem by using divide instructions. divu puts the remainder in + the HI reg, so doing a divide by -1 will move the value in the HI + reg for all values except -1. We could handle that case by using a + signed divide, e.g. -1 / 2 (or maybe 1 / -2?). We'd have to emit + a compare/branch to test the input value to see which instruction + we need to use. This gets pretty messy, but it is feasible. */ + +int +mips_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class to, enum reg_class from) +{ + if (from == M16_REGS && GR_REG_CLASS_P (to)) + return 2; + else if (from == M16_NA_REGS && GR_REG_CLASS_P (to)) + return 2; + else if (GR_REG_CLASS_P (from)) + { + if (to == M16_REGS) + return 2; + else if (to == M16_NA_REGS) + return 2; + else if (GR_REG_CLASS_P (to)) + { + if (TARGET_MIPS16) + return 4; + else + return 2; + } + else if (to == FP_REGS) + return 4; + else if (reg_class_subset_p (to, ACC_REGS)) + { + if (TARGET_MIPS16) + return 12; + else + return 6; + } + else if (COP_REG_CLASS_P (to)) + { + return 5; + } + } + else if (from == FP_REGS) + { + if (GR_REG_CLASS_P (to)) + return 4; + else if (to == FP_REGS) + return 2; + else if (to == ST_REGS) + return 8; + } + else if (reg_class_subset_p (from, ACC_REGS)) + { + if (GR_REG_CLASS_P (to)) + { + if (TARGET_MIPS16) + return 12; + else + return 6; + } + } + else if (from == ST_REGS && GR_REG_CLASS_P (to)) + return 4; + else if (COP_REG_CLASS_P (from)) + { + return 5; + } + + /* Fall through. + ??? What cases are these? Shouldn't we return 2 here? */ + + return 12; +} + +/* Return the length of INSN. LENGTH is the initial length computed by + attributes in the machine-description file. */ + +int +mips_adjust_insn_length (rtx insn, int length) +{ + /* A unconditional jump has an unfilled delay slot if it is not part + of a sequence. A conditional jump normally has a delay slot, but + does not on MIPS16. */ + if (CALL_P (insn) || (TARGET_MIPS16 ? simplejump_p (insn) : JUMP_P (insn))) + length += 4; + + /* See how many nops might be needed to avoid hardware hazards. */ + if (!cfun->machine->ignore_hazard_length_p && INSN_CODE (insn) >= 0) + switch (get_attr_hazard (insn)) + { + case HAZARD_NONE: + break; + + case HAZARD_DELAY: + length += 4; + break; + + case HAZARD_HILO: + length += 8; + break; + } + + /* All MIPS16 instructions are a measly two bytes. */ + if (TARGET_MIPS16) + length /= 2; + + return length; +} + + +/* Return an asm sequence to start a noat block and load the address + of a label into $1. */ + +const char * +mips_output_load_label (void) +{ + if (TARGET_EXPLICIT_RELOCS) + switch (mips_abi) + { + case ABI_N32: + return "%[lw\t%@,%%got_page(%0)(%+)\n\taddiu\t%@,%@,%%got_ofst(%0)"; + + case ABI_64: + return "%[ld\t%@,%%got_page(%0)(%+)\n\tdaddiu\t%@,%@,%%got_ofst(%0)"; + + default: + if (ISA_HAS_LOAD_DELAY) + return "%[lw\t%@,%%got(%0)(%+)%#\n\taddiu\t%@,%@,%%lo(%0)"; + return "%[lw\t%@,%%got(%0)(%+)\n\taddiu\t%@,%@,%%lo(%0)"; + } + else + { + if (Pmode == DImode) + return "%[dla\t%@,%0"; + else + return "%[la\t%@,%0"; + } +} + +/* Return the assembly code for INSN, which has the operands given by + OPERANDS, and which branches to OPERANDS[1] if some condition is true. + BRANCH_IF_TRUE is the asm template that should be used if OPERANDS[1] + is in range of a direct branch. BRANCH_IF_FALSE is an inverted + version of BRANCH_IF_TRUE. */ + +const char * +mips_output_conditional_branch (rtx insn, rtx *operands, + const char *branch_if_true, + const char *branch_if_false) +{ + unsigned int length; + rtx taken, not_taken; + + length = get_attr_length (insn); + if (length <= 8) + { + /* Just a simple conditional branch. */ + mips_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn)); + return branch_if_true; + } + + /* Generate a reversed branch around a direct jump. This fallback does + not use branch-likely instructions. */ + mips_branch_likely = false; + not_taken = gen_label_rtx (); + taken = operands[1]; + + /* Generate the reversed branch to NOT_TAKEN. */ + operands[1] = not_taken; + output_asm_insn (branch_if_false, operands); + + /* If INSN has a delay slot, we must provide delay slots for both the + branch to NOT_TAKEN and the conditional jump. We must also ensure + that INSN's delay slot is executed in the appropriate cases. */ + if (final_sequence) + { + /* This first delay slot will always be executed, so use INSN's + delay slot if is not annulled. */ + if (!INSN_ANNULLED_BRANCH_P (insn)) + { + final_scan_insn (XVECEXP (final_sequence, 0, 1), + asm_out_file, optimize, 1, NULL); + INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1; + } + else + output_asm_insn ("nop", 0); + fprintf (asm_out_file, "\n"); + } + + /* Output the unconditional branch to TAKEN. */ + if (length <= 16) + output_asm_insn ("j\t%0%/", &taken); + else + { + output_asm_insn (mips_output_load_label (), &taken); + output_asm_insn ("jr\t%@%]%/", 0); + } + + /* Now deal with its delay slot; see above. */ + if (final_sequence) + { + /* This delay slot will only be executed if the branch is taken. + Use INSN's delay slot if is annulled. */ + if (INSN_ANNULLED_BRANCH_P (insn)) + { + final_scan_insn (XVECEXP (final_sequence, 0, 1), + asm_out_file, optimize, 1, NULL); + INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1; + } + else + output_asm_insn ("nop", 0); + fprintf (asm_out_file, "\n"); + } + + /* Output NOT_TAKEN. */ + (*targetm.asm_out.internal_label) (asm_out_file, "L", + CODE_LABEL_NUMBER (not_taken)); + return ""; +} + +/* Return the assembly code for INSN, which branches to OPERANDS[1] + if some ordered condition is true. The condition is given by + OPERANDS[0] if !INVERTED_P, otherwise it is the inverse of + OPERANDS[0]. OPERANDS[2] is the comparison's first operand; + its second is always zero. */ + +const char * +mips_output_order_conditional_branch (rtx insn, rtx *operands, bool inverted_p) +{ + const char *branch[2]; + + /* Make BRANCH[1] branch to OPERANDS[1] when the condition is true. + Make BRANCH[0] branch on the inverse condition. */ + switch (GET_CODE (operands[0])) + { + /* These cases are equivalent to comparisons against zero. */ + case LEU: + inverted_p = !inverted_p; + /* Fall through. */ + case GTU: + branch[!inverted_p] = MIPS_BRANCH ("bne", "%2,%.,%1"); + branch[inverted_p] = MIPS_BRANCH ("beq", "%2,%.,%1"); + break; + + /* These cases are always true or always false. */ + case LTU: + inverted_p = !inverted_p; + /* Fall through. */ + case GEU: + branch[!inverted_p] = MIPS_BRANCH ("beq", "%.,%.,%1"); + branch[inverted_p] = MIPS_BRANCH ("bne", "%.,%.,%1"); + break; + + default: + branch[!inverted_p] = MIPS_BRANCH ("b%C0z", "%2,%1"); + branch[inverted_p] = MIPS_BRANCH ("b%N0z", "%2,%1"); + break; + } + return mips_output_conditional_branch (insn, operands, branch[1], branch[0]); +} + +/* Used to output div or ddiv instruction DIVISION, which has the operands + given by OPERANDS. Add in a divide-by-zero check if needed. + + When working around R4000 and R4400 errata, we need to make sure that + the division is not immediately followed by a shift[1][2]. We also + need to stop the division from being put into a branch delay slot[3]. + The easiest way to avoid both problems is to add a nop after the + division. When a divide-by-zero check is needed, this nop can be + used to fill the branch delay slot. + + [1] If a double-word or a variable shift executes immediately + after starting an integer division, the shift may give an + incorrect result. See quotations of errata #16 and #28 from + "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0" + in mips.md for details. + + [2] A similar bug to [1] exists for all revisions of the + R4000 and the R4400 when run in an MC configuration. + From "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0": + + "19. In this following sequence: + + ddiv (or ddivu or div or divu) + dsll32 (or dsrl32, dsra32) + + if an MPT stall occurs, while the divide is slipping the cpu + pipeline, then the following double shift would end up with an + incorrect result. + + Workaround: The compiler needs to avoid generating any + sequence with divide followed by extended double shift." + + This erratum is also present in "MIPS R4400MC Errata, Processor + Revision 1.0" and "MIPS R4400MC Errata, Processor Revision 2.0 + & 3.0" as errata #10 and #4, respectively. + + [3] From "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0" + (also valid for MIPS R4000MC processors): + + "52. R4000SC: This bug does not apply for the R4000PC. + + There are two flavors of this bug: + + 1) If the instruction just after divide takes an RF exception + (tlb-refill, tlb-invalid) and gets an instruction cache + miss (both primary and secondary) and the line which is + currently in secondary cache at this index had the first + data word, where the bits 5..2 are set, then R4000 would + get a wrong result for the div. + + ##1 + nop + div r8, r9 + ------------------- # end-of page. -tlb-refill + nop + ##2 + nop + div r8, r9 + ------------------- # end-of page. -tlb-invalid + nop + + 2) If the divide is in the taken branch delay slot, where the + target takes RF exception and gets an I-cache miss for the + exception vector or where I-cache miss occurs for the + target address, under the above mentioned scenarios, the + div would get wrong results. + + ##1 + j r2 # to next page mapped or unmapped + div r8,r9 # this bug would be there as long + # as there is an ICache miss and + nop # the "data pattern" is present + + ##2 + beq r0, r0, NextPage # to Next page + div r8,r9 + nop + + This bug is present for div, divu, ddiv, and ddivu + instructions. + + Workaround: For item 1), OS could make sure that the next page + after the divide instruction is also mapped. For item 2), the + compiler could make sure that the divide instruction is not in + the branch delay slot." + + These processors have PRId values of 0x00004220 and 0x00004300 for + the R4000 and 0x00004400, 0x00004500 and 0x00004600 for the R4400. */ + +const char * +mips_output_division (const char *division, rtx *operands) +{ + const char *s; + + s = division; + if (TARGET_FIX_R4000 || TARGET_FIX_R4400) + { + output_asm_insn (s, operands); + s = "nop"; + } + if (TARGET_CHECK_ZERO_DIV) + { + if (TARGET_MIPS16) + { + output_asm_insn (s, operands); + s = "bnez\t%2,1f\n\tbreak\t7\n1:"; + } + else if (GENERATE_DIVIDE_TRAPS) + { + output_asm_insn (s, operands); + s = "teq\t%2,%.,7"; + } + else + { + output_asm_insn ("%(bne\t%2,%.,1f", operands); + output_asm_insn (s, operands); + s = "break\t7%)\n1:"; + } + } + return s; +} + +/* Return true if GIVEN is the same as CANONICAL, or if it is CANONICAL + with a final "000" replaced by "k". Ignore case. + + Note: this function is shared between GCC and GAS. */ + +static bool +mips_strict_matching_cpu_name_p (const char *canonical, const char *given) +{ + while (*given != 0 && TOLOWER (*given) == TOLOWER (*canonical)) + given++, canonical++; + + return ((*given == 0 && *canonical == 0) + || (strcmp (canonical, "000") == 0 && strcasecmp (given, "k") == 0)); +} + + +/* Return true if GIVEN matches CANONICAL, where GIVEN is a user-supplied + CPU name. We've traditionally allowed a lot of variation here. + + Note: this function is shared between GCC and GAS. */ + +static bool +mips_matching_cpu_name_p (const char *canonical, const char *given) +{ + /* First see if the name matches exactly, or with a final "000" + turned into "k". */ + if (mips_strict_matching_cpu_name_p (canonical, given)) + return true; + + /* If not, try comparing based on numerical designation alone. + See if GIVEN is an unadorned number, or 'r' followed by a number. */ + if (TOLOWER (*given) == 'r') + given++; + if (!ISDIGIT (*given)) + return false; + + /* Skip over some well-known prefixes in the canonical name, + hoping to find a number there too. */ + if (TOLOWER (canonical[0]) == 'v' && TOLOWER (canonical[1]) == 'r') + canonical += 2; + else if (TOLOWER (canonical[0]) == 'r' && TOLOWER (canonical[1]) == 'm') + canonical += 2; + else if (TOLOWER (canonical[0]) == 'r') + canonical += 1; + + return mips_strict_matching_cpu_name_p (canonical, given); +} + + +/* Return the mips_cpu_info entry for the processor or ISA given + by CPU_STRING. Return null if the string isn't recognized. + + A similar function exists in GAS. */ + +static const struct mips_cpu_info * +mips_parse_cpu (const char *cpu_string) +{ + const struct mips_cpu_info *p; + const char *s; + + /* In the past, we allowed upper-case CPU names, but it doesn't + work well with the multilib machinery. */ + for (s = cpu_string; *s != 0; s++) + if (ISUPPER (*s)) + { + warning (0, "the cpu name must be lower case"); + break; + } + + /* 'from-abi' selects the most compatible architecture for the given + ABI: MIPS I for 32-bit ABIs and MIPS III for 64-bit ABIs. For the + EABIs, we have to decide whether we're using the 32-bit or 64-bit + version. Look first at the -mgp options, if given, otherwise base + the choice on MASK_64BIT in TARGET_DEFAULT. */ + if (strcasecmp (cpu_string, "from-abi") == 0) + return mips_cpu_info_from_isa (ABI_NEEDS_32BIT_REGS ? 1 + : ABI_NEEDS_64BIT_REGS ? 3 + : (TARGET_64BIT ? 3 : 1)); + + /* 'default' has traditionally been a no-op. Probably not very useful. */ + if (strcasecmp (cpu_string, "default") == 0) + return 0; + + for (p = mips_cpu_info_table; p->name != 0; p++) + if (mips_matching_cpu_name_p (p->name, cpu_string)) + return p; + + return 0; +} + + +/* Return the processor associated with the given ISA level, or null + if the ISA isn't valid. */ + +static const struct mips_cpu_info * +mips_cpu_info_from_isa (int isa) +{ + const struct mips_cpu_info *p; + + for (p = mips_cpu_info_table; p->name != 0; p++) + if (p->isa == isa) + return p; + + return 0; +} + +/* Implement HARD_REGNO_NREGS. The size of FP registers is controlled + by UNITS_PER_FPREG. The size of FP status registers is always 4, because + they only hold condition code modes, and CCmode is always considered to + be 4 bytes wide. All other registers are word sized. */ + +unsigned int +mips_hard_regno_nregs (int regno, enum machine_mode mode) +{ + if (ST_REG_P (regno)) + return ((GET_MODE_SIZE (mode) + 3) / 4); + else if (! FP_REG_P (regno)) + return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); + else + return ((GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG); +} + +/* Implement TARGET_RETURN_IN_MEMORY. Under the old (i.e., 32 and O64 ABIs) + all BLKmode objects are returned in memory. Under the new (N32 and + 64-bit MIPS ABIs) small structures are returned in a register. + Objects with varying size must still be returned in memory, of + course. */ + +static bool +mips_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) +{ + if (TARGET_OLDABI) + return (TYPE_MODE (type) == BLKmode); + else + return ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD)) + || (int_size_in_bytes (type) == -1)); +} + +static bool +mips_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) +{ + return !TARGET_OLDABI; +} + +/* Return true if INSN is a multiply-add or multiply-subtract + instruction and PREV assigns to the accumulator operand. */ + +bool +mips_linked_madd_p (rtx prev, rtx insn) +{ + rtx x; + + x = single_set (insn); + if (x == 0) + return false; + + x = SET_SRC (x); + + if (GET_CODE (x) == PLUS + && GET_CODE (XEXP (x, 0)) == MULT + && reg_set_p (XEXP (x, 1), prev)) + return true; + + if (GET_CODE (x) == MINUS + && GET_CODE (XEXP (x, 1)) == MULT + && reg_set_p (XEXP (x, 0), prev)) + return true; + + return false; +} + +/* Used by TUNE_MACC_CHAINS to record the last scheduled instruction + that may clobber hi or lo. */ + +static rtx mips_macc_chains_last_hilo; + +/* A TUNE_MACC_CHAINS helper function. Record that instruction INSN has + been scheduled, updating mips_macc_chains_last_hilo appropriately. */ + +static void +mips_macc_chains_record (rtx insn) +{ + if (get_attr_may_clobber_hilo (insn)) + mips_macc_chains_last_hilo = insn; +} + +/* A TUNE_MACC_CHAINS helper function. Search ready queue READY, which + has NREADY elements, looking for a multiply-add or multiply-subtract + instruction that is cumulative with mips_macc_chains_last_hilo. + If there is one, promote it ahead of anything else that might + clobber hi or lo. */ + +static void +mips_macc_chains_reorder (rtx *ready, int nready) +{ + int i, j; + + if (mips_macc_chains_last_hilo != 0) + for (i = nready - 1; i >= 0; i--) + if (mips_linked_madd_p (mips_macc_chains_last_hilo, ready[i])) + { + for (j = nready - 1; j > i; j--) + if (recog_memoized (ready[j]) >= 0 + && get_attr_may_clobber_hilo (ready[j])) + { + mips_promote_ready (ready, i, j); + break; + } + break; + } +} + +/* The last instruction to be scheduled. */ + +static rtx vr4130_last_insn; + +/* A note_stores callback used by vr4130_true_reg_dependence_p. DATA + points to an rtx that is initially an instruction. Nullify the rtx + if the instruction uses the value of register X. */ + +static void +vr4130_true_reg_dependence_p_1 (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data) +{ + rtx *insn_ptr = data; + if (REG_P (x) + && *insn_ptr != 0 + && reg_referenced_p (x, PATTERN (*insn_ptr))) + *insn_ptr = 0; +} + +/* Return true if there is true register dependence between vr4130_last_insn + and INSN. */ + +static bool +vr4130_true_reg_dependence_p (rtx insn) +{ + note_stores (PATTERN (vr4130_last_insn), + vr4130_true_reg_dependence_p_1, &insn); + return insn == 0; +} + +/* A TUNE_MIPS4130 helper function. Given that INSN1 is at the head of + the ready queue and that INSN2 is the instruction after it, return + true if it is worth promoting INSN2 ahead of INSN1. Look for cases + in which INSN1 and INSN2 can probably issue in parallel, but for + which (INSN2, INSN1) should be less sensitive to instruction + alignment than (INSN1, INSN2). See 4130.md for more details. */ + +static bool +vr4130_swap_insns_p (rtx insn1, rtx insn2) +{ + rtx dep; + + /* Check for the following case: + + 1) there is some other instruction X with an anti dependence on INSN1; + 2) X has a higher priority than INSN2; and + 3) X is an arithmetic instruction (and thus has no unit restrictions). + + If INSN1 is the last instruction blocking X, it would better to + choose (INSN1, X) over (INSN2, INSN1). */ + for (dep = INSN_DEPEND (insn1); dep != 0; dep = XEXP (dep, 1)) + if (REG_NOTE_KIND (dep) == REG_DEP_ANTI + && INSN_PRIORITY (XEXP (dep, 0)) > INSN_PRIORITY (insn2) + && recog_memoized (XEXP (dep, 0)) >= 0 + && get_attr_vr4130_class (XEXP (dep, 0)) == VR4130_CLASS_ALU) + return false; + + if (vr4130_last_insn != 0 + && recog_memoized (insn1) >= 0 + && recog_memoized (insn2) >= 0) + { + /* See whether INSN1 and INSN2 use different execution units, + or if they are both ALU-type instructions. If so, they can + probably execute in parallel. */ + enum attr_vr4130_class class1 = get_attr_vr4130_class (insn1); + enum attr_vr4130_class class2 = get_attr_vr4130_class (insn2); + if (class1 != class2 || class1 == VR4130_CLASS_ALU) + { + /* If only one of the instructions has a dependence on + vr4130_last_insn, prefer to schedule the other one first. */ + bool dep1 = vr4130_true_reg_dependence_p (insn1); + bool dep2 = vr4130_true_reg_dependence_p (insn2); + if (dep1 != dep2) + return dep1; + + /* Prefer to schedule INSN2 ahead of INSN1 if vr4130_last_insn + is not an ALU-type instruction and if INSN1 uses the same + execution unit. (Note that if this condition holds, we already + know that INSN2 uses a different execution unit.) */ + if (class1 != VR4130_CLASS_ALU + && recog_memoized (vr4130_last_insn) >= 0 + && class1 == get_attr_vr4130_class (vr4130_last_insn)) + return true; + } + } + return false; +} + +/* A TUNE_MIPS4130 helper function. (READY, NREADY) describes a ready + queue with at least two instructions. Swap the first two if + vr4130_swap_insns_p says that it could be worthwhile. */ + +static void +vr4130_reorder (rtx *ready, int nready) +{ + if (vr4130_swap_insns_p (ready[nready - 1], ready[nready - 2])) + mips_promote_ready (ready, nready - 2, nready - 1); +} + +/* Remove the instruction at index LOWER from ready queue READY and + reinsert it in front of the instruction at index HIGHER. LOWER must + be <= HIGHER. */ + +static void +mips_promote_ready (rtx *ready, int lower, int higher) +{ + rtx new_head; + int i; + + new_head = ready[lower]; + for (i = lower; i < higher; i++) + ready[i] = ready[i + 1]; + ready[i] = new_head; +} + +/* Implement TARGET_SCHED_REORDER. */ + +static int +mips_sched_reorder (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx *ready, int *nreadyp, int cycle) +{ + if (!reload_completed && TUNE_MACC_CHAINS) + { + if (cycle == 0) + mips_macc_chains_last_hilo = 0; + if (*nreadyp > 0) + mips_macc_chains_reorder (ready, *nreadyp); + } + if (reload_completed && TUNE_MIPS4130 && !TARGET_VR4130_ALIGN) + { + if (cycle == 0) + vr4130_last_insn = 0; + if (*nreadyp > 1) + vr4130_reorder (ready, *nreadyp); + } + return mips_issue_rate (); +} + +/* Implement TARGET_SCHED_VARIABLE_ISSUE. */ + +static int +mips_variable_issue (FILE *file ATTRIBUTE_UNUSED, int verbose ATTRIBUTE_UNUSED, + rtx insn, int more) +{ + switch (GET_CODE (PATTERN (insn))) + { + case USE: + case CLOBBER: + /* Don't count USEs and CLOBBERs against the issue rate. */ + break; + + default: + more--; + if (!reload_completed && TUNE_MACC_CHAINS) + mips_macc_chains_record (insn); + vr4130_last_insn = insn; + break; + } + return more; +} + +/* Implement TARGET_SCHED_ADJUST_COST. We assume that anti and output + dependencies have no cost. */ + +static int +mips_adjust_cost (rtx insn ATTRIBUTE_UNUSED, rtx link, + rtx dep ATTRIBUTE_UNUSED, int cost) +{ + if (REG_NOTE_KIND (link) != 0) + return 0; + return cost; +} + +/* Return the number of instructions that can be issued per cycle. */ + +static int +mips_issue_rate (void) +{ + switch (mips_tune) + { + case PROCESSOR_R4130: + case PROCESSOR_R5400: + case PROCESSOR_R5500: + case PROCESSOR_R7000: + case PROCESSOR_R9000: + return 2; + + case PROCESSOR_SB1: + case PROCESSOR_SB1A: + /* This is actually 4, but we get better performance if we claim 3. + This is partly because of unwanted speculative code motion with the + larger number, and partly because in most common cases we can't + reach the theoretical max of 4. */ + return 3; + + default: + return 1; + } +} + +/* Implements TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD. This should + be as wide as the scheduling freedom in the DFA. */ + +static int +mips_multipass_dfa_lookahead (void) +{ + /* Can schedule up to 4 of the 6 function units in any one cycle. */ + if (TUNE_SB1) + return 4; + + return 0; +} + +/* Implements a store data bypass check. We need this because the cprestore + pattern is type store, but defined using an UNSPEC. This UNSPEC causes the + default routine to abort. We just return false for that case. */ +/* ??? Should try to give a better result here than assuming false. */ + +int +mips_store_data_bypass_p (rtx out_insn, rtx in_insn) +{ + if (GET_CODE (PATTERN (in_insn)) == UNSPEC_VOLATILE) + return false; + + return ! store_data_bypass_p (out_insn, in_insn); +} + +/* Given that we have an rtx of the form (prefetch ... WRITE LOCALITY), + return the first operand of the associated "pref" or "prefx" insn. */ + +rtx +mips_prefetch_cookie (rtx write, rtx locality) +{ + /* store_streamed / load_streamed. */ + if (INTVAL (locality) <= 0) + return GEN_INT (INTVAL (write) + 4); + + /* store / load. */ + if (INTVAL (locality) <= 2) + return write; + + /* store_retained / load_retained. */ + return GEN_INT (INTVAL (write) + 6); +} + +/* MIPS builtin function support. */ + +struct builtin_description +{ + /* The code of the main .md file instruction. See mips_builtin_type + for more information. */ + enum insn_code icode; + + /* The floating-point comparison code to use with ICODE, if any. */ + enum mips_fp_condition cond; + + /* The name of the builtin function. */ + const char *name; + + /* Specifies how the function should be expanded. */ + enum mips_builtin_type builtin_type; + + /* The function's prototype. */ + enum mips_function_type function_type; + + /* The target flags required for this function. */ + int target_flags; +}; + +/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_mips_. + FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */ +#define DIRECT_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ + { CODE_FOR_mips_ ## INSN, 0, "__builtin_mips_" #INSN, \ + MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS } + +/* Define __builtin_mips___{s,d}, both of which require + TARGET_FLAGS. */ +#define CMP_SCALAR_BUILTINS(INSN, COND, TARGET_FLAGS) \ + { CODE_FOR_mips_ ## INSN ## _cond_s, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_" #INSN "_" #COND "_s", \ + MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_SF_SF, TARGET_FLAGS }, \ + { CODE_FOR_mips_ ## INSN ## _cond_d, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_" #INSN "_" #COND "_d", \ + MIPS_BUILTIN_CMP_SINGLE, MIPS_INT_FTYPE_DF_DF, TARGET_FLAGS } + +/* Define __builtin_mips_{any,all,upper,lower}___ps. + The lower and upper forms require TARGET_FLAGS while the any and all + forms require MASK_MIPS3D. */ +#define CMP_PS_BUILTINS(INSN, COND, TARGET_FLAGS) \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_any_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF, MASK_MIPS3D }, \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_all_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF, MASK_MIPS3D }, \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_lower_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_CMP_LOWER, MIPS_INT_FTYPE_V2SF_V2SF, TARGET_FLAGS }, \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_upper_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_CMP_UPPER, MIPS_INT_FTYPE_V2SF_V2SF, TARGET_FLAGS } + +/* Define __builtin_mips_{any,all}___4s. The functions + require MASK_MIPS3D. */ +#define CMP_4S_BUILTINS(INSN, COND) \ + { CODE_FOR_mips_ ## INSN ## _cond_4s, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_any_" #INSN "_" #COND "_4s", \ + MIPS_BUILTIN_CMP_ANY, MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, \ + MASK_MIPS3D }, \ + { CODE_FOR_mips_ ## INSN ## _cond_4s, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_all_" #INSN "_" #COND "_4s", \ + MIPS_BUILTIN_CMP_ALL, MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF, \ + MASK_MIPS3D } + +/* Define __builtin_mips_mov{t,f}___ps. The comparison + instruction requires TARGET_FLAGS. */ +#define MOVTF_BUILTINS(INSN, COND, TARGET_FLAGS) \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_movt_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_MOVT, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \ + TARGET_FLAGS }, \ + { CODE_FOR_mips_ ## INSN ## _cond_ps, MIPS_FP_COND_ ## COND, \ + "__builtin_mips_movf_" #INSN "_" #COND "_ps", \ + MIPS_BUILTIN_MOVF, MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF, \ + TARGET_FLAGS } + +/* Define all the builtins related to c.cond.fmt condition COND. */ +#define CMP_BUILTINS(COND) \ + MOVTF_BUILTINS (c, COND, MASK_PAIRED_SINGLE_FLOAT), \ + MOVTF_BUILTINS (cabs, COND, MASK_MIPS3D), \ + CMP_SCALAR_BUILTINS (cabs, COND, MASK_MIPS3D), \ + CMP_PS_BUILTINS (c, COND, MASK_PAIRED_SINGLE_FLOAT), \ + CMP_PS_BUILTINS (cabs, COND, MASK_MIPS3D), \ + CMP_4S_BUILTINS (c, COND), \ + CMP_4S_BUILTINS (cabs, COND) + +static const struct builtin_description mips_bdesc[] = +{ + DIRECT_BUILTIN (pll_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (pul_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (plu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (puu_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (cvt_ps_s, MIPS_V2SF_FTYPE_SF_SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (cvt_s_pl, MIPS_SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (cvt_s_pu, MIPS_SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (abs_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT), + + DIRECT_BUILTIN (alnv_ps, MIPS_V2SF_FTYPE_V2SF_V2SF_INT, + MASK_PAIRED_SINGLE_FLOAT), + DIRECT_BUILTIN (addr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D), + DIRECT_BUILTIN (mulr_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D), + DIRECT_BUILTIN (cvt_pw_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D), + DIRECT_BUILTIN (cvt_ps_pw, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D), + + DIRECT_BUILTIN (recip1_s, MIPS_SF_FTYPE_SF, MASK_MIPS3D), + DIRECT_BUILTIN (recip1_d, MIPS_DF_FTYPE_DF, MASK_MIPS3D), + DIRECT_BUILTIN (recip1_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D), + DIRECT_BUILTIN (recip2_s, MIPS_SF_FTYPE_SF_SF, MASK_MIPS3D), + DIRECT_BUILTIN (recip2_d, MIPS_DF_FTYPE_DF_DF, MASK_MIPS3D), + DIRECT_BUILTIN (recip2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D), + + DIRECT_BUILTIN (rsqrt1_s, MIPS_SF_FTYPE_SF, MASK_MIPS3D), + DIRECT_BUILTIN (rsqrt1_d, MIPS_DF_FTYPE_DF, MASK_MIPS3D), + DIRECT_BUILTIN (rsqrt1_ps, MIPS_V2SF_FTYPE_V2SF, MASK_MIPS3D), + DIRECT_BUILTIN (rsqrt2_s, MIPS_SF_FTYPE_SF_SF, MASK_MIPS3D), + DIRECT_BUILTIN (rsqrt2_d, MIPS_DF_FTYPE_DF_DF, MASK_MIPS3D), + DIRECT_BUILTIN (rsqrt2_ps, MIPS_V2SF_FTYPE_V2SF_V2SF, MASK_MIPS3D), + + MIPS_FP_CONDITIONS (CMP_BUILTINS) +}; + +/* Builtin functions for the SB-1 processor. */ + +#define CODE_FOR_mips_sqrt_ps CODE_FOR_sqrtv2sf2 + +static const struct builtin_description sb1_bdesc[] = +{ + DIRECT_BUILTIN (sqrt_ps, MIPS_V2SF_FTYPE_V2SF, MASK_PAIRED_SINGLE_FLOAT) +}; + +/* Builtin functions for DSP ASE. */ + +#define CODE_FOR_mips_addq_ph CODE_FOR_addv2hi3 +#define CODE_FOR_mips_addu_qb CODE_FOR_addv4qi3 +#define CODE_FOR_mips_subq_ph CODE_FOR_subv2hi3 +#define CODE_FOR_mips_subu_qb CODE_FOR_subv4qi3 + +/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction + CODE_FOR_mips_. FUNCTION_TYPE and TARGET_FLAGS are + builtin_description fields. */ +#define DIRECT_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ + { CODE_FOR_mips_ ## INSN, 0, "__builtin_mips_" #INSN, \ + MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS } + +/* Define __builtin_mips_bposge. is 32 for the MIPS32 DSP + branch instruction. TARGET_FLAGS is a builtin_description field. */ +#define BPOSGE_BUILTIN(VALUE, TARGET_FLAGS) \ + { CODE_FOR_mips_bposge, 0, "__builtin_mips_bposge" #VALUE, \ + MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, TARGET_FLAGS } + +static const struct builtin_description dsp_bdesc[] = +{ + DIRECT_BUILTIN (addq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (addq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (addq_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (addu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (addu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (subq_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (subq_s_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (subq_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (subu_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (subu_s_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (addsc, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (addwc, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (modsub, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (raddu_w_qb, MIPS_SI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (absq_s_ph, MIPS_V2HI_FTYPE_V2HI, MASK_DSP), + DIRECT_BUILTIN (absq_s_w, MIPS_SI_FTYPE_SI, MASK_DSP), + DIRECT_BUILTIN (precrq_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (precrq_ph_w, MIPS_V2HI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (precrq_rs_ph_w, MIPS_V2HI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (precrqu_s_qb_ph, MIPS_V4QI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (preceq_w_phl, MIPS_SI_FTYPE_V2HI, MASK_DSP), + DIRECT_BUILTIN (preceq_w_phr, MIPS_SI_FTYPE_V2HI, MASK_DSP), + DIRECT_BUILTIN (precequ_ph_qbl, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (precequ_ph_qbr, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (precequ_ph_qbla, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (precequ_ph_qbra, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (preceu_ph_qbl, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (preceu_ph_qbr, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (preceu_ph_qbla, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (preceu_ph_qbra, MIPS_V2HI_FTYPE_V4QI, MASK_DSP), + DIRECT_BUILTIN (shll_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSP), + DIRECT_BUILTIN (shll_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP), + DIRECT_BUILTIN (shll_s_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP), + DIRECT_BUILTIN (shll_s_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (shrl_qb, MIPS_V4QI_FTYPE_V4QI_SI, MASK_DSP), + DIRECT_BUILTIN (shra_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP), + DIRECT_BUILTIN (shra_r_ph, MIPS_V2HI_FTYPE_V2HI_SI, MASK_DSP), + DIRECT_BUILTIN (shra_r_w, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (muleu_s_ph_qbl, MIPS_V2HI_FTYPE_V4QI_V2HI, MASK_DSP), + DIRECT_BUILTIN (muleu_s_ph_qbr, MIPS_V2HI_FTYPE_V4QI_V2HI, MASK_DSP), + DIRECT_BUILTIN (mulq_rs_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (muleq_s_w_phl, MIPS_SI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (muleq_s_w_phr, MIPS_SI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (dpau_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (dpau_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (dpsu_h_qbl, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (dpsu_h_qbr, MIPS_DI_FTYPE_DI_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (dpaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (dpsq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (mulsaq_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (dpaq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSP), + DIRECT_BUILTIN (dpsq_sa_l_w, MIPS_DI_FTYPE_DI_SI_SI, MASK_DSP), + DIRECT_BUILTIN (maq_s_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (maq_s_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (maq_sa_w_phl, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (maq_sa_w_phr, MIPS_DI_FTYPE_DI_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (bitrev, MIPS_SI_FTYPE_SI, MASK_DSP), + DIRECT_BUILTIN (insv, MIPS_SI_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (repl_qb, MIPS_V4QI_FTYPE_SI, MASK_DSP), + DIRECT_BUILTIN (repl_ph, MIPS_V2HI_FTYPE_SI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmpu_eq_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmpu_lt_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmpu_le_qb, MIPS_VOID_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (cmpgu_eq_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (cmpgu_lt_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (cmpgu_le_qb, MIPS_SI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmp_eq_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmp_lt_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (cmp_le_ph, MIPS_VOID_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (pick_qb, MIPS_V4QI_FTYPE_V4QI_V4QI, MASK_DSP), + DIRECT_BUILTIN (pick_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (packrl_ph, MIPS_V2HI_FTYPE_V2HI_V2HI, MASK_DSP), + DIRECT_BUILTIN (extr_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (extr_r_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (extr_rs_w, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (extr_s_h, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (extp, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (extpdp, MIPS_SI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (shilo, MIPS_DI_FTYPE_DI_SI, MASK_DSP), + DIRECT_BUILTIN (mthlip, MIPS_DI_FTYPE_DI_SI, MASK_DSP), + DIRECT_NO_TARGET_BUILTIN (wrdsp, MIPS_VOID_FTYPE_SI_SI, MASK_DSP), + DIRECT_BUILTIN (rddsp, MIPS_SI_FTYPE_SI, MASK_DSP), + DIRECT_BUILTIN (lbux, MIPS_SI_FTYPE_PTR_SI, MASK_DSP), + DIRECT_BUILTIN (lhx, MIPS_SI_FTYPE_PTR_SI, MASK_DSP), + DIRECT_BUILTIN (lwx, MIPS_SI_FTYPE_PTR_SI, MASK_DSP), + BPOSGE_BUILTIN (32, MASK_DSP) +}; + +/* This helps provide a mapping from builtin function codes to bdesc + arrays. */ + +struct bdesc_map +{ + /* The builtin function table that this entry describes. */ + const struct builtin_description *bdesc; + + /* The number of entries in the builtin function table. */ + unsigned int size; + + /* The target processor that supports these builtin functions. + PROCESSOR_MAX means we enable them for all processors. */ + enum processor_type proc; +}; + +static const struct bdesc_map bdesc_arrays[] = +{ + { mips_bdesc, ARRAY_SIZE (mips_bdesc), PROCESSOR_MAX }, + { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 }, + { dsp_bdesc, ARRAY_SIZE (dsp_bdesc), PROCESSOR_MAX } +}; + +/* Take the head of argument list *ARGLIST and convert it into a form + suitable for input operand OP of instruction ICODE. Return the value + and point *ARGLIST at the next element of the list. */ + +static rtx +mips_prepare_builtin_arg (enum insn_code icode, + unsigned int op, tree *arglist) +{ + rtx value; + enum machine_mode mode; + + value = expand_normal (TREE_VALUE (*arglist)); + mode = insn_data[icode].operand[op].mode; + if (!insn_data[icode].operand[op].predicate (value, mode)) + { + value = copy_to_mode_reg (mode, value); + /* Check the predicate again. */ + if (!insn_data[icode].operand[op].predicate (value, mode)) + { + error ("invalid argument to builtin function"); + return const0_rtx; + } + } + + *arglist = TREE_CHAIN (*arglist); + return value; +} + +/* Return an rtx suitable for output operand OP of instruction ICODE. + If TARGET is non-null, try to use it where possible. */ + +static rtx +mips_prepare_builtin_target (enum insn_code icode, unsigned int op, rtx target) +{ + enum machine_mode mode; + + mode = insn_data[icode].operand[op].mode; + if (target == 0 || !insn_data[icode].operand[op].predicate (target, mode)) + target = gen_reg_rtx (mode); + + return target; +} + +/* Expand builtin functions. This is called from TARGET_EXPAND_BUILTIN. */ + +rtx +mips_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + int ignore ATTRIBUTE_UNUSED) +{ + enum insn_code icode; + enum mips_builtin_type type; + tree fndecl, arglist; + unsigned int fcode; + const struct builtin_description *bdesc; + const struct bdesc_map *m; + + fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); + arglist = TREE_OPERAND (exp, 1); + fcode = DECL_FUNCTION_CODE (fndecl); + + bdesc = NULL; + for (m = bdesc_arrays; m < &bdesc_arrays[ARRAY_SIZE (bdesc_arrays)]; m++) + { + if (fcode < m->size) + { + bdesc = m->bdesc; + icode = bdesc[fcode].icode; + type = bdesc[fcode].builtin_type; + break; + } + fcode -= m->size; + } + if (bdesc == NULL) + return 0; + + switch (type) + { + case MIPS_BUILTIN_DIRECT: + return mips_expand_builtin_direct (icode, target, arglist, true); + + case MIPS_BUILTIN_DIRECT_NO_TARGET: + return mips_expand_builtin_direct (icode, target, arglist, false); + + case MIPS_BUILTIN_MOVT: + case MIPS_BUILTIN_MOVF: + return mips_expand_builtin_movtf (type, icode, bdesc[fcode].cond, + target, arglist); + + case MIPS_BUILTIN_CMP_ANY: + case MIPS_BUILTIN_CMP_ALL: + case MIPS_BUILTIN_CMP_UPPER: + case MIPS_BUILTIN_CMP_LOWER: + case MIPS_BUILTIN_CMP_SINGLE: + return mips_expand_builtin_compare (type, icode, bdesc[fcode].cond, + target, arglist); + + case MIPS_BUILTIN_BPOSGE32: + return mips_expand_builtin_bposge (type, target); + + default: + return 0; + } +} + +/* Init builtin functions. This is called from TARGET_INIT_BUILTIN. */ + +void +mips_init_builtins (void) +{ + const struct builtin_description *d; + const struct bdesc_map *m; + tree types[(int) MIPS_MAX_FTYPE_MAX]; + tree V2SF_type_node; + tree V2HI_type_node; + tree V4QI_type_node; + unsigned int offset; + + /* We have only builtins for -mpaired-single, -mips3d and -mdsp. */ + if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_DSP) + return; + + if (TARGET_PAIRED_SINGLE_FLOAT) + { + V2SF_type_node = build_vector_type_for_mode (float_type_node, V2SFmode); + + types[MIPS_V2SF_FTYPE_V2SF] + = build_function_type_list (V2SF_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_V2SF_FTYPE_V2SF_V2SF] + = build_function_type_list (V2SF_type_node, + V2SF_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_V2SF_FTYPE_V2SF_V2SF_INT] + = build_function_type_list (V2SF_type_node, + V2SF_type_node, V2SF_type_node, + integer_type_node, NULL_TREE); + + types[MIPS_V2SF_FTYPE_V2SF_V2SF_V2SF_V2SF] + = build_function_type_list (V2SF_type_node, + V2SF_type_node, V2SF_type_node, + V2SF_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_V2SF_FTYPE_SF_SF] + = build_function_type_list (V2SF_type_node, + float_type_node, float_type_node, NULL_TREE); + + types[MIPS_INT_FTYPE_V2SF_V2SF] + = build_function_type_list (integer_type_node, + V2SF_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_INT_FTYPE_V2SF_V2SF_V2SF_V2SF] + = build_function_type_list (integer_type_node, + V2SF_type_node, V2SF_type_node, + V2SF_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_INT_FTYPE_SF_SF] + = build_function_type_list (integer_type_node, + float_type_node, float_type_node, NULL_TREE); + + types[MIPS_INT_FTYPE_DF_DF] + = build_function_type_list (integer_type_node, + double_type_node, double_type_node, NULL_TREE); + + types[MIPS_SF_FTYPE_V2SF] + = build_function_type_list (float_type_node, V2SF_type_node, NULL_TREE); + + types[MIPS_SF_FTYPE_SF] + = build_function_type_list (float_type_node, + float_type_node, NULL_TREE); + + types[MIPS_SF_FTYPE_SF_SF] + = build_function_type_list (float_type_node, + float_type_node, float_type_node, NULL_TREE); + + types[MIPS_DF_FTYPE_DF] + = build_function_type_list (double_type_node, + double_type_node, NULL_TREE); + + types[MIPS_DF_FTYPE_DF_DF] + = build_function_type_list (double_type_node, + double_type_node, double_type_node, NULL_TREE); + } + + if (TARGET_DSP) + { + V2HI_type_node = build_vector_type_for_mode (intHI_type_node, V2HImode); + V4QI_type_node = build_vector_type_for_mode (intQI_type_node, V4QImode); + + types[MIPS_V2HI_FTYPE_V2HI_V2HI] + = build_function_type_list (V2HI_type_node, + V2HI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_SI_SI] + = build_function_type_list (intSI_type_node, + intSI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_V4QI_FTYPE_V4QI_V4QI] + = build_function_type_list (V4QI_type_node, + V4QI_type_node, V4QI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_V4QI] + = build_function_type_list (intSI_type_node, + V4QI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_V2HI] + = build_function_type_list (V2HI_type_node, + V2HI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_SI] + = build_function_type_list (intSI_type_node, + intSI_type_node, + NULL_TREE); + + types[MIPS_V4QI_FTYPE_V2HI_V2HI] + = build_function_type_list (V4QI_type_node, + V2HI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_SI_SI] + = build_function_type_list (V2HI_type_node, + intSI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_V2HI] + = build_function_type_list (intSI_type_node, + V2HI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_V4QI] + = build_function_type_list (V2HI_type_node, + V4QI_type_node, + NULL_TREE); + + types[MIPS_V4QI_FTYPE_V4QI_SI] + = build_function_type_list (V4QI_type_node, + V4QI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_V2HI_SI] + = build_function_type_list (V2HI_type_node, + V2HI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_V4QI_V2HI] + = build_function_type_list (V2HI_type_node, + V4QI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_V2HI_V2HI] + = build_function_type_list (intSI_type_node, + V2HI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_DI_FTYPE_DI_V4QI_V4QI] + = build_function_type_list (intDI_type_node, + intDI_type_node, V4QI_type_node, V4QI_type_node, + NULL_TREE); + + types[MIPS_DI_FTYPE_DI_V2HI_V2HI] + = build_function_type_list (intDI_type_node, + intDI_type_node, V2HI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_DI_FTYPE_DI_SI_SI] + = build_function_type_list (intDI_type_node, + intDI_type_node, intSI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_V4QI_FTYPE_SI] + = build_function_type_list (V4QI_type_node, + intSI_type_node, + NULL_TREE); + + types[MIPS_V2HI_FTYPE_SI] + = build_function_type_list (V2HI_type_node, + intSI_type_node, + NULL_TREE); + + types[MIPS_VOID_FTYPE_V4QI_V4QI] + = build_function_type_list (void_type_node, + V4QI_type_node, V4QI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_V4QI_V4QI] + = build_function_type_list (intSI_type_node, + V4QI_type_node, V4QI_type_node, + NULL_TREE); + + types[MIPS_VOID_FTYPE_V2HI_V2HI] + = build_function_type_list (void_type_node, + V2HI_type_node, V2HI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_DI_SI] + = build_function_type_list (intSI_type_node, + intDI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_DI_FTYPE_DI_SI] + = build_function_type_list (intDI_type_node, + intDI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_VOID_FTYPE_SI_SI] + = build_function_type_list (void_type_node, + intSI_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_PTR_SI] + = build_function_type_list (intSI_type_node, + ptr_type_node, intSI_type_node, + NULL_TREE); + + types[MIPS_SI_FTYPE_VOID] + = build_function_type (intSI_type_node, void_list_node); + } + + /* Iterate through all of the bdesc arrays, initializing all of the + builtin functions. */ + + offset = 0; + for (m = bdesc_arrays; m < &bdesc_arrays[ARRAY_SIZE (bdesc_arrays)]; m++) + { + if (m->proc == PROCESSOR_MAX || (m->proc == mips_arch)) + for (d = m->bdesc; d < &m->bdesc[m->size]; d++) + if ((d->target_flags & target_flags) == d->target_flags) + lang_hooks.builtin_function (d->name, types[d->function_type], + d - m->bdesc + offset, + BUILT_IN_MD, NULL, NULL); + offset += m->size; + } +} + +/* Expand a MIPS_BUILTIN_DIRECT function. ICODE is the code of the + .md pattern and ARGLIST is the list of function arguments. TARGET, + if nonnull, suggests a good place to put the result. + HAS_TARGET indicates the function must return something. */ + +static rtx +mips_expand_builtin_direct (enum insn_code icode, rtx target, tree arglist, + bool has_target) +{ + rtx ops[MAX_RECOG_OPERANDS]; + int i = 0; + + if (has_target) + { + /* We save target to ops[0]. */ + ops[0] = mips_prepare_builtin_target (icode, 0, target); + i = 1; + } + + /* We need to test if arglist is not zero. Some instructions have extra + clobber registers. */ + for (; i < insn_data[icode].n_operands && arglist != 0; i++) + ops[i] = mips_prepare_builtin_arg (icode, i, &arglist); + + switch (i) + { + case 2: + emit_insn (GEN_FCN (icode) (ops[0], ops[1])); + break; + + case 3: + emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2])); + break; + + case 4: + emit_insn (GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3])); + break; + + default: + gcc_unreachable (); + } + return target; +} + +/* Expand a __builtin_mips_movt_*_ps() or __builtin_mips_movf_*_ps() + function (TYPE says which). ARGLIST is the list of arguments to the + function, ICODE is the instruction that should be used to compare + the first two arguments, and COND is the condition it should test. + TARGET, if nonnull, suggests a good place to put the result. */ + +static rtx +mips_expand_builtin_movtf (enum mips_builtin_type type, + enum insn_code icode, enum mips_fp_condition cond, + rtx target, tree arglist) +{ + rtx cmp_result, op0, op1; + + cmp_result = mips_prepare_builtin_target (icode, 0, 0); + op0 = mips_prepare_builtin_arg (icode, 1, &arglist); + op1 = mips_prepare_builtin_arg (icode, 2, &arglist); + emit_insn (GEN_FCN (icode) (cmp_result, op0, op1, GEN_INT (cond))); + + icode = CODE_FOR_mips_cond_move_tf_ps; + target = mips_prepare_builtin_target (icode, 0, target); + if (type == MIPS_BUILTIN_MOVT) + { + op1 = mips_prepare_builtin_arg (icode, 2, &arglist); + op0 = mips_prepare_builtin_arg (icode, 1, &arglist); + } + else + { + op0 = mips_prepare_builtin_arg (icode, 1, &arglist); + op1 = mips_prepare_builtin_arg (icode, 2, &arglist); + } + emit_insn (gen_mips_cond_move_tf_ps (target, op0, op1, cmp_result)); + return target; +} + +/* Move VALUE_IF_TRUE into TARGET if CONDITION is true; move VALUE_IF_FALSE + into TARGET otherwise. Return TARGET. */ + +static rtx +mips_builtin_branch_and_move (rtx condition, rtx target, + rtx value_if_true, rtx value_if_false) +{ + rtx true_label, done_label; + + true_label = gen_label_rtx (); + done_label = gen_label_rtx (); + + /* First assume that CONDITION is false. */ + emit_move_insn (target, value_if_false); + + /* Branch to TRUE_LABEL if CONDITION is true and DONE_LABEL otherwise. */ + emit_jump_insn (gen_condjump (condition, true_label)); + emit_jump_insn (gen_jump (done_label)); + emit_barrier (); + + /* Fix TARGET if CONDITION is true. */ + emit_label (true_label); + emit_move_insn (target, value_if_true); + + emit_label (done_label); + return target; +} + +/* Expand a comparison builtin of type BUILTIN_TYPE. ICODE is the code + of the comparison instruction and COND is the condition it should test. + ARGLIST is the list of function arguments and TARGET, if nonnull, + suggests a good place to put the boolean result. */ + +static rtx +mips_expand_builtin_compare (enum mips_builtin_type builtin_type, + enum insn_code icode, enum mips_fp_condition cond, + rtx target, tree arglist) +{ + rtx offset, condition, cmp_result, ops[MAX_RECOG_OPERANDS]; + int i; + + if (target == 0 || GET_MODE (target) != SImode) + target = gen_reg_rtx (SImode); + + /* Prepare the operands to the comparison. */ + cmp_result = mips_prepare_builtin_target (icode, 0, 0); + for (i = 1; i < insn_data[icode].n_operands - 1; i++) + ops[i] = mips_prepare_builtin_arg (icode, i, &arglist); + + switch (insn_data[icode].n_operands) + { + case 4: + emit_insn (GEN_FCN (icode) (cmp_result, ops[1], ops[2], GEN_INT (cond))); + break; + + case 6: + emit_insn (GEN_FCN (icode) (cmp_result, ops[1], ops[2], + ops[3], ops[4], GEN_INT (cond))); + break; + + default: + gcc_unreachable (); + } + + /* If the comparison sets more than one register, we define the result + to be 0 if all registers are false and -1 if all registers are true. + The value of the complete result is indeterminate otherwise. */ + switch (builtin_type) + { + case MIPS_BUILTIN_CMP_ALL: + condition = gen_rtx_NE (VOIDmode, cmp_result, constm1_rtx); + return mips_builtin_branch_and_move (condition, target, + const0_rtx, const1_rtx); + + case MIPS_BUILTIN_CMP_UPPER: + case MIPS_BUILTIN_CMP_LOWER: + offset = GEN_INT (builtin_type == MIPS_BUILTIN_CMP_UPPER); + condition = gen_single_cc (cmp_result, offset); + return mips_builtin_branch_and_move (condition, target, + const1_rtx, const0_rtx); + + default: + condition = gen_rtx_NE (VOIDmode, cmp_result, const0_rtx); + return mips_builtin_branch_and_move (condition, target, + const1_rtx, const0_rtx); + } +} + +/* Expand a bposge builtin of type BUILTIN_TYPE. TARGET, if nonnull, + suggests a good place to put the boolean result. */ + +static rtx +mips_expand_builtin_bposge (enum mips_builtin_type builtin_type, rtx target) +{ + rtx condition, cmp_result; + int cmp_value; + + if (target == 0 || GET_MODE (target) != SImode) + target = gen_reg_rtx (SImode); + + cmp_result = gen_rtx_REG (CCDSPmode, CCDSP_PO_REGNUM); + + if (builtin_type == MIPS_BUILTIN_BPOSGE32) + cmp_value = 32; + else + gcc_assert (0); + + condition = gen_rtx_GE (VOIDmode, cmp_result, GEN_INT (cmp_value)); + return mips_builtin_branch_and_move (condition, target, + const1_rtx, const0_rtx); +} + +/* Set SYMBOL_REF_FLAGS for the SYMBOL_REF inside RTL, which belongs to DECL. + FIRST is true if this is the first time handling this decl. */ + +static void +mips_encode_section_info (tree decl, rtx rtl, int first) +{ + default_encode_section_info (decl, rtl, first); + + if (TREE_CODE (decl) == FUNCTION_DECL + && lookup_attribute ("long_call", TYPE_ATTRIBUTES (TREE_TYPE (decl)))) + { + rtx symbol = XEXP (rtl, 0); + SYMBOL_REF_FLAGS (symbol) |= SYMBOL_FLAG_LONG_CALL; + } +} + +/* Implement TARGET_EXTRA_LIVE_ON_ENTRY. PIC_FUNCTION_ADDR_REGNUM is live + on entry to a function when generating -mshared abicalls code. */ + +static void +mips_extra_live_on_entry (bitmap regs) +{ + if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS) + bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM); +} + +/* SImode values are represented as sign-extended to DImode. */ + +int +mips_mode_rep_extended (enum machine_mode mode, enum machine_mode mode_rep) +{ + if (TARGET_64BIT && mode == SImode && mode_rep == DImode) + return SIGN_EXTEND; + + return UNKNOWN; +} + +#include "gt-mips.h" diff --git a/contrib/gcc/config/mips/mips.h b/contrib/gcc/config/mips/mips.h new file mode 100644 index 00000000000..ba77d8636af --- /dev/null +++ b/contrib/gcc/config/mips/mips.h @@ -0,0 +1,2711 @@ +/* Definitions of target machine for GNU compiler. MIPS version. + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by A. Lichnewsky (lich@inria.inria.fr). + Changed by Michael Meissner (meissner@osf.org). + 64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and + Brendan Eich (brendan@microunity.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + + +/* MIPS external variables defined in mips.c. */ + +/* Which processor to schedule for. Since there is no difference between + a R2000 and R3000 in terms of the scheduler, we collapse them into + just an R3000. The elements of the enumeration must match exactly + the cpu attribute in the mips.md machine description. */ + +enum processor_type { + PROCESSOR_R3000, + PROCESSOR_4KC, + PROCESSOR_4KP, + PROCESSOR_5KC, + PROCESSOR_5KF, + PROCESSOR_20KC, + PROCESSOR_24K, + PROCESSOR_24KX, + PROCESSOR_M4K, + PROCESSOR_R3900, + PROCESSOR_R6000, + PROCESSOR_R4000, + PROCESSOR_R4100, + PROCESSOR_R4111, + PROCESSOR_R4120, + PROCESSOR_R4130, + PROCESSOR_R4300, + PROCESSOR_R4600, + PROCESSOR_R4650, + PROCESSOR_R5000, + PROCESSOR_R5400, + PROCESSOR_R5500, + PROCESSOR_R7000, + PROCESSOR_R8000, + PROCESSOR_R9000, + PROCESSOR_SB1, + PROCESSOR_SB1A, + PROCESSOR_SR71000, + PROCESSOR_MAX +}; + +/* Costs of various operations on the different architectures. */ + +struct mips_rtx_cost_data +{ + unsigned short fp_add; + unsigned short fp_mult_sf; + unsigned short fp_mult_df; + unsigned short fp_div_sf; + unsigned short fp_div_df; + unsigned short int_mult_si; + unsigned short int_mult_di; + unsigned short int_div_si; + unsigned short int_div_di; + unsigned short branch_cost; + unsigned short memory_latency; +}; + +/* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32), + ABI_64 (n64) are all defined by SGI. ABI_O64 is o32 extended + to work on a 64 bit machine. */ + +#define ABI_32 0 +#define ABI_N32 1 +#define ABI_64 2 +#define ABI_EABI 3 +#define ABI_O64 4 + +/* Information about one recognized processor. Defined here for the + benefit of TARGET_CPU_CPP_BUILTINS. */ +struct mips_cpu_info { + /* The 'canonical' name of the processor as far as GCC is concerned. + It's typically a manufacturer's prefix followed by a numerical + designation. It should be lower case. */ + const char *name; + + /* The internal processor number that most closely matches this + entry. Several processors can have the same value, if there's no + difference between them from GCC's point of view. */ + enum processor_type cpu; + + /* The ISA level that the processor implements. */ + int isa; +}; + +#ifndef USED_FOR_TARGET +extern char mips_print_operand_punct[256]; /* print_operand punctuation chars */ +extern const char *current_function_file; /* filename current function is in */ +extern int num_source_filenames; /* current .file # */ +extern int mips_section_threshold; /* # bytes of data/sdata cutoff */ +extern int sym_lineno; /* sgi next label # for each stmt */ +extern int set_noreorder; /* # of nested .set noreorder's */ +extern int set_nomacro; /* # of nested .set nomacro's */ +extern int set_noat; /* # of nested .set noat's */ +extern int set_volatile; /* # of nested .set volatile's */ +extern int mips_branch_likely; /* emit 'l' after br (branch likely) */ +extern int mips_dbx_regno[]; /* Map register # to debug register # */ +extern bool mips_split_p[]; +extern GTY(()) rtx cmp_operands[2]; +extern enum processor_type mips_arch; /* which cpu to codegen for */ +extern enum processor_type mips_tune; /* which cpu to schedule for */ +extern int mips_isa; /* architectural level */ +extern int mips_abi; /* which ABI to use */ +extern int mips16_hard_float; /* mips16 without -msoft-float */ +extern const struct mips_cpu_info mips_cpu_info_table[]; +extern const struct mips_cpu_info *mips_arch_info; +extern const struct mips_cpu_info *mips_tune_info; +extern const struct mips_rtx_cost_data *mips_cost; +#endif + +/* Macros to silence warnings about numbers being signed in traditional + C and unsigned in ISO C when compiled on 32-bit hosts. */ + +#define BITMASK_HIGH (((unsigned long)1) << 31) /* 0x80000000 */ +#define BITMASK_UPPER16 ((unsigned long)0xffff << 16) /* 0xffff0000 */ +#define BITMASK_LOWER16 ((unsigned long)0xffff) /* 0x0000ffff */ + + +/* Run-time compilation parameters selecting different hardware subsets. */ + +/* True if the call patterns should be split into a jalr followed by + an instruction to restore $gp. This is only ever true for SVR4 PIC, + in which $gp is call-clobbered. It is only safe to split the load + from the call when every use of $gp is explicit. */ + +#define TARGET_SPLIT_CALLS \ + (TARGET_EXPLICIT_RELOCS && TARGET_ABICALLS && !TARGET_NEWABI) + +/* True if we're generating a form of -mabicalls in which we can use + operators like %hi and %lo to refer to locally-binding symbols. + We can only do this for -mno-shared, and only then if we can use + relocation operations instead of assembly macros. It isn't really + worth using absolute sequences for 64-bit symbols because GOT + accesses are so much shorter. */ + +#define TARGET_ABSOLUTE_ABICALLS \ + (TARGET_ABICALLS \ + && !TARGET_SHARED \ + && TARGET_EXPLICIT_RELOCS \ + && !ABI_HAS_64BIT_SYMBOLS) + +/* True if we can optimize sibling calls. For simplicity, we only + handle cases in which call_insn_operand will reject invalid + sibcall addresses. There are two cases in which this isn't true: + + - TARGET_MIPS16. call_insn_operand accepts constant addresses + but there is no direct jump instruction. It isn't worth + using sibling calls in this case anyway; they would usually + be longer than normal calls. + + - TARGET_ABICALLS && !TARGET_EXPLICIT_RELOCS. call_insn_operand + accepts global constants, but "jr $25" is the only allowed + sibcall. */ + +#define TARGET_SIBCALLS \ + (!TARGET_MIPS16 && (!TARGET_ABICALLS || TARGET_EXPLICIT_RELOCS)) + +/* True if .gpword or .gpdword should be used for switch tables. + + Although GAS does understand .gpdword, the SGI linker mishandles + the relocations GAS generates (R_MIPS_GPREL32 followed by R_MIPS_64). + We therefore disable GP-relative switch tables for n64 on IRIX targets. */ +#define TARGET_GPWORD (TARGET_ABICALLS && !(mips_abi == ABI_64 && TARGET_IRIX)) + +/* Generate mips16 code */ +#define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0) +/* Generate mips16e code. Default 16bit ASE for mips32/mips32r2/mips64 */ +#define GENERATE_MIPS16E (TARGET_MIPS16 && mips_isa >= 32) + +/* Generic ISA defines. */ +#define ISA_MIPS1 (mips_isa == 1) +#define ISA_MIPS2 (mips_isa == 2) +#define ISA_MIPS3 (mips_isa == 3) +#define ISA_MIPS4 (mips_isa == 4) +#define ISA_MIPS32 (mips_isa == 32) +#define ISA_MIPS32R2 (mips_isa == 33) +#define ISA_MIPS64 (mips_isa == 64) + +/* Architecture target defines. */ +#define TARGET_MIPS3900 (mips_arch == PROCESSOR_R3900) +#define TARGET_MIPS4000 (mips_arch == PROCESSOR_R4000) +#define TARGET_MIPS4120 (mips_arch == PROCESSOR_R4120) +#define TARGET_MIPS4130 (mips_arch == PROCESSOR_R4130) +#define TARGET_MIPS5400 (mips_arch == PROCESSOR_R5400) +#define TARGET_MIPS5500 (mips_arch == PROCESSOR_R5500) +#define TARGET_MIPS7000 (mips_arch == PROCESSOR_R7000) +#define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000) +#define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \ + || mips_arch == PROCESSOR_SB1A) +#define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) + +/* Scheduling target defines. */ +#define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000) +#define TUNE_MIPS3900 (mips_tune == PROCESSOR_R3900) +#define TUNE_MIPS4000 (mips_tune == PROCESSOR_R4000) +#define TUNE_MIPS4120 (mips_tune == PROCESSOR_R4120) +#define TUNE_MIPS4130 (mips_tune == PROCESSOR_R4130) +#define TUNE_MIPS5000 (mips_tune == PROCESSOR_R5000) +#define TUNE_MIPS5400 (mips_tune == PROCESSOR_R5400) +#define TUNE_MIPS5500 (mips_tune == PROCESSOR_R5500) +#define TUNE_MIPS6000 (mips_tune == PROCESSOR_R6000) +#define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000) +#define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000) +#define TUNE_SB1 (mips_tune == PROCESSOR_SB1 \ + || mips_tune == PROCESSOR_SB1A) + +/* True if the pre-reload scheduler should try to create chains of + multiply-add or multiply-subtract instructions. For example, + suppose we have: + + t1 = a * b + t2 = t1 + c * d + t3 = e * f + t4 = t3 - g * h + + t1 will have a higher priority than t2 and t3 will have a higher + priority than t4. However, before reload, there is no dependence + between t1 and t3, and they can often have similar priorities. + The scheduler will then tend to prefer: + + t1 = a * b + t3 = e * f + t2 = t1 + c * d + t4 = t3 - g * h + + which stops us from making full use of macc/madd-style instructions. + This sort of situation occurs frequently in Fourier transforms and + in unrolled loops. + + To counter this, the TUNE_MACC_CHAINS code will reorder the ready + queue so that chained multiply-add and multiply-subtract instructions + appear ahead of any other instruction that is likely to clobber lo. + In the example above, if t2 and t3 become ready at the same time, + the code ensures that t2 is scheduled first. + + Multiply-accumulate instructions are a bigger win for some targets + than others, so this macro is defined on an opt-in basis. */ +#define TUNE_MACC_CHAINS (TUNE_MIPS5500 \ + || TUNE_MIPS4120 \ + || TUNE_MIPS4130) + +#define TARGET_OLDABI (mips_abi == ABI_32 || mips_abi == ABI_O64) +#define TARGET_NEWABI (mips_abi == ABI_N32 || mips_abi == ABI_64) + +/* IRIX specific stuff. */ +#define TARGET_IRIX 0 +#define TARGET_IRIX6 0 + +/* Define preprocessor macros for the -march and -mtune options. + PREFIX is either _MIPS_ARCH or _MIPS_TUNE, INFO is the selected + processor. If INFO's canonical name is "foo", define PREFIX to + be "foo", and define an additional macro PREFIX_FOO. */ +#define MIPS_CPP_SET_PROCESSOR(PREFIX, INFO) \ + do \ + { \ + char *macro, *p; \ + \ + macro = concat ((PREFIX), "_", (INFO)->name, NULL); \ + for (p = macro; *p != 0; p++) \ + *p = TOUPPER (*p); \ + \ + builtin_define (macro); \ + builtin_define_with_value ((PREFIX), (INFO)->name, 1); \ + free (macro); \ + } \ + while (0) + +/* Target CPU builtins. */ +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + /* Everyone but IRIX defines this to mips. */ \ + if (!TARGET_IRIX) \ + builtin_assert ("machine=mips"); \ + \ + builtin_assert ("cpu=mips"); \ + builtin_define ("__mips__"); \ + builtin_define ("_mips"); \ + \ + /* We do this here because __mips is defined below \ + and so we can't use builtin_define_std. */ \ + if (!flag_iso) \ + builtin_define ("mips"); \ + \ + if (TARGET_64BIT) \ + builtin_define ("__mips64"); \ + \ + if (!TARGET_IRIX) \ + { \ + /* Treat _R3000 and _R4000 like register-size \ + defines, which is how they've historically \ + been used. */ \ + if (TARGET_64BIT) \ + { \ + builtin_define_std ("R4000"); \ + builtin_define ("_R4000"); \ + } \ + else \ + { \ + builtin_define_std ("R3000"); \ + builtin_define ("_R3000"); \ + } \ + } \ + if (TARGET_FLOAT64) \ + builtin_define ("__mips_fpr=64"); \ + else \ + builtin_define ("__mips_fpr=32"); \ + \ + if (TARGET_MIPS16) \ + builtin_define ("__mips16"); \ + \ + if (TARGET_MIPS3D) \ + builtin_define ("__mips3d"); \ + \ + if (TARGET_DSP) \ + builtin_define ("__mips_dsp"); \ + \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \ + \ + if (ISA_MIPS1) \ + { \ + builtin_define ("__mips=1"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS1"); \ + } \ + else if (ISA_MIPS2) \ + { \ + builtin_define ("__mips=2"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS2"); \ + } \ + else if (ISA_MIPS3) \ + { \ + builtin_define ("__mips=3"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS3"); \ + } \ + else if (ISA_MIPS4) \ + { \ + builtin_define ("__mips=4"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS4"); \ + } \ + else if (ISA_MIPS32) \ + { \ + builtin_define ("__mips=32"); \ + builtin_define ("__mips_isa_rev=1"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS32"); \ + } \ + else if (ISA_MIPS32R2) \ + { \ + builtin_define ("__mips=32"); \ + builtin_define ("__mips_isa_rev=2"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS32"); \ + } \ + else if (ISA_MIPS64) \ + { \ + builtin_define ("__mips=64"); \ + builtin_define ("__mips_isa_rev=1"); \ + builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS64"); \ + } \ + \ + if (TARGET_HARD_FLOAT) \ + builtin_define ("__mips_hard_float"); \ + else if (TARGET_SOFT_FLOAT) \ + builtin_define ("__mips_soft_float"); \ + \ + if (TARGET_SINGLE_FLOAT) \ + builtin_define ("__mips_single_float"); \ + \ + if (TARGET_PAIRED_SINGLE_FLOAT) \ + builtin_define ("__mips_paired_single_float"); \ + \ + if (TARGET_BIG_ENDIAN) \ + { \ + builtin_define_std ("MIPSEB"); \ + builtin_define ("_MIPSEB"); \ + } \ + else \ + { \ + builtin_define_std ("MIPSEL"); \ + builtin_define ("_MIPSEL"); \ + } \ + \ + /* Macros dependent on the C dialect. */ \ + if (preprocessing_asm_p ()) \ + { \ + builtin_define_std ("LANGUAGE_ASSEMBLY"); \ + builtin_define ("_LANGUAGE_ASSEMBLY"); \ + } \ + else if (c_dialect_cxx ()) \ + { \ + builtin_define ("_LANGUAGE_C_PLUS_PLUS"); \ + builtin_define ("__LANGUAGE_C_PLUS_PLUS"); \ + builtin_define ("__LANGUAGE_C_PLUS_PLUS__"); \ + } \ + else \ + { \ + builtin_define_std ("LANGUAGE_C"); \ + builtin_define ("_LANGUAGE_C"); \ + } \ + if (c_dialect_objc ()) \ + { \ + builtin_define ("_LANGUAGE_OBJECTIVE_C"); \ + builtin_define ("__LANGUAGE_OBJECTIVE_C"); \ + /* Bizarre, but needed at least for Irix. */ \ + builtin_define_std ("LANGUAGE_C"); \ + builtin_define ("_LANGUAGE_C"); \ + } \ + \ + if (mips_abi == ABI_EABI) \ + builtin_define ("__mips_eabi"); \ + \ +} while (0) + +/* Default target_flags if no switches are specified */ + +#ifndef TARGET_DEFAULT +#define TARGET_DEFAULT 0 +#endif + +#ifndef TARGET_CPU_DEFAULT +#define TARGET_CPU_DEFAULT 0 +#endif + +#ifndef TARGET_ENDIAN_DEFAULT +#define TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN +#endif + +#ifndef TARGET_FP_EXCEPTIONS_DEFAULT +#define TARGET_FP_EXCEPTIONS_DEFAULT MASK_FP_EXCEPTIONS +#endif + +/* 'from-abi' makes a good default: you get whatever the ABI requires. */ +#ifndef MIPS_ISA_DEFAULT +#ifndef MIPS_CPU_STRING_DEFAULT +#define MIPS_CPU_STRING_DEFAULT "from-abi" +#endif +#endif + +#ifdef IN_LIBGCC2 +#undef TARGET_64BIT +/* Make this compile time constant for libgcc2 */ +#ifdef __mips64 +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif /* IN_LIBGCC2 */ + +#define TARGET_LIBGCC_SDATA_SECTION ".sdata" + +#ifndef MULTILIB_ENDIAN_DEFAULT +#if TARGET_ENDIAN_DEFAULT == 0 +#define MULTILIB_ENDIAN_DEFAULT "EL" +#else +#define MULTILIB_ENDIAN_DEFAULT "EB" +#endif +#endif + +#ifndef MULTILIB_ISA_DEFAULT +# if MIPS_ISA_DEFAULT == 1 +# define MULTILIB_ISA_DEFAULT "mips1" +# else +# if MIPS_ISA_DEFAULT == 2 +# define MULTILIB_ISA_DEFAULT "mips2" +# else +# if MIPS_ISA_DEFAULT == 3 +# define MULTILIB_ISA_DEFAULT "mips3" +# else +# if MIPS_ISA_DEFAULT == 4 +# define MULTILIB_ISA_DEFAULT "mips4" +# else +# if MIPS_ISA_DEFAULT == 32 +# define MULTILIB_ISA_DEFAULT "mips32" +# else +# if MIPS_ISA_DEFAULT == 33 +# define MULTILIB_ISA_DEFAULT "mips32r2" +# else +# if MIPS_ISA_DEFAULT == 64 +# define MULTILIB_ISA_DEFAULT "mips64" +# else +# define MULTILIB_ISA_DEFAULT "mips1" +# endif +# endif +# endif +# endif +# endif +# endif +# endif +#endif + +#ifndef MULTILIB_DEFAULTS +#define MULTILIB_DEFAULTS \ + { MULTILIB_ENDIAN_DEFAULT, MULTILIB_ISA_DEFAULT, MULTILIB_ABI_DEFAULT } +#endif + +/* We must pass -EL to the linker by default for little endian embedded + targets using linker scripts with a OUTPUT_FORMAT line. Otherwise, the + linker will default to using big-endian output files. The OUTPUT_FORMAT + line must be in the linker script, otherwise -EB/-EL will not work. */ + +#ifndef ENDIAN_SPEC +#if TARGET_ENDIAN_DEFAULT == 0 +#define ENDIAN_SPEC "%{!EB:%{!meb:-EL}} %{EB|meb:-EB}" +#else +#define ENDIAN_SPEC "%{!EL:%{!mel:-EB}} %{EL|mel:-EL}" +#endif +#endif + +/* Support for a compile-time default CPU, et cetera. The rules are: + --with-arch is ignored if -march is specified or a -mips is specified + (other than -mips16). + --with-tune is ignored if -mtune is specified. + --with-abi is ignored if -mabi is specified. + --with-float is ignored if -mhard-float or -msoft-float are + specified. + --with-divide is ignored if -mdivide-traps or -mdivide-breaks are + specified. */ +#define OPTION_DEFAULT_SPECS \ + {"arch", "%{!march=*:%{mips16:-march=%(VALUE)}%{!mips*:-march=%(VALUE)}}" }, \ + {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ + {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \ + {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }, \ + {"divide", "%{!mdivide-traps:%{!mdivide-breaks:-mdivide-%(VALUE)}}" } + + +#define GENERATE_DIVIDE_TRAPS (TARGET_DIVIDE_TRAPS \ + && ISA_HAS_COND_TRAP) + +#define GENERATE_BRANCHLIKELY (TARGET_BRANCHLIKELY \ + && !TARGET_SR71K \ + && !TARGET_MIPS16) + +/* Generate three-operand multiply instructions for SImode. */ +#define GENERATE_MULT3_SI ((TARGET_MIPS3900 \ + || TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_MIPS7000 \ + || TARGET_MIPS9000 \ + || TARGET_MAD \ + || ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64) \ + && !TARGET_MIPS16) + +/* Generate three-operand multiply instructions for DImode. */ +#define GENERATE_MULT3_DI ((TARGET_MIPS3900) \ + && !TARGET_MIPS16) + +/* True if the ABI can only work with 64-bit integer registers. We + generally allow ad-hoc variations for TARGET_SINGLE_FLOAT, but + otherwise floating-point registers must also be 64-bit. */ +#define ABI_NEEDS_64BIT_REGS (TARGET_NEWABI || mips_abi == ABI_O64) + +/* Likewise for 32-bit regs. */ +#define ABI_NEEDS_32BIT_REGS (mips_abi == ABI_32) + +/* True if symbols are 64 bits wide. At present, n64 is the only + ABI for which this is true. */ +#define ABI_HAS_64BIT_SYMBOLS (mips_abi == ABI_64 && !TARGET_SYM32) + +/* ISA has instructions for managing 64 bit fp and gp regs (e.g. mips3). */ +#define ISA_HAS_64BIT_REGS (ISA_MIPS3 \ + || ISA_MIPS4 \ + || ISA_MIPS64) + +/* ISA has branch likely instructions (e.g. mips2). */ +/* Disable branchlikely for tx39 until compare rewrite. They haven't + been generated up to this point. */ +#define ISA_HAS_BRANCHLIKELY (!ISA_MIPS1) + +/* ISA has the conditional move instructions introduced in mips4. */ +#define ISA_HAS_CONDMOVE ((ISA_MIPS4 \ + || ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64) \ + && !TARGET_MIPS5500 \ + && !TARGET_MIPS16) + +/* ISA has the mips4 FP condition code instructions: FP-compare to CC, + branch on CC, and move (both FP and non-FP) on CC. */ +#define ISA_HAS_8CC (ISA_MIPS4 \ + || ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64) + +/* This is a catch all for other mips4 instructions: indexed load, the + FP madd and msub instructions, and the FP recip and recip sqrt + instructions. */ +#define ISA_HAS_FP4 ((ISA_MIPS4 \ + || ISA_MIPS64) \ + && !TARGET_MIPS16) + +/* ISA has conditional trap instructions. */ +#define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ + && !TARGET_MIPS16) + +/* ISA has integer multiply-accumulate instructions, madd and msub. */ +#define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64 \ + ) && !TARGET_MIPS16) + +/* ISA has floating-point nmadd and nmsub instructions. */ +#define ISA_HAS_NMADD_NMSUB ((ISA_MIPS4 \ + || ISA_MIPS64) \ + && (!TARGET_MIPS5400 || TARGET_MAD) \ + && ! TARGET_MIPS16) + +/* ISA has count leading zeroes/ones instruction (not implemented). */ +#define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64 \ + ) && !TARGET_MIPS16) + +/* ISA has double-word count leading zeroes/ones instruction (not + implemented). */ +#define ISA_HAS_DCLZ_DCLO (ISA_MIPS64 \ + && !TARGET_MIPS16) + +/* ISA has three operand multiply instructions that put + the high part in an accumulator: mulhi or mulhiu. */ +#define ISA_HAS_MULHI (TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + ) + +/* ISA has three operand multiply instructions that + negates the result and puts the result in an accumulator. */ +#define ISA_HAS_MULS (TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + ) + +/* ISA has three operand multiply instructions that subtracts the + result from a 4th operand and puts the result in an accumulator. */ +#define ISA_HAS_MSAC (TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + ) +/* ISA has three operand multiply instructions that the result + from a 4th operand and puts the result in an accumulator. */ +#define ISA_HAS_MACC ((TARGET_MIPS4120 && !TARGET_MIPS16) \ + || (TARGET_MIPS4130 && !TARGET_MIPS16) \ + || TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + ) + +/* ISA has NEC VR-style MACC, MACCHI, DMACC and DMACCHI instructions. */ +#define ISA_HAS_MACCHI (!TARGET_MIPS16 \ + && (TARGET_MIPS4120 \ + || TARGET_MIPS4130)) + +/* ISA has 32-bit rotate right instruction. */ +#define ISA_HAS_ROTR_SI (!TARGET_MIPS16 \ + && (ISA_MIPS32R2 \ + || TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + )) + +/* ISA has 64-bit rotate right instruction. */ +#define ISA_HAS_ROTR_DI (TARGET_64BIT \ + && !TARGET_MIPS16 \ + && (TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ + )) + +/* ISA has data prefetch instructions. This controls use of 'pref'. */ +#define ISA_HAS_PREFETCH ((ISA_MIPS4 \ + || ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64) \ + && !TARGET_MIPS16) + +/* ISA has data indexed prefetch instructions. This controls use of + 'prefx', along with TARGET_HARD_FLOAT and TARGET_DOUBLE_FLOAT. + (prefx is a cop1x instruction, so can only be used if FP is + enabled.) */ +#define ISA_HAS_PREFETCHX ((ISA_MIPS4 \ + || ISA_MIPS64) \ + && !TARGET_MIPS16) + +/* True if trunc.w.s and trunc.w.d are real (not synthetic) + instructions. Both require TARGET_HARD_FLOAT, and trunc.w.d + also requires TARGET_DOUBLE_FLOAT. */ +#define ISA_HAS_TRUNC_W (!ISA_MIPS1) + +/* ISA includes the MIPS32r2 seb and seh instructions. */ +#define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \ + && (ISA_MIPS32R2 \ + )) + +/* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ +#define ISA_HAS_EXT_INS (!TARGET_MIPS16 \ + && (ISA_MIPS32R2 \ + )) + +/* True if the result of a load is not available to the next instruction. + A nop will then be needed between instructions like "lw $4,..." + and "addiu $4,$4,1". */ +#define ISA_HAS_LOAD_DELAY (mips_isa == 1 \ + && !TARGET_MIPS3900 \ + && !TARGET_MIPS16) + +/* Likewise mtc1 and mfc1. */ +#define ISA_HAS_XFER_DELAY (mips_isa <= 3) + +/* Likewise floating-point comparisons. */ +#define ISA_HAS_FCMP_DELAY (mips_isa <= 3) + +/* True if mflo and mfhi can be immediately followed by instructions + which write to the HI and LO registers. + + According to MIPS specifications, MIPS ISAs I, II, and III need + (at least) two instructions between the reads of HI/LO and + instructions which write them, and later ISAs do not. Contradicting + the MIPS specifications, some MIPS IV processor user manuals (e.g. + the UM for the NEC Vr5000) document needing the instructions between + HI/LO reads and writes, as well. Therefore, we declare only MIPS32, + MIPS64 and later ISAs to have the interlocks, plus any specific + earlier-ISA CPUs for which CPU documentation declares that the + instructions are really interlocked. */ +#define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64 \ + || TARGET_MIPS5500) + +/* Add -G xx support. */ + +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G') + +#define OVERRIDE_OPTIONS override_options () + +#define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage () + +/* Show we can debug even without a frame pointer. */ +#define CAN_DEBUG_WITHOUT_FP + +/* Tell collect what flags to pass to nm. */ +#ifndef NM_FLAGS +#define NM_FLAGS "-Bn" +#endif + + +#ifndef MIPS_ABI_DEFAULT +#define MIPS_ABI_DEFAULT ABI_32 +#endif + +/* Use the most portable ABI flag for the ASM specs. */ + +#if MIPS_ABI_DEFAULT == ABI_32 +#define MULTILIB_ABI_DEFAULT "mabi=32" +#endif + +#if MIPS_ABI_DEFAULT == ABI_O64 +#define MULTILIB_ABI_DEFAULT "mabi=o64" +#endif + +#if MIPS_ABI_DEFAULT == ABI_N32 +#define MULTILIB_ABI_DEFAULT "mabi=n32" +#endif + +#if MIPS_ABI_DEFAULT == ABI_64 +#define MULTILIB_ABI_DEFAULT "mabi=64" +#endif + +#if MIPS_ABI_DEFAULT == ABI_EABI +#define MULTILIB_ABI_DEFAULT "mabi=eabi" +#endif + +/* SUBTARGET_ASM_OPTIMIZING_SPEC handles passing optimization options + to the assembler. It may be overridden by subtargets. */ +#ifndef SUBTARGET_ASM_OPTIMIZING_SPEC +#define SUBTARGET_ASM_OPTIMIZING_SPEC "\ +%{noasmopt:-O0} \ +%{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}" +#endif + +/* SUBTARGET_ASM_DEBUGGING_SPEC handles passing debugging options to + the assembler. It may be overridden by subtargets. + + Beginning with gas 2.13, -mdebug must be passed to correctly handle + COFF debugging info. */ + +#ifndef SUBTARGET_ASM_DEBUGGING_SPEC +#define SUBTARGET_ASM_DEBUGGING_SPEC "\ +%{g} %{g0} %{g1} %{g2} %{g3} \ +%{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \ +%{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \ +%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \ +%{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \ +%{gcoff*:-mdebug} %{!gcoff*:-no-mdebug}" +#endif + +/* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be + overridden by subtargets. */ + +#ifndef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "" +#endif + +#undef ASM_SPEC +#define ASM_SPEC "\ +%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ +%{mips32} %{mips32r2} %{mips64} \ +%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ +%{mips3d:-mips3d} \ +%{mdsp} \ +%{mfix-vr4120} %{mfix-vr4130} \ +%(subtarget_asm_optimizing_spec) \ +%(subtarget_asm_debugging_spec) \ +%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \ +%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ +%{mshared} %{mno-shared} \ +%{msym32} %{mno-sym32} \ +%{mtune=*} %{v} \ +%(subtarget_asm_spec)" + +/* Extra switches sometimes passed to the linker. */ +/* ??? The bestGnum will never be passed to the linker, because the gcc driver + will interpret it as a -b option. */ + +#ifndef LINK_SPEC +#define LINK_SPEC "\ +%(endian_spec) \ +%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \ +%{bestGnum} %{shared} %{non_shared}" +#endif /* LINK_SPEC defined */ + + +/* Specs for the compiler proper */ + +/* SUBTARGET_CC1_SPEC is passed to the compiler proper. It may be + overridden by subtargets. */ +#ifndef SUBTARGET_CC1_SPEC +#define SUBTARGET_CC1_SPEC "" +#endif + +/* CC1_SPEC is the set of arguments to pass to the compiler proper. */ + +#undef CC1_SPEC +#define CC1_SPEC "\ +%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ +%{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \ +%{save-temps: } \ +%(subtarget_cc1_spec)" + +/* Preprocessor specs. */ + +/* SUBTARGET_CPP_SPEC is passed to the preprocessor. It may be + overridden by subtargets. */ +#ifndef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "" +#endif + +#define CPP_SPEC "%(subtarget_cpp_spec)" + +/* This macro defines names of additional specifications to put in the specs + that can be used in various specifications like CC1_SPEC. Its definition + is an initializer with a subgrouping for each command option. + + Each subgrouping contains a string constant, that defines the + specification name, and a string constant that used by the GCC driver + program. + + Do not define this macro if it does not need to do anything. */ + +#define EXTRA_SPECS \ + { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, \ + { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ + { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \ + { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \ + { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \ + { "asm_abi_default_spec", "-" MULTILIB_ABI_DEFAULT }, \ + { "endian_spec", ENDIAN_SPEC }, \ + SUBTARGET_EXTRA_SPECS + +#ifndef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS +#endif + +#define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */ +#define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */ +#define DWARF2_DEBUGGING_INFO 1 /* dwarf2 debugging info */ + +#ifndef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG +#endif + +#define DWARF2_ADDR_SIZE (ABI_HAS_64BIT_SYMBOLS ? 8 : 4) + +/* By default, turn on GDB extensions. */ +#define DEFAULT_GDB_EXTENSIONS 1 + +/* Local compiler-generated symbols must have a prefix that the assembler + understands. By default, this is $, although some targets (e.g., + NetBSD-ELF) need to override this. */ + +#ifndef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "$" +#endif + +/* By default on the mips, external symbols do not have an underscore + prepended, but some targets (e.g., NetBSD) require this. */ + +#ifndef USER_LABEL_PREFIX +#define USER_LABEL_PREFIX "" +#endif + +/* On Sun 4, this limit is 2048. We use 1500 to be safe, + since the length can run past this up to a continuation point. */ +#undef DBX_CONTIN_LENGTH +#define DBX_CONTIN_LENGTH 1500 + +/* How to renumber registers for dbx and gdb. */ +#define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ] + +/* The mapping from gcc register number to DWARF 2 CFA column number. */ +#define DWARF_FRAME_REGNUM(REG) (REG) + +/* The DWARF 2 CFA column which tracks the return address. */ +#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31) + +/* The DWARF 2 CFA column which tracks the return address from a + signal handler context. */ +#define SIGNAL_UNWIND_RETURN_COLUMN (FP_REG_LAST + 1) + +/* Before the prologue, RA lives in r31. */ +#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31) + +/* Describe how we implement __builtin_eh_return. */ +#define EH_RETURN_DATA_REGNO(N) \ + ((N) < (TARGET_MIPS16 ? 2 : 4) ? (N) + GP_ARG_FIRST : INVALID_REGNUM) + +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, GP_REG_FIRST + 3) + +/* Offsets recorded in opcodes are a multiple of this alignment factor. + The default for this in 64-bit mode is 8, which causes problems with + SFmode register saves. */ +#define DWARF_CIE_DATA_ALIGNMENT -4 + +/* Correct the offset of automatic variables and arguments. Note that + the MIPS debug format wants all automatic variables and arguments + to be in terms of the virtual frame pointer (stack pointer before + any adjustment in the function), while the MIPS 3.0 linker wants + the frame pointer to be the stack pointer after the initial + adjustment. */ + +#define DEBUGGER_AUTO_OFFSET(X) \ + mips_debugger_offset (X, (HOST_WIDE_INT) 0) +#define DEBUGGER_ARG_OFFSET(OFFSET, X) \ + mips_debugger_offset (X, (HOST_WIDE_INT) OFFSET) + +/* Target machine storage layout */ + +#define BITS_BIG_ENDIAN 0 +#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0) +#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0) + +/* Define this to set the endianness to use in libgcc2.c, which can + not depend on target_flags. */ +#if !defined(MIPSEL) && !defined(__MIPSEL__) +#define LIBGCC2_WORDS_BIG_ENDIAN 1 +#else +#define LIBGCC2_WORDS_BIG_ENDIAN 0 +#endif + +#define MAX_BITS_PER_WORD 64 + +/* Width of a word, in units (bytes). */ +#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4) +#ifndef IN_LIBGCC2 +#define MIN_UNITS_PER_WORD 4 +#endif + +/* For MIPS, width of a floating point register. */ +#define UNITS_PER_FPREG (TARGET_FLOAT64 ? 8 : 4) + +/* If register $f0 holds a floating-point value, $f(0 + FP_INC) is + the next available register. */ +#define FP_INC (TARGET_FLOAT64 || TARGET_SINGLE_FLOAT ? 1 : 2) + +/* The largest size of value that can be held in floating-point + registers and moved with a single instruction. */ +#define UNITS_PER_HWFPVALUE (TARGET_SOFT_FLOAT ? 0 : FP_INC * UNITS_PER_FPREG) + +/* The largest size of value that can be held in floating-point + registers. */ +#define UNITS_PER_FPVALUE \ + (TARGET_SOFT_FLOAT ? 0 \ + : TARGET_SINGLE_FLOAT ? UNITS_PER_FPREG \ + : LONG_DOUBLE_TYPE_SIZE / BITS_PER_UNIT) + +/* The number of bytes in a double. */ +#define UNITS_PER_DOUBLE (TYPE_PRECISION (double_type_node) / BITS_PER_UNIT) + +#define UNITS_PER_SIMD_WORD (TARGET_PAIRED_SINGLE_FLOAT ? 8 : UNITS_PER_WORD) + +/* Set the sizes of the core types. */ +#define SHORT_TYPE_SIZE 16 +#define INT_TYPE_SIZE 32 +#define LONG_TYPE_SIZE (TARGET_LONG64 ? 64 : 32) +#define LONG_LONG_TYPE_SIZE 64 + +#define FLOAT_TYPE_SIZE 32 +#define DOUBLE_TYPE_SIZE 64 +#define LONG_DOUBLE_TYPE_SIZE (TARGET_NEWABI ? 128 : 64) + +/* long double is not a fixed mode, but the idea is that, if we + support long double, we also want a 128-bit integer type. */ +#define MAX_FIXED_MODE_SIZE LONG_DOUBLE_TYPE_SIZE + +#ifdef IN_LIBGCC2 +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) \ + || (defined _ABI64 && _MIPS_SIM == _ABI64) +# define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 +# else +# define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 +# endif +#endif + +/* Width in bits of a pointer. */ +#ifndef POINTER_SIZE +#define POINTER_SIZE ((TARGET_LONG64 && TARGET_64BIT) ? 64 : 32) +#endif + +/* Allocation boundary (in *bits*) for storing arguments in argument list. */ +#define PARM_BOUNDARY BITS_PER_WORD + +/* Allocation boundary (in *bits*) for the code of a function. */ +#define FUNCTION_BOUNDARY 32 + +/* Alignment of field after `int : 0' in a structure. */ +#define EMPTY_FIELD_BOUNDARY 32 + +/* Every structure's size must be a multiple of this. */ +/* 8 is observed right on a DECstation and on riscos 4.02. */ +#define STRUCTURE_SIZE_BOUNDARY 8 + +/* There is no point aligning anything to a rounder boundary than this. */ +#define BIGGEST_ALIGNMENT LONG_DOUBLE_TYPE_SIZE + +/* All accesses must be aligned. */ +#define STRICT_ALIGNMENT 1 + +/* Define this if you wish to imitate the way many other C compilers + handle alignment of bitfields and the structures that contain + them. + + The behavior is that the type written for a bit-field (`int', + `short', or other integer type) imposes an alignment for the + entire structure, as if the structure really did contain an + ordinary field of that type. In addition, the bit-field is placed + within the structure so that it would fit within such a field, + not crossing a boundary for it. + + Thus, on most machines, a bit-field whose type is written as `int' + would not cross a four-byte boundary, and would force four-byte + alignment for the whole structure. (The alignment used may not + be four bytes; it is controlled by the other alignment + parameters.) + + If the macro is defined, its definition should be a C expression; + a nonzero value for the expression enables this behavior. */ + +#define PCC_BITFIELD_TYPE_MATTERS 1 + +/* If defined, a C expression to compute the alignment given to a + constant that is being placed in memory. CONSTANT is the constant + and ALIGN is the alignment that the object would ordinarily have. + The value of this macro is used instead of that alignment to align + the object. + + If this macro is not defined, then ALIGN is used. + + The typical use of this macro is to increase alignment for string + constants to be word aligned so that `strcpy' calls that copy + constants can be done inline. */ + +#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ + ((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \ + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) + +/* If defined, a C expression to compute the alignment for a static + variable. TYPE is the data type, and ALIGN is the alignment that + the object would ordinarily have. The value of this macro is used + instead of that alignment to align the object. + + If this macro is not defined, then ALIGN is used. + + One use of this macro is to increase alignment of medium-size + data to make it all fit in fewer cache lines. Another is to + cause character arrays to be word-aligned so that `strcpy' calls + that copy constants to character arrays can be done inline. */ + +#undef DATA_ALIGNMENT +#define DATA_ALIGNMENT(TYPE, ALIGN) \ + ((((ALIGN) < BITS_PER_WORD) \ + && (TREE_CODE (TYPE) == ARRAY_TYPE \ + || TREE_CODE (TYPE) == UNION_TYPE \ + || TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN)) + + +#define PAD_VARARGS_DOWN \ + (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward) + +/* Define if operations between registers always perform the operation + on the full register even if a narrower mode is specified. */ +#define WORD_REGISTER_OPERATIONS + +/* When in 64 bit mode, move insns will sign extend SImode and CCmode + moves. All other references are zero extended. */ +#define LOAD_EXTEND_OP(MODE) \ + (TARGET_64BIT && ((MODE) == SImode || (MODE) == CCmode) \ + ? SIGN_EXTEND : ZERO_EXTEND) + +/* Define this macro if it is advisable to hold scalars in registers + in a wider mode than that declared by the program. In such cases, + the value is constrained to be within the bounds of the declared + type, but kept valid in the wider mode. The signedness of the + extension may differ from that of the type. */ + +#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ + if (GET_MODE_CLASS (MODE) == MODE_INT \ + && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ + { \ + if ((MODE) == SImode) \ + (UNSIGNEDP) = 0; \ + (MODE) = Pmode; \ + } + +/* Define if loading short immediate values into registers sign extends. */ +#define SHORT_IMMEDIATES_SIGN_EXTEND + +/* The [d]clz instructions have the natural values at 0. */ + +#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ + ((VALUE) = GET_MODE_BITSIZE (MODE), true) + +/* Standard register usage. */ + +/* Number of hardware registers. We have: + + - 32 integer registers + - 32 floating point registers + - 8 condition code registers + - 2 accumulator registers (hi and lo) + - 32 registers each for coprocessors 0, 2 and 3 + - 3 fake registers: + - ARG_POINTER_REGNUM + - FRAME_POINTER_REGNUM + - FAKE_CALL_REGNO (see the comment above load_callsi for details) + - 3 dummy entries that were used at various times in the past. + - 6 DSP accumulator registers (3 hi-lo pairs) for MIPS DSP ASE + - 6 DSP control registers */ + +#define FIRST_PSEUDO_REGISTER 188 + +/* By default, fix the kernel registers ($26 and $27), the global + pointer ($28) and the stack pointer ($29). This can change + depending on the command-line options. + + Regarding coprocessor registers: without evidence to the contrary, + it's best to assume that each coprocessor register has a unique + use. This can be overridden, in, e.g., override_options() or + CONDITIONAL_REGISTER_USAGE should the assumption be inappropriate + for a particular target. */ + +#define FIXED_REGISTERS \ +{ \ + 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, \ + /* COP0 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP2 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP3 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* 6 DSP accumulator registers & 6 control registers */ \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 \ +} + + +/* Set up this array for o32 by default. + + Note that we don't mark $31 as a call-clobbered register. The idea is + that it's really the call instructions themselves which clobber $31. + We don't care what the called function does with it afterwards. + + This approach makes it easier to implement sibcalls. Unlike normal + calls, sibcalls don't clobber $31, so the register reaches the + called function in tact. EPILOGUE_USES says that $31 is useful + to the called function. */ + +#define CALL_USED_REGISTERS \ +{ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP0 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP2 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP3 registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* 6 DSP accumulator registers & 6 control registers */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \ +} + + +/* Define this since $28, though fixed, is call-saved in many ABIs. */ + +#define CALL_REALLY_USED_REGISTERS \ +{ /* General registers. */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, \ + /* Floating-point registers. */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + /* Others. */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + /* COP0 registers */ \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + /* COP2 registers */ \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + /* COP3 registers */ \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + /* 6 DSP accumulator registers & 6 control registers */ \ + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 \ +} + +/* Internal macros to classify a register number as to whether it's a + general purpose register, a floating point register, a + multiply/divide register, or a status register. */ + +#define GP_REG_FIRST 0 +#define GP_REG_LAST 31 +#define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1) +#define GP_DBX_FIRST 0 + +#define FP_REG_FIRST 32 +#define FP_REG_LAST 63 +#define FP_REG_NUM (FP_REG_LAST - FP_REG_FIRST + 1) +#define FP_DBX_FIRST ((write_symbols == DBX_DEBUG) ? 38 : 32) + +#define MD_REG_FIRST 64 +#define MD_REG_LAST 65 +#define MD_REG_NUM (MD_REG_LAST - MD_REG_FIRST + 1) +#define MD_DBX_FIRST (FP_DBX_FIRST + FP_REG_NUM) + +#define ST_REG_FIRST 67 +#define ST_REG_LAST 74 +#define ST_REG_NUM (ST_REG_LAST - ST_REG_FIRST + 1) + + +/* FIXME: renumber. */ +#define COP0_REG_FIRST 80 +#define COP0_REG_LAST 111 +#define COP0_REG_NUM (COP0_REG_LAST - COP0_REG_FIRST + 1) + +#define COP2_REG_FIRST 112 +#define COP2_REG_LAST 143 +#define COP2_REG_NUM (COP2_REG_LAST - COP2_REG_FIRST + 1) + +#define COP3_REG_FIRST 144 +#define COP3_REG_LAST 175 +#define COP3_REG_NUM (COP3_REG_LAST - COP3_REG_FIRST + 1) +/* ALL_COP_REG_NUM assumes that COP0,2,and 3 are numbered consecutively. */ +#define ALL_COP_REG_NUM (COP3_REG_LAST - COP0_REG_FIRST + 1) + +#define DSP_ACC_REG_FIRST 176 +#define DSP_ACC_REG_LAST 181 +#define DSP_ACC_REG_NUM (DSP_ACC_REG_LAST - DSP_ACC_REG_FIRST + 1) + +#define AT_REGNUM (GP_REG_FIRST + 1) +#define HI_REGNUM (MD_REG_FIRST + 0) +#define LO_REGNUM (MD_REG_FIRST + 1) +#define AC1HI_REGNUM (DSP_ACC_REG_FIRST + 0) +#define AC1LO_REGNUM (DSP_ACC_REG_FIRST + 1) +#define AC2HI_REGNUM (DSP_ACC_REG_FIRST + 2) +#define AC2LO_REGNUM (DSP_ACC_REG_FIRST + 3) +#define AC3HI_REGNUM (DSP_ACC_REG_FIRST + 4) +#define AC3LO_REGNUM (DSP_ACC_REG_FIRST + 5) + +/* FPSW_REGNUM is the single condition code used if !ISA_HAS_8CC. + If ISA_HAS_8CC, it should not be used, and an arbitrary ST_REG + should be used instead. */ +#define FPSW_REGNUM ST_REG_FIRST + +#define GP_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - GP_REG_FIRST) < GP_REG_NUM) +#define M16_REG_P(REGNO) \ + (((REGNO) >= 2 && (REGNO) <= 7) || (REGNO) == 16 || (REGNO) == 17) +#define FP_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - FP_REG_FIRST) < FP_REG_NUM) +#define MD_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - MD_REG_FIRST) < MD_REG_NUM) +#define ST_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - ST_REG_FIRST) < ST_REG_NUM) +#define COP0_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - COP0_REG_FIRST) < COP0_REG_NUM) +#define COP2_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - COP2_REG_FIRST) < COP2_REG_NUM) +#define COP3_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - COP3_REG_FIRST) < COP3_REG_NUM) +#define ALL_COP_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - COP0_REG_FIRST) < ALL_COP_REG_NUM) +/* Test if REGNO is one of the 6 new DSP accumulators. */ +#define DSP_ACC_REG_P(REGNO) \ + ((unsigned int) ((int) (REGNO) - DSP_ACC_REG_FIRST) < DSP_ACC_REG_NUM) +/* Test if REGNO is hi, lo, or one of the 6 new DSP accumulators. */ +#define ACC_REG_P(REGNO) \ + (MD_REG_P (REGNO) || DSP_ACC_REG_P (REGNO)) +/* Test if REGNO is HI or the first register of 3 new DSP accumulator pairs. */ +#define ACC_HI_REG_P(REGNO) \ + ((REGNO) == HI_REGNUM || (REGNO) == AC1HI_REGNUM || (REGNO) == AC2HI_REGNUM \ + || (REGNO) == AC3HI_REGNUM) + +#define FP_REG_RTX_P(X) (REG_P (X) && FP_REG_P (REGNO (X))) + +/* True if X is (const (unspec [(const_int 0)] UNSPEC_GP)). This is used + to initialize the mips16 gp pseudo register. */ +#define CONST_GP_P(X) \ + (GET_CODE (X) == CONST \ + && GET_CODE (XEXP (X, 0)) == UNSPEC \ + && XINT (XEXP (X, 0), 1) == UNSPEC_GP) + +/* Return coprocessor number from register number. */ + +#define COPNUM_AS_CHAR_FROM_REGNUM(REGNO) \ + (COP0_REG_P (REGNO) ? '0' : COP2_REG_P (REGNO) ? '2' \ + : COP3_REG_P (REGNO) ? '3' : '?') + + +#define HARD_REGNO_NREGS(REGNO, MODE) mips_hard_regno_nregs (REGNO, MODE) + +/* To make the code simpler, HARD_REGNO_MODE_OK just references an + array built in override_options. Because machmodes.h is not yet + included before this file is processed, the MODE bound can't be + expressed here. */ + +extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER]; + +#define HARD_REGNO_MODE_OK(REGNO, MODE) \ + mips_hard_regno_mode_ok[ (int)(MODE) ][ (REGNO) ] + +/* Value is 1 if it is a good idea to tie two pseudo registers + when one has mode MODE1 and one has mode MODE2. + If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, + for any hard reg, then this must be 0 for correct output. */ +#define MODES_TIEABLE_P(MODE1, MODE2) \ + ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \ + GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ + == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \ + GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT)) + +/* Register to use for pushing function arguments. */ +#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29) + +/* These two registers don't really exist: they get eliminated to either + the stack or hard frame pointer. */ +#define ARG_POINTER_REGNUM 77 +#define FRAME_POINTER_REGNUM 78 + +/* $30 is not available on the mips16, so we use $17 as the frame + pointer. */ +#define HARD_FRAME_POINTER_REGNUM \ + (TARGET_MIPS16 ? GP_REG_FIRST + 17 : GP_REG_FIRST + 30) + +/* Value should be nonzero if functions must have frame pointers. + Zero means the frame pointer need not be set up (and parms + may be accessed via the stack pointer) in functions that seem suitable. + This is computed in `reload', in reload1.c. */ +#define FRAME_POINTER_REQUIRED (current_function_calls_alloca) + +/* Register in which static-chain is passed to a function. */ +#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2) + +/* Registers used as temporaries in prologue/epilogue code. If we're + generating mips16 code, these registers must come from the core set + of 8. The prologue register mustn't conflict with any incoming + arguments, the static chain pointer, or the frame pointer. The + epilogue temporary mustn't conflict with the return registers, the + frame pointer, the EH stack adjustment, or the EH data registers. */ + +#define MIPS_PROLOGUE_TEMP_REGNUM (GP_REG_FIRST + 3) +#define MIPS_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + (TARGET_MIPS16 ? 6 : 8)) + +#define MIPS_PROLOGUE_TEMP(MODE) gen_rtx_REG (MODE, MIPS_PROLOGUE_TEMP_REGNUM) +#define MIPS_EPILOGUE_TEMP(MODE) gen_rtx_REG (MODE, MIPS_EPILOGUE_TEMP_REGNUM) + +/* Define this macro if it is as good or better to call a constant + function address than to call an address kept in a register. */ +#define NO_FUNCTION_CSE 1 + +/* The ABI-defined global pointer. Sometimes we use a different + register in leaf functions: see PIC_OFFSET_TABLE_REGNUM. */ +#define GLOBAL_POINTER_REGNUM (GP_REG_FIRST + 28) + +/* We normally use $28 as the global pointer. However, when generating + n32/64 PIC, it is better for leaf functions to use a call-clobbered + register instead. They can then avoid saving and restoring $28 + and perhaps avoid using a frame at all. + + When a leaf function uses something other than $28, mips_expand_prologue + will modify pic_offset_table_rtx in place. Take the register number + from there after reload. */ +#define PIC_OFFSET_TABLE_REGNUM \ + (reload_completed ? REGNO (pic_offset_table_rtx) : GLOBAL_POINTER_REGNUM) + +#define PIC_FUNCTION_ADDR_REGNUM (GP_REG_FIRST + 25) + +/* Define the classes of registers for register constraints in the + machine description. Also define ranges of constants. + + One of the classes must always be named ALL_REGS and include all hard regs. + If there is more than one class, another class must be named NO_REGS + and contain no registers. + + The name GENERAL_REGS must be the name of a class (or an alias for + another name such as ALL_REGS). This is the class of registers + that is allowed by "g" or "r" in a register constraint. + Also, registers outside this class are allocated only when + instructions express preferences for them. + + The classes must be numbered in nondecreasing order; that is, + a larger-numbered class must never be contained completely + in a smaller-numbered class. + + For any two classes, it is very desirable that there be another + class that represents their union. */ + +enum reg_class +{ + NO_REGS, /* no registers in set */ + M16_NA_REGS, /* mips16 regs not used to pass args */ + M16_REGS, /* mips16 directly accessible registers */ + T_REG, /* mips16 T register ($24) */ + M16_T_REGS, /* mips16 registers plus T register */ + PIC_FN_ADDR_REG, /* SVR4 PIC function address register */ + V1_REG, /* Register $v1 ($3) used for TLS access. */ + LEA_REGS, /* Every GPR except $25 */ + GR_REGS, /* integer registers */ + FP_REGS, /* floating point registers */ + HI_REG, /* hi register */ + LO_REG, /* lo register */ + MD_REGS, /* multiply/divide registers (hi/lo) */ + COP0_REGS, /* generic coprocessor classes */ + COP2_REGS, + COP3_REGS, + HI_AND_GR_REGS, /* union classes */ + LO_AND_GR_REGS, + HI_AND_FP_REGS, + COP0_AND_GR_REGS, + COP2_AND_GR_REGS, + COP3_AND_GR_REGS, + ALL_COP_REGS, + ALL_COP_AND_GR_REGS, + ST_REGS, /* status registers (fp status) */ + DSP_ACC_REGS, /* DSP accumulator registers */ + ACC_REGS, /* Hi/Lo and DSP accumulator registers */ + ALL_REGS, /* all registers */ + LIM_REG_CLASSES /* max value + 1 */ +}; + +#define N_REG_CLASSES (int) LIM_REG_CLASSES + +#define GENERAL_REGS GR_REGS + +/* An initializer containing the names of the register classes as C + string constants. These names are used in writing some of the + debugging dumps. */ + +#define REG_CLASS_NAMES \ +{ \ + "NO_REGS", \ + "M16_NA_REGS", \ + "M16_REGS", \ + "T_REG", \ + "M16_T_REGS", \ + "PIC_FN_ADDR_REG", \ + "V1_REG", \ + "LEA_REGS", \ + "GR_REGS", \ + "FP_REGS", \ + "HI_REG", \ + "LO_REG", \ + "MD_REGS", \ + /* coprocessor registers */ \ + "COP0_REGS", \ + "COP2_REGS", \ + "COP3_REGS", \ + "HI_AND_GR_REGS", \ + "LO_AND_GR_REGS", \ + "HI_AND_FP_REGS", \ + "COP0_AND_GR_REGS", \ + "COP2_AND_GR_REGS", \ + "COP3_AND_GR_REGS", \ + "ALL_COP_REGS", \ + "ALL_COP_AND_GR_REGS", \ + "ST_REGS", \ + "DSP_ACC_REGS", \ + "ACC_REGS", \ + "ALL_REGS" \ +} + +/* An initializer containing the contents of the register classes, + as integers which are bit masks. The Nth integer specifies the + contents of class N. The way the integer MASK is interpreted is + that register R is in the class if `MASK & (1 << R)' is 1. + + When the machine has more than 32 registers, an integer does not + suffice. Then the integers are replaced by sub-initializers, + braced groupings containing several integers. Each + sub-initializer must be suitable as an initializer for the type + `HARD_REG_SET' which is defined in `hard-reg-set.h'. */ + +#define REG_CLASS_CONTENTS \ +{ \ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* no registers */ \ + { 0x0003000c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 nonarg regs */\ + { 0x000300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 registers */ \ + { 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 T register */ \ + { 0x010300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 and T regs */ \ + { 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* SVR4 PIC function address register */ \ + { 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* only $v1 */ \ + { 0xfdffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* Every other GPR except $25 */ \ + { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* integer registers */ \ + { 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* floating registers*/ \ + { 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, /* hi register */ \ + { 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000 }, /* lo register */ \ + { 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000 }, /* mul/div registers */ \ + { 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, /* cop0 registers */ \ + { 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, /* cop2 registers */ \ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, /* cop3 registers */ \ + { 0xffffffff, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, /* union classes */ \ + { 0xffffffff, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000 }, \ + { 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000000, 0x00000000 }, \ + { 0xffffffff, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000 }, \ + { 0xffffffff, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000 }, \ + { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffff0000, 0x0000ffff }, \ + { 0x00000000, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \ + { 0xffffffff, 0x00000000, 0xffff0000, 0xffffffff, 0xffffffff, 0x0000ffff }, \ + { 0x00000000, 0x00000000, 0x000007f8, 0x00000000, 0x00000000, 0x00000000 }, /* status registers */ \ + { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003f0000 }, /* dsp accumulator registers */ \ + { 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x003f0000 }, /* hi/lo and dsp accumulator registers */ \ + { 0xffffffff, 0xffffffff, 0xffff07ff, 0xffffffff, 0xffffffff, 0x0fffffff } /* all registers */ \ +} + + +/* A C expression whose value is a register class containing hard + register REGNO. In general there is more that one such class; + choose a class which is "minimal", meaning that no smaller class + also contains the register. */ + +extern const enum reg_class mips_regno_to_class[]; + +#define REGNO_REG_CLASS(REGNO) mips_regno_to_class[ (REGNO) ] + +/* A macro whose definition is the name of the class to which a + valid base register must belong. A base register is one used in + an address which is the register value plus a displacement. */ + +#define BASE_REG_CLASS (TARGET_MIPS16 ? M16_REGS : GR_REGS) + +/* A macro whose definition is the name of the class to which a + valid index register must belong. An index register is one used + in an address where its value is either multiplied by a scale + factor or added to another register (as well as added to a + displacement). */ + +#define INDEX_REG_CLASS NO_REGS + +/* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows + registers explicitly used in the rtl to be used as spill registers + but prevents the compiler from extending the lifetime of these + registers. */ + +#define SMALL_REGISTER_CLASSES (TARGET_MIPS16) + +/* This macro is used later on in the file. */ +#define GR_REG_CLASS_P(CLASS) \ + ((CLASS) == GR_REGS || (CLASS) == M16_REGS || (CLASS) == T_REG \ + || (CLASS) == M16_T_REGS || (CLASS) == M16_NA_REGS \ + || (CLASS) == V1_REG \ + || (CLASS) == PIC_FN_ADDR_REG || (CLASS) == LEA_REGS) + +/* This macro is also used later on in the file. */ +#define COP_REG_CLASS_P(CLASS) \ + ((CLASS) == COP0_REGS || (CLASS) == COP2_REGS || (CLASS) == COP3_REGS) + +/* REG_ALLOC_ORDER is to order in which to allocate registers. This + is the default value (allocate the registers in numeric order). We + define it just so that we can override it for the mips16 target in + ORDER_REGS_FOR_LOCAL_ALLOC. */ + +#define REG_ALLOC_ORDER \ +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, \ + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, \ + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \ + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, \ + 96, 97, 98, 99, 100,101,102,103,104,105,106,107,108,109,110,111, \ + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, \ + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, \ + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, \ + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, \ + 176,177,178,179,180,181,182,183,184,185,186,187 \ +} + +/* ORDER_REGS_FOR_LOCAL_ALLOC is a macro which permits reg_alloc_order + to be rearranged based on a particular function. On the mips16, we + want to allocate $24 (T_REG) before other registers for + instructions for which it is possible. */ + +#define ORDER_REGS_FOR_LOCAL_ALLOC mips_order_regs_for_local_alloc () + +/* True if VALUE is an unsigned 6-bit number. */ + +#define UIMM6_OPERAND(VALUE) \ + (((VALUE) & ~(unsigned HOST_WIDE_INT) 0x3f) == 0) + +/* True if VALUE is a signed 10-bit number. */ + +#define IMM10_OPERAND(VALUE) \ + ((unsigned HOST_WIDE_INT) (VALUE) + 0x200 < 0x400) + +/* True if VALUE is a signed 16-bit number. */ + +#define SMALL_OPERAND(VALUE) \ + ((unsigned HOST_WIDE_INT) (VALUE) + 0x8000 < 0x10000) + +/* True if VALUE is an unsigned 16-bit number. */ + +#define SMALL_OPERAND_UNSIGNED(VALUE) \ + (((VALUE) & ~(unsigned HOST_WIDE_INT) 0xffff) == 0) + +/* True if VALUE can be loaded into a register using LUI. */ + +#define LUI_OPERAND(VALUE) \ + (((VALUE) | 0x7fff0000) == 0x7fff0000 \ + || ((VALUE) | 0x7fff0000) + 0x10000 == 0) + +/* Return a value X with the low 16 bits clear, and such that + VALUE - X is a signed 16-bit value. */ + +#define CONST_HIGH_PART(VALUE) \ + (((VALUE) + 0x8000) & ~(unsigned HOST_WIDE_INT) 0xffff) + +#define CONST_LOW_PART(VALUE) \ + ((VALUE) - CONST_HIGH_PART (VALUE)) + +#define SMALL_INT(X) SMALL_OPERAND (INTVAL (X)) +#define SMALL_INT_UNSIGNED(X) SMALL_OPERAND_UNSIGNED (INTVAL (X)) +#define LUI_INT(X) LUI_OPERAND (INTVAL (X)) + +#define PREFERRED_RELOAD_CLASS(X,CLASS) \ + mips_preferred_reload_class (X, CLASS) + +/* Certain machines have the property that some registers cannot be + copied to some other registers without using memory. Define this + macro on those machines to be a C expression that is nonzero if + objects of mode MODE in registers of CLASS1 can only be copied to + registers of class CLASS2 by storing a register of CLASS1 into + memory and loading that memory location into a register of CLASS2. + + Do not define this macro if its value would always be zero. */ +#if 0 +#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ + ((!TARGET_DEBUG_H_MODE \ + && GET_MODE_CLASS (MODE) == MODE_INT \ + && ((CLASS1 == FP_REGS && GR_REG_CLASS_P (CLASS2)) \ + || (GR_REG_CLASS_P (CLASS1) && CLASS2 == FP_REGS))) \ + || (TARGET_FLOAT64 && !TARGET_64BIT && (MODE) == DFmode \ + && ((GR_REG_CLASS_P (CLASS1) && CLASS2 == FP_REGS) \ + || (GR_REG_CLASS_P (CLASS2) && CLASS1 == FP_REGS)))) +#endif +/* The HI and LO registers can only be reloaded via the general + registers. Condition code registers can only be loaded to the + general registers, and from the floating point registers. */ + +#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ + mips_secondary_reload_class (CLASS, MODE, X, 1) +#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ + mips_secondary_reload_class (CLASS, MODE, X, 0) + +/* Return the maximum number of consecutive registers + needed to represent mode MODE in a register of class CLASS. */ + +#define CLASS_MAX_NREGS(CLASS, MODE) mips_class_max_nregs (CLASS, MODE) + +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + mips_cannot_change_mode_class (FROM, TO, CLASS) + +/* Stack layout; function entry, exit and calling. */ + +#define STACK_GROWS_DOWNWARD + +/* The offset of the first local variable from the beginning of the frame. + See compute_frame_size for details about the frame layout. + + ??? If flag_profile_values is true, and we are generating 32-bit code, then + we assume that we will need 16 bytes of argument space. This is because + the value profiling code may emit calls to cmpdi2 in leaf functions. + Without this hack, the local variables will start at sp+8 and the gp save + area will be at sp+16, and thus they will overlap. compute_frame_size is + OK because it uses STARTING_FRAME_OFFSET to compute cprestore_size, which + will end up as 24 instead of 8. This won't be needed if profiling code is + inserted before virtual register instantiation. */ + +#define STARTING_FRAME_OFFSET \ + ((flag_profile_values && ! TARGET_64BIT \ + ? MAX (REG_PARM_STACK_SPACE(NULL), current_function_outgoing_args_size) \ + : current_function_outgoing_args_size) \ + + (TARGET_ABICALLS && !TARGET_NEWABI \ + ? MIPS_STACK_ALIGN (UNITS_PER_WORD) : 0)) + +#define RETURN_ADDR_RTX mips_return_addr + +/* Since the mips16 ISA mode is encoded in the least-significant bit + of the address, mask it off return addresses for purposes of + finding exception handling regions. */ + +#define MASK_RETURN_ADDR GEN_INT (-2) + + +/* Similarly, don't use the least-significant bit to tell pointers to + code from vtable index. */ + +#define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_delta + +/* The eliminations to $17 are only used for mips16 code. See the + definition of HARD_FRAME_POINTER_REGNUM. */ + +#define ELIMINABLE_REGS \ +{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { ARG_POINTER_REGNUM, GP_REG_FIRST + 30}, \ + { ARG_POINTER_REGNUM, GP_REG_FIRST + 17}, \ + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { FRAME_POINTER_REGNUM, GP_REG_FIRST + 30}, \ + { FRAME_POINTER_REGNUM, GP_REG_FIRST + 17}} + +/* We can always eliminate to the hard frame pointer. We can eliminate + to the stack pointer unless a frame pointer is needed. + + In mips16 mode, we need a frame pointer for a large frame; otherwise, + reload may be unable to compute the address of a local variable, + since there is no way to add a large constant to the stack pointer + without using a temporary register. */ +#define CAN_ELIMINATE(FROM, TO) \ + ((TO) == HARD_FRAME_POINTER_REGNUM \ + || ((TO) == STACK_POINTER_REGNUM && !frame_pointer_needed \ + && (!TARGET_MIPS16 \ + || compute_frame_size (get_frame_size ()) < 32768))) + +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + (OFFSET) = mips_initial_elimination_offset ((FROM), (TO)) + +/* Allocate stack space for arguments at the beginning of each function. */ +#define ACCUMULATE_OUTGOING_ARGS 1 + +/* The argument pointer always points to the first argument. */ +#define FIRST_PARM_OFFSET(FNDECL) 0 + +/* o32 and o64 reserve stack space for all argument registers. */ +#define REG_PARM_STACK_SPACE(FNDECL) \ + (TARGET_OLDABI \ + ? (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) \ + : 0) + +/* Define this if it is the responsibility of the caller to + allocate the area reserved for arguments passed in registers. + If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect + of this macro is to determine whether the space is included in + `current_function_outgoing_args_size'. */ +#define OUTGOING_REG_PARM_STACK_SPACE + +#define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64) + +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 + +/* Symbolic macros for the registers used to return integer and floating + point values. */ + +#define GP_RETURN (GP_REG_FIRST + 2) +#define FP_RETURN ((TARGET_SOFT_FLOAT) ? GP_RETURN : (FP_REG_FIRST + 0)) + +#define MAX_ARGS_IN_REGISTERS (TARGET_OLDABI ? 4 : 8) + +/* Symbolic macros for the first/last argument registers. */ + +#define GP_ARG_FIRST (GP_REG_FIRST + 4) +#define GP_ARG_LAST (GP_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1) +#define FP_ARG_FIRST (FP_REG_FIRST + 12) +#define FP_ARG_LAST (FP_ARG_FIRST + MAX_ARGS_IN_REGISTERS - 1) + +#define LIBCALL_VALUE(MODE) \ + mips_function_value (NULL_TREE, NULL, (MODE)) + +#define FUNCTION_VALUE(VALTYPE, FUNC) \ + mips_function_value ((VALTYPE), (FUNC), VOIDmode) + +/* 1 if N is a possible register number for a function value. + On the MIPS, R2 R3 and F0 F2 are the only register thus used. + Currently, R2 and F0 are only implemented here (C has no complex type) */ + +#define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_RETURN || (N) == FP_RETURN \ + || (LONG_DOUBLE_TYPE_SIZE == 128 && FP_RETURN != GP_RETURN \ + && (N) == FP_RETURN + 2)) + +/* 1 if N is a possible register number for function argument passing. + We have no FP argument registers when soft-float. When FP registers + are 32 bits, we can't directly reference the odd numbered ones. */ + +#define FUNCTION_ARG_REGNO_P(N) \ + ((IN_RANGE((N), GP_ARG_FIRST, GP_ARG_LAST) \ + || (IN_RANGE((N), FP_ARG_FIRST, FP_ARG_LAST))) \ + && !fixed_regs[N]) + +/* This structure has to cope with two different argument allocation + schemes. Most MIPS ABIs view the arguments as a structure, of which + the first N words go in registers and the rest go on the stack. If I + < N, the Ith word might go in Ith integer argument register or in a + floating-point register. For these ABIs, we only need to remember + the offset of the current argument into the structure. + + The EABI instead allocates the integer and floating-point arguments + separately. The first N words of FP arguments go in FP registers, + the rest go on the stack. Likewise, the first N words of the other + arguments go in integer registers, and the rest go on the stack. We + need to maintain three counts: the number of integer registers used, + the number of floating-point registers used, and the number of words + passed on the stack. + + We could keep separate information for the two ABIs (a word count for + the standard ABIs, and three separate counts for the EABI). But it + seems simpler to view the standard ABIs as forms of EABI that do not + allocate floating-point registers. + + So for the standard ABIs, the first N words are allocated to integer + registers, and function_arg decides on an argument-by-argument basis + whether that argument should really go in an integer register, or in + a floating-point one. */ + +typedef struct mips_args { + /* Always true for varargs functions. Otherwise true if at least + one argument has been passed in an integer register. */ + int gp_reg_found; + + /* The number of arguments seen so far. */ + unsigned int arg_number; + + /* The number of integer registers used so far. For all ABIs except + EABI, this is the number of words that have been added to the + argument structure, limited to MAX_ARGS_IN_REGISTERS. */ + unsigned int num_gprs; + + /* For EABI, the number of floating-point registers used so far. */ + unsigned int num_fprs; + + /* The number of words passed on the stack. */ + unsigned int stack_words; + + /* On the mips16, we need to keep track of which floating point + arguments were passed in general registers, but would have been + passed in the FP regs if this were a 32 bit function, so that we + can move them to the FP regs if we wind up calling a 32 bit + function. We record this information in fp_code, encoded in base + four. A zero digit means no floating point argument, a one digit + means an SFmode argument, and a two digit means a DFmode argument, + and a three digit is not used. The low order digit is the first + argument. Thus 6 == 1 * 4 + 2 means a DFmode argument followed by + an SFmode argument. ??? A more sophisticated approach will be + needed if MIPS_ABI != ABI_32. */ + int fp_code; + + /* True if the function has a prototype. */ + int prototype; +} CUMULATIVE_ARGS; + +/* Initialize a variable CUM of type CUMULATIVE_ARGS + for a call to a function whose data type is FNTYPE. + For a library call, FNTYPE is 0. */ + +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ + init_cumulative_args (&CUM, FNTYPE, LIBNAME) \ + +/* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. + (TYPE is null for libcalls where that information may not be available.) */ + +#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ + function_arg_advance (&CUM, MODE, TYPE, NAMED) + +/* Determine where to put an argument to a function. + Value is zero to push the argument on the stack, + or a hard register in which to store the argument. + + MODE is the argument's machine mode. + TYPE is the data type of the argument (as a tree). + This is null for libcalls where that information may + not be available. + CUM is a variable of type CUMULATIVE_ARGS which gives info about + the preceding args and about the function being called. + NAMED is nonzero if this argument is a named parameter + (otherwise it is an extra parameter matching an ellipsis). */ + +#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ + function_arg( &CUM, MODE, TYPE, NAMED) + +#define FUNCTION_ARG_BOUNDARY function_arg_boundary + +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ + (mips_pad_arg_upward (MODE, TYPE) ? upward : downward) + +#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ + (mips_pad_reg_upward (MODE, TYPE) ? upward : downward) + +/* True if using EABI and varargs can be passed in floating-point + registers. Under these conditions, we need a more complex form + of va_list, which tracks GPR, FPR and stack arguments separately. */ +#define EABI_FLOAT_VARARGS_P \ + (mips_abi == ABI_EABI && UNITS_PER_FPVALUE >= UNITS_PER_DOUBLE) + + +/* Say that the epilogue uses the return address register. Note that + in the case of sibcalls, the values "used by the epilogue" are + considered live at the start of the called function. */ +#define EPILOGUE_USES(REGNO) ((REGNO) == 31) + +/* Treat LOC as a byte offset from the stack pointer and round it up + to the next fully-aligned offset. */ +#define MIPS_STACK_ALIGN(LOC) \ + (TARGET_NEWABI ? ((LOC) + 15) & -16 : ((LOC) + 7) & -8) + + +/* Implement `va_start' for varargs and stdarg. */ +#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ + mips_va_start (valist, nextarg) + +/* Output assembler code to FILE to increment profiler label # LABELNO + for profiling a function entry. */ + +#define FUNCTION_PROFILER(FILE, LABELNO) \ +{ \ + if (TARGET_MIPS16) \ + sorry ("mips16 function profiling"); \ + fprintf (FILE, "\t.set\tnoat\n"); \ + fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \ + reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \ + if (!TARGET_NEWABI) \ + { \ + fprintf (FILE, \ + "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n", \ + TARGET_64BIT ? "dsubu" : "subu", \ + reg_names[STACK_POINTER_REGNUM], \ + reg_names[STACK_POINTER_REGNUM], \ + Pmode == DImode ? 16 : 8); \ + } \ + fprintf (FILE, "\tjal\t_mcount\n"); \ + fprintf (FILE, "\t.set\tat\n"); \ +} + +/* No mips port has ever used the profiler counter word, so don't emit it + or the label for it. */ + +#define NO_PROFILE_COUNTERS 1 + +/* Define this macro if the code for function profiling should come + before the function prologue. Normally, the profiling code comes + after. */ + +/* #define PROFILE_BEFORE_PROLOGUE */ + +/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, + the stack pointer does not matter. The value is tested only in + functions that have frame pointers. + No definition is equivalent to always zero. */ + +#define EXIT_IGNORE_STACK 1 + + +/* A C statement to output, on the stream FILE, assembler code for a + block of data that contains the constant parts of a trampoline. + This code should not include a label--the label is taken care of + automatically. */ + +#define TRAMPOLINE_TEMPLATE(STREAM) \ +{ \ + if (ptr_mode == DImode) \ + fprintf (STREAM, "\t.word\t0x03e0082d\t\t# dmove $1,$31\n"); \ + else \ + fprintf (STREAM, "\t.word\t0x03e00821\t\t# move $1,$31\n"); \ + fprintf (STREAM, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n"); \ + fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n"); \ + if (ptr_mode == DImode) \ + { \ + fprintf (STREAM, "\t.word\t0xdfe30014\t\t# ld $3,20($31)\n"); \ + fprintf (STREAM, "\t.word\t0xdfe2001c\t\t# ld $2,28($31)\n"); \ + fprintf (STREAM, "\t.word\t0x0060c82d\t\t# dmove $25,$3\n"); \ + } \ + else \ + { \ + fprintf (STREAM, "\t.word\t0x8fe30014\t\t# lw $3,20($31)\n"); \ + fprintf (STREAM, "\t.word\t0x8fe20018\t\t# lw $2,24($31)\n"); \ + fprintf (STREAM, "\t.word\t0x0060c821\t\t# move $25,$3\n"); \ + } \ + fprintf (STREAM, "\t.word\t0x00600008\t\t# jr $3\n"); \ + if (ptr_mode == DImode) \ + { \ + fprintf (STREAM, "\t.word\t0x0020f82d\t\t# dmove $31,$1\n"); \ + fprintf (STREAM, "\t.dword\t0x00000000\t\t# \n"); \ + fprintf (STREAM, "\t.dword\t0x00000000\t\t# \n"); \ + } \ + else \ + { \ + fprintf (STREAM, "\t.word\t0x0020f821\t\t# move $31,$1\n"); \ + fprintf (STREAM, "\t.word\t0x00000000\t\t# \n"); \ + fprintf (STREAM, "\t.word\t0x00000000\t\t# \n"); \ + } \ +} + +/* A C expression for the size in bytes of the trampoline, as an + integer. */ + +#define TRAMPOLINE_SIZE (32 + GET_MODE_SIZE (ptr_mode) * 2) + +/* Alignment required for trampolines, in bits. */ + +#define TRAMPOLINE_ALIGNMENT GET_MODE_BITSIZE (ptr_mode) + +/* INITIALIZE_TRAMPOLINE calls this library function to flush + program and data caches. */ + +#ifndef CACHE_FLUSH_FUNC +#define CACHE_FLUSH_FUNC "_flush_cache" +#endif + +/* A C statement to initialize the variable parts of a trampoline. + ADDR is an RTX for the address of the trampoline; FNADDR is an + RTX for the address of the nested function; STATIC_CHAIN is an + RTX for the static chain value that should be passed to the + function when it is called. */ + +#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \ +{ \ + rtx func_addr, chain_addr; \ + \ + func_addr = plus_constant (ADDR, 32); \ + chain_addr = plus_constant (func_addr, GET_MODE_SIZE (ptr_mode)); \ + emit_move_insn (gen_rtx_MEM (ptr_mode, func_addr), FUNC); \ + emit_move_insn (gen_rtx_MEM (ptr_mode, chain_addr), CHAIN); \ + \ + /* Flush both caches. We need to flush the data cache in case \ + the system has a write-back cache. */ \ + /* ??? Should check the return value for errors. */ \ + if (mips_cache_flush_func && mips_cache_flush_func[0]) \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \ + 0, VOIDmode, 3, ADDR, Pmode, \ + GEN_INT (TRAMPOLINE_SIZE), TYPE_MODE (integer_type_node),\ + GEN_INT (3), TYPE_MODE (integer_type_node)); \ +} + +/* Addressing modes, and classification of registers for them. */ + +#define REGNO_OK_FOR_INDEX_P(REGNO) 0 +#define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) \ + mips_regno_mode_ok_for_base_p (REGNO, MODE, 1) + +/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx + and check its validity for a certain class. + We have two alternate definitions for each of them. + The usual definition accepts all pseudo regs; the other rejects them all. + The symbol REG_OK_STRICT causes the latter definition to be used. + + Most source files want to accept pseudo regs in the hope that + they will get allocated to the class that the insn wants them to be in. + Some source files that are used after register allocation + need to be strict. */ + +#ifndef REG_OK_STRICT +#define REG_MODE_OK_FOR_BASE_P(X, MODE) \ + mips_regno_mode_ok_for_base_p (REGNO (X), MODE, 0) +#else +#define REG_MODE_OK_FOR_BASE_P(X, MODE) \ + mips_regno_mode_ok_for_base_p (REGNO (X), MODE, 1) +#endif + +#define REG_OK_FOR_INDEX_P(X) 0 + + +/* Maximum number of registers that can appear in a valid memory address. */ + +#define MAX_REGS_PER_ADDRESS 1 + +#ifdef REG_OK_STRICT +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ +{ \ + if (mips_legitimate_address_p (MODE, X, 1)) \ + goto ADDR; \ +} +#else +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ +{ \ + if (mips_legitimate_address_p (MODE, X, 0)) \ + goto ADDR; \ +} +#endif + +/* Check for constness inline but use mips_legitimate_address_p + to check whether a constant really is an address. */ + +#define CONSTANT_ADDRESS_P(X) \ + (CONSTANT_P (X) && mips_legitimate_address_p (SImode, X, 0)) + +#define LEGITIMATE_CONSTANT_P(X) (mips_const_insns (X) > 0) + +#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ + do { \ + if (mips_legitimize_address (&(X), MODE)) \ + goto WIN; \ + } while (0) + + +/* A C statement or compound statement with a conditional `goto + LABEL;' executed if memory address X (an RTX) can have different + meanings depending on the machine mode of the memory reference it + is used for. + + Autoincrement and autodecrement addresses typically have + mode-dependent effects because the amount of the increment or + decrement is the size of the operand being addressed. Some + machines have other mode-dependent addresses. Many RISC machines + have no mode-dependent addresses. + + You may assume that ADDR is a valid address for the machine. */ + +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {} + +/* This handles the magic '..CURRENT_FUNCTION' symbol, which means + 'the start of the function that this code is output in'. */ + +#define ASM_OUTPUT_LABELREF(FILE,NAME) \ + if (strcmp (NAME, "..CURRENT_FUNCTION") == 0) \ + asm_fprintf ((FILE), "%U%s", \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + else \ + asm_fprintf ((FILE), "%U%s", (NAME)) + +/* Flag to mark a function decl symbol that requires a long call. */ +#define SYMBOL_FLAG_LONG_CALL (SYMBOL_FLAG_MACH_DEP << 0) +#define SYMBOL_REF_LONG_CALL_P(X) \ + ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_LONG_CALL) != 0) + +/* Specify the machine mode that this machine uses + for the index in the tablejump instruction. + ??? Using HImode in mips16 mode can cause overflow. */ +#define CASE_VECTOR_MODE \ + (TARGET_MIPS16 ? HImode : ptr_mode) + +/* Define as C expression which evaluates to nonzero if the tablejump + instruction expects the table to contain offsets from the address of the + table. + Do not define this if the table should contain absolute addresses. */ +#define CASE_VECTOR_PC_RELATIVE (TARGET_MIPS16) + +/* Define this as 1 if `char' should by default be signed; else as 0. */ +#ifndef DEFAULT_SIGNED_CHAR +#define DEFAULT_SIGNED_CHAR 1 +#endif + +/* Max number of bytes we can move from memory to memory + in one reasonably fast instruction. */ +#define MOVE_MAX (TARGET_64BIT ? 8 : 4) +#define MAX_MOVE_MAX 8 + +/* Define this macro as a C expression which is nonzero if + accessing less than a word of memory (i.e. a `char' or a + `short') is no faster than accessing a word of memory, i.e., if + such access require more than one instruction or if there is no + difference in cost between byte and (aligned) word loads. + + On RISC machines, it tends to generate better code to define + this as 1, since it avoids making a QI or HI mode register. */ +#define SLOW_BYTE_ACCESS 1 + +/* Define this to be nonzero if shift instructions ignore all but the low-order + few bits. */ +#define SHIFT_COUNT_TRUNCATED 1 + +/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits + is done just by pretending it is already truncated. */ +#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) \ + (TARGET_64BIT ? ((INPREC) <= 32 || (OUTPREC) > 32) : 1) + + +/* Specify the machine mode that pointers have. + After generation of rtl, the compiler makes no further distinction + between pointers and any other objects of this machine mode. */ + +#ifndef Pmode +#define Pmode (TARGET_64BIT && TARGET_LONG64 ? DImode : SImode) +#endif + +/* Give call MEMs SImode since it is the "most permissive" mode + for both 32-bit and 64-bit targets. */ + +#define FUNCTION_MODE SImode + + +/* The cost of loading values from the constant pool. It should be + larger than the cost of any constant we want to synthesize in-line. */ + +#define CONSTANT_POOL_COST COSTS_N_INSNS (8) + +/* A C expression for the cost of moving data from a register in + class FROM to one in class TO. The classes are expressed using + the enumeration values such as `GENERAL_REGS'. A value of 2 is + the default; other values are interpreted relative to that. + + It is not required that the cost always equal 2 when FROM is the + same as TO; on some machines it is expensive to move between + registers if they are not general registers. + + If reload sees an insn consisting of a single `set' between two + hard registers, and if `REGISTER_MOVE_COST' applied to their + classes returns a value of 2, reload does not check to ensure + that the constraints of the insn are met. Setting a cost of + other than 2 will allow reload to verify that the constraints are + met. You should do this if the `movM' pattern's constraints do + not allow such copying. */ + +#define REGISTER_MOVE_COST(MODE, FROM, TO) \ + mips_register_move_cost (MODE, FROM, TO) + +#define MEMORY_MOVE_COST(MODE,CLASS,TO_P) \ + (mips_cost->memory_latency \ + + memory_move_secondary_cost ((MODE), (CLASS), (TO_P))) + +/* Define if copies to/from condition code registers should be avoided. + + This is needed for the MIPS because reload_outcc is not complete; + it needs to handle cases where the source is a general or another + condition code register. */ +#define AVOID_CCMODE_COPIES + +/* A C expression for the cost of a branch instruction. A value of + 1 is the default; other values are interpreted relative to that. */ + +#define BRANCH_COST mips_cost->branch_cost +#define LOGICAL_OP_NON_SHORT_CIRCUIT 0 + +/* If defined, modifies the length assigned to instruction INSN as a + function of the context in which it is used. LENGTH is an lvalue + that contains the initially computed length of the insn and should + be updated with the correct length of the insn. */ +#define ADJUST_INSN_LENGTH(INSN, LENGTH) \ + ((LENGTH) = mips_adjust_insn_length ((INSN), (LENGTH))) + +/* Return the asm template for a non-MIPS16 conditional branch instruction. + OPCODE is the opcode's mnemonic and OPERANDS is the asm template for + its operands. */ +#define MIPS_BRANCH(OPCODE, OPERANDS) \ + "%*" OPCODE "%?\t" OPERANDS "%/" + +/* Return the asm template for a call. INSN is the instruction's mnemonic + ("j" or "jal"), OPERANDS are its operands, and OPNO is the operand number + of the target. + + When generating -mabicalls without explicit relocation operators, + all calls should use assembly macros. Otherwise, all indirect + calls should use "jr" or "jalr"; we will arrange to restore $gp + afterwards if necessary. Finally, we can only generate direct + calls for -mabicalls by temporarily switching to non-PIC mode. */ +#define MIPS_CALL(INSN, OPERANDS, OPNO) \ + (TARGET_ABICALLS && !TARGET_EXPLICIT_RELOCS \ + ? "%*" INSN "\t%" #OPNO "%/" \ + : REG_P (OPERANDS[OPNO]) \ + ? "%*" INSN "r\t%" #OPNO "%/" \ + : TARGET_ABICALLS \ + ? (".option\tpic0\n\t" \ + "%*" INSN "\t%" #OPNO "%/\n\t" \ + ".option\tpic2") \ + : "%*" INSN "\t%" #OPNO "%/") + +/* Control the assembler format that we output. */ + +/* Output to assembler file text saying following lines + may contain character constants, extra white space, comments, etc. */ + +#ifndef ASM_APP_ON +#define ASM_APP_ON " #APP\n" +#endif + +/* Output to assembler file text saying following lines + no longer contain unusual constructs. */ + +#ifndef ASM_APP_OFF +#define ASM_APP_OFF " #NO_APP\n" +#endif + +#define REGISTER_NAMES \ +{ "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", \ + "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", \ + "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", \ + "$24", "$25", "$26", "$27", "$28", "$sp", "$fp", "$31", \ + "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", \ + "$f8", "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15", \ + "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23", \ + "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31", \ + "hi", "lo", "", "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4", \ + "$fcc5","$fcc6","$fcc7","", "", "$arg", "$frame", "$fakec", \ + "$c0r0", "$c0r1", "$c0r2", "$c0r3", "$c0r4", "$c0r5", "$c0r6", "$c0r7", \ + "$c0r8", "$c0r9", "$c0r10","$c0r11","$c0r12","$c0r13","$c0r14","$c0r15", \ + "$c0r16","$c0r17","$c0r18","$c0r19","$c0r20","$c0r21","$c0r22","$c0r23", \ + "$c0r24","$c0r25","$c0r26","$c0r27","$c0r28","$c0r29","$c0r30","$c0r31", \ + "$c2r0", "$c2r1", "$c2r2", "$c2r3", "$c2r4", "$c2r5", "$c2r6", "$c2r7", \ + "$c2r8", "$c2r9", "$c2r10","$c2r11","$c2r12","$c2r13","$c2r14","$c2r15", \ + "$c2r16","$c2r17","$c2r18","$c2r19","$c2r20","$c2r21","$c2r22","$c2r23", \ + "$c2r24","$c2r25","$c2r26","$c2r27","$c2r28","$c2r29","$c2r30","$c2r31", \ + "$c3r0", "$c3r1", "$c3r2", "$c3r3", "$c3r4", "$c3r5", "$c3r6", "$c3r7", \ + "$c3r8", "$c3r9", "$c3r10","$c3r11","$c3r12","$c3r13","$c3r14","$c3r15", \ + "$c3r16","$c3r17","$c3r18","$c3r19","$c3r20","$c3r21","$c3r22","$c3r23", \ + "$c3r24","$c3r25","$c3r26","$c3r27","$c3r28","$c3r29","$c3r30","$c3r31", \ + "$ac1hi","$ac1lo","$ac2hi","$ac2lo","$ac3hi","$ac3lo","$dsp_po","$dsp_sc", \ + "$dsp_ca","$dsp_ou","$dsp_cc","$dsp_ef" } + +/* List the "software" names for each register. Also list the numerical + names for $fp and $sp. */ + +#define ADDITIONAL_REGISTER_NAMES \ +{ \ + { "$29", 29 + GP_REG_FIRST }, \ + { "$30", 30 + GP_REG_FIRST }, \ + { "at", 1 + GP_REG_FIRST }, \ + { "v0", 2 + GP_REG_FIRST }, \ + { "v1", 3 + GP_REG_FIRST }, \ + { "a0", 4 + GP_REG_FIRST }, \ + { "a1", 5 + GP_REG_FIRST }, \ + { "a2", 6 + GP_REG_FIRST }, \ + { "a3", 7 + GP_REG_FIRST }, \ + { "t0", 8 + GP_REG_FIRST }, \ + { "t1", 9 + GP_REG_FIRST }, \ + { "t2", 10 + GP_REG_FIRST }, \ + { "t3", 11 + GP_REG_FIRST }, \ + { "t4", 12 + GP_REG_FIRST }, \ + { "t5", 13 + GP_REG_FIRST }, \ + { "t6", 14 + GP_REG_FIRST }, \ + { "t7", 15 + GP_REG_FIRST }, \ + { "s0", 16 + GP_REG_FIRST }, \ + { "s1", 17 + GP_REG_FIRST }, \ + { "s2", 18 + GP_REG_FIRST }, \ + { "s3", 19 + GP_REG_FIRST }, \ + { "s4", 20 + GP_REG_FIRST }, \ + { "s5", 21 + GP_REG_FIRST }, \ + { "s6", 22 + GP_REG_FIRST }, \ + { "s7", 23 + GP_REG_FIRST }, \ + { "t8", 24 + GP_REG_FIRST }, \ + { "t9", 25 + GP_REG_FIRST }, \ + { "k0", 26 + GP_REG_FIRST }, \ + { "k1", 27 + GP_REG_FIRST }, \ + { "gp", 28 + GP_REG_FIRST }, \ + { "sp", 29 + GP_REG_FIRST }, \ + { "fp", 30 + GP_REG_FIRST }, \ + { "ra", 31 + GP_REG_FIRST }, \ + ALL_COP_ADDITIONAL_REGISTER_NAMES \ +} + +/* This is meant to be redefined in the host dependent files. It is a + set of alternative names and regnums for mips coprocessors. */ + +#define ALL_COP_ADDITIONAL_REGISTER_NAMES + +/* A C compound statement to output to stdio stream STREAM the + assembler syntax for an instruction operand X. X is an RTL + expression. + + CODE is a value that can be used to specify one of several ways + of printing the operand. It is used when identical operands + must be printed differently depending on the context. CODE + comes from the `%' specification that was used to request + printing of the operand. If the specification was just `%DIGIT' + then CODE is 0; if the specification was `%LTR DIGIT' then CODE + is the ASCII code for LTR. + + If X is a register, this macro should print the register's name. + The names can be found in an array `reg_names' whose type is + `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'. + + When the machine description has a specification `%PUNCT' (a `%' + followed by a punctuation character), this macro is called with + a null pointer for X and the punctuation character for CODE. + + See mips.c for the MIPS specific codes. */ + +#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) + +/* A C expression which evaluates to true if CODE is a valid + punctuation character for use in the `PRINT_OPERAND' macro. If + `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no + punctuation characters (except for the standard one, `%') are + used in this way. */ + +#define PRINT_OPERAND_PUNCT_VALID_P(CODE) mips_print_operand_punct[CODE] + +/* A C compound statement to output to stdio stream STREAM the + assembler syntax for an instruction operand that is a memory + reference whose address is ADDR. ADDR is an RTL expression. */ + +#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) + + +/* A C statement, to be executed after all slot-filler instructions + have been output. If necessary, call `dbr_sequence_length' to + determine the number of slots filled in a sequence (zero if not + currently outputting a sequence), to decide how many no-ops to + output, or whatever. + + Don't define this macro if it has nothing to do, but it is + helpful in reading assembly output if the extent of the delay + sequence is made explicit (e.g. with white space). + + Note that output routines for instructions with delay slots must + be prepared to deal with not being output as part of a sequence + (i.e. when the scheduling pass is not run, or when no slot + fillers could be found.) The variable `final_sequence' is null + when not processing a sequence, otherwise it contains the + `sequence' rtx being output. */ + +#define DBR_OUTPUT_SEQEND(STREAM) \ +do \ + { \ + if (set_nomacro > 0 && --set_nomacro == 0) \ + fputs ("\t.set\tmacro\n", STREAM); \ + \ + if (set_noreorder > 0 && --set_noreorder == 0) \ + fputs ("\t.set\treorder\n", STREAM); \ + \ + fputs ("\n", STREAM); \ + } \ +while (0) + + +/* How to tell the debugger about changes of source files. */ +#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \ + mips_output_filename (STREAM, NAME) + +/* mips-tfile does not understand .stabd directives. */ +#define DBX_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) do { \ + dbxout_begin_stabn_sline (LINE); \ + dbxout_stab_value_internal_label ("LM", &COUNTER); \ +} while (0) + +/* Use .loc directives for SDB line numbers. */ +#define SDB_OUTPUT_SOURCE_LINE(STREAM, LINE) \ + fprintf (STREAM, "\t.loc\t%d %d\n", num_source_filenames, LINE) + +/* The MIPS implementation uses some labels for its own purpose. The + following lists what labels are created, and are all formed by the + pattern $L[a-z].*. The machine independent portion of GCC creates + labels matching: $L[A-Z][0-9]+ and $L[0-9]+. + + LM[0-9]+ Silicon Graphics/ECOFF stabs label before each stmt. + $Lb[0-9]+ Begin blocks for MIPS debug support + $Lc[0-9]+ Label for use in s operation. + $Le[0-9]+ End blocks for MIPS debug support */ + +#undef ASM_DECLARE_OBJECT_NAME +#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ + mips_declare_object (STREAM, NAME, "", ":\n", 0) + +/* Globalizing directive for a label. */ +#define GLOBAL_ASM_OP "\t.globl\t" + +/* This says how to define a global common symbol. */ + +#define ASM_OUTPUT_ALIGNED_DECL_COMMON mips_output_aligned_decl_common + +/* This says how to define a local common symbol (i.e., not visible to + linker). */ + +#ifndef ASM_OUTPUT_ALIGNED_LOCAL +#define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \ + mips_declare_common_object (STREAM, NAME, "\n\t.lcomm\t", SIZE, ALIGN, false) +#endif + +/* This says how to output an external. It would be possible not to + output anything and let undefined symbol become external. However + the assembler uses length information on externals to allocate in + data/sdata bss/sbss, thereby saving exec time. */ + +#define ASM_OUTPUT_EXTERNAL(STREAM,DECL,NAME) \ + mips_output_external(STREAM,DECL,NAME) + +/* This is how to declare a function name. The actual work of + emitting the label is moved to function_prologue, so that we can + get the line number correctly emitted before the .ent directive, + and after any .file directives. Define as empty so that the function + is not declared before the .ent directive elsewhere. */ + +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) + +#ifndef FUNCTION_NAME_ALREADY_DECLARED +#define FUNCTION_NAME_ALREADY_DECLARED 0 +#endif + +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM)) + +/* This is how to output an element of a case-vector that is absolute. */ + +#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ + fprintf (STREAM, "\t%s\t%sL%d\n", \ + ptr_mode == DImode ? ".dword" : ".word", \ + LOCAL_LABEL_PREFIX, \ + VALUE) + +/* This is how to output an element of a case-vector. We can make the + entries PC-relative in MIPS16 code and GP-relative when .gp(d)word + is supported. */ + +#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ +do { \ + if (TARGET_MIPS16) \ + fprintf (STREAM, "\t.half\t%sL%d-%sL%d\n", \ + LOCAL_LABEL_PREFIX, VALUE, LOCAL_LABEL_PREFIX, REL); \ + else if (TARGET_GPWORD) \ + fprintf (STREAM, "\t%s\t%sL%d\n", \ + ptr_mode == DImode ? ".gpdword" : ".gpword", \ + LOCAL_LABEL_PREFIX, VALUE); \ + else \ + fprintf (STREAM, "\t%s\t%sL%d\n", \ + ptr_mode == DImode ? ".dword" : ".word", \ + LOCAL_LABEL_PREFIX, VALUE); \ +} while (0) + +/* When generating MIPS16 code, we want the jump table to be in the text + section so that we can load its address using a PC-relative addition. */ +#define JUMP_TABLES_IN_TEXT_SECTION TARGET_MIPS16 + +/* This is how to output an assembler line + that says to advance the location counter + to a multiple of 2**LOG bytes. */ + +#define ASM_OUTPUT_ALIGN(STREAM,LOG) \ + fprintf (STREAM, "\t.align\t%d\n", (LOG)) + +/* This is how to output an assembler line to advance the location + counter by SIZE bytes. */ + +#undef ASM_OUTPUT_SKIP +#define ASM_OUTPUT_SKIP(STREAM,SIZE) \ + fprintf (STREAM, "\t.space\t"HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE)) + +/* This is how to output a string. */ +#undef ASM_OUTPUT_ASCII +#define ASM_OUTPUT_ASCII(STREAM, STRING, LEN) \ + mips_output_ascii (STREAM, STRING, LEN, "\t.ascii\t") + +/* Output #ident as a in the read-only data section. */ +#undef ASM_OUTPUT_IDENT +#define ASM_OUTPUT_IDENT(FILE, STRING) \ +{ \ + const char *p = STRING; \ + int size = strlen (p) + 1; \ + switch_to_section (readonly_data_section); \ + assemble_string (p, size); \ +} + +/* Default to -G 8 */ +#ifndef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 8 +#endif + +/* Define the strings to put out for each section in the object file. */ +#define TEXT_SECTION_ASM_OP "\t.text" /* instructions */ +#define DATA_SECTION_ASM_OP "\t.data" /* large data */ + +#undef READONLY_DATA_SECTION_ASM_OP +#define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */ + +#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO) \ +do \ + { \ + fprintf (STREAM, "\t%s\t%s,%s,8\n\t%s\t%s,0(%s)\n", \ + TARGET_64BIT ? "dsubu" : "subu", \ + reg_names[STACK_POINTER_REGNUM], \ + reg_names[STACK_POINTER_REGNUM], \ + TARGET_64BIT ? "sd" : "sw", \ + reg_names[REGNO], \ + reg_names[STACK_POINTER_REGNUM]); \ + } \ +while (0) + +#define ASM_OUTPUT_REG_POP(STREAM,REGNO) \ +do \ + { \ + if (! set_noreorder) \ + fprintf (STREAM, "\t.set\tnoreorder\n"); \ + \ + fprintf (STREAM, "\t%s\t%s,0(%s)\n\t%s\t%s,%s,8\n", \ + TARGET_64BIT ? "ld" : "lw", \ + reg_names[REGNO], \ + reg_names[STACK_POINTER_REGNUM], \ + TARGET_64BIT ? "daddu" : "addu", \ + reg_names[STACK_POINTER_REGNUM], \ + reg_names[STACK_POINTER_REGNUM]); \ + \ + if (! set_noreorder) \ + fprintf (STREAM, "\t.set\treorder\n"); \ + } \ +while (0) + +/* How to start an assembler comment. + The leading space is important (the mips native assembler requires it). */ +#ifndef ASM_COMMENT_START +#define ASM_COMMENT_START " #" +#endif + +/* Default definitions for size_t and ptrdiff_t. We must override the + definitions from ../svr4.h on mips-*-linux-gnu. */ + +#undef SIZE_TYPE +#define SIZE_TYPE (POINTER_SIZE == 64 ? "long unsigned int" : "unsigned int") + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (POINTER_SIZE == 64 ? "long int" : "int") + +#ifndef __mips16 +/* Since the bits of the _init and _fini function is spread across + many object files, each potentially with its own GP, we must assume + we need to load our GP. We don't preserve $gp or $ra, since each + init/fini chunk is supposed to initialize $gp, and crti/crtn + already take care of preserving $ra and, when appropriate, $gp. */ +#if (defined _ABIO32 && _MIPS_SIM == _ABIO32) +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\ + .set noreorder\n\ + bal 1f\n\ + nop\n\ +1: .cpload $31\n\ + .set reorder\n\ + jal " USER_LABEL_PREFIX #FUNC "\n\ + " TEXT_SECTION_ASM_OP); +#endif /* Switch to #elif when we're no longer limited by K&R C. */ +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) \ + || (defined _ABI64 && _MIPS_SIM == _ABI64) +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\ + .set noreorder\n\ + bal 1f\n\ + nop\n\ +1: .set reorder\n\ + .cpsetup $31, $2, 1b\n\ + jal " USER_LABEL_PREFIX #FUNC "\n\ + " TEXT_SECTION_ASM_OP); +#endif +#endif + +#ifndef HAVE_AS_TLS +#define HAVE_AS_TLS 0 +#endif diff --git a/contrib/gcc/config/mips/mips.md b/contrib/gcc/config/mips/mips.md new file mode 100644 index 00000000000..969d22fa00f --- /dev/null +++ b/contrib/gcc/config/mips/mips.md @@ -0,0 +1,5485 @@ +;; Mips.md Machine Description for MIPS based processors +;; Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Contributed by A. Lichnewsky, lich@inria.inria.fr +;; Changes by Michael Meissner, meissner@osf.org +;; 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and +;; Brendan Eich, brendan@microunity.com. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_constants + [(UNSPEC_LOAD_DF_LOW 0) + (UNSPEC_LOAD_DF_HIGH 1) + (UNSPEC_STORE_DF_HIGH 2) + (UNSPEC_GET_FNADDR 3) + (UNSPEC_BLOCKAGE 4) + (UNSPEC_CPRESTORE 5) + (UNSPEC_EH_RECEIVER 6) + (UNSPEC_EH_RETURN 7) + (UNSPEC_CONSTTABLE_INT 8) + (UNSPEC_CONSTTABLE_FLOAT 9) + (UNSPEC_ALIGN 14) + (UNSPEC_HIGH 17) + (UNSPEC_LOAD_LEFT 18) + (UNSPEC_LOAD_RIGHT 19) + (UNSPEC_STORE_LEFT 20) + (UNSPEC_STORE_RIGHT 21) + (UNSPEC_LOADGP 22) + (UNSPEC_LOAD_CALL 23) + (UNSPEC_LOAD_GOT 24) + (UNSPEC_GP 25) + (UNSPEC_MFHILO 26) + (UNSPEC_TLS_LDM 27) + (UNSPEC_TLS_GET_TP 28) + + (UNSPEC_ADDRESS_FIRST 100) + + (FAKE_CALL_REGNO 79) + + ;; For MIPS Paired-Singled Floating Point Instructions. + + (UNSPEC_MOVE_TF_PS 200) + (UNSPEC_C 201) + + ;; MIPS64/MIPS32R2 alnv.ps + (UNSPEC_ALNV_PS 202) + + ;; MIPS-3D instructions + (UNSPEC_CABS 203) + + (UNSPEC_ADDR_PS 204) + (UNSPEC_CVT_PW_PS 205) + (UNSPEC_CVT_PS_PW 206) + (UNSPEC_MULR_PS 207) + (UNSPEC_ABS_PS 208) + + (UNSPEC_RSQRT1 209) + (UNSPEC_RSQRT2 210) + (UNSPEC_RECIP1 211) + (UNSPEC_RECIP2 212) + (UNSPEC_SINGLE_CC 213) + (UNSPEC_SCC 214) + + ;; MIPS DSP ASE Revision 0.98 3/24/2005 + (UNSPEC_ADDQ 300) + (UNSPEC_ADDQ_S 301) + (UNSPEC_SUBQ 302) + (UNSPEC_SUBQ_S 303) + (UNSPEC_ADDSC 304) + (UNSPEC_ADDWC 305) + (UNSPEC_MODSUB 306) + (UNSPEC_RADDU_W_QB 307) + (UNSPEC_ABSQ_S 308) + (UNSPEC_PRECRQ_QB_PH 309) + (UNSPEC_PRECRQ_PH_W 310) + (UNSPEC_PRECRQ_RS_PH_W 311) + (UNSPEC_PRECRQU_S_QB_PH 312) + (UNSPEC_PRECEQ_W_PHL 313) + (UNSPEC_PRECEQ_W_PHR 314) + (UNSPEC_PRECEQU_PH_QBL 315) + (UNSPEC_PRECEQU_PH_QBR 316) + (UNSPEC_PRECEQU_PH_QBLA 317) + (UNSPEC_PRECEQU_PH_QBRA 318) + (UNSPEC_PRECEU_PH_QBL 319) + (UNSPEC_PRECEU_PH_QBR 320) + (UNSPEC_PRECEU_PH_QBLA 321) + (UNSPEC_PRECEU_PH_QBRA 322) + (UNSPEC_SHLL 323) + (UNSPEC_SHLL_S 324) + (UNSPEC_SHRL_QB 325) + (UNSPEC_SHRA_PH 326) + (UNSPEC_SHRA_R 327) + (UNSPEC_MULEU_S_PH_QBL 328) + (UNSPEC_MULEU_S_PH_QBR 329) + (UNSPEC_MULQ_RS_PH 330) + (UNSPEC_MULEQ_S_W_PHL 331) + (UNSPEC_MULEQ_S_W_PHR 332) + (UNSPEC_DPAU_H_QBL 333) + (UNSPEC_DPAU_H_QBR 334) + (UNSPEC_DPSU_H_QBL 335) + (UNSPEC_DPSU_H_QBR 336) + (UNSPEC_DPAQ_S_W_PH 337) + (UNSPEC_DPSQ_S_W_PH 338) + (UNSPEC_MULSAQ_S_W_PH 339) + (UNSPEC_DPAQ_SA_L_W 340) + (UNSPEC_DPSQ_SA_L_W 341) + (UNSPEC_MAQ_S_W_PHL 342) + (UNSPEC_MAQ_S_W_PHR 343) + (UNSPEC_MAQ_SA_W_PHL 344) + (UNSPEC_MAQ_SA_W_PHR 345) + (UNSPEC_BITREV 346) + (UNSPEC_INSV 347) + (UNSPEC_REPL_QB 348) + (UNSPEC_REPL_PH 349) + (UNSPEC_CMP_EQ 350) + (UNSPEC_CMP_LT 351) + (UNSPEC_CMP_LE 352) + (UNSPEC_CMPGU_EQ_QB 353) + (UNSPEC_CMPGU_LT_QB 354) + (UNSPEC_CMPGU_LE_QB 355) + (UNSPEC_PICK 356) + (UNSPEC_PACKRL_PH 357) + (UNSPEC_EXTR_W 358) + (UNSPEC_EXTR_R_W 359) + (UNSPEC_EXTR_RS_W 360) + (UNSPEC_EXTR_S_H 361) + (UNSPEC_EXTP 362) + (UNSPEC_EXTPDP 363) + (UNSPEC_SHILO 364) + (UNSPEC_MTHLIP 365) + (UNSPEC_WRDSP 366) + (UNSPEC_RDDSP 367) + ] +) + +(include "predicates.md") +(include "constraints.md") + +;; .................... +;; +;; Attributes +;; +;; .................... + +(define_attr "got" "unset,xgot_high,load" + (const_string "unset")) + +;; For jal instructions, this attribute is DIRECT when the target address +;; is symbolic and INDIRECT when it is a register. +(define_attr "jal" "unset,direct,indirect" + (const_string "unset")) + +;; This attribute is YES if the instruction is a jal macro (not a +;; real jal instruction). +;; +;; jal is always a macro for o32 and o64 abicalls because it includes an +;; instruction to restore $gp. Direct jals are also macros for -mshared +;; abicalls because they first load the target address into $25. +(define_attr "jal_macro" "no,yes" + (cond [(eq_attr "jal" "direct") + (symbol_ref "TARGET_ABICALLS + && (TARGET_OLDABI || !TARGET_ABSOLUTE_ABICALLS)") + (eq_attr "jal" "indirect") + (symbol_ref "TARGET_ABICALLS && TARGET_OLDABI")] + (const_string "no"))) + +;; Classification of each insn. +;; branch conditional branch +;; jump unconditional jump +;; call unconditional call +;; load load instruction(s) +;; fpload floating point load +;; fpidxload floating point indexed load +;; store store instruction(s) +;; fpstore floating point store +;; fpidxstore floating point indexed store +;; prefetch memory prefetch (register + offset) +;; prefetchx memory indexed prefetch (register + register) +;; condmove conditional moves +;; xfer transfer to/from coprocessor +;; mthilo transfer to hi/lo registers +;; mfhilo transfer from hi/lo registers +;; const load constant +;; arith integer arithmetic and logical instructions +;; shift integer shift instructions +;; slt set less than instructions +;; clz the clz and clo instructions +;; trap trap if instructions +;; imul integer multiply 2 operands +;; imul3 integer multiply 3 operands +;; imadd integer multiply-add +;; idiv integer divide +;; fmove floating point register move +;; fadd floating point add/subtract +;; fmul floating point multiply +;; fmadd floating point multiply-add +;; fdiv floating point divide +;; frdiv floating point reciprocal divide +;; frdiv1 floating point reciprocal divide step 1 +;; frdiv2 floating point reciprocal divide step 2 +;; fabs floating point absolute value +;; fneg floating point negation +;; fcmp floating point compare +;; fcvt floating point convert +;; fsqrt floating point square root +;; frsqrt floating point reciprocal square root +;; frsqrt1 floating point reciprocal square root step1 +;; frsqrt2 floating point reciprocal square root step2 +;; multi multiword sequence (or user asm statements) +;; nop no operation +(define_attr "type" + "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,xfer,mthilo,mfhilo,const,arith,shift,slt,clz,trap,imul,imul3,imadd,idiv,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop" + (cond [(eq_attr "jal" "!unset") (const_string "call") + (eq_attr "got" "load") (const_string "load")] + (const_string "unknown"))) + +;; Main data type used by the insn +(define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW" + (const_string "unknown")) + +;; Mode for conversion types (fcvt) +;; I2S integer to float single (SI/DI to SF) +;; I2D integer to float double (SI/DI to DF) +;; S2I float to integer (SF to SI/DI) +;; D2I float to integer (DF to SI/DI) +;; D2S double to float single +;; S2D float single to double + +(define_attr "cnv_mode" "unknown,I2S,I2D,S2I,D2I,D2S,S2D" + (const_string "unknown")) + +;; Is this an extended instruction in mips16 mode? +(define_attr "extended_mips16" "no,yes" + (const_string "no")) + +;; Length of instruction in bytes. +(define_attr "length" "" + (cond [;; Direct branch instructions have a range of [-0x40000,0x3fffc]. + ;; If a branch is outside this range, we have a choice of two + ;; sequences. For PIC, an out-of-range branch like: + ;; + ;; bne r1,r2,target + ;; dslot + ;; + ;; becomes the equivalent of: + ;; + ;; beq r1,r2,1f + ;; dslot + ;; la $at,target + ;; jr $at + ;; nop + ;; 1: + ;; + ;; where the load address can be up to three instructions long + ;; (lw, nop, addiu). + ;; + ;; The non-PIC case is similar except that we use a direct + ;; jump instead of an la/jr pair. Since the target of this + ;; jump is an absolute 28-bit bit address (the other bits + ;; coming from the address of the delay slot) this form cannot + ;; cross a 256MB boundary. We could provide the option of + ;; using la/jr in this case too, but we do not do so at + ;; present. + ;; + ;; Note that this value does not account for the delay slot + ;; instruction, whose length is added separately. If the RTL + ;; pattern has no explicit delay slot, mips_adjust_insn_length + ;; will add the length of the implicit nop. The values for + ;; forward and backward branches will be different as well. + (eq_attr "type" "branch") + (cond [(and (le (minus (match_dup 1) (pc)) (const_int 131064)) + (le (minus (pc) (match_dup 1)) (const_int 131068))) + (const_int 4) + (ne (symbol_ref "flag_pic") (const_int 0)) + (const_int 24) + ] (const_int 12)) + + (eq_attr "got" "load") + (const_int 4) + (eq_attr "got" "xgot_high") + (const_int 8) + + (eq_attr "type" "const") + (symbol_ref "mips_const_insns (operands[1]) * 4") + (eq_attr "type" "load,fpload") + (symbol_ref "mips_fetch_insns (operands[1]) * 4") + (eq_attr "type" "store,fpstore") + (symbol_ref "mips_fetch_insns (operands[0]) * 4") + + ;; In the worst case, a call macro will take 8 instructions: + ;; + ;; lui $25,%call_hi(FOO) + ;; addu $25,$25,$28 + ;; lw $25,%call_lo(FOO)($25) + ;; nop + ;; jalr $25 + ;; nop + ;; lw $gp,X($sp) + ;; nop + (eq_attr "jal_macro" "yes") + (const_int 32) + + (and (eq_attr "extended_mips16" "yes") + (ne (symbol_ref "TARGET_MIPS16") (const_int 0))) + (const_int 8) + + ;; Various VR4120 errata require a nop to be inserted after a macc + ;; instruction. The assembler does this for us, so account for + ;; the worst-case length here. + (and (eq_attr "type" "imadd") + (ne (symbol_ref "TARGET_FIX_VR4120") (const_int 0))) + (const_int 8) + + ;; VR4120 errata MD(4): if there are consecutive dmult instructions, + ;; the result of the second one is missed. The assembler should work + ;; around this by inserting a nop after the first dmult. + (and (eq_attr "type" "imul,imul3") + (and (eq_attr "mode" "DI") + (ne (symbol_ref "TARGET_FIX_VR4120") (const_int 0)))) + (const_int 8) + + (eq_attr "type" "idiv") + (symbol_ref "mips_idiv_insns () * 4") + ] (const_int 4))) + +;; Attribute describing the processor. This attribute must match exactly +;; with the processor_type enumeration in mips.h. +(define_attr "cpu" + "r3000,4kc,4kp,5kc,5kf,20kc,24k,24kx,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sb1a,sr71000" + (const (symbol_ref "mips_tune"))) + +;; The type of hardware hazard associated with this instruction. +;; DELAY means that the next instruction cannot read the result +;; of this one. HILO means that the next two instructions cannot +;; write to HI or LO. +(define_attr "hazard" "none,delay,hilo" + (cond [(and (eq_attr "type" "load,fpload,fpidxload") + (ne (symbol_ref "ISA_HAS_LOAD_DELAY") (const_int 0))) + (const_string "delay") + + (and (eq_attr "type" "xfer") + (ne (symbol_ref "ISA_HAS_XFER_DELAY") (const_int 0))) + (const_string "delay") + + (and (eq_attr "type" "fcmp") + (ne (symbol_ref "ISA_HAS_FCMP_DELAY") (const_int 0))) + (const_string "delay") + + ;; The r4000 multiplication patterns include an mflo instruction. + (and (eq_attr "type" "imul") + (ne (symbol_ref "TARGET_FIX_R4000") (const_int 0))) + (const_string "hilo") + + (and (eq_attr "type" "mfhilo") + (eq (symbol_ref "ISA_HAS_HILO_INTERLOCKS") (const_int 0))) + (const_string "hilo")] + (const_string "none"))) + +;; Is it a single instruction? +(define_attr "single_insn" "no,yes" + (symbol_ref "get_attr_length (insn) == (TARGET_MIPS16 ? 2 : 4)")) + +;; Can the instruction be put into a delay slot? +(define_attr "can_delay" "no,yes" + (if_then_else (and (eq_attr "type" "!branch,call,jump") + (and (eq_attr "hazard" "none") + (eq_attr "single_insn" "yes"))) + (const_string "yes") + (const_string "no"))) + +;; Attribute defining whether or not we can use the branch-likely instructions +(define_attr "branch_likely" "no,yes" + (const + (if_then_else (ne (symbol_ref "GENERATE_BRANCHLIKELY") (const_int 0)) + (const_string "yes") + (const_string "no")))) + +;; True if an instruction might assign to hi or lo when reloaded. +;; This is used by the TUNE_MACC_CHAINS code. +(define_attr "may_clobber_hilo" "no,yes" + (if_then_else (eq_attr "type" "imul,imul3,imadd,idiv,mthilo") + (const_string "yes") + (const_string "no"))) + +;; Describe a user's asm statement. +(define_asm_attributes + [(set_attr "type" "multi") + (set_attr "can_delay" "no")]) + +;; This mode macro allows 32-bit and 64-bit GPR patterns to be generated +;; from the same template. +(define_mode_macro GPR [SI (DI "TARGET_64BIT")]) + +;; This mode macro allows :P to be used for patterns that operate on +;; pointer-sized quantities. Exactly one of the two alternatives will match. +(define_mode_macro P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) + +;; This mode macro allows :MOVECC to be used anywhere that a +;; conditional-move-type condition is needed. +(define_mode_macro MOVECC [SI (DI "TARGET_64BIT") (CC "TARGET_HARD_FLOAT")]) + +;; This mode macro allows the QI and HI extension patterns to be defined from +;; the same template. +(define_mode_macro SHORT [QI HI]) + +;; This mode macro allows :ANYF to be used wherever a scalar or vector +;; floating-point mode is allowed. +(define_mode_macro ANYF [(SF "TARGET_HARD_FLOAT") + (DF "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT") + (V2SF "TARGET_PAIRED_SINGLE_FLOAT")]) + +;; Like ANYF, but only applies to scalar modes. +(define_mode_macro SCALARF [(SF "TARGET_HARD_FLOAT") + (DF "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT")]) + +;; In GPR templates, a string like "subu" will expand to "subu" in the +;; 32-bit version and "dsubu" in the 64-bit version. +(define_mode_attr d [(SI "") (DI "d")]) + +;; This attribute gives the length suffix for a sign- or zero-extension +;; instruction. +(define_mode_attr size [(QI "b") (HI "h")]) + +;; This attributes gives the mode mask of a SHORT. +(define_mode_attr mask [(QI "0x00ff") (HI "0xffff")]) + +;; Mode attributes for GPR loads and stores. +(define_mode_attr load [(SI "lw") (DI "ld")]) +(define_mode_attr store [(SI "sw") (DI "sd")]) + +;; Similarly for MIPS IV indexed FPR loads and stores. +(define_mode_attr loadx [(SF "lwxc1") (DF "ldxc1") (V2SF "ldxc1")]) +(define_mode_attr storex [(SF "swxc1") (DF "sdxc1") (V2SF "sdxc1")]) + +;; The unextended ranges of the MIPS16 addiu and daddiu instructions +;; are different. Some forms of unextended addiu have an 8-bit immediate +;; field but the equivalent daddiu has only a 5-bit field. +(define_mode_attr si8_di5 [(SI "8") (DI "5")]) + +;; This attribute gives the best constraint to use for registers of +;; a given mode. +(define_mode_attr reg [(SI "d") (DI "d") (CC "z")]) + +;; This attribute gives the format suffix for floating-point operations. +(define_mode_attr fmt [(SF "s") (DF "d") (V2SF "ps")]) + +;; This attribute gives the upper-case mode name for one unit of a +;; floating-point mode. +(define_mode_attr UNITMODE [(SF "SF") (DF "DF") (V2SF "SF")]) + +;; This attribute works around the early SB-1 rev2 core "F2" erratum: +;; +;; In certain cases, div.s and div.ps may have a rounding error +;; and/or wrong inexact flag. +;; +;; Therefore, we only allow div.s if not working around SB-1 rev2 +;; errata or if a slight loss of precision is OK. +(define_mode_attr divide_condition + [DF (SF "!TARGET_FIX_SB1 || flag_unsafe_math_optimizations") + (V2SF "TARGET_SB1 && (!TARGET_FIX_SB1 || flag_unsafe_math_optimizations)")]) + +; This attribute gives the condition for which sqrt instructions exist. +(define_mode_attr sqrt_condition + [(SF "!ISA_MIPS1") (DF "!ISA_MIPS1") (V2SF "TARGET_SB1")]) + +; This attribute gives the condition for which recip and rsqrt instructions +; exist. +(define_mode_attr recip_condition + [(SF "ISA_HAS_FP4") (DF "ISA_HAS_FP4") (V2SF "TARGET_SB1")]) + +;; This code macro allows all branch instructions to be generated from +;; a single define_expand template. +(define_code_macro any_cond [unordered ordered unlt unge uneq ltgt unle ungt + eq ne gt ge lt le gtu geu ltu leu]) + +;; This code macro allows signed and unsigned widening multiplications +;; to use the same template. +(define_code_macro any_extend [sign_extend zero_extend]) + +;; This code macro allows the three shift instructions to be generated +;; from the same template. +(define_code_macro any_shift [ashift ashiftrt lshiftrt]) + +;; This code macro allows all native floating-point comparisons to be +;; generated from the same template. +(define_code_macro fcond [unordered uneq unlt unle eq lt le]) + +;; This code macro is used for comparisons that can be implemented +;; by swapping the operands. +(define_code_macro swapped_fcond [ge gt unge ungt]) + +;; expands to an empty string when doing a signed operation and +;; "u" when doing an unsigned operation. +(define_code_attr u [(sign_extend "") (zero_extend "u")]) + +;; is like , but the signed form expands to "s" rather than "". +(define_code_attr su [(sign_extend "s") (zero_extend "u")]) + +;; expands to the name of the optab for a particular code. +(define_code_attr optab [(ashift "ashl") + (ashiftrt "ashr") + (lshiftrt "lshr")]) + +;; expands to the name of the insn that implements a particular code. +(define_code_attr insn [(ashift "sll") + (ashiftrt "sra") + (lshiftrt "srl")]) + +;; is the c.cond.fmt condition associated with a particular code. +(define_code_attr fcond [(unordered "un") + (uneq "ueq") + (unlt "ult") + (unle "ule") + (eq "eq") + (lt "lt") + (le "le")]) + +;; Similar, but for swapped conditions. +(define_code_attr swapped_fcond [(ge "le") + (gt "lt") + (unge "ule") + (ungt "ult")]) + +;; ......................... +;; +;; Branch, call and jump delay slots +;; +;; ......................... + +(define_delay (and (eq_attr "type" "branch") + (eq (symbol_ref "TARGET_MIPS16") (const_int 0))) + [(eq_attr "can_delay" "yes") + (nil) + (and (eq_attr "branch_likely" "yes") + (eq_attr "can_delay" "yes"))]) + +(define_delay (eq_attr "type" "jump") + [(eq_attr "can_delay" "yes") + (nil) + (nil)]) + +(define_delay (and (eq_attr "type" "call") + (eq_attr "jal_macro" "no")) + [(eq_attr "can_delay" "yes") + (nil) + (nil)]) + +;; Pipeline descriptions. +;; +;; generic.md provides a fallback for processors without a specific +;; pipeline description. It is derived from the old define_function_unit +;; version and uses the "alu" and "imuldiv" units declared below. +;; +;; Some of the processor-specific files are also derived from old +;; define_function_unit descriptions and simply override the parts of +;; generic.md that don't apply. The other processor-specific files +;; are self-contained. +(define_automaton "alu,imuldiv") + +(define_cpu_unit "alu" "alu") +(define_cpu_unit "imuldiv" "imuldiv") + +(include "4k.md") +(include "5k.md") +(include "24k.md") +(include "3000.md") +(include "4000.md") +(include "4100.md") +(include "4130.md") +(include "4300.md") +(include "4600.md") +(include "5000.md") +(include "5400.md") +(include "5500.md") +(include "6000.md") +(include "7000.md") +(include "9000.md") +(include "sb1.md") +(include "sr71k.md") +(include "generic.md") + +;; +;; .................... +;; +;; CONDITIONAL TRAPS +;; +;; .................... +;; + +(define_insn "trap" + [(trap_if (const_int 1) (const_int 0))] + "" +{ + if (ISA_HAS_COND_TRAP) + return "teq\t$0,$0"; + else if (TARGET_MIPS16) + return "break 0"; + else + return "break"; +} + [(set_attr "type" "trap")]) + +(define_expand "conditional_trap" + [(trap_if (match_operator 0 "comparison_operator" + [(match_dup 2) (match_dup 3)]) + (match_operand 1 "const_int_operand"))] + "ISA_HAS_COND_TRAP" +{ + if (GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_INT + && operands[1] == const0_rtx) + { + mips_gen_conditional_trap (operands); + DONE; + } + else + FAIL; +}) + +(define_insn "*conditional_trap" + [(trap_if (match_operator:GPR 0 "trap_comparison_operator" + [(match_operand:GPR 1 "reg_or_0_operand" "dJ") + (match_operand:GPR 2 "arith_operand" "dI")]) + (const_int 0))] + "ISA_HAS_COND_TRAP" + "t%C0\t%z1,%2" + [(set_attr "type" "trap")]) + +;; +;; .................... +;; +;; ADDITION +;; +;; .................... +;; + +(define_insn "add3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (plus:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] + "" + "add.\t%0,%1,%2" + [(set_attr "type" "fadd") + (set_attr "mode" "")]) + +(define_expand "add3" + [(set (match_operand:GPR 0 "register_operand") + (plus:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "arith_operand")))] + "") + +(define_insn "*add3" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (match_operand:GPR 1 "register_operand" "d,d") + (match_operand:GPR 2 "arith_operand" "d,Q")))] + "!TARGET_MIPS16" + "@ + addu\t%0,%1,%2 + addiu\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +;; We need to recognize MIPS16 stack pointer additions explicitly, since +;; we don't have a constraint for $sp. These insns will be generated by +;; the save_restore_insns functions. + +(define_insn "*add3_sp1" + [(set (reg:GPR 29) + (plus:GPR (reg:GPR 29) + (match_operand:GPR 0 "const_arith_operand" "")))] + "TARGET_MIPS16" + "addiu\t%$,%$,%0" + [(set_attr "type" "arith") + (set_attr "mode" "") + (set (attr "length") (if_then_else (match_operand 0 "m16_simm8_8") + (const_int 4) + (const_int 8)))]) + +(define_insn "*add3_sp2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (plus:GPR (reg:GPR 29) + (match_operand:GPR 1 "const_arith_operand" "")))] + "TARGET_MIPS16" + "addiu\t%0,%$,%1" + [(set_attr "type" "arith") + (set_attr "mode" "") + (set (attr "length") (if_then_else (match_operand 1 "m16_uimm_4") + (const_int 4) + (const_int 8)))]) + +(define_insn "*add3_mips16" + [(set (match_operand:GPR 0 "register_operand" "=d,d,d") + (plus:GPR (match_operand:GPR 1 "register_operand" "0,d,d") + (match_operand:GPR 2 "arith_operand" "Q,O,d")))] + "TARGET_MIPS16" + "@ + addiu\t%0,%2 + addiu\t%0,%1,%2 + addu\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "") + (set_attr_alternative "length" + [(if_then_else (match_operand 2 "m16_simm_1") + (const_int 4) + (const_int 8)) + (if_then_else (match_operand 2 "m16_simm4_1") + (const_int 4) + (const_int 8)) + (const_int 4)])]) + + +;; On the mips16, we can sometimes split an add of a constant which is +;; a 4 byte instruction into two adds which are both 2 byte +;; instructions. There are two cases: one where we are adding a +;; constant plus a register to another register, and one where we are +;; simply adding a constant to a register. + +(define_split + [(set (match_operand:SI 0 "register_operand") + (plus:SI (match_dup 0) + (match_operand:SI 1 "const_int_operand")))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) > 0x7f + && INTVAL (operands[1]) <= 0x7f + 0x7f) + || (INTVAL (operands[1]) < - 0x80 + && INTVAL (operands[1]) >= - 0x80 - 0x80))" + [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val >= 0) + { + operands[1] = GEN_INT (0x7f); + operands[2] = GEN_INT (val - 0x7f); + } + else + { + operands[1] = GEN_INT (- 0x80); + operands[2] = GEN_INT (val + 0x80); + } +}) + +(define_split + [(set (match_operand:SI 0 "register_operand") + (plus:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "const_int_operand")))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && REG_P (operands[1]) + && M16_REG_P (REGNO (operands[1])) + && REGNO (operands[0]) != REGNO (operands[1]) + && GET_CODE (operands[2]) == CONST_INT + && ((INTVAL (operands[2]) > 0x7 + && INTVAL (operands[2]) <= 0x7 + 0x7f) + || (INTVAL (operands[2]) < - 0x8 + && INTVAL (operands[2]) >= - 0x8 - 0x80))" + [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2))) + (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))] +{ + HOST_WIDE_INT val = INTVAL (operands[2]); + + if (val >= 0) + { + operands[2] = GEN_INT (0x7); + operands[3] = GEN_INT (val - 0x7); + } + else + { + operands[2] = GEN_INT (- 0x8); + operands[3] = GEN_INT (val + 0x8); + } +}) + +(define_split + [(set (match_operand:DI 0 "register_operand") + (plus:DI (match_dup 0) + (match_operand:DI 1 "const_int_operand")))] + "TARGET_MIPS16 && TARGET_64BIT && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) > 0xf + && INTVAL (operands[1]) <= 0xf + 0xf) + || (INTVAL (operands[1]) < - 0x10 + && INTVAL (operands[1]) >= - 0x10 - 0x10))" + [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val >= 0) + { + operands[1] = GEN_INT (0xf); + operands[2] = GEN_INT (val - 0xf); + } + else + { + operands[1] = GEN_INT (- 0x10); + operands[2] = GEN_INT (val + 0x10); + } +}) + +(define_split + [(set (match_operand:DI 0 "register_operand") + (plus:DI (match_operand:DI 1 "register_operand") + (match_operand:DI 2 "const_int_operand")))] + "TARGET_MIPS16 && TARGET_64BIT && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && REG_P (operands[1]) + && M16_REG_P (REGNO (operands[1])) + && REGNO (operands[0]) != REGNO (operands[1]) + && GET_CODE (operands[2]) == CONST_INT + && ((INTVAL (operands[2]) > 0x7 + && INTVAL (operands[2]) <= 0x7 + 0xf) + || (INTVAL (operands[2]) < - 0x8 + && INTVAL (operands[2]) >= - 0x8 - 0x10))" + [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2))) + (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] +{ + HOST_WIDE_INT val = INTVAL (operands[2]); + + if (val >= 0) + { + operands[2] = GEN_INT (0x7); + operands[3] = GEN_INT (val - 0x7); + } + else + { + operands[2] = GEN_INT (- 0x8); + operands[3] = GEN_INT (val + 0x8); + } +}) + +(define_insn "*addsi3_extended" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (sign_extend:DI + (plus:SI (match_operand:SI 1 "register_operand" "d,d") + (match_operand:SI 2 "arith_operand" "d,Q"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "@ + addu\t%0,%1,%2 + addiu\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +;; Split this insn so that the addiu splitters can have a crack at it. +;; Use a conservative length estimate until the split. +(define_insn_and_split "*addsi3_extended_mips16" + [(set (match_operand:DI 0 "register_operand" "=d,d,d") + (sign_extend:DI + (plus:SI (match_operand:SI 1 "register_operand" "0,d,d") + (match_operand:SI 2 "arith_operand" "Q,O,d"))))] + "TARGET_64BIT && TARGET_MIPS16" + "#" + "&& reload_completed" + [(set (match_dup 3) (plus:SI (match_dup 1) (match_dup 2)))] + { operands[3] = gen_lowpart (SImode, operands[0]); } + [(set_attr "type" "arith") + (set_attr "mode" "SI") + (set_attr "extended_mips16" "yes")]) + +;; +;; .................... +;; +;; SUBTRACTION +;; +;; .................... +;; + +(define_insn "sub3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (minus:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] + "" + "sub.\t%0,%1,%2" + [(set_attr "type" "fadd") + (set_attr "mode" "")]) + +(define_insn "sub3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (minus:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d")))] + "" + "subu\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "*subsi3_extended" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI + (minus:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d"))))] + "TARGET_64BIT" + "subu\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "DI")]) + +;; +;; .................... +;; +;; MULTIPLICATION +;; +;; .................... +;; + +(define_expand "mul3" + [(set (match_operand:SCALARF 0 "register_operand") + (mult:SCALARF (match_operand:SCALARF 1 "register_operand") + (match_operand:SCALARF 2 "register_operand")))] + "" + "") + +(define_insn "*mul3" + [(set (match_operand:SCALARF 0 "register_operand" "=f") + (mult:SCALARF (match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f")))] + "!TARGET_4300_MUL_FIX" + "mul.\t%0,%1,%2" + [(set_attr "type" "fmul") + (set_attr "mode" "")]) + +;; Early VR4300 silicon has a CPU bug where multiplies with certain +;; operands may corrupt immediately following multiplies. This is a +;; simple fix to insert NOPs. + +(define_insn "*mul3_r4300" + [(set (match_operand:SCALARF 0 "register_operand" "=f") + (mult:SCALARF (match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f")))] + "TARGET_4300_MUL_FIX" + "mul.\t%0,%1,%2\;nop" + [(set_attr "type" "fmul") + (set_attr "mode" "") + (set_attr "length" "8")]) + +(define_insn "mulv2sf3" + [(set (match_operand:V2SF 0 "register_operand" "=f") + (mult:V2SF (match_operand:V2SF 1 "register_operand" "f") + (match_operand:V2SF 2 "register_operand" "f")))] + "TARGET_PAIRED_SINGLE_FLOAT" + "mul.ps\t%0,%1,%2" + [(set_attr "type" "fmul") + (set_attr "mode" "SF")]) + +;; The original R4000 has a cpu bug. If a double-word or a variable +;; shift executes while an integer multiplication is in progress, the +;; shift may give an incorrect result. Avoid this by keeping the mflo +;; with the mult on the R4000. +;; +;; From "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0" +;; (also valid for MIPS R4000MC processors): +;; +;; "16. R4000PC, R4000SC: Please refer to errata 28 for an update to +;; this errata description. +;; The following code sequence causes the R4000 to incorrectly +;; execute the Double Shift Right Arithmetic 32 (dsra32) +;; instruction. If the dsra32 instruction is executed during an +;; integer multiply, the dsra32 will only shift by the amount in +;; specified in the instruction rather than the amount plus 32 +;; bits. +;; instruction 1: mult rs,rt integer multiply +;; instruction 2-12: dsra32 rd,rt,rs doubleword shift +;; right arithmetic + 32 +;; Workaround: A dsra32 instruction placed after an integer +;; multiply should not be one of the 11 instructions after the +;; multiply instruction." +;; +;; and: +;; +;; "28. R4000PC, R4000SC: The text from errata 16 should be replaced by +;; the following description. +;; All extended shifts (shift by n+32) and variable shifts (32 and +;; 64-bit versions) may produce incorrect results under the +;; following conditions: +;; 1) An integer multiply is currently executing +;; 2) These types of shift instructions are executed immediately +;; following an integer divide instruction. +;; Workaround: +;; 1) Make sure no integer multiply is running wihen these +;; instruction are executed. If this cannot be predicted at +;; compile time, then insert a "mfhi" to R0 instruction +;; immediately after the integer multiply instruction. This +;; will cause the integer multiply to complete before the shift +;; is executed. +;; 2) Separate integer divide and these two classes of shift +;; instructions by another instruction or a noop." +;; +;; These processors have PRId values of 0x00004220 and 0x00004300, +;; respectively. + +(define_expand "mul3" + [(set (match_operand:GPR 0 "register_operand") + (mult:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "register_operand")))] + "" +{ + if (GENERATE_MULT3_) + emit_insn (gen_mul3_mult3 (operands[0], operands[1], operands[2])); + else if (!TARGET_FIX_R4000) + emit_insn (gen_mul3_internal (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_mul3_r4000 (operands[0], operands[1], operands[2])); + DONE; +}) + +(define_insn "mulsi3_mult3" + [(set (match_operand:SI 0 "register_operand" "=d,l") + (mult:SI (match_operand:SI 1 "register_operand" "d,d") + (match_operand:SI 2 "register_operand" "d,d"))) + (clobber (match_scratch:SI 3 "=h,h")) + (clobber (match_scratch:SI 4 "=l,X"))] + "GENERATE_MULT3_SI" +{ + if (which_alternative == 1) + return "mult\t%1,%2"; + if (TARGET_MAD + || TARGET_MIPS5400 + || TARGET_MIPS5500 + || TARGET_MIPS7000 + || TARGET_MIPS9000 + || ISA_MIPS32 + || ISA_MIPS32R2 + || ISA_MIPS64) + return "mul\t%0,%1,%2"; + return "mult\t%0,%1,%2"; +} + [(set_attr "type" "imul3,imul") + (set_attr "mode" "SI")]) + +(define_insn "muldi3_mult3" + [(set (match_operand:DI 0 "register_operand" "=d") + (mult:DI (match_operand:DI 1 "register_operand" "d") + (match_operand:DI 2 "register_operand" "d"))) + (clobber (match_scratch:DI 3 "=h")) + (clobber (match_scratch:DI 4 "=l"))] + "TARGET_64BIT && GENERATE_MULT3_DI" + "dmult\t%0,%1,%2" + [(set_attr "type" "imul3") + (set_attr "mode" "DI")]) + +;; If a register gets allocated to LO, and we spill to memory, the reload +;; will include a move from LO to a GPR. Merge it into the multiplication +;; if it can set the GPR directly. +;; +;; Operand 0: LO +;; Operand 1: GPR (1st multiplication operand) +;; Operand 2: GPR (2nd multiplication operand) +;; Operand 3: HI +;; Operand 4: GPR (destination) +(define_peephole2 + [(parallel + [(set (match_operand:SI 0 "register_operand") + (mult:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand"))) + (clobber (match_operand:SI 3 "register_operand")) + (clobber (scratch:SI))]) + (set (match_operand:SI 4 "register_operand") + (unspec [(match_dup 0) (match_dup 3)] UNSPEC_MFHILO))] + "GENERATE_MULT3_SI && peep2_reg_dead_p (2, operands[0])" + [(parallel + [(set (match_dup 4) + (mult:SI (match_dup 1) + (match_dup 2))) + (clobber (match_dup 3)) + (clobber (match_dup 0))])]) + +(define_insn "mul3_internal" + [(set (match_operand:GPR 0 "register_operand" "=l") + (mult:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d"))) + (clobber (match_scratch:GPR 3 "=h"))] + "!TARGET_FIX_R4000" + "mult\t%1,%2" + [(set_attr "type" "imul") + (set_attr "mode" "")]) + +(define_insn "mul3_r4000" + [(set (match_operand:GPR 0 "register_operand" "=d") + (mult:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d"))) + (clobber (match_scratch:GPR 3 "=h")) + (clobber (match_scratch:GPR 4 "=l"))] + "TARGET_FIX_R4000" + "mult\t%1,%2\;mflo\t%0" + [(set_attr "type" "imul") + (set_attr "mode" "") + (set_attr "length" "8")]) + +;; On the VR4120 and VR4130, it is better to use "mtlo $0; macc" instead +;; of "mult; mflo". They have the same latency, but the first form gives +;; us an extra cycle to compute the operands. + +;; Operand 0: LO +;; Operand 1: GPR (1st multiplication operand) +;; Operand 2: GPR (2nd multiplication operand) +;; Operand 3: HI +;; Operand 4: GPR (destination) +(define_peephole2 + [(parallel + [(set (match_operand:SI 0 "register_operand") + (mult:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand"))) + (clobber (match_operand:SI 3 "register_operand"))]) + (set (match_operand:SI 4 "register_operand") + (unspec:SI [(match_dup 0) (match_dup 3)] UNSPEC_MFHILO))] + "ISA_HAS_MACC && !GENERATE_MULT3_SI" + [(set (match_dup 0) + (const_int 0)) + (parallel + [(set (match_dup 0) + (plus:SI (mult:SI (match_dup 1) + (match_dup 2)) + (match_dup 0))) + (set (match_dup 4) + (plus:SI (mult:SI (match_dup 1) + (match_dup 2)) + (match_dup 0))) + (clobber (match_dup 3))])]) + +;; Multiply-accumulate patterns + +;; For processors that can copy the output to a general register: +;; +;; The all-d alternative is needed because the combiner will find this +;; pattern and then register alloc/reload will move registers around to +;; make them fit, and we don't want to trigger unnecessary loads to LO. +;; +;; The last alternative should be made slightly less desirable, but adding +;; "?" to the constraint is too strong, and causes values to be loaded into +;; LO even when that's more costly. For now, using "*d" mostly does the +;; trick. +(define_insn "*mul_acc_si" + [(set (match_operand:SI 0 "register_operand" "=l,*d,*d") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d,d,d") + (match_operand:SI 2 "register_operand" "d,d,d")) + (match_operand:SI 3 "register_operand" "0,l,*d"))) + (clobber (match_scratch:SI 4 "=h,h,h")) + (clobber (match_scratch:SI 5 "=X,3,l")) + (clobber (match_scratch:SI 6 "=X,X,&d"))] + "(TARGET_MIPS3900 + || ISA_HAS_MADD_MSUB) + && !TARGET_MIPS16" +{ + static const char *const madd[] = { "madd\t%1,%2", "madd\t%0,%1,%2" }; + if (which_alternative == 2) + return "#"; + if (ISA_HAS_MADD_MSUB && which_alternative != 0) + return "#"; + return madd[which_alternative]; +} + [(set_attr "type" "imadd,imadd,multi") + (set_attr "mode" "SI") + (set_attr "length" "4,4,8")]) + +;; Split the above insn if we failed to get LO allocated. +(define_split + [(set (match_operand:SI 0 "register_operand") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand")) + (match_operand:SI 3 "register_operand"))) + (clobber (match_scratch:SI 4)) + (clobber (match_scratch:SI 5)) + (clobber (match_scratch:SI 6))] + "reload_completed && !TARGET_DEBUG_D_MODE + && GP_REG_P (true_regnum (operands[0])) + && GP_REG_P (true_regnum (operands[3]))" + [(parallel [(set (match_dup 6) + (mult:SI (match_dup 1) (match_dup 2))) + (clobber (match_dup 4)) + (clobber (match_dup 5))]) + (set (match_dup 0) (plus:SI (match_dup 6) (match_dup 3)))] + "") + +;; Splitter to copy result of MADD to a general register +(define_split + [(set (match_operand:SI 0 "register_operand") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand")) + (match_operand:SI 3 "register_operand"))) + (clobber (match_scratch:SI 4)) + (clobber (match_scratch:SI 5)) + (clobber (match_scratch:SI 6))] + "reload_completed && !TARGET_DEBUG_D_MODE + && GP_REG_P (true_regnum (operands[0])) + && true_regnum (operands[3]) == LO_REGNUM" + [(parallel [(set (match_dup 3) + (plus:SI (mult:SI (match_dup 1) (match_dup 2)) + (match_dup 3))) + (clobber (match_dup 4)) + (clobber (match_dup 5)) + (clobber (match_dup 6))]) + (set (match_dup 0) (unspec:SI [(match_dup 5) (match_dup 4)] UNSPEC_MFHILO))] + "") + +(define_insn "*macc" + [(set (match_operand:SI 0 "register_operand" "=l,d") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d,d") + (match_operand:SI 2 "register_operand" "d,d")) + (match_operand:SI 3 "register_operand" "0,l"))) + (clobber (match_scratch:SI 4 "=h,h")) + (clobber (match_scratch:SI 5 "=X,3"))] + "ISA_HAS_MACC" +{ + if (which_alternative == 1) + return "macc\t%0,%1,%2"; + else if (TARGET_MIPS5500) + return "madd\t%1,%2"; + else + /* The VR4130 assumes that there is a two-cycle latency between a macc + that "writes" to $0 and an instruction that reads from it. We avoid + this by assigning to $1 instead. */ + return "%[macc\t%@,%1,%2%]"; +} + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "*msac" + [(set (match_operand:SI 0 "register_operand" "=l,d") + (minus:SI (match_operand:SI 1 "register_operand" "0,l") + (mult:SI (match_operand:SI 2 "register_operand" "d,d") + (match_operand:SI 3 "register_operand" "d,d")))) + (clobber (match_scratch:SI 4 "=h,h")) + (clobber (match_scratch:SI 5 "=X,1"))] + "ISA_HAS_MSAC" +{ + if (which_alternative == 1) + return "msac\t%0,%2,%3"; + else if (TARGET_MIPS5500) + return "msub\t%2,%3"; + else + return "msac\t$0,%2,%3"; +} + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; An msac-like instruction implemented using negation and a macc. +(define_insn_and_split "*msac_using_macc" + [(set (match_operand:SI 0 "register_operand" "=l,d") + (minus:SI (match_operand:SI 1 "register_operand" "0,l") + (mult:SI (match_operand:SI 2 "register_operand" "d,d") + (match_operand:SI 3 "register_operand" "d,d")))) + (clobber (match_scratch:SI 4 "=h,h")) + (clobber (match_scratch:SI 5 "=X,1")) + (clobber (match_scratch:SI 6 "=d,d"))] + "ISA_HAS_MACC && !ISA_HAS_MSAC" + "#" + "&& reload_completed" + [(set (match_dup 6) + (neg:SI (match_dup 3))) + (parallel + [(set (match_dup 0) + (plus:SI (mult:SI (match_dup 2) + (match_dup 6)) + (match_dup 1))) + (clobber (match_dup 4)) + (clobber (match_dup 5))])] + "" + [(set_attr "type" "imadd") + (set_attr "length" "8")]) + +;; Patterns generated by the define_peephole2 below. + +(define_insn "*macc2" + [(set (match_operand:SI 0 "register_operand" "=l") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")) + (match_dup 0))) + (set (match_operand:SI 3 "register_operand" "=d") + (plus:SI (mult:SI (match_dup 1) + (match_dup 2)) + (match_dup 0))) + (clobber (match_scratch:SI 4 "=h"))] + "ISA_HAS_MACC && reload_completed" + "macc\t%3,%1,%2" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "*msac2" + [(set (match_operand:SI 0 "register_operand" "=l") + (minus:SI (match_dup 0) + (mult:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")))) + (set (match_operand:SI 3 "register_operand" "=d") + (minus:SI (match_dup 0) + (mult:SI (match_dup 1) + (match_dup 2)))) + (clobber (match_scratch:SI 4 "=h"))] + "ISA_HAS_MSAC && reload_completed" + "msac\t%3,%1,%2" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; Convert macc $0,, & mflo into macc ,, +;; Similarly msac. +;; +;; Operand 0: LO +;; Operand 1: macc/msac +;; Operand 2: HI +;; Operand 3: GPR (destination) +(define_peephole2 + [(parallel + [(set (match_operand:SI 0 "register_operand") + (match_operand:SI 1 "macc_msac_operand")) + (clobber (match_operand:SI 2 "register_operand")) + (clobber (scratch:SI))]) + (set (match_operand:SI 3 "register_operand") + (unspec:SI [(match_dup 0) (match_dup 2)] UNSPEC_MFHILO))] + "" + [(parallel [(set (match_dup 0) + (match_dup 1)) + (set (match_dup 3) + (match_dup 1)) + (clobber (match_dup 2))])] + "") + +;; When we have a three-address multiplication instruction, it should +;; be faster to do a separate multiply and add, rather than moving +;; something into LO in order to use a macc instruction. +;; +;; This peephole needs a scratch register to cater for the case when one +;; of the multiplication operands is the same as the destination. +;; +;; Operand 0: GPR (scratch) +;; Operand 1: LO +;; Operand 2: GPR (addend) +;; Operand 3: GPR (destination) +;; Operand 4: macc/msac +;; Operand 5: HI +;; Operand 6: new multiplication +;; Operand 7: new addition/subtraction +(define_peephole2 + [(match_scratch:SI 0 "d") + (set (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand")) + (match_dup 0) + (parallel + [(set (match_operand:SI 3 "register_operand") + (match_operand:SI 4 "macc_msac_operand")) + (clobber (match_operand:SI 5 "register_operand")) + (clobber (match_dup 1))])] + "GENERATE_MULT3_SI + && true_regnum (operands[1]) == LO_REGNUM + && peep2_reg_dead_p (2, operands[1]) + && GP_REG_P (true_regnum (operands[3]))" + [(parallel [(set (match_dup 0) + (match_dup 6)) + (clobber (match_dup 5)) + (clobber (match_dup 1))]) + (set (match_dup 3) + (match_dup 7))] +{ + operands[6] = XEXP (operands[4], GET_CODE (operands[4]) == PLUS ? 0 : 1); + operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[4]), SImode, + operands[2], operands[0]); +}) + +;; Same as above, except LO is the initial target of the macc. +;; +;; Operand 0: GPR (scratch) +;; Operand 1: LO +;; Operand 2: GPR (addend) +;; Operand 3: macc/msac +;; Operand 4: HI +;; Operand 5: GPR (destination) +;; Operand 6: new multiplication +;; Operand 7: new addition/subtraction +(define_peephole2 + [(match_scratch:SI 0 "d") + (set (match_operand:SI 1 "register_operand") + (match_operand:SI 2 "register_operand")) + (match_dup 0) + (parallel + [(set (match_dup 1) + (match_operand:SI 3 "macc_msac_operand")) + (clobber (match_operand:SI 4 "register_operand")) + (clobber (scratch:SI))]) + (match_dup 0) + (set (match_operand:SI 5 "register_operand") + (unspec:SI [(match_dup 1) (match_dup 4)] UNSPEC_MFHILO))] + "GENERATE_MULT3_SI && peep2_reg_dead_p (3, operands[1])" + [(parallel [(set (match_dup 0) + (match_dup 6)) + (clobber (match_dup 4)) + (clobber (match_dup 1))]) + (set (match_dup 5) + (match_dup 7))] +{ + operands[6] = XEXP (operands[4], GET_CODE (operands[4]) == PLUS ? 0 : 1); + operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[4]), SImode, + operands[2], operands[0]); +}) + +(define_insn "*mul_sub_si" + [(set (match_operand:SI 0 "register_operand" "=l,*d,*d") + (minus:SI (match_operand:SI 1 "register_operand" "0,l,*d") + (mult:SI (match_operand:SI 2 "register_operand" "d,d,d") + (match_operand:SI 3 "register_operand" "d,d,d")))) + (clobber (match_scratch:SI 4 "=h,h,h")) + (clobber (match_scratch:SI 5 "=X,1,l")) + (clobber (match_scratch:SI 6 "=X,X,&d"))] + "ISA_HAS_MADD_MSUB" + "@ + msub\t%2,%3 + # + #" + [(set_attr "type" "imadd,multi,multi") + (set_attr "mode" "SI") + (set_attr "length" "4,8,8")]) + +;; Split the above insn if we failed to get LO allocated. +(define_split + [(set (match_operand:SI 0 "register_operand") + (minus:SI (match_operand:SI 1 "register_operand") + (mult:SI (match_operand:SI 2 "register_operand") + (match_operand:SI 3 "register_operand")))) + (clobber (match_scratch:SI 4)) + (clobber (match_scratch:SI 5)) + (clobber (match_scratch:SI 6))] + "reload_completed && !TARGET_DEBUG_D_MODE + && GP_REG_P (true_regnum (operands[0])) + && GP_REG_P (true_regnum (operands[1]))" + [(parallel [(set (match_dup 6) + (mult:SI (match_dup 2) (match_dup 3))) + (clobber (match_dup 4)) + (clobber (match_dup 5))]) + (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 6)))] + "") + +;; Splitter to copy result of MSUB to a general register +(define_split + [(set (match_operand:SI 0 "register_operand") + (minus:SI (match_operand:SI 1 "register_operand") + (mult:SI (match_operand:SI 2 "register_operand") + (match_operand:SI 3 "register_operand")))) + (clobber (match_scratch:SI 4)) + (clobber (match_scratch:SI 5)) + (clobber (match_scratch:SI 6))] + "reload_completed && !TARGET_DEBUG_D_MODE + && GP_REG_P (true_regnum (operands[0])) + && true_regnum (operands[1]) == LO_REGNUM" + [(parallel [(set (match_dup 1) + (minus:SI (match_dup 1) + (mult:SI (match_dup 2) (match_dup 3)))) + (clobber (match_dup 4)) + (clobber (match_dup 5)) + (clobber (match_dup 6))]) + (set (match_dup 0) (unspec:SI [(match_dup 5) (match_dup 4)] UNSPEC_MFHILO))] + "") + +(define_insn "*muls" + [(set (match_operand:SI 0 "register_operand" "=l,d") + (neg:SI (mult:SI (match_operand:SI 1 "register_operand" "d,d") + (match_operand:SI 2 "register_operand" "d,d")))) + (clobber (match_scratch:SI 3 "=h,h")) + (clobber (match_scratch:SI 4 "=X,l"))] + "ISA_HAS_MULS" + "@ + muls\t$0,%1,%2 + muls\t%0,%1,%2" + [(set_attr "type" "imul,imul3") + (set_attr "mode" "SI")]) + +;; ??? We could define a mulditi3 pattern when TARGET_64BIT. + +(define_expand "mulsidi3" + [(parallel + [(set (match_operand:DI 0 "register_operand") + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand")) + (any_extend:DI (match_operand:SI 2 "register_operand")))) + (clobber (scratch:DI)) + (clobber (scratch:DI)) + (clobber (scratch:DI))])] + "!TARGET_64BIT || !TARGET_FIX_R4000" +{ + if (!TARGET_64BIT) + { + if (!TARGET_FIX_R4000) + emit_insn (gen_mulsidi3_32bit_internal (operands[0], operands[1], + operands[2])); + else + emit_insn (gen_mulsidi3_32bit_r4000 (operands[0], operands[1], + operands[2])); + DONE; + } +}) + +(define_insn "mulsidi3_32bit_internal" + [(set (match_operand:DI 0 "register_operand" "=x") + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d"))))] + "!TARGET_64BIT && !TARGET_FIX_R4000" + "mult\t%1,%2" + [(set_attr "type" "imul") + (set_attr "mode" "SI")]) + +(define_insn "mulsidi3_32bit_r4000" + [(set (match_operand:DI 0 "register_operand" "=d") + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d")))) + (clobber (match_scratch:DI 3 "=x"))] + "!TARGET_64BIT && TARGET_FIX_R4000" + "mult\t%1,%2\;mflo\t%L0;mfhi\t%M0" + [(set_attr "type" "imul") + (set_attr "mode" "SI") + (set_attr "length" "12")]) + +(define_insn_and_split "*mulsidi3_64bit" + [(set (match_operand:DI 0 "register_operand" "=d") + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d")))) + (clobber (match_scratch:DI 3 "=l")) + (clobber (match_scratch:DI 4 "=h")) + (clobber (match_scratch:DI 5 "=d"))] + "TARGET_64BIT && !TARGET_FIX_R4000" + "#" + "&& reload_completed" + [(parallel + [(set (match_dup 3) + (sign_extend:DI + (mult:SI (match_dup 1) + (match_dup 2)))) + (set (match_dup 4) + (ashiftrt:DI + (mult:DI (any_extend:DI (match_dup 1)) + (any_extend:DI (match_dup 2))) + (const_int 32)))]) + + ;; OP5 <- LO, OP0 <- HI + (set (match_dup 5) (unspec:DI [(match_dup 3) (match_dup 4)] UNSPEC_MFHILO)) + (set (match_dup 0) (unspec:DI [(match_dup 4) (match_dup 3)] UNSPEC_MFHILO)) + + ;; Zero-extend OP5. + (set (match_dup 5) + (ashift:DI (match_dup 5) + (const_int 32))) + (set (match_dup 5) + (lshiftrt:DI (match_dup 5) + (const_int 32))) + + ;; Shift OP0 into place. + (set (match_dup 0) + (ashift:DI (match_dup 0) + (const_int 32))) + + ;; OR the two halves together + (set (match_dup 0) + (ior:DI (match_dup 0) + (match_dup 5)))] + "" + [(set_attr "type" "imul") + (set_attr "mode" "SI") + (set_attr "length" "24")]) + +(define_insn "*mulsidi3_64bit_parts" + [(set (match_operand:DI 0 "register_operand" "=l") + (sign_extend:DI + (mult:SI (match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d")))) + (set (match_operand:DI 1 "register_operand" "=h") + (ashiftrt:DI + (mult:DI (any_extend:DI (match_dup 2)) + (any_extend:DI (match_dup 3))) + (const_int 32)))] + "TARGET_64BIT && !TARGET_FIX_R4000" + "mult\t%2,%3" + [(set_attr "type" "imul") + (set_attr "mode" "SI")]) + +;; Widening multiply with negation. +(define_insn "*muls_di" + [(set (match_operand:DI 0 "register_operand" "=x") + (neg:DI + (mult:DI + (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] + "!TARGET_64BIT && ISA_HAS_MULS" + "muls\t$0,%1,%2" + [(set_attr "type" "imul") + (set_attr "mode" "SI")]) + +(define_insn "*msac_di" + [(set (match_operand:DI 0 "register_operand" "=x") + (minus:DI + (match_operand:DI 3 "register_operand" "0") + (mult:DI + (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] + "!TARGET_64BIT && ISA_HAS_MSAC" +{ + if (TARGET_MIPS5500) + return "msub\t%1,%2"; + else + return "msac\t$0,%1,%2"; +} + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; _highpart patterns + +(define_expand "mulsi3_highpart" + [(set (match_operand:SI 0 "register_operand") + (truncate:SI + (lshiftrt:DI + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand")) + (any_extend:DI (match_operand:SI 2 "register_operand"))) + (const_int 32))))] + "ISA_HAS_MULHI || !TARGET_FIX_R4000" +{ + if (ISA_HAS_MULHI) + emit_insn (gen_mulsi3_highpart_mulhi_internal (operands[0], + operands[1], + operands[2])); + else + emit_insn (gen_mulsi3_highpart_internal (operands[0], operands[1], + operands[2])); + DONE; +}) + +(define_insn "mulsi3_highpart_internal" + [(set (match_operand:SI 0 "register_operand" "=h") + (truncate:SI + (lshiftrt:DI + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) + (const_int 32)))) + (clobber (match_scratch:SI 3 "=l"))] + "!ISA_HAS_MULHI && !TARGET_FIX_R4000" + "mult\t%1,%2" + [(set_attr "type" "imul") + (set_attr "mode" "SI")]) + +(define_insn "mulsi3_highpart_mulhi_internal" + [(set (match_operand:SI 0 "register_operand" "=h,d") + (truncate:SI + (lshiftrt:DI + (mult:DI + (any_extend:DI (match_operand:SI 1 "register_operand" "d,d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d,d"))) + (const_int 32)))) + (clobber (match_scratch:SI 3 "=l,l")) + (clobber (match_scratch:SI 4 "=X,h"))] + "ISA_HAS_MULHI" + "@ + mult\t%1,%2 + mulhi\t%0,%1,%2" + [(set_attr "type" "imul,imul3") + (set_attr "mode" "SI")]) + +(define_insn "*mulsi3_highpart_neg_mulhi_internal" + [(set (match_operand:SI 0 "register_operand" "=h,d") + (truncate:SI + (lshiftrt:DI + (neg:DI + (mult:DI + (any_extend:DI (match_operand:SI 1 "register_operand" "d,d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d,d")))) + (const_int 32)))) + (clobber (match_scratch:SI 3 "=l,l")) + (clobber (match_scratch:SI 4 "=X,h"))] + "ISA_HAS_MULHI" + "@ + mulshi\t%.,%1,%2 + mulshi\t%0,%1,%2" + [(set_attr "type" "imul,imul3") + (set_attr "mode" "SI")]) + +;; Disable unsigned multiplication for -mfix-vr4120. This is for VR4120 +;; errata MD(0), which says that dmultu does not always produce the +;; correct result. +(define_insn "muldi3_highpart" + [(set (match_operand:DI 0 "register_operand" "=h") + (truncate:DI + (lshiftrt:TI + (mult:TI + (any_extend:TI (match_operand:DI 1 "register_operand" "d")) + (any_extend:TI (match_operand:DI 2 "register_operand" "d"))) + (const_int 64)))) + (clobber (match_scratch:DI 3 "=l"))] + "TARGET_64BIT && !TARGET_FIX_R4000 + && !( == ZERO_EXTEND && TARGET_FIX_VR4120)" + "dmult\t%1,%2" + [(set_attr "type" "imul") + (set_attr "mode" "DI")]) + +;; The R4650 supports a 32 bit multiply/ 64 bit accumulate +;; instruction. The HI/LO registers are used as a 64 bit accumulator. + +(define_insn "madsi" + [(set (match_operand:SI 0 "register_operand" "+l") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")) + (match_dup 0))) + (clobber (match_scratch:SI 3 "=h"))] + "TARGET_MAD" + "mad\t%1,%2" + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +(define_insn "*mul_acc_di" + [(set (match_operand:DI 0 "register_operand" "=x") + (plus:DI + (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) + (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) + (match_operand:DI 3 "register_operand" "0")))] + "(TARGET_MAD || ISA_HAS_MACC) + && !TARGET_64BIT" +{ + if (TARGET_MAD) + return "mad\t%1,%2"; + else if (TARGET_MIPS5500) + return "madd\t%1,%2"; + else + /* See comment in *macc. */ + return "%[macc\t%@,%1,%2%]"; +} + [(set_attr "type" "imadd") + (set_attr "mode" "SI")]) + +;; Floating point multiply accumulate instructions. + +(define_insn "*madd" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (plus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")) + (match_operand:ANYF 3 "register_operand" "f")))] + "ISA_HAS_FP4 && TARGET_FUSED_MADD" + "madd.\t%0,%3,%1,%2" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +(define_insn "*msub" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (minus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")) + (match_operand:ANYF 3 "register_operand" "f")))] + "ISA_HAS_FP4 && TARGET_FUSED_MADD" + "msub.\t%0,%3,%1,%2" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +(define_insn "*nmadd" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (neg:ANYF (plus:ANYF + (mult:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")) + (match_operand:ANYF 3 "register_operand" "f"))))] + "ISA_HAS_NMADD_NMSUB && TARGET_FUSED_MADD + && HONOR_SIGNED_ZEROS (mode) + && !HONOR_NANS (mode)" + "nmadd.\t%0,%3,%1,%2" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +(define_insn "*nmadd_fastmath" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (minus:ANYF + (mult:ANYF (neg:ANYF (match_operand:ANYF 1 "register_operand" "f")) + (match_operand:ANYF 2 "register_operand" "f")) + (match_operand:ANYF 3 "register_operand" "f")))] + "ISA_HAS_NMADD_NMSUB && TARGET_FUSED_MADD + && !HONOR_SIGNED_ZEROS (mode) + && !HONOR_NANS (mode)" + "nmadd.\t%0,%3,%1,%2" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +(define_insn "*nmsub" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (neg:ANYF (minus:ANYF + (mult:ANYF (match_operand:ANYF 2 "register_operand" "f") + (match_operand:ANYF 3 "register_operand" "f")) + (match_operand:ANYF 1 "register_operand" "f"))))] + "ISA_HAS_NMADD_NMSUB && TARGET_FUSED_MADD + && HONOR_SIGNED_ZEROS (mode) + && !HONOR_NANS (mode)" + "nmsub.\t%0,%1,%2,%3" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +(define_insn "*nmsub_fastmath" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (minus:ANYF + (match_operand:ANYF 1 "register_operand" "f") + (mult:ANYF (match_operand:ANYF 2 "register_operand" "f") + (match_operand:ANYF 3 "register_operand" "f"))))] + "ISA_HAS_NMADD_NMSUB && TARGET_FUSED_MADD + && !HONOR_SIGNED_ZEROS (mode) + && !HONOR_NANS (mode)" + "nmsub.\t%0,%1,%2,%3" + [(set_attr "type" "fmadd") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; DIVISION and REMAINDER +;; +;; .................... +;; + +(define_expand "div3" + [(set (match_operand:ANYF 0 "register_operand") + (div:ANYF (match_operand:ANYF 1 "reg_or_1_operand") + (match_operand:ANYF 2 "register_operand")))] + "" +{ + if (const_1_operand (operands[1], mode)) + if (!(ISA_HAS_FP4 && flag_unsafe_math_optimizations)) + operands[1] = force_reg (mode, operands[1]); +}) + +;; These patterns work around the early SB-1 rev2 core "F1" erratum: +;; +;; If an mfc1 or dmfc1 happens to access the floating point register +;; file at the same time a long latency operation (div, sqrt, recip, +;; sqrt) iterates an intermediate result back through the floating +;; point register file bypass, then instead returning the correct +;; register value the mfc1 or dmfc1 operation returns the intermediate +;; result of the long latency operation. +;; +;; The workaround is to insert an unconditional 'mov' from/to the +;; long latency op destination register. + +(define_insn "*div3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (div:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] + "" +{ + if (TARGET_FIX_SB1) + return "div.\t%0,%1,%2\;mov.\t%0,%0"; + else + return "div.\t%0,%1,%2"; +} + [(set_attr "type" "fdiv") + (set_attr "mode" "") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0)) + (const_int 8) + (const_int 4)))]) + +(define_insn "*recip3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "") + (match_operand:ANYF 2 "register_operand" "f")))] + " && flag_unsafe_math_optimizations" +{ + if (TARGET_FIX_SB1) + return "recip.\t%0,%2\;mov.\t%0,%0"; + else + return "recip.\t%0,%2"; +} + [(set_attr "type" "frdiv") + (set_attr "mode" "") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0)) + (const_int 8) + (const_int 4)))]) + +;; VR4120 errata MD(A1): signed division instructions do not work correctly +;; with negative operands. We use special libgcc functions instead. +(define_insn "divmod4" + [(set (match_operand:GPR 0 "register_operand" "=l") + (div:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d"))) + (set (match_operand:GPR 3 "register_operand" "=h") + (mod:GPR (match_dup 1) + (match_dup 2)))] + "!TARGET_FIX_VR4120" + { return mips_output_division ("div\t$0,%1,%2", operands); } + [(set_attr "type" "idiv") + (set_attr "mode" "")]) + +(define_insn "udivmod4" + [(set (match_operand:GPR 0 "register_operand" "=l") + (udiv:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d"))) + (set (match_operand:GPR 3 "register_operand" "=h") + (umod:GPR (match_dup 1) + (match_dup 2)))] + "" + { return mips_output_division ("divu\t$0,%1,%2", operands); } + [(set_attr "type" "idiv") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; SQUARE ROOT +;; +;; .................... + +;; These patterns work around the early SB-1 rev2 core "F1" erratum (see +;; "*div[sd]f3" comment for details). + +(define_insn "sqrt2" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (sqrt:ANYF (match_operand:ANYF 1 "register_operand" "f")))] + "" +{ + if (TARGET_FIX_SB1) + return "sqrt.\t%0,%1\;mov.\t%0,%0"; + else + return "sqrt.\t%0,%1"; +} + [(set_attr "type" "fsqrt") + (set_attr "mode" "") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0)) + (const_int 8) + (const_int 4)))]) + +(define_insn "*rsqrta" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (div:ANYF (match_operand:ANYF 1 "const_1_operand" "") + (sqrt:ANYF (match_operand:ANYF 2 "register_operand" "f"))))] + " && flag_unsafe_math_optimizations" +{ + if (TARGET_FIX_SB1) + return "rsqrt.\t%0,%2\;mov.\t%0,%0"; + else + return "rsqrt.\t%0,%2"; +} + [(set_attr "type" "frsqrt") + (set_attr "mode" "") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0)) + (const_int 8) + (const_int 4)))]) + +(define_insn "*rsqrtb" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (sqrt:ANYF (div:ANYF (match_operand:ANYF 1 "const_1_operand" "") + (match_operand:ANYF 2 "register_operand" "f"))))] + " && flag_unsafe_math_optimizations" +{ + if (TARGET_FIX_SB1) + return "rsqrt.\t%0,%2\;mov.\t%0,%0"; + else + return "rsqrt.\t%0,%2"; +} + [(set_attr "type" "frsqrt") + (set_attr "mode" "") + (set (attr "length") + (if_then_else (ne (symbol_ref "TARGET_FIX_SB1") (const_int 0)) + (const_int 8) + (const_int 4)))]) + +;; +;; .................... +;; +;; ABSOLUTE VALUE +;; +;; .................... + +;; Do not use the integer abs macro instruction, since that signals an +;; exception on -2147483648 (sigh). + +;; abs.fmt is an arithmetic instruction and treats all NaN inputs as +;; invalid; it does not clear their sign bits. We therefore can't use +;; abs.fmt if the signs of NaNs matter. + +(define_insn "abs2" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (abs:ANYF (match_operand:ANYF 1 "register_operand" "f")))] + "!HONOR_NANS (mode)" + "abs.\t%0,%1" + [(set_attr "type" "fabs") + (set_attr "mode" "")]) + +;; +;; ................... +;; +;; Count leading zeroes. +;; +;; ................... +;; + +(define_insn "clz2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (clz:GPR (match_operand:GPR 1 "register_operand" "d")))] + "ISA_HAS_CLZ_CLO" + "clz\t%0,%1" + [(set_attr "type" "clz") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; NEGATION and ONE'S COMPLEMENT +;; +;; .................... + +(define_insn "negsi2" + [(set (match_operand:SI 0 "register_operand" "=d") + (neg:SI (match_operand:SI 1 "register_operand" "d")))] + "" +{ + if (TARGET_MIPS16) + return "neg\t%0,%1"; + else + return "subu\t%0,%.,%1"; +} + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "negdi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (neg:DI (match_operand:DI 1 "register_operand" "d")))] + "TARGET_64BIT && !TARGET_MIPS16" + "dsubu\t%0,%.,%1" + [(set_attr "type" "arith") + (set_attr "mode" "DI")]) + +;; neg.fmt is an arithmetic instruction and treats all NaN inputs as +;; invalid; it does not flip their sign bit. We therefore can't use +;; neg.fmt if the signs of NaNs matter. + +(define_insn "neg2" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (neg:ANYF (match_operand:ANYF 1 "register_operand" "f")))] + "!HONOR_NANS (mode)" + "neg.\t%0,%1" + [(set_attr "type" "fneg") + (set_attr "mode" "")]) + +(define_insn "one_cmpl2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (not:GPR (match_operand:GPR 1 "register_operand" "d")))] + "" +{ + if (TARGET_MIPS16) + return "not\t%0,%1"; + else + return "nor\t%0,%.,%1"; +} + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; LOGICAL +;; +;; .................... +;; + +;; Many of these instructions use trivial define_expands, because we +;; want to use a different set of constraints when TARGET_MIPS16. + +(define_expand "and3" + [(set (match_operand:GPR 0 "register_operand") + (and:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "uns_arith_operand")))] + "" +{ + if (TARGET_MIPS16) + operands[2] = force_reg (mode, operands[2]); +}) + +(define_insn "*and3" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (and:GPR (match_operand:GPR 1 "register_operand" "%d,d") + (match_operand:GPR 2 "uns_arith_operand" "d,K")))] + "!TARGET_MIPS16" + "@ + and\t%0,%1,%2 + andi\t%0,%1,%x2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "*and3_mips16" + [(set (match_operand:GPR 0 "register_operand" "=d") + (and:GPR (match_operand:GPR 1 "register_operand" "%0") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_MIPS16" + "and\t%0,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_expand "ior3" + [(set (match_operand:GPR 0 "register_operand") + (ior:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "uns_arith_operand")))] + "" +{ + if (TARGET_MIPS16) + operands[2] = force_reg (mode, operands[2]); +}) + +(define_insn "*ior3" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (ior:GPR (match_operand:GPR 1 "register_operand" "%d,d") + (match_operand:GPR 2 "uns_arith_operand" "d,K")))] + "!TARGET_MIPS16" + "@ + or\t%0,%1,%2 + ori\t%0,%1,%x2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "*ior3_mips16" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ior:GPR (match_operand:GPR 1 "register_operand" "%0") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_MIPS16" + "or\t%0,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_expand "xor3" + [(set (match_operand:GPR 0 "register_operand") + (xor:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "uns_arith_operand")))] + "" + "") + +(define_insn "" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (xor:GPR (match_operand:GPR 1 "register_operand" "%d,d") + (match_operand:GPR 2 "uns_arith_operand" "d,K")))] + "!TARGET_MIPS16" + "@ + xor\t%0,%1,%2 + xori\t%0,%1,%x2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "" + [(set (match_operand:GPR 0 "register_operand" "=d,t,t") + (xor:GPR (match_operand:GPR 1 "register_operand" "%0,d,d") + (match_operand:GPR 2 "uns_arith_operand" "d,K,d")))] + "TARGET_MIPS16" + "@ + xor\t%0,%2 + cmpi\t%1,%2 + cmp\t%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand:VOID 2 "m16_uimm8_1") + (const_int 4) + (const_int 8)) + (const_int 4)])]) + +(define_insn "*nor3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (and:GPR (not:GPR (match_operand:GPR 1 "register_operand" "d")) + (not:GPR (match_operand:GPR 2 "register_operand" "d"))))] + "!TARGET_MIPS16" + "nor\t%0,%1,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; TRUNCATION +;; +;; .................... + + + +(define_insn "truncdfsf2" + [(set (match_operand:SF 0 "register_operand" "=f") + (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" + "cvt.s.d\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "cnv_mode" "D2S") + (set_attr "mode" "SF")]) + +;; Integer truncation patterns. Truncating SImode values to smaller +;; modes is a no-op, as it is for most other GCC ports. Truncating +;; DImode values to SImode is not a no-op for TARGET_64BIT since we +;; need to make sure that the lower 32 bits are properly sign-extended +;; (see TRULY_NOOP_TRUNCATION). Truncating DImode values into modes +;; smaller than SImode is equivalent to two separate truncations: +;; +;; A B +;; DI ---> HI == DI ---> SI ---> HI +;; DI ---> QI == DI ---> SI ---> QI +;; +;; Step A needs a real instruction but step B does not. + +(define_insn "truncdisi2" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,m") + (truncate:SI (match_operand:DI 1 "register_operand" "d,d")))] + "TARGET_64BIT" + "@ + sll\t%0,%1,0 + sw\t%1,%0" + [(set_attr "type" "shift,store") + (set_attr "mode" "SI") + (set_attr "extended_mips16" "yes,*")]) + +(define_insn "truncdihi2" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,m") + (truncate:HI (match_operand:DI 1 "register_operand" "d,d")))] + "TARGET_64BIT" + "@ + sll\t%0,%1,0 + sh\t%1,%0" + [(set_attr "type" "shift,store") + (set_attr "mode" "SI") + (set_attr "extended_mips16" "yes,*")]) + +(define_insn "truncdiqi2" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,m") + (truncate:QI (match_operand:DI 1 "register_operand" "d,d")))] + "TARGET_64BIT" + "@ + sll\t%0,%1,0 + sb\t%1,%0" + [(set_attr "type" "shift,store") + (set_attr "mode" "SI") + (set_attr "extended_mips16" "yes,*")]) + +;; Combiner patterns to optimize shift/truncate combinations. + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (truncate:SI + (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") + (match_operand:DI 2 "const_arith_operand" ""))))] + "TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) >= 32" + "dsra\t%0,%1,%2" + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (truncate:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "d") + (const_int 32))))] + "TARGET_64BIT && !TARGET_MIPS16" + "dsra\t%0,%1,32" + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + +;; Combiner patterns for truncate/sign_extend combinations. They use +;; the shift/truncate patterns above. + +(define_insn_and_split "" + [(set (match_operand:SI 0 "register_operand" "=d") + (sign_extend:SI + (truncate:HI (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "#" + "&& reload_completed" + [(set (match_dup 2) + (ashift:DI (match_dup 1) + (const_int 48))) + (set (match_dup 0) + (truncate:SI (ashiftrt:DI (match_dup 2) + (const_int 48))))] + { operands[2] = gen_lowpart (DImode, operands[0]); }) + +(define_insn_and_split "" + [(set (match_operand:SI 0 "register_operand" "=d") + (sign_extend:SI + (truncate:QI (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "#" + "&& reload_completed" + [(set (match_dup 2) + (ashift:DI (match_dup 1) + (const_int 56))) + (set (match_dup 0) + (truncate:SI (ashiftrt:DI (match_dup 2) + (const_int 56))))] + { operands[2] = gen_lowpart (DImode, operands[0]); }) + + +;; Combiner patterns to optimize truncate/zero_extend combinations. + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (truncate:HI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "andi\t%0,%1,0xffff" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (truncate:QI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "andi\t%0,%1,0xff" + [(set_attr "type" "arith") + (set_attr "mode" "SI")]) + +(define_insn "" + [(set (match_operand:HI 0 "register_operand" "=d") + (zero_extend:HI (truncate:QI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT && !TARGET_MIPS16" + "andi\t%0,%1,0xff" + [(set_attr "type" "arith") + (set_attr "mode" "HI")]) + +;; +;; .................... +;; +;; ZERO EXTENSION +;; +;; .................... + +;; Extension insns. + +(define_insn_and_split "zero_extendsidi2" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,W")))] + "TARGET_64BIT" + "@ + # + lwu\t%0,%1" + "&& reload_completed && REG_P (operands[1])" + [(set (match_dup 0) + (ashift:DI (match_dup 1) (const_int 32))) + (set (match_dup 0) + (lshiftrt:DI (match_dup 0) (const_int 32)))] + { operands[1] = gen_lowpart (DImode, operands[1]); } + [(set_attr "type" "multi,load") + (set_attr "mode" "DI") + (set_attr "length" "8,*")]) + +;; Combine is not allowed to convert this insn into a zero_extendsidi2 +;; because of TRULY_NOOP_TRUNCATION. + +(define_insn_and_split "*clear_upper32" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") + (const_int 4294967295)))] + "TARGET_64BIT" +{ + if (which_alternative == 0) + return "#"; + + operands[1] = gen_lowpart (SImode, operands[1]); + return "lwu\t%0,%1"; +} + "&& reload_completed && REG_P (operands[1])" + [(set (match_dup 0) + (ashift:DI (match_dup 1) (const_int 32))) + (set (match_dup 0) + (lshiftrt:DI (match_dup 0) (const_int 32)))] + "" + [(set_attr "type" "multi,load") + (set_attr "mode" "DI") + (set_attr "length" "8,*")]) + +(define_expand "zero_extend2" + [(set (match_operand:GPR 0 "register_operand") + (zero_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand")))] + "" +{ + if (TARGET_MIPS16 && !GENERATE_MIPS16E + && !memory_operand (operands[1], mode)) + { + emit_insn (gen_and3 (operands[0], + gen_lowpart (mode, operands[1]), + force_reg (mode, + GEN_INT ()))); + DONE; + } +}) + +(define_insn "*zero_extend2" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (zero_extend:GPR + (match_operand:SHORT 1 "nonimmediate_operand" "d,m")))] + "!TARGET_MIPS16" + "@ + andi\t%0,%1, + lu\t%0,%1" + [(set_attr "type" "arith,load") + (set_attr "mode" "")]) + +(define_insn "*zero_extend2_mips16e" + [(set (match_operand:GPR 0 "register_operand" "=d") + (zero_extend:GPR (match_operand:SHORT 1 "register_operand" "0")))] + "GENERATE_MIPS16E" + "ze\t%0" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "*zero_extend2_mips16" + [(set (match_operand:GPR 0 "register_operand" "=d") + (zero_extend:GPR (match_operand:SHORT 1 "memory_operand" "m")))] + "TARGET_MIPS16" + "lu\t%0,%1" + [(set_attr "type" "load") + (set_attr "mode" "")]) + +(define_expand "zero_extendqihi2" + [(set (match_operand:HI 0 "register_operand") + (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand")))] + "" +{ + if (TARGET_MIPS16 && !memory_operand (operands[1], QImode)) + { + emit_insn (gen_zero_extendqisi2 (gen_lowpart (SImode, operands[0]), + operands[1])); + DONE; + } +}) + +(define_insn "*zero_extendqihi2" + [(set (match_operand:HI 0 "register_operand" "=d,d") + (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "d,m")))] + "!TARGET_MIPS16" + "@ + andi\t%0,%1,0x00ff + lbu\t%0,%1" + [(set_attr "type" "arith,load") + (set_attr "mode" "HI")]) + +(define_insn "*zero_extendqihi2_mips16" + [(set (match_operand:HI 0 "register_operand" "=d") + (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))] + "TARGET_MIPS16" + "lbu\t%0,%1" + [(set_attr "type" "load") + (set_attr "mode" "HI")]) + +;; +;; .................... +;; +;; SIGN EXTENSION +;; +;; .................... + +;; Extension insns. +;; Those for integer source operand are ordered widest source type first. + +;; When TARGET_64BIT, all SImode integer registers should already be in +;; sign-extended form (see TRULY_NOOP_TRUNCATION and truncdisi2). We can +;; therefore get rid of register->register instructions if we constrain +;; the source to be in the same register as the destination. +;; +;; The register alternative has type "arith" so that the pre-reload +;; scheduler will treat it as a move. This reflects what happens if +;; the register alternative needs a reload. +(define_insn_and_split "extendsidi2" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "0,m")))] + "TARGET_64BIT" + "@ + # + lw\t%0,%1" + "&& reload_completed && register_operand (operands[1], VOIDmode)" + [(const_int 0)] +{ + emit_note (NOTE_INSN_DELETED); + DONE; +} + [(set_attr "type" "arith,load") + (set_attr "mode" "DI")]) + +(define_expand "extend2" + [(set (match_operand:GPR 0 "register_operand") + (sign_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand")))] + "") + +(define_insn "*extend2_mips16e" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (sign_extend:GPR (match_operand:SHORT 1 "nonimmediate_operand" "0,m")))] + "GENERATE_MIPS16E" + "@ + se\t%0 + l\t%0,%1" + [(set_attr "type" "arith,load") + (set_attr "mode" "")]) + +(define_insn_and_split "*extend2" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (sign_extend:GPR + (match_operand:SHORT 1 "nonimmediate_operand" "d,m")))] + "!ISA_HAS_SEB_SEH && !GENERATE_MIPS16E" + "@ + # + l\t%0,%1" + "&& reload_completed && REG_P (operands[1])" + [(set (match_dup 0) (ashift:GPR (match_dup 1) (match_dup 2))) + (set (match_dup 0) (ashiftrt:GPR (match_dup 0) (match_dup 2)))] +{ + operands[1] = gen_lowpart (mode, operands[1]); + operands[2] = GEN_INT (GET_MODE_BITSIZE (mode) + - GET_MODE_BITSIZE (mode)); +} + [(set_attr "type" "arith,load") + (set_attr "mode" "") + (set_attr "length" "8,*")]) + +(define_insn "*extend2_se" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (sign_extend:GPR + (match_operand:SHORT 1 "nonimmediate_operand" "d,m")))] + "ISA_HAS_SEB_SEH" + "@ + se\t%0,%1 + l\t%0,%1" + [(set_attr "type" "arith,load") + (set_attr "mode" "")]) + +;; This pattern generates the same code as extendqisi2; split it into +;; that form after reload. +(define_insn_and_split "extendqihi2" + [(set (match_operand:HI 0 "register_operand" "=d,d") + (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "d,m")))] + "" + "#" + "reload_completed" + [(set (match_dup 0) (sign_extend:SI (match_dup 1)))] + { operands[0] = gen_lowpart (SImode, operands[0]); } + [(set_attr "type" "arith,load") + (set_attr "mode" "SI") + (set_attr "length" "8,*")]) + +(define_insn "extendsfdf2" + [(set (match_operand:DF 0 "register_operand" "=f") + (float_extend:DF (match_operand:SF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" + "cvt.d.s\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "cnv_mode" "S2D") + (set_attr "mode" "DF")]) + +;; +;; .................... +;; +;; CONVERSIONS +;; +;; .................... + +(define_expand "fix_truncdfsi2" + [(set (match_operand:SI 0 "register_operand") + (fix:SI (match_operand:DF 1 "register_operand")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" +{ + if (!ISA_HAS_TRUNC_W) + { + emit_insn (gen_fix_truncdfsi2_macro (operands[0], operands[1])); + DONE; + } +}) + +(define_insn "fix_truncdfsi2_insn" + [(set (match_operand:SI 0 "register_operand" "=f") + (fix:SI (match_operand:DF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && ISA_HAS_TRUNC_W" + "trunc.w.d %0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") + (set_attr "length" "4")]) + +(define_insn "fix_truncdfsi2_macro" + [(set (match_operand:SI 0 "register_operand" "=f") + (fix:SI (match_operand:DF 1 "register_operand" "f"))) + (clobber (match_scratch:DF 2 "=d"))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !ISA_HAS_TRUNC_W" +{ + if (set_nomacro) + return ".set\tmacro\;trunc.w.d %0,%1,%2\;.set\tnomacro"; + else + return "trunc.w.d %0,%1,%2"; +} + [(set_attr "type" "fcvt") + (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") + (set_attr "length" "36")]) + +(define_expand "fix_truncsfsi2" + [(set (match_operand:SI 0 "register_operand") + (fix:SI (match_operand:SF 1 "register_operand")))] + "TARGET_HARD_FLOAT" +{ + if (!ISA_HAS_TRUNC_W) + { + emit_insn (gen_fix_truncsfsi2_macro (operands[0], operands[1])); + DONE; + } +}) + +(define_insn "fix_truncsfsi2_insn" + [(set (match_operand:SI 0 "register_operand" "=f") + (fix:SI (match_operand:SF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && ISA_HAS_TRUNC_W" + "trunc.w.s %0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") + (set_attr "length" "4")]) + +(define_insn "fix_truncsfsi2_macro" + [(set (match_operand:SI 0 "register_operand" "=f") + (fix:SI (match_operand:SF 1 "register_operand" "f"))) + (clobber (match_scratch:SF 2 "=d"))] + "TARGET_HARD_FLOAT && !ISA_HAS_TRUNC_W" +{ + if (set_nomacro) + return ".set\tmacro\;trunc.w.s %0,%1,%2\;.set\tnomacro"; + else + return "trunc.w.s %0,%1,%2"; +} + [(set_attr "type" "fcvt") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") + (set_attr "length" "36")]) + + +(define_insn "fix_truncdfdi2" + [(set (match_operand:DI 0 "register_operand" "=f") + (fix:DI (match_operand:DF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT" + "trunc.l.d %0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") + (set_attr "length" "4")]) + + +(define_insn "fix_truncsfdi2" + [(set (match_operand:DI 0 "register_operand" "=f") + (fix:DI (match_operand:SF 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT" + "trunc.l.s %0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") + (set_attr "length" "4")]) + + +(define_insn "floatsidf2" + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:SI 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" + "cvt.d.w\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "DF") + (set_attr "cnv_mode" "I2D") + (set_attr "length" "4")]) + + +(define_insn "floatdidf2" + [(set (match_operand:DF 0 "register_operand" "=f") + (float:DF (match_operand:DI 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT" + "cvt.d.l\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "DF") + (set_attr "cnv_mode" "I2D") + (set_attr "length" "4")]) + + +(define_insn "floatsisf2" + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:SI 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT" + "cvt.s.w\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "I2S") + (set_attr "length" "4")]) + + +(define_insn "floatdisf2" + [(set (match_operand:SF 0 "register_operand" "=f") + (float:SF (match_operand:DI 1 "register_operand" "f")))] + "TARGET_HARD_FLOAT && TARGET_FLOAT64 && TARGET_DOUBLE_FLOAT" + "cvt.s.l\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "I2S") + (set_attr "length" "4")]) + + +(define_expand "fixuns_truncdfsi2" + [(set (match_operand:SI 0 "register_operand") + (unsigned_fix:SI (match_operand:DF 1 "register_operand")))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" +{ + rtx reg1 = gen_reg_rtx (DFmode); + rtx reg2 = gen_reg_rtx (DFmode); + rtx reg3 = gen_reg_rtx (SImode); + rtx label1 = gen_label_rtx (); + rtx label2 = gen_label_rtx (); + REAL_VALUE_TYPE offset; + + real_2expN (&offset, 31); + + if (reg1) /* Turn off complaints about unreached code. */ + { + emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode)); + do_pending_stack_adjust (); + + emit_insn (gen_cmpdf (operands[1], reg1)); + emit_jump_insn (gen_bge (label1)); + + emit_insn (gen_fix_truncdfsi2 (operands[0], operands[1])); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); + emit_barrier (); + + emit_label (label1); + emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1)); + emit_move_insn (reg3, GEN_INT (trunc_int_for_mode + (BITMASK_HIGH, SImode))); + + emit_insn (gen_fix_truncdfsi2 (operands[0], reg2)); + emit_insn (gen_iorsi3 (operands[0], operands[0], reg3)); + + emit_label (label2); + + /* Allow REG_NOTES to be set on last insn (labels don't have enough + fields, and can't be used for REG_NOTES anyway). */ + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + DONE; + } +}) + + +(define_expand "fixuns_truncdfdi2" + [(set (match_operand:DI 0 "register_operand") + (unsigned_fix:DI (match_operand:DF 1 "register_operand")))] + "TARGET_HARD_FLOAT && TARGET_64BIT && TARGET_DOUBLE_FLOAT" +{ + rtx reg1 = gen_reg_rtx (DFmode); + rtx reg2 = gen_reg_rtx (DFmode); + rtx reg3 = gen_reg_rtx (DImode); + rtx label1 = gen_label_rtx (); + rtx label2 = gen_label_rtx (); + REAL_VALUE_TYPE offset; + + real_2expN (&offset, 63); + + emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, DFmode)); + do_pending_stack_adjust (); + + emit_insn (gen_cmpdf (operands[1], reg1)); + emit_jump_insn (gen_bge (label1)); + + emit_insn (gen_fix_truncdfdi2 (operands[0], operands[1])); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); + emit_barrier (); + + emit_label (label1); + emit_move_insn (reg2, gen_rtx_MINUS (DFmode, operands[1], reg1)); + emit_move_insn (reg3, GEN_INT (BITMASK_HIGH)); + emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32))); + + emit_insn (gen_fix_truncdfdi2 (operands[0], reg2)); + emit_insn (gen_iordi3 (operands[0], operands[0], reg3)); + + emit_label (label2); + + /* Allow REG_NOTES to be set on last insn (labels don't have enough + fields, and can't be used for REG_NOTES anyway). */ + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + DONE; +}) + + +(define_expand "fixuns_truncsfsi2" + [(set (match_operand:SI 0 "register_operand") + (unsigned_fix:SI (match_operand:SF 1 "register_operand")))] + "TARGET_HARD_FLOAT" +{ + rtx reg1 = gen_reg_rtx (SFmode); + rtx reg2 = gen_reg_rtx (SFmode); + rtx reg3 = gen_reg_rtx (SImode); + rtx label1 = gen_label_rtx (); + rtx label2 = gen_label_rtx (); + REAL_VALUE_TYPE offset; + + real_2expN (&offset, 31); + + emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode)); + do_pending_stack_adjust (); + + emit_insn (gen_cmpsf (operands[1], reg1)); + emit_jump_insn (gen_bge (label1)); + + emit_insn (gen_fix_truncsfsi2 (operands[0], operands[1])); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); + emit_barrier (); + + emit_label (label1); + emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1)); + emit_move_insn (reg3, GEN_INT (trunc_int_for_mode + (BITMASK_HIGH, SImode))); + + emit_insn (gen_fix_truncsfsi2 (operands[0], reg2)); + emit_insn (gen_iorsi3 (operands[0], operands[0], reg3)); + + emit_label (label2); + + /* Allow REG_NOTES to be set on last insn (labels don't have enough + fields, and can't be used for REG_NOTES anyway). */ + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + DONE; +}) + + +(define_expand "fixuns_truncsfdi2" + [(set (match_operand:DI 0 "register_operand") + (unsigned_fix:DI (match_operand:SF 1 "register_operand")))] + "TARGET_HARD_FLOAT && TARGET_64BIT && TARGET_DOUBLE_FLOAT" +{ + rtx reg1 = gen_reg_rtx (SFmode); + rtx reg2 = gen_reg_rtx (SFmode); + rtx reg3 = gen_reg_rtx (DImode); + rtx label1 = gen_label_rtx (); + rtx label2 = gen_label_rtx (); + REAL_VALUE_TYPE offset; + + real_2expN (&offset, 63); + + emit_move_insn (reg1, CONST_DOUBLE_FROM_REAL_VALUE (offset, SFmode)); + do_pending_stack_adjust (); + + emit_insn (gen_cmpsf (operands[1], reg1)); + emit_jump_insn (gen_bge (label1)); + + emit_insn (gen_fix_truncsfdi2 (operands[0], operands[1])); + emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, label2))); + emit_barrier (); + + emit_label (label1); + emit_move_insn (reg2, gen_rtx_MINUS (SFmode, operands[1], reg1)); + emit_move_insn (reg3, GEN_INT (BITMASK_HIGH)); + emit_insn (gen_ashldi3 (reg3, reg3, GEN_INT (32))); + + emit_insn (gen_fix_truncsfdi2 (operands[0], reg2)); + emit_insn (gen_iordi3 (operands[0], operands[0], reg3)); + + emit_label (label2); + + /* Allow REG_NOTES to be set on last insn (labels don't have enough + fields, and can't be used for REG_NOTES anyway). */ + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + DONE; +}) + +;; +;; .................... +;; +;; DATA MOVEMENT +;; +;; .................... + +;; Bit field extract patterns which use lwl/lwr or ldl/ldr. + +(define_expand "extv" + [(set (match_operand 0 "register_operand") + (sign_extract (match_operand:QI 1 "memory_operand") + (match_operand 2 "immediate_operand") + (match_operand 3 "immediate_operand")))] + "!TARGET_MIPS16" +{ + if (mips_expand_unaligned_load (operands[0], operands[1], + INTVAL (operands[2]), + INTVAL (operands[3]))) + DONE; + else + FAIL; +}) + +(define_expand "extzv" + [(set (match_operand 0 "register_operand") + (zero_extract (match_operand 1 "nonimmediate_operand") + (match_operand 2 "immediate_operand") + (match_operand 3 "immediate_operand")))] + "!TARGET_MIPS16" +{ + if (mips_expand_unaligned_load (operands[0], operands[1], + INTVAL (operands[2]), + INTVAL (operands[3]))) + DONE; + else if (mips_use_ins_ext_p (operands[1], operands[2], operands[3])) + { + if (GET_MODE (operands[0]) == DImode) + emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], + operands[3])); + else + emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], + operands[3])); + DONE; + } + else + FAIL; +}) + +(define_insn "extzv" + [(set (match_operand:GPR 0 "register_operand" "=d") + (zero_extract:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:SI 2 "immediate_operand" "I") + (match_operand:SI 3 "immediate_operand" "I")))] + "mips_use_ins_ext_p (operands[1], operands[2], operands[3])" + "ext\t%0,%1,%3,%2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + + +(define_expand "insv" + [(set (zero_extract (match_operand 0 "nonimmediate_operand") + (match_operand 1 "immediate_operand") + (match_operand 2 "immediate_operand")) + (match_operand 3 "reg_or_0_operand"))] + "!TARGET_MIPS16" +{ + if (mips_expand_unaligned_store (operands[0], operands[3], + INTVAL (operands[1]), + INTVAL (operands[2]))) + DONE; + else if (mips_use_ins_ext_p (operands[0], operands[1], operands[2])) + { + if (GET_MODE (operands[0]) == DImode) + emit_insn (gen_insvdi (operands[0], operands[1], operands[2], + operands[3])); + else + emit_insn (gen_insvsi (operands[0], operands[1], operands[2], + operands[3])); + DONE; + } + else + FAIL; +}) + +(define_insn "insv" + [(set (zero_extract:GPR (match_operand:GPR 0 "register_operand" "+d") + (match_operand:SI 1 "immediate_operand" "I") + (match_operand:SI 2 "immediate_operand" "I")) + (match_operand:GPR 3 "reg_or_0_operand" "dJ"))] + "mips_use_ins_ext_p (operands[0], operands[1], operands[2])" + "ins\t%0,%z3,%2,%1" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +;; Unaligned word moves generated by the bit field patterns. +;; +;; As far as the rtl is concerned, both the left-part and right-part +;; instructions can access the whole field. However, the real operand +;; refers to just the first or the last byte (depending on endianness). +;; We therefore use two memory operands to each instruction, one to +;; describe the rtl effect and one to use in the assembly output. +;; +;; Operands 0 and 1 are the rtl-level target and source respectively. +;; This allows us to use the standard length calculations for the "load" +;; and "store" type attributes. + +(define_insn "mov_l" + [(set (match_operand:GPR 0 "register_operand" "=d") + (unspec:GPR [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m")] + UNSPEC_LOAD_LEFT))] + "!TARGET_MIPS16 && mips_mem_fits_mode_p (mode, operands[1])" + "l\t%0,%2" + [(set_attr "type" "load") + (set_attr "mode" "")]) + +(define_insn "mov_r" + [(set (match_operand:GPR 0 "register_operand" "=d") + (unspec:GPR [(match_operand:BLK 1 "memory_operand" "m") + (match_operand:QI 2 "memory_operand" "m") + (match_operand:GPR 3 "register_operand" "0")] + UNSPEC_LOAD_RIGHT))] + "!TARGET_MIPS16 && mips_mem_fits_mode_p (mode, operands[1])" + "r\t%0,%2" + [(set_attr "type" "load") + (set_attr "mode" "")]) + +(define_insn "mov_l" + [(set (match_operand:BLK 0 "memory_operand" "=m") + (unspec:BLK [(match_operand:GPR 1 "reg_or_0_operand" "dJ") + (match_operand:QI 2 "memory_operand" "m")] + UNSPEC_STORE_LEFT))] + "!TARGET_MIPS16 && mips_mem_fits_mode_p (mode, operands[0])" + "l\t%z1,%2" + [(set_attr "type" "store") + (set_attr "mode" "")]) + +(define_insn "mov_r" + [(set (match_operand:BLK 0 "memory_operand" "+m") + (unspec:BLK [(match_operand:GPR 1 "reg_or_0_operand" "dJ") + (match_operand:QI 2 "memory_operand" "m") + (match_dup 0)] + UNSPEC_STORE_RIGHT))] + "!TARGET_MIPS16 && mips_mem_fits_mode_p (mode, operands[0])" + "r\t%z1,%2" + [(set_attr "type" "store") + (set_attr "mode" "")]) + +;; An instruction to calculate the high part of a 64-bit SYMBOL_GENERAL. +;; The required value is: +;; +;; (%highest(op1) << 48) + (%higher(op1) << 32) + (%hi(op1) << 16) +;; +;; which translates to: +;; +;; lui op0,%highest(op1) +;; daddiu op0,op0,%higher(op1) +;; dsll op0,op0,16 +;; daddiu op0,op0,%hi(op1) +;; dsll op0,op0,16 +;; +;; The split is deferred until after flow2 to allow the peephole2 below +;; to take effect. +(define_insn_and_split "*lea_high64" + [(set (match_operand:DI 0 "register_operand" "=d") + (high:DI (match_operand:DI 1 "general_symbolic_operand" "")))] + "TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS" + "#" + "&& flow2_completed" + [(set (match_dup 0) (high:DI (match_dup 2))) + (set (match_dup 0) (lo_sum:DI (match_dup 0) (match_dup 2))) + (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 16))) + (set (match_dup 0) (lo_sum:DI (match_dup 0) (match_dup 3))) + (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 16)))] +{ + operands[2] = mips_unspec_address (operands[1], SYMBOL_64_HIGH); + operands[3] = mips_unspec_address (operands[1], SYMBOL_64_MID); +} + [(set_attr "length" "20")]) + +;; Use a scratch register to reduce the latency of the above pattern +;; on superscalar machines. The optimized sequence is: +;; +;; lui op1,%highest(op2) +;; lui op0,%hi(op2) +;; daddiu op1,op1,%higher(op2) +;; dsll32 op1,op1,0 +;; daddu op1,op1,op0 +(define_peephole2 + [(set (match_operand:DI 1 "register_operand") + (high:DI (match_operand:DI 2 "general_symbolic_operand"))) + (match_scratch:DI 0 "d")] + "TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS" + [(set (match_dup 1) (high:DI (match_dup 3))) + (set (match_dup 0) (high:DI (match_dup 4))) + (set (match_dup 1) (lo_sum:DI (match_dup 1) (match_dup 3))) + (set (match_dup 1) (ashift:DI (match_dup 1) (const_int 32))) + (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 0)))] +{ + operands[3] = mips_unspec_address (operands[2], SYMBOL_64_HIGH); + operands[4] = mips_unspec_address (operands[2], SYMBOL_64_LOW); +}) + +;; On most targets, the expansion of (lo_sum (high X) X) for a 64-bit +;; SYMBOL_GENERAL X will take 6 cycles. This next pattern allows combine +;; to merge the HIGH and LO_SUM parts of a move if the HIGH part is only +;; used once. We can then use the sequence: +;; +;; lui op0,%highest(op1) +;; lui op2,%hi(op1) +;; daddiu op0,op0,%higher(op1) +;; daddiu op2,op2,%lo(op1) +;; dsll32 op0,op0,0 +;; daddu op0,op0,op2 +;; +;; which takes 4 cycles on most superscalar targets. +(define_insn_and_split "*lea64" + [(set (match_operand:DI 0 "register_operand" "=d") + (match_operand:DI 1 "general_symbolic_operand" "")) + (clobber (match_scratch:DI 2 "=&d"))] + "TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS && cse_not_expected" + "#" + "&& reload_completed" + [(set (match_dup 0) (high:DI (match_dup 3))) + (set (match_dup 2) (high:DI (match_dup 4))) + (set (match_dup 0) (lo_sum:DI (match_dup 0) (match_dup 3))) + (set (match_dup 2) (lo_sum:DI (match_dup 2) (match_dup 4))) + (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 32))) + (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))] +{ + operands[3] = mips_unspec_address (operands[1], SYMBOL_64_HIGH); + operands[4] = mips_unspec_address (operands[1], SYMBOL_64_LOW); +} + [(set_attr "length" "24")]) + +;; Insns to fetch a global symbol from a big GOT. + +(define_insn_and_split "*xgot_hi" + [(set (match_operand:P 0 "register_operand" "=d") + (high:P (match_operand:P 1 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) (high:P (match_dup 2))) + (set (match_dup 0) (plus:P (match_dup 0) (match_dup 3)))] +{ + operands[2] = mips_unspec_address (operands[1], SYMBOL_GOTOFF_GLOBAL); + operands[3] = pic_offset_table_rtx; +} + [(set_attr "got" "xgot_high") + (set_attr "mode" "")]) + +(define_insn_and_split "*xgot_lo" + [(set (match_operand:P 0 "register_operand" "=d") + (lo_sum:P (match_operand:P 1 "register_operand" "d") + (match_operand:P 2 "global_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS && TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) + (unspec:P [(match_dup 1) (match_dup 3)] UNSPEC_LOAD_GOT))] + { operands[3] = mips_unspec_address (operands[2], SYMBOL_GOTOFF_GLOBAL); } + [(set_attr "got" "load") + (set_attr "mode" "")]) + +;; Insns to fetch a global symbol from a normal GOT. + +(define_insn_and_split "*got_disp" + [(set (match_operand:P 0 "register_operand" "=d") + (match_operand:P 1 "global_got_operand" ""))] + "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT" + "#" + "&& reload_completed" + [(set (match_dup 0) + (unspec:P [(match_dup 2) (match_dup 3)] UNSPEC_LOAD_GOT))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = mips_unspec_address (operands[1], SYMBOL_GOTOFF_GLOBAL); +} + [(set_attr "got" "load") + (set_attr "mode" "")]) + +;; Insns for loading the high part of a local symbol. + +(define_insn_and_split "*got_page" + [(set (match_operand:P 0 "register_operand" "=d") + (high:P (match_operand:P 1 "local_got_operand" "")))] + "TARGET_EXPLICIT_RELOCS" + "#" + "&& reload_completed" + [(set (match_dup 0) + (unspec:P [(match_dup 2) (match_dup 3)] UNSPEC_LOAD_GOT))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = mips_unspec_address (operands[1], SYMBOL_GOTOFF_PAGE); +} + [(set_attr "got" "load") + (set_attr "mode" "")]) + +;; Lower-level instructions for loading an address from the GOT. +;; We could use MEMs, but an unspec gives more optimization +;; opportunities. + +(define_insn "load_got" + [(set (match_operand:P 0 "register_operand" "=d") + (unspec:P [(match_operand:P 1 "register_operand" "d") + (match_operand:P 2 "immediate_operand" "")] + UNSPEC_LOAD_GOT))] + "" + "\t%0,%R2(%1)" + [(set_attr "type" "load") + (set_attr "mode" "") + (set_attr "length" "4")]) + +;; Instructions for adding the low 16 bits of an address to a register. +;; Operand 2 is the address: print_operand works out which relocation +;; should be applied. + +(define_insn "*low" + [(set (match_operand:P 0 "register_operand" "=d") + (lo_sum:P (match_operand:P 1 "register_operand" "d") + (match_operand:P 2 "immediate_operand" "")))] + "!TARGET_MIPS16" + "addiu\t%0,%1,%R2" + [(set_attr "type" "arith") + (set_attr "mode" "")]) + +(define_insn "*low_mips16" + [(set (match_operand:P 0 "register_operand" "=d") + (lo_sum:P (match_operand:P 1 "register_operand" "0") + (match_operand:P 2 "immediate_operand" "")))] + "TARGET_MIPS16" + "addiu\t%0,%R2" + [(set_attr "type" "arith") + (set_attr "mode" "") + (set_attr "length" "8")]) + +;; Allow combine to split complex const_int load sequences, using operand 2 +;; to store the intermediate results. See move_operand for details. +(define_split + [(set (match_operand:GPR 0 "register_operand") + (match_operand:GPR 1 "splittable_const_int_operand")) + (clobber (match_operand:GPR 2 "register_operand"))] + "" + [(const_int 0)] +{ + mips_move_integer (operands[0], operands[2], INTVAL (operands[1])); + DONE; +}) + +;; Likewise, for symbolic operands. +(define_split + [(set (match_operand:P 0 "register_operand") + (match_operand:P 1 "splittable_symbolic_operand")) + (clobber (match_operand:P 2 "register_operand"))] + "" + [(set (match_dup 0) (match_dup 1))] + { operands[1] = mips_split_symbol (operands[2], operands[1]); }) + +;; 64-bit integer moves + +;; Unlike most other insns, the move insns can't be split with +;; different predicates, because register spilling and other parts of +;; the compiler, have memoized the insn number already. + +(define_expand "movdi" + [(set (match_operand:DI 0 "") + (match_operand:DI 1 ""))] + "" +{ + if (mips_legitimize_move (DImode, operands[0], operands[1])) + DONE; +}) + +;; For mips16, we need a special case to handle storing $31 into +;; memory, since we don't have a constraint to match $31. This +;; instruction can be generated by save_restore_insns. + +(define_insn "*mov_ra" + [(set (match_operand:GPR 0 "stack_operand" "=m") + (reg:GPR 31))] + "TARGET_MIPS16" + "\t$31,%0" + [(set_attr "type" "store") + (set_attr "mode" "")]) + +(define_insn "*movdi_32bit" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,*a,*d,*B*C*D,*B*C*D,*d,*m") + (match_operand:DI 1 "move_operand" "d,i,m,d,*J*d,*a,*d,*m,*B*C*D,*B*C*D"))] + "!TARGET_64BIT && !TARGET_MIPS16 + && (register_operand (operands[0], DImode) + || reg_or_0_operand (operands[1], DImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,load,store,mthilo,mfhilo,xfer,load,xfer,store") + (set_attr "mode" "DI") + (set_attr "length" "8,16,*,*,8,8,8,*,8,*")]) + +(define_insn "*movdi_32bit_mips16" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,y,d,d,d,d,m,*d") + (match_operand:DI 1 "move_operand" "d,d,y,K,N,m,d,*x"))] + "!TARGET_64BIT && TARGET_MIPS16 + && (register_operand (operands[0], DImode) + || register_operand (operands[1], DImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,arith,arith,arith,load,store,mfhilo") + (set_attr "mode" "DI") + (set_attr "length" "8,8,8,8,12,*,*,8")]) + +(define_insn "*movdi_64bit" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*x,*B*C*D,*B*C*D,*d,*m") + (match_operand:DI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*J*d,*d,*m,*B*C*D,*B*C*D"))] + "TARGET_64BIT && !TARGET_MIPS16 + && (register_operand (operands[0], DImode) + || reg_or_0_operand (operands[1], DImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,const,const,load,store,fmove,xfer,fpload,xfer,fpstore,mthilo,xfer,load,xfer,store") + (set_attr "mode" "DI") + (set_attr "length" "4,*,*,*,*,4,4,*,4,*,4,8,*,8,*")]) + +(define_insn "*movdi_64bit_mips16" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,y,d,d,d,d,d,m") + (match_operand:DI 1 "move_operand" "d,d,y,K,N,U,m,d"))] + "TARGET_64BIT && TARGET_MIPS16 + && (register_operand (operands[0], DImode) + || register_operand (operands[1], DImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,arith,arith,arith,const,load,store") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) + (const_int 4) + (const_int 4) + (if_then_else (match_operand:VOID 1 "m16_uimm8_1") + (const_int 4) + (const_int 8)) + (if_then_else (match_operand:VOID 1 "m16_nuimm8_1") + (const_int 8) + (const_int 12)) + (const_string "*") + (const_string "*") + (const_string "*")])]) + + +;; On the mips16, we can split ld $r,N($r) into an add and a load, +;; when the original load is a 4 byte instruction but the add and the +;; load are 2 2 byte instructions. + +(define_split + [(set (match_operand:DI 0 "register_operand") + (mem:DI (plus:DI (match_dup 0) + (match_operand:DI 1 "const_int_operand"))))] + "TARGET_64BIT && TARGET_MIPS16 && reload_completed + && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) < 0 + && INTVAL (operands[1]) >= -0x10) + || (INTVAL (operands[1]) >= 32 * 8 + && INTVAL (operands[1]) <= 31 * 8 + 0x8) + || (INTVAL (operands[1]) >= 0 + && INTVAL (operands[1]) < 32 * 8 + && (INTVAL (operands[1]) & 7) != 0))" + [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (mem:DI (plus:DI (match_dup 0) (match_dup 2))))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val < 0) + operands[2] = const0_rtx; + else if (val >= 32 * 8) + { + int off = val & 7; + + operands[1] = GEN_INT (0x8 + off); + operands[2] = GEN_INT (val - off - 0x8); + } + else + { + int off = val & 7; + + operands[1] = GEN_INT (off); + operands[2] = GEN_INT (val - off); + } +}) + +;; 32-bit Integer moves + +;; Unlike most other insns, the move insns can't be split with +;; different predicates, because register spilling and other parts of +;; the compiler, have memoized the insn number already. + +(define_expand "movsi" + [(set (match_operand:SI 0 "") + (match_operand:SI 1 ""))] + "" +{ + if (mips_legitimize_move (SImode, operands[0], operands[1])) + DONE; +}) + +;; The difference between these two is whether or not ints are allowed +;; in FP registers (off by default, use -mdebugh to enable). + +(define_insn "*movsi_internal" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,e,d,m,*f,*f,*f,*d,*m,*d,*z,*a,*d,*B*C*D,*B*C*D,*d,*m") + (match_operand:SI 1 "move_operand" "d,U,T,m,dJ,*f,*d*J,*m,*f,*f,*z,*d,*J*d,*A,*d,*m,*B*C*D,*B*C*D"))] + "!TARGET_MIPS16 + && (register_operand (operands[0], SImode) + || reg_or_0_operand (operands[1], SImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,const,const,load,store,fmove,xfer,fpload,xfer,fpstore,xfer,xfer,mthilo,mfhilo,xfer,load,xfer,store") + (set_attr "mode" "SI") + (set_attr "length" "4,*,*,*,*,4,4,*,4,*,4,4,4,4,4,*,4,*")]) + +(define_insn "*movsi_mips16" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,y,d,d,d,d,d,m") + (match_operand:SI 1 "move_operand" "d,d,y,K,N,U,m,d"))] + "TARGET_MIPS16 + && (register_operand (operands[0], SImode) + || register_operand (operands[1], SImode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,arith,arith,arith,const,load,store") + (set_attr "mode" "SI") + (set_attr_alternative "length" + [(const_int 4) + (const_int 4) + (const_int 4) + (if_then_else (match_operand:VOID 1 "m16_uimm8_1") + (const_int 4) + (const_int 8)) + (if_then_else (match_operand:VOID 1 "m16_nuimm8_1") + (const_int 8) + (const_int 12)) + (const_string "*") + (const_string "*") + (const_string "*")])]) + +;; On the mips16, we can split lw $r,N($r) into an add and a load, +;; when the original load is a 4 byte instruction but the add and the +;; load are 2 2 byte instructions. + +(define_split + [(set (match_operand:SI 0 "register_operand") + (mem:SI (plus:SI (match_dup 0) + (match_operand:SI 1 "const_int_operand"))))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) < 0 + && INTVAL (operands[1]) >= -0x80) + || (INTVAL (operands[1]) >= 32 * 4 + && INTVAL (operands[1]) <= 31 * 4 + 0x7c) + || (INTVAL (operands[1]) >= 0 + && INTVAL (operands[1]) < 32 * 4 + && (INTVAL (operands[1]) & 3) != 0))" + [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (mem:SI (plus:SI (match_dup 0) (match_dup 2))))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val < 0) + operands[2] = const0_rtx; + else if (val >= 32 * 4) + { + int off = val & 3; + + operands[1] = GEN_INT (0x7c + off); + operands[2] = GEN_INT (val - off - 0x7c); + } + else + { + int off = val & 3; + + operands[1] = GEN_INT (off); + operands[2] = GEN_INT (val - off); + } +}) + +;; On the mips16, we can split a load of certain constants into a load +;; and an add. This turns a 4 byte instruction into 2 2 byte +;; instructions. + +(define_split + [(set (match_operand:SI 0 "register_operand") + (match_operand:SI 1 "const_int_operand"))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && INTVAL (operands[1]) >= 0x100 + && INTVAL (operands[1]) <= 0xff + 0x7f" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))] +{ + int val = INTVAL (operands[1]); + + operands[1] = GEN_INT (0xff); + operands[2] = GEN_INT (val - 0xff); +}) + +;; This insn handles moving CCmode values. It's really just a +;; slightly simplified copy of movsi_internal2, with additional cases +;; to move a condition register to a general register and to move +;; between the general registers and the floating point registers. + +(define_insn "movcc" + [(set (match_operand:CC 0 "nonimmediate_operand" "=d,*d,*d,*m,*d,*f,*f,*f,*m") + (match_operand:CC 1 "general_operand" "z,*d,*m,*d,*f,*d,*f,*m,*f"))] + "ISA_HAS_8CC && TARGET_HARD_FLOAT" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "xfer,arith,load,store,xfer,xfer,fmove,fpload,fpstore") + (set_attr "mode" "SI") + (set_attr "length" "8,4,*,*,4,4,4,*,*")]) + +;; Reload condition code registers. reload_incc and reload_outcc +;; both handle moves from arbitrary operands into condition code +;; registers. reload_incc handles the more common case in which +;; a source operand is constrained to be in a condition-code +;; register, but has not been allocated to one. +;; +;; Sometimes, such as in movcc, we have a CCmode destination whose +;; constraints do not include 'z'. reload_outcc handles the case +;; when such an operand is allocated to a condition-code register. +;; +;; Note that reloads from a condition code register to some +;; other location can be done using ordinary moves. Moving +;; into a GPR takes a single movcc, moving elsewhere takes +;; two. We can leave these cases to the generic reload code. +(define_expand "reload_incc" + [(set (match_operand:CC 0 "fcc_reload_operand" "=z") + (match_operand:CC 1 "general_operand" "")) + (clobber (match_operand:TF 2 "register_operand" "=&f"))] + "ISA_HAS_8CC && TARGET_HARD_FLOAT" +{ + mips_emit_fcc_reload (operands[0], operands[1], operands[2]); + DONE; +}) + +(define_expand "reload_outcc" + [(set (match_operand:CC 0 "fcc_reload_operand" "=z") + (match_operand:CC 1 "register_operand" "")) + (clobber (match_operand:TF 2 "register_operand" "=&f"))] + "ISA_HAS_8CC && TARGET_HARD_FLOAT" +{ + mips_emit_fcc_reload (operands[0], operands[1], operands[2]); + DONE; +}) + +;; MIPS4 supports loading and storing a floating point register from +;; the sum of two general registers. We use two versions for each of +;; these four instructions: one where the two general registers are +;; SImode, and one where they are DImode. This is because general +;; registers will be in SImode when they hold 32 bit values, but, +;; since the 32 bit values are always sign extended, the [ls][wd]xc1 +;; instructions will still work correctly. + +;; ??? Perhaps it would be better to support these instructions by +;; modifying GO_IF_LEGITIMATE_ADDRESS and friends. However, since +;; these instructions can only be used to load and store floating +;; point registers, that would probably cause trouble in reload. + +(define_insn "*_" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (mem:ANYF (plus:P (match_operand:P 1 "register_operand" "d") + (match_operand:P 2 "register_operand" "d"))))] + "ISA_HAS_FP4" + "\t%0,%1(%2)" + [(set_attr "type" "fpidxload") + (set_attr "mode" "")]) + +(define_insn "*_" + [(set (mem:ANYF (plus:P (match_operand:P 1 "register_operand" "d") + (match_operand:P 2 "register_operand" "d"))) + (match_operand:ANYF 0 "register_operand" "f"))] + "ISA_HAS_FP4" + "\t%0,%1(%2)" + [(set_attr "type" "fpidxstore") + (set_attr "mode" "")]) + +;; 16-bit Integer moves + +;; Unlike most other insns, the move insns can't be split with +;; different predicates, because register spilling and other parts of +;; the compiler, have memoized the insn number already. +;; Unsigned loads are used because LOAD_EXTEND_OP returns ZERO_EXTEND. + +(define_expand "movhi" + [(set (match_operand:HI 0 "") + (match_operand:HI 1 ""))] + "" +{ + if (mips_legitimize_move (HImode, operands[0], operands[1])) + DONE; +}) + +(define_insn "*movhi_internal" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m,*d,*f,*f,*x") + (match_operand:HI 1 "move_operand" "d,I,m,dJ,*f,*d,*f,*d"))] + "!TARGET_MIPS16 + && (register_operand (operands[0], HImode) + || reg_or_0_operand (operands[1], HImode))" + "@ + move\t%0,%1 + li\t%0,%1 + lhu\t%0,%1 + sh\t%z1,%0 + mfc1\t%0,%1 + mtc1\t%1,%0 + mov.s\t%0,%1 + mt%0\t%1" + [(set_attr "type" "arith,arith,load,store,xfer,xfer,fmove,mthilo") + (set_attr "mode" "HI") + (set_attr "length" "4,4,*,*,4,4,4,4")]) + +(define_insn "*movhi_mips16" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,y,d,d,d,d,m") + (match_operand:HI 1 "move_operand" "d,d,y,K,N,m,d"))] + "TARGET_MIPS16 + && (register_operand (operands[0], HImode) + || register_operand (operands[1], HImode))" + "@ + move\t%0,%1 + move\t%0,%1 + move\t%0,%1 + li\t%0,%1 + # + lhu\t%0,%1 + sh\t%1,%0" + [(set_attr "type" "arith,arith,arith,arith,arith,load,store") + (set_attr "mode" "HI") + (set_attr_alternative "length" + [(const_int 4) + (const_int 4) + (const_int 4) + (if_then_else (match_operand:VOID 1 "m16_uimm8_1") + (const_int 4) + (const_int 8)) + (if_then_else (match_operand:VOID 1 "m16_nuimm8_1") + (const_int 8) + (const_int 12)) + (const_string "*") + (const_string "*")])]) + + +;; On the mips16, we can split lh $r,N($r) into an add and a load, +;; when the original load is a 4 byte instruction but the add and the +;; load are 2 2 byte instructions. + +(define_split + [(set (match_operand:HI 0 "register_operand") + (mem:HI (plus:SI (match_dup 0) + (match_operand:SI 1 "const_int_operand"))))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) < 0 + && INTVAL (operands[1]) >= -0x80) + || (INTVAL (operands[1]) >= 32 * 2 + && INTVAL (operands[1]) <= 31 * 2 + 0x7e) + || (INTVAL (operands[1]) >= 0 + && INTVAL (operands[1]) < 32 * 2 + && (INTVAL (operands[1]) & 1) != 0))" + [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (mem:HI (plus:SI (match_dup 0) (match_dup 2))))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val < 0) + operands[2] = const0_rtx; + else if (val >= 32 * 2) + { + int off = val & 1; + + operands[1] = GEN_INT (0x7e + off); + operands[2] = GEN_INT (val - off - 0x7e); + } + else + { + int off = val & 1; + + operands[1] = GEN_INT (off); + operands[2] = GEN_INT (val - off); + } +}) + +;; 8-bit Integer moves + +;; Unlike most other insns, the move insns can't be split with +;; different predicates, because register spilling and other parts of +;; the compiler, have memoized the insn number already. +;; Unsigned loads are used because LOAD_EXTEND_OP returns ZERO_EXTEND. + +(define_expand "movqi" + [(set (match_operand:QI 0 "") + (match_operand:QI 1 ""))] + "" +{ + if (mips_legitimize_move (QImode, operands[0], operands[1])) + DONE; +}) + +(define_insn "*movqi_internal" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,*d,*f,*f,*x") + (match_operand:QI 1 "move_operand" "d,I,m,dJ,*f,*d,*f,*d"))] + "!TARGET_MIPS16 + && (register_operand (operands[0], QImode) + || reg_or_0_operand (operands[1], QImode))" + "@ + move\t%0,%1 + li\t%0,%1 + lbu\t%0,%1 + sb\t%z1,%0 + mfc1\t%0,%1 + mtc1\t%1,%0 + mov.s\t%0,%1 + mt%0\t%1" + [(set_attr "type" "arith,arith,load,store,xfer,xfer,fmove,mthilo") + (set_attr "mode" "QI") + (set_attr "length" "4,4,*,*,4,4,4,4")]) + +(define_insn "*movqi_mips16" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,y,d,d,d,d,m") + (match_operand:QI 1 "move_operand" "d,d,y,K,N,m,d"))] + "TARGET_MIPS16 + && (register_operand (operands[0], QImode) + || register_operand (operands[1], QImode))" + "@ + move\t%0,%1 + move\t%0,%1 + move\t%0,%1 + li\t%0,%1 + # + lbu\t%0,%1 + sb\t%1,%0" + [(set_attr "type" "arith,arith,arith,arith,arith,load,store") + (set_attr "mode" "QI") + (set_attr "length" "4,4,4,4,8,*,*")]) + +;; On the mips16, we can split lb $r,N($r) into an add and a load, +;; when the original load is a 4 byte instruction but the add and the +;; load are 2 2 byte instructions. + +(define_split + [(set (match_operand:QI 0 "register_operand") + (mem:QI (plus:SI (match_dup 0) + (match_operand:SI 1 "const_int_operand"))))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && REG_P (operands[0]) + && M16_REG_P (REGNO (operands[0])) + && GET_CODE (operands[1]) == CONST_INT + && ((INTVAL (operands[1]) < 0 + && INTVAL (operands[1]) >= -0x80) + || (INTVAL (operands[1]) >= 32 + && INTVAL (operands[1]) <= 31 + 0x7f))" + [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1))) + (set (match_dup 0) (mem:QI (plus:SI (match_dup 0) (match_dup 2))))] +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + + if (val < 0) + operands[2] = const0_rtx; + else + { + operands[1] = GEN_INT (0x7f); + operands[2] = GEN_INT (val - 0x7f); + } +}) + +;; 32-bit floating point moves + +(define_expand "movsf" + [(set (match_operand:SF 0 "") + (match_operand:SF 1 ""))] + "" +{ + if (mips_legitimize_move (SFmode, operands[0], operands[1])) + DONE; +}) + +(define_insn "*movsf_hardfloat" + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,m,m,*f,*d,*d,*d,*m") + (match_operand:SF 1 "move_operand" "f,G,m,f,G,*d,*f,*G*d,*m,*d"))] + "TARGET_HARD_FLOAT + && (register_operand (operands[0], SFmode) + || reg_or_0_operand (operands[1], SFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "fmove,xfer,fpload,fpstore,store,xfer,xfer,arith,load,store") + (set_attr "mode" "SF") + (set_attr "length" "4,4,*,*,*,4,4,4,*,*")]) + +(define_insn "*movsf_softfloat" + [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,m") + (match_operand:SF 1 "move_operand" "Gd,m,d"))] + "TARGET_SOFT_FLOAT && !TARGET_MIPS16 + && (register_operand (operands[0], SFmode) + || reg_or_0_operand (operands[1], SFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,load,store") + (set_attr "mode" "SF") + (set_attr "length" "4,*,*")]) + +(define_insn "*movsf_mips16" + [(set (match_operand:SF 0 "nonimmediate_operand" "=d,y,d,d,m") + (match_operand:SF 1 "move_operand" "d,d,y,m,d"))] + "TARGET_MIPS16 + && (register_operand (operands[0], SFmode) + || register_operand (operands[1], SFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,arith,load,store") + (set_attr "mode" "SF") + (set_attr "length" "4,4,4,*,*")]) + + +;; 64-bit floating point moves + +(define_expand "movdf" + [(set (match_operand:DF 0 "") + (match_operand:DF 1 ""))] + "" +{ + if (mips_legitimize_move (DFmode, operands[0], operands[1])) + DONE; +}) + +(define_insn "*movdf_hardfloat_64bit" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,m,*f,*d,*d,*d,*m") + (match_operand:DF 1 "move_operand" "f,G,m,f,G,*d,*f,*d*G,*m,*d"))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && TARGET_64BIT + && (register_operand (operands[0], DFmode) + || reg_or_0_operand (operands[1], DFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "fmove,xfer,fpload,fpstore,store,xfer,xfer,arith,load,store") + (set_attr "mode" "DF") + (set_attr "length" "4,4,*,*,*,4,4,4,*,*")]) + +(define_insn "*movdf_hardfloat_32bit" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,m,*f,*d,*d,*d,*m") + (match_operand:DF 1 "move_operand" "f,G,m,f,G,*d,*f,*d*G,*m,*d"))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT + && (register_operand (operands[0], DFmode) + || reg_or_0_operand (operands[1], DFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "fmove,xfer,fpload,fpstore,store,xfer,xfer,arith,load,store") + (set_attr "mode" "DF") + (set_attr "length" "4,8,*,*,*,8,8,8,*,*")]) + +(define_insn "*movdf_softfloat" + [(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,m,d,f,f") + (match_operand:DF 1 "move_operand" "dG,m,dG,f,d,f"))] + "(TARGET_SOFT_FLOAT || TARGET_SINGLE_FLOAT) && !TARGET_MIPS16 + && (register_operand (operands[0], DFmode) + || reg_or_0_operand (operands[1], DFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,load,store,xfer,xfer,fmove") + (set_attr "mode" "DF") + (set_attr "length" "8,*,*,4,4,4")]) + +(define_insn "*movdf_mips16" + [(set (match_operand:DF 0 "nonimmediate_operand" "=d,y,d,d,m") + (match_operand:DF 1 "move_operand" "d,d,y,m,d"))] + "TARGET_MIPS16 + && (register_operand (operands[0], DFmode) + || register_operand (operands[1], DFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "arith,arith,arith,load,store") + (set_attr "mode" "DF") + (set_attr "length" "8,8,8,*,*")]) + +(define_split + [(set (match_operand:DI 0 "nonimmediate_operand") + (match_operand:DI 1 "move_operand"))] + "reload_completed && !TARGET_64BIT + && mips_split_64bit_move_p (operands[0], operands[1])" + [(const_int 0)] +{ + mips_split_64bit_move (operands[0], operands[1]); + DONE; +}) + +(define_split + [(set (match_operand:DF 0 "nonimmediate_operand") + (match_operand:DF 1 "move_operand"))] + "reload_completed && !TARGET_64BIT + && mips_split_64bit_move_p (operands[0], operands[1])" + [(const_int 0)] +{ + mips_split_64bit_move (operands[0], operands[1]); + DONE; +}) + +;; When generating mips16 code, split moves of negative constants into +;; a positive "li" followed by a negation. +(define_split + [(set (match_operand 0 "register_operand") + (match_operand 1 "const_int_operand"))] + "TARGET_MIPS16 && reload_completed && INTVAL (operands[1]) < 0" + [(set (match_dup 2) + (match_dup 3)) + (set (match_dup 2) + (neg:SI (match_dup 2)))] +{ + operands[2] = gen_lowpart (SImode, operands[0]); + operands[3] = GEN_INT (-INTVAL (operands[1])); +}) + +;; 64-bit paired-single floating point moves + +(define_expand "movv2sf" + [(set (match_operand:V2SF 0) + (match_operand:V2SF 1))] + "TARGET_PAIRED_SINGLE_FLOAT" +{ + if (mips_legitimize_move (V2SFmode, operands[0], operands[1])) + DONE; +}) + +(define_insn "movv2sf_hardfloat_64bit" + [(set (match_operand:V2SF 0 "nonimmediate_operand" "=f,f,f,m,m,*f,*d,*d,*d,*m") + (match_operand:V2SF 1 "move_operand" "f,YG,m,f,YG,*d,*f,*d*YG,*m,*d"))] + "TARGET_PAIRED_SINGLE_FLOAT + && TARGET_64BIT + && (register_operand (operands[0], V2SFmode) + || reg_or_0_operand (operands[1], V2SFmode))" + { return mips_output_move (operands[0], operands[1]); } + [(set_attr "type" "fmove,xfer,fpload,fpstore,store,xfer,xfer,arith,load,store") + (set_attr "mode" "SF") + (set_attr "length" "4,4,*,*,*,4,4,4,*,*")]) + +;; The HI and LO registers are not truly independent. If we move an mthi +;; instruction before an mflo instruction, it will make the result of the +;; mflo unpredictable. The same goes for mtlo and mfhi. +;; +;; We cope with this by making the mflo and mfhi patterns use both HI and LO. +;; Operand 1 is the register we want, operand 2 is the other one. +;; +;; When generating VR4120 or VR4130 code, we use macc{,hi} and +;; dmacc{,hi} instead of mfhi and mflo. This avoids both the normal +;; MIPS III hi/lo hazards and the errata related to -mfix-vr4130. + +(define_expand "mfhilo_" + [(set (match_operand:GPR 0 "register_operand") + (unspec:GPR [(match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "register_operand")] + UNSPEC_MFHILO))]) + +(define_insn "*mfhilo_" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (unspec:GPR [(match_operand:GPR 1 "register_operand" "h,l") + (match_operand:GPR 2 "register_operand" "l,h")] + UNSPEC_MFHILO))] + "!ISA_HAS_MACCHI" + "mf%1\t%0" + [(set_attr "type" "mfhilo") + (set_attr "mode" "")]) + +(define_insn "*mfhilo__macc" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (unspec:GPR [(match_operand:GPR 1 "register_operand" "h,l") + (match_operand:GPR 2 "register_operand" "l,h")] + UNSPEC_MFHILO))] + "ISA_HAS_MACCHI" +{ + if (REGNO (operands[1]) == HI_REGNUM) + return "macchi\t%0,%.,%."; + else + return "macc\t%0,%.,%."; +} + [(set_attr "type" "mfhilo") + (set_attr "mode" "")]) + +;; Patterns for loading or storing part of a paired floating point +;; register. We need them because odd-numbered floating-point registers +;; are not fully independent: see mips_split_64bit_move. + +;; Load the low word of operand 0 with operand 1. +(define_insn "load_df_low" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (unspec:DF [(match_operand:SI 1 "general_operand" "dJ,m")] + UNSPEC_LOAD_DF_LOW))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT" +{ + operands[0] = mips_subword (operands[0], 0); + return mips_output_move (operands[0], operands[1]); +} + [(set_attr "type" "xfer,fpload") + (set_attr "mode" "SF")]) + +;; Load the high word of operand 0 from operand 1, preserving the value +;; in the low word. +(define_insn "load_df_high" + [(set (match_operand:DF 0 "register_operand" "=f,f") + (unspec:DF [(match_operand:SI 1 "general_operand" "dJ,m") + (match_operand:DF 2 "register_operand" "0,0")] + UNSPEC_LOAD_DF_HIGH))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT" +{ + operands[0] = mips_subword (operands[0], 1); + return mips_output_move (operands[0], operands[1]); +} + [(set_attr "type" "xfer,fpload") + (set_attr "mode" "SF")]) + +;; Store the high word of operand 1 in operand 0. The corresponding +;; low-word move is done in the normal way. +(define_insn "store_df_high" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,m") + (unspec:SI [(match_operand:DF 1 "register_operand" "f,f")] + UNSPEC_STORE_DF_HIGH))] + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_64BIT" +{ + operands[1] = mips_subword (operands[1], 1); + return mips_output_move (operands[0], operands[1]); +} + [(set_attr "type" "xfer,fpstore") + (set_attr "mode" "SF")]) + +;; Insn to initialize $gp for n32/n64 abicalls. Operand 0 is the offset +;; of _gp from the start of this function. Operand 1 is the incoming +;; function address. +(define_insn_and_split "loadgp" + [(unspec_volatile [(match_operand 0 "" "") + (match_operand 1 "register_operand" "")] UNSPEC_LOADGP)] + "mips_current_loadgp_style () == LOADGP_NEWABI" + "#" + "" + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 2) (match_dup 4)) + (set (match_dup 2) (match_dup 5))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_rtx_HIGH (Pmode, operands[0]); + operands[4] = gen_rtx_PLUS (Pmode, operands[2], operands[1]); + operands[5] = gen_rtx_LO_SUM (Pmode, operands[2], operands[0]); +} + [(set_attr "length" "12")]) + +;; Likewise, for -mno-shared code. Operand 0 is the __gnu_local_gp symbol. +(define_insn_and_split "loadgp_noshared" + [(unspec_volatile [(match_operand 0 "" "")] UNSPEC_LOADGP)] + "mips_current_loadgp_style () == LOADGP_ABSOLUTE" + "#" + "" + [(const_int 0)] +{ + emit_move_insn (pic_offset_table_rtx, operands[0]); + DONE; +} + [(set_attr "length" "8")]) + +;; The use of gp is hidden when not using explicit relocations. +;; This blockage instruction prevents the gp load from being +;; scheduled after an implicit use of gp. It also prevents +;; the load from being deleted as dead. +(define_insn "loadgp_blockage" + [(unspec_volatile [(reg:DI 28)] UNSPEC_BLOCKAGE)] + "" + "" + [(set_attr "type" "unknown") + (set_attr "mode" "none") + (set_attr "length" "0")]) + +;; Emit a .cprestore directive, which normally expands to a single store +;; instruction. Note that we continue to use .cprestore for explicit reloc +;; code so that jals inside inline asms will work correctly. +(define_insn "cprestore" + [(unspec_volatile [(match_operand 0 "const_int_operand" "I,i")] + UNSPEC_CPRESTORE)] + "" +{ + if (set_nomacro && which_alternative == 1) + return ".set\tmacro\;.cprestore\t%0\;.set\tnomacro"; + else + return ".cprestore\t%0"; +} + [(set_attr "type" "store") + (set_attr "length" "4,12")]) + +;; Block moves, see mips.c for more details. +;; Argument 0 is the destination +;; Argument 1 is the source +;; Argument 2 is the length +;; Argument 3 is the alignment + +(define_expand "movmemsi" + [(parallel [(set (match_operand:BLK 0 "general_operand") + (match_operand:BLK 1 "general_operand")) + (use (match_operand:SI 2 "")) + (use (match_operand:SI 3 "const_int_operand"))])] + "!TARGET_MIPS16 && !TARGET_MEMCPY" +{ + if (mips_expand_block_move (operands[0], operands[1], operands[2])) + DONE; + else + FAIL; +}) + +;; +;; .................... +;; +;; SHIFTS +;; +;; .................... + +(define_expand "3" + [(set (match_operand:GPR 0 "register_operand") + (any_shift:GPR (match_operand:GPR 1 "register_operand") + (match_operand:SI 2 "arith_operand")))] + "" +{ + /* On the mips16, a shift of more than 8 is a four byte instruction, + so, for a shift between 8 and 16, it is just as fast to do two + shifts of 8 or less. If there is a lot of shifting going on, we + may win in CSE. Otherwise combine will put the shifts back + together again. This can be called by function_arg, so we must + be careful not to allocate a new register if we've reached the + reload pass. */ + if (TARGET_MIPS16 + && optimize + && GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) > 8 + && INTVAL (operands[2]) <= 16 + && !reload_in_progress + && !reload_completed) + { + rtx temp = gen_reg_rtx (mode); + + emit_insn (gen_3 (temp, operands[1], GEN_INT (8))); + emit_insn (gen_3 (operands[0], temp, + GEN_INT (INTVAL (operands[2]) - 8))); + DONE; + } +}) + +(define_insn "*3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (any_shift:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:SI 2 "arith_operand" "dI")))] + "!TARGET_MIPS16" +{ + if (GET_CODE (operands[2]) == CONST_INT) + operands[2] = GEN_INT (INTVAL (operands[2]) + & (GET_MODE_BITSIZE (mode) - 1)); + + return "\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "")]) + +(define_insn "*si3_extend" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI + (any_shift:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "arith_operand" "dI"))))] + "TARGET_64BIT && !TARGET_MIPS16" +{ + if (GET_CODE (operands[2]) == CONST_INT) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + + return "\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + +(define_insn "*si3_mips16" + [(set (match_operand:SI 0 "register_operand" "=d,d") + (any_shift:SI (match_operand:SI 1 "register_operand" "0,d") + (match_operand:SI 2 "arith_operand" "d,I")))] + "TARGET_MIPS16" +{ + if (which_alternative == 0) + return "\t%0,%2"; + + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "SI") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm3_b") + (const_int 4) + (const_int 8))])]) + +;; We need separate DImode MIPS16 patterns because of the irregularity +;; of right shifts. +(define_insn "*ashldi3_mips16" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (ashift:DI (match_operand:DI 1 "register_operand" "0,d") + (match_operand:SI 2 "arith_operand" "d,I")))] + "TARGET_64BIT && TARGET_MIPS16" +{ + if (which_alternative == 0) + return "dsll\t%0,%2"; + + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); + return "dsll\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm3_b") + (const_int 4) + (const_int 8))])]) + +(define_insn "*ashrdi3_mips16" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0") + (match_operand:SI 2 "arith_operand" "d,I")))] + "TARGET_64BIT && TARGET_MIPS16" +{ + if (GET_CODE (operands[2]) == CONST_INT) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); + + return "dsra\t%0,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm3_b") + (const_int 4) + (const_int 8))])]) + +(define_insn "*lshrdi3_mips16" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0") + (match_operand:SI 2 "arith_operand" "d,I")))] + "TARGET_64BIT && TARGET_MIPS16" +{ + if (GET_CODE (operands[2]) == CONST_INT) + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); + + return "dsrl\t%0,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm3_b") + (const_int 4) + (const_int 8))])]) + +;; On the mips16, we can split a 4 byte shift into 2 2 byte shifts. + +(define_split + [(set (match_operand:GPR 0 "register_operand") + (any_shift:GPR (match_operand:GPR 1 "register_operand") + (match_operand:GPR 2 "const_int_operand")))] + "TARGET_MIPS16 && reload_completed && !TARGET_DEBUG_D_MODE + && GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) > 8 + && INTVAL (operands[2]) <= 16" + [(set (match_dup 0) (any_shift:GPR (match_dup 1) (const_int 8))) + (set (match_dup 0) (any_shift:GPR (match_dup 0) (match_dup 2)))] + { operands[2] = GEN_INT (INTVAL (operands[2]) - 8); }) + +;; If we load a byte on the mips16 as a bitfield, the resulting +;; sequence of instructions is too complicated for combine, because it +;; involves four instructions: a load, a shift, a constant load into a +;; register, and an and (the key problem here is that the mips16 does +;; not have and immediate). We recognize a shift of a load in order +;; to make it simple enough for combine to understand. +;; +;; The length here is the worst case: the length of the split version +;; will be more accurate. +(define_insn_and_split "" + [(set (match_operand:SI 0 "register_operand" "=d") + (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m") + (match_operand:SI 2 "immediate_operand" "I")))] + "TARGET_MIPS16" + "#" + "" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))] + "" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "16")]) + +(define_insn "rotr3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (rotatert:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:SI 2 "arith_operand" "dI")))] + "ISA_HAS_ROTR_" +{ + if (GET_CODE (operands[2]) == CONST_INT) + gcc_assert (INTVAL (operands[2]) >= 0 + && INTVAL (operands[2]) < GET_MODE_BITSIZE (mode)); + + return "ror\t%0,%1,%2"; +} + [(set_attr "type" "shift") + (set_attr "mode" "")]) + +;; +;; .................... +;; +;; COMPARISONS +;; +;; .................... + +;; Flow here is rather complex: +;; +;; 1) The cmp{si,di,sf,df} routine is called. It deposits the arguments +;; into cmp_operands[] but generates no RTL. +;; +;; 2) The appropriate branch define_expand is called, which then +;; creates the appropriate RTL for the comparison and branch. +;; Different CC modes are used, based on what type of branch is +;; done, so that we can constrain things appropriately. There +;; are assumptions in the rest of GCC that break if we fold the +;; operands into the branches for integer operations, and use cc0 +;; for floating point, so we use the fp status register instead. +;; If needed, an appropriate temporary is created to hold the +;; of the integer compare. + +(define_expand "cmp" + [(set (cc0) + (compare:CC (match_operand:GPR 0 "register_operand") + (match_operand:GPR 1 "nonmemory_operand")))] + "" +{ + cmp_operands[0] = operands[0]; + cmp_operands[1] = operands[1]; + DONE; +}) + +(define_expand "cmp" + [(set (cc0) + (compare:CC (match_operand:SCALARF 0 "register_operand") + (match_operand:SCALARF 1 "register_operand")))] + "" +{ + cmp_operands[0] = operands[0]; + cmp_operands[1] = operands[1]; + DONE; +}) + +;; +;; .................... +;; +;; CONDITIONAL BRANCHES +;; +;; .................... + +;; Conditional branches on floating-point equality tests. + +(define_insn "*branch_fp" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(match_operand:CC 2 "register_operand" "z") + (const_int 0)]) + (label_ref (match_operand 1 "" "")) + (pc)))] + "TARGET_HARD_FLOAT" +{ + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%F0", "%Z2%1"), + MIPS_BRANCH ("b%W0", "%Z2%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +(define_insn "*branch_fp_inverted" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(match_operand:CC 2 "register_operand" "z") + (const_int 0)]) + (pc) + (label_ref (match_operand 1 "" ""))))] + "TARGET_HARD_FLOAT" +{ + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%W0", "%Z2%1"), + MIPS_BRANCH ("b%F0", "%Z2%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +;; Conditional branches on ordered comparisons with zero. + +(define_insn "*branch_order" + [(set (pc) + (if_then_else + (match_operator 0 "order_operator" + [(match_operand:GPR 2 "register_operand" "d") + (const_int 0)]) + (label_ref (match_operand 1 "" "")) + (pc)))] + "!TARGET_MIPS16" + { return mips_output_order_conditional_branch (insn, operands, false); } + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +(define_insn "*branch_order_inverted" + [(set (pc) + (if_then_else + (match_operator 0 "order_operator" + [(match_operand:GPR 2 "register_operand" "d") + (const_int 0)]) + (pc) + (label_ref (match_operand 1 "" ""))))] + "!TARGET_MIPS16" + { return mips_output_order_conditional_branch (insn, operands, true); } + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +;; Conditional branch on equality comparison. + +(define_insn "*branch_equality" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(match_operand:GPR 2 "register_operand" "d") + (match_operand:GPR 3 "reg_or_0_operand" "dJ")]) + (label_ref (match_operand 1 "" "")) + (pc)))] + "!TARGET_MIPS16" +{ + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%C0", "%2,%z3,%1"), + MIPS_BRANCH ("b%N0", "%2,%z3,%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +(define_insn "*branch_equality_inverted" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(match_operand:GPR 2 "register_operand" "d") + (match_operand:GPR 3 "reg_or_0_operand" "dJ")]) + (pc) + (label_ref (match_operand 1 "" ""))))] + "!TARGET_MIPS16" +{ + return mips_output_conditional_branch (insn, operands, + MIPS_BRANCH ("b%N0", "%2,%z3,%1"), + MIPS_BRANCH ("b%C0", "%2,%z3,%1")); +} + [(set_attr "type" "branch") + (set_attr "mode" "none")]) + +;; MIPS16 branches + +(define_insn "*branch_equality_mips16" + [(set (pc) + (if_then_else + (match_operator 0 "equality_operator" + [(match_operand:GPR 1 "register_operand" "d,t") + (const_int 0)]) + (match_operand 2 "pc_or_label_operand" "") + (match_operand 3 "pc_or_label_operand" "")))] + "TARGET_MIPS16" +{ + if (operands[2] != pc_rtx) + { + if (which_alternative == 0) + return "b%C0z\t%1,%2"; + else + return "bt%C0z\t%2"; + } + else + { + if (which_alternative == 0) + return "b%N0z\t%1,%3"; + else + return "bt%N0z\t%3"; + } +} + [(set_attr "type" "branch") + (set_attr "mode" "none") + (set_attr "length" "8")]) + +(define_expand "b" + [(set (pc) + (if_then_else (any_cond:CC (cc0) + (const_int 0)) + (label_ref (match_operand 0 "")) + (pc)))] + "" +{ + gen_conditional_branch (operands, ); + DONE; +}) + +;; Used to implement built-in functions. +(define_expand "condjump" + [(set (pc) + (if_then_else (match_operand 0) + (label_ref (match_operand 1)) + (pc)))]) + +;; +;; .................... +;; +;; SETTING A REGISTER FROM A COMPARISON +;; +;; .................... + +(define_expand "seq" + [(set (match_operand:SI 0 "register_operand") + (eq:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (EQ, operands[0])) DONE; else FAIL; }) + +(define_insn "*seq_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (eq:GPR (match_operand:GPR 1 "register_operand" "d") + (const_int 0)))] + "!TARGET_MIPS16" + "sltu\t%0,%1,1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*seq__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t") + (eq:GPR (match_operand:GPR 1 "register_operand" "d") + (const_int 0)))] + "TARGET_MIPS16" + "sltu\t%1,1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +;; "sne" uses sltu instructions in which the first operand is $0. +;; This isn't possible in mips16 code. + +(define_expand "sne" + [(set (match_operand:SI 0 "register_operand") + (ne:SI (match_dup 1) + (match_dup 2)))] + "!TARGET_MIPS16" + { if (mips_emit_scc (NE, operands[0])) DONE; else FAIL; }) + +(define_insn "*sne_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ne:GPR (match_operand:GPR 1 "register_operand" "d") + (const_int 0)))] + "!TARGET_MIPS16" + "sltu\t%0,%.,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_expand "sgt" + [(set (match_operand:SI 0 "register_operand") + (gt:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (GT, operands[0])) DONE; else FAIL; }) + +(define_insn "*sgt_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (gt:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "reg_or_0_operand" "dJ")))] + "!TARGET_MIPS16" + "slt\t%0,%z2,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*sgt__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t") + (gt:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_MIPS16" + "slt\t%2,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_expand "sge" + [(set (match_operand:SI 0 "register_operand") + (ge:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (GE, operands[0])) DONE; else FAIL; }) + +(define_insn "*sge_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ge:GPR (match_operand:GPR 1 "register_operand" "d") + (const_int 1)))] + "!TARGET_MIPS16" + "slt\t%0,%.,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_expand "slt" + [(set (match_operand:SI 0 "register_operand") + (lt:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (LT, operands[0])) DONE; else FAIL; }) + +(define_insn "*slt_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (lt:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "arith_operand" "dI")))] + "!TARGET_MIPS16" + "slt\t%0,%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*slt__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t,t") + (lt:GPR (match_operand:GPR 1 "register_operand" "d,d") + (match_operand:GPR 2 "arith_operand" "d,I")))] + "TARGET_MIPS16" + "slt\t%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm8_1") + (const_int 4) + (const_int 8))])]) + +(define_expand "sle" + [(set (match_operand:SI 0 "register_operand") + (le:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (LE, operands[0])) DONE; else FAIL; }) + +(define_insn "*sle_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (le:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "sle_operand" "")))] + "!TARGET_MIPS16" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + return "slt\t%0,%1,%2"; +} + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*sle__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t") + (le:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "sle_operand" "")))] + "TARGET_MIPS16" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + return "slt\t%1,%2"; +} + [(set_attr "type" "slt") + (set_attr "mode" "") + (set (attr "length") (if_then_else (match_operand 2 "m16_uimm8_m1_1") + (const_int 4) + (const_int 8)))]) + +(define_expand "sgtu" + [(set (match_operand:SI 0 "register_operand") + (gtu:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (GTU, operands[0])) DONE; else FAIL; }) + +(define_insn "*sgtu_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (gtu:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "reg_or_0_operand" "dJ")))] + "!TARGET_MIPS16" + "sltu\t%0,%z2,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*sgtu__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t") + (gtu:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "register_operand" "d")))] + "TARGET_MIPS16" + "sltu\t%2,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_expand "sgeu" + [(set (match_operand:SI 0 "register_operand") + (geu:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (GEU, operands[0])) DONE; else FAIL; }) + +(define_insn "*sge_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (geu:GPR (match_operand:GPR 1 "register_operand" "d") + (const_int 1)))] + "!TARGET_MIPS16" + "sltu\t%0,%.,%1" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_expand "sltu" + [(set (match_operand:SI 0 "register_operand") + (ltu:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (LTU, operands[0])) DONE; else FAIL; }) + +(define_insn "*sltu_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ltu:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "arith_operand" "dI")))] + "!TARGET_MIPS16" + "sltu\t%0,%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*sltu__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t,t") + (ltu:GPR (match_operand:GPR 1 "register_operand" "d,d") + (match_operand:GPR 2 "arith_operand" "d,I")))] + "TARGET_MIPS16" + "sltu\t%1,%2" + [(set_attr "type" "slt") + (set_attr "mode" "") + (set_attr_alternative "length" + [(const_int 4) + (if_then_else (match_operand 2 "m16_uimm8_1") + (const_int 4) + (const_int 8))])]) + +(define_expand "sleu" + [(set (match_operand:SI 0 "register_operand") + (leu:SI (match_dup 1) + (match_dup 2)))] + "" + { if (mips_emit_scc (LEU, operands[0])) DONE; else FAIL; }) + +(define_insn "*sleu_" + [(set (match_operand:GPR 0 "register_operand" "=d") + (leu:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "sleu_operand" "")))] + "!TARGET_MIPS16" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + return "sltu\t%0,%1,%2"; +} + [(set_attr "type" "slt") + (set_attr "mode" "")]) + +(define_insn "*sleu__mips16" + [(set (match_operand:GPR 0 "register_operand" "=t") + (leu:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:GPR 2 "sleu_operand" "")))] + "TARGET_MIPS16" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) + 1); + return "sltu\t%1,%2"; +} + [(set_attr "type" "slt") + (set_attr "mode" "") + (set (attr "length") (if_then_else (match_operand 2 "m16_uimm8_m1_1") + (const_int 4) + (const_int 8)))]) + +;; +;; .................... +;; +;; FLOATING POINT COMPARISONS +;; +;; .................... + +(define_insn "s_" + [(set (match_operand:CC 0 "register_operand" "=z") + (fcond:CC (match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f")))] + "" + "c..\t%Z0%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +(define_insn "s_" + [(set (match_operand:CC 0 "register_operand" "=z") + (swapped_fcond:CC (match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f")))] + "" + "c..\t%Z0%2,%1" + [(set_attr "type" "fcmp") + (set_attr "mode" "FPSW")]) + +;; +;; .................... +;; +;; UNCONDITIONAL BRANCHES +;; +;; .................... + +;; Unconditional branches. + +(define_insn "jump" + [(set (pc) + (label_ref (match_operand 0 "" "")))] + "!TARGET_MIPS16" +{ + if (flag_pic) + { + if (get_attr_length (insn) <= 8) + return "%*b\t%l0%/"; + else + { + output_asm_insn (mips_output_load_label (), operands); + return "%*jr\t%@%/%]"; + } + } + else + return "%*j\t%l0%/"; +} + [(set_attr "type" "jump") + (set_attr "mode" "none") + (set (attr "length") + ;; We can't use `j' when emitting PIC. Emit a branch if it's + ;; in range, otherwise load the address of the branch target into + ;; $at and then jump to it. + (if_then_else + (ior (eq (symbol_ref "flag_pic") (const_int 0)) + (lt (abs (minus (match_dup 0) + (plus (pc) (const_int 4)))) + (const_int 131072))) + (const_int 4) (const_int 16)))]) + +;; We need a different insn for the mips16, because a mips16 branch +;; does not have a delay slot. + +(define_insn "" + [(set (pc) + (label_ref (match_operand 0 "" "")))] + "TARGET_MIPS16" + "b\t%l0" + [(set_attr "type" "branch") + (set_attr "mode" "none") + (set_attr "length" "8")]) + +(define_expand "indirect_jump" + [(set (pc) (match_operand 0 "register_operand"))] + "" +{ + operands[0] = force_reg (Pmode, operands[0]); + if (Pmode == SImode) + emit_jump_insn (gen_indirect_jumpsi (operands[0])); + else + emit_jump_insn (gen_indirect_jumpdi (operands[0])); + DONE; +}) + +(define_insn "indirect_jump" + [(set (pc) (match_operand:P 0 "register_operand" "d"))] + "" + "%*j\t%0%/" + [(set_attr "type" "jump") + (set_attr "mode" "none")]) + +(define_expand "tablejump" + [(set (pc) + (match_operand 0 "register_operand")) + (use (label_ref (match_operand 1 "")))] + "" +{ + if (TARGET_MIPS16) + operands[0] = expand_binop (Pmode, add_optab, + convert_to_mode (Pmode, operands[0], false), + gen_rtx_LABEL_REF (Pmode, operands[1]), + 0, 0, OPTAB_WIDEN); + else if (TARGET_GPWORD) + operands[0] = expand_binop (Pmode, add_optab, operands[0], + pic_offset_table_rtx, 0, 0, OPTAB_WIDEN); + + if (Pmode == SImode) + emit_jump_insn (gen_tablejumpsi (operands[0], operands[1])); + else + emit_jump_insn (gen_tablejumpdi (operands[0], operands[1])); + DONE; +}) + +(define_insn "tablejump" + [(set (pc) + (match_operand:P 0 "register_operand" "d")) + (use (label_ref (match_operand 1 "" "")))] + "" + "%*j\t%0%/" + [(set_attr "type" "jump") + (set_attr "mode" "none")]) + +;; For TARGET_ABICALLS, we save the gp in the jmp_buf as well. +;; While it is possible to either pull it off the stack (in the +;; o32 case) or recalculate it given t9 and our target label, +;; it takes 3 or 4 insns to do so. + +(define_expand "builtin_setjmp_setup" + [(use (match_operand 0 "register_operand"))] + "TARGET_ABICALLS" +{ + rtx addr; + + addr = plus_constant (operands[0], GET_MODE_SIZE (Pmode) * 3); + emit_move_insn (gen_rtx_MEM (Pmode, addr), pic_offset_table_rtx); + DONE; +}) + +;; Restore the gp that we saved above. Despite the earlier comment, it seems +;; that older code did recalculate the gp from $25. Continue to jump through +;; $25 for compatibility (we lose nothing by doing so). + +(define_expand "builtin_longjmp" + [(use (match_operand 0 "register_operand"))] + "TARGET_ABICALLS" +{ + /* The elements of the buffer are, in order: */ + int W = GET_MODE_SIZE (Pmode); + rtx fp = gen_rtx_MEM (Pmode, operands[0]); + rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], 1*W)); + rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2*W)); + rtx gpv = gen_rtx_MEM (Pmode, plus_constant (operands[0], 3*W)); + rtx pv = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); + /* Use gen_raw_REG to avoid being given pic_offset_table_rtx. + The target is bound to be using $28 as the global pointer + but the current function might not be. */ + rtx gp = gen_raw_REG (Pmode, GLOBAL_POINTER_REGNUM); + + /* This bit is similar to expand_builtin_longjmp except that it + restores $gp as well. */ + emit_move_insn (hard_frame_pointer_rtx, fp); + emit_move_insn (pv, lab); + emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX); + emit_move_insn (gp, gpv); + emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); + emit_insn (gen_rtx_USE (VOIDmode, gp)); + emit_indirect_jump (pv); + DONE; +}) + +;; +;; .................... +;; +;; Function prologue/epilogue +;; +;; .................... +;; + +(define_expand "prologue" + [(const_int 1)] + "" +{ + mips_expand_prologue (); + DONE; +}) + +;; Block any insns from being moved before this point, since the +;; profiling call to mcount can use various registers that aren't +;; saved or used to pass arguments. + +(define_insn "blockage" + [(unspec_volatile [(const_int 0)] UNSPEC_BLOCKAGE)] + "" + "" + [(set_attr "type" "unknown") + (set_attr "mode" "none") + (set_attr "length" "0")]) + +(define_expand "epilogue" + [(const_int 2)] + "" +{ + mips_expand_epilogue (false); + DONE; +}) + +(define_expand "sibcall_epilogue" + [(const_int 2)] + "" +{ + mips_expand_epilogue (true); + DONE; +}) + +;; Trivial return. Make it look like a normal return insn as that +;; allows jump optimizations to work better. + +(define_insn "return" + [(return)] + "mips_can_use_return_insn ()" + "%*j\t$31%/" + [(set_attr "type" "jump") + (set_attr "mode" "none")]) + +;; Normal return. + +(define_insn "return_internal" + [(return) + (use (match_operand 0 "pmode_register_operand" ""))] + "" + "%*j\t%0%/" + [(set_attr "type" "jump") + (set_attr "mode" "none")]) + +;; This is used in compiling the unwind routines. +(define_expand "eh_return" + [(use (match_operand 0 "general_operand"))] + "" +{ + enum machine_mode gpr_mode = TARGET_64BIT ? DImode : SImode; + + if (GET_MODE (operands[0]) != gpr_mode) + operands[0] = convert_to_mode (gpr_mode, operands[0], 0); + if (TARGET_64BIT) + emit_insn (gen_eh_set_lr_di (operands[0])); + else + emit_insn (gen_eh_set_lr_si (operands[0])); + + DONE; +}) + +;; Clobber the return address on the stack. We can't expand this +;; until we know where it will be put in the stack frame. + +(define_insn "eh_set_lr_si" + [(unspec [(match_operand:SI 0 "register_operand" "d")] UNSPEC_EH_RETURN) + (clobber (match_scratch:SI 1 "=&d"))] + "! TARGET_64BIT" + "#") + +(define_insn "eh_set_lr_di" + [(unspec [(match_operand:DI 0 "register_operand" "d")] UNSPEC_EH_RETURN) + (clobber (match_scratch:DI 1 "=&d"))] + "TARGET_64BIT" + "#") + +(define_split + [(unspec [(match_operand 0 "register_operand")] UNSPEC_EH_RETURN) + (clobber (match_scratch 1))] + "reload_completed && !TARGET_DEBUG_D_MODE" + [(const_int 0)] +{ + mips_set_return_address (operands[0], operands[1]); + DONE; +}) + +(define_insn_and_split "exception_receiver" + [(set (reg:SI 28) + (unspec_volatile:SI [(const_int 0)] UNSPEC_EH_RECEIVER))] + "TARGET_ABICALLS && TARGET_OLDABI" + "#" + "&& reload_completed" + [(const_int 0)] +{ + mips_restore_gp (); + DONE; +} + [(set_attr "type" "load") + (set_attr "length" "12")]) + +;; +;; .................... +;; +;; FUNCTION CALLS +;; +;; .................... + +;; Instructions to load a call address from the GOT. The address might +;; point to a function or to a lazy binding stub. In the latter case, +;; the stub will use the dynamic linker to resolve the function, which +;; in turn will change the GOT entry to point to the function's real +;; address. +;; +;; This means that every call, even pure and constant ones, can +;; potentially modify the GOT entry. And once a stub has been called, +;; we must not call it again. +;; +;; We represent this restriction using an imaginary fixed register that +;; acts like a GOT version number. By making the register call-clobbered, +;; we tell the target-independent code that the address could be changed +;; by any call insn. +(define_insn "load_call" + [(set (match_operand:P 0 "register_operand" "=c") + (unspec:P [(match_operand:P 1 "register_operand" "r") + (match_operand:P 2 "immediate_operand" "") + (reg:P FAKE_CALL_REGNO)] + UNSPEC_LOAD_CALL))] + "TARGET_ABICALLS" + "\t%0,%R2(%1)" + [(set_attr "type" "load") + (set_attr "mode" "") + (set_attr "length" "4")]) + +;; Sibling calls. All these patterns use jump instructions. + +;; If TARGET_SIBCALLS, call_insn_operand will only accept constant +;; addresses if a direct jump is acceptable. Since the 'S' constraint +;; is defined in terms of call_insn_operand, the same is true of the +;; constraints. + +;; When we use an indirect jump, we need a register that will be +;; preserved by the epilogue. Since TARGET_ABICALLS forces us to +;; use $25 for this purpose -- and $25 is never clobbered by the +;; epilogue -- we might as well use it for !TARGET_ABICALLS as well. + +(define_expand "sibcall" + [(parallel [(call (match_operand 0 "") + (match_operand 1 "")) + (use (match_operand 2 "")) ;; next_arg_reg + (use (match_operand 3 ""))])] ;; struct_value_size_rtx + "TARGET_SIBCALLS" +{ + mips_expand_call (0, XEXP (operands[0], 0), operands[1], operands[2], true); + DONE; +}) + +(define_insn "sibcall_internal" + [(call (mem:SI (match_operand 0 "call_insn_operand" "j,S")) + (match_operand 1 "" ""))] + "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" + { return MIPS_CALL ("j", operands, 0); } + [(set_attr "type" "call")]) + +(define_expand "sibcall_value" + [(parallel [(set (match_operand 0 "") + (call (match_operand 1 "") + (match_operand 2 ""))) + (use (match_operand 3 ""))])] ;; next_arg_reg + "TARGET_SIBCALLS" +{ + mips_expand_call (operands[0], XEXP (operands[1], 0), + operands[2], operands[3], true); + DONE; +}) + +(define_insn "sibcall_value_internal" + [(set (match_operand 0 "register_operand" "=df,df") + (call (mem:SI (match_operand 1 "call_insn_operand" "j,S")) + (match_operand 2 "" "")))] + "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" + { return MIPS_CALL ("j", operands, 1); } + [(set_attr "type" "call")]) + +(define_insn "sibcall_value_multiple_internal" + [(set (match_operand 0 "register_operand" "=df,df") + (call (mem:SI (match_operand 1 "call_insn_operand" "j,S")) + (match_operand 2 "" ""))) + (set (match_operand 3 "register_operand" "=df,df") + (call (mem:SI (match_dup 1)) + (match_dup 2)))] + "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" + { return MIPS_CALL ("j", operands, 1); } + [(set_attr "type" "call")]) + +(define_expand "call" + [(parallel [(call (match_operand 0 "") + (match_operand 1 "")) + (use (match_operand 2 "")) ;; next_arg_reg + (use (match_operand 3 ""))])] ;; struct_value_size_rtx + "" +{ + mips_expand_call (0, XEXP (operands[0], 0), operands[1], operands[2], false); + DONE; +}) + +;; This instruction directly corresponds to an assembly-language "jal". +;; There are four cases: +;; +;; - -mno-abicalls: +;; Both symbolic and register destinations are OK. The pattern +;; always expands to a single mips instruction. +;; +;; - -mabicalls/-mno-explicit-relocs: +;; Again, both symbolic and register destinations are OK. +;; The call is treated as a multi-instruction black box. +;; +;; - -mabicalls/-mexplicit-relocs with n32 or n64: +;; Only "jal $25" is allowed. This expands to a single "jalr $25" +;; instruction. +;; +;; - -mabicalls/-mexplicit-relocs with o32 or o64: +;; Only "jal $25" is allowed. The call is actually two instructions: +;; "jalr $25" followed by an insn to reload $gp. +;; +;; In the last case, we can generate the individual instructions with +;; a define_split. There are several things to be wary of: +;; +;; - We can't expose the load of $gp before reload. If we did, +;; it might get removed as dead, but reload can introduce new +;; uses of $gp by rematerializing constants. +;; +;; - We shouldn't restore $gp after calls that never return. +;; It isn't valid to insert instructions between a noreturn +;; call and the following barrier. +;; +;; - The splitter deliberately changes the liveness of $gp. The unsplit +;; instruction preserves $gp and so have no effect on its liveness. +;; But once we generate the separate insns, it becomes obvious that +;; $gp is not live on entry to the call. +;; +;; ??? The operands[2] = insn check is a hack to make the original insn +;; available to the splitter. +(define_insn_and_split "call_internal" + [(call (mem:SI (match_operand 0 "call_insn_operand" "c,S")) + (match_operand 1 "" "")) + (clobber (reg:SI 31))] + "" + { return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 0); } + "reload_completed && TARGET_SPLIT_CALLS && (operands[2] = insn)" + [(const_int 0)] +{ + emit_call_insn (gen_call_split (operands[0], operands[1])); + if (!find_reg_note (operands[2], REG_NORETURN, 0)) + mips_restore_gp (); + DONE; +} + [(set_attr "jal" "indirect,direct") + (set_attr "extended_mips16" "no,yes")]) + +(define_insn "call_split" + [(call (mem:SI (match_operand 0 "call_insn_operand" "cS")) + (match_operand 1 "" "")) + (clobber (reg:SI 31)) + (clobber (reg:SI 28))] + "TARGET_SPLIT_CALLS" + { return MIPS_CALL ("jal", operands, 0); } + [(set_attr "type" "call")]) + +(define_expand "call_value" + [(parallel [(set (match_operand 0 "") + (call (match_operand 1 "") + (match_operand 2 ""))) + (use (match_operand 3 ""))])] ;; next_arg_reg + "" +{ + mips_expand_call (operands[0], XEXP (operands[1], 0), + operands[2], operands[3], false); + DONE; +}) + +;; See comment for call_internal. +(define_insn_and_split "call_value_internal" + [(set (match_operand 0 "register_operand" "=df,df") + (call (mem:SI (match_operand 1 "call_insn_operand" "c,S")) + (match_operand 2 "" ""))) + (clobber (reg:SI 31))] + "" + { return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1); } + "reload_completed && TARGET_SPLIT_CALLS && (operands[3] = insn)" + [(const_int 0)] +{ + emit_call_insn (gen_call_value_split (operands[0], operands[1], + operands[2])); + if (!find_reg_note (operands[3], REG_NORETURN, 0)) + mips_restore_gp (); + DONE; +} + [(set_attr "jal" "indirect,direct") + (set_attr "extended_mips16" "no,yes")]) + +(define_insn "call_value_split" + [(set (match_operand 0 "register_operand" "=df") + (call (mem:SI (match_operand 1 "call_insn_operand" "cS")) + (match_operand 2 "" ""))) + (clobber (reg:SI 31)) + (clobber (reg:SI 28))] + "TARGET_SPLIT_CALLS" + { return MIPS_CALL ("jal", operands, 1); } + [(set_attr "type" "call")]) + +;; See comment for call_internal. +(define_insn_and_split "call_value_multiple_internal" + [(set (match_operand 0 "register_operand" "=df,df") + (call (mem:SI (match_operand 1 "call_insn_operand" "c,S")) + (match_operand 2 "" ""))) + (set (match_operand 3 "register_operand" "=df,df") + (call (mem:SI (match_dup 1)) + (match_dup 2))) + (clobber (reg:SI 31))] + "" + { return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1); } + "reload_completed && TARGET_SPLIT_CALLS && (operands[4] = insn)" + [(const_int 0)] +{ + emit_call_insn (gen_call_value_multiple_split (operands[0], operands[1], + operands[2], operands[3])); + if (!find_reg_note (operands[4], REG_NORETURN, 0)) + mips_restore_gp (); + DONE; +} + [(set_attr "jal" "indirect,direct") + (set_attr "extended_mips16" "no,yes")]) + +(define_insn "call_value_multiple_split" + [(set (match_operand 0 "register_operand" "=df") + (call (mem:SI (match_operand 1 "call_insn_operand" "cS")) + (match_operand 2 "" ""))) + (set (match_operand 3 "register_operand" "=df") + (call (mem:SI (match_dup 1)) + (match_dup 2))) + (clobber (reg:SI 31)) + (clobber (reg:SI 28))] + "TARGET_SPLIT_CALLS" + { return MIPS_CALL ("jal", operands, 1); } + [(set_attr "type" "call")]) + +;; Call subroutine returning any type. + +(define_expand "untyped_call" + [(parallel [(call (match_operand 0 "") + (const_int 0)) + (match_operand 1 "") + (match_operand 2 "")])] + "" +{ + int i; + + emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx)); + + for (i = 0; i < XVECLEN (operands[2], 0); i++) + { + rtx set = XVECEXP (operands[2], 0, i); + emit_move_insn (SET_DEST (set), SET_SRC (set)); + } + + emit_insn (gen_blockage ()); + DONE; +}) + +;; +;; .................... +;; +;; MISC. +;; +;; .................... +;; + + +(define_insn "prefetch" + [(prefetch (match_operand:QI 0 "address_operand" "p") + (match_operand 1 "const_int_operand" "n") + (match_operand 2 "const_int_operand" "n"))] + "ISA_HAS_PREFETCH && TARGET_EXPLICIT_RELOCS" +{ + operands[1] = mips_prefetch_cookie (operands[1], operands[2]); + return "pref\t%1,%a0"; +} + [(set_attr "type" "prefetch")]) + +(define_insn "*prefetch_indexed_" + [(prefetch (plus:P (match_operand:P 0 "register_operand" "d") + (match_operand:P 1 "register_operand" "d")) + (match_operand 2 "const_int_operand" "n") + (match_operand 3 "const_int_operand" "n"))] + "ISA_HAS_PREFETCHX && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" +{ + operands[2] = mips_prefetch_cookie (operands[2], operands[3]); + return "prefx\t%2,%1(%0)"; +} + [(set_attr "type" "prefetchx")]) + +(define_insn "nop" + [(const_int 0)] + "" + "%(nop%)" + [(set_attr "type" "nop") + (set_attr "mode" "none")]) + +;; Like nop, but commented out when outside a .set noreorder block. +(define_insn "hazard_nop" + [(const_int 1)] + "" + { + if (set_noreorder) + return "nop"; + else + return "#nop"; + } + [(set_attr "type" "nop")]) + +;; MIPS4 Conditional move instructions. + +(define_insn "*mov_on_" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (if_then_else:GPR + (match_operator:MOVECC 4 "equality_operator" + [(match_operand:MOVECC 1 "register_operand" ",") + (const_int 0)]) + (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") + (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] + "ISA_HAS_CONDMOVE" + "@ + mov%T4\t%0,%z2,%1 + mov%t4\t%0,%z3,%1" + [(set_attr "type" "condmove") + (set_attr "mode" "")]) + +(define_insn "*mov_on_" + [(set (match_operand:SCALARF 0 "register_operand" "=f,f") + (if_then_else:SCALARF + (match_operator:MOVECC 4 "equality_operator" + [(match_operand:MOVECC 1 "register_operand" ",") + (const_int 0)]) + (match_operand:SCALARF 2 "register_operand" "f,0") + (match_operand:SCALARF 3 "register_operand" "0,f")))] + "ISA_HAS_CONDMOVE" + "@ + mov%T4.\t%0,%2,%1 + mov%t4.\t%0,%3,%1" + [(set_attr "type" "condmove") + (set_attr "mode" "")]) + +;; These are the main define_expand's used to make conditional moves. + +(define_expand "movcc" + [(set (match_dup 4) (match_operand 1 "comparison_operator")) + (set (match_operand:GPR 0 "register_operand") + (if_then_else:GPR (match_dup 5) + (match_operand:GPR 2 "reg_or_0_operand") + (match_operand:GPR 3 "reg_or_0_operand")))] + "ISA_HAS_CONDMOVE" +{ + gen_conditional_move (operands); + DONE; +}) + +(define_expand "movcc" + [(set (match_dup 4) (match_operand 1 "comparison_operator")) + (set (match_operand:SCALARF 0 "register_operand") + (if_then_else:SCALARF (match_dup 5) + (match_operand:SCALARF 2 "register_operand") + (match_operand:SCALARF 3 "register_operand")))] + "ISA_HAS_CONDMOVE" +{ + gen_conditional_move (operands); + DONE; +}) + +;; +;; .................... +;; +;; mips16 inline constant tables +;; +;; .................... +;; + +(define_insn "consttable_int" + [(unspec_volatile [(match_operand 0 "consttable_operand" "") + (match_operand 1 "const_int_operand" "")] + UNSPEC_CONSTTABLE_INT)] + "TARGET_MIPS16" +{ + assemble_integer (operands[0], INTVAL (operands[1]), + BITS_PER_UNIT * INTVAL (operands[1]), 1); + return ""; +} + [(set (attr "length") (symbol_ref "INTVAL (operands[1])"))]) + +(define_insn "consttable_float" + [(unspec_volatile [(match_operand 0 "consttable_operand" "")] + UNSPEC_CONSTTABLE_FLOAT)] + "TARGET_MIPS16" +{ + REAL_VALUE_TYPE d; + + gcc_assert (GET_CODE (operands[0]) == CONST_DOUBLE); + REAL_VALUE_FROM_CONST_DOUBLE (d, operands[0]); + assemble_real (d, GET_MODE (operands[0]), + GET_MODE_BITSIZE (GET_MODE (operands[0]))); + return ""; +} + [(set (attr "length") + (symbol_ref "GET_MODE_SIZE (GET_MODE (operands[0]))"))]) + +(define_insn "align" + [(unspec_volatile [(match_operand 0 "const_int_operand" "")] UNSPEC_ALIGN)] + "" + ".align\t%0" + [(set (attr "length") (symbol_ref "(1 << INTVAL (operands[0])) - 1"))]) + +(define_split + [(match_operand 0 "small_data_pattern")] + "reload_completed" + [(match_dup 0)] + { operands[0] = mips_rewrite_small_data (operands[0]); }) + +; Thread-Local Storage + +; The TLS base pointer is accessed via "rdhwr $v1, $29". No current +; MIPS architecture defines this register, and no current +; implementation provides it; instead, any OS which supports TLS is +; expected to trap and emulate this instruction. rdhwr is part of the +; MIPS 32r2 specification, but we use it on any architecture because +; we expect it to be emulated. Use .set to force the assembler to +; accept it. + +(define_insn "tls_get_tp_" + [(set (match_operand:P 0 "register_operand" "=v") + (unspec:P [(const_int 0)] + UNSPEC_TLS_GET_TP))] + "HAVE_AS_TLS && !TARGET_MIPS16" + ".set\tpush\;.set\tmips32r2\t\;rdhwr\t%0,$29\;.set\tpop" + [(set_attr "type" "unknown") + ; Since rdhwr always generates a trap for now, putting it in a delay + ; slot would make the kernel's emulation of it much slower. + (set_attr "can_delay" "no") + (set_attr "mode" "")]) + +; The MIPS Paired-Single Floating Point and MIPS-3D Instructions. + +(include "mips-ps-3d.md") + +; The MIPS DSP Instructions. + +(include "mips-dsp.md") diff --git a/contrib/gcc/config/mips/mips.opt b/contrib/gcc/config/mips/mips.opt new file mode 100644 index 00000000000..7f8214bb146 --- /dev/null +++ b/contrib/gcc/config/mips/mips.opt @@ -0,0 +1,222 @@ +; Options for the MIPS port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mabi= +Target RejectNegative Joined +-mabi=ABI Generate code that conforms to the given ABI + +mabicalls +Target Report Mask(ABICALLS) +Generate code that can be used in SVR4-style dynamic objects + +mad +Target Report Var(TARGET_MAD) +Use PMC-style 'mad' instructions + +march= +Target RejectNegative Joined Var(mips_arch_string) +-march=ISA Generate code for the given ISA + +mbranch-likely +Target Report Mask(BRANCHLIKELY) +Use Branch Likely instructions, overriding the architecture default + +mcheck-zero-division +Target Report Mask(CHECK_ZERO_DIV) +Trap on integer divide by zero + +mdivide-breaks +Target Report RejectNegative Mask(DIVIDE_BREAKS) +Use branch-and-break sequences to check for integer divide by zero + +mdivide-traps +Target Report RejectNegative InverseMask(DIVIDE_BREAKS, DIVIDE_TRAPS) +Use trap instructions to check for integer divide by zero + +mdouble-float +Target Report RejectNegative InverseMask(SINGLE_FLOAT, DOUBLE_FLOAT) +Allow hardware floating-point instructions to cover both 32-bit and 64-bit operations + +mdsp +Target Report Mask(DSP) +Use MIPS-DSP instructions + +mdebug +Target Var(TARGET_DEBUG_MODE) Undocumented + +mdebugd +Target Var(TARGET_DEBUG_D_MODE) Undocumented + +meb +Target Report RejectNegative Mask(BIG_ENDIAN) +Use big-endian byte order + +mel +Target Report RejectNegative InverseMask(BIG_ENDIAN, LITTLE_ENDIAN) +Use little-endian byte order + +membedded-data +Target Report Var(TARGET_EMBEDDED_DATA) +Use ROM instead of RAM + +mexplicit-relocs +Target Report Mask(EXPLICIT_RELOCS) +Use NewABI-style %reloc() assembly operators + +mfix-r4000 +Target Report Mask(FIX_R4000) +Work around certain R4000 errata + +mfix-r4400 +Target Report Mask(FIX_R4400) +Work around certain R4400 errata + +mfix-sb1 +Target Report Var(TARGET_FIX_SB1) +Work around errata for early SB-1 revision 2 cores + +mfix-vr4120 +Target Report Var(TARGET_FIX_VR4120) +Work around certain VR4120 errata + +mfix-vr4130 +Target Report Var(TARGET_FIX_VR4130) +Work around VR4130 mflo/mfhi errata + +mfix4300 +Target Report Var(TARGET_4300_MUL_FIX) +Work around an early 4300 hardware bug + +mfp-exceptions +Target Report Mask(FP_EXCEPTIONS) +FP exceptions are enabled + +mfp32 +Target Report RejectNegative InverseMask(FLOAT64) +Use 32-bit floating-point registers + +mfp64 +Target Report RejectNegative Mask(FLOAT64) +Use 64-bit floating-point registers + +mflush-func= +Target RejectNegative Joined Var(mips_cache_flush_func) Init(CACHE_FLUSH_FUNC) +-mflush-func=FUNC Use FUNC to flush the cache before calling stack trampolines + +mfused-madd +Target Report Mask(FUSED_MADD) +Generate floating-point multiply-add instructions + +mgp32 +Target Report RejectNegative InverseMask(64BIT) +Use 32-bit general registers + +mgp64 +Target Report RejectNegative Mask(64BIT) +Use 64-bit general registers + +mhard-float +Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) +Allow the use of hardware floating-point instructions + +mips +Target RejectNegative Joined +-mipsN Generate code for ISA level N + +mips16 +Target Report RejectNegative Mask(MIPS16) +Generate mips16 code + +mips3d +Target Report RejectNegative Mask(MIPS3D) +Use MIPS-3D instructions + +mlong-calls +Target Report Var(TARGET_LONG_CALLS) +Use indirect calls + +mlong32 +Target Report RejectNegative InverseMask(LONG64, LONG32) +Use a 32-bit long type + +mlong64 +Target Report RejectNegative Mask(LONG64) +Use a 64-bit long type + +mmemcpy +Target Report Var(TARGET_MEMCPY) +Don't optimize block moves + +mmips-tfile +Target +Use the mips-tfile postpass + +mno-flush-func +Target RejectNegative +Do not use a cache-flushing function before calling stack trampolines + +mno-mips16 +Target Report RejectNegative InverseMask(MIPS16) +Generate normal-mode code + +mno-mips3d +Target Report RejectNegative InverseMask(MIPS3D) +Do not use MIPS-3D instructions + +mpaired-single +Target Report Mask(PAIRED_SINGLE_FLOAT) +Use paired-single floating-point instructions + +mshared +Target Report Var(TARGET_SHARED) Init(1) +When generating -mabicalls code, make the code suitable for use in shared libraries + +msingle-float +Target Report RejectNegative Mask(SINGLE_FLOAT) +Restrict the use of hardware floating-point instructions to 32-bit operations + +msoft-float +Target Report RejectNegative Mask(SOFT_FLOAT) +Prevent the use of all hardware floating-point instructions + +msplit-addresses +Target Report Mask(SPLIT_ADDRESSES) +Optimize lui/addiu address loads + +msym32 +Target Report Var(TARGET_SYM32) +Assume all symbols have 32-bit values + +mtune= +Target RejectNegative Joined Var(mips_tune_string) +-mtune=PROCESSOR Optimize the output for PROCESSOR + +muninit-const-in-rodata +Target Report Var(TARGET_UNINIT_CONST_IN_RODATA) +Put uninitialized constants in ROM (needs -membedded-data) + +mvr4130-align +Target Report Mask(VR4130_ALIGN) +Perform VR4130-specific alignment optimizations + +mxgot +Target Report Var(TARGET_XGOT) +Lift restrictions on GOT size diff --git a/contrib/gcc/config/mips/mips16.S b/contrib/gcc/config/mips/mips16.S new file mode 100644 index 00000000000..a6afa0c0544 --- /dev/null +++ b/contrib/gcc/config/mips/mips16.S @@ -0,0 +1,739 @@ +/* mips16 floating point support code + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Contributed by Cygnus Support + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* This file contains mips16 floating point support functions. These + functions are called by mips16 code to handle floating point when + -msoft-float is not used. They accept the arguments and return + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + +/* This file contains 32 bit assembly code. */ + .set nomips16 + +/* Start a function. */ + +#define STARTFN(NAME) .globl NAME; .ent NAME; NAME: + +/* Finish a function. */ + +#define ENDFN(NAME) .end NAME + +/* Single precision math. */ + +/* This macro defines a function which loads two single precision + values, performs an operation, and returns the single precision + result. */ + +#define SFOP(NAME, OPCODE) \ +STARTFN (NAME); \ + .set noreorder; \ + mtc1 $4,$f0; \ + mtc1 $5,$f2; \ + nop; \ + OPCODE $f0,$f0,$f2; \ + mfc1 $2,$f0; \ + j $31; \ + nop; \ + .set reorder; \ + ENDFN (NAME) + +#ifdef L_m16addsf3 +SFOP(__mips16_addsf3, add.s) +#endif +#ifdef L_m16subsf3 +SFOP(__mips16_subsf3, sub.s) +#endif +#ifdef L_m16mulsf3 +SFOP(__mips16_mulsf3, mul.s) +#endif +#ifdef L_m16divsf3 +SFOP(__mips16_divsf3, div.s) +#endif + +#define SFOP2(NAME, OPCODE) \ +STARTFN (NAME); \ + .set noreorder; \ + mtc1 $4,$f0; \ + nop; \ + OPCODE $f0,$f0; \ + mfc1 $2,$f0; \ + j $31; \ + nop; \ + .set reorder; \ + ENDFN (NAME) + +#ifdef L_m16negsf2 +SFOP2(__mips16_negsf2, neg.s) +#endif +#ifdef L_m16abssf2 +SFOP2(__mips16_abssf2, abs.s) +#endif + +/* Single precision comparisons. */ + +/* This macro defines a function which loads two single precision + values, performs a floating point comparison, and returns the + specified values according to whether the comparison is true or + false. */ + +#define SFCMP(NAME, OPCODE, TRUE, FALSE) \ +STARTFN (NAME); \ + mtc1 $4,$f0; \ + mtc1 $5,$f2; \ + OPCODE $f0,$f2; \ + li $2,TRUE; \ + bc1t 1f; \ + li $2,FALSE; \ +1:; \ + j $31; \ + ENDFN (NAME) + +/* This macro is like SFCMP, but it reverses the comparison. */ + +#define SFREVCMP(NAME, OPCODE, TRUE, FALSE) \ +STARTFN (NAME); \ + mtc1 $4,$f0; \ + mtc1 $5,$f2; \ + OPCODE $f2,$f0; \ + li $2,TRUE; \ + bc1t 1f; \ + li $2,FALSE; \ +1:; \ + j $31; \ + ENDFN (NAME) + +#ifdef L_m16eqsf2 +SFCMP(__mips16_eqsf2, c.eq.s, 0, 1) +#endif +#ifdef L_m16nesf2 +SFCMP(__mips16_nesf2, c.eq.s, 0, 1) +#endif +#ifdef L_m16gtsf2 +SFREVCMP(__mips16_gtsf2, c.lt.s, 1, 0) +#endif +#ifdef L_m16gesf2 +SFREVCMP(__mips16_gesf2, c.le.s, 0, -1) +#endif +#ifdef L_m16lesf2 +SFCMP(__mips16_lesf2, c.le.s, 0, 1) +#endif +#ifdef L_m16ltsf2 +SFCMP(__mips16_ltsf2, c.lt.s, -1, 0) +#endif + +/* Single precision conversions. */ + +#ifdef L_m16fltsisf +STARTFN (__mips16_floatsisf) + .set noreorder + mtc1 $4,$f0 + nop + cvt.s.w $f0,$f0 + mfc1 $2,$f0 + j $31 + nop + .set reorder + ENDFN (__mips16_floatsisf) +#endif + +#ifdef L_m16fix_truncsfsi +STARTFN (__mips16_fix_truncsfsi) + .set noreorder + mtc1 $4,$f0 + nop + trunc.w.s $f0,$f0,$4 + mfc1 $2,$f0 + j $31 + nop + .set reorder + ENDFN (__mips16_fix_truncsfsi) +#endif + +#if !defined(__mips_single_float) && !defined(__SINGLE_FLOAT) + +/* The double precision operations. We need to use different code + based on the preprocessor symbol __mips64, because the way in which + double precision values will change. Without __mips64, the value + is passed in two 32 bit registers. With __mips64, the value is + passed in a single 64 bit register. */ + +/* Load the first double precision operand. */ + +#if defined(__mips64) +#define LDDBL1 dmtc1 $4,$f12 +#elif defined(__mipsfp64) +#define LDDBL1 sw $4,0($29); sw $5,4($29); l.d $f12,0($29) +#elif defined(__MIPSEB__) +#define LDDBL1 mtc1 $4,$f13; mtc1 $5,$f12 +#else +#define LDDBL1 mtc1 $4,$f12; mtc1 $5,$f13 +#endif + +/* Load the second double precision operand. */ + +#if defined(__mips64) +/* XXX this should be $6 for Algo arg passing model */ +#define LDDBL2 dmtc1 $5,$f14 +#elif defined(__mipsfp64) +#define LDDBL2 sw $6,8($29); sw $7,12($29); l.d $f14,8($29) +#elif defined(__MIPSEB__) +#define LDDBL2 mtc1 $6,$f15; mtc1 $7,$f14 +#else +#define LDDBL2 mtc1 $6,$f14; mtc1 $7,$f15 +#endif + +/* Move the double precision return value to the right place. */ + +#if defined(__mips64) +#define RETDBL dmfc1 $2,$f0 +#elif defined(__mipsfp64) +#define RETDBL s.d $f0,0($29); lw $2,0($29); lw $3,4($29) +#elif defined(__MIPSEB__) +#define RETDBL mfc1 $2,$f1; mfc1 $3,$f0 +#else +#define RETDBL mfc1 $2,$f0; mfc1 $3,$f1 +#endif + +/* Double precision math. */ + +/* This macro defines a function which loads two double precision + values, performs an operation, and returns the double precision + result. */ + +#define DFOP(NAME, OPCODE) \ +STARTFN (NAME); \ + .set noreorder; \ + LDDBL1; \ + LDDBL2; \ + nop; \ + OPCODE $f0,$f12,$f14; \ + RETDBL; \ + j $31; \ + nop; \ + .set reorder; \ + ENDFN (NAME) + +#ifdef L_m16adddf3 +DFOP(__mips16_adddf3, add.d) +#endif +#ifdef L_m16subdf3 +DFOP(__mips16_subdf3, sub.d) +#endif +#ifdef L_m16muldf3 +DFOP(__mips16_muldf3, mul.d) +#endif +#ifdef L_m16divdf3 +DFOP(__mips16_divdf3, div.d) +#endif + +#define DFOP2(NAME, OPCODE) \ +STARTFN (NAME); \ + .set noreorder; \ + LDDBL1; \ + nop; \ + OPCODE $f0,$f12; \ + RETDBL; \ + j $31; \ + nop; \ + .set reorder; \ + ENDFN (NAME) + +#ifdef L_m16negdf2 +DFOP2(__mips16_negdf2, neg.d) +#endif +#ifdef L_m16absdf2 +DFOP2(__mips16_absdf2, abs.d) +#endif + + +/* Conversions between single and double precision. */ + +#ifdef L_m16extsfdf2 +STARTFN (__mips16_extendsfdf2) + .set noreorder + mtc1 $4,$f12 + nop + cvt.d.s $f0,$f12 + RETDBL + j $31 + nop + .set reorder + ENDFN (__mips16_extendsfdf2) +#endif + +#ifdef L_m16trdfsf2 +STARTFN (__mips16_truncdfsf2) + .set noreorder + LDDBL1 + nop + cvt.s.d $f0,$f12 + mfc1 $2,$f0 + j $31 + nop + .set reorder + ENDFN (__mips16_truncdfsf2) +#endif + +/* Double precision comparisons. */ + +/* This macro defines a function which loads two double precision + values, performs a floating point comparison, and returns the + specified values according to whether the comparison is true or + false. */ + +#define DFCMP(NAME, OPCODE, TRUE, FALSE) \ +STARTFN (NAME); \ + LDDBL1; \ + LDDBL2; \ + OPCODE $f12,$f14; \ + li $2,TRUE; \ + bc1t 1f; \ + li $2,FALSE; \ +1:; \ + j $31; \ + ENDFN (NAME) + +/* This macro is like DFCMP, but it reverses the comparison. */ + +#define DFREVCMP(NAME, OPCODE, TRUE, FALSE) \ +STARTFN (NAME); \ + LDDBL1; \ + LDDBL2; \ + OPCODE $f14,$f12; \ + li $2,TRUE; \ + bc1t 1f; \ + li $2,FALSE; \ +1:; \ + j $31; \ + ENDFN (NAME) + +#ifdef L_m16eqdf2 +DFCMP(__mips16_eqdf2, c.eq.d, 0, 1) +#endif +#ifdef L_m16nedf2 +DFCMP(__mips16_nedf2, c.eq.d, 0, 1) +#endif +#ifdef L_m16gtdf2 +DFREVCMP(__mips16_gtdf2, c.lt.d, 1, 0) +#endif +#ifdef L_m16gedf2 +DFREVCMP(__mips16_gedf2, c.le.d, 0, -1) +#endif +#ifdef L_m16ledf2 +DFCMP(__mips16_ledf2, c.le.d, 0, 1) +#endif +#ifdef L_m16ltdf2 +DFCMP(__mips16_ltdf2, c.lt.d, -1, 0) +#endif + +/* Double precision conversions. */ + +#ifdef L_m16fltsidf +STARTFN (__mips16_floatsidf) + .set noreorder + mtc1 $4,$f12 + nop + cvt.d.w $f0,$f12 + RETDBL + j $31 + nop + .set reorder + ENDFN (__mips16_floatsidf) +#endif + +#ifdef L_m16fix_truncdfsi +STARTFN (__mips16_fix_truncdfsi) + .set noreorder + LDDBL1 + nop + trunc.w.d $f0,$f12,$4 + mfc1 $2,$f0 + j $31 + nop + .set reorder + ENDFN (__mips16_fix_truncdfsi) +#endif +#endif /* !__mips_single_float */ + +/* These functions are used to return floating point values from + mips16 functions. In this case we can put mtc1 in a jump delay slot, + because we know that the next instruction will not refer to a floating + point register. */ + +#ifdef L_m16retsf +STARTFN (__mips16_ret_sf) + .set noreorder + j $31 + mtc1 $2,$f0 + .set reorder + ENDFN (__mips16_ret_sf) +#endif + +#if !defined(__mips_single_float) && !defined(__SINGLE_FLOAT) +#ifdef L_m16retdf +STARTFN (__mips16_ret_df) + .set noreorder +#if defined(__mips64) + j $31 + dmtc1 $2,$f0 +#elif defined(__mipsfp64) + sw $2,0($29) + sw $3,4($29) + l.d $f0,0($29) +#elif defined(__MIPSEB__) + mtc1 $2,$f1 + j $31 + mtc1 $3,$f0 +#else + mtc1 $2,$f0 + j $31 + mtc1 $3,$f1 +#endif + .set reorder + ENDFN (__mips16_ret_df) +#endif +#endif /* !__mips_single_float */ + +/* These functions are used by 16 bit code when calling via a function + pointer. They must copy the floating point arguments from the gp + regs into the fp regs. The function to call will be in $2. The + exact set of floating point arguments to copy is encoded in the + function name; the final number is an fp_code, as described in + mips.h in the comment about CUMULATIVE_ARGS. */ + +#ifdef L_m16stub1 +/* (float) */ +STARTFN (__mips16_call_stub_1) + .set noreorder + mtc1 $4,$f12 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_1) +#endif + +#ifdef L_m16stub5 +/* (float, float) */ +STARTFN (__mips16_call_stub_5) + .set noreorder + mtc1 $4,$f12 + mtc1 $5,$f14 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_5) +#endif + +#if !defined(__mips_single_float) && !defined(__SINGLE_FLOAT) + +#ifdef L_m16stub2 +/* (double) */ +STARTFN (__mips16_call_stub_2) + .set noreorder + LDDBL1 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_2) +#endif + +#ifdef L_m16stub6 +/* (double, float) */ +STARTFN (__mips16_call_stub_6) + .set noreorder + LDDBL1 + mtc1 $6,$f14 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_6) +#endif + +#ifdef L_m16stub9 +/* (float, double) */ +STARTFN (__mips16_call_stub_9) + .set noreorder + mtc1 $4,$f12 + LDDBL2 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_9) +#endif + +#ifdef L_m16stub10 +/* (double, double) */ +STARTFN (__mips16_call_stub_10) + .set noreorder + LDDBL1 + LDDBL2 + j $2 + nop + .set reorder + ENDFN (__mips16_call_stub_10) +#endif +#endif /* !__mips_single_float */ + +/* Now we have the same set of functions, except that this time the + function being called returns an SFmode value. The calling + function will arrange to preserve $18, so these functions are free + to use it to hold the return address. + + Note that we do not know whether the function we are calling is 16 + bit or 32 bit. However, it does not matter, because 16 bit + functions always return floating point values in both the gp and + the fp regs. It would be possible to check whether the function + being called is 16 bits, in which case the copy is unnecessary; + however, it's faster to always do the copy. */ + +#ifdef L_m16stubsf0 +/* () */ +STARTFN (__mips16_call_stub_sf_0) + .set noreorder + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_0) +#endif + +#ifdef L_m16stubsf1 +/* (float) */ +STARTFN (__mips16_call_stub_sf_1) + .set noreorder + mtc1 $4,$f12 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_1) +#endif + +#ifdef L_m16stubsf5 +/* (float, float) */ +STARTFN (__mips16_call_stub_sf_5) + .set noreorder + mtc1 $4,$f12 + mtc1 $5,$f14 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_5) +#endif + +#if !defined(__mips_single_float) && !defined(__SINGLE_FLOAT) +#ifdef L_m16stubsf2 +/* (double) */ +STARTFN (__mips16_call_stub_sf_2) + .set noreorder + LDDBL1 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_2) +#endif + +#ifdef L_m16stubsf6 +/* (double, float) */ +STARTFN (__mips16_call_stub_sf_6) + .set noreorder + LDDBL1 + mtc1 $6,$f14 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_6) +#endif + +#ifdef L_m16stubsf9 +/* (float, double) */ +STARTFN (__mips16_call_stub_sf_9) + .set noreorder + mtc1 $4,$f12 + LDDBL2 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_9) +#endif + +#ifdef L_m16stubsf10 +/* (double, double) */ +STARTFN (__mips16_call_stub_sf_10) + .set noreorder + LDDBL1 + LDDBL2 + move $18,$31 + jal $2 + nop + mfc1 $2,$f0 + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_sf_10) +#endif + +/* Now we have the same set of functions again, except that this time + the function being called returns an DFmode value. */ + +#ifdef L_m16stubdf0 +/* () */ +STARTFN (__mips16_call_stub_df_0) + .set noreorder + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_0) +#endif + +#ifdef L_m16stubdf1 +/* (float) */ +STARTFN (__mips16_call_stub_df_1) + .set noreorder + mtc1 $4,$f12 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_1) +#endif + +#ifdef L_m16stubdf2 +/* (double) */ +STARTFN (__mips16_call_stub_df_2) + .set noreorder + LDDBL1 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_2) +#endif + +#ifdef L_m16stubdf5 +/* (float, float) */ +STARTFN (__mips16_call_stub_df_5) + .set noreorder + mtc1 $4,$f12 + mtc1 $5,$f14 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_5) +#endif + +#ifdef L_m16stubdf6 +/* (double, float) */ +STARTFN (__mips16_call_stub_df_6) + .set noreorder + LDDBL1 + mtc1 $6,$f14 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_6) +#endif + +#ifdef L_m16stubdf9 +/* (float, double) */ +STARTFN (__mips16_call_stub_df_9) + .set noreorder + mtc1 $4,$f12 + LDDBL2 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_9) +#endif + +#ifdef L_m16stubdf10 +/* (double, double) */ +STARTFN (__mips16_call_stub_df_10) + .set noreorder + LDDBL1 + LDDBL2 + move $18,$31 + jal $2 + nop + RETDBL + j $18 + nop + .set reorder + ENDFN (__mips16_call_stub_df_10) +#endif +#endif /* !__mips_single_float */ diff --git a/contrib/gcc/config/mips/netbsd.h b/contrib/gcc/config/mips/netbsd.h new file mode 100644 index 00000000000..6b335ca34ee --- /dev/null +++ b/contrib/gcc/config/mips/netbsd.h @@ -0,0 +1,203 @@ +/* Definitions of target machine for GNU compiler, for MIPS NetBSD systems. + Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + + +/* Define default target values. */ + +#undef MACHINE_TYPE +#if TARGET_ENDIAN_DEFAULT != 0 +#define MACHINE_TYPE "NetBSD/mipseb ELF" +#else +#define MACHINE_TYPE "NetBSD/mipsel ELF" +#endif + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + NETBSD_OS_CPP_BUILTINS_ELF(); \ + builtin_define ("__NO_LEADING_UNDERSCORES__"); \ + builtin_define ("__GP_SUPPORT__"); \ + if (TARGET_LONG64) \ + builtin_define ("__LONG64"); \ + \ + if (TARGET_ABICALLS) \ + builtin_define ("__ABICALLS__"); \ + \ + if (mips_abi == ABI_EABI) \ + builtin_define ("__mips_eabi"); \ + else if (mips_abi == ABI_N32) \ + builtin_define ("__mips_n32"); \ + else if (mips_abi == ABI_64) \ + builtin_define ("__mips_n64"); \ + else if (mips_abi == ABI_O64) \ + builtin_define ("__mips_o64"); \ + } \ + while (0) + +/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD. + Specifically, they define too many namespace-invasive macros. Override + them here. Note this is structured for easy comparison to the version + in mips.h. + + FIXME: This probably isn't the best solution. But in the absence + of something better, it will have to do, for now. */ + +#undef TARGET_CPU_CPP_BUILTINS +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("cpu=mips"); \ + builtin_define ("__mips__"); \ + builtin_define ("_mips"); \ + \ + /* No _R3000 or _R4000. */ \ + if (TARGET_64BIT) \ + builtin_define ("__mips64"); \ + \ + if (TARGET_FLOAT64) \ + builtin_define ("__mips_fpr=64"); \ + else \ + builtin_define ("__mips_fpr=32"); \ + \ + if (TARGET_MIPS16) \ + builtin_define ("__mips16"); \ + \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \ + \ + if (ISA_MIPS1) \ + builtin_define ("__mips=1"); \ + else if (ISA_MIPS2) \ + builtin_define ("__mips=2"); \ + else if (ISA_MIPS3) \ + builtin_define ("__mips=3"); \ + else if (ISA_MIPS4) \ + builtin_define ("__mips=4"); \ + else if (ISA_MIPS32) \ + { \ + builtin_define ("__mips=32"); \ + builtin_define ("__mips_isa_rev=1"); \ + } \ + else if (ISA_MIPS32R2) \ + { \ + builtin_define ("__mips=32"); \ + builtin_define ("__mips_isa_rev=2"); \ + } \ + else if (ISA_MIPS64) \ + { \ + builtin_define ("__mips=64"); \ + builtin_define ("__mips_isa_rev=1"); \ + } \ + \ + if (TARGET_HARD_FLOAT) \ + builtin_define ("__mips_hard_float"); \ + else if (TARGET_SOFT_FLOAT) \ + builtin_define ("__mips_soft_float"); \ + \ + if (TARGET_SINGLE_FLOAT) \ + builtin_define ("__mips_single_float"); \ + \ + if (TARGET_BIG_ENDIAN) \ + builtin_define ("__MIPSEB__"); \ + else \ + builtin_define ("__MIPSEL__"); \ + \ + /* No language dialect defines. */ \ + \ + /* ABIs handled in TARGET_OS_CPP_BUILTINS. */ \ + } \ + while (0) + + +/* Clean up after the generic MIPS/ELF configuration. */ +#undef MD_EXEC_PREFIX +#undef MD_STARTFILE_PREFIX + +/* Extra specs we need. */ +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ + { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + +/* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. */ + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%(netbsd_cpp_spec)" + +/* Provide a LINK_SPEC appropriate for a NetBSD/mips target. + This is a copy of LINK_SPEC from tweaked for + the MIPS target. */ + +#undef LINK_SPEC +#define LINK_SPEC \ + "%{EL:-m elf32lmip} \ + %{EB:-m elf32bmip} \ + %(endian_spec) \ + %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \ + %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \ + %(netbsd_link_spec)" + +#define NETBSD_ENTRY_POINT "__start" + +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC \ + "%{!mno-abicalls: \ + %{!fno-PIC:%{!fno-pic:-KPIC}}}" + + +/* -G is incompatible with -KPIC which is the default, so only allow objects + in the small data section if the user explicitly asks for it. */ + +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 + + +/* This defines which switch letters take arguments. -G is a MIPS + special. */ + +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ + || (CHAR) == 'R' \ + || (CHAR) == 'G') + + +#undef ASM_FINAL_SPEC +#undef SET_ASM_OP + + +/* NetBSD hasn't historically provided _flush_cache(), but rather + _cacheflush(), which takes the same arguments as the former. */ +#undef CACHE_FLUSH_FUNC +#define CACHE_FLUSH_FUNC "_cacheflush" + + +/* Make gcc agree with */ + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef WINT_TYPE +#define WINT_TYPE "int" diff --git a/contrib/gcc/config/mips/openbsd.h b/contrib/gcc/config/mips/openbsd.h new file mode 100644 index 00000000000..69cc0c6ad1a --- /dev/null +++ b/contrib/gcc/config/mips/openbsd.h @@ -0,0 +1,98 @@ +/* Configuration for a MIPS ABI32 OpenBSD target. + Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Definitions needed for OpenBSD, to avoid picking mips 'defaults'. */ + +/* GAS must know this. */ +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}" + +#define AS_NEEDS_DASH_FOR_PIPED_INPUT + +/* CPP specific OpenBSD specs. */ +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC + +/* Needed for ELF (inspired by netbsd-elf). */ +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* The profiling lib spec here is not really correct but we leave + it as it is until we have some kind of profiling working. */ +#define LIB_SPEC OBSD_LIB_SPEC + +/* mips assembler uses .set for arcane purposes. __attribute__((alias)) + and friends won't work until we get recent binutils with .weakext + support. */ +#undef SET_ASM_OP + +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define ("__unix__"); \ + builtin_define ("__SYSTYPE_BSD__"); \ + builtin_define ("__NO_LEADING_UNDERSCORES__"); \ + builtin_define ("__GP_SUPPORT__"); \ + builtin_define ("__OpenBSD__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=OpenBSD"); \ +} while (0) + +/* Layout of source language data types. */ + +/* This must agree with . */ +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +/* Controlling the compilation driver. */ + +/* LINK_SPEC appropriate for OpenBSD: support for GCC options + -static, -assert, and -nostdlib. Dynamic loader control. */ +#undef LINK_SPEC +#define LINK_SPEC \ + "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ + %{bestGnum} %{shared} %{non_shared} \ + %{call_shared} %{no_archive} %{exact_version} \ + %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \ + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \ + %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \ + %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}" + +/* -G is incompatible with -KPIC which is the default, so only allow objects + in the small data section if the user explicitly asks for it. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 + + +/* Since gas and gld are standard on OpenBSD, we don't need these. */ +#undef ASM_FINAL_SPEC +#undef STARTFILE_SPEC + +/* Switch into a generic section. */ +#undef TARGET_ASM_NAMED_SECTION +#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section diff --git a/contrib/gcc/config/mips/predicates.md b/contrib/gcc/config/mips/predicates.md new file mode 100644 index 00000000000..9a6756c20a2 --- /dev/null +++ b/contrib/gcc/config/mips/predicates.md @@ -0,0 +1,286 @@ +;; Predicate definitions for MIPS. +;; Copyright (C) 2004 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_predicate "const_uns_arith_operand" + (and (match_code "const_int") + (match_test "SMALL_OPERAND_UNSIGNED (INTVAL (op))"))) + +(define_predicate "uns_arith_operand" + (ior (match_operand 0 "const_uns_arith_operand") + (match_operand 0 "register_operand"))) + +(define_predicate "const_arith_operand" + (and (match_code "const_int") + (match_test "SMALL_OPERAND (INTVAL (op))"))) + +(define_predicate "arith_operand" + (ior (match_operand 0 "const_arith_operand") + (match_operand 0 "register_operand"))) + +(define_predicate "const_uimm6_operand" + (and (match_code "const_int") + (match_test "UIMM6_OPERAND (INTVAL (op))"))) + +(define_predicate "const_imm10_operand" + (and (match_code "const_int") + (match_test "IMM10_OPERAND (INTVAL (op))"))) + +(define_predicate "reg_imm10_operand" + (ior (match_operand 0 "const_imm10_operand") + (match_operand 0 "register_operand"))) + +(define_predicate "sle_operand" + (and (match_code "const_int") + (match_test "SMALL_OPERAND (INTVAL (op) + 1)"))) + +(define_predicate "sleu_operand" + (and (match_operand 0 "sle_operand") + (match_test "INTVAL (op) + 1 != 0"))) + +(define_predicate "const_0_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (GET_MODE (op))"))) + +(define_predicate "reg_or_0_operand" + (ior (and (match_operand 0 "const_0_operand") + (match_test "!TARGET_MIPS16")) + (match_operand 0 "register_operand"))) + +(define_predicate "const_1_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST1_RTX (GET_MODE (op))"))) + +(define_predicate "reg_or_1_operand" + (ior (match_operand 0 "const_1_operand") + (match_operand 0 "register_operand"))) + +;; This is used for indexing into vectors, and hence only accepts const_int. +(define_predicate "const_0_or_1_operand" + (and (match_code "const_int") + (ior (match_test "op == CONST0_RTX (GET_MODE (op))") + (match_test "op == CONST1_RTX (GET_MODE (op))")))) + +(define_predicate "fpr_operand" + (and (match_code "reg") + (match_test "FP_REG_P (REGNO (op))"))) + +(define_predicate "lo_operand" + (and (match_code "reg") + (match_test "REGNO (op) == LO_REGNUM"))) + +(define_predicate "fcc_reload_operand" + (and (match_code "reg,subreg") + (match_test "ST_REG_P (true_regnum (op))"))) + +(define_special_predicate "pc_or_label_operand" + (match_code "pc,label_ref")) + +(define_predicate "const_call_insn_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type symbol_type; + + if (!mips_symbolic_constant_p (op, &symbol_type)) + return false; + + switch (symbol_type) + { + case SYMBOL_GENERAL: + /* We can only use direct calls for TARGET_ABSOLUTE_ABICALLS if we + are sure that the target function does not need $25 to be live + on entry. This is true for any locally-defined function because + any such function will use %hi/%lo accesses to set up $gp. */ + if (TARGET_ABSOLUTE_ABICALLS + && !(GET_CODE (op) == SYMBOL_REF + && SYMBOL_REF_DECL (op) + && !DECL_EXTERNAL (SYMBOL_REF_DECL (op)))) + return false; + + /* If -mlong-calls, force all calls to use register addressing. Also, + if this function has the long_call attribute, we must use register + addressing. */ + return !TARGET_LONG_CALLS && !SYMBOL_REF_LONG_CALL_P (op); + + case SYMBOL_GOT_GLOBAL: + /* Without explicit relocs, there is no special syntax for + loading the address of a call destination into a register. + Using "la $25,foo; jal $25" would prevent the lazy binding + of "foo", so keep the address of global symbols with the + jal macro. */ + return !TARGET_EXPLICIT_RELOCS; + + default: + return false; + } +}) + +(define_predicate "call_insn_operand" + (ior (match_operand 0 "const_call_insn_operand") + (match_operand 0 "register_operand"))) + +;; A legitimate CONST_INT operand that takes more than one instruction +;; to load. +(define_predicate "splittable_const_int_operand" + (match_code "const_int") +{ + /* When generating mips16 code, LEGITIMATE_CONSTANT_P rejects + CONST_INTs that can't be loaded using simple insns. */ + if (TARGET_MIPS16) + return false; + + /* Don't handle multi-word moves this way; we don't want to introduce + the individual word-mode moves until after reload. */ + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + return false; + + /* Otherwise check whether the constant can be loaded in a single + instruction. */ + return !LUI_INT (op) && !SMALL_INT (op) && !SMALL_INT_UNSIGNED (op); +}) + +;; A legitimate symbolic operand that takes more than one instruction +;; to load. +(define_predicate "splittable_symbolic_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type symbol_type; + return (mips_symbolic_constant_p (op, &symbol_type) + && mips_split_p[symbol_type]); +}) + +(define_predicate "move_operand" + (match_operand 0 "general_operand") +{ + enum mips_symbol_type symbol_type; + + /* The thinking here is as follows: + + (1) The move expanders should split complex load sequences into + individual instructions. Those individual instructions can + then be optimized by all rtl passes. + + (2) The target of pre-reload load sequences should not be used + to store temporary results. If the target register is only + assigned one value, reload can rematerialize that value + on demand, rather than spill it to the stack. + + (3) If we allowed pre-reload passes like combine and cse to recreate + complex load sequences, we would want to be able to split the + sequences before reload as well, so that the pre-reload scheduler + can see the individual instructions. This falls foul of (2); + the splitter would be forced to reuse the target register for + intermediate results. + + (4) We want to define complex load splitters for combine. These + splitters can request a temporary scratch register, which avoids + the problem in (2). They allow things like: + + (set (reg T1) (high SYM)) + (set (reg T2) (low (reg T1) SYM)) + (set (reg X) (plus (reg T2) (const_int OFFSET))) + + to be combined into: + + (set (reg T3) (high SYM+OFFSET)) + (set (reg X) (lo_sum (reg T3) SYM+OFFSET)) + + if T2 is only used this once. */ + switch (GET_CODE (op)) + { + case CONST_INT: + return !splittable_const_int_operand (op, mode); + + case CONST: + case SYMBOL_REF: + case LABEL_REF: + if (CONST_GP_P (op)) + return true; + return (mips_symbolic_constant_p (op, &symbol_type) + && !mips_split_p[symbol_type]); + + default: + return true; + } +}) + +(define_predicate "consttable_operand" + (match_test "CONSTANT_P (op)")) + +(define_predicate "symbolic_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type type; + return mips_symbolic_constant_p (op, &type); +}) + +(define_predicate "general_symbolic_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type type; + return mips_symbolic_constant_p (op, &type) && type == SYMBOL_GENERAL; +}) + +(define_predicate "global_got_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type type; + return mips_symbolic_constant_p (op, &type) && type == SYMBOL_GOT_GLOBAL; +}) + +(define_predicate "local_got_operand" + (match_code "const,symbol_ref,label_ref") +{ + enum mips_symbol_type type; + return mips_symbolic_constant_p (op, &type) && type == SYMBOL_GOT_LOCAL; +}) + +(define_predicate "stack_operand" + (and (match_code "mem") + (match_test "mips_stack_address_p (XEXP (op, 0), GET_MODE (op))"))) + +(define_predicate "macc_msac_operand" + (ior (and (match_code "plus") (match_test "ISA_HAS_MACC")) + (and (match_code "minus") (match_test "ISA_HAS_MSAC"))) +{ + rtx mult = XEXP (op, GET_CODE (op) == PLUS ? 0 : 1); + rtx accum = XEXP (op, GET_CODE (op) == PLUS ? 1 : 0); + return (GET_CODE (mult) == MULT + && REG_P (XEXP (mult, 0)) + && REG_P (XEXP (mult, 1)) + && REG_P (accum)); +}) + + +(define_predicate "equality_operator" + (match_code "eq,ne")) + +(define_predicate "extend_operator" + (match_code "zero_extend,sign_extend")) + +(define_predicate "trap_comparison_operator" + (match_code "eq,ne,lt,ltu,ge,geu")) + +(define_predicate "order_operator" + (match_code "lt,ltu,le,leu,ge,geu,gt,gtu")) + + +(define_predicate "small_data_pattern" + (and (match_code "set,parallel,unspec,unspec_volatile,prefetch") + (match_test "mips_small_data_pattern_p (op)"))) diff --git a/contrib/gcc/config/mips/r3900.h b/contrib/gcc/config/mips/r3900.h new file mode 100644 index 00000000000..d524689be86 --- /dev/null +++ b/contrib/gcc/config/mips/r3900.h @@ -0,0 +1,37 @@ +/* Definitions of MIPS sub target machine for GNU compiler. + Toshiba r3900. You should include mips.h after this. + + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2004 + Free Software Foundation, Inc. + Contributed by Gavin Koch (gavin@cygnus.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#define MIPS_CPU_STRING_DEFAULT "r3900" +#define MIPS_ISA_DEFAULT 1 + +#define MULTILIB_DEFAULTS { MULTILIB_ENDIAN_DEFAULT, "msoft-float" } + +/* We use the MIPS EABI by default. */ +#define MIPS_ABI_DEFAULT ABI_EABI + +/* By default (if not mips-something-else) produce code for the r3900 */ +#define SUBTARGET_CC1_SPEC "\ +%{mhard-float:%e-mhard-float not supported} \ +%{msingle-float:%{msoft-float: \ + %e-msingle-float and -msoft-float cannot both be specified}}" diff --git a/contrib/gcc/config/mips/rtems.h b/contrib/gcc/config/mips/rtems.h new file mode 100644 index 00000000000..0143de76d1d --- /dev/null +++ b/contrib/gcc/config/mips/rtems.h @@ -0,0 +1,36 @@ +/* Definitions for rtems targeting a MIPS using ELF. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005 + Free Software Foundation, Inc. + Contributed by Joel Sherrill (joel@OARcorp.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Specify predefined symbols in preprocessor. */ + +#define TARGET_OS_CPP_BUILTINS() \ +do { \ + builtin_define ("__rtems__"); \ + builtin_define ("__USE_INIT_FINI__"); \ + builtin_assert ("system=rtems"); \ +} while (0) + +/* No sdata. + * The RTEMS BSPs expect -G0 + */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 diff --git a/contrib/gcc/config/mips/sb1.md b/contrib/gcc/config/mips/sb1.md new file mode 100644 index 00000000000..7db31ef5516 --- /dev/null +++ b/contrib/gcc/config/mips/sb1.md @@ -0,0 +1,564 @@ +;; +;; DFA-based pipeline description for Broadcom SB-1 +;; + +;; The Broadcom SB-1 core is 4-way superscalar, in-order. It has 2 load/store +;; pipes (one of which can support some ALU operations), 2 alu pipes, 2 FP +;; pipes, and 1 MDMX pipes. It can issue 2 ls insns and 2 exe/fpu/mdmx insns +;; each cycle. + +;; We model the 4-way issue by ordering unit choices. The possible choices are +;; {ex1,fp1}|{ex0,fp0}|ls1|ls0. Instructions issue to the first eligible unit +;; in the list in most cases. Non-indexed load/stores issue to ls0 first. +;; simple alu operations issue to ls1 if it is still available, and their +;; operands are ready (no co-issue with loads), otherwise to the first +;; available ex unit. + +;; When exceptions are enabled, can only issue FP insns to fp1. This is +;; to ensure that instructions complete in order. The -mfp-exceptions option +;; can be used to specify whether the system has FP exceptions enabled or not. + +;; In 32-bit mode, dependent FP can't co-issue with load, and only one FP exe +;; insn can issue per cycle (fp1). + +;; The A1 MDMX pipe is separate from the FP pipes, but uses the same register +;; file. As a result, once an MDMX insn is issued, no FP insns can be issued +;; for 3 cycles. When an FP insn is issued, no MDMX insn can be issued for +;; 5 cycles. This is currently not handled because there is no MDMX insn +;; support as yet. + +;; +;; We use two automata. sb1_cpu_div is for the integer divides, which are +;; not pipelined. sb1_cpu is for everything else. +;; +(define_automaton "sb1_cpu, sb1_cpu_div") + +;; Load/store function units. +(define_cpu_unit "sb1_ls0" "sb1_cpu") +(define_cpu_unit "sb1_ls1" "sb1_cpu") + +;; CPU function units. +(define_cpu_unit "sb1_ex0" "sb1_cpu") +(define_cpu_unit "sb1_ex1" "sb1_cpu") + +;; The divide unit is not pipelined, and blocks hi/lo reads and writes. +(define_cpu_unit "sb1_div" "sb1_cpu_div") +;; DMULT block any multiply from issuing in the next cycle. +(define_cpu_unit "sb1_mul" "sb1_cpu") + +;; Floating-point units. +(define_cpu_unit "sb1_fp0" "sb1_cpu") +(define_cpu_unit "sb1_fp1" "sb1_cpu") + +;; Can only issue to one of the ex and fp pipes at a time. +(exclusion_set "sb1_ex0" "sb1_fp0") +(exclusion_set "sb1_ex1" "sb1_fp1") + +;; Define an SB-1 specific attribute to simplify some FP descriptions. +;; We can use 2 FP pipes only if we have 64-bit FP code, and exceptions are +;; disabled. + +(define_attr "sb1_fp_pipes" "one,two" + (cond [(and (ne (symbol_ref "TARGET_FLOAT64") (const_int 0)) + (eq (symbol_ref "TARGET_FP_EXCEPTIONS") (const_int 0))) + (const_string "two")] + (const_string "one"))) + +;; Define reservations for common combinations. + +;; For long cycle operations, the FPU has a 4 cycle pipeline that repeats, +;; effectively re-issuing the operation every 4 cycles. This means that we +;; can have at most 4 long-cycle operations per pipe. + +;; ??? The fdiv operations should be e.g. +;; sb1_fp1_4cycles*7" | "sb1_fp0_4cycle*7 +;; but the DFA is too large when we do that. Perhaps have to use scheduler +;; hooks here. + +;; ??? Try limiting scheduler to 2 long latency operations, and see if this +;; results in a usable DFA, and whether it helps code performance. + +;;(define_reservation "sb1_fp0_4cycles" "sb1_fp0, nothing*3") +;;(define_reservation "sb1_fp1_4cycles" "sb1_fp1, nothing*3") + +;; +;; The ordering of the instruction-execution-path/resource-usage +;; descriptions (also known as reservation RTL) is roughly ordered +;; based on the define attribute RTL for the "type" classification. +;; When modifying, remember that the first test that matches is the +;; reservation used! +;; + +(define_insn_reservation "ir_sb1_unknown" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "unknown,multi")) + "sb1_ls0+sb1_ls1+sb1_ex0+sb1_ex1+sb1_fp0+sb1_fp1") + +;; predicted taken branch causes 2 cycle ifetch bubble. predicted not +;; taken branch causes 0 cycle ifetch bubble. mispredicted branch causes 8 +;; cycle ifetch bubble. We assume all branches predicted not taken. + +;; ??? This assumption that branches are predicated not taken should be +;; investigated. Maybe using 2 here will give better results. + +(define_insn_reservation "ir_sb1_branch" 0 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "branch,jump,call")) + "sb1_ex0") + +;; ??? This is 1 cycle for ldl/ldr to ldl/ldr when they use the same data +;; register as destination. + +;; ??? SB-1 can co-issue a load with a dependent arith insn if it executes on +;; an EX unit. Can not co-issue if the dependent insn executes on an LS unit. +;; SB-1A can always co-issue here. + +;; A load normally has a latency of zero cycles. In some cases, dependent +;; insns can be issued in the same cycle. However, a value of 1 gives +;; better performance in empirical testing. + +(define_insn_reservation "ir_sb1_load" 1 + (and (eq_attr "cpu" "sb1") + (eq_attr "type" "load,prefetch")) + "sb1_ls0 | sb1_ls1") + +(define_insn_reservation "ir_sb1a_load" 0 + (and (eq_attr "cpu" "sb1a") + (eq_attr "type" "load,prefetch")) + "sb1_ls0 | sb1_ls1") + +;; Can not co-issue fpload with fp exe when in 32-bit mode. + +(define_insn_reservation "ir_sb1_fpload" 0 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fpload") + (ne (symbol_ref "TARGET_FLOAT64") + (const_int 0)))) + "sb1_ls0 | sb1_ls1") + +(define_insn_reservation "ir_sb1_fpload_32bitfp" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fpload") + (eq (symbol_ref "TARGET_FLOAT64") + (const_int 0)))) + "sb1_ls0 | sb1_ls1") + +;; Indexed loads can only execute on LS1 pipe. + +(define_insn_reservation "ir_sb1_fpidxload" 0 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fpidxload") + (ne (symbol_ref "TARGET_FLOAT64") + (const_int 0)))) + "sb1_ls1") + +(define_insn_reservation "ir_sb1_fpidxload_32bitfp" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fpidxload") + (eq (symbol_ref "TARGET_FLOAT64") + (const_int 0)))) + "sb1_ls1") + +;; prefx can only execute on the ls1 pipe. + +(define_insn_reservation "ir_sb1_prefetchx" 0 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "prefetchx")) + "sb1_ls1") + +;; ??? There is a 4.5 cycle latency if a store is followed by a load, and +;; there is a RAW dependency. + +(define_insn_reservation "ir_sb1_store" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "store")) + "sb1_ls0+sb1_ex1 | sb1_ls0+sb1_ex0 | sb1_ls1+sb1_ex1 | sb1_ls1+sb1_ex0") + +(define_insn_reservation "ir_sb1_fpstore" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "fpstore")) + "sb1_ls0+sb1_fp1 | sb1_ls0+sb1_fp0 | sb1_ls1+sb1_fp1 | sb1_ls1+sb1_fp0") + +;; Indexed stores can only execute on LS1 pipe. + +(define_insn_reservation "ir_sb1_fpidxstore" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "fpidxstore")) + "sb1_ls1+sb1_fp1 | sb1_ls1+sb1_fp0") + +;; Load latencies are 3 cycles for one load to another load or store (address +;; only). This is 0 cycles for one load to a store using it as the data +;; written. + +;; This assumes that if a load is dependent on a previous insn, then it must +;; be an address dependence. + +(define_bypass 3 + "ir_sb1_load,ir_sb1a_load,ir_sb1_fpload,ir_sb1_fpload_32bitfp, + ir_sb1_fpidxload,ir_sb1_fpidxload_32bitfp" + "ir_sb1_load,ir_sb1a_load,ir_sb1_fpload,ir_sb1_fpload_32bitfp, + ir_sb1_fpidxload,ir_sb1_fpidxload_32bitfp,ir_sb1_prefetchx") + +(define_bypass 3 + "ir_sb1_load,ir_sb1a_load,ir_sb1_fpload,ir_sb1_fpload_32bitfp, + ir_sb1_fpidxload,ir_sb1_fpidxload_32bitfp" + "ir_sb1_store,ir_sb1_fpstore,ir_sb1_fpidxstore" + "mips_store_data_bypass_p") + +;; On SB-1, simple alu instructions can execute on the LS1 unit. + +;; ??? A simple alu insn issued on an LS unit has 0 cycle latency to an EX +;; insn, to a store (for data), and to an xfer insn. It has 1 cycle latency to +;; another LS insn (excluding store data). A simple alu insn issued on an EX +;; unit has a latency of 5 cycles when the results goes to a LS unit (excluding +;; store data), otherwise a latency of 1 cycle. + +;; ??? We cannot handle latencies properly for simple alu instructions +;; within the DFA pipeline model. Latencies can be defined only from one +;; insn reservation to another. We can't make them depend on which function +;; unit was used. This isn't a DFA flaw. There is a conflict here, as we +;; need to know the latency before we can determine which unit will be +;; available, but we need to know which unit it is issued to before we can +;; compute the latency. Perhaps this can be handled via scheduler hooks. +;; This needs to be investigated. + +;; ??? Optimal scheduling taking the LS units into account seems to require +;; a pre-scheduling pass. We need to determine which instructions feed results +;; into store/load addresses, and thus benefit most from being issued to the +;; LS unit. Also, we need to prune the list to ensure we don't overschedule +;; insns to the LS unit, and that we don't conflict with insns that need LS1 +;; such as indexed loads. We then need to emit nops to ensure that simple +;; alu instructions that are not supposed to be scheduled to LS1 don't +;; accidentally end up there because LS1 is free when they are issued. This +;; will be a lot of work, and it isn't clear how useful it will be. + +;; Empirical testing shows that 2 gives the best result. + +(define_insn_reservation "ir_sb1_simple_alu" 2 + (and (eq_attr "cpu" "sb1") + (eq_attr "type" "const,arith")) + "sb1_ls1 | sb1_ex1 | sb1_ex0") + +;; On SB-1A, simple alu instructions can not execute on the LS1 unit, and we +;; have none of the above problems. + +(define_insn_reservation "ir_sb1a_simple_alu" 1 + (and (eq_attr "cpu" "sb1a") + (eq_attr "type" "const,arith")) + "sb1_ex1 | sb1_ex0") + +;; ??? condmove also includes some FP instructions that execute on the FP +;; units. This needs to be clarified. + +(define_insn_reservation "ir_sb1_alu" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "condmove,nop,shift")) + "sb1_ex1 | sb1_ex0") + +;; These are type arith/darith that only execute on the EX0 unit. + +(define_insn_reservation "ir_sb1_alu_0" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "slt,clz,trap")) + "sb1_ex0") + +;; An alu insn issued on an EX unit has a latency of 5 cycles when the +;; result goes to a LS unit (excluding store data). + +;; This assumes that if a load is dependent on a previous insn, then it must +;; be an address dependence. + +(define_bypass 5 + "ir_sb1a_simple_alu,ir_sb1_alu,ir_sb1_alu_0,ir_sb1_mfhi,ir_sb1_mflo" + "ir_sb1_load,ir_sb1a_load,ir_sb1_fpload,ir_sb1_fpload_32bitfp, + ir_sb1_fpidxload,ir_sb1_fpidxload_32bitfp,ir_sb1_prefetchx") + +(define_bypass 5 + "ir_sb1a_simple_alu,ir_sb1_alu,ir_sb1_alu_0,ir_sb1_mfhi,ir_sb1_mflo" + "ir_sb1_store,ir_sb1_fpstore,ir_sb1_fpidxstore" + "mips_store_data_bypass_p") + +;; mf{hi,lo} is 1 cycle. + +(define_insn_reservation "ir_sb1_mfhi" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "mfhilo") + (not (match_operand 1 "lo_operand")))) + "sb1_ex1") + +(define_insn_reservation "ir_sb1_mflo" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "mfhilo") + (match_operand 1 "lo_operand"))) + "sb1_ex1") + +;; mt{hi,lo} to mul/div is 4 cycles. + +(define_insn_reservation "ir_sb1_mthilo" 4 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "mthilo")) + "sb1_ex1") + +;; mt{hi,lo} to mf{hi,lo} is 3 cycles. + +(define_bypass 3 "ir_sb1_mthilo" "ir_sb1_mfhi,ir_sb1_mflo") + +;; multiply latency to an EX operation is 3 cycles. + +;; ??? Should check whether we need to make multiply conflict with moves +;; to/from hilo registers. + +(define_insn_reservation "ir_sb1_mulsi" 3 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "sb1_ex1+sb1_mul") + +;; muldi to mfhi is 4 cycles. +;; Blocks any other multiply insn issue for 1 cycle. + +(define_insn_reservation "ir_sb1_muldi" 4 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "sb1_ex1+sb1_mul, sb1_mul") + +;; muldi to mflo is 3 cycles. + +(define_bypass 3 "ir_sb1_muldi" "ir_sb1_mflo") + +;; mul latency is 7 cycles if the result is used by any LS insn. + +;; This assumes that if a load is dependent on a previous insn, then it must +;; be an address dependence. + +(define_bypass 7 + "ir_sb1_mulsi,ir_sb1_muldi" + "ir_sb1_load,ir_sb1a_load,ir_sb1_fpload,ir_sb1_fpload_32bitfp, + ir_sb1_fpidxload,ir_sb1_fpidxload_32bitfp,ir_sb1_prefetchx") + +(define_bypass 7 + "ir_sb1_mulsi,ir_sb1_muldi" + "ir_sb1_store,ir_sb1_fpstore,ir_sb1_fpidxstore" + "mips_store_data_bypass_p") + +;; The divide unit is not pipelined. Divide busy is asserted in the 4th +;; cycle, and then deasserted on the latency cycle. So only one divide at +;; a time, but the first/last 4 cycles can overlap. + +;; ??? All divides block writes to hi/lo regs. hi/lo regs are written 4 cycles +;; after the latency cycle for divides (e.g. 40/72). dmult writes lo in +;; cycle 7, and hi in cycle 8. All other insns write hi/lo regs in cycle 7. +;; Default for output dependencies is the difference in latencies, which is +;; only 1 cycle off here, e.g. div to mtlo stalls for 32 cycles, but should +;; stall for 33 cycles. This does not seem significant enough to worry about. + +(define_insn_reservation "ir_sb1_divsi" 36 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "sb1_ex1, nothing*3, sb1_div*32") + +(define_insn_reservation "ir_sb1_divdi" 68 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "sb1_ex1, nothing*3, sb1_div*64") + +(define_insn_reservation "ir_sb1_fpu_2pipes" 4 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fmove,fadd,fmul,fabs,fneg,fcvt,frdiv1,frsqrt1") + (eq_attr "sb1_fp_pipes" "two"))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_fpu_1pipe" 4 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fmove,fadd,fmul,fabs,fneg,fcvt,frdiv1,frsqrt1") + (eq_attr "sb1_fp_pipes" "one"))) + "sb1_fp1") + +(define_insn_reservation "ir_sb1_fpu_step2_2pipes" 8 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv2,frsqrt2") + (eq_attr "sb1_fp_pipes" "two"))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_fpu_step2_1pipe" 8 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv2,frsqrt2") + (eq_attr "sb1_fp_pipes" "one"))) + "sb1_fp1") + +;; ??? madd/msub 4-cycle latency to itself (same fr?), but 8 cycle latency +;; otherwise. + +;; ??? Blocks issue of another non-madd/msub after 4 cycles. + +(define_insn_reservation "ir_sb1_fmadd_2pipes" 8 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fmadd") + (eq_attr "sb1_fp_pipes" "two"))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_fmadd_1pipe" 8 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fmadd") + (eq_attr "sb1_fp_pipes" "one"))) + "sb1_fp1") + +(define_insn_reservation "ir_sb1_fcmp" 4 + (and (eq_attr "cpu" "sb1,sb1a") + (eq_attr "type" "fcmp")) + "sb1_fp1") + +;; mtc1 latency 5 cycles. + +(define_insn_reservation "ir_sb1_mtxfer" 5 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "xfer") + (match_operand 0 "fpr_operand"))) + "sb1_fp0") + +;; mfc1 latency 1 cycle. + +(define_insn_reservation "ir_sb1_mfxfer" 1 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "xfer") + (not (match_operand 0 "fpr_operand")))) + "sb1_fp0") + +;; ??? Can deliver at most 1 result per every 6 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_divsf_2pipes" 24 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_divsf_1pipe" 24 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 8 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_divdf_2pipes" 32 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_divdf_1pipe" 32 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 3 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_recipsf_2pipes" 12 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_recipsf_1pipe" 12 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 5 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_recipdf_2pipes" 20 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_recipdf_1pipe" 20 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frdiv") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 7 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_sqrtsf_2pipes" 28 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fsqrt") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_sqrtsf_1pipe" 28 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fsqrt") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 10 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_sqrtdf_2pipes" 40 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fsqrt") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_sqrtdf_1pipe" 40 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "fsqrt") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 4 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_rsqrtsf_2pipes" 16 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frsqrt") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_rsqrtsf_1pipe" 16 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frsqrt") + (and (eq_attr "mode" "SF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") + +;; ??? Can deliver at most 1 result per every 7 cycles because of issue +;; restrictions. + +(define_insn_reservation "ir_sb1_rsqrtdf_2pipes" 28 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frsqrt") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "two")))) + "sb1_fp1 | sb1_fp0") + +(define_insn_reservation "ir_sb1_rsqrtdf_1pipe" 28 + (and (eq_attr "cpu" "sb1,sb1a") + (and (eq_attr "type" "frsqrt") + (and (eq_attr "mode" "DF") + (eq_attr "sb1_fp_pipes" "one")))) + "sb1_fp1") diff --git a/contrib/gcc/config/mips/sdb.h b/contrib/gcc/config/mips/sdb.h new file mode 100644 index 00000000000..a26826e4bc5 --- /dev/null +++ b/contrib/gcc/config/mips/sdb.h @@ -0,0 +1,88 @@ +/* Generate SDB debugging info. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* Note that no configuration uses sdb as its preferred format. */ + +#define SDB_DEBUGGING_INFO 1 + +/* Forward references to tags are allowed. */ +#define SDB_ALLOW_FORWARD_REFERENCES + +/* Unknown tags are also allowed. */ +#define SDB_ALLOW_UNKNOWN_REFERENCES + +/* Block start/end next label #. */ +extern int sdb_label_count; + +/* Starting line of current function. */ +extern int sdb_begin_function_line; + +/* For block start and end, we create labels, so that + later we can figure out where the correct offset is. + The normal .ent/.end serve well enough for functions, + so those are just commented out. */ + +#define PUT_SDB_BLOCK_START(LINE) \ +do { \ + fprintf (asm_out_file, \ + "%sLb%d:\n\t.begin\t%sLb%d\t%d\n", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (LINE)); \ + sdb_label_count++; \ +} while (0) + +#define PUT_SDB_BLOCK_END(LINE) \ +do { \ + fprintf (asm_out_file, \ + "%sLe%d:\n\t.bend\t%sLe%d\t%d\n", \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + LOCAL_LABEL_PREFIX, \ + sdb_label_count, \ + (LINE)); \ + sdb_label_count++; \ +} while (0) + +#define PUT_SDB_FUNCTION_START(LINE) + +#define PUT_SDB_FUNCTION_END(LINE) \ +do { \ + SDB_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line); \ +} while (0) + +#define PUT_SDB_EPILOGUE_END(NAME) + +/* We need to use .esize and .etype instead of .size and .type to + avoid conflicting with ELF directives. */ +#undef PUT_SDB_SIZE +#define PUT_SDB_SIZE(a) \ +do { \ + fprintf (asm_out_file, "\t.esize\t" HOST_WIDE_INT_PRINT_DEC ";", \ + (HOST_WIDE_INT) (a)); \ +} while (0) + +#undef PUT_SDB_TYPE +#define PUT_SDB_TYPE(a) \ +do { \ + fprintf (asm_out_file, "\t.etype\t0x%x;", (a)); \ +} while (0) diff --git a/contrib/gcc/config/mips/sr71k.md b/contrib/gcc/config/mips/sr71k.md new file mode 100644 index 00000000000..268bc4854f0 --- /dev/null +++ b/contrib/gcc/config/mips/sr71k.md @@ -0,0 +1,321 @@ +;; ......................... +;; +;; DFA-based pipeline description for Sandcraft SR3 (MIPS64 based) +;; +;; The SR3 is described as: +;; - nine-stage pipeline, insn buffering with out-of-order issue to +;; multiple function units, with an average dispatch rate of 2 +;; insn.s per cycle (max 6 insns: 2 fpu, 4 cpu). +;; +;; The details on this are scant except for a diagram in +;; Chap. 6 of Rev. 1.0 SR3 Spec. +;; +;; The model employed below is designed to closely approximate the +;; published latencies. Emulation of out-of-order issue and the insn +;; buffering is done via a VLIW dispatch style (with a packing of 6 insns); +;; the function unit reservations restrictions (define_*_set) are +;; contrived to support published timings. +;; +;; Reference: +;; "SR3 Microprocessor Specification, System development information," +;; Revision 1.0, 13 December 2000. +;; +;; +;; Reservation model is based on: +;; 1) Figure 6-1, from the 1.0 specification. +;; 2) Chapter 19, from the 1.0 specification. +;; 3) following questions(Red Hat)/answers(Sandcraft): +;; RH> From Section 19.1 +;; RH> 1) In terms of figure 6-1, are all the instructions in +;; RH> table 19-1 restricted +;; RH> to ALUx? When ALUx is not in use for an instruction in table;; RH> 19-1 is +;; RH> it fully compatible with all insns that issue to ALUy? +;; +;; Yes, all the instructions in Table 19-1 only go to ALUX, and all the +;; instructions that can be issued to ALUY can also be issued to ALUX. +;; +;; +;; RH> From Section 19.2 +;; RH> 2) Explain conditional moves execution path (in terms of +;; RH> figure 6-1) +;; +;; Conditional move of integer registers (based on floating point condition +;; codes or integer register value) go to ALUX or ALUY. +;; +;; RH> 3) Explain floating point store execution path (in terms of +;; RH> figure 6-1) +;; +;; Floating point stores go to Ld/St and go to MOV in the floating point +;; pipeline. +;; +;; Floating point loads go to Ld/St and go to LOAD in the floating point +;; pipeline. +;; +;; RH> 4) Explain branch on floating condition (in terms of figure 6-1);; +;; Branch on floating condition go to BRU. +;; +;; RH> 5) Is the column for single RECIP instruction latency correct? +;; RH> What about for RSQRT single and double? +;; +;; The latency/repeat for RECIP and RSQRT are correct. +;; + +;; +;; Use four automata to isolate long latency operations, and to +;; reduce the complexity of cpu+fpu, reducing space. +;; +(define_automaton "sr71_cpu, sr71_cpu1, sr71_cp1, sr71_cp2, sr71_fextra, sr71_imacc") + +;; feeders for CPU function units and feeders for fpu (CP1 interface) +(define_cpu_unit "sr_iss0,sr_iss1,sr_iss2,sr_iss3,sr_iss4,sr_iss5" "sr71_cpu") + +;; CPU function units +(define_cpu_unit "ipu_bru" "sr71_cpu1") +(define_cpu_unit "ipu_alux" "sr71_cpu1") +(define_cpu_unit "ipu_aluy" "sr71_cpu1") +(define_cpu_unit "ipu_ldst" "sr71_cpu1") +(define_cpu_unit "ipu_macc_iter" "sr71_imacc") + + +;; Floating-point unit (Co-processor interface 1). +(define_cpu_unit "fpu_mov" "sr71_cp1") +(define_cpu_unit "fpu_load" "sr71_cp1") +(define_cpu_unit "fpu_fpu" "sr71_cp2") + +;; fictitous unit to track long float insns with separate automaton +(define_cpu_unit "fpu_iter" "sr71_fextra") + + +;; +;; Define common execution path (reservation) combinations +;; + +;; +(define_reservation "cpu_iss" "sr_iss0|sr_iss1|sr_iss2|sr_iss3") + +;; two cycles are used for instruction using the fpu as it runs +;; at half the clock speed of the cpu. By adding an extra cycle +;; to the issue units, the default/minimum "repeat" dispatch delay is +;; accounted for all insn.s +(define_reservation "cp1_iss" "(sr_iss4*2)|(sr_iss5*2)") + +(define_reservation "serial_dispatch" "sr_iss0+sr_iss1+sr_iss2+sr_iss3+sr_iss4+sr_iss5") + +;; Simulate a 6 insn VLIW dispatch, 1 cycle in dispatch followed by +;; reservation of function unit. +(define_reservation "ri_insns" "cpu_iss,(ipu_alux|ipu_aluy)") +(define_reservation "ri_mem" "cpu_iss,ipu_ldst") +(define_reservation "ri_alux" "cpu_iss,ipu_alux") +(define_reservation "ri_branch" "cpu_iss,ipu_bru") + +(define_reservation "rf_insn" "cp1_iss,fpu_fpu") +(define_reservation "rf_ldmem" "cp1_iss,fpu_load") + +; simultaneous reservation of pseudo-unit keeps cp1 fpu tied +; up until long cycle insn is finished... +(define_reservation "rf_multi1" "rf_insn+fpu_iter") + +;; +;; The ordering of the instruction-execution-path/resource-usage +;; descriptions (also known as reservation RTL) is roughly ordered +;; based on the define attribute RTL for the "type" classification. +;; When modifying, remember that the first test that matches is the +;; reservation used! +;; + + +(define_insn_reservation "ir_sr70_unknown" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "unknown")) + "serial_dispatch") + + +;; Assume prediction fails. +(define_insn_reservation "ir_sr70_branch" 6 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "branch,jump,call")) + "ri_branch") + +(define_insn_reservation "ir_sr70_load" 2 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "load")) + "ri_mem") + +(define_insn_reservation "ir_sr70_store" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "store")) + "ri_mem") + + +;; +;; float loads/stores flow through both cpu and cp1... +;; +(define_insn_reservation "ir_sr70_fload" 9 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fpload,fpidxload")) + "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") + +(define_insn_reservation "ir_sr70_fstore" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fpstore,fpidxstore")) + "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") + + +;; This reservation is for conditional move based on integer +;; or floating point CC. +(define_insn_reservation "ir_sr70_condmove" 4 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "condmove")) + "ri_insns") + +;; Try to discriminate move-from-cp1 versus move-to-cp1 as latencies +;; are different. Like float load/store, these insns use multiple +;; resources simultaneously +(define_insn_reservation "ir_sr70_xfer_from" 6 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "xfer") + (eq_attr "mode" "!SF,DF,FPSW"))) + "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") + +(define_insn_reservation "ir_sr70_xfer_to" 9 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "xfer") + (eq_attr "mode" "SF,DF"))) + "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") + +(define_insn_reservation "ir_sr70_hilo" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "mthilo,mfhilo")) + "ri_insns") + +(define_insn_reservation "ir_sr70_arith" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "arith,shift,slt,clz,const,trap")) + "ri_insns") + +;; emulate repeat (dispatch stall) by spending extra cycle(s) in +;; in iter unit +(define_insn_reservation "ir_sr70_imul_si" 4 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "ri_alux,ipu_alux,ipu_macc_iter") + +(define_insn_reservation "ir_sr70_imul_di" 6 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*3)") + +;; Divide algorithm is early out with best latency of 7 pcycles. +;; Use worst case for scheduling purposes. +(define_insn_reservation "ir_sr70_idiv_si" 41 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*38)") + +(define_insn_reservation "ir_sr70_idiv_di" 73 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*70)") + +;; extra reservations of fpu_fpu are for repeat latency +(define_insn_reservation "ir_sr70_fadd_sf" 8 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fadd") + (eq_attr "mode" "SF"))) + "rf_insn,fpu_fpu") + +(define_insn_reservation "ir_sr70_fadd_df" 10 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fadd") + (eq_attr "mode" "DF"))) + "rf_insn,fpu_fpu") + +;; Latencies for MADD,MSUB, NMADD, NMSUB assume the Multiply is fused +;; with the sub or add. +(define_insn_reservation "ir_sr70_fmul_sf" 8 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "rf_insn,fpu_fpu") + +;; tie up the fpu unit to emulate the balance for the "repeat +;; rate" of 8 (2 are spent in the iss unit) +(define_insn_reservation "ir_sr70_fmul_df" 16 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "rf_insn,fpu_fpu*6") + + +;; RECIP insn uses same type attr as div, and for SR3, has same +;; timings for double. However, single RECIP has a latency of +;; 28 -- only way to fix this is to introduce new insn attrs. +;; cycles spent in iter unit are designed to satisfy balance +;; of "repeat" latency after insn uses up rf_multi1 reservation +(define_insn_reservation "ir_sr70_fdiv_sf" 60 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*51)") + +(define_insn_reservation "ir_sr70_fdiv_df" 120 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*109)") + +(define_insn_reservation "ir_sr70_fabs" 4 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fabs,fneg,fmove")) + "rf_insn,fpu_fpu") + +(define_insn_reservation "ir_sr70_fcmp" 10 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fcmp")) + "rf_insn,fpu_fpu") + +;; "fcvt" type attribute covers a number of diff insns, most have the same +;; latency descriptions, a few vary. We use the +;; most common timing (which is also worst case). +(define_insn_reservation "ir_sr70_fcvt" 12 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fcvt")) + "rf_insn,fpu_fpu*4") + +(define_insn_reservation "ir_sr70_fsqrt_sf" 62 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fsqrt") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*53)") + +(define_insn_reservation "ir_sr70_fsqrt_df" 122 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fsqrt") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*111)") + +(define_insn_reservation "ir_sr70_frsqrt_sf" 48 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*39)") + +(define_insn_reservation "ir_sr70_frsqrt_df" 240 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*229)") + +(define_insn_reservation "ir_sr70_multi" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "multi")) + "serial_dispatch") + +(define_insn_reservation "ir_sr70_nop" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "nop")) + "ri_insns") diff --git a/contrib/gcc/config/mips/t-elf b/contrib/gcc/config/mips/t-elf new file mode 100644 index 00000000000..f2da07d1bcd --- /dev/null +++ b/contrib/gcc/config/mips/t-elf @@ -0,0 +1,40 @@ +# Don't let CTOR_LIST end up in sdata section. +CRTSTUFF_T_CFLAGS = -G 0 + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm + +$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm + +LIB1ASMSRC = mips/mips16.S +LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \ + _m16eqsf2 _m16nesf2 _m16gtsf2 _m16gesf2 _m16lesf2 _m16ltsf2 \ + _m16fltsisf _m16fix_truncsfsi \ + _m16adddf3 _m16subdf3 _m16muldf3 _m16divdf3 \ + _m16extsfdf2 _m16trdfsf2 \ + _m16eqdf2 _m16nedf2 _m16gtdf2 _m16gedf2 _m16ledf2 _m16ltdf2 \ + _m16fltsidf _m16fix_truncdfsi \ + _m16retsf _m16retdf \ + _m16stub1 _m16stub2 _m16stub5 _m16stub6 _m16stub9 _m16stub10 \ + _m16stubsf0 _m16stubsf1 _m16stubsf2 _m16stubsf5 _m16stubsf6 \ + _m16stubsf9 _m16stubsf10 \ + _m16stubdf0 _m16stubdf1 _m16stubdf2 _m16stubdf5 _m16stubdf6 \ + _m16stubdf9 _m16stubdf10 + +# We must build libgcc2.a with -G 0, in case the user wants to link +# without the $gp register. +TARGET_LIBGCC2_CFLAGS = -G 0 + +# Build the libraries for both hard and soft floating point + +MULTILIB_OPTIONS = msoft-float EL/EB +MULTILIB_DIRNAMES = soft-float el eb +MULTILIB_MATCHES = EL=mel EB=meb msingle-float=m4650 +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/contrib/gcc/config/mips/t-gofast b/contrib/gcc/config/mips/t-gofast new file mode 100644 index 00000000000..a6c60d4bf57 --- /dev/null +++ b/contrib/gcc/config/mips/t-gofast @@ -0,0 +1,19 @@ +# We want fine grained libraries, so use the new code to build the +# floating point emulation libraries. +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + echo '#ifdef __MIPSEL__' > dp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c + echo '#endif' >> dp-bit.c + echo '#define US_SOFTWARE_GOFAST' >> dp-bit.c + cat $(srcdir)/config/fp-bit.c >> dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + echo '#ifdef __MIPSEL__' >> fp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c + echo '#endif' >> fp-bit.c + echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c diff --git a/contrib/gcc/config/mips/t-iris b/contrib/gcc/config/mips/t-iris new file mode 100644 index 00000000000..4a7143f9ddd --- /dev/null +++ b/contrib/gcc/config/mips/t-iris @@ -0,0 +1,12 @@ +# Find all of the declarations from the header files +FIXPROTO_DEFINES = -D__EXTENSIONS__ -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS + +$(T)irix-crti.o: $(srcdir)/config/mips/irix-crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $@ -x assembler-with-cpp $< + +$(T)irix-crtn.o: $(srcdir)/config/mips/irix-crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $@ -x assembler-with-cpp $< + +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o irix-crti.o irix-crtn.o diff --git a/contrib/gcc/config/mips/t-iris6 b/contrib/gcc/config/mips/t-iris6 new file mode 100644 index 00000000000..51554720698 --- /dev/null +++ b/contrib/gcc/config/mips/t-iris6 @@ -0,0 +1,19 @@ +MULTILIB_OPTIONS=mabi=n32/mabi=32/mabi=64 +MULTILIB_DIRNAMES=n32 32 64 +MULTILIB_MATCHES= +MULTILIB_OSDIRNAMES=../lib32 ../lib ../lib64 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +TPBIT = tp-bit.c + +tp-bit.c: $(srcdir)/config/fp-bit.c + echo '#ifdef __MIPSEL__' > tp-bit.c + echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c + echo '#endif' >> tp-bit.c + echo '#define QUIET_NAN_NEGATED' >> tp-bit.c + echo '#if __LDBL_MANT_DIG__ == 106' >> tp-bit.c + echo '# define TFLOAT' >> tp-bit.c + cat $(srcdir)/config/fp-bit.c >> tp-bit.c + echo '#endif' >> tp-bit.c diff --git a/contrib/gcc/config/mips/t-isa3264 b/contrib/gcc/config/mips/t-isa3264 new file mode 100644 index 00000000000..6604fbe09b2 --- /dev/null +++ b/contrib/gcc/config/mips/t-isa3264 @@ -0,0 +1,40 @@ +# Don't let CTOR_LIST end up in sdata section. +CRTSTUFF_T_CFLAGS = -G 0 + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm + +$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm + +LIB1ASMSRC = mips/mips16.S +LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \ + _m16eqsf2 _m16nesf2 _m16gtsf2 _m16gesf2 _m16lesf2 _m16ltsf2 \ + _m16fltsisf _m16fix_truncsfsi \ + _m16adddf3 _m16subdf3 _m16muldf3 _m16divdf3 \ + _m16extsfdf2 _m16trdfsf2 \ + _m16eqdf2 _m16nedf2 _m16gtdf2 _m16gedf2 _m16ledf2 _m16ltdf2 \ + _m16fltsidf _m16fix_truncdfsi \ + _m16retsf _m16retdf \ + _m16stub1 _m16stub2 _m16stub5 _m16stub6 _m16stub9 _m16stub10 \ + _m16stubsf0 _m16stubsf1 _m16stubsf2 _m16stubsf5 _m16stubsf6 \ + _m16stubsf9 _m16stubsf10 \ + _m16stubdf0 _m16stubdf1 _m16stubdf2 _m16stubdf5 _m16stubdf6 \ + _m16stubdf9 _m16stubdf10 + +# We must build libgcc2.a with -G 0, in case the user wants to link +# without the $gp register. +TARGET_LIBGCC2_CFLAGS = -G 0 + +# Build the libraries for both hard and soft floating point + +MULTILIB_OPTIONS = msoft-float EL/EB mips32/mips32r2/mips64 +MULTILIB_DIRNAMES = soft-float el eb mips32 mips32r2 mips64 +MULTILIB_MATCHES = EL=mel EB=meb +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/contrib/gcc/config/mips/t-linux64 b/contrib/gcc/config/mips/t-linux64 new file mode 100644 index 00000000000..0592e7fa999 --- /dev/null +++ b/contrib/gcc/config/mips/t-linux64 @@ -0,0 +1,17 @@ +MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64 +MULTILIB_DIRNAMES = n32 32 64 +MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64 + +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o + +TPBIT = tp-bit.c + +tp-bit.c: $(srcdir)/config/fp-bit.c + echo '#ifdef __MIPSEL__' > tp-bit.c + echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c + echo '#endif' >> tp-bit.c + echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c + echo '#define QUIET_NAN_NEGATED' >> tp-bit.c + echo '# define TFLOAT' >> tp-bit.c + cat $(srcdir)/config/fp-bit.c >> tp-bit.c + echo '#endif' >> tp-bit.c diff --git a/contrib/gcc/config/mips/t-mips b/contrib/gcc/config/mips/t-mips new file mode 100644 index 00000000000..c431dcc0e8e --- /dev/null +++ b/contrib/gcc/config/mips/t-mips @@ -0,0 +1,23 @@ +# fp-bit and dp-bit are really part of libgcc1, but this will cause +# them to be built correctly, so... [taken from t-sparclite] +# We want fine grained libraries, so use the new code to build the +# floating point emulation libraries. +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + echo '#ifdef __MIPSEL__' > dp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c + echo '#endif' >> dp-bit.c + echo '#define QUIET_NAN_NEGATED' >> dp-bit.c + cat $(srcdir)/config/fp-bit.c >> dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + echo '#ifdef __MIPSEL__' >> fp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c + echo '#endif' >> fp-bit.c + echo '#define QUIET_NAN_NEGATED' >> fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +LIB2_SIDITI_CONV_FUNCS=yes diff --git a/contrib/gcc/config/mips/t-r3900 b/contrib/gcc/config/mips/t-r3900 new file mode 100644 index 00000000000..3bc8c47279d --- /dev/null +++ b/contrib/gcc/config/mips/t-r3900 @@ -0,0 +1,31 @@ +LIB1ASMSRC = mips/mips16.S +LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \ + _m16eqsf2 _m16nesf2 _m16gtsf2 _m16gesf2 _m16lesf2 _m16ltsf2 \ + _m16fltsisf _m16fix_truncsfsi \ + _m16adddf3 _m16subdf3 _m16muldf3 _m16divdf3 \ + _m16extsfdf2 _m16trdfsf2 \ + _m16eqdf2 _m16nedf2 _m16gtdf2 _m16gedf2 _m16ledf2 _m16ltdf2 \ + _m16fltsidf _m16fix_truncdfsi \ + _m16retsf _m16retdf \ + _m16stub1 _m16stub2 _m16stub5 _m16stub6 _m16stub9 _m16stub10 \ + _m16stubsf0 _m16stubsf1 _m16stubsf2 _m16stubsf5 _m16stubsf6 \ + _m16stubsf9 _m16stubsf10 \ + _m16stubdf0 _m16stubdf1 _m16stubdf2 _m16stubdf5 _m16stubdf6 \ + _m16stubdf9 _m16stubdf10 + +# We must build libgcc2.a with -G 0, in case the user wants to link +# without the $gp register. +TARGET_LIBGCC2_CFLAGS = -G 0 + +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o +# Don't let CTOR_LIST end up in sdata section. +CRTSTUFF_T_CFLAGS = -G 0 + +# Build the libraries for both hard and soft floating point + +MULTILIB_OPTIONS = msoft-float EL/EB +MULTILIB_DIRNAMES = soft-float el eb +MULTILIB_MATCHES = EL=mel EB=meb + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/contrib/gcc/config/mips/t-rtems b/contrib/gcc/config/mips/t-rtems new file mode 100644 index 00000000000..b012100415a --- /dev/null +++ b/contrib/gcc/config/mips/t-rtems @@ -0,0 +1,16 @@ +# Custom multilibs for RTEMS + +# default is mips1 EB hard-float +MULTILIB_OPTIONS = mips1/mips3/mips32 EB/EL msoft-float +MULTILIB_DIRNAMES = mips1 mips3 mips32 eb el soft-float +MULTILIB_MATCHES = EL=mel EB=meb + +MULTILIB_EXCEPTIONS = + +# Big endian only +MULTILIB_EXCEPTIONS += EL* +MULTILIB_EXCEPTIONS += mips32/EL* + +# Little endian only +MULTILIB_EXCEPTIONS += mips3 +MULTILIB_EXCEPTIONS += mips3/msoft-float diff --git a/contrib/gcc/config/mips/t-sb1 b/contrib/gcc/config/mips/t-sb1 new file mode 100644 index 00000000000..b181bb7d00c --- /dev/null +++ b/contrib/gcc/config/mips/t-sb1 @@ -0,0 +1,44 @@ +# GP-rel: G0 only +# +# Endianness: EB or EL +# +# ABIs: mabi=32 +# mabi=o64 +# mabi=o64/mlong64 +# +# FPU: (default mhard-float) +# msoft-float (only for mabi=32) +# + +MULTILIB_EXTRA_OPTS = G0 + +MULTILIB_OPTIONS = \ + EB/EL \ + mabi=32/mabi=o64 \ + mips32/mips64 \ + mlong64/msoft-float \ + +MULTILIB_DIRNAMES = \ + eb el \ + o32 o64 \ + mips32 mips64 \ + long64 soft-float \ + +MULTILIB_MATCHES = \ + EB=meb EL=mel \ + +MULTILIB_EXCEPTIONS = \ + *mabi=32/*mlong64* \ + +MULTILIB_EXCLUSIONS = \ + mips32/!mabi=32 \ + mabi=32/!mips32 \ + msoft-float/!mabi=32 \ + +# Small multilib list for quick builds and tests. +# Must either comment out everything above these lines, or everything below +# these lines. + +#MULTILIB_OPTIONS = EB/EL msoft-float +#MULTILIB_DIRNAMES = eb el soft-float +#MULTILIB_MATCHES = EB=meb EL=mel diff --git a/contrib/gcc/config/mips/t-slibgcc-irix b/contrib/gcc/config/mips/t-slibgcc-irix new file mode 100644 index 00000000000..cfb4bf4d8cc --- /dev/null +++ b/contrib/gcc/config/mips/t-slibgcc-irix @@ -0,0 +1,34 @@ +# Build a shared libgcc library. + +SHLIB_EXT = .so +SHLIB_SOLINK = @shlib_base_name@.so +SHLIB_SOVERSION = 1 +SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION) +SHLIB_MAP = @shlib_map_file@ +SHLIB_OBJS = @shlib_objs@ +SHLIB_DIR = @multilib_dir@ +SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ +SHLIB_LC = -lc + +SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ + -Wl,-soname,$(SHLIB_SONAME) \ + -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ + $(SHLIB_OBJS) $(SHLIB_LC) && \ + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ + if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ + mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ + $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ + else true; fi && \ + mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ + $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) +# $(slibdir) double quoted to protect it from expansion while building +# libgcc.mk. We want this delayed until actual install time. +SHLIB_INSTALL = \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ + rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ + $(LN_S) $(SHLIB_SONAME) \ + $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) +SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk +SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver diff --git a/contrib/gcc/config/mips/t-sr71k b/contrib/gcc/config/mips/t-sr71k new file mode 100644 index 00000000000..2b2c27a1852 --- /dev/null +++ b/contrib/gcc/config/mips/t-sr71k @@ -0,0 +1,51 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. +LIBGCC1 = +CROSS_LIBGCC1 = + +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o +# Don't let CTOR_LIST end up in sdata section. +CRTSTUFF_T_CFLAGS = -G 0 + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm + +$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm + +# We must build libgcc2.a with -G 0, in case the user wants to link +# without the $gp register. +TARGET_LIBGCC2_CFLAGS = -G 0 + +# fp-bit and dp-bit are really part of libgcc1, but this will cause +# them to be built correctly, so... [taken from t-sparclite] +# We want fine grained libraries, so use the new code to build the +# floating point emulation libraries. +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + echo '#ifdef __MIPSEL__' > dp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c + echo '#endif' >> dp-bit.c + echo '#define US_SOFTWARE_GOFAST' >> dp-bit.c + cat $(srcdir)/config/fp-bit.c >> dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + echo '#ifdef __MIPSEL__' >> fp-bit.c + echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c + echo '#endif' >> fp-bit.c + echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +# Build the libraries for both hard and soft floating point + +MULTILIB_OPTIONS = EL/EB msoft-float mips2 +MULTILIB_DIRNAMES = el eb soft-float mips2 + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib diff --git a/contrib/gcc/config/mips/t-vr b/contrib/gcc/config/mips/t-vr new file mode 100644 index 00000000000..9c046b0eb04 --- /dev/null +++ b/contrib/gcc/config/mips/t-vr @@ -0,0 +1,112 @@ +# BEGIN boiler-plate MIPS stuff + +# Don't let CTOR_LIST end up in sdata section. +CRTSTUFF_T_CFLAGS = -G 0 + +# We must build libgcc2.a with -G 0, in case the user wants to link +# without the $gp register. +TARGET_LIBGCC2_CFLAGS = -G 0 + +LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/mips/mips16.S \ + $(srcdir)/config/mips/vr4120-div.S +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm + +$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm + +# END boiler-plate + +# Main multilibs +# -------------- +# +# Endianness: EB or EL +# +# ABIs: mabi=32 +# mabi=o64 +# mabi=eabi +# mabi=eabi/mlong32 +# mabi=eabi/mgp32 +# mabi=eabi/mgp32/mlong64 +# +# Architecture: march=vr4120 with -mfix-vr4120 +# march=vr4130 with -mfix-vr4130 (default) +# march=vr5000 +# march=vr5400 +# march=vr5500 +# +# Total: 2 * 6 * 5 = 60 multilibs. +# +# +# Extra vr4300 multilibs +# ---------------------- +# +# Endianness: EB or EL +# +# ABI: o64 +# +# Architecture: vr4300. +# +# Total: 2 * 1 * 2 = 2 multilibs. +# +# +# Extra MIPS16 multilibs +# ---------------------- +# +# Endianness: EB or EL +# +# ABIs: mabi=o64 +# mabi=eabi/mlong32 +# mabi=eabi/mgp32 +# +# Architecture: march=vr4120 with -mfix-vr4120 +# march=vr4130 with -mfix-vr4130 (default) +# +# Total: 2 * 3 * 2 = 12 multilibs. +MULTILIB_OPTIONS = \ + EL/EB \ + mabi=32/mabi=o64/mabi=eabi \ + mgp32 \ + mlong64 \ + mips16 \ + mfix-vr4120/mfix-vr4130/march=vr4300/march=vr5000/march=vr5400/march=vr5500 + +MULTILIB_DIRNAMES = \ + el eb \ + o32 o64 eabi \ + gp32 \ + long64 \ + mips16 \ + vr4120 vr4130 vr4300 vr5000 vr5400 vr5500 + +MULTILIB_MATCHES = EL=mel EB=meb mfix-vr4120=march?vr4120 \ + mfix-vr4130=march?vr4130 + +# Assume a 41xx-series is the default: we'd need a *mips16 entry if +# the default processor didn't support mips16. Also assume the +# default ABI is EABI64 -mlong32. +MULTILIB_EXCEPTIONS = \ + *mabi=32/mlong64* \ + *mabi=32/mgp32* \ + *mabi=o64/mgp32* \ + *mabi=o64/mlong64* \ + *mips16/march=vr5* \ + *mips16/march=vr4300 \ + $(MIPS16_EXCEPTIONS) \ + $(VR4300_EXCEPTIONS) + +MIPS16_EXCEPTIONS = \ + *mabi=32*mips16* \ + *mlong64*mips16* + +VR4300_EXCEPTIONS = \ + *mabi=32*march=vr4300 \ + *mgp32*march=vr4300 \ + *mlong64*march=vr4300 \ + march=vr4300 \ + E[LB]/march=vr4300 diff --git a/contrib/gcc/config/mips/t-vxworks b/contrib/gcc/config/mips/t-vxworks new file mode 100644 index 00000000000..51e006aa902 --- /dev/null +++ b/contrib/gcc/config/mips/t-vxworks @@ -0,0 +1,16 @@ +# Multilibs for VxWorks. + +# default is mips1 EB hard-float +MULTILIB_OPTIONS = mips2/mips3 EL msoft-float +MULTILIB_MATCHES = EL=mel mips2=mips32 mips3=mips4 mips3=mips64 + +MULTILIB_EXCEPTIONS = EL EL/msoft-float mips3/msoft-float mips3/EL/msoft-float + +MUTLILIB_EXTRA_OPTS = -G 0 -mno-branch-likely + +MULTILIB_OSDIRNAMES = msoft-float=!MIPS32sfr3kgnu \ + mips2=!MIPS32gnu mips2/msoft-float=!MIPS32sfgnu \ + mips2/EL=!MIPS32gnule \ + mips2/EL/msoft-float=!MIPS32sfgnule \ + mips3=!MIPS64gnu mips3/EL=!MIPS64gnule + diff --git a/contrib/gcc/config/mips/vr.h b/contrib/gcc/config/mips/vr.h new file mode 100644 index 00000000000..a723a48cab2 --- /dev/null +++ b/contrib/gcc/config/mips/vr.h @@ -0,0 +1,53 @@ +/* Definitions of target machine for GNU compiler. + NEC VR Series Processors + Copyright (c) 2002, 2004, 2005 Free Software Foundation, Inc. + Contributed by Red Hat, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#define DEFAULT_VR_ARCH "mfix-vr4130" +#define MIPS_ABI_DEFAULT ABI_EABI +#define MIPS_MARCH_CONTROLS_SOFT_FLOAT 1 +#define MULTILIB_DEFAULTS \ + { MULTILIB_ENDIAN_DEFAULT, \ + MULTILIB_ABI_DEFAULT, \ + DEFAULT_VR_ARCH } + +#define DRIVER_SELF_SPECS \ + /* Enforce the default architecture. This is mostly for \ + the assembler's benefit. */ \ + "%{!march=*:%{!mfix-vr4120:%{!mfix-vr4130:" \ + "-" DEFAULT_VR_ARCH "}}}", \ + \ + /* Make -mfix-vr4120 imply -march=vr4120. This cuts down \ + on command-line tautology and makes it easier for t-vr to \ + provide a -mfix-vr4120 multilib. */ \ + "%{mfix-vr4120:%{!march=*:-march=vr4120}}", \ + \ + /* Same idea for -mfix-vr4130. */ \ + "%{mfix-vr4130:%{!march=*:-march=vr4130}}", \ + \ + /* Make -mabi=eabi -mlong32 the default. */ \ + "%{!mabi=*:-mabi=eabi %{!mlong*:-mlong32}}", \ + \ + /* Make sure -mlong64 multilibs are chosen when 64-bit longs \ + are needed. */ \ + "%{mabi=eabi:%{!mlong*:%{!mgp32:-mlong64}}}", \ + \ + /* Remove -mgp32 if it is redundant. */ \ + "%{mabi=32:%= 0 */; \ + and $3,$3,$2 /* t = (x ^ y) & 0x80000000 in delay slot */ ;\ + .set reorder; \ + subu $4,$0,$4 /* x = -x */ ; \ +1:; \ + .set noreorder; \ + bgez $5,2f /* y >= 0 */ ; \ + nop; \ + subu $5,$0,$5 /* y = -y */ ; \ + .set reorder; \ +2:; \ + divu $0,$4,$5; /* we use divu because of INT_MIN */ \ + .set noreorder; \ + bne $5,$0,3f; \ + nop; \ + break 7 /* division on zero y */ ; \ +3:; \ + .set reorder; \ + mflo $2 /* r = x / y */ ; \ + .set noreorder; \ + beq $3,$0,4f /* t == 0 */ ; \ + nop; \ + subu $2,$0,$2 /* r = -r */ ; \ + .set reorder; \ +4: + + .globl __vr4120_divsi3 + .ent __vr4120_divsi3 +__vr4120_divsi3: + DIV + j $31 + .end __vr4120_divsi3 + + .globl __vr4120_modsi3 + .ent __vr4120_modsi3 +__vr4120_modsi3: + move $6,$4 # x1 = x + move $7,$5 # y1 = y + DIV + mult $2,$7 # r = r * y1 + mflo $2 + .set noreorder + j $31 + subu $2,$6,$2 # r = x1 - r in delay slot + .end __vr4120_modsi3 diff --git a/contrib/gcc/config/mips/vxworks.h b/contrib/gcc/config/mips/vxworks.h new file mode 100644 index 00000000000..bf37901bac3 --- /dev/null +++ b/contrib/gcc/config/mips/vxworks.h @@ -0,0 +1,68 @@ +/* Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (MIPS, VxWorks syntax)"); + +/* Combination of mips.h and svr4.h. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ + || (CHAR) == 'G' \ + || (CHAR) == 'h' \ + || (CHAR) == 'x' \ + || (CHAR) == 'z') + +#undef ASM_SPEC +#define ASM_SPEC "\ +%{!G:-G 0} %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ +%{mips32} %{mips32r2} %{mips64} \ +%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ +%(subtarget_asm_optimizing_spec) \ +%(subtarget_asm_debugging_spec) \ +%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \ +%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ +%{mtune=*} %{v} \ +%(subtarget_asm_spec)" + +#undef LINK_SPEC +/* LINK_SPEC is clobbered in svr4.h. ugh! */ +#define LINK_SPEC "\ +%(endian_spec) \ +%{!G:-G 0} %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \ +%{bestGnum}" + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__vxworks"); \ + builtin_assert ("system=unix"); \ + } \ + while (0) + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC \ +"%{!DCPU=*: %{mips3|mips4|mips64:-DCPU=MIPS64;:-DCPU=MIPS32}} \ + %{EL|mel:-DMIPSEL;:-DMIPSEB} \ + %{msoft-float:-DSOFT_FLOAT} \ + %{mips1:-D_WRS_R3K_EXC_SUPPORT}" + +/* No sdata. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 diff --git a/contrib/gcc/config/mips/windiss.h b/contrib/gcc/config/mips/windiss.h new file mode 100644 index 00000000000..bd6962153e3 --- /dev/null +++ b/contrib/gcc/config/mips/windiss.h @@ -0,0 +1,101 @@ +/* Support for GCC on MIPS using WindISS simulator. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (MIPS WindISS)"); + +/* Combination of mips.h and svr4.h. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ + || (CHAR) == 'G' \ + || (CHAR) == 'h' \ + || (CHAR) == 'x' \ + || (CHAR) == 'z') + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC \ +"%{!DCPU=*: %{mips3|mips4|mips64:-DCPU=MIPS64;:-DCPU=MIPS32}} \ + %{EL|mel:-DMIPSEL;:-DMIPSEB} \ + %{msoft-float:-DSOFT_FLOAT} \ + %{mips1:-D_WRS_R3K_EXC_SUPPORT}" + +#undef ASM_SPEC +#define ASM_SPEC "\ +%{!G:-G 0} %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \ +%{mips32} %{mips32r2} %{mips64} \ +%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \ +%(subtarget_asm_optimizing_spec) \ +%(subtarget_asm_debugging_spec) \ +%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \ +%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \ +%{mtune=*} %{v} \ +%(subtarget_asm_spec)" + +#undef LINK_SPEC +/* LINK_SPEC is clobbered in svr4.h. ugh! */ +#define LINK_SPEC "\ +-m elf32mipswindiss \ +%{!G:-G 0} %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \ +%{bestGnum}" + +/* Diab libs MIPS{,E,F,L,M,W,X,Y,Z}{,H,N,S} + + . + E - Elf (small-data/const=8 + F - Elf Far (small-data/const=0) + L - Little Elf + M - Little Elf Far + W - elf32 bigmips + X - elf32 bigmips (far?) + Y - elf32 littlemips + Z - elf32 littlemips (far?) + + . - Integer routines + H - Hard float + N - No float + S - Soft float + + Want {F,M}{,H,S} + +*/ + +#undef LIB_SPEC +#define LIB_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crt0.o%s crtbegin.o%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s" + +/* We have no shared libraries. These two shouldn't be necessary. */ +#undef LINK_SHLIB_SPEC +#define LINK_SHLIB_SPEC "" +#undef LINK_EH_SPEC +#define LINK_EH_SPEC "" + +#undef CRTSAVRES_DEFAULT_SPEC +#define CRTSAVRES_DEFAULT_SPEC "" + +/* No sdata. */ +#undef MIPS_DEFAULT_GVALUE +#define MIPS_DEFAULT_GVALUE 0 diff --git a/contrib/gcc/config/netbsd-aout.h b/contrib/gcc/config/netbsd-aout.h index 53e65707764..fe5b3ec5f18 100644 --- a/contrib/gcc/config/netbsd-aout.h +++ b/contrib/gcc/config/netbsd-aout.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD a.out targets. */ #define NETBSD_OS_CPP_BUILTINS_AOUT() \ diff --git a/contrib/gcc/config/netbsd-elf.h b/contrib/gcc/config/netbsd-elf.h index a87699c34a2..9a56de23f63 100644 --- a/contrib/gcc/config/netbsd-elf.h +++ b/contrib/gcc/config/netbsd-elf.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD ELF targets. */ #define NETBSD_OS_CPP_BUILTINS_ELF() \ diff --git a/contrib/gcc/config/netbsd.h b/contrib/gcc/config/netbsd.h index 121dda2fb48..5386b656512 100644 --- a/contrib/gcc/config/netbsd.h +++ b/contrib/gcc/config/netbsd.h @@ -1,5 +1,5 @@ /* Base configuration file for all NetBSD targets. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -16,14 +16,16 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD targets. */ #define NETBSD_OS_CPP_BUILTINS_COMMON() \ do \ { \ builtin_define ("__NetBSD__"); \ + builtin_define ("__unix__"); \ + builtin_assert ("system=bsd"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=NetBSD"); \ } \ @@ -154,18 +156,16 @@ Boston, MA 02111-1307, USA. */ fprintf ((STREAM), "void __fini() {\n\t%s();\n}\n", (FUNC)); \ } while (0) -#undef TARGET_HAS_F_SETLKW -#define TARGET_HAS_F_SETLKW - -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#undef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS 1 +#undef TARGET_POSIX_IO +#define TARGET_POSIX_IO /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 +/* Don't assume anything about the header files. */ +#undef NO_IMPLICIT_EXTERN_C +#define NO_IMPLICIT_EXTERN_C 1 /* Define some types that are the same on all NetBSD platforms, making them agree with . */ diff --git a/contrib/gcc/config/openbsd-oldgas.h b/contrib/gcc/config/openbsd-oldgas.h index 423a15c727a..5ca617b9ec9 100644 --- a/contrib/gcc/config/openbsd-oldgas.h +++ b/contrib/gcc/config/openbsd-oldgas.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define OBSD_OLD_GAS diff --git a/contrib/gcc/config/openbsd.h b/contrib/gcc/config/openbsd.h index 670a0a08aa1..68eb948772b 100644 --- a/contrib/gcc/config/openbsd.h +++ b/contrib/gcc/config/openbsd.h @@ -1,5 +1,5 @@ /* Base configuration file for all OpenBSD targets. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Common OpenBSD configuration. All OpenBSD architectures include this file, which is intended as @@ -52,29 +52,41 @@ Boston, MA 02111-1307, USA. */ #ifdef OPENBSD_NATIVE -#undef GCC_INCLUDE_DIR -#define GCC_INCLUDE_DIR "/usr/include" - /* The compiler is configured with ONLY the gcc/g++ standard headers. */ #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \ + { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \ { 0, 0, 0, 0 } \ } /* Under OpenBSD, the normal location of the various *crt*.o files is the /usr/lib directory. */ -#define STANDARD_STARTFILE_PREFIX "/usr/lib/" +#undef STANDARD_STARTFILE_PREFIX +#define STANDARD_STARTFILE_PREFIX "/usr/local/lib/" #endif /* Controlling the compilation driver. */ +/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets. */ +#define OPENBSD_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__OpenBSD__"); \ + builtin_define ("__unix__"); \ + builtin_define ("__ANSI_COMPAT"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=OpenBSD"); \ + } \ + while (0) /* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread. - XXX the way threads are handling currently is not very satisfying, + XXX the way threads are handled currently is not very satisfying, since all code must be compiled with -pthread to work. This two-stage defines makes it easy to pick that for targets that have subspecs. */ @@ -84,10 +96,15 @@ Boston, MA 02111-1307, USA. */ #define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" #endif -/* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc, - depending on profiling and threads. Basically, - -lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */ -#define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}" +/* LIB_SPEC appropriate for OpenBSD. */ +#ifdef HAS_LIBC_R +/* -lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */ +# define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}" +#else +/* Include -lpthread if -pthread is specified on the command line. */ +# define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}" +#endif + #ifndef OBSD_HAS_CORRECT_SPECS @@ -130,13 +147,6 @@ Boston, MA 02111-1307, USA. */ /* Runtime target specification. */ -/* Implicit calls to library routines. */ - -/* Use memcpy and memset instead of bcopy and bzero. */ -#ifndef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS -#endif - /* Miscellaneous parameters. */ /* Controlling debugging info: dbx options. */ @@ -282,3 +292,20 @@ do { \ as this depends on a few other details as well... */ #define HANDLE_SYSV_PRAGMA 1 +/* Stack is explicitly denied execution rights on OpenBSD platforms. */ +#define ENABLE_EXECUTE_STACK \ +extern void __enable_execute_stack (void *); \ +void \ +__enable_execute_stack (void *addr) \ +{ \ + long size = getpagesize (); \ + long mask = ~(size-1); \ + char *page = (char *) (((long) addr) & mask); \ + char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \ + \ + if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \ + perror ("mprotect of trampoline code"); \ +} + +#include +#include diff --git a/contrib/gcc/config/ptx4.h b/contrib/gcc/config/ptx4.h index 33e91d15135..8c231027dd9 100644 --- a/contrib/gcc/config/ptx4.h +++ b/contrib/gcc/config/ptx4.h @@ -1,6 +1,7 @@ /* Operating system specific defines to be used when targeting GCC for Sequent's Dynix/ptx v4 and later. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. Generic SysV4 file Contributed by Ron Guilmette (rfg@monkeys.com). Renamed and changed to suit Dynix/ptx v4 and later. Modified by Tim Wright (timw@sequent.com). @@ -20,8 +21,8 @@ GNU General Public License for more details. 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. +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ @@ -136,7 +137,7 @@ Boston, MA 02111-1307, USA. #undef LINK_SPEC #define LINK_SPEC "%{h*} %{v:-V} \ - %{b} %{Wl,*:%*} \ + %{b} \ %{static:-dn -Bstatic} \ %{shared:-G -dy -z text} \ %{symbolic:-Bsymbolic -G -dy -z text} \ @@ -184,26 +185,13 @@ Boston, MA 02111-1307, USA. /* Like block addresses, stabs line numbers are relative to the current function. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \ -do \ - { \ - fprintf (file, ".stabn 68,0,%d,.LM%d-", \ - line, counter); \ - assemble_name (file, \ - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ - fprintf (file, "\n.LM%d:\n", counter); \ - } \ -while (0) +#define DBX_LINES_FUNCTION_RELATIVE 1 /* Generate a blank trailing N_SO to mark the end of the .o file, since we can't depend upon the linker to mark .o file boundaries with embedded stabs. */ -#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ - fprintf (FILE, \ - "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO) +#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END /* Define the actual types of some ANSI-mandated types. (These definitions should work for most SVR4 systems). */ diff --git a/contrib/gcc/config/rs6000/40x.md b/contrib/gcc/config/rs6000/40x.md index 9d229b4c8d7..94b6c459ae1 100644 --- a/contrib/gcc/config/rs6000/40x.md +++ b/contrib/gcc/config/rs6000/40x.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM PowerPC 403 and PowerPC 405 processors. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,22 +15,24 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. -(define_automaton "ppc40x") -(define_cpu_unit "iu_40x,bpu_40x,fpu_405" "ppc40x") +(define_automaton "ppc40x,ppc40xiu") +(define_cpu_unit "bpu_40x,fpu_405" "ppc40x") +(define_cpu_unit "iu_40x" "ppc40xiu") ;; PPC401 / PPC403 / PPC405 32-bit integer only IU BPU ;; Embedded PowerPC controller ;; In-order execution ;; Max issue two insns/cycle (includes one branch) (define_insn_reservation "ppc403-load" 2 - (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ + load_l,store_c,sync") (eq_attr "cpu" "ppc403,ppc405")) "iu_40x") -(define_insn_reservation "ppc403-store" 1 +(define_insn_reservation "ppc403-store" 2 (and (eq_attr "type" "store,store_ux,store_u") (eq_attr "cpu" "ppc403,ppc405")) "iu_40x") @@ -40,6 +42,16 @@ (eq_attr "cpu" "ppc403,ppc405")) "iu_40x") +(define_insn_reservation "ppc403-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc403,ppc405")) + "iu_40x,iu_40x") + +(define_insn_reservation "ppc403-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc403,ppc405")) + "iu_40x,iu_40x,iu_40x") + (define_insn_reservation "ppc403-compare" 3 (and (eq_attr "type" "cmp,fast_compare,compare,delayed_compare") (eq_attr "cpu" "ppc403,ppc405")) @@ -91,7 +103,7 @@ "iu_40x") (define_insn_reservation "ppc403-jmpreg" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "ppc403,ppc405")) "bpu_40x") @@ -101,7 +113,7 @@ "bpu_40x") (define_insn_reservation "ppc405-float" 11 - (and (eq_attr "type" "fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,fpcompare,fp,dmul,sdiv,ddiv") + (and (eq_attr "type" "fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,\ + fpcompare,fp,dmul,sdiv,ddiv") (eq_attr "cpu" "ppc405")) "fpu_405*10") - diff --git a/contrib/gcc/config/rs6000/440.md b/contrib/gcc/config/rs6000/440.md index e98d5be782d..60e0f72dc16 100644 --- a/contrib/gcc/config/rs6000/440.md +++ b/contrib/gcc/config/rs6000/440.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM PowerPC 440 processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; PPC440 Embedded PowerPC controller ;; dual issue @@ -34,11 +34,12 @@ (define_insn_reservation "ppc440-load" 3 - (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ + load_l,store_c,sync") (eq_attr "cpu" "ppc440")) "ppc440_issue,ppc440_l_pipe") -(define_insn_reservation "ppc440-store" 1 +(define_insn_reservation "ppc440-store" 3 (and (eq_attr "type" "store,store_ux,store_u") (eq_attr "cpu" "ppc440")) "ppc440_issue,ppc440_l_pipe") @@ -58,6 +59,18 @@ (eq_attr "cpu" "ppc440")) "ppc440_issue,ppc440_i_pipe|ppc440_j_pipe") +(define_insn_reservation "ppc440-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc440")) + "ppc440_issue_0+ppc440_issue_1,\ + ppc440_i_pipe|ppc440_j_pipe,ppc440_i_pipe|ppc440_j_pipe") + +(define_insn_reservation "ppc440-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc440")) + "ppc440_issue_0+ppc440_issue_1,ppc440_i_pipe|ppc440_j_pipe,\ + ppc440_i_pipe|ppc440_j_pipe,ppc440_i_pipe|ppc440_j_pipe") + (define_insn_reservation "ppc440-imul" 3 (and (eq_attr "type" "imul,imul_compare") (eq_attr "cpu" "ppc440")) @@ -74,7 +87,7 @@ "ppc440_issue,ppc440_i_pipe*33") (define_insn_reservation "ppc440-branch" 1 - (and (eq_attr "type" "branch,jmpreg") + (and (eq_attr "type" "branch,jmpreg,isync") (eq_attr "cpu" "ppc440")) "ppc440_issue,ppc440_i_pipe") diff --git a/contrib/gcc/config/rs6000/603.md b/contrib/gcc/config/rs6000/603.md index 7ae038e33e0..4721aca798c 100644 --- a/contrib/gcc/config/rs6000/603.md +++ b/contrib/gcc/config/rs6000/603.md @@ -1,5 +1,5 @@ ;; Scheduling description for PowerPC 603 processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,8 +15,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "ppc603,ppc603fp") (define_cpu_unit "iu_603" "ppc603") @@ -39,25 +39,40 @@ ;; CR insns get executed in the SRU. Not modelled. (define_insn_reservation "ppc603-load" 2 - (and (eq_attr "type" "load,load_ext,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ux,load_u,load_l") (eq_attr "cpu" "ppc603")) "lsu_603") -(define_insn_reservation "ppc603-store" 1 +(define_insn_reservation "ppc603-store" 2 (and (eq_attr "type" "store,store_ux,store_u,fpstore,fpstore_ux,fpstore_u") (eq_attr "cpu" "ppc603")) - "lsu_603") + "lsu_603*2") (define_insn_reservation "ppc603-fpload" 2 (and (eq_attr "type" "fpload,fpload_ux,fpload_u") (eq_attr "cpu" "ppc603")) "lsu_603") +(define_insn_reservation "ppc603-storec" 8 + (and (eq_attr "type" "store_c") + (eq_attr "cpu" "ppc603")) + "lsu_603") + (define_insn_reservation "ppc603-integer" 1 (and (eq_attr "type" "integer,insert_word") (eq_attr "cpu" "ppc603")) "iu_603") +(define_insn_reservation "ppc603-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc603")) + "iu_603,iu_603") + +(define_insn_reservation "ppc603-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc603")) + "iu_603,iu_603,iu_603") + ; This takes 2 or 3 cycles (define_insn_reservation "ppc603-imul" 3 (and (eq_attr "type" "imul,imul_compare") @@ -116,7 +131,7 @@ "sru_603") (define_insn_reservation "ppc603-mfjmpr" 2 - (and (eq_attr "type" "mfjmpr") + (and (eq_attr "type" "mfjmpr,isync,sync") (eq_attr "cpu" "ppc603")) "sru_603") diff --git a/contrib/gcc/config/rs6000/6xx.md b/contrib/gcc/config/rs6000/6xx.md index d28d3738bb7..31aa6062070 100644 --- a/contrib/gcc/config/rs6000/6xx.md +++ b/contrib/gcc/config/rs6000/6xx.md @@ -1,6 +1,6 @@ ;; Scheduling description for PowerPC 604, PowerPC 604e, PowerPC 620, ;; and PowerPC 630 processors. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -16,8 +16,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "ppc6xx,ppc6xxfp,ppc6xxfp2") (define_cpu_unit "iu1_6xx,iu2_6xx,mciu_6xx" "ppc6xx") @@ -58,16 +58,36 @@ (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) "lsu_6xx") -(define_insn_reservation "ppc604-store" 1 +(define_insn_reservation "ppc604-store" 3 (and (eq_attr "type" "store,fpstore,store_ux,store_u,fpstore_ux,fpstore_u") (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) "lsu_6xx") +(define_insn_reservation "ppc604-llsc" 3 + (and (eq_attr "type" "load_l,store_c") + (eq_attr "cpu" "ppc604,ppc604e")) + "lsu_6xx") + +(define_insn_reservation "ppc630-llsc" 4 + (and (eq_attr "type" "load_l,store_c") + (eq_attr "cpu" "ppc620,ppc630")) + "lsu_6xx") + (define_insn_reservation "ppc604-integer" 1 (and (eq_attr "type" "integer,insert_word") (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) "iu1_6xx|iu2_6xx") +(define_insn_reservation "ppc604-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) + "iu1_6xx|iu2_6xx,iu1_6xx|iu2_6xx") + +(define_insn_reservation "ppc604-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) + "iu1_6xx|iu2_6xx,iu1_6xx|iu2_6xx,iu1_6xx|iu2_6xx") + (define_insn_reservation "ppc604-imul" 4 (and (eq_attr "type" "imul,imul2,imul3,imul_compare") (eq_attr "cpu" "ppc604")) @@ -232,3 +252,23 @@ (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630")) "bpu_6xx") +(define_insn_reservation "ppc604-isync" 0 + (and (eq_attr "type" "isync") + (eq_attr "cpu" "ppc604,ppc604e")) + "bpu_6xx") + +(define_insn_reservation "ppc630-isync" 6 + (and (eq_attr "type" "isync") + (eq_attr "cpu" "ppc620,ppc630")) + "bpu_6xx") + +(define_insn_reservation "ppc604-sync" 35 + (and (eq_attr "type" "sync") + (eq_attr "cpu" "ppc604,ppc604e")) + "lsu_6xx") + +(define_insn_reservation "ppc630-sync" 26 + (and (eq_attr "type" "sync") + (eq_attr "cpu" "ppc620,ppc630")) + "lsu_6xx") + diff --git a/contrib/gcc/config/rs6000/7450.md b/contrib/gcc/config/rs6000/7450.md index 55bd4d86368..99e87125fb9 100644 --- a/contrib/gcc/config/rs6000/7450.md +++ b/contrib/gcc/config/rs6000/7450.md @@ -1,5 +1,5 @@ ;; Scheduling description for Motorola PowerPC 7450 processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,11 +15,12 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. -(define_automaton "ppc7450,ppc7450fp,ppc7450vec") -(define_cpu_unit "iu1_7450,iu2_7450,iu3_7450,mciu_7450" "ppc7450") +(define_automaton "ppc7450,ppc7450mciu,ppc7450fp,ppc7450vec") +(define_cpu_unit "iu1_7450,iu2_7450,iu3_7450" "ppc7450") +(define_cpu_unit "mciu_7450" "ppc7450mciu") (define_cpu_unit "fpu_7450" "ppc7450fp") (define_cpu_unit "lsu_7450,bpu_7450" "ppc7450") (define_cpu_unit "du1_7450,du2_7450,du3_7450" "ppc7450") @@ -63,10 +64,31 @@ (eq_attr "cpu" "ppc7450")) "ppc7450_du,lsu_7450*3") +(define_insn_reservation "ppc7450-llsc" 3 + (and (eq_attr "type" "load_l,store_c") + (eq_attr "cpu" "ppc7450")) + "ppc7450_du,lsu_7450") + +(define_insn_reservation "ppc7450-sync" 35 + (and (eq_attr "type" "sync") + (eq_attr "cpu" "ppc7450")) + "ppc7450_du,lsu_7450") + (define_insn_reservation "ppc7450-integer" 1 (and (eq_attr "type" "integer,insert_word") (eq_attr "cpu" "ppc7450")) - "ppc7450_du,(iu1_7450|iu2_7450|iu3_7450)") + "ppc7450_du,iu1_7450|iu2_7450|iu3_7450") + +(define_insn_reservation "ppc7450-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc7450")) + "ppc7450_du,iu1_7450|iu2_7450|iu3_7450,iu1_7450|iu2_7450|iu3_7450") + +(define_insn_reservation "ppc7450-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc7450")) + "ppc7450_du,iu1_7450|iu2_7450|iu3_7450,\ + iu1_7450|iu2_7450|iu3_7450,iu1_7450|iu2_7450|iu3_7450") (define_insn_reservation "ppc7450-imul" 4 (and (eq_attr "type" "imul,imul_compare") @@ -130,7 +152,7 @@ "nothing,mciu_7450*2") (define_insn_reservation "ppc7450-jmpreg" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "ppc7450")) "nothing,bpu_7450") diff --git a/contrib/gcc/config/rs6000/7xx.md b/contrib/gcc/config/rs6000/7xx.md index de8a7b7552d..77e58a3cb6c 100644 --- a/contrib/gcc/config/rs6000/7xx.md +++ b/contrib/gcc/config/rs6000/7xx.md @@ -1,5 +1,5 @@ ;; Scheduling description for Motorola PowerPC 750 and PowerPC 7400 processors. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,8 +15,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "ppc7xx,ppc7xxfp") (define_cpu_unit "iu1_7xx,iu2_7xx" "ppc7xx") @@ -48,20 +48,36 @@ (define_insn_reservation "ppc750-load" 2 (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,\ - load_ux,load_u,fpload,fpload_ux,fpload_u,vecload") + load_ux,load_u,fpload,fpload_ux,fpload_u,\ + vecload,load_l") (eq_attr "cpu" "ppc750,ppc7400")) "ppc750_du,lsu_7xx") -(define_insn_reservation "ppc750-store" 1 +(define_insn_reservation "ppc750-store" 2 (and (eq_attr "type" "store,store_ux,store_u,\ fpstore,fpstore_ux,fpstore_u,vecstore") (eq_attr "cpu" "ppc750,ppc7400")) "ppc750_du,lsu_7xx") +(define_insn_reservation "ppc750-storec" 8 + (and (eq_attr "type" "store_c") + (eq_attr "cpu" "ppc750,ppc7400")) + "ppc750_du,lsu_7xx") + (define_insn_reservation "ppc750-integer" 1 (and (eq_attr "type" "integer,insert_word") (eq_attr "cpu" "ppc750,ppc7400")) - "ppc750_du,(iu1_7xx|iu2_7xx)") + "ppc750_du,iu1_7xx|iu2_7xx") + +(define_insn_reservation "ppc750-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc750,ppc7400")) + "ppc750_du,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx") + +(define_insn_reservation "ppc750-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc750,ppc7400")) + "ppc750_du,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx,iu1_7xx|iu2_7xx") (define_insn_reservation "ppc750-imul" 4 (and (eq_attr "type" "imul,imul_compare") @@ -127,10 +143,10 @@ (define_insn_reservation "ppc750-crlogical" 3 (and (eq_attr "type" "cr_logical,delayed_cr") (eq_attr "cpu" "ppc750,ppc7400")) - "ppc750_du,sru_7xx*2") + "nothing,sru_7xx*2") (define_insn_reservation "ppc750-mtjmpr" 2 - (and (eq_attr "type" "mtjmpr") + (and (eq_attr "type" "mtjmpr,isync,sync") (eq_attr "cpu" "ppc750,ppc7400")) "nothing,sru_7xx*2") @@ -140,7 +156,7 @@ "nothing,sru_7xx*2") (define_insn_reservation "ppc750-jmpreg" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "ppc750,ppc7400")) "nothing,bpu_7xx") diff --git a/contrib/gcc/config/rs6000/8540.md b/contrib/gcc/config/rs6000/8540.md index 737c3995897..b42e2472a41 100644 --- a/contrib/gcc/config/rs6000/8540.md +++ b/contrib/gcc/config/rs6000/8540.md @@ -1,5 +1,5 @@ ;; Pipeline description for Motorola PowerPC 8540 processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,14 +15,14 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "ppc8540_most,ppc8540_long,ppc8540_retire") (define_cpu_unit "ppc8540_decode_0,ppc8540_decode_1" "ppc8540_most") ;; We don't simulate general issue queue (GIC). If we have SU insn -;; and then SU1 insn, they can not be issued on the same cycle +;; and then SU1 insn, they cannot be issued on the same cycle ;; (although SU1 insn and then SU insn can be issued) because the SU ;; insn will go to SU1 from GIC0 entry. Fortunately, the first cycle ;; multipass insn scheduling will find the situation and issue the SU1 @@ -31,7 +31,7 @@ ;; We could describe completion buffers slots in combination with the ;; retirement units and the order of completion but the result -;; automaton would behave in the same way because we can not describe +;; automaton would behave in the same way because we cannot describe ;; real latency time with taking in order completion into account. ;; Actually we could define the real latency time by querying reserved ;; automaton units but the current scheduler uses latency time before @@ -89,9 +89,22 @@ (eq_attr "cpu" "ppc8540")) "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") +(define_insn_reservation "ppc8540_two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "ppc8540")) + "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ + ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") + +(define_insn_reservation "ppc8540_three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "ppc8540")) + "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ + ppc8540_issue+ppc8540_su_stage0+ppc8540_retire,\ + ppc8540_issue+ppc8540_su_stage0+ppc8540_retire") + ;; Branch. Actually this latency time is not used by the scheduler. (define_insn_reservation "ppc8540_branch" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "ppc8540")) "ppc8540_decode,ppc8540_bu,ppc8540_retire") @@ -138,13 +151,14 @@ ;; Loads (define_insn_reservation "ppc8540_load" 3 - (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ + load_l,sync") (eq_attr "cpu" "ppc8540")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") ;; Stores. (define_insn_reservation "ppc8540_store" 3 - (and (eq_attr "type" "store,store_ux,store_u") + (and (eq_attr "type" "store,store_ux,store_u,store_c") (eq_attr "cpu" "ppc8540")) "ppc8540_decode,ppc8540_issue+ppc8540_lsu,nothing,ppc8540_retire") diff --git a/contrib/gcc/config/rs6000/aix.h b/contrib/gcc/config/rs6000/aix.h index b14107f523a..57f487664a9 100644 --- a/contrib/gcc/config/rs6000/aix.h +++ b/contrib/gcc/config/rs6000/aix.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Yes! We are AIX! */ #define DEFAULT_ABI ABI_AIX @@ -32,13 +33,17 @@ /* AIX allows r13 to be used in 32-bit mode. */ #define FIXED_R13 0 +/* 32-bit and 64-bit AIX stack boundary is 128. */ +#undef STACK_BOUNDARY +#define STACK_BOUNDARY 128 + /* AIX does not support Altivec. */ #undef TARGET_ALTIVEC #define TARGET_ALTIVEC 0 #undef TARGET_ALTIVEC_ABI #define TARGET_ALTIVEC_ABI 0 -#undef TARGET_ALTIVEC_VRSAVE -#define TARGET_ALTIVEC_VRSAVE 0 +#undef TARGET_IEEEQUAD +#define TARGET_IEEEQUAD 0 /* The AIX linker will discard static constructors in object files before collect has a chance to see them, so scan the object files directly. */ @@ -51,26 +56,52 @@ #define REAL_NM_FILE_NAME "/usr/ucb/nm" #define USER_LABEL_PREFIX "" + /* Don't turn -B into -L if the argument specifies a relative file name. */ #define RELATIVE_PREFIX_NOT_LINKDIR /* Because of the above, we must have gcc search itself to find libgcc.a. */ #define LINK_LIBGCC_SPECIAL_1 +#define MFWRAP_SPEC " %{static: %{fmudflap|fmudflapth: \ + -brename:malloc,__wrap_malloc -brename:__real_malloc,malloc \ + -brename:free,__wrap_free -brename:__real_free,free \ + -brename:calloc,__wrap_calloc -brename:__real_calloc,calloc \ + -brename:realloc,__wrap_realloc -brename:__real_realloc,realloc \ + -brename:mmap,__wrap_mmap -brename:__real_mmap,mmap \ + -brename:munmap,__wrap_munmap -brename:__real_munmap,munmap \ + -brename:alloca,__wrap_alloca -brename:__real_alloca,alloca \ +} %{fmudflapth: \ + -brename:pthread_create,__wrap_pthread_create \ + -brename:__real_pthread_create,pthread_create \ + -brename:pthread_join,__wrap_pthread_join \ + -brename:__real_pthread_join,pthread_join \ + -brename:pthread_exit,__wrap_pthread_exit \ + -brename:__real_pthread_exit,pthread_exit \ +}} %{fmudflap|fmudflapth: \ + -brename:main,__wrap_main -brename:__real_main,main \ +}" + +#define MFLIB_SPEC " %{fmudflap: -lmudflap \ + %{static:%(link_gcc_c_sequence) -lmudflap}} \ + %{fmudflapth: -lmudflapth -lpthread \ + %{static:%(link_gcc_c_sequence) -lmudflapth}} " + /* Names to predefine in the preprocessor for this target machine. */ -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_IBMR2"); \ - builtin_define ("_POWER"); \ - builtin_define ("_AIX"); \ - builtin_define ("_AIX32"); \ - builtin_define ("_LONG_LONG"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=aix"); \ - builtin_assert ("cpu=rs6000"); \ - builtin_assert ("machine=rs6000"); \ - } \ +#define TARGET_OS_AIX_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_IBMR2"); \ + builtin_define ("_POWER"); \ + builtin_define ("_AIX"); \ + builtin_define ("_AIX32"); \ + builtin_define ("_AIX41"); \ + builtin_define ("_LONG_LONG"); \ + if (TARGET_LONG_DOUBLE_128) \ + builtin_define ("__LONGDOUBLE128"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=aix"); \ + } \ while (0) /* Define appropriate architecture macros for preprocessor depending on @@ -139,12 +170,12 @@ /* AIX increases natural record alignment to doubleword if the first field is an FP double while the FP fields remain word aligned. */ -#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ - ((TREE_CODE (STRUCT) == RECORD_TYPE \ - || TREE_CODE (STRUCT) == UNION_TYPE \ - || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ - && TARGET_ALIGN_NATURAL == 0 \ - ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ +#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ + ((TREE_CODE (STRUCT) == RECORD_TYPE \ + || TREE_CODE (STRUCT) == UNION_TYPE \ + || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ + && TARGET_ALIGN_NATURAL == 0 \ + ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ : MAX ((COMPUTED), (SPECIFIED))) /* The AIX ABI isn't explicit on whether aggregates smaller than a @@ -157,13 +188,6 @@ #define AGGREGATE_PADDING_FIXED 1 #define AGGREGATES_PAD_UPWARD_ALWAYS 1 -/* We don't want anything in the reg parm area being passed on the - stack. */ -#define MUST_PASS_IN_STACK(MODE, TYPE) \ - ((TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE))) - /* Specify padding for the last element of a block move between registers and memory. FIRST is nonzero if this is the only element. */ @@ -174,19 +198,6 @@ #define JUMP_TABLES_IN_TEXT_SECTION 1 -/* Enable AIX XL compiler calling convention breakage compatibility. */ -#undef TARGET_XL_COMPAT -#define MASK_XL_COMPAT 0x40000000 -#define TARGET_XL_COMPAT (target_flags & MASK_XL_COMPAT) -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"xl-compat", MASK_XL_COMPAT, \ - N_("Conform more closely to IBM XLC semantics") }, \ - {"no-xl-compat", - MASK_XL_COMPAT, \ - N_("Default GCC semantics that differ from IBM XLC") }, \ - SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES - /* Define any extra SPECS that the compiler needs to generate. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -244,3 +255,6 @@ 32-bit mode. */ #define OS_MISSING_POWERPC64 1 #define OS_MISSING_ALTIVEC 1 + +/* WINT_TYPE */ +#define WINT_TYPE "int" diff --git a/contrib/gcc/config/rs6000/aix.opt b/contrib/gcc/config/rs6000/aix.opt new file mode 100644 index 00000000000..e6dadce10fb --- /dev/null +++ b/contrib/gcc/config/rs6000/aix.opt @@ -0,0 +1,25 @@ +; AIX options. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mxl-compat +Target Var(has_xl_compat_option) +Conform more closely to IBM XLC semantics diff --git a/contrib/gcc/config/rs6000/aix41.h b/contrib/gcc/config/rs6000/aix41.h index 542f92841cb..44b1390cdfe 100644 --- a/contrib/gcc/config/rs6000/aix41.h +++ b/contrib/gcc/config/rs6000/aix41.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX version 4.1. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, + 2005 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). @@ -18,13 +19,8 @@ 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. */ - -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef ASM_SPEC #define ASM_SPEC "-u %(asm_cpu)" @@ -33,18 +29,11 @@ #define ASM_DEFAULT_SPEC "-mcom" #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_IBMR2"); \ - builtin_define ("_POWER"); \ - builtin_define ("_AIX"); \ - builtin_define ("_AIX32"); \ - builtin_define ("_AIX41"); \ - builtin_define ("_LONG_LONG"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=aix"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + TARGET_OS_AIX_CPP_BUILTINS (); \ + } \ while (0) #undef CPP_SPEC @@ -102,3 +91,6 @@ .set directives. We handle this by deferring the output of .set directives to the end of the compilation unit. */ #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) true + +#undef TARGET_64BIT +#define TARGET_64BIT 0 diff --git a/contrib/gcc/config/rs6000/aix41.opt b/contrib/gcc/config/rs6000/aix41.opt new file mode 100644 index 00000000000..a1f7665d110 --- /dev/null +++ b/contrib/gcc/config/rs6000/aix41.opt @@ -0,0 +1,25 @@ +; Options for AIX4.1. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mpe +Target Report RejectNegative Var(internal_nothing_1) +Support message passing with the Parallel Environment diff --git a/contrib/gcc/config/rs6000/aix43.h b/contrib/gcc/config/rs6000/aix43.h index 50bd304dd7c..b99f1a8e8b5 100644 --- a/contrib/gcc/config/rs6000/aix43.h +++ b/contrib/gcc/config/rs6000/aix43.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX version 4.3. - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). This file is part of GCC. @@ -17,18 +18,8 @@ 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. */ - -/* AIX 4.3 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro @@ -45,12 +36,18 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ + } \ + if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \ + { \ + rs6000_long_double_type_size = 64; \ + if (rs6000_explicit_options.long_double) \ + warning (0, "soft-float and long-double-128 are incompatible"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -96,19 +93,12 @@ do { \ #define ASM_DEFAULT_SPEC "-mcom" #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_IBMR2"); \ - builtin_define ("_POWER"); \ - builtin_define ("_AIX"); \ - builtin_define ("_AIX32"); \ - builtin_define ("_AIX41"); \ - builtin_define ("_AIX43"); \ - builtin_define ("_LONG_LONG"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=aix"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_AIX43"); \ + TARGET_OS_AIX_CPP_BUILTINS (); \ + } \ while (0) #undef CPP_SPEC @@ -122,10 +112,7 @@ do { \ defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC \ - "-D_XOPEN_SOURCE=500 \ - -D_XOPEN_SOURCE_EXTENDED=1 \ - -D_LARGE_FILE_API \ - -D_ALL_SOURCE \ + "-D_ALL_SOURCE \ %{maix64: -D__64BIT__} \ %{mpe: -I/usr/lpp/ppe.poe/include} \ %{pthread: -D_THREAD_SAFE}" @@ -192,3 +179,6 @@ do { \ .set directives. We handle this by deferring the output of .set directives to the end of the compilation unit. */ #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) true + +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/contrib/gcc/config/rs6000/aix51.h b/contrib/gcc/config/rs6000/aix51.h index 863b97fb229..ad0afeeb67a 100644 --- a/contrib/gcc/config/rs6000/aix51.h +++ b/contrib/gcc/config/rs6000/aix51.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V5. - Copyright (C) 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). This file is part of GCC. @@ -17,18 +17,8 @@ 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. */ - -/* AIX V5 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro @@ -45,12 +35,12 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -90,26 +80,21 @@ do { \ %{mcpu=604: -m604} \ %{mcpu=604e: -m604} \ %{mcpu=620: -m620} \ -%{mcpu=630: -m620}" +%{mcpu=630: -m620} \ +%{mcpu=970: -m620} \ +%{mcpu=G5: -m620}" #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mcom" #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_IBMR2"); \ - builtin_define ("_POWER"); \ - builtin_define ("_LONG_LONG"); \ - builtin_define ("_AIX"); \ - builtin_define ("_AIX32"); \ - builtin_define ("_AIX41"); \ - builtin_define ("_AIX43"); \ - builtin_define ("_AIX51"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=aix"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_AIX43"); \ + builtin_define ("_AIX51"); \ + TARGET_OS_AIX_CPP_BUILTINS (); \ + } \ while (0) #undef CPP_SPEC @@ -123,10 +108,7 @@ do { \ defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC \ - "-D_XOPEN_SOURCE=500 \ - -D_XOPEN_SOURCE_EXTENDED=1 \ - -D_LARGE_FILE_API \ - -D_ALL_SOURCE \ + "-D_ALL_SOURCE \ %{maix64: -D__64BIT__} \ %{mpe: -I/usr/lpp/ppe.poe/include} \ %{pthread: -D_THREAD_SAFE}" @@ -181,7 +163,6 @@ do { \ /* Width of wchar_t in bits. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32) -#define MAX_WCHAR_TYPE_SIZE 32 /* AIX V5 uses PowerPC nop (ori 0,0,0) instruction as call glue for PowerPC and "cror 31,31,31" for POWER architecture. */ @@ -197,3 +178,5 @@ do { \ #undef LD_INIT_SWITCH #define LD_INIT_SWITCH "-binitfini" +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/contrib/gcc/config/rs6000/aix52.h b/contrib/gcc/config/rs6000/aix52.h index 6f12619e2da..87d2157c61e 100644 --- a/contrib/gcc/config/rs6000/aix52.h +++ b/contrib/gcc/config/rs6000/aix52.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000 POWER running AIX V5.2. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by David Edelsohn (edelsohn@gnu.org). This file is part of GCC. @@ -17,18 +17,8 @@ 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. */ - -/* AIX V5 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro @@ -45,12 +35,18 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ + } \ + if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \ + { \ + rs6000_long_double_type_size = 64; \ + if (rs6000_explicit_options.long_double) \ + warning (0, "soft-float and long-double-128 are incompatible"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -70,6 +66,9 @@ do { \ %{!mpower64: %(asm_default)}}} \ %{mcpu=power3: -m620} \ %{mcpu=power4: -m620} \ +%{mcpu=power5: -m620} \ +%{mcpu=power5+: -m620} \ +%{mcpu=power6: -m620} \ %{mcpu=powerpc: -mppc} \ %{mcpu=rs64a: -mppc} \ %{mcpu=603: -m603} \ @@ -77,27 +76,22 @@ do { \ %{mcpu=604: -m604} \ %{mcpu=604e: -m604} \ %{mcpu=620: -m620} \ -%{mcpu=630: -m620}" +%{mcpu=630: -m620} \ +%{mcpu=970: -m620} \ +%{mcpu=G5: -m620}" #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mppc" #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_IBMR2"); \ - builtin_define ("_POWER"); \ - builtin_define ("_LONG_LONG"); \ - builtin_define ("_AIX"); \ - builtin_define ("_AIX32"); \ - builtin_define ("_AIX41"); \ - builtin_define ("_AIX43"); \ - builtin_define ("_AIX51"); \ - builtin_define ("_AIX52"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=aix"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_AIX43"); \ + builtin_define ("_AIX51"); \ + builtin_define ("_AIX52"); \ + TARGET_OS_AIX_CPP_BUILTINS (); \ + } \ while (0) #undef CPP_SPEC @@ -108,13 +102,10 @@ do { \ %{pthread: -D_THREAD_SAFE}" /* The GNU C++ standard library requires that these macros be - defined. */ + defined. Synchronize with libstdc++ os_defines.h. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC \ - "-D_XOPEN_SOURCE=500 \ - -D_XOPEN_SOURCE_EXTENDED=1 \ - -D_LARGE_FILE_API \ - -D_ALL_SOURCE \ + "-D_ALL_SOURCE \ %{maix64: -D__64BIT__} \ %{mpe: -I/usr/lpp/ppe.poe/include} \ %{pthread: -D_THREAD_SAFE}" @@ -123,7 +114,7 @@ do { \ #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) #undef PROCESSOR_DEFAULT -#define PROCESSOR_DEFAULT PROCESSOR_PPC630 +#define PROCESSOR_DEFAULT PROCESSOR_POWER4 #undef PROCESSOR_DEFAULT64 #define PROCESSOR_DEFAULT64 PROCESSOR_POWER4 @@ -173,7 +164,6 @@ do { \ /* Width of wchar_t in bits. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32) -#define MAX_WCHAR_TYPE_SIZE 32 /* AIX V5 uses PowerPC nop (ori 0,0,0) instruction as call glue for PowerPC and "cror 31,31,31" for POWER architecture. */ @@ -197,3 +187,5 @@ do { \ extern long long int atoll(const char *); #endif +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/contrib/gcc/config/rs6000/aix64.opt b/contrib/gcc/config/rs6000/aix64.opt new file mode 100644 index 00000000000..817e9856673 --- /dev/null +++ b/contrib/gcc/config/rs6000/aix64.opt @@ -0,0 +1,33 @@ +; Options for the 64-bit flavor of AIX. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +maix64 +Target Report RejectNegative Mask(64BIT) +Compile for 64-bit pointers + +maix32 +Target Report RejectNegative InverseMask(64BIT) +Compile for 32-bit pointers + +mpe +Target Report RejectNegative Var(internal_nothing_1) +Support message passing with the Parallel Environment diff --git a/contrib/gcc/config/rs6000/altivec.h b/contrib/gcc/config/rs6000/altivec.h index 779b4280ba5..dacb6d0b744 100644 --- a/contrib/gcc/config/rs6000/altivec.h +++ b/contrib/gcc/config/rs6000/altivec.h @@ -1,6 +1,7 @@ /* PowerPC AltiVec include file. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Aldy Hernandez (aldyh@redhat.com). + Rewritten by Paolo Bonzini (bonzini@gnu.org). This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause @@ -55,8 +56,7 @@ #define __CR6_LT 2 #define __CR6_LT_REV 3 -/* These are easy... Same exact arguments. */ - +/* Synonyms. */ #define vec_vaddcuw vec_addc #define vec_vand vec_and #define vec_vandc vec_andc @@ -99,11409 +99,363 @@ #define vec_vrfiz vec_trunc #define vec_vxor vec_xor -#ifdef __cplusplus +/* Functions that are resolved by the backend to one of the + typed builtins. */ +#define vec_vaddfp __builtin_vec_vaddfp +#define vec_addc __builtin_vec_addc +#define vec_vaddsws __builtin_vec_vaddsws +#define vec_vaddshs __builtin_vec_vaddshs +#define vec_vaddsbs __builtin_vec_vaddsbs +#define vec_vavgsw __builtin_vec_vavgsw +#define vec_vavguw __builtin_vec_vavguw +#define vec_vavgsh __builtin_vec_vavgsh +#define vec_vavguh __builtin_vec_vavguh +#define vec_vavgsb __builtin_vec_vavgsb +#define vec_vavgub __builtin_vec_vavgub +#define vec_ceil __builtin_vec_ceil +#define vec_cmpb __builtin_vec_cmpb +#define vec_vcmpeqfp __builtin_vec_vcmpeqfp +#define vec_cmpge __builtin_vec_cmpge +#define vec_vcmpgtfp __builtin_vec_vcmpgtfp +#define vec_vcmpgtsw __builtin_vec_vcmpgtsw +#define vec_vcmpgtuw __builtin_vec_vcmpgtuw +#define vec_vcmpgtsh __builtin_vec_vcmpgtsh +#define vec_vcmpgtuh __builtin_vec_vcmpgtuh +#define vec_vcmpgtsb __builtin_vec_vcmpgtsb +#define vec_vcmpgtub __builtin_vec_vcmpgtub +#define vec_vcfsx __builtin_vec_vcfsx +#define vec_vcfux __builtin_vec_vcfux +#define vec_cts __builtin_vec_cts +#define vec_ctu __builtin_vec_ctu +#define vec_expte __builtin_vec_expte +#define vec_floor __builtin_vec_floor +#define vec_loge __builtin_vec_loge +#define vec_madd __builtin_vec_madd +#define vec_madds __builtin_vec_madds +#define vec_mtvscr __builtin_vec_mtvscr +#define vec_vmaxfp __builtin_vec_vmaxfp +#define vec_vmaxsw __builtin_vec_vmaxsw +#define vec_vmaxsh __builtin_vec_vmaxsh +#define vec_vmaxsb __builtin_vec_vmaxsb +#define vec_vminfp __builtin_vec_vminfp +#define vec_vminsw __builtin_vec_vminsw +#define vec_vminsh __builtin_vec_vminsh +#define vec_vminsb __builtin_vec_vminsb +#define vec_mradds __builtin_vec_mradds +#define vec_vmsumshm __builtin_vec_vmsumshm +#define vec_vmsumuhm __builtin_vec_vmsumuhm +#define vec_vmsummbm __builtin_vec_vmsummbm +#define vec_vmsumubm __builtin_vec_vmsumubm +#define vec_vmsumshs __builtin_vec_vmsumshs +#define vec_vmsumuhs __builtin_vec_vmsumuhs +#define vec_vmulesb __builtin_vec_vmulesb +#define vec_vmulesh __builtin_vec_vmulesh +#define vec_vmuleuh __builtin_vec_vmuleuh +#define vec_vmuleub __builtin_vec_vmuleub +#define vec_vmulosh __builtin_vec_vmulosh +#define vec_vmulouh __builtin_vec_vmulouh +#define vec_vmulosb __builtin_vec_vmulosb +#define vec_vmuloub __builtin_vec_vmuloub +#define vec_nmsub __builtin_vec_nmsub +#define vec_packpx __builtin_vec_packpx +#define vec_vpkswss __builtin_vec_vpkswss +#define vec_vpkuwus __builtin_vec_vpkuwus +#define vec_vpkshss __builtin_vec_vpkshss +#define vec_vpkuhus __builtin_vec_vpkuhus +#define vec_vpkswus __builtin_vec_vpkswus +#define vec_vpkshus __builtin_vec_vpkshus +#define vec_re __builtin_vec_re +#define vec_round __builtin_vec_round +#define vec_rsqrte __builtin_vec_rsqrte +#define vec_vsubfp __builtin_vec_vsubfp +#define vec_subc __builtin_vec_subc +#define vec_vsubsws __builtin_vec_vsubsws +#define vec_vsubshs __builtin_vec_vsubshs +#define vec_vsubsbs __builtin_vec_vsubsbs +#define vec_sum4s __builtin_vec_sum4s +#define vec_vsum4shs __builtin_vec_vsum4shs +#define vec_vsum4sbs __builtin_vec_vsum4sbs +#define vec_vsum4ubs __builtin_vec_vsum4ubs +#define vec_sum2s __builtin_vec_sum2s +#define vec_sums __builtin_vec_sums +#define vec_trunc __builtin_vec_trunc +#define vec_vupkhpx __builtin_vec_vupkhpx +#define vec_vupkhsh __builtin_vec_vupkhsh +#define vec_vupkhsb __builtin_vec_vupkhsb +#define vec_vupklpx __builtin_vec_vupklpx +#define vec_vupklsh __builtin_vec_vupklsh +#define vec_vupklsb __builtin_vec_vupklsb +#define vec_abs __builtin_vec_abs +#define vec_abss __builtin_vec_abss +#define vec_add __builtin_vec_add +#define vec_adds __builtin_vec_adds +#define vec_and __builtin_vec_and +#define vec_andc __builtin_vec_andc +#define vec_avg __builtin_vec_avg +#define vec_cmpeq __builtin_vec_cmpeq +#define vec_cmpgt __builtin_vec_cmpgt +#define vec_ctf __builtin_vec_ctf +#define vec_dst __builtin_vec_dst +#define vec_dstst __builtin_vec_dstst +#define vec_dststt __builtin_vec_dststt +#define vec_dstt __builtin_vec_dstt +#define vec_ld __builtin_vec_ld +#define vec_lde __builtin_vec_lde +#define vec_ldl __builtin_vec_ldl +#define vec_lvebx __builtin_vec_lvebx +#define vec_lvehx __builtin_vec_lvehx +#define vec_lvewx __builtin_vec_lvewx +#define vec_lvsl __builtin_vec_lvsl +#define vec_lvsr __builtin_vec_lvsr +#define vec_max __builtin_vec_max +#define vec_mergeh __builtin_vec_mergeh +#define vec_mergel __builtin_vec_mergel +#define vec_min __builtin_vec_min +#define vec_mladd __builtin_vec_mladd +#define vec_msum __builtin_vec_msum +#define vec_msums __builtin_vec_msums +#define vec_mule __builtin_vec_mule +#define vec_mulo __builtin_vec_mulo +#define vec_nor __builtin_vec_nor +#define vec_or __builtin_vec_or +#define vec_pack __builtin_vec_pack +#define vec_packs __builtin_vec_packs +#define vec_packsu __builtin_vec_packsu +#define vec_perm __builtin_vec_perm +#define vec_rl __builtin_vec_rl +#define vec_sel __builtin_vec_sel +#define vec_sl __builtin_vec_sl +#define vec_sld __builtin_vec_sld +#define vec_sll __builtin_vec_sll +#define vec_slo __builtin_vec_slo +#define vec_splat __builtin_vec_splat +#define vec_sr __builtin_vec_sr +#define vec_sra __builtin_vec_sra +#define vec_srl __builtin_vec_srl +#define vec_sro __builtin_vec_sro +#define vec_st __builtin_vec_st +#define vec_ste __builtin_vec_ste +#define vec_stl __builtin_vec_stl +#define vec_stvebx __builtin_vec_stvebx +#define vec_stvehx __builtin_vec_stvehx +#define vec_stvewx __builtin_vec_stvewx +#define vec_sub __builtin_vec_sub +#define vec_subs __builtin_vec_subs +#define vec_sum __builtin_vec_sum +#define vec_unpackh __builtin_vec_unpackh +#define vec_unpackl __builtin_vec_unpackl +#define vec_vaddubm __builtin_vec_vaddubm +#define vec_vaddubs __builtin_vec_vaddubs +#define vec_vadduhm __builtin_vec_vadduhm +#define vec_vadduhs __builtin_vec_vadduhs +#define vec_vadduwm __builtin_vec_vadduwm +#define vec_vadduws __builtin_vec_vadduws +#define vec_vcmpequb __builtin_vec_vcmpequb +#define vec_vcmpequh __builtin_vec_vcmpequh +#define vec_vcmpequw __builtin_vec_vcmpequw +#define vec_vmaxub __builtin_vec_vmaxub +#define vec_vmaxuh __builtin_vec_vmaxuh +#define vec_vmaxuw __builtin_vec_vmaxuw +#define vec_vminub __builtin_vec_vminub +#define vec_vminuh __builtin_vec_vminuh +#define vec_vminuw __builtin_vec_vminuw +#define vec_vmrghb __builtin_vec_vmrghb +#define vec_vmrghh __builtin_vec_vmrghh +#define vec_vmrghw __builtin_vec_vmrghw +#define vec_vmrglb __builtin_vec_vmrglb +#define vec_vmrglh __builtin_vec_vmrglh +#define vec_vmrglw __builtin_vec_vmrglw +#define vec_vpkuhum __builtin_vec_vpkuhum +#define vec_vpkuwum __builtin_vec_vpkuwum +#define vec_vrlb __builtin_vec_vrlb +#define vec_vrlh __builtin_vec_vrlh +#define vec_vrlw __builtin_vec_vrlw +#define vec_vslb __builtin_vec_vslb +#define vec_vslh __builtin_vec_vslh +#define vec_vslw __builtin_vec_vslw +#define vec_vspltb __builtin_vec_vspltb +#define vec_vsplth __builtin_vec_vsplth +#define vec_vspltw __builtin_vec_vspltw +#define vec_vsrab __builtin_vec_vsrab +#define vec_vsrah __builtin_vec_vsrah +#define vec_vsraw __builtin_vec_vsraw +#define vec_vsrb __builtin_vec_vsrb +#define vec_vsrh __builtin_vec_vsrh +#define vec_vsrw __builtin_vec_vsrw +#define vec_vsububs __builtin_vec_vsububs +#define vec_vsububm __builtin_vec_vsububm +#define vec_vsubuhm __builtin_vec_vsubuhm +#define vec_vsubuhs __builtin_vec_vsubuhs +#define vec_vsubuwm __builtin_vec_vsubuwm +#define vec_vsubuws __builtin_vec_vsubuws +#define vec_xor __builtin_vec_xor -extern "C++" { +/* Predicates. + For C++, we use templates in order to allow non-parenthesized arguments. + For C, instead, we use macros since non-parenthesized arguments were + not allowed even in older GCC implementation of AltiVec. -/* Prototypes for builtins that take literals and must always be - inlined. */ -inline __vector float vec_ctf (__vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector float vec_ctf (__vector signed int, const int) __attribute__ ((always_inline)); -inline __vector float vec_vcfsx (__vector signed int a1, const int a2) __attribute__ ((always_inline)); -inline __vector float vec_vcfux (__vector unsigned int a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed int vec_cts (__vector float, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_ctu (__vector float, const int) __attribute__ ((always_inline)); -inline void vec_dss (const int) __attribute__ ((always_inline)); + In the future, we may add more magic to the back-end, so that no + one- or two-argument macros are used. */ -inline void vec_dst (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector __bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector __bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector __pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector __bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const float *, int, const int) __attribute__ ((always_inline)); +#ifdef __cplusplus__ +#define __altivec_unary_pred(NAME, CALL) \ +template int NAME (T a1) { return CALL; } -inline void vec_dstst (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector __bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector __bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector __pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector __bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const float *, int, const int) __attribute__ ((always_inline)); +#define __altivec_scalar_pred(NAME, CALL) \ +template int NAME (T a1, U a2) { return CALL; } -inline void vec_dststt (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector __bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector __bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector __pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector __bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const float *, int, const int) __attribute__ ((always_inline)); - -inline void vec_dstt (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector __bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector __bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector __pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector __bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const float *, int, const int) __attribute__ ((always_inline)); - -inline __vector float vec_sld (__vector float, __vector float, const int) __attribute__ ((always_inline)); -inline __vector signed int vec_sld (__vector signed int, __vector signed int, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_sld (__vector unsigned int, __vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector __bool int vec_sld (__vector __bool int, __vector __bool int, const int) __attribute__ ((always_inline)); -inline __vector signed short vec_sld (__vector signed short, __vector signed short, const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_sld (__vector unsigned short, __vector unsigned short, const int) __attribute__ ((always_inline)); -inline __vector __bool short vec_sld (__vector __bool short, __vector __bool short, const int) __attribute__ ((always_inline)); -inline __vector __pixel vec_sld (__vector __pixel, __vector __pixel, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_sld (__vector signed char, __vector signed char, const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_sld (__vector unsigned char, __vector unsigned char, const int) __attribute__ ((always_inline)); -inline __vector __bool char vec_sld (__vector __bool char, __vector __bool char, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_splat (__vector signed char, const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_splat (__vector unsigned char, const int) __attribute__ ((always_inline)); -inline __vector __bool char vec_splat (__vector __bool char, const int) __attribute__ ((always_inline)); -inline __vector signed short vec_splat (__vector signed short, const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_splat (__vector unsigned short, const int) __attribute__ ((always_inline)); -inline __vector __bool short vec_splat (__vector __bool short, const int) __attribute__ ((always_inline)); -inline __vector __pixel vec_splat (__vector __pixel, const int) __attribute__ ((always_inline)); -inline __vector float vec_splat (__vector float, const int) __attribute__ ((always_inline)); -inline __vector signed int vec_splat (__vector signed int, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_splat (__vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector __bool int vec_splat (__vector __bool int, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_splat_s8 (const int) __attribute__ ((always_inline)); -inline __vector signed short vec_splat_s16 (const int) __attribute__ ((always_inline)); -inline __vector signed int vec_splat_s32 (const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_splat_u8 (const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_splat_u16 (const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_splat_u32 (const int) __attribute__ ((always_inline)); -inline __vector float vec_vspltw (__vector float a1, const int a2) __attribute__ ((always_inline)); -inline __vector __bool int vec_vspltw (__vector __bool int a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed int vec_vspltw (__vector signed int a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned int vec_vspltw (__vector unsigned int a1, const int a2) __attribute__ ((always_inline)); -inline __vector __bool short vec_vsplth (__vector __bool short a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed short vec_vsplth (__vector signed short a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned short vec_vsplth (__vector unsigned short a1, const int a2) __attribute__ ((always_inline)); -inline __vector __pixel vec_vsplth (__vector __pixel a1, const int a2) __attribute__ ((always_inline)); -inline __vector __bool char vec_vspltb (__vector __bool char a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed char vec_vspltb (__vector signed char a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned char vec_vspltb (__vector unsigned char a1, const int a2) __attribute__ ((always_inline)); - -/* vec_step */ - -template -struct __vec_step_help -{ - // All proper __vector types will specialize _S_elem. +/* Given the vec_step of a type, return the corresponding bool type. */ +template class __altivec_bool_ret { }; +template <> class __altivec_bool_ret <4> { + typedef __vector __bool int __ret; +}; +template <> class __altivec_bool_ret <8> { + typedef __vector __bool short __ret; +}; +template <> class __altivec_bool_ret <16> { + typedef __vector __bool char __ret; }; -template<> -struct __vec_step_help<__vector signed short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector unsigned short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector __bool short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector __pixel> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector signed int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector unsigned int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector __bool int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector unsigned char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector signed char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector __bool char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector float> -{ - static const int _S_elem = 4; -}; - -#define vec_step(t) __vec_step_help::_S_elem - -/* vec_abs */ - -inline __vector signed char -vec_abs (__vector signed char a1) -{ - return __builtin_altivec_abs_v16qi (a1); -} - -inline __vector signed short -vec_abs (__vector signed short a1) -{ - return __builtin_altivec_abs_v8hi (a1); -} - -inline __vector signed int -vec_abs (__vector signed int a1) -{ - return __builtin_altivec_abs_v4si (a1); -} - -inline __vector float -vec_abs (__vector float a1) -{ - return __builtin_altivec_abs_v4sf (a1); -} - -/* vec_abss */ - -inline __vector signed char -vec_abss (__vector signed char a1) -{ - return __builtin_altivec_abss_v16qi (a1); -} - -inline __vector signed short -vec_abss (__vector signed short a1) -{ - return __builtin_altivec_abss_v8hi (a1); -} - -inline __vector signed int -vec_abss (__vector signed int a1) -{ - return __builtin_altivec_abss_v4si (a1); -} - -/* vec_add */ - -inline __vector signed char -vec_add (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_add (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_add (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_add (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_add (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_add (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_add (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_add (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_add (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_add (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vaddfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vaddfp */ - -inline __vector float -vec_vaddfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vaddfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vadduwm */ - -inline __vector signed int -vec_vadduwm (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vadduwm (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vadduwm (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vadduhm */ - -inline __vector signed short -vec_vadduhm (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vadduhm (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vadduhm (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vaddubm */ - -inline __vector signed char -vec_vaddubm (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddubm (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddubm (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_addc */ - -inline __vector unsigned int -vec_addc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vaddcuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_adds */ - -inline __vector unsigned char -vec_adds (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_adds (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_adds (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_adds (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_adds (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_adds (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_adds (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_adds (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_adds (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vaddsws */ - -inline __vector signed int -vec_vaddsws (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vaddsws (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vaddsws (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vadduws */ - -inline __vector unsigned int -vec_vadduws (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduws (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduws (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vaddshs */ - -inline __vector signed short -vec_vaddshs (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vaddshs (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vaddshs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vadduhs */ - -inline __vector unsigned short -vec_vadduhs (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhs (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vaddsbs */ - -inline __vector signed char -vec_vaddsbs (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddsbs (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddsbs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vaddubs */ - -inline __vector unsigned char -vec_vaddubs (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubs (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_and */ - -inline __vector float -vec_and (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_and (__vector float a1, __vector __bool int a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_and (__vector __bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_and (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_and (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_and (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_andc */ - -inline __vector float -vec_andc (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_andc (__vector float a1, __vector __bool int a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_andc (__vector __bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_andc (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_andc (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_andc (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_avg */ - -inline __vector unsigned char -vec_avg (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_avg (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_avg (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_avg (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_avg (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_avg (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavgsw */ - -inline __vector signed int -vec_vavgsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavguw */ - -inline __vector unsigned int -vec_vavguw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavgsh */ - -inline __vector signed short -vec_vavgsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vavguh */ - -inline __vector unsigned short -vec_vavguh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vavgsb */ - -inline __vector signed char -vec_vavgsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vavgub */ - -inline __vector unsigned char -vec_vavgub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_ceil */ - -inline __vector float -vec_ceil (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfip ((__vector float) a1); -} - -/* vec_cmpb */ - -inline __vector signed int -vec_cmpb (__vector float a1, __vector float a2) -{ - return (__vector signed int) __builtin_altivec_vcmpbfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_cmpeq */ - -inline __vector __bool char -vec_cmpeq (__vector signed char a1, __vector signed char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool char -vec_cmpeq (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool short -vec_cmpeq (__vector signed short a1, __vector signed short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool short -vec_cmpeq (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool int -vec_cmpeq (__vector signed int a1, __vector signed int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_cmpeq (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_cmpeq (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpeqfp */ - -inline __vector __bool int -vec_vcmpeqfp (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpequw */ - -inline __vector __bool int -vec_vcmpequw (__vector signed int a1, __vector signed int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_vcmpequw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpequh */ - -inline __vector __bool short -vec_vcmpequh (__vector signed short a1, __vector signed short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool short -vec_vcmpequh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpequb */ - -inline __vector __bool char -vec_vcmpequb (__vector signed char a1, __vector signed char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool char -vec_vcmpequb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_cmpge */ - -inline __vector __bool int -vec_cmpge (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) a1, (__vector float) a2); -} - -/* vec_cmpgt */ - -inline __vector __bool char -vec_cmpgt (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool char -vec_cmpgt (__vector signed char a1, __vector signed char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool short -vec_cmpgt (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool short -vec_cmpgt (__vector signed short a1, __vector signed short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool int -vec_cmpgt (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_cmpgt (__vector signed int a1, __vector signed int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_cmpgt (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpgtfp */ - -inline __vector __bool int -vec_vcmpgtfp (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpgtsw */ - -inline __vector __bool int -vec_vcmpgtsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpgtuw */ - -inline __vector __bool int -vec_vcmpgtuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpgtsh */ - -inline __vector __bool short -vec_vcmpgtsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpgtuh */ - -inline __vector __bool short -vec_vcmpgtuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpgtsb */ - -inline __vector __bool char -vec_vcmpgtsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vcmpgtub */ - -inline __vector __bool char -vec_vcmpgtub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_cmple */ - -inline __vector __bool int -vec_cmple (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) a2, (__vector float) a1); -} - -/* vec_cmplt */ - -inline __vector __bool char -vec_cmplt (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a2, (__vector signed char) a1); -} - -inline __vector __bool char -vec_cmplt (__vector signed char a1, __vector signed char a2) -{ - return (__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a2, (__vector signed char) a1); -} - -inline __vector __bool short -vec_cmplt (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a2, (__vector signed short) a1); -} - -inline __vector __bool short -vec_cmplt (__vector signed short a1, __vector signed short a2) -{ - return (__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a2, (__vector signed short) a1); -} - -inline __vector __bool int -vec_cmplt (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a2, (__vector signed int) a1); -} - -inline __vector __bool int -vec_cmplt (__vector signed int a1, __vector signed int a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a2, (__vector signed int) a1); -} - -inline __vector __bool int -vec_cmplt (__vector float a1, __vector float a2) -{ - return (__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) a2, (__vector float) a1); -} - -/* vec_ctf */ - -inline __vector float -vec_ctf (__vector unsigned int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfux ((__vector signed int) a1, a2); -} - -inline __vector float -vec_ctf (__vector signed int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfsx ((__vector signed int) a1, a2); -} - -/* vec_vcfsx */ - -inline __vector float -vec_vcfsx (__vector signed int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfsx ((__vector signed int) a1, a2); -} - -/* vec_vcfux */ - -inline __vector float -vec_vcfux (__vector unsigned int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfux ((__vector signed int) a1, a2); -} - -/* vec_cts */ - -inline __vector signed int -vec_cts (__vector float a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vctsxs ((__vector float) a1, a2); -} - -/* vec_ctu */ - -inline __vector unsigned int -vec_ctu (__vector float a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vctuxs ((__vector float) a1, a2); -} - -/* vec_dss */ - -inline void -vec_dss (const int a1) -{ - __builtin_altivec_dss (a1); -} - -/* vec_dssall */ - -inline void -vec_dssall (void) -{ - __builtin_altivec_dssall (); -} - -/* vec_dst */ - -inline void -vec_dst (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector __bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector __bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector __pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector __bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -/* vec_dstst */ - -inline void -vec_dstst (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector __bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector __bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector __pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector __bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -/* vec_dststt */ - -inline void -vec_dststt (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector __bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector __bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector __pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector __bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -/* vec_dstt */ - -inline void -vec_dstt (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector __bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector __bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector __pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector __bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -/* vec_expte */ - -inline __vector float -vec_expte (__vector float a1) -{ - return (__vector float) __builtin_altivec_vexptefp ((__vector float) a1); -} - -/* vec_floor */ - -inline __vector float -vec_floor (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfim ((__vector float) a1); -} - -/* vec_ld */ - -inline __vector float -vec_ld (int a1, const __vector float *a2) -{ - return (__vector float) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector float -vec_ld (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector __bool int -vec_ld (int a1, const __vector __bool int *a2) -{ - return (__vector __bool int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const __vector signed int *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const __vector unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector __bool short -vec_ld (int a1, const __vector __bool short *a2) -{ - return (__vector __bool short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector __pixel -vec_ld (int a1, const __vector __pixel *a2) -{ - return (__vector __pixel) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed short -vec_ld (int a1, const __vector signed short *a2) -{ - return (__vector signed short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed short -vec_ld (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ld (int a1, const __vector unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ld (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector __bool char -vec_ld (int a1, const __vector __bool char *a2) -{ - return (__vector __bool char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed char -vec_ld (int a1, const __vector signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed char -vec_ld (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ld (int a1, const __vector unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ld (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); -} - -/* vec_lde */ - -inline __vector signed char -vec_lde (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lde (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector signed short -vec_lde (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_lde (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector float -vec_lde (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lde (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lde (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lde (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lde (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -/* vec_lvewx */ - -inline __vector float -vec_lvewx (int a1, float *a2) -{ - return (__vector float) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lvewx (int a1, int *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lvewx (int a1, unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lvewx (int a1, long *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lvewx (int a1, unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -/* vec_lvehx */ - -inline __vector signed short -vec_lvehx (int a1, short *a2) -{ - return (__vector signed short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_lvehx (int a1, unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -/* vec_lvebx */ - -inline __vector signed char -vec_lvebx (int a1, signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvebx (int a1, unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -/* vec_ldl */ - -inline __vector float -vec_ldl (int a1, const __vector float *a2) -{ - return (__vector float) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector float -vec_ldl (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector __bool int -vec_ldl (int a1, const __vector __bool int *a2) -{ - return (__vector __bool int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const __vector signed int *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const __vector unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector __bool short -vec_ldl (int a1, const __vector __bool short *a2) -{ - return (__vector __bool short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector __pixel -vec_ldl (int a1, const __vector __pixel *a2) -{ - return (__vector __pixel) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed short -vec_ldl (int a1, const __vector signed short *a2) -{ - return (__vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed short -vec_ldl (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ldl (int a1, const __vector unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ldl (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector __bool char -vec_ldl (int a1, const __vector __bool char *a2) -{ - return (__vector __bool char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed char -vec_ldl (int a1, const __vector signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed char -vec_ldl (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ldl (int a1, const __vector unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ldl (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -/* vec_loge */ - -inline __vector float -vec_loge (__vector float a1) -{ - return (__vector float) __builtin_altivec_vlogefp ((__vector float) a1); -} - -/* vec_lvsl */ - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile signed char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile float *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -/* vec_lvsr */ - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile signed char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile float *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -/* vec_madd */ - -inline __vector float -vec_madd (__vector float a1, __vector float a2, __vector float a3) -{ - return (__vector float) __builtin_altivec_vmaddfp ((__vector float) a1, (__vector float) a2, (__vector float) a3); -} - -/* vec_madds */ - -inline __vector signed short -vec_madds (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmhaddshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_max */ - -inline __vector unsigned char -vec_max (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_max (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_max (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_max (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_max (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_max (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_max (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_max (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_max (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_max (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmaxfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vmaxfp */ - -inline __vector float -vec_vmaxfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmaxfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vmaxsw */ - -inline __vector signed int -vec_vmaxsw (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmaxsw (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmaxsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmaxuw */ - -inline __vector unsigned int -vec_vmaxuw (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmaxuw (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmaxuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmaxsh */ - -inline __vector signed short -vec_vmaxsh (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmaxsh (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmaxsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmaxuh */ - -inline __vector unsigned short -vec_vmaxuh (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmaxuh (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmaxuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmaxsb */ - -inline __vector signed char -vec_vmaxsb (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmaxsb (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmaxsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmaxub */ - -inline __vector unsigned char -vec_vmaxub (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmaxub (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmaxub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mergeh */ - -inline __vector __bool char -vec_mergeh (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_mergeh (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_mergeh (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool short -vec_mergeh (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __pixel -vec_mergeh (__vector __pixel a1, __vector __pixel a2) -{ - return (__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_mergeh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_mergeh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector float -vec_mergeh (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_mergeh (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_mergeh (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_mergeh (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrghw */ - -inline __vector float -vec_vmrghw (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_vmrghw (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmrghw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmrghw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrghh */ - -inline __vector __bool short -vec_vmrghh (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmrghh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmrghh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __pixel -vec_vmrghh (__vector __pixel a1, __vector __pixel a2) -{ - return (__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmrghb */ - -inline __vector __bool char -vec_vmrghb (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmrghb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmrghb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mergel */ - -inline __vector __bool char -vec_mergel (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_mergel (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_mergel (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector __bool short -vec_mergel (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __pixel -vec_mergel (__vector __pixel a1, __vector __pixel a2) -{ - return (__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_mergel (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_mergel (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector float -vec_mergel (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_mergel (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_mergel (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_mergel (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrglw */ - -inline __vector float -vec_vmrglw (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmrglw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmrglw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_vmrglw (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrglh */ - -inline __vector __bool short -vec_vmrglh (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmrglh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmrglh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __pixel -vec_vmrglh (__vector __pixel a1, __vector __pixel a2) -{ - return (__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmrglb */ - -inline __vector __bool char -vec_vmrglb (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmrglb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmrglb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mfvscr */ - -inline __vector unsigned short -vec_mfvscr (void) -{ - return (__vector unsigned short) __builtin_altivec_mfvscr (); -} - -/* vec_min */ - -inline __vector unsigned char -vec_min (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_min (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_min (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_min (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_min (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_min (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_min (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_min (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_min (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_min (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vminfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vminfp */ - -inline __vector float -vec_vminfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vminfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vminsw */ - -inline __vector signed int -vec_vminsw (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vminsw (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vminsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vminuw */ - -inline __vector unsigned int -vec_vminuw (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vminuw (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vminuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vminsh */ - -inline __vector signed short -vec_vminsh (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vminsh (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vminsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vminuh */ - -inline __vector unsigned short -vec_vminuh (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vminuh (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vminuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vminsb */ - -inline __vector signed char -vec_vminsb (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vminsb (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vminsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vminub */ - -inline __vector unsigned char -vec_vminub (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vminub (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vminub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mladd */ - -inline __vector signed short -vec_mladd (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector signed short -vec_mladd (__vector signed short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector signed short -vec_mladd (__vector unsigned short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector unsigned short -vec_mladd (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector unsigned short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_mradds */ - -inline __vector signed short -vec_mradds (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmhraddshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_msum */ - -inline __vector unsigned int -vec_msum (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msum (__vector signed char a1, __vector unsigned char a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_msum (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msum (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumshm */ - -inline __vector signed int -vec_vmsumshm (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumuhm */ - -inline __vector unsigned int -vec_vmsumuhm (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsummbm */ - -inline __vector signed int -vec_vmsummbm (__vector signed char a1, __vector unsigned char a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -/* vec_vmsumubm */ - -inline __vector unsigned int -vec_vmsumubm (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -/* vec_msums */ - -inline __vector unsigned int -vec_msums (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msums (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumshs */ - -inline __vector signed int -vec_vmsumshs (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumuhs */ - -inline __vector unsigned int -vec_vmsumuhs (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_mtvscr */ - -inline void -vec_mtvscr (__vector signed int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector __bool int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector signed short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector __bool short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector __pixel a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector signed char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector __bool char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -/* vec_mule */ - -inline __vector unsigned short -vec_mule (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_mule (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned int -vec_mule (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_mule (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulesh */ - -inline __vector signed int -vec_vmulesh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmuleuh */ - -inline __vector unsigned int -vec_vmuleuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulesb */ - -inline __vector signed short -vec_vmulesb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmuleub */ - -inline __vector unsigned short -vec_vmuleub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mulo */ - -inline __vector unsigned short -vec_mulo (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_mulo (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned int -vec_mulo (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_mulo (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulosh */ - -inline __vector signed int -vec_vmulosh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulouh */ - -inline __vector unsigned int -vec_vmulouh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulosb */ - -inline __vector signed short -vec_vmulosb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmuloub */ - -inline __vector unsigned short -vec_vmuloub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_nmsub */ - -inline __vector float -vec_nmsub (__vector float a1, __vector float a2, __vector float a3) -{ - return (__vector float) __builtin_altivec_vnmsubfp ((__vector float) a1, (__vector float) a2, (__vector float) a3); -} - -/* vec_nor */ - -inline __vector float -vec_nor (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_nor (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_nor (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_nor (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_nor (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_nor (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_nor (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_nor (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_nor (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_nor (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_or */ - -inline __vector float -vec_or (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_or (__vector float a1, __vector __bool int a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_or (__vector __bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_or (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_or (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_or (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_pack */ - -inline __vector signed char -vec_pack (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_pack (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector __bool char -vec_pack (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_pack (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_pack (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_pack (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuwum */ - -inline __vector __bool short -vec_vpkuwum (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_vpkuwum (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_vpkuwum (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuhum */ - -inline __vector __bool char -vec_vpkuhum (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed char -vec_vpkuhum (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_vpkuhum (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_packpx */ - -inline __vector __pixel -vec_packpx (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector __pixel) __builtin_altivec_vpkpx ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_packs */ - -inline __vector unsigned char -vec_packs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed char -vec_packs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_packs (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_packs (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkswss */ - -inline __vector signed short -vec_vpkswss (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuwus */ - -inline __vector unsigned short -vec_vpkuwus (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkshss */ - -inline __vector signed char -vec_vpkshss (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vpkuhus */ - -inline __vector unsigned char -vec_vpkuhus (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_packsu */ - -inline __vector unsigned char -vec_packsu (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_packsu (__vector signed short a1, __vector signed short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_packsu (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_packsu (__vector signed int a1, __vector signed int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkswus */ - -inline __vector unsigned short -vec_vpkswus (__vector signed int a1, __vector signed int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkshus */ - -inline __vector unsigned char -vec_vpkshus (__vector signed short a1, __vector signed short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_perm */ - -inline __vector float -vec_perm (__vector float a1, __vector float a2, __vector unsigned char a3) -{ - return (__vector float) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed int -vec_perm (__vector signed int a1, __vector signed int a2, __vector unsigned char a3) -{ - return (__vector signed int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned int -vec_perm (__vector unsigned int a1, __vector unsigned int a2, __vector unsigned char a3) -{ - return (__vector unsigned int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector __bool int -vec_perm (__vector __bool int a1, __vector __bool int a2, __vector unsigned char a3) -{ - return (__vector __bool int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed short -vec_perm (__vector signed short a1, __vector signed short a2, __vector unsigned char a3) -{ - return (__vector signed short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned short -vec_perm (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned char a3) -{ - return (__vector unsigned short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector __bool short -vec_perm (__vector __bool short a1, __vector __bool short a2, __vector unsigned char a3) -{ - return (__vector __bool short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector __pixel -vec_perm (__vector __pixel a1, __vector __pixel a2, __vector unsigned char a3) -{ - return (__vector __pixel) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed char -vec_perm (__vector signed char a1, __vector signed char a2, __vector unsigned char a3) -{ - return (__vector signed char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned char -vec_perm (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned char a3) -{ - return (__vector unsigned char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector __bool char -vec_perm (__vector __bool char a1, __vector __bool char a2, __vector unsigned char a3) -{ - return (__vector __bool char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -/* vec_re */ - -inline __vector float -vec_re (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrefp ((__vector float) a1); -} - -/* vec_rl */ - -inline __vector signed char -vec_rl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_rl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_rl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_rl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_rl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_rl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vrlw */ - -inline __vector signed int -vec_vrlw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vrlw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vrlh */ - -inline __vector signed short -vec_vrlh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vrlh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vrlb */ - -inline __vector signed char -vec_vrlb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vrlb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_round */ - -inline __vector float -vec_round (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfin ((__vector float) a1); -} - -/* vec_rsqrte */ - -inline __vector float -vec_rsqrte (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrsqrtefp ((__vector float) a1); -} - -/* vec_sel */ - -inline __vector float -vec_sel (__vector float a1, __vector float a2, __vector __bool int a3) -{ - return (__vector float) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector float -vec_sel (__vector float a1, __vector float a2, __vector unsigned int a3) -{ - return (__vector float) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_sel (__vector signed int a1, __vector signed int a2, __vector __bool int a3) -{ - return (__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_sel (__vector signed int a1, __vector signed int a2, __vector unsigned int a3) -{ - return (__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_sel (__vector unsigned int a1, __vector unsigned int a2, __vector __bool int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_sel (__vector unsigned int a1, __vector unsigned int a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool int -vec_sel (__vector __bool int a1, __vector __bool int a2, __vector __bool int a3) -{ - return (__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool int -vec_sel (__vector __bool int a1, __vector __bool int a2, __vector unsigned int a3) -{ - return (__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed short -vec_sel (__vector signed short a1, __vector signed short a2, __vector __bool short a3) -{ - return (__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed short -vec_sel (__vector signed short a1, __vector signed short a2, __vector unsigned short a3) -{ - return (__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned short -vec_sel (__vector unsigned short a1, __vector unsigned short a2, __vector __bool short a3) -{ - return (__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned short -vec_sel (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool short -vec_sel (__vector __bool short a1, __vector __bool short a2, __vector __bool short a3) -{ - return (__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool short -vec_sel (__vector __bool short a1, __vector __bool short a2, __vector unsigned short a3) -{ - return (__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed char -vec_sel (__vector signed char a1, __vector signed char a2, __vector __bool char a3) -{ - return (__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed char -vec_sel (__vector signed char a1, __vector signed char a2, __vector unsigned char a3) -{ - return (__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned char -vec_sel (__vector unsigned char a1, __vector unsigned char a2, __vector __bool char a3) -{ - return (__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned char -vec_sel (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned char a3) -{ - return (__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool char -vec_sel (__vector __bool char a1, __vector __bool char a2, __vector __bool char a3) -{ - return (__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector __bool char -vec_sel (__vector __bool char a1, __vector __bool char a2, __vector unsigned char a3) -{ - return (__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -/* vec_sl */ - -inline __vector signed char -vec_sl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vslw */ - -inline __vector signed int -vec_vslw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vslw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vslh */ - -inline __vector signed short -vec_vslh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vslh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vslb */ - -inline __vector signed char -vec_vslb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vslb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sld */ - -inline __vector float -vec_sld (__vector float a1, __vector float a2, const int a3) -{ - return (__vector float) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed int -vec_sld (__vector signed int a1, __vector signed int a2, const int a3) -{ - return (__vector signed int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned int -vec_sld (__vector unsigned int a1, __vector unsigned int a2, const int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector __bool int -vec_sld (__vector __bool int a1, __vector __bool int a2, const int a3) -{ - return (__vector __bool int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed short -vec_sld (__vector signed short a1, __vector signed short a2, const int a3) -{ - return (__vector signed short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned short -vec_sld (__vector unsigned short a1, __vector unsigned short a2, const int a3) -{ - return (__vector unsigned short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector __bool short -vec_sld (__vector __bool short a1, __vector __bool short a2, const int a3) -{ - return (__vector __bool short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector __pixel -vec_sld (__vector __pixel a1, __vector __pixel a2, const int a3) -{ - return (__vector __pixel) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed char -vec_sld (__vector signed char a1, __vector signed char a2, const int a3) -{ - return (__vector signed char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned char -vec_sld (__vector unsigned char a1, __vector unsigned char a2, const int a3) -{ - return (__vector unsigned char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector __bool char -vec_sld (__vector __bool char a1, __vector __bool char a2, const int a3) -{ - return (__vector __bool char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -/* vec_sll */ - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned short a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_sll (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_sll (__vector __bool int a1, __vector unsigned short a2) -{ - return (__vector __bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_sll (__vector __bool int a1, __vector unsigned char a2) -{ - return (__vector __bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned int a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_sll (__vector __bool short a1, __vector unsigned int a2) -{ - return (__vector __bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_sll (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_sll (__vector __bool short a1, __vector unsigned char a2) -{ - return (__vector __bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_sll (__vector __pixel a1, __vector unsigned int a2) -{ - return (__vector __pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_sll (__vector __pixel a1, __vector unsigned short a2) -{ - return (__vector __pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_sll (__vector __pixel a1, __vector unsigned char a2) -{ - return (__vector __pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned int a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned short a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_sll (__vector __bool char a1, __vector unsigned int a2) -{ - return (__vector __bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_sll (__vector __bool char a1, __vector unsigned short a2) -{ - return (__vector __bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_sll (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_slo */ - -inline __vector float -vec_slo (__vector float a1, __vector signed char a2) -{ - return (__vector float) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_slo (__vector float a1, __vector unsigned char a2) -{ - return (__vector float) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_slo (__vector signed int a1, __vector signed char a2) -{ - return (__vector signed int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_slo (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_slo (__vector unsigned int a1, __vector signed char a2) -{ - return (__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_slo (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_slo (__vector signed short a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_slo (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_slo (__vector unsigned short a1, __vector signed char a2) -{ - return (__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_slo (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_slo (__vector __pixel a1, __vector signed char a2) -{ - return (__vector __pixel) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_slo (__vector __pixel a1, __vector unsigned char a2) -{ - return (__vector __pixel) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_slo (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_slo (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_slo (__vector unsigned char a1, __vector signed char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_slo (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_splat */ - -inline __vector signed char -vec_splat (__vector signed char a1, const int a2) -{ - return (__vector signed char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector unsigned char -vec_splat (__vector unsigned char a1, const int a2) -{ - return (__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector __bool char -vec_splat (__vector __bool char a1, const int a2) -{ - return (__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector signed short -vec_splat (__vector signed short a1, const int a2) -{ - return (__vector signed short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector unsigned short -vec_splat (__vector unsigned short a1, const int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector __bool short -vec_splat (__vector __bool short a1, const int a2) -{ - return (__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector __pixel -vec_splat (__vector __pixel a1, const int a2) -{ - return (__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector float -vec_splat (__vector float a1, const int a2) -{ - return (__vector float) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector signed int -vec_splat (__vector signed int a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector unsigned int -vec_splat (__vector unsigned int a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector __bool int -vec_splat (__vector __bool int a1, const int a2) -{ - return (__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -/* vec_vspltw */ - -inline __vector float -vec_vspltw (__vector float a1, const int a2) -{ - return (__vector float) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector signed int -vec_vspltw (__vector signed int a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector unsigned int -vec_vspltw (__vector unsigned int a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector __bool int -vec_vspltw (__vector __bool int a1, const int a2) -{ - return (__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -/* vec_vsplth */ - -inline __vector __bool short -vec_vsplth (__vector __bool short a1, const int a2) -{ - return (__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector signed short -vec_vsplth (__vector signed short a1, const int a2) -{ - return (__vector signed short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector unsigned short -vec_vsplth (__vector unsigned short a1, const int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector __pixel -vec_vsplth (__vector __pixel a1, const int a2) -{ - return (__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -/* vec_vspltb */ - -inline __vector signed char -vec_vspltb (__vector signed char a1, const int a2) -{ - return (__vector signed char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector unsigned char -vec_vspltb (__vector unsigned char a1, const int a2) -{ - return (__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector __bool char -vec_vspltb (__vector __bool char a1, const int a2) -{ - return (__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -/* vec_splat_s8 */ - -inline __vector signed char -vec_splat_s8 (const int a1) -{ - return (__vector signed char) __builtin_altivec_vspltisb (a1); -} - -/* vec_splat_s16 */ - -inline __vector signed short -vec_splat_s16 (const int a1) -{ - return (__vector signed short) __builtin_altivec_vspltish (a1); -} - -/* vec_splat_s32 */ - -inline __vector signed int -vec_splat_s32 (const int a1) -{ - return (__vector signed int) __builtin_altivec_vspltisw (a1); -} - -/* vec_splat_u8 */ - -inline __vector unsigned char -vec_splat_u8 (const int a1) -{ - return (__vector unsigned char) __builtin_altivec_vspltisb (a1); -} - -/* vec_splat_u16 */ - -inline __vector unsigned short -vec_splat_u16 (const int a1) -{ - return (__vector unsigned short) __builtin_altivec_vspltish (a1); -} - -/* vec_splat_u32 */ - -inline __vector unsigned int -vec_splat_u32 (const int a1) -{ - return (__vector unsigned int) __builtin_altivec_vspltisw (a1); -} - -/* vec_sr */ - -inline __vector signed char -vec_sr (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sr (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sr (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sr (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sr (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sr (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrw */ - -inline __vector signed int -vec_vsrw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsrw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrh */ - -inline __vector signed short -vec_vsrh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsrh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsrb */ - -inline __vector signed char -vec_vsrb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsrb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sra */ - -inline __vector signed char -vec_sra (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sra (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sra (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sra (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sra (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sra (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsraw */ - -inline __vector signed int -vec_vsraw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsraw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrah */ - -inline __vector signed short -vec_vsrah (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsrah (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsrab */ - -inline __vector signed char -vec_vsrab (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsrab (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_srl */ - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned short a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_srl (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector __bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_srl (__vector __bool int a1, __vector unsigned short a2) -{ - return (__vector __bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_srl (__vector __bool int a1, __vector unsigned char a2) -{ - return (__vector __bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned int a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_srl (__vector __bool short a1, __vector unsigned int a2) -{ - return (__vector __bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_srl (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector __bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_srl (__vector __bool short a1, __vector unsigned char a2) -{ - return (__vector __bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_srl (__vector __pixel a1, __vector unsigned int a2) -{ - return (__vector __pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_srl (__vector __pixel a1, __vector unsigned short a2) -{ - return (__vector __pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_srl (__vector __pixel a1, __vector unsigned char a2) -{ - return (__vector __pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned int a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned short a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_srl (__vector __bool char a1, __vector unsigned int a2) -{ - return (__vector __bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_srl (__vector __bool char a1, __vector unsigned short a2) -{ - return (__vector __bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_srl (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector __bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_sro */ - -inline __vector float -vec_sro (__vector float a1, __vector signed char a2) -{ - return (__vector float) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_sro (__vector float a1, __vector unsigned char a2) -{ - return (__vector float) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sro (__vector signed int a1, __vector signed char a2) -{ - return (__vector signed int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sro (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sro (__vector unsigned int a1, __vector signed char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sro (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sro (__vector signed short a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sro (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sro (__vector unsigned short a1, __vector signed char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sro (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_sro (__vector __pixel a1, __vector signed char a2) -{ - return (__vector __pixel) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __pixel -vec_sro (__vector __pixel a1, __vector unsigned char a2) -{ - return (__vector __pixel) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sro (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sro (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sro (__vector unsigned char a1, __vector signed char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sro (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_st */ - -inline void -vec_st (__vector float a1, int a2, __vector float *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed int a1, int a2, __vector signed int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned int a1, int a2, __vector unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool int a1, int a2, __vector __bool int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed short a1, int a2, __vector signed short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned short a1, int a2, __vector unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool short a1, int a2, __vector __bool short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __pixel a1, int a2, __vector __pixel *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed char a1, int a2, __vector signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned char a1, int a2, __vector unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool char a1, int a2, __vector __bool char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector __bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_ste */ - -inline void -vec_ste (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector __bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_stvewx */ - -inline void -vec_stvewx (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector __bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector __bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_stvehx */ - -inline void -vec_stvehx (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector __bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector __bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector __pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector __pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -/* vec_stvebx */ - -inline void -vec_stvebx (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector __bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector __bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -/* vec_stl */ - -inline void -vec_stl (__vector float a1, int a2, __vector float *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed int a1, int a2, __vector signed int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned int a1, int a2, __vector unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool int a1, int a2, __vector __bool int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed short a1, int a2, __vector signed short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned short a1, int a2, __vector unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool short a1, int a2, __vector __bool short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __pixel a1, int a2, __vector __pixel *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed char a1, int a2, __vector signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned char a1, int a2, __vector unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool char a1, int a2, __vector __bool char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector __bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_sub */ - -inline __vector signed char -vec_sub (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_sub (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_sub (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sub (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_sub (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_sub (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sub (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sub (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sub (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_sub (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vsubfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vsubfp */ - -inline __vector float -vec_vsubfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vsubfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vsubuwm */ - -inline __vector signed int -vec_vsubuwm (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubuwm (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubuwm (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubuhm */ - -inline __vector signed short -vec_vsubuhm (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubuhm (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubuhm (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsububm */ - -inline __vector signed char -vec_vsububm (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsububm (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsububm (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_subc */ - -inline __vector unsigned int -vec_subc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubcuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_subs */ - -inline __vector unsigned char -vec_subs (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_subs (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_subs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_subs (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_subs (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_subs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_subs (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_subs (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_subs (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubsws */ - -inline __vector signed int -vec_vsubsws (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubsws (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubsws (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubuws */ - -inline __vector unsigned int -vec_vsubuws (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuws (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuws (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubshs */ - -inline __vector signed short -vec_vsubshs (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubshs (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubshs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsubuhs */ - -inline __vector unsigned short -vec_vsubuhs (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhs (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsubsbs */ - -inline __vector signed char -vec_vsubsbs (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsubsbs (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsubsbs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vsububs */ - -inline __vector unsigned char -vec_vsububs (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububs (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sum4s */ - -inline __vector unsigned int -vec_sum4s (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sum4s (__vector signed char a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sum4s (__vector signed short a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) a1, (__vector signed int) a2); -} - -/* vec_vsum4shs */ - -inline __vector signed int -vec_vsum4shs (__vector signed short a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) a1, (__vector signed int) a2); -} - -/* vec_vsum4sbs */ - -inline __vector signed int -vec_vsum4sbs (__vector signed char a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) a1, (__vector signed int) a2); -} - -/* vec_vsum4ubs */ - -inline __vector unsigned int -vec_vsum4ubs (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) a1, (__vector signed int) a2); -} - -/* vec_sum2s */ - -inline __vector signed int -vec_sum2s (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum2sws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_sums */ - -inline __vector signed int -vec_sums (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsumsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_trunc */ - -inline __vector float -vec_trunc (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfiz ((__vector float) a1); -} - -/* vec_unpackh */ - -inline __vector signed short -vec_unpackh (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector __bool short -vec_unpackh (__vector __bool char a1) -{ - return (__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector signed int -vec_unpackh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector __bool int -vec_unpackh (__vector __bool short a1) -{ - return (__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector unsigned int -vec_unpackh (__vector __pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) a1); -} - -/* vec_vupkhsh */ - -inline __vector __bool int -vec_vupkhsh (__vector __bool short a1) -{ - return (__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector signed int -vec_vupkhsh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -/* vec_vupkhpx */ - -inline __vector unsigned int -vec_vupkhpx (__vector __pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) a1); -} - -/* vec_vupkhsb */ - -inline __vector __bool short -vec_vupkhsb (__vector __bool char a1) -{ - return (__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector signed short -vec_vupkhsb (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -/* vec_unpackl */ - -inline __vector signed short -vec_unpackl (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector __bool short -vec_unpackl (__vector __bool char a1) -{ - return (__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector unsigned int -vec_unpackl (__vector __pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) a1); -} - -inline __vector signed int -vec_unpackl (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -inline __vector __bool int -vec_unpackl (__vector __bool short a1) -{ - return (__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -/* vec_vupklpx */ - -inline __vector unsigned int -vec_vupklpx (__vector __pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) a1); -} - -/* vec_upklsh */ - -inline __vector __bool int -vec_vupklsh (__vector __bool short a1) -{ - return (__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -inline __vector signed int -vec_vupklsh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -/* vec_vupklsb */ - -inline __vector __bool short -vec_vupklsb (__vector __bool char a1) -{ - return (__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector signed short -vec_vupklsb (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -/* vec_xor */ - -inline __vector float -vec_xor (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_xor (__vector float a1, __vector __bool int a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_xor (__vector __bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool int -vec_xor (__vector __bool int a1, __vector __bool int a2) -{ - return (__vector __bool int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector __bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector signed int a1, __vector __bool int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector __bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector unsigned int a1, __vector __bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool short -vec_xor (__vector __bool short a1, __vector __bool short a2) -{ - return (__vector __bool short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector __bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector signed short a1, __vector __bool short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector __bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector unsigned short a1, __vector __bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector __bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector __bool char -vec_xor (__vector __bool char a1, __vector __bool char a2) -{ - return (__vector __bool char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector signed char a1, __vector __bool char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector __bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector unsigned char a1, __vector __bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_all_eq */ - -inline int -vec_all_eq (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, a2); -} - -inline int -vec_all_eq (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector __bool char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector __bool short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector __pixel a1, __vector __pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector __bool int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a2); -} - -/* vec_all_ge */ - -inline int -vec_all_ge (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT, a1, a2); -} - -/* vec_all_gt */ - -inline int -vec_all_gt (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a1, a2); -} - -/* vec_all_in */ - -inline int -vec_all_in (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_le */ - -inline int -vec_all_le (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT, a2, a1); -} - -/* vec_all_lt */ - -inline int -vec_all_lt (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a2, a1); -} - -/* vec_all_nan */ - -inline int -vec_all_nan (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1); -} - -/* vec_all_ne */ - -inline int -vec_all_ne (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector __bool char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector __bool short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector __pixel a1, __vector __pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector __bool int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_nge */ - -inline int -vec_all_nge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_ngt */ - -inline int -vec_all_ngt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_nle */ - -inline int -vec_all_nle (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1); -} - -/* vec_all_nlt */ - -inline int -vec_all_nlt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1); -} - -/* vec_all_numeric */ - -inline int -vec_all_numeric (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1); -} - -/* vec_any_eq */ - -inline int -vec_any_eq (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector __bool char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector __bool short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector __pixel a1, __vector __pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector __bool int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_ge */ - -inline int -vec_any_ge (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_gt */ - -inline int -vec_any_gt (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_le */ - -inline int -vec_any_le (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a2, a1); -} - -/* vec_any_lt */ - -inline int -vec_any_lt (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a2, a1); -} - -/* vec_any_nan */ - -inline int -vec_any_nan (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1); -} - -/* vec_any_ne */ - -inline int -vec_any_ne (__vector signed char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector unsigned char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector __bool char a1, __vector __bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector __bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector __bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector signed short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector unsigned short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector __bool short a1, __vector __bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector __bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector __bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector __pixel a1, __vector __pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector signed int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector unsigned int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector __bool int a1, __vector __bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector __bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector __bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_nge */ - -inline int -vec_any_nge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_ngt */ - -inline int -vec_any_ngt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_nle */ - -inline int -vec_any_nle (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1); -} - -/* vec_any_nlt */ - -inline int -vec_any_nlt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1); -} - -/* vec_any_numeric */ - -inline int -vec_any_numeric (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1); -} - -/* vec_any_out */ - -inline int -vec_any_out (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2); -} - -} /* extern "C++" */ - -#else /* not C++ */ - -/* "... and so I think no man in a century will suffer as greatly as - you will." */ - -/* Helper macros. */ - -#define __un_args_eq(xtype, x) \ - __builtin_types_compatible_p (xtype, typeof (x)) - -#define __bin_args_eq(xtype, x, ytype, y) \ - (__builtin_types_compatible_p (xtype, typeof (x)) \ - && __builtin_types_compatible_p (ytype, typeof (y))) - -#define __tern_args_eq(xtype, x, ytype, y, ztype, z) \ - (__builtin_types_compatible_p (xtype, typeof (x)) \ - && __builtin_types_compatible_p (ytype, typeof (y)) \ - && __builtin_types_compatible_p (ztype, typeof (z))) - -#define __ch(x, y, z) __builtin_choose_expr (x, y, z) - -#define vec_step(t) \ - __ch (__builtin_types_compatible_p (typeof (t), __vector signed int), 4, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector unsigned int), 4, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector __bool int), 4, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector signed short), 8, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector unsigned short), 8, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector __bool short), 8, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector __pixel), 8, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector signed char), 16, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector unsigned char), 16, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector __bool char), 16, \ - __ch (__builtin_types_compatible_p (typeof (t), __vector float), 4, \ - __builtin_altivec_compiletime_error ("vec_step")))))))))))) - -#define vec_abs(a) \ - __ch (__un_args_eq (__vector signed char, (a)), \ - ((__vector signed char) __builtin_altivec_abs_v16qi ((__vector signed char) (a))), \ - __ch (__un_args_eq (__vector signed short, (a)), \ - ((__vector signed short) __builtin_altivec_abs_v8hi ((__vector signed short) (a))), \ - __ch (__un_args_eq (__vector signed int, (a)), \ - ((__vector signed int) __builtin_altivec_abs_v4si ((__vector signed int) (a))), \ - __ch (__un_args_eq (__vector float, (a)), \ - ((__vector float) __builtin_altivec_abs_v4sf ((__vector float) (a))), \ - __builtin_altivec_compiletime_error ("vec_abs"))))) - -#define vec_abss(a) \ - __ch (__un_args_eq (__vector signed char, (a)), \ - ((__vector signed char) __builtin_altivec_abss_v16qi ((__vector signed char) (a))), \ - __ch (__un_args_eq (__vector signed short, (a)), \ - ((__vector signed short) __builtin_altivec_abss_v8hi ((__vector signed short) (a))), \ - __ch (__un_args_eq (__vector signed int, (a)), \ - ((__vector signed int) __builtin_altivec_abss_v4si ((__vector signed int) (a))), \ - __builtin_altivec_compiletime_error ("vec_abss")))) - -#define vec_vaddubm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddubm"))))))) - -#define vec_vadduhm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduhm"))))))) - -#define vec_vadduwm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduwm"))))))) - -#define vec_vaddfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vaddfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddfp")) - -#define vec_add(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vaddfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_add")))))))))))))))))))) - -#define vec_addc(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vaddcuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_addc")) - -#define vec_adds(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_adds"))))))))))))))))))) - -#define vec_vaddsws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddsws")))) - -#define vec_vadduws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduws")))) - -#define vec_vaddshs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddshs")))) - -#define vec_vadduhs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduhs")))) - -#define vec_vaddsbs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddsbs")))) - -#define vec_vaddubs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddubs")))) - -#define vec_and(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_and"))))))))))))))))))))))))) - -#define vec_andc(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_andc"))))))))))))))))))))))))) - -#define vec_avg(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_avg"))))))) - -#define vec_vavgsw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsw")) - -#define vec_vavguw(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavguw")) - -#define vec_vavgsh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsh")) - -#define vec_vavguh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavguh")) - -#define vec_vavgsb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsb")) - -#define vec_vavgub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgub")) - -#define vec_ceil(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfip ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_ceil")) - -#define vec_cmpb(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector signed int) __builtin_altivec_vcmpbfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpb")) - -#define vec_cmpeq(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpeq")))))))) - -#define vec_vcmpeqfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpeqfp")) - -#define vec_vcmpequw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequw"))) - -#define vec_vcmpequh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequh"))) - -#define vec_vcmpequb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequb"))) - -#define vec_cmpge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpge")) - -#define vec_cmpgt(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpgt")))))))) - -#define vec_vcmpgtfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtfp")) - -#define vec_vcmpgtsw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsw")) - -#define vec_vcmpgtuw(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtuw")) - -#define vec_vcmpgtsh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsh")) - -#define vec_vcmpgtuh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtuh")) - -#define vec_vcmpgtsb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsb")) - -#define vec_vcmpgtub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtub")) - -#define vec_cmple(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) (a2), (__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_cmple")) - -#define vec_cmplt(a2, a1) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmplt")))))))) - -#define vec_ctf(a1, a2) \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector float) __builtin_altivec_vcfux ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector float) __builtin_altivec_vcfsx ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_ctf"))) - -#define vec_vcfsx(a1, a2) \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector float) __builtin_altivec_vcfsx ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcfsx")) - -#define vec_vcfux(a1, a2) \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector float) __builtin_altivec_vcfux ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcfux")) - -#define vec_cts(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector signed int) __builtin_altivec_vctsxs ((__vector float) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cts")) - -#define vec_ctu(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vctuxs ((__vector float) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_ctu")) - -#define vec_dss(a1) __builtin_altivec_dss ((const int) (a1)); - +/* Be very liberal in the pairs we accept. Mistakes such as passing + a `vector char' and `vector short' will be caught by the middle-end, + while any attempt to detect them here would produce hard to understand + error messages involving the implementation details of AltiVec. */ +#define __altivec_binary_pred(NAME, CALL) \ +template \ +typename __altivec_bool_ret ::__ret \ +NAME (T a1, U a2) \ +{ \ + return CALL; \ +} + +__altivec_binary_pred(vec_cmplt, + __builtin_vec_cmpgt (a2, a1)) +__altivec_binary_pred(vec_cmple, + __builtin_altivec_cmpge (a2, a1)) + +__altivec_scalar_pred(vec_all_in, + __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_any_out, + __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2)) + +__altivec_unary_pred(vec_all_nan, + __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1)) +__altivec_unary_pred(vec_any_nan, + __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1)) + +__altivec_unary_pred(vec_all_numeric, + __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1)) +__altivec_unary_pred(vec_any_numeric, + __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1)) + +__altivec_scalar_pred(vec_all_eq, + __builtin_vec_vcmpeq_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_all_ne, + __builtin_vec_vcmpeq_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_any_eq, + __builtin_vec_vcmpeq_p (__CR6_EQ_REV, a1, a2)) +__altivec_scalar_pred(vec_any_ne, + __builtin_vec_vcmpeq_p (__CR6_LT_REV, a1, a2)) + +__altivec_scalar_pred(vec_all_gt, + __builtin_vec_vcmpgt_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_all_lt, + __builtin_vec_vcmpgt_p (__CR6_LT, a2, a1)) +__altivec_scalar_pred(vec_any_gt, + __builtin_vec_vcmpgt_p (__CR6_EQ_REV, a1, a2)) +__altivec_scalar_pred(vec_any_lt, + __builtin_vec_vcmpgt_p (__CR6_EQ_REV, a2, a1)) + +__altivec_scalar_pred(vec_all_ngt, + __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_all_nlt, + __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1)) +__altivec_scalar_pred(vec_any_ngt, + __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2)) +__altivec_scalar_pred(vec_any_nlt, + __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1)) + +/* __builtin_vec_vcmpge_p is vcmpgefp for floating-point vector types, + while for integer types it is converted to __builtin_vec_vcmpgt_p, + with inverted args and condition code. */ +__altivec_scalar_pred(vec_all_le, + __builtin_vec_vcmpge_p (__CR6_LT, a2, a1)) +__altivec_scalar_pred(vec_all_ge, + __builtin_vec_vcmpge_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_any_le, + __builtin_vec_vcmpge_p (__CR6_EQ_REV, a2, a1)) +__altivec_scalar_pred(vec_any_ge, + __builtin_vec_vcmpge_p (__CR6_EQ_REV, a1, a2)) + +__altivec_scalar_pred(vec_all_nge, + __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_all_nle, + __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1)) +__altivec_scalar_pred(vec_any_nge, + __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2)) +__altivec_scalar_pred(vec_any_nle, + __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1)) + +#undef __altivec_scalar_pred +#undef __altivec_unary_pred +#undef __altivec_binary_pred +#else +#define vec_cmplt(a1, a2) __builtin_vec_cmpgt ((a2), (a1)) +#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a2), (a1)) + +#define vec_all_in(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)) +#define vec_any_out(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)) + +#define vec_all_nan(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)) +#define vec_any_nan(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)) + +#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)) +#define vec_any_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)) + +#define vec_all_eq(a1, a2) __builtin_vec_vcmpeq_p (__CR6_LT, (a1), (a2)) +#define vec_all_ne(a1, a2) __builtin_vec_vcmpeq_p (__CR6_EQ, (a1), (a2)) +#define vec_any_eq(a1, a2) __builtin_vec_vcmpeq_p (__CR6_EQ_REV, (a1), (a2)) +#define vec_any_ne(a1, a2) __builtin_vec_vcmpeq_p (__CR6_LT_REV, (a1), (a2)) + +#define vec_all_gt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_LT, (a1), (a2)) +#define vec_all_lt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_LT, (a2), (a1)) +#define vec_any_gt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_EQ_REV, (a1), (a2)) +#define vec_any_lt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_EQ_REV, (a2), (a1)) + +#define vec_all_ngt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)) +#define vec_all_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)) +#define vec_any_ngt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)) +#define vec_any_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)) + +/* __builtin_vec_vcmpge_p is vcmpgefp for floating-point vector types, + while for integer types it is converted to __builtin_vec_vcmpgt_p, + with inverted args and condition code. */ +#define vec_all_le(a1, a2) __builtin_vec_vcmpge_p (__CR6_LT, (a2), (a1)) +#define vec_all_ge(a1, a2) __builtin_vec_vcmpge_p (__CR6_LT, (a1), (a2)) +#define vec_any_le(a1, a2) __builtin_vec_vcmpge_p (__CR6_EQ_REV, (a2), (a1)) +#define vec_any_ge(a1, a2) __builtin_vec_vcmpge_p (__CR6_EQ_REV, (a1), (a2)) + +#define vec_all_nge(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)) +#define vec_all_nle(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)) +#define vec_any_nge(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)) +#define vec_any_nle(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)) +#endif + +/* These do not accept vectors, so they do not have a __builtin_vec_* + counterpart. */ +#define vec_dss(x) __builtin_altivec_dss((x)) #define vec_dssall() __builtin_altivec_dssall () - -#define vec_dst(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dst"))))))))))))))))))))) - -#define vec_dstst(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dstst"))))))))))))))))))))) - -#define vec_dststt(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dststt"))))))))))))))))))))) - -#define vec_dstt(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dstt"))))))))))))))))))))) - -#define vec_expte(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vexptefp ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_expte")) - -#define vec_floor(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfim ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_floor")) - -#define vec_ld(a, b) \ -__ch (__un_args_eq (const __vector unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool char, *(b)), \ - ((__vector __bool char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool short, *(b)), \ - ((__vector __bool short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __pixel, *(b)), \ - ((__vector __pixel) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool int, *(b)), \ - ((__vector __bool int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector float, *(b)), \ - ((__vector float) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_ld"))))))))))))))))))))) - -#define vec_lde(a, b) \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvewx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lde")))))))))) - -#define vec_lvewx(a, b) \ -__ch (__un_args_eq (unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (float, *(b)), \ - ((__vector float) __builtin_altivec_lvewx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvewx")))))) - -#define vec_lvehx(a, b) \ -__ch (__un_args_eq (unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvehx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvehx"))) - -#define vec_lvebx(a, b) \ -__ch (__un_args_eq (unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvebx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvebx"))) - -#define vec_ldl(a, b) \ -__ch (__un_args_eq (const __vector unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool char, *(b)), \ - ((__vector __bool char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool short, *(b)), \ - ((__vector __bool short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __pixel, *(b)), \ - ((__vector __pixel) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool int, *(b)), \ - ((__vector __bool int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector float, *(b)), \ - ((__vector float) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvxl ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_ldl"))))))))))))))))))))) - -#define vec_loge(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vlogefp ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_loge")) - -#define vec_lvsl(a1, a2) \ -__ch (__un_args_eq (const volatile unsigned char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile float, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__builtin_altivec_compiletime_error ("vec_lvsl")))))))))) - -#define vec_lvsr(a1, a2) \ -__ch (__un_args_eq (const volatile unsigned char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile float, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__builtin_altivec_compiletime_error ("vec_lvsr")))))))))) - -#define vec_madd(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector float, (a3)), \ - ((__vector float) __builtin_altivec_vmaddfp ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_madd")) - -#define vec_madds(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmhaddshs ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_madds")) - -#define vec_max(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmaxfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_max")))))))))))))))))))) - -#define vec_vmaxfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmaxfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxfp")) - -#define vec_vmaxsw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsw")))) - -#define vec_vmaxuw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxuw")))) - -#define vec_vmaxsh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsh")))) - -#define vec_vmaxuh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxuh")))) - -#define vec_vmaxsb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsb")))) - -#define vec_vmaxub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxub")))) - -#define vec_mergeh(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mergeh")))))))))))) - -#define vec_vmrghw(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghw"))))) - -#define vec_vmrghh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghh"))))) - -#define vec_vmrghb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghb")))) - -#define vec_mergel(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mergel")))))))))))) - -#define vec_vmrglw(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglw"))))) - -#define vec_vmrglh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglh"))))) - -#define vec_vmrglb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglb")))) - -#define vec_mfvscr() (((__vector unsigned short) __builtin_altivec_mfvscr ())) - -#define vec_min(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vminfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_min")))))))))))))))))))) - -#define vec_vminfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vminfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminfp")) - -#define vec_vminsw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminsw")))) - -#define vec_vminuw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminuw")))) - -#define vec_vminsh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminsh")))) - -#define vec_vminuh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminuh")))) - -#define vec_vminsb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_minsb")))) - -#define vec_vminub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminub")))) - -#define vec_mladd(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ - __builtin_altivec_compiletime_error ("vec_mladd"))))) - -#define vec_mradds(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmhraddshs ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_mradds")) - -#define vec_msum(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector unsigned char, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_msum"))))) - -#define vec_vmsumshm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumshm")) - -#define vec_vmsumuhm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumuhm")) - -#define vec_vmsummbm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector unsigned char, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsummbm")) - -#define vec_vmsumubm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsummbm")) - -#define vec_msums(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_msums"))) - -#define vec_vmsumshs(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumshs")) - -#define vec_vmsumuhs(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumuhs")) - -#define vec_mtvscr(a1) \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ - __builtin_altivec_compiletime_error ("vec_mtvscr"))))))))))) - -#define vec_mule(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mule"))))) - -#define vec_vmulesh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulesh")) - -#define vec_vmuleuh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuleuh")) - -#define vec_vmulesb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulesb")) - -#define vec_vmuleub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuleub")) - -#define vec_mulo(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mulo"))))) - -#define vec_vmulosh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulosh")) - -#define vec_vmulouh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulouh")) - -#define vec_vmulosb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulosb")) - -#define vec_vmuloub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuloub")) - -#define vec_nmsub(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector float, (a3)), \ - ((__vector float) __builtin_altivec_vnmsubfp ((__vector float) (a1), (__vector float) (a2), (__vector float) (a3))), \ - __builtin_altivec_compiletime_error ("vec_nmsub")) - -#define vec_nor(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_nor"))))))))))) - -#define vec_or(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_or"))))))))))))))))))))))))) - -#define vec_pack(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_pack"))))))) - -#define vec_vpkuwum(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuwum")))) - -#define vec_vpkuhum(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuhum")))) - -#define vec_packpx(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vpkpx ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_packpx")) - -#define vec_packs(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_packs"))))) - -#define vec_vpkswss(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkswss")) - -#define vec_vpkuwus(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuwus")) - -#define vec_vpkshss(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkshss")) - -#define vec_vpkuhus(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuhus")) - -#define vec_packsu(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_packsu"))))) - -#define vec_vpkswus(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkswus")) - -#define vec_vpkshus(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkshus")) - -#define vec_perm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector unsigned char, (a3)), \ - ((__vector float) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector unsigned char, (a3)), \ - ((__vector signed int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector unsigned char, (a3)), \ - ((__vector signed short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __pixel, (a1), __vector __pixel, (a2), __vector unsigned char, (a3)), \ - ((__vector __pixel) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector unsigned char, (a3)), \ - ((__vector signed char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ - __builtin_altivec_compiletime_error ("vec_perm")))))))))))) - -#define vec_re(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrefp ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_re")) - -#define vec_rl(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_rl"))))))) - -#define vec_vrlw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlw"))) - -#define vec_vrlh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlh"))) - -#define vec_vrlb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlb"))) - -#define vec_round(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfin ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_round")) - -#define vec_rsqrte(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrsqrtefp ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_rsqrte")) - -#define vec_sel(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector __bool int, (a3)), \ - ((__vector float) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector unsigned int, (a3)), \ - ((__vector float) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector __bool int, (a3)), \ - ((__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector unsigned int, (a3)), \ - ((__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector __bool int, (a3)), \ - ((__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector unsigned int, (a3)), \ - ((__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector __bool int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector __bool short, (a3)), \ - ((__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector unsigned short, (a3)), \ - ((__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector __bool short, (a3)), \ - ((__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector unsigned short, (a3)), \ - ((__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector __bool short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector __bool char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector __bool char, (a3)), \ - ((__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector unsigned char, (a3)), \ - ((__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector __bool char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_sel"))))))))))))))))))))) - -#define vec_sl(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sl"))))))) - -#define vec_vslw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslw"))) - -#define vec_vslh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslh"))) - -#define vec_vslb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslb"))) - -#define vec_sld(a1, a2, a3) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_sld")))))))))))) - -#define vec_sll(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned short, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned int, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned short, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned int, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned short, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sll"))))))))))))))))))))))))))))))) - -#define vec_slo(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector signed char, (a2)), \ - ((__vector float) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector unsigned char, (a2)), \ - ((__vector float) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed char, (a2)), \ - ((__vector signed int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector signed char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector signed char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector signed char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector signed char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_slo"))))))))))))))))) - -#define vec_splat(a1, a2) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - ((__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - ((__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector signed int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - ((__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_splat")))))))))))) - -#define vec_vspltw(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - ((__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector signed int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vspltw"))))) - -#define vec_vsplth(a1, a2) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - ((__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsplth"))))) - -#define vec_vspltb(a1, a2) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - ((__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vspltb")))) - -#define vec_splat_s8(a1) ((__vector signed char) __builtin_altivec_vspltisb (a1)) - -#define vec_splat_s16(a1) ((__vector signed short) __builtin_altivec_vspltish (a1)) - -#define vec_splat_s32(a1) ((__vector signed int) __builtin_altivec_vspltisw (a1)) - -#define vec_splat_u8(a1) ((__vector unsigned char) __builtin_altivec_vspltisb (a1)) - -#define vec_splat_u16(a1) ((__vector unsigned short) __builtin_altivec_vspltish (a1)) - -#define vec_splat_u32(a1) ((__vector unsigned int) __builtin_altivec_vspltisw (a1)) - -#define vec_sr(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sr"))))))) - -#define vec_vsrw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrw"))) - -#define vec_vsrh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrh"))) - -#define vec_vsrb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrb"))) - -#define vec_sra(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sra"))))))) - -#define vec_vsraw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsraw"))) - -#define vec_vsrah(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrah"))) - -#define vec_vsrab(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrab"))) - -#define vec_srl(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned short, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned int, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned short, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned int, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned short, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_srl"))))))))))))))))))))))))))))))) - -#define vec_sro(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector signed char, (a2)), \ - ((__vector float) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector unsigned char, (a2)), \ - ((__vector float) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector signed char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector signed char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector signed char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector signed char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sro"))))))))))))))))) - -#define vec_st(a1, a2, a3) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), float, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__builtin_altivec_compiletime_error ("vec_st"))))))))))))))))))))))))))) - -#define vec_stl(a1, a2, a3) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), float, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__builtin_altivec_compiletime_error ("vec_stl"))))))))))))))))))))))))))) - -#define vec_ste(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector unsigned short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector unsigned int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector float, (a), float, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ - __builtin_altivec_compiletime_error ("vec_ste")))))))))))))))) - -#define vec_stvewx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector float, (a), float, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvewx")))))) - -#define vec_stvehx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvehx"))))))) - -#define vec_stvebx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvebx"))))) - -#define vec_sub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsubfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sub")))))))))))))))))))) - -#define vec_vsubfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsubfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubfp")) - -#define vec_vsubuwm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuwm"))))))) - -#define vec_vsubuhm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuhm"))))))) - -#define vec_vsububm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsububm"))))))) - -#define vec_subc(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubcuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_subc")) - -#define vec_subs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_subs"))))))))))))))))))) - -#define vec_vsubsws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubsws")))) - -#define vec_vsubuws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuws")))) - -#define vec_vsubshs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubshs")))) - -#define vec_vsubuhs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuhs")))) - -#define vec_vsubsbs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubsbs")))) - -#define vec_vsububs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsububs")))) - -#define vec_sum4s(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sum4s")))) - -#define vec_vsum4shs(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4shs")) - -#define vec_vsum4sbs(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4sbs")) - -#define vec_vsum4ubs(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4ubs")) - -#define vec_sum2s(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum2sws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_sum2s")) - -#define vec_sums(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsumsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_sums")) - -#define vec_trunc(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfiz ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_trunc")) - -#define vec_unpackh(a1) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ - __builtin_altivec_compiletime_error ("vec_unpackh")))))) - -#define vec_vupkhsh(a1) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhsh"))) - -#define vec_vupkhpx(a1) \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhpx")) - -#define vec_vupkhsb(a1) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhsb"))) - -#define vec_unpackl(a1) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ - __builtin_altivec_compiletime_error ("vec_unpackl")))))) - -#define vec_vupklsh(a1) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklsh"))) - -#define vec_vupklpx(a1) \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklpx")) - -#define vec_vupklsb(a1) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklsb"))) - -#define vec_xor(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_xor"))))))))))))))))))))))))) - -/* Predicates. */ - -#define vec_all_eq(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_eq")))))))))))))))))))))))) - -#define vec_all_ge(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ge")))))))))))))))))))) - -#define vec_all_gt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_gt")))))))))))))))))))) - -#define vec_all_in(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_in")) - -#define vec_all_le(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_le")))))))))))))))))))) - -#define vec_all_lt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_lt")))))))))))))))))))) - -#define vec_all_nan(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nan")) - -#define vec_all_ne(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ne")))))))))))))))))))))))) - -#define vec_all_nge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_nge")) - -#define vec_all_ngt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ngt")) - -#define vec_all_nle(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nle")) - -#define vec_all_nlt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nlt")) - -#define vec_all_numeric(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_numeric")) - -#define vec_any_eq(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_eq")))))))))))))))))))))))) - -#define vec_any_ge(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ge")))))))))))))))))))) - -#define vec_any_gt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_gt")))))))))))))))))))) - -#define vec_any_le(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_le")))))))))))))))))))) - -#define vec_any_lt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_lt")))))))))))))))))))) - -#define vec_any_nan(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nan")) - -#define vec_any_ne(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ne")))))))))))))))))))))))) - -#define vec_any_nge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_nge")) - -#define vec_any_ngt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ngt")) - -#define vec_any_nle(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nle")) - -#define vec_any_nlt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nlt")) - -#define vec_any_numeric(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_numeric")) - -#define vec_any_out(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_out")) - - -#endif /* __cplusplus */ +#define vec_mfvscr() ((__vector unsigned short) __builtin_altivec_mfvscr ()) +#define vec_splat_s8(x) __builtin_altivec_vspltisb ((x)) +#define vec_splat_s16(x) __builtin_altivec_vspltish ((x)) +#define vec_splat_s32(x) __builtin_altivec_vspltisw ((x)) +#define vec_splat_u8(x) ((__vector unsigned char) vec_splat_s8 ((x))) +#define vec_splat_u16(x) ((__vector unsigned short) vec_splat_s16 ((x))) +#define vec_splat_u32(x) ((__vector unsigned int) vec_splat_s32 ((x))) + +/* This also accepts a type for its parameter, so it is not enough + to #define vec_step to __builtin_vec_step. */ +#define vec_step(x) __builtin_vec_step (* (__typeof__ (x) *) 0) #endif /* _ALTIVEC_H */ diff --git a/contrib/gcc/config/rs6000/altivec.md b/contrib/gcc/config/rs6000/altivec.md index 505a5738cf8..e0326856f1a 100644 --- a/contrib/gcc/config/rs6000/altivec.md +++ b/contrib/gcc/config/rs6000/altivec.md @@ -1,5 +1,5 @@ ;; AltiVec patterns. -;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Contributed by Aldy Hernandez (aldy@quesejoda.com) ;; This file is part of GCC. @@ -16,100 +16,178 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_constants - [(UNSPEC_VSPLTISW 141) - (UNSPEC_VSPLTISH 140) - (UNSPEC_VSPLTISB 139) + [(UNSPEC_VCMPBFP 50) + (UNSPEC_VCMPEQUB 51) + (UNSPEC_VCMPEQUH 52) + (UNSPEC_VCMPEQUW 53) + (UNSPEC_VCMPEQFP 54) + (UNSPEC_VCMPGEFP 55) + (UNSPEC_VCMPGTUB 56) + (UNSPEC_VCMPGTSB 57) + (UNSPEC_VCMPGTUH 58) + (UNSPEC_VCMPGTSH 59) + (UNSPEC_VCMPGTUW 60) + (UNSPEC_VCMPGTSW 61) + (UNSPEC_VCMPGTFP 62) + (UNSPEC_VMSUMU 65) + (UNSPEC_VMSUMM 66) + (UNSPEC_VMSUMSHM 68) + (UNSPEC_VMSUMUHS 69) + (UNSPEC_VMSUMSHS 70) + (UNSPEC_VMHADDSHS 71) + (UNSPEC_VMHRADDSHS 72) + (UNSPEC_VMLADDUHM 73) + (UNSPEC_VADDCUW 75) + (UNSPEC_VADDU 76) + (UNSPEC_VADDS 77) + (UNSPEC_VAVGU 80) + (UNSPEC_VAVGS 81) + (UNSPEC_VMULEUB 83) + (UNSPEC_VMULESB 84) + (UNSPEC_VMULEUH 85) + (UNSPEC_VMULESH 86) + (UNSPEC_VMULOUB 87) + (UNSPEC_VMULOSB 88) + (UNSPEC_VMULOUH 89) + (UNSPEC_VMULOSH 90) + (UNSPEC_VPKUHUM 93) + (UNSPEC_VPKUWUM 94) + (UNSPEC_VPKPX 95) + (UNSPEC_VPKSHSS 97) + (UNSPEC_VPKSWSS 99) + (UNSPEC_VPKUHUS 100) + (UNSPEC_VPKSHUS 101) + (UNSPEC_VPKUWUS 102) + (UNSPEC_VPKSWUS 103) + (UNSPEC_VRL 104) + (UNSPEC_VSL 107) + (UNSPEC_VSLV4SI 110) + (UNSPEC_VSLO 111) + (UNSPEC_VSR 118) + (UNSPEC_VSRO 119) + (UNSPEC_VSUBCUW 124) + (UNSPEC_VSUBU 125) + (UNSPEC_VSUBS 126) + (UNSPEC_VSUM4UBS 131) + (UNSPEC_VSUM4S 132) + (UNSPEC_VSUM2SWS 134) + (UNSPEC_VSUMSWS 135) + (UNSPEC_VPERM 144) + (UNSPEC_VRFIP 148) + (UNSPEC_VRFIN 149) + (UNSPEC_VRFIM 150) + (UNSPEC_VCFUX 151) + (UNSPEC_VCFSX 152) + (UNSPEC_VCTUXS 153) + (UNSPEC_VCTSXS 154) + (UNSPEC_VLOGEFP 155) + (UNSPEC_VEXPTEFP 156) + (UNSPEC_VRSQRTEFP 157) + (UNSPEC_VREFP 158) + (UNSPEC_VSEL4SI 159) + (UNSPEC_VSEL4SF 160) + (UNSPEC_VSEL8HI 161) + (UNSPEC_VSEL16QI 162) + (UNSPEC_VLSDOI 163) + (UNSPEC_VUPKHSB 167) + (UNSPEC_VUPKHPX 168) + (UNSPEC_VUPKHSH 169) + (UNSPEC_VUPKLSB 170) + (UNSPEC_VUPKLPX 171) + (UNSPEC_VUPKLSH 172) + (UNSPEC_PREDICATE 173) + (UNSPEC_DST 190) + (UNSPEC_DSTT 191) + (UNSPEC_DSTST 192) + (UNSPEC_DSTSTT 193) + (UNSPEC_LVSL 194) + (UNSPEC_LVSR 195) + (UNSPEC_LVE 196) + (UNSPEC_STVX 201) + (UNSPEC_STVXL 202) + (UNSPEC_STVE 203) + (UNSPEC_SET_VSCR 213) + (UNSPEC_GET_VRSAVE 214) + (UNSPEC_REALIGN_LOAD 215) + (UNSPEC_REDUC_PLUS 217) + (UNSPEC_VECSH 219) + (UNSPEC_VCOND_V4SI 301) + (UNSPEC_VCOND_V4SF 302) + (UNSPEC_VCOND_V8HI 303) + (UNSPEC_VCOND_V16QI 304) + (UNSPEC_VCONDU_V4SI 305) + (UNSPEC_VCONDU_V8HI 306) + (UNSPEC_VCONDU_V16QI 307) ]) +(define_constants + [(UNSPECV_SET_VRSAVE 30) + (UNSPECV_MTVSCR 186) + (UNSPECV_MFVSCR 187) + (UNSPECV_DSSALL 188) + (UNSPECV_DSS 189) + ]) + +;; Vec int modes +(define_mode_macro VI [V4SI V8HI V16QI]) +;; Short vec in modes +(define_mode_macro VIshort [V8HI V16QI]) +;; Vec float modes +(define_mode_macro VF [V4SF]) +;; Vec modes, pity mode macros are not composable +(define_mode_macro V [V4SI V8HI V16QI V4SF]) + +(define_mode_attr VI_char [(V4SI "w") (V8HI "h") (V16QI "b")]) + ;; Generic LVX load instruction. -(define_insn "altivec_lvx_4si" - [(set (match_operand:V4SI 0 "altivec_register_operand" "=v") - (match_operand:V4SI 1 "memory_operand" "m"))] - "TARGET_ALTIVEC" - "lvx %0,%y1" - [(set_attr "type" "vecload")]) - -(define_insn "altivec_lvx_8hi" - [(set (match_operand:V8HI 0 "altivec_register_operand" "=v") - (match_operand:V8HI 1 "memory_operand" "m"))] - "TARGET_ALTIVEC" - "lvx %0,%y1" - [(set_attr "type" "vecload")]) - -(define_insn "altivec_lvx_16qi" - [(set (match_operand:V16QI 0 "altivec_register_operand" "=v") - (match_operand:V16QI 1 "memory_operand" "m"))] - "TARGET_ALTIVEC" - "lvx %0,%y1" - [(set_attr "type" "vecload")]) - -(define_insn "altivec_lvx_4sf" - [(set (match_operand:V4SF 0 "altivec_register_operand" "=v") - (match_operand:V4SF 1 "memory_operand" "m"))] +(define_insn "altivec_lvx_" + [(set (match_operand:V 0 "altivec_register_operand" "=v") + (match_operand:V 1 "memory_operand" "Z"))] "TARGET_ALTIVEC" "lvx %0,%y1" [(set_attr "type" "vecload")]) ;; Generic STVX store instruction. -(define_insn "altivec_stvx_4si" - [(set (match_operand:V4SI 0 "memory_operand" "=m") - (match_operand:V4SI 1 "altivec_register_operand" "v"))] - "TARGET_ALTIVEC" - "stvx %1,%y0" - [(set_attr "type" "vecstore")]) - -(define_insn "altivec_stvx_8hi" - [(set (match_operand:V8HI 0 "memory_operand" "=m") - (match_operand:V8HI 1 "altivec_register_operand" "v"))] - "TARGET_ALTIVEC" - "stvx %1,%y0" - [(set_attr "type" "vecstore")]) - -(define_insn "altivec_stvx_16qi" - [(set (match_operand:V16QI 0 "memory_operand" "=m") - (match_operand:V16QI 1 "altivec_register_operand" "v"))] - "TARGET_ALTIVEC" - "stvx %1,%y0" - [(set_attr "type" "vecstore")]) - -(define_insn "altivec_stvx_4sf" - [(set (match_operand:V4SF 0 "memory_operand" "=m") - (match_operand:V4SF 1 "altivec_register_operand" "v"))] +(define_insn "altivec_stvx_" + [(set (match_operand:V 0 "memory_operand" "=Z") + (match_operand:V 1 "altivec_register_operand" "v"))] "TARGET_ALTIVEC" "stvx %1,%y0" [(set_attr "type" "vecstore")]) ;; Vector move instructions. -(define_expand "movv4si" - [(set (match_operand:V4SI 0 "nonimmediate_operand" "") - (match_operand:V4SI 1 "any_operand" ""))] +(define_expand "mov" + [(set (match_operand:V 0 "nonimmediate_operand" "") + (match_operand:V 1 "any_operand" ""))] "TARGET_ALTIVEC" - "{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }") +{ + rs6000_emit_move (operands[0], operands[1], mode); + DONE; +}) -(define_insn "*movv4si_internal" - [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v") - (match_operand:V4SI 1 "input_operand" "v,m,v,r,o,r,W"))] +(define_insn "*mov_internal" + [(set (match_operand:V 0 "nonimmediate_operand" "=Z,v,v,o,r,r,v") + (match_operand:V 1 "input_operand" "v,Z,v,r,o,r,W"))] "TARGET_ALTIVEC - && (register_operand (operands[0], V4SImode) - || register_operand (operands[1], V4SImode))" - "* + && (register_operand (operands[0], mode) + || register_operand (operands[1], mode))" { switch (which_alternative) { - case 0: return \"stvx %1,%y0\"; - case 1: return \"lvx %0,%y1\"; - case 2: return \"vor %0,%1,%1\"; - case 3: return \"#\"; - case 4: return \"#\"; - case 5: return \"#\"; + case 0: return "stvx %1,%y0"; + case 1: return "lvx %0,%y1"; + case 2: return "vor %0,%1,%1"; + case 3: return "#"; + case 4: return "#"; + case 5: return "#"; case 6: return output_vec_const_move (operands); - default: abort(); + default: gcc_unreachable (); } -}" +} [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")]) (define_split @@ -118,48 +196,9 @@ "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" [(pc)] -{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) - -(define_split - [(set (match_operand:V4SI 0 "altivec_register_operand" "") - (match_operand:V4SI 1 "easy_vector_constant_add_self" ""))] - "TARGET_ALTIVEC && reload_completed" - [(set (match_dup 0) (match_dup 3)) - (set (match_dup 0) - (plus:V4SI (match_dup 0) - (match_dup 0)))] - " -{ - operands[3] = gen_easy_vector_constant_add_self (operands[1]); -}") - -(define_expand "movv8hi" - [(set (match_operand:V8HI 0 "nonimmediate_operand" "") - (match_operand:V8HI 1 "any_operand" ""))] - "TARGET_ALTIVEC" - "{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }") - -(define_insn "*movv8hi_internal1" - [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v") - (match_operand:V8HI 1 "input_operand" "v,m,v,r,o,r,W"))] - "TARGET_ALTIVEC - && (register_operand (operands[0], V8HImode) - || register_operand (operands[1], V8HImode))" - "* { - switch (which_alternative) - { - case 0: return \"stvx %1,%y0\"; - case 1: return \"lvx %0,%y1\"; - case 2: return \"vor %0,%1,%1\"; - case 3: return \"#\"; - case 4: return \"#\"; - case 5: return \"#\"; - case 6: return output_vec_const_move (operands); - default: abort (); - } -}" - [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")]) + rs6000_split_multireg_move (operands[0], operands[1]); DONE; +}) (define_split [(set (match_operand:V8HI 0 "nonimmediate_operand" "") @@ -169,47 +208,6 @@ [(pc)] { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) -(define_split - [(set (match_operand:V8HI 0 "altivec_register_operand" "") - (match_operand:V8HI 1 "easy_vector_constant_add_self" ""))] - "TARGET_ALTIVEC && reload_completed" - [(set (match_dup 0) (match_dup 3)) - (set (match_dup 0) - (plus:V8HI (match_dup 0) - (match_dup 0)))] - " -{ - operands[3] = gen_easy_vector_constant_add_self (operands[1]); -}") - -(define_expand "movv16qi" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "") - (match_operand:V16QI 1 "any_operand" ""))] - "TARGET_ALTIVEC" - "{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }") - -(define_insn "*movv16qi_internal1" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,o,r,r,v") - (match_operand:V16QI 1 "input_operand" "v,m,v,r,o,r,W"))] - "TARGET_ALTIVEC - && (register_operand (operands[0], V16QImode) - || register_operand (operands[1], V16QImode))" - "* -{ - switch (which_alternative) - { - case 0: return \"stvx %1,%y0\"; - case 1: return \"lvx %0,%y1\"; - case 2: return \"vor %0,%1,%1\"; - case 3: return \"#\"; - case 4: return \"#\"; - case 5: return \"#\"; - case 6: return output_vec_const_move (operands); - default: abort (); - } -}" - [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")]) - (define_split [(set (match_operand:V16QI 0 "nonimmediate_operand" "") (match_operand:V16QI 1 "input_operand" ""))] @@ -218,107 +216,92 @@ [(pc)] { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) -(define_split - [(set (match_operand:V16QI 0 "altivec_register_operand" "") - (match_operand:V16QI 1 "easy_vector_constant_add_self" ""))] - "TARGET_ALTIVEC && reload_completed" - [(set (match_dup 0) (match_dup 3)) - (set (match_dup 0) - (plus:V16QI (match_dup 0) - (match_dup 0)))] - " -{ - operands[3] = gen_easy_vector_constant_add_self (operands[1]); -}") - -(define_expand "movv4sf" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "") - (match_operand:V4SF 1 "any_operand" ""))] - "TARGET_ALTIVEC" - "{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }") - -(define_insn "*movv4sf_internal1" - [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,o,r,r,v") - (match_operand:V4SF 1 "input_operand" "v,m,v,r,o,r,W"))] - "TARGET_ALTIVEC - && (register_operand (operands[0], V4SFmode) - || register_operand (operands[1], V4SFmode))" - "* -{ - switch (which_alternative) - { - case 0: return \"stvx %1,%y0\"; - case 1: return \"lvx %0,%y1\"; - case 2: return \"vor %0,%1,%1\"; - case 3: return \"#\"; - case 4: return \"#\"; - case 5: return \"#\"; - case 6: return output_vec_const_move (operands); - default: abort (); - } -}" - [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")]) - (define_split [(set (match_operand:V4SF 0 "nonimmediate_operand" "") (match_operand:V4SF 1 "input_operand" ""))] "TARGET_ALTIVEC && reload_completed && gpr_or_gpr_p (operands[0], operands[1])" [(pc)] -{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) +{ + rs6000_split_multireg_move (operands[0], operands[1]); DONE; +}) + +(define_split + [(set (match_operand:VI 0 "altivec_register_operand" "") + (match_operand:VI 1 "easy_vector_constant_add_self" ""))] + "TARGET_ALTIVEC && reload_completed" + [(set (match_dup 0) (match_dup 3)) + (set (match_dup 0) (plus:VI (match_dup 0) + (match_dup 0)))] +{ + rtx dup = gen_easy_altivec_constant (operands[1]); + rtx const_vec; + + /* Divide the operand of the resulting VEC_DUPLICATE, and use + simplify_rtx to make a CONST_VECTOR. */ + XEXP (dup, 0) = simplify_const_binary_operation (ASHIFTRT, QImode, + XEXP (dup, 0), const1_rtx); + const_vec = simplify_rtx (dup); + + if (GET_MODE (const_vec) == mode) + operands[3] = const_vec; + else + operands[3] = gen_lowpart (mode, const_vec); +}) (define_insn "get_vrsave_internal" [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(reg:SI 109)] 214))] + (unspec:SI [(reg:SI 109)] UNSPEC_GET_VRSAVE))] "TARGET_ALTIVEC" - "* { if (TARGET_MACHO) - return \"mfspr %0,256\"; + return "mfspr %0,256"; else - return \"mfvrsave %0\"; -}" + return "mfvrsave %0"; +} [(set_attr "type" "*")]) (define_insn "*set_vrsave_internal" [(match_parallel 0 "vrsave_operation" [(set (reg:SI 109) (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r") - (reg:SI 109)] 30))])] + (reg:SI 109)] UNSPECV_SET_VRSAVE))])] "TARGET_ALTIVEC" - "* { if (TARGET_MACHO) - return \"mtspr 256,%1\"; + return "mtspr 256,%1"; else - return \"mtvrsave %1\"; -}" + return "mtvrsave %1"; +} [(set_attr "type" "*")]) +(define_insn "*save_world" + [(match_parallel 0 "save_world_operation" + [(clobber (match_operand:SI 1 "register_operand" "=l")) + (use (match_operand:SI 2 "call_operand" "s"))])] + "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT" + "bl %z2" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +(define_insn "*restore_world" + [(match_parallel 0 "restore_world_operation" + [(return) + (use (match_operand:SI 1 "register_operand" "l")) + (use (match_operand:SI 2 "call_operand" "s")) + (clobber (match_operand:SI 3 "gpc_reg_operand" "=r"))])] + "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT" + "b %z2") + ;; Simple binary operations. -(define_insn "addv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (plus:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] +;; add +(define_insn "add3" + [(set (match_operand:VI 0 "register_operand" "=v") + (plus:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vaddubm %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "addv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (plus:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vadduhm %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "addv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (plus:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vadduwm %0,%1,%2" + "vaddum %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "addv4sf3" @@ -332,133 +315,102 @@ (define_insn "altivec_vaddcuw" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 35))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VADDCUW))] "TARGET_ALTIVEC" "vaddcuw %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vaddubs" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 36)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +(define_insn "altivec_vaddus" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VADDU)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" - "vaddubs %0,%1,%2" + "vaddus %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vaddsbs" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 37)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +(define_insn "altivec_vaddss" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VADDS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" - "vaddsbs %0,%1,%2" + "vaddss %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vadduhs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 38)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +;; sub +(define_insn "sub3" + [(set (match_operand:VI 0 "register_operand" "=v") + (minus:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vadduhs %0,%1,%2" + "vsubum %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vaddshs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 39)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +(define_insn "subv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (minus:V4SF (match_operand:V4SF 1 "register_operand" "v") + (match_operand:V4SF 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vaddshs %0,%1,%2" - [(set_attr "type" "vecsimple")]) + "vsubfp %0,%1,%2" + [(set_attr "type" "vecfloat")]) -(define_insn "altivec_vadduws" +(define_insn "altivec_vsubcuw" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 40)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUBCUW))] "TARGET_ALTIVEC" - "vadduws %0,%1,%2" + "vsubcuw %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vaddsws" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 41)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +(define_insn "altivec_vsubus" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VSUBU)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" - "vaddsws %0,%1,%2" + "vsubus %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "andv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (and:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] +(define_insn "altivec_vsubss" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VSUBS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" - "vand %0,%1,%2" + "vsubss %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vandc" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (and:V4SI (match_operand:V4SI 1 "register_operand" "v") - (not:V4SI (match_operand:V4SI 2 "register_operand" "v"))))] +;; +(define_insn "altivec_vavgu" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VAVGU))] "TARGET_ALTIVEC" - "vandc %0,%1,%2" + "vavgu %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vavgub" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 44))] +(define_insn "altivec_vavgs" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VAVGS))] "TARGET_ALTIVEC" - "vavgub %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vavgsb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 45))] - "TARGET_ALTIVEC" - "vavgsb %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vavguh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 46))] - "TARGET_ALTIVEC" - "vavguh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vavgsh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 47))] - "TARGET_ALTIVEC" - "vavgsh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vavguw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 48))] - "TARGET_ALTIVEC" - "vavguw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vavgsw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 49))] - "TARGET_ALTIVEC" - "vavgsw %0,%1,%2" + "vavgs %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_vcmpbfp" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 50))] + (match_operand:V4SF 2 "register_operand" "v")] + UNSPEC_VCMPBFP))] "TARGET_ALTIVEC" "vcmpbfp %0,%1,%2" [(set_attr "type" "veccmp")]) @@ -466,7 +418,8 @@ (define_insn "altivec_vcmpequb" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 51))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VCMPEQUB))] "TARGET_ALTIVEC" "vcmpequb %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -474,7 +427,8 @@ (define_insn "altivec_vcmpequh" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 52))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VCMPEQUH))] "TARGET_ALTIVEC" "vcmpequh %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -482,7 +436,8 @@ (define_insn "altivec_vcmpequw" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 53))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VCMPEQUW))] "TARGET_ALTIVEC" "vcmpequw %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -490,7 +445,8 @@ (define_insn "altivec_vcmpeqfp" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 54))] + (match_operand:V4SF 2 "register_operand" "v")] + UNSPEC_VCMPEQFP))] "TARGET_ALTIVEC" "vcmpeqfp %0,%1,%2" [(set_attr "type" "veccmp")]) @@ -498,7 +454,8 @@ (define_insn "altivec_vcmpgefp" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 55))] + (match_operand:V4SF 2 "register_operand" "v")] + UNSPEC_VCMPGEFP))] "TARGET_ALTIVEC" "vcmpgefp %0,%1,%2" [(set_attr "type" "veccmp")]) @@ -506,7 +463,8 @@ (define_insn "altivec_vcmpgtub" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 56))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VCMPGTUB))] "TARGET_ALTIVEC" "vcmpgtub %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -514,7 +472,8 @@ (define_insn "altivec_vcmpgtsb" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 57))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VCMPGTSB))] "TARGET_ALTIVEC" "vcmpgtsb %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -522,7 +481,8 @@ (define_insn "altivec_vcmpgtuh" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 58))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VCMPGTUH))] "TARGET_ALTIVEC" "vcmpgtuh %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -530,7 +490,8 @@ (define_insn "altivec_vcmpgtsh" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 59))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VCMPGTSH))] "TARGET_ALTIVEC" "vcmpgtsh %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -538,7 +499,8 @@ (define_insn "altivec_vcmpgtuw" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 60))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VCMPGTUW))] "TARGET_ALTIVEC" "vcmpgtuw %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -546,7 +508,8 @@ (define_insn "altivec_vcmpgtsw" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 61))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VCMPGTSW))] "TARGET_ALTIVEC" "vcmpgtsw %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -554,7 +517,8 @@ (define_insn "altivec_vcmpgtfp" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 62))] + (match_operand:V4SF 2 "register_operand" "v")] + UNSPEC_VCMPGTFP))] "TARGET_ALTIVEC" "vcmpgtfp %0,%1,%2" [(set_attr "type" "veccmp")]) @@ -581,16 +545,75 @@ rtx neg0; /* Generate [-0.0, -0.0, -0.0, -0.0]. */ - neg0 = gen_reg_rtx (V4SFmode); - emit_insn (gen_altivec_vspltisw_v4sf (neg0, GEN_INT (-1))); - emit_insn (gen_altivec_vslw_v4sf (neg0, neg0, neg0)); + neg0 = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (neg0, constm1_rtx)); + emit_insn (gen_altivec_vslw (neg0, neg0, neg0)); /* Use the multiply-add. */ emit_insn (gen_altivec_vmaddfp (operands[0], operands[1], operands[2], - neg0)); + gen_lowpart (V4SFmode, neg0))); DONE; }") +;; 32 bit integer multiplication +;; A_high = Operand_0 & 0xFFFF0000 >> 16 +;; A_low = Operand_0 & 0xFFFF +;; B_high = Operand_1 & 0xFFFF0000 >> 16 +;; B_low = Operand_1 & 0xFFFF +;; result = A_low * B_low + (A_high * B_low + B_high * A_low) << 16 + +;; (define_insn "mulv4si3" +;; [(set (match_operand:V4SI 0 "register_operand" "=v") +;; (mult:V4SI (match_operand:V4SI 1 "register_operand" "v") +;; (match_operand:V4SI 2 "register_operand" "v")))] +(define_expand "mulv4si3" + [(use (match_operand:V4SI 0 "register_operand" "")) + (use (match_operand:V4SI 1 "register_operand" "")) + (use (match_operand:V4SI 2 "register_operand" ""))] + "TARGET_ALTIVEC" + " + { + rtx zero; + rtx swap; + rtx small_swap; + rtx sixteen; + rtx one; + rtx two; + rtx low_product; + rtx high_product; + + zero = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (zero, const0_rtx)); + + sixteen = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (sixteen, gen_rtx_CONST_INT (V4SImode, -16))); + + swap = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vrlw (swap, operands[2], sixteen)); + + one = gen_reg_rtx (V8HImode); + convert_move (one, operands[1], 0); + + two = gen_reg_rtx (V8HImode); + convert_move (two, operands[2], 0); + + small_swap = gen_reg_rtx (V8HImode); + convert_move (small_swap, swap, 0); + + low_product = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vmulouh (low_product, one, two)); + + high_product = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vmsumuhm (high_product, one, small_swap, zero)); + + emit_insn (gen_altivec_vslw (high_product, high_product, sixteen)); + + emit_insn (gen_addv4si3 (operands[0], high_product, low_product)); + + DONE; + }") + + ;; Fused multiply subtract (define_insn "altivec_vnmsubfp" [(set (match_operand:V4SF 0 "register_operand" "=v") @@ -601,39 +624,32 @@ "vnmsubfp %0,%1,%2,%3" [(set_attr "type" "vecfloat")]) - -(define_insn "altivec_vmsumubm" +(define_insn "altivec_vmsumum" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 65))] + (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v") + (match_operand:VIshort 2 "register_operand" "v") + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VMSUMU))] "TARGET_ALTIVEC" - "vmsumubm %0,%1,%2,%3" + "vmsumum %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) -(define_insn "altivec_vmsummbm" +(define_insn "altivec_vmsummm" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 66))] + (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v") + (match_operand:VIshort 2 "register_operand" "v") + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VMSUMM))] "TARGET_ALTIVEC" - "vmsummbm %0,%1,%2,%3" - [(set_attr "type" "veccomplex")]) - -(define_insn "altivec_vmsumuhm" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 67))] - "TARGET_ALTIVEC" - "vmsumuhm %0,%1,%2,%3" + "vmsummm %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) (define_insn "altivec_vmsumshm" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 68))] + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VMSUMSHM))] "TARGET_ALTIVEC" "vmsumshm %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -642,8 +658,9 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 69)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VMSUMUHS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmsumuhs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -652,58 +669,29 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 70)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VMSUMSHS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmsumshs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) -(define_insn "umaxv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (umax:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] +;; max + +(define_insn "umax3" + [(set (match_operand:VI 0 "register_operand" "=v") + (umax:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vmaxub %0,%1,%2" + "vmaxu %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "smaxv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (smax:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] +(define_insn "smax3" + [(set (match_operand:VI 0 "register_operand" "=v") + (smax:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vmaxsb %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "umaxv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (umax:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vmaxuh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "smaxv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (smax:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vmaxsh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "umaxv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (umax:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vmaxuw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "smaxv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (smax:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vmaxsw %0,%1,%2" + "vmaxs %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "smaxv4sf3" @@ -714,189 +702,20 @@ "vmaxfp %0,%1,%2" [(set_attr "type" "veccmp")]) -(define_insn "altivec_vmhaddshs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V8HI 3 "register_operand" "v")] 71)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] +(define_insn "umin3" + [(set (match_operand:VI 0 "register_operand" "=v") + (umin:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vmhaddshs %0,%1,%2,%3" - [(set_attr "type" "veccomplex")]) -(define_insn "altivec_vmhraddshs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V8HI 3 "register_operand" "v")] 72)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vmhraddshs %0,%1,%2,%3" - [(set_attr "type" "veccomplex")]) -(define_insn "altivec_vmladduhm" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V8HI 3 "register_operand" "v")] 73))] - "TARGET_ALTIVEC" - "vmladduhm %0,%1,%2,%3" - [(set_attr "type" "veccomplex")]) - -(define_insn "altivec_vmrghb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v") - (parallel [(const_int 8) - (const_int 9) - (const_int 10) - (const_int 11) - (const_int 12) - (const_int 13) - (const_int 14) - (const_int 15) - (const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7)])) - (match_operand:V16QI 2 "register_operand" "v") - (const_int 255)))] - "TARGET_ALTIVEC" - "vmrghb %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vmrghh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v") - (parallel [(const_int 4) - (const_int 5) - (const_int 6) - (const_int 7) - (const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)])) - (match_operand:V8HI 2 "register_operand" "v") - (const_int 15)))] - "TARGET_ALTIVEC" - "vmrghh %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vmrghw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v") - (parallel [(const_int 2) - (const_int 3) - (const_int 0) - (const_int 1)])) - (match_operand:V4SI 2 "register_operand" "v") - (const_int 12)))] - "TARGET_ALTIVEC" - "vmrghw %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vmrglb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7) - (const_int 8) - (const_int 9) - (const_int 10) - (const_int 11) - (const_int 12) - (const_int 13) - (const_int 14) - (const_int 15)])) - (match_operand:V16QI 1 "register_operand" "v") - (const_int 255)))] - "TARGET_ALTIVEC" - "vmrglb %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vmrglh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3) - (const_int 4) - (const_int 5) - (const_int 6) - (const_int 7)])) - (match_operand:V8HI 1 "register_operand" "v") - (const_int 15)))] - "TARGET_ALTIVEC" - "vmrglh %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vmrglw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") - (parallel [(const_int 0) - (const_int 1) - (const_int 2) - (const_int 3)])) - (match_operand:V4SI 1 "register_operand" "v") - (const_int 12)))] - "TARGET_ALTIVEC" - "vmrglw %0,%1,%2" - [(set_attr "type" "vecperm")]) - -(define_insn "uminv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (umin:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vminub %0,%1,%2" + "vminu %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "sminv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (smin:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] +(define_insn "smin3" + [(set (match_operand:VI 0 "register_operand" "=v") + (smin:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] "TARGET_ALTIVEC" - "vminsb %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "uminv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (umin:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vminuh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "sminv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (smin:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vminsh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "uminv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (umin:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vminuw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "sminv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (smin:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vminsw %0,%1,%2" + "vmins %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "sminv4sf3" @@ -907,10 +726,209 @@ "vminfp %0,%1,%2" [(set_attr "type" "veccmp")]) +(define_insn "altivec_vmhaddshs" + [(set (match_operand:V8HI 0 "register_operand" "=v") + (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v") + (match_operand:V8HI 3 "register_operand" "v")] + UNSPEC_VMHADDSHS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] + "TARGET_ALTIVEC" + "vmhaddshs %0,%1,%2,%3" + [(set_attr "type" "veccomplex")]) + +(define_insn "altivec_vmhraddshs" + [(set (match_operand:V8HI 0 "register_operand" "=v") + (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v") + (match_operand:V8HI 3 "register_operand" "v")] + UNSPEC_VMHRADDSHS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] + "TARGET_ALTIVEC" + "vmhraddshs %0,%1,%2,%3" + [(set_attr "type" "veccomplex")]) + +(define_insn "altivec_vmladduhm" + [(set (match_operand:V8HI 0 "register_operand" "=v") + (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v") + (match_operand:V8HI 3 "register_operand" "v")] + UNSPEC_VMLADDUHM))] + "TARGET_ALTIVEC" + "vmladduhm %0,%1,%2,%3" + [(set_attr "type" "veccomplex")]) + +(define_insn "altivec_vmrghb" + [(set (match_operand:V16QI 0 "register_operand" "=v") + (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v") + (parallel [(const_int 0) + (const_int 8) + (const_int 1) + (const_int 9) + (const_int 2) + (const_int 10) + (const_int 3) + (const_int 11) + (const_int 4) + (const_int 12) + (const_int 5) + (const_int 13) + (const_int 6) + (const_int 14) + (const_int 7) + (const_int 15)])) + (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") + (parallel [(const_int 8) + (const_int 0) + (const_int 9) + (const_int 1) + (const_int 10) + (const_int 2) + (const_int 11) + (const_int 3) + (const_int 12) + (const_int 4) + (const_int 13) + (const_int 5) + (const_int 14) + (const_int 6) + (const_int 15) + (const_int 7)])) + (const_int 21845)))] + "TARGET_ALTIVEC" + "vmrghb %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vmrghh" + [(set (match_operand:V8HI 0 "register_operand" "=v") + (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v") + (parallel [(const_int 0) + (const_int 4) + (const_int 1) + (const_int 5) + (const_int 2) + (const_int 6) + (const_int 3) + (const_int 7)])) + (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") + (parallel [(const_int 4) + (const_int 0) + (const_int 5) + (const_int 1) + (const_int 6) + (const_int 2) + (const_int 7) + (const_int 3)])) + (const_int 85)))] + "TARGET_ALTIVEC" + "vmrghh %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vmrghw" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v") + (parallel [(const_int 0) + (const_int 2) + (const_int 1) + (const_int 3)])) + (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") + (parallel [(const_int 2) + (const_int 0) + (const_int 3) + (const_int 1)])) + (const_int 5)))] + "TARGET_ALTIVEC" + "vmrghw %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vmrglb" + [(set (match_operand:V16QI 0 "register_operand" "=v") + (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v") + (parallel [(const_int 8) + (const_int 0) + (const_int 9) + (const_int 1) + (const_int 10) + (const_int 2) + (const_int 11) + (const_int 3) + (const_int 12) + (const_int 4) + (const_int 13) + (const_int 5) + (const_int 14) + (const_int 6) + (const_int 15) + (const_int 7)])) + (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") + (parallel [(const_int 0) + (const_int 8) + (const_int 1) + (const_int 9) + (const_int 2) + (const_int 10) + (const_int 3) + (const_int 11) + (const_int 4) + (const_int 12) + (const_int 5) + (const_int 13) + (const_int 6) + (const_int 14) + (const_int 7) + (const_int 15)])) + (const_int 21845)))] + "TARGET_ALTIVEC" + "vmrglb %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vmrglh" + [(set (match_operand:V8HI 0 "register_operand" "=v") + (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v") + (parallel [(const_int 4) + (const_int 0) + (const_int 5) + (const_int 1) + (const_int 6) + (const_int 2) + (const_int 7) + (const_int 3)])) + (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") + (parallel [(const_int 0) + (const_int 4) + (const_int 1) + (const_int 5) + (const_int 2) + (const_int 6) + (const_int 3) + (const_int 7)])) + (const_int 85)))] + "TARGET_ALTIVEC" + "vmrglh %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vmrglw" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v") + (parallel [(const_int 2) + (const_int 0) + (const_int 3) + (const_int 1)])) + (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") + (parallel [(const_int 0) + (const_int 2) + (const_int 1) + (const_int 3)])) + (const_int 5)))] + "TARGET_ALTIVEC" + "vmrglw %0,%1,%2" + [(set_attr "type" "vecperm")]) + (define_insn "altivec_vmuleub" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 83))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VMULEUB))] "TARGET_ALTIVEC" "vmuleub %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -918,7 +936,8 @@ (define_insn "altivec_vmulesb" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 84))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VMULESB))] "TARGET_ALTIVEC" "vmulesb %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -926,7 +945,8 @@ (define_insn "altivec_vmuleuh" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 85))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VMULEUH))] "TARGET_ALTIVEC" "vmuleuh %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -934,7 +954,8 @@ (define_insn "altivec_vmulesh" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 86))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VMULESH))] "TARGET_ALTIVEC" "vmulesh %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -942,7 +963,8 @@ (define_insn "altivec_vmuloub" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 87))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VMULOUB))] "TARGET_ALTIVEC" "vmuloub %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -950,7 +972,8 @@ (define_insn "altivec_vmulosb" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 88))] + (match_operand:V16QI 2 "register_operand" "v")] + UNSPEC_VMULOSB))] "TARGET_ALTIVEC" "vmulosb %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -958,7 +981,8 @@ (define_insn "altivec_vmulouh" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 89))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VMULOUH))] "TARGET_ALTIVEC" "vmulouh %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -966,31 +990,83 @@ (define_insn "altivec_vmulosh" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 90))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VMULOSH))] "TARGET_ALTIVEC" "vmulosh %0,%1,%2" [(set_attr "type" "veccomplex")]) -(define_insn "altivec_vnor" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (not:V4SI (ior:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v"))))] + +;; logical ops + +(define_insn "and3" + [(set (match_operand:VI 0 "register_operand" "=v") + (and:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vand %0,%1,%2" + [(set_attr "type" "vecsimple")]) + +(define_insn "ior3" + [(set (match_operand:VI 0 "register_operand" "=v") + (ior:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vor %0,%1,%2" + [(set_attr "type" "vecsimple")]) + +(define_insn "xor3" + [(set (match_operand:VI 0 "register_operand" "=v") + (xor:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vxor %0,%1,%2" + [(set_attr "type" "vecsimple")]) + +(define_insn "xorv4sf3" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (xor:V4SF (match_operand:V4SF 1 "register_operand" "v") + (match_operand:V4SF 2 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vxor %0,%1,%2" + [(set_attr "type" "vecsimple")]) + +(define_insn "one_cmpl2" + [(set (match_operand:VI 0 "register_operand" "=v") + (not:VI (match_operand:VI 1 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vnor %0,%1,%1" + [(set_attr "type" "vecsimple")]) + +(define_insn "altivec_nor3" + [(set (match_operand:VI 0 "register_operand" "=v") + (not:VI (ior:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v"))))] "TARGET_ALTIVEC" "vnor %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "iorv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (ior:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] +(define_insn "andc3" + [(set (match_operand:VI 0 "register_operand" "=v") + (and:VI (not:VI (match_operand:VI 2 "register_operand" "v")) + (match_operand:VI 1 "register_operand" "v")))] "TARGET_ALTIVEC" - "vor %0,%1,%2" + "vandc %0,%1,%2" + [(set_attr "type" "vecsimple")]) + +(define_insn "*andc3_v4sf" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (and:V4SF (not:V4SF (match_operand:V4SF 2 "register_operand" "v")) + (match_operand:V4SF 1 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vandc %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_vpkuhum" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 93))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VPKUHUM))] "TARGET_ALTIVEC" "vpkuhum %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -998,7 +1074,8 @@ (define_insn "altivec_vpkuwum" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 94))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VPKUWUM))] "TARGET_ALTIVEC" "vpkuwum %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1006,43 +1083,28 @@ (define_insn "altivec_vpkpx" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 95))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VPKPX))] "TARGET_ALTIVEC" "vpkpx %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vpkuhss" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 96)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vpkuhss %0,%1,%2" - [(set_attr "type" "vecperm")]) - (define_insn "altivec_vpkshss" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 97)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VPKSHSS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkshss %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vpkuwss" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 98)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vpkuwss %0,%1,%2" - [(set_attr "type" "vecperm")]) - (define_insn "altivec_vpkswss" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 99)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VPKSWSS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkswss %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1050,8 +1112,9 @@ (define_insn "altivec_vpkuhus" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 100)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VPKUHUS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuhus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1059,8 +1122,9 @@ (define_insn "altivec_vpkshus" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 101)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VPKSHUS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkshus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1068,8 +1132,9 @@ (define_insn "altivec_vpkuwus" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 102)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VPKUWUS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuwus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1077,72 +1142,36 @@ (define_insn "altivec_vpkswus" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 103)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VPKSWUS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkswus %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vrlb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 104))] +(define_insn "altivec_vrl" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VRL))] "TARGET_ALTIVEC" - "vrlb %0,%1,%2" + "vrl %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vrlh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 105))] +(define_insn "altivec_vsl" + [(set (match_operand:VI 0 "register_operand" "=v") + (unspec:VI [(match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v")] + UNSPEC_VSL))] "TARGET_ALTIVEC" - "vrlh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vrlw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 106))] - "TARGET_ALTIVEC" - "vrlw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vslb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 107))] - "TARGET_ALTIVEC" - "vslb %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vslh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 108))] - "TARGET_ALTIVEC" - "vslh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vslw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 109))] - "TARGET_ALTIVEC" - "vslw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vslw_v4sf" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 109))] - "TARGET_ALTIVEC" - "vslw %0,%1,%2" + "vsl %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_vsl" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 110))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSLV4SI))] "TARGET_ALTIVEC" "vsl %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1150,63 +1179,33 @@ (define_insn "altivec_vslo" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 111))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSLO))] "TARGET_ALTIVEC" "vslo %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsrb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 112))] +(define_insn "lshr3" + [(set (match_operand:VI 0 "register_operand" "=v") + (lshiftrt:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v") ))] "TARGET_ALTIVEC" - "vsrb %0,%1,%2" + "vsr %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vsrh" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 113))] +(define_insn "ashr3" + [(set (match_operand:VI 0 "register_operand" "=v") + (ashiftrt:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v") ))] "TARGET_ALTIVEC" - "vsrh %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsrw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 114))] - "TARGET_ALTIVEC" - "vsrw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsrab" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 115))] - "TARGET_ALTIVEC" - "vsrab %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsrah" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 116))] - "TARGET_ALTIVEC" - "vsrah %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsraw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 117))] - "TARGET_ALTIVEC" - "vsraw %0,%1,%2" + "vsra %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_vsr" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 118))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSR))] "TARGET_ALTIVEC" "vsr %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -1214,137 +1213,38 @@ (define_insn "altivec_vsro" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 119))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSRO))] "TARGET_ALTIVEC" "vsro %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "subv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (minus:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vsububm %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "subv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (minus:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vsubuhm %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "subv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (minus:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vsubuwm %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "subv4sf3" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (minus:V4SF (match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vsubfp %0,%1,%2" - [(set_attr "type" "vecfloat")]) - -(define_insn "altivec_vsubcuw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 124))] - "TARGET_ALTIVEC" - "vsubcuw %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsububs" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 125)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsububs %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsubsbs" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")] 126)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsubsbs %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsubuhs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 127)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsubuhs %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsubshs" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")] 128)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsubshs %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsubuws" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 129)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsubuws %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "altivec_vsubsws" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 130)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsubsws %0,%1,%2" - [(set_attr "type" "vecsimple")]) - (define_insn "altivec_vsum4ubs" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 131)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUM4UBS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsum4ubs %0,%1,%2" [(set_attr "type" "veccomplex")]) -(define_insn "altivec_vsum4sbs" +(define_insn "altivec_vsum4ss" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 132)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v") + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUM4S)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" - "vsum4sbs %0,%1,%2" - [(set_attr "type" "veccomplex")]) - -(define_insn "altivec_vsum4shs" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 133)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] - "TARGET_ALTIVEC" - "vsum4shs %0,%1,%2" + "vsum4ss %0,%1,%2" [(set_attr "type" "veccomplex")]) (define_insn "altivec_vsum2sws" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 134)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUM2SWS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsum2sws %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -1352,91 +1252,59 @@ (define_insn "altivec_vsumsws" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")] 135)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUMSWS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsumsws %0,%1,%2" [(set_attr "type" "veccomplex")]) -;; Vector xor's -(define_insn "xorv4si3" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (xor:V4SI (match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vxor %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "xorv8hi3" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (xor:V8HI (match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vxor %0,%1,%2" - [(set_attr "type" "vecsimple")]) - -(define_insn "xorv16qi3" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (xor:V16QI (match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v")))] - "TARGET_ALTIVEC" - "vxor %0,%1,%2" - [(set_attr "type" "vecsimple")]) - (define_insn "altivec_vspltb" [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 136))] + (vec_duplicate:V16QI + (vec_select:QI (match_operand:V16QI 1 "register_operand" "v") + (parallel + [(match_operand:QI 2 "u5bit_cint_operand" "")]))))] "TARGET_ALTIVEC" "vspltb %0,%1,%2" [(set_attr "type" "vecperm")]) -;; End of vector xor's (define_insn "altivec_vsplth" [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 137))] + (vec_duplicate:V8HI + (vec_select:HI (match_operand:V8HI 1 "register_operand" "v") + (parallel + [(match_operand:QI 2 "u5bit_cint_operand" "")]))))] "TARGET_ALTIVEC" "vsplth %0,%1,%2" [(set_attr "type" "vecperm")]) (define_insn "altivec_vspltw" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 138))] + (vec_duplicate:V4SI + (vec_select:SI (match_operand:V4SI 1 "register_operand" "v") + (parallel + [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))] "TARGET_ALTIVEC" "vspltw %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vspltisb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:QI 1 "immediate_operand" "i")] - UNSPEC_VSPLTISB))] - "TARGET_ALTIVEC" - "vspltisb %0,%1" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vspltish" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:QI 1 "immediate_operand" "i")] - UNSPEC_VSPLTISH))] - "TARGET_ALTIVEC" - "vspltish %0,%1" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vspltisw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:QI 1 "immediate_operand" "i")] - UNSPEC_VSPLTISW))] - "TARGET_ALTIVEC" - "vspltisw %0,%1" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vspltisw_v4sf" +(define_insn "*altivec_vspltsf" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:QI 1 "immediate_operand" "i")] 142))] + (vec_duplicate:V4SF + (vec_select:SF (match_operand:V4SF 1 "register_operand" "v") + (parallel + [(match_operand:QI 2 "u5bit_cint_operand" "i")]))))] "TARGET_ALTIVEC" - "vspltisw %0,%1" + "vspltw %0,%1,%2" + [(set_attr "type" "vecperm")]) + +(define_insn "altivec_vspltis" + [(set (match_operand:VI 0 "register_operand" "=v") + (vec_duplicate:VI + (match_operand:QI 1 "s5bit_cint_operand" "i")))] + "TARGET_ALTIVEC" + "vspltis %0,%1" [(set_attr "type" "vecperm")]) (define_insn "ftruncv4sf2" @@ -1446,59 +1314,36 @@ "vrfiz %0,%1" [(set_attr "type" "vecfloat")]) -(define_insn "altivec_vperm_4si" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v") - (match_operand:V16QI 3 "register_operand" "v")] 144))] - "TARGET_ALTIVEC" - "vperm %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vperm_4sf" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v") - (match_operand:V16QI 3 "register_operand" "v")] 145))] - "TARGET_ALTIVEC" - "vperm %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vperm_8hi" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V16QI 3 "register_operand" "v")] 146))] - "TARGET_ALTIVEC" - "vperm %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vperm_16qi" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v") - (match_operand:V16QI 3 "register_operand" "v")] 147))] +(define_insn "altivec_vperm_" + [(set (match_operand:V 0 "register_operand" "=v") + (unspec:V [(match_operand:V 1 "register_operand" "v") + (match_operand:V 2 "register_operand" "v") + (match_operand:V16QI 3 "register_operand" "v")] + UNSPEC_VPERM))] "TARGET_ALTIVEC" "vperm %0,%1,%2,%3" [(set_attr "type" "vecperm")]) (define_insn "altivec_vrfip" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 148))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VRFIP))] "TARGET_ALTIVEC" "vrfip %0,%1" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vrfin" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 149))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VRFIN))] "TARGET_ALTIVEC" "vrfin %0,%1" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vrfim" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 150))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VRFIM))] "TARGET_ALTIVEC" "vrfim %0,%1" [(set_attr "type" "vecfloat")]) @@ -1506,7 +1351,8 @@ (define_insn "altivec_vcfux" [(set (match_operand:V4SF 0 "register_operand" "=v") (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 151))] + (match_operand:QI 2 "immediate_operand" "i")] + UNSPEC_VCFUX))] "TARGET_ALTIVEC" "vcfux %0,%1,%2" [(set_attr "type" "vecfloat")]) @@ -1514,7 +1360,8 @@ (define_insn "altivec_vcfsx" [(set (match_operand:V4SF 0 "register_operand" "=v") (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 152))] + (match_operand:QI 2 "immediate_operand" "i")] + UNSPEC_VCFSX))] "TARGET_ALTIVEC" "vcfsx %0,%1,%2" [(set_attr "type" "vecfloat")]) @@ -1522,8 +1369,9 @@ (define_insn "altivec_vctuxs" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 153)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:QI 2 "immediate_operand" "i")] + UNSPEC_VCTUXS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vctuxs %0,%1,%2" [(set_attr "type" "vecfloat")]) @@ -1531,150 +1379,273 @@ (define_insn "altivec_vctsxs" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:QI 2 "immediate_operand" "i")] 154)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:QI 2 "immediate_operand" "i")] + UNSPEC_VCTSXS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vctsxs %0,%1,%2" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vlogefp" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 155))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VLOGEFP))] "TARGET_ALTIVEC" "vlogefp %0,%1" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vexptefp" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 156))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VEXPTEFP))] "TARGET_ALTIVEC" "vexptefp %0,%1" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vrsqrtefp" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 157))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VRSQRTEFP))] "TARGET_ALTIVEC" "vrsqrtefp %0,%1" [(set_attr "type" "vecfloat")]) (define_insn "altivec_vrefp" [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 158))] + (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] + UNSPEC_VREFP))] "TARGET_ALTIVEC" "vrefp %0,%1" [(set_attr "type" "vecfloat")]) -(define_insn "altivec_vsel_4si" +(define_expand "vcondv4si" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V4SI 2 "register_operand" "v") + (match_operand:V4SI 3 "comparison_operator" "") + (match_operand:V4SI 4 "register_operand" "v") + (match_operand:V4SI 5 "register_operand" "v") + ] UNSPEC_VCOND_V4SI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vconduv4si" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V4SI 2 "register_operand" "v") + (match_operand:V4SI 3 "comparison_operator" "") + (match_operand:V4SI 4 "register_operand" "v") + (match_operand:V4SI 5 "register_operand" "v") + ] UNSPEC_VCONDU_V4SI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vcondv4sf" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V4SF 2 "register_operand" "v") + (match_operand:V4SF 3 "comparison_operator" "") + (match_operand:V4SF 4 "register_operand" "v") + (match_operand:V4SF 5 "register_operand" "v") + ] UNSPEC_VCOND_V4SF))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vcondv8hi" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v") + (match_operand:V8HI 3 "comparison_operator" "") + (match_operand:V8HI 4 "register_operand" "v") + (match_operand:V8HI 5 "register_operand" "v") + ] UNSPEC_VCOND_V8HI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vconduv8hi" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v") + (match_operand:V8HI 3 "comparison_operator" "") + (match_operand:V8HI 4 "register_operand" "v") + (match_operand:V8HI 5 "register_operand" "v") + ] UNSPEC_VCONDU_V8HI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vcondv16qi" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V16QI 2 "register_operand" "v") + (match_operand:V16QI 3 "comparison_operator" "") + (match_operand:V16QI 4 "register_operand" "v") + (match_operand:V16QI 5 "register_operand" "v") + ] UNSPEC_VCOND_V16QI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + +(define_expand "vconduv16qi" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (unspec:V16QI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V16QI 2 "register_operand" "v") + (match_operand:V16QI 3 "comparison_operator" "") + (match_operand:V16QI 4 "register_operand" "v") + (match_operand:V16QI 5 "register_operand" "v") + ] UNSPEC_VCONDU_V16QI))] + "TARGET_ALTIVEC" + " +{ + if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], + operands[3], operands[4], operands[5])) + DONE; + else + FAIL; +} + ") + + +(define_insn "altivec_vsel_v4si" [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 159))] + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VSEL4SI))] "TARGET_ALTIVEC" "vsel %0,%1,%2,%3" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsel_4sf" +(define_insn "altivec_vsel_v4sf" [(set (match_operand:V4SF 0 "register_operand" "=v") (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v") (match_operand:V4SF 2 "register_operand" "v") - (match_operand:V4SI 3 "register_operand" "v")] 160))] + (match_operand:V4SI 3 "register_operand" "v")] + UNSPEC_VSEL4SF))] "TARGET_ALTIVEC" "vsel %0,%1,%2,%3" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsel_8hi" +(define_insn "altivec_vsel_v8hi" [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") - (match_operand:V8HI 3 "register_operand" "v")] 161))] + (match_operand:V8HI 3 "register_operand" "v")] + UNSPEC_VSEL8HI))] "TARGET_ALTIVEC" "vsel %0,%1,%2,%3" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsel_16qi" +(define_insn "altivec_vsel_v16qi" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") (match_operand:V16QI 2 "register_operand" "v") - (match_operand:V16QI 3 "register_operand" "v")] 162))] + (match_operand:V16QI 3 "register_operand" "v")] + UNSPEC_VSEL16QI))] "TARGET_ALTIVEC" "vsel %0,%1,%2,%3" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsldoi_4si" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v") - (match_operand:QI 3 "immediate_operand" "i")] 163))] - "TARGET_ALTIVEC" - "vsldoi %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vsldoi_4sf" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v") - (match_operand:QI 3 "immediate_operand" "i")] 164))] - "TARGET_ALTIVEC" - "vsldoi %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vsldoi_8hi" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand:QI 3 "immediate_operand" "i")] 165))] - "TARGET_ALTIVEC" - "vsldoi %0,%1,%2,%3" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vsldoi_16qi" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v") - (match_operand:QI 3 "immediate_operand" "i")] 166))] +(define_insn "altivec_vsldoi_" + [(set (match_operand:V 0 "register_operand" "=v") + (unspec:V [(match_operand:V 1 "register_operand" "v") + (match_operand:V 2 "register_operand" "v") + (match_operand:QI 3 "immediate_operand" "i")] + UNSPEC_VLSDOI))] "TARGET_ALTIVEC" "vsldoi %0,%1,%2,%3" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupkhsb" [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 167))] + (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] + UNSPEC_VUPKHSB))] "TARGET_ALTIVEC" "vupkhsb %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupkhpx" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 168))] + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] + UNSPEC_VUPKHPX))] "TARGET_ALTIVEC" "vupkhpx %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupkhsh" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 169))] + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] + UNSPEC_VUPKHSH))] "TARGET_ALTIVEC" "vupkhsh %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupklsb" [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 170))] + (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] + UNSPEC_VUPKLSB))] "TARGET_ALTIVEC" "vupklsb %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupklpx" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 171))] + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] + UNSPEC_VUPKLPX))] "TARGET_ALTIVEC" "vupklpx %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vupklsh" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 172))] + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] + UNSPEC_VUPKLSH))] "TARGET_ALTIVEC" "vupklsh %0,%1" [(set_attr "type" "vecperm")]) @@ -1714,42 +1685,12 @@ ;; We can get away with generating the opcode on the fly (%3 below) ;; because all the predicates have the same scheduling parameters. -(define_insn "altivec_predicate_v4si" +(define_insn "altivec_predicate_" [(set (reg:CC 74) - (unspec:CC [(match_operand:V4SI 1 "register_operand" "v") - (match_operand:V4SI 2 "register_operand" "v") - (match_operand 3 "any_operand" "")] 173)) - (clobber (match_scratch:V4SI 0 "=v"))] - "TARGET_ALTIVEC" - "%3 %0,%1,%2" -[(set_attr "type" "veccmp")]) - -(define_insn "altivec_predicate_v4sf" - [(set (reg:CC 74) - (unspec:CC [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v") - (match_operand 3 "any_operand" "")] 174)) - (clobber (match_scratch:V4SF 0 "=v"))] - "TARGET_ALTIVEC" - "%3 %0,%1,%2" -[(set_attr "type" "veccmp")]) - -(define_insn "altivec_predicate_v8hi" - [(set (reg:CC 74) - (unspec:CC [(match_operand:V8HI 1 "register_operand" "v") - (match_operand:V8HI 2 "register_operand" "v") - (match_operand 3 "any_operand" "")] 175)) - (clobber (match_scratch:V8HI 0 "=v"))] - "TARGET_ALTIVEC" - "%3 %0,%1,%2" -[(set_attr "type" "veccmp")]) - -(define_insn "altivec_predicate_v16qi" - [(set (reg:CC 74) - (unspec:CC [(match_operand:V16QI 1 "register_operand" "v") - (match_operand:V16QI 2 "register_operand" "v") - (match_operand 3 "any_operand" "")] 175)) - (clobber (match_scratch:V16QI 0 "=v"))] + (unspec:CC [(match_operand:V 1 "register_operand" "v") + (match_operand:V 2 "register_operand" "v") + (match_operand 3 "any_operand" "")] UNSPEC_PREDICATE)) + (clobber (match_scratch:V 0 "=v"))] "TARGET_ALTIVEC" "%3 %0,%1,%2" [(set_attr "type" "veccmp")]) @@ -1757,102 +1698,114 @@ (define_insn "altivec_mtvscr" [(set (reg:SI 110) (unspec_volatile:SI - [(match_operand:V4SI 0 "register_operand" "v")] 186))] + [(match_operand:V4SI 0 "register_operand" "v")] UNSPECV_MTVSCR))] "TARGET_ALTIVEC" "mtvscr %0" [(set_attr "type" "vecsimple")]) (define_insn "altivec_mfvscr" [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec_volatile:V8HI [(reg:SI 110)] 187))] + (unspec_volatile:V8HI [(reg:SI 110)] UNSPECV_MFVSCR))] "TARGET_ALTIVEC" "mfvscr %0" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dssall" - [(unspec [(const_int 0)] 188)] + [(unspec_volatile [(const_int 0)] UNSPECV_DSSALL)] "TARGET_ALTIVEC" "dssall" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dss" - [(unspec [(match_operand:QI 0 "immediate_operand" "i")] 189)] + [(unspec_volatile [(match_operand:QI 0 "immediate_operand" "i")] + UNSPECV_DSS)] "TARGET_ALTIVEC" "dss %0" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dst" - [(unspec [(match_operand:V4SI 0 "memory_operand" "Q") + [(unspec [(match_operand 0 "register_operand" "b") (match_operand:SI 1 "register_operand" "r") - (match_operand:QI 2 "immediate_operand" "i")] 190)] - "TARGET_ALTIVEC" - "dst %P0,%1,%2" + (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DST)] + "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode" + "dst %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dstt" - [(unspec [(match_operand:V4SI 0 "memory_operand" "Q") + [(unspec [(match_operand 0 "register_operand" "b") (match_operand:SI 1 "register_operand" "r") - (match_operand:QI 2 "immediate_operand" "i")] 191)] - "TARGET_ALTIVEC" - "dstt %P0,%1,%2" + (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTT)] + "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode" + "dstt %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dstst" - [(unspec [(match_operand:V4SI 0 "memory_operand" "Q") + [(unspec [(match_operand 0 "register_operand" "b") (match_operand:SI 1 "register_operand" "r") - (match_operand:QI 2 "immediate_operand" "i")] 192)] - "TARGET_ALTIVEC" - "dstst %P0,%1,%2" + (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTST)] + "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode" + "dstst %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_dststt" - [(unspec [(match_operand:V4SI 0 "memory_operand" "Q") + [(unspec [(match_operand 0 "register_operand" "b") (match_operand:SI 1 "register_operand" "r") - (match_operand:QI 2 "immediate_operand" "i")] 193)] - "TARGET_ALTIVEC" - "dststt %P0,%1,%2" + (match_operand:QI 2 "immediate_operand" "i")] UNSPEC_DSTSTT)] + "TARGET_ALTIVEC && GET_MODE (operands[0]) == Pmode" + "dststt %0,%1,%2" [(set_attr "type" "vecsimple")]) (define_insn "altivec_lvsl" [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand 1 "memory_operand" "m")] 194))] + (unspec:V16QI [(match_operand 1 "memory_operand" "Z")] UNSPEC_LVSL))] "TARGET_ALTIVEC" "lvsl %0,%y1" [(set_attr "type" "vecload")]) (define_insn "altivec_lvsr" [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand 1 "memory_operand" "m")] 195))] + (unspec:V16QI [(match_operand 1 "memory_operand" "Z")] UNSPEC_LVSR))] "TARGET_ALTIVEC" "lvsr %0,%y1" [(set_attr "type" "vecload")]) +(define_expand "build_vector_mask_for_load" + [(set (match_operand:V16QI 0 "register_operand" "") + (unspec:V16QI [(match_operand 1 "memory_operand" "")] UNSPEC_LVSR))] + "TARGET_ALTIVEC" + " +{ + rtx addr; + rtx temp; + + gcc_assert (GET_CODE (operands[1]) == MEM); + + addr = XEXP (operands[1], 0); + temp = gen_reg_rtx (GET_MODE (addr)); + emit_insn (gen_rtx_SET (VOIDmode, temp, + gen_rtx_NEG (GET_MODE (addr), addr))); + emit_insn (gen_altivec_lvsr (operands[0], + replace_equiv_address (operands[1], temp))); + DONE; +}") + ;; Parallel some of the LVE* and STV*'s with unspecs because some have ;; identical rtl but different instructions-- and gcc gets confused. -(define_insn "altivec_lvebx" +(define_insn "altivec_lvex" [(parallel - [(set (match_operand:V16QI 0 "register_operand" "=v") - (match_operand:V16QI 1 "memory_operand" "m")) - (unspec [(const_int 0)] 196)])] + [(set (match_operand:VI 0 "register_operand" "=v") + (match_operand:VI 1 "memory_operand" "Z")) + (unspec [(const_int 0)] UNSPEC_LVE)])] "TARGET_ALTIVEC" - "lvebx %0,%y1" + "lvex %0,%y1" [(set_attr "type" "vecload")]) -(define_insn "altivec_lvehx" +(define_insn "*altivec_lvesfx" [(parallel - [(set (match_operand:V8HI 0 "register_operand" "=v") - (match_operand:V8HI 1 "memory_operand" "m")) - (unspec [(const_int 0)] 197)])] - "TARGET_ALTIVEC" - "lvehx %0,%y1" - [(set_attr "type" "vecload")]) - -(define_insn "altivec_lvewx" - [(parallel - [(set (match_operand:V4SI 0 "register_operand" "=v") - (match_operand:V4SI 1 "memory_operand" "m")) - (unspec [(const_int 0)] 198)])] + [(set (match_operand:V4SF 0 "register_operand" "=v") + (match_operand:V4SF 1 "memory_operand" "Z")) + (unspec [(const_int 0)] UNSPEC_LVE)])] "TARGET_ALTIVEC" "lvewx %0,%y1" [(set_attr "type" "vecload")]) @@ -1860,130 +1813,412 @@ (define_insn "altivec_lvxl" [(parallel [(set (match_operand:V4SI 0 "register_operand" "=v") - (match_operand:V4SI 1 "memory_operand" "m")) - (unspec [(const_int 0)] 213)])] + (match_operand:V4SI 1 "memory_operand" "Z")) + (unspec [(const_int 0)] UNSPEC_SET_VSCR)])] "TARGET_ALTIVEC" "lvxl %0,%y1" [(set_attr "type" "vecload")]) (define_insn "altivec_lvx" [(set (match_operand:V4SI 0 "register_operand" "=v") - (match_operand:V4SI 1 "memory_operand" "m"))] + (match_operand:V4SI 1 "memory_operand" "Z"))] "TARGET_ALTIVEC" "lvx %0,%y1" [(set_attr "type" "vecload")]) (define_insn "altivec_stvx" [(parallel - [(set (match_operand:V4SI 0 "memory_operand" "=m") + [(set (match_operand:V4SI 0 "memory_operand" "=Z") (match_operand:V4SI 1 "register_operand" "v")) - (unspec [(const_int 0)] 201)])] + (unspec [(const_int 0)] UNSPEC_STVX)])] "TARGET_ALTIVEC" "stvx %1,%y0" [(set_attr "type" "vecstore")]) (define_insn "altivec_stvxl" [(parallel - [(set (match_operand:V4SI 0 "memory_operand" "=m") + [(set (match_operand:V4SI 0 "memory_operand" "=Z") (match_operand:V4SI 1 "register_operand" "v")) - (unspec [(const_int 0)] 202)])] + (unspec [(const_int 0)] UNSPEC_STVXL)])] "TARGET_ALTIVEC" "stvxl %1,%y0" [(set_attr "type" "vecstore")]) -(define_insn "altivec_stvebx" +(define_insn "altivec_stvex" [(parallel - [(set (match_operand:V16QI 0 "memory_operand" "=m") - (match_operand:V16QI 1 "register_operand" "v")) - (unspec [(const_int 0)] 203)])] + [(set (match_operand:VI 0 "memory_operand" "=Z") + (match_operand:VI 1 "register_operand" "v")) + (unspec [(const_int 0)] UNSPEC_STVE)])] "TARGET_ALTIVEC" - "stvebx %1,%y0" + "stvex %1,%y0" [(set_attr "type" "vecstore")]) -(define_insn "altivec_stvehx" +(define_insn "*altivec_stvesfx" [(parallel - [(set (match_operand:V8HI 0 "memory_operand" "=m") - (match_operand:V8HI 1 "register_operand" "v")) - (unspec [(const_int 0)] 204)])] - "TARGET_ALTIVEC" - "stvehx %1,%y0" - [(set_attr "type" "vecstore")]) - -(define_insn "altivec_stvewx" - [(parallel - [(set (match_operand:V4SI 0 "memory_operand" "=m") - (match_operand:V4SI 1 "register_operand" "v")) - (unspec [(const_int 0)] 205)])] + [(set (match_operand:V4SF 0 "memory_operand" "=Z") + (match_operand:V4SF 1 "register_operand" "v")) + (unspec [(const_int 0)] UNSPEC_STVE)])] "TARGET_ALTIVEC" "stvewx %1,%y0" [(set_attr "type" "vecstore")]) -(define_insn "absv16qi2" +(define_expand "vec_init" + [(match_operand:V 0 "register_operand" "") + (match_operand 1 "" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_init (operands[0], operands[1]); + DONE; +}) + +(define_expand "vec_setv4si" + [(match_operand:V4SI 0 "register_operand" "") + (match_operand:SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_setv8hi" + [(match_operand:V8HI 0 "register_operand" "") + (match_operand:HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_setv16qi" + [(match_operand:V16QI 0 "register_operand" "") + (match_operand:QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_setv4sf" + [(match_operand:V4SF 0 "register_operand" "") + (match_operand:SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv4si" + [(match_operand:SI 0 "register_operand" "") + (match_operand:V4SI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv8hi" + [(match_operand:HI 0 "register_operand" "") + (match_operand:V8HI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv16qi" + [(match_operand:QI 0 "register_operand" "") + (match_operand:V16QI 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +(define_expand "vec_extractv4sf" + [(match_operand:SF 0 "register_operand" "") + (match_operand:V4SF 1 "register_operand" "") + (match_operand 2 "const_int_operand" "")] + "TARGET_ALTIVEC" +{ + rs6000_expand_vector_extract (operands[0], operands[1], INTVAL (operands[2])); + DONE; +}) + +;; Generate +;; vspltis? SCRATCH0,0 +;; vsubu?m SCRATCH2,SCRATCH1,%1 +;; vmaxs? %0,%1,SCRATCH2" +(define_expand "abs2" + [(set (match_dup 2) (vec_duplicate:VI (const_int 0))) + (set (match_dup 3) + (minus:VI (match_dup 2) + (match_operand:VI 1 "register_operand" "v"))) + (set (match_operand:VI 0 "register_operand" "=v") + (smax:VI (match_dup 1) (match_dup 3)))] + "TARGET_ALTIVEC" +{ + operands[2] = gen_reg_rtx (GET_MODE (operands[0])); + operands[3] = gen_reg_rtx (GET_MODE (operands[0])); +}) + +;; Generate +;; vspltisw SCRATCH1,-1 +;; vslw SCRATCH2,SCRATCH1,SCRATCH1 +;; vandc %0,%1,SCRATCH2 +(define_expand "absv4sf2" + [(set (match_dup 2) + (vec_duplicate:V4SI (const_int -1))) + (set (match_dup 3) + (unspec:V4SI [(match_dup 2) (match_dup 2)] UNSPEC_VSL)) + (set (match_operand:V4SF 0 "register_operand" "=v") + (and:V4SF (not:V4SF (subreg:V4SF (match_dup 3) 0)) + (match_operand:V4SF 1 "register_operand" "v")))] + "TARGET_ALTIVEC" +{ + operands[2] = gen_reg_rtx (V4SImode); + operands[3] = gen_reg_rtx (V4SImode); +}) + +;; Generate +;; vspltis? SCRATCH0,0 +;; vsubs?s SCRATCH2,SCRATCH1,%1 +;; vmaxs? %0,%1,SCRATCH2" +(define_expand "altivec_abss_" + [(set (match_dup 2) (vec_duplicate:VI (const_int 0))) + (parallel [(set (match_dup 3) + (unspec:VI [(match_dup 2) + (match_operand:VI 1 "register_operand" "v")] + UNSPEC_VSUBS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]) + (set (match_operand:VI 0 "register_operand" "=v") + (smax:VI (match_dup 1) (match_dup 3)))] + "TARGET_ALTIVEC" +{ + operands[2] = gen_reg_rtx (GET_MODE (operands[0])); + operands[3] = gen_reg_rtx (GET_MODE (operands[0])); +}) + +;; Vector shift left in bits. Currently supported ony for shift +;; amounts that can be expressed as byte shifts (divisible by 8). +;; General shift amounts can be supported using vslo + vsl. We're +;; not expecting to see these yet (the vectorizer currently +;; generates only shifts divisible by byte_size). +(define_expand "vec_shl_" + [(set (match_operand:V 0 "register_operand" "=v") + (unspec:V [(match_operand:V 1 "register_operand" "v") + (match_operand:QI 2 "reg_or_short_operand" "")] + UNSPEC_VECSH))] + "TARGET_ALTIVEC" + " +{ + rtx bitshift = operands[2]; + rtx byteshift = gen_reg_rtx (QImode); + HOST_WIDE_INT bitshift_val; + HOST_WIDE_INT byteshift_val; + + if (! CONSTANT_P (bitshift)) + FAIL; + bitshift_val = INTVAL (bitshift); + if (bitshift_val & 0x7) + FAIL; + byteshift_val = bitshift_val >> 3; + byteshift = gen_rtx_CONST_INT (QImode, byteshift_val); + emit_insn (gen_altivec_vsldoi_ (operands[0], operands[1], operands[1], + byteshift)); + DONE; +}") + +;; Vector shift left in bits. Currently supported ony for shift +;; amounts that can be expressed as byte shifts (divisible by 8). +;; General shift amounts can be supported using vsro + vsr. We're +;; not expecting to see these yet (the vectorizer currently +;; generates only shifts divisible by byte_size). +(define_expand "vec_shr_" + [(set (match_operand:V 0 "register_operand" "=v") + (unspec:V [(match_operand:V 1 "register_operand" "v") + (match_operand:QI 2 "reg_or_short_operand" "")] + UNSPEC_VECSH))] + "TARGET_ALTIVEC" + " +{ + rtx bitshift = operands[2]; + rtx byteshift = gen_reg_rtx (QImode); + HOST_WIDE_INT bitshift_val; + HOST_WIDE_INT byteshift_val; + + if (! CONSTANT_P (bitshift)) + FAIL; + bitshift_val = INTVAL (bitshift); + if (bitshift_val & 0x7) + FAIL; + byteshift_val = 16 - (bitshift_val >> 3); + byteshift = gen_rtx_CONST_INT (QImode, byteshift_val); + emit_insn (gen_altivec_vsldoi_ (operands[0], operands[1], operands[1], + byteshift)); + DONE; +}") + +(define_insn "altivec_vsumsws_nomode" + [(set (match_operand 0 "register_operand" "=v") + (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") + (match_operand:V4SI 2 "register_operand" "v")] + UNSPEC_VSUMSWS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] + "TARGET_ALTIVEC" + "vsumsws %0,%1,%2" + [(set_attr "type" "veccomplex")]) + +(define_expand "reduc_splus_" + [(set (match_operand:VIshort 0 "register_operand" "=v") + (unspec:VIshort [(match_operand:VIshort 1 "register_operand" "v")] + UNSPEC_REDUC_PLUS))] + "TARGET_ALTIVEC" + " +{ + rtx vzero = gen_reg_rtx (V4SImode); + rtx vtmp1 = gen_reg_rtx (V4SImode); + + emit_insn (gen_altivec_vspltisw (vzero, const0_rtx)); + emit_insn (gen_altivec_vsum4ss (vtmp1, operands[1], vzero)); + emit_insn (gen_altivec_vsumsws_nomode (operands[0], vtmp1, vzero)); + DONE; +}") + +(define_expand "reduc_uplus_v16qi" [(set (match_operand:V16QI 0 "register_operand" "=v") - (abs:V16QI (match_operand:V16QI 1 "register_operand" "v"))) - (clobber (match_scratch:V16QI 2 "=&v")) - (clobber (match_scratch:V16QI 3 "=&v"))] + (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")] + UNSPEC_REDUC_PLUS))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsububm %3,%2,%1\;vmaxsb %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) + " +{ + rtx vzero = gen_reg_rtx (V4SImode); + rtx vtmp1 = gen_reg_rtx (V4SImode); -(define_insn "absv8hi2" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (abs:V8HI (match_operand:V8HI 1 "register_operand" "v"))) - (clobber (match_scratch:V8HI 2 "=&v")) - (clobber (match_scratch:V8HI 3 "=&v"))] + emit_insn (gen_altivec_vspltisw (vzero, const0_rtx)); + emit_insn (gen_altivec_vsum4ubs (vtmp1, operands[1], vzero)); + emit_insn (gen_altivec_vsumsws_nomode (operands[0], vtmp1, vzero)); + DONE; +}") + +(define_insn "vec_realign_load_" + [(set (match_operand:V 0 "register_operand" "=v") + (unspec:V [(match_operand:V 1 "register_operand" "v") + (match_operand:V 2 "register_operand" "v") + (match_operand:V16QI 3 "register_operand" "v")] + UNSPEC_REALIGN_LOAD))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubuhm %3,%2,%1\;vmaxsh %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) + "vperm %0,%1,%2,%3" + [(set_attr "type" "vecperm")]) -(define_insn "absv4si2" +(define_expand "neg2" + [(use (match_operand:VI 0 "register_operand" "")) + (use (match_operand:VI 1 "register_operand" ""))] + "TARGET_ALTIVEC" + " +{ + rtx vzero; + + vzero = gen_reg_rtx (GET_MODE (operands[0])); + emit_insn (gen_altivec_vspltis (vzero, const0_rtx)); + emit_insn (gen_sub3 (operands[0], vzero, operands[1])); + + DONE; +}") + +(define_expand "udot_prod" [(set (match_operand:V4SI 0 "register_operand" "=v") - (abs:V4SI (match_operand:V4SI 1 "register_operand" "v"))) - (clobber (match_scratch:V4SI 2 "=&v")) - (clobber (match_scratch:V4SI 3 "=&v"))] + (plus:V4SI (match_operand:V4SI 3 "register_operand" "v") + (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v") + (match_operand:VIshort 2 "register_operand" "v")] + UNSPEC_VMSUMU)))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubuwm %3,%2,%1\;vmaxsw %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) - -(define_insn "absv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (abs:V4SF (match_operand:V4SF 1 "register_operand" "v"))) - (clobber (match_scratch:V4SF 2 "=&v")) - (clobber (match_scratch:V4SF 3 "=&v"))] - "TARGET_ALTIVEC" - "vspltisw %2,-1\;vslw %3,%2,%2\;vandc %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) - -(define_insn "altivec_abss_v16qi" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")] 210)) - (clobber (match_scratch:V16QI 2 "=&v")) - (clobber (match_scratch:V16QI 3 "=&v"))] - "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubsbs %3,%2,%1\;vmaxsb %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) - -(define_insn "altivec_abss_v8hi" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")] 211)) - (clobber (match_scratch:V8HI 2 "=&v")) - (clobber (match_scratch:V8HI 3 "=&v"))] - "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubshs %3,%2,%1\;vmaxsh %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) - -(define_insn "altivec_abss_v4si" + " +{ + emit_insn (gen_altivec_vmsumum (operands[0], operands[1], operands[2], operands[3])); + DONE; +}") + +(define_expand "sdot_prodv8hi" [(set (match_operand:V4SI 0 "register_operand" "=v") - (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")] 212)) - (clobber (match_scratch:V4SI 2 "=&v")) - (clobber (match_scratch:V4SI 3 "=&v"))] + (plus:V4SI (match_operand:V4SI 3 "register_operand" "v") + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") + (match_operand:V8HI 2 "register_operand" "v")] + UNSPEC_VMSUMSHM)))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubsws %3,%2,%1\;vmaxsw %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) + " +{ + emit_insn (gen_altivec_vmsumshm (operands[0], operands[1], operands[2], operands[3])); + DONE; +}") + +(define_expand "widen_usum3" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (plus:V4SI (match_operand:V4SI 2 "register_operand" "v") + (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v")] + UNSPEC_VMSUMU)))] + "TARGET_ALTIVEC" + " +{ + rtx vones = gen_reg_rtx (GET_MODE (operands[1])); + + emit_insn (gen_altivec_vspltis (vones, const1_rtx)); + emit_insn (gen_altivec_vmsumum (operands[0], operands[1], vones, operands[2])); + DONE; +}") + +(define_expand "widen_ssumv16qi3" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (plus:V4SI (match_operand:V4SI 2 "register_operand" "v") + (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")] + UNSPEC_VMSUMM)))] + "TARGET_ALTIVEC" + " +{ + rtx vones = gen_reg_rtx (V16QImode); + + emit_insn (gen_altivec_vspltisb (vones, const1_rtx)); + emit_insn (gen_altivec_vmsummbm (operands[0], operands[1], vones, operands[2])); + DONE; +}") + +(define_expand "widen_ssumv8hi3" + [(set (match_operand:V4SI 0 "register_operand" "=v") + (plus:V4SI (match_operand:V4SI 2 "register_operand" "v") + (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] + UNSPEC_VMSUMSHM)))] + "TARGET_ALTIVEC" + " +{ + rtx vones = gen_reg_rtx (V8HImode); + + emit_insn (gen_altivec_vspltish (vones, const1_rtx)); + emit_insn (gen_altivec_vmsumshm (operands[0], operands[1], vones, operands[2])); + DONE; +}") + +(define_expand "negv4sf2" + [(use (match_operand:V4SF 0 "register_operand" "")) + (use (match_operand:V4SF 1 "register_operand" ""))] + "TARGET_ALTIVEC" + " +{ + rtx neg0; + + /* Generate [-0.0, -0.0, -0.0, -0.0]. */ + neg0 = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (neg0, constm1_rtx)); + emit_insn (gen_altivec_vslw (neg0, neg0, neg0)); + + /* XOR */ + emit_insn (gen_xorv4sf3 (operands[0], + gen_lowpart (V4SFmode, neg0), operands[1])); + + DONE; +}") diff --git a/contrib/gcc/config/rs6000/beos.h b/contrib/gcc/config/rs6000/beos.h index a9e88ac2f32..cea5ca87352 100644 --- a/contrib/gcc/config/rs6000/beos.h +++ b/contrib/gcc/config/rs6000/beos.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler, for BeOS. - Copyright (C) 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2001, 2002, 2003, 2005 + Free Software Foundation, Inc. Contributed by Fred Fish (fnf@cygnus.com), based on aix41.h from David Edelsohn (edelsohn@npac.syr.edu). @@ -17,8 +18,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (BeOS/PowerPC)"); diff --git a/contrib/gcc/config/rs6000/biarch64.h b/contrib/gcc/config/rs6000/biarch64.h index 3f8addd5ac9..c5cb5981fb6 100644 --- a/contrib/gcc/config/rs6000/biarch64.h +++ b/contrib/gcc/config/rs6000/biarch64.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Specify this in a cover file to provide bi-architecture (32/64) support. */ #define RS6000_BI_ARCH 1 diff --git a/contrib/gcc/config/rs6000/constraints.md b/contrib/gcc/config/rs6000/constraints.md new file mode 100644 index 00000000000..a7d46611813 --- /dev/null +++ b/contrib/gcc/config/rs6000/constraints.md @@ -0,0 +1,162 @@ +;; Constraint definitions for RS6000 +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Register constraints + +(define_register_constraint "f" "TARGET_HARD_FLOAT && TARGET_FPRS + ? FLOAT_REGS : NO_REGS" + "@internal") + +(define_register_constraint "b" "BASE_REGS" + "@internal") + +(define_register_constraint "h" "SPECIAL_REGS" + "@internal") + +(define_register_constraint "q" "MQ_REGS" + "@internal") + +(define_register_constraint "c" "CTR_REGS" + "@internal") + +(define_register_constraint "l" "LINK_REGS" + "@internal") + +(define_register_constraint "v" "ALTIVEC_REGS" + "@internal") + +(define_register_constraint "x" "CR0_REGS" + "@internal") + +(define_register_constraint "y" "CR_REGS" + "@internal") + +(define_register_constraint "z" "XER_REGS" + "@internal") + +;; Integer constraints + +(define_constraint "I" + "A signed 16-bit constant" + (and (match_code "const_int") + (match_test "(unsigned HOST_WIDE_INT) (ival + 0x8000) < 0x10000"))) + +(define_constraint "J" + "high-order 16 bits nonzero" + (and (match_code "const_int") + (match_test "(ival & (~ (unsigned HOST_WIDE_INT) 0xffff0000)) == 0"))) + +(define_constraint "K" + "low-order 16 bits nonzero" + (and (match_code "const_int") + (match_test "(ival & (~ (HOST_WIDE_INT) 0xffff)) == 0"))) + +(define_constraint "L" + "signed 16-bit constant shifted left 16 bits" + (and (match_code "const_int") + (match_test "((ival & 0xffff) == 0 + && (ival >> 31 == -1 || ival >> 31 == 0))"))) + +(define_constraint "M" + "constant greater than 31" + (and (match_code "const_int") + (match_test "ival > 31"))) + +(define_constraint "N" + "positive constant that is an exact power of two" + (and (match_code "const_int") + (match_test "ival > 0 && exact_log2 (ival) >= 0"))) + +(define_constraint "O" + "constant zero" + (and (match_code "const_int") + (match_test "ival == 0"))) + +(define_constraint "P" + "constant whose negation is signed 16-bit constant" + (and (match_code "const_int") + (match_test "(unsigned HOST_WIDE_INT) ((- ival) + 0x8000) < 0x10000"))) + +;; Floating-point constraints + +(define_constraint "G" + "Constant that can be copied into GPR with two insns for DF/DI + and one for SF." + (and (match_code "const_double") + (match_test "num_insns_constant (op, mode) + == (mode == SFmode ? 1 : 2)"))) + +(define_constraint "H" + "DF/DI constant that takes three insns." + (and (match_code "const_double") + (match_test "num_insns_constant (op, mode) == 3"))) + +;; Memory constraints + +(define_memory_constraint "Q" + "Memory operand that is just an offset from a reg" + (and (match_code "mem") + (match_test "GET_CODE (XEXP (op, 0)) == REG"))) + +(define_memory_constraint "Y" + "Indexed or word-aligned displacement memory operand" + (match_operand 0 "word_offset_memref_operand")) + +(define_memory_constraint "Z" + "Indexed or indirect memory operand" + (match_operand 0 "indexed_or_indirect_operand")) + +;; Address constraints + +(define_address_constraint "a" + "Indexed or indirect address operand" + (match_operand 0 "indexed_or_indirect_address")) + +(define_constraint "R" + "AIX TOC entry" + (match_test "legitimate_constant_pool_address_p (op)")) + +;; General constraints + +(define_constraint "S" + "Constant that can be placed into a 64-bit mask operand" + (match_operand 0 "mask64_operand")) + +(define_constraint "T" + "Constant that can be placed into a 32-bit mask operand" + (match_operand 0 "mask_operand")) + +(define_constraint "U" + "V.4 small data reference" + (and (match_test "DEFAULT_ABI == ABI_V4") + (match_operand 0 "small_data_operand"))) + +(define_constraint "t" + "AND masks that can be performed by two rldic{l,r} insns + (but excluding those that could match other constraints of anddi3)" + (and (and (and (match_operand 0 "mask64_2_operand") + (match_test "(fixed_regs[CR0_REGNO] + || !logical_operand (op, DImode))")) + (not (match_operand 0 "mask_operand"))) + (not (match_operand 0 "mask64_operand")))) + +(define_constraint "W" + "vector constant that does not require memory" + (match_operand 0 "easy_vector_constant")) diff --git a/contrib/gcc/config/rs6000/crtsavres.asm b/contrib/gcc/config/rs6000/crtsavres.asm index 327048eb287..498759d27d8 100644 --- a/contrib/gcc/config/rs6000/crtsavres.asm +++ b/contrib/gcc/config/rs6000/crtsavres.asm @@ -25,8 +25,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/darwin-asm.h b/contrib/gcc/config/rs6000/darwin-asm.h new file mode 100644 index 00000000000..401b4f81b51 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-asm.h @@ -0,0 +1,61 @@ +/* Macro definitions to used to support 32/64-bit code in Darwin's + * assembly files. + * + * Copyright (C) 2004 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause the + * resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why the + * executable file might be covered by the GNU General Public License. + */ + +/* These are donated from /usr/include/architecture/ppc . */ + +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define cmpg MODE_CHOICE(cmpw, cmpd) +#define lg MODE_CHOICE(lwz, ld) +#define stg MODE_CHOICE(stw, std) +#define lgx MODE_CHOICE(lwzx, ldx) +#define stgx MODE_CHOICE(stwx, stdx) +#define lgu MODE_CHOICE(lwzu, ldu) +#define stgu MODE_CHOICE(stwu, stdu) +#define lgux MODE_CHOICE(lwzux, ldux) +#define stgux MODE_CHOICE(stwux, stdux) +#define lgwa MODE_CHOICE(lwz, lwa) + +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +#define GPR_BYTES MODE_CHOICE(4,8) /* size of a GPR in bytes */ +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ + +#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* position of saved + LR in frame */ diff --git a/contrib/gcc/config/rs6000/darwin-fallback.c b/contrib/gcc/config/rs6000/darwin-fallback.c new file mode 100644 index 00000000000..5d3de322475 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-fallback.c @@ -0,0 +1,471 @@ +/* Fallback frame-state unwinder for Darwin. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "tconfig.h" +#include "tsystem.h" +#include "coretypes.h" +#include "tm.h" +#include "dwarf2.h" +#include "unwind.h" +#include "unwind-dw2.h" +#include +#include +#include +#include + +typedef unsigned long reg_unit; + +/* Place in GPRS the parameters to the first 'sc' instruction that would + have been executed if we were returning from this CONTEXT, or + return false if an unexpected instruction is encountered. */ + +static bool +interpret_libc (reg_unit gprs[32], struct _Unwind_Context *context) +{ + uint32_t *pc = (uint32_t *)_Unwind_GetIP (context); + uint32_t cr; + reg_unit lr = (reg_unit) pc; + reg_unit ctr = 0; + uint32_t *invalid_address = NULL; + + int i; + + for (i = 0; i < 13; i++) + gprs[i] = 1; + gprs[1] = _Unwind_GetCFA (context); + for (; i < 32; i++) + gprs[i] = _Unwind_GetGR (context, i); + cr = _Unwind_GetGR (context, CR2_REGNO); + + /* For each supported Libc, we have to track the code flow + all the way back into the kernel. + + This code is believed to support all released Libc/Libsystem builds since + Jaguar 6C115, including all the security updates. To be precise, + + Libc Libsystem Build(s) + 262~1 60~37 6C115 + 262~1 60.2~4 6D52 + 262~1 61~3 6F21-6F22 + 262~1 63~24 6G30-6G37 + 262~1 63~32 6I34-6I35 + 262~1 63~64 6L29-6L60 + 262.4.1~1 63~84 6L123-6R172 + + 320~1 71~101 7B85-7D28 + 320~1 71~266 7F54-7F56 + 320~1 71~288 7F112 + 320~1 71~289 7F113 + 320.1.3~1 71.1.1~29 7H60-7H105 + 320.1.3~1 71.1.1~30 7H110-7H113 + 320.1.3~1 71.1.1~31 7H114 + + That's a big table! It would be insane to try to keep track of + every little detail, so we just read the code itself and do what + it would do. + */ + + for (;;) + { + uint32_t ins = *pc++; + + if ((ins & 0xFC000003) == 0x48000000) /* b instruction */ + { + pc += ((((int32_t) ins & 0x3FFFFFC) ^ 0x2000000) - 0x2000004) / 4; + continue; + } + if ((ins & 0xFC600000) == 0x2C000000) /* cmpwi */ + { + int32_t val1 = (int16_t) ins; + int32_t val2 = gprs[ins >> 16 & 0x1F]; + /* Only beq and bne instructions are supported, so we only + need to set the EQ bit. */ + uint32_t mask = 0xF << ((ins >> 21 & 0x1C) ^ 0x1C); + if (val1 == val2) + cr |= mask; + else + cr &= ~mask; + continue; + } + if ((ins & 0xFEC38003) == 0x40820000) /* forwards beq/bne */ + { + if ((cr >> ((ins >> 16 & 0x1F) ^ 0x1F) & 1) == (ins >> 24 & 1)) + pc += (ins & 0x7FFC) / 4 - 1; + continue; + } + if ((ins & 0xFC0007FF) == 0x7C000378) /* or, including mr */ + { + gprs [ins >> 16 & 0x1F] = (gprs [ins >> 11 & 0x1F] + | gprs [ins >> 21 & 0x1F]); + continue; + } + if (ins >> 26 == 0x0E) /* addi, including li */ + { + reg_unit src = (ins >> 16 & 0x1F) == 0 ? 0 : gprs [ins >> 16 & 0x1F]; + gprs [ins >> 21 & 0x1F] = src + (int16_t) ins; + continue; + } + if (ins >> 26 == 0x0F) /* addis, including lis */ + { + reg_unit src = (ins >> 16 & 0x1F) == 0 ? 0 : gprs [ins >> 16 & 0x1F]; + gprs [ins >> 21 & 0x1F] = src + ((int16_t) ins << 16); + continue; + } + if (ins >> 26 == 0x20) /* lwz */ + { + reg_unit src = (ins >> 16 & 0x1F) == 0 ? 0 : gprs [ins >> 16 & 0x1F]; + uint32_t *p = (uint32_t *)(src + (int16_t) ins); + if (p == invalid_address) + return false; + gprs [ins >> 21 & 0x1F] = *p; + continue; + } + if (ins >> 26 == 0x21) /* lwzu */ + { + uint32_t *p = (uint32_t *)(gprs [ins >> 16 & 0x1F] += (int16_t) ins); + if (p == invalid_address) + return false; + gprs [ins >> 21 & 0x1F] = *p; + continue; + } + if (ins >> 26 == 0x24) /* stw */ + /* What we hope this is doing is '--in_sigtramp'. We don't want + to actually store to memory, so just make a note of the + address and refuse to load from it. */ + { + reg_unit src = (ins >> 16 & 0x1F) == 0 ? 0 : gprs [ins >> 16 & 0x1F]; + uint32_t *p = (uint32_t *)(src + (int16_t) ins); + if (p == NULL || invalid_address != NULL) + return false; + invalid_address = p; + continue; + } + if (ins >> 26 == 0x2E) /* lmw */ + { + reg_unit src = (ins >> 16 & 0x1F) == 0 ? 0 : gprs [ins >> 16 & 0x1F]; + uint32_t *p = (uint32_t *)(src + (int16_t) ins); + int i; + + for (i = (ins >> 21 & 0x1F); i < 32; i++) + { + if (p == invalid_address) + return false; + gprs[i] = *p++; + } + continue; + } + if ((ins & 0xFC1FFFFF) == 0x7c0803a6) /* mtlr */ + { + lr = gprs [ins >> 21 & 0x1F]; + continue; + } + if ((ins & 0xFC1FFFFF) == 0x7c0802a6) /* mflr */ + { + gprs [ins >> 21 & 0x1F] = lr; + continue; + } + if ((ins & 0xFC1FFFFF) == 0x7c0903a6) /* mtctr */ + { + ctr = gprs [ins >> 21 & 0x1F]; + continue; + } + /* The PowerPC User's Manual says that bit 11 of the mtcrf + instruction is reserved and should be set to zero, but it + looks like the Darwin assembler doesn't do that... */ + if ((ins & 0xFC000FFF) == 0x7c000120) /* mtcrf */ + { + int i; + uint32_t mask = 0; + for (i = 0; i < 8; i++) + mask |= ((-(ins >> (12 + i) & 1)) & 0xF) << 4 * i; + cr = (cr & ~mask) | (gprs [ins >> 21 & 0x1F] & mask); + continue; + } + if (ins == 0x429f0005) /* bcl- 20,4*cr7+so,.+4, loads pc into LR */ + { + lr = (reg_unit) pc; + continue; + } + if (ins == 0x4e800420) /* bctr */ + { + pc = (uint32_t *) ctr; + continue; + } + if (ins == 0x44000002) /* sc */ + return true; + + return false; + } +} + +/* We used to include and , + but they change so much between different Darwin system versions + that it's much easier to just write the structures involved here + directly. */ + +/* These defines are from the kernel's bsd/dev/ppc/unix_signal.c. */ +#define UC_TRAD 1 +#define UC_TRAD_VEC 6 +#define UC_TRAD64 20 +#define UC_TRAD64_VEC 25 +#define UC_FLAVOR 30 +#define UC_FLAVOR_VEC 35 +#define UC_FLAVOR64 40 +#define UC_FLAVOR64_VEC 45 +#define UC_DUAL 50 +#define UC_DUAL_VEC 55 + +struct gcc_ucontext +{ + int onstack; + sigset_t sigmask; + void * stack_sp; + size_t stack_sz; + int stack_flags; + struct gcc_ucontext *link; + size_t mcsize; + struct gcc_mcontext32 *mcontext; +}; + +struct gcc_float_vector_state +{ + double fpregs[32]; + uint32_t fpscr_pad; + uint32_t fpscr; + uint32_t save_vr[32][4]; + uint32_t save_vscr[4]; +}; + +struct gcc_mcontext32 { + uint32_t dar; + uint32_t dsisr; + uint32_t exception; + uint32_t padding1[5]; + uint32_t srr0; + uint32_t srr1; + uint32_t gpr[32]; + uint32_t cr; + uint32_t xer; + uint32_t lr; + uint32_t ctr; + uint32_t mq; + uint32_t vrsave; + struct gcc_float_vector_state fvs; +}; + +/* These are based on /usr/include/ppc/ucontext.h and + /usr/include/mach/ppc/thread_status.h, but rewritten to be more + convenient, to compile on Jaguar, and to work around Radar 3712064 + on Panther, which is that the 'es' field of 'struct mcontext64' has + the wrong type (doh!). */ + +struct gcc_mcontext64 { + uint64_t dar; + uint32_t dsisr; + uint32_t exception; + uint32_t padding1[4]; + uint64_t srr0; + uint64_t srr1; + uint32_t gpr[32][2]; + uint32_t cr; + uint32_t xer[2]; /* These are arrays because the original structure has them misaligned. */ + uint32_t lr[2]; + uint32_t ctr[2]; + uint32_t vrsave; + struct gcc_float_vector_state fvs; +}; + +#define UC_FLAVOR_SIZE \ + (sizeof (struct gcc_mcontext32) - 33*16) + +#define UC_FLAVOR_VEC_SIZE (sizeof (struct gcc_mcontext32)) + +#define UC_FLAVOR64_SIZE \ + (sizeof (struct gcc_mcontext64) - 33*16) + +#define UC_FLAVOR64_VEC_SIZE (sizeof (struct gcc_mcontext64)) + +/* Given GPRS as input to a 'sc' instruction, and OLD_CFA, update FS + to represent the execution of a signal return; or, if not a signal + return, return false. */ + +static bool +handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], + _Unwind_Ptr old_cfa) +{ + struct gcc_ucontext *uctx; + bool is_64, is_vector; + struct gcc_float_vector_state * float_vector_state; + _Unwind_Ptr new_cfa; + int i; + static _Unwind_Ptr return_addr; + + /* Yay! We're in a Libc that we understand, and it's made a + system call. It'll be one of two kinds: either a Jaguar-style + SYS_sigreturn, or a Panther-style 'syscall' call with 184, which + is also SYS_sigreturn. */ + + if (gprs[0] == 0x67 /* SYS_SIGRETURN */) + { + uctx = (struct gcc_ucontext *) gprs[3]; + is_vector = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE + || uctx->mcsize == UC_FLAVOR_VEC_SIZE); + is_64 = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE + || uctx->mcsize == UC_FLAVOR64_SIZE); + } + else if (gprs[0] == 0 && gprs[3] == 184) + { + int ctxstyle = gprs[5]; + uctx = (struct gcc_ucontext *) gprs[4]; + is_vector = (ctxstyle == UC_FLAVOR_VEC || ctxstyle == UC_FLAVOR64_VEC + || ctxstyle == UC_TRAD_VEC || ctxstyle == UC_TRAD64_VEC); + is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC + || ctxstyle == UC_FLAVOR64 || ctxstyle == UC_TRAD64); + } + else + return false; + +#define set_offset(r, addr) \ + (fs->regs.reg[r].how = REG_SAVED_OFFSET, \ + fs->regs.reg[r].loc.offset = (_Unwind_Ptr)(addr) - new_cfa) + + /* Restore even the registers that are not call-saved, since they + might be being used in the prologue to save other registers, + for instance GPR0 is sometimes used to save LR. */ + + /* Handle the GPRs, and produce the information needed to do the rest. */ + if (is_64) + { + /* The context is 64-bit, but it doesn't carry any extra information + for us because only the low 32 bits of the registers are + call-saved. */ + struct gcc_mcontext64 *m64 = (struct gcc_mcontext64 *)uctx->mcontext; + int i; + + float_vector_state = &m64->fvs; + + new_cfa = m64->gpr[1][1]; + + set_offset (CR2_REGNO, &m64->cr); + for (i = 0; i < 32; i++) + set_offset (i, m64->gpr[i] + 1); + set_offset (XER_REGNO, m64->xer + 1); + set_offset (LINK_REGISTER_REGNUM, m64->lr + 1); + set_offset (COUNT_REGISTER_REGNUM, m64->ctr + 1); + if (is_vector) + set_offset (VRSAVE_REGNO, &m64->vrsave); + + /* Sometimes, srr0 points to the instruction that caused the exception, + and sometimes to the next instruction to be executed; we want + the latter. */ + if (m64->exception == 3 || m64->exception == 4 + || m64->exception == 6 + || (m64->exception == 7 && !(m64->srr1 & 0x10000))) + return_addr = m64->srr0 + 4; + else + return_addr = m64->srr0; + } + else + { + struct gcc_mcontext32 *m = uctx->mcontext; + int i; + + float_vector_state = &m->fvs; + + new_cfa = m->gpr[1]; + + set_offset (CR2_REGNO, &m->cr); + for (i = 0; i < 32; i++) + set_offset (i, m->gpr + i); + set_offset (XER_REGNO, &m->xer); + set_offset (LINK_REGISTER_REGNUM, &m->lr); + set_offset (COUNT_REGISTER_REGNUM, &m->ctr); + + if (is_vector) + set_offset (VRSAVE_REGNO, &m->vrsave); + + /* Sometimes, srr0 points to the instruction that caused the exception, + and sometimes to the next instruction to be executed; we want + the latter. */ + if (m->exception == 3 || m->exception == 4 + || m->exception == 6 + || (m->exception == 7 && !(m->srr1 & 0x10000))) + return_addr = m->srr0 + 4; + else + return_addr = m->srr0; + } + + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = STACK_POINTER_REGNUM; + fs->cfa_offset = new_cfa - old_cfa;; + + /* The choice of column for the return address is somewhat tricky. + Fortunately, the actual choice is private to this file, and + the space it's reserved from is the GCC register space, not the + DWARF2 numbering. So any free element of the right size is an OK + choice. Thus: */ + fs->retaddr_column = ARG_POINTER_REGNUM; + /* FIXME: this should really be done using a DWARF2 location expression, + not using a static variable. In fact, this entire file should + be implemented in DWARF2 expressions. */ + set_offset (ARG_POINTER_REGNUM, &return_addr); + + for (i = 0; i < 32; i++) + set_offset (32 + i, float_vector_state->fpregs + i); + set_offset (SPEFSCR_REGNO, &float_vector_state->fpscr); + + if (is_vector) + { + for (i = 0; i < 32; i++) + set_offset (FIRST_ALTIVEC_REGNO + i, float_vector_state->save_vr + i); + set_offset (VSCR_REGNO, float_vector_state->save_vscr); + } + + return true; +} + +/* This is also prototyped in rs6000/darwin.h, inside the + MD_FALLBACK_FRAME_STATE_FOR macro. */ +extern bool _Unwind_fallback_frame_state_for (struct _Unwind_Context *context, + _Unwind_FrameState *fs); + +/* Implement the MD_FALLBACK_FRAME_STATE_FOR macro, + returning true iff the frame was a sigreturn() frame that we + can understand. */ + +bool +_Unwind_fallback_frame_state_for (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + reg_unit gprs[32]; + + if (!interpret_libc (gprs, context)) + return false; + return handle_syscall (fs, gprs, _Unwind_GetCFA (context)); +} diff --git a/contrib/gcc/config/rs6000/darwin-fpsave.asm b/contrib/gcc/config/rs6000/darwin-fpsave.asm new file mode 100644 index 00000000000..86d4760b0b6 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-fpsave.asm @@ -0,0 +1,102 @@ +/* This file contains the floating-point save and restore routines. + * + * Copyright (C) 2004 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause the + * resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why the + * executable file might be covered by the GNU General Public License. + */ + +/* THE SAVE AND RESTORE ROUTINES CAN HAVE ONLY ONE GLOBALLY VISIBLE + ENTRY POINT - callers have to jump to "saveFP+60" to save f29..f31, + for example. For FP reg saves/restores, it takes one instruction + (4 bytes) to do the operation; for Vector regs, 2 instructions are + required (8 bytes.) + + MORAL: DO NOT MESS AROUND WITH THESE FUNCTIONS! */ + +#include "darwin-asm.h" + +.text + .align 2 + +/* saveFP saves R0 -- assumed to be the callers LR -- to 8/16(R1). */ + +.private_extern saveFP +saveFP: + stfd f14,-144(r1) + stfd f15,-136(r1) + stfd f16,-128(r1) + stfd f17,-120(r1) + stfd f18,-112(r1) + stfd f19,-104(r1) + stfd f20,-96(r1) + stfd f21,-88(r1) + stfd f22,-80(r1) + stfd f23,-72(r1) + stfd f24,-64(r1) + stfd f25,-56(r1) + stfd f26,-48(r1) + stfd f27,-40(r1) + stfd f28,-32(r1) + stfd f29,-24(r1) + stfd f30,-16(r1) + stfd f31,-8(r1) + stg r0,SAVED_LR_OFFSET(r1) + blr + +/* restFP restores the caller`s LR from 8/16(R1). Note that the code for + this starts at the offset of F30 restoration, so calling this + routine in an attempt to restore only F31 WILL NOT WORK (it would + be a stupid thing to do, anyway.) */ + +.private_extern restFP +restFP: + lfd f14,-144(r1) + lfd f15,-136(r1) + lfd f16,-128(r1) + lfd f17,-120(r1) + lfd f18,-112(r1) + lfd f19,-104(r1) + lfd f20,-96(r1) + lfd f21,-88(r1) + lfd f22,-80(r1) + lfd f23,-72(r1) + lfd f24,-64(r1) + lfd f25,-56(r1) + lfd f26,-48(r1) + lfd f27,-40(r1) + lfd f28,-32(r1) + lfd f29,-24(r1) + /* restore callers LR */ + lg r0,SAVED_LR_OFFSET(r1) + lfd f30,-16(r1) + /* and prepare for return to caller */ + mtlr r0 + lfd f31,-8(r1) + blr diff --git a/contrib/gcc/config/rs6000/darwin-ldouble-format b/contrib/gcc/config/rs6000/darwin-ldouble-format new file mode 100644 index 00000000000..0012a332d71 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-ldouble-format @@ -0,0 +1,84 @@ +Long double format +================== + + Each long double is made up of two IEEE doubles. The value of the +long double is the sum of the values of the two parts (except for +-0.0). The most significant part is required to be the value of the +long double rounded to the nearest double, as specified by IEEE. For +Inf values, the least significant part is required to be one of +0.0 +or -0.0. No other requirements are made; so, for example, 1.0 may be +represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN +is don't-care. + +Classification +-------------- + +A long double can represent any value of the form + s * 2^e * sum(k=0...105: f_k * 2^(-k)) +where 's' is +1 or -1, 'e' is between 1022 and -968 inclusive, f_0 is +1, and f_k for k>0 is 0 or 1. These are the 'normal' long doubles. + +A long double can also represent any value of the form + s * 2^-968 * sum(k=0...105: f_k * 2^(-k)) +where 's' is +1 or -1, f_0 is 0, and f_k for k>0 is 0 or 1. These are +the 'subnormal' long doubles. + +There are four long doubles that represent zero, two that represent ++0.0 and two that represent -0.0. The sign of the high part is the +sign of the long double, and the sign of the low part is ignored. + +Likewise, there are four long doubles that represent infinities, two +for +Inf and two for -Inf. + +Each NaN, quiet or signalling, that can be represented as a 'double' +can be represented as a 'long double'. In fact, there are 2^64 +equivalent representations for each one. + +There are certain other valid long doubles where both parts are +nonzero but the low part represents a value which has a bit set below +2^(e-105). These, together with the subnormal long doubles, make up +the denormal long doubles. + +Many possible long double bit patterns are not valid long doubles. +These do not represent any value. + +Limits +------ + +The maximum representable long double is 2^1024-2^918. The smallest +*normal* positive long double is 2^-968. The smallest denormalised +positive long double is 2^-1074 (this is the same as for 'double'). + +Conversions +----------- + +A double can be converted to a long double by adding a zero low part. + +A long double can be converted to a double by removing the low part. + +Comparisons +----------- + +Two long doubles can be compared by comparing the high parts, and if +those compare equal, comparing the low parts. + +Arithmetic +---------- + +The unary negate operation operates by negating the low and high parts. + +An absolute or absolute-negate operation must be done by comparing +against zero and negating if necessary. + +Addition and subtraction are performed using library routines. They +are not at present performed perfectly accurately, the result produced +will be within 1ulp of the range generated by adding or subtracting +1ulp from the input values, where a 'ulp' is 2^(e-106) given the +exponent 'e'. In the presence of cancellation, this may be +arbitrarily inaccurate. Subtraction is done by negation and addition. + +Multiplication is also performed using a library routine. Its result +will be within 2ulp of the correct result. + +Division is also performed using a library routine. Its result will +be within 3ulp of the correct result. diff --git a/contrib/gcc/config/rs6000/darwin-ldouble.c b/contrib/gcc/config/rs6000/darwin-ldouble.c index 210f2d6a331..c30a98cc90f 100644 --- a/contrib/gcc/config/rs6000/darwin-ldouble.c +++ b/contrib/gcc/config/rs6000/darwin-ldouble.c @@ -1,5 +1,6 @@ /* 128-bit long double support routines for Darwin. - Copyright (C) 1993, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. @@ -24,18 +25,18 @@ for more details. 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. */ /* Implementations of floating-point long double basic arithmetic functions called by the IBM C compiler when generating code for PowerPC platforms. In particular, the following functions are - implemented: _xlqadd, _xlqsub, _xlqmul, and _xlqdiv. Double-double - algorithms are based on the paper "Doubled-Precision IEEE Standard - 754 Floating-Point Arithmetic" by W. Kahan, February 26, 1987. An - alternative published reference is "Software for Doubled-Precision - Floating-Point Computations", by Seppo Linnainmaa, ACM TOMS vol 7 - no 3, September 1961, pages 272-283. */ + implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv. + Double-double algorithms are based on the paper "Doubled-Precision + IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26, + 1987. An alternative published reference is "Software for + Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa, + ACM TOMS vol 7 no 3, September 1981, pages 272-283. */ /* Each long double is made up of two IEEE doubles. The value of the long double is the sum of the values of the two parts. The most @@ -48,36 +49,48 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA This code currently assumes big-endian. */ -#if !_SOFT_FLOAT && (defined (__MACH__) || defined (__powerpc64__) || defined (_AIX)) +#if ((!defined (__NO_FPRS__) || defined (_SOFT_FLOAT)) \ + && !defined (__LITTLE_ENDIAN__) \ + && (defined (__MACH__) || defined (__powerpc__) || defined (_AIX))) #define fabs(x) __builtin_fabs(x) +#define isless(x, y) __builtin_isless (x, y) +#define inf() __builtin_inf() #define unlikely(x) __builtin_expect ((x), 0) +#define nonfinite(a) unlikely (! isless (fabs (a), inf ())) + +/* Define ALIASNAME as a strong alias for NAME. */ +# define strong_alias(name, aliasname) _strong_alias(name, aliasname) +# define _strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))); + /* All these routines actually take two long doubles as parameters, but GCC currently generates poor code when a union is used to turn a long double into a pair of doubles. */ -extern long double __gcc_qadd (double, double, double, double); -extern long double __gcc_qsub (double, double, double, double); -extern long double __gcc_qmul (double, double, double, double); -extern long double __gcc_qdiv (double, double, double, double); +long double __gcc_qadd (double, double, double, double); +long double __gcc_qsub (double, double, double, double); +long double __gcc_qmul (double, double, double, double); +long double __gcc_qdiv (double, double, double, double); -#if defined __ELF__ && defined IN_LIBGCC2_S -/* Provide definitions of the old symbol names to statisfy apps and +#if defined __ELF__ && defined SHARED \ + && (defined __powerpc64__ || !(defined __linux__ || defined __gnu_hurd__)) +/* Provide definitions of the old symbol names to satisfy apps and shared libs built against an older libgcc. To access the _xlq symbols an explicit version reference is needed, so these won't satisfy an unadorned reference like _xlqadd. If dot symbols are not needed, the assembler will remove the aliases from the symbol table. */ __asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t" - ".symver __gcc_qsub,_xlqsub@GCC_3.4\n\t" - ".symver __gcc_qmul,_xlqmul@GCC_3.4\n\t" - ".symver __gcc_qdiv,_xlqdiv@GCC_3.4\n\t" - ".symver .__gcc_qadd,._xlqadd@GCC_3.4\n\t" - ".symver .__gcc_qsub,._xlqsub@GCC_3.4\n\t" - ".symver .__gcc_qmul,._xlqmul@GCC_3.4\n\t" - ".symver .__gcc_qdiv,._xlqdiv@GCC_3.4"); + ".symver __gcc_qsub,_xlqsub@GCC_3.4\n\t" + ".symver __gcc_qmul,_xlqmul@GCC_3.4\n\t" + ".symver __gcc_qdiv,_xlqdiv@GCC_3.4\n\t" + ".symver .__gcc_qadd,._xlqadd@GCC_3.4\n\t" + ".symver .__gcc_qsub,._xlqsub@GCC_3.4\n\t" + ".symver .__gcc_qmul,._xlqmul@GCC_3.4\n\t" + ".symver .__gcc_qdiv,._xlqdiv@GCC_3.4"); #endif typedef union @@ -86,66 +99,44 @@ typedef union double dval[2]; } longDblUnion; -static const double FPKINF = 1.0/0.0; - /* Add two 'long double' values and return the result. */ long double -__gcc_qadd (double a, double b, double c, double d) +__gcc_qadd (double a, double aa, double c, double cc) { - longDblUnion z; - double t, tau, u, FPR_zero, FPR_PosInf; + longDblUnion x; + double z, q, zz, xh; - FPR_zero = 0.0; - FPR_PosInf = FPKINF; + z = a + c; - if (unlikely (a != a) || unlikely (c != c)) - return a + c; /* NaN result. */ - - /* Ordered operands are arranged in order of their magnitudes. */ - - /* Switch inputs if |(c,d)| > |(a,b)|. */ - if (fabs (c) > fabs (a)) + if (nonfinite (z)) { - t = a; - tau = b; - a = c; - b = d; - c = t; - d = tau; + z = cc + aa + c + a; + if (nonfinite (z)) + return z; + x.dval[0] = z; /* Will always be DBL_MAX. */ + zz = aa + cc; + if (fabs(a) > fabs(c)) + x.dval[1] = a - z + c + zz; + else + x.dval[1] = c - z + a + zz; } - - /* b <- second largest magnitude double. */ - if (fabs (c) > fabs (b)) + else { - t = b; - b = c; - c = t; + q = a - z; + zz = q + c + (a - (q + z)) + aa + cc; + + /* Keep -0 result. */ + if (zz == 0.0) + return z; + + xh = z + zz; + if (nonfinite (xh)) + return xh; + + x.dval[0] = xh; + x.dval[1] = z - xh + zz; } - - /* Thanks to commutivity, sum is invariant w.r.t. the next - conditional exchange. */ - tau = d + c; - - /* Order the smallest magnitude doubles. */ - if (fabs (d) > fabs (c)) - { - t = c; - c = d; - d = t; - } - - t = (tau + b) + a; /* Sum values in ascending magnitude order. */ - - /* Infinite or zero result. */ - if (unlikely (t == FPR_zero) || unlikely (fabs (t) == FPR_PosInf)) - return t; - - /* Usual case. */ - tau = (((a-t) + b) + c) + d; - u = t + tau; - z.dval[0] = u; /* Final fixup for long double result. */ - z.dval[1] = (t - u) + tau; - return z.ldval; + return x.ldval; } long double @@ -154,32 +145,38 @@ __gcc_qsub (double a, double b, double c, double d) return __gcc_qadd (a, b, -c, -d); } +#ifdef _SOFT_FLOAT +static double fmsub (double, double, double); +#endif + long double __gcc_qmul (double a, double b, double c, double d) { longDblUnion z; - double t, tau, u, v, w, FPR_zero, FPR_PosInf; + double t, tau, u, v, w; - FPR_zero = 0.0; - FPR_PosInf = FPKINF; - t = a * c; /* Highest order double term. */ - if (unlikely (t != t) || unlikely (t == FPR_zero) - || unlikely (fabs (t) == FPR_PosInf)) + if (unlikely (t == 0) /* Preserve -0. */ + || nonfinite (t)) return t; - /* Finite nonzero result requires summing of terms of two highest - orders. */ + /* Sum terms of two highest orders. */ - /* Use fused multiply-add to get low part of a * c. */ + /* Use fused multiply-add to get low part of a * c. */ +#ifndef _SOFT_FLOAT asm ("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t)); +#else + tau = fmsub (a, c, t); +#endif v = a*d; w = b*c; tau += v + w; /* Add in other second-order terms. */ u = t + tau; /* Construct long double result. */ + if (nonfinite (u)) + return u; z.dval[0] = u; z.dval[1] = (t - u) + tau; return z.ldval; @@ -189,34 +186,253 @@ long double __gcc_qdiv (double a, double b, double c, double d) { longDblUnion z; - double s, sigma, t, tau, u, v, w, FPR_zero, FPR_PosInf; - - FPR_zero = 0.0; - FPR_PosInf = FPKINF; + double s, sigma, t, tau, u, v, w; t = a / c; /* highest order double term */ - if (unlikely (t != t) || unlikely (t == FPR_zero) - || unlikely (fabs (t) == FPR_PosInf)) + if (unlikely (t == 0) /* Preserve -0. */ + || nonfinite (t)) return t; /* Finite nonzero result requires corrections to the highest order term. */ - s = c * t; /* (s,sigma) = c*t exactly. */ + s = c * t; /* (s,sigma) = c*t exactly. */ w = -(-b + d * t); /* Written to get fnmsub for speed, but not numerically necessary. */ /* Use fused multiply-add to get low part of c * t. */ +#ifndef _SOFT_FLOAT asm ("fmsub %0,%1,%2,%3" : "=f"(sigma) : "f"(c), "f"(t), "f"(s)); +#else + sigma = fmsub (c, t, s); +#endif v = a - s; - tau = ((v-sigma)+w)/c; /* Correction to t. */ + tau = ((v-sigma)+w)/c; /* Correction to t. */ u = t + tau; - /* Construct long double result. */ + /* Construct long double result. */ + if (nonfinite (u)) + return u; z.dval[0] = u; z.dval[1] = (t - u) + tau; return z.ldval; } +#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__) + +long double __gcc_qneg (double, double); +int __gcc_qeq (double, double, double, double); +int __gcc_qne (double, double, double, double); +int __gcc_qge (double, double, double, double); +int __gcc_qle (double, double, double, double); +int __gcc_qunord (double, double, double, double); +long double __gcc_stoq (float); +long double __gcc_dtoq (double); +float __gcc_qtos (double, double); +double __gcc_qtod (double, double); +int __gcc_qtoi (double, double); +unsigned int __gcc_qtou (double, double); +long double __gcc_itoq (int); +long double __gcc_utoq (unsigned int); + +extern int __eqdf2 (double, double); +extern int __ledf2 (double, double); +extern int __gedf2 (double, double); +extern int __unorddf2 (double, double); + +/* Negate 'long double' value and return the result. */ +long double +__gcc_qneg (double a, double aa) +{ + longDblUnion x; + + x.dval[0] = -a; + x.dval[1] = -aa; + return x.ldval; +} + +/* Compare two 'long double' values for equality. */ +int +__gcc_qeq (double a, double aa, double c, double cc) +{ + if (__eqdf2 (a, c) == 0) + return __eqdf2 (aa, cc); + return 1; +} + +strong_alias (__gcc_qeq, __gcc_qne); + +/* Compare two 'long double' values for less than or equal. */ +int +__gcc_qle (double a, double aa, double c, double cc) +{ + if (__eqdf2 (a, c) == 0) + return __ledf2 (aa, cc); + return __ledf2 (a, c); +} + +strong_alias (__gcc_qle, __gcc_qlt); + +/* Compare two 'long double' values for greater than or equal. */ +int +__gcc_qge (double a, double aa, double c, double cc) +{ + if (__eqdf2 (a, c) == 0) + return __gedf2 (aa, cc); + return __gedf2 (a, c); +} + +strong_alias (__gcc_qge, __gcc_qgt); + +/* Compare two 'long double' values for unordered. */ +int +__gcc_qunord (double a, double aa, double c, double cc) +{ + if (__eqdf2 (a, c) == 0) + return __unorddf2 (aa, cc); + return __unorddf2 (a, c); +} + +/* Convert single to long double. */ +long double +__gcc_stoq (float a) +{ + longDblUnion x; + + x.dval[0] = (double) a; + x.dval[1] = 0.0; + + return x.ldval; +} + +/* Convert double to long double. */ +long double +__gcc_dtoq (double a) +{ + longDblUnion x; + + x.dval[0] = a; + x.dval[1] = 0.0; + + return x.ldval; +} + +/* Convert long double to single. */ +float +__gcc_qtos (double a, double aa __attribute__ ((__unused__))) +{ + return (float) a; +} + +/* Convert long double to double. */ +double +__gcc_qtod (double a, double aa __attribute__ ((__unused__))) +{ + return a; +} + +/* Convert long double to int. */ +int +__gcc_qtoi (double a, double aa) +{ + double z = a + aa; + return (int) z; +} + +/* Convert long double to unsigned int. */ +unsigned int +__gcc_qtou (double a, double aa) +{ + double z = a + aa; + return (unsigned int) z; +} + +/* Convert int to long double. */ +long double +__gcc_itoq (int a) +{ + return __gcc_dtoq ((double) a); +} + +/* Convert unsigned int to long double. */ +long double +__gcc_utoq (unsigned int a) +{ + return __gcc_dtoq ((double) a); +} + +#include "config/soft-fp/soft-fp.h" +#include "config/soft-fp/double.h" +#include "config/soft-fp/quad.h" + +/* Compute floating point multiply-subtract with higher (quad) precision. */ +static double +fmsub (double a, double b, double c) +{ + FP_DECL_EX; + FP_DECL_D(A); + FP_DECL_D(B); + FP_DECL_D(C); + FP_DECL_Q(X); + FP_DECL_Q(Y); + FP_DECL_Q(Z); + FP_DECL_Q(U); + FP_DECL_Q(V); + FP_DECL_D(R); + double r; + long double u, v, x, y, z; + + FP_INIT_ROUNDMODE; + FP_UNPACK_RAW_D (A, a); + FP_UNPACK_RAW_D (B, b); + FP_UNPACK_RAW_D (C, c); + + /* Extend double to quad. */ +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_EXTEND(Q,D,4,2,X,A); + FP_EXTEND(Q,D,4,2,Y,B); + FP_EXTEND(Q,D,4,2,Z,C); +#else + FP_EXTEND(Q,D,2,1,X,A); + FP_EXTEND(Q,D,2,1,Y,B); + FP_EXTEND(Q,D,2,1,Z,C); +#endif + FP_PACK_RAW_Q(x,X); + FP_PACK_RAW_Q(y,Y); + FP_PACK_RAW_Q(z,Z); + FP_HANDLE_EXCEPTIONS; + + /* Multiply. */ + FP_INIT_ROUNDMODE; + FP_UNPACK_Q(X,x); + FP_UNPACK_Q(Y,y); + FP_MUL_Q(U,X,Y); + FP_PACK_Q(u,U); + FP_HANDLE_EXCEPTIONS; + + /* Subtract. */ + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(U,u); + FP_UNPACK_SEMIRAW_Q(Z,z); + FP_SUB_Q(V,U,Z); + FP_PACK_SEMIRAW_Q(v,V); + FP_HANDLE_EXCEPTIONS; + + /* Truncate quad to double. */ + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(V,v); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_TRUNC(D,Q,2,4,R,V); +#else + FP_TRUNC(D,Q,1,2,R,V); +#endif + FP_PACK_SEMIRAW_D(r,R); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +#endif + #endif diff --git a/contrib/gcc/config/rs6000/darwin-libgcc.10.4.ver b/contrib/gcc/config/rs6000/darwin-libgcc.10.4.ver new file mode 100644 index 00000000000..019218dd60f --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-libgcc.10.4.ver @@ -0,0 +1,76 @@ +__Unwind_Backtrace +__Unwind_DeleteException +__Unwind_FindEnclosingFunction +__Unwind_Find_FDE +__Unwind_ForcedUnwind +__Unwind_GetCFA +__Unwind_GetDataRelBase +__Unwind_GetGR +__Unwind_GetIP +__Unwind_GetLanguageSpecificData +__Unwind_GetRegionStart +__Unwind_GetTextRelBase +__Unwind_RaiseException +__Unwind_Resume +__Unwind_Resume_or_Rethrow +__Unwind_SetGR +__Unwind_SetIP +___absvdi2 +___absvsi2 +___addvdi3 +___addvsi3 +___ashldi3 +___ashrdi3 +___clear_cache +___clzdi2 +___clzsi2 +___cmpdi2 +___ctzdi2 +___ctzsi2 +___deregister_frame +___deregister_frame_info +___deregister_frame_info_bases +___divdi3 +___enable_execute_stack +___ffsdi2 +___fixdfdi +___fixsfdi +___fixtfdi +___fixunsdfdi +___fixunsdfsi +___fixunssfdi +___fixunssfsi +___fixunstfdi +___floatdidf +___floatdisf +___floatditf +___gcc_personality_v0 +___gcc_qadd +___gcc_qdiv +___gcc_qmul +___gcc_qsub +___lshrdi3 +___moddi3 +___muldi3 +___mulvdi3 +___mulvsi3 +___negdi2 +___negvdi2 +___negvsi2 +___paritydi2 +___paritysi2 +___popcountdi2 +___popcountsi2 +___register_frame +___register_frame_info +___register_frame_info_bases +___register_frame_info_table +___register_frame_info_table_bases +___register_frame_table +___subvdi3 +___subvsi3 +___trampoline_setup +___ucmpdi2 +___udivdi3 +___udivmoddi4 +___umoddi3 diff --git a/contrib/gcc/config/rs6000/darwin-libgcc.10.5.ver b/contrib/gcc/config/rs6000/darwin-libgcc.10.5.ver new file mode 100644 index 00000000000..7e0dd52b09d --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-libgcc.10.5.ver @@ -0,0 +1,89 @@ +__Unwind_Backtrace +__Unwind_DeleteException +__Unwind_FindEnclosingFunction +__Unwind_Find_FDE +__Unwind_ForcedUnwind +__Unwind_GetCFA +__Unwind_GetDataRelBase +__Unwind_GetGR +__Unwind_GetIP +__Unwind_GetIPInfo +__Unwind_GetLanguageSpecificData +__Unwind_GetRegionStart +__Unwind_GetTextRelBase +__Unwind_RaiseException +__Unwind_Resume +__Unwind_Resume_or_Rethrow +__Unwind_SetGR +__Unwind_SetIP +___absvdi2 +___absvsi2 +___addvdi3 +___addvsi3 +___ashldi3 +___ashrdi3 +___clear_cache +___clzdi2 +___clzsi2 +___cmpdi2 +___ctzdi2 +___ctzsi2 +___deregister_frame +___deregister_frame_info +___deregister_frame_info_bases +___divdc3 +___divdi3 +___divsc3 +___divtc3 +___enable_execute_stack +___ffsdi2 +___fixdfdi +___fixsfdi +___fixtfdi +___fixunsdfdi +___fixunsdfsi +___fixunssfdi +___fixunssfsi +___fixunstfdi +___floatdidf +___floatdisf +___floatditf +___floatundidf +___floatundisf +___floatunditf +___gcc_personality_v0 +___gcc_qadd +___gcc_qdiv +___gcc_qmul +___gcc_qsub +___lshrdi3 +___moddi3 +___muldc3 +___muldi3 +___mulsc3 +___multc3 +___mulvdi3 +___mulvsi3 +___negdi2 +___negvdi2 +___negvsi2 +___paritydi2 +___paritysi2 +___popcountdi2 +___popcountsi2 +___powidf2 +___powisf2 +___powitf2 +___register_frame +___register_frame_info +___register_frame_info_bases +___register_frame_info_table +___register_frame_info_table_bases +___register_frame_table +___subvdi3 +___subvsi3 +___trampoline_setup +___ucmpdi2 +___udivdi3 +___udivmoddi4 +___umoddi3 diff --git a/contrib/gcc/config/rs6000/darwin-tramp.asm b/contrib/gcc/config/rs6000/darwin-tramp.asm index 22ce80a1080..62522b9e35b 100644 --- a/contrib/gcc/config/rs6000/darwin-tramp.asm +++ b/contrib/gcc/config/rs6000/darwin-tramp.asm @@ -1,6 +1,6 @@ /* Special support for trampolines * - * Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + * Copyright (C) 1996, 1997, 2000, 2004, 2005 Free Software Foundation, Inc. * Written By Michael Meissner * * This file is free software; you can redistribute it and/or modify it @@ -23,8 +23,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause the @@ -33,22 +33,24 @@ * executable file might be covered by the GNU General Public License. */ +#include "darwin-asm.h" + /* Set up trampolines. */ .text - .align 2 + .align LOG2_GPR_BYTES Ltrampoline_initial: mflr r0 bl 1f Lfunc = .-Ltrampoline_initial - .long 0 /* will be replaced with function address */ + .g_long 0 /* will be replaced with function address */ Lchain = .-Ltrampoline_initial - .long 0 /* will be replaced with static chain */ + .g_long 0 /* will be replaced with static chain */ 1: mflr r11 - lwz r12,0(r11) /* function address */ + lg r12,0(r11) /* function address */ mtlr r0 mtctr r12 - lwz r11,4(r11) /* static chain */ + lg r11,GPR_BYTES(r11) /* static chain */ bctr trampoline_size = .-Ltrampoline_initial @@ -65,12 +67,12 @@ ___trampoline_setup: LCF0: mflr r11 addis r7,r11,ha16(LTRAMP-LCF0) - lwz r7,lo16(LTRAMP-LCF0)(r7) + lg r7,lo16(LTRAMP-LCF0)(r7) subi r7,r7,4 li r8,trampoline_size /* verify trampoline big enough */ - cmpw cr1,r8,r4 - srwi r4,r4,2 /* # words to move */ - addi r9,r3,-4 /* adjust pointer for lwzu */ + cmpg cr1,r8,r4 + srwi r4,r4,2 /* # words to move (insns always 4-byte) */ + addi r9,r3,-4 /* adjust pointer for lgu */ mtctr r4 blt cr1,Labort @@ -83,8 +85,8 @@ Lmove: bdnz Lmove /* Store correct function and static chain */ - stw r5,Lfunc(r3) - stw r6,Lchain(r3) + stg r5,Lfunc(r3) + stg r6,Lchain(r3) /* Now flush both caches */ mtctr r4 @@ -94,16 +96,19 @@ Lcache: addi r3,r3,4 bdnz Lcache - /* Finally synchronize things & return */ + /* Ensure cache-flushing has finished. */ sync isync - blr + + /* Make stack writeable. */ + b ___enable_execute_stack Labort: #ifdef __DYNAMIC__ bl L_abort$stub .data -.picsymbol_stub +.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 + .align 2 L_abort$stub: .indirect_symbol _abort mflr r0 @@ -112,20 +117,19 @@ L0$_abort: mflr r11 addis r11,r11,ha16(L_abort$lazy_ptr-L0$_abort) mtlr r0 - lwz r12,lo16(L_abort$lazy_ptr-L0$_abort)(r11) + lgu r12,lo16(L_abort$lazy_ptr-L0$_abort)(r11) mtctr r12 - addi r11,r11,lo16(L_abort$lazy_ptr-L0$_abort) bctr .data .lazy_symbol_pointer L_abort$lazy_ptr: .indirect_symbol _abort - .long dyld_stub_binding_helper + .g_long dyld_stub_binding_helper #else bl _abort #endif .data - .align 2 + .align LOG2_GPR_BYTES LTRAMP: - .long Ltrampoline_initial + .g_long Ltrampoline_initial diff --git a/contrib/gcc/config/rs6000/darwin-unwind.h b/contrib/gcc/config/rs6000/darwin-unwind.h new file mode 100644 index 00000000000..9218c5ad45d --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-unwind.h @@ -0,0 +1,35 @@ +/* DWARF2 EH unwinding support for Darwin. + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combined + executable.) + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +extern bool _Unwind_fallback_frame_state_for + (struct _Unwind_Context *context, _Unwind_FrameState *fs); + +#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS) \ + (_Unwind_fallback_frame_state_for (CONTEXT, FS) \ + ? _URC_NO_REASON : _URC_END_OF_STACK) diff --git a/contrib/gcc/config/rs6000/darwin-vecsave.asm b/contrib/gcc/config/rs6000/darwin-vecsave.asm new file mode 100644 index 00000000000..693879f8263 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-vecsave.asm @@ -0,0 +1,165 @@ +/* This file contains the vector save and restore routines. + * + * Copyright (C) 2004 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause the + * resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why the + * executable file might be covered by the GNU General Public License. + */ + +/* Vector save/restore routines for Darwin. Note that each vector + save/restore requires 2 instructions (8 bytes.) + + THE SAVE AND RESTORE ROUTINES CAN HAVE ONLY ONE GLOBALLY VISIBLE + ENTRY POINT - callers have to jump to "saveFP+60" to save f29..f31, + for example. For FP reg saves/restores, it takes one instruction + (4 bytes) to do the operation; for Vector regs, 2 instructions are + required (8 bytes.). */ + + .machine ppc7400 +.text + .align 2 + +.private_extern saveVEC +saveVEC: + li r11,-192 + stvx v20,r11,r0 + li r11,-176 + stvx v21,r11,r0 + li r11,-160 + stvx v22,r11,r0 + li r11,-144 + stvx v23,r11,r0 + li r11,-128 + stvx v24,r11,r0 + li r11,-112 + stvx v25,r11,r0 + li r11,-96 + stvx v26,r11,r0 + li r11,-80 + stvx v27,r11,r0 + li r11,-64 + stvx v28,r11,r0 + li r11,-48 + stvx v29,r11,r0 + li r11,-32 + stvx v30,r11,r0 + li r11,-16 + stvx v31,r11,r0 + blr + +.private_extern restVEC +restVEC: + li r11,-192 + lvx v20,r11,r0 + li r11,-176 + lvx v21,r11,r0 + li r11,-160 + lvx v22,r11,r0 + li r11,-144 + lvx v23,r11,r0 + li r11,-128 + lvx v24,r11,r0 + li r11,-112 + lvx v25,r11,r0 + li r11,-96 + lvx v26,r11,r0 + li r11,-80 + lvx v27,r11,r0 + li r11,-64 + lvx v28,r11,r0 + li r11,-48 + lvx v29,r11,r0 + li r11,-32 + lvx v30,r11,r0 + li r11,-16 + lvx v31,r11,r0 + blr + +/* saveVEC_vr11 -- as saveVEC but VRsave is returned in R11. */ + +.private_extern saveVEC_vr11 +saveVEC_vr11: + li r11,-192 + stvx v20,r11,r0 + li r11,-176 + stvx v21,r11,r0 + li r11,-160 + stvx v22,r11,r0 + li r11,-144 + stvx v23,r11,r0 + li r11,-128 + stvx v24,r11,r0 + li r11,-112 + stvx v25,r11,r0 + li r11,-96 + stvx v26,r11,r0 + li r11,-80 + stvx v27,r11,r0 + li r11,-64 + stvx v28,r11,r0 + li r11,-48 + stvx v29,r11,r0 + li r11,-32 + stvx v30,r11,r0 + li r11,-16 + stvx v31,r11,r0 + mfspr r11,VRsave + blr + +/* As restVec, but the original VRsave value passed in R10. */ + +.private_extern restVEC_vr10 +restVEC_vr10: + li r11,-192 + lvx v20,r11,r0 + li r11,-176 + lvx v21,r11,r0 + li r11,-160 + lvx v22,r11,r0 + li r11,-144 + lvx v23,r11,r0 + li r11,-128 + lvx v24,r11,r0 + li r11,-112 + lvx v25,r11,r0 + li r11,-96 + lvx v26,r11,r0 + li r11,-80 + lvx v27,r11,r0 + li r11,-64 + lvx v28,r11,r0 + li r11,-48 + lvx v29,r11,r0 + li r11,-32 + lvx v30,r11,r0 + li r11,-16 + lvx v31,r11,r0 + /* restore VRsave from R10. */ + mtspr VRsave,r10 + blr diff --git a/contrib/gcc/config/rs6000/darwin-world.asm b/contrib/gcc/config/rs6000/darwin-world.asm new file mode 100644 index 00000000000..7ff51b51f11 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin-world.asm @@ -0,0 +1,269 @@ +/* This file contains the exception-handling save_world and + * restore_world routines, which need to do a run-time check to see if + * they should save and restore the vector registers. + * + * Copyright (C) 2004 Free Software Foundation, Inc. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * In addition to the permissions in the GNU General Public License, the + * Free Software Foundation gives you unlimited permission to link the + * compiled version of this file with other programs, and to distribute + * those programs without any restriction coming from the use of this + * file. (The General Public License restrictions do apply in other + * respects; for example, they cover modification of the file, and + * distribution when not linked into another program.) + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * As a special exception, if you link this library with files + * compiled with GCC to produce an executable, this does not cause the + * resulting executable to be covered by the GNU General Public License. + * This exception does not however invalidate any other reasons why the + * executable file might be covered by the GNU General Public License. + */ + + .machine ppc7400 +.data + .align 2 + +#ifdef __DYNAMIC__ + +.non_lazy_symbol_pointer +L_has_vec$non_lazy_ptr: + .indirect_symbol __cpu_has_altivec +#ifdef __ppc64__ + .quad 0 +#else + .long 0 +#endif + +#else + +/* For static, "pretend" we have a non-lazy-pointer. */ + +L_has_vec$non_lazy_ptr: + .long __cpu_has_altivec + +#endif + + +.text + .align 2 + +/* save_world and rest_world save/restore F14-F31 and possibly V20-V31 + (assuming you have a CPU with vector registers; we use a global var + provided by the System Framework to determine this.) + + SAVE_WORLD takes R0 (the caller`s caller`s return address) and R11 + (the stack frame size) as parameters. It returns VRsave in R0 if + we`re on a CPU with vector regs. + + With gcc3, we now need to save and restore CR as well, since gcc3's + scheduled prologs can cause comparisons to be moved before calls to + save_world! + + USES: R0 R11 R12 */ + +.private_extern save_world +save_world: + stw r0,8(r1) + mflr r0 + bcl 20,31,Ls$pb +Ls$pb: mflr r12 + addis r12,r12,ha16(L_has_vec$non_lazy_ptr-Ls$pb) + lwz r12,lo16(L_has_vec$non_lazy_ptr-Ls$pb)(r12) + mtlr r0 + lwz r12,0(r12) + /* grab CR */ + mfcr r0 + /* test HAS_VEC */ + cmpwi r12,0 + stfd f14,-144(r1) + stfd f15,-136(r1) + stfd f16,-128(r1) + stfd f17,-120(r1) + stfd f18,-112(r1) + stfd f19,-104(r1) + stfd f20,-96(r1) + stfd f21,-88(r1) + stfd f22,-80(r1) + stfd f23,-72(r1) + stfd f24,-64(r1) + stfd f25,-56(r1) + stfd f26,-48(r1) + stfd f27,-40(r1) + stfd f28,-32(r1) + stfd f29,-24(r1) + stfd f30,-16(r1) + stfd f31,-8(r1) + stmw r13,-220(r1) + /* stash CR */ + stw r0,4(r1) + /* set R12 pointing at Vector Reg save area */ + addi r12,r1,-224 + /* allocate stack frame */ + stwux r1,r1,r11 + /* ...but return if HAS_VEC is zero */ + bne+ L$saveVMX + /* Not forgetting to restore CR. */ + mtcr r0 + blr + +L$saveVMX: + /* We're saving Vector regs too. */ + /* Restore CR from R0. No More Branches! */ + mtcr r0 + + /* We should really use VRSAVE to figure out which vector regs + we actually need to save and restore. Some other time :-/ */ + + li r11,-192 + stvx v20,r11,r12 + li r11,-176 + stvx v21,r11,r12 + li r11,-160 + stvx v22,r11,r12 + li r11,-144 + stvx v23,r11,r12 + li r11,-128 + stvx v24,r11,r12 + li r11,-112 + stvx v25,r11,r12 + li r11,-96 + stvx v26,r11,r12 + li r11,-80 + stvx v27,r11,r12 + li r11,-64 + stvx v28,r11,r12 + li r11,-48 + stvx v29,r11,r12 + li r11,-32 + stvx v30,r11,r12 + mfspr r0,VRsave + li r11,-16 + stvx v31,r11,r12 + /* VRsave lives at -224(R1) */ + stw r0,0(r12) + blr + + +/* eh_rest_world_r10 is jumped to, not called, so no need to worry about LR. + R10 is the C++ EH stack adjust parameter, we return to the caller`s caller. + + USES: R0 R10 R11 R12 and R7 R8 + RETURNS: C++ EH Data registers (R3 - R6.) + + We now set up R7/R8 and jump to rest_world_eh_r7r8. + + rest_world doesn't use the R10 stack adjust parameter, nor does it + pick up the R3-R6 exception handling stuff. */ + +.private_extern rest_world +rest_world: + /* Pickup previous SP */ + lwz r11, 0(r1) + li r7, 0 + lwz r8, 8(r11) + li r10, 0 + b rest_world_eh_r7r8 + +.private_extern eh_rest_world_r10 +eh_rest_world_r10: + /* Pickup previous SP */ + lwz r11, 0(r1) + mr r7,r10 + lwz r8, 8(r11) + /* pickup the C++ EH data regs (R3 - R6.) */ + lwz r6,-420(r11) + lwz r5,-424(r11) + lwz r4,-428(r11) + lwz r3,-432(r11) + + b rest_world_eh_r7r8 + +/* rest_world_eh_r7r8 is jumped to -- not called! -- when we're doing + the exception-handling epilog. R7 contains the offset to add to + the SP, and R8 contains the 'real' return address. + + USES: R0 R11 R12 [R7/R8] + RETURNS: C++ EH Data registers (R3 - R6.) */ + +rest_world_eh_r7r8: + bcl 20,31,Lr7r8$pb +Lr7r8$pb: mflr r12 + lwz r11,0(r1) + /* R11 := previous SP */ + addis r12,r12,ha16(L_has_vec$non_lazy_ptr-Lr7r8$pb) + lwz r12,lo16(L_has_vec$non_lazy_ptr-Lr7r8$pb)(r12) + lwz r0,4(r11) + /* R0 := old CR */ + lwz r12,0(r12) + /* R12 := HAS_VEC */ + mtcr r0 + cmpwi r12,0 + lmw r13,-220(r11) + beq L.rest_world_fp_eh + /* restore VRsave and V20..V31 */ + lwz r0,-224(r11) + li r12,-416 + mtspr VRsave,r0 + lvx v20,r11,r12 + li r12,-400 + lvx v21,r11,r12 + li r12,-384 + lvx v22,r11,r12 + li r12,-368 + lvx v23,r11,r12 + li r12,-352 + lvx v24,r11,r12 + li r12,-336 + lvx v25,r11,r12 + li r12,-320 + lvx v26,r11,r12 + li r12,-304 + lvx v27,r11,r12 + li r12,-288 + lvx v28,r11,r12 + li r12,-272 + lvx v29,r11,r12 + li r12,-256 + lvx v30,r11,r12 + li r12,-240 + lvx v31,r11,r12 + +L.rest_world_fp_eh: + lfd f14,-144(r11) + lfd f15,-136(r11) + lfd f16,-128(r11) + lfd f17,-120(r11) + lfd f18,-112(r11) + lfd f19,-104(r11) + lfd f20,-96(r11) + lfd f21,-88(r11) + lfd f22,-80(r11) + lfd f23,-72(r11) + lfd f24,-64(r11) + lfd f25,-56(r11) + lfd f26,-48(r11) + lfd f27,-40(r11) + lfd f28,-32(r11) + lfd f29,-24(r11) + lfd f30,-16(r11) + /* R8 is the exception-handler's address */ + mtctr r8 + lfd f31,-8(r11) + /* set SP to original value + R7 offset */ + add r1,r11,r7 + bctr diff --git a/contrib/gcc/config/rs6000/darwin.h b/contrib/gcc/config/rs6000/darwin.h index cae8bac3231..7bd53fcdc8a 100644 --- a/contrib/gcc/config/rs6000/darwin.h +++ b/contrib/gcc/config/rs6000/darwin.h @@ -1,5 +1,6 @@ /* Target definitions for PowerPC running Darwin (Mac OS X). - Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -16,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC)"); @@ -26,106 +27,180 @@ #define DEFAULT_ABI ABI_DARWIN +#ifdef IN_LIBGCC2 +#undef TARGET_64BIT +#ifdef __powerpc64__ +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif + /* The object file format is Mach-O. */ #define TARGET_OBJECT_FORMAT OBJECT_MACHO +/* Size of the Obj-C jump buffer. */ +#define OBJC_JBLEN ((TARGET_64BIT) ? (26*2 + 18*2 + 129 + 1) : (26 + 18*2 + 129 + 1)) + /* We're not ever going to do TOCs. */ #define TARGET_TOC 0 #define TARGET_NO_TOC 1 -/* Darwin switches. */ -/* Use dynamic-no-pic codegen (no picbase reg; not suitable for shlibs.) */ -#define MASK_MACHO_DYNAMIC_NO_PIC 0x00800000 - -#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC) - -/* Handle #pragma weak and #pragma pack. */ -#define HANDLE_SYSV_PRAGMA 1 +/* Override the default rs6000 definition. */ +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") +/* Translate config/rs6000/darwin.opt to config/darwin.h. */ +#define TARGET_DYNAMIC_NO_PIC (TARGET_MACHO_DYNAMIC_NO_PIC) #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__ppc__"); \ + if (!TARGET_64BIT) builtin_define ("__ppc__"); \ + if (TARGET_64BIT) builtin_define ("__ppc64__"); \ builtin_define ("__POWERPC__"); \ builtin_define ("__NATURAL_ALIGNMENT__"); \ - builtin_define ("__MACH__"); \ - builtin_define ("__APPLE__"); \ + darwin_cpp_builtins (pfile); \ } \ while (0) -/* */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"dynamic-no-pic", MASK_MACHO_DYNAMIC_NO_PIC, \ - N_("Generate code suitable for executables (NOT shared libs)")}, \ - {"no-dynamic-no-pic", -MASK_MACHO_DYNAMIC_NO_PIC, ""}, - - -/* The Darwin ABI always includes AltiVec, can't be (validly) turned - off. */ - -#define SUBTARGET_OVERRIDE_OPTIONS \ +#define SUBTARGET_OVERRIDE_OPTIONS \ do { \ + /* The Darwin ABI always includes AltiVec, can't be (validly) turned \ + off. */ \ rs6000_altivec_abi = 1; \ - rs6000_altivec_vrsave = 1; \ + TARGET_ALTIVEC_VRSAVE = 1; \ if (DEFAULT_ABI == ABI_DARWIN) \ { \ if (MACHO_DYNAMIC_NO_PIC_P) \ { \ if (flag_pic) \ - warning ("-mdynamic-no-pic overrides -fpic or -fPIC"); \ + warning (0, "-mdynamic-no-pic overrides -fpic or -fPIC"); \ flag_pic = 0; \ } \ else if (flag_pic == 1) \ { \ - /* Darwin doesn't support -fpic. */ \ - warning ("-fpic is not supported; -fPIC assumed"); \ flag_pic = 2; \ } \ } \ -}while(0) + if (TARGET_64BIT && ! TARGET_POWERPC64) \ + { \ + target_flags |= MASK_POWERPC64; \ + warning (0, "-m64 requires PowerPC64 architecture, enabling"); \ + } \ + if (flag_mkernel) \ + { \ + rs6000_default_long_calls = 1; \ + target_flags |= MASK_SOFT_FLOAT; \ + } \ + \ + /* Make -m64 imply -maltivec. Darwin's 64-bit ABI includes \ + Altivec. */ \ + if (!flag_mkernel && !flag_apple_kext \ + && TARGET_64BIT \ + && ! (target_flags_explicit & MASK_ALTIVEC)) \ + target_flags |= MASK_ALTIVEC; \ + \ + /* Unless the user (not the configurer) has explicitly overridden \ + it with -mcpu=G3 or -mno-altivec, then 10.5+ targets default to \ + G4 unless targetting the kernel. */ \ + if (!flag_mkernel \ + && !flag_apple_kext \ + && darwin_macosx_version_min \ + && strverscmp (darwin_macosx_version_min, "10.5") >= 0 \ + && ! (target_flags_explicit & MASK_ALTIVEC) \ + && ! rs6000_select[1].string) \ + { \ + target_flags |= MASK_ALTIVEC; \ + } \ +} while(0) + +#define C_COMMON_OVERRIDE_OPTIONS do { \ + /* On powerpc, __cxa_get_exception_ptr is available starting in the \ + 10.4.6 libstdc++.dylib. */ \ + if ((! darwin_macosx_version_min \ + || strverscmp (darwin_macosx_version_min, "10.4.6") < 0) \ + && flag_use_cxa_get_exception_ptr == 2) \ + flag_use_cxa_get_exception_ptr = 0; \ + if (flag_mkernel) \ + flag_no_builtin = 1; \ + SUBTARGET_C_COMMON_OVERRIDE_OPTIONS; \ +} while (0) + +/* Darwin has 128-bit long double support in libc in 10.4 and later. + Default to 128-bit long doubles even on earlier platforms for ABI + consistency; arithmetic will work even if libc and libm support is + not available. */ + +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 + /* We want -fPIC by default, unless we're using -static to compile for the kernel or some such. */ - #define CC1_SPEC "\ -%{gused: -feliminate-unused-debug-symbols % 10.4 mmacosx-version-min= crt2.o%s)}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ - { "darwin_arch", "ppc" }, + { "darwin_arch", DARWIN_ARCH_SPEC }, \ + { "darwin_crt2", DARWIN_CRT2_SPEC }, \ + { "darwin_subarch", DARWIN_SUBARCH_SPEC }, -/* The "-faltivec" option should have been called "-maltivec" all along. */ -#define SUBTARGET_OPTION_TRANSLATE_TABLE \ - { "-faltivec", "-maltivec -include altivec.h" }, \ - { "-fno-altivec", "-mno-altivec" }, \ - { "-Waltivec-long-deprecated", "-mwarn-altivec-long" }, \ +/* Output a .machine directive. */ +#undef TARGET_ASM_FILE_START +#define TARGET_ASM_FILE_START rs6000_darwin_file_start + +/* The "-faltivec" option should have been called "-maltivec" all + along. -ffix-and-continue and -findirect-data is for compatibility + for old compilers. */ + +#define SUBTARGET_OPTION_TRANSLATE_TABLE \ + { "-ffix-and-continue", "-mfix-and-continue" }, \ + { "-findirect-data", "-mfix-and-continue" }, \ + { "-faltivec", "-maltivec -include altivec.h" }, \ + { "-fno-altivec", "-mno-altivec" }, \ + { "-Waltivec-long-deprecated", "-mwarn-altivec-long" }, \ { "-Wno-altivec-long-deprecated", "-mno-warn-altivec-long" } -/* Make both r2 and r3 available for allocation. */ +/* Make both r2 and r13 available for allocation. */ #define FIXED_R2 0 #define FIXED_R13 0 /* Base register for access to local variables of the function. */ -#undef FRAME_POINTER_REGNUM -#define FRAME_POINTER_REGNUM 30 +#undef HARD_FRAME_POINTER_REGNUM +#define HARD_FRAME_POINTER_REGNUM 30 #undef RS6000_PIC_OFFSET_TABLE_REGNUM #define RS6000_PIC_OFFSET_TABLE_REGNUM 31 @@ -134,9 +209,10 @@ do { \ #undef STARTING_FRAME_OFFSET #define STARTING_FRAME_OFFSET \ - (RS6000_ALIGN (current_function_outgoing_args_size, 16) \ - + RS6000_VARARGS_AREA \ - + RS6000_SAVE_AREA) + (FRAME_GROWS_DOWNWARD \ + ? 0 \ + : (RS6000_ALIGN (current_function_outgoing_args_size, 16) \ + + RS6000_SAVE_AREA)) #undef STACK_DYNAMIC_OFFSET #define STACK_DYNAMIC_OFFSET(FUNDECL) \ @@ -146,7 +222,7 @@ do { \ /* These are used by -fbranch-probabilities */ #define HOT_TEXT_SECTION_NAME "__TEXT,__text,regular,pure_instructions" #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME \ - "__TEXT,__text2,regular,pure_instructions" + "__TEXT,__unlikely,regular,pure_instructions" /* Define cutoff for using external functions to save floating point. Currently on Darwin, always use inline stores. */ @@ -154,6 +230,10 @@ do { \ #undef FP_SAVE_INLINE #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64) +/* Darwin uses a function call if everything needs to be saved/restored. */ +#undef WORLD_SAVE_P +#define WORLD_SAVE_P(INFO) ((INFO)->world_save_p) + /* The assembler wants the alternate register names, but without leading percent sign. */ #undef REGISTER_NAMES @@ -175,7 +255,8 @@ do { \ "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", \ "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", \ "vrsave", "vscr", \ - "spe_acc", "spefscr" \ + "spe_acc", "spefscr", \ + "sfp" \ } /* This outputs NAME to FILE. */ @@ -199,13 +280,14 @@ do { \ /* This says how to output an assembler line to define a global common symbol. */ -/* ? */ -#undef ASM_OUTPUT_ALIGNED_COMMON -#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ - do { fputs (".comm ", (FILE)); \ - RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ - (SIZE)); } while (0) +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ + do { \ + unsigned HOST_WIDE_INT _new_size = SIZE; \ + fputs (".comm ", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + if (_new_size == 0) _new_size = 1; \ + fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", _new_size); \ + } while (0) /* Override the standard rs6000 definition. */ @@ -233,6 +315,19 @@ do { \ fprintf (FILE, "\t.align32 %d,0x60000000\n", (LOG)); \ } while (0) +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +/* This is supported in cctools 465 and later. The macro test + above prevents using it in earlier build environments. */ +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ + if ((LOG) != 0) \ + { \ + if ((MAX_SKIP) == 0) \ + fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else \ + fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ + } +#endif + /* Generate insns to call the profiler. */ #define PROFILE_HOOK(LABEL) output_profile_hook (LABEL) @@ -241,10 +336,12 @@ do { \ #define RS6000_MCOUNT "*mcount" -/* Default processor: a G4. */ +/* Default processor: G4, and G5 for 64-bit. */ #undef PROCESSOR_DEFAULT #define PROCESSOR_DEFAULT PROCESSOR_PPC7400 +#undef PROCESSOR_DEFAULT64 +#define PROCESSOR_DEFAULT64 PROCESSOR_POWER4 /* Default target flag settings. Despite the fact that STMW/LMW serializes, it's still a big code size win to use them. Use FSEL by @@ -254,9 +351,15 @@ do { \ #define TARGET_DEFAULT (MASK_POWERPC | MASK_MULTIPLE | MASK_NEW_MNEMONICS \ | MASK_PPC_GFXOPT) +/* Darwin only runs on PowerPC, so short-circuit POWER patterns. */ +#undef TARGET_POWER +#define TARGET_POWER 0 +#undef TARGET_IEEEQUAD +#define TARGET_IEEEQUAD 0 + /* Since Darwin doesn't do TOCs, stub this out. */ -#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) 0 +#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) ((void)X, (void)MODE, 0) /* Unlike most other PowerPC targets, chars are signed, for consistency with other Darwin architectures. */ @@ -264,11 +367,11 @@ do { \ #undef DEFAULT_SIGNED_CHAR #define DEFAULT_SIGNED_CHAR (1) -/* Given an rtx X being reloaded into a reg required to be - in class CLASS, return the class of reg to actually use. +/* Given an rtx X being reloaded into a reg required to be + in class CLASS, return the class of reg to actually use. In general this is just CLASS; but on some machines in some cases it is preferable to use a more restrictive class. - + On the RS/6000, we have to return NO_REGS when we want to reload a floating-point CONST_DOUBLE to force it to be copied to memory. @@ -277,8 +380,8 @@ do { \ #undef PREFERRED_RELOAD_CLASS #define PREFERRED_RELOAD_CLASS(X,CLASS) \ - ((GET_CODE (X) == CONST_DOUBLE \ - && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ + ((CONSTANT_P (X) \ + && reg_classes_intersect_p ((CLASS), FLOAT_REGS)) \ ? NO_REGS \ : ((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == HIGH) \ && reg_class_subset_p (BASE_REGS, (CLASS))) \ @@ -308,23 +411,64 @@ do { \ || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ && TARGET_ALIGN_NATURAL == 0 \ ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ - : (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \ + : (TREE_CODE (STRUCT) == VECTOR_TYPE \ + && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \ ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ : MAX ((COMPUTED), (SPECIFIED))) +/* Specify padding for the last element of a block move between + registers and memory. FIRST is nonzero if this is the only + element. */ +#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ + (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE)) + /* XXX: Darwin supports neither .quad, or .llong, but it also doesn't support 64 bit PowerPC either, so this just keeps things happy. */ #define DOUBLE_INT_ASM_OP "\t.quad\t" -/* Get HOST_WIDE_INT and CONST_INT to be 32 bits, for compile time - space/speed. */ -#undef MAX_LONG_TYPE_SIZE -#define MAX_LONG_TYPE_SIZE 32 - /* For binary compatibility with 2.95; Darwin C APIs use bool from - stdbool.h, which was an int-sized enum in 2.95. */ -#define BOOL_TYPE_SIZE INT_TYPE_SIZE + stdbool.h, which was an int-sized enum in 2.95. Users can explicitly + choose to have sizeof(bool)==1 with the -mone-byte-bool switch. */ +#define BOOL_TYPE_SIZE (darwin_one_byte_bool ? CHAR_TYPE_SIZE : INT_TYPE_SIZE) #undef REGISTER_TARGET_PRAGMAS -#define REGISTER_TARGET_PRAGMAS DARWIN_REGISTER_TARGET_PRAGMAS +#define REGISTER_TARGET_PRAGMAS() \ + do \ + { \ + DARWIN_REGISTER_TARGET_PRAGMAS(); \ + targetm.resolve_overloaded_builtin = altivec_resolve_overloaded_builtin; \ + } \ + while (0) +#ifdef IN_LIBGCC2 +#include +#endif + +#define MD_UNWIND_SUPPORT "config/rs6000/darwin-unwind.h" + +#define HAS_MD_FALLBACK_FRAME_STATE_FOR 1 + +/* True, iff we're generating fast turn around debugging code. When + true, we arrange for function prologues to start with 5 nops so + that gdb may insert code to redirect them, and for data to be + accessed indirectly. The runtime uses this indirection to forward + references for data to the original instance of that data. */ + +#define TARGET_FIX_AND_CONTINUE (darwin_fix_and_continue) + +/* This is the reserved direct dispatch address for Objective-C. */ +#define OFFS_MSGSEND_FAST 0xFFFEFF00 + +/* This is the reserved ivar address Objective-C. */ +#define OFFS_ASSIGNIVAR_FAST 0xFFFEFEC0 + +/* Old versions of Mac OS/Darwin don't have C99 functions available. */ +#undef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS \ + (TARGET_64BIT \ + || (darwin_macosx_version_min \ + && strverscmp (darwin_macosx_version_min, "10.3") >= 0)) + +/* When generating kernel code or kexts, we don't use Altivec by + default, as kernel code doesn't save/restore those registers. */ +#define OS_MISSING_ALTIVEC (flag_mkernel || flag_apple_kext) diff --git a/contrib/gcc/config/rs6000/darwin.md b/contrib/gcc/config/rs6000/darwin.md new file mode 100644 index 00000000000..c8e32871f6c --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin.md @@ -0,0 +1,440 @@ +/* Machine description patterns for PowerPC running Darwin (Mac OS X). + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by Apple Computer Inc. + +This file is part of GCC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +(define_insn "adddi3_high" + [(set (match_operand:DI 0 "gpc_reg_operand" "=b") + (plus:DI (match_operand:DI 1 "gpc_reg_operand" "b") + (high:DI (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_64BIT" + "{cau|addis} %0,%1,ha16(%2)" + [(set_attr "length" "4")]) + +(define_insn "movdf_low_si" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r") + (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && !TARGET_64BIT" + "* +{ + switch (which_alternative) + { + case 0: + return \"lfd %0,lo16(%2)(%1)\"; + case 1: + { + if (TARGET_POWERPC64 && TARGET_32BIT) + /* Note, old assemblers didn't support relocation here. */ + return \"ld %0,lo16(%2)(%1)\"; + else + { + output_asm_insn (\"{cal|la} %0,lo16(%2)(%1)\", operands); + output_asm_insn (\"{l|lwz} %L0,4(%0)\", operands); + return (\"{l|lwz} %0,0(%0)\"); + } + } + default: + gcc_unreachable (); + } +}" + [(set_attr "type" "load") + (set_attr "length" "4,12")]) + + +(define_insn "movdf_low_di" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r") + (mem:DF (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_64BIT" + "* +{ + switch (which_alternative) + { + case 0: + return \"lfd %0,lo16(%2)(%1)\"; + case 1: + return \"ld %0,lo16(%2)(%1)\"; + default: + gcc_unreachable (); + } +}" + [(set_attr "type" "load") + (set_attr "length" "4,4")]) + +(define_insn "movdf_low_st_si" + [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") + (match_operand 2 "" ""))) + (match_operand:DF 0 "gpc_reg_operand" "f"))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" + "stfd %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +(define_insn "movdf_low_st_di" + [(set (mem:DF (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b") + (match_operand 2 "" ""))) + (match_operand:DF 0 "gpc_reg_operand" "f"))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_64BIT" + "stfd %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +(define_insn "movsf_low_si" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r") + (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" + "@ + lfs %0,lo16(%2)(%1) + {l|lwz} %0,lo16(%2)(%1)" + [(set_attr "type" "load") + (set_attr "length" "4")]) + +(define_insn "movsf_low_di" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r") + (mem:SF (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_64BIT" + "@ + lfs %0,lo16(%2)(%1) + {l|lwz} %0,lo16(%2)(%1)" + [(set_attr "type" "load") + (set_attr "length" "4")]) + +(define_insn "movsf_low_st_si" + [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))) + (match_operand:SF 0 "gpc_reg_operand" "f,!r"))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" + "@ + stfs %0,lo16(%2)(%1) + {st|stw} %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +(define_insn "movsf_low_st_di" + [(set (mem:SF (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b") + (match_operand 2 "" ""))) + (match_operand:SF 0 "gpc_reg_operand" "f,!r"))] + "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_64BIT" + "@ + stfs %0,lo16(%2)(%1) + {st|stw} %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +;; 64-bit MachO load/store support +(define_insn "movdi_low" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (mem:DI (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b") + (match_operand 2 "" ""))))] + "TARGET_MACHO && TARGET_64BIT" + "{l|ld} %0,lo16(%2)(%1)" + [(set_attr "type" "load") + (set_attr "length" "4")]) + +(define_insn "movsi_low_st" + [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") + (match_operand 2 "" ""))) + (match_operand:SI 0 "gpc_reg_operand" "r"))] + "TARGET_MACHO && ! TARGET_64BIT" + "{st|stw} %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +(define_insn "movdi_low_st" + [(set (mem:DI (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b") + (match_operand 2 "" ""))) + (match_operand:DI 0 "gpc_reg_operand" "r"))] + "TARGET_MACHO && TARGET_64BIT" + "{st|std} %0,lo16(%2)(%1)" + [(set_attr "type" "store") + (set_attr "length" "4")]) + +;; Mach-O PIC trickery. +(define_expand "macho_high" + [(set (match_operand 0 "" "") + (high (match_operand 1 "" "")))] + "TARGET_MACHO" +{ + if (TARGET_64BIT) + emit_insn (gen_macho_high_di (operands[0], operands[1])); + else + emit_insn (gen_macho_high_si (operands[0], operands[1])); + + DONE; +}) + +(define_insn "macho_high_si" + [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r") + (high:SI (match_operand 1 "" "")))] + "TARGET_MACHO && ! TARGET_64BIT" + "{liu|lis} %0,ha16(%1)") + + +(define_insn "macho_high_di" + [(set (match_operand:DI 0 "gpc_reg_operand" "=b*r") + (high:DI (match_operand 1 "" "")))] + "TARGET_MACHO && TARGET_64BIT" + "{liu|lis} %0,ha16(%1)") + +(define_expand "macho_low" + [(set (match_operand 0 "" "") + (lo_sum (match_operand 1 "" "") + (match_operand 2 "" "")))] + "TARGET_MACHO" +{ + if (TARGET_64BIT) + emit_insn (gen_macho_low_di (operands[0], operands[1], operands[2])); + else + emit_insn (gen_macho_low_si (operands[0], operands[1], operands[2])); + + DONE; +}) + +(define_insn "macho_low_si" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") + (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r") + (match_operand 2 "" "")))] + "TARGET_MACHO && ! TARGET_64BIT" + "@ + {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)} + {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}") + +(define_insn "macho_low_di" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") + (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,!*r") + (match_operand 2 "" "")))] + "TARGET_MACHO && TARGET_64BIT" + "@ + {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)} + {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}") + +(define_split + [(set (mem:V4SI (plus:DI (match_operand:DI 0 "gpc_reg_operand" "") + (match_operand:DI 1 "short_cint_operand" ""))) + (match_operand:V4SI 2 "register_operand" "")) + (clobber (match_operand:DI 3 "gpc_reg_operand" ""))] + "TARGET_MACHO && TARGET_64BIT" + [(set (match_dup 3) (plus:DI (match_dup 0) (match_dup 1))) + (set (mem:V4SI (match_dup 3)) + (match_dup 2))] + "") + +(define_expand "load_macho_picbase" + [(set (match_operand 0 "" "") + (unspec [(match_operand 1 "" "")] + UNSPEC_LD_MPIC))] + "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" +{ + if (TARGET_32BIT) + emit_insn (gen_load_macho_picbase_si (operands[0], operands[1])); + else + emit_insn (gen_load_macho_picbase_di (operands[0], operands[1])); + + DONE; +}) + +(define_insn "load_macho_picbase_si" + [(set (match_operand:SI 0 "register_operand" "=l") + (unspec:SI [(match_operand:SI 1 "immediate_operand" "s") + (pc)] UNSPEC_LD_MPIC))] + "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" + "bcl 20,31,%1\\n%1:" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +(define_insn "load_macho_picbase_di" + [(set (match_operand:DI 0 "register_operand" "=l") + (unspec:DI [(match_operand:DI 1 "immediate_operand" "s") + (pc)] UNSPEC_LD_MPIC))] + "(DEFAULT_ABI == ABI_DARWIN) && flag_pic && TARGET_64BIT" + "bcl 20,31,%1\\n%1:" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +(define_expand "macho_correct_pic" + [(set (match_operand 0 "" "") + (plus (match_operand 1 "" "") + (unspec [(match_operand 2 "" "") + (match_operand 3 "" "")] + UNSPEC_MPIC_CORRECT)))] + "DEFAULT_ABI == ABI_DARWIN" +{ + if (TARGET_32BIT) + emit_insn (gen_macho_correct_pic_si (operands[0], operands[1], operands[2], + operands[3])); + else + emit_insn (gen_macho_correct_pic_di (operands[0], operands[1], operands[2], + operands[3])); + + DONE; +}) + +(define_insn "macho_correct_pic_si" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r") + (unspec:SI [(match_operand:SI 2 "immediate_operand" "s") + (match_operand:SI 3 "immediate_operand" "s")] + UNSPEC_MPIC_CORRECT)))] + "DEFAULT_ABI == ABI_DARWIN" + "addis %0,%1,ha16(%2-%3)\n\taddi %0,%0,lo16(%2-%3)" + [(set_attr "length" "8")]) + +(define_insn "macho_correct_pic_di" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (plus:DI (match_operand:DI 1 "gpc_reg_operand" "r") + (unspec:DI [(match_operand:DI 2 "immediate_operand" "s") + (match_operand:DI 3 "immediate_operand" "s")] + 16)))] + "DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT" + "addis %0,%1,ha16(%2-%3)\n\taddi %0,%0,lo16(%2-%3)" + [(set_attr "length" "8")]) + +(define_insn "*call_indirect_nonlocal_darwin64" + [(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l,c,*l")) + (match_operand 1 "" "g,g,g,g")) + (use (match_operand:SI 2 "immediate_operand" "O,O,n,n")) + (clobber (match_scratch:SI 3 "=l,l,l,l"))] + "DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT" +{ + return "b%T0l"; +} + [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") + (set_attr "length" "4,4,8,8")]) + +(define_insn "*call_nonlocal_darwin64" + [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s,s")) + (match_operand 1 "" "g,g")) + (use (match_operand:SI 2 "immediate_operand" "O,n")) + (clobber (match_scratch:SI 3 "=l,l"))] + "(DEFAULT_ABI == ABI_DARWIN) + && (INTVAL (operands[2]) & CALL_LONG) == 0" +{ +#if TARGET_MACHO + return output_call(insn, operands, 0, 2); +#else + gcc_unreachable (); +#endif +} + [(set_attr "type" "branch,branch") + (set_attr "length" "4,8")]) + +(define_insn "*call_value_indirect_nonlocal_darwin64" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:DI 1 "register_operand" "c,*l,c,*l")) + (match_operand 2 "" "g,g,g,g"))) + (use (match_operand:SI 3 "immediate_operand" "O,O,n,n")) + (clobber (match_scratch:SI 4 "=l,l,l,l"))] + "DEFAULT_ABI == ABI_DARWIN" +{ + return "b%T1l"; +} + [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") + (set_attr "length" "4,4,8,8")]) + +(define_insn "*call_value_nonlocal_darwin64" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s,s")) + (match_operand 2 "" "g,g"))) + (use (match_operand:SI 3 "immediate_operand" "O,n")) + (clobber (match_scratch:SI 4 "=l,l"))] + "(DEFAULT_ABI == ABI_DARWIN) + && (INTVAL (operands[3]) & CALL_LONG) == 0" +{ +#if TARGET_MACHO + return output_call(insn, operands, 1, 3); +#else + gcc_unreachable (); +#endif +} + [(set_attr "type" "branch,branch") + (set_attr "length" "4,8")]) + +(define_insn "*sibcall_nonlocal_darwin64" + [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s,s")) + (match_operand 1 "" "")) + (use (match_operand 2 "immediate_operand" "O,n")) + (use (match_operand:SI 3 "register_operand" "l,l")) + (return)] + "(DEFAULT_ABI == ABI_DARWIN) + && (INTVAL (operands[2]) & CALL_LONG) == 0" +{ + return "b %z0"; +} + [(set_attr "type" "branch,branch") + (set_attr "length" "4,8")]) + +(define_insn "*sibcall_value_nonlocal_darwin64" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s,s")) + (match_operand 2 "" ""))) + (use (match_operand:SI 3 "immediate_operand" "O,n")) + (use (match_operand:SI 4 "register_operand" "l,l")) + (return)] + "(DEFAULT_ABI == ABI_DARWIN) + && (INTVAL (operands[3]) & CALL_LONG) == 0" + "* +{ + return \"b %z1\"; +}" + [(set_attr "type" "branch,branch") + (set_attr "length" "4,8")]) + + +(define_insn "*sibcall_symbolic_64" + [(call (mem:SI (match_operand:DI 0 "call_operand" "s,c")) ; 64 + (match_operand 1 "" "")) + (use (match_operand 2 "" "")) + (use (match_operand:SI 3 "register_operand" "l,l")) + (return)] + "TARGET_64BIT && DEFAULT_ABI == ABI_DARWIN" + "* +{ + switch (which_alternative) + { + case 0: return \"b %z0\"; + case 1: return \"b%T0\"; + default: gcc_unreachable (); + } +}" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + +(define_insn "*sibcall_value_symbolic_64" + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:DI 1 "call_operand" "s,c")) + (match_operand 2 "" ""))) + (use (match_operand:SI 3 "" "")) + (use (match_operand:SI 4 "register_operand" "l,l")) + (return)] + "TARGET_64BIT && DEFAULT_ABI == ABI_DARWIN" + "* +{ + switch (which_alternative) + { + case 0: return \"b %z1\"; + case 1: return \"b%T1\"; + default: gcc_unreachable (); + } +}" + [(set_attr "type" "branch") + (set_attr "length" "4")]) + diff --git a/contrib/gcc/config/rs6000/darwin.opt b/contrib/gcc/config/rs6000/darwin.opt new file mode 100644 index 00000000000..99b38ec7224 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin.opt @@ -0,0 +1,33 @@ +; Darwin options for PPC port. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +m64 +Target RejectNegative Mask(64BIT) +Generate 64-bit code + +m32 +Target RejectNegative InverseMask(64BIT) +Generate 32-bit code + +mdynamic-no-pic +Target Report Mask(MACHO_DYNAMIC_NO_PIC) +Generate code suitable for executables (NOT shared libs) diff --git a/contrib/gcc/config/rs6000/darwin64.h b/contrib/gcc/config/rs6000/darwin64.h new file mode 100644 index 00000000000..80e802d8913 --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin64.h @@ -0,0 +1,36 @@ +/* Target definitions for PowerPC running Darwin (Mac OS X). + Copyright (C) 2006 Free Software Foundation, Inc. + Contributed by Apple Computer Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC64)"); + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_POWERPC | MASK_POWERPC64 | MASK_64BIT \ + | MASK_MULTIPLE | MASK_NEW_MNEMONICS | MASK_PPC_GFXOPT) + +#undef DARWIN_ARCH_SPEC +#define DARWIN_ARCH_SPEC "ppc64" + +#undef DARWIN_SUBARCH_SPEC +#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC + +#undef DARWIN_CRT2_SPEC +#define DARWIN_CRT2_SPEC "" diff --git a/contrib/gcc/config/rs6000/darwin7.h b/contrib/gcc/config/rs6000/darwin7.h new file mode 100644 index 00000000000..4c1cda3ca8e --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin7.h @@ -0,0 +1,31 @@ +/* Target definitions for Darwin 7.x (Mac OS X) systems. + Copyright (C) 2004, 2005 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Machine dependent libraries. Include libmx when compiling for + Darwin 7.0 and above, but before libSystem, since the functions are + actually in libSystem but for 7.x compatibility we want them to be + looked for in libmx first. Include libmx by default because otherwise + libstdc++ isn't usable. */ + +#undef LIB_SPEC +#define LIB_SPEC "%{!static:\ + %:version-compare(!< 10.3 mmacosx-version-min= -lmx)\ + -lSystem}" diff --git a/contrib/gcc/config/rs6000/darwin8.h b/contrib/gcc/config/rs6000/darwin8.h new file mode 100644 index 00000000000..ee583a2cc5c --- /dev/null +++ b/contrib/gcc/config/rs6000/darwin8.h @@ -0,0 +1,33 @@ +/* Target definitions for Darwin 8.0 and above (Mac OS X) systems. + Copyright (C) 2004, 2005 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Machine dependent libraries. Include libmx when compiling on + Darwin 7.0 and above, but before libSystem, since the functions are + actually in libSystem but for 7.x compatibility we want them to be + looked for in libmx first---but only do this if 7.x compatibility + is a concern, which it's not in 64-bit mode. Include + libSystemStubs when compiling on (not necessarily for) 8.0 and + above and not 64-bit long double. */ + +#undef LIB_SPEC +#define LIB_SPEC "%{!static:\ + %{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \ + %{!m64:%:version-compare(>< 10.3 10.4 mmacosx-version-min= -lmx)} -lSystem}" diff --git a/contrib/gcc/config/rs6000/default64.h b/contrib/gcc/config/rs6000/default64.h index c6ed142d69b..10fe09c1190 100644 --- a/contrib/gcc/config/rs6000/default64.h +++ b/contrib/gcc/config/rs6000/default64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for 64 bit powerpc linux defaulting to -m64. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,9 +16,10 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (MASK_POWERPC | MASK_POWERPC64 | MASK_64BIT | MASK_NEW_MNEMONICS) + (MASK_POWERPC | MASK_PPC_GFXOPT | \ + MASK_POWERPC64 | MASK_64BIT | MASK_NEW_MNEMONICS) diff --git a/contrib/gcc/config/rs6000/e500-double.h b/contrib/gcc/config/rs6000/e500-double.h new file mode 100644 index 00000000000..55587e469b8 --- /dev/null +++ b/contrib/gcc/config/rs6000/e500-double.h @@ -0,0 +1,25 @@ +/* Target definitions for E500 with double precision FP. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. + Contributed by Aldy Hernandez (aldyh@redhat.com). + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + 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, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#undef SUB3TARGET_OVERRIDE_OPTIONS +#define SUB3TARGET_OVERRIDE_OPTIONS \ + if (!rs6000_explicit_options.float_gprs) \ + rs6000_float_gprs = 2; diff --git a/contrib/gcc/config/rs6000/eabi-ci.asm b/contrib/gcc/config/rs6000/eabi-ci.asm index 447b4e2378c..d32120f13f1 100644 --- a/contrib/gcc/config/rs6000/eabi-ci.asm +++ b/contrib/gcc/config/rs6000/eabi-ci.asm @@ -22,8 +22,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/eabi-cn.asm b/contrib/gcc/config/rs6000/eabi-cn.asm index b2c609532ce..90a5da75c16 100644 --- a/contrib/gcc/config/rs6000/eabi-cn.asm +++ b/contrib/gcc/config/rs6000/eabi-cn.asm @@ -22,8 +22,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/eabi.asm b/contrib/gcc/config/rs6000/eabi.asm index c7876bca1da..b5d4505d9ed 100644 --- a/contrib/gcc/config/rs6000/eabi.asm +++ b/contrib/gcc/config/rs6000/eabi.asm @@ -24,8 +24,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/eabi.h b/contrib/gcc/config/rs6000/eabi.h index ff8df2c3e41..323e5ad51dd 100644 --- a/contrib/gcc/config/rs6000/eabi.h +++ b/contrib/gcc/config/rs6000/eabi.h @@ -1,6 +1,6 @@ /* Core target definitions for GNU compiler for IBM RS/6000 PowerPC targeted to embedded ELF systems. - Copyright (C) 1995, 1996, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2000, 2003, 2004 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GCC. @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Add -meabi to target flags. */ #undef TARGET_DEFAULT @@ -49,9 +49,13 @@ #undef TARGET_E500 #undef TARGET_ISEL #undef TARGET_FPRS +#undef TARGET_E500_SINGLE +#undef TARGET_E500_DOUBLE #define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE rs6000_spe #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) #define TARGET_ISEL rs6000_isel -#define TARGET_FPRS (!rs6000_float_gprs) +#define TARGET_FPRS (rs6000_float_gprs == 0) +#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1) +#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2) diff --git a/contrib/gcc/config/rs6000/eabialtivec.h b/contrib/gcc/config/rs6000/eabialtivec.h index e407e3bc7cf..437c0c84e17 100644 --- a/contrib/gcc/config/rs6000/eabialtivec.h +++ b/contrib/gcc/config/rs6000/eabialtivec.h @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Add -meabi and -maltivec to target flags. */ #undef TARGET_DEFAULT diff --git a/contrib/gcc/config/rs6000/eabisim.h b/contrib/gcc/config/rs6000/eabisim.h index 5e0900d9c1e..171c791f660 100644 --- a/contrib/gcc/config/rs6000/eabisim.h +++ b/contrib/gcc/config/rs6000/eabisim.h @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)"); diff --git a/contrib/gcc/config/rs6000/eabispe.h b/contrib/gcc/config/rs6000/eabispe.h index 1551dc1305d..2a0b92368c0 100644 --- a/contrib/gcc/config/rs6000/eabispe.h +++ b/contrib/gcc/config/rs6000/eabispe.h @@ -1,6 +1,6 @@ /* Core target definitions for GNU compiler for PowerPC embedded targeted systems with SPE support. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Aldy Hernandez (aldyh@redhat.com). This file is part of GCC. @@ -17,11 +17,12 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI) +#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI \ + | MASK_STRICT_ALIGN) #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC Embedded SPE)"); @@ -30,17 +31,19 @@ #define SUBSUBTARGET_OVERRIDE_OPTIONS \ if (rs6000_select[1].string == NULL) \ rs6000_cpu = PROCESSOR_PPC8540; \ - if (rs6000_abi_string == NULL) \ + if (!rs6000_explicit_options.abi) \ rs6000_spe_abi = 1; \ - if (rs6000_float_gprs_string == NULL) \ + if (!rs6000_explicit_options.float_gprs) \ rs6000_float_gprs = 1; \ /* See note below. */ \ - /*if (rs6000_long_double_size_string == NULL)*/ \ + /*if (!rs6000_explicit_options.long_double)*/ \ /* rs6000_long_double_type_size = 128;*/ \ - if (rs6000_spe_string == NULL) \ + if (!rs6000_explicit_options.spe) \ rs6000_spe = 1; \ - if (rs6000_isel_string == NULL) \ - rs6000_isel = 1 + if (!rs6000_explicit_options.isel) \ + rs6000_isel = 1; \ + if (target_flags & MASK_64BIT) \ + error ("-m64 not supported in this configuration") /* The e500 ABI says that either long doubles are 128 bits, or if implemented in any other size, the compiler/linker should error out. diff --git a/contrib/gcc/config/rs6000/freebsd.h b/contrib/gcc/config/rs6000/freebsd.h index fe6a801bb2c..edd267d8e48 100644 --- a/contrib/gcc/config/rs6000/freebsd.h +++ b/contrib/gcc/config/rs6000/freebsd.h @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Override the defaults, which exist to force the proper definition. */ diff --git a/contrib/gcc/config/rs6000/gnu.h b/contrib/gcc/config/rs6000/gnu.h index 658a6d60193..b7ddbfbdac0 100644 --- a/contrib/gcc/config/rs6000/gnu.h +++ b/contrib/gcc/config/rs6000/gnu.h @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_gnu)" diff --git a/contrib/gcc/config/rs6000/host-darwin.c b/contrib/gcc/config/rs6000/host-darwin.c index d04270c3675..be0c55f312a 100644 --- a/contrib/gcc/config/rs6000/host-darwin.c +++ b/contrib/gcc/config/rs6000/host-darwin.c @@ -1,5 +1,5 @@ /* Darwin/powerpc host-specific hook definitions. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -15,27 +15,37 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "config.h" #include "system.h" #include "coretypes.h" #include #include -#include #include "hosthooks.h" #include "hosthooks-def.h" #include "toplev.h" #include "diagnostic.h" +#include "config/host-darwin.h" static void segv_crash_handler (int); static void segv_handler (int, siginfo_t *, void *); static void darwin_rs6000_extra_signals (void); +#ifndef HAVE_DECL_SIGALTSTACK /* This doesn't have a prototype in signal.h in 10.2.x and earlier, fixed in later releases. */ extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *); +#endif + +/* The fields of the mcontext_t type have acquired underscores in later + OS versions. */ +#ifdef HAS_MCONTEXT_T_UNDERSCORES +#define MC_FLD(x) __ ## x +#else +#define MC_FLD(x) x +#endif #undef HOST_HOOKS_EXTRA_SIGNALS #define HOST_HOOKS_EXTRA_SIGNALS darwin_rs6000_extra_signals @@ -58,13 +68,17 @@ segv_handler (int sig ATTRIBUTE_UNUSED, void *scp) { ucontext_t *uc = (ucontext_t *)scp; + sigset_t sigset; unsigned faulting_insn; /* The fault might have happened when trying to run some instruction, in which case the next line will segfault _again_. Handle this case. */ signal (SIGSEGV, segv_crash_handler); + sigemptyset (&sigset); + sigaddset (&sigset, SIGSEGV); + sigprocmask (SIG_UNBLOCK, &sigset, NULL); - faulting_insn = *(unsigned *)uc->uc_mcontext->ss.srr0; + faulting_insn = *(unsigned *)uc->uc_mcontext->MC_FLD(ss).MC_FLD(srr0); /* Note that this only has to work for GCC, so we don't have to deal with all the possible cases (GCC has no AltiVec code, for @@ -73,7 +87,7 @@ segv_handler (int sig ATTRIBUTE_UNUSED, this. */ if ((faulting_insn & 0xFFFF8000) == 0x94218000 /* stwu %r1, -xxx(%r1) */ - || (faulting_insn & 0xFFFF03FF) == 0x7C21016E /* stwux %r1, xxx, %r1 */ + || (faulting_insn & 0xFC1F03FF) == 0x7C01016E /* stwux xxx, %r1, xxx */ || (faulting_insn & 0xFC1F8000) == 0x90018000 /* stw xxx, -yyy(%r1) */ || (faulting_insn & 0xFC1F8000) == 0xD8018000 /* stfd xxx, -yyy(%r1) */ || (faulting_insn & 0xFC1F8000) == 0xBC018000 /* stmw xxx, -yyy(%r1) */) @@ -101,19 +115,20 @@ segv_handler (int sig ATTRIBUTE_UNUSED, if (strcmp (shell_commands[i][0], shell_name + 1) == 0) { fnotice (stderr, - "Try running `%s' in the shell to raise its limit.\n", + "Try running '%s' in the shell to raise its limit.\n", shell_commands[i][1]); } } if (global_dc->abort_on_error) - abort (); + fancy_abort (__FILE__, __LINE__, __FUNCTION__); exit (FATAL_EXIT_CODE); } fprintf (stderr, "[address=%08lx pc=%08x]\n", - uc->uc_mcontext->es.dar, uc->uc_mcontext->ss.srr0); + uc->uc_mcontext->MC_FLD(es).MC_FLD(dar), + uc->uc_mcontext->MC_FLD(ss).MC_FLD(srr0)); internal_error ("Segmentation Fault"); exit (FATAL_EXIT_CODE); } @@ -137,65 +152,5 @@ darwin_rs6000_extra_signals (void) fatal_error ("While setting up signal handler: %m"); } -#undef HOST_HOOKS_GT_PCH_GET_ADDRESS -#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_rs6000_gt_pch_get_address -#undef HOST_HOOKS_GT_PCH_USE_ADDRESS -#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_rs6000_gt_pch_use_address - -/* Yes, this is really supposed to work. */ -static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); - -/* Return the address of the PCH address space, if the PCH will fit in it. */ - -static void * -darwin_rs6000_gt_pch_get_address (size_t sz, int fd ATTRIBUTE_UNUSED) -{ - if (sz <= sizeof (pch_address_space)) - return pch_address_space; - else - return NULL; -} - -/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of - pch_address_space beyond SZ. */ - -static int -darwin_rs6000_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) -{ - const size_t pagesize = getpagesize(); - void *mmap_result; - int ret; - - if ((size_t)pch_address_space % pagesize != 0 - || sizeof (pch_address_space) % pagesize != 0) - abort (); - - ret = (addr == pch_address_space && sz <= sizeof (pch_address_space)); - if (! ret) - sz = 0; - - /* Round the size to a whole page size. Normally this is a no-op. */ - sz = (sz + pagesize - 1) / pagesize * pagesize; - - if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0) - fatal_error ("couldn't unmap pch_address_space: %m\n"); - - if (ret) - { - mmap_result = mmap (addr, sz, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, - fd, off); - - /* The file might not be mmap-able. */ - ret = mmap_result != (void *) MAP_FAILED; - - /* Sanity check for broken MAP_FIXED. */ - if (ret && mmap_result != addr) - abort (); - } - - return ret; -} - const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/rs6000/host-ppc64-darwin.c b/contrib/gcc/config/rs6000/host-ppc64-darwin.c new file mode 100644 index 00000000000..ec7f9b3f11b --- /dev/null +++ b/contrib/gcc/config/rs6000/host-ppc64-darwin.c @@ -0,0 +1,31 @@ +/* ppc64-darwin host-specific hook definitions. + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "hosthooks.h" +#include "hosthooks-def.h" +#include "config/host-darwin.h" + +/* Darwin doesn't do anything special for ppc64 hosts; this file exists just + to include config/host-darwin.h. */ + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/contrib/gcc/config/rs6000/kaos-ppc.h b/contrib/gcc/config/rs6000/kaos-ppc.h index d6b92e73e6a..eb18541ad01 100644 --- a/contrib/gcc/config/rs6000/kaos-ppc.h +++ b/contrib/gcc/config/rs6000/kaos-ppc.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (PowerPC/kaOS[ELF])", stderr); diff --git a/contrib/gcc/config/rs6000/libgcc-ppc-glibc.ver b/contrib/gcc/config/rs6000/libgcc-ppc-glibc.ver new file mode 100644 index 00000000000..cf023dda158 --- /dev/null +++ b/contrib/gcc/config/rs6000/libgcc-ppc-glibc.ver @@ -0,0 +1,52 @@ +%ifndef _SOFT_FLOAT +%ifndef __powerpc64__ +%exclude { + __multc3 + __divtc3 + __powitf2 + __fixtfdi + __fixunstfdi + __floatditf +} + +GCC_4.1.0 { + # long double support + __multc3 + __divtc3 + __powitf2 + __fixtfdi + __fixunstfdi + __floatditf + +%else +GCC_3.4.4 { +%endif +%else +GCC_4.2.0 { +%endif + + # long double support + __gcc_qadd + __gcc_qsub + __gcc_qmul + __gcc_qdiv + +%ifdef _SOFT_FLOAT + __gcc_qneg + __gcc_qeq + __gcc_qne + __gcc_qgt + __gcc_qge + __gcc_qlt + __gcc_qle + __gcc_qunord + __gcc_stoq + __gcc_dtoq + __gcc_qtos + __gcc_qtod + __gcc_qtoi + __gcc_qtou + __gcc_itoq + __gcc_utoq +%endif +} diff --git a/contrib/gcc/config/rs6000/linux-unwind.h b/contrib/gcc/config/rs6000/linux-unwind.h index 842fd1081ec..6a59a544b17 100644 --- a/contrib/gcc/config/rs6000/linux-unwind.h +++ b/contrib/gcc/config/rs6000/linux-unwind.h @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for PowerPC and PowerPC64 Linux. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -23,8 +23,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* This file defines our own versions of various kernel and user structs, so that system headers are not needed, which otherwise @@ -89,234 +89,260 @@ struct gcc_ucontext enum { SIGNAL_FRAMESIZE = 128 }; -/* If the current unwind info (FS) does not contain explicit info - saving R2, then we have to do a minor amount of code reading to - figure out if it was saved. The big problem here is that the - code that does the save/restore is generated by the linker, so - we have no good way to determine at compile time what to do. */ - -#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ - do { \ - if ((FS)->regs.reg[2].how == REG_UNSAVED) \ - { \ - unsigned int *insn \ - = (unsigned int *) \ - _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ - if (*insn == 0xE8410028) \ - _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ - } \ - } while (0) - /* If PC is at a sigreturn trampoline, return a pointer to the regs. Otherwise return NULL. */ -#define PPC_LINUX_GET_REGS(CONTEXT) \ -({ \ - const unsigned char *pc = (CONTEXT)->ra; \ - struct gcc_regs *regs = NULL; \ - \ - /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ \ - /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ \ - if (*(unsigned int *) (pc + 0) != 0x38210000 + SIGNAL_FRAMESIZE \ - || *(unsigned int *) (pc + 8) != 0x44000002) \ - ; \ - else if (*(unsigned int *) (pc + 4) == 0x38000077) \ - { \ - struct sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - unsigned long pad[7]; \ - struct gcc_regs *regs; \ - } *frame = (struct sigframe *) (CONTEXT)->cfa; \ - regs = frame->regs; \ - } \ - else if (*(unsigned int *) (pc + 4) == 0x380000AC) \ - { \ - /* This works for 2.4 kernels, but not for 2.6 kernels with vdso \ - because pc isn't pointing into the stack. Can be removed when \ - no one is running 2.4.19 or 2.4.20, the first two ppc64 \ - kernels released. */ \ - struct rt_sigframe_24 { \ - int tramp[6]; \ - void *pinfo; \ - struct gcc_ucontext *puc; \ - } *frame24 = (struct rt_sigframe_24 *) pc; \ - \ - /* Test for magic value in *puc of vdso. */ \ - if ((long) frame24->puc != -21 * 8) \ - regs = frame24->puc->regs; \ - else \ - { \ - /* This works for 2.4.21 and later kernels. */ \ - struct rt_sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - struct gcc_ucontext uc; \ - unsigned long pad[2]; \ - int tramp[6]; \ - void *pinfo; \ - struct gcc_ucontext *puc; \ - } *frame = (struct rt_sigframe *) (CONTEXT)->cfa; \ - regs = frame->uc.regs; \ - } \ - } \ - regs; \ -}) +static struct gcc_regs * +get_regs (struct _Unwind_Context *context) +{ + const unsigned char *pc = context->ra; -#define LINUX_HWCAP_DEFAULT 0xc0000000 + /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ + /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ + if (*(unsigned int *) (pc + 0) != 0x38210000 + SIGNAL_FRAMESIZE + || *(unsigned int *) (pc + 8) != 0x44000002) + return NULL; + if (*(unsigned int *) (pc + 4) == 0x38000077) + { + struct sigframe { + char gap[SIGNAL_FRAMESIZE]; + unsigned long pad[7]; + struct gcc_regs *regs; + } *frame = (struct sigframe *) context->cfa; + return frame->regs; + } + else if (*(unsigned int *) (pc + 4) == 0x380000AC) + { + /* This works for 2.4 kernels, but not for 2.6 kernels with vdso + because pc isn't pointing into the stack. Can be removed when + no one is running 2.4.19 or 2.4.20, the first two ppc64 + kernels released. */ + struct rt_sigframe_24 { + int tramp[6]; + void *pinfo; + struct gcc_ucontext *puc; + } *frame24 = (struct rt_sigframe_24 *) pc; -#define PPC_LINUX_VREGS(REGS) (REGS)->vp + /* Test for magic value in *puc of vdso. */ + if ((long) frame24->puc != -21 * 8) + return frame24->puc->regs; + else + { + /* This works for 2.4.21 and later kernels. */ + struct rt_sigframe { + char gap[SIGNAL_FRAMESIZE]; + struct gcc_ucontext uc; + unsigned long pad[2]; + int tramp[6]; + void *pinfo; + struct gcc_ucontext *puc; + } *frame = (struct rt_sigframe *) context->cfa; + return frame->uc.regs; + } + } + return NULL; +} #else /* !__powerpc64__ */ enum { SIGNAL_FRAMESIZE = 64 }; -#define PPC_LINUX_GET_REGS(CONTEXT) \ -({ \ - const unsigned char *pc = (CONTEXT)->ra; \ - struct gcc_regs *regs = NULL; \ - \ - /* li r0, 0x7777; sc (sigreturn old) */ \ - /* li r0, 0x0077; sc (sigreturn new) */ \ - /* li r0, 0x6666; sc (rt_sigreturn old) */ \ - /* li r0, 0x00AC; sc (rt_sigreturn new) */ \ - if (*(unsigned int *) (pc + 4) != 0x44000002) \ - ; \ - else if (*(unsigned int *) (pc + 0) == 0x38007777 \ - || *(unsigned int *) (pc + 0) == 0x38000077) \ - { \ - struct sigframe { \ - char gap[SIGNAL_FRAMESIZE]; \ - unsigned long pad[7]; \ - struct gcc_regs *regs; \ - } *frame = (struct sigframe *) (CONTEXT)->cfa; \ - regs = frame->regs; \ - } \ - else if (*(unsigned int *) (pc + 0) == 0x38006666 \ - || *(unsigned int *) (pc + 0) == 0x380000AC) \ - { \ - struct rt_sigframe { \ - char gap[SIGNAL_FRAMESIZE + 16]; \ - char siginfo[128]; \ - struct gcc_ucontext uc; \ - } *frame = (struct rt_sigframe *) (CONTEXT)->cfa; \ - regs = frame->uc.regs; \ - } \ - regs; \ -}) - -#define LINUX_HWCAP_DEFAULT 0x80000000 - -#define PPC_LINUX_VREGS(REGS) &(REGS)->vregs +static struct gcc_regs * +get_regs (struct _Unwind_Context *context) +{ + const unsigned char *pc = context->ra; + /* li r0, 0x7777; sc (sigreturn old) */ + /* li r0, 0x0077; sc (sigreturn new) */ + /* li r0, 0x6666; sc (rt_sigreturn old) */ + /* li r0, 0x00AC; sc (rt_sigreturn new) */ + if (*(unsigned int *) (pc + 4) != 0x44000002) + return NULL; + if (*(unsigned int *) (pc + 0) == 0x38007777 + || *(unsigned int *) (pc + 0) == 0x38000077) + { + struct sigframe { + char gap[SIGNAL_FRAMESIZE]; + unsigned long pad[7]; + struct gcc_regs *regs; + } *frame = (struct sigframe *) context->cfa; + return frame->regs; + } + else if (*(unsigned int *) (pc + 0) == 0x38006666 + || *(unsigned int *) (pc + 0) == 0x380000AC) + { + struct rt_sigframe { + char gap[SIGNAL_FRAMESIZE + 16]; + char siginfo[128]; + struct gcc_ucontext uc; + } *frame = (struct rt_sigframe *) context->cfa; + return frame->uc.regs; + } + return NULL; +} #endif +/* Find an entry in the process auxiliary vector. The canonical way to + test for VMX is to look at AT_HWCAP. */ + +static long +ppc_linux_aux_vector (long which) +{ + /* __libc_stack_end holds the original stack passed to a process. */ + extern long *__libc_stack_end; + long argc; + char **argv; + char **envp; + struct auxv + { + long a_type; + long a_val; + } *auxp; + + /* The Linux kernel puts argc first on the stack. */ + argc = __libc_stack_end[0]; + /* Followed by argv, NULL terminated. */ + argv = (char **) __libc_stack_end + 1; + /* Followed by environment string pointers, NULL terminated. */ + envp = argv + argc + 1; + while (*envp++) + continue; + /* Followed by the aux vector, zero terminated. */ + for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) + if (auxp->a_type == which) + return auxp->a_val; + return 0; +} + /* Do code reading to identify a signal frame, and set the frame state data appropriately. See unwind-dw2.c for the structs. */ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - static long hwcap = 0; \ - struct gcc_regs *regs = PPC_LINUX_GET_REGS (CONTEXT); \ - long new_cfa; \ - int i; \ - \ - if (regs == NULL) \ - break; \ - \ - new_cfa = regs->gpr[STACK_POINTER_REGNUM]; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = STACK_POINTER_REGNUM; \ - (FS)->cfa_offset = new_cfa - (long) (CONTEXT)->cfa; \ - \ - for (i = 0; i < 32; i++) \ - if (i != STACK_POINTER_REGNUM) \ - { \ - (FS)->regs.reg[i].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i].loc.offset \ - = (long) ®s->gpr[i] - new_cfa; \ - } \ - \ - (FS)->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[CR2_REGNO].loc.offset \ - = (long) ®s->ccr - new_cfa; \ - \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \ - = (long) ®s->link - new_cfa; \ - \ - (FS)->regs.reg[ARG_POINTER_REGNUM].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[ARG_POINTER_REGNUM].loc.offset \ - = (long) ®s->nip - new_cfa; \ - (FS)->retaddr_column = ARG_POINTER_REGNUM; \ - \ - if (hwcap == 0) \ - { \ - /* __libc_stack_end holds the original stack passed to a \ - process. */ \ - extern long *__libc_stack_end; \ - long argc; \ - char **argv; \ - char **envp; \ - struct auxv \ - { \ - long a_type; \ - long a_val; \ - } *auxp; \ - \ - /* The Linux kernel puts argc first on the stack. */ \ - argc = __libc_stack_end[0]; \ - /* Followed by argv, NULL terminated. */ \ - argv = (char **) __libc_stack_end + 1; \ - /* Followed by environment string pointers, NULL terminated. */ \ - envp = argv + argc + 1; \ - while (*envp++) \ - continue; \ - /* Followed by the aux vector, zero terminated. */ \ - for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp) \ - if (auxp->a_type == 16) \ - { \ - hwcap = auxp->a_val; \ - break; \ - } \ - \ - /* These will already be set if we found AT_HWCAP. A non-zero \ - value stops us looking again if for some reason we couldn't \ - find AT_HWCAP. */ \ - hwcap |= LINUX_HWCAP_DEFAULT; \ - } \ - \ - /* If we have a FPU... */ \ - if (hwcap & 0x08000000) \ - for (i = 0; i < 32; i++) \ - { \ - (FS)->regs.reg[i + 32].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i + 32].loc.offset \ - = (long) ®s->fpr[i] - new_cfa; \ - } \ - \ - /* If we have a VMX unit... */ \ - if (hwcap & 0x10000000) \ - { \ - struct gcc_vregs *vregs; \ - vregs = PPC_LINUX_VREGS (regs); \ - if (regs->msr & (1 << 25)) \ - { \ - for (i = 0; i < 32; i++) \ - { \ - (FS)->regs.reg[i + FIRST_ALTIVEC_REGNO].how \ - = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i + FIRST_ALTIVEC_REGNO].loc.offset \ - = (long) &vregs[i] - new_cfa; \ - } \ - \ - (FS)->regs.reg[VSCR_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[VSCR_REGNO].loc.offset \ - = (long) &vregs->vscr - new_cfa; \ - } \ - \ - (FS)->regs.reg[VRSAVE_REGNO].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[VRSAVE_REGNO].loc.offset \ - = (long) &vregs->vsave - new_cfa; \ - } \ - \ - goto SUCCESS; \ - } while (0) +#define MD_FALLBACK_FRAME_STATE_FOR ppc_fallback_frame_state + +static _Unwind_Reason_Code +ppc_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + static long hwcap = 0; + struct gcc_regs *regs = get_regs (context); + long new_cfa; + int i; + + if (regs == NULL) + return _URC_END_OF_STACK; + + new_cfa = regs->gpr[STACK_POINTER_REGNUM]; + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = STACK_POINTER_REGNUM; + fs->cfa_offset = new_cfa - (long) context->cfa; + + for (i = 0; i < 32; i++) + if (i != STACK_POINTER_REGNUM) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = (long) ®s->gpr[i] - new_cfa; + } + + fs->regs.reg[CR2_REGNO].how = REG_SAVED_OFFSET; + fs->regs.reg[CR2_REGNO].loc.offset = (long) ®s->ccr - new_cfa; + + fs->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; + fs->regs.reg[LINK_REGISTER_REGNUM].loc.offset = (long) ®s->link - new_cfa; + + fs->regs.reg[ARG_POINTER_REGNUM].how = REG_SAVED_OFFSET; + fs->regs.reg[ARG_POINTER_REGNUM].loc.offset = (long) ®s->nip - new_cfa; + fs->retaddr_column = ARG_POINTER_REGNUM; + fs->signal_frame = 1; + + if (hwcap == 0) + { + hwcap = ppc_linux_aux_vector (16); + /* These will already be set if we found AT_HWCAP. A nonzero + value stops us looking again if for some reason we couldn't + find AT_HWCAP. */ +#ifdef __powerpc64__ + hwcap |= 0xc0000000; +#else + hwcap |= 0x80000000; +#endif + } + + /* If we have a FPU... */ + if (hwcap & 0x08000000) + for (i = 0; i < 32; i++) + { + fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; + fs->regs.reg[i + 32].loc.offset = (long) ®s->fpr[i] - new_cfa; + } + + /* If we have a VMX unit... */ + if (hwcap & 0x10000000) + { + struct gcc_vregs *vregs; +#ifdef __powerpc64__ + vregs = regs->vp; +#else + vregs = ®s->vregs; +#endif + if (regs->msr & (1 << 25)) + { + for (i = 0; i < 32; i++) + { + fs->regs.reg[i + FIRST_ALTIVEC_REGNO].how = REG_SAVED_OFFSET; + fs->regs.reg[i + FIRST_ALTIVEC_REGNO].loc.offset + = (long) &vregs[i] - new_cfa; + } + + fs->regs.reg[VSCR_REGNO].how = REG_SAVED_OFFSET; + fs->regs.reg[VSCR_REGNO].loc.offset = (long) &vregs->vscr - new_cfa; + } + + fs->regs.reg[VRSAVE_REGNO].how = REG_SAVED_OFFSET; + fs->regs.reg[VRSAVE_REGNO].loc.offset = (long) &vregs->vsave - new_cfa; + } + + return _URC_NO_REASON; +} + +#define MD_FROB_UPDATE_CONTEXT frob_update_context + +static void +frob_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs ATTRIBUTE_UNUSED) +{ + const unsigned int *pc = (const unsigned int *) context->ra; + + /* Fix up for 2.6.12 - 2.6.16 Linux kernels that have vDSO, but don't + have S flag in it. */ +#ifdef __powerpc64__ + /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ + /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ + if (pc[0] == 0x38210000 + SIGNAL_FRAMESIZE + && (pc[1] == 0x38000077 || pc[1] == 0x380000AC) + && pc[2] == 0x44000002) + _Unwind_SetSignalFrame (context, 1); +#else + /* li r0, 0x7777; sc (sigreturn old) */ + /* li r0, 0x0077; sc (sigreturn new) */ + /* li r0, 0x6666; sc (rt_sigreturn old) */ + /* li r0, 0x00AC; sc (rt_sigreturn new) */ + if ((pc[0] == 0x38007777 || pc[0] == 0x38000077 + || pc[0] == 0x38006666 || pc[0] == 0x380000AC) + && pc[1] == 0x44000002) + _Unwind_SetSignalFrame (context, 1); +#endif + +#ifdef __powerpc64__ + if (fs->regs.reg[2].how == REG_UNSAVED) + { + /* If the current unwind info (FS) does not contain explicit info + saving R2, then we have to do a minor amount of code reading to + figure out if it was saved. The big problem here is that the + code that does the save/restore is generated by the linker, so + we have no good way to determine at compile time what to do. */ + unsigned int *insn + = (unsigned int *) _Unwind_GetGR (context, LINK_REGISTER_REGNUM); + if (*insn == 0xE8410028) + _Unwind_SetGRPtr (context, 2, context->cfa + 40); + } +#endif +} diff --git a/contrib/gcc/config/rs6000/linux.h b/contrib/gcc/config/rs6000/linux.h index 84cdeeddd8a..3df356fca1a 100644 --- a/contrib/gcc/config/rs6000/linux.h +++ b/contrib/gcc/config/rs6000/linux.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler, for PowerPC machines running Linux. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Meissner (meissner@cygnus.com). This file is part of GCC. @@ -18,8 +18,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX @@ -28,20 +28,23 @@ process. */ #define OS_MISSING_POWERPC64 1 +/* We use glibc _mcount for profiling. */ +#define NO_PROFILE_COUNTERS 1 + /* glibc has float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS -#define TARGET_C99_FUNCTIONS 1 +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("PPC"); \ - builtin_define_std ("powerpc"); \ - builtin_assert ("cpu=powerpc"); \ - builtin_assert ("machine=powerpc"); \ - TARGET_OS_SYSV_CPP_BUILTINS (); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define_std ("powerpc"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + TARGET_OS_SYSV_CPP_BUILTINS (); \ + } \ while (0) #undef CPP_OS_DEFAULT_SPEC @@ -74,6 +77,11 @@ #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 +#endif + #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)"); @@ -102,8 +110,18 @@ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO -#ifdef IN_LIBGCC2 -#include "config/rs6000/linux-unwind.h" +#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */ +#define TARGET_THREAD_SSP_OFFSET -0x7008 +#endif + +#define POWERPC_LINUX + +/* ppc linux has 128-bit long double support in glibc 2.4 and later. */ +#ifdef TARGET_DEFAULT_LONG_DOUBLE_128 +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 #endif diff --git a/contrib/gcc/config/rs6000/linux64.h b/contrib/gcc/config/rs6000/linux64.h index 84e13a155fa..f52b2451abe 100644 --- a/contrib/gcc/config/rs6000/linux64.h +++ b/contrib/gcc/config/rs6000/linux64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for 64 bit PowerPC linux. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #ifndef RS6000_BI_ARCH @@ -50,8 +50,17 @@ #undef TARGET_AIX #define TARGET_AIX TARGET_64BIT -#undef PROCESSOR_DEFAULT64 -#define PROCESSOR_DEFAULT64 PROCESSOR_PPC630 +#ifdef HAVE_LD_NO_DOT_SYMS +/* New ABI uses a local sym for the function entry point. */ +extern int dot_symbols; +#undef DOT_SYMBOLS +#define DOT_SYMBOLS dot_symbols +#endif + +#undef PROCESSOR_DEFAULT +#define PROCESSOR_DEFAULT PROCESSOR_POWER4 +#undef PROCESSOR_DEFAULT64 +#define PROCESSOR_DEFAULT64 PROCESSOR_POWER4 /* We don't need to generate entries in .fixup, except when -mrelocatable or -mrelocatable-lib is given. */ @@ -60,7 +69,7 @@ (target_flags & target_flags_explicit & MASK_RELOCATABLE) #undef RS6000_ABI_NAME -#define RS6000_ABI_NAME (TARGET_64BIT ? "aixdesc" : "sysv") +#define RS6000_ABI_NAME "linux" #define INVALID_64BIT "-m%s not supported in this configuration" #define INVALID_32BIT INVALID_64BIT @@ -69,7 +78,7 @@ #define SUBSUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (rs6000_alignment_string == 0) \ + if (!rs6000_explicit_options.alignment) \ rs6000_alignment_flags = MASK_ALIGN_NATURAL; \ if (TARGET_64BIT) \ { \ @@ -78,6 +87,7 @@ rs6000_current_abi = ABI_AIX; \ error (INVALID_64BIT, "call"); \ } \ + dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \ if (target_flags & MASK_RELOCATABLE) \ { \ target_flags &= ~MASK_RELOCATABLE; \ @@ -93,7 +103,7 @@ target_flags &= ~MASK_PROTOTYPE; \ error (INVALID_64BIT, "prototype"); \ } \ - if ((target_flags & MASK_POWERPC64) == 0) \ + if ((target_flags & MASK_POWERPC64) == 0) \ { \ target_flags |= MASK_POWERPC64; \ error ("-m64 requires a PowerPC64 cpu"); \ @@ -127,16 +137,16 @@ #ifndef RS6000_BI_ARCH #define ASM_DEFAULT_SPEC "-mppc64" -#define ASM_SPEC "%(asm_spec64) %(asm_spec_common)" +#define ASM_SPEC "%(asm_spec64) %(asm_spec_common)" #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)" #else #if DEFAULT_ARCH64_P #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}" -#define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)" +#define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)" #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}" #else #define ASM_DEFAULT_SPEC "-mppc%{m64:64}" -#define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)" +#define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)" #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}" #endif #endif @@ -196,24 +206,8 @@ #endif -#define MASK_PROFILE_KERNEL 0x00100000 - -/* Non-standard profiling for kernels, which just saves LR then calls - _mcount without worrying about arg saves. The idea is to change - the function prologue as little as possible as it isn't easy to - account for arg save/restore code added just for _mcount. */ -#define TARGET_PROFILE_KERNEL (target_flags & MASK_PROFILE_KERNEL) - -/* Override sysv4.h. */ -#undef EXTRA_SUBTARGET_SWITCHES -#define EXTRA_SUBTARGET_SWITCHES \ - {"profile-kernel", MASK_PROFILE_KERNEL, \ - N_("Call mcount for profiling before a function prologue") }, \ - {"no-profile-kernel", -MASK_PROFILE_KERNEL, \ - N_("Call mcount for profiling after a function prologue") }, - /* We use glibc _mcount for profiling. */ -#define NO_PROFILE_COUNTERS TARGET_64BIT +#define NO_PROFILE_COUNTERS 1 #define PROFILE_HOOK(LABEL) \ do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0) @@ -234,13 +228,11 @@ the first field is an FP double, only if in power alignment mode. */ #undef ROUND_TYPE_ALIGN #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ - ((TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \ - ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ - : (TARGET_64BIT \ - && (TREE_CODE (STRUCT) == RECORD_TYPE \ - || TREE_CODE (STRUCT) == UNION_TYPE \ - || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ - && TARGET_ALIGN_NATURAL == 0) \ + ((TARGET_64BIT \ + && (TREE_CODE (STRUCT) == RECORD_TYPE \ + || TREE_CODE (STRUCT) == UNION_TYPE \ + || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ + && TARGET_ALIGN_NATURAL == 0) \ ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \ : MAX ((COMPUTED), (SPECIFIED))) @@ -258,7 +250,7 @@ than a doubleword should be padded upward or downward. You could reasonably assume that they follow the normal rules for structure layout treating the parameter area as any other block of memory, - then map the reg param area to registers. ie. pad updard. + then map the reg param area to registers. i.e. pad upward. Setting both of the following defines results in this behavior. Setting just the first one will result in aggregates that fit in a doubleword being padded downward, and others being padded upward. @@ -267,16 +259,6 @@ #define AGGREGATE_PADDING_FIXED TARGET_64BIT #define AGGREGATES_PAD_UPWARD_ALWAYS 0 -/* We don't want anything in the reg parm area being passed on the - stack. */ -#define MUST_PASS_IN_STACK(MODE, TYPE) \ - ((TARGET_64BIT \ - && (TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE))) \ - || (!TARGET_64BIT \ - && default_must_pass_in_stack ((MODE), (TYPE)))) - /* Specify padding for the last element of a block move between registers and memory. FIRST is nonzero if this is the only element. */ @@ -301,10 +283,10 @@ /* glibc has float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS -#define TARGET_C99_FUNCTIONS 1 +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) #undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ +#define TARGET_OS_CPP_BUILTINS() \ do \ { \ if (TARGET_64BIT) \ @@ -313,7 +295,6 @@ builtin_define ("__PPC64__"); \ builtin_define ("__powerpc__"); \ builtin_define ("__powerpc64__"); \ - builtin_define ("__PIC__"); \ builtin_assert ("cpu=powerpc64"); \ builtin_assert ("machine=powerpc64"); \ } \ @@ -355,13 +336,28 @@ #undef LINK_OS_DEFAULT_SPEC #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" +#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" +#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#if UCLIBC_DEFAULT +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" +#else +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#endif +#define LINUX_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) +#define LINUX_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}" #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}" + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}" #undef TOC_SECTION_ASM_OP #define TOC_SECTION_ASM_OP \ @@ -412,11 +408,19 @@ object files, each potentially with a different TOC pointer. For that reason, place a nop after the call so that the linker can restore the TOC pointer if a TOC adjusting call stub is needed. */ +#if DOT_SYMBOLS #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n" \ " bl ." #FUNC "\n" \ " nop\n" \ " .previous"); +#else +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n" \ +" bl " #FUNC "\n" \ +" nop\n" \ +" .previous"); +#endif #endif /* FP save and restore routines. */ @@ -441,13 +445,11 @@ if (!flag_inhibit_size_directive) \ { \ fputs ("\t.size\t", (FILE)); \ - if (TARGET_64BIT) \ + if (TARGET_64BIT && DOT_SYMBOLS) \ putc ('.', (FILE)); \ assemble_name ((FILE), (FNAME)); \ fputs (",.-", (FILE)); \ - if (TARGET_64BIT) \ - putc ('.', (FILE)); \ - assemble_name ((FILE), (FNAME)); \ + rs6000_output_function_entry (FILE, FNAME); \ putc ('\n', (FILE)); \ } \ } \ @@ -476,72 +478,14 @@ && ((TARGET_64BIT \ && (TARGET_POWERPC64 \ || TARGET_MINIMAL_TOC \ - || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && ! TARGET_NO_FP_IN_TOC))) \ || (!TARGET_64BIT \ && !TARGET_NO_FP_IN_TOC \ && !TARGET_RELOCATABLE \ - && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && BITS_PER_WORD == HOST_BITS_PER_INT))))) -/* This is the same as the dbxelf.h version, except that we need to - use the function code label, not the function descriptor. */ -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \ -do \ - { \ - char temp[256]; \ - ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \ - fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \ - assemble_name (FILE, temp); \ - putc ('-', FILE); \ - if (TARGET_64BIT) \ - putc ('.', FILE); \ - assemble_name (FILE, \ - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ - putc ('\n', FILE); \ - (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \ - } \ -while (0) - -/* Similarly, we want the function code label here. */ -#define DBX_OUTPUT_BRAC(FILE, NAME, BRAC) \ - do \ - { \ - const char *flab; \ - fprintf (FILE, "%s%d,0,0,", ASM_STABN_OP, BRAC); \ - assemble_name (FILE, NAME); \ - putc ('-', FILE); \ - if (current_function_func_begin_label != NULL_TREE) \ - flab = IDENTIFIER_POINTER (current_function_func_begin_label); \ - else \ - { \ - if (TARGET_64BIT) \ - putc ('.', FILE); \ - flab = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \ - } \ - assemble_name (FILE, flab); \ - putc ('\n', FILE); \ - } \ - while (0) - -#define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC) -#define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC) - -/* Another case where we want the dot name. */ -#define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL) \ - do \ - { \ - fprintf (FILE, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN); \ - assemble_name (FILE, LSCOPE); \ - putc ('-', FILE); \ - if (TARGET_64BIT) \ - putc ('.', FILE); \ - assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \ - putc ('\n', FILE); \ - } \ - while (0) - /* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is true if the symbol may be affected by dynamic relocations. */ @@ -559,11 +503,27 @@ while (0) #define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -#ifdef IN_LIBGCC2 -#include "config/rs6000/linux-unwind.h" +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 +#endif + +#define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* ppc32 glibc provides __stack_chk_guard in -0x7008(2), + ppc64 glibc provides it at -0x7010(13). */ +#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008) +#endif + +#define POWERPC_LINUX + +/* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */ +#ifdef TARGET_DEFAULT_LONG_DOUBLE_128 +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 #endif diff --git a/contrib/gcc/config/rs6000/linux64.opt b/contrib/gcc/config/rs6000/linux64.opt new file mode 100644 index 00000000000..ebd3384425b --- /dev/null +++ b/contrib/gcc/config/rs6000/linux64.opt @@ -0,0 +1,25 @@ +; Options for 64-bit PowerPC Linux. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mprofile-kernel +Target Report Mask(PROFILE_KERNEL) +Call mcount for profiling before a function prologue diff --git a/contrib/gcc/config/rs6000/linuxaltivec.h b/contrib/gcc/config/rs6000/linuxaltivec.h index 73ac8646141..181bb81d3a4 100644 --- a/contrib/gcc/config/rs6000/linuxaltivec.h +++ b/contrib/gcc/config/rs6000/linuxaltivec.h @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC AltiVec GNU/Linux)"); diff --git a/contrib/gcc/config/rs6000/linuxspe.h b/contrib/gcc/config/rs6000/linuxspe.h index 59eb8316f04..fd7d20ebd68 100644 --- a/contrib/gcc/config/rs6000/linuxspe.h +++ b/contrib/gcc/config/rs6000/linuxspe.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for PowerPC e500 machines running GNU/Linux. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. Contributed by Aldy Hernandez (aldy@quesejoda.com). This file is part of GCC. @@ -17,43 +17,49 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC E500 GNU/Linux)"); /* Override rs6000.h and sysv4.h definition. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) +#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN) #undef TARGET_SPE_ABI #undef TARGET_SPE #undef TARGET_E500 #undef TARGET_ISEL #undef TARGET_FPRS +#undef TARGET_E500_SINGLE +#undef TARGET_E500_DOUBLE #define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE rs6000_spe #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) #define TARGET_ISEL rs6000_isel -#define TARGET_FPRS (!rs6000_float_gprs) +#define TARGET_FPRS (rs6000_float_gprs == 0) +#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1) +#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2) #undef SUBSUBTARGET_OVERRIDE_OPTIONS #define SUBSUBTARGET_OVERRIDE_OPTIONS \ if (rs6000_select[1].string == NULL) \ rs6000_cpu = PROCESSOR_PPC8540; \ - if (rs6000_abi_string == NULL || strstr (rs6000_abi_string, "spe") == NULL) \ + if (!rs6000_explicit_options.abi) \ rs6000_spe_abi = 1; \ - if (rs6000_float_gprs_string == NULL) \ + if (!rs6000_explicit_options.float_gprs) \ rs6000_float_gprs = 1; \ /* See note below. */ \ - /*if (rs6000_long_double_size_string == NULL)*/ \ + /*if (!rs6000_explicit_options.long_double)*/ \ /* rs6000_long_double_type_size = 128;*/ \ - if (rs6000_spe_string == NULL) \ + if (!rs6000_explicit_options.spe) \ rs6000_spe = 1; \ - if (rs6000_isel_string == NULL) \ - rs6000_isel = 1 + if (!rs6000_explicit_options.isel) \ + rs6000_isel = 1; \ + if (target_flags & MASK_64BIT) \ + error ("-m64 not supported in this configuration") /* The e500 ABI says that either long doubles are 128 bits, or if implemented in any other size, the compiler/linker should error out. diff --git a/contrib/gcc/config/rs6000/lynx.h b/contrib/gcc/config/rs6000/lynx.h index b32b07890ae..ab2d16f24ca 100644 --- a/contrib/gcc/config/rs6000/lynx.h +++ b/contrib/gcc/config/rs6000/lynx.h @@ -1,6 +1,8 @@ /* Definitions for Rs6000 running LynxOS. - Copyright (C) 1995, 1996, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2000, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by David Henkel-Wallace, Cygnus Support (gumby@cygnus.com) + Rewritten by Adam Nemet, LynuxWorks Inc. This file is part of GCC. @@ -16,72 +18,108 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ -/* Print subsidiary information on the compiler version in use. */ -#define TARGET_VERSION fprintf (stderr, " (LynxOS-RS/6000)"); +/* Override the definition in sysv4.h. */ -/* LynxOS has signed chars, regardless of what most R/S 6000 systems do */ -#undef DEFAULT_SIGNED_CHAR -#define DEFAULT_SIGNED_CHAR 1 +#undef TARGET_VERSION +#define TARGET_VERSION fputs (" (PowerPC/LynxOS)", stderr); -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_assert ("cpu=rs6000"); \ - builtin_assert ("machine=rs6000"); \ - builtin_assert ("system=lynx"); \ - builtin_assert ("system=unix"); \ - builtin_define_std ("Lynx"); \ - builtin_define ("_IBMR2"); \ - builtin_define_std ("unix"); \ - builtin_define_std ("rs6000"); \ - builtin_define_std ("lynx"); \ - builtin_define_std ("LYNX"); \ - } \ +/* Undefine the definition to enable the LynxOS default from the + top-level lynx.h. */ + +#undef SUBTARGET_EXTRA_SPECS + +/* Get rid off the spec definitions from rs6000/sysv4.h. */ + +#undef CPP_SPEC +#define CPP_SPEC \ +"%{msoft-float: -D_SOFT_FLOAT} \ + %(cpp_cpu) \ + %(cpp_os_lynx)" + +/* LynxOS only supports big-endian on PPC so we override the + definition from sysv4.h. Since the LynxOS 4.0 compiler was set to + return every structure in memory regardless of their size we have + to emulate the same behavior here with disabling the SVR4 structure + returning. */ + +#undef CC1_SPEC +#define CC1_SPEC \ +"%{G*} %{mno-sdata:-msdata=none} \ + %{maltivec:-mabi=altivec} \ + -maix-struct-return" + +#undef ASM_SPEC +#define ASM_SPEC \ +"%(asm_cpu) \ + %{.s: %{mregnames} %{mno-regnames}} \ + %{.S: %{mregnames} %{mno-regnames}}" + +#undef STARTFILE_SPEC +#undef ENDFILE_SPEC +#undef LIB_SPEC +#undef LINK_SPEC +#define LINK_SPEC \ +"%{!msdata=none:%{G*}} %{msdata=none:-G0} \ + %(link_os_lynx)" + +/* Override the definition from sysv4.h. */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__BIG_ENDIAN__"); \ + builtin_define ("__powerpc__"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + builtin_define ("__PPC__"); \ + } \ while (0) -#undef LINK_SPEC -#define LINK_SPEC "-T0x10001000 -H0x1000 -D0x20000000 -btextro -bhalt:4 -bnodelcsect -bnso -bro -bnoglink %{v} %{b*}" +/* Override the rs6000.h definition. */ -#undef LIB_SPEC -#define LIB_SPEC "%{mthreads:-L/lib/thread/} \ - %{msystem-v:-lc_v -lm.v} \ - %{!msystem-v:%{mposix:-lc_p} -lc -lm}" +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{p:%{mthreads:thread/pinit.o%s}%{!mthreads:pinit.o%s}}%{!p:%{msystem-v:vinit.o%s -e_start}%{!msystem-v:%{mthreads:thread/init.o%s}%{!mthreads:init.o%s}}}" +/* Override the rs6000.h definition. */ -#undef ENDFILE_SPEC +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" -/* This can become more refined as we have more powerpc options. */ -#undef ASM_SPEC -#define ASM_SPEC "-u %(asm_cpu)" +/* LynxOS does not do anything with .fixup plus let's not create + writable section for linkonce.r and linkonce.t. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"threads", MASK_THREADS}, \ - {"posix", MASK_POSIX}, \ - {"system-v", MASK_SYSTEM_V}, +#undef RELOCATABLE_NEEDS_FIXUP -#undef SUBTARGET_OVERRIDE_OPTIONS -#define SUBTARGET_OVERRIDE_OPTIONS \ -do { \ - if (TARGET_SYSTEM_V && profile_flag) \ - warning ("-msystem-v and -p are incompatible"); \ - if (TARGET_SYSTEM_V && TARGET_THREADS) \ - warning ("-msystem-v and -mthreads are incompatible"); \ -} while (0) +/* Override these from rs6000.h with the generic definition. */ -/* For collect2 */ -#define OBJECT_FORMAT_NONE -#undef OBJECT_FORMAT_COFF -#undef MD_EXEC_PREFIX -#undef REAL_LD_FILE_NAME -#undef REAL_STRIP_FILE_NAME +#undef SIZE_TYPE +#undef ASM_OUTPUT_ALIGN +#undef PREFERRED_DEBUGGING_TYPE -/* LynxOS doesn't have mcount. */ -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(file, profile_label_no) +/* The file rs6000.c defines TARGET_HAVE_TLS unconditionally to the + value of HAVE_AS_TLS. HAVE_AS_TLS is true as gas support for TLS + is detected by configure. Override the definition to false. */ + +#undef HAVE_AS_TLS +#define HAVE_AS_TLS 0 + +#ifdef CRT_BEGIN +/* This function is part of crtbegin*.o which is at the beginning of + the link and is called from .fini which is usually toward the end + of the executable. Make it longcall so that we don't limit the + text size of the executables to 32M. */ + +static void __do_global_dtors_aux (void) __attribute__ ((longcall)); +#endif /* CRT_BEGIN */ + +#ifdef CRT_END +/* Similarly here. This function resides in crtend*.o which is toward + to end of the link and is called from .init which is at the + beginning. */ + +static void __do_global_ctors_aux (void) __attribute__ ((longcall)); +#endif /* CRT_END */ diff --git a/contrib/gcc/config/rs6000/mpc.md b/contrib/gcc/config/rs6000/mpc.md index b95bba5c33a..75e475208d3 100644 --- a/contrib/gcc/config/rs6000/mpc.md +++ b/contrib/gcc/config/rs6000/mpc.md @@ -1,5 +1,5 @@ ;; Scheduling description for Motorola PowerPC processor cores. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,8 +15,8 @@ ;; ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "mpc,mpcfp") (define_cpu_unit "iu_mpc,mciu_mpc" "mpc") @@ -27,11 +27,12 @@ ;; 505/801/821/823 (define_insn_reservation "mpccore-load" 2 - (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ + load_l,store_c,sync") (eq_attr "cpu" "mpccore")) "lsu_mpc") -(define_insn_reservation "mpccore-store" 1 +(define_insn_reservation "mpccore-store" 2 (and (eq_attr "type" "store,store_ux,store_u,fpstore,fpstore_ux,fpstore_u") (eq_attr "cpu" "mpccore")) "lsu_mpc") @@ -46,6 +47,16 @@ (eq_attr "cpu" "mpccore")) "iu_mpc") +(define_insn_reservation "mpccore-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "mpccore")) + "iu_mpc,iu_mpc") + +(define_insn_reservation "mpccore-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "mpccore")) + "iu_mpc,iu_mpc,iu_mpc") + (define_insn_reservation "mpccore-imul" 2 (and (eq_attr "type" "imul,imul2,imul3,imul_compare") (eq_attr "cpu" "mpccore")) @@ -93,7 +104,7 @@ "bpu_mpc") (define_insn_reservation "mpccore-jmpreg" 1 - (and (eq_attr "type" "jmpreg,branch,cr_logical,delayed_cr,mfcr,mtcr") + (and (eq_attr "type" "jmpreg,branch,cr_logical,delayed_cr,mfcr,mtcr,isync") (eq_attr "cpu" "mpccore")) "bpu_mpc") diff --git a/contrib/gcc/config/rs6000/netbsd.h b/contrib/gcc/config/rs6000/netbsd.h index e0c519654d3..151c232e77e 100644 --- a/contrib/gcc/config/rs6000/netbsd.h +++ b/contrib/gcc/config/rs6000/netbsd.h @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */ #define TARGET_OS_CPP_BUILTINS() \ diff --git a/contrib/gcc/config/rs6000/power4.md b/contrib/gcc/config/rs6000/power4.md index fabc1de34aa..53ac066d856 100644 --- a/contrib/gcc/config/rs6000/power4.md +++ b/contrib/gcc/config/rs6000/power4.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM Power4 and PowerPC 970 processors. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,8 +15,8 @@ ;; ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. ;; Sources: IBM Red Book and White Paper on POWER4 @@ -38,38 +38,37 @@ (define_reservation "lsq_power4" "(du1_power4,lsu1_power4)\ |(du2_power4,lsu2_power4)\ - |(du3_power4,nothing,lsu2_power4)\ - |(du4_power4,nothing,lsu1_power4)") + |(du3_power4,lsu2_power4)\ + |(du4_power4,lsu1_power4)") (define_reservation "lsuq_power4" "(du1_power4+du2_power4,lsu1_power4+iu2_power4)\ |(du2_power4+du3_power4,lsu2_power4+iu2_power4)\ |(du3_power4+du4_power4,lsu2_power4+iu1_power4)") -; |(du2_power4+du3_power4,nothing,lsu2_power4,iu2_power4) (define_reservation "iq_power4" "(du1_power4,iu1_power4)\ |(du2_power4,iu2_power4)\ - |(du3_power4,nothing,iu2_power4)\ - |(du4_power4,nothing,iu1_power4)") + |(du3_power4,iu2_power4)\ + |(du4_power4,iu1_power4)") (define_reservation "fpq_power4" "(du1_power4,fpu1_power4)\ |(du2_power4,fpu2_power4)\ - |(du3_power4,nothing,fpu2_power4)\ - |(du4_power4,nothing,fpu1_power4)") + |(du3_power4,fpu2_power4)\ + |(du4_power4,fpu1_power4)") (define_reservation "vq_power4" "(du1_power4,vec_power4)\ |(du2_power4,vec_power4)\ - |(du3_power4,nothing,vec_power4)\ - |(du4_power4,nothing,vec_power4)") + |(du3_power4,vec_power4)\ + |(du4_power4,vec_power4)") (define_reservation "vpq_power4" "(du1_power4,vecperm_power4)\ |(du2_power4,vecperm_power4)\ - |(du3_power4,nothing,vecperm_power4)\ - |(du4_power4,nothing,vecperm_power4)") + |(du3_power4,vecperm_power4)\ + |(du4_power4,vecperm_power4)") ; Dispatch slots are allocated in order conforming to program order. @@ -130,15 +129,15 @@ (eq_attr "cpu" "power4")) "lsq_power4") -(define_insn_reservation "power4-store" 1 +(define_insn_reservation "power4-store" 12 (and (eq_attr "type" "store") (eq_attr "cpu" "power4")) "(du1_power4,lsu1_power4,iu1_power4)\ |(du2_power4,lsu2_power4,iu2_power4)\ - |(du3_power4,lsu2_power4,nothing,iu2_power4)\ - |(du4_power4,lsu1_power4,nothing,iu1_power4)") + |(du3_power4,lsu2_power4,iu2_power4)\ + |(du4_power4,lsu1_power4,iu1_power4)") -(define_insn_reservation "power4-store-update" 1 +(define_insn_reservation "power4-store-update" 12 (and (eq_attr "type" "store_u") (eq_attr "cpu" "power4")) "(du1_power4+du2_power4,lsu1_power4+iu2_power4,iu1_power4)\ @@ -146,35 +145,40 @@ |(du3_power4+du4_power4,lsu2_power4+iu1_power4,iu2_power4)\ |(du3_power4+du4_power4,lsu2_power4,iu1_power4,iu2_power4)") -(define_insn_reservation "power4-store-update-indexed" 1 +(define_insn_reservation "power4-store-update-indexed" 12 (and (eq_attr "type" "store_ux") (eq_attr "cpu" "power4")) "du1_power4+du2_power4+du3_power4+du4_power4,\ iu1_power4,lsu2_power4+iu2_power4,iu2_power4") -(define_insn_reservation "power4-fpstore" 1 +(define_insn_reservation "power4-fpstore" 12 (and (eq_attr "type" "fpstore") (eq_attr "cpu" "power4")) "(du1_power4,lsu1_power4,fpu1_power4)\ |(du2_power4,lsu2_power4,fpu2_power4)\ - |(du3_power4,lsu2_power4,nothing,fpu2_power4)\ - |(du4_power4,lsu1_power4,nothing,fpu1_power4)") + |(du3_power4,lsu2_power4,fpu2_power4)\ + |(du4_power4,lsu1_power4,fpu1_power4)") -(define_insn_reservation "power4-fpstore-update" 1 +(define_insn_reservation "power4-fpstore-update" 12 (and (eq_attr "type" "fpstore_u,fpstore_ux") (eq_attr "cpu" "power4")) "(du1_power4+du2_power4,lsu1_power4+iu2_power4,fpu1_power4)\ |(du2_power4+du3_power4,lsu2_power4+iu2_power4,fpu2_power4)\ |(du3_power4+du4_power4,lsu2_power4+iu1_power4,fpu2_power4)") -; |(du3_power4+du4_power4,nothing,lsu2_power4+iu1_power4,fpu2_power4)") -(define_insn_reservation "power4-vecstore" 1 +(define_insn_reservation "power4-vecstore" 12 (and (eq_attr "type" "vecstore") (eq_attr "cpu" "power4")) "(du1_power4,lsu1_power4,vec_power4)\ |(du2_power4,lsu2_power4,vec_power4)\ - |(du3_power4,lsu2_power4,nothing,vec_power4)\ - |(du4_power4,lsu1_power4,nothing,vec_power4)") + |(du3_power4,lsu2_power4,vec_power4)\ + |(du4_power4,lsu1_power4,vec_power4)") + +(define_insn_reservation "power4-llsc" 11 + (and (eq_attr "type" "load_l,store_c,sync") + (eq_attr "cpu" "power4")) + "du1_power4+du2_power4+du3_power4+du4_power4,\ + lsu1_power4") ; Integer latency is 2 cycles @@ -183,6 +187,26 @@ (eq_attr "cpu" "power4")) "iq_power4") +(define_insn_reservation "power4-two" 2 + (and (eq_attr "type" "two") + (eq_attr "cpu" "power4")) + "(du1_power4+du2_power4,iu1_power4,nothing,iu2_power4)\ + |(du2_power4+du3_power4,iu2_power4,nothing,iu2_power4)\ + |(du3_power4+du4_power4,iu2_power4,nothing,iu1_power4)\ + |(du4_power4+du1_power4,iu1_power4,nothing,iu1_power4)") + +(define_insn_reservation "power4-three" 2 + (and (eq_attr "type" "three") + (eq_attr "cpu" "power4")) + "(du1_power4+du2_power4+du3_power4,\ + iu1_power4,nothing,iu2_power4,nothing,iu2_power4)\ + |(du2_power4+du3_power4+du4_power4,\ + iu2_power4,nothing,iu2_power4,nothing,iu1_power4)\ + |(du3_power4+du4_power4+du1_power4,\ + iu2_power4,nothing,iu1_power4,nothing,iu1_power4)\ + |(du4_power4+du1_power4+du2_power4,\ + iu1_power4,nothing,iu2_power4,nothing,iu2_power4)") + (define_insn_reservation "power4-insert" 4 (and (eq_attr "type" "insert_word") (eq_attr "cpu" "power4")) @@ -200,7 +224,7 @@ (eq_attr "cpu" "power4")) "(du1_power4+du2_power4,iu1_power4,iu2_power4)\ |(du2_power4+du3_power4,iu2_power4,iu2_power4)\ - |(du3_power4+du4_power4,nothing,iu2_power4,iu1_power4)") + |(du3_power4+du4_power4,iu2_power4,iu1_power4)") (define_bypass 4 "power4-compare" "power4-branch,power4-crlogical,power4-delayedcr,power4-mfcr,power4-mfcrf") @@ -210,7 +234,6 @@ "(du1_power4+du2_power4,iu1_power4*6,iu2_power4)\ |(du2_power4+du3_power4,iu2_power4*6,iu2_power4)\ |(du3_power4+du4_power4,iu2_power4*6,iu1_power4)") -; |(du3_power4+du4_power4,nothing,iu2_power4*6,iu1_power4)") (define_bypass 10 "power4-lmul-cmp" "power4-branch,power4-crlogical,power4-delayedcr,power4-mfcr,power4-mfcrf") @@ -220,7 +243,6 @@ "(du1_power4+du2_power4,iu1_power4*4,iu2_power4)\ |(du2_power4+du3_power4,iu2_power4*4,iu2_power4)\ |(du3_power4+du4_power4,iu2_power4*4,iu1_power4)") -; |(du3_power4+du4_power4,nothing,iu2_power4*4,iu1_power4)") (define_bypass 8 "power4-imul-cmp" "power4-branch,power4-crlogical,power4-delayedcr,power4-mfcr,power4-mfcrf") @@ -230,9 +252,7 @@ "(du1_power4,iu1_power4*6)\ |(du2_power4,iu2_power4*6)\ |(du3_power4,iu2_power4*6)\ - |(du4_power4,iu2_power4*6)") -; |(du3_power4,nothing,iu2_power4*6)\ -; |(du4_power4,nothing,iu2_power4*6)") + |(du4_power4,iu1_power4*6)") (define_insn_reservation "power4-imul" 5 (and (eq_attr "type" "imul") @@ -241,8 +261,6 @@ |(du2_power4,iu2_power4*4)\ |(du3_power4,iu2_power4*4)\ |(du4_power4,iu1_power4*4)") -; |(du3_power4,nothing,iu2_power4*4)\ -; |(du4_power4,nothing,iu1_power4*4)") (define_insn_reservation "power4-imul3" 4 (and (eq_attr "type" "imul2,imul3") @@ -251,8 +269,6 @@ |(du2_power4,iu2_power4*3)\ |(du3_power4,iu2_power4*3)\ |(du4_power4,iu1_power4*3)") -; |(du3_power4,nothing,iu2_power4*3)\ -; |(du4_power4,nothing,iu1_power4*3)") ; SPR move only executes in first IU. @@ -335,8 +351,6 @@ |(du2_power4,fpu2_power4*28)\ |(du3_power4,fpu2_power4*28)\ |(du4_power4,fpu1_power4*28)") -; |(du3_power4,nothing,fpu2_power4*28)\ -; |(du4_power4,nothing,fpu1_power4*28)") (define_insn_reservation "power4-sqrt" 40 (and (eq_attr "type" "ssqrt,dsqrt") @@ -345,8 +359,12 @@ |(du2_power4,fpu2_power4*35)\ |(du3_power4,fpu2_power4*35)\ |(du4_power4,fpu2_power4*35)") -; |(du3_power4,nothing,fpu2_power4*35)\ -; |(du4_power4,nothing,fpu2_power4*35)") + +(define_insn_reservation "power4-isync" 2 + (and (eq_attr "type" "isync") + (eq_attr "cpu" "power4")) + "du1_power4+du2_power4+du3_power4+du4_power4,\ + lsu1_power4") ; VMX diff --git a/contrib/gcc/config/rs6000/power5.md b/contrib/gcc/config/rs6000/power5.md index 59baa79c30c..ce6892605d1 100644 --- a/contrib/gcc/config/rs6000/power5.md +++ b/contrib/gcc/config/rs6000/power5.md @@ -15,8 +15,8 @@ ;; ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. ;; Sources: IBM Red Book and White Paper on POWER5 @@ -37,20 +37,20 @@ (define_reservation "lsq_power5" "(du1_power5,lsu1_power5)\ |(du2_power5,lsu2_power5)\ - |(du3_power5,nothing,lsu2_power5)\ - |(du4_power5,nothing,lsu1_power5)") + |(du3_power5,lsu2_power5)\ + |(du4_power5,lsu1_power5)") (define_reservation "iq_power5" "(du1_power5,iu1_power5)\ |(du2_power5,iu2_power5)\ - |(du3_power5,nothing,iu2_power5)\ - |(du4_power5,nothing,iu1_power5)") + |(du3_power5,iu2_power5)\ + |(du4_power5,iu1_power5)") (define_reservation "fpq_power5" "(du1_power5,fpu1_power5)\ |(du2_power5,fpu2_power5)\ - |(du3_power5,nothing,fpu2_power5)\ - |(du4_power5,nothing,fpu1_power5)") + |(du3_power5,fpu2_power5)\ + |(du4_power5,fpu1_power5)") ; Dispatch slots are allocated in order conforming to program order. (absence_set "du1_power5" "du2_power5,du3_power5,du4_power5,du5_power5") @@ -103,38 +103,44 @@ (eq_attr "cpu" "power5")) "du1_power5+du2_power5,lsu1_power5+iu2_power5") -(define_insn_reservation "power5-store" 1 +(define_insn_reservation "power5-store" 12 (and (eq_attr "type" "store") (eq_attr "cpu" "power5")) "(du1_power5,lsu1_power5,iu1_power5)\ |(du2_power5,lsu2_power5,iu2_power5)\ - |(du3_power5,lsu2_power5,nothing,iu2_power5)\ - |(du4_power5,lsu1_power5,nothing,iu1_power5)") + |(du3_power5,lsu2_power5,iu2_power5)\ + |(du4_power5,lsu1_power5,iu1_power5)") -(define_insn_reservation "power5-store-update" 1 +(define_insn_reservation "power5-store-update" 12 (and (eq_attr "type" "store_u") (eq_attr "cpu" "power5")) "du1_power5+du2_power5,lsu1_power5+iu2_power5,iu1_power5") -(define_insn_reservation "power5-store-update-indexed" 1 +(define_insn_reservation "power5-store-update-indexed" 12 (and (eq_attr "type" "store_ux") (eq_attr "cpu" "power5")) "du1_power5+du2_power5+du3_power5+du4_power5,\ iu1_power5,lsu2_power5+iu2_power5,iu2_power5") -(define_insn_reservation "power5-fpstore" 1 +(define_insn_reservation "power5-fpstore" 12 (and (eq_attr "type" "fpstore") (eq_attr "cpu" "power5")) "(du1_power5,lsu1_power5,fpu1_power5)\ |(du2_power5,lsu2_power5,fpu2_power5)\ - |(du3_power5,lsu2_power5,nothing,fpu2_power5)\ - |(du4_power5,lsu1_power5,nothing,fpu1_power5)") + |(du3_power5,lsu2_power5,fpu2_power5)\ + |(du4_power5,lsu1_power5,fpu1_power5)") -(define_insn_reservation "power5-fpstore-update" 1 +(define_insn_reservation "power5-fpstore-update" 12 (and (eq_attr "type" "fpstore_u,fpstore_ux") (eq_attr "cpu" "power5")) "du1_power5+du2_power5,lsu1_power5+iu2_power5,fpu1_power5") +(define_insn_reservation "power5-llsc" 11 + (and (eq_attr "type" "load_l,store_c,sync") + (eq_attr "cpu" "power5")) + "du1_power5+du2_power5+du3_power5+du4_power5,\ + lsu1_power5") + ; Integer latency is 2 cycles (define_insn_reservation "power5-integer" 2 @@ -142,6 +148,26 @@ (eq_attr "cpu" "power5")) "iq_power5") +(define_insn_reservation "power5-two" 2 + (and (eq_attr "type" "two") + (eq_attr "cpu" "power5")) + "(du1_power5+du2_power5,iu1_power5,nothing,iu2_power5)\ + |(du2_power5+du3_power5,iu2_power5,nothing,iu2_power5)\ + |(du3_power5+du4_power5,iu2_power5,nothing,iu1_power5)\ + |(du4_power5+du1_power5,iu1_power5,nothing,iu1_power5)") + +(define_insn_reservation "power5-three" 2 + (and (eq_attr "type" "three") + (eq_attr "cpu" "power5")) + "(du1_power5+du2_power5+du3_power5,\ + iu1_power5,nothing,iu2_power5,nothing,iu2_power5)\ + |(du2_power5+du3_power5+du4_power5,\ + iu2_power5,nothing,iu2_power5,nothing,iu1_power5)\ + |(du3_power5+du4_power5+du1_power5,\ + iu2_power5,nothing,iu1_power5,nothing,iu1_power5)\ + |(du4_power5+du1_power5+du2_power5,\ + iu1_power5,nothing,iu2_power5,nothing,iu2_power5)") + (define_insn_reservation "power5-insert" 4 (and (eq_attr "type" "insert_word") (eq_attr "cpu" "power5")) @@ -179,9 +205,7 @@ "(du1_power5,iu1_power5*6)\ |(du2_power5,iu2_power5*6)\ |(du3_power5,iu2_power5*6)\ - |(du4_power5,iu2_power5*6)") -; |(du3_power5,nothing,iu2_power5*6)\ -; |(du4_power5,nothing,iu2_power5*6)") + |(du4_power5,iu1_power5*6)") (define_insn_reservation "power5-imul" 5 (and (eq_attr "type" "imul") @@ -190,8 +214,6 @@ |(du2_power5,iu2_power5*4)\ |(du3_power5,iu2_power5*4)\ |(du4_power5,iu1_power5*4)") -; |(du3_power5,nothing,iu2_power5*4)\ -; |(du4_power5,nothing,iu1_power5*4)") (define_insn_reservation "power5-imul3" 4 (and (eq_attr "type" "imul2,imul3") @@ -200,8 +222,6 @@ |(du2_power5,iu2_power5*3)\ |(du3_power5,iu2_power5*3)\ |(du4_power5,iu1_power5*3)") -; |(du3_power5,nothing,iu2_power5*3)\ -; |(du4_power5,nothing,iu1_power5*3)") ; SPR move only executes in first IU. @@ -284,8 +304,6 @@ |(du2_power5,fpu2_power5*28)\ |(du3_power5,fpu2_power5*28)\ |(du4_power5,fpu1_power5*28)") -; |(du3_power5,nothing,fpu2_power5*28)\ -; |(du4_power5,nothing,fpu1_power5*28)") (define_insn_reservation "power5-sqrt" 40 (and (eq_attr "type" "ssqrt,dsqrt") @@ -294,6 +312,10 @@ |(du2_power5,fpu2_power5*35)\ |(du3_power5,fpu2_power5*35)\ |(du4_power5,fpu2_power5*35)") -; |(du3_power5,nothing,fpu2_power5*35)\ -; |(du4_power5,nothing,fpu2_power5*35)") + +(define_insn_reservation "power5-isync" 2 + (and (eq_attr "type" "isync") + (eq_attr "cpu" "power5")) + "du1_power5+du2_power5+du3_power5+du4_power5,\ + lsu1_power5") diff --git a/contrib/gcc/config/rs6000/ppc64-fp.c b/contrib/gcc/config/rs6000/ppc64-fp.c index c736d9ad7c8..184f34e1de9 100644 --- a/contrib/gcc/config/rs6000/ppc64-fp.c +++ b/contrib/gcc/config/rs6000/ppc64-fp.c @@ -2,7 +2,7 @@ libgcc2.c with macros expanded to force the use of specific types. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -27,10 +27,11 @@ for more details. 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. */ -#if defined(__powerpc64__) +#if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__) +#define TMODES #include "config/fp-bit.h" extern DItype __fixtfdi (TFtype); @@ -39,8 +40,11 @@ extern DItype __fixsfdi (SFtype); extern USItype __fixunsdfsi (DFtype); extern USItype __fixunssfsi (SFtype); extern TFtype __floatditf (DItype); +extern TFtype __floatunditf (UDItype); extern DFtype __floatdidf (DItype); +extern DFtype __floatundidf (UDItype); extern SFtype __floatdisf (DItype); +extern SFtype __floatundisf (UDItype); extern DItype __fixunstfdi (TFtype); static DItype local_fixunssfdi (SFtype); @@ -100,6 +104,18 @@ __floatditf (DItype u) return (TFtype) dh + (TFtype) dl; } +TFtype +__floatunditf (UDItype u) +{ + DFtype dh, dl; + + dh = (USItype) (u >> (sizeof (SItype) * 8)); + dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (TFtype) dh + (TFtype) dl; +} + DFtype __floatdidf (DItype u) { @@ -112,6 +128,18 @@ __floatdidf (DItype u) return d; } +DFtype +__floatundidf (UDItype u) +{ + DFtype d; + + d = (USItype) (u >> (sizeof (SItype) * 8)); + d *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + d += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return d; +} + SFtype __floatdisf (DItype u) { @@ -137,6 +165,30 @@ __floatdisf (DItype u) return (SFtype) f; } +SFtype +__floatundisf (UDItype u) +{ + DFtype f; + + if (53 < (sizeof (DItype) * 8) + && 53 > ((sizeof (DItype) * 8) - 53 + 24)) + { + if (u >= ((UDItype) 1 << 53)) + { + if ((UDItype) u & (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1)) + { + u &= ~ (((UDItype) 1 << ((sizeof (DItype) * 8) - 53)) - 1); + u |= ((UDItype) 1 << ((sizeof (DItype) * 8) - 53)); + } + } + } + f = (USItype) (u >> (sizeof (SItype) * 8)); + f *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); + f += (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); + + return (SFtype) f; +} + DItype __fixunstfdi (TFtype a) { diff --git a/contrib/gcc/config/rs6000/predicates.md b/contrib/gcc/config/rs6000/predicates.md new file mode 100644 index 00000000000..6aefe2dd0c9 --- /dev/null +++ b/contrib/gcc/config/rs6000/predicates.md @@ -0,0 +1,1307 @@ +;; Predicate definitions for POWER and PowerPC. +;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Return 1 for anything except PARALLEL. +(define_predicate "any_operand" + (match_code "const_int,const_double,const,symbol_ref,label_ref,subreg,reg,mem")) + +;; Return 1 for any PARALLEL. +(define_predicate "any_parallel_operand" + (match_code "parallel")) + +;; Return 1 if op is COUNT register. +(define_predicate "count_register_operand" + (and (match_code "reg") + (match_test "REGNO (op) == COUNT_REGISTER_REGNUM + || REGNO (op) > LAST_VIRTUAL_REGISTER"))) + +;; Return 1 if op is an Altivec register. +(define_predicate "altivec_register_operand" + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || ALTIVEC_REGNO_P (REGNO (op)) + || REGNO (op) > LAST_VIRTUAL_REGISTER"))) + +;; Return 1 if op is XER register. +(define_predicate "xer_operand" + (and (match_code "reg") + (match_test "XER_REGNO_P (REGNO (op))"))) + +;; Return 1 if op is a signed 5-bit constant integer. +(define_predicate "s5bit_cint_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= -16 && INTVAL (op) <= 15"))) + +;; Return 1 if op is a unsigned 5-bit constant integer. +(define_predicate "u5bit_cint_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 31"))) + +;; Return 1 if op is a signed 8-bit constant integer. +;; Integer multiplication complete more quickly +(define_predicate "s8bit_cint_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= -128 && INTVAL (op) <= 127"))) + +;; Return 1 if op is a constant integer that can fit in a D field. +(define_predicate "short_cint_operand" + (and (match_code "const_int") + (match_test "satisfies_constraint_I (op)"))) + +;; Return 1 if op is a constant integer that can fit in an unsigned D field. +(define_predicate "u_short_cint_operand" + (and (match_code "const_int") + (match_test "satisfies_constraint_K (op)"))) + +;; Return 1 if op is a constant integer that cannot fit in a signed D field. +(define_predicate "non_short_cint_operand" + (and (match_code "const_int") + (match_test "(unsigned HOST_WIDE_INT) + (INTVAL (op) + 0x8000) >= 0x10000"))) + +;; Return 1 if op is a positive constant integer that is an exact power of 2. +(define_predicate "exact_log2_cint_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) > 0 && exact_log2 (INTVAL (op)) >= 0"))) + +;; Return 1 if op is a register that is not special. +(define_predicate "gpc_reg_operand" + (and (match_operand 0 "register_operand") + (match_test "(GET_CODE (op) != REG + || (REGNO (op) >= ARG_POINTER_REGNUM + && !XER_REGNO_P (REGNO (op))) + || REGNO (op) < MQ_REGNO) + && !((TARGET_E500_DOUBLE || TARGET_SPE) + && invalid_e500_subreg (op, mode))"))) + +;; Return 1 if op is a register that is a condition register field. +(define_predicate "cc_reg_operand" + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || REGNO (op) > LAST_VIRTUAL_REGISTER + || CR_REGNO_P (REGNO (op))"))) + +;; Return 1 if op is a register that is a condition register field not cr0. +(define_predicate "cc_reg_not_cr0_operand" + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || REGNO (op) > LAST_VIRTUAL_REGISTER + || CR_REGNO_NOT_CR0_P (REGNO (op))"))) + +;; Return 1 if op is a constant integer valid for D field +;; or non-special register register. +(define_predicate "reg_or_short_operand" + (if_then_else (match_code "const_int") + (match_operand 0 "short_cint_operand") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is a constant integer valid whose negation is valid for +;; D field or non-special register register. +;; Do not allow a constant zero because all patterns that call this +;; predicate use "addic r1,r2,-const" to set carry when r2 is greater than +;; or equal to const, which does not work for zero. +(define_predicate "reg_or_neg_short_operand" + (if_then_else (match_code "const_int") + (match_test "satisfies_constraint_P (op) + && INTVAL (op) != 0") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is a constant integer valid for DS field +;; or non-special register. +(define_predicate "reg_or_aligned_short_operand" + (if_then_else (match_code "const_int") + (and (match_operand 0 "short_cint_operand") + (match_test "!(INTVAL (op) & 3)")) + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is a constant integer whose high-order 16 bits are zero +;; or non-special register. +(define_predicate "reg_or_u_short_operand" + (if_then_else (match_code "const_int") + (match_operand 0 "u_short_cint_operand") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is any constant integer +;; or non-special register. +(define_predicate "reg_or_cint_operand" + (ior (match_code "const_int") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is a constant integer valid for addition +;; or non-special register. +(define_predicate "reg_or_add_cint_operand" + (if_then_else (match_code "const_int") + (match_test "(HOST_BITS_PER_WIDE_INT == 32 + && (mode == SImode || INTVAL (op) < 0x7fff8000)) + || ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80008000) + < (unsigned HOST_WIDE_INT) 0x100000000ll)") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is a constant integer valid for subtraction +;; or non-special register. +(define_predicate "reg_or_sub_cint_operand" + (if_then_else (match_code "const_int") + (match_test "(HOST_BITS_PER_WIDE_INT == 32 + && (mode == SImode || - INTVAL (op) < 0x7fff8000)) + || ((unsigned HOST_WIDE_INT) (- INTVAL (op) + + (mode == SImode + ? 0x80000000 : 0x80008000)) + < (unsigned HOST_WIDE_INT) 0x100000000ll)") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if op is any 32-bit unsigned constant integer +;; or non-special register. +(define_predicate "reg_or_logical_cint_operand" + (if_then_else (match_code "const_int") + (match_test "(GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT + && INTVAL (op) >= 0) + || ((INTVAL (op) & GET_MODE_MASK (mode) + & (~ (unsigned HOST_WIDE_INT) 0xffffffff)) == 0)") + (if_then_else (match_code "const_double") + (match_test "GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT + && mode == DImode + && CONST_DOUBLE_HIGH (op) == 0") + (match_operand 0 "gpc_reg_operand")))) + +;; Return 1 if operand is a CONST_DOUBLE that can be set in a register +;; with no more than one instruction per word. +(define_predicate "easy_fp_constant" + (match_code "const_double") +{ + long k[4]; + REAL_VALUE_TYPE rv; + + if (GET_MODE (op) != mode + || (!SCALAR_FLOAT_MODE_P (mode) && mode != DImode)) + return 0; + + /* Consider all constants with -msoft-float to be easy. */ + if ((TARGET_SOFT_FLOAT || TARGET_E500_SINGLE) + && mode != DImode) + return 1; + + if (DECIMAL_FLOAT_MODE_P (mode)) + return 0; + + /* If we are using V.4 style PIC, consider all constants to be hard. */ + if (flag_pic && DEFAULT_ABI == ABI_V4) + return 0; + +#ifdef TARGET_RELOCATABLE + /* Similarly if we are using -mrelocatable, consider all constants + to be hard. */ + if (TARGET_RELOCATABLE) + return 0; +#endif + + switch (mode) + { + case TFmode: + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k); + + return (num_insns_constant_wide ((HOST_WIDE_INT) k[0]) == 1 + && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1 + && num_insns_constant_wide ((HOST_WIDE_INT) k[2]) == 1 + && num_insns_constant_wide ((HOST_WIDE_INT) k[3]) == 1); + + case DFmode: + /* Force constants to memory before reload to utilize + compress_float_constant. + Avoid this when flag_unsafe_math_optimizations is enabled + because RDIV division to reciprocal optimization is not able + to regenerate the division. */ + if (TARGET_E500_DOUBLE + || (!reload_in_progress && !reload_completed + && !flag_unsafe_math_optimizations)) + return 0; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_DOUBLE (rv, k); + + return (num_insns_constant_wide ((HOST_WIDE_INT) k[0]) == 1 + && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1); + + case SFmode: + /* The constant 0.f is easy. */ + if (op == CONST0_RTX (SFmode)) + return 1; + + /* Force constants to memory before reload to utilize + compress_float_constant. + Avoid this when flag_unsafe_math_optimizations is enabled + because RDIV division to reciprocal optimization is not able + to regenerate the division. */ + if (!reload_in_progress && !reload_completed + && !flag_unsafe_math_optimizations) + return 0; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_SINGLE (rv, k[0]); + + return num_insns_constant_wide (k[0]) == 1; + + case DImode: + return ((TARGET_POWERPC64 + && GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_LOW (op) == 0) + || (num_insns_constant (op, DImode) <= 2)); + + case SImode: + return 1; + + default: + gcc_unreachable (); + } +}) + +;; Return 1 if the operand is a CONST_VECTOR and can be loaded into a +;; vector register without using memory. +(define_predicate "easy_vector_constant" + (match_code "const_vector") +{ + if (ALTIVEC_VECTOR_MODE (mode)) + { + if (zero_constant (op, mode)) + return true; + return easy_altivec_constant (op, mode); + } + + if (SPE_VECTOR_MODE (mode)) + { + int cst, cst2; + if (zero_constant (op, mode)) + return true; + if (GET_MODE_CLASS (mode) != MODE_VECTOR_INT) + return false; + + /* Limit SPE vectors to 15 bits signed. These we can generate with: + li r0, CONSTANT1 + evmergelo r0, r0, r0 + li r0, CONSTANT2 + + I don't know how efficient it would be to allow bigger constants, + considering we'll have an extra 'ori' for every 'li'. I doubt 5 + instructions is better than a 64-bit memory load, but I don't + have the e500 timing specs. */ + if (mode == V2SImode) + { + cst = INTVAL (CONST_VECTOR_ELT (op, 0)); + cst2 = INTVAL (CONST_VECTOR_ELT (op, 1)); + return cst >= -0x7fff && cst <= 0x7fff + && cst2 >= -0x7fff && cst2 <= 0x7fff; + } + } + + return false; +}) + +;; Same as easy_vector_constant but only for EASY_VECTOR_15_ADD_SELF. +(define_predicate "easy_vector_constant_add_self" + (and (match_code "const_vector") + (and (match_test "TARGET_ALTIVEC") + (match_test "easy_altivec_constant (op, mode)"))) +{ + rtx last = CONST_VECTOR_ELT (op, GET_MODE_NUNITS (mode) - 1); + HOST_WIDE_INT val = ((INTVAL (last) & 0xff) ^ 0x80) - 0x80; + return EASY_VECTOR_15_ADD_SELF (val); +}) + +;; Return 1 if operand is constant zero (scalars and vectors). +(define_predicate "zero_constant" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (mode)"))) + +;; Return 1 if operand is 0.0. +;; or non-special register register field no cr0 +(define_predicate "zero_fp_constant" + (and (match_code "const_double") + (match_test "SCALAR_FLOAT_MODE_P (mode) + && op == CONST0_RTX (mode)"))) + +;; Return 1 if the operand is in volatile memory. Note that during the +;; RTL generation phase, memory_operand does not return TRUE for volatile +;; memory references. So this function allows us to recognize volatile +;; references where it's safe. +(define_predicate "volatile_mem_operand" + (and (and (match_code "mem") + (match_test "MEM_VOLATILE_P (op)")) + (if_then_else (match_test "reload_completed") + (match_operand 0 "memory_operand") + (if_then_else (match_test "reload_in_progress") + (match_test "strict_memory_address_p (mode, XEXP (op, 0))") + (match_test "memory_address_p (mode, XEXP (op, 0))"))))) + +;; Return 1 if the operand is an offsettable memory operand. +(define_predicate "offsettable_mem_operand" + (and (match_code "mem") + (match_test "offsettable_address_p (reload_completed + || reload_in_progress, + mode, XEXP (op, 0))"))) + +;; Return 1 if the operand is a memory operand with an address divisible by 4 +(define_predicate "word_offset_memref_operand" + (and (match_operand 0 "memory_operand") + (match_test "GET_CODE (XEXP (op, 0)) != PLUS + || ! REG_P (XEXP (XEXP (op, 0), 0)) + || GET_CODE (XEXP (XEXP (op, 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (op, 0), 1)) % 4 == 0"))) + +;; Return 1 if the operand is an indexed or indirect memory operand. +(define_predicate "indexed_or_indirect_operand" + (match_code "mem") +{ + op = XEXP (op, 0); + if (TARGET_ALTIVEC + && ALTIVEC_VECTOR_MODE (mode) + && GET_CODE (op) == AND + && GET_CODE (XEXP (op, 1)) == CONST_INT + && INTVAL (XEXP (op, 1)) == -16) + op = XEXP (op, 0); + + return indexed_or_indirect_address (op, mode); +}) + +;; Return 1 if the operand is an indexed or indirect address. +(define_special_predicate "indexed_or_indirect_address" + (and (match_test "REG_P (op) + || (GET_CODE (op) == PLUS + /* Omit testing REG_P (XEXP (op, 0)). */ + && REG_P (XEXP (op, 1)))") + (match_operand 0 "address_operand"))) + +;; Used for the destination of the fix_truncdfsi2 expander. +;; If stfiwx will be used, the result goes to memory; otherwise, +;; we're going to emit a store and a load of a subreg, so the dest is a +;; register. +(define_predicate "fix_trunc_dest_operand" + (if_then_else (match_test "! TARGET_E500_DOUBLE && TARGET_PPC_GFXOPT") + (match_operand 0 "memory_operand") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if the operand is either a non-special register or can be used +;; as the operand of a `mode' add insn. +(define_predicate "add_operand" + (if_then_else (match_code "const_int") + (match_test "satisfies_constraint_I (op) + || satisfies_constraint_L (op)") + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if OP is a constant but not a valid add_operand. +(define_predicate "non_add_cint_operand" + (and (match_code "const_int") + (match_test "!satisfies_constraint_I (op) + && !satisfies_constraint_L (op)"))) + +;; Return 1 if the operand is a constant that can be used as the operand +;; of an OR or XOR. +(define_predicate "logical_const_operand" + (match_code "const_int,const_double") +{ + HOST_WIDE_INT opl, oph; + + if (GET_CODE (op) == CONST_INT) + { + opl = INTVAL (op) & GET_MODE_MASK (mode); + + if (HOST_BITS_PER_WIDE_INT <= 32 + && GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT && opl < 0) + return 0; + } + else if (GET_CODE (op) == CONST_DOUBLE) + { + gcc_assert (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT); + + opl = CONST_DOUBLE_LOW (op); + oph = CONST_DOUBLE_HIGH (op); + if (oph != 0) + return 0; + } + else + return 0; + + return ((opl & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0 + || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0); +}) + +;; Return 1 if the operand is a non-special register or a constant that +;; can be used as the operand of an OR or XOR. +(define_predicate "logical_operand" + (ior (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_const_operand"))) + +;; Return 1 if op is a constant that is not a logical operand, but could +;; be split into one. +(define_predicate "non_logical_cint_operand" + (and (match_code "const_int,const_double") + (and (not (match_operand 0 "logical_operand")) + (match_operand 0 "reg_or_logical_cint_operand")))) + +;; Return 1 if op is a constant that can be encoded in a 32-bit mask, +;; suitable for use with rlwinm (no more than two 1->0 or 0->1 +;; transitions). Reject all ones and all zeros, since these should have +;; been optimized away and confuse the making of MB and ME. +(define_predicate "mask_operand" + (match_code "const_int") +{ + HOST_WIDE_INT c, lsb; + + c = INTVAL (op); + + if (TARGET_POWERPC64) + { + /* Fail if the mask is not 32-bit. */ + if (mode == DImode && (c & ~(unsigned HOST_WIDE_INT) 0xffffffff) != 0) + return 0; + + /* Fail if the mask wraps around because the upper 32-bits of the + mask will all be 1s, contrary to GCC's internal view. */ + if ((c & 0x80000001) == 0x80000001) + return 0; + } + + /* We don't change the number of transitions by inverting, + so make sure we start with the LS bit zero. */ + if (c & 1) + c = ~c; + + /* Reject all zeros or all ones. */ + if (c == 0) + return 0; + + /* Find the first transition. */ + lsb = c & -c; + + /* Invert to look for a second transition. */ + c = ~c; + + /* Erase first transition. */ + c &= -lsb; + + /* Find the second transition (if any). */ + lsb = c & -c; + + /* Match if all the bits above are 1's (or c is zero). */ + return c == -lsb; +}) + +;; Return 1 for the PowerPC64 rlwinm corner case. +(define_predicate "mask_operand_wrap" + (match_code "const_int") +{ + HOST_WIDE_INT c, lsb; + + c = INTVAL (op); + + if ((c & 0x80000001) != 0x80000001) + return 0; + + c = ~c; + if (c == 0) + return 0; + + lsb = c & -c; + c = ~c; + c &= -lsb; + lsb = c & -c; + return c == -lsb; +}) + +;; Return 1 if the operand is a constant that is a PowerPC64 mask +;; suitable for use with rldicl or rldicr (no more than one 1->0 or 0->1 +;; transition). Reject all zeros, since zero should have been +;; optimized away and confuses the making of MB and ME. +(define_predicate "mask64_operand" + (match_code "const_int") +{ + HOST_WIDE_INT c, lsb; + + c = INTVAL (op); + + /* Reject all zeros. */ + if (c == 0) + return 0; + + /* We don't change the number of transitions by inverting, + so make sure we start with the LS bit zero. */ + if (c & 1) + c = ~c; + + /* Find the first transition. */ + lsb = c & -c; + + /* Match if all the bits above are 1's (or c is zero). */ + return c == -lsb; +}) + +;; Like mask64_operand, but allow up to three transitions. This +;; predicate is used by insn patterns that generate two rldicl or +;; rldicr machine insns. +(define_predicate "mask64_2_operand" + (match_code "const_int") +{ + HOST_WIDE_INT c, lsb; + + c = INTVAL (op); + + /* Disallow all zeros. */ + if (c == 0) + return 0; + + /* We don't change the number of transitions by inverting, + so make sure we start with the LS bit zero. */ + if (c & 1) + c = ~c; + + /* Find the first transition. */ + lsb = c & -c; + + /* Invert to look for a second transition. */ + c = ~c; + + /* Erase first transition. */ + c &= -lsb; + + /* Find the second transition. */ + lsb = c & -c; + + /* Invert to look for a third transition. */ + c = ~c; + + /* Erase second transition. */ + c &= -lsb; + + /* Find the third transition (if any). */ + lsb = c & -c; + + /* Match if all the bits above are 1's (or c is zero). */ + return c == -lsb; +}) + +;; Like and_operand, but also match constants that can be implemented +;; with two rldicl or rldicr insns. +(define_predicate "and64_2_operand" + (ior (match_operand 0 "mask64_2_operand") + (if_then_else (match_test "fixed_regs[CR0_REGNO]") + (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_operand")))) + +;; Return 1 if the operand is either a non-special register or a +;; constant that can be used as the operand of a logical AND. +(define_predicate "and_operand" + (ior (match_operand 0 "mask_operand") + (ior (and (match_test "TARGET_POWERPC64 && mode == DImode") + (match_operand 0 "mask64_operand")) + (if_then_else (match_test "fixed_regs[CR0_REGNO]") + (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_operand"))))) + +;; Return 1 if the operand is either a logical operand or a short cint operand. +(define_predicate "scc_eq_operand" + (ior (match_operand 0 "logical_operand") + (match_operand 0 "short_cint_operand"))) + +;; Return 1 if the operand is a general non-special register or memory operand. +(define_predicate "reg_or_mem_operand" + (ior (match_operand 0 "memory_operand") + (ior (and (match_code "mem") + (match_test "macho_lo_sum_memory_operand (op, mode)")) + (ior (match_operand 0 "volatile_mem_operand") + (match_operand 0 "gpc_reg_operand"))))) + +;; Return 1 if the operand is either an easy FP constant or memory or reg. +(define_predicate "reg_or_none500mem_operand" + (if_then_else (match_code "mem") + (and (match_test "!TARGET_E500_DOUBLE") + (ior (match_operand 0 "memory_operand") + (ior (match_test "macho_lo_sum_memory_operand (op, mode)") + (match_operand 0 "volatile_mem_operand")))) + (match_operand 0 "gpc_reg_operand"))) + +;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand. +(define_predicate "zero_reg_mem_operand" + (ior (match_operand 0 "zero_fp_constant") + (match_operand 0 "reg_or_mem_operand"))) + +;; Return 1 if the operand is a general register or memory operand without +;; pre_inc or pre_dec, which produces invalid form of PowerPC lwa +;; instruction. +(define_predicate "lwa_operand" + (match_code "reg,subreg,mem") +{ + rtx inner = op; + + if (reload_completed && GET_CODE (inner) == SUBREG) + inner = SUBREG_REG (inner); + + return gpc_reg_operand (inner, mode) + || (memory_operand (inner, mode) + && GET_CODE (XEXP (inner, 0)) != PRE_INC + && GET_CODE (XEXP (inner, 0)) != PRE_DEC + && (GET_CODE (XEXP (inner, 0)) != PLUS + || GET_CODE (XEXP (XEXP (inner, 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0)); +}) + +;; Return 1 if the operand, used inside a MEM, is a SYMBOL_REF. +(define_predicate "symbol_ref_operand" + (and (match_code "symbol_ref") + (match_test "(mode == VOIDmode || GET_MODE (op) == mode) + && (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))"))) + +;; Return 1 if op is an operand that can be loaded via the GOT. +;; or non-special register register field no cr0 +(define_predicate "got_operand" + (match_code "symbol_ref,const,label_ref")) + +;; Return 1 if op is a simple reference that can be loaded via the GOT, +;; excluding labels involving addition. +(define_predicate "got_no_const_operand" + (match_code "symbol_ref,label_ref")) + +;; Return 1 if op is a SYMBOL_REF for a TLS symbol. +(define_predicate "rs6000_tls_symbol_ref" + (and (match_code "symbol_ref") + (match_test "RS6000_SYMBOL_REF_TLS_P (op)"))) + +;; Return 1 if the operand, used inside a MEM, is a valid first argument +;; to CALL. This is a SYMBOL_REF, a pseudo-register, LR or CTR. +(define_predicate "call_operand" + (if_then_else (match_code "reg") + (match_test "REGNO (op) == LINK_REGISTER_REGNUM + || REGNO (op) == COUNT_REGISTER_REGNUM + || REGNO (op) >= FIRST_PSEUDO_REGISTER") + (match_code "symbol_ref"))) + +;; Return 1 if the operand is a SYMBOL_REF for a function known to be in +;; this file. +(define_predicate "current_file_function_operand" + (and (match_code "symbol_ref") + (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)) + && (SYMBOL_REF_LOCAL_P (op) + || (op == XEXP (DECL_RTL (current_function_decl), + 0)))"))) + +;; Return 1 if this operand is a valid input for a move insn. +(define_predicate "input_operand" + (match_code "label_ref,symbol_ref,const,high,reg,subreg,mem, + const_double,const_vector,const_int,plus") +{ + /* Memory is always valid. */ + if (memory_operand (op, mode)) + return 1; + + /* For floating-point, easy constants are valid. */ + if (SCALAR_FLOAT_MODE_P (mode) + && CONSTANT_P (op) + && easy_fp_constant (op, mode)) + return 1; + + /* Allow any integer constant. */ + if (GET_MODE_CLASS (mode) == MODE_INT + && (GET_CODE (op) == CONST_INT + || GET_CODE (op) == CONST_DOUBLE)) + return 1; + + /* Allow easy vector constants. */ + if (GET_CODE (op) == CONST_VECTOR + && easy_vector_constant (op, mode)) + return 1; + + /* Do not allow invalid E500 subregs. */ + if ((TARGET_E500_DOUBLE || TARGET_SPE) + && GET_CODE (op) == SUBREG + && invalid_e500_subreg (op, mode)) + return 0; + + /* For floating-point or multi-word mode, the only remaining valid type + is a register. */ + if (SCALAR_FLOAT_MODE_P (mode) + || GET_MODE_SIZE (mode) > UNITS_PER_WORD) + return register_operand (op, mode); + + /* The only cases left are integral modes one word or smaller (we + do not get called for MODE_CC values). These can be in any + register. */ + if (register_operand (op, mode)) + return 1; + + /* A SYMBOL_REF referring to the TOC is valid. */ + if (legitimate_constant_pool_address_p (op)) + return 1; + + /* A constant pool expression (relative to the TOC) is valid */ + if (toc_relative_expr_p (op)) + return 1; + + /* V.4 allows SYMBOL_REFs and CONSTs that are in the small data region + to be valid. */ + if (DEFAULT_ABI == ABI_V4 + && (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST) + && small_data_operand (op, Pmode)) + return 1; + + return 0; +}) + +;; Return true if OP is an invalid SUBREG operation on the e500. +(define_predicate "rs6000_nonimmediate_operand" + (match_code "reg,subreg,mem") +{ + if ((TARGET_E500_DOUBLE || TARGET_SPE) + && GET_CODE (op) == SUBREG + && invalid_e500_subreg (op, mode)) + return 0; + + return nonimmediate_operand (op, mode); +}) + +;; Return true if operand is boolean operator. +(define_predicate "boolean_operator" + (match_code "and,ior,xor")) + +;; Return true if operand is OR-form of boolean operator. +(define_predicate "boolean_or_operator" + (match_code "ior,xor")) + +;; Return true if operand is an equality operator. +(define_special_predicate "equality_operator" + (match_code "eq,ne")) + +;; Return true if operand is MIN or MAX operator. +(define_predicate "min_max_operator" + (match_code "smin,smax,umin,umax")) + +;; Return 1 if OP is a comparison operation that is valid for a branch +;; instruction. We check the opcode against the mode of the CC value. +;; validate_condition_mode is an assertion. +(define_predicate "branch_comparison_operator" + (and (match_operand 0 "comparison_operator") + (and (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC") + (match_test "validate_condition_mode (GET_CODE (op), + GET_MODE (XEXP (op, 0))), + 1")))) + +;; Return 1 if OP is a comparison operation that is valid for an SCC insn -- +;; it must be a positive comparison. +(define_predicate "scc_comparison_operator" + (and (match_operand 0 "branch_comparison_operator") + (match_code "eq,lt,gt,ltu,gtu,unordered"))) + +;; Return 1 if OP is a comparison operation that is valid for a branch +;; insn, which is true if the corresponding bit in the CC register is set. +(define_predicate "branch_positive_comparison_operator" + (and (match_operand 0 "branch_comparison_operator") + (match_code "eq,lt,gt,ltu,gtu,unordered"))) + +;; Return 1 is OP is a comparison operation that is valid for a trap insn. +(define_predicate "trap_comparison_operator" + (and (match_operand 0 "comparison_operator") + (match_code "eq,ne,le,lt,ge,gt,leu,ltu,geu,gtu"))) + +;; Return 1 if OP is a load multiple operation, known to be a PARALLEL. +(define_predicate "load_multiple_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + unsigned int dest_regno; + rtx src_addr; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) + return 0; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != dest_regno + i + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4) + return 0; + } + + return 1; +}) + +;; Return 1 if OP is a store multiple operation, known to be a PARALLEL. +;; The second vector element is a CLOBBER. +(define_predicate "store_multiple_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0) - 1; + unsigned int src_regno; + rtx dest_addr; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) + return 0; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i + 1); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != src_regno + i + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4) + return 0; + } + + return 1; +}) + +;; Return 1 if OP is valid for a save_world call in prologue, known to be +;; a PARLLEL. +(define_predicate "save_world_operation" + (match_code "parallel") +{ + int index; + int i; + rtx elt; + int count = XVECLEN (op, 0); + + if (count != 55) + return 0; + + index = 0; + if (GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER + || GET_CODE (XVECEXP (op, 0, index++)) != USE) + return 0; + + for (i=1; i <= 18; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != MEM + || ! memory_operand (SET_DEST (elt), DFmode) + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != DFmode) + return 0; + } + + for (i=1; i <= 12; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != MEM + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != V4SImode) + return 0; + } + + for (i=1; i <= 19; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != MEM + || ! memory_operand (SET_DEST (elt), Pmode) + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != Pmode) + return 0; + } + + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != MEM + || ! memory_operand (SET_DEST (elt), Pmode) + || GET_CODE (SET_SRC (elt)) != REG + || REGNO (SET_SRC (elt)) != CR2_REGNO + || GET_MODE (SET_SRC (elt)) != Pmode) + return 0; + + if (GET_CODE (XVECEXP (op, 0, index++)) != USE + || GET_CODE (XVECEXP (op, 0, index++)) != USE + || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER) + return 0; + return 1; +}) + +;; Return 1 if OP is valid for a restore_world call in epilogue, known to be +;; a PARLLEL. +(define_predicate "restore_world_operation" + (match_code "parallel") +{ + int index; + int i; + rtx elt; + int count = XVECLEN (op, 0); + + if (count != 59) + return 0; + + index = 0; + if (GET_CODE (XVECEXP (op, 0, index++)) != RETURN + || GET_CODE (XVECEXP (op, 0, index++)) != USE + || GET_CODE (XVECEXP (op, 0, index++)) != USE + || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER) + return 0; + + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != MEM + || ! memory_operand (SET_SRC (elt), Pmode) + || GET_CODE (SET_DEST (elt)) != REG + || REGNO (SET_DEST (elt)) != CR2_REGNO + || GET_MODE (SET_DEST (elt)) != Pmode) + return 0; + + for (i=1; i <= 19; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != MEM + || ! memory_operand (SET_SRC (elt), Pmode) + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != Pmode) + return 0; + } + + for (i=1; i <= 12; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != MEM + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != V4SImode) + return 0; + } + + for (i=1; i <= 18; i++) + { + elt = XVECEXP (op, 0, index++); + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != MEM + || ! memory_operand (SET_SRC (elt), DFmode) + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != DFmode) + return 0; + } + + if (GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER + || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER + || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER + || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER + || GET_CODE (XVECEXP (op, 0, index++)) != USE) + return 0; + return 1; +}) + +;; Return 1 if OP is valid for a vrsave call, known to be a PARALLEL. +(define_predicate "vrsave_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + unsigned int dest_regno, src_regno; + int i; + + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC_VOLATILE + || XINT (SET_SRC (XVECEXP (op, 0, 0)), 1) != UNSPECV_SET_VRSAVE) + return 0; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_regno = REGNO (XVECEXP (SET_SRC (XVECEXP (op, 0, 0)), 0, 1)); + + if (dest_regno != VRSAVE_REGNO || src_regno != VRSAVE_REGNO) + return 0; + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != CLOBBER + && GET_CODE (elt) != SET) + return 0; + } + + return 1; +}) + +;; Return 1 if OP is valid for mfcr insn, known to be a PARALLEL. +(define_predicate "mfcr_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count < 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC + || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2) + return 0; + + for (i = 0; i < count; i++) + { + rtx exp = XVECEXP (op, 0, i); + rtx unspec; + int maskval; + rtx src_reg; + + src_reg = XVECEXP (SET_SRC (exp), 0, 0); + + if (GET_CODE (src_reg) != REG + || GET_MODE (src_reg) != CCmode + || ! CR_REGNO_P (REGNO (src_reg))) + return 0; + + if (GET_CODE (exp) != SET + || GET_CODE (SET_DEST (exp)) != REG + || GET_MODE (SET_DEST (exp)) != SImode + || ! INT_REGNO_P (REGNO (SET_DEST (exp)))) + return 0; + unspec = SET_SRC (exp); + maskval = 1 << (MAX_CR_REGNO - REGNO (src_reg)); + + if (GET_CODE (unspec) != UNSPEC + || XINT (unspec, 1) != UNSPEC_MOVESI_FROM_CR + || XVECLEN (unspec, 0) != 2 + || XVECEXP (unspec, 0, 0) != src_reg + || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT + || INTVAL (XVECEXP (unspec, 0, 1)) != maskval) + return 0; + } + return 1; +}) + +;; Return 1 if OP is valid for mtcrf insn, known to be a PARALLEL. +(define_predicate "mtcrf_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + rtx src_reg; + + /* Perform a quick check so we don't blow up below. */ + if (count < 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC + || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2) + return 0; + src_reg = XVECEXP (SET_SRC (XVECEXP (op, 0, 0)), 0, 0); + + if (GET_CODE (src_reg) != REG + || GET_MODE (src_reg) != SImode + || ! INT_REGNO_P (REGNO (src_reg))) + return 0; + + for (i = 0; i < count; i++) + { + rtx exp = XVECEXP (op, 0, i); + rtx unspec; + int maskval; + + if (GET_CODE (exp) != SET + || GET_CODE (SET_DEST (exp)) != REG + || GET_MODE (SET_DEST (exp)) != CCmode + || ! CR_REGNO_P (REGNO (SET_DEST (exp)))) + return 0; + unspec = SET_SRC (exp); + maskval = 1 << (MAX_CR_REGNO - REGNO (SET_DEST (exp))); + + if (GET_CODE (unspec) != UNSPEC + || XINT (unspec, 1) != UNSPEC_MOVESI_TO_CR + || XVECLEN (unspec, 0) != 2 + || XVECEXP (unspec, 0, 0) != src_reg + || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT + || INTVAL (XVECEXP (unspec, 0, 1)) != maskval) + return 0; + } + return 1; +}) + +;; Return 1 if OP is valid for lmw insn, known to be a PARALLEL. +(define_predicate "lmw_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + unsigned int dest_regno; + rtx src_addr; + unsigned int base_regno; + HOST_WIDE_INT offset; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) + return 0; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); + + if (dest_regno > 31 + || count != 32 - (int) dest_regno) + return 0; + + if (legitimate_indirect_address_p (src_addr, 0)) + { + offset = 0; + base_regno = REGNO (src_addr); + if (base_regno == 0) + return 0; + } + else if (rs6000_legitimate_offset_address_p (SImode, src_addr, 0)) + { + offset = INTVAL (XEXP (src_addr, 1)); + base_regno = REGNO (XEXP (src_addr, 0)); + } + else + return 0; + + for (i = 0; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + rtx newaddr; + rtx addr_reg; + HOST_WIDE_INT newoffset; + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != dest_regno + i + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode) + return 0; + newaddr = XEXP (SET_SRC (elt), 0); + if (legitimate_indirect_address_p (newaddr, 0)) + { + newoffset = 0; + addr_reg = newaddr; + } + else if (rs6000_legitimate_offset_address_p (SImode, newaddr, 0)) + { + addr_reg = XEXP (newaddr, 0); + newoffset = INTVAL (XEXP (newaddr, 1)); + } + else + return 0; + if (REGNO (addr_reg) != base_regno + || newoffset != offset + 4 * i) + return 0; + } + + return 1; +}) + +;; Return 1 if OP is valid for stmw insn, known to be a PARALLEL. +(define_predicate "stmw_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + unsigned int src_regno; + rtx dest_addr; + unsigned int base_regno; + HOST_WIDE_INT offset; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) + return 0; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); + + if (src_regno > 31 + || count != 32 - (int) src_regno) + return 0; + + if (legitimate_indirect_address_p (dest_addr, 0)) + { + offset = 0; + base_regno = REGNO (dest_addr); + if (base_regno == 0) + return 0; + } + else if (rs6000_legitimate_offset_address_p (SImode, dest_addr, 0)) + { + offset = INTVAL (XEXP (dest_addr, 1)); + base_regno = REGNO (XEXP (dest_addr, 0)); + } + else + return 0; + + for (i = 0; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + rtx newaddr; + rtx addr_reg; + HOST_WIDE_INT newoffset; + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != src_regno + i + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode) + return 0; + newaddr = XEXP (SET_DEST (elt), 0); + if (legitimate_indirect_address_p (newaddr, 0)) + { + newoffset = 0; + addr_reg = newaddr; + } + else if (rs6000_legitimate_offset_address_p (SImode, newaddr, 0)) + { + addr_reg = XEXP (newaddr, 0); + newoffset = INTVAL (XEXP (newaddr, 1)); + } + else + return 0; + if (REGNO (addr_reg) != base_regno + || newoffset != offset + 4 * i) + return 0; + } + + return 1; +}) diff --git a/contrib/gcc/config/rs6000/rios1.md b/contrib/gcc/config/rs6000/rios1.md index 5e77a67fe2c..59b34c5f8d7 100644 --- a/contrib/gcc/config/rs6000/rios1.md +++ b/contrib/gcc/config/rs6000/rios1.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM POWER processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,8 +15,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "rios1,rios1fp") (define_cpu_unit "iu_rios1" "rios1") @@ -26,11 +26,12 @@ ;; RIOS1 32-bit IU, FPU, BPU (define_insn_reservation "rios1-load" 2 - (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u") + (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,\ + load_l,store_c,sync") (eq_attr "cpu" "rios1,ppc601")) "iu_rios1") -(define_insn_reservation "rios1-store" 1 +(define_insn_reservation "rios1-store" 2 (and (eq_attr "type" "store,store_ux,store_u") (eq_attr "cpu" "rios1,ppc601")) "iu_rios1") @@ -45,7 +46,7 @@ (eq_attr "cpu" "ppc601")) "iu_rios1") -(define_insn_reservation "rios1-fpstore" 1 +(define_insn_reservation "rios1-fpstore" 3 (and (eq_attr "type" "fpstore,fpstore_ux,fpstore_u") (eq_attr "cpu" "rios1,ppc601")) "iu_rios1+fpu_rios1") @@ -55,6 +56,16 @@ (eq_attr "cpu" "rios1,ppc601")) "iu_rios1") +(define_insn_reservation "rios1-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "rios1,ppc601")) + "iu_rios1,iu_rios1") + +(define_insn_reservation "rios1-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "rios1,ppc601")) + "iu_rios1,iu_rios1,iu_rios1") + (define_insn_reservation "rios1-imul" 5 (and (eq_attr "type" "imul,imul_compare") (eq_attr "cpu" "rios1")) @@ -173,7 +184,7 @@ "iu_rios1,bpu_rios1") (define_insn_reservation "rios1-branch" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "rios1,ppc601")) "bpu_rios1") diff --git a/contrib/gcc/config/rs6000/rios2.md b/contrib/gcc/config/rs6000/rios2.md index 36690acf06e..b2f5cb282ab 100644 --- a/contrib/gcc/config/rs6000/rios2.md +++ b/contrib/gcc/config/rs6000/rios2.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM Power2 processor. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,8 +15,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "rios2,rios2fp") (define_cpu_unit "iu1_rios2,iu2_rios2" "rios2") @@ -29,11 +29,12 @@ (define_insn_reservation "rios2-load" 2 (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,\ - load_ux,load_u,fpload,fpload_ux,fpload_u") + load_ux,load_u,fpload,fpload_ux,fpload_u,\ + load_l,store_c,sync") (eq_attr "cpu" "rios2")) "iu1_rios2|iu2_rios2") -(define_insn_reservation "rios2-store" 1 +(define_insn_reservation "rios2-store" 2 (and (eq_attr "type" "store,store_ux,store_u,fpstore,fpstore_ux,fpstore_u") (eq_attr "cpu" "rios2")) "iu1_rios2|iu2_rios2") @@ -43,6 +44,16 @@ (eq_attr "cpu" "rios2")) "iu1_rios2|iu2_rios2") +(define_insn_reservation "rios2-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "rios2")) + "iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2") + +(define_insn_reservation "rios2-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "rios2")) + "iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2") + (define_insn_reservation "rios2-imul" 2 (and (eq_attr "type" "imul,imul2,imul3,imul_compare") (eq_attr "cpu" "rios2")) @@ -111,7 +122,7 @@ "iu1_rios2,bpu_rios2") (define_insn_reservation "rios2-branch" 1 - (and (eq_attr "type" "jmpreg,branch") + (and (eq_attr "type" "jmpreg,branch,isync") (eq_attr "cpu" "rios2")) "bpu_rios2") diff --git a/contrib/gcc/config/rs6000/rs6000-c.c b/contrib/gcc/config/rs6000/rs6000-c.c index 13d0ca6eb65..5c6abd10b17 100644 --- a/contrib/gcc/config/rs6000/rs6000-c.c +++ b/contrib/gcc/config/rs6000/rs6000-c.c @@ -1,8 +1,9 @@ /* Subroutines for the C front end on the POWER and PowerPC architectures. - Copyright (C) 2002, 2003 + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Zack Weinberg + and Paolo Bonzini This file is part of GCC. @@ -18,8 +19,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -27,9 +28,15 @@ #include "tm.h" #include "cpplib.h" #include "tree.h" +#include "c-common.h" #include "c-pragma.h" -#include "errors.h" +#include "c-tree.h" +#include "toplev.h" #include "tm_p.h" +#include "target.h" +#include "langhooks.h" + + /* Handle the machine specific pragma longcall. Its syntax is @@ -41,10 +48,10 @@ whether or not new function declarations receive a longcall attribute by default. */ -#define SYNTAX_ERROR(msgid) do { \ - warning (msgid); \ - warning ("ignoring malformed #pragma longcall"); \ - return; \ +#define SYNTAX_ERROR(gmsgid) do { \ + warning (OPT_Wpragmas, gmsgid); \ + warning (OPT_Wpragmas, "ignoring malformed #pragma longcall"); \ + return; \ } while (0) void @@ -55,20 +62,20 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED) /* If we get here, generic code has already scanned the directive leader and the word "longcall". */ - if (c_lex (&x) != CPP_OPEN_PAREN) + if (pragma_lex (&x) != CPP_OPEN_PAREN) SYNTAX_ERROR ("missing open paren"); - if (c_lex (&n) != CPP_NUMBER) + if (pragma_lex (&n) != CPP_NUMBER) SYNTAX_ERROR ("missing number"); - if (c_lex (&x) != CPP_CLOSE_PAREN) + if (pragma_lex (&x) != CPP_CLOSE_PAREN) SYNTAX_ERROR ("missing close paren"); - if (!integer_zerop (n) && !integer_onep (n)) + if (n != integer_zero_node && n != integer_one_node) SYNTAX_ERROR ("number must be 0 or 1"); - if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma longcall"); + if (pragma_lex (&x) != CPP_EOF) + warning (OPT_Wpragmas, "junk at end of #pragma longcall"); - rs6000_default_long_calls = integer_onep (n); + rs6000_default_long_calls = (n == integer_one_node); } /* Handle defining many CPP flags based on TARGET_xxx. As a general @@ -87,8 +94,18 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) builtin_define ("_ARCH_PWR"); if (TARGET_POWERPC) builtin_define ("_ARCH_PPC"); + if (TARGET_PPC_GPOPT) + builtin_define ("_ARCH_PPCSQ"); + if (TARGET_PPC_GFXOPT) + builtin_define ("_ARCH_PPCGR"); if (TARGET_POWERPC64) builtin_define ("_ARCH_PPC64"); + if (TARGET_MFCRF) + builtin_define ("_ARCH_PWR4"); + if (TARGET_POPCNTB) + builtin_define ("_ARCH_PWR5"); + if (TARGET_FPRND) + builtin_define ("_ARCH_PWR5X"); if (! TARGET_POWER && ! TARGET_POWER2 && ! TARGET_POWERPC) builtin_define ("_ARCH_COM"); if (TARGET_ALTIVEC) @@ -108,6 +125,9 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) /* Used by lwarx/stwcx. errata work-around. */ if (rs6000_cpu == PROCESSOR_PPC405) builtin_define ("__PPC405__"); + /* Used by libstdc++. */ + if (TARGET_NO_LWSYNC) + builtin_define ("__NO_LWSYNC__"); /* May be overridden by target configuration. */ RS6000_CPU_CPP_ENDIAN_BUILTINS(); @@ -130,4 +150,2430 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) default: break; } + + /* Let the compiled code know if 'f' class registers will not be available. */ + if (TARGET_SOFT_FLOAT || !TARGET_FPRS) + builtin_define ("__NO_FPRS__"); } + + +struct altivec_builtin_types +{ + enum rs6000_builtins code; + enum rs6000_builtins overloaded_code; + signed char ret_type; + signed char op1; + signed char op2; + signed char op3; +}; + +const struct altivec_builtin_types altivec_overloaded_builtins[] = { + /* Unary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_CEIL, ALTIVEC_BUILTIN_VRFIP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_EXPTE, ALTIVEC_BUILTIN_VEXPTEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_FLOOR, ALTIVEC_BUILTIN_VRFIM, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_LOGE, ALTIVEC_BUILTIN_VLOGEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_RE, ALTIVEC_BUILTIN_VREFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ROUND, ALTIVEC_BUILTIN_VRFIN, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_RSQRTE, ALTIVEC_BUILTIN_VRSQRTEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_TRUNC, ALTIVEC_BUILTIN_VRFIZ, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + + /* Binary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDFP, ALTIVEC_BUILTIN_VADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDC, ALTIVEC_BUILTIN_VADDCUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSW, ALTIVEC_BUILTIN_VAVGSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUW, ALTIVEC_BUILTIN_VAVGUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSH, ALTIVEC_BUILTIN_VAVGSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUH, ALTIVEC_BUILTIN_VAVGUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSB, ALTIVEC_BUILTIN_VAVGSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUB, ALTIVEC_BUILTIN_VAVGUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPB, ALTIVEC_BUILTIN_VCMPBFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQFP, ALTIVEC_BUILTIN_VCMPEQFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGE, ALTIVEC_BUILTIN_VCMPGEFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTFP, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLE, ALTIVEC_BUILTIN_VCMPGEFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CTF, ALTIVEC_BUILTIN_VCFUX, + RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTF, ALTIVEC_BUILTIN_VCFSX, + RS6000_BTI_V4SF, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCFSX, ALTIVEC_BUILTIN_VCFSX, + RS6000_BTI_V4SF, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCFUX, ALTIVEC_BUILTIN_VCFUX, + RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTS, ALTIVEC_BUILTIN_VCTSXS, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTU, ALTIVEC_BUILTIN_VCTUXS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEHX, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEHX, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEBX, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEBX, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXFP, ALTIVEC_BUILTIN_VMAXFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINFP, ALTIVEC_BUILTIN_VMINFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULEUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULESB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULEUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULESH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULEUB, ALTIVEC_BUILTIN_VMULEUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULESB, ALTIVEC_BUILTIN_VMULESB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULEUH, ALTIVEC_BUILTIN_VMULEUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULESH, ALTIVEC_BUILTIN_VMULESH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOSH, ALTIVEC_BUILTIN_VMULOSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOUH, ALTIVEC_BUILTIN_VMULOUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOSB, ALTIVEC_BUILTIN_VMULOSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOUB, ALTIVEC_BUILTIN_VMULOUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKPX, ALTIVEC_BUILTIN_VPKPX, + RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKSHSS, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKSWSS, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSWSS, ALTIVEC_BUILTIN_VPKSWSS, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUS, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSHSS, ALTIVEC_BUILTIN_VPKSHSS, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUS, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKSHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKSWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSWUS, ALTIVEC_BUILTIN_VPKSWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSHUS, ALTIVEC_BUILTIN_VPKSHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLW, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLW, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLH, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLH, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLB, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLB, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLW, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLW, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLH, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLH, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLB, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLB, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRW, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRW, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRH, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRH, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRB, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRB, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAH, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAH, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAB, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAB, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBFP, ALTIVEC_BUILTIN_VSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBC, ALTIVEC_BUILTIN_VSUBCUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4UBS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4SBS, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4SHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4SHS, ALTIVEC_BUILTIN_VSUM4SHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4SBS, ALTIVEC_BUILTIN_VSUM4SBS, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4UBS, ALTIVEC_BUILTIN_VSUM4UBS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM2S, ALTIVEC_BUILTIN_VSUM2SWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUMS, ALTIVEC_BUILTIN_VSUMSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + + /* Ternary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_MADD, ALTIVEC_BUILTIN_VMADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_MADDS, ALTIVEC_BUILTIN_VMHADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_MRADDS, ALTIVEC_BUILTIN_VMHRADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMUBM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMMBM, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMUHM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMSHM, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMSHM, ALTIVEC_BUILTIN_VMSUMSHM, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUHM, ALTIVEC_BUILTIN_VMSUMUHM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMMBM, ALTIVEC_BUILTIN_VMSUMMBM, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUBM, ALTIVEC_BUILTIN_VMSUMUBM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUMS, ALTIVEC_BUILTIN_VMSUMUHS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUMS, ALTIVEC_BUILTIN_VMSUMSHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMSHS, ALTIVEC_BUILTIN_VMSUMSHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUHS, ALTIVEC_BUILTIN_VMSUMUHS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_NMSUB, ALTIVEC_BUILTIN_VNMSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI }, + + /* Predicates. */ + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + + /* cmpge is the same as cmpgt for all cases except floating point. + There is further code to deal with this special case in + altivec_build_resolved_builtin. */ + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGEFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + { 0, 0, 0, 0, 0, 0 } +}; + + +/* Convert a type stored into a struct altivec_builtin_types as ID, + into a tree. The types are in rs6000_builtin_types: negative values + create a pointer type for the type associated to ~ID. Note it is + a logical NOT, rather than a negation, otherwise you cannot represent + a pointer type for ID 0. */ + +static inline tree +rs6000_builtin_type (int id) +{ + tree t; + t = rs6000_builtin_types[id < 0 ? ~id : id]; + return id < 0 ? build_pointer_type (t) : t; +} + +/* Check whether the type of an argument, T, is compatible with a + type ID stored into a struct altivec_builtin_types. Integer + types are considered compatible; otherwise, the language hook + lang_hooks.types_compatible_p makes the decision. */ + +static inline bool +rs6000_builtin_type_compatible (tree t, int id) +{ + tree builtin_type; + builtin_type = rs6000_builtin_type (id); + if (INTEGRAL_TYPE_P (t) && INTEGRAL_TYPE_P (builtin_type)) + return true; + else + return lang_hooks.types_compatible_p (t, builtin_type); +} + + +/* Build a tree for a function call to an Altivec non-overloaded builtin. + The overloaded builtin that matched the types and args is described + by DESC. The N arguments are given in ARGS, respectively. + + Actually the only thing it does is calling fold_convert on ARGS, with + a small exception for vec_{all,any}_{ge,le} predicates. */ + +static tree +altivec_build_resolved_builtin (tree *args, int n, + const struct altivec_builtin_types *desc) +{ + tree impl_fndecl = rs6000_builtin_decls[desc->overloaded_code]; + tree ret_type = rs6000_builtin_type (desc->ret_type); + tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (impl_fndecl)); + tree arglist = NULL_TREE, arg_type[3]; + + int i; + for (i = 0; i < n; i++) + arg_type[i] = TREE_VALUE (argtypes), argtypes = TREE_CHAIN (argtypes); + + /* The AltiVec overloading implementation is overall gross, but this + is particularly disgusting. The vec_{all,any}_{ge,le} builtins + are completely different for floating-point vs. integer vector + types, because the former has vcmpgefp, but the latter should use + vcmpgtXX. + + In practice, the second and third arguments are swapped, and the + condition (LT vs. EQ, which is recognizable by bit 1 of the first + argument) is reversed. Patch the arguments here before building + the resolved CALL_EXPR. */ + if (desc->code == ALTIVEC_BUILTIN_VCMPGE_P + && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P) + { + tree t; + t = args[2], args[2] = args[1], args[1] = t; + t = arg_type[2], arg_type[2] = arg_type[1], arg_type[1] = t; + + args[0] = fold_build2 (BIT_XOR_EXPR, TREE_TYPE (args[0]), args[0], + build_int_cst (NULL_TREE, 2)); + } + + while (--n >= 0) + arglist = tree_cons (NULL_TREE, + fold_convert (arg_type[n], args[n]), + arglist); + + return fold_convert (ret_type, + build_function_call_expr (impl_fndecl, arglist)); +} + +/* Implementation of the resolve_overloaded_builtin target hook, to + support Altivec's overloaded builtins. */ + +tree +altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) +{ + unsigned int fcode = DECL_FUNCTION_CODE (fndecl); + tree fnargs = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); + tree types[3], args[3]; + const struct altivec_builtin_types *desc; + int n; + + if (fcode < ALTIVEC_BUILTIN_OVERLOADED_FIRST + || fcode > ALTIVEC_BUILTIN_OVERLOADED_LAST) + return NULL_TREE; + + for (n = 0; + !VOID_TYPE_P (TREE_VALUE (fnargs)) && arglist; + fnargs = TREE_CHAIN (fnargs), arglist = TREE_CHAIN (arglist), n++) + { + tree decl_type = TREE_VALUE (fnargs); + tree arg = TREE_VALUE (arglist); + tree type; + + if (arg == error_mark_node) + return error_mark_node; + + if (n >= 3) + abort (); + + arg = default_conversion (arg); + + /* The C++ front-end converts float * to const void * using + NOP_EXPR (NOP_EXPR (x)). */ + type = TREE_TYPE (arg); + if (POINTER_TYPE_P (type) + && TREE_CODE (arg) == NOP_EXPR + && lang_hooks.types_compatible_p (TREE_TYPE (arg), + const_ptr_type_node) + && lang_hooks.types_compatible_p (TREE_TYPE (TREE_OPERAND (arg, 0)), + ptr_type_node)) + { + arg = TREE_OPERAND (arg, 0); + type = TREE_TYPE (arg); + } + + /* Remove the const from the pointers to simplify the overload + matching further down. */ + if (POINTER_TYPE_P (decl_type) + && POINTER_TYPE_P (type) + && TYPE_QUALS (TREE_TYPE (type)) != 0) + { + if (TYPE_READONLY (TREE_TYPE (type)) + && !TYPE_READONLY (TREE_TYPE (decl_type))) + warning (0, "passing arg %d of %qE discards qualifiers from" + "pointer target type", n + 1, fndecl); + type = build_pointer_type (build_qualified_type (TREE_TYPE (type), + 0)); + arg = fold_convert (type, arg); + } + + args[n] = arg; + types[n] = type; + } + + /* If the number of arguments did not match the prototype, return NULL + and the generic code will issue the appropriate error message. */ + if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || arglist) + return NULL; + + if (n == 0) + abort (); + + if (fcode == ALTIVEC_BUILTIN_VEC_STEP) + { + if (TREE_CODE (types[0]) != VECTOR_TYPE) + goto bad; + + return build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (types[0])); + } + + for (desc = altivec_overloaded_builtins; + desc->code && desc->code != fcode; desc++) + continue; + + /* For arguments after the last, we have RS6000_BTI_NOT_OPAQUE in + the opX fields. */ + for (; desc->code == fcode; desc++) + if ((desc->op1 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[0], desc->op1)) + && (desc->op2 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[1], desc->op2)) + && (desc->op3 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[2], desc->op3))) + return altivec_build_resolved_builtin (args, n, desc); + + bad: + error ("invalid parameter combination for AltiVec intrinsic"); + return error_mark_node; +} + diff --git a/contrib/gcc/config/rs6000/rs6000-modes.def b/contrib/gcc/config/rs6000/rs6000-modes.def index 6f17f1a7acc..c0599b3960c 100644 --- a/contrib/gcc/config/rs6000/rs6000-modes.def +++ b/contrib/gcc/config/rs6000/rs6000-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* 128-bit floating point. ABI_V4 uses IEEE quad, AIX/Darwin adjust this in rs6000_override_options. */ @@ -38,3 +38,10 @@ PARTIAL_INT_MODE (SI); CC_MODE (CCUNS); CC_MODE (CCFP); CC_MODE (CCEQ); + +/* Vector modes. */ +VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */ +VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */ +VECTOR_MODE (INT, DI, 1); +VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */ +VECTOR_MODES (FLOAT, 16); /* V8HF V4SF V2DF */ diff --git a/contrib/gcc/config/rs6000/rs6000-protos.h b/contrib/gcc/config/rs6000/rs6000-protos.h index 3303ecd4eb1..0cb5a50b773 100644 --- a/contrib/gcc/config/rs6000/rs6000-protos.h +++ b/contrib/gcc/config/rs6000/rs6000-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. - Copyright (C) 2000, 2001, 2002, 2003, 2004 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #ifndef GCC_RS6000_PROTOS_H #define GCC_RS6000_PROTOS_H @@ -32,83 +32,42 @@ extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int, int); extern void rs6000_va_start (tree, rtx); #endif /* TREE_CODE */ -extern struct rtx_def *rs6000_got_register (rtx); -extern struct rtx_def *find_addr_reg (rtx); -extern int any_operand (rtx, enum machine_mode); -extern int short_cint_operand (rtx, enum machine_mode); -extern int u_short_cint_operand (rtx, enum machine_mode); -extern int non_short_cint_operand (rtx, enum machine_mode); -extern int exact_log2_cint_operand (rtx, enum machine_mode); -extern int gpc_reg_operand (rtx, enum machine_mode); -extern int cc_reg_operand (rtx, enum machine_mode); -extern int cc_reg_not_cr0_operand (rtx, enum machine_mode); -extern int reg_or_short_operand (rtx, enum machine_mode); -extern int reg_or_neg_short_operand (rtx, enum machine_mode); -extern int reg_or_aligned_short_operand (rtx, enum machine_mode); -extern int reg_or_u_short_operand (rtx, enum machine_mode); -extern int reg_or_cint_operand (rtx, enum machine_mode); -extern int reg_or_arith_cint_operand (rtx, enum machine_mode); -extern int reg_or_add_cint64_operand (rtx, enum machine_mode); -extern int reg_or_sub_cint64_operand (rtx, enum machine_mode); -extern int reg_or_logical_cint_operand (rtx, enum machine_mode); -extern int got_operand (rtx, enum machine_mode); -extern int word_offset_memref_operand (rtx, enum machine_mode); -extern int got_no_const_operand (rtx, enum machine_mode); +extern bool easy_altivec_constant (rtx, enum machine_mode); +extern bool macho_lo_sum_memory_operand (rtx, enum machine_mode); extern int num_insns_constant (rtx, enum machine_mode); -extern int easy_fp_constant (rtx, enum machine_mode); -extern int easy_vector_constant (rtx, enum machine_mode); -extern rtx gen_easy_vector_constant_add_self (rtx); -extern const char *output_vec_const_move (rtx *); -extern int zero_fp_constant (rtx, enum machine_mode); -extern int zero_constant (rtx, enum machine_mode); -extern int volatile_mem_operand (rtx, enum machine_mode); -extern int offsettable_mem_operand (rtx, enum machine_mode); -extern int mem_or_easy_const_operand (rtx, enum machine_mode); -extern int add_operand (rtx, enum machine_mode); -extern int non_add_cint_operand (rtx, enum machine_mode); -extern int non_logical_cint_operand (rtx, enum machine_mode); -extern int logical_operand (rtx, enum machine_mode); -extern int mask_operand (rtx, enum machine_mode); -extern int mask_operand_wrap (rtx, enum machine_mode); -extern int mask64_operand (rtx, enum machine_mode); -extern int mask64_2_operand (rtx, enum machine_mode); -extern void build_mask64_2_operands (rtx, rtx *); -extern int and64_operand (rtx, enum machine_mode); -extern int and64_2_operand (rtx, enum machine_mode); -extern int and_operand (rtx, enum machine_mode); -extern int count_register_operand (rtx, enum machine_mode); -extern int xer_operand (rtx, enum machine_mode); -extern int reg_or_mem_operand (rtx, enum machine_mode); -extern int lwa_operand (rtx, enum machine_mode); -extern int call_operand (rtx, enum machine_mode); -extern int current_file_function_operand (rtx, enum machine_mode); -extern int input_operand (rtx, enum machine_mode); +extern int num_insns_constant_wide (HOST_WIDE_INT); extern int small_data_operand (rtx, enum machine_mode); -extern int s8bit_cint_operand (rtx, enum machine_mode); +extern bool toc_relative_expr_p (rtx); +extern bool invalid_e500_subreg (rtx, enum machine_mode); +extern void validate_condition_mode (enum rtx_code, enum machine_mode); extern bool legitimate_constant_pool_address_p (rtx); +extern bool legitimate_indirect_address_p (rtx, int); + +extern rtx rs6000_got_register (rtx); +extern rtx find_addr_reg (rtx); +extern rtx gen_easy_altivec_constant (rtx); +extern const char *output_vec_const_move (rtx *); +extern void rs6000_expand_vector_init (rtx, rtx); +extern void rs6000_expand_vector_set (rtx, rtx, int); +extern void rs6000_expand_vector_extract (rtx, rtx, int); +extern void build_mask64_2_operands (rtx, rtx *); +extern int expand_block_clear (rtx[]); extern int expand_block_move (rtx[]); -extern int load_multiple_operation (rtx, enum machine_mode); extern const char * rs6000_output_load_multiple (rtx[]); -extern int store_multiple_operation (rtx, enum machine_mode); -extern int branch_comparison_operator (rtx, enum machine_mode); -extern int branch_positive_comparison_operator (rtx, enum machine_mode); -extern int scc_comparison_operator (rtx, enum machine_mode); -extern int trap_comparison_operator (rtx, enum machine_mode); -extern int boolean_operator (rtx, enum machine_mode); -extern int boolean_or_operator (rtx, enum machine_mode); -extern int min_max_operator (rtx, enum machine_mode); extern int includes_lshift_p (rtx, rtx); extern int includes_rshift_p (rtx, rtx); extern int includes_rldic_lshift_p (rtx, rtx); extern int includes_rldicr_lshift_p (rtx, rtx); +extern int insvdi_rshift_rlwimi_p (rtx, rtx, rtx); extern int registers_ok_for_quad_peep (rtx, rtx); -extern int addrs_ok_for_quad_peep (rtx, rtx); +extern int mems_ok_for_quad_peep (rtx, rtx); extern bool gpr_or_gpr_p (rtx, rtx); -extern enum reg_class secondary_reload_class (enum reg_class, - enum machine_mode, rtx); +extern enum reg_class rs6000_secondary_reload_class (enum reg_class, + enum machine_mode, rtx); extern int ccr_bit (rtx, int); extern int extract_MB (rtx); extern int extract_ME (rtx); +extern void rs6000_output_function_entry (FILE *, const char *); extern void print_operand (FILE *, rtx, int); extern void print_operand_address (FILE *, rtx); extern enum rtx_code rs6000_reverse_condition (enum machine_mode, @@ -116,52 +75,56 @@ extern enum rtx_code rs6000_reverse_condition (enum machine_mode, extern void rs6000_emit_sCOND (enum rtx_code, rtx); extern void rs6000_emit_cbranch (enum rtx_code, rtx); extern char * output_cbranch (rtx, const char *, int, rtx); -extern char * output_e500_flip_eq_bit (rtx, rtx); +extern char * output_e500_flip_gt_bit (rtx, rtx); extern rtx rs6000_emit_set_const (rtx, enum machine_mode, rtx, int); extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx); +extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx); extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx); +extern void rs6000_emit_sync (enum rtx_code, enum machine_mode, + rtx, rtx, rtx, rtx, bool); +extern void rs6000_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx); +extern void rs6000_split_compare_and_swap (rtx, rtx, rtx, rtx, rtx); +extern void rs6000_expand_compare_and_swapqhi (rtx, rtx, rtx, rtx); +extern void rs6000_split_compare_and_swapqhi (rtx, rtx, rtx, rtx, rtx, rtx); +extern void rs6000_split_lock_test_and_set (rtx, rtx, rtx, rtx); +extern void rs6000_emit_swdivsf (rtx, rtx, rtx); +extern void rs6000_emit_swdivdf (rtx, rtx, rtx); extern void output_toc (FILE *, rtx, int, enum machine_mode); extern void rs6000_initialize_trampoline (rtx, rtx, rtx); -extern struct rtx_def *rs6000_longcall_ref (rtx); +extern rtx rs6000_longcall_ref (rtx); extern void rs6000_fatal_bad_address (rtx); -extern int stmw_operation (rtx, enum machine_mode); -extern int mfcr_operation (rtx, enum machine_mode); -extern int mtcrf_operation (rtx, enum machine_mode); -extern int lmw_operation (rtx, enum machine_mode); -extern struct rtx_def *create_TOC_reference (rtx); +extern rtx create_TOC_reference (rtx); extern void rs6000_split_multireg_move (rtx, rtx); extern void rs6000_emit_move (rtx, rtx, enum machine_mode); extern rtx rs6000_legitimize_address (rtx, rtx, enum machine_mode); extern rtx rs6000_legitimize_reload_address (rtx, enum machine_mode, - int, int, int, int *); + int, int, int, int *); extern int rs6000_legitimate_address (enum machine_mode, rtx, int); +extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx, int); extern bool rs6000_mode_dependent_address (rtx); +extern bool rs6000_offsettable_memref_p (rtx); extern rtx rs6000_return_addr (int, rtx); extern void rs6000_output_symbol_ref (FILE*, rtx); extern HOST_WIDE_INT rs6000_initial_elimination_offset (int, int); -extern rtx rs6000_machopic_legitimize_pic_address (rtx orig, - enum machine_mode mode, rtx reg); - +extern rtx rs6000_machopic_legitimize_pic_address (rtx, enum machine_mode, + rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern unsigned int rs6000_special_round_type_align (tree, int, int); +extern unsigned int rs6000_special_round_type_align (tree, unsigned int, + unsigned int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, - tree, int); + tree, int, int); extern int function_arg_boundary (enum machine_mode, tree); -extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern int function_arg_pass_by_reference (CUMULATIVE_ARGS *, - enum machine_mode, - tree, int); +extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); +extern tree altivec_resolve_overloaded_builtin (tree, tree); extern rtx rs6000_function_value (tree, tree); extern rtx rs6000_libcall_value (enum machine_mode); -extern struct rtx_def *rs6000_va_arg (tree, tree); +extern rtx rs6000_va_arg (tree, tree); extern int function_ok_for_sibcall (tree); extern void rs6000_elf_declare_function_name (FILE *, const char *, tree); +extern bool rs6000_elf_in_small_data_p (tree); #ifdef ARGS_SIZE_RTX /* expr.h defines ARGS_SIZE_RTX and `enum direction' */ extern enum direction function_arg_padding (enum machine_mode, tree); @@ -179,13 +142,6 @@ extern void rs6000_gen_section_name (char **, const char *, const char *); extern void output_function_profiler (FILE *, int); extern void output_profile_hook (int); extern int rs6000_trampoline_size (void); -extern void toc_section (void); -extern void sdata_section (void); -extern void sdata2_section (void); -extern void sbss_section (void); -extern void private_data_section (void); -extern void read_only_data_section (void); -extern void read_only_private_data_section (void); extern int get_TOC_alias_set (void); extern void rs6000_emit_prologue (void); extern void rs6000_emit_load_toc_table (int); @@ -194,13 +150,12 @@ extern unsigned int rs6000_dbx_register_number (unsigned int); extern void rs6000_emit_epilogue (int); extern void rs6000_emit_eh_reg_restore (rtx, rtx); extern const char * output_isel (rtx *); -extern int vrsave_operation (rtx, enum machine_mode); extern int rs6000_register_move_cost (enum machine_mode, - enum reg_class, enum reg_class); + enum reg_class, enum reg_class); extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int); extern bool rs6000_tls_referenced_p (rtx); -extern int rs6000_tls_symbol_ref (rtx, enum machine_mode); -extern void rs6000_output_dwarf_dtprel (FILE*, int, rtx); +extern int rs6000_hard_regno_nregs (int, enum machine_mode); +extern void rs6000_conditional_register_usage (void); /* Declare functions in rs6000-c.c */ @@ -211,4 +166,5 @@ extern void rs6000_cpu_cpp_builtins (struct cpp_reader *); char *output_call (rtx, rtx *, int, int); #endif +extern bool rs6000_hard_regno_mode_ok_p[][FIRST_PSEUDO_REGISTER]; #endif /* rs6000-protos.h */ diff --git a/contrib/gcc/config/rs6000/rs6000.c b/contrib/gcc/config/rs6000/rs6000.c index ea35843341f..5e9d0fef02e 100644 --- a/contrib/gcc/config/rs6000/rs6000.c +++ b/contrib/gcc/config/rs6000/rs6000.c @@ -1,6 +1,7 @@ /* Subroutines used for code generation on IBM RS/6000. - Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -17,8 +18,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -52,18 +53,21 @@ #include "reload.h" #include "cfglayout.h" #include "sched-int.h" +#include "tree-gimple.h" +#include "intl.h" +#include "params.h" +#include "tm-constrs.h" #if TARGET_XCOFF #include "xcoffout.h" /* get declarations of xcoff_*_section_name */ #endif +#if TARGET_MACHO +#include "gstab.h" /* for N_SLINE */ +#endif #ifndef TARGET_NO_PROTOTYPE #define TARGET_NO_PROTOTYPE 0 #endif -#define EASY_VECTOR_15(n) ((n) >= -16 && (n) <= 15) -#define EASY_VECTOR_15_ADD_SELF(n) ((n) >= 0x10 && (n) <= 0x1e \ - && !((n) & 1)) - #define min(A,B) ((A) < (B) ? (A) : (B)) #define max(A,B) ((A) > (B) ? (A) : (B)) @@ -75,9 +79,10 @@ typedef struct rs6000_stack { int lr_save_p; /* true if the link reg needs to be saved */ int cr_save_p; /* true if the CR reg needs to be saved */ unsigned int vrsave_mask; /* mask of vec registers to save */ - int toc_save_p; /* true if the TOC needs to be saved */ int push_p; /* true if we need to allocate stack space */ int calls_p; /* true if the function makes any calls */ + int world_save_p; /* true if we're saving *everything*: + r13-r31, cr, f14-f31, vrsave, v20-v31 */ enum rs6000_abi abi; /* which ABI to use */ int gp_save_offset; /* offset to save GP regs from initial SP */ int fp_save_offset; /* offset to save FP regs from initial SP */ @@ -86,11 +91,9 @@ typedef struct rs6000_stack { int cr_save_offset; /* offset to save CR from initial SP */ int vrsave_save_offset; /* offset to save VRSAVE from initial SP */ int spe_gp_save_offset; /* offset to save spe 64-bit gprs */ - int toc_save_offset; /* offset to save the TOC pointer */ int varargs_save_offset; /* offset to save the varargs registers */ int ehrd_offset; /* offset to EH return data */ int reg_size; /* register size (4 or 8) */ - int varargs_size; /* size to hold V.4 args passed in regs */ HOST_WIDE_INT vars_size; /* variable save area size */ int parm_size; /* outgoing parameter size */ int save_size; /* save area size */ @@ -99,17 +102,32 @@ typedef struct rs6000_stack { int fp_size; /* size of saved FP registers */ int altivec_size; /* size of saved AltiVec registers */ int cr_size; /* size to hold CR if not in save_size */ - int lr_size; /* size to hold LR if not in save_size */ int vrsave_size; /* size to hold VRSAVE if not in save_size */ int altivec_padding_size; /* size of altivec alignment padding if not in save_size */ int spe_gp_size; /* size of 64-bit GPR save size for SPE */ int spe_padding_size; - int toc_size; /* size to hold TOC if not in save_size */ HOST_WIDE_INT total_size; /* total bytes allocated for stack */ int spe_64bit_regs_used; } rs6000_stack_t; +/* A C structure for machine-specific, per-function data. + This is added to the cfun structure. */ +typedef struct machine_function GTY(()) +{ + /* Flags if __builtin_return_address (n) with n >= 1 was used. */ + int ra_needs_full_frame; + /* Some local-dynamic symbol. */ + const char *some_ld_name; + /* Whether the instruction chain has been scanned already. */ + int insn_chain_scanned_p; + /* Flags if __builtin_return_address (0) was used. */ + int ra_need_lr; + /* Offset from virtual_stack_vars_rtx to the start of the ABI_V4 + varargs save area. */ + HOST_WIDE_INT varargs_save_offset; +} machine_function; + /* Target cpu type */ enum processor_type rs6000_cpu; @@ -127,11 +145,6 @@ static GTY(()) bool rs6000_always_hint; /* Schedule instructions for group formation. */ static GTY(()) bool rs6000_sched_groups; -/* Support adjust_priority scheduler hook - and -mprioritize-restricted-insns= option. */ -const char *rs6000_sched_restricted_insns_priority_str; -int rs6000_sched_restricted_insns_priority; - /* Support for -msched-costly-dep option. */ const char *rs6000_sched_costly_dep_str; enum rs6000_dependence_cost rs6000_sched_costly_dep; @@ -140,39 +153,26 @@ enum rs6000_dependence_cost rs6000_sched_costly_dep; const char *rs6000_sched_insert_nops_str; enum rs6000_nop_insertion rs6000_sched_insert_nops; -/* Size of long double */ -const char *rs6000_long_double_size_string; +/* Support targetm.vectorize.builtin_mask_for_load. */ +static GTY(()) tree altivec_builtin_mask_for_load; + +/* Size of long double. */ int rs6000_long_double_type_size; -/* Whether -mabi=altivec has appeared */ +/* IEEE quad extended precision long double. */ +int rs6000_ieeequad; + +/* Whether -mabi=altivec has appeared. */ int rs6000_altivec_abi; -/* Whether VRSAVE instructions should be generated. */ -int rs6000_altivec_vrsave; - -/* String from -mvrsave= option. */ -const char *rs6000_altivec_vrsave_string; - /* Nonzero if we want SPE ABI extensions. */ int rs6000_spe_abi; -/* Whether isel instructions should be generated. */ -int rs6000_isel; - -/* Whether SPE simd instructions should be generated. */ -int rs6000_spe; - /* Nonzero if floating point operations are done in the GPRs. */ int rs6000_float_gprs = 0; -/* String from -mfloat-gprs=. */ -const char *rs6000_float_gprs_string; - -/* String from -misel=. */ -const char *rs6000_isel_string; - -/* String from -mspe=. */ -const char *rs6000_spe_string; +/* Nonzero if we want Darwin's struct-by-value-in-regs ABI. */ +int rs6000_darwin64_abi; /* Set to nonzero once AIX common-mode calls have been defined. */ static GTY(()) int common_mode_defined; @@ -207,32 +207,21 @@ const char *rs6000_tls_size_string; /* ABI enumeration available for subtarget to use. */ enum rs6000_abi rs6000_current_abi; -/* ABI string from -mabi= option. */ -const char *rs6000_abi_string; +/* Whether to use variant of AIX ABI for PowerPC64 Linux. */ +int dot_symbols; /* Debug flags */ const char *rs6000_debug_name; int rs6000_debug_stack; /* debug stack applications */ int rs6000_debug_arg; /* debug argument handling */ -/* Opaque types. */ -static GTY(()) tree opaque_V2SI_type_node; -static GTY(()) tree opaque_V2SF_type_node; -static GTY(()) tree opaque_p_V2SI_type_node; +/* Value is TRUE if register/mode pair is acceptable. */ +bool rs6000_hard_regno_mode_ok_p[NUM_MACHINE_MODES][FIRST_PSEUDO_REGISTER]; -/* AltiVec requires a few more basic types in addition to the vector - types already defined in tree.c. */ -static GTY(()) tree bool_char_type_node; /* __bool char */ -static GTY(()) tree bool_short_type_node; /* __bool short */ -static GTY(()) tree bool_int_type_node; /* __bool int */ -static GTY(()) tree pixel_type_node; /* __pixel */ -static GTY(()) tree bool_V16QI_type_node; /* __vector __bool char */ -static GTY(()) tree bool_V8HI_type_node; /* __vector __bool short */ -static GTY(()) tree bool_V4SI_type_node; /* __vector __bool int */ -static GTY(()) tree pixel_V8HI_type_node; /* __vector __pixel */ +/* Built in types. */ -int rs6000_warn_altivec_long = 1; /* On by default. */ -const char *rs6000_warn_altivec_long_switch; +tree rs6000_builtin_types[RS6000_BTI_MAX]; +tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT]; const char *rs6000_traceback_name; static enum { @@ -246,22 +235,28 @@ static enum { int toc_initialized; char toc_label_name[10]; -/* Alias set for saves and restores from the rs6000 stack. */ -static GTY(()) int rs6000_sr_alias_set; - -/* Call distance, overridden by -mlongcall and #pragma longcall(1). - The only place that looks at this is rs6000_set_default_type_attributes; - everywhere else should rely on the presence or absence of a longcall - attribute on the function declaration. Exception: init_cumulative_args - looks at it too, for libcalls. */ -int rs6000_default_long_calls; -const char *rs6000_longcall_switch; +static GTY(()) section *read_only_data_section; +static GTY(()) section *private_data_section; +static GTY(()) section *read_only_private_data_section; +static GTY(()) section *sdata2_section; +static GTY(()) section *toc_section; /* Control alignment for fields within structures. */ /* String from -malign-XXXXX. */ -const char *rs6000_alignment_string; int rs6000_alignment_flags; +/* True for any options that were explicitly set. */ +struct { + bool aix_struct_ret; /* True if -maix-struct-ret was used. */ + bool alignment; /* True if -malign- was used. */ + bool abi; /* True if -mabi=spe/nospe was used. */ + bool spe; /* True if -mspe= was used. */ + bool float_gprs; /* True if -mfloat-gprs= was used. */ + bool isel; /* True if -misel was used. */ + bool long_double; /* True if -mlong-double- was used. */ + bool ieee; /* True if -mabi=ieee/ibmlongdouble used. */ +} rs6000_explicit_options; + struct builtin_description { /* mask is not const because we're going to alter it below. This @@ -272,10 +267,314 @@ struct builtin_description const char *const name; const enum rs6000_builtins code; }; + +/* Target cpu costs. */ +struct processor_costs { + const int mulsi; /* cost of SImode multiplication. */ + const int mulsi_const; /* cost of SImode multiplication by constant. */ + const int mulsi_const9; /* cost of SImode mult by short constant. */ + const int muldi; /* cost of DImode multiplication. */ + const int divsi; /* cost of SImode division. */ + const int divdi; /* cost of DImode division. */ + const int fp; /* cost of simple SFmode and DFmode insns. */ + const int dmul; /* cost of DFmode multiplication (and fmadd). */ + const int sdiv; /* cost of SFmode division (fdivs). */ + const int ddiv; /* cost of DFmode division (fdiv). */ +}; + +const struct processor_costs *rs6000_cost; + +/* Processor costs (relative to an add) */ + +/* Instruction size costs on 32bit processors. */ +static const +struct processor_costs size32_cost = { + COSTS_N_INSNS (1), /* mulsi */ + COSTS_N_INSNS (1), /* mulsi_const */ + COSTS_N_INSNS (1), /* mulsi_const9 */ + COSTS_N_INSNS (1), /* muldi */ + COSTS_N_INSNS (1), /* divsi */ + COSTS_N_INSNS (1), /* divdi */ + COSTS_N_INSNS (1), /* fp */ + COSTS_N_INSNS (1), /* dmul */ + COSTS_N_INSNS (1), /* sdiv */ + COSTS_N_INSNS (1), /* ddiv */ +}; + +/* Instruction size costs on 64bit processors. */ +static const +struct processor_costs size64_cost = { + COSTS_N_INSNS (1), /* mulsi */ + COSTS_N_INSNS (1), /* mulsi_const */ + COSTS_N_INSNS (1), /* mulsi_const9 */ + COSTS_N_INSNS (1), /* muldi */ + COSTS_N_INSNS (1), /* divsi */ + COSTS_N_INSNS (1), /* divdi */ + COSTS_N_INSNS (1), /* fp */ + COSTS_N_INSNS (1), /* dmul */ + COSTS_N_INSNS (1), /* sdiv */ + COSTS_N_INSNS (1), /* ddiv */ +}; + +/* Instruction costs on RIOS1 processors. */ +static const +struct processor_costs rios1_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (3), /* mulsi_const9 */ + COSTS_N_INSNS (5), /* muldi */ + COSTS_N_INSNS (19), /* divsi */ + COSTS_N_INSNS (19), /* divdi */ + COSTS_N_INSNS (2), /* fp */ + COSTS_N_INSNS (2), /* dmul */ + COSTS_N_INSNS (19), /* sdiv */ + COSTS_N_INSNS (19), /* ddiv */ +}; + +/* Instruction costs on RIOS2 processors. */ +static const +struct processor_costs rios2_cost = { + COSTS_N_INSNS (2), /* mulsi */ + COSTS_N_INSNS (2), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (2), /* muldi */ + COSTS_N_INSNS (13), /* divsi */ + COSTS_N_INSNS (13), /* divdi */ + COSTS_N_INSNS (2), /* fp */ + COSTS_N_INSNS (2), /* dmul */ + COSTS_N_INSNS (17), /* sdiv */ + COSTS_N_INSNS (17), /* ddiv */ +}; + +/* Instruction costs on RS64A processors. */ +static const +struct processor_costs rs64a_cost = { + COSTS_N_INSNS (20), /* mulsi */ + COSTS_N_INSNS (12), /* mulsi_const */ + COSTS_N_INSNS (8), /* mulsi_const9 */ + COSTS_N_INSNS (34), /* muldi */ + COSTS_N_INSNS (65), /* divsi */ + COSTS_N_INSNS (67), /* divdi */ + COSTS_N_INSNS (4), /* fp */ + COSTS_N_INSNS (4), /* dmul */ + COSTS_N_INSNS (31), /* sdiv */ + COSTS_N_INSNS (31), /* ddiv */ +}; + +/* Instruction costs on MPCCORE processors. */ +static const +struct processor_costs mpccore_cost = { + COSTS_N_INSNS (2), /* mulsi */ + COSTS_N_INSNS (2), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (2), /* muldi */ + COSTS_N_INSNS (6), /* divsi */ + COSTS_N_INSNS (6), /* divdi */ + COSTS_N_INSNS (4), /* fp */ + COSTS_N_INSNS (5), /* dmul */ + COSTS_N_INSNS (10), /* sdiv */ + COSTS_N_INSNS (17), /* ddiv */ +}; + +/* Instruction costs on PPC403 processors. */ +static const +struct processor_costs ppc403_cost = { + COSTS_N_INSNS (4), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (4), /* mulsi_const9 */ + COSTS_N_INSNS (4), /* muldi */ + COSTS_N_INSNS (33), /* divsi */ + COSTS_N_INSNS (33), /* divdi */ + COSTS_N_INSNS (11), /* fp */ + COSTS_N_INSNS (11), /* dmul */ + COSTS_N_INSNS (11), /* sdiv */ + COSTS_N_INSNS (11), /* ddiv */ +}; + +/* Instruction costs on PPC405 processors. */ +static const +struct processor_costs ppc405_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (3), /* mulsi_const9 */ + COSTS_N_INSNS (5), /* muldi */ + COSTS_N_INSNS (35), /* divsi */ + COSTS_N_INSNS (35), /* divdi */ + COSTS_N_INSNS (11), /* fp */ + COSTS_N_INSNS (11), /* dmul */ + COSTS_N_INSNS (11), /* sdiv */ + COSTS_N_INSNS (11), /* ddiv */ +}; + +/* Instruction costs on PPC440 processors. */ +static const +struct processor_costs ppc440_cost = { + COSTS_N_INSNS (3), /* mulsi */ + COSTS_N_INSNS (2), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (3), /* muldi */ + COSTS_N_INSNS (34), /* divsi */ + COSTS_N_INSNS (34), /* divdi */ + COSTS_N_INSNS (5), /* fp */ + COSTS_N_INSNS (5), /* dmul */ + COSTS_N_INSNS (19), /* sdiv */ + COSTS_N_INSNS (33), /* ddiv */ +}; + +/* Instruction costs on PPC601 processors. */ +static const +struct processor_costs ppc601_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (5), /* mulsi_const */ + COSTS_N_INSNS (5), /* mulsi_const9 */ + COSTS_N_INSNS (5), /* muldi */ + COSTS_N_INSNS (36), /* divsi */ + COSTS_N_INSNS (36), /* divdi */ + COSTS_N_INSNS (4), /* fp */ + COSTS_N_INSNS (5), /* dmul */ + COSTS_N_INSNS (17), /* sdiv */ + COSTS_N_INSNS (31), /* ddiv */ +}; + +/* Instruction costs on PPC603 processors. */ +static const +struct processor_costs ppc603_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (3), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (5), /* muldi */ + COSTS_N_INSNS (37), /* divsi */ + COSTS_N_INSNS (37), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (4), /* dmul */ + COSTS_N_INSNS (18), /* sdiv */ + COSTS_N_INSNS (33), /* ddiv */ +}; + +/* Instruction costs on PPC604 processors. */ +static const +struct processor_costs ppc604_cost = { + COSTS_N_INSNS (4), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (4), /* mulsi_const9 */ + COSTS_N_INSNS (4), /* muldi */ + COSTS_N_INSNS (20), /* divsi */ + COSTS_N_INSNS (20), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (18), /* sdiv */ + COSTS_N_INSNS (32), /* ddiv */ +}; + +/* Instruction costs on PPC604e processors. */ +static const +struct processor_costs ppc604e_cost = { + COSTS_N_INSNS (2), /* mulsi */ + COSTS_N_INSNS (2), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (2), /* muldi */ + COSTS_N_INSNS (20), /* divsi */ + COSTS_N_INSNS (20), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (18), /* sdiv */ + COSTS_N_INSNS (32), /* ddiv */ +}; + +/* Instruction costs on PPC620 processors. */ +static const +struct processor_costs ppc620_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (3), /* mulsi_const9 */ + COSTS_N_INSNS (7), /* muldi */ + COSTS_N_INSNS (21), /* divsi */ + COSTS_N_INSNS (37), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (18), /* sdiv */ + COSTS_N_INSNS (32), /* ddiv */ +}; + +/* Instruction costs on PPC630 processors. */ +static const +struct processor_costs ppc630_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (3), /* mulsi_const9 */ + COSTS_N_INSNS (7), /* muldi */ + COSTS_N_INSNS (21), /* divsi */ + COSTS_N_INSNS (37), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (17), /* sdiv */ + COSTS_N_INSNS (21), /* ddiv */ +}; + +/* Instruction costs on PPC750 and PPC7400 processors. */ +static const +struct processor_costs ppc750_cost = { + COSTS_N_INSNS (5), /* mulsi */ + COSTS_N_INSNS (3), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (5), /* muldi */ + COSTS_N_INSNS (17), /* divsi */ + COSTS_N_INSNS (17), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (17), /* sdiv */ + COSTS_N_INSNS (31), /* ddiv */ +}; + +/* Instruction costs on PPC7450 processors. */ +static const +struct processor_costs ppc7450_cost = { + COSTS_N_INSNS (4), /* mulsi */ + COSTS_N_INSNS (3), /* mulsi_const */ + COSTS_N_INSNS (3), /* mulsi_const9 */ + COSTS_N_INSNS (4), /* muldi */ + COSTS_N_INSNS (23), /* divsi */ + COSTS_N_INSNS (23), /* divdi */ + COSTS_N_INSNS (5), /* fp */ + COSTS_N_INSNS (5), /* dmul */ + COSTS_N_INSNS (21), /* sdiv */ + COSTS_N_INSNS (35), /* ddiv */ +}; + +/* Instruction costs on PPC8540 processors. */ +static const +struct processor_costs ppc8540_cost = { + COSTS_N_INSNS (4), /* mulsi */ + COSTS_N_INSNS (4), /* mulsi_const */ + COSTS_N_INSNS (4), /* mulsi_const9 */ + COSTS_N_INSNS (4), /* muldi */ + COSTS_N_INSNS (19), /* divsi */ + COSTS_N_INSNS (19), /* divdi */ + COSTS_N_INSNS (4), /* fp */ + COSTS_N_INSNS (4), /* dmul */ + COSTS_N_INSNS (29), /* sdiv */ + COSTS_N_INSNS (29), /* ddiv */ +}; + +/* Instruction costs on POWER4 and POWER5 processors. */ +static const +struct processor_costs power4_cost = { + COSTS_N_INSNS (3), /* mulsi */ + COSTS_N_INSNS (2), /* mulsi_const */ + COSTS_N_INSNS (2), /* mulsi_const9 */ + COSTS_N_INSNS (4), /* muldi */ + COSTS_N_INSNS (18), /* divsi */ + COSTS_N_INSNS (34), /* divdi */ + COSTS_N_INSNS (3), /* fp */ + COSTS_N_INSNS (3), /* dmul */ + COSTS_N_INSNS (17), /* sdiv */ + COSTS_N_INSNS (17), /* ddiv */ +}; + + static bool rs6000_function_ok_for_sibcall (tree, tree); -static int num_insns_constant_wide (HOST_WIDE_INT); -static void validate_condition_mode (enum rtx_code, enum machine_mode); +static const char *rs6000_invalid_within_doloop (rtx); static rtx rs6000_generate_compare (enum rtx_code); static void rs6000_maybe_dead (rtx); static void rs6000_emit_stack_tie (void); @@ -291,21 +590,21 @@ static unsigned toc_hash_function (const void *); static int toc_hash_eq (const void *, const void *); static int constant_pool_expr_1 (rtx, int *, int *); static bool constant_pool_expr_p (rtx); -static bool toc_relative_expr_p (rtx); static bool legitimate_small_data_p (enum machine_mode, rtx); -static bool legitimate_offset_address_p (enum machine_mode, rtx, int); static bool legitimate_indexed_address_p (rtx, int); -static bool legitimate_indirect_address_p (rtx, int); -static bool macho_lo_sum_memory_operand (rtx x, enum machine_mode mode); static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int); static struct machine_function * rs6000_init_machine_status (void); static bool rs6000_assemble_integer (rtx, unsigned int, int); +static bool no_global_regs_above (int); #ifdef HAVE_GAS_HIDDEN static void rs6000_assemble_visibility (tree, int); #endif static int rs6000_ra_ever_killed (void); static tree rs6000_handle_longcall_attribute (tree *, tree, tree, int, bool *); static tree rs6000_handle_altivec_attribute (tree *, tree, tree, int, bool *); +static bool rs6000_ms_bitfield_layout_p (tree); +static tree rs6000_handle_struct_attribute (tree *, tree, tree, int, bool *); +static void rs6000_eliminate_indexed_memrefs (rtx operands[2]); static const char *rs6000_mangle_fundamental_type (tree); extern const struct attribute_spec rs6000_attribute_table[]; static void rs6000_set_default_type_attributes (tree); @@ -317,34 +616,33 @@ static rtx rs6000_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT); static bool rs6000_return_in_memory (tree, tree); static void rs6000_file_start (void); #if TARGET_ELF -static unsigned int rs6000_elf_section_type_flags (tree, const char *, int); +static int rs6000_elf_reloc_rw_mask (void); static void rs6000_elf_asm_out_constructor (rtx, int); static void rs6000_elf_asm_out_destructor (rtx, int); static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED; -static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT); -static void rs6000_elf_unique_section (tree, int); -static void rs6000_elf_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT); +static void rs6000_elf_asm_init_sections (void); +static section *rs6000_elf_select_rtx_section (enum machine_mode, rtx, + unsigned HOST_WIDE_INT); static void rs6000_elf_encode_section_info (tree, rtx, int) ATTRIBUTE_UNUSED; -static bool rs6000_elf_in_small_data_p (tree); #endif +static bool rs6000_use_blocks_for_constant_p (enum machine_mode, rtx); #if TARGET_XCOFF +static void rs6000_xcoff_asm_output_anchor (rtx); static void rs6000_xcoff_asm_globalize_label (FILE *, const char *); -static void rs6000_xcoff_asm_named_section (const char *, unsigned int); -static void rs6000_xcoff_select_section (tree, int, unsigned HOST_WIDE_INT); -static void rs6000_xcoff_unique_section (tree, int); -static void rs6000_xcoff_select_rtx_section (enum machine_mode, rtx, +static void rs6000_xcoff_asm_init_sections (void); +static int rs6000_xcoff_reloc_rw_mask (void); +static void rs6000_xcoff_asm_named_section (const char *, unsigned int, tree); +static section *rs6000_xcoff_select_section (tree, int, unsigned HOST_WIDE_INT); +static void rs6000_xcoff_unique_section (tree, int); +static section *rs6000_xcoff_select_rtx_section + (enum machine_mode, rtx, unsigned HOST_WIDE_INT); static const char * rs6000_xcoff_strip_name_encoding (const char *); static unsigned int rs6000_xcoff_section_type_flags (tree, const char *, int); static void rs6000_xcoff_file_start (void); static void rs6000_xcoff_file_end (void); #endif -#if TARGET_MACHO -static bool rs6000_binds_local_p (tree); -#endif -static int rs6000_use_dfa_pipeline_interface (void); static int rs6000_variable_issue (FILE *, int, rtx, int); static bool rs6000_rtx_costs (rtx, int, int, int *); static int rs6000_adjust_cost (rtx, rtx, rtx, int); @@ -363,7 +661,9 @@ static int redefine_groups (FILE *, int, rtx, rtx); static int pad_groups (FILE *, int, rtx, rtx); static void rs6000_sched_finish (FILE *, int); static int rs6000_use_sched_lookahead (void); +static tree rs6000_builtin_mask_for_load (void); +static void def_builtin (int, const char *, tree, int); static void rs6000_init_builtins (void); static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx); static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx); @@ -376,6 +676,7 @@ static void rs6000_init_libfuncs (void); static void enable_mask_for_builtins (struct builtin_description *, int, enum rs6000_builtins, enum rs6000_builtins); +static tree build_opaque_vector_type (tree, int); static void spe_init_builtins (void); static rtx spe_expand_builtin (tree, rtx, bool *); static rtx spe_expand_stv_builtin (enum insn_code, tree); @@ -390,45 +691,78 @@ static rtx altivec_expand_ld_builtin (tree, rtx, bool *); static rtx altivec_expand_st_builtin (tree, rtx, bool *); static rtx altivec_expand_dst_builtin (tree, rtx, bool *); static rtx altivec_expand_abs_builtin (enum insn_code, tree, rtx); -static rtx altivec_expand_predicate_builtin (enum insn_code, - const char *, tree, rtx); +static rtx altivec_expand_predicate_builtin (enum insn_code, + const char *, tree, rtx); static rtx altivec_expand_lv_builtin (enum insn_code, tree, rtx); static rtx altivec_expand_stv_builtin (enum insn_code, tree); -static void rs6000_parse_abi_options (void); -static void rs6000_parse_alignment_option (void); +static rtx altivec_expand_vec_init_builtin (tree, tree, rtx); +static rtx altivec_expand_vec_set_builtin (tree); +static rtx altivec_expand_vec_ext_builtin (tree, rtx); +static int get_element_number (tree, tree); +static bool rs6000_handle_option (size_t, const char *, int); static void rs6000_parse_tls_size_option (void); static void rs6000_parse_yes_no_option (const char *, const char *, int *); static int first_altivec_reg_to_save (void); static unsigned int compute_vrsave_mask (void); +static void compute_save_world_info (rs6000_stack_t *info_ptr); static void is_altivec_return_reg (rtx, void *); static rtx generate_set_vrsave (rtx, rs6000_stack_t *, int); int easy_vector_constant (rtx, enum machine_mode); -static int easy_vector_same (rtx, enum machine_mode); -static int easy_vector_splat_const (int, enum machine_mode); -static bool is_ev64_opaque_type (tree); +static bool rs6000_is_opaque_type (tree); static rtx rs6000_dwarf_register_span (rtx); static rtx rs6000_legitimize_tls_address (rtx, enum tls_model); +static void rs6000_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; static rtx rs6000_tls_get_addr (void); static rtx rs6000_got_sym (void); -static inline int rs6000_tls_symbol_ref_1 (rtx *, void *); +static int rs6000_tls_symbol_ref_1 (rtx *, void *); static const char *rs6000_get_some_local_dynamic_name (void); static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *); static rtx rs6000_complex_function_value (enum machine_mode); static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree); +static void rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *, + HOST_WIDE_INT); +static void rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *, + tree, HOST_WIDE_INT); +static void rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *, + HOST_WIDE_INT, + rtx[], int *); +static void rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *, + tree, HOST_WIDE_INT, + rtx[], int *); +static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, tree, int, bool); static rtx rs6000_mixed_function_arg (enum machine_mode, tree, int); static void rs6000_move_block_from_reg (int regno, rtx x, int nregs); static void setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int); +static bool rs6000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); +static int rs6000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); +static const char *invalid_arg_for_unprototyped_fn (tree, tree, tree); #if TARGET_MACHO static void macho_branch_islands (void); -static void add_compiler_branch_island (tree, tree, int); static int no_previous_def (tree function_name); static tree get_prev_label (tree function_name); +static void rs6000_darwin_file_start (void); #endif static tree rs6000_build_builtin_va_list (void); +static tree rs6000_gimplify_va_arg (tree, tree, tree *, tree *); +static bool rs6000_must_pass_in_stack (enum machine_mode, tree); +static bool rs6000_scalar_mode_supported_p (enum machine_mode); +static bool rs6000_vector_mode_supported_p (enum machine_mode); +static int get_vec_cmp_insn (enum rtx_code, enum machine_mode, + enum machine_mode); +static rtx rs6000_emit_vector_compare (enum rtx_code, rtx, rtx, + enum machine_mode); +static int get_vsel_insn (enum machine_mode); +static void rs6000_emit_vector_select (rtx, rtx, rtx, rtx); +static tree rs6000_stack_protect_fail (void); + +const int INSN_NOT_AVAILABLE = -1; +static enum machine_mode rs6000_eh_return_filter_mode (void); /* Hash table stuff for keeping track of TOC entries. */ @@ -464,7 +798,9 @@ char rs6000_reg_names[][8] = "24", "25", "26", "27", "28", "29", "30", "31", "vrsave", "vscr", /* SPE registers. */ - "spe_acc", "spefscr" + "spe_acc", "spefscr", + /* Soft frame pointer. */ + "sfp" }; #ifdef TARGET_REGNAMES @@ -488,7 +824,9 @@ static const char alt_reg_names[][8] = "%v24", "%v25", "%v26", "%v27", "%v28", "%v29", "%v30", "%v31", "vrsave", "vscr", /* SPE registers. */ - "spe_acc", "spefscr" + "spe_acc", "spefscr", + /* Soft frame pointer. */ + "sfp" }; #endif @@ -501,10 +839,6 @@ static const char alt_reg_names[][8] = /* The VRSAVE bitmask puts bit %v0 as the most significant bit. */ #define ALTIVEC_REG_BIT(REGNO) (0x80000000 >> ((REGNO) - FIRST_ALTIVEC_REGNO)) - -/* Return 1 for a symbol ref for a thread-local storage symbol. */ -#define RS6000_SYMBOL_REF_TLS_P(RTX) \ - (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0) /* Initialize the GCC target structure. */ #undef TARGET_ATTRIBUTE_TABLE @@ -533,6 +867,10 @@ static const char alt_reg_names[][8] = #define TARGET_ASM_UNALIGNED_HI_OP "\t.short\t" #undef TARGET_ASM_UNALIGNED_SI_OP #define TARGET_ASM_UNALIGNED_SI_OP "\t.long\t" +#undef TARGET_ASM_UNALIGNED_DI_OP +#define TARGET_ASM_UNALIGNED_DI_OP "\t.quad\t" +#undef TARGET_ASM_ALIGNED_DI_OP +#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t" #endif #endif @@ -557,8 +895,6 @@ static const char alt_reg_names[][8] = #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE rs6000_use_dfa_pipeline_interface #undef TARGET_SCHED_VARIABLE_ISSUE #define TARGET_SCHED_VARIABLE_ISSUE rs6000_variable_issue @@ -568,7 +904,7 @@ static const char alt_reg_names[][8] = #define TARGET_SCHED_ADJUST_COST rs6000_adjust_cost #undef TARGET_SCHED_ADJUST_PRIORITY #define TARGET_SCHED_ADJUST_PRIORITY rs6000_adjust_priority -#undef TARGET_SCHED_IS_COSTLY_DEPENDENCE +#undef TARGET_SCHED_IS_COSTLY_DEPENDENCE #define TARGET_SCHED_IS_COSTLY_DEPENDENCE rs6000_is_costly_dependence #undef TARGET_SCHED_FINISH #define TARGET_SCHED_FINISH rs6000_sched_finish @@ -576,6 +912,9 @@ static const char alt_reg_names[][8] = #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD rs6000_use_sched_lookahead +#undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD +#define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD rs6000_builtin_mask_for_load + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS rs6000_init_builtins @@ -590,9 +929,12 @@ static const char alt_reg_names[][8] = #if TARGET_MACHO #undef TARGET_BINDS_LOCAL_P -#define TARGET_BINDS_LOCAL_P rs6000_binds_local_p +#define TARGET_BINDS_LOCAL_P darwin_binds_local_p #endif +#undef TARGET_MS_BITFIELD_LAYOUT_P +#define TARGET_MS_BITFIELD_LAYOUT_P rs6000_ms_bitfield_layout_p + #undef TARGET_ASM_OUTPUT_MI_THUNK #define TARGET_ASM_OUTPUT_MI_THUNK rs6000_output_mi_thunk @@ -602,13 +944,16 @@ static const char alt_reg_names[][8] = #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL rs6000_function_ok_for_sibcall +#undef TARGET_INVALID_WITHIN_DOLOOP +#define TARGET_INVALID_WITHIN_DOLOOP rs6000_invalid_within_doloop + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS rs6000_rtx_costs #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_0 #undef TARGET_VECTOR_OPAQUE_P -#define TARGET_VECTOR_OPAQUE_P is_ev64_opaque_type +#define TARGET_VECTOR_OPAQUE_P rs6000_is_opaque_type #undef TARGET_DWARF_REGISTER_SPAN #define TARGET_DWARF_REGISTER_SPAN rs6000_dwarf_register_span @@ -620,10 +965,6 @@ static const char alt_reg_names[][8] = #undef TARGET_PROMOTE_FUNCTION_RETURN #define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true -/* Structure return values are passed as an extra parameter. */ -#undef TARGET_STRUCT_VALUE_RTX -#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null - #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY rs6000_return_in_memory @@ -637,12 +978,134 @@ static const char alt_reg_names[][8] = #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true #undef TARGET_SPLIT_COMPLEX_ARG #define TARGET_SPLIT_COMPLEX_ARG hook_bool_tree_true +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK rs6000_must_pass_in_stack +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE rs6000_pass_by_reference +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES rs6000_arg_partial_bytes #undef TARGET_BUILD_BUILTIN_VA_LIST #define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR rs6000_gimplify_va_arg + +#undef TARGET_EH_RETURN_FILTER_MODE +#define TARGET_EH_RETURN_FILTER_MODE rs6000_eh_return_filter_mode + +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P rs6000_scalar_mode_supported_p + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P rs6000_vector_mode_supported_p + +#undef TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN +#define TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN invalid_arg_for_unprototyped_fn + +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION rs6000_handle_option + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (TARGET_DEFAULT) + +#undef TARGET_STACK_PROTECT_FAIL +#define TARGET_STACK_PROTECT_FAIL rs6000_stack_protect_fail + +/* MPC604EUM 3.5.2 Weak Consistency between Multiple Processors + The PowerPC architecture requires only weak consistency among + processors--that is, memory accesses between processors need not be + sequentially consistent and memory accesses among processors can occur + in any order. The ability to order memory accesses weakly provides + opportunities for more efficient use of the system bus. Unless a + dependency exists, the 604e allows read operations to precede store + operations. */ +#undef TARGET_RELAXED_ORDERING +#define TARGET_RELAXED_ORDERING true + +#ifdef HAVE_AS_TLS +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL +#define TARGET_ASM_OUTPUT_DWARF_DTPREL rs6000_output_dwarf_dtprel +#endif + +/* Use a 32-bit anchor range. This leads to sequences like: + + addis tmp,anchor,high + add dest,tmp,low + + where tmp itself acts as an anchor, and can be shared between + accesses to the same 64k page. */ +#undef TARGET_MIN_ANCHOR_OFFSET +#define TARGET_MIN_ANCHOR_OFFSET -0x7fffffff - 1 +#undef TARGET_MAX_ANCHOR_OFFSET +#define TARGET_MAX_ANCHOR_OFFSET 0x7fffffff +#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P +#define TARGET_USE_BLOCKS_FOR_CONSTANT_P rs6000_use_blocks_for_constant_p + struct gcc_target targetm = TARGET_INITIALIZER; + +/* Value is 1 if hard register REGNO can hold a value of machine-mode + MODE. */ +static int +rs6000_hard_regno_mode_ok (int regno, enum machine_mode mode) +{ + /* The GPRs can hold any mode, but values bigger than one register + cannot go past R31. */ + if (INT_REGNO_P (regno)) + return INT_REGNO_P (regno + HARD_REGNO_NREGS (regno, mode) - 1); + + /* The float registers can only hold floating modes and DImode. + This also excludes decimal float modes. */ + if (FP_REGNO_P (regno)) + return + (SCALAR_FLOAT_MODE_P (mode) + && !DECIMAL_FLOAT_MODE_P (mode) + && FP_REGNO_P (regno + HARD_REGNO_NREGS (regno, mode) - 1)) + || (GET_MODE_CLASS (mode) == MODE_INT + && GET_MODE_SIZE (mode) == UNITS_PER_FP_WORD); + + /* The CR register can only hold CC modes. */ + if (CR_REGNO_P (regno)) + return GET_MODE_CLASS (mode) == MODE_CC; + + if (XER_REGNO_P (regno)) + return mode == PSImode; + + /* AltiVec only in AldyVec registers. */ + if (ALTIVEC_REGNO_P (regno)) + return ALTIVEC_VECTOR_MODE (mode); + + /* ...but GPRs can hold SIMD data on the SPE in one register. */ + if (SPE_SIMD_REGNO_P (regno) && TARGET_SPE && SPE_VECTOR_MODE (mode)) + return 1; + + /* We cannot put TImode anywhere except general register and it must be + able to fit within the register set. */ + + return GET_MODE_SIZE (mode) <= UNITS_PER_WORD; +} + +/* Initialize rs6000_hard_regno_mode_ok_p table. */ +static void +rs6000_init_hard_regno_mode_ok (void) +{ + int r, m; + + for (r = 0; r < FIRST_PSEUDO_REGISTER; ++r) + for (m = 0; m < NUM_MACHINE_MODES; ++m) + if (rs6000_hard_regno_mode_ok (r, m)) + rs6000_hard_regno_mode_ok_p[m][r] = true; +} + +/* If not otherwise specified by a target, make 'long double' equivalent to + 'double'. */ + +#ifndef RS6000_DEFAULT_LONG_DOUBLE_SIZE +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 64 +#endif + /* Override command line options. Mostly we process the processor type and sometimes adjust other TARGET_ options. */ @@ -663,7 +1126,7 @@ rs6000_override_options (const char *default_cpu) /* This table occasionally claims that a processor does not support a particular feature even though it does, but the feature is slower than the alternative. Thus, it shouldn't be relied on as a - complete description of the processor's support. + complete description of the processor's support. Please keep this list in order, and don't forget to update the documentation in invoke.texi when adding a new processor or @@ -677,10 +1140,14 @@ rs6000_override_options (const char *default_cpu) = {{"401", PROCESSOR_PPC403, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"403", PROCESSOR_PPC403, POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_STRICT_ALIGN}, - {"405", PROCESSOR_PPC405, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"405fp", PROCESSOR_PPC405, POWERPC_BASE_MASK}, - {"440", PROCESSOR_PPC440, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"440fp", PROCESSOR_PPC440, POWERPC_BASE_MASK}, + {"405", PROCESSOR_PPC405, + POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_MULHW | MASK_DLMZB}, + {"405fp", PROCESSOR_PPC405, + POWERPC_BASE_MASK | MASK_MULHW | MASK_DLMZB}, + {"440", PROCESSOR_PPC440, + POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_MULHW | MASK_DLMZB}, + {"440fp", PROCESSOR_PPC440, + POWERPC_BASE_MASK | MASK_MULHW | MASK_DLMZB}, {"505", PROCESSOR_MPCCORE, POWERPC_BASE_MASK}, {"601", PROCESSOR_PPC601, MASK_POWER | POWERPC_BASE_MASK | MASK_MULTIPLE | MASK_STRING}, @@ -700,7 +1167,11 @@ rs6000_override_options (const char *default_cpu) {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_PPC_GFXOPT}, + {"8540", PROCESSOR_PPC8540, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + /* 8548 has a dummy entry for now. */ + {"8548", PROCESSOR_PPC8540, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"970", PROCESSOR_POWER4, POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, @@ -718,17 +1189,25 @@ rs6000_override_options (const char *default_cpu) {"power4", PROCESSOR_POWER4, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POWERPC64}, {"power5", PROCESSOR_POWER5, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GFXOPT + | MASK_MFCRF | MASK_POPCNTB}, + {"power5+", PROCESSOR_POWER5, + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GFXOPT + | MASK_MFCRF | MASK_POPCNTB | MASK_FPRND}, + {"power6", PROCESSOR_POWER5, + POWERPC_7400_MASK | MASK_POWERPC64 | MASK_MFCRF | MASK_POPCNTB + | MASK_FPRND}, {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK}, {"powerpc64", PROCESSOR_POWERPC64, - POWERPC_BASE_MASK | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}, {"rios", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rios1", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rios2", PROCESSOR_RIOS2, MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING}, {"rsc", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rsc1", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, - {"rs64a", PROCESSOR_RS64A, POWERPC_BASE_MASK | MASK_POWERPC64}, + {"rs64", PROCESSOR_RS64A, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64} }; const size_t ptt_size = ARRAY_SIZE (processor_target_table); @@ -741,11 +1220,15 @@ rs6000_override_options (const char *default_cpu) enum { POWER_MASKS = MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING, - POWERPC_MASKS = (POWERPC_BASE_MASK | MASK_PPC_GPOPT + POWERPC_MASKS = (POWERPC_BASE_MASK | MASK_PPC_GPOPT | MASK_STRICT_ALIGN | MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_ALTIVEC - | MASK_MFCRF) + | MASK_MFCRF | MASK_POPCNTB | MASK_FPRND | MASK_MULHW + | MASK_DLMZB) }; - set_masks = POWER_MASKS | POWERPC_MASKS | MASK_SOFT_FLOAT; + + rs6000_init_hard_regno_mode_ok (); + + set_masks = POWER_MASKS | POWERPC_MASKS | MASK_SOFT_FLOAT; #ifdef OS_MISSING_POWERPC64 if (OS_MISSING_POWERPC64) set_masks &= ~MASK_POWERPC64; @@ -807,14 +1290,14 @@ rs6000_override_options (const char *default_cpu) { target_flags &= ~MASK_MULTIPLE; if ((target_flags_explicit & MASK_MULTIPLE) != 0) - warning ("-mmultiple is not supported on little endian systems"); + warning (0, "-mmultiple is not supported on little endian systems"); } if (TARGET_STRING) { target_flags &= ~MASK_STRING; if ((target_flags_explicit & MASK_STRING) != 0) - warning ("-mstring is not supported on little endian systems"); + warning (0, "-mstring is not supported on little endian systems"); } } @@ -840,44 +1323,40 @@ rs6000_override_options (const char *default_cpu) else if (! strncmp (rs6000_traceback_name, "no", 2)) rs6000_traceback = traceback_none; else - error ("unknown -mtraceback arg `%s'; expecting `full', `partial' or `none'", + error ("unknown -mtraceback arg %qs; expecting %, % or %", rs6000_traceback_name); } - /* Set size of long double */ - rs6000_long_double_type_size = 64; - if (rs6000_long_double_size_string) - { - char *tail; - int size = strtol (rs6000_long_double_size_string, &tail, 10); - if (*tail != '\0' || (size != 64 && size != 128)) - error ("Unknown switch -mlong-double-%s", - rs6000_long_double_size_string); - else - rs6000_long_double_type_size = size; - } + if (!rs6000_explicit_options.long_double) + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; + +#ifndef POWERPC_LINUX + if (!rs6000_explicit_options.ieee) + rs6000_ieeequad = 1; +#endif /* Set Altivec ABI as default for powerpc64 linux. */ if (TARGET_ELF && TARGET_64BIT) { rs6000_altivec_abi = 1; - rs6000_altivec_vrsave = 1; + TARGET_ALTIVEC_VRSAVE = 1; } - /* Handle -mabi= options. */ - rs6000_parse_abi_options (); + /* Set the Darwin64 ABI as default for 64-bit Darwin. */ + if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT) + { + rs6000_darwin64_abi = 1; +#if TARGET_MACHO + darwin_one_byte_bool = 1; +#endif + /* Default to natural alignment, for better performance. */ + rs6000_alignment_flags = MASK_ALIGN_NATURAL; + } - /* Handle -malign-XXXXX option. */ - rs6000_parse_alignment_option (); - - /* Handle generic -mFOO=YES/NO options. */ - rs6000_parse_yes_no_option ("vrsave", rs6000_altivec_vrsave_string, - &rs6000_altivec_vrsave); - rs6000_parse_yes_no_option ("isel", rs6000_isel_string, - &rs6000_isel); - rs6000_parse_yes_no_option ("spe", rs6000_spe_string, &rs6000_spe); - rs6000_parse_yes_no_option ("float-gprs", rs6000_float_gprs_string, - &rs6000_float_gprs); + /* Place FP constants in the constant pool instead of TOC + if section anchors enabled. */ + if (flag_section_anchors) + TARGET_NO_FP_IN_TOC = 1; /* Handle -mtls-size option. */ rs6000_parse_tls_size_option (); @@ -888,37 +1367,35 @@ rs6000_override_options (const char *default_cpu) #ifdef SUBSUBTARGET_OVERRIDE_OPTIONS SUBSUBTARGET_OVERRIDE_OPTIONS; #endif +#ifdef SUB3TARGET_OVERRIDE_OPTIONS + SUB3TARGET_OVERRIDE_OPTIONS; +#endif if (TARGET_E500) { if (TARGET_ALTIVEC) - error ("AltiVec and E500 instructions cannot coexist"); + error ("AltiVec and E500 instructions cannot coexist"); /* The e500 does not have string instructions, and we set MASK_STRING above when optimizing for size. */ if ((target_flags & MASK_STRING) != 0) target_flags = target_flags & ~MASK_STRING; - - /* No SPE means 64-bit long doubles, even if an E500. */ - if (rs6000_spe_string != 0 - && !strcmp (rs6000_spe_string, "no")) - rs6000_long_double_type_size = 64; } else if (rs6000_select[1].string != NULL) { /* For the powerpc-eabispe configuration, we set all these by default, so let's unset them if we manually set another CPU that is not the E500. */ - if (rs6000_abi_string == 0) + if (!rs6000_explicit_options.abi) rs6000_spe_abi = 0; - if (rs6000_spe_string == 0) + if (!rs6000_explicit_options.spe) rs6000_spe = 0; - if (rs6000_float_gprs_string == 0) + if (!rs6000_explicit_options.float_gprs) rs6000_float_gprs = 0; - if (rs6000_isel_string == 0) + if (!rs6000_explicit_options.isel) rs6000_isel = 0; - if (rs6000_long_double_size_string == 0) - rs6000_long_double_type_size = 64; + if (!rs6000_explicit_options.long_double) + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; } rs6000_always_hint = (rs6000_cpu != PROCESSOR_POWER4 @@ -926,70 +1403,41 @@ rs6000_override_options (const char *default_cpu) rs6000_sched_groups = (rs6000_cpu == PROCESSOR_POWER4 || rs6000_cpu == PROCESSOR_POWER5); - /* Handle -m(no-)longcall option. This is a bit of a cheap hack, - using TARGET_OPTIONS to handle a toggle switch, but we're out of - bits in target_flags so TARGET_SWITCHES cannot be used. - Assumption here is that rs6000_longcall_switch points into the - text of the complete option, rather than being a copy, so we can - scan back for the presence or absence of the no- modifier. */ - if (rs6000_longcall_switch) - { - const char *base = rs6000_longcall_switch; - while (base[-1] != 'm') base--; - - if (*rs6000_longcall_switch != '\0') - error ("invalid option `%s'", base); - rs6000_default_long_calls = (base[0] != 'n'); - } - - /* Handle -m(no-)warn-altivec-long similarly. */ - if (rs6000_warn_altivec_long_switch) - { - const char *base = rs6000_warn_altivec_long_switch; - while (base[-1] != 'm') base--; - - if (*rs6000_warn_altivec_long_switch != '\0') - error ("invalid option `%s'", base); - rs6000_warn_altivec_long = (base[0] != 'n'); - } - - /* Handle -mprioritize-restricted-insns option. */ rs6000_sched_restricted_insns_priority = (rs6000_sched_groups ? 1 : 0); - if (rs6000_sched_restricted_insns_priority_str) - rs6000_sched_restricted_insns_priority = - atoi (rs6000_sched_restricted_insns_priority_str); /* Handle -msched-costly-dep option. */ rs6000_sched_costly_dep = (rs6000_sched_groups ? store_to_load_dep_costly : no_dep_costly); + if (rs6000_sched_costly_dep_str) { - if (! strcmp (rs6000_sched_costly_dep_str, "no")) - rs6000_sched_costly_dep = no_dep_costly; + if (! strcmp (rs6000_sched_costly_dep_str, "no")) + rs6000_sched_costly_dep = no_dep_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "all")) - rs6000_sched_costly_dep = all_deps_costly; + rs6000_sched_costly_dep = all_deps_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "true_store_to_load")) - rs6000_sched_costly_dep = true_store_to_load_dep_costly; + rs6000_sched_costly_dep = true_store_to_load_dep_costly; else if (! strcmp (rs6000_sched_costly_dep_str, "store_to_load")) - rs6000_sched_costly_dep = store_to_load_dep_costly; - else - rs6000_sched_costly_dep = atoi (rs6000_sched_costly_dep_str); + rs6000_sched_costly_dep = store_to_load_dep_costly; + else + rs6000_sched_costly_dep = atoi (rs6000_sched_costly_dep_str); } /* Handle -minsert-sched-nops option. */ rs6000_sched_insert_nops = (rs6000_sched_groups ? sched_finish_regroup_exact : sched_finish_none); + if (rs6000_sched_insert_nops_str) { if (! strcmp (rs6000_sched_insert_nops_str, "no")) - rs6000_sched_insert_nops = sched_finish_none; + rs6000_sched_insert_nops = sched_finish_none; else if (! strcmp (rs6000_sched_insert_nops_str, "pad")) - rs6000_sched_insert_nops = sched_finish_pad_groups; + rs6000_sched_insert_nops = sched_finish_pad_groups; else if (! strcmp (rs6000_sched_insert_nops_str, "regroup_exact")) - rs6000_sched_insert_nops = sched_finish_regroup_exact; + rs6000_sched_insert_nops = sched_finish_regroup_exact; else - rs6000_sched_insert_nops = atoi (rs6000_sched_insert_nops_str); + rs6000_sched_insert_nops = atoi (rs6000_sched_insert_nops_str); } #ifdef TARGET_REGNAMES @@ -999,25 +1447,16 @@ rs6000_override_options (const char *default_cpu) memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names)); #endif - /* Set TARGET_AIX_STRUCT_RET last, after the ABI is determined. + /* Set aix_struct_return last, after the ABI is determined. If -maix-struct-return or -msvr4-struct-return was explicitly used, don't override with the ABI default. */ - if ((target_flags_explicit & MASK_AIX_STRUCT_RET) == 0) - { - if (DEFAULT_ABI == ABI_V4 && !DRAFT_V4_STRUCT_RET) - target_flags = (target_flags & ~MASK_AIX_STRUCT_RET); - else - target_flags |= MASK_AIX_STRUCT_RET; - } + if (!rs6000_explicit_options.aix_struct_ret) + aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET); - if (TARGET_LONG_DOUBLE_128 - && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)) + if (TARGET_LONG_DOUBLE_128 && !TARGET_IEEEQUAD) REAL_MODE_FORMAT (TFmode) = &ibm_extended_format; - /* Allocate an alias set for register saves & restores from stack. */ - rs6000_sr_alias_set = new_alias_set (); - - if (TARGET_TOC) + if (TARGET_TOC) ASM_GENERATE_INTERNAL_LABEL (toc_label_name, "LCTOC", 1); /* We can only guarantee the availability of DI pseudo-ops when @@ -1028,9 +1467,23 @@ rs6000_override_options (const char *default_cpu) targetm.asm_out.unaligned_op.di = NULL; } - /* Set maximum branch target alignment at two instructions, eight bytes. */ - align_jumps_max_skip = 8; - align_loops_max_skip = 8; + /* Set branch target alignment, if not optimizing for size. */ + if (!optimize_size) + { + if (rs6000_sched_groups) + { + if (align_functions <= 0) + align_functions = 16; + if (align_jumps <= 0) + align_jumps = 16; + if (align_loops <= 0) + align_loops = 16; + } + if (align_jumps_max_skip <= 0) + align_jumps_max_skip = 15; + if (align_loops_max_skip <= 0) + align_loops_max_skip = 15; + } /* Arrange to save and restore machine status around nested functions. */ init_machine_status = rs6000_init_machine_status; @@ -1039,6 +1492,96 @@ rs6000_override_options (const char *default_cpu) Linux and Darwin ABIs at the moment. For now, only AIX is fixed. */ if (DEFAULT_ABI != ABI_AIX) targetm.calls.split_complex_arg = NULL; + + /* Initialize rs6000_cost with the appropriate target costs. */ + if (optimize_size) + rs6000_cost = TARGET_POWERPC64 ? &size64_cost : &size32_cost; + else + switch (rs6000_cpu) + { + case PROCESSOR_RIOS1: + rs6000_cost = &rios1_cost; + break; + + case PROCESSOR_RIOS2: + rs6000_cost = &rios2_cost; + break; + + case PROCESSOR_RS64A: + rs6000_cost = &rs64a_cost; + break; + + case PROCESSOR_MPCCORE: + rs6000_cost = &mpccore_cost; + break; + + case PROCESSOR_PPC403: + rs6000_cost = &ppc403_cost; + break; + + case PROCESSOR_PPC405: + rs6000_cost = &ppc405_cost; + break; + + case PROCESSOR_PPC440: + rs6000_cost = &ppc440_cost; + break; + + case PROCESSOR_PPC601: + rs6000_cost = &ppc601_cost; + break; + + case PROCESSOR_PPC603: + rs6000_cost = &ppc603_cost; + break; + + case PROCESSOR_PPC604: + rs6000_cost = &ppc604_cost; + break; + + case PROCESSOR_PPC604e: + rs6000_cost = &ppc604e_cost; + break; + + case PROCESSOR_PPC620: + rs6000_cost = &ppc620_cost; + break; + + case PROCESSOR_PPC630: + rs6000_cost = &ppc630_cost; + break; + + case PROCESSOR_PPC750: + case PROCESSOR_PPC7400: + rs6000_cost = &ppc750_cost; + break; + + case PROCESSOR_PPC7450: + rs6000_cost = &ppc7450_cost; + break; + + case PROCESSOR_PPC8540: + rs6000_cost = &ppc8540_cost; + break; + + case PROCESSOR_POWER4: + case PROCESSOR_POWER5: + rs6000_cost = &power4_cost; + break; + + default: + gcc_unreachable (); + } +} + +/* Implement targetm.vectorize.builtin_mask_for_load. */ +static tree +rs6000_builtin_mask_for_load (void) +{ + if (TARGET_ALTIVEC) + return altivec_builtin_mask_for_load; + else + return 0; } /* Handle generic options of the form -mfoo=yes/no. @@ -1059,48 +1602,6 @@ rs6000_parse_yes_no_option (const char *name, const char *value, int *flag) error ("unknown -m%s= option specified: '%s'", name, value); } -/* Handle -mabi= options. */ -static void -rs6000_parse_abi_options (void) -{ - if (rs6000_abi_string == 0) - return; - else if (! strcmp (rs6000_abi_string, "altivec")) - { - rs6000_altivec_abi = 1; - rs6000_spe_abi = 0; - } - else if (! strcmp (rs6000_abi_string, "no-altivec")) - rs6000_altivec_abi = 0; - else if (! strcmp (rs6000_abi_string, "spe")) - { - rs6000_spe_abi = 1; - rs6000_altivec_abi = 0; - if (!TARGET_SPE_ABI) - error ("not configured for ABI: '%s'", rs6000_abi_string); - } - - else if (! strcmp (rs6000_abi_string, "no-spe")) - rs6000_spe_abi = 0; - else - error ("unknown ABI specified: '%s'", rs6000_abi_string); -} - -/* Handle -malign-XXXXXX options. */ -static void -rs6000_parse_alignment_option (void) -{ - if (rs6000_alignment_string == 0) - return; - else if (! strcmp (rs6000_alignment_string, "power")) - rs6000_alignment_flags = MASK_ALIGN_POWER; - else if (! strcmp (rs6000_alignment_string, "natural")) - rs6000_alignment_flags = MASK_ALIGN_NATURAL; - else - error ("unknown -malign-XXXXX option specified: '%s'", - rs6000_alignment_string); -} - /* Validate and record the size specified with the -mtls-size option. */ static void @@ -1115,12 +1616,313 @@ rs6000_parse_tls_size_option (void) else if (strcmp (rs6000_tls_size_string, "64") == 0) rs6000_tls_size = 64; else - error ("bad value `%s' for -mtls-size switch", rs6000_tls_size_string); + error ("bad value %qs for -mtls-size switch", rs6000_tls_size_string); } void optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) { + if (DEFAULT_ABI == ABI_DARWIN) + /* The Darwin libraries never set errno, so we might as well + avoid calling them when that's the only reason we would. */ + flag_errno_math = 0; + + /* Double growth factor to counter reduced min jump length. */ + set_param_value ("max-grow-copy-bb-insns", 16); + + /* Enable section anchors by default. + Skip section anchors for Objective C and Objective C++ + until front-ends fixed. */ + if (!TARGET_MACHO && lang_hooks.name[4] != 'O') + flag_section_anchors = 1; +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +rs6000_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_mno_power: + target_flags &= ~(MASK_POWER | MASK_POWER2 + | MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_POWER | MASK_POWER2 + | MASK_MULTIPLE | MASK_STRING); + break; + case OPT_mno_powerpc: + target_flags &= ~(MASK_POWERPC | MASK_PPC_GPOPT + | MASK_PPC_GFXOPT | MASK_POWERPC64); + target_flags_explicit |= (MASK_POWERPC | MASK_PPC_GPOPT + | MASK_PPC_GFXOPT | MASK_POWERPC64); + break; + case OPT_mfull_toc: + target_flags &= ~MASK_MINIMAL_TOC; + TARGET_NO_FP_IN_TOC = 0; + TARGET_NO_SUM_IN_TOC = 0; + target_flags_explicit |= MASK_MINIMAL_TOC; +#ifdef TARGET_USES_SYSV4_OPT + /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be + just the same as -mminimal-toc. */ + target_flags |= MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC; +#endif + break; + +#ifdef TARGET_USES_SYSV4_OPT + case OPT_mtoc: + /* Make -mtoc behave like -mminimal-toc. */ + target_flags |= MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC; + break; +#endif + +#ifdef TARGET_USES_AIX64_OPT + case OPT_maix64: +#else + case OPT_m64: +#endif + target_flags |= MASK_POWERPC64 | MASK_POWERPC; + target_flags |= ~target_flags_explicit & MASK_PPC_GFXOPT; + target_flags_explicit |= MASK_POWERPC64 | MASK_POWERPC; + break; + +#ifdef TARGET_USES_AIX64_OPT + case OPT_maix32: +#else + case OPT_m32: +#endif + target_flags &= ~MASK_POWERPC64; + target_flags_explicit |= MASK_POWERPC64; + break; + + case OPT_minsert_sched_nops_: + rs6000_sched_insert_nops_str = arg; + break; + + case OPT_mminimal_toc: + if (value == 1) + { + TARGET_NO_FP_IN_TOC = 0; + TARGET_NO_SUM_IN_TOC = 0; + } + break; + + case OPT_mpower: + if (value == 1) + { + target_flags |= (MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_MULTIPLE | MASK_STRING); + } + break; + + case OPT_mpower2: + if (value == 1) + { + target_flags |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING); + } + break; + + case OPT_mpowerpc_gpopt: + case OPT_mpowerpc_gfxopt: + if (value == 1) + { + target_flags |= MASK_POWERPC; + target_flags_explicit |= MASK_POWERPC; + } + break; + + case OPT_maix_struct_return: + case OPT_msvr4_struct_return: + rs6000_explicit_options.aix_struct_ret = true; + break; + + case OPT_mvrsave_: + rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE)); + break; + + case OPT_misel_: + rs6000_explicit_options.isel = true; + rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel)); + break; + + case OPT_mspe_: + rs6000_explicit_options.spe = true; + rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe)); + /* No SPE means 64-bit long doubles, even if an E500. */ + if (!rs6000_spe) + rs6000_long_double_type_size = 64; + break; + + case OPT_mdebug_: + rs6000_debug_name = arg; + break; + +#ifdef TARGET_USES_SYSV4_OPT + case OPT_mcall_: + rs6000_abi_name = arg; + break; + + case OPT_msdata_: + rs6000_sdata_name = arg; + break; + + case OPT_mtls_size_: + rs6000_tls_size_string = arg; + break; + + case OPT_mrelocatable: + if (value == 1) + { + target_flags |= MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC; + TARGET_NO_FP_IN_TOC = 1; + } + break; + + case OPT_mrelocatable_lib: + if (value == 1) + { + target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_RELOCATABLE | MASK_MINIMAL_TOC; + TARGET_NO_FP_IN_TOC = 1; + } + else + { + target_flags &= ~MASK_RELOCATABLE; + target_flags_explicit |= MASK_RELOCATABLE; + } + break; +#endif + + case OPT_mabi_: + if (!strcmp (arg, "altivec")) + { + rs6000_explicit_options.abi = true; + rs6000_altivec_abi = 1; + rs6000_spe_abi = 0; + } + else if (! strcmp (arg, "no-altivec")) + { + /* ??? Don't set rs6000_explicit_options.abi here, to allow + the default for rs6000_spe_abi to be chosen later. */ + rs6000_altivec_abi = 0; + } + else if (! strcmp (arg, "spe")) + { + rs6000_explicit_options.abi = true; + rs6000_spe_abi = 1; + rs6000_altivec_abi = 0; + if (!TARGET_SPE_ABI) + error ("not configured for ABI: '%s'", arg); + } + else if (! strcmp (arg, "no-spe")) + { + rs6000_explicit_options.abi = true; + rs6000_spe_abi = 0; + } + + /* These are here for testing during development only, do not + document in the manual please. */ + else if (! strcmp (arg, "d64")) + { + rs6000_darwin64_abi = 1; + warning (0, "Using darwin64 ABI"); + } + else if (! strcmp (arg, "d32")) + { + rs6000_darwin64_abi = 0; + warning (0, "Using old darwin ABI"); + } + + else if (! strcmp (arg, "ibmlongdouble")) + { + rs6000_explicit_options.ieee = true; + rs6000_ieeequad = 0; + warning (0, "Using IBM extended precision long double"); + } + else if (! strcmp (arg, "ieeelongdouble")) + { + rs6000_explicit_options.ieee = true; + rs6000_ieeequad = 1; + warning (0, "Using IEEE extended precision long double"); + } + + else + { + error ("unknown ABI specified: '%s'", arg); + return false; + } + break; + + case OPT_mcpu_: + rs6000_select[1].string = arg; + break; + + case OPT_mtune_: + rs6000_select[2].string = arg; + break; + + case OPT_mtraceback_: + rs6000_traceback_name = arg; + break; + + case OPT_mfloat_gprs_: + rs6000_explicit_options.float_gprs = true; + if (! strcmp (arg, "yes") || ! strcmp (arg, "single")) + rs6000_float_gprs = 1; + else if (! strcmp (arg, "double")) + rs6000_float_gprs = 2; + else if (! strcmp (arg, "no")) + rs6000_float_gprs = 0; + else + { + error ("invalid option for -mfloat-gprs: '%s'", arg); + return false; + } + break; + + case OPT_mlong_double_: + rs6000_explicit_options.long_double = true; + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; + if (value != 64 && value != 128) + { + error ("Unknown switch -mlong-double-%s", arg); + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; + return false; + } + else + rs6000_long_double_type_size = value; + break; + + case OPT_msched_costly_dep_: + rs6000_sched_costly_dep_str = arg; + break; + + case OPT_malign_: + rs6000_explicit_options.alignment = true; + if (! strcmp (arg, "power")) + { + /* On 64-bit Darwin, power alignment is ABI-incompatible with + some C library functions, so warn about it. The flag may be + useful for performance studies from time to time though, so + don't disable it entirely. */ + if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT) + warning (0, "-malign-power is not supported for 64-bit Darwin;" + " it is incompatible with the installed C and C++ libraries"); + rs6000_alignment_flags = MASK_ALIGN_POWER; + } + else if (! strcmp (arg, "natural")) + rs6000_alignment_flags = MASK_ALIGN_NATURAL; + else + { + error ("unknown -malign-XXXXX option specified: '%s'", arg); + return false; + } + break; + } + return true; } /* Do anything needed at the start of the asm file. */ @@ -1157,6 +1959,12 @@ rs6000_file_start (void) } } + if (PPC405_ERRATUM77) + { + fprintf (file, "%s PPC405CR_ERRATUM77", start); + start = ""; + } + #ifdef USING_ELFOS_H switch (rs6000_sdata) { @@ -1177,7 +1985,14 @@ rs6000_file_start (void) if (*start == '\0') putc ('\n', file); } + + if (DEFAULT_ABI == ABI_AIX || (TARGET_ELF && flag_pic == 2)) + { + switch_to_section (toc_section); + switch_to_section (text_section); + } } + /* Return nonzero if this function is known to have a null epilogue. */ @@ -1201,310 +2016,19 @@ direct_return (void) return 0; } -/* Returns 1 always. */ - -int -any_operand (rtx op ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return 1; -} - -/* Returns 1 if op is the count register. */ -int -count_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != REG) - return 0; - - if (REGNO (op) == COUNT_REGISTER_REGNUM) - return 1; - - if (REGNO (op) > FIRST_PSEUDO_REGISTER) - return 1; - - return 0; -} - -/* Returns 1 if op is an altivec register. */ -int -altivec_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - - return (register_operand (op, mode) - && (GET_CODE (op) != REG - || REGNO (op) > FIRST_PSEUDO_REGISTER - || ALTIVEC_REGNO_P (REGNO (op)))); -} - -int -xer_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != REG) - return 0; - - if (XER_REGNO_P (REGNO (op))) - return 1; - - return 0; -} - -/* Return 1 if OP is a signed 8-bit constant. Int multiplication - by such constants completes more quickly. */ - -int -s8bit_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ( GET_CODE (op) == CONST_INT - && (INTVAL (op) >= -128 && INTVAL (op) <= 127)); -} - -/* Return 1 if OP is a constant that can fit in a D field. */ - -int -short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')); -} - -/* Similar for an unsigned D field. */ - -int -u_short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (op) & GET_MODE_MASK (mode), 'K')); -} - -/* Return 1 if OP is a CONST_INT that cannot fit in a signed D field. */ - -int -non_short_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000); -} - -/* Returns 1 if OP is a CONST_INT that is a positive value - and an exact power of 2. */ - -int -exact_log2_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) > 0 - && exact_log2 (INTVAL (op)) >= 0); -} - -/* Returns 1 if OP is a register that is not special (i.e., not MQ, - ctr, or lr). */ - -int -gpc_reg_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - && (GET_CODE (op) != REG - || (REGNO (op) >= ARG_POINTER_REGNUM - && !XER_REGNO_P (REGNO (op))) - || REGNO (op) < MQ_REGNO)); -} - -/* Returns 1 if OP is either a pseudo-register or a register denoting a - CR field. */ - -int -cc_reg_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - && (GET_CODE (op) != REG - || REGNO (op) >= FIRST_PSEUDO_REGISTER - || CR_REGNO_P (REGNO (op)))); -} - -/* Returns 1 if OP is either a pseudo-register or a register denoting a - CR field that isn't CR0. */ - -int -cc_reg_not_cr0_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - && (GET_CODE (op) != REG - || REGNO (op) >= FIRST_PSEUDO_REGISTER - || CR_REGNO_NOT_CR0_P (REGNO (op)))); -} - -/* Returns 1 if OP is either a constant integer valid for a D-field or - a non-special register. If a register, it must be in the proper - mode unless MODE is VOIDmode. */ - -int -reg_or_short_operand (rtx op, enum machine_mode mode) -{ - return short_cint_operand (op, mode) || gpc_reg_operand (op, mode); -} - -/* Similar, except check if the negation of the constant would be - valid for a D-field. Don't allow a constant zero, since all the - patterns that call this predicate use "addic r1,r2,-constant" on - a constant value to set a carry when r2 is greater or equal to - "constant". That doesn't work for zero. */ - -int -reg_or_neg_short_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return CONST_OK_FOR_LETTER_P (INTVAL (op), 'P') && INTVAL (op) != 0; - - return gpc_reg_operand (op, mode); -} - -/* Returns 1 if OP is either a constant integer valid for a DS-field or - a non-special register. If a register, it must be in the proper - mode unless MODE is VOIDmode. */ - -int -reg_or_aligned_short_operand (rtx op, enum machine_mode mode) -{ - if (gpc_reg_operand (op, mode)) - return 1; - else if (short_cint_operand (op, mode) && !(INTVAL (op) & 3)) - return 1; - - return 0; -} - - -/* Return 1 if the operand is either a register or an integer whose - high-order 16 bits are zero. */ - -int -reg_or_u_short_operand (rtx op, enum machine_mode mode) -{ - return u_short_cint_operand (op, mode) || gpc_reg_operand (op, mode); -} - -/* Return 1 is the operand is either a non-special register or ANY - constant integer. */ - -int -reg_or_cint_operand (rtx op, enum machine_mode mode) -{ - return (GET_CODE (op) == CONST_INT || gpc_reg_operand (op, mode)); -} - -/* Return 1 is the operand is either a non-special register or ANY - 32-bit signed constant integer. */ - -int -reg_or_arith_cint_operand (rtx op, enum machine_mode mode) -{ - return (gpc_reg_operand (op, mode) - || (GET_CODE (op) == CONST_INT -#if HOST_BITS_PER_WIDE_INT != 32 - && ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80000000) - < (unsigned HOST_WIDE_INT) 0x100000000ll) -#endif - )); -} - -/* Return 1 is the operand is either a non-special register or a 32-bit - signed constant integer valid for 64-bit addition. */ - -int -reg_or_add_cint64_operand (rtx op, enum machine_mode mode) -{ - return (gpc_reg_operand (op, mode) - || (GET_CODE (op) == CONST_INT -#if HOST_BITS_PER_WIDE_INT == 32 - && INTVAL (op) < 0x7fff8000 -#else - && ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80008000) - < 0x100000000ll) -#endif - )); -} - -/* Return 1 is the operand is either a non-special register or a 32-bit - signed constant integer valid for 64-bit subtraction. */ - -int -reg_or_sub_cint64_operand (rtx op, enum machine_mode mode) -{ - return (gpc_reg_operand (op, mode) - || (GET_CODE (op) == CONST_INT -#if HOST_BITS_PER_WIDE_INT == 32 - && (- INTVAL (op)) < 0x7fff8000 -#else - && ((unsigned HOST_WIDE_INT) ((- INTVAL (op)) + 0x80008000) - < 0x100000000ll) -#endif - )); -} - -/* Return 1 is the operand is either a non-special register or ANY - 32-bit unsigned constant integer. */ - -int -reg_or_logical_cint_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - { - if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT) - { - if (GET_MODE_BITSIZE (mode) <= 32) - abort (); - - if (INTVAL (op) < 0) - return 0; - } - - return ((INTVAL (op) & GET_MODE_MASK (mode) - & (~ (unsigned HOST_WIDE_INT) 0xffffffff)) == 0); - } - else if (GET_CODE (op) == CONST_DOUBLE) - { - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - || mode != DImode) - abort (); - - return CONST_DOUBLE_HIGH (op) == 0; - } - else - return gpc_reg_operand (op, mode); -} - -/* Return 1 if the operand is an operand that can be loaded via the GOT. */ - -int -got_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == SYMBOL_REF - || GET_CODE (op) == CONST - || GET_CODE (op) == LABEL_REF); -} - -/* Return 1 if the operand is a simple references that can be loaded via - the GOT (labels involving addition aren't allowed). */ - -int -got_no_const_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF); -} - /* Return the number of instructions it takes to form a constant in an integer register. */ -static int +int num_insns_constant_wide (HOST_WIDE_INT value) { /* signed constant loadable with {cal|addi} */ - if (CONST_OK_FOR_LETTER_P (value, 'I')) + if ((unsigned HOST_WIDE_INT) (value + 0x8000) < 0x10000) return 1; /* constant loadable with {cau|addis} */ - else if (CONST_OK_FOR_LETTER_P (value, 'L')) + else if ((value & 0xffff) == 0 + && (value >> 31 == -1 || value >> 31 == 0)) return 1; #if HOST_BITS_PER_WIDE_INT == 64 @@ -1533,285 +2057,228 @@ num_insns_constant_wide (HOST_WIDE_INT value) int num_insns_constant (rtx op, enum machine_mode mode) { - if (GET_CODE (op) == CONST_INT) + HOST_WIDE_INT low, high; + + switch (GET_CODE (op)) { + case CONST_INT: #if HOST_BITS_PER_WIDE_INT == 64 if ((INTVAL (op) >> 31) != 0 && (INTVAL (op) >> 31) != -1 && mask64_operand (op, mode)) - return 2; + return 2; else #endif return num_insns_constant_wide (INTVAL (op)); - } - else if (GET_CODE (op) == CONST_DOUBLE && mode == SFmode) + case CONST_DOUBLE: + if (mode == SFmode) + { + long l; + REAL_VALUE_TYPE rv; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_SINGLE (rv, l); + return num_insns_constant_wide ((HOST_WIDE_INT) l); + } + + if (mode == VOIDmode || mode == DImode) + { + high = CONST_DOUBLE_HIGH (op); + low = CONST_DOUBLE_LOW (op); + } + else + { + long l[2]; + REAL_VALUE_TYPE rv; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_DOUBLE (rv, l); + high = l[WORDS_BIG_ENDIAN == 0]; + low = l[WORDS_BIG_ENDIAN != 0]; + } + + if (TARGET_32BIT) + return (num_insns_constant_wide (low) + + num_insns_constant_wide (high)); + else + { + if ((high == 0 && low >= 0) + || (high == -1 && low < 0)) + return num_insns_constant_wide (low); + + else if (mask64_operand (op, mode)) + return 2; + + else if (low == 0) + return num_insns_constant_wide (high) + 1; + + else + return (num_insns_constant_wide (high) + + num_insns_constant_wide (low) + 1); + } + + default: + gcc_unreachable (); + } +} + +/* Interpret element ELT of the CONST_VECTOR OP as an integer value. + If the mode of OP is MODE_VECTOR_INT, this simply returns the + corresponding element of the vector, but for V4SFmode and V2SFmode, + the corresponding "float" is interpreted as an SImode integer. */ + +static HOST_WIDE_INT +const_vector_elt_as_int (rtx op, unsigned int elt) +{ + rtx tmp = CONST_VECTOR_ELT (op, elt); + if (GET_MODE (op) == V4SFmode + || GET_MODE (op) == V2SFmode) + tmp = gen_lowpart (SImode, tmp); + return INTVAL (tmp); +} + +/* Return true if OP can be synthesized with a particular vspltisb, vspltish + or vspltisw instruction. OP is a CONST_VECTOR. Which instruction is used + depends on STEP and COPIES, one of which will be 1. If COPIES > 1, + all items are set to the same value and contain COPIES replicas of the + vsplt's operand; if STEP > 1, one in STEP elements is set to the vsplt's + operand and the others are set to the value of the operand's msb. */ + +static bool +vspltis_constant (rtx op, unsigned step, unsigned copies) +{ + enum machine_mode mode = GET_MODE (op); + enum machine_mode inner = GET_MODE_INNER (mode); + + unsigned i; + unsigned nunits = GET_MODE_NUNITS (mode); + unsigned bitsize = GET_MODE_BITSIZE (inner); + unsigned mask = GET_MODE_MASK (inner); + + HOST_WIDE_INT val = const_vector_elt_as_int (op, nunits - 1); + HOST_WIDE_INT splat_val = val; + HOST_WIDE_INT msb_val = val > 0 ? 0 : -1; + + /* Construct the value to be splatted, if possible. If not, return 0. */ + for (i = 2; i <= copies; i *= 2) { - long l; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); - return num_insns_constant_wide ((HOST_WIDE_INT) l); + HOST_WIDE_INT small_val; + bitsize /= 2; + small_val = splat_val >> bitsize; + mask >>= bitsize; + if (splat_val != ((small_val << bitsize) | (small_val & mask))) + return false; + splat_val = small_val; } - else if (GET_CODE (op) == CONST_DOUBLE) - { - HOST_WIDE_INT low; - HOST_WIDE_INT high; - long l[2]; - REAL_VALUE_TYPE rv; - int endian = (WORDS_BIG_ENDIAN == 0); + /* Check if SPLAT_VAL can really be the operand of a vspltis[bhw]. */ + if (EASY_VECTOR_15 (splat_val)) + ; - if (mode == VOIDmode || mode == DImode) - { - high = CONST_DOUBLE_HIGH (op); - low = CONST_DOUBLE_LOW (op); - } - else - { - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_DOUBLE (rv, l); - high = l[endian]; - low = l[1 - endian]; - } - - if (TARGET_32BIT) - return (num_insns_constant_wide (low) - + num_insns_constant_wide (high)); - - else - { - if (high == 0 && low >= 0) - return num_insns_constant_wide (low); - - else if (high == -1 && low < 0) - return num_insns_constant_wide (low); - - else if (mask64_operand (op, mode)) - return 2; - - else if (low == 0) - return num_insns_constant_wide (high) + 1; - - else - return (num_insns_constant_wide (high) - + num_insns_constant_wide (low) + 1); - } - } + /* Also check if we can splat, and then add the result to itself. Do so if + the value is positive, of if the splat instruction is using OP's mode; + for splat_val < 0, the splat and the add should use the same mode. */ + else if (EASY_VECTOR_15_ADD_SELF (splat_val) + && (splat_val >= 0 || (step == 1 && copies == 1))) + ; else - abort (); + return false; + + /* Check if VAL is present in every STEP-th element, and the + other elements are filled with its most significant bit. */ + for (i = 0; i < nunits - 1; ++i) + { + HOST_WIDE_INT desired_val; + if (((i + 1) & (step - 1)) == 0) + desired_val = val; + else + desired_val = msb_val; + + if (desired_val != const_vector_elt_as_int (op, i)) + return false; + } + + return true; } -/* Return 1 if the operand is a CONST_DOUBLE and it can be put into a - register with one instruction per word. We only do this if we can - safely read CONST_DOUBLE_{LOW,HIGH}. */ -int -easy_fp_constant (rtx op, enum machine_mode mode) +/* Return true if OP is of the given MODE and can be synthesized + with a vspltisb, vspltish or vspltisw. */ + +bool +easy_altivec_constant (rtx op, enum machine_mode mode) { - if (GET_CODE (op) != CONST_DOUBLE - || GET_MODE (op) != mode - || (GET_MODE_CLASS (mode) != MODE_FLOAT && mode != DImode)) - return 0; + unsigned step, copies; - /* Consider all constants with -msoft-float to be easy. */ - if ((TARGET_SOFT_FLOAT || !TARGET_FPRS) - && mode != DImode) - return 1; + if (mode == VOIDmode) + mode = GET_MODE (op); + else if (mode != GET_MODE (op)) + return false; - /* If we are using V.4 style PIC, consider all constants to be hard. */ - if (flag_pic && DEFAULT_ABI == ABI_V4) - return 0; + /* Start with a vspltisw. */ + step = GET_MODE_NUNITS (mode) / 4; + copies = 1; -#ifdef TARGET_RELOCATABLE - /* Similarly if we are using -mrelocatable, consider all constants - to be hard. */ - if (TARGET_RELOCATABLE) - return 0; -#endif + if (vspltis_constant (op, step, copies)) + return true; - if (mode == TFmode) - { - long k[4]; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k); - - return (num_insns_constant_wide ((HOST_WIDE_INT) k[0]) == 1 - && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1 - && num_insns_constant_wide ((HOST_WIDE_INT) k[2]) == 1 - && num_insns_constant_wide ((HOST_WIDE_INT) k[3]) == 1); - } - - else if (mode == DFmode) - { - long k[2]; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_DOUBLE (rv, k); - - return (num_insns_constant_wide ((HOST_WIDE_INT) k[0]) == 1 - && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1); - } - - else if (mode == SFmode) - { - long l; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); - - return num_insns_constant_wide (l) == 1; - } - - else if (mode == DImode) - return ((TARGET_POWERPC64 - && GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_LOW (op) == 0) - || (num_insns_constant (op, DImode) <= 2)); - - else if (mode == SImode) - return 1; + /* Then try with a vspltish. */ + if (step == 1) + copies <<= 1; else - abort (); + step >>= 1; + + if (vspltis_constant (op, step, copies)) + return true; + + /* And finally a vspltisb. */ + if (step == 1) + copies <<= 1; + else + step >>= 1; + + if (vspltis_constant (op, step, copies)) + return true; + + return false; } -/* Returns the constant for the splat instrunction, if exists. */ +/* Generate a VEC_DUPLICATE representing a vspltis[bhw] instruction whose + result is OP. Abort if it is not possible. */ -static int -easy_vector_splat_const (int cst, enum machine_mode mode) +rtx +gen_easy_altivec_constant (rtx op) { - switch (mode) - { - case V4SImode: - if (EASY_VECTOR_15 (cst) - || EASY_VECTOR_15_ADD_SELF (cst)) - return cst; - if ((cst & 0xffff) != ((cst >> 16) & 0xffff)) - break; - cst = cst >> 16; - case V8HImode: - if (EASY_VECTOR_15 (cst) - || EASY_VECTOR_15_ADD_SELF (cst)) - return cst; - if ((cst & 0xff) != ((cst >> 8) & 0xff)) - break; - cst = cst >> 8; - case V16QImode: - if (EASY_VECTOR_15 (cst) - || EASY_VECTOR_15_ADD_SELF (cst)) - return cst; - default: - break; - } - return 0; -} + enum machine_mode mode = GET_MODE (op); + int nunits = GET_MODE_NUNITS (mode); + rtx last = CONST_VECTOR_ELT (op, nunits - 1); + unsigned step = nunits / 4; + unsigned copies = 1; + /* Start with a vspltisw. */ + if (vspltis_constant (op, step, copies)) + return gen_rtx_VEC_DUPLICATE (V4SImode, gen_lowpart (SImode, last)); -/* Return nonzero if all elements of a vector have the same value. */ + /* Then try with a vspltish. */ + if (step == 1) + copies <<= 1; + else + step >>= 1; -static int -easy_vector_same (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int units, i, cst; + if (vspltis_constant (op, step, copies)) + return gen_rtx_VEC_DUPLICATE (V8HImode, gen_lowpart (HImode, last)); - units = CONST_VECTOR_NUNITS (op); + /* And finally a vspltisb. */ + if (step == 1) + copies <<= 1; + else + step >>= 1; - cst = INTVAL (CONST_VECTOR_ELT (op, 0)); - for (i = 1; i < units; ++i) - if (INTVAL (CONST_VECTOR_ELT (op, i)) != cst) - break; - if (i == units && easy_vector_splat_const (cst, mode)) - return 1; - return 0; -} + if (vspltis_constant (op, step, copies)) + return gen_rtx_VEC_DUPLICATE (V16QImode, gen_lowpart (QImode, last)); -/* Return 1 if the operand is a CONST_INT and can be put into a - register without using memory. */ - -int -easy_vector_constant (rtx op, enum machine_mode mode) -{ - int cst, cst2; - - if (GET_CODE (op) != CONST_VECTOR - || (!TARGET_ALTIVEC - && !TARGET_SPE)) - return 0; - - if (zero_constant (op, mode) - && ((TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (mode)) - || (TARGET_SPE && SPE_VECTOR_MODE (mode)))) - return 1; - - if (GET_MODE_CLASS (mode) != MODE_VECTOR_INT) - return 0; - - if (TARGET_SPE && mode == V1DImode) - return 0; - - cst = INTVAL (CONST_VECTOR_ELT (op, 0)); - cst2 = INTVAL (CONST_VECTOR_ELT (op, 1)); - - /* Limit SPE vectors to 15 bits signed. These we can generate with: - li r0, CONSTANT1 - evmergelo r0, r0, r0 - li r0, CONSTANT2 - - I don't know how efficient it would be to allow bigger constants, - considering we'll have an extra 'ori' for every 'li'. I doubt 5 - instructions is better than a 64-bit memory load, but I don't - have the e500 timing specs. */ - if (TARGET_SPE && mode == V2SImode - && cst >= -0x7fff && cst <= 0x7fff - && cst2 >= -0x7fff && cst2 <= 0x7fff) - return 1; - - if (TARGET_ALTIVEC - && easy_vector_same (op, mode)) - { - cst = easy_vector_splat_const (cst, mode); - if (EASY_VECTOR_15_ADD_SELF (cst) - || EASY_VECTOR_15 (cst)) - return 1; - } - return 0; -} - -/* Same as easy_vector_constant but only for EASY_VECTOR_15_ADD_SELF. */ - -int -easy_vector_constant_add_self (rtx op, enum machine_mode mode) -{ - int cst; - if (TARGET_ALTIVEC - && GET_CODE (op) == CONST_VECTOR - && easy_vector_same (op, mode)) - { - cst = easy_vector_splat_const (INTVAL (CONST_VECTOR_ELT (op, 0)), mode); - if (EASY_VECTOR_15_ADD_SELF (cst)) - return 1; - } - return 0; -} - -/* Generate easy_vector_constant out of a easy_vector_constant_add_self. */ - -rtx -gen_easy_vector_constant_add_self (rtx op) -{ - int i, units; - rtvec v; - units = GET_MODE_NUNITS (GET_MODE (op)); - v = rtvec_alloc (units); - - for (i = 0; i < units; i++) - RTVEC_ELT (v, i) = - GEN_INT (INTVAL (CONST_VECTOR_ELT (op, i)) >> 1); - return gen_rtx_raw_CONST_VECTOR (GET_MODE (op), v); + gcc_unreachable (); } const char * @@ -1823,354 +2290,214 @@ output_vec_const_move (rtx *operands) dest = operands[0]; vec = operands[1]; - - cst = INTVAL (CONST_VECTOR_ELT (vec, 0)); - cst2 = INTVAL (CONST_VECTOR_ELT (vec, 1)); mode = GET_MODE (dest); if (TARGET_ALTIVEC) { + rtx splat_vec; if (zero_constant (vec, mode)) return "vxor %0,%0,%0"; - else if (easy_vector_constant (vec, mode)) + + splat_vec = gen_easy_altivec_constant (vec); + gcc_assert (GET_CODE (splat_vec) == VEC_DUPLICATE); + operands[1] = XEXP (splat_vec, 0); + if (!EASY_VECTOR_15 (INTVAL (operands[1]))) + return "#"; + + switch (GET_MODE (splat_vec)) { - operands[1] = GEN_INT (cst); - switch (mode) - { - case V4SImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltisw %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; - cst = cst >> 16; - case V8HImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltish %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; - cst = cst >> 8; - case V16QImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltisb %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; - default: - abort (); - } + case V4SImode: + return "vspltisw %0,%1"; + + case V8HImode: + return "vspltish %0,%1"; + + case V16QImode: + return "vspltisb %0,%1"; + + default: + gcc_unreachable (); } - else - abort (); } - if (TARGET_SPE) - { - /* Vector constant 0 is handled as a splitter of V2SI, and in the - pattern of V1DI, V4HI, and V2SF. + gcc_assert (TARGET_SPE); - FIXME: We should probably return # and add post reload - splitters for these, but this way is so easy ;-). - */ - operands[1] = GEN_INT (cst); - operands[2] = GEN_INT (cst2); - if (cst == cst2) - return "li %0,%1\n\tevmergelo %0,%0,%0"; - else - return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2"; - } + /* Vector constant 0 is handled as a splitter of V2SI, and in the + pattern of V1DI, V4HI, and V2SF. - abort (); -} - -/* Return 1 if the operand is the constant 0. This works for scalars - as well as vectors. */ -int -zero_constant (rtx op, enum machine_mode mode) -{ - return op == CONST0_RTX (mode); -} - -/* Return 1 if the operand is 0.0. */ -int -zero_fp_constant (rtx op, enum machine_mode mode) -{ - return GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode); -} - -/* Return 1 if the operand is in volatile memory. Note that during - the RTL generation phase, memory_operand does not return TRUE for - volatile memory references. So this function allows us to - recognize volatile references where its safe. */ - -int -volatile_mem_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - return 0; - - if (!MEM_VOLATILE_P (op)) - return 0; - - if (mode != GET_MODE (op)) - return 0; - - if (reload_completed) - return memory_operand (op, mode); - - if (reload_in_progress) - return strict_memory_address_p (mode, XEXP (op, 0)); - - return memory_address_p (mode, XEXP (op, 0)); -} - -/* Return 1 if the operand is an offsettable memory operand. */ - -int -offsettable_mem_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == MEM) - && offsettable_address_p (reload_completed || reload_in_progress, - mode, XEXP (op, 0))); -} - -/* Return 1 if the operand is either an easy FP constant (see above) or - memory. */ - -int -mem_or_easy_const_operand (rtx op, enum machine_mode mode) -{ - return memory_operand (op, mode) || easy_fp_constant (op, mode); -} - -/* Return 1 if the operand is either a non-special register or an item - that can be used as the operand of a `mode' add insn. */ - -int -add_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'I') - || CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')); - - return gpc_reg_operand (op, mode); -} - -/* Return 1 if OP is a constant but not a valid add_operand. */ - -int -non_add_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && !CONST_OK_FOR_LETTER_P (INTVAL (op), 'I') - && !CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')); -} - -/* Return 1 if the operand is a non-special register or a constant that - can be used as the operand of an OR or XOR insn on the RS/6000. */ - -int -logical_operand (rtx op, enum machine_mode mode) -{ - HOST_WIDE_INT opl, oph; - - if (gpc_reg_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT) - { - opl = INTVAL (op) & GET_MODE_MASK (mode); - -#if HOST_BITS_PER_WIDE_INT <= 32 - if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT && opl < 0) - return 0; -#endif - } - else if (GET_CODE (op) == CONST_DOUBLE) - { - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) - abort (); - - opl = CONST_DOUBLE_LOW (op); - oph = CONST_DOUBLE_HIGH (op); - if (oph != 0) - return 0; - } + FIXME: We should probably return # and add post reload + splitters for these, but this way is so easy ;-). */ + cst = INTVAL (CONST_VECTOR_ELT (vec, 0)); + cst2 = INTVAL (CONST_VECTOR_ELT (vec, 1)); + operands[1] = CONST_VECTOR_ELT (vec, 0); + operands[2] = CONST_VECTOR_ELT (vec, 1); + if (cst == cst2) + return "li %0,%1\n\tevmergelo %0,%0,%0"; else - return 0; - - return ((opl & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0 - || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0); + return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2"; } -/* Return 1 if C is a constant that is not a logical operand (as - above), but could be split into one. */ +/* Initialize vector TARGET to VALS. */ -int -non_logical_cint_operand (rtx op, enum machine_mode mode) +void +rs6000_expand_vector_init (rtx target, rtx vals) { - return ((GET_CODE (op) == CONST_INT || GET_CODE (op) == CONST_DOUBLE) - && ! logical_operand (op, mode) - && reg_or_logical_cint_operand (op, mode)); -} + enum machine_mode mode = GET_MODE (target); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + int n_elts = GET_MODE_NUNITS (mode); + int n_var = 0, one_var = -1; + bool all_same = true, all_const_zero = true; + rtx x, mem; + int i; -/* Return 1 if C is a constant that can be encoded in a 32-bit mask on the - RS/6000. It is if there are no more than two 1->0 or 0->1 transitions. - Reject all ones and all zeros, since these should have been optimized - away and confuse the making of MB and ME. */ - -int -mask_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT c, lsb; - - if (GET_CODE (op) != CONST_INT) - return 0; - - c = INTVAL (op); - - /* Fail in 64-bit mode if the mask wraps around because the upper - 32-bits of the mask will all be 1s, contrary to GCC's internal view. */ - if (TARGET_POWERPC64 && (c & 0x80000001) == 0x80000001) - return 0; - - /* We don't change the number of transitions by inverting, - so make sure we start with the LS bit zero. */ - if (c & 1) - c = ~c; - - /* Reject all zeros or all ones. */ - if (c == 0) - return 0; - - /* Find the first transition. */ - lsb = c & -c; - - /* Invert to look for a second transition. */ - c = ~c; - - /* Erase first transition. */ - c &= -lsb; - - /* Find the second transition (if any). */ - lsb = c & -c; - - /* Match if all the bits above are 1's (or c is zero). */ - return c == -lsb; -} - -/* Return 1 for the PowerPC64 rlwinm corner case. */ - -int -mask_operand_wrap (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT c, lsb; - - if (GET_CODE (op) != CONST_INT) - return 0; - - c = INTVAL (op); - - if ((c & 0x80000001) != 0x80000001) - return 0; - - c = ~c; - if (c == 0) - return 0; - - lsb = c & -c; - c = ~c; - c &= -lsb; - lsb = c & -c; - return c == -lsb; -} - -/* Return 1 if the operand is a constant that is a PowerPC64 mask. - It is if there are no more than one 1->0 or 0->1 transitions. - Reject all zeros, since zero should have been optimized away and - confuses the making of MB and ME. */ - -int -mask64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT) + for (i = 0; i < n_elts; ++i) { - HOST_WIDE_INT c, lsb; + x = XVECEXP (vals, 0, i); + if (!CONSTANT_P (x)) + ++n_var, one_var = i; + else if (x != CONST0_RTX (inner_mode)) + all_const_zero = false; - c = INTVAL (op); - - /* Reject all zeros. */ - if (c == 0) - return 0; - - /* We don't change the number of transitions by inverting, - so make sure we start with the LS bit zero. */ - if (c & 1) - c = ~c; - - /* Find the transition, and check that all bits above are 1's. */ - lsb = c & -c; - - /* Match if all the bits above are 1's (or c is zero). */ - return c == -lsb; + if (i > 0 && !rtx_equal_p (x, XVECEXP (vals, 0, 0))) + all_same = false; } - return 0; + + if (n_var == 0) + { + if (mode != V4SFmode && all_const_zero) + { + /* Zero register. */ + emit_insn (gen_rtx_SET (VOIDmode, target, + gen_rtx_XOR (mode, target, target))); + return; + } + else if (mode != V4SFmode && easy_vector_constant (vals, mode)) + { + /* Splat immediate. */ + emit_insn (gen_rtx_SET (VOIDmode, target, vals)); + return; + } + else if (all_same) + ; /* Splat vector element. */ + else + { + /* Load from constant pool. */ + emit_move_insn (target, gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0))); + return; + } + } + + /* Store value to stack temp. Load vector element. Splat. */ + if (all_same) + { + mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode), 0); + emit_move_insn (adjust_address_nv (mem, inner_mode, 0), + XVECEXP (vals, 0, 0)); + x = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (1, const0_rtx), UNSPEC_LVE); + emit_insn (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, + target, mem), + x))); + x = gen_rtx_VEC_SELECT (inner_mode, target, + gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (1, const0_rtx))); + emit_insn (gen_rtx_SET (VOIDmode, target, + gen_rtx_VEC_DUPLICATE (mode, x))); + return; + } + + /* One field is non-constant. Load constant then overwrite + varying field. */ + if (n_var == 1) + { + rtx copy = copy_rtx (vals); + + /* Load constant part of vector, substitute neighboring value for + varying element. */ + XVECEXP (copy, 0, one_var) = XVECEXP (vals, 0, (one_var + 1) % n_elts); + rs6000_expand_vector_init (target, copy); + + /* Insert variable. */ + rs6000_expand_vector_set (target, XVECEXP (vals, 0, one_var), one_var); + return; + } + + /* Construct the vector in memory one field at a time + and load the whole vector. */ + mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0); + for (i = 0; i < n_elts; i++) + emit_move_insn (adjust_address_nv (mem, inner_mode, + i * GET_MODE_SIZE (inner_mode)), + XVECEXP (vals, 0, i)); + emit_move_insn (target, mem); } -/* Like mask64_operand, but allow up to three transitions. This - predicate is used by insn patterns that generate two rldicl or - rldicr machine insns. */ +/* Set field ELT of TARGET to VAL. */ -int -mask64_2_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +void +rs6000_expand_vector_set (rtx target, rtx val, int elt) { - if (GET_CODE (op) == CONST_INT) - { - HOST_WIDE_INT c, lsb; + enum machine_mode mode = GET_MODE (target); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + rtx reg = gen_reg_rtx (mode); + rtx mask, mem, x; + int width = GET_MODE_SIZE (inner_mode); + int i; - c = INTVAL (op); + /* Load single variable value. */ + mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode), 0); + emit_move_insn (adjust_address_nv (mem, inner_mode, 0), val); + x = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (1, const0_rtx), UNSPEC_LVE); + emit_insn (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, + reg, mem), + x))); - /* Disallow all zeros. */ - if (c == 0) - return 0; + /* Linear sequence. */ + mask = gen_rtx_PARALLEL (V16QImode, rtvec_alloc (16)); + for (i = 0; i < 16; ++i) + XVECEXP (mask, 0, i) = GEN_INT (i); - /* We don't change the number of transitions by inverting, - so make sure we start with the LS bit zero. */ - if (c & 1) - c = ~c; + /* Set permute mask to insert element into target. */ + for (i = 0; i < width; ++i) + XVECEXP (mask, 0, elt*width + i) + = GEN_INT (i + 0x10); + x = gen_rtx_CONST_VECTOR (V16QImode, XVEC (mask, 0)); + x = gen_rtx_UNSPEC (mode, + gen_rtvec (3, target, reg, + force_reg (V16QImode, x)), + UNSPEC_VPERM); + emit_insn (gen_rtx_SET (VOIDmode, target, x)); +} - /* Find the first transition. */ - lsb = c & -c; +/* Extract field ELT from VEC into TARGET. */ - /* Invert to look for a second transition. */ - c = ~c; +void +rs6000_expand_vector_extract (rtx target, rtx vec, int elt) +{ + enum machine_mode mode = GET_MODE (vec); + enum machine_mode inner_mode = GET_MODE_INNER (mode); + rtx mem, x; - /* Erase first transition. */ - c &= -lsb; + /* Allocate mode-sized buffer. */ + mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0); - /* Find the second transition. */ - lsb = c & -c; + /* Add offset to field within buffer matching vector element. */ + mem = adjust_address_nv (mem, mode, elt * GET_MODE_SIZE (inner_mode)); - /* Invert to look for a third transition. */ - c = ~c; - - /* Erase second transition. */ - c &= -lsb; - - /* Find the third transition (if any). */ - lsb = c & -c; - - /* Match if all the bits above are 1's (or c is zero). */ - return c == -lsb; - } - return 0; + /* Store single field into mode-sized buffer. */ + x = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (1, const0_rtx), UNSPEC_STVE); + emit_insn (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (2, + gen_rtx_SET (VOIDmode, + mem, vec), + x))); + emit_move_insn (target, adjust_address_nv (mem, inner_mode, 0)); } /* Generates shifts and masks for a pair of rldicl or rldicr insns to @@ -2182,8 +2509,7 @@ build_mask64_2_operands (rtx in, rtx *out) unsigned HOST_WIDE_INT c, lsb, m1, m2; int shift; - if (GET_CODE (in) != CONST_INT) - abort (); + gcc_assert (GET_CODE (in) == CONST_INT); c = INTVAL (in); if (c & 1) @@ -2239,203 +2565,73 @@ build_mask64_2_operands (rtx in, rtx *out) #else (void)in; (void)out; - abort (); + gcc_unreachable (); #endif } -/* Return 1 if the operand is either a non-special register or a constant - that can be used as the operand of a PowerPC64 logical AND insn. */ +/* Return TRUE if OP is an invalid SUBREG operation on the e500. */ -int -and64_operand (rtx op, enum machine_mode mode) +bool +invalid_e500_subreg (rtx op, enum machine_mode mode) { - if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */ - return (gpc_reg_operand (op, mode) || mask64_operand (op, mode)); + if (TARGET_E500_DOUBLE) + { + /* Reject (subreg:SI (reg:DF)). */ + if (GET_CODE (op) == SUBREG + && mode == SImode + && REG_P (SUBREG_REG (op)) + && GET_MODE (SUBREG_REG (op)) == DFmode) + return true; - return (logical_operand (op, mode) || mask64_operand (op, mode)); + /* Reject (subreg:DF (reg:DI)). */ + if (GET_CODE (op) == SUBREG + && mode == DFmode + && REG_P (SUBREG_REG (op)) + && GET_MODE (SUBREG_REG (op)) == DImode) + return true; + } + + if (TARGET_SPE + && GET_CODE (op) == SUBREG + && mode == SImode + && REG_P (SUBREG_REG (op)) + && SPE_VECTOR_MODE (GET_MODE (SUBREG_REG (op)))) + return true; + + return false; } -/* Like the above, but also match constants that can be implemented - with two rldicl or rldicr insns. */ - -int -and64_2_operand (rtx op, enum machine_mode mode) -{ - if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */ - return gpc_reg_operand (op, mode) || mask64_2_operand (op, mode); - - return logical_operand (op, mode) || mask64_2_operand (op, mode); -} - -/* Return 1 if the operand is either a non-special register or a - constant that can be used as the operand of an RS/6000 logical AND insn. */ - -int -and_operand (rtx op, enum machine_mode mode) -{ - if (fixed_regs[CR0_REGNO]) /* CR0 not available, don't do andi./andis. */ - return (gpc_reg_operand (op, mode) || mask_operand (op, mode)); - - return (logical_operand (op, mode) || mask_operand (op, mode)); -} - -/* Return 1 if the operand is a general register or memory operand. */ - -int -reg_or_mem_operand (rtx op, enum machine_mode mode) -{ - return (gpc_reg_operand (op, mode) - || memory_operand (op, mode) - || macho_lo_sum_memory_operand (op, mode) - || volatile_mem_operand (op, mode)); -} - -/* Return 1 if the operand is a general register or memory operand without - pre_inc or pre_dec which produces invalid form of PowerPC lwa - instruction. */ - -int -lwa_operand (rtx op, enum machine_mode mode) -{ - rtx inner = op; - - if (reload_completed && GET_CODE (inner) == SUBREG) - inner = SUBREG_REG (inner); - - return gpc_reg_operand (inner, mode) - || (memory_operand (inner, mode) - && GET_CODE (XEXP (inner, 0)) != PRE_INC - && GET_CODE (XEXP (inner, 0)) != PRE_DEC - && (GET_CODE (XEXP (inner, 0)) != PLUS - || GET_CODE (XEXP (XEXP (inner, 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0)); -} - -/* Return 1 if the operand, used inside a MEM, is a SYMBOL_REF. */ - -int -symbol_ref_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - - return (GET_CODE (op) == SYMBOL_REF - && (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))); -} - -/* Return 1 if the operand, used inside a MEM, is a valid first argument - to CALL. This is a SYMBOL_REF, a pseudo-register, LR or CTR. */ - -int -call_operand (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - - return (GET_CODE (op) == SYMBOL_REF - || (GET_CODE (op) == REG - && (REGNO (op) == LINK_REGISTER_REGNUM - || REGNO (op) == COUNT_REGISTER_REGNUM - || REGNO (op) >= FIRST_PSEUDO_REGISTER))); -} - -/* Return 1 if the operand is a SYMBOL_REF for a function known to be in - this file. */ - -int -current_file_function_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == SYMBOL_REF - && (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)) - && (SYMBOL_REF_LOCAL_P (op) - || (op == XEXP (DECL_RTL (current_function_decl), 0)))); -} - -/* Return 1 if this operand is a valid input for a move insn. */ - -int -input_operand (rtx op, enum machine_mode mode) -{ - /* Memory is always valid. */ - if (memory_operand (op, mode)) - return 1; - - /* Only a tiny bit of handling for CONSTANT_P_RTX is necessary. */ - if (GET_CODE (op) == CONSTANT_P_RTX) - return 1; - - /* For floating-point, easy constants are valid. */ - if (GET_MODE_CLASS (mode) == MODE_FLOAT - && CONSTANT_P (op) - && easy_fp_constant (op, mode)) - return 1; - - /* Allow any integer constant. */ - if (GET_MODE_CLASS (mode) == MODE_INT - && (GET_CODE (op) == CONST_INT - || GET_CODE (op) == CONST_DOUBLE)) - return 1; - - /* Allow easy vector constants. */ - if (GET_CODE (op) == CONST_VECTOR - && easy_vector_constant (op, mode)) - return 1; - - /* For floating-point or multi-word mode, the only remaining valid type - is a register. */ - if (GET_MODE_CLASS (mode) == MODE_FLOAT - || GET_MODE_SIZE (mode) > UNITS_PER_WORD) - return register_operand (op, mode); - - /* The only cases left are integral modes one word or smaller (we - do not get called for MODE_CC values). These can be in any - register. */ - if (register_operand (op, mode)) - return 1; - - /* A SYMBOL_REF referring to the TOC is valid. */ - if (legitimate_constant_pool_address_p (op)) - return 1; - - /* A constant pool expression (relative to the TOC) is valid */ - if (toc_relative_expr_p (op)) - return 1; - - /* V.4 allows SYMBOL_REFs and CONSTs that are in the small data region - to be valid. */ - if (DEFAULT_ABI == ABI_V4 - && (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST) - && small_data_operand (op, Pmode)) - return 1; - - return 0; -} - - /* Darwin, AIX increases natural record alignment to doubleword if the first field is an FP double while the FP fields remain word aligned. */ unsigned int -rs6000_special_round_type_align (tree type, int computed, int specified) +rs6000_special_round_type_align (tree type, unsigned int computed, + unsigned int specified) { + unsigned int align = MAX (computed, specified); tree field = TYPE_FIELDS (type); - /* Skip all the static variables only if ABI is greater than - 1 or equal to 0. */ - while (field != NULL && TREE_CODE (field) == VAR_DECL) + /* Skip all non field decls */ + while (field != NULL && TREE_CODE (field) != FIELD_DECL) field = TREE_CHAIN (field); - if (field == NULL || field == type || DECL_MODE (field) != DFmode) - return MAX (computed, specified); + if (field != NULL && field != type) + { + type = TREE_TYPE (field); + while (TREE_CODE (type) == ARRAY_TYPE) + type = TREE_TYPE (type); - return MAX (MAX (computed, specified), 64); + if (type != error_mark_node && TYPE_MODE (type) == DFmode) + align = MAX (align, 64); + } + + return align; } /* Return 1 for an operand in small memory on V.4/eabi. */ int -small_data_operand (rtx op ATTRIBUTE_UNUSED, +small_data_operand (rtx op ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED) { #if TARGET_ELF @@ -2462,10 +2658,10 @@ small_data_operand (rtx op ATTRIBUTE_UNUSED, HOST_WIDE_INT summand; /* We have to be careful here, because it is the referenced address - that must be 32k from _SDA_BASE_, not just the symbol. */ + that must be 32k from _SDA_BASE_, not just the symbol. */ summand = INTVAL (XEXP (sum, 1)); if (summand < 0 || (unsigned HOST_WIDE_INT) summand > g_switch_value) - return 0; + return 0; sym_ref = XEXP (sum, 0); } @@ -2476,27 +2672,6 @@ small_data_operand (rtx op ATTRIBUTE_UNUSED, #endif } -/* Return true, if operand is a memory operand and has a - displacement divisible by 4. */ - -int -word_offset_memref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - rtx addr; - int off = 0; - - if (!memory_operand (op, mode)) - return 0; - - addr = XEXP (op, 0); - if (GET_CODE (addr) == PLUS - && GET_CODE (XEXP (addr, 0)) == REG - && GET_CODE (XEXP (addr, 1)) == CONST_INT) - off = INTVAL (XEXP (addr, 1)); - - return (off % 4) == 0; -} - /* Return true if either operand is a general purpose register. */ bool @@ -2509,10 +2684,10 @@ gpr_or_gpr_p (rtx op0, rtx op1) /* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address. */ -static int -constant_pool_expr_1 (rtx op, int *have_sym, int *have_toc) +static int +constant_pool_expr_1 (rtx op, int *have_sym, int *have_toc) { - switch (GET_CODE(op)) + switch (GET_CODE (op)) { case SYMBOL_REF: if (RS6000_SYMBOL_REF_TLS_P (op)) @@ -2555,7 +2730,7 @@ constant_pool_expr_p (rtx op) return constant_pool_expr_1 (op, &have_sym, &have_toc) && have_sym; } -static bool +bool toc_relative_expr_p (rtx op) { int have_sym = 0; @@ -2563,9 +2738,6 @@ toc_relative_expr_p (rtx op) return constant_pool_expr_1 (op, &have_sym, &have_toc) && have_toc; } -/* SPE offset addressing is limited to 5-bits worth of double words. */ -#define SPE_CONST_OFFSET_OK(x) (((x) & ~0xf8) == 0) - bool legitimate_constant_pool_address_p (rtx x) { @@ -2585,8 +2757,11 @@ legitimate_small_data_p (enum machine_mode mode, rtx x) && small_data_operand (x, mode)); } -static bool -legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) +/* SPE offset addressing is limited to 5-bits worth of double words. */ +#define SPE_CONST_OFFSET_OK(x) (((x) & ~0xf8) == 0) + +bool +rs6000_legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) { unsigned HOST_WIDE_INT offset, extra; @@ -2596,6 +2771,8 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) return false; if (!INT_REG_OK_FOR_BASE_P (XEXP (x, 0), strict)) return false; + if (legitimate_constant_pool_address_p (x)) + return true; if (GET_CODE (XEXP (x, 1)) != CONST_INT) return false; @@ -2607,10 +2784,10 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) case V8HImode: case V4SFmode: case V4SImode: - /* AltiVec vector modes. Only reg+reg addressing is valid here, - which leaves the only valid constant offset of zero, which by - canonicalization rules is also invalid. */ - return false; + /* AltiVec vector modes. Only reg+reg addressing is valid and + constant offset zero should not occur due to canonicalization. + Allow any offset when not strict before reload. */ + return !strict; case V4HImode: case V2SImode: @@ -2620,7 +2797,18 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) return SPE_CONST_OFFSET_OK (offset); case DFmode: + if (TARGET_E500_DOUBLE) + return SPE_CONST_OFFSET_OK (offset); + case DImode: + /* On e500v2, we may have: + + (subreg:DF (mem:DI (plus (reg) (const_int))) 0). + + Which gets addressed with evldd instructions. */ + if (TARGET_E500_DOUBLE) + return SPE_CONST_OFFSET_OK (offset); + if (mode == DFmode || !TARGET_POWERPC64) extra = 4; else if (offset & 3) @@ -2652,31 +2840,38 @@ legitimate_indexed_address_p (rtx x, int strict) if (GET_CODE (x) != PLUS) return false; + op0 = XEXP (x, 0); op1 = XEXP (x, 1); - if (!REG_P (op0) || !REG_P (op1)) - return false; + /* Recognize the rtl generated by reload which we know will later be + replaced with proper base and index regs. */ + if (!strict + && reload_in_progress + && (REG_P (op0) || GET_CODE (op0) == PLUS) + && REG_P (op1)) + return true; - return ((INT_REG_OK_FOR_BASE_P (op0, strict) - && INT_REG_OK_FOR_INDEX_P (op1, strict)) - || (INT_REG_OK_FOR_BASE_P (op1, strict) - && INT_REG_OK_FOR_INDEX_P (op0, strict))); + return (REG_P (op0) && REG_P (op1) + && ((INT_REG_OK_FOR_BASE_P (op0, strict) + && INT_REG_OK_FOR_INDEX_P (op1, strict)) + || (INT_REG_OK_FOR_BASE_P (op1, strict) + && INT_REG_OK_FOR_INDEX_P (op0, strict)))); } -static inline bool +inline bool legitimate_indirect_address_p (rtx x, int strict) { return GET_CODE (x) == REG && INT_REG_OK_FOR_BASE_P (x, strict); } -static bool +bool macho_lo_sum_memory_operand (rtx x, enum machine_mode mode) { - if (!TARGET_MACHO || !flag_pic - || mode != SImode || GET_CODE(x) != MEM) - return false; - x = XEXP (x, 0); + if (!TARGET_MACHO || !flag_pic + || mode != SImode || GET_CODE (x) != MEM) + return false; + x = XEXP (x, 0); if (GET_CODE (x) != LO_SUM) return false; @@ -2698,6 +2893,9 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict) return false; if (!INT_REG_OK_FOR_BASE_P (XEXP (x, 0), strict)) return false; + /* Restrict addressing for DI because of our SUBREG hackery. */ + if (TARGET_E500_DOUBLE && (mode == DFmode || mode == DImode)) + return false; x = XEXP (x, 1); if (TARGET_ELF || TARGET_MACHO) @@ -2708,8 +2906,9 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict) return false; if (GET_MODE_NUNITS (mode) != 1) return false; - if (GET_MODE_BITSIZE (mode) > 32 - && !(TARGET_HARD_FLOAT && TARGET_FPRS && mode == DFmode)) + if (GET_MODE_BITSIZE (mode) > 64 + || (GET_MODE_BITSIZE (mode) > 32 && !TARGET_POWERPC64 + && !(TARGET_HARD_FLOAT && TARGET_FPRS && mode == DFmode))) return false; return CONSTANT_P (x); @@ -2753,11 +2952,11 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return rs6000_legitimize_tls_address (x, model); } - if (GET_CODE (x) == PLUS + if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == REG && GET_CODE (XEXP (x, 1)) == CONST_INT && (unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000) >= 0x10000) - { + { HOST_WIDE_INT high_int, low_int; rtx sum; low_int = ((INTVAL (XEXP (x, 1)) & 0xffff) ^ 0x8000) - 0x8000; @@ -2766,13 +2965,14 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, GEN_INT (high_int)), 0); return gen_rtx_PLUS (Pmode, sum, GEN_INT (low_int)); } - else if (GET_CODE (x) == PLUS + else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == REG && GET_CODE (XEXP (x, 1)) != CONST_INT && GET_MODE_NUNITS (mode) == 1 && ((TARGET_HARD_FLOAT && TARGET_FPRS) || TARGET_POWERPC64 - || (mode != DFmode && mode != TFmode)) + || (((mode != DImode && mode != DFmode) || TARGET_E500_DOUBLE) + && mode != TFmode)) && (TARGET_POWERPC64 || mode != DImode) && mode != TImode) { @@ -2791,24 +2991,28 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, reg = force_reg (Pmode, x); return reg; } - else if (SPE_VECTOR_MODE (mode)) + else if (SPE_VECTOR_MODE (mode) + || (TARGET_E500_DOUBLE && (mode == DFmode + || mode == DImode))) { + if (mode == DImode) + return NULL_RTX; /* We accept [reg + reg] and [reg + OFFSET]. */ if (GET_CODE (x) == PLUS) - { - rtx op1 = XEXP (x, 0); - rtx op2 = XEXP (x, 1); + { + rtx op1 = XEXP (x, 0); + rtx op2 = XEXP (x, 1); - op1 = force_reg (Pmode, op1); + op1 = force_reg (Pmode, op1); - if (GET_CODE (op2) != REG - && (GET_CODE (op2) != CONST_INT - || !SPE_CONST_OFFSET_OK (INTVAL (op2)))) - op2 = force_reg (Pmode, op2); + if (GET_CODE (op2) != REG + && (GET_CODE (op2) != CONST_INT + || !SPE_CONST_OFFSET_OK (INTVAL (op2)))) + op2 = force_reg (Pmode, op2); - return gen_rtx_PLUS (Pmode, op1, op2); - } + return gen_rtx_PLUS (Pmode, op1, op2); + } return force_reg (Pmode, x); } @@ -2817,7 +3021,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && TARGET_NO_TOC && ! flag_pic && GET_CODE (x) != CONST_INT - && GET_CODE (x) != CONST_DOUBLE + && GET_CODE (x) != CONST_DOUBLE && CONSTANT_P (x) && GET_MODE_NUNITS (mode) == 1 && (GET_MODE_BITSIZE (mode) <= 32 @@ -2833,17 +3037,17 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && ! MACHO_DYNAMIC_NO_PIC_P #endif && GET_CODE (x) != CONST_INT - && GET_CODE (x) != CONST_DOUBLE + && GET_CODE (x) != CONST_DOUBLE && CONSTANT_P (x) && ((TARGET_HARD_FLOAT && TARGET_FPRS) || mode != DFmode) - && mode != DImode + && mode != DImode && mode != TImode) { rtx reg = gen_reg_rtx (Pmode); emit_insn (gen_macho_high (reg, x)); return gen_rtx_LO_SUM (Pmode, reg, x); } - else if (TARGET_TOC + else if (TARGET_TOC && constant_pool_expr_p (x) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), Pmode)) { @@ -2853,10 +3057,10 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return NULL_RTX; } -/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. +/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. We need to emit DTP-relative relocations. */ -void +static void rs6000_output_dwarf_dtprel (FILE *file, int size, rtx x) { switch (size) @@ -2868,7 +3072,7 @@ rs6000_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs (DOUBLE_INT_ASM_OP, file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs ("@dtprel+0x8000", file); @@ -2897,7 +3101,7 @@ rs6000_got_sym (void) rs6000_got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); SYMBOL_REF_FLAGS (rs6000_got_symbol) |= SYMBOL_FLAG_LOCAL; SYMBOL_REF_FLAGS (rs6000_got_symbol) |= SYMBOL_FLAG_EXTERNAL; - } + } return rs6000_got_symbol; } @@ -2953,6 +3157,11 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) { rtx r3, got, tga, tmp1, tmp2, eqv; + /* We currently use relocations like @got@tlsgd for tls, which + means the linker will handle allocation of tls entries, placing + them in the .got section. So use a pointer to the .got section, + not one to secondary TOC sections used by 64-bit -mminimal-toc, + or to secondary GOT sections used by 32-bit -fPIC. */ if (TARGET_64BIT) got = gen_rtx_REG (Pmode, 2); else @@ -2974,8 +3183,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) tmp1 = gen_reg_rtx (Pmode); tmp2 = gen_reg_rtx (Pmode); tmp3 = gen_reg_rtx (Pmode); - mem = gen_rtx_MEM (Pmode, tmp1); - RTX_UNCHANGING_P (mem) = 1; + mem = gen_const_mem (Pmode, tmp1); first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, gsym)); emit_move_insn (tmp1, tempLR); @@ -3083,15 +3291,6 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) return dest; } -/* Return 1 if X is a SYMBOL_REF for a TLS symbol. This is used in - instruction definitions. */ - -int -rs6000_tls_symbol_ref (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return RS6000_SYMBOL_REF_TLS_P (x); -} - /* Return 1 if X contains a thread-local symbol. */ bool @@ -3106,7 +3305,7 @@ rs6000_tls_referenced_p (rtx x) /* Return 1 if *X is a thread-local symbol. This is the same as rs6000_tls_symbol_ref except for the type of the unused argument. */ -static inline int +static int rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) { return RS6000_SYMBOL_REF_TLS_P (*x); @@ -3133,10 +3332,11 @@ rs6000_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) The Darwin code is inside #if TARGET_MACHO because only then is machopic_function_base_name() defined. */ rtx -rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, - int opnum, int type, int ind_levels ATTRIBUTE_UNUSED, int *win) +rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, + int opnum, int type, + int ind_levels ATTRIBUTE_UNUSED, int *win) { - /* We must recognize output that we have already generated ourselves. */ + /* We must recognize output that we have already generated ourselves. */ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == PLUS && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG @@ -3144,8 +3344,8 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, && GET_CODE (XEXP (x, 1)) == CONST_INT) { push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, - BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, - opnum, (enum reload_type)type); + BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, + opnum, (enum reload_type)type); *win = 1; return x; } @@ -3165,8 +3365,8 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, /* Result of previous invocation of this function on Darwin floating point constant. */ push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, - BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, + opnum, (enum reload_type)type); *win = 1; return x; } @@ -3180,6 +3380,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, && REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode) && GET_CODE (XEXP (x, 1)) == CONST_INT && (INTVAL (XEXP (x, 1)) & 3) != 0 + && !ALTIVEC_VECTOR_MODE (mode) && GET_MODE_SIZE (mode) >= UNITS_PER_WORD && TARGET_POWERPC64) { @@ -3197,56 +3398,69 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, && REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode) && GET_CODE (XEXP (x, 1)) == CONST_INT && !SPE_VECTOR_MODE (mode) + && !(TARGET_E500_DOUBLE && (mode == DFmode + || mode == DImode)) && !ALTIVEC_VECTOR_MODE (mode)) { HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; HOST_WIDE_INT high - = (((val - low) & 0xffffffff) ^ 0x80000000) - 0x80000000; + = (((val - low) & 0xffffffff) ^ 0x80000000) - 0x80000000; /* Check for 32-bit overflow. */ if (high + low != val) - { + { *win = 0; return x; } /* Reload the high part into a base reg; leave the low part - in the mem directly. */ + in the mem directly. */ x = gen_rtx_PLUS (GET_MODE (x), - gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), - GEN_INT (high)), - GEN_INT (low)); + gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), + GEN_INT (high)), + GEN_INT (low)); push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, - BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, - opnum, (enum reload_type)type); + BASE_REG_CLASS, GET_MODE (x), VOIDmode, 0, 0, + opnum, (enum reload_type)type); *win = 1; return x; } -#if TARGET_MACHO if (GET_CODE (x) == SYMBOL_REF - && DEFAULT_ABI == ABI_DARWIN && !ALTIVEC_VECTOR_MODE (mode) + && !SPE_VECTOR_MODE (mode) +#if TARGET_MACHO + && DEFAULT_ABI == ABI_DARWIN && (flag_pic || MACHO_DYNAMIC_NO_PIC_P) - /* Don't do this for TFmode, since the result isn't offsettable. */ - && mode != TFmode) +#else + && DEFAULT_ABI == ABI_V4 + && !flag_pic +#endif + /* Don't do this for TFmode, since the result isn't offsettable. + The same goes for DImode without 64-bit gprs and DFmode + without fprs. */ + && mode != TFmode + && (mode != DImode || TARGET_POWERPC64) + && (mode != DFmode || TARGET_POWERPC64 + || (TARGET_FPRS && TARGET_HARD_FLOAT))) { +#if TARGET_MACHO if (flag_pic) { rtx offset = gen_rtx_CONST (Pmode, gen_rtx_MINUS (Pmode, x, - gen_rtx_SYMBOL_REF (Pmode, - machopic_function_base_name ()))); + machopic_function_base_sym ())); x = gen_rtx_LO_SUM (GET_MODE (x), gen_rtx_PLUS (Pmode, pic_offset_table_rtx, gen_rtx_HIGH (Pmode, offset)), offset); } else +#endif x = gen_rtx_LO_SUM (GET_MODE (x), - gen_rtx_HIGH (Pmode, x), x); + gen_rtx_HIGH (Pmode, x), x); push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, @@ -3254,19 +3468,35 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, *win = 1; return x; } -#endif + + /* Reload an offset address wrapped by an AND that represents the + masking of the lower bits. Strip the outer AND and let reload + convert the offset address into an indirect address. */ + if (TARGET_ALTIVEC + && ALTIVEC_VECTOR_MODE (mode) + && GET_CODE (x) == AND + && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == REG + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT + && GET_CODE (XEXP (x, 1)) == CONST_INT + && INTVAL (XEXP (x, 1)) == -16) + { + x = XEXP (x, 0); + *win = 1; + return x; + } if (TARGET_TOC && constant_pool_expr_p (x) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (x), mode)) { - (x) = create_TOC_reference (x); + x = create_TOC_reference (x); *win = 1; return x; } *win = 0; return x; -} +} /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a valid memory address for an instruction. @@ -3282,12 +3512,20 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, word aligned. For modes spanning multiple registers (DFmode in 32-bit GPRs, - 32-bit DImode, TImode), indexed addressing cannot be used because + 32-bit DImode, TImode, TFmode), indexed addressing cannot be used because adjacent memory cells are accessed by adding word-sized offsets during assembly output. */ int rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict) { + /* If this is an unaligned stvx/ldvx type address, discard the outer AND. */ + if (TARGET_ALTIVEC + && ALTIVEC_VECTOR_MODE (mode) + && GET_CODE (x) == AND + && GET_CODE (XEXP (x, 1)) == CONST_INT + && INTVAL (XEXP (x, 1)) == -16) + x = XEXP (x, 0); + if (RS6000_SYMBOL_REF_TLS_P (x)) return 0; if (legitimate_indirect_address_p (x, reg_ok_strict)) @@ -3295,6 +3533,9 @@ rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict) if ((GET_CODE (x) == PRE_INC || GET_CODE (x) == PRE_DEC) && !ALTIVEC_VECTOR_MODE (mode) && !SPE_VECTOR_MODE (mode) + && mode != TFmode + /* Restrict addressing for DI because of our SUBREG hackery. */ + && !(TARGET_E500_DOUBLE && (mode == DFmode || mode == DImode)) && TARGET_UPDATE && legitimate_indirect_address_p (XEXP (x, 0), reg_ok_strict)) return 1; @@ -3310,12 +3551,13 @@ rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict) || XEXP (x, 0) == arg_pointer_rtx) && GET_CODE (XEXP (x, 1)) == CONST_INT) return 1; - if (legitimate_offset_address_p (mode, x, reg_ok_strict)) + if (rs6000_legitimate_offset_address_p (mode, x, reg_ok_strict)) return 1; if (mode != TImode + && mode != TFmode && ((TARGET_HARD_FLOAT && TARGET_FPRS) || TARGET_POWERPC64 - || (mode != DFmode && mode != TFmode)) + || ((mode != DFmode || TARGET_E500_DOUBLE) && mode != TFmode)) && (TARGET_POWERPC64 || mode != DImode) && legitimate_indexed_address_p (x, reg_ok_strict)) return 1; @@ -3332,7 +3574,7 @@ rs6000_legitimate_address (enum machine_mode mode, rtx x, int reg_ok_strict) ??? Except that due to conceptual problems in offsettable_address_p we can't really report the problems of integral offsets. So leave - this assuming that the adjustable offset must be valid for the + this assuming that the adjustable offset must be valid for the sub-words of a TFmode operand, which is what we had before. */ bool @@ -3361,6 +3603,142 @@ rs6000_mode_dependent_address (rtx addr) return false; } + +/* More elaborate version of recog's offsettable_memref_p predicate + that works around the ??? note of rs6000_mode_dependent_address. + In particular it accepts + + (mem:DI (plus:SI (reg/f:SI 31 31) (const_int 32760 [0x7ff8]))) + + in 32-bit mode, that the recog predicate rejects. */ + +bool +rs6000_offsettable_memref_p (rtx op) +{ + if (!MEM_P (op)) + return false; + + /* First mimic offsettable_memref_p. */ + if (offsettable_address_p (1, GET_MODE (op), XEXP (op, 0))) + return true; + + /* offsettable_address_p invokes rs6000_mode_dependent_address, but + the latter predicate knows nothing about the mode of the memory + reference and, therefore, assumes that it is the largest supported + mode (TFmode). As a consequence, legitimate offsettable memory + references are rejected. rs6000_legitimate_offset_address_p contains + the correct logic for the PLUS case of rs6000_mode_dependent_address. */ + return rs6000_legitimate_offset_address_p (GET_MODE (op), XEXP (op, 0), 1); +} + +/* Return number of consecutive hard regs needed starting at reg REGNO + to hold something of mode MODE. + This is ordinarily the length in words of a value of mode MODE + but can be less for certain modes in special long registers. + + For the SPE, GPRs are 64 bits but only 32 bits are visible in + scalar instructions. The upper 32 bits are only available to the + SIMD instructions. + + POWER and PowerPC GPRs hold 32 bits worth; + PowerPC64 GPRs and FPRs point register holds 64 bits worth. */ + +int +rs6000_hard_regno_nregs (int regno, enum machine_mode mode) +{ + if (FP_REGNO_P (regno)) + return (GET_MODE_SIZE (mode) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD; + + if (SPE_SIMD_REGNO_P (regno) && TARGET_SPE && SPE_VECTOR_MODE (mode)) + return (GET_MODE_SIZE (mode) + UNITS_PER_SPE_WORD - 1) / UNITS_PER_SPE_WORD; + + if (ALTIVEC_REGNO_P (regno)) + return + (GET_MODE_SIZE (mode) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD; + + /* The value returned for SCmode in the E500 double case is 2 for + ABI compatibility; storing an SCmode value in a single register + would require function_arg and rs6000_spe_function_arg to handle + SCmode so as to pass the value correctly in a pair of + registers. */ + if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode) + return (GET_MODE_SIZE (mode) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD; + + return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; +} + +/* Change register usage conditional on target flags. */ +void +rs6000_conditional_register_usage (void) +{ + int i; + + /* Set MQ register fixed (already call_used) if not POWER + architecture (RIOS1, RIOS2, RSC, and PPC601) so that it will not + be allocated. */ + if (! TARGET_POWER) + fixed_regs[64] = 1; + + /* 64-bit AIX and Linux reserve GPR13 for thread-private data. */ + if (TARGET_64BIT) + fixed_regs[13] = call_used_regs[13] + = call_really_used_regs[13] = 1; + + /* Conditionally disable FPRs. */ + if (TARGET_SOFT_FLOAT || !TARGET_FPRS) + for (i = 32; i < 64; i++) + fixed_regs[i] = call_used_regs[i] + = call_really_used_regs[i] = 1; + + /* The TOC register is not killed across calls in a way that is + visible to the compiler. */ + if (DEFAULT_ABI == ABI_AIX) + call_really_used_regs[2] = 0; + + if (DEFAULT_ABI == ABI_V4 + && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM + && flag_pic == 2) + fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; + + if (DEFAULT_ABI == ABI_V4 + && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM + && flag_pic == 1) + fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] + = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] + = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; + + if (DEFAULT_ABI == ABI_DARWIN + && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) + fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] + = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] + = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; + + if (TARGET_TOC && TARGET_MINIMAL_TOC) + fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] + = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; + + if (TARGET_ALTIVEC) + global_regs[VSCR_REGNO] = 1; + + if (TARGET_SPE) + { + global_regs[SPEFSCR_REGNO] = 1; + fixed_regs[FIXED_SCRATCH] + = call_used_regs[FIXED_SCRATCH] + = call_really_used_regs[FIXED_SCRATCH] = 1; + } + + if (! TARGET_ALTIVEC) + { + for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i) + fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; + call_really_used_regs[VRSAVE_REGNO] = 1; + } + + if (TARGET_ALTIVEC_ABI) + for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i) + call_used_regs[i] = call_really_used_regs[i] = 1; +} /* Try to output insns to set TARGET equal to the constant C if it can be done in less than N insns. Do all computations in MODE. @@ -3369,21 +3747,22 @@ rs6000_mode_dependent_address (rtx addr) insns, zero is returned and no insns and emitted. */ rtx -rs6000_emit_set_const (rtx dest, enum machine_mode mode, +rs6000_emit_set_const (rtx dest, enum machine_mode mode, rtx source, int n ATTRIBUTE_UNUSED) { rtx result, insn, set; HOST_WIDE_INT c0, c1; - if (mode == QImode || mode == HImode) + switch (mode) { + case QImode: + case HImode: if (dest == NULL) - dest = gen_reg_rtx (mode); + dest = gen_reg_rtx (mode); emit_insn (gen_rtx_SET (VOIDmode, dest, source)); return dest; - } - else if (mode == SImode) - { + + case SImode: result = no_new_pseudos ? dest : gen_reg_rtx (SImode); emit_insn (gen_rtx_SET (VOIDmode, result, @@ -3393,16 +3772,17 @@ rs6000_emit_set_const (rtx dest, enum machine_mode mode, gen_rtx_IOR (SImode, result, GEN_INT (INTVAL (source) & 0xffff)))); result = dest; - } - else if (mode == DImode) - { - if (GET_CODE (source) == CONST_INT) + break; + + case DImode: + switch (GET_CODE (source)) { + case CONST_INT: c0 = INTVAL (source); c1 = -(c0 < 0); - } - else if (GET_CODE (source) == CONST_DOUBLE) - { + break; + + case CONST_DOUBLE: #if HOST_BITS_PER_WIDE_INT >= 64 c0 = CONST_DOUBLE_LOW (source); c1 = -(c0 < 0); @@ -3410,14 +3790,18 @@ rs6000_emit_set_const (rtx dest, enum machine_mode mode, c0 = CONST_DOUBLE_LOW (source); c1 = CONST_DOUBLE_HIGH (source); #endif + break; + + default: + gcc_unreachable (); } - else - abort (); result = rs6000_emit_set_long_const (dest, c0, c1); + break; + + default: + gcc_unreachable (); } - else - abort (); insn = get_last_insn (); set = single_set (insn); @@ -3457,7 +3841,7 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) ud3 = c2 & 0xffff; ud4 = (c2 & 0xffff0000) >> 16; - if ((ud4 == 0xffff && ud3 == 0xffff && ud2 == 0xffff && (ud1 & 0x8000)) + if ((ud4 == 0xffff && ud3 == 0xffff && ud2 == 0xffff && (ud1 & 0x8000)) || (ud4 == 0 && ud3 == 0 && ud2 == 0 && ! (ud1 & 0x8000))) { if (ud1 & 0x8000) @@ -3466,22 +3850,22 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) emit_move_insn (dest, GEN_INT (ud1)); } - else if ((ud4 == 0xffff && ud3 == 0xffff && (ud2 & 0x8000)) + else if ((ud4 == 0xffff && ud3 == 0xffff && (ud2 & 0x8000)) || (ud4 == 0 && ud3 == 0 && ! (ud2 & 0x8000))) { if (ud2 & 0x8000) - emit_move_insn (dest, GEN_INT (((ud2 << 16) ^ 0x80000000) + emit_move_insn (dest, GEN_INT (((ud2 << 16) ^ 0x80000000) - 0x80000000)); else emit_move_insn (dest, GEN_INT (ud2 << 16)); if (ud1 != 0) emit_move_insn (dest, gen_rtx_IOR (DImode, dest, GEN_INT (ud1))); } - else if ((ud4 == 0xffff && (ud3 & 0x8000)) + else if ((ud4 == 0xffff && (ud3 & 0x8000)) || (ud4 == 0 && ! (ud3 & 0x8000))) { if (ud3 & 0x8000) - emit_move_insn (dest, GEN_INT (((ud3 << 16) ^ 0x80000000) + emit_move_insn (dest, GEN_INT (((ud3 << 16) ^ 0x80000000) - 0x80000000)); else emit_move_insn (dest, GEN_INT (ud3 << 16)); @@ -3492,10 +3876,10 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) if (ud1 != 0) emit_move_insn (dest, gen_rtx_IOR (DImode, dest, GEN_INT (ud1))); } - else + else { if (ud4 & 0x8000) - emit_move_insn (dest, GEN_INT (((ud4 << 16) ^ 0x80000000) + emit_move_insn (dest, GEN_INT (((ud4 << 16) ^ 0x80000000) - 0x80000000)); else emit_move_insn (dest, GEN_INT (ud4 << 16)); @@ -3505,8 +3889,8 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) emit_move_insn (dest, gen_rtx_ASHIFT (DImode, dest, GEN_INT (32))); if (ud2 != 0) - emit_move_insn (dest, gen_rtx_IOR (DImode, dest, - GEN_INT (ud2 << 16))); + emit_move_insn (dest, gen_rtx_IOR (DImode, dest, + GEN_INT (ud2 << 16))); if (ud1 != 0) emit_move_insn (dest, gen_rtx_IOR (DImode, dest, GEN_INT (ud1))); } @@ -3514,6 +3898,29 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2) return dest; } +/* Helper for the following. Get rid of [r+r] memory refs + in cases where it won't work (TImode, TFmode). */ + +static void +rs6000_eliminate_indexed_memrefs (rtx operands[2]) +{ + if (GET_CODE (operands[0]) == MEM + && GET_CODE (XEXP (operands[0], 0)) != REG + && ! legitimate_constant_pool_address_p (XEXP (operands[0], 0)) + && ! reload_in_progress) + operands[0] + = replace_equiv_address (operands[0], + copy_addr_to_reg (XEXP (operands[0], 0))); + + if (GET_CODE (operands[1]) == MEM + && GET_CODE (XEXP (operands[1], 0)) != REG + && ! legitimate_constant_pool_address_p (XEXP (operands[1], 0)) + && ! reload_in_progress) + operands[1] + = replace_equiv_address (operands[1], + copy_addr_to_reg (XEXP (operands[1], 0))); +} + /* Emit a move from SOURCE to DEST in mode MODE. */ void rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) @@ -3521,7 +3928,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) rtx operands[2]; operands[0] = dest; operands[1] = source; - + /* Sanity checks. Check that we get CONST_DOUBLE only when we should. */ if (GET_CODE (operands[1]) == CONST_DOUBLE && ! FLOAT_MODE_P (mode) @@ -3532,13 +3939,12 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) to a CONST_INT. */ operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), mode); } - if (GET_CODE (operands[1]) == CONST_DOUBLE - && ! FLOAT_MODE_P (mode) - && ((CONST_DOUBLE_HIGH (operands[1]) == 0 - && CONST_DOUBLE_LOW (operands[1]) >= 0) - || (CONST_DOUBLE_HIGH (operands[1]) == -1 - && CONST_DOUBLE_LOW (operands[1]) < 0))) - abort (); + gcc_assert (GET_CODE (operands[1]) != CONST_DOUBLE + || FLOAT_MODE_P (mode) + || ((CONST_DOUBLE_HIGH (operands[1]) != 0 + || CONST_DOUBLE_LOW (operands[1]) < 0) + && (CONST_DOUBLE_HIGH (operands[1]) != -1 + || CONST_DOUBLE_LOW (operands[1]) >= 0))); /* Check if GCC is setting up a block move that will end up using FP registers as temporaries. We must make sure this is acceptable. */ @@ -3550,7 +3956,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) && ! (SLOW_UNALIGNED_ACCESS (SImode, (MEM_ALIGN (operands[0]) > 32 ? 32 : MEM_ALIGN (operands[0]))) || SLOW_UNALIGNED_ACCESS (SImode, (MEM_ALIGN (operands[1]) > 32 - ? 32 + ? 32 : MEM_ALIGN (operands[1])))) && ! MEM_VOLATILE_P (operands [0]) && ! MEM_VOLATILE_P (operands [1])) @@ -3561,23 +3967,10 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) adjust_address (operands[1], SImode, 4)); return; } - - if (!no_new_pseudos) - { - if (GET_CODE (operands[1]) == MEM && optimize > 0 - && (mode == QImode || mode == HImode || mode == SImode) - && GET_MODE_SIZE (mode) < GET_MODE_SIZE (word_mode)) - { - rtx reg = gen_reg_rtx (word_mode); - emit_insn (gen_rtx_SET (word_mode, reg, - gen_rtx_ZERO_EXTEND (word_mode, - operands[1]))); - operands[1] = gen_lowpart (mode, reg); - } - if (GET_CODE (operands[0]) != REG) - operands[1] = force_reg (mode, operands[1]); - } + if (!no_new_pseudos && GET_CODE (operands[0]) == MEM + && !gpc_reg_operand (operands[1], mode)) + operands[1] = force_reg (mode, operands[1]); if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS @@ -3591,7 +3984,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) regnum = REGNO (operands[1]); else regnum = -1; - + /* If operands[1] is a register, on POWER it may have double-precision data in it, so truncate it to single precision. */ @@ -3606,11 +3999,29 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* Recognize the case where operand[1] is a reference to thread-local data and load its address to a register. */ - if (GET_CODE (operands[1]) == SYMBOL_REF) + if (rs6000_tls_referenced_p (operands[1])) { - enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); - if (model != 0) - operands[1] = rs6000_legitimize_tls_address (operands[1], model); + enum tls_model model; + rtx tmp = operands[1]; + rtx addend = NULL; + + if (GET_CODE (tmp) == CONST && GET_CODE (XEXP (tmp, 0)) == PLUS) + { + addend = XEXP (XEXP (tmp, 0), 1); + tmp = XEXP (XEXP (tmp, 0), 0); + } + + gcc_assert (GET_CODE (tmp) == SYMBOL_REF); + model = SYMBOL_REF_TLS_MODEL (tmp); + gcc_assert (model != 0); + + tmp = rs6000_legitimize_tls_address (tmp, model); + if (addend) + { + tmp = gen_rtx_PLUS (mode, tmp, addend); + tmp = force_operand (tmp, operands[0]); + } + operands[1] = tmp; } /* Handle the case where reload calls us with an invalid address. */ @@ -3619,14 +4030,9 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) || ! nonimmediate_operand (operands[0], mode))) goto emit_set; - /* Handle the case of CONSTANT_P_RTX. */ - if (GET_CODE (operands[1]) == CONSTANT_P_RTX) - goto emit_set; - /* 128-bit constant floating-point values on Darwin should really be loaded as two parts. */ - if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128 + if (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128 && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE) { /* DImode is used, not DFmode, because simplify_gen_subreg doesn't @@ -3655,13 +4061,16 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) break; case TFmode: + rs6000_eliminate_indexed_memrefs (operands); + /* fall through */ + case DFmode: case SFmode: - if (CONSTANT_P (operands[1]) + if (CONSTANT_P (operands[1]) && ! easy_fp_constant (operands[1], mode)) operands[1] = force_const_mem (mode, operands[1]); break; - + case V16QImode: case V8HImode: case V4SFmode: @@ -3674,14 +4083,14 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) && !easy_vector_constant (operands[1], mode)) operands[1] = force_const_mem (mode, operands[1]); break; - + case SImode: case DImode: /* Use default pattern for address of ELF small data */ if (TARGET_ELF && mode == Pmode && DEFAULT_ABI == ABI_V4 - && (GET_CODE (operands[1]) == SYMBOL_REF + && (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) && small_data_operand (operands[1], mode)) { @@ -3722,7 +4131,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) = CONSTANT_POOL_ADDRESS_P (operands[1]); SYMBOL_REF_FLAGS (new_ref) = SYMBOL_REF_FLAGS (operands[1]); SYMBOL_REF_USED (new_ref) = SYMBOL_REF_USED (operands[1]); - SYMBOL_REF_DECL (new_ref) = SYMBOL_REF_DECL (operands[1]); + SYMBOL_REF_DATA (new_ref) = SYMBOL_REF_DATA (operands[1]); operands[1] = new_ref; } @@ -3736,7 +4145,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) operands[1], mode, operands[0]); if (operands[0] != operands[1]) emit_insn (gen_rtx_SET (VOIDmode, - operands[0], operands[1])); + operands[0], operands[1])); return; } #endif @@ -3821,35 +4230,23 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) operands[1] = force_const_mem (mode, operands[1]); - if (TARGET_TOC + if (TARGET_TOC && constant_pool_expr_p (XEXP (operands[1], 0)) && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P ( get_pool_constant (XEXP (operands[1], 0)), get_pool_mode (XEXP (operands[1], 0)))) { operands[1] - = gen_rtx_MEM (mode, - create_TOC_reference (XEXP (operands[1], 0))); + = gen_const_mem (mode, + create_TOC_reference (XEXP (operands[1], 0))); set_mem_alias_set (operands[1], get_TOC_alias_set ()); - RTX_UNCHANGING_P (operands[1]) = 1; } } break; case TImode: - if (GET_CODE (operands[0]) == MEM - && GET_CODE (XEXP (operands[0], 0)) != REG - && ! reload_in_progress) - operands[0] - = replace_equiv_address (operands[0], - copy_addr_to_reg (XEXP (operands[0], 0))); + rs6000_eliminate_indexed_memrefs (operands); - if (GET_CODE (operands[1]) == MEM - && GET_CODE (XEXP (operands[1], 0)) != REG - && ! reload_in_progress) - operands[1] - = replace_equiv_address (operands[1], - copy_addr_to_reg (XEXP (operands[1], 0))); if (TARGET_POWER) { emit_insn (gen_rtx_PARALLEL (VOIDmode, @@ -3863,7 +4260,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } /* Above, we may have called force_const_mem which may have returned @@ -3878,7 +4275,8 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* Nonzero if we can use a floating-point register to pass this arg. */ #define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \ - (GET_MODE_CLASS (MODE) == MODE_FLOAT \ + (SCALAR_FLOAT_MODE_P (MODE) \ + && !DECIMAL_FLOAT_MODE_P (MODE) \ && (CUM)->fregno <= FP_ARG_MAX_REG \ && TARGET_HARD_FLOAT && TARGET_FPRS) @@ -3898,7 +4296,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) returned in memory. The Darwin ABI does the same. The SVR4 ABI specifies that structures <= 8 bytes are returned in r3/r4, but a draft put them in memory, and GCC used to implement the draft - instead of the final standard. Therefore, TARGET_AIX_STRUCT_RET + instead of the final standard. Therefore, aix_struct_return controls this instead of DEFAULT_ABI; V.4 targets needing backward compatibility can change DRAFT_V4_STRUCT_RET to override the default, and -m switches get the final word. See @@ -3913,12 +4311,54 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) static bool rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) { + /* In the darwin64 abi, try to use registers for larger structs + if possible. */ + if (rs6000_darwin64_abi + && TREE_CODE (type) == RECORD_TYPE + && int_size_in_bytes (type) > 0) + { + CUMULATIVE_ARGS valcum; + rtx valret; + + valcum.words = 0; + valcum.fregno = FP_ARG_MIN_REG; + valcum.vregno = ALTIVEC_ARG_MIN_REG; + /* Do a trial code generation as if this were going to be passed + as an argument; if any part goes in memory, we return NULL. */ + valret = rs6000_darwin64_record_arg (&valcum, type, 1, true); + if (valret) + return false; + /* Otherwise fall through to more conventional ABI rules. */ + } + if (AGGREGATE_TYPE_P (type) - && (TARGET_AIX_STRUCT_RET + && (aix_struct_return || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8)) return true; - if (DEFAULT_ABI == ABI_V4 && TYPE_MODE (type) == TFmode) + + /* Allow -maltivec -mabi=no-altivec without warning. Altivec vector + modes only exist for GCC vector types if -maltivec. */ + if (TARGET_32BIT && !TARGET_ALTIVEC_ABI + && ALTIVEC_VECTOR_MODE (TYPE_MODE (type))) + return false; + + /* Return synthetic vectors in memory. */ + if (TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) > (TARGET_ALTIVEC_ABI ? 16 : 8)) + { + static bool warned_for_return_big_vectors = false; + if (!warned_for_return_big_vectors) + { + warning (0, "GCC vector returned by reference: " + "non-standard ABI extension with no compatibility guarantee"); + warned_for_return_big_vectors = true; + } + return true; + } + + if (DEFAULT_ABI == ABI_V4 && TARGET_IEEEQUAD && TYPE_MODE (type) == TFmode) return true; + return false; } @@ -3930,7 +4370,7 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) so we never return a PARALLEL. */ void -init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, +init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname ATTRIBUTE_UNUSED, int incoming, int libcall, int n_named_args) { @@ -3976,18 +4416,29 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, fprintf (stderr, " proto = %d, nargs = %d\n", cum->prototype, cum->nargs_prototype); } - - if (fntype - && !TARGET_ALTIVEC - && TARGET_ALTIVEC_ABI - && ALTIVEC_VECTOR_MODE (TYPE_MODE (TREE_TYPE (fntype)))) - { - error ("Cannot return value in vector register because" - " altivec instructions are disabled, use -maltivec" - " to enable them."); - } + + if (fntype + && !TARGET_ALTIVEC + && TARGET_ALTIVEC_ABI + && ALTIVEC_VECTOR_MODE (TYPE_MODE (TREE_TYPE (fntype)))) + { + error ("cannot return value in vector register because" + " altivec instructions are disabled, use -maltivec" + " to enable them"); + } } +/* Return true if TYPE must be passed on the stack and not in registers. */ + +static bool +rs6000_must_pass_in_stack (enum machine_mode mode, tree type) +{ + if (DEFAULT_ABI == ABI_AIX || TARGET_64BIT) + return must_pass_in_stack_var_size (mode, type); + else + return must_pass_in_stack_var_size_or_pad (mode, type); +} + /* If defined, a C expression which determines whether, and in which direction, to pad out an argument with extra space. The value should be of type `enum direction': either `upward' to pad above @@ -4011,7 +4462,7 @@ function_arg_padding (enum machine_mode mode, tree type) { /* GCC used to pass structures of the same size as integer types as if they were in fact integers, ignoring FUNCTION_ARG_PADDING. - ie. Structures of size 1 or 2 (or 4 when TARGET_64BIT) were + i.e. Structures of size 1 or 2 (or 4 when TARGET_64BIT) were passed padded downward, except that -mstrict-align further muddied the water in that multi-component structures of 2 and 4 bytes in size were passed padded upward. @@ -4047,24 +4498,58 @@ function_arg_padding (enum machine_mode mode, tree type) } /* If defined, a C expression that gives the alignment boundary, in bits, - of an argument with the specified mode and type. If it is not defined, + of an argument with the specified mode and type. If it is not defined, PARM_BOUNDARY is used for all arguments. - - V.4 wants long longs to be double word aligned. */ + + V.4 wants long longs and doubles to be double word aligned. Just + testing the mode size is a boneheaded way to do this as it means + that other types such as complex int are also double word aligned. + However, we're stuck with this because changing the ABI might break + existing library interfaces. + + Doubleword align SPE vectors. + Quadword align Altivec vectors. + Quadword align large synthetic vector types. */ int -function_arg_boundary (enum machine_mode mode, tree type ATTRIBUTE_UNUSED) +function_arg_boundary (enum machine_mode mode, tree type) { - if (DEFAULT_ABI == ABI_V4 && GET_MODE_SIZE (mode) == 8) + if (DEFAULT_ABI == ABI_V4 + && (GET_MODE_SIZE (mode) == 8 + || (TARGET_HARD_FLOAT + && TARGET_FPRS + && mode == TFmode))) return 64; - else if (SPE_VECTOR_MODE (mode)) + else if (SPE_VECTOR_MODE (mode) + || (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) >= 8 + && int_size_in_bytes (type) < 16)) return 64; - else if (ALTIVEC_VECTOR_MODE (mode)) + else if (ALTIVEC_VECTOR_MODE (mode) + || (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) >= 16)) + return 128; + else if (rs6000_darwin64_abi && mode == BLKmode + && type && TYPE_ALIGN (type) > 64) return 128; else return PARM_BOUNDARY; } +/* For a function parm of MODE and TYPE, return the starting word in + the parameter area. NWORDS of the parameter area are already used. */ + +static unsigned int +rs6000_parm_start (enum machine_mode mode, tree type, unsigned int nwords) +{ + unsigned int align; + unsigned int parm_offset; + + align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; + parm_offset = DEFAULT_ABI == ABI_V4 ? 2 : 6; + return nwords + (-(parm_offset + nwords) & align); +} + /* Compute the size (in words) of a function argument. */ static unsigned long @@ -4083,6 +4568,89 @@ rs6000_arg_size (enum machine_mode mode, tree type) return (size + 7) >> 3; } +/* Use this to flush pending int fields. */ + +static void +rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *cum, + HOST_WIDE_INT bitpos) +{ + unsigned int startbit, endbit; + int intregs, intoffset; + enum machine_mode mode; + + if (cum->intoffset == -1) + return; + + intoffset = cum->intoffset; + cum->intoffset = -1; + + if (intoffset % BITS_PER_WORD != 0) + { + mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, + MODE_INT, 0); + if (mode == BLKmode) + { + /* We couldn't find an appropriate mode, which happens, + e.g., in packed structs when there are 3 bytes to load. + Back intoffset back to the beginning of the word in this + case. */ + intoffset = intoffset & -BITS_PER_WORD; + } + } + + startbit = intoffset & -BITS_PER_WORD; + endbit = (bitpos + BITS_PER_WORD - 1) & -BITS_PER_WORD; + intregs = (endbit - startbit) / BITS_PER_WORD; + cum->words += intregs; +} + +/* The darwin64 ABI calls for us to recurse down through structs, + looking for elements passed in registers. Unfortunately, we have + to track int register count here also because of misalignments + in powerpc alignment mode. */ + +static void +rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum, + tree type, + HOST_WIDE_INT startbitpos) +{ + tree f; + + for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f)) + if (TREE_CODE (f) == FIELD_DECL) + { + HOST_WIDE_INT bitpos = startbitpos; + tree ftype = TREE_TYPE (f); + enum machine_mode mode; + if (ftype == error_mark_node) + continue; + mode = TYPE_MODE (ftype); + + if (DECL_SIZE (f) != 0 + && host_integerp (bit_position (f), 1)) + bitpos += int_bit_position (f); + + /* ??? FIXME: else assume zero offset. */ + + if (TREE_CODE (ftype) == RECORD_TYPE) + rs6000_darwin64_record_arg_advance_recurse (cum, ftype, bitpos); + else if (USE_FP_FOR_ARG_P (cum, mode, ftype)) + { + rs6000_darwin64_record_arg_advance_flush (cum, bitpos); + cum->fregno += (GET_MODE_SIZE (mode) + 7) >> 3; + cum->words += (GET_MODE_SIZE (mode) + 7) >> 3; + } + else if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, 1)) + { + rs6000_darwin64_record_arg_advance_flush (cum, bitpos); + cum->vregno++; + cum->words += 2; + } + else if (cum->intoffset == -1) + cum->intoffset = bitpos; + } +} + /* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. (TYPE is null for libcalls where that information may not be available.) @@ -4092,25 +4660,32 @@ rs6000_arg_size (enum machine_mode mode, tree type) itself. */ void -function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named) +function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named, int depth) { - cum->nargs_prototype--; + int size; - if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + /* Only tick off an argument if we're not recursing. */ + if (depth == 0) + cum->nargs_prototype--; + + if (TARGET_ALTIVEC_ABI + && (ALTIVEC_VECTOR_MODE (mode) + || (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) == 16))) { bool stack = false; if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) - { + { cum->vregno++; if (!TARGET_ALTIVEC) - error ("Cannot pass argument in vector register because" + error ("cannot pass argument in vector register because" " altivec instructions are disabled, use -maltivec" - " to enable them."); + " to enable them"); /* PowerPC64 Linux and AIX allocate GPRs for a vector argument - even if it is going to be passed in a vector register. + even if it is going to be passed in a vector register. Darwin does the same for variable-argument functions. */ if ((DEFAULT_ABI == ABI_AIX && TARGET_64BIT) || (cum->stdarg && DEFAULT_ABI != ABI_V4)) @@ -4120,9 +4695,9 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, stack = true; if (stack) - { + { int align; - + /* Vector parameters must be 16-byte aligned. This places them at 2 mod 4 in terms of words in 32-bit mode, since the parameter save area starts at offset 24 from the @@ -4135,13 +4710,13 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, else align = cum->words & 1; cum->words += align + rs6000_arg_size (mode, type); - + if (TARGET_DEBUG_ARG) { - fprintf (stderr, "function_adv: words = %2d, align=%d, ", + fprintf (stderr, "function_adv: words = %2d, align=%d, ", cum->words, align); fprintf (stderr, "nargs = %4d, proto = %d, mode = %4s\n", - cum->nargs_prototype, cum->prototype, + cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode)); } } @@ -4150,17 +4725,46 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, && !cum->stdarg && cum->sysv_gregno <= GP_ARG_MAX_REG) cum->sysv_gregno++; + + else if (rs6000_darwin64_abi + && mode == BLKmode + && TREE_CODE (type) == RECORD_TYPE + && (size = int_size_in_bytes (type)) > 0) + { + /* Variable sized types have size == -1 and are + treated as if consisting entirely of ints. + Pad to 16 byte boundary if needed. */ + if (TYPE_ALIGN (type) >= 2 * BITS_PER_WORD + && (cum->words % 2) != 0) + cum->words++; + /* For varargs, we can just go up by the size of the struct. */ + if (!named) + cum->words += (size + 7) / 8; + else + { + /* It is tempting to say int register count just goes up by + sizeof(type)/8, but this is wrong in a case such as + { int; double; int; } [powerpc alignment]. We have to + grovel through the fields for these too. */ + cum->intoffset = 0; + rs6000_darwin64_record_arg_advance_recurse (cum, type, 0); + rs6000_darwin64_record_arg_advance_flush (cum, + size * BITS_PER_UNIT); + } + } else if (DEFAULT_ABI == ABI_V4) { if (TARGET_HARD_FLOAT && TARGET_FPRS - && (mode == SFmode || mode == DFmode)) + && (mode == SFmode || mode == DFmode + || (mode == TFmode && !TARGET_IEEEQUAD))) { - if (cum->fregno <= FP_ARG_V4_MAX_REG) - cum->fregno++; + if (cum->fregno + (mode == TFmode ? 1 : 0) <= FP_ARG_V4_MAX_REG) + cum->fregno += (GET_MODE_SIZE (mode) + 7) >> 3; else { - if (mode == DFmode) - cum->words += cum->words & 1; + cum->fregno = FP_ARG_V4_MAX_REG + 1; + if (mode == DFmode || mode == TFmode) + cum->words += cum->words & 1; cum->words += rs6000_arg_size (mode, type); } } @@ -4205,17 +4809,13 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, else { int n_words = rs6000_arg_size (mode, type); - int align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; + int start_words = cum->words; + int align_words = rs6000_parm_start (mode, type, start_words); - /* The simple alignment calculation here works because - function_arg_boundary / PARM_BOUNDARY will only be 1 or 2. - If we ever want to handle alignments larger than 8 bytes for - 32-bit or 16 bytes for 64-bit, then we'll need to take into - account the offset to the start of the parm save area. */ - align &= cum->words; - cum->words += align + n_words; + cum->words = align_words + n_words; - if (GET_MODE_CLASS (mode) == MODE_FLOAT + if (SCALAR_FLOAT_MODE_P (mode) + && !DECIMAL_FLOAT_MODE_P (mode) && TARGET_HARD_FLOAT && TARGET_FPRS) cum->fregno += (GET_MODE_SIZE (mode) + 7) >> 3; @@ -4225,20 +4825,61 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, cum->words, cum->fregno); fprintf (stderr, "nargs = %4d, proto = %d, mode = %4s, ", cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode)); - fprintf (stderr, "named = %d, align = %d\n", named, align); + fprintf (stderr, "named = %d, align = %d, depth = %d\n", + named, align_words - start_words, depth); } } } -/* Determine where to put a SIMD argument on the SPE. */ - static rtx -rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, +spe_build_register_parallel (enum machine_mode mode, int gregno) +{ + rtx r1, r3; + + switch (mode) + { + case DFmode: + r1 = gen_rtx_REG (DImode, gregno); + r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); + return gen_rtx_PARALLEL (mode, gen_rtvec (1, r1)); + + case DCmode: + r1 = gen_rtx_REG (DImode, gregno); + r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); + r3 = gen_rtx_REG (DImode, gregno + 2); + r3 = gen_rtx_EXPR_LIST (VOIDmode, r3, GEN_INT (8)); + return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r3)); + + default: + gcc_unreachable (); + } +} + +/* Determine where to put a SIMD argument on the SPE. */ +static rtx +rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type) { + int gregno = cum->sysv_gregno; + + /* On E500 v2, double arithmetic is done on the full 64-bit GPR, but + are passed and returned in a pair of GPRs for ABI compatibility. */ + if (TARGET_E500_DOUBLE && (mode == DFmode || mode == DCmode)) + { + int n_words = rs6000_arg_size (mode, type); + + /* Doubles go in an odd/even register pair (r5/r6, etc). */ + if (mode == DFmode) + gregno += (1 - gregno) & 1; + + /* Multi-reg args are not split between registers and stack. */ + if (gregno + n_words - 1 > GP_ARG_MAX_REG) + return NULL_RTX; + + return spe_build_register_parallel (mode, gregno); + } if (cum->stdarg) { - int gregno = cum->sysv_gregno; int n_words = rs6000_arg_size (mode, type); /* SPE vectors are put in odd registers. */ @@ -4261,13 +4902,198 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, } else { - if (cum->sysv_gregno <= GP_ARG_MAX_REG) - return gen_rtx_REG (mode, cum->sysv_gregno); + if (gregno <= GP_ARG_MAX_REG) + return gen_rtx_REG (mode, gregno); else return NULL_RTX; } } +/* A subroutine of rs6000_darwin64_record_arg. Assign the bits of the + structure between cum->intoffset and bitpos to integer registers. */ + +static void +rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *cum, + HOST_WIDE_INT bitpos, rtx rvec[], int *k) +{ + enum machine_mode mode; + unsigned int regno; + unsigned int startbit, endbit; + int this_regno, intregs, intoffset; + rtx reg; + + if (cum->intoffset == -1) + return; + + intoffset = cum->intoffset; + cum->intoffset = -1; + + /* If this is the trailing part of a word, try to only load that + much into the register. Otherwise load the whole register. Note + that in the latter case we may pick up unwanted bits. It's not a + problem at the moment but may wish to revisit. */ + + if (intoffset % BITS_PER_WORD != 0) + { + mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, + MODE_INT, 0); + if (mode == BLKmode) + { + /* We couldn't find an appropriate mode, which happens, + e.g., in packed structs when there are 3 bytes to load. + Back intoffset back to the beginning of the word in this + case. */ + intoffset = intoffset & -BITS_PER_WORD; + mode = word_mode; + } + } + else + mode = word_mode; + + startbit = intoffset & -BITS_PER_WORD; + endbit = (bitpos + BITS_PER_WORD - 1) & -BITS_PER_WORD; + intregs = (endbit - startbit) / BITS_PER_WORD; + this_regno = cum->words + intoffset / BITS_PER_WORD; + + if (intregs > 0 && intregs > GP_ARG_NUM_REG - this_regno) + cum->use_stack = 1; + + intregs = MIN (intregs, GP_ARG_NUM_REG - this_regno); + if (intregs <= 0) + return; + + intoffset /= BITS_PER_UNIT; + do + { + regno = GP_ARG_MIN_REG + this_regno; + reg = gen_rtx_REG (mode, regno); + rvec[(*k)++] = + gen_rtx_EXPR_LIST (VOIDmode, reg, GEN_INT (intoffset)); + + this_regno += 1; + intoffset = (intoffset | (UNITS_PER_WORD-1)) + 1; + mode = word_mode; + intregs -= 1; + } + while (intregs > 0); +} + +/* Recursive workhorse for the following. */ + +static void +rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *cum, tree type, + HOST_WIDE_INT startbitpos, rtx rvec[], + int *k) +{ + tree f; + + for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f)) + if (TREE_CODE (f) == FIELD_DECL) + { + HOST_WIDE_INT bitpos = startbitpos; + tree ftype = TREE_TYPE (f); + enum machine_mode mode; + if (ftype == error_mark_node) + continue; + mode = TYPE_MODE (ftype); + + if (DECL_SIZE (f) != 0 + && host_integerp (bit_position (f), 1)) + bitpos += int_bit_position (f); + + /* ??? FIXME: else assume zero offset. */ + + if (TREE_CODE (ftype) == RECORD_TYPE) + rs6000_darwin64_record_arg_recurse (cum, ftype, bitpos, rvec, k); + else if (cum->named && USE_FP_FOR_ARG_P (cum, mode, ftype)) + { +#if 0 + switch (mode) + { + case SCmode: mode = SFmode; break; + case DCmode: mode = DFmode; break; + case TCmode: mode = TFmode; break; + default: break; + } +#endif + rs6000_darwin64_record_arg_flush (cum, bitpos, rvec, k); + rvec[(*k)++] + = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, cum->fregno++), + GEN_INT (bitpos / BITS_PER_UNIT)); + if (mode == TFmode) + cum->fregno++; + } + else if (cum->named && USE_ALTIVEC_FOR_ARG_P (cum, mode, ftype, 1)) + { + rs6000_darwin64_record_arg_flush (cum, bitpos, rvec, k); + rvec[(*k)++] + = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, cum->vregno++), + GEN_INT (bitpos / BITS_PER_UNIT)); + } + else if (cum->intoffset == -1) + cum->intoffset = bitpos; + } +} + +/* For the darwin64 ABI, we want to construct a PARALLEL consisting of + the register(s) to be used for each field and subfield of a struct + being passed by value, along with the offset of where the + register's value may be found in the block. FP fields go in FP + register, vector fields go in vector registers, and everything + else goes in int registers, packed as in memory. + + This code is also used for function return values. RETVAL indicates + whether this is the case. + + Much of this is taken from the SPARC V9 port, which has a similar + calling convention. */ + +static rtx +rs6000_darwin64_record_arg (CUMULATIVE_ARGS *orig_cum, tree type, + int named, bool retval) +{ + rtx rvec[FIRST_PSEUDO_REGISTER]; + int k = 1, kbase = 1; + HOST_WIDE_INT typesize = int_size_in_bytes (type); + /* This is a copy; modifications are not visible to our caller. */ + CUMULATIVE_ARGS copy_cum = *orig_cum; + CUMULATIVE_ARGS *cum = ©_cum; + + /* Pad to 16 byte boundary if needed. */ + if (!retval && TYPE_ALIGN (type) >= 2 * BITS_PER_WORD + && (cum->words % 2) != 0) + cum->words++; + + cum->intoffset = 0; + cum->use_stack = 0; + cum->named = named; + + /* Put entries into rvec[] for individual FP and vector fields, and + for the chunks of memory that go in int regs. Note we start at + element 1; 0 is reserved for an indication of using memory, and + may or may not be filled in below. */ + rs6000_darwin64_record_arg_recurse (cum, type, 0, rvec, &k); + rs6000_darwin64_record_arg_flush (cum, typesize * BITS_PER_UNIT, rvec, &k); + + /* If any part of the struct went on the stack put all of it there. + This hack is because the generic code for + FUNCTION_ARG_PARTIAL_NREGS cannot handle cases where the register + parts of the struct are not at the beginning. */ + if (cum->use_stack) + { + if (retval) + return NULL_RTX; /* doesn't go in registers at all */ + kbase = 0; + rvec[0] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx); + } + if (k > 1 || cum->use_stack) + return gen_rtx_PARALLEL (BLKmode, gen_rtvec_v (k - kbase, &rvec[kbase])); + else + return NULL_RTX; +} + /* Determine where to place an argument in 64-bit mode with 32-bit ABI. */ static rtx @@ -4293,15 +5119,13 @@ rs6000_mixed_function_arg (enum machine_mode mode, tree type, int align_words) if (align_words + n_units > GP_ARG_NUM_REG) /* Not all of the arg fits in gprs. Say that it goes in memory too, using a magic NULL_RTX component. - FIXME: This is not strictly correct. Only some of the arg - belongs in memory, not all of it. However, there isn't any way - to do this currently, apart from building rtx descriptions for - the pieces of memory we want stored. Due to bugs in the generic - code we can't use the normal function_arg_partial_nregs scheme - with the PARALLEL arg description we emit here. - In any case, the code to store the whole arg to memory is often - more efficient than code to store pieces, and we know that space - is available in the right place for the whole arg. */ + This is not strictly correct. Only some of the arg belongs in + memory, not all of it. However, the normal scheme using + function_arg_partial_nregs can result in unusual subregs, eg. + (subreg:SI (reg:DF) 4), which are not handled well. The code to + store the whole arg to memory is often more efficient than code + to store pieces, and we know that space is available in the right + place for the whole arg. */ rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx); i = 0; @@ -4325,7 +5149,8 @@ rs6000_mixed_function_arg (enum machine_mode mode, tree type, int align_words) This is null for libcalls where that information may not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. + the preceding args and about the function being called. It is + not modified in this routine. NAMED is nonzero if this argument is a named parameter (otherwise it is an extra parameter matching an ellipsis). @@ -4343,8 +5168,8 @@ rs6000_mixed_function_arg (enum machine_mode mode, tree type, int align_words) with MODE and TYPE set to that of the pointer to the arg, not the arg itself. */ -struct rtx_def * -function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, +rtx +function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int named) { enum rs6000_abi abi = DEFAULT_ABI; @@ -4374,34 +5199,46 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, return GEN_INT (cum->call_cookie); } + if (rs6000_darwin64_abi && mode == BLKmode + && TREE_CODE (type) == RECORD_TYPE) + { + rtx rslt = rs6000_darwin64_record_arg (cum, type, named, false); + if (rslt != NULL_RTX) + return rslt; + /* Else fall through to usual handling. */ + } + if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) if (TARGET_64BIT && ! cum->prototype) { - /* Vector parameters get passed in vector register - and also in GPRs or memory, in absence of prototype. */ - int align_words; - rtx slot; - align_words = (cum->words + 1) & ~1; + /* Vector parameters get passed in vector register + and also in GPRs or memory, in absence of prototype. */ + int align_words; + rtx slot; + align_words = (cum->words + 1) & ~1; - if (align_words >= GP_ARG_NUM_REG) - { - slot = NULL_RTX; - } - else - { - slot = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); - } - return gen_rtx_PARALLEL (mode, - gen_rtvec (2, - gen_rtx_EXPR_LIST (VOIDmode, - slot, const0_rtx), - gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (mode, cum->vregno), - const0_rtx))); + if (align_words >= GP_ARG_NUM_REG) + { + slot = NULL_RTX; + } + else + { + slot = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); + } + return gen_rtx_PARALLEL (mode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + slot, const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (mode, cum->vregno), + const0_rtx))); } else return gen_rtx_REG (mode, cum->vregno); - else if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + else if (TARGET_ALTIVEC_ABI + && (ALTIVEC_VECTOR_MODE (mode) + || (type && TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) == 16))) { if (named || abi == ABI_V4) return NULL_RTX; @@ -4442,14 +5279,19 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, return gen_rtx_REG (part_mode, GP_ARG_MIN_REG + align_words); } } - else if (TARGET_SPE_ABI && TARGET_SPE && SPE_VECTOR_MODE (mode)) + else if (TARGET_SPE_ABI && TARGET_SPE + && (SPE_VECTOR_MODE (mode) + || (TARGET_E500_DOUBLE && (mode == DFmode + || mode == DCmode)))) return rs6000_spe_function_arg (cum, mode, type); + else if (abi == ABI_V4) { if (TARGET_HARD_FLOAT && TARGET_FPRS - && (mode == SFmode || mode == DFmode)) + && (mode == SFmode || mode == DFmode + || (mode == TFmode && !TARGET_IEEEQUAD))) { - if (cum->fregno <= FP_ARG_V4_MAX_REG) + if (cum->fregno + (mode == TFmode ? 1 : 0) <= FP_ARG_V4_MAX_REG) return gen_rtx_REG (mode, cum->fregno); else return NULL_RTX; @@ -4477,8 +5319,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, } else { - int align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; - int align_words = cum->words + (cum->words & align); + int align_words = rs6000_parm_start (mode, type, cum->words); if (USE_FP_FOR_ARG_P (cum, mode, type)) { @@ -4493,8 +5334,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, { /* Currently, we only ever need one reg here because complex doubles are split. */ - if (cum->fregno != FP_ARG_MAX_REG || fmode != TFmode) - abort (); + gcc_assert (cum->fregno == FP_ARG_MAX_REG && fmode == TFmode); /* Long double split over regs and memory. */ fmode = DFmode; @@ -4527,11 +5367,21 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, include the portion actually in registers here. */ enum machine_mode rmode = TARGET_32BIT ? SImode : DImode; rtx off; + int i = 0; + if (align_words + n_words > GP_ARG_NUM_REG) + /* Not all of the arg fits in gprs. Say that it + goes in memory too, using a magic NULL_RTX + component. Also see comment in + rs6000_mixed_function_arg for why the normal + function_arg_partial_nregs scheme doesn't work + in this case. */ + rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, + const0_rtx); do { r = gen_rtx_REG (rmode, GP_ARG_MIN_REG + align_words); - off = GEN_INT (k * GET_MODE_SIZE (rmode)); + off = GEN_INT (i++ * GET_MODE_SIZE (rmode)); rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off); } while (++align_words < GP_ARG_NUM_REG && --n_words != 0); @@ -4559,6 +5409,9 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (TARGET_32BIT && TARGET_POWERPC64) return rs6000_mixed_function_arg (mode, type, align_words); + if (mode == BLKmode) + mode = Pmode; + return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); } else @@ -4567,18 +5420,16 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, } /* For an arg passed partly in registers and partly in memory, this is - the number of registers used. For args passed entirely in registers - or entirely in memory, zero. When an arg is described by a PARALLEL, - perhaps using more than one register type, this function returns the - number of registers used by the first element of the PARALLEL. */ + the number of bytes passed in registers. For args passed entirely in + registers or entirely in memory, zero. When an arg is described by a + PARALLEL, perhaps using more than one register type, this function + returns the number of bytes used by the first element of the PARALLEL. */ -int -function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named) +static int +rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, bool named) { int ret = 0; - int align; - int parm_offset; int align_words; if (DEFAULT_ABI == ABI_V4) @@ -4588,32 +5439,39 @@ function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, && cum->nargs_prototype >= 0) return 0; - align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; - parm_offset = TARGET_32BIT ? 2 : 0; - align_words = cum->words + ((parm_offset - cum->words) & align); + /* In this complicated case we just disable the partial_nregs code. */ + if (rs6000_darwin64_abi && mode == BLKmode + && TREE_CODE (type) == RECORD_TYPE + && int_size_in_bytes (type) > 0) + return 0; - if (USE_FP_FOR_ARG_P (cum, mode, type) - /* If we are passing this arg in gprs as well, then this function - should return the number of gprs (or memory) partially passed, - *not* the number of fprs. */ - && !(type - && (cum->nargs_prototype <= 0 - || (DEFAULT_ABI == ABI_AIX - && TARGET_XL_COMPAT - && align_words >= GP_ARG_NUM_REG)))) + align_words = rs6000_parm_start (mode, type, cum->words); + + if (USE_FP_FOR_ARG_P (cum, mode, type)) { - if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) > FP_ARG_MAX_REG + 1) - ret = FP_ARG_MAX_REG + 1 - cum->fregno; + /* If we are passing this arg in the fixed parameter save area + (gprs or memory) as well as fprs, then this function should + return the number of partial bytes passed in the parameter + save area rather than partial bytes passed in fprs. */ + if (type + && (cum->nargs_prototype <= 0 + || (DEFAULT_ABI == ABI_AIX + && TARGET_XL_COMPAT + && align_words >= GP_ARG_NUM_REG))) + return 0; + else if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) + > FP_ARG_MAX_REG + 1) + ret = (FP_ARG_MAX_REG + 1 - cum->fregno) * 8; else if (cum->nargs_prototype >= 0) return 0; } if (align_words < GP_ARG_NUM_REG && GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type)) - ret = GP_ARG_NUM_REG - align_words; + ret = (GP_ARG_NUM_REG - align_words) * (TARGET_32BIT ? 4 : 8); if (ret != 0 && TARGET_DEBUG_ARG) - fprintf (stderr, "function_arg_partial_nregs: %d\n", ret); + fprintf (stderr, "rs6000_arg_partial_bytes: %d\n", ret); return ret; } @@ -4632,22 +5490,60 @@ function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode, As an extension to all ABIs, variable sized types are passed by reference. */ -int -function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED, - tree type, int named ATTRIBUTE_UNUSED) +static bool +rs6000_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode, tree type, + bool named ATTRIBUTE_UNUSED) { - if ((DEFAULT_ABI == ABI_V4 - && ((type && AGGREGATE_TYPE_P (type)) - || mode == TFmode)) - || (TARGET_32BIT && !TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) - || (type && int_size_in_bytes (type) < 0)) + if (DEFAULT_ABI == ABI_V4 && TARGET_IEEEQUAD && mode == TFmode) { if (TARGET_DEBUG_ARG) - fprintf (stderr, "function_arg_pass_by_reference\n"); - + fprintf (stderr, "function_arg_pass_by_reference: V4 long double\n"); return 1; } + + if (!type) + return 0; + + if (DEFAULT_ABI == ABI_V4 && AGGREGATE_TYPE_P (type)) + { + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: V4 aggregate\n"); + return 1; + } + + if (int_size_in_bytes (type) < 0) + { + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: variable size\n"); + return 1; + } + + /* Allow -maltivec -mabi=no-altivec without warning. Altivec vector + modes only exist for GCC vector types if -maltivec. */ + if (TARGET_32BIT && !TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + { + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: AltiVec\n"); + return 1; + } + + /* Pass synthetic vectors in memory. */ + if (TREE_CODE (type) == VECTOR_TYPE + && int_size_in_bytes (type) > (TARGET_ALTIVEC_ABI ? 16 : 8)) + { + static bool warned_for_pass_big_vectors = false; + if (TARGET_DEBUG_ARG) + fprintf (stderr, "function_arg_pass_by_reference: synthetic vector\n"); + if (!warned_for_pass_big_vectors) + { + warning (0, "GCC vector passed by reference: " + "non-standard ABI extension with no compatibility guarantee"); + warned_for_pass_big_vectors = true; + } + return 1; + } + return 0; } @@ -4660,30 +5556,28 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs) if (nregs == 0) return; - for (i = 0; i < nregs; i++) + for (i = 0; i < nregs; i++) { - rtx tem = adjust_address_nv (x, reg_mode, i*GET_MODE_SIZE(reg_mode)); + rtx tem = adjust_address_nv (x, reg_mode, i * GET_MODE_SIZE (reg_mode)); if (reload_completed) - { - if (! strict_memory_address_p (reg_mode, XEXP (tem, 0))) - tem = NULL_RTX; - else - tem = simplify_gen_subreg (reg_mode, x, BLKmode, - i * GET_MODE_SIZE(reg_mode)); - } + { + if (! strict_memory_address_p (reg_mode, XEXP (tem, 0))) + tem = NULL_RTX; + else + tem = simplify_gen_subreg (reg_mode, x, BLKmode, + i * GET_MODE_SIZE (reg_mode)); + } else tem = replace_equiv_address (tem, XEXP (tem, 0)); - if (tem == NULL_RTX) - abort (); + gcc_assert (tem); emit_move_insn (tem, gen_rtx_REG (reg_mode, regno + i)); } } - /* Perform any needed actions needed for a function that is receiving a - variable number of arguments. + variable number of arguments. CUM is as above. @@ -4697,8 +5591,9 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs) stack and set PRETEND_SIZE to the length of the registers pushed. */ static void -setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int *pretend_size ATTRIBUTE_UNUSED, int no_rtl) +setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int *pretend_size ATTRIBUTE_UNUSED, + int no_rtl) { CUMULATIVE_ARGS next_cum; int reg_size = TARGET_32BIT ? 4 : 8; @@ -4707,68 +5602,145 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, /* Skip the last named argument. */ next_cum = *cum; - function_arg_advance (&next_cum, mode, type, 1); + function_arg_advance (&next_cum, mode, type, 1, 0); if (DEFAULT_ABI == ABI_V4) { - /* Indicate to allocate space on the stack for varargs save area. */ - cfun->machine->sysv_varargs_p = 1; - if (! no_rtl) - save_area = plus_constant (virtual_stack_vars_rtx, - - RS6000_VARARGS_SIZE); - first_reg_offset = next_cum.sysv_gregno - GP_ARG_MIN_REG; + + if (! no_rtl) + { + int gpr_reg_num = 0, gpr_size = 0, fpr_size = 0; + HOST_WIDE_INT offset = 0; + + /* Try to optimize the size of the varargs save area. + The ABI requires that ap.reg_save_area is doubleword + aligned, but we don't need to allocate space for all + the bytes, only those to which we actually will save + anything. */ + if (cfun->va_list_gpr_size && first_reg_offset < GP_ARG_NUM_REG) + gpr_reg_num = GP_ARG_NUM_REG - first_reg_offset; + if (TARGET_HARD_FLOAT && TARGET_FPRS + && next_cum.fregno <= FP_ARG_V4_MAX_REG + && cfun->va_list_fpr_size) + { + if (gpr_reg_num) + fpr_size = (next_cum.fregno - FP_ARG_MIN_REG) + * UNITS_PER_FP_WORD; + if (cfun->va_list_fpr_size + < FP_ARG_V4_MAX_REG + 1 - next_cum.fregno) + fpr_size += cfun->va_list_fpr_size * UNITS_PER_FP_WORD; + else + fpr_size += (FP_ARG_V4_MAX_REG + 1 - next_cum.fregno) + * UNITS_PER_FP_WORD; + } + if (gpr_reg_num) + { + offset = -((first_reg_offset * reg_size) & ~7); + if (!fpr_size && gpr_reg_num > cfun->va_list_gpr_size) + { + gpr_reg_num = cfun->va_list_gpr_size; + if (reg_size == 4 && (first_reg_offset & 1)) + gpr_reg_num++; + } + gpr_size = (gpr_reg_num * reg_size + 7) & ~7; + } + else if (fpr_size) + offset = - (int) (next_cum.fregno - FP_ARG_MIN_REG) + * UNITS_PER_FP_WORD + - (int) (GP_ARG_NUM_REG * reg_size); + + if (gpr_size + fpr_size) + { + rtx reg_save_area + = assign_stack_local (BLKmode, gpr_size + fpr_size, 64); + gcc_assert (GET_CODE (reg_save_area) == MEM); + reg_save_area = XEXP (reg_save_area, 0); + if (GET_CODE (reg_save_area) == PLUS) + { + gcc_assert (XEXP (reg_save_area, 0) + == virtual_stack_vars_rtx); + gcc_assert (GET_CODE (XEXP (reg_save_area, 1)) == CONST_INT); + offset += INTVAL (XEXP (reg_save_area, 1)); + } + else + gcc_assert (reg_save_area == virtual_stack_vars_rtx); + } + + cfun->machine->varargs_save_offset = offset; + save_area = plus_constant (virtual_stack_vars_rtx, offset); + } } else { first_reg_offset = next_cum.words; save_area = virtual_incoming_args_rtx; - cfun->machine->sysv_varargs_p = 0; - if (MUST_PASS_IN_STACK (mode, type)) + if (targetm.calls.must_pass_in_stack (mode, type)) first_reg_offset += rs6000_arg_size (TYPE_MODE (type), type); } set = get_varargs_alias_set (); - if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG) + if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG + && cfun->va_list_gpr_size) { + int nregs = GP_ARG_NUM_REG - first_reg_offset; + + if (va_list_gpr_counter_field) + { + /* V4 va_list_gpr_size counts number of registers needed. */ + if (nregs > cfun->va_list_gpr_size) + nregs = cfun->va_list_gpr_size; + } + else + { + /* char * va_list instead counts number of bytes needed. */ + if (nregs > cfun->va_list_gpr_size / reg_size) + nregs = cfun->va_list_gpr_size / reg_size; + } + mem = gen_rtx_MEM (BLKmode, - plus_constant (save_area, - first_reg_offset * reg_size)), + plus_constant (save_area, + first_reg_offset * reg_size)); + MEM_NOTRAP_P (mem) = 1; set_mem_alias_set (mem, set); set_mem_align (mem, BITS_PER_WORD); - rs6000_move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem, - GP_ARG_NUM_REG - first_reg_offset); + rs6000_move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem, + nregs); } /* Save FP registers if needed. */ if (DEFAULT_ABI == ABI_V4 && TARGET_HARD_FLOAT && TARGET_FPRS && ! no_rtl - && next_cum.fregno <= FP_ARG_V4_MAX_REG) + && next_cum.fregno <= FP_ARG_V4_MAX_REG + && cfun->va_list_fpr_size) { - int fregno = next_cum.fregno; + int fregno = next_cum.fregno, nregs; rtx cr1 = gen_rtx_REG (CCmode, CR1_REGNO); rtx lab = gen_label_rtx (); - int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) * 8); + int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) + * UNITS_PER_FP_WORD); - emit_jump_insn (gen_rtx_SET (VOIDmode, - pc_rtx, - gen_rtx_IF_THEN_ELSE (VOIDmode, + emit_jump_insn + (gen_rtx_SET (VOIDmode, + pc_rtx, + gen_rtx_IF_THEN_ELSE (VOIDmode, gen_rtx_NE (VOIDmode, cr1, - const0_rtx), + const0_rtx), gen_rtx_LABEL_REF (VOIDmode, lab), pc_rtx))); - while (fregno <= FP_ARG_V4_MAX_REG) + for (nregs = 0; + fregno <= FP_ARG_V4_MAX_REG && nregs < cfun->va_list_fpr_size; + fregno++, off += UNITS_PER_FP_WORD, nregs++) { mem = gen_rtx_MEM (DFmode, plus_constant (save_area, off)); - set_mem_alias_set (mem, set); + MEM_NOTRAP_P (mem) = 1; + set_mem_alias_set (mem, set); set_mem_align (mem, GET_MODE_ALIGNMENT (DFmode)); emit_move_insn (mem, gen_rtx_REG (DFmode, fregno)); - fregno++; - off += 8; } emit_label (lab); @@ -4790,9 +5762,9 @@ rs6000_build_builtin_va_list (void) record = (*lang_hooks.types.make_type) (RECORD_TYPE); type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); - f_gpr = build_decl (FIELD_DECL, get_identifier ("gpr"), + f_gpr = build_decl (FIELD_DECL, get_identifier ("gpr"), unsigned_char_type_node); - f_fpr = build_decl (FIELD_DECL, get_identifier ("fpr"), + f_fpr = build_decl (FIELD_DECL, get_identifier ("fpr"), unsigned_char_type_node); /* Give the two bytes of padding a name, so that -Wpadded won't warn on every user file. */ @@ -4803,6 +5775,9 @@ rs6000_build_builtin_va_list (void) f_sav = build_decl (FIELD_DECL, get_identifier ("reg_save_area"), ptr_type_node); + va_list_gpr_counter_field = f_gpr; + va_list_fpr_counter_field = f_fpr; + DECL_FIELD_CONTEXT (f_gpr) = record; DECL_FIELD_CONTEXT (f_fpr) = record; DECL_FIELD_CONTEXT (f_res) = record; @@ -4845,85 +5820,88 @@ rs6000_va_start (tree valist, rtx nextarg) f_ovf = TREE_CHAIN (f_res); f_sav = TREE_CHAIN (f_ovf); - valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + valist = build_va_arg_indirect_ref (valist); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); /* Count number of gp and fp argument registers used. */ words = current_function_args_info.words; - n_gpr = current_function_args_info.sysv_gregno - GP_ARG_MIN_REG; - n_fpr = current_function_args_info.fregno - FP_ARG_MIN_REG; + n_gpr = MIN (current_function_args_info.sysv_gregno - GP_ARG_MIN_REG, + GP_ARG_NUM_REG); + n_fpr = MIN (current_function_args_info.fregno - FP_ARG_MIN_REG, + FP_ARG_NUM_REG); if (TARGET_DEBUG_ARG) fprintf (stderr, "va_start: words = "HOST_WIDE_INT_PRINT_DEC", n_gpr = " HOST_WIDE_INT_PRINT_DEC", n_fpr = "HOST_WIDE_INT_PRINT_DEC"\n", words, n_gpr, n_fpr); - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, build_int_2 (n_gpr, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size) + { + t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, + build_int_cst (NULL_TREE, n_gpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, build_int_2 (n_fpr, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_fpr_size) + { + t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, + build_int_cst (NULL_TREE, n_fpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the overflow area. */ t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); if (words != 0) - t = build (PLUS_EXPR, TREE_TYPE (ovf), t, - build_int_2 (words * UNITS_PER_WORD, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); + t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t, + build_int_cst (NULL_TREE, words * UNITS_PER_WORD)); + t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + /* If there were no va_arg invocations, don't set up the register + save area. */ + if (!cfun->va_list_gpr_size + && !cfun->va_list_fpr_size + && n_gpr < GP_ARG_NUM_REG + && n_fpr < FP_ARG_V4_MAX_REG) + return; + /* Find the register save area. */ t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx); - t = build (PLUS_EXPR, TREE_TYPE (sav), t, - build_int_2 (-RS6000_VARARGS_SIZE, -1)); - t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t); + if (cfun->machine->varargs_save_offset) + t = build2 (PLUS_EXPR, TREE_TYPE (sav), t, + build_int_cst (NULL_TREE, cfun->machine->varargs_save_offset)); + t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); } /* Implement va_arg. */ -rtx -rs6000_va_arg (tree valist, tree type) +tree +rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { tree f_gpr, f_fpr, f_res, f_ovf, f_sav; tree gpr, fpr, ovf, sav, reg, t, u; - int indirect_p, size, rsize, n_reg, sav_ofs, sav_scale; - rtx lab_false, lab_over, addr_rtx, r; + int size, rsize, n_reg, sav_ofs, sav_scale; + tree lab_false, lab_over, addr; int align; + tree ptrtype = build_pointer_type (type); + + if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) + { + t = rs6000_gimplify_va_arg (valist, ptrtype, pre_p, post_p); + return build_va_arg_indirect_ref (t); + } if (DEFAULT_ABI != ABI_V4) { - /* Variable sized types are passed by reference, as are AltiVec - vectors when 32-bit and not using the AltiVec ABI extension. */ - if (int_size_in_bytes (type) < 0 - || (TARGET_32BIT - && !TARGET_ALTIVEC_ABI - && ALTIVEC_VECTOR_MODE (TYPE_MODE (type)))) - { - u = build_pointer_type (type); - - /* Args grow upward. */ - t = build (POSTINCREMENT_EXPR, TREE_TYPE (valist), valist, - build_int_2 (POINTER_SIZE / BITS_PER_UNIT, 0)); - TREE_SIDE_EFFECTS (t) = 1; - - t = build1 (NOP_EXPR, build_pointer_type (u), t); - TREE_SIDE_EFFECTS (t) = 1; - - t = build1 (INDIRECT_REF, u, t); - TREE_SIDE_EFFECTS (t) = 1; - - return expand_expr (t, NULL_RTX, VOIDmode, EXPAND_NORMAL); - } - if (targetm.calls.split_complex_arg - && TREE_CODE (type) == COMPLEX_TYPE) + if (targetm.calls.split_complex_arg && TREE_CODE (type) == COMPLEX_TYPE) { tree elem_type = TREE_TYPE (type); enum machine_mode elem_mode = TYPE_MODE (elem_type); @@ -4931,33 +5909,24 @@ rs6000_va_arg (tree valist, tree type) if (elem_size < UNITS_PER_WORD) { - rtx real_part, imag_part, dest_real, rr; + tree real_part, imag_part; + tree post = NULL_TREE; - real_part = rs6000_va_arg (valist, elem_type); - imag_part = rs6000_va_arg (valist, elem_type); + real_part = rs6000_gimplify_va_arg (valist, elem_type, pre_p, + &post); + /* Copy the value into a temporary, lest the formal temporary + be reused out from under us. */ + real_part = get_initialized_tmp_var (real_part, pre_p, &post); + append_to_statement_list (post, pre_p); - /* We're not returning the value here, but the address. - real_part and imag_part are not contiguous, and we know - there is space available to pack real_part next to - imag_part. float _Complex is not promoted to - double _Complex by the default promotion rules that - promote float to double. */ - if (2 * elem_size > UNITS_PER_WORD) - abort (); + imag_part = rs6000_gimplify_va_arg (valist, elem_type, pre_p, + post_p); - real_part = gen_rtx_MEM (elem_mode, real_part); - imag_part = gen_rtx_MEM (elem_mode, imag_part); - - dest_real = adjust_address (imag_part, elem_mode, -elem_size); - rr = gen_reg_rtx (elem_mode); - emit_move_insn (rr, real_part); - emit_move_insn (dest_real, rr); - - return XEXP (dest_real, 0); + return build2 (COMPLEX_EXPR, type, real_part, imag_part); } } - return std_expand_builtin_va_arg (valist, type); + return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); } f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node)); @@ -4966,46 +5935,32 @@ rs6000_va_arg (tree valist, tree type) f_ovf = TREE_CHAIN (f_res); f_sav = TREE_CHAIN (f_ovf); - valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + valist = build_va_arg_indirect_ref (valist); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); size = int_size_in_bytes (type); rsize = (size + 3) / 4; align = 1; - if (AGGREGATE_TYPE_P (type) - || TYPE_MODE (type) == TFmode - || (!TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (TYPE_MODE (type)))) - { - /* Aggregates, long doubles, and AltiVec vectors are passed by - reference. */ - indirect_p = 1; - reg = gpr; - n_reg = 1; - sav_ofs = 0; - sav_scale = 4; - size = 4; - rsize = 1; - } - else if (TARGET_HARD_FLOAT && TARGET_FPRS - && (TYPE_MODE (type) == SFmode || TYPE_MODE (type) == DFmode)) + if (TARGET_HARD_FLOAT && TARGET_FPRS + && (TYPE_MODE (type) == SFmode + || TYPE_MODE (type) == DFmode + || TYPE_MODE (type) == TFmode)) { /* FP args go in FP registers, if present. */ - indirect_p = 0; reg = fpr; - n_reg = 1; + n_reg = (size + 7) / 8; sav_ofs = 8*4; sav_scale = 8; - if (TYPE_MODE (type) == DFmode) + if (TYPE_MODE (type) != SFmode) align = 8; } else { /* Otherwise into GP registers. */ - indirect_p = 0; reg = gpr; n_reg = rsize; sav_ofs = 0; @@ -5016,66 +5971,59 @@ rs6000_va_arg (tree valist, tree type) /* Pull the value out of the saved registers.... */ - lab_over = NULL_RTX; - addr_rtx = gen_reg_rtx (Pmode); + lab_over = NULL; + addr = create_tmp_var (ptr_type_node, "addr"); + DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); /* AltiVec vectors never go in registers when -mabi=altivec. */ if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (TYPE_MODE (type))) align = 16; else { - lab_false = gen_label_rtx (); - lab_over = gen_label_rtx (); + lab_false = create_artificial_label (); + lab_over = create_artificial_label (); /* Long long and SPE vectors are aligned in the registers. As are any other 2 gpr item such as complex int due to a historical mistake. */ u = reg; - if (n_reg == 2) + if (n_reg == 2 && reg == gpr) { - u = build (BIT_AND_EXPR, TREE_TYPE (reg), reg, - build_int_2 (n_reg - 1, 0)); - u = build (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u); - TREE_SIDE_EFFECTS (u) = 1; + u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg, + size_int (n_reg - 1)); + u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u); } - emit_cmp_and_jump_insns - (expand_expr (u, NULL_RTX, QImode, EXPAND_NORMAL), - GEN_INT (8 - n_reg + 1), GE, const1_rtx, QImode, 1, - lab_false); + t = fold_convert (TREE_TYPE (reg), size_int (8 - n_reg + 1)); + t = build2 (GE_EXPR, boolean_type_node, u, t); + u = build1 (GOTO_EXPR, void_type_node, lab_false); + t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE); + gimplify_and_add (t, pre_p); t = sav; if (sav_ofs) - t = build (PLUS_EXPR, ptr_type_node, sav, build_int_2 (sav_ofs, 0)); - - u = build (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, - build_int_2 (n_reg, 0)); - TREE_SIDE_EFFECTS (u) = 1; + t = build2 (PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs)); + u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, size_int (n_reg)); u = build1 (CONVERT_EXPR, integer_type_node, u); - TREE_SIDE_EFFECTS (u) = 1; + u = build2 (MULT_EXPR, integer_type_node, u, size_int (sav_scale)); + t = build2 (PLUS_EXPR, ptr_type_node, t, u); - u = build (MULT_EXPR, integer_type_node, u, build_int_2 (sav_scale, 0)); - TREE_SIDE_EFFECTS (u) = 1; + t = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (t, pre_p); - t = build (PLUS_EXPR, ptr_type_node, t, u); - TREE_SIDE_EFFECTS (t) = 1; + t = build1 (GOTO_EXPR, void_type_node, lab_over); + gimplify_and_add (t, pre_p); - r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); - if (r != addr_rtx) - emit_move_insn (addr_rtx, r); + t = build1 (LABEL_EXPR, void_type_node, lab_false); + append_to_statement_list (t, pre_p); - emit_jump_insn (gen_jump (lab_over)); - emit_barrier (); - - emit_label (lab_false); - if (n_reg > 2) + if ((n_reg == 2 && reg != gpr) || n_reg > 2) { /* Ensure that we don't find any more args in regs. - Alignment has taken care of the n_reg == 2 case. */ - t = build (MODIFY_EXPR, TREE_TYPE (reg), reg, build_int_2 (8, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + Alignment has taken care of the n_reg == 2 gpr case. */ + t = build2 (MODIFY_EXPR, TREE_TYPE (reg), reg, size_int (8)); + gimplify_and_add (t, pre_p); } } @@ -5085,41 +6033,65 @@ rs6000_va_arg (tree valist, tree type) t = ovf; if (align != 1) { - t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (align - 1, 0)); - t = build (BIT_AND_EXPR, TREE_TYPE (t), t, build_int_2 (-align, -1)); + t = build2 (PLUS_EXPR, TREE_TYPE (t), t, size_int (align - 1)); + t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, + build_int_cst (NULL_TREE, -align)); } - t = save_expr (t); + gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); - r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); - if (r != addr_rtx) - emit_move_insn (addr_rtx, r); + u = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (u, pre_p); - t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (size, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, TREE_TYPE (t), t, size_int (size)); + t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); + gimplify_and_add (t, pre_p); if (lab_over) - emit_label (lab_over); - - if (indirect_p) { - r = gen_rtx_MEM (Pmode, addr_rtx); - set_mem_alias_set (r, get_varargs_alias_set ()); - emit_move_insn (addr_rtx, r); + t = build1 (LABEL_EXPR, void_type_node, lab_over); + append_to_statement_list (t, pre_p); } - return addr_rtx; + if (STRICT_ALIGNMENT + && (TYPE_ALIGN (type) + > (unsigned) BITS_PER_UNIT * (align < 4 ? 4 : align))) + { + /* The value (of type complex double, for example) may not be + aligned in memory in the saved registers, so copy via a + temporary. (This is the same code as used for SPARC.) */ + tree tmp = create_tmp_var (type, "va_arg_tmp"); + tree dest_addr = build_fold_addr_expr (tmp); + + tree copy = build_function_call_expr + (implicit_built_in_decls[BUILT_IN_MEMCPY], + tree_cons (NULL_TREE, dest_addr, + tree_cons (NULL_TREE, addr, + tree_cons (NULL_TREE, size_int (rsize * 4), + NULL_TREE)))); + + gimplify_and_add (copy, pre_p); + addr = dest_addr; + } + + addr = fold_convert (ptrtype, addr); + return build_va_arg_indirect_ref (addr); } /* Builtins. */ -#define def_builtin(MASK, NAME, TYPE, CODE) \ -do { \ - if ((MASK) & target_flags) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ - NULL, NULL_TREE); \ -} while (0) +static void +def_builtin (int mask, const char *name, tree type, int code) +{ + if (mask & target_flags) + { + if (rs6000_builtin_decls[code]) + abort (); + + rs6000_builtin_decls[code] = + lang_hooks.builtin_function (name, type, code, BUILT_IN_MD, + NULL, NULL_TREE); + } +} /* Simple ternary operations: VECd = foo (VECa, VECb, VECc). */ @@ -5135,19 +6107,35 @@ static const struct builtin_description bdesc_3arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vmsumshm, "__builtin_altivec_vmsumshm", ALTIVEC_BUILTIN_VMSUMSHM }, { MASK_ALTIVEC, CODE_FOR_altivec_vmsumuhs, "__builtin_altivec_vmsumuhs", ALTIVEC_BUILTIN_VMSUMUHS }, { MASK_ALTIVEC, CODE_FOR_altivec_vmsumshs, "__builtin_altivec_vmsumshs", ALTIVEC_BUILTIN_VMSUMSHS }, - { MASK_ALTIVEC, CODE_FOR_altivec_vnmsubfp, "__builtin_altivec_vnmsubfp", ALTIVEC_BUILTIN_VNMSUBFP }, - { MASK_ALTIVEC, CODE_FOR_altivec_vperm_4sf, "__builtin_altivec_vperm_4sf", ALTIVEC_BUILTIN_VPERM_4SF }, - { MASK_ALTIVEC, CODE_FOR_altivec_vperm_4si, "__builtin_altivec_vperm_4si", ALTIVEC_BUILTIN_VPERM_4SI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vperm_8hi, "__builtin_altivec_vperm_8hi", ALTIVEC_BUILTIN_VPERM_8HI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vperm_16qi, "__builtin_altivec_vperm_16qi", ALTIVEC_BUILTIN_VPERM_16QI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsel_4sf, "__builtin_altivec_vsel_4sf", ALTIVEC_BUILTIN_VSEL_4SF }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsel_4si, "__builtin_altivec_vsel_4si", ALTIVEC_BUILTIN_VSEL_4SI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsel_8hi, "__builtin_altivec_vsel_8hi", ALTIVEC_BUILTIN_VSEL_8HI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsel_16qi, "__builtin_altivec_vsel_16qi", ALTIVEC_BUILTIN_VSEL_16QI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_16qi, "__builtin_altivec_vsldoi_16qi", ALTIVEC_BUILTIN_VSLDOI_16QI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_8hi, "__builtin_altivec_vsldoi_8hi", ALTIVEC_BUILTIN_VSLDOI_8HI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_4si, "__builtin_altivec_vsldoi_4si", ALTIVEC_BUILTIN_VSLDOI_4SI }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_4sf, "__builtin_altivec_vsldoi_4sf", ALTIVEC_BUILTIN_VSLDOI_4SF }, + { MASK_ALTIVEC, CODE_FOR_altivec_vnmsubfp, "__builtin_altivec_vnmsubfp", ALTIVEC_BUILTIN_VNMSUBFP }, + { MASK_ALTIVEC, CODE_FOR_altivec_vperm_v4sf, "__builtin_altivec_vperm_4sf", ALTIVEC_BUILTIN_VPERM_4SF }, + { MASK_ALTIVEC, CODE_FOR_altivec_vperm_v4si, "__builtin_altivec_vperm_4si", ALTIVEC_BUILTIN_VPERM_4SI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vperm_v8hi, "__builtin_altivec_vperm_8hi", ALTIVEC_BUILTIN_VPERM_8HI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vperm_v16qi, "__builtin_altivec_vperm_16qi", ALTIVEC_BUILTIN_VPERM_16QI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsel_v4sf, "__builtin_altivec_vsel_4sf", ALTIVEC_BUILTIN_VSEL_4SF }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsel_v4si, "__builtin_altivec_vsel_4si", ALTIVEC_BUILTIN_VSEL_4SI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsel_v8hi, "__builtin_altivec_vsel_8hi", ALTIVEC_BUILTIN_VSEL_8HI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsel_v16qi, "__builtin_altivec_vsel_16qi", ALTIVEC_BUILTIN_VSEL_16QI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v16qi, "__builtin_altivec_vsldoi_16qi", ALTIVEC_BUILTIN_VSLDOI_16QI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v8hi, "__builtin_altivec_vsldoi_8hi", ALTIVEC_BUILTIN_VSLDOI_8HI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v4si, "__builtin_altivec_vsldoi_4si", ALTIVEC_BUILTIN_VSLDOI_4SI }, + { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v4sf, "__builtin_altivec_vsldoi_4sf", ALTIVEC_BUILTIN_VSLDOI_4SF }, + + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_madd", ALTIVEC_BUILTIN_VEC_MADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_madds", ALTIVEC_BUILTIN_VEC_MADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mladd", ALTIVEC_BUILTIN_VEC_MLADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mradds", ALTIVEC_BUILTIN_VEC_MRADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_msum", ALTIVEC_BUILTIN_VEC_MSUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumshm", ALTIVEC_BUILTIN_VEC_VMSUMSHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumuhm", ALTIVEC_BUILTIN_VEC_VMSUMUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsummbm", ALTIVEC_BUILTIN_VEC_VMSUMMBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumubm", ALTIVEC_BUILTIN_VEC_VMSUMUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_msums", ALTIVEC_BUILTIN_VEC_MSUMS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumshs", ALTIVEC_BUILTIN_VEC_VMSUMSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumuhs", ALTIVEC_BUILTIN_VEC_VMSUMUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_nmsub", ALTIVEC_BUILTIN_VEC_NMSUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_perm", ALTIVEC_BUILTIN_VEC_PERM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sel", ALTIVEC_BUILTIN_VEC_SEL }, }; /* DST operations: void foo (void *, const int, const char). */ @@ -5157,7 +6145,12 @@ static const struct builtin_description bdesc_dst[] = { MASK_ALTIVEC, CODE_FOR_altivec_dst, "__builtin_altivec_dst", ALTIVEC_BUILTIN_DST }, { MASK_ALTIVEC, CODE_FOR_altivec_dstt, "__builtin_altivec_dstt", ALTIVEC_BUILTIN_DSTT }, { MASK_ALTIVEC, CODE_FOR_altivec_dstst, "__builtin_altivec_dstst", ALTIVEC_BUILTIN_DSTST }, - { MASK_ALTIVEC, CODE_FOR_altivec_dststt, "__builtin_altivec_dststt", ALTIVEC_BUILTIN_DSTSTT } + { MASK_ALTIVEC, CODE_FOR_altivec_dststt, "__builtin_altivec_dststt", ALTIVEC_BUILTIN_DSTSTT }, + + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dst", ALTIVEC_BUILTIN_VEC_DST }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dstt", ALTIVEC_BUILTIN_VEC_DSTT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dstst", ALTIVEC_BUILTIN_VEC_DSTST }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dststt", ALTIVEC_BUILTIN_VEC_DSTSTT } }; /* Simple binary operations: VECc = foo (VECa, VECb). */ @@ -5176,7 +6169,7 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vadduws, "__builtin_altivec_vadduws", ALTIVEC_BUILTIN_VADDUWS }, { MASK_ALTIVEC, CODE_FOR_altivec_vaddsws, "__builtin_altivec_vaddsws", ALTIVEC_BUILTIN_VADDSWS }, { MASK_ALTIVEC, CODE_FOR_andv4si3, "__builtin_altivec_vand", ALTIVEC_BUILTIN_VAND }, - { MASK_ALTIVEC, CODE_FOR_altivec_vandc, "__builtin_altivec_vandc", ALTIVEC_BUILTIN_VANDC }, + { MASK_ALTIVEC, CODE_FOR_andcv4si3, "__builtin_altivec_vandc", ALTIVEC_BUILTIN_VANDC }, { MASK_ALTIVEC, CODE_FOR_altivec_vavgub, "__builtin_altivec_vavgub", ALTIVEC_BUILTIN_VAVGUB }, { MASK_ALTIVEC, CODE_FOR_altivec_vavgsb, "__builtin_altivec_vavgsb", ALTIVEC_BUILTIN_VAVGSB }, { MASK_ALTIVEC, CODE_FOR_altivec_vavguh, "__builtin_altivec_vavguh", ALTIVEC_BUILTIN_VAVGUH }, @@ -5228,14 +6221,12 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vmulosb, "__builtin_altivec_vmulosb", ALTIVEC_BUILTIN_VMULOSB }, { MASK_ALTIVEC, CODE_FOR_altivec_vmulouh, "__builtin_altivec_vmulouh", ALTIVEC_BUILTIN_VMULOUH }, { MASK_ALTIVEC, CODE_FOR_altivec_vmulosh, "__builtin_altivec_vmulosh", ALTIVEC_BUILTIN_VMULOSH }, - { MASK_ALTIVEC, CODE_FOR_altivec_vnor, "__builtin_altivec_vnor", ALTIVEC_BUILTIN_VNOR }, + { MASK_ALTIVEC, CODE_FOR_altivec_norv4si3, "__builtin_altivec_vnor", ALTIVEC_BUILTIN_VNOR }, { MASK_ALTIVEC, CODE_FOR_iorv4si3, "__builtin_altivec_vor", ALTIVEC_BUILTIN_VOR }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkuhum, "__builtin_altivec_vpkuhum", ALTIVEC_BUILTIN_VPKUHUM }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkuwum, "__builtin_altivec_vpkuwum", ALTIVEC_BUILTIN_VPKUWUM }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkpx, "__builtin_altivec_vpkpx", ALTIVEC_BUILTIN_VPKPX }, - { MASK_ALTIVEC, CODE_FOR_altivec_vpkuhss, "__builtin_altivec_vpkuhss", ALTIVEC_BUILTIN_VPKUHSS }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkshss, "__builtin_altivec_vpkshss", ALTIVEC_BUILTIN_VPKSHSS }, - { MASK_ALTIVEC, CODE_FOR_altivec_vpkuwss, "__builtin_altivec_vpkuwss", ALTIVEC_BUILTIN_VPKUWSS }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkswss, "__builtin_altivec_vpkswss", ALTIVEC_BUILTIN_VPKSWSS }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkuhus, "__builtin_altivec_vpkuhus", ALTIVEC_BUILTIN_VPKUHUS }, { MASK_ALTIVEC, CODE_FOR_altivec_vpkshus, "__builtin_altivec_vpkshus", ALTIVEC_BUILTIN_VPKSHUS }, @@ -5252,12 +6243,12 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vspltb, "__builtin_altivec_vspltb", ALTIVEC_BUILTIN_VSPLTB }, { MASK_ALTIVEC, CODE_FOR_altivec_vsplth, "__builtin_altivec_vsplth", ALTIVEC_BUILTIN_VSPLTH }, { MASK_ALTIVEC, CODE_FOR_altivec_vspltw, "__builtin_altivec_vspltw", ALTIVEC_BUILTIN_VSPLTW }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrb, "__builtin_altivec_vsrb", ALTIVEC_BUILTIN_VSRB }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrh, "__builtin_altivec_vsrh", ALTIVEC_BUILTIN_VSRH }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrw, "__builtin_altivec_vsrw", ALTIVEC_BUILTIN_VSRW }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrab, "__builtin_altivec_vsrab", ALTIVEC_BUILTIN_VSRAB }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrah, "__builtin_altivec_vsrah", ALTIVEC_BUILTIN_VSRAH }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsraw, "__builtin_altivec_vsraw", ALTIVEC_BUILTIN_VSRAW }, + { MASK_ALTIVEC, CODE_FOR_lshrv16qi3, "__builtin_altivec_vsrb", ALTIVEC_BUILTIN_VSRB }, + { MASK_ALTIVEC, CODE_FOR_lshrv8hi3, "__builtin_altivec_vsrh", ALTIVEC_BUILTIN_VSRH }, + { MASK_ALTIVEC, CODE_FOR_lshrv4si3, "__builtin_altivec_vsrw", ALTIVEC_BUILTIN_VSRW }, + { MASK_ALTIVEC, CODE_FOR_ashrv16qi3, "__builtin_altivec_vsrab", ALTIVEC_BUILTIN_VSRAB }, + { MASK_ALTIVEC, CODE_FOR_ashrv8hi3, "__builtin_altivec_vsrah", ALTIVEC_BUILTIN_VSRAH }, + { MASK_ALTIVEC, CODE_FOR_ashrv4si3, "__builtin_altivec_vsraw", ALTIVEC_BUILTIN_VSRAW }, { MASK_ALTIVEC, CODE_FOR_altivec_vsr, "__builtin_altivec_vsr", ALTIVEC_BUILTIN_VSR }, { MASK_ALTIVEC, CODE_FOR_altivec_vsro, "__builtin_altivec_vsro", ALTIVEC_BUILTIN_VSRO }, { MASK_ALTIVEC, CODE_FOR_subv16qi3, "__builtin_altivec_vsububm", ALTIVEC_BUILTIN_VSUBUBM }, @@ -5278,6 +6269,134 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vsumsws, "__builtin_altivec_vsumsws", ALTIVEC_BUILTIN_VSUMSWS }, { MASK_ALTIVEC, CODE_FOR_xorv4si3, "__builtin_altivec_vxor", ALTIVEC_BUILTIN_VXOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_add", ALTIVEC_BUILTIN_VEC_ADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddfp", ALTIVEC_BUILTIN_VEC_VADDFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduwm", ALTIVEC_BUILTIN_VEC_VADDUWM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduhm", ALTIVEC_BUILTIN_VEC_VADDUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddubm", ALTIVEC_BUILTIN_VEC_VADDUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_addc", ALTIVEC_BUILTIN_VEC_ADDC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_adds", ALTIVEC_BUILTIN_VEC_ADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddsws", ALTIVEC_BUILTIN_VEC_VADDSWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduws", ALTIVEC_BUILTIN_VEC_VADDUWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddshs", ALTIVEC_BUILTIN_VEC_VADDSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduhs", ALTIVEC_BUILTIN_VEC_VADDUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddsbs", ALTIVEC_BUILTIN_VEC_VADDSBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddubs", ALTIVEC_BUILTIN_VEC_VADDUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_and", ALTIVEC_BUILTIN_VEC_AND }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_andc", ALTIVEC_BUILTIN_VEC_ANDC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_avg", ALTIVEC_BUILTIN_VEC_AVG }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsw", ALTIVEC_BUILTIN_VEC_VAVGSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavguw", ALTIVEC_BUILTIN_VEC_VAVGUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsh", ALTIVEC_BUILTIN_VEC_VAVGSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavguh", ALTIVEC_BUILTIN_VEC_VAVGUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsb", ALTIVEC_BUILTIN_VEC_VAVGSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgub", ALTIVEC_BUILTIN_VEC_VAVGUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpb", ALTIVEC_BUILTIN_VEC_CMPB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpeq", ALTIVEC_BUILTIN_VEC_CMPEQ }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpeqfp", ALTIVEC_BUILTIN_VEC_VCMPEQFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequw", ALTIVEC_BUILTIN_VEC_VCMPEQUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequh", ALTIVEC_BUILTIN_VEC_VCMPEQUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequb", ALTIVEC_BUILTIN_VEC_VCMPEQUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpge", ALTIVEC_BUILTIN_VEC_CMPGE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpgt", ALTIVEC_BUILTIN_VEC_CMPGT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtfp", ALTIVEC_BUILTIN_VEC_VCMPGTFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsw", ALTIVEC_BUILTIN_VEC_VCMPGTSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtuw", ALTIVEC_BUILTIN_VEC_VCMPGTUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsh", ALTIVEC_BUILTIN_VEC_VCMPGTSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtuh", ALTIVEC_BUILTIN_VEC_VCMPGTUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsb", ALTIVEC_BUILTIN_VEC_VCMPGTSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtub", ALTIVEC_BUILTIN_VEC_VCMPGTUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmple", ALTIVEC_BUILTIN_VEC_CMPLE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmplt", ALTIVEC_BUILTIN_VEC_CMPLT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_max", ALTIVEC_BUILTIN_VEC_MAX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxfp", ALTIVEC_BUILTIN_VEC_VMAXFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsw", ALTIVEC_BUILTIN_VEC_VMAXSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxuw", ALTIVEC_BUILTIN_VEC_VMAXUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsh", ALTIVEC_BUILTIN_VEC_VMAXSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxuh", ALTIVEC_BUILTIN_VEC_VMAXUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsb", ALTIVEC_BUILTIN_VEC_VMAXSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxub", ALTIVEC_BUILTIN_VEC_VMAXUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mergeh", ALTIVEC_BUILTIN_VEC_MERGEH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghw", ALTIVEC_BUILTIN_VEC_VMRGHW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghh", ALTIVEC_BUILTIN_VEC_VMRGHH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghb", ALTIVEC_BUILTIN_VEC_VMRGHB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mergel", ALTIVEC_BUILTIN_VEC_MERGEL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglw", ALTIVEC_BUILTIN_VEC_VMRGLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglh", ALTIVEC_BUILTIN_VEC_VMRGLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglb", ALTIVEC_BUILTIN_VEC_VMRGLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_min", ALTIVEC_BUILTIN_VEC_MIN }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminfp", ALTIVEC_BUILTIN_VEC_VMINFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsw", ALTIVEC_BUILTIN_VEC_VMINSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminuw", ALTIVEC_BUILTIN_VEC_VMINUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsh", ALTIVEC_BUILTIN_VEC_VMINSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminuh", ALTIVEC_BUILTIN_VEC_VMINUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsb", ALTIVEC_BUILTIN_VEC_VMINSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminub", ALTIVEC_BUILTIN_VEC_VMINUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mule", ALTIVEC_BUILTIN_VEC_MULE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuleub", ALTIVEC_BUILTIN_VEC_VMULEUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulesb", ALTIVEC_BUILTIN_VEC_VMULESB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuleuh", ALTIVEC_BUILTIN_VEC_VMULEUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulesh", ALTIVEC_BUILTIN_VEC_VMULESH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mulo", ALTIVEC_BUILTIN_VEC_MULO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulosh", ALTIVEC_BUILTIN_VEC_VMULOSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulouh", ALTIVEC_BUILTIN_VEC_VMULOUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulosb", ALTIVEC_BUILTIN_VEC_VMULOSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuloub", ALTIVEC_BUILTIN_VEC_VMULOUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_nor", ALTIVEC_BUILTIN_VEC_NOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_or", ALTIVEC_BUILTIN_VEC_OR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_pack", ALTIVEC_BUILTIN_VEC_PACK }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuwum", ALTIVEC_BUILTIN_VEC_VPKUWUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuhum", ALTIVEC_BUILTIN_VEC_VPKUHUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packpx", ALTIVEC_BUILTIN_VEC_PACKPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packs", ALTIVEC_BUILTIN_VEC_PACKS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkswss", ALTIVEC_BUILTIN_VEC_VPKSWSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuwus", ALTIVEC_BUILTIN_VEC_VPKUWUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkshss", ALTIVEC_BUILTIN_VEC_VPKSHSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuhus", ALTIVEC_BUILTIN_VEC_VPKUHUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packsu", ALTIVEC_BUILTIN_VEC_PACKSU }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkswus", ALTIVEC_BUILTIN_VEC_VPKSWUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkshus", ALTIVEC_BUILTIN_VEC_VPKSHUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_rl", ALTIVEC_BUILTIN_VEC_RL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlw", ALTIVEC_BUILTIN_VEC_VRLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlh", ALTIVEC_BUILTIN_VEC_VRLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlb", ALTIVEC_BUILTIN_VEC_VRLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sl", ALTIVEC_BUILTIN_VEC_SL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslw", ALTIVEC_BUILTIN_VEC_VSLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslh", ALTIVEC_BUILTIN_VEC_VSLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslb", ALTIVEC_BUILTIN_VEC_VSLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sll", ALTIVEC_BUILTIN_VEC_SLL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_slo", ALTIVEC_BUILTIN_VEC_SLO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sr", ALTIVEC_BUILTIN_VEC_SR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrw", ALTIVEC_BUILTIN_VEC_VSRW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrh", ALTIVEC_BUILTIN_VEC_VSRH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrb", ALTIVEC_BUILTIN_VEC_VSRB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sra", ALTIVEC_BUILTIN_VEC_SRA }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsraw", ALTIVEC_BUILTIN_VEC_VSRAW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrah", ALTIVEC_BUILTIN_VEC_VSRAH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrab", ALTIVEC_BUILTIN_VEC_VSRAB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_srl", ALTIVEC_BUILTIN_VEC_SRL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sro", ALTIVEC_BUILTIN_VEC_SRO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sub", ALTIVEC_BUILTIN_VEC_SUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubfp", ALTIVEC_BUILTIN_VEC_VSUBFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuwm", ALTIVEC_BUILTIN_VEC_VSUBUWM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuhm", ALTIVEC_BUILTIN_VEC_VSUBUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsububm", ALTIVEC_BUILTIN_VEC_VSUBUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_subc", ALTIVEC_BUILTIN_VEC_SUBC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_subs", ALTIVEC_BUILTIN_VEC_SUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubsws", ALTIVEC_BUILTIN_VEC_VSUBSWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuws", ALTIVEC_BUILTIN_VEC_VSUBUWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubshs", ALTIVEC_BUILTIN_VEC_VSUBSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuhs", ALTIVEC_BUILTIN_VEC_VSUBUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubsbs", ALTIVEC_BUILTIN_VEC_VSUBSBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsububs", ALTIVEC_BUILTIN_VEC_VSUBUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sum4s", ALTIVEC_BUILTIN_VEC_SUM4S }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4shs", ALTIVEC_BUILTIN_VEC_VSUM4SHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4sbs", ALTIVEC_BUILTIN_VEC_VSUM4SBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4ubs", ALTIVEC_BUILTIN_VEC_VSUM4UBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sum2s", ALTIVEC_BUILTIN_VEC_SUM2S }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sums", ALTIVEC_BUILTIN_VEC_SUMS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_xor", ALTIVEC_BUILTIN_VEC_XOR }, + /* Place holder, leave as first spe builtin. */ { 0, CODE_FOR_spe_evaddw, "__builtin_spe_evaddw", SPE_BUILTIN_EVADDW }, { 0, CODE_FOR_spe_evand, "__builtin_spe_evand", SPE_BUILTIN_EVAND }, @@ -5420,7 +6539,7 @@ static struct builtin_description bdesc_2arg[] = { 0, CODE_FOR_spe_brinc, "__builtin_spe_brinc", SPE_BUILTIN_BRINC }, /* Place-holder. Leave as last binary SPE builtin. */ - { 0, CODE_FOR_xorv2si3, "__builtin_spe_evxor", SPE_BUILTIN_EVXOR }, + { 0, CODE_FOR_xorv2si3, "__builtin_spe_evxor", SPE_BUILTIN_EVXOR } }; /* AltiVec predicates. */ @@ -5448,7 +6567,11 @@ static const struct builtin_description_predicates bdesc_altivec_preds[] = { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v8hi, "*vcmpequh.", "__builtin_altivec_vcmpequh_p", ALTIVEC_BUILTIN_VCMPEQUH_P }, { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpequb.", "__builtin_altivec_vcmpequb_p", ALTIVEC_BUILTIN_VCMPEQUB_P }, { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtsb.", "__builtin_altivec_vcmpgtsb_p", ALTIVEC_BUILTIN_VCMPGTSB_P }, - { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtub.", "__builtin_altivec_vcmpgtub_p", ALTIVEC_BUILTIN_VCMPGTUB_P } + { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtub.", "__builtin_altivec_vcmpgtub_p", ALTIVEC_BUILTIN_VCMPGTUB_P }, + + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpeq_p", ALTIVEC_BUILTIN_VCMPEQ_P }, + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpgt_p", ALTIVEC_BUILTIN_VCMPGT_P }, + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpge_p", ALTIVEC_BUILTIN_VCMPGE_P } }; /* SPE predicates. */ @@ -5523,6 +6646,26 @@ static struct builtin_description bdesc_1arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vupklpx, "__builtin_altivec_vupklpx", ALTIVEC_BUILTIN_VUPKLPX }, { MASK_ALTIVEC, CODE_FOR_altivec_vupklsh, "__builtin_altivec_vupklsh", ALTIVEC_BUILTIN_VUPKLSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_abs", ALTIVEC_BUILTIN_VEC_ABS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_abss", ALTIVEC_BUILTIN_VEC_ABSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_ceil", ALTIVEC_BUILTIN_VEC_CEIL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_expte", ALTIVEC_BUILTIN_VEC_EXPTE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_floor", ALTIVEC_BUILTIN_VEC_FLOOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_loge", ALTIVEC_BUILTIN_VEC_LOGE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mtvscr", ALTIVEC_BUILTIN_VEC_MTVSCR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_re", ALTIVEC_BUILTIN_VEC_RE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_round", ALTIVEC_BUILTIN_VEC_ROUND }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_rsqrte", ALTIVEC_BUILTIN_VEC_RSQRTE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_trunc", ALTIVEC_BUILTIN_VEC_TRUNC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_unpackh", ALTIVEC_BUILTIN_VEC_UNPACKH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhsh", ALTIVEC_BUILTIN_VEC_VUPKHSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhpx", ALTIVEC_BUILTIN_VEC_VUPKHPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhsb", ALTIVEC_BUILTIN_VEC_VUPKHSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_unpackl", ALTIVEC_BUILTIN_VEC_UNPACKL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklpx", ALTIVEC_BUILTIN_VEC_VUPKLPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklsh", ALTIVEC_BUILTIN_VEC_VUPKLSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklsb", ALTIVEC_BUILTIN_VEC_VUPKLSB }, + /* The SPE unary builtins must start with SPE_BUILTIN_EVABS and end with SPE_BUILTIN_EVSUBFUSIAAW. */ { 0, CODE_FOR_spe_evabs, "__builtin_spe_evabs", SPE_BUILTIN_EVABS }, @@ -5555,7 +6698,7 @@ static struct builtin_description bdesc_1arg[] = { 0, CODE_FOR_spe_evsubfumiaaw, "__builtin_spe_evsubfumiaaw", SPE_BUILTIN_EVSUBFUMIAAW }, /* Place-holder. Leave as last unary SPE builtin. */ - { 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW }, + { 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW } }; static rtx @@ -5563,7 +6706,7 @@ rs6000_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat; tree arg0 = TREE_VALUE (arglist); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; @@ -5583,8 +6726,8 @@ rs6000_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target) { /* Only allow 5-bit *signed* literals. */ if (GET_CODE (op0) != CONST_INT - || INTVAL (op0) > 0x1f - || INTVAL (op0) < -0x1f) + || INTVAL (op0) > 15 + || INTVAL (op0) < -16) { error ("argument 1 must be a 5-bit signed literal"); return const0_rtx; @@ -5612,7 +6755,7 @@ altivec_expand_abs_builtin (enum insn_code icode, tree arglist, rtx target) { rtx pat, scratch1, scratch2; tree arg0 = TREE_VALUE (arglist); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; @@ -5645,8 +6788,8 @@ rs6000_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) rtx pat; tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; @@ -5713,15 +6856,15 @@ rs6000_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) } static rtx -altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, +altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, tree arglist, rtx target) { rtx pat, scratch; tree cr6_form = TREE_VALUE (arglist); tree arg0 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg1 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode tmode = SImode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; @@ -5735,8 +6878,7 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, else cr6_form_int = TREE_INT_CST_LOW (cr6_form); - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); /* If we have invalid arguments, bail out before generating bad rtl. */ if (arg0 == error_mark_node || arg1 == error_mark_node) @@ -5755,7 +6897,7 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, scratch = gen_reg_rtx (mode0); pat = GEN_FCN (icode) (scratch, op0, op1, - gen_rtx (SYMBOL_REF, Pmode, opcode)); + gen_rtx_SYMBOL_REF (Pmode, opcode)); if (! pat) return 0; emit_insn (pat); @@ -5768,24 +6910,24 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, If you think this is disgusting, look at the specs for the AltiVec predicates. */ - switch (cr6_form_int) - { - case 0: - emit_insn (gen_cr6_test_for_zero (target)); - break; - case 1: - emit_insn (gen_cr6_test_for_zero_reverse (target)); - break; - case 2: - emit_insn (gen_cr6_test_for_lt (target)); - break; - case 3: - emit_insn (gen_cr6_test_for_lt_reverse (target)); - break; - default: - error ("argument 1 of __builtin_altivec_predicate is out of range"); - break; - } + switch (cr6_form_int) + { + case 0: + emit_insn (gen_cr6_test_for_zero (target)); + break; + case 1: + emit_insn (gen_cr6_test_for_zero_reverse (target)); + break; + case 2: + emit_insn (gen_cr6_test_for_lt (target)); + break; + case 3: + emit_insn (gen_cr6_test_for_lt_reverse (target)); + break; + default: + error ("argument 1 of __builtin_altivec_predicate is out of range"); + break; + } return target; } @@ -5799,8 +6941,8 @@ altivec_expand_lv_builtin (enum insn_code icode, tree arglist, rtx target) enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = Pmode; enum machine_mode mode1 = Pmode; - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); if (icode == CODE_FOR_nothing) /* Builtin not supported on this processor. */ @@ -5815,7 +6957,7 @@ altivec_expand_lv_builtin (enum insn_code icode, tree arglist, rtx target) || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - op1 = copy_to_mode_reg (mode1, op1); + op1 = copy_to_mode_reg (mode1, op1); if (op0 == const0_rtx) { @@ -5842,9 +6984,9 @@ spe_expand_stv_builtin (enum insn_code icode, tree arglist) tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - rtx op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); + rtx op2 = expand_normal (arg2); rtx pat; enum machine_mode mode0 = insn_data[icode].operand[0].mode; enum machine_mode mode1 = insn_data[icode].operand[1].mode; @@ -5875,9 +7017,9 @@ altivec_expand_stv_builtin (enum insn_code icode, tree arglist) tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - rtx op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); + rtx op2 = expand_normal (arg2); rtx pat, addr; enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode1 = Pmode; @@ -5892,7 +7034,7 @@ altivec_expand_stv_builtin (enum insn_code icode, tree arglist) if (! (*insn_data[icode].operand[1].predicate) (op0, tmode)) op0 = copy_to_mode_reg (tmode, op0); - op2 = copy_to_mode_reg (mode2, op2); + op2 = copy_to_mode_reg (mode2, op2); if (op1 == const0_rtx) { @@ -5917,9 +7059,9 @@ rs6000_expand_ternop_builtin (enum insn_code icode, tree arglist, rtx target) tree arg0 = TREE_VALUE (arglist); tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - rtx op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); + rtx op2 = expand_normal (arg2); enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; @@ -5935,12 +7077,13 @@ rs6000_expand_ternop_builtin (enum insn_code icode, tree arglist, rtx target) || arg2 == error_mark_node) return const0_rtx; - if (icode == CODE_FOR_altivec_vsldoi_4sf - || icode == CODE_FOR_altivec_vsldoi_4si - || icode == CODE_FOR_altivec_vsldoi_8hi - || icode == CODE_FOR_altivec_vsldoi_16qi) + if (icode == CODE_FOR_altivec_vsldoi_v4sf + || icode == CODE_FOR_altivec_vsldoi_v4si + || icode == CODE_FOR_altivec_vsldoi_v8hi + || icode == CODE_FOR_altivec_vsldoi_v16qi) { /* Only allow 4-bit unsigned literals. */ + STRIP_NOPS (arg2); if (TREE_CODE (arg2) != INTEGER_CST || TREE_INT_CST_LOW (arg2) & ~0xf) { @@ -5984,16 +7127,16 @@ altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp) switch (fcode) { case ALTIVEC_BUILTIN_LD_INTERNAL_16qi: - icode = CODE_FOR_altivec_lvx_16qi; + icode = CODE_FOR_altivec_lvx_v16qi; break; case ALTIVEC_BUILTIN_LD_INTERNAL_8hi: - icode = CODE_FOR_altivec_lvx_8hi; + icode = CODE_FOR_altivec_lvx_v8hi; break; case ALTIVEC_BUILTIN_LD_INTERNAL_4si: - icode = CODE_FOR_altivec_lvx_4si; + icode = CODE_FOR_altivec_lvx_v4si; break; case ALTIVEC_BUILTIN_LD_INTERNAL_4sf: - icode = CODE_FOR_altivec_lvx_4sf; + icode = CODE_FOR_altivec_lvx_v4sf; break; default: *expandedp = false; @@ -6003,7 +7146,7 @@ altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp) *expandedp = true; arg0 = TREE_VALUE (arglist); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); tmode = insn_data[icode].operand[0].mode; mode0 = insn_data[icode].operand[1].mode; @@ -6024,7 +7167,7 @@ altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp) /* Expand the stvx builtins. */ static rtx -altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, +altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, bool *expandedp) { tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); @@ -6038,16 +7181,16 @@ altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, switch (fcode) { case ALTIVEC_BUILTIN_ST_INTERNAL_16qi: - icode = CODE_FOR_altivec_stvx_16qi; + icode = CODE_FOR_altivec_stvx_v16qi; break; case ALTIVEC_BUILTIN_ST_INTERNAL_8hi: - icode = CODE_FOR_altivec_stvx_8hi; + icode = CODE_FOR_altivec_stvx_v8hi; break; case ALTIVEC_BUILTIN_ST_INTERNAL_4si: - icode = CODE_FOR_altivec_stvx_4si; + icode = CODE_FOR_altivec_stvx_v4si; break; case ALTIVEC_BUILTIN_ST_INTERNAL_4sf: - icode = CODE_FOR_altivec_stvx_4sf; + icode = CODE_FOR_altivec_stvx_v4sf; break; default: *expandedp = false; @@ -6056,8 +7199,8 @@ altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); mode0 = insn_data[icode].operand[0].mode; mode1 = insn_data[icode].operand[1].mode; @@ -6076,7 +7219,7 @@ altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, /* Expand the dst builtins. */ static rtx -altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, +altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, bool *expandedp) { tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); @@ -6098,9 +7241,9 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); + op1 = expand_normal (arg1); + op2 = expand_normal (arg2); mode0 = insn_data[d->icode].operand[0].mode; mode1 = insn_data[d->icode].operand[1].mode; mode2 = insn_data[d->icode].operand[2].mode; @@ -6116,12 +7259,12 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, if (TREE_CODE (arg2) != INTEGER_CST || TREE_INT_CST_LOW (arg2) & ~0x3) { - error ("argument to `%s' must be a 2-bit unsigned literal", d->name); + error ("argument to %qs must be a 2-bit unsigned literal", d->name); return const0_rtx; } if (! (*insn_data[d->icode].operand[0].predicate) (op0, mode0)) - op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0)); + op0 = copy_to_mode_reg (Pmode, op0); if (! (*insn_data[d->icode].operand[1].predicate) (op1, mode1)) op1 = copy_to_mode_reg (mode1, op1); @@ -6135,6 +7278,111 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, return NULL_RTX; } +/* Expand vec_init builtin. */ +static rtx +altivec_expand_vec_init_builtin (tree type, tree arglist, rtx target) +{ + enum machine_mode tmode = TYPE_MODE (type); + enum machine_mode inner_mode = GET_MODE_INNER (tmode); + int i, n_elt = GET_MODE_NUNITS (tmode); + rtvec v = rtvec_alloc (n_elt); + + gcc_assert (VECTOR_MODE_P (tmode)); + + for (i = 0; i < n_elt; ++i, arglist = TREE_CHAIN (arglist)) + { + rtx x = expand_normal (TREE_VALUE (arglist)); + RTVEC_ELT (v, i) = gen_lowpart (inner_mode, x); + } + + gcc_assert (arglist == NULL); + + if (!target || !register_operand (target, tmode)) + target = gen_reg_rtx (tmode); + + rs6000_expand_vector_init (target, gen_rtx_PARALLEL (tmode, v)); + return target; +} + +/* Return the integer constant in ARG. Constrain it to be in the range + of the subparts of VEC_TYPE; issue an error if not. */ + +static int +get_element_number (tree vec_type, tree arg) +{ + unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1; + + if (!host_integerp (arg, 1) + || (elt = tree_low_cst (arg, 1), elt > max)) + { + error ("selector must be an integer constant in the range 0..%wi", max); + return 0; + } + + return elt; +} + +/* Expand vec_set builtin. */ +static rtx +altivec_expand_vec_set_builtin (tree arglist) +{ + enum machine_mode tmode, mode1; + tree arg0, arg1, arg2; + int elt; + rtx op0, op1; + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + + tmode = TYPE_MODE (TREE_TYPE (arg0)); + mode1 = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); + gcc_assert (VECTOR_MODE_P (tmode)); + + op0 = expand_expr (arg0, NULL_RTX, tmode, 0); + op1 = expand_expr (arg1, NULL_RTX, mode1, 0); + elt = get_element_number (TREE_TYPE (arg0), arg2); + + if (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode) + op1 = convert_modes (mode1, GET_MODE (op1), op1, true); + + op0 = force_reg (tmode, op0); + op1 = force_reg (mode1, op1); + + rs6000_expand_vector_set (op0, op1, elt); + + return op0; +} + +/* Expand vec_ext builtin. */ +static rtx +altivec_expand_vec_ext_builtin (tree arglist, rtx target) +{ + enum machine_mode tmode, mode0; + tree arg0, arg1; + int elt; + rtx op0; + + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + + op0 = expand_normal (arg0); + elt = get_element_number (TREE_TYPE (arg0), arg1); + + tmode = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); + mode0 = TYPE_MODE (TREE_TYPE (arg0)); + gcc_assert (VECTOR_MODE_P (mode0)); + + op0 = force_reg (mode0, op0); + + if (optimize || !target || !register_operand (target, tmode)) + target = gen_reg_rtx (tmode); + + rs6000_expand_vector_extract (target, op0, elt); + + return target; +} + /* Expand the builtin in EXP and store the result in TARGET. Store true in *EXPANDEDP if we found a builtin to expand. */ static rtx @@ -6151,6 +7399,14 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) enum machine_mode tmode, mode0; unsigned int fcode = DECL_FUNCTION_CODE (fndecl); + if (fcode >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && fcode <= ALTIVEC_BUILTIN_OVERLOADED_LAST) + { + *expandedp = true; + error ("unresolved overload for Altivec builtin %qF", fndecl); + return const0_rtx; + } + target = altivec_expand_ld_builtin (exp, target, expandedp); if (*expandedp) return target; @@ -6186,7 +7442,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - + pat = GEN_FCN (icode) (target); if (! pat) return 0; @@ -6196,7 +7452,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) case ALTIVEC_BUILTIN_MTVSCR: icode = CODE_FOR_altivec_mtvscr; arg0 = TREE_VALUE (arglist); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); mode0 = insn_data[icode].operand[0].mode; /* If we got invalid arguments bail out before generating bad rtl. */ @@ -6219,7 +7475,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) icode = CODE_FOR_altivec_dss; arg0 = TREE_VALUE (arglist); STRIP_NOPS (arg0); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); mode0 = insn_data[icode].operand[0].mode; /* If we got invalid arguments bail out before generating bad rtl. */ @@ -6239,14 +7495,27 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) emit_insn (gen_altivec_dss (op0)); return NULL_RTX; - case ALTIVEC_BUILTIN_COMPILETIME_ERROR: - arg0 = TREE_VALUE (arglist); - while (TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == ADDR_EXPR) - arg0 = TREE_OPERAND (arg0, 0); - error ("invalid parameter combination for `%s' AltiVec intrinsic", - TREE_STRING_POINTER (arg0)); + case ALTIVEC_BUILTIN_VEC_INIT_V4SI: + case ALTIVEC_BUILTIN_VEC_INIT_V8HI: + case ALTIVEC_BUILTIN_VEC_INIT_V16QI: + case ALTIVEC_BUILTIN_VEC_INIT_V4SF: + return altivec_expand_vec_init_builtin (TREE_TYPE (exp), arglist, target); - return const0_rtx; + case ALTIVEC_BUILTIN_VEC_SET_V4SI: + case ALTIVEC_BUILTIN_VEC_SET_V8HI: + case ALTIVEC_BUILTIN_VEC_SET_V16QI: + case ALTIVEC_BUILTIN_VEC_SET_V4SF: + return altivec_expand_vec_set_builtin (arglist); + + case ALTIVEC_BUILTIN_VEC_EXT_V4SI: + case ALTIVEC_BUILTIN_VEC_EXT_V8HI: + case ALTIVEC_BUILTIN_VEC_EXT_V16QI: + case ALTIVEC_BUILTIN_VEC_EXT_V4SF: + return altivec_expand_vec_ext_builtin (arglist, target); + + default: + break; + /* Fall through. */ } /* Expand abs* operations. */ @@ -6259,32 +7528,33 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) dp = (struct builtin_description_predicates *) bdesc_altivec_preds; for (i = 0; i < ARRAY_SIZE (bdesc_altivec_preds); i++, dp++) if (dp->code == fcode) - return altivec_expand_predicate_builtin (dp->icode, dp->opcode, arglist, target); + return altivec_expand_predicate_builtin (dp->icode, dp->opcode, + arglist, target); /* LV* are funky. We initialized them differently. */ switch (fcode) { case ALTIVEC_BUILTIN_LVSL: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvsl, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVSR: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvsr, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVEBX: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvebx, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVEHX: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvehx, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVEWX: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvewx, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVXL: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvxl, - arglist, target); + arglist, target); case ALTIVEC_BUILTIN_LVX: return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx, - arglist, target); + arglist, target); default: break; /* Fall through. */ @@ -6430,7 +7700,7 @@ spe_expand_builtin (tree exp, rtx target, bool *expandedp) || GET_MODE (target) != tmode || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - + pat = GEN_FCN (icode) (target); if (! pat) return 0; @@ -6439,7 +7709,7 @@ spe_expand_builtin (tree exp, rtx target, bool *expandedp) case SPE_BUILTIN_MTSPEFSCR: icode = CODE_FOR_spe_mtspefscr; arg0 = TREE_VALUE (arglist); - op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); + op0 = expand_normal (arg0); mode0 = insn_data[icode].operand[0].mode; if (arg0 == error_mark_node) @@ -6467,8 +7737,8 @@ spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target) tree form = TREE_VALUE (arglist); tree arg0 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg1 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; int form_int; @@ -6482,8 +7752,7 @@ spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target) else form_int = TREE_INT_CST_LOW (form); - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); if (arg0 == error_mark_node || arg1 == error_mark_node) return const0_rtx; @@ -6532,7 +7801,7 @@ spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target) case 0: /* We need to get to the OV bit, which is the ORDERED bit. We could generate (ordered:SI (reg:CC xx) (const_int 0)), but - that's ugly and will trigger a validate_condition_mode abort. + that's ugly and will make validate_condition_mode die. So let's just use another pattern. */ emit_insn (gen_move_from_CR_ov_bit (target, scratch)); return target; @@ -6577,15 +7846,14 @@ spe_expand_evsel_builtin (enum insn_code icode, tree arglist, rtx target) tree arg1 = TREE_VALUE (TREE_CHAIN (arglist)); tree arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); tree arg3 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))); - rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0); - rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); - rtx op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); - rtx op3 = expand_expr (arg3, NULL_RTX, VOIDmode, 0); + rtx op0 = expand_normal (arg0); + rtx op1 = expand_normal (arg1); + rtx op2 = expand_normal (arg2); + rtx op3 = expand_normal (arg3); enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); if (arg0 == error_mark_node || arg1 == error_mark_node || arg2 == error_mark_node || arg3 == error_mark_node) @@ -6628,8 +7896,8 @@ spe_expand_evsel_builtin (enum insn_code icode, tree arglist, rtx target) static rtx rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, - enum machine_mode mode ATTRIBUTE_UNUSED, - int ignore ATTRIBUTE_UNUSED) + enum machine_mode mode ATTRIBUTE_UNUSED, + int ignore ATTRIBUTE_UNUSED) { tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); tree arglist = TREE_OPERAND (exp, 1); @@ -6638,7 +7906,47 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, size_t i; rtx ret; bool success; - + + if (fcode == ALTIVEC_BUILTIN_MASK_FOR_LOAD + || fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE) + { + int icode = (int) CODE_FOR_altivec_lvsr; + enum machine_mode tmode = insn_data[icode].operand[0].mode; + enum machine_mode mode = insn_data[icode].operand[1].mode; + tree arg; + rtx op, addr, pat; + + gcc_assert (TARGET_ALTIVEC); + + arg = TREE_VALUE (arglist); + gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE); + op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL); + addr = memory_address (mode, op); + if (fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE) + op = addr; + else + { + /* For the load case need to negate the address. */ + op = gen_reg_rtx (GET_MODE (addr)); + emit_insn (gen_rtx_SET (VOIDmode, op, + gen_rtx_NEG (GET_MODE (addr), addr))); + } + op = gen_rtx_MEM (mode, op); + + if (target == 0 + || GET_MODE (target) != tmode + || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) + target = gen_reg_rtx (tmode); + + /*pat = gen_altivec_lvsr (target, op);*/ + pat = GEN_FCN (icode) (target, op); + if (!pat) + return 0; + emit_insn (pat); + + return target; + } + if (TARGET_ALTIVEC) { ret = altivec_expand_builtin (exp, target, &success); @@ -6654,49 +7962,76 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, return ret; } - if (TARGET_ALTIVEC || TARGET_SPE) - { - /* Handle simple unary operations. */ - d = (struct builtin_description *) bdesc_1arg; - for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_unop_builtin (d->icode, arglist, target); + gcc_assert (TARGET_ALTIVEC || TARGET_SPE); - /* Handle simple binary operations. */ - d = (struct builtin_description *) bdesc_2arg; - for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_binop_builtin (d->icode, arglist, target); + /* Handle simple unary operations. */ + d = (struct builtin_description *) bdesc_1arg; + for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_unop_builtin (d->icode, arglist, target); - /* Handle simple ternary operations. */ - d = (struct builtin_description *) bdesc_3arg; - for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_ternop_builtin (d->icode, arglist, target); - } + /* Handle simple binary operations. */ + d = (struct builtin_description *) bdesc_2arg; + for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_binop_builtin (d->icode, arglist, target); - abort (); - return NULL_RTX; + /* Handle simple ternary operations. */ + d = (struct builtin_description *) bdesc_3arg; + for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_ternop_builtin (d->icode, arglist, target); + + gcc_unreachable (); +} + +static tree +build_opaque_vector_type (tree node, int nunits) +{ + node = copy_node (node); + TYPE_MAIN_VARIANT (node) = node; + return build_vector_type (node, nunits); } static void rs6000_init_builtins (void) { - opaque_V2SI_type_node = copy_node (V2SI_type_node); - opaque_V2SF_type_node = copy_node (V2SF_type_node); + V2SI_type_node = build_vector_type (intSI_type_node, 2); + V2SF_type_node = build_vector_type (float_type_node, 2); + V4HI_type_node = build_vector_type (intHI_type_node, 4); + V4SI_type_node = build_vector_type (intSI_type_node, 4); + V4SF_type_node = build_vector_type (float_type_node, 4); + V8HI_type_node = build_vector_type (intHI_type_node, 8); + V16QI_type_node = build_vector_type (intQI_type_node, 16); + + unsigned_V16QI_type_node = build_vector_type (unsigned_intQI_type_node, 16); + unsigned_V8HI_type_node = build_vector_type (unsigned_intHI_type_node, 8); + unsigned_V4SI_type_node = build_vector_type (unsigned_intSI_type_node, 4); + + opaque_V2SF_type_node = build_opaque_vector_type (float_type_node, 2); + opaque_V2SI_type_node = build_opaque_vector_type (intSI_type_node, 2); opaque_p_V2SI_type_node = build_pointer_type (opaque_V2SI_type_node); + opaque_V4SI_type_node = copy_node (V4SI_type_node); /* The 'vector bool ...' types must be kept distinct from 'vector unsigned ...' - types, especially in C++ land. Similarly, 'vector pixel' is distinct from+ 'vector unsigned short'. */ + types, especially in C++ land. Similarly, 'vector pixel' is distinct from + 'vector unsigned short'. */ - bool_char_type_node = copy_node (unsigned_intQI_type_node); - TYPE_MAIN_VARIANT (bool_char_type_node) = bool_char_type_node; - bool_short_type_node = copy_node (unsigned_intHI_type_node); - TYPE_MAIN_VARIANT (bool_short_type_node) = bool_short_type_node; - bool_int_type_node = copy_node (unsigned_intSI_type_node); - TYPE_MAIN_VARIANT (bool_int_type_node) = bool_int_type_node; - pixel_type_node = copy_node (unsigned_intHI_type_node); - TYPE_MAIN_VARIANT (pixel_type_node) = pixel_type_node; + bool_char_type_node = build_distinct_type_copy (unsigned_intQI_type_node); + bool_short_type_node = build_distinct_type_copy (unsigned_intHI_type_node); + bool_int_type_node = build_distinct_type_copy (unsigned_intSI_type_node); + pixel_type_node = build_distinct_type_copy (unsigned_intHI_type_node); + + long_integer_type_internal_node = long_integer_type_node; + long_unsigned_type_internal_node = long_unsigned_type_node; + intQI_type_internal_node = intQI_type_node; + uintQI_type_internal_node = unsigned_intQI_type_node; + intHI_type_internal_node = intHI_type_node; + uintHI_type_internal_node = unsigned_intHI_type_node; + intSI_type_internal_node = intSI_type_node; + uintSI_type_internal_node = unsigned_intSI_type_node; + float_type_internal_node = float_type_node; + void_type_internal_node = void_type_node; (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, get_identifier ("__bool char"), @@ -6711,10 +8046,10 @@ rs6000_init_builtins (void) get_identifier ("__pixel"), pixel_type_node)); - bool_V16QI_type_node = make_vector (V16QImode, bool_char_type_node, 1); - bool_V8HI_type_node = make_vector (V8HImode, bool_short_type_node, 1); - bool_V4SI_type_node = make_vector (V4SImode, bool_int_type_node, 1); - pixel_V8HI_type_node = make_vector (V8HImode, pixel_type_node, 1); + bool_V16QI_type_node = build_vector_type (bool_char_type_node, 16); + bool_V8HI_type_node = build_vector_type (bool_short_type_node, 8); + bool_V4SI_type_node = build_vector_type (bool_int_type_node, 4); + pixel_V8HI_type_node = build_vector_type (pixel_type_node, 8); (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, get_identifier ("__vector unsigned char"), @@ -6759,6 +8094,12 @@ rs6000_init_builtins (void) altivec_init_builtins (); if (TARGET_ALTIVEC || TARGET_SPE) rs6000_common_init_builtins (); + +#if TARGET_XCOFF + /* AIX libm provides clog as __clog. */ + if (built_in_decls [BUILT_IN_CLOG]) + set_user_assembler_name (built_in_decls [BUILT_IN_CLOG], "__clog"); +#endif } /* Search through a set of builtins and enable the mask bits. @@ -6768,7 +8109,7 @@ rs6000_init_builtins (void) END is the builtin enum at which to end. */ static void enable_mask_for_builtins (struct builtin_description *desc, int size, - enum rs6000_builtins start, + enum rs6000_builtins start, enum rs6000_builtins end) { int i; @@ -6921,7 +8262,7 @@ spe_init_builtins (void) opaque_V2SI_type_node)); /* Initialize irregular SPE builtins. */ - + def_builtin (target_flags, "__builtin_spe_mtspefscr", void_ftype_int, SPE_BUILTIN_MTSPEFSCR); def_builtin (target_flags, "__builtin_spe_mfspefscr", int_ftype_void, SPE_BUILTIN_MFSPEFSCR); def_builtin (target_flags, "__builtin_spe_evstddx", void_ftype_v2si_pv2si_int, SPE_BUILTIN_EVSTDDX); @@ -6980,7 +8321,7 @@ spe_init_builtins (void) type = int_ftype_int_v2sf_v2sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (d->mask, d->name, type, d->code); @@ -7001,7 +8342,7 @@ spe_init_builtins (void) type = v2sf_ftype_4_v2sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (d->mask, d->name, type, d->code); @@ -7014,6 +8355,8 @@ altivec_init_builtins (void) struct builtin_description *d; struct builtin_description_predicates *dp; size_t i; + tree ftype; + tree pfloat_type_node = build_pointer_type (float_type_node); tree pint_type_node = build_pointer_type (integer_type_node); tree pshort_type_node = build_pointer_type (short_integer_type_node); @@ -7028,6 +8371,21 @@ altivec_init_builtins (void) tree pcvoid_type_node = build_pointer_type (build_qualified_type (void_type_node, TYPE_QUAL_CONST)); + tree int_ftype_opaque + = build_function_type_list (integer_type_node, + opaque_V4SI_type_node, NULL_TREE); + + tree opaque_ftype_opaque_int + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque_int + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, + integer_type_node, NULL_TREE); + tree int_ftype_int_opaque_opaque + = build_function_type_list (integer_type_node, + integer_type_node, opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); tree int_ftype_int_v4si_v4si = build_function_type_list (integer_type_node, integer_type_node, V4SI_type_node, @@ -7061,6 +8419,9 @@ altivec_init_builtins (void) tree void_ftype_int = build_function_type_list (void_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_long_pcvoid + = build_function_type_list (opaque_V4SI_type_node, + long_integer_type_node, pcvoid_type_node, NULL_TREE); tree v16qi_ftype_long_pcvoid = build_function_type_list (V16QI_type_node, long_integer_type_node, pcvoid_type_node, NULL_TREE); @@ -7071,6 +8432,10 @@ altivec_init_builtins (void) = build_function_type_list (V4SI_type_node, long_integer_type_node, pcvoid_type_node, NULL_TREE); + tree void_ftype_opaque_long_pvoid + = build_function_type_list (void_type_node, + opaque_V4SI_type_node, long_integer_type_node, + pvoid_type_node, NULL_TREE); tree void_ftype_v4si_long_pvoid = build_function_type_list (void_type_node, V4SI_type_node, long_integer_type_node, @@ -7107,10 +8472,7 @@ altivec_init_builtins (void) = build_function_type_list (void_type_node, pcvoid_type_node, integer_type_node, integer_type_node, NULL_TREE); - tree int_ftype_pcchar - = build_function_type_list (integer_type_node, - pcchar_type_node, NULL_TREE); - + def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_4sf", v4sf_ftype_pcfloat, ALTIVEC_BUILTIN_LD_INTERNAL_4sf); def_builtin (MASK_ALTIVEC, "__builtin_altivec_st_internal_4sf", void_ftype_pfloat_v4sf, @@ -7143,10 +8505,33 @@ altivec_init_builtins (void) def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvxl", void_ftype_v4si_long_pvoid, ALTIVEC_BUILTIN_STVXL); def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvebx", void_ftype_v16qi_long_pvoid, ALTIVEC_BUILTIN_STVEBX); def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvehx", void_ftype_v8hi_long_pvoid, ALTIVEC_BUILTIN_STVEHX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ld", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LD); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lde", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LDE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ldl", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LDL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvsl", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVSL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvsr", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVSR); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvebx", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEBX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvehx", v8hi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEHX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvewx", v4si_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEWX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_st", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_ST); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ste", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stl", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvewx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEWX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvebx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEBX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvehx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEHX); - /* See altivec.h for usage of "__builtin_altivec_compiletime_error". */ - def_builtin (MASK_ALTIVEC, "__builtin_altivec_compiletime_error", int_ftype_pcchar, - ALTIVEC_BUILTIN_COMPILETIME_ERROR); + def_builtin (MASK_ALTIVEC, "__builtin_vec_step", int_ftype_opaque, ALTIVEC_BUILTIN_VEC_STEP); + + def_builtin (MASK_ALTIVEC, "__builtin_vec_sld", opaque_ftype_opaque_opaque_int, ALTIVEC_BUILTIN_VEC_SLD); + def_builtin (MASK_ALTIVEC, "__builtin_vec_splat", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_SPLAT); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vspltw", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTW); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vsplth", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTH); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vspltb", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTB); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ctf", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTF); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vcfsx", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VCFSX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vcfux", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VCFUX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_cts", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTS); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ctu", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTU); /* Add the DST variants. */ d = (struct builtin_description *) bdesc_dst; @@ -7159,11 +8544,19 @@ altivec_init_builtins (void) { enum machine_mode mode1; tree type; + bool is_overloaded = dp->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && dp->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - mode1 = insn_data[dp->icode].operand[1].mode; + if (is_overloaded) + mode1 = VOIDmode; + else + mode1 = insn_data[dp->icode].operand[1].mode; switch (mode1) { + case VOIDmode: + type = int_ftype_int_opaque_opaque; + break; case V4SImode: type = int_ftype_int_v4si_v4si; break; @@ -7177,9 +8570,9 @@ altivec_init_builtins (void) type = int_ftype_int_v4sf_v4sf; break; default: - abort (); + gcc_unreachable (); } - + def_builtin (dp->mask, dp->name, type, dp->code); } @@ -7207,11 +8600,110 @@ altivec_init_builtins (void) type = v4sf_ftype_v4sf; break; default: - abort (); + gcc_unreachable (); } - + def_builtin (d->mask, d->name, type, d->code); } + + if (TARGET_ALTIVEC) + { + tree decl; + + /* Initialize target builtin that implements + targetm.vectorize.builtin_mask_for_load. */ + + decl = lang_hooks.builtin_function ("__builtin_altivec_mask_for_load", + v16qi_ftype_long_pcvoid, + ALTIVEC_BUILTIN_MASK_FOR_LOAD, + BUILT_IN_MD, NULL, + tree_cons (get_identifier ("const"), + NULL_TREE, NULL_TREE)); + /* Record the decl. Will be used by rs6000_builtin_mask_for_load. */ + altivec_builtin_mask_for_load = decl; + } + + /* Access to the vec_init patterns. */ + ftype = build_function_type_list (V4SI_type_node, integer_type_node, + integer_type_node, integer_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_init_v4si", ftype, + ALTIVEC_BUILTIN_VEC_INIT_V4SI); + + ftype = build_function_type_list (V8HI_type_node, short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, + short_integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_init_v8hi", ftype, + ALTIVEC_BUILTIN_VEC_INIT_V8HI); + + ftype = build_function_type_list (V16QI_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, char_type_node, + char_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_init_v16qi", ftype, + ALTIVEC_BUILTIN_VEC_INIT_V16QI); + + ftype = build_function_type_list (V4SF_type_node, float_type_node, + float_type_node, float_type_node, + float_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_init_v4sf", ftype, + ALTIVEC_BUILTIN_VEC_INIT_V4SF); + + /* Access to the vec_set patterns. */ + ftype = build_function_type_list (V4SI_type_node, V4SI_type_node, + intSI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_set_v4si", ftype, + ALTIVEC_BUILTIN_VEC_SET_V4SI); + + ftype = build_function_type_list (V8HI_type_node, V8HI_type_node, + intHI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_set_v8hi", ftype, + ALTIVEC_BUILTIN_VEC_SET_V8HI); + + ftype = build_function_type_list (V8HI_type_node, V16QI_type_node, + intQI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_set_v16qi", ftype, + ALTIVEC_BUILTIN_VEC_SET_V16QI); + + ftype = build_function_type_list (V4SF_type_node, V4SF_type_node, + float_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_set_v4sf", ftype, + ALTIVEC_BUILTIN_VEC_SET_V4SF); + + /* Access to the vec_extract patterns. */ + ftype = build_function_type_list (intSI_type_node, V4SI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ext_v4si", ftype, + ALTIVEC_BUILTIN_VEC_EXT_V4SI); + + ftype = build_function_type_list (intHI_type_node, V8HI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ext_v8hi", ftype, + ALTIVEC_BUILTIN_VEC_EXT_V8HI); + + ftype = build_function_type_list (intQI_type_node, V16QI_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ext_v16qi", ftype, + ALTIVEC_BUILTIN_VEC_EXT_V16QI); + + ftype = build_function_type_list (float_type_node, V4SF_type_node, + integer_type_node, NULL_TREE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ext_v4sf", ftype, + ALTIVEC_BUILTIN_VEC_EXT_V4SF); } static void @@ -7262,6 +8754,10 @@ rs6000_common_init_builtins (void) integer_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); + tree v2si_ftype_v2si = build_function_type_list (opaque_V2SI_type_node, opaque_V2SI_type_node, NULL_TREE); @@ -7269,7 +8765,7 @@ rs6000_common_init_builtins (void) tree v2sf_ftype_v2sf = build_function_type_list (opaque_V2SF_type_node, opaque_V2SF_type_node, NULL_TREE); - + tree v2sf_ftype_v2si = build_function_type_list (opaque_V2SF_type_node, opaque_V2SI_type_node, NULL_TREE); @@ -7296,6 +8792,9 @@ rs6000_common_init_builtins (void) integer_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, NULL_TREE); tree v4si_ftype_v4si_v4si = build_function_type_list (V4SI_type_node, V4SI_type_node, V4SI_type_node, NULL_TREE); @@ -7333,6 +8832,10 @@ rs6000_common_init_builtins (void) tree v4sf_ftype_v4sf_v4sf = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); tree v4sf_ftype_v4sf_v4sf_v4si = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, @@ -7341,7 +8844,7 @@ rs6000_common_init_builtins (void) = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, V4SF_type_node, NULL_TREE); - tree v4si_ftype_v4si_v4si_v4si + tree v4si_ftype_v4si_v4si_v4si = build_function_type_list (V4SI_type_node, V4SI_type_node, V4SI_type_node, V4SI_type_node, NULL_TREE); @@ -7352,11 +8855,11 @@ rs6000_common_init_builtins (void) = build_function_type_list (V8HI_type_node, V8HI_type_node, V8HI_type_node, V8HI_type_node, NULL_TREE); - tree v4si_ftype_v8hi_v8hi_v4si + tree v4si_ftype_v8hi_v8hi_v4si = build_function_type_list (V4SI_type_node, V8HI_type_node, V8HI_type_node, V4SI_type_node, NULL_TREE); - tree v4si_ftype_v16qi_v16qi_v4si + tree v4si_ftype_v16qi_v16qi_v4si = build_function_type_list (V4SI_type_node, V16QI_type_node, V16QI_type_node, V4SI_type_node, NULL_TREE); @@ -7406,23 +8909,37 @@ rs6000_common_init_builtins (void) d = (struct builtin_description *) bdesc_3arg; for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) { - enum machine_mode mode0, mode1, mode2, mode3; tree type; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; + + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + mode2 = VOIDmode; + mode3 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; + + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + mode2 = insn_data[d->icode].operand[2].mode; + mode3 = insn_data[d->icode].operand[3].mode; + } - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; - - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; - mode2 = insn_data[d->icode].operand[2].mode; - mode3 = insn_data[d->icode].operand[3].mode; - /* When all four are of the same mode. */ if (mode0 == mode1 && mode1 == mode2 && mode2 == mode3) { switch (mode0) { + case VOIDmode: + type = opaque_ftype_opaque_opaque_opaque; + break; case V4SImode: type = v4si_ftype_v4si_v4si_v4si; break; @@ -7431,16 +8948,16 @@ rs6000_common_init_builtins (void) break; case V8HImode: type = v8hi_ftype_v8hi_v8hi_v8hi; - break; + break; case V16QImode: type = v16qi_ftype_v16qi_v16qi_v16qi; - break; + break; default: - abort(); + gcc_unreachable (); } } else if (mode0 == mode1 && mode1 == mode2 && mode3 == V16QImode) - { + { switch (mode0) { case V4SImode: @@ -7451,21 +8968,21 @@ rs6000_common_init_builtins (void) break; case V8HImode: type = v8hi_ftype_v8hi_v8hi_v16qi; - break; + break; case V16QImode: type = v16qi_ftype_v16qi_v16qi_v16qi; - break; + break; default: - abort(); + gcc_unreachable (); } } - else if (mode0 == V4SImode && mode1 == V16QImode && mode2 == V16QImode + else if (mode0 == V4SImode && mode1 == V16QImode && mode2 == V16QImode && mode3 == V4SImode) type = v4si_ftype_v16qi_v16qi_v4si; - else if (mode0 == V4SImode && mode1 == V8HImode && mode2 == V8HImode + else if (mode0 == V4SImode && mode1 == V8HImode && mode2 == V8HImode && mode3 == V4SImode) type = v4si_ftype_v8hi_v8hi_v4si; - else if (mode0 == V4SFmode && mode1 == V4SFmode && mode2 == V4SFmode + else if (mode0 == V4SFmode && mode1 == V4SFmode && mode2 == V4SFmode && mode3 == V4SImode) type = v4sf_ftype_v4sf_v4sf_v4si; @@ -7490,7 +9007,7 @@ rs6000_common_init_builtins (void) type = v4sf_ftype_v4sf_v4sf_int; else - abort (); + gcc_unreachable (); def_builtin (d->mask, d->name, type, d->code); } @@ -7501,19 +9018,33 @@ rs6000_common_init_builtins (void) { enum machine_mode mode0, mode1, mode2; tree type; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; - - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; - mode2 = insn_data[d->icode].operand[2].mode; + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + mode2 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; + + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + mode2 = insn_data[d->icode].operand[2].mode; + } /* When all three operands are of the same mode. */ if (mode0 == mode1 && mode1 == mode2) { switch (mode0) { + case VOIDmode: + type = opaque_ftype_opaque_opaque; + break; case V4SFmode: type = v4sf_ftype_v4sf_v4sf; break; @@ -7536,7 +9067,7 @@ rs6000_common_init_builtins (void) type = int_ftype_int_int; break; default: - abort (); + gcc_unreachable (); } } @@ -7573,15 +9104,15 @@ rs6000_common_init_builtins (void) /* vint, vshort, vint. */ else if (mode0 == V4SImode && mode1 == V8HImode && mode2 == V4SImode) type = v4si_ftype_v8hi_v4si; - + /* vint, vint, 5 bit literal. */ else if (mode0 == V4SImode && mode1 == V4SImode && mode2 == QImode) type = v4si_ftype_v4si_int; - + /* vshort, vshort, 5 bit literal. */ else if (mode0 == V8HImode && mode1 == V8HImode && mode2 == QImode) type = v8hi_ftype_v8hi_int; - + /* vchar, vchar, 5 bit literal. */ else if (mode0 == V16QImode && mode1 == V16QImode && mode2 == QImode) type = v16qi_ftype_v16qi_int; @@ -7589,7 +9120,7 @@ rs6000_common_init_builtins (void) /* vfloat, vint, 5 bit literal. */ else if (mode0 == V4SFmode && mode1 == V4SImode && mode2 == QImode) type = v4sf_ftype_v4si_int; - + /* vint, vfloat, 5 bit literal. */ else if (mode0 == V4SImode && mode1 == V4SFmode && mode2 == QImode) type = v4si_ftype_v4sf_int; @@ -7603,9 +9134,10 @@ rs6000_common_init_builtins (void) else if (mode0 == V2SImode && mode1 == SImode && mode2 == QImode) type = v2si_ftype_int_char; - /* int, x, x. */ - else if (mode0 == SImode) + else { + /* int, x, x. */ + gcc_assert (mode0 == SImode); switch (mode1) { case V4SImode: @@ -7621,13 +9153,10 @@ rs6000_common_init_builtins (void) type = int_ftype_v8hi_v8hi; break; default: - abort (); + gcc_unreachable (); } } - else - abort (); - def_builtin (d->mask, d->name, type, d->code); } @@ -7637,19 +9166,31 @@ rs6000_common_init_builtins (void) { enum machine_mode mode0, mode1; tree type; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; - - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; + + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + } if (mode0 == V4SImode && mode1 == QImode) - type = v4si_ftype_int; + type = v4si_ftype_int; else if (mode0 == V8HImode && mode1 == QImode) - type = v8hi_ftype_int; + type = v8hi_ftype_int; else if (mode0 == V16QImode && mode1 == QImode) - type = v16qi_ftype_int; + type = v16qi_ftype_int; + else if (mode0 == VOIDmode && mode1 == VOIDmode) + type = opaque_ftype_opaque; else if (mode0 == V4SFmode && mode1 == V4SFmode) type = v4sf_ftype_v4sf; else if (mode0 == V8HImode && mode1 == V16QImode) @@ -7667,7 +9208,7 @@ rs6000_common_init_builtins (void) else if (mode0 == V2SImode && mode1 == QImode) type = v2si_ftype_char; else - abort (); + gcc_unreachable (); def_builtin (d->mask, d->name, type, d->code); } @@ -7676,36 +9217,53 @@ rs6000_common_init_builtins (void) static void rs6000_init_libfuncs (void) { - if (!TARGET_HARD_FLOAT) - return; - - if (DEFAULT_ABI != ABI_V4) + if (DEFAULT_ABI != ABI_V4 && TARGET_XCOFF + && !TARGET_POWER2 && !TARGET_POWERPC) { - if (TARGET_XCOFF && ! TARGET_POWER2 && ! TARGET_POWERPC) - { - /* AIX library routines for float->int conversion. */ - set_conv_libfunc (sfix_optab, SImode, DFmode, "__itrunc"); - set_conv_libfunc (ufix_optab, SImode, DFmode, "__uitrunc"); - set_conv_libfunc (sfix_optab, SImode, TFmode, "_qitrunc"); - set_conv_libfunc (ufix_optab, SImode, TFmode, "_quitrunc"); - } - - /* AIX/Darwin/64-bit Linux quad floating point routines. */ - if (!TARGET_XL_COMPAT) - { - set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); - set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); - set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); - set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); - } - else - { - set_optab_libfunc (add_optab, TFmode, "_xlqadd"); - set_optab_libfunc (sub_optab, TFmode, "_xlqsub"); - set_optab_libfunc (smul_optab, TFmode, "_xlqmul"); - set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv"); - } + /* AIX library routines for float->int conversion. */ + set_conv_libfunc (sfix_optab, SImode, DFmode, "__itrunc"); + set_conv_libfunc (ufix_optab, SImode, DFmode, "__uitrunc"); + set_conv_libfunc (sfix_optab, SImode, TFmode, "_qitrunc"); + set_conv_libfunc (ufix_optab, SImode, TFmode, "_quitrunc"); } + + if (!TARGET_IEEEQUAD) + /* AIX/Darwin/64-bit Linux quad floating point routines. */ + if (!TARGET_XL_COMPAT) + { + set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); + set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); + set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); + set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); + + if (TARGET_SOFT_FLOAT) + { + set_optab_libfunc (neg_optab, TFmode, "__gcc_qneg"); + set_optab_libfunc (eq_optab, TFmode, "__gcc_qeq"); + set_optab_libfunc (ne_optab, TFmode, "__gcc_qne"); + set_optab_libfunc (gt_optab, TFmode, "__gcc_qgt"); + set_optab_libfunc (ge_optab, TFmode, "__gcc_qge"); + set_optab_libfunc (lt_optab, TFmode, "__gcc_qlt"); + set_optab_libfunc (le_optab, TFmode, "__gcc_qle"); + set_optab_libfunc (unord_optab, TFmode, "__gcc_qunord"); + + set_conv_libfunc (sext_optab, TFmode, SFmode, "__gcc_stoq"); + set_conv_libfunc (sext_optab, TFmode, DFmode, "__gcc_dtoq"); + set_conv_libfunc (trunc_optab, SFmode, TFmode, "__gcc_qtos"); + set_conv_libfunc (trunc_optab, DFmode, TFmode, "__gcc_qtod"); + set_conv_libfunc (sfix_optab, SImode, TFmode, "__gcc_qtoi"); + set_conv_libfunc (ufix_optab, SImode, TFmode, "__gcc_qtou"); + set_conv_libfunc (sfloat_optab, TFmode, SImode, "__gcc_itoq"); + set_conv_libfunc (ufloat_optab, TFmode, SImode, "__gcc_utoq"); + } + } + else + { + set_optab_libfunc (add_optab, TFmode, "_xlqadd"); + set_optab_libfunc (sub_optab, TFmode, "_xlqsub"); + set_optab_libfunc (smul_optab, TFmode, "_xlqmul"); + set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv"); + } else { /* 32-bit SVR4 quad floating point routines. */ @@ -7732,8 +9290,102 @@ rs6000_init_libfuncs (void) set_conv_libfunc (sfix_optab, SImode, TFmode, "_q_qtoi"); set_conv_libfunc (ufix_optab, SImode, TFmode, "_q_qtou"); set_conv_libfunc (sfloat_optab, TFmode, SImode, "_q_itoq"); + set_conv_libfunc (ufloat_optab, TFmode, SImode, "_q_utoq"); } } + + +/* Expand a block clear operation, and return 1 if successful. Return 0 + if we should let the compiler generate normal code. + + operands[0] is the destination + operands[1] is the length + operands[3] is the alignment */ + +int +expand_block_clear (rtx operands[]) +{ + rtx orig_dest = operands[0]; + rtx bytes_rtx = operands[1]; + rtx align_rtx = operands[3]; + bool constp = (GET_CODE (bytes_rtx) == CONST_INT); + HOST_WIDE_INT align; + HOST_WIDE_INT bytes; + int offset; + int clear_bytes; + int clear_step; + + /* If this is not a fixed size move, just call memcpy */ + if (! constp) + return 0; + + /* This must be a fixed size alignment */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); + align = INTVAL (align_rtx) * BITS_PER_UNIT; + + /* Anything to clear? */ + bytes = INTVAL (bytes_rtx); + if (bytes <= 0) + return 1; + + /* Use the builtin memset after a point, to avoid huge code bloat. + When optimize_size, avoid any significant code bloat; calling + memset is about 4 instructions, so allow for one instruction to + load zero and three to do clearing. */ + if (TARGET_ALTIVEC && align >= 128) + clear_step = 16; + else if (TARGET_POWERPC64 && align >= 32) + clear_step = 8; + else + clear_step = 4; + + if (optimize_size && bytes > 3 * clear_step) + return 0; + if (! optimize_size && bytes > 8 * clear_step) + return 0; + + for (offset = 0; bytes > 0; offset += clear_bytes, bytes -= clear_bytes) + { + enum machine_mode mode = BLKmode; + rtx dest; + + if (bytes >= 16 && TARGET_ALTIVEC && align >= 128) + { + clear_bytes = 16; + mode = V4SImode; + } + else if (bytes >= 8 && TARGET_POWERPC64 + /* 64-bit loads and stores require word-aligned + displacements. */ + && (align >= 64 || (!STRICT_ALIGNMENT && align >= 32))) + { + clear_bytes = 8; + mode = DImode; + } + else if (bytes >= 4 && (align >= 32 || !STRICT_ALIGNMENT)) + { /* move 4 bytes */ + clear_bytes = 4; + mode = SImode; + } + else if (bytes >= 2 && (align >= 16 || !STRICT_ALIGNMENT)) + { /* move 2 bytes */ + clear_bytes = 2; + mode = HImode; + } + else /* move 1 byte at a time */ + { + clear_bytes = 1; + mode = QImode; + } + + dest = adjust_address (orig_dest, mode, offset); + + emit_move_insn (dest, CONST0_RTX (mode)); + } + + return 1; +} + /* Expand a block move operation, and return 1 if successful. Return 0 if we should let the compiler generate normal code. @@ -7764,10 +9416,9 @@ expand_block_move (rtx operands[]) if (! constp) return 0; - /* If this is not a fixed size alignment, abort */ - if (GET_CODE (align_rtx) != CONST_INT) - abort (); - align = INTVAL (align_rtx); + /* This must be a fixed size alignment */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); + align = INTVAL (align_rtx) * BITS_PER_UNIT; /* Anything to move? */ bytes = INTVAL (bytes_rtx); @@ -7775,20 +9426,28 @@ expand_block_move (rtx operands[]) return 1; /* store_one_arg depends on expand_block_move to handle at least the size of - reg_parm_stack_space. */ + reg_parm_stack_space. */ if (bytes > (TARGET_POWERPC64 ? 64 : 32)) return 0; for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes) { union { - rtx (*movstrsi) (rtx, rtx, rtx, rtx); + rtx (*movmemsi) (rtx, rtx, rtx, rtx); rtx (*mov) (rtx, rtx); } gen_func; enum machine_mode mode = BLKmode; rtx src, dest; - - if (TARGET_STRING + + /* Altivec first, since it will be faster than a string move + when it applies, and usually not significantly larger. */ + if (TARGET_ALTIVEC && bytes >= 16 && align >= 128) + { + move_bytes = 16; + mode = V4SImode; + gen_func.mov = gen_movv4si; + } + else if (TARGET_STRING && bytes > 24 /* move up to 32 bytes at a time */ && ! fixed_regs[5] && ! fixed_regs[6] @@ -7800,7 +9459,7 @@ expand_block_move (rtx operands[]) && ! fixed_regs[12]) { move_bytes = (bytes > 32) ? 32 : bytes; - gen_func.movstrsi = gen_movstrsi_8reg; + gen_func.movmemsi = gen_movmemsi_8reg; } else if (TARGET_STRING && bytes > 16 /* move up to 24 bytes at a time */ @@ -7812,7 +9471,7 @@ expand_block_move (rtx operands[]) && ! fixed_regs[10]) { move_bytes = (bytes > 24) ? 24 : bytes; - gen_func.movstrsi = gen_movstrsi_6reg; + gen_func.movmemsi = gen_movmemsi_6reg; } else if (TARGET_STRING && bytes > 8 /* move up to 16 bytes at a time */ @@ -7822,12 +9481,12 @@ expand_block_move (rtx operands[]) && ! fixed_regs[8]) { move_bytes = (bytes > 16) ? 16 : bytes; - gen_func.movstrsi = gen_movstrsi_4reg; + gen_func.movmemsi = gen_movmemsi_4reg; } else if (bytes >= 8 && TARGET_POWERPC64 /* 64-bit loads and stores require word-aligned displacements. */ - && (align >= 8 || (! STRICT_ALIGNMENT && align >= 4))) + && (align >= 64 || (!STRICT_ALIGNMENT && align >= 32))) { move_bytes = 8; mode = DImode; @@ -7836,15 +9495,15 @@ expand_block_move (rtx operands[]) else if (TARGET_STRING && bytes > 4 && !TARGET_POWERPC64) { /* move up to 8 bytes at a time */ move_bytes = (bytes > 8) ? 8 : bytes; - gen_func.movstrsi = gen_movstrsi_2reg; + gen_func.movmemsi = gen_movmemsi_2reg; } - else if (bytes >= 4 && (align >= 4 || ! STRICT_ALIGNMENT)) + else if (bytes >= 4 && (align >= 32 || !STRICT_ALIGNMENT)) { /* move 4 bytes */ move_bytes = 4; mode = SImode; gen_func.mov = gen_movsi; } - else if (bytes >= 2 && (align >= 2 || ! STRICT_ALIGNMENT)) + else if (bytes >= 2 && (align >= 16 || !STRICT_ALIGNMENT)) { /* move 2 bytes */ move_bytes = 2; mode = HImode; @@ -7853,7 +9512,7 @@ expand_block_move (rtx operands[]) else if (TARGET_STRING && bytes > 1) { /* move up to 4 bytes at a time */ move_bytes = (bytes > 4) ? 4 : bytes; - gen_func.movstrsi = gen_movstrsi_1reg; + gen_func.movmemsi = gen_movmemsi_1reg; } else /* move 1 byte at a time */ { @@ -7861,14 +9520,14 @@ expand_block_move (rtx operands[]) mode = QImode; gen_func.mov = gen_movqi; } - + src = adjust_address (orig_src, mode, offset); dest = adjust_address (orig_dest, mode, offset); - - if (mode != BLKmode) + + if (mode != BLKmode) { rtx tmp_reg = gen_reg_rtx (mode); - + emit_insn ((*gen_func.mov) (tmp_reg, src)); stores[num_reg++] = (*gen_func.mov) (dest, tmp_reg); } @@ -7883,7 +9542,7 @@ expand_block_move (rtx operands[]) if (mode == BLKmode) { - /* Move the address into scratch registers. The movstrsi + /* Move the address into scratch registers. The movmemsi patterns require zero offset. */ if (!REG_P (XEXP (src, 0))) { @@ -7891,15 +9550,15 @@ expand_block_move (rtx operands[]) src = replace_equiv_address (src, src_reg); } set_mem_size (src, GEN_INT (move_bytes)); - + if (!REG_P (XEXP (dest, 0))) { rtx dest_reg = copy_addr_to_reg (XEXP (dest, 0)); dest = replace_equiv_address (dest, dest_reg); } set_mem_size (dest, GEN_INT (move_bytes)); - - emit_insn ((*gen_func.movstrsi) (dest, src, + + emit_insn ((*gen_func.movmemsi) (dest, src, GEN_INT (move_bytes & 31), align_rtx)); } @@ -7909,88 +9568,6 @@ expand_block_move (rtx operands[]) } -/* Return 1 if OP is a load multiple operation. It is known to be a - PARALLEL and the first section will be tested. */ - -int -load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - unsigned int dest_regno; - rtx src_addr; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != SImode - || REGNO (SET_DEST (elt)) != dest_regno + i - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != SImode - || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) - || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4) - return 0; - } - - return 1; -} - -/* Similar, but tests for store multiple. Here, the second vector element - is a CLOBBER. It will be tested later. */ - -int -store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0) - 1; - unsigned int src_regno; - rtx dest_addr; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i + 1); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != SImode - || REGNO (SET_SRC (elt)) != src_regno + i - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != SImode - || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) - || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4) - return 0; - } - - return 1; -} - /* Return a string to perform a load_multiple operation. operands[0] is the vector. operands[1] is the source address. @@ -8048,405 +9625,43 @@ rs6000_output_load_multiple (rtx operands[3]) return "{lsi|lswi} %2,%1,%N0"; } -/* Return 1 for a parallel vrsave operation. */ - -int -vrsave_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - unsigned int dest_regno, src_regno; - int i; - - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC_VOLATILE) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - - if (dest_regno != VRSAVE_REGNO - && src_regno != VRSAVE_REGNO) - return 0; - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != CLOBBER - && GET_CODE (elt) != SET) - return 0; - } - - return 1; -} - -/* Return 1 for an PARALLEL suitable for mfcr. */ - -int -mfcr_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count < 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC - || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2) - return 0; - - for (i = 0; i < count; i++) - { - rtx exp = XVECEXP (op, 0, i); - rtx unspec; - int maskval; - rtx src_reg; - - src_reg = XVECEXP (SET_SRC (exp), 0, 0); - - if (GET_CODE (src_reg) != REG - || GET_MODE (src_reg) != CCmode - || ! CR_REGNO_P (REGNO (src_reg))) - return 0; - - if (GET_CODE (exp) != SET - || GET_CODE (SET_DEST (exp)) != REG - || GET_MODE (SET_DEST (exp)) != SImode - || ! INT_REGNO_P (REGNO (SET_DEST (exp)))) - return 0; - unspec = SET_SRC (exp); - maskval = 1 << (MAX_CR_REGNO - REGNO (src_reg)); - - if (GET_CODE (unspec) != UNSPEC - || XINT (unspec, 1) != UNSPEC_MOVESI_FROM_CR - || XVECLEN (unspec, 0) != 2 - || XVECEXP (unspec, 0, 0) != src_reg - || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT - || INTVAL (XVECEXP (unspec, 0, 1)) != maskval) - return 0; - } - return 1; -} - -/* Return 1 for an PARALLEL suitable for mtcrf. */ - -int -mtcrf_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - rtx src_reg; - - /* Perform a quick check so we don't blow up below. */ - if (count < 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC - || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2) - return 0; - src_reg = XVECEXP (SET_SRC (XVECEXP (op, 0, 0)), 0, 0); - - if (GET_CODE (src_reg) != REG - || GET_MODE (src_reg) != SImode - || ! INT_REGNO_P (REGNO (src_reg))) - return 0; - - for (i = 0; i < count; i++) - { - rtx exp = XVECEXP (op, 0, i); - rtx unspec; - int maskval; - - if (GET_CODE (exp) != SET - || GET_CODE (SET_DEST (exp)) != REG - || GET_MODE (SET_DEST (exp)) != CCmode - || ! CR_REGNO_P (REGNO (SET_DEST (exp)))) - return 0; - unspec = SET_SRC (exp); - maskval = 1 << (MAX_CR_REGNO - REGNO (SET_DEST (exp))); - - if (GET_CODE (unspec) != UNSPEC - || XINT (unspec, 1) != UNSPEC_MOVESI_TO_CR - || XVECLEN (unspec, 0) != 2 - || XVECEXP (unspec, 0, 0) != src_reg - || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT - || INTVAL (XVECEXP (unspec, 0, 1)) != maskval) - return 0; - } - return 1; -} - -/* Return 1 for an PARALLEL suitable for lmw. */ - -int -lmw_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - unsigned int dest_regno; - rtx src_addr; - unsigned int base_regno; - HOST_WIDE_INT offset; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); - - if (dest_regno > 31 - || count != 32 - (int) dest_regno) - return 0; - - if (legitimate_indirect_address_p (src_addr, 0)) - { - offset = 0; - base_regno = REGNO (src_addr); - if (base_regno == 0) - return 0; - } - else if (legitimate_offset_address_p (SImode, src_addr, 0)) - { - offset = INTVAL (XEXP (src_addr, 1)); - base_regno = REGNO (XEXP (src_addr, 0)); - } - else - return 0; - - for (i = 0; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - rtx newaddr; - rtx addr_reg; - HOST_WIDE_INT newoffset; - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != SImode - || REGNO (SET_DEST (elt)) != dest_regno + i - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != SImode) - return 0; - newaddr = XEXP (SET_SRC (elt), 0); - if (legitimate_indirect_address_p (newaddr, 0)) - { - newoffset = 0; - addr_reg = newaddr; - } - else if (legitimate_offset_address_p (SImode, newaddr, 0)) - { - addr_reg = XEXP (newaddr, 0); - newoffset = INTVAL (XEXP (newaddr, 1)); - } - else - return 0; - if (REGNO (addr_reg) != base_regno - || newoffset != offset + 4 * i) - return 0; - } - - return 1; -} - -/* Return 1 for an PARALLEL suitable for stmw. */ - -int -stmw_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - unsigned int src_regno; - rtx dest_addr; - unsigned int base_regno; - HOST_WIDE_INT offset; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); - - if (src_regno > 31 - || count != 32 - (int) src_regno) - return 0; - - if (legitimate_indirect_address_p (dest_addr, 0)) - { - offset = 0; - base_regno = REGNO (dest_addr); - if (base_regno == 0) - return 0; - } - else if (legitimate_offset_address_p (SImode, dest_addr, 0)) - { - offset = INTVAL (XEXP (dest_addr, 1)); - base_regno = REGNO (XEXP (dest_addr, 0)); - } - else - return 0; - - for (i = 0; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - rtx newaddr; - rtx addr_reg; - HOST_WIDE_INT newoffset; - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != SImode - || REGNO (SET_SRC (elt)) != src_regno + i - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != SImode) - return 0; - newaddr = XEXP (SET_DEST (elt), 0); - if (legitimate_indirect_address_p (newaddr, 0)) - { - newoffset = 0; - addr_reg = newaddr; - } - else if (legitimate_offset_address_p (SImode, newaddr, 0)) - { - addr_reg = XEXP (newaddr, 0); - newoffset = INTVAL (XEXP (newaddr, 1)); - } - else - return 0; - if (REGNO (addr_reg) != base_regno - || newoffset != offset + 4 * i) - return 0; - } - - return 1; -} /* A validation routine: say whether CODE, a condition code, and MODE match. The other alternatives either don't make sense or should never be generated. */ -static void +void validate_condition_mode (enum rtx_code code, enum machine_mode mode) { - if (GET_RTX_CLASS (code) != '<' - || GET_MODE_CLASS (mode) != MODE_CC) - abort (); + gcc_assert ((GET_RTX_CLASS (code) == RTX_COMPARE + || GET_RTX_CLASS (code) == RTX_COMM_COMPARE) + && GET_MODE_CLASS (mode) == MODE_CC); /* These don't make sense. */ - if ((code == GT || code == LT || code == GE || code == LE) - && mode == CCUNSmode) - abort (); + gcc_assert ((code != GT && code != LT && code != GE && code != LE) + || mode != CCUNSmode); - if ((code == GTU || code == LTU || code == GEU || code == LEU) - && mode != CCUNSmode) - abort (); + gcc_assert ((code != GTU && code != LTU && code != GEU && code != LEU) + || mode == CCUNSmode); - if (mode != CCFPmode - && (code == ORDERED || code == UNORDERED - || code == UNEQ || code == LTGT - || code == UNGT || code == UNLT - || code == UNGE || code == UNLE)) - abort (); - - /* These should never be generated except for + gcc_assert (mode == CCFPmode + || (code != ORDERED && code != UNORDERED + && code != UNEQ && code != LTGT + && code != UNGT && code != UNLT + && code != UNGE && code != UNLE)); + + /* These should never be generated except for flag_finite_math_only. */ - if (mode == CCFPmode - && ! flag_finite_math_only - && (code == LE || code == GE - || code == UNEQ || code == LTGT - || code == UNGT || code == UNLT)) - abort (); + gcc_assert (mode != CCFPmode + || flag_finite_math_only + || (code != LE && code != GE + && code != UNEQ && code != LTGT + && code != UNGT && code != UNLT)); /* These are invalid; the information is not there. */ - if (mode == CCEQmode - && code != EQ && code != NE) - abort (); + gcc_assert (mode != CCEQmode || code == EQ || code == NE); } -/* Return 1 if OP is a comparison operation that is valid for a branch insn. - We only check the opcode against the mode of the CC value here. */ - -int -branch_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - enum machine_mode cc_mode; - - if (GET_RTX_CLASS (code) != '<') - return 0; - - cc_mode = GET_MODE (XEXP (op, 0)); - if (GET_MODE_CLASS (cc_mode) != MODE_CC) - return 0; - - validate_condition_mode (code, cc_mode); - - return 1; -} - -/* Return 1 if OP is a comparison operation that is valid for a branch - insn and which is true if the corresponding bit in the CC register - is set. */ - -int -branch_positive_comparison_operator (rtx op, enum machine_mode mode) -{ - enum rtx_code code; - - if (! branch_comparison_operator (op, mode)) - return 0; - - code = GET_CODE (op); - return (code == EQ || code == LT || code == GT - || code == LTU || code == GTU - || code == UNORDERED); -} - -/* Return 1 if OP is a comparison operation that is valid for an scc - insn: it must be a positive comparison. */ - -int -scc_comparison_operator (rtx op, enum machine_mode mode) -{ - return branch_positive_comparison_operator (op, mode); -} - -int -trap_comparison_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - return GET_RTX_CLASS (GET_CODE (op)) == '<'; -} - -int -boolean_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - return (code == AND || code == IOR || code == XOR); -} - -int -boolean_or_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - return (code == IOR || code == XOR); -} - -int -min_max_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - return (code == SMIN || code == SMAX || code == UMIN || code == UMAX); -} /* Return 1 if ANDOP is a mask that has no bits on that are not in the mask required to convert the result of a rotate insn into a shift @@ -8637,17 +9852,39 @@ includes_rldicr_lshift_p (rtx shiftop, rtx andop) return 0; } -/* Return 1 if REGNO (reg1) == REGNO (reg2) - 1 making them candidates - for lfq and stfq insns. +/* Return 1 if operands will generate a valid arguments to rlwimi +instruction for insert with right shift in 64-bit mode. The mask may +not start on the first bit or stop on the last bit because wrap-around +effects of instruction do not correspond to semantics of RTL insn. */ - Note reg1 and reg2 *must* be hard registers. To be sure we will - abort if we are passed pseudo registers. */ +int +insvdi_rshift_rlwimi_p (rtx sizeop, rtx startop, rtx shiftop) +{ + if (INTVAL (startop) > 32 + && INTVAL (startop) < 64 + && INTVAL (sizeop) > 1 + && INTVAL (sizeop) + INTVAL (startop) < 64 + && INTVAL (shiftop) > 0 + && INTVAL (sizeop) + INTVAL (shiftop) < 32 + && (64 - (INTVAL (shiftop) & 63)) >= INTVAL (sizeop)) + return 1; + + return 0; +} + +/* Return 1 if REGNO (reg1) == REGNO (reg2) - 1 making them candidates + for lfq and stfq insns iff the registers are hard registers. */ int registers_ok_for_quad_peep (rtx reg1, rtx reg2) { /* We might have been passed a SUBREG. */ - if (GET_CODE (reg1) != REG || GET_CODE (reg2) != REG) + if (GET_CODE (reg1) != REG || GET_CODE (reg2) != REG) + return 0; + + /* We might have been passed non floating point registers. */ + if (!FP_REGNO_P (REGNO (reg1)) + || !FP_REGNO_P (REGNO (reg2))) return 0; return (REGNO (reg1) == REGNO (reg2) - 1); @@ -8658,10 +9895,18 @@ registers_ok_for_quad_peep (rtx reg1, rtx reg2) (addr2 == addr1 + 8). */ int -addrs_ok_for_quad_peep (rtx addr1, rtx addr2) +mems_ok_for_quad_peep (rtx mem1, rtx mem2) { - unsigned int reg1; - int offset1; + rtx addr1, addr2; + unsigned int reg1, reg2; + int offset1, offset2; + + /* The mems cannot be volatile. */ + if (MEM_VOLATILE_P (mem1) || MEM_VOLATILE_P (mem2)) + return 0; + + addr1 = XEXP (mem1, 0); + addr2 = XEXP (mem2, 0); /* Extract an offset (if used) from the first addr. */ if (GET_CODE (addr1) == PLUS) @@ -8671,11 +9916,11 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2) return 0; else { - reg1 = REGNO (XEXP (addr1, 0)); + reg1 = REGNO (XEXP (addr1, 0)); /* The offset must be constant! */ if (GET_CODE (XEXP (addr1, 1)) != CONST_INT) - return 0; - offset1 = INTVAL (XEXP (addr1, 1)); + return 0; + offset1 = INTVAL (XEXP (addr1, 1)); } } else if (GET_CODE (addr1) != REG) @@ -8687,23 +9932,36 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2) offset1 = 0; } - /* Make sure the second address is a (mem (plus (reg) (const_int))) - or if it is (mem (reg)) then make sure that offset1 is -8 and the same - register as addr1. */ - if (offset1 == -8 && GET_CODE (addr2) == REG && reg1 == REGNO (addr2)) - return 1; - if (GET_CODE (addr2) != PLUS) + /* And now for the second addr. */ + if (GET_CODE (addr2) == PLUS) + { + /* If not a REG, return zero. */ + if (GET_CODE (XEXP (addr2, 0)) != REG) + return 0; + else + { + reg2 = REGNO (XEXP (addr2, 0)); + /* The offset must be constant. */ + if (GET_CODE (XEXP (addr2, 1)) != CONST_INT) + return 0; + offset2 = INTVAL (XEXP (addr2, 1)); + } + } + else if (GET_CODE (addr2) != REG) return 0; + else + { + reg2 = REGNO (addr2); + /* This was a simple (mem (reg)) expression. Offset is 0. */ + offset2 = 0; + } - if (GET_CODE (XEXP (addr2, 0)) != REG - || GET_CODE (XEXP (addr2, 1)) != CONST_INT) - return 0; - - if (reg1 != REGNO (XEXP (addr2, 0))) + /* Both of these must have the same base register. */ + if (reg1 != reg2) return 0; /* The offset for the second addr must be 8 more than the first addr. */ - if (INTVAL (XEXP (addr2, 1)) != offset1 + 8) + if (offset2 != offset1 + 8) return 0; /* All the tests passed. addr1 and addr2 are valid for lfq or stfq @@ -8716,31 +9974,31 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2) NO_REGS is returned. */ enum reg_class -secondary_reload_class (enum reg_class class, - enum machine_mode mode, - rtx in) +rs6000_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx in) { int regno; if (TARGET_ELF || (DEFAULT_ABI == ABI_DARWIN #if TARGET_MACHO - && MACHOPIC_INDIRECT + && MACHOPIC_INDIRECT #endif - )) + )) { /* We cannot copy a symbolic operand directly into anything - other than BASE_REGS for TARGET_ELF. So indicate that a - register from BASE_REGS is needed as an intermediate - register. - + other than BASE_REGS for TARGET_ELF. So indicate that a + register from BASE_REGS is needed as an intermediate + register. + On Darwin, pic addresses require a load from memory, which needs a base register. */ if (class != BASE_REGS - && (GET_CODE (in) == SYMBOL_REF - || GET_CODE (in) == HIGH - || GET_CODE (in) == LABEL_REF - || GET_CODE (in) == CONST)) - return BASE_REGS; + && (GET_CODE (in) == SYMBOL_REF + || GET_CODE (in) == HIGH + || GET_CODE (in) == LABEL_REF + || GET_CODE (in) == CONST)) + return BASE_REGS; } if (GET_CODE (in) == REG) @@ -8788,7 +10046,7 @@ secondary_reload_class (enum reg_class class, } /* Given a comparison operation, return the bit number in CCR to test. We - know this is a valid comparison. + know this is a valid comparison. SCC_P is 1 if this is for an scc. That means that %D will have been used instead of %C, so the bits will be in different places. @@ -8804,14 +10062,12 @@ ccr_bit (rtx op, int scc_p) int base_bit; rtx reg; - if (GET_RTX_CLASS (code) != '<') + if (!COMPARISON_P (op)) return -1; reg = XEXP (op, 0); - if (GET_CODE (reg) != REG - || ! CR_REGNO_P (REGNO (reg))) - abort (); + gcc_assert (GET_CODE (reg) == REG && CR_REGNO_P (REGNO (reg))); cc_mode = GET_MODE (reg); cc_regnum = REGNO (reg); @@ -8821,10 +10077,10 @@ ccr_bit (rtx op, int scc_p) /* When generating a sCOND operation, only positive conditions are allowed. */ - if (scc_p && code != EQ && code != GT && code != LT && code != UNORDERED - && code != GTU && code != LTU) - abort (); - + gcc_assert (!scc_p + || code == EQ || code == GT || code == LT || code == UNORDERED + || code == GTU || code == LTU); + switch (code) { case NE: @@ -8848,13 +10104,13 @@ ccr_bit (rtx op, int scc_p) return scc_p ? base_bit + 3 : base_bit + 1; default: - abort (); + gcc_unreachable (); } } /* Return the GOT register. */ -struct rtx_def * +rtx rs6000_got_register (rtx value ATTRIBUTE_UNUSED) { /* The second flow pass currently (June 1999) can't update @@ -8896,8 +10152,7 @@ extract_MB (rtx op) from the left. */ if ((val & 0x80000000) == 0) { - if ((val & 0xffffffff) == 0) - abort (); + gcc_assert (val & 0xffffffff); i = 1; while (((val <<= 1) & 0x80000000) == 0) @@ -8929,8 +10184,7 @@ extract_ME (rtx op) the right. */ if ((val & 1) == 0) { - if ((val & 0xffffffff) == 0) - abort (); + gcc_assert (val & 0xffffffff); i = 30; while (((val >>= 1) & 1) == 0) @@ -8970,7 +10224,7 @@ rs6000_get_some_local_dynamic_name (void) rs6000_get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } /* Helper function for rs6000_get_some_local_dynamic_name. */ @@ -8993,6 +10247,36 @@ rs6000_get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) return 0; } +/* Write out a function code label. */ + +void +rs6000_output_function_entry (FILE *file, const char *fname) +{ + if (fname[0] != '.') + { + switch (DEFAULT_ABI) + { + default: + gcc_unreachable (); + + case ABI_AIX: + if (DOT_SYMBOLS) + putc ('.', file); + else + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "L."); + break; + + case ABI_V4: + case ABI_DARWIN: + break; + } + } + if (TARGET_AIX) + RS6000_OUTPUT_BASENAME (file, fname); + else + assemble_name (file, fname); +} + /* Print an operand. Recognize special options, documented below. */ #if TARGET_ELF @@ -9043,7 +10327,7 @@ print_operand (FILE *file, rtx x, int code) case 'B': /* If the low-order bit is zero, write 'r'; otherwise, write 'l' for 64-bit mask direction. */ - putc (((INT_LOWPART(x) & 1) == 0 ? 'r' : 'l'), file); + putc (((INT_LOWPART (x) & 1) == 0 ? 'r' : 'l'), file); return; /* %c is output_addr_const if a CONSTANT_ADDRESS_P, otherwise @@ -9052,21 +10336,20 @@ print_operand (FILE *file, rtx x, int code) case 'c': /* X is a CR register. Print the number of the GT bit of the CR. */ if (GET_CODE (x) != REG || ! CR_REGNO_P (REGNO (x))) - output_operand_lossage ("invalid %%E value"); + output_operand_lossage ("invalid %%E value"); else - fprintf (file, "%d", 4 * (REGNO (x) - CR0_REGNO) + 1); + fprintf (file, "%d", 4 * (REGNO (x) - CR0_REGNO) + 1); return; case 'D': - /* Like 'J' but get to the EQ bit. */ - if (GET_CODE (x) != REG) - abort (); + /* Like 'J' but get to the GT bit only. */ + gcc_assert (GET_CODE (x) == REG); - /* Bit 1 is EQ bit. */ - i = 4 * (REGNO (x) - CR0_REGNO) + 2; + /* Bit 1 is GT bit. */ + i = 4 * (REGNO (x) - CR0_REGNO) + 1; - /* If we want bit 31, write a shift count of zero, not 32. */ - fprintf (file, "%d", i == 31 ? 0 : i + 1); + /* Add one for shift count in rlinm for scc. */ + fprintf (file, "%d", i + 1); return; case 'E': @@ -9192,7 +10475,7 @@ print_operand (FILE *file, rtx x, int code) /* Write second word of DImode or DFmode reference. Works on register or non-indexed memory only. */ if (GET_CODE (x) == REG) - fprintf (file, "%s", reg_names[REGNO (x) + 1]); + fputs (reg_names[REGNO (x) + 1], file); else if (GET_CODE (x) == MEM) { /* Handle possible auto-increment. Since it is pre-increment and @@ -9211,7 +10494,7 @@ print_operand (FILE *file, rtx x, int code) reg_names[SMALL_DATA_REG]); } return; - + case 'm': /* MB value for a mask operand. */ if (! mask_operand (x, SImode)) @@ -9263,15 +10546,15 @@ print_operand (FILE *file, rtx x, int code) || REGNO (XEXP (x, 0)) >= 32) output_operand_lossage ("invalid %%P value"); else - fprintf (file, "%s", reg_names[REGNO (XEXP (x, 0))]); + fputs (reg_names[REGNO (XEXP (x, 0))], file); return; case 'q': /* This outputs the logical code corresponding to a boolean expression. The expression may have one or both operands negated (if one, only the first one). For condition register - logical operations, it will also treat the negated - CR codes as NOTs, but not handle NOTs of them. */ + logical operations, it will also treat the negated + CR codes as NOTs, but not handle NOTs of them. */ { const char *const *t = 0; const char *s; @@ -9299,14 +10582,14 @@ print_operand (FILE *file, rtx x, int code) else s = t[1]; } - + fputs (s, file); } return; case 'Q': if (TARGET_MFCRF) - fputc (',',file); + fputc (',', file); /* FALLTHRU */ else return; @@ -9353,15 +10636,13 @@ print_operand (FILE *file, rtx x, int code) } while (uval != 0) --i, uval >>= 1; - if (i < 0) - abort (); + gcc_assert (i >= 0); fprintf (file, "%d", i); return; case 't': /* Like 'J' but get to the OVERFLOW/UNORDERED bit. */ - if (GET_CODE (x) != REG || GET_MODE (x) != CCmode) - abort (); + gcc_assert (GET_CODE (x) == REG && GET_MODE (x) == CCmode); /* Bit 3 is OV bit. */ i = 4 * (REGNO (x) - CR0_REGNO) + 3; @@ -9386,7 +10667,7 @@ print_operand (FILE *file, rtx x, int code) if (! INT_P (x)) output_operand_lossage ("invalid %%u value"); else - fprintf (file, HOST_WIDE_INT_PRINT_HEX, + fprintf (file, HOST_WIDE_INT_PRINT_HEX, (INT_LOWPART (x) >> 16) & 0xffff); return; @@ -9442,7 +10723,7 @@ print_operand (FILE *file, rtx x, int code) fputs ("lge", file); /* 5 */ break; default: - abort (); + gcc_unreachable (); } break; @@ -9450,7 +10731,7 @@ print_operand (FILE *file, rtx x, int code) /* If constant, low-order 16 bits of constant, signed. Otherwise, write normally. */ if (INT_P (x)) - fprintf (file, HOST_WIDE_INT_PRINT_DEC, + fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((INT_LOWPART (x) & 0xffff) ^ 0x8000) - 0x8000); else print_operand (file, x, 0); @@ -9475,9 +10756,8 @@ print_operand (FILE *file, rtx x, int code) { val = CONST_DOUBLE_LOW (x); - if (val == 0) - abort (); - else if (val < 0) + gcc_assert (val); + if (val < 0) --i; else for ( ; i < 64; i++) @@ -9498,7 +10778,7 @@ print_operand (FILE *file, rtx x, int code) case 'Y': /* Like 'L', for third word of TImode */ if (GET_CODE (x) == REG) - fprintf (file, "%s", reg_names[REGNO (x) + 2]); + fputs (reg_names[REGNO (x) + 2], file); else if (GET_CODE (x) == MEM) { if (GET_CODE (XEXP (x, 0)) == PRE_INC @@ -9511,42 +10791,41 @@ print_operand (FILE *file, rtx x, int code) reg_names[SMALL_DATA_REG]); } return; - + case 'z': /* X is a SYMBOL_REF. Write out the name preceded by a period and without any trailing data in brackets. Used for function names. If we are configured for System V (or the embedded ABI) on the PowerPC, do not emit the period, since those systems do not use TOCs and the like. */ - if (GET_CODE (x) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); - if (XSTR (x, 0)[0] != '.') + /* Mark the decl as referenced so that cgraph will output the + function. */ + if (SYMBOL_REF_DECL (x)) + mark_decl_referenced (SYMBOL_REF_DECL (x)); + + /* For macho, check to see if we need a stub. */ + if (TARGET_MACHO) { - switch (DEFAULT_ABI) - { - default: - abort (); - - case ABI_AIX: - putc ('.', file); - break; - - case ABI_V4: - case ABI_DARWIN: - break; - } + const char *name = XSTR (x, 0); +#if TARGET_MACHO + if (MACHOPIC_INDIRECT + && machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION) + name = machopic_indirection_name (x, /*stub_p=*/true); +#endif + assemble_name (file, name); } - if (TARGET_AIX) - RS6000_OUTPUT_BASENAME (file, XSTR (x, 0)); - else + else if (!DOT_SYMBOLS) assemble_name (file, XSTR (x, 0)); + else + rs6000_output_function_entry (file, XSTR (x, 0)); return; case 'Z': /* Like 'L', for last word of TImode. */ if (GET_CODE (x) == REG) - fprintf (file, "%s", reg_names[REGNO (x) + 3]); + fputs (reg_names[REGNO (x) + 3], file); else if (GET_CODE (x) == MEM) { if (GET_CODE (XEXP (x, 0)) == PRE_INC @@ -9565,12 +10844,12 @@ print_operand (FILE *file, rtx x, int code) { rtx tmp; - if (GET_CODE (x) != MEM) - abort (); + gcc_assert (GET_CODE (x) == MEM); tmp = XEXP (x, 0); - if (TARGET_E500) + /* Ugly hack because %y is overloaded. */ + if (TARGET_E500 && GET_MODE_SIZE (GET_MODE (x)) == 8) { /* Handle [reg]. */ if (GET_CODE (tmp) == REG) @@ -9584,8 +10863,7 @@ print_operand (FILE *file, rtx x, int code) { int x; - if (GET_CODE (XEXP (tmp, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (tmp, 0)) == REG); x = INTVAL (XEXP (tmp, 1)); fprintf (file, "%d(%s)", x, reg_names[REGNO (XEXP (tmp, 0))]); @@ -9594,10 +10872,19 @@ print_operand (FILE *file, rtx x, int code) /* Fall through. Must be [reg+reg]. */ } + if (TARGET_ALTIVEC + && GET_CODE (tmp) == AND + && GET_CODE (XEXP (tmp, 1)) == CONST_INT + && INTVAL (XEXP (tmp, 1)) == -16) + tmp = XEXP (tmp, 0); if (GET_CODE (tmp) == REG) fprintf (file, "0,%s", reg_names[REGNO (tmp)]); - else if (GET_CODE (tmp) == PLUS && GET_CODE (XEXP (tmp, 1)) == REG) + else { + gcc_assert (GET_CODE (tmp) == PLUS + && REG_P (XEXP (tmp, 0)) + && REG_P (XEXP (tmp, 1))); + if (REGNO (XEXP (tmp, 0)) == 0) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ], reg_names[ REGNO (XEXP (tmp, 0)) ]); @@ -9605,11 +10892,9 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 0)) ], reg_names[ REGNO (XEXP (tmp, 1)) ]); } - else - abort (); break; } - + case 0: if (GET_CODE (x) == REG) fprintf (file, "%s", reg_names[REGNO (x)]); @@ -9653,11 +10938,12 @@ print_operand_address (FILE *file, rtx x) if (small_data_operand (x, GET_MODE (x))) fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[SMALL_DATA_REG]); - else if (TARGET_TOC) - abort (); + else + gcc_assert (!TARGET_TOC); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) { + gcc_assert (REG_P (XEXP (x, 0))); if (REGNO (XEXP (x, 0)) == 0) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 1)) ], reg_names[ REGNO (XEXP (x, 0)) ]); @@ -9670,7 +10956,7 @@ print_operand_address (FILE *file, rtx x) INTVAL (XEXP (x, 1)), reg_names[ REGNO (XEXP (x, 0)) ]); #if TARGET_ELF else if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 0)) == REG - && CONSTANT_P (XEXP (x, 1))) + && CONSTANT_P (XEXP (x, 1))) { output_addr_const (file, XEXP (x, 1)); fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]); @@ -9678,7 +10964,7 @@ print_operand_address (FILE *file, rtx x) #endif #if TARGET_MACHO else if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 0)) == REG - && CONSTANT_P (XEXP (x, 1))) + && CONSTANT_P (XEXP (x, 1))) { fprintf (file, "lo16("); output_addr_const (file, XEXP (x, 1)); @@ -9692,7 +10978,7 @@ print_operand_address (FILE *file, rtx x) rtx contains_minus = XEXP (x, 1); rtx minus, symref; const char *name; - + /* Find the (minus (sym) (toc)) buried in X, and temporarily turn it into (sym) for output_addr_const. */ while (GET_CODE (XEXP (contains_minus, 0)) != MINUS) @@ -9722,7 +11008,7 @@ print_operand_address (FILE *file, rtx x) fprintf (file, "(%s)", reg_names[REGNO (XEXP (x, 0))]); } else - abort (); + gcc_unreachable (); } /* Target hook for assembling integer objects. The PowerPC version has @@ -9737,14 +11023,14 @@ rs6000_assemble_integer (rtx x, unsigned int size, int aligned_p) /* Special handling for SI values. */ if (RELOCATABLE_NEEDS_FIXUP && size == 4 && aligned_p) { - extern int in_toc_section (void); static int recurse = 0; - + /* For -mrelocatable, we mark all addresses that need to be fixed up in the .fixup section. */ if (TARGET_RELOCATABLE - && !in_toc_section () - && !in_text_section () + && in_section != toc_section + && in_section != text_section + && !unlikely_text_section_p (in_section) && !recurse && GET_CODE (x) != CONST_INT && GET_CODE (x) != CONST_DOUBLE @@ -9795,10 +11081,12 @@ rs6000_assemble_visibility (tree decl, int vis) { /* Functions need to have their entry point symbol visibility set as well as their descriptor symbol visibility. */ - if (DEFAULT_ABI == ABI_AIX && TREE_CODE (decl) == FUNCTION_DECL) + if (DEFAULT_ABI == ABI_AIX + && DOT_SYMBOLS + && TREE_CODE (decl) == FUNCTION_DECL) { static const char * const visibility_types[] = { - NULL, "internal", "hidden", "protected" + NULL, "internal", "hidden", "protected" }; const char *name, *type; @@ -9820,7 +11108,7 @@ rs6000_reverse_condition (enum machine_mode mode, enum rtx_code code) { /* Reversal of FP compares takes care -- an ordered compare becomes an unordered compare and vice versa. */ - if (mode == CCFPmode + if (mode == CCFPmode && (!flag_finite_math_only || code == UNLT || code == UNLE || code == UNGT || code == UNGE || code == UNEQ || code == LTGT)) @@ -9841,7 +11129,17 @@ rs6000_generate_compare (enum rtx_code code) if (rs6000_compare_fp_p) comp_mode = CCFPmode; else if (code == GTU || code == LTU - || code == GEU || code == LEU) + || code == GEU || code == LEU) + comp_mode = CCUNSmode; + else if ((code == EQ || code == NE) + && GET_CODE (rs6000_compare_op0) == SUBREG + && GET_CODE (rs6000_compare_op1) == SUBREG + && SUBREG_PROMOTED_UNSIGNED_P (rs6000_compare_op0) + && SUBREG_PROMOTED_UNSIGNED_P (rs6000_compare_op1)) + /* These are unsigned values, perhaps there will be a later + ordering compare that can be shared with this one. + Unfortunately we cannot detect the signedness of the operands + for non-subregs. */ comp_mode = CCUNSmode; else comp_mode = CCmode; @@ -9849,40 +11147,94 @@ rs6000_generate_compare (enum rtx_code code) /* First, the compare. */ compare_result = gen_reg_rtx (comp_mode); - /* SPE FP compare instructions on the GPRs. Yuck! */ + /* E500 FP compare instructions on the GPRs. Yuck! */ if ((TARGET_E500 && !TARGET_FPRS && TARGET_HARD_FLOAT) && rs6000_compare_fp_p) { - rtx cmp, or1, or2, or_result, compare_result2; + rtx cmp, or_result, compare_result2; + enum machine_mode op_mode = GET_MODE (rs6000_compare_op0); - /* Note: The E500 comparison instructions set the GT bit (x + - 1), on success. This explains the mess. */ + if (op_mode == VOIDmode) + op_mode = GET_MODE (rs6000_compare_op1); + + /* The E500 FP compare instructions toggle the GT bit (CR bit 1) only. + This explains the following mess. */ switch (code) { - case EQ: case UNEQ: case NE: case LTGT: - cmp = flag_finite_math_only - ? gen_tstsfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); + case EQ: case UNEQ: case NE: case LTGT: + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; - case GT: case GTU: case UNGT: case UNGE: case GE: case GEU: - cmp = flag_finite_math_only - ? gen_tstsfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); + + case GT: case GTU: case UNGT: case UNGE: case GE: case GEU: + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; - case LT: case LTU: case UNLT: case UNLE: case LE: case LEU: - cmp = flag_finite_math_only - ? gen_tstsflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); + + case LT: case LTU: case UNLT: case UNLE: case LE: case LEU: + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; - default: - abort (); + default: + gcc_unreachable (); } /* Synthesize LE and GE from LT/GT || EQ. */ @@ -9896,30 +11248,39 @@ rs6000_generate_compare (enum rtx_code code) case GE: code = GT; break; case LEU: code = LT; break; case GEU: code = GT; break; - default: abort (); + default: gcc_unreachable (); } - or1 = gen_reg_rtx (SImode); - or2 = gen_reg_rtx (SImode); - or_result = gen_reg_rtx (CCEQmode); compare_result2 = gen_reg_rtx (CCFPmode); /* Do the EQ. */ - cmp = flag_finite_math_only - ? gen_tstsfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1); + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } emit_insn (cmp); - or1 = gen_rtx_GT (SImode, compare_result, const0_rtx); - or2 = gen_rtx_GT (SImode, compare_result2, const0_rtx); - /* OR them together. */ - cmp = gen_rtx_SET (VOIDmode, or_result, - gen_rtx_COMPARE (CCEQmode, - gen_rtx_IOR (SImode, or1, or2), - const_true_rtx)); + or_result = gen_reg_rtx (CCFPmode); + cmp = gen_e500_cr_ior_compare (or_result, compare_result, + compare_result2); compare_result = or_result; code = EQ; } @@ -9927,8 +11288,8 @@ rs6000_generate_compare (enum rtx_code code) { if (code == NE || code == LTGT) code = NE; - else - code = EQ; + else + code = EQ; } emit_insn (cmp); @@ -9936,13 +11297,13 @@ rs6000_generate_compare (enum rtx_code code) else { /* Generate XLC-compatible TFmode compare as PARALLEL with extra - CLOBBERs to match cmptf_internal2 pattern. */ + CLOBBERs to match cmptf_internal2 pattern. */ if (comp_mode == CCFPmode && TARGET_XL_COMPAT - && GET_MODE (rs6000_compare_op0) == TFmode - && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128) - emit_insn (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (9, + && GET_MODE (rs6000_compare_op0) == TFmode + && !TARGET_IEEEQUAD + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128) + emit_insn (gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (9, gen_rtx_SET (VOIDmode, compare_result, gen_rtx_COMPARE (comp_mode, @@ -9956,18 +11317,31 @@ rs6000_generate_compare (enum rtx_code code) gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)), gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)), gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode))))); + else if (GET_CODE (rs6000_compare_op1) == UNSPEC + && XINT (rs6000_compare_op1, 1) == UNSPEC_SP_TEST) + { + rtx op1 = XVECEXP (rs6000_compare_op1, 0, 0); + comp_mode = CCEQmode; + compare_result = gen_reg_rtx (CCEQmode); + if (TARGET_64BIT) + emit_insn (gen_stack_protect_testdi (compare_result, + rs6000_compare_op0, op1)); + else + emit_insn (gen_stack_protect_testsi (compare_result, + rs6000_compare_op0, op1)); + } else emit_insn (gen_rtx_SET (VOIDmode, compare_result, gen_rtx_COMPARE (comp_mode, - rs6000_compare_op0, + rs6000_compare_op0, rs6000_compare_op1))); } - + /* Some kinds of FP comparisons need an OR operation; under flag_finite_math_only we don't bother. */ if (rs6000_compare_fp_p - && ! flag_finite_math_only - && ! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS) + && !flag_finite_math_only + && !(TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS) && (code == LE || code == GE || code == UNEQ || code == LTGT || code == UNGT || code == UNLT)) @@ -9975,7 +11349,7 @@ rs6000_generate_compare (enum rtx_code code) enum rtx_code or1, or2; rtx or1_rtx, or2_rtx, compare2_rtx; rtx or_result = gen_reg_rtx (CCEQmode); - + switch (code) { case LE: or1 = LT; or2 = EQ; break; @@ -9984,12 +11358,12 @@ rs6000_generate_compare (enum rtx_code code) case LTGT: or1 = LT; or2 = GT; break; case UNGT: or1 = UNORDERED; or2 = GT; break; case UNLT: or1 = UNORDERED; or2 = LT; break; - default: abort (); + default: gcc_unreachable (); } validate_condition_mode (or1, comp_mode); validate_condition_mode (or2, comp_mode); - or1_rtx = gen_rtx (or1, SImode, compare_result, const0_rtx); - or2_rtx = gen_rtx (or2, SImode, compare_result, const0_rtx); + or1_rtx = gen_rtx_fmt_ee (or1, SImode, compare_result, const0_rtx); + or2_rtx = gen_rtx_fmt_ee (or2, SImode, compare_result, const0_rtx); compare2_rtx = gen_rtx_COMPARE (CCEQmode, gen_rtx_IOR (SImode, or1_rtx, or2_rtx), const_true_rtx); @@ -10000,8 +11374,8 @@ rs6000_generate_compare (enum rtx_code code) } validate_condition_mode (code, GET_MODE (compare_result)); - - return gen_rtx (code, VOIDmode, compare_result, const0_rtx); + + return gen_rtx_fmt_ee (code, VOIDmode, compare_result, const0_rtx); } @@ -10025,13 +11399,12 @@ rs6000_emit_sCOND (enum rtx_code code, rtx result) PUT_MODE (condition_rtx, SImode); t = XEXP (condition_rtx, 0); - if (cond_code != NE && cond_code != EQ) - abort (); + gcc_assert (cond_code == NE || cond_code == EQ); if (cond_code == NE) - emit_insn (gen_e500_flip_eq_bit (t, t)); + emit_insn (gen_e500_flip_gt_bit (t, t)); - emit_insn (gen_move_from_CR_eq_bit (result, t)); + emit_insn (gen_move_from_CR_gt_bit (result, t)); return; } @@ -10043,11 +11416,11 @@ rs6000_emit_sCOND (enum rtx_code code, rtx result) rtx not_result = gen_reg_rtx (CCEQmode); rtx not_op, rev_cond_rtx; enum machine_mode cc_mode; - + cc_mode = GET_MODE (XEXP (condition_rtx, 0)); - rev_cond_rtx = gen_rtx (rs6000_reverse_condition (cc_mode, cond_code), - SImode, XEXP (condition_rtx, 0), const0_rtx); + rev_cond_rtx = gen_rtx_fmt_ee (rs6000_reverse_condition (cc_mode, cond_code), + SImode, XEXP (condition_rtx, 0), const0_rtx); not_op = gen_rtx_COMPARE (CCEQmode, rev_cond_rtx, const0_rtx); emit_insn (gen_rtx_SET (VOIDmode, not_result, not_op)); condition_rtx = gen_rtx_EQ (VOIDmode, not_result, const0_rtx); @@ -10085,7 +11458,7 @@ rs6000_emit_cbranch (enum rtx_code code, rtx loc) /* Return the string to output a conditional branch to LABEL, which is the operand number of the label, or -1 if the branch is really a - conditional return. + conditional return. OP is the conditional expression. XEXP (OP, 0) is assumed to be a condition code register and its mode specifies what kind of @@ -10129,13 +11502,20 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) { /* The efscmp/tst* instructions twiddle bit 2, which maps nicely to the GT bit. */ - if (code == EQ) - /* Opposite of GT. */ - code = GT; - else if (code == NE) - code = UNLE; - else - abort (); + switch (code) + { + case EQ: + /* Opposite of GT. */ + code = GT; + break; + + case NE: + code = UNLE; + break; + + default: + gcc_unreachable (); + } } switch (code) @@ -10146,23 +11526,23 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) ccode = "ne"; break; case EQ: case UNEQ: ccode = "eq"; break; - case GE: case GEU: + case GE: case GEU: ccode = "ge"; break; - case GT: case GTU: case UNGT: + case GT: case GTU: case UNGT: ccode = "gt"; break; - case LE: case LEU: + case LE: case LEU: ccode = "le"; break; - case LT: case LTU: case UNLT: + case LT: case LTU: case UNLT: ccode = "lt"; break; case UNORDERED: ccode = "un"; break; case ORDERED: ccode = "nu"; break; case UNGE: ccode = "nl"; break; case UNLE: ccode = "ng"; break; default: - abort (); + gcc_unreachable (); } - - /* Maybe we have a guess as to how likely the branch is. + + /* Maybe we have a guess as to how likely the branch is. The old mnemonics don't have a way to specify this information. */ pred = ""; note = find_reg_note (insn, REG_BR_PROB, NULL_RTX); @@ -10176,13 +11556,14 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) prediction. For older cpus we may as well always hint, but assume not taken for branches that are very close to 50% as a mispredicted taken branch is more expensive than a - mispredicted not-taken branch. */ + mispredicted not-taken branch. */ if (rs6000_always_hint - || abs (prob) > REG_BR_PROB_BASE / 100 * 48) + || (abs (prob) > REG_BR_PROB_BASE / 100 * 48 + && br_prob_note_reliable_p (note))) { if (abs (prob) > REG_BR_PROB_BASE / 20 && ((prob > 0) ^ need_longbranch)) - pred = "+"; + pred = "+"; else pred = "-"; } @@ -10212,25 +11593,292 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) return string; } -/* Return the string to flip the EQ bit on a CR. */ +/* Return the string to flip the GT bit on a CR. */ char * -output_e500_flip_eq_bit (rtx dst, rtx src) +output_e500_flip_gt_bit (rtx dst, rtx src) { static char string[64]; int a, b; - if (GET_CODE (dst) != REG || ! CR_REGNO_P (REGNO (dst)) - || GET_CODE (src) != REG || ! CR_REGNO_P (REGNO (src))) - abort (); + gcc_assert (GET_CODE (dst) == REG && CR_REGNO_P (REGNO (dst)) + && GET_CODE (src) == REG && CR_REGNO_P (REGNO (src))); - /* EQ bit. */ - a = 4 * (REGNO (dst) - CR0_REGNO) + 2; - b = 4 * (REGNO (src) - CR0_REGNO) + 2; + /* GT bit. */ + a = 4 * (REGNO (dst) - CR0_REGNO) + 1; + b = 4 * (REGNO (src) - CR0_REGNO) + 1; sprintf (string, "crnot %d,%d", a, b); return string; } +/* Return insn index for the vector compare instruction for given CODE, + and DEST_MODE, OP_MODE. Return INSN_NOT_AVAILABLE if valid insn is + not available. */ + +static int +get_vec_cmp_insn (enum rtx_code code, + enum machine_mode dest_mode, + enum machine_mode op_mode) +{ + if (!TARGET_ALTIVEC) + return INSN_NOT_AVAILABLE; + + switch (code) + { + case EQ: + if (dest_mode == V16QImode && op_mode == V16QImode) + return UNSPEC_VCMPEQUB; + if (dest_mode == V8HImode && op_mode == V8HImode) + return UNSPEC_VCMPEQUH; + if (dest_mode == V4SImode && op_mode == V4SImode) + return UNSPEC_VCMPEQUW; + if (dest_mode == V4SImode && op_mode == V4SFmode) + return UNSPEC_VCMPEQFP; + break; + case GE: + if (dest_mode == V4SImode && op_mode == V4SFmode) + return UNSPEC_VCMPGEFP; + case GT: + if (dest_mode == V16QImode && op_mode == V16QImode) + return UNSPEC_VCMPGTSB; + if (dest_mode == V8HImode && op_mode == V8HImode) + return UNSPEC_VCMPGTSH; + if (dest_mode == V4SImode && op_mode == V4SImode) + return UNSPEC_VCMPGTSW; + if (dest_mode == V4SImode && op_mode == V4SFmode) + return UNSPEC_VCMPGTFP; + break; + case GTU: + if (dest_mode == V16QImode && op_mode == V16QImode) + return UNSPEC_VCMPGTUB; + if (dest_mode == V8HImode && op_mode == V8HImode) + return UNSPEC_VCMPGTUH; + if (dest_mode == V4SImode && op_mode == V4SImode) + return UNSPEC_VCMPGTUW; + break; + default: + break; + } + return INSN_NOT_AVAILABLE; +} + +/* Emit vector compare for operands OP0 and OP1 using code RCODE. + DMODE is expected destination mode. This is a recursive function. */ + +static rtx +rs6000_emit_vector_compare (enum rtx_code rcode, + rtx op0, rtx op1, + enum machine_mode dmode) +{ + int vec_cmp_insn; + rtx mask; + enum machine_mode dest_mode; + enum machine_mode op_mode = GET_MODE (op1); + + gcc_assert (TARGET_ALTIVEC); + gcc_assert (GET_MODE (op0) == GET_MODE (op1)); + + /* Floating point vector compare instructions uses destination V4SImode. + Move destination to appropriate mode later. */ + if (dmode == V4SFmode) + dest_mode = V4SImode; + else + dest_mode = dmode; + + mask = gen_reg_rtx (dest_mode); + vec_cmp_insn = get_vec_cmp_insn (rcode, dest_mode, op_mode); + + if (vec_cmp_insn == INSN_NOT_AVAILABLE) + { + bool swap_operands = false; + bool try_again = false; + switch (rcode) + { + case LT: + rcode = GT; + swap_operands = true; + try_again = true; + break; + case LTU: + rcode = GTU; + swap_operands = true; + try_again = true; + break; + case NE: + /* Treat A != B as ~(A==B). */ + { + enum insn_code nor_code; + rtx eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1, + dest_mode); + + nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; + gcc_assert (nor_code != CODE_FOR_nothing); + emit_insn (GEN_FCN (nor_code) (mask, eq_rtx)); + + if (dmode != dest_mode) + { + rtx temp = gen_reg_rtx (dest_mode); + convert_move (temp, mask, 0); + return temp; + } + return mask; + } + break; + case GE: + case GEU: + case LE: + case LEU: + /* Try GT/GTU/LT/LTU OR EQ */ + { + rtx c_rtx, eq_rtx; + enum insn_code ior_code; + enum rtx_code new_code; + + switch (rcode) + { + case GE: + new_code = GT; + break; + + case GEU: + new_code = GTU; + break; + + case LE: + new_code = LT; + break; + + case LEU: + new_code = LTU; + break; + + default: + gcc_unreachable (); + } + + c_rtx = rs6000_emit_vector_compare (new_code, + op0, op1, dest_mode); + eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1, + dest_mode); + + ior_code = ior_optab->handlers[(int)dest_mode].insn_code; + gcc_assert (ior_code != CODE_FOR_nothing); + emit_insn (GEN_FCN (ior_code) (mask, c_rtx, eq_rtx)); + if (dmode != dest_mode) + { + rtx temp = gen_reg_rtx (dest_mode); + convert_move (temp, mask, 0); + return temp; + } + return mask; + } + break; + default: + gcc_unreachable (); + } + + if (try_again) + { + vec_cmp_insn = get_vec_cmp_insn (rcode, dest_mode, op_mode); + /* You only get two chances. */ + gcc_assert (vec_cmp_insn != INSN_NOT_AVAILABLE); + } + + if (swap_operands) + { + rtx tmp; + tmp = op0; + op0 = op1; + op1 = tmp; + } + } + + emit_insn (gen_rtx_SET (VOIDmode, mask, + gen_rtx_UNSPEC (dest_mode, + gen_rtvec (2, op0, op1), + vec_cmp_insn))); + if (dmode != dest_mode) + { + rtx temp = gen_reg_rtx (dest_mode); + convert_move (temp, mask, 0); + return temp; + } + return mask; +} + +/* Return vector select instruction for MODE. Return INSN_NOT_AVAILABLE, if + valid insn doesn exist for given mode. */ + +static int +get_vsel_insn (enum machine_mode mode) +{ + switch (mode) + { + case V4SImode: + return UNSPEC_VSEL4SI; + break; + case V4SFmode: + return UNSPEC_VSEL4SF; + break; + case V8HImode: + return UNSPEC_VSEL8HI; + break; + case V16QImode: + return UNSPEC_VSEL16QI; + break; + default: + return INSN_NOT_AVAILABLE; + break; + } + return INSN_NOT_AVAILABLE; +} + +/* Emit vector select insn where DEST is destination using + operands OP1, OP2 and MASK. */ + +static void +rs6000_emit_vector_select (rtx dest, rtx op1, rtx op2, rtx mask) +{ + rtx t, temp; + enum machine_mode dest_mode = GET_MODE (dest); + int vsel_insn_index = get_vsel_insn (GET_MODE (dest)); + + temp = gen_reg_rtx (dest_mode); + + /* For each vector element, select op1 when mask is 1 otherwise + select op2. */ + t = gen_rtx_SET (VOIDmode, temp, + gen_rtx_UNSPEC (dest_mode, + gen_rtvec (3, op2, op1, mask), + vsel_insn_index)); + emit_insn (t); + emit_move_insn (dest, temp); + return; +} + +/* Emit vector conditional expression. + DEST is destination. OP1 and OP2 are two VEC_COND_EXPR operands. + CC_OP0 and CC_OP1 are the two operands for the relation operation COND. */ + +int +rs6000_emit_vector_cond_expr (rtx dest, rtx op1, rtx op2, + rtx cond, rtx cc_op0, rtx cc_op1) +{ + enum machine_mode dest_mode = GET_MODE (dest); + enum rtx_code rcode = GET_CODE (cond); + rtx mask; + + if (!TARGET_ALTIVEC) + return 0; + + /* Get the vector mask for the given relational operations. */ + mask = rs6000_emit_vector_compare (rcode, cc_op0, cc_op1, dest_mode); + + rs6000_emit_vector_select (dest, op1, op2, mask); + + return 1; +} + /* Emit a conditional move: move TRUE_COND to DEST if OP of the operands of the last comparison is nonzero/true, FALSE_COND if it is zero/false. Return 0 if the hardware has no such operation. */ @@ -10245,6 +11893,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) enum machine_mode compare_mode = GET_MODE (op0); enum machine_mode result_mode = GET_MODE (dest); rtx temp; + bool is_against_zero; /* These modes should always match. */ if (GET_MODE (op1) != compare_mode @@ -10266,7 +11915,18 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) return 0; } else if (TARGET_E500 && TARGET_HARD_FLOAT && !TARGET_FPRS - && GET_MODE_CLASS (compare_mode) == MODE_FLOAT) + && SCALAR_FLOAT_MODE_P (compare_mode)) + return 0; + + is_against_zero = op1 == CONST0_RTX (compare_mode); + + /* A floating-point subtract might overflow, underflow, or produce + an inexact result, thus changing the floating-point flags, so it + can't be generated if we care about that. It's safe if one side + of the construct is zero, since then no subtract will be + generated. */ + if (SCALAR_FLOAT_MODE_P (compare_mode) + && flag_trapping_math && ! is_against_zero) return 0; /* Eliminate half of the comparisons by switching operands, this @@ -10284,10 +11944,10 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) it'll probably be faster to use a branch here too. */ if (code == UNEQ && HONOR_NANS (compare_mode)) return 0; - + if (GET_CODE (op1) == CONST_DOUBLE) REAL_VALUE_FROM_CONST_DOUBLE (c1, op1); - + /* We're going to try to implement comparisons by performing a subtract, then comparing against zero. Unfortunately, Inf - Inf is NaN which is not zero, and so if we don't @@ -10298,17 +11958,21 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) && (GET_CODE (op1) != CONST_DOUBLE || real_isinf (&c1)) /* Constructs of the form (a OP b ? a : b) are safe. */ && ((! rtx_equal_p (op0, false_cond) && ! rtx_equal_p (op1, false_cond)) - || (! rtx_equal_p (op0, true_cond) + || (! rtx_equal_p (op0, true_cond) && ! rtx_equal_p (op1, true_cond)))) return 0; + /* At this point we know we can use fsel. */ /* Reduce the comparison to a comparison against zero. */ - temp = gen_reg_rtx (compare_mode); - emit_insn (gen_rtx_SET (VOIDmode, temp, - gen_rtx_MINUS (compare_mode, op0, op1))); - op0 = temp; - op1 = CONST0_RTX (compare_mode); + if (! is_against_zero) + { + temp = gen_reg_rtx (compare_mode); + emit_insn (gen_rtx_SET (VOIDmode, temp, + gen_rtx_MINUS (compare_mode, op0, op1))); + op0 = temp; + op1 = CONST0_RTX (compare_mode); + } /* If we don't care about NaNs we can reduce some of the comparisons down to faster ones. */ @@ -10351,7 +12015,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) case EQ: temp = gen_reg_rtx (compare_mode); - emit_insn (gen_rtx_SET (VOIDmode, temp, + emit_insn (gen_rtx_SET (VOIDmode, temp, gen_rtx_NEG (compare_mode, gen_rtx_ABS (compare_mode, op0)))); op0 = temp; @@ -10377,7 +12041,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) /* a GT 0 <-> (a GE 0 && -a UNLT 0) */ temp = gen_reg_rtx (result_mode); emit_insn (gen_rtx_SET (VOIDmode, temp, - gen_rtx_IF_THEN_ELSE (result_mode, + gen_rtx_IF_THEN_ELSE (result_mode, gen_rtx_GE (VOIDmode, op0, op1), true_cond, false_cond))); @@ -10390,7 +12054,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_rtx_SET (VOIDmode, dest, @@ -10456,18 +12120,454 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1) c = GEU; if (code == SMAX || code == UMAX) - target = emit_conditional_move (dest, c, op0, op1, mode, + target = emit_conditional_move (dest, c, op0, op1, mode, op0, op1, mode, 0); else - target = emit_conditional_move (dest, c, op0, op1, mode, + target = emit_conditional_move (dest, c, op0, op1, mode, op1, op0, mode, 0); - if (target == NULL_RTX) - abort (); + gcc_assert (target); if (target != dest) emit_move_insn (dest, target); } -/* Emit instructions to move SRC to DST. Called by splitters for +/* Emit instructions to perform a load-reserved/store-conditional operation. + The operation performed is an atomic + (set M (CODE:MODE M OP)) + If not NULL, BEFORE is atomically set to M before the operation, and + AFTER is set to M after the operation (that is, (CODE:MODE M OP)). + If SYNC_P then a memory barrier is emitted before the operation. + Either OP or M may be wrapped in a NOT operation. */ + +void +rs6000_emit_sync (enum rtx_code code, enum machine_mode mode, + rtx m, rtx op, rtx before_param, rtx after_param, + bool sync_p) +{ + enum machine_mode used_mode; + rtx the_op, set_before, set_after, set_atomic, cc_scratch, before, after; + rtx used_m; + rtvec vec; + HOST_WIDE_INT imask = GET_MODE_MASK (mode); + rtx shift = NULL_RTX; + + if (sync_p) + emit_insn (gen_memory_barrier ()); + + if (GET_CODE (m) == NOT) + used_m = XEXP (m, 0); + else + used_m = m; + + /* If this is smaller than SImode, we'll have to use SImode with + adjustments. */ + if (mode == QImode || mode == HImode) + { + rtx newop, oldop; + + if (MEM_ALIGN (used_m) >= 32) + { + int ishift = 0; + if (BYTES_BIG_ENDIAN) + ishift = GET_MODE_BITSIZE (SImode) - GET_MODE_BITSIZE (mode); + + shift = GEN_INT (ishift); + } + else + { + rtx addrSI, aligned_addr; + int shift_mask = mode == QImode ? 0x18 : 0x10; + + addrSI = force_reg (SImode, gen_lowpart_common (SImode, + XEXP (used_m, 0))); + shift = gen_reg_rtx (SImode); + + emit_insn (gen_rlwinm (shift, addrSI, GEN_INT (3), + GEN_INT (shift_mask))); + emit_insn (gen_xorsi3 (shift, shift, GEN_INT (shift_mask))); + + aligned_addr = expand_binop (Pmode, and_optab, + XEXP (used_m, 0), + GEN_INT (-4), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + used_m = change_address (used_m, SImode, aligned_addr); + set_mem_align (used_m, 32); + /* It's safe to keep the old alias set of USED_M, because + the operation is atomic and only affects the original + USED_M. */ + if (GET_CODE (m) == NOT) + m = gen_rtx_NOT (SImode, used_m); + else + m = used_m; + } + + if (GET_CODE (op) == NOT) + { + oldop = lowpart_subreg (SImode, XEXP (op, 0), mode); + oldop = gen_rtx_NOT (SImode, oldop); + } + else + oldop = lowpart_subreg (SImode, op, mode); + + switch (code) + { + case IOR: + case XOR: + newop = expand_binop (SImode, and_optab, + oldop, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newop, newop, shift)); + break; + + case AND: + newop = expand_binop (SImode, ior_optab, + oldop, GEN_INT (~imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_rotlsi3 (newop, newop, shift)); + break; + + case PLUS: + case MINUS: + { + rtx mask; + + newop = expand_binop (SImode, and_optab, + oldop, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newop, newop, shift)); + + mask = gen_reg_rtx (SImode); + emit_move_insn (mask, GEN_INT (imask)); + emit_insn (gen_ashlsi3 (mask, mask, shift)); + + if (code == PLUS) + newop = gen_rtx_PLUS (SImode, m, newop); + else + newop = gen_rtx_MINUS (SImode, m, newop); + newop = gen_rtx_AND (SImode, newop, mask); + newop = gen_rtx_IOR (SImode, newop, + gen_rtx_AND (SImode, + gen_rtx_NOT (SImode, mask), + m)); + break; + } + + default: + gcc_unreachable (); + } + + if (GET_CODE (m) == NOT) + { + rtx mask, xorm; + + mask = gen_reg_rtx (SImode); + emit_move_insn (mask, GEN_INT (imask)); + emit_insn (gen_ashlsi3 (mask, mask, shift)); + + xorm = gen_rtx_XOR (SImode, used_m, mask); + /* Depending on the value of 'op', the XOR or the operation might + be able to be simplified away. */ + newop = simplify_gen_binary (code, SImode, xorm, newop); + } + op = newop; + used_mode = SImode; + before = gen_reg_rtx (used_mode); + after = gen_reg_rtx (used_mode); + } + else + { + used_mode = mode; + before = before_param; + after = after_param; + + if (before == NULL_RTX) + before = gen_reg_rtx (used_mode); + if (after == NULL_RTX) + after = gen_reg_rtx (used_mode); + } + + if ((code == PLUS || code == MINUS || GET_CODE (m) == NOT) + && used_mode != mode) + the_op = op; /* Computed above. */ + else if (GET_CODE (op) == NOT && GET_CODE (m) != NOT) + the_op = gen_rtx_fmt_ee (code, used_mode, op, m); + else + the_op = gen_rtx_fmt_ee (code, used_mode, m, op); + + set_after = gen_rtx_SET (VOIDmode, after, the_op); + set_before = gen_rtx_SET (VOIDmode, before, used_m); + set_atomic = gen_rtx_SET (VOIDmode, used_m, + gen_rtx_UNSPEC (used_mode, + gen_rtvec (1, the_op), + UNSPEC_SYNC_OP)); + cc_scratch = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (CCmode)); + + if ((code == PLUS || code == MINUS) && used_mode != mode) + vec = gen_rtvec (5, set_after, set_before, set_atomic, cc_scratch, + gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode))); + else + vec = gen_rtvec (4, set_after, set_before, set_atomic, cc_scratch); + emit_insn (gen_rtx_PARALLEL (VOIDmode, vec)); + + /* Shift and mask the return values properly. */ + if (used_mode != mode && before_param) + { + emit_insn (gen_lshrsi3 (before, before, shift)); + convert_move (before_param, before, 1); + } + + if (used_mode != mode && after_param) + { + emit_insn (gen_lshrsi3 (after, after, shift)); + convert_move (after_param, after, 1); + } + + /* The previous sequence will end with a branch that's dependent on + the conditional store, so placing an isync will ensure that no + other instructions (especially, no load or store instructions) + can start before the atomic operation completes. */ + if (sync_p) + emit_insn (gen_isync ()); +} + +/* A subroutine of the atomic operation splitters. Jump to LABEL if + COND is true. Mark the jump as unlikely to be taken. */ + +static void +emit_unlikely_jump (rtx cond, rtx label) +{ + rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); + rtx x; + + x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx); + x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); + REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); +} + +/* A subroutine of the atomic operation splitters. Emit a load-locked + instruction in MODE. */ + +static void +emit_load_locked (enum machine_mode mode, rtx reg, rtx mem) +{ + rtx (*fn) (rtx, rtx) = NULL; + if (mode == SImode) + fn = gen_load_locked_si; + else if (mode == DImode) + fn = gen_load_locked_di; + emit_insn (fn (reg, mem)); +} + +/* A subroutine of the atomic operation splitters. Emit a store-conditional + instruction in MODE. */ + +static void +emit_store_conditional (enum machine_mode mode, rtx res, rtx mem, rtx val) +{ + rtx (*fn) (rtx, rtx, rtx) = NULL; + if (mode == SImode) + fn = gen_store_conditional_si; + else if (mode == DImode) + fn = gen_store_conditional_di; + + /* Emit sync before stwcx. to address PPC405 Erratum. */ + if (PPC405_ERRATUM77) + emit_insn (gen_memory_barrier ()); + + emit_insn (fn (res, mem, val)); +} + +/* Expand an an atomic fetch-and-operate pattern. CODE is the binary operation + to perform. MEM is the memory on which to operate. VAL is the second + operand of the binary operator. BEFORE and AFTER are optional locations to + return the value of MEM either before of after the operation. SCRATCH is + a scratch register. */ + +void +rs6000_split_atomic_op (enum rtx_code code, rtx mem, rtx val, + rtx before, rtx after, rtx scratch) +{ + enum machine_mode mode = GET_MODE (mem); + rtx label, x, cond = gen_rtx_REG (CCmode, CR0_REGNO); + + emit_insn (gen_memory_barrier ()); + + label = gen_label_rtx (); + emit_label (label); + label = gen_rtx_LABEL_REF (VOIDmode, label); + + if (before == NULL_RTX) + before = scratch; + emit_load_locked (mode, before, mem); + + if (code == NOT) + x = gen_rtx_AND (mode, gen_rtx_NOT (mode, before), val); + else if (code == AND) + x = gen_rtx_UNSPEC (mode, gen_rtvec (2, before, val), UNSPEC_AND); + else + x = gen_rtx_fmt_ee (code, mode, before, val); + + if (after != NULL_RTX) + emit_insn (gen_rtx_SET (VOIDmode, after, copy_rtx (x))); + emit_insn (gen_rtx_SET (VOIDmode, scratch, x)); + + emit_store_conditional (mode, cond, mem, scratch); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label); + + emit_insn (gen_isync ()); +} + +/* Expand an atomic compare and swap operation. MEM is the memory on which + to operate. OLDVAL is the old value to be compared. NEWVAL is the new + value to be stored. SCRATCH is a scratch GPR. */ + +void +rs6000_split_compare_and_swap (rtx retval, rtx mem, rtx oldval, rtx newval, + rtx scratch) +{ + enum machine_mode mode = GET_MODE (mem); + rtx label1, label2, x, cond = gen_rtx_REG (CCmode, CR0_REGNO); + + emit_insn (gen_memory_barrier ()); + + label1 = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ()); + label2 = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ()); + emit_label (XEXP (label1, 0)); + + emit_load_locked (mode, retval, mem); + + x = gen_rtx_COMPARE (CCmode, retval, oldval); + emit_insn (gen_rtx_SET (VOIDmode, cond, x)); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label2); + + emit_move_insn (scratch, newval); + emit_store_conditional (mode, cond, mem, scratch); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label1); + + emit_insn (gen_isync ()); + emit_label (XEXP (label2, 0)); +} + +/* Expand an atomic test and set operation. MEM is the memory on which + to operate. VAL is the value set. SCRATCH is a scratch GPR. */ + +void +rs6000_split_lock_test_and_set (rtx retval, rtx mem, rtx val, rtx scratch) +{ + enum machine_mode mode = GET_MODE (mem); + rtx label, x, cond = gen_rtx_REG (CCmode, CR0_REGNO); + + emit_insn (gen_memory_barrier ()); + + label = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ()); + emit_label (XEXP (label, 0)); + + emit_load_locked (mode, retval, mem); + emit_move_insn (scratch, val); + emit_store_conditional (mode, cond, mem, scratch); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label); + + emit_insn (gen_isync ()); +} + +void +rs6000_expand_compare_and_swapqhi (rtx dst, rtx mem, rtx oldval, rtx newval) +{ + enum machine_mode mode = GET_MODE (mem); + rtx addrSI, align, wdst, shift, mask; + HOST_WIDE_INT shift_mask = mode == QImode ? 0x18 : 0x10; + HOST_WIDE_INT imask = GET_MODE_MASK (mode); + + /* Shift amount for subword relative to aligned word. */ + addrSI = force_reg (SImode, gen_lowpart_common (SImode, XEXP (mem, 0))); + shift = gen_reg_rtx (SImode); + emit_insn (gen_rlwinm (shift, addrSI, GEN_INT (3), + GEN_INT (shift_mask))); + emit_insn (gen_xorsi3 (shift, shift, GEN_INT (shift_mask))); + + /* Shift and mask old value into position within word. */ + oldval = convert_modes (SImode, mode, oldval, 1); + oldval = expand_binop (SImode, and_optab, + oldval, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (oldval, oldval, shift)); + + /* Shift and mask new value into position within word. */ + newval = convert_modes (SImode, mode, newval, 1); + newval = expand_binop (SImode, and_optab, + newval, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newval, newval, shift)); + + /* Mask for insertion. */ + mask = gen_reg_rtx (SImode); + emit_move_insn (mask, GEN_INT (imask)); + emit_insn (gen_ashlsi3 (mask, mask, shift)); + + /* Address of aligned word containing subword. */ + align = expand_binop (Pmode, and_optab, XEXP (mem, 0), GEN_INT (-4), + NULL_RTX, 1, OPTAB_LIB_WIDEN); + mem = change_address (mem, SImode, align); + set_mem_align (mem, 32); + MEM_VOLATILE_P (mem) = 1; + + wdst = gen_reg_rtx (SImode); + emit_insn (gen_sync_compare_and_swapqhi_internal (wdst, mask, + oldval, newval, mem)); + + emit_move_insn (dst, gen_lowpart (mode, wdst)); +} + +void +rs6000_split_compare_and_swapqhi (rtx dest, rtx mask, + rtx oldval, rtx newval, rtx mem, + rtx scratch) +{ + rtx label1, label2, x, cond = gen_rtx_REG (CCmode, CR0_REGNO); + + emit_insn (gen_memory_barrier ()); + label1 = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ()); + label2 = gen_rtx_LABEL_REF (VOIDmode, gen_label_rtx ()); + emit_label (XEXP (label1, 0)); + + emit_load_locked (SImode, scratch, mem); + + /* Mask subword within loaded value for comparison with oldval. + Use UNSPEC_AND to avoid clobber.*/ + emit_insn (gen_rtx_SET (SImode, dest, + gen_rtx_UNSPEC (SImode, + gen_rtvec (2, scratch, mask), + UNSPEC_AND))); + + x = gen_rtx_COMPARE (CCmode, dest, oldval); + emit_insn (gen_rtx_SET (VOIDmode, cond, x)); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label2); + + /* Clear subword within loaded value for insertion of new value. */ + emit_insn (gen_rtx_SET (SImode, scratch, + gen_rtx_AND (SImode, + gen_rtx_NOT (SImode, mask), scratch))); + emit_insn (gen_iorsi3 (scratch, scratch, newval)); + emit_store_conditional (SImode, cond, mem, scratch); + + x = gen_rtx_NE (VOIDmode, cond, const0_rtx); + emit_unlikely_jump (x, label1); + + emit_insn (gen_isync ()); + emit_label (XEXP (label2, 0)); +} + + + /* Emit instructions to move SRC to DST. Called by splitters for multi-register moves. It will emit at most one instruction for each register that is accessed; that is, it won't emit li/lis pairs (or equivalent for 64-bit code). One of SRC or DST must be a hard @@ -10488,25 +12588,26 @@ rs6000_split_multireg_move (rtx dst, rtx src) reg = REG_P (dst) ? REGNO (dst) : REGNO (src); mode = GET_MODE (dst); - nregs = HARD_REGNO_NREGS (reg, mode); + nregs = hard_regno_nregs[reg][mode]; if (FP_REGNO_P (reg)) reg_mode = DFmode; else if (ALTIVEC_REGNO_P (reg)) reg_mode = V16QImode; + else if (TARGET_E500_DOUBLE && mode == TFmode) + reg_mode = DFmode; else reg_mode = word_mode; reg_mode_size = GET_MODE_SIZE (reg_mode); - - if (reg_mode_size * nregs != GET_MODE_SIZE (mode)) - abort (); - + + gcc_assert (reg_mode_size * nregs == GET_MODE_SIZE (mode)); + if (REG_P (src) && REG_P (dst) && (REGNO (src) < REGNO (dst))) { /* Move register range backwards, if we might have destructive overlap. */ int i; for (i = nregs - 1; i >= 0; i--) - emit_insn (gen_rtx_SET (VOIDmode, + emit_insn (gen_rtx_SET (VOIDmode, simplify_gen_subreg (reg_mode, dst, mode, i * reg_mode_size), simplify_gen_subreg (reg_mode, src, mode, @@ -10518,31 +12619,29 @@ rs6000_split_multireg_move (rtx dst, rtx src) int j = -1; bool used_update = false; - if (GET_CODE (src) == MEM && INT_REGNO_P (reg)) - { - rtx breg; + if (MEM_P (src) && INT_REGNO_P (reg)) + { + rtx breg; if (GET_CODE (XEXP (src, 0)) == PRE_INC || GET_CODE (XEXP (src, 0)) == PRE_DEC) { rtx delta_rtx; breg = XEXP (XEXP (src, 0), 0); - delta_rtx = GET_CODE (XEXP (src, 0)) == PRE_INC - ? GEN_INT (GET_MODE_SIZE (GET_MODE (src))) - : GEN_INT (-GET_MODE_SIZE (GET_MODE (src))); + delta_rtx = (GET_CODE (XEXP (src, 0)) == PRE_INC + ? GEN_INT (GET_MODE_SIZE (GET_MODE (src))) + : GEN_INT (-GET_MODE_SIZE (GET_MODE (src)))); emit_insn (TARGET_32BIT ? gen_addsi3 (breg, breg, delta_rtx) : gen_adddi3 (breg, breg, delta_rtx)); - src = gen_rtx_MEM (mode, breg); + src = replace_equiv_address (src, breg); } - else if (! offsettable_memref_p (src)) + else if (! rs6000_offsettable_memref_p (src)) { - rtx newsrc, basereg; + rtx basereg; basereg = gen_rtx_REG (Pmode, reg); emit_insn (gen_rtx_SET (VOIDmode, basereg, XEXP (src, 0))); - newsrc = gen_rtx_MEM (GET_MODE (src), basereg); - MEM_COPY_ATTRIBUTES (newsrc, src); - src = newsrc; + src = replace_equiv_address (src, basereg); } breg = XEXP (src, 0); @@ -10566,9 +12665,9 @@ rs6000_split_multireg_move (rtx dst, rtx src) { rtx delta_rtx; breg = XEXP (XEXP (dst, 0), 0); - delta_rtx = GET_CODE (XEXP (dst, 0)) == PRE_INC - ? GEN_INT (GET_MODE_SIZE (GET_MODE (dst))) - : GEN_INT (-GET_MODE_SIZE (GET_MODE (dst))); + delta_rtx = (GET_CODE (XEXP (dst, 0)) == PRE_INC + ? GEN_INT (GET_MODE_SIZE (GET_MODE (dst))) + : GEN_INT (-GET_MODE_SIZE (GET_MODE (dst)))); /* We have to update the breg before doing the store. Use store with update, if available. */ @@ -10577,32 +12676,34 @@ rs6000_split_multireg_move (rtx dst, rtx src) { rtx nsrc = simplify_gen_subreg (reg_mode, src, mode, 0); emit_insn (TARGET_32BIT - ? gen_movsi_update (breg, breg, delta_rtx, nsrc) - : gen_movdi_update (breg, breg, delta_rtx, nsrc)); + ? (TARGET_POWERPC64 + ? gen_movdi_si_update (breg, breg, delta_rtx, nsrc) + : gen_movsi_update (breg, breg, delta_rtx, nsrc)) + : gen_movdi_di_update (breg, breg, delta_rtx, nsrc)); used_update = true; } else emit_insn (TARGET_32BIT ? gen_addsi3 (breg, breg, delta_rtx) : gen_adddi3 (breg, breg, delta_rtx)); - dst = gen_rtx_MEM (mode, breg); + dst = replace_equiv_address (dst, breg); } - else if (! offsettable_memref_p (dst)) - abort (); + else + gcc_assert (rs6000_offsettable_memref_p (dst)); } for (i = 0; i < nregs; i++) - { + { /* Calculate index to next subword. */ ++j; - if (j == nregs) + if (j == nregs) j = 0; - /* If compiler already emitted move of first word by + /* If compiler already emitted move of first word by store with update, no need to do anything. */ if (j == 0 && used_update) continue; - + emit_insn (gen_rtx_SET (VOIDmode, simplify_gen_subreg (reg_mode, dst, mode, j * reg_mode_size), @@ -10626,7 +12727,7 @@ first_reg_to_save (void) /* Find lowest numbered live register. */ for (first_reg = 13; first_reg <= 31; first_reg++) - if (regs_ever_live[first_reg] + if (regs_ever_live[first_reg] && (! call_used_regs[first_reg] || (first_reg == RS6000_PIC_OFFSET_TABLE_REGNUM && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) @@ -10670,6 +12771,13 @@ first_altivec_reg_to_save (void) if (! TARGET_ALTIVEC_ABI) return LAST_ALTIVEC_REGNO + 1; + /* On Darwin, the unwind routines are compiled without + TARGET_ALTIVEC, and use save_world to save/restore the + altivec registers when necessary. */ + if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return + && ! TARGET_ALTIVEC) + return FIRST_ALTIVEC_REGNO + 20; + /* Find lowest numbered live register. */ for (i = FIRST_ALTIVEC_REGNO + 20; i <= LAST_ALTIVEC_REGNO; ++i) if (regs_ever_live[i]) @@ -10687,6 +12795,13 @@ compute_vrsave_mask (void) { unsigned int i, mask = 0; + /* On Darwin, the unwind routines are compiled without + TARGET_ALTIVEC, and use save_world to save/restore the + call-saved altivec registers when necessary. */ + if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return + && ! TARGET_ALTIVEC) + mask |= 0xFFF; + /* First, find out if we use _any_ altivec registers. */ for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i) if (regs_ever_live[i]) @@ -10714,6 +12829,59 @@ compute_vrsave_mask (void) return mask; } +/* For a very restricted set of circumstances, we can cut down the + size of prologues/epilogues by calling our own save/restore-the-world + routines. */ + +static void +compute_save_world_info (rs6000_stack_t *info_ptr) +{ + info_ptr->world_save_p = 1; + info_ptr->world_save_p + = (WORLD_SAVE_P (info_ptr) + && DEFAULT_ABI == ABI_DARWIN + && ! (current_function_calls_setjmp && flag_exceptions) + && info_ptr->first_fp_reg_save == FIRST_SAVED_FP_REGNO + && info_ptr->first_gp_reg_save == FIRST_SAVED_GP_REGNO + && info_ptr->first_altivec_reg_save == FIRST_SAVED_ALTIVEC_REGNO + && info_ptr->cr_save_p); + + /* This will not work in conjunction with sibcalls. Make sure there + are none. (This check is expensive, but seldom executed.) */ + if (WORLD_SAVE_P (info_ptr)) + { + rtx insn; + for ( insn = get_last_insn_anywhere (); insn; insn = PREV_INSN (insn)) + if ( GET_CODE (insn) == CALL_INSN + && SIBLING_CALL_P (insn)) + { + info_ptr->world_save_p = 0; + break; + } + } + + if (WORLD_SAVE_P (info_ptr)) + { + /* Even if we're not touching VRsave, make sure there's room on the + stack for it, if it looks like we're calling SAVE_WORLD, which + will attempt to save it. */ + info_ptr->vrsave_size = 4; + + /* "Save" the VRsave register too if we're saving the world. */ + if (info_ptr->vrsave_mask == 0) + info_ptr->vrsave_mask = compute_vrsave_mask (); + + /* Because the Darwin register save/restore routines only handle + F14 .. F31 and V20 .. V31 as per the ABI, perform a consistency + check. */ + gcc_assert (info_ptr->first_fp_reg_save >= FIRST_SAVED_FP_REGNO + && (info_ptr->first_altivec_reg_save + >= FIRST_SAVED_ALTIVEC_REGNO)); + } + return; +} + + static void is_altivec_return_reg (rtx reg, void *xyes) { @@ -10777,11 +12945,11 @@ is_altivec_return_reg (rtx reg, void *xyes) | Parameter save area (P) | 8 +---------------------------------------+ | Alloca space (A) | 8+P - +---------------------------------------+ + +---------------------------------------+ | Varargs save area (V) | 8+P+A - +---------------------------------------+ + +---------------------------------------+ | Local variable space (L) | 8+P+A+V - +---------------------------------------+ + +---------------------------------------+ | Float/int conversion temporary (X) | 8+P+A+V+L +---------------------------------------+ | Save area for AltiVec registers (W) | 8+P+A+V+L+X @@ -10790,14 +12958,14 @@ is_altivec_return_reg (rtx reg, void *xyes) +---------------------------------------+ | Save area for VRSAVE register (Z) | 8+P+A+V+L+X+W+Y +---------------------------------------+ - | SPE: area for 64-bit GP registers | - +---------------------------------------+ - | SPE alignment padding | - +---------------------------------------+ + | SPE: area for 64-bit GP registers | + +---------------------------------------+ + | SPE alignment padding | + +---------------------------------------+ | saved CR (C) | 8+P+A+V+L+X+W+Y+Z - +---------------------------------------+ + +---------------------------------------+ | Save area for GP registers (G) | 8+P+A+V+L+X+W+Y+Z+C - +---------------------------------------+ + +---------------------------------------+ | Save area for FP registers (F) | 8+P+A+V+L+X+W+Y+Z+C+G +---------------------------------------+ old SP->| back chain to caller's caller | @@ -10823,24 +12991,22 @@ is_altivec_return_reg (rtx reg, void *xyes) static rs6000_stack_t * rs6000_stack_info (void) { - static rs6000_stack_t info, zero_info; + static rs6000_stack_t info; rs6000_stack_t *info_ptr = &info; int reg_size = TARGET_32BIT ? 4 : 8; int ehrd_size; int save_align; HOST_WIDE_INT non_fixed_size; - /* Zero all fields portably. */ - info = zero_info; + memset (&info, 0, sizeof (info)); if (TARGET_SPE) { /* Cache value so we don't rescan instruction chain over and over. */ if (cfun->machine->insn_chain_scanned_p == 0) - { - cfun->machine->insn_chain_scanned_p = 1; - info_ptr->spe_64bit_regs_used = (int) spe_func_has_64bit_regs_p (); - } + cfun->machine->insn_chain_scanned_p + = spe_func_has_64bit_regs_p () + 1; + info_ptr->spe_64bit_regs_used = cfun->machine->insn_chain_scanned_p - 1; } /* Select which calling sequence. */ @@ -10848,7 +13014,7 @@ rs6000_stack_info (void) /* Calculate which registers need to be saved & save area size. */ info_ptr->first_gp_reg_save = first_reg_to_save (); - /* Assume that we will have to save RS6000_PIC_OFFSET_TABLE_REGNUM, + /* Assume that we will have to save RS6000_PIC_OFFSET_TABLE_REGNUM, even if it currently looks like we won't. */ if (((TARGET_TOC && TARGET_MINIMAL_TOC) || (flag_pic == 1 && DEFAULT_ABI == ABI_V4) @@ -10885,10 +13051,9 @@ rs6000_stack_info (void) || cfun->machine->ra_needs_full_frame); /* Determine if we need to save the link register. */ - if (rs6000_ra_ever_killed () - || (DEFAULT_ABI == ABI_AIX - && current_function_profile - && !TARGET_PROFILE_KERNEL) + if ((DEFAULT_ABI == ABI_AIX + && current_function_profile + && !TARGET_PROFILE_KERNEL) #ifdef TARGET_RELOCATABLE || (TARGET_RELOCATABLE && (get_pool_size () != 0)) #endif @@ -10896,17 +13061,15 @@ rs6000_stack_info (void) && !FP_SAVE_INLINE (info_ptr->first_fp_reg_save)) || info_ptr->first_altivec_reg_save <= LAST_ALTIVEC_REGNO || (DEFAULT_ABI == ABI_V4 && current_function_calls_alloca) - || (DEFAULT_ABI == ABI_DARWIN - && flag_pic - && current_function_uses_pic_offset_table) - || info_ptr->calls_p) + || info_ptr->calls_p + || rs6000_ra_ever_killed ()) { info_ptr->lr_save_p = 1; regs_ever_live[LINK_REGISTER_REGNUM] = 1; } /* Determine if we need to save the condition code registers. */ - if (regs_ever_live[CR2_REGNO] + if (regs_ever_live[CR2_REGNO] || regs_ever_live[CR3_REGNO] || regs_ever_live[CR4_REGNO]) { @@ -10935,10 +13098,16 @@ rs6000_stack_info (void) /* Determine various sizes. */ info_ptr->reg_size = reg_size; info_ptr->fixed_size = RS6000_SAVE_AREA; - info_ptr->varargs_size = RS6000_VARARGS_AREA; info_ptr->vars_size = RS6000_ALIGN (get_frame_size (), 8); info_ptr->parm_size = RS6000_ALIGN (current_function_outgoing_args_size, TARGET_ALTIVEC ? 16 : 8); + if (FRAME_GROWS_DOWNWARD) + info_ptr->vars_size + += RS6000_ALIGN (info_ptr->fixed_size + info_ptr->vars_size + + info_ptr->parm_size, + ABI_STACK_BOUNDARY / BITS_PER_UNIT) + - (info_ptr->fixed_size + info_ptr->vars_size + + info_ptr->parm_size); if (TARGET_SPE_ABI && info_ptr->spe_64bit_regs_used != 0) info_ptr->spe_gp_size = 8 * (32 - info_ptr->first_gp_reg_save); @@ -10955,12 +13124,14 @@ rs6000_stack_info (void) else info_ptr->vrsave_size = 0; + compute_save_world_info (info_ptr); + /* Calculate the offsets. */ switch (DEFAULT_ABI) { case ABI_NONE: default: - abort (); + gcc_unreachable (); case ABI_AIX: case ABI_DARWIN: @@ -10972,10 +13143,11 @@ rs6000_stack_info (void) info_ptr->vrsave_save_offset = info_ptr->gp_save_offset - info_ptr->vrsave_size; - /* Align stack so vector save area is on a quadword boundary. */ + /* Align stack so vector save area is on a quadword boundary. + The padding goes above the vectors. */ if (info_ptr->altivec_size != 0) info_ptr->altivec_padding_size - = 16 - (-info_ptr->vrsave_save_offset % 16); + = info_ptr->vrsave_save_offset & 0xF; else info_ptr->altivec_padding_size = 0; @@ -10983,6 +13155,8 @@ rs6000_stack_info (void) = info_ptr->vrsave_save_offset - info_ptr->altivec_padding_size - info_ptr->altivec_size; + gcc_assert (info_ptr->altivec_size == 0 + || info_ptr->altivec_save_offset % 16 == 0); /* Adjust for AltiVec case. */ info_ptr->ehrd_offset = info_ptr->altivec_save_offset - ehrd_size; @@ -10999,24 +13173,23 @@ rs6000_stack_info (void) info_ptr->cr_save_offset = info_ptr->gp_save_offset - info_ptr->cr_size; if (TARGET_SPE_ABI && info_ptr->spe_64bit_regs_used != 0) - { - /* Align stack so SPE GPR save area is aligned on a - double-word boundary. */ - if (info_ptr->spe_gp_size != 0) - info_ptr->spe_padding_size - = 8 - (-info_ptr->cr_save_offset % 8); - else - info_ptr->spe_padding_size = 0; + { + /* Align stack so SPE GPR save area is aligned on a + double-word boundary. */ + if (info_ptr->spe_gp_size != 0) + info_ptr->spe_padding_size + = 8 - (-info_ptr->cr_save_offset % 8); + else + info_ptr->spe_padding_size = 0; - info_ptr->spe_gp_save_offset - = info_ptr->cr_save_offset - - info_ptr->spe_padding_size - - info_ptr->spe_gp_size; + info_ptr->spe_gp_save_offset + = info_ptr->cr_save_offset + - info_ptr->spe_padding_size + - info_ptr->spe_gp_size; - /* Adjust for SPE case. */ - info_ptr->toc_save_offset - = info_ptr->spe_gp_save_offset - info_ptr->toc_size; - } + /* Adjust for SPE case. */ + info_ptr->ehrd_offset = info_ptr->spe_gp_save_offset; + } else if (TARGET_ALTIVEC_ABI) { info_ptr->vrsave_save_offset @@ -11035,12 +13208,11 @@ rs6000_stack_info (void) - info_ptr->altivec_size; /* Adjust for AltiVec case. */ - info_ptr->toc_save_offset - = info_ptr->altivec_save_offset - info_ptr->toc_size; + info_ptr->ehrd_offset = info_ptr->altivec_save_offset; } else - info_ptr->toc_save_offset = info_ptr->cr_save_offset - info_ptr->toc_size; - info_ptr->ehrd_offset = info_ptr->toc_save_offset - ehrd_size; + info_ptr->ehrd_offset = info_ptr->cr_save_offset; + info_ptr->ehrd_offset -= ehrd_size; info_ptr->lr_save_offset = reg_size; break; } @@ -11054,15 +13226,12 @@ rs6000_stack_info (void) + info_ptr->spe_padding_size + ehrd_size + info_ptr->cr_size - + info_ptr->lr_size - + info_ptr->vrsave_size - + info_ptr->toc_size, + + info_ptr->vrsave_size, save_align); non_fixed_size = (info_ptr->vars_size + info_ptr->parm_size - + info_ptr->save_size - + info_ptr->varargs_size); + + info_ptr->save_size); info_ptr->total_size = RS6000_ALIGN (non_fixed_size + info_ptr->fixed_size, ABI_STACK_BOUNDARY / BITS_PER_UNIT); @@ -11118,9 +13287,6 @@ rs6000_stack_info (void) if (! info_ptr->cr_save_p) info_ptr->cr_save_offset = 0; - if (! info_ptr->toc_save_p) - info_ptr->toc_save_offset = 0; - return info_ptr; } @@ -11147,10 +13313,23 @@ spe_func_has_64bit_regs_p (void) { rtx i; + /* FIXME: This should be implemented with attributes... + + (set_attr "spe64" "true")....then, + if (get_spe64(insn)) return true; + + It's the only reliable way to do the stuff below. */ + i = PATTERN (insn); - if (GET_CODE (i) == SET - && SPE_VECTOR_MODE (GET_MODE (SET_SRC (i)))) - return true; + if (GET_CODE (i) == SET) + { + enum machine_mode mode = GET_MODE (SET_SRC (i)); + + if (SPE_VECTOR_MODE (mode)) + return true; + if (TARGET_E500_DOUBLE && mode == DFmode) + return true; + } } } @@ -11203,9 +13382,6 @@ debug_stack_info (rs6000_stack_t *info) if (info->cr_save_p) fprintf (stderr, "\tcr_save_p = %5d\n", info->cr_save_p); - if (info->toc_save_p) - fprintf (stderr, "\ttoc_save_p = %5d\n", info->toc_save_p); - if (info->vrsave_mask) fprintf (stderr, "\tvrsave_mask = 0x%x\n", info->vrsave_mask); @@ -11239,9 +13415,6 @@ debug_stack_info (rs6000_stack_t *info) if (info->cr_save_offset) fprintf (stderr, "\tcr_save_offset = %5d\n", info->cr_save_offset); - if (info->toc_save_offset) - fprintf (stderr, "\ttoc_save_offset = %5d\n", info->toc_save_offset); - if (info->varargs_save_offset) fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset); @@ -11249,9 +13422,6 @@ debug_stack_info (rs6000_stack_t *info) fprintf (stderr, "\ttotal_size = "HOST_WIDE_INT_PRINT_DEC"\n", info->total_size); - if (info->varargs_size) - fprintf (stderr, "\tvarargs_size = %5d\n", info->varargs_size); - if (info->vars_size) fprintf (stderr, "\tvars_size = "HOST_WIDE_INT_PRINT_DEC"\n", info->vars_size); @@ -11285,15 +13455,9 @@ debug_stack_info (rs6000_stack_t *info) fprintf (stderr, "\tspe_padding_size = %5d\n", info->spe_padding_size); - if (info->lr_size) - fprintf (stderr, "\tlr_size = %5d\n", info->lr_size); - if (info->cr_size) fprintf (stderr, "\tcr_size = %5d\n", info->cr_size); - if (info->toc_size) - fprintf (stderr, "\ttoc_size = %5d\n", info->toc_size); - if (info->save_size) fprintf (stderr, "\tsave_size = %5d\n", info->save_size); @@ -11342,14 +13506,14 @@ rs6000_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) if (decl) { if (TARGET_ALTIVEC_VRSAVE) - { + { for (type = TYPE_ARG_TYPES (TREE_TYPE (decl)); type; type = TREE_CHAIN (type)) { if (TREE_CODE (TREE_VALUE (type)) == VECTOR_TYPE) return false; } - } + } if (DEFAULT_ABI == ABI_DARWIN || (*targetm.binds_local_p) (decl)) { @@ -11363,6 +13527,24 @@ rs6000_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) return false; } +/* NULL if INSN insn is valid within a low-overhead loop. + Otherwise return why doloop cannot be applied. + PowerPC uses the COUNT register for branch on table instructions. */ + +static const char * +rs6000_invalid_within_doloop (rtx insn) +{ + if (CALL_P (insn)) + return "Function call in the loop."; + + if (JUMP_P (insn) + && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (insn)) == ADDR_VEC)) + return "Computed branch in the loop."; + + return NULL; +} + static int rs6000_ra_ever_killed (void) { @@ -11388,7 +13570,7 @@ rs6000_ra_ever_killed (void) When we're called from the epilogue, we need to avoid counting this as a store. */ - + push_topmost_sequence (); top = get_insns (); pop_topmost_sequence (); @@ -11398,10 +13580,12 @@ rs6000_ra_ever_killed (void) { if (INSN_P (insn)) { - if (FIND_REG_INC_NOTE (insn, reg)) - return 1; - else if (GET_CODE (insn) == CALL_INSN - && !SIBLING_CALL_P (insn)) + if (CALL_P (insn)) + { + if (!SIBLING_CALL_P (insn)) + return 1; + } + else if (find_regno_note (insn, REG_INC, LINK_REGISTER_REGNUM)) return 1; else if (set_of (reg, insn) != NULL_RTX && !prologue_epilogue_contains (insn)) @@ -11430,15 +13614,49 @@ rs6000_emit_load_toc_table (int fromprolog) rtx dest, insn; dest = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM); - if (TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 1) + if (TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic) { - rtx temp = (fromprolog - ? gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM) - : gen_reg_rtx (Pmode)); - insn = emit_insn (gen_load_toc_v4_pic_si (temp)); + char buf[30]; + rtx lab, tmp1, tmp2, got, tempLR; + + ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); + lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); + if (flag_pic == 2) + got = gen_rtx_SYMBOL_REF (Pmode, toc_label_name); + else + got = rs6000_got_sym (); + tmp1 = tmp2 = dest; + if (!fromprolog) + { + tmp1 = gen_reg_rtx (Pmode); + tmp2 = gen_reg_rtx (Pmode); + } + tempLR = (fromprolog + ? gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM) + : gen_reg_rtx (Pmode)); + insn = emit_insn (gen_load_toc_v4_PIC_1 (tempLR, lab)); if (fromprolog) rs6000_maybe_dead (insn); - insn = emit_move_insn (dest, temp); + insn = emit_move_insn (tmp1, tempLR); + if (fromprolog) + rs6000_maybe_dead (insn); + insn = emit_insn (gen_load_toc_v4_PIC_3b (tmp2, tmp1, got, lab)); + if (fromprolog) + rs6000_maybe_dead (insn); + insn = emit_insn (gen_load_toc_v4_PIC_3c (dest, tmp2, got, lab)); + if (fromprolog) + rs6000_maybe_dead (insn); + } + else if (TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 1) + { + rtx tempLR = (fromprolog + ? gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM) + : gen_reg_rtx (Pmode)); + + insn = emit_insn (gen_load_toc_v4_pic_si (tempLR)); + if (fromprolog) + rs6000_maybe_dead (insn); + insn = emit_move_insn (dest, tempLR); if (fromprolog) rs6000_maybe_dead (insn); } @@ -11452,13 +13670,6 @@ rs6000_emit_load_toc_table (int fromprolog) ? gen_rtx_REG (Pmode, 0) : gen_reg_rtx (Pmode)); - /* possibly create the toc section */ - if (! toc_initialized) - { - toc_section (); - function_section (current_function_decl); - } - if (fromprolog) { rtx symF, symL; @@ -11504,8 +13715,10 @@ rs6000_emit_load_toc_table (int fromprolog) if (fromprolog) rs6000_maybe_dead (insn); } - else if (DEFAULT_ABI == ABI_AIX) + else { + gcc_assert (DEFAULT_ABI == ABI_AIX); + if (TARGET_32BIT) insn = emit_insn (gen_load_toc_aix_si (dest)); else @@ -11513,8 +13726,6 @@ rs6000_emit_load_toc_table (int fromprolog) if (fromprolog) rs6000_maybe_dead (insn); } - else - abort (); } /* Emit instructions to restore the link register after determining where @@ -11539,14 +13750,15 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch) || current_function_calls_alloca || info->total_size > 32767) { - emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx)); + tmp = gen_frame_mem (Pmode, frame_rtx); + emit_move_insn (operands[1], tmp); frame_rtx = operands[1]; } else if (info->push_p) sp_offset = info->total_size; tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset); - tmp = gen_rtx_MEM (Pmode, tmp); + tmp = gen_frame_mem (Pmode, tmp); emit_move_insn (tmp, operands[0]); } else @@ -11555,20 +13767,20 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch) static GTY(()) int set = -1; -int +int get_TOC_alias_set (void) { if (set == -1) set = new_alias_set (); return set; -} +} /* This returns nonzero if the current function uses the TOC. This is determined by the presence of (use (unspec ... UNSPEC_TOC)), which is generated by the ABI_V4 load_toc_* patterns. */ #if TARGET_ELF static int -uses_TOC (void) +uses_TOC (void) { rtx insn; @@ -11578,7 +13790,7 @@ uses_TOC (void) rtx pat = PATTERN (insn); int i; - if (GET_CODE (pat) == PARALLEL) + if (GET_CODE (pat) == PARALLEL) for (i = 0; i < XVECLEN (pat, 0); i++) { rtx sub = XVECEXP (pat, 0, i); @@ -11596,14 +13808,14 @@ uses_TOC (void) #endif rtx -create_TOC_reference (rtx symbol) +create_TOC_reference (rtx symbol) { if (no_new_pseudos) regs_ever_live[TOC_REGISTER] = 1; - return gen_rtx_PLUS (Pmode, + return gen_rtx_PLUS (Pmode, gen_rtx_REG (Pmode, TOC_REGISTER), - gen_rtx_CONST (Pmode, - gen_rtx_MINUS (Pmode, symbol, + gen_rtx_CONST (Pmode, + gen_rtx_MINUS (Pmode, symbol, gen_rtx_SYMBOL_REF (Pmode, toc_label_name)))); } @@ -11621,12 +13833,12 @@ rs6000_aix_emit_builtin_unwind_init (void) rtx tocompare = gen_reg_rtx (SImode); rtx no_toc_save_needed = gen_label_rtx (); - mem = gen_rtx_MEM (Pmode, hard_frame_pointer_rtx); + mem = gen_frame_mem (Pmode, hard_frame_pointer_rtx); emit_move_insn (stack_top, mem); - mem = gen_rtx_MEM (Pmode, - gen_rtx_PLUS (Pmode, stack_top, - GEN_INT (2 * GET_MODE_SIZE (Pmode)))); + mem = gen_frame_mem (Pmode, + gen_rtx_PLUS (Pmode, stack_top, + GEN_INT (2 * GET_MODE_SIZE (Pmode)))); emit_move_insn (opcode_addr, mem); emit_move_insn (opcode, gen_rtx_MEM (SImode, opcode_addr)); emit_move_insn (tocompare, gen_int_mode (TARGET_32BIT ? 0x80410014 @@ -11636,22 +13848,22 @@ rs6000_aix_emit_builtin_unwind_init (void) SImode, NULL_RTX, NULL_RTX, no_toc_save_needed); - mem = gen_rtx_MEM (Pmode, - gen_rtx_PLUS (Pmode, stack_top, - GEN_INT (5 * GET_MODE_SIZE (Pmode)))); + mem = gen_frame_mem (Pmode, + gen_rtx_PLUS (Pmode, stack_top, + GEN_INT (5 * GET_MODE_SIZE (Pmode)))); emit_move_insn (mem, gen_rtx_REG (Pmode, 2)); emit_label (no_toc_save_needed); } -/* This ties together stack memory (MEM with an alias set of - rs6000_sr_alias_set) and the change to the stack pointer. */ +/* This ties together stack memory (MEM with an alias set of frame_alias_set) + and the change to the stack pointer. */ static void rs6000_emit_stack_tie (void) { - rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM)); + rtx mem = gen_frame_mem (BLKmode, + gen_rtx_REG (Pmode, STACK_POINTER_REGNUM)); - set_mem_alias_set (mem, rs6000_sr_alias_set); emit_insn (gen_stack_tie (mem)); } @@ -11665,12 +13877,19 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) rtx insn; rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM); rtx tmp_reg = gen_rtx_REG (Pmode, 0); - rtx todec = GEN_INT (-size); + rtx todec = gen_int_mode (-size, Pmode); + + if (INTVAL (todec) != -size) + { + warning (0, "stack frame too large"); + emit_insn (gen_trap ()); + return; + } if (current_function_limit_stack) { if (REG_P (stack_limit_rtx) - && REGNO (stack_limit_rtx) > 1 + && REGNO (stack_limit_rtx) > 1 && REGNO (stack_limit_rtx) <= 31) { emit_insn (TARGET_32BIT @@ -11689,8 +13908,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) && DEFAULT_ABI == ABI_V4) { rtx toload = gen_rtx_CONST (VOIDmode, - gen_rtx_PLUS (Pmode, - stack_limit_rtx, + gen_rtx_PLUS (Pmode, + stack_limit_rtx, GEN_INT (size))); emit_insn (gen_elf_high (tmp_reg, toload)); @@ -11699,7 +13918,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) const0_rtx)); } else - warning ("stack limit expression is not supported"); + warning (0, "stack limit expression is not supported"); } if (copy_r12 || ! TARGET_UPDATE) @@ -11710,7 +13929,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) if (size > 32767) { /* Need a note here so that try_split doesn't get confused. */ - if (get_last_insn() == NULL_RTX) + if (get_last_insn () == NULL_RTX) emit_note (NOTE_INSN_DELETED); insn = emit_move_insn (tmp_reg, todec); try_split (PATTERN (insn), insn, 0); @@ -11720,7 +13939,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) insn = emit_insn (TARGET_32BIT ? gen_movsi_update (stack_reg, stack_reg, todec, stack_reg) - : gen_movdi_update (stack_reg, stack_reg, + : gen_movdi_di_update (stack_reg, stack_reg, todec, stack_reg)); } else @@ -11731,11 +13950,11 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) emit_move_insn (gen_rtx_MEM (Pmode, stack_reg), gen_rtx_REG (Pmode, 12)); } - + RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) = + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, stack_reg, + gen_rtx_SET (VOIDmode, stack_reg, gen_rtx_PLUS (Pmode, stack_reg, GEN_INT (-size))), REG_NOTES (insn)); @@ -11748,7 +13967,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) its hand so much. */ static void -rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, +rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, rtx reg2, rtx rreg) { rtx real, temp; @@ -11765,12 +13984,12 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, if (reg2 != NULL_RTX) real = replace_rtx (real, reg2, rreg); - - real = replace_rtx (real, reg, + + real = replace_rtx (real, reg, gen_rtx_PLUS (Pmode, gen_rtx_REG (Pmode, STACK_POINTER_REGNUM), GEN_INT (val))); - + /* We expect that 'real' is either a SET or a PARALLEL containing SETs (and possibly other stuff). In a PARALLEL, all the SETs are important so they all have to be marked RTX_FRAME_RELATED_P. */ @@ -11778,7 +13997,7 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, if (GET_CODE (real) == SET) { rtx set = real; - + temp = simplify_rtx (SET_SRC (set)); if (temp) SET_SRC (set) = temp; @@ -11792,14 +14011,16 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, XEXP (SET_DEST (set), 0) = temp; } } - else if (GET_CODE (real) == PARALLEL) + else { int i; + + gcc_assert (GET_CODE (real) == PARALLEL); for (i = 0; i < XVECLEN (real, 0); i++) if (GET_CODE (XVECEXP (real, 0, i)) == SET) { rtx set = XVECEXP (real, 0, i); - + temp = simplify_rtx (SET_SRC (set)); if (temp) SET_SRC (set) = temp; @@ -11815,8 +14036,6 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, RTX_FRAME_RELATED_P (set) = 1; } } - else - abort (); if (TARGET_SPE) real = spe_synthesize_frame_save (real); @@ -11845,10 +14064,9 @@ spe_synthesize_frame_save (rtx real) This is so we can differentiate between 64-bit and 32-bit saves. Words cannot describe this nastiness. */ - if (GET_CODE (SET_DEST (real)) != MEM - || GET_CODE (XEXP (SET_DEST (real), 0)) != PLUS - || GET_CODE (SET_SRC (real)) != REG) - abort (); + gcc_assert (GET_CODE (SET_DEST (real)) == MEM + && GET_CODE (XEXP (SET_DEST (real), 0)) == PLUS + && GET_CODE (SET_SRC (real)) == REG); /* Transform: (set (mem (plus (reg x) (const y))) @@ -11905,7 +14123,7 @@ generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep) vrsave, gen_rtx_UNSPEC_VOLATILE (SImode, gen_rtvec (2, reg, vrsave), - 30)); + UNSPECV_SET_VRSAVE)); nclobs = 1; @@ -11953,7 +14171,7 @@ generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep) Save REGNO into [FRAME_REG + OFFSET] in mode MODE. */ static void -emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, +emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, unsigned int regno, int offset, HOST_WIDE_INT total_size) { rtx reg, offset_rtx, insn, mem, addr, int_rtx; @@ -11963,12 +14181,13 @@ emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, /* Some cases that need register indexed addressing. */ if ((TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) + || (TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE_ABI && SPE_VECTOR_MODE (mode) && !SPE_CONST_OFFSET_OK (offset))) { /* Whomever calls us must make sure r11 is available in the - flow path of instructions in the prologue. */ + flow path of instructions in the prologue. */ offset_rtx = gen_rtx_REG (Pmode, 11); emit_move_insn (offset_rtx, int_rtx); @@ -11984,8 +14203,7 @@ emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, reg = gen_rtx_REG (mode, regno); addr = gen_rtx_PLUS (Pmode, frame_reg, offset_rtx); - mem = gen_rtx_MEM (mode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (mode, addr); insn = emit_move_insn (mem, reg); @@ -12002,7 +14220,8 @@ gen_frame_mem_offset (enum machine_mode mode, rtx reg, int offset) int_rtx = GEN_INT (offset); - if (TARGET_SPE_ABI && SPE_VECTOR_MODE (mode)) + if ((TARGET_SPE_ABI && SPE_VECTOR_MODE (mode)) + || (TARGET_E500_DOUBLE && mode == DFmode)) { offset_rtx = gen_rtx_REG (Pmode, FIXED_SCRATCH); emit_move_insn (offset_rtx, int_rtx); @@ -12010,9 +14229,26 @@ gen_frame_mem_offset (enum machine_mode mode, rtx reg, int offset) else offset_rtx = int_rtx; - return gen_rtx_MEM (mode, gen_rtx_PLUS (Pmode, reg, offset_rtx)); + return gen_frame_mem (mode, gen_rtx_PLUS (Pmode, reg, offset_rtx)); } +/* Look for user-defined global regs. We should not save and restore these, + and cannot use stmw/lmw if there are any in its range. */ + +static bool +no_global_regs_above (int first_greg) +{ + int i; + for (i = 0; i < 32 - first_greg; i++) + if (global_regs[first_greg + i]) + return false; + return true; +} + +#ifndef TARGET_FIX_AND_CONTINUE +#define TARGET_FIX_AND_CONTINUE 0 +#endif + /* Emit function prologue as insns. */ void @@ -12029,24 +14265,40 @@ rs6000_emit_prologue (void) int saving_FPRs_inline; int using_store_multiple; HOST_WIDE_INT sp_offset = 0; - - if (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0) - { - reg_mode = V2SImode; - reg_size = 8; - } + + if (TARGET_FIX_AND_CONTINUE) + { + /* gdb on darwin arranges to forward a function from the old + address by modifying the first 5 instructions of the function + to branch to the overriding function. This is necessary to + permit function pointers that point to the old function to + actually forward to the new function. */ + emit_insn (gen_nop ()); + emit_insn (gen_nop ()); + emit_insn (gen_nop ()); + emit_insn (gen_nop ()); + emit_insn (gen_nop ()); + } + + if (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0) + { + reg_mode = V2SImode; + reg_size = 8; + } using_store_multiple = (TARGET_MULTIPLE && ! TARGET_POWERPC64 && (!TARGET_SPE_ABI || info->spe_64bit_regs_used == 0) - && info->first_gp_reg_save < 31); + && info->first_gp_reg_save < 31 + && no_global_regs_above (info->first_gp_reg_save)); saving_FPRs_inline = (info->first_fp_reg_save == 64 || FP_SAVE_INLINE (info->first_fp_reg_save) || current_function_calls_eh_return || cfun->machine->ra_need_lr); /* For V.4, update stack before we do any saving and set back pointer. */ - if (info->push_p + if (! WORLD_SAVE_P (info) + && info->push_p && (DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)) { @@ -12054,7 +14306,7 @@ rs6000_emit_prologue (void) sp_offset = info->total_size; else frame_reg_rtx = frame_ptr_rtx; - rs6000_emit_allocate_stack (info->total_size, + rs6000_emit_allocate_stack (info->total_size, (frame_reg_rtx != sp_reg_rtx && (info->cr_save_p || info->lr_save_p @@ -12065,8 +14317,123 @@ rs6000_emit_prologue (void) rs6000_emit_stack_tie (); } + /* Handle world saves specially here. */ + if (WORLD_SAVE_P (info)) + { + int i, j, sz; + rtx treg; + rtvec p; + rtx reg0; + + /* save_world expects lr in r0. */ + reg0 = gen_rtx_REG (Pmode, 0); + if (info->lr_save_p) + { + insn = emit_move_insn (reg0, + gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); + RTX_FRAME_RELATED_P (insn) = 1; + } + + /* The SAVE_WORLD and RESTORE_WORLD routines make a number of + assumptions about the offsets of various bits of the stack + frame. */ + gcc_assert (info->gp_save_offset == -220 + && info->fp_save_offset == -144 + && info->lr_save_offset == 8 + && info->cr_save_offset == 4 + && info->push_p + && info->lr_save_p + && (!current_function_calls_eh_return + || info->ehrd_offset == -432) + && info->vrsave_save_offset == -224 + && info->altivec_save_offset == -416); + + treg = gen_rtx_REG (SImode, 11); + emit_move_insn (treg, GEN_INT (-info->total_size)); + + /* SAVE_WORLD takes the caller's LR in R0 and the frame size + in R11. It also clobbers R12, so beware! */ + + /* Preserve CR2 for save_world prologues */ + sz = 5; + sz += 32 - info->first_gp_reg_save; + sz += 64 - info->first_fp_reg_save; + sz += LAST_ALTIVEC_REGNO - info->first_altivec_reg_save + 1; + p = rtvec_alloc (sz); + j = 0; + RTVEC_ELT (p, j++) = gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (Pmode, + LINK_REGISTER_REGNUM)); + RTVEC_ELT (p, j++) = gen_rtx_USE (VOIDmode, + gen_rtx_SYMBOL_REF (Pmode, + "*save_world")); + /* We do floats first so that the instruction pattern matches + properly. */ + for (i = 0; i < 64 - info->first_fp_reg_save; i++) + { + rtx reg = gen_rtx_REG (DFmode, info->first_fp_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->fp_save_offset + + sp_offset + 8 * i)); + rtx mem = gen_frame_mem (DFmode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg); + } + for (i = 0; info->first_altivec_reg_save + i <= LAST_ALTIVEC_REGNO; i++) + { + rtx reg = gen_rtx_REG (V4SImode, info->first_altivec_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->altivec_save_offset + + sp_offset + 16 * i)); + rtx mem = gen_frame_mem (V4SImode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg); + } + for (i = 0; i < 32 - info->first_gp_reg_save; i++) + { + rtx reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + sp_offset + reg_size * i)); + rtx mem = gen_frame_mem (reg_mode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg); + } + + { + /* CR register traditionally saved as CR2. */ + rtx reg = gen_rtx_REG (reg_mode, CR2_REGNO); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->cr_save_offset + + sp_offset)); + rtx mem = gen_frame_mem (reg_mode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg); + } + /* Explain about use of R0. */ + if (info->lr_save_p) + { + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->lr_save_offset + + sp_offset)); + rtx mem = gen_frame_mem (reg_mode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg0); + } + /* Explain what happens to the stack pointer. */ + { + rtx newval = gen_rtx_PLUS (Pmode, sp_reg_rtx, treg); + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, sp_reg_rtx, newval); + } + + insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + treg, GEN_INT (-info->total_size)); + sp_offset = info->total_size; + } + /* Save AltiVec registers if needed. */ - if (TARGET_ALTIVEC_ABI && info->altivec_size != 0) + if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0) { int i; @@ -12087,10 +14454,8 @@ rs6000_emit_prologue (void) emit_move_insn (areg, GEN_INT (offset)); /* AltiVec addressing mode is [reg+reg]. */ - mem = gen_rtx_MEM (V4SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, areg)); - - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (V4SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, areg)); insn = emit_move_insn (mem, savereg); @@ -12122,13 +14487,15 @@ rs6000_emit_prologue (void) else emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave)); - /* Save VRSAVE. */ - offset = info->vrsave_save_offset + sp_offset; - mem - = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); - set_mem_alias_set (mem, rs6000_sr_alias_set); - insn = emit_move_insn (mem, reg); + if (!WORLD_SAVE_P (info)) + { + /* Save VRSAVE. */ + offset = info->vrsave_save_offset + sp_offset; + mem = gen_frame_mem (SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (offset))); + insn = emit_move_insn (mem, reg); + } /* Include the registers in the mask. */ emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask))); @@ -12137,40 +14504,57 @@ rs6000_emit_prologue (void) } /* If we use the link register, get it into r0. */ - if (info->lr_save_p) - emit_move_insn (gen_rtx_REG (Pmode, 0), - gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); + if (!WORLD_SAVE_P (info) && info->lr_save_p) + { + insn = emit_move_insn (gen_rtx_REG (Pmode, 0), + gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); + RTX_FRAME_RELATED_P (insn) = 1; + } /* If we need to save CR, put it into r12. */ - if (info->cr_save_p && frame_reg_rtx != frame_ptr_rtx) + if (!WORLD_SAVE_P (info) && info->cr_save_p && frame_reg_rtx != frame_ptr_rtx) { + rtx set; + cr_save_rtx = gen_rtx_REG (SImode, 12); - emit_insn (gen_movesi_from_cr (cr_save_rtx)); + insn = emit_insn (gen_movesi_from_cr (cr_save_rtx)); + RTX_FRAME_RELATED_P (insn) = 1; + /* Now, there's no way that dwarf2out_frame_debug_expr is going + to understand '(unspec:SI [(reg:CC 68) ...] UNSPEC_MOVESI_FROM_CR)'. + But that's OK. All we have to do is specify that _one_ condition + code register is saved in this stack slot. The thrower's epilogue + will then restore all the call-saved registers. + We use CR2_REGNO (70) to be compatible with gcc-2.95 on Linux. */ + set = gen_rtx_SET (VOIDmode, cr_save_rtx, + gen_rtx_REG (SImode, CR2_REGNO)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, + set, + REG_NOTES (insn)); } /* Do any required saving of fpr's. If only one or two to save, do it ourselves. Otherwise, call function. */ - if (saving_FPRs_inline) + if (!WORLD_SAVE_P (info) && saving_FPRs_inline) { int i; for (i = 0; i < 64 - info->first_fp_reg_save; i++) - if ((regs_ever_live[info->first_fp_reg_save+i] + if ((regs_ever_live[info->first_fp_reg_save+i] && ! call_used_regs[info->first_fp_reg_save+i])) emit_frame_save (frame_reg_rtx, frame_ptr_rtx, DFmode, info->first_fp_reg_save + i, info->fp_save_offset + sp_offset + 8 * i, info->total_size); } - else if (info->first_fp_reg_save != 64) + else if (!WORLD_SAVE_P (info) && info->first_fp_reg_save != 64) { int i; char rname[30]; const char *alloc_rname; rtvec p; p = rtvec_alloc (2 + 64 - info->first_fp_reg_save); - - RTVEC_ELT (p, 0) = gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (Pmode, + + RTVEC_ELT (p, 0) = gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); sprintf (rname, "%s%d%s", SAVE_FP_PREFIX, info->first_fp_reg_save - 32, SAVE_FP_SUFFIX); @@ -12183,21 +14567,20 @@ rs6000_emit_prologue (void) rtx addr, reg, mem; reg = gen_rtx_REG (DFmode, info->first_fp_reg_save + i); addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->fp_save_offset + GEN_INT (info->fp_save_offset + sp_offset + 8*i)); - mem = gen_rtx_MEM (DFmode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (DFmode, addr); RTVEC_ELT (p, i + 2) = gen_rtx_SET (VOIDmode, mem, reg); } insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, NULL_RTX, NULL_RTX); } /* Save GPRs. This is done as a PARALLEL if we are using the store-multiple instructions. */ - if (using_store_multiple) + if (!WORLD_SAVE_P (info) && using_store_multiple) { rtvec p; int i; @@ -12206,29 +14589,28 @@ rs6000_emit_prologue (void) { rtx addr, reg, mem; reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i); - addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->gp_save_offset - + sp_offset + addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + sp_offset + reg_size * i)); - mem = gen_rtx_MEM (reg_mode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (reg_mode, addr); RTVEC_ELT (p, i) = gen_rtx_SET (VOIDmode, mem, reg); } insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, NULL_RTX, NULL_RTX); } - else + else if (!WORLD_SAVE_P (info)) { int i; for (i = 0; i < 32 - info->first_gp_reg_save; i++) - if ((regs_ever_live[info->first_gp_reg_save+i] - && (! call_used_regs[info->first_gp_reg_save+i] - || (i+info->first_gp_reg_save + if ((regs_ever_live[info->first_gp_reg_save + i] + && (!call_used_regs[info->first_gp_reg_save + i] + || (i + info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM && TARGET_TOC && TARGET_MINIMAL_TOC))) - || (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM + || (i + info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))) { @@ -12249,8 +14631,7 @@ rs6000_emit_prologue (void) b = GEN_INT (offset); addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, b); - mem = gen_rtx_MEM (V2SImode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (V2SImode, addr); insn = emit_move_insn (mem, reg); if (GET_CODE (b) == CONST_INT) @@ -12262,15 +14643,14 @@ rs6000_emit_prologue (void) } else { - addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->gp_save_offset - + sp_offset + addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + sp_offset + reg_size * i)); - mem = gen_rtx_MEM (reg_mode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (reg_mode, addr); insn = emit_move_insn (mem, reg); - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, NULL_RTX, NULL_RTX); } } @@ -12290,11 +14670,10 @@ rs6000_emit_prologue (void) reg = gen_rtx_REG (reg_mode, 2); addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (sp_offset + 5 * reg_size)); - mem = gen_rtx_MEM (reg_mode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (reg_mode, addr); insn = emit_move_insn (mem, reg); - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, NULL_RTX, NULL_RTX); PATTERN (insn) = gen_blockage (); } @@ -12313,100 +14692,117 @@ rs6000_emit_prologue (void) } /* Save lr if we used it. */ - if (info->lr_save_p) + if (!WORLD_SAVE_P (info) && info->lr_save_p) { rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (info->lr_save_offset + sp_offset)); rtx reg = gen_rtx_REG (Pmode, 0); rtx mem = gen_rtx_MEM (Pmode, addr); - /* This should not be of rs6000_sr_alias_set, because of + /* This should not be of frame_alias_set, because of __builtin_return_address. */ - + insn = emit_move_insn (mem, reg); - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, - reg, gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + NULL_RTX, NULL_RTX); } /* Save CR if we use any that must be preserved. */ - if (info->cr_save_p) + if (!WORLD_SAVE_P (info) && info->cr_save_p) { rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (info->cr_save_offset + sp_offset)); - rtx mem = gen_rtx_MEM (SImode, addr); - - set_mem_alias_set (mem, rs6000_sr_alias_set); + rtx mem = gen_frame_mem (SImode, addr); + /* See the large comment above about why CR2_REGNO is used. */ + rtx magic_eh_cr_reg = gen_rtx_REG (SImode, CR2_REGNO); /* If r12 was used to hold the original sp, copy cr into r0 now that it's free. */ if (REGNO (frame_reg_rtx) == 12) { + rtx set; + cr_save_rtx = gen_rtx_REG (SImode, 0); - emit_insn (gen_movesi_from_cr (cr_save_rtx)); + insn = emit_insn (gen_movesi_from_cr (cr_save_rtx)); + RTX_FRAME_RELATED_P (insn) = 1; + set = gen_rtx_SET (VOIDmode, cr_save_rtx, magic_eh_cr_reg); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, + set, + REG_NOTES (insn)); + } insn = emit_move_insn (mem, cr_save_rtx); - /* Now, there's no way that dwarf2out_frame_debug_expr is going - to understand '(unspec:SI [(reg:CC 68) ...] UNSPEC_MOVESI_FROM_CR)'. - But that's OK. All we have to do is specify that _one_ condition - code register is saved in this stack slot. The thrower's epilogue - will then restore all the call-saved registers. - We use CR2_REGNO (70) to be compatible with gcc-2.95 on Linux. */ - rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, - cr_save_rtx, gen_rtx_REG (SImode, CR2_REGNO)); + rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, + NULL_RTX, NULL_RTX); } - /* Update stack and set back pointer unless this is V.4, + /* Update stack and set back pointer unless this is V.4, for which it was done previously. */ - if (info->push_p + if (!WORLD_SAVE_P (info) && info->push_p && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)) rs6000_emit_allocate_stack (info->total_size, FALSE); /* Set frame pointer, if needed. */ if (frame_pointer_needed) { - insn = emit_move_insn (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), + insn = emit_move_insn (gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM), sp_reg_rtx); RTX_FRAME_RELATED_P (insn) = 1; } /* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */ if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) - || (DEFAULT_ABI == ABI_V4 && flag_pic == 1 + || (DEFAULT_ABI == ABI_V4 + && (flag_pic == 1 || (flag_pic && TARGET_SECURE_PLT)) && regs_ever_live[RS6000_PIC_OFFSET_TABLE_REGNUM])) - { - /* If emit_load_toc_table will use the link register, we need to save - it. We use R12 for this purpose because emit_load_toc_table - can use register 0. This allows us to use a plain 'blr' to return - from the procedure more often. */ - int save_LR_around_toc_setup = (TARGET_ELF - && DEFAULT_ABI != ABI_AIX - && flag_pic - && ! info->lr_save_p - && EXIT_BLOCK_PTR->pred != NULL); - if (save_LR_around_toc_setup) - { - rtx lr = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM); - rs6000_maybe_dead (emit_move_insn (frame_ptr_rtx, lr)); + { + /* If emit_load_toc_table will use the link register, we need to save + it. We use R12 for this purpose because emit_load_toc_table + can use register 0. This allows us to use a plain 'blr' to return + from the procedure more often. */ + int save_LR_around_toc_setup = (TARGET_ELF + && DEFAULT_ABI != ABI_AIX + && flag_pic + && ! info->lr_save_p + && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0); + if (save_LR_around_toc_setup) + { + rtx lr = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM); + + insn = emit_move_insn (frame_ptr_rtx, lr); + rs6000_maybe_dead (insn); + RTX_FRAME_RELATED_P (insn) = 1; + + rs6000_emit_load_toc_table (TRUE); + + insn = emit_move_insn (lr, frame_ptr_rtx); + rs6000_maybe_dead (insn); + RTX_FRAME_RELATED_P (insn) = 1; + } + else rs6000_emit_load_toc_table (TRUE); - rs6000_maybe_dead (emit_move_insn (lr, frame_ptr_rtx)); - } - else - rs6000_emit_load_toc_table (TRUE); - } + } #if TARGET_MACHO if (DEFAULT_ABI == ABI_DARWIN && flag_pic && current_function_uses_pic_offset_table) { - rtx dest = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM); - const char *picbase = machopic_function_base_name (); - rtx src = gen_rtx_SYMBOL_REF (Pmode, picbase); + rtx lr = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM); + rtx src = machopic_function_base_sym (); - rs6000_maybe_dead (emit_insn (gen_load_macho_picbase (dest, src))); + /* Save and restore LR locally around this call (in R0). */ + if (!info->lr_save_p) + rs6000_maybe_dead (emit_move_insn (gen_rtx_REG (Pmode, 0), lr)); - rs6000_maybe_dead ( - emit_move_insn (gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM), - gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM))); + rs6000_maybe_dead (emit_insn (gen_load_macho_picbase (lr, src))); + + insn = emit_move_insn (gen_rtx_REG (Pmode, + RS6000_PIC_OFFSET_TABLE_REGNUM), + lr); + rs6000_maybe_dead (insn); + + if (!info->lr_save_p) + rs6000_maybe_dead (emit_move_insn (lr, gen_rtx_REG (Pmode, 0))); } #endif } @@ -12414,7 +14810,7 @@ rs6000_emit_prologue (void) /* Write function prologue. */ static void -rs6000_output_function_prologue (FILE *file, +rs6000_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { rs6000_stack_t *info = rs6000_stack_info (); @@ -12466,13 +14862,13 @@ rs6000_output_function_prologue (FILE *file, if (TARGET_DEBUG_STACK) debug_rtx_list (get_insns (), 100); - final (get_insns (), file, FALSE, FALSE); + final (get_insns (), file, FALSE); end_sequence (); } rs6000_pic_labelno++; } - + /* Emit function epilogue as insns. At present, dwarf2out_frame_debug_expr doesn't understand @@ -12506,12 +14902,13 @@ rs6000_emit_epilogue (int sibcall) using_load_multiple = (TARGET_MULTIPLE && ! TARGET_POWERPC64 && (!TARGET_SPE_ABI || info->spe_64bit_regs_used == 0) - && info->first_gp_reg_save < 31); + && info->first_gp_reg_save < 31 + && no_global_regs_above (info->first_gp_reg_save)); restoring_FPRs_inline = (sibcall || current_function_calls_eh_return || info->first_fp_reg_save == 64 || FP_SAVE_INLINE (info->first_fp_reg_save)); - use_backchain_to_restore_sp = (frame_pointer_needed + use_backchain_to_restore_sp = (frame_pointer_needed || current_function_calls_alloca || info->total_size > 32767); using_mfcr_multiple = (rs6000_cpu == PROCESSOR_PPC601 @@ -12519,6 +14916,97 @@ rs6000_emit_epilogue (int sibcall) || rs6000_cpu == PROCESSOR_PPC750 || optimize_size); + if (WORLD_SAVE_P (info)) + { + int i, j; + char rname[30]; + const char *alloc_rname; + rtvec p; + + /* eh_rest_world_r10 will return to the location saved in the LR + stack slot (which is not likely to be our caller.) + Input: R10 -- stack adjustment. Clobbers R0, R11, R12, R7, R8. + rest_world is similar, except any R10 parameter is ignored. + The exception-handling stuff that was here in 2.95 is no + longer necessary. */ + + p = rtvec_alloc (9 + + 1 + + 32 - info->first_gp_reg_save + + LAST_ALTIVEC_REGNO + 1 - info->first_altivec_reg_save + + 63 + 1 - info->first_fp_reg_save); + + strcpy (rname, ((current_function_calls_eh_return) ? + "*eh_rest_world_r10" : "*rest_world")); + alloc_rname = ggc_strdup (rname); + + j = 0; + RTVEC_ELT (p, j++) = gen_rtx_RETURN (VOIDmode); + RTVEC_ELT (p, j++) = gen_rtx_USE (VOIDmode, + gen_rtx_REG (Pmode, + LINK_REGISTER_REGNUM)); + RTVEC_ELT (p, j++) + = gen_rtx_USE (VOIDmode, gen_rtx_SYMBOL_REF (Pmode, alloc_rname)); + /* The instruction pattern requires a clobber here; + it is shared with the restVEC helper. */ + RTVEC_ELT (p, j++) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 11)); + + { + /* CR register traditionally saved as CR2. */ + rtx reg = gen_rtx_REG (reg_mode, CR2_REGNO); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->cr_save_offset)); + rtx mem = gen_frame_mem (reg_mode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, reg, mem); + } + + for (i = 0; i < 32 - info->first_gp_reg_save; i++) + { + rtx reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + reg_size * i)); + rtx mem = gen_frame_mem (reg_mode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, reg, mem); + } + for (i = 0; info->first_altivec_reg_save + i <= LAST_ALTIVEC_REGNO; i++) + { + rtx reg = gen_rtx_REG (V4SImode, info->first_altivec_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->altivec_save_offset + + 16 * i)); + rtx mem = gen_frame_mem (V4SImode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, reg, mem); + } + for (i = 0; info->first_fp_reg_save + i <= 63; i++) + { + rtx reg = gen_rtx_REG (DFmode, info->first_fp_reg_save + i); + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->fp_save_offset + + 8 * i)); + rtx mem = gen_frame_mem (DFmode, addr); + + RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, reg, mem); + } + RTVEC_ELT (p, j++) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 0)); + RTVEC_ELT (p, j++) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 12)); + RTVEC_ELT (p, j++) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 7)); + RTVEC_ELT (p, j++) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, 8)); + RTVEC_ELT (p, j++) + = gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, 10)); + emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p)); + + return; + } + /* If we have a frame pointer, a call to alloca, or a large stack frame, restore the old stack pointer using the backchain. Otherwise, we know what size to update it with. */ @@ -12531,7 +15019,6 @@ rs6000_emit_epilogue (int sibcall) emit_move_insn (frame_reg_rtx, gen_rtx_MEM (Pmode, sp_reg_rtx)); - } else if (info->push_p) { @@ -12547,7 +15034,7 @@ rs6000_emit_epilogue (int sibcall) GEN_INT (info->total_size))); } } - + /* Restore AltiVec registers if needed. */ if (TARGET_ALTIVEC_ABI && info->altivec_size != 0) { @@ -12566,8 +15053,7 @@ rs6000_emit_epilogue (int sibcall) /* AltiVec addressing mode is [reg+reg]. */ addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, areg); - mem = gen_rtx_MEM (V4SImode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (V4SImode, addr); emit_move_insn (gen_rtx_REG (V4SImode, i), mem); } @@ -12581,8 +15067,7 @@ rs6000_emit_epilogue (int sibcall) addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (info->vrsave_save_offset + sp_offset)); - mem = gen_rtx_MEM (SImode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (SImode, addr); reg = gen_rtx_REG (SImode, 12); emit_move_insn (reg, mem); @@ -12595,28 +15080,24 @@ rs6000_emit_epilogue (int sibcall) rtx mem = gen_frame_mem_offset (Pmode, frame_reg_rtx, info->lr_save_offset + sp_offset); - set_mem_alias_set (mem, rs6000_sr_alias_set); - emit_move_insn (gen_rtx_REG (Pmode, 0), mem); } - + /* Get the old cr if we saved it. */ if (info->cr_save_p) { rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (info->cr_save_offset + sp_offset)); - rtx mem = gen_rtx_MEM (SImode, addr); - - set_mem_alias_set (mem, rs6000_sr_alias_set); + rtx mem = gen_frame_mem (SImode, addr); emit_move_insn (gen_rtx_REG (SImode, 12), mem); } - + /* Set LR here to try to overlap restores below. */ if (info->lr_save_p) emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), gen_rtx_REG (Pmode, 0)); - + /* Load exception handler data registers, if needed. */ if (current_function_calls_eh_return) { @@ -12626,9 +15107,7 @@ rs6000_emit_epilogue (int sibcall) { rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (sp_offset + 5 * reg_size)); - rtx mem = gen_rtx_MEM (reg_mode, addr); - - set_mem_alias_set (mem, rs6000_sr_alias_set); + rtx mem = gen_frame_mem (reg_mode, addr); emit_move_insn (gen_rtx_REG (reg_mode, 2), mem); } @@ -12644,12 +15123,11 @@ rs6000_emit_epilogue (int sibcall) mem = gen_frame_mem_offset (reg_mode, frame_reg_rtx, info->ehrd_offset + sp_offset + reg_size * (int) i); - set_mem_alias_set (mem, rs6000_sr_alias_set); emit_move_insn (gen_rtx_REG (reg_mode, regno), mem); } } - + /* Restore GPRs. This is done as a PARALLEL if we are using the load-multiple instructions. */ if (using_load_multiple) @@ -12658,15 +15136,13 @@ rs6000_emit_epilogue (int sibcall) p = rtvec_alloc (32 - info->first_gp_reg_save); for (i = 0; i < 32 - info->first_gp_reg_save; i++) { - rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->gp_save_offset - + sp_offset + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + sp_offset + reg_size * i)); - rtx mem = gen_rtx_MEM (reg_mode, addr); + rtx mem = gen_frame_mem (reg_mode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); - - RTVEC_ELT (p, i) = + RTVEC_ELT (p, i) = gen_rtx_SET (VOIDmode, gen_rtx_REG (reg_mode, info->first_gp_reg_save + i), mem); @@ -12675,19 +15151,19 @@ rs6000_emit_epilogue (int sibcall) } else for (i = 0; i < 32 - info->first_gp_reg_save; i++) - if ((regs_ever_live[info->first_gp_reg_save+i] - && (! call_used_regs[info->first_gp_reg_save+i] - || (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM + if ((regs_ever_live[info->first_gp_reg_save + i] + && (!call_used_regs[info->first_gp_reg_save + i] + || (i + info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM && TARGET_TOC && TARGET_MINIMAL_TOC))) - || (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM + || (i + info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))) { - rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->gp_save_offset - + sp_offset + rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, + GEN_INT (info->gp_save_offset + + sp_offset + reg_size * i)); - rtx mem = gen_rtx_MEM (reg_mode, addr); + rtx mem = gen_frame_mem (reg_mode, addr); /* Restore 64-bit quantities for SPE. */ if (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0) @@ -12704,30 +15180,27 @@ rs6000_emit_epilogue (int sibcall) b = GEN_INT (offset); addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, b); - mem = gen_rtx_MEM (V2SImode, addr); + mem = gen_frame_mem (V2SImode, addr); } - set_mem_alias_set (mem, rs6000_sr_alias_set); - - emit_move_insn (gen_rtx_REG (reg_mode, + emit_move_insn (gen_rtx_REG (reg_mode, info->first_gp_reg_save + i), mem); } /* Restore fpr's if we need to do it without calling a function. */ if (restoring_FPRs_inline) for (i = 0; i < 64 - info->first_fp_reg_save; i++) - if ((regs_ever_live[info->first_fp_reg_save+i] + if ((regs_ever_live[info->first_fp_reg_save+i] && ! call_used_regs[info->first_fp_reg_save+i])) { rtx addr, mem; addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, - GEN_INT (info->fp_save_offset - + sp_offset + GEN_INT (info->fp_save_offset + + sp_offset + 8 * i)); - mem = gen_rtx_MEM (DFmode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (DFmode, addr); - emit_move_insn (gen_rtx_REG (DFmode, + emit_move_insn (gen_rtx_REG (DFmode, info->first_fp_reg_save + i), mem); } @@ -12737,21 +15210,20 @@ rs6000_emit_epilogue (int sibcall) { rtx r12_rtx = gen_rtx_REG (SImode, 12); int count = 0; - + if (using_mfcr_multiple) { for (i = 0; i < 8; i++) if (regs_ever_live[CR0_REGNO+i] && ! call_used_regs[CR0_REGNO+i]) count++; - if (count == 0) - abort (); + gcc_assert (count); } if (using_mfcr_multiple && count > 1) { rtvec p; int ndx; - + p = rtvec_alloc (count); ndx = 0; @@ -12762,49 +15234,38 @@ rs6000_emit_epilogue (int sibcall) RTVEC_ELT (r, 0) = r12_rtx; RTVEC_ELT (r, 1) = GEN_INT (1 << (7-i)); RTVEC_ELT (p, ndx) = - gen_rtx_SET (VOIDmode, gen_rtx_REG (CCmode, CR0_REGNO+i), + gen_rtx_SET (VOIDmode, gen_rtx_REG (CCmode, CR0_REGNO+i), gen_rtx_UNSPEC (CCmode, r, UNSPEC_MOVESI_TO_CR)); ndx++; } emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); - if (ndx != count) - abort (); + gcc_assert (ndx == count); } else for (i = 0; i < 8; i++) if (regs_ever_live[CR0_REGNO+i] && ! call_used_regs[CR0_REGNO+i]) { - emit_insn (gen_movsi_to_cr_one (gen_rtx_REG (CCmode, + emit_insn (gen_movsi_to_cr_one (gen_rtx_REG (CCmode, CR0_REGNO+i), r12_rtx)); } } /* If this is V.4, unwind the stack pointer after all of the loads - have been done. We need to emit a block here so that sched - doesn't decide to move the sp change before the register restores - (which may not have any obvious dependency on the stack). This - doesn't hurt performance, because there is no scheduling that can - be done after this point. */ - if (DEFAULT_ABI == ABI_V4 - || current_function_calls_eh_return) + have been done. */ + if (frame_reg_rtx != sp_reg_rtx) { - if (frame_reg_rtx != sp_reg_rtx) - rs6000_emit_stack_tie (); - - if (use_backchain_to_restore_sp) - { - emit_move_insn (sp_reg_rtx, frame_reg_rtx); - } - else if (sp_offset != 0) - { - emit_insn (TARGET_32BIT - ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx, - GEN_INT (sp_offset)) - : gen_adddi3 (sp_reg_rtx, sp_reg_rtx, - GEN_INT (sp_offset))); - } + /* This blockage is needed so that sched doesn't decide to move + the sp change before the register restores. */ + rs6000_emit_stack_tie (); + emit_move_insn (sp_reg_rtx, frame_reg_rtx); } + else if (sp_offset != 0) + emit_insn (TARGET_32BIT + ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx, + GEN_INT (sp_offset)) + : gen_adddi3 (sp_reg_rtx, sp_reg_rtx, + GEN_INT (sp_offset))); if (current_function_calls_eh_return) { @@ -12823,8 +15284,8 @@ rs6000_emit_epilogue (int sibcall) p = rtvec_alloc (2); RTVEC_ELT (p, 0) = gen_rtx_RETURN (VOIDmode); - RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, - gen_rtx_REG (Pmode, + RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, + gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)); /* If we have to restore more than two FP registers, branch to the @@ -12835,7 +15296,7 @@ rs6000_emit_epilogue (int sibcall) char rname[30]; const char *alloc_rname; - sprintf (rname, "%s%d%s", RESTORE_FP_PREFIX, + sprintf (rname, "%s%d%s", RESTORE_FP_PREFIX, info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX); alloc_rname = ggc_strdup (rname); RTVEC_ELT (p, 2) = gen_rtx_USE (VOIDmode, @@ -12847,16 +15308,15 @@ rs6000_emit_epilogue (int sibcall) rtx addr, mem; addr = gen_rtx_PLUS (Pmode, sp_reg_rtx, GEN_INT (info->fp_save_offset + 8*i)); - mem = gen_rtx_MEM (DFmode, addr); - set_mem_alias_set (mem, rs6000_sr_alias_set); + mem = gen_frame_mem (DFmode, addr); - RTVEC_ELT (p, i+3) = + RTVEC_ELT (p, i+3) = gen_rtx_SET (VOIDmode, gen_rtx_REG (DFmode, info->first_fp_reg_save + i), mem); } } - + emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p)); } } @@ -12864,11 +15324,9 @@ rs6000_emit_epilogue (int sibcall) /* Write function epilogue. */ static void -rs6000_output_function_epilogue (FILE *file, +rs6000_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { - rs6000_stack_t *info = rs6000_stack_info (); - if (! HAVE_epilogue) { rtx insn = get_last_insn (); @@ -12901,7 +15359,7 @@ rs6000_output_function_epilogue (FILE *file, if (TARGET_DEBUG_STACK) debug_rtx_list (get_insns (), 100); - final (get_insns (), file, FALSE, FALSE); + final (get_insns (), file, FALSE); end_sequence (); } } @@ -12916,8 +15374,8 @@ rs6000_output_function_epilogue (FILE *file, && NOTE_P (insn) && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL) insn = PREV_INSN (insn); - if (insn - && (LABEL_P (insn) + if (insn + && (LABEL_P (insn) || (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))) fputs ("\tnop\n", file); @@ -12939,13 +15397,14 @@ rs6000_output_function_epilogue (FILE *file, System V.4 Powerpc's (and the embedded ABI derived from it) use a different traceback table. */ if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive - && rs6000_traceback != traceback_none) + && rs6000_traceback != traceback_none && !current_function_is_thunk) { const char *fname = NULL; const char *language_string = lang_hooks.name; int fixed_parms = 0, float_parms = 0, parm_info = 0; int i; int optional_tbtab; + rs6000_stack_t *info = rs6000_stack_info (); if (rs6000_traceback == traceback_full) optional_tbtab = 1; @@ -12986,23 +15445,26 @@ rs6000_output_function_epilogue (FILE *file, official way to discover the language being compiled, so we use language_string. C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9. - Java is 13. Objective-C is 14. */ + Java is 13. Objective-C is 14. Objective-C++ isn't assigned + a number, so for now use 9. */ if (! strcmp (language_string, "GNU C")) i = 0; - else if (! strcmp (language_string, "GNU F77")) + else if (! strcmp (language_string, "GNU F77") + || ! strcmp (language_string, "GNU F95")) i = 1; else if (! strcmp (language_string, "GNU Pascal")) i = 2; else if (! strcmp (language_string, "GNU Ada")) i = 3; - else if (! strcmp (language_string, "GNU C++")) + else if (! strcmp (language_string, "GNU C++") + || ! strcmp (language_string, "GNU Objective-C++")) i = 9; else if (! strcmp (language_string, "GNU Java")) i = 13; else if (! strcmp (language_string, "GNU Objective-C")) i = 14; else - abort (); + gcc_unreachable (); fprintf (file, "%d,", i); /* 8 single bit fields: global linkage (not set for C extern linkage, @@ -13049,18 +15511,26 @@ rs6000_output_function_epilogue (FILE *file, if (GET_CODE (parameter) == REG) { - if (GET_MODE_CLASS (mode) == MODE_FLOAT) + if (SCALAR_FLOAT_MODE_P (mode)) { int bits; float_parms++; - if (mode == SFmode) - bits = 0x2; - else if (mode == DFmode || mode == TFmode) - bits = 0x3; - else - abort (); + switch (mode) + { + case SFmode: + bits = 0x2; + break; + + case DFmode: + case TFmode: + bits = 0x3; + break; + + default: + gcc_unreachable (); + } /* If only one bit will fit, don't or in this entry. */ if (next_parm_info_bit > 0) @@ -13110,17 +15580,12 @@ rs6000_output_function_epilogue (FILE *file, /* Offset from start of code to tb table. */ fputs ("\t.long ", file); ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LT"); -#if TARGET_AIX - RS6000_OUTPUT_BASENAME (file, fname); -#else - assemble_name (file, fname); -#endif - fputs ("-.", file); -#if TARGET_AIX - RS6000_OUTPUT_BASENAME (file, fname); -#else - assemble_name (file, fname); -#endif + if (TARGET_AIX) + RS6000_OUTPUT_BASENAME (file, fname); + else + assemble_name (file, fname); + putc ('-', file); + rs6000_output_function_entry (file, fname); putc ('\n', file); /* Interrupt handler mask. */ @@ -13183,8 +15648,8 @@ rs6000_output_function_epilogue (FILE *file, not support varargs. */ static void -rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, - HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, +rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, tree function) { rtx this, insn, funexp; @@ -13192,6 +15657,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, reload_completed = 1; epilogue_completed = 1; no_new_pseudos = 1; + reset_block_changes (); /* Mark the end of the (empty) prologue. */ emit_note (NOTE_INSN_PROLOGUE_END); @@ -13252,7 +15718,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, #endif /* gen_sibcall expects reload to convert scratch pseudo to LR so we must - generate sibcall RTL explicitly to avoid constraint abort. */ + generate sibcall RTL explicitly. */ insn = emit_call_insn ( gen_rtx_PARALLEL (VOIDmode, gen_rtvec (4, @@ -13274,7 +15740,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, insn_locators_initialize (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; @@ -13285,7 +15751,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, /* A quick summary of the various types of 'constant-pool tables' under PowerPC: - Target Flags Name One table per + Target Flags Name One table per AIX (none) AIX TOC object file AIX -mfull-toc AIX TOC object file AIX -mminimal-toc AIX minimal TOC translation unit @@ -13294,7 +15760,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, SVR4/EABI -fPIC SVR4 PIC translation unit SVR4/EABI -mrelocatable EABI TOC function SVR4/EABI -maix AIX TOC object file - SVR4/EABI -maix -mminimal-toc + SVR4/EABI -maix -mminimal-toc AIX minimal TOC translation unit Name Reg. Set by entries contains: @@ -13319,7 +15785,7 @@ rs6000_hash_constant (rtx k) unsigned result = (code << 3) ^ mode; const char *format; int flen, fidx; - + format = GET_RTX_FORMAT (code); flen = strlen (format); fidx = 0; @@ -13370,7 +15836,7 @@ rs6000_hash_constant (rtx k) else { size_t i; - for (i = 0; i < sizeof(HOST_WIDE_INT)/sizeof(unsigned); i++) + for (i = 0; i < sizeof (HOST_WIDE_INT) / sizeof (unsigned); i++) result = result * 613 + (unsigned) (XWINT (k, fidx) >> CHAR_BIT * i); } @@ -13378,7 +15844,7 @@ rs6000_hash_constant (rtx k) case '0': break; default: - abort (); + gcc_unreachable (); } return result; @@ -13387,7 +15853,7 @@ rs6000_hash_constant (rtx k) static unsigned toc_hash_function (const void *hash_entry) { - const struct toc_hash_struct *thc = + const struct toc_hash_struct *thc = (const struct toc_hash_struct *) hash_entry; return rs6000_hash_constant (thc->key) ^ thc->key_mode; } @@ -13413,11 +15879,11 @@ toc_hash_eq (const void *h1, const void *h2) to whether or not an object is a vtable. */ #define VTABLE_NAME_P(NAME) \ - (strncmp ("_vt.", name, strlen("_vt.")) == 0 \ + (strncmp ("_vt.", name, strlen ("_vt.")) == 0 \ || strncmp ("_ZTV", name, strlen ("_ZTV")) == 0 \ || strncmp ("_ZTT", name, strlen ("_ZTT")) == 0 \ || strncmp ("_ZTI", name, strlen ("_ZTI")) == 0 \ - || strncmp ("_ZTC", name, strlen ("_ZTC")) == 0) + || strncmp ("_ZTC", name, strlen ("_ZTC")) == 0) void rs6000_output_symbol_ref (FILE *file, rtx x) @@ -13425,12 +15891,12 @@ rs6000_output_symbol_ref (FILE *file, rtx x) /* Currently C++ toc references to vtables can be emitted before it is decided whether the vtable is public or private. If this is the case, then the linker will eventually complain that there is - a reference to an unknown section. Thus, for vtables only, + a reference to an unknown section. Thus, for vtables only, we emit the TOC reference to reference the symbol and not the section. */ const char *name = XSTR (x, 0); - if (VTABLE_NAME_P (name)) + if (VTABLE_NAME_P (name)) { RS6000_OUTPUT_BASENAME (file, name); } @@ -13448,10 +15914,9 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) const char *name = buf; const char *real_name; rtx base = x; - int offset = 0; + HOST_WIDE_INT offset = 0; - if (TARGET_NO_TOC) - abort (); + gcc_assert (!TARGET_NO_TOC); /* When the linker won't eliminate them, don't output duplicate TOC entries (this happens on AIX if there is any kind of TOC, @@ -13461,29 +15926,29 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) { struct toc_hash_struct *h; void * * found; - + /* Create toc_hash_table. This can't be done at OVERRIDE_OPTIONS - time because GGC is not initialized at that point. */ + time because GGC is not initialized at that point. */ if (toc_hash_table == NULL) - toc_hash_table = htab_create_ggc (1021, toc_hash_function, + toc_hash_table = htab_create_ggc (1021, toc_hash_function, toc_hash_eq, NULL); h = ggc_alloc (sizeof (*h)); h->key = x; h->key_mode = mode; h->labelno = labelno; - + found = htab_find_slot (toc_hash_table, h, 1); if (*found == NULL) *found = h; - else /* This is indeed a duplicate. + else /* This is indeed a duplicate. Set this label equal to that label. */ { fputs ("\t.set ", file); ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC"); fprintf (file, "%d,", labelno); ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC"); - fprintf (file, "%d\n", ((*(const struct toc_hash_struct **) + fprintf (file, "%d\n", ((*(const struct toc_hash_struct **) found)->labelno)); return; } @@ -13503,13 +15968,17 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) /* Handle FP constants specially. Note that if we have a minimal TOC, things we put here aren't actually in the TOC, so we can allow FP constants. */ - if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == TFmode) + if (GET_CODE (x) == CONST_DOUBLE && + (GET_MODE (x) == TFmode || GET_MODE (x) == TDmode)) { REAL_VALUE_TYPE rv; long k[4]; REAL_VALUE_FROM_CONST_DOUBLE (rv, x); - REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k); + if (DECIMAL_FLOAT_MODE_P (GET_MODE (x))) + REAL_VALUE_TO_TARGET_DECIMAL128 (rv, k); + else + REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k); if (TARGET_64BIT) { @@ -13538,13 +16007,18 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) return; } } - else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == DFmode) + else if (GET_CODE (x) == CONST_DOUBLE && + (GET_MODE (x) == DFmode || GET_MODE (x) == DDmode)) { REAL_VALUE_TYPE rv; long k[2]; REAL_VALUE_FROM_CONST_DOUBLE (rv, x); - REAL_VALUE_TO_TARGET_DOUBLE (rv, k); + + if (DECIMAL_FLOAT_MODE_P (GET_MODE (x))) + REAL_VALUE_TO_TARGET_DECIMAL64 (rv, k); + else + REAL_VALUE_TO_TARGET_DOUBLE (rv, k); if (TARGET_64BIT) { @@ -13569,13 +16043,17 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) return; } } - else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode) + else if (GET_CODE (x) == CONST_DOUBLE && + (GET_MODE (x) == SFmode || GET_MODE (x) == SDmode)) { REAL_VALUE_TYPE rv; long l; REAL_VALUE_FROM_CONST_DOUBLE (rv, x); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); + if (DECIMAL_FLOAT_MODE_P (GET_MODE (x))) + REAL_VALUE_TO_TARGET_DECIMAL32 (rv, l); + else + REAL_VALUE_TO_TARGET_SINGLE (rv, l); if (TARGET_64BIT) { @@ -13615,8 +16093,8 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) } #else { - low = INTVAL (x) & 0xffffffff; - high = (HOST_WIDE_INT) INTVAL (x) >> 32; + low = INTVAL (x) & 0xffffffff; + high = (HOST_WIDE_INT) INTVAL (x) >> 32; } #endif @@ -13630,8 +16108,8 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) For a 32-bit target, CONST_INT values are loaded and shifted entirely within `low' and can be stored in one TOC entry. */ - if (TARGET_64BIT && POINTER_SIZE < GET_MODE_BITSIZE (mode)) - abort ();/* It would be easy to make this work, but it doesn't now. */ + /* It would be easy to make this work, but it doesn't now. */ + gcc_assert (!TARGET_64BIT || POINTER_SIZE >= GET_MODE_BITSIZE (mode)); if (POINTER_SIZE > GET_MODE_BITSIZE (mode)) { @@ -13683,21 +16161,30 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) if (GET_CODE (x) == CONST) { - if (GET_CODE (XEXP (x, 0)) != PLUS) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == PLUS); base = XEXP (XEXP (x, 0), 0); offset = INTVAL (XEXP (XEXP (x, 0), 1)); } - - if (GET_CODE (base) == SYMBOL_REF) - name = XSTR (base, 0); - else if (GET_CODE (base) == LABEL_REF) - ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (XEXP (base, 0))); - else if (GET_CODE (base) == CODE_LABEL) - ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (base)); - else - abort (); + + switch (GET_CODE (base)) + { + case SYMBOL_REF: + name = XSTR (base, 0); + break; + + case LABEL_REF: + ASM_GENERATE_INTERNAL_LABEL (buf, "L", + CODE_LABEL_NUMBER (XEXP (base, 0))); + break; + + case CODE_LABEL: + ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (base)); + break; + + default: + gcc_unreachable (); + } real_name = (*targetm.strip_name_encoding) (name); if (TARGET_MINIMAL_TOC) @@ -13707,9 +16194,9 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) fprintf (file, "\t.tc %s", real_name); if (offset < 0) - fprintf (file, ".N%d", - offset); + fprintf (file, ".N" HOST_WIDE_INT_PRINT_UNSIGNED, - offset); else if (offset) - fprintf (file, ".P%d", offset); + fprintf (file, ".P" HOST_WIDE_INT_PRINT_UNSIGNED, offset); fputs ("[TC],", file); } @@ -13724,9 +16211,9 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) { RS6000_OUTPUT_BASENAME (file, name); if (offset < 0) - fprintf (file, "%d", offset); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset); else if (offset > 0) - fprintf (file, "+%d", offset); + fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC, offset); } else output_addr_const (file, x); @@ -13813,8 +16300,8 @@ output_ascii (FILE *file, const char *p, int n) the name. */ void -rs6000_gen_section_name (char **buf, const char *filename, - const char *section_desc) +rs6000_gen_section_name (char **buf, const char *filename, + const char *section_desc) { const char *q, *after_last_slash, *last_period = 0; char *p; @@ -13838,14 +16325,14 @@ rs6000_gen_section_name (char **buf, const char *filename, for (q = after_last_slash; *q; q++) { if (q == last_period) - { + { strcpy (p, section_desc); p += strlen (section_desc); break; - } + } else if (ISALNUM (*q)) - *p++ = *q; + *p++ = *q; } if (last_period == 0) @@ -13859,6 +16346,10 @@ rs6000_gen_section_name (char **buf, const char *filename, void output_profile_hook (int labelno ATTRIBUTE_UNUSED) { + /* Non-standard profiling for kernels, which just saves LR then calls + _mcount without worrying about arg saves. The idea is to change + the function prologue as little as possible as it isn't easy to + account for arg save/restore code added just for _mcount. */ if (TARGET_PROFILE_KERNEL) return; @@ -13867,7 +16358,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) #ifndef NO_PROFILE_COUNTERS # define NO_PROFILE_COUNTERS 0 #endif - if (NO_PROFILE_COUNTERS) + if (NO_PROFILE_COUNTERS) emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0); else { @@ -13894,12 +16385,9 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) #if TARGET_MACHO /* For PIC code, set up a stub and collect the caller's address from r0, which is where the prologue puts it. */ - if (MACHOPIC_INDIRECT) - { - mcount_name = machopic_stub_name (mcount_name); - if (current_function_uses_pic_offset_table) - caller_addr_regno = 0; - } + if (MACHOPIC_INDIRECT + && current_function_uses_pic_offset_table) + caller_addr_regno = 0; #endif emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name), 0, VOIDmode, 1, @@ -13913,27 +16401,42 @@ void output_function_profiler (FILE *file, int labelno) { char buf[100]; - int save_lr = 8; switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); case ABI_V4: - save_lr = 4; if (!TARGET_32BIT) { - warning ("no profiling of 64-bit code for this ABI"); + warning (0, "no profiling of 64-bit code for this ABI"); return; } ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); fprintf (file, "\tmflr %s\n", reg_names[0]); - if (flag_pic == 1) + if (NO_PROFILE_COUNTERS) + { + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); + } + else if (TARGET_SECURE_PLT && flag_pic) + { + asm_fprintf (file, "\tbcl 20,31,1f\n1:\n\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); + asm_fprintf (file, "\tmflr %s\n", reg_names[12]); + asm_fprintf (file, "\t{cau|addis} %s,%s,", + reg_names[12], reg_names[12]); + assemble_name (file, buf); + asm_fprintf (file, "-1b@ha\n\t{cal|la} %s,", reg_names[0]); + assemble_name (file, buf); + asm_fprintf (file, "-1b@l(%s)\n", reg_names[12]); + } + else if (flag_pic == 1) { fputs ("\tbl _GLOBAL_OFFSET_TABLE_@local-4\n", file); - asm_fprintf (file, "\t{st|stw} %s,%d(%s)\n", - reg_names[0], save_lr, reg_names[1]); + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); asm_fprintf (file, "\tmflr %s\n", reg_names[12]); asm_fprintf (file, "\t{l|lwz} %s,", reg_names[0]); assemble_name (file, buf); @@ -13941,14 +16444,14 @@ output_function_profiler (FILE *file, int labelno) } else if (flag_pic > 1) { - asm_fprintf (file, "\t{st|stw} %s,%d(%s)\n", - reg_names[0], save_lr, reg_names[1]); + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); /* Now, we need to get the address of the label. */ - fputs ("\tbl 1f\n\t.long ", file); + fputs ("\tbcl 20,31,1f\n\t.long ", file); assemble_name (file, buf); fputs ("-.\n1:", file); asm_fprintf (file, "\tmflr %s\n", reg_names[11]); - asm_fprintf (file, "\t{l|lwz} %s,0(%s)\n", + asm_fprintf (file, "\t{l|lwz} %s,0(%s)\n", reg_names[0], reg_names[11]); asm_fprintf (file, "\t{cax|add} %s,%s,%s\n", reg_names[0], reg_names[0], reg_names[11]); @@ -13958,8 +16461,8 @@ output_function_profiler (FILE *file, int labelno) asm_fprintf (file, "\t{liu|lis} %s,", reg_names[12]); assemble_name (file, buf); fputs ("@ha\n", file); - asm_fprintf (file, "\t{st|stw} %s,%d(%s)\n", - reg_names[0], save_lr, reg_names[1]); + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); asm_fprintf (file, "\t{cal|la} %s,", reg_names[0]); assemble_name (file, buf); asm_fprintf (file, "@l(%s)\n", reg_names[12]); @@ -13968,7 +16471,6 @@ output_function_profiler (FILE *file, int labelno) /* ABI_V4 saves the static chain reg with ASM_OUTPUT_REG_PUSH. */ fprintf (file, "\tbl %s%s\n", RS6000_MCOUNT, flag_pic ? "@plt" : ""); - break; case ABI_AIX: @@ -13979,13 +16481,12 @@ output_function_profiler (FILE *file, int labelno) } else { - if (TARGET_32BIT) - abort (); + gcc_assert (!TARGET_32BIT); asm_fprintf (file, "\tmflr %s\n", reg_names[0]); asm_fprintf (file, "\tstd %s,16(%s)\n", reg_names[0], reg_names[1]); - if (current_function_needs_context) + if (cfun->static_chain_decl != NULL) { asm_fprintf (file, "\tstd %s,24(%s)\n", reg_names[STATIC_CHAIN_REGNUM], reg_names[1]); @@ -14001,12 +16502,6 @@ output_function_profiler (FILE *file, int labelno) } -static int -rs6000_use_dfa_pipeline_interface (void) -{ - return 1; -} - /* Power4 load update and store update instructions are cracked into a load or store and an integer insn which are executed in the same cycle. Branches have their own dispatch slot which does not count against the @@ -14014,8 +16509,8 @@ rs6000_use_dfa_pipeline_interface (void) instructions to issue in this cycle. */ static int -rs6000_variable_issue (FILE *stream ATTRIBUTE_UNUSED, - int verbose ATTRIBUTE_UNUSED, +rs6000_variable_issue (FILE *stream ATTRIBUTE_UNUSED, + int verbose ATTRIBUTE_UNUSED, rtx insn, int more) { if (GET_CODE (PATTERN (insn)) == USE @@ -14025,9 +16520,9 @@ rs6000_variable_issue (FILE *stream ATTRIBUTE_UNUSED, if (rs6000_sched_groups) { if (is_microcoded_insn (insn)) - return 0; + return 0; else if (is_cracked_insn (insn)) - return more > 2 ? more - 2 : 0; + return more > 2 ? more - 2 : 0; } return more - 1; @@ -14037,8 +16532,7 @@ rs6000_variable_issue (FILE *stream ATTRIBUTE_UNUSED, a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ static int -rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn ATTRIBUTE_UNUSED, - int cost) +rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { if (! recog_memoized (insn)) return 0; @@ -14050,6 +16544,17 @@ rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn ATTRIBUTE_UNUSED, { /* Data dependency; DEP_INSN writes a register that INSN reads some cycles later. */ + + /* Separate a load from a narrower, dependent store. */ + if (rs6000_sched_groups + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (PATTERN (dep_insn)) == SET + && GET_CODE (XEXP (PATTERN (insn), 1)) == MEM + && GET_CODE (XEXP (PATTERN (dep_insn), 0)) == MEM + && (GET_MODE_SIZE (GET_MODE (XEXP (PATTERN (insn), 1))) + > GET_MODE_SIZE (GET_MODE (XEXP (PATTERN (dep_insn), 0))))) + return cost + 14; + switch (get_attr_type (insn)) { case TYPE_JMPREG: @@ -14111,7 +16616,7 @@ is_microcoded_insn (rtx insn) || type == TYPE_LOAD_UX || type == TYPE_STORE_UX || type == TYPE_MFCR) - return true; + return true; } return false; @@ -14153,6 +16658,11 @@ is_dispatch_slot_restricted (rtx insn) case TYPE_IDIV: case TYPE_LDIV: return 2; + case TYPE_LOAD_L: + case TYPE_STORE_C: + case TYPE_ISYNC: + case TYPE_SYNC: + return 4; default: if (rs6000_cpu == PROCESSOR_POWER5 && is_cracked_insn (insn)) @@ -14176,14 +16686,14 @@ is_cracked_insn (rtx insn) { enum attr_type type = get_attr_type (insn); if (type == TYPE_LOAD_U || type == TYPE_STORE_U - || type == TYPE_FPLOAD_U || type == TYPE_FPSTORE_U - || type == TYPE_FPLOAD_UX || type == TYPE_FPSTORE_UX - || type == TYPE_LOAD_EXT || type == TYPE_DELAYED_CR - || type == TYPE_COMPARE || type == TYPE_DELAYED_COMPARE - || type == TYPE_IMUL_COMPARE || type == TYPE_LMUL_COMPARE - || type == TYPE_IDIV || type == TYPE_LDIV - || type == TYPE_INSERT_WORD) - return true; + || type == TYPE_FPLOAD_U || type == TYPE_FPSTORE_U + || type == TYPE_FPLOAD_UX || type == TYPE_FPSTORE_UX + || type == TYPE_LOAD_EXT || type == TYPE_DELAYED_CR + || type == TYPE_COMPARE || type == TYPE_DELAYED_COMPARE + || type == TYPE_IMUL_COMPARE || type == TYPE_LMUL_COMPARE + || type == TYPE_IDIV || type == TYPE_LDIV + || type == TYPE_INSERT_WORD) + return true; } return false; @@ -14204,7 +16714,7 @@ is_branch_slot_insn (rtx insn) { enum attr_type type = get_attr_type (insn); if (type == TYPE_BRANCH || type == TYPE_JMPREG) - return true; + return true; return false; } @@ -14252,22 +16762,23 @@ rs6000_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority) if (is_dispatch_slot_restricted (insn) && reload_completed - && current_sched_info->sched_max_insns_priority + && current_sched_info->sched_max_insns_priority && rs6000_sched_restricted_insns_priority) { - /* Prioritize insns that can be dispatched only in the first dispatch slot. */ + /* Prioritize insns that can be dispatched only in the first + dispatch slot. */ if (rs6000_sched_restricted_insns_priority == 1) - /* Attach highest priority to insn. This means that in - haifa-sched.c:ready_sort(), dispatch-slot restriction considerations + /* Attach highest priority to insn. This means that in + haifa-sched.c:ready_sort(), dispatch-slot restriction considerations precede 'priority' (critical path) considerations. */ - return current_sched_info->sched_max_insns_priority; + return current_sched_info->sched_max_insns_priority; else if (rs6000_sched_restricted_insns_priority == 2) - /* Increase priority of insn by a minimal amount. This means that in - haifa-sched.c:ready_sort(), only 'priority' (critical path) considerations - precede dispatch-slot restriction considerations. */ - return (priority + 1); - } + /* Increase priority of insn by a minimal amount. This means that in + haifa-sched.c:ready_sort(), only 'priority' (critical path) + considerations precede dispatch-slot restriction considerations. */ + return (priority + 1); + } return priority; } @@ -14292,7 +16803,7 @@ rs6000_issue_rate (void) case CPU_PPC750: case CPU_PPC7400: case CPU_PPC8540: - return 2; + return 2; case CPU_RIOS2: case CPU_PPC604: case CPU_PPC604E: @@ -14346,7 +16857,7 @@ is_mem_ref (rtx pat) } /* Determine if PAT is a PATTERN of a load insn. */ - + static bool is_load_insn1 (rtx pat) { @@ -14420,34 +16931,36 @@ is_store_insn (rtx insn) costly by the given target. */ static bool -rs6000_is_costly_dependence (rtx insn, rtx next, rtx link, int cost, int distance) -{ - /* If the flag is not enbled - no dependence is considered costly; - allow all dependent insns in the same group. +rs6000_is_costly_dependence (rtx insn, rtx next, rtx link, int cost, + int distance) +{ + /* If the flag is not enabled - no dependence is considered costly; + allow all dependent insns in the same group. This is the most aggressive option. */ if (rs6000_sched_costly_dep == no_dep_costly) return false; - /* If the flag is set to 1 - a dependence is always considered costly; + /* If the flag is set to 1 - a dependence is always considered costly; do not allow dependent instructions in the same group. This is the most conservative option. */ if (rs6000_sched_costly_dep == all_deps_costly) - return true; + return true; - if (rs6000_sched_costly_dep == store_to_load_dep_costly - && is_load_insn (next) + if (rs6000_sched_costly_dep == store_to_load_dep_costly + && is_load_insn (next) && is_store_insn (insn)) /* Prevent load after store in the same group. */ return true; if (rs6000_sched_costly_dep == true_store_to_load_dep_costly - && is_load_insn (next) + && is_load_insn (next) && is_store_insn (insn) && (!link || (int) REG_NOTE_KIND (link) == 0)) - /* Prevent load after store in the same group if it is a true dependence. */ + /* Prevent load after store in the same group if it is a true + dependence. */ return true; - - /* The flag is set to X; dependences with latency >= X are considered costly, + + /* The flag is set to X; dependences with latency >= X are considered costly, and will not be scheduled in the same group. */ if (rs6000_sched_costly_dep <= max_dep_latency && ((cost - distance) >= (int)rs6000_sched_costly_dep)) @@ -14456,33 +16969,31 @@ rs6000_is_costly_dependence (rtx insn, rtx next, rtx link, int cost, int distanc return false; } -/* Return the next insn after INSN that is found before TAIL is reached, +/* Return the next insn after INSN that is found before TAIL is reached, skipping any "non-active" insns - insns that will not actually occupy an issue slot. Return NULL_RTX if such an insn is not found. */ static rtx get_next_active_insn (rtx insn, rtx tail) { - rtx next_insn; - - if (!insn || insn == tail) + if (insn == NULL_RTX || insn == tail) return NULL_RTX; - next_insn = NEXT_INSN (insn); - - while (next_insn - && next_insn != tail - && (GET_CODE(next_insn) == NOTE - || GET_CODE (PATTERN (next_insn)) == USE - || GET_CODE (PATTERN (next_insn)) == CLOBBER)) + while (1) { - next_insn = NEXT_INSN (next_insn); + insn = NEXT_INSN (insn); + if (insn == NULL_RTX || insn == tail) + return NULL_RTX; + + if (CALL_P (insn) + || JUMP_P (insn) + || (NONJUMP_INSN_P (insn) + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER + && INSN_CODE (insn) != CODE_FOR_stack_tie)) + break; } - - if (!next_insn || next_insn == tail) - return NULL_RTX; - - return next_insn; + return insn; } /* Return whether the presence of INSN causes a dispatch group termination @@ -14514,13 +17025,13 @@ insn_terminates_group_p (rtx insn, enum group_termination which_group) if (which_group == current_group) { if (is_branch_slot_insn (insn)) - return true; + return true; return false; } else if (which_group == previous_group) { if (is_dispatch_slot_restricted (insn)) - return true; + return true; return false; } @@ -14542,23 +17053,23 @@ is_costly_group (rtx *group_insns, rtx next_insn) { rtx insn = group_insns[i]; if (!insn) - continue; + continue; for (link = INSN_DEPEND (insn); link != 0; link = XEXP (link, 1)) - { - rtx next = XEXP (link, 0); - if (next == next_insn) - { - cost = insn_cost (insn, link, next_insn); - if (rs6000_is_costly_dependence (insn, next_insn, link, cost, 0)) - return true; - } - } + { + rtx next = XEXP (link, 0); + if (next == next_insn) + { + cost = insn_cost (insn, link, next_insn); + if (rs6000_is_costly_dependence (insn, next_insn, link, cost, 0)) + return true; + } + } } return false; } -/* Utility of the function redefine_groups. +/* Utility of the function redefine_groups. Check if it is too costly to schedule NEXT_INSN together with GROUP_INSNS in the same dispatch group. If so, insert nops before NEXT_INSN, in order to keep it "far" (in a separate group) from GROUP_INSNS, following @@ -14566,14 +17077,15 @@ is_costly_group (rtx *group_insns, rtx next_insn) -minsert_sched_nops = X: (1) X == sched_finish_regroup_exact: insert exactly as many nops as needed in order to force NEXT_INSN into a separate group. - (2) X < sched_finish_regroup_exact: insert exactly X nops. - GROUP_END, CAN_ISSUE_MORE and GROUP_COUNT record the state after nop + (2) X < sched_finish_regroup_exact: insert exactly X nops. + GROUP_END, CAN_ISSUE_MORE and GROUP_COUNT record the state after nop insertion (has a group just ended, how many vacant issue slots remain in the last group, and how many dispatch groups were encountered so far). */ -static int -force_new_group (int sched_verbose, FILE *dump, rtx *group_insns, rtx next_insn, - bool *group_end, int can_issue_more, int *group_count) +static int +force_new_group (int sched_verbose, FILE *dump, rtx *group_insns, + rtx next_insn, bool *group_end, int can_issue_more, + int *group_count) { rtx nop; bool force; @@ -14593,95 +17105,96 @@ force_new_group (int sched_verbose, FILE *dump, rtx *group_insns, rtx next_insn, if (sched_verbose > 6) fprintf (dump,"force: group count = %d, can_issue_more = %d\n", - *group_count ,can_issue_more); + *group_count ,can_issue_more); if (rs6000_sched_insert_nops == sched_finish_regroup_exact) { if (*group_end) - can_issue_more = 0; + can_issue_more = 0; /* Since only a branch can be issued in the last issue_slot, it is sufficient to insert 'can_issue_more - 1' nops if next_insn is not a branch. If next_insn is a branch, we insert 'can_issue_more' nops; - in this case the last nop will start a new group and the branch will be - forced to the new group. */ + in this case the last nop will start a new group and the branch + will be forced to the new group. */ if (can_issue_more && !is_branch_slot_insn (next_insn)) - can_issue_more--; + can_issue_more--; while (can_issue_more > 0) - { - nop = gen_nop(); - emit_insn_before (nop, next_insn); - can_issue_more--; - } + { + nop = gen_nop (); + emit_insn_before (nop, next_insn); + can_issue_more--; + } *group_end = true; return 0; - } + } if (rs6000_sched_insert_nops < sched_finish_regroup_exact) { int n_nops = rs6000_sched_insert_nops; - /* Nops can't be issued from the branch slot, so the effective - issue_rate for nops is 'issue_rate - 1'. */ + /* Nops can't be issued from the branch slot, so the effective + issue_rate for nops is 'issue_rate - 1'. */ if (can_issue_more == 0) - can_issue_more = issue_rate; + can_issue_more = issue_rate; can_issue_more--; if (can_issue_more == 0) - { - can_issue_more = issue_rate - 1; - (*group_count)++; - end = true; - for (i = 0; i < issue_rate; i++) - { - group_insns[i] = 0; - } - } + { + can_issue_more = issue_rate - 1; + (*group_count)++; + end = true; + for (i = 0; i < issue_rate; i++) + { + group_insns[i] = 0; + } + } while (n_nops > 0) - { - nop = gen_nop (); - emit_insn_before (nop, next_insn); - if (can_issue_more == issue_rate - 1) /* new group begins */ - end = false; - can_issue_more--; - if (can_issue_more == 0) - { - can_issue_more = issue_rate - 1; - (*group_count)++; - end = true; - for (i = 0; i < issue_rate; i++) - { - group_insns[i] = 0; - } - } - n_nops--; - } + { + nop = gen_nop (); + emit_insn_before (nop, next_insn); + if (can_issue_more == issue_rate - 1) /* new group begins */ + end = false; + can_issue_more--; + if (can_issue_more == 0) + { + can_issue_more = issue_rate - 1; + (*group_count)++; + end = true; + for (i = 0; i < issue_rate; i++) + { + group_insns[i] = 0; + } + } + n_nops--; + } /* Scale back relative to 'issue_rate' (instead of 'issue_rate - 1'). */ - can_issue_more++; + can_issue_more++; - *group_end = /* Is next_insn going to start a new group? */ - (end + /* Is next_insn going to start a new group? */ + *group_end + = (end || (can_issue_more == 1 && !is_branch_slot_insn (next_insn)) || (can_issue_more <= 2 && is_cracked_insn (next_insn)) || (can_issue_more < issue_rate && - insn_terminates_group_p (next_insn, previous_group))); + insn_terminates_group_p (next_insn, previous_group))); if (*group_end && end) - (*group_count)--; + (*group_count)--; if (sched_verbose > 6) - fprintf (dump, "done force: group count = %d, can_issue_more = %d\n", - *group_count, can_issue_more); - return can_issue_more; - } + fprintf (dump, "done force: group count = %d, can_issue_more = %d\n", + *group_count, can_issue_more); + return can_issue_more; + } return can_issue_more; } /* This function tries to synch the dispatch groups that the compiler "sees" - with the dispatch groups that the processor dispatcher is expected to + with the dispatch groups that the processor dispatcher is expected to form in practice. It tries to achieve this synchronization by forcing the estimated processor grouping on the compiler (as opposed to the function 'pad_goups' which tries to force the scheduler's grouping on the processor). @@ -14696,7 +17209,7 @@ force_new_group (int sched_verbose, FILE *dump, rtx *group_insns, rtx next_insn, between the insns. The function estimates the group boundaries that the processor will form as - folllows: It keeps track of how many vacant issue slots are available after + follows: It keeps track of how many vacant issue slots are available after each insn. A subsequent insn will start a new group if one of the following 4 cases applies: - no more vacant issue slots remain in the current dispatch group. @@ -14705,7 +17218,7 @@ force_new_group (int sched_verbose, FILE *dump, rtx *group_insns, rtx next_insn, - only the last 2 or less issue slots, including the branch slot, are vacant, which means that a cracked insn (which occupies two issue slots) can't be issued in this group. - - less than 'issue_rate' slots are vacant, and the next insn always needs to + - less than 'issue_rate' slots are vacant, and the next insn always needs to start a new group. */ static int @@ -14722,7 +17235,7 @@ redefine_groups (FILE *dump, int sched_verbose, rtx prev_head_insn, rtx tail) /* Initialize. */ issue_rate = rs6000_issue_rate (); group_insns = alloca (issue_rate * sizeof (rtx)); - for (i = 0; i < issue_rate; i++) + for (i = 0; i < issue_rate; i++) { group_insns[i] = 0; } @@ -14736,43 +17249,45 @@ redefine_groups (FILE *dump, int sched_verbose, rtx prev_head_insn, rtx tail) slot = (issue_rate - can_issue_more); group_insns[slot] = insn; can_issue_more = - rs6000_variable_issue (dump, sched_verbose, insn, can_issue_more); + rs6000_variable_issue (dump, sched_verbose, insn, can_issue_more); if (insn_terminates_group_p (insn, current_group)) - can_issue_more = 0; + can_issue_more = 0; next_insn = get_next_active_insn (insn, tail); if (next_insn == NULL_RTX) - return group_count + 1; + return group_count + 1; - group_end = /* Is next_insn going to start a new group? */ - (can_issue_more == 0 - || (can_issue_more == 1 && !is_branch_slot_insn (next_insn)) - || (can_issue_more <= 2 && is_cracked_insn (next_insn)) - || (can_issue_more < issue_rate && - insn_terminates_group_p (next_insn, previous_group))); + /* Is next_insn going to start a new group? */ + group_end + = (can_issue_more == 0 + || (can_issue_more == 1 && !is_branch_slot_insn (next_insn)) + || (can_issue_more <= 2 && is_cracked_insn (next_insn)) + || (can_issue_more < issue_rate && + insn_terminates_group_p (next_insn, previous_group))); - can_issue_more = force_new_group (sched_verbose, dump, group_insns, - next_insn, &group_end, can_issue_more, &group_count); + can_issue_more = force_new_group (sched_verbose, dump, group_insns, + next_insn, &group_end, can_issue_more, + &group_count); if (group_end) - { - group_count++; - can_issue_more = 0; - for (i = 0; i < issue_rate; i++) - { - group_insns[i] = 0; - } - } + { + group_count++; + can_issue_more = 0; + for (i = 0; i < issue_rate; i++) + { + group_insns[i] = 0; + } + } if (GET_MODE (next_insn) == TImode && can_issue_more) - PUT_MODE(next_insn, VOIDmode); + PUT_MODE (next_insn, VOIDmode); else if (!can_issue_more && GET_MODE (next_insn) != TImode) - PUT_MODE (next_insn, TImode); + PUT_MODE (next_insn, TImode); insn = next_insn; if (can_issue_more == 0) - can_issue_more = issue_rate; - } /* while */ + can_issue_more = issue_rate; + } /* while */ return group_count; } @@ -14808,33 +17323,33 @@ pad_groups (FILE *dump, int sched_verbose, rtx prev_head_insn, rtx tail) group_end = (next_insn == NULL_RTX || GET_MODE (next_insn) == TImode); if (next_insn == NULL_RTX) - break; + break; if (group_end) - { - /* If the scheduler had marked group termination at this location - (between insn and next_indn), and neither insn nor next_insn will - force group termination, pad the group with nops to force group - termination. */ - if (can_issue_more - && (rs6000_sched_insert_nops == sched_finish_pad_groups) - && !insn_terminates_group_p (insn, current_group) - && !insn_terminates_group_p (next_insn, previous_group)) - { - if (!is_branch_slot_insn(next_insn)) - can_issue_more--; + { + /* If the scheduler had marked group termination at this location + (between insn and next_indn), and neither insn nor next_insn will + force group termination, pad the group with nops to force group + termination. */ + if (can_issue_more + && (rs6000_sched_insert_nops == sched_finish_pad_groups) + && !insn_terminates_group_p (insn, current_group) + && !insn_terminates_group_p (next_insn, previous_group)) + { + if (!is_branch_slot_insn (next_insn)) + can_issue_more--; - while (can_issue_more) - { - nop = gen_nop (); - emit_insn_before (nop, next_insn); - can_issue_more--; - } - } + while (can_issue_more) + { + nop = gen_nop (); + emit_insn_before (nop, next_insn); + can_issue_more--; + } + } - can_issue_more = issue_rate; - group_count++; - } + can_issue_more = issue_rate; + group_count++; + } insn = next_insn; next_insn = get_next_active_insn (insn, tail); @@ -14857,16 +17372,16 @@ rs6000_sched_finish (FILE *dump, int sched_verbose) if (reload_completed && rs6000_sched_groups) { if (rs6000_sched_insert_nops == sched_finish_none) - return; + return; if (rs6000_sched_insert_nops == sched_finish_pad_groups) - n_groups = pad_groups (dump, sched_verbose, - current_sched_info->prev_head, - current_sched_info->next_tail); + n_groups = pad_groups (dump, sched_verbose, + current_sched_info->prev_head, + current_sched_info->next_tail); else - n_groups = redefine_groups (dump, sched_verbose, - current_sched_info->prev_head, - current_sched_info->next_tail); + n_groups = redefine_groups (dump, sched_verbose, + current_sched_info->prev_head, + current_sched_info->next_tail); if (sched_verbose >= 6) { @@ -14887,7 +17402,7 @@ rs6000_trampoline_size (void) switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); case ABI_AIX: ret = (TARGET_32BIT) ? 12 : 24; @@ -14909,25 +17424,24 @@ rs6000_trampoline_size (void) void rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) { - enum machine_mode pmode = Pmode; int regsize = (TARGET_32BIT) ? 4 : 8; - rtx ctx_reg = force_reg (pmode, cxt); + rtx ctx_reg = force_reg (Pmode, cxt); switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); /* Macros to shorten the code expansions below. */ -#define MEM_DEREF(addr) gen_rtx_MEM (pmode, memory_address (pmode, addr)) +#define MEM_DEREF(addr) gen_rtx_MEM (Pmode, memory_address (Pmode, addr)) #define MEM_PLUS(addr,offset) \ - gen_rtx_MEM (pmode, memory_address (pmode, plus_constant (addr, offset))) + gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (addr, offset))) /* Under AIX, just build the 3 word function descriptor */ case ABI_AIX: { - rtx fn_reg = gen_reg_rtx (pmode); - rtx toc_reg = gen_reg_rtx (pmode); + rtx fn_reg = gen_reg_rtx (Pmode); + rtx toc_reg = gen_reg_rtx (Pmode); emit_move_insn (fn_reg, MEM_DEREF (fnaddr)); emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize)); emit_move_insn (MEM_DEREF (addr), fn_reg); @@ -14939,12 +17453,12 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) /* Under V.4/eabi/darwin, __trampoline_setup does the real work. */ case ABI_DARWIN: case ABI_V4: - emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"), + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"), FALSE, VOIDmode, 4, - addr, pmode, + addr, Pmode, GEN_INT (rs6000_trampoline_size ()), SImode, - fnaddr, pmode, - ctx_reg, pmode); + fnaddr, Pmode, + ctx_reg, Pmode); break; } @@ -14960,21 +17474,28 @@ const struct attribute_spec rs6000_attribute_table[] = { "altivec", 1, 1, false, true, false, rs6000_handle_altivec_attribute }, { "longcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute }, { "shortcall", 0, 0, false, true, true, rs6000_handle_longcall_attribute }, + { "ms_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute }, + { "gcc_struct", 0, 0, false, false, false, rs6000_handle_struct_attribute }, +#ifdef SUBTARGET_ATTRIBUTE_TABLE + SUBTARGET_ATTRIBUTE_TABLE, +#endif { NULL, 0, 0, false, false, false, NULL } }; /* Handle the "altivec" attribute. The attribute may have arguments as follows: - __attribute__((altivec(vector__))) - __attribute__((altivec(pixel__))) (always followed by 'unsigned short') - __attribute__((altivec(bool__))) (always followed by 'unsigned') + __attribute__((altivec(vector__))) + __attribute__((altivec(pixel__))) (always followed by 'unsigned short') + __attribute__((altivec(bool__))) (always followed by 'unsigned') and may appear more than once (e.g., 'vector bool char') in a given declaration. */ static tree -rs6000_handle_altivec_attribute (tree *node, tree name, tree args, +rs6000_handle_altivec_attribute (tree *node, + tree name ATTRIBUTE_UNUSED, + tree args, int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) { @@ -14983,7 +17504,7 @@ rs6000_handle_altivec_attribute (tree *node, tree name, tree args, int unsigned_p; char altivec_type = ((args && TREE_CODE (args) == TREE_LIST && TREE_VALUE (args) - && TREE_CODE (TREE_VALUE (args)) == IDENTIFIER_NODE) + && TREE_CODE (TREE_VALUE (args)) == IDENTIFIER_NODE) ? *IDENTIFIER_POINTER (TREE_VALUE (args)) : '?'); @@ -14995,47 +17516,66 @@ rs6000_handle_altivec_attribute (tree *node, tree name, tree args, mode = TYPE_MODE (type); - if (rs6000_warn_altivec_long - && (type == long_unsigned_type_node || type == long_integer_type_node)) - warning ("use of 'long' in AltiVec types is deprecated; use 'int'"); + /* Check for invalid AltiVec type qualifiers. */ + if (type == long_unsigned_type_node || type == long_integer_type_node) + { + if (TARGET_64BIT) + error ("use of % in AltiVec types is invalid for 64-bit code"); + else if (rs6000_warn_altivec_long) + warning (0, "use of % in AltiVec types is deprecated; use %"); + } + else if (type == long_long_unsigned_type_node + || type == long_long_integer_type_node) + error ("use of % in AltiVec types is invalid"); + else if (type == double_type_node) + error ("use of % in AltiVec types is invalid"); + else if (type == long_double_type_node) + error ("use of % in AltiVec types is invalid"); + else if (type == boolean_type_node) + error ("use of boolean types in AltiVec types is invalid"); + else if (TREE_CODE (type) == COMPLEX_TYPE) + error ("use of % in AltiVec types is invalid"); + else if (DECIMAL_FLOAT_MODE_P (mode)) + error ("use of decimal floating point types in AltiVec types is invalid"); switch (altivec_type) { case 'v': - unsigned_p = TREE_UNSIGNED (type); + unsigned_p = TYPE_UNSIGNED (type); switch (mode) { - case SImode: - result = (unsigned_p ? unsigned_V4SI_type_node : V4SI_type_node); - break; - case HImode: - result = (unsigned_p ? unsigned_V8HI_type_node : V8HI_type_node); - break; - case QImode: - result = (unsigned_p ? unsigned_V16QI_type_node : V16QI_type_node); - break; - case SFmode: result = V4SF_type_node; break; - /* If the user says 'vector int bool', we may be handed the 'bool' - attribute _before_ the 'vector' attribute, and so select the proper - type in the 'b' case below. */ - case V4SImode: case V8HImode: case V16QImode: result = type; - default: break; + case SImode: + result = (unsigned_p ? unsigned_V4SI_type_node : V4SI_type_node); + break; + case HImode: + result = (unsigned_p ? unsigned_V8HI_type_node : V8HI_type_node); + break; + case QImode: + result = (unsigned_p ? unsigned_V16QI_type_node : V16QI_type_node); + break; + case SFmode: result = V4SF_type_node; break; + /* If the user says 'vector int bool', we may be handed the 'bool' + attribute _before_ the 'vector' attribute, and so select the + proper type in the 'b' case below. */ + case V4SImode: case V8HImode: case V16QImode: case V4SFmode: + result = type; + default: break; } break; case 'b': switch (mode) { - case SImode: case V4SImode: result = bool_V4SI_type_node; break; - case HImode: case V8HImode: result = bool_V8HI_type_node; break; - case QImode: case V16QImode: result = bool_V16QI_type_node; - default: break; + case SImode: case V4SImode: result = bool_V4SI_type_node; break; + case HImode: case V8HImode: result = bool_V8HI_type_node; break; + case QImode: case V16QImode: result = bool_V16QI_type_node; + default: break; } break; case 'p': switch (mode) { - case V8HImode: result = pixel_V8HI_type_node; - default: break; + case V8HImode: result = pixel_V8HI_type_node; + default: break; } default: break; } @@ -15045,9 +17585,7 @@ rs6000_handle_altivec_attribute (tree *node, tree name, tree args, *no_add_attrs = true; /* No need to hang on to the attribute. */ - if (!result) - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); - else + if (result) *node = reconstruct_complex_type (*node, result); return NULL_TREE; @@ -15064,6 +17602,14 @@ rs6000_mangle_fundamental_type (tree type) if (type == pixel_type_node) return "u7__pixel"; if (type == bool_int_type_node) return "U6__booli"; + /* Mangle IBM extended float long double as `g' (__float128) on + powerpc*-linux where long-double-64 previously was the default. */ + if (TYPE_MAIN_VARIANT (type) == long_double_type_node + && TARGET_ELF + && TARGET_LONG_DOUBLE_128 + && !TARGET_IEEEQUAD) + return "g"; + /* For all other types, use normal C++ mangling. */ return NULL; } @@ -15072,16 +17618,16 @@ rs6000_mangle_fundamental_type (tree type) struct attribute_spec.handler. */ static tree -rs6000_handle_longcall_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, +rs6000_handle_longcall_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_TYPE && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("`%s' attribute only applies to functions", + warning (OPT_Wattributes, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -15100,12 +17646,16 @@ rs6000_set_default_type_attributes (tree type) TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("longcall"), NULL_TREE, TYPE_ATTRIBUTES (type)); + +#if TARGET_MACHO + darwin_set_default_type_attributes (type); +#endif } /* Return a reference suitable for calling a function with the longcall attribute. */ -struct rtx_def * +rtx rs6000_longcall_ref (rtx call_ref) { const char *call_name; @@ -15128,59 +17678,119 @@ rs6000_longcall_ref (rtx call_ref) return force_reg (Pmode, call_ref); } +#ifndef TARGET_USE_MS_BITFIELD_LAYOUT +#define TARGET_USE_MS_BITFIELD_LAYOUT 0 +#endif + +/* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in + struct attribute_spec.handler. */ +static tree +rs6000_handle_struct_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + tree *type = NULL; + if (DECL_P (*node)) + { + if (TREE_CODE (*node) == TYPE_DECL) + type = &TREE_TYPE (*node); + } + else + type = node; + + if (!(type && (TREE_CODE (*type) == RECORD_TYPE + || TREE_CODE (*type) == UNION_TYPE))) + { + warning (OPT_Wattributes, "%qs attribute ignored", IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + else if ((is_attribute_p ("ms_struct", name) + && lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (*type))) + || ((is_attribute_p ("gcc_struct", name) + && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))))) + { + warning (OPT_Wattributes, "%qs incompatible attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +static bool +rs6000_ms_bitfield_layout_p (tree record_type) +{ + return (TARGET_USE_MS_BITFIELD_LAYOUT && + !lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type))) + || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type)); +} + #ifdef USING_ELFOS_H -/* A C statement or statements to switch to the appropriate section - for output of RTX in mode MODE. You can assume that RTX is some - kind of constant in RTL. The argument MODE is redundant except in - the case of a `const_int' rtx. Select the section by calling - `text_section' or one of the alternatives for other sections. - - Do not define this macro if you put all constants in the read-only - data section. */ +/* A get_unnamed_section callback, used for switching to toc_section. */ static void -rs6000_elf_select_rtx_section (enum machine_mode mode, rtx x, +rs6000_elf_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED) +{ + if (DEFAULT_ABI == ABI_AIX + && TARGET_MINIMAL_TOC + && !TARGET_RELOCATABLE) + { + if (!toc_initialized) + { + toc_initialized = 1; + fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); + (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); + fprintf (asm_out_file, "\t.tc "); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); + fprintf (asm_out_file, "\n"); + + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); + fprintf (asm_out_file, " = .+32768\n"); + } + else + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + } + else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) + fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); + else + { + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + if (!toc_initialized) + { + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); + fprintf (asm_out_file, " = .+32768\n"); + toc_initialized = 1; + } + } +} + +/* Implement TARGET_ASM_INIT_SECTIONS. */ + +static void +rs6000_elf_asm_init_sections (void) +{ + toc_section + = get_unnamed_section (0, rs6000_elf_output_toc_section_asm_op, NULL); + + sdata2_section + = get_unnamed_section (SECTION_WRITE, output_section_asm_op, + SDATA2_SECTION_ASM_OP); +} + +/* Implement TARGET_SELECT_RTX_SECTION. */ + +static section * +rs6000_elf_select_rtx_section (enum machine_mode mode, rtx x, unsigned HOST_WIDE_INT align) { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode)) - toc_section (); + return toc_section; else - default_elf_select_rtx_section (mode, x, align); -} - -/* A C statement or statements to switch to the appropriate - section for output of DECL. DECL is either a `VAR_DECL' node - or a constant of some sort. RELOC indicates whether forming - the initial value of DECL requires link-time relocations. */ - -static void -rs6000_elf_select_section (tree decl, int reloc, - unsigned HOST_WIDE_INT align) -{ - /* Pretend that we're always building for a shared library when - ABI_AIX, because otherwise we end up with dynamic relocations - in read-only sections. This happens for function pointers, - references to vtables in typeinfo, and probably other cases. */ - default_elf_select_section_1 (decl, reloc, align, - flag_pic || DEFAULT_ABI == ABI_AIX); -} - -/* A C statement to build up a unique section name, expressed as a - STRING_CST node, and assign it to DECL_SECTION_NAME (decl). - RELOC indicates whether the initial value of EXP requires - link-time relocations. If you do not define this macro, GCC will use - the symbol name prefixed by `.' as the section name. Note - this - macro can now be called for uninitialized data items as well as - initialized data and functions. */ - -static void -rs6000_elf_unique_section (tree decl, int reloc) -{ - /* As above, pretend that we're always building for a shared library - when ABI_AIX, to avoid dynamic relocations in read-only sections. */ - default_unique_section_1 (decl, reloc, - flag_pic || DEFAULT_ABI == ABI_AIX); + return default_elf_select_rtx_section (mode, x, align); } /* For a SYMBOL_REF, set generic flags and then perform some @@ -15210,7 +17820,7 @@ rs6000_elf_encode_section_info (tree decl, rtx rtl, int first) } } -static bool +bool rs6000_elf_in_small_data_p (tree decl) { if (rs6000_sdata == SDATA_NONE) @@ -15224,10 +17834,6 @@ rs6000_elf_in_small_data_p (tree decl) if (TREE_CODE (decl) == FUNCTION_DECL) return false; - /* Thread-local vars can't go in the small data area. */ - if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) - return false; - if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl)) { const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); @@ -15255,7 +17861,14 @@ rs6000_elf_in_small_data_p (tree decl) } #endif /* USING_ELFOS_H */ + +/* Implement TARGET_USE_BLOCKS_FOR_CONSTANT_P. */ +static bool +rs6000_use_blocks_for_constant_p (enum machine_mode mode, rtx x) +{ + return !ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode); +} /* Return a REG that occurs in ADDR with coefficient 1. ADDR can be effectively incremented by incrementing REG. @@ -15264,7 +17877,7 @@ rs6000_elf_in_small_data_p (tree decl) register by this routine since our caller will try to increment the returned register via an "la" instruction. */ -struct rtx_def * +rtx find_addr_reg (rtx addr) { while (GET_CODE (addr) == PLUS) @@ -15280,11 +17893,10 @@ find_addr_reg (rtx addr) else if (CONSTANT_P (XEXP (addr, 1))) addr = XEXP (addr, 0); else - abort (); + gcc_unreachable (); } - if (GET_CODE (addr) == REG && REGNO (addr) != 0) - return addr; - abort (); + gcc_assert (GET_CODE (addr) == REG && REGNO (addr) != 0); + return addr; } void @@ -15295,42 +17907,17 @@ rs6000_fatal_bad_address (rtx op) #if TARGET_MACHO -#if 0 -/* Returns 1 if OP is either a symbol reference or a sum of a symbol - reference and a constant. */ - -int -symbolic_operand (rtx op) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF: - case LABEL_REF: - return 1; - case CONST: - op = XEXP (op, 0); - return (GET_CODE (op) == SYMBOL_REF || - (GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && GET_CODE (XEXP (op, 1)) == CONST_INT); - default: - return 0; - } -} -#endif - -#if TARGET_MACHO - static tree branch_island_list = 0; /* Remember to generate a branch island for far calls to the given function. */ -static void -add_compiler_branch_island (tree label_name, tree function_name, int line_number) +static void +add_compiler_branch_island (tree label_name, tree function_name, + int line_number) { tree branch_island = build_tree_list (function_name, label_name); - TREE_TYPE (branch_island) = build_int_2 (line_number, 0); + TREE_TYPE (branch_island) = build_int_cst (NULL_TREE, line_number); TREE_CHAIN (branch_island) = branch_island_list; branch_island_list = branch_island; } @@ -15359,8 +17946,7 @@ macho_branch_islands (void) const char *label = IDENTIFIER_POINTER (BRANCH_ISLAND_LABEL_NAME (branch_island)); const char *name = - darwin_strip_name_encoding ( - IDENTIFIER_POINTER (BRANCH_ISLAND_FUNCTION_NAME (branch_island))); + IDENTIFIER_POINTER (BRANCH_ISLAND_FUNCTION_NAME (branch_island)); char name_buf[512]; /* Cheap copy of the details from the Darwin ASM_OUTPUT_LABELREF(). */ if (name[0] == '*' || name[0] == '&') @@ -15374,8 +17960,7 @@ macho_branch_islands (void) strcat (tmp_buf, label); #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) - fprintf (asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n", - BRANCH_ISLAND_LINE_NUMBER(branch_island)); + dbxout_stabd (N_SLINE, BRANCH_ISLAND_LINE_NUMBER (branch_island)); #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */ if (flag_pic) { @@ -15384,21 +17969,21 @@ macho_branch_islands (void) strcat (tmp_buf, "_pic\n"); strcat (tmp_buf, label); strcat (tmp_buf, "_pic:\n\tmflr r11\n"); - + strcat (tmp_buf, "\taddis r11,r11,ha16("); strcat (tmp_buf, name_buf); strcat (tmp_buf, " - "); strcat (tmp_buf, label); strcat (tmp_buf, "_pic)\n"); - + strcat (tmp_buf, "\tmtlr r0\n"); - + strcat (tmp_buf, "\taddi r12,r11,lo16("); strcat (tmp_buf, name_buf); strcat (tmp_buf, " - "); strcat (tmp_buf, label); strcat (tmp_buf, "_pic)\n"); - + strcat (tmp_buf, "\tmtctr r12\n\tbctr\n"); } else @@ -15412,8 +17997,7 @@ macho_branch_islands (void) output_asm_insn (tmp_buf, 0); #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO) if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) - fprintf(asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n", - BRANCH_ISLAND_LINE_NUMBER (branch_island)); + dbxout_stabd (N_SLINE, BRANCH_ISLAND_LINE_NUMBER (branch_island)); #endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */ } @@ -15450,21 +18034,31 @@ get_prev_label (tree function_name) return 0; } +#ifndef DARWIN_LINKER_GENERATES_ISLANDS +#define DARWIN_LINKER_GENERATES_ISLANDS 0 +#endif + +/* KEXTs still need branch islands. */ +#define DARWIN_GENERATE_ISLANDS (!DARWIN_LINKER_GENERATES_ISLANDS \ + || flag_mkernel || flag_apple_kext) + /* INSN is either a function call or a millicode call. It may have an - unconditional jump in its delay slot. + unconditional jump in its delay slot. CALL_DEST is the routine we are calling. */ char * -output_call (rtx insn, rtx *operands, int dest_operand_number, int cookie_operand_number) +output_call (rtx insn, rtx *operands, int dest_operand_number, + int cookie_operand_number) { static char buf[256]; - if (GET_CODE (operands[dest_operand_number]) == SYMBOL_REF + if (DARWIN_GENERATE_ISLANDS + && GET_CODE (operands[dest_operand_number]) == SYMBOL_REF && (INTVAL (operands[cookie_operand_number]) & CALL_LONG)) { tree labelname; tree funname = get_identifier (XSTR (operands[dest_operand_number], 0)); - + if (no_previous_def (funname)) { int line_number = 0; @@ -15495,8 +18089,6 @@ output_call (rtx insn, rtx *operands, int dest_operand_number, int cookie_operan return buf; } -#endif /* TARGET_MACHO */ - /* Generate PIC and indirect symbol stubs. */ void @@ -15519,43 +18111,53 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) GEN_LAZY_PTR_NAME_FOR_SYMBOL (lazy_ptr_name, symb, length); if (flag_pic == 2) - machopic_picsymbol_stub1_section (); + switch_to_section (darwin_sections[machopic_picsymbol_stub1_section]); else - machopic_symbol_stub1_section (); - fprintf (file, "\t.align 2\n"); - - fprintf (file, "%s:\n", stub); - fprintf (file, "\t.indirect_symbol %s\n", symbol_name); + switch_to_section (darwin_sections[machopic_symbol_stub1_section]); if (flag_pic == 2) { + fprintf (file, "\t.align 5\n"); + + fprintf (file, "%s:\n", stub); + fprintf (file, "\t.indirect_symbol %s\n", symbol_name); + label++; - local_label_0 = alloca (sizeof("\"L0000000000$spb\"")); + local_label_0 = alloca (sizeof ("\"L00000000000$spb\"")); sprintf (local_label_0, "\"L%011d$spb\"", label); - + fprintf (file, "\tmflr r0\n"); fprintf (file, "\tbcl 20,31,%s\n", local_label_0); fprintf (file, "%s:\n\tmflr r11\n", local_label_0); fprintf (file, "\taddis r11,r11,ha16(%s-%s)\n", lazy_ptr_name, local_label_0); fprintf (file, "\tmtlr r0\n"); - fprintf (file, "\tlwzu r12,lo16(%s-%s)(r11)\n", + fprintf (file, "\t%s r12,lo16(%s-%s)(r11)\n", + (TARGET_64BIT ? "ldu" : "lwzu"), lazy_ptr_name, local_label_0); fprintf (file, "\tmtctr r12\n"); fprintf (file, "\tbctr\n"); } else - { - fprintf (file, "\tlis r11,ha16(%s)\n", lazy_ptr_name); - fprintf (file, "\tlwzu r12,lo16(%s)(r11)\n", lazy_ptr_name); - fprintf (file, "\tmtctr r12\n"); - fprintf (file, "\tbctr\n"); - } - - machopic_lazy_symbol_ptr_section (); + { + fprintf (file, "\t.align 4\n"); + + fprintf (file, "%s:\n", stub); + fprintf (file, "\t.indirect_symbol %s\n", symbol_name); + + fprintf (file, "\tlis r11,ha16(%s)\n", lazy_ptr_name); + fprintf (file, "\t%s r12,lo16(%s)(r11)\n", + (TARGET_64BIT ? "ldu" : "lwzu"), + lazy_ptr_name); + fprintf (file, "\tmtctr r12\n"); + fprintf (file, "\tbctr\n"); + } + + switch_to_section (darwin_sections[machopic_lazy_symbol_ptr_section]); fprintf (file, "%s:\n", lazy_ptr_name); fprintf (file, "\t.indirect_symbol %s\n", symbol_name); - fprintf (file, "\t.long dyld_stub_binding_helper\n"); + fprintf (file, "%sdyld_stub_binding_helper\n", + (TARGET_64BIT ? DOUBLE_INT_ASM_OP : "\t.long\t")); } /* Legitimize PIC addresses. If the address is already @@ -15563,10 +18165,10 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) position-independent addresses go into a reg. This is REG if non zero, otherwise we allocate register(s) as necessary. */ -#define SMALL_INT(X) ((unsigned) (INTVAL(X) + 0x8000) < 0x10000) +#define SMALL_INT(X) ((UINTVAL (X) + 0x8000) < 0x10000) rtx -rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, +rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) { rtx base, offset; @@ -15576,25 +18178,22 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, if (GET_CODE (orig) == CONST) { + rtx reg_temp; + if (GET_CODE (XEXP (orig, 0)) == PLUS && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) return orig; - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - /* Use a different reg for the intermediate value, as - it will be marked UNCHANGING. */ - rtx reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); - base = - rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0), - Pmode, reg_temp); - offset = - rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1), - Pmode, reg); - } - else - abort (); + /* Use a different reg for the intermediate value, as + it will be marked UNCHANGING. */ + reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode); + base = rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0), + Pmode, reg_temp); + offset = + rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1), + Pmode, reg); if (GET_CODE (offset) == CONST_INT) { @@ -15608,31 +18207,78 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, return machopic_legitimize_pic_address (mem, Pmode, reg); } } - return gen_rtx (PLUS, Pmode, base, offset); + return gen_rtx_PLUS (Pmode, base, offset); } /* Fall back on generic machopic code. */ return machopic_legitimize_pic_address (orig, mode, reg); } -/* This is just a placeholder to make linking work without having to - add this to the generic Darwin EXTRA_SECTIONS. If -mcall-aix is - ever needed for Darwin (not too likely!) this would have to get a - real definition. */ +/* Output a .machine directive for the Darwin assembler, and call + the generic start_file routine. */ -void -toc_section (void) +static void +rs6000_darwin_file_start (void) { + static const struct + { + const char *arg; + const char *name; + int if_set; + } mapping[] = { + { "ppc64", "ppc64", MASK_64BIT }, + { "970", "ppc970", MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64 }, + { "power4", "ppc970", 0 }, + { "G5", "ppc970", 0 }, + { "7450", "ppc7450", 0 }, + { "7400", "ppc7400", MASK_ALTIVEC }, + { "G4", "ppc7400", 0 }, + { "750", "ppc750", 0 }, + { "740", "ppc750", 0 }, + { "G3", "ppc750", 0 }, + { "604e", "ppc604e", 0 }, + { "604", "ppc604", 0 }, + { "603e", "ppc603", 0 }, + { "603", "ppc603", 0 }, + { "601", "ppc601", 0 }, + { NULL, "ppc", 0 } }; + const char *cpu_id = ""; + size_t i; + + rs6000_file_start (); + darwin_file_start (); + + /* Determine the argument to -mcpu=. Default to G3 if not specified. */ + for (i = 0; i < ARRAY_SIZE (rs6000_select); i++) + if (rs6000_select[i].set_arch_p && rs6000_select[i].string + && rs6000_select[i].string[0] != '\0') + cpu_id = rs6000_select[i].string; + + /* Look through the mapping array. Pick the first name that either + matches the argument, has a bit set in IF_SET that is also set + in the target flags, or has a NULL name. */ + + i = 0; + while (mapping[i].arg != NULL + && strcmp (mapping[i].arg, cpu_id) != 0 + && (mapping[i].if_set & target_flags) == 0) + i++; + + fprintf (asm_out_file, "\t.machine %s\n", mapping[i].name); } #endif /* TARGET_MACHO */ #if TARGET_ELF -static unsigned int -rs6000_elf_section_type_flags (tree decl, const char *name, int reloc) +static int +rs6000_elf_reloc_rw_mask (void) { - return default_section_type_flags_1 (decl, name, reloc, - flag_pic || DEFAULT_ABI == ABI_AIX); + if (flag_pic) + return 3; + else if (DEFAULT_ABI == ABI_AIX) + return 2; + else + return 0; } /* Record an element in the table of global constructors. SYMBOL is @@ -15651,14 +18297,14 @@ rs6000_elf_asm_out_constructor (rtx symbol, int priority) if (priority != DEFAULT_INIT_PRIORITY) { sprintf (buf, ".ctors.%.5u", - /* Invert the numbering so the linker puts us in the proper - order; constructors are run from right to left, and the - linker sorts in increasing order. */ - MAX_INIT_PRIORITY - priority); + /* Invert the numbering so the linker puts us in the proper + order; constructors are run from right to left, and the + linker sorts in increasing order. */ + MAX_INIT_PRIORITY - priority); section = buf; } - named_section_flags (section, SECTION_WRITE); + switch_to_section (get_section (section, SECTION_WRITE, NULL)); assemble_align (POINTER_SIZE); if (TARGET_RELOCATABLE) @@ -15680,14 +18326,14 @@ rs6000_elf_asm_out_destructor (rtx symbol, int priority) if (priority != DEFAULT_INIT_PRIORITY) { sprintf (buf, ".dtors.%.5u", - /* Invert the numbering so the linker puts us in the proper - order; constructors are run from right to left, and the - linker sorts in increasing order. */ - MAX_INIT_PRIORITY - priority); + /* Invert the numbering so the linker puts us in the proper + order; constructors are run from right to left, and the + linker sorts in increasing order. */ + MAX_INIT_PRIORITY - priority); section = buf; } - named_section_flags (section, SECTION_WRITE); + switch_to_section (get_section (section, SECTION_WRITE, NULL)); assemble_align (POINTER_SIZE); if (TARGET_RELOCATABLE) @@ -15708,26 +18354,32 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) fputs ("\t.section\t\".opd\",\"aw\"\n\t.align 3\n", file); ASM_OUTPUT_LABEL (file, name); fputs (DOUBLE_INT_ASM_OP, file); - putc ('.', file); - assemble_name (file, name); - fputs (",.TOC.@tocbase,0\n\t.previous\n\t.size\t", file); - assemble_name (file, name); - fputs (",24\n\t.type\t.", file); - assemble_name (file, name); - fputs (",@function\n", file); - if (TREE_PUBLIC (decl) && ! DECL_WEAK (decl)) + rs6000_output_function_entry (file, name); + fputs (",.TOC.@tocbase,0\n\t.previous\n", file); + if (DOT_SYMBOLS) { - fputs ("\t.globl\t.", file); + fputs ("\t.size\t", file); assemble_name (file, name); - putc ('\n', file); + fputs (",24\n\t.type\t.", file); + assemble_name (file, name); + fputs (",@function\n", file); + if (TREE_PUBLIC (decl) && ! DECL_WEAK (decl)) + { + fputs ("\t.globl\t.", file); + assemble_name (file, name); + putc ('\n', file); + } } + else + ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function"); ASM_DECLARE_RESULT (file, DECL_RESULT (decl)); - putc ('.', file); - ASM_OUTPUT_LABEL (file, name); + rs6000_output_function_entry (file, name); + fputs (":\n", file); return; } if (TARGET_RELOCATABLE + && !TARGET_SECURE_PLT && (get_pool_size () != 0 || current_function_profile) && uses_TOC ()) { @@ -15779,6 +18431,16 @@ rs6000_elf_end_indicate_exec_stack (void) #endif #if TARGET_XCOFF +static void +rs6000_xcoff_asm_output_anchor (rtx symbol) +{ + char buffer[100]; + + sprintf (buffer, "$ + " HOST_WIDE_INT_PRINT_DEC, + SYMBOL_REF_BLOCK_OFFSET (symbol)); + ASM_OUTPUT_DEF (asm_out_file, XSTR (symbol, 0), buffer); +} + static void rs6000_xcoff_asm_globalize_label (FILE *stream, const char *name) { @@ -15787,8 +18449,82 @@ rs6000_xcoff_asm_globalize_label (FILE *stream, const char *name) putc ('\n', stream); } +/* A get_unnamed_decl callback, used for read-only sections. PTR + points to the section string variable. */ + static void -rs6000_xcoff_asm_named_section (const char *name, unsigned int flags) +rs6000_xcoff_output_readonly_section_asm_op (const void *directive) +{ + fprintf (asm_out_file, "\t.csect %s[RO],3\n", + *(const char *const *) directive); +} + +/* Likewise for read-write sections. */ + +static void +rs6000_xcoff_output_readwrite_section_asm_op (const void *directive) +{ + fprintf (asm_out_file, "\t.csect %s[RW],3\n", + *(const char *const *) directive); +} + +/* A get_unnamed_section callback, used for switching to toc_section. */ + +static void +rs6000_xcoff_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED) +{ + if (TARGET_MINIMAL_TOC) + { + /* toc_section is always selected at least once from + rs6000_xcoff_file_start, so this is guaranteed to + always be defined once and only once in each file. */ + if (!toc_initialized) + { + fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); + fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); + toc_initialized = 1; + } + fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", + (TARGET_32BIT ? "" : ",3")); + } + else + fputs ("\t.toc\n", asm_out_file); +} + +/* Implement TARGET_ASM_INIT_SECTIONS. */ + +static void +rs6000_xcoff_asm_init_sections (void) +{ + read_only_data_section + = get_unnamed_section (0, rs6000_xcoff_output_readonly_section_asm_op, + &xcoff_read_only_section_name); + + private_data_section + = get_unnamed_section (SECTION_WRITE, + rs6000_xcoff_output_readwrite_section_asm_op, + &xcoff_private_data_section_name); + + read_only_private_data_section + = get_unnamed_section (0, rs6000_xcoff_output_readonly_section_asm_op, + &xcoff_private_data_section_name); + + toc_section + = get_unnamed_section (0, rs6000_xcoff_output_toc_section_asm_op, NULL); + + readonly_data_section = read_only_data_section; + exception_section = data_section; +} + +static int +rs6000_xcoff_reloc_rw_mask (void) +{ + return 3; +} + +static void +rs6000_xcoff_asm_named_section (const char *name, unsigned int flags, + tree decl ATTRIBUTE_UNUSED) { int smclass; static const char * const suffix[3] = { "PR", "RO", "RW" }; @@ -15805,23 +18541,23 @@ rs6000_xcoff_asm_named_section (const char *name, unsigned int flags) name, suffix[smclass], flags & SECTION_ENTSIZE); } -static void -rs6000_xcoff_select_section (tree decl, int reloc, - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) +static section * +rs6000_xcoff_select_section (tree decl, int reloc, + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { - if (decl_readonly_section_1 (decl, reloc, 1)) + if (decl_readonly_section (decl, reloc)) { if (TREE_PUBLIC (decl)) - read_only_data_section (); + return read_only_data_section; else - read_only_private_data_section (); + return read_only_private_data_section; } else { if (TREE_PUBLIC (decl)) - data_section (); + return data_section; else - private_data_section (); + return private_data_section; } } @@ -15850,14 +18586,14 @@ rs6000_xcoff_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) However, if this is being placed in the TOC it must be output as a toc entry. */ -static void -rs6000_xcoff_select_rtx_section (enum machine_mode mode, rtx x, - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) +static section * +rs6000_xcoff_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (x, mode)) - toc_section (); + return toc_section; else - read_only_private_data_section (); + return read_only_private_data_section; } /* Remove any trailing [DS] or the like from the symbol name. */ @@ -15881,7 +18617,7 @@ static unsigned int rs6000_xcoff_section_type_flags (tree decl, const char *name, int reloc) { unsigned int align; - unsigned int flags = default_section_type_flags_1 (decl, name, reloc, 1); + unsigned int flags = default_section_type_flags (decl, name, reloc); /* Align to at least UNIT size. */ if (flags & SECTION_CODE) @@ -15920,10 +18656,9 @@ rs6000_xcoff_file_start (void) fputs ("\t.file\t", asm_out_file); output_quoted_string (asm_out_file, main_input_filename); fputc ('\n', asm_out_file); - toc_section (); if (write_symbols != NO_DEBUG) - private_data_section (); - text_section (); + switch_to_section (private_data_section); + switch_to_section (text_section); if (profile_flag) fprintf (asm_out_file, "\t.extern %s\n", RS6000_MCOUNT); rs6000_file_start (); @@ -15935,256 +18670,390 @@ rs6000_xcoff_file_start (void) static void rs6000_xcoff_file_end (void) { - text_section (); + switch_to_section (text_section); fputs ("_section_.text:\n", asm_out_file); - data_section (); + switch_to_section (data_section); fputs (TARGET_32BIT ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", asm_out_file); } #endif /* TARGET_XCOFF */ -#if TARGET_MACHO -/* Cross-module name binding. Darwin does not support overriding - functions at dynamic-link time. */ - -static bool -rs6000_binds_local_p (tree decl) -{ - return default_binds_local_p_1 (decl, 0); -} -#endif - /* Compute a (partial) cost for rtx X. Return true if the complete cost has been computed, and false if subexpressions should be scanned. In either case, *TOTAL contains the cost result. */ static bool -rs6000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, - int *total) +rs6000_rtx_costs (rtx x, int code, int outer_code, int *total) { + enum machine_mode mode = GET_MODE (x); + switch (code) { - /* On the RS/6000, if it is valid in the insn, it is free. - So this always returns 0. */ + /* On the RS/6000, if it is valid in the insn, it is free. */ case CONST_INT: - case CONST: - case LABEL_REF: - case SYMBOL_REF: + if (((outer_code == SET + || outer_code == PLUS + || outer_code == MINUS) + && (satisfies_constraint_I (x) + || satisfies_constraint_L (x))) + || (outer_code == AND + && (satisfies_constraint_K (x) + || (mode == SImode + ? satisfies_constraint_L (x) + : satisfies_constraint_J (x)) + || mask_operand (x, mode) + || (mode == DImode + && mask64_operand (x, DImode)))) + || ((outer_code == IOR || outer_code == XOR) + && (satisfies_constraint_K (x) + || (mode == SImode + ? satisfies_constraint_L (x) + : satisfies_constraint_J (x)))) + || outer_code == ASHIFT + || outer_code == ASHIFTRT + || outer_code == LSHIFTRT + || outer_code == ROTATE + || outer_code == ROTATERT + || outer_code == ZERO_EXTRACT + || (outer_code == MULT + && satisfies_constraint_I (x)) + || ((outer_code == DIV || outer_code == UDIV + || outer_code == MOD || outer_code == UMOD) + && exact_log2 (INTVAL (x)) >= 0) + || (outer_code == COMPARE + && (satisfies_constraint_I (x) + || satisfies_constraint_K (x))) + || (outer_code == EQ + && (satisfies_constraint_I (x) + || satisfies_constraint_K (x) + || (mode == SImode + ? satisfies_constraint_L (x) + : satisfies_constraint_J (x)))) + || (outer_code == GTU + && satisfies_constraint_I (x)) + || (outer_code == LTU + && satisfies_constraint_P (x))) + { + *total = 0; + return true; + } + else if ((outer_code == PLUS + && reg_or_add_cint_operand (x, VOIDmode)) + || (outer_code == MINUS + && reg_or_sub_cint_operand (x, VOIDmode)) + || ((outer_code == SET + || outer_code == IOR + || outer_code == XOR) + && (INTVAL (x) + & ~ (unsigned HOST_WIDE_INT) 0xffffffff) == 0)) + { + *total = COSTS_N_INSNS (1); + return true; + } + /* FALLTHRU */ + case CONST_DOUBLE: + if (mode == DImode && code == CONST_DOUBLE) + { + if ((outer_code == IOR || outer_code == XOR) + && CONST_DOUBLE_HIGH (x) == 0 + && (CONST_DOUBLE_LOW (x) + & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0) + { + *total = 0; + return true; + } + else if ((outer_code == AND && and64_2_operand (x, DImode)) + || ((outer_code == SET + || outer_code == IOR + || outer_code == XOR) + && CONST_DOUBLE_HIGH (x) == 0)) + { + *total = COSTS_N_INSNS (1); + return true; + } + } + /* FALLTHRU */ + + case CONST: case HIGH: + case SYMBOL_REF: + case MEM: + /* When optimizing for size, MEM should be slightly more expensive + than generating address, e.g., (plus (reg) (const)). + L1 cache latency is about two instructions. */ + *total = optimize_size ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2); + return true; + + case LABEL_REF: *total = 0; return true; case PLUS: - *total = ((GET_CODE (XEXP (x, 1)) == CONST_INT - && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) - + 0x8000) >= 0x10000) - && ((INTVAL (XEXP (x, 1)) & 0xffff) != 0)) - ? COSTS_N_INSNS (2) - : COSTS_N_INSNS (1)); - return true; + if (mode == DFmode) + { + if (GET_CODE (XEXP (x, 0)) == MULT) + { + /* FNMA accounted in outer NEG. */ + if (outer_code == NEG) + *total = rs6000_cost->dmul - rs6000_cost->fp; + else + *total = rs6000_cost->dmul; + } + else + *total = rs6000_cost->fp; + } + else if (mode == SFmode) + { + /* FNMA accounted in outer NEG. */ + if (outer_code == NEG && GET_CODE (XEXP (x, 0)) == MULT) + *total = 0; + else + *total = rs6000_cost->fp; + } + else + *total = COSTS_N_INSNS (1); + return false; - case AND: - case IOR: - case XOR: - *total = ((GET_CODE (XEXP (x, 1)) == CONST_INT - && (INTVAL (XEXP (x, 1)) & (~ (HOST_WIDE_INT) 0xffff)) != 0 - && ((INTVAL (XEXP (x, 1)) & 0xffff) != 0)) - ? COSTS_N_INSNS (2) - : COSTS_N_INSNS (1)); - return true; + case MINUS: + if (mode == DFmode) + { + if (GET_CODE (XEXP (x, 0)) == MULT) + { + /* FNMA accounted in outer NEG. */ + if (outer_code == NEG) + *total = 0; + else + *total = rs6000_cost->dmul; + } + else + *total = rs6000_cost->fp; + } + else if (mode == SFmode) + { + /* FNMA accounted in outer NEG. */ + if (outer_code == NEG && GET_CODE (XEXP (x, 0)) == MULT) + *total = 0; + else + *total = rs6000_cost->fp; + } + else + *total = COSTS_N_INSNS (1); + return false; case MULT: - if (optimize_size) + if (GET_CODE (XEXP (x, 1)) == CONST_INT + && satisfies_constraint_I (XEXP (x, 1))) { - *total = COSTS_N_INSNS (2); - return true; - } - switch (rs6000_cpu) - { - case PROCESSOR_RIOS1: - case PROCESSOR_PPC405: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? COSTS_N_INSNS (5) - : (INTVAL (XEXP (x, 1)) >= -256 - && INTVAL (XEXP (x, 1)) <= 255) - ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); - return true; - - case PROCESSOR_PPC440: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? COSTS_N_INSNS (3) - : COSTS_N_INSNS (2)); - return true; - - case PROCESSOR_RS64A: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (20) : COSTS_N_INSNS (34) - : (INTVAL (XEXP (x, 1)) >= -256 - && INTVAL (XEXP (x, 1)) <= 255) - ? COSTS_N_INSNS (8) : COSTS_N_INSNS (12)); - return true; - - case PROCESSOR_RIOS2: - case PROCESSOR_MPCCORE: - case PROCESSOR_PPC604e: - *total = COSTS_N_INSNS (2); - return true; - - case PROCESSOR_PPC601: - *total = COSTS_N_INSNS (5); - return true; - - case PROCESSOR_PPC603: - case PROCESSOR_PPC7400: - case PROCESSOR_PPC750: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? COSTS_N_INSNS (5) - : (INTVAL (XEXP (x, 1)) >= -256 - && INTVAL (XEXP (x, 1)) <= 255) - ? COSTS_N_INSNS (2) : COSTS_N_INSNS (3)); - return true; - - case PROCESSOR_PPC7450: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? COSTS_N_INSNS (4) - : COSTS_N_INSNS (3)); - return true; - - case PROCESSOR_PPC403: - case PROCESSOR_PPC604: - case PROCESSOR_PPC8540: - *total = COSTS_N_INSNS (4); - return true; - - case PROCESSOR_PPC620: - case PROCESSOR_PPC630: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (5) : COSTS_N_INSNS (7) - : (INTVAL (XEXP (x, 1)) >= -256 - && INTVAL (XEXP (x, 1)) <= 255) - ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); - return true; - - case PROCESSOR_POWER4: - case PROCESSOR_POWER5: - *total = (GET_CODE (XEXP (x, 1)) != CONST_INT - ? GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4) - : COSTS_N_INSNS (2)); - return true; - - default: - abort (); + if (INTVAL (XEXP (x, 1)) >= -256 + && INTVAL (XEXP (x, 1)) <= 255) + *total = rs6000_cost->mulsi_const9; + else + *total = rs6000_cost->mulsi_const; } + /* FMA accounted in outer PLUS/MINUS. */ + else if ((mode == DFmode || mode == SFmode) + && (outer_code == PLUS || outer_code == MINUS)) + *total = 0; + else if (mode == DFmode) + *total = rs6000_cost->dmul; + else if (mode == SFmode) + *total = rs6000_cost->fp; + else if (mode == DImode) + *total = rs6000_cost->muldi; + else + *total = rs6000_cost->mulsi; + return false; case DIV: case MOD: - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) + if (FLOAT_MODE_P (mode)) { - *total = COSTS_N_INSNS (2); - return true; + *total = mode == DFmode ? rs6000_cost->ddiv + : rs6000_cost->sdiv; + return false; } /* FALLTHRU */ case UDIV: case UMOD: - switch (rs6000_cpu) + if (GET_CODE (XEXP (x, 1)) == CONST_INT + && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) { - case PROCESSOR_RIOS1: - *total = COSTS_N_INSNS (19); - return true; - - case PROCESSOR_RIOS2: - *total = COSTS_N_INSNS (13); - return true; - - case PROCESSOR_RS64A: - *total = (GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (65) - : COSTS_N_INSNS (67)); - return true; - - case PROCESSOR_MPCCORE: - *total = COSTS_N_INSNS (6); - return true; - - case PROCESSOR_PPC403: - *total = COSTS_N_INSNS (33); - return true; - - case PROCESSOR_PPC405: - *total = COSTS_N_INSNS (35); - return true; - - case PROCESSOR_PPC440: - *total = COSTS_N_INSNS (34); - return true; - - case PROCESSOR_PPC601: - *total = COSTS_N_INSNS (36); - return true; - - case PROCESSOR_PPC603: - *total = COSTS_N_INSNS (37); - return true; - - case PROCESSOR_PPC604: - case PROCESSOR_PPC604e: - *total = COSTS_N_INSNS (20); - return true; - - case PROCESSOR_PPC620: - case PROCESSOR_PPC630: - *total = (GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (21) - : COSTS_N_INSNS (37)); - return true; - - case PROCESSOR_PPC750: - case PROCESSOR_PPC8540: - case PROCESSOR_PPC7400: - *total = COSTS_N_INSNS (19); - return true; - - case PROCESSOR_PPC7450: - *total = COSTS_N_INSNS (23); - return true; - - case PROCESSOR_POWER4: - case PROCESSOR_POWER5: - *total = (GET_MODE (XEXP (x, 1)) != DImode - ? COSTS_N_INSNS (18) - : COSTS_N_INSNS (34)); - return true; - - default: - abort (); + if (code == DIV || code == MOD) + /* Shift, addze */ + *total = COSTS_N_INSNS (2); + else + /* Shift */ + *total = COSTS_N_INSNS (1); } + else + { + if (GET_MODE (XEXP (x, 1)) == DImode) + *total = rs6000_cost->divdi; + else + *total = rs6000_cost->divsi; + } + /* Add in shift and subtract for MOD. */ + if (code == MOD || code == UMOD) + *total += COSTS_N_INSNS (2); + return false; case FFS: *total = COSTS_N_INSNS (4); - return true; + return false; - case MEM: - /* MEM should be slightly more expensive than (plus (reg) (const)). */ - *total = 5; - return true; + case NOT: + if (outer_code == AND || outer_code == IOR || outer_code == XOR) + { + *total = 0; + return false; + } + /* FALLTHRU */ + + case AND: + case IOR: + case XOR: + case ZERO_EXTRACT: + *total = COSTS_N_INSNS (1); + return false; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + case ROTATE: + case ROTATERT: + /* Handle mul_highpart. */ + if (outer_code == TRUNCATE + && GET_CODE (XEXP (x, 0)) == MULT) + { + if (mode == DImode) + *total = rs6000_cost->muldi; + else + *total = rs6000_cost->mulsi; + return true; + } + else if (outer_code == AND) + *total = 0; + else + *total = COSTS_N_INSNS (1); + return false; + + case SIGN_EXTEND: + case ZERO_EXTEND: + if (GET_CODE (XEXP (x, 0)) == MEM) + *total = 0; + else + *total = COSTS_N_INSNS (1); + return false; + + case COMPARE: + case NEG: + case ABS: + if (!FLOAT_MODE_P (mode)) + { + *total = COSTS_N_INSNS (1); + return false; + } + /* FALLTHRU */ + + case FLOAT: + case UNSIGNED_FLOAT: + case FIX: + case UNSIGNED_FIX: + case FLOAT_TRUNCATE: + *total = rs6000_cost->fp; + return false; + + case FLOAT_EXTEND: + if (mode == DFmode) + *total = 0; + else + *total = rs6000_cost->fp; + return false; + + case UNSPEC: + switch (XINT (x, 1)) + { + case UNSPEC_FRSP: + *total = rs6000_cost->fp; + return true; + + default: + break; + } + break; + + case CALL: + case IF_THEN_ELSE: + if (optimize_size) + { + *total = COSTS_N_INSNS (1); + return true; + } + else if (FLOAT_MODE_P (mode) + && TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS) + { + *total = rs6000_cost->fp; + return false; + } + break; + + case EQ: + case GTU: + case LTU: + /* Carry bit requires mode == Pmode. + NEG or PLUS already counted so only add one. */ + if (mode == Pmode + && (outer_code == NEG || outer_code == PLUS)) + { + *total = COSTS_N_INSNS (1); + return true; + } + if (outer_code == SET) + { + if (XEXP (x, 1) == const0_rtx) + { + *total = COSTS_N_INSNS (2); + return true; + } + else if (mode == Pmode) + { + *total = COSTS_N_INSNS (3); + return false; + } + } + /* FALLTHRU */ + + case GT: + case LT: + case UNORDERED: + if (outer_code == SET && (XEXP (x, 1) == const0_rtx)) + { + *total = COSTS_N_INSNS (2); + return true; + } + /* CC COMPARE. */ + if (outer_code == COMPARE) + { + *total = 0; + return true; + } + break; default: - return false; + break; } + + return false; } /* A C expression returning the cost of moving data from a register of class CLASS1 to one of CLASS2. */ int -rs6000_register_move_cost (enum machine_mode mode, +rs6000_register_move_cost (enum machine_mode mode, enum reg_class from, enum reg_class to) { /* Moves from/to GENERAL_REGS. */ @@ -16198,22 +19067,23 @@ rs6000_register_move_cost (enum machine_mode mode, return (rs6000_memory_move_cost (mode, from, 0) + rs6000_memory_move_cost (mode, GENERAL_REGS, 0)); -/* It's more expensive to move CR_REGS than CR0_REGS because of the shift.... */ + /* It's more expensive to move CR_REGS than CR0_REGS because of the + shift. */ else if (from == CR_REGS) return 4; else -/* A move will cost one instruction per GPR moved. */ - return 2 * HARD_REGNO_NREGS (0, mode); + /* A move will cost one instruction per GPR moved. */ + return 2 * hard_regno_nregs[0][mode]; } -/* Moving between two similar registers is just one instruction. */ + /* Moving between two similar registers is just one instruction. */ else if (reg_classes_intersect_p (to, from)) return mode == TFmode ? 4 : 2; -/* Everything else has to go through GENERAL_REGS. */ + /* Everything else has to go through GENERAL_REGS. */ else - return (rs6000_register_move_cost (mode, GENERAL_REGS, to) + return (rs6000_register_move_cost (mode, GENERAL_REGS, to) + rs6000_register_move_cost (mode, from, GENERAL_REGS)); } @@ -16221,19 +19091,122 @@ rs6000_register_move_cost (enum machine_mode mode, or from memory. */ int -rs6000_memory_move_cost (enum machine_mode mode, enum reg_class class, +rs6000_memory_move_cost (enum machine_mode mode, enum reg_class class, int in ATTRIBUTE_UNUSED) { if (reg_classes_intersect_p (class, GENERAL_REGS)) - return 4 * HARD_REGNO_NREGS (0, mode); + return 4 * hard_regno_nregs[0][mode]; else if (reg_classes_intersect_p (class, FLOAT_REGS)) - return 4 * HARD_REGNO_NREGS (32, mode); + return 4 * hard_regno_nregs[32][mode]; else if (reg_classes_intersect_p (class, ALTIVEC_REGS)) - return 4 * HARD_REGNO_NREGS (FIRST_ALTIVEC_REGNO, mode); + return 4 * hard_regno_nregs[FIRST_ALTIVEC_REGNO][mode]; else return 4 + rs6000_register_move_cost (mode, class, GENERAL_REGS); } +/* Newton-Raphson approximation of single-precision floating point divide n/d. + Assumes no trapping math and finite arguments. */ + +void +rs6000_emit_swdivsf (rtx res, rtx n, rtx d) +{ + rtx x0, e0, e1, y1, u0, v0, one; + + x0 = gen_reg_rtx (SFmode); + e0 = gen_reg_rtx (SFmode); + e1 = gen_reg_rtx (SFmode); + y1 = gen_reg_rtx (SFmode); + u0 = gen_reg_rtx (SFmode); + v0 = gen_reg_rtx (SFmode); + one = force_reg (SFmode, CONST_DOUBLE_FROM_REAL_VALUE (dconst1, SFmode)); + + /* x0 = 1./d estimate */ + emit_insn (gen_rtx_SET (VOIDmode, x0, + gen_rtx_UNSPEC (SFmode, gen_rtvec (1, d), + UNSPEC_FRES))); + /* e0 = 1. - d * x0 */ + emit_insn (gen_rtx_SET (VOIDmode, e0, + gen_rtx_MINUS (SFmode, one, + gen_rtx_MULT (SFmode, d, x0)))); + /* e1 = e0 + e0 * e0 */ + emit_insn (gen_rtx_SET (VOIDmode, e1, + gen_rtx_PLUS (SFmode, + gen_rtx_MULT (SFmode, e0, e0), e0))); + /* y1 = x0 + e1 * x0 */ + emit_insn (gen_rtx_SET (VOIDmode, y1, + gen_rtx_PLUS (SFmode, + gen_rtx_MULT (SFmode, e1, x0), x0))); + /* u0 = n * y1 */ + emit_insn (gen_rtx_SET (VOIDmode, u0, + gen_rtx_MULT (SFmode, n, y1))); + /* v0 = n - d * u0 */ + emit_insn (gen_rtx_SET (VOIDmode, v0, + gen_rtx_MINUS (SFmode, n, + gen_rtx_MULT (SFmode, d, u0)))); + /* res = u0 + v0 * y1 */ + emit_insn (gen_rtx_SET (VOIDmode, res, + gen_rtx_PLUS (SFmode, + gen_rtx_MULT (SFmode, v0, y1), u0))); +} + +/* Newton-Raphson approximation of double-precision floating point divide n/d. + Assumes no trapping math and finite arguments. */ + +void +rs6000_emit_swdivdf (rtx res, rtx n, rtx d) +{ + rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one; + + x0 = gen_reg_rtx (DFmode); + e0 = gen_reg_rtx (DFmode); + e1 = gen_reg_rtx (DFmode); + e2 = gen_reg_rtx (DFmode); + y1 = gen_reg_rtx (DFmode); + y2 = gen_reg_rtx (DFmode); + y3 = gen_reg_rtx (DFmode); + u0 = gen_reg_rtx (DFmode); + v0 = gen_reg_rtx (DFmode); + one = force_reg (DFmode, CONST_DOUBLE_FROM_REAL_VALUE (dconst1, DFmode)); + + /* x0 = 1./d estimate */ + emit_insn (gen_rtx_SET (VOIDmode, x0, + gen_rtx_UNSPEC (DFmode, gen_rtvec (1, d), + UNSPEC_FRES))); + /* e0 = 1. - d * x0 */ + emit_insn (gen_rtx_SET (VOIDmode, e0, + gen_rtx_MINUS (DFmode, one, + gen_rtx_MULT (SFmode, d, x0)))); + /* y1 = x0 + e0 * x0 */ + emit_insn (gen_rtx_SET (VOIDmode, y1, + gen_rtx_PLUS (DFmode, + gen_rtx_MULT (DFmode, e0, x0), x0))); + /* e1 = e0 * e0 */ + emit_insn (gen_rtx_SET (VOIDmode, e1, + gen_rtx_MULT (DFmode, e0, e0))); + /* y2 = y1 + e1 * y1 */ + emit_insn (gen_rtx_SET (VOIDmode, y2, + gen_rtx_PLUS (DFmode, + gen_rtx_MULT (DFmode, e1, y1), y1))); + /* e2 = e1 * e1 */ + emit_insn (gen_rtx_SET (VOIDmode, e2, + gen_rtx_MULT (DFmode, e1, e1))); + /* y3 = y2 + e2 * y2 */ + emit_insn (gen_rtx_SET (VOIDmode, y3, + gen_rtx_PLUS (DFmode, + gen_rtx_MULT (DFmode, e2, y2), y2))); + /* u0 = n * y3 */ + emit_insn (gen_rtx_SET (VOIDmode, u0, + gen_rtx_MULT (DFmode, n, y3))); + /* v0 = n - d * u0 */ + emit_insn (gen_rtx_SET (VOIDmode, v0, + gen_rtx_MINUS (DFmode, n, + gen_rtx_MULT (DFmode, d, u0)))); + /* res = u0 + v0 * y3 */ + emit_insn (gen_rtx_SET (VOIDmode, res, + gen_rtx_PLUS (DFmode, + gen_rtx_MULT (DFmode, v0, y3), u0))); +} + /* Return an RTX representing where to find the function value of a function returning MODE. */ static rtx @@ -16281,6 +19254,26 @@ rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) enum machine_mode mode; unsigned int regno; + /* Special handling for structs in darwin64. */ + if (rs6000_darwin64_abi + && TYPE_MODE (valtype) == BLKmode + && TREE_CODE (valtype) == RECORD_TYPE + && int_size_in_bytes (valtype) > 0) + { + CUMULATIVE_ARGS valcum; + rtx valret; + + valcum.words = 0; + valcum.fregno = FP_ARG_MIN_REG; + valcum.vregno = ALTIVEC_ARG_MIN_REG; + /* Do a trial code generation as if this were going to be passed as + an argument; if any part goes in memory, we return NULL. */ + valret = rs6000_darwin64_record_arg (&valcum, valtype, 1, true); + if (valret) + return valret; + /* Otherwise fall through to standard ABI rules. */ + } + if (TARGET_32BIT && TARGET_POWERPC64 && TYPE_MODE (valtype) == DImode) { /* Long long return value need be split in -mpowerpc64, 32bit ABI. */ @@ -16294,22 +19287,46 @@ rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) GP_ARG_RETURN + 1), GEN_INT (4)))); } + if (TARGET_32BIT && TARGET_POWERPC64 && TYPE_MODE (valtype) == DCmode) + { + return gen_rtx_PARALLEL (DCmode, + gen_rtvec (4, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, GP_ARG_RETURN), + const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_RETURN + 1), + GEN_INT (4)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_RETURN + 2), + GEN_INT (8)), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_RETURN + 3), + GEN_INT (12)))); + } - if ((INTEGRAL_TYPE_P (valtype) - && TYPE_PRECISION (valtype) < BITS_PER_WORD) + mode = TYPE_MODE (valtype); + if ((INTEGRAL_TYPE_P (valtype) && GET_MODE_BITSIZE (mode) < BITS_PER_WORD) || POINTER_TYPE_P (valtype)) mode = TARGET_32BIT ? SImode : DImode; - else - mode = TYPE_MODE (valtype); - if (SCALAR_FLOAT_TYPE_P (valtype) && TARGET_HARD_FLOAT && TARGET_FPRS) + if (DECIMAL_FLOAT_MODE_P (mode)) + regno = GP_ARG_RETURN; + else if (SCALAR_FLOAT_TYPE_P (valtype) && TARGET_HARD_FLOAT && TARGET_FPRS) regno = FP_ARG_RETURN; else if (TREE_CODE (valtype) == COMPLEX_TYPE && targetm.calls.split_complex_arg) return rs6000_complex_function_value (mode); else if (TREE_CODE (valtype) == VECTOR_TYPE - && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI) + && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI + && ALTIVEC_VECTOR_MODE (mode)) regno = ALTIVEC_ARG_RETURN; + else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT + && (mode == DFmode || mode == DCmode)) + return spe_build_register_parallel (mode, GP_ARG_RETURN); else regno = GP_ARG_RETURN; @@ -16323,7 +19340,23 @@ rs6000_libcall_value (enum machine_mode mode) { unsigned int regno; - if (GET_MODE_CLASS (mode) == MODE_FLOAT + if (TARGET_32BIT && TARGET_POWERPC64 && mode == DImode) + { + /* Long long return value need be split in -mpowerpc64, 32bit ABI. */ + return gen_rtx_PARALLEL (DImode, + gen_rtvec (2, + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, GP_ARG_RETURN), + const0_rtx), + gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (SImode, + GP_ARG_RETURN + 1), + GEN_INT (4)))); + } + + if (DECIMAL_FLOAT_MODE_P (mode)) + regno = GP_ARG_RETURN; + else if (SCALAR_FLOAT_MODE_P (mode) && TARGET_HARD_FLOAT && TARGET_FPRS) regno = FP_ARG_RETURN; else if (ALTIVEC_VECTOR_MODE (mode) @@ -16331,6 +19364,9 @@ rs6000_libcall_value (enum machine_mode mode) regno = ALTIVEC_ARG_RETURN; else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg) return rs6000_complex_function_value (mode); + else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT + && (mode == DFmode || mode == DCmode)) + return spe_build_register_parallel (mode, GP_ARG_RETURN); else regno = GP_ARG_RETURN; @@ -16345,29 +19381,39 @@ rs6000_initial_elimination_offset (int from, int to) rs6000_stack_t *info = rs6000_stack_info (); HOST_WIDE_INT offset; - if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) + if (from == HARD_FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) offset = info->push_p ? 0 : -info->total_size; - else if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM) + else if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) + { + offset = info->push_p ? 0 : -info->total_size; + if (FRAME_GROWS_DOWNWARD) + offset += info->fixed_size + info->vars_size + info->parm_size; + } + else if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) + offset = FRAME_GROWS_DOWNWARD + ? info->fixed_size + info->vars_size + info->parm_size + : 0; + else if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) offset = info->total_size; else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) offset = info->push_p ? info->total_size : 0; else if (from == RS6000_PIC_OFFSET_TABLE_REGNUM) offset = 0; else - abort (); + gcc_unreachable (); return offset; } -/* Return true if TYPE is of type __ev64_opaque__. */ +/* Return true if TYPE is a SPE or AltiVec opaque type. */ static bool -is_ev64_opaque_type (tree type) +rs6000_is_opaque_type (tree type) { - return (TARGET_SPE - && (type == opaque_V2SI_type_node + return (type == opaque_V2SI_type_node || type == opaque_V2SF_type_node - || type == opaque_p_V2SI_type_node)); + || type == opaque_p_V2SI_type_node + || type == opaque_V4SI_type_node); } static rtx @@ -16375,7 +19421,11 @@ rs6000_dwarf_register_span (rtx reg) { unsigned regno; - if (!TARGET_SPE || !SPE_VECTOR_MODE (GET_MODE (reg))) + if (TARGET_SPE + && (SPE_VECTOR_MODE (GET_MODE (reg)) + || (TARGET_E500_DOUBLE && GET_MODE (reg) == DFmode))) + ; + else return NULL_RTX; regno = REGNO (reg); @@ -16423,10 +19473,67 @@ rs6000_dbx_register_number (unsigned int regno) return 612; /* SPE high reg number. We get these values of regno from rs6000_dwarf_register_span. */ - if (regno >= 1200 && regno < 1232) - return regno; + gcc_assert (regno >= 1200 && regno < 1232); + return regno; +} - abort (); +/* target hook eh_return_filter_mode */ +static enum machine_mode +rs6000_eh_return_filter_mode (void) +{ + return TARGET_32BIT ? SImode : word_mode; +} + +/* Target hook for scalar_mode_supported_p. */ +static bool +rs6000_scalar_mode_supported_p (enum machine_mode mode) +{ + if (DECIMAL_FLOAT_MODE_P (mode)) + return true; + else + return default_scalar_mode_supported_p (mode); +} + +/* Target hook for vector_mode_supported_p. */ +static bool +rs6000_vector_mode_supported_p (enum machine_mode mode) +{ + + if (TARGET_SPE && SPE_VECTOR_MODE (mode)) + return true; + + else if (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (mode)) + return true; + + else + return false; +} + +/* Target hook for invalid_arg_for_unprototyped_fn. */ +static const char * +invalid_arg_for_unprototyped_fn (tree typelist, tree funcdecl, tree val) +{ + return (!rs6000_darwin64_abi + && typelist == 0 + && TREE_CODE (TREE_TYPE (val)) == VECTOR_TYPE + && (funcdecl == NULL_TREE + || (TREE_CODE (funcdecl) == FUNCTION_DECL + && DECL_BUILT_IN_CLASS (funcdecl) != BUILT_IN_MD))) + ? N_("AltiVec argument passed to unprototyped function") + : NULL; +} + +/* For TARGET_SECURE_PLT 32-bit PIC code we can save PIC register + setup by using __stack_chk_fail_local hidden function instead of + calling __stack_chk_fail directly. Otherwise it is better to call + __stack_chk_fail directly. */ + +static tree +rs6000_stack_protect_fail (void) +{ + return (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic) + ? default_hidden_stack_protect_fail () + : default_external_stack_protect_fail (); } #include "gt-rs6000.h" diff --git a/contrib/gcc/config/rs6000/rs6000.h b/contrib/gcc/config/rs6000/rs6000.h index 01a97da4bf6..3294bd2ddee 100644 --- a/contrib/gcc/config/rs6000/rs6000.h +++ b/contrib/gcc/config/rs6000/rs6000.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. @@ -17,8 +18,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Note that some other tm.h files include this one and then override many of the definitions. */ @@ -40,11 +41,22 @@ #define TARGET_AIX 0 #endif +/* Control whether function entry points use a "dot" symbol when + ABI_AIX. */ +#define DOT_SYMBOLS 1 + /* Default string to use for cpu if not specified. */ #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT ((char *)0) #endif +/* If configured for PPC405, support PPC405CR Erratum77. */ +#ifdef CONFIG_PPC405CR +#define PPC405_ERRATUM77 (rs6000_cpu == PROCESSOR_PPC405) +#else +#define PPC405_ERRATUM77 0 +#endif + /* Common ASM definitions used by ASM_SPEC among the various targets for handling -mcpu=xxx switches. */ #define ASM_CPU_SPEC \ @@ -61,6 +73,8 @@ %{mcpu=power3: -mppc64} \ %{mcpu=power4: -mpower4} \ %{mcpu=power5: -mpower4} \ +%{mcpu=power5+: -mpower4} \ +%{mcpu=power6: -mpower4 -maltivec} \ %{mcpu=powerpc: -mppc} \ %{mcpu=rios: -mpwr} \ %{mcpu=rios1: -mpwr} \ @@ -124,252 +138,59 @@ /* Architecture type. */ -extern int target_flags; +/* Define TARGET_MFCRF if the target assembler does not support the + optional field operand for mfcr. */ -/* Use POWER architecture instructions and MQ register. */ -#define MASK_POWER 0x00000001 - -/* Use POWER2 extensions to POWER architecture. */ -#define MASK_POWER2 0x00000002 - -/* Use PowerPC architecture instructions. */ -#define MASK_POWERPC 0x00000004 - -/* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */ -#define MASK_PPC_GPOPT 0x00000008 - -/* Use PowerPC Graphics group optional instructions, e.g. fsel. */ -#define MASK_PPC_GFXOPT 0x00000010 - -/* Use PowerPC-64 architecture instructions. */ -#define MASK_POWERPC64 0x00000020 - -/* Use revised mnemonic names defined for PowerPC architecture. */ -#define MASK_NEW_MNEMONICS 0x00000040 - -/* Disable placing fp constants in the TOC; can be turned on when the - TOC overflows. */ -#define MASK_NO_FP_IN_TOC 0x00000080 - -/* Disable placing symbol+offset constants in the TOC; can be turned on when - the TOC overflows. */ -#define MASK_NO_SUM_IN_TOC 0x00000100 - -/* Output only one TOC entry per module. Normally linking fails if - there are more than 16K unique variables/constants in an executable. With - this option, linking fails only if there are more than 16K modules, or - if there are more than 16K unique variables/constant in a single module. - - This is at the cost of having 2 extra loads and one extra store per - function, and one less allocable register. */ -#define MASK_MINIMAL_TOC 0x00000200 - -/* Nonzero for the 64 bit ABIs: longs and pointers are 64 bits. The - chip is running in "64-bit mode", in which CR0 is set in dot - operations based on all 64 bits of the register, bdnz works on 64-bit - ctr, lr is 64 bits, and so on. Requires MASK_POWERPC64. */ -#define MASK_64BIT 0x00000400 - -/* Disable use of FPRs. */ -#define MASK_SOFT_FLOAT 0x00000800 - -/* Enable load/store multiple, even on PowerPC */ -#define MASK_MULTIPLE 0x00001000 - -/* Use string instructions for block moves */ -#define MASK_STRING 0x00002000 - -/* Disable update form of load/store */ -#define MASK_NO_UPDATE 0x00004000 - -/* Disable fused multiply/add operations */ -#define MASK_NO_FUSED_MADD 0x00008000 - -/* Nonzero if we need to schedule the prolog and epilog. */ -#define MASK_SCHED_PROLOG 0x00010000 - -/* Use AltiVec instructions. */ -#define MASK_ALTIVEC 0x00020000 - -/* Return small structures in memory (as the AIX ABI requires). */ -#define MASK_AIX_STRUCT_RET 0x00040000 - -/* Use single field mfcr instruction. */ -#define MASK_MFCRF 0x00080000 - -/* The only remaining free bits are 0x00600000. linux64.h uses - 0x00100000, and sysv4.h uses 0x00800000 -> 0x40000000. - 0x80000000 is not available because target_flags is signed. */ - -#define TARGET_POWER (target_flags & MASK_POWER) -#define TARGET_POWER2 (target_flags & MASK_POWER2) -#define TARGET_POWERPC (target_flags & MASK_POWERPC) -#define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT) -#define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT) -#define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS) -#define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC) -#define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC) -#define TARGET_MINIMAL_TOC (target_flags & MASK_MINIMAL_TOC) -#define TARGET_64BIT (target_flags & MASK_64BIT) -#define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT) -#define TARGET_MULTIPLE (target_flags & MASK_MULTIPLE) -#define TARGET_STRING (target_flags & MASK_STRING) -#define TARGET_NO_UPDATE (target_flags & MASK_NO_UPDATE) -#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) -#define TARGET_SCHED_PROLOG (target_flags & MASK_SCHED_PROLOG) -#define TARGET_ALTIVEC (target_flags & MASK_ALTIVEC) -#define TARGET_AIX_STRUCT_RET (target_flags & MASK_AIX_STRUCT_RET) - -/* Define TARGET_MFCRF if the target assembler supports the optional - field operand for mfcr and the target processor supports the - instruction. */ - -#ifdef HAVE_AS_MFCRF -#define TARGET_MFCRF (target_flags & MASK_MFCRF) -#else +#ifndef HAVE_AS_MFCRF +#undef TARGET_MFCRF #define TARGET_MFCRF 0 #endif +/* Define TARGET_POPCNTB if the target assembler does not support the + popcount byte instruction. */ + +#ifndef HAVE_AS_POPCNTB +#undef TARGET_POPCNTB +#define TARGET_POPCNTB 0 +#endif + +/* Define TARGET_FPRND if the target assembler does not support the + fp rounding instructions. */ + +#ifndef HAVE_AS_FPRND +#undef TARGET_FPRND +#define TARGET_FPRND 0 +#endif + +#ifndef TARGET_SECURE_PLT +#define TARGET_SECURE_PLT 0 +#endif #define TARGET_32BIT (! TARGET_64BIT) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_UPDATE (! TARGET_NO_UPDATE) -#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) - -/* Emit a dtp-relative reference to a TLS variable. */ - -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - rs6000_output_dwarf_dtprel (FILE, SIZE, X) -#endif #ifndef HAVE_AS_TLS #define HAVE_AS_TLS 0 #endif +/* Return 1 for a symbol ref for a thread-local storage symbol. */ +#define RS6000_SYMBOL_REF_TLS_P(RTX) \ + (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0) + #ifdef IN_LIBGCC2 /* For libgcc2 we make sure this is a compile time constant */ -#if defined (__64BIT__) || defined (__powerpc64__) +#if defined (__64BIT__) || defined (__powerpc64__) || defined (__ppc64__) +#undef TARGET_POWERPC64 #define TARGET_POWERPC64 1 #else +#undef TARGET_POWERPC64 #define TARGET_POWERPC64 0 #endif #else -#define TARGET_POWERPC64 (target_flags & MASK_POWERPC64) + /* The option machinery will define this. */ #endif -#define TARGET_XL_COMPAT 0 - -/* Run-time compilation parameters selecting different hardware subsets. - - Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING, \ - N_("Use POWER instruction set")}, \ - {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \ - | MASK_POWER2), \ - N_("Use POWER2 instruction set")}, \ - {"no-power2", - MASK_POWER2, \ - N_("Do not use POWER2 instruction set")}, \ - {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \ - | MASK_STRING), \ - N_("Do not use POWER instruction set")}, \ - {"powerpc", MASK_POWERPC, \ - N_("Use PowerPC instruction set")}, \ - {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \ - | MASK_PPC_GFXOPT | MASK_POWERPC64), \ - N_("Do not use PowerPC instruction set")}, \ - {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ - N_("Use PowerPC General Purpose group optional instructions")},\ - {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ - N_("Do not use PowerPC General Purpose group optional instructions")},\ - {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ - N_("Use PowerPC Graphics group optional instructions")},\ - {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ - N_("Do not use PowerPC Graphics group optional instructions")},\ - {"powerpc64", MASK_POWERPC64, \ - N_("Use PowerPC-64 instruction set")}, \ - {"no-powerpc64", - MASK_POWERPC64, \ - N_("Do not use PowerPC-64 instruction set")}, \ - {"altivec", MASK_ALTIVEC , \ - N_("Use AltiVec instructions")}, \ - {"no-altivec", - MASK_ALTIVEC , \ - N_("Do not use AltiVec instructions")}, \ - {"new-mnemonics", MASK_NEW_MNEMONICS, \ - N_("Use new mnemonics for PowerPC architecture")},\ - {"old-mnemonics", -MASK_NEW_MNEMONICS, \ - N_("Use old mnemonics for PowerPC architecture")},\ - {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \ - | MASK_MINIMAL_TOC), \ - N_("Put everything in the regular TOC")}, \ - {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ - N_("Place floating point constants in TOC")}, \ - {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ - N_("Do not place floating point constants in TOC")},\ - {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ - N_("Place symbol+offset constants in TOC")}, \ - {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ - N_("Do not place symbol+offset constants in TOC")},\ - {"minimal-toc", MASK_MINIMAL_TOC, \ - "Use only one TOC entry per procedure"}, \ - {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ - ""}, \ - {"no-minimal-toc", - MASK_MINIMAL_TOC, \ - N_("Place variable addresses in the regular TOC")},\ - {"hard-float", - MASK_SOFT_FLOAT, \ - N_("Use hardware floating point")}, \ - {"soft-float", MASK_SOFT_FLOAT, \ - N_("Do not use hardware floating point")}, \ - {"multiple", MASK_MULTIPLE, \ - N_("Generate load/store multiple instructions")}, \ - {"no-multiple", - MASK_MULTIPLE, \ - N_("Do not generate load/store multiple instructions")},\ - {"string", MASK_STRING, \ - N_("Generate string instructions for block moves")},\ - {"no-string", - MASK_STRING, \ - N_("Do not generate string instructions for block moves")},\ - {"update", - MASK_NO_UPDATE, \ - N_("Generate load/store with update instructions")},\ - {"no-update", MASK_NO_UPDATE, \ - N_("Do not generate load/store with update instructions")},\ - {"fused-madd", - MASK_NO_FUSED_MADD, \ - N_("Generate fused multiply/add instructions")},\ - {"no-fused-madd", MASK_NO_FUSED_MADD, \ - N_("Do not generate fused multiply/add instructions")},\ - {"sched-prolog", MASK_SCHED_PROLOG, \ - ""}, \ - {"no-sched-prolog", -MASK_SCHED_PROLOG, \ - N_("Do not schedule the start and end of the procedure")},\ - {"sched-epilog", MASK_SCHED_PROLOG, \ - ""}, \ - {"no-sched-epilog", -MASK_SCHED_PROLOG, \ - ""}, \ - {"aix-struct-return", MASK_AIX_STRUCT_RET, \ - N_("Return all structures in memory (AIX default)")},\ - {"svr4-struct-return", - MASK_AIX_STRUCT_RET, \ - N_("Return small structures in registers (SVR4 default)")},\ - {"no-aix-struct-return", - MASK_AIX_STRUCT_RET, \ - ""}, \ - {"no-svr4-struct-return", MASK_AIX_STRUCT_RET, \ - ""}, \ - {"mfcrf", MASK_MFCRF, \ - N_("Generate single field mfcr instruction")}, \ - {"no-mfcrf", - MASK_MFCRF, \ - N_("Do not generate single field mfcr instruction")},\ - SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT | MASK_SCHED_PROLOG, \ - ""}} - #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) -/* This is meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES - /* Processor type. Order must match cpu attribute in MD file. */ enum processor_type { @@ -438,46 +259,6 @@ enum group_termination previous_group }; -/* This is meant to be overridden in target specific files. */ -#define SUBTARGET_OPTIONS - -#define TARGET_OPTIONS \ -{ \ - {"cpu=", &rs6000_select[1].string, \ - N_("Use features of and schedule code for given CPU"), 0}, \ - {"tune=", &rs6000_select[2].string, \ - N_("Schedule code for given CPU"), 0}, \ - {"debug=", &rs6000_debug_name, N_("Enable debug output"), 0}, \ - {"traceback=", &rs6000_traceback_name, \ - N_("Select full, part, or no traceback table"), 0}, \ - {"abi=", &rs6000_abi_string, N_("Specify ABI to use"), 0}, \ - {"long-double-", &rs6000_long_double_size_string, \ - N_("Specify size of long double (64 or 128 bits)"), 0}, \ - {"isel=", &rs6000_isel_string, \ - N_("Specify yes/no if isel instructions should be generated"), 0}, \ - {"spe=", &rs6000_spe_string, \ - N_("Specify yes/no if SPE SIMD instructions should be generated"), 0},\ - {"float-gprs=", &rs6000_float_gprs_string, \ - N_("Specify yes/no if using floating point in the GPRs"), 0}, \ - {"vrsave=", &rs6000_altivec_vrsave_string, \ - N_("Specify yes/no if VRSAVE instructions should be generated for AltiVec"), 0}, \ - {"longcall", &rs6000_longcall_switch, \ - N_("Avoid all range limits on call instructions"), 0}, \ - {"no-longcall", &rs6000_longcall_switch, "", 0}, \ - {"warn-altivec-long", &rs6000_warn_altivec_long_switch, \ - N_("Warn about deprecated 'vector long ...' AltiVec type usage"), 0}, \ - {"no-warn-altivec-long", &rs6000_warn_altivec_long_switch, "", 0}, \ - {"sched-costly-dep=", &rs6000_sched_costly_dep_str, \ - N_("Determine which dependences between insns are considered costly"), 0}, \ - {"insert-sched-nops=", &rs6000_sched_insert_nops_str, \ - N_("Specify which post scheduling nop insertion scheme to apply"), 0}, \ - {"align-", &rs6000_alignment_string, \ - N_("Specify alignment of structure fields default/natural"), 0}, \ - {"prioritize-restricted-insns=", &rs6000_sched_restricted_insns_priority_str, \ - N_("Specify scheduling priority for dispatch slot restricted insns"), 0}, \ - SUBTARGET_OPTIONS \ -} - /* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. @@ -501,7 +282,6 @@ extern struct rs6000_cpu_select rs6000_select[]; /* Debug support */ extern const char *rs6000_debug_name; /* Name for -mdebug-xxxx option */ -extern const char *rs6000_abi_string; /* for -mabi={sysv,darwin,eabi,aix,altivec} */ extern int rs6000_debug_stack; /* debug stack applications */ extern int rs6000_debug_arg; /* debug argument handling */ @@ -512,32 +292,15 @@ extern const char *rs6000_traceback_name; /* Type of traceback table. */ /* These are separate from target_flags because we've run out of bits there. */ -extern const char *rs6000_long_double_size_string; extern int rs6000_long_double_type_size; +extern int rs6000_ieeequad; extern int rs6000_altivec_abi; extern int rs6000_spe_abi; -extern int rs6000_isel; -extern int rs6000_spe; extern int rs6000_float_gprs; -extern const char *rs6000_float_gprs_string; -extern const char *rs6000_isel_string; -extern const char *rs6000_spe_string; -extern const char *rs6000_altivec_vrsave_string; -extern int rs6000_altivec_vrsave; -extern const char *rs6000_longcall_switch; -extern int rs6000_default_long_calls; -extern const char* rs6000_alignment_string; extern int rs6000_alignment_flags; -extern const char *rs6000_sched_restricted_insns_priority_str; -extern int rs6000_sched_restricted_insns_priority; -extern const char *rs6000_sched_costly_dep_str; -extern enum rs6000_dependence_cost rs6000_sched_costly_dep; extern const char *rs6000_sched_insert_nops_str; extern enum rs6000_nop_insertion rs6000_sched_insert_nops; -extern int rs6000_warn_altivec_long; -extern const char *rs6000_warn_altivec_long_switch; - /* Alignment options for fields in structures for sub-targets following AIX-like ABI. ALIGN_POWER word-aligns FP doubles (default AIX ABI). @@ -546,7 +309,7 @@ extern const char *rs6000_warn_altivec_long_switch; Override the macro definitions when compiling libobjc to avoid undefined reference to rs6000_alignment_flags due to library's use of GCC alignment macros which use the macros below. */ - + #ifndef IN_TARGET_LIBS #define MASK_ALIGN_POWER 0x00000000 #define MASK_ALIGN_NATURAL 0x00000001 @@ -556,14 +319,19 @@ extern const char *rs6000_warn_altivec_long_switch; #endif #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128) +#define TARGET_IEEEQUAD rs6000_ieeequad #define TARGET_ALTIVEC_ABI rs6000_altivec_abi -#define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave #define TARGET_SPE_ABI 0 #define TARGET_SPE 0 #define TARGET_E500 0 #define TARGET_ISEL 0 #define TARGET_FPRS 1 +#define TARGET_E500_SINGLE 0 +#define TARGET_E500_DOUBLE 0 + +/* E500 processors only support plain "sync", not lwsync. */ +#define TARGET_NO_LWSYNC TARGET_E500 /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro @@ -587,6 +355,7 @@ extern const char *rs6000_warn_altivec_long_switch; /* Target pragma. */ #define REGISTER_TARGET_PRAGMAS() do { \ c_register_pragma (0, "longcall", rs6000_pragma_longcall); \ + targetm.resolve_overloaded_builtin = altivec_resolve_overloaded_builtin; \ } while (0) /* Target #defines. */ @@ -682,7 +451,6 @@ extern const char *rs6000_warn_altivec_long_switch; target machine. If you don't define this, the default is one word. */ #define LONG_TYPE_SIZE (TARGET_32BIT ? 32 : 64) -#define MAX_LONG_TYPE_SIZE 64 /* A C expression for the size in bits of the type `long long' on the target machine. If you don't define this, the default is two @@ -704,9 +472,6 @@ extern const char *rs6000_warn_altivec_long_switch; words. */ #define LONG_DOUBLE_TYPE_SIZE rs6000_long_double_type_size -/* Constant which presents upper bound of the above value. */ -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - /* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */ #ifdef __LONG_DOUBLE_128__ @@ -740,7 +505,9 @@ extern const char *rs6000_warn_altivec_long_switch; that the object would ordinarily have. */ #define LOCAL_ALIGNMENT(TYPE, ALIGN) \ ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 : \ - (TARGET_SPE && TREE_CODE (TYPE) == VECTOR_TYPE) ? 64 : ALIGN) + (TARGET_E500_DOUBLE && TYPE_MODE (TYPE) == DFmode) ? 64 : \ + (TARGET_SPE && TREE_CODE (TYPE) == VECTOR_TYPE \ + && SPE_VECTOR_MODE (TYPE_MODE (TYPE))) ? 64 : ALIGN) /* Alignment of field after `int : 0' in a structure. */ #define EMPTY_FIELD_BOUNDARY 32 @@ -756,9 +523,13 @@ extern const char *rs6000_warn_altivec_long_switch; store_bit_field() will force (subreg:DI (reg:V2SI x))'s to the back-end. Because a single GPR can hold a V2SI, but not a DI, the best thing to do is set structs to BLKmode and avoid Severe Tire - Damage. */ + Damage. + + On e500 v2, DF and DI modes suffer from the same anomaly. DF can + fit into 1, whereas DI still needs two. */ #define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \ - (TARGET_SPE && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) + ((TARGET_SPE && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \ + || (TARGET_E500_DOUBLE && (MODE) == DFmode)) /* A bit-field declared as `int' forces `int' alignment for the struct. */ #define PCC_BITFIELD_TYPE_MATTERS 1 @@ -772,9 +543,11 @@ extern const char *rs6000_warn_altivec_long_switch; : (ALIGN)) /* Make arrays of chars word-aligned for the same reasons. - Align vectors to 128 bits. */ + Align vectors to 128 bits. Align SPE vectors and E500 v2 doubles to + 64 bits. */ #define DATA_ALIGNMENT(TYPE, ALIGN) \ (TREE_CODE (TYPE) == VECTOR_TYPE ? (TARGET_SPE_ABI ? 64 : 128) \ + : (TARGET_E500_DOUBLE && TYPE_MODE (TYPE) == DFmode) ? 64 \ : TREE_CODE (TYPE) == ARRAY_TYPE \ && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) @@ -813,15 +586,18 @@ extern const char *rs6000_warn_altivec_long_switch; We also create a pseudo register for float/int conversions, that will really represent the memory location used. It is represented here as a register, in order to work around problems in allocating stack storage - in inline functions. */ + in inline functions. -#define FIRST_PSEUDO_REGISTER 113 + Another pseudo (not included in DWARF_FRAME_REGISTERS) is soft frame + pointer, which is eventually eliminated in favor of SP or FP. */ + +#define FIRST_PSEUDO_REGISTER 114 /* This must be included for pre gcc 3.0 glibc compatibility. */ #define PRE_GCC3_DWARF_FRAME_REGISTERS 77 /* Add 32 dwarf columns for synthetic SPE registers. */ -#define DWARF_FRAME_REGISTERS (FIRST_PSEUDO_REGISTER + 32) +#define DWARF_FRAME_REGISTERS ((FIRST_PSEUDO_REGISTER - 1) + 32) /* The SPE has an additional 32 synthetic registers, with DWARF debug info numbering for these registers starting at 1200. While eh_frame @@ -835,13 +611,28 @@ extern const char *rs6000_warn_altivec_long_switch; avoid invalidating older SPE eh_frame info. We must map them here to avoid huge unwinder tables mostly consisting - of unused space. */ + of unused space. */ #define DWARF_REG_TO_UNWIND_COLUMN(r) \ - ((r) > 1200 ? ((r) - 1200 + FIRST_PSEUDO_REGISTER) : (r)) + ((r) > 1200 ? ((r) - 1200 + FIRST_PSEUDO_REGISTER - 1) : (r)) + +/* Use standard DWARF numbering for DWARF debugging information. */ +#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO) /* Use gcc hard register numbering for eh_frame. */ #define DWARF_FRAME_REGNUM(REGNO) (REGNO) +/* Map register numbers held in the call frame info that gcc has + collected using DWARF_FRAME_REGNUM to those that should be output in + .debug_frame and .eh_frame. We continue to use gcc hard reg numbers + for .eh_frame, but use the numbers mandated by the various ABIs for + .debug_frame. rs6000_emit_prologue has translated any combination of + CR2, CR3, CR4 saves to a save of CR2. The actual code emitted saves + the whole of CR, so we map CR2_REGNO to the DWARF reg for CR. */ +#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) \ + ((FOR_EH) ? (REGNO) \ + : (REGNO) == CR2_REGNO ? 64 \ + : DBX_REGISTER_NUMBER (REGNO)) + /* 1 for registers that have pervasive standard uses and are not available for the register allocator. @@ -862,7 +653,7 @@ extern const char *rs6000_warn_altivec_long_switch; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1 \ - , 1, 1 \ + , 1, 1, 1 \ } /* 1 for registers not available across function calls. @@ -882,7 +673,7 @@ extern const char *rs6000_warn_altivec_long_switch; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1 \ - , 1, 1 \ + , 1, 1, 1 \ } /* Like `CALL_USED_REGISTERS' except this macro doesn't require that @@ -890,7 +681,7 @@ extern const char *rs6000_warn_altivec_long_switch; (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS'). This macro is optional. If not specified, it defaults to the value of `CALL_USED_REGISTERS'. */ - + #define CALL_REALLY_USED_REGISTERS \ {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, FIXED_R13, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -901,7 +692,7 @@ extern const char *rs6000_warn_altivec_long_switch; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0 \ - , 0, 0 \ + , 0, 0, 0 \ } #define MQ_REGNO 64 @@ -920,6 +711,10 @@ extern const char *rs6000_warn_altivec_long_switch; #define SPE_ACC_REGNO 111 #define SPEFSCR_REGNO 112 +#define FIRST_SAVED_ALTIVEC_REGNO (FIRST_ALTIVEC_REGNO+20) +#define FIRST_SAVED_FP_REGNO (14+32) +#define FIRST_SAVED_GP_REGNO 13 + /* List the order in which to allocate registers. Each register must be listed once, even those in FIXED_REGISTERS. @@ -927,31 +722,31 @@ extern const char *rs6000_warn_altivec_long_switch; fp0 (not saved or used for anything) fp13 - fp2 (not saved; incoming fp arg registers) fp1 (not saved; return value) - fp31 - fp14 (saved; order given to save least number) + fp31 - fp14 (saved; order given to save least number) cr7, cr6 (not saved or special) cr1 (not saved, but used for FP operations) cr0 (not saved, but used for arithmetic operations) cr4, cr3, cr2 (saved) - r0 (not saved; cannot be base reg) + r0 (not saved; cannot be base reg) r9 (not saved; best for TImode) r11, r10, r8-r4 (not saved; highest used first to make less conflict) - r3 (not saved; return value register) + r3 (not saved; return value register) r31 - r13 (saved; order given to save least number) r12 (not saved; if used for DImode or DFmode would use r13) mq (not saved; best to use it if we can) ctr (not saved; when we have the choice ctr is better) lr (saved) - cr5, r1, r2, ap, xer, vrsave, vscr (fixed) + cr5, r1, r2, ap, xer (fixed) + v0 - v1 (not saved or used for anything) + v13 - v3 (not saved; incoming vector arg registers) + v2 (not saved; incoming vector arg reg; return value) + v19 - v14 (not saved or used for anything) + v31 - v20 (saved; order given to save least number) + vrsave, vscr (fixed) spe_acc, spefscr (fixed) - - AltiVec registers: - v0 - v1 (not saved or used for anything) - v13 - v3 (not saved; incoming vector arg registers) - v2 (not saved; incoming vector arg reg; return value) - v19 - v14 (not saved or used for anything) - v31 - v20 (saved; order given to save least number) + sfp (fixed) */ - + #if FIXED_R2 == 1 #define MAYBE_R2_AVAILABLE #define MAYBE_R2_FIXED 2, @@ -960,28 +755,28 @@ extern const char *rs6000_warn_altivec_long_switch; #define MAYBE_R2_FIXED #endif -#define REG_ALLOC_ORDER \ - {32, \ - 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, \ - 33, \ - 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \ - 50, 49, 48, 47, 46, \ - 75, 74, 69, 68, 72, 71, 70, \ - 0, MAYBE_R2_AVAILABLE \ - 9, 11, 10, 8, 7, 6, 5, 4, \ - 3, \ - 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \ - 18, 17, 16, 15, 14, 13, 12, \ - 64, 66, 65, \ - 73, 1, MAYBE_R2_FIXED 67, 76, \ - /* AltiVec registers. */ \ - 77, 78, \ - 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, \ - 79, \ - 96, 95, 94, 93, 92, 91, \ - 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, \ - 97, 109, 110 \ - , 111, 112 \ +#define REG_ALLOC_ORDER \ + {32, \ + 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, \ + 33, \ + 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \ + 50, 49, 48, 47, 46, \ + 75, 74, 69, 68, 72, 71, 70, \ + 0, MAYBE_R2_AVAILABLE \ + 9, 11, 10, 8, 7, 6, 5, 4, \ + 3, \ + 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, \ + 18, 17, 16, 15, 14, 13, 12, \ + 64, 66, 65, \ + 73, 1, MAYBE_R2_FIXED 67, 76, \ + /* AltiVec registers. */ \ + 77, 78, \ + 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, \ + 79, \ + 96, 95, 94, 93, 92, 91, \ + 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, \ + 109, 110, \ + 111, 112, 113 \ } /* True if register is floating-point. */ @@ -994,7 +789,8 @@ extern const char *rs6000_warn_altivec_long_switch; #define CR_REGNO_NOT_CR0_P(N) ((N) >= 69 && (N) <= 75) /* True if register is an integer register. */ -#define INT_REGNO_P(N) ((N) <= 31 || (N) == ARG_POINTER_REGNUM) +#define INT_REGNO_P(N) \ + ((N) <= 31 || (N) == ARG_POINTER_REGNUM || (N) == FRAME_POINTER_REGNUM) /* SPE SIMD registers are just the GPRs. */ #define SPE_SIMD_REGNO_P(N) ((N) <= 31) @@ -1006,29 +802,13 @@ extern const char *rs6000_warn_altivec_long_switch; #define ALTIVEC_REGNO_P(N) ((N) >= FIRST_ALTIVEC_REGNO && (N) <= LAST_ALTIVEC_REGNO) /* Return number of consecutive hard regs needed starting at reg REGNO - to hold something of mode MODE. - This is ordinarily the length in words of a value of mode MODE - but can be less for certain modes in special long registers. + to hold something of mode MODE. */ - For the SPE, GPRs are 64 bits but only 32 bits are visible in - scalar instructions. The upper 32 bits are only available to the - SIMD instructions. - - POWER and PowerPC GPRs hold 32 bits worth; - PowerPC64 GPRs and FPRs point register holds 64 bits worth. */ - -#define HARD_REGNO_NREGS(REGNO, MODE) \ - (FP_REGNO_P (REGNO) \ - ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ - : (SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE)) \ - ? ((GET_MODE_SIZE (MODE) + UNITS_PER_SPE_WORD - 1) / UNITS_PER_SPE_WORD) \ - : ALTIVEC_REGNO_P (REGNO) \ - ? ((GET_MODE_SIZE (MODE) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD) \ - : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) +#define HARD_REGNO_NREGS(REGNO, MODE) rs6000_hard_regno_nregs ((REGNO), (MODE)) #define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ ((TARGET_32BIT && TARGET_POWERPC64 \ - && (MODE == DImode || MODE == DFmode) \ + && (GET_MODE_SIZE (MODE) > 4) \ && INT_REGNO_P (REGNO)) ? 1 : 0) #define ALTIVEC_VECTOR_MODE(MODE) \ @@ -1043,44 +823,24 @@ extern const char *rs6000_warn_altivec_long_switch; || (MODE) == V1DImode \ || (MODE) == V2SImode) -/* Define this macro to be nonzero if the port is prepared to handle - insns involving vector mode MODE. At the very least, it must have - move patterns for this mode. */ +#define UNITS_PER_SIMD_WORD \ + (TARGET_ALTIVEC ? UNITS_PER_ALTIVEC_WORD \ + : (TARGET_SPE ? UNITS_PER_SPE_WORD : UNITS_PER_WORD)) -#define VECTOR_MODE_SUPPORTED_P(MODE) \ - ((TARGET_SPE && SPE_VECTOR_MODE (MODE)) \ - || (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (MODE))) - -/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. - For POWER and PowerPC, the GPRs can hold any mode, but values bigger - than one register cannot go past R31. The float - registers only can hold floating modes and DImode, and CR register only - can hold CC modes. We cannot put TImode anywhere except general - register and it must be able to fit within the register set. */ - -#define HARD_REGNO_MODE_OK(REGNO, MODE) \ - (INT_REGNO_P (REGNO) ? \ - INT_REGNO_P (REGNO + HARD_REGNO_NREGS (REGNO, MODE) - 1) \ - : FP_REGNO_P (REGNO) ? \ - ((GET_MODE_CLASS (MODE) == MODE_FLOAT \ - && FP_REGNO_P (REGNO + HARD_REGNO_NREGS (REGNO, MODE) - 1)) \ - || (GET_MODE_CLASS (MODE) == MODE_INT \ - && GET_MODE_SIZE (MODE) == UNITS_PER_FP_WORD)) \ - : ALTIVEC_REGNO_P (REGNO) ? ALTIVEC_VECTOR_MODE (MODE) \ - : SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE) ? 1 \ - : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \ - : XER_REGNO_P (REGNO) ? (MODE) == PSImode \ - : GET_MODE_SIZE (MODE) <= UNITS_PER_WORD) +/* Value is TRUE if hard register REGNO can hold a value of + machine-mode MODE. */ +#define HARD_REGNO_MODE_OK(REGNO, MODE) \ + rs6000_hard_regno_mode_ok_p[(int)(MODE)][REGNO] /* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */ #define MODES_TIEABLE_P(MODE1, MODE2) \ - (GET_MODE_CLASS (MODE1) == MODE_FLOAT \ - ? GET_MODE_CLASS (MODE2) == MODE_FLOAT \ - : GET_MODE_CLASS (MODE2) == MODE_FLOAT \ - ? GET_MODE_CLASS (MODE1) == MODE_FLOAT \ + (SCALAR_FLOAT_MODE_P (MODE1) \ + ? SCALAR_FLOAT_MODE_P (MODE2) \ + : SCALAR_FLOAT_MODE_P (MODE2) \ + ? SCALAR_FLOAT_MODE_P (MODE1) \ : GET_MODE_CLASS (MODE1) == MODE_CC \ ? GET_MODE_CLASS (MODE2) == MODE_CC \ : GET_MODE_CLASS (MODE2) == MODE_CC \ @@ -1120,9 +880,9 @@ extern const char *rs6000_warn_altivec_long_switch; #define BRANCH_COST 3 /* Override BRANCH_COST heuristic which empirically produces worse - performance for fold_range_test(). */ + performance for removing short circuiting from the logical ops. */ -#define RANGE_TEST_NON_SHORT_CIRCUIT 0 +#define LOGICAL_OP_NON_SHORT_CIRCUIT 0 /* A fixed register used at prologue and epilogue generation to fix addressing modes. The SPE needs heavy addressing fixes at the last @@ -1137,62 +897,10 @@ extern const char *rs6000_warn_altivec_long_switch; #define FIXED_SCRATCH (TARGET_SPE ? 14 : 11) -/* Define this macro to change register usage conditional on target flags. - Set MQ register fixed (already call_used) if not POWER architecture - (RIOS1, RIOS2, RSC, and PPC601) so that it will not be allocated. - 64-bit AIX reserves GPR13 for thread-private data. - Conditionally disable FPRs. */ +/* Define this macro to change register usage conditional on target + flags. */ -#define CONDITIONAL_REGISTER_USAGE \ -{ \ - int i; \ - if (! TARGET_POWER) \ - fixed_regs[64] = 1; \ - if (TARGET_64BIT) \ - fixed_regs[13] = call_used_regs[13] \ - = call_really_used_regs[13] = 1; \ - if (TARGET_SOFT_FLOAT || !TARGET_FPRS) \ - for (i = 32; i < 64; i++) \ - fixed_regs[i] = call_used_regs[i] \ - = call_really_used_regs[i] = 1; \ - if (DEFAULT_ABI == ABI_V4 \ - && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM \ - && flag_pic == 2) \ - fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \ - if (DEFAULT_ABI == ABI_V4 \ - && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM \ - && flag_pic == 1) \ - fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \ - if (DEFAULT_ABI == ABI_DARWIN \ - && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ - global_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = call_really_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \ - if (TARGET_TOC && TARGET_MINIMAL_TOC) \ - fixed_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] \ - = call_used_regs[RS6000_PIC_OFFSET_TABLE_REGNUM] = 1; \ - if (TARGET_ALTIVEC) \ - global_regs[VSCR_REGNO] = 1; \ - if (TARGET_SPE) \ - { \ - global_regs[SPEFSCR_REGNO] = 1; \ - fixed_regs[FIXED_SCRATCH] \ - = call_used_regs[FIXED_SCRATCH] \ - = call_really_used_regs[FIXED_SCRATCH] = 1; \ - } \ - if (! TARGET_ALTIVEC) \ - { \ - for (i = FIRST_ALTIVEC_REGNO; i <= LAST_ALTIVEC_REGNO; ++i) \ - fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; \ - call_really_used_regs[VRSAVE_REGNO] = 1; \ - } \ - if (TARGET_ALTIVEC_ABI) \ - for (i = FIRST_ALTIVEC_REGNO; i < FIRST_ALTIVEC_REGNO + 20; ++i) \ - call_used_regs[i] = call_really_used_regs[i] = 1; \ -} +#define CONDITIONAL_REGISTER_USAGE rs6000_conditional_register_usage () /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ @@ -1204,7 +912,10 @@ extern const char *rs6000_warn_altivec_long_switch; #define STACK_POINTER_REGNUM 1 /* Base register for access to local variables of the function. */ -#define FRAME_POINTER_REGNUM 31 +#define HARD_FRAME_POINTER_REGNUM 31 + +/* Base register for access to local variables of the function. */ +#define FRAME_POINTER_REGNUM 113 /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms @@ -1316,26 +1027,26 @@ enum reg_class #define REG_CLASS_CONTENTS \ { \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \ - { 0xfffffffe, 0x00000000, 0x00000008, 0x00000000 }, /* BASE_REGS */ \ - { 0xffffffff, 0x00000000, 0x00000008, 0x00000000 }, /* GENERAL_REGS */ \ + { 0xfffffffe, 0x00000000, 0x00000008, 0x00020000 }, /* BASE_REGS */ \ + { 0xffffffff, 0x00000000, 0x00000008, 0x00020000 }, /* GENERAL_REGS */ \ { 0x00000000, 0xffffffff, 0x00000000, 0x00000000 }, /* FLOAT_REGS */ \ { 0x00000000, 0x00000000, 0xffffe000, 0x00001fff }, /* ALTIVEC_REGS */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00002000 }, /* VRSAVE_REGS */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00004000 }, /* VSCR_REGS */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00008000 }, /* SPE_ACC_REGS */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00010000 }, /* SPEFSCR_REGS */ \ - { 0xffffffff, 0xffffffff, 0x00000008, 0x00000000 }, /* NON_SPECIAL_REGS */ \ + { 0xffffffff, 0xffffffff, 0x00000008, 0x00020000 }, /* NON_SPECIAL_REGS */ \ { 0x00000000, 0x00000000, 0x00000001, 0x00000000 }, /* MQ_REGS */ \ { 0x00000000, 0x00000000, 0x00000002, 0x00000000 }, /* LINK_REGS */ \ { 0x00000000, 0x00000000, 0x00000004, 0x00000000 }, /* CTR_REGS */ \ { 0x00000000, 0x00000000, 0x00000006, 0x00000000 }, /* LINK_OR_CTR_REGS */ \ { 0x00000000, 0x00000000, 0x00000007, 0x00002000 }, /* SPECIAL_REGS */ \ - { 0xffffffff, 0x00000000, 0x0000000f, 0x00000000 }, /* SPEC_OR_GEN_REGS */ \ + { 0xffffffff, 0x00000000, 0x0000000f, 0x00022000 }, /* SPEC_OR_GEN_REGS */ \ { 0x00000000, 0x00000000, 0x00000010, 0x00000000 }, /* CR0_REGS */ \ { 0x00000000, 0x00000000, 0x00000ff0, 0x00000000 }, /* CR_REGS */ \ - { 0xffffffff, 0x00000000, 0x0000efff, 0x00000000 }, /* NON_FLOAT_REGS */ \ + { 0xffffffff, 0x00000000, 0x0000efff, 0x00020000 }, /* NON_FLOAT_REGS */ \ { 0x00000000, 0x00000000, 0x00001000, 0x00000000 }, /* XER_REGS */ \ - { 0xffffffff, 0xffffffff, 0xffffffff, 0x00003fff } /* ALL_REGS */ \ + { 0xffffffff, 0xffffffff, 0xffffffff, 0x0003ffff } /* ALL_REGS */ \ } /* The same information, inverted: @@ -1356,115 +1067,27 @@ enum reg_class : (REGNO) == ARG_POINTER_REGNUM ? BASE_REGS \ : (REGNO) == XER_REGNO ? XER_REGS \ : (REGNO) == VRSAVE_REGNO ? VRSAVE_REGS \ - : (REGNO) == VSCR_REGNO ? VRSAVE_REGS \ + : (REGNO) == VSCR_REGNO ? VRSAVE_REGS \ : (REGNO) == SPE_ACC_REGNO ? SPE_ACC_REGS \ : (REGNO) == SPEFSCR_REGNO ? SPEFSCR_REGS \ + : (REGNO) == FRAME_POINTER_REGNUM ? BASE_REGS \ : NO_REGS) /* The class value for index registers, and the one for base regs. */ #define INDEX_REG_CLASS GENERAL_REGS #define BASE_REG_CLASS BASE_REGS -/* Get reg_class from a letter such as appears in the machine description. */ - -#define REG_CLASS_FROM_LETTER(C) \ - ((C) == 'f' ? FLOAT_REGS \ - : (C) == 'b' ? BASE_REGS \ - : (C) == 'h' ? SPECIAL_REGS \ - : (C) == 'q' ? MQ_REGS \ - : (C) == 'c' ? CTR_REGS \ - : (C) == 'l' ? LINK_REGS \ - : (C) == 'v' ? ALTIVEC_REGS \ - : (C) == 'x' ? CR0_REGS \ - : (C) == 'y' ? CR_REGS \ - : (C) == 'z' ? XER_REGS \ - : NO_REGS) - -/* The letters I, J, K, L, M, N, and P in a register constraint string - can be used to stand for particular ranges of immediate operands. - This macro defines what the ranges are. - C is the letter, and VALUE is a constant value. - Return 1 if VALUE is in the range specified by C. - - `I' is a signed 16-bit constant - `J' is a constant with only the high-order 16 bits nonzero - `K' is a constant with only the low-order 16 bits nonzero - `L' is a signed 16-bit constant shifted left 16 bits - `M' is a constant that is greater than 31 - `N' is a positive constant that is an exact power of two - `O' is the constant zero - `P' is a constant whose negation is a signed 16-bit constant */ - -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ - ( (C) == 'I' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \ - : (C) == 'J' ? ((VALUE) & (~ (unsigned HOST_WIDE_INT) 0xffff0000)) == 0 \ - : (C) == 'K' ? ((VALUE) & (~ (HOST_WIDE_INT) 0xffff)) == 0 \ - : (C) == 'L' ? (((VALUE) & 0xffff) == 0 \ - && ((VALUE) >> 31 == -1 || (VALUE) >> 31 == 0)) \ - : (C) == 'M' ? (VALUE) > 31 \ - : (C) == 'N' ? (VALUE) > 0 && exact_log2 (VALUE) >= 0 \ - : (C) == 'O' ? (VALUE) == 0 \ - : (C) == 'P' ? (unsigned HOST_WIDE_INT) ((- (VALUE)) + 0x8000) < 0x10000 \ - : 0) - -/* Similar, but for floating constants, and defining letters G and H. - Here VALUE is the CONST_DOUBLE rtx itself. - - We flag for special constants when we can copy the constant into - a general register in two insns for DF/DI and one insn for SF. - - 'H' is used for DI/DF constants that take 3 insns. */ - -#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ( (C) == 'G' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) \ - == ((GET_MODE (VALUE) == SFmode) ? 1 : 2)) \ - : (C) == 'H' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) == 3) \ - : 0) - -/* Optional extra constraints for this machine. - - 'Q' means that is a memory operand that is just an offset from a reg. - 'R' is for AIX TOC entries. - 'S' is a constant that can be placed into a 64-bit mask operand - 'T' is a constant that can be placed into a 32-bit mask operand - 'U' is for V.4 small data references. - 'W' is a vector constant that can be easily generated (no mem refs). - 'Y' is a indexed or word-aligned displacement memory operand. - 't' is for AND masks that can be performed by two rldic{l,r} insns. */ - -#define EXTRA_CONSTRAINT(OP, C) \ - ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \ - : (C) == 'R' ? legitimate_constant_pool_address_p (OP) \ - : (C) == 'S' ? mask64_operand (OP, DImode) \ - : (C) == 'T' ? mask_operand (OP, SImode) \ - : (C) == 'U' ? (DEFAULT_ABI == ABI_V4 \ - && small_data_operand (OP, GET_MODE (OP))) \ - : (C) == 't' ? (mask64_2_operand (OP, DImode) \ - && (fixed_regs[CR0_REGNO] \ - || !logical_operand (OP, DImode)) \ - && !mask64_operand (OP, DImode)) \ - : (C) == 'W' ? (easy_vector_constant (OP, GET_MODE (OP))) \ - : (C) == 'Y' ? (word_offset_memref_operand (OP, GET_MODE (OP))) \ - : 0) - -/* Defining, which contraints are memory contraints. Tells reload, - that any memory address can be reloaded by copying the - memory address into a base register if required. */ - -#define EXTRA_MEMORY_CONSTRAINT(C, STR) \ - ((C) == 'Q' || (C) == 'Y') - /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. In general this is just CLASS; but on some machines in some cases it is preferable to use a more restrictive class. On the RS/6000, we have to return NO_REGS when we want to reload a - floating-point CONST_DOUBLE to force it to be copied to memory. + floating-point CONST_DOUBLE to force it to be copied to memory. We also don't want to reload integer values into floating-point registers if we can at all help it. In fact, this can - cause reload to abort, if it tries to generate a reload of CTR + cause reload to die, if it tries to generate a reload of CTR into a FP register and discovers it doesn't have the memory location required. @@ -1473,27 +1096,20 @@ enum reg_class */ #define PREFERRED_RELOAD_CLASS(X,CLASS) \ - (((GET_CODE (X) == CONST_DOUBLE \ - && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ - ? NO_REGS \ - : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ - && (CLASS) == NON_SPECIAL_REGS) \ - ? GENERAL_REGS \ - : (CLASS))) - -#define DISPARAGE_RELOAD_CLASS(X, CLASS) \ - (GET_CODE (X) == REG \ - && REGNO (X) < FIRST_PSEUDO_REGISTER \ - && SECONDARY_MEMORY_NEEDED (GET_MODE_CLASS (GET_MODE (X)), \ - CLASS, GET_MODE (X)) \ - ? 6 : 0) + ((CONSTANT_P (X) \ + && reg_classes_intersect_p ((CLASS), FLOAT_REGS)) \ + ? NO_REGS \ + : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ + && (CLASS) == NON_SPECIAL_REGS) \ + ? GENERAL_REGS \ + : (CLASS)) /* Return the register class of a scratch register needed to copy IN into or out of a register in CLASS in MODE. If it can be done directly, NO_REGS is returned. */ -#define SECONDARY_RELOAD_CLASS(CLASS, MODE, IN) \ - secondary_reload_class (CLASS, MODE, IN) +#define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \ + rs6000_secondary_reload_class (CLASS, MODE, IN) /* If we are copying between FP or AltiVec registers and anything else, we need a memory location. */ @@ -1512,20 +1128,23 @@ enum reg_class #define CLASS_MAX_NREGS(CLASS, MODE) \ (((CLASS) == FLOAT_REGS) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ + : (TARGET_E500_DOUBLE && (CLASS) == GENERAL_REGS && (MODE) == DFmode) \ + ? 1 \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) +/* Return nonzero if for CLASS a mode change from FROM to TO is invalid. */ -/* Return a class of registers that cannot change FROM mode to TO mode. */ - -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) \ - && GET_MODE_SIZE (FROM) >= 8 && GET_MODE_SIZE (TO) >= 8) \ - ? 0 \ - : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \ - : (TARGET_SPE && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1) \ - ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ - : 0) +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ + ? ((GET_MODE_SIZE (FROM) < 8 || GET_MODE_SIZE (TO) < 8 \ + || TARGET_IEEEQUAD) \ + && reg_classes_intersect_p (FLOAT_REGS, CLASS)) \ + : (((TARGET_E500_DOUBLE \ + && ((((TO) == DFmode) + ((FROM) == DFmode)) == 1 \ + || (((TO) == DImode) + ((FROM) == DImode)) == 1)) \ + || (TARGET_SPE \ + && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1)) \ + && reg_classes_intersect_p (GENERAL_REGS, CLASS))) /* Stack layout; function entry, exit and calling. */ @@ -1546,14 +1165,14 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ /* Offsets recorded in opcodes are a multiple of this alignment factor. */ #define DWARF_CIE_DATA_ALIGNMENT (-((int) (TARGET_32BIT ? 4 : 8))) -/* Define this if the nominal address of the stack frame +/* Define this to nonzero if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. On the RS/6000, we grow upwards, from the area after the outgoing arguments. */ -/* #define FRAME_GROWS_DOWNWARD */ +#define FRAME_GROWS_DOWNWARD (flag_stack_protect != 0) /* Size of the outgoing register save area */ #define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \ @@ -1571,16 +1190,9 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ plus_constant (stack_pointer_rtx, \ (TARGET_32BIT ? 20 : 40))) -/* Size of the V.4 varargs area if needed */ -#define RS6000_VARARGS_AREA 0 - /* Align an address */ #define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1)) -/* Size of V.4 varargs area in bytes */ -#define RS6000_VARARGS_SIZE \ - ((GP_ARG_NUM_REG * (TARGET_32BIT ? 4 : 8)) + (FP_ARG_NUM_REG * 8) + 8) - /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING @@ -1591,10 +1203,11 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ outgoing parameter area. */ #define STARTING_FRAME_OFFSET \ - (RS6000_ALIGN (current_function_outgoing_args_size, \ - TARGET_ALTIVEC ? 16 : 8) \ - + RS6000_VARARGS_AREA \ - + RS6000_SAVE_AREA) + (FRAME_GROWS_DOWNWARD \ + ? 0 \ + : (RS6000_ALIGN (current_function_outgoing_args_size, \ + TARGET_ALTIVEC ? 16 : 8) \ + + RS6000_SAVE_AREA)) /* Offset from the stack pointer register to an item dynamically allocated on the stack, e.g., by `alloca'. @@ -1665,7 +1278,7 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ /* DRAFT_V4_STRUCT_RET defaults off. */ #define DRAFT_V4_STRUCT_RET 0 -/* Let RETURN_IN_MEMORY control what happens. */ +/* Let TARGET_RETURN_IN_MEMORY control what happens. */ #define DEFAULT_PCC_STRUCT_RETURN 0 /* Mode of stack savearea. @@ -1708,13 +1321,17 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ #define CALL_LONG 0x00000008 /* always call indirect */ #define CALL_LIBCALL 0x00000010 /* libcall */ +/* We don't have prologue and epilogue functions to save/restore + everything for most ABIs. */ +#define WORLD_SAVE_P(INFO) 0 + /* 1 if N is a possible register number for a function value as seen by the caller. On RS/6000, this is r3, fp1, and v2 (for AltiVec). */ #define FUNCTION_VALUE_REGNO_P(N) \ ((N) == GP_ARG_RETURN \ - || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT) \ + || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT && TARGET_FPRS) \ || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI)) /* 1 if N is a possible register number for function argument passing. @@ -1725,24 +1342,8 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ || ((unsigned) (N) - ALTIVEC_ARG_MIN_REG < ALTIVEC_ARG_NUM_REG \ && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI) \ || ((unsigned) (N) - FP_ARG_MIN_REG < FP_ARG_NUM_REG \ - && TARGET_HARD_FLOAT)) + && TARGET_HARD_FLOAT && TARGET_FPRS)) -/* A C structure for machine-specific, per-function data. - This is added to the cfun structure. */ -typedef struct machine_function GTY(()) -{ - /* Whether a System V.4 varargs area was created. */ - int sysv_varargs_p; - /* Flags if __builtin_return_address (n) with n >= 1 was used. */ - int ra_needs_full_frame; - /* Some local-dynamic symbol. */ - const char *some_ld_name; - /* Whether the instruction chain has been scanned already. */ - int insn_chain_scanned_p; - /* Flags if __builtin_return_address (0) was used. */ - int ra_need_lr; -} machine_function; - /* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself @@ -1771,6 +1372,9 @@ typedef struct rs6000_args int stdarg; /* Whether function is a stdarg function. */ int call_cookie; /* Do special things for this call */ int sysv_gregno; /* next available GP register */ + int intoffset; /* running offset in struct (darwin64) */ + int use_stack; /* any part of struct on stack (darwin64) */ + int named; /* false for varargs params */ } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS @@ -1796,7 +1400,7 @@ typedef struct rs6000_args (TYPE is null for libcalls where that information may not be available.) */ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - function_arg_advance (&CUM, MODE, TYPE, NAMED) + function_arg_advance (&CUM, MODE, TYPE, NAMED, 0) /* Determine where to put an argument to a function. Value is zero to push the argument on the stack, @@ -1823,22 +1427,6 @@ typedef struct rs6000_args #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (&CUM, MODE, TYPE, NAMED) -/* For an arg passed partly in registers and partly in memory, - this is the number of registers used. - For args passed entirely in registers or entirely in memory, zero. */ - -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ - function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) - -/* A C expression that indicates when an argument must be passed by - reference. If nonzero for an argument, a copy of that argument is - made in memory and a pointer to the argument is passed instead of - the argument itself. The pointer is passed in whatever way is - appropriate for passing a pointer to that type. */ - -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED) - /* If defined, a C expression which determines whether, and in which direction, to pad out an argument with extra space. The value should be of type `enum direction': either `upward' to pad above @@ -1858,17 +1446,9 @@ typedef struct rs6000_args #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ rs6000_va_start (valist, nextarg) -/* Implement `va_arg'. */ -#define EXPAND_BUILTIN_VA_ARG(valist, type) \ - rs6000_va_arg (valist, type) - #define PAD_VARARGS_DOWN \ (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward) -/* Define this macro to be a nonzero value if the location where a function - argument is passed depends on whether or not it is a named argument. */ -#define STRICT_ARGUMENT_NAMING 1 - /* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */ @@ -1951,10 +1531,12 @@ typedef struct rs6000_args of eliminable registers. The "from" register number is given first, followed by "to". Eliminations of the same "from" register are listed in order of preference. */ -#define ELIMINABLE_REGS \ -{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ - { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ - { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ +#define ELIMINABLE_REGS \ +{{ HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ + { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ { RS6000_PIC_OFFSET_TABLE_REGNUM, RS6000_PIC_OFFSET_TABLE_REGNUM } } /* Given FROM and TO register numbers, say whether this elimination is allowed. @@ -1994,14 +1576,18 @@ typedef struct rs6000_args #define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) < FIRST_PSEUDO_REGISTER \ ? (REGNO) <= 31 || (REGNO) == 67 \ + || (REGNO) == FRAME_POINTER_REGNUM \ : (reg_renumber[REGNO] >= 0 \ - && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67))) + && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67 \ + || reg_renumber[REGNO] == FRAME_POINTER_REGNUM))) #define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) < FIRST_PSEUDO_REGISTER \ ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \ + || (REGNO) == FRAME_POINTER_REGNUM \ : (reg_renumber[REGNO] > 0 \ - && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67))) + && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67 \ + || reg_renumber[REGNO] == FRAME_POINTER_REGNUM))) /* Maximum number of registers that can appear in a valid memory address. */ @@ -2030,6 +1616,11 @@ typedef struct rs6000_args || easy_vector_constant (X, GET_MODE (X))) \ && !rs6000_tls_referenced_p (X)) +#define EASY_VECTOR_15(n) ((n) >= -16 && (n) <= 15) +#define EASY_VECTOR_15_ADD_SELF(n) (!EASY_VECTOR_15((n)) \ + && EASY_VECTOR_15((n) >> 1) \ + && ((n) & 1) == 0) + /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. @@ -2052,16 +1643,14 @@ typedef struct rs6000_args /* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg in the non-strict case. */ #define INT_REG_OK_FOR_INDEX_P(X, STRICT) \ - ((! (STRICT) \ - && (REGNO (X) <= 31 \ - || REGNO (X) == ARG_POINTER_REGNUM \ - || REGNO (X) >= FIRST_PSEUDO_REGISTER)) \ - || ((STRICT) && REGNO_OK_FOR_INDEX_P (REGNO (X)))) + ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ + || REGNO_OK_FOR_INDEX_P (REGNO (X))) /* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg in the non-strict case. */ #define INT_REG_OK_FOR_BASE_P(X, STRICT) \ - (REGNO (X) > 0 && INT_REG_OK_FOR_INDEX_P (X, (STRICT))) + ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ + || REGNO_OK_FOR_BASE_P (REGNO (X))) #define REG_OK_FOR_INDEX_P(X) INT_REG_OK_FOR_INDEX_P (X, REG_OK_STRICT_FLAG) #define REG_OK_FOR_BASE_P(X) INT_REG_OK_FOR_BASE_P (X, REG_OK_STRICT_FLAG) @@ -2071,7 +1660,7 @@ typedef struct rs6000_args The MODE argument is the machine mode for the MEM expression that wants to use this address. - On the RS/6000, there are four valid address: a SYMBOL_REF that + On the RS/6000, there are four valid addresses: a SYMBOL_REF that refers to a constant pool entry of an address (or the sum of it plus a constant), a short (16-bit signed) constant plus a register, the sum of two registers, or a register indirect, possibly with an @@ -2125,9 +1714,9 @@ typedef struct rs6000_args operand. If we find one, push the reload and jump to WIN. This macro is used in only one place: `find_reloads_address' in reload.c. - Implemented on rs6000 by rs6000_legitimize_reload_address. + Implemented on rs6000 by rs6000_legitimize_reload_address. Note that (X) is evaluated twice; this is safe in current usage. */ - + #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \ do { \ int win; \ @@ -2165,23 +1754,6 @@ do { \ /* #define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED */ -/* By generating position-independent code, when two different - programs (A and B) share a common library (libC.a), the text of - the library can be shared whether or not the library is linked at - the same address for both programs. In some of these - environments, position-independent code requires not only the use - of different addressing modes, but also special code to enable the - use of these addressing modes. - - The `FINALIZE_PIC' macro serves as a hook to emit these special - codes once the function is being compiled into assembly code, but - not before. (It is not done before, because in the case of - compiling an inline function, it would lead to multiple PIC - prologues being included in functions which used inline functions - and were compiled to assembly language.) */ - -/* #define FINALIZE_PIC */ - /* A C expression that is nonzero if X is a legitimate immediate operand on the target machine when generating position independent code. You can assume that X satisfies `CONSTANT_P', so you need @@ -2215,6 +1787,12 @@ do { \ /* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */ +/* An integer expression for the size in bits of the largest integer machine + mode that should actually be used. */ + +/* Allow pairs of registers to be used, which is the intent of the default. */ +#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_POWERPC64 ? TImode : DImode) + /* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */ #define MOVE_MAX (! TARGET_POWERPC64 ? 4 : 8) @@ -2232,7 +1810,7 @@ do { \ /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD will either zero-extend or sign-extend. The value of this macro should be the code that says which one of the two operations is implicitly - done, NIL if none. */ + done, UNKNOWN if none. */ #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND /* Define if loading short immediate values into registers sign extends. */ @@ -2290,9 +1868,9 @@ do { \ comparison. CCmode should be used in all other cases. */ #define SELECT_CC_MODE(OP,X,Y) \ - (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode \ + (SCALAR_FLOAT_MODE_P (GET_MODE (X)) ? CCFPmode \ : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \ - : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \ + : (((OP) == EQ || (OP) == NE) && COMPARISON_P (X) \ ? CCEQmode : CCmode)) /* Can the condition code MODE be safely reversed? This is safe in @@ -2317,10 +1895,6 @@ extern int rs6000_compare_fp_p; the end of the line. */ #define ASM_COMMENT_START " #" -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - /* Flag to say the TOC is initialized */ extern int toc_initialized; @@ -2349,9 +1923,9 @@ extern int toc_initialized; do \ { \ fputs ("\t.weak\t", (FILE)); \ - RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \ - && DEFAULT_ABI == ABI_AIX) \ + && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS) \ { \ if (TARGET_XCOFF) \ fputs ("[DS]", (FILE)); \ @@ -2363,7 +1937,7 @@ extern int toc_initialized; { \ ASM_OUTPUT_DEF ((FILE), (NAME), (VAL)); \ if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \ - && DEFAULT_ABI == ABI_AIX) \ + && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS) \ { \ fputs ("\t.set\t.", (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ @@ -2376,6 +1950,26 @@ extern int toc_initialized; while (0) #endif +#if HAVE_GAS_WEAKREF +#define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \ + do \ + { \ + fputs ("\t.weakref\t", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + fputs (", ", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (VALUE)); \ + if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \ + && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS) \ + { \ + fputs ("\n\t.weakref\t.", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + fputs (", .", (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (VALUE)); \ + } \ + fputc ('\n', (FILE)); \ + } while (0) +#endif + /* This implements the `alias' attribute. */ #undef ASM_OUTPUT_DEF_FROM_DECLS #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \ @@ -2384,7 +1978,7 @@ extern int toc_initialized; const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ const char *name = IDENTIFIER_POINTER (TARGET); \ if (TREE_CODE (DECL) == FUNCTION_DECL \ - && DEFAULT_ABI == ABI_AIX) \ + && DEFAULT_ABI == ABI_AIX && DOT_SYMBOLS) \ { \ if (TREE_PUBLIC (DECL)) \ { \ @@ -2548,6 +2142,7 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */ &rs6000_reg_names[110][0], /* vscr */ \ &rs6000_reg_names[111][0], /* spe_acc */ \ &rs6000_reg_names[112][0], /* spefscr */ \ + &rs6000_reg_names[113][0], /* sfp */ \ } /* Table of additional register names to use in user input. */ @@ -2635,79 +2230,6 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) -/* Define the codes that are matched by predicates in rs6000.c. */ - -#define PREDICATE_CODES \ - {"any_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM, PARALLEL}}, \ - {"zero_constant", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"short_cint_operand", {CONST_INT}}, \ - {"u_short_cint_operand", {CONST_INT}}, \ - {"non_short_cint_operand", {CONST_INT}}, \ - {"exact_log2_cint_operand", {CONST_INT}}, \ - {"gpc_reg_operand", {SUBREG, REG}}, \ - {"cc_reg_operand", {SUBREG, REG}}, \ - {"cc_reg_not_cr0_operand", {SUBREG, REG}}, \ - {"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_aligned_short_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_arith_cint_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_add_cint64_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_sub_cint64_operand", {SUBREG, REG, CONST_INT}}, \ - {"reg_or_logical_cint_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ - {"got_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \ - {"got_no_const_operand", {SYMBOL_REF, LABEL_REF}}, \ - {"easy_fp_constant", {CONST_DOUBLE}}, \ - {"easy_vector_constant", {CONST_VECTOR}}, \ - {"easy_vector_constant_add_self", {CONST_VECTOR}}, \ - {"zero_fp_constant", {CONST_DOUBLE}}, \ - {"reg_or_mem_operand", {SUBREG, MEM, REG}}, \ - {"lwa_operand", {SUBREG, MEM, REG}}, \ - {"volatile_mem_operand", {MEM}}, \ - {"offsettable_mem_operand", {MEM}}, \ - {"mem_or_easy_const_operand", {SUBREG, MEM, CONST_DOUBLE}}, \ - {"add_operand", {SUBREG, REG, CONST_INT}}, \ - {"non_add_cint_operand", {CONST_INT}}, \ - {"and_operand", {SUBREG, REG, CONST_INT}}, \ - {"and64_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ - {"and64_2_operand", {SUBREG, REG, CONST_INT}}, \ - {"logical_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ - {"non_logical_cint_operand", {CONST_INT, CONST_DOUBLE}}, \ - {"mask_operand", {CONST_INT}}, \ - {"mask_operand_wrap", {CONST_INT}}, \ - {"mask64_operand", {CONST_INT}}, \ - {"mask64_2_operand", {CONST_INT}}, \ - {"count_register_operand", {REG}}, \ - {"xer_operand", {REG}}, \ - {"symbol_ref_operand", {SYMBOL_REF}}, \ - {"rs6000_tls_symbol_ref", {SYMBOL_REF}}, \ - {"call_operand", {SYMBOL_REF, REG}}, \ - {"current_file_function_operand", {SYMBOL_REF}}, \ - {"input_operand", {SUBREG, MEM, REG, CONST_INT, \ - CONST_DOUBLE, SYMBOL_REF}}, \ - {"load_multiple_operation", {PARALLEL}}, \ - {"store_multiple_operation", {PARALLEL}}, \ - {"vrsave_operation", {PARALLEL}}, \ - {"branch_comparison_operator", {EQ, NE, LE, LT, GE, \ - GT, LEU, LTU, GEU, GTU, \ - UNORDERED, ORDERED, \ - UNGE, UNLE }}, \ - {"branch_positive_comparison_operator", {EQ, LT, GT, LTU, GTU, \ - UNORDERED }}, \ - {"scc_comparison_operator", {EQ, NE, LE, LT, GE, \ - GT, LEU, LTU, GEU, GTU, \ - UNORDERED, ORDERED, \ - UNGE, UNLE }}, \ - {"trap_comparison_operator", {EQ, NE, LE, LT, GE, \ - GT, LEU, LTU, GEU, GTU}}, \ - {"boolean_operator", {AND, IOR, XOR}}, \ - {"boolean_or_operator", {IOR, XOR}}, \ - {"altivec_register_operand", {REG}}, \ - {"min_max_operator", {SMIN, SMAX, UMIN, UMAX}}, - /* uncomment for disabling the corresponding default options */ /* #define MACHINE_no_sched_interblock */ /* #define MACHINE_no_sched_speculative */ @@ -2923,7 +2445,237 @@ enum rs6000_builtins ALTIVEC_BUILTIN_ABS_V4SF, ALTIVEC_BUILTIN_ABS_V8HI, ALTIVEC_BUILTIN_ABS_V16QI, - ALTIVEC_BUILTIN_COMPILETIME_ERROR, + ALTIVEC_BUILTIN_MASK_FOR_LOAD, + ALTIVEC_BUILTIN_MASK_FOR_STORE, + ALTIVEC_BUILTIN_VEC_INIT_V4SI, + ALTIVEC_BUILTIN_VEC_INIT_V8HI, + ALTIVEC_BUILTIN_VEC_INIT_V16QI, + ALTIVEC_BUILTIN_VEC_INIT_V4SF, + ALTIVEC_BUILTIN_VEC_SET_V4SI, + ALTIVEC_BUILTIN_VEC_SET_V8HI, + ALTIVEC_BUILTIN_VEC_SET_V16QI, + ALTIVEC_BUILTIN_VEC_SET_V4SF, + ALTIVEC_BUILTIN_VEC_EXT_V4SI, + ALTIVEC_BUILTIN_VEC_EXT_V8HI, + ALTIVEC_BUILTIN_VEC_EXT_V16QI, + ALTIVEC_BUILTIN_VEC_EXT_V4SF, + + /* Altivec overloaded builtins. */ + ALTIVEC_BUILTIN_VCMPEQ_P, + ALTIVEC_BUILTIN_OVERLOADED_FIRST = ALTIVEC_BUILTIN_VCMPEQ_P, + ALTIVEC_BUILTIN_VCMPGT_P, + ALTIVEC_BUILTIN_VCMPGE_P, + ALTIVEC_BUILTIN_VEC_ABS, + ALTIVEC_BUILTIN_VEC_ABSS, + ALTIVEC_BUILTIN_VEC_ADD, + ALTIVEC_BUILTIN_VEC_ADDC, + ALTIVEC_BUILTIN_VEC_ADDS, + ALTIVEC_BUILTIN_VEC_AND, + ALTIVEC_BUILTIN_VEC_ANDC, + ALTIVEC_BUILTIN_VEC_AVG, + ALTIVEC_BUILTIN_VEC_CEIL, + ALTIVEC_BUILTIN_VEC_CMPB, + ALTIVEC_BUILTIN_VEC_CMPEQ, + ALTIVEC_BUILTIN_VEC_CMPEQUB, + ALTIVEC_BUILTIN_VEC_CMPEQUH, + ALTIVEC_BUILTIN_VEC_CMPEQUW, + ALTIVEC_BUILTIN_VEC_CMPGE, + ALTIVEC_BUILTIN_VEC_CMPGT, + ALTIVEC_BUILTIN_VEC_CMPLE, + ALTIVEC_BUILTIN_VEC_CMPLT, + ALTIVEC_BUILTIN_VEC_CTF, + ALTIVEC_BUILTIN_VEC_CTS, + ALTIVEC_BUILTIN_VEC_CTU, + ALTIVEC_BUILTIN_VEC_DST, + ALTIVEC_BUILTIN_VEC_DSTST, + ALTIVEC_BUILTIN_VEC_DSTSTT, + ALTIVEC_BUILTIN_VEC_DSTT, + ALTIVEC_BUILTIN_VEC_EXPTE, + ALTIVEC_BUILTIN_VEC_FLOOR, + ALTIVEC_BUILTIN_VEC_LD, + ALTIVEC_BUILTIN_VEC_LDE, + ALTIVEC_BUILTIN_VEC_LDL, + ALTIVEC_BUILTIN_VEC_LOGE, + ALTIVEC_BUILTIN_VEC_LVEBX, + ALTIVEC_BUILTIN_VEC_LVEHX, + ALTIVEC_BUILTIN_VEC_LVEWX, + ALTIVEC_BUILTIN_VEC_LVSL, + ALTIVEC_BUILTIN_VEC_LVSR, + ALTIVEC_BUILTIN_VEC_MADD, + ALTIVEC_BUILTIN_VEC_MADDS, + ALTIVEC_BUILTIN_VEC_MAX, + ALTIVEC_BUILTIN_VEC_MERGEH, + ALTIVEC_BUILTIN_VEC_MERGEL, + ALTIVEC_BUILTIN_VEC_MIN, + ALTIVEC_BUILTIN_VEC_MLADD, + ALTIVEC_BUILTIN_VEC_MPERM, + ALTIVEC_BUILTIN_VEC_MRADDS, + ALTIVEC_BUILTIN_VEC_MRGHB, + ALTIVEC_BUILTIN_VEC_MRGHH, + ALTIVEC_BUILTIN_VEC_MRGHW, + ALTIVEC_BUILTIN_VEC_MRGLB, + ALTIVEC_BUILTIN_VEC_MRGLH, + ALTIVEC_BUILTIN_VEC_MRGLW, + ALTIVEC_BUILTIN_VEC_MSUM, + ALTIVEC_BUILTIN_VEC_MSUMS, + ALTIVEC_BUILTIN_VEC_MTVSCR, + ALTIVEC_BUILTIN_VEC_MULE, + ALTIVEC_BUILTIN_VEC_MULO, + ALTIVEC_BUILTIN_VEC_NMSUB, + ALTIVEC_BUILTIN_VEC_NOR, + ALTIVEC_BUILTIN_VEC_OR, + ALTIVEC_BUILTIN_VEC_PACK, + ALTIVEC_BUILTIN_VEC_PACKPX, + ALTIVEC_BUILTIN_VEC_PACKS, + ALTIVEC_BUILTIN_VEC_PACKSU, + ALTIVEC_BUILTIN_VEC_PERM, + ALTIVEC_BUILTIN_VEC_RE, + ALTIVEC_BUILTIN_VEC_RL, + ALTIVEC_BUILTIN_VEC_ROUND, + ALTIVEC_BUILTIN_VEC_RSQRTE, + ALTIVEC_BUILTIN_VEC_SEL, + ALTIVEC_BUILTIN_VEC_SL, + ALTIVEC_BUILTIN_VEC_SLD, + ALTIVEC_BUILTIN_VEC_SLL, + ALTIVEC_BUILTIN_VEC_SLO, + ALTIVEC_BUILTIN_VEC_SPLAT, + ALTIVEC_BUILTIN_VEC_SPLAT_S16, + ALTIVEC_BUILTIN_VEC_SPLAT_S32, + ALTIVEC_BUILTIN_VEC_SPLAT_S8, + ALTIVEC_BUILTIN_VEC_SPLAT_U16, + ALTIVEC_BUILTIN_VEC_SPLAT_U32, + ALTIVEC_BUILTIN_VEC_SPLAT_U8, + ALTIVEC_BUILTIN_VEC_SPLTB, + ALTIVEC_BUILTIN_VEC_SPLTH, + ALTIVEC_BUILTIN_VEC_SPLTW, + ALTIVEC_BUILTIN_VEC_SR, + ALTIVEC_BUILTIN_VEC_SRA, + ALTIVEC_BUILTIN_VEC_SRL, + ALTIVEC_BUILTIN_VEC_SRO, + ALTIVEC_BUILTIN_VEC_ST, + ALTIVEC_BUILTIN_VEC_STE, + ALTIVEC_BUILTIN_VEC_STL, + ALTIVEC_BUILTIN_VEC_STVEBX, + ALTIVEC_BUILTIN_VEC_STVEHX, + ALTIVEC_BUILTIN_VEC_STVEWX, + ALTIVEC_BUILTIN_VEC_SUB, + ALTIVEC_BUILTIN_VEC_SUBC, + ALTIVEC_BUILTIN_VEC_SUBS, + ALTIVEC_BUILTIN_VEC_SUM2S, + ALTIVEC_BUILTIN_VEC_SUM4S, + ALTIVEC_BUILTIN_VEC_SUMS, + ALTIVEC_BUILTIN_VEC_TRUNC, + ALTIVEC_BUILTIN_VEC_UNPACKH, + ALTIVEC_BUILTIN_VEC_UNPACKL, + ALTIVEC_BUILTIN_VEC_VADDFP, + ALTIVEC_BUILTIN_VEC_VADDSBS, + ALTIVEC_BUILTIN_VEC_VADDSHS, + ALTIVEC_BUILTIN_VEC_VADDSWS, + ALTIVEC_BUILTIN_VEC_VADDUBM, + ALTIVEC_BUILTIN_VEC_VADDUBS, + ALTIVEC_BUILTIN_VEC_VADDUHM, + ALTIVEC_BUILTIN_VEC_VADDUHS, + ALTIVEC_BUILTIN_VEC_VADDUWM, + ALTIVEC_BUILTIN_VEC_VADDUWS, + ALTIVEC_BUILTIN_VEC_VAVGSB, + ALTIVEC_BUILTIN_VEC_VAVGSH, + ALTIVEC_BUILTIN_VEC_VAVGSW, + ALTIVEC_BUILTIN_VEC_VAVGUB, + ALTIVEC_BUILTIN_VEC_VAVGUH, + ALTIVEC_BUILTIN_VEC_VAVGUW, + ALTIVEC_BUILTIN_VEC_VCFSX, + ALTIVEC_BUILTIN_VEC_VCFUX, + ALTIVEC_BUILTIN_VEC_VCMPEQFP, + ALTIVEC_BUILTIN_VEC_VCMPEQUB, + ALTIVEC_BUILTIN_VEC_VCMPEQUH, + ALTIVEC_BUILTIN_VEC_VCMPEQUW, + ALTIVEC_BUILTIN_VEC_VCMPGTFP, + ALTIVEC_BUILTIN_VEC_VCMPGTSB, + ALTIVEC_BUILTIN_VEC_VCMPGTSH, + ALTIVEC_BUILTIN_VEC_VCMPGTSW, + ALTIVEC_BUILTIN_VEC_VCMPGTUB, + ALTIVEC_BUILTIN_VEC_VCMPGTUH, + ALTIVEC_BUILTIN_VEC_VCMPGTUW, + ALTIVEC_BUILTIN_VEC_VMAXFP, + ALTIVEC_BUILTIN_VEC_VMAXSB, + ALTIVEC_BUILTIN_VEC_VMAXSH, + ALTIVEC_BUILTIN_VEC_VMAXSW, + ALTIVEC_BUILTIN_VEC_VMAXUB, + ALTIVEC_BUILTIN_VEC_VMAXUH, + ALTIVEC_BUILTIN_VEC_VMAXUW, + ALTIVEC_BUILTIN_VEC_VMINFP, + ALTIVEC_BUILTIN_VEC_VMINSB, + ALTIVEC_BUILTIN_VEC_VMINSH, + ALTIVEC_BUILTIN_VEC_VMINSW, + ALTIVEC_BUILTIN_VEC_VMINUB, + ALTIVEC_BUILTIN_VEC_VMINUH, + ALTIVEC_BUILTIN_VEC_VMINUW, + ALTIVEC_BUILTIN_VEC_VMRGHB, + ALTIVEC_BUILTIN_VEC_VMRGHH, + ALTIVEC_BUILTIN_VEC_VMRGHW, + ALTIVEC_BUILTIN_VEC_VMRGLB, + ALTIVEC_BUILTIN_VEC_VMRGLH, + ALTIVEC_BUILTIN_VEC_VMRGLW, + ALTIVEC_BUILTIN_VEC_VMSUMMBM, + ALTIVEC_BUILTIN_VEC_VMSUMSHM, + ALTIVEC_BUILTIN_VEC_VMSUMSHS, + ALTIVEC_BUILTIN_VEC_VMSUMUBM, + ALTIVEC_BUILTIN_VEC_VMSUMUHM, + ALTIVEC_BUILTIN_VEC_VMSUMUHS, + ALTIVEC_BUILTIN_VEC_VMULESB, + ALTIVEC_BUILTIN_VEC_VMULESH, + ALTIVEC_BUILTIN_VEC_VMULEUB, + ALTIVEC_BUILTIN_VEC_VMULEUH, + ALTIVEC_BUILTIN_VEC_VMULOSB, + ALTIVEC_BUILTIN_VEC_VMULOSH, + ALTIVEC_BUILTIN_VEC_VMULOUB, + ALTIVEC_BUILTIN_VEC_VMULOUH, + ALTIVEC_BUILTIN_VEC_VPKSHSS, + ALTIVEC_BUILTIN_VEC_VPKSHUS, + ALTIVEC_BUILTIN_VEC_VPKSWSS, + ALTIVEC_BUILTIN_VEC_VPKSWUS, + ALTIVEC_BUILTIN_VEC_VPKUHUM, + ALTIVEC_BUILTIN_VEC_VPKUHUS, + ALTIVEC_BUILTIN_VEC_VPKUWUM, + ALTIVEC_BUILTIN_VEC_VPKUWUS, + ALTIVEC_BUILTIN_VEC_VRLB, + ALTIVEC_BUILTIN_VEC_VRLH, + ALTIVEC_BUILTIN_VEC_VRLW, + ALTIVEC_BUILTIN_VEC_VSLB, + ALTIVEC_BUILTIN_VEC_VSLH, + ALTIVEC_BUILTIN_VEC_VSLW, + ALTIVEC_BUILTIN_VEC_VSPLTB, + ALTIVEC_BUILTIN_VEC_VSPLTH, + ALTIVEC_BUILTIN_VEC_VSPLTW, + ALTIVEC_BUILTIN_VEC_VSRAB, + ALTIVEC_BUILTIN_VEC_VSRAH, + ALTIVEC_BUILTIN_VEC_VSRAW, + ALTIVEC_BUILTIN_VEC_VSRB, + ALTIVEC_BUILTIN_VEC_VSRH, + ALTIVEC_BUILTIN_VEC_VSRW, + ALTIVEC_BUILTIN_VEC_VSUBFP, + ALTIVEC_BUILTIN_VEC_VSUBSBS, + ALTIVEC_BUILTIN_VEC_VSUBSHS, + ALTIVEC_BUILTIN_VEC_VSUBSWS, + ALTIVEC_BUILTIN_VEC_VSUBUBM, + ALTIVEC_BUILTIN_VEC_VSUBUBS, + ALTIVEC_BUILTIN_VEC_VSUBUHM, + ALTIVEC_BUILTIN_VEC_VSUBUHS, + ALTIVEC_BUILTIN_VEC_VSUBUWM, + ALTIVEC_BUILTIN_VEC_VSUBUWS, + ALTIVEC_BUILTIN_VEC_VSUM4SBS, + ALTIVEC_BUILTIN_VEC_VSUM4SHS, + ALTIVEC_BUILTIN_VEC_VSUM4UBS, + ALTIVEC_BUILTIN_VEC_VUPKHPX, + ALTIVEC_BUILTIN_VEC_VUPKHSB, + ALTIVEC_BUILTIN_VEC_VUPKHSH, + ALTIVEC_BUILTIN_VEC_VUPKLPX, + ALTIVEC_BUILTIN_VEC_VUPKLSB, + ALTIVEC_BUILTIN_VEC_VUPKLSH, + ALTIVEC_BUILTIN_VEC_XOR, + ALTIVEC_BUILTIN_VEC_STEP, + ALTIVEC_BUILTIN_OVERLOADED_LAST = ALTIVEC_BUILTIN_VEC_STEP, + /* SPE builtins. */ SPE_BUILTIN_EVADDW, SPE_BUILTIN_EVAND, @@ -3157,5 +2909,84 @@ enum rs6000_builtins SPE_BUILTIN_EVMWHGUMIAN, SPE_BUILTIN_MTSPEFSCR, SPE_BUILTIN_MFSPEFSCR, - SPE_BUILTIN_BRINC + SPE_BUILTIN_BRINC, + + RS6000_BUILTIN_COUNT }; + +enum rs6000_builtin_type_index +{ + RS6000_BTI_NOT_OPAQUE, + RS6000_BTI_opaque_V2SI, + RS6000_BTI_opaque_V2SF, + RS6000_BTI_opaque_p_V2SI, + RS6000_BTI_opaque_V4SI, + RS6000_BTI_V16QI, + RS6000_BTI_V2SI, + RS6000_BTI_V2SF, + RS6000_BTI_V4HI, + RS6000_BTI_V4SI, + RS6000_BTI_V4SF, + RS6000_BTI_V8HI, + RS6000_BTI_unsigned_V16QI, + RS6000_BTI_unsigned_V8HI, + RS6000_BTI_unsigned_V4SI, + RS6000_BTI_bool_char, /* __bool char */ + RS6000_BTI_bool_short, /* __bool short */ + RS6000_BTI_bool_int, /* __bool int */ + RS6000_BTI_pixel, /* __pixel */ + RS6000_BTI_bool_V16QI, /* __vector __bool char */ + RS6000_BTI_bool_V8HI, /* __vector __bool short */ + RS6000_BTI_bool_V4SI, /* __vector __bool int */ + RS6000_BTI_pixel_V8HI, /* __vector __pixel */ + RS6000_BTI_long, /* long_integer_type_node */ + RS6000_BTI_unsigned_long, /* long_unsigned_type_node */ + RS6000_BTI_INTQI, /* intQI_type_node */ + RS6000_BTI_UINTQI, /* unsigned_intQI_type_node */ + RS6000_BTI_INTHI, /* intHI_type_node */ + RS6000_BTI_UINTHI, /* unsigned_intHI_type_node */ + RS6000_BTI_INTSI, /* intSI_type_node */ + RS6000_BTI_UINTSI, /* unsigned_intSI_type_node */ + RS6000_BTI_float, /* float_type_node */ + RS6000_BTI_void, /* void_type_node */ + RS6000_BTI_MAX +}; + + +#define opaque_V2SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V2SI]) +#define opaque_V2SF_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V2SF]) +#define opaque_p_V2SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_p_V2SI]) +#define opaque_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V4SI]) +#define V16QI_type_node (rs6000_builtin_types[RS6000_BTI_V16QI]) +#define V2SI_type_node (rs6000_builtin_types[RS6000_BTI_V2SI]) +#define V2SF_type_node (rs6000_builtin_types[RS6000_BTI_V2SF]) +#define V4HI_type_node (rs6000_builtin_types[RS6000_BTI_V4HI]) +#define V4SI_type_node (rs6000_builtin_types[RS6000_BTI_V4SI]) +#define V4SF_type_node (rs6000_builtin_types[RS6000_BTI_V4SF]) +#define V8HI_type_node (rs6000_builtin_types[RS6000_BTI_V8HI]) +#define unsigned_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V16QI]) +#define unsigned_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V8HI]) +#define unsigned_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V4SI]) +#define bool_char_type_node (rs6000_builtin_types[RS6000_BTI_bool_char]) +#define bool_short_type_node (rs6000_builtin_types[RS6000_BTI_bool_short]) +#define bool_int_type_node (rs6000_builtin_types[RS6000_BTI_bool_int]) +#define pixel_type_node (rs6000_builtin_types[RS6000_BTI_pixel]) +#define bool_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V16QI]) +#define bool_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V8HI]) +#define bool_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V4SI]) +#define pixel_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_pixel_V8HI]) + +#define long_integer_type_internal_node (rs6000_builtin_types[RS6000_BTI_long]) +#define long_unsigned_type_internal_node (rs6000_builtin_types[RS6000_BTI_unsigned_long]) +#define intQI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTQI]) +#define uintQI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTQI]) +#define intHI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTHI]) +#define uintHI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTHI]) +#define intSI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTSI]) +#define uintSI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTSI]) +#define float_type_internal_node (rs6000_builtin_types[RS6000_BTI_float]) +#define void_type_internal_node (rs6000_builtin_types[RS6000_BTI_void]) + +extern GTY(()) tree rs6000_builtin_types[RS6000_BTI_MAX]; +extern GTY(()) tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT]; + diff --git a/contrib/gcc/config/rs6000/rs6000.md b/contrib/gcc/config/rs6000/rs6000.md index 0e242d4cfa6..21cc2079ec1 100644 --- a/contrib/gcc/config/rs6000/rs6000.md +++ b/contrib/gcc/config/rs6000/rs6000.md @@ -1,6 +1,7 @@ ;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler ;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -;; 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +;; Free Software Foundation, Inc. ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) ;; This file is part of GCC. @@ -17,8 +18,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. @@ -34,6 +35,10 @@ (UNSPEC_MOVSI_GOT 8) (UNSPEC_MV_CR_OV 9) ; move_from_CR_ov_bit (UNSPEC_FCTIWZ 10) + (UNSPEC_FRIM 11) + (UNSPEC_FRIN 12) + (UNSPEC_FRIP 13) + (UNSPEC_FRIZ 14) (UNSPEC_LD_MPIC 15) ; load_macho_picbase (UNSPEC_MPIC_CORRECT 16) ; macho_correct_pic (UNSPEC_TLSGD 17) @@ -50,7 +55,23 @@ (UNSPEC_TLSGOTTPREL 28) (UNSPEC_TLSTLS 29) (UNSPEC_FIX_TRUNC_TF 30) ; fadd, rounding towards zero - (UNSPEC_MV_CR_EQ 31) ; move_from_CR_eq_bit + (UNSPEC_MV_CR_GT 31) ; move_from_CR_gt_bit + (UNSPEC_STFIWX 32) + (UNSPEC_POPCNTB 33) + (UNSPEC_FRES 34) + (UNSPEC_SP_SET 35) + (UNSPEC_SP_TEST 36) + (UNSPEC_SYNC 37) + (UNSPEC_LWSYNC 38) + (UNSPEC_ISYNC 39) + (UNSPEC_SYNC_OP 40) + (UNSPEC_ATOMIC 41) + (UNSPEC_CMPXCHG 42) + (UNSPEC_XCHG 43) + (UNSPEC_AND 44) + (UNSPEC_DLMZB 45) + (UNSPEC_DLMZB_CR 46) + (UNSPEC_DLMZB_STRLEN 47) ]) ;; @@ -59,16 +80,18 @@ (define_constants [(UNSPECV_BLOCK 0) + (UNSPECV_LL 1) ; load-locked + (UNSPECV_SC 2) ; store-conditional (UNSPECV_EH_RR 9) ; eh_reg_restore ]) ;; Define an insn type attribute. This is used in function unit delay ;; computations. -(define_attr "type" "integer,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv" +(define_attr "type" "integer,two,three,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mfcrf,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv,isync,sync,load_l,store_c" (const_string "integer")) ;; Length (in bytes). -; '(pc)' in the following doesn't include the instruction itself; it is +; '(pc)' in the following doesn't include the instruction itself; it is ; calculated as if the instruction had zero size. (define_attr "length" "" (if_then_else (eq_attr "type" "branch") @@ -102,40 +125,81 @@ (include "power4.md") (include "power5.md") +(include "predicates.md") +(include "constraints.md") + +(include "darwin.md") + + +;; Mode macros + +; This mode macro allows :GPR to be used to indicate the allowable size +; of whole values in GPRs. +(define_mode_macro GPR [SI (DI "TARGET_POWERPC64")]) + +; Any supported integer mode. +(define_mode_macro INT [QI HI SI DI TI]) + +; Any supported integer mode that fits in one register. +(define_mode_macro INT1 [QI HI SI (DI "TARGET_POWERPC64")]) + +; extend modes for DImode +(define_mode_macro QHSI [QI HI SI]) + +; SImode or DImode, even if DImode doesn't fit in GPRs. +(define_mode_macro SDI [SI DI]) + +; The size of a pointer. Also, the size of the value that a record-condition +; (one with a '.') will compare. +(define_mode_macro P [(SI "TARGET_32BIT") (DI "TARGET_64BIT")]) + +; Any hardware-supported floating-point mode +(define_mode_macro FP [(SF "TARGET_HARD_FLOAT") + (DF "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)") + (TF "!TARGET_IEEEQUAD + && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128")]) + +; Various instructions that come in SI and DI forms. +; A generic w/d attribute, for things like cmpw/cmpd. +(define_mode_attr wd [(QI "b") (HI "h") (SI "w") (DI "d")]) + +; DImode bits +(define_mode_attr dbits [(QI "56") (HI "48") (SI "32")]) + ;; Start with fixed-point load and store insns. Here we put only the more ;; complex forms. Basic data transfer is done later. -(define_expand "zero_extendqidi2" +(define_expand "zero_extenddi2" [(set (match_operand:DI 0 "gpc_reg_operand" "") - (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))] + (zero_extend:DI (match_operand:QHSI 1 "gpc_reg_operand" "")))] "TARGET_POWERPC64" "") -(define_insn "" +(define_insn "*zero_extenddi2_internal1" [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))] + (zero_extend:DI (match_operand:QHSI 1 "reg_or_mem_operand" "m,r")))] "TARGET_POWERPC64" "@ - lbz%U1%X1 %0,%1 - rldicl %0,%1,0,56" + lz%U1%X1 %0,%1 + rldicl %0,%1,0," [(set_attr "type" "load,*")]) -(define_insn "" +(define_insn "*zero_extenddi2_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r")) + (compare:CC (zero_extend:DI (match_operand:QHSI 1 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:DI 2 "=r,r"))] "TARGET_64BIT" "@ - rldicl. %2,%1,0,56 + rldicl. %2,%1,0, #" [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")) + (compare:CC (zero_extend:DI (match_operand:QHSI 1 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:DI 2 ""))] "TARGET_POWERPC64 && reload_completed" @@ -146,22 +210,22 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "*zero_extenddi2_internal3" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r")) + (compare:CC (zero_extend:DI (match_operand:QHSI 1 "gpc_reg_operand" "r,r")) (const_int 0))) (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") (zero_extend:DI (match_dup 1)))] "TARGET_64BIT" "@ - rldicl. %0,%1,0,56 + rldicl. %0,%1,0, #" [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")) + (compare:CC (zero_extend:DI (match_operand:QHSI 1 "gpc_reg_operand" "")) (const_int 0))) (set (match_operand:DI 0 "gpc_reg_operand" "") (zero_extend:DI (match_dup 1)))] @@ -231,73 +295,6 @@ (const_int 0)))] "") -(define_expand "zero_extendhidi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))] - "TARGET_POWERPC64" - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))] - "TARGET_POWERPC64" - "@ - lhz%U1%X1 %0,%1 - rldicl %0,%1,0,48" - [(set_attr "type" "load,*")]) - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - rldicl. %2,%1,0,48 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (zero_extend:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (zero_extend:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - rldicl. %0,%1,0,48 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (zero_extend:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (zero_extend:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - (define_expand "extendhidi2" [(set (match_operand:DI 0 "gpc_reg_operand" "") (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))] @@ -365,73 +362,6 @@ (const_int 0)))] "") -(define_expand "zero_extendsidi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))] - "TARGET_POWERPC64" - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))] - "TARGET_POWERPC64" - "@ - lwz%U1%X1 %0,%1 - rldicl %0,%1,0,32" - [(set_attr "type" "load,*")]) - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - rldicl. %2,%1,0,32 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (zero_extend:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (zero_extend:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - rldicl. %0,%1,0,32 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (zero_extend:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (zero_extend:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - (define_expand "extendsidi2" [(set (match_operand:DI 0 "gpc_reg_operand" "") (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))] @@ -953,6 +883,537 @@ [(set_attr "type" "compare") (set_attr "length" "4,8")]) +;; IBM 405 and 440 half-word multiplication operations. + +(define_insn "*macchwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (ashiftrt:SI + (match_dup 2) + (const_int 16)) + (sign_extend:SI + (match_dup 1))) + (match_dup 4)))] + "TARGET_MULHW" + "macchw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*macchw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "macchw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*macchwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (lshiftrt:SI + (match_dup 2) + (const_int 16)) + (zero_extend:SI + (match_dup 1))) + (match_dup 4)))] + "TARGET_MULHW" + "macchwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*macchwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "macchwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*machhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (ashiftrt:SI + (match_dup 1) + (const_int 16)) + (ashiftrt:SI + (match_dup 2) + (const_int 16))) + (match_dup 4)))] + "TARGET_MULHW" + "machhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*machhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "machhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*machhwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (lshiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (lshiftrt:SI + (match_dup 1) + (const_int 16)) + (lshiftrt:SI + (match_dup 2) + (const_int 16))) + (match_dup 4)))] + "TARGET_MULHW" + "machhwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*machhwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (lshiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "machhwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*maclhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (sign_extend:SI + (match_dup 1)) + (sign_extend:SI + (match_dup 2))) + (match_dup 4)))] + "TARGET_MULHW" + "maclhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*maclhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "maclhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*maclhwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (plus:SI (mult:SI (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (zero_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (match_operand:SI 4 "gpc_reg_operand" "0")) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (zero_extend:SI + (match_dup 1)) + (zero_extend:SI + (match_dup 2))) + (match_dup 4)))] + "TARGET_MULHW" + "maclhwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*maclhwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (plus:SI (mult:SI (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (zero_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (match_operand:SI 3 "gpc_reg_operand" "0")))] + "TARGET_MULHW" + "maclhwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmacchwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (minus:SI (match_operand:SI 4 "gpc_reg_operand" "0") + (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r")))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_dup 4) + (mult:SI (ashiftrt:SI + (match_dup 2) + (const_int 16)) + (sign_extend:SI + (match_dup 1)))))] + "TARGET_MULHW" + "nmacchw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmacchw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_operand:SI 3 "gpc_reg_operand" "0") + (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r")))))] + "TARGET_MULHW" + "nmacchw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmachhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (minus:SI (match_operand:SI 4 "gpc_reg_operand" "0") + (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_dup 4) + (mult:SI (ashiftrt:SI + (match_dup 1) + (const_int 16)) + (ashiftrt:SI + (match_dup 2) + (const_int 16)))))] + "TARGET_MULHW" + "nmachhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmachhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_operand:SI 3 "gpc_reg_operand" "0") + (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)))))] + "TARGET_MULHW" + "nmachhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmaclhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (minus:SI (match_operand:SI 4 "gpc_reg_operand" "0") + (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r")))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_dup 4) + (mult:SI (sign_extend:SI + (match_dup 1)) + (sign_extend:SI + (match_dup 2)))))] + "TARGET_MULHW" + "nmaclhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*nmaclhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (minus:SI (match_operand:SI 3 "gpc_reg_operand" "0") + (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r")))))] + "TARGET_MULHW" + "nmaclhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulchwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (ashiftrt:SI + (match_dup 2) + (const_int 16)) + (sign_extend:SI + (match_dup 1))))] + "TARGET_MULHW" + "mulchw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulchw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))))] + "TARGET_MULHW" + "mulchw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulchwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (lshiftrt:SI + (match_dup 2) + (const_int 16)) + (zero_extend:SI + (match_dup 1))))] + "TARGET_MULHW" + "mulchwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulchwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16)) + (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "r"))))] + "TARGET_MULHW" + "mulchwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulhhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (ashiftrt:SI + (match_dup 1) + (const_int 16)) + (ashiftrt:SI + (match_dup 2) + (const_int 16))))] + "TARGET_MULHW" + "mulhhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulhhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (ashiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (ashiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))))] + "TARGET_MULHW" + "mulhhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulhhwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (lshiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (lshiftrt:SI + (match_dup 1) + (const_int 16)) + (lshiftrt:SI + (match_dup 2) + (const_int 16))))] + "TARGET_MULHW" + "mulhhwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mulhhwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (lshiftrt:SI + (match_operand:SI 1 "gpc_reg_operand" "%r") + (const_int 16)) + (lshiftrt:SI + (match_operand:SI 2 "gpc_reg_operand" "r") + (const_int 16))))] + "TARGET_MULHW" + "mulhhwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mullhwc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (sign_extend:SI + (match_dup 1)) + (sign_extend:SI + (match_dup 2))))] + "TARGET_MULHW" + "mullhw. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mullhw" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (sign_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (sign_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))))] + "TARGET_MULHW" + "mullhw %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mullhwuc" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (compare:CC (mult:SI (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (zero_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))) + (const_int 0))) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (zero_extend:SI + (match_dup 1)) + (zero_extend:SI + (match_dup 2))))] + "TARGET_MULHW" + "mullhwu. %0, %1, %2" + [(set_attr "type" "imul3")]) + +(define_insn "*mullhwu" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (mult:SI (zero_extend:SI + (match_operand:HI 1 "gpc_reg_operand" "%r")) + (zero_extend:SI + (match_operand:HI 2 "gpc_reg_operand" "r"))))] + "TARGET_MULHW" + "mullhwu %0, %1, %2" + [(set_attr "type" "imul3")]) + +;; IBM 405 and 440 string-search dlmzb instruction support. +(define_insn "dlmzb" + [(set (match_operand:CC 3 "cc_reg_operand" "=x") + (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") + (match_operand:SI 2 "gpc_reg_operand" "r")] + UNSPEC_DLMZB_CR)) + (set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_dup 1) + (match_dup 2)] + UNSPEC_DLMZB))] + "TARGET_DLMZB" + "dlmzb. %0, %1, %2") + +(define_expand "strlensi" + [(set (match_operand:SI 0 "gpc_reg_operand" "") + (unspec:SI [(match_operand:BLK 1 "general_operand" "") + (match_operand:QI 2 "const_int_operand" "") + (match_operand 3 "const_int_operand" "")] + UNSPEC_DLMZB_STRLEN)) + (clobber (match_scratch:CC 4 "=x"))] + "TARGET_DLMZB && WORDS_BIG_ENDIAN && !optimize_size" +{ + rtx result = operands[0]; + rtx src = operands[1]; + rtx search_char = operands[2]; + rtx align = operands[3]; + rtx addr, scratch_string, word1, word2, scratch_dlmzb; + rtx loop_label, end_label, mem, cr0, cond; + if (search_char != const0_rtx + || GET_CODE (align) != CONST_INT + || INTVAL (align) < 8) + FAIL; + word1 = gen_reg_rtx (SImode); + word2 = gen_reg_rtx (SImode); + scratch_dlmzb = gen_reg_rtx (SImode); + scratch_string = gen_reg_rtx (Pmode); + loop_label = gen_label_rtx (); + end_label = gen_label_rtx (); + addr = force_reg (Pmode, XEXP (src, 0)); + emit_move_insn (scratch_string, addr); + emit_label (loop_label); + mem = change_address (src, SImode, scratch_string); + emit_move_insn (word1, mem); + emit_move_insn (word2, adjust_address (mem, SImode, 4)); + cr0 = gen_rtx_REG (CCmode, CR0_REGNO); + emit_insn (gen_dlmzb (scratch_dlmzb, word1, word2, cr0)); + cond = gen_rtx_NE (VOIDmode, cr0, const0_rtx); + emit_jump_insn (gen_rtx_SET (VOIDmode, + pc_rtx, + gen_rtx_IF_THEN_ELSE (VOIDmode, + cond, + gen_rtx_LABEL_REF + (VOIDmode, + end_label), + pc_rtx))); + emit_insn (gen_addsi3 (scratch_string, scratch_string, GEN_INT (8))); + emit_jump_insn (gen_rtx_SET (VOIDmode, + pc_rtx, + gen_rtx_LABEL_REF (VOIDmode, loop_label))); + emit_barrier (); + emit_label (end_label); + emit_insn (gen_addsi3 (scratch_string, scratch_string, scratch_dlmzb)); + emit_insn (gen_subsi3 (result, scratch_string, addr)); + emit_insn (gen_subsi3 (result, result, const1_rtx)); + DONE; +}) + (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")) @@ -969,38 +1430,45 @@ ;; Fixed-point arithmetic insns. -;; Discourage ai/addic because of carry but provide it in an alternative -;; allowing register zero as source. -(define_expand "addsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_arith_cint_operand" "")))] +(define_expand "add3" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (plus:SDI (match_operand:SDI 1 "gpc_reg_operand" "") + (match_operand:SDI 2 "reg_or_add_cint_operand" "")))] "" - " { - if (GET_CODE (operands[2]) == CONST_INT - && ! add_operand (operands[2], SImode)) + if (mode == DImode && ! TARGET_POWERPC64) + { + if (non_short_cint_operand (operands[2], DImode)) + FAIL; + } + else if (GET_CODE (operands[2]) == CONST_INT + && ! add_operand (operands[2], mode)) { rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) - ? operands[0] : gen_reg_rtx (SImode)); + ? operands[0] : gen_reg_rtx (mode)); HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode); + HOST_WIDE_INT rest = trunc_int_for_mode (val - low, mode); + + if (mode == DImode && !satisfies_constraint_L (GEN_INT (rest))) + FAIL; /* The ordering here is important for the prolog expander. When space is allocated from the stack, adding 'low' first may produce a temporary deallocation (which would be bad). */ - emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest))); - emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low))); + emit_insn (gen_add3 (tmp, operands[1], GEN_INT (rest))); + emit_insn (gen_add3 (operands[0], tmp, GEN_INT (low))); DONE; } -}") +}) -(define_insn "*addsi3_internal1" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b") - (match_operand:SI 2 "add_operand" "r,I,I,L")))] +;; Discourage ai/addic because of carry but provide it in an alternative +;; allowing register zero as source. +(define_insn "*add3_internal1" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,?r,r") + (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,r,b") + (match_operand:GPR 2 "add_operand" "r,I,I,L")))] "" "@ {cax|add} %0,%1,%2 @@ -1017,13 +1485,13 @@ "{cau|addis} %0,%1,ha16(%2)" [(set_attr "length" "4")]) -(define_insn "*addsi3_internal2" +(define_insn "*add3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "%r,r,r,r") + (match_operand:P 2 "reg_or_short_operand" "r,I,r,I")) (const_int 0))) - (clobber (match_scratch:SI 3 "=r,r,r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 3 "=r,r,r,r"))] + "" "@ {cax.|add.} %3,%1,%2 {ai.|addic.} %3,%1,%2 @@ -1034,28 +1502,28 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "reg_or_short_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 3 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:GPR 3 ""))] + "reload_completed" [(set (match_dup 3) - (plus:SI (match_dup 1) + (plus:GPR (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] "") -(define_insn "*addsi3_internal3" +(define_insn "*add3_internal3" [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "%r,r,r,r") + (match_operand:P 2 "reg_or_short_operand" "r,I,r,I")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") - (plus:SI (match_dup 1) - (match_dup 2)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r,r,r") + (plus:P (match_dup 1) + (match_dup 2)))] + "" "@ {cax.|add.} %0,%1,%2 {ai.|addic.} %0,%1,%2 @@ -1066,15 +1534,15 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "reg_or_short_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (plus:P (match_dup 1) (match_dup 2)))] + "reload_completed" [(set (match_dup 0) - (plus:SI (match_dup 1) - (match_dup 2))) + (plus:P (match_dup 1) + (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] @@ -1085,34 +1553,43 @@ ;; add should be last in case the result gets used in an address. (define_split - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "non_add_cint_operand" "")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "") + (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "non_add_cint_operand" "")))] "" - [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3))) - (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))] -" + [(set (match_dup 0) (plus:GPR (match_dup 1) (match_dup 3))) + (set (match_dup 0) (plus:GPR (match_dup 0) (match_dup 4)))] { HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode); + HOST_WIDE_INT rest = trunc_int_for_mode (val - low, mode); - operands[3] = GEN_INT (rest); operands[4] = GEN_INT (low); -}") + if (mode == SImode || satisfies_constraint_L (GEN_INT (rest))) + operands[3] = GEN_INT (rest); + else if (! no_new_pseudos) + { + operands[3] = gen_reg_rtx (DImode); + emit_move_insn (operands[3], operands[2]); + emit_insn (gen_adddi3 (operands[0], operands[1], operands[3])); + DONE; + } + else + FAIL; +}) -(define_insn "one_cmplsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_insn "one_cmpl2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" "nor %0,%1,%1") (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 2 "=r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 2 "=r,r"))] + "" "@ nor. %2,%1,%1 #" @@ -1121,12 +1598,12 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 2 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 2 ""))] + "reload_completed" [(set (match_dup 2) - (not:SI (match_dup 1))) + (not:P (match_dup 1))) (set (match_dup 0) (compare:CC (match_dup 2) (const_int 0)))] @@ -1134,11 +1611,11 @@ (define_insn "" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (not:SI (match_dup 1)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (not:P (match_dup 1)))] + "" "@ nor. %0,%1,%1 #" @@ -1147,13 +1624,13 @@ (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (not:SI (match_dup 1)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (not:P (match_dup 1)))] + "reload_completed" [(set (match_dup 0) - (not:SI (match_dup 1))) + (not:P (match_dup 1))) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] @@ -1167,9 +1644,9 @@ "{sf%I1|subf%I1c} %0,%2,%1") (define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I") - (match_operand:SI 2 "gpc_reg_operand" "r,r")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") + (minus:GPR (match_operand:GPR 1 "reg_or_short_operand" "r,I") + (match_operand:GPR 2 "gpc_reg_operand" "r,r")))] "TARGET_POWERPC" "@ subf %0,%2,%1 @@ -1190,11 +1667,11 @@ (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "gpc_reg_operand" "r,r")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 3 "=r,r"))] - "TARGET_POWERPC && TARGET_32BIT" + (clobber (match_scratch:P 3 "=r,r"))] + "TARGET_POWERPC" "@ subf. %3,%2,%1 #" @@ -1203,13 +1680,13 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "gpc_reg_operand" "")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 3 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 3 ""))] + "reload_completed" [(set (match_dup 3) - (minus:SI (match_dup 1) + (minus:P (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) @@ -1232,13 +1709,13 @@ (define_insn "" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "gpc_reg_operand" "r,r")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (minus:SI (match_dup 1) + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (minus:P (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC && TARGET_32BIT" + "TARGET_POWERPC" "@ subf. %0,%2,%1 #" @@ -1247,32 +1724,32 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "gpc_reg_operand" "")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (minus:SI (match_dup 1) + (set (match_operand:P 0 "gpc_reg_operand" "") + (minus:P (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + "reload_completed" [(set (match_dup 0) - (minus:SI (match_dup 1) + (minus:P (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_expand "subsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (minus:SI (match_operand:SI 1 "reg_or_short_operand" "") - (match_operand:SI 2 "reg_or_arith_cint_operand" "")))] +(define_expand "sub3" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (minus:SDI (match_operand:SDI 1 "reg_or_short_operand" "") + (match_operand:SDI 2 "reg_or_sub_cint_operand" "")))] "" " { if (GET_CODE (operands[2]) == CONST_INT) { - emit_insn (gen_addsi3 (operands[0], operands[1], - negate_rtx (SImode, operands[2]))); + emit_insn (gen_add3 (operands[0], operands[1], + negate_rtx (mode, operands[2]))); DONE; } }") @@ -1555,18 +2032,24 @@ (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))] "") -(define_insn "negsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_expand "neg2" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (neg:SDI (match_operand:SDI 1 "gpc_reg_operand" "")))] + "" + "") + +(define_insn "*neg2_internal" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" "neg %0,%1") (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 2 "=r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 2 "=r,r"))] + "" "@ neg. %2,%1 #" @@ -1575,12 +2058,12 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 2 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 2 ""))] + "reload_completed" [(set (match_dup 2) - (neg:SI (match_dup 1))) + (neg:P (match_dup 1))) (set (match_dup 0) (compare:CC (match_dup 2) (const_int 0)))] @@ -1588,11 +2071,11 @@ (define_insn "" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (neg:SI (match_dup 1)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (neg:P (match_dup 1)))] + "" "@ neg. %0,%1 #" @@ -1601,56 +2084,85 @@ (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (neg:SI (match_dup 1)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (neg:P (match_dup 1)))] + "reload_completed" [(set (match_dup 0) - (neg:SI (match_dup 1))) + (neg:P (match_dup 1))) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_insn "clzsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (clz:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_insn "clz2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (clz:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" - "{cntlz|cntlzw} %0,%1") + "{cntlz|cntlz} %0,%1") -(define_expand "ctzsi2" +(define_expand "ctz2" [(set (match_dup 2) - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:SI (match_dup 1) - (match_dup 2))) + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r"))) + (parallel [(set (match_dup 3) (and:GPR (match_dup 1) + (match_dup 2))) (clobber (scratch:CC))]) - (set (match_dup 4) (clz:SI (match_dup 3))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r") - (minus:SI (const_int 31) (match_dup 4)))] + (set (match_dup 4) (clz:GPR (match_dup 3))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (minus:GPR (match_dup 5) (match_dup 4)))] "" { - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); - operands[4] = gen_reg_rtx (SImode); + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = gen_reg_rtx (mode); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode) - 1); }) - -(define_expand "ffssi2" + +(define_expand "ffs2" [(set (match_dup 2) - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:SI (match_dup 1) - (match_dup 2))) + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r"))) + (parallel [(set (match_dup 3) (and:GPR (match_dup 1) + (match_dup 2))) (clobber (scratch:CC))]) - (set (match_dup 4) (clz:SI (match_dup 3))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r") - (minus:SI (const_int 32) (match_dup 4)))] + (set (match_dup 4) (clz:GPR (match_dup 3))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (minus:GPR (match_dup 5) (match_dup 4)))] "" { - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); - operands[4] = gen_reg_rtx (SImode); + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = gen_reg_rtx (mode); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode)); }) - + +(define_expand "popcount2" + [(set (match_dup 2) + (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")] + UNSPEC_POPCNTB)) + (set (match_dup 3) + (mult:GPR (match_dup 2) (match_dup 4))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (lshiftrt:GPR (match_dup 3) (match_dup 5)))] + "TARGET_POPCNTB" + { + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = force_reg (mode, + mode == SImode + ? GEN_INT (0x01010101) + : GEN_INT ((HOST_WIDE_INT) + 0x01010101 << 32 | 0x01010101)); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode) - 8); + }) + +(define_insn "popcntb2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")] + UNSPEC_POPCNTB))] + "TARGET_POPCNTB" + "popcntb %0,%1") + (define_expand "mulsi3" [(use (match_operand:SI 0 "gpc_reg_operand" "")) (use (match_operand:SI 1 "gpc_reg_operand" "")) @@ -1674,10 +2186,10 @@ "@ {muls|mullw} %0,%1,%2 {muli|mulli} %0,%1,%2" - [(set (attr "type") + [(set (attr "type") (cond [(match_operand:SI 2 "s8bit_cint_operand" "") (const_string "imul3") - (match_operand:SI 2 "short_cint_operand" "") + (match_operand:SI 2 "short_cint_operand" "") (const_string "imul2")] (const_string "imul")))]) @@ -1689,10 +2201,10 @@ "@ {muls|mullw} %0,%1,%2 {muli|mulli} %0,%1,%2" - [(set (attr "type") + [(set (attr "type") (cond [(match_operand:SI 2 "s8bit_cint_operand" "") (const_string "imul3") - (match_operand:SI 2 "short_cint_operand" "") + (match_operand:SI 2 "short_cint_operand" "") (const_string "imul2")] (const_string "imul")))]) @@ -1848,10 +2360,10 @@ "divs %0,%1,%2" [(set_attr "type" "idiv")]) -(define_expand "udivsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "gpc_reg_operand" "")))] +(define_expand "udiv3" + [(set (match_operand:GPR 0 "gpc_reg_operand" "") + (udiv:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "gpc_reg_operand" "")))] "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)" " { @@ -1880,21 +2392,21 @@ [(set_attr "type" "idiv")]) (define_insn "*udivsi3_no_mq" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "gpc_reg_operand" "r")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (udiv:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "gpc_reg_operand" "r")))] "TARGET_POWERPC && ! TARGET_POWER" - "divwu %0,%1,%2" + "divu %0,%1,%2" [(set_attr "type" "idiv")]) ;; For powers of two we can do srai/aze for divide and then adjust for ;; modulus. If it isn't a power of two, FAIL on POWER so divmodsi4 will be ;; used; for PowerPC, force operands into register and do a normal divide; ;; for AIX common-mode, use quoss call on register operands. -(define_expand "divsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (div:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_cint_operand" "")))] +(define_expand "div3" + [(set (match_operand:GPR 0 "gpc_reg_operand" "") + (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "reg_or_cint_operand" "")))] "" " { @@ -1904,7 +2416,7 @@ ; else if (TARGET_POWERPC) { - operands[2] = force_reg (SImode, operands[2]); + operands[2] = force_reg (mode, operands[2]); if (TARGET_POWER) { emit_insn (gen_divsi3_mq (operands[0], operands[1], operands[2])); @@ -1932,18 +2444,18 @@ "divw %0,%1,%2" [(set_attr "type" "idiv")]) -(define_insn "*divsi3_no_mq" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (div:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "gpc_reg_operand" "r")))] +(define_insn "*div3_no_mq" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "gpc_reg_operand" "r")))] "TARGET_POWERPC && ! TARGET_POWER" - "divw %0,%1,%2" + "div %0,%1,%2" [(set_attr "type" "idiv")]) -(define_expand "modsi3" - [(use (match_operand:SI 0 "gpc_reg_operand" "")) - (use (match_operand:SI 1 "gpc_reg_operand" "")) - (use (match_operand:SI 2 "reg_or_cint_operand" ""))] +(define_expand "mod3" + [(use (match_operand:GPR 0 "gpc_reg_operand" "")) + (use (match_operand:GPR 1 "gpc_reg_operand" "")) + (use (match_operand:GPR 2 "reg_or_cint_operand" ""))] "" " { @@ -1956,45 +2468,47 @@ || (i = exact_log2 (INTVAL (operands[2]))) < 0) FAIL; - temp1 = gen_reg_rtx (SImode); - temp2 = gen_reg_rtx (SImode); + temp1 = gen_reg_rtx (mode); + temp2 = gen_reg_rtx (mode); - emit_insn (gen_divsi3 (temp1, operands[1], operands[2])); - emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i))); - emit_insn (gen_subsi3 (operands[0], operands[1], temp2)); + emit_insn (gen_div3 (temp1, operands[1], operands[2])); + emit_insn (gen_ashl3 (temp2, temp1, GEN_INT (i))); + emit_insn (gen_sub3 (operands[0], operands[1], temp2)); DONE; }") (define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (div:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "exact_log2_cint_operand" "N")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "exact_log2_cint_operand" "N")))] "" - "{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0" - [(set_attr "length" "8")]) + "{srai|srai} %0,%1,%p2\;{aze|addze} %0,%0" + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "exact_log2_cint_operand" "N,N")) + (compare:CC (div:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "exact_log2_cint_operand" "N,N")) (const_int 0))) - (clobber (match_scratch:SI 3 "=r,r"))] + (clobber (match_scratch:P 3 "=r,r"))] "" "@ - {srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3 + {srai|srai} %3,%1,%p2\;{aze.|addze.} %3,%3 #" [(set_attr "type" "compare") (set_attr "length" "8,12")]) (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "exact_log2_cint_operand" "")) + (compare:CC (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "exact_log2_cint_operand" + "")) (const_int 0))) - (clobber (match_scratch:SI 3 ""))] + (clobber (match_scratch:GPR 3 ""))] "reload_completed" [(set (match_dup 3) - (div:SI (match_dup 1) (match_dup 2))) + (div: (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] @@ -2002,28 +2516,29 @@ (define_insn "" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "exact_log2_cint_operand" "N,N")) + (compare:CC (div:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "exact_log2_cint_operand" "N,N")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (div:SI (match_dup 1) (match_dup 2)))] + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (div:P (match_dup 1) (match_dup 2)))] "" "@ - {srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0 + {srai|srai} %0,%1,%p2\;{aze.|addze.} %0,%0 #" [(set_attr "type" "compare") (set_attr "length" "8,12")]) (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "exact_log2_cint_operand" "")) + (compare:CC (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "exact_log2_cint_operand" + "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (div:SI (match_dup 1) (match_dup 2)))] + (set (match_operand:GPR 0 "gpc_reg_operand" "") + (div:GPR (match_dup 1) (match_dup 2)))] "reload_completed" [(set (match_dup 0) - (div:SI (match_dup 1) (match_dup 2))) + (div: (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] @@ -2215,7 +2730,8 @@ and %0,%1,%2 {rlinm|rlwinm} %0,%1,0,%m2,%M2 {andil.|andi.} %0,%1,%b2 - {andiu.|andis.} %0,%1,%u2") + {andiu.|andis.} %0,%1,%u2" + [(set_attr "type" "*,*,compare,compare")]) ;; Note to set cr's other than cr0 we do the and immediate and then ;; the test again -- this avoids a mfcr which on the higher end @@ -2263,15 +2779,15 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "and_operand" "")) + (compare:CC (and:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "and_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 3 "")) + (clobber (match_scratch:GPR 3 "")) (clobber (match_scratch:CC 4 ""))] "reload_completed" [(parallel [(set (match_dup 3) - (and:SI (match_dup 1) - (match_dup 2))) + (and: (match_dup 1) + (match_dup 2))) (clobber (match_dup 4))]) (set (match_dup 0) (compare:CC (match_dup 3) @@ -2515,7 +3031,7 @@ (const_int 0)))] "") -;; Split a logical operation that we can't do in one insn into two insns, +;; Split a logical operation that we can't do in one insn into two insns, ;; each of which does one 16-bit part. This is used by combine. (define_split @@ -2530,11 +3046,11 @@ { rtx i; i = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff)); - operands[4] = gen_rtx (GET_CODE (operands[3]), SImode, - operands[1], i); + operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[3]), SImode, + operands[1], i); i = GEN_INT (INTVAL (operands[2]) & 0xffff); - operands[5] = gen_rtx (GET_CODE (operands[3]), SImode, - operands[0], i); + operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), SImode, + operands[0], i); }") (define_insn "*boolcsi3_internal1" @@ -2873,9 +3389,12 @@ { /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the - compiler if the address of the structure is taken later. */ + compiler if the address of the structure is taken later. Likewise, do + not handle invalid E500 subregs. */ if (GET_CODE (operands[0]) == SUBREG - && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD)) + && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD + || ((TARGET_E500_DOUBLE || TARGET_SPE) + && invalid_e500_subreg (operands[0], GET_MODE (operands[0]))))) FAIL; if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode) @@ -2906,7 +3425,7 @@ [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r") (match_operand:SI 1 "const_int_operand" "i") (match_operand:SI 2 "const_int_operand" "i")) - (ashift:SI (match_operand:SI 3 "gpc_reg_operand" "r") + (rotate:SI (match_operand:SI 3 "gpc_reg_operand" "r") (match_operand:SI 4 "const_int_operand" "i")))] "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])" "* @@ -2981,6 +3500,45 @@ }" [(set_attr "type" "insert_word")]) +;; combine patterns for rlwimi +(define_insn "*insvsi_internal5" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (ior:SI (and:SI (match_operand:SI 4 "gpc_reg_operand" "0") + (match_operand:SI 1 "mask_operand" "i")) + (and:SI (lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r") + (match_operand:SI 2 "const_int_operand" "i")) + (match_operand:SI 5 "mask_operand" "i"))))] + "TARGET_POWERPC && INTVAL(operands[1]) == ~INTVAL(operands[5])" + "* +{ + int me = extract_ME(operands[5]); + int mb = extract_MB(operands[5]); + operands[4] = GEN_INT(32 - INTVAL(operands[2])); + operands[2] = GEN_INT(mb); + operands[1] = GEN_INT(me); + return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\"; +}" + [(set_attr "type" "insert_word")]) + +(define_insn "*insvsi_internal6" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (ior:SI (and:SI (lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r") + (match_operand:SI 2 "const_int_operand" "i")) + (match_operand:SI 5 "mask_operand" "i")) + (and:SI (match_operand:SI 4 "gpc_reg_operand" "0") + (match_operand:SI 1 "mask_operand" "i"))))] + "TARGET_POWERPC && INTVAL(operands[1]) == ~INTVAL(operands[5])" + "* +{ + int me = extract_ME(operands[5]); + int mb = extract_MB(operands[5]); + operands[4] = GEN_INT(32 - INTVAL(operands[2])); + operands[2] = GEN_INT(mb); + operands[1] = GEN_INT(me); + return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\"; +}" + [(set_attr "type" "insert_word")]) + (define_insn "insvdi" [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r") (match_operand:SI 1 "const_int_operand" "i") @@ -2996,6 +3554,46 @@ return \"rldimi %0,%3,%H1,%H2\"; }") +(define_insn "*insvdi_internal2" + [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r") + (match_operand:SI 1 "const_int_operand" "i") + (match_operand:SI 2 "const_int_operand" "i")) + (ashiftrt:DI (match_operand:DI 3 "gpc_reg_operand" "r") + (match_operand:SI 4 "const_int_operand" "i")))] + "TARGET_POWERPC64 + && insvdi_rshift_rlwimi_p (operands[1], operands[2], operands[4])" + "* +{ + int shift = INTVAL (operands[4]) & 63; + int start = (INTVAL (operands[2]) & 63) - 32; + int size = INTVAL (operands[1]) & 63; + + operands[4] = GEN_INT (64 - shift - start - size); + operands[2] = GEN_INT (start); + operands[1] = GEN_INT (start + size - 1); + return \"rlwimi %0,%3,%h4,%h2,%h1\"; +}") + +(define_insn "*insvdi_internal3" + [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r") + (match_operand:SI 1 "const_int_operand" "i") + (match_operand:SI 2 "const_int_operand" "i")) + (lshiftrt:DI (match_operand:DI 3 "gpc_reg_operand" "r") + (match_operand:SI 4 "const_int_operand" "i")))] + "TARGET_POWERPC64 + && insvdi_rshift_rlwimi_p (operands[1], operands[2], operands[4])" + "* +{ + int shift = INTVAL (operands[4]) & 63; + int start = (INTVAL (operands[2]) & 63) - 32; + int size = INTVAL (operands[1]) & 63; + + operands[4] = GEN_INT (64 - shift - start - size); + operands[2] = GEN_INT (start); + operands[1] = GEN_INT (start + size - 1); + return \"rlwimi %0,%3,%h4,%h2,%h1\"; +}") + (define_expand "extzv" [(set (match_operand 0 "gpc_reg_operand" "") (zero_extract (match_operand 1 "gpc_reg_operand" "") @@ -3183,7 +3781,8 @@ operands[3] = GEN_INT (start + size); operands[2] = GEN_INT (64 - size); return \"rldicl. %4,%1,%3,%2\"; -}") +}" + [(set_attr "type" "compare")]) (define_insn "*extzvdi_internal2" [(set (match_operand:CC 4 "gpc_reg_operand" "=x") @@ -3205,7 +3804,8 @@ operands[3] = GEN_INT (start + size); operands[2] = GEN_INT (64 - size); return \"rldicl. %0,%1,%3,%2\"; -}") +}" + [(set_attr "type" "compare")]) (define_insn "rotlsi3" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") @@ -3650,7 +4250,7 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "rlwinm" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r") (match_operand:SI 2 "const_int_operand" "i")) @@ -4317,20 +4917,35 @@ ;; this case, we just lose precision that we would have otherwise gotten but ;; is not guaranteed. Perhaps this should be tightened up at some point. -(define_insn "extendsfdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=f") - (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))] - "TARGET_HARD_FLOAT && TARGET_FPRS" - "* -{ - if (REGNO (operands[0]) == REGNO (operands[1])) - return \"\"; - else - return \"fmr %0,%1\"; -}" - [(set_attr "type" "fp")]) +(define_expand "extendsfdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (float_extend:DF (match_operand:SF 1 "reg_or_none500mem_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") -(define_insn "truncdfsf2" +(define_insn_and_split "*extendsfdf2_fpr" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f,f") + (float_extend:DF (match_operand:SF 1 "reg_or_mem_operand" "0,f,m")))] + "TARGET_HARD_FLOAT && TARGET_FPRS" + "@ + # + fmr %0,%1 + lfs%U1%X1 %0,%1" + "&& reload_completed && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1])" + [(const_int 0)] +{ + emit_note (NOTE_INSN_DELETED); + DONE; +} + [(set_attr "type" "fp,fp,fpload")]) + +(define_expand "truncdfsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "") + (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*truncdfsf2_fpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=f") (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "f")))] "TARGET_HARD_FLOAT && TARGET_FPRS" @@ -4446,12 +5061,26 @@ "{fm|fmul} %0,%1,%2" [(set_attr "type" "dmul")]) +(define_insn "fres" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f") + (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRES))] + "TARGET_PPC_GFXOPT && flag_finite_math_only" + "fres %0,%1" + [(set_attr "type" "fp")]) + (define_expand "divsf3" [(set (match_operand:SF 0 "gpc_reg_operand" "") (div:SF (match_operand:SF 1 "gpc_reg_operand" "") (match_operand:SF 2 "gpc_reg_operand" "")))] "TARGET_HARD_FLOAT" - "") +{ + if (swdiv && !optimize_size && TARGET_PPC_GFXOPT + && flag_finite_math_only && !flag_trapping_math) + { + rs6000_emit_swdivsf (operands[0], operands[1], operands[2]); + DONE; + } +}) (define_insn "" [(set (match_operand:SF 0 "gpc_reg_operand" "=f") @@ -4581,7 +5210,7 @@ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && ! HONOR_SIGNED_ZEROS (SFmode)" "{fnms|fnmsub} %0,%1,%2,%3" - [(set_attr "type" "fp")]) + [(set_attr "type" "dmul")]) (define_expand "sqrtsf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") @@ -4603,26 +5232,62 @@ "fsqrt %0,%1" [(set_attr "type" "dsqrt")]) +(define_expand "copysignsf3" + [(set (match_dup 3) + (abs:SF (match_operand:SF 1 "gpc_reg_operand" ""))) + (set (match_dup 4) + (neg:SF (abs:SF (match_dup 1)))) + (set (match_operand:SF 0 "gpc_reg_operand" "") + (if_then_else:SF (ge (match_operand:SF 2 "gpc_reg_operand" "") + (match_dup 5)) + (match_dup 3) + (match_dup 4)))] + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS + && !HONOR_NANS (SFmode) && !HONOR_SIGNED_ZEROS (SFmode)" + { + operands[3] = gen_reg_rtx (SFmode); + operands[4] = gen_reg_rtx (SFmode); + operands[5] = CONST0_RTX (SFmode); + }) + +(define_expand "copysigndf3" + [(set (match_dup 3) + (abs:DF (match_operand:DF 1 "gpc_reg_operand" ""))) + (set (match_dup 4) + (neg:DF (abs:DF (match_dup 1)))) + (set (match_operand:DF 0 "gpc_reg_operand" "") + (if_then_else:DF (ge (match_operand:DF 2 "gpc_reg_operand" "") + (match_dup 5)) + (match_dup 3) + (match_dup 4)))] + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS + && !HONOR_NANS (DFmode) && !HONOR_SIGNED_ZEROS (DFmode)" + { + operands[3] = gen_reg_rtx (DFmode); + operands[4] = gen_reg_rtx (DFmode); + operands[5] = CONST0_RTX (DFmode); + }) + ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a ;; fsel instruction and some auxiliary computations. Then we just have a ;; single DEFINE_INSN for fsel and the define_splits to make them if made by ;; combine. -(define_expand "maxsf3" +(define_expand "smaxsf3" [(set (match_operand:SF 0 "gpc_reg_operand" "") (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "") (match_operand:SF 2 "gpc_reg_operand" "")) (match_dup 1) (match_dup 2)))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}") -(define_expand "minsf3" +(define_expand "sminsf3" [(set (match_operand:SF 0 "gpc_reg_operand" "") (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "") (match_operand:SF 2 "gpc_reg_operand" "")) (match_dup 2) (match_dup 1)))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}") (define_split @@ -4630,10 +5295,10 @@ (match_operator:SF 3 "min_max_operator" [(match_operand:SF 1 "gpc_reg_operand" "") (match_operand:SF 2 "gpc_reg_operand" "")]))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" [(const_int 0)] " -{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]), +{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]), operands[1], operands[2]); DONE; }") @@ -4720,28 +5385,47 @@ "fsel %0,%1,%2,%3" [(set_attr "type" "fp")]) -(define_insn "negdf2" +(define_expand "negdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (neg:DF (match_operand:DF 1 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*negdf2_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (neg:DF (match_operand:DF 1 "gpc_reg_operand" "f")))] "TARGET_HARD_FLOAT && TARGET_FPRS" "fneg %0,%1" [(set_attr "type" "fp")]) -(define_insn "absdf2" +(define_expand "absdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (abs:DF (match_operand:DF 1 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*absdf2_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f")))] "TARGET_HARD_FLOAT && TARGET_FPRS" "fabs %0,%1" [(set_attr "type" "fp")]) -(define_insn "" +(define_insn "*nabsdf2_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f"))))] "TARGET_HARD_FLOAT && TARGET_FPRS" "fnabs %0,%1" [(set_attr "type" "fp")]) -(define_insn "adddf3" +(define_expand "adddf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (plus:DF (match_operand:DF 1 "gpc_reg_operand" "") + (match_operand:DF 2 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*adddf3_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (plus:DF (match_operand:DF 1 "gpc_reg_operand" "%f") (match_operand:DF 2 "gpc_reg_operand" "f")))] @@ -4749,7 +5433,14 @@ "{fa|fadd} %0,%1,%2" [(set_attr "type" "fp")]) -(define_insn "subdf3" +(define_expand "subdf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (minus:DF (match_operand:DF 1 "gpc_reg_operand" "") + (match_operand:DF 2 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*subdf3_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (minus:DF (match_operand:DF 1 "gpc_reg_operand" "f") (match_operand:DF 2 "gpc_reg_operand" "f")))] @@ -4757,7 +5448,14 @@ "{fs|fsub} %0,%1,%2" [(set_attr "type" "fp")]) -(define_insn "muldf3" +(define_expand "muldf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (mult:DF (match_operand:DF 1 "gpc_reg_operand" "") + (match_operand:DF 2 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" + "") + +(define_insn "*muldf3_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f") (match_operand:DF 2 "gpc_reg_operand" "f")))] @@ -4765,7 +5463,28 @@ "{fm|fmul} %0,%1,%2" [(set_attr "type" "dmul")]) -(define_insn "divdf3" +(define_insn "fred" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unspec:DF [(match_operand:DF 1 "gpc_reg_operand" "f")] UNSPEC_FRES))] + "TARGET_POPCNTB && flag_finite_math_only" + "fre %0,%1" + [(set_attr "type" "fp")]) + +(define_expand "divdf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (div:DF (match_operand:DF 1 "gpc_reg_operand" "") + (match_operand:DF 2 "gpc_reg_operand" "")))] + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" +{ + if (swdiv && !optimize_size && TARGET_POPCNTB + && flag_finite_math_only && !flag_trapping_math) + { + rs6000_emit_swdivdf (operands[0], operands[1], operands[2]); + DONE; + } +}) + +(define_insn "*divdf3_fpr" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (div:DF (match_operand:DF 1 "gpc_reg_operand" "f") (match_operand:DF 2 "gpc_reg_operand" "f")))] @@ -4826,7 +5545,7 @@ (minus:DF (match_operand:DF 3 "gpc_reg_operand" "f") (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f") (match_operand:DF 2 "gpc_reg_operand" "f"))))] - "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD + "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD && ! HONOR_SIGNED_ZEROS (DFmode)" "{fnms|fnmsub} %0,%1,%2,%3" [(set_attr "type" "dmul")]) @@ -4839,24 +5558,24 @@ [(set_attr "type" "dsqrt")]) ;; The conditional move instructions allow us to perform max and min -;; operations even when +;; operations even when -(define_expand "maxdf3" +(define_expand "smaxdf3" [(set (match_operand:DF 0 "gpc_reg_operand" "") (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "") (match_operand:DF 2 "gpc_reg_operand" "")) (match_dup 1) (match_dup 2)))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}") -(define_expand "mindf3" +(define_expand "smindf3" [(set (match_operand:DF 0 "gpc_reg_operand" "") (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "") (match_operand:DF 2 "gpc_reg_operand" "")) (match_dup 2) (match_dup 1)))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}") (define_split @@ -4864,10 +5583,10 @@ (match_operator:DF 3 "min_max_operator" [(match_operand:DF 1 "gpc_reg_operand" "") (match_operand:DF 2 "gpc_reg_operand" "")]))] - "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS && !flag_trapping_math" [(const_int 0)] " -{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]), +{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]), operands[1], operands[2]); DONE; }") @@ -4936,6 +5655,11 @@ "TARGET_HARD_FLOAT && TARGET_FPRS" " { + if (TARGET_E500_DOUBLE) + { + emit_insn (gen_spe_floatsidf2 (operands[0], operands[1])); + DONE; + } if (TARGET_POWERPC64) { rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); @@ -4952,7 +5676,7 @@ operands[6] = gen_reg_rtx (SImode); }") -(define_insn "*floatsidf2_internal" +(define_insn_and_split "*floatsidf2_internal" [(set (match_operand:DF 0 "gpc_reg_operand" "=&f") (float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) (use (match_operand:SI 2 "gpc_reg_operand" "r")) @@ -4962,45 +5686,29 @@ (clobber (match_operand:SI 6 "gpc_reg_operand" "=&r"))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "24")]) - -(define_split - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" "")) - (clobber (match_operand:SI 6 "gpc_reg_operand" ""))] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" "")) - (clobber (match_operand:SI 6 "gpc_reg_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[4]))" + [(pc)] " { rtx lowword, highword; - if (GET_CODE (operands[4]) != MEM) - abort(); - highword = XEXP (operands[4], 0); - lowword = plus_constant (highword, 4); + gcc_assert (MEM_P (operands[4])); + highword = adjust_address (operands[4], SImode, 0); + lowword = adjust_address (operands[4], SImode, 4); if (! WORDS_BIG_ENDIAN) { rtx tmp; tmp = highword; highword = lowword; lowword = tmp; } - emit_insn (gen_xorsi3 (operands[6], operands[1], + emit_insn (gen_xorsi3 (operands[6], operands[1], GEN_INT (~ (HOST_WIDE_INT) 0x7fffffff))); - emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[6]); - emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]); + emit_move_insn (lowword, operands[6]); + emit_move_insn (highword, operands[2]); emit_move_insn (operands[5], operands[4]); emit_insn (gen_subdf3 (operands[0], operands[5], operands[3])); DONE; -}") +}" + [(set_attr "length" "24")]) (define_expand "floatunssisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") @@ -5015,9 +5723,14 @@ (use (match_dup 3)) (clobber (match_dup 4)) (clobber (match_dup 5))])] - "TARGET_HARD_FLOAT && TARGET_FPRS" + "TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" " { + if (TARGET_E500_DOUBLE) + { + emit_insn (gen_spe_floatunssidf2 (operands[0], operands[1])); + DONE; + } if (TARGET_POWERPC64) { rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); @@ -5034,7 +5747,7 @@ operands[5] = gen_reg_rtx (DFmode); }") -(define_insn "*floatunssidf2_internal" +(define_insn_and_split "*floatunssidf2_internal" [(set (match_operand:DF 0 "gpc_reg_operand" "=&f") (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) (use (match_operand:SI 2 "gpc_reg_operand" "r")) @@ -5043,100 +5756,173 @@ (clobber (match_operand:DF 5 "gpc_reg_operand" "=&f"))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "20")]) - -(define_split - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" ""))] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[4]))" + [(pc)] " { rtx lowword, highword; - if (GET_CODE (operands[4]) != MEM) - abort(); - highword = XEXP (operands[4], 0); - lowword = plus_constant (highword, 4); + gcc_assert (MEM_P (operands[4])); + highword = adjust_address (operands[4], SImode, 0); + lowword = adjust_address (operands[4], SImode, 4); if (! WORDS_BIG_ENDIAN) { rtx tmp; tmp = highword; highword = lowword; lowword = tmp; } - emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[1]); - emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]); + emit_move_insn (lowword, operands[1]); + emit_move_insn (highword, operands[2]); emit_move_insn (operands[5], operands[4]); emit_insn (gen_subdf3 (operands[0], operands[5], operands[3])); DONE; -}") +}" + [(set_attr "length" "20")]) (define_expand "fix_truncdfsi2" - [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "") + [(parallel [(set (match_operand:SI 0 "fix_trunc_dest_operand" "") (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) (clobber (match_dup 2)) (clobber (match_dup 3))])] - "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" + "(TARGET_POWER2 || TARGET_POWERPC) + && TARGET_HARD_FLOAT && (TARGET_FPRS || TARGET_E500_DOUBLE)" " { + if (TARGET_E500_DOUBLE) + { + emit_insn (gen_spe_fix_truncdfsi2 (operands[0], operands[1])); + DONE; + } operands[2] = gen_reg_rtx (DImode); + if (TARGET_PPC_GFXOPT) + { + rtx orig_dest = operands[0]; + if (! memory_operand (orig_dest, GET_MODE (orig_dest))) + operands[0] = assign_stack_temp (SImode, GET_MODE_SIZE (SImode), 0); + emit_insn (gen_fix_truncdfsi2_internal_gfxopt (operands[0], operands[1], + operands[2])); + if (operands[0] != orig_dest) + emit_move_insn (orig_dest, operands[0]); + DONE; + } operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); }") -(define_insn "*fix_truncdfsi2_internal" +(define_insn_and_split "*fix_truncdfsi2_internal" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))) (clobber (match_operand:DI 2 "gpc_reg_operand" "=f")) (clobber (match_operand:DI 3 "memory_operand" "=o"))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "16")]) - -(define_split - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) - (clobber (match_operand:DI 2 "gpc_reg_operand" "")) - (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))] - "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) - (clobber (match_operand:DI 2 "gpc_reg_operand" "")) - (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[3]))" + [(pc)] " { rtx lowword; - if (GET_CODE (operands[3]) != MEM) - abort(); - lowword = XEXP (operands[3], 0); - if (WORDS_BIG_ENDIAN) - lowword = plus_constant (lowword, 4); + gcc_assert (MEM_P (operands[3])); + lowword = adjust_address (operands[3], SImode, WORDS_BIG_ENDIAN ? 4 : 0); emit_insn (gen_fctiwz (operands[2], operands[1])); emit_move_insn (operands[3], operands[2]); - emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword)); + emit_move_insn (operands[0], lowword); DONE; -}") +}" + [(set_attr "length" "16")]) + +(define_insn_and_split "fix_truncdfsi2_internal_gfxopt" + [(set (match_operand:SI 0 "memory_operand" "=Z") + (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))) + (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))] + "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS + && TARGET_PPC_GFXOPT" + "#" + "&& 1" + [(pc)] + " +{ + emit_insn (gen_fctiwz (operands[2], operands[1])); + emit_insn (gen_stfiwx (operands[0], operands[2])); + DONE; +}" + [(set_attr "length" "16")]) ; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] UNSPEC_FCTIWZ)) ; rather than (set (subreg:SI (reg)) (fix:SI ...)) ; because the first makes it clear that operand 0 is not live ; before the instruction. (define_insn "fctiwz" - [(set (match_operand:DI 0 "gpc_reg_operand" "=*f") + [(set (match_operand:DI 0 "gpc_reg_operand" "=f") (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] UNSPEC_FCTIWZ))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" "{fcirz|fctiwz} %0,%1" [(set_attr "type" "fp")]) +(define_insn "btruncdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unspec:DF [(match_operand:DF 1 "gpc_reg_operand" "f")] UNSPEC_FRIZ))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "friz %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "btruncsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f") + (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRIZ))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "friz %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "ceildf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unspec:DF [(match_operand:DF 1 "gpc_reg_operand" "f")] UNSPEC_FRIP))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frip %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "ceilsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f") + (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRIP))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frip %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "floordf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unspec:DF [(match_operand:DF 1 "gpc_reg_operand" "f")] UNSPEC_FRIM))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frim %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "floorsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f") + (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRIM))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frim %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "rounddf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=f") + (unspec:DF [(match_operand:DF 1 "gpc_reg_operand" "f")] UNSPEC_FRIN))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frin %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "roundsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "=f") + (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] UNSPEC_FRIN))] + "TARGET_FPRND && TARGET_HARD_FLOAT && TARGET_FPRS" + "frin %0,%1" + [(set_attr "type" "fp")]) + +; An UNSPEC is used so we don't have to support SImode in FP registers. +(define_insn "stfiwx" + [(set (match_operand:SI 0 "memory_operand" "=Z") + (unspec:SI [(match_operand:DI 1 "gpc_reg_operand" "f")] + UNSPEC_STFIWX))] + "TARGET_PPC_GFXOPT" + "stfiwx %1,%y0" + [(set_attr "type" "fpstore")]) + (define_expand "floatsisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") (float:SF (match_operand:SI 1 "gpc_reg_operand" "")))] @@ -5275,7 +6061,8 @@ ? \"{a|addc} %0,%1,%2\;{ae|adde} %L0,%L1,%L2\" : \"{ai|addic} %0,%1,%2\;{a%G2e|add%G2e} %L0,%L1\"; }" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "*subdi3_noppc64" [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r") @@ -5293,7 +6080,8 @@ ? \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\" : \"{sfi|subfic} %0,%2,%1\;{sf%G1e|subf%G1e} %L0,%L2\"; }" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "*negdi2_noppc64" [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r") @@ -5305,7 +6093,8 @@ ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\" : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\"; }" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_expand "mulsidi3" [(set (match_operand:DI 0 "gpc_reg_operand" "") @@ -5588,11 +6377,12 @@ "@ {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2 {sri|srwi} %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;{srai|srawi} %0,%1,%h2" - [(set_attr "length" "8,12")]) + [(set_attr "type" "two,three") + (set_attr "length" "8,12")]) (define_insn "*ashrdisi3_noppc64" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (subreg:SI (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r") + (subreg:SI (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r") (const_int 32)) 4))] "TARGET_32BIT && !TARGET_POWERPC64" "* @@ -5602,289 +6392,11 @@ else return \"mr %0,%1\"; }" - [(set_attr "length" "4")]) + [(set_attr "length" "4")]) ;; PowerPC64 DImode operations. -(define_expand "adddi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_add_cint64_operand" "")))] - "" - " -{ - if (! TARGET_POWERPC64) - { - if (non_short_cint_operand (operands[2], DImode)) - FAIL; - } - else - if (GET_CODE (operands[2]) == CONST_INT - && ! add_operand (operands[2], DImode)) - { - rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) - ? operands[0] : gen_reg_rtx (DImode)); - - HOST_WIDE_INT val = INTVAL (operands[2]); - HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode); - - if (!CONST_OK_FOR_LETTER_P (rest, 'L')) - FAIL; - - /* The ordering here is important for the prolog expander. - When space is allocated from the stack, adding 'low' first may - produce a temporary deallocation (which would be bad). */ - emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest))); - emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low))); - DONE; - } -}") - -;; Discourage ai/addic because of carry but provide it in an alternative -;; allowing register zero as source. - -(define_insn "*adddi3_internal1" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b") - (match_operand:DI 2 "add_operand" "r,I,I,L")))] - "TARGET_POWERPC64" - "@ - add %0,%1,%2 - addi %0,%1,%2 - addic %0,%1,%2 - addis %0,%1,%v2") - -(define_insn "*adddi3_internal2" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")) - (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r,r,r"))] - "TARGET_64BIT" - "@ - add. %3,%1,%2 - addic. %3,%1,%2 - # - #" - [(set_attr "type" "fast_compare,compare,compare,compare") - (set_attr "length" "4,4,8,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 3) - (plus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") - -(define_insn "*adddi3_internal3" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - add. %0,%1,%2 - addic. %0,%1,%2 - # - #" - [(set_attr "type" "fast_compare,compare,compare,compare") - (set_attr "length" "4,4,8,8")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (plus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -;; Split an add that we can't do in one insn into two insns, each of which -;; does one 16-bit part. This is used by combine. Note that the low-order -;; add should be last in case the result gets used in an address. - -(define_split - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "non_add_cint_operand" "")))] - "TARGET_POWERPC64" - [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3))) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] -" -{ - HOST_WIDE_INT val = INTVAL (operands[2]); - HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode); - - operands[4] = GEN_INT (low); - if (CONST_OK_FOR_LETTER_P (rest, 'L')) - operands[3] = GEN_INT (rest); - else if (! no_new_pseudos) - { - operands[3] = gen_reg_rtx (DImode); - emit_move_insn (operands[3], operands[2]); - emit_insn (gen_adddi3 (operands[0], operands[1], operands[3])); - DONE; - } - else - FAIL; -}") - -(define_insn "one_cmpldi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "nor %0,%1,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - nor. %2,%1,%1 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (not:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (not:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - nor. %0,%1,%1 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (not:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (not:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I") - (match_operand:DI 2 "gpc_reg_operand" "r,r")))] - "TARGET_POWERPC64" - "@ - subf %0,%2,%1 - subfic %0,%2,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r"))] - "TARGET_64BIT" - "@ - subf. %3,%2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 3) - (minus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (minus:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subf. %0,%2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (minus:DI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (minus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_expand "subdi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (minus:DI (match_operand:DI 1 "reg_or_short_operand" "") - (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))] - "" - " -{ - if (GET_CODE (operands[2]) == CONST_INT) - { - emit_insn (gen_adddi3 (operands[0], operands[1], - negate_rtx (DImode, operands[2]))); - DONE; - } -}") - (define_insn_and_split "absdi2" [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r") (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))) @@ -5909,115 +6421,20 @@ (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))] "") -(define_expand "negdi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))] - "" - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "neg %0,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - neg. %2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (neg:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (neg:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - neg. %0,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (neg:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (neg:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "clzdi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (clz:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "cntlzd %0,%1") - -(define_expand "ctzdi2" - [(set (match_dup 2) - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:DI (match_dup 1) - (match_dup 2))) - (clobber (scratch:CC))]) - (set (match_dup 4) (clz:DI (match_dup 3))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r") - (minus:DI (const_int 63) (match_dup 4)))] - "TARGET_POWERPC64" - { - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_reg_rtx (DImode); - operands[4] = gen_reg_rtx (DImode); - }) - -(define_expand "ffsdi2" - [(set (match_dup 2) - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:DI (match_dup 1) - (match_dup 2))) - (clobber (scratch:CC))]) - (set (match_dup 4) (clz:DI (match_dup 3))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r") - (minus:DI (const_int 64) (match_dup 4)))] - "TARGET_POWERPC64" - { - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_reg_rtx (DImode); - operands[4] = gen_reg_rtx (DImode); - }) - (define_insn "muldi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r") - (match_operand:DI 2 "gpc_reg_operand" "r")))] + [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") + (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r") + (match_operand:DI 2 "reg_or_short_operand" "r,I")))] "TARGET_POWERPC64" - "mulld %0,%1,%2" - [(set_attr "type" "lmul")]) + "@ + mulld %0,%1,%2 + mulli %0,%1,%2" + [(set (attr "type") + (cond [(match_operand:SI 2 "s8bit_cint_operand" "") + (const_string "imul3") + (match_operand:SI 2 "short_cint_operand" "") + (const_string "imul2")] + (const_string "lmul")))]) (define_insn "*muldi3_internal1" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -6099,126 +6516,6 @@ "mulhdu %0,%1,%2" [(set_attr "type" "lmul")]) -(define_expand "divdi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (div:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_cint_operand" "")))] - "TARGET_POWERPC64" - " -{ - if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 0 - && exact_log2 (INTVAL (operands[2])) >= 0) - ; - else - operands[2] = force_reg (DImode, operands[2]); -}") - -(define_expand "moddi3" - [(use (match_operand:DI 0 "gpc_reg_operand" "")) - (use (match_operand:DI 1 "gpc_reg_operand" "")) - (use (match_operand:DI 2 "reg_or_cint_operand" ""))] - "TARGET_POWERPC64" - " -{ - int i; - rtx temp1; - rtx temp2; - - if (GET_CODE (operands[2]) != CONST_INT - || INTVAL (operands[2]) <= 0 - || (i = exact_log2 (INTVAL (operands[2]))) < 0) - FAIL; - - temp1 = gen_reg_rtx (DImode); - temp2 = gen_reg_rtx (DImode); - - emit_insn (gen_divdi3 (temp1, operands[1], operands[2])); - emit_insn (gen_ashldi3 (temp2, temp1, GEN_INT (i))); - emit_insn (gen_subdi3 (operands[0], operands[1], temp2)); - DONE; -}") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (div:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "exact_log2_cint_operand" "N")))] - "TARGET_POWERPC64" - "sradi %0,%1,%p2\;addze %0,%0" - [(set_attr "length" "8")]) - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "exact_log2_cint_operand" "N,N")) - (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r"))] - "TARGET_64BIT" - "@ - sradi %3,%1,%p2\;addze. %3,%3 - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "exact_log2_cint_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 3) - (div:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "exact_log2_cint_operand" "N,N")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (div:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - sradi %0,%1,%p2\;addze. %0,%0 - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "exact_log2_cint_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (div:DI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (div:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (div:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "divd %0,%1,%2" - [(set_attr "type" "ldiv")]) - -(define_insn "udivdi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (udiv:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "divdu %0,%1,%2" - [(set_attr "type" "ldiv")]) - (define_insn "rotldi3" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r") @@ -6604,9 +6901,8 @@ (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r") (match_operand:SI 2 "reg_or_cint_operand" "ri")))] "TARGET_POWERPC64" - "sld%I2 %0,%1,%H2" - [(set_attr "length" "8")]) - + "sld%I2 %0,%1,%H2") + (define_insn "*ashldi3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") @@ -6619,7 +6915,7 @@ #" [(set_attr "type" "delayed_compare") (set_attr "length" "4,8")]) - + (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "") @@ -6683,7 +6979,7 @@ "@ rldic. %4,%1,%H2,%W3 #" - [(set_attr "type" "delayed_compare") + [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split @@ -6717,7 +7013,7 @@ "@ rldic. %0,%1,%H2,%W3 #" - [(set_attr "type" "delayed_compare") + [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split @@ -6759,7 +7055,7 @@ "@ rldicr. %4,%1,%H2,%S3 #" - [(set_attr "type" "delayed_compare") + [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split @@ -6793,7 +7089,7 @@ "@ rldicr. %0,%1,%H2,%S3 #" - [(set_attr "type" "delayed_compare") + [(set_attr "type" "compare") (set_attr "length" "4,8")]) (define_split @@ -6984,18 +7280,20 @@ "") (define_insn "anddi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r") - (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r") - (match_operand:DI 2 "and64_2_operand" "?r,S,K,J,t"))) - (clobber (match_scratch:CC 3 "=X,X,x,x,X"))] + [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r") + (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r") + (match_operand:DI 2 "and64_2_operand" "?r,S,T,K,J,t"))) + (clobber (match_scratch:CC 3 "=X,X,X,x,x,X"))] "TARGET_POWERPC64" "@ and %0,%1,%2 rldic%B2 %0,%1,0,%S2 + rlwinm %0,%1,0,%m2,%M2 andi. %0,%1,%b2 andis. %0,%1,%u2 #" - [(set_attr "length" "4,4,4,4,8")]) + [(set_attr "type" "*,*,*,compare,compare,*") + (set_attr "length" "4,4,4,4,4,8")]) (define_split [(set (match_operand:DI 0 "gpc_reg_operand" "") @@ -7004,6 +7302,7 @@ (clobber (match_scratch:CC 3 ""))] "TARGET_POWERPC64 && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode)) + && !mask_operand (operands[2], DImode) && !mask64_operand (operands[2], DImode)" [(set (match_dup 0) (and:DI (rotate:DI (match_dup 1) @@ -7013,22 +7312,22 @@ (and:DI (rotate:DI (match_dup 0) (match_dup 6)) (match_dup 7)))] - " { build_mask64_2_operands (operands[2], &operands[4]); -}") +}) (define_insn "*anddi3_internal2" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,??y,??y,?y") - (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:DI 2 "and64_2_operand" "r,S,K,J,t,r,S,K,J,t")) + [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,x,?y,?y,?y,??y,??y,?y") + (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r,r,r") + (match_operand:DI 2 "and64_2_operand" "r,S,T,K,J,t,r,S,T,K,J,t")) (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r,r,r,r,r,r,r,r,r")) - (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,x,x,X"))] + (clobber (match_scratch:DI 3 "=r,r,r,r,r,r,r,r,r,r,r,r")) + (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,X,X,x,x,X"))] "TARGET_64BIT" "@ and. %3,%1,%2 rldic%B2. %3,%1,0,%S2 + rlwinm. %3,%1,0,%m2,%M2 andi. %3,%1,%b2 andis. %3,%1,%u2 # @@ -7036,26 +7335,10 @@ # # # + # #" - [(set_attr "type" "compare,delayed_compare,compare,compare,delayed_compare,compare,compare,compare,compare,compare") - (set_attr "length" "4,4,4,4,8,8,8,8,8,12")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "and64_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 "")) - (clobber (match_scratch:CC 4 ""))] - "TARGET_POWERPC64 && reload_completed" - [(parallel [(set (match_dup 3) - (and:DI (match_dup 1) - (match_dup 2))) - (clobber (match_dup 4))]) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") + [(set_attr "type" "compare,compare,compare,compare,compare,compare,compare,compare,compare,compare,compare,compare") + (set_attr "length" "4,4,4,4,4,8,8,8,8,8,8,12")]) (define_split [(set (match_operand:CC 0 "cc_reg_operand" "") @@ -7064,8 +7347,9 @@ (const_int 0))) (clobber (match_scratch:DI 3 "")) (clobber (match_scratch:CC 4 ""))] - "TARGET_POWERPC64 && reload_completed + "TARGET_64BIT && reload_completed && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode)) + && !mask_operand (operands[2], DImode) && !mask64_operand (operands[2], DImode)" [(set (match_dup 3) (and:DI (rotate:DI (match_dup 1) @@ -7083,17 +7367,18 @@ }") (define_insn "*anddi3_internal3" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,x,?y,?y,??y,??y,?y") - (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:DI 2 "and64_2_operand" "r,S,K,J,t,r,S,K,J,t")) + [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,x,x,?y,?y,?y,??y,??y,?y") + (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r,r,r") + (match_operand:DI 2 "and64_2_operand" "r,S,T,K,J,t,r,S,T,K,J,t")) (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r") + (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r,r,r") (and:DI (match_dup 1) (match_dup 2))) - (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,x,x,X"))] + (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,X,X,x,x,X"))] "TARGET_64BIT" "@ and. %0,%1,%2 rldic%B2. %0,%1,0,%S2 + rlwinm. %0,%1,0,%m2,%M2 andi. %0,%1,%b2 andis. %0,%1,%u2 # @@ -7101,19 +7386,20 @@ # # # + # #" - [(set_attr "type" "compare,delayed_compare,compare,compare,delayed_compare,compare,compare,compare,compare,compare") - (set_attr "length" "4,4,4,4,8,8,8,8,8,12")]) + [(set_attr "type" "compare,compare,compare,compare,compare,compare,compare,compare,compare,compare,compare,compare") + (set_attr "length" "4,4,4,4,4,8,8,8,8,8,8,12")]) (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "and64_operand" "")) + (match_operand:DI 2 "and64_2_operand" "")) (const_int 0))) (set (match_operand:DI 0 "gpc_reg_operand" "") (and:DI (match_dup 1) (match_dup 2))) (clobber (match_scratch:CC 4 ""))] - "TARGET_POWERPC64 && reload_completed" + "TARGET_64BIT && reload_completed" [(parallel [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 2))) (clobber (match_dup 4))]) @@ -7130,8 +7416,9 @@ (set (match_operand:DI 0 "gpc_reg_operand" "") (and:DI (match_dup 1) (match_dup 2))) (clobber (match_scratch:CC 4 ""))] - "TARGET_POWERPC64 && reload_completed + "TARGET_64BIT && reload_completed && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode)) + && !mask_operand (operands[2], DImode) && !mask64_operand (operands[2], DImode)" [(set (match_dup 0) (and:DI (rotate:DI (match_dup 1) @@ -7286,7 +7573,7 @@ (const_int 0)))] "") -;; Split a logical operation that we can't do in one insn into two insns, +;; Split a logical operation that we can't do in one insn into two insns, ;; each of which does one 16-bit part. This is used by combine. (define_split @@ -7300,7 +7587,7 @@ " { rtx i3,i4; - + if (GET_CODE (operands[2]) == CONST_DOUBLE) { HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]); @@ -7314,10 +7601,10 @@ & (~ (HOST_WIDE_INT) 0xffff)); i4 = GEN_INT (INTVAL (operands[2]) & 0xffff); } - operands[4] = gen_rtx (GET_CODE (operands[3]), DImode, - operands[1], i3); - operands[5] = gen_rtx (GET_CODE (operands[3]), DImode, - operands[0], i4); + operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[3]), DImode, + operands[1], i3); + operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[3]), DImode, + operands[0], i4); }") (define_insn "*boolcdi3_internal1" @@ -7454,41 +7741,6 @@ ;; Now define ways of moving data around. -;; Elf specific ways of loading addresses for non-PIC code. -;; The output of this could be r0, but we make a very strong -;; preference for a base register because it will usually -;; be needed there. -(define_insn "elf_high" - [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r") - (high:SI (match_operand 1 "" "")))] - "TARGET_ELF && ! TARGET_64BIT" - "{liu|lis} %0,%1@ha") - -(define_insn "elf_low" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r") - (match_operand 2 "" "")))] - "TARGET_ELF && ! TARGET_64BIT" - "@ - {cal|la} %0,%2@l(%1) - {ai|addic} %0,%1,%K2") - -;; Mach-O PIC trickery. -(define_insn "macho_high" - [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r") - (high:SI (match_operand 1 "" "")))] - "TARGET_MACHO && ! TARGET_64BIT" - "{liu|lis} %0,ha16(%1)") - -(define_insn "macho_low" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r") - (match_operand 2 "" "")))] - "TARGET_MACHO && ! TARGET_64BIT" - "@ - {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)} - {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}") - ;; Set up a register with a value from the GOT table (define_expand "movsi_got" @@ -7528,7 +7780,7 @@ ;; Used by sched, shorten_branches and final when the GOT pseudo reg ;; didn't get allocated to a hard register. -(define_split +(define_split [(set (match_operand:SI 0 "gpc_reg_operand" "") (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "") (match_operand:SI 2 "memory_operand" "")] @@ -7545,12 +7797,6 @@ ;; do the load 16-bits at a time. We could do this by loading from memory, ;; and this is even supposed to be faster, but it is simpler not to get ;; integers in the TOC. -(define_expand "movsi" - [(set (match_operand:SI 0 "general_operand" "") - (match_operand:SI 1 "any_operand" ""))] - "" - "{ rs6000_emit_move (operands[0], operands[1], SImode); DONE; }") - (define_insn "movsi_low" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") @@ -7560,90 +7806,8 @@ [(set_attr "type" "load") (set_attr "length" "4")]) -(define_insn "movsi_low_st" - [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") - (match_operand 2 "" ""))) - (match_operand:SI 0 "gpc_reg_operand" "r"))] - "TARGET_MACHO && ! TARGET_64BIT" - "{st|stw} %0,lo16(%2)(%1)" - [(set_attr "type" "store") - (set_attr "length" "4")]) - -(define_insn "movdf_low" - [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r") - (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") - (match_operand 2 "" ""))))] - "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" - "* -{ - switch (which_alternative) - { - case 0: - return \"lfd %0,lo16(%2)(%1)\"; - case 1: - { - rtx operands2[4]; - operands2[0] = operands[0]; - operands2[1] = operands[1]; - operands2[2] = operands[2]; - if (TARGET_POWERPC64 && TARGET_32BIT) - /* Note, old assemblers didn't support relocation here. */ - return \"ld %0,lo16(%2)(%1)\"; - else - { - operands2[3] = gen_rtx_REG (SImode, RS6000_PIC_OFFSET_TABLE_REGNUM); - output_asm_insn (\"{l|lwz} %0,lo16(%2)(%1)\", operands); -#if TARGET_MACHO - if (MACHO_DYNAMIC_NO_PIC_P) - output_asm_insn (\"{liu|lis} %L0,ha16(%2+4)\", operands); - else - /* We cannot rely on ha16(low half)==ha16(high half), alas, - although in practice it almost always is. */ - output_asm_insn (\"{cau|addis} %L0,%3,ha16(%2+4)\", operands2); -#endif - return (\"{l|lwz} %L0,lo16(%2+4)(%L0)\"); - } - } - default: - abort(); - } -}" - [(set_attr "type" "load") - (set_attr "length" "4,12")]) - -(define_insn "movdf_low_st" - [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") - (match_operand 2 "" ""))) - (match_operand:DF 0 "gpc_reg_operand" "f"))] - "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" - "stfd %0,lo16(%2)(%1)" - [(set_attr "type" "store") - (set_attr "length" "4")]) - -(define_insn "movsf_low" - [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r") - (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") - (match_operand 2 "" ""))))] - "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" - "@ - lfs %0,lo16(%2)(%1) - {l|lwz} %0,lo16(%2)(%1)" - [(set_attr "type" "load") - (set_attr "length" "4")]) - -(define_insn "movsf_low_st" - [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b") - (match_operand 2 "" ""))) - (match_operand:SF 0 "gpc_reg_operand" "f,!r"))] - "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT" - "@ - stfs %0,lo16(%2)(%1) - {st|stw} %0,lo16(%2)(%1)" - [(set_attr "type" "store") - (set_attr "length" "4")]) - (define_insn "*movsi_internal1" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h") + [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h") (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0"))] "gpc_reg_operand (operands[0], SImode) || gpc_reg_operand (operands[1], SImode)" @@ -7686,14 +7850,14 @@ FAIL; }") -(define_insn "*movsi_internal2" +(define_insn "*mov_internal2" [(set (match_operand:CC 2 "cc_reg_operand" "=y,x,?y") - (compare:CC (match_operand:SI 1 "gpc_reg_operand" "0,r,r") + (compare:CC (match_operand:P 1 "gpc_reg_operand" "0,r,r") (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r") (match_dup 1))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r,r") (match_dup 1))] + "" "@ - {cmpi|cmpwi} %2,%0,0 + {cmpi|cmpi} %2,%0,0 mr. %0,%1 #" [(set_attr "type" "cmp,compare,cmp") @@ -7701,22 +7865,16 @@ (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (match_operand:SI 1 "gpc_reg_operand" "") + (compare:CC (match_operand:P 1 "gpc_reg_operand" "") (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") (match_dup 1))] + "reload_completed" [(set (match_dup 0) (match_dup 1)) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_expand "movhi" - [(set (match_operand:HI 0 "general_operand" "") - (match_operand:HI 1 "any_operand" ""))] - "" - "{ rs6000_emit_move (operands[0], operands[1], HImode); DONE; }") - (define_insn "*movhi_internal" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h") (match_operand:HI 1 "input_operand" "r,m,r,i,*h,r,r,0"))] @@ -7733,11 +7891,11 @@ {cror 0,0,0|nop}" [(set_attr "type" "*,load,store,*,mfjmpr,*,mtjmpr,*")]) -(define_expand "movqi" - [(set (match_operand:QI 0 "general_operand" "") - (match_operand:QI 1 "any_operand" ""))] +(define_expand "mov" + [(set (match_operand:INT 0 "general_operand" "") + (match_operand:INT 1 "any_operand" ""))] "" - "{ rs6000_emit_move (operands[0], operands[1], QImode); DONE; }") + "{ rs6000_emit_move (operands[0], operands[1], mode); DONE; }") (define_insn "*movqi_internal" [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h") @@ -7765,42 +7923,44 @@ "") (define_insn "*movcc_internal1" - [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,?y,r,r,r,r,q,cl,r,m") - (match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,h,r,r,m,r"))] + [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,?y,y,r,r,r,r,r,q,cl,r,m") + (match_operand:CC 1 "general_operand" "y,r,r,O,x,y,r,I,h,r,r,m,r"))] "register_operand (operands[0], CCmode) || register_operand (operands[1], CCmode)" "@ mcrf %0,%1 mtcrf 128,%1 {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff + crxor %0,%0,%0 mfcr %0%Q1 mfcr %0%Q1\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000 mr %0,%1 + {lil|li} %0,%1 mf%1 %0 mt%0 %1 mt%0 %1 {l%U1%X1|lwz%U1%X1} %0,%1 {st%U0%U1|stw%U0%U1} %1,%0" [(set (attr "type") - (cond [(eq_attr "alternative" "0") + (cond [(eq_attr "alternative" "0,3") (const_string "cr_logical") (eq_attr "alternative" "1,2") (const_string "mtcr") - (eq_attr "alternative" "5,7") + (eq_attr "alternative" "6,7,9") (const_string "integer") - (eq_attr "alternative" "6") - (const_string "mfjmpr") (eq_attr "alternative" "8") - (const_string "mtjmpr") - (eq_attr "alternative" "9") - (const_string "load") + (const_string "mfjmpr") (eq_attr "alternative" "10") + (const_string "mtjmpr") + (eq_attr "alternative" "11") + (const_string "load") + (eq_attr "alternative" "12") (const_string "store") (ne (symbol_ref "TARGET_MFCRF") (const_int 0)) (const_string "mfcrf") ] (const_string "mfcr"))) - (set_attr "length" "4,4,12,4,8,4,4,4,4,4,4")]) + (set_attr "length" "4,4,12,4,4,8,4,4,4,4,4,4,4")]) ;; For floating-point, we normally deal with the floating-point registers ;; unless -msoft-float is used. The sole exception is that parameter passing @@ -7839,7 +7999,7 @@ }") (define_insn "*movsf_hardfloat" - [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!cl,!q,!r,!h,!r,!r") + [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,*c*l,*q,!r,*h,!r,!r") (match_operand:SF 1 "input_operand" "r,m,r,f,m,f,r,r,h,0,G,Fn"))] "(gpc_reg_operand (operands[0], SFmode) || gpc_reg_operand (operands[1], SFmode)) @@ -7857,7 +8017,7 @@ {cror 0,0,0|nop} # #" - [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,mtjmpr,*,*,*,*") + [(set_attr "type" "*,load,store,fp,fpload,fpstore,mtjmpr,*,mfjmpr,*,*,*") (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,8")]) (define_insn "*movsf_softfloat" @@ -7879,7 +8039,7 @@ # # {cror 0,0,0|nop}" - [(set_attr "type" "*,mtjmpr,*,*,load,store,*,*,*,*,*,*") + [(set_attr "type" "*,mtjmpr,*,mfjmpr,load,store,*,*,*,*,*,*") (set_attr "length" "4,4,4,4,4,4,4,4,4,4,8,4")]) @@ -7941,7 +8101,7 @@ (define_split [(set (match_operand:DF 0 "gpc_reg_operand" "") - (match_operand:DF 1 "easy_fp_constant" ""))] + (match_operand:DF 1 "const_double_operand" ""))] "TARGET_POWERPC64 && reload_completed && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31) || (GET_CODE (operands[0]) == SUBREG @@ -7989,7 +8149,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: /* We normally copy the low-numbered register first. However, if the first register operand 0 is the same as the second register @@ -7999,7 +8159,7 @@ else return \"mr %0,%1\;mr %L0,%L1\"; case 1: - if (offsettable_memref_p (operands[1]) + if (rs6000_offsettable_memref_p (operands[1]) || (GET_CODE (operands[1]) == MEM && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM || GET_CODE (XEXP (operands[1], 0)) == PRE_INC @@ -8039,7 +8199,7 @@ } } case 2: - if (offsettable_memref_p (operands[0]) + if (rs6000_offsettable_memref_p (operands[0]) || (GET_CODE (operands[0]) == MEM && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM || GET_CODE (XEXP (operands[0], 0)) == PRE_INC @@ -8068,13 +8228,13 @@ return \"#\"; } }" - [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*") + [(set_attr "type" "two,load,store,fp,fpload,fpstore,*,*,*") (set_attr "length" "8,16,16,4,4,4,8,12,16")]) (define_insn "*movdf_softfloat32" [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r") (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))] - "! TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS) + "! TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || TARGET_E500_SINGLE) && (gpc_reg_operand (operands[0], DFmode) || gpc_reg_operand (operands[1], DFmode))" "* @@ -8082,7 +8242,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: /* We normally copy the low-numbered register first. However, if the first register operand 0 is the same as the second register of @@ -8109,13 +8269,13 @@ return \"#\"; } }" - [(set_attr "type" "*,load,store,*,*,*") + [(set_attr "type" "two,load,store,*,*,*") (set_attr "length" "8,8,8,8,12,16")]) ; ld/std require word-aligned displacements -> 'Y' constraint. ; List Y->r and r->Y before r->r for reload. (define_insn "*movdf_hardfloat64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=Y,r,!r,f,f,m,!cl,!r,!h,!r,!r,!r") + [(set (match_operand:DF 0 "nonimmediate_operand" "=Y,r,!r,f,f,m,*c*l,!r,*h,!r,!r,!r") (match_operand:DF 1 "input_operand" "r,Y,r,f,m,f,r,h,0,G,H,F"))] "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && (gpc_reg_operand (operands[0], DFmode) @@ -8133,7 +8293,7 @@ # # #" - [(set_attr "type" "store,load,*,fp,fpload,fpstore,mtjmpr,*,*,*,*,*") + [(set_attr "type" "store,load,*,fp,fpload,fpstore,mtjmpr,mfjmpr,*,*,*,*") (set_attr "length" "4,4,4,4,4,4,4,4,4,8,12,16")]) (define_insn "*movdf_softfloat64" @@ -8152,23 +8312,22 @@ # # {cror 0,0,0|nop}" - [(set_attr "type" "load,store,*,*,*,*,*,*,*") + [(set_attr "type" "load,store,*,mtjmpr,mfjmpr,*,*,*,*") (set_attr "length" "4,4,4,4,4,8,12,16,4")]) (define_expand "movtf" [(set (match_operand:TF 0 "general_operand" "") (match_operand:TF 1 "any_operand" ""))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" + "!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128" "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }") ; It's important to list the o->f and f->o moves before f->f because ; otherwise reload, given m->f, will try to pick f->f and reload it, -; which doesn't make progress. +; which doesn't make progress. Likewise r->Y must be before r->r. (define_insn_and_split "*movtf_internal" - [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,rm,r") - (match_operand:TF 1 "input_operand" "f,o,f,r,mGHF"))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,r,Y,r") + (match_operand:TF 1 "input_operand" "f,o,f,YGHF,r,r"))] + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128 && (gpc_reg_operand (operands[0], TFmode) || gpc_reg_operand (operands[1], TFmode))" @@ -8176,23 +8335,39 @@ "&& reload_completed" [(pc)] { rs6000_split_multireg_move (operands[0], operands[1]); DONE; } - [(set_attr "length" "8,8,8,20,20")]) + [(set_attr "length" "8,8,8,20,20,16")]) + +(define_insn_and_split "*movtf_softfloat" + [(set (match_operand:TF 0 "nonimmediate_operand" "=r,Y,r") + (match_operand:TF 1 "input_operand" "YGHF,r,r"))] + "!TARGET_IEEEQUAD + && (TARGET_SOFT_FLOAT || !TARGET_FPRS) && TARGET_LONG_DOUBLE_128 + && (gpc_reg_operand (operands[0], TFmode) + || gpc_reg_operand (operands[1], TFmode))" + "#" + "&& reload_completed" + [(pc)] +{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; } + [(set_attr "length" "20,20,16")]) (define_expand "extenddftf2" [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "") (float_extend:TF (match_operand:DF 1 "input_operand" ""))) (use (match_dup 2))])] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" { operands[2] = CONST0_RTX (DFmode); + /* Generate GOT reference early for SVR4 PIC. */ + if (DEFAULT_ABI == ABI_V4 && flag_pic) + operands[2] = validize_mem (force_const_mem (DFmode, operands[2])); }) (define_insn_and_split "*extenddftf2_internal" [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,&f,r") (float_extend:TF (match_operand:DF 1 "input_operand" "fr,mf,mf,rmGHF"))) - (use (match_operand:DF 2 "input_operand" "rf,m,f,n"))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + (use (match_operand:DF 2 "zero_reg_mem_operand" "rf,m,f,n"))] + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" @@ -8205,12 +8380,12 @@ emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word), operands[2]); DONE; -}) +}) (define_expand "extendsftf2" [(set (match_operand:TF 0 "nonimmediate_operand" "") (float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" { rtx tmp = gen_reg_rtx (DFmode); @@ -8222,14 +8397,14 @@ (define_expand "trunctfdf2" [(set (match_operand:DF 0 "gpc_reg_operand" "") (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "") (define_insn_and_split "trunctfdf2_internal1" [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f") (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "0,f")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && !TARGET_XL_COMPAT + "!TARGET_IEEEQUAD && !TARGET_XL_COMPAT && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "@ # @@ -8245,7 +8420,7 @@ (define_insn "trunctfdf2_internal2" [(set (match_operand:DF 0 "gpc_reg_operand" "=f") (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_XL_COMPAT + "!TARGET_IEEEQUAD && TARGET_XL_COMPAT && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "fadd %0,%1,%L1" [(set_attr "type" "fp")]) @@ -8254,7 +8429,7 @@ [(set (match_operand:SF 0 "gpc_reg_operand" "=f") (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f"))) (clobber (match_scratch:DF 2 "=f"))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" @@ -8265,9 +8440,9 @@ "") (define_expand "floatsitf2" - [(set (match_operand:TF 0 "gpc_reg_operand" "=f") - (float:TF (match_operand:SI 1 "gpc_reg_operand" "r")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + [(set (match_operand:TF 0 "gpc_reg_operand" "") + (float:TF (match_operand:SI 1 "gpc_reg_operand" "")))] + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" { rtx tmp = gen_reg_rtx (DFmode); @@ -8295,7 +8470,7 @@ (clobber (match_dup 3)) (clobber (match_dup 4)) (clobber (match_dup 5))])] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && (TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" { @@ -8312,31 +8487,28 @@ (clobber (match_operand:DF 3 "gpc_reg_operand" "=&f")) (clobber (match_operand:DI 4 "gpc_reg_operand" "=f")) (clobber (match_operand:DI 5 "memory_operand" "=o"))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" - "&& reload_completed" + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[5]))" [(pc)] { rtx lowword; emit_insn (gen_fix_trunc_helper (operands[2], operands[1], operands[3])); - if (GET_CODE (operands[5]) != MEM) - abort(); - lowword = XEXP (operands[5], 0); - if (WORDS_BIG_ENDIAN) - lowword = plus_constant (lowword, 4); + gcc_assert (MEM_P (operands[5])); + lowword = adjust_address (operands[5], SImode, WORDS_BIG_ENDIAN ? 4 : 0); emit_insn (gen_fctiwz (operands[4], operands[2])); emit_move_insn (operands[5], operands[4]); - emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword)); + emit_move_insn (operands[0], lowword); DONE; }) (define_insn "negtf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "* { @@ -8351,7 +8523,7 @@ (define_expand "abstf2" [(set (match_operand:TF 0 "gpc_reg_operand" "=f") (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" " { @@ -8371,7 +8543,7 @@ (label_ref (match_operand 2 "" "")) (pc))) (set (match_dup 6) (neg:DF (match_dup 6)))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) + "!TARGET_IEEEQUAD && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" " { @@ -8385,43 +8557,24 @@ ;; Next come the multi-word integer load and store and the load and store ;; multiple insns. -(define_expand "movdi" - [(set (match_operand:DI 0 "general_operand" "") - (match_operand:DI 1 "any_operand" ""))] - "" - "{ rs6000_emit_move (operands[0], operands[1], DImode); DONE; }") +; List r->r after r->"o<>", otherwise reload will try to reload a +; non-offsettable address by using r->r which won't make progress. (define_insn "*movdi_internal32" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r") - (match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,r,r,*f,*f,m,r") + (match_operand:DI 1 "input_operand" "r,r,m,f,m,f,IJKnGHF"))] "! TARGET_POWERPC64 && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" - "* -{ - switch (which_alternative) - { - default: - abort (); - case 0: - case 1: - case 2: - return \"#\"; - case 3: - return \"fmr %0,%1\"; - case 4: - return \"lfd%U1%X1 %0,%1\"; - case 5: - return \"stfd%U0%X0 %1,%0\"; - case 6: - case 7: - case 8: - case 9: - case 10: - return \"#\"; - } -}" - [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")]) + "@ + # + # + # + fmr %0,%1 + lfd%U1%X1 %0,%1 + stfd%U0%X0 %1,%0 + #" + [(set_attr "type" "load,*,store,fp,fpload,fpstore,*")]) (define_split [(set (match_operand:DI 0 "gpc_reg_operand" "") @@ -8447,47 +8600,21 @@ (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "input_operand" ""))] - "reload_completed && !TARGET_POWERPC64 + "reload_completed && !TARGET_POWERPC64 && gpr_or_gpr_p (operands[0], operands[1])" [(pc)] { rs6000_split_multireg_move (operands[0], operands[1]); DONE; }) -(define_split - [(set (match_operand:TI 0 "gpc_reg_operand" "") - (match_operand:TI 1 "const_double_operand" ""))] - "TARGET_POWERPC64" - [(set (match_dup 2) (match_dup 4)) - (set (match_dup 3) (match_dup 5))] - " -{ - operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0, - TImode); - operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0, - TImode); - if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - } - else if (GET_CODE (operands[1]) == CONST_INT) - { - operands[4] = GEN_INT (- (INTVAL (operands[1]) < 0)); - operands[5] = operands[1]; - } - else - FAIL; -}") - (define_insn "*movdi_internal64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,r,??f,f,m,r,*h,*h") - (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,R,f,m,f,*h,r,0"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*f,*f,m,r,*h,*h") + (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))] "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" "@ - std%U0%X0 %1,%0 - ld%U1%X1 %0,%1 mr %0,%1 + ld%U1%X1 %0,%1 + std%U0%X0 %1,%0 li %0,%1 lis %0,%v1 # @@ -8498,7 +8625,7 @@ mf%1 %0 mt%0 %1 {cror 0,0,0|nop}" - [(set_attr "type" "store,load,*,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*") + [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*") (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")]) ;; immediate value valid for a single instruction hiding in a const_double @@ -8561,41 +8688,10 @@ else FAIL; }") - -(define_insn "*movdi_internal2" - [(set (match_operand:CC 2 "cc_reg_operand" "=y,x,?y") - (compare:CC (match_operand:DI 1 "gpc_reg_operand" "0,r,r") - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r") (match_dup 1))] - "TARGET_64BIT" - "@ - cmpdi %2,%0,0 - mr. %0,%1 - #" - [(set_attr "type" "cmp,compare,cmp") - (set_attr "length" "4,4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (match_operand:DI 1 "gpc_reg_operand" "") - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") (match_dup 1))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) (match_dup 1)) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") ;; TImode is similar, except that we usually want to compute the address into ;; a register and use lsi/stsi (the exception is during reload). MQ is also ;; clobbered in stsi for POWER, so we need a SCRATCH for it. -(define_expand "movti" - [(parallel [(set (match_operand:TI 0 "general_operand" "") - (match_operand:TI 1 "general_operand" "")) - (clobber (scratch:SI))])] - "" - "{ rs6000_emit_move (operands[0], operands[1], TImode); DONE; }") ;; We say that MQ is clobbered in the last alternative because the first ;; alternative would never get used otherwise since it would need a reload @@ -8604,17 +8700,17 @@ ;; giving the SCRATCH mq. (define_insn "*movti_power" - [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r") - (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m")) - (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))] - "TARGET_POWER && ! TARGET_POWERPC64 + [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r,r") + (match_operand:TI 1 "input_operand" "r,r,r,Q,m,n")) + (clobber (match_scratch:SI 2 "=q,q#X,X,X,X,X"))] + "TARGET_POWER && ! TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))" "* { switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: if (TARGET_STRING) @@ -8630,14 +8726,15 @@ return \"{lsi|lswi} %0,%P1,16\"; /* ... fall through ... */ case 4: + case 5: return \"#\"; } }" - [(set_attr "type" "store,store,*,load,load")]) + [(set_attr "type" "store,store,*,load,load,*")]) (define_insn "*movti_string" - [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r") - (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))] + [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,o<>,????r,????r,????r,r") + (match_operand:TI 1 "input_operand" "r,r,r,Q,m,n"))] "! TARGET_POWER && ! TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))" "* @@ -8645,7 +8742,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: if (TARGET_STRING) return \"{stsi|stswi} %1,%P0,16\"; @@ -8655,27 +8752,51 @@ case 3: /* If the address is not used in the output, we can use lsi. Otherwise, fall through to generating four loads. */ - if (TARGET_STRING + if (TARGET_STRING && ! reg_overlap_mentioned_p (operands[0], operands[1])) return \"{lsi|lswi} %0,%P1,16\"; /* ... fall through ... */ case 4: + case 5: return \"#\"; } }" - [(set_attr "type" "store,store,*,load,load")]) + [(set_attr "type" "store_ux,store_ux,*,load_ux,load_ux,*")]) (define_insn "*movti_ppc64" - [(set (match_operand:TI 0 "nonimmediate_operand" "=r,m,r") - (match_operand:TI 1 "input_operand" "r,r,o"))] + [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o<>,r") + (match_operand:TI 1 "input_operand" "r,r,m"))] "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))" - "@ - # - # - #" + "#" [(set_attr "type" "*,load,store")]) +(define_split + [(set (match_operand:TI 0 "gpc_reg_operand" "") + (match_operand:TI 1 "const_double_operand" ""))] + "TARGET_POWERPC64" + [(set (match_dup 2) (match_dup 4)) + (set (match_dup 3) (match_dup 5))] + " +{ + operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0, + TImode); + operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0, + TImode); + if (GET_CODE (operands[1]) == CONST_DOUBLE) + { + operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); + operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + } + else if (GET_CODE (operands[1]) == CONST_INT) + { + operands[4] = GEN_INT (- (INTVAL (operands[1]) < 0)); + operands[5] = operands[1]; + } + else + FAIL; +}") + (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") (match_operand:TI 1 "input_operand" ""))] @@ -8741,7 +8862,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 8" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_insn "*ldmsi7" @@ -8763,7 +8884,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 7" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_insn "*ldmsi6" @@ -8783,7 +8904,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 6" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_insn "*ldmsi5" @@ -8801,7 +8922,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 5" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_insn "*ldmsi4" @@ -8817,7 +8938,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 4" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_insn "*ldmsi3" @@ -8831,7 +8952,7 @@ "TARGET_STRING && XVECLEN (operands[0], 0) == 3" "* { return rs6000_output_load_multiple (operands); }" - [(set_attr "type" "load") + [(set_attr "type" "load_ux") (set_attr "length" "32")]) (define_expand "store_multiple" @@ -8878,20 +8999,11 @@ gen_rtx_REG (SImode, regno + i)); }") -(define_insn "*store_multiple_power" - [(match_parallel 0 "store_multiple_operation" - [(set (match_operand:SI 1 "indirect_operand" "=Q") - (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "=q"))])] - "TARGET_STRING && TARGET_POWER" - "{stsi|stswi} %2,%P1,%O0" - [(set_attr "type" "store")]) - (define_insn "*stmsi8" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) @@ -8908,13 +9020,13 @@ (match_operand:SI 10 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 9" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) (define_insn "*stmsi7" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) @@ -8929,13 +9041,13 @@ (match_operand:SI 9 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 8" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) (define_insn "*stmsi6" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) @@ -8948,13 +9060,13 @@ (match_operand:SI 8 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 7" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) (define_insn "*stmsi5" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) @@ -8965,13 +9077,13 @@ (match_operand:SI 7 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 6" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) (define_insn "*stmsi4" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) @@ -8980,28 +9092,154 @@ (match_operand:SI 6 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 5" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) (define_insn "*stmsi3" [(match_parallel 0 "store_multiple_operation" [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) (match_operand:SI 2 "gpc_reg_operand" "r")) - (clobber (match_scratch:SI 3 "X")) + (clobber (match_scratch:SI 3 "=X")) (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) (match_operand:SI 4 "gpc_reg_operand" "r")) (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) (match_operand:SI 5 "gpc_reg_operand" "r"))])] "TARGET_STRING && !TARGET_POWER && XVECLEN (operands[0], 0) == 4" "{stsi|stswi} %2,%1,%O0" - [(set_attr "type" "store")]) + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi8_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 12))) + (match_operand:SI 6 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 16))) + (match_operand:SI 7 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 20))) + (match_operand:SI 8 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 24))) + (match_operand:SI 9 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 28))) + (match_operand:SI 10 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 9" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi7_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 12))) + (match_operand:SI 6 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 16))) + (match_operand:SI 7 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 20))) + (match_operand:SI 8 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 24))) + (match_operand:SI 9 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 8" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi6_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 12))) + (match_operand:SI 6 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 16))) + (match_operand:SI 7 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 20))) + (match_operand:SI 8 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 7" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi5_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 12))) + (match_operand:SI 6 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 16))) + (match_operand:SI 7 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 6" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi4_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 12))) + (match_operand:SI 6 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 5" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) + +(define_insn "*stmsi3_power" + [(match_parallel 0 "store_multiple_operation" + [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b")) + (match_operand:SI 2 "gpc_reg_operand" "r")) + (clobber (match_scratch:SI 3 "=q")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 4))) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (set (mem:SI (plus:SI (match_dup 1) (const_int 8))) + (match_operand:SI 5 "gpc_reg_operand" "r"))])] + "TARGET_STRING && TARGET_POWER && XVECLEN (operands[0], 0) == 4" + "{stsi|stswi} %2,%1,%O0" + [(set_attr "type" "store_ux")]) +(define_expand "setmemsi" + [(parallel [(set (match_operand:BLK 0 "" "") + (match_operand 2 "const_int_operand" "")) + (use (match_operand:SI 1 "" "")) + (use (match_operand:SI 3 "" ""))])] + "" + " +{ + /* If value to set is not zero, use the library routine. */ + if (operands[2] != const0_rtx) + FAIL; + + if (expand_block_clear (operands)) + DONE; + else + FAIL; +}") + ;; String/block move insn. ;; Argument 0 is the destination ;; Argument 1 is the source ;; Argument 2 is the length ;; Argument 3 is the alignment -(define_expand "movstrsi" +(define_expand "movmemsi" [(parallel [(set (match_operand:BLK 0 "" "") (match_operand:BLK 1 "" "")) (use (match_operand:SI 2 "" "")) @@ -9018,7 +9256,7 @@ ;; Move up to 32 bytes at a time. The fixed registers are needed because the ;; register allocator doesn't have a clue about allocating 8 word registers. ;; rD/rS = r5 is preferred, efficient form. -(define_expand "movstrsi_8reg" +(define_expand "movmemsi_8reg" [(parallel [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" "")) @@ -9056,12 +9294,12 @@ && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) (define_insn "" - [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b"))) + [(set (mem:BLK (match_operand:P 0 "gpc_reg_operand" "b")) + (mem:BLK (match_operand:P 1 "gpc_reg_operand" "b"))) (use (match_operand:SI 2 "immediate_operand" "i")) (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) @@ -9072,7 +9310,7 @@ (clobber (reg:SI 10)) (clobber (reg:SI 11)) (clobber (reg:SI 12)) - (clobber (match_scratch:SI 5 "X"))] + (clobber (match_scratch:SI 5 "=X"))] "TARGET_STRING && ! TARGET_POWER && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32) || INTVAL (operands[2]) == 0) @@ -9080,37 +9318,13 @@ && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") - (set_attr "length" "8")]) - -(define_insn "" - [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b"))) - (use (match_operand:SI 2 "immediate_operand" "i")) - (use (match_operand:SI 3 "immediate_operand" "i")) - (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) - (clobber (reg:SI 6)) - (clobber (reg:SI 7)) - (clobber (reg:SI 8)) - (clobber (reg:SI 9)) - (clobber (reg:SI 10)) - (clobber (reg:SI 11)) - (clobber (reg:SI 12)) - (clobber (match_scratch:SI 5 "X"))] - "TARGET_STRING && TARGET_POWERPC64 - && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32) - || INTVAL (operands[2]) == 0) - && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12) - && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12) - && REGNO (operands[4]) == 5" - "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) ;; Move up to 24 bytes at a time. The fixed registers are needed because the ;; register allocator doesn't have a clue about allocating 6 word registers. ;; rD/rS = r5 is preferred, efficient form. -(define_expand "movstrsi_6reg" +(define_expand "movmemsi_6reg" [(parallel [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" "")) @@ -9143,12 +9357,12 @@ && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) (define_insn "" - [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b"))) + [(set (mem:BLK (match_operand:P 0 "gpc_reg_operand" "b")) + (mem:BLK (match_operand:P 1 "gpc_reg_operand" "b"))) (use (match_operand:SI 2 "immediate_operand" "i")) (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) @@ -9157,41 +9371,20 @@ (clobber (reg:SI 8)) (clobber (reg:SI 9)) (clobber (reg:SI 10)) - (clobber (match_scratch:SI 5 "X"))] + (clobber (match_scratch:SI 5 "=X"))] "TARGET_STRING && ! TARGET_POWER && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10) && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") - (set_attr "length" "8")]) - -(define_insn "" - [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b"))) - (use (match_operand:SI 2 "immediate_operand" "i")) - (use (match_operand:SI 3 "immediate_operand" "i")) - (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) - (clobber (reg:SI 6)) - (clobber (reg:SI 7)) - (clobber (reg:SI 8)) - (clobber (reg:SI 9)) - (clobber (reg:SI 10)) - (clobber (match_scratch:SI 5 "X"))] - "TARGET_STRING && TARGET_POWERPC64 - && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32 - && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10) - && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10) - && REGNO (operands[4]) == 5" - "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) ;; Move up to 16 bytes at a time, using 4 fixed registers to avoid spill ;; problems with TImode. ;; rD/rS = r5 is preferred, efficient form. -(define_expand "movstrsi_4reg" +(define_expand "movmemsi_4reg" [(parallel [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" "")) @@ -9220,49 +9413,30 @@ && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) (define_insn "" - [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b"))) + [(set (mem:BLK (match_operand:P 0 "gpc_reg_operand" "b")) + (mem:BLK (match_operand:P 1 "gpc_reg_operand" "b"))) (use (match_operand:SI 2 "immediate_operand" "i")) (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) (clobber (reg:SI 6)) (clobber (reg:SI 7)) (clobber (reg:SI 8)) - (clobber (match_scratch:SI 5 "X"))] + (clobber (match_scratch:SI 5 "=X"))] "TARGET_STRING && ! TARGET_POWER && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8) && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8) && REGNO (operands[4]) == 5" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") - (set_attr "length" "8")]) - -(define_insn "" - [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b"))) - (use (match_operand:SI 2 "immediate_operand" "i")) - (use (match_operand:SI 3 "immediate_operand" "i")) - (clobber (match_operand:SI 4 "gpc_reg_operand" "=r")) - (clobber (reg:SI 6)) - (clobber (reg:SI 7)) - (clobber (reg:SI 8)) - (clobber (match_scratch:SI 5 "X"))] - "TARGET_STRING && TARGET_POWERPC64 - && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16 - && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8) - && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8) - && REGNO (operands[4]) == 5" - "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) ;; Move up to 8 bytes at a time. -(define_expand "movstrsi_2reg" +(define_expand "movmemsi_2reg" [(parallel [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" "")) @@ -9282,7 +9456,7 @@ "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) (define_insn "" @@ -9291,15 +9465,15 @@ (use (match_operand:SI 2 "immediate_operand" "i")) (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_scratch:DI 4 "=&r")) - (clobber (match_scratch:SI 5 "X"))] + (clobber (match_scratch:SI 5 "=X"))] "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) ;; Move up to 4 bytes at a time. -(define_expand "movstrsi_1reg" +(define_expand "movmemsi_1reg" [(parallel [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" "")) @@ -9319,35 +9493,21 @@ "TARGET_STRING && TARGET_POWER && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) (define_insn "" - [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b"))) + [(set (mem:BLK (match_operand:P 0 "gpc_reg_operand" "b")) + (mem:BLK (match_operand:P 1 "gpc_reg_operand" "b"))) (use (match_operand:SI 2 "immediate_operand" "i")) (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_scratch:SI 4 "=&r")) - (clobber (match_scratch:SI 5 "X"))] + (clobber (match_scratch:SI 5 "=X"))] "TARGET_STRING && ! TARGET_POWER && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4" "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") + [(set_attr "type" "store_ux") (set_attr "length" "8")]) - -(define_insn "" - [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b")) - (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b"))) - (use (match_operand:SI 2 "immediate_operand" "i")) - (use (match_operand:SI 3 "immediate_operand" "i")) - (clobber (match_scratch:SI 4 "=&r")) - (clobber (match_scratch:SI 5 "X"))] - "TARGET_STRING && TARGET_POWERPC64 - && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4" - "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2" - [(set_attr "type" "load") - (set_attr "length" "8")]) - ;; Define insns that do load or store with update. Some of these we can ;; get by using pre-decrement or pre-increment, but the hardware can also @@ -9370,12 +9530,12 @@ ldu %3,%2(%0)" [(set_attr "type" "load_ux,load_u")]) -(define_insn "movdi_update" - [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0") - (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I"))) +(define_insn "movdi__update" + [(set (mem:DI (plus:P (match_operand:P 1 "gpc_reg_operand" "0,0") + (match_operand:P 2 "reg_or_aligned_short_operand" "r,I"))) (match_operand:DI 3 "gpc_reg_operand" "r,r")) - (set (match_operand:DI 0 "gpc_reg_operand" "=b,b") - (plus:DI (match_dup 1) (match_dup 2)))] + (set (match_operand:P 0 "gpc_reg_operand" "=b,b") + (plus:P (match_dup 1) (match_dup 2)))] "TARGET_POWERPC64 && TARGET_UPDATE" "@ stdux %3,%0,%2 @@ -9578,170 +9738,214 @@ ;; Peephole to convert two consecutive FP loads or stores into lfq/stfq. -(define_peephole - [(set (match_operand:DF 0 "gpc_reg_operand" "=f") +(define_insn "*lfq_power2" + [(set (match_operand:V2DF 0 "gpc_reg_operand" "=f") + (match_operand:V2DF 1 "memory_operand" ""))] + "TARGET_POWER2 + && TARGET_HARD_FLOAT && TARGET_FPRS" + "lfq%U1%X1 %0,%1") + +(define_peephole2 + [(set (match_operand:DF 0 "gpc_reg_operand" "") (match_operand:DF 1 "memory_operand" "")) - (set (match_operand:DF 2 "gpc_reg_operand" "=f") + (set (match_operand:DF 2 "gpc_reg_operand" "") (match_operand:DF 3 "memory_operand" ""))] "TARGET_POWER2 && TARGET_HARD_FLOAT && TARGET_FPRS && registers_ok_for_quad_peep (operands[0], operands[2]) - && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3]) - && addrs_ok_for_quad_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))" - "lfq%U1%X1 %0,%1") + && mems_ok_for_quad_peep (operands[1], operands[3])" + [(set (match_dup 0) + (match_dup 1))] + "operands[1] = widen_memory_access (operands[1], V2DFmode, 0); + operands[0] = gen_rtx_REG (V2DFmode, REGNO (operands[0]));") -(define_peephole +(define_insn "*stfq_power2" + [(set (match_operand:V2DF 0 "memory_operand" "") + (match_operand:V2DF 1 "gpc_reg_operand" "f"))] + "TARGET_POWER2 + && TARGET_HARD_FLOAT && TARGET_FPRS" + "stfq%U0%X0 %1,%0") + + +(define_peephole2 [(set (match_operand:DF 0 "memory_operand" "") - (match_operand:DF 1 "gpc_reg_operand" "f")) + (match_operand:DF 1 "gpc_reg_operand" "")) (set (match_operand:DF 2 "memory_operand" "") - (match_operand:DF 3 "gpc_reg_operand" "f"))] + (match_operand:DF 3 "gpc_reg_operand" ""))] "TARGET_POWER2 && TARGET_HARD_FLOAT && TARGET_FPRS && registers_ok_for_quad_peep (operands[1], operands[3]) - && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2]) - && addrs_ok_for_quad_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))" - "stfq%U0%X0 %1,%0") + && mems_ok_for_quad_peep (operands[0], operands[2])" + [(set (match_dup 0) + (match_dup 1))] + "operands[0] = widen_memory_access (operands[0], V2DFmode, 0); + operands[1] = gen_rtx_REG (V2DFmode, REGNO (operands[1]));") + +;; After inserting conditional returns we can sometimes have +;; unnecessary register moves. Unfortunately we cannot have a +;; modeless peephole here, because some single SImode sets have early +;; clobber outputs. Although those sets expand to multi-ppc-insn +;; sequences, using get_attr_length here will smash the operands +;; array. Neither is there an early_cobbler_p predicate. +;; Disallow subregs for E500 so we don't munge frob_di_df_2. +(define_peephole2 + [(set (match_operand:DF 0 "gpc_reg_operand" "") + (match_operand:DF 1 "any_operand" "")) + (set (match_operand:DF 2 "gpc_reg_operand" "") + (match_dup 0))] + "!(TARGET_E500_DOUBLE && GET_CODE (operands[2]) == SUBREG) + && peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) (match_dup 1))]) + +(define_peephole2 + [(set (match_operand:SF 0 "gpc_reg_operand" "") + (match_operand:SF 1 "any_operand" "")) + (set (match_operand:SF 2 "gpc_reg_operand" "") + (match_dup 0))] + "peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) (match_dup 1))]) + ;; TLS support. ;; "b" output constraint here and on tls_ld to support tls linker optimization. (define_insn "tls_gd_32" - [(set (match_operand:SI 0 "register_operand" "=b") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=b") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGD))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%2@got@tlsgd") (define_insn "tls_gd_64" - [(set (match_operand:DI 0 "register_operand" "=b") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=b") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGD))] "HAVE_AS_TLS && TARGET_64BIT" "addi %0,%1,%2@got@tlsgd") (define_insn "tls_ld_32" - [(set (match_operand:SI 0 "register_operand" "=b") - (unspec:SI [(match_operand:SI 1 "register_operand" "b")] + [(set (match_operand:SI 0 "gpc_reg_operand" "=b") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b")] UNSPEC_TLSLD))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%&@got@tlsld") (define_insn "tls_ld_64" - [(set (match_operand:DI 0 "register_operand" "=b") - (unspec:DI [(match_operand:DI 1 "register_operand" "b")] + [(set (match_operand:DI 0 "gpc_reg_operand" "=b") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b")] UNSPEC_TLSLD))] "HAVE_AS_TLS && TARGET_64BIT" "addi %0,%1,%&@got@tlsld") (define_insn "tls_dtprel_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPREL))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%2@dtprel") (define_insn "tls_dtprel_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPREL))] "HAVE_AS_TLS && TARGET_64BIT" "addi %0,%1,%2@dtprel") (define_insn "tls_dtprel_ha_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPRELHA))] "HAVE_AS_TLS && !TARGET_64BIT" "addis %0,%1,%2@dtprel@ha") (define_insn "tls_dtprel_ha_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPRELHA))] "HAVE_AS_TLS && TARGET_64BIT" "addis %0,%1,%2@dtprel@ha") (define_insn "tls_dtprel_lo_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPRELLO))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%2@dtprel@l") (define_insn "tls_dtprel_lo_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSDTPRELLO))] "HAVE_AS_TLS && TARGET_64BIT" "addi %0,%1,%2@dtprel@l") (define_insn "tls_got_dtprel_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGOTDTPREL))] "HAVE_AS_TLS && !TARGET_64BIT" "lwz %0,%2@got@dtprel(%1)") (define_insn "tls_got_dtprel_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGOTDTPREL))] "HAVE_AS_TLS && TARGET_64BIT" "ld %0,%2@got@dtprel(%1)") (define_insn "tls_tprel_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPREL))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%2@tprel") (define_insn "tls_tprel_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPREL))] "HAVE_AS_TLS && TARGET_64BIT" "addi %0,%1,%2@tprel") (define_insn "tls_tprel_ha_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPRELHA))] "HAVE_AS_TLS && !TARGET_64BIT" "addis %0,%1,%2@tprel@ha") (define_insn "tls_tprel_ha_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPRELHA))] "HAVE_AS_TLS && TARGET_64BIT" "addis %0,%1,%2@tprel@ha") (define_insn "tls_tprel_lo_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPRELLO))] "HAVE_AS_TLS && !TARGET_64BIT" "addi %0,%1,%2@tprel@l") (define_insn "tls_tprel_lo_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTPRELLO))] "HAVE_AS_TLS && TARGET_64BIT" @@ -9751,32 +9955,32 @@ ;; optimization. The linker may edit the instructions emitted by a ;; tls_got_tprel/tls_tls pair to addis,addi. (define_insn "tls_got_tprel_32" - [(set (match_operand:SI 0 "register_operand" "=b") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=b") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGOTTPREL))] "HAVE_AS_TLS && !TARGET_64BIT" "lwz %0,%2@got@tprel(%1)") (define_insn "tls_got_tprel_64" - [(set (match_operand:DI 0 "register_operand" "=b") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=b") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSGOTTPREL))] "HAVE_AS_TLS && TARGET_64BIT" "ld %0,%2@got@tprel(%1)") (define_insn "tls_tls_32" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:SI 1 "register_operand" "b") + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "b") (match_operand:SI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTLS))] "HAVE_AS_TLS && !TARGET_64BIT" "add %0,%1,%2@tls") (define_insn "tls_tls_64" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "register_operand" "b") + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "b") (match_operand:DI 2 "rs6000_tls_symbol_ref" "")] UNSPEC_TLSTLS))] "HAVE_AS_TLS && TARGET_64BIT" @@ -9804,7 +10008,7 @@ if (current_function_limit_stack) { rtx available; - available = expand_binop (Pmode, sub_optab, + available = expand_binop (Pmode, sub_optab, stack_pointer_rtx, stack_limit_rtx, NULL_RTX, 1, OPTAB_WIDEN); emit_insn (gen_cond_trap (LTU, available, operands[1], const0_rtx)); @@ -9824,7 +10028,7 @@ neg_op0 = GEN_INT (- INTVAL (operands[1])); if (TARGET_UPDATE) - emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_update)) + emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_di_update)) (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain)); else @@ -9859,52 +10063,58 @@ "" "DONE;") +;; Adjust stack pointer (op0) to a new value (op1). +;; First copy old stack backchain to new location, and ensure that the +;; scheduler won't reorder the sp assignment before the backchain write. (define_expand "restore_stack_block" - [(use (match_operand 0 "register_operand" "")) - (set (match_dup 2) (match_dup 3)) - (set (match_dup 0) (match_operand 1 "register_operand" "")) - (set (match_dup 3) (match_dup 2))] + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 4) (match_dup 2)) + (set (match_dup 5) (unspec:BLK [(match_dup 5)] UNSPEC_TIE)) + (set (match_operand 0 "register_operand" "") + (match_operand 1 "register_operand" ""))] "" " { operands[2] = gen_reg_rtx (Pmode); - operands[3] = gen_rtx_MEM (Pmode, operands[0]); + operands[3] = gen_frame_mem (Pmode, operands[0]); + operands[4] = gen_frame_mem (Pmode, operands[1]); + operands[5] = gen_frame_mem (BLKmode, operands[0]); }") (define_expand "save_stack_nonlocal" - [(match_operand 0 "memory_operand" "") - (match_operand 1 "register_operand" "")] + [(set (match_dup 3) (match_dup 4)) + (set (match_operand 0 "memory_operand" "") (match_dup 3)) + (set (match_dup 2) (match_operand 1 "register_operand" ""))] "" " { - rtx temp = gen_reg_rtx (Pmode); + int units_per_word = (TARGET_32BIT) ? 4 : 8; /* Copy the backchain to the first word, sp to the second. */ - emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1])); - emit_move_insn (operand_subword (operands[0], 0, 0, - (TARGET_32BIT ? DImode : TImode)), - temp); - emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)), - operands[1]); - DONE; + operands[0] = adjust_address_nv (operands[0], Pmode, 0); + operands[2] = adjust_address_nv (operands[0], Pmode, units_per_word); + operands[3] = gen_reg_rtx (Pmode); + operands[4] = gen_frame_mem (Pmode, operands[1]); }") (define_expand "restore_stack_nonlocal" - [(match_operand 0 "register_operand" "") - (match_operand 1 "memory_operand" "")] + [(set (match_dup 2) (match_operand 1 "memory_operand" "")) + (set (match_dup 3) (match_dup 4)) + (set (match_dup 5) (match_dup 2)) + (set (match_dup 6) (unspec:BLK [(match_dup 6)] UNSPEC_TIE)) + (set (match_operand 0 "register_operand" "") (match_dup 3))] "" " { - rtx temp = gen_reg_rtx (Pmode); + int units_per_word = (TARGET_32BIT) ? 4 : 8; /* Restore the backchain from the first word, sp from the second. */ - emit_move_insn (temp, - operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode))); - emit_move_insn (operands[0], - operand_subword (operands[1], 1, 0, - (TARGET_32BIT ? DImode : TImode))); - emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp); - DONE; + operands[2] = gen_reg_rtx (Pmode); + operands[3] = gen_reg_rtx (Pmode); + operands[1] = adjust_address_nv (operands[1], Pmode, 0); + operands[4] = adjust_address_nv (operands[1], Pmode, units_per_word); + operands[5] = gen_frame_mem (Pmode, operands[3]); + operands[6] = gen_frame_mem (BLKmode, operands[0]); }") ;; TOC register handling. @@ -9960,7 +10170,8 @@ [(set (match_operand:SI 0 "register_operand" "=l") (match_operand:SI 1 "immediate_operand" "s")) (use (unspec [(match_dup 1)] UNSPEC_TOC))] - "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2" + "TARGET_ELF && DEFAULT_ABI != ABI_AIX + && (flag_pic == 2 || (flag_pic && TARGET_SECURE_PLT))" "bcl 20,31,%1\\n%1:" [(set_attr "type" "branch") (set_attr "length" "4")]) @@ -9983,24 +10194,22 @@ "{l|lwz} %0,%2-%3(%1)" [(set_attr "type" "load")]) -(define_insn "load_macho_picbase" - [(set (match_operand:SI 0 "register_operand" "=l") - (unspec:SI [(match_operand:SI 1 "immediate_operand" "s")] - UNSPEC_LD_MPIC))] - "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" - "bcl 20,31,%1\\n%1:" - [(set_attr "type" "branch") - (set_attr "length" "4")]) - -(define_insn "macho_correct_pic" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") +(define_insn "load_toc_v4_PIC_3b" + [(set (match_operand:SI 0 "gpc_reg_operand" "=b") (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (unspec:SI [(match_operand:SI 2 "immediate_operand" "s") - (match_operand:SI 3 "immediate_operand" "s")] - UNSPEC_MPIC_CORRECT)))] - "DEFAULT_ABI == ABI_DARWIN" - "addis %0,%1,ha16(%2-%3)\n\taddi %0,%0,lo16(%2-%3)" - [(set_attr "length" "8")]) + (high:SI + (minus:SI (match_operand:SI 2 "symbol_ref_operand" "s") + (match_operand:SI 3 "symbol_ref_operand" "s")))))] + "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic" + "{cau|addis} %0,%1,%2-%3@ha") + +(define_insn "load_toc_v4_PIC_3c" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") + (minus:SI (match_operand:SI 2 "symbol_ref_operand" "s") + (match_operand:SI 3 "symbol_ref_operand" "s"))))] + "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic" + "{cal|addi} %0,%1,%2-%3@l") ;; If the TOC is shared over a translation unit, as happens with all ;; the kinds of PIC that we support, we need to restore the TOC @@ -10035,6 +10244,25 @@ rs6000_emit_load_toc_table (FALSE); DONE; }") + +;; Elf specific ways of loading addresses for non-PIC code. +;; The output of this could be r0, but we make a very strong +;; preference for a base register because it will usually +;; be needed there. +(define_insn "elf_high" + [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r") + (high:SI (match_operand 1 "" "")))] + "TARGET_ELF && ! TARGET_64BIT" + "{liu|lis} %0,%1@ha") + +(define_insn "elf_low" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") + (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r") + (match_operand 2 "" "")))] + "TARGET_ELF && ! TARGET_64BIT" + "@ + {cal|la} %0,%2@l(%1) + {ai|addic} %0,%1,%K2") ;; A function pointer under AIX is a pointer to a data area whose first word ;; contains the actual address of the function, whose second word contains a @@ -10146,11 +10374,30 @@ operands[0] = machopic_indirect_call_target (operands[0]); #endif - if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); + gcc_assert (GET_CODE (operands[1]) == CONST_INT); operands[0] = XEXP (operands[0], 0); + if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT + && flag_pic + && GET_CODE (operands[0]) == SYMBOL_REF + && !SYMBOL_REF_LOCAL_P (operands[0])) + { + rtx call; + rtvec tmp; + + tmp = gen_rtvec (3, + gen_rtx_CALL (VOIDmode, + gen_rtx_MEM (SImode, operands[0]), + operands[1]), + gen_rtx_USE (VOIDmode, operands[2]), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode))); + call = emit_call_insn (gen_rtx_PARALLEL (VOIDmode, tmp)); + use_reg (&CALL_INSN_FUNCTION_USAGE (call), pic_offset_table_rtx); + DONE; + } + if (GET_CODE (operands[0]) != SYMBOL_REF || (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[0])) || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[2]) & CALL_LONG) != 0)) @@ -10158,12 +10405,14 @@ if (INTVAL (operands[2]) & CALL_LONG) operands[0] = rs6000_longcall_ref (operands[0]); - if (DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - operands[0] = force_reg (Pmode, operands[0]); + switch (DEFAULT_ABI) + { + case ABI_V4: + case ABI_DARWIN: + operands[0] = force_reg (Pmode, operands[0]); + break; - else if (DEFAULT_ABI == ABI_AIX) - { + case ABI_AIX: /* AIX function pointers are really pointers to a three word area. */ emit_call_insn (TARGET_32BIT @@ -10174,9 +10423,10 @@ operands[0]), operands[1])); DONE; + + default: + gcc_unreachable (); } - else - abort (); } }") @@ -10194,11 +10444,33 @@ operands[1] = machopic_indirect_call_target (operands[1]); #endif - if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); operands[1] = XEXP (operands[1], 0); + if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT + && flag_pic + && GET_CODE (operands[1]) == SYMBOL_REF + && !SYMBOL_REF_LOCAL_P (operands[1])) + { + rtx call; + rtvec tmp; + + tmp = gen_rtvec (3, + gen_rtx_SET (VOIDmode, + operands[0], + gen_rtx_CALL (VOIDmode, + gen_rtx_MEM (SImode, + operands[1]), + operands[2])), + gen_rtx_USE (VOIDmode, operands[3]), + gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode))); + call = emit_call_insn (gen_rtx_PARALLEL (VOIDmode, tmp)); + use_reg (&CALL_INSN_FUNCTION_USAGE (call), pic_offset_table_rtx); + DONE; + } + if (GET_CODE (operands[1]) != SYMBOL_REF || (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[1])) || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[3]) & CALL_LONG) != 0)) @@ -10206,12 +10478,14 @@ if (INTVAL (operands[3]) & CALL_LONG) operands[1] = rs6000_longcall_ref (operands[1]); - if (DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - operands[1] = force_reg (Pmode, operands[1]); + switch (DEFAULT_ABI) + { + case ABI_V4: + case ABI_DARWIN: + operands[1] = force_reg (Pmode, operands[1]); + break; - else if (DEFAULT_ABI == ABI_AIX) - { + case ABI_AIX: /* AIX function pointers are really pointers to a three word area. */ emit_call_insn (TARGET_32BIT @@ -10224,9 +10498,10 @@ operands[1]), operands[2])); DONE; + + default: + gcc_unreachable (); } - else - abort (); } }") @@ -10323,13 +10598,13 @@ ;; and < 0 if they were not. (define_insn "*call_indirect_nonlocal_aix32" - [(call (mem:SI (match_operand:SI 0 "register_operand" "cl")) - (match_operand 1 "" "g")) + [(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l")) + (match_operand 1 "" "g,g")) (use (reg:SI 2)) (use (reg:SI 11)) (set (reg:SI 2) (mem:SI (plus:SI (reg:SI 1) (const_int 20)))) - (clobber (match_scratch:SI 2 "=l"))] + (clobber (match_scratch:SI 2 "=l,l"))] "TARGET_32BIT && DEFAULT_ABI == ABI_AIX" "b%T0l\;{l|lwz} 2,20(1)" [(set_attr "type" "jmpreg") @@ -10348,13 +10623,13 @@ (set_attr "length" "8")]) (define_insn "*call_indirect_nonlocal_aix64" - [(call (mem:SI (match_operand:DI 0 "register_operand" "cl")) - (match_operand 1 "" "g")) + [(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l")) + (match_operand 1 "" "g,g")) (use (reg:DI 2)) (use (reg:DI 11)) (set (reg:DI 2) (mem:DI (plus:DI (reg:DI 1) (const_int 40)))) - (clobber (match_scratch:SI 2 "=l"))] + (clobber (match_scratch:SI 2 "=l,l"))] "TARGET_64BIT && DEFAULT_ABI == ABI_AIX" "b%T0l\;ld 2,40(1)" [(set_attr "type" "jmpreg") @@ -10365,7 +10640,7 @@ (match_operand 1 "" "g")) (use (match_operand:SI 2 "immediate_operand" "O")) (clobber (match_scratch:SI 3 "=l"))] - "TARGET_64BIT + "TARGET_64BIT && DEFAULT_ABI == ABI_AIX && (INTVAL (operands[2]) & CALL_LONG) == 0" "bl %z0\;%." @@ -10374,13 +10649,13 @@ (define_insn "*call_value_indirect_nonlocal_aix32" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "register_operand" "cl")) - (match_operand 2 "" "g"))) + (call (mem:SI (match_operand:SI 1 "register_operand" "c,*l")) + (match_operand 2 "" "g,g"))) (use (reg:SI 2)) (use (reg:SI 11)) (set (reg:SI 2) (mem:SI (plus:SI (reg:SI 1) (const_int 20)))) - (clobber (match_scratch:SI 3 "=l"))] + (clobber (match_scratch:SI 3 "=l,l"))] "TARGET_32BIT && DEFAULT_ABI == ABI_AIX" "b%T1l\;{l|lwz} 2,20(1)" [(set_attr "type" "jmpreg") @@ -10401,13 +10676,13 @@ (define_insn "*call_value_indirect_nonlocal_aix64" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:DI 1 "register_operand" "cl")) - (match_operand 2 "" "g"))) + (call (mem:SI (match_operand:DI 1 "register_operand" "c,*l")) + (match_operand 2 "" "g,g"))) (use (reg:DI 2)) (use (reg:DI 11)) (set (reg:DI 2) (mem:DI (plus:DI (reg:DI 1) (const_int 40)))) - (clobber (match_scratch:SI 3 "=l"))] + (clobber (match_scratch:SI 3 "=l,l"))] "TARGET_64BIT && DEFAULT_ABI == ABI_AIX" "b%T1l\;ld 2,40(1)" [(set_attr "type" "jmpreg") @@ -10419,7 +10694,7 @@ (match_operand 2 "" "g"))) (use (match_operand:SI 3 "immediate_operand" "O")) (clobber (match_scratch:SI 4 "=l"))] - "TARGET_64BIT + "TARGET_64BIT && DEFAULT_ABI == ABI_AIX && (INTVAL (operands[3]) & CALL_LONG) == 0" "bl %z1\;%." @@ -10432,11 +10707,11 @@ ;; operands[2] is the value FUNCTION_ARG returns for the VOID argument ;; which indicates how to set cr1 -(define_insn "*call_indirect_nonlocal_sysv" - [(call (mem:SI (match_operand:SI 0 "register_operand" "cl,cl")) - (match_operand 1 "" "g,g")) - (use (match_operand:SI 2 "immediate_operand" "O,n")) - (clobber (match_scratch:SI 3 "=l,l"))] +(define_insn "*call_indirect_nonlocal_sysv" + [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l,c,*l")) + (match_operand 1 "" "g,g,g,g")) + (use (match_operand:SI 2 "immediate_operand" "O,O,n,n")) + (clobber (match_scratch:SI 3 "=l,l,l,l"))] "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN" { @@ -10448,11 +10723,11 @@ return "b%T0l"; } - [(set_attr "type" "jmpreg,jmpreg") - (set_attr "length" "4,8")]) + [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") + (set_attr "length" "4,4,8,8")]) -(define_insn "*call_nonlocal_sysv" - [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s")) +(define_insn "*call_nonlocal_sysv" + [(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s")) (match_operand 1 "" "g,g")) (use (match_operand:SI 2 "immediate_operand" "O,n")) (clobber (match_scratch:SI 3 "=l,l"))] @@ -10469,18 +10744,29 @@ #if TARGET_MACHO return output_call(insn, operands, 0, 2); #else - return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@plt" : "bl %z0"; -#endif + if (DEFAULT_ABI == ABI_V4 && flag_pic) + { + if (TARGET_SECURE_PLT && flag_pic == 2) + /* The magic 32768 offset here and in the other sysv call insns + corresponds to the offset of r30 in .got2, as given by LCTOC1. + See sysv4.h:toc_section. */ + return "bl %z0+32768@plt"; + else + return "bl %z0@plt"; + } + else + return "bl %z0"; +#endif } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) -(define_insn "*call_value_indirect_nonlocal_sysv" +(define_insn "*call_value_indirect_nonlocal_sysv" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "register_operand" "cl,cl")) - (match_operand 2 "" "g,g"))) - (use (match_operand:SI 3 "immediate_operand" "O,n")) - (clobber (match_scratch:SI 4 "=l,l"))] + (call (mem:SI (match_operand:P 1 "register_operand" "c,*l,c,*l")) + (match_operand 2 "" "g,g,g,g"))) + (use (match_operand:SI 3 "immediate_operand" "O,O,n,n")) + (clobber (match_scratch:SI 4 "=l,l,l,l"))] "DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN" { @@ -10492,12 +10778,12 @@ return "b%T1l"; } - [(set_attr "type" "jmpreg,jmpreg") - (set_attr "length" "4,8")]) + [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg") + (set_attr "length" "4,4,8,8")]) -(define_insn "*call_value_nonlocal_sysv" +(define_insn "*call_value_nonlocal_sysv" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s")) + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s")) (match_operand 2 "" "g,g"))) (use (match_operand:SI 3 "immediate_operand" "O,n")) (clobber (match_scratch:SI 4 "=l,l"))] @@ -10514,8 +10800,16 @@ #if TARGET_MACHO return output_call(insn, operands, 1, 3); #else - return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@plt" : "bl %z1"; -#endif + if (DEFAULT_ABI == ABI_V4 && flag_pic) + { + if (TARGET_SECURE_PLT && flag_pic == 2) + return "bl %z1+32768@plt"; + else + return "bl %z1@plt"; + } + else + return "bl %z1"; +#endif } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10563,8 +10857,8 @@ operands[0] = machopic_indirect_call_target (operands[0]); #endif - if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); + gcc_assert (GET_CODE (operands[1]) == CONST_INT); operands[0] = XEXP (operands[0], 0); operands[3] = gen_reg_rtx (SImode); @@ -10677,7 +10971,7 @@ (use (match_operand:SI 2 "immediate_operand" "O")) (use (match_operand:SI 3 "register_operand" "l")) (return)] - "TARGET_64BIT + "TARGET_64BIT && DEFAULT_ABI == ABI_AIX && (INTVAL (operands[2]) & CALL_LONG) == 0" "b %z0" @@ -10705,15 +10999,15 @@ (use (match_operand:SI 3 "immediate_operand" "O")) (use (match_operand:SI 4 "register_operand" "l")) (return)] - "TARGET_64BIT + "TARGET_64BIT && DEFAULT_ABI == ABI_AIX && (INTVAL (operands[3]) & CALL_LONG) == 0" "b %z1" [(set_attr "type" "branch") (set_attr "length" "4")]) -(define_insn "*sibcall_nonlocal_sysv" - [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s")) +(define_insn "*sibcall_nonlocal_sysv" + [(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s")) (match_operand 1 "" "")) (use (match_operand 2 "immediate_operand" "O,n")) (use (match_operand:SI 3 "register_operand" "l,l")) @@ -10729,7 +11023,15 @@ else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn (\"creqv 6,6,6\", operands); - return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z0@plt\" : \"b %z0\"; + if (DEFAULT_ABI == ABI_V4 && flag_pic) + { + if (TARGET_SECURE_PLT && flag_pic == 2) + return \"b %z0+32768@plt\"; + else + return \"b %z0@plt\"; + } + else + return \"b %z0\"; }" [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10749,17 +11051,17 @@ operands[1] = machopic_indirect_call_target (operands[1]); #endif - if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); operands[1] = XEXP (operands[1], 0); operands[4] = gen_reg_rtx (SImode); }") -(define_insn "*sibcall_value_nonlocal_sysv" +(define_insn "*sibcall_value_nonlocal_sysv" [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s")) + (call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s")) (match_operand 2 "" ""))) (use (match_operand:SI 3 "immediate_operand" "O,n")) (use (match_operand:SI 4 "register_operand" "l,l")) @@ -10775,7 +11077,15 @@ else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn (\"creqv 6,6,6\", operands); - return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z1@plt\" : \"b %z1\"; + if (DEFAULT_ABI == ABI_V4 && flag_pic) + { + if (TARGET_SECURE_PLT && flag_pic == 2) + return \"b %z1+32768@plt\"; + else + return \"b %z1@plt\"; + } + else + return \"b %z1\"; }" [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10803,10 +11113,10 @@ ;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc ;; insns, and branches. We store the operands of compares until we see ;; how it is used. -(define_expand "cmpsi" +(define_expand "cmp" [(set (cc0) - (compare (match_operand:SI 0 "gpc_reg_operand" "") - (match_operand:SI 1 "reg_or_short_operand" "")))] + (compare (match_operand:GPR 0 "gpc_reg_operand" "") + (match_operand:GPR 1 "reg_or_short_operand" "")))] "" " { @@ -10814,7 +11124,7 @@ this might be a logical operation. That insn doesn't exist. */ if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 0) - operands[1] = force_reg (SImode, operands[1]); + operands[1] = force_reg (mode, operands[1]); rs6000_compare_op0 = operands[0]; rs6000_compare_op1 = operands[1]; @@ -10822,54 +11132,10 @@ DONE; }") -(define_expand "cmpdi" - [(set (cc0) - (compare (match_operand:DI 0 "gpc_reg_operand" "") - (match_operand:DI 1 "reg_or_short_operand" "")))] - "TARGET_POWERPC64" - " -{ - /* Take care of the possibility that operands[1] might be negative but - this might be a logical operation. That insn doesn't exist. */ - if (GET_CODE (operands[1]) == CONST_INT - && INTVAL (operands[1]) < 0) - operands[1] = force_reg (DImode, operands[1]); - - rs6000_compare_op0 = operands[0]; - rs6000_compare_op1 = operands[1]; - rs6000_compare_fp_p = 0; - DONE; -}") - -(define_expand "cmpsf" - [(set (cc0) (compare (match_operand:SF 0 "gpc_reg_operand" "") - (match_operand:SF 1 "gpc_reg_operand" "")))] - "TARGET_HARD_FLOAT" - " -{ - rs6000_compare_op0 = operands[0]; - rs6000_compare_op1 = operands[1]; - rs6000_compare_fp_p = 1; - DONE; -}") - -(define_expand "cmpdf" - [(set (cc0) (compare (match_operand:DF 0 "gpc_reg_operand" "") - (match_operand:DF 1 "gpc_reg_operand" "")))] - "TARGET_HARD_FLOAT && TARGET_FPRS" - " -{ - rs6000_compare_op0 = operands[0]; - rs6000_compare_op1 = operands[1]; - rs6000_compare_fp_p = 1; - DONE; -}") - -(define_expand "cmptf" - [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "") - (match_operand:TF 1 "gpc_reg_operand" "")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) - && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" +(define_expand "cmp" + [(set (cc0) (compare (match_operand:FP 0 "gpc_reg_operand" "") + (match_operand:FP 1 "gpc_reg_operand" "")))] + "" " { rs6000_compare_op0 = operands[0]; @@ -10930,12 +11196,12 @@ (define_expand "bunordered" [(use (match_operand 0 "" ""))] - "" + "! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)" "{ rs6000_emit_cbranch (UNORDERED, operands[0]); DONE; }") (define_expand "bordered" [(use (match_operand 0 "" ""))] - "" + "! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)" "{ rs6000_emit_cbranch (ORDERED, operands[0]); DONE; }") (define_expand "buneq" @@ -10982,11 +11248,11 @@ [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))] "" " -{ +{ if (! rs6000_compare_fp_p) FAIL; - rs6000_emit_sCOND (NE, operands[0]); + rs6000_emit_sCOND (NE, operands[0]); DONE; }") @@ -10996,8 +11262,7 @@ "" " { - if (! rs6000_compare_fp_p - && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx)) + if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx) FAIL; rs6000_emit_sCOND (GE, operands[0]); @@ -11010,11 +11275,10 @@ "" " { - if (! rs6000_compare_fp_p - && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx)) + if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx) FAIL; - rs6000_emit_sCOND (GT, operands[0]); + rs6000_emit_sCOND (GT, operands[0]); DONE; }") @@ -11024,11 +11288,10 @@ "" " { - if (! rs6000_compare_fp_p - && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx)) + if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx) FAIL; - rs6000_emit_sCOND (LE, operands[0]); + rs6000_emit_sCOND (LE, operands[0]); DONE; }") @@ -11038,11 +11301,10 @@ "" " { - if (! rs6000_compare_fp_p - && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx)) + if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx) FAIL; - rs6000_emit_sCOND (LT, operands[0]); + rs6000_emit_sCOND (LT, operands[0]); DONE; }") @@ -11068,12 +11330,12 @@ (define_expand "sunordered" [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))] - "" + "! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)" "{ rs6000_emit_sCOND (UNORDERED, operands[0]); DONE; }") (define_expand "sordered" [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))] - "" + "! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)" "{ rs6000_emit_sCOND (ORDERED, operands[0]); DONE; }") (define_expand "suneq" @@ -11106,51 +11368,138 @@ "" "{ rs6000_emit_sCOND (LTGT, operands[0]); DONE; }") +(define_expand "stack_protect_set" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx tlsreg = gen_rtx_REG (Pmode, TARGET_64BIT ? 13 : 2); + rtx addr = gen_rtx_PLUS (Pmode, tlsreg, GEN_INT (TARGET_THREAD_SSP_OFFSET)); + operands[1] = gen_rtx_MEM (Pmode, addr); +#endif + if (TARGET_64BIT) + emit_insn (gen_stack_protect_setdi (operands[0], operands[1])); + else + emit_insn (gen_stack_protect_setsi (operands[0], operands[1])); + DONE; +}) + +(define_insn "stack_protect_setsi" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec:SI [(match_operand:SI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:SI 2 "=&r") (const_int 0))] + "TARGET_32BIT" + "{l%U1%X1|lwz%U1%X1} %2,%1\;{st%U0%X0|stw%U0%X0} %2,%0\;{lil|li} %2,0" + [(set_attr "type" "three") + (set_attr "length" "12")]) + +(define_insn "stack_protect_setdi" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:DI 2 "=&r") (const_int 0))] + "TARGET_64BIT" + "ld%U1%X1 %2,%1\;std%U0%X0 %2,%0\;{lil|li} %2,0" + [(set_attr "type" "three") + (set_attr "length" "12")]) + +(define_expand "stack_protect_test" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "") + (match_operand 2 "" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx tlsreg = gen_rtx_REG (Pmode, TARGET_64BIT ? 13 : 2); + rtx addr = gen_rtx_PLUS (Pmode, tlsreg, GEN_INT (TARGET_THREAD_SSP_OFFSET)); + operands[1] = gen_rtx_MEM (Pmode, addr); +#endif + rs6000_compare_op0 = operands[0]; + rs6000_compare_op1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, operands[1]), + UNSPEC_SP_TEST); + rs6000_compare_fp_p = 0; + emit_jump_insn (gen_beq (operands[2])); + DONE; +}) + +(define_insn "stack_protect_testsi" + [(set (match_operand:CCEQ 0 "cc_reg_operand" "=x,?y") + (unspec:CCEQ [(match_operand:SI 1 "memory_operand" "m,m") + (match_operand:SI 2 "memory_operand" "m,m")] + UNSPEC_SP_TEST)) + (set (match_scratch:SI 4 "=r,r") (const_int 0)) + (clobber (match_scratch:SI 3 "=&r,&r"))] + "TARGET_32BIT" + "@ + {l%U1%X1|lwz%U1%X1} %3,%1\;{l%U2%X2|lwz%U2%X2} %4,%2\;xor. %3,%3,%4\;{lil|li} %4,0 + {l%U1%X1|lwz%U1%X1} %3,%1\;{l%U2%X2|lwz%U2%X2} %4,%2\;{cmpl|cmplw} %0,%3,%4\;{lil|li} %3,0\;{lil|li} %4,0" + [(set_attr "length" "16,20")]) + +(define_insn "stack_protect_testdi" + [(set (match_operand:CCEQ 0 "cc_reg_operand" "=x,?y") + (unspec:CCEQ [(match_operand:DI 1 "memory_operand" "m,m") + (match_operand:DI 2 "memory_operand" "m,m")] + UNSPEC_SP_TEST)) + (set (match_scratch:DI 4 "=r,r") (const_int 0)) + (clobber (match_scratch:DI 3 "=&r,&r"))] + "TARGET_64BIT" + "@ + ld%U1%X1 %3,%1\;ld%U2%X2 %4,%2\;xor. %3,%3,%4\;{lil|li} %4,0 + ld%U1%X1 %3,%1\;ld%U2%X2 %4,%2\;cmpld %0,%3,%4\;{lil|li} %3,0\;{lil|li} %4,0" + [(set_attr "length" "16,20")]) + ;; Here are the actual compare insns. -(define_insn "*cmpsi_internal1" +(define_insn "*cmp_internal1" [(set (match_operand:CC 0 "cc_reg_operand" "=y") - (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI")))] + (compare:CC (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "reg_or_short_operand" "rI")))] "" - "{cmp%I2|cmpw%I2} %0,%1,%2" - [(set_attr "type" "cmp")]) - -(define_insn "*cmpdi_internal1" - [(set (match_operand:CC 0 "cc_reg_operand" "=y") - (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "reg_or_short_operand" "rI")))] - "TARGET_POWERPC64" - "cmpd%I2 %0,%1,%2" + "{cmp%I2|cmp%I2} %0,%1,%2" [(set_attr "type" "cmp")]) ;; If we are comparing a register for equality with a large constant, -;; we can do this with an XOR followed by a compare. But we need a scratch -;; register for the result of the XOR. +;; we can do this with an XOR followed by a compare. But this is profitable +;; only if the large constant is only used for the comparison (and in this +;; case we already have a register to reuse as scratch). +;; +;; For 64-bit registers, we could only do so if the constant's bit 15 is clear: +;; otherwise we'd need to XOR with FFFFFFFF????0000 which is not available. -(define_split - [(set (match_operand:CC 0 "cc_reg_operand" "") - (compare:CC (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "non_short_cint_operand" ""))) - (clobber (match_operand:SI 3 "gpc_reg_operand" ""))] - "find_single_use (operands[0], insn, 0) - && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ - || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)" - [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4))) - (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))] - " +(define_peephole2 + [(set (match_operand:SI 0 "register_operand") + (match_operand:SI 1 "logical_const_operand" "")) + (set (match_dup 0) (match_operator:SI 3 "boolean_or_operator" + [(match_dup 0) + (match_operand:SI 2 "logical_const_operand" "")])) + (set (match_operand:CC 4 "cc_reg_operand" "") + (compare:CC (match_operand:SI 5 "gpc_reg_operand" "") + (match_dup 0))) + (set (pc) + (if_then_else (match_operator 6 "equality_operator" + [(match_dup 4) (const_int 0)]) + (match_operand 7 "" "") + (match_operand 8 "" "")))] + "peep2_reg_dead_p (3, operands[0]) + && peep2_reg_dead_p (4, operands[4])" + [(set (match_dup 0) (xor:SI (match_dup 5) (match_dup 9))) + (set (match_dup 4) (compare:CC (match_dup 0) (match_dup 10))) + (set (pc) (if_then_else (match_dup 6) (match_dup 7) (match_dup 8)))] + { - /* Get the constant we are comparing against, C, and see what it looks like - sign-extended to 16 bits. Then see what constant could be XOR'ed - with C to get the sign-extended value. */ - - HOST_WIDE_INT c = INTVAL (operands[2]); + /* Get the constant we are comparing against, and see what it looks like + when sign-extended from 16 to 32 bits. Then see what constant we could + XOR with SEXTC to get the sign-extended value. */ + rtx cnst = simplify_const_binary_operation (GET_CODE (operands[3]), + SImode, + operands[1], operands[2]); + HOST_WIDE_INT c = INTVAL (cnst); HOST_WIDE_INT sextc = ((c & 0xffff) ^ 0x8000) - 0x8000; HOST_WIDE_INT xorv = c ^ sextc; - operands[4] = GEN_INT (xorv); - operands[5] = GEN_INT (sextc); -}") + operands[9] = GEN_INT (xorv); + operands[10] = GEN_INT (sextc); +}) (define_insn "*cmpsi_internal2" [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y") @@ -11234,7 +11583,7 @@ [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f") (match_operand:TF 2 "gpc_reg_operand" "f")))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && !TARGET_XL_COMPAT + "!TARGET_IEEEQUAD && !TARGET_XL_COMPAT && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "fcmpu %0,%1,%2\;bne %0,$+8\;fcmpu %0,%L1,%L2" [(set_attr "type" "fpcompare") @@ -11252,7 +11601,7 @@ (clobber (match_scratch:DF 8 "=f")) (clobber (match_scratch:DF 9 "=f")) (clobber (match_scratch:DF 10 "=f"))] - "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_XL_COMPAT + "!TARGET_IEEEQUAD && TARGET_XL_COMPAT && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" "&& reload_completed" @@ -11290,14 +11639,12 @@ DFmode)); if (TARGET_TOC) { - operands[13] = gen_rtx_MEM (DFmode, - create_TOC_reference (XEXP (operands[13], 0))); - operands[14] = gen_rtx_MEM (DFmode, - create_TOC_reference (XEXP (operands[14], 0))); + operands[13] = gen_const_mem (DFmode, + create_TOC_reference (XEXP (operands[13], 0))); + operands[14] = gen_const_mem (DFmode, + create_TOC_reference (XEXP (operands[14], 0))); set_mem_alias_set (operands[13], get_TOC_alias_set ()); set_mem_alias_set (operands[14], get_TOC_alias_set ()); - RTX_UNCHANGING_P (operands[13]) = 1; - RTX_UNCHANGING_P (operands[14]) = 1; } }) @@ -11320,16 +11667,16 @@ (const_string "mfcrf") ] (const_string "mfcr"))) - (set_attr "length" "12")]) + (set_attr "length" "8")]) -;; Same as above, but get the EQ bit. -(define_insn "move_from_CR_eq_bit" +;; Same as above, but get the GT bit. +(define_insn "move_from_CR_gt_bit" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (unspec:SI [(match_operand 1 "cc_reg_operand" "y")] UNSPEC_MV_CR_EQ))] + (unspec:SI [(match_operand 1 "cc_reg_operand" "y")] UNSPEC_MV_CR_GT))] "TARGET_E500" - "mfcr %0\;{rlinm|rlwinm} %0,%0,%D1,1" + "mfcr %0\;{rlinm|rlwinm} %0,%0,%D1,31,31" [(set_attr "type" "mfcr") - (set_attr "length" "12")]) + (set_attr "length" "8")]) ;; Same as above, but get the OV/ORDERED bit. (define_insn "move_from_CR_ov_bit" @@ -11338,7 +11685,7 @@ "TARGET_ISEL" "mfcr %0\;{rlinm|rlwinm} %0,%0,%t1,1" [(set_attr "type" "mfcr") - (set_attr "length" "12")]) + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") @@ -11352,7 +11699,7 @@ (const_string "mfcrf") ] (const_string "mfcr"))) - (set_attr "length" "12")]) + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -11367,7 +11714,7 @@ mfcr %3%Q2\;{rlinm.|rlwinm.} %3,%3,%J1,1 #" [(set_attr "type" "delayed_compare") - (set_attr "length" "12,16")]) + (set_attr "length" "8,16")]) (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") @@ -11413,7 +11760,7 @@ (const_string "mfcrf") ] (const_string "mfcr"))) - (set_attr "length" "12")]) + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -11448,7 +11795,7 @@ return \"mfcr %4%Q2\;{rlinm.|rlwinm.} %4,%4,%5,%6,%6\"; }" [(set_attr "type" "delayed_compare") - (set_attr "length" "12,16")]) + (set_attr "length" "8,16")]) (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") @@ -11485,7 +11832,7 @@ "REGNO (operands[2]) != REGNO (operands[5])" "mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1" [(set_attr "type" "mfcr") - (set_attr "length" "20")]) + (set_attr "length" "12")]) (define_peephole [(set (match_operand:DI 0 "gpc_reg_operand" "=r") @@ -11499,7 +11846,7 @@ "TARGET_POWERPC64 && REGNO (operands[2]) != REGNO (operands[5])" "mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1" [(set_attr "type" "mfcr") - (set_attr "length" "20")]) + (set_attr "length" "12")]) ;; There are some scc insns that can be done directly, without a compare. ;; These are faster because they don't involve the communications between @@ -11515,117 +11862,96 @@ ;; otherwise won't accept constants. We do this because it is faster than ;; the cmp/mfcr sequence we would otherwise generate. -(define_insn "" +(define_mode_attr scc_eq_op2 [(SI "rKLI") + (DI "rKJI")]) + +(define_insn_and_split "*eq" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (eq:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "scc_eq_operand" "")))] + "!TARGET_POWER" + "#" + "!TARGET_POWER" + [(set (match_dup 0) + (clz:GPR (match_dup 3))) + (set (match_dup 0) + (lshiftrt:GPR (match_dup 0) (match_dup 4)))] + { + if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0) + { + /* Use output operand as intermediate. */ + operands[3] = operands[0]; + + if (logical_operand (operands[2], mode)) + emit_insn (gen_rtx_SET (VOIDmode, operands[3], + gen_rtx_XOR (mode, + operands[1], operands[2]))); + else + emit_insn (gen_rtx_SET (VOIDmode, operands[3], + gen_rtx_PLUS (mode, operands[1], + negate_rtx (mode, + operands[2])))); + } + else + operands[3] = operands[1]; + + operands[4] = GEN_INT (exact_log2 (GET_MODE_BITSIZE (mode))); + }) + +(define_insn_and_split "*eq_compare" + [(set (match_operand:CC 3 "cc_reg_operand" "=y") + (compare:CC + (eq:P (match_operand:P 1 "gpc_reg_operand" "=r") + (match_operand:P 2 "scc_eq_operand" "")) + (const_int 0))) + (set (match_operand:P 0 "gpc_reg_operand" "=r") + (eq:P (match_dup 1) (match_dup 2)))] + "!TARGET_POWER && optimize_size" + "#" + "!TARGET_POWER && optimize_size" + [(set (match_dup 0) + (clz:P (match_dup 4))) + (parallel [(set (match_dup 3) + (compare:CC (lshiftrt:P (match_dup 0) (match_dup 5)) + (const_int 0))) + (set (match_dup 0) + (lshiftrt:P (match_dup 0) (match_dup 5)))])] + { + if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0) + { + /* Use output operand as intermediate. */ + operands[4] = operands[0]; + + if (logical_operand (operands[2], mode)) + emit_insn (gen_rtx_SET (VOIDmode, operands[4], + gen_rtx_XOR (mode, + operands[1], operands[2]))); + else + emit_insn (gen_rtx_SET (VOIDmode, operands[4], + gen_rtx_PLUS (mode, operands[1], + negate_rtx (mode, + operands[2])))); + } + else + operands[4] = operands[1]; + + operands[5] = GEN_INT (exact_log2 (GET_MODE_BITSIZE (mode))); + }) + +(define_insn "*eqsi_power" [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r") (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r") (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))) (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))] - "TARGET_32BIT" + "TARGET_POWER" "@ xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0 {sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0" - [(set_attr "length" "12,8,12,12,12")]) - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r") - (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r") - (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I"))) - (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))] - "TARGET_64BIT" - "@ - xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0 - subfic %3,%1,0\;adde %0,%3,%1 - xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0 - xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0 - subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0" - [(set_attr "length" "12,8,12,12,12")]) - -(define_insn "" - [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y") - (compare:CC - (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r") - (eq:SI (match_dup 1) (match_dup 2))) - (clobber (match_scratch:SI 3 "=r,&r,r,r,r,r,&r,r,r,r"))] - "TARGET_32BIT" - "@ - xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0 - {sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1 - {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0 - {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0 - {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0 - # - # - # - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,8,12,12,12,16,12,16,16,16")]) - -(define_split - [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "") - (compare:CC - (eq:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_cint_operand" "")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (eq:SI (match_dup 1) (match_dup 2))) - (clobber (match_scratch:SI 3 ""))] - "TARGET_32BIT && reload_completed" - [(parallel [(set (match_dup 0) - (eq:SI (match_dup 1) (match_dup 2))) - (clobber (match_dup 3))]) - (set (match_dup 4) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y") - (compare:CC - (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I,r,O,K,J,I")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r") - (eq:DI (match_dup 1) (match_dup 2))) - (clobber (match_scratch:DI 3 "=r,&r,r,r,r,r,&r,r,r,r"))] - "TARGET_64BIT" - "@ - xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0 - subfic %3,%1,0\;adde. %0,%3,%1 - xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0 - xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0 - subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0 - # - # - # - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,8,12,12,12,16,12,16,16,16")]) - -(define_split - [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "") - (compare:CC - (eq:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_cint_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (eq:DI (match_dup 1) (match_dup 2))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_64BIT && reload_completed" - [(parallel [(set (match_dup 0) - (eq:DI (match_dup 1) (match_dup 2))) - (clobber (match_dup 3))]) - (set (match_dup 4) - (compare:CC (match_dup 0) - (const_int 0)))] - "") + [(set_attr "type" "three,two,three,three,three") + (set_attr "length" "12,8,12,12,12")]) ;; We have insns of the form shown by the first define_insn below. If ;; there is something inside the comparison operation, we must split it. @@ -11642,10 +11968,10 @@ (set (match_dup 2) (plus:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)]) (match_dup 4)))]) -(define_insn "" +(define_insn "*plus_eqsi" [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r") (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r") - (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I")) + (match_operand:SI 2 "scc_eq_operand" "r,O,K,L,I")) (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r")))] "TARGET_32BIT" "@ @@ -11654,18 +11980,19 @@ {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3" - [(set_attr "length" "12,8,12,12,12")]) + [(set_attr "type" "three,two,three,three,three") + (set_attr "length" "12,8,12,12,12")]) -(define_insn "" +(define_insn "*compare_plus_eqsi" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y") (compare:CC (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I")) + (match_operand:SI 2 "scc_eq_operand" "r,O,K,L,I,r,O,K,L,I")) (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r")) (const_int 0))) (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))] - "TARGET_32BIT" + "TARGET_32BIT && optimize_size" "@ xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3 {sfi|subfic} %4,%1,0\;{aze.|addze.} %4,%3 @@ -11685,11 +12012,11 @@ (compare:CC (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_cint_operand" "")) + (match_operand:SI 2 "scc_eq_operand" "")) (match_operand:SI 3 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 4 ""))] - "TARGET_32BIT && reload_completed" + "TARGET_32BIT && optimize_size && reload_completed" [(set (match_dup 4) (plus:SI (eq:SI (match_dup 1) (match_dup 2)) @@ -11699,17 +12026,17 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "*plus_eqsi_compare" [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y") (compare:CC (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r") - (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I")) + (match_operand:SI 2 "scc_eq_operand" "r,O,K,L,I,r,O,K,L,I")) (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r") (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT" + "TARGET_32BIT && optimize_size" "@ xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3 {sfi|subfic} %0,%1,0\;{aze.|addze.} %0,%3 @@ -11729,12 +12056,12 @@ (compare:CC (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_cint_operand" "")) + (match_operand:SI 2 "scc_eq_operand" "")) (match_operand:SI 3 "gpc_reg_operand" "")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT && reload_completed" + "TARGET_32BIT && optimize_size && reload_completed" [(set (match_dup 0) (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3))) (set (match_dup 4) @@ -11742,41 +12069,67 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r") - (neg:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r") - (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))))] - "TARGET_32BIT" - "@ - xor %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0 - {ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0 - {xoril|xori} %0,%1,%b2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0 - {xoriu|xoris} %0,%1,%u2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0 - {sfi|subfic} %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0" - [(set_attr "length" "12,8,12,12,12")]) +(define_insn "*neg_eq0" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (neg:P (eq:P (match_operand:P 1 "gpc_reg_operand" "r") + (const_int 0))))] + "" + "{ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0" + [(set_attr "type" "two") + (set_attr "length" "8")]) + +(define_insn_and_split "*neg_eq" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (neg:P (eq:P (match_operand:P 1 "gpc_reg_operand" "%r") + (match_operand:P 2 "scc_eq_operand" ""))))] + "" + "#" + "" + [(set (match_dup 0) (neg:P (eq:P (match_dup 3) (const_int 0))))] + { + if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != 0) + { + /* Use output operand as intermediate. */ + operands[3] = operands[0]; + + if (logical_operand (operands[2], mode)) + emit_insn (gen_rtx_SET (VOIDmode, operands[3], + gen_rtx_XOR (mode, + operands[1], operands[2]))); + else + emit_insn (gen_rtx_SET (VOIDmode, operands[3], + gen_rtx_PLUS (mode, operands[1], + negate_rtx (mode, + operands[2])))); + } + else + operands[3] = operands[1]; + }) ;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power, ;; since it nabs/sr is just as fast. -(define_insn "*ne0" +(define_insn "*ne0si" [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) (const_int 31))) (clobber (match_scratch:SI 2 "=&r"))] "! TARGET_POWER && TARGET_32BIT && !TARGET_ISEL" "{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) -(define_insn "" +(define_insn "*ne0di" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) (const_int 63))) (clobber (match_scratch:DI 2 "=&r"))] "TARGET_64BIT" "addic %2,%1,-1\;subfe %0,%2,%1" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) ;; This is what (plus (ne X (const_int 0)) Y) looks like. -(define_insn "" +(define_insn "*plus_ne0si" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) @@ -11785,9 +12138,10 @@ (clobber (match_scratch:SI 3 "=&r"))] "TARGET_32BIT" "{ai|addic} %3,%1,-1\;{aze|addze} %0,%2" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) -(define_insn "" +(define_insn "*plus_ne0di" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) @@ -11796,9 +12150,10 @@ (clobber (match_scratch:DI 3 "=&r"))] "TARGET_64BIT" "addic %3,%1,-1\;addze %0,%2" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) -(define_insn "" +(define_insn "*compare_plus_ne0si" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (compare:CC (plus:SI (lshiftrt:SI @@ -11836,7 +12191,7 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "*compare_plus_ne0di" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (compare:CC (plus:DI (lshiftrt:DI @@ -11871,7 +12226,7 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "*plus_ne0si_compare" [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y") (compare:CC (plus:SI (lshiftrt:SI @@ -11912,7 +12267,7 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "*plus_ne0di_compare" [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y") (compare:CC (plus:DI (lshiftrt:DI @@ -12090,62 +12445,24 @@ {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{srai|srawi} %0,%0,31" [(set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI")))] - "TARGET_32BIT" +(define_insn "*leu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (leu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI")))] + "" "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "reg_or_short_operand" "rI")))] - "TARGET_64BIT" - "subf%I2c %0,%1,%2\;li %0,0\;adde %0,%0,%0" - [(set_attr "length" "12")]) - -(define_insn "" +(define_insn "*leu_compare" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") (compare:CC - (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "reg_or_short_operand" "rI,rI")) + (leu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_short_operand" "rI,rI")) (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (leu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0 - #" - [(set_attr "type" "compare") - (set_attr "length" "12,16")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC - (leu:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (leu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (leu:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC - (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_short_operand" "rI,rI")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (leu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (leu:P (match_dup 1) (match_dup 2)))] + "" "@ {sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0 #" @@ -12155,27 +12472,28 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC - (leu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) + (leu:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "reg_or_short_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (leu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (leu:P (match_dup 1) (match_dup 2)))] + "reload_completed" [(set (match_dup 0) - (leu:SI (match_dup 1) (match_dup 2))) + (leu:P (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") - (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI")) - (match_operand:SI 3 "gpc_reg_operand" "r")))] - "TARGET_32BIT" +(define_insn "*plus_leu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r") + (plus:P (leu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI")) + (match_operand:P 3 "gpc_reg_operand" "r")))] + "" "{sf%I2|subf%I2c} %0,%1,%2\;{aze|addze} %0,%3" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -12242,23 +12560,25 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (neg:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI"))))] - "TARGET_32BIT" +(define_insn "*neg_leu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (neg:P (leu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI"))))] + "" "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") - (and:SI (neg:SI - (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI"))) - (match_operand:SI 3 "gpc_reg_operand" "r")))] - "TARGET_32BIT" +(define_insn "*and_neg_leu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r") + (and:P (neg:P + (leu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI"))) + (match_operand:P 3 "gpc_reg_operand" "r")))] + "" "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -12451,138 +12771,75 @@ "doz%I2 %0,%1,%2\;nabs %0,%0\;{srai|srawi} %0,%0,31" [(set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))] - "TARGET_32BIT" - "@ - {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg %0,%0 - {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg %0,%0" - [(set_attr "length" "12")]) +(define_insn_and_split "*ltu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (ltu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P")))] + "" + "#" + "" + [(set (match_dup 0) (neg:P (ltu:P (match_dup 1) (match_dup 2)))) + (set (match_dup 0) (neg:P (match_dup 0)))] + "") -(define_insn "" +(define_insn_and_split "*ltu_compare" [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") (compare:CC - (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")) + (ltu:P (match_operand:P 1 "gpc_reg_operand" "r,r,r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P,r,P")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") - (ltu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT" - "@ - {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg. %0,%0 - {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,12,16,16")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC - (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_neg_short_operand" "")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (ltu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (ltu:SI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] + (set (match_operand:P 0 "gpc_reg_operand" "=r,r,r,r") + (ltu:P (match_dup 1) (match_dup 2)))] + "" + "#" + "" + [(set (match_dup 0) (neg:P (ltu:P (match_dup 1) (match_dup 2)))) + (parallel [(set (match_dup 3) + (compare:CC (neg:P (match_dup 0)) (const_int 0))) + (set (match_dup 0) (neg:P (match_dup 0)))])] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r") - (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")) - (match_operand:SI 3 "reg_or_short_operand" "rI,rI")))] - "TARGET_32BIT" - "@ - {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3 - {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3" - [(set_attr "length" "12")]) - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC - (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")) - (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r")) - (const_int 0))) - (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))] - "TARGET_32BIT" - "@ - {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3 - {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,12,16,16")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_neg_short_operand" "")) - (match_operand:SI 3 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:SI 4 ""))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 4) - (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) - (match_dup 3))) - (set (match_dup 0) - (compare:CC (match_dup 4) - (const_int 0)))] +(define_insn_and_split "*plus_ltu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r,r") + (plus:P (ltu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P")) + (match_operand:P 3 "reg_or_short_operand" "rI,rI")))] + "" + "#" + "&& !reg_overlap_mentioned_p (operands[0], operands[3])" + [(set (match_dup 0) (neg:P (ltu:P (match_dup 1) (match_dup 2)))) + (set (match_dup 0) (minus:P (match_dup 3) (match_dup 0)))] "") -(define_insn "" +(define_insn_and_split "*plus_ltu_compare" [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y") (compare:CC - (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")) - (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r")) + (plus:P (ltu:P (match_operand:P 1 "gpc_reg_operand" "r,r,r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P,r,P")) + (match_operand:P 3 "gpc_reg_operand" "r,r,r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r") - (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT" - "@ - {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3 - {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,12,16,16")]) - -(define_split - [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_neg_short_operand" "")) - (match_operand:SI 3 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 4) - (compare:CC (match_dup 0) - (const_int 0)))] + (set (match_operand:P 0 "gpc_reg_operand" "=&r,&r,&r,&r") + (plus:P (ltu:P (match_dup 1) (match_dup 2)) (match_dup 3)))] + "" + "#" + "&& !reg_overlap_mentioned_p (operands[0], operands[3])" + [(set (match_dup 0) (neg:P (ltu:P (match_dup 1) (match_dup 2)))) + (parallel [(set (match_dup 4) + (compare:CC (minus:P (match_dup 3) (match_dup 0)) + (const_int 0))) + (set (match_dup 0) (minus:P (match_dup 3) (match_dup 0)))])] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (neg:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))))] - "TARGET_32BIT" +(define_insn "*neg_ltu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (neg:P (ltu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P"))))] + "" "@ {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") @@ -12709,35 +12966,26 @@ "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0" [(set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))] - "TARGET_32BIT" +(define_insn "*geu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (geu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P")))] + "" "@ {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "reg_or_neg_short_operand" "r,P")))] - "TARGET_64BIT" - "@ - subfc %0,%2,%1\;li %0,0\;adde %0,%0,%0 - addic %0,%1,%n2\;li %0,0\;adde %0,%0,%0" - [(set_attr "length" "12")]) - -(define_insn "" +(define_insn "*geu_compare" [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") (compare:CC - (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")) + (geu:P (match_operand:P 1 "gpc_reg_operand" "r,r,r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P,r,P")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") - (geu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r,r,r") + (geu:P (match_dup 1) (match_dup 2)))] + "" "@ {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0 @@ -12749,62 +12997,30 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC - (geu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_neg_short_operand" "")) + (geu:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "reg_or_neg_short_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (geu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (geu:P (match_dup 1) (match_dup 2)))] + "reload_completed" [(set (match_dup 0) - (geu:SI (match_dup 1) (match_dup 2))) + (geu:P (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC - (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:DI 2 "reg_or_neg_short_operand" "r,P,r,P")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r") - (geu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subfc %0,%2,%1\;li %0,0\;adde. %0,%0,%0 - addic %0,%1,%n2\;li %0,0\;adde. %0,%0,%0 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "12,12,16,16")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC - (geu:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_neg_short_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (geu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (geu:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r") - (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")) - (match_operand:SI 3 "gpc_reg_operand" "r,r")))] - "TARGET_32BIT" +(define_insn "*plus_geu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r,&r") + (plus:P (geu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P")) + (match_operand:P 3 "gpc_reg_operand" "r,r")))] + "" "@ {sf|subfc} %0,%2,%1\;{aze|addze} %0,%3 {ai|addic} %0,%1,%n2\;{aze|addze} %0,%3" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") @@ -12875,27 +13091,29 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (neg:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_short_operand" "r,I"))))] - "TARGET_32BIT" +(define_insn "*neg_geu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (neg:P (geu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_short_operand" "r,I"))))] + "" "@ {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0 {sfi|subfic} %0,%1,-1\;{a%I2|add%I2c} %0,%0,%2\;{sfe|subfe} %0,%0,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r") - (and:SI (neg:SI - (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))) - (match_operand:SI 3 "gpc_reg_operand" "r,r")))] - "TARGET_32BIT" +(define_insn "*and_neg_geu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r,&r") + (and:P (neg:P + (geu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_neg_short_operand" "r,P"))) + (match_operand:P 3 "gpc_reg_operand" "r,r")))] + "" "@ {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") @@ -12970,84 +13188,6 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (const_int 0)))] - "TARGET_32BIT" - "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri|srwi} %0,%0,31" - [(set_attr "length" "12")]) - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (const_int 0)))] - "TARGET_64BIT" - "subfic %0,%1,0\;addme %0,%0\;srdi %0,%0,63" - [(set_attr "length" "12")]) - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC - (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (const_int 0)) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (gt:SI (match_dup 1) (const_int 0)))] - "TARGET_32BIT" - "@ - {sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri.|srwi.} %0,%0,31 - #" - [(set_attr "type" "delayed_compare") - (set_attr "length" "12,16")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC - (gt:SI (match_operand:SI 1 "gpc_reg_operand" "") - (const_int 0)) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (gt:SI (match_dup 1) (const_int 0)))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (gt:SI (match_dup 1) (const_int 0))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC - (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (const_int 0)) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (gt:DI (match_dup 1) (const_int 0)))] - "TARGET_64BIT" - "@ - subfic %0,%1,0\;addme %0,%0\;srdi. %0,%0,63 - #" - [(set_attr "type" "delayed_compare") - (set_attr "length" "12,16")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC - (gt:DI (match_operand:DI 1 "gpc_reg_operand" "") - (const_int 0)) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (gt:DI (match_dup 1) (const_int 0)))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (gt:DI (match_dup 1) (const_int 0))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - (define_insn "" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r") @@ -13087,23 +13227,15 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") - (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (const_int 0)) - (match_operand:SI 2 "gpc_reg_operand" "r")))] - "TARGET_32BIT" +(define_insn "*plus_gt0" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r") + (plus:P (gt:P (match_operand:P 1 "gpc_reg_operand" "r") + (const_int 0)) + (match_operand:P 2 "gpc_reg_operand" "r")))] + "" "{a|addc} %0,%1,%1\;{sfe|subfe} %0,%1,%0\;{aze|addze} %0,%2" - [(set_attr "length" "12")]) - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=&r") - (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (const_int 0)) - (match_operand:DI 2 "gpc_reg_operand" "r")))] - "TARGET_64BIT" - "addc %0,%1,%1\;subfe %0,%1,%0\;addze %0,%2" - [(set_attr "length" "12")]) + [(set_attr "type" "three") + (set_attr "length" "12")]) (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") @@ -13308,22 +13440,6 @@ (const_int 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (const_int 0))))] - "TARGET_32BIT" - "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{srai|srawi} %0,%0,31" - [(set_attr "length" "12")]) - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (neg:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (const_int 0))))] - "TARGET_64BIT" - "subfic %0,%1,0\;addme %0,%0\;sradi %0,%0,63" - [(set_attr "length" "12")]) - (define_insn "" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r") @@ -13332,259 +13448,74 @@ "doz %0,%2,%1\;nabs %0,%0\;{srai|srawi} %0,%0,31" [(set_attr "length" "12")]) -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI")))] - "TARGET_32BIT" - "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg %0,%0" - [(set_attr "length" "12")]) +(define_insn_and_split "*gtu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (gtu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI")))] + "" + "#" + "" + [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2)))) + (set (match_dup 0) (neg:P (match_dup 0)))] + "") -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "reg_or_short_operand" "rI")))] - "TARGET_64BIT" - "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg %0,%0" - [(set_attr "length" "12")]) - -(define_insn "" +(define_insn_and_split "*gtu_compare" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") (compare:CC - (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_short_operand" "rI,rI")) + (gtu:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "reg_or_short_operand" "rI,rI")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (gtu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT" - "@ - {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0 - #" - [(set_attr "type" "compare") - (set_attr "length" "12,16")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC - (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (gtu:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (gtu:SI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (gtu:P (match_dup 1) (match_dup 2)))] + "" + "#" + "" + [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2)))) + (parallel [(set (match_dup 3) + (compare:CC (neg:P (match_dup 0)) (const_int 0))) + (set (match_dup 0) (neg:P (match_dup 0)))])] "") -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC - (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "reg_or_short_operand" "rI,rI")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (gtu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg. %0,%0 - #" - [(set_attr "type" "compare") - (set_attr "length" "12,16")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC - (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (gtu:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (gtu:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] +(define_insn_and_split "*plus_gtu" + [(set (match_operand:P 0 "gpc_reg_operand" "=&r") + (plus:P (gtu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI")) + (match_operand:P 3 "reg_or_short_operand" "rI")))] + "" + "#" + "&& !reg_overlap_mentioned_p (operands[0], operands[3])" + [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2)))) + (set (match_dup 0) (minus:P (match_dup 3) (match_dup 0)))] "") -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r") - (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "reg_or_short_operand" "I,rI")) - (match_operand:SI 3 "reg_or_short_operand" "r,rI")))] - "TARGET_32BIT" - "@ - {ai|addic} %0,%1,%k2\;{aze|addze} %0,%3 - {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3" - [(set_attr "length" "8,12")]) - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r") - (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "reg_or_short_operand" "I,rI")) - (match_operand:DI 3 "reg_or_short_operand" "r,rI")))] - "TARGET_64BIT" - "@ - addic %0,%1,%k2\;addze %0,%3 - subf%I2c %0,%1,%2\;subfe %0,%0,%0\;subf%I3c %0,%0,%3" - [(set_attr "length" "8,12")]) - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC - (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r")) - (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r")) - (const_int 0))) - (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))] - "TARGET_32BIT" - "@ - {ai|addic} %4,%1,%k2\;{aze.|addze.} %4,%3 - {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12,12,16")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) - (match_operand:SI 3 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:SI 4 ""))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 4) - (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) - (match_dup 3))) - (set (match_dup 0) - (compare:CC (match_dup 4) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC - (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r")) - (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r")) - (const_int 0))) - (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))] - "TARGET_64BIT" - "@ - addic %4,%1,%k2\;addze. %4,%3 - subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %4,%4,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12,12,16")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (match_operand:DI 3 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 4 ""))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 4) - (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) - (match_dup 3))) - (set (match_dup 0) - (compare:CC (match_dup 4) - (const_int 0)))] - "") - -(define_insn "" +(define_insn_and_split "*plus_gtu_compare" [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y") (compare:CC - (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r")) - (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r")) + (plus:P (gtu:P (match_operand:P 1 "gpc_reg_operand" "r,r,r,r") + (match_operand:P 2 "reg_or_short_operand" "I,r,I,r")) + (match_operand:P 3 "gpc_reg_operand" "r,r,r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r") - (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT" - "@ - {ai|addic} %0,%1,%k2\;{aze.|addze.} %0,%3 - {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12,12,16")]) - -(define_split - [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) - (match_operand:SI 3 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_32BIT && reload_completed" - [(set (match_dup 0) - (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 4) - (compare:CC (match_dup 0) - (const_int 0)))] + (set (match_operand:P 0 "gpc_reg_operand" "=&r,&r,&r,&r") + (plus:P (gtu:P (match_dup 1) (match_dup 2)) (match_dup 3)))] + "" + "#" + "&& !reg_overlap_mentioned_p (operands[0], operands[3])" + [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2)))) + (parallel [(set (match_dup 4) + (compare:CC (minus:P (match_dup 3) (match_dup 0)) + (const_int 0))) + (set (match_dup 0) (minus:P (match_dup 3) (match_dup 0)))])] "") -(define_insn "" - [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC - (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r")) - (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,&r,&r") - (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_64BIT" - "@ - addic %0,%1,%k2\;addze. %0,%3 - subf%I2c %0,%1,%2\;subfe %0,%0,%0\;subfc. %0,%0,%3 - # - #" - [(set_attr "type" "compare") - (set_attr "length" "8,12,12,16")]) - -(define_split - [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "") - (compare:CC - (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (match_operand:DI 3 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3))) - (set (match_dup 4) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (neg:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI"))))] - "TARGET_32BIT" +(define_insn "*neg_gtu" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (neg:P (gtu:P (match_operand:P 1 "gpc_reg_operand" "r") + (match_operand:P 2 "reg_or_short_operand" "rI"))))] + "" "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0" - [(set_attr "length" "8")]) + [(set_attr "type" "two") + (set_attr "length" "8")]) -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (neg:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (match_operand:DI 2 "reg_or_short_operand" "rI"))))] - "TARGET_64BIT" - "subf%I2c %0,%1,%2\;subfe %0,%0,%0" - [(set_attr "length" "8")]) ;; Define both directions of branch and return. If we need a reload ;; register, we'd rather use CR0 since it is much easier to copy a @@ -13618,7 +13549,7 @@ { return output_cbranch (operands[0], NULL, 0, insn); }" - [(set_attr "type" "branch") + [(set_attr "type" "jmpreg") (set_attr "length" "4")]) (define_insn "" @@ -13649,7 +13580,7 @@ { return output_cbranch (operands[0], NULL, 1, insn); }" - [(set_attr "type" "branch") + [(set_attr "type" "jmpreg") (set_attr "length" "4")]) ;; Logic on condition register values. @@ -13731,28 +13662,28 @@ { int positive_1, positive_2; - positive_1 = branch_positive_comparison_operator (operands[1], CCEQmode); - positive_2 = branch_positive_comparison_operator (operands[3], CCEQmode); + positive_1 = branch_positive_comparison_operator (operands[1], + GET_MODE (operands[1])); + positive_2 = branch_positive_comparison_operator (operands[3], + GET_MODE (operands[3])); if (! positive_1) - operands[1] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[2]), - GET_CODE (operands[1])), - SImode, - operands[2], const0_rtx); + operands[1] = gen_rtx_fmt_ee (rs6000_reverse_condition (GET_MODE (operands[2]), + GET_CODE (operands[1])), + SImode, + operands[2], const0_rtx); else if (GET_MODE (operands[1]) != SImode) - operands[1] = gen_rtx (GET_CODE (operands[1]), - SImode, - operands[2], const0_rtx); + operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]), SImode, + operands[2], const0_rtx); if (! positive_2) - operands[3] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[4]), - GET_CODE (operands[3])), - SImode, - operands[4], const0_rtx); + operands[3] = gen_rtx_fmt_ee (rs6000_reverse_condition (GET_MODE (operands[4]), + GET_CODE (operands[3])), + SImode, + operands[4], const0_rtx); else if (GET_MODE (operands[3]) != SImode) - operands[3] = gen_rtx (GET_CODE (operands[3]), - SImode, - operands[4], const0_rtx); + operands[3] = gen_rtx_fmt_ee (GET_CODE (operands[3]), SImode, + operands[4], const0_rtx); if (positive_1 == positive_2) { @@ -13781,33 +13712,16 @@ [(set_attr "type" "jmpreg")]) (define_expand "indirect_jump" - [(set (pc) (match_operand 0 "register_operand" ""))] - "" - " -{ - if (TARGET_32BIT) - emit_jump_insn (gen_indirect_jumpsi (operands[0])); - else - emit_jump_insn (gen_indirect_jumpdi (operands[0])); - DONE; -}") + [(set (pc) (match_operand 0 "register_operand" ""))]) -(define_insn "indirect_jumpsi" - [(set (pc) (match_operand:SI 0 "register_operand" "c,*l"))] - "TARGET_32BIT" +(define_insn "*indirect_jump" + [(set (pc) (match_operand:P 0 "register_operand" "c,*l"))] + "" "@ bctr {br|blr}" [(set_attr "type" "jmpreg")]) -(define_insn "indirect_jumpdi" - [(set (pc) (match_operand:DI 0 "register_operand" "c,*l"))] - "TARGET_64BIT" - "@ - bctr - blr" - [(set_attr "type" "jmpreg")]) - ;; Table jump for switch statements: (define_expand "tablejump" [(use (match_operand 0 "" "")) @@ -13836,7 +13750,7 @@ }") (define_expand "tablejumpdi" - [(set (match_dup 4) + [(set (match_dup 4) (sign_extend:DI (match_operand:SI 0 "lwa_operand" "rm"))) (set (match_dup 3) (plus:DI (match_dup 4) @@ -13850,26 +13764,16 @@ operands[4] = gen_reg_rtx (DImode); }") -(define_insn "" +(define_insn "*tablejump_internal1" [(set (pc) - (match_operand:SI 0 "register_operand" "c,*l")) + (match_operand:P 0 "register_operand" "c,*l")) (use (label_ref (match_operand 1 "" "")))] - "TARGET_32BIT" + "" "@ bctr {br|blr}" [(set_attr "type" "jmpreg")]) -(define_insn "" - [(set (pc) - (match_operand:DI 0 "register_operand" "c,*l")) - (use (label_ref (match_operand 1 "" "")))] - "TARGET_64BIT" - "@ - bctr - blr" - [(set_attr "type" "jmpreg")]) - (define_insn "nop" [(const_int 0)] "" @@ -13905,32 +13809,18 @@ DONE; }") -(define_expand "ctrsi" +(define_expand "ctr" [(parallel [(set (pc) - (if_then_else (ne (match_operand:SI 0 "register_operand" "") + (if_then_else (ne (match_operand:P 0 "register_operand" "") (const_int 1)) (label_ref (match_operand 1 "" "")) (pc))) (set (match_dup 0) - (plus:SI (match_dup 0) + (plus:P (match_dup 0) (const_int -1))) (clobber (match_scratch:CC 2 "")) - (clobber (match_scratch:SI 3 ""))])] - "TARGET_32BIT" - "") - -(define_expand "ctrdi" - [(parallel [(set (pc) - (if_then_else (ne (match_operand:DI 0 "register_operand" "") - (const_int 1)) - (label_ref (match_operand 1 "" "")) - (pc))) - (set (match_dup 0) - (plus:DI (match_dup 0) - (const_int -1))) - (clobber (match_scratch:CC 2 "")) - (clobber (match_scratch:DI 3 ""))])] - "TARGET_64BIT" + (clobber (match_scratch:P 3 ""))])] + "" "") ;; We need to be able to do this for any operand, including MEM, or we @@ -13939,18 +13829,18 @@ ;; For the length attribute to be calculated correctly, the ;; label MUST be operand 0. -(define_insn "*ctrsi_internal1" +(define_insn "*ctr_internal1" [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r,*r") + (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) + (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*q*c*l") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 4 "=X,X,&r,r"))] + "" "* { if (which_alternative != 0) @@ -13963,164 +13853,18 @@ [(set_attr "type" "branch") (set_attr "length" "*,12,16,16")]) -(define_insn "*ctrsi_internal2" +(define_insn "*ctr_internal2" [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r,*r") + (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) + (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*q*c*l") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"bdz %l0\"; - else - return \"{bdn|bdnz} $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal1" - [(set (pc) - (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 1)) - (label_ref (match_operand 0 "" "")) - (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"{bdn|bdnz} %l0\"; - else - return \"bdz $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal2" - [(set (pc) - (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 1)) - (pc) - (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"bdz %l0\"; - else - return \"{bdn|bdnz} $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -;; Similar, but we can use GE since we have a REG_NONNEG. - -(define_insn "*ctrsi_internal3" - [(set (pc) - (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r,*r") - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT && find_reg_note (insn, REG_NONNEG, 0)" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"{bdn|bdnz} %l0\"; - else - return \"bdz $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrsi_internal4" - [(set (pc) - (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r,*r") - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" "")))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT && find_reg_note (insn, REG_NONNEG, 0)" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"bdz %l0\"; - else - return \"{bdn|bdnz} $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal3" - [(set (pc) - (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT && find_reg_note (insn, REG_NONNEG, 0)" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"{bdn|bdnz} %l0\"; - else - return \"bdz $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal4" - [(set (pc) - (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT && find_reg_note (insn, REG_NONNEG, 0)" + (clobber (match_scratch:P 4 "=X,X,&r,r"))] + "" "* { if (which_alternative != 0) @@ -14135,18 +13879,18 @@ ;; Similar but use EQ -(define_insn "*ctrsi_internal5" +(define_insn "*ctr_internal5" [(set (pc) - (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r,*r") + (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) + (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*q*c*l") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 4 "=X,X,&r,r"))] + "" "* { if (which_alternative != 0) @@ -14159,66 +13903,18 @@ [(set_attr "type" "branch") (set_attr "length" "*,12,16,16")]) -(define_insn "*ctrsi_internal6" +(define_insn "*ctr_internal6" [(set (pc) - (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r,*r") + (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) - (set (match_operand:SI 2 "register_operand" "=1,*r,m,*q*c*l") - (plus:SI (match_dup 1) + (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*q*c*l") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:SI 4 "=X,X,&r,r"))] - "TARGET_32BIT" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"{bdn|bdnz} %l0\"; - else - return \"bdz $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal5" - [(set (pc) - (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 1)) - (label_ref (match_operand 0 "" "")) - (pc))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT" - "* -{ - if (which_alternative != 0) - return \"#\"; - else if (get_attr_length (insn) == 4) - return \"bdz %l0\"; - else - return \"{bdn|bdnz} $+8\;b %l0\"; -}" - [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) - -(define_insn "*ctrdi_internal6" - [(set (pc) - (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,*r") - (const_int 1)) - (pc) - (label_ref (match_operand 0 "" "")))) - (set (match_operand:DI 2 "register_operand" "=1,*r,m,*c*l") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) - (clobber (match_scratch:DI 4 "=X,X,&r,r"))] - "TARGET_64BIT" + (clobber (match_scratch:P 4 "=X,X,&r,r"))] + "" "* { if (which_alternative != 0) @@ -14236,49 +13932,47 @@ (define_split [(set (pc) (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:SI 1 "gpc_reg_operand" "") + [(match_operand:P 1 "gpc_reg_operand" "") (const_int 1)]) (match_operand 5 "" "") (match_operand 6 "" ""))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_dup 1) - (const_int -1))) + (set (match_operand:P 0 "gpc_reg_operand" "") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:SI 4 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 4 ""))] + "reload_completed" [(parallel [(set (match_dup 3) - (compare:CC (plus:SI (match_dup 1) + (compare:CC (plus:P (match_dup 1) (const_int -1)) (const_int 0))) (set (match_dup 0) - (plus:SI (match_dup 1) + (plus:P (match_dup 1) (const_int -1)))]) (set (pc) (if_then_else (match_dup 7) (match_dup 5) (match_dup 6)))] " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") +{ operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[2]), VOIDmode, + operands[3], const0_rtx); }") (define_split [(set (pc) (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:SI 1 "gpc_reg_operand" "") + [(match_operand:P 1 "gpc_reg_operand" "") (const_int 1)]) (match_operand 5 "" "") (match_operand 6 "" ""))) - (set (match_operand:SI 0 "nonimmediate_operand" "") - (plus:SI (match_dup 1) (const_int -1))) + (set (match_operand:P 0 "nonimmediate_operand" "") + (plus:P (match_dup 1) (const_int -1))) (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:SI 4 ""))] - "TARGET_32BIT && reload_completed - && ! gpc_reg_operand (operands[0], SImode)" + (clobber (match_scratch:P 4 ""))] + "reload_completed && ! gpc_reg_operand (operands[0], SImode)" [(parallel [(set (match_dup 3) - (compare:CC (plus:SI (match_dup 1) + (compare:CC (plus:P (match_dup 1) (const_int -1)) (const_int 0))) (set (match_dup 4) - (plus:SI (match_dup 1) + (plus:P (match_dup 1) (const_int -1)))]) (set (match_dup 0) (match_dup 4)) @@ -14286,63 +13980,8 @@ (match_dup 5) (match_dup 6)))] " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") -(define_split - [(set (pc) - (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:DI 1 "gpc_reg_operand" "") - (const_int 1)]) - (match_operand 5 "" "") - (match_operand 6 "" ""))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_dup 1) - (const_int -1))) - (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:DI 4 ""))] - "TARGET_64BIT && reload_completed" - [(parallel [(set (match_dup 3) - (compare:CC (plus:DI (match_dup 1) - (const_int -1)) - (const_int 0))) - (set (match_dup 0) - (plus:DI (match_dup 1) - (const_int -1)))]) - (set (pc) (if_then_else (match_dup 7) - (match_dup 5) - (match_dup 6)))] - " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") - -(define_split - [(set (pc) - (if_then_else (match_operator 2 "comparison_operator" - [(match_operand:DI 1 "gpc_reg_operand" "") - (const_int 1)]) - (match_operand 5 "" "") - (match_operand 6 "" ""))) - (set (match_operand:DI 0 "nonimmediate_operand" "") - (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:CC 3 "")) - (clobber (match_scratch:DI 4 ""))] - "TARGET_64BIT && reload_completed - && ! gpc_reg_operand (operands[0], DImode)" - [(parallel [(set (match_dup 3) - (compare:CC (plus:DI (match_dup 1) - (const_int -1)) - (const_int 0))) - (set (match_dup 4) - (plus:DI (match_dup 1) - (const_int -1)))]) - (set (match_dup 0) - (match_dup 4)) - (set (pc) (if_then_else (match_dup 7) - (match_dup 5) - (match_dup 6)))] - " -{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3], - const0_rtx); }") +{ operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[2]), VOIDmode, + operands[3], const0_rtx); }") (define_insn "trap" [(trap_if (const_int 1) (const_int 0))] @@ -14360,19 +13999,11 @@ (define_insn "" [(trap_if (match_operator 0 "trap_comparison_operator" - [(match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "reg_or_short_operand" "rI")]) + [(match_operand:GPR 1 "register_operand" "r") + (match_operand:GPR 2 "reg_or_short_operand" "rI")]) (const_int 0))] "" - "{t|tw}%V0%I2 %1,%2") - -(define_insn "" - [(trap_if (match_operator 0 "trap_comparison_operator" - [(match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "reg_or_short_operand" "rI")]) - (const_int 0))] - "TARGET_POWERPC64" - "td%V0%I2 %1,%2") + "{t|t}%V0%I2 %1,%2") ;; Insns related to generating the function prologue and epilogue. @@ -14408,7 +14039,7 @@ (define_insn "movesi_from_cr" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (unspec:SI [(reg:CC 68) (reg:CC 69) (reg:CC 70) (reg:CC 71) + (unspec:SI [(reg:CC 68) (reg:CC 69) (reg:CC 70) (reg:CC 71) (reg:CC 72) (reg:CC 73) (reg:CC 74) (reg:CC 75)] UNSPEC_MOVESI_FROM_CR))] "" @@ -14420,26 +14051,16 @@ [(set (match_operand:SI 1 "memory_operand" "=m") (match_operand:SI 2 "gpc_reg_operand" "r"))])] "TARGET_MULTIPLE" - "{stm|stmw} %2,%1") - -(define_insn "*save_fpregs_si" - [(match_parallel 0 "any_operand" - [(clobber (match_operand:SI 1 "register_operand" "=l")) - (use (match_operand:SI 2 "call_operand" "s")) - (set (match_operand:DF 3 "memory_operand" "=m") - (match_operand:DF 4 "gpc_reg_operand" "f"))])] - "TARGET_32BIT" - "bl %z2" - [(set_attr "type" "branch") - (set_attr "length" "4")]) + "{stm|stmw} %2,%1" + [(set_attr "type" "store_ux")]) -(define_insn "*save_fpregs_di" - [(match_parallel 0 "any_operand" - [(clobber (match_operand:DI 1 "register_operand" "=l")) - (use (match_operand:DI 2 "call_operand" "s")) +(define_insn "*save_fpregs_" + [(match_parallel 0 "any_parallel_operand" + [(clobber (match_operand:P 1 "register_operand" "=l")) + (use (match_operand:P 2 "call_operand" "s")) (set (match_operand:DF 3 "memory_operand" "=m") (match_operand:DF 4 "gpc_reg_operand" "f"))])] - "TARGET_64BIT" + "" "bl %z2" [(set_attr "type" "branch") (set_attr "length" "4")]) @@ -14497,7 +14118,7 @@ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") (match_operand 2 "immediate_operand" "n")] UNSPEC_MOVESI_TO_CR))] - "GET_CODE (operands[0]) == REG + "GET_CODE (operands[0]) == REG && CR_REGNO_P (REGNO (operands[0])) && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 1 << (75 - REGNO (operands[0]))" @@ -14506,50 +14127,34 @@ ; The load-multiple instructions have similar properties. ; Note that "load_multiple" is a name known to the machine-independent -; code that actually corresponds to the powerpc load-string. +; code that actually corresponds to the PowerPC load-string. (define_insn "*lmw" [(match_parallel 0 "lmw_operation" [(set (match_operand:SI 1 "gpc_reg_operand" "=r") (match_operand:SI 2 "memory_operand" "m"))])] "TARGET_MULTIPLE" - "{lm|lmw} %1,%2") - -(define_insn "*return_internal_si" - [(return) - (use (match_operand:SI 0 "register_operand" "lc"))] - "TARGET_32BIT" - "b%T0" - [(set_attr "type" "jmpreg")]) + "{lm|lmw} %1,%2" + [(set_attr "type" "load_ux")]) -(define_insn "*return_internal_di" +(define_insn "*return_internal_" [(return) - (use (match_operand:DI 0 "register_operand" "lc"))] - "TARGET_64BIT" + (use (match_operand:P 0 "register_operand" "lc"))] + "" "b%T0" [(set_attr "type" "jmpreg")]) ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall -; stuff was in GCC. Oh, and "any_operand" is a bit flexible... +; stuff was in GCC. Oh, and "any_parallel_operand" is a bit flexible... -(define_insn "*return_and_restore_fpregs_si" - [(match_parallel 0 "any_operand" +(define_insn "*return_and_restore_fpregs_" + [(match_parallel 0 "any_parallel_operand" [(return) - (use (match_operand:SI 1 "register_operand" "l")) - (use (match_operand:SI 2 "call_operand" "s")) + (use (match_operand:P 1 "register_operand" "l")) + (use (match_operand:P 2 "call_operand" "s")) (set (match_operand:DF 3 "gpc_reg_operand" "=f") (match_operand:DF 4 "memory_operand" "m"))])] - "TARGET_32BIT" - "b %z2") - -(define_insn "*return_and_restore_fpregs_di" - [(match_parallel 0 "any_operand" - [(return) - (use (match_operand:DI 1 "register_operand" "l")) - (use (match_operand:DI 2 "call_operand" "s")) - (set (match_operand:DF 3 "gpc_reg_operand" "=f") - (match_operand:DF 4 "memory_operand" "m"))])] - "TARGET_64BIT" + "" "b %z2") ; This is used in compiling the unwind routines. @@ -14566,18 +14171,11 @@ }") ; We can't expand this before we know where the link register is stored. -(define_insn "eh_set_lr_si" - [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] +(define_insn "eh_set_lr_" + [(unspec_volatile [(match_operand:P 0 "register_operand" "r")] UNSPECV_EH_RR) - (clobber (match_scratch:SI 1 "=&b"))] - "TARGET_32BIT" - "#") - -(define_insn "eh_set_lr_di" - [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")] - UNSPECV_EH_RR) - (clobber (match_scratch:DI 1 "=&b"))] - "TARGET_64BIT" + (clobber (match_scratch:P 1 "=&b"))] + "" "#") (define_split @@ -14592,7 +14190,7 @@ }") (define_insn "prefetch" - [(prefetch (match_operand:V4SI 0 "address_operand" "p") + [(prefetch (match_operand 0 "indexed_or_indirect_address" "a") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] "TARGET_POWERPC" @@ -14603,6 +14201,8 @@ return INTVAL (operands[1]) ? \"dcbtst %a0\" : \"dcbt %a0\"; }" [(set_attr "type" "load")]) + +(include "sync.md") (include "altivec.md") (include "spe.md") diff --git a/contrib/gcc/config/rs6000/rs6000.opt b/contrib/gcc/config/rs6000/rs6000.opt new file mode 100644 index 00000000000..8ff390d6edc --- /dev/null +++ b/contrib/gcc/config/rs6000/rs6000.opt @@ -0,0 +1,247 @@ +; Options for the rs6000 port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mpower +Target Report RejectNegative Mask(POWER) +Use POWER instruction set + +mno-power +Target Report RejectNegative +Do not use POWER instruction set + +mpower2 +Target Report Mask(POWER2) +Use POWER2 instruction set + +mpowerpc +Target Report RejectNegative Mask(POWERPC) +Use PowerPC instruction set + +mno-powerpc +Target Report RejectNegative +Do not use PowerPC instruction set + +mpowerpc64 +Target Report Mask(POWERPC64) +Use PowerPC-64 instruction set + +mpowerpc-gpopt +Target Report Mask(PPC_GPOPT) +Use PowerPC General Purpose group optional instructions + +mpowerpc-gfxopt +Target Report Mask(PPC_GFXOPT) +Use PowerPC Graphics group optional instructions + +mmfcrf +Target Report Mask(MFCRF) +Use PowerPC V2.01 single field mfcr instruction + +mpopcntb +Target Report Mask(POPCNTB) +Use PowerPC V2.02 popcntb instruction + +mfprnd +Target Report Mask(FPRND) +Use PowerPC V2.02 floating point rounding instructions + +maltivec +Target Report Mask(ALTIVEC) +Use AltiVec instructions + +mmulhw +Target Report Mask(MULHW) +Use 4xx half-word multiply instructions + +mdlmzb +Target Report Mask(DLMZB) +Use 4xx string-search dlmzb instruction + +mmultiple +Target Report Mask(MULTIPLE) +Generate load/store multiple instructions + +mstring +Target Report Mask(STRING) +Generate string instructions for block moves + +mnew-mnemonics +Target Report RejectNegative Mask(NEW_MNEMONICS) +Use new mnemonics for PowerPC architecture + +mold-mnemonics +Target Report RejectNegative InverseMask(NEW_MNEMONICS) +Use old mnemonics for PowerPC architecture + +msoft-float +Target Report RejectNegative Mask(SOFT_FLOAT) +Do not use hardware floating point + +mhard-float +Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) +Use hardware floating point + +mno-update +Target Report RejectNegative Mask(NO_UPDATE) +Do not generate load/store with update instructions + +mupdate +Target Report RejectNegative InverseMask(NO_UPDATE, UPDATE) +Generate load/store with update instructions + +mno-fused-madd +Target Report RejectNegative Mask(NO_FUSED_MADD) +Do not generate fused multiply/add instructions + +mfused-madd +Target Report RejectNegative InverseMask(NO_FUSED_MADD, FUSED_MADD) +Generate fused multiply/add instructions + +msched-prolog +Target Report Var(TARGET_SCHED_PROLOG) Init(1) +Schedule the start and end of the procedure + +msched-epilog +Target Undocumented Var(TARGET_SCHED_PROLOG) VarExists + +maix-struct-return +Target Report RejectNegative Var(aix_struct_return) +Return all structures in memory (AIX default) + +msvr4-struct-return +Target Report RejectNegative Var(aix_struct_return,0) VarExists +Return small structures in registers (SVR4 default) + +mxl-compat +Target Report Var(TARGET_XL_COMPAT) +Conform more closely to IBM XLC semantics + +mswdiv +Target Report Var(swdiv) +Generate software floating point divide for better throughput + +mno-fp-in-toc +Target Report RejectNegative Var(TARGET_NO_FP_IN_TOC) +Do not place floating point constants in TOC + +mfp-in-toc +Target Report RejectNegative Var(TARGET_NO_FP_IN_TOC,0) +Place floating point constants in TOC + +mno-sum-in-toc +Target RejectNegative Var(TARGET_NO_SUM_IN_TOC) +Do not place symbol+offset constants in TOC + +msum-in-toc +Target RejectNegative Var(TARGET_NO_SUM_IN_TOC,0) VarExists +Place symbol+offset constants in TOC + +; Output only one TOC entry per module. Normally linking fails if +; there are more than 16K unique variables/constants in an executable. With +; this option, linking fails only if there are more than 16K modules, or +; if there are more than 16K unique variables/constant in a single module. +; +; This is at the cost of having 2 extra loads and one extra store per +; function, and one less allocable register. +mminimal-toc +Target Report Mask(MINIMAL_TOC) +Use only one TOC entry per procedure + +mfull-toc +Target Report +Put everything in the regular TOC + +mvrsave +Target Report Var(TARGET_ALTIVEC_VRSAVE) +Generate VRSAVE instructions when generating AltiVec code + +mvrsave= +Target RejectNegative Joined +-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead + +misel +Target Var(rs6000_isel) +Generate isel instructions + +misel= +Target RejectNegative Joined +-misel=yes/no Deprecated option. Use -misel/-mno-isel instead + +mspe +Target Var(rs6000_spe) +Generate SPE SIMD instructions on E500 + +mspe= +Target RejectNegative Joined +-mspe=yes/no Deprecated option. Use -mspe/-mno-spe instead + +mdebug= +Target RejectNegative Joined +-mdebug= Enable debug output + +mabi= +Target RejectNegative Joined +-mabi= Specify ABI to use + +mcpu= +Target RejectNegative Joined +-mcpu= Use features of and schedule code for given CPU + +mtune= +Target RejectNegative Joined +-mtune= Schedule code for given CPU + +mtraceback= +Target RejectNegative Joined +-mtraceback= Select full, part, or no traceback table + +mlongcall +Target Report Var(rs6000_default_long_calls) +Avoid all range limits on call instructions + +mwarn-altivec-long +Target Var(rs6000_warn_altivec_long) Init(1) +Warn about deprecated 'vector long ...' AltiVec type usage + +mfloat-gprs= +Target RejectNegative Joined +-mfloat-gprs= Select GPR floating point method + +mlong-double- +Target RejectNegative Joined UInteger +-mlong-double- Specify size of long double (64 or 128 bits) + +msched-costly-dep= +Target RejectNegative Joined +Determine which dependences between insns are considered costly + +minsert-sched-nops= +Target RejectNegative Joined +Specify which post scheduling nop insertion scheme to apply + +malign- +Target RejectNegative Joined +Specify alignment of structure fields default/natural + +mprioritize-restricted-insns= +Target RejectNegative Joined UInteger Var(rs6000_sched_restricted_insns_priority) +Specify scheduling priority for dispatch slot restricted insns diff --git a/contrib/gcc/config/rs6000/rs64.md b/contrib/gcc/config/rs6000/rs64.md index 4d9987523f4..71ec61de59b 100644 --- a/contrib/gcc/config/rs6000/rs64.md +++ b/contrib/gcc/config/rs6000/rs64.md @@ -1,5 +1,5 @@ ;; Scheduling description for IBM RS64 processors. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -15,8 +15,8 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_automaton "rs64,rs64fp") (define_cpu_unit "iu_rs64" "rs64") @@ -31,7 +31,7 @@ (eq_attr "cpu" "rs64a")) "lsu_rs64") -(define_insn_reservation "rs64a-store" 1 +(define_insn_reservation "rs64a-store" 2 (and (eq_attr "type" "store,store_ux,store_u,fpstore,fpstore_ux,fpstore_u") (eq_attr "cpu" "rs64a")) "lsu_rs64") @@ -41,11 +41,26 @@ (eq_attr "cpu" "rs64a")) "lsu_rs64") +(define_insn_reservation "rs64a-llsc" 2 + (and (eq_attr "type" "load_l,store_c") + (eq_attr "cpu" "rs64a")) + "lsu_rs64") + (define_insn_reservation "rs64a-integer" 1 (and (eq_attr "type" "integer,insert_word") (eq_attr "cpu" "rs64a")) "iu_rs64") +(define_insn_reservation "rs64a-two" 1 + (and (eq_attr "type" "two") + (eq_attr "cpu" "rs64a")) + "iu_rs64,iu_rs64") + +(define_insn_reservation "rs64a-three" 1 + (and (eq_attr "type" "three") + (eq_attr "cpu" "rs64a")) + "iu_rs64,iu_rs64,iu_rs64") + (define_insn_reservation "rs64a-imul" 20 (and (eq_attr "type" "imul,imul_compare") (eq_attr "cpu" "rs64a")) @@ -126,3 +141,13 @@ (eq_attr "cpu" "rs64a")) "bpu_rs64") +(define_insn_reservation "rs64a-isync" 6 + (and (eq_attr "type" "isync") + (eq_attr "cpu" "rs64a")) + "bpu_rs64") + +(define_insn_reservation "rs64a-sync" 1 + (and (eq_attr "type" "sync") + (eq_attr "cpu" "rs64a")) + "lsu_rs64") + diff --git a/contrib/gcc/config/rs6000/rtems.h b/contrib/gcc/config/rs6000/rtems.h index d83e1eb61cc..7c491861054 100644 --- a/contrib/gcc/config/rs6000/rtems.h +++ b/contrib/gcc/config/rs6000/rtems.h @@ -1,5 +1,5 @@ /* Definitions for rtems targeting a PowerPC using elf. - Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2005 + Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Joel Sherrill (joel@OARcorp.com). @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Specify predefined symbols in preprocessor. */ diff --git a/contrib/gcc/config/rs6000/secureplt.h b/contrib/gcc/config/rs6000/secureplt.h new file mode 100644 index 00000000000..a02af8d3cec --- /dev/null +++ b/contrib/gcc/config/rs6000/secureplt.h @@ -0,0 +1,21 @@ +/* Default to -msecure-plt. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" diff --git a/contrib/gcc/config/rs6000/sfp-machine.h b/contrib/gcc/config/rs6000/sfp-machine.h new file mode 100644 index 00000000000..29173e235dc --- /dev/null +++ b/contrib/gcc/config/rs6000/sfp-machine.h @@ -0,0 +1,63 @@ +#define _FP_W_TYPE_SIZE 32 +#define _FP_W_TYPE unsigned long +#define _FP_WS_TYPE signed long +#define _FP_I_TYPE long + +#define _FP_MUL_MEAT_S(R,X,Y) \ + _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) +#define _FP_MUL_MEAT_D(R,X,Y) \ + _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) +#define _FP_MUL_MEAT_Q(R,X,Y) \ + _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) + +#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y) +#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) +#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) + +#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) +#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 +#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 +#define _FP_NANSIGN_S 0 +#define _FP_NANSIGN_D 0 +#define _FP_NANSIGN_Q 0 + +#define _FP_KEEPNANFRACP 1 + +/* Someone please check this. */ +#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ + do { \ + if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \ + && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \ + { \ + R##_s = Y##_s; \ + _FP_FRAC_COPY_##wc(R,Y); \ + } \ + else \ + { \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc(R,X); \ + } \ + R##_c = FP_CLS_NAN; \ + } while (0) + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 + +#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN +# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# error "Both BIG_ENDIAN and LITTLE_ENDIAN defined!" +# endif +# define __BYTE_ORDER __BIG_ENDIAN +#else +# if defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# define __BYTE_ORDER __LITTLE_ENDIAN +# else +# error "Cannot determine current byte order" +# endif +#endif + + +/* Define ALIASNAME as a strong alias for NAME. */ +# define strong_alias(name, aliasname) _strong_alias(name, aliasname) +# define _strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))); diff --git a/contrib/gcc/config/rs6000/sol-ci.asm b/contrib/gcc/config/rs6000/sol-ci.asm index cc97b0ac6f5..35e3b8e5c35 100644 --- a/contrib/gcc/config/rs6000/sol-ci.asm +++ b/contrib/gcc/config/rs6000/sol-ci.asm @@ -23,8 +23,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/sol-cn.asm b/contrib/gcc/config/rs6000/sol-cn.asm index 673540f7a1e..85468345ba2 100644 --- a/contrib/gcc/config/rs6000/sol-cn.asm +++ b/contrib/gcc/config/rs6000/sol-cn.asm @@ -23,8 +23,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # # As a special exception, if you link this library with files # compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/rs6000/spe.h b/contrib/gcc/config/rs6000/spe.h index 878fc72b2e5..4e2d7f6987d 100644 --- a/contrib/gcc/config/rs6000/spe.h +++ b/contrib/gcc/config/rs6000/spe.h @@ -1,5 +1,5 @@ /* PowerPC E500 user include file. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Aldy Hernandez (aldyh@redhat.com). This file is part of GCC. @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause diff --git a/contrib/gcc/config/rs6000/spe.md b/contrib/gcc/config/rs6000/spe.md index 306accdb231..7d05e0882d5 100644 --- a/contrib/gcc/config/rs6000/spe.md +++ b/contrib/gcc/config/rs6000/spe.md @@ -1,5 +1,5 @@ ;; e500 SPE description -;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Aldy Hernandez (aldy@quesejoda.com) ;; This file is part of GCC. @@ -16,12 +16,24 @@ ;; 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. +;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. (define_constants [(SPE_ACC_REGNO 111) - (SPEFSCR_REGNO 112)]) + (SPEFSCR_REGNO 112) + + (CMPDFEQ_GPR 1006) + (TSTDFEQ_GPR 1007) + (CMPDFGT_GPR 1008) + (TSTDFGT_GPR 1009) + (CMPDFLT_GPR 1010) + (TSTDFLT_GPR 1011) + (E500_CR_IOR_COMPARE 1012) + ]) + +;; Modes using a 64-bit register. +(define_mode_macro SPE64 [DF V4HI V2SF V1DI V2SI]) (define_insn "*negsf2_gpr" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") @@ -76,6 +88,22 @@ "efsdiv %0,%1,%2" [(set_attr "type" "vecfdiv")]) +;; Floating point conversion instructions. + +(define_insn "fixuns_truncdfsi2" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdctuiz %0,%1" + [(set_attr "type" "fp")]) + +(define_insn "spe_extendsfdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdcfs %0,%1" + [(set_attr "type" "fp")]) + (define_insn "spe_fixuns_truncsfsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (unsigned_fix:SI (match_operand:SF 1 "gpc_reg_operand" "r")))] @@ -90,6 +118,13 @@ "efsctsiz %0,%1" [(set_attr "type" "fp")]) +(define_insn "spe_fix_truncdfsi2" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdctsiz %0,%1" + [(set_attr "type" "fp")]) + (define_insn "spe_floatunssisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (unsigned_float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))] @@ -97,6 +132,13 @@ "efscfui %0,%1" [(set_attr "type" "fp")]) +(define_insn "spe_floatunssidf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdcfui %0,%1" + [(set_attr "type" "fp")]) + (define_insn "spe_floatsisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "=r") (float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))] @@ -104,6 +146,12 @@ "efscfsi %0,%1" [(set_attr "type" "fp")]) +(define_insn "spe_floatsidf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdcfsi %0,%1" + [(set_attr "type" "fp")]) ;; SPE SIMD instructions @@ -2147,6 +2195,165 @@ [(set_attr "type" "vecstore") (set_attr "length" "4")]) +;; Double-precision floating point instructions. + +;; FIXME: Add o=r option. +(define_insn "*frob_df_di" + [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r") + (subreg:DF (match_operand:DI 1 "input_operand" "r,m") 0))] + "TARGET_E500_DOUBLE" + "@ + evmergelo %0,%1,%L1 + evldd%X1 %0,%y1") + +(define_insn "*frob_di_df" + [(set (match_operand:DI 0 "nonimmediate_operand" "=&r") + (subreg:DI (match_operand:DF 1 "input_operand" "r") 0))] + "TARGET_E500_DOUBLE" + "evmergehi %0,%1,%1\;mr %L0,%1" + [(set_attr "length" "8")]) + +(define_insn "*frob_di_df_2" + [(set (subreg:DF (match_operand:DI 0 "register_operand" "=&r,r") 0) + (match_operand:DF 1 "input_operand" "r,m"))] + "TARGET_E500_DOUBLE" + "* +{ + switch (which_alternative) + { + default: + gcc_unreachable (); + case 0: + return \"evmergehi %0,%1,%1\;mr %L0,%1\"; + case 1: + /* If the address is not offsettable we need to load the whole + doubleword into a 64-bit register and then copy the high word + to form the correct output layout. */ + if (!offsettable_nonstrict_memref_p (operands[1])) + return \"evldd%X1 %L0,%y1\;evmergehi %0,%L0,%L0\"; + /* If the low-address word is used in the address, we must load + it last. Otherwise, load it first. Note that we cannot have + auto-increment in that case since the address register is + known to be dead. */ + if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1, + operands[1], 0)) + return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\"; + else + return \"{l%U1%X1|lwz%U1%X1} %0,%1\;{l|lwz} %L0,%L1\"; + } +}" + [(set_attr "length" "8,8")]) + +(define_insn "*mov_si_e500_subreg0" + [(set (subreg:SI (match_operand:SPE64 0 "register_operand" "+r,&r") 0) + (match_operand:SI 1 "input_operand" "r,m"))] + "(TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE && mode != DFmode)" + "@ + evmergelo %0,%1,%0 + evmergelohi %0,%0,%0\;{l%U1%X1|lwz%U1%X1} %0,%1\;evmergelohi %0,%0,%0") + +;; ??? Could use evstwwe for memory stores in some cases, depending on +;; the offset. +(define_insn "*mov_si_e500_subreg0_2" + [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m") + (subreg:SI (match_operand:SPE64 1 "register_operand" "+r,&r") 0))] + "(TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE && mode != DFmode)" + "@ + evmergehi %0,%0,%1 + evmergelohi %1,%1,%1\;{st%U0%X0|stw%U0%X0} %1,%0") + +(define_insn "*mov_si_e500_subreg4" + [(set (subreg:SI (match_operand:SPE64 0 "register_operand" "+r,r") 4) + (match_operand:SI 1 "input_operand" "r,m"))] + "(TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE && mode != DFmode)" + "@ + mr %0,%1 + {l%U1%X1|lwz%U1%X1} %0,%1") + +(define_insn "*mov_si_e500_subreg4_2" + [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m") + (subreg:SI (match_operand:SPE64 1 "register_operand" "r,r") 4))] + "(TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE && mode != DFmode)" + "@ + mr %0,%1 + {st%U0%X0|stw%U0%X0} %1,%0") + +;; FIXME: Allow r=CONST0. +(define_insn "*movdf_e500_double" + [(set (match_operand:DF 0 "rs6000_nonimmediate_operand" "=r,r,m") + (match_operand:DF 1 "input_operand" "r,m,r"))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE + && (gpc_reg_operand (operands[0], DFmode) + || gpc_reg_operand (operands[1], DFmode))" + "* + { + switch (which_alternative) + { + case 0: + return \"evor %0,%1,%1\"; + case 1: + return \"evldd%X1 %0,%y1\"; + case 2: + return \"evstdd%X0 %1,%y0\"; + default: + gcc_unreachable (); + } + }" + [(set_attr "type" "*,vecload,vecstore") + (set_attr "length" "*,*,*")]) + +(define_insn "spe_truncdfsf2" + [(set (match_operand:SF 0 "gpc_reg_operand" "=r") + (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efscfd %0,%1") + +(define_insn "spe_absdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdabs %0,%1") + +(define_insn "spe_nabsdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r"))))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdnabs %0,%1") + +(define_insn "spe_negdf2" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (neg:DF (match_operand:DF 1 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdneg %0,%1") + +(define_insn "spe_adddf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (plus:DF (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdadd %0,%1,%2") + +(define_insn "spe_subdf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (minus:DF (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdsub %0,%1,%2") + +(define_insn "spe_muldf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (mult:DF (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efdmul %0,%1,%2") + +(define_insn "spe_divdf3" + [(set (match_operand:DF 0 "gpc_reg_operand" "=r") + (div:DF (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r")))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" + "efddiv %0,%1,%2") + ;; Vector move instructions. (define_expand "movv2si" @@ -2169,7 +2376,7 @@ case 1: return \"evldd%X1 %0,%y1\"; case 2: return \"evor %0,%1,%1\"; case 3: return output_vec_const_move (operands); - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "type" "vecload,vecstore,*,*") @@ -2210,15 +2417,16 @@ "{ rs6000_emit_move (operands[0], operands[1], V4HImode); DONE; }") (define_insn "*movv4hi_internal" - [(set (match_operand:V4HI 0 "nonimmediate_operand" "=m,r,r") - (match_operand:V4HI 1 "input_operand" "r,m,r"))] + [(set (match_operand:V4HI 0 "nonimmediate_operand" "=m,r,r,r") + (match_operand:V4HI 1 "input_operand" "r,m,r,W"))] "TARGET_SPE && (gpc_reg_operand (operands[0], V4HImode) || gpc_reg_operand (operands[1], V4HImode))" "@ evstdd%X0 %1,%y0 evldd%X1 %0,%y1 - evor %0,%1,%1" + evor %0,%1,%1 + evxor %0,%0,%0" [(set_attr "type" "vecload")]) (define_expand "movv2sf" @@ -2458,14 +2666,14 @@ ;; FP comparison stuff. ;; Flip the GT bit. -(define_insn "e500_flip_eq_bit" +(define_insn "e500_flip_gt_bit" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(match_operand:CCFP 1 "cc_reg_operand" "y")] 999))] + (unspec:CCFP + [(match_operand:CCFP 1 "cc_reg_operand" "y")] 999))] "!TARGET_FPRS && TARGET_HARD_FLOAT" "* { - return output_e500_flip_eq_bit (operands[0], operands[1]); + return output_e500_flip_gt_bit (operands[0], operands[1]); }" [(set_attr "type" "cr_logical")]) @@ -2475,60 +2683,132 @@ (define_insn "cmpsfeq_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1000))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1000))] "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations" "efscmpeq %0,%1,%2" [(set_attr "type" "veccmp")]) (define_insn "tstsfeq_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1001))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1001))] "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations" "efststeq %0,%1,%2" [(set_attr "type" "veccmpsimple")]) (define_insn "cmpsfgt_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1002))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1002))] "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations" "efscmpgt %0,%1,%2" [(set_attr "type" "veccmp")]) (define_insn "tstsfgt_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1003))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1003))] "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations" "efststgt %0,%1,%2" [(set_attr "type" "veccmpsimple")]) (define_insn "cmpsflt_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1004))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1004))] "TARGET_HARD_FLOAT && !TARGET_FPRS && !flag_unsafe_math_optimizations" "efscmplt %0,%1,%2" [(set_attr "type" "veccmp")]) (define_insn "tstsflt_gpr" [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") - (match_operand:SF 2 "gpc_reg_operand" "r"))] - 1005))] + (unspec:CCFP + [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r") + (match_operand:SF 2 "gpc_reg_operand" "r"))] + 1005))] "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations" "efststlt %0,%1,%2" [(set_attr "type" "veccmpsimple")]) + +;; Same thing, but for double-precision. + +(define_insn "cmpdfeq_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + CMPDFEQ_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations" + "efdcmpeq %0,%1,%2" + [(set_attr "type" "veccmp")]) + +(define_insn "tstdfeq_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + TSTDFEQ_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations" + "efdtsteq %0,%1,%2" + [(set_attr "type" "veccmpsimple")]) + +(define_insn "cmpdfgt_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + CMPDFGT_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations" + "efdcmpgt %0,%1,%2" + [(set_attr "type" "veccmp")]) + +(define_insn "tstdfgt_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + TSTDFGT_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations" + "efdtstgt %0,%1,%2" + [(set_attr "type" "veccmpsimple")]) + +(define_insn "cmpdflt_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + CMPDFLT_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations" + "efdcmplt %0,%1,%2" + [(set_attr "type" "veccmp")]) + +(define_insn "tstdflt_gpr" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP + [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r") + (match_operand:DF 2 "gpc_reg_operand" "r"))] + TSTDFLT_GPR))] + "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations" + "efdtstlt %0,%1,%2" + [(set_attr "type" "veccmpsimple")]) + +;; Like cceq_ior_compare, but compare the GT bits. +(define_insn "e500_cr_ior_compare" + [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") + (unspec:CCFP [(match_operand 1 "cc_reg_operand" "y") + (match_operand 2 "cc_reg_operand" "y")] + E500_CR_IOR_COMPARE))] + "TARGET_E500" + "cror 4*%0+gt,4*%1+gt,4*%2+gt" + [(set_attr "type" "cr_logical")]) diff --git a/contrib/gcc/config/rs6000/sync.md b/contrib/gcc/config/rs6000/sync.md new file mode 100644 index 00000000000..b7166473efe --- /dev/null +++ b/contrib/gcc/config/rs6000/sync.md @@ -0,0 +1,625 @@ +;; Machine description for PowerPC synchronization instructions. +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Contributed by Geoffrey Keating. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; 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, 51 Franklin Street, Fifth Floor, Boston, +;; MA 02110-1301, USA. + +(define_mode_attr larx [(SI "lwarx") (DI "ldarx")]) +(define_mode_attr stcx [(SI "stwcx.") (DI "stdcx.")]) + +(define_code_macro FETCHOP [plus minus ior xor and]) +(define_code_attr fetchop_name + [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) +(define_code_attr fetchop_pred + [(plus "add_operand") (minus "gpc_reg_operand") + (ior "logical_operand") (xor "logical_operand") (and "and_operand")]) +(define_code_attr fetchopsi_constr + [(plus "rIL") (minus "r") (ior "rKL") (xor "rKL") (and "rTKL")]) +(define_code_attr fetchopdi_constr + [(plus "rIL") (minus "r") (ior "rKJF") (xor "rKJF") (and "rSTKJ")]) + +(define_expand "memory_barrier" + [(set (mem:BLK (match_dup 0)) + (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_SYNC))] + "" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*sync_internal" + [(set (match_operand:BLK 0 "" "") + (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_SYNC))] + "" + "{dcs|sync}" + [(set_attr "type" "sync")]) + +(define_insn "load_locked_" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (unspec_volatile:GPR + [(match_operand:GPR 1 "memory_operand" "Z")] UNSPECV_LL))] + "TARGET_POWERPC" + " %0,%y1" + [(set_attr "type" "load_l")]) + +(define_insn "store_conditional_" + [(set (match_operand:CC 0 "cc_reg_operand" "=x") + (unspec_volatile:CC [(const_int 0)] UNSPECV_SC)) + (set (match_operand:GPR 1 "memory_operand" "=Z") + (match_operand:GPR 2 "gpc_reg_operand" "r"))] + "TARGET_POWERPC" + " %2,%y1" + [(set_attr "type" "store_c")]) + +(define_insn_and_split "sync_compare_and_swap" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") + (match_operand:GPR 1 "memory_operand" "+Z")) + (set (match_dup 1) + (unspec:GPR + [(match_operand:GPR 2 "reg_or_short_operand" "rI") + (match_operand:GPR 3 "gpc_reg_operand" "r")] + UNSPEC_CMPXCHG)) + (clobber (match_scratch:GPR 4 "=&r")) + (clobber (match_scratch:CC 5 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_compare_and_swap (operands[0], operands[1], operands[2], + operands[3], operands[4]); + DONE; +}) + +(define_expand "sync_compare_and_swaphi" + [(match_operand:HI 0 "gpc_reg_operand" "") + (match_operand:HI 1 "memory_operand" "") + (match_operand:HI 2 "gpc_reg_operand" "") + (match_operand:HI 3 "gpc_reg_operand" "")] + "TARGET_POWERPC" +{ + rs6000_expand_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3]); + DONE; +}) + +(define_expand "sync_compare_and_swapqi" + [(match_operand:QI 0 "gpc_reg_operand" "") + (match_operand:QI 1 "memory_operand" "") + (match_operand:QI 2 "gpc_reg_operand" "") + (match_operand:QI 3 "gpc_reg_operand" "")] + "TARGET_POWERPC" +{ + rs6000_expand_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3]); + DONE; +}) + +(define_insn_and_split "sync_compare_and_swapqhi_internal" + [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") + (match_operand:SI 4 "memory_operand" "+Z")) + (set (match_dup 4) + (unspec:SI + [(match_operand:SI 1 "gpc_reg_operand" "r") + (match_operand:SI 2 "gpc_reg_operand" "r") + (match_operand:SI 3 "gpc_reg_operand" "r")] + UNSPEC_CMPXCHG)) + (clobber (match_scratch:SI 5 "=&r")) + (clobber (match_scratch:CC 6 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_compare_and_swapqhi (operands[0], operands[1], + operands[2], operands[3], operands[4], + operands[5]); + DONE; +}) + +(define_insn_and_split "sync_lock_test_and_set" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") + (match_operand:GPR 1 "memory_operand" "+Z")) + (set (match_dup 1) + (unspec:GPR + [(match_operand:GPR 2 "reg_or_short_operand" "rL")] + UNSPEC_XCHG)) + (clobber (match_scratch:GPR 3 "=&r")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_lock_test_and_set (operands[0], operands[1], operands[2], + operands[3]); + DONE; +}) + +(define_expand "sync_" + [(parallel [(set (match_operand:INT1 0 "memory_operand" "") + (unspec:INT1 + [(FETCHOP:INT1 (match_dup 0) + (match_operand:INT1 1 "" ""))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; + } +}") + +(define_insn_and_split "*sync_si_internal" + [(set (match_operand:SI 0 "memory_operand" "+Z") + (unspec:SI + [(FETCHOP:SI (match_dup 0) + (match_operand:SI 1 "" ""))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:SI 2 "=&b")) + (clobber (match_scratch:CC 3 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[0], operands[1], + NULL_RTX, NULL_RTX, operands[2]); + DONE; +}) + +(define_insn_and_split "*sync_di_internal" + [(set (match_operand:DI 0 "memory_operand" "+Z") + (unspec:DI + [(FETCHOP:DI (match_dup 0) + (match_operand:DI 1 "" ""))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:DI 2 "=&b")) + (clobber (match_scratch:CC 3 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[0], operands[1], + NULL_RTX, NULL_RTX, operands[2]); + DONE; +}) + +(define_expand "sync_nand" + [(parallel [(set (match_operand:INT1 0 "memory_operand" "") + (unspec:INT1 + [(and:INT1 (not:INT1 (match_dup 0)) + (match_operand:INT1 1 "gpc_reg_operand" ""))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[0]), + operands[1], + NULL_RTX, NULL_RTX, true); + DONE; + } +}") + +(define_insn_and_split "*sync_nand_internal" + [(set (match_operand:GPR 0 "memory_operand" "+Z") + (unspec:GPR + [(and:GPR (not:GPR (match_dup 0)) + (match_operand:GPR 1 "gpc_reg_operand" "r"))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:GPR 2 "=&r")) + (clobber (match_scratch:CC 3 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (NOT, operands[0], operands[1], + NULL_RTX, NULL_RTX, operands[2]); + DONE; +}) + +(define_expand "sync_old_" + [(parallel [(set (match_operand:INT1 0 "gpc_reg_operand" "") + (match_operand:INT1 1 "memory_operand" "")) + (set (match_dup 1) + (unspec:INT1 + [(FETCHOP:INT1 (match_dup 1) + (match_operand:INT1 2 "" ""))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; + } +}") + +(define_insn_and_split "*sync_old_si_internal" + [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") + (match_operand:SI 1 "memory_operand" "+Z")) + (set (match_dup 1) + (unspec:SI + [(FETCHOP:SI (match_dup 1) + (match_operand:SI 2 "" ""))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:SI 3 "=&b")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[1], operands[2], + operands[0], NULL_RTX, operands[3]); + DONE; +}) + +(define_insn_and_split "*sync_old_di_internal" + [(set (match_operand:DI 0 "gpc_reg_operand" "=&r") + (match_operand:DI 1 "memory_operand" "+Z")) + (set (match_dup 1) + (unspec:DI + [(FETCHOP:DI (match_dup 1) + (match_operand:DI 2 "" ""))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:DI 3 "=&b")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[1], operands[2], + operands[0], NULL_RTX, operands[3]); + DONE; +}) + +(define_expand "sync_old_nand" + [(parallel [(set (match_operand:INT1 0 "gpc_reg_operand" "") + (match_operand:INT1 1 "memory_operand" "")) + (set (match_dup 1) + (unspec:INT1 + [(and:INT1 (not:INT1 (match_dup 1)) + (match_operand:INT1 2 "gpc_reg_operand" ""))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[1]), + operands[2], + operands[0], NULL_RTX, true); + DONE; + } +}") + +(define_insn_and_split "*sync_old_nand_internal" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") + (match_operand:GPR 1 "memory_operand" "+Z")) + (set (match_dup 1) + (unspec:GPR + [(and:GPR (not:GPR (match_dup 1)) + (match_operand:GPR 2 "gpc_reg_operand" "r"))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:GPR 3 "=&r")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (NOT, operands[1], operands[2], + operands[0], NULL_RTX, operands[3]); + DONE; +}) + +(define_expand "sync_new_" + [(parallel [(set (match_operand:INT1 0 "gpc_reg_operand" "") + (FETCHOP:INT1 + (match_operand:INT1 1 "memory_operand" "") + (match_operand:INT1 2 "" ""))) + (set (match_dup 1) + (unspec:INT1 + [(FETCHOP:INT1 (match_dup 1) (match_dup 2))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; + } +}") + +(define_insn_and_split "*sync_new_si_internal" + [(set (match_operand:SI 0 "gpc_reg_operand" "=&r") + (FETCHOP:SI + (match_operand:SI 1 "memory_operand" "+Z") + (match_operand:SI 2 "" ""))) + (set (match_dup 1) + (unspec:SI + [(FETCHOP:SI (match_dup 1) (match_dup 2))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:SI 3 "=&b")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[1], operands[2], + NULL_RTX, operands[0], operands[3]); + DONE; +}) + +(define_insn_and_split "*sync_new_di_internal" + [(set (match_operand:DI 0 "gpc_reg_operand" "=&r") + (FETCHOP:DI + (match_operand:DI 1 "memory_operand" "+Z") + (match_operand:DI 2 "" ""))) + (set (match_dup 1) + (unspec:DI + [(FETCHOP:DI (match_dup 1) (match_dup 2))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:DI 3 "=&b")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (, operands[1], operands[2], + NULL_RTX, operands[0], operands[3]); + DONE; +}) + +(define_expand "sync_new_nand" + [(parallel [(set (match_operand:INT1 0 "gpc_reg_operand" "") + (and:INT1 + (not:INT1 (match_operand:INT1 1 "memory_operand" "")) + (match_operand:INT1 2 "gpc_reg_operand" ""))) + (set (match_dup 1) + (unspec:INT1 + [(and:INT1 (not:INT1 (match_dup 1)) (match_dup 2))] + UNSPEC_ATOMIC)) + (clobber (scratch:INT1)) + (clobber (scratch:CC))])] + "TARGET_POWERPC" + " +{ + if (mode != SImode && mode != DImode) + { + if (PPC405_ERRATUM77) + FAIL; + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[1]), + operands[2], + NULL_RTX, operands[0], true); + DONE; + } +}") + +(define_insn_and_split "*sync_new_nand_internal" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") + (and:GPR + (not:GPR (match_operand:GPR 1 "memory_operand" "+Z")) + (match_operand:GPR 2 "gpc_reg_operand" "r"))) + (set (match_dup 1) + (unspec:GPR + [(and:GPR (not:GPR (match_dup 1)) (match_dup 2))] + UNSPEC_ATOMIC)) + (clobber (match_scratch:GPR 3 "=&r")) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "#" + "&& reload_completed" + [(const_int 0)] +{ + rs6000_split_atomic_op (NOT, operands[1], operands[2], + NULL_RTX, operands[0], operands[3]); + DONE; +}) + +; and without cr0 clobber to avoid generation of additional clobber +; in atomic splitters causing internal consistency failure. +; cr0 already clobbered by larx/stcx. +(define_insn "*atomic_andsi" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") + (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") + (match_operand:SI 2 "and_operand" "?r,T,K,L")] + UNSPEC_AND))] + "" + "@ + and %0,%1,%2 + {rlinm|rlwinm} %0,%1,0,%m2,%M2 + {andil.|andi.} %0,%1,%b2 + {andiu.|andis.} %0,%1,%u2" + [(set_attr "type" "*,*,compare,compare")]) + +(define_insn "*atomic_anddi" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r") + (unspec:DI [(match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r") + (match_operand:DI 2 "and_operand" "?r,S,T,K,J")] + UNSPEC_AND))] + "TARGET_POWERPC64" + "@ + and %0,%1,%2 + rldic%B2 %0,%1,0,%S2 + rlwinm %0,%1,0,%m2,%M2 + andi. %0,%1,%b2 + andis. %0,%1,%u2" + [(set_attr "type" "*,*,*,compare,compare") + (set_attr "length" "4,4,4,4,4")]) + +; the sync_*_internal patterns all have these operands: +; 0 - memory location +; 1 - operand +; 2 - value in memory after operation +; 3 - value in memory immediately before operation + +(define_insn "*sync_addshort_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r") + (ior:SI (and:SI (plus:SI (match_operand:SI 0 "memory_operand" "+Z") + (match_operand:SI 1 "add_operand" "rI")) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) + (unspec:SI [(ior:SI (and:SI (plus:SI (match_dup 0) (match_dup 1)) + (match_dup 4)) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x")) + (clobber (match_scratch:SI 6 "=&r"))] + "TARGET_POWERPC && !PPC405_ERRATUM77" + "lwarx %3,%y0\n\tadd%I1 %2,%3,%1\n\tandc %6,%3,%4\n\tand %2,%2,%4\n\tor %2,%2,%6\n\tstwcx. %2,%y0\n\tbne- $-24" + [(set_attr "length" "28")]) + +(define_insn "*sync_subshort_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r") + (ior:SI (and:SI (minus:SI (match_operand:SI 0 "memory_operand" "+Z") + (match_operand:SI 1 "add_operand" "rI")) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) + (unspec:SI [(ior:SI (and:SI (minus:SI (match_dup 0) (match_dup 1)) + (match_dup 4)) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x")) + (clobber (match_scratch:SI 6 "=&r"))] + "TARGET_POWERPC && !PPC405_ERRATUM77" + "lwarx %3,%y0\n\tsubf %2,%1,%3\n\tandc %6,%3,%4\n\tand %2,%2,%4\n\tor %2,%2,%6\n\tstwcx. %2,%y0\n\tbne- $-24" + [(set_attr "length" "28")]) + +(define_insn "*sync_andsi_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r,&r,&r,&r") + (and:SI (match_operand:SI 0 "memory_operand" "+Z,Z,Z,Z") + (match_operand:SI 1 "and_operand" "r,T,K,L"))) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b,&b,&b,&b") (match_dup 0)) + (set (match_dup 0) + (unspec:SI [(and:SI (match_dup 0) (match_dup 1))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 4 "=&x,&x,&x,&x"))] + "TARGET_POWERPC && !PPC405_ERRATUM77" + "@ + lwarx %3,%y0\n\tand %2,%3,%1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\trlwinm %2,%3,0,%m1,%M1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\tandi. %2,%3,%b1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\tandis. %2,%3,%u1\n\tstwcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16,16")]) + +(define_insn "*sync_boolsi_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r,&r,&r") + (match_operator:SI 4 "boolean_or_operator" + [(match_operand:SI 0 "memory_operand" "+Z,Z,Z") + (match_operand:SI 1 "logical_operand" "r,K,L")])) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b,&b,&b") (match_dup 0)) + (set (match_dup 0) (unspec:SI [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x,&x,&x"))] + "TARGET_POWERPC && !PPC405_ERRATUM77" + "@ + lwarx %3,%y0\n\t%q4 %2,%3,%1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\t%q4i %2,%3,%b1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\t%q4is %2,%3,%u1\n\tstwcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16")]) + +; This pattern could also take immediate values of operand 1, +; since the non-NOT version of the operator is used; but this is not +; very useful, since in practice operand 1 is a full 32-bit value. +; Likewise, operand 5 is in practice either <= 2^16 or it is a register. +(define_insn "*sync_boolcshort_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r") + (match_operator:SI 4 "boolean_operator" + [(xor:SI (match_operand:SI 0 "memory_operand" "+Z") + (match_operand:SI 5 "logical_operand" "rK")) + (match_operand:SI 1 "gpc_reg_operand" "r")])) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) (unspec:SI [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 6 "=&x"))] + "TARGET_POWERPC && !PPC405_ERRATUM77" + "lwarx %3,%y0\n\txor%I2 %2,%3,%5\n\t%q4 %2,%2,%1\n\tstwcx. %2,%y0\n\tbne- $-16" + [(set_attr "length" "20")]) + +(define_insn "isync" + [(set (mem:BLK (match_scratch 0 "X")) + (unspec_volatile:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_ISYNC))] + "" + "{ics|isync}" + [(set_attr "type" "isync")]) + +(define_expand "sync_lock_release" + [(set (match_operand:INT 0 "memory_operand") + (match_operand:INT 1 "any_operand"))] + "" + " +{ + emit_insn (gen_lwsync ()); + emit_move_insn (operands[0], operands[1]); + DONE; +}") + +; Some AIX assemblers don't accept lwsync, so we use a .long. +(define_insn "lwsync" + [(set (mem:BLK (match_scratch 0 "X")) + (unspec_volatile:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_LWSYNC))] + "" +{ + if (TARGET_NO_LWSYNC) + return "sync"; + else + return ".long 0x7c2004ac"; +} + [(set_attr "type" "sync")]) + diff --git a/contrib/gcc/config/rs6000/sysv4.h b/contrib/gcc/config/rs6000/sysv4.h index d367aa810b3..0adde2bc8be 100644 --- a/contrib/gcc/config/rs6000/sysv4.h +++ b/contrib/gcc/config/rs6000/sysv4.h @@ -1,6 +1,6 @@ /* Target definitions for GNU compiler for PowerPC running System V.4 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GCC. @@ -17,10 +17,11 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ /* Header files should be C++ aware in general. */ +#undef NO_IMPLICIT_EXTERN_C #define NO_IMPLICIT_EXTERN_C /* Yes! We are ELF. */ @@ -46,24 +47,6 @@ enum rs6000_sdata_type { extern enum rs6000_sdata_type rs6000_sdata; -/* V.4/eabi switches. */ -#define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */ -#define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */ -#define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */ -#define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */ -#define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */ -#define MASK_REGNAMES 0x02000000 /* Use alternate register names. */ -#define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */ -#define MASK_NO_BITFIELD_WORD 0x00800000 /* Bitfields cannot cross word boundaries */ - -#define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) -#define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN) -#define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE) -#define TARGET_EABI (target_flags & MASK_EABI) -#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) -#define TARGET_REGNAMES (target_flags & MASK_REGNAMES) -#define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) -#define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD) #define TARGET_TOC ((target_flags & MASK_64BIT) \ || ((target_flags & (MASK_RELOCATABLE \ | MASK_MINIMAL_TOC)) \ @@ -76,91 +59,17 @@ extern enum rs6000_sdata_type rs6000_sdata; #define TARGET_NO_TOC (! TARGET_TOC) #define TARGET_NO_EABI (! TARGET_EABI) -/* Strings provided by SUBTARGET_OPTIONS */ +#ifdef HAVE_AS_REL16 +#undef TARGET_SECURE_PLT +#define TARGET_SECURE_PLT secure_plt +#endif + extern const char *rs6000_abi_name; extern const char *rs6000_sdata_name; extern const char *rs6000_tls_size_string; /* For -mtls-size= */ -/* Override rs6000.h definition. */ -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "call-", &rs6000_abi_name, N_("Select ABI calling convention"), 0}, \ - { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling"), 0}, \ - { "tls-size=", &rs6000_tls_size_string, \ - N_("Specify bit size of immediate TLS offsets"), 0 } - #define SDATA_DEFAULT_SIZE 8 -/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just - the same as -mminimal-toc. */ -/* Override rs6000.h definition. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "bit-align", -MASK_NO_BITFIELD_TYPE, \ - N_("Align to the base type of the bit-field") }, \ - { "no-bit-align", MASK_NO_BITFIELD_TYPE, \ - N_("Don't align to the base type of the bit-field") }, \ - { "strict-align", MASK_STRICT_ALIGN, \ - N_("Don't assume that unaligned accesses are handled by the system") }, \ - { "no-strict-align", -MASK_STRICT_ALIGN, \ - N_("Assume that unaligned accesses are handled by the system") }, \ - { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ - N_("Produce code relocatable at runtime") }, \ - { "no-relocatable", -MASK_RELOCATABLE, \ - N_("Don't produce code relocatable at runtime") }, \ - { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ - N_("Produce code relocatable at runtime") }, \ - { "no-relocatable-lib", -MASK_RELOCATABLE, \ - N_("Don't produce code relocatable at runtime") }, \ - { "little-endian", MASK_LITTLE_ENDIAN, \ - N_("Produce little endian code") }, \ - { "little", MASK_LITTLE_ENDIAN, \ - N_("Produce little endian code") }, \ - { "big-endian", -MASK_LITTLE_ENDIAN, \ - N_("Produce big endian code") }, \ - { "big", -MASK_LITTLE_ENDIAN, \ - N_("Produce big endian code") }, \ - { "no-toc", 0, N_("no description yet") }, \ - { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ - { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ - { "prototype", MASK_PROTOTYPE, \ - N_("Assume all variable arg functions are prototyped") }, \ - { "no-prototype", -MASK_PROTOTYPE, \ - N_("Non-prototyped functions might take a variable number of args") }, \ - { "no-traceback", 0, N_("no description yet") }, \ - { "eabi", MASK_EABI, N_("Use EABI") }, \ - { "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \ - { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \ - { "no-bit-word", MASK_NO_BITFIELD_WORD, \ - N_("Do not allow bit-fields to cross word boundaries") }, \ - { "regnames", MASK_REGNAMES, \ - N_("Use alternate register names") }, \ - { "no-regnames", -MASK_REGNAMES, \ - N_("Don't use alternate register names") }, \ - { "sdata", 0, N_("no description yet") }, \ - { "no-sdata", 0, N_("no description yet") }, \ - { "sim", 0, \ - N_("Link with libsim.a, libc.a and sim-crt0.o") }, \ - { "ads", 0, \ - N_("Link with libads.a, libc.a and crt0.o") }, \ - { "yellowknife", 0, \ - N_("Link with libyk.a, libc.a and crt0.o") }, \ - { "mvme", 0, \ - N_("Link with libmvme.a, libc.a and crt0.o") }, \ - { "emb", 0, \ - N_("Set the PPC_EMB bit in the ELF flags header") }, \ - { "windiss", 0, N_("Use the WindISS simulator") }, \ - { "shlib", 0, N_("no description yet") }, \ - { "64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Generate 64-bit code") }, \ - { "32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Generate 32-bit code") }, \ - EXTRA_SUBTARGET_SWITCHES \ - { "newlib", 0, N_("no description yet") }, - -/* This is meant to be redefined in the host dependent files. */ -#define EXTRA_SUBTARGET_SWITCHES - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -196,7 +105,12 @@ do { \ else if (!strcmp (rs6000_abi_name, "freebsd")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "linux")) \ - rs6000_current_abi = ABI_V4; \ + { \ + if (TARGET_64BIT) \ + rs6000_current_abi = ABI_AIX; \ + else \ + rs6000_current_abi = ABI_V4; \ + } \ else if (!strcmp (rs6000_abi_name, "gnu")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "netbsd")) \ @@ -296,9 +210,17 @@ do { \ error ("-mcall-aixdesc must be big endian"); \ } \ \ + if (TARGET_SECURE_PLT != secure_plt) \ + { \ + error ("-msecure-plt not supported by your assembler"); \ + } \ + \ /* Treat -fPIC the same as -mrelocatable. */ \ if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX) \ - target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ + { \ + target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC; \ + TARGET_NO_FP_IN_TOC = 1; \ + } \ \ else if (TARGET_RELOCATABLE) \ flag_pic = 2; \ @@ -321,16 +243,15 @@ do { \ #undef PROCESSOR_DEFAULT #define PROCESSOR_DEFAULT PROCESSOR_PPC750 +/* SVR4 only defined for PowerPC, so short-circuit POWER patterns. */ +#undef TARGET_POWER +#define TARGET_POWER 0 + #define FIXED_R2 1 /* System V.4 uses register 13 as a pointer to the small data area, so it is not available to the normal user. */ #define FIXED_R13 1 -/* Size of the V.4 varargs area if needed. */ -/* Override rs6000.h definition. */ -#undef RS6000_VARARGS_AREA -#define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0) - /* Override default big endianism definitions in rs6000.h. */ #undef BYTES_BIG_ENDIAN #undef WORDS_BIG_ENDIAN @@ -412,15 +333,6 @@ do { \ ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \ ? 128 : COMPUTED) -/* Define this macro as an expression for the alignment of a type - (given by TYPE as a tree node) if the alignment computed in the - usual way is COMPUTED and the alignment explicitly specified was - SPECIFIED. */ -#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) \ - ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) \ - ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ - : MAX (COMPUTED, SPECIFIED)) - #undef BIGGEST_FIELD_ALIGNMENT /* Use ELF style section commands. */ @@ -450,131 +362,12 @@ do { \ #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" -/* Besides the usual ELF sections, we need a toc section. */ -/* Override elfos.h definition. */ -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini - -/* Override elfos.h definition. */ -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - TOC_SECTION_FUNCTION \ - SDATA_SECTION_FUNCTION \ - SDATA2_SECTION_FUNCTION \ - SBSS_SECTION_FUNCTION \ - INIT_SECTION_FUNCTION \ - FINI_SECTION_FUNCTION - -#define TOC_SECTION_FUNCTION \ -void \ -toc_section (void) \ -{ \ - if (in_section != in_toc) \ - { \ - in_section = in_toc; \ - if (DEFAULT_ABI == ABI_AIX \ - && TARGET_MINIMAL_TOC \ - && !TARGET_RELOCATABLE) \ - { \ - if (! toc_initialized) \ - { \ - toc_initialized = 1; \ - fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ - (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); \ - fprintf (asm_out_file, "\t.tc "); \ - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \ - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ - fprintf (asm_out_file, "\n"); \ - \ - fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ - fprintf (asm_out_file, " = .+32768\n"); \ - } \ - else \ - fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ - } \ - else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \ - fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ - else \ - { \ - fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ - if (! toc_initialized) \ - { \ - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ - fprintf (asm_out_file, " = .+32768\n"); \ - toc_initialized = 1; \ - } \ - } \ - } \ -} \ - \ -extern int in_toc_section (void); \ -int in_toc_section (void) \ -{ \ - return in_section == in_toc; \ -} - -#define SDATA_SECTION_FUNCTION \ -void \ -sdata_section (void) \ -{ \ - if (in_section != in_sdata) \ - { \ - in_section = in_sdata; \ - fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ - } \ -} - -#define SDATA2_SECTION_FUNCTION \ -void \ -sdata2_section (void) \ -{ \ - if (in_section != in_sdata2) \ - { \ - in_section = in_sdata2; \ - fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \ - } \ -} - -#define SBSS_SECTION_FUNCTION \ -void \ -sbss_section (void) \ -{ \ - if (in_section != in_sbss) \ - { \ - in_section = in_sbss; \ - fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ - } \ -} - -#define INIT_SECTION_FUNCTION \ -void \ -init_section (void) \ -{ \ - if (in_section != in_init) \ - { \ - in_section = in_init; \ - fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ - } \ -} - -#define FINI_SECTION_FUNCTION \ -void \ -fini_section (void) \ -{ \ - if (in_section != in_fini) \ - { \ - in_section = in_fini; \ - fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ - } \ -} - /* Override default elf definitions. */ +#define TARGET_ASM_INIT_SECTIONS rs6000_elf_asm_init_sections +#undef TARGET_ASM_RELOC_RW_MASK +#define TARGET_ASM_RELOC_RW_MASK rs6000_elf_reloc_rw_mask #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section -#undef TARGET_ASM_SELECT_SECTION -#define TARGET_ASM_SELECT_SECTION rs6000_elf_select_section -#define TARGET_ASM_UNIQUE_SECTION rs6000_elf_unique_section /* Return nonzero if this entry is to be written into the constant pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST @@ -599,7 +392,7 @@ fini_section (void) \ || (!TARGET_NO_FP_IN_TOC \ && !TARGET_RELOCATABLE \ && GET_CODE (X) == CONST_DOUBLE \ - && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && BITS_PER_WORD == HOST_BITS_PER_INT))) /* These macros generate the special .type and .size directives which @@ -641,14 +434,12 @@ extern int rs6000_pic_labelno; #define LCOMM_ASM_OP "\t.lcomm\t" -/* Override elfos.h definition. */ -#undef ASM_OUTPUT_ALIGNED_LOCAL -#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ +/* Describe how to emit uninitialized local items. */ +#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ do { \ - if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \ - && (SIZE) <= g_switch_value) \ + if ((DECL) && rs6000_elf_in_small_data_p (DECL)) \ { \ - sbss_section (); \ + switch_to_section (sbss_section); \ ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ ASM_OUTPUT_LABEL (FILE, NAME); \ ASM_OUTPUT_SKIP (FILE, SIZE); \ @@ -668,7 +459,7 @@ do { \ /* Describe how to emit uninitialized external linkage items. */ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ do { \ - ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ + ASM_OUTPUT_ALIGNED_DECL_LOCAL (FILE, DECL, NAME, SIZE, ALIGN); \ } while (0) #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN @@ -739,23 +530,8 @@ extern int fixuplabelno; /* Historically we have also supported stabs debugging. */ #define DBX_DEBUGGING_INFO 1 -#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO) - -/* Map register numbers held in the call frame info that gcc has - collected using DWARF_FRAME_REGNUM to those that should be output in - .debug_frame and .eh_frame. We continue to use gcc hard reg numbers - for .eh_frame, but use the numbers mandated by the various ABIs for - .debug_frame. rs6000_emit_prologue has translated any combination of - CR2, CR3, CR4 saves to a save of CR2. The actual code emitted saves - the whole of CR, so we map CR2_REGNO to the DWARF reg for CR. */ -#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) \ - ((FOR_EH) ? (REGNO) \ - : (REGNO) == CR2_REGNO ? 64 \ - : DBX_REGISTER_NUMBER (REGNO)) - #define TARGET_ENCODE_SECTION_INFO rs6000_elf_encode_section_info #define TARGET_IN_SMALL_DATA_P rs6000_elf_in_small_data_p -#define TARGET_SECTION_TYPE_FLAGS rs6000_elf_section_type_flags /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */ @@ -773,38 +549,28 @@ extern int fixuplabelno; #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); #endif -#define TARGET_OS_SYSV_CPP_BUILTINS() \ - do \ - { \ - if (flag_pic == 1) \ - { \ - builtin_define ("__pic__=1"); \ - builtin_define ("__PIC__=1"); \ - } \ - else if (flag_pic == 2) \ - { \ - builtin_define ("__pic__=2"); \ - builtin_define ("__PIC__=2"); \ - } \ - if (target_flags_explicit \ - & MASK_RELOCATABLE) \ - builtin_define ("_RELOCATABLE"); \ - } \ +#define TARGET_OS_SYSV_CPP_BUILTINS() \ + do \ + { \ + if (target_flags_explicit \ + & MASK_RELOCATABLE) \ + builtin_define ("_RELOCATABLE"); \ + } \ while (0) #ifndef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("PPC"); \ - builtin_define_std ("unix"); \ - builtin_define ("__svr4__"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=svr4"); \ - builtin_assert ("cpu=powerpc"); \ - builtin_assert ("machine=powerpc"); \ - TARGET_OS_SYSV_CPP_BUILTINS (); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("PPC"); \ + builtin_define_std ("unix"); \ + builtin_define ("__svr4__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=svr4"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + TARGET_OS_SYSV_CPP_BUILTINS (); \ + } \ while (0) #endif @@ -837,6 +603,10 @@ extern int fixuplabelno; #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)" +#ifndef CC1_SECURE_PLT_DEFAULT_SPEC +#define CC1_SECURE_PLT_DEFAULT_SPEC "" +#endif + /* Pass -G xxx to the compiler and set correct endian mode. */ #define CC1_SPEC "%{G*} \ %{mlittle|mlittle-endian: %(cc1_endian_little); \ @@ -849,7 +619,6 @@ extern int fixuplabelno; mcall-gnu : -mbig %(cc1_endian_big); \ mcall-i960-old : -mlittle %(cc1_endian_little); \ : %(cc1_endian_default)} \ -%{mno-sdata: -msdata=none } \ %{meabi: %{!mcall-*: -mcall-sysv }} \ %{!meabi: %{!mno-eabi: \ %{mrelocatable: -meabi } \ @@ -861,6 +630,7 @@ extern int fixuplabelno; %{mcall-openbsd: -mno-eabi }}} \ %{msdata: -msdata=default} \ %{mno-sdata: -msdata=none} \ +%{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \ %{profile: -p}" /* Don't put -Y P, for cross compilers. */ @@ -1089,7 +859,6 @@ extern int fixuplabelno; #define LINK_OS_FREEBSD_SPEC "\ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ - %{Wl,*:%*} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ @@ -1107,12 +876,12 @@ extern int fixuplabelno; #ifdef HAVE_LD_PIE #define STARTFILE_LINUX_SPEC "\ -%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ +%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ %{mnewlib:ecrti.o%s;:crti.o%s} \ %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_LINUX_SPEC "\ -%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}} \ +%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \ %{mnewlib:ecrti.o%s;:crti.o%s} \ %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" #endif @@ -1123,9 +892,19 @@ extern int fixuplabelno; #define LINK_START_LINUX_SPEC "" +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" +#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#if UCLIBC_DEFAULT +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" +#else +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#endif +#define LINUX_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" #if defined(HAVE_LD_EH_FRAME_HDR) # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " @@ -1237,7 +1016,7 @@ ncrtn.o%s" /* Override rs6000.h definition. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ - { "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \ + { "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \ { "lib_ads", LIB_ADS_SPEC }, \ { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \ { "lib_mvme", LIB_MVME_SPEC }, \ @@ -1247,7 +1026,7 @@ ncrtn.o%s" { "lib_linux", LIB_LINUX_SPEC }, \ { "lib_netbsd", LIB_NETBSD_SPEC }, \ { "lib_openbsd", LIB_OPENBSD_SPEC }, \ - { "lib_windiss", LIB_WINDISS_SPEC }, \ + { "lib_windiss", LIB_WINDISS_SPEC }, \ { "lib_default", LIB_DEFAULT_SPEC }, \ { "startfile_ads", STARTFILE_ADS_SPEC }, \ { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \ @@ -1258,7 +1037,7 @@ ncrtn.o%s" { "startfile_linux", STARTFILE_LINUX_SPEC }, \ { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \ - { "startfile_windiss", STARTFILE_WINDISS_SPEC }, \ + { "startfile_windiss", STARTFILE_WINDISS_SPEC }, \ { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ { "endfile_ads", ENDFILE_ADS_SPEC }, \ { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \ @@ -1269,7 +1048,7 @@ ncrtn.o%s" { "endfile_linux", ENDFILE_LINUX_SPEC }, \ { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \ - { "endfile_windiss", ENDFILE_WINDISS_SPEC }, \ + { "endfile_windiss", ENDFILE_WINDISS_SPEC }, \ { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ { "link_path", LINK_PATH_SPEC }, \ { "link_shlib", LINK_SHLIB_SPEC }, \ @@ -1301,6 +1080,7 @@ ncrtn.o%s" { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \ { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \ { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \ + { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ @@ -1310,7 +1090,7 @@ ncrtn.o%s" { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \ - { "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \ + { "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \ { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }, \ SUBSUBTARGET_EXTRA_SPECS @@ -1360,3 +1140,6 @@ ncrtn.o%s" /* Generate entries in .fixup for relocatable addresses. */ #define RELOCATABLE_NEEDS_FIXUP 1 + +/* This target uses the sysv4.opt file. */ +#define TARGET_USES_SYSV4_OPT 1 diff --git a/contrib/gcc/config/rs6000/sysv4.opt b/contrib/gcc/config/rs6000/sysv4.opt new file mode 100644 index 00000000000..c483ea5e00a --- /dev/null +++ b/contrib/gcc/config/rs6000/sysv4.opt @@ -0,0 +1,149 @@ +; SYSV4 options for PPC port. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mcall- +Target RejectNegative Joined +Select ABI calling convention + +msdata= +Target RejectNegative Joined +Select method for sdata handling + +mtls-size= +Target RejectNegative Joined +Specify bit size of immediate TLS offsets + +mbit-align +Target Report Mask(NO_BITFIELD_TYPE) +Align to the base type of the bit-field + +mstrict-align +Target Report Mask(STRICT_ALIGN) +Align to the base type of the bit-field +Don't assume that unaligned accesses are handled by the system + +mrelocatable +Target Report Mask(RELOCATABLE) +Produce code relocatable at runtime + +mrelocatable-lib +Target +Produce code relocatable at runtime + +mlittle-endian +Target Report RejectNegative Mask(LITTLE_ENDIAN) +Produce little endian code + +mlittle +Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists +Produce little endian code + +mbig-endian +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Produce big endian code + +mbig +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Produce big endian code + +;; FIXME: This does nothing. What should be done? +mno-toc +Target RejectNegative +no description yet + +mtoc +Target RejectNegative +no description yet + +mprototype +Target Mask(PROTOTYPE) +Assume all variable arg functions are prototyped + +;; FIXME: Does nothing. +mno-traceback +Target RejectNegative +no description yet + +meabi +Target Report Mask(EABI) +Use EABI + +mbit-word +Target Report Mask(NO_BITFIELD_WORD) +Allow bit-fields to cross word boundaries + +mregnames +Target Mask(REGNAMES) +Use alternate register names + +;; FIXME: Does nothing. +msdata +Target +no description yet + +msim +Target RejectNegative +Link with libsim.a, libc.a and sim-crt0.o + +mads +Target RejectNegative +Link with libads.a, libc.a and crt0.o + +myellowknife +Target RejectNegative +Link with libyk.a, libc.a and crt0.o + +mmvme +Target RejectNegative +Link with libmvme.a, libc.a and crt0.o + +memb +Target RejectNegative +Set the PPC_EMB bit in the ELF flags header + +mwindiss +Target RejectNegative +Use the WindISS simulator + +mshlib +Target RejectNegative +no description yet + +m64 +Target Report RejectNegative Mask(64BIT) +Generate 64-bit code + +m32 +Target Report RejectNegative InverseMask(64BIT) +Generate 32-bit code + +mnewlib +Target RejectNegative +no description yet + +msecure-plt +Target Report RejectNegative Var(secure_plt, 1) +Generate code to use a non-exec PLT and GOT + +mbss-plt +Target Report RejectNegative Var(secure_plt, 0) +Generate code for old exec BSS PLT diff --git a/contrib/gcc/config/rs6000/sysv4le.h b/contrib/gcc/config/rs6000/sysv4le.h index 38be8a6886f..b6964bc5629 100644 --- a/contrib/gcc/config/rs6000/sysv4le.h +++ b/contrib/gcc/config/rs6000/sysv4le.h @@ -17,8 +17,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN) diff --git a/contrib/gcc/config/rs6000/t-aix43 b/contrib/gcc/config/rs6000/t-aix43 index 8c2592fe430..6a73cdd0312 100644 --- a/contrib/gcc/config/rs6000/t-aix43 +++ b/contrib/gcc/config/rs6000/t-aix43 @@ -46,29 +46,31 @@ SHLIB_EXT = .a SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \ @multilib_flags@ @shlib_objs@ -lc \ - `case @shlib_base_name@ in \ + `case @multilib_dir@ in \ *pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \ *) echo -lc ;; esac` ; \ - rm -f tmp-@shlib_base_name@.a ; \ - $(AR_CREATE_FOR_TARGET) tmp-@shlib_base_name@.a @multilib_dir@/shr.o ; \ - mv tmp-@shlib_base_name@.a @shlib_base_name@.a ; \ + rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \ + $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \ + @multilib_dir@/shr.o ; \ + mv @multilib_dir@/tmp-@shlib_base_name@.a \ + @multilib_dir@/@shlib_base_name@.a ; \ rm -f @multilib_dir@/shr.o # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. -SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.a $$(DESTDIR)$$(slibdir)/ -SHLIB_LIBS = -lc `case @shlib_base_name@ in *pthread*) echo -lpthread ;; esac` +SHLIB_INSTALL = \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \ + $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \ + $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/ +SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac` SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver SHLIB_NM_FLAGS = -Bpg -X32_64 # GCC 128-bit long double support routines. -LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c +LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/ppc64-fp.c \ + $(srcdir)/config/rs6000/darwin-ldouble.c +TARGET_LIBGCC2_CFLAGS = -mlong-double-128 # Either 32-bit and 64-bit objects in archives. AR_FLAGS_FOR_TARGET = -X32_64 -# Compile Ada files with minimal-toc. The primary focus is gnatlib, so -# that the library does not use nearly the entire TOC of applications -# until gnatlib is built as a shared library on AIX. Compiling the -# compiler with -mminimal-toc does not cause any harm. -T_ADAFLAGS = -mminimal-toc diff --git a/contrib/gcc/config/rs6000/t-aix52 b/contrib/gcc/config/rs6000/t-aix52 index 839bd0a1ce2..37a5d83b828 100644 --- a/contrib/gcc/config/rs6000/t-aix52 +++ b/contrib/gcc/config/rs6000/t-aix52 @@ -27,29 +27,31 @@ SHLIB_EXT = .a SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ -Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \ @multilib_flags@ @shlib_objs@ -lc \ - `case @shlib_base_name@ in \ + `case @multilib_dir@ in \ *pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \ *) echo -lc ;; esac` ; \ - rm -f tmp-@shlib_base_name@.a ; \ - $(AR_CREATE_FOR_TARGET) tmp-@shlib_base_name@.a @multilib_dir@/shr.o ; \ - mv tmp-@shlib_base_name@.a @shlib_base_name@.a ; \ + rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \ + $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \ + @multilib_dir@/shr.o ; \ + mv @multilib_dir@/tmp-@shlib_base_name@.a \ + @multilib_dir@/@shlib_base_name@.a ; \ rm -f @multilib_dir@/shr.o # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. -SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.a $$(DESTDIR)$$(slibdir)/ -SHLIB_LIBS = -lc `case @shlib_base_name@ in *pthread*) echo -lpthread ;; esac` +SHLIB_INSTALL = \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \ + $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \ + $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/ +SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac` SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver SHLIB_NM_FLAGS = -Bpg -X32_64 # GCC 128-bit long double support routines. -LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c +LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/ppc64-fp.c \ + $(srcdir)/config/rs6000/darwin-ldouble.c +TARGET_LIBGCC2_CFLAGS = -mlong-double-128 # Either 32-bit and 64-bit objects in archives. AR_FLAGS_FOR_TARGET = -X32_64 -# Compile Ada files with minimal-toc. The primary focus is gnatlib, so -# that the library does not use nearly the entire TOC of applications -# until gnatlib is built as a shared library on AIX. Compiling the -# compiler with -mminimal-toc does not cause any harm. -T_ADAFLAGS = -mminimal-toc diff --git a/contrib/gcc/config/rs6000/t-beos b/contrib/gcc/config/rs6000/t-beos index badffefff42..dc3b89dba57 100644 --- a/contrib/gcc/config/rs6000/t-beos +++ b/contrib/gcc/config/rs6000/t-beos @@ -28,6 +28,3 @@ EXTRA_PARTS = milli.exp milli.exp: $(srcdir)/config/rs6000/milli.exp rm -f milli.exp cp $(srcdir)/config/rs6000/milli.exp ./milli.exp - -# Don't use collect. -USE_COLLECT2 = diff --git a/contrib/gcc/config/rs6000/t-darwin b/contrib/gcc/config/rs6000/t-darwin index 185bb00eed2..5ef28723848 100644 --- a/contrib/gcc/config/rs6000/t-darwin +++ b/contrib/gcc/config/rs6000/t-darwin @@ -1,7 +1,37 @@ -# Add trampoline and long double support to libgcc. LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \ - $(srcdir)/config/rs6000/darwin-ldouble.c + $(srcdir)/config/rs6000/ppc64-fp.c \ + $(srcdir)/config/darwin-64.c \ + $(srcdir)/config/rs6000/darwin-ldouble.c \ + $(srcdir)/config/rs6000/darwin-world.asm -# For libgcc, we always want 128-bit long double, since a libgcc built with -# that will work without it. -TARGET_LIBGCC2_CFLAGS = -mlong-double-128 +LIB2FUNCS_STATIC_EXTRA = \ + $(srcdir)/config/rs6000/darwin-fpsave.asm \ + $(srcdir)/config/rs6000/darwin-vecsave.asm + +DARWIN_EXTRA_CRT_BUILD_CFLAGS = -mlongcall + +# The .asm files above are designed to run on all processors, +# even though they use AltiVec instructions. -Wa is used because +# -force_cpusubtype_ALL doesn't work with -dynamiclib. +# +# -pipe because there's an assembler bug, 4077127, which causes +# it to not properly process the first # directive, causing temporary +# file names to appear in stabs, causing the bootstrap to fail. Using -pipe +# works around this by not having any temporary file names. +TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusubtype_ALL -pipe -mmacosx-version-min=10.4 + +# Export the _xlq* symbols from darwin-ldouble.c. +SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver + +SHLIB_VERPFX = $(srcdir)/config/rs6000/darwin-libgcc + +LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c + +darwin-fpsave.o: $(srcdir)/config/rs6000/darwin-asm.h +darwin-tramp.o: $(srcdir)/config/rs6000/darwin-asm.h + +# Explain how to build crt2.o +$(T)crt2$(objext): $(srcdir)/config/darwin-crt2.c $(GCC_PASSES) \ + $(TCONFIG_H) stmp-int-hdrs tsystem.h + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \ + -c $(srcdir)/config/darwin-crt2.c -o $(T)crt2$(objext) diff --git a/contrib/gcc/config/rs6000/t-darwin8 b/contrib/gcc/config/rs6000/t-darwin8 new file mode 100644 index 00000000000..2f3bb32f821 --- /dev/null +++ b/contrib/gcc/config/rs6000/t-darwin8 @@ -0,0 +1,3 @@ +# 64-bit libraries can only be built in Darwin 8.x or later. +MULTILIB_OPTIONS = m64 +MULTILIB_DIRNAMES = ppc64 diff --git a/contrib/gcc/config/rs6000/t-fprules b/contrib/gcc/config/rs6000/t-fprules index 4fb09a2789a..aa686c15b00 100644 --- a/contrib/gcc/config/rs6000/t-fprules +++ b/contrib/gcc/config/rs6000/t-fprules @@ -1,18 +1,7 @@ -# We want fine grained libraries, so use the new code to build the -# floating point emulation libraries. -FPBIT = fp-bit.c -DPBIT = dp-bit.c - -dp-bit.c: $(srcdir)/config/fp-bit.c - cat $(srcdir)/config/fp-bit.c > dp-bit.c - -fp-bit.c: $(srcdir)/config/fp-bit.c - echo '#define FLOAT' > fp-bit.c - cat $(srcdir)/config/fp-bit.c >> fp-bit.c - MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \ msoft-float=mcpu?403 \ msoft-float=mcpu?405 \ + msoft-float=mcpu?440 \ msoft-float=mcpu?ec603e \ msoft-float=mcpu?801 \ msoft-float=mcpu?821 \ diff --git a/contrib/gcc/config/rs6000/t-fprules-fpbit b/contrib/gcc/config/rs6000/t-fprules-fpbit new file mode 100644 index 00000000000..a80c1cf4eec --- /dev/null +++ b/contrib/gcc/config/rs6000/t-fprules-fpbit @@ -0,0 +1,11 @@ +# We want fine grained libraries, so use the new code to build the +# floating point emulation libraries. +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c diff --git a/contrib/gcc/config/rs6000/t-fprules-softfp b/contrib/gcc/config/rs6000/t-fprules-softfp new file mode 100644 index 00000000000..10b271f036d --- /dev/null +++ b/contrib/gcc/config/rs6000/t-fprules-softfp @@ -0,0 +1,6 @@ +softfp_float_modes := sf df +softfp_int_modes := si di +softfp_extensions := sfdf +softfp_truncations := dfsf +softfp_machine_header := rs6000/sfp-machine.h +softfp_exclude_libgcc2 := y diff --git a/contrib/gcc/config/rs6000/t-linux64 b/contrib/gcc/config/rs6000/t-linux64 index 6d1e6f46940..a2c04f928e6 100644 --- a/contrib/gcc/config/rs6000/t-linux64 +++ b/contrib/gcc/config/rs6000/t-linux64 @@ -1,13 +1,11 @@ #rs6000/t-linux64 -LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c -LIB2FUNCS_STATIC_EXTRA = eabi.S $(srcdir)/config/rs6000/darwin-ldouble.c -LIB2FUNCS_SHARED_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble-shared.c +LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/ppc64-fp.c \ + $(srcdir)/config/rs6000/darwin-ldouble.c +LIB2FUNCS_EXTRA := $(sort $(LIB2FUNCS_EXTRA)) -TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC -specs=bispecs - -SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver +TARGET_LIBGCC2_CFLAGS += -mno-minimal-toc MULTILIB_OPTIONS = m64/m32 msoft-float MULTILIB_DIRNAMES = 64 32 nof @@ -17,29 +15,5 @@ MULTILIB_EXCLUSIONS = m64/!m32/msoft-float MULTILIB_OSDIRNAMES = ../lib64 ../lib nof MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT) -# We want fine grained libraries, so use the new code to build the -# floating point emulation libraries. -# fp-bit is only to be used by 32-bit multilibs -FPBIT = fp-bit32.c -DPBIT = dp-bit32.c - -dp-bit32.c: $(srcdir)/config/fp-bit.c - ( echo '#ifndef __powerpc64__'; \ - cat $(srcdir)/config/fp-bit.c; \ - echo '#endif' ) > dp-bit32.c - -fp-bit32.c: $(srcdir)/config/fp-bit.c - ( echo '#ifndef __powerpc64__'; \ - echo '#define FLOAT'; \ - cat $(srcdir)/config/fp-bit.c; \ - echo '#endif' ) > fp-bit32.c - -# Hack to use -mlong-double-128 just for compiling 64 bit libgcc -mklibgcc: bispecs - -bispecs: specs - if [ x`$(GCC_FOR_TARGET) -print-multi-os-directory` = x../lib ]; then \ - sed -e '/cc1_options/{ n; s/$$/ %{m64:-mlong-double-128}/; }' < specs > $@; \ - else \ - sed -e '/cc1_options/{ n; s/$$/ %{!m32:-mlong-double-128}/; }' < specs > $@; \ - fi +softfp_wrap_start := '\#ifndef __powerpc64__' +softfp_wrap_end := '\#endif' diff --git a/contrib/gcc/config/rs6000/t-lynx b/contrib/gcc/config/rs6000/t-lynx new file mode 100644 index 00000000000..429f641ece2 --- /dev/null +++ b/contrib/gcc/config/rs6000/t-lynx @@ -0,0 +1,38 @@ +LIB2FUNCS_EXTRA = tramp.S + +tramp.S: $(srcdir)/config/rs6000/tramp.asm + cat $(srcdir)/config/rs6000/tramp.asm > tramp.S + +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +MULTILIB_OPTIONS += msoft-float +MULTILIB_DIRNAMES += soft-float + +MULTILIB_OPTIONS += maltivec +MULTILIB_DIRNAMES += altivec + +MULTILIB_EXCEPTIONS = *msoft-float/*maltivec* + +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o + +# If .sdata is enabled __CTOR_{LIST,END}__ go into .sdata instead of +# .ctors. +CRTSTUFF_T_CFLAGS = -mno-sdata + +# Compile crtbeginS.o and crtendS.o with pic. +CRTSTUFF_T_CFLAGS_S = -fPIC -mno-sdata + +Local Variables: +mode: makefile +End: diff --git a/contrib/gcc/config/rs6000/t-ppccomm b/contrib/gcc/config/rs6000/t-ppccomm index eaa3252a60b..b4950f1297a 100644 --- a/contrib/gcc/config/rs6000/t-ppccomm +++ b/contrib/gcc/config/rs6000/t-ppccomm @@ -1,6 +1,6 @@ # Common support for PowerPC ELF targets (both EABI and SVR4). -LIB2FUNCS_EXTRA = tramp.S +LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c # This one can't end up in shared libgcc LIB2FUNCS_STATIC_EXTRA = eabi.S @@ -11,6 +11,14 @@ eabi.S: $(srcdir)/config/rs6000/eabi.asm tramp.S: $(srcdir)/config/rs6000/tramp.asm cat $(srcdir)/config/rs6000/tramp.asm > tramp.S +ifneq (,$(findstring gnu,$(target))) +ifeq (,$(findstring spe,$(target))) +TARGET_LIBGCC2_CFLAGS += -mlong-double-128 + +SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc-glibc.ver +endif +endif + # Switch synonyms MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd diff --git a/contrib/gcc/config/rs6000/t-rtems b/contrib/gcc/config/rs6000/t-rtems index 05d9a262364..b3db9498a23 100644 --- a/contrib/gcc/config/rs6000/t-rtems +++ b/contrib/gcc/config/rs6000/t-rtems @@ -1,87 +1,66 @@ # Multilibs for powerpc RTEMS targets. MULTILIB_OPTIONS = \ -mcpu=403/mcpu=505/mcpu=601/mcpu=602/mcpu=603/mcpu=603e/mcpu=604/mcpu=750/mcpu=821/mcpu=860 \ -Dmpc509/Dmpc8260 \ -D_OLD_EXCEPTIONS \ +mcpu=403/mcpu=505/mcpu=601/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400 \ +Dmpc8260 \ msoft-float MULTILIB_DIRNAMES = \ -m403 m505 m601 m602 m603 m603e m604 m750 m821 m860 \ -mpc509 \ +m403 m505 m601 m603e m604 m860 m7400 \ mpc8260 \ -roe \ nof MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align # MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} -MULTILIB_MATCHES = ${MULTILIB_MATCHES_ENDIAN} \ - ${MULTILIB_MATCHES_SYSV} \ - mcpu?505/Dmpc505=mcpu?505/Dmpc509 +MULTILIB_MATCHES = +MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} +MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV} +# Map 405 to 403 +MULTILIB_MATCHES += mcpu?403=mcpu?405 +# Map 602, 603e, 603 to 603e +MULTILIB_MATCHES += mcpu?603e=mcpu?602 +MULTILIB_MATCHES += mcpu?603e=mcpu?603 +# Map 801, 821, 823 to 860 +MULTILIB_MATCHES += mcpu?860=mcpu?801 +MULTILIB_MATCHES += mcpu?860=mcpu?821 +MULTILIB_MATCHES += mcpu?860=mcpu?823 +# Map 7450 to 7400 +MULTILIB_MATCHES += mcpu?7400=mcpu?7450 -# -# RTEMS old/new-exceptions handling -# -# old-exception processing is depredicated, therefore -# -# * Cpu-variants supporting new exception processing are build -# with new exception processing only -# * Cpu-variants not having been ported to new exception processing are -# build with old and new exception processing -# - -# Cpu-variants supporting new exception processing only -MULTILIB_NEW_EXCEPTIONS_ONLY = \ -*mcpu=505*/*D_OLD_EXCEPTIONS* \ -*mcpu=604*/*D_OLD_EXCEPTIONS* \ -*mcpu=750*/*D_OLD_EXCEPTIONS* \ -*mcpu=821*/*D_OLD_EXCEPTIONS* \ -*Dmpc8260*/*D_OLD_EXCEPTIONS* \ -*mcpu=860*/*D_OLD_EXCEPTIONS* +# Map 750 to . +MULTILIB_MATCHES += mcpu?750= # Soft-float only, default implies msoft-float # NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES MULTILIB_SOFTFLOAT_ONLY = \ -mcpu=403/*msoft-float* \ -mcpu=821/*msoft-float* \ -mcpu=860/*msoft-float* +*mcpu=401/*msoft-float* \ +*mcpu=403/*msoft-float* \ +*mcpu=405/*msoft-float* \ +*mcpu=801/*msoft-float* \ +*mcpu=821/*msoft-float* \ +*mcpu=823/*msoft-float* \ +*mcpu=860/*msoft-float* # Hard-float only, take out msoft-float MULTILIB_HARDFLOAT_ONLY = \ -mcpu=505/*msoft-float* +*mcpu=505/*msoft-float* MULTILIB_EXCEPTIONS = -# Disallow -D_OLD_EXCEPTIONS without other options -MULTILIB_EXCEPTIONS += D_OLD_EXCEPTIONS* - # Disallow -Dppc and -Dmpc without other options MULTILIB_EXCEPTIONS += Dppc* Dmpc* MULTILIB_EXCEPTIONS += \ -${MULTILIB_NEW_EXCEPTIONS_ONLY} \ ${MULTILIB_SOFTFLOAT_ONLY} \ ${MULTILIB_HARDFLOAT_ONLY} # Special rules # Take out all variants we don't want -MULTILIB_EXCEPTIONS += mcpu=403/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=403/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=505/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=505/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=601/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=601/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=602/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=602/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=603/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=603/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=603e/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=604/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=604/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=750/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=750/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=821/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=821/Dmpc8260* -MULTILIB_EXCEPTIONS += mcpu=860/Dmpc509* -MULTILIB_EXCEPTIONS += mcpu=860/Dmpc8260* +MULTILIB_EXCEPTIONS += *mcpu=403/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=505/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=601/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=604/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=750/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=860/Dmpc* +MULTILIB_EXCEPTIONS += *mcpu=7400/Dmpc* diff --git a/contrib/gcc/config/rs6000/t-vxworks b/contrib/gcc/config/rs6000/t-vxworks index e89e47b8d09..fe65a399397 100644 --- a/contrib/gcc/config/rs6000/t-vxworks +++ b/contrib/gcc/config/rs6000/t-vxworks @@ -1,10 +1,11 @@ # Multilibs for VxWorks. -MULTILIB_OPTIONS = t403/t405/t440/t603/t604/t860 -MULTILIB_DIRNAMES = PPC403gnu PPC405gnu PPC440gnu \ - PPC603gnu PPC604gnu PPC860gnu +# The base multilib is -mhard-float. +MULTILIB_OPTIONS = mrtp fPIC msoft-float +MULTILIB_DIRNAMES = +MULTILIB_MATCHES = fPIC=fpic +MULTILIB_EXCEPTIONS = fPIC* -MULTILIB_MATCHES = t604= - -# Put vxlib.c back in LIB2FUNCS_EXTRA (t-ppccomm clobbers it). -LIB2FUNCS_EXTRA += $(srcdir)/config/vxlib.c +# Restore some variables from t-vxworks clobbered by t-ppccomm. +EXTRA_MULTILIB_PARTS = +LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c diff --git a/contrib/gcc/config/rs6000/t-vxworksae b/contrib/gcc/config/rs6000/t-vxworksae new file mode 100644 index 00000000000..5f682627ebc --- /dev/null +++ b/contrib/gcc/config/rs6000/t-vxworksae @@ -0,0 +1,5 @@ +# Multilibs for VxWorks AE. + +MULTILIB_OPTIONS = mvthreads msoft-float +MULTILIB_MATCHES = +MULTILIB_EXCEPTIONS = diff --git a/contrib/gcc/config/rs6000/tramp.asm b/contrib/gcc/config/rs6000/tramp.asm index 284f9386074..63dacc027a3 100644 --- a/contrib/gcc/config/rs6000/tramp.asm +++ b/contrib/gcc/config/rs6000/tramp.asm @@ -23,8 +23,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause @@ -44,7 +44,7 @@ .align 2 trampoline_initial: mflr r0 - bl 1f + bcl 20,31,1f .Lfunc = .-trampoline_initial .long 0 /* will be replaced with function address */ .Lchain = .-trampoline_initial @@ -67,7 +67,7 @@ trampoline_size = .-trampoline_initial FUNC_START(__trampoline_setup) mflr r0 /* save return address */ - bl .LCF0 /* load up __trampoline_initial into r7 */ + bcl 20,31,.LCF0 /* load up __trampoline_initial into r7 */ .LCF0: mflr r11 addi r7,r11,trampoline_initial-4-.LCF0 /* trampoline address -4 */ @@ -105,6 +105,12 @@ FUNC_START(__trampoline_setup) blr .Labort: +#if defined SHARED && defined HAVE_AS_REL16 + bcl 20,31,1f +1: mflr r30 + addis r30,r30,_GLOBAL_OFFSET_TABLE_-1b@ha + addi r30,r30,_GLOBAL_OFFSET_TABLE_-1b@l +#endif bl JUMP_TARGET(abort) FUNC_END(__trampoline_setup) diff --git a/contrib/gcc/config/rs6000/vxworks.h b/contrib/gcc/config/rs6000/vxworks.h index e7a70922e7a..273a4357a28 100644 --- a/contrib/gcc/config/rs6000/vxworks.h +++ b/contrib/gcc/config/rs6000/vxworks.h @@ -1,32 +1,56 @@ /* Definitions of target machine for GNU compiler. Vxworks PowerPC version. - Copyright (C) 1996, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. - This file is part of GCC. +This file is part of GCC. - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your - option) any later version. +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. - 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. */ +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ -#undef TARGET_OS_CPP_BUILTINS +/* Note to future editors: VxWorks is mostly an EABI target. We do + not use rs6000/eabi.h because we would have to override most of + it anyway. However, if you change that file, consider making + analogous changes here too. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)"); + +/* CPP predefined macros. */ + +#undef TARGET_OS_CPP_BUILTINS #define TARGET_OS_CPP_BUILTINS() \ do \ { \ + builtin_define ("__ppc"); \ + builtin_define ("__EABI__"); \ + builtin_define ("__ELF__"); \ builtin_define ("__vxworks"); \ - builtin_define ("__vxworks__"); \ + builtin_define ("__VXWORKS__"); \ + if (!TARGET_SOFT_FLOAT) \ + builtin_define ("__hardfp"); \ + \ + /* C89 namespace violation! */ \ + builtin_define ("CPU_FAMILY=PPC"); \ } \ while (0) +/* Only big endian PPC is supported by VxWorks. */ +#undef BYTES_BIG_ENDIAN +#define BYTES_BIG_ENDIAN 1 + /* We have to kill off the entire specs set created by rs6000/sysv4.h and substitute our own set. The top level vxworks.h has done some of this for us. */ @@ -38,45 +62,92 @@ #define SUBTARGET_EXTRA_SPECS /* none needed */ +/* FIXME: The only reason we allow no -mcpu switch at all is because + config-ml.in insists on a "." multilib. */ #define CPP_SPEC \ -"-DCPU_FAMILY=PPC -D__ppc -D__EABI__ \ - %{t403: -DCPU=PPC403 -D_SOFT_FLOAT ; \ - t405: -DCPU=PPC405 -D_SOFT_FLOAT ; \ - t440: -DCPU=PPC440 -D_SOFT_FLOAT ; \ - t603: -DCPU=PPC603 ; \ - t604: -DCPU=PPC604 ; \ - t860: -DCPU=PPC860 -D_SOFT_FLOAT ; \ - : -DCPU=PPC604} \ - %{!msoft-float:-D__hardfp} \ - %{fpic|fpie: -D__PIC__=1 -D__pic__=1 ; \ - fPIC|fPIE: -D__PIC__=2 -D__pic__=2 } \ - %(cpp_cpu)" +"%{!DCPU=*: \ + %{mcpu=403 : -DCPU=PPC403 ; \ + mcpu=405 : -DCPU=PPC405 ; \ + mcpu=440 : -DCPU=PPC440 ; \ + mcpu=603 : -DCPU=PPC603 ; \ + mcpu=604 : -DCPU=PPC604 ; \ + mcpu=860 : -DCPU=PPC860 ; \ + mcpu=8540: -DCPU=PPC85XX ; \ + : -DCPU=PPC604 }}" \ +VXWORKS_ADDITIONAL_CPP_SPEC -#define CC1_SPEC \ -"%{t403: -mcpu=403 -mstrict-align ; \ - t405: -mcpu=405 -mstrict-align ; \ - t440: -mcpu=440 -mstrict-align ; \ - t603: -mcpu=603 -mstrict-align ; \ - t604: -mcpu=604 -mstrict-align ; \ - t860: -mcpu=860 ; \ - : -mcpu=604 -mstrict-align } \ - %{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \ +#define CC1_SPEC \ +"%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \ %{mlittle|mlittle-endian:-mstrict-align} \ - %{profile: -p} \ + %{profile: -p} \ %{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}" - -#define ASM_SPEC "%(asm_cpu) \ -%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ -%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ -%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig" -#undef MULTILIB_DEFAULTS -#define MULTILIB_DEFAULTS { "t604" } +#define ASM_SPEC \ +"%(asm_cpu) \ + %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ + %{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ + %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig" -/* We can't use .ctors/.dtors sections. */ -#undef TARGET_ASM_OUTPUT_CONSTRUCTOR -#undef TARGET_ASM_OUTPUT_DESTRUCTOR +#undef LIB_SPEC +#define LIB_SPEC VXWORKS_LIB_SPEC +#undef LINK_SPEC +#define LINK_SPEC VXWORKS_LINK_SPEC +#undef STARTFILE_SPEC +#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC +#undef ENDFILE_SPEC +#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC -/* Nor sdata. */ -#undef SDATA_DEFAULT_SIZE -#define SDATA_DEFAULT_SIZE 0 +/* There is no default multilib. */ +#undef MULTILIB_DEFAULTS + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT \ + (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN) + +#undef PROCESSOR_DEFAULT +#define PROCESSOR_DEFAULT PROCESSOR_PPC604 + +/* Nor sdata, for kernel mode. We use this in + SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized. */ +#undef SDATA_DEFAULT_SIZE +#define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0) + +#undef STACK_BOUNDARY +#define STACK_BOUNDARY (16*BITS_PER_UNIT) +/* Override sysv4.h, reset to the default. */ +#undef PREFERRED_STACK_BOUNDARY + +/* Enable SPE */ +#undef TARGET_SPE_ABI +#undef TARGET_SPE +#undef TARGET_E500 +#undef TARGET_ISEL +#undef TARGET_FPRS + +#define TARGET_SPE_ABI rs6000_spe_abi +#define TARGET_SPE rs6000_spe +#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) +#define TARGET_ISEL rs6000_isel +#define TARGET_FPRS (!rs6000_float_gprs) + +/* Make -mcpu=8540 imply SPE. ISEL is automatically enabled, the + others must be done by hand. Handle -mrtp. Disable -fPIC + for -mrtp - the VxWorks PIC model is not compatible with it. */ +#undef SUBSUBTARGET_OVERRIDE_OPTIONS +#define SUBSUBTARGET_OVERRIDE_OPTIONS \ + do { \ + if (TARGET_E500) \ + { \ + rs6000_spe = 1; \ + rs6000_spe_abi = 1; \ + rs6000_float_gprs = 1; \ + } \ + \ + if (!g_switch_set) \ + g_switch_value = SDATA_DEFAULT_SIZE; \ + VXWORKS_OVERRIDE_OPTIONS; \ + } while (0) + +/* No _mcount profiling on VxWorks. */ +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO) diff --git a/contrib/gcc/config/rs6000/vxworksae.h b/contrib/gcc/config/rs6000/vxworksae.h new file mode 100644 index 00000000000..814b969b0a2 --- /dev/null +++ b/contrib/gcc/config/rs6000/vxworksae.h @@ -0,0 +1,24 @@ +/* PowerPC VxWorks AE target definitions for GNU compiler. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks AE)"); + diff --git a/contrib/gcc/config/rs6000/windiss.h b/contrib/gcc/config/rs6000/windiss.h index e66d128696d..f4f16651668 100644 --- a/contrib/gcc/config/rs6000/windiss.h +++ b/contrib/gcc/config/rs6000/windiss.h @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC WindISS)"); diff --git a/contrib/gcc/config/rs6000/x-darwin b/contrib/gcc/config/rs6000/x-darwin index f7242a7ee5b..033ab6bf54c 100644 --- a/contrib/gcc/config/rs6000/x-darwin +++ b/contrib/gcc/config/rs6000/x-darwin @@ -1,4 +1,4 @@ -host-darwin.o : $(srcdir)/config/rs6000/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/rs6000/host-darwin.c +host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c \ + $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \ + config/host-darwin.h $(DIAGNOSTIC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ diff --git a/contrib/gcc/config/rs6000/x-darwin64 b/contrib/gcc/config/rs6000/x-darwin64 new file mode 100644 index 00000000000..3cb423db35e --- /dev/null +++ b/contrib/gcc/config/rs6000/x-darwin64 @@ -0,0 +1,4 @@ +host-ppc64-darwin.o : $(srcdir)/config/rs6000/host-ppc64-darwin.c \ + $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \ + config/host-darwin.h $(DIAGNOSTIC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ diff --git a/contrib/gcc/config/rs6000/xcoff.h b/contrib/gcc/config/rs6000/xcoff.h index d4e056b4b74..ebf79b51e9d 100644 --- a/contrib/gcc/config/rs6000/xcoff.h +++ b/contrib/gcc/config/rs6000/xcoff.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for some generic XCOFF file format - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ 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. */ + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ #define TARGET_OBJECT_FORMAT OBJECT_XCOFF @@ -56,92 +56,10 @@ #define DOLLARS_IN_IDENTIFIERS 0 -/* Define the extra sections we need. We define three: one is the read-only - data section which is used for constants. This is a csect whose name is - derived from the name of the input file. The second is for initialized - global variables. This is a csect whose name is that of the variable. - The third is the TOC. */ +/* AIX .align pseudo-op accept value from 0 to 12, corresponding to + log base 2 of the alignment in bytes; 12 = 4096 bytes = 32768 bits. */ -#define EXTRA_SECTIONS \ - read_only_data, private_data, read_only_private_data, toc, bss - -/* Define the routines to implement these extra sections. - BIGGEST_ALIGNMENT is 64, so align the sections that much. */ - -#define EXTRA_SECTION_FUNCTIONS \ - READ_ONLY_DATA_SECTION_FUNCTION \ - PRIVATE_DATA_SECTION_FUNCTION \ - READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION \ - TOC_SECTION_FUNCTION - -#define READ_ONLY_DATA_SECTION_FUNCTION \ -void \ -read_only_data_section (void) \ -{ \ - if (in_section != read_only_data) \ - { \ - fprintf (asm_out_file, "\t.csect %s[RO],3\n", \ - xcoff_read_only_section_name); \ - in_section = read_only_data; \ - } \ -} - -#define PRIVATE_DATA_SECTION_FUNCTION \ -void \ -private_data_section (void) \ -{ \ - if (in_section != private_data) \ - { \ - fprintf (asm_out_file, "\t.csect %s[RW],3\n", \ - xcoff_private_data_section_name); \ - in_section = private_data; \ - } \ -} - -#define READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION \ -void \ -read_only_private_data_section (void) \ -{ \ - if (in_section != read_only_private_data) \ - { \ - fprintf (asm_out_file, "\t.csect %s[RO],3\n", \ - xcoff_private_data_section_name); \ - in_section = read_only_private_data; \ - } \ -} - -#define TOC_SECTION_FUNCTION \ -void \ -toc_section (void) \ -{ \ - if (TARGET_MINIMAL_TOC) \ - { \ - /* toc_section is always called at least once \ - from rs6000_xcoff_file_start, so this is \ - guaranteed to always be defined once and \ - only once in each file. */ \ - if (! toc_initialized) \ - { \ - fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); \ - fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \ - toc_initialized = 1; \ - } \ - \ - if (in_section != toc) \ - fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", \ - (TARGET_32BIT ? "" : ",3")); \ - } \ - else \ - { \ - if (in_section != toc) \ - fputs ("\t.toc\n", asm_out_file); \ - } \ - in_section = toc; \ -} - -/* Define the name of our readonly data section. */ - -#define READONLY_DATA_SECTION read_only_data_section +#define MAX_OFILE_ALIGNMENT 32768 /* Return nonzero if this entry is to be written into the constant pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF @@ -164,14 +82,18 @@ toc_section (void) \ || (GET_CODE (X) == CONST_DOUBLE \ && (TARGET_POWERPC64 \ || TARGET_MINIMAL_TOC \ - || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ && ! TARGET_NO_FP_IN_TOC))))) +#define TARGET_ASM_OUTPUT_ANCHOR rs6000_xcoff_asm_output_anchor #define TARGET_ASM_GLOBALIZE_LABEL rs6000_xcoff_asm_globalize_label +#define TARGET_ASM_INIT_SECTIONS rs6000_xcoff_asm_init_sections +#define TARGET_ASM_RELOC_RW_MASK rs6000_xcoff_reloc_rw_mask #define TARGET_ASM_NAMED_SECTION rs6000_xcoff_asm_named_section #define TARGET_ASM_SELECT_SECTION rs6000_xcoff_select_section #define TARGET_ASM_SELECT_RTX_SECTION rs6000_xcoff_select_rtx_section #define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section +#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section #define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding #define TARGET_SECTION_TYPE_FLAGS rs6000_xcoff_section_type_flags @@ -212,9 +134,8 @@ toc_section (void) \ On the RS/6000, we need to place an extra '.' in the function name and output the function descriptor. - The csect for the function will have already been created by the - `text_section' call previously done. We do have to go back to that - csect, however. + The csect for the function will have already been created when + text_section was selected. We do have to go back to that csect, however. The third and fourth parameters to the .function pseudo-op (16 and 044) are placeholders which no longer have any use. */ @@ -243,8 +164,8 @@ toc_section (void) \ fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fputs (", TOC[tc0], 0\n", FILE); \ - in_section = no_section; \ - function_section(DECL); \ + in_section = NULL; \ + switch_to_section (function_section (DECL)); \ putc ('.', FILE); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fputs (":\n", FILE); \ @@ -361,10 +282,6 @@ toc_section (void) \ Align entire section to BIGGEST_ALIGNMENT. */ #define DATA_SECTION_ASM_OP "\t.csect .data[RW],3" -/* Define the name of the section to use for the EH language specific - data areas (.gcc_except_table on most other systems). */ -#define TARGET_ASM_EXCEPTION_SECTION data_section - /* Define to prevent DWARF2 unwind info in the data section rather than in the .eh_frame section. We do this because the AIX linker would otherwise garbage collect these sections. */ diff --git a/contrib/gcc/config/rtems.h b/contrib/gcc/config/rtems.h index 80636436124..546c1da7565 100644 --- a/contrib/gcc/config/rtems.h +++ b/contrib/gcc/config/rtems.h @@ -15,17 +15,12 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* The system headers under RTEMS are C++-aware. */ #define NO_IMPLICIT_EXTERN_C -/* Generate calls to memcpy, memcmp and memset. */ -#ifndef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS -#endif - /* * Dummy start/end specification to let linker work as * needed by autoconf scripts using this compiler. @@ -39,8 +34,7 @@ Boston, MA 02111-1307, USA. */ /* * Some targets do not set up LIB_SPECS, override it, here. */ -#define STD_LIB_SPEC \ - "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}" +#define STD_LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}" #undef LIB_SPEC #define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \ @@ -48,4 +42,3 @@ Boston, MA 02111-1307, USA. */ %{!qrtems_debug: -lrtemsbsp -lrtemscpu} \ %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \ -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}" - diff --git a/contrib/gcc/config/s390/2064.md b/contrib/gcc/config/s390/2064.md index 143cd1b9ca2..2f958a5253f 100644 --- a/contrib/gcc/config/s390/2064.md +++ b/contrib/gcc/config/s390/2064.md @@ -1,5 +1,5 @@ ;; Scheduling description for z900 (cpu 2064). -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). @@ -17,8 +17,8 @@ ;; 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. ;; ;; References: @@ -40,62 +40,67 @@ ;; | ;; wr +;; This scheduler description is also used for the g5 and g6. + (define_automaton "z_ipu") (define_cpu_unit "z_e1" "z_ipu") (define_cpu_unit "z_wr" "z_ipu") (define_insn_reservation "z_la" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "la")) "z_e1,z_wr") (define_insn_reservation "z_larl" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "larl")) "z_e1,z_wr") (define_insn_reservation "z_load" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "load")) "z_e1,z_wr") (define_insn_reservation "z_store" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "store")) "z_e1,z_wr") +(define_insn_reservation "z_sem" 2 + (and (eq_attr "cpu" "z900,g5,g6") + (eq_attr "type" "sem")) + "z_e1*2,z_wr") + (define_insn_reservation "z_call" 5 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "jsr")) "z_e1*5,z_wr") -(define_insn_reservation "z_o2" 2 - (and (eq_attr "cpu" "z900") - (eq_attr "type" "o2")) - "z_e1*2,z_wr") +(define_insn_reservation "z_mul" 5 + (and (eq_attr "cpu" "g5,g6,z900") + (eq_attr "type" "imulsi,imulhi")) + "z_e1*5,z_wr") -(define_insn_reservation "z_o3" 3 - (and (eq_attr "cpu" "z900") - (eq_attr "type" "o3")) - "z_e1*3,z_wr") +(define_insn_reservation "z_inf" 10 + (and (eq_attr "cpu" "g5,g6,z900") + (eq_attr "type" "idiv,imuldi")) + "z_e1*10,z_wr") -; -; Insn still not mentioned are check for -; the usage of the agen unit -; +;; For everything else we check the atype flag. (define_insn_reservation "z_int" 1 - (and (eq_attr "cpu" "z900") - (eq_attr "atype" "reg")) + (and (eq_attr "cpu" "z900,g5,g6") + (and (not (eq_attr "type" "la,larl,load,store,jsr")) + (eq_attr "atype" "reg"))) "z_e1,z_wr") (define_insn_reservation "z_agen" 1 - (and (eq_attr "cpu" "z900") - (eq_attr "atype" "agen")) + (and (eq_attr "cpu" "z900,g5,g6") + (and (not (eq_attr "type" "la,larl,load,store,jsr")) + (eq_attr "atype" "agen"))) "z_e1,z_wr") - ;; ;; s390_agen_dep_p returns 1, if a register is set in the ;; first insn and used in the dependent insn to form a address. diff --git a/contrib/gcc/config/s390/2084.md b/contrib/gcc/config/s390/2084.md index a74ffbfdd46..3a4479a2937 100644 --- a/contrib/gcc/config/s390/2084.md +++ b/contrib/gcc/config/s390/2084.md @@ -1,5 +1,5 @@ ;; Scheduling description for z990 (cpu 2084). -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). @@ -17,8 +17,8 @@ ;; 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. (define_automaton "x_ipu") @@ -61,151 +61,199 @@ ;; Simple insns ;; +(define_insn_reservation "x_int" 1 + (and (eq_attr "cpu" "z990,z9_109") + (and (eq_attr "type" "integer") + (eq_attr "atype" "reg"))) + "x-e1-st,x-wr-st") + +(define_insn_reservation "x_agen" 1 + (and (eq_attr "cpu" "z990,z9_109") + (and (eq_attr "type" "integer") + (eq_attr "atype" "agen"))) + "x-e1-st,x-wr-st") + (define_insn_reservation "x_lr" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "lr")) "x-e1-st,x-wr-st") (define_insn_reservation "x_la" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "la")) "x-e1-st,x-wr-st") (define_insn_reservation "x_larl" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "larl")) "x-e1-st,x-wr-st") (define_insn_reservation "x_load" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "load")) "x-e1-st+x-mem,x-wr-st") (define_insn_reservation "x_store" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "store")) "x-e1-st+x_store_tok,x-wr-st") (define_insn_reservation "x_branch" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "branch")) "x_e1_r,x_wr_r") (define_insn_reservation "x_call" 5 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "jsr")) - "x-e1-np*5,x-wr-np") + "x-e1-np*5,x-wr-np") + +(define_insn_reservation "x_mul_hi" 2 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "imulhi")) + "x-e1-np*2,x-wr-np") + +(define_insn_reservation "x_mul_sidi" 4 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "imulsi,imuldi")) + "x-e1-np*4,x-wr-np") + +(define_insn_reservation "x_div" 10 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "idiv")) + "x-e1-np*10,x-wr-np") + +(define_insn_reservation "x_sem" 17 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "sem")) + "x-e1-np+x-mem,x-e1-np*16,x-wr-st") ;; ;; Multicycle insns ;; -(define_insn_reservation "x_ss" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "op_type" "SS")) +(define_insn_reservation "x_cs" 1 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "cs")) "x-e1-np,x-wr-np") +(define_insn_reservation "x_vs" 1 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "vs")) + "x-e1-np*10,x-wr-np") + (define_insn_reservation "x_stm" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "stm")) "(x-e1-np+x_store_tok)*10,x-wr-np") (define_insn_reservation "x_lm" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "lm")) "x-e1-np*10,x-wr-np") -(define_insn_reservation "x_nn" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "op_type" "NN")) +(define_insn_reservation "x_other" 1 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "other")) "x-e1-np,x-wr-np") -(define_insn_reservation "x_o2" 2 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "o2")) - "x-e1-np*2,x-wr-np") - -(define_insn_reservation "x_o3" 3 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "o3")) - "x-e1-np*3,x-wr-np") - ;; ;; Floating point insns ;; -(define_insn_reservation "x_fsimpd" 6 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fsimpd,fmuld")) +(define_insn_reservation "x_fsimptf" 7 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fsimptf")) + "x_e1_t*2,x-wr-fp") + +(define_insn_reservation "x_fsimpdf" 6 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fsimpdf,fmuldf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fsimps" 6 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fsimps,fmuls")) +(define_insn_reservation "x_fsimpsf" 6 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fsimpsf,fmulsf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fdivd" 36 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fdivd")) + +(define_insn_reservation "x_fmultf" 33 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fmultf")) + "x_e1_t*27,x-wr-fp") + + +(define_insn_reservation "x_fdivtf" 82 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fdivtf,fsqrttf")) + "x_e1_t*76,x-wr-fp") + +(define_insn_reservation "x_fdivdf" 36 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fdivdf,fsqrtdf")) "x_e1_t*30,x-wr-fp") -(define_insn_reservation "x_fdivs" 36 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fdivs")) +(define_insn_reservation "x_fdivsf" 36 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fdivsf,fsqrtsf")) "x_e1_t*30,x-wr-fp") -(define_insn_reservation "x_floadd" 6 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "floadd")) + +(define_insn_reservation "x_floadtf" 6 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "floadtf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_floads" 6 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "floads")) +(define_insn_reservation "x_floaddf" 6 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "floaddf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fstored" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fstored")) +(define_insn_reservation "x_floadsf" 6 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "floadsf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fstores" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "type" "fstores")) + +(define_insn_reservation "x_fstoredf" 1 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fstoredf")) "x_e1_t,x-wr-fp") +(define_insn_reservation "x_fstoresf" 1 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "fstoresf")) + "x_e1_t,x-wr-fp") + + +(define_insn_reservation "x_ftrunctf" 16 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "ftrunctf")) + "x_e1_t*10,x-wr-fp") + +(define_insn_reservation "x_ftruncdf" 11 + (and (eq_attr "cpu" "z990,z9_109") + (eq_attr "type" "ftruncdf")) + "x_e1_t*5,x-wr-fp") + + (define_insn_reservation "x_ftoi" 1 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "ftoi")) "x_e1_t*3,x-wr-fp") (define_insn_reservation "x_itof" 7 - (and (eq_attr "cpu" "z990") + (and (eq_attr "cpu" "z990,z9_109") (eq_attr "type" "itof")) "x_e1_t*3,x-wr-fp") -(define_bypass 1 "x_fsimpd" "x_fstored") +(define_bypass 1 "x_fsimpdf" "x_fstoredf") -(define_bypass 1 "x_fsimps" "x_fstores") +(define_bypass 1 "x_fsimpsf" "x_fstoresf") -(define_bypass 1 "x_floadd" "x_fsimpd,x_fstored,x_floadd") +(define_bypass 1 "x_floaddf" "x_fsimpdf,x_fstoredf,x_floaddf") -(define_bypass 1 "x_floads" "x_fsimps,x_fstores,x_floads") - -;; -;; Insns still not mentioned are checked for -;; the usage of the agen unit -;; - -(define_insn_reservation "x_int" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "atype" "reg")) - "x-e1-st,x-wr-st") - -(define_insn_reservation "x_agen" 1 - (and (eq_attr "cpu" "z990") - (eq_attr "atype" "agen")) - "x-e1-st+x-mem,x-wr-st") +(define_bypass 1 "x_floadsf" "x_fsimpsf,x_fstoresf,x_floadsf") ;; ;; s390_agen_dep_p returns 1, if a register is set in the @@ -218,12 +266,12 @@ ;; (define_bypass 5 "x_int,x_agen,x_lr" - "x_agen,x_la,x_call,x_load,x_store,x_ss,x_stm,x_lm" + "x_agen,x_la,x_branch,x_call,x_load,x_store,x_cs,x_stm,x_lm,x_other" "s390_agen_dep_p") (define_bypass 9 "x_int,x_agen,x_lr" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floadtf, x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; ;; A load type instruction uses a bypass to feed the result back @@ -231,12 +279,12 @@ ;; (define_bypass 4 "x_load" - "x_agen,x_la,x_call,x_load,x_store,x_ss,x_stm,x_lm" + "x_agen,x_la,x_branch,x_call,x_load,x_store,x_cs,x_stm,x_lm,x_other" "s390_agen_dep_p") (define_bypass 5 "x_load" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floadtf, x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; @@ -245,12 +293,12 @@ ;; (define_bypass 3 "x_larl,x_la" - "x_agen,x_la,x_call,x_load,x_store,x_ss,x_stm,x_lm" + "x_agen,x_la,x_branch,x_call,x_load,x_store,x_cs,x_stm,x_lm,x_other" "s390_agen_dep_p") (define_bypass 5 "x_larl, x_la" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floadtf, x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; diff --git a/contrib/gcc/config/s390/constraints.md b/contrib/gcc/config/s390/constraints.md new file mode 100644 index 00000000000..cfc8aa51f3f --- /dev/null +++ b/contrib/gcc/config/s390/constraints.md @@ -0,0 +1,438 @@ +;; Constraints definitions belonging to the gcc backend for IBM S/390. +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; Written by Wolfgang Gellerich, using code and information found in +;; files s390.md, s390.h, and s390.c. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it under +;; the terms of the GNU General Public License as published by the Free +;; Software Foundation; either version 2, or (at your option) any later +;; version. +;; +;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +;; WARRANTY; without even the implied warranty of MERCHANTABILITY or +;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +;; for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301, USA. + + +;; +;; Special constraints for s/390 machine description: +;; +;; a -- Any address register from 1 to 15. +;; c -- Condition code register 33. +;; d -- Any register from 0 to 15. +;; f -- Floating point registers. +;; t -- Access registers 36 and 37. +;; G -- Const double zero operand +;; I -- An 8-bit constant (0..255). +;; J -- A 12-bit constant (0..4095). +;; K -- A 16-bit constant (-32768..32767). +;; L -- Value appropriate as displacement. +;; (0..4095) for short displacement +;; (-524288..524287) for long displacement +;; M -- Constant integer with a value of 0x7fffffff. +;; N -- Multiple letter constraint followed by 4 parameter letters. +;; 0..9,x: number of the part counting from most to least significant +;; H,Q: mode of the part +;; D,S,H: mode of the containing operand +;; 0,F: value of the other parts (F - all bits set) +;; +;; The constraint matches if the specified part of a constant +;; has a value different from its other parts. If the letter x +;; is specified instead of a part number, the constraint matches +;; if there is any single part with non-default value. +;; O -- Multiple letter constraint followed by 1 parameter. +;; s: Signed extended immediate value (-2G .. 2G-1). +;; p: Positive extended immediate value (0 .. 4G-1). +;; n: Negative extended immediate value (-4G .. -1). +;; These constraints do not accept any operand if the machine does +;; not provide the extended-immediate facility. +;; P -- Any integer constant that can be loaded without literal pool. +;; Q -- Memory reference without index register and with short displacement. +;; R -- Memory reference with index register and short displacement. +;; S -- Memory reference without index register but with long displacement. +;; T -- Memory reference with index register and long displacement. +;; A -- Multiple letter constraint followed by Q, R, S, or T: +;; Offsettable memory reference of type specified by second letter. +;; B -- Multiple letter constraint followed by Q, R, S, or T: +;; Memory reference of the type specified by second letter that +;; does *not* refer to a literal pool entry. +;; U -- Pointer with short displacement. +;; W -- Pointer with long displacement. +;; Y -- Shift count operand. +;; + + +;; +;; Register constraints. +;; + +(define_register_constraint "a" + "ADDR_REGS" + "Any address register from 1 to 15.") + + +(define_register_constraint "c" + "CC_REGS" + "Condition code register 33") + + +(define_register_constraint "d" + "GENERAL_REGS" + "Any register from 0 to 15") + + +(define_register_constraint "f" + "FP_REGS" + "Floating point registers") + + +(define_register_constraint "t" + "ACCESS_REGS" + "@internal + Access registers 36 and 37") + + +;; +;; General constraints for constants. +;; + +(define_constraint "G" + "@internal + Const double zero operand" + (and (match_code "const_double") + (match_test "s390_float_const_zero_p (op)"))) + + +(define_constraint "I" + "An 8-bit constant (0..255)" + (and (match_code "const_int") + (match_test "(unsigned int) ival <= 255"))) + + +(define_constraint "J" + "A 12-bit constant (0..4095)" + (and (match_code "const_int") + (match_test "(unsigned int) ival <= 4095"))) + + +(define_constraint "K" + "A 16-bit constant (-32768..32767)" + (and (match_code "const_int") + (match_test "ival >= -32768 && ival <= 32767"))) + + + +(define_constraint "L" + "Value appropriate as displacement. + (0..4095) for short displacement + (-524288..524287) for long displacement" + (and (match_code "const_int") + (match_test "TARGET_LONG_DISPLACEMENT ? + (ival >= -524288 && ival <= 524287) + : (ival >= 0 && ival <= 4095)"))) + + +(define_constraint "M" + "Constant integer with a value of 0x7fffffff" + (and (match_code "const_int") + (match_test "ival == 2147483647"))) + + +(define_constraint "P" + "@internal + Any integer constant that can be loaded without literal pool" + (and (match_code "const_int") + (match_test "legitimate_reload_constant_p (GEN_INT (ival))"))) + + +(define_address_constraint "Y" + "Shift count operand" + +;; Simply check for the basic form of a shift count. Reload will +;; take care of making sure we have a proper base register. + + (match_test "s390_decompose_shift_count (op, NULL, NULL)" )) + + +;; N -- Multiple letter constraint followed by 4 parameter letters. +;; 0..9,x: number of the part counting from most to least significant +;; H,Q: mode of the part +;; D,S,H: mode of the containing operand +;; 0,F: value of the other parts (F = all bits set) +;; +;; The constraint matches if the specified part of a constant +;; has a value different from its other parts. If the letter x +;; is specified instead of a part number, the constraint matches +;; if there is any single part with non-default value. +;; +;; The following patterns define only those constraints that are actually +;; used in s390.md. If you need an additional one, simply add it in the +;; obvious way. Function s390_N_constraint_str is ready to handle all +;; combinations. +;; + + +(define_constraint "NxQS0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQS0\", ival)"))) + + +(define_constraint "NxQD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQD0\", ival)"))) + + +(define_constraint "N3HD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"3HD0\", ival)"))) + + +(define_constraint "N2HD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"2HD0\", ival)"))) + + +(define_constraint "N1SD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1SD0\", ival)"))) + + +(define_constraint "N1HS0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1HS0\", ival)"))) + + +(define_constraint "N1HD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1HD0\", ival)"))) + + +(define_constraint "N0SD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0SD0\", ival)"))) + + +(define_constraint "N0HS0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0HS0\", ival)"))) + + +(define_constraint "N0HD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0HD0\", ival)"))) + + +(define_constraint "NxQDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQDF\", ival)"))) + + +(define_constraint "N1SDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1SDF\", ival)"))) + + +(define_constraint "N0SDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0SDF\", ival)"))) + + +(define_constraint "N3HDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"3HDF\", ival)"))) + + +(define_constraint "N2HDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"2HDF\", ival)"))) + + +(define_constraint "N1HDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1HDF\", ival)"))) + + +(define_constraint "N0HDF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0HDF\", ival)"))) + + +(define_constraint "N0HSF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"0HSF\", ival)"))) + + +(define_constraint "N1HSF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"1HSF\", ival)"))) + + +(define_constraint "NxQSF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQSF\", ival)"))) + + +(define_constraint "NxQHF" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQHF\", ival)"))) + + +(define_constraint "NxQH0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xQH0\", ival)"))) + + + + +;; +;; Double-letter constraints starting with O follow. +;; + + +(define_constraint "Os" + "@internal + Signed extended immediate value (-2G .. 2G-1). + This constraint will only match if the machine provides + the extended-immediate facility." + (and (match_code "const_int") + (match_test "s390_O_constraint_str ('s', ival)"))) + + +(define_constraint "Op" + "@internal + Positive extended immediate value (0 .. 4G-1). + This constraint will only match if the machine provides + the extended-immediate facility." + (and (match_code "const_int") + (match_test "s390_O_constraint_str ('p', ival)"))) + + +(define_constraint "On" + "@internal + Negative extended immediate value (-4G .. -1). + This constraint will only match if the machine provides + the extended-immediate facility." + (and (match_code "const_int") + (match_test "s390_O_constraint_str ('n', ival)"))) + + + + +;; +;; Memory constraints follow. +;; + +(define_memory_constraint "Q" + "Memory reference without index register and with short displacement" + (match_test "s390_mem_constraint (\"Q\", op)")) + + + +(define_memory_constraint "R" + "Memory reference with index register and short displacement" + (match_test "s390_mem_constraint (\"R\", op)")) + + +(define_memory_constraint "S" + "Memory reference without index register but with long displacement" + (match_test "s390_mem_constraint (\"S\", op)")) + + +(define_memory_constraint "T" + "Memory reference with index register and long displacement" + (match_test "s390_mem_constraint (\"T\", op)")) + + + +(define_memory_constraint "AQ" + "@internal + Offsettable memory reference without index register and with short displacement" + (match_test "s390_mem_constraint (\"AQ\", op)")) + + +(define_memory_constraint "AR" + "@internal + Offsettable memory reference with index register and short displacement" + (match_test "s390_mem_constraint (\"AR\", op)")) + + +(define_memory_constraint "AS" + "@internal + Offsettable memory reference without index register but with long displacement" + (match_test "s390_mem_constraint (\"AS\", op)")) + + +(define_memory_constraint "AT" + "@internal + Offsettable memory reference with index register and long displacement" + (match_test "s390_mem_constraint (\"AT\", op)")) + + + +(define_constraint "BQ" + "@internal + Memory reference without index register and with short + displacement that does *not* refer to a literal pool entry." + (match_test "s390_mem_constraint (\"BQ\", op)")) + + +(define_constraint "BR" + "@internal + Memory reference with index register and short displacement that + does *not* refer to a literal pool entry. " + (match_test "s390_mem_constraint (\"BR\", op)")) + + +(define_constraint "BS" + "@internal + Memory reference without index register but with long displacement + that does *not* refer to a literal pool entry. " + (match_test "s390_mem_constraint (\"BS\", op)")) + + +(define_constraint "BT" + "@internal + Memory reference with index register and long displacement that + does *not* refer to a literal pool entry. " + (match_test "s390_mem_constraint (\"BT\", op)")) + + + +(define_address_constraint "U" + "Pointer with short displacement" + (match_test "s390_mem_constraint (\"U\", op)")) + + + +(define_address_constraint "W" + "Pointer with long displacement" + (match_test "s390_mem_constraint (\"W\", op)")) diff --git a/contrib/gcc/config/s390/fixdfdi.h b/contrib/gcc/config/s390/fixdfdi.h index a5b9212e793..88c2197f4c8 100644 --- a/contrib/gcc/config/s390/fixdfdi.h +++ b/contrib/gcc/config/s390/fixdfdi.h @@ -17,8 +17,158 @@ for more details. 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. */ + +#ifdef L_fixunstfdi + +#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF) +#define EXPONENT_BIAS 16383 +#define MANTISSA_BITS 112 +#define PRECISION (MANTISSA_BITS + 1) +#define SIGNBIT 0x80000000 +#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT) +#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT) +#define MANTD_LOW_LL(fp) (fp.ll[1]) +#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK)) +#define HIGH_LL_FRAC_BITS 48 +#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS) +#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1) + +typedef int DItype_x __attribute__ ((mode (DI))); +typedef unsigned int UDItype_x __attribute__ ((mode (DI))); +typedef int SItype_x __attribute__ ((mode (SI))); +typedef unsigned int USItype_x __attribute__ ((mode (SI))); + +union double_long { + long double d; + struct { + SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */ + } l; + UDItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */ +}; + +UDItype_x __fixunstfdi (long double a1); + +/* convert double to unsigned int */ +UDItype_x +__fixunstfdi (long double a1) +{ + register union double_long dl1; + register int exp; + register UDItype_x l; + + dl1.d = a1; + + /* +/- 0, denormalized, negative */ + if (!EXPD (dl1) || SIGND(dl1)) + return 0; + + /* The exponent - considered the binary point at the right end of + the mantissa. */ + exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS; + + /* number < 1: If the mantissa would need to be right-shifted more bits than + its size (plus the implied one bit on the left) the result would be + zero. */ + if (exp <= -PRECISION) + return 0; + + /* NaN: All exponent bits set and a nonzero fraction. */ + if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1)) + return 0x0ULL; + + /* If the upper ll part of the mantissa isn't + zeroed out after shifting the number would be to large. */ + if (exp >= -HIGH_LL_FRAC_BITS) + return 0xFFFFFFFFFFFFFFFFULL; + + exp += HIGH_LL_FRAC_BITS + 1; + + l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1) + | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1)); + + return l >> -exp; +} +#define __fixunstfdi ___fixunstfdi +#endif +#undef L_fixunstfdi + +#ifdef L_fixtfdi +#define EXPD(fp) (((fp.l.i[0]) >> 16) & 0x7FFF) +#define EXPONENT_BIAS 16383 +#define MANTISSA_BITS 112 +#define PRECISION (MANTISSA_BITS + 1) +#define SIGNBIT 0x80000000 +#define SIGND(fp) ((fp.l.i[0]) & SIGNBIT) +#define MANTD_HIGH_LL(fp) ((fp.ll[0] & HIGH_LL_FRAC_MASK) | HIGH_LL_UNIT_BIT) +#define MANTD_LOW_LL(fp) (fp.ll[1]) +#define FRACD_ZERO_P(fp) (!fp.ll[1] && !(fp.ll[0] & HIGH_LL_FRAC_MASK)) +#define HIGH_LL_FRAC_BITS 48 +#define HIGH_LL_UNIT_BIT ((UDItype_x)1 << HIGH_LL_FRAC_BITS) +#define HIGH_LL_FRAC_MASK (HIGH_LL_UNIT_BIT - 1) + +typedef int DItype_x __attribute__ ((mode (DI))); +typedef unsigned int UDItype_x __attribute__ ((mode (DI))); +typedef int SItype_x __attribute__ ((mode (SI))); +typedef unsigned int USItype_x __attribute__ ((mode (SI))); + +union double_long { + long double d; + struct { + SItype_x i[4]; /* 32 bit parts: 0 upper ... 3 lowest */ + } l; + DItype_x ll[2]; /* 64 bit parts: 0 upper, 1 lower */ +}; + +DItype_x __fixtfdi (long double a1); + +/* convert double to unsigned int */ +DItype_x +__fixtfdi (long double a1) +{ + register union double_long dl1; + register int exp; + register UDItype_x l; + + dl1.d = a1; + + /* +/- 0, denormalized */ + if (!EXPD (dl1)) + return 0; + + /* The exponent - considered the binary point at the right end of + the mantissa. */ + exp = EXPD (dl1) - EXPONENT_BIAS - MANTISSA_BITS; + + /* number < 1: If the mantissa would need to be right-shifted more bits than + its size the result would be zero. */ + if (exp <= -PRECISION) + return 0; + + /* NaN: All exponent bits set and a nonzero fraction. */ + if ((EXPD(dl1) == 0x7fff) && !FRACD_ZERO_P (dl1)) + return 0x8000000000000000ULL; + + /* If the upper ll part of the mantissa isn't + zeroed out after shifting the number would be to large. */ + if (exp >= -HIGH_LL_FRAC_BITS) + { + l = (long long)1 << 63; /* long int min */ + return SIGND (dl1) ? l : l - 1; + } + + /* The extra bit is needed for the sign bit. */ + exp += HIGH_LL_FRAC_BITS + 1; + + l = MANTD_LOW_LL (dl1) >> (HIGH_LL_FRAC_BITS + 1) + | MANTD_HIGH_LL (dl1) << (64 - (HIGH_LL_FRAC_BITS + 1)); + + return SIGND (dl1) ? -(l >> -exp) : l >> -exp; +} +#define __fixtfdi ___fixtfdi +#endif +#undef L_fixtfdi #ifdef L_fixunsdfdi #define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF) @@ -55,7 +205,7 @@ __fixunsdfdi (double a1) dl1.d = a1; - /* +/- 0, denormalized, negativ */ + /* +/- 0, denormalized, negative */ if (!EXPD (dl1) || SIGND(dl1)) return 0; @@ -199,7 +349,7 @@ __fixunssfdi (float a1) fl1.f = a1; - /* +/- 0, denormalized, negativ */ + /* +/- 0, denormalized, negative */ if (!EXP (fl1) || SIGN(fl1)) return 0; @@ -305,4 +455,3 @@ __fixsfdi (float a1) #define __fixsfdi ___fixsfdi #endif #undef L_fixsfdi - diff --git a/contrib/gcc/config/s390/libgcc-glibc.ver b/contrib/gcc/config/s390/libgcc-glibc.ver index 1d9e2290413..e9413d0fff1 100644 --- a/contrib/gcc/config/s390/libgcc-glibc.ver +++ b/contrib/gcc/config/s390/libgcc-glibc.ver @@ -39,3 +39,36 @@ GLIBC_2.2 { } %endif +# With GCC 4.1.0 long double 128 bit support was introduced. The +# following symbols coming from libgcc are enabled when -mlong-double-128 +# is specified. These lines make the symbols to get a @@GCC_4.1.0 attached. + +%exclude { + __divtc3 + __multc3 + __powitf2 + __fixtfti + __fixunstfti + __floattitf + + __fixtfdi + __fixunstfdi + __floatditf +} + +GCC_4.1.0 { + __divtc3 + __multc3 + __powitf2 + +%ifdef __s390x__ + __fixtfti + __fixunstfti + __floattitf + +%else + __fixtfdi + __fixunstfdi + __floatditf +%endif +} diff --git a/contrib/gcc/config/s390/linux-unwind.h b/contrib/gcc/config/s390/linux-unwind.h new file mode 100644 index 00000000000..221a5d4bc0a --- /dev/null +++ b/contrib/gcc/config/s390/linux-unwind.h @@ -0,0 +1,134 @@ +/* DWARF2 EH unwinding support for S/390 Linux. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +#define MD_FALLBACK_FRAME_STATE_FOR s390_fallback_frame_state + +static _Unwind_Reason_Code +s390_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned char *pc = context->ra; + long new_cfa; + int i; + + typedef struct + { + unsigned long psw_mask; + unsigned long psw_addr; + unsigned long gprs[16]; + unsigned int acrs[16]; + unsigned int fpc; + unsigned int __pad; + double fprs[16]; + } __attribute__ ((__aligned__ (8))) sigregs_; + + sigregs_ *regs; + int *signo; + + /* svc $__NR_sigreturn or svc $__NR_rt_sigreturn */ + if (pc[0] != 0x0a || (pc[1] != 119 && pc[1] != 173)) + return _URC_END_OF_STACK; + + /* Legacy frames: + old signal mask (8 bytes) + pointer to sigregs (8 bytes) - points always to next location + sigregs + retcode + This frame layout was used on kernels < 2.6.9 for non-RT frames, + and on kernels < 2.4.13 for RT frames as well. Note that we need + to look at RA to detect this layout -- this means that if you use + sa_restorer to install a different signal restorer on a legacy + kernel, unwinding from signal frames will not work. */ + if (context->ra == context->cfa + 16 + sizeof (sigregs_)) + { + regs = (sigregs_ *)(context->cfa + 16); + signo = NULL; + } + + /* New-style RT frame: + retcode + alignment (8 bytes) + siginfo (128 bytes) + ucontext (contains sigregs) */ + else if (pc[1] == 173 /* __NR_rt_sigreturn */) + { + struct ucontext_ + { + unsigned long uc_flags; + struct ucontext_ *uc_link; + unsigned long uc_stack[3]; + sigregs_ uc_mcontext; + } *uc = context->cfa + 8 + 128; + + regs = &uc->uc_mcontext; + signo = context->cfa + sizeof(long); + } + + /* New-style non-RT frame: + old signal mask (8 bytes) + pointer to sigregs (followed by signal number) */ + else + { + regs = *(sigregs_ **)(context->cfa + 8); + signo = (int *)(regs + 1); + } + + new_cfa = regs->gprs[15] + 16*sizeof(long) + 32; + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 15; + fs->cfa_offset = + new_cfa - (long) context->cfa + 16*sizeof(long) + 32; + + for (i = 0; i < 16; i++) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = + (long)®s->gprs[i] - new_cfa; + } + for (i = 0; i < 16; i++) + { + fs->regs.reg[16+i].how = REG_SAVED_OFFSET; + fs->regs.reg[16+i].loc.offset = + (long)®s->fprs[i] - new_cfa; + } + + /* Load return addr from PSW into dummy register 32. */ + + fs->regs.reg[32].how = REG_SAVED_OFFSET; + fs->regs.reg[32].loc.offset = (long)®s->psw_addr - new_cfa; + fs->retaddr_column = 32; + /* SIGILL, SIGFPE and SIGTRAP are delivered with psw_addr + after the faulting instruction rather than before it. + Don't set FS->signal_frame in that case. */ + if (!signo || (*signo != 4 && *signo != 5 && *signo != 8)) + fs->signal_frame = 1; + + return _URC_NO_REASON; +} diff --git a/contrib/gcc/config/s390/linux.h b/contrib/gcc/config/s390/linux.h index 9a6db9d76c1..fd8ef0b9a47 100644 --- a/contrib/gcc/config/s390/linux.h +++ b/contrib/gcc/config/s390/linux.h @@ -1,5 +1,6 @@ /* Definitions for Linux for S/390. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -17,8 +18,8 @@ for more details. 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. */ #ifndef _LINUX_H #define _LINUX_H @@ -54,11 +55,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA do \ { \ LINUX_TARGET_OS_CPP_BUILTINS(); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) @@ -77,6 +73,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define MULTILIB_DEFAULTS { "m31" } #endif +#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1" + #undef LINK_SPEC #define LINK_SPEC \ "%{m31:-m elf_s390}%{m64:-m elf64_s390} \ @@ -86,88 +85,22 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA %{!static: \ %{rdynamic:-export-dynamic} \ %{!dynamic-linker: \ - %{m31:-dynamic-linker /lib/ld.so.1} \ - %{m64:-dynamic-linker /lib/ld64.so.1}}}}" + %{m31:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "} \ + %{m64:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" #define TARGET_ASM_FILE_END file_end_indicate_exec_stack -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ +#define MD_UNWIND_SUPPORT "config/s390/linux-unwind.h" -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned char *pc_ = (CONTEXT)->ra; \ - long new_cfa_; \ - int i_; \ - \ - typedef struct \ - { \ - unsigned long psw_mask; \ - unsigned long psw_addr; \ - unsigned long gprs[16]; \ - unsigned int acrs[16]; \ - unsigned int fpc; \ - unsigned int __pad; \ - double fprs[16]; \ - } __attribute__ ((__aligned__ (8))) sigregs_; \ - \ - sigregs_ *regs_; \ - \ - /* svc $__NR_sigreturn or svc $__NR_rt_sigreturn */ \ - if (pc_[0] != 0x0a || (pc_[1] != 119 && pc_[1] != 173)) \ - break; \ - \ - /* New-style RT frame: \ - retcode + alignment (8 bytes) \ - siginfo (128 bytes) \ - ucontext (contains sigregs) */ \ - if ((CONTEXT)->ra == (CONTEXT)->cfa) \ - { \ - struct ucontext_ \ - { \ - unsigned long uc_flags; \ - struct ucontext_ *uc_link; \ - unsigned long uc_stack[3]; \ - sigregs_ uc_mcontext; \ - } *uc_ = (CONTEXT)->cfa + 8 + 128; \ - \ - regs_ = &uc_->uc_mcontext; \ - } \ - \ - /* Old-style RT frame and all non-RT frames: \ - old signal mask (8 bytes) \ - pointer to sigregs */ \ - else \ - { \ - regs_ = *(sigregs_ **)((CONTEXT)->cfa + 8); \ - } \ - \ - new_cfa_ = regs_->gprs[15] + 16*sizeof(long) + 32; \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 15; \ - (FS)->cfa_offset = \ - new_cfa_ - (long) (CONTEXT)->cfa + 16*sizeof(long) + 32; \ - \ - for (i_ = 0; i_ < 16; i_++) \ - { \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset = \ - (long)®s_->gprs[i_] - new_cfa_; \ - } \ - for (i_ = 0; i_ < 16; i_++) \ - { \ - (FS)->regs.reg[16+i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[16+i_].loc.offset = \ - (long)®s_->fprs[i_] - new_cfa_; \ - } \ - \ - /* Load return addr from PSW into dummy register 32. */ \ - (FS)->regs.reg[32].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[32].loc.offset = (long)®s_->psw_addr - new_cfa_; \ - (FS)->retaddr_column = 32; \ - \ - goto SUCCESS; \ - } while (0) +#ifdef TARGET_LIBC_PROVIDES_SSP +/* s390 glibc provides __stack_chk_guard in 0x14(tp), + s390x glibc provides it at 0x28(tp). */ +#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) +#endif + +/* Define if long doubles should be mangled as 'g'. */ +#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING #endif diff --git a/contrib/gcc/config/s390/predicates.md b/contrib/gcc/config/s390/predicates.md new file mode 100644 index 00000000000..9f7ea360f6e --- /dev/null +++ b/contrib/gcc/config/s390/predicates.md @@ -0,0 +1,379 @@ +;; Predicate definitions for S/390 and zSeries. +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and +;; Ulrich Weigand (uweigand@de.ibm.com). +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; OP is the current operation. +;; MODE is the current operation mode. + +;; operands -------------------------------------------------------------- + +;; Return true if OP a (const_int 0) operand. + +(define_predicate "const0_operand" + (and (match_code "const_int, const_double") + (match_test "op == CONST0_RTX (mode)"))) + +;; Return true if OP is constant. + +(define_special_predicate "consttable_operand" + (and (match_code "symbol_ref, label_ref, const, const_int, const_double") + (match_test "CONSTANT_P (op)"))) + +;; Return true if OP is a valid S-type operand. + +(define_predicate "s_operand" + (and (match_code "subreg, mem") + (match_operand 0 "general_operand")) +{ + /* Just like memory_operand, allow (subreg (mem ...)) + after reload. */ + if (reload_completed + && GET_CODE (op) == SUBREG + && GET_CODE (SUBREG_REG (op)) == MEM) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM) + return false; + if (!s390_legitimate_address_without_index_p (op)) + return false; + + return true; +}) + +;; Return true if OP is a valid operand for the BRAS instruction. +;; Allow SYMBOL_REFs and @PLT stubs. + +(define_special_predicate "bras_sym_operand" + (ior (and (match_code "symbol_ref") + (match_test "!flag_pic || SYMBOL_REF_LOCAL_P (op)")) + (and (match_code "const") + (and (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC") + (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_PLT"))))) + +;; Return true if OP is a PLUS that is not a legitimate +;; operand for the LA instruction. + +(define_predicate "s390_plus_operand" + (and (match_code "plus") + (and (match_test "mode == Pmode") + (match_test "!legitimate_la_operand_p (op)")))) + +;; Return true if OP is a valid operand as shift count or setmem. + +(define_predicate "shift_count_or_setmem_operand" + (match_code "reg, subreg, plus, const_int") +{ + HOST_WIDE_INT offset; + rtx base; + + /* Extract base register and offset. */ + if (!s390_decompose_shift_count (op, &base, &offset)) + return false; + + /* Don't allow any non-base hard registers. Doing so without + confusing reload and/or regrename would be tricky, and doesn't + buy us much anyway. */ + if (base && REGNO (base) < FIRST_PSEUDO_REGISTER && !ADDR_REG_P (base)) + return false; + + /* Unfortunately we have to reject constants that are invalid + for an address, or else reload will get confused. */ + if (!DISP_IN_RANGE (offset)) + return false; + + return true; +}) + +;; Return true if OP a valid operand for the LARL instruction. + +(define_predicate "larl_operand" + (match_code "label_ref, symbol_ref, const, const_int, const_double") +{ + /* Allow labels and local symbols. */ + if (GET_CODE (op) == LABEL_REF) + return true; + if (GET_CODE (op) == SYMBOL_REF) + return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 + && SYMBOL_REF_TLS_MODEL (op) == 0 + && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); + + /* Everything else must have a CONST, so strip it. */ + if (GET_CODE (op) != CONST) + return false; + op = XEXP (op, 0); + + /* Allow adding *even* in-range constants. */ + if (GET_CODE (op) == PLUS) + { + if (GET_CODE (XEXP (op, 1)) != CONST_INT + || (INTVAL (XEXP (op, 1)) & 1) != 0) + return false; + if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 31 + || INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 31)) + return false; + op = XEXP (op, 0); + } + + /* Labels and local symbols allowed here as well. */ + if (GET_CODE (op) == LABEL_REF) + return true; + if (GET_CODE (op) == SYMBOL_REF) + return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 + && SYMBOL_REF_TLS_MODEL (op) == 0 + && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); + + /* Now we must have a @GOTENT offset or @PLT stub + or an @INDNTPOFF TLS offset. */ + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_GOTENT) + return true; + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_PLT) + return true; + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_INDNTPOFF) + return true; + + return false; +}) + +;; operators -------------------------------------------------------------- + +;; Return nonzero if OP is a valid comparison operator +;; for a branch condition. + +(define_predicate "s390_comparison" + (match_code "eq, ne, lt, gt, le, ge, ltu, gtu, leu, geu, + uneq, unlt, ungt, unle, unge, ltgt, + unordered, ordered") +{ + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + return (s390_branch_condition_mask (op) >= 0); +}) + +;; Return nonzero if OP is a valid comparison operator +;; for an ALC condition. + +(define_predicate "s390_alc_comparison" + (match_code "zero_extend, sign_extend, ltu, gtu, leu, geu") +{ + while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) + op = XEXP (op, 0); + + if (!COMPARISON_P (op)) + return false; + + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + switch (GET_MODE (XEXP (op, 0))) + { + case CCL1mode: + return GET_CODE (op) == LTU; + + case CCL2mode: + return GET_CODE (op) == LEU; + + case CCL3mode: + return GET_CODE (op) == GEU; + + case CCUmode: + return GET_CODE (op) == GTU; + + case CCURmode: + return GET_CODE (op) == LTU; + + case CCSmode: + return GET_CODE (op) == UNGT; + + case CCSRmode: + return GET_CODE (op) == UNLT; + + default: + return false; + } +}) + +;; Return nonzero if OP is a valid comparison operator +;; for an SLB condition. + +(define_predicate "s390_slb_comparison" + (match_code "zero_extend, sign_extend, ltu, gtu, leu, geu") +{ + while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) + op = XEXP (op, 0); + + if (!COMPARISON_P (op)) + return false; + + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + switch (GET_MODE (XEXP (op, 0))) + { + case CCL1mode: + return GET_CODE (op) == GEU; + + case CCL2mode: + return GET_CODE (op) == GTU; + + case CCL3mode: + return GET_CODE (op) == LTU; + + case CCUmode: + return GET_CODE (op) == LEU; + + case CCURmode: + return GET_CODE (op) == GEU; + + case CCSmode: + return GET_CODE (op) == LE; + + case CCSRmode: + return GET_CODE (op) == GE; + + default: + return false; + } +}) + +;; Return true if OP is a load multiple operation. It is known to be a +;; PARALLEL and the first section will be tested. + +(define_special_predicate "load_multiple_operation" + (match_code "parallel") +{ + enum machine_mode elt_mode; + int count = XVECLEN (op, 0); + unsigned int dest_regno; + rtx src_addr; + int i, off; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) + return false; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); + elt_mode = GET_MODE (SET_DEST (XVECEXP (op, 0, 0))); + + /* Check, is base, or base + displacement. */ + + if (GET_CODE (src_addr) == REG) + off = 0; + else if (GET_CODE (src_addr) == PLUS + && GET_CODE (XEXP (src_addr, 0)) == REG + && GET_CODE (XEXP (src_addr, 1)) == CONST_INT) + { + off = INTVAL (XEXP (src_addr, 1)); + src_addr = XEXP (src_addr, 0); + } + else + return false; + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != elt_mode + || REGNO (SET_DEST (elt)) != dest_regno + i + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != elt_mode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) + != off + i * GET_MODE_SIZE (elt_mode)) + return false; + } + + return true; +}) + +;; Return true if OP is a store multiple operation. It is known to be a +;; PARALLEL and the first section will be tested. + +(define_special_predicate "store_multiple_operation" + (match_code "parallel") +{ + enum machine_mode elt_mode; + int count = XVECLEN (op, 0); + unsigned int src_regno; + rtx dest_addr; + int i, off; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) + return false; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); + elt_mode = GET_MODE (SET_SRC (XVECEXP (op, 0, 0))); + + /* Check, is base, or base + displacement. */ + + if (GET_CODE (dest_addr) == REG) + off = 0; + else if (GET_CODE (dest_addr) == PLUS + && GET_CODE (XEXP (dest_addr, 0)) == REG + && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT) + { + off = INTVAL (XEXP (dest_addr, 1)); + dest_addr = XEXP (dest_addr, 0); + } + else + return false; + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != elt_mode + || REGNO (SET_SRC (elt)) != src_regno + i + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != elt_mode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) + != off + i * GET_MODE_SIZE (elt_mode)) + return false; + } + return true; +}) diff --git a/contrib/gcc/config/s390/s390-modes.def b/contrib/gcc/config/s390/s390-modes.def index 08759558871..afcfb1b69e6 100644 --- a/contrib/gcc/config/s390/s390-modes.def +++ b/contrib/gcc/config/s390/s390-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM S/390 - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -17,21 +17,154 @@ for more details. 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. */ /* 256-bit integer mode is needed for STACK_SAVEAREA_MODE. */ INT_MODE (OI, 32); +/* Define TFmode to work around reload problem PR 20927. */ +FLOAT_MODE (TF, 16, ieee_quad_format); + /* Add any extra modes needed to represent the condition code. */ +/* + +Condition Codes + +Check for zero + +CCZ: EQ NE NE NE +CCZ1: EQ NE (CS) + +Unsigned compares + +CCU: EQ LTU GTU NE (CLG/R, CL/R/Y, CLM/Y, CLI/Y) +CCUR: EQ GTU LTU NE (CLGF/R) + +Signed compares + +CCS: EQ LT GT UNORDERED (LTGFR, LTGR, LTR, ICM/Y, + LTDBR, LTDR, LTEBR, LTER, + CG/R, C/R/Y, CGHI, CHI, + CDB/R, CD/R, CEB/R, CE/R, + ADB/R, AEB/R, SDB/R, SEB/R, + SRAG, SRA, SRDA) +CCSR: EQ GT LT UNORDERED (CGF/R, CH/Y) + +Condition codes resulting from add with overflow + +CCA: EQ LT GT Overflow +CCAP: EQ LT GT LT (AGHI, AHI) +CCAN: EQ LT GT GT (AGHI, AHI) + +Condition codes of unsigned adds and subs + +CCL: EQ NE EQ NE (ALGF/R, ALG/R, AL/R/Y, + ALCG/R, ALC/R, + SLGF/R, SLG/R, SL/R/Y, + SLBG/R, SLB/R) +CCL1: GEU GEU LTU LTU (ALG/R, AL/R/Y) +CCL2: GTU GTU LEU LEU (SLG/R, SL/R/Y) +CCL3: EQ LTU EQ GTU (SLG/R, SL/R/Y) + +Test under mask checks + +CCT: EQ NE NE NE (ICM/Y, TML, CG/R, CGHI, + C/R/Y, CHI, NG/R, N/R/Y, + OG/R, O/R/Y, XG/R, X/R/Y) +CCT1: NE EQ NE NE (TMH, TML) +CCT2: NE NE EQ NE (TMH, TML) +CCT3: NE NE NE EQ (TMH, TML) + +CCA and CCT modes are request only modes. These modes are never returned by +s390_select_cc_mode. They are only intended to match other modes. + +Requested mode -> Destination CC register mode + +CCS, CCU, CCT, CCSR, CCUR -> CCZ +CCA -> CCAP, CCAN + + +*** Comments *** + +CCAP, CCAN + +The CC obtained from add instruction usually can't be used for comparisons +because its coupling with overflow flag. In case of an overflow the +less than/greater than data are lost. Nevertheless a comparison can be done +whenever immediate values are involved because they are known at compile time. +If you know whether the used constant is positive or negative you can predict +the sign of the result even in case of an overflow. + + +CCT, CCT1, CCT2, CCT3 + +If bits of an integer masked with an AND instruction are checked, the test under +mask instructions turn out to be very handy for a set of special cases. +The simple cases are checks whether all masked bits are zero or ones: + + int a; + if ((a & (16 + 128)) == 0) -> CCT/CCZ + if ((a & (16 + 128)) == 16 + 128) -> CCT3 + +Using two extra modes makes it possible to do complete checks on two bits of an +integer (This is possible on register operands only. TM does not provide the +information necessary for CCT1 and CCT2 modes.): + + int a; + if ((a & (16 + 128)) == 16) -> CCT1 + if ((a & (16 + 128)) == 128) -> CCT2 + + +CCSR, CCUR + +There are several instructions comparing 32 bit with 64 bit unsigned/signed +values. Such instructions can be considered to have a builtin zero/sign_extend. +The problem is that in the RTL (to be canonical) the zero/sign extended operand +has to be the first one but the machine instructions like it the other way +around. The following both modes can be considered as CCS and CCU modes with +exchanged operands. + + +CCL1, CCL2 + +These modes represent the result of overflow checks. + +if (a + b < a) -> CCL1 state of the carry bit (CC2 | CC3) +if (a - b > a) -> CCL2 state of the borrow bit (CC0 | CC1) + +They are used when multi word numbers are computed dealing one SImode part after +another or whenever manual overflow checks like the examples above are +compiled. + + +CCL3 + +A logical subtract instruction sets the borrow bit in case of an overflow. +The resulting condition code of those instructions is represented by the +CCL3 mode. Together with the CCU mode this mode is used for jumpless +implementations of several if-constructs - see s390_expand_addcc for more +details. + +CCZ1 + +The compare and swap instructions sets the condition code to 0/1 if the +operands were equal/unequal. The CCZ1 mode ensures the result can be +effectively placed into a register. + +*/ + + CC_MODE (CCZ); +CC_MODE (CCZ1); CC_MODE (CCA); CC_MODE (CCAP); CC_MODE (CCAN); CC_MODE (CCL); CC_MODE (CCL1); CC_MODE (CCL2); +CC_MODE (CCL3); CC_MODE (CCU); CC_MODE (CCUR); CC_MODE (CCS); diff --git a/contrib/gcc/config/s390/s390-protos.h b/contrib/gcc/config/s390/s390-protos.h index 90815a87938..8b2db858bd9 100644 --- a/contrib/gcc/config/s390/s390-protos.h +++ b/contrib/gcc/config/s390/s390-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM S/390. - Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) This file is part of GCC. @@ -16,52 +16,64 @@ for more details. 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. */ + + + +/* Prototypes of functions used for constraint evaluation in + constraints.c. */ + +extern int s390_mem_constraint (const char *str, rtx op); +extern int s390_O_constraint_str (const char c, HOST_WIDE_INT value); +extern int s390_N_constraint_str (const char *str, HOST_WIDE_INT value); +extern int s390_float_const_zero_p (rtx value); + + /* Declare functions in s390.c. */ extern void optimization_options (int, int); extern void override_options (void); -extern HOST_WIDE_INT s390_arg_frame_offset (void); -extern void s390_load_got (int); +extern bool s390_can_eliminate (int, int); +extern HOST_WIDE_INT s390_initial_elimination_offset (int, int); extern void s390_emit_prologue (void); -extern void s390_emit_epilogue (void); +extern void s390_emit_epilogue (bool); extern void s390_function_profiler (FILE *, int); +extern void s390_conditional_register_usage (void); +extern void s390_set_has_landing_pad_p (bool); +extern bool s390_hard_regno_mode_ok (unsigned int, enum machine_mode); +extern bool s390_hard_regno_rename_ok (unsigned int, unsigned int); +extern bool s390_class_max_nregs (enum reg_class, enum machine_mode); #ifdef RTX_CODE extern int s390_extra_constraint_str (rtx, int, const char *); extern int s390_const_ok_for_constraint_p (HOST_WIDE_INT, int, const char *); -extern int const0_operand (rtx, enum machine_mode); -extern int consttable_operand (rtx, enum machine_mode); -extern int larl_operand (rtx, enum machine_mode); -extern int s_operand (rtx, enum machine_mode); -extern int s_imm_operand (rtx, enum machine_mode); -extern int shift_count_operand (rtx, enum machine_mode); -extern int bras_sym_operand (rtx, enum machine_mode); -extern int load_multiple_operation (rtx, enum machine_mode); -extern int store_multiple_operation (rtx, enum machine_mode); +extern int s390_const_double_ok_for_constraint_p (rtx, int, const char *); extern int s390_single_part (rtx, enum machine_mode, enum machine_mode, int); extern unsigned HOST_WIDE_INT s390_extract_part (rtx, enum machine_mode, int); extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int); +extern bool s390_overlap_p (rtx, rtx, HOST_WIDE_INT); +extern bool s390_offset_p (rtx, rtx, rtx); extern int tls_symbolic_operand (rtx); -extern int s390_match_ccmode (rtx, enum machine_mode); -extern enum machine_mode s390_tm_ccmode (rtx, rtx, int); +extern bool s390_match_ccmode (rtx, enum machine_mode); +extern enum machine_mode s390_tm_ccmode (rtx, rtx, bool); extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx); -extern int s390_alc_comparison (rtx op, enum machine_mode mode); -extern int s390_slb_comparison (rtx op, enum machine_mode mode); -extern int symbolic_reference_mentioned_p (rtx); -extern int tls_symbolic_reference_mentioned_p (rtx); -extern rtx s390_tls_get_offset (void); -extern int legitimate_la_operand_p (rtx); -extern int preferred_la_operand_p (rtx); +extern void s390_canonicalize_comparison (enum rtx_code *, rtx *, rtx *); +extern rtx s390_emit_compare (enum rtx_code, rtx, rtx); +extern void s390_emit_jump (rtx, rtx); +extern bool symbolic_reference_mentioned_p (rtx); +extern bool tls_symbolic_reference_mentioned_p (rtx); +extern bool legitimate_la_operand_p (rtx); +extern bool preferred_la_operand_p (rtx, rtx); extern int legitimate_pic_operand_p (rtx); extern int legitimate_constant_p (rtx); -extern int legitimate_reload_constant_p (rtx); -extern int legitimate_address_p (enum machine_mode, rtx, int); +extern bool legitimate_reload_constant_p (rtx); +extern bool legitimate_address_p (enum machine_mode, rtx, int); extern rtx legitimize_pic_address (rtx, rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); +extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int); extern enum reg_class s390_preferred_reload_class (rtx, enum reg_class); extern enum reg_class s390_secondary_input_reload_class (enum reg_class, enum machine_mode, @@ -69,37 +81,49 @@ extern enum reg_class s390_secondary_input_reload_class (enum reg_class, extern enum reg_class s390_secondary_output_reload_class (enum reg_class, enum machine_mode, rtx); -extern int s390_plus_operand (rtx, enum machine_mode); extern void s390_expand_plus_operand (rtx, rtx, rtx); extern void emit_symbolic_move (rtx *); extern void s390_load_address (rtx, rtx); -extern void s390_expand_movstr (rtx, rtx, rtx); -extern void s390_expand_clrstr (rtx, rtx); +extern void s390_expand_movmem (rtx, rtx, rtx); +extern void s390_expand_setmem (rtx, rtx, rtx); extern void s390_expand_cmpmem (rtx, rtx, rtx, rtx); +extern bool s390_expand_addcc (enum rtx_code, rtx, rtx, rtx, rtx, rtx); +extern bool s390_expand_insv (rtx, rtx, rtx, rtx); +extern void s390_expand_cs_hqi (enum machine_mode, rtx, rtx, rtx, rtx); +extern void s390_expand_atomic (enum machine_mode, enum rtx_code, + rtx, rtx, rtx, bool); extern rtx s390_return_addr_rtx (int, rtx); +extern rtx s390_back_chain_rtx (void); +extern rtx s390_emit_call (rtx, rtx, rtx, rtx); +extern void s390_expand_logical_operator (enum rtx_code, + enum machine_mode, rtx *); +extern bool s390_logical_operator_ok_p (rtx *); +extern void s390_narrow_logical_operator (enum rtx_code, rtx *, rtx *); +extern void s390_split_access_reg (rtx, rtx *, rtx *); -extern void s390_output_symbolic_const (FILE *, rtx); +extern bool s390_output_addr_const_extra (FILE*, rtx); extern void print_operand_address (FILE *, rtx); extern void print_operand (FILE *, rtx, int); -extern void s390_output_constant_pool (rtx, rtx); -extern void s390_output_pool_entry (FILE *, rtx, enum machine_mode, - unsigned int); +extern void s390_output_pool_entry (rtx, enum machine_mode, unsigned int); extern void s390_trampoline_template (FILE *); extern void s390_initialize_trampoline (rtx, rtx, rtx); extern rtx s390_gen_rtx_const_DI (int, int); -extern void s390_output_dwarf_dtprel (FILE*, int, rtx); extern int s390_agen_dep_p (rtx, rtx); +extern rtx s390_load_got (void); +extern rtx s390_get_thread_pointer (void); +extern void s390_emit_tpf_eh_return (rtx); +extern bool s390_legitimate_address_without_index_p (rtx); +extern bool s390_decompose_shift_count (rtx, rtx *, HOST_WIDE_INT *); +extern int s390_branch_condition_mask (rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern int s390_function_arg_pass_by_reference (enum machine_mode, tree); extern void s390_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); #ifdef RTX_CODE extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern rtx s390_function_value (tree, enum machine_mode); extern void s390_va_start (tree, rtx); -extern rtx s390_va_arg (tree, tree); #endif /* RTX_CODE */ #endif /* TREE_CODE */ diff --git a/contrib/gcc/config/s390/s390.c b/contrib/gcc/config/s390/s390.c index ced0bf9010a..86b4b7eeac3 100644 --- a/contrib/gcc/config/s390/s390.c +++ b/contrib/gcc/config/s390/s390.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on IBM S/390 and zSeries - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -18,8 +18,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -50,116 +50,166 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "debug.h" #include "langhooks.h" #include "optabs.h" - -/* Machine-specific symbol_ref flags. */ -#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0) +#include "tree-gimple.h" -static bool s390_assemble_integer (rtx, unsigned int, int); -static void s390_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT); -static void s390_encode_section_info (tree, rtx, int); -static bool s390_cannot_force_const_mem (rtx); -static rtx s390_delegitimize_address (rtx); -static bool s390_return_in_memory (tree, tree); -static void s390_init_builtins (void); -static rtx s390_expand_builtin (tree, rtx, rtx, enum machine_mode, int); -static void s390_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, - HOST_WIDE_INT, tree); -static enum attr_type s390_safe_attr_type (rtx); +/* Define the specific costs for a given cpu. */ -static int s390_adjust_cost (rtx, rtx, rtx, int); -static int s390_adjust_priority (rtx, int); -static int s390_issue_rate (void); -static int s390_use_dfa_pipeline_interface (void); -static int s390_first_cycle_multipass_dfa_lookahead (void); -static int s390_sched_reorder2 (FILE *, int, rtx *, int *, int); -static bool s390_rtx_costs (rtx, int, int, int *); -static int s390_address_cost (rtx); -static void s390_reorg (void); -static bool s390_valid_pointer_mode (enum machine_mode); -static tree s390_build_builtin_va_list (void); +struct processor_costs +{ + /* multiplication */ + const int m; /* cost of an M instruction. */ + const int mghi; /* cost of an MGHI instruction. */ + const int mh; /* cost of an MH instruction. */ + const int mhi; /* cost of an MHI instruction. */ + const int ml; /* cost of an ML instruction. */ + const int mr; /* cost of an MR instruction. */ + const int ms; /* cost of an MS instruction. */ + const int msg; /* cost of an MSG instruction. */ + const int msgf; /* cost of an MSGF instruction. */ + const int msgfr; /* cost of an MSGFR instruction. */ + const int msgr; /* cost of an MSGR instruction. */ + const int msr; /* cost of an MSR instruction. */ + const int mult_df; /* cost of multiplication in DFmode. */ + const int mxbr; + /* square root */ + const int sqxbr; /* cost of square root in TFmode. */ + const int sqdbr; /* cost of square root in DFmode. */ + const int sqebr; /* cost of square root in SFmode. */ + /* multiply and add */ + const int madbr; /* cost of multiply and add in DFmode. */ + const int maebr; /* cost of multiply and add in SFmode. */ + /* division */ + const int dxbr; + const int dxr; + const int ddbr; + const int ddr; + const int debr; + const int der; + const int dlgr; + const int dlr; + const int dr; + const int dsgfr; + const int dsgr; +}; -#undef TARGET_ASM_ALIGNED_HI_OP -#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t" -#undef TARGET_ASM_ALIGNED_DI_OP -#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t" -#undef TARGET_ASM_INTEGER -#define TARGET_ASM_INTEGER s390_assemble_integer +const struct processor_costs *s390_cost; -#undef TARGET_ASM_OPEN_PAREN -#define TARGET_ASM_OPEN_PAREN "" +static const +struct processor_costs z900_cost = +{ + COSTS_N_INSNS (5), /* M */ + COSTS_N_INSNS (10), /* MGHI */ + COSTS_N_INSNS (5), /* MH */ + COSTS_N_INSNS (4), /* MHI */ + COSTS_N_INSNS (5), /* ML */ + COSTS_N_INSNS (5), /* MR */ + COSTS_N_INSNS (4), /* MS */ + COSTS_N_INSNS (15), /* MSG */ + COSTS_N_INSNS (7), /* MSGF */ + COSTS_N_INSNS (7), /* MSGFR */ + COSTS_N_INSNS (10), /* MSGR */ + COSTS_N_INSNS (4), /* MSR */ + COSTS_N_INSNS (7), /* multiplication in DFmode */ + COSTS_N_INSNS (13), /* MXBR */ + COSTS_N_INSNS (136), /* SQXBR */ + COSTS_N_INSNS (44), /* SQDBR */ + COSTS_N_INSNS (35), /* SQEBR */ + COSTS_N_INSNS (18), /* MADBR */ + COSTS_N_INSNS (13), /* MAEBR */ + COSTS_N_INSNS (134), /* DXBR */ + COSTS_N_INSNS (135), /* DXR */ + COSTS_N_INSNS (30), /* DDBR */ + COSTS_N_INSNS (30), /* DDR */ + COSTS_N_INSNS (27), /* DEBR */ + COSTS_N_INSNS (26), /* DER */ + COSTS_N_INSNS (220), /* DLGR */ + COSTS_N_INSNS (34), /* DLR */ + COSTS_N_INSNS (34), /* DR */ + COSTS_N_INSNS (32), /* DSGFR */ + COSTS_N_INSNS (32), /* DSGR */ +}; -#undef TARGET_ASM_CLOSE_PAREN -#define TARGET_ASM_CLOSE_PAREN "" +static const +struct processor_costs z990_cost = +{ + COSTS_N_INSNS (4), /* M */ + COSTS_N_INSNS (2), /* MGHI */ + COSTS_N_INSNS (2), /* MH */ + COSTS_N_INSNS (2), /* MHI */ + COSTS_N_INSNS (4), /* ML */ + COSTS_N_INSNS (4), /* MR */ + COSTS_N_INSNS (5), /* MS */ + COSTS_N_INSNS (6), /* MSG */ + COSTS_N_INSNS (4), /* MSGF */ + COSTS_N_INSNS (4), /* MSGFR */ + COSTS_N_INSNS (4), /* MSGR */ + COSTS_N_INSNS (4), /* MSR */ + COSTS_N_INSNS (1), /* multiplication in DFmode */ + COSTS_N_INSNS (28), /* MXBR */ + COSTS_N_INSNS (130), /* SQXBR */ + COSTS_N_INSNS (66), /* SQDBR */ + COSTS_N_INSNS (38), /* SQEBR */ + COSTS_N_INSNS (1), /* MADBR */ + COSTS_N_INSNS (1), /* MAEBR */ + COSTS_N_INSNS (60), /* DXBR */ + COSTS_N_INSNS (72), /* DXR */ + COSTS_N_INSNS (40), /* DDBR */ + COSTS_N_INSNS (44), /* DDR */ + COSTS_N_INSNS (26), /* DDBR */ + COSTS_N_INSNS (28), /* DER */ + COSTS_N_INSNS (176), /* DLGR */ + COSTS_N_INSNS (31), /* DLR */ + COSTS_N_INSNS (31), /* DR */ + COSTS_N_INSNS (31), /* DSGFR */ + COSTS_N_INSNS (31), /* DSGR */ +}; -#undef TARGET_ASM_SELECT_RTX_SECTION -#define TARGET_ASM_SELECT_RTX_SECTION s390_select_rtx_section - -#undef TARGET_ENCODE_SECTION_INFO -#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info - -#ifdef HAVE_AS_TLS -#undef TARGET_HAVE_TLS -#define TARGET_HAVE_TLS true -#endif -#undef TARGET_CANNOT_FORCE_CONST_MEM -#define TARGET_CANNOT_FORCE_CONST_MEM s390_cannot_force_const_mem - -#undef TARGET_DELEGITIMIZE_ADDRESS -#define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address - -#undef TARGET_RETURN_IN_MEMORY -#define TARGET_RETURN_IN_MEMORY s390_return_in_memory - -#undef TARGET_INIT_BUILTINS -#define TARGET_INIT_BUILTINS s390_init_builtins -#undef TARGET_EXPAND_BUILTIN -#define TARGET_EXPAND_BUILTIN s390_expand_builtin - -#undef TARGET_ASM_OUTPUT_MI_THUNK -#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk -#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK -#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true - -#undef TARGET_SCHED_ADJUST_COST -#define TARGET_SCHED_ADJUST_COST s390_adjust_cost -#undef TARGET_SCHED_ADJUST_PRIORITY -#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority -#undef TARGET_SCHED_ISSUE_RATE -#define TARGET_SCHED_ISSUE_RATE s390_issue_rate -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE s390_use_dfa_pipeline_interface -#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD -#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead -#undef TARGET_SCHED_REORDER2 -#define TARGET_SCHED_REORDER2 s390_sched_reorder2 - -#undef TARGET_RTX_COSTS -#define TARGET_RTX_COSTS s390_rtx_costs -#undef TARGET_ADDRESS_COST -#define TARGET_ADDRESS_COST s390_address_cost - -#undef TARGET_MACHINE_DEPENDENT_REORG -#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg - -#undef TARGET_VALID_POINTER_MODE -#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode - -#undef TARGET_BUILD_BUILTIN_VA_LIST -#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list - -struct gcc_target targetm = TARGET_INITIALIZER; +static const +struct processor_costs z9_109_cost = +{ + COSTS_N_INSNS (4), /* M */ + COSTS_N_INSNS (2), /* MGHI */ + COSTS_N_INSNS (2), /* MH */ + COSTS_N_INSNS (2), /* MHI */ + COSTS_N_INSNS (4), /* ML */ + COSTS_N_INSNS (4), /* MR */ + COSTS_N_INSNS (5), /* MS */ + COSTS_N_INSNS (6), /* MSG */ + COSTS_N_INSNS (4), /* MSGF */ + COSTS_N_INSNS (4), /* MSGFR */ + COSTS_N_INSNS (4), /* MSGR */ + COSTS_N_INSNS (4), /* MSR */ + COSTS_N_INSNS (1), /* multiplication in DFmode */ + COSTS_N_INSNS (28), /* MXBR */ + COSTS_N_INSNS (130), /* SQXBR */ + COSTS_N_INSNS (66), /* SQDBR */ + COSTS_N_INSNS (38), /* SQEBR */ + COSTS_N_INSNS (1), /* MADBR */ + COSTS_N_INSNS (1), /* MAEBR */ + COSTS_N_INSNS (60), /* DXBR */ + COSTS_N_INSNS (72), /* DXR */ + COSTS_N_INSNS (40), /* DDBR */ + COSTS_N_INSNS (37), /* DDR */ + COSTS_N_INSNS (26), /* DDBR */ + COSTS_N_INSNS (28), /* DER */ + COSTS_N_INSNS (30), /* DLGR */ + COSTS_N_INSNS (23), /* DLR */ + COSTS_N_INSNS (23), /* DR */ + COSTS_N_INSNS (24), /* DSGFR */ + COSTS_N_INSNS (24), /* DSGR */ +}; extern int reload_completed; -/* The alias set for prologue/epilogue register save/restore. */ -static int s390_sr_alias_set = 0; - /* Save information from a "cmpxx" operation until the branch or scc is emitted. */ rtx s390_compare_op0, s390_compare_op1; +/* Save the result of a compare_and_swap until the branch or scc is + emitted. */ +rtx s390_compare_emitted = NULL_RTX; + /* Structure used to hold the components of a S/390 memory address. A legitimate address on S/390 is of the general form @@ -174,88 +224,179 @@ struct s390_address rtx base; rtx indx; rtx disp; - int pointer; + bool pointer; + bool literal_pool; }; /* Which cpu are we tuning for. */ -enum processor_type s390_tune; +enum processor_type s390_tune = PROCESSOR_max; enum processor_flags s390_tune_flags; /* Which instruction set architecture to use. */ enum processor_type s390_arch; enum processor_flags s390_arch_flags; -/* Strings to hold which cpu and instruction set architecture to use. */ -const char *s390_tune_string; /* for -mtune= */ -const char *s390_arch_string; /* for -march= */ +HOST_WIDE_INT s390_warn_framesize = 0; +HOST_WIDE_INT s390_stack_size = 0; +HOST_WIDE_INT s390_stack_guard = 0; -/* Define the structure for the machine field in struct function. */ +/* The following structure is embedded in the machine + specific part of struct function. */ -struct machine_function GTY(()) +struct s390_frame_layout GTY (()) { - /* Set, if some of the fprs 8-15 need to be saved (64 bit abi). */ - int save_fprs_p; + /* Offset within stack frame. */ + HOST_WIDE_INT gprs_offset; + HOST_WIDE_INT f0_offset; + HOST_WIDE_INT f4_offset; + HOST_WIDE_INT f8_offset; + HOST_WIDE_INT backchain_offset; - /* Set if return address needs to be saved. */ - bool save_return_addr_p; + /* Number of first and last gpr where slots in the register + save area are reserved for. */ + int first_save_gpr_slot; + int last_save_gpr_slot; /* Number of first and last gpr to be saved, restored. */ int first_save_gpr; int first_restore_gpr; int last_save_gpr; + int last_restore_gpr; + + /* Bits standing for floating point registers. Set, if the + respective register has to be saved. Starting with reg 16 (f0) + at the rightmost bit. + Bit 15 - 8 7 6 5 4 3 2 1 0 + fpr 15 - 8 7 5 3 1 6 4 2 0 + reg 31 - 24 23 22 21 20 19 18 17 16 */ + unsigned int fpr_bitmap; + + /* Number of floating point registers f8-f15 which must be saved. */ + int high_fprs; + + /* Set if return address needs to be saved. + This flag is set by s390_return_addr_rtx if it could not use + the initial value of r14 and therefore depends on r14 saved + to the stack. */ + bool save_return_addr_p; /* Size of stack frame. */ HOST_WIDE_INT frame_size; +}; + +/* Define the structure for the machine field in struct function. */ + +struct machine_function GTY(()) +{ + struct s390_frame_layout frame_layout; + + /* Literal pool base register. */ + rtx base_reg; + + /* True if we may need to perform branch splitting. */ + bool split_branches_pending_p; + + /* True during final stage of literal pool processing. */ + bool decomposed_literal_pool_addresses_ok_p; /* Some local-dynamic TLS symbol name. */ const char *some_ld_name; + + bool has_landing_pad_p; }; -static int s390_match_ccmode_set (rtx, enum machine_mode); -static int s390_branch_condition_mask (rtx); -static const char *s390_branch_condition_mnemonic (rtx, int); -static int check_mode (rtx, enum machine_mode *); -static int general_s_operand (rtx, enum machine_mode, int); -static int s390_short_displacement (rtx); -static int s390_decompose_address (rtx, struct s390_address *); -static rtx get_thread_pointer (void); -static rtx legitimize_tls_address (rtx, rtx); -static void print_shift_count_operand (FILE *, rtx); -static const char *get_some_local_dynamic_name (void); -static int get_some_local_dynamic_name_1 (rtx *, void *); -static int reg_used_in_mem_p (int, rtx); -static int addr_generation_dependency_p (rtx, rtx); -static int s390_split_branches (void); -static void find_constant_pool_ref (rtx, rtx *); -static void replace_constant_pool_ref (rtx *, rtx, rtx); -static rtx find_ltrel_base (rtx); -static void replace_ltrel_base (rtx *, rtx); -static void s390_optimize_prolog (bool); -static int find_unused_clobbered_reg (void); -static void s390_frame_info (void); -static rtx save_fpr (rtx, int, int); -static rtx restore_fpr (rtx, int, int); -static rtx save_gprs (rtx, int, int, int); -static rtx restore_gprs (rtx, int, int, int); -static int s390_function_arg_size (enum machine_mode, tree); -static bool s390_function_arg_float (enum machine_mode, tree); -static struct machine_function * s390_init_machine_status (void); +/* Few accessor macros for struct cfun->machine->s390_frame_layout. */ -/* Check whether integer displacement is in range. */ -#define DISP_IN_RANGE(d) \ - (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \ - : ((d) >= 0 && (d) <= 4095)) +#define cfun_frame_layout (cfun->machine->frame_layout) +#define cfun_save_high_fprs_p (!!cfun_frame_layout.high_fprs) +#define cfun_gprs_save_area_size ((cfun_frame_layout.last_save_gpr_slot - \ + cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_WORD) +#define cfun_set_fpr_bit(BITNUM) (cfun->machine->frame_layout.fpr_bitmap |= \ + (1 << (BITNUM))) +#define cfun_fpr_bit_p(BITNUM) (!!(cfun->machine->frame_layout.fpr_bitmap & \ + (1 << (BITNUM)))) + +/* Number of GPRs and FPRs used for argument passing. */ +#define GP_ARG_NUM_REG 5 +#define FP_ARG_NUM_REG (TARGET_64BIT? 4 : 2) + +/* A couple of shortcuts. */ +#define CONST_OK_FOR_J(x) \ + CONST_OK_FOR_CONSTRAINT_P((x), 'J', "J") +#define CONST_OK_FOR_K(x) \ + CONST_OK_FOR_CONSTRAINT_P((x), 'K', "K") +#define CONST_OK_FOR_Os(x) \ + CONST_OK_FOR_CONSTRAINT_P((x), 'O', "Os") +#define CONST_OK_FOR_Op(x) \ + CONST_OK_FOR_CONSTRAINT_P((x), 'O', "Op") +#define CONST_OK_FOR_On(x) \ + CONST_OK_FOR_CONSTRAINT_P((x), 'O', "On") + +#define REGNO_PAIR_OK(REGNO, MODE) \ + (HARD_REGNO_NREGS ((REGNO), (MODE)) == 1 || !((REGNO) & 1)) + +/* Return true if the back end supports mode MODE. */ +static bool +s390_scalar_mode_supported_p (enum machine_mode mode) +{ + if (DECIMAL_FLOAT_MODE_P (mode)) + return true; + else + return default_scalar_mode_supported_p (mode); +} + +/* Set the has_landing_pad_p flag in struct machine_function to VALUE. */ + +void +s390_set_has_landing_pad_p (bool value) +{ + cfun->machine->has_landing_pad_p = value; +} + +/* If two condition code modes are compatible, return a condition code + mode which is compatible with both. Otherwise, return + VOIDmode. */ + +static enum machine_mode +s390_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2) +{ + if (m1 == m2) + return m1; + + switch (m1) + { + case CCZmode: + if (m2 == CCUmode || m2 == CCTmode || m2 == CCZ1mode + || m2 == CCSmode || m2 == CCSRmode || m2 == CCURmode) + return m2; + return VOIDmode; + + case CCSmode: + case CCUmode: + case CCTmode: + case CCSRmode: + case CCURmode: + case CCZ1mode: + if (m2 == CCZmode) + return m1; + + return VOIDmode; + + default: + return VOIDmode; + } + return VOIDmode; +} /* Return true if SET either doesn't set the CC register, or else the source and destination have matching CC modes and that CC mode is at least as constrained as REQ_MODE. */ -static int +static bool s390_match_ccmode_set (rtx set, enum machine_mode req_mode) { enum machine_mode set_mode; - if (GET_CODE (set) != SET) - abort (); + gcc_assert (GET_CODE (set) == SET); if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set)))) return 1; @@ -270,6 +411,7 @@ s390_match_ccmode_set (rtx set, enum machine_mode req_mode) case CCLmode: case CCL1mode: case CCL2mode: + case CCL3mode: case CCT1mode: case CCT2mode: case CCT3mode: @@ -290,7 +432,7 @@ s390_match_ccmode_set (rtx set, enum machine_mode req_mode) break; default: - abort (); + gcc_unreachable (); } return (GET_MODE (SET_SRC (set)) == set_mode); @@ -301,14 +443,14 @@ s390_match_ccmode_set (rtx set, enum machine_mode req_mode) CC mode is at least as constrained as REQ_MODE. If REQ_MODE is VOIDmode, always return false. */ -int +bool s390_match_ccmode (rtx insn, enum machine_mode req_mode) { int i; /* s390_tm_ccmode returns VOIDmode to indicate failure. */ if (req_mode == VOIDmode) - return 0; + return false; if (GET_CODE (PATTERN (insn)) == SET) return s390_match_ccmode_set (PATTERN (insn), req_mode); @@ -319,10 +461,10 @@ s390_match_ccmode (rtx insn, enum machine_mode req_mode) rtx set = XVECEXP (PATTERN (insn), 0, i); if (GET_CODE (set) == SET) if (!s390_match_ccmode_set (set, req_mode)) - return 0; + return false; } - return 1; + return true; } /* If a test-under-mask instruction can be used to implement @@ -333,7 +475,7 @@ s390_match_ccmode (rtx insn, enum machine_mode req_mode) if the instruction cannot (TM). */ enum machine_mode -s390_tm_ccmode (rtx op1, rtx op2, int mixed) +s390_tm_ccmode (rtx op1, rtx op2, bool mixed) { int bit0, bit1; @@ -341,15 +483,20 @@ s390_tm_ccmode (rtx op1, rtx op2, int mixed) if (GET_CODE (op1) != CONST_INT || GET_CODE (op2) != CONST_INT) return VOIDmode; - /* Selected bits all zero: CC0. */ + /* Selected bits all zero: CC0. + e.g.: int a; if ((a & (16 + 128)) == 0) */ if (INTVAL (op2) == 0) return CCTmode; - /* Selected bits all one: CC3. */ + /* Selected bits all one: CC3. + e.g.: int a; if ((a & (16 + 128)) == 16 + 128) */ if (INTVAL (op2) == INTVAL (op1)) return CCT3mode; - /* Exactly two bits selected, mixed zeroes and ones: CC1 or CC2. */ + /* Exactly two bits selected, mixed zeroes and ones: CC1 or CC2. e.g.: + int a; + if ((a & (16 + 128)) == 16) -> CCT1 + if ((a & (16 + 128)) == 128) -> CCT2 */ if (mixed) { bit1 = exact_log2 (INTVAL (op2)); @@ -372,8 +519,11 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) { case EQ: case NE: + if ((GET_CODE (op0) == NEG || GET_CODE (op0) == ABS) + && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT) + return CCAPmode; if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT - && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K")) + && CONST_OK_FOR_K (INTVAL (XEXP (op0, 1)))) return CCAPmode; if ((GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS || GET_CODE (op1) == NEG) @@ -408,14 +558,28 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) case LT: case GE: case GT: - if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT - && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K")) - { - if (INTVAL (XEXP((op0), 1)) < 0) - return CCANmode; - else - return CCAPmode; - } + /* The only overflow condition of NEG and ABS happens when + -INT_MAX is used as parameter, which stays negative. So + we have an overflow from a positive value to a negative. + Using CCAP mode the resulting cc can be used for comparisons. */ + if ((GET_CODE (op0) == NEG || GET_CODE (op0) == ABS) + && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT) + return CCAPmode; + + /* If constants are involved in an add instruction it is possible to use + the resulting cc for comparisons with zero. Knowing the sign of the + constant the overflow behavior gets predictable. e.g.: + int a, b; if ((b = a + c) > 0) + with c as a constant value: c < 0 -> CCAN and c >= 0 -> CCAP */ + if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT + && CONST_OK_FOR_K (INTVAL (XEXP (op0, 1)))) + { + if (INTVAL (XEXP((op0), 1)) < 0) + return CCANmode; + else + return CCAPmode; + } + /* Fall through. */ case UNORDERED: case ORDERED: case UNEQ: @@ -452,98 +616,208 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) return CCUmode; default: - abort (); + gcc_unreachable (); } } -/* Return nonzero if OP is a valid comparison operator - for an ALC condition in mode MODE. */ +/* Replace the comparison OP0 CODE OP1 by a semantically equivalent one + that we can implement more efficiently. */ -int -s390_alc_comparison (rtx op, enum machine_mode mode) +void +s390_canonicalize_comparison (enum rtx_code *code, rtx *op0, rtx *op1) { - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - if (GET_RTX_CLASS (GET_CODE (op)) != '<') - return 0; - - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != CC_REGNUM - || XEXP (op, 1) != const0_rtx) - return 0; - - switch (GET_MODE (XEXP (op, 0))) + /* Convert ZERO_EXTRACT back to AND to enable TM patterns. */ + if ((*code == EQ || *code == NE) + && *op1 == const0_rtx + && GET_CODE (*op0) == ZERO_EXTRACT + && GET_CODE (XEXP (*op0, 1)) == CONST_INT + && GET_CODE (XEXP (*op0, 2)) == CONST_INT + && SCALAR_INT_MODE_P (GET_MODE (XEXP (*op0, 0)))) { - case CCL1mode: - return GET_CODE (op) == LTU; + rtx inner = XEXP (*op0, 0); + HOST_WIDE_INT modesize = GET_MODE_BITSIZE (GET_MODE (inner)); + HOST_WIDE_INT len = INTVAL (XEXP (*op0, 1)); + HOST_WIDE_INT pos = INTVAL (XEXP (*op0, 2)); - case CCL2mode: - return GET_CODE (op) == LEU; + if (len > 0 && len < modesize + && pos >= 0 && pos + len <= modesize + && modesize <= HOST_BITS_PER_WIDE_INT) + { + unsigned HOST_WIDE_INT block; + block = ((unsigned HOST_WIDE_INT) 1 << len) - 1; + block <<= modesize - pos - len; - case CCUmode: - return GET_CODE (op) == GTU; + *op0 = gen_rtx_AND (GET_MODE (inner), inner, + gen_int_mode (block, GET_MODE (inner))); + } + } - case CCURmode: - return GET_CODE (op) == LTU; + /* Narrow AND of memory against immediate to enable TM. */ + if ((*code == EQ || *code == NE) + && *op1 == const0_rtx + && GET_CODE (*op0) == AND + && GET_CODE (XEXP (*op0, 1)) == CONST_INT + && SCALAR_INT_MODE_P (GET_MODE (XEXP (*op0, 0)))) + { + rtx inner = XEXP (*op0, 0); + rtx mask = XEXP (*op0, 1); - case CCSmode: - return GET_CODE (op) == UNGT; + /* Ignore paradoxical SUBREGs if all extra bits are masked out. */ + if (GET_CODE (inner) == SUBREG + && SCALAR_INT_MODE_P (GET_MODE (SUBREG_REG (inner))) + && (GET_MODE_SIZE (GET_MODE (inner)) + >= GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner)))) + && ((INTVAL (mask) + & GET_MODE_MASK (GET_MODE (inner)) + & ~GET_MODE_MASK (GET_MODE (SUBREG_REG (inner)))) + == 0)) + inner = SUBREG_REG (inner); - case CCSRmode: - return GET_CODE (op) == UNLT; + /* Do not change volatile MEMs. */ + if (MEM_P (inner) && !MEM_VOLATILE_P (inner)) + { + int part = s390_single_part (XEXP (*op0, 1), + GET_MODE (inner), QImode, 0); + if (part >= 0) + { + mask = gen_int_mode (s390_extract_part (mask, QImode, 0), QImode); + inner = adjust_address_nv (inner, QImode, part); + *op0 = gen_rtx_AND (QImode, inner, mask); + } + } + } - default: - return 0; + /* Narrow comparisons against 0xffff to HImode if possible. */ + if ((*code == EQ || *code == NE) + && GET_CODE (*op1) == CONST_INT + && INTVAL (*op1) == 0xffff + && SCALAR_INT_MODE_P (GET_MODE (*op0)) + && (nonzero_bits (*op0, GET_MODE (*op0)) + & ~(unsigned HOST_WIDE_INT) 0xffff) == 0) + { + *op0 = gen_lowpart (HImode, *op0); + *op1 = constm1_rtx; + } + + + /* Remove redundant UNSPEC_CMPINT conversions if possible. */ + if (GET_CODE (*op0) == UNSPEC + && XINT (*op0, 1) == UNSPEC_CMPINT + && XVECLEN (*op0, 0) == 1 + && GET_MODE (XVECEXP (*op0, 0, 0)) == CCUmode + && GET_CODE (XVECEXP (*op0, 0, 0)) == REG + && REGNO (XVECEXP (*op0, 0, 0)) == CC_REGNUM + && *op1 == const0_rtx) + { + enum rtx_code new_code = UNKNOWN; + switch (*code) + { + case EQ: new_code = EQ; break; + case NE: new_code = NE; break; + case LT: new_code = GTU; break; + case GT: new_code = LTU; break; + case LE: new_code = GEU; break; + case GE: new_code = LEU; break; + default: break; + } + + if (new_code != UNKNOWN) + { + *op0 = XVECEXP (*op0, 0, 0); + *code = new_code; + } + } + + /* Simplify cascaded EQ, NE with const0_rtx. */ + if ((*code == NE || *code == EQ) + && (GET_CODE (*op0) == EQ || GET_CODE (*op0) == NE) + && GET_MODE (*op0) == SImode + && GET_MODE (XEXP (*op0, 0)) == CCZ1mode + && REG_P (XEXP (*op0, 0)) + && XEXP (*op0, 1) == const0_rtx + && *op1 == const0_rtx) + { + if ((*code == EQ && GET_CODE (*op0) == NE) + || (*code == NE && GET_CODE (*op0) == EQ)) + *code = EQ; + else + *code = NE; + *op0 = XEXP (*op0, 0); + } + + /* Prefer register over memory as first operand. */ + if (MEM_P (*op0) && REG_P (*op1)) + { + rtx tem = *op0; *op0 = *op1; *op1 = tem; + *code = swap_condition (*code); } } -/* Return nonzero if OP is a valid comparison operator - for an SLB condition in mode MODE. */ +/* Emit a compare instruction suitable to implement the comparison + OP0 CODE OP1. Return the correct condition RTL to be placed in + the IF_THEN_ELSE of the conditional branch testing the result. */ -int -s390_slb_comparison (rtx op, enum machine_mode mode) +rtx +s390_emit_compare (enum rtx_code code, rtx op0, rtx op1) { - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; + enum machine_mode mode = s390_select_ccmode (code, op0, op1); + rtx ret = NULL_RTX; - if (GET_RTX_CLASS (GET_CODE (op)) != '<') - return 0; - - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != CC_REGNUM - || XEXP (op, 1) != const0_rtx) - return 0; - - switch (GET_MODE (XEXP (op, 0))) + /* Do not output a redundant compare instruction if a compare_and_swap + pattern already computed the result and the machine modes are compatible. */ + if (s390_compare_emitted + && (s390_cc_modes_compatible (GET_MODE (s390_compare_emitted), mode) + == GET_MODE (s390_compare_emitted))) + ret = gen_rtx_fmt_ee (code, VOIDmode, s390_compare_emitted, const0_rtx); + else { - case CCL1mode: - return GET_CODE (op) == GEU; - - case CCL2mode: - return GET_CODE (op) == GTU; - - case CCUmode: - return GET_CODE (op) == LEU; - - case CCURmode: - return GET_CODE (op) == GEU; - - case CCSmode: - return GET_CODE (op) == LE; - - case CCSRmode: - return GET_CODE (op) == GE; - - default: - return 0; + rtx cc = gen_rtx_REG (mode, CC_REGNUM); + + emit_insn (gen_rtx_SET (VOIDmode, cc, gen_rtx_COMPARE (mode, op0, op1))); + ret = gen_rtx_fmt_ee (code, VOIDmode, cc, const0_rtx); } + s390_compare_emitted = NULL_RTX; + return ret; +} + +/* Emit a SImode compare and swap instruction setting MEM to NEW if OLD + matches CMP. + Return the correct condition RTL to be placed in the IF_THEN_ELSE of the + conditional branch testing the result. */ + +static rtx +s390_emit_compare_and_swap (enum rtx_code code, rtx old, rtx mem, rtx cmp, rtx new) +{ + rtx ret; + + emit_insn (gen_sync_compare_and_swap_ccsi (old, mem, cmp, new)); + ret = gen_rtx_fmt_ee (code, VOIDmode, s390_compare_emitted, const0_rtx); + + s390_compare_emitted = NULL_RTX; + + return ret; +} + +/* Emit a jump instruction to TARGET. If COND is NULL_RTX, emit an + unconditional jump, else a conditional jump under condition COND. */ + +void +s390_emit_jump (rtx target, rtx cond) +{ + rtx insn; + + target = gen_rtx_LABEL_REF (VOIDmode, target); + if (cond) + target = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, target, pc_rtx); + + insn = gen_rtx_SET (VOIDmode, pc_rtx, target); + emit_jump_insn (insn); } /* Return branch condition mask to implement a branch - specified by CODE. */ + specified by CODE. Return -1 for invalid comparisons. */ -static int +int s390_branch_condition_mask (rtx code) { const int CC0 = 1 << 3; @@ -551,20 +825,19 @@ s390_branch_condition_mask (rtx code) const int CC2 = 1 << 1; const int CC3 = 1 << 0; - if (GET_CODE (XEXP (code, 0)) != REG - || REGNO (XEXP (code, 0)) != CC_REGNUM - || XEXP (code, 1) != const0_rtx) - abort (); + gcc_assert (GET_CODE (XEXP (code, 0)) == REG); + gcc_assert (REGNO (XEXP (code, 0)) == CC_REGNUM); + gcc_assert (XEXP (code, 1) == const0_rtx); switch (GET_MODE (XEXP (code, 0))) { case CCZmode: + case CCZ1mode: switch (GET_CODE (code)) { case EQ: return CC0; case NE: return CC1 | CC2 | CC3; - default: - abort (); + default: return -1; } break; @@ -573,8 +846,7 @@ s390_branch_condition_mask (rtx code) { case EQ: return CC1; case NE: return CC0 | CC2 | CC3; - default: - abort (); + default: return -1; } break; @@ -583,8 +855,7 @@ s390_branch_condition_mask (rtx code) { case EQ: return CC2; case NE: return CC0 | CC1 | CC3; - default: - abort (); + default: return -1; } break; @@ -593,8 +864,7 @@ s390_branch_condition_mask (rtx code) { case EQ: return CC3; case NE: return CC0 | CC1 | CC2; - default: - abort (); + default: return -1; } break; @@ -603,8 +873,7 @@ s390_branch_condition_mask (rtx code) { case EQ: return CC0 | CC2; case NE: return CC1 | CC3; - default: - abort (); + default: return -1; } break; @@ -613,8 +882,7 @@ s390_branch_condition_mask (rtx code) { case LTU: return CC2 | CC3; /* carry */ case GEU: return CC0 | CC1; /* no carry */ - default: - abort (); + default: return -1; } break; @@ -623,11 +891,22 @@ s390_branch_condition_mask (rtx code) { case GTU: return CC0 | CC1; /* borrow */ case LEU: return CC2 | CC3; /* no borrow */ - default: - abort (); + default: return -1; } break; + case CCL3mode: + switch (GET_CODE (code)) + { + case EQ: return CC0 | CC2; + case NE: return CC1 | CC3; + case LTU: return CC1; + case GTU: return CC3; + case LEU: return CC1 | CC2; + case GEU: return CC2 | CC3; + default: return -1; + } + case CCUmode: switch (GET_CODE (code)) { @@ -637,8 +916,7 @@ s390_branch_condition_mask (rtx code) case GTU: return CC2; case LEU: return CC0 | CC1; case GEU: return CC0 | CC2; - default: - abort (); + default: return -1; } break; @@ -651,8 +929,7 @@ s390_branch_condition_mask (rtx code) case GTU: return CC1; case LEU: return CC0 | CC2; case GEU: return CC0 | CC1; - default: - abort (); + default: return -1; } break; @@ -665,8 +942,7 @@ s390_branch_condition_mask (rtx code) case GT: return CC2; case LE: return CC0 | CC1 | CC3; case GE: return CC0 | CC2; - default: - abort (); + default: return -1; } break; @@ -679,8 +955,7 @@ s390_branch_condition_mask (rtx code) case GT: return CC2 | CC3; case LE: return CC0 | CC1; case GE: return CC0 | CC2 | CC3; - default: - abort (); + default: return -1; } break; @@ -701,8 +976,7 @@ s390_branch_condition_mask (rtx code) case UNLE: return CC0 | CC1 | CC3; case UNGE: return CC0 | CC2 | CC3; case LTGT: return CC1 | CC2; - default: - abort (); + default: return -1; } break; @@ -723,13 +997,12 @@ s390_branch_condition_mask (rtx code) case UNLE: return CC0 | CC2 | CC3; case UNGE: return CC0 | CC1 | CC3; case LTGT: return CC2 | CC1; - default: - abort (); + default: return -1; } break; default: - abort (); + return -1; } } @@ -749,19 +1022,19 @@ s390_branch_condition_mnemonic (rtx code, int inv) }; int mask = s390_branch_condition_mask (code); + gcc_assert (mask >= 0); if (inv) mask ^= 15; - if (mask < 1 || mask > 14) - abort (); + gcc_assert (mask >= 1 && mask <= 14); return mnemonic[mask]; } /* Return the part of op which has a value different from def. The size of the part is determined by mode. - Use this function only if you already know that op really + Use this function only if you already know that op really contains such a part. */ unsigned HOST_WIDE_INT @@ -770,21 +1043,22 @@ s390_extract_part (rtx op, enum machine_mode mode, int def) unsigned HOST_WIDE_INT value = 0; int max_parts = HOST_BITS_PER_WIDE_INT / GET_MODE_BITSIZE (mode); int part_bits = GET_MODE_BITSIZE (mode); - unsigned HOST_WIDE_INT part_mask = (1 << part_bits) - 1; + unsigned HOST_WIDE_INT part_mask + = ((unsigned HOST_WIDE_INT)1 << part_bits) - 1; int i; - + for (i = 0; i < max_parts; i++) { if (i == 0) value = (unsigned HOST_WIDE_INT) INTVAL (op); else value >>= part_bits; - + if ((value & part_mask) != (def & part_mask)) return value & part_mask; } - - abort (); + + gcc_unreachable (); } /* If OP is an integer constant of mode MODE with exactly one @@ -792,26 +1066,27 @@ s390_extract_part (rtx op, enum machine_mode mode, int def) part. Otherwise, return -1. */ int -s390_single_part (rtx op, - enum machine_mode mode, +s390_single_part (rtx op, + enum machine_mode mode, enum machine_mode part_mode, int def) { unsigned HOST_WIDE_INT value = 0; int n_parts = GET_MODE_SIZE (mode) / GET_MODE_SIZE (part_mode); - unsigned HOST_WIDE_INT part_mask = (1 << GET_MODE_BITSIZE (part_mode)) - 1; + unsigned HOST_WIDE_INT part_mask + = ((unsigned HOST_WIDE_INT)1 << GET_MODE_BITSIZE (part_mode)) - 1; int i, part = -1; if (GET_CODE (op) != CONST_INT) return -1; - + for (i = 0; i < n_parts; i++) { if (i == 0) value = (unsigned HOST_WIDE_INT) INTVAL (op); else value >>= GET_MODE_BITSIZE (part_mode); - + if ((value & part_mask) != (def & part_mask)) { if (part != -1) @@ -855,6 +1130,169 @@ s390_split_ok_p (rtx dst, rtx src, enum machine_mode mode, int first_subword) return true; } +/* Return true if it can be proven that [MEM1, MEM1 + SIZE] + and [MEM2, MEM2 + SIZE] do overlap and false + otherwise. */ + +bool +s390_overlap_p (rtx mem1, rtx mem2, HOST_WIDE_INT size) +{ + rtx addr1, addr2, addr_delta; + HOST_WIDE_INT delta; + + if (GET_CODE (mem1) != MEM || GET_CODE (mem2) != MEM) + return true; + + if (size == 0) + return false; + + addr1 = XEXP (mem1, 0); + addr2 = XEXP (mem2, 0); + + addr_delta = simplify_binary_operation (MINUS, Pmode, addr2, addr1); + + /* This overlapping check is used by peepholes merging memory block operations. + Overlapping operations would otherwise be recognized by the S/390 hardware + and would fall back to a slower implementation. Allowing overlapping + operations would lead to slow code but not to wrong code. Therefore we are + somewhat optimistic if we cannot prove that the memory blocks are + overlapping. + That's why we return false here although this may accept operations on + overlapping memory areas. */ + if (!addr_delta || GET_CODE (addr_delta) != CONST_INT) + return false; + + delta = INTVAL (addr_delta); + + if (delta == 0 + || (delta > 0 && delta < size) + || (delta < 0 && -delta < size)) + return true; + + return false; +} + +/* Check whether the address of memory reference MEM2 equals exactly + the address of memory reference MEM1 plus DELTA. Return true if + we can prove this to be the case, false otherwise. */ + +bool +s390_offset_p (rtx mem1, rtx mem2, rtx delta) +{ + rtx addr1, addr2, addr_delta; + + if (GET_CODE (mem1) != MEM || GET_CODE (mem2) != MEM) + return false; + + addr1 = XEXP (mem1, 0); + addr2 = XEXP (mem2, 0); + + addr_delta = simplify_binary_operation (MINUS, Pmode, addr2, addr1); + if (!addr_delta || !rtx_equal_p (addr_delta, delta)) + return false; + + return true; +} + +/* Expand logical operator CODE in mode MODE with operands OPERANDS. */ + +void +s390_expand_logical_operator (enum rtx_code code, enum machine_mode mode, + rtx *operands) +{ + enum machine_mode wmode = mode; + rtx dst = operands[0]; + rtx src1 = operands[1]; + rtx src2 = operands[2]; + rtx op, clob, tem; + + /* If we cannot handle the operation directly, use a temp register. */ + if (!s390_logical_operator_ok_p (operands)) + dst = gen_reg_rtx (mode); + + /* QImode and HImode patterns make sense only if we have a destination + in memory. Otherwise perform the operation in SImode. */ + if ((mode == QImode || mode == HImode) && GET_CODE (dst) != MEM) + wmode = SImode; + + /* Widen operands if required. */ + if (mode != wmode) + { + if (GET_CODE (dst) == SUBREG + && (tem = simplify_subreg (wmode, dst, mode, 0)) != 0) + dst = tem; + else if (REG_P (dst)) + dst = gen_rtx_SUBREG (wmode, dst, 0); + else + dst = gen_reg_rtx (wmode); + + if (GET_CODE (src1) == SUBREG + && (tem = simplify_subreg (wmode, src1, mode, 0)) != 0) + src1 = tem; + else if (GET_MODE (src1) != VOIDmode) + src1 = gen_rtx_SUBREG (wmode, force_reg (mode, src1), 0); + + if (GET_CODE (src2) == SUBREG + && (tem = simplify_subreg (wmode, src2, mode, 0)) != 0) + src2 = tem; + else if (GET_MODE (src2) != VOIDmode) + src2 = gen_rtx_SUBREG (wmode, force_reg (mode, src2), 0); + } + + /* Emit the instruction. */ + op = gen_rtx_SET (VOIDmode, dst, gen_rtx_fmt_ee (code, wmode, src1, src2)); + clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM)); + emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, op, clob))); + + /* Fix up the destination if needed. */ + if (dst != operands[0]) + emit_move_insn (operands[0], gen_lowpart (mode, dst)); +} + +/* Check whether OPERANDS are OK for a logical operation (AND, IOR, XOR). */ + +bool +s390_logical_operator_ok_p (rtx *operands) +{ + /* If the destination operand is in memory, it needs to coincide + with one of the source operands. After reload, it has to be + the first source operand. */ + if (GET_CODE (operands[0]) == MEM) + return rtx_equal_p (operands[0], operands[1]) + || (!reload_completed && rtx_equal_p (operands[0], operands[2])); + + return true; +} + +/* Narrow logical operation CODE of memory operand MEMOP with immediate + operand IMMOP to switch from SS to SI type instructions. */ + +void +s390_narrow_logical_operator (enum rtx_code code, rtx *memop, rtx *immop) +{ + int def = code == AND ? -1 : 0; + HOST_WIDE_INT mask; + int part; + + gcc_assert (GET_CODE (*memop) == MEM); + gcc_assert (!MEM_VOLATILE_P (*memop)); + + mask = s390_extract_part (*immop, QImode, def); + part = s390_single_part (*immop, GET_MODE (*memop), QImode, def); + gcc_assert (part >= 0); + + *memop = adjust_address (*memop, QImode, part); + *immop = gen_int_mode (mask, QImode); +} + + +/* How to allocate a 'struct machine_function'. */ + +static struct machine_function * +s390_init_machine_status (void) +{ + return ggc_alloc_cleared (sizeof (struct machine_function)); +} /* Change optimizations to be performed, depending on the optimization level. @@ -873,12 +1311,20 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) /* By default, always emit DWARF-2 unwind info. This allows debugging without maintaining a stack frame back-chain. */ flag_asynchronous_unwind_tables = 1; + + /* Use MVCLE instructions to decrease code size if requested. */ + if (size != 0) + target_flags |= MASK_MVCLE; } -void -override_options (void) +/* Return true if ARG is the name of a processor. Set *TYPE and *FLAGS + to the associated processor_type and processor_flags if so. */ + +static bool +s390_handle_arch_option (const char *arg, + enum processor_type *type, + enum processor_flags *flags) { - int i; static struct pta { const char *const name; /* processor name or nickname. */ @@ -892,13 +1338,59 @@ override_options (void) {"z900", PROCESSOR_2064_Z900, PF_IEEE_FLOAT | PF_ZARCH}, {"z990", PROCESSOR_2084_Z990, PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT}, + {"z9-109", PROCESSOR_2094_Z9_109, PF_IEEE_FLOAT | PF_ZARCH + | PF_LONG_DISPLACEMENT | PF_EXTIMM}, }; + size_t i; - int const pta_size = ARRAY_SIZE (processor_alias_table); + for (i = 0; i < ARRAY_SIZE (processor_alias_table); i++) + if (strcmp (arg, processor_alias_table[i].name) == 0) + { + *type = processor_alias_table[i].processor; + *flags = processor_alias_table[i].flags; + return true; + } + return false; +} - /* Acquire a unique set number for our register saves and restores. */ - s390_sr_alias_set = new_alias_set (); +/* Implement TARGET_HANDLE_OPTION. */ +static bool +s390_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_march_: + return s390_handle_arch_option (arg, &s390_arch, &s390_arch_flags); + + case OPT_mstack_guard_: + if (sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_stack_guard) != 1) + return false; + if (exact_log2 (s390_stack_guard) == -1) + error ("stack guard value must be an exact power of 2"); + return true; + + case OPT_mstack_size_: + if (sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_stack_size) != 1) + return false; + if (exact_log2 (s390_stack_size) == -1) + error ("stack size must be an exact power of 2"); + return true; + + case OPT_mtune_: + return s390_handle_arch_option (arg, &s390_tune, &s390_tune_flags); + + case OPT_mwarn_framesize_: + return sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_warn_framesize) == 1; + + default: + return true; + } +} + +void +override_options (void) +{ /* Set up function hooks. */ init_machine_status = s390_init_machine_status; @@ -913,43 +1405,52 @@ override_options (void) /* Determine processor architectural level. */ if (!s390_arch_string) - s390_arch_string = TARGET_ZARCH? "z900" : "g5"; - - for (i = 0; i < pta_size; i++) - if (! strcmp (s390_arch_string, processor_alias_table[i].name)) - { - s390_arch = processor_alias_table[i].processor; - s390_arch_flags = processor_alias_table[i].flags; - break; - } - if (i == pta_size) - error ("Unknown cpu used in -march=%s.", s390_arch_string); + { + s390_arch_string = TARGET_ZARCH? "z900" : "g5"; + s390_handle_arch_option (s390_arch_string, &s390_arch, &s390_arch_flags); + } /* Determine processor to tune for. */ - if (!s390_tune_string) + if (s390_tune == PROCESSOR_max) { s390_tune = s390_arch; s390_tune_flags = s390_arch_flags; - s390_tune_string = s390_arch_string; - } - else - { - for (i = 0; i < pta_size; i++) - if (! strcmp (s390_tune_string, processor_alias_table[i].name)) - { - s390_tune = processor_alias_table[i].processor; - s390_tune_flags = processor_alias_table[i].flags; - break; - } - if (i == pta_size) - error ("Unknown cpu used in -mtune=%s.", s390_tune_string); } /* Sanity checks. */ if (TARGET_ZARCH && !(s390_arch_flags & PF_ZARCH)) - error ("z/Architecture mode not supported on %s.", s390_arch_string); + error ("z/Architecture mode not supported on %s", s390_arch_string); if (TARGET_64BIT && !TARGET_ZARCH) - error ("64-bit ABI not supported in ESA/390 mode."); + error ("64-bit ABI not supported in ESA/390 mode"); + + /* Set processor cost function. */ + if (s390_tune == PROCESSOR_2094_Z9_109) + s390_cost = &z9_109_cost; + else if (s390_tune == PROCESSOR_2084_Z990) + s390_cost = &z990_cost; + else + s390_cost = &z900_cost; + + if (TARGET_BACKCHAIN && TARGET_PACKED_STACK && TARGET_HARD_FLOAT) + error ("-mbackchain -mpacked-stack -mhard-float are not supported " + "in combination"); + + if (s390_stack_size) + { + if (!s390_stack_guard) + error ("-mstack-size implies use of -mstack-guard"); + else if (s390_stack_guard >= s390_stack_size) + error ("stack size must be greater than the stack guard value"); + else if (s390_stack_size > 1 << 16) + error ("stack size must not be greater than 64k"); + } + else if (s390_stack_guard) + error ("-mstack-guard implies use of -mstack-size"); + +#ifdef TARGET_DEFAULT_LONG_DOUBLE_128 + if (!(target_flags_explicit & MASK_LONG_DOUBLE_128)) + target_flags |= MASK_LONG_DOUBLE_128; +#endif } /* Map for smallest class containing reg regno. */ @@ -963,7 +1464,8 @@ const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, FP_REGS, - ADDR_REGS, NO_REGS, ADDR_REGS + ADDR_REGS, CC_REGS, ADDR_REGS, ADDR_REGS, + ACCESS_REGS, ACCESS_REGS }; /* Return attribute type of insn. */ @@ -977,229 +1479,14 @@ s390_safe_attr_type (rtx insn) return TYPE_NONE; } -/* Return true if OP a (const_int 0) operand. - OP is the current operation. - MODE is the current operation mode. */ - -int -const0_operand (register rtx op, enum machine_mode mode) -{ - return op == CONST0_RTX (mode); -} - -/* Return true if OP is constant. - OP is the current operation. - MODE is the current operation mode. */ - -int -consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return CONSTANT_P (op); -} - -/* Return true if the mode of operand OP matches MODE. - If MODE is set to VOIDmode, set it to the mode of OP. */ - -static int -check_mode (register rtx op, enum machine_mode *mode) -{ - if (*mode == VOIDmode) - *mode = GET_MODE (op); - else - { - if (GET_MODE (op) != VOIDmode && GET_MODE (op) != *mode) - return 0; - } - return 1; -} - -/* Return true if OP a valid operand for the LARL instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -larl_operand (register rtx op, enum machine_mode mode) -{ - if (! check_mode (op, &mode)) - return 0; - - /* Allow labels and local symbols. */ - if (GET_CODE (op) == LABEL_REF) - return 1; - if (GET_CODE (op) == SYMBOL_REF) - return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 - && SYMBOL_REF_TLS_MODEL (op) == 0 - && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); - - /* Everything else must have a CONST, so strip it. */ - if (GET_CODE (op) != CONST) - return 0; - op = XEXP (op, 0); - - /* Allow adding *even* in-range constants. */ - if (GET_CODE (op) == PLUS) - { - if (GET_CODE (XEXP (op, 1)) != CONST_INT - || (INTVAL (XEXP (op, 1)) & 1) != 0) - return 0; -#if HOST_BITS_PER_WIDE_INT > 32 - if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 32 - || INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 32)) - return 0; -#endif - op = XEXP (op, 0); - } - - /* Labels and local symbols allowed here as well. */ - if (GET_CODE (op) == LABEL_REF) - return 1; - if (GET_CODE (op) == SYMBOL_REF) - return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 - && SYMBOL_REF_TLS_MODEL (op) == 0 - && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); - - /* Now we must have a @GOTENT offset or @PLT stub - or an @INDNTPOFF TLS offset. */ - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_GOTENT) - return 1; - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_PLT) - return 1; - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_INDNTPOFF) - return 1; - - return 0; -} - -/* Helper routine to implement s_operand and s_imm_operand. - OP is the current operation. - MODE is the current operation mode. - ALLOW_IMMEDIATE specifies whether immediate operands should - be accepted or not. */ - -static int -general_s_operand (register rtx op, enum machine_mode mode, - int allow_immediate) -{ - struct s390_address addr; - - /* Call general_operand first, so that we don't have to - check for many special cases. */ - if (!general_operand (op, mode)) - return 0; - - /* Just like memory_operand, allow (subreg (mem ...)) - after reload. */ - if (reload_completed - && GET_CODE (op) == SUBREG - && GET_CODE (SUBREG_REG (op)) == MEM) - op = SUBREG_REG (op); - - switch (GET_CODE (op)) - { - /* Constants are OK as s-operand if ALLOW_IMMEDIATE - is true and we are still before reload. */ - case CONST_INT: - case CONST_DOUBLE: - if (!allow_immediate || reload_completed) - return 0; - return 1; - - /* Memory operands are OK unless they already use an - index register. */ - case MEM: - if (GET_CODE (XEXP (op, 0)) == ADDRESSOF) - return 1; - if (!s390_decompose_address (XEXP (op, 0), &addr)) - return 0; - if (addr.indx) - return 0; - /* Do not allow literal pool references unless ALLOW_IMMEDIATE - is true. This prevents compares between two literal pool - entries from being accepted. */ - if (!allow_immediate - && addr.base && REGNO (addr.base) == BASE_REGISTER) - return 0; - return 1; - - default: - break; - } - - return 0; -} - -/* Return true if OP is a valid S-type operand. - OP is the current operation. - MODE is the current operation mode. */ - -int -s_operand (register rtx op, enum machine_mode mode) -{ - return general_s_operand (op, mode, 0); -} - -/* Return true if OP is a valid S-type operand or an immediate - operand that can be addressed as S-type operand by forcing - it into the literal pool. - OP is the current operation. - MODE is the current operation mode. */ - -int -s_imm_operand (register rtx op, enum machine_mode mode) -{ - return general_s_operand (op, mode, 1); -} - -/* Return true if OP a valid shift count operand. - OP is the current operation. - MODE is the current operation mode. */ - -int -shift_count_operand (rtx op, enum machine_mode mode) -{ - HOST_WIDE_INT offset = 0; - - if (! check_mode (op, &mode)) - return 0; - - /* We can have an integer constant, an address register, - or a sum of the two. Note that reload already checks - that any register present is an address register, so - we just check for any register here. */ - if (GET_CODE (op) == CONST_INT) - { - offset = INTVAL (op); - op = NULL_RTX; - } - if (op && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) - { - offset = INTVAL (XEXP (op, 1)); - op = XEXP (op, 0); - } - while (op && GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (op && GET_CODE (op) != REG) - return 0; - - /* Unfortunately we have to reject constants that are invalid - for an address, or else reload will get confused. */ - if (!DISP_IN_RANGE (offset)) - return 0; - - return 1; -} - /* Return true if DISP is a valid short displacement. */ -static int +static bool s390_short_displacement (rtx disp) { /* No displacement is OK. */ if (!disp) - return 1; + return true; /* Integer displacement in range. */ if (GET_CODE (disp) == CONST_INT) @@ -1208,26 +1495,408 @@ s390_short_displacement (rtx disp) /* GOT offset is not OK, the GOT can be large. */ if (GET_CODE (disp) == CONST && GET_CODE (XEXP (disp, 0)) == UNSPEC - && XINT (XEXP (disp, 0), 1) == UNSPEC_GOT) - return 0; + && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT + || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF)) + return false; /* All other symbolic constants are literal pool references, which are OK as the literal pool must be small. */ if (GET_CODE (disp) == CONST) - return 1; + return true; - return 0; + return false; } -/* Return true if OP is a valid operand for a C constraint. */ +/* Decompose a RTL expression ADDR for a memory address into + its components, returned in OUT. -int -s390_extra_constraint_str (rtx op, int c, const char * str) + Returns false if ADDR is not a valid memory address, true + otherwise. If OUT is NULL, don't return the components, + but check for validity only. + + Note: Only addresses in canonical form are recognized. + LEGITIMIZE_ADDRESS should convert non-canonical forms to the + canonical form so that they will be recognized. */ + +static int +s390_decompose_address (rtx addr, struct s390_address *out) +{ + HOST_WIDE_INT offset = 0; + rtx base = NULL_RTX; + rtx indx = NULL_RTX; + rtx disp = NULL_RTX; + rtx orig_disp; + bool pointer = false; + bool base_ptr = false; + bool indx_ptr = false; + bool literal_pool = false; + + /* We may need to substitute the literal pool base register into the address + below. However, at this point we do not know which register is going to + be used as base, so we substitute the arg pointer register. This is going + to be treated as holding a pointer below -- it shouldn't be used for any + other purpose. */ + rtx fake_pool_base = gen_rtx_REG (Pmode, ARG_POINTER_REGNUM); + + /* Decompose address into base + index + displacement. */ + + if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC) + base = addr; + + else if (GET_CODE (addr) == PLUS) + { + rtx op0 = XEXP (addr, 0); + rtx op1 = XEXP (addr, 1); + enum rtx_code code0 = GET_CODE (op0); + enum rtx_code code1 = GET_CODE (op1); + + if (code0 == REG || code0 == UNSPEC) + { + if (code1 == REG || code1 == UNSPEC) + { + indx = op0; /* index + base */ + base = op1; + } + + else + { + base = op0; /* base + displacement */ + disp = op1; + } + } + + else if (code0 == PLUS) + { + indx = XEXP (op0, 0); /* index + base + disp */ + base = XEXP (op0, 1); + disp = op1; + } + + else + { + return false; + } + } + + else + disp = addr; /* displacement */ + + /* Extract integer part of displacement. */ + orig_disp = disp; + if (disp) + { + if (GET_CODE (disp) == CONST_INT) + { + offset = INTVAL (disp); + disp = NULL_RTX; + } + else if (GET_CODE (disp) == CONST + && GET_CODE (XEXP (disp, 0)) == PLUS + && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) + { + offset = INTVAL (XEXP (XEXP (disp, 0), 1)); + disp = XEXP (XEXP (disp, 0), 0); + } + } + + /* Strip off CONST here to avoid special case tests later. */ + if (disp && GET_CODE (disp) == CONST) + disp = XEXP (disp, 0); + + /* We can convert literal pool addresses to + displacements by basing them off the base register. */ + if (disp && GET_CODE (disp) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (disp)) + { + /* Either base or index must be free to hold the base register. */ + if (!base) + base = fake_pool_base, literal_pool = true; + else if (!indx) + indx = fake_pool_base, literal_pool = true; + else + return false; + + /* Mark up the displacement. */ + disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), + UNSPEC_LTREL_OFFSET); + } + + /* Validate base register. */ + if (base) + { + if (GET_CODE (base) == UNSPEC) + switch (XINT (base, 1)) + { + case UNSPEC_LTREF: + if (!disp) + disp = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, XVECEXP (base, 0, 0)), + UNSPEC_LTREL_OFFSET); + else + return false; + + base = XVECEXP (base, 0, 1); + break; + + case UNSPEC_LTREL_BASE: + if (XVECLEN (base, 0) == 1) + base = fake_pool_base, literal_pool = true; + else + base = XVECEXP (base, 0, 1); + break; + + default: + return false; + } + + if (!REG_P (base) + || (GET_MODE (base) != SImode + && GET_MODE (base) != Pmode)) + return false; + + if (REGNO (base) == STACK_POINTER_REGNUM + || REGNO (base) == FRAME_POINTER_REGNUM + || ((reload_completed || reload_in_progress) + && frame_pointer_needed + && REGNO (base) == HARD_FRAME_POINTER_REGNUM) + || REGNO (base) == ARG_POINTER_REGNUM + || (flag_pic + && REGNO (base) == PIC_OFFSET_TABLE_REGNUM)) + pointer = base_ptr = true; + + if ((reload_completed || reload_in_progress) + && base == cfun->machine->base_reg) + pointer = base_ptr = literal_pool = true; + } + + /* Validate index register. */ + if (indx) + { + if (GET_CODE (indx) == UNSPEC) + switch (XINT (indx, 1)) + { + case UNSPEC_LTREF: + if (!disp) + disp = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, XVECEXP (indx, 0, 0)), + UNSPEC_LTREL_OFFSET); + else + return false; + + indx = XVECEXP (indx, 0, 1); + break; + + case UNSPEC_LTREL_BASE: + if (XVECLEN (indx, 0) == 1) + indx = fake_pool_base, literal_pool = true; + else + indx = XVECEXP (indx, 0, 1); + break; + + default: + return false; + } + + if (!REG_P (indx) + || (GET_MODE (indx) != SImode + && GET_MODE (indx) != Pmode)) + return false; + + if (REGNO (indx) == STACK_POINTER_REGNUM + || REGNO (indx) == FRAME_POINTER_REGNUM + || ((reload_completed || reload_in_progress) + && frame_pointer_needed + && REGNO (indx) == HARD_FRAME_POINTER_REGNUM) + || REGNO (indx) == ARG_POINTER_REGNUM + || (flag_pic + && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM)) + pointer = indx_ptr = true; + + if ((reload_completed || reload_in_progress) + && indx == cfun->machine->base_reg) + pointer = indx_ptr = literal_pool = true; + } + + /* Prefer to use pointer as base, not index. */ + if (base && indx && !base_ptr + && (indx_ptr || (!REG_POINTER (base) && REG_POINTER (indx)))) + { + rtx tmp = base; + base = indx; + indx = tmp; + } + + /* Validate displacement. */ + if (!disp) + { + /* If virtual registers are involved, the displacement will change later + anyway as the virtual registers get eliminated. This could make a + valid displacement invalid, but it is more likely to make an invalid + displacement valid, because we sometimes access the register save area + via negative offsets to one of those registers. + Thus we don't check the displacement for validity here. If after + elimination the displacement turns out to be invalid after all, + this is fixed up by reload in any case. */ + if (base != arg_pointer_rtx + && indx != arg_pointer_rtx + && base != return_address_pointer_rtx + && indx != return_address_pointer_rtx + && base != frame_pointer_rtx + && indx != frame_pointer_rtx + && base != virtual_stack_vars_rtx + && indx != virtual_stack_vars_rtx) + if (!DISP_IN_RANGE (offset)) + return false; + } + else + { + /* All the special cases are pointers. */ + pointer = true; + + /* In the small-PIC case, the linker converts @GOT + and @GOTNTPOFF offsets to possible displacements. */ + if (GET_CODE (disp) == UNSPEC + && (XINT (disp, 1) == UNSPEC_GOT + || XINT (disp, 1) == UNSPEC_GOTNTPOFF) + && flag_pic == 1) + { + ; + } + + /* Accept chunkified literal pool symbol references. */ + else if (cfun && cfun->machine + && cfun->machine->decomposed_literal_pool_addresses_ok_p + && GET_CODE (disp) == MINUS + && GET_CODE (XEXP (disp, 0)) == LABEL_REF + && GET_CODE (XEXP (disp, 1)) == LABEL_REF) + { + ; + } + + /* Accept literal pool references. */ + else if (GET_CODE (disp) == UNSPEC + && XINT (disp, 1) == UNSPEC_LTREL_OFFSET) + { + orig_disp = gen_rtx_CONST (Pmode, disp); + if (offset) + { + /* If we have an offset, make sure it does not + exceed the size of the constant pool entry. */ + rtx sym = XVECEXP (disp, 0, 0); + if (offset >= GET_MODE_SIZE (get_pool_mode (sym))) + return false; + + orig_disp = plus_constant (orig_disp, offset); + } + } + + else + return false; + } + + if (!base && !indx) + pointer = true; + + if (out) + { + out->base = base; + out->indx = indx; + out->disp = orig_disp; + out->pointer = pointer; + out->literal_pool = literal_pool; + } + + return true; +} + +/* Decompose a RTL expression OP for a shift count into its components, + and return the base register in BASE and the offset in OFFSET. + + Return true if OP is a valid shift count, false if not. */ + +bool +s390_decompose_shift_count (rtx op, rtx *base, HOST_WIDE_INT *offset) +{ + HOST_WIDE_INT off = 0; + + /* We can have an integer constant, an address register, + or a sum of the two. */ + if (GET_CODE (op) == CONST_INT) + { + off = INTVAL (op); + op = NULL_RTX; + } + if (op && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) + { + off = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + } + while (op && GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (op && GET_CODE (op) != REG) + return false; + + if (offset) + *offset = off; + if (base) + *base = op; + + return true; +} + + +/* Return true if CODE is a valid address without index. */ + +bool +s390_legitimate_address_without_index_p (rtx op) { struct s390_address addr; - if (c != str[0]) - abort (); + if (!s390_decompose_address (XEXP (op, 0), &addr)) + return false; + if (addr.indx) + return false; + + return true; +} + + +/* Evaluates constraint strings described by the regular expression + ([A|B](Q|R|S|T))|U|W and returns 1 if OP is a valid operand for the + constraint given in STR, or 0 else. */ + +int +s390_mem_constraint (const char *str, rtx op) +{ + struct s390_address addr; + char c = str[0]; + + /* Check for offsettable variants of memory constraints. */ + if (c == 'A') + { + /* Only accept non-volatile MEMs. */ + if (!MEM_P (op) || MEM_VOLATILE_P (op)) + return 0; + + if ((reload_completed || reload_in_progress) + ? !offsettable_memref_p (op) : !offsettable_nonstrict_memref_p (op)) + return 0; + + c = str[1]; + } + + /* Check for non-literal-pool variants of memory constraints. */ + else if (c == 'B') + { + if (GET_CODE (op) != MEM) + return 0; + if (!s390_decompose_address (XEXP (op, 0), &addr)) + return 0; + if (addr.literal_pool) + return 0; + + c = str[1]; + } switch (c) { @@ -1305,78 +1974,10 @@ s390_extra_constraint_str (rtx op, int c, const char * str) break; case 'Y': - return shift_count_operand (op, VOIDmode); - - default: - return 0; - } - - return 1; -} - -/* Return true if VALUE matches the constraint STR. */ - -int -s390_const_ok_for_constraint_p (HOST_WIDE_INT value, - int c, - const char * str) -{ - enum machine_mode mode, part_mode; - int def; - unsigned char part; - - if (c != str[0]) - abort (); - - switch (str[0]) - { - case 'I': - return (unsigned int)value < 256; - - case 'J': - return (unsigned int)value < 4096; - - case 'K': - return value >= -32768 && value < 32768; - - case 'L': - return (TARGET_LONG_DISPLACEMENT ? - (value >= -524288 && value <= 524287) - : (value >= 0 && value <= 4095)); - case 'M': - return value == 2147483647; - - case 'N': - part = str[1] - '0'; - - switch (str[2]) - { - case 'H': part_mode = HImode; break; - case 'Q': part_mode = QImode; break; - default: return 0; - } - - switch (str[3]) - { - case 'H': mode = HImode; break; - case 'S': mode = SImode; break; - case 'D': mode = DImode; break; - default: return 0; - } - - switch (str[4]) - { - case '0': def = 0; break; - case 'F': def = -1; break; - default: return 0; - } - - if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode)) + /* Simply check for the basic form of a shift count. Reload will + take care of making sure we have a proper base register. */ + if (!s390_decompose_shift_count (op, NULL, NULL)) return 0; - - if (s390_single_part (GEN_INT (value), mode, part_mode, def) != part) - return 0; - break; default: @@ -1386,9 +1987,125 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value, return 1; } + + +/* Evaluates constraint strings starting with letter O. Input + parameter C is the second letter following the "O" in the constraint + string. Returns 1 if VALUE meets the respective constraint and 0 + otherwise. */ + +int +s390_O_constraint_str (const char c, HOST_WIDE_INT value) +{ + if (!TARGET_EXTIMM) + return 0; + + switch (c) + { + case 's': + return trunc_int_for_mode (value, SImode) == value; + + case 'p': + return value == 0 + || s390_single_part (GEN_INT (value), DImode, SImode, 0) == 1; + + case 'n': + return value == -1 + || s390_single_part (GEN_INT (value), DImode, SImode, -1) == 1; + + default: + gcc_unreachable (); + } +} + + +/* Evaluates constraint strings starting with letter N. Parameter STR + contains the letters following letter "N" in the constraint string. + Returns true if VALUE matches the constraint. */ + +int +s390_N_constraint_str (const char *str, HOST_WIDE_INT value) +{ + enum machine_mode mode, part_mode; + int def; + int part, part_goal; + + + if (str[0] == 'x') + part_goal = -1; + else + part_goal = str[0] - '0'; + + switch (str[1]) + { + case 'Q': + part_mode = QImode; + break; + case 'H': + part_mode = HImode; + break; + case 'S': + part_mode = SImode; + break; + default: + return 0; + } + + switch (str[2]) + { + case 'H': + mode = HImode; + break; + case 'S': + mode = SImode; + break; + case 'D': + mode = DImode; + break; + default: + return 0; + } + + switch (str[3]) + { + case '0': + def = 0; + break; + case 'F': + def = -1; + break; + default: + return 0; + } + + if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode)) + return 0; + + part = s390_single_part (GEN_INT (value), mode, part_mode, def); + if (part < 0) + return 0; + if (part_goal != -1 && part_goal != part) + return 0; + + return 1; +} + + +/* Returns true if the input parameter VALUE is a float zero. */ + +int +s390_float_const_zero_p (rtx value) +{ + return (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT + && value == CONST0_RTX (GET_MODE (value))); +} + + /* Compute a (partial) cost for rtx X. Return true if the complete cost has been computed, and false if subexpressions should be - scanned. In either case, *TOTAL contains the cost result. */ + scanned. In either case, *TOTAL contains the cost result. + CODE contains GET_CODE (x), OUTER_CODE contains the code + of the superexpression of x. */ static bool s390_rtx_costs (rtx x, int code, int outer_code, int *total) @@ -1396,60 +2113,195 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total) switch (code) { case CONST: - if (GET_CODE (XEXP (x, 0)) == MINUS - && GET_CODE (XEXP (XEXP (x, 0), 1)) != CONST_INT) - *total = 1000; - else - *total = 0; - return true; - case CONST_INT: - /* Force_const_mem does not work out of reload, because the - saveable_obstack is set to reload_obstack, which does not - live long enough. Because of this we cannot use force_const_mem - in addsi3. This leads to problems with gen_add2_insn with a - constant greater than a short. Because of that we give an - addition of greater constants a cost of 3 (reload1.c 10096). */ - /* ??? saveable_obstack no longer exists. */ - if (outer_code == PLUS - && (INTVAL (x) > 32767 || INTVAL (x) < -32768)) - *total = COSTS_N_INSNS (3); - else - *total = 0; - return true; - case LABEL_REF: case SYMBOL_REF: case CONST_DOUBLE: + case MEM: *total = 0; return true; case ASHIFT: case ASHIFTRT: case LSHIFTRT: - case PLUS: + case ROTATE: + case ROTATERT: case AND: case IOR: case XOR: - case MINUS: case NEG: case NOT: *total = COSTS_N_INSNS (1); - return true; + return false; - case MULT: - if (GET_MODE (XEXP (x, 0)) == DImode) - *total = COSTS_N_INSNS (40); - else - *total = COSTS_N_INSNS (7); - return true; + case PLUS: + case MINUS: + /* Check for multiply and add. */ + if ((GET_MODE (x) == DFmode || GET_MODE (x) == SFmode) + && GET_CODE (XEXP (x, 0)) == MULT + && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD) + { + /* This is the multiply and add case. */ + if (GET_MODE (x) == DFmode) + *total = s390_cost->madbr; + else + *total = s390_cost->maebr; + *total += rtx_cost (XEXP (XEXP (x, 0), 0), MULT) + + rtx_cost (XEXP (XEXP (x, 0), 1), MULT) + + rtx_cost (XEXP (x, 1), code); + return true; /* Do not do an additional recursive descent. */ + } + *total = COSTS_N_INSNS (1); + return false; + + case MULT: + switch (GET_MODE (x)) + { + case SImode: + { + rtx left = XEXP (x, 0); + rtx right = XEXP (x, 1); + if (GET_CODE (right) == CONST_INT + && CONST_OK_FOR_K (INTVAL (right))) + *total = s390_cost->mhi; + else if (GET_CODE (left) == SIGN_EXTEND) + *total = s390_cost->mh; + else + *total = s390_cost->ms; /* msr, ms, msy */ + break; + } + case DImode: + { + rtx left = XEXP (x, 0); + rtx right = XEXP (x, 1); + if (TARGET_64BIT) + { + if (GET_CODE (right) == CONST_INT + && CONST_OK_FOR_K (INTVAL (right))) + *total = s390_cost->mghi; + else if (GET_CODE (left) == SIGN_EXTEND) + *total = s390_cost->msgf; + else + *total = s390_cost->msg; /* msgr, msg */ + } + else /* TARGET_31BIT */ + { + if (GET_CODE (left) == SIGN_EXTEND + && GET_CODE (right) == SIGN_EXTEND) + /* mulsidi case: mr, m */ + *total = s390_cost->m; + else if (GET_CODE (left) == ZERO_EXTEND + && GET_CODE (right) == ZERO_EXTEND + && TARGET_CPU_ZARCH) + /* umulsidi case: ml, mlr */ + *total = s390_cost->ml; + else + /* Complex calculation is required. */ + *total = COSTS_N_INSNS (40); + } + break; + } + case SFmode: + case DFmode: + *total = s390_cost->mult_df; + break; + case TFmode: + *total = s390_cost->mxbr; + break; + default: + return false; + } + return false; + + case UDIV: + case UMOD: + if (GET_MODE (x) == TImode) /* 128 bit division */ + *total = s390_cost->dlgr; + else if (GET_MODE (x) == DImode) + { + rtx right = XEXP (x, 1); + if (GET_CODE (right) == ZERO_EXTEND) /* 64 by 32 bit division */ + *total = s390_cost->dlr; + else /* 64 by 64 bit division */ + *total = s390_cost->dlgr; + } + else if (GET_MODE (x) == SImode) /* 32 bit division */ + *total = s390_cost->dlr; + return false; case DIV: - case UDIV: case MOD: - case UMOD: - *total = COSTS_N_INSNS (33); - return true; + if (GET_MODE (x) == DImode) + { + rtx right = XEXP (x, 1); + if (GET_CODE (right) == ZERO_EXTEND) /* 64 by 32 bit division */ + if (TARGET_64BIT) + *total = s390_cost->dsgfr; + else + *total = s390_cost->dr; + else /* 64 by 64 bit division */ + *total = s390_cost->dsgr; + } + else if (GET_MODE (x) == SImode) /* 32 bit division */ + *total = s390_cost->dlr; + else if (GET_MODE (x) == SFmode) + { + if (TARGET_IEEE_FLOAT) + *total = s390_cost->debr; + else /* TARGET_IBM_FLOAT */ + *total = s390_cost->der; + } + else if (GET_MODE (x) == DFmode) + { + if (TARGET_IEEE_FLOAT) + *total = s390_cost->ddbr; + else /* TARGET_IBM_FLOAT */ + *total = s390_cost->ddr; + } + else if (GET_MODE (x) == TFmode) + { + if (TARGET_IEEE_FLOAT) + *total = s390_cost->dxbr; + else /* TARGET_IBM_FLOAT */ + *total = s390_cost->dxr; + } + return false; + + case SQRT: + if (GET_MODE (x) == SFmode) + *total = s390_cost->sqebr; + else if (GET_MODE (x) == DFmode) + *total = s390_cost->sqdbr; + else /* TFmode */ + *total = s390_cost->sqxbr; + return false; + + case SIGN_EXTEND: + case ZERO_EXTEND: + if (outer_code == MULT || outer_code == DIV || outer_code == MOD + || outer_code == PLUS || outer_code == MINUS + || outer_code == COMPARE) + *total = 0; + return false; + + case COMPARE: + *total = COSTS_N_INSNS (1); + if (GET_CODE (XEXP (x, 0)) == AND + && GET_CODE (XEXP (x, 1)) == CONST_INT + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) + { + rtx op0 = XEXP (XEXP (x, 0), 0); + rtx op1 = XEXP (XEXP (x, 0), 1); + rtx op2 = XEXP (x, 1); + + if (memory_operand (op0, GET_MODE (op0)) + && s390_tm_ccmode (op1, op2, 0) != VOIDmode) + return true; + if (register_operand (op0, GET_MODE (op0)) + && s390_tm_ccmode (op1, op2, 1) != VOIDmode) + return true; + } + return false; default: return false; @@ -1468,172 +2320,41 @@ s390_address_cost (rtx addr) return ad.indx? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (1); } -/* Return true if OP is a valid operand for the BRAS instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -bras_sym_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - register enum rtx_code code = GET_CODE (op); - - /* Allow SYMBOL_REFs. */ - if (code == SYMBOL_REF) - return 1; - - /* Allow @PLT stubs. */ - if (code == CONST - && GET_CODE (XEXP (op, 0)) == UNSPEC - && XINT (XEXP (op, 0), 1) == UNSPEC_PLT) - return 1; - return 0; -} - /* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode, otherwise return 0. */ int -tls_symbolic_operand (register rtx op) +tls_symbolic_operand (rtx op) { if (GET_CODE (op) != SYMBOL_REF) return 0; return SYMBOL_REF_TLS_MODEL (op); } -/* Return true if OP is a load multiple operation. It is known to be a - PARALLEL and the first section will be tested. - OP is the current operation. - MODE is the current operation mode. */ +/* Split DImode access register reference REG (on 64-bit) into its constituent + low and high parts, and store them into LO and HI. Note that gen_lowpart/ + gen_highpart cannot be used as they assume all registers are word-sized, + while our access registers have only half that size. */ -int -load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +void +s390_split_access_reg (rtx reg, rtx *lo, rtx *hi) { - enum machine_mode elt_mode; - int count = XVECLEN (op, 0); - unsigned int dest_regno; - rtx src_addr; - int i, off; + gcc_assert (TARGET_64BIT); + gcc_assert (ACCESS_REG_P (reg)); + gcc_assert (GET_MODE (reg) == DImode); + gcc_assert (!(REGNO (reg) & 1)); - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); - elt_mode = GET_MODE (SET_DEST (XVECEXP (op, 0, 0))); - - /* Check, is base, or base + displacement. */ - - if (GET_CODE (src_addr) == REG) - off = 0; - else if (GET_CODE (src_addr) == PLUS - && GET_CODE (XEXP (src_addr, 0)) == REG - && GET_CODE (XEXP (src_addr, 1)) == CONST_INT) - { - off = INTVAL (XEXP (src_addr, 1)); - src_addr = XEXP (src_addr, 0); - } - else - return 0; - - if (src_addr == frame_pointer_rtx || src_addr == arg_pointer_rtx) - return 0; - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != elt_mode - || REGNO (SET_DEST (elt)) != dest_regno + i - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != elt_mode - || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) - || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) - != off + i * GET_MODE_SIZE (elt_mode)) - return 0; - } - - return 1; + *lo = gen_rtx_REG (SImode, REGNO (reg) + 1); + *hi = gen_rtx_REG (SImode, REGNO (reg)); } -/* Return true if OP is a store multiple operation. It is known to be a - PARALLEL and the first section will be tested. - OP is the current operation. - MODE is the current operation mode. */ - -int -store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum machine_mode elt_mode; - int count = XVECLEN (op, 0); - unsigned int src_regno; - rtx dest_addr; - int i, off; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); - elt_mode = GET_MODE (SET_SRC (XVECEXP (op, 0, 0))); - - /* Check, is base, or base + displacement. */ - - if (GET_CODE (dest_addr) == REG) - off = 0; - else if (GET_CODE (dest_addr) == PLUS - && GET_CODE (XEXP (dest_addr, 0)) == REG - && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT) - { - off = INTVAL (XEXP (dest_addr, 1)); - dest_addr = XEXP (dest_addr, 0); - } - else - return 0; - - if (dest_addr == frame_pointer_rtx || dest_addr == arg_pointer_rtx) - return 0; - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != elt_mode - || REGNO (SET_SRC (elt)) != src_regno + i - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != elt_mode - || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) - || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) - != off + i * GET_MODE_SIZE (elt_mode)) - return 0; - } - return 1; -} - - /* Return true if OP contains a symbol reference */ -int +bool symbolic_reference_mentioned_p (rtx op) { - register const char *fmt; - register int i; + const char *fmt; + int i; if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) return 1; @@ -1643,7 +2364,7 @@ symbolic_reference_mentioned_p (rtx op) { if (fmt[i] == 'E') { - register int j; + int j; for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) @@ -1659,11 +2380,11 @@ symbolic_reference_mentioned_p (rtx op) /* Return true if OP contains a reference to a thread-local symbol. */ -int +bool tls_symbolic_reference_mentioned_p (rtx op) { - register const char *fmt; - register int i; + const char *fmt; + int i; if (GET_CODE (op) == SYMBOL_REF) return tls_symbolic_operand (op); @@ -1673,18 +2394,18 @@ tls_symbolic_reference_mentioned_p (rtx op) { if (fmt[i] == 'E') { - register int j; + int j; for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (tls_symbolic_reference_mentioned_p (XVECEXP (op, i, j))) - return 1; + return true; } else if (fmt[i] == 'e' && tls_symbolic_reference_mentioned_p (XEXP (op, i))) - return 1; + return true; } - return 0; + return false; } @@ -1693,7 +2414,7 @@ tls_symbolic_reference_mentioned_p (rtx op) and that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */ int -legitimate_pic_operand_p (register rtx op) +legitimate_pic_operand_p (rtx op) { /* Accept all non-symbolic constants. */ if (!SYMBOLIC_CONST (op)) @@ -1708,7 +2429,7 @@ legitimate_pic_operand_p (register rtx op) It is given that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */ int -legitimate_constant_p (register rtx op) +legitimate_constant_p (rtx op) { /* Accept all non-symbolic constants. */ if (!SYMBOLIC_CONST (op)) @@ -1784,13 +2505,18 @@ s390_cannot_force_const_mem (rtx x) case UNSPEC_INDNTPOFF: return false; + /* If the literal pool shares the code section, be put + execute template placeholders into the pool as well. */ + case UNSPEC_INSN: + return TARGET_CPU_ZARCH; + default: return true; } break; default: - abort (); + gcc_unreachable (); } } @@ -1800,31 +2526,55 @@ s390_cannot_force_const_mem (rtx x) a constant that would need to be forced to the literal pool before it can be used as operand. */ -int -legitimate_reload_constant_p (register rtx op) +bool +legitimate_reload_constant_p (rtx op) { /* Accept la(y) operands. */ if (GET_CODE (op) == CONST_INT && DISP_IN_RANGE (INTVAL (op))) - return 1; + return true; - /* Accept l(g)hi operands. */ + /* Accept l(g)hi/l(g)fi operands. */ if (GET_CODE (op) == CONST_INT - && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K")) - return 1; + && (CONST_OK_FOR_K (INTVAL (op)) || CONST_OK_FOR_Os (INTVAL (op)))) + return true; /* Accept lliXX operands. */ if (TARGET_ZARCH - && s390_single_part (op, DImode, HImode, 0) >= 0) - return 1; + && GET_CODE (op) == CONST_INT + && trunc_int_for_mode (INTVAL (op), word_mode) == INTVAL (op) + && s390_single_part (op, word_mode, HImode, 0) >= 0) + return true; + + if (TARGET_EXTIMM + && GET_CODE (op) == CONST_INT + && trunc_int_for_mode (INTVAL (op), word_mode) == INTVAL (op) + && s390_single_part (op, word_mode, SImode, 0) >= 0) + return true; /* Accept larl operands. */ if (TARGET_CPU_ZARCH && larl_operand (op, VOIDmode)) - return 1; + return true; + + /* Accept lzXX operands. */ + if (GET_CODE (op) == CONST_DOUBLE + && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, 'G', "G")) + return true; + + /* Accept double-word operands that can be split. */ + if (GET_CODE (op) == CONST_INT + && trunc_int_for_mode (INTVAL (op), word_mode) != INTVAL (op)) + { + enum machine_mode dword_mode = word_mode == SImode ? DImode : TImode; + rtx hi = operand_subword (op, 0, 0, dword_mode); + rtx lo = operand_subword (op, 1, 0, dword_mode); + return legitimate_reload_constant_p (hi) + && legitimate_reload_constant_p (lo); + } /* Everything else cannot be handled without reload. */ - return 0; + return false; } /* Given an rtx OP being reloaded into a reg required to be in class CLASS, @@ -1833,12 +2583,6 @@ legitimate_reload_constant_p (register rtx op) enum reg_class s390_preferred_reload_class (rtx op, enum reg_class class) { - /* This can happen if a floating point constant is being - reloaded into an integer register. Leave well alone. */ - if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT - && class != FP_REGS) - return class; - switch (GET_CODE (op)) { /* Constants we cannot reload must be forced into the @@ -1878,12 +2622,24 @@ s390_preferred_reload_class (rtx op, enum reg_class class) is not a legitimate operand of the LOAD ADDRESS instruction. */ enum reg_class -s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED, +s390_secondary_input_reload_class (enum reg_class class, enum machine_mode mode, rtx in) { if (s390_plus_operand (in, mode)) return ADDR_REGS; + if (reg_classes_intersect_p (FP_REGS, class) + && mode == TFmode + && GET_CODE (in) == MEM + && GET_CODE (XEXP (in, 0)) == PLUS + && GET_CODE (XEXP (XEXP (in, 0), 1)) == CONST_INT + && !DISP_IN_RANGE (INTVAL (XEXP (XEXP (in, 0), 1)) + + GET_MODE_SIZE (mode) - 1)) + return ADDR_REGS; + + if (reg_classes_intersect_p (CC_REGS, class)) + return GENERAL_REGS; + return NO_REGS; } @@ -1897,51 +2653,46 @@ enum reg_class s390_secondary_output_reload_class (enum reg_class class, enum machine_mode mode, rtx out) { - if ((TARGET_64BIT ? mode == TImode + if ((TARGET_64BIT ? (mode == TImode || mode == TFmode) : (mode == DImode || mode == DFmode)) && reg_classes_intersect_p (GENERAL_REGS, class) && GET_CODE (out) == MEM - && !offsettable_memref_p (out) - && !s_operand (out, VOIDmode)) + && GET_CODE (XEXP (out, 0)) == PLUS + && GET_CODE (XEXP (XEXP (out, 0), 0)) == PLUS + && GET_CODE (XEXP (XEXP (out, 0), 1)) == CONST_INT + && !DISP_IN_RANGE (INTVAL (XEXP (XEXP (out, 0), 1)) + + GET_MODE_SIZE (mode) - 1)) return ADDR_REGS; + if (reg_classes_intersect_p (FP_REGS, class) + && mode == TFmode + && GET_CODE (out) == MEM + && GET_CODE (XEXP (out, 0)) == PLUS + && GET_CODE (XEXP (XEXP (out, 0), 1)) == CONST_INT + && !DISP_IN_RANGE (INTVAL (XEXP (XEXP (out, 0), 1)) + + GET_MODE_SIZE (mode) - 1)) + return ADDR_REGS; + + if (reg_classes_intersect_p (CC_REGS, class)) + return GENERAL_REGS; + return NO_REGS; } -/* Return true if OP is a PLUS that is not a legitimate - operand for the LA instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -s390_plus_operand (register rtx op, enum machine_mode mode) -{ - if (!check_mode (op, &mode) || mode != Pmode) - return FALSE; - - if (GET_CODE (op) != PLUS) - return FALSE; - - if (legitimate_la_operand_p (op)) - return FALSE; - - return TRUE; -} - /* Generate code to load SRC, which is PLUS that is not a legitimate operand for the LA instruction, into TARGET. SCRATCH may be used as scratch register. */ void -s390_expand_plus_operand (register rtx target, register rtx src, - register rtx scratch) +s390_expand_plus_operand (rtx target, rtx src, + rtx scratch) { rtx sum1, sum2; struct s390_address ad; /* src must be a PLUS; get its two operands. */ - if (GET_CODE (src) != PLUS || GET_MODE (src) != Pmode) - abort (); + gcc_assert (GET_CODE (src) == PLUS); + gcc_assert (GET_MODE (src) == Pmode); /* Check if any of the two operands is already scheduled for replacement by reload. This can happen e.g. when @@ -1952,8 +2703,8 @@ s390_expand_plus_operand (register rtx target, register rtx src, /* If the address is already strictly valid, there's nothing to do. */ if (!s390_decompose_address (src, &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))) + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + || (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx)))) { /* Otherwise, one of the operands cannot be an address register; we reload its value into the scratch register. */ @@ -1975,7 +2726,7 @@ s390_expand_plus_operand (register rtx target, register rtx src, if (sum1 == scratch && sum2 == scratch) { debug_rtx (src); - abort (); + gcc_unreachable (); } src = gen_rtx_PLUS (Pmode, sum1, sum2); @@ -1988,314 +2739,83 @@ s390_expand_plus_operand (register rtx target, register rtx src, } -/* Decompose a RTL expression ADDR for a memory address into - its components, returned in OUT. - - Returns 0 if ADDR is not a valid memory address, nonzero - otherwise. If OUT is NULL, don't return the components, - but check for validity only. - - Note: Only addresses in canonical form are recognized. - LEGITIMIZE_ADDRESS should convert non-canonical forms to the - canonical form so that they will be recognized. */ - -static int -s390_decompose_address (register rtx addr, struct s390_address *out) -{ - rtx base = NULL_RTX; - rtx indx = NULL_RTX; - rtx disp = NULL_RTX; - int pointer = FALSE; - int base_ptr = FALSE; - int indx_ptr = FALSE; - - /* Decompose address into base + index + displacement. */ - - if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC) - base = addr; - - else if (GET_CODE (addr) == PLUS) - { - rtx op0 = XEXP (addr, 0); - rtx op1 = XEXP (addr, 1); - enum rtx_code code0 = GET_CODE (op0); - enum rtx_code code1 = GET_CODE (op1); - - if (code0 == REG || code0 == UNSPEC) - { - if (code1 == REG || code1 == UNSPEC) - { - indx = op0; /* index + base */ - base = op1; - } - - else - { - base = op0; /* base + displacement */ - disp = op1; - } - } - - else if (code0 == PLUS) - { - indx = XEXP (op0, 0); /* index + base + disp */ - base = XEXP (op0, 1); - disp = op1; - } - - else - { - return FALSE; - } - } - - else - disp = addr; /* displacement */ - - - /* Validate base register. */ - if (base) - { - if (GET_CODE (base) == UNSPEC) - { - if (XVECLEN (base, 0) != 1 || XINT (base, 1) != UNSPEC_LTREL_BASE) - return FALSE; - base = gen_rtx_REG (Pmode, BASE_REGISTER); - } - - if (GET_CODE (base) != REG || GET_MODE (base) != Pmode) - return FALSE; - - if (REGNO (base) == BASE_REGISTER - || REGNO (base) == STACK_POINTER_REGNUM - || REGNO (base) == FRAME_POINTER_REGNUM - || ((reload_completed || reload_in_progress) - && frame_pointer_needed - && REGNO (base) == HARD_FRAME_POINTER_REGNUM) - || REGNO (base) == ARG_POINTER_REGNUM - || (flag_pic - && REGNO (base) == PIC_OFFSET_TABLE_REGNUM)) - pointer = base_ptr = TRUE; - } - - /* Validate index register. */ - if (indx) - { - if (GET_CODE (indx) == UNSPEC) - { - if (XVECLEN (indx, 0) != 1 || XINT (indx, 1) != UNSPEC_LTREL_BASE) - return FALSE; - indx = gen_rtx_REG (Pmode, BASE_REGISTER); - } - - if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode) - return FALSE; - - if (REGNO (indx) == BASE_REGISTER - || REGNO (indx) == STACK_POINTER_REGNUM - || REGNO (indx) == FRAME_POINTER_REGNUM - || ((reload_completed || reload_in_progress) - && frame_pointer_needed - && REGNO (indx) == HARD_FRAME_POINTER_REGNUM) - || REGNO (indx) == ARG_POINTER_REGNUM - || (flag_pic - && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM)) - pointer = indx_ptr = TRUE; - } - - /* Prefer to use pointer as base, not index. */ - if (base && indx && !base_ptr - && (indx_ptr || (!REG_POINTER (base) && REG_POINTER (indx)))) - { - rtx tmp = base; - base = indx; - indx = tmp; - } - - /* Validate displacement. */ - if (disp) - { - /* Allow integer constant in range. */ - if (GET_CODE (disp) == CONST_INT) - { - /* If the argument pointer is involved, the displacement will change - later anyway as the argument pointer gets eliminated. This could - make a valid displacement invalid, but it is more likely to make - an invalid displacement valid, because we sometimes access the - register save area via negative offsets to the arg pointer. - Thus we don't check the displacement for validity here. If after - elimination the displacement turns out to be invalid after all, - this is fixed up by reload in any case. */ - if (base != arg_pointer_rtx && indx != arg_pointer_rtx) - { - if (!DISP_IN_RANGE (INTVAL (disp))) - return FALSE; - } - } - - /* In the small-PIC case, the linker converts @GOT - and @GOTNTPOFF offsets to possible displacements. */ - else if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == UNSPEC - && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT - || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF)) - { - if (flag_pic != 1) - return FALSE; - - pointer = TRUE; - } - - /* Accept chunkfied literal pool symbol references. */ - else if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == MINUS - && GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF - && GET_CODE (XEXP (XEXP (disp, 0), 1)) == LABEL_REF) - { - pointer = TRUE; - } - - /* Likewise if a constant offset is present. */ - else if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == PLUS - && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (disp, 0), 0)) == MINUS - && GET_CODE (XEXP (XEXP (XEXP (disp, 0), 0), 0)) == LABEL_REF - && GET_CODE (XEXP (XEXP (XEXP (disp, 0), 0), 1)) == LABEL_REF) - { - pointer = TRUE; - } - - /* We can convert literal pool addresses to - displacements by basing them off the base register. */ - else - { - /* In some cases, we can accept an additional - small constant offset. Split these off here. */ - - unsigned int offset = 0; - - if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == PLUS - && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) - { - offset = INTVAL (XEXP (XEXP (disp, 0), 1)); - disp = XEXP (XEXP (disp, 0), 0); - } - - /* Now we must have a literal pool address. */ - if (GET_CODE (disp) != SYMBOL_REF - || !CONSTANT_POOL_ADDRESS_P (disp)) - return FALSE; - - /* If we have an offset, make sure it does not - exceed the size of the constant pool entry. */ - if (offset && offset >= GET_MODE_SIZE (get_pool_mode (disp))) - return FALSE; - - /* Either base or index must be free to - hold the base register. */ - if (base && indx) - return FALSE; - - /* Convert the address. */ - if (base) - indx = gen_rtx_REG (Pmode, BASE_REGISTER); - else - base = gen_rtx_REG (Pmode, BASE_REGISTER); - - disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), - UNSPEC_LTREL_OFFSET); - disp = gen_rtx_CONST (Pmode, disp); - - if (offset) - disp = plus_constant (disp, offset); - - pointer = TRUE; - } - } - - if (!base && !indx) - pointer = TRUE; - - if (out) - { - out->base = base; - out->indx = indx; - out->disp = disp; - out->pointer = pointer; - } - - return TRUE; -} - -/* Return nonzero if ADDR is a valid memory address. +/* Return true if ADDR is a valid memory address. STRICT specifies whether strict register checking applies. */ -int +bool legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, - register rtx addr, int strict) + rtx addr, int strict) { struct s390_address ad; if (!s390_decompose_address (addr, &ad)) - return FALSE; + return false; if (strict) { - if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - return FALSE; - if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx)) - return FALSE; + if (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + return false; + + if (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx))) + return false; } else { - if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base)) - return FALSE; - if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx)) - return FALSE; + if (ad.base + && !(REGNO (ad.base) >= FIRST_PSEUDO_REGISTER + || REGNO_REG_CLASS (REGNO (ad.base)) == ADDR_REGS)) + return false; + + if (ad.indx + && !(REGNO (ad.indx) >= FIRST_PSEUDO_REGISTER + || REGNO_REG_CLASS (REGNO (ad.indx)) == ADDR_REGS)) + return false; } - - return TRUE; + return true; } -/* Return 1 if OP is a valid operand for the LA instruction. +/* Return true if OP is a valid operand for the LA instruction. In 31-bit, we need to prove that the result is used as an address, as LA performs only a 31-bit addition. */ -int -legitimate_la_operand_p (register rtx op) +bool +legitimate_la_operand_p (rtx op) { struct s390_address addr; if (!s390_decompose_address (op, &addr)) - return FALSE; + return false; - if (TARGET_64BIT || addr.pointer) - return TRUE; - - return FALSE; + return (TARGET_64BIT || addr.pointer); } -/* Return 1 if OP is a valid operand for the LA instruction, - and we prefer to use LA over addition to compute it. */ +/* Return true if it is valid *and* preferable to use LA to + compute the sum of OP1 and OP2. */ -int -preferred_la_operand_p (register rtx op) +bool +preferred_la_operand_p (rtx op1, rtx op2) { struct s390_address addr; - if (!s390_decompose_address (op, &addr)) - return FALSE; + + if (op2 != const0_rtx) + op1 = gen_rtx_PLUS (Pmode, op1, op2); + + if (!s390_decompose_address (op1, &addr)) + return false; + if (addr.base && !REGNO_OK_FOR_BASE_P (REGNO (addr.base))) + return false; + if (addr.indx && !REGNO_OK_FOR_INDEX_P (REGNO (addr.indx))) + return false; if (!TARGET_64BIT && !addr.pointer) - return FALSE; + return false; if (addr.pointer) - return TRUE; + return true; if ((addr.base && REG_P (addr.base) && REG_POINTER (addr.base)) || (addr.indx && REG_P (addr.indx) && REG_POINTER (addr.indx))) - return TRUE; + return true; - return FALSE; + return false; } /* Emit a forced load-address operation to load SRC into DST. @@ -2336,6 +2856,8 @@ legitimize_pic_address (rtx orig, rtx reg) rtx new = orig; rtx base; + gcc_assert (!TLS_SYMBOLIC_CONST (addr)); + if (GET_CODE (addr) == LABEL_REF || (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (addr))) { @@ -2363,7 +2885,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); if (reg != 0) { - emit_move_insn (reg, new); + s390_load_address (reg, new); new = reg; } } @@ -2384,8 +2906,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT); new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); emit_move_insn (reg, new); new = reg; } @@ -2400,8 +2921,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_CONST (Pmode, new); emit_move_insn (temp, new); - new = gen_rtx_MEM (Pmode, temp); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, temp); emit_move_insn (reg, new); new = reg; } @@ -2421,8 +2941,7 @@ legitimize_pic_address (rtx orig, rtx reg) emit_move_insn (temp, addr); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); emit_move_insn (reg, new); new = reg; } @@ -2434,8 +2953,7 @@ legitimize_pic_address (rtx orig, rtx reg) addr = XEXP (addr, 0); if (GET_CODE (addr) == UNSPEC) { - if (XVECLEN (addr, 0) != 1) - abort (); + gcc_assert (XVECLEN (addr, 0) == 1); switch (XINT (addr, 1)) { /* If someone moved a GOT-relative UNSPEC @@ -2475,7 +2993,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); if (reg != 0) { - emit_move_insn (reg, new); + s390_load_address (reg, new); new = reg; } } @@ -2483,22 +3001,29 @@ legitimize_pic_address (rtx orig, rtx reg) /* Everything else cannot happen. */ default: - abort (); + gcc_unreachable (); } } - else if (GET_CODE (addr) != PLUS) - abort (); + else + gcc_assert (GET_CODE (addr) == PLUS); } if (GET_CODE (addr) == PLUS) { rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1); + + gcc_assert (!TLS_SYMBOLIC_CONST (op0)); + gcc_assert (!TLS_SYMBOLIC_CONST (op1)); + /* Check first to see if this is a constant offset from a local symbol reference. */ if ((GET_CODE (op0) == LABEL_REF || (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (op0))) && GET_CODE (op1) == CONST_INT) { - if (TARGET_CPU_ZARCH && larl_operand (op0, VOIDmode)) + if (TARGET_CPU_ZARCH + && larl_operand (op0, VOIDmode) + && INTVAL (op1) < (HOST_WIDE_INT)1 << 31 + && INTVAL (op1) >= -((HOST_WIDE_INT)1 << 31)) { if (INTVAL (op1) & 1) { @@ -2508,10 +3033,10 @@ legitimize_pic_address (rtx orig, rtx reg) if (!DISP_IN_RANGE (INTVAL (op1))) { - int even = INTVAL (op1) - 1; + HOST_WIDE_INT even = INTVAL (op1) - 1; op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even)); op0 = gen_rtx_CONST (Pmode, op0); - op1 = GEN_INT (1); + op1 = const1_rtx; } emit_move_insn (temp, op0); @@ -2519,7 +3044,7 @@ legitimize_pic_address (rtx orig, rtx reg) if (reg != 0) { - emit_move_insn (reg, new); + s390_load_address (reg, new); new = reg; } } @@ -2548,7 +3073,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); if (reg != 0) { - emit_move_insn (reg, new); + s390_load_address (reg, new); new = reg; } } @@ -2561,8 +3086,7 @@ legitimize_pic_address (rtx orig, rtx reg) && GET_CODE (op1) == CONST_INT && XINT (op0, 1) == UNSPEC_GOTOFF) { - if (XVECLEN (op0, 0) != 1) - abort (); + gcc_assert (XVECLEN (op0, 0) == 1); new = force_const_mem (Pmode, orig); } @@ -2596,28 +3120,39 @@ legitimize_pic_address (rtx orig, rtx reg) /* Load the thread pointer into a register. */ -static rtx -get_thread_pointer (void) +rtx +s390_get_thread_pointer (void) { - rtx tp; + rtx tp = gen_reg_rtx (Pmode); - tp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_TP); - tp = force_reg (Pmode, tp); + emit_move_insn (tp, gen_rtx_REG (Pmode, TP_REGNUM)); mark_reg_pointer (tp, BITS_PER_WORD); return tp; } -/* Construct the SYMBOL_REF for the tls_get_offset function. */ +/* Emit a tls call insn. The call target is the SYMBOL_REF stored + in s390_tls_symbol which always refers to __tls_get_offset. + The returned offset is written to RESULT_REG and an USE rtx is + generated for TLS_CALL. */ static GTY(()) rtx s390_tls_symbol; -rtx -s390_tls_get_offset (void) + +static void +s390_emit_tls_call_insn (rtx result_reg, rtx tls_call) { + rtx insn; + + gcc_assert (flag_pic); + if (!s390_tls_symbol) s390_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_offset"); - return s390_tls_symbol; + insn = s390_emit_call (s390_tls_symbol, tls_call, result_reg, + gen_rtx_REG (Pmode, RETURN_REGNUM)); + + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), result_reg); + CONST_OR_PURE_CALL_P (insn) = 1; } /* ADDR contains a thread-local SYMBOL_REF. Generate code to compute @@ -2638,7 +3173,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = gen_rtx_CONST (Pmode, tls_call); new = force_const_mem (Pmode, new); emit_move_insn (r2, new); - emit_call_insn (gen_call_value_tls (r2, tls_call)); + s390_emit_tls_call_insn (r2, tls_call); insn = get_insns (); end_sequence (); @@ -2646,7 +3181,7 @@ legitimize_tls_address (rtx addr, rtx reg) temp = gen_reg_rtx (Pmode); emit_libcall_block (insn, temp, r2, new); - new = gen_rtx_PLUS (Pmode, get_thread_pointer (), temp); + new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp); if (reg != 0) { s390_load_address (reg, new); @@ -2661,7 +3196,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = gen_rtx_CONST (Pmode, tls_call); new = force_const_mem (Pmode, new); emit_move_insn (r2, new); - emit_call_insn (gen_call_value_tls (r2, tls_call)); + s390_emit_tls_call_insn (r2, tls_call); insn = get_insns (); end_sequence (); @@ -2669,7 +3204,7 @@ legitimize_tls_address (rtx addr, rtx reg) temp = gen_reg_rtx (Pmode); emit_libcall_block (insn, temp, r2, new); - new = gen_rtx_PLUS (Pmode, get_thread_pointer (), temp); + new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp); base = gen_reg_rtx (Pmode); s390_load_address (base, new); @@ -2699,8 +3234,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTNTPOFF); new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); } @@ -2714,8 +3248,7 @@ legitimize_tls_address (rtx addr, rtx reg) temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); - new = gen_rtx_MEM (Pmode, temp); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, temp); temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); } @@ -2734,8 +3267,7 @@ legitimize_tls_address (rtx addr, rtx reg) emit_move_insn (temp, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + new = gen_const_mem (Pmode, new); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD); temp = gen_reg_rtx (Pmode); @@ -2753,15 +3285,13 @@ legitimize_tls_address (rtx addr, rtx reg) emit_move_insn (temp, new); new = temp; - new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; - + new = gen_const_mem (Pmode, new); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD); temp = gen_reg_rtx (Pmode); emit_insn (gen_rtx_SET (Pmode, temp, new)); } - new = gen_rtx_PLUS (Pmode, get_thread_pointer (), temp); + new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp); if (reg != 0) { s390_load_address (reg, new); @@ -2776,7 +3306,7 @@ legitimize_tls_address (rtx addr, rtx reg) temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); - new = gen_rtx_PLUS (Pmode, get_thread_pointer (), temp); + new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp); if (reg != 0) { s390_load_address (reg, new); @@ -2785,7 +3315,7 @@ legitimize_tls_address (rtx addr, rtx reg) break; default: - abort (); + gcc_unreachable (); } else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == UNSPEC) @@ -2793,19 +3323,29 @@ legitimize_tls_address (rtx addr, rtx reg) switch (XINT (XEXP (addr, 0), 1)) { case UNSPEC_INDNTPOFF: - if (TARGET_CPU_ZARCH) - new = addr; - else - abort (); + gcc_assert (TARGET_CPU_ZARCH); + new = addr; break; default: - abort (); + gcc_unreachable (); } } + else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST_INT) + { + new = XEXP (XEXP (addr, 0), 0); + if (GET_CODE (new) != SYMBOL_REF) + new = gen_rtx_CONST (Pmode, new); + + new = legitimize_tls_address (new, reg); + new = plus_constant (new, INTVAL (XEXP (XEXP (addr, 0), 1))); + new = force_operand (new, 0); + } + else - abort (); /* for now ... */ + gcc_unreachable (); /* for now ... */ return new; } @@ -2837,7 +3377,7 @@ emit_symbolic_move (rtx *operands) See comments by legitimize_pic_address for details. */ rtx -legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, +legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED) { rtx constant_term = const0_rtx; @@ -2849,6 +3389,12 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, if (legitimate_address_p (mode, x, FALSE)) return x; } + else if (GET_CODE (x) == PLUS + && (TLS_SYMBOLIC_CONST (XEXP (x, 0)) + || TLS_SYMBOLIC_CONST (XEXP (x, 1)))) + { + return x; + } else if (flag_pic) { if (SYMBOLIC_CONST (x) @@ -2892,8 +3438,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, { if (GET_CODE (XEXP (x, 0)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 1), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 1), temp); if (val != temp) emit_move_insn (temp, val); @@ -2902,8 +3448,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, else if (GET_CODE (XEXP (x, 1)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 0), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 0), temp); if (val != temp) emit_move_insn (temp, val); @@ -2917,37 +3463,80 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, return x; } +/* Try a machine-dependent way of reloading an illegitimate address AD + operand. If we find one, push the reload and and return the new address. + + MODE is the mode of the enclosing MEM. OPNUM is the operand number + and TYPE is the reload type of the current reload. */ + +rtx +legitimize_reload_address (rtx ad, enum machine_mode mode ATTRIBUTE_UNUSED, + int opnum, int type) +{ + if (!optimize || TARGET_LONG_DISPLACEMENT) + return NULL_RTX; + + if (GET_CODE (ad) == PLUS) + { + rtx tem = simplify_binary_operation (PLUS, Pmode, + XEXP (ad, 0), XEXP (ad, 1)); + if (tem) + ad = tem; + } + + if (GET_CODE (ad) == PLUS + && GET_CODE (XEXP (ad, 0)) == REG + && GET_CODE (XEXP (ad, 1)) == CONST_INT + && !DISP_IN_RANGE (INTVAL (XEXP (ad, 1)))) + { + HOST_WIDE_INT lower = INTVAL (XEXP (ad, 1)) & 0xfff; + HOST_WIDE_INT upper = INTVAL (XEXP (ad, 1)) ^ lower; + rtx cst, tem, new; + + cst = GEN_INT (upper); + if (!legitimate_reload_constant_p (cst)) + cst = force_const_mem (Pmode, cst); + + tem = gen_rtx_PLUS (Pmode, XEXP (ad, 0), cst); + new = gen_rtx_PLUS (Pmode, tem, GEN_INT (lower)); + + push_reload (XEXP (tem, 1), 0, &XEXP (tem, 1), 0, + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, + opnum, (enum reload_type) type); + return new; + } + + return NULL_RTX; +} + /* Emit code to move LEN bytes from DST to SRC. */ void -s390_expand_movstr (rtx dst, rtx src, rtx len) +s390_expand_movmem (rtx dst, rtx src, rtx len) { if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256) { if (INTVAL (len) > 0) - emit_insn (gen_movstr_short (dst, src, GEN_INT (INTVAL (len) - 1))); + emit_insn (gen_movmem_short (dst, src, GEN_INT (INTVAL (len) - 1))); } else if (TARGET_MVCLE) { - emit_insn (gen_movstr_long (dst, src, convert_to_mode (Pmode, len, 1))); + emit_insn (gen_movmem_long (dst, src, convert_to_mode (Pmode, len, 1))); } else { rtx dst_addr, src_addr, count, blocks, temp; + rtx loop_start_label = gen_label_rtx (); + rtx loop_end_label = gen_label_rtx (); rtx end_label = gen_label_rtx (); enum machine_mode mode; - tree type; mode = GET_MODE (len); if (mode == VOIDmode) mode = Pmode; - type = lang_hooks.types.type_for_mode (mode, 1); - if (!type) - abort (); - dst_addr = gen_reg_rtx (Pmode); src_addr = gen_reg_rtx (Pmode); count = gen_reg_rtx (mode); @@ -2966,16 +3555,16 @@ s390_expand_movstr (rtx dst, rtx src, rtx len) if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); - expand_start_loop (1); - expand_exit_loop_top_cond (0, build (NE_EXPR, type, - make_tree (type, blocks), - make_tree (type, const0_rtx))); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); - emit_insn (gen_movstr_short (dst, src, GEN_INT (255))); + emit_label (loop_start_label); + + emit_insn (gen_movmem_short (dst, src, GEN_INT (255))); s390_load_address (dst_addr, gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256))); s390_load_address (src_addr, @@ -2985,45 +3574,72 @@ s390_expand_movstr (rtx dst, rtx src, rtx len) if (temp != blocks) emit_move_insn (blocks, temp); - expand_end_loop (); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); - emit_insn (gen_movstr_short (dst, src, + emit_jump (loop_start_label); + emit_label (loop_end_label); + + emit_insn (gen_movmem_short (dst, src, convert_to_mode (Pmode, count, 1))); emit_label (end_label); } } -/* Emit code to clear LEN bytes at DST. */ +/* Emit code to set LEN bytes at DST to VAL. + Make use of clrmem if VAL is zero. */ void -s390_expand_clrstr (rtx dst, rtx len) +s390_expand_setmem (rtx dst, rtx len, rtx val) { - if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256) + if (GET_CODE (len) == CONST_INT && INTVAL (len) == 0) + return; + + gcc_assert (GET_CODE (val) == CONST_INT || GET_MODE (val) == QImode); + + if (GET_CODE (len) == CONST_INT && INTVAL (len) > 0 && INTVAL (len) <= 257) { - if (INTVAL (len) > 0) - emit_insn (gen_clrstr_short (dst, GEN_INT (INTVAL (len) - 1))); + if (val == const0_rtx && INTVAL (len) <= 256) + emit_insn (gen_clrmem_short (dst, GEN_INT (INTVAL (len) - 1))); + else + { + /* Initialize memory by storing the first byte. */ + emit_move_insn (adjust_address (dst, QImode, 0), val); + + if (INTVAL (len) > 1) + { + /* Initiate 1 byte overlap move. + The first byte of DST is propagated through DSTP1. + Prepare a movmem for: DST+1 = DST (length = LEN - 1). + DST is set to size 1 so the rest of the memory location + does not count as source operand. */ + rtx dstp1 = adjust_address (dst, VOIDmode, 1); + set_mem_size (dst, const1_rtx); + + emit_insn (gen_movmem_short (dstp1, dst, + GEN_INT (INTVAL (len) - 2))); + } + } } else if (TARGET_MVCLE) { - emit_insn (gen_clrstr_long (dst, convert_to_mode (Pmode, len, 1))); + val = force_not_mem (convert_modes (Pmode, QImode, val, 1)); + emit_insn (gen_setmem_long (dst, convert_to_mode (Pmode, len, 1), val)); } else { - rtx dst_addr, src_addr, count, blocks, temp; + rtx dst_addr, src_addr, count, blocks, temp, dstp1 = NULL_RTX; + rtx loop_start_label = gen_label_rtx (); + rtx loop_end_label = gen_label_rtx (); rtx end_label = gen_label_rtx (); enum machine_mode mode; - tree type; mode = GET_MODE (len); if (mode == VOIDmode) mode = Pmode; - type = lang_hooks.types.type_for_mode (mode, 1); - if (!type) - abort (); - dst_addr = gen_reg_rtx (Pmode); src_addr = gen_reg_rtx (Pmode); count = gen_reg_rtx (mode); @@ -3036,20 +3652,38 @@ s390_expand_clrstr (rtx dst, rtx len) emit_move_insn (dst_addr, force_operand (XEXP (dst, 0), NULL_RTX)); dst = change_address (dst, VOIDmode, dst_addr); - temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0); + if (val == const0_rtx) + temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0); + else + { + dstp1 = adjust_address (dst, VOIDmode, 1); + set_mem_size (dst, const1_rtx); + + /* Initialize memory by storing the first byte. */ + emit_move_insn (adjust_address (dst, QImode, 0), val); + + /* If count is 1 we are done. */ + emit_cmp_and_jump_insns (count, const1_rtx, + EQ, NULL_RTX, mode, 1, end_label); + + temp = expand_binop (mode, add_optab, count, GEN_INT (-2), count, 1, 0); + } if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); - expand_start_loop (1); - expand_exit_loop_top_cond (0, build (NE_EXPR, type, - make_tree (type, blocks), - make_tree (type, const0_rtx))); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); - emit_insn (gen_clrstr_short (dst, GEN_INT (255))); + emit_label (loop_start_label); + + if (val == const0_rtx) + emit_insn (gen_clrmem_short (dst, GEN_INT (255))); + else + emit_insn (gen_movmem_short (dstp1, dst, GEN_INT (255))); s390_load_address (dst_addr, gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256))); @@ -3057,9 +3691,16 @@ s390_expand_clrstr (rtx dst, rtx len) if (temp != blocks) emit_move_insn (blocks, temp); - expand_end_loop (); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); - emit_insn (gen_clrstr_short (dst, convert_to_mode (Pmode, count, 1))); + emit_jump (loop_start_label); + emit_label (loop_end_label); + + if (val == const0_rtx) + emit_insn (gen_clrmem_short (dst, convert_to_mode (Pmode, count, 1))); + else + emit_insn (gen_movmem_short (dstp1, dst, convert_to_mode (Pmode, count, 1))); emit_label (end_label); } } @@ -3070,48 +3711,40 @@ s390_expand_clrstr (rtx dst, rtx len) void s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) { - rtx (*gen_result) (rtx) = - GET_MODE (target) == DImode ? gen_cmpint_di : gen_cmpint_si; + rtx ccreg = gen_rtx_REG (CCUmode, CC_REGNUM); + rtx tmp; - op0 = protect_from_queue (op0, 0); - op1 = protect_from_queue (op1, 0); - len = protect_from_queue (len, 0); + /* As the result of CMPINT is inverted compared to what we need, + we have to swap the operands. */ + tmp = op0; op0 = op1; op1 = tmp; if (GET_CODE (len) == CONST_INT && INTVAL (len) >= 0 && INTVAL (len) <= 256) { if (INTVAL (len) > 0) { emit_insn (gen_cmpmem_short (op0, op1, GEN_INT (INTVAL (len) - 1))); - emit_insn (gen_result (target)); + emit_insn (gen_cmpint (target, ccreg)); } else emit_move_insn (target, const0_rtx); } - - else /* if (TARGET_MVCLE) */ + else if (TARGET_MVCLE) { emit_insn (gen_cmpmem_long (op0, op1, convert_to_mode (Pmode, len, 1))); - emit_insn (gen_result (target)); + emit_insn (gen_cmpint (target, ccreg)); } - -#if 0 - /* Deactivate for now as profile code cannot cope with - CC being live across basic block boundaries. */ else { rtx addr0, addr1, count, blocks, temp; + rtx loop_start_label = gen_label_rtx (); + rtx loop_end_label = gen_label_rtx (); rtx end_label = gen_label_rtx (); enum machine_mode mode; - tree type; mode = GET_MODE (len); if (mode == VOIDmode) mode = Pmode; - type = lang_hooks.types.type_for_mode (mode, 1); - if (!type) - abort (); - addr0 = gen_reg_rtx (Pmode); addr1 = gen_reg_rtx (Pmode); count = gen_reg_rtx (mode); @@ -3130,17 +3763,17 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, ashr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); if (temp != blocks) emit_move_insn (blocks, temp); - expand_start_loop (1); - expand_exit_loop_top_cond (0, build (NE_EXPR, type, - make_tree (type, blocks), - make_tree (type, const0_rtx))); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); + + emit_label (loop_start_label); emit_insn (gen_cmpmem_short (op0, op1, GEN_INT (255))); - temp = gen_rtx_NE (VOIDmode, gen_rtx_REG (CCSmode, 33), const0_rtx); + temp = gen_rtx_NE (VOIDmode, ccreg, const0_rtx); temp = gen_rtx_IF_THEN_ELSE (VOIDmode, temp, gen_rtx_LABEL_REF (VOIDmode, end_label), pc_rtx); temp = gen_rtx_SET (VOIDmode, pc_rtx, temp); @@ -3155,21 +3788,540 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) if (temp != blocks) emit_move_insn (blocks, temp); - expand_end_loop (); + emit_cmp_and_jump_insns (blocks, const0_rtx, + EQ, NULL_RTX, mode, 1, loop_end_label); - emit_insn (gen_cmpmem_short (op0, op1, + emit_jump (loop_start_label); + emit_label (loop_end_label); + + emit_insn (gen_cmpmem_short (op0, op1, convert_to_mode (Pmode, count, 1))); emit_label (end_label); - emit_insn (gen_result (target)); + emit_insn (gen_cmpint (target, ccreg)); } -#endif } -/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. - We need to emit DTP-relative relocations. */ + +/* Expand conditional increment or decrement using alc/slb instructions. + Should generate code setting DST to either SRC or SRC + INCREMENT, + depending on the result of the comparison CMP_OP0 CMP_CODE CMP_OP1. + Returns true if successful, false otherwise. + + That makes it possible to implement some if-constructs without jumps e.g.: + (borrow = CC0 | CC1 and carry = CC2 | CC3) + unsigned int a, b, c; + if (a < b) c++; -> CCU b > a -> CC2; c += carry; + if (a < b) c--; -> CCL3 a - b -> borrow; c -= borrow; + if (a <= b) c++; -> CCL3 b - a -> borrow; c += carry; + if (a <= b) c--; -> CCU a <= b -> borrow; c -= borrow; + + Checks for EQ and NE with a nonzero value need an additional xor e.g.: + if (a == b) c++; -> CCL3 a ^= b; 0 - a -> borrow; c += carry; + if (a == b) c--; -> CCU a ^= b; a <= 0 -> CC0 | CC1; c -= borrow; + if (a != b) c++; -> CCU a ^= b; a > 0 -> CC2; c += carry; + if (a != b) c--; -> CCL3 a ^= b; 0 - a -> borrow; c -= borrow; */ + +bool +s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1, + rtx dst, rtx src, rtx increment) +{ + enum machine_mode cmp_mode; + enum machine_mode cc_mode; + rtx op_res; + rtx insn; + rtvec p; + int ret; + + if ((GET_MODE (cmp_op0) == SImode || GET_MODE (cmp_op0) == VOIDmode) + && (GET_MODE (cmp_op1) == SImode || GET_MODE (cmp_op1) == VOIDmode)) + cmp_mode = SImode; + else if ((GET_MODE (cmp_op0) == DImode || GET_MODE (cmp_op0) == VOIDmode) + && (GET_MODE (cmp_op1) == DImode || GET_MODE (cmp_op1) == VOIDmode)) + cmp_mode = DImode; + else + return false; + + /* Try ADD LOGICAL WITH CARRY. */ + if (increment == const1_rtx) + { + /* Determine CC mode to use. */ + if (cmp_code == EQ || cmp_code == NE) + { + if (cmp_op1 != const0_rtx) + { + cmp_op0 = expand_simple_binop (cmp_mode, XOR, cmp_op0, cmp_op1, + NULL_RTX, 0, OPTAB_WIDEN); + cmp_op1 = const0_rtx; + } + + cmp_code = cmp_code == EQ ? LEU : GTU; + } + + if (cmp_code == LTU || cmp_code == LEU) + { + rtx tem = cmp_op0; + cmp_op0 = cmp_op1; + cmp_op1 = tem; + cmp_code = swap_condition (cmp_code); + } + + switch (cmp_code) + { + case GTU: + cc_mode = CCUmode; + break; + + case GEU: + cc_mode = CCL3mode; + break; + + default: + return false; + } + + /* Emit comparison instruction pattern. */ + if (!register_operand (cmp_op0, cmp_mode)) + cmp_op0 = force_reg (cmp_mode, cmp_op0); + + insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM), + gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1)); + /* We use insn_invalid_p here to add clobbers if required. */ + ret = insn_invalid_p (emit_insn (insn)); + gcc_assert (!ret); + + /* Emit ALC instruction pattern. */ + op_res = gen_rtx_fmt_ee (cmp_code, GET_MODE (dst), + gen_rtx_REG (cc_mode, CC_REGNUM), + const0_rtx); + + if (src != const0_rtx) + { + if (!register_operand (src, GET_MODE (dst))) + src = force_reg (GET_MODE (dst), src); + + src = gen_rtx_PLUS (GET_MODE (dst), src, const0_rtx); + op_res = gen_rtx_PLUS (GET_MODE (dst), src, op_res); + } + + p = rtvec_alloc (2); + RTVEC_ELT (p, 0) = + gen_rtx_SET (VOIDmode, dst, op_res); + RTVEC_ELT (p, 1) = + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM)); + emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); + + return true; + } + + /* Try SUBTRACT LOGICAL WITH BORROW. */ + if (increment == constm1_rtx) + { + /* Determine CC mode to use. */ + if (cmp_code == EQ || cmp_code == NE) + { + if (cmp_op1 != const0_rtx) + { + cmp_op0 = expand_simple_binop (cmp_mode, XOR, cmp_op0, cmp_op1, + NULL_RTX, 0, OPTAB_WIDEN); + cmp_op1 = const0_rtx; + } + + cmp_code = cmp_code == EQ ? LEU : GTU; + } + + if (cmp_code == GTU || cmp_code == GEU) + { + rtx tem = cmp_op0; + cmp_op0 = cmp_op1; + cmp_op1 = tem; + cmp_code = swap_condition (cmp_code); + } + + switch (cmp_code) + { + case LEU: + cc_mode = CCUmode; + break; + + case LTU: + cc_mode = CCL3mode; + break; + + default: + return false; + } + + /* Emit comparison instruction pattern. */ + if (!register_operand (cmp_op0, cmp_mode)) + cmp_op0 = force_reg (cmp_mode, cmp_op0); + + insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM), + gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1)); + /* We use insn_invalid_p here to add clobbers if required. */ + ret = insn_invalid_p (emit_insn (insn)); + gcc_assert (!ret); + + /* Emit SLB instruction pattern. */ + if (!register_operand (src, GET_MODE (dst))) + src = force_reg (GET_MODE (dst), src); + + op_res = gen_rtx_MINUS (GET_MODE (dst), + gen_rtx_MINUS (GET_MODE (dst), src, const0_rtx), + gen_rtx_fmt_ee (cmp_code, GET_MODE (dst), + gen_rtx_REG (cc_mode, CC_REGNUM), + const0_rtx)); + p = rtvec_alloc (2); + RTVEC_ELT (p, 0) = + gen_rtx_SET (VOIDmode, dst, op_res); + RTVEC_ELT (p, 1) = + gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, CC_REGNUM)); + emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); + + return true; + } + + return false; +} + +/* Expand code for the insv template. Return true if successful, false else. */ + +bool +s390_expand_insv (rtx dest, rtx op1, rtx op2, rtx src) +{ + int bitsize = INTVAL (op1); + int bitpos = INTVAL (op2); + + /* We need byte alignment. */ + if (bitsize % BITS_PER_UNIT) + return false; + + if (bitpos == 0 + && memory_operand (dest, VOIDmode) + && (register_operand (src, word_mode) + || const_int_operand (src, VOIDmode))) + { + /* Emit standard pattern if possible. */ + enum machine_mode mode = smallest_mode_for_size (bitsize, MODE_INT); + if (GET_MODE_BITSIZE (mode) == bitsize) + emit_move_insn (adjust_address (dest, mode, 0), gen_lowpart (mode, src)); + + /* (set (ze (mem)) (const_int)). */ + else if (const_int_operand (src, VOIDmode)) + { + int size = bitsize / BITS_PER_UNIT; + rtx src_mem = adjust_address (force_const_mem (word_mode, src), BLKmode, + GET_MODE_SIZE (word_mode) - size); + + dest = adjust_address (dest, BLKmode, 0); + set_mem_size (dest, GEN_INT (size)); + s390_expand_movmem (dest, src_mem, GEN_INT (size)); + } + + /* (set (ze (mem)) (reg)). */ + else if (register_operand (src, word_mode)) + { + if (bitsize <= GET_MODE_BITSIZE (SImode)) + emit_move_insn (gen_rtx_ZERO_EXTRACT (word_mode, dest, op1, + const0_rtx), src); + else + { + /* Emit st,stcmh sequence. */ + int stcmh_width = bitsize - GET_MODE_BITSIZE (SImode); + int size = stcmh_width / BITS_PER_UNIT; + + emit_move_insn (adjust_address (dest, SImode, size), + gen_lowpart (SImode, src)); + set_mem_size (dest, GEN_INT (size)); + emit_move_insn (gen_rtx_ZERO_EXTRACT (word_mode, dest, GEN_INT + (stcmh_width), const0_rtx), + gen_rtx_LSHIFTRT (word_mode, src, GEN_INT + (GET_MODE_BITSIZE (SImode)))); + } + } + else + return false; + + return true; + } + + /* (set (ze (reg)) (const_int)). */ + if (TARGET_ZARCH + && register_operand (dest, word_mode) + && (bitpos % 16) == 0 + && (bitsize % 16) == 0 + && const_int_operand (src, VOIDmode)) + { + HOST_WIDE_INT val = INTVAL (src); + int regpos = bitpos + bitsize; + + while (regpos > bitpos) + { + enum machine_mode putmode; + int putsize; + + if (TARGET_EXTIMM && (regpos % 32 == 0) && (regpos >= bitpos + 32)) + putmode = SImode; + else + putmode = HImode; + + putsize = GET_MODE_BITSIZE (putmode); + regpos -= putsize; + emit_move_insn (gen_rtx_ZERO_EXTRACT (word_mode, dest, + GEN_INT (putsize), + GEN_INT (regpos)), + gen_int_mode (val, putmode)); + val >>= putsize; + } + gcc_assert (regpos == bitpos); + return true; + } + + return false; +} + +/* A subroutine of s390_expand_cs_hqi and s390_expand_atomic which returns a + register that holds VAL of mode MODE shifted by COUNT bits. */ + +static inline rtx +s390_expand_mask_and_shift (rtx val, enum machine_mode mode, rtx count) +{ + val = expand_simple_binop (SImode, AND, val, GEN_INT (GET_MODE_MASK (mode)), + NULL_RTX, 1, OPTAB_DIRECT); + return expand_simple_binop (SImode, ASHIFT, val, count, + NULL_RTX, 1, OPTAB_DIRECT); +} + +/* Structure to hold the initial parameters for a compare_and_swap operation + in HImode and QImode. */ + +struct alignment_context +{ + rtx memsi; /* SI aligned memory location. */ + rtx shift; /* Bit offset with regard to lsb. */ + rtx modemask; /* Mask of the HQImode shifted by SHIFT bits. */ + rtx modemaski; /* ~modemask */ + bool aligned; /* True if memory is aligned, false else. */ +}; + +/* A subroutine of s390_expand_cs_hqi and s390_expand_atomic to initialize + structure AC for transparent simplifying, if the memory alignment is known + to be at least 32bit. MEM is the memory location for the actual operation + and MODE its mode. */ + +static void +init_alignment_context (struct alignment_context *ac, rtx mem, + enum machine_mode mode) +{ + ac->shift = GEN_INT (GET_MODE_SIZE (SImode) - GET_MODE_SIZE (mode)); + ac->aligned = (MEM_ALIGN (mem) >= GET_MODE_BITSIZE (SImode)); + + if (ac->aligned) + ac->memsi = adjust_address (mem, SImode, 0); /* Memory is aligned. */ + else + { + /* Alignment is unknown. */ + rtx byteoffset, addr, align; + + /* Force the address into a register. */ + addr = force_reg (Pmode, XEXP (mem, 0)); + + /* Align it to SImode. */ + align = expand_simple_binop (Pmode, AND, addr, + GEN_INT (-GET_MODE_SIZE (SImode)), + NULL_RTX, 1, OPTAB_DIRECT); + /* Generate MEM. */ + ac->memsi = gen_rtx_MEM (SImode, align); + MEM_VOLATILE_P (ac->memsi) = MEM_VOLATILE_P (mem); + set_mem_alias_set (ac->memsi, ALIAS_SET_MEMORY_BARRIER); + set_mem_align (ac->memsi, GET_MODE_BITSIZE (SImode)); + + /* Calculate shiftcount. */ + byteoffset = expand_simple_binop (Pmode, AND, addr, + GEN_INT (GET_MODE_SIZE (SImode) - 1), + NULL_RTX, 1, OPTAB_DIRECT); + /* As we already have some offset, evaluate the remaining distance. */ + ac->shift = expand_simple_binop (SImode, MINUS, ac->shift, byteoffset, + NULL_RTX, 1, OPTAB_DIRECT); + + } + /* Shift is the byte count, but we need the bitcount. */ + ac->shift = expand_simple_binop (SImode, MULT, ac->shift, GEN_INT (BITS_PER_UNIT), + NULL_RTX, 1, OPTAB_DIRECT); + /* Calculate masks. */ + ac->modemask = expand_simple_binop (SImode, ASHIFT, + GEN_INT (GET_MODE_MASK (mode)), ac->shift, + NULL_RTX, 1, OPTAB_DIRECT); + ac->modemaski = expand_simple_unop (SImode, NOT, ac->modemask, NULL_RTX, 1); +} + +/* Expand an atomic compare and swap operation for HImode and QImode. MEM is + the memory location, CMP the old value to compare MEM with and NEW the value + to set if CMP == MEM. + CMP is never in memory for compare_and_swap_cc because + expand_bool_compare_and_swap puts it into a register for later compare. */ void +s390_expand_cs_hqi (enum machine_mode mode, rtx target, rtx mem, rtx cmp, rtx new) +{ + struct alignment_context ac; + rtx cmpv, newv, val, resv, cc; + rtx res = gen_reg_rtx (SImode); + rtx csloop = gen_label_rtx (); + rtx csend = gen_label_rtx (); + + gcc_assert (register_operand (target, VOIDmode)); + gcc_assert (MEM_P (mem)); + + init_alignment_context (&ac, mem, mode); + + /* Shift the values to the correct bit positions. */ + if (!(ac.aligned && MEM_P (cmp))) + cmp = s390_expand_mask_and_shift (cmp, mode, ac.shift); + if (!(ac.aligned && MEM_P (new))) + new = s390_expand_mask_and_shift (new, mode, ac.shift); + + /* Load full word. Subsequent loads are performed by CS. */ + val = expand_simple_binop (SImode, AND, ac.memsi, ac.modemaski, + NULL_RTX, 1, OPTAB_DIRECT); + + /* Start CS loop. */ + emit_label (csloop); + /* val = "00..0" + * cmp = "00..000..0" + * new = "00..000..0" + */ + + /* Patch cmp and new with val at correct position. */ + if (ac.aligned && MEM_P (cmp)) + { + cmpv = force_reg (SImode, val); + store_bit_field (cmpv, GET_MODE_BITSIZE (mode), 0, SImode, cmp); + } + else + cmpv = force_reg (SImode, expand_simple_binop (SImode, IOR, cmp, val, + NULL_RTX, 1, OPTAB_DIRECT)); + if (ac.aligned && MEM_P (new)) + { + newv = force_reg (SImode, val); + store_bit_field (newv, GET_MODE_BITSIZE (mode), 0, SImode, new); + } + else + newv = force_reg (SImode, expand_simple_binop (SImode, IOR, new, val, + NULL_RTX, 1, OPTAB_DIRECT)); + + /* Jump to end if we're done (likely?). */ + s390_emit_jump (csend, s390_emit_compare_and_swap (EQ, res, ac.memsi, + cmpv, newv)); + + /* Check for changes outside mode. */ + resv = expand_simple_binop (SImode, AND, res, ac.modemaski, + NULL_RTX, 1, OPTAB_DIRECT); + cc = s390_emit_compare (NE, resv, val); + emit_move_insn (val, resv); + /* Loop internal if so. */ + s390_emit_jump (csloop, cc); + + emit_label (csend); + + /* Return the correct part of the bitfield. */ + convert_move (target, expand_simple_binop (SImode, LSHIFTRT, res, ac.shift, + NULL_RTX, 1, OPTAB_DIRECT), 1); +} + +/* Expand an atomic operation CODE of mode MODE. MEM is the memory location + and VAL the value to play with. If AFTER is true then store the the value + MEM holds after the operation, if AFTER is false then store the value MEM + holds before the operation. If TARGET is zero then discard that value, else + store it to TARGET. */ + +void +s390_expand_atomic (enum machine_mode mode, enum rtx_code code, + rtx target, rtx mem, rtx val, bool after) +{ + struct alignment_context ac; + rtx cmp; + rtx new = gen_reg_rtx (SImode); + rtx orig = gen_reg_rtx (SImode); + rtx csloop = gen_label_rtx (); + + gcc_assert (!target || register_operand (target, VOIDmode)); + gcc_assert (MEM_P (mem)); + + init_alignment_context (&ac, mem, mode); + + /* Shift val to the correct bit positions. + Preserve "icm", but prevent "ex icm". */ + if (!(ac.aligned && code == SET && MEM_P (val))) + val = s390_expand_mask_and_shift (val, mode, ac.shift); + + /* Further preparation insns. */ + if (code == PLUS || code == MINUS) + emit_move_insn (orig, val); + else if (code == MULT || code == AND) /* val = "11..111..1" */ + val = expand_simple_binop (SImode, XOR, val, ac.modemaski, + NULL_RTX, 1, OPTAB_DIRECT); + + /* Load full word. Subsequent loads are performed by CS. */ + cmp = force_reg (SImode, ac.memsi); + + /* Start CS loop. */ + emit_label (csloop); + emit_move_insn (new, cmp); + + /* Patch new with val at correct position. */ + switch (code) + { + case PLUS: + case MINUS: + val = expand_simple_binop (SImode, code, new, orig, + NULL_RTX, 1, OPTAB_DIRECT); + val = expand_simple_binop (SImode, AND, val, ac.modemask, + NULL_RTX, 1, OPTAB_DIRECT); + /* FALLTHRU */ + case SET: + if (ac.aligned && MEM_P (val)) + store_bit_field (new, GET_MODE_BITSIZE (mode), 0, SImode, val); + else + { + new = expand_simple_binop (SImode, AND, new, ac.modemaski, + NULL_RTX, 1, OPTAB_DIRECT); + new = expand_simple_binop (SImode, IOR, new, val, + NULL_RTX, 1, OPTAB_DIRECT); + } + break; + case AND: + case IOR: + case XOR: + new = expand_simple_binop (SImode, code, new, val, + NULL_RTX, 1, OPTAB_DIRECT); + break; + case MULT: /* NAND */ + new = expand_simple_binop (SImode, XOR, new, ac.modemask, + NULL_RTX, 1, OPTAB_DIRECT); + new = expand_simple_binop (SImode, AND, new, val, + NULL_RTX, 1, OPTAB_DIRECT); + break; + default: + gcc_unreachable (); + } + + s390_emit_jump (csloop, s390_emit_compare_and_swap (NE, cmp, + ac.memsi, cmp, new)); + + /* Return the correct part of the bitfield. */ + if (target) + convert_move (target, expand_simple_binop (SImode, LSHIFTRT, + after ? new : cmp, ac.shift, + NULL_RTX, 1, OPTAB_DIRECT), 1); +} + +/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. + We need to emit DTP-relative relocations. */ + +static void s390_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; + +static void s390_output_dwarf_dtprel (FILE *file, int size, rtx x) { switch (size) @@ -3181,14 +4333,29 @@ s390_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs ("\t.quad\t", file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs ("@DTPOFF", file); } +#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING +/* Implement TARGET_MANGLE_FUNDAMENTAL_TYPE. */ + +static const char * +s390_mangle_fundamental_type (tree type) +{ + if (TYPE_MAIN_VARIANT (type) == long_double_type_node + && TARGET_LONG_DOUBLE_128) + return "g"; + + /* For all other types, use normal C++ mangling. */ + return NULL; +} +#endif + /* In the name of slightly smaller debug output, and to cater to - general assembler losage, recognize various UNSPEC sequences + general assembler lossage, recognize various UNSPEC sequences and turn them back into a direct symbol reference. */ static rtx @@ -3224,58 +4391,35 @@ s390_delegitimize_address (rtx orig_x) return orig_x; } -/* Output shift count operand OP to stdio stream FILE. */ +/* Output operand OP to stdio stream FILE. + OP is an address (register + offset) which is not used to address data; + instead the rightmost bits are interpreted as the value. */ static void print_shift_count_operand (FILE *file, rtx op) { - HOST_WIDE_INT offset = 0; + HOST_WIDE_INT offset; + rtx base; - /* We can have an integer constant, an address register, - or a sum of the two. */ - if (GET_CODE (op) == CONST_INT) - { - offset = INTVAL (op); - op = NULL_RTX; - } - if (op && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) - { - offset = INTVAL (XEXP (op, 1)); - op = XEXP (op, 0); - } - while (op && GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); + /* Extract base register and offset. */ + if (!s390_decompose_shift_count (op, &base, &offset)) + gcc_unreachable (); /* Sanity check. */ - if (op && (GET_CODE (op) != REG - || REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) != ADDR_REGS)) - abort (); + if (base) + { + gcc_assert (GET_CODE (base) == REG); + gcc_assert (REGNO (base) < FIRST_PSEUDO_REGISTER); + gcc_assert (REGNO_REG_CLASS (REGNO (base)) == ADDR_REGS); + } - /* Shift counts are truncated to the low six bits anyway. */ - fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset & 63); - if (op) - fprintf (file, "(%s)", reg_names[REGNO (op)]); + /* Offsets are constricted to twelve bits. */ + fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset & ((1 << 12) - 1)); + if (base) + fprintf (file, "(%s)", reg_names[REGNO (base)]); } -/* Locate some local-dynamic symbol still in use by this function - so that we can print its name in local-dynamic base patterns. */ - -static const char * -get_some_local_dynamic_name (void) -{ - rtx insn; - - if (cfun->machine->some_ld_name) - return cfun->machine->some_ld_name; - - for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) - if (INSN_P (insn) - && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) - return cfun->machine->some_ld_name; - - abort (); -} +/* See 'get_some_local_dynamic_name'. */ static int get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) @@ -3298,98 +4442,82 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) return 0; } -/* Output symbolic constant X in assembler syntax to - stdio stream FILE. */ +/* Locate some local-dynamic symbol still in use by this function + so that we can print its name in local-dynamic base patterns. */ -void -s390_output_symbolic_const (FILE *file, rtx x) +static const char * +get_some_local_dynamic_name (void) { - switch (GET_CODE (x)) - { - case CONST: - case ZERO_EXTEND: - case SIGN_EXTEND: - s390_output_symbolic_const (file, XEXP (x, 0)); - break; + rtx insn; - case PLUS: - s390_output_symbolic_const (file, XEXP (x, 0)); - fprintf (file, "+"); - s390_output_symbolic_const (file, XEXP (x, 1)); - break; + if (cfun->machine->some_ld_name) + return cfun->machine->some_ld_name; - case MINUS: - s390_output_symbolic_const (file, XEXP (x, 0)); - fprintf (file, "-"); - s390_output_symbolic_const (file, XEXP (x, 1)); - break; + for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) + if (INSN_P (insn) + && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) + return cfun->machine->some_ld_name; - case CONST_INT: - case LABEL_REF: - case CODE_LABEL: - case SYMBOL_REF: - output_addr_const (file, x); - break; + gcc_unreachable (); +} - case UNSPEC: - if (XVECLEN (x, 0) != 1) - output_operand_lossage ("invalid UNSPEC as operand (1)"); - switch (XINT (x, 1)) - { - case UNSPEC_GOTENT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTENT"); - break; - case UNSPEC_GOT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOT"); - break; - case UNSPEC_GOTOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTOFF"); - break; - case UNSPEC_PLT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@PLT"); - break; - case UNSPEC_PLTOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@PLTOFF"); - break; - case UNSPEC_TLSGD: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@TLSGD"); - break; - case UNSPEC_TLSLDM: - assemble_name (file, get_some_local_dynamic_name ()); - fprintf (file, "@TLSLDM"); - break; - case UNSPEC_DTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@DTPOFF"); - break; - case UNSPEC_NTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@NTPOFF"); - break; - case UNSPEC_GOTNTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTNTPOFF"); - break; - case UNSPEC_INDNTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@INDNTPOFF"); - break; - default: - output_operand_lossage ("invalid UNSPEC as operand (2)"); - break; - } - break; +/* Output machine-dependent UNSPECs occurring in address constant X + in assembler syntax to stdio stream FILE. Returns true if the + constant X could be recognized, false otherwise. */ - default: - fatal_insn ("UNKNOWN in s390_output_symbolic_const !?", x); - break; - } +bool +s390_output_addr_const_extra (FILE *file, rtx x) +{ + if (GET_CODE (x) == UNSPEC && XVECLEN (x, 0) == 1) + switch (XINT (x, 1)) + { + case UNSPEC_GOTENT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTENT"); + return true; + case UNSPEC_GOT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOT"); + return true; + case UNSPEC_GOTOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTOFF"); + return true; + case UNSPEC_PLT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@PLT"); + return true; + case UNSPEC_PLTOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@PLTOFF"); + return true; + case UNSPEC_TLSGD: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@TLSGD"); + return true; + case UNSPEC_TLSLDM: + assemble_name (file, get_some_local_dynamic_name ()); + fprintf (file, "@TLSLDM"); + return true; + case UNSPEC_DTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@DTPOFF"); + return true; + case UNSPEC_NTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@NTPOFF"); + return true; + case UNSPEC_GOTNTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTNTPOFF"); + return true; + case UNSPEC_INDNTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@INDNTPOFF"); + return true; + } + + return false; } /* Output address operand ADDR in assembler syntax to @@ -3401,12 +4529,12 @@ print_operand_address (FILE *file, rtx addr) struct s390_address ad; if (!s390_decompose_address (addr, &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))) - output_operand_lossage ("Cannot decompose address."); + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + || (ad.indx && !REGNO_OK_FOR_INDEX_P (REGNO (ad.indx)))) + output_operand_lossage ("cannot decompose address"); if (ad.disp) - s390_output_symbolic_const (file, ad.disp); + output_addr_const (file, ad.disp); else fprintf (file, "0"); @@ -3424,17 +4552,22 @@ print_operand_address (FILE *file, rtx addr) 'C': print opcode suffix for branch condition. 'D': print opcode suffix for inverse branch condition. 'J': print tls_load/tls_gdcall/tls_ldcall suffix + 'G': print the size of the operand in bytes. 'O': print only the displacement of a memory reference. 'R': print only the base register of a memory reference. + 'S': print S-type memory reference (base+displacement). 'N': print the second word of a DImode operand. 'M': print the second word of a TImode operand. 'Y': print shift count operand. 'b': print integer X as if it's an unsigned byte. - 'x': print integer X as if it's an unsigned word. - 'h': print integer X as if it's a signed word. + 'x': print integer X as if it's an unsigned halfword. + 'h': print integer X as if it's a signed halfword. 'i': print the first nonzero HImode part of X. - 'j': print the first HImode part unequal to 0xffff of X. */ + 'j': print the first HImode part unequal to -1 of X. + 'k': print the first nonzero SImode part of X. + 'm': print the first SImode part unequal to -1 of X. + 'o': print integer X as if it's an unsigned 32bit word. */ void print_operand (FILE *file, rtx x, int code) @@ -3466,21 +4599,26 @@ print_operand (FILE *file, rtx x, int code) assemble_name (file, get_some_local_dynamic_name ()); } else - abort (); + gcc_unreachable (); + return; + + case 'G': + fprintf (file, "%u", GET_MODE_SIZE (GET_MODE (x))); return; case 'O': { struct s390_address ad; + int ret; - if (GET_CODE (x) != MEM - || !s390_decompose_address (XEXP (x, 0), &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || ad.indx) - abort (); + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); + gcc_assert (!ad.indx); if (ad.disp) - s390_output_symbolic_const (file, ad.disp); + output_addr_const (file, ad.disp); else fprintf (file, "0"); } @@ -3489,12 +4627,13 @@ print_operand (FILE *file, rtx x, int code) case 'R': { struct s390_address ad; + int ret; - if (GET_CODE (x) != MEM - || !s390_decompose_address (XEXP (x, 0), &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || ad.indx) - abort (); + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); + gcc_assert (!ad.indx); if (ad.base) fprintf (file, "%s", reg_names[REGNO (ad.base)]); @@ -3503,13 +4642,34 @@ print_operand (FILE *file, rtx x, int code) } return; + case 'S': + { + struct s390_address ad; + int ret; + + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REGNO_OK_FOR_BASE_P (REGNO (ad.base))); + gcc_assert (!ad.indx); + + if (ad.disp) + output_addr_const (file, ad.disp); + else + fprintf (file, "0"); + + if (ad.base) + fprintf (file, "(%s)", reg_names[REGNO (ad.base)]); + } + return; + case 'N': if (GET_CODE (x) == REG) x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1); else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4)); else - abort (); + gcc_unreachable (); break; case 'M': @@ -3518,7 +4678,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8)); else - abort (); + gcc_unreachable (); break; case 'Y': @@ -3540,7 +4700,7 @@ print_operand (FILE *file, rtx x, int code) case CODE_LABEL: case LABEL_REF: case SYMBOL_REF: - s390_output_symbolic_const (file, x); + output_addr_const (file, x); break; case CONST_INT: @@ -3551,18 +4711,25 @@ print_operand (FILE *file, rtx x, int code) else if (code == 'h') fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((INTVAL (x) & 0xffff) ^ 0x8000) - 0x8000); else if (code == 'i') - fprintf (file, HOST_WIDE_INT_PRINT_DEC, + fprintf (file, HOST_WIDE_INT_PRINT_DEC, s390_extract_part (x, HImode, 0)); else if (code == 'j') - fprintf (file, HOST_WIDE_INT_PRINT_DEC, - s390_extract_part (x, HImode, -1)); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + s390_extract_part (x, HImode, -1)); + else if (code == 'k') + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + s390_extract_part (x, SImode, 0)); + else if (code == 'm') + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + s390_extract_part (x, SImode, -1)); + else if (code == 'o') + fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffffffff); else fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x)); break; case CONST_DOUBLE: - if (GET_MODE (x) != VOIDmode) - abort (); + gcc_assert (GET_MODE (x) == VOIDmode); if (code == 'b') fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xff); else if (code == 'x') @@ -3570,7 +4737,7 @@ print_operand (FILE *file, rtx x, int code) else if (code == 'h') fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000); else - abort (); + gcc_unreachable (); break; default: @@ -3599,7 +4766,7 @@ s390_assemble_integer (rtx x, unsigned int size, int aligned_p) /* Returns true if register REGNO is used for forming a memory address in expression X. */ -static int +static bool reg_used_in_mem_p (int regno, rtx x) { enum rtx_code code = GET_CODE (x); @@ -3610,14 +4777,14 @@ reg_used_in_mem_p (int regno, rtx x) { if (refers_to_regno_p (regno, regno+1, XEXP (x, 0), 0)) - return 1; + return true; } else if (code == SET && GET_CODE (SET_DEST (x)) == PC) { if (refers_to_regno_p (regno, regno+1, SET_SRC (x), 0)) - return 1; + return true; } fmt = GET_RTX_FORMAT (code); @@ -3625,20 +4792,20 @@ reg_used_in_mem_p (int regno, rtx x) { if (fmt[i] == 'e' && reg_used_in_mem_p (regno, XEXP (x, i))) - return 1; + return true; else if (fmt[i] == 'E') for (j = 0; j < XVECLEN (x, i); j++) if (reg_used_in_mem_p (regno, XVECEXP (x, i, j))) - return 1; + return true; } - return 0; + return false; } /* Returns true if expression DEP_RTX sets an address register used by instruction INSN to address memory. */ -static int +static bool addr_generation_dependency_p (rtx dep_rtx, rtx insn) { rtx target, pat; @@ -3663,20 +4830,17 @@ addr_generation_dependency_p (rtx dep_rtx, rtx insn) pat = PATTERN (insn); if (GET_CODE (pat) == PARALLEL) { - if (XVECLEN (pat, 0) != 2) - abort(); + gcc_assert (XVECLEN (pat, 0) == 2); pat = XVECEXP (pat, 0, 0); } - if (GET_CODE (pat) == SET) - return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0); - else - abort(); + gcc_assert (GET_CODE (pat) == SET); + return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0); } else if (get_attr_atype (insn) == ATYPE_AGEN) return reg_used_in_mem_p (regno, PATTERN (insn)); } } - return 0; + return false; } /* Return 1, if dep_insn sets register used in insn in the agen unit. */ @@ -3701,63 +4865,6 @@ s390_agen_dep_p (rtx dep_insn, rtx insn) return 0; } -/* Return the modified cost of the dependency of instruction INSN - on instruction DEP_INSN through the link LINK. COST is the - default cost of that dependency. - - Data dependencies are all handled without delay. However, if a - register is modified and subsequently used as base or index - register of a memory reference, at least 4 cycles need to pass - between setting and using the register to avoid pipeline stalls. - An exception is the LA instruction. An address generated by LA can - be used by introducing only a one cycle stall on the pipeline. */ - -static int -s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) -{ - rtx dep_rtx; - int i; - - /* If the dependence is an anti-dependence, there is no cost. For an - output dependence, there is sometimes a cost, but it doesn't seem - worth handling those few cases. */ - - if (REG_NOTE_KIND (link) != 0) - return 0; - - /* If we can't recognize the insns, we can't really do anything. */ - if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) - return cost; - - /* DFA based scheduling checks address dependency in md file. */ - if (s390_use_dfa_pipeline_interface ()) - { - /* Operand forward in case of lr, load and la. */ - if (s390_tune == PROCESSOR_2084_Z990 - && cost == 1 - && (s390_safe_attr_type (dep_insn) == TYPE_LA - || s390_safe_attr_type (dep_insn) == TYPE_LR - || s390_safe_attr_type (dep_insn) == TYPE_LOAD)) - return 0; - return cost; - } - - dep_rtx = PATTERN (dep_insn); - - if (GET_CODE (dep_rtx) == SET - && addr_generation_dependency_p (dep_rtx, insn)) - cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4; - else if (GET_CODE (dep_rtx) == PARALLEL) - { - for (i = 0; i < XVECLEN (dep_rtx, 0); i++) - { - if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i), insn)) - cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4; - } - } - - return cost; -} /* A C statement (sans semicolon) to update the integer scheduling priority INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier, reduce the priority to execute INSN later. Do not define this macro if @@ -3772,16 +4879,18 @@ s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority) if (! INSN_P (insn)) return priority; - if (s390_tune != PROCESSOR_2084_Z990) + if (s390_tune != PROCESSOR_2084_Z990 + && s390_tune != PROCESSOR_2094_Z9_109) return priority; switch (s390_safe_attr_type (insn)) { - case TYPE_FSTORED: - case TYPE_FSTORES: + case TYPE_FSTOREDF: + case TYPE_FSTORESF: priority = priority << 3; break; case TYPE_STORE: + case TYPE_STM: priority = priority << 1; break; default: @@ -3795,43 +4904,121 @@ s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority) static int s390_issue_rate (void) { - if (s390_tune == PROCESSOR_2084_Z990) + if (s390_tune == PROCESSOR_2084_Z990 + || s390_tune == PROCESSOR_2094_Z9_109) return 3; return 1; } -/* If the following function returns TRUE, we will use the the DFA - insn scheduler. */ - -static int -s390_use_dfa_pipeline_interface (void) -{ - if (s390_tune == PROCESSOR_2064_Z900 - || s390_tune == PROCESSOR_2084_Z990) - return 1; - - return 0; -} - static int s390_first_cycle_multipass_dfa_lookahead (void) { - return s390_use_dfa_pipeline_interface () ? 4 : 0; + return 4; } -/* Called after issuing each insn. - Triggers default sort algorithm to better slot instructions. */ -static int -s390_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED, - int sched_verbose ATTRIBUTE_UNUSED, - rtx *ready ATTRIBUTE_UNUSED, - int *pn_ready ATTRIBUTE_UNUSED, - int clock_var ATTRIBUTE_UNUSED) +/* Annotate every literal pool reference in X by an UNSPEC_LTREF expression. + Fix up MEMs as required. */ + +static void +annotate_constant_pool_refs (rtx *x) { - return s390_issue_rate(); -} + int i, j; + const char *fmt; + gcc_assert (GET_CODE (*x) != SYMBOL_REF + || !CONSTANT_POOL_ADDRESS_P (*x)); + + /* Literal pool references can only occur inside a MEM ... */ + if (GET_CODE (*x) == MEM) + { + rtx memref = XEXP (*x, 0); + + if (GET_CODE (memref) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (memref)) + { + rtx base = cfun->machine->base_reg; + rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, memref, base), + UNSPEC_LTREF); + + *x = replace_equiv_address (*x, addr); + return; + } + + if (GET_CODE (memref) == CONST + && GET_CODE (XEXP (memref, 0)) == PLUS + && GET_CODE (XEXP (XEXP (memref, 0), 1)) == CONST_INT + && GET_CODE (XEXP (XEXP (memref, 0), 0)) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (memref, 0), 0))) + { + HOST_WIDE_INT off = INTVAL (XEXP (XEXP (memref, 0), 1)); + rtx sym = XEXP (XEXP (memref, 0), 0); + rtx base = cfun->machine->base_reg; + rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base), + UNSPEC_LTREF); + + *x = replace_equiv_address (*x, plus_constant (addr, off)); + return; + } + } + + /* ... or a load-address type pattern. */ + if (GET_CODE (*x) == SET) + { + rtx addrref = SET_SRC (*x); + + if (GET_CODE (addrref) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (addrref)) + { + rtx base = cfun->machine->base_reg; + rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, addrref, base), + UNSPEC_LTREF); + + SET_SRC (*x) = addr; + return; + } + + if (GET_CODE (addrref) == CONST + && GET_CODE (XEXP (addrref, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addrref, 0), 1)) == CONST_INT + && GET_CODE (XEXP (XEXP (addrref, 0), 0)) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (addrref, 0), 0))) + { + HOST_WIDE_INT off = INTVAL (XEXP (XEXP (addrref, 0), 1)); + rtx sym = XEXP (XEXP (addrref, 0), 0); + rtx base = cfun->machine->base_reg; + rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base), + UNSPEC_LTREF); + + SET_SRC (*x) = plus_constant (addr, off); + return; + } + } + + /* Annotate LTREL_BASE as well. */ + if (GET_CODE (*x) == UNSPEC + && XINT (*x, 1) == UNSPEC_LTREL_BASE) + { + rtx base = cfun->machine->base_reg; + *x = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XVECEXP (*x, 0, 0), base), + UNSPEC_LTREL_BASE); + return; + } + + fmt = GET_RTX_FORMAT (GET_CODE (*x)); + for (i = GET_RTX_LENGTH (GET_CODE (*x)) - 1; i >= 0; i--) + { + if (fmt[i] == 'e') + { + annotate_constant_pool_refs (&XEXP (*x, i)); + } + else if (fmt[i] == 'E') + { + for (j = 0; j < XVECLEN (*x, i); j++) + annotate_constant_pool_refs (&XVECEXP (*x, i, j)); + } + } +} /* Split all branches that exceed the maximum distance. Returns true if this created a new literal pool entry. */ @@ -3840,7 +5027,7 @@ static int s390_split_branches (void) { rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); - int new_literal = 0; + int new_literal = 0, ret; rtx insn, pat, tmp, target; rtx *label; @@ -3882,7 +5069,7 @@ s390_split_branches (void) /* We are going to use the return register as scratch register, make sure it will be saved/restored by the prologue/epilogue. */ - cfun->machine->save_return_addr_p = 1; + cfun_frame_layout.save_return_addr_p = 1; if (!flag_pic) { @@ -3890,6 +5077,7 @@ s390_split_branches (void) tmp = force_const_mem (Pmode, *label); tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, tmp), insn); INSN_ADDRESSES_NEW (tmp, -1); + annotate_constant_pool_refs (&PATTERN (tmp)); target = temp_reg; } @@ -3902,24 +5090,26 @@ s390_split_branches (void) target = force_const_mem (Pmode, target); tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); INSN_ADDRESSES_NEW (tmp, -1); + annotate_constant_pool_refs (&PATTERN (tmp)); - target = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (target, 0)), + target = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XEXP (target, 0), + cfun->machine->base_reg), UNSPEC_LTREL_BASE); target = gen_rtx_PLUS (Pmode, temp_reg, target); } - if (!validate_change (insn, label, target, 0)) - abort (); + ret = validate_change (insn, label, target, 0); + gcc_assert (ret); } return new_literal; } -/* Find a literal pool symbol referenced in RTX X, and store - it at REF. Will abort if X contains references to more than - one such pool symbol; multiple references to the same symbol - are allowed, however. +/* Find an annotated literal pool symbol referenced in RTX X, + and store it at REF. Will abort if X contains references to + more than one such pool symbol; multiple references to the same + symbol are allowed, however. The rtx pointed to by REF must be initialized to NULL_RTX by the caller before calling this routine. */ @@ -3939,13 +5129,21 @@ find_constant_pool_ref (rtx x, rtx *ref) && XINT (x, 1) == UNSPECV_POOL_ENTRY) return; - if (GET_CODE (x) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (x)) + gcc_assert (GET_CODE (x) != SYMBOL_REF + || !CONSTANT_POOL_ADDRESS_P (x)); + + if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_LTREF) { + rtx sym = XVECEXP (x, 0, 0); + gcc_assert (GET_CODE (sym) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (sym)); + if (*ref == NULL_RTX) - *ref = x; - else if (*ref != x) - abort(); + *ref = sym; + else + gcc_assert (*ref == sym); + + return; } fmt = GET_RTX_FORMAT (GET_CODE (x)); @@ -3963,60 +5161,34 @@ find_constant_pool_ref (rtx x, rtx *ref) } } -/* Replace every reference to the literal pool symbol REF - in X by the address ADDR. Fix up MEMs as required. */ +/* Replace every reference to the annotated literal pool + symbol REF in X by its base plus OFFSET. */ static void -replace_constant_pool_ref (rtx *x, rtx ref, rtx addr) +replace_constant_pool_ref (rtx *x, rtx ref, rtx offset) { int i, j; const char *fmt; - if (*x == ref) - abort (); + gcc_assert (*x != ref); - /* Literal pool references can only occur inside a MEM ... */ - if (GET_CODE (*x) == MEM) + if (GET_CODE (*x) == UNSPEC + && XINT (*x, 1) == UNSPEC_LTREF + && XVECEXP (*x, 0, 0) == ref) { - rtx memref = XEXP (*x, 0); - - if (memref == ref) - { - *x = replace_equiv_address (*x, addr); - return; - } - - if (GET_CODE (memref) == CONST - && GET_CODE (XEXP (memref, 0)) == PLUS - && GET_CODE (XEXP (XEXP (memref, 0), 1)) == CONST_INT - && XEXP (XEXP (memref, 0), 0) == ref) - { - HOST_WIDE_INT off = INTVAL (XEXP (XEXP (memref, 0), 1)); - *x = replace_equiv_address (*x, plus_constant (addr, off)); - return; - } + *x = gen_rtx_PLUS (Pmode, XVECEXP (*x, 0, 1), offset); + return; } - /* ... or a load-address type pattern. */ - if (GET_CODE (*x) == SET) + if (GET_CODE (*x) == PLUS + && GET_CODE (XEXP (*x, 1)) == CONST_INT + && GET_CODE (XEXP (*x, 0)) == UNSPEC + && XINT (XEXP (*x, 0), 1) == UNSPEC_LTREF + && XVECEXP (XEXP (*x, 0), 0, 0) == ref) { - rtx addrref = SET_SRC (*x); - - if (addrref == ref) - { - SET_SRC (*x) = addr; - return; - } - - if (GET_CODE (addrref) == CONST - && GET_CODE (XEXP (addrref, 0)) == PLUS - && GET_CODE (XEXP (XEXP (addrref, 0), 1)) == CONST_INT - && XEXP (XEXP (addrref, 0), 0) == ref) - { - HOST_WIDE_INT off = INTVAL (XEXP (XEXP (addrref, 0), 1)); - SET_SRC (*x) = plus_constant (addr, off); - return; - } + rtx addr = gen_rtx_PLUS (Pmode, XVECEXP (XEXP (*x, 0), 0, 1), offset); + *x = plus_constant (addr, INTVAL (XEXP (*x, 1))); + return; } fmt = GET_RTX_FORMAT (GET_CODE (*x)); @@ -4024,12 +5196,12 @@ replace_constant_pool_ref (rtx *x, rtx ref, rtx addr) { if (fmt[i] == 'e') { - replace_constant_pool_ref (&XEXP (*x, i), ref, addr); + replace_constant_pool_ref (&XEXP (*x, i), ref, offset); } else if (fmt[i] == 'E') { for (j = 0; j < XVECLEN (*x, i); j++) - replace_constant_pool_ref (&XVECEXP (*x, i, j), ref, addr); + replace_constant_pool_ref (&XVECEXP (*x, i, j), ref, offset); } } } @@ -4070,10 +5242,10 @@ find_ltrel_base (rtx x) return NULL_RTX; } -/* Replace any occurrence of UNSPEC_LTREL_BASE in X with BASE. */ +/* Replace any occurrence of UNSPEC_LTREL_BASE in X with its base. */ static void -replace_ltrel_base (rtx *x, rtx base) +replace_ltrel_base (rtx *x) { int i, j; const char *fmt; @@ -4081,7 +5253,7 @@ replace_ltrel_base (rtx *x, rtx base) if (GET_CODE (*x) == UNSPEC && XINT (*x, 1) == UNSPEC_LTREL_BASE) { - *x = base; + *x = XVECEXP (*x, 0, 1); return; } @@ -4090,12 +5262,12 @@ replace_ltrel_base (rtx *x, rtx base) { if (fmt[i] == 'e') { - replace_ltrel_base (&XEXP (*x, i), base); + replace_ltrel_base (&XEXP (*x, i)); } else if (fmt[i] == 'E') { for (j = 0; j < XVECLEN (*x, i); j++) - replace_ltrel_base (&XVECEXP (*x, i, j), base); + replace_ltrel_base (&XVECEXP (*x, i, j)); } } } @@ -4104,12 +5276,12 @@ replace_ltrel_base (rtx *x, rtx base) /* We keep a list of constants which we have to add to internal constant tables in the middle of large functions. */ -#define NR_C_MODES 7 +#define NR_C_MODES 11 enum machine_mode constant_modes[NR_C_MODES] = { - TImode, - DFmode, DImode, - SFmode, SImode, + TFmode, TImode, TDmode, + DFmode, DImode, DDmode, + SFmode, SImode, SDmode, HImode, QImode }; @@ -4129,27 +5301,33 @@ struct constant_pool bitmap insns; struct constant *constants[NR_C_MODES]; + struct constant *execute; rtx label; int size; }; -static struct constant_pool * s390_mainpool_start (void); -static void s390_mainpool_finish (struct constant_pool *, rtx base_reg); -static void s390_mainpool_cancel (struct constant_pool *); +/* Allocate new constant_pool structure. */ -static struct constant_pool * s390_chunkify_start (rtx base_reg); -static void s390_chunkify_finish (struct constant_pool *, rtx base_reg); -static void s390_chunkify_cancel (struct constant_pool *); +static struct constant_pool * +s390_alloc_pool (void) +{ + struct constant_pool *pool; + int i; -static struct constant_pool *s390_start_pool (struct constant_pool **, rtx); -static void s390_end_pool (struct constant_pool *, rtx); -static void s390_add_pool_insn (struct constant_pool *, rtx); -static struct constant_pool *s390_find_pool (struct constant_pool *, rtx); -static void s390_add_constant (struct constant_pool *, rtx, enum machine_mode); -static rtx s390_find_constant (struct constant_pool *, rtx, enum machine_mode); -static rtx s390_dump_pool (struct constant_pool *, bool); -static struct constant_pool *s390_alloc_pool (void); -static void s390_free_pool (struct constant_pool *); + pool = (struct constant_pool *) xmalloc (sizeof *pool); + pool->next = NULL; + for (i = 0; i < NR_C_MODES; i++) + pool->constants[i] = NULL; + + pool->execute = NULL; + pool->label = gen_label_rtx (); + pool->first_insn = NULL_RTX; + pool->pool_insn = NULL_RTX; + pool->insns = BITMAP_ALLOC (NULL); + pool->size = 0; + + return pool; +} /* Create new constant pool covering instructions starting at INSN and chain it to the end of POOL_LIST. */ @@ -4217,8 +5395,7 @@ s390_add_constant (struct constant_pool *pool, rtx val, enum machine_mode mode) for (i = 0; i < NR_C_MODES; i++) if (constant_modes[i] == mode) break; - if (i == NR_C_MODES) - abort (); + gcc_assert (i != NR_C_MODES); for (c = pool->constants[i]; c != NULL; c = c->next) if (rtx_equal_p (val, c->value)) @@ -4250,15 +5427,13 @@ s390_find_constant (struct constant_pool *pool, rtx val, for (i = 0; i < NR_C_MODES; i++) if (constant_modes[i] == mode) break; - if (i == NR_C_MODES) - abort (); + gcc_assert (i != NR_C_MODES); for (c = pool->constants[i]; c != NULL; c = c->next) if (rtx_equal_p (val, c->value)) break; - if (c == NULL) - abort (); + gcc_assert (c); offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label), gen_rtx_LABEL_REF (Pmode, pool->label)); @@ -4266,24 +5441,126 @@ s390_find_constant (struct constant_pool *pool, rtx val, return offset; } +/* Check whether INSN is an execute. Return the label_ref to its + execute target template if so, NULL_RTX otherwise. */ + +static rtx +s390_execute_label (rtx insn) +{ + if (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == UNSPEC + && XINT (XVECEXP (PATTERN (insn), 0, 0), 1) == UNSPEC_EXECUTE) + return XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 2); + + return NULL_RTX; +} + +/* Add execute target for INSN to the constant pool POOL. */ + +static void +s390_add_execute (struct constant_pool *pool, rtx insn) +{ + struct constant *c; + + for (c = pool->execute; c != NULL; c = c->next) + if (INSN_UID (insn) == INSN_UID (c->value)) + break; + + if (c == NULL) + { + c = (struct constant *) xmalloc (sizeof *c); + c->value = insn; + c->label = gen_label_rtx (); + c->next = pool->execute; + pool->execute = c; + pool->size += 6; + } +} + +/* Find execute target for INSN in the constant pool POOL. + Return an RTX describing the distance from the start of + the pool to the location of the execute target. */ + +static rtx +s390_find_execute (struct constant_pool *pool, rtx insn) +{ + struct constant *c; + rtx offset; + + for (c = pool->execute; c != NULL; c = c->next) + if (INSN_UID (insn) == INSN_UID (c->value)) + break; + + gcc_assert (c); + + offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label), + gen_rtx_LABEL_REF (Pmode, pool->label)); + offset = gen_rtx_CONST (Pmode, offset); + return offset; +} + +/* For an execute INSN, extract the execute target template. */ + +static rtx +s390_execute_target (rtx insn) +{ + rtx pattern = PATTERN (insn); + gcc_assert (s390_execute_label (insn)); + + if (XVECLEN (pattern, 0) == 2) + { + pattern = copy_rtx (XVECEXP (pattern, 0, 1)); + } + else + { + rtvec vec = rtvec_alloc (XVECLEN (pattern, 0) - 1); + int i; + + for (i = 0; i < XVECLEN (pattern, 0) - 1; i++) + RTVEC_ELT (vec, i) = copy_rtx (XVECEXP (pattern, 0, i + 1)); + + pattern = gen_rtx_PARALLEL (VOIDmode, vec); + } + + return pattern; +} + +/* Indicate that INSN cannot be duplicated. This is the case for + execute insns that carry a unique label. */ + +static bool +s390_cannot_copy_insn_p (rtx insn) +{ + rtx label = s390_execute_label (insn); + return label && label != const0_rtx; +} + /* Dump out the constants in POOL. If REMOTE_LABEL is true, do not emit the pool base label. */ -static rtx +static void s390_dump_pool (struct constant_pool *pool, bool remote_label) { struct constant *c; - rtx insn; + rtx insn = pool->pool_insn; int i; - /* Pool start insn switches to proper section - and guarantees necessary alignment. */ + /* Switch to rodata section. */ if (TARGET_CPU_ZARCH) - insn = emit_insn_after (gen_pool_start_64 (), pool->pool_insn); + { + insn = emit_insn_after (gen_pool_section_start (), insn); + INSN_ADDRESSES_NEW (insn, -1); + } + + /* Ensure minimum pool alignment. */ + if (TARGET_CPU_ZARCH) + insn = emit_insn_after (gen_pool_align (GEN_INT (8)), insn); else - insn = emit_insn_after (gen_pool_start_31 (), pool->pool_insn); + insn = emit_insn_after (gen_pool_align (GEN_INT (4)), insn); INSN_ADDRESSES_NEW (insn, -1); + /* Emit pool base label. */ if (!remote_label) { insn = emit_label_after (pool->label, insn); @@ -4310,50 +5587,39 @@ s390_dump_pool (struct constant_pool *pool, bool remote_label) insn = emit_label_after (c->label, insn); INSN_ADDRESSES_NEW (insn, -1); - value = gen_rtx_UNSPEC_VOLATILE (constant_modes[i], + value = gen_rtx_UNSPEC_VOLATILE (constant_modes[i], gen_rtvec (1, value), UNSPECV_POOL_ENTRY); insn = emit_insn_after (value, insn); INSN_ADDRESSES_NEW (insn, -1); } - /* Pool end insn switches back to previous section - and guarantees necessary alignment. */ - if (TARGET_CPU_ZARCH) - insn = emit_insn_after (gen_pool_end_64 (), insn); - else - insn = emit_insn_after (gen_pool_end_31 (), insn); + /* Ensure minimum alignment for instructions. */ + insn = emit_insn_after (gen_pool_align (GEN_INT (2)), insn); INSN_ADDRESSES_NEW (insn, -1); + /* Output in-pool execute template insns. */ + for (c = pool->execute; c; c = c->next) + { + insn = emit_label_after (c->label, insn); + INSN_ADDRESSES_NEW (insn, -1); + + insn = emit_insn_after (s390_execute_target (c->value), insn); + INSN_ADDRESSES_NEW (insn, -1); + } + + /* Switch back to previous section. */ + if (TARGET_CPU_ZARCH) + { + insn = emit_insn_after (gen_pool_section_end (), insn); + INSN_ADDRESSES_NEW (insn, -1); + } + insn = emit_barrier_after (insn); INSN_ADDRESSES_NEW (insn, -1); /* Remove placeholder insn. */ remove_insn (pool->pool_insn); - - return insn; -} - -/* Allocate new constant_pool structure. */ - -static struct constant_pool * -s390_alloc_pool (void) -{ - struct constant_pool *pool; - int i; - - pool = (struct constant_pool *) xmalloc (sizeof *pool); - pool->next = NULL; - for (i = 0; i < NR_C_MODES; i++) - pool->constants[i] = NULL; - - pool->label = gen_label_rtx (); - pool->first_insn = NULL_RTX; - pool->pool_insn = NULL_RTX; - pool->insns = BITMAP_XMALLOC (); - pool->size = 0; - - return pool; } /* Free all memory used by POOL. */ @@ -4361,20 +5627,23 @@ s390_alloc_pool (void) static void s390_free_pool (struct constant_pool *pool) { + struct constant *c, *next; int i; for (i = 0; i < NR_C_MODES; i++) + for (c = pool->constants[i]; c; c = next) + { + next = c->next; + free (c); + } + + for (c = pool->execute; c; c = next) { - struct constant *c = pool->constants[i]; - while (c != NULL) - { - struct constant *next = c->next; - free (c); - c = next; - } + next = c->next; + free (c); } - BITMAP_XFREE (pool->insns); + BITMAP_FREE (pool->insns); free (pool); } @@ -4392,15 +5661,19 @@ s390_mainpool_start (void) for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { if (GET_CODE (insn) == INSN - && GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE - && XINT (PATTERN (insn), 1) == UNSPECV_MAIN_POOL) + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC_VOLATILE + && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPECV_MAIN_POOL) { - if (pool->pool_insn) - abort (); + gcc_assert (!pool->pool_insn); pool->pool_insn = insn; } - if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) + if (!TARGET_CPU_ZARCH && s390_execute_label (insn)) + { + s390_add_execute (pool, insn); + } + else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) { rtx pool_ref = NULL_RTX; find_constant_pool_ref (PATTERN (insn), &pool_ref); @@ -4413,8 +5686,7 @@ s390_mainpool_start (void) } } - if (!pool->pool_insn) - abort (); + gcc_assert (pool->pool_insn || pool->size == 0); if (pool->size >= 4096) { @@ -4431,18 +5703,22 @@ s390_mainpool_start (void) /* POOL holds the main literal pool as collected by s390_mainpool_start. Modify the current function to output the pool constants as well as - the pool register setup instruction. BASE_REG is the register to - be used as pool base register. */ + the pool register setup instruction. */ static void -s390_mainpool_finish (struct constant_pool *pool, rtx base_reg) +s390_mainpool_finish (struct constant_pool *pool) { + rtx base_reg = cfun->machine->base_reg; rtx insn; /* If the pool is empty, we're done. */ if (pool->size == 0) { - remove_insn (pool->pool_insn); + /* We don't actually need a base register after all. */ + cfun->machine->base_reg = NULL_RTX; + + if (pool->pool_insn) + remove_insn (pool->pool_insn); s390_free_pool (pool); return; } @@ -4458,8 +5734,8 @@ s390_mainpool_finish (struct constant_pool *pool, rtx base_reg) insn = emit_insn_after (insn, pool->pool_insn); INSN_ADDRESSES_NEW (insn, -1); remove_insn (pool->pool_insn); - - insn = get_last_insn (); + + insn = get_last_insn (); pool->pool_insn = emit_insn_after (gen_pool (const0_rtx), insn); INSN_ADDRESSES_NEW (pool->pool_insn, -1); @@ -4516,7 +5792,7 @@ s390_mainpool_finish (struct constant_pool *pool, rtx base_reg) for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) - replace_ltrel_base (&PATTERN (insn), base_reg); + replace_ltrel_base (&PATTERN (insn)); if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) { @@ -4524,9 +5800,12 @@ s390_mainpool_finish (struct constant_pool *pool, rtx base_reg) find_constant_pool_ref (PATTERN (insn), &pool_ref); if (pool_ref) { - addr = s390_find_constant (pool, get_pool_constant (pool_ref), - get_pool_mode (pool_ref)); - addr = gen_rtx_PLUS (Pmode, base_reg, addr); + if (s390_execute_label (insn)) + addr = s390_find_execute (pool, insn); + else + addr = s390_find_constant (pool, get_pool_constant (pool_ref), + get_pool_mode (pool_ref)); + replace_constant_pool_ref (&PATTERN (insn), pool_ref, addr); INSN_CODE (insn) = -1; } @@ -4550,14 +5829,13 @@ s390_mainpool_cancel (struct constant_pool *pool) } -/* Chunkify the literal pool. BASE_REG is to be used as pool - register. */ +/* Chunkify the literal pool. */ #define S390_POOL_CHUNK_MIN 0xc00 #define S390_POOL_CHUNK_MAX 0xe00 static struct constant_pool * -s390_chunkify_start (rtx base_reg) +s390_chunkify_start (void) { struct constant_pool *curr_pool = NULL, *pool_list = NULL; int extra_size = 0; @@ -4583,14 +5861,20 @@ s390_chunkify_start (rtx base_reg) rtx ltrel_base = find_ltrel_base (PATTERN (insn)); if (ltrel_base) { - if (ltrel_base == pending_ltrel) - pending_ltrel = NULL_RTX; - else - abort (); + gcc_assert (ltrel_base == pending_ltrel); + pending_ltrel = NULL_RTX; } } - if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) + if (!TARGET_CPU_ZARCH && s390_execute_label (insn)) + { + if (!curr_pool) + curr_pool = s390_start_pool (&pool_list, insn); + + s390_add_execute (curr_pool, insn); + s390_add_pool_insn (curr_pool, insn); + } + else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN) { rtx pool_ref = NULL_RTX; find_constant_pool_ref (PATTERN (insn), &pool_ref); @@ -4611,8 +5895,7 @@ s390_chunkify_start (rtx base_reg) && GET_CODE (XEXP (constant, 0)) == UNSPEC && XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET) { - if (pending_ltrel) - abort (); + gcc_assert (!pending_ltrel); pending_ltrel = pool_ref; } } @@ -4623,8 +5906,7 @@ s390_chunkify_start (rtx base_reg) if (curr_pool) s390_add_pool_insn (curr_pool, insn); /* An LTREL_BASE must follow within the same basic block. */ - if (pending_ltrel) - abort (); + gcc_assert (!pending_ltrel); } if (!curr_pool @@ -4702,14 +5984,12 @@ s390_chunkify_start (rtx base_reg) if (curr_pool) s390_end_pool (curr_pool, NULL_RTX); - if (pending_ltrel) - abort (); - + gcc_assert (!pending_ltrel); /* Find all labels that are branched into from an insn belonging to a different chunk. */ - far_labels = BITMAP_XMALLOC (); + far_labels = BITMAP_ALLOC (NULL); for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { @@ -4784,7 +6064,8 @@ s390_chunkify_start (rtx base_reg) for (curr_pool = pool_list; curr_pool; curr_pool = curr_pool->next) { - rtx new_insn = gen_reload_base (base_reg, curr_pool->label); + rtx new_insn = gen_reload_base (cfun->machine->base_reg, + curr_pool->label); rtx insn = curr_pool->first_insn; INSN_ADDRESSES_NEW (emit_insn_before (new_insn, insn), -1); } @@ -4798,13 +6079,14 @@ s390_chunkify_start (rtx base_reg) struct constant_pool *pool = s390_find_pool (pool_list, insn); if (pool) { - rtx new_insn = gen_reload_base (base_reg, pool->label); + rtx new_insn = gen_reload_base (cfun->machine->base_reg, + pool->label); INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1); } } - BITMAP_XFREE (far_labels); + BITMAP_FREE (far_labels); /* Recompute insn addresses. */ @@ -4817,11 +6099,10 @@ s390_chunkify_start (rtx base_reg) /* POOL_LIST is a chunk list as prepared by s390_chunkify_start. After we have decided to use this list, finish implementing - all changes to the current function as required. BASE_REG is - to be used as pool base register. */ + all changes to the current function as required. */ static void -s390_chunkify_finish (struct constant_pool *pool_list, rtx base_reg) +s390_chunkify_finish (struct constant_pool *pool_list) { struct constant_pool *curr_pool = NULL; rtx insn; @@ -4832,7 +6113,7 @@ s390_chunkify_finish (struct constant_pool *pool_list, rtx base_reg) for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { if (INSN_P (insn)) - replace_ltrel_base (&PATTERN (insn), base_reg); + replace_ltrel_base (&PATTERN (insn)); curr_pool = s390_find_pool (pool_list, insn); if (!curr_pool) @@ -4844,9 +6125,13 @@ s390_chunkify_finish (struct constant_pool *pool_list, rtx base_reg) find_constant_pool_ref (PATTERN (insn), &pool_ref); if (pool_ref) { - addr = s390_find_constant (curr_pool, get_pool_constant (pool_ref), - get_pool_mode (pool_ref)); - addr = gen_rtx_PLUS (Pmode, base_reg, addr); + if (s390_execute_label (insn)) + addr = s390_find_execute (curr_pool, insn); + else + addr = s390_find_constant (curr_pool, + get_pool_constant (pool_ref), + get_pool_mode (pool_ref)); + replace_constant_pool_ref (&PATTERN (insn), pool_ref, addr); INSN_CODE (insn) = -1; } @@ -4929,334 +6214,41 @@ s390_chunkify_cancel (struct constant_pool *pool_list) } -/* Output to FILE the constant pool entry EXP in mode MODE - with alignment ALIGN. */ +/* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */ void -s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode, - unsigned int align) +s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) { REAL_VALUE_TYPE r; switch (GET_MODE_CLASS (mode)) { case MODE_FLOAT: - if (GET_CODE (exp) != CONST_DOUBLE) - abort (); + case MODE_DECIMAL_FLOAT: + gcc_assert (GET_CODE (exp) == CONST_DOUBLE); REAL_VALUE_FROM_CONST_DOUBLE (r, exp); assemble_real (r, mode, align); break; case MODE_INT: - if (GET_CODE (exp) == CONST - || GET_CODE (exp) == SYMBOL_REF - || GET_CODE (exp) == LABEL_REF) - { - fputs (integer_asm_op (GET_MODE_SIZE (mode), TRUE), file); - s390_output_symbolic_const (file, exp); - fputc ('\n', file); - } - else - { - assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); - } + assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); break; default: - abort (); + gcc_unreachable (); } } -/* Rework the prolog/epilog to avoid saving/restoring - registers unnecessarily. BASE_USED specifies whether - the literal pool base register needs to be saved. */ - -static void -s390_optimize_prolog (bool base_used) -{ - int save_first, save_last, restore_first, restore_last; - int i, j; - rtx insn, new_insn, next_insn; - - /* Recompute regs_ever_live data for special registers. */ - regs_ever_live[BASE_REGISTER] = base_used; - regs_ever_live[RETURN_REGNUM] = cfun->machine->save_return_addr_p; - regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; - - - /* Find first and last gpr to be saved. */ - - for (i = 6; i < 16; i++) - if (regs_ever_live[i]) - if (!global_regs[i] - || i == STACK_POINTER_REGNUM - || i == RETURN_REGNUM - || i == BASE_REGISTER - || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM)) - break; - - for (j = 15; j > i; j--) - if (regs_ever_live[j]) - if (!global_regs[j] - || j == STACK_POINTER_REGNUM - || j == RETURN_REGNUM - || j == BASE_REGISTER - || (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM)) - break; - - if (i == 16) - { - /* Nothing to save/restore. */ - save_first = restore_first = -1; - save_last = restore_last = -1; - } - else - { - /* Save/restore from i to j. */ - save_first = restore_first = i; - save_last = restore_last = j; - } - - /* Varargs functions need to save gprs 2 to 6. */ - if (current_function_stdarg) - { - save_first = 2; - if (save_last < 6) - save_last = 6; - } - - - /* If all special registers are in fact used, there's nothing we - can do, so no point in walking the insn list. */ - if (i <= BASE_REGISTER && j >= BASE_REGISTER - && (TARGET_CPU_ZARCH || (i <= RETURN_REGNUM && j >= RETURN_REGNUM))) - return; - - - /* Search for prolog/epilog insns and replace them. */ - - for (insn = get_insns (); insn; insn = next_insn) - { - int first, last, off; - rtx set, base, offset; - - next_insn = NEXT_INSN (insn); - - if (GET_CODE (insn) != INSN) - continue; - - if (GET_CODE (PATTERN (insn)) == PARALLEL - && store_multiple_operation (PATTERN (insn), VOIDmode)) - { - set = XVECEXP (PATTERN (insn), 0, 0); - first = REGNO (SET_SRC (set)); - last = first + XVECLEN (PATTERN (insn), 0) - 1; - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); - off = INTVAL (offset) - first * UNITS_PER_WORD; - - if (GET_CODE (base) != REG || off < 0) - continue; - if (first > BASE_REGISTER || last < BASE_REGISTER) - continue; - - if (save_first != -1) - { - new_insn = save_gprs (base, off, save_first, save_last); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } - - remove_insn (insn); - continue; - } - - if (GET_CODE (PATTERN (insn)) == SET - && GET_CODE (SET_SRC (PATTERN (insn))) == REG - && REGNO (SET_SRC (PATTERN (insn))) == BASE_REGISTER - && GET_CODE (SET_DEST (PATTERN (insn))) == MEM) - { - set = PATTERN (insn); - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); - off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD; - - if (GET_CODE (base) != REG || off < 0) - continue; - - if (save_first != -1) - { - new_insn = save_gprs (base, off, save_first, save_last); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } - - remove_insn (insn); - continue; - } - - if (GET_CODE (PATTERN (insn)) == PARALLEL - && load_multiple_operation (PATTERN (insn), VOIDmode)) - { - set = XVECEXP (PATTERN (insn), 0, 0); - first = REGNO (SET_DEST (set)); - last = first + XVECLEN (PATTERN (insn), 0) - 1; - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); - off = INTVAL (offset) - first * UNITS_PER_WORD; - - if (GET_CODE (base) != REG || off < 0) - continue; - if (first > BASE_REGISTER || last < BASE_REGISTER) - continue; - - if (restore_first != -1) - { - new_insn = restore_gprs (base, off, restore_first, restore_last); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } - - remove_insn (insn); - continue; - } - - if (GET_CODE (PATTERN (insn)) == SET - && GET_CODE (SET_DEST (PATTERN (insn))) == REG - && REGNO (SET_DEST (PATTERN (insn))) == BASE_REGISTER - && GET_CODE (SET_SRC (PATTERN (insn))) == MEM) - { - set = PATTERN (insn); - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); - off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD; - - if (GET_CODE (base) != REG || off < 0) - continue; - - if (restore_first != -1) - { - new_insn = restore_gprs (base, off, restore_first, restore_last); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } - - remove_insn (insn); - continue; - } - } -} - -/* Perform machine-dependent processing. */ - -static void -s390_reorg (void) -{ - rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER); - bool base_used = false; - bool pool_overflow = false; - - /* Make sure all splits have been performed; splits after - machine_dependent_reorg might confuse insn length counts. */ - split_all_insns_noflow (); - - - /* In small leaf functions, try to use an unused call-clobbered - register as base register to avoid save/restore overhead. */ - if (current_function_is_leaf && !regs_ever_live[5]) - base_reg = gen_rtx_REG (Pmode, 5); - - - /* Install the main literal pool and the associated base - register load insns. - - In addition, there are two problematic situations we need - to correct: - - - the literal pool might be > 4096 bytes in size, so that - some of its elements cannot be directly accessed - - - a branch target might be > 64K away from the branch, so that - it is not possible to use a PC-relative instruction. - - To fix those, we split the single literal pool into multiple - pool chunks, reloading the pool base register at various - points throughout the function to ensure it always points to - the pool chunk the following code expects, and / or replace - PC-relative branches by absolute branches. - - However, the two problems are interdependent: splitting the - literal pool can move a branch further away from its target, - causing the 64K limit to overflow, and on the other hand, - replacing a PC-relative branch by an absolute branch means - we need to put the branch target address into the literal - pool, possibly causing it to overflow. - - So, we loop trying to fix up both problems until we manage - to satisfy both conditions at the same time. Note that the - loop is guaranteed to terminate as every pass of the loop - strictly decreases the total number of PC-relative branches - in the function. (This is not completely true as there - might be branch-over-pool insns introduced by chunkify_start. - Those never need to be split however.) */ - - for (;;) - { - struct constant_pool *pool = NULL; - - /* Collect the literal pool. */ - if (!pool_overflow) - { - pool = s390_mainpool_start (); - if (!pool) - pool_overflow = true; - } - - /* If literal pool overflowed, start to chunkify it. */ - if (pool_overflow) - pool = s390_chunkify_start (base_reg); - - /* Split out-of-range branches. If this has created new - literal pool entries, cancel current chunk list and - recompute it. zSeries machines have large branch - instructions, so we never need to split a branch. */ - if (!TARGET_CPU_ZARCH && s390_split_branches ()) - { - if (pool_overflow) - s390_chunkify_cancel (pool); - else - s390_mainpool_cancel (pool); - - continue; - } - - /* If we made it up to here, both conditions are satisfied. - Finish up literal pool related changes. */ - if ((pool_overflow || pool->size > 0) - && REGNO (base_reg) == BASE_REGISTER) - base_used = true; - - if (pool_overflow) - s390_chunkify_finish (pool, base_reg); - else - s390_mainpool_finish (pool, base_reg); - - break; - } - - s390_optimize_prolog (base_used); -} - - /* Return an RTL expression representing the value of the return address for the frame COUNT steps up from the current frame. FRAME is the frame pointer of that frame. */ rtx -s390_return_addr_rtx (int count, rtx frame) +s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) { + int offset; rtx addr; /* Without backchain, we fail for all but the current frame. */ @@ -5268,17 +6260,48 @@ s390_return_addr_rtx (int count, rtx frame) value of RETURN_REGNUM is actually saved. */ if (count == 0) - cfun->machine->save_return_addr_p = true; + { + /* On non-z architectures branch splitting could overwrite r14. */ + if (TARGET_CPU_ZARCH) + return get_hard_reg_initial_val (Pmode, RETURN_REGNUM); + else + { + cfun_frame_layout.save_return_addr_p = true; + return gen_rtx_MEM (Pmode, return_address_pointer_rtx); + } + } - /* To retrieve the return address we read the stack slot where the - corresponding RETURN_REGNUM value was saved. */ + if (TARGET_PACKED_STACK) + offset = -2 * UNITS_PER_WORD; + else + offset = RETURN_REGNUM * UNITS_PER_WORD; - addr = plus_constant (frame, RETURN_REGNUM * UNITS_PER_WORD); + addr = plus_constant (frame, offset); addr = memory_address (Pmode, addr); return gen_rtx_MEM (Pmode, addr); } -/* Find first call clobbered register unsused in a function. +/* Return an RTL expression representing the back chain stored in + the current stack frame. */ + +rtx +s390_back_chain_rtx (void) +{ + rtx chain; + + gcc_assert (TARGET_BACKCHAIN); + + if (TARGET_PACKED_STACK) + chain = plus_constant (stack_pointer_rtx, + STACK_POINTER_OFFSET - UNITS_PER_WORD); + else + chain = stack_pointer_rtx; + + chain = gen_rtx_MEM (Pmode, chain); + return chain; +} + +/* Find first call clobbered register unused in a function. This could be used as base register in a leaf function or for holding the return address before epilogue. */ @@ -5292,113 +6315,633 @@ find_unused_clobbered_reg (void) return 0; } -/* Fill FRAME with info about frame of current function. */ + +/* Helper function for s390_regs_ever_clobbered. Sets the fields in DATA for all + clobbered hard regs in SETREG. */ + +static void +s390_reg_clobbered_rtx (rtx setreg, rtx set_insn ATTRIBUTE_UNUSED, void *data) +{ + int *regs_ever_clobbered = (int *)data; + unsigned int i, regno; + enum machine_mode mode = GET_MODE (setreg); + + if (GET_CODE (setreg) == SUBREG) + { + rtx inner = SUBREG_REG (setreg); + if (!GENERAL_REG_P (inner)) + return; + regno = subreg_regno (setreg); + } + else if (GENERAL_REG_P (setreg)) + regno = REGNO (setreg); + else + return; + + for (i = regno; + i < regno + HARD_REGNO_NREGS (regno, mode); + i++) + regs_ever_clobbered[i] = 1; +} + +/* Walks through all basic blocks of the current function looking + for clobbered hard regs using s390_reg_clobbered_rtx. The fields + of the passed integer array REGS_EVER_CLOBBERED are set to one for + each of those regs. */ + +static void +s390_regs_ever_clobbered (int *regs_ever_clobbered) +{ + basic_block cur_bb; + rtx cur_insn; + unsigned int i; + + memset (regs_ever_clobbered, 0, 16 * sizeof (int)); + + /* For non-leaf functions we have to consider all call clobbered regs to be + clobbered. */ + if (!current_function_is_leaf) + { + for (i = 0; i < 16; i++) + regs_ever_clobbered[i] = call_really_used_regs[i]; + } + + /* Make the "magic" eh_return registers live if necessary. For regs_ever_live + this work is done by liveness analysis (mark_regs_live_at_end). + Special care is needed for functions containing landing pads. Landing pads + may use the eh registers, but the code which sets these registers is not + contained in that function. Hence s390_regs_ever_clobbered is not able to + deal with this automatically. */ + if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p) + for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++) + if (current_function_calls_eh_return + || (cfun->machine->has_landing_pad_p + && regs_ever_live [EH_RETURN_DATA_REGNO (i)])) + regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1; + + /* For nonlocal gotos all call-saved registers have to be saved. + This flag is also set for the unwinding code in libgcc. + See expand_builtin_unwind_init. For regs_ever_live this is done by + reload. */ + if (current_function_has_nonlocal_label) + for (i = 0; i < 16; i++) + if (!call_really_used_regs[i]) + regs_ever_clobbered[i] = 1; + + FOR_EACH_BB (cur_bb) + { + FOR_BB_INSNS (cur_bb, cur_insn) + { + if (INSN_P (cur_insn)) + note_stores (PATTERN (cur_insn), + s390_reg_clobbered_rtx, + regs_ever_clobbered); + } + } +} + +/* Determine the frame area which actually has to be accessed + in the function epilogue. The values are stored at the + given pointers AREA_BOTTOM (address of the lowest used stack + address) and AREA_TOP (address of the first item which does + not belong to the stack frame). */ + +static void +s390_frame_area (int *area_bottom, int *area_top) +{ + int b, t; + int i; + + b = INT_MAX; + t = INT_MIN; + + if (cfun_frame_layout.first_restore_gpr != -1) + { + b = (cfun_frame_layout.gprs_offset + + cfun_frame_layout.first_restore_gpr * UNITS_PER_WORD); + t = b + (cfun_frame_layout.last_restore_gpr + - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_WORD; + } + + if (TARGET_64BIT && cfun_save_high_fprs_p) + { + b = MIN (b, cfun_frame_layout.f8_offset); + t = MAX (t, (cfun_frame_layout.f8_offset + + cfun_frame_layout.high_fprs * 8)); + } + + if (!TARGET_64BIT) + for (i = 2; i < 4; i++) + if (cfun_fpr_bit_p (i)) + { + b = MIN (b, cfun_frame_layout.f4_offset + (i - 2) * 8); + t = MAX (t, cfun_frame_layout.f4_offset + (i - 1) * 8); + } + + *area_bottom = b; + *area_top = t; +} + +/* Fill cfun->machine with info about register usage of current function. + Return in CLOBBERED_REGS which GPRs are currently considered set. */ + +static void +s390_register_info (int clobbered_regs[]) +{ + int i, j; + + /* fprs 8 - 15 are call saved for 64 Bit ABI. */ + cfun_frame_layout.fpr_bitmap = 0; + cfun_frame_layout.high_fprs = 0; + if (TARGET_64BIT) + for (i = 24; i < 32; i++) + if (regs_ever_live[i] && !global_regs[i]) + { + cfun_set_fpr_bit (i - 16); + cfun_frame_layout.high_fprs++; + } + + /* Find first and last gpr to be saved. We trust regs_ever_live + data, except that we don't save and restore global registers. + + Also, all registers with special meaning to the compiler need + to be handled extra. */ + + s390_regs_ever_clobbered (clobbered_regs); + + for (i = 0; i < 16; i++) + clobbered_regs[i] = clobbered_regs[i] && !global_regs[i] && !fixed_regs[i]; + + if (frame_pointer_needed) + clobbered_regs[HARD_FRAME_POINTER_REGNUM] = 1; + + if (flag_pic) + clobbered_regs[PIC_OFFSET_TABLE_REGNUM] + |= regs_ever_live[PIC_OFFSET_TABLE_REGNUM]; + + clobbered_regs[BASE_REGNUM] + |= (cfun->machine->base_reg + && REGNO (cfun->machine->base_reg) == BASE_REGNUM); + + clobbered_regs[RETURN_REGNUM] + |= (!current_function_is_leaf + || TARGET_TPF_PROFILING + || cfun->machine->split_branches_pending_p + || cfun_frame_layout.save_return_addr_p + || current_function_calls_eh_return + || current_function_stdarg); + + clobbered_regs[STACK_POINTER_REGNUM] + |= (!current_function_is_leaf + || TARGET_TPF_PROFILING + || cfun_save_high_fprs_p + || get_frame_size () > 0 + || current_function_calls_alloca + || current_function_stdarg); + + for (i = 6; i < 16; i++) + if (regs_ever_live[i] || clobbered_regs[i]) + break; + for (j = 15; j > i; j--) + if (regs_ever_live[j] || clobbered_regs[j]) + break; + + if (i == 16) + { + /* Nothing to save/restore. */ + cfun_frame_layout.first_save_gpr_slot = -1; + cfun_frame_layout.last_save_gpr_slot = -1; + cfun_frame_layout.first_save_gpr = -1; + cfun_frame_layout.first_restore_gpr = -1; + cfun_frame_layout.last_save_gpr = -1; + cfun_frame_layout.last_restore_gpr = -1; + } + else + { + /* Save slots for gprs from i to j. */ + cfun_frame_layout.first_save_gpr_slot = i; + cfun_frame_layout.last_save_gpr_slot = j; + + for (i = cfun_frame_layout.first_save_gpr_slot; + i < cfun_frame_layout.last_save_gpr_slot + 1; + i++) + if (clobbered_regs[i]) + break; + + for (j = cfun_frame_layout.last_save_gpr_slot; j > i; j--) + if (clobbered_regs[j]) + break; + + if (i == cfun_frame_layout.last_save_gpr_slot + 1) + { + /* Nothing to save/restore. */ + cfun_frame_layout.first_save_gpr = -1; + cfun_frame_layout.first_restore_gpr = -1; + cfun_frame_layout.last_save_gpr = -1; + cfun_frame_layout.last_restore_gpr = -1; + } + else + { + /* Save / Restore from gpr i to j. */ + cfun_frame_layout.first_save_gpr = i; + cfun_frame_layout.first_restore_gpr = i; + cfun_frame_layout.last_save_gpr = j; + cfun_frame_layout.last_restore_gpr = j; + } + } + + if (current_function_stdarg) + { + /* Varargs functions need to save gprs 2 to 6. */ + if (cfun->va_list_gpr_size + && current_function_args_info.gprs < GP_ARG_NUM_REG) + { + int min_gpr = current_function_args_info.gprs; + int max_gpr = min_gpr + cfun->va_list_gpr_size; + if (max_gpr > GP_ARG_NUM_REG) + max_gpr = GP_ARG_NUM_REG; + + if (cfun_frame_layout.first_save_gpr == -1 + || cfun_frame_layout.first_save_gpr > 2 + min_gpr) + { + cfun_frame_layout.first_save_gpr = 2 + min_gpr; + cfun_frame_layout.first_save_gpr_slot = 2 + min_gpr; + } + + if (cfun_frame_layout.last_save_gpr == -1 + || cfun_frame_layout.last_save_gpr < 2 + max_gpr - 1) + { + cfun_frame_layout.last_save_gpr = 2 + max_gpr - 1; + cfun_frame_layout.last_save_gpr_slot = 2 + max_gpr - 1; + } + } + + /* Mark f0, f2 for 31 bit and f0-f4 for 64 bit to be saved. */ + if (TARGET_HARD_FLOAT && cfun->va_list_fpr_size + && current_function_args_info.fprs < FP_ARG_NUM_REG) + { + int min_fpr = current_function_args_info.fprs; + int max_fpr = min_fpr + cfun->va_list_fpr_size; + if (max_fpr > FP_ARG_NUM_REG) + max_fpr = FP_ARG_NUM_REG; + + /* ??? This is currently required to ensure proper location + of the fpr save slots within the va_list save area. */ + if (TARGET_PACKED_STACK) + min_fpr = 0; + + for (i = min_fpr; i < max_fpr; i++) + cfun_set_fpr_bit (i); + } + } + + if (!TARGET_64BIT) + for (i = 2; i < 4; i++) + if (regs_ever_live[i + 16] && !global_regs[i + 16]) + cfun_set_fpr_bit (i); +} + +/* Fill cfun->machine with info about frame of current function. */ static void s390_frame_info (void) { - int i, j; - HOST_WIDE_INT fsize = get_frame_size (); + int i; - if (!TARGET_64BIT && fsize > 0x7fff0000) - fatal_error ("Total size of local variables exceeds architecture limit."); - - /* fprs 8 - 15 are caller saved for 64 Bit ABI. */ - cfun->machine->save_fprs_p = 0; - if (TARGET_64BIT) - for (i = 24; i < 32; i++) - if (regs_ever_live[i] && !global_regs[i]) + cfun_frame_layout.frame_size = get_frame_size (); + if (!TARGET_64BIT && cfun_frame_layout.frame_size > 0x7fff0000) + fatal_error ("total size of local variables exceeds architecture limit"); + + if (!TARGET_PACKED_STACK) + { + cfun_frame_layout.backchain_offset = 0; + cfun_frame_layout.f0_offset = 16 * UNITS_PER_WORD; + cfun_frame_layout.f4_offset = cfun_frame_layout.f0_offset + 2 * 8; + cfun_frame_layout.f8_offset = -cfun_frame_layout.high_fprs * 8; + cfun_frame_layout.gprs_offset = (cfun_frame_layout.first_save_gpr_slot + * UNITS_PER_WORD); + } + else if (TARGET_BACKCHAIN) /* kernel stack layout */ + { + cfun_frame_layout.backchain_offset = (STACK_POINTER_OFFSET + - UNITS_PER_WORD); + cfun_frame_layout.gprs_offset + = (cfun_frame_layout.backchain_offset + - (STACK_POINTER_REGNUM - cfun_frame_layout.first_save_gpr_slot + 1) + * UNITS_PER_WORD); + + if (TARGET_64BIT) { - cfun->machine->save_fprs_p = 1; - break; + cfun_frame_layout.f4_offset + = (cfun_frame_layout.gprs_offset + - 8 * (cfun_fpr_bit_p (2) + cfun_fpr_bit_p (3))); + + cfun_frame_layout.f0_offset + = (cfun_frame_layout.f4_offset + - 8 * (cfun_fpr_bit_p (0) + cfun_fpr_bit_p (1))); } + else + { + /* On 31 bit we have to care about alignment of the + floating point regs to provide fastest access. */ + cfun_frame_layout.f0_offset + = ((cfun_frame_layout.gprs_offset + & ~(STACK_BOUNDARY / BITS_PER_UNIT - 1)) + - 8 * (cfun_fpr_bit_p (0) + cfun_fpr_bit_p (1))); + + cfun_frame_layout.f4_offset + = (cfun_frame_layout.f0_offset + - 8 * (cfun_fpr_bit_p (2) + cfun_fpr_bit_p (3))); + } + } + else /* no backchain */ + { + cfun_frame_layout.f4_offset + = (STACK_POINTER_OFFSET + - 8 * (cfun_fpr_bit_p (2) + cfun_fpr_bit_p (3))); + + cfun_frame_layout.f0_offset + = (cfun_frame_layout.f4_offset + - 8 * (cfun_fpr_bit_p (0) + cfun_fpr_bit_p (1))); + + cfun_frame_layout.gprs_offset + = cfun_frame_layout.f0_offset - cfun_gprs_save_area_size; + } - cfun->machine->frame_size = fsize + cfun->machine->save_fprs_p * 64; + if (current_function_is_leaf + && !TARGET_TPF_PROFILING + && cfun_frame_layout.frame_size == 0 + && !cfun_save_high_fprs_p + && !current_function_calls_alloca + && !current_function_stdarg) + return; - /* Does function need to setup frame and save area. */ + if (!TARGET_PACKED_STACK) + cfun_frame_layout.frame_size += (STACK_POINTER_OFFSET + + current_function_outgoing_args_size + + cfun_frame_layout.high_fprs * 8); + else + { + if (TARGET_BACKCHAIN) + cfun_frame_layout.frame_size += UNITS_PER_WORD; - if (! current_function_is_leaf - || cfun->machine->frame_size > 0 - || current_function_calls_alloca - || current_function_stdarg) - cfun->machine->frame_size += STARTING_FRAME_OFFSET; + /* No alignment trouble here because f8-f15 are only saved under + 64 bit. */ + cfun_frame_layout.f8_offset = (MIN (MIN (cfun_frame_layout.f0_offset, + cfun_frame_layout.f4_offset), + cfun_frame_layout.gprs_offset) + - cfun_frame_layout.high_fprs * 8); - /* If we use the return register, we'll need to make sure - it is going to be saved/restored. */ + cfun_frame_layout.frame_size += cfun_frame_layout.high_fprs * 8; - if (!current_function_is_leaf - || regs_ever_live[RETURN_REGNUM]) - cfun->machine->save_return_addr_p = 1; + for (i = 0; i < 8; i++) + if (cfun_fpr_bit_p (i)) + cfun_frame_layout.frame_size += 8; + + cfun_frame_layout.frame_size += cfun_gprs_save_area_size; + + /* If under 31 bit an odd number of gprs has to be saved we have to adjust + the frame size to sustain 8 byte alignment of stack frames. */ + cfun_frame_layout.frame_size = ((cfun_frame_layout.frame_size + + STACK_BOUNDARY / BITS_PER_UNIT - 1) + & ~(STACK_BOUNDARY / BITS_PER_UNIT - 1)); - /* Find first and last gpr to be saved. Note that at this point, - we assume the base register and -on S/390- the return register - always need to be saved. This is done because the usage of these - register might change even after the prolog was emitted. - If it turns out later that we really don't need them, the - prolog/epilog code is modified again. */ - - regs_ever_live[BASE_REGISTER] = 1; - if (!TARGET_CPU_ZARCH || cfun->machine->save_return_addr_p) - regs_ever_live[RETURN_REGNUM] = 1; - regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; - - for (i = 6; i < 16; i++) - if (regs_ever_live[i]) - if (!global_regs[i] - || i == STACK_POINTER_REGNUM - || i == RETURN_REGNUM - || i == BASE_REGISTER - || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM)) - break; - - for (j = 15; j > i; j--) - if (regs_ever_live[j]) - if (!global_regs[j] - || j == STACK_POINTER_REGNUM - || j == RETURN_REGNUM - || j == BASE_REGISTER - || (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM)) - break; - - /* Save / Restore from gpr i to j. */ - cfun->machine->first_save_gpr = i; - cfun->machine->first_restore_gpr = i; - cfun->machine->last_save_gpr = j; - - /* Varargs functions need to save gprs 2 to 6. */ - if (current_function_stdarg) - cfun->machine->first_save_gpr = 2; + cfun_frame_layout.frame_size += current_function_outgoing_args_size; + } } -/* Return offset between argument pointer and frame pointer - initially after prologue. */ +/* Generate frame layout. Fills in register and frame data for the current + function in cfun->machine. This routine can be called multiple times; + it will re-do the complete frame layout every time. */ -HOST_WIDE_INT -s390_arg_frame_offset (void) +static void +s390_init_frame_layout (void) { - HOST_WIDE_INT fsize = get_frame_size (); - int save_fprs_p, i; + HOST_WIDE_INT frame_size; + int base_used; + int clobbered_regs[16]; - /* fprs 8 - 15 are caller saved for 64 Bit ABI. */ - save_fprs_p = 0; - if (TARGET_64BIT) - for (i = 24; i < 32; i++) - if (regs_ever_live[i] && !global_regs[i]) + /* On S/390 machines, we may need to perform branch splitting, which + will require both base and return address register. We have no + choice but to assume we're going to need them until right at the + end of the machine dependent reorg phase. */ + if (!TARGET_CPU_ZARCH) + cfun->machine->split_branches_pending_p = true; + + do + { + frame_size = cfun_frame_layout.frame_size; + + /* Try to predict whether we'll need the base register. */ + base_used = cfun->machine->split_branches_pending_p + || current_function_uses_const_pool + || (!DISP_IN_RANGE (frame_size) + && !CONST_OK_FOR_K (frame_size)); + + /* Decide which register to use as literal pool base. In small + leaf functions, try to use an unused call-clobbered register + as base register to avoid save/restore overhead. */ + if (!base_used) + cfun->machine->base_reg = NULL_RTX; + else if (current_function_is_leaf && !regs_ever_live[5]) + cfun->machine->base_reg = gen_rtx_REG (Pmode, 5); + else + cfun->machine->base_reg = gen_rtx_REG (Pmode, BASE_REGNUM); + + s390_register_info (clobbered_regs); + s390_frame_info (); + } + while (frame_size != cfun_frame_layout.frame_size); +} + +/* Update frame layout. Recompute actual register save data based on + current info and update regs_ever_live for the special registers. + May be called multiple times, but may never cause *more* registers + to be saved than s390_init_frame_layout allocated room for. */ + +static void +s390_update_frame_layout (void) +{ + int clobbered_regs[16]; + + s390_register_info (clobbered_regs); + + regs_ever_live[BASE_REGNUM] = clobbered_regs[BASE_REGNUM]; + regs_ever_live[RETURN_REGNUM] = clobbered_regs[RETURN_REGNUM]; + regs_ever_live[STACK_POINTER_REGNUM] = clobbered_regs[STACK_POINTER_REGNUM]; + + if (cfun->machine->base_reg) + regs_ever_live[REGNO (cfun->machine->base_reg)] = 1; +} + +/* Return true if it is legal to put a value with MODE into REGNO. */ + +bool +s390_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) +{ + switch (REGNO_REG_CLASS (regno)) + { + case FP_REGS: + if (REGNO_PAIR_OK (regno, mode)) { - save_fprs_p = 1; - break; + if (mode == SImode || mode == DImode) + return true; + + if (FLOAT_MODE_P (mode) && GET_MODE_CLASS (mode) != MODE_VECTOR_FLOAT) + return true; + } + break; + case ADDR_REGS: + if (FRAME_REGNO_P (regno) && mode == Pmode) + return true; + + /* fallthrough */ + case GENERAL_REGS: + if (REGNO_PAIR_OK (regno, mode)) + { + if (TARGET_64BIT + || (mode != TFmode && mode != TCmode && mode != TDmode)) + return true; + } + break; + case CC_REGS: + if (GET_MODE_CLASS (mode) == MODE_CC) + return true; + break; + case ACCESS_REGS: + if (REGNO_PAIR_OK (regno, mode)) + { + if (mode == SImode || mode == Pmode) + return true; + } + break; + default: + return false; + } + + return false; +} + +/* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ + +bool +s390_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg) +{ + /* Once we've decided upon a register to use as base register, it must + no longer be used for any other purpose. */ + if (cfun->machine->base_reg) + if (REGNO (cfun->machine->base_reg) == old_reg + || REGNO (cfun->machine->base_reg) == new_reg) + return false; + + return true; +} + +/* Maximum number of registers to represent a value of mode MODE + in a register of class CLASS. */ + +bool +s390_class_max_nregs (enum reg_class class, enum machine_mode mode) +{ + switch (class) + { + case FP_REGS: + if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) + return 2 * ((GET_MODE_SIZE (mode) / 2 + 8 - 1) / 8); + else + return (GET_MODE_SIZE (mode) + 8 - 1) / 8; + case ACCESS_REGS: + return (GET_MODE_SIZE (mode) + 4 - 1) / 4; + default: + break; + } + return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; +} + +/* Return true if register FROM can be eliminated via register TO. */ + +bool +s390_can_eliminate (int from, int to) +{ + /* On zSeries machines, we have not marked the base register as fixed. + Instead, we have an elimination rule BASE_REGNUM -> BASE_REGNUM. + If a function requires the base register, we say here that this + elimination cannot be performed. This will cause reload to free + up the base register (as if it were fixed). On the other hand, + if the current function does *not* require the base register, we + say here the elimination succeeds, which in turn allows reload + to allocate the base register for any other purpose. */ + if (from == BASE_REGNUM && to == BASE_REGNUM) + { + if (TARGET_CPU_ZARCH) + { + s390_init_frame_layout (); + return cfun->machine->base_reg == NULL_RTX; } - fsize = fsize + save_fprs_p * 64; + return false; + } - /* Does function need to setup frame and save area. */ + /* Everything else must point into the stack frame. */ + gcc_assert (to == STACK_POINTER_REGNUM + || to == HARD_FRAME_POINTER_REGNUM); - if (! current_function_is_leaf - || fsize > 0 - || current_function_calls_alloca - || current_function_stdarg) - fsize += STARTING_FRAME_OFFSET; - return fsize + STACK_POINTER_OFFSET; + gcc_assert (from == FRAME_POINTER_REGNUM + || from == ARG_POINTER_REGNUM + || from == RETURN_ADDRESS_POINTER_REGNUM); + + /* Make sure we actually saved the return address. */ + if (from == RETURN_ADDRESS_POINTER_REGNUM) + if (!current_function_calls_eh_return + && !current_function_stdarg + && !cfun_frame_layout.save_return_addr_p) + return false; + + return true; +} + +/* Return offset between register FROM and TO initially after prolog. */ + +HOST_WIDE_INT +s390_initial_elimination_offset (int from, int to) +{ + HOST_WIDE_INT offset; + int index; + + /* ??? Why are we called for non-eliminable pairs? */ + if (!s390_can_eliminate (from, to)) + return 0; + + switch (from) + { + case FRAME_POINTER_REGNUM: + offset = (get_frame_size() + + STACK_POINTER_OFFSET + + current_function_outgoing_args_size); + break; + + case ARG_POINTER_REGNUM: + s390_init_frame_layout (); + offset = cfun_frame_layout.frame_size + STACK_POINTER_OFFSET; + break; + + case RETURN_ADDRESS_POINTER_REGNUM: + s390_init_frame_layout (); + index = RETURN_REGNUM - cfun_frame_layout.first_save_gpr_slot; + gcc_assert (index >= 0); + offset = cfun_frame_layout.frame_size + cfun_frame_layout.gprs_offset; + offset += index * UNITS_PER_WORD; + break; + + case BASE_REGNUM: + offset = 0; + break; + + default: + gcc_unreachable (); + } + + return offset; } /* Emit insn to save fpr REGNUM at offset OFFSET relative @@ -5409,7 +6952,11 @@ save_fpr (rtx base, int offset, int regnum) { rtx addr; addr = gen_rtx_MEM (DFmode, plus_constant (base, offset)); - set_mem_alias_set (addr, s390_sr_alias_set); + + if (regnum >= 16 && regnum <= (16 + FP_ARG_NUM_REG)) + set_mem_alias_set (addr, get_varargs_alias_set ()); + else + set_mem_alias_set (addr, get_frame_alias_set ()); return emit_move_insn (addr, gen_rtx_REG (DFmode, regnum)); } @@ -5422,7 +6969,7 @@ restore_fpr (rtx base, int offset, int regnum) { rtx addr; addr = gen_rtx_MEM (DFmode, plus_constant (base, offset)); - set_mem_alias_set (addr, s390_sr_alias_set); + set_mem_alias_set (addr, get_frame_alias_set ()); return emit_move_insn (gen_rtx_REG (DFmode, regnum), addr); } @@ -5437,9 +6984,10 @@ save_gprs (rtx base, int offset, int first, int last) rtx addr, insn, note; int i; - addr = plus_constant (base, offset + first * UNITS_PER_WORD); + addr = plus_constant (base, offset); addr = gen_rtx_MEM (Pmode, addr); - set_mem_alias_set (addr, s390_sr_alias_set); + + set_mem_alias_set (addr, get_frame_alias_set ()); /* Special-case single register. */ if (first == last) @@ -5458,6 +7006,14 @@ save_gprs (rtx base, int offset, int first, int last) gen_rtx_REG (Pmode, first), GEN_INT (last - first + 1)); + if (first <= 6 && current_function_stdarg) + for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) + { + rtx mem = XEXP (XVECEXP (PATTERN (insn), 0, i), 0); + + if (first + i <= 6) + set_mem_alias_set (mem, get_varargs_alias_set ()); + } /* We need to set the FRAME_RELATED flag on all SETs inside the store-multiple pattern. @@ -5465,7 +7021,7 @@ save_gprs (rtx base, int offset, int first, int last) However, we must not emit DWARF records for registers 2..5 if they are stored for use by variable arguments ... - ??? Unfortunately, it is not enough to simply not the the + ??? Unfortunately, it is not enough to simply not the FRAME_RELATED flags for those SETs, because the first SET of the PARALLEL is always treated as if it had the flag set, even if it does not. Therefore we emit a new pattern @@ -5483,7 +7039,7 @@ save_gprs (rtx base, int offset, int first, int last) } else if (last >= 6) { - addr = plus_constant (base, offset + 6 * UNITS_PER_WORD); + addr = plus_constant (base, offset + (6 - first) * UNITS_PER_WORD); note = gen_store_multiple (gen_rtx_MEM (Pmode, addr), gen_rtx_REG (Pmode, 6), GEN_INT (last - 6 + 1)); @@ -5512,9 +7068,9 @@ restore_gprs (rtx base, int offset, int first, int last) { rtx addr, insn; - addr = plus_constant (base, offset + first * UNITS_PER_WORD); + addr = plus_constant (base, offset); addr = gen_rtx_MEM (Pmode, addr); - set_mem_alias_set (addr, s390_sr_alias_set); + set_mem_alias_set (addr, get_frame_alias_set ()); /* Special-case single register. */ if (first == last) @@ -5533,49 +7089,47 @@ restore_gprs (rtx base, int offset, int first, int last) return insn; } -/* Emit code to load the GOT register. If MAYBE_DEAD is true, - annotate generated insns with REG_MAYBE_DEAD notes. */ +/* Return insn sequence to load the GOT register. */ static GTY(()) rtx got_symbol; -void -s390_load_got (int maybe_dead) +rtx +s390_load_got (void) { + rtx insns; + if (!got_symbol) { got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); SYMBOL_REF_FLAGS (got_symbol) = SYMBOL_FLAG_LOCAL; } + start_sequence (); + if (TARGET_CPU_ZARCH) { - rtx insn = emit_move_insn (pic_offset_table_rtx, got_symbol); - if (maybe_dead) - REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX, - REG_NOTES (insn)); + emit_move_insn (pic_offset_table_rtx, got_symbol); } else { - rtx offset, insn; + rtx offset; offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, got_symbol), UNSPEC_LTREL_OFFSET); offset = gen_rtx_CONST (Pmode, offset); offset = force_const_mem (Pmode, offset); - insn = emit_move_insn (pic_offset_table_rtx, offset); - if (maybe_dead) - REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX, - REG_NOTES (insn)); + emit_move_insn (pic_offset_table_rtx, offset); offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (offset, 0)), UNSPEC_LTREL_BASE); offset = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, offset); - insn = emit_move_insn (pic_offset_table_rtx, offset); - if (maybe_dead) - REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX, - REG_NOTES (insn)); + emit_move_insn (pic_offset_table_rtx, offset); } + + insns = get_insns (); + end_sequence (); + return insns; } /* Expand the prologue into a bunch of separate insns. */ @@ -5586,90 +7140,179 @@ s390_emit_prologue (void) rtx insn, addr; rtx temp_reg; int i; + int offset; + int next_fpr = 0; - /* Compute frame_info. */ + /* Complete frame layout. */ - s390_frame_info (); + s390_update_frame_layout (); + + /* Annotate all constant pool references to let the scheduler know + they implicitly use the base register. */ + + push_topmost_sequence (); + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn)) + annotate_constant_pool_refs (&PATTERN (insn)); + + pop_topmost_sequence (); /* Choose best register to use for temp use within prologue. See below for why TPF must use the register 1. */ - if (!current_function_is_leaf - && !TARGET_TPF) + if (!has_hard_reg_initial_val (Pmode, RETURN_REGNUM) + && !current_function_is_leaf + && !TARGET_TPF_PROFILING) temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); else temp_reg = gen_rtx_REG (Pmode, 1); /* Save call saved gprs. */ - - insn = save_gprs (stack_pointer_rtx, 0, - cfun->machine->first_save_gpr, cfun->machine->last_save_gpr); - emit_insn (insn); + if (cfun_frame_layout.first_save_gpr != -1) + { + insn = save_gprs (stack_pointer_rtx, + cfun_frame_layout.gprs_offset + + UNITS_PER_WORD * (cfun_frame_layout.first_save_gpr + - cfun_frame_layout.first_save_gpr_slot), + cfun_frame_layout.first_save_gpr, + cfun_frame_layout.last_save_gpr); + emit_insn (insn); + } /* Dummy insn to mark literal pool slot. */ - emit_insn (gen_main_pool ()); + if (cfun->machine->base_reg) + emit_insn (gen_main_pool (cfun->machine->base_reg)); - /* Save fprs for variable args. */ + offset = cfun_frame_layout.f0_offset; - if (current_function_stdarg) - for (i = 16; i < (TARGET_64BIT ? 20 : 18); i++) - save_fpr (stack_pointer_rtx, 16*UNITS_PER_WORD + 8*(i-16), i); - - /* Save fprs 4 and 6 if used (31 bit ABI). */ - - if (!TARGET_64BIT) - for (i = 18; i < 20; i++) - if (regs_ever_live[i] && !global_regs[i]) + /* Save f0 and f2. */ + for (i = 0; i < 2; i++) + { + if (cfun_fpr_bit_p (i)) { - insn = save_fpr (stack_pointer_rtx, 16*UNITS_PER_WORD + 8*(i-16), i); - RTX_FRAME_RELATED_P (insn) = 1; + save_fpr (stack_pointer_rtx, offset, i + 16); + offset += 8; } + else if (!TARGET_PACKED_STACK) + offset += 8; + } + + /* Save f4 and f6. */ + offset = cfun_frame_layout.f4_offset; + for (i = 2; i < 4; i++) + { + if (cfun_fpr_bit_p (i)) + { + insn = save_fpr (stack_pointer_rtx, offset, i + 16); + offset += 8; + + /* If f4 and f6 are call clobbered they are saved due to stdargs and + therefore are not frame related. */ + if (!call_really_used_regs[i + 16]) + RTX_FRAME_RELATED_P (insn) = 1; + } + else if (!TARGET_PACKED_STACK) + offset += 8; + } + + if (TARGET_PACKED_STACK + && cfun_save_high_fprs_p + && cfun_frame_layout.f8_offset + cfun_frame_layout.high_fprs * 8 > 0) + { + offset = (cfun_frame_layout.f8_offset + + (cfun_frame_layout.high_fprs - 1) * 8); + + for (i = 15; i > 7 && offset >= 0; i--) + if (cfun_fpr_bit_p (i)) + { + insn = save_fpr (stack_pointer_rtx, offset, i + 16); + + RTX_FRAME_RELATED_P (insn) = 1; + offset -= 8; + } + if (offset >= cfun_frame_layout.f8_offset) + next_fpr = i + 16; + } + + if (!TARGET_PACKED_STACK) + next_fpr = cfun_save_high_fprs_p ? 31 : 0; /* Decrement stack pointer. */ - if (cfun->machine->frame_size > 0) + if (cfun_frame_layout.frame_size > 0) { - rtx frame_off = GEN_INT (-cfun->machine->frame_size); + rtx frame_off = GEN_INT (-cfun_frame_layout.frame_size); + + if (s390_stack_size) + { + HOST_WIDE_INT stack_check_mask = ((s390_stack_size - 1) + & ~(s390_stack_guard - 1)); + rtx t = gen_rtx_AND (Pmode, stack_pointer_rtx, + GEN_INT (stack_check_mask)); + + if (TARGET_64BIT) + gen_cmpdi (t, const0_rtx); + else + gen_cmpsi (t, const0_rtx); + + emit_insn (gen_conditional_trap (gen_rtx_EQ (CCmode, + gen_rtx_REG (CCmode, + CC_REGNUM), + const0_rtx), + const0_rtx)); + } + + if (s390_warn_framesize > 0 + && cfun_frame_layout.frame_size >= s390_warn_framesize) + warning (0, "frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes", + current_function_name (), cfun_frame_layout.frame_size); + + if (s390_warn_dynamicstack_p && cfun->calls_alloca) + warning (0, "%qs uses dynamic stack allocation", current_function_name ()); /* Save incoming stack pointer into temp reg. */ - - if (TARGET_BACKCHAIN || cfun->machine->save_fprs_p) - { - insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx)); - } + if (TARGET_BACKCHAIN || next_fpr) + insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx)); /* Subtract frame size from stack pointer. */ if (DISP_IN_RANGE (INTVAL (frame_off))) { insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx, - gen_rtx_PLUS (Pmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, stack_pointer_rtx, frame_off)); insn = emit_insn (insn); } else { - if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K")) + if (!CONST_OK_FOR_K (INTVAL (frame_off))) frame_off = force_const_mem (Pmode, frame_off); insn = emit_insn (gen_add2_insn (stack_pointer_rtx, frame_off)); + annotate_constant_pool_refs (&PATTERN (insn)); } RTX_FRAME_RELATED_P (insn) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, gen_rtx_SET (VOIDmode, stack_pointer_rtx, - gen_rtx_PLUS (Pmode, stack_pointer_rtx, - GEN_INT (-cfun->machine->frame_size))), + gen_rtx_PLUS (Pmode, stack_pointer_rtx, + GEN_INT (-cfun_frame_layout.frame_size))), REG_NOTES (insn)); /* Set backchain. */ if (TARGET_BACKCHAIN) { - addr = gen_rtx_MEM (Pmode, stack_pointer_rtx); - set_mem_alias_set (addr, s390_sr_alias_set); + if (cfun_frame_layout.backchain_offset) + addr = gen_rtx_MEM (Pmode, + plus_constant (stack_pointer_rtx, + cfun_frame_layout.backchain_offset)); + else + addr = gen_rtx_MEM (Pmode, stack_pointer_rtx); + set_mem_alias_set (addr, get_frame_alias_set ()); insn = emit_insn (gen_move_insn (addr, temp_reg)); } @@ -5686,24 +7329,30 @@ s390_emit_prologue (void) /* Save fprs 8 - 15 (64 bit ABI). */ - if (cfun->machine->save_fprs_p) + if (cfun_save_high_fprs_p && next_fpr) { - insn = emit_insn (gen_add2_insn (temp_reg, GEN_INT(-64))); + insn = emit_insn (gen_add2_insn (temp_reg, + GEN_INT (cfun_frame_layout.f8_offset))); - for (i = 24; i < 32; i++) - if (regs_ever_live[i] && !global_regs[i]) + offset = 0; + + for (i = 24; i <= next_fpr; i++) + if (cfun_fpr_bit_p (i - 16)) { rtx addr = plus_constant (stack_pointer_rtx, - cfun->machine->frame_size - 64 + (i-24)*8); - - insn = save_fpr (temp_reg, (i-24)*8, i); + cfun_frame_layout.frame_size + + cfun_frame_layout.f8_offset + + offset); + + insn = save_fpr (temp_reg, offset, i); + offset += 8; RTX_FRAME_RELATED_P (insn) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - gen_rtx_MEM (DFmode, addr), - gen_rtx_REG (DFmode, i)), - REG_NOTES (insn)); + gen_rtx_SET (VOIDmode, + gen_rtx_MEM (DFmode, addr), + gen_rtx_REG (DFmode, i)), + REG_NOTES (insn)); } } @@ -5718,24 +7367,26 @@ s390_emit_prologue (void) /* Set up got pointer, if needed. */ if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]) - s390_load_got(true); + { + rtx insns = s390_load_got (); - if (TARGET_TPF) + for (insn = insns; insn; insn = NEXT_INSN (insn)) + { + annotate_constant_pool_refs (&PATTERN (insn)); + + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX, + REG_NOTES (insn)); + } + + emit_insn (insns); + } + + if (TARGET_TPF_PROFILING) { /* Generate a BAS instruction to serve as a function entry intercept to facilitate the use of tracing - algorithms located at the branch target. - - This must use register 1. */ - rtx addr; - rtx unkn; - rtx link; - - addr = GEN_INT (0xfe0); - unkn = CONST0_RTX (SImode); - link = gen_rtx_REG (Pmode, 1); - - emit_call_insn (gen_call_exp (gen_rtx_MEM (QImode, addr), unkn, link)); + algorithms located at the branch target. */ + emit_insn (gen_prologue_tpf ()); /* Emit a blockage here so that all code lies between the profiling mechanisms. */ @@ -5746,76 +7397,34 @@ s390_emit_prologue (void) /* Expand the epilogue into a bunch of separate insns. */ void -s390_emit_epilogue (void) +s390_emit_epilogue (bool sibcall) { rtx frame_pointer, return_reg; int area_bottom, area_top, offset = 0; + int next_offset; rtvec p; int i; - if (TARGET_TPF) + if (TARGET_TPF_PROFILING) { /* Generate a BAS instruction to serve as a function entry intercept to facilitate the use of tracing - algorithms located at the branch target. - - This must use register 1. */ - - rtx addr; - rtx unkn; - rtx link; - - addr = GEN_INT (0xfe6); - unkn = CONST0_RTX (SImode); - link = gen_rtx_REG (Pmode, 1); + algorithms located at the branch target. */ /* Emit a blockage here so that all code lies between the profiling mechanisms. */ emit_insn (gen_blockage ()); - emit_call_insn (gen_call_exp (gen_rtx_MEM (QImode, addr), unkn, link)); + emit_insn (gen_epilogue_tpf ()); } /* Check whether to use frame or stack pointer for restore. */ - frame_pointer = frame_pointer_needed ? - hard_frame_pointer_rtx : stack_pointer_rtx; + frame_pointer = (frame_pointer_needed + ? hard_frame_pointer_rtx : stack_pointer_rtx); - /* Compute which parts of the save area we need to access. */ - - if (cfun->machine->first_restore_gpr != -1) - { - area_bottom = cfun->machine->first_restore_gpr * UNITS_PER_WORD; - area_top = (cfun->machine->last_save_gpr + 1) * UNITS_PER_WORD; - } - else - { - area_bottom = INT_MAX; - area_top = INT_MIN; - } - - if (TARGET_64BIT) - { - if (cfun->machine->save_fprs_p) - { - if (area_bottom > -64) - area_bottom = -64; - if (area_top < 0) - area_top = 0; - } - } - else - { - for (i = 18; i < 20; i++) - if (regs_ever_live[i] && !global_regs[i]) - { - if (area_bottom > 16*UNITS_PER_WORD + 8*(i-16)) - area_bottom = 16*UNITS_PER_WORD + 8*(i-16); - if (area_top < 16*UNITS_PER_WORD + 8*(i-16) + 8) - area_top = 16*UNITS_PER_WORD + 8*(i-16) + 8; - } - } + s390_frame_area (&area_bottom, &area_top); /* Check whether we can access the register save area. If not, increment the frame pointer as required. */ @@ -5824,18 +7433,18 @@ s390_emit_epilogue (void) { /* Nothing to restore. */ } - else if (DISP_IN_RANGE (cfun->machine->frame_size + area_bottom) - && DISP_IN_RANGE (cfun->machine->frame_size + area_top-1)) + else if (DISP_IN_RANGE (cfun_frame_layout.frame_size + area_bottom) + && DISP_IN_RANGE (cfun_frame_layout.frame_size + area_top - 1)) { /* Area is in range. */ - offset = cfun->machine->frame_size; + offset = cfun_frame_layout.frame_size; } else { rtx insn, frame_off; offset = area_bottom < 0 ? -area_bottom : 0; - frame_off = GEN_INT (cfun->machine->frame_size - offset); + frame_off = GEN_INT (cfun_frame_layout.frame_size - offset); if (DISP_IN_RANGE (INTVAL (frame_off))) { @@ -5845,10 +7454,11 @@ s390_emit_epilogue (void) } else { - if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K")) + if (!CONST_OK_FOR_K (INTVAL (frame_off))) frame_off = force_const_mem (Pmode, frame_off); insn = emit_insn (gen_add2_insn (frame_pointer, frame_off)); + annotate_constant_pool_refs (&PATTERN (insn)); } } @@ -5856,18 +7466,36 @@ s390_emit_epilogue (void) if (TARGET_64BIT) { - if (cfun->machine->save_fprs_p) - for (i = 24; i < 32; i++) - if (regs_ever_live[i] && !global_regs[i]) - restore_fpr (frame_pointer, - offset - 64 + (i-24) * 8, i); + if (cfun_save_high_fprs_p) + { + next_offset = cfun_frame_layout.f8_offset; + for (i = 24; i < 32; i++) + { + if (cfun_fpr_bit_p (i - 16)) + { + restore_fpr (frame_pointer, + offset + next_offset, i); + next_offset += 8; + } + } + } + } else { + next_offset = cfun_frame_layout.f4_offset; for (i = 18; i < 20; i++) - if (regs_ever_live[i] && !global_regs[i]) - restore_fpr (frame_pointer, - offset + 16*UNITS_PER_WORD + 8*(i-16), i); + { + if (cfun_fpr_bit_p (i - 16)) + { + restore_fpr (frame_pointer, + offset + next_offset, i); + next_offset += 8; + } + else if (!TARGET_PACKED_STACK) + next_offset += 8; + } + } /* Return register. */ @@ -5876,7 +7504,7 @@ s390_emit_epilogue (void) /* Restore call saved gprs. */ - if (cfun->machine->first_restore_gpr != -1) + if (cfun_frame_layout.first_restore_gpr != -1) { rtx insn, addr; int i; @@ -5884,66 +7512,76 @@ s390_emit_epilogue (void) /* Check for global register and save them to stack location from where they get restored. */ - for (i = cfun->machine->first_restore_gpr; - i <= cfun->machine->last_save_gpr; + for (i = cfun_frame_layout.first_restore_gpr; + i <= cfun_frame_layout.last_restore_gpr; i++) { /* These registers are special and need to be restored in any case. */ if (i == STACK_POINTER_REGNUM || i == RETURN_REGNUM - || i == BASE_REGISTER + || i == BASE_REGNUM || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM)) continue; if (global_regs[i]) { addr = plus_constant (frame_pointer, - offset + i * UNITS_PER_WORD); + offset + cfun_frame_layout.gprs_offset + + (i - cfun_frame_layout.first_save_gpr_slot) + * UNITS_PER_WORD); addr = gen_rtx_MEM (Pmode, addr); - set_mem_alias_set (addr, s390_sr_alias_set); + set_mem_alias_set (addr, get_frame_alias_set ()); emit_move_insn (addr, gen_rtx_REG (Pmode, i)); } } - /* Fetch return address from stack before load multiple, - this will do good for scheduling. */ - - if (cfun->machine->save_return_addr_p - || (cfun->machine->first_restore_gpr < BASE_REGISTER - && cfun->machine->last_save_gpr > RETURN_REGNUM)) + if (! sibcall) { - int return_regnum = find_unused_clobbered_reg(); - if (!return_regnum) - return_regnum = 4; - return_reg = gen_rtx_REG (Pmode, return_regnum); + /* Fetch return address from stack before load multiple, + this will do good for scheduling. */ - addr = plus_constant (frame_pointer, - offset + RETURN_REGNUM * UNITS_PER_WORD); - addr = gen_rtx_MEM (Pmode, addr); - set_mem_alias_set (addr, s390_sr_alias_set); - emit_move_insn (return_reg, addr); + if (cfun_frame_layout.save_return_addr_p + || (cfun_frame_layout.first_restore_gpr < BASE_REGNUM + && cfun_frame_layout.last_restore_gpr > RETURN_REGNUM)) + { + int return_regnum = find_unused_clobbered_reg(); + if (!return_regnum) + return_regnum = 4; + return_reg = gen_rtx_REG (Pmode, return_regnum); + + addr = plus_constant (frame_pointer, + offset + cfun_frame_layout.gprs_offset + + (RETURN_REGNUM + - cfun_frame_layout.first_save_gpr_slot) + * UNITS_PER_WORD); + addr = gen_rtx_MEM (Pmode, addr); + set_mem_alias_set (addr, get_frame_alias_set ()); + emit_move_insn (return_reg, addr); + } } - /* ??? As references to the base register are not made - explicit in insn RTX code, we have to add a barrier here - to prevent incorrect scheduling. */ - - emit_insn (gen_blockage()); - - insn = restore_gprs (frame_pointer, offset, - cfun->machine->first_restore_gpr, - cfun->machine->last_save_gpr); + insn = restore_gprs (frame_pointer, + offset + cfun_frame_layout.gprs_offset + + (cfun_frame_layout.first_restore_gpr + - cfun_frame_layout.first_save_gpr_slot) + * UNITS_PER_WORD, + cfun_frame_layout.first_restore_gpr, + cfun_frame_layout.last_restore_gpr); emit_insn (insn); } - /* Return to caller. */ + if (! sibcall) + { - p = rtvec_alloc (2); + /* Return to caller. */ - RTVEC_ELT (p, 0) = gen_rtx_RETURN (VOIDmode); - RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, return_reg); - emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p)); + p = rtvec_alloc (2); + + RTVEC_ELT (p, 0) = gen_rtx_RETURN (VOIDmode); + RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, return_reg); + emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p)); + } } @@ -5962,7 +7600,7 @@ s390_function_arg_size (enum machine_mode mode, tree type) return GET_MODE_SIZE (mode); /* If we have neither type nor mode, abort */ - abort (); + gcc_unreachable (); } /* Return true if a function argument of type TYPE and mode MODE @@ -5981,7 +7619,7 @@ s390_function_arg_float (enum machine_mode mode, tree type) /* No type info available for some library calls ... */ if (!type) - return mode == SFmode || mode == DFmode; + return mode == SFmode || mode == DFmode || mode == SDmode || mode == DDmode; /* The ABI says that record types with a single member are treated just like that member would be. */ @@ -6023,17 +7661,17 @@ s390_function_arg_integer (enum machine_mode mode, tree type) /* No type info available for some library calls ... */ if (!type) return GET_MODE_CLASS (mode) == MODE_INT - || (TARGET_SOFT_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT); + || (TARGET_SOFT_FLOAT && SCALAR_FLOAT_MODE_P (mode)); /* We accept small integral (and similar) types. */ if (INTEGRAL_TYPE_P (type) - || POINTER_TYPE_P (type) + || POINTER_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE || (TARGET_SOFT_FLOAT && TREE_CODE (type) == REAL_TYPE)) return true; /* We also accept structs of size 1, 2, 4, 8 that are not - passed in floating-point registers. */ + passed in floating-point registers. */ if (AGGREGATE_TYPE_P (type) && exact_log2 (size) >= 0 && !s390_function_arg_float (mode, type)) @@ -6048,8 +7686,10 @@ s390_function_arg_integer (enum machine_mode mode, tree type) all other structures (and complex numbers) are passed by reference. */ -int -s390_function_arg_pass_by_reference (enum machine_mode mode, tree type) +static bool +s390_pass_by_reference (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED, + enum machine_mode mode, tree type, + bool named ATTRIBUTE_UNUSED) { int size = s390_function_arg_size (mode, type); if (size > 8) @@ -6078,11 +7718,7 @@ void s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int named ATTRIBUTE_UNUSED) { - if (s390_function_arg_pass_by_reference (mode, type)) - { - cum->gprs += 1; - } - else if (s390_function_arg_float (mode, type)) + if (s390_function_arg_float (mode, type)) { cum->fprs += 1; } @@ -6092,7 +7728,7 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD); } else - abort (); + gcc_unreachable (); } /* Define where to put the arguments to a function. @@ -6118,25 +7754,22 @@ rtx s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int named ATTRIBUTE_UNUSED) { - if (s390_function_arg_pass_by_reference (mode, type)) - return 0; - if (s390_function_arg_float (mode, type)) { - if (cum->fprs + 1 > (TARGET_64BIT? 4 : 2)) + if (cum->fprs + 1 > FP_ARG_NUM_REG) return 0; else - return gen_rtx (REG, mode, cum->fprs + 16); + return gen_rtx_REG (mode, cum->fprs + 16); } else if (s390_function_arg_integer (mode, type)) { int size = s390_function_arg_size (mode, type); int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD; - if (cum->gprs + n_gprs > 5) + if (cum->gprs + n_gprs > GP_ARG_NUM_REG) return 0; else - return gen_rtx (REG, mode, cum->gprs + 2); + return gen_rtx_REG (mode, cum->gprs + 2); } /* After the real arguments, expand_call calls us once again @@ -6147,7 +7780,7 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else if (type == void_type_node) return const0_rtx; - abort (); + gcc_unreachable (); } /* Return true if return values of type TYPE should be returned @@ -6159,7 +7792,7 @@ s390_return_in_memory (tree type, tree fundecl ATTRIBUTE_UNUSED) { /* We accept small integral (and similar) types. */ if (INTEGRAL_TYPE_P (type) - || POINTER_TYPE_P (type) + || POINTER_TYPE_P (type) || TREE_CODE (type) == OFFSET_TYPE || TREE_CODE (type) == REAL_TYPE) return int_size_in_bytes (type) > 8; @@ -6186,17 +7819,14 @@ s390_function_value (tree type, enum machine_mode mode) { if (type) { - int unsignedp = TREE_UNSIGNED (type); + int unsignedp = TYPE_UNSIGNED (type); mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1); } - if (GET_MODE_CLASS (mode) != MODE_INT - && GET_MODE_CLASS (mode) != MODE_FLOAT) - abort (); - if (GET_MODE_SIZE (mode) > 8) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_INT || SCALAR_FLOAT_MODE_P (mode)); + gcc_assert (GET_MODE_SIZE (mode) <= 8); - if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + if (TARGET_HARD_FLOAT && SCALAR_FLOAT_MODE_P (mode)) return gen_rtx_REG (mode, 16); else return gen_rtx_REG (mode, 2); @@ -6243,6 +7873,9 @@ s390_build_builtin_va_list (void) f_sav = build_decl (FIELD_DECL, get_identifier ("__reg_save_area"), ptr_type_node); + va_list_gpr_counter_field = f_gpr; + va_list_fpr_counter_field = f_fpr; + DECL_FIELD_CONTEXT (f_gpr) = record; DECL_FIELD_CONTEXT (f_fpr) = record; DECL_FIELD_CONTEXT (f_ovf) = record; @@ -6287,47 +7920,64 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) f_ovf = TREE_CHAIN (f_fpr); f_sav = TREE_CHAIN (f_ovf); - valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + valist = build_va_arg_indirect_ref (valist); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); /* Count number of gp and fp argument registers used. */ n_gpr = current_function_args_info.gprs; n_fpr = current_function_args_info.fprs; - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, build_int_2 (n_gpr, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size) + { + t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, + build_int_cst (NULL_TREE, n_gpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, build_int_2 (n_fpr, 0)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_fpr_size) + { + t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, + build_int_cst (NULL_TREE, n_fpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the overflow area. */ - t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); + if (n_gpr + cfun->va_list_gpr_size > GP_ARG_NUM_REG + || n_fpr + cfun->va_list_fpr_size > FP_ARG_NUM_REG) + { + t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); - off = INTVAL (current_function_arg_offset_rtx); - off = off < 0 ? 0 : off; - if (TARGET_DEBUG_ARG) - fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n", - (int)n_gpr, (int)n_fpr, off); + off = INTVAL (current_function_arg_offset_rtx); + off = off < 0 ? 0 : off; + if (TARGET_DEBUG_ARG) + fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n", + (int)n_gpr, (int)n_fpr, off); - t = build (PLUS_EXPR, TREE_TYPE (ovf), t, build_int_2 (off, 0)); + t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t, build_int_cst (NULL_TREE, off)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the register save area. */ - t = make_tree (TREE_TYPE (sav), virtual_incoming_args_rtx); - t = build (PLUS_EXPR, TREE_TYPE (sav), t, - build_int_2 (-STACK_POINTER_OFFSET, -1)); - t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if ((cfun->va_list_gpr_size && n_gpr < GP_ARG_NUM_REG) + || (cfun->va_list_fpr_size && n_fpr < FP_ARG_NUM_REG)) + { + t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx); + t = build2 (PLUS_EXPR, TREE_TYPE (sav), t, + build_int_cst (NULL_TREE, -RETURN_REGNUM * UNITS_PER_WORD)); + + t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } } /* Implement va_arg by updating the va_list structure @@ -6354,28 +8004,29 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) ret = **args.overflow_arg_area++; } */ -rtx -s390_va_arg (tree valist, tree type) +static tree +s390_gimplify_va_arg (tree valist, tree type, tree *pre_p, + tree *post_p ATTRIBUTE_UNUSED) { tree f_gpr, f_fpr, f_ovf, f_sav; tree gpr, fpr, ovf, sav, reg, t, u; int indirect_p, size, n_reg, sav_ofs, sav_scale, max_reg; - rtx lab_false, lab_over, addr_rtx, r; + tree lab_false, lab_over, addr; f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node)); f_fpr = TREE_CHAIN (f_gpr); f_ovf = TREE_CHAIN (f_fpr); f_sav = TREE_CHAIN (f_ovf); - valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist); - gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr); - fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr); - ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf); - sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); + valist = build_va_arg_indirect_ref (valist); + gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE); + fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE); + ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE); + sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE); size = int_size_in_bytes (type); - if (s390_function_arg_pass_by_reference (TYPE_MODE (type), type)) + if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) { if (TARGET_DEBUG_ARG) { @@ -6387,10 +8038,14 @@ s390_va_arg (tree valist, tree type) indirect_p = 1; reg = gpr; n_reg = 1; + + /* kernel stack layout on 31 bit: It is assumed here that no padding + will be added by s390_frame_info because for va_args always an even + number of gprs has to be saved r15-r2 = 14 regs. */ sav_ofs = 2 * UNITS_PER_WORD; sav_scale = UNITS_PER_WORD; size = UNITS_PER_WORD; - max_reg = 4; + max_reg = GP_ARG_NUM_REG - n_reg; } else if (s390_function_arg_float (TYPE_MODE (type), type)) { @@ -6406,8 +8061,7 @@ s390_va_arg (tree valist, tree type) n_reg = 1; sav_ofs = 16 * UNITS_PER_WORD; sav_scale = 8; - /* TARGET_64BIT has up to 4 parameter in fprs */ - max_reg = TARGET_64BIT ? 3 : 1; + max_reg = FP_ARG_NUM_REG - n_reg; } else { @@ -6421,93 +8075,88 @@ s390_va_arg (tree valist, tree type) indirect_p = 0; reg = gpr; n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + /* kernel stack layout on 31 bit: It is assumed here that no padding + will be added by s390_frame_info because for va_args always an even + number of gprs has to be saved r15-r2 = 14 regs. */ sav_ofs = 2 * UNITS_PER_WORD; if (size < UNITS_PER_WORD) sav_ofs += UNITS_PER_WORD - size; sav_scale = UNITS_PER_WORD; - if (n_reg > 1) - max_reg = 3; - else - max_reg = 4; + max_reg = GP_ARG_NUM_REG - n_reg; } /* Pull the value out of the saved registers ... */ - lab_false = gen_label_rtx (); - lab_over = gen_label_rtx (); - addr_rtx = gen_reg_rtx (Pmode); + lab_false = create_artificial_label (); + lab_over = create_artificial_label (); + addr = create_tmp_var (ptr_type_node, "addr"); + DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); - emit_cmp_and_jump_insns (expand_expr (reg, NULL_RTX, Pmode, EXPAND_NORMAL), - GEN_INT (max_reg), - GT, const1_rtx, Pmode, 0, lab_false); + t = fold_convert (TREE_TYPE (reg), size_int (max_reg)); + t = build2 (GT_EXPR, boolean_type_node, reg, t); + u = build1 (GOTO_EXPR, void_type_node, lab_false); + t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE); + gimplify_and_add (t, pre_p); - if (sav_ofs) - t = build (PLUS_EXPR, ptr_type_node, sav, build_int_2 (sav_ofs, 0)); - else - t = sav; + t = build2 (PLUS_EXPR, ptr_type_node, sav, + fold_convert (ptr_type_node, size_int (sav_ofs))); + u = build2 (MULT_EXPR, TREE_TYPE (reg), reg, + fold_convert (TREE_TYPE (reg), size_int (sav_scale))); + t = build2 (PLUS_EXPR, ptr_type_node, t, fold_convert (ptr_type_node, u)); - u = build (MULT_EXPR, long_integer_type_node, - reg, build_int_2 (sav_scale, 0)); - TREE_SIDE_EFFECTS (u) = 1; + t = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (t, pre_p); - t = build (PLUS_EXPR, ptr_type_node, t, u); - TREE_SIDE_EFFECTS (t) = 1; + t = build1 (GOTO_EXPR, void_type_node, lab_over); + gimplify_and_add (t, pre_p); - r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); - if (r != addr_rtx) - emit_move_insn (addr_rtx, r); + t = build1 (LABEL_EXPR, void_type_node, lab_false); + append_to_statement_list (t, pre_p); - emit_jump_insn (gen_jump (lab_over)); - emit_barrier (); - emit_label (lab_false); - /* ... Otherwise out of the overflow area. */ - t = save_expr (ovf); - - - /* In 64 BIT for each argument on stack, a full 64 bit slot is allocated. */ + t = ovf; if (size < UNITS_PER_WORD) - { - t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (UNITS_PER_WORD-size, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, ptr_type_node, t, + fold_convert (ptr_type_node, size_int (UNITS_PER_WORD - size))); - t = save_expr (ovf); - } + gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); - r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL); - if (r != addr_rtx) - emit_move_insn (addr_rtx, r); + u = build2 (MODIFY_EXPR, void_type_node, addr, t); + gimplify_and_add (u, pre_p); - t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (size, 0)); - t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + t = build2 (PLUS_EXPR, ptr_type_node, t, + fold_convert (ptr_type_node, size_int (size))); + t = build2 (MODIFY_EXPR, ptr_type_node, ovf, t); + gimplify_and_add (t, pre_p); - emit_label (lab_over); + t = build1 (LABEL_EXPR, void_type_node, lab_over); + append_to_statement_list (t, pre_p); - /* If less than max_regs a registers are retrieved out - of register save area, increment. */ - u = build (PREINCREMENT_EXPR, TREE_TYPE (reg), reg, - build_int_2 (n_reg, 0)); - TREE_SIDE_EFFECTS (u) = 1; - expand_expr (u, const0_rtx, VOIDmode, EXPAND_NORMAL); + /* Increment register save count. */ + + u = build2 (PREINCREMENT_EXPR, TREE_TYPE (reg), reg, + fold_convert (TREE_TYPE (reg), size_int (n_reg))); + gimplify_and_add (u, pre_p); if (indirect_p) { - r = gen_rtx_MEM (Pmode, addr_rtx); - set_mem_alias_set (r, get_varargs_alias_set ()); - emit_move_insn (addr_rtx, r); + t = build_pointer_type (build_pointer_type (type)); + addr = fold_convert (t, addr); + addr = build_va_arg_indirect_ref (addr); + } + else + { + t = build_pointer_type (type); + addr = fold_convert (t, addr); } - - return addr_rtx; + return build_va_arg_indirect_ref (addr); } @@ -6537,14 +8186,14 @@ s390_init_builtins (void) tree ftype; ftype = build_function_type (ptr_type_node, void_list_node); - builtin_function ("__builtin_thread_pointer", ftype, - S390_BUILTIN_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_thread_pointer", ftype, + S390_BUILTIN_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); - builtin_function ("__builtin_set_thread_pointer", ftype, - S390_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_set_thread_pointer", ftype, + S390_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); } /* Expand an expression EXP that calls a built-in function, @@ -6623,7 +8272,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, pat = GEN_FCN (icode) (target, op[0], op[1]); break; default: - abort (); + gcc_unreachable (); } if (!pat) return NULL_RTX; @@ -6645,23 +8294,23 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, void s390_trampoline_template (FILE *file) { + rtx op[2]; + op[0] = gen_rtx_REG (Pmode, 0); + op[1] = gen_rtx_REG (Pmode, 1); + if (TARGET_64BIT) { - fprintf (file, "larl\t%s,0f\n", reg_names[1]); - fprintf (file, "lg\t%s,0(%s)\n", reg_names[0], reg_names[1]); - fprintf (file, "lg\t%s,8(%s)\n", reg_names[1], reg_names[1]); - fprintf (file, "br\t%s\n", reg_names[1]); - fprintf (file, "0:\t.quad\t0\n"); - fprintf (file, ".quad\t0\n"); + output_asm_insn ("basr\t%1,0", op); + output_asm_insn ("lmg\t%0,%1,14(%1)", op); + output_asm_insn ("br\t%1", op); + ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 10)); } else { - fprintf (file, "basr\t%s,0\n", reg_names[1]); - fprintf (file, "l\t%s,10(%s)\n", reg_names[0], reg_names[1]); - fprintf (file, "l\t%s,14(%s)\n", reg_names[1], reg_names[1]); - fprintf (file, "br\t%s\n", reg_names[1]); - fprintf (file, ".long\t0\n"); - fprintf (file, ".long\t0\n"); + output_asm_insn ("basr\t%1,0", op); + output_asm_insn ("lm\t%0,%1,6(%1)", op); + output_asm_insn ("br\t%1", op); + ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 8)); } } @@ -6672,14 +8321,12 @@ s390_trampoline_template (FILE *file) void s390_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) { - emit_move_insn (gen_rtx - (MEM, Pmode, + emit_move_insn (gen_rtx_MEM (Pmode, memory_address (Pmode, - plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt); - emit_move_insn (gen_rtx - (MEM, Pmode, + plus_constant (addr, (TARGET_64BIT ? 16 : 8)))), cxt); + emit_move_insn (gen_rtx_MEM (Pmode, memory_address (Pmode, - plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr); + plus_constant (addr, (TARGET_64BIT ? 24 : 12)))), fnaddr); } /* Return rtx for 64-bit constant formed from the 32-bit subwords @@ -6699,7 +8346,7 @@ s390_gen_rtx_const_DI (int high, int low) #if HOST_BITS_PER_WIDE_INT >= 32 return immed_double_const ((HOST_WIDE_INT)low, (HOST_WIDE_INT)high, DImode); #else - abort (); + gcc_unreachable (); #endif #endif } @@ -6772,20 +8419,6 @@ s390_function_profiler (FILE *file, int labelno) } } -/* Select section for constant in constant pool. In 32-bit mode, - constants go in the function section; in 64-bit mode in .rodata. */ - -static void -s390_select_rtx_section (enum machine_mode mode ATTRIBUTE_UNUSED, - rtx x ATTRIBUTE_UNUSED, - unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) -{ - if (TARGET_CPU_ZARCH) - readonly_data_section (); - else - function_section (current_function_decl); -} - /* Encode symbol attributes (local vs. global, tls model) of a SYMBOL_REF into its SYMBOL_REF_FLAGS. */ @@ -6854,9 +8487,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, { /* Setup literal pool pointer if required. */ if ((!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) + && !CONST_OK_FOR_K (delta) + && !CONST_OK_FOR_Os (delta)) || (!DISP_IN_RANGE (vcall_offset) - && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))) + && !CONST_OK_FOR_K (vcall_offset) + && !CONST_OK_FOR_Os (vcall_offset))) { op[5] = gen_label_rtx (); output_asm_insn ("larl\t%4,%5", op); @@ -6865,12 +8500,14 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Add DELTA to this pointer. */ if (delta) { - if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J")) + if (CONST_OK_FOR_J (delta)) output_asm_insn ("la\t%1,%2(%1)", op); else if (DISP_IN_RANGE (delta)) output_asm_insn ("lay\t%1,%2(%1)", op); - else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) + else if (CONST_OK_FOR_K (delta)) output_asm_insn ("aghi\t%1,%2", op); + else if (CONST_OK_FOR_Os (delta)) + output_asm_insn ("agfi\t%1,%2", op); else { op[6] = gen_label_rtx (); @@ -6886,12 +8523,18 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, output_asm_insn ("lg\t%4,0(%1)", op); output_asm_insn ("ag\t%1,%3(%4)", op); } - else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")) + else if (CONST_OK_FOR_K (vcall_offset)) { output_asm_insn ("lghi\t%4,%3", op); output_asm_insn ("ag\t%4,0(%1)", op); output_asm_insn ("ag\t%1,0(%4)", op); } + else if (CONST_OK_FOR_Os (vcall_offset)) + { + output_asm_insn ("lgfi\t%4,%3", op); + output_asm_insn ("ag\t%4,0(%1)", op); + output_asm_insn ("ag\t%1,0(%4)", op); + } else { op[7] = gen_label_rtx (); @@ -6929,9 +8572,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Setup base pointer if required. */ if (!vcall_offset || (!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) + && !CONST_OK_FOR_K (delta) + && !CONST_OK_FOR_Os (delta)) || (!DISP_IN_RANGE (delta) - && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))) + && !CONST_OK_FOR_K (vcall_offset) + && !CONST_OK_FOR_Os (vcall_offset))) { op[5] = gen_label_rtx (); output_asm_insn ("basr\t%4,0", op); @@ -6942,12 +8587,14 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Add DELTA to this pointer. */ if (delta) { - if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J")) + if (CONST_OK_FOR_J (delta)) output_asm_insn ("la\t%1,%2(%1)", op); else if (DISP_IN_RANGE (delta)) output_asm_insn ("lay\t%1,%2(%1)", op); - else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K")) + else if (CONST_OK_FOR_K (delta)) output_asm_insn ("ahi\t%1,%2", op); + else if (CONST_OK_FOR_Os (delta)) + output_asm_insn ("afi\t%1,%2", op); else { op[6] = gen_label_rtx (); @@ -6958,22 +8605,28 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, /* Perform vcall adjustment. */ if (vcall_offset) { - if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'J', "J")) + if (CONST_OK_FOR_J (vcall_offset)) { - output_asm_insn ("lg\t%4,0(%1)", op); + output_asm_insn ("l\t%4,0(%1)", op); output_asm_insn ("a\t%1,%3(%4)", op); } else if (DISP_IN_RANGE (vcall_offset)) { - output_asm_insn ("lg\t%4,0(%1)", op); + output_asm_insn ("l\t%4,0(%1)", op); output_asm_insn ("ay\t%1,%3(%4)", op); } - else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")) + else if (CONST_OK_FOR_K (vcall_offset)) { output_asm_insn ("lhi\t%4,%3", op); output_asm_insn ("a\t%4,0(%1)", op); output_asm_insn ("a\t%1,0(%4)", op); } + else if (CONST_OK_FOR_Os (vcall_offset)) + { + output_asm_insn ("iilf\t%4,%3", op); + output_asm_insn ("a\t%4,0(%1)", op); + output_asm_insn ("a\t%1,0(%4)", op); + } else { op[7] = gen_label_rtx (); @@ -7046,18 +8699,630 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, } } -bool +static bool s390_valid_pointer_mode (enum machine_mode mode) { return (mode == SImode || (TARGET_64BIT && mode == DImode)); } -/* How to allocate a 'struct machine_function'. */ +/* Checks whether the given ARGUMENT_LIST would use a caller + saved register. This is used to decide whether sibling call + optimization could be performed on the respective function + call. */ -static struct machine_function * -s390_init_machine_status (void) +static bool +s390_call_saved_register_used (tree argument_list) { - return ggc_alloc_cleared (sizeof (struct machine_function)); + CUMULATIVE_ARGS cum; + tree parameter; + enum machine_mode mode; + tree type; + rtx parm_rtx; + int reg; + + INIT_CUMULATIVE_ARGS (cum, NULL, NULL, 0, 0); + + while (argument_list) + { + parameter = TREE_VALUE (argument_list); + argument_list = TREE_CHAIN (argument_list); + + gcc_assert (parameter); + + /* For an undeclared variable passed as parameter we will get + an ERROR_MARK node here. */ + if (TREE_CODE (parameter) == ERROR_MARK) + return true; + + type = TREE_TYPE (parameter); + gcc_assert (type); + + mode = TYPE_MODE (type); + gcc_assert (mode); + + if (pass_by_reference (&cum, mode, type, true)) + { + mode = Pmode; + type = build_pointer_type (type); + } + + parm_rtx = s390_function_arg (&cum, mode, type, 0); + + s390_function_arg_advance (&cum, mode, type, 0); + + if (parm_rtx && REG_P (parm_rtx)) + { + for (reg = 0; + reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx)); + reg++) + if (! call_used_regs[reg + REGNO (parm_rtx)]) + return true; + } + } + return false; } +/* Return true if the given call expression can be + turned into a sibling call. + DECL holds the declaration of the function to be called whereas + EXP is the call expression itself. */ + +static bool +s390_function_ok_for_sibcall (tree decl, tree exp) +{ + /* The TPF epilogue uses register 1. */ + if (TARGET_TPF_PROFILING) + return false; + + /* The 31 bit PLT code uses register 12 (GOT pointer - caller saved) + which would have to be restored before the sibcall. */ + if (!TARGET_64BIT && flag_pic && decl && !targetm.binds_local_p (decl)) + return false; + + /* Register 6 on s390 is available as an argument register but unfortunately + "caller saved". This makes functions needing this register for arguments + not suitable for sibcalls. */ + if (TREE_OPERAND (exp, 1) + && s390_call_saved_register_used (TREE_OPERAND (exp, 1))) + return false; + + return true; +} + +/* Return the fixed registers used for condition codes. */ + +static bool +s390_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) +{ + *p1 = CC_REGNUM; + *p2 = INVALID_REGNUM; + + return true; +} + +/* This function is used by the call expanders of the machine description. + It emits the call insn itself together with the necessary operations + to adjust the target address and returns the emitted insn. + ADDR_LOCATION is the target address rtx + TLS_CALL the location of the thread-local symbol + RESULT_REG the register where the result of the call should be stored + RETADDR_REG the register where the return address should be stored + If this parameter is NULL_RTX the call is considered + to be a sibling call. */ + +rtx +s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg, + rtx retaddr_reg) +{ + bool plt_call = false; + rtx insn; + rtx call; + rtx clobber; + rtvec vec; + + /* Direct function calls need special treatment. */ + if (GET_CODE (addr_location) == SYMBOL_REF) + { + /* When calling a global routine in PIC mode, we must + replace the symbol itself with the PLT stub. */ + if (flag_pic && !SYMBOL_REF_LOCAL_P (addr_location)) + { + addr_location = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, addr_location), + UNSPEC_PLT); + addr_location = gen_rtx_CONST (Pmode, addr_location); + plt_call = true; + } + + /* Unless we can use the bras(l) insn, force the + routine address into a register. */ + if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) + { + if (flag_pic) + addr_location = legitimize_pic_address (addr_location, 0); + else + addr_location = force_reg (Pmode, addr_location); + } + } + + /* If it is already an indirect call or the code above moved the + SYMBOL_REF to somewhere else make sure the address can be found in + register 1. */ + if (retaddr_reg == NULL_RTX + && GET_CODE (addr_location) != SYMBOL_REF + && !plt_call) + { + emit_move_insn (gen_rtx_REG (Pmode, SIBCALL_REGNUM), addr_location); + addr_location = gen_rtx_REG (Pmode, SIBCALL_REGNUM); + } + + addr_location = gen_rtx_MEM (QImode, addr_location); + call = gen_rtx_CALL (VOIDmode, addr_location, const0_rtx); + + if (result_reg != NULL_RTX) + call = gen_rtx_SET (VOIDmode, result_reg, call); + + if (retaddr_reg != NULL_RTX) + { + clobber = gen_rtx_CLOBBER (VOIDmode, retaddr_reg); + + if (tls_call != NULL_RTX) + vec = gen_rtvec (3, call, clobber, + gen_rtx_USE (VOIDmode, tls_call)); + else + vec = gen_rtvec (2, call, clobber); + + call = gen_rtx_PARALLEL (VOIDmode, vec); + } + + insn = emit_call_insn (call); + + /* 31-bit PLT stubs and tls calls use the GOT register implicitly. */ + if ((!TARGET_64BIT && plt_call) || tls_call != NULL_RTX) + { + /* s390_function_ok_for_sibcall should + have denied sibcalls in this case. */ + gcc_assert (retaddr_reg != NULL_RTX); + + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); + } + return insn; +} + +/* Implement CONDITIONAL_REGISTER_USAGE. */ + +void +s390_conditional_register_usage (void) +{ + int i; + + if (flag_pic) + { + fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; + call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; + } + if (TARGET_CPU_ZARCH) + { + fixed_regs[BASE_REGNUM] = 0; + call_used_regs[BASE_REGNUM] = 0; + fixed_regs[RETURN_REGNUM] = 0; + call_used_regs[RETURN_REGNUM] = 0; + } + if (TARGET_64BIT) + { + for (i = 24; i < 32; i++) + call_used_regs[i] = call_really_used_regs[i] = 0; + } + else + { + for (i = 18; i < 20; i++) + call_used_regs[i] = call_really_used_regs[i] = 0; + } + + if (TARGET_SOFT_FLOAT) + { + for (i = 16; i < 32; i++) + call_used_regs[i] = fixed_regs[i] = 1; + } +} + +/* Corresponding function to eh_return expander. */ + +static GTY(()) rtx s390_tpf_eh_return_symbol; +void +s390_emit_tpf_eh_return (rtx target) +{ + rtx insn, reg; + + if (!s390_tpf_eh_return_symbol) + s390_tpf_eh_return_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tpf_eh_return"); + + reg = gen_rtx_REG (Pmode, 2); + + emit_move_insn (reg, target); + insn = s390_emit_call (s390_tpf_eh_return_symbol, NULL_RTX, reg, + gen_rtx_REG (Pmode, RETURN_REGNUM)); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg); + + emit_move_insn (EH_RETURN_HANDLER_RTX, reg); +} + +/* Rework the prologue/epilogue to avoid saving/restoring + registers unnecessarily. */ + +static void +s390_optimize_prologue (void) +{ + rtx insn, new_insn, next_insn; + + /* Do a final recompute of the frame-related data. */ + + s390_update_frame_layout (); + + /* If all special registers are in fact used, there's nothing we + can do, so no point in walking the insn list. */ + + if (cfun_frame_layout.first_save_gpr <= BASE_REGNUM + && cfun_frame_layout.last_save_gpr >= BASE_REGNUM + && (TARGET_CPU_ZARCH + || (cfun_frame_layout.first_save_gpr <= RETURN_REGNUM + && cfun_frame_layout.last_save_gpr >= RETURN_REGNUM))) + return; + + /* Search for prologue/epilogue insns and replace them. */ + + for (insn = get_insns (); insn; insn = next_insn) + { + int first, last, off; + rtx set, base, offset; + + next_insn = NEXT_INSN (insn); + + if (GET_CODE (insn) != INSN) + continue; + + if (GET_CODE (PATTERN (insn)) == PARALLEL + && store_multiple_operation (PATTERN (insn), VOIDmode)) + { + set = XVECEXP (PATTERN (insn), 0, 0); + first = REGNO (SET_SRC (set)); + last = first + XVECLEN (PATTERN (insn), 0) - 1; + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); + off = INTVAL (offset); + + if (GET_CODE (base) != REG || off < 0) + continue; + if (cfun_frame_layout.first_save_gpr != -1 + && (cfun_frame_layout.first_save_gpr < first + || cfun_frame_layout.last_save_gpr > last)) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (first > BASE_REGNUM || last < BASE_REGNUM) + continue; + + if (cfun_frame_layout.first_save_gpr != -1) + { + new_insn = save_gprs (base, + off + (cfun_frame_layout.first_save_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_save_gpr, + cfun_frame_layout.last_save_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } + + remove_insn (insn); + continue; + } + + if (cfun_frame_layout.first_save_gpr == -1 + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == REG + && (REGNO (SET_SRC (PATTERN (insn))) == BASE_REGNUM + || (!TARGET_CPU_ZARCH + && REGNO (SET_SRC (PATTERN (insn))) == RETURN_REGNUM)) + && GET_CODE (SET_DEST (PATTERN (insn))) == MEM) + { + set = PATTERN (insn); + first = REGNO (SET_SRC (set)); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); + off = INTVAL (offset); + + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + + remove_insn (insn); + continue; + } + + if (GET_CODE (PATTERN (insn)) == PARALLEL + && load_multiple_operation (PATTERN (insn), VOIDmode)) + { + set = XVECEXP (PATTERN (insn), 0, 0); + first = REGNO (SET_DEST (set)); + last = first + XVECLEN (PATTERN (insn), 0) - 1; + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); + off = INTVAL (offset); + + if (GET_CODE (base) != REG || off < 0) + continue; + if (cfun_frame_layout.first_restore_gpr != -1 + && (cfun_frame_layout.first_restore_gpr < first + || cfun_frame_layout.last_restore_gpr > last)) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (first > BASE_REGNUM || last < BASE_REGNUM) + continue; + + if (cfun_frame_layout.first_restore_gpr != -1) + { + new_insn = restore_gprs (base, + off + (cfun_frame_layout.first_restore_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_restore_gpr, + cfun_frame_layout.last_restore_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } + + remove_insn (insn); + continue; + } + + if (cfun_frame_layout.first_restore_gpr == -1 + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_DEST (PATTERN (insn))) == REG + && (REGNO (SET_DEST (PATTERN (insn))) == BASE_REGNUM + || (!TARGET_CPU_ZARCH + && REGNO (SET_DEST (PATTERN (insn))) == RETURN_REGNUM)) + && GET_CODE (SET_SRC (PATTERN (insn))) == MEM) + { + set = PATTERN (insn); + first = REGNO (SET_DEST (set)); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); + off = INTVAL (offset); + + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + + remove_insn (insn); + continue; + } + } +} + +/* Perform machine-dependent processing. */ + +static void +s390_reorg (void) +{ + bool pool_overflow = false; + + /* Make sure all splits have been performed; splits after + machine_dependent_reorg might confuse insn length counts. */ + split_all_insns_noflow (); + + /* From here on decomposed literal pool addresses must be accepted. */ + cfun->machine->decomposed_literal_pool_addresses_ok_p = true; + + /* Install the main literal pool and the associated base + register load insns. + + In addition, there are two problematic situations we need + to correct: + + - the literal pool might be > 4096 bytes in size, so that + some of its elements cannot be directly accessed + + - a branch target might be > 64K away from the branch, so that + it is not possible to use a PC-relative instruction. + + To fix those, we split the single literal pool into multiple + pool chunks, reloading the pool base register at various + points throughout the function to ensure it always points to + the pool chunk the following code expects, and / or replace + PC-relative branches by absolute branches. + + However, the two problems are interdependent: splitting the + literal pool can move a branch further away from its target, + causing the 64K limit to overflow, and on the other hand, + replacing a PC-relative branch by an absolute branch means + we need to put the branch target address into the literal + pool, possibly causing it to overflow. + + So, we loop trying to fix up both problems until we manage + to satisfy both conditions at the same time. Note that the + loop is guaranteed to terminate as every pass of the loop + strictly decreases the total number of PC-relative branches + in the function. (This is not completely true as there + might be branch-over-pool insns introduced by chunkify_start. + Those never need to be split however.) */ + + for (;;) + { + struct constant_pool *pool = NULL; + + /* Collect the literal pool. */ + if (!pool_overflow) + { + pool = s390_mainpool_start (); + if (!pool) + pool_overflow = true; + } + + /* If literal pool overflowed, start to chunkify it. */ + if (pool_overflow) + pool = s390_chunkify_start (); + + /* Split out-of-range branches. If this has created new + literal pool entries, cancel current chunk list and + recompute it. zSeries machines have large branch + instructions, so we never need to split a branch. */ + if (!TARGET_CPU_ZARCH && s390_split_branches ()) + { + if (pool_overflow) + s390_chunkify_cancel (pool); + else + s390_mainpool_cancel (pool); + + continue; + } + + /* If we made it up to here, both conditions are satisfied. + Finish up literal pool related changes. */ + if (pool_overflow) + s390_chunkify_finish (pool); + else + s390_mainpool_finish (pool); + + /* We're done splitting branches. */ + cfun->machine->split_branches_pending_p = false; + break; + } + + /* Generate out-of-pool execute target insns. */ + if (TARGET_CPU_ZARCH) + { + rtx insn, label, target; + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + label = s390_execute_label (insn); + if (!label) + continue; + + gcc_assert (label != const0_rtx); + + target = emit_label (XEXP (label, 0)); + INSN_ADDRESSES_NEW (target, -1); + + target = emit_insn (s390_execute_target (insn)); + INSN_ADDRESSES_NEW (target, -1); + } + } + + /* Try to optimize prologue and epilogue further. */ + s390_optimize_prologue (); +} + + +/* Initialize GCC target structure. */ + +#undef TARGET_ASM_ALIGNED_HI_OP +#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t" +#undef TARGET_ASM_ALIGNED_DI_OP +#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t" +#undef TARGET_ASM_INTEGER +#define TARGET_ASM_INTEGER s390_assemble_integer + +#undef TARGET_ASM_OPEN_PAREN +#define TARGET_ASM_OPEN_PAREN "" + +#undef TARGET_ASM_CLOSE_PAREN +#define TARGET_ASM_CLOSE_PAREN "" + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION s390_handle_option + +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info + +#ifdef HAVE_AS_TLS +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS true +#endif +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM s390_cannot_force_const_mem + +#undef TARGET_DELEGITIMIZE_ADDRESS +#define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address + +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY s390_return_in_memory + +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS s390_init_builtins +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN s390_expand_builtin + +#undef TARGET_ASM_OUTPUT_MI_THUNK +#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk +#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true + +#undef TARGET_SCHED_ADJUST_PRIORITY +#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE s390_issue_rate +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead + +#undef TARGET_CANNOT_COPY_INSN_P +#define TARGET_CANNOT_COPY_INSN_P s390_cannot_copy_insn_p +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS s390_rtx_costs +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST s390_address_cost + +#undef TARGET_MACHINE_DEPENDENT_REORG +#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg + +#undef TARGET_VALID_POINTER_MODE +#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode + +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR s390_gimplify_va_arg + +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE s390_pass_by_reference + +#undef TARGET_FUNCTION_OK_FOR_SIBCALL +#define TARGET_FUNCTION_OK_FOR_SIBCALL s390_function_ok_for_sibcall + +#undef TARGET_FIXED_CONDITION_CODE_REGS +#define TARGET_FIXED_CONDITION_CODE_REGS s390_fixed_condition_code_regs + +#undef TARGET_CC_MODES_COMPATIBLE +#define TARGET_CC_MODES_COMPATIBLE s390_cc_modes_compatible + +#undef TARGET_INVALID_WITHIN_DOLOOP +#define TARGET_INVALID_WITHIN_DOLOOP hook_constcharptr_rtx_null + +#ifdef HAVE_AS_TLS +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL +#define TARGET_ASM_OUTPUT_DWARF_DTPREL s390_output_dwarf_dtprel +#endif + +#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING +#undef TARGET_MANGLE_FUNDAMENTAL_TYPE +#define TARGET_MANGLE_FUNDAMENTAL_TYPE s390_mangle_fundamental_type +#endif + +#undef TARGET_SCALAR_MODE_SUPPORTED_P +#define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p + +struct gcc_target targetm = TARGET_INITIALIZER; + #include "gt-s390.h" diff --git a/contrib/gcc/config/s390/s390.h b/contrib/gcc/config/s390/s390.h index d2416c8a0f8..ba7a036e1ec 100644 --- a/contrib/gcc/config/s390/s390.h +++ b/contrib/gcc/config/s390/s390.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM S/390 - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -18,8 +18,8 @@ for more details. 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. */ #ifndef _S390_H #define _S390_H @@ -40,6 +40,7 @@ enum processor_type PROCESSOR_9672_G6, PROCESSOR_2064_Z900, PROCESSOR_2084_Z990, + PROCESSOR_2094_Z9_109, PROCESSOR_max }; @@ -49,16 +50,15 @@ enum processor_flags { PF_IEEE_FLOAT = 1, PF_ZARCH = 2, - PF_LONG_DISPLACEMENT = 4 + PF_LONG_DISPLACEMENT = 4, + PF_EXTIMM = 8 }; extern enum processor_type s390_tune; extern enum processor_flags s390_tune_flags; -extern const char *s390_tune_string; extern enum processor_type s390_arch; extern enum processor_flags s390_arch_flags; -extern const char *s390_arch_string; #define TARGET_CPU_IEEE_FLOAT \ (s390_arch_flags & PF_IEEE_FLOAT) @@ -66,13 +66,24 @@ extern const char *s390_arch_string; (s390_arch_flags & PF_ZARCH) #define TARGET_CPU_LONG_DISPLACEMENT \ (s390_arch_flags & PF_LONG_DISPLACEMENT) +#define TARGET_CPU_EXTIMM \ + (s390_arch_flags & PF_EXTIMM) #define TARGET_LONG_DISPLACEMENT \ (TARGET_ZARCH && TARGET_CPU_LONG_DISPLACEMENT) - +#define TARGET_EXTIMM \ + (TARGET_ZARCH && TARGET_CPU_EXTIMM) /* Run-time target specification. */ +/* Defaults for option flags defined only on some subtargets. */ +#ifndef TARGET_TPF_PROFILING +#define TARGET_TPF_PROFILING 0 +#endif + +/* This will be overridden by OS headers. */ +#define TARGET_TPF 0 + /* Target CPU builtins. */ #define TARGET_CPU_CPP_BUILTINS() \ do \ @@ -82,72 +93,21 @@ extern const char *s390_arch_string; builtin_define ("__s390__"); \ if (TARGET_64BIT) \ builtin_define ("__s390x__"); \ + if (TARGET_LONG_DOUBLE_128) \ + builtin_define ("__LONG_DOUBLE_128__"); \ } \ while (0) -/* Optional target features. */ -extern int target_flags; - -#define MASK_HARD_FLOAT 0x01 -#define MASK_BACKCHAIN 0x02 -#define MASK_SMALL_EXEC 0x04 -#define MASK_DEBUG_ARG 0x08 -#define MASK_64BIT 0x10 -#define MASK_ZARCH 0x20 -#define MASK_MVCLE 0x40 -#define MASK_TPF 0x80 -#define MASK_NO_FUSED_MADD 0x100 - -#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT) -#define TARGET_SOFT_FLOAT (!(target_flags & MASK_HARD_FLOAT)) -#define TARGET_BACKCHAIN (target_flags & MASK_BACKCHAIN) -#define TARGET_SMALL_EXEC (target_flags & MASK_SMALL_EXEC) -#define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG) -#define TARGET_64BIT (target_flags & MASK_64BIT) -#define TARGET_ZARCH (target_flags & MASK_ZARCH) -#define TARGET_MVCLE (target_flags & MASK_MVCLE) -#define TARGET_TPF (target_flags & MASK_TPF) -#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) -#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) - /* ??? Once this actually works, it could be made a runtime option. */ #define TARGET_IBM_FLOAT 0 #define TARGET_IEEE_FLOAT 1 #ifdef DEFAULT_TARGET_64BIT -#define TARGET_DEFAULT 0x31 +#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_FLOAT) #else -#define TARGET_DEFAULT 0x1 +#define TARGET_DEFAULT MASK_HARD_FLOAT #endif -#define TARGET_SWITCHES \ -{ { "hard-float", 1, N_("Use hardware fp")}, \ - { "soft-float", -1, N_("Don't use hardware fp")}, \ - { "backchain", 2, N_("Set backchain")}, \ - { "no-backchain", -2, N_("Don't set backchain (faster, but debug harder")},\ - { "small-exec", 4, N_("Use bras for executable < 64k")}, \ - { "no-small-exec", -4, N_("Don't use bras")}, \ - { "debug", 8, N_("Additional debug prints")}, \ - { "no-debug", -8, N_("Don't print additional debug prints")}, \ - { "64", 16, N_("64 bit ABI")}, \ - { "31", -16, N_("31 bit ABI")}, \ - { "zarch", 32, N_("z/Architecture")}, \ - { "esa", -32, N_("ESA/390 architecture")}, \ - { "mvcle", 64, N_("mvcle use")}, \ - { "no-mvcle", -64, N_("mvc&ex")}, \ - { "tpf", 128, N_("enable tpf OS code")}, \ - { "no-tpf", -128, N_("disable tpf OS code")}, \ - { "no-fused-madd", 256, N_("disable fused multiply/add instructions")},\ - { "fused-madd", -256, N_("enable fused multiply/add instructions")}, \ - { "", TARGET_DEFAULT, 0 } } - -#define TARGET_OPTIONS \ -{ { "tune=", &s390_tune_string, \ - N_("Schedule code for given CPU"), 0}, \ - { "arch=", &s390_arch_string, \ - N_("Generate code for given CPU"), 0}, \ -} - /* Support for configure-time defaults. */ #define OPTION_DEFAULT_SPECS \ { "mode", "%{!mesa:%{!mzarch:-m%(VALUE)}}" }, \ @@ -208,11 +168,7 @@ extern int target_flags; #define MAX_BITS_PER_WORD 64 /* Function arguments and return values are promoted to word size. */ -#define PROMOTE_FUNCTION_ARGS -#define PROMOTE_FUNCTION_RETURN -#define PROMOTE_FOR_CALL_ONLY - -#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ +#define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \ if (INTEGRAL_MODE_P (MODE) && \ GET_MODE_SIZE (MODE) < UNITS_PER_WORD) { \ (MODE) = Pmode; \ @@ -259,11 +215,21 @@ if (INTEGRAL_MODE_P (MODE) && \ #define SHORT_TYPE_SIZE 16 #define INT_TYPE_SIZE 32 #define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32) -#define MAX_LONG_TYPE_SIZE 64 #define LONG_LONG_TYPE_SIZE 64 #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 -#define LONG_DOUBLE_TYPE_SIZE 64 /* ??? Should support extended format. */ +#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) + +/* Define this to set long double type size to use in libgcc2.c, which can + not depend on target_flags. */ +#ifdef __LONG_DOUBLE_128__ +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 +#else +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 +#endif + +/* Work around target_flags dependency in ada/targtyps.c. */ +#define WIDEST_HARDWARE_FP_SIZE 64 /* We use "unsigned char" as default. */ #define DEFAULT_SIGNED_CHAR 0 @@ -283,30 +249,32 @@ if (INTEGRAL_MODE_P (MODE) && \ GPR 14: Return address register GPR 15: Stack pointer - Registers 32-34 are 'fake' hard registers that do not + Registers 32-35 are 'fake' hard registers that do not correspond to actual hardware: Reg 32: Argument pointer Reg 33: Condition code - Reg 34: Frame pointer */ + Reg 34: Frame pointer + Reg 35: Return address pointer -#define FIRST_PSEUDO_REGISTER 35 + Registers 36 and 37 are mapped to access registers + 0 and 1, used to implement thread-local storage. */ + +#define FIRST_PSEUDO_REGISTER 38 /* Standard register usage. */ #define GENERAL_REGNO_P(N) ((int)(N) >= 0 && (N) < 16) #define ADDR_REGNO_P(N) ((N) >= 1 && (N) < 16) #define FP_REGNO_P(N) ((N) >= 16 && (N) < (TARGET_IEEE_FLOAT? 32 : 20)) #define CC_REGNO_P(N) ((N) == 33) -#define FRAME_REGNO_P(N) ((N) == 32 || (N) == 34) +#define FRAME_REGNO_P(N) ((N) == 32 || (N) == 34 || (N) == 35) +#define ACCESS_REGNO_P(N) ((N) == 36 || (N) == 37) #define GENERAL_REG_P(X) (REG_P (X) && GENERAL_REGNO_P (REGNO (X))) #define ADDR_REG_P(X) (REG_P (X) && ADDR_REGNO_P (REGNO (X))) #define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X))) #define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X))) #define FRAME_REG_P(X) (REG_P (X) && FRAME_REGNO_P (REGNO (X))) - -#define BASE_REGISTER 13 -#define RETURN_REGNUM 14 -#define CC_REGNUM 33 +#define ACCESS_REG_P(X) (REG_P (X) && ACCESS_REGNO_P (REGNO (X))) /* Set up fixed registers and calling convention: @@ -317,6 +285,7 @@ if (INTEGRAL_MODE_P (MODE) && \ GPR 14 is always fixed on S/390 machines (as return address). GPR 15 is always fixed (as stack pointer). The 'fake' hard registers are call-clobbered and fixed. + The access registers are call-saved and fixed. On 31-bit, FPRs 18-19 are call-clobbered; on 64-bit, FPRs 24-31 are call-clobbered. @@ -331,7 +300,8 @@ if (INTEGRAL_MODE_P (MODE) && \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ - 1, 1, 1 } + 1, 1, 1, 1, \ + 1, 1 } #define CALL_USED_REGISTERS \ { 1, 1, 1, 1, \ @@ -342,7 +312,8 @@ if (INTEGRAL_MODE_P (MODE) && \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ - 1, 1, 1 } + 1, 1, 1, 1, \ + 1, 1 } #define CALL_REALLY_USED_REGISTERS \ { 1, 1, 1, 1, \ @@ -353,41 +324,17 @@ if (INTEGRAL_MODE_P (MODE) && \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ - 1, 1, 1 } + 1, 1, 1, 1, \ + 0, 0 } -#define CONDITIONAL_REGISTER_USAGE \ -do \ - { \ - int i; \ - \ - if (flag_pic) \ - { \ - fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ - call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ - } \ - if (TARGET_CPU_ZARCH) \ - { \ - fixed_regs[RETURN_REGNUM] = 0; \ - call_used_regs[RETURN_REGNUM] = 0; \ - } \ - if (TARGET_64BIT) \ - { \ - for (i = 24; i < 32; i++) \ - call_used_regs[i] = call_really_used_regs[i] = 0; \ - } \ - else \ - { \ - for (i = 18; i < 20; i++) \ - call_used_regs[i] = call_really_used_regs[i] = 0; \ - } \ - } while (0) +#define CONDITIONAL_REGISTER_USAGE s390_conditional_register_usage () /* Preferred register allocation order. */ #define REG_ALLOC_ORDER \ -{ 1, 2, 3, 4, 5, 0, 13, 12, 11, 10, 9, 8, 7, 6, 14, \ +{ 1, 2, 3, 4, 5, 0, 12, 11, 10, 9, 8, 7, 6, 14, 13, \ 16, 17, 18, 19, 20, 21, 22, 23, \ 24, 25, 26, 27, 28, 29, 30, 31, \ - 15, 32, 33, 34 } + 15, 32, 33, 34, 35, 36, 37 } /* Fitting values into registers. */ @@ -400,31 +347,24 @@ do \ Floating point modes <= word size fit into any FPR or GPR. Floating point modes > word size (i.e. DFmode on 32-bit) fit into any FPR, or an even-odd GPR pair. + TFmode fits only into an even-odd FPR pair. Complex floating point modes fit either into two FPRs, or into successive GPRs (again starting with an even number). + TCmode fits only into two successive even-odd FPR pairs. Condition code modes fit only into the CC register. */ +/* Because all registers in a class have the same size HARD_REGNO_NREGS + is equivalent to CLASS_MAX_NREGS. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ - (FP_REGNO_P(REGNO)? \ - (GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \ - GENERAL_REGNO_P(REGNO)? \ - ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \ - 1) + s390_class_max_nregs (REGNO_REG_CLASS (REGNO), (MODE)) -#define HARD_REGNO_MODE_OK(REGNO, MODE) \ - (FP_REGNO_P(REGNO)? \ - ((MODE) == SImode || (MODE) == DImode || \ - GET_MODE_CLASS(MODE) == MODE_FLOAT || \ - GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT) : \ - GENERAL_REGNO_P(REGNO)? \ - (HARD_REGNO_NREGS(REGNO, MODE) == 1 || !((REGNO) & 1)) : \ - CC_REGNO_P(REGNO)? \ - GET_MODE_CLASS (MODE) == MODE_CC : \ - FRAME_REGNO_P(REGNO)? \ - (enum machine_mode) (MODE) == Pmode : \ - 0) +#define HARD_REGNO_MODE_OK(REGNO, MODE) \ + s390_hard_regno_mode_ok ((REGNO), (MODE)) + +#define HARD_REGNO_RENAME_OK(FROM, TO) \ + s390_hard_regno_rename_ok (FROM, TO) #define MODES_TIEABLE_P(MODE1, MODE2) \ (((MODE1) == SFmode || (MODE1) == DFmode) \ @@ -433,16 +373,18 @@ do \ /* Maximum number of registers to represent a value of mode MODE in a register of class CLASS. */ #define CLASS_MAX_NREGS(CLASS, MODE) \ - ((CLASS) == FP_REGS ? \ - (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \ - (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) + s390_class_max_nregs ((CLASS), (MODE)) /* If a 4-byte value is loaded into a FPR, it is placed into the *upper* half of the register, not the lower. Therefore, we - cannot use SUBREGs to switch between modes in FP registers. */ -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FP_REGS, CLASS) : 0) + cannot use SUBREGs to switch between modes in FP registers. + Likewise for access registers, since they have only half the + word size on 64-bit. */ +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ + ? ((reg_classes_intersect_p (FP_REGS, CLASS) \ + && (GET_MODE_SIZE (FROM) < 8 || GET_MODE_SIZE (TO) < 8)) \ + || reg_classes_intersect_p (ACCESS_REGS, CLASS)) : 0) /* Register classes. */ @@ -451,39 +393,48 @@ do \ ADDR_REGS All general purpose registers except %r0 (These registers can be used in address generation) FP_REGS All floating point registers + CC_REGS The condition code register + ACCESS_REGS The access registers GENERAL_FP_REGS Union of GENERAL_REGS and FP_REGS ADDR_FP_REGS Union of ADDR_REGS and FP_REGS + GENERAL_CC_REGS Union of GENERAL_REGS and CC_REGS + ADDR_CC_REGS Union of ADDR_REGS and CC_REGS NO_REGS No registers ALL_REGS All registers Note that the 'fake' frame pointer and argument pointer registers - are included amongst the address registers here. The condition - code register is only included in ALL_REGS. */ + are included amongst the address registers here. */ enum reg_class { - NO_REGS, ADDR_REGS, GENERAL_REGS, + NO_REGS, CC_REGS, ADDR_REGS, GENERAL_REGS, ACCESS_REGS, + ADDR_CC_REGS, GENERAL_CC_REGS, FP_REGS, ADDR_FP_REGS, GENERAL_FP_REGS, ALL_REGS, LIM_REG_CLASSES }; #define N_REG_CLASSES (int) LIM_REG_CLASSES -#define REG_CLASS_NAMES \ -{ "NO_REGS", "ADDR_REGS", "GENERAL_REGS", \ +#define REG_CLASS_NAMES \ +{ "NO_REGS", "CC_REGS", "ADDR_REGS", "GENERAL_REGS", "ACCESS_REGS", \ + "ADDR_CC_REGS", "GENERAL_CC_REGS", \ "FP_REGS", "ADDR_FP_REGS", "GENERAL_FP_REGS", "ALL_REGS" } /* Class -> register mapping. */ #define REG_CLASS_CONTENTS \ { \ { 0x00000000, 0x00000000 }, /* NO_REGS */ \ - { 0x0000fffe, 0x00000005 }, /* ADDR_REGS */ \ - { 0x0000ffff, 0x00000005 }, /* GENERAL_REGS */ \ + { 0x00000000, 0x00000002 }, /* CC_REGS */ \ + { 0x0000fffe, 0x0000000d }, /* ADDR_REGS */ \ + { 0x0000ffff, 0x0000000d }, /* GENERAL_REGS */ \ + { 0x00000000, 0x00000030 }, /* ACCESS_REGS */ \ + { 0x0000fffe, 0x0000000f }, /* ADDR_CC_REGS */ \ + { 0x0000ffff, 0x0000000f }, /* GENERAL_CC_REGS */ \ { 0xffff0000, 0x00000000 }, /* FP_REGS */ \ - { 0xfffffffe, 0x00000005 }, /* ADDR_FP_REGS */ \ - { 0xffffffff, 0x00000005 }, /* GENERAL_FP_REGS */ \ - { 0xffffffff, 0x00000007 }, /* ALL_REGS */ \ + { 0xfffffffe, 0x0000000d }, /* ADDR_FP_REGS */ \ + { 0xffffffff, 0x0000000d }, /* GENERAL_FP_REGS */ \ + { 0xffffffff, 0x0000003f }, /* ALL_REGS */ \ } /* Register -> class mapping. */ @@ -498,8 +449,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; or a pseudo register currently allocated to one such. */ #define REGNO_OK_FOR_INDEX_P(REGNO) \ (((REGNO) < FIRST_PSEUDO_REGISTER \ - && REGNO_REG_CLASS ((REGNO)) == ADDR_REGS) \ - || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16)) + && REGNO_REG_CLASS ((REGNO)) == ADDR_REGS) \ + || ADDR_REGNO_P (reg_renumber[REGNO])) #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO) @@ -530,35 +481,13 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; : MODE) -/* Define various machine-dependent constraint letters. */ - -#define REG_CLASS_FROM_LETTER(C) \ - ((C) == 'a' ? ADDR_REGS : \ - (C) == 'd' ? GENERAL_REGS : \ - (C) == 'f' ? FP_REGS : NO_REGS) - -#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ - s390_const_ok_for_constraint_p ((VALUE), (C), (STR)) - -#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR) 1 - -#define EXTRA_CONSTRAINT_STR(OP, C, STR) \ - s390_extra_constraint_str ((OP), (C), (STR)) -#define EXTRA_MEMORY_CONSTRAINT(C, STR) \ - ((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T') -#define EXTRA_ADDRESS_CONSTRAINT(C, STR) \ - ((C) == 'U' || (C) == 'W' || (C) == 'Y') - -#define CONSTRAINT_LEN(C, STR) \ - ((C) == 'N' ? 5 : DEFAULT_CONSTRAINT_LEN ((C), (STR))) - /* Stack layout and calling conventions. */ /* Our stack grows from higher to lower addresses. However, local variables are accessed by positive offsets, and function arguments are stored at increasing addresses. */ #define STACK_GROWS_DOWNWARD -/* #undef FRAME_GROWS_DOWNWARD */ +#define FRAME_GROWS_DOWNWARD 1 /* #undef ARGS_GROW_DOWNWARD */ /* The basic stack layout looks like this: the stack pointer points @@ -570,33 +499,39 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; #define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96) /* Offset within stack frame to start allocating local variables at. */ -extern int current_function_outgoing_args_size; -#define STARTING_FRAME_OFFSET \ - (STACK_POINTER_OFFSET + current_function_outgoing_args_size) +#define STARTING_FRAME_OFFSET 0 /* Offset from the stack pointer register to an item dynamically allocated on the stack, e.g., by `alloca'. */ -#define STACK_DYNAMIC_OFFSET(FUNDECL) (STARTING_FRAME_OFFSET) +extern int current_function_outgoing_args_size; +#define STACK_DYNAMIC_OFFSET(FUNDECL) \ + (STACK_POINTER_OFFSET + current_function_outgoing_args_size) /* Offset of first parameter from the argument pointer register value. We have a fake argument pointer register that points directly to the argument area. */ #define FIRST_PARM_OFFSET(FNDECL) 0 +/* Defining this macro makes __builtin_frame_address(0) and + __builtin_return_address(0) work with -fomit-frame-pointer. */ +#define INITIAL_FRAME_ADDRESS_RTX \ + (TARGET_PACKED_STACK ? \ + plus_constant (arg_pointer_rtx, -UNITS_PER_WORD) : \ + plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)) + /* The return address of the current frame is retrieved from the initial value of register RETURN_REGNUM. For frames farther back, we use the stack slot where the corresponding RETURN_REGNUM register was saved. */ +#define DYNAMIC_CHAIN_ADDRESS(FRAME) \ + (TARGET_PACKED_STACK ? \ + plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : (FRAME)) -#define DYNAMIC_CHAIN_ADDRESS(FRAME) \ - ((FRAME) != hard_frame_pointer_rtx ? (FRAME) : \ - plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)) - -#define RETURN_ADDR_RTX(COUNT, FRAME) \ +#define RETURN_ADDR_RTX(COUNT, FRAME) \ s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME))) /* In 31-bit mode, we need to mask off the high bit of return addresses. */ -#define MASK_RETURN_ADDR (TARGET_64BIT ? GEN_INT (-1) : GEN_INT (0x7fffffff)) +#define MASK_RETURN_ADDR (TARGET_64BIT ? constm1_rtx : GEN_INT (0x7fffffff)) /* Exception handling. */ @@ -608,10 +543,8 @@ extern int current_function_outgoing_args_size; /* Describe how we implement __builtin_eh_return. */ #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM) -#define EH_RETURN_HANDLER_RTX \ - gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, \ - -STACK_POINTER_OFFSET + UNITS_PER_WORD*RETURN_REGNUM)) - +#define EH_RETURN_HANDLER_RTX gen_rtx_MEM (Pmode, return_address_pointer_rtx) + /* Select a format to encode pointers in exception handling data. */ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ (flag_pic \ @@ -625,6 +558,7 @@ extern int current_function_outgoing_args_size; #define FRAME_POINTER_REGNUM 34 #define HARD_FRAME_POINTER_REGNUM 11 #define ARG_POINTER_REGNUM 32 +#define RETURN_ADDRESS_POINTER_REGNUM 35 /* The static chain must be call-clobbered, but not used for function argument passing. As register 1 is clobbered by @@ -641,30 +575,20 @@ extern int current_function_outgoing_args_size; #define FRAME_POINTER_REQUIRED 0 -#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0 +#define ELIMINABLE_REGS \ +{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ + { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ + { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ + { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ + { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ + { RETURN_ADDRESS_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \ + { BASE_REGNUM, BASE_REGNUM }} -#define ELIMINABLE_REGS \ -{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ - { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ - { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ - { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} +#define CAN_ELIMINATE(FROM, TO) \ + s390_can_eliminate ((FROM), (TO)) -#define CAN_ELIMINATE(FROM, TO) (1) - -#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ -{ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ - { (OFFSET) = 0; } \ - else if ((FROM) == FRAME_POINTER_REGNUM \ - && (TO) == HARD_FRAME_POINTER_REGNUM) \ - { (OFFSET) = 0; } \ - else if ((FROM) == ARG_POINTER_REGNUM \ - && (TO) == HARD_FRAME_POINTER_REGNUM) \ - { (OFFSET) = s390_arg_frame_offset (); } \ - else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ - { (OFFSET) = s390_arg_frame_offset (); } \ - else \ - abort(); \ -} +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + (OFFSET) = s390_initial_elimination_offset ((FROM), (TO)) /* Stack arguments. */ @@ -694,11 +618,6 @@ CUMULATIVE_ARGS; #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ s390_function_arg (&CUM, MODE, TYPE, NAMED) -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ - s390_function_arg_pass_by_reference (MODE, TYPE) - -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0 - /* Arguments can be placed in general registers 2 to 6, or in floating point registers 0 and 2. */ #define FUNCTION_ARG_REGNO_P(N) (((N) >=2 && (N) <7) || \ @@ -716,9 +635,6 @@ CUMULATIVE_ARGS; /* Only gpr 2 and fpr 0 are ever used as return registers. */ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16) -/* Structure value address is passed as invisible first argument (gpr 2). */ -#define STRUCT_VALUE 0 - /* Function entry and exit. */ @@ -739,13 +655,9 @@ CUMULATIVE_ARGS; #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ s390_va_start (valist, nextarg) -#define EXPAND_BUILTIN_VA_ARG(valist, type) \ - s390_va_arg (valist, type) - - /* Trampolines for nested functions. */ -#define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20) +#define TRAMPOLINE_SIZE (TARGET_64BIT ? 32 : 16) #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \ s390_initialize_trampoline ((ADDR), (FNADDR), (CXT)) @@ -754,12 +666,6 @@ CUMULATIVE_ARGS; s390_trampoline_template (FILE) -/* Library calls. */ - -/* We should use memcpy, not bcopy. */ -#define TARGET_MEM_FUNCTIONS - - /* Addressing modes, and classification of registers for them. */ /* Recognize any constant value that is a valid address. */ @@ -768,38 +674,6 @@ CUMULATIVE_ARGS; /* Maximum number of registers that can appear in a valid memory address. */ #define MAX_REGS_PER_ADDRESS 2 -/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check - its validity for a certain class. We have two alternate definitions - for each of them. The usual definition accepts all pseudo regs; the - other rejects them all. The symbol REG_OK_STRICT causes the latter - definition to be used. - - Most source files want to accept pseudo regs in the hope that they will - get allocated to the class that the insn wants them to be in. - Some source files that are used after register allocation - need to be strict. */ - -#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \ -((GET_MODE (X) == Pmode) && \ - ((REGNO (X) >= FIRST_PSEUDO_REGISTER) \ - || REGNO_REG_CLASS (REGNO (X)) == ADDR_REGS)) - -#define REG_OK_FOR_BASE_NONSTRICT_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X) - -#define REG_OK_FOR_INDEX_STRICT_P(X) \ -((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_INDEX_P (REGNO (X)))) - -#define REG_OK_FOR_BASE_STRICT_P(X) \ -((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_BASE_P (REGNO (X)))) - -#ifndef REG_OK_STRICT -#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X) -#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X) -#else -#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P(X) -#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P(X) -#endif - /* S/390 has no mode dependent addresses. */ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) @@ -831,6 +705,19 @@ CUMULATIVE_ARGS; goto WIN; \ } +/* Try a machine-dependent way of reloading an illegitimate address + operand. If we find one, push the reload and jump to WIN. This + macro is used in only one place: `find_reloads_address' in reload.c. */ +#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \ +do { \ + rtx new = legitimize_reload_address (AD, MODE, OPNUM, (int)(TYPE)); \ + if (new) \ + { \ + (AD) = new; \ + goto WIN; \ + } \ +} while (0) + /* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ #define LEGITIMATE_CONSTANT_P(X) \ @@ -853,10 +740,14 @@ CUMULATIVE_ARGS; return the mode to be used for the comparison. */ #define SELECT_CC_MODE(OP, X, Y) s390_select_ccmode ((OP), (X), (Y)) +/* Canonicalize a comparison from one we don't have to one we do have. */ +#define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \ + s390_canonicalize_comparison (&(CODE), &(OP0), &(OP1)) + /* Define the information needed to generate branch and scc insns. This is stored from the compare operation. Note that we can't use "rtx" here since it hasn't been defined! */ -extern struct rtx_def *s390_compare_op0, *s390_compare_op1; +extern struct rtx_def *s390_compare_op0, *s390_compare_op1, *s390_compare_emitted; /* Relative costs of operations. */ @@ -880,9 +771,14 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1; /* Nonzero if access to memory by bytes is slow and undesirable. */ #define SLOW_BYTE_ACCESS 1 +/* An integer expression for the size in bits of the largest integer machine + mode that should actually be used. We allow pairs of registers. */ +#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode) + /* The maximum number of bytes that a single instruction can move quickly - between memory and registers or between two memory locations. */ + between memory and registers or between two memory locations. */ #define MOVE_MAX (TARGET_64BIT ? 16 : 8) +#define MOVE_MAX_PIECES (TARGET_64BIT ? 8 : 4) #define MAX_MOVE_MAX 16 /* Determine whether to use move_by_pieces or block move insn. */ @@ -895,6 +791,11 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1; ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \ || (TARGET_64BIT && (SIZE) == 8) ) +/* This macro is used to determine whether store_by_pieces should be + called to "memset" storage with byte values other than zero, or + to "memcpy" storage when the source is a constant string. */ +#define STORE_BY_PIECES_P(SIZE, ALIGN) MOVE_BY_PIECES_P (SIZE, ALIGN) + /* Don't perform CSE on function addresses. */ #define NO_FUNCTION_CSE @@ -959,23 +860,23 @@ extern int flag_pic; indexed by compiler's hard-register-number (see above). */ #define REGISTER_NAMES \ { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \ - "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \ + "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \ "%f0", "%f2", "%f4", "%f6", "%f1", "%f3", "%f5", "%f7", \ - "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \ - "%ap", "%cc", "%fp" \ + "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \ + "%ap", "%cc", "%fp", "%rp", "%a0", "%a1" \ } -/* Emit a dtp-relative reference to a TLS variable. */ - -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - s390_output_dwarf_dtprel (FILE, SIZE, X) -#endif - /* Print operand X (an rtx) in assembler syntax to file FILE. */ #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) +/* Output machine-dependent UNSPECs in address constants. */ +#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \ +do { \ + if (!s390_output_addr_const_extra (FILE, (X))) \ + goto FAIL; \ +} while (0); + /* Output an element of a case-vector that is absolute. */ #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ do { \ @@ -1002,22 +903,6 @@ do { \ /* Miscellaneous parameters. */ -/* Define the codes that are matched by predicates in aux-output.c. */ -#define PREDICATE_CODES \ - {"s_operand", { SUBREG, MEM }}, \ - {"s_imm_operand", { CONST_INT, CONST_DOUBLE, SUBREG, MEM }}, \ - {"shift_count_operand", { REG, SUBREG, PLUS, CONST_INT }}, \ - {"bras_sym_operand",{ SYMBOL_REF, CONST }}, \ - {"larl_operand", { SYMBOL_REF, CONST, CONST_INT, CONST_DOUBLE }}, \ - {"load_multiple_operation", {PARALLEL}}, \ - {"store_multiple_operation", {PARALLEL}}, \ - {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \ - {"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST, \ - CONST_INT, CONST_DOUBLE }}, \ - {"s390_plus_operand", { PLUS }}, \ - {"s390_alc_comparison", { LTU, GTU, LEU, GEU }}, \ - {"s390_slb_comparison", { LTU, GTU, LEU, GEU }}, - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode) @@ -1038,7 +923,15 @@ do { \ indexing purposes) so give the MEM rtx a byte's mode. */ #define FUNCTION_MODE QImode -/* This macro definition sets up a default value for `main' to return. */ -#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node) +/* Specify the value which is used when clz operand is zero. */ +#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 64, 1) + +/* Machine-specific symbol_ref flags. */ +#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0) + +/* Check whether integer displacement is in range. */ +#define DISP_IN_RANGE(d) \ + (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \ + : ((d) >= 0 && (d) <= 4095)) #endif diff --git a/contrib/gcc/config/s390/s390.md b/contrib/gcc/config/s390/s390.md index 345a36a1859..23484098f79 100644 --- a/contrib/gcc/config/s390/s390.md +++ b/contrib/gcc/config/s390/s390.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler -- S/390 / zSeries version. -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 ;; Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). @@ -18,53 +18,34 @@ ;; 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. ;; -;; Special constraints for s/390 machine description: -;; -;; a -- Any address register from 1 to 15. -;; d -- Any register from 0 to 15. -;; I -- An 8-bit constant (0..255). -;; J -- A 12-bit constant (0..4095). -;; K -- A 16-bit constant (-32768..32767). -;; L -- Value appropriate as displacement. -;; (0..4095) for short displacement -;; (-524288..524287) for long displacement -;; M -- Constant integer with a value of 0x7fffffff. -;; N -- Multiple letter constraint followed by 4 parameter letters. -;; 0..9: number of the part counting from most to least significant -;; H,Q: mode of the part -;; D,S,H: mode of the containing operand -;; 0,F: value of the other parts (F - all bits set) -;; -;; The constraint matches if the specified part of a constant -;; has a value different from its other parts. -;; Q -- Memory reference without index register and with short displacement. -;; R -- Memory reference with index register and short displacement. -;; S -- Memory reference without index register but with long displacement. -;; T -- Memory reference with index register and long displacement. -;; U -- Pointer with short displacement. -;; W -- Pointer with long displacement. -;; Y -- Shift count operand. +;; See constraints.md for a description of constraints specific to s390. ;; + ;; Special formats used for outputting 390 instructions. ;; ;; %C: print opcode suffix for branch condition. ;; %D: print opcode suffix for inverse branch condition. ;; %J: print tls_load/tls_gdcall/tls_ldcall suffix +;; %G: print the size of the operand in bytes. ;; %O: print only the displacement of a memory reference. ;; %R: print only the base register of a memory reference. +;; %S: print S-type memory reference (base+displacement). ;; %N: print the second word of a DImode operand. ;; %M: print the second word of a TImode operand. - +;; %Y: print shift count operand. +;; ;; %b: print integer X as if it's an unsigned byte. -;; %x: print integer X as if it's an unsigned word. -;; %h: print integer X as if it's a signed word. -;; %i: print the first nonzero HImode part of X -;; %j: print the first HImode part unequal to 0xffff of X - +;; %x: print integer X as if it's an unsigned halfword. +;; %h: print integer X as if it's a signed halfword. +;; %i: print the first nonzero HImode part of X. +;; %j: print the first HImode part unequal to -1 of X. +;; %k: print the first nonzero SImode part of X. +;; %m: print the first SImode part unequal to -1 of X. +;; %o: print integer X as if it's an unsigned 32bit word. ;; ;; We have a special constraint for pattern matching. ;; @@ -78,7 +59,8 @@ (define_constants [; Miscellaneous (UNSPEC_ROUND 1) - (UNSPEC_SETHIGH 10) + (UNSPEC_CMPINT 2) + (UNSPEC_ICM 10) ; GOT/PLT and lt-relative accesses (UNSPEC_LTREL_OFFSET 100) @@ -92,6 +74,9 @@ ; Literal pool (UNSPEC_RELOAD_BASE 210) (UNSPEC_MAIN_BASE 211) + (UNSPEC_LTREF 212) + (UNSPEC_INSN 213) + (UNSPEC_EXECUTE 214) ; TLS relocation specifiers (UNSPEC_TLSGD 500) @@ -102,12 +87,16 @@ (UNSPEC_INDNTPOFF 505) ; TLS support - (UNSPEC_TP 510) (UNSPEC_TLSLDM_NTPOFF 511) (UNSPEC_TLS_LOAD 512) ; String Functions - (UNSPEC_SRST 600) + (UNSPEC_SRST 600) + (UNSPEC_MVST 601) + + ; Stack Smashing Protector + (UNSPEC_SP_SET 700) + (UNSPEC_SP_TEST 701) ]) ;; @@ -118,233 +107,241 @@ [; Blockage (UNSPECV_BLOCKAGE 0) + ; TPF Support + (UNSPECV_TPF_PROLOGUE 20) + (UNSPECV_TPF_EPILOGUE 21) + ; Literal pool (UNSPECV_POOL 200) - (UNSPECV_POOL_START 201) - (UNSPECV_POOL_END 202) + (UNSPECV_POOL_SECTION 201) + (UNSPECV_POOL_ALIGN 202) (UNSPECV_POOL_ENTRY 203) (UNSPECV_MAIN_POOL 300) ; TLS support (UNSPECV_SET_TP 500) + + ; Atomic Support + (UNSPECV_MB 700) + (UNSPECV_CAS 701) + ]) + +;; +;; Registers +;; + +(define_constants + [ + ; Sibling call register. + (SIBCALL_REGNUM 1) + ; Literal pool base register. + (BASE_REGNUM 13) + ; Return address register. + (RETURN_REGNUM 14) + ; Condition code register. + (CC_REGNUM 33) + ; Thread local storage pointer register. + (TP_REGNUM 36) ]) -;; Processor type. This attribute must exactly match the processor_type -;; enumeration in s390.h. - -(define_attr "cpu" "g5,g6,z900,z990" - (const (symbol_ref "s390_tune"))) - -;; Define an insn type attribute. This is used in function unit delay -;; computations. - -(define_attr "type" "none,integer,load,lr,la,larl,lm,stm, - cs,vs,store,imul,idiv, - branch,jsr,fsimpd,fsimps, - floadd,floads,fstored, fstores, - fmuld,fmuls,fdivd,fdivs, - ftoi,itof,fsqrtd,fsqrts, - other,o2,o3" - (const_string "integer")) - -;; Operand type. Used to default length attribute values +;; Instruction operand type as used in the Principles of Operation. +;; Used to determine defaults for length and other attribute values. (define_attr "op_type" "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY" - (const_string "RX")) + (const_string "NN")) -;; Insn are devide in two classes: -;; agen: Insn using agen -;; reg: Insn not using agen +;; Instruction type attribute used for scheduling. + +(define_attr "type" "none,integer,load,lr,la,larl,lm,stm, + cs,vs,store,sem,idiv, + imulhi,imulsi,imuldi, + branch,jsr,fsimptf,fsimpdf,fsimpsf, + floadtf,floaddf,floadsf,fstoredf,fstoresf, + fmultf,fmuldf,fmulsf,fdivtf,fdivdf,fdivsf, + ftoi,itof,fsqrttf,fsqrtdf,fsqrtsf, + ftrunctf,ftruncdf,other" + (cond [(eq_attr "op_type" "NN") (const_string "other") + (eq_attr "op_type" "SS") (const_string "cs")] + (const_string "integer"))) + +;; Another attribute used for scheduling purposes: +;; agen: Instruction uses the address generation unit +;; reg: Instruction does not use the agen unit (define_attr "atype" "agen,reg" -(cond [ (eq_attr "op_type" "E") (const_string "reg") - (eq_attr "op_type" "RR") (const_string "reg") - (eq_attr "op_type" "RX") (const_string "agen") - (eq_attr "op_type" "RI") (const_string "reg") - (eq_attr "op_type" "RRE") (const_string "reg") - (eq_attr "op_type" "RS") (const_string "agen") - (eq_attr "op_type" "RSI") (const_string "agen") - (eq_attr "op_type" "S") (const_string "agen") - (eq_attr "op_type" "SI") (const_string "agen") - (eq_attr "op_type" "SS") (const_string "agen") - (eq_attr "op_type" "SSE") (const_string "agen") - (eq_attr "op_type" "RXE") (const_string "agen") - (eq_attr "op_type" "RSE") (const_string "agen") - (eq_attr "op_type" "RIL") (const_string "agen") - (eq_attr "op_type" "RXY") (const_string "agen") - (eq_attr "op_type" "RSY") (const_string "agen") - (eq_attr "op_type" "SIY") (const_string "agen")] - (const_string "reg"))) - -;; Generic pipeline function unit. - -(define_function_unit "integer" 1 0 - (eq_attr "type" "none") 0 0) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "integer") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsimpd") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsimps") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "load") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "floadd") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "floads") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "la") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "larl") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "lr") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "branch") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "store") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fstored") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fstores") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "lm") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "stm") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "cs") 5 5) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "vs") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "jsr") 5 5) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "imul") 7 7) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fmuld") 6 6) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fmuls") 6 6) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "idiv") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fdivd") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fdivs") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsqrtd") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsqrts") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "ftoi") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "itof") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "o2") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "o3") 3 3) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "other") 5 5) - -;; Pipeline description for z900 - -(include "2064.md") -(include "2084.md") + (if_then_else (eq_attr "op_type" "E,RR,RI,RRE") + (const_string "reg") + (const_string "agen"))) ;; Length in bytes. (define_attr "length" "" -(cond [ (eq_attr "op_type" "E") (const_int 2) - (eq_attr "op_type" "RR") (const_int 2) - (eq_attr "op_type" "RX") (const_int 4) - (eq_attr "op_type" "RI") (const_int 4) - (eq_attr "op_type" "RRE") (const_int 4) - (eq_attr "op_type" "RS") (const_int 4) - (eq_attr "op_type" "RSI") (const_int 4) - (eq_attr "op_type" "S") (const_int 4) - (eq_attr "op_type" "SI") (const_int 4) - (eq_attr "op_type" "SS") (const_int 6) - (eq_attr "op_type" "SSE") (const_int 6) - (eq_attr "op_type" "RXE") (const_int 6) - (eq_attr "op_type" "RSE") (const_int 6) - (eq_attr "op_type" "RIL") (const_int 6) - (eq_attr "op_type" "RXY") (const_int 6) - (eq_attr "op_type" "RSY") (const_int 6) - (eq_attr "op_type" "SIY") (const_int 6)] - (const_int 4))) + (cond [(eq_attr "op_type" "E,RR") (const_int 2) + (eq_attr "op_type" "RX,RI,RRE,RS,RSI,S,SI") (const_int 4)] + (const_int 6))) -;; Define attributes for `asm' insns. -(define_asm_attributes [(set_attr "type" "other") - (set_attr "op_type" "NN")]) +;; Processor type. This attribute must exactly match the processor_type +;; enumeration in s390.h. The current machine description does not +;; distinguish between g5 and g6, but there are differences between the two +;; CPUs could in theory be modeled. -;; -;; Condition Codes -;; -; -; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR) -; CCA: Zero Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA) -; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM) -; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM) -; CCT: Zero Mixed Mixed Ones (TM, TMH, TML) +(define_attr "cpu" "g5,g6,z900,z990,z9_109" + (const (symbol_ref "s390_tune"))) -; CCZ -> CCL / CCZ1 -; CCZ1 -> CCA/CCU/CCS/CCT -; CCS -> CCA +;; Pipeline description for z900. For lack of anything better, +;; this description is also used for the g5 and g6. +(include "2064.md") -; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST -; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT +;; Pipeline description for z990. +(include "2084.md") + +;; Predicates +(include "predicates.md") + +;; Constraint definitions +(include "constraints.md") + +;; Other includes +(include "tpf.md") + +;; Macros + +;; This mode macro allows floating point patterns to be generated from the +;; same template. +(define_mode_macro FPR [TF DF SF]) +(define_mode_macro DSF [DF SF]) + +;; These mode macros allow 31-bit and 64-bit TDSI patterns to be generated +;; from the same template. +(define_mode_macro TDSI [(TI "TARGET_64BIT") DI SI]) + +;; These mode macros allow 31-bit and 64-bit GPR patterns to be generated +;; from the same template. +(define_mode_macro GPR [(DI "TARGET_64BIT") SI]) +(define_mode_macro DSI [DI SI]) + +;; This mode macro allows :P to be used for patterns that operate on +;; pointer-sized quantities. Exactly one of the two alternatives will match. +(define_mode_macro DP [(TI "TARGET_64BIT") (DI "!TARGET_64BIT")]) +(define_mode_macro P [(DI "TARGET_64BIT") (SI "!TARGET_64BIT")]) + +;; This mode macro allows the QI and HI patterns to be defined from +;; the same template. +(define_mode_macro HQI [HI QI]) + +;; This mode macro allows the integer patterns to be defined from the +;; same template. +(define_mode_macro INT [(DI "TARGET_64BIT") SI HI QI]) + +;; This macro allows to unify all 'bCOND' expander patterns. +(define_code_macro COMPARE [eq ne gt gtu lt ltu ge geu le leu unordered + ordered uneq unlt ungt unle unge ltgt]) + +;; This macro allows to unify all 'sCOND' patterns. +(define_code_macro SCOND [ltu gtu leu geu]) + +;; This macro allows some 'ashift' and 'lshiftrt' pattern to be defined from +;; the same template. +(define_code_macro SHIFT [ashift lshiftrt]) + +;; These macros allow to combine most atomic operations. +(define_code_macro ATOMIC [and ior xor plus minus mult]) +(define_code_attr atomic [(and "and") (ior "ior") (xor "xor") + (plus "add") (minus "sub") (mult "nand")]) + + +;; In FPR templates, a string like "ltbr" will expand to "ltxbr" in TFmode, +;; "ltdbr" in DFmode, and "ltebr" in SFmode. +(define_mode_attr xde [(TF "x") (DF "d") (SF "e")]) + +;; In FPR templates, a string like "mbr" will expand to "mxbr" in TFmode, +;; "mdbr" in DFmode, and "meebr" in SFmode. +(define_mode_attr xdee [(TF "x") (DF "d") (SF "ee")]) + +;; In FPR templates, "" will expand to "RRE" in TFmode and "RR" otherwise. +;; Likewise for "". +(define_mode_attr RRe [(TF "RRE") (DF "RR") (SF "RR")]) +(define_mode_attr RXe [(TF "RXE") (DF "RX") (SF "RX")]) + +;; In FPR templates, "" will expand to "f" in TFmode and "R" otherwise. +;; This is used to disable the memory alternative in TFmode patterns. +(define_mode_attr Rf [(TF "f") (DF "R") (SF "R")]) + +;; In GPR and P templates, a constraint like "" will expand to "d" in DImode +;; and "0" in SImode. This allows to combine instructions of which the 31bit +;; version only operates on one register. +(define_mode_attr d0 [(DI "d") (SI "0")]) + +;; In combination with d0 this allows to combine instructions of which the 31bit +;; version only operates on one register. The DImode version needs an additional +;; register for the assembler output. +(define_mode_attr 1 [(DI "%1,") (SI "")]) + +;; In SHIFT templates, a string like "sdl" will expand to "sldl" in +;; 'ashift' and "srdl" in 'lshiftrt'. +(define_code_attr lr [(ashift "l") (lshiftrt "r")]) + +;; In SHIFT templates, this attribute holds the correct standard name for the +;; pattern itself and the corresponding function calls. +(define_code_attr shift [(ashift "ashl") (lshiftrt "lshr")]) + +;; This attribute handles differences in the instruction 'type' and will result +;; in "RRE" for DImode and "RR" for SImode. +(define_mode_attr E [(DI "E") (SI "")]) + +;; This attribute handles differences in the instruction 'type' and makes RX +;; to result in "RXY" for DImode and "RX" for SImode. +(define_mode_attr Y [(DI "Y") (SI "")]) + +;; This attribute handles differences in the instruction 'type' and will result +;; in "RSE" for TImode and "RS" for DImode. +(define_mode_attr TE [(TI "E") (DI "")]) + +;; In GPR templates, a string like "lcr" will expand to "lcgr" in DImode +;; and "lcr" in SImode. +(define_mode_attr g [(DI "g") (SI "")]) + +;; In GPR templates, a string like "sl" will expand to "slg" in DImode +;; and "sly" in SImode. This is useful because on 64bit the ..g instructions +;; were enhanced with long displacements whereas 31bit instructions got a ..y +;; variant for long displacements. +(define_mode_attr y [(DI "g") (SI "y")]) + +;; In DP templates, a string like "cds" will expand to "cdsg" in TImode +;; and "cds" in DImode. +(define_mode_attr tg [(TI "g") (DI "")]) + +;; In GPR templates, a string like "cdbr" will expand to "cgdbr" in DImode +;; and "cfdbr" in SImode. +(define_mode_attr gf [(DI "g") (SI "f")]) + +;; ICM mask required to load MODE value into the lowest subreg +;; of a SImode register. +(define_mode_attr icm_lo [(HI "3") (QI "1")]) + +;; In HQI templates, a string like "llg" will expand to "llgh" in +;; HImode and "llgc" in QImode. +(define_mode_attr hc [(HI "h") (QI "c")]) + +;; In P templates, the mode will expand to "TI" in DImode and "DI" +;; in SImode. +(define_mode_attr DBL [(DI "TI") (SI "DI")]) + +;; Maximum unsigned integer that fits in MODE. +(define_mode_attr max_uint [(HI "65535") (QI "255")]) ;; ;;- Compare instructions. ;; -(define_expand "cmpdi" - [(set (reg:CC 33) - (compare:CC (match_operand:DI 0 "register_operand" "") - (match_operand:DI 1 "general_operand" "")))] - "TARGET_64BIT" -{ - s390_compare_op0 = operands[0]; - s390_compare_op1 = operands[1]; - DONE; -}) - -(define_expand "cmpsi" - [(set (reg:CC 33) - (compare:CC (match_operand:SI 0 "register_operand" "") - (match_operand:SI 1 "general_operand" "")))] +(define_expand "cmp" + [(set (reg:CC CC_REGNUM) + (compare:CC (match_operand:GPR 0 "register_operand" "") + (match_operand:GPR 1 "general_operand" "")))] "" { s390_compare_op0 = operands[0]; @@ -352,10 +349,10 @@ DONE; }) -(define_expand "cmpdf" - [(set (reg:CC 33) - (compare:CC (match_operand:DF 0 "register_operand" "") - (match_operand:DF 1 "general_operand" "")))] +(define_expand "cmp" + [(set (reg:CC CC_REGNUM) + (compare:CC (match_operand:FPR 0 "register_operand" "") + (match_operand:FPR 1 "general_operand" "")))] "TARGET_HARD_FLOAT" { s390_compare_op0 = operands[0]; @@ -363,185 +360,28 @@ DONE; }) -(define_expand "cmpsf" - [(set (reg:CC 33) - (compare:CC (match_operand:SF 0 "register_operand" "") - (match_operand:SF 1 "general_operand" "")))] - "TARGET_HARD_FLOAT" -{ - s390_compare_op0 = operands[0]; - s390_compare_op1 = operands[1]; - DONE; -}) - - -; Test-under-Mask (zero_extract) instructions - -(define_insn "*tmdi_ext" - [(set (reg 33) - (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d") - (match_operand:DI 1 "const_int_operand" "n") - (match_operand:DI 2 "const_int_operand" "n")) - (const_int 0)))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT - && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0 - && INTVAL (operands[1]) + INTVAL (operands[2]) <= 64 - && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4 - == INTVAL (operands[2]) >> 4" -{ - int part = INTVAL (operands[2]) >> 4; - int block = (1 << INTVAL (operands[1])) - 1; - int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15); - - operands[2] = GEN_INT (block << shift); - - switch (part) - { - case 0: return "tmhh\t%0,%x2"; - case 1: return "tmhl\t%0,%x2"; - case 2: return "tmlh\t%0,%x2"; - case 3: return "tmll\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - -(define_insn "*tmsi_ext" - [(set (reg 33) - (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d") - (match_operand:SI 1 "const_int_operand" "n") - (match_operand:SI 2 "const_int_operand" "n")) - (const_int 0)))] - "s390_match_ccmode(insn, CCTmode) - && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0 - && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32 - && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4 - == INTVAL (operands[2]) >> 4" -{ - int part = INTVAL (operands[2]) >> 4; - int block = (1 << INTVAL (operands[1])) - 1; - int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15); - - operands[2] = GEN_INT (block << shift); - - switch (part) - { - case 0: return "tmh\t%0,%x2"; - case 1: return "tml\t%0,%x2"; - default: abort (); - } -} - [(set_attr "op_type" "RI")]) - -(define_insn "*tmqisi_ext" - [(set (reg 33) - (compare (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,S") - (match_operand:SI 1 "const_int_operand" "n,n") - (match_operand:SI 2 "const_int_operand" "n,n")) - (const_int 0)))] - "!TARGET_64BIT && s390_match_ccmode(insn, CCTmode) - && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0 - && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8" -{ - int block = (1 << INTVAL (operands[1])) - 1; - int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]); - - operands[2] = GEN_INT (block << shift); - return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2"; -} - [(set_attr "op_type" "SI,SIY")]) - -(define_insn "*tmqidi_ext" - [(set (reg 33) - (compare (zero_extract:DI (match_operand:QI 0 "memory_operand" "Q,S") - (match_operand:SI 1 "const_int_operand" "n,n") - (match_operand:SI 2 "const_int_operand" "n,n")) - (const_int 0)))] - "TARGET_64BIT && s390_match_ccmode(insn, CCTmode) - && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0 - && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8" -{ - int block = (1 << INTVAL (operands[1])) - 1; - int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]); - - operands[2] = GEN_INT (block << shift); - return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2"; -} - [(set_attr "op_type" "SI,SIY")]) - ; Test-under-Mask instructions -(define_insn "*tmdi_mem" - [(set (reg 33) - (compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S") - (match_operand:DI 1 "immediate_operand" "n,n")) - (match_operand:DI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_part (operands[1], DImode, QImode, 0) >= 0" -{ - int part = s390_single_part (operands[1], DImode, QImode, 0); - operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); - - operands[0] = gen_rtx_MEM (QImode, - plus_constant (XEXP (operands[0], 0), part)); - return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1"; -} - [(set_attr "op_type" "SI,SIY")]) - -(define_insn "*tmsi_mem" - [(set (reg 33) - (compare (and:SI (match_operand:SI 0 "memory_operand" "Q,S") - (match_operand:SI 1 "immediate_operand" "n,n")) - (match_operand:SI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_part (operands[1], SImode, QImode, 0) >= 0" -{ - int part = s390_single_part (operands[1], SImode, QImode, 0); - operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); - - operands[0] = gen_rtx_MEM (QImode, - plus_constant (XEXP (operands[0], 0), part)); - return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1"; -} - [(set_attr "op_type" "SI")]) - -(define_insn "*tmhi_mem" - [(set (reg 33) - (compare (and:SI (subreg:SI (match_operand:HI 0 "memory_operand" "Q,S") 0) - (match_operand:SI 1 "immediate_operand" "n,n")) - (match_operand:SI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0)) - && s390_single_part (operands[1], HImode, QImode, 0) >= 0" -{ - int part = s390_single_part (operands[1], HImode, QImode, 0); - operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0)); - - operands[0] = gen_rtx_MEM (QImode, - plus_constant (XEXP (operands[0], 0), part)); - return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1"; -} - [(set_attr "op_type" "SI")]) - (define_insn "*tmqi_mem" - [(set (reg 33) - (compare (and:SI (subreg:SI (match_operand:QI 0 "memory_operand" "Q,S") 0) - (match_operand:SI 1 "immediate_operand" "n,n")) - (match_operand:SI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))" + [(set (reg CC_REGNUM) + (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S") + (match_operand:QI 1 "immediate_operand" "n,n")) + (match_operand:QI 2 "immediate_operand" "n,n")))] + "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], false))" "@ - tm\t%0,%b1 - tmy\t%0,%b1" + tm\t%S0,%b1 + tmy\t%S0,%b1" [(set_attr "op_type" "SI,SIY")]) (define_insn "*tmdi_reg" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d") - (match_operand:DI 1 "immediate_operand" + (match_operand:DI 1 "immediate_operand" "N0HD0,N1HD0,N2HD0,N3HD0")) (match_operand:DI 2 "immediate_operand" "n,n,n,n")))] "TARGET_64BIT - && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) + && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) && s390_single_part (operands[1], DImode, HImode, 0) >= 0" "@ tmhh\t%0,%i1 @@ -551,38 +391,34 @@ [(set_attr "op_type" "RI")]) (define_insn "*tmsi_reg" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d") (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0")) (match_operand:SI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) + "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) && s390_single_part (operands[1], SImode, HImode, 0) >= 0" "@ tmh\t%0,%i1 tml\t%0,%i1" [(set_attr "op_type" "RI")]) -(define_insn "*tmhi_full" - [(set (reg 33) - (compare (match_operand:HI 0 "register_operand" "d") - (match_operand:HI 1 "immediate_operand" "n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))" - "tml\t%0,65535" - [(set_attr "op_type" "RX")]) - -(define_insn "*tmqi_full" - [(set (reg 33) - (compare (match_operand:QI 0 "register_operand" "d") - (match_operand:QI 1 "immediate_operand" "n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))" - "tml\t%0,255" +(define_insn "*tm_full" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "register_operand" "d") + (match_operand:HQI 1 "immediate_operand" "n")))] + "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], true))" + "tml\t%0," [(set_attr "op_type" "RI")]) +; ; Load-and-Test instructions +; + +; tst(di|si) instruction pattern(s). (define_insn "*tstdi_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0) (const_int 32)) (const_int 32)) (match_operand:DI 1 "const0_operand" ""))) @@ -592,26 +428,68 @@ "ltgfr\t%2,%0" [(set_attr "op_type" "RRE")]) +; ltr, lt, ltgr, ltg +(define_insn "*tst_extimm" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m") + (match_operand:GPR 1 "const0_operand" ""))) + (set (match_operand:GPR 2 "register_operand" "=d,d") + (match_dup 0))] + "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM" + "@ + ltr\t%2,%0 + lt\t%2,%0" + [(set_attr "op_type" "RR,RXY")]) + +; ltr, lt, ltgr, ltg +(define_insn "*tst_cconly_extimm" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m") + (match_operand:GPR 1 "const0_operand" ""))) + (clobber (match_scratch:GPR 2 "=X,d"))] + "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM" + "@ + ltr\t%0,%0 + lt\t%2,%0" + [(set_attr "op_type" "RR,RXY")]) + (define_insn "*tstdi" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" ""))) (set (match_operand:DI 2 "register_operand" "=d") (match_dup 0))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && !TARGET_EXTIMM" "ltgr\t%2,%0" [(set_attr "op_type" "RRE")]) -(define_insn "*tstdi_cconly" - [(set (reg 33) - (compare (match_operand:DI 0 "register_operand" "d") - (match_operand:DI 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" - "ltgr\t%0,%0" - [(set_attr "op_type" "RRE")]) +(define_insn "*tstsi" + [(set (reg CC_REGNUM) + (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") + (match_operand:SI 1 "const0_operand" ""))) + (set (match_operand:SI 2 "register_operand" "=d,d,d") + (match_dup 0))] + "s390_match_ccmode(insn, CCSmode) && !TARGET_EXTIMM" + "@ + ltr\t%2,%0 + icm\t%2,15,%S0 + icmy\t%2,15,%S0" + [(set_attr "op_type" "RR,RS,RSY")]) + +(define_insn "*tstsi_cconly" + [(set (reg CC_REGNUM) + (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") + (match_operand:SI 1 "const0_operand" ""))) + (clobber (match_scratch:SI 2 "=X,d,d"))] + "s390_match_ccmode(insn, CCSmode)" + "@ + ltr\t%0,%0 + icm\t%2,15,%S0 + icmy\t%2,15,%S0" + [(set_attr "op_type" "RR,RS,RSY")]) (define_insn "*tstdi_cconly_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT" @@ -619,140 +497,111 @@ [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) - -(define_insn "*tstsi" - [(set (reg 33) - (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") - (match_operand:SI 1 "const0_operand" ""))) - (set (match_operand:SI 2 "register_operand" "=d,d,d") - (match_dup 0))] +; ltr, ltgr +(define_insn "*tst_cconly2" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 0 "register_operand" "d") + (match_operand:GPR 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode)" - "@ - ltr\t%2,%0 - icm\t%2,15,%0 - icmy\t%2,15,%0" - [(set_attr "op_type" "RR,RS,RSY")]) + "ltr\t%0,%0" + [(set_attr "op_type" "RR")]) -(define_insn "*tstsi_cconly" - [(set (reg 33) - (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") - (match_operand:SI 1 "const0_operand" ""))) - (clobber (match_scratch:SI 2 "=X,d,d"))] - "s390_match_ccmode(insn, CCSmode)" - "@ - ltr\t%0,%0 - icm\t%2,15,%0 - icmy\t%2,15,%0" - [(set_attr "op_type" "RR,RS,RSY")]) +; tst(hi|qi) instruction pattern(s). -(define_insn "*tstsi_cconly2" - [(set (reg 33) - (compare (match_operand:SI 0 "register_operand" "d") - (match_operand:SI 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode)" - "ltr\t%0,%0" - [(set_attr "op_type" "RR")]) - -(define_insn "*tsthiCCT" - [(set (reg 33) - (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d") - (match_operand:HI 1 "const0_operand" ""))) - (set (match_operand:HI 2 "register_operand" "=d,d,0") +(define_insn "*tstCCT" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "nonimmediate_operand" "?Q,?S,d") + (match_operand:HQI 1 "const0_operand" ""))) + (set (match_operand:HQI 2 "register_operand" "=d,d,0") (match_dup 0))] "s390_match_ccmode(insn, CCTmode)" "@ - icm\t%2,3,%0 - icmy\t%2,3,%0 - tml\t%0,65535" + icm\t%2,,%S0 + icmy\t%2,,%S0 + tml\t%0," [(set_attr "op_type" "RS,RSY,RI")]) (define_insn "*tsthiCCT_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d") (match_operand:HI 1 "const0_operand" ""))) (clobber (match_scratch:HI 2 "=d,d,X"))] "s390_match_ccmode(insn, CCTmode)" "@ - icm\t%2,3,%0 - icmy\t%2,3,%0 + icm\t%2,3,%S0 + icmy\t%2,3,%S0 tml\t%0,65535" [(set_attr "op_type" "RS,RSY,RI")]) -(define_insn "*tsthi" - [(set (reg 33) - (compare (match_operand:HI 0 "s_operand" "Q,S") - (match_operand:HI 1 "const0_operand" ""))) - (set (match_operand:HI 2 "register_operand" "=d,d") - (match_dup 0))] - "s390_match_ccmode(insn, CCSmode)" - "@ - icm\t%2,3,%0 - icmy\t%2,3,%0" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*tsthi_cconly" - [(set (reg 33) - (compare (match_operand:HI 0 "s_operand" "Q,S") - (match_operand:HI 1 "const0_operand" ""))) - (clobber (match_scratch:HI 2 "=d,d"))] - "s390_match_ccmode(insn, CCSmode)" - "@ - icm\t%2,3,%0 - icmy\t%2,3,%0" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*tstqiCCT" - [(set (reg 33) - (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d") - (match_operand:QI 1 "const0_operand" ""))) - (set (match_operand:QI 2 "register_operand" "=d,d,0") - (match_dup 0))] - "s390_match_ccmode(insn, CCTmode)" - "@ - icm\t%2,1,%0 - icmy\t%2,1,%0 - tml\t%0,255" - [(set_attr "op_type" "RS,RSY,RI")]) - (define_insn "*tstqiCCT_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d") (match_operand:QI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCTmode)" "@ - cli\t%0,0 - cliy\t%0,0 + cli\t%S0,0 + cliy\t%S0,0 tml\t%0,255" [(set_attr "op_type" "SI,SIY,RI")]) -(define_insn "*tstqi" - [(set (reg 33) - (compare (match_operand:QI 0 "s_operand" "Q,S") - (match_operand:QI 1 "const0_operand" ""))) - (set (match_operand:QI 2 "register_operand" "=d,d") +(define_insn "*tst" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "s_operand" "Q,S") + (match_operand:HQI 1 "const0_operand" ""))) + (set (match_operand:HQI 2 "register_operand" "=d,d") (match_dup 0))] "s390_match_ccmode(insn, CCSmode)" "@ - icm\t%2,1,%0 - icmy\t%2,1,%0" + icm\t%2,,%S0 + icmy\t%2,,%S0" [(set_attr "op_type" "RS,RSY")]) -(define_insn "*tstqi_cconly" - [(set (reg 33) - (compare (match_operand:QI 0 "s_operand" "Q,S") - (match_operand:QI 1 "const0_operand" ""))) - (clobber (match_scratch:QI 2 "=d,d"))] +(define_insn "*tst_cconly" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "s_operand" "Q,S") + (match_operand:HQI 1 "const0_operand" ""))) + (clobber (match_scratch:HQI 2 "=d,d"))] "s390_match_ccmode(insn, CCSmode)" "@ - icm\t%2,1,%0 - icmy\t%2,1,%0" + icm\t%2,,%S0 + icmy\t%2,,%S0" [(set_attr "op_type" "RS,RSY")]) +; Compare (equality) instructions + +(define_insn "*cmpdi_cct" + [(set (reg CC_REGNUM) + (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,d,Q") + (match_operand:DI 1 "general_operand" "d,K,Os,m,BQ")))] + "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT" + "@ + cgr\t%0,%1 + cghi\t%0,%h1 + cgfi\t%0,%1 + cg\t%0,%1 + #" + [(set_attr "op_type" "RRE,RI,RIL,RXY,SS")]) + +(define_insn "*cmpsi_cct" + [(set (reg CC_REGNUM) + (compare (match_operand:SI 0 "nonimmediate_operand" "%d,d,d,d,d,Q") + (match_operand:SI 1 "general_operand" "d,K,Os,R,T,BQ")))] + "s390_match_ccmode (insn, CCTmode)" + "@ + cr\t%0,%1 + chi\t%0,%h1 + cfi\t%0,%1 + c\t%0,%1 + cy\t%0,%1 + #" + [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS")]) + + ; Compare (signed) instructions (define_insn "*cmpdi_ccs_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")) (match_operand:DI 0 "register_operand" "d,d")))] "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT" @@ -761,19 +610,8 @@ cgf\t%0,%1" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*cmpdi_ccs" - [(set (reg 33) - (compare (match_operand:DI 0 "register_operand" "d,d,d") - (match_operand:DI 1 "general_operand" "d,K,m")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" - "@ - cgr\t%0,%1 - cghi\t%0,%c1 - cg\t%0,%1" - [(set_attr "op_type" "RRE,RI,RXY")]) - (define_insn "*cmpsi_ccs_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")) (match_operand:SI 0 "register_operand" "d,d")))] "s390_match_ccmode(insn, CCSRmode)" @@ -782,199 +620,168 @@ chy\t%0,%1" [(set_attr "op_type" "RX,RXY")]) -(define_insn "*cmpsi_ccs" - [(set (reg 33) - (compare (match_operand:SI 0 "register_operand" "d,d,d,d") - (match_operand:SI 1 "general_operand" "d,K,R,T")))] +; cr, chi, cfi, c, cy, cgr, cghi, cgfi, cg +(define_insn "*cmp_ccs" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 0 "register_operand" "d,d,d,d,d") + (match_operand:GPR 1 "general_operand" "d,K,Os,R,T")))] "s390_match_ccmode(insn, CCSmode)" "@ - cr\t%0,%1 - chi\t%0,%c1 - c\t%0,%1 - cy\t%0,%1" - [(set_attr "op_type" "RR,RI,RX,RXY")]) + cr\t%0,%1 + chi\t%0,%h1 + cfi\t%0,%1 + c\t%0,%1 + c\t%0,%1" + [(set_attr "op_type" "RR,RI,RIL,RX,RXY")]) ; Compare (unsigned) instructions (define_insn "*cmpdi_ccu_zero" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")) (match_operand:DI 0 "register_operand" "d,d")))] - "s390_match_ccmode(insn, CCURmode) && TARGET_64BIT" + "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT" "@ clgfr\t%0,%1 clgf\t%0,%1" [(set_attr "op_type" "RRE,RXY")]) (define_insn "*cmpdi_ccu" - [(set (reg 33) - (compare (match_operand:DI 0 "register_operand" "d,d") - (match_operand:DI 1 "general_operand" "d,m")))] - "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT" + [(set (reg CC_REGNUM) + (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,d,Q,BQ") + (match_operand:DI 1 "general_operand" "d,Op,m,BQ,Q")))] + "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT" "@ clgr\t%0,%1 - clg\t%0,%1" - [(set_attr "op_type" "RRE,RXY")]) + clgfi\t%0,%1 + clg\t%0,%1 + # + #" + [(set_attr "op_type" "RRE,RIL,RXY,SS,SS")]) (define_insn "*cmpsi_ccu" - [(set (reg 33) - (compare (match_operand:SI 0 "register_operand" "d,d,d") - (match_operand:SI 1 "general_operand" "d,R,T")))] - "s390_match_ccmode(insn, CCUmode)" - "@ - clr\t%0,%1 - cl\t%0,%1 - cly\t%0,%1" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*cmphi_ccu" - [(set (reg 33) - (compare (match_operand:HI 0 "register_operand" "d,d") - (match_operand:HI 1 "s_imm_operand" "Q,S")))] - "s390_match_ccmode(insn, CCUmode)" - "@ - clm\t%0,3,%1 - clmy\t%0,3,%1" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*cmpqi_ccu" - [(set (reg 33) - (compare (match_operand:QI 0 "register_operand" "d,d") - (match_operand:QI 1 "s_imm_operand" "Q,S")))] - "s390_match_ccmode(insn, CCUmode)" - "@ - clm\t%0,1,%1 - clmy\t%0,1,%1" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*cli" - [(set (reg 33) - (compare (match_operand:QI 0 "memory_operand" "Q,S") - (match_operand:QI 1 "immediate_operand" "n,n")))] + [(set (reg CC_REGNUM) + (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,d,Q,BQ") + (match_operand:SI 1 "general_operand" "d,Os,R,T,BQ,Q")))] "s390_match_ccmode (insn, CCUmode)" "@ - cli\t%0,%b1 - cliy\t%0,%b1" - [(set_attr "op_type" "SI,SIY")]) + clr\t%0,%1 + clfi\t%0,%o1 + cl\t%0,%1 + cly\t%0,%1 + # + #" + [(set_attr "op_type" "RR,RIL,RX,RXY,SS,SS")]) -(define_insn "*cmpdi_ccu_mem" - [(set (reg 33) - (compare (match_operand:DI 0 "s_operand" "Q") - (match_operand:DI 1 "s_imm_operand" "Q")))] - "s390_match_ccmode(insn, CCUmode)" - "clc\t%O0(8,%R0),%1" +(define_insn "*cmphi_ccu" + [(set (reg CC_REGNUM) + (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,BQ") + (match_operand:HI 1 "general_operand" "Q,S,BQ,Q")))] + "s390_match_ccmode (insn, CCUmode) + && !register_operand (operands[1], HImode)" + "@ + clm\t%0,3,%S1 + clmy\t%0,3,%S1 + # + #" + [(set_attr "op_type" "RS,RSY,SS,SS")]) + +(define_insn "*cmpqi_ccu" + [(set (reg CC_REGNUM) + (compare (match_operand:QI 0 "nonimmediate_operand" "d,d,Q,S,Q,BQ") + (match_operand:QI 1 "general_operand" "Q,S,n,n,BQ,Q")))] + "s390_match_ccmode (insn, CCUmode) + && !register_operand (operands[1], QImode)" + "@ + clm\t%0,1,%S1 + clmy\t%0,1,%S1 + cli\t%S0,%b1 + cliy\t%S0,%b1 + # + #" + [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")]) + + +; Block compare (CLC) instruction patterns. + +(define_insn "*clc" + [(set (reg CC_REGNUM) + (compare (match_operand:BLK 0 "memory_operand" "Q") + (match_operand:BLK 1 "memory_operand" "Q"))) + (use (match_operand 2 "const_int_operand" "n"))] + "s390_match_ccmode (insn, CCUmode) + && INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" + "clc\t%O0(%2,%R0),%S1" [(set_attr "op_type" "SS")]) -(define_insn "*cmpsi_ccu_mem" - [(set (reg 33) - (compare (match_operand:SI 0 "s_operand" "Q") - (match_operand:SI 1 "s_imm_operand" "Q")))] - "s390_match_ccmode(insn, CCUmode)" - "clc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (reg CC_REGNUM) + (compare (match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "")))] + "reload_completed + && s390_match_ccmode (insn, CCUmode) + && GET_MODE (operands[0]) == GET_MODE (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" + [(parallel + [(set (match_dup 0) (match_dup 1)) + (use (match_dup 2))])] +{ + operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); + operands[0] = adjust_address (operands[0], BLKmode, 0); + operands[1] = adjust_address (operands[1], BLKmode, 0); -(define_insn "*cmphi_ccu_mem" - [(set (reg 33) - (compare (match_operand:HI 0 "s_operand" "Q") - (match_operand:HI 1 "s_imm_operand" "Q")))] - "s390_match_ccmode(insn, CCUmode)" - "clc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*cmpqi_ccu_mem" - [(set (reg 33) - (compare (match_operand:QI 0 "s_operand" "Q") - (match_operand:QI 1 "s_imm_operand" "Q")))] - "s390_match_ccmode(insn, CCUmode)" - "clc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SS")]) + operands[1] = gen_rtx_COMPARE (GET_MODE (SET_DEST (PATTERN (curr_insn))), + operands[0], operands[1]); + operands[0] = SET_DEST (PATTERN (curr_insn)); +}) -; DF instructions +; (DF|SF) instructions -(define_insn "*cmpdf_ccs_0" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f") - (match_operand:DF 1 "const0_operand" "")))] +; ltxbr, ltdbr, ltebr +(define_insn "*cmp_ccs_0" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f") + (match_operand:FPR 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "ltdbr\t%0,%0" + "ltbr\t%0,%0" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*cmpdf_ccs_0_ibm" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f") - (match_operand:DF 1 "const0_operand" "")))] +; ltxr, ltdr, lter +(define_insn "*cmp_ccs_0_ibm" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f") + (match_operand:FPR 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "ltdr\t%0,%0" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) + "ltr\t%0,%0" + [(set_attr "op_type" "") + (set_attr "type" "fsimp")]) -(define_insn "*cmpdf_ccs" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f,f") - (match_operand:DF 1 "general_operand" "f,R")))] +; cxbr, cdbr, cebr, cxb, cdb, ceb +(define_insn "*cmp_ccs" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f,f") + (match_operand:FPR 1 "general_operand" "f,")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - cdbr\t%0,%1 - cdb\t%0,%1" + cbr\t%0,%1 + cb\t%0,%1" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*cmpdf_ccs_ibm" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f,f") - (match_operand:DF 1 "general_operand" "f,R")))] +; cxr, cdr, cer, cx, cd, ce +(define_insn "*cmp_ccs_ibm" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f,f") + (match_operand:FPR 1 "general_operand" "f,")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - cdr\t%0,%1 - cd\t%0,%1" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd")]) - - -; SF instructions - -(define_insn "*cmpsf_ccs_0" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f") - (match_operand:SF 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "ltebr\t%0,%0" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) - -(define_insn "*cmpsf_ccs_0_ibm" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f") - (match_operand:SF 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lter\t%0,%0" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) - -(define_insn "*cmpsf_ccs" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f,f") - (match_operand:SF 1 "general_operand" "f,R")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - cebr\t%0,%1 - ceb\t%0,%1" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps")]) - -(define_insn "*cmpsf_ccs" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f,f") - (match_operand:SF 1 "general_operand" "f,R")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - cer\t%0,%1 - ce\t%0,%1" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps")]) + cr\t%0,%1 + c\t%0,%1" + [(set_attr "op_type" ",") + (set_attr "type" "fsimp")]) ;; @@ -987,16 +794,16 @@ (define_insn "movti" [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q") - (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))] + (match_operand:TI 1 "general_operand" "QS,d,dPm,d,Q"))] "TARGET_64BIT" "@ - lmg\t%0,%N0,%1 - stmg\t%1,%N1,%0 + lmg\t%0,%N0,%S1 + stmg\t%1,%N1,%S0 # # - mvc\t%O0(16,%R0),%1" - [(set_attr "op_type" "RSY,RSY,NN,NN,SS") - (set_attr "type" "lm,stm,*,*,cs")]) + #" + [(set_attr "op_type" "RSY,RSY,*,*,SS") + (set_attr "type" "lm,stm,*,*,*")]) (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") @@ -1044,9 +851,8 @@ (match_operand:DI 2 "register_operand" "=&a")])] "TARGET_64BIT" { - if (GET_CODE (operands[0]) != MEM) - abort (); - s390_load_address (operands[2], XEXP (operands[0], 0)); + gcc_assert (MEM_P (operands[0])); + s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0))); operands[0] = replace_equiv_address (operands[0], operands[2]); emit_move_insn (operands[0], operands[1]); DONE; @@ -1062,16 +868,12 @@ "" { /* Handle symbolic constants. */ - if (TARGET_64BIT && SYMBOLIC_CONST (operands[1])) + if (TARGET_64BIT + && (SYMBOLIC_CONST (operands[1]) + || (GET_CODE (operands[1]) == PLUS + && XEXP (operands[1], 0) == pic_offset_table_rtx + && SYMBOLIC_CONST (XEXP (operands[1], 1))))) emit_symbolic_move (operands); - - /* During and after reload, we need to force constants - to the literal pool ourselves, if necessary. */ - if ((reload_in_progress || reload_completed) - && CONSTANT_P (operands[1]) - && (!legitimate_reload_constant_p (operands[1]) - || FP_REG_P (operands[0]))) - operands[1] = force_const_mem (DImode, operands[1]); }) (define_insn "*movdi_larl" @@ -1083,12 +885,46 @@ [(set_attr "op_type" "RIL") (set_attr "type" "larl")]) +(define_insn "*movdi_64extimm" + [(set (match_operand:DI 0 "nonimmediate_operand" + "=d,d,d,d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q") + (match_operand:DI 1 "general_operand" + "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))] + "TARGET_64BIT && TARGET_EXTIMM" + "@ + lghi\t%0,%h1 + llihh\t%0,%i1 + llihl\t%0,%i1 + llilh\t%0,%i1 + llill\t%0,%i1 + lgfi\t%0,%1 + llihf\t%0,%k1 + llilf\t%0,%k1 + lay\t%0,%a1 + lgr\t%0,%1 + lg\t%0,%1 + stg\t%1,%0 + ldr\t%0,%1 + ld\t%0,%1 + ldy\t%0,%1 + std\t%1,%0 + stdy\t%1,%0 + # + # + stam\t%1,%N1,%S0 + lam\t%0,%N0,%S1 + #" + [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RXY,RRE,RXY,RXY, + RR,RX,RXY,RX,RXY,*,*,RS,RS,SS") + (set_attr "type" "*,*,*,*,*,*,*,*,la,lr,load,store, + floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")]) + (define_insn "*movdi_64" - [(set (match_operand:DI 0 "nonimmediate_operand" - "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q") - (match_operand:DI 1 "general_operand" - "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))] - "TARGET_64BIT" + [(set (match_operand:DI 0 "nonimmediate_operand" + "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q") + (match_operand:DI 1 "general_operand" + "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))] + "TARGET_64BIT && !TARGET_EXTIMM" "@ lghi\t%0,%h1 llihh\t%0,%i1 @@ -1104,18 +940,58 @@ ldy\t%0,%1 std\t%1,%0 stdy\t%1,%0 - mvc\t%O0(8,%R0),%1" - [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd, - fstored,fstored,cs")]) + # + # + stam\t%1,%N1,%S0 + lam\t%0,%N0,%S1 + #" + [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY, + RR,RX,RXY,RX,RXY,*,*,RS,RS,SS") + (set_attr "type" "*,*,*,*,*,la,lr,load,store, + floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (match_operand:DI 1 "register_operand" ""))] + "TARGET_64BIT && ACCESS_REG_P (operands[1])" + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 32))) + (set (strict_low_part (match_dup 2)) (match_dup 4))] + "operands[2] = gen_lowpart (SImode, operands[0]); + s390_split_access_reg (operands[1], &operands[4], &operands[3]);") + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (match_operand:DI 1 "register_operand" ""))] + "TARGET_64BIT && ACCESS_REG_P (operands[0]) + && dead_or_set_p (insn, operands[1])" + [(set (match_dup 3) (match_dup 2)) + (set (match_dup 1) (lshiftrt:DI (match_dup 1) (const_int 32))) + (set (match_dup 4) (match_dup 2))] + "operands[2] = gen_lowpart (SImode, operands[1]); + s390_split_access_reg (operands[0], &operands[3], &operands[4]);") + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (match_operand:DI 1 "register_operand" ""))] + "TARGET_64BIT && ACCESS_REG_P (operands[0]) + && !dead_or_set_p (insn, operands[1])" + [(set (match_dup 3) (match_dup 2)) + (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32))) + (set (match_dup 4) (match_dup 2)) + (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32)))] + "operands[2] = gen_lowpart (SImode, operands[1]); + s390_split_access_reg (operands[0], &operands[3], &operands[4]);") (define_insn "*movdi_31" - [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q") - (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,Q,S,d,o,!*f,!*f,!*f,!R,!T,Q") + (match_operand:DI 1 "general_operand" "Q,S,d,d,dPm,d,*f,R,T,*f,*f,Q"))] "!TARGET_64BIT" "@ - lm\t%0,%N0,%1 - stm\t%1,%N1,%0 + lm\t%0,%N0,%S1 + lmy\t%0,%N0,%S1 + stm\t%1,%N1,%S0 + stmy\t%1,%N1,%S0 # # ldr\t%0,%1 @@ -1123,9 +999,9 @@ ldy\t%0,%1 std\t%1,%0 stdy\t%1,%0 - mvc\t%O0(8,%R0),%1" - [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")]) + #" + [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,SS") + (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*")]) (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") @@ -1174,9 +1050,8 @@ (match_operand:SI 2 "register_operand" "=&a")])] "!TARGET_64BIT" { - if (GET_CODE (operands[0]) != MEM) - abort (); - s390_load_address (operands[2], XEXP (operands[0], 0)); + gcc_assert (MEM_P (operands[0])); + s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0))); operands[0] = replace_equiv_address (operands[0], operands[2]); emit_move_insn (operands[0], operands[1]); DONE; @@ -1208,10 +1083,9 @@ [(parallel [(set (match_operand:DI 0 "register_operand" "") (match_operand:QI 1 "address_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "TARGET_64BIT - && strict_memory_address_p (VOIDmode, operands[1]) - && preferred_la_operand_p (operands[1])" + && preferred_la_operand_p (operands[1], const0_rtx)" [(set (match_dup 0) (match_dup 1))] "") @@ -1222,11 +1096,10 @@ [(set (match_dup 0) (plus:DI (match_dup 0) (match_operand:DI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "TARGET_64BIT && !reg_overlap_mentioned_p (operands[0], operands[2]) - && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2])) - && preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))" + && preferred_la_operand_p (operands[1], operands[2])" [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] "") @@ -1250,29 +1123,12 @@ "" { /* Handle symbolic constants. */ - if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1])) + if (!TARGET_64BIT + && (SYMBOLIC_CONST (operands[1]) + || (GET_CODE (operands[1]) == PLUS + && XEXP (operands[1], 0) == pic_offset_table_rtx + && SYMBOLIC_CONST (XEXP(operands[1], 1))))) emit_symbolic_move (operands); - - /* expr.c tries to load an effective address using - force_reg. This fails because we don't have a - generic load_address pattern. Convert the move - to a proper arithmetic operation instead, unless - it is guaranteed to be OK. */ - if (GET_CODE (operands[1]) == PLUS - && !legitimate_la_operand_p (operands[1])) - { - operands[1] = force_operand (operands[1], operands[0]); - if (operands[1] == operands[0]) - DONE; - } - - /* During and after reload, we need to force constants - to the literal pool ourselves, if necessary. */ - if ((reload_in_progress || reload_completed) - && CONSTANT_P (operands[1]) - && (!legitimate_reload_constant_p (operands[1]) - || FP_REG_P (operands[0]))) - operands[1] = force_const_mem (SImode, operands[1]); }) (define_insn "*movsi_larl" @@ -1285,15 +1141,16 @@ (set_attr "type" "larl")]) (define_insn "*movsi_zarch" - [(set (match_operand:SI 0 "nonimmediate_operand" - "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q") - (match_operand:SI 1 "general_operand" - "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))] + [(set (match_operand:SI 0 "nonimmediate_operand" + "=d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q") + (match_operand:SI 1 "general_operand" + "K,N0HS0,N1HS0,Os,L,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))] "TARGET_ZARCH" "@ lhi\t%0,%h1 llilh\t%0,%i1 llill\t%0,%i1 + iilf\t%0,%o1 lay\t%0,%a1 lr\t%0,%1 l\t%0,%1 @@ -1305,13 +1162,19 @@ ley\t%0,%1 ste\t%1,%0 stey\t%1,%0 - mvc\t%O0(4,%R0),%1" - [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")]) + ear\t%0,%1 + sar\t%0,%1 + stam\t%1,%1,%S0 + lam\t%0,%0,%S1 + #" + [(set_attr "op_type" "RI,RI,RI,RIL,RXY,RR,RX,RXY,RX,RXY, + RR,RX,RXY,RX,RXY,RRE,RRE,RS,RS,SS") + (set_attr "type" "*,*,*,*,la,lr,load,load,store,store, + floadsf,floadsf,floadsf,fstoresf,fstoresf,*,*,*,*,*")]) (define_insn "*movsi_esa" - [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q") - (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q") + (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q,?Q"))] "!TARGET_ZARCH" "@ lhi\t%0,%h1 @@ -1321,9 +1184,13 @@ ler\t%0,%1 le\t%0,%1 ste\t%1,%0 - mvc\t%O0(4,%R0),%1" - [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS") - (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")]) + ear\t%0,%1 + sar\t%0,%1 + stam\t%1,%1,%S0 + lam\t%0,%0,%S1 + #" + [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS") + (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")]) (define_peephole2 [(set (match_operand:SI 0 "register_operand" "") @@ -1350,10 +1217,9 @@ [(parallel [(set (match_operand:SI 0 "register_operand" "") (match_operand:QI 1 "address_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "!TARGET_64BIT - && strict_memory_address_p (VOIDmode, operands[1]) - && preferred_la_operand_p (operands[1])" + && preferred_la_operand_p (operands[1], const0_rtx)" [(set (match_dup 0) (match_dup 1))] "") @@ -1364,11 +1230,10 @@ [(set (match_dup 0) (plus:SI (match_dup 0) (match_operand:SI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "!TARGET_64BIT && !reg_overlap_mentioned_p (operands[0], operands[2]) - && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2])) - && preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))" + && preferred_la_operand_p (operands[1], operands[2])" [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] "") @@ -1387,7 +1252,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (and:SI (match_operand:QI 1 "address_operand" "p") (const_int 2147483647))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "#" "&& reload_completed" @@ -1427,12 +1292,11 @@ (match_operand:HI 1 "general_operand" ""))] "" { - /* Make it explicit that loading a register from memory + /* Make it explicit that loading a register from memory always sign-extends (at least) to SImode. */ if (optimize && !no_new_pseudos && register_operand (operands[0], VOIDmode) - && GET_CODE (operands[1]) == MEM - && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF) + && GET_CODE (operands[1]) == MEM) { rtx tmp = gen_reg_rtx (SImode); rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]); @@ -1452,9 +1316,9 @@ lhy\t%0,%1 sth\t%1,%0 sthy\t%1,%0 - mvc\t%O0(2,%R0),%1" + #" [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS") - (set_attr "type" "lr,*,*,*,store,store,cs")]) + (set_attr "type" "lr,*,*,*,store,store,*")]) (define_peephole2 [(set (match_operand:HI 0 "register_operand" "") @@ -1479,8 +1343,7 @@ is just as fast as a QImode load. */ if (TARGET_ZARCH && optimize && !no_new_pseudos && register_operand (operands[0], VOIDmode) - && GET_CODE (operands[1]) == MEM - && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF) + && GET_CODE (operands[1]) == MEM) { rtx tmp = gen_reg_rtx (word_mode); rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]); @@ -1500,11 +1363,11 @@ icy\t%0,%1 stc\t%1,%0 stcy\t%1,%0 - mvi\t%0,%b1 - mviy\t%0,%b1 - mvc\t%O0(1,%R0),%1" + mvi\t%S0,%b1 + mviy\t%S0,%b1 + #" [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS") - (set_attr "type" "lr,*,*,*,store,store,store,store,cs")]) + (set_attr "type" "lr,*,*,*,store,store,store,store,*")]) (define_peephole2 [(set (match_operand:QI 0 "nonimmediate_operand" "") @@ -1535,12 +1398,12 @@ (define_insn "*movstricthi" [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d")) - (match_operand:HI 1 "s_imm_operand" "Q,S")) - (clobber (reg:CC 33))] + (match_operand:HI 1 "memory_operand" "Q,S")) + (clobber (reg:CC CC_REGNUM))] "" "@ - icm\t%0,3,%1 - icmy\t%0,3,%1" + icm\t%0,3,%S1 + icmy\t%0,3,%S1" [(set_attr "op_type" "RS,RSY")]) ; @@ -1548,15 +1411,159 @@ ; (define_insn "movstrictsi" - [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d")) - (match_operand:SI 1 "general_operand" "d,R,T"))] + [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d,d")) + (match_operand:SI 1 "general_operand" "d,R,T,t"))] "TARGET_64BIT" "@ lr\t%0,%1 l\t%0,%1 - ly\t%0,%1" - [(set_attr "op_type" "RR,RX,RXY") - (set_attr "type" "lr,load,load")]) + ly\t%0,%1 + ear\t%0,%1" + [(set_attr "op_type" "RR,RX,RXY,RRE") + (set_attr "type" "lr,load,load,*")]) + +; +; movtf instruction pattern(s). +; + +(define_expand "movtf" + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "general_operand" ""))] + "" + "") + +(define_insn "*movtf_64" + [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,f,o,d,QS,d,o,Q") + (match_operand:TF 1 "general_operand" "G,f,o,f,QS,d,dm,d,Q"))] + "TARGET_64BIT" + "@ + lzxr\t%0 + lxr\t%0,%1 + # + # + lmg\t%0,%N0,%S1 + stmg\t%1,%N1,%S0 + # + # + #" + [(set_attr "op_type" "RRE,RRE,*,*,RSY,RSY,*,*,*") + (set_attr "type" "fsimptf,fsimptf,*,*,lm,stm,*,*,*")]) + +(define_insn "*movtf_31" + [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,f,o,Q") + (match_operand:TF 1 "general_operand" "G,f,o,f,Q"))] + "!TARGET_64BIT" + "@ + lzxr\t%0 + lxr\t%0,%1 + # + # + #" + [(set_attr "op_type" "RRE,RRE,*,*,*") + (set_attr "type" "fsimptf,fsimptf,*,*,*")]) + +; TFmode in GPRs splitters + +(define_split + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "general_operand" ""))] + "TARGET_64BIT && reload_completed + && s390_split_ok_p (operands[0], operands[1], TFmode, 0)" + [(set (match_dup 2) (match_dup 4)) + (set (match_dup 3) (match_dup 5))] +{ + operands[2] = operand_subword (operands[0], 0, 0, TFmode); + operands[3] = operand_subword (operands[0], 1, 0, TFmode); + operands[4] = operand_subword (operands[1], 0, 0, TFmode); + operands[5] = operand_subword (operands[1], 1, 0, TFmode); +}) + +(define_split + [(set (match_operand:TF 0 "nonimmediate_operand" "") + (match_operand:TF 1 "general_operand" ""))] + "TARGET_64BIT && reload_completed + && s390_split_ok_p (operands[0], operands[1], TFmode, 1)" + [(set (match_dup 2) (match_dup 4)) + (set (match_dup 3) (match_dup 5))] +{ + operands[2] = operand_subword (operands[0], 1, 0, TFmode); + operands[3] = operand_subword (operands[0], 0, 0, TFmode); + operands[4] = operand_subword (operands[1], 1, 0, TFmode); + operands[5] = operand_subword (operands[1], 0, 0, TFmode); +}) + +(define_split + [(set (match_operand:TF 0 "register_operand" "") + (match_operand:TF 1 "memory_operand" ""))] + "TARGET_64BIT && reload_completed + && !FP_REG_P (operands[0]) + && !s_operand (operands[1], VOIDmode)" + [(set (match_dup 0) (match_dup 1))] +{ + rtx addr = operand_subword (operands[0], 1, 0, DFmode); + s390_load_address (addr, XEXP (operands[1], 0)); + operands[1] = replace_equiv_address (operands[1], addr); +}) + +; TFmode in FPRs splitters + +(define_split + [(set (match_operand:TF 0 "register_operand" "") + (match_operand:TF 1 "memory_operand" ""))] + "reload_completed && offsettable_memref_p (operands[1]) + && FP_REG_P (operands[0])" + [(set (match_dup 2) (match_dup 4)) + (set (match_dup 3) (match_dup 5))] +{ + operands[2] = simplify_gen_subreg (DFmode, operands[0], TFmode, 0); + operands[3] = simplify_gen_subreg (DFmode, operands[0], TFmode, 8); + operands[4] = adjust_address_nv (operands[1], DFmode, 0); + operands[5] = adjust_address_nv (operands[1], DFmode, 8); +}) + +(define_split + [(set (match_operand:TF 0 "memory_operand" "") + (match_operand:TF 1 "register_operand" ""))] + "reload_completed && offsettable_memref_p (operands[0]) + && FP_REG_P (operands[1])" + [(set (match_dup 2) (match_dup 4)) + (set (match_dup 3) (match_dup 5))] +{ + operands[2] = adjust_address_nv (operands[0], DFmode, 0); + operands[3] = adjust_address_nv (operands[0], DFmode, 8); + operands[4] = simplify_gen_subreg (DFmode, operands[1], TFmode, 0); + operands[5] = simplify_gen_subreg (DFmode, operands[1], TFmode, 8); +}) + +(define_expand "reload_outtf" + [(parallel [(match_operand:TF 0 "" "") + (match_operand:TF 1 "register_operand" "f") + (match_operand:SI 2 "register_operand" "=&a")])] + "" +{ + rtx addr = gen_lowpart (Pmode, operands[2]); + + gcc_assert (MEM_P (operands[0])); + s390_load_address (addr, find_replacement (&XEXP (operands[0], 0))); + operands[0] = replace_equiv_address (operands[0], addr); + emit_move_insn (operands[0], operands[1]); + DONE; +}) + +(define_expand "reload_intf" + [(parallel [(match_operand:TF 0 "register_operand" "=f") + (match_operand:TF 1 "" "") + (match_operand:SI 2 "register_operand" "=&a")])] + "" +{ + rtx addr = gen_lowpart (Pmode, operands[2]); + + gcc_assert (MEM_P (operands[1])); + s390_load_address (addr, find_replacement (&XEXP (operands[1], 0))); + operands[1] = replace_equiv_address (operands[1], addr); + emit_move_insn (operands[0], operands[1]); + DONE; +}) ; ; movdf instruction pattern(s). @@ -1566,19 +1573,14 @@ [(set (match_operand:DF 0 "nonimmediate_operand" "") (match_operand:DF 1 "general_operand" ""))] "" -{ - /* During and after reload, we need to force constants - to the literal pool ourselves, if necessary. */ - if ((reload_in_progress || reload_completed) - && CONSTANT_P (operands[1])) - operands[1] = force_const_mem (DFmode, operands[1]); -}) + "") (define_insn "*movdf_64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q") - (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,m,?Q") + (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,d,m,d,?Q"))] "TARGET_64BIT" "@ + lzdr\t%0 ldr\t%0,%1 ld\t%0,%1 ldy\t%0,%1 @@ -1587,27 +1589,31 @@ lgr\t%0,%1 lg\t%0,%1 stg\t%1,%0 - mvc\t%O0(8,%R0),%1" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS") - (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")]) + #" + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS") + (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,fstoredf,fstoredf,lr,load,store,*")]) (define_insn "*movdf_31" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q") - (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,Q,S,d,o,Q") + (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,Q,S,d,d,dPm,d,Q"))] "!TARGET_64BIT" "@ + lzdr\t%0 ldr\t%0,%1 ld\t%0,%1 ldy\t%0,%1 std\t%1,%0 stdy\t%1,%0 - lm\t%0,%N0,%1 - stm\t%1,%N1,%0 + lm\t%0,%N0,%S1 + lmy\t%0,%N0,%S1 + stm\t%1,%N1,%S0 + stmy\t%1,%N1,%S0 # # - mvc\t%O0(8,%R0),%1" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS") - (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")]) + #" + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*,SS") + (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,fstoredf,fstoredf,\ + lm,lm,stm,stm,*,*,*")]) (define_split [(set (match_operand:DF 0 "nonimmediate_operand" "") @@ -1656,9 +1662,8 @@ (match_operand:SI 2 "register_operand" "=&a")])] "!TARGET_64BIT" { - if (GET_CODE (operands[0]) != MEM) - abort (); - s390_load_address (operands[2], XEXP (operands[0], 0)); + gcc_assert (MEM_P (operands[0])); + s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0))); operands[0] = replace_equiv_address (operands[0], operands[2]); emit_move_insn (operands[0], operands[1]); DONE; @@ -1668,23 +1673,12 @@ ; movsf instruction pattern(s). ; -(define_expand "movsf" - [(set (match_operand:SF 0 "nonimmediate_operand" "") - (match_operand:SF 1 "general_operand" ""))] - "" -{ - /* During and after reload, we need to force constants - to the literal pool ourselves, if necessary. */ - if ((reload_in_progress || reload_completed) - && CONSTANT_P (operands[1])) - operands[1] = force_const_mem (SFmode, operands[1]); -}) - -(define_insn "*movsf" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q") - (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))] +(define_insn "movsf" + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,d,R,T,?Q") + (match_operand:SF 1 "general_operand" "G,f,R,T,f,f,d,R,T,d,d,?Q"))] "" "@ + lzer\t%0 ler\t%0,%1 le\t%0,%1 ley\t%0,%1 @@ -1695,9 +1689,78 @@ ly\t%0,%1 st\t%1,%0 sty\t%1,%0 - mvc\t%O0(4,%R0),%1" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")]) + #" + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") + (set_attr "type" "fsimpsf,floadsf,floadsf,floadsf,fstoresf,fstoresf, + lr,load,load,store,store,*")]) + +; +; movcc instruction pattern +; + +(define_insn "movcc" + [(set (match_operand:CC 0 "nonimmediate_operand" "=d,c,d,d,d,R,T") + (match_operand:CC 1 "nonimmediate_operand" "d,d,c,R,T,d,d"))] + "" + "@ + lr\t%0,%1 + tmh\t%1,12288 + ipm\t%0 + st\t%0,%1 + sty\t%0,%1 + l\t%1,%0 + ly\t%1,%0" + [(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY") + (set_attr "type" "lr,*,*,store,store,load,load")]) + +; +; Block move (MVC) patterns. +; + +(define_insn "*mvc" + [(set (match_operand:BLK 0 "memory_operand" "=Q") + (match_operand:BLK 1 "memory_operand" "Q")) + (use (match_operand 2 "const_int_operand" "n"))] + "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" + "mvc\t%O0(%2,%R0),%S1" + [(set_attr "op_type" "SS")]) + +(define_split + [(set (match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" ""))] + "reload_completed + && GET_MODE (operands[0]) == GET_MODE (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" + [(parallel + [(set (match_dup 0) (match_dup 1)) + (use (match_dup 2))])] +{ + operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); + operands[0] = adjust_address (operands[0], BLKmode, 0); + operands[1] = adjust_address (operands[1], BLKmode, 0); +}) + +(define_peephole2 + [(parallel + [(set (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" "")) + (use (match_operand 2 "const_int_operand" ""))]) + (parallel + [(set (match_operand:BLK 3 "memory_operand" "") + (match_operand:BLK 4 "memory_operand" "")) + (use (match_operand 5 "const_int_operand" ""))])] + "s390_offset_p (operands[0], operands[3], operands[2]) + && s390_offset_p (operands[1], operands[4], operands[2]) + && !s390_overlap_p (operands[0], operands[1], + INTVAL (operands[2]) + INTVAL (operands[5])) + && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" + [(parallel + [(set (match_dup 6) (match_dup 7)) + (use (match_dup 8))])] + "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); + operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); + operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") + ; ; load_multiple pattern(s). @@ -1751,9 +1814,6 @@ } else FAIL; - - if (from == frame_pointer_rtx || from == arg_pointer_rtx) - FAIL; } else { @@ -1776,7 +1836,7 @@ { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1); - return "lmg\t%1,%0,%2"; + return "lmg\t%1,%0,%S2"; } [(set_attr "op_type" "RSY") (set_attr "type" "lm")]) @@ -1789,7 +1849,7 @@ { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1); - return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2"; + return which_alternative == 0 ? "lm\t%1,%0,%S2" : "lmy\t%1,%0,%S2"; } [(set_attr "op_type" "RS,RSY") (set_attr "type" "lm")]) @@ -1844,9 +1904,6 @@ } else FAIL; - - if (to == frame_pointer_rtx || to == arg_pointer_rtx) - FAIL; } else { @@ -1870,7 +1927,7 @@ { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1); - return "stmg\t%2,%0,%1"; + return "stmg\t%2,%0,%S1"; } [(set_attr "op_type" "RSY") (set_attr "type" "stm")]) @@ -1884,7 +1941,7 @@ { int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1); - return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1"; + return which_alternative == 0 ? "stm\t%2,%0,%S1" : "stmy\t%2,%0,%S1"; } [(set_attr "op_type" "RS,RSY") (set_attr "type" "stm")]) @@ -1893,144 +1950,225 @@ ;; String instructions. ;; +(define_insn "*execute" + [(match_parallel 0 "" + [(unspec [(match_operand 1 "register_operand" "a") + (match_operand:BLK 2 "memory_operand" "R") + (match_operand 3 "" "")] UNSPEC_EXECUTE)])] + "GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT + && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD" + "ex\t%1,%2" + [(set_attr "op_type" "RX") + (set_attr "type" "cs")]) + + ; ; strlenM instruction pattern(s). ; -(define_expand "strlendi" - [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) - (parallel - [(set (match_dup 4) - (unspec:DI [(const_int 0) - (match_operand:BLK 1 "memory_operand" "") - (reg:QI 0) - (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (scratch:DI)) - (clobber (reg:CC 33))]) +(define_expand "strlen" + [(set (reg:SI 0) (match_operand:SI 2 "immediate_operand" "")) (parallel - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))])] - "TARGET_64BIT" + [(set (match_dup 4) + (unspec:P [(const_int 0) + (match_operand:BLK 1 "memory_operand" "") + (reg:SI 0) + (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) + (clobber (scratch:P)) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_operand:P 0 "register_operand" "") + (minus:P (match_dup 4) (match_dup 5))) + (clobber (reg:CC CC_REGNUM))])] + "" { - operands[4] = gen_reg_rtx (DImode); - operands[5] = gen_reg_rtx (DImode); + operands[4] = gen_reg_rtx (Pmode); + operands[5] = gen_reg_rtx (Pmode); emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); operands[1] = replace_equiv_address (operands[1], operands[5]); }) -(define_insn "*strlendi" - [(set (match_operand:DI 0 "register_operand" "=a") - (unspec:DI [(match_operand:DI 2 "general_operand" "0") - (mem:BLK (match_operand:DI 3 "register_operand" "1")) - (reg:QI 0) +(define_insn "*strlen" + [(set (match_operand:P 0 "register_operand" "=a") + (unspec:P [(match_operand:P 2 "general_operand" "0") + (mem:BLK (match_operand:P 3 "register_operand" "1")) + (reg:SI 0) (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (match_scratch:DI 1 "=a")) - (clobber (reg:CC 33))] - "TARGET_64BIT" + (clobber (match_scratch:P 1 "=a")) + (clobber (reg:CC CC_REGNUM))] + "" "srst\t%0,%1\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) + [(set_attr "length" "8") + (set_attr "type" "vs")]) -(define_expand "strlensi" - [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) - (parallel - [(set (match_dup 4) - (unspec:SI [(const_int 0) - (match_operand:BLK 1 "memory_operand" "") - (reg:QI 0) - (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (scratch:SI)) - (clobber (reg:CC 33))]) +; +; cmpstrM instruction pattern(s). +; + +(define_expand "cmpstrsi" + [(set (reg:SI 0) (const_int 0)) (parallel - [(set (match_operand:SI 0 "register_operand" "") - (minus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))])] - "!TARGET_64BIT" + [(clobber (match_operand 3 "" "")) + (clobber (match_dup 4)) + (set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 1 "memory_operand" "") + (match_operand:BLK 2 "memory_operand" ""))) + (use (reg:SI 0))]) + (parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(reg:CCU CC_REGNUM)] UNSPEC_CMPINT)) + (clobber (reg:CC CC_REGNUM))])] + "" { - operands[4] = gen_reg_rtx (SImode); - operands[5] = gen_reg_rtx (SImode); - emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); - operands[1] = replace_equiv_address (operands[1], operands[5]); + /* As the result of CMPINT is inverted compared to what we need, + we have to swap the operands. */ + rtx op1 = operands[2]; + rtx op2 = operands[1]; + rtx addr1 = gen_reg_rtx (Pmode); + rtx addr2 = gen_reg_rtx (Pmode); + + emit_move_insn (addr1, force_operand (XEXP (op1, 0), NULL_RTX)); + emit_move_insn (addr2, force_operand (XEXP (op2, 0), NULL_RTX)); + operands[1] = replace_equiv_address_nv (op1, addr1); + operands[2] = replace_equiv_address_nv (op2, addr2); + operands[3] = addr1; + operands[4] = addr2; }) -(define_insn "*strlensi" - [(set (match_operand:SI 0 "register_operand" "=a") - (unspec:SI [(match_operand:SI 2 "general_operand" "0") - (mem:BLK (match_operand:SI 3 "register_operand" "1")) - (reg:QI 0) - (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (match_scratch:SI 1 "=a")) - (clobber (reg:CC 33))] - "!TARGET_64BIT" - "srst\t%0,%1\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - +(define_insn "*cmpstr" + [(clobber (match_operand:P 0 "register_operand" "=d")) + (clobber (match_operand:P 1 "register_operand" "=d")) + (set (reg:CCU CC_REGNUM) + (compare:CCU (mem:BLK (match_operand:P 2 "register_operand" "0")) + (mem:BLK (match_operand:P 3 "register_operand" "1")))) + (use (reg:SI 0))] + "" + "clst\t%0,%1\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) + ; -; movstrM instruction pattern(s). +; movstr instruction pattern. ; -(define_expand "movstrdi" - [(set (match_operand:BLK 0 "memory_operand" "") - (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:DI 2 "general_operand" "")) - (match_operand 3 "" "")] - "TARGET_64BIT" - "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;") +(define_expand "movstr" + [(set (reg:SI 0) (const_int 0)) + (parallel + [(clobber (match_dup 3)) + (set (match_operand:BLK 1 "memory_operand" "") + (match_operand:BLK 2 "memory_operand" "")) + (set (match_operand 0 "register_operand" "") + (unspec [(match_dup 1) + (match_dup 2) + (reg:SI 0)] UNSPEC_MVST)) + (clobber (reg:CC CC_REGNUM))])] + "" +{ + rtx addr1 = gen_reg_rtx (Pmode); + rtx addr2 = gen_reg_rtx (Pmode); -(define_expand "movstrsi" + emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX)); + emit_move_insn (addr2, force_operand (XEXP (operands[2], 0), NULL_RTX)); + operands[1] = replace_equiv_address_nv (operands[1], addr1); + operands[2] = replace_equiv_address_nv (operands[2], addr2); + operands[3] = addr2; +}) + +(define_insn "*movstr" + [(clobber (match_operand:P 2 "register_operand" "=d")) + (set (mem:BLK (match_operand:P 1 "register_operand" "0")) + (mem:BLK (match_operand:P 3 "register_operand" "2"))) + (set (match_operand:P 0 "register_operand" "=d") + (unspec [(mem:BLK (match_dup 1)) + (mem:BLK (match_dup 3)) + (reg:SI 0)] UNSPEC_MVST)) + (clobber (reg:CC CC_REGNUM))] + "" + "mvst\t%1,%2\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) + + +; +; movmemM instruction pattern(s). +; + +(define_expand "movmem" [(set (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:SI 2 "general_operand" "")) + (use (match_operand:GPR 2 "general_operand" "")) (match_operand 3 "" "")] "" - "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;") + "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;") ; Move a block that is up to 256 bytes in length. ; The block length is taken as (operands[2] % 256) + 1. -(define_expand "movstr_short" +(define_expand "movmem_short" [(parallel [(set (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" "")) (use (match_operand 2 "nonmemory_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) (clobber (match_dup 3))])] "" "operands[3] = gen_rtx_SCRATCH (Pmode);") -(define_insn "*movstr_short" - [(set (match_operand:BLK 0 "memory_operand" "=Q,Q") - (match_operand:BLK 1 "memory_operand" "Q,Q")) - (use (match_operand 2 "nonmemory_operand" "n,a")) - (clobber (match_scratch 3 "=X,&a"))] +(define_insn "*movmem_short" + [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q") + (match_operand:BLK 1 "memory_operand" "Q,Q,Q")) + (use (match_operand 2 "nonmemory_operand" "n,a,a")) + (use (match_operand 3 "immediate_operand" "X,R,X")) + (clobber (match_scratch 4 "=X,X,&a"))] "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode) - && GET_MODE (operands[3]) == Pmode" -{ - switch (which_alternative) - { - case 0: - return "mvc\t%O0(%b2+1,%R0),%1"; + && GET_MODE (operands[4]) == Pmode" + "#" + [(set_attr "type" "cs")]) - case 1: - output_asm_insn ("bras\t%3,.+10", operands); - output_asm_insn ("mvc\t%O0(1,%R0),%1", operands); - return "ex\t%2,0(%3)"; +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" "")) + (use (match_operand 2 "const_int_operand" "")) + (use (match_operand 3 "immediate_operand" "")) + (clobber (scratch))] + "reload_completed" + [(parallel + [(set (match_dup 0) (match_dup 1)) + (use (match_dup 2))])] + "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);") - default: - abort (); - } -} - [(set_attr "op_type" "SS,NN") - (set_attr "type" "cs,cs") - (set_attr "atype" "*,agen") - (set_attr "length" "*,14")]) +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" "")) + (use (match_operand 2 "register_operand" "")) + (use (match_operand 3 "memory_operand" "")) + (clobber (scratch))] + "reload_completed" + [(parallel + [(unspec [(match_dup 2) (match_dup 3) + (const_int 0)] UNSPEC_EXECUTE) + (set (match_dup 0) (match_dup 1)) + (use (const_int 1))])] + "") + +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" "")) + (use (match_operand 2 "register_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) + (clobber (match_operand 3 "register_operand" ""))] + "reload_completed && TARGET_CPU_ZARCH" + [(set (match_dup 3) (label_ref (match_dup 4))) + (parallel + [(unspec [(match_dup 2) (mem:BLK (match_dup 3)) + (label_ref (match_dup 4))] UNSPEC_EXECUTE) + (set (match_dup 0) (match_dup 1)) + (use (const_int 1))])] + "operands[4] = gen_label_rtx ();") ; Move a block of arbitrary length. -(define_expand "movstr_long" +(define_expand "movmem_long" [(parallel [(clobber (match_dup 2)) (clobber (match_dup 3)) @@ -2038,7 +2176,7 @@ (match_operand:BLK 1 "memory_operand" "")) (use (match_operand 2 "general_operand" "")) (use (match_dup 3)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" { enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; @@ -2063,105 +2201,114 @@ operands[3] = reg1; }) -(define_insn "*movstr_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (clobber (match_operand:TI 1 "register_operand" "=d")) - (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))) +(define_insn "*movmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (clobber (match_operand: 1 "register_operand" "=d")) + (set (mem:BLK (subreg:P (match_operand: 2 "register_operand" "0") 0)) + (mem:BLK (subreg:P (match_operand: 3 "register_operand" "1") 0))) (use (match_dup 2)) (use (match_dup 3)) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - -(define_insn "*movstr_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (clobber (match_operand:DI 1 "register_operand" "=d")) - (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (reg:CC 33))] - "!TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - -; -; clrstrM instruction pattern(s). -; - -(define_expand "clrstrdi" - [(set (match_operand:BLK 0 "memory_operand" "") - (const_int 0)) - (use (match_operand:DI 1 "general_operand" "")) - (match_operand 2 "" "")] - "TARGET_64BIT" - "s390_expand_clrstr (operands[0], operands[1]); DONE;") - -(define_expand "clrstrsi" - [(set (match_operand:BLK 0 "memory_operand" "") - (const_int 0)) - (use (match_operand:SI 1 "general_operand" "")) - (match_operand 2 "" "")] + (clobber (reg:CC CC_REGNUM))] "" - "s390_expand_clrstr (operands[0], operands[1]); DONE;") + "mvcle\t%0,%1,0\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) + +; +; setmemM instruction pattern(s). +; + +(define_expand "setmem" + [(set (match_operand:BLK 0 "memory_operand" "") + (match_operand:QI 2 "general_operand" "")) + (use (match_operand:GPR 1 "general_operand" "")) + (match_operand 3 "" "")] + "" + "s390_expand_setmem (operands[0], operands[1], operands[2]); DONE;") ; Clear a block that is up to 256 bytes in length. ; The block length is taken as (operands[1] % 256) + 1. -(define_expand "clrstr_short" +(define_expand "clrmem_short" [(parallel [(set (match_operand:BLK 0 "memory_operand" "") (const_int 0)) (use (match_operand 1 "nonmemory_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) (clobber (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" "operands[2] = gen_rtx_SCRATCH (Pmode);") -(define_insn "*clrstr_short" - [(set (match_operand:BLK 0 "memory_operand" "=Q,Q") +(define_insn "*clrmem_short" + [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q") (const_int 0)) - (use (match_operand 1 "nonmemory_operand" "n,a")) - (clobber (match_scratch 2 "=X,&a")) - (clobber (reg:CC 33))] + (use (match_operand 1 "nonmemory_operand" "n,a,a")) + (use (match_operand 2 "immediate_operand" "X,R,X")) + (clobber (match_scratch 3 "=X,X,&a")) + (clobber (reg:CC CC_REGNUM))] "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode) - && GET_MODE (operands[2]) == Pmode" -{ - switch (which_alternative) - { - case 0: - return "xc\t%O0(%b1+1,%R0),%0"; + && GET_MODE (operands[3]) == Pmode" + "#" + [(set_attr "type" "cs")]) - case 1: - output_asm_insn ("bras\t%2,.+10", operands); - output_asm_insn ("xc\t%O0(1,%R0),%0", operands); - return "ex\t%1,0(%2)"; +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (const_int 0)) + (use (match_operand 1 "const_int_operand" "")) + (use (match_operand 2 "immediate_operand" "")) + (clobber (scratch)) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (const_int 0)) + (use (match_dup 1)) + (clobber (reg:CC CC_REGNUM))])] + "operands[1] = GEN_INT ((INTVAL (operands[1]) & 0xff) + 1);") - default: - abort (); - } -} - [(set_attr "op_type" "SS,NN") - (set_attr "type" "cs,cs") - (set_attr "atype" "*,agen") - (set_attr "length" "*,14")]) +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (const_int 0)) + (use (match_operand 1 "register_operand" "")) + (use (match_operand 2 "memory_operand" "")) + (clobber (scratch)) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(unspec [(match_dup 1) (match_dup 2) + (const_int 0)] UNSPEC_EXECUTE) + (set (match_dup 0) (const_int 0)) + (use (const_int 1)) + (clobber (reg:CC CC_REGNUM))])] + "") -; Clear a block of arbitrary length. +(define_split + [(set (match_operand:BLK 0 "memory_operand" "") + (const_int 0)) + (use (match_operand 1 "register_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) + (clobber (match_operand 2 "register_operand" "")) + (clobber (reg:CC CC_REGNUM))] + "reload_completed && TARGET_CPU_ZARCH" + [(set (match_dup 2) (label_ref (match_dup 3))) + (parallel + [(unspec [(match_dup 1) (mem:BLK (match_dup 2)) + (label_ref (match_dup 3))] UNSPEC_EXECUTE) + (set (match_dup 0) (const_int 0)) + (use (const_int 1)) + (clobber (reg:CC CC_REGNUM))])] + "operands[3] = gen_label_rtx ();") -(define_expand "clrstr_long" +; Initialize a block of arbitrary length with (operands[2] % 256). + +(define_expand "setmem_long" [(parallel [(clobber (match_dup 1)) (set (match_operand:BLK 0 "memory_operand" "") - (const_int 0)) + (match_operand 2 "shift_count_or_setmem_operand" "")) (use (match_operand 1 "general_operand" "")) - (use (match_dup 2)) - (clobber (reg:CC 33))])] + (use (match_dup 3)) + (clobber (reg:CC CC_REGNUM))])] "" { enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; @@ -2178,49 +2325,37 @@ operands[0] = replace_equiv_address_nv (operands[0], addr0); operands[1] = reg0; - operands[2] = reg1; + operands[3] = reg1; }) -(define_insn "*clrstr_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (const_int 0)) - (use (match_dup 2)) - (use (match_operand:TI 1 "register_operand" "d")) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - -(define_insn "*clrstr_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) - (const_int 0)) - (use (match_dup 2)) - (use (match_operand:DI 1 "register_operand" "d")) - (clobber (reg:CC 33))] - "!TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) +(define_insn "*setmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (set (mem:BLK (subreg:P (match_operand: 3 "register_operand" "0") 0)) + (match_operand 2 "shift_count_or_setmem_operand" "Y")) + (use (match_dup 3)) + (use (match_operand: 1 "register_operand" "d")) + (clobber (reg:CC CC_REGNUM))] + "" + "mvcle\t%0,%1,%Y2\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) +(define_insn "*setmem_long_and" + [(clobber (match_operand: 0 "register_operand" "=d")) + (set (mem:BLK (subreg:P (match_operand: 3 "register_operand" "0") 0)) + (and (match_operand 2 "shift_count_or_setmem_operand" "Y") + (match_operand 4 "const_int_operand" "n"))) + (use (match_dup 3)) + (use (match_operand: 1 "register_operand" "d")) + (clobber (reg:CC CC_REGNUM))] + "(INTVAL (operands[4]) & 255) == 255" + "mvcle\t%0,%1,%Y2\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) ; ; cmpmemM instruction pattern(s). ; -(define_expand "cmpmemdi" - [(set (match_operand:DI 0 "register_operand" "") - (compare:DI (match_operand:BLK 1 "memory_operand" "") - (match_operand:BLK 2 "memory_operand" "") ) ) - (use (match_operand:DI 3 "general_operand" "")) - (use (match_operand:DI 4 "" ""))] - "TARGET_64BIT" - "s390_expand_cmpmem (operands[0], operands[1], - operands[2], operands[3]); DONE;") - (define_expand "cmpmemsi" [(set (match_operand:SI 0 "register_operand" "") (compare:SI (match_operand:BLK 1 "memory_operand" "") @@ -2236,41 +2371,70 @@ (define_expand "cmpmem_short" [(parallel - [(set (reg:CCS 33) - (compare:CCS (match_operand:BLK 0 "memory_operand" "") + [(set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "nonmemory_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) (clobber (match_dup 3))])] "" "operands[3] = gen_rtx_SCRATCH (Pmode);") (define_insn "*cmpmem_short" - [(set (reg:CCS 33) - (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q") - (match_operand:BLK 1 "memory_operand" "Q,Q"))) - (use (match_operand 2 "nonmemory_operand" "n,a")) - (clobber (match_scratch 3 "=X,&a"))] + [(set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q") + (match_operand:BLK 1 "memory_operand" "Q,Q,Q"))) + (use (match_operand 2 "nonmemory_operand" "n,a,a")) + (use (match_operand 3 "immediate_operand" "X,R,X")) + (clobber (match_scratch 4 "=X,X,&a"))] "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode) - && GET_MODE (operands[3]) == Pmode" -{ - switch (which_alternative) - { - case 0: - return "clc\t%O0(%b2+1,%R0),%1"; + && GET_MODE (operands[4]) == Pmode" + "#" + [(set_attr "type" "cs")]) - case 1: - output_asm_insn ("bras\t%3,.+10", operands); - output_asm_insn ("clc\t%O0(1,%R0),%1", operands); - return "ex\t%2,0(%3)"; +(define_split + [(set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "const_int_operand" "")) + (use (match_operand 3 "immediate_operand" "")) + (clobber (scratch))] + "reload_completed" + [(parallel + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) + (use (match_dup 2))])] + "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);") - default: - abort (); - } -} - [(set_attr "op_type" "SS,NN") - (set_attr "type" "cs,cs") - (set_attr "atype" "*,agen") - (set_attr "length" "*,14")]) +(define_split + [(set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "register_operand" "")) + (use (match_operand 3 "memory_operand" "")) + (clobber (scratch))] + "reload_completed" + [(parallel + [(unspec [(match_dup 2) (match_dup 3) + (const_int 0)] UNSPEC_EXECUTE) + (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) + (use (const_int 1))])] + "") + +(define_split + [(set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "") + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "register_operand" "")) + (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) + (clobber (match_operand 3 "register_operand" ""))] + "reload_completed && TARGET_CPU_ZARCH" + [(set (match_dup 3) (label_ref (match_dup 4))) + (parallel + [(unspec [(match_dup 2) (mem:BLK (match_dup 3)) + (label_ref (match_dup 4))] UNSPEC_EXECUTE) + (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) + (use (const_int 1))])] + "operands[4] = gen_label_rtx ();") ; Compare a block of arbitrary length. @@ -2278,8 +2442,8 @@ [(parallel [(clobber (match_dup 2)) (clobber (match_dup 3)) - (set (reg:CCS 33) - (compare:CCS (match_operand:BLK 0 "memory_operand" "") + (set (reg:CCU CC_REGNUM) + (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "general_operand" "")) (use (match_dup 3))])] @@ -2307,148 +2471,268 @@ operands[3] = reg1; }) -(define_insn "*cmpmem_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (clobber (match_operand:TI 1 "register_operand" "=d")) - (set (reg:CCS 33) - (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))) +(define_insn "*cmpmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (clobber (match_operand: 1 "register_operand" "=d")) + (set (reg:CCU CC_REGNUM) + (compare:CCU (mem:BLK (subreg:P (match_operand: 2 "register_operand" "0") 0)) + (mem:BLK (subreg:P (match_operand: 3 "register_operand" "1") 0)))) (use (match_dup 2)) (use (match_dup 3))] - "TARGET_64BIT" - "clcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - -(define_insn "*cmpmem_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (clobber (match_operand:DI 1 "register_operand" "=d")) - (set (reg:CCS 33) - (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))) - (use (match_dup 2)) - (use (match_dup 3))] - "!TARGET_64BIT" - "clcle\t%0,%1,0\;jo\t.-4" - [(set_attr "op_type" "NN") - (set_attr "type" "vs") - (set_attr "length" "8")]) - -; Convert condition code to integer in range (-1, 0, 1) - -(define_insn "cmpint_si" - [(set (match_operand:SI 0 "register_operand" "=d") - (compare:SI (reg:CCS 33) (const_int 0)))] "" -{ - output_asm_insn ("lhi\t%0,1", operands); - output_asm_insn ("jh\t.+12", operands); - output_asm_insn ("jl\t.+6", operands); - output_asm_insn ("sr\t%0,%0", operands); - return "lcr\t%0,%0"; -} - [(set_attr "op_type" "NN") - (set_attr "length" "16") - (set_attr "type" "other")]) + "clcle\t%0,%1,0\;jo\t.-4" + [(set_attr "length" "8") + (set_attr "type" "vs")]) -(define_insn "cmpint_di" - [(set (match_operand:DI 0 "register_operand" "=d") - (compare:DI (reg:CCS 33) (const_int 0)))] - "TARGET_64BIT" +; Convert CCUmode condition code to integer. +; Result is zero if EQ, positive if LTU, negative if GTU. + +(define_insn_and_split "cmpint" + [(set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] + UNSPEC_CMPINT)) + (clobber (reg:CC CC_REGNUM))] + "" + "#" + "reload_completed" + [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2))) + (parallel + [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30))) + (clobber (reg:CC CC_REGNUM))])]) + +(define_insn_and_split "*cmpint_cc" + [(set (reg CC_REGNUM) + (compare (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] + UNSPEC_CMPINT) + (const_int 0))) + (set (match_operand:SI 0 "register_operand" "=d") + (unspec:SI [(match_dup 1)] UNSPEC_CMPINT))] + "s390_match_ccmode (insn, CCSmode)" + "#" + "&& reload_completed" + [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2))) + (parallel + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30)))])] { - output_asm_insn ("lghi\t%0,1", operands); - output_asm_insn ("jh\t.+16", operands); - output_asm_insn ("jl\t.+8", operands); - output_asm_insn ("sgr\t%0,%0", operands); - return "lcgr\t%0,%0"; -} - [(set_attr "op_type" "NN") - (set_attr "length" "20") - (set_attr "type" "other")]) + rtx result = gen_rtx_ASHIFTRT (SImode, operands[0], GEN_INT (30)); + operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0)); + operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx); +}) + +(define_insn_and_split "*cmpint_sign" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] + UNSPEC_CMPINT))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT" + "#" + "&& reload_completed" + [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) + (parallel + [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62))) + (clobber (reg:CC CC_REGNUM))])]) + +(define_insn_and_split "*cmpint_sign_cc" + [(set (reg CC_REGNUM) + (compare (ashiftrt:DI (ashift:DI (subreg:DI + (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] + UNSPEC_CMPINT) 0) + (const_int 32)) (const_int 32)) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI (unspec:SI [(match_dup 1)] UNSPEC_CMPINT)))] + "s390_match_ccmode (insn, CCSmode) && TARGET_64BIT" + "#" + "&& reload_completed" + [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) + (parallel + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62)))])] +{ + rtx result = gen_rtx_ASHIFTRT (DImode, operands[0], GEN_INT (62)); + operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0)); + operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx); +}) ;; ;;- Conversion instructions. ;; -(define_insn "*sethighqisi" +(define_insn "*sethighpartsi" [(set (match_operand:SI 0 "register_operand" "=d,d") - (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (unspec:SI [(match_operand:BLK 1 "s_operand" "Q,S") + (match_operand 2 "const_int_operand" "n,n")] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))] "" "@ - icm\t%0,8,%1 - icmy\t%0,8,%1" + icm\t%0,%2,%S1 + icmy\t%0,%2,%S1" [(set_attr "op_type" "RS,RSY")]) -(define_insn "*sethighhisi" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] - "" - "@ - icm\t%0,12,%1 - icmy\t%0,12,%1" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*sethighqidi_64" +(define_insn "*sethighpartdi_64" [(set (match_operand:DI 0 "register_operand" "=d") - (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (unspec:DI [(match_operand:BLK 1 "s_operand" "QS") + (match_operand 2 "const_int_operand" "n")] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" - "icmh\t%0,8,%1" + "icmh\t%0,%2,%S1" [(set_attr "op_type" "RSY")]) -(define_insn "*sethighqidi_31" +(define_insn "*sethighpartdi_31" [(set (match_operand:DI 0 "register_operand" "=d,d") - (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (unspec:DI [(match_operand:BLK 1 "s_operand" "Q,S") + (match_operand 2 "const_int_operand" "n,n")] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "@ - icm\t%0,8,%1 - icmy\t%0,8,%1" + icm\t%0,%2,%S1 + icmy\t%0,%2,%S1" [(set_attr "op_type" "RS,RSY")]) -(define_insn_and_split "*extractqi" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extract:SI (match_operand:QI 1 "s_operand" "Q") - (match_operand 2 "const_int_operand" "n") - (const_int 0))) - (clobber (reg:CC 33))] - "!TARGET_64BIT - && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8" +(define_insn_and_split "*extzv" + [(set (match_operand:GPR 0 "register_operand" "=d") + (zero_extract:GPR (match_operand:QI 1 "s_operand" "QS") + (match_operand 2 "const_int_operand" "n") + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[2]) > 0 + && INTVAL (operands[2]) <= GET_MODE_BITSIZE (SImode)" "#" "&& reload_completed" [(parallel - [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) - (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))] + [(set (match_dup 0) (unspec:GPR [(match_dup 1) (match_dup 3)] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))]) + (set (match_dup 0) (lshiftrt:GPR (match_dup 0) (match_dup 2)))] { - operands[2] = GEN_INT (32 - INTVAL (operands[2])); - operands[1] = change_address (operands[1], QImode, 0); -} - [(set_attr "atype" "agen")]) + int bitsize = INTVAL (operands[2]); + int size = (bitsize - 1) / BITS_PER_UNIT + 1; /* round up */ + int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size); -(define_insn_and_split "*extracthi" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extract:SI (match_operand:QI 1 "s_operand" "Q") - (match_operand 2 "const_int_operand" "n") - (const_int 0))) - (clobber (reg:CC 33))] - "!TARGET_64BIT - && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16" + operands[1] = adjust_address (operands[1], BLKmode, 0); + set_mem_size (operands[1], GEN_INT (size)); + operands[2] = GEN_INT (GET_MODE_BITSIZE (mode) - bitsize); + operands[3] = GEN_INT (mask); +}) + +(define_insn_and_split "*extv" + [(set (match_operand:GPR 0 "register_operand" "=d") + (sign_extract:GPR (match_operand:QI 1 "s_operand" "QS") + (match_operand 2 "const_int_operand" "n") + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[2]) > 0 + && INTVAL (operands[2]) <= GET_MODE_BITSIZE (SImode)" "#" "&& reload_completed" [(parallel - [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) - (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))] + [(set (match_dup 0) (unspec:GPR [(match_dup 1) (match_dup 3)] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_dup 0) (ashiftrt:GPR (match_dup 0) (match_dup 2))) + (clobber (reg:CC CC_REGNUM))])] { - operands[2] = GEN_INT (32 - INTVAL (operands[2])); - operands[1] = change_address (operands[1], HImode, 0); + int bitsize = INTVAL (operands[2]); + int size = (bitsize - 1) / BITS_PER_UNIT + 1; /* round up */ + int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size); + + operands[1] = adjust_address (operands[1], BLKmode, 0); + set_mem_size (operands[1], GEN_INT (size)); + operands[2] = GEN_INT (GET_MODE_BITSIZE (mode) - bitsize); + operands[3] = GEN_INT (mask); +}) + +; +; insv instruction patterns +; + +(define_expand "insv" + [(set (zero_extract (match_operand 0 "nonimmediate_operand" "") + (match_operand 1 "const_int_operand" "") + (match_operand 2 "const_int_operand" "")) + (match_operand 3 "general_operand" ""))] + "" +{ + if (s390_expand_insv (operands[0], operands[1], operands[2], operands[3])) + DONE; + FAIL; +}) + +(define_insn "*insv_mem_reg" + [(set (zero_extract:P (match_operand:QI 0 "memory_operand" "+Q,S") + (match_operand 1 "const_int_operand" "n,n") + (const_int 0)) + (match_operand:P 2 "register_operand" "d,d"))] + "INTVAL (operands[1]) > 0 + && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) + && INTVAL (operands[1]) % BITS_PER_UNIT == 0" +{ + int size = INTVAL (operands[1]) / BITS_PER_UNIT; + + operands[1] = GEN_INT ((1ul << size) - 1); + return (which_alternative == 0) ? "stcm\t%2,%1,%S0" + : "stcmy\t%2,%1,%S0"; } - [(set_attr "atype" "agen")]) + [(set_attr "op_type" "RS,RSY")]) + +(define_insn "*insvdi_mem_reghigh" + [(set (zero_extract:DI (match_operand:QI 0 "memory_operand" "+QS") + (match_operand 1 "const_int_operand" "n") + (const_int 0)) + (lshiftrt:DI (match_operand:DI 2 "register_operand" "d") + (const_int 32)))] + "TARGET_64BIT + && INTVAL (operands[1]) > 0 + && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) + && INTVAL (operands[1]) % BITS_PER_UNIT == 0" +{ + int size = INTVAL (operands[1]) / BITS_PER_UNIT; + + operands[1] = GEN_INT ((1ul << size) - 1); + return "stcmh\t%2,%1,%S0"; +} +[(set_attr "op_type" "RSY")]) + +(define_insn "*insv_reg_imm" + [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d") + (const_int 16) + (match_operand 1 "const_int_operand" "n")) + (match_operand:P 2 "const_int_operand" "n"))] + "TARGET_ZARCH + && INTVAL (operands[1]) >= 0 + && INTVAL (operands[1]) < BITS_PER_WORD + && INTVAL (operands[1]) % 16 == 0" +{ + switch (BITS_PER_WORD - INTVAL (operands[1])) + { + case 64: return "iihh\t%0,%x2"; break; + case 48: return "iihl\t%0,%x2"; break; + case 32: return "iilh\t%0,%x2"; break; + case 16: return "iill\t%0,%x2"; break; + default: gcc_unreachable(); + } +} + [(set_attr "op_type" "RI")]) + +(define_insn "*insv_reg_extimm" + [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d") + (const_int 32) + (match_operand 1 "const_int_operand" "n")) + (match_operand:P 2 "const_int_operand" "n"))] + "TARGET_EXTIMM + && INTVAL (operands[1]) >= 0 + && INTVAL (operands[1]) < BITS_PER_WORD + && INTVAL (operands[1]) % 32 == 0" +{ + switch (BITS_PER_WORD - INTVAL (operands[1])) + { + case 64: return "iihf\t%0,%o2"; break; + case 32: return "iilf\t%0,%o2"; break; + default: gcc_unreachable(); + } +} + [(set_attr "op_type" "RIL")]) ; ; extendsidi2 instruction pattern(s). @@ -2458,7 +2742,6 @@ [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] "" - " { if (!TARGET_64BIT) { @@ -2468,8 +2751,7 @@ emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32))); DONE; } -} -") +}) (define_insn "*extendsidi2" [(set (match_operand:DI 0 "register_operand" "=d,d") @@ -2481,31 +2763,45 @@ [(set_attr "op_type" "RRE,RXY")]) ; -; extendhidi2 instruction pattern(s). +; extend(hi|qi)(si|di)2 instruction pattern(s). ; -(define_expand "extendhidi2" - [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI (match_operand:HI 1 "register_operand" "")))] +(define_expand "extend2" + [(set (match_operand:DSI 0 "register_operand" "") + (sign_extend:DSI (match_operand:HQI 1 "nonimmediate_operand" "")))] "" - " { - if (!TARGET_64BIT) + if (mode == DImode && !TARGET_64BIT) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_extendhisi2 (tmp, operands[1])); + emit_insn (gen_extendsi2 (tmp, operands[1])); emit_insn (gen_extendsidi2 (operands[0], tmp)); DONE; } - else + else if (!TARGET_EXTIMM) { - operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48))); - emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48))); + rtx bitcount = GEN_INT (GET_MODE_BITSIZE (mode) - + GET_MODE_BITSIZE (mode)); + + operands[1] = gen_lowpart (mode, operands[1]); + emit_insn (gen_ashl3 (operands[0], operands[1], bitcount)); + emit_insn (gen_ashr3 (operands[0], operands[0], bitcount)); DONE; } -} -") +}) + +; +; extendhidi2 instruction pattern(s). +; + +(define_insn "*extendhidi2_extimm" + [(set (match_operand:DI 0 "register_operand" "=d,d") + (sign_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,m")))] + "TARGET_64BIT && TARGET_EXTIMM" + "@ + lghr\t%0,%1 + lgh\t%0,%1" + [(set_attr "op_type" "RRE,RXY")]) (define_insn "*extendhidi2" [(set (match_operand:DI 0 "register_operand" "=d") @@ -2514,124 +2810,70 @@ "lgh\t%0,%1" [(set_attr "op_type" "RXY")]) -; -; extendqidi2 instruction pattern(s). -; - -(define_expand "extendqidi2" - [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - if (!TARGET_64BIT) - { - rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_extendqisi2 (tmp, operands[1])); - emit_insn (gen_extendsidi2 (operands[0], tmp)); - DONE; - } - else - { - operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56))); - emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56))); - DONE; - } -} -") - -(define_insn "*extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_64BIT && TARGET_LONG_DISPLACEMENT" - "lgb\t%0,%1" - [(set_attr "op_type" "RXY")]) - -(define_insn_and_split "*extendqidi2_short_displ" - [(set (match_operand:DI 0 "register_operand" "=d") - (sign_extend:DI (match_operand:QI 1 "s_operand" "Q"))) - (clobber (reg:CC 33))] - "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT" - "#" - "&& reload_completed" - [(parallel - [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) - (parallel - [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56))) - (clobber (reg:CC 33))])] - "") - ; ; extendhisi2 instruction pattern(s). ; -(define_expand "extendhisi2" - [(set (match_operand:SI 0 "register_operand" "") - (sign_extend:SI (match_operand:HI 1 "register_operand" "")))] - "" - " -{ - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16))); - emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16))); - DONE; -} -") +(define_insn "*extendhisi2_extimm" + [(set (match_operand:SI 0 "register_operand" "=d,d,d") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d,R,T")))] + "TARGET_EXTIMM" + "@ + lhr\t%0,%1 + lh\t%0,%1 + lhy\t%0,%1" + [(set_attr "op_type" "RRE,RX,RXY")]) (define_insn "*extendhisi2" [(set (match_operand:SI 0 "register_operand" "=d,d") (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))] - "" + "!TARGET_EXTIMM" "@ lh\t%0,%1 lhy\t%0,%1" [(set_attr "op_type" "RX,RXY")]) ; -; extendqisi2 instruction pattern(s). +; extendqi(si|di)2 instruction pattern(s). ; -(define_expand "extendqisi2" - [(set (match_operand:SI 0 "register_operand" "") - (sign_extend:SI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24))); - emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24))); - DONE; -} -") +; lbr, lgbr, lb, lgb +(define_insn "*extendqi2_extimm" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (sign_extend:GPR (match_operand:QI 1 "nonimmediate_operand" "d,m")))] + "TARGET_EXTIMM" + "@ + lbr\t%0,%1 + lb\t%0,%1" + [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_LONG_DISPLACEMENT" - "lb\t%0,%1" +; lb, lgb +(define_insn "*extendqi2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (sign_extend:GPR (match_operand:QI 1 "memory_operand" "m")))] + "!TARGET_EXTIMM && TARGET_LONG_DISPLACEMENT" + "lb\t%0,%1" [(set_attr "op_type" "RXY")]) -(define_insn_and_split "*extendsiqi2_short_displ" - [(set (match_operand:SI 0 "register_operand" "=d") - (sign_extend:SI (match_operand:QI 1 "s_operand" "Q"))) - (clobber (reg:CC 33))] - "!TARGET_LONG_DISPLACEMENT" +(define_insn_and_split "*extendqi2_short_displ" + [(set (match_operand:GPR 0 "register_operand" "=d") + (sign_extend:GPR (match_operand:QI 1 "s_operand" "Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_EXTIMM && !TARGET_LONG_DISPLACEMENT" "#" "&& reload_completed" [(parallel - [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) + [(set (match_dup 0) (unspec:GPR [(match_dup 1) (const_int 8)] UNSPEC_ICM)) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24))) - (clobber (reg:CC 33))])] - "") - -; -; extendqihi2 instruction pattern(s). -; - + [(set (match_dup 0) (ashiftrt:GPR (match_dup 0) (match_dup 2))) + (clobber (reg:CC CC_REGNUM))])] +{ + operands[1] = adjust_address (operands[1], BLKmode, 0); + set_mem_size (operands[1], GEN_INT (GET_MODE_SIZE (QImode))); + operands[2] = GEN_INT (GET_MODE_BITSIZE (mode) + - GET_MODE_BITSIZE (QImode)); +}) ; ; zero_extendsidi2 instruction pattern(s). @@ -2641,7 +2883,6 @@ [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] "" - " { if (!TARGET_64BIT) { @@ -2650,8 +2891,7 @@ emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx); DONE; } -} -") +}) (define_insn "*zero_extendsidi2" [(set (match_operand:DI 0 "register_operand" "=d,d") @@ -2662,65 +2902,41 @@ llgf\t%0,%1" [(set_attr "op_type" "RRE,RXY")]) -; -; zero_extendhidi2 instruction pattern(s). -; - -(define_expand "zero_extendhidi2" - [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:HI 1 "register_operand" "")))] - "" - " -{ - if (!TARGET_64BIT) - { - rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_zero_extendhisi2 (tmp, operands[1])); - emit_insn (gen_zero_extendsidi2 (operands[0], tmp)); - DONE; - } - else - { - operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48))); - emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48))); - DONE; - } -} -") - -(define_insn "*zero_extendhidi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_64BIT" - "llgh\t%0,%1" - [(set_attr "op_type" "RXY")]) - ; ; LLGT-type instructions (zero-extend from 31 bit to 64 bit). ; +(define_insn "*llgt_sidi" + [(set (match_operand:DI 0 "register_operand" "=d") + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) + (const_int 2147483647)))] + "TARGET_64BIT" + "llgt\t%0,%1" + [(set_attr "op_type" "RXE")]) + +(define_insn_and_split "*llgt_sidi_split" + [(set (match_operand:DI 0 "register_operand" "=d") + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) + (const_int 2147483647))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT" + "#" + "&& reload_completed" + [(set (match_dup 0) + (and:DI (subreg:DI (match_dup 1) 0) + (const_int 2147483647)))] + "") + (define_insn "*llgt_sisi" [(set (match_operand:SI 0 "register_operand" "=d,d") (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m") (const_int 2147483647)))] - "TARGET_64BIT" + "TARGET_ZARCH" "@ llgtr\t%0,%1 llgt\t%0,%1" [(set_attr "op_type" "RRE,RXE")]) -(define_split - [(set (match_operand:SI 0 "register_operand" "") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "") - (const_int 2147483647))) - (clobber (reg:CC 33))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (and:SI (match_dup 1) - (const_int 2147483647)))] - "") - (define_insn "*llgt_didi" [(set (match_operand:DI 0 "register_operand" "=d,d") (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") @@ -2732,130 +2948,87 @@ [(set_attr "op_type" "RRE,RXE")]) (define_split - [(set (match_operand:DI 0 "register_operand" "") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "") - (const_int 2147483647))) - (clobber (reg:CC 33))] - "TARGET_64BIT && reload_completed" + [(set (match_operand:GPR 0 "register_operand" "") + (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "") + (const_int 2147483647))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && reload_completed" [(set (match_dup 0) - (and:DI (match_dup 1) - (const_int 2147483647)))] - "") - -(define_insn "*llgt_sidi" - [(set (match_operand:DI 0 "register_operand" "=d") - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) - (const_int 2147483647)))] - "TARGET_64BIT" - "llgt\t%0,%1" - [(set_attr "op_type" "RXE")]) - -(define_insn_and_split "*llgt_sidi_split" - [(set (match_operand:DI 0 "register_operand" "=d") - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) - (const_int 2147483647))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" - [(set (match_dup 0) - (and:DI (subreg:DI (match_dup 1) 0) - (const_int 2147483647)))] + (and:GPR (match_dup 1) + (const_int 2147483647)))] "") ; -; zero_extendqidi2 instruction pattern(s) +; zero_extend(hi|qi)(si|di)2 instruction pattern(s). ; -(define_expand "zero_extendqidi2" +(define_expand "zero_extenddi2" [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:QI 1 "register_operand" "")))] + (zero_extend:DI (match_operand:HQI 1 "nonimmediate_operand" "")))] "" - " { if (!TARGET_64BIT) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_zero_extendqisi2 (tmp, operands[1])); + emit_insn (gen_zero_extendsi2 (tmp, operands[1])); emit_insn (gen_zero_extendsidi2 (operands[0], tmp)); DONE; } - else + else if (!TARGET_EXTIMM) { + rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) - + GET_MODE_BITSIZE(mode)); operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56))); - emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56))); + emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount)); + emit_insn (gen_lshrdi3 (operands[0], operands[0], bitcount)); DONE; } -} -") +}) -(define_insn "*zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_64BIT" - "llgc\t%0,%1" - [(set_attr "op_type" "RXY")]) - -; -; zero_extendhisi2 instruction pattern(s). -; - -(define_expand "zero_extendhisi2" +(define_expand "zero_extendsi2" [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:HI 1 "register_operand" "")))] + (zero_extend:SI (match_operand:HQI 1 "nonimmediate_operand" "")))] "" - " { - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff))); - DONE; -} -") + if (!TARGET_EXTIMM) + { + operands[1] = gen_lowpart (SImode, operands[1]); + emit_insn (gen_andsi3 (operands[0], operands[1], + GEN_INT ((1 << GET_MODE_BITSIZE(mode)) - 1))); + DONE; + } +}) -(define_insn "*zero_extendhisi2_64" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] - "TARGET_64BIT" - "llgh\t%0,%1" +; llhr, llcr, llghr, llgcr, llh, llc, llgh, llgc +(define_insn "*zero_extend2_extimm" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (zero_extend:GPR (match_operand:HQI 1 "nonimmediate_operand" "d,m")))] + "TARGET_EXTIMM" + "@ + llr\t%0,%1 + ll\t%0,%1" + [(set_attr "op_type" "RRE,RXY")]) + +; llgh, llgc +(define_insn "*zero_extend2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (zero_extend:GPR (match_operand:HQI 1 "memory_operand" "m")))] + "TARGET_ZARCH && !TARGET_EXTIMM" + "llg\t%0,%1" [(set_attr "op_type" "RXY")]) (define_insn_and_split "*zero_extendhisi2_31" [(set (match_operand:SI 0 "register_operand" "=&d") (zero_extend:SI (match_operand:HI 1 "s_operand" "QS"))) - (clobber (reg:CC 33))] - "!TARGET_64BIT" + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (const_int 0)) (parallel [(set (strict_low_part (match_dup 2)) (match_dup 1)) - (clobber (reg:CC 33))])] - "operands[2] = gen_lowpart (HImode, operands[0]);" - [(set_attr "atype" "agen")]) - -; -; zero_extendqisi2 instruction pattern(s). -; - -(define_expand "zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff))); - DONE; -} -") - -(define_insn "*zero_extendqisi2_64" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ZARCH" - "llgc\t%0,%1" - [(set_attr "op_type" "RXY")]) + (clobber (reg:CC CC_REGNUM))])] + "operands[2] = gen_lowpart (HImode, operands[0]);") (define_insn_and_split "*zero_extendqisi2_31" [(set (match_operand:SI 0 "register_operand" "=&d") @@ -2865,8 +3038,7 @@ "&& reload_completed" [(set (match_dup 0) (const_int 0)) (set (strict_low_part (match_dup 2)) (match_dup 1))] - "operands[2] = gen_lowpart (QImode, operands[0]);" - [(set_attr "atype" "agen")]) + "operands[2] = gen_lowpart (QImode, operands[0]);") ; ; zero_extendqihi2 instruction pattern(s). @@ -2875,19 +3047,17 @@ (define_expand "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "register_operand" "")))] - "TARGET_ZARCH" - " + "TARGET_ZARCH && !TARGET_EXTIMM" { operands[1] = gen_lowpart (HImode, operands[1]); emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff))); DONE; -} -") +}) (define_insn "*zero_extendqihi2_64" [(set (match_operand:HI 0 "register_operand" "=d") (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ZARCH" + "TARGET_ZARCH && !TARGET_EXTIMM" "llgc\t%0,%1" [(set_attr "op_type" "RXY")]) @@ -2899,90 +3069,81 @@ "&& reload_completed" [(set (match_dup 0) (const_int 0)) (set (strict_low_part (match_dup 2)) (match_dup 1))] - "operands[2] = gen_lowpart (QImode, operands[0]);" - [(set_attr "atype" "agen")]) + "operands[2] = gen_lowpart (QImode, operands[0]);") ; -; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s). +; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2 instruction pattern(s). ; -(define_expand "fixuns_truncdfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (DFmode); - operands[1] = force_reg (DFmode, operands[1]); - - emit_insn (gen_cmpdf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode))); - emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subdf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode))); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - emit_label (label2); - DONE; -}) - -(define_expand "fix_truncdfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - operands[1] = force_reg (DFmode, operands[1]); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - DONE; -}) - -(define_insn "fix_truncdfdi2_ieee" - [(set (match_operand:DI 0 "register_operand" "=d") - (fix:DI (match_operand:DF 1 "register_operand" "f"))) - (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cgdbr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) - -; -; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s). -; - -(define_expand "fixuns_truncdfsi2" - [(set (match_operand:SI 0 "register_operand" "") - (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))] +(define_expand "fixuns_trunc2" + [(set (match_operand:GPR 0 "register_operand" "") + (unsigned_fix:GPR (match_operand:FPR 1 "register_operand" "")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" { rtx label1 = gen_label_rtx (); rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (DFmode); - - operands[1] = force_reg (DFmode,operands[1]); - emit_insn (gen_cmpdf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode))); + rtx temp = gen_reg_rtx (mode); + REAL_VALUE_TYPE cmp, sub; + + operands[1] = force_reg (mode, operands[1]); + real_2expN (&cmp, GET_MODE_BITSIZE(mode) - 1); + real_2expN (&sub, GET_MODE_BITSIZE(mode)); + + emit_insn (gen_cmp (operands[1], + CONST_DOUBLE_FROM_REAL_VALUE (cmp, mode))); emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subdf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode))); - emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7))); + emit_insn (gen_sub3 (temp, operands[1], + CONST_DOUBLE_FROM_REAL_VALUE (sub, mode))); + emit_insn (gen_fix_trunc2_ieee (operands[0], temp, + GEN_INT(7))); emit_jump (label2); emit_label (label1); - emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5))); + emit_insn (gen_fix_trunc2_ieee (operands[0], + operands[1], GEN_INT(5))); emit_label (label2); DONE; }) +(define_expand "fix_truncdi2" + [(set (match_operand:DI 0 "register_operand" "") + (fix:DI (match_operand:DSF 1 "nonimmediate_operand" "")))] + "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" +{ + operands[1] = force_reg (mode, operands[1]); + emit_insn (gen_fix_truncdi2_ieee (operands[0], operands[1], + GEN_INT(5))); + DONE; +}) + +; cgxbr, cgdbr, cgebr, cfxbr, cfdbr, cfebr +(define_insn "fix_trunc2_ieee" + [(set (match_operand:GPR 0 "register_operand" "=d") + (fix:GPR (match_operand:FPR 1 "register_operand" "f"))) + (unspec:GPR [(match_operand:GPR 2 "immediate_operand" "K")] UNSPEC_ROUND) + (clobber (reg:CC CC_REGNUM))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "cbr\t%0,%h2,%1" + [(set_attr "op_type" "RRE") + (set_attr "type" "ftoi")]) + +; +; fix_trunctf(si|di)2 instruction pattern(s). +; + +(define_expand "fix_trunctf2" + [(parallel [(set (match_operand:GPR 0 "register_operand" "") + (fix:GPR (match_operand:TF 1 "register_operand" ""))) + (unspec:GPR [(const_int 5)] UNSPEC_ROUND) + (clobber (reg:CC CC_REGNUM))])] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "") + +; +; fix_truncdfsi2 instruction pattern(s). +; + (define_expand "fix_truncdfsi2" [(set (match_operand:SI 0 "register_operand" "") (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))] @@ -3009,23 +3170,13 @@ DONE; }) -(define_insn "fix_truncdfsi2_ieee" - [(set (match_operand:SI 0 "register_operand" "=d") - (fix:SI (match_operand:DF 1 "register_operand" "f"))) - (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cfdbr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "other" )]) - (define_insn "fix_truncdfsi2_ibm" [(set (match_operand:SI 0 "register_operand" "=d") (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f"))) (use (match_operand:DI 2 "immediate_operand" "m")) (use (match_operand:DI 3 "immediate_operand" "m")) (use (match_operand:BLK 4 "memory_operand" "m")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" { output_asm_insn ("sd\t%1,%2", operands); @@ -3034,92 +3185,12 @@ output_asm_insn ("xi\t%N4,128", operands); return "l\t%0,%N4"; } - [(set_attr "op_type" "NN") - (set_attr "type" "ftoi") - (set_attr "atype" "agen") - (set_attr "length" "20")]) + [(set_attr "length" "20")]) ; -; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s). +; fix_truncsfsi2 instruction pattern(s). ; -(define_expand "fixuns_truncsfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (SFmode); - - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_cmpsf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode))); - emit_jump_insn (gen_blt (label1)); - - emit_insn (gen_subsf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode))); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - emit_label (label2); - DONE; -}) - -(define_expand "fix_truncsfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - DONE; -}) - -(define_insn "fix_truncsfdi2_ieee" - [(set (match_operand:DI 0 "register_operand" "=d") - (fix:DI (match_operand:SF 1 "register_operand" "f"))) - (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cgebr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) - -; -; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s). -; - -(define_expand "fixuns_truncsfsi2" - [(set (match_operand:SI 0 "register_operand" "") - (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (SFmode); - - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_cmpsf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode))); - emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subsf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode))); - emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5))); - emit_label (label2); - DONE; -}) - (define_expand "fix_truncsfsi2" [(set (match_operand:SI 0 "register_operand" "") (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))] @@ -3141,51 +3212,42 @@ DONE; }) -(define_insn "fix_truncsfsi2_ieee" - [(set (match_operand:SI 0 "register_operand" "=d") - (fix:SI (match_operand:SF 1 "register_operand" "f"))) - (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] +; +; float(si|di)(tf|df|sf)2 instruction pattern(s). +; + +; cxgbr, cdgbr, cegbr +(define_insn "floatdi2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (float:FPR (match_operand:DI 1 "register_operand" "d")))] + "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "cgbr\t%0,%1" + [(set_attr "op_type" "RRE") + (set_attr "type" "itof" )]) + +; cxfbr, cdfbr, cefbr +(define_insn "floatsi2_ieee" + [(set (match_operand:FPR 0 "register_operand" "=f") + (float:FPR (match_operand:SI 1 "register_operand" "d")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cfebr\t%0,%h2,%1" + "cfbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) + (set_attr "type" "itof" )]) + ; -; floatdidf2 instruction pattern(s). +; floatsi(tf|df)2 instruction pattern(s). ; -(define_insn "floatdidf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cdgbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "itof" )]) - -; -; floatdisf2 instruction pattern(s). -; - -(define_insn "floatdisf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cegbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "itof" )]) - -; -; floatsidf2 instruction pattern(s). -; +(define_expand "floatsitf2" + [(set (match_operand:TF 0 "register_operand" "") + (float:TF (match_operand:SI 1 "register_operand" "")))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "") (define_expand "floatsidf2" - [(parallel - [(set (match_operand:DF 0 "register_operand" "") - (float:DF (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 33))])] + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:SI 1 "register_operand" "")))] "TARGET_HARD_FLOAT" { if (TARGET_IBM_FLOAT) @@ -3200,21 +3262,12 @@ } }) -(define_insn "floatsidf2_ieee" - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cdfbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "itof" )]) - (define_insn "floatsidf2_ibm" [(set (match_operand:DF 0 "register_operand" "=f") (float:DF (match_operand:SI 1 "register_operand" "d"))) (use (match_operand:DI 2 "immediate_operand" "m")) (use (match_operand:BLK 3 "memory_operand" "m")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" { output_asm_insn ("st\t%1,%N3", operands); @@ -3223,20 +3276,15 @@ output_asm_insn ("ld\t%0,%3", operands); return "sd\t%0,%2"; } - [(set_attr "op_type" "NN") - (set_attr "type" "other" ) - (set_attr "atype" "agen") - (set_attr "length" "20")]) + [(set_attr "length" "20")]) ; ; floatsisf2 instruction pattern(s). ; (define_expand "floatsisf2" - [(parallel - [(set (match_operand:SF 0 "register_operand" "") - (float:SF (match_operand:SI 1 "register_operand" ""))) - (clobber (reg:CC 33))])] + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:SI 1 "register_operand" "")))] "TARGET_HARD_FLOAT" { if (TARGET_IBM_FLOAT) @@ -3249,41 +3297,93 @@ } }) -(define_insn "floatsisf2_ieee" - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cefbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "itof" )]) - ; ; truncdfsf2 instruction pattern(s). ; (define_expand "truncdfsf2" [(set (match_operand:SF 0 "register_operand" "") - (float_truncate:SF (match_operand:DF 1 "general_operand" "")))] + (float_truncate:SF (match_operand:DF 1 "register_operand" "")))] "TARGET_HARD_FLOAT" "") (define_insn "truncdfsf2_ieee" [(set (match_operand:SF 0 "register_operand" "=f") - (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))] + (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "ledbr\t%0,%1" - [(set_attr "op_type" "RRE")]) + [(set_attr "op_type" "RRE") + (set_attr "type" "ftruncdf")]) (define_insn "truncdfsf2_ibm" [(set (match_operand:SF 0 "register_operand" "=f,f") - (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))] + (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - lrer\t%0,%1 + ler\t%0,%1 le\t%0,%1" [(set_attr "op_type" "RR,RX") - (set_attr "type" "floads,floads")]) + (set_attr "type" "floadsf")]) + +; +; trunctfdf2 instruction pattern(s). +; + +(define_expand "trunctfdf2" + [(parallel + [(set (match_operand:DF 0 "register_operand" "") + (float_truncate:DF (match_operand:TF 1 "register_operand" ""))) + (clobber (match_scratch:TF 2 "=f"))])] + "TARGET_HARD_FLOAT" + "") + +(define_insn "*trunctfdf2_ieee" + [(set (match_operand:DF 0 "register_operand" "=f") + (float_truncate:DF (match_operand:TF 1 "register_operand" "f"))) + (clobber (match_scratch:TF 2 "=f"))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "ldxbr\t%2,%1\;ldr\t%0,%2" + [(set_attr "length" "6") + (set_attr "type" "ftrunctf")]) + +(define_insn "*trunctfdf2_ibm" + [(set (match_operand:DF 0 "register_operand" "=f") + (float_truncate:DF (match_operand:TF 1 "register_operand" "f"))) + (clobber (match_scratch:TF 2 "=f"))] + "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" + "ldxr\t%2,%1\;ldr\t%0,%2" + [(set_attr "length" "4") + (set_attr "type" "ftrunctf")]) + +; +; trunctfsf2 instruction pattern(s). +; + +(define_expand "trunctfsf2" + [(parallel + [(set (match_operand:SF 0 "register_operand" "=f") + (float_truncate:SF (match_operand:TF 1 "register_operand" "f"))) + (clobber (match_scratch:TF 2 "=f"))])] + "TARGET_HARD_FLOAT" + "") + +(define_insn "*trunctfsf2_ieee" + [(set (match_operand:SF 0 "register_operand" "=f") + (float_truncate:SF (match_operand:TF 1 "register_operand" "f"))) + (clobber (match_scratch:TF 2 "=f"))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lexbr\t%2,%1\;ler\t%0,%2" + [(set_attr "length" "6") + (set_attr "type" "ftrunctf")]) + +(define_insn "*trunctfsf2_ibm" + [(set (match_operand:SF 0 "register_operand" "=f") + (float_truncate:SF (match_operand:TF 1 "register_operand" "f"))) + (clobber (match_scratch:TF 2 "=f"))] + "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" + "lexr\t%2,%1\;ler\t%0,%2" + [(set_attr "length" "6") + (set_attr "type" "ftrunctf")]) ; ; extendsfdf2 instruction pattern(s). @@ -3309,20 +3409,78 @@ ldebr\t%0,%1 ldeb\t%0,%1" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "floads,floads")]) + (set_attr "type" "fsimpsf, floadsf")]) (define_insn "extendsfdf2_ibm" [(set (match_operand:DF 0 "register_operand" "=f,f") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ sdr\t%0,%0\;ler\t%0,%1 sdr\t%0,%0\;le\t%0,%1" - [(set_attr "op_type" "NN,NN") - (set_attr "atype" "reg,agen") - (set_attr "length" "4,6") - (set_attr "type" "o2,o2")]) + [(set_attr "length" "4,6") + (set_attr "type" "floadsf")]) + +; +; extenddftf2 instruction pattern(s). +; + +(define_expand "extenddftf2" + [(set (match_operand:TF 0 "register_operand" "") + (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "")))] + "TARGET_HARD_FLOAT" + "") + +(define_insn "*extenddftf2_ieee" + [(set (match_operand:TF 0 "register_operand" "=f,f") + (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "f,R")))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "@ + lxdbr\t%0,%1 + lxdb\t%0,%1" + [(set_attr "op_type" "RRE,RXE") + (set_attr "type" "fsimptf, floadtf")]) + +(define_insn "*extenddftf2_ibm" + [(set (match_operand:TF 0 "register_operand" "=f,f") + (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "f,R")))] + "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" + "@ + lxdr\t%0,%1 + lxd\t%0,%1" + [(set_attr "op_type" "RRE,RXE") + (set_attr "type" "fsimptf, floadtf")]) + +; +; extendsftf2 instruction pattern(s). +; + +(define_expand "extendsftf2" + [(set (match_operand:TF 0 "register_operand" "") + (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "")))] + "TARGET_HARD_FLOAT" + "") + +(define_insn "*extendsftf2_ieee" + [(set (match_operand:TF 0 "register_operand" "=f,f") + (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "f,R")))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "@ + lxebr\t%0,%1 + lxeb\t%0,%1" + [(set_attr "op_type" "RRE,RXE") + (set_attr "type" "fsimptf, floadtf")]) + +(define_insn "*extendsftf2_ibm" + [(set (match_operand:TF 0 "register_operand" "=f,f") + (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "f,R")))] + "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" + "@ + lxer\t%0,%1 + lxe\t%0,%1" + [(set_attr "op_type" "RRE,RXE") + (set_attr "type" "fsimptf, floadtf")]) ;; @@ -3336,15 +3494,52 @@ ;;- Add instructions. ;; +; +; addti3 instruction pattern(s). +; + +(define_insn_and_split "addti3" + [(set (match_operand:TI 0 "register_operand" "=&d") + (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0") + (match_operand:TI 2 "general_operand" "do") ) ) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT" + "#" + "&& reload_completed" + [(parallel + [(set (reg:CCL1 CC_REGNUM) + (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8)) + (match_dup 7))) + (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))]) + (parallel + [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5)) + (ltu:DI (reg:CCL1 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] + "operands[3] = operand_subword (operands[0], 0, 0, TImode); + operands[4] = operand_subword (operands[1], 0, 0, TImode); + operands[5] = operand_subword (operands[2], 0, 0, TImode); + operands[6] = operand_subword (operands[0], 1, 0, TImode); + operands[7] = operand_subword (operands[1], 1, 0, TImode); + operands[8] = operand_subword (operands[2], 1, 0, TImode);") + ; ; adddi3 instruction pattern(s). ; +(define_expand "adddi3" + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") + (match_operand:DI 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "" + "") + (define_insn "*adddi3_sign" [(set (match_operand:DI 0 "register_operand" "=d,d") (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ agfr\t%0,%2 @@ -3352,7 +3547,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_zero_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0")) (const_int 0))) @@ -3365,7 +3560,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_zero_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0")) (const_int 0))) @@ -3380,172 +3575,60 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ algfr\t%0,%2 algf\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*adddi3_imm_cc" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0") - (match_operand:DI 2 "const_int_operand" "K")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT - && s390_match_ccmode (insn, CCAmode) - && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")" - "aghi\t%0,%h2" - [(set_attr "op_type" "RI")]) - -(define_insn "*adddi3_carry1_cc" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 1))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_carry1_cconly" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 1))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_carry2_cc" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 2))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_carry2_cconly" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 2))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_cc" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_cconly" - [(set (reg 33) - (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (const_int 0))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_cconly2" - [(set (reg 33) - (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (neg:SI (match_operand:DI 2 "general_operand" "d,m")))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT" - "@ - algr\t%0,%2 - alg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_64" - [(set (match_operand:DI 0 "register_operand" "=d,d,d") - (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:DI 2 "general_operand" "d,K,m") ) ) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - agr\t%0,%2 - aghi\t%0,%h2 - ag\t%0,%2" - [(set_attr "op_type" "RRE,RI,RXY")]) - (define_insn_and_split "*adddi3_31z" [(set (match_operand:DI 0 "register_operand" "=&d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel - [(set (reg:CCL1 33) + [(set (reg:CCL1 CC_REGNUM) (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5)) - (ltu:SI (reg:CCL1 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (ltu:SI (reg:CCL1 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); operands[5] = operand_subword (operands[2], 0, 0, DImode); operands[6] = operand_subword (operands[0], 1, 0, DImode); operands[7] = operand_subword (operands[1], 1, 0, DImode); - operands[8] = operand_subword (operands[2], 1, 0, DImode);" - [(set_attr "op_type" "NN")]) + operands[8] = operand_subword (operands[2], 1, 0, DImode);") (define_insn_and_split "*adddi3_31" [(set (match_operand:DI 0 "register_operand" "=&d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (reg:CCL1 33) + [(set (reg:CCL1 CC_REGNUM) (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) (set (pc) - (if_then_else (ltu (reg:CCL1 33) (const_int 0)) + (if_then_else (ltu (reg:CCL1 CC_REGNUM) (const_int 0)) (pc) (label_ref (match_dup 9)))) (parallel [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (match_dup 9)] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); @@ -3553,293 +3636,294 @@ operands[6] = operand_subword (operands[0], 1, 0, DImode); operands[7] = operand_subword (operands[1], 1, 0, DImode); operands[8] = operand_subword (operands[2], 1, 0, DImode); - operands[9] = gen_label_rtx ();" - [(set_attr "op_type" "NN")]) - -(define_expand "adddi3" - [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] - "" - "") + operands[9] = gen_label_rtx ();") ; ; addsi3 instruction pattern(s). ; -(define_insn "*addsi3_imm_cc" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0") - (match_operand:SI 2 "const_int_operand" "K")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d") - (plus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCAmode) - && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")" - "ahi\t%0,%h2" - [(set_attr "op_type" "RI")]) - -(define_insn "*addsi3_carry1_cc" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 1))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") - (plus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL1mode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_carry1_cconly" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 1))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCL1mode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_carry2_cc" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 2))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") - (plus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL1mode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_carry2_cconly" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 2))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCL1mode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_cc" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") - (plus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCLmode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_cconly" - [(set (reg 33) - (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (const_int 0))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCLmode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*addsi3_cconly2" - [(set (reg 33) - (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (neg:SI (match_operand:SI 2 "general_operand" "d,R,T")))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCLmode)" - "@ - alr\t%0,%2 - al\t%0,%2 - aly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) +(define_expand "addsi3" + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (plus:SI (match_operand:SI 1 "nonimmediate_operand" "") + (match_operand:SI 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "" + "") (define_insn "*addsi3_sign" [(set (match_operand:SI 0 "register_operand" "=d,d") - (plus:SI (match_operand:SI 1 "register_operand" "0,0") - (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")))) - (clobber (reg:CC 33))] + (plus:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")) + (match_operand:SI 1 "register_operand" "0,0"))) + (clobber (reg:CC CC_REGNUM))] "" "@ ah\t%0,%2 ahy\t%0,%2" [(set_attr "op_type" "RX,RXY")]) -(define_insn "addsi3" - [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") - (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") - (match_operand:SI 2 "general_operand" "d,K,R,T"))) - (clobber (reg:CC 33))] +; +; add(di|si)3 instruction pattern(s). +; + +; ar, ahi, alfi, slfi, a, ay, agr, aghi, algfi, slgfi, ag +(define_insn "*add3" + [(set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d,d") + (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0,0") + (match_operand:GPR 2 "general_operand" "d,K,Op,On,R,T") ) ) + (clobber (reg:CC CC_REGNUM))] "" "@ - ar\t%0,%2 - ahi\t%0,%h2 - a\t%0,%2 - ay\t%0,%2" - [(set_attr "op_type" "RR,RI,RX,RXY")]) + ar\t%0,%2 + ahi\t%0,%h2 + alfi\t%0,%2 + slfi\t%0,%n2 + a\t%0,%2 + a\t%0,%2" + [(set_attr "op_type" "RR,RI,RIL,RIL,RX,RXY")]) + +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg +(define_insn "*add3_carry1_cc" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T")) + (match_dup 1))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d") + (plus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCL1mode)" + "@ + alr\t%0,%2 + alfi\t%0,%2 + slfi\t%0,%n2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RIL,RIL,RX,RXY")]) + +; alr, al, aly, algr, alg +(define_insn "*add3_carry1_cconly" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (match_dup 1))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCL1mode)" + "@ + alr\t%0,%2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg +(define_insn "*add3_carry2_cc" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T")) + (match_dup 2))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d") + (plus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCL1mode)" + "@ + alr\t%0,%2 + alfi\t%0,%2 + slfi\t%0,%n2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RIL,RIL,RX,RXY")]) + +; alr, al, aly, algr, alg +(define_insn "*add3_carry2_cconly" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (match_dup 2))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCL1mode)" + "@ + alr\t%0,%2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg +(define_insn "*add3_cc" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:GPR 2 "general_operand" "d,Op,On,R,T")) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d,d,d") + (plus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCLmode)" + "@ + alr\t%0,%2 + alfi\t%0,%2 + slfi\t%0,%n2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RIL,RIL,RX,RXY")]) + +; alr, al, aly, algr, alg +(define_insn "*add3_cconly" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCLmode)" + "@ + alr\t%0,%2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; alr, al, aly, algr, alg +(define_insn "*add3_cconly2" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 1 "nonimmediate_operand" "%0,0,0") + (neg:GPR (match_operand:GPR 2 "general_operand" "d,R,T")))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode(insn, CCLmode)" + "@ + alr\t%0,%2 + al\t%0,%2 + al\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; ahi, afi, aghi, agfi +(define_insn "*add3_imm_cc" + [(set (reg CC_REGNUM) + (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") + (match_operand:GPR 2 "const_int_operand" "K,Os")) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCAmode) + && (CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\") + || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'O', \"Os\")) + && INTVAL (operands[2]) != -((HOST_WIDE_INT)1 << (GET_MODE_BITSIZE(mode) - 1))" + "@ + ahi\t%0,%h2 + afi\t%0,%2" + [(set_attr "op_type" "RI,RIL")]) ; -; adddf3 instruction pattern(s). +; add(df|sf)3 instruction pattern(s). ; -(define_expand "adddf3" +(define_expand "add3" [(parallel - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*adddf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +; axbr, adbr, aebr, axb, adb, aeb +(define_insn "*add3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - adbr\t%0,%2 - adb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*adddf3_cc" - [(set (reg 33) - (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_dup 1) (match_dup 2)))] +; axbr, adbr, aebr, axb, adb, aeb +(define_insn "*add3_cc" + [(set (reg CC_REGNUM) + (compare (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,")) + (match_operand:FPR 3 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_dup 1) (match_dup 2)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - adbr\t%0,%2 - adb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*adddf3_cconly" - [(set (reg 33) - (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f,f"))] +; axbr, adbr, aebr, axb, adb, aeb +(define_insn "*add3_cconly" + [(set (reg CC_REGNUM) + (compare (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,")) + (match_operand:FPR 3 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f,f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - adbr\t%0,%2 - adb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*adddf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +; axr, adr, aer, ax, ad, ae +(define_insn "*add3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - adr\t%0,%2 - ad\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd,fsimpd")]) - -; -; addsf3 instruction pattern(s). -; - -(define_expand "addsf3" - [(parallel - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*addsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - aebr\t%0,%2 - aeb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*addsf3_cc" - [(set (reg 33) - (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - aebr\t%0,%2 - aeb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*addsf3_cconly" - [(set (reg 33) - (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f,f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - aebr\t%0,%2 - aeb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*addsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - aer\t%0,%2 - ae\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps,fsimps")]) + ar\t%0,%2 + a\t%0,%2" + [(set_attr "op_type" ",") + (set_attr "type" "fsimp")]) ;; ;;- Subtract instructions. ;; +; +; subti3 instruction pattern(s). +; + +(define_insn_and_split "subti3" + [(set (match_operand:TI 0 "register_operand" "=&d") + (minus:TI (match_operand:TI 1 "register_operand" "0") + (match_operand:TI 2 "general_operand" "do") ) ) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT" + "#" + "&& reload_completed" + [(parallel + [(set (reg:CCL2 CC_REGNUM) + (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8)) + (match_dup 7))) + (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))]) + (parallel + [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5)) + (gtu:DI (reg:CCL2 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] + "operands[3] = operand_subword (operands[0], 0, 0, TImode); + operands[4] = operand_subword (operands[1], 0, 0, TImode); + operands[5] = operand_subword (operands[2], 0, 0, TImode); + operands[6] = operand_subword (operands[0], 1, 0, TImode); + operands[7] = operand_subword (operands[1], 1, 0, TImode); + operands[8] = operand_subword (operands[2], 1, 0, TImode);") + ; ; subdi3 instruction pattern(s). ; +(define_expand "subdi3" + [(parallel + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "" + "") + (define_insn "*subdi3_sign" [(set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_operand:DI 1 "register_operand" "0,0") (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ sgfr\t%0,%2 @@ -3847,7 +3931,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_zero_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))) (const_int 0))) @@ -3860,7 +3944,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_zero_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))) (const_int 0))) @@ -3875,122 +3959,60 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ slgfr\t%0,%2 slgf\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subdi3_borrow_cc" - [(set (reg 33) - (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 1))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT" - "@ - slgr\t%0,%2 - slg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_borrow_cconly" - [(set (reg 33) - (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_dup 1))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT" - "@ - slgr\t%0,%2 - slg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_cc" - [(set (reg 33) - (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - slgr\t%0,%2 - slg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_cconly" - [(set (reg 33) - (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (const_int 0))) - (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - slgr\t%0,%2 - slg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_64" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m") ) ) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - sgr\t%0,%2 - sg\t%0,%2" - [(set_attr "op_type" "RRE,RRE")]) - (define_insn_and_split "*subdi3_31z" [(set (match_operand:DI 0 "register_operand" "=&d") (minus:DI (match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel - [(set (reg:CCL2 33) + [(set (reg:CCL2 CC_REGNUM) (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5)) - (gtu:SI (reg:CCL2 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (gtu:SI (reg:CCL2 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); operands[5] = operand_subword (operands[2], 0, 0, DImode); operands[6] = operand_subword (operands[0], 1, 0, DImode); operands[7] = operand_subword (operands[1], 1, 0, DImode); - operands[8] = operand_subword (operands[2], 1, 0, DImode);" - [(set_attr "op_type" "NN")]) + operands[8] = operand_subword (operands[2], 1, 0, DImode);") (define_insn_and_split "*subdi3_31" [(set (match_operand:DI 0 "register_operand" "=&d") (minus:DI (match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (reg:CCL2 33) + [(set (reg:CCL2 CC_REGNUM) (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) (set (pc) - (if_then_else (gtu (reg:CCL2 33) (const_int 0)) + (if_then_else (gtu (reg:CCL2 CC_REGNUM) (const_int 0)) (pc) (label_ref (match_dup 9)))) (parallel [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (match_dup 9)] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); @@ -3998,227 +4020,201 @@ operands[6] = operand_subword (operands[0], 1, 0, DImode); operands[7] = operand_subword (operands[1], 1, 0, DImode); operands[8] = operand_subword (operands[2], 1, 0, DImode); - operands[9] = gen_label_rtx ();" - [(set_attr "op_type" "NN")]) - -(define_expand "subdi3" - [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] - "" - "") + operands[9] = gen_label_rtx ();") ; ; subsi3 instruction pattern(s). ; -(define_insn "*subsi3_borrow_cc" - [(set (reg 33) - (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 1))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") - (minus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCL2mode)" - "@ - slr\t%0,%2 - sl\t%0,%2 - sly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*subsi3_borrow_cconly" - [(set (reg 33) - (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (match_dup 1))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCL2mode)" - "@ - slr\t%0,%2 - sl\t%0,%2 - sly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*subsi3_cc" - [(set (reg 33) - (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") - (minus:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCLmode)" - "@ - slr\t%0,%2 - sl\t%0,%2 - sly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_insn "*subsi3_cconly" - [(set (reg 33) - (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) - (const_int 0))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode (insn, CCLmode)" - "@ - slr\t%0,%2 - sl\t%0,%2 - sly\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) +(define_expand "subsi3" + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (minus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] + "" + "") (define_insn "*subsi3_sign" [(set (match_operand:SI 0 "register_operand" "=d,d") (minus:SI (match_operand:SI 1 "register_operand" "0,0") (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ sh\t%0,%2 shy\t%0,%2" [(set_attr "op_type" "RX,RXY")]) -(define_insn "subsi3" - [(set (match_operand:SI 0 "register_operand" "=d,d,d") - (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T"))) - (clobber (reg:CC 33))] +; +; sub(di|si)3 instruction pattern(s). +; + +; sr, s, sy, sgr, sg +(define_insn "*sub3" + [(set (match_operand:GPR 0 "register_operand" "=d,d,d") + (minus:GPR (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T") ) ) + (clobber (reg:CC CC_REGNUM))] "" "@ - sr\t%0,%2 - s\t%0,%2 - sy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + sr\t%0,%2 + s\t%0,%2 + s\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) +; slr, sl, sly, slgr, slg +(define_insn "*sub3_borrow_cc" + [(set (reg CC_REGNUM) + (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (match_dup 1))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d") + (minus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCL2mode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; slr, sl, sly, slgr, slg +(define_insn "*sub3_borrow_cconly" + [(set (reg CC_REGNUM) + (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (match_dup 1))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCL2mode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; slr, sl, sly, slgr, slg +(define_insn "*sub3_cc" + [(set (reg CC_REGNUM) + (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d") + (minus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCLmode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; slr, sl, sly, slgr, slg +(define_insn "*sub3_cc2" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T"))) + (set (match_operand:GPR 0 "register_operand" "=d,d,d") + (minus:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode (insn, CCL3mode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; slr, sl, sly, slgr, slg +(define_insn "*sub3_cconly" + [(set (reg CC_REGNUM) + (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T")) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCLmode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) + +; slr, sl, sly, slgr, slg +(define_insn "*sub3_cconly2" + [(set (reg CC_REGNUM) + (compare (match_operand:GPR 1 "register_operand" "0,0,0") + (match_operand:GPR 2 "general_operand" "d,R,T"))) + (clobber (match_scratch:GPR 0 "=d,d,d"))] + "s390_match_ccmode (insn, CCL3mode)" + "@ + slr\t%0,%2 + sl\t%0,%2 + sl\t%0,%2" + [(set_attr "op_type" "RR,RX,RXY")]) ; -; subdf3 instruction pattern(s). +; sub(df|sf)3 instruction pattern(s). ; -(define_expand "subdf3" +(define_expand "sub3" [(parallel - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*subdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +; sxbr, sdbr, sebr, sxb, sdb, seb +(define_insn "*sub3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sdbr\t%0,%2 - sdb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*subdf3_cc" - [(set (reg 33) - (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_dup 1) (match_dup 2)))] +; sxbr, sdbr, sebr, sxb, sdb, seb +(define_insn "*sub3_cc" + [(set (reg CC_REGNUM) + (compare (minus:FPR (match_operand:FPR 1 "nonimmediate_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,")) + (match_operand:FPR 3 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_dup 1) (match_dup 2)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sdbr\t%0,%2 - sdb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*subdf3_cconly" - [(set (reg 33) - (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f,f"))] +; sxbr, sdbr, sebr, sxb, sdb, seb +(define_insn "*sub3_cconly" + [(set (reg CC_REGNUM) + (compare (minus:FPR (match_operand:FPR 1 "nonimmediate_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,")) + (match_operand:FPR 3 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f,f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sdbr\t%0,%2 - sdb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*subdf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +; sxr, sdr, ser, sx, sd, se +(define_insn "*sub3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - sdr\t%0,%2 - sd\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd,fsimpd")]) - -; -; subsf3 instruction pattern(s). -; - -(define_expand "subsf3" - [(parallel - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*subsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sebr\t%0,%2 - seb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*subsf3_cc" - [(set (reg 33) - (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sebr\t%0,%2 - seb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*subsf3_cconly" - [(set (reg 33) - (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f,f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sebr\t%0,%2 - seb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*subsf3_ibm" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - ser\t%0,%2 - se\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps,fsimps")]) + sr\t%0,%2 + s\t%0,%2" + [(set_attr "op_type" ",") + (set_attr "type" "fsimp")]) ;; @@ -4226,120 +4222,149 @@ ;; ; -; adddicc instruction pattern(s). +; add(di|si)cc instruction pattern(s). ; -(define_insn "*adddi3_alc_cc" - [(set (reg 33) +; alcr, alc, alcgr, alcg +(define_insn "*add3_alc_cc" + [(set (reg CC_REGNUM) (compare - (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_alc_comparison" "")) + (plus:GPR (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_alc_comparison" "")) (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + (set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (plus:GPR (match_dup 1) (match_dup 2)) (match_dup 3)))] + "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" "@ - alcgr\\t%0,%2 - alcg\\t%0,%2" + alcr\t%0,%2 + alc\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*adddi3_alc" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_alc_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" +; alcr, alc, alcgr, alcg +(define_insn "*add3_alc" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_alc_comparison" ""))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_CPU_ZARCH" "@ - alcgr\\t%0,%2 - alcg\\t%0,%2" + alcr\t%0,%2 + alc\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subdi3_slb_cc" - [(set (reg 33) +; slbr, slb, slbgr, slbg +(define_insn "*sub3_slb_cc" + [(set (reg CC_REGNUM) (compare - (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_slb_comparison" "")) + (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_slb_comparison" "")) (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" + (set (match_operand:GPR 0 "register_operand" "=d,d") + (minus:GPR (minus:GPR (match_dup 1) (match_dup 2)) (match_dup 3)))] + "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" "@ - slbgr\\t%0,%2 - slbg\\t%0,%2" + slbr\t%0,%2 + slb\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subdi3_slb" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_slb_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" +; slbr, slb, slbgr, slbg +(define_insn "*sub3_slb" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_slb_comparison" ""))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_CPU_ZARCH" "@ - slbgr\\t%0,%2 - slbg\\t%0,%2" + slbr\t%0,%2 + slb\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) +(define_expand "addcc" + [(match_operand:GPR 0 "register_operand" "") + (match_operand 1 "comparison_operator" "") + (match_operand:GPR 2 "register_operand" "") + (match_operand:GPR 3 "const_int_operand" "")] + "TARGET_CPU_ZARCH" + "if (!s390_expand_addcc (GET_CODE (operands[1]), + s390_compare_op0, s390_compare_op1, + operands[0], operands[2], + operands[3])) FAIL; DONE;") + ; -; addsicc instruction pattern(s). +; scond instruction pattern(s). ; -(define_insn "*addsi3_alc_cc" - [(set (reg 33) - (compare - (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_alc_comparison" "")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d") - (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" - "@ - alcr\\t%0,%2 - alc\\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) +(define_insn_and_split "*scond" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (match_operand:GPR 1 "s390_alc_comparison" "")) + (clobber (reg:CC CC_REGNUM))] + "TARGET_CPU_ZARCH" + "#" + "&& reload_completed" + [(set (match_dup 0) (const_int 0)) + (parallel + [(set (match_dup 0) (plus:GPR (plus:GPR (match_dup 0) (match_dup 0)) + (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "") -(define_insn "*addsi3_alc" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_alc_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_CPU_ZARCH" - "@ - alcr\\t%0,%2 - alc\\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) +(define_insn_and_split "*scond_neg" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (match_operand:GPR 1 "s390_slb_comparison" "")) + (clobber (reg:CC CC_REGNUM))] + "TARGET_CPU_ZARCH" + "#" + "&& reload_completed" + [(set (match_dup 0) (const_int 0)) + (parallel + [(set (match_dup 0) (minus:GPR (minus:GPR (match_dup 0) (match_dup 0)) + (match_dup 1))) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_dup 0) (neg:GPR (match_dup 0))) + (clobber (reg:CC CC_REGNUM))])] + "") -(define_insn "*subsi3_slb_cc" - [(set (reg 33) - (compare - (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_slb_comparison" "")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d") - (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" - "@ - slbr\\t%0,%2 - slb\\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subsi3_slb" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_slb_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_CPU_ZARCH" - "@ - slbr\\t%0,%2 - slb\\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) +(define_expand "s" + [(set (match_operand:SI 0 "register_operand" "") + (SCOND (match_dup 0) + (match_dup 0)))] + "TARGET_CPU_ZARCH" + "if (!s390_expand_addcc (, s390_compare_op0, s390_compare_op1, + operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") + +(define_expand "seq" + [(parallel + [(set (match_operand:SI 0 "register_operand" "=d") + (match_dup 1)) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_dup 0) (xor:SI (match_dup 0) (const_int 1))) + (clobber (reg:CC CC_REGNUM))])] + "" +{ + if (!s390_compare_emitted || GET_MODE (s390_compare_emitted) != CCZ1mode) + FAIL; + operands[1] = s390_emit_compare (NE, s390_compare_op0, s390_compare_op1); + PUT_MODE (operands[1], SImode); +}) + +(define_insn_and_split "*sne" + [(set (match_operand:SI 0 "register_operand" "=d") + (ne:SI (match_operand:CCZ1 1 "register_operand" "0") + (const_int 0))) + (clobber (reg:CC CC_REGNUM))] + "" + "#" + "reload_completed" + [(parallel + [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 28))) + (clobber (reg:CC CC_REGNUM))])]) ;; @@ -4359,7 +4384,7 @@ msgfr\t%0,%2 msgf\t%0,%2" [(set_attr "op_type" "RRE,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imuldi")]) (define_insn "muldi3" [(set (match_operand:DI 0 "register_operand" "=d,d,d") @@ -4371,7 +4396,7 @@ mghi\t%0,%h2 msg\t%0,%2" [(set_attr "op_type" "RRE,RI,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imuldi")]) ; ; mulsi3 instruction pattern(s). @@ -4384,7 +4409,7 @@ "" "mh\t%0,%2" [(set_attr "op_type" "RX") - (set_attr "type" "imul")]) + (set_attr "type" "imulhi")]) (define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") @@ -4397,7 +4422,7 @@ ms\t%0,%2 msy\t%0,%2" [(set_attr "op_type" "RRE,RI,RX,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi,imulhi,imulsi,imulsi")]) ; ; mulsidi3 instruction pattern(s). @@ -4414,7 +4439,7 @@ mr\t%0,%2 m\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi")]) ; ; umulsidi3 instruction pattern(s). @@ -4431,121 +4456,68 @@ mlr\t%0,%2 ml\t%0,%2" [(set_attr "op_type" "RRE,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi")]) ; -; muldf3 instruction pattern(s). +; mul(df|sf)3 instruction pattern(s). ; -(define_expand "muldf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +(define_expand "mul3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT" "") -(define_insn "*muldf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +; mxbr mdbr, meebr, mxb, mxb, meeb +(define_insn "*mul3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - mdbr\t%0,%2 - mdb\t%0,%2" + mbr\t%0,%2 + mb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) + (set_attr "type" "fmul")]) -(define_insn "*muldf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +; mxr, mdr, mer, mx, md, me +(define_insn "*mul3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - mdr\t%0,%2 - md\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fmuld")]) + mr\t%0,%2 + m\t%0,%2" + [(set_attr "op_type" ",") + (set_attr "type" "fmul")]) -(define_insn "*fmadddf" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f") - (match_operand:DF 2 "nonimmediate_operand" "f,R")) - (match_operand:DF 3 "register_operand" "0,0")))] +; maxbr, madbr, maebr, maxb, madb, maeb +(define_insn "*fmadd" + [(set (match_operand:DSF 0 "register_operand" "=f,f") + (plus:DSF (mult:DSF (match_operand:DSF 1 "register_operand" "%f,f") + (match_operand:DSF 2 "nonimmediate_operand" "f,R")) + (match_operand:DSF 3 "register_operand" "0,0")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" "@ - madbr\t%0,%1,%2 - madb\t%0,%1,%2" + mabr\t%0,%1,%2 + mab\t%0,%1,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) + (set_attr "type" "fmul")]) -(define_insn "*fmsubdf" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f") - (match_operand:DF 2 "nonimmediate_operand" "f,R")) - (match_operand:DF 3 "register_operand" "0,0")))] +; msxbr, msdbr, msebr, msxb, msdb, mseb +(define_insn "*fmsub" + [(set (match_operand:DSF 0 "register_operand" "=f,f") + (minus:DSF (mult:DSF (match_operand:DSF 1 "register_operand" "f,f") + (match_operand:DSF 2 "nonimmediate_operand" "f,R")) + (match_operand:DSF 3 "register_operand" "0,0")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" "@ - msdbr\t%0,%1,%2 - msdb\t%0,%1,%2" + msbr\t%0,%1,%2 + msb\t%0,%1,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) - -; -; mulsf3 instruction pattern(s). -; - -(define_expand "mulsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*mulsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - meebr\t%0,%2 - meeb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) - -(define_insn "*mulsf3_ibm" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - mer\t%0,%2 - me\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fmuls")]) - -(define_insn "*fmaddsf" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f") - (match_operand:SF 2 "nonimmediate_operand" "f,R")) - (match_operand:SF 3 "register_operand" "0,0")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" - "@ - maebr\t%0,%1,%2 - maeb\t%0,%1,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) - -(define_insn "*fmsubsf" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f") - (match_operand:SF 2 "nonimmediate_operand" "f,R")) - (match_operand:SF 3 "register_operand" "0,0")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" - "@ - msebr\t%0,%1,%2 - mseb\t%0,%1,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) + (set_attr "type" "fmul")]) ;; ;;- Divide and modulo instructions. @@ -4586,14 +4558,12 @@ (define_insn "divmodtidi3" [(set (match_operand:TI 0 "register_operand" "=d,d") (ior:TI - (zero_extend:TI - (div:DI (match_operand:DI 1 "register_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m"))) (ashift:TI (zero_extend:TI - (mod:DI (match_dup 1) - (match_dup 2))) - (const_int 64))))] + (mod:DI (match_operand:DI 1 "register_operand" "0,0") + (match_operand:DI 2 "general_operand" "d,m"))) + (const_int 64)) + (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))] "TARGET_64BIT" "@ dsgr\t%0,%2 @@ -4604,14 +4574,14 @@ (define_insn "divmodtisi3" [(set (match_operand:TI 0 "register_operand" "=d,d") (ior:TI - (zero_extend:TI - (div:DI (match_operand:DI 1 "register_operand" "0,0") - (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m")))) (ashift:TI (zero_extend:TI - (mod:DI (match_dup 1) - (sign_extend:DI (match_dup 2)))) - (const_int 64))))] + (mod:DI (match_operand:DI 1 "register_operand" "0,0") + (sign_extend:DI + (match_operand:SI 2 "nonimmediate_operand" "d,m")))) + (const_int 64)) + (zero_extend:TI + (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))] "TARGET_64BIT" "@ dsgfr\t%0,%2 @@ -4637,10 +4607,10 @@ div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]); mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]); equal = gen_rtx_IOR (TImode, - gen_rtx_ZERO_EXTEND (TImode, div_equal), gen_rtx_ASHIFT (TImode, gen_rtx_ZERO_EXTEND (TImode, mod_equal), - GEN_INT (64))); + GEN_INT (64)), + gen_rtx_ZERO_EXTEND (TImode, div_equal)); operands[4] = gen_reg_rtx(TImode); emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4])); @@ -4663,16 +4633,17 @@ (define_insn "udivmodtidi3" [(set (match_operand:TI 0 "register_operand" "=d,d") - (ior:TI (zero_extend:TI - (truncate:DI - (udiv:TI (match_operand:TI 1 "register_operand" "0,0") - (zero_extend:TI - (match_operand:DI 2 "nonimmediate_operand" "d,m"))))) - (ashift:TI - (zero_extend:TI - (truncate:DI - (umod:TI (match_dup 1) (zero_extend:TI (match_dup 2))))) - (const_int 64))))] + (ior:TI + (ashift:TI + (zero_extend:TI + (truncate:DI + (umod:TI (match_operand:TI 1 "register_operand" "0,0") + (zero_extend:TI + (match_operand:DI 2 "nonimmediate_operand" "d,m"))))) + (const_int 64)) + (zero_extend:TI + (truncate:DI + (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))] "TARGET_64BIT" "@ dlgr\t%0,%2 @@ -4698,10 +4669,10 @@ div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]); mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]); equal = gen_rtx_IOR (DImode, - gen_rtx_ZERO_EXTEND (DImode, div_equal), gen_rtx_ASHIFT (DImode, gen_rtx_ZERO_EXTEND (DImode, mod_equal), - GEN_INT (32))); + GEN_INT (32)), + gen_rtx_ZERO_EXTEND (DImode, div_equal)); operands[4] = gen_reg_rtx(DImode); emit_insn (gen_extendsidi2 (operands[4], operands[1])); @@ -4722,16 +4693,17 @@ (define_insn "divmoddisi3" [(set (match_operand:DI 0 "register_operand" "=d,d") - (ior:DI (zero_extend:DI - (truncate:SI - (div:DI (match_operand:DI 1 "register_operand" "0,0") - (sign_extend:DI - (match_operand:SI 2 "nonimmediate_operand" "d,R"))))) - (ashift:DI - (zero_extend:DI - (truncate:SI - (mod:DI (match_dup 1) (sign_extend:DI (match_dup 2))))) - (const_int 32))))] + (ior:DI + (ashift:DI + (zero_extend:DI + (truncate:SI + (mod:DI (match_operand:DI 1 "register_operand" "0,0") + (sign_extend:DI + (match_operand:SI 2 "nonimmediate_operand" "d,R"))))) + (const_int 32)) + (zero_extend:DI + (truncate:SI + (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))] "!TARGET_64BIT" "@ dr\t%0,%2 @@ -4757,10 +4729,10 @@ div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); equal = gen_rtx_IOR (DImode, - gen_rtx_ZERO_EXTEND (DImode, div_equal), gen_rtx_ASHIFT (DImode, gen_rtx_ZERO_EXTEND (DImode, mod_equal), - GEN_INT (32))); + GEN_INT (32)), + gen_rtx_ZERO_EXTEND (DImode, div_equal)); operands[4] = gen_reg_rtx(DImode); emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4])); @@ -4783,16 +4755,17 @@ (define_insn "udivmoddisi3" [(set (match_operand:DI 0 "register_operand" "=d,d") - (ior:DI (zero_extend:DI - (truncate:SI - (udiv:DI (match_operand:DI 1 "register_operand" "0,0") - (zero_extend:DI - (match_operand:SI 2 "nonimmediate_operand" "d,m"))))) - (ashift:DI - (zero_extend:DI - (truncate:SI - (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2))))) - (const_int 32))))] + (ior:DI + (ashift:DI + (zero_extend:DI + (truncate:SI + (umod:DI (match_operand:DI 1 "register_operand" "0,0") + (zero_extend:DI + (match_operand:SI 2 "nonimmediate_operand" "d,m"))))) + (const_int 32)) + (zero_extend:DI + (truncate:SI + (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))] "!TARGET_64BIT && TARGET_CPU_ZARCH" "@ dlr\t%0,%2 @@ -4812,10 +4785,10 @@ udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); equal = gen_rtx_IOR (DImode, - gen_rtx_ZERO_EXTEND (DImode, udiv_equal), gen_rtx_ASHIFT (DImode, gen_rtx_ZERO_EXTEND (DImode, umod_equal), - GEN_INT (32))); + GEN_INT (32)), + gen_rtx_ZERO_EXTEND (DImode, udiv_equal)); operands[3] = gen_reg_rtx (DImode); @@ -4864,7 +4837,7 @@ emit_move_insn (operands[0], const0_rtx); emit_insn (gen_cmpsi (operands[2], operands[1])); emit_jump_insn (gen_bgtu (label3)); - emit_insn (gen_cmpsi (operands[2], const1_rtx)); + emit_insn (gen_cmpsi (operands[2], const0_rtx)); emit_jump_insn (gen_blt (label2)); emit_insn (gen_cmpsi (operands[2], const1_rtx)); emit_jump_insn (gen_beq (label1)); @@ -4903,10 +4876,10 @@ udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); equal = gen_rtx_IOR (DImode, - gen_rtx_ZERO_EXTEND (DImode, udiv_equal), gen_rtx_ASHIFT (DImode, gen_rtx_ZERO_EXTEND (DImode, umod_equal), - GEN_INT (32))); + GEN_INT (32)), + gen_rtx_ZERO_EXTEND (DImode, udiv_equal)); operands[3] = gen_reg_rtx (DImode); @@ -4956,7 +4929,7 @@ emit_move_insn(operands[0], operands[1]); emit_insn (gen_cmpsi (operands[2], operands[1])); emit_jump_insn (gen_bgtu (label3)); - emit_insn (gen_cmpsi (operands[2], const1_rtx)); + emit_insn (gen_cmpsi (operands[2], const0_rtx)); emit_jump_insn (gen_blt (label2)); emit_insn (gen_cmpsi (operands[2], const1_rtx)); emit_jump_insn (gen_beq (label1)); @@ -4983,82 +4956,59 @@ }) ; -; divdf3 instruction pattern(s). +; div(df|sf)3 instruction pattern(s). ; -(define_expand "divdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +(define_expand "div3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT" "") -(define_insn "*divdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +; dxbr, ddbr, debr, dxb, ddb, deb +(define_insn "*div3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - ddbr\t%0,%2 - ddb\t%0,%2" + dbr\t%0,%2 + db\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fdivd")]) + (set_attr "type" "fdiv")]) -(define_insn "*divdf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] +; dxr, ddr, der, dx, dd, de +(define_insn "*div3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,")))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - ddr\t%0,%2 - dd\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fdivd")]) - -; -; divsf3 instruction pattern(s). -; - -(define_expand "divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - debr\t%0,%2 - deb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fdivs")]) - -(define_insn "*divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - der\t%0,%2 - de\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fdivs")]) + dr\t%0,%2 + d\t%0,%2" + [(set_attr "op_type" ",") + (set_attr "type" "fdiv")]) ;; ;;- And instructions. ;; +(define_expand "and3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (and:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (AND, mode, operands); DONE;") + ; ; anddi3 instruction pattern(s). ; (define_insn "*anddi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5071,239 +5021,299 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*anddi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) (clobber (match_scratch:DI 0 "=d,d"))] - "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" + "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT + /* Do not steal TM patterns. */ + && s390_single_part (operands[2], DImode, HImode, 0) < 0" "@ ngr\t%0,%2 ng\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "anddi3" - [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0") - (match_operand:DI 2 "general_operand" - "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - # - # - nihh\t%0,%j2 - nihl\t%0,%j2 - nilh\t%0,%j2 - nill\t%0,%j2 - ngr\t%0,%2 - ng\t%0,%2" - [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")]) +(define_insn "*anddi3_extimm" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,d,d,AQ,Q") + (and:DI (match_operand:DI 1 "nonimmediate_operand" + "%d,o,0,0,0,0,0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" + "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,m,NxQDF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" + "@ + # + # + nihh\t%0,%j2 + nihl\t%0,%j2 + nilh\t%0,%j2 + nill\t%0,%j2 + nihf\t%0,%m2 + nilf\t%0,%m2 + ngr\t%0,%2 + ng\t%0,%2 + # + #" + [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")]) -(define_insn "*anddi3_ss" - [(set (match_operand:DI 0 "s_operand" "=Q") - (and:DI (match_dup 0) - (match_operand:DI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_insn "*anddi3" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q") + (and:DI (match_operand:DI 1 "nonimmediate_operand" + "%d,o,0,0,0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" + "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" + "@ + # + # + nihh\t%0,%j2 + nihl\t%0,%j2 + nilh\t%0,%j2 + nill\t%0,%j2 + ngr\t%0,%2 + ng\t%0,%2 + # + #" + [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY,SI,SS")]) + +(define_split + [(set (match_operand:DI 0 "s_operand" "") + (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") -(define_insn "*anddi3_ss_inv" - [(set (match_operand:DI 0 "s_operand" "=Q") - (and:DI (match_operand:DI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) ; ; andsi3 instruction pattern(s). ; (define_insn "*andsi3_cc" - [(set (reg 33) - (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") + (set (match_operand:SI 0 "register_operand" "=d,d,d,d") (and:SI (match_dup 1) (match_dup 2)))] "s390_match_ccmode(insn, CCTmode)" "@ + nilf\t%0,%o2 nr\t%0,%2 n\t%0,%2 ny\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RIL,RR,RX,RXY")]) (define_insn "*andsi3_cconly" - [(set (reg 33) - (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (clobber (match_scratch:SI 0 "=d,d,d"))] - "s390_match_ccmode(insn, CCTmode)" + (clobber (match_scratch:SI 0 "=d,d,d,d"))] + "s390_match_ccmode(insn, CCTmode) + /* Do not steal TM patterns. */ + && s390_single_part (operands[2], SImode, HImode, 0) < 0" "@ + nilf\t%0,%o2 nr\t%0,%2 n\t%0,%2 ny\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) - -(define_expand "andsi3" - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] - "" - "") + [(set_attr "op_type" "RIL,RR,RX,RXY")]) (define_insn "*andsi3_zarch" - [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0") - (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q") + (and:SI (match_operand:SI 1 "nonimmediate_operand" + "%d,o,0,0,0,0,0,0,0,0") + (match_operand:SI 2 "general_operand" + "M,M,N0HSF,N1HSF,Os,d,R,T,NxQSF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ # # nilh\t%0,%j2 - nill\t%0,%j2 + nill\t%0,%j2 + nilf\t%0,%o2 nr\t%0,%2 n\t%0,%2 - ny\t%0,%2" - [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")]) + ny\t%0,%2 + # + #" + [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RX,RXY,SI,SS")]) (define_insn "*andsi3_esa" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") - (match_operand:SI 2 "general_operand" "d,R"))) - (clobber (reg:CC 33))] - "!TARGET_ZARCH" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "d,R,NxQSF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 - n\t%0,%2" - [(set_attr "op_type" "RR,RX")]) + n\t%0,%2 + # + #" + [(set_attr "op_type" "RR,RX,SI,SS")]) -(define_insn "*andsi3_ss" - [(set (match_operand:SI 0 "s_operand" "=Q") - (and:SI (match_dup 0) - (match_operand:SI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*andsi3_ss_inv" - [(set (match_operand:SI 0 "s_operand" "=Q") - (and:SI (match_operand:SI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:SI 0 "s_operand" "") + (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") ; ; andhi3 instruction pattern(s). ; -(define_insn "*andhi3_ni" - [(set (match_operand:HI 0 "register_operand" "=d,d") - (and:HI (match_operand:HI 1 "register_operand" "%0,0") - (match_operand:HI 2 "nonmemory_operand" "d,n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" +(define_insn "*andhi3_zarch" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:HI 2 "general_operand" "d,n,NxQHF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 - nill\t%0,%x2" - [(set_attr "op_type" "RR,RI")]) + nill\t%0,%x2 + # + #" + [(set_attr "op_type" "RR,RI,SI,SS")]) -(define_insn "andhi3" - [(set (match_operand:HI 0 "register_operand" "=d") - (and:HI (match_operand:HI 1 "register_operand" "%0") - (match_operand:HI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "nr\t%0,%2" - [(set_attr "op_type" "RR")]) +(define_insn "*andhi3_esa" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") + (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") + (match_operand:HI 2 "general_operand" "d,NxQHF,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" + "@ + nr\t%0,%2 + # + #" + [(set_attr "op_type" "RR,SI,SS")]) -(define_insn "*andhi3_ss" - [(set (match_operand:HI 0 "s_operand" "=Q") - (and:HI (match_dup 0) - (match_operand:HI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*andhi3_ss_inv" - [(set (match_operand:HI 0 "s_operand" "=Q") - (and:HI (match_operand:HI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "nc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:HI 0 "s_operand" "") + (and:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") ; ; andqi3 instruction pattern(s). ; -(define_insn "*andqi3_ni" - [(set (match_operand:QI 0 "register_operand" "=d,d") - (and:QI (match_operand:QI 1 "register_operand" "%0,0") - (match_operand:QI 2 "nonmemory_operand" "d,n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" +(define_insn "*andqi3_zarch" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q") + (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:QI 2 "general_operand" "d,n,n,n,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 - nill\t%0,%b2" - [(set_attr "op_type" "RR,RI")]) + nill\t%0,%b2 + ni\t%S0,%b2 + niy\t%S0,%b2 + #" + [(set_attr "op_type" "RR,RI,SI,SIY,SS")]) -(define_insn "andqi3" - [(set (match_operand:QI 0 "register_operand" "=d") - (and:QI (match_operand:QI 1 "register_operand" "%0") - (match_operand:QI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "nr\t%0,%2" - [(set_attr "op_type" "RR")]) - -(define_insn "*andqi3_ss" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (and:QI (match_dup 0) - (match_operand:QI 1 "s_imm_operand" "n,n,Q"))) - (clobber (reg:CC 33))] - "" +(define_insn "*andqi3_esa" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") + (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") + (match_operand:QI 2 "general_operand" "d,n,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ - ni\t%0,%b1 - niy\t%0,%b1 - nc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) + nr\t%0,%2 + ni\t%S0,%b2 + #" + [(set_attr "op_type" "RR,SI,SS")]) -(define_insn "*andqi3_ss_inv" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "@ - ni\t%0,%b1 - niy\t%0,%b1 - nc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) +; +; Block and (NC) patterns. +; + +(define_insn "*nc" + [(set (match_operand:BLK 0 "memory_operand" "=Q") + (and:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" "Q"))) + (use (match_operand 2 "const_int_operand" "n")) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" + "nc\t%O0(%2,%R0),%S1" + [(set_attr "op_type" "SS")]) + +(define_split + [(set (match_operand 0 "memory_operand" "") + (and (match_dup 0) + (match_operand 1 "memory_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed + && GET_MODE (operands[0]) == GET_MODE (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" + [(parallel + [(set (match_dup 0) (and:BLK (match_dup 0) (match_dup 1))) + (use (match_dup 2)) + (clobber (reg:CC CC_REGNUM))])] +{ + operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); + operands[0] = adjust_address (operands[0], BLKmode, 0); + operands[1] = adjust_address (operands[1], BLKmode, 0); +}) + +(define_peephole2 + [(parallel + [(set (match_operand:BLK 0 "memory_operand" "") + (and:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_operand:BLK 3 "memory_operand" "") + (and:BLK (match_dup 3) + (match_operand:BLK 4 "memory_operand" ""))) + (use (match_operand 5 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))])] + "s390_offset_p (operands[0], operands[3], operands[2]) + && s390_offset_p (operands[1], operands[4], operands[2]) + && !s390_overlap_p (operands[0], operands[1], + INTVAL (operands[2]) + INTVAL (operands[5])) + && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" + [(parallel + [(set (match_dup 6) (and:BLK (match_dup 6) (match_dup 7))) + (use (match_dup 8)) + (clobber (reg:CC CC_REGNUM))])] + "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); + operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); + operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") ;; ;;- Bit set (inclusive or) instructions. ;; +(define_expand "ior3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (ior:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (IOR, mode, operands); DONE;") + ; ; iordi3 instruction pattern(s). ; (define_insn "*iordi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5316,7 +5326,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*iordi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5327,223 +5337,273 @@ og\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "iordi3" - [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d") - (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0") - (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" +(define_insn "*iordi3_extimm" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q") + (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" + "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,m,NxQD0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" + "@ + oihh\t%0,%i2 + oihl\t%0,%i2 + oilh\t%0,%i2 + oill\t%0,%i2 + oihf\t%0,%k2 + oilf\t%0,%k2 + ogr\t%0,%2 + og\t%0,%2 + # + #" + [(set_attr "op_type" "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")]) + +(define_insn "*iordi3" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q") + (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" + "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" "@ oihh\t%0,%i2 oihl\t%0,%i2 oilh\t%0,%i2 oill\t%0,%i2 ogr\t%0,%2 - og\t%0,%2" - [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")]) + og\t%0,%2 + # + #" + [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY,SI,SS")]) -(define_insn "*iordi3_ss" - [(set (match_operand:DI 0 "s_operand" "=Q") - (ior:DI (match_dup 0) - (match_operand:DI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*iordi3_ss_inv" - [(set (match_operand:DI 0 "s_operand" "=Q") - (ior:DI (match_operand:DI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:DI 0 "s_operand" "") + (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") ; ; iorsi3 instruction pattern(s). ; (define_insn "*iorsi3_cc" - [(set (reg 33) - (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") + (set (match_operand:SI 0 "register_operand" "=d,d,d,d") (ior:SI (match_dup 1) (match_dup 2)))] "s390_match_ccmode(insn, CCTmode)" "@ + oilf\t%0,%o2 or\t%0,%2 o\t%0,%2 oy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RIL,RR,RX,RXY")]) (define_insn "*iorsi3_cconly" - [(set (reg 33) - (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (clobber (match_scratch:SI 0 "=d,d,d"))] + (clobber (match_scratch:SI 0 "=d,d,d,d"))] "s390_match_ccmode(insn, CCTmode)" "@ + oilf\t%0,%o2 or\t%0,%2 o\t%0,%2 oy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RIL,RR,RX,RXY")]) -(define_expand "iorsi3" - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] - "" - "") - -(define_insn "iorsi3_zarch" - [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0") - (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" +(define_insn "*iorsi3_zarch" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q") + (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0") + (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,Os,d,R,T,NxQS0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ oilh\t%0,%i2 oill\t%0,%i2 + oilf\t%0,%o2 or\t%0,%2 o\t%0,%2 - oy\t%0,%2" - [(set_attr "op_type" "RI,RI,RR,RX,RXY")]) + oy\t%0,%2 + # + #" + [(set_attr "op_type" "RI,RI,RIL,RR,RX,RXY,SI,SS")]) -(define_insn "iorsi3_esa" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:SI 2 "general_operand" "d,R"))) - (clobber (reg:CC 33))] - "!TARGET_ZARCH" +(define_insn "*iorsi3_esa" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "d,R,NxQS0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 - o\t%0,%2" - [(set_attr "op_type" "RR,RX")]) + o\t%0,%2 + # + #" + [(set_attr "op_type" "RR,RX,SI,SS")]) -(define_insn "*iorsi3_ss" - [(set (match_operand:SI 0 "s_operand" "=Q") - (ior:SI (match_dup 0) - (match_operand:SI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*iorsi3_ss_inv" - [(set (match_operand:SI 0 "s_operand" "=Q") - (ior:SI (match_operand:SI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:SI 0 "s_operand" "") + (ior:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") ; ; iorhi3 instruction pattern(s). ; -(define_insn "*iorhi3_oi" - [(set (match_operand:HI 0 "register_operand" "=d,d") - (ior:HI (match_operand:HI 1 "register_operand" "%0,0") - (match_operand:HI 2 "nonmemory_operand" "d,n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" +(define_insn "*iorhi3_zarch" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:HI 2 "general_operand" "d,n,NxQH0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 - oill\t%0,%x2" - [(set_attr "op_type" "RR,RI")]) + oill\t%0,%x2 + # + #" + [(set_attr "op_type" "RR,RI,SI,SS")]) -(define_insn "iorhi3" - [(set (match_operand:HI 0 "register_operand" "=d") - (ior:HI (match_operand:HI 1 "register_operand" "%0") - (match_operand:HI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "or\t%0,%2" - [(set_attr "op_type" "RR")]) +(define_insn "*iorhi3_esa" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") + (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") + (match_operand:HI 2 "general_operand" "d,NxQH0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" + "@ + or\t%0,%2 + # + #" + [(set_attr "op_type" "RR,SI,SS")]) -(define_insn "*iorhi3_ss" - [(set (match_operand:HI 0 "s_operand" "=Q") - (ior:HI (match_dup 0) - (match_operand:HI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*iorhi3_ss_inv" - [(set (match_operand:HI 0 "s_operand" "=Q") - (ior:HI (match_operand:HI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "oc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:HI 0 "s_operand" "") + (ior:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") ; ; iorqi3 instruction pattern(s). ; -(define_insn "*iorqi3_oi" - [(set (match_operand:QI 0 "register_operand" "=d,d") - (ior:QI (match_operand:QI 1 "register_operand" "%0,0") - (match_operand:QI 2 "nonmemory_operand" "d,n"))) - (clobber (reg:CC 33))] - "TARGET_ZARCH" +(define_insn "*iorqi3_zarch" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q") + (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:QI 2 "general_operand" "d,n,n,n,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 - oill\t%0,%b2" - [(set_attr "op_type" "RR,RI")]) + oill\t%0,%b2 + oi\t%S0,%b2 + oiy\t%S0,%b2 + #" + [(set_attr "op_type" "RR,RI,SI,SIY,SS")]) -(define_insn "iorqi3" - [(set (match_operand:QI 0 "register_operand" "=d") - (ior:QI (match_operand:QI 1 "register_operand" "%0") - (match_operand:QI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "or\t%0,%2" - [(set_attr "op_type" "RR")]) - -(define_insn "*iorqi3_ss" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (ior:QI (match_dup 0) - (match_operand:QI 1 "s_imm_operand" "n,n,Q"))) - (clobber (reg:CC 33))] - "" +(define_insn "*iorqi3_esa" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") + (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") + (match_operand:QI 2 "general_operand" "d,n,Q"))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ - oi\t%0,%b1 - oiy\t%0,%b1 - oc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) + or\t%0,%2 + oi\t%S0,%b2 + #" + [(set_attr "op_type" "RR,SI,SS")]) -(define_insn "*iorqi3_ss_inv" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "@ - oi\t%0,%b1 - oiy\t%0,%b1 - oc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) +; +; Block inclusive or (OC) patterns. +; + +(define_insn "*oc" + [(set (match_operand:BLK 0 "memory_operand" "=Q") + (ior:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" "Q"))) + (use (match_operand 2 "const_int_operand" "n")) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" + "oc\t%O0(%2,%R0),%S1" + [(set_attr "op_type" "SS")]) + +(define_split + [(set (match_operand 0 "memory_operand" "") + (ior (match_dup 0) + (match_operand 1 "memory_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed + && GET_MODE (operands[0]) == GET_MODE (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" + [(parallel + [(set (match_dup 0) (ior:BLK (match_dup 0) (match_dup 1))) + (use (match_dup 2)) + (clobber (reg:CC CC_REGNUM))])] +{ + operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); + operands[0] = adjust_address (operands[0], BLKmode, 0); + operands[1] = adjust_address (operands[1], BLKmode, 0); +}) + +(define_peephole2 + [(parallel + [(set (match_operand:BLK 0 "memory_operand" "") + (ior:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_operand:BLK 3 "memory_operand" "") + (ior:BLK (match_dup 3) + (match_operand:BLK 4 "memory_operand" ""))) + (use (match_operand 5 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))])] + "s390_offset_p (operands[0], operands[3], operands[2]) + && s390_offset_p (operands[1], operands[4], operands[2]) + && !s390_overlap_p (operands[0], operands[1], + INTVAL (operands[2]) + INTVAL (operands[5])) + && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" + [(parallel + [(set (match_dup 6) (ior:BLK (match_dup 6) (match_dup 7))) + (use (match_dup 8)) + (clobber (reg:CC CC_REGNUM))])] + "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); + operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); + operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") ;; ;;- Xor instructions. ;; +(define_expand "xor3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (xor:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (XOR, mode, operands); DONE;") + ; ; xordi3 instruction pattern(s). ; (define_insn "*xordi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5556,7 +5616,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*xordi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5567,163 +5627,237 @@ xr\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "xordi3" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" +(define_insn "*xordi3_extimm" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q") + (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0") + (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,m,NxQD0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" + "@ + xihf\t%0,%k2 + xilf\t%0,%k2 + xgr\t%0,%2 + xg\t%0,%2 + # + #" + [(set_attr "op_type" "RIL,RIL,RRE,RXY,SI,SS")]) + +(define_insn "*xordi3" + [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)" "@ xgr\t%0,%2 - xg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) + xg\t%0,%2 + # + #" + [(set_attr "op_type" "RRE,RXY,SI,SS")]) -(define_insn "*xordi3_ss" - [(set (match_operand:DI 0 "s_operand" "=Q") - (xor:DI (match_dup 0) - (match_operand:DI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*xordi3_ss_inv" - [(set (match_operand:DI 0 "s_operand" "=Q") - (xor:DI (match_operand:DI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(8,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:DI 0 "s_operand" "") + (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") ; ; xorsi3 instruction pattern(s). ; (define_insn "*xorsi3_cc" - [(set (reg 33) - (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d,d") + (set (match_operand:SI 0 "register_operand" "=d,d,d,d") (xor:SI (match_dup 1) (match_dup 2)))] "s390_match_ccmode(insn, CCTmode)" "@ + xilf\t%0,%o2 xr\t%0,%2 x\t%0,%2 xy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RIL,RR,RX,RXY")]) (define_insn "*xorsi3_cconly" - [(set (reg 33) - (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T")) + [(set (reg CC_REGNUM) + (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T")) (const_int 0))) - (clobber (match_scratch:SI 0 "=d,d,d"))] + (clobber (match_scratch:SI 0 "=d,d,d,d"))] "s390_match_ccmode(insn, CCTmode)" "@ + xilf\t%0,%o2 xr\t%0,%2 x\t%0,%2 xy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + [(set_attr "op_type" "RIL,RR,RX,RXY")]) -(define_insn "xorsi3" - [(set (match_operand:SI 0 "register_operand" "=d,d,d") - (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") - (match_operand:SI 2 "general_operand" "d,R,T"))) - (clobber (reg:CC 33))] - "" +(define_insn "*xorsi3" + [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q") + (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0,0") + (match_operand:SI 2 "general_operand" "Os,d,R,T,NxQS0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "s390_logical_operator_ok_p (operands)" "@ + xilf\t%0,%o2 xr\t%0,%2 x\t%0,%2 - xy\t%0,%2" - [(set_attr "op_type" "RR,RX,RXY")]) + xy\t%0,%2 + # + #" + [(set_attr "op_type" "RIL,RR,RX,RXY,SI,SS")]) -(define_insn "*xorsi3_ss" - [(set (match_operand:SI 0 "s_operand" "=Q") - (xor:SI (match_dup 0) - (match_operand:SI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*xorsi3_ss_inv" - [(set (match_operand:SI 0 "s_operand" "=Q") - (xor:SI (match_operand:SI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(4,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:SI 0 "s_operand" "") + (xor:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") ; ; xorhi3 instruction pattern(s). ; -(define_insn "xorhi3" - [(set (match_operand:HI 0 "register_operand" "=d") - (xor:HI (match_operand:HI 1 "register_operand" "%0") - (match_operand:HI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "xr\t%0,%2" - [(set_attr "op_type" "RR")]) +(define_insn "*xorhi3" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q") + (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0") + (match_operand:HI 2 "general_operand" "Os,d,NxQH0,Q"))) + (clobber (reg:CC CC_REGNUM))] + "s390_logical_operator_ok_p (operands)" + "@ + xilf\t%0,%x2 + xr\t%0,%2 + # + #" + [(set_attr "op_type" "RIL,RR,SI,SS")]) -(define_insn "*xorhi3_ss" - [(set (match_operand:HI 0 "s_operand" "=Q") - (xor:HI (match_dup 0) - (match_operand:HI 1 "s_imm_operand" "Q"))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) - -(define_insn "*xorhi3_ss_inv" - [(set (match_operand:HI 0 "s_operand" "=Q") - (xor:HI (match_operand:HI 1 "s_imm_operand" "Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "xc\t%O0(2,%R0),%1" - [(set_attr "op_type" "SS")]) +(define_split + [(set (match_operand:HI 0 "s_operand" "") + (xor:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed" + [(parallel + [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) + (clobber (reg:CC CC_REGNUM))])] + "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") ; ; xorqi3 instruction pattern(s). ; -(define_insn "xorqi3" - [(set (match_operand:QI 0 "register_operand" "=d") - (xor:QI (match_operand:QI 1 "register_operand" "%0") - (match_operand:QI 2 "nonmemory_operand" "d"))) - (clobber (reg:CC 33))] - "" - "xr\t%0,%2" - [(set_attr "op_type" "RR")]) - -(define_insn "*xorqi3_ss" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (xor:QI (match_dup 0) - (match_operand:QI 1 "s_imm_operand" "n,n,Q"))) - (clobber (reg:CC 33))] - "" +(define_insn "*xorqi3" + [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q") + (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0") + (match_operand:QI 2 "general_operand" "Os,d,n,n,Q"))) + (clobber (reg:CC CC_REGNUM))] + "s390_logical_operator_ok_p (operands)" "@ - xi\t%0,%b1 - xiy\t%0,%b1 - xc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) + xilf\t%0,%b2 + xr\t%0,%2 + xi\t%S0,%b2 + xiy\t%S0,%b2 + #" + [(set_attr "op_type" "RIL,RR,SI,SIY,SS")]) -(define_insn "*xorqi3_ss_inv" - [(set (match_operand:QI 0 "s_operand" "=Q,S,Q") - (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q") - (match_dup 0))) - (clobber (reg:CC 33))] - "" - "@ - xi\t%0,%b1 - xiy\t%0,%b1 - xc\t%O0(1,%R0),%1" - [(set_attr "op_type" "SI,SIY,SS")]) +; +; Block exclusive or (XC) patterns. +; + +(define_insn "*xc" + [(set (match_operand:BLK 0 "memory_operand" "=Q") + (xor:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" "Q"))) + (use (match_operand 2 "const_int_operand" "n")) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" + "xc\t%O0(%2,%R0),%S1" + [(set_attr "op_type" "SS")]) + +(define_split + [(set (match_operand 0 "memory_operand" "") + (xor (match_dup 0) + (match_operand 1 "memory_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "reload_completed + && GET_MODE (operands[0]) == GET_MODE (operands[1]) + && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" + [(parallel + [(set (match_dup 0) (xor:BLK (match_dup 0) (match_dup 1))) + (use (match_dup 2)) + (clobber (reg:CC CC_REGNUM))])] +{ + operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); + operands[0] = adjust_address (operands[0], BLKmode, 0); + operands[1] = adjust_address (operands[1], BLKmode, 0); +}) + +(define_peephole2 + [(parallel + [(set (match_operand:BLK 0 "memory_operand" "") + (xor:BLK (match_dup 0) + (match_operand:BLK 1 "memory_operand" ""))) + (use (match_operand 2 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_operand:BLK 3 "memory_operand" "") + (xor:BLK (match_dup 3) + (match_operand:BLK 4 "memory_operand" ""))) + (use (match_operand 5 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))])] + "s390_offset_p (operands[0], operands[3], operands[2]) + && s390_offset_p (operands[1], operands[4], operands[2]) + && !s390_overlap_p (operands[0], operands[1], + INTVAL (operands[2]) + INTVAL (operands[5])) + && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" + [(parallel + [(set (match_dup 6) (xor:BLK (match_dup 6) (match_dup 7))) + (use (match_dup 8)) + (clobber (reg:CC CC_REGNUM))])] + "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); + operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); + operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") + +; +; Block xor (XC) patterns with src == dest. +; + +(define_insn "*xc_zero" + [(set (match_operand:BLK 0 "memory_operand" "=Q") + (const_int 0)) + (use (match_operand 1 "const_int_operand" "n")) + (clobber (reg:CC CC_REGNUM))] + "INTVAL (operands[1]) >= 1 && INTVAL (operands[1]) <= 256" + "xc\t%O0(%1,%R0),%S0" + [(set_attr "op_type" "SS")]) + +(define_peephole2 + [(parallel + [(set (match_operand:BLK 0 "memory_operand" "") + (const_int 0)) + (use (match_operand 1 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (match_operand:BLK 2 "memory_operand" "") + (const_int 0)) + (use (match_operand 3 "const_int_operand" "")) + (clobber (reg:CC CC_REGNUM))])] + "s390_offset_p (operands[0], operands[2], operands[1]) + && INTVAL (operands[1]) + INTVAL (operands[3]) <= 256" + [(parallel + [(set (match_dup 4) (const_int 0)) + (use (match_dup 5)) + (clobber (reg:CC CC_REGNUM))])] + "operands[4] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); + operands[5] = GEN_INT (INTVAL (operands[1]) + INTVAL (operands[3]));") ;; @@ -5731,116 +5865,149 @@ ;; ; -; negdi2 instruction pattern(s). +; neg(di|si)2 instruction pattern(s). ; -(define_expand "negdi2" +(define_expand "neg2" [(parallel - [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))])] + [(set (match_operand:DSI 0 "register_operand" "=d") + (neg:DSI (match_operand:DSI 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))])] "" "") -(define_insn "*negdi2_64" +(define_insn "*negdi2_sign_cc" + [(set (reg CC_REGNUM) + (compare (neg:DI (ashiftrt:DI (ashift:DI (subreg:DI + (match_operand:SI 1 "register_operand" "d") 0) + (const_int 32)) (const_int 32))) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=d") + (neg:DI (sign_extend:DI (match_dup 1))))] + "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "lcgfr\t%0,%1" + [(set_attr "op_type" "RRE")]) + +(define_insn "*negdi2_sign" [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] + (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" - "lcgr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lcgfr\t%0,%1" + [(set_attr "op_type" "RRE")]) -(define_insn "*negdi2_31" +; lcr, lcgr +(define_insn "*neg2_cc" + [(set (reg CC_REGNUM) + (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (match_dup 1)))] + "s390_match_ccmode (insn, CCAmode)" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lcr, lcgr +(define_insn "*neg2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode (insn, CCAmode)" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lcr, lcgr +(define_insn "*neg2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (match_operand:GPR 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))] + "" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) + +(define_insn_and_split "*negdi2_31" [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" -{ - rtx xop[1]; - xop[0] = gen_label_rtx (); - output_asm_insn ("lcr\t%0,%1", operands); - output_asm_insn ("lcr\t%N0,%N1", operands); - output_asm_insn ("je\t%l0", xop); - output_asm_insn ("bctr\t%0,0", operands); - targetm.asm_out.internal_label (asm_out_file, "L", - CODE_LABEL_NUMBER (xop[0])); - return ""; -} - [(set_attr "op_type" "NN") - (set_attr "type" "other") - (set_attr "length" "10")]) - -; -; negsi2 instruction pattern(s). -; - -(define_insn "negsi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "" - "lcr\t%0,%1" - [(set_attr "op_type" "RR")]) - -; -; negdf2 instruction pattern(s). -; - -(define_expand "negdf2" + "#" + "&& reload_completed" [(parallel - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] + [(set (match_dup 2) (neg:SI (match_dup 3))) + (clobber (reg:CC CC_REGNUM))]) + (parallel + [(set (reg:CCAP CC_REGNUM) + (compare:CCAP (neg:SI (match_dup 5)) (const_int 0))) + (set (match_dup 4) (neg:SI (match_dup 5)))]) + (set (pc) + (if_then_else (ne (reg:CCAP CC_REGNUM) (const_int 0)) + (pc) + (label_ref (match_dup 6)))) + (parallel + [(set (match_dup 2) (plus:SI (match_dup 2) (const_int -1))) + (clobber (reg:CC CC_REGNUM))]) + (match_dup 6)] + "operands[2] = operand_subword (operands[0], 0, 0, DImode); + operands[3] = operand_subword (operands[1], 0, 0, DImode); + operands[4] = operand_subword (operands[0], 1, 0, DImode); + operands[5] = operand_subword (operands[1], 1, 0, DImode); + operands[6] = gen_label_rtx ();") + +; +; neg(df|sf)2 instruction pattern(s). +; + +(define_expand "neg2" + [(parallel + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*negdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcdbr\t%0,%1" +; lcxbr, lcdbr, lcebr +(define_insn "*neg2_cc" + [(set (reg CC_REGNUM) + (compare (neg:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_dup 1)))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lcbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*negdf2_ibm" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lcdr\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) - -; -; negsf2 instruction pattern(s). -; - -(define_expand "negsf2" - [(parallel - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*negsf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcebr\t%0,%1" +; lcxbr, lcdbr, lcebr +(define_insn "*neg2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lcbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*negsf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +; lcxbr, lcdbr, lcebr +(define_insn "*neg2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lcbr\t%0,%1" + [(set_attr "op_type" "RRE") + (set_attr "type" "fsimp")]) + +; lcxr, lcdr, lcer +(define_insn "*neg2_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lcer\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) + "lcr\t%0,%1" + [(set_attr "op_type" "") + (set_attr "type" "fsimp")]) ;; @@ -5848,88 +6015,113 @@ ;; ; -; absdi2 instruction pattern(s). +; abs(di|si)2 instruction pattern(s). ; -(define_insn "absdi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (abs:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "lpgr\t%0,%1" +(define_insn "*absdi2_sign_cc" + [(set (reg CC_REGNUM) + (compare (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI + (match_operand:SI 1 "register_operand" "d") 0) + (const_int 32)) (const_int 32))) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=d") + (abs:DI (sign_extend:DI (match_dup 1))))] + "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "lpgfr\t%0,%1" [(set_attr "op_type" "RRE")]) -; -; abssi2 instruction pattern(s). -; +(define_insn "*absdi2_sign" + [(set (match_operand:DI 0 "register_operand" "=d") + (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_64BIT" + "lpgfr\t%0,%1" + [(set_attr "op_type" "RRE")]) -(define_insn "abssi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (abs:SI (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] +; lpr, lpgr +(define_insn "*abs2_cc" + [(set (reg CC_REGNUM) + (compare (abs:GPR (match_operand:DI 1 "register_operand" "d")) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d") + (abs:GPR (match_dup 1)))] + "s390_match_ccmode (insn, CCAmode)" + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lpr, lpgr +(define_insn "*abs2_cconly" + [(set (reg CC_REGNUM) + (compare (abs:GPR (match_operand:GPR 1 "register_operand" "d")) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode (insn, CCAmode)" + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lpr, lpgr +(define_insn "abs2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))] "" - "lpr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) ; -; absdf2 instruction pattern(s). +; abs(df|sf)2 instruction pattern(s). ; -(define_expand "absdf2" +(define_expand "abs2" [(parallel - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*absdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpdbr\t%0,%1" +; lpxbr, lpdbr, lpebr +(define_insn "*abs2_cc" + [(set (reg CC_REGNUM) + (compare (abs:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_dup 1)))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lpbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*absdf2_ibm" - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lpdr\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) - -; -; abssf2 instruction pattern(s). -; - -(define_expand "abssf2" - [(parallel - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*abssf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpebr\t%0,%1" +; lpxbr, lpdbr, lpebr +(define_insn "*abs2_cconly" + [(set (reg CC_REGNUM) + (compare (abs:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lpbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*abssf2_ibm" - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +; lpxbr, lpdbr, lpebr +(define_insn "*abs2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lpbr\t%0,%1" + [(set_attr "op_type" "RRE") + (set_attr "type" "fsimp")]) + +; lpxr, lpdr, lper +(define_insn "*abs2_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lper\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) + "lpr\t%0,%1" + [(set_attr "op_type" "") + (set_attr "type" "fsimp")]) ;; ;;- Negated absolute value instructions @@ -5939,129 +6131,173 @@ ; Integer ; -(define_insn "*negabssi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] - "" - "lnr\t%0,%1" - [(set_attr "op_type" "RR")]) - -(define_insn "*negabsdi2" +(define_insn "*negabsdi2_sign_cc" + [(set (reg CC_REGNUM) + (compare (neg:DI (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI + (match_operand:SI 1 "register_operand" "d") 0) + (const_int 32)) (const_int 32)))) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=d") + (neg:DI (abs:DI (sign_extend:DI (match_dup 1)))))] + "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" + "lngfr\t%0,%1" + [(set_attr "op_type" "RRE")]) + +(define_insn "*negabsdi2_sign" [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] + (neg:DI (abs:DI (sign_extend:DI + (match_operand:SI 1 "register_operand" "d"))))) + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" - "lngr\t%0,%1" + "lngfr\t%0,%1" [(set_attr "op_type" "RRE")]) +; lnr, lngr +(define_insn "*negabs2_cc" + [(set (reg CC_REGNUM) + (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (abs:GPR (match_dup 1))))] + "s390_match_ccmode (insn, CCAmode)" + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lnr, lngr +(define_insn "*negabs2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode (insn, CCAmode)" + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) + +; lnr, lngr +(define_insn "*negabs2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d")))) + (clobber (reg:CC CC_REGNUM))] + "" + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) + ; ; Floating point ; -(define_insn "*negabssf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f")))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lnebr\t%0,%1" +; lnxbr, lndbr, lnebr +(define_insn "*negabs2_cc" + [(set (reg CC_REGNUM) + (compare (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (abs:FPR (match_dup 1))))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lnbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*negabsdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f")))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lndbr\t%0,%1" +; lnxbr, lndbr, lnebr +(define_insn "*negabs2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] + "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lnbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) + +; lnxbr, lndbr, lnebr +(define_insn "*negabs2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f")))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "lnbr\t%0,%1" + [(set_attr "op_type" "RRE") + (set_attr "type" "fsimp")]) ;; ;;- Square root instructions. ;; ; -; sqrtdf2 instruction pattern(s). +; sqrt(df|sf)2 instruction pattern(s). ; -(define_insn "sqrtdf2" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))] +; sqxbr, sqdbr, sqebr, sqxb, sqdb, sqeb +(define_insn "sqrt2" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (sqrt:FPR (match_operand:FPR 1 "general_operand" "f,")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sqdbr\t%0,%1 - sqdb\t%0,%1" - [(set_attr "op_type" "RRE,RXE")]) + sqbr\t%0,%1 + sqb\t%0,%1" + [(set_attr "op_type" "RRE,RXE") + (set_attr "type" "fsqrt")]) -; -; sqrtsf2 instruction pattern(s). -; - -(define_insn "sqrtsf2" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sqebr\t%0,%1 - sqeb\t%0,%1" - [(set_attr "op_type" "RRE,RXE")]) ;; ;;- One complement instructions. ;; ; -; one_cmpldi2 instruction pattern(s). +; one_cmpl(di|si|hi|qi)2 instruction pattern(s). ; -(define_expand "one_cmpldi2" +(define_expand "one_cmpl2" [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (xor:DI (match_operand:DI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "TARGET_64BIT" - "") - -; -; one_cmplsi2 instruction pattern(s). -; - -(define_expand "one_cmplsi2" - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (xor:SI (match_operand:SI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] + [(set (match_operand:INT 0 "register_operand" "") + (xor:INT (match_operand:INT 1 "register_operand" "") + (const_int -1))) + (clobber (reg:CC CC_REGNUM))])] "" "") -; -; one_cmplhi2 instruction pattern(s). -; -(define_expand "one_cmplhi2" - [(parallel - [(set (match_operand:HI 0 "register_operand" "") - (xor:HI (match_operand:HI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "" - "") +;; +;; Find leftmost bit instructions. +;; -; -; one_cmplqi2 instruction pattern(s). -; +(define_expand "clzdi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (clz:DI (match_operand:DI 1 "register_operand" "d")))] + "TARGET_EXTIMM && TARGET_64BIT" +{ + rtx insn, clz_equal; + rtx wide_reg = gen_reg_rtx (TImode); + rtx msb = gen_rtx_CONST_INT (DImode, (unsigned HOST_WIDE_INT) 1 << 63); -(define_expand "one_cmplqi2" - [(parallel - [(set (match_operand:QI 0 "register_operand" "") - (xor:QI (match_operand:QI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "" - "") + clz_equal = gen_rtx_CLZ (DImode, operands[1]); + + emit_insn (gen_clztidi2 (wide_reg, operands[1], msb)); + + insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg)); + REG_NOTES (insn) = + gen_rtx_EXPR_LIST (REG_EQUAL, clz_equal, REG_NOTES (insn)); + + DONE; +}) + +(define_insn "clztidi2" + [(set (match_operand:TI 0 "register_operand" "=d") + (ior:TI + (ashift:TI + (zero_extend:TI + (xor:DI (match_operand:DI 1 "register_operand" "d") + (lshiftrt (match_operand:DI 2 "const_int_operand" "") + (subreg:SI (clz:DI (match_dup 1)) 4)))) + + (const_int 64)) + (zero_extend:TI (clz:DI (match_dup 1))))) + (clobber (reg:CC CC_REGNUM))] + "(unsigned HOST_WIDE_INT) INTVAL (operands[2]) + == (unsigned HOST_WIDE_INT) 1 << 63 + && TARGET_EXTIMM && TARGET_64BIT" + "flogr\t%0,%1" + [(set_attr "op_type" "RRE")]) ;; @@ -6069,82 +6305,105 @@ ;; ; -; rotldi3 instruction pattern(s). +; rotl(di|si)3 instruction pattern(s). ; -(define_insn "rotldi3" - [(set (match_operand:DI 0 "register_operand" "=d") - (rotate:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "TARGET_64BIT" - "rllg\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - -; -; rotlsi3 instruction pattern(s). -; - -(define_insn "rotlsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (rotate:SI (match_operand:SI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] +; rll, rllg +(define_insn "rotl3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (rotate:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] "TARGET_CPU_ZARCH" - "rll\t%0,%1,%Y2" + "rll\t%0,%1,%Y2" + [(set_attr "op_type" "RSE") + (set_attr "atype" "reg")]) + +; rll, rllg +(define_insn "*rotl3_and" + [(set (match_operand:GPR 0 "register_operand" "=d") + (rotate:GPR (match_operand:GPR 1 "register_operand" "d") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))))] + "TARGET_CPU_ZARCH && (INTVAL (operands[3]) & 63) == 63" + "rll\t%0,%1,%Y2" [(set_attr "op_type" "RSE") (set_attr "atype" "reg")]) ;; -;;- Arithmetic shift instructions. +;;- Shift instructions. ;; ; -; ashldi3 instruction pattern(s). +; (ashl|lshr)(di|si)3 instruction pattern(s). ; -(define_expand "ashldi3" - [(set (match_operand:DI 0 "register_operand" "") - (ashift:DI (match_operand:DI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_operand" "")))] +(define_expand "3" + [(set (match_operand:DSI 0 "register_operand" "") + (SHIFT:DSI (match_operand:DSI 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" "")))] "" "") -(define_insn "*ashldi3_31" +; sldl, srdl +(define_insn "*di3_31" [(set (match_operand:DI 0 "register_operand" "=d") - (ashift:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] + (SHIFT:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] "!TARGET_64BIT" - "sldl\t%0,%Y2" + "sdl\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) -(define_insn "*ashldi3_64" +; sll, srl, sllg, srlg +(define_insn "*3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (SHIFT:GPR (match_operand:GPR 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] + "" + "sl\t%0,<1>%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + +; sldl, srdl +(define_insn "*di3_31_and" [(set (match_operand:DI 0 "register_operand" "=d") - (ashift:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "TARGET_64BIT" - "sllg\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") + (SHIFT:DI (match_operand:DI 1 "register_operand" "0") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))))] + "!TARGET_64BIT && (INTVAL (operands[3]) & 63) == 63" + "sdl\t%0,%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + +; sll, srl, sllg, srlg +(define_insn "*3_and" + [(set (match_operand:GPR 0 "register_operand" "=d") + (SHIFT:GPR (match_operand:GPR 1 "register_operand" "") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))))] + "(INTVAL (operands[3]) & 63) == 63" + "sl\t%0,<1>%Y2" + [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) ; -; ashrdi3 instruction pattern(s). +; ashr(di|si)3 instruction pattern(s). ; -(define_expand "ashrdi3" +(define_expand "ashr3" [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (ashiftrt:DI (match_operand:DI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_operand" ""))) - (clobber (reg:CC 33))])] + [(set (match_operand:DSI 0 "register_operand" "") + (ashiftrt:DSI (match_operand:DSI 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" ""))) + (clobber (reg:CC CC_REGNUM))])] "" "") (define_insn "*ashrdi3_cc_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")) + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_dup 1) (match_dup 2)))] @@ -6154,9 +6413,9 @@ (set_attr "atype" "reg")]) (define_insn "*ashrdi3_cconly_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")) + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) (const_int 0))) (clobber (match_scratch:DI 0 "=d"))] "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)" @@ -6167,143 +6426,127 @@ (define_insn "*ashrdi3_31" [(set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y"))) + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) -(define_insn "*ashrdi3_cc_64" - [(set (reg 33) - (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")) +; sra, srag +(define_insn "*ashr3_cc" + [(set (reg CC_REGNUM) + (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d") - (ashiftrt:DI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" - "srag\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") + (set (match_operand:GPR 0 "register_operand" "=d") + (ashiftrt:GPR (match_dup 1) (match_dup 2)))] + "s390_match_ccmode(insn, CCSmode)" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) -(define_insn "*ashrdi3_cconly_64" - [(set (reg 33) - (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")) +; sra, srag +(define_insn "*ashr3_cconly" + [(set (reg CC_REGNUM) + (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) + (const_int 0))) + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode(insn, CCSmode)" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + +; sra, srag +(define_insn "*ashr3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (match_operand:SI 2 "shift_count_or_setmem_operand" "Y"))) + (clobber (reg:CC CC_REGNUM))] + "" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + + +; shift pattern with implicit ANDs + +(define_insn "*ashrdi3_cc_31_and" + [(set (reg CC_REGNUM) + (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=d") + (ashiftrt:DI (match_dup 1) (and:SI (match_dup 2) (match_dup 3))))] + "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode) + && (INTVAL (operands[3]) & 63) == 63" + "srda\t%0,%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + +(define_insn "*ashrdi3_cconly_31_and" + [(set (reg CC_REGNUM) + (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))) (const_int 0))) (clobber (match_scratch:DI 0 "=d"))] - "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" - "srag\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - -(define_insn "*ashrdi3_64" - [(set (match_operand:DI 0 "register_operand" "=d") - (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "srag\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - - -; -; ashlsi3 instruction pattern(s). -; - -(define_insn "ashlsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (ashift:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "" - "sll\t%0,%Y2" + "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode) + && (INTVAL (operands[3]) & 63) == 63" + "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) -; -; ashrsi3 instruction pattern(s). -; +(define_insn "*ashrdi3_31_and" + [(set (match_operand:DI 0 "register_operand" "=d") + (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n")))) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_64BIT && (INTVAL (operands[3]) & 63) == 63" + "srda\t%0,%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) -(define_insn "*ashrsi3_cc" - [(set (reg 33) - (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")) +; sra, srag +(define_insn "*ashr3_cc_and" + [(set (reg CC_REGNUM) + (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))) + (const_int 0))) + (set (match_operand:GPR 0 "register_operand" "=d") + (ashiftrt:GPR (match_dup 1) (and:SI (match_dup 2) (match_dup 3))))] + "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") + (set_attr "atype" "reg")]) + +; sra, srag +(define_insn "*ashr3_cconly_and" + [(set (reg CC_REGNUM) + (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n"))) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d") - (ashiftrt:SI (match_dup 1) (match_dup 2)))] - "s390_match_ccmode(insn, CCSmode)" - "sra\t%0,%Y2" - [(set_attr "op_type" "RS") + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) - -(define_insn "*ashrsi3_cconly" - [(set (reg 33) - (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")) - (const_int 0))) - (clobber (match_scratch:SI 0 "=d"))] - "s390_match_ccmode(insn, CCSmode)" - "sra\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) - -(define_insn "ashrsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] - "" - "sra\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) - - -;; -;;- logical shift instructions. -;; - -; -; lshrdi3 instruction pattern(s). -; - -(define_expand "lshrdi3" - [(set (match_operand:DI 0 "register_operand" "") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_operand" "")))] - "" - "") - -(define_insn "*lshrdi3_31" - [(set (match_operand:DI 0 "register_operand" "=d") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "!TARGET_64BIT" - "srdl\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) - -(define_insn "*lshrdi3_64" - [(set (match_operand:DI 0 "register_operand" "=d") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "TARGET_64BIT" - "srlg\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - -; -; lshrsi3 instruction pattern(s). -; - -(define_insn "lshrsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (lshiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "" - "srl\t%0,%Y2" - [(set_attr "op_type" "RS") +; sra, srag +(define_insn "*ashr3_and" + [(set (match_operand:GPR 0 "register_operand" "=d") + (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "") + (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") + (match_operand:SI 3 "const_int_operand" "n")))) + (clobber (reg:CC CC_REGNUM))] + "(INTVAL (operands[3]) & 63) == 63" + "sra\t%0,<1>%Y2" + [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -6311,204 +6554,66 @@ ;; Branch instruction patterns. ;; -(define_expand "beq" - [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (eq (reg:CCZ 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) +(define_expand "b" + [(set (pc) + (if_then_else (COMPARE (match_operand 0 "" "") + (const_int 0)) + (match_dup 0) (pc)))] "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bne" - [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ne (reg:CCZ 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bgt" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (gt (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bgtu" - [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (gtu (reg:CCU 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "blt" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (lt (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bltu" - [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ltu (reg:CCU 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bge" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ge (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bgeu" - [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (geu (reg:CCU 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "ble" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (le (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bleu" - [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (leu (reg:CCU 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bunordered" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (unordered (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bordered" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ordered (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "buneq" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (uneq (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bungt" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ungt (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bunlt" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (unlt (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bunge" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (unge (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bunle" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (unle (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") - -(define_expand "bltgt" - [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2))) - (set (pc) - (if_then_else (ltgt (reg:CCS 33) (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;") + "s390_emit_jump (operands[0], + s390_emit_compare (, s390_compare_op0, s390_compare_op1)); DONE;") ;; ;;- Conditional jump instructions. ;; -(define_insn "cjump" - [(set (pc) - (if_then_else - (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" +(define_insn "*cjump_64" + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (label_ref (match_operand 0 "" "")) + (pc)))] + "TARGET_CPU_ZARCH" { if (get_attr_length (insn) == 4) return "j%C1\t%l0"; - else if (TARGET_CPU_ZARCH) - return "jg%C1\t%l0"; else - abort (); + return "jg%C1\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") - (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) - (const_int 4) - (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) - (const_int 6) - (eq (symbol_ref "flag_pic") (const_int 0)) - (const_int 6)] (const_int 8)))]) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)))]) + +(define_insn "*cjump_31" + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (label_ref (match_operand 0 "" "")) + (pc)))] + "!TARGET_CPU_ZARCH" +{ + gcc_assert (get_attr_length (insn) == 4); + return "j%C1\t%l0"; +} + [(set_attr "op_type" "RI") + (set_attr "type" "branch") + (set (attr "length") + (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 8))))]) (define_insn "*cjump_long" - [(set (pc) - (if_then_else - (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) - (match_operand 0 "address_operand" "U") - (pc)))] + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (match_operand 0 "address_operand" "U") + (pc)))] "" { if (get_attr_op_type (insn) == OP_TYPE_RR) @@ -6519,7 +6624,7 @@ [(set (attr "op_type") (if_then_else (match_operand 0 "register_operand" "") (const_string "RR") (const_string "RX"))) - (set_attr "type" "branch") + (set_attr "type" "branch") (set_attr "atype" "agen")]) @@ -6527,37 +6632,51 @@ ;;- Negated conditional jump instructions. ;; -(define_insn "icjump" - [(set (pc) - (if_then_else - (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" +(define_insn "*icjump_64" + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (pc) + (label_ref (match_operand 0 "" ""))))] + "TARGET_CPU_ZARCH" { if (get_attr_length (insn) == 4) return "j%D1\t%l0"; - else if (TARGET_CPU_ZARCH) - return "jg%D1\t%l0"; else - abort (); + return "jg%D1\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") - (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) - (const_int 4) - (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) - (const_int 6) - (eq (symbol_ref "flag_pic") (const_int 0)) - (const_int 6)] (const_int 8)))]) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)))]) + +(define_insn "*icjump_31" + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (pc) + (label_ref (match_operand 0 "" ""))))] + "!TARGET_CPU_ZARCH" +{ + gcc_assert (get_attr_length (insn) == 4); + return "j%D1\t%l0"; +} + [(set_attr "op_type" "RI") + (set_attr "type" "branch") + (set (attr "length") + (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 8))))]) (define_insn "*icjump_long" - [(set (pc) - (if_then_else - (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)]) - (pc) - (match_operand 0 "address_operand" "U")))] + [(set (pc) + (if_then_else + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (pc) + (match_operand 0 "address_operand" "U")))] "" { if (get_attr_op_type (insn) == OP_TYPE_RR) @@ -6579,28 +6698,21 @@ [(trap_if (const_int 1) (const_int 0))] "" "j\t.+2" - [(set_attr "op_type" "RX") + [(set_attr "op_type" "RI") (set_attr "type" "branch")]) (define_expand "conditional_trap" - [(set (match_dup 2) (match_dup 3)) - (trap_if (match_operator 0 "comparison_operator" - [(match_dup 2) (const_int 0)]) - (match_operand:SI 1 "general_operand" ""))] + [(trap_if (match_operand 0 "comparison_operator" "") + (match_operand 1 "general_operand" ""))] "" { - enum machine_mode ccmode; - - if (operands[1] != const0_rtx) FAIL; - - ccmode = s390_select_ccmode (GET_CODE (operands[0]), - s390_compare_op0, s390_compare_op1); - operands[2] = gen_rtx_REG (ccmode, 33); - operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1); + if (operands[1] != const0_rtx) FAIL; + operands[0] = s390_emit_compare (GET_CODE (operands[0]), + s390_compare_op0, s390_compare_op1); }) (define_insn "*trap" - [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)]) + [(trap_if (match_operator 0 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (const_int 0))] "" "j%C0\t.+2"; @@ -6621,8 +6733,10 @@ (use (match_operand 4 "" ""))] ; label "" { - if (GET_MODE (operands[0]) == SImode) - emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0])); + if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH) + emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0])); + else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH) + emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0])); else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT) emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0])); else @@ -6631,50 +6745,99 @@ DONE; }) -(define_insn "doloop_si" +(define_insn_and_split "doloop_si64" [(set (pc) (if_then_else - (ne (match_operand:SI 1 "register_operand" "d,d") + (ne (match_operand:SI 1 "register_operand" "d,d,d") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:SI 2 "register_operand" "=1,?*m*d") + (set (match_operand:SI 2 "nonimmediate_operand" "=1,?X,?X") (plus:SI (match_dup 1) (const_int -1))) - (clobber (match_scratch:SI 3 "=X,&d")) - (clobber (reg:CC 33))] - "" + (clobber (match_scratch:SI 3 "=X,&1,&?d")) + (clobber (reg:CC CC_REGNUM))] + "TARGET_CPU_ZARCH" { if (which_alternative != 0) return "#"; else if (get_attr_length (insn) == 4) return "brct\t%1,%l0"; - else if (TARGET_CPU_ZARCH) - return "ahi\t%1,-1\;jgne\t%l0"; else - abort (); + return "ahi\t%1,-1\;jgne\t%l0"; } + "&& reload_completed + && (! REG_P (operands[2]) + || ! rtx_equal_p (operands[1], operands[2]))" + [(set (match_dup 3) (match_dup 1)) + (parallel [(set (reg:CCAN CC_REGNUM) + (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) + (const_int 0))) + (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) + (set (match_dup 2) (match_dup 3)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) + (label_ref (match_dup 0)) + (pc)))] + "" [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") - (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) - (const_int 4) - (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) - (const_int 10) - (eq (symbol_ref "flag_pic") (const_int 0)) - (const_int 6)] (const_int 8)))]) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 10)))]) + +(define_insn_and_split "doloop_si31" + [(set (pc) + (if_then_else + (ne (match_operand:SI 1 "register_operand" "d,d,d") + (const_int 1)) + (label_ref (match_operand 0 "" "")) + (pc))) + (set (match_operand:SI 2 "nonimmediate_operand" "=1,?X,?X") + (plus:SI (match_dup 1) (const_int -1))) + (clobber (match_scratch:SI 3 "=X,&1,&?d")) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_CPU_ZARCH" +{ + if (which_alternative != 0) + return "#"; + else if (get_attr_length (insn) == 4) + return "brct\t%1,%l0"; + else + gcc_unreachable (); +} + "&& reload_completed + && (! REG_P (operands[2]) + || ! rtx_equal_p (operands[1], operands[2]))" + [(set (match_dup 3) (match_dup 1)) + (parallel [(set (reg:CCAN CC_REGNUM) + (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) + (const_int 0))) + (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) + (set (match_dup 2) (match_dup 3)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) + (label_ref (match_dup 0)) + (pc)))] + "" + [(set_attr "op_type" "RI") + (set_attr "type" "branch") + (set (attr "length") + (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 8))))]) (define_insn "*doloop_si_long" [(set (pc) (if_then_else - (ne (match_operand:SI 1 "register_operand" "d,d") + (ne (match_operand:SI 1 "register_operand" "d") (const_int 1)) - (match_operand 0 "address_operand" "U,U") + (match_operand 0 "address_operand" "U") (pc))) - (set (match_operand:SI 2 "register_operand" "=1,?*m*d") + (set (match_operand:SI 2 "register_operand" "=1") (plus:SI (match_dup 1) (const_int -1))) - (clobber (match_scratch:SI 3 "=X,&d")) - (clobber (reg:CC 33))] - "" + (clobber (match_scratch:SI 3 "=X")) + (clobber (reg:CC CC_REGNUM))] + "!TARGET_CPU_ZARCH" { if (get_attr_op_type (insn) == OP_TYPE_RR) return "bctr\t%1,%0"; @@ -6687,41 +6850,17 @@ (set_attr "type" "branch") (set_attr "atype" "agen")]) -(define_split - [(set (pc) - (if_then_else (ne (match_operand:SI 1 "register_operand" "") - (const_int 1)) - (match_operand 0 "" "") - (pc))) - (set (match_operand:SI 2 "nonimmediate_operand" "") - (plus:SI (match_dup 1) (const_int -1))) - (clobber (match_scratch:SI 3 "")) - (clobber (reg:CC 33))] - "reload_completed - && (! REG_P (operands[2]) - || ! rtx_equal_p (operands[1], operands[2]))" - [(set (match_dup 3) (match_dup 1)) - (parallel [(set (reg:CCAN 33) - (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) - (const_int 0))) - (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) - (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) - (match_dup 0) - (pc)))] - "") - -(define_insn "doloop_di" +(define_insn_and_split "doloop_di" [(set (pc) (if_then_else - (ne (match_operand:DI 1 "register_operand" "d,d") + (ne (match_operand:DI 1 "register_operand" "d,d,d") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) - (set (match_operand:DI 2 "register_operand" "=1,?*m*r") + (set (match_operand:DI 2 "nonimmediate_operand" "=1,?X,?X") (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:DI 3 "=X,&d")) - (clobber (reg:CC 33))] + (clobber (match_scratch:DI 3 "=X,&1,&?d")) + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" { if (which_alternative != 0) @@ -6731,36 +6870,25 @@ else return "aghi\t%1,-1\;jgne\t%l0"; } + "&& reload_completed + && (! REG_P (operands[2]) + || ! rtx_equal_p (operands[1], operands[2]))" + [(set (match_dup 3) (match_dup 1)) + (parallel [(set (reg:CCAN CC_REGNUM) + (compare:CCAN (plus:DI (match_dup 3) (const_int -1)) + (const_int 0))) + (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))]) + (set (match_dup 2) (match_dup 3)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) + (label_ref (match_dup 0)) + (pc)))] + "" [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) (const_int 4) (const_int 10)))]) -(define_split - [(set (pc) - (if_then_else (ne (match_operand:DI 1 "register_operand" "") - (const_int 1)) - (match_operand 0 "" "") - (pc))) - (set (match_operand:DI 2 "nonimmediate_operand" "") - (plus:DI (match_dup 1) (const_int -1))) - (clobber (match_scratch:DI 3 "")) - (clobber (reg:CC 33))] - "reload_completed - && (! REG_P (operands[2]) - || ! rtx_equal_p (operands[1], operands[2]))" - [(set (match_dup 3) (match_dup 1)) - (parallel [(set (reg:CCAN 33) - (compare:CCAN (plus:DI (match_dup 3) (const_int -1)) - (const_int 0))) - (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))]) - (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) - (match_dup 0) - (pc)))] - "") - ;; ;;- Unconditional jump instructions. ;; @@ -6769,26 +6897,41 @@ ; jump instruction pattern(s). ; -(define_insn "jump" - [(set (pc) (label_ref (match_operand 0 "" "")))] +(define_expand "jump" + [(match_operand 0 "" "")] "" + "s390_emit_jump (operands[0], NULL_RTX); DONE;") + +(define_insn "*jump64" + [(set (pc) (label_ref (match_operand 0 "" "")))] + "TARGET_CPU_ZARCH" { if (get_attr_length (insn) == 4) return "j\t%l0"; - else if (TARGET_CPU_ZARCH) - return "jg\t%l0"; else - abort (); + return "jg\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") (set (attr "length") - (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) - (const_int 4) - (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) - (const_int 6) - (eq (symbol_ref "flag_pic") (const_int 0)) - (const_int 6)] (const_int 8)))]) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)))]) + +(define_insn "*jump31" + [(set (pc) (label_ref (match_operand 0 "" "")))] + "!TARGET_CPU_ZARCH" +{ + gcc_assert (get_attr_length (insn) == 4); + return "j\t%l0"; +} + [(set_attr "op_type" "RI") + (set_attr "type" "branch") + (set (attr "length") + (if_then_else (eq (symbol_ref "flag_pic") (const_int 0)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 6)) + (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) + (const_int 4) (const_int 8))))]) ; ; indirect-jump instruction pattern(s). @@ -6854,11 +6997,11 @@ if (TARGET_64BIT) emit_insn (gen_ashldi3 (index, index, GEN_INT (3))); else - emit_insn (gen_ashlsi3 (index, index, GEN_INT (2))); + emit_insn (gen_ashlsi3 (index, index, const2_rtx)); emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3])); - index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index)); + index = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, base, index)); emit_move_insn (target, index); if (flag_pic) @@ -6915,6 +7058,87 @@ [(set_attr "type" "none") (set_attr "length" "0")]) +; +; sibcall patterns +; + +(define_expand "sibcall" + [(call (match_operand 0 "" "") + (match_operand 1 "" ""))] + "" +{ + s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX); + DONE; +}) + +(define_insn "*sibcall_br" + [(call (mem:QI (reg SIBCALL_REGNUM)) + (match_operand 0 "const_int_operand" "n"))] + "SIBLING_CALL_P (insn) + && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode" + "br\t%%r1" + [(set_attr "op_type" "RR") + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +(define_insn "*sibcall_brc" + [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) + (match_operand 1 "const_int_operand" "n"))] + "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC" + "j\t%0" + [(set_attr "op_type" "RI") + (set_attr "type" "branch")]) + +(define_insn "*sibcall_brcl" + [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) + (match_operand 1 "const_int_operand" "n"))] + "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH" + "jg\t%0" + [(set_attr "op_type" "RIL") + (set_attr "type" "branch")]) + +; +; sibcall_value patterns +; + +(define_expand "sibcall_value" + [(set (match_operand 0 "" "") + (call (match_operand 1 "" "") + (match_operand 2 "" "")))] + "" +{ + s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX); + DONE; +}) + +(define_insn "*sibcall_value_br" + [(set (match_operand 0 "" "") + (call (mem:QI (reg SIBCALL_REGNUM)) + (match_operand 1 "const_int_operand" "n")))] + "SIBLING_CALL_P (insn) + && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode" + "br\t%%r1" + [(set_attr "op_type" "RR") + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +(define_insn "*sibcall_value_brc" + [(set (match_operand 0 "" "") + (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) + (match_operand 2 "const_int_operand" "n")))] + "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC" + "j\t%1" + [(set_attr "op_type" "RI") + (set_attr "type" "branch")]) + +(define_insn "*sibcall_value_brcl" + [(set (match_operand 0 "" "") + (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) + (match_operand 2 "const_int_operand" "n")))] + "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH" + "jg\t%1" + [(set_attr "op_type" "RIL") + (set_attr "type" "branch")]) ; @@ -6927,59 +7151,18 @@ (use (match_operand 2 "" ""))] "" { - bool plt_call = false; - rtx insn; - - /* Direct function calls need special treatment. */ - if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF) - { - rtx sym = XEXP (operands[0], 0); - - /* When calling a global routine in PIC mode, we must - replace the symbol itself with the PLT stub. */ - if (flag_pic && !SYMBOL_REF_LOCAL_P (sym)) - { - sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT); - sym = gen_rtx_CONST (Pmode, sym); - plt_call = true; - } - - /* Unless we can use the bras(l) insn, force the - routine address into a register. */ - if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) - { - if (flag_pic) - sym = legitimize_pic_address (sym, 0); - else - sym = force_reg (Pmode, sym); - } - - operands[0] = gen_rtx_MEM (QImode, sym); - } - - /* Emit insn. */ - insn = emit_call_insn (gen_call_exp (operands[0], operands[1], - gen_rtx_REG (Pmode, RETURN_REGNUM))); - - /* 31-bit PLT stubs use the GOT register implicitly. */ - if (!TARGET_64BIT && plt_call) - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - + s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, + gen_rtx_REG (Pmode, RETURN_REGNUM)); DONE; }) -(define_expand "call_exp" - [(parallel [(call (match_operand 0 "" "") - (match_operand 1 "" "")) - (clobber (match_operand 2 "" ""))])] - "" - "") - (define_insn "*bras" [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) (match_operand 1 "const_int_operand" "n")) (clobber (match_operand 2 "register_operand" "=r"))] - "TARGET_SMALL_EXEC && GET_MODE (operands[2]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_SMALL_EXEC + && GET_MODE (operands[2]) == Pmode" "bras\t%2,%0" [(set_attr "op_type" "RI") (set_attr "type" "jsr")]) @@ -6988,7 +7171,9 @@ [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) (match_operand 1 "const_int_operand" "n")) (clobber (match_operand 2 "register_operand" "=r"))] - "TARGET_CPU_ZARCH && GET_MODE (operands[2]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_CPU_ZARCH + && GET_MODE (operands[2]) == Pmode" "brasl\t%2,%0" [(set_attr "op_type" "RIL") (set_attr "type" "jsr")]) @@ -6997,7 +7182,7 @@ [(call (mem:QI (match_operand 0 "address_operand" "U")) (match_operand 1 "const_int_operand" "n")) (clobber (match_operand 2 "register_operand" "=r"))] - "GET_MODE (operands[2]) == Pmode" + "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode" { if (get_attr_op_type (insn) == OP_TYPE_RR) return "basr\t%2,%0"; @@ -7021,62 +7206,19 @@ (use (match_operand 3 "" ""))] "" { - bool plt_call = false; - rtx insn; - - /* Direct function calls need special treatment. */ - if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF) - { - rtx sym = XEXP (operands[1], 0); - - /* When calling a global routine in PIC mode, we must - replace the symbol itself with the PLT stub. */ - if (flag_pic && !SYMBOL_REF_LOCAL_P (sym)) - { - sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT); - sym = gen_rtx_CONST (Pmode, sym); - plt_call = true; - } - - /* Unless we can use the bras(l) insn, force the - routine address into a register. */ - if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) - { - if (flag_pic) - sym = legitimize_pic_address (sym, 0); - else - sym = force_reg (Pmode, sym); - } - - operands[1] = gen_rtx_MEM (QImode, sym); - } - - /* Emit insn. */ - insn = emit_call_insn ( - gen_call_value_exp (operands[0], operands[1], operands[2], - gen_rtx_REG (Pmode, RETURN_REGNUM))); - - /* 31-bit PLT stubs use the GOT register implicitly. */ - if (!TARGET_64BIT && plt_call) - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - + s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], + gen_rtx_REG (Pmode, RETURN_REGNUM)); DONE; }) -(define_expand "call_value_exp" - [(parallel [(set (match_operand 0 "" "") - (call (match_operand 1 "" "") - (match_operand 2 "" ""))) - (clobber (match_operand 3 "" ""))])] - "" - "") - (define_insn "*bras_r" [(set (match_operand 0 "" "") (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) (match_operand:SI 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r"))] - "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_SMALL_EXEC + && GET_MODE (operands[3]) == Pmode" "bras\t%3,%1" [(set_attr "op_type" "RI") (set_attr "type" "jsr")]) @@ -7086,7 +7228,9 @@ (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) (match_operand 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r"))] - "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_CPU_ZARCH + && GET_MODE (operands[3]) == Pmode" "brasl\t%3,%1" [(set_attr "op_type" "RIL") (set_attr "type" "jsr")]) @@ -7096,7 +7240,7 @@ (call (mem:QI (match_operand 1 "address_operand" "U")) (match_operand 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r"))] - "GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode" { if (get_attr_op_type (insn) == OP_TYPE_RR) return "basr\t%3,%1"; @@ -7113,46 +7257,34 @@ ;;- Thread-local storage support. ;; -(define_insn "get_tp_64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q") - (unspec:DI [(const_int 0)] UNSPEC_TP))] +(define_expand "get_tp_64" + [(set (match_operand:DI 0 "nonimmediate_operand" "") (reg:DI TP_REGNUM))] "TARGET_64BIT" - "@ - ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1 - stam\t%%a0,%%a1,%0" - [(set_attr "op_type" "NN,RS") - (set_attr "atype" "reg,*") - (set_attr "type" "o3,*") - (set_attr "length" "14,*")]) + "") -(define_insn "get_tp_31" - [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q") - (unspec:SI [(const_int 0)] UNSPEC_TP))] +(define_expand "get_tp_31" + [(set (match_operand:SI 0 "nonimmediate_operand" "") (reg:SI TP_REGNUM))] "!TARGET_64BIT" - "@ - ear\t%0,%%a0 - stam\t%%a0,%%a0,%0" - [(set_attr "op_type" "RRE,RS")]) + "") -(define_insn "set_tp_64" - [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP) - (clobber (match_scratch:SI 1 "=d,X"))] +(define_expand "set_tp_64" + [(set (reg:DI TP_REGNUM) (match_operand:DI 0 "nonimmediate_operand" "")) + (set (reg:DI TP_REGNUM) (unspec_volatile:DI [(reg:DI TP_REGNUM)] UNSPECV_SET_TP))] "TARGET_64BIT" - "@ - sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1 - lam\t%%a0,%%a1,%0" - [(set_attr "op_type" "NN,RS") - (set_attr "atype" "reg,*") - (set_attr "type" "o3,*") - (set_attr "length" "14,*")]) + "") -(define_insn "set_tp_31" - [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)] +(define_expand "set_tp_31" + [(set (reg:SI TP_REGNUM) (match_operand:SI 0 "nonimmediate_operand" "")) + (set (reg:SI TP_REGNUM) (unspec_volatile:SI [(reg:SI TP_REGNUM)] UNSPECV_SET_TP))] "!TARGET_64BIT" - "@ - sar\t%%a0,%0 - lam\t%%a0,%%a0,%0" - [(set_attr "op_type" "RRE,RS")]) + "") + +(define_insn "*set_tp" + [(set (reg TP_REGNUM) (unspec_volatile [(reg TP_REGNUM)] UNSPECV_SET_TP))] + "" + "" + [(set_attr "type" "none") + (set_attr "length" "0")]) (define_insn "*tls_load_64" [(set (match_operand:DI 0 "register_operand" "=d") @@ -7174,64 +7306,15 @@ ly\t%0,%1%J2" [(set_attr "op_type" "RX,RXY")]) -(define_expand "call_value_tls" - [(set (match_operand 0 "" "") - (call (const_int 0) (const_int 0))) - (use (match_operand 1 "" ""))] - "" -{ - rtx insn, sym; - - if (!flag_pic) - abort (); - - sym = s390_tls_get_offset (); - sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT); - sym = gen_rtx_CONST (Pmode, sym); - - /* Unless we can use the bras(l) insn, force the - routine address into a register. */ - if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) - { - if (flag_pic) - sym = legitimize_pic_address (sym, 0); - else - sym = force_reg (Pmode, sym); - } - - sym = gen_rtx_MEM (QImode, sym); - - /* Emit insn. */ - insn = emit_call_insn ( - gen_call_value_tls_exp (operands[0], sym, const0_rtx, - gen_rtx_REG (Pmode, RETURN_REGNUM), - operands[1])); - - /* The calling convention of __tls_get_offset uses the - GOT register implicitly. */ - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), operands[0]); - CONST_OR_PURE_CALL_P (insn) = 1; - - DONE; -}) - -(define_expand "call_value_tls_exp" - [(parallel [(set (match_operand 0 "" "") - (call (match_operand 1 "" "") - (match_operand 2 "" ""))) - (clobber (match_operand 3 "" "")) - (use (match_operand 4 "" ""))])] - "" - "") - (define_insn "*bras_tls" [(set (match_operand 0 "" "") (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) (match_operand 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r")) (use (match_operand 4 "" ""))] - "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_SMALL_EXEC + && GET_MODE (operands[3]) == Pmode" "bras\t%3,%1%J4" [(set_attr "op_type" "RI") (set_attr "type" "jsr")]) @@ -7242,7 +7325,9 @@ (match_operand 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r")) (use (match_operand 4 "" ""))] - "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) + && TARGET_CPU_ZARCH + && GET_MODE (operands[3]) == Pmode" "brasl\t%3,%1%J4" [(set_attr "op_type" "RIL") (set_attr "type" "jsr")]) @@ -7253,7 +7338,7 @@ (match_operand 2 "const_int_operand" "n"))) (clobber (match_operand 3 "register_operand" "=r")) (use (match_operand 4 "" ""))] - "GET_MODE (operands[3]) == Pmode" + "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode" { if (get_attr_op_type (insn) == OP_TYPE_RR) return "basr\t%3,%1%J4"; @@ -7266,6 +7351,159 @@ (set_attr "type" "jsr") (set_attr "atype" "agen")]) +;; +;;- Atomic operations +;; + +; +; memory barrier pattern. +; + +(define_expand "memory_barrier" + [(set (mem:BLK (match_dup 0)) + (unspec_volatile:BLK [(mem:BLK (match_dup 0))] UNSPECV_MB))] + "" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*memory_barrier" + [(set (match_operand:BLK 0 "" "") + (unspec_volatile:BLK [(match_operand:BLK 1 "" "")] UNSPECV_MB))] + "" + "bcr\t15,0" + [(set_attr "op_type" "RR")]) + +; +; compare and swap patterns. +; + +(define_expand "sync_compare_and_swap" + [(parallel + [(set (match_operand:TDSI 0 "register_operand" "") + (match_operand:TDSI 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:TDSI + [(match_dup 1) + (match_operand:TDSI 2 "register_operand" "") + (match_operand:TDSI 3 "register_operand" "")] + UNSPECV_CAS)) + (set (reg:CCZ1 CC_REGNUM) + (compare:CCZ1 (match_dup 1) (match_dup 2)))])] + "") + +(define_expand "sync_compare_and_swap" + [(parallel + [(set (match_operand:HQI 0 "register_operand" "") + (match_operand:HQI 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:HQI + [(match_dup 1) + (match_operand:HQI 2 "general_operand" "") + (match_operand:HQI 3 "general_operand" "")] + UNSPECV_CAS)) + (set (reg:CCZ1 CC_REGNUM) + (compare:CCZ1 (match_dup 1) (match_dup 2)))])] + "" + "s390_expand_cs_hqi (mode, operands[0], operands[1], + operands[2], operands[3]); DONE;") + +(define_expand "sync_compare_and_swap_cc" + [(parallel + [(set (match_operand:TDSI 0 "register_operand" "") + (match_operand:TDSI 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:TDSI + [(match_dup 1) + (match_operand:TDSI 2 "register_operand" "") + (match_operand:TDSI 3 "register_operand" "")] + UNSPECV_CAS)) + (set (match_dup 4) + (compare:CCZ1 (match_dup 1) (match_dup 2)))])] + "" +{ + /* Emulate compare. */ + operands[4] = gen_rtx_REG (CCZ1mode, CC_REGNUM); + s390_compare_op0 = operands[1]; + s390_compare_op1 = operands[2]; + s390_compare_emitted = operands[4]; +}) + +; cds, cdsg +(define_insn "*sync_compare_and_swap" + [(set (match_operand:DP 0 "register_operand" "=r") + (match_operand:DP 1 "memory_operand" "+Q")) + (set (match_dup 1) + (unspec_volatile:DP + [(match_dup 1) + (match_operand:DP 2 "register_operand" "0") + (match_operand:DP 3 "register_operand" "r")] + UNSPECV_CAS)) + (set (reg:CCZ1 CC_REGNUM) + (compare:CCZ1 (match_dup 1) (match_dup 2)))] + "" + "cds\t%0,%3,%S1" + [(set_attr "op_type" "RS") + (set_attr "type" "sem")]) + +; cs, csg +(define_insn "*sync_compare_and_swap" + [(set (match_operand:GPR 0 "register_operand" "=r") + (match_operand:GPR 1 "memory_operand" "+Q")) + (set (match_dup 1) + (unspec_volatile:GPR + [(match_dup 1) + (match_operand:GPR 2 "register_operand" "0") + (match_operand:GPR 3 "register_operand" "r")] + UNSPECV_CAS)) + (set (reg:CCZ1 CC_REGNUM) + (compare:CCZ1 (match_dup 1) (match_dup 2)))] + "" + "cs\t%0,%3,%S1" + [(set_attr "op_type" "RS") + (set_attr "type" "sem")]) + + +; +; Other atomic instruction patterns. +; + +(define_expand "sync_lock_test_and_set" + [(match_operand:HQI 0 "register_operand") + (match_operand:HQI 1 "memory_operand") + (match_operand:HQI 2 "general_operand")] + "" + "s390_expand_atomic (mode, SET, operands[0], operands[1], + operands[2], false); DONE;") + +(define_expand "sync_" + [(set (match_operand:HQI 0 "memory_operand") + (ATOMIC:HQI (match_dup 0) + (match_operand:HQI 1 "general_operand")))] + "" + "s390_expand_atomic (mode, , NULL_RTX, operands[0], + operands[1], false); DONE;") + +(define_expand "sync_old_" + [(set (match_operand:HQI 0 "register_operand") + (match_operand:HQI 1 "memory_operand")) + (set (match_dup 1) + (ATOMIC:HQI (match_dup 1) + (match_operand:HQI 2 "general_operand")))] + "" + "s390_expand_atomic (mode, , operands[0], operands[1], + operands[2], false); DONE;") + +(define_expand "sync_new_" + [(set (match_operand:HQI 0 "register_operand") + (ATOMIC:HQI (match_operand:HQI 1 "memory_operand") + (match_operand:HQI 2 "general_operand"))) + (set (match_dup 1) (ATOMIC:HQI (match_dup 1) (match_dup 2)))] + "" + "s390_expand_atomic (mode, , operands[0], operands[1], + operands[2], true); DONE;") + ;; ;;- Miscellaneous instructions. ;; @@ -7275,27 +7513,18 @@ ; (define_expand "allocate_stack" - [(set (reg 15) - (plus (reg 15) (match_operand 1 "general_operand" ""))) - (set (match_operand 0 "general_operand" "") - (reg 15))] + [(match_operand 0 "general_operand" "") + (match_operand 1 "general_operand" "")] "TARGET_BACKCHAIN" { - rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM); - rtx chain = gen_rtx (MEM, Pmode, stack); - rtx temp = gen_reg_rtx (Pmode); + rtx temp = gen_reg_rtx (Pmode); - emit_move_insn (temp, chain); + emit_move_insn (temp, s390_back_chain_rtx ()); + anti_adjust_stack (operands[1]); + emit_move_insn (s390_back_chain_rtx (), temp); - if (TARGET_64BIT) - emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1]))); - else - emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1]))); - - emit_move_insn (chain, temp); - - emit_move_insn (operands[0], virtual_stack_dynamic_rtx); - DONE; + emit_move_insn (operands[0], virtual_stack_dynamic_rtx); + DONE; }) @@ -7307,7 +7536,7 @@ [(match_operand 0 "" "")] "flag_pic" { - s390_load_got (false); + emit_insn (s390_load_got ()); emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx)); DONE; }) @@ -7334,14 +7563,17 @@ "DONE;") (define_expand "restore_stack_block" - [(use (match_operand 0 "register_operand" "")) - (set (match_dup 2) (match_dup 3)) - (set (match_dup 0) (match_operand 1 "register_operand" "")) - (set (match_dup 3) (match_dup 2))] - "" + [(match_operand 0 "register_operand" "") + (match_operand 1 "register_operand" "")] + "TARGET_BACKCHAIN" { - operands[2] = gen_reg_rtx (Pmode); - operands[3] = gen_rtx_MEM (Pmode, operands[0]); + rtx temp = gen_reg_rtx (Pmode); + + emit_move_insn (temp, s390_back_chain_rtx ()); + emit_move_insn (operands[0], operands[1]); + emit_move_insn (s390_back_chain_rtx (), temp); + + DONE; }) (define_expand "save_stack_nonlocal" @@ -7349,20 +7581,21 @@ (match_operand 1 "register_operand" "")] "" { - rtx temp = gen_reg_rtx (Pmode); + enum machine_mode mode = TARGET_64BIT ? OImode : TImode; + rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); + + /* Copy the backchain to the first word, sp to the second and the + literal pool base to the third. */ + + if (TARGET_BACKCHAIN) + { + rtx temp = force_reg (Pmode, s390_back_chain_rtx ()); + emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp); + } + + emit_move_insn (operand_subword (operands[0], 1, 0, mode), operands[1]); + emit_move_insn (operand_subword (operands[0], 2, 0, mode), base); - /* Copy the backchain to the first word, sp to the second and the literal pool - base to the third. */ - emit_move_insn (operand_subword (operands[0], 2, 0, - TARGET_64BIT ? OImode : TImode), - gen_rtx_REG (Pmode, BASE_REGISTER)); - emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1])); - emit_move_insn (operand_subword (operands[0], 0, 0, - TARGET_64BIT ? OImode : TImode), - temp); - emit_move_insn (operand_subword (operands[0], 1, 0, - TARGET_64BIT ? OImode : TImode), - operands[1]); DONE; }) @@ -7371,26 +7604,33 @@ (match_operand 1 "memory_operand" "")] "" { - rtx temp = gen_reg_rtx (Pmode); - rtx base = gen_rtx_REG (Pmode, BASE_REGISTER); + enum machine_mode mode = TARGET_64BIT ? OImode : TImode; + rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); + rtx temp = NULL_RTX; /* Restore the backchain from the first word, sp from the second and the - literal pool base from the third. */ - emit_move_insn (temp, - operand_subword (operands[1], 0, 0, - TARGET_64BIT ? OImode : TImode)); - emit_move_insn (operands[0], - operand_subword (operands[1], 1, 0, - TARGET_64BIT ? OImode : TImode)); - emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp); - emit_move_insn (base, - operand_subword (operands[1], 2, 0, - TARGET_64BIT ? OImode : TImode)); - emit_insn (gen_rtx_USE (VOIDmode, base)); + literal pool base from the third. */ + if (TARGET_BACKCHAIN) + temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode)); + + emit_move_insn (base, operand_subword (operands[1], 2, 0, mode)); + emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode)); + + if (temp) + emit_move_insn (s390_back_chain_rtx (), temp); + + emit_insn (gen_rtx_USE (VOIDmode, base)); DONE; }) +(define_expand "exception_receiver" + [(const_int 0)] + "" +{ + s390_set_has_landing_pad_p (true); + DONE; +}) ; ; nop instruction pattern(s). @@ -7414,40 +7654,30 @@ { enum machine_mode mode = GET_MODE (PATTERN (insn)); unsigned int align = GET_MODE_BITSIZE (mode); - s390_output_pool_entry (asm_out_file, operands[0], mode, align); + s390_output_pool_entry (operands[0], mode, align); return ""; } - [(set_attr "op_type" "NN") - (set (attr "length") + [(set (attr "length") (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))]) -(define_insn "pool_start_31" - [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)] - "!TARGET_CPU_ZARCH" - ".align\t4" - [(set_attr "op_type" "NN") - (set_attr "length" "2")]) +(define_insn "pool_align" + [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] + UNSPECV_POOL_ALIGN)] + "" + ".align\t%0" + [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) -(define_insn "pool_end_31" - [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)] - "!TARGET_CPU_ZARCH" - ".align\t2" - [(set_attr "op_type" "NN") - (set_attr "length" "2")]) +(define_insn "pool_section_start" + [(unspec_volatile [(const_int 1)] UNSPECV_POOL_SECTION)] + "" + ".section\t.rodata" + [(set_attr "length" "0")]) -(define_insn "pool_start_64" - [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)] - "TARGET_CPU_ZARCH" - ".section\t.rodata\;.align\t8" - [(set_attr "op_type" "NN") - (set_attr "length" "0")]) - -(define_insn "pool_end_64" - [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)] - "TARGET_CPU_ZARCH" +(define_insn "pool_section_end" + [(unspec_volatile [(const_int 0)] UNSPECV_POOL_SECTION)] + "" ".previous" - [(set_attr "op_type" "NN") - (set_attr "length" "0")]) + [(set_attr "length" "0")]) (define_insn "main_base_31_small" [(set (match_operand 0 "register_operand" "=a") @@ -7474,19 +7704,23 @@ (set_attr "type" "larl")]) (define_insn "main_pool" - [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)] - "" - "* abort ();" - [(set_attr "op_type" "NN")]) + [(set (match_operand 0 "register_operand" "=a") + (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))] + "GET_MODE (operands[0]) == Pmode" +{ + gcc_unreachable (); +} + [(set (attr "type") + (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) + (const_string "larl") (const_string "la")))]) (define_insn "reload_base_31" [(set (match_operand 0 "register_operand" "=a") (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))] "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" "basr\t%0,0\;la\t%0,%1-.(%0)" - [(set_attr "op_type" "NN") - (set_attr "type" "la") - (set_attr "length" "6")]) + [(set_attr "length" "6") + (set_attr "type" "la")]) (define_insn "reload_base_64" [(set (match_operand 0 "register_operand" "=a") @@ -7499,9 +7733,10 @@ (define_insn "pool" [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)] "" - "* abort ();" - [(set_attr "op_type" "NN") - (set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) +{ + gcc_unreachable (); +} + [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) ;; ;; Insns related to generating the function prologue and epilogue. @@ -7516,7 +7751,12 @@ (define_expand "epilogue" [(use (const_int 1))] "" - "s390_emit_epilogue (); DONE;") + "s390_emit_epilogue (false); DONE;") + +(define_expand "sibcall_epilogue" + [(use (const_int 0))] + "" + "s390_emit_epilogue (true); DONE;") (define_insn "*return" [(return) @@ -7541,3 +7781,77 @@ GEN_INT (0x7fffffff))); DONE; }) + +;; Instruction definition to expand eh_return macro to support +;; swapping in special linkage return addresses. + +(define_expand "eh_return" + [(use (match_operand 0 "register_operand" ""))] + "TARGET_TPF" +{ + s390_emit_tpf_eh_return (operands[0]); + DONE; +}) + +; +; Stack Protector Patterns +; + +(define_expand "stack_protect_set" + [(set (match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" ""))] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + operands[1] + = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), + GEN_INT (TARGET_THREAD_SSP_OFFSET))); +#endif + if (TARGET_64BIT) + emit_insn (gen_stack_protect_setdi (operands[0], operands[1])); + else + emit_insn (gen_stack_protect_setsi (operands[0], operands[1])); + + DONE; +}) + +(define_insn "stack_protect_set" + [(set (match_operand:DSI 0 "memory_operand" "=Q") + (unspec:DSI [(match_operand:DSI 1 "memory_operand" "Q")] UNSPEC_SP_SET))] + "" + "mvc\t%O0(%G0,%R0),%S1" + [(set_attr "op_type" "SS")]) + +(define_expand "stack_protect_test" + [(set (reg:CC CC_REGNUM) + (compare (match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" ""))) + (match_operand 2 "" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + operands[1] + = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), + GEN_INT (TARGET_THREAD_SSP_OFFSET))); +#endif + s390_compare_op0 = operands[0]; + s390_compare_op1 = operands[1]; + s390_compare_emitted = gen_rtx_REG (CCZmode, CC_REGNUM); + + if (TARGET_64BIT) + emit_insn (gen_stack_protect_testdi (operands[0], operands[1])); + else + emit_insn (gen_stack_protect_testsi (operands[0], operands[1])); + + emit_jump_insn (gen_beq (operands[2])); + + DONE; +}) + +(define_insn "stack_protect_test" + [(set (reg:CCZ CC_REGNUM) + (unspec:CCZ [(match_operand:DSI 0 "memory_operand" "Q") + (match_operand:DSI 1 "memory_operand" "Q")] UNSPEC_SP_TEST))] + "" + "clc\t%O0(%G0,%R0),%S1" + [(set_attr "op_type" "SS")]) diff --git a/contrib/gcc/config/s390/s390.opt b/contrib/gcc/config/s390/s390.opt new file mode 100644 index 00000000000..21ef4f31065 --- /dev/null +++ b/contrib/gcc/config/s390/s390.opt @@ -0,0 +1,100 @@ +; Options for the S/390 / zSeries port of the compiler. + +; Copyright (C) 2005, 2006 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +m31 +Target Report RejectNegative InverseMask(64BIT) +31 bit ABI + +m64 +Target Report RejectNegative Mask(64BIT) +64 bit ABI + +march= +Target RejectNegative Joined Var(s390_arch_string) +Generate code for given CPU + +mbackchain +Target Report Mask(BACKCHAIN) +Maintain backchain pointer + +mdebug +Target Report Mask(DEBUG_ARG) +Additional debug prints + +mesa +Target Report RejectNegative InverseMask(ZARCH) +ESA/390 architecture + +mfused-madd +Target Report Mask(FUSED_MADD) +Enable fused multiply/add instructions + +mhard-float +Target Report RejectNegative Mask(HARD_FLOAT) +Use hardware fp + +mlong-double-128 +Target Report RejectNegative Mask(LONG_DOUBLE_128) +Use 128-bit long double + +mlong-double-64 +Target Report RejectNegative InverseMask(LONG_DOUBLE_128) +Use 64-bit long double + +mpacked-stack +Target Report Mask(PACKED_STACK) +Use packed stack layout + +msmall-exec +Target Report Mask(SMALL_EXEC) +Use bras for executable < 64k + +msoft-float +Target Report RejectNegative InverseMask(HARD_FLOAT, SOFT_FLOAT) +Don't use hardware fp + +mstack-guard= +Target RejectNegative Joined +Set the max. number of bytes which has to be left to stack size before a trap instruction is triggered + +mstack-size= +Target RejectNegative Joined +Emit extra code in the function prologue in order to trap if the stack size exceeds the given limit + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +mmvcle +Target Report Mask(MVCLE) +mvcle use + +mwarn-dynamicstack +Target RejectNegative Var(s390_warn_dynamicstack_p) +Warn if a function uses alloca or creates an array with dynamic size + +mwarn-framesize= +Target RejectNegative Joined +Warn if a single function's framesize exceeds the given framesize + +mzarch +Target Report RejectNegative Mask(ZARCH) +z/Architecture diff --git a/contrib/gcc/config/s390/s390x.h b/contrib/gcc/config/s390/s390x.h index f9177c1c266..cbfb45c8d1f 100644 --- a/contrib/gcc/config/s390/s390x.h +++ b/contrib/gcc/config/s390/s390x.h @@ -17,8 +17,8 @@ for more details. 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. */ #ifndef _S390X_H #define _S390X_H diff --git a/contrib/gcc/config/s390/t-crtstuff b/contrib/gcc/config/s390/t-crtstuff index 5572e6bf54e..39b0eba6b97 100644 --- a/contrib/gcc/config/s390/t-crtstuff +++ b/contrib/gcc/config/s390/t-crtstuff @@ -2,3 +2,4 @@ # because then __FRAME_END__ might not be the last thing in .eh_frame # section. CRTSTUFF_T_CFLAGS = -fno-asynchronous-unwind-tables +TARGET_LIBGCC2_CFLAGS += -mlong-double-128 diff --git a/contrib/gcc/config/s390/t-linux b/contrib/gcc/config/s390/t-linux new file mode 100644 index 00000000000..d5a92781450 --- /dev/null +++ b/contrib/gcc/config/s390/t-linux @@ -0,0 +1,3 @@ +# Override t-slibgcc-elf-ver to export some libgcc symbols with +# the symbol versions that glibc used. +SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/s390/libgcc-glibc.ver diff --git a/contrib/gcc/config/s390/t-linux64 b/contrib/gcc/config/s390/t-linux64 index db839c65ef1..0ffb6902c18 100644 --- a/contrib/gcc/config/s390/t-linux64 +++ b/contrib/gcc/config/s390/t-linux64 @@ -6,7 +6,3 @@ LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o - -# Override t-slibgcc-elf-ver to export some libgcc symbols with -# the symbol versions that glibc used. -SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/s390/libgcc-glibc.ver diff --git a/contrib/gcc/config/s390/t-tpf b/contrib/gcc/config/s390/t-tpf index c04d5622d6c..6e4c377697c 100644 --- a/contrib/gcc/config/s390/t-tpf +++ b/contrib/gcc/config/s390/t-tpf @@ -3,11 +3,7 @@ CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC # Compile libgcc2.a with pic. TARGET_LIBGCC2_CFLAGS = -fPIC -# Override t-slibgcc-elf-ver to export some libgcc symbols with -# the symbol versions that glibc used. -SHLIB_MAPFILES += $(srcdir)/config/s390/libgcc-glibc.ver - -# Use unwind-dw2-fde-glibc +# Use unwind-dw2-fde-glibc. LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c -LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c gthr-gnat.c +LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h diff --git a/contrib/gcc/config/s390/tpf-unwind.h b/contrib/gcc/config/s390/tpf-unwind.h new file mode 100644 index 00000000000..87b68923f49 --- /dev/null +++ b/contrib/gcc/config/s390/tpf-unwind.h @@ -0,0 +1,257 @@ +/* DWARF2 EH unwinding support for TPF OS. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by P.J. Darcy (darcypj@us.ibm.com). + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combined +executable.) + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include + +/* Function Name: __isPATrange + Parameters passed into it: address to check + Return Value: A 1 if address is in pat code "range", 0 if not + Description: This function simply checks to see if the address + passed to it is in the CP pat code range. */ + +#define MIN_PATRANGE 0x10000 +#define MAX_PATRANGE 0x800000 + +static inline unsigned int +__isPATrange (void *addr) +{ + if (addr > (void *)MIN_PATRANGE && addr < (void *)MAX_PATRANGE) + return 1; + else + return 0; +} + +/* TPF return address offset from start of stack frame. */ +#define TPFRA_OFFSET 168 + +/* Exceptions macro defined for TPF so that functions without + dwarf frame information can be used with exceptions. */ +#define MD_FALLBACK_FRAME_STATE_FOR s390_fallback_frame_state + +static _Unwind_Reason_Code +s390_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned long int regs; + unsigned long int new_cfa; + int i; + + regs = *((unsigned long int *) + (((unsigned long int) context->cfa) - STACK_POINTER_OFFSET)); + + /* Are we going through special linkage code? */ + if (__isPATrange (context->ra)) + { + + /* Our return register isn't zero for end of stack, so + check backward stackpointer to see if it is zero. */ + if (regs == NULL) + return _URC_END_OF_STACK; + + /* No stack frame. */ + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 15; + fs->cfa_offset = STACK_POINTER_OFFSET; + + /* All registers remain unchanged ... */ + for (i = 0; i < 32; i++) + { + fs->regs.reg[i].how = REG_SAVED_REG; + fs->regs.reg[i].loc.reg = i; + } + + /* ... except for %r14, which is stored at CFA-112 + and used as return address. */ + fs->regs.reg[14].how = REG_SAVED_OFFSET; + fs->regs.reg[14].loc.offset = TPFRA_OFFSET - STACK_POINTER_OFFSET; + fs->retaddr_column = 14; + + return _URC_NO_REASON; + } + + regs = *((unsigned long int *) + (((unsigned long int) context->cfa) - STACK_POINTER_OFFSET)); + new_cfa = regs + STACK_POINTER_OFFSET; + + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 15; + fs->cfa_offset = new_cfa - + (unsigned long int) context->cfa + STACK_POINTER_OFFSET; + + for (i = 0; i < 16; i++) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = regs + i*8 - new_cfa; + } + + for (i = 0; i < 4; i++) + { + fs->regs.reg[16 + i].how = REG_SAVED_OFFSET; + fs->regs.reg[16 + i].loc.offset = regs + 16*8 + i*8 - new_cfa; + } + + fs->retaddr_column = 14; + + return _URC_NO_REASON; +} + +/* Function Name: __tpf_eh_return + Parameters passed into it: Destination address to jump to. + Return Value: Converted Destination address if a Pat Stub exists. + Description: This function swaps the unwinding return address + with the cp stub code. The original target return address is + then stored into the tpf return address field. The cp stub + code is searched for by climbing back up the stack and + comparing the tpf stored return address object address to + that of the targets object address. */ + +#define CURRENT_STACK_PTR() \ + ({ register unsigned long int *stack_ptr asm ("%r15"); stack_ptr; }) + +#define PREVIOUS_STACK_PTR() \ + ((unsigned long int *)(*(CURRENT_STACK_PTR()))) + +#define RA_OFFSET 112 +#define R15_OFFSET 120 +#define TPFAREA_OFFSET 160 +#define TPFAREA_SIZE STACK_POINTER_OFFSET-TPFAREA_OFFSET +#define INVALID_RETURN 0 + +void * __tpf_eh_return (void *target); + +void * +__tpf_eh_return (void *target) +{ + Dl_info targetcodeInfo, currentcodeInfo; + int retval; + void *current, *stackptr, *destination_frame; + unsigned long int shifter, is_a_stub; + + is_a_stub = 0; + + /* Get code info for target return's address. */ + retval = dladdr (target, &targetcodeInfo); + + /* Ensure the code info is valid (for target). */ + if (retval != INVALID_RETURN) + { + + /* Get the stack pointer of the stack frame to be modified by + the exception unwinder. So that we can begin our climb + there. */ + stackptr = (void *) *((unsigned long int *) (*(PREVIOUS_STACK_PTR()))); + + /* Begin looping through stack frames. Stop if invalid + code information is retrieved or if a match between the + current stack frame iteration shared object's address + matches that of the target, calculated above. */ + do + { + /* Get return address based on our stackptr iterator. */ + current = (void *) *((unsigned long int *) + (stackptr+RA_OFFSET)); + + /* Is it a Pat Stub? */ + if (__isPATrange (current)) + { + /* Yes it was, get real return address + in TPF stack area. */ + current = (void *) *((unsigned long int *) + (stackptr+TPFRA_OFFSET)); + is_a_stub = 1; + } + + /* Get codeinfo on RA so that we can figure out + the module address. */ + retval = dladdr (current, ¤tcodeInfo); + + /* Check that codeinfo for current stack frame is valid. + Then compare the module address of current stack frame + to target stack frame to determine if we have the pat + stub address we want. Also ensure we are dealing + with a module crossing, stub return address. */ + if (is_a_stub && retval != INVALID_RETURN + && targetcodeInfo.dli_fbase == currentcodeInfo.dli_fbase) + { + /* Yes! They are in the same module. + Force copy of TPF private stack area to + destination stack frame TPF private area. */ + destination_frame = (void *) *((unsigned long int *) + (*PREVIOUS_STACK_PTR() + R15_OFFSET)); + + /* Copy TPF linkage area from current frame to + destination frame. */ + memcpy((void *) (destination_frame + TPFAREA_OFFSET), + (void *) (stackptr + TPFAREA_OFFSET), TPFAREA_SIZE); + + /* Now overlay the + real target address into the TPF stack area of + the target frame we are jumping to. */ + *((unsigned long int *) (destination_frame + + TPFRA_OFFSET)) = (unsigned long int) target; + + /* Before returning the desired pat stub address to + the exception handling unwinder so that it can + actually do the "leap" shift out the low order + bit designated to determine if we are in 64BIT mode. + This is necessary for CTOA stubs. + Otherwise we leap one byte past where we want to + go to in the TPF pat stub linkage code. */ + shifter = *((unsigned long int *) + (stackptr + RA_OFFSET)); + + shifter &= ~1ul; + + /* Store Pat Stub Address in destination Stack Frame. */ + *((unsigned long int *) (destination_frame + + RA_OFFSET)) = shifter; + + /* Re-adjust pat stub address to go to correct place + in linkage. */ + shifter = shifter - 4; + + return (void *) shifter; + } + + /* Desired module pat stub not found ... + Bump stack frame iterator. */ + stackptr = (void *) *(unsigned long int *) stackptr; + + is_a_stub = 0; + + } while (stackptr && retval != INVALID_RETURN + && targetcodeInfo.dli_fbase != currentcodeInfo.dli_fbase); + } + + /* No pat stub found, could be a problem? Simply return unmodified + target address. */ + return target; +} + diff --git a/contrib/gcc/config/s390/tpf.h b/contrib/gcc/config/s390/tpf.h index 30158276f2e..f0a63f7d255 100644 --- a/contrib/gcc/config/s390/tpf.h +++ b/contrib/gcc/config/s390/tpf.h @@ -1,5 +1,5 @@ /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by P.J. Darcy (darcypj@us.ibm.com), Hartmut Penner (hpenner@de.ibm.com), and Ulrich Weigand (uweigand@de.ibm.com). @@ -18,21 +18,21 @@ for more details. 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. */ #ifndef _TPF_H #define _TPF_H /* TPF wants the following macros defined/undefined as follows. */ +#undef TARGET_TPF +#define TARGET_TPF 1 #undef ASM_APP_ON #define ASM_APP_ON "#APP\n" #undef ASM_APP_OFF #define ASM_APP_OFF "#NO_APP\n" #define NO_IMPLICIT_EXTERN_C -#define TARGET_HAS_F_SETLKW -#undef MD_EXEC_PREFIX -#undef MD_STARTFILE_PREFIX +#define TARGET_POSIX_IO #undef SIZE_TYPE #define SIZE_TYPE ("long unsigned int") @@ -50,11 +50,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* TPF OS specific stack-pointer offset. */ #undef STACK_POINTER_OFFSET -#define STACK_POINTER_OFFSET 280 +#define STACK_POINTER_OFFSET 448 -/* When building for TPF, set a generic default target that is 64 bits. */ +/* When building for TPF, set a generic default target that is 64 bits. Also + enable TPF profiling support and the standard backchain by default. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT 0x33 +#define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \ + | MASK_HARD_FLOAT | MASK_BACKCHAIN) + +/* Exception handling. */ + +/* Select a format to encode pointers in exception handling data. */ +#undef ASM_PREFERRED_EH_DATA_FORMAT +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr /* TPF OS specific compiler settings. */ #undef TARGET_OS_CPP_BUILTINS @@ -64,52 +72,59 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA builtin_define_std ("tpf"); \ builtin_assert ("system=tpf"); \ builtin_define ("__ELF__"); \ - if (flag_pic) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ } \ while (0) +#define EXTRA_SPECS \ + { "entry_spec", ENTRY_SPEC } + /* Make TPF specific spec file settings here. */ -#undef STARTFILE_SPEC +#undef STARTFILE_SPEC #define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{static:crtbeginT.o%s} \ - %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" + "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s" -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtendS%O%s" + +#undef CC1_SPEC +#define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}" /* The GNU C++ standard library requires that these macros be defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" -#undef ASM_SPEC -#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}" +#undef ASM_SPEC +#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \ + -alshd=%b.lst" -#undef LIB_SPEC -#define LIB_SPEC "%{pthread:-lpthread} -lc" +/* It would be nice to get the system linker script define the ones that it + needed. */ +#undef LIB_SPEC +#define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \ + -lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB" #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS 1 +#define ENTRY_SPEC "%{mmain:-entry=_start} \ + %{!mmain:-entry=0}" + +/* All linking is done shared on TPF-OS. */ +/* FIXME: When binutils patch for new emulation is committed + then change emulation to elf64_s390_tpf. */ #undef LINK_SPEC #define LINK_SPEC \ "-m elf64_s390 \ - %{shared:-shared} \ - %{!shared: \ - %{static:-static} \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld64.so}}}" + %{static:%estatic is not supported on TPF-OS} \ + %{shared: -shared} \ + %{!shared:-shared} \ + %(entry_spec)" +#define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h" + +/* IBM copies these libraries over with these names. */ +#define MATH_LIBRARY "-lCLBM" +#define LIBSTDCXX "-lCPP1" #endif /* ! _TPF_H */ - diff --git a/contrib/gcc/config/s390/tpf.md b/contrib/gcc/config/s390/tpf.md new file mode 100644 index 00000000000..87a2616e0bb --- /dev/null +++ b/contrib/gcc/config/s390/tpf.md @@ -0,0 +1,34 @@ +;; S390 TPF-OS specific machine patterns +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_insn "prologue_tpf" + [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE) + (clobber (reg:DI 1))] + "TARGET_TPF_PROFILING" + "larl\t%%r1,.+14\;tm\t4065,255\;bnz\t4064" + [(set_attr "length" "14")]) + + +(define_insn "epilogue_tpf" + [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE) + (clobber (reg:DI 1))] + "TARGET_TPF_PROFILING" + "larl\t%%r1,.+14\;tm\t4071,255\;bnz\t4070" + [(set_attr "length" "14")]) diff --git a/contrib/gcc/config/s390/tpf.opt b/contrib/gcc/config/s390/tpf.opt new file mode 100644 index 00000000000..7f124025975 --- /dev/null +++ b/contrib/gcc/config/s390/tpf.opt @@ -0,0 +1,28 @@ +; Options for the TPF-OS port of the compiler. + +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mtpf-trace +Target Report Mask(TPF_PROFILING) +Enable TPF-OS tracing code + +mmain +Target Report +Specify main object for TPF-OS diff --git a/contrib/gcc/config/soft-fp/README b/contrib/gcc/config/soft-fp/README new file mode 100644 index 00000000000..870025cc53a --- /dev/null +++ b/contrib/gcc/config/soft-fp/README @@ -0,0 +1,4 @@ +Except for t-softfp, the files in this directory are part of the GNU C +Library, not part of GCC. As described at +, changes should be made to +the GNU C Library and the changed files then imported into GCC. diff --git a/contrib/gcc/config/soft-fp/adddf3.c b/contrib/gcc/config/soft-fp/adddf3.c new file mode 100644 index 00000000000..24c03db0a64 --- /dev/null +++ b/contrib/gcc/config/soft-fp/adddf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __adddf3(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_D(A, a); + FP_UNPACK_SEMIRAW_D(B, b); + FP_ADD_D(R, A, B); + FP_PACK_SEMIRAW_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/addsf3.c b/contrib/gcc/config/soft-fp/addsf3.c new file mode 100644 index 00000000000..b86991ee562 --- /dev/null +++ b/contrib/gcc/config/soft-fp/addsf3.c @@ -0,0 +1,50 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __addsf3(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_S(A, a); + FP_UNPACK_SEMIRAW_S(B, b); + FP_ADD_S(R, A, B); + FP_PACK_SEMIRAW_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} + diff --git a/contrib/gcc/config/soft-fp/addtf3.c b/contrib/gcc/config/soft-fp/addtf3.c new file mode 100644 index 00000000000..49b67f0ba96 --- /dev/null +++ b/contrib/gcc/config/soft-fp/addtf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a + b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __addtf3(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); + FP_ADD_Q(R, A, B); + FP_PACK_SEMIRAW_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/divdf3.c b/contrib/gcc/config/soft-fp/divdf3.c new file mode 100644 index 00000000000..c3bb0d247cb --- /dev/null +++ b/contrib/gcc/config/soft-fp/divdf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __divdf3(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_D(A, a); + FP_UNPACK_D(B, b); + FP_DIV_D(R, A, B); + FP_PACK_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/divsf3.c b/contrib/gcc/config/soft-fp/divsf3.c new file mode 100644 index 00000000000..176bb3c2cb3 --- /dev/null +++ b/contrib/gcc/config/soft-fp/divsf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __divsf3(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); + FP_UNPACK_S(B, b); + FP_DIV_S(R, A, B); + FP_PACK_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/divtf3.c b/contrib/gcc/config/soft-fp/divtf3.c new file mode 100644 index 00000000000..916fbfe9748 --- /dev/null +++ b/contrib/gcc/config/soft-fp/divtf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a / b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __divtf3(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); + FP_DIV_Q(R, A, B); + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/double.h b/contrib/gcc/config/soft-fp/double.h new file mode 100644 index 00000000000..c8f4420af85 --- /dev/null +++ b/contrib/gcc/config/soft-fp/double.h @@ -0,0 +1,264 @@ +/* Software floating-point emulation. + Definitions for IEEE Double Precision + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel kid. Go buy yourself a real computer." +#endif + +#if _FP_W_TYPE_SIZE < 64 +#define _FP_FRACTBITS_D (2 * _FP_W_TYPE_SIZE) +#else +#define _FP_FRACTBITS_D _FP_W_TYPE_SIZE +#endif + +#define _FP_FRACBITS_D 53 +#define _FP_FRACXBITS_D (_FP_FRACTBITS_D - _FP_FRACBITS_D) +#define _FP_WFRACBITS_D (_FP_WORKBITS + _FP_FRACBITS_D) +#define _FP_WFRACXBITS_D (_FP_FRACTBITS_D - _FP_WFRACBITS_D) +#define _FP_EXPBITS_D 11 +#define _FP_EXPBIAS_D 1023 +#define _FP_EXPMAX_D 2047 + +#define _FP_QNANBIT_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_D \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_OVERFLOW_D \ + ((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE) + +typedef float DFtype __attribute__((mode(DF))); + +#if _FP_W_TYPE_SIZE < 64 + +union _FP_UNION_D +{ + DFtype flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_D; + unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE; + unsigned frac0 : _FP_W_TYPE_SIZE; +#else + unsigned frac0 : _FP_W_TYPE_SIZE; + unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_D; + unsigned sign : 1; +#endif + } bits __attribute__((packed)); +}; + +#define FP_DECL_D(X) _FP_DECL(2,X) +#define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_2(D,X,val) +#define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_2_P(D,X,val) +#define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_2(D,val,X) +#define FP_PACK_RAW_DP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + +#define FP_UNPACK_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(D,X,val); \ + _FP_UNPACK_CANONICAL(D,2,X); \ + } while (0) + +#define FP_UNPACK_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(D,X,val); \ + _FP_UNPACK_CANONICAL(D,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(D,X,val); \ + _FP_UNPACK_SEMIRAW(D,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(D,X,val); \ + _FP_UNPACK_SEMIRAW(D,2,X); \ + } while (0) + +#define FP_PACK_D(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,2,X); \ + _FP_PACK_RAW_2(D,val,X); \ + } while (0) + +#define FP_PACK_DP(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_D(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,2,X); \ + _FP_PACK_RAW_2(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_DP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(D,val,X); \ + } while (0) + +#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X) +#define FP_NEG_D(R,X) _FP_NEG(D,2,R,X) +#define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y) +#define FP_SUB_D(R,X,Y) _FP_SUB(D,2,R,X,Y) +#define FP_MUL_D(R,X,Y) _FP_MUL(D,2,R,X,Y) +#define FP_DIV_D(R,X,Y) _FP_DIV(D,2,R,X,Y) +#define FP_SQRT_D(R,X) _FP_SQRT(D,2,R,X) +#define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_2(R,S,T,X,Q) + +#define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un) +#define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y) +#define FP_CMP_UNORD_D(r,X,Y) _FP_CMP_UNORD(D,2,r,X,Y) + +#define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg) +#define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt) + +#define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_2(X) +#define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_2(X) + +#else + +union _FP_UNION_D +{ + DFtype flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_D; + unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0); +#else + unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0); + unsigned exp : _FP_EXPBITS_D; + unsigned sign : 1; +#endif + } bits __attribute__((packed)); +}; + +#define FP_DECL_D(X) _FP_DECL(1,X) +#define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_1(D,X,val) +#define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_1_P(D,X,val) +#define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_1(D,val,X) +#define FP_PACK_RAW_DP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + +#define FP_UNPACK_D(X,val) \ + do { \ + _FP_UNPACK_RAW_1(D,X,val); \ + _FP_UNPACK_CANONICAL(D,1,X); \ + } while (0) + +#define FP_UNPACK_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_1_P(D,X,val); \ + _FP_UNPACK_CANONICAL(D,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_D(X,val) \ + do { \ + _FP_UNPACK_RAW_2(1,X,val); \ + _FP_UNPACK_SEMIRAW(D,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_DP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(1,X,val); \ + _FP_UNPACK_SEMIRAW(D,1,X); \ + } while (0) + +#define FP_PACK_D(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,1,X); \ + _FP_PACK_RAW_1(D,val,X); \ + } while (0) + +#define FP_PACK_DP(val,X) \ + do { \ + _FP_PACK_CANONICAL(D,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_D(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,1,X); \ + _FP_PACK_RAW_1(D,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_DP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(D,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(D,val,X); \ + } while (0) + +#define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X) +#define FP_NEG_D(R,X) _FP_NEG(D,1,R,X) +#define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y) +#define FP_SUB_D(R,X,Y) _FP_SUB(D,1,R,X,Y) +#define FP_MUL_D(R,X,Y) _FP_MUL(D,1,R,X,Y) +#define FP_DIV_D(R,X,Y) _FP_DIV(D,1,R,X,Y) +#define FP_SQRT_D(R,X) _FP_SQRT(D,1,R,X) +#define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_1(R,S,T,X,Q) + +/* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by + the target machine. */ + +#define FP_CMP_D(r,X,Y,un) _FP_CMP(D,1,r,X,Y,un) +#define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,1,r,X,Y) +#define FP_CMP_UNORD_D(r,X,Y) _FP_CMP_UNORD(D,1,r,X,Y) + +#define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,1,r,X,rsz,rsg) +#define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,1,X,r,rs,rt) + +#define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_1(X) +#define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_1(X) + +#endif /* W_TYPE_SIZE < 64 */ diff --git a/contrib/gcc/config/soft-fp/eqdf2.c b/contrib/gcc/config/soft-fp/eqdf2.c new file mode 100644 index 00000000000..efa769e986d --- /dev/null +++ b/contrib/gcc/config/soft-fp/eqdf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +int __eqdf2(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_EQ_D(r, A, B); + if (r && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqdf2, __nedf2); diff --git a/contrib/gcc/config/soft-fp/eqsf2.c b/contrib/gcc/config/soft-fp/eqsf2.c new file mode 100644 index 00000000000..7e01c01d2f4 --- /dev/null +++ b/contrib/gcc/config/soft-fp/eqsf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +int __eqsf2(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_EQ_S(r, A, B); + if (r && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqsf2, __nesf2); diff --git a/contrib/gcc/config/soft-fp/eqtf2.c b/contrib/gcc/config/soft-fp/eqtf2.c new file mode 100644 index 00000000000..fd6ffd1ebef --- /dev/null +++ b/contrib/gcc/config/soft-fp/eqtf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 otherwise + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int __eqtf2(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_EQ_Q(r, A, B); + if (r && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__eqtf2, __netf2); diff --git a/contrib/gcc/config/soft-fp/extenddftf2.c b/contrib/gcc/config/soft-fp/extenddftf2.c new file mode 100644 index 00000000000..4101639a947 --- /dev/null +++ b/contrib/gcc/config/soft-fp/extenddftf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Return a converted to IEEE quad + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" +#include "quad.h" + +TFtype __extenddftf2(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_RAW_D(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_EXTEND(Q,D,4,2,R,A); +#else + FP_EXTEND(Q,D,2,1,R,A); +#endif + FP_PACK_RAW_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/extended.h b/contrib/gcc/config/soft-fp/extended.h new file mode 100644 index 00000000000..bbf39429e7f --- /dev/null +++ b/contrib/gcc/config/soft-fp/extended.h @@ -0,0 +1,453 @@ +/* Software floating-point emulation. + Definitions for IEEE Extended Precision. + Copyright (C) 1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel, kid. Go buy yourself a real computer." +#endif + +#if _FP_W_TYPE_SIZE < 64 +#define _FP_FRACTBITS_E (4*_FP_W_TYPE_SIZE) +#else +#define _FP_FRACTBITS_E (2*_FP_W_TYPE_SIZE) +#endif + +#define _FP_FRACBITS_E 64 +#define _FP_FRACXBITS_E (_FP_FRACTBITS_E - _FP_FRACBITS_E) +#define _FP_WFRACBITS_E (_FP_WORKBITS + _FP_FRACBITS_E) +#define _FP_WFRACXBITS_E (_FP_FRACTBITS_E - _FP_WFRACBITS_E) +#define _FP_EXPBITS_E 15 +#define _FP_EXPBIAS_E 16383 +#define _FP_EXPMAX_E 32767 + +#define _FP_QNANBIT_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_E \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_OVERFLOW_E \ + ((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE)) + +typedef float XFtype __attribute__((mode(XF))); + +#if _FP_W_TYPE_SIZE < 64 + +union _FP_UNION_E +{ + XFtype flt; + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned long pad1 : _FP_W_TYPE_SIZE; + unsigned long pad2 : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); + unsigned long sign : 1; + unsigned long exp : _FP_EXPBITS_E; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned long frac0 : _FP_W_TYPE_SIZE; +#else + unsigned long frac0 : _FP_W_TYPE_SIZE; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_E; + unsigned sign : 1; +#endif /* not bigendian */ + } bits __attribute__((packed)); +}; + + +#define FP_DECL_E(X) _FP_DECL(4,X) + +#define FP_UNPACK_RAW_E(X, val) \ + do { \ + union _FP_UNION_E _flo; _flo.flt = (val); \ + \ + X##_f[2] = 0; X##_f[3] = 0; \ + X##_f[0] = _flo.bits.frac0; \ + X##_f[1] = _flo.bits.frac1; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + if (!X##_e && (X##_f[1] || X##_f[0]) \ + && !(X##_f[1] & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_UNPACK_RAW_EP(X, val) \ + do { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + X##_f[2] = 0; X##_f[3] = 0; \ + X##_f[0] = _flo->bits.frac0; \ + X##_f[1] = _flo->bits.frac1; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + if (!X##_e && (X##_f[1] || X##_f[0]) \ + && !(X##_f[1] & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_PACK_RAW_E(val, X) \ + do { \ + union _FP_UNION_E _flo; \ + \ + if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \ + else X##_f[1] &= ~(_FP_IMPLBIT_E); \ + _flo.bits.frac0 = X##_f[0]; \ + _flo.bits.frac1 = X##_f[1]; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define FP_PACK_RAW_EP(val, X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \ + else X##_f[1] &= ~(_FP_IMPLBIT_E); \ + _flo->bits.frac0 = X##_f[0]; \ + _flo->bits.frac1 = X##_f[1]; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } \ + } while (0) + +#define FP_UNPACK_E(X,val) \ + do { \ + FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_CANONICAL(E,4,X); \ + } while (0) + +#define FP_UNPACK_EP(X,val) \ + do { \ + FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_CANONICAL(E,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_E(X,val) \ + do { \ + _FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_SEMIRAW(E,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_EP(X,val) \ + do { \ + _FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_SEMIRAW(E,4,X); \ + } while (0) + +#define FP_PACK_E(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,4,X); \ + FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_EP(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,4,X); \ + FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_E(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,4,X); \ + _FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_EP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,4,X); \ + _FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X) +#define FP_NEG_E(R,X) _FP_NEG(E,4,R,X) +#define FP_ADD_E(R,X,Y) _FP_ADD(E,4,R,X,Y) +#define FP_SUB_E(R,X,Y) _FP_SUB(E,4,R,X,Y) +#define FP_MUL_E(R,X,Y) _FP_MUL(E,4,R,X,Y) +#define FP_DIV_E(R,X,Y) _FP_DIV(E,4,R,X,Y) +#define FP_SQRT_E(R,X) _FP_SQRT(E,4,R,X) + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + * This has special _E version because standard _4 square + * root would not work (it has to start normally with the + * second word and not the first), but as we have to do it + * anyway, we optimize it by doing most of the calculations + * in two UWtype registers instead of four. + */ + +#define _FP_SQRT_MEAT_E(R, S, T, X, q) \ + do { \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + _FP_FRAC_SRL_4(X, (_FP_WORKBITS)); \ + while (q) \ + { \ + T##_f[1] = S##_f[1] + q; \ + if (T##_f[1] <= X##_f[1]) \ + { \ + S##_f[1] = T##_f[1] + q; \ + X##_f[1] -= T##_f[1]; \ + R##_f[1] += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q) \ + { \ + T##_f[0] = S##_f[0] + q; \ + T##_f[1] = S##_f[1]; \ + if (T##_f[1] < X##_f[1] || \ + (T##_f[1] == X##_f[1] && \ + T##_f[0] <= X##_f[0])) \ + { \ + S##_f[0] = T##_f[0] + q; \ + S##_f[1] += (T##_f[0] > S##_f[0]); \ + _FP_FRAC_DEC_2(X, T); \ + R##_f[0] += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + _FP_FRAC_SLL_4(R, (_FP_WORKBITS)); \ + if (X##_f[0] | X##_f[1]) \ + { \ + if (S##_f[1] < X##_f[1] || \ + (S##_f[1] == X##_f[1] && \ + S##_f[0] < X##_f[0])) \ + R##_f[0] |= _FP_WORK_ROUND; \ + R##_f[0] |= _FP_WORK_STICKY; \ + } \ + } while (0) + +#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,4,r,X,Y,un) +#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,4,r,X,Y) +#define FP_CMP_UNORD_E(r,X,Y) _FP_CMP_UNORD(E,4,r,X,Y) + +#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,4,r,X,rsz,rsg) +#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,4,X,r,rs,rt) + +#define _FP_FRAC_HIGH_E(X) (X##_f[2]) +#define _FP_FRAC_HIGH_RAW_E(X) (X##_f[1]) + +#else /* not _FP_W_TYPE_SIZE < 64 */ +union _FP_UNION_E +{ + XFtype flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E); + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_E; + unsigned long frac : _FP_W_TYPE_SIZE; +#else + unsigned long frac : _FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_E; + unsigned sign : 1; +#endif + } bits; +}; + +#define FP_DECL_E(X) _FP_DECL(2,X) + +#define FP_UNPACK_RAW_E(X, val) \ + do { \ + union _FP_UNION_E _flo; _flo.flt = (val); \ + \ + X##_f0 = _flo.bits.frac; \ + X##_f1 = 0; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_UNPACK_RAW_EP(X, val) \ + do { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + X##_f0 = _flo->bits.frac; \ + X##_f1 = 0; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \ + { \ + X##_e++; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } while (0) + +#define FP_PACK_RAW_E(val, X) \ + do { \ + union _FP_UNION_E _flo; \ + \ + if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \ + else X##_f0 &= ~(_FP_IMPLBIT_E); \ + _flo.bits.frac = X##_f0; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define FP_PACK_RAW_EP(fs, val, X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + { \ + union _FP_UNION_E *_flo = \ + (union _FP_UNION_E *)(val); \ + \ + if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \ + else X##_f0 &= ~(_FP_IMPLBIT_E); \ + _flo->bits.frac = X##_f0; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } \ + } while (0) + + +#define FP_UNPACK_E(X,val) \ + do { \ + FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_CANONICAL(E,2,X); \ + } while (0) + +#define FP_UNPACK_EP(X,val) \ + do { \ + FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_CANONICAL(E,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_E(X,val) \ + do { \ + _FP_UNPACK_RAW_E(X,val); \ + _FP_UNPACK_SEMIRAW(E,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_EP(X,val) \ + do { \ + _FP_UNPACK_RAW_EP(X,val); \ + _FP_UNPACK_SEMIRAW(E,2,X); \ + } while (0) + +#define FP_PACK_E(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,2,X); \ + FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_EP(val,X) \ + do { \ + _FP_PACK_CANONICAL(E,2,X); \ + FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_E(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,2,X); \ + _FP_PACK_RAW_E(val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_EP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(E,2,X); \ + _FP_PACK_RAW_EP(val,X); \ + } while (0) + +#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X) +#define FP_NEG_E(R,X) _FP_NEG(E,2,R,X) +#define FP_ADD_E(R,X,Y) _FP_ADD(E,2,R,X,Y) +#define FP_SUB_E(R,X,Y) _FP_SUB(E,2,R,X,Y) +#define FP_MUL_E(R,X,Y) _FP_MUL(E,2,R,X,Y) +#define FP_DIV_E(R,X,Y) _FP_DIV(E,2,R,X,Y) +#define FP_SQRT_E(R,X) _FP_SQRT(E,2,R,X) + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + * We optimize it by doing most of the calculations + * in one UWtype registers instead of two, although we don't + * have to. + */ +#define _FP_SQRT_MEAT_E(R, S, T, X, q) \ + do { \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + _FP_FRAC_SRL_2(X, (_FP_WORKBITS)); \ + while (q) \ + { \ + T##_f0 = S##_f0 + q; \ + if (T##_f0 <= X##_f0) \ + { \ + S##_f0 = T##_f0 + q; \ + X##_f0 -= T##_f0; \ + R##_f0 += q; \ + } \ + _FP_FRAC_SLL_1(X, 1); \ + q >>= 1; \ + } \ + _FP_FRAC_SLL_2(R, (_FP_WORKBITS)); \ + if (X##_f0) \ + { \ + if (S##_f0 < X##_f0) \ + R##_f0 |= _FP_WORK_ROUND; \ + R##_f0 |= _FP_WORK_STICKY; \ + } \ + } while (0) + +#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,2,r,X,Y,un) +#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,2,r,X,Y) +#define FP_CMP_UNORD_E(r,X,Y) _FP_CMP_UNORD(E,2,r,X,Y) + +#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,2,r,X,rsz,rsg) +#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,2,X,r,rs,rt) + +#define _FP_FRAC_HIGH_E(X) (X##_f1) +#define _FP_FRAC_HIGH_RAW_E(X) (X##_f0) + +#endif /* not _FP_W_TYPE_SIZE < 64 */ diff --git a/contrib/gcc/config/soft-fp/extendsfdf2.c b/contrib/gcc/config/soft-fp/extendsfdf2.c new file mode 100644 index 00000000000..fba22d5a197 --- /dev/null +++ b/contrib/gcc/config/soft-fp/extendsfdf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Return a converted to IEEE double + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "double.h" + +DFtype __extendsfdf2(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_RAW_S(A, a); +#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D + FP_EXTEND(D,S,2,1,R,A); +#else + FP_EXTEND(D,S,1,1,R,A); +#endif + FP_PACK_RAW_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/extendsftf2.c b/contrib/gcc/config/soft-fp/extendsftf2.c new file mode 100644 index 00000000000..c43cf1edee5 --- /dev/null +++ b/contrib/gcc/config/soft-fp/extendsftf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Return a converted to IEEE quad + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "quad.h" + +TFtype __extendsftf2(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_RAW_S(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_EXTEND(Q,S,4,1,R,A); +#else + FP_EXTEND(Q,S,2,1,R,A); +#endif + FP_PACK_RAW_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixdfdi.c b/contrib/gcc/config/soft-fp/fixdfdi.c new file mode 100644 index 00000000000..fdfe35af519 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixdfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DItype __fixdfdi(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + UDItype r; + + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, DI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixdfsi.c b/contrib/gcc/config/soft-fp/fixdfsi.c new file mode 100644 index 00000000000..a05f3e39a5f --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixdfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +SItype __fixdfsi(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + USItype r; + + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, SI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixsfdi.c b/contrib/gcc/config/soft-fp/fixsfdi.c new file mode 100644 index 00000000000..384d9bdd536 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixsfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +DItype __fixsfdi(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + UDItype r; + + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, DI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixsfsi.c b/contrib/gcc/config/soft-fp/fixsfsi.c new file mode 100644 index 00000000000..1d40ed05df7 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixsfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SItype __fixsfsi(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + USItype r; + + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, SI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixtfdi.c b/contrib/gcc/config/soft-fp/fixtfdi.c new file mode 100644 index 00000000000..ea10ce2dd3b --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixtfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +DItype __fixtfdi(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + UDItype r; + + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, DI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixtfsi.c b/contrib/gcc/config/soft-fp/fixtfsi.c new file mode 100644 index 00000000000..eb71038bc35 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixtfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit signed integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +SItype __fixtfsi(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + USItype r; + + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, SI_BITS, 1); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunsdfdi.c b/contrib/gcc/config/soft-fp/fixunsdfdi.c new file mode 100644 index 00000000000..d85198f1853 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunsdfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +UDItype __fixunsdfdi(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + UDItype r; + + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, DI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunsdfsi.c b/contrib/gcc/config/soft-fp/fixunsdfsi.c new file mode 100644 index 00000000000..492ffdea680 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunsdfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +USItype __fixunsdfsi(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + USItype r; + + FP_UNPACK_RAW_D(A, a); + FP_TO_INT_D(r, A, SI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunssfdi.c b/contrib/gcc/config/soft-fp/fixunssfdi.c new file mode 100644 index 00000000000..54841538372 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunssfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +UDItype __fixunssfdi(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + UDItype r; + + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, DI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunssfsi.c b/contrib/gcc/config/soft-fp/fixunssfsi.c new file mode 100644 index 00000000000..ac9d4b9654f --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunssfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +USItype __fixunssfsi(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); + USItype r; + + FP_UNPACK_RAW_S(A, a); + FP_TO_INT_S(r, A, SI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunstfdi.c b/contrib/gcc/config/soft-fp/fixunstfdi.c new file mode 100644 index 00000000000..86f1fc85629 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunstfdi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 64bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +UDItype __fixunstfdi(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + UDItype r; + + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, DI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/fixunstfsi.c b/contrib/gcc/config/soft-fp/fixunstfsi.c new file mode 100644 index 00000000000..e0335da4790 --- /dev/null +++ b/contrib/gcc/config/soft-fp/fixunstfsi.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a to 32bit unsigned integer + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +USItype __fixunstfsi(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + USItype r; + + FP_UNPACK_RAW_Q(A, a); + FP_TO_INT_Q(r, A, SI_BITS, 0); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/floatdidf.c b/contrib/gcc/config/soft-fp/floatdidf.c new file mode 100644 index 00000000000..21e9fb1899c --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatdidf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 64bit signed integer to IEEE double + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __floatdidf(DItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + DFtype a; + + FP_FROM_INT_D(A, i, DI_BITS, UDItype); + FP_PACK_RAW_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatdisf.c b/contrib/gcc/config/soft-fp/floatdisf.c new file mode 100644 index 00000000000..ee57915c3b8 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatdisf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 64bit signed integer to IEEE single + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __floatdisf(DItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + SFtype a; + + FP_FROM_INT_S(A, i, DI_BITS, UDItype); + FP_PACK_RAW_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatditf.c b/contrib/gcc/config/soft-fp/floatditf.c new file mode 100644 index 00000000000..564800bc05a --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatditf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 64bit signed integer to IEEE quad + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __floatditf(DItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + TFtype a; + + FP_FROM_INT_Q(A, i, DI_BITS, UDItype); + FP_PACK_RAW_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatsidf.c b/contrib/gcc/config/soft-fp/floatsidf.c new file mode 100644 index 00000000000..b6d5f8d1d2a --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatsidf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 32bit signed integer to IEEE double + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __floatsidf(SItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + DFtype a; + + FP_FROM_INT_D(A, i, SI_BITS, USItype); + FP_PACK_RAW_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatsisf.c b/contrib/gcc/config/soft-fp/floatsisf.c new file mode 100644 index 00000000000..76217fe3478 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatsisf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 32bit signed integer to IEEE single + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __floatsisf(SItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + SFtype a; + + FP_FROM_INT_S(A, i, SI_BITS, USItype); + FP_PACK_RAW_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatsitf.c b/contrib/gcc/config/soft-fp/floatsitf.c new file mode 100644 index 00000000000..8c3d9cc6193 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatsitf.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Convert a 32bit signed integer to IEEE quad + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __floatsitf(SItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + TFtype a; + + FP_FROM_INT_Q(A, i, SI_BITS, USItype); + FP_PACK_RAW_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatundidf.c b/contrib/gcc/config/soft-fp/floatundidf.c new file mode 100644 index 00000000000..2169a3f1988 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatundidf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE double + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +double +__floatundidf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + DFtype a; + + FP_FROM_INT_D(A, i, DI_BITS, UDItype); + FP_PACK_RAW_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatundisf.c b/contrib/gcc/config/soft-fp/floatundisf.c new file mode 100644 index 00000000000..5f08764dc50 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatundisf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE single + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +float +__floatundisf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + SFtype a; + + FP_FROM_INT_S(A, i, DI_BITS, UDItype); + FP_PACK_RAW_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatunditf.c b/contrib/gcc/config/soft-fp/floatunditf.c new file mode 100644 index 00000000000..ab357f051c3 --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatunditf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 64bit unsigned integer to IEEE quad + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype +__floatunditf(UDItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + TFtype a; + + FP_FROM_INT_Q(A, i, DI_BITS, UDItype); + FP_PACK_RAW_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatunsidf.c b/contrib/gcc/config/soft-fp/floatunsidf.c new file mode 100644 index 00000000000..97b488ab68a --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatunsidf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE double + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +double +__floatunsidf(USItype i) +{ + FP_DECL_EX; + FP_DECL_D(A); + DFtype a; + + FP_FROM_INT_D(A, i, SI_BITS, USItype); + FP_PACK_RAW_D(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatunsisf.c b/contrib/gcc/config/soft-fp/floatunsisf.c new file mode 100644 index 00000000000..2ec16ba7b7f --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatunsisf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE single + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +float +__floatunsisf(USItype i) +{ + FP_DECL_EX; + FP_DECL_S(A); + SFtype a; + + FP_FROM_INT_S(A, i, SI_BITS, USItype); + FP_PACK_RAW_S(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/floatunsitf.c b/contrib/gcc/config/soft-fp/floatunsitf.c new file mode 100644 index 00000000000..c993716e54a --- /dev/null +++ b/contrib/gcc/config/soft-fp/floatunsitf.c @@ -0,0 +1,47 @@ +/* Software floating-point emulation. + Convert a 32bit unsigned integer to IEEE quad + Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype +__floatunsitf(USItype i) +{ + FP_DECL_EX; + FP_DECL_Q(A); + TFtype a; + + FP_FROM_INT_Q(A, i, SI_BITS, USItype); + FP_PACK_RAW_Q(a, A); + FP_HANDLE_EXCEPTIONS; + + return a; +} diff --git a/contrib/gcc/config/soft-fp/gedf2.c b/contrib/gcc/config/soft-fp/gedf2.c new file mode 100644 index 00000000000..e0dc8620eee --- /dev/null +++ b/contrib/gcc/config/soft-fp/gedf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +int __gedf2(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_D(r, A, B, -2); + if (r == -2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__gedf2, __gtdf2); diff --git a/contrib/gcc/config/soft-fp/gesf2.c b/contrib/gcc/config/soft-fp/gesf2.c new file mode 100644 index 00000000000..d1f3ba2f9f5 --- /dev/null +++ b/contrib/gcc/config/soft-fp/gesf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +int __gesf2(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_S(r, A, B, -2); + if (r == -2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__gesf2, __gtsf2); diff --git a/contrib/gcc/config/soft-fp/getf2.c b/contrib/gcc/config/soft-fp/getf2.c new file mode 100644 index 00000000000..82ff283d0d9 --- /dev/null +++ b/contrib/gcc/config/soft-fp/getf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, -2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int __getf2(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_Q(r, A, B, -2); + if (r == -2 && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__getf2, __gttf2); diff --git a/contrib/gcc/config/soft-fp/ledf2.c b/contrib/gcc/config/soft-fp/ledf2.c new file mode 100644 index 00000000000..528a9819cef --- /dev/null +++ b/contrib/gcc/config/soft-fp/ledf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +int __ledf2(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_D(r, A, B, 2); + if (r == 2 && (FP_ISSIGNAN_D(A) || FP_ISSIGNAN_D(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__ledf2, __ltdf2); diff --git a/contrib/gcc/config/soft-fp/lesf2.c b/contrib/gcc/config/soft-fp/lesf2.c new file mode 100644 index 00000000000..c564bd9539e --- /dev/null +++ b/contrib/gcc/config/soft-fp/lesf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +int __lesf2(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_S(r, A, B, 2); + if (r == 2 && (FP_ISSIGNAN_S(A) || FP_ISSIGNAN_S(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__lesf2, __ltsf2); diff --git a/contrib/gcc/config/soft-fp/letf2.c b/contrib/gcc/config/soft-fp/letf2.c new file mode 100644 index 00000000000..35e03aaacfe --- /dev/null +++ b/contrib/gcc/config/soft-fp/letf2.c @@ -0,0 +1,51 @@ +/* Software floating-point emulation. + Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int __letf2(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_Q(r, A, B, 2); + if (r == 2 && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))) + FP_SET_EXCEPTION(FP_EX_INVALID); + FP_HANDLE_EXCEPTIONS; + + return r; +} + +strong_alias(__letf2, __lttf2); diff --git a/contrib/gcc/config/soft-fp/muldf3.c b/contrib/gcc/config/soft-fp/muldf3.c new file mode 100644 index 00000000000..7eb2015ae56 --- /dev/null +++ b/contrib/gcc/config/soft-fp/muldf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a * b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __muldf3(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_D(A, a); + FP_UNPACK_D(B, b); + FP_MUL_D(R, A, B); + FP_PACK_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/mulsf3.c b/contrib/gcc/config/soft-fp/mulsf3.c new file mode 100644 index 00000000000..5df44068720 --- /dev/null +++ b/contrib/gcc/config/soft-fp/mulsf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a * b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __mulsf3(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_S(A, a); + FP_UNPACK_S(B, b); + FP_MUL_S(R, A, B); + FP_PACK_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/multf3.c b/contrib/gcc/config/soft-fp/multf3.c new file mode 100644 index 00000000000..0abab6ddc3b --- /dev/null +++ b/contrib/gcc/config/soft-fp/multf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a * b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __multf3(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_Q(A, a); + FP_UNPACK_Q(B, b); + FP_MUL_Q(R, A, B); + FP_PACK_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/negdf2.c b/contrib/gcc/config/soft-fp/negdf2.c new file mode 100644 index 00000000000..54869e9a68d --- /dev/null +++ b/contrib/gcc/config/soft-fp/negdf2.c @@ -0,0 +1,48 @@ +/* Software floating-point emulation. + Return -a + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __negdf2(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(R); + DFtype r; + + FP_UNPACK_D(A, a); + FP_NEG_D(R, A); + FP_PACK_D(r, R); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/negsf2.c b/contrib/gcc/config/soft-fp/negsf2.c new file mode 100644 index 00000000000..bf5db7a452c --- /dev/null +++ b/contrib/gcc/config/soft-fp/negsf2.c @@ -0,0 +1,48 @@ +/* Software floating-point emulation. + Return -a + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __negsf2(SFtype a) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(R); + SFtype r; + + FP_UNPACK_S(A, a); + FP_NEG_S(R, A); + FP_PACK_S(r, R); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/negtf2.c b/contrib/gcc/config/soft-fp/negtf2.c new file mode 100644 index 00000000000..5524c82df1c --- /dev/null +++ b/contrib/gcc/config/soft-fp/negtf2.c @@ -0,0 +1,48 @@ +/* Software floating-point emulation. + Return -a + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __negtf2(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(R); + TFtype r; + + FP_UNPACK_Q(A, a); + FP_NEG_Q(R, A); + FP_PACK_Q(r, R); + FP_CLEAR_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/op-1.h b/contrib/gcc/config/soft-fp/op-1.h new file mode 100644 index 00000000000..35cd0ba7bb1 --- /dev/null +++ b/contrib/gcc/config/soft-fp/op-1.h @@ -0,0 +1,302 @@ +/* Software floating-point emulation. + Basic one-word fraction declaration and manipulation. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#define _FP_FRAC_DECL_1(X) _FP_W_TYPE X##_f +#define _FP_FRAC_COPY_1(D,S) (D##_f = S##_f) +#define _FP_FRAC_SET_1(X,I) (X##_f = I) +#define _FP_FRAC_HIGH_1(X) (X##_f) +#define _FP_FRAC_LOW_1(X) (X##_f) +#define _FP_FRAC_WORD_1(X,w) (X##_f) + +#define _FP_FRAC_ADDI_1(X,I) (X##_f += I) +#define _FP_FRAC_SLL_1(X,N) \ + do { \ + if (__builtin_constant_p(N) && (N) == 1) \ + X##_f += X##_f; \ + else \ + X##_f <<= (N); \ + } while (0) +#define _FP_FRAC_SRL_1(X,N) (X##_f >>= N) + +/* Right shift with sticky-lsb. */ +#define _FP_FRAC_SRST_1(X,S,N,sz) __FP_FRAC_SRST_1(X##_f, S, N, sz) +#define _FP_FRAC_SRS_1(X,N,sz) __FP_FRAC_SRS_1(X##_f, N, sz) + +#define __FP_FRAC_SRST_1(X,S,N,sz) \ +do { \ + S = (__builtin_constant_p(N) && (N) == 1 \ + ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0); \ + X = X >> (N); \ +} while (0) + +#define __FP_FRAC_SRS_1(X,N,sz) \ + (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1 \ + ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0))) + +#define _FP_FRAC_ADD_1(R,X,Y) (R##_f = X##_f + Y##_f) +#define _FP_FRAC_SUB_1(R,X,Y) (R##_f = X##_f - Y##_f) +#define _FP_FRAC_DEC_1(X,Y) (X##_f -= Y##_f) +#define _FP_FRAC_CLZ_1(z, X) __FP_CLZ(z, X##_f) + +/* Predicates */ +#define _FP_FRAC_NEGP_1(X) ((_FP_WS_TYPE)X##_f < 0) +#define _FP_FRAC_ZEROP_1(X) (X##_f == 0) +#define _FP_FRAC_OVERP_1(fs,X) (X##_f & _FP_OVERFLOW_##fs) +#define _FP_FRAC_CLEAR_OVERP_1(fs,X) (X##_f &= ~_FP_OVERFLOW_##fs) +#define _FP_FRAC_EQ_1(X, Y) (X##_f == Y##_f) +#define _FP_FRAC_GE_1(X, Y) (X##_f >= Y##_f) +#define _FP_FRAC_GT_1(X, Y) (X##_f > Y##_f) + +#define _FP_ZEROFRAC_1 0 +#define _FP_MINFRAC_1 1 +#define _FP_MAXFRAC_1 (~(_FP_WS_TYPE)0) + +/* + * Unpack the raw bits of a native fp value. Do not classify or + * normalize the data. + */ + +#define _FP_UNPACK_RAW_1(fs, X, val) \ + do { \ + union _FP_UNION_##fs _flo; _flo.flt = (val); \ + \ + X##_f = _flo.bits.frac; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + } while (0) + +#define _FP_UNPACK_RAW_1_P(fs, X, val) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + X##_f = _flo->bits.frac; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + } while (0) + +/* + * Repack the raw bits of a native fp value. + */ + +#define _FP_PACK_RAW_1(fs, val, X) \ + do { \ + union _FP_UNION_##fs _flo; \ + \ + _flo.bits.frac = X##_f; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define _FP_PACK_RAW_1_P(fs, val, X) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + _flo->bits.frac = X##_f; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } while (0) + + +/* + * Multiplication algorithms: + */ + +/* Basic. Assuming the host word size is >= 2*FRACBITS, we can do the + multiplication immediately. */ + +#define _FP_MUL_MEAT_1_imm(wfracbits, R, X, Y) \ + do { \ + R##_f = X##_f * Y##_f; \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_1(R, wfracbits-1, 2*wfracbits); \ + } while (0) + +/* Given a 1W * 1W => 2W primitive, do the extended multiplication. */ + +#define _FP_MUL_MEAT_1_wide(wfracbits, R, X, Y, doit) \ + do { \ + _FP_W_TYPE _Z_f0, _Z_f1; \ + doit(_Z_f1, _Z_f0, X##_f, Y##_f); \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_2(_Z, wfracbits-1, 2*wfracbits); \ + R##_f = _Z_f0; \ + } while (0) + +/* Finally, a simple widening multiply algorithm. What fun! */ + +#define _FP_MUL_MEAT_1_hard(wfracbits, R, X, Y) \ + do { \ + _FP_W_TYPE _xh, _xl, _yh, _yl, _z_f0, _z_f1, _a_f0, _a_f1; \ + \ + /* split the words in half */ \ + _xh = X##_f >> (_FP_W_TYPE_SIZE/2); \ + _xl = X##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1); \ + _yh = Y##_f >> (_FP_W_TYPE_SIZE/2); \ + _yl = Y##_f & (((_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2)) - 1); \ + \ + /* multiply the pieces */ \ + _z_f0 = _xl * _yl; \ + _a_f0 = _xh * _yl; \ + _a_f1 = _xl * _yh; \ + _z_f1 = _xh * _yh; \ + \ + /* reassemble into two full words */ \ + if ((_a_f0 += _a_f1) < _a_f1) \ + _z_f1 += (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE/2); \ + _a_f1 = _a_f0 >> (_FP_W_TYPE_SIZE/2); \ + _a_f0 = _a_f0 << (_FP_W_TYPE_SIZE/2); \ + _FP_FRAC_ADD_2(_z, _z, _a); \ + \ + /* normalize */ \ + _FP_FRAC_SRS_2(_z, wfracbits - 1, 2*wfracbits); \ + R##_f = _z_f0; \ + } while (0) + + +/* + * Division algorithms: + */ + +/* Basic. Assuming the host word size is >= 2*FRACBITS, we can do the + division immediately. Give this macro either _FP_DIV_HELP_imm for + C primitives or _FP_DIV_HELP_ldiv for the ISO function. Which you + choose will depend on what the compiler does with divrem4. */ + +#define _FP_DIV_MEAT_1_imm(fs, R, X, Y, doit) \ + do { \ + _FP_W_TYPE _q, _r; \ + X##_f <<= (X##_f < Y##_f \ + ? R##_e--, _FP_WFRACBITS_##fs \ + : _FP_WFRACBITS_##fs - 1); \ + doit(_q, _r, X##_f, Y##_f); \ + R##_f = _q | (_r != 0); \ + } while (0) + +/* GCC's longlong.h defines a 2W / 1W => (1W,1W) primitive udiv_qrnnd + that may be useful in this situation. This first is for a primitive + that requires normalization, the second for one that does not. Look + for UDIV_NEEDS_NORMALIZATION to tell which your machine needs. */ + +#define _FP_DIV_MEAT_1_udiv_norm(fs, R, X, Y) \ + do { \ + _FP_W_TYPE _nh, _nl, _q, _r, _y; \ + \ + /* Normalize Y -- i.e. make the most significant bit set. */ \ + _y = Y##_f << _FP_WFRACXBITS_##fs; \ + \ + /* Shift X op correspondingly high, that is, up one full word. */ \ + if (X##_f < Y##_f) \ + { \ + R##_e--; \ + _nl = 0; \ + _nh = X##_f; \ + } \ + else \ + { \ + _nl = X##_f << (_FP_W_TYPE_SIZE - 1); \ + _nh = X##_f >> 1; \ + } \ + \ + udiv_qrnnd(_q, _r, _nh, _nl, _y); \ + R##_f = _q | (_r != 0); \ + } while (0) + +#define _FP_DIV_MEAT_1_udiv(fs, R, X, Y) \ + do { \ + _FP_W_TYPE _nh, _nl, _q, _r; \ + if (X##_f < Y##_f) \ + { \ + R##_e--; \ + _nl = X##_f << _FP_WFRACBITS_##fs; \ + _nh = X##_f >> _FP_WFRACXBITS_##fs; \ + } \ + else \ + { \ + _nl = X##_f << (_FP_WFRACBITS_##fs - 1); \ + _nh = X##_f >> (_FP_WFRACXBITS_##fs + 1); \ + } \ + udiv_qrnnd(_q, _r, _nh, _nl, Y##_f); \ + R##_f = _q | (_r != 0); \ + } while (0) + + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + */ + +#define _FP_SQRT_MEAT_1(R, S, T, X, q) \ + do { \ + while (q != _FP_WORK_ROUND) \ + { \ + T##_f = S##_f + q; \ + if (T##_f <= X##_f) \ + { \ + S##_f = T##_f + q; \ + X##_f -= T##_f; \ + R##_f += q; \ + } \ + _FP_FRAC_SLL_1(X, 1); \ + q >>= 1; \ + } \ + if (X##_f) \ + { \ + if (S##_f < X##_f) \ + R##_f |= _FP_WORK_ROUND; \ + R##_f |= _FP_WORK_STICKY; \ + } \ + } while (0) + +/* + * Assembly/disassembly for converting to/from integral types. + * No shifting or overflow handled here. + */ + +#define _FP_FRAC_ASSEMBLE_1(r, X, rsize) (r = X##_f) +#define _FP_FRAC_DISASSEMBLE_1(X, r, rsize) (X##_f = r) + + +/* + * Convert FP values between word sizes + */ + +#define _FP_FRAC_COPY_1_1(D, S) (D##_f = S##_f) diff --git a/contrib/gcc/config/soft-fp/op-2.h b/contrib/gcc/config/soft-fp/op-2.h new file mode 100644 index 00000000000..5c9bce4c179 --- /dev/null +++ b/contrib/gcc/config/soft-fp/op-2.h @@ -0,0 +1,615 @@ +/* Software floating-point emulation. + Basic two-word fraction declaration and manipulation. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#define _FP_FRAC_DECL_2(X) _FP_W_TYPE X##_f0, X##_f1 +#define _FP_FRAC_COPY_2(D,S) (D##_f0 = S##_f0, D##_f1 = S##_f1) +#define _FP_FRAC_SET_2(X,I) __FP_FRAC_SET_2(X, I) +#define _FP_FRAC_HIGH_2(X) (X##_f1) +#define _FP_FRAC_LOW_2(X) (X##_f0) +#define _FP_FRAC_WORD_2(X,w) (X##_f##w) + +#define _FP_FRAC_SLL_2(X,N) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + if (__builtin_constant_p(N) && (N) == 1) \ + { \ + X##_f1 = X##_f1 + X##_f1 + (((_FP_WS_TYPE)(X##_f0)) < 0); \ + X##_f0 += X##_f0; \ + } \ + else \ + { \ + X##_f1 = X##_f1 << (N) | X##_f0 >> (_FP_W_TYPE_SIZE - (N)); \ + X##_f0 <<= (N); \ + } \ + 0; \ + }) \ + : ({ \ + X##_f1 = X##_f0 << ((N) - _FP_W_TYPE_SIZE); \ + X##_f0 = 0; \ + })) + + +#define _FP_FRAC_SRL_2(X,N) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + X##_f0 = X##_f0 >> (N) | X##_f1 << (_FP_W_TYPE_SIZE - (N)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + X##_f0 = X##_f1 >> ((N) - _FP_W_TYPE_SIZE); \ + X##_f1 = 0; \ + })) + +/* Right shift with sticky-lsb. */ +#define _FP_FRAC_SRST_2(X,S, N,sz) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + S = (__builtin_constant_p(N) && (N) == 1 \ + ? X##_f0 & 1 \ + : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0); \ + X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + S = ((((N) == _FP_W_TYPE_SIZE \ + ? 0 \ + : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \ + | X##_f0) != 0); \ + X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE)); \ + X##_f1 = 0; \ + })) + +#define _FP_FRAC_SRS_2(X,N,sz) \ +(void)(((N) < _FP_W_TYPE_SIZE) \ + ? ({ \ + X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) | \ + (__builtin_constant_p(N) && (N) == 1 \ + ? X##_f0 & 1 \ + : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \ + X##_f1 >>= (N); \ + }) \ + : ({ \ + X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) | \ + ((((N) == _FP_W_TYPE_SIZE \ + ? 0 \ + : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \ + | X##_f0) != 0)); \ + X##_f1 = 0; \ + })) + +#define _FP_FRAC_ADDI_2(X,I) \ + __FP_FRAC_ADDI_2(X##_f1, X##_f0, I) + +#define _FP_FRAC_ADD_2(R,X,Y) \ + __FP_FRAC_ADD_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0) + +#define _FP_FRAC_SUB_2(R,X,Y) \ + __FP_FRAC_SUB_2(R##_f1, R##_f0, X##_f1, X##_f0, Y##_f1, Y##_f0) + +#define _FP_FRAC_DEC_2(X,Y) \ + __FP_FRAC_DEC_2(X##_f1, X##_f0, Y##_f1, Y##_f0) + +#define _FP_FRAC_CLZ_2(R,X) \ + do { \ + if (X##_f1) \ + __FP_CLZ(R,X##_f1); \ + else \ + { \ + __FP_CLZ(R,X##_f0); \ + R += _FP_W_TYPE_SIZE; \ + } \ + } while(0) + +/* Predicates */ +#define _FP_FRAC_NEGP_2(X) ((_FP_WS_TYPE)X##_f1 < 0) +#define _FP_FRAC_ZEROP_2(X) ((X##_f1 | X##_f0) == 0) +#define _FP_FRAC_OVERP_2(fs,X) (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs) +#define _FP_FRAC_CLEAR_OVERP_2(fs,X) (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs) +#define _FP_FRAC_EQ_2(X, Y) (X##_f1 == Y##_f1 && X##_f0 == Y##_f0) +#define _FP_FRAC_GT_2(X, Y) \ + (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 > Y##_f0)) +#define _FP_FRAC_GE_2(X, Y) \ + (X##_f1 > Y##_f1 || (X##_f1 == Y##_f1 && X##_f0 >= Y##_f0)) + +#define _FP_ZEROFRAC_2 0, 0 +#define _FP_MINFRAC_2 0, 1 +#define _FP_MAXFRAC_2 (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0) + +/* + * Internals + */ + +#define __FP_FRAC_SET_2(X,I1,I0) (X##_f0 = I0, X##_f1 = I1) + +#define __FP_CLZ_2(R, xh, xl) \ + do { \ + if (xh) \ + __FP_CLZ(R,xh); \ + else \ + { \ + __FP_CLZ(R,xl); \ + R += _FP_W_TYPE_SIZE; \ + } \ + } while(0) + +#if 0 + +#ifndef __FP_FRAC_ADDI_2 +#define __FP_FRAC_ADDI_2(xh, xl, i) \ + (xh += ((xl += i) < i)) +#endif +#ifndef __FP_FRAC_ADD_2 +#define __FP_FRAC_ADD_2(rh, rl, xh, xl, yh, yl) \ + (rh = xh + yh + ((rl = xl + yl) < xl)) +#endif +#ifndef __FP_FRAC_SUB_2 +#define __FP_FRAC_SUB_2(rh, rl, xh, xl, yh, yl) \ + (rh = xh - yh - ((rl = xl - yl) > xl)) +#endif +#ifndef __FP_FRAC_DEC_2 +#define __FP_FRAC_DEC_2(xh, xl, yh, yl) \ + do { \ + UWtype _t = xl; \ + xh -= yh + ((xl -= yl) > _t); \ + } while (0) +#endif + +#else + +#undef __FP_FRAC_ADDI_2 +#define __FP_FRAC_ADDI_2(xh, xl, i) add_ssaaaa(xh, xl, xh, xl, 0, i) +#undef __FP_FRAC_ADD_2 +#define __FP_FRAC_ADD_2 add_ssaaaa +#undef __FP_FRAC_SUB_2 +#define __FP_FRAC_SUB_2 sub_ddmmss +#undef __FP_FRAC_DEC_2 +#define __FP_FRAC_DEC_2(xh, xl, yh, yl) sub_ddmmss(xh, xl, xh, xl, yh, yl) + +#endif + +/* + * Unpack the raw bits of a native fp value. Do not classify or + * normalize the data. + */ + +#define _FP_UNPACK_RAW_2(fs, X, val) \ + do { \ + union _FP_UNION_##fs _flo; _flo.flt = (val); \ + \ + X##_f0 = _flo.bits.frac0; \ + X##_f1 = _flo.bits.frac1; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + } while (0) + +#define _FP_UNPACK_RAW_2_P(fs, X, val) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + X##_f0 = _flo->bits.frac0; \ + X##_f1 = _flo->bits.frac1; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + } while (0) + + +/* + * Repack the raw bits of a native fp value. + */ + +#define _FP_PACK_RAW_2(fs, val, X) \ + do { \ + union _FP_UNION_##fs _flo; \ + \ + _flo.bits.frac0 = X##_f0; \ + _flo.bits.frac1 = X##_f1; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + \ + (val) = _flo.flt; \ + } while (0) + +#define _FP_PACK_RAW_2_P(fs, val, X) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + _flo->bits.frac0 = X##_f0; \ + _flo->bits.frac1 = X##_f1; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } while (0) + + +/* + * Multiplication algorithms: + */ + +/* Given a 1W * 1W => 2W primitive, do the extended multiplication. */ + +#define _FP_MUL_MEAT_2_wide(wfracbits, R, X, Y, doit) \ + do { \ + _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c); \ + \ + doit(_FP_FRAC_WORD_4(_z,1), _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0); \ + doit(_b_f1, _b_f0, X##_f0, Y##_f1); \ + doit(_c_f1, _c_f0, X##_f1, Y##_f0); \ + doit(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), X##_f1, Y##_f1); \ + \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1), 0, _b_f1, _b_f0, \ + _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0, \ + _FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1)); \ + \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits); \ + R##_f0 = _FP_FRAC_WORD_4(_z,0); \ + R##_f1 = _FP_FRAC_WORD_4(_z,1); \ + } while (0) + +/* Given a 1W * 1W => 2W primitive, do the extended multiplication. + Do only 3 multiplications instead of four. This one is for machines + where multiplication is much more expensive than subtraction. */ + +#define _FP_MUL_MEAT_2_wide_3mul(wfracbits, R, X, Y, doit) \ + do { \ + _FP_FRAC_DECL_4(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c); \ + _FP_W_TYPE _d; \ + int _c1, _c2; \ + \ + _b_f0 = X##_f0 + X##_f1; \ + _c1 = _b_f0 < X##_f0; \ + _b_f1 = Y##_f0 + Y##_f1; \ + _c2 = _b_f1 < Y##_f0; \ + doit(_d, _FP_FRAC_WORD_4(_z,0), X##_f0, Y##_f0); \ + doit(_FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1), _b_f0, _b_f1); \ + doit(_c_f1, _c_f0, X##_f1, Y##_f1); \ + \ + _b_f0 &= -_c2; \ + _b_f1 &= -_c1; \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1), (_c1 & _c2), 0, _d, \ + 0, _FP_FRAC_WORD_4(_z,2), _FP_FRAC_WORD_4(_z,1)); \ + __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _b_f0); \ + __FP_FRAC_ADDI_2(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _b_f1); \ + __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1), \ + 0, _d, _FP_FRAC_WORD_4(_z,0)); \ + __FP_FRAC_DEC_3(_FP_FRAC_WORD_4(_z,3),_FP_FRAC_WORD_4(_z,2), \ + _FP_FRAC_WORD_4(_z,1), 0, _c_f1, _c_f0); \ + __FP_FRAC_ADD_2(_FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2), \ + _c_f1, _c_f0, \ + _FP_FRAC_WORD_4(_z,3), _FP_FRAC_WORD_4(_z,2)); \ + \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits); \ + R##_f0 = _FP_FRAC_WORD_4(_z,0); \ + R##_f1 = _FP_FRAC_WORD_4(_z,1); \ + } while (0) + +#define _FP_MUL_MEAT_2_gmp(wfracbits, R, X, Y) \ + do { \ + _FP_FRAC_DECL_4(_z); \ + _FP_W_TYPE _x[2], _y[2]; \ + _x[0] = X##_f0; _x[1] = X##_f1; \ + _y[0] = Y##_f0; _y[1] = Y##_f1; \ + \ + mpn_mul_n(_z_f, _x, _y, 2); \ + \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_4(_z, wfracbits-1, 2*wfracbits); \ + R##_f0 = _z_f[0]; \ + R##_f1 = _z_f[1]; \ + } while (0) + +/* Do at most 120x120=240 bits multiplication using double floating + point multiplication. This is useful if floating point + multiplication has much bigger throughput than integer multiply. + It is supposed to work for _FP_W_TYPE_SIZE 64 and wfracbits + between 106 and 120 only. + Caller guarantees that X and Y has (1LLL << (wfracbits - 1)) set. + SETFETZ is a macro which will disable all FPU exceptions and set rounding + towards zero, RESETFE should optionally reset it back. */ + +#define _FP_MUL_MEAT_2_120_240_double(wfracbits, R, X, Y, setfetz, resetfe) \ + do { \ + static const double _const[] = { \ + /* 2^-24 */ 5.9604644775390625e-08, \ + /* 2^-48 */ 3.5527136788005009e-15, \ + /* 2^-72 */ 2.1175823681357508e-22, \ + /* 2^-96 */ 1.2621774483536189e-29, \ + /* 2^28 */ 2.68435456e+08, \ + /* 2^4 */ 1.600000e+01, \ + /* 2^-20 */ 9.5367431640625e-07, \ + /* 2^-44 */ 5.6843418860808015e-14, \ + /* 2^-68 */ 3.3881317890172014e-21, \ + /* 2^-92 */ 2.0194839173657902e-28, \ + /* 2^-116 */ 1.2037062152420224e-35}; \ + double _a240, _b240, _c240, _d240, _e240, _f240, \ + _g240, _h240, _i240, _j240, _k240; \ + union { double d; UDItype i; } _l240, _m240, _n240, _o240, \ + _p240, _q240, _r240, _s240; \ + UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0; \ + \ + if (wfracbits < 106 || wfracbits > 120) \ + abort(); \ + \ + setfetz; \ + \ + _e240 = (double)(long)(X##_f0 & 0xffffff); \ + _j240 = (double)(long)(Y##_f0 & 0xffffff); \ + _d240 = (double)(long)((X##_f0 >> 24) & 0xffffff); \ + _i240 = (double)(long)((Y##_f0 >> 24) & 0xffffff); \ + _c240 = (double)(long)(((X##_f1 << 16) & 0xffffff) | (X##_f0 >> 48)); \ + _h240 = (double)(long)(((Y##_f1 << 16) & 0xffffff) | (Y##_f0 >> 48)); \ + _b240 = (double)(long)((X##_f1 >> 8) & 0xffffff); \ + _g240 = (double)(long)((Y##_f1 >> 8) & 0xffffff); \ + _a240 = (double)(long)(X##_f1 >> 32); \ + _f240 = (double)(long)(Y##_f1 >> 32); \ + _e240 *= _const[3]; \ + _j240 *= _const[3]; \ + _d240 *= _const[2]; \ + _i240 *= _const[2]; \ + _c240 *= _const[1]; \ + _h240 *= _const[1]; \ + _b240 *= _const[0]; \ + _g240 *= _const[0]; \ + _s240.d = _e240*_j240;\ + _r240.d = _d240*_j240 + _e240*_i240;\ + _q240.d = _c240*_j240 + _d240*_i240 + _e240*_h240;\ + _p240.d = _b240*_j240 + _c240*_i240 + _d240*_h240 + _e240*_g240;\ + _o240.d = _a240*_j240 + _b240*_i240 + _c240*_h240 + _d240*_g240 + _e240*_f240;\ + _n240.d = _a240*_i240 + _b240*_h240 + _c240*_g240 + _d240*_f240; \ + _m240.d = _a240*_h240 + _b240*_g240 + _c240*_f240; \ + _l240.d = _a240*_g240 + _b240*_f240; \ + _k240 = _a240*_f240; \ + _r240.d += _s240.d; \ + _q240.d += _r240.d; \ + _p240.d += _q240.d; \ + _o240.d += _p240.d; \ + _n240.d += _o240.d; \ + _m240.d += _n240.d; \ + _l240.d += _m240.d; \ + _k240 += _l240.d; \ + _s240.d -= ((_const[10]+_s240.d)-_const[10]); \ + _r240.d -= ((_const[9]+_r240.d)-_const[9]); \ + _q240.d -= ((_const[8]+_q240.d)-_const[8]); \ + _p240.d -= ((_const[7]+_p240.d)-_const[7]); \ + _o240.d += _const[7]; \ + _n240.d += _const[6]; \ + _m240.d += _const[5]; \ + _l240.d += _const[4]; \ + if (_s240.d != 0.0) _y240 = 1; \ + if (_r240.d != 0.0) _y240 = 1; \ + if (_q240.d != 0.0) _y240 = 1; \ + if (_p240.d != 0.0) _y240 = 1; \ + _t240 = (DItype)_k240; \ + _u240 = _l240.i; \ + _v240 = _m240.i; \ + _w240 = _n240.i; \ + _x240 = _o240.i; \ + R##_f1 = (_t240 << (128 - (wfracbits - 1))) \ + | ((_u240 & 0xffffff) >> ((wfracbits - 1) - 104)); \ + R##_f0 = ((_u240 & 0xffffff) << (168 - (wfracbits - 1))) \ + | ((_v240 & 0xffffff) << (144 - (wfracbits - 1))) \ + | ((_w240 & 0xffffff) << (120 - (wfracbits - 1))) \ + | ((_x240 & 0xffffff) >> ((wfracbits - 1) - 96)) \ + | _y240; \ + resetfe; \ + } while (0) + +/* + * Division algorithms: + */ + +#define _FP_DIV_MEAT_2_udiv(fs, R, X, Y) \ + do { \ + _FP_W_TYPE _n_f2, _n_f1, _n_f0, _r_f1, _r_f0, _m_f1, _m_f0; \ + if (_FP_FRAC_GT_2(X, Y)) \ + { \ + _n_f2 = X##_f1 >> 1; \ + _n_f1 = X##_f1 << (_FP_W_TYPE_SIZE - 1) | X##_f0 >> 1; \ + _n_f0 = X##_f0 << (_FP_W_TYPE_SIZE - 1); \ + } \ + else \ + { \ + R##_e--; \ + _n_f2 = X##_f1; \ + _n_f1 = X##_f0; \ + _n_f0 = 0; \ + } \ + \ + /* Normalize, i.e. make the most significant bit of the \ + denominator set. */ \ + _FP_FRAC_SLL_2(Y, _FP_WFRACXBITS_##fs); \ + \ + udiv_qrnnd(R##_f1, _r_f1, _n_f2, _n_f1, Y##_f1); \ + umul_ppmm(_m_f1, _m_f0, R##_f1, Y##_f0); \ + _r_f0 = _n_f0; \ + if (_FP_FRAC_GT_2(_m, _r)) \ + { \ + R##_f1--; \ + _FP_FRAC_ADD_2(_r, Y, _r); \ + if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r)) \ + { \ + R##_f1--; \ + _FP_FRAC_ADD_2(_r, Y, _r); \ + } \ + } \ + _FP_FRAC_DEC_2(_r, _m); \ + \ + if (_r_f1 == Y##_f1) \ + { \ + /* This is a special case, not an optimization \ + (_r/Y##_f1 would not fit into UWtype). \ + As _r is guaranteed to be < Y, R##_f0 can be either \ + (UWtype)-1 or (UWtype)-2. But as we know what kind \ + of bits it is (sticky, guard, round), we don't care. \ + We also don't care what the reminder is, because the \ + guard bit will be set anyway. -jj */ \ + R##_f0 = -1; \ + } \ + else \ + { \ + udiv_qrnnd(R##_f0, _r_f1, _r_f1, _r_f0, Y##_f1); \ + umul_ppmm(_m_f1, _m_f0, R##_f0, Y##_f0); \ + _r_f0 = 0; \ + if (_FP_FRAC_GT_2(_m, _r)) \ + { \ + R##_f0--; \ + _FP_FRAC_ADD_2(_r, Y, _r); \ + if (_FP_FRAC_GE_2(_r, Y) && _FP_FRAC_GT_2(_m, _r)) \ + { \ + R##_f0--; \ + _FP_FRAC_ADD_2(_r, Y, _r); \ + } \ + } \ + if (!_FP_FRAC_EQ_2(_r, _m)) \ + R##_f0 |= _FP_WORK_STICKY; \ + } \ + } while (0) + + +#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y) \ + do { \ + _FP_W_TYPE _x[4], _y[2], _z[4]; \ + _y[0] = Y##_f0; _y[1] = Y##_f1; \ + _x[0] = _x[3] = 0; \ + if (_FP_FRAC_GT_2(X, Y)) \ + { \ + R##_e++; \ + _x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE) | \ + X##_f1 >> (_FP_W_TYPE_SIZE - \ + (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE))); \ + _x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE); \ + } \ + else \ + { \ + _x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE) | \ + X##_f1 >> (_FP_W_TYPE_SIZE - \ + (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE))); \ + _x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE); \ + } \ + \ + (void) mpn_divrem (_z, 0, _x, 4, _y, 2); \ + R##_f1 = _z[1]; \ + R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0); \ + } while (0) + + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + */ + +#define _FP_SQRT_MEAT_2(R, S, T, X, q) \ + do { \ + while (q) \ + { \ + T##_f1 = S##_f1 + q; \ + if (T##_f1 <= X##_f1) \ + { \ + S##_f1 = T##_f1 + q; \ + X##_f1 -= T##_f1; \ + R##_f1 += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q != _FP_WORK_ROUND) \ + { \ + T##_f0 = S##_f0 + q; \ + T##_f1 = S##_f1; \ + if (T##_f1 < X##_f1 || \ + (T##_f1 == X##_f1 && T##_f0 <= X##_f0)) \ + { \ + S##_f0 = T##_f0 + q; \ + S##_f1 += (T##_f0 > S##_f0); \ + _FP_FRAC_DEC_2(X, T); \ + R##_f0 += q; \ + } \ + _FP_FRAC_SLL_2(X, 1); \ + q >>= 1; \ + } \ + if (X##_f0 | X##_f1) \ + { \ + if (S##_f1 < X##_f1 || \ + (S##_f1 == X##_f1 && S##_f0 < X##_f0)) \ + R##_f0 |= _FP_WORK_ROUND; \ + R##_f0 |= _FP_WORK_STICKY; \ + } \ + } while (0) + + +/* + * Assembly/disassembly for converting to/from integral types. + * No shifting or overflow handled here. + */ + +#define _FP_FRAC_ASSEMBLE_2(r, X, rsize) \ +(void)((rsize <= _FP_W_TYPE_SIZE) \ + ? ({ r = X##_f0; }) \ + : ({ \ + r = X##_f1; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f0; \ + })) + +#define _FP_FRAC_DISASSEMBLE_2(X, r, rsize) \ + do { \ + X##_f0 = r; \ + X##_f1 = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE); \ + } while (0) + +/* + * Convert FP values between word sizes + */ + +#define _FP_FRAC_COPY_1_2(D, S) (D##_f = S##_f0) + +#define _FP_FRAC_COPY_2_1(D, S) ((D##_f0 = S##_f), (D##_f1 = 0)) diff --git a/contrib/gcc/config/soft-fp/op-4.h b/contrib/gcc/config/soft-fp/op-4.h new file mode 100644 index 00000000000..1b90535c56e --- /dev/null +++ b/contrib/gcc/config/soft-fp/op-4.h @@ -0,0 +1,686 @@ +/* Software floating-point emulation. + Basic four-word fraction declaration and manipulation. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#define _FP_FRAC_DECL_4(X) _FP_W_TYPE X##_f[4] +#define _FP_FRAC_COPY_4(D,S) \ + (D##_f[0] = S##_f[0], D##_f[1] = S##_f[1], \ + D##_f[2] = S##_f[2], D##_f[3] = S##_f[3]) +#define _FP_FRAC_SET_4(X,I) __FP_FRAC_SET_4(X, I) +#define _FP_FRAC_HIGH_4(X) (X##_f[3]) +#define _FP_FRAC_LOW_4(X) (X##_f[0]) +#define _FP_FRAC_WORD_4(X,w) (X##_f[w]) + +#define _FP_FRAC_SLL_4(X,N) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _up = (N) % _FP_W_TYPE_SIZE; \ + _down = _FP_W_TYPE_SIZE - _up; \ + if (!_up) \ + for (_i = 3; _i >= _skip; --_i) \ + X##_f[_i] = X##_f[_i-_skip]; \ + else \ + { \ + for (_i = 3; _i > _skip; --_i) \ + X##_f[_i] = X##_f[_i-_skip] << _up \ + | X##_f[_i-_skip-1] >> _down; \ + X##_f[_i--] = X##_f[0] << _up; \ + } \ + for (; _i >= 0; --_i) \ + X##_f[_i] = 0; \ + } while (0) + +/* This one was broken too */ +#define _FP_FRAC_SRL_4(X,N) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _down = (N) % _FP_W_TYPE_SIZE; \ + _up = _FP_W_TYPE_SIZE - _down; \ + if (!_down) \ + for (_i = 0; _i <= 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip]; \ + else \ + { \ + for (_i = 0; _i < 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip] >> _down \ + | X##_f[_i+_skip+1] << _up; \ + X##_f[_i++] = X##_f[3] >> _down; \ + } \ + for (; _i < 4; ++_i) \ + X##_f[_i] = 0; \ + } while (0) + + +/* Right shift with sticky-lsb. + * What this actually means is that we do a standard right-shift, + * but that if any of the bits that fall off the right hand side + * were one then we always set the LSbit. + */ +#define _FP_FRAC_SRST_4(X,S,N,size) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _FP_W_TYPE _s; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _down = (N) % _FP_W_TYPE_SIZE; \ + _up = _FP_W_TYPE_SIZE - _down; \ + for (_s = _i = 0; _i < _skip; ++_i) \ + _s |= X##_f[_i]; \ + if (!_down) \ + for (_i = 0; _i <= 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip]; \ + else \ + { \ + _s |= X##_f[_i] << _up; \ + for (_i = 0; _i < 3-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip] >> _down \ + | X##_f[_i+_skip+1] << _up; \ + X##_f[_i++] = X##_f[3] >> _down; \ + } \ + for (; _i < 4; ++_i) \ + X##_f[_i] = 0; \ + S = (_s != 0); \ + } while (0) + +#define _FP_FRAC_SRS_4(X,N,size) \ + do { \ + int _sticky; \ + _FP_FRAC_SRST_4(X, _sticky, N, size); \ + X##_f[0] |= _sticky; \ + } while (0) + +#define _FP_FRAC_ADD_4(R,X,Y) \ + __FP_FRAC_ADD_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0], \ + X##_f[3], X##_f[2], X##_f[1], X##_f[0], \ + Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0]) + +#define _FP_FRAC_SUB_4(R,X,Y) \ + __FP_FRAC_SUB_4(R##_f[3], R##_f[2], R##_f[1], R##_f[0], \ + X##_f[3], X##_f[2], X##_f[1], X##_f[0], \ + Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0]) + +#define _FP_FRAC_DEC_4(X,Y) \ + __FP_FRAC_DEC_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], \ + Y##_f[3], Y##_f[2], Y##_f[1], Y##_f[0]) + +#define _FP_FRAC_ADDI_4(X,I) \ + __FP_FRAC_ADDI_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], I) + +#define _FP_ZEROFRAC_4 0,0,0,0 +#define _FP_MINFRAC_4 0,0,0,1 +#define _FP_MAXFRAC_4 (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0), (~(_FP_WS_TYPE)0) + +#define _FP_FRAC_ZEROP_4(X) ((X##_f[0] | X##_f[1] | X##_f[2] | X##_f[3]) == 0) +#define _FP_FRAC_NEGP_4(X) ((_FP_WS_TYPE)X##_f[3] < 0) +#define _FP_FRAC_OVERP_4(fs,X) (_FP_FRAC_HIGH_##fs(X) & _FP_OVERFLOW_##fs) +#define _FP_FRAC_CLEAR_OVERP_4(fs,X) (_FP_FRAC_HIGH_##fs(X) &= ~_FP_OVERFLOW_##fs) + +#define _FP_FRAC_EQ_4(X,Y) \ + (X##_f[0] == Y##_f[0] && X##_f[1] == Y##_f[1] \ + && X##_f[2] == Y##_f[2] && X##_f[3] == Y##_f[3]) + +#define _FP_FRAC_GT_4(X,Y) \ + (X##_f[3] > Y##_f[3] || \ + (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] || \ + (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] || \ + (X##_f[1] == Y##_f[1] && X##_f[0] > Y##_f[0]) \ + )) \ + )) \ + ) + +#define _FP_FRAC_GE_4(X,Y) \ + (X##_f[3] > Y##_f[3] || \ + (X##_f[3] == Y##_f[3] && (X##_f[2] > Y##_f[2] || \ + (X##_f[2] == Y##_f[2] && (X##_f[1] > Y##_f[1] || \ + (X##_f[1] == Y##_f[1] && X##_f[0] >= Y##_f[0]) \ + )) \ + )) \ + ) + + +#define _FP_FRAC_CLZ_4(R,X) \ + do { \ + if (X##_f[3]) \ + { \ + __FP_CLZ(R,X##_f[3]); \ + } \ + else if (X##_f[2]) \ + { \ + __FP_CLZ(R,X##_f[2]); \ + R += _FP_W_TYPE_SIZE; \ + } \ + else if (X##_f[1]) \ + { \ + __FP_CLZ(R,X##_f[1]); \ + R += _FP_W_TYPE_SIZE*2; \ + } \ + else \ + { \ + __FP_CLZ(R,X##_f[0]); \ + R += _FP_W_TYPE_SIZE*3; \ + } \ + } while(0) + + +#define _FP_UNPACK_RAW_4(fs, X, val) \ + do { \ + union _FP_UNION_##fs _flo; _flo.flt = (val); \ + X##_f[0] = _flo.bits.frac0; \ + X##_f[1] = _flo.bits.frac1; \ + X##_f[2] = _flo.bits.frac2; \ + X##_f[3] = _flo.bits.frac3; \ + X##_e = _flo.bits.exp; \ + X##_s = _flo.bits.sign; \ + } while (0) + +#define _FP_UNPACK_RAW_4_P(fs, X, val) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + X##_f[0] = _flo->bits.frac0; \ + X##_f[1] = _flo->bits.frac1; \ + X##_f[2] = _flo->bits.frac2; \ + X##_f[3] = _flo->bits.frac3; \ + X##_e = _flo->bits.exp; \ + X##_s = _flo->bits.sign; \ + } while (0) + +#define _FP_PACK_RAW_4(fs, val, X) \ + do { \ + union _FP_UNION_##fs _flo; \ + _flo.bits.frac0 = X##_f[0]; \ + _flo.bits.frac1 = X##_f[1]; \ + _flo.bits.frac2 = X##_f[2]; \ + _flo.bits.frac3 = X##_f[3]; \ + _flo.bits.exp = X##_e; \ + _flo.bits.sign = X##_s; \ + (val) = _flo.flt; \ + } while (0) + +#define _FP_PACK_RAW_4_P(fs, val, X) \ + do { \ + union _FP_UNION_##fs *_flo = \ + (union _FP_UNION_##fs *)(val); \ + \ + _flo->bits.frac0 = X##_f[0]; \ + _flo->bits.frac1 = X##_f[1]; \ + _flo->bits.frac2 = X##_f[2]; \ + _flo->bits.frac3 = X##_f[3]; \ + _flo->bits.exp = X##_e; \ + _flo->bits.sign = X##_s; \ + } while (0) + +/* + * Multiplication algorithms: + */ + +/* Given a 1W * 1W => 2W primitive, do the extended multiplication. */ + +#define _FP_MUL_MEAT_4_wide(wfracbits, R, X, Y, doit) \ + do { \ + _FP_FRAC_DECL_8(_z); _FP_FRAC_DECL_2(_b); _FP_FRAC_DECL_2(_c); \ + _FP_FRAC_DECL_2(_d); _FP_FRAC_DECL_2(_e); _FP_FRAC_DECL_2(_f); \ + \ + doit(_FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0), X##_f[0], Y##_f[0]); \ + doit(_b_f1, _b_f0, X##_f[0], Y##_f[1]); \ + doit(_c_f1, _c_f0, X##_f[1], Y##_f[0]); \ + doit(_d_f1, _d_f0, X##_f[1], Y##_f[1]); \ + doit(_e_f1, _e_f0, X##_f[0], Y##_f[2]); \ + doit(_f_f1, _f_f0, X##_f[2], Y##_f[0]); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2), \ + _FP_FRAC_WORD_8(_z,1), 0,_b_f1,_b_f0, \ + 0,0,_FP_FRAC_WORD_8(_z,1)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2), \ + _FP_FRAC_WORD_8(_z,1), 0,_c_f1,_c_f0, \ + _FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2), \ + _FP_FRAC_WORD_8(_z,1)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3), \ + _FP_FRAC_WORD_8(_z,2), 0,_d_f1,_d_f0, \ + 0,_FP_FRAC_WORD_8(_z,3),_FP_FRAC_WORD_8(_z,2)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3), \ + _FP_FRAC_WORD_8(_z,2), 0,_e_f1,_e_f0, \ + _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3), \ + _FP_FRAC_WORD_8(_z,2)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3), \ + _FP_FRAC_WORD_8(_z,2), 0,_f_f1,_f_f0, \ + _FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3), \ + _FP_FRAC_WORD_8(_z,2)); \ + doit(_b_f1, _b_f0, X##_f[0], Y##_f[3]); \ + doit(_c_f1, _c_f0, X##_f[3], Y##_f[0]); \ + doit(_d_f1, _d_f0, X##_f[1], Y##_f[2]); \ + doit(_e_f1, _e_f0, X##_f[2], Y##_f[1]); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3), 0,_b_f1,_b_f0, \ + 0,_FP_FRAC_WORD_8(_z,4),_FP_FRAC_WORD_8(_z,3)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3), 0,_c_f1,_c_f0, \ + _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3), 0,_d_f1,_d_f0, \ + _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3), 0,_e_f1,_e_f0, \ + _FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4), \ + _FP_FRAC_WORD_8(_z,3)); \ + doit(_b_f1, _b_f0, X##_f[2], Y##_f[2]); \ + doit(_c_f1, _c_f0, X##_f[1], Y##_f[3]); \ + doit(_d_f1, _d_f0, X##_f[3], Y##_f[1]); \ + doit(_e_f1, _e_f0, X##_f[2], Y##_f[3]); \ + doit(_f_f1, _f_f0, X##_f[3], Y##_f[2]); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5), \ + _FP_FRAC_WORD_8(_z,4), 0,_b_f1,_b_f0, \ + 0,_FP_FRAC_WORD_8(_z,5),_FP_FRAC_WORD_8(_z,4)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5), \ + _FP_FRAC_WORD_8(_z,4), 0,_c_f1,_c_f0, \ + _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5), \ + _FP_FRAC_WORD_8(_z,4)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5), \ + _FP_FRAC_WORD_8(_z,4), 0,_d_f1,_d_f0, \ + _FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5), \ + _FP_FRAC_WORD_8(_z,4)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6), \ + _FP_FRAC_WORD_8(_z,5), 0,_e_f1,_e_f0, \ + 0,_FP_FRAC_WORD_8(_z,6),_FP_FRAC_WORD_8(_z,5)); \ + __FP_FRAC_ADD_3(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6), \ + _FP_FRAC_WORD_8(_z,5), 0,_f_f1,_f_f0, \ + _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6), \ + _FP_FRAC_WORD_8(_z,5)); \ + doit(_b_f1, _b_f0, X##_f[3], Y##_f[3]); \ + __FP_FRAC_ADD_2(_FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6), \ + _b_f1,_b_f0, \ + _FP_FRAC_WORD_8(_z,7),_FP_FRAC_WORD_8(_z,6)); \ + \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits); \ + __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2), \ + _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0)); \ + } while (0) + +#define _FP_MUL_MEAT_4_gmp(wfracbits, R, X, Y) \ + do { \ + _FP_FRAC_DECL_8(_z); \ + \ + mpn_mul_n(_z_f, _x_f, _y_f, 4); \ + \ + /* Normalize since we know where the msb of the multiplicands \ + were (bit B), we know that the msb of the of the product is \ + at either 2B or 2B-1. */ \ + _FP_FRAC_SRS_8(_z, wfracbits-1, 2*wfracbits); \ + __FP_FRAC_SET_4(R, _FP_FRAC_WORD_8(_z,3), _FP_FRAC_WORD_8(_z,2), \ + _FP_FRAC_WORD_8(_z,1), _FP_FRAC_WORD_8(_z,0)); \ + } while (0) + +/* + * Helper utility for _FP_DIV_MEAT_4_udiv: + * pppp = m * nnn + */ +#define umul_ppppmnnn(p3,p2,p1,p0,m,n2,n1,n0) \ + do { \ + UWtype _t; \ + umul_ppmm(p1,p0,m,n0); \ + umul_ppmm(p2,_t,m,n1); \ + __FP_FRAC_ADDI_2(p2,p1,_t); \ + umul_ppmm(p3,_t,m,n2); \ + __FP_FRAC_ADDI_2(p3,p2,_t); \ + } while (0) + +/* + * Division algorithms: + */ + +#define _FP_DIV_MEAT_4_udiv(fs, R, X, Y) \ + do { \ + int _i; \ + _FP_FRAC_DECL_4(_n); _FP_FRAC_DECL_4(_m); \ + _FP_FRAC_SET_4(_n, _FP_ZEROFRAC_4); \ + if (_FP_FRAC_GT_4(X, Y)) \ + { \ + _n_f[3] = X##_f[0] << (_FP_W_TYPE_SIZE - 1); \ + _FP_FRAC_SRL_4(X, 1); \ + } \ + else \ + R##_e--; \ + \ + /* Normalize, i.e. make the most significant bit of the \ + denominator set. */ \ + _FP_FRAC_SLL_4(Y, _FP_WFRACXBITS_##fs); \ + \ + for (_i = 3; ; _i--) \ + { \ + if (X##_f[3] == Y##_f[3]) \ + { \ + /* This is a special case, not an optimization \ + (X##_f[3]/Y##_f[3] would not fit into UWtype). \ + As X## is guaranteed to be < Y, R##_f[_i] can be either \ + (UWtype)-1 or (UWtype)-2. */ \ + R##_f[_i] = -1; \ + if (!_i) \ + break; \ + __FP_FRAC_SUB_4(X##_f[3], X##_f[2], X##_f[1], X##_f[0], \ + Y##_f[2], Y##_f[1], Y##_f[0], 0, \ + X##_f[2], X##_f[1], X##_f[0], _n_f[_i]); \ + _FP_FRAC_SUB_4(X, Y, X); \ + if (X##_f[3] > Y##_f[3]) \ + { \ + R##_f[_i] = -2; \ + _FP_FRAC_ADD_4(X, Y, X); \ + } \ + } \ + else \ + { \ + udiv_qrnnd(R##_f[_i], X##_f[3], X##_f[3], X##_f[2], Y##_f[3]); \ + umul_ppppmnnn(_m_f[3], _m_f[2], _m_f[1], _m_f[0], \ + R##_f[_i], Y##_f[2], Y##_f[1], Y##_f[0]); \ + X##_f[2] = X##_f[1]; \ + X##_f[1] = X##_f[0]; \ + X##_f[0] = _n_f[_i]; \ + if (_FP_FRAC_GT_4(_m, X)) \ + { \ + R##_f[_i]--; \ + _FP_FRAC_ADD_4(X, Y, X); \ + if (_FP_FRAC_GE_4(X, Y) && _FP_FRAC_GT_4(_m, X)) \ + { \ + R##_f[_i]--; \ + _FP_FRAC_ADD_4(X, Y, X); \ + } \ + } \ + _FP_FRAC_DEC_4(X, _m); \ + if (!_i) \ + { \ + if (!_FP_FRAC_EQ_4(X, _m)) \ + R##_f[0] |= _FP_WORK_STICKY; \ + break; \ + } \ + } \ + } \ + } while (0) + + +/* + * Square root algorithms: + * We have just one right now, maybe Newton approximation + * should be added for those machines where division is fast. + */ + +#define _FP_SQRT_MEAT_4(R, S, T, X, q) \ + do { \ + while (q) \ + { \ + T##_f[3] = S##_f[3] + q; \ + if (T##_f[3] <= X##_f[3]) \ + { \ + S##_f[3] = T##_f[3] + q; \ + X##_f[3] -= T##_f[3]; \ + R##_f[3] += q; \ + } \ + _FP_FRAC_SLL_4(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q) \ + { \ + T##_f[2] = S##_f[2] + q; \ + T##_f[3] = S##_f[3]; \ + if (T##_f[3] < X##_f[3] || \ + (T##_f[3] == X##_f[3] && T##_f[2] <= X##_f[2])) \ + { \ + S##_f[2] = T##_f[2] + q; \ + S##_f[3] += (T##_f[2] > S##_f[2]); \ + __FP_FRAC_DEC_2(X##_f[3], X##_f[2], \ + T##_f[3], T##_f[2]); \ + R##_f[2] += q; \ + } \ + _FP_FRAC_SLL_4(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q) \ + { \ + T##_f[1] = S##_f[1] + q; \ + T##_f[2] = S##_f[2]; \ + T##_f[3] = S##_f[3]; \ + if (T##_f[3] < X##_f[3] || \ + (T##_f[3] == X##_f[3] && (T##_f[2] < X##_f[2] || \ + (T##_f[2] == X##_f[2] && T##_f[1] <= X##_f[1])))) \ + { \ + S##_f[1] = T##_f[1] + q; \ + S##_f[2] += (T##_f[1] > S##_f[1]); \ + S##_f[3] += (T##_f[2] > S##_f[2]); \ + __FP_FRAC_DEC_3(X##_f[3], X##_f[2], X##_f[1], \ + T##_f[3], T##_f[2], T##_f[1]); \ + R##_f[1] += q; \ + } \ + _FP_FRAC_SLL_4(X, 1); \ + q >>= 1; \ + } \ + q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \ + while (q != _FP_WORK_ROUND) \ + { \ + T##_f[0] = S##_f[0] + q; \ + T##_f[1] = S##_f[1]; \ + T##_f[2] = S##_f[2]; \ + T##_f[3] = S##_f[3]; \ + if (_FP_FRAC_GE_4(X,T)) \ + { \ + S##_f[0] = T##_f[0] + q; \ + S##_f[1] += (T##_f[0] > S##_f[0]); \ + S##_f[2] += (T##_f[1] > S##_f[1]); \ + S##_f[3] += (T##_f[2] > S##_f[2]); \ + _FP_FRAC_DEC_4(X, T); \ + R##_f[0] += q; \ + } \ + _FP_FRAC_SLL_4(X, 1); \ + q >>= 1; \ + } \ + if (!_FP_FRAC_ZEROP_4(X)) \ + { \ + if (_FP_FRAC_GT_4(X,S)) \ + R##_f[0] |= _FP_WORK_ROUND; \ + R##_f[0] |= _FP_WORK_STICKY; \ + } \ + } while (0) + + +/* + * Internals + */ + +#define __FP_FRAC_SET_4(X,I3,I2,I1,I0) \ + (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0) + +#ifndef __FP_FRAC_ADD_3 +#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \ + do { \ + _FP_W_TYPE _c1, _c2; \ + r0 = x0 + y0; \ + _c1 = r0 < x0; \ + r1 = x1 + y1; \ + _c2 = r1 < x1; \ + r1 += _c1; \ + _c2 |= r1 < _c1; \ + r2 = x2 + y2 + _c2; \ + } while (0) +#endif + +#ifndef __FP_FRAC_ADD_4 +#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \ + do { \ + _FP_W_TYPE _c1, _c2, _c3; \ + r0 = x0 + y0; \ + _c1 = r0 < x0; \ + r1 = x1 + y1; \ + _c2 = r1 < x1; \ + r1 += _c1; \ + _c2 |= r1 < _c1; \ + r2 = x2 + y2; \ + _c3 = r2 < x2; \ + r2 += _c2; \ + _c3 |= r2 < _c2; \ + r3 = x3 + y3 + _c3; \ + } while (0) +#endif + +#ifndef __FP_FRAC_SUB_3 +#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \ + do { \ + _FP_W_TYPE _c1, _c2; \ + r0 = x0 - y0; \ + _c1 = r0 > x0; \ + r1 = x1 - y1; \ + _c2 = r1 > x1; \ + r1 -= _c1; \ + _c2 |= _c1 && (y1 == x1); \ + r2 = x2 - y2 - _c2; \ + } while (0) +#endif + +#ifndef __FP_FRAC_SUB_4 +#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \ + do { \ + _FP_W_TYPE _c1, _c2, _c3; \ + r0 = x0 - y0; \ + _c1 = r0 > x0; \ + r1 = x1 - y1; \ + _c2 = r1 > x1; \ + r1 -= _c1; \ + _c2 |= _c1 && (y1 == x1); \ + r2 = x2 - y2; \ + _c3 = r2 > x2; \ + r2 -= _c2; \ + _c3 |= _c2 && (y2 == x2); \ + r3 = x3 - y3 - _c3; \ + } while (0) +#endif + +#ifndef __FP_FRAC_DEC_3 +#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) \ + do { \ + UWtype _t0, _t1, _t2; \ + _t0 = x0, _t1 = x1, _t2 = x2; \ + __FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0); \ + } while (0) +#endif + +#ifndef __FP_FRAC_DEC_4 +#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) \ + do { \ + UWtype _t0, _t1, _t2, _t3; \ + _t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3; \ + __FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0); \ + } while (0) +#endif + +#ifndef __FP_FRAC_ADDI_4 +#define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \ + do { \ + UWtype _t; \ + _t = ((x0 += i) < i); \ + x1 += _t; _t = (x1 < _t); \ + x2 += _t; _t = (x2 < _t); \ + x3 += _t; \ + } while (0) +#endif + +/* Convert FP values between word sizes. This appears to be more + * complicated than I'd have expected it to be, so these might be + * wrong... These macros are in any case somewhat bogus because they + * use information about what various FRAC_n variables look like + * internally [eg, that 2 word vars are X_f0 and x_f1]. But so do + * the ones in op-2.h and op-1.h. + */ +#define _FP_FRAC_COPY_1_4(D, S) (D##_f = S##_f[0]) + +#define _FP_FRAC_COPY_2_4(D, S) \ +do { \ + D##_f0 = S##_f[0]; \ + D##_f1 = S##_f[1]; \ +} while (0) + +/* Assembly/disassembly for converting to/from integral types. + * No shifting or overflow handled here. + */ +/* Put the FP value X into r, which is an integer of size rsize. */ +#define _FP_FRAC_ASSEMBLE_4(r, X, rsize) \ + do { \ + if (rsize <= _FP_W_TYPE_SIZE) \ + r = X##_f[0]; \ + else if (rsize <= 2*_FP_W_TYPE_SIZE) \ + { \ + r = X##_f[1]; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f[0]; \ + } \ + else \ + { \ + /* I'm feeling lazy so we deal with int == 3words (implausible)*/ \ + /* and int == 4words as a single case. */ \ + r = X##_f[3]; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f[2]; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f[1]; \ + r <<= _FP_W_TYPE_SIZE; \ + r += X##_f[0]; \ + } \ + } while (0) + +/* "No disassemble Number Five!" */ +/* move an integer of size rsize into X's fractional part. We rely on + * the _f[] array consisting of words of size _FP_W_TYPE_SIZE to avoid + * having to mask the values we store into it. + */ +#define _FP_FRAC_DISASSEMBLE_4(X, r, rsize) \ + do { \ + X##_f[0] = r; \ + X##_f[1] = (rsize <= _FP_W_TYPE_SIZE ? 0 : r >> _FP_W_TYPE_SIZE); \ + X##_f[2] = (rsize <= 2*_FP_W_TYPE_SIZE ? 0 : r >> 2*_FP_W_TYPE_SIZE); \ + X##_f[3] = (rsize <= 3*_FP_W_TYPE_SIZE ? 0 : r >> 3*_FP_W_TYPE_SIZE); \ + } while (0); + +#define _FP_FRAC_COPY_4_1(D, S) \ +do { \ + D##_f[0] = S##_f; \ + D##_f[1] = D##_f[2] = D##_f[3] = 0; \ +} while (0) + +#define _FP_FRAC_COPY_4_2(D, S) \ +do { \ + D##_f[0] = S##_f0; \ + D##_f[1] = S##_f1; \ + D##_f[2] = D##_f[3] = 0; \ +} while (0) diff --git a/contrib/gcc/config/soft-fp/op-8.h b/contrib/gcc/config/soft-fp/op-8.h new file mode 100644 index 00000000000..e0612a5e62f --- /dev/null +++ b/contrib/gcc/config/soft-fp/op-8.h @@ -0,0 +1,111 @@ +/* Software floating-point emulation. + Basic eight-word fraction declaration and manipulation. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +/* We need just a few things from here for op-4, if we ever need some + other macros, they can be added. */ +#define _FP_FRAC_DECL_8(X) _FP_W_TYPE X##_f[8] +#define _FP_FRAC_HIGH_8(X) (X##_f[7]) +#define _FP_FRAC_LOW_8(X) (X##_f[0]) +#define _FP_FRAC_WORD_8(X,w) (X##_f[w]) + +#define _FP_FRAC_SLL_8(X,N) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _up = (N) % _FP_W_TYPE_SIZE; \ + _down = _FP_W_TYPE_SIZE - _up; \ + if (!_up) \ + for (_i = 7; _i >= _skip; --_i) \ + X##_f[_i] = X##_f[_i-_skip]; \ + else \ + { \ + for (_i = 7; _i > _skip; --_i) \ + X##_f[_i] = X##_f[_i-_skip] << _up \ + | X##_f[_i-_skip-1] >> _down; \ + X##_f[_i--] = X##_f[0] << _up; \ + } \ + for (; _i >= 0; --_i) \ + X##_f[_i] = 0; \ + } while (0) + +#define _FP_FRAC_SRL_8(X,N) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _down = (N) % _FP_W_TYPE_SIZE; \ + _up = _FP_W_TYPE_SIZE - _down; \ + if (!_down) \ + for (_i = 0; _i <= 7-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip]; \ + else \ + { \ + for (_i = 0; _i < 7-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip] >> _down \ + | X##_f[_i+_skip+1] << _up; \ + X##_f[_i++] = X##_f[7] >> _down; \ + } \ + for (; _i < 8; ++_i) \ + X##_f[_i] = 0; \ + } while (0) + + +/* Right shift with sticky-lsb. + * What this actually means is that we do a standard right-shift, + * but that if any of the bits that fall off the right hand side + * were one then we always set the LSbit. + */ +#define _FP_FRAC_SRS_8(X,N,size) \ + do { \ + _FP_I_TYPE _up, _down, _skip, _i; \ + _FP_W_TYPE _s; \ + _skip = (N) / _FP_W_TYPE_SIZE; \ + _down = (N) % _FP_W_TYPE_SIZE; \ + _up = _FP_W_TYPE_SIZE - _down; \ + for (_s = _i = 0; _i < _skip; ++_i) \ + _s |= X##_f[_i]; \ + if (!_down) \ + for (_i = 0; _i <= 7-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip]; \ + else \ + { \ + _s |= X##_f[_i] << _up; \ + for (_i = 0; _i < 7-_skip; ++_i) \ + X##_f[_i] = X##_f[_i+_skip] >> _down \ + | X##_f[_i+_skip+1] << _up; \ + X##_f[_i++] = X##_f[7] >> _down; \ + } \ + for (; _i < 8; ++_i) \ + X##_f[_i] = 0; \ + /* don't fix the LSB until the very end when we're sure f[0] is stable */ \ + X##_f[0] |= (_s != 0); \ + } while (0) + diff --git a/contrib/gcc/config/soft-fp/op-common.h b/contrib/gcc/config/soft-fp/op-common.h new file mode 100644 index 00000000000..0aa6e3e05d8 --- /dev/null +++ b/contrib/gcc/config/soft-fp/op-common.h @@ -0,0 +1,1333 @@ +/* Software floating-point emulation. Common operations. + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#define _FP_DECL(wc, X) \ + _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e; \ + _FP_FRAC_DECL_##wc(X) + +/* + * Finish truely unpacking a native fp value by classifying the kind + * of fp value and normalizing both the exponent and the fraction. + */ + +#define _FP_UNPACK_CANONICAL(fs, wc, X) \ +do { \ + switch (X##_e) \ + { \ + default: \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs; \ + _FP_FRAC_SLL_##wc(X, _FP_WORKBITS); \ + X##_e -= _FP_EXPBIAS_##fs; \ + X##_c = FP_CLS_NORMAL; \ + break; \ + \ + case 0: \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + X##_c = FP_CLS_ZERO; \ + else \ + { \ + /* a denormalized number */ \ + _FP_I_TYPE _shift; \ + _FP_FRAC_CLZ_##wc(_shift, X); \ + _shift -= _FP_FRACXBITS_##fs; \ + _FP_FRAC_SLL_##wc(X, (_shift+_FP_WORKBITS)); \ + X##_e -= _FP_EXPBIAS_##fs - 1 + _shift; \ + X##_c = FP_CLS_NORMAL; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + break; \ + \ + case _FP_EXPMAX_##fs: \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + X##_c = FP_CLS_INF; \ + else \ + { \ + X##_c = FP_CLS_NAN; \ + /* Check for signaling NaN */ \ + if (!(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + break; \ + } \ +} while (0) + +/* Finish unpacking an fp value in semi-raw mode: the mantissa is + shifted by _FP_WORKBITS but the implicit MSB is not inserted and + other classification is not done. */ +#define _FP_UNPACK_SEMIRAW(fs, wc, X) _FP_FRAC_SLL_##wc(X, _FP_WORKBITS) + +/* A semi-raw value has overflowed to infinity. Adjust the mantissa + and exponent appropriately. */ +#define _FP_OVERFLOW_SEMIRAW(fs, wc, X) \ +do { \ + if (FP_ROUNDMODE == FP_RND_NEAREST \ + || (FP_ROUNDMODE == FP_RND_PINF && !X##_s) \ + || (FP_ROUNDMODE == FP_RND_MINF && X##_s)) \ + { \ + X##_e = _FP_EXPMAX_##fs; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + else \ + { \ + X##_e = _FP_EXPMAX_##fs - 1; \ + _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \ + } \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + FP_SET_EXCEPTION(FP_EX_OVERFLOW); \ +} while (0) + +/* Check for a semi-raw value being a signaling NaN and raise the + invalid exception if so. */ +#define _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X) \ +do { \ + if (X##_e == _FP_EXPMAX_##fs \ + && !_FP_FRAC_ZEROP_##wc(X) \ + && !(_FP_FRAC_HIGH_##fs(X) & _FP_QNANBIT_SH_##fs)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ +} while (0) + +/* Choose a NaN result from an operation on two semi-raw NaN + values. */ +#define _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP) \ +do { \ + /* _FP_CHOOSENAN expects raw values, so shift as required. */ \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + _FP_FRAC_SRL_##wc(Y, _FP_WORKBITS); \ + _FP_CHOOSENAN(fs, wc, R, X, Y, OP); \ + _FP_FRAC_SLL_##wc(R, _FP_WORKBITS); \ +} while (0) + +/* Test whether a biased exponent is normal (not zero or maximum). */ +#define _FP_EXP_NORMAL(fs, wc, X) (((X##_e + 1) & _FP_EXPMAX_##fs) > 1) + +/* Prepare to pack an fp value in semi-raw mode: the mantissa is + rounded and shifted right, with the rounding possibly increasing + the exponent (including changing a finite value to infinity). */ +#define _FP_PACK_SEMIRAW(fs, wc, X) \ +do { \ + _FP_ROUND(wc, X); \ + if (_FP_FRAC_HIGH_##fs(X) \ + & (_FP_OVERFLOW_##fs >> 1)) \ + { \ + _FP_FRAC_HIGH_##fs(X) &= ~(_FP_OVERFLOW_##fs >> 1); \ + X##_e++; \ + if (X##_e == _FP_EXPMAX_##fs) \ + _FP_OVERFLOW_SEMIRAW(fs, wc, X); \ + } \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + if (!_FP_EXP_NORMAL(fs, wc, X) && !_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (X##_e == 0) \ + FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + else \ + { \ + if (!_FP_KEEPNANFRACP) \ + { \ + _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \ + X##_s = _FP_NANSIGN_##fs; \ + } \ + else \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \ + } \ + } \ +} while (0) + +/* + * Before packing the bits back into the native fp result, take care + * of such mundane things as rounding and overflow. Also, for some + * kinds of fp values, the original parts may not have been fully + * extracted -- but that is ok, we can regenerate them now. + */ + +#define _FP_PACK_CANONICAL(fs, wc, X) \ +do { \ + switch (X##_c) \ + { \ + case FP_CLS_NORMAL: \ + X##_e += _FP_EXPBIAS_##fs; \ + if (X##_e > 0) \ + { \ + _FP_ROUND(wc, X); \ + if (_FP_FRAC_OVERP_##wc(fs, X)) \ + { \ + _FP_FRAC_CLEAR_OVERP_##wc(fs, X); \ + X##_e++; \ + } \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + if (X##_e >= _FP_EXPMAX_##fs) \ + { \ + /* overflow */ \ + switch (FP_ROUNDMODE) \ + { \ + case FP_RND_NEAREST: \ + X##_c = FP_CLS_INF; \ + break; \ + case FP_RND_PINF: \ + if (!X##_s) X##_c = FP_CLS_INF; \ + break; \ + case FP_RND_MINF: \ + if (X##_s) X##_c = FP_CLS_INF; \ + break; \ + } \ + if (X##_c == FP_CLS_INF) \ + { \ + /* Overflow to infinity */ \ + X##_e = _FP_EXPMAX_##fs; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + else \ + { \ + /* Overflow to maximum normal */ \ + X##_e = _FP_EXPMAX_##fs - 1; \ + _FP_FRAC_SET_##wc(X, _FP_MAXFRAC_##wc); \ + } \ + FP_SET_EXCEPTION(FP_EX_OVERFLOW); \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + } \ + else \ + { \ + /* we've got a denormalized number */ \ + X##_e = -X##_e + 1; \ + if (X##_e <= _FP_WFRACBITS_##fs) \ + { \ + _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \ + _FP_ROUND(wc, X); \ + if (_FP_FRAC_HIGH_##fs(X) \ + & (_FP_OVERFLOW_##fs >> 1)) \ + { \ + X##_e = 1; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + else \ + { \ + X##_e = 0; \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + } \ + } \ + else \ + { \ + /* underflow to zero */ \ + X##_e = 0; \ + if (!_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ + _FP_ROUND(wc, X); \ + _FP_FRAC_LOW_##wc(X) >>= (_FP_WORKBITS); \ + } \ + FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + } \ + } \ + break; \ + \ + case FP_CLS_ZERO: \ + X##_e = 0; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + break; \ + \ + case FP_CLS_INF: \ + X##_e = _FP_EXPMAX_##fs; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + break; \ + \ + case FP_CLS_NAN: \ + X##_e = _FP_EXPMAX_##fs; \ + if (!_FP_KEEPNANFRACP) \ + { \ + _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \ + X##_s = _FP_NANSIGN_##fs; \ + } \ + else \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \ + break; \ + } \ +} while (0) + +/* This one accepts raw argument and not cooked, returns + * 1 if X is a signaling NaN. + */ +#define _FP_ISSIGNAN(fs, wc, X) \ +({ \ + int __ret = 0; \ + if (X##_e == _FP_EXPMAX_##fs) \ + { \ + if (!_FP_FRAC_ZEROP_##wc(X) \ + && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)) \ + __ret = 1; \ + } \ + __ret; \ +}) + + + + + +/* Addition on semi-raw values. */ +#define _FP_ADD_INTERNAL(fs, wc, R, X, Y, OP) \ +do { \ + if (X##_s == Y##_s) \ + { \ + /* Addition. */ \ + R##_s = X##_s; \ + int ediff = X##_e - Y##_e; \ + if (ediff > 0) \ + { \ + R##_e = X##_e; \ + if (Y##_e == 0) \ + { \ + /* Y is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + goto add3; \ + } \ + if (X##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + goto add1; \ + } \ + } \ + else if (X##_e == _FP_EXPMAX_##fs) \ + { \ + /* X is NaN or Inf, Y is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + \ + /* Insert implicit MSB of Y. */ \ + _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs; \ + \ + add1: \ + /* Shift the mantissa of Y to the right EDIFF steps; \ + remember to account later for the implicit MSB of X. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + } \ + else if (ediff < 0) \ + { \ + ediff = -ediff; \ + R##_e = Y##_e; \ + if (X##_e == 0) \ + { \ + /* X is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_ADD_##wc(R, Y, X); \ + goto add3; \ + } \ + if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + goto add2; \ + } \ + } \ + else if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + /* Y is NaN or Inf, X is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + \ + /* Insert implicit MSB of X. */ \ + _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs; \ + \ + add2: \ + /* Shift the mantissa of X to the right EDIFF steps; \ + remember to account later for the implicit MSB of Y. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ + _FP_FRAC_ADD_##wc(R, Y, X); \ + } \ + else \ + { \ + /* ediff == 0. */ \ + if (!_FP_EXP_NORMAL(fs, wc, X)) \ + { \ + if (X##_e == 0) \ + { \ + /* X and Y are zero or denormalized. */ \ + R##_e = 0; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (!_FP_FRAC_ZEROP_##wc(Y)) \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto add_done; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto add_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* Normalized result. */ \ + _FP_FRAC_HIGH_##fs(R) \ + &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + R##_e = 1; \ + } \ + goto add_done; \ + } \ + } \ + else \ + { \ + /* X and Y are NaN or Inf. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + R##_e = _FP_EXPMAX_##fs; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_COPY_##wc(R, Y); \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_COPY_##wc(R, X); \ + else \ + _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP); \ + goto add_done; \ + } \ + } \ + /* The exponents of X and Y, both normal, are equal. The \ + implicit MSBs will always add to increase the \ + exponent. */ \ + _FP_FRAC_ADD_##wc(R, X, Y); \ + R##_e = X##_e + 1; \ + _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ + if (R##_e == _FP_EXPMAX_##fs) \ + /* Overflow to infinity (depending on rounding mode). */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, R); \ + goto add_done; \ + } \ + add3: \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* Overflow. */ \ + _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + R##_e++; \ + _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ + if (R##_e == _FP_EXPMAX_##fs) \ + /* Overflow to infinity (depending on rounding mode). */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, R); \ + } \ + add_done: ; \ + } \ + else \ + { \ + /* Subtraction. */ \ + int ediff = X##_e - Y##_e; \ + if (ediff > 0) \ + { \ + R##_e = X##_e; \ + R##_s = X##_s; \ + if (Y##_e == 0) \ + { \ + /* Y is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + goto sub3; \ + } \ + if (X##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + goto sub1; \ + } \ + } \ + else if (X##_e == _FP_EXPMAX_##fs) \ + { \ + /* X is NaN or Inf, Y is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_FRAC_COPY_##wc(R, X); \ + goto sub_done; \ + } \ + \ + /* Insert implicit MSB of Y. */ \ + _FP_FRAC_HIGH_##fs(Y) |= _FP_IMPLBIT_SH_##fs; \ + \ + sub1: \ + /* Shift the mantissa of Y to the right EDIFF steps; \ + remember to account later for the implicit MSB of X. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(Y, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(Y)) \ + _FP_FRAC_SET_##wc(Y, _FP_MINFRAC_##wc); \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + } \ + else if (ediff < 0) \ + { \ + ediff = -ediff; \ + R##_e = Y##_e; \ + R##_s = Y##_s; \ + if (X##_e == 0) \ + { \ + /* X is zero or denormalized. */ \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + ediff--; \ + if (ediff == 0) \ + { \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + goto sub3; \ + } \ + if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + goto sub2; \ + } \ + } \ + else if (Y##_e == _FP_EXPMAX_##fs) \ + { \ + /* Y is NaN or Inf, X is normal. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + _FP_FRAC_COPY_##wc(R, Y); \ + goto sub_done; \ + } \ + \ + /* Insert implicit MSB of X. */ \ + _FP_FRAC_HIGH_##fs(X) |= _FP_IMPLBIT_SH_##fs; \ + \ + sub2: \ + /* Shift the mantissa of X to the right EDIFF steps; \ + remember to account later for the implicit MSB of Y. */ \ + if (ediff <= _FP_WFRACBITS_##fs) \ + _FP_FRAC_SRS_##wc(X, ediff, _FP_WFRACBITS_##fs); \ + else if (!_FP_FRAC_ZEROP_##wc(X)) \ + _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + } \ + else \ + { \ + /* ediff == 0. */ \ + if (!_FP_EXP_NORMAL(fs, wc, X)) \ + { \ + if (X##_e == 0) \ + { \ + /* X and Y are zero or denormalized. */ \ + R##_e = 0; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + _FP_FRAC_COPY_##wc(R, Y); \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + R##_s = Y##_s; \ + } \ + goto sub_done; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_s = X##_s; \ + goto sub_done; \ + } \ + else \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + R##_s = X##_s; \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* |X| < |Y|, negate result. */ \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + R##_s = Y##_s; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(R)) \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + goto sub_done; \ + } \ + } \ + else \ + { \ + /* X and Y are NaN or Inf, of opposite signs. */ \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, X); \ + _FP_CHECK_SIGNAN_SEMIRAW(fs, wc, Y); \ + R##_e = _FP_EXPMAX_##fs; \ + if (_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + /* Inf - Inf. */ \ + R##_s = _FP_NANSIGN_##fs; \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + _FP_FRAC_SLL_##wc(R, _FP_WORKBITS); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + else \ + { \ + /* Inf - NaN. */ \ + R##_s = Y##_s; \ + _FP_FRAC_COPY_##wc(R, Y); \ + } \ + } \ + else \ + { \ + if (_FP_FRAC_ZEROP_##wc(Y)) \ + { \ + /* NaN - Inf. */ \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc(R, X); \ + } \ + else \ + { \ + /* NaN - NaN. */ \ + _FP_CHOOSENAN_SEMIRAW(fs, wc, R, X, Y, OP); \ + } \ + } \ + goto sub_done; \ + } \ + } \ + /* The exponents of X and Y, both normal, are equal. The \ + implicit MSBs cancel. */ \ + R##_e = X##_e; \ + _FP_FRAC_SUB_##wc(R, X, Y); \ + R##_s = X##_s; \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + /* |X| < |Y|, negate result. */ \ + _FP_FRAC_SUB_##wc(R, Y, X); \ + R##_s = Y##_s; \ + } \ + else if (_FP_FRAC_ZEROP_##wc(R)) \ + { \ + R##_e = 0; \ + R##_s = (FP_ROUNDMODE == FP_RND_MINF); \ + goto sub_done; \ + } \ + goto norm; \ + } \ + sub3: \ + if (_FP_FRAC_HIGH_##fs(R) & _FP_IMPLBIT_SH_##fs) \ + { \ + int diff; \ + /* Carry into most significant bit of larger one of X and Y, \ + canceling it; renormalize. */ \ + _FP_FRAC_HIGH_##fs(R) &= _FP_IMPLBIT_SH_##fs - 1; \ + norm: \ + _FP_FRAC_CLZ_##wc(diff, R); \ + diff -= _FP_WFRACXBITS_##fs; \ + _FP_FRAC_SLL_##wc(R, diff); \ + if (R##_e <= diff) \ + { \ + /* R is denormalized. */ \ + diff = diff - R##_e + 1; \ + _FP_FRAC_SRS_##wc(R, diff, _FP_WFRACBITS_##fs); \ + R##_e = 0; \ + } \ + else \ + { \ + R##_e -= diff; \ + _FP_FRAC_HIGH_##fs(R) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + } \ + } \ + sub_done: ; \ + } \ +} while (0) + +#define _FP_ADD(fs, wc, R, X, Y) _FP_ADD_INTERNAL(fs, wc, R, X, Y, '+') +#define _FP_SUB(fs, wc, R, X, Y) \ + do { \ + if (!(Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) Y##_s ^= 1; \ + _FP_ADD_INTERNAL(fs, wc, R, X, Y, '-'); \ + } while (0) + + +/* + * Main negation routine. FIXME -- when we care about setting exception + * bits reliably, this will not do. We should examine all of the fp classes. + */ + +#define _FP_NEG(fs, wc, R, X) \ + do { \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_c = X##_c; \ + R##_e = X##_e; \ + R##_s = 1 ^ X##_s; \ + } while (0) + + +/* + * Main multiplication routine. The input values should be cooked. + */ + +#define _FP_MUL(fs, wc, R, X, Y) \ +do { \ + R##_s = X##_s ^ Y##_s; \ + switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \ + { \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \ + R##_c = FP_CLS_NORMAL; \ + R##_e = X##_e + Y##_e + 1; \ + \ + _FP_MUL_MEAT_##fs(R,X,Y); \ + \ + if (_FP_FRAC_OVERP_##wc(fs, R)) \ + _FP_FRAC_SRS_##wc(R, 1, _FP_WFRACBITS_##fs); \ + else \ + R##_e--; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \ + _FP_CHOOSENAN(fs, wc, R, X, Y, '*'); \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \ + R##_s = X##_s; \ + \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_c = X##_c; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \ + R##_s = Y##_s; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \ + _FP_FRAC_COPY_##wc(R, Y); \ + R##_c = Y##_c; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \ + R##_s = _FP_NANSIGN_##fs; \ + R##_c = FP_CLS_NAN; \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + break; \ + \ + default: \ + abort(); \ + } \ +} while (0) + + +/* + * Main division routine. The input values should be cooked. + */ + +#define _FP_DIV(fs, wc, R, X, Y) \ +do { \ + R##_s = X##_s ^ Y##_s; \ + switch (_FP_CLS_COMBINE(X##_c, Y##_c)) \ + { \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL): \ + R##_c = FP_CLS_NORMAL; \ + R##_e = X##_e - Y##_e; \ + \ + _FP_DIV_MEAT_##fs(R,X,Y); \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NAN): \ + _FP_CHOOSENAN(fs, wc, R, X, Y, '/'); \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_NORMAL): \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_NAN,FP_CLS_ZERO): \ + R##_s = X##_s; \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_c = X##_c; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NAN): \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NAN): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NAN): \ + R##_s = Y##_s; \ + _FP_FRAC_COPY_##wc(R, Y); \ + R##_c = Y##_c; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_NORMAL): \ + R##_c = FP_CLS_ZERO; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_ZERO): \ + FP_SET_EXCEPTION(FP_EX_DIVZERO); \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_ZERO): \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_NORMAL): \ + R##_c = FP_CLS_INF; \ + break; \ + \ + case _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF): \ + case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ + R##_s = _FP_NANSIGN_##fs; \ + R##_c = FP_CLS_NAN; \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + break; \ + \ + default: \ + abort(); \ + } \ +} while (0) + + +/* + * Main differential comparison routine. The inputs should be raw not + * cooked. The return is -1,0,1 for normal values, 2 otherwise. + */ + +#define _FP_CMP(fs, wc, ret, X, Y, un) \ + do { \ + /* NANs are unordered */ \ + if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ + || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \ + { \ + ret = un; \ + } \ + else \ + { \ + int __is_zero_x; \ + int __is_zero_y; \ + \ + __is_zero_x = (!X##_e && _FP_FRAC_ZEROP_##wc(X)) ? 1 : 0; \ + __is_zero_y = (!Y##_e && _FP_FRAC_ZEROP_##wc(Y)) ? 1 : 0; \ + \ + if (__is_zero_x && __is_zero_y) \ + ret = 0; \ + else if (__is_zero_x) \ + ret = Y##_s ? 1 : -1; \ + else if (__is_zero_y) \ + ret = X##_s ? -1 : 1; \ + else if (X##_s != Y##_s) \ + ret = X##_s ? -1 : 1; \ + else if (X##_e > Y##_e) \ + ret = X##_s ? -1 : 1; \ + else if (X##_e < Y##_e) \ + ret = X##_s ? 1 : -1; \ + else if (_FP_FRAC_GT_##wc(X, Y)) \ + ret = X##_s ? -1 : 1; \ + else if (_FP_FRAC_GT_##wc(Y, X)) \ + ret = X##_s ? 1 : -1; \ + else \ + ret = 0; \ + } \ + } while (0) + + +/* Simplification for strict equality. */ + +#define _FP_CMP_EQ(fs, wc, ret, X, Y) \ + do { \ + /* NANs are unordered */ \ + if ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ + || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))) \ + { \ + ret = 1; \ + } \ + else \ + { \ + ret = !(X##_e == Y##_e \ + && _FP_FRAC_EQ_##wc(X, Y) \ + && (X##_s == Y##_s || (!X##_e && _FP_FRAC_ZEROP_##wc(X)))); \ + } \ + } while (0) + +/* Version to test unordered. */ + +#define _FP_CMP_UNORD(fs, wc, ret, X, Y) \ + do { \ + ret = ((X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ + || (Y##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(Y))); \ + } while (0) + +/* + * Main square root routine. The input value should be cooked. + */ + +#define _FP_SQRT(fs, wc, R, X) \ +do { \ + _FP_FRAC_DECL_##wc(T); _FP_FRAC_DECL_##wc(S); \ + _FP_W_TYPE q; \ + switch (X##_c) \ + { \ + case FP_CLS_NAN: \ + _FP_FRAC_COPY_##wc(R, X); \ + R##_s = X##_s; \ + R##_c = FP_CLS_NAN; \ + break; \ + case FP_CLS_INF: \ + if (X##_s) \ + { \ + R##_s = _FP_NANSIGN_##fs; \ + R##_c = FP_CLS_NAN; /* NAN */ \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + else \ + { \ + R##_s = 0; \ + R##_c = FP_CLS_INF; /* sqrt(+inf) = +inf */ \ + } \ + break; \ + case FP_CLS_ZERO: \ + R##_s = X##_s; \ + R##_c = FP_CLS_ZERO; /* sqrt(+-0) = +-0 */ \ + break; \ + case FP_CLS_NORMAL: \ + R##_s = 0; \ + if (X##_s) \ + { \ + R##_c = FP_CLS_NAN; /* sNAN */ \ + R##_s = _FP_NANSIGN_##fs; \ + _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + break; \ + } \ + R##_c = FP_CLS_NORMAL; \ + if (X##_e & 1) \ + _FP_FRAC_SLL_##wc(X, 1); \ + R##_e = X##_e >> 1; \ + _FP_FRAC_SET_##wc(S, _FP_ZEROFRAC_##wc); \ + _FP_FRAC_SET_##wc(R, _FP_ZEROFRAC_##wc); \ + q = _FP_OVERFLOW_##fs >> 1; \ + _FP_SQRT_MEAT_##wc(R, S, T, X, q); \ + } \ + } while (0) + +/* + * Convert from FP to integer. Input is raw. + */ + +/* RSIGNED can have following values: + * 0: the number is required to be 0..(2^rsize)-1, if not, NV is set plus + * the result is either 0 or (2^rsize)-1 depending on the sign in such + * case. + * 1: the number is required to be -(2^(rsize-1))..(2^(rsize-1))-1, if not, + * NV is set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 + * depending on the sign in such case. + * -1: the number is required to be -(2^(rsize-1))..(2^rsize)-1, if not, NV is + * set plus the result is either -(2^(rsize-1)) or (2^(rsize-1))-1 + * depending on the sign in such case. + */ +#define _FP_TO_INT(fs, wc, r, X, rsize, rsigned) \ +do { \ + if (X##_e < _FP_EXPBIAS_##fs) \ + { \ + r = 0; \ + if (X##_e == 0) \ + { \ + if (!_FP_FRAC_ZEROP_##wc(X)) \ + { \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + } \ + } \ + else \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + else if (X##_e >= _FP_EXPBIAS_##fs + rsize - (rsigned > 0 || X##_s) \ + || (!rsigned && X##_s)) \ + { \ + /* Overflow or converting to the most negative integer. */ \ + if (rsigned) \ + { \ + r = 1; \ + r <<= rsize - 1; \ + r -= 1 - X##_s; \ + } else { \ + r = 0; \ + if (X##_s) \ + r = ~r; \ + } \ + \ + if (rsigned && X##_s && X##_e == _FP_EXPBIAS_##fs + rsize - 1) \ + { \ + /* Possibly converting to most negative integer; check the \ + mantissa. */ \ + int inexact = 0; \ + (void)((_FP_FRACBITS_##fs > rsize) \ + ? ({ _FP_FRAC_SRST_##wc(X, inexact, \ + _FP_FRACBITS_##fs - rsize, \ + _FP_FRACBITS_##fs); 0; }) \ + : 0); \ + if (!_FP_FRAC_ZEROP_##wc(X)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + else if (inexact) \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + else \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + } \ + else \ + { \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_IMPLBIT_##fs; \ + if (X##_e >= _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs - 1) \ + { \ + _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ + r <<= X##_e - _FP_EXPBIAS_##fs - _FP_FRACBITS_##fs + 1; \ + } \ + else \ + { \ + int inexact; \ + _FP_FRAC_SRST_##wc(X, inexact, \ + (_FP_FRACBITS_##fs + _FP_EXPBIAS_##fs - 1 \ + - X##_e), \ + _FP_FRACBITS_##fs); \ + if (inexact) \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ + } \ + if (rsigned && X##_s) \ + r = -r; \ + } \ +} while (0) + +/* Convert integer to fp. Output is raw. RTYPE is unsigned even if + input is signed. */ +#define _FP_FROM_INT(fs, wc, X, r, rsize, rtype) \ + do { \ + if (r) \ + { \ + rtype ur_; \ + \ + if ((X##_s = (r < 0))) \ + r = -(rtype)r; \ + \ + ur_ = (rtype) r; \ + (void)((rsize <= _FP_W_TYPE_SIZE) \ + ? ({ \ + int lz_; \ + __FP_CLZ(lz_, (_FP_W_TYPE)ur_); \ + X##_e = _FP_EXPBIAS_##fs + _FP_W_TYPE_SIZE - 1 - lz_; \ + }) \ + : ((rsize <= 2 * _FP_W_TYPE_SIZE) \ + ? ({ \ + int lz_; \ + __FP_CLZ_2(lz_, (_FP_W_TYPE)(ur_ >> _FP_W_TYPE_SIZE), \ + (_FP_W_TYPE)ur_); \ + X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \ + - lz_); \ + }) \ + : (abort(), 0))); \ + \ + if (rsize - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs \ + && X##_e >= _FP_EXPMAX_##fs) \ + { \ + /* Exponent too big; overflow to infinity. (May also \ + happen after rounding below.) */ \ + _FP_OVERFLOW_SEMIRAW(fs, wc, X); \ + goto pack_semiraw; \ + } \ + \ + if (rsize <= _FP_FRACBITS_##fs \ + || X##_e < _FP_EXPBIAS_##fs + _FP_FRACBITS_##fs) \ + { \ + /* Exactly representable; shift left. */ \ + _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ + _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs \ + + _FP_FRACBITS_##fs - 1 - X##_e)); \ + } \ + else \ + { \ + /* More bits in integer than in floating type; need to \ + round. */ \ + if (_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 < X##_e) \ + ur_ = ((ur_ >> (X##_e - _FP_EXPBIAS_##fs \ + - _FP_WFRACBITS_##fs + 1)) \ + | ((ur_ << (rsize - (X##_e - _FP_EXPBIAS_##fs \ + - _FP_WFRACBITS_##fs + 1))) \ + != 0)); \ + _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ + if ((_FP_EXPBIAS_##fs + _FP_WFRACBITS_##fs - 1 - X##_e) > 0) \ + _FP_FRAC_SLL_##wc(X, (_FP_EXPBIAS_##fs \ + + _FP_WFRACBITS_##fs - 1 - X##_e)); \ + _FP_FRAC_HIGH_##fs(X) &= ~(_FP_W_TYPE)_FP_IMPLBIT_SH_##fs; \ + pack_semiraw: \ + _FP_PACK_SEMIRAW(fs, wc, X); \ + } \ + } \ + else \ + { \ + X##_s = 0; \ + X##_e = 0; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + } while (0) + + +/* Extend from a narrower floating-point format to a wider one. Input + and output are raw. */ +#define FP_EXTEND(dfs,sfs,dwc,swc,D,S) \ +do { \ + if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs \ + || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \ + < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs) \ + || _FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \ + abort(); \ + D##_s = S##_s; \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + if (_FP_EXP_NORMAL(sfs, swc, S)) \ + { \ + D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs; \ + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs - _FP_FRACBITS_##sfs)); \ + } \ + else \ + { \ + if (S##_e == 0) \ + { \ + if (_FP_FRAC_ZEROP_##swc(S)) \ + D##_e = 0; \ + else \ + { \ + int _lz; \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + _FP_FRAC_CLZ_##swc(_lz, S); \ + _FP_FRAC_SLL_##dwc(D, \ + _lz + _FP_FRACBITS_##dfs \ + - _FP_FRACTBITS_##sfs); \ + D##_e = (_FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs + 1 \ + + _FP_FRACXBITS_##sfs - _lz); \ + } \ + } \ + else \ + { \ + D##_e = _FP_EXPMAX_##dfs; \ + if (!_FP_FRAC_ZEROP_##swc(S)) \ + { \ + if (!(_FP_FRAC_HIGH_RAW_##sfs(S) & _FP_QNANBIT_##sfs)) \ + FP_SET_EXCEPTION(FP_EX_INVALID); \ + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs \ + - _FP_FRACBITS_##sfs)); \ + } \ + } \ + } \ +} while (0) + +/* Truncate from a wider floating-point format to a narrower one. + Input and output are semi-raw. */ +#define FP_TRUNC(dfs,sfs,dwc,swc,D,S) \ +do { \ + if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs \ + || _FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \ + abort(); \ + D##_s = S##_s; \ + if (_FP_EXP_NORMAL(sfs, swc, S)) \ + { \ + D##_e = S##_e + _FP_EXPBIAS_##dfs - _FP_EXPBIAS_##sfs; \ + if (D##_e >= _FP_EXPMAX_##dfs) \ + _FP_OVERFLOW_SEMIRAW(dfs, dwc, D); \ + else \ + { \ + if (D##_e <= 0) \ + { \ + if (D##_e <= 1 - _FP_FRACBITS_##dfs) \ + _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \ + else \ + { \ + _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \ + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs + 1 - D##_e), \ + _FP_WFRACBITS_##sfs); \ + } \ + D##_e = 0; \ + } \ + else \ + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs), \ + _FP_WFRACBITS_##sfs); \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + } \ + } \ + else \ + { \ + if (S##_e == 0) \ + { \ + D##_e = 0; \ + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \ + if (!_FP_FRAC_ZEROP_##swc(S)) \ + { \ + FP_SET_EXCEPTION(FP_EX_DENORM); \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + } \ + } \ + else \ + { \ + D##_e = _FP_EXPMAX_##dfs; \ + if (_FP_FRAC_ZEROP_##swc(S)) \ + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \ + else \ + { \ + _FP_CHECK_SIGNAN_SEMIRAW(sfs, swc, S); \ + _FP_FRAC_SRL_##swc(S, (_FP_WFRACBITS_##sfs \ + - _FP_WFRACBITS_##dfs)); \ + _FP_FRAC_COPY_##dwc##_##swc(D, S); \ + /* Semi-raw NaN must have all workbits cleared. */ \ + _FP_FRAC_LOW_##dwc(D) \ + &= ~(_FP_W_TYPE) ((1 << _FP_WORKBITS) - 1); \ + _FP_FRAC_HIGH_##dfs(D) |= _FP_QNANBIT_SH_##dfs; \ + } \ + } \ + } \ +} while (0) + +/* + * Helper primitives. + */ + +/* Count leading zeros in a word. */ + +#ifndef __FP_CLZ +/* GCC 3.4 and later provide the builtins for us. */ +#define __FP_CLZ(r, x) \ + do { \ + if (sizeof (_FP_W_TYPE) == sizeof (unsigned int)) \ + r = __builtin_clz (x); \ + else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long)) \ + r = __builtin_clzl (x); \ + else if (sizeof (_FP_W_TYPE) == sizeof (unsigned long long)) \ + r = __builtin_clzll (x); \ + else \ + abort (); \ + } while (0) +#endif /* ndef __FP_CLZ */ + +#define _FP_DIV_HELP_imm(q, r, n, d) \ + do { \ + q = n / d, r = n % d; \ + } while (0) + + +/* A restoring bit-by-bit division primitive. */ + +#define _FP_DIV_MEAT_N_loop(fs, wc, R, X, Y) \ + do { \ + int count = _FP_WFRACBITS_##fs; \ + _FP_FRAC_DECL_##wc (u); \ + _FP_FRAC_DECL_##wc (v); \ + _FP_FRAC_COPY_##wc (u, X); \ + _FP_FRAC_COPY_##wc (v, Y); \ + _FP_FRAC_SET_##wc (R, _FP_ZEROFRAC_##wc); \ + /* Normalize U and V. */ \ + _FP_FRAC_SLL_##wc (u, _FP_WFRACXBITS_##fs); \ + _FP_FRAC_SLL_##wc (v, _FP_WFRACXBITS_##fs); \ + /* First round. Since the operands are normalized, either the \ + first or second bit will be set in the fraction. Produce a \ + normalized result by checking which and adjusting the loop \ + count and exponent accordingly. */ \ + if (_FP_FRAC_GE_1 (u, v)) \ + { \ + _FP_FRAC_SUB_##wc (u, u, v); \ + _FP_FRAC_LOW_##wc (R) |= 1; \ + count--; \ + } \ + else \ + R##_e--; \ + /* Subsequent rounds. */ \ + do { \ + int msb = (_FP_WS_TYPE) _FP_FRAC_HIGH_##wc (u) < 0; \ + _FP_FRAC_SLL_##wc (u, 1); \ + _FP_FRAC_SLL_##wc (R, 1); \ + if (msb || _FP_FRAC_GE_1 (u, v)) \ + { \ + _FP_FRAC_SUB_##wc (u, u, v); \ + _FP_FRAC_LOW_##wc (R) |= 1; \ + } \ + } while (--count > 0); \ + /* If there's anything left in U, the result is inexact. */ \ + _FP_FRAC_LOW_##wc (R) |= !_FP_FRAC_ZEROP_##wc (u); \ + } while (0) + +#define _FP_DIV_MEAT_1_loop(fs, R, X, Y) _FP_DIV_MEAT_N_loop (fs, 1, R, X, Y) +#define _FP_DIV_MEAT_2_loop(fs, R, X, Y) _FP_DIV_MEAT_N_loop (fs, 2, R, X, Y) +#define _FP_DIV_MEAT_4_loop(fs, R, X, Y) _FP_DIV_MEAT_N_loop (fs, 4, R, X, Y) diff --git a/contrib/gcc/config/soft-fp/quad.h b/contrib/gcc/config/soft-fp/quad.h new file mode 100644 index 00000000000..d7840ff0662 --- /dev/null +++ b/contrib/gcc/config/soft-fp/quad.h @@ -0,0 +1,271 @@ +/* Software floating-point emulation. + Definitions for IEEE Quad Precision. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel, kid. Go buy yourself a real computer." +#endif + +#if _FP_W_TYPE_SIZE < 64 +#define _FP_FRACTBITS_Q (4*_FP_W_TYPE_SIZE) +#else +#define _FP_FRACTBITS_Q (2*_FP_W_TYPE_SIZE) +#endif + +#define _FP_FRACBITS_Q 113 +#define _FP_FRACXBITS_Q (_FP_FRACTBITS_Q - _FP_FRACBITS_Q) +#define _FP_WFRACBITS_Q (_FP_WORKBITS + _FP_FRACBITS_Q) +#define _FP_WFRACXBITS_Q (_FP_FRACTBITS_Q - _FP_WFRACBITS_Q) +#define _FP_EXPBITS_Q 15 +#define _FP_EXPBIAS_Q 16383 +#define _FP_EXPMAX_Q 32767 + +#define _FP_QNANBIT_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2) % _FP_W_TYPE_SIZE) +#define _FP_QNANBIT_SH_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1) % _FP_W_TYPE_SIZE) +#define _FP_IMPLBIT_SH_Q \ + ((_FP_W_TYPE)1 << (_FP_FRACBITS_Q-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE) +#define _FP_OVERFLOW_Q \ + ((_FP_W_TYPE)1 << (_FP_WFRACBITS_Q % _FP_W_TYPE_SIZE)) + +typedef float TFtype __attribute__((mode(TF))); + +#if _FP_W_TYPE_SIZE < 64 + +union _FP_UNION_Q +{ + TFtype flt; + struct + { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_Q; + unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3); + unsigned long frac2 : _FP_W_TYPE_SIZE; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned long frac0 : _FP_W_TYPE_SIZE; +#else + unsigned long frac0 : _FP_W_TYPE_SIZE; + unsigned long frac1 : _FP_W_TYPE_SIZE; + unsigned long frac2 : _FP_W_TYPE_SIZE; + unsigned long frac3 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0)-(_FP_W_TYPE_SIZE * 3); + unsigned exp : _FP_EXPBITS_Q; + unsigned sign : 1; +#endif /* not bigendian */ + } bits __attribute__((packed)); +}; + + +#define FP_DECL_Q(X) _FP_DECL(4,X) +#define FP_UNPACK_RAW_Q(X,val) _FP_UNPACK_RAW_4(Q,X,val) +#define FP_UNPACK_RAW_QP(X,val) _FP_UNPACK_RAW_4_P(Q,X,val) +#define FP_PACK_RAW_Q(val,X) _FP_PACK_RAW_4(Q,val,X) +#define FP_PACK_RAW_QP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_4_P(Q,val,X); \ + } while (0) + +#define FP_UNPACK_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_4(Q,X,val); \ + _FP_UNPACK_CANONICAL(Q,4,X); \ + } while (0) + +#define FP_UNPACK_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_4_P(Q,X,val); \ + _FP_UNPACK_CANONICAL(Q,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_4(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,4,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_4_P(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,4,X); \ + } while (0) + +#define FP_PACK_Q(val,X) \ + do { \ + _FP_PACK_CANONICAL(Q,4,X); \ + _FP_PACK_RAW_4(Q,val,X); \ + } while (0) + +#define FP_PACK_QP(val,X) \ + do { \ + _FP_PACK_CANONICAL(Q,4,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_4_P(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_Q(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,4,X); \ + _FP_PACK_RAW_4(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_QP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,4,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_4_P(Q,val,X); \ + } while (0) + +#define FP_ISSIGNAN_Q(X) _FP_ISSIGNAN(Q,4,X) +#define FP_NEG_Q(R,X) _FP_NEG(Q,4,R,X) +#define FP_ADD_Q(R,X,Y) _FP_ADD(Q,4,R,X,Y) +#define FP_SUB_Q(R,X,Y) _FP_SUB(Q,4,R,X,Y) +#define FP_MUL_Q(R,X,Y) _FP_MUL(Q,4,R,X,Y) +#define FP_DIV_Q(R,X,Y) _FP_DIV(Q,4,R,X,Y) +#define FP_SQRT_Q(R,X) _FP_SQRT(Q,4,R,X) +#define _FP_SQRT_MEAT_Q(R,S,T,X,Q) _FP_SQRT_MEAT_4(R,S,T,X,Q) + +#define FP_CMP_Q(r,X,Y,un) _FP_CMP(Q,4,r,X,Y,un) +#define FP_CMP_EQ_Q(r,X,Y) _FP_CMP_EQ(Q,4,r,X,Y) +#define FP_CMP_UNORD_Q(r,X,Y) _FP_CMP_UNORD(Q,4,r,X,Y) + +#define FP_TO_INT_Q(r,X,rsz,rsg) _FP_TO_INT(Q,4,r,X,rsz,rsg) +#define FP_FROM_INT_Q(X,r,rs,rt) _FP_FROM_INT(Q,4,X,r,rs,rt) + +#define _FP_FRAC_HIGH_Q(X) _FP_FRAC_HIGH_4(X) +#define _FP_FRAC_HIGH_RAW_Q(X) _FP_FRAC_HIGH_4(X) + +#else /* not _FP_W_TYPE_SIZE < 64 */ +union _FP_UNION_Q +{ + TFtype flt /* __attribute__((mode(TF))) */ ; + struct { + _FP_W_TYPE a, b; + } longs; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_Q; + unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE; + unsigned long frac0 : _FP_W_TYPE_SIZE; +#else + unsigned long frac0 : _FP_W_TYPE_SIZE; + unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE; + unsigned exp : _FP_EXPBITS_Q; + unsigned sign : 1; +#endif + } bits; +}; + +#define FP_DECL_Q(X) _FP_DECL(2,X) +#define FP_UNPACK_RAW_Q(X,val) _FP_UNPACK_RAW_2(Q,X,val) +#define FP_UNPACK_RAW_QP(X,val) _FP_UNPACK_RAW_2_P(Q,X,val) +#define FP_PACK_RAW_Q(val,X) _FP_PACK_RAW_2(Q,val,X) +#define FP_PACK_RAW_QP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(Q,val,X); \ + } while (0) + +#define FP_UNPACK_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_2(Q,X,val); \ + _FP_UNPACK_CANONICAL(Q,2,X); \ + } while (0) + +#define FP_UNPACK_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(Q,X,val); \ + _FP_UNPACK_CANONICAL(Q,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_Q(X,val) \ + do { \ + _FP_UNPACK_RAW_2(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,2,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_QP(X,val) \ + do { \ + _FP_UNPACK_RAW_2_P(Q,X,val); \ + _FP_UNPACK_SEMIRAW(Q,2,X); \ + } while (0) + +#define FP_PACK_Q(val,X) \ + do { \ + _FP_PACK_CANONICAL(Q,2,X); \ + _FP_PACK_RAW_2(Q,val,X); \ + } while (0) + +#define FP_PACK_QP(val,X) \ + do { \ + _FP_PACK_CANONICAL(Q,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_Q(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,2,X); \ + _FP_PACK_RAW_2(Q,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_QP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(Q,2,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_2_P(Q,val,X); \ + } while (0) + +#define FP_ISSIGNAN_Q(X) _FP_ISSIGNAN(Q,2,X) +#define FP_NEG_Q(R,X) _FP_NEG(Q,2,R,X) +#define FP_ADD_Q(R,X,Y) _FP_ADD(Q,2,R,X,Y) +#define FP_SUB_Q(R,X,Y) _FP_SUB(Q,2,R,X,Y) +#define FP_MUL_Q(R,X,Y) _FP_MUL(Q,2,R,X,Y) +#define FP_DIV_Q(R,X,Y) _FP_DIV(Q,2,R,X,Y) +#define FP_SQRT_Q(R,X) _FP_SQRT(Q,2,R,X) +#define _FP_SQRT_MEAT_Q(R,S,T,X,Q) _FP_SQRT_MEAT_2(R,S,T,X,Q) + +#define FP_CMP_Q(r,X,Y,un) _FP_CMP(Q,2,r,X,Y,un) +#define FP_CMP_EQ_Q(r,X,Y) _FP_CMP_EQ(Q,2,r,X,Y) +#define FP_CMP_UNORD_Q(r,X,Y) _FP_CMP_UNORD(Q,2,r,X,Y) + +#define FP_TO_INT_Q(r,X,rsz,rsg) _FP_TO_INT(Q,2,r,X,rsz,rsg) +#define FP_FROM_INT_Q(X,r,rs,rt) _FP_FROM_INT(Q,2,X,r,rs,rt) + +#define _FP_FRAC_HIGH_Q(X) _FP_FRAC_HIGH_2(X) +#define _FP_FRAC_HIGH_RAW_Q(X) _FP_FRAC_HIGH_2(X) + +#endif /* not _FP_W_TYPE_SIZE < 64 */ diff --git a/contrib/gcc/config/soft-fp/single.h b/contrib/gcc/config/soft-fp/single.h new file mode 100644 index 00000000000..9c3734adf48 --- /dev/null +++ b/contrib/gcc/config/soft-fp/single.h @@ -0,0 +1,151 @@ +/* Software floating-point emulation. + Definitions for IEEE Single Precision. + Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#if _FP_W_TYPE_SIZE < 32 +#error "Here's a nickel kid. Go buy yourself a real computer." +#endif + +#define _FP_FRACTBITS_S _FP_W_TYPE_SIZE + +#define _FP_FRACBITS_S 24 +#define _FP_FRACXBITS_S (_FP_FRACTBITS_S - _FP_FRACBITS_S) +#define _FP_WFRACBITS_S (_FP_WORKBITS + _FP_FRACBITS_S) +#define _FP_WFRACXBITS_S (_FP_FRACTBITS_S - _FP_WFRACBITS_S) +#define _FP_EXPBITS_S 8 +#define _FP_EXPBIAS_S 127 +#define _FP_EXPMAX_S 255 +#define _FP_QNANBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2)) +#define _FP_QNANBIT_SH_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2+_FP_WORKBITS)) +#define _FP_IMPLBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1)) +#define _FP_IMPLBIT_SH_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1+_FP_WORKBITS)) +#define _FP_OVERFLOW_S ((_FP_W_TYPE)1 << (_FP_WFRACBITS_S)) + +/* The implementation of _FP_MUL_MEAT_S and _FP_DIV_MEAT_S should be + chosen by the target machine. */ + +typedef float SFtype __attribute__((mode(SF))); + +union _FP_UNION_S +{ + SFtype flt; + struct { +#if __BYTE_ORDER == __BIG_ENDIAN + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_S; + unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0); +#else + unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0); + unsigned exp : _FP_EXPBITS_S; + unsigned sign : 1; +#endif + } bits __attribute__((packed)); +}; + +#define FP_DECL_S(X) _FP_DECL(1,X) +#define FP_UNPACK_RAW_S(X,val) _FP_UNPACK_RAW_1(S,X,val) +#define FP_UNPACK_RAW_SP(X,val) _FP_UNPACK_RAW_1_P(S,X,val) +#define FP_PACK_RAW_S(val,X) _FP_PACK_RAW_1(S,val,X) +#define FP_PACK_RAW_SP(val,X) \ + do { \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(S,val,X); \ + } while (0) + +#define FP_UNPACK_S(X,val) \ + do { \ + _FP_UNPACK_RAW_1(S,X,val); \ + _FP_UNPACK_CANONICAL(S,1,X); \ + } while (0) + +#define FP_UNPACK_SP(X,val) \ + do { \ + _FP_UNPACK_RAW_1_P(S,X,val); \ + _FP_UNPACK_CANONICAL(S,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_S(X,val) \ + do { \ + _FP_UNPACK_RAW_1(S,X,val); \ + _FP_UNPACK_SEMIRAW(S,1,X); \ + } while (0) + +#define FP_UNPACK_SEMIRAW_SP(X,val) \ + do { \ + _FP_UNPACK_RAW_1_P(S,X,val); \ + _FP_UNPACK_SEMIRAW(S,1,X); \ + } while (0) + +#define FP_PACK_S(val,X) \ + do { \ + _FP_PACK_CANONICAL(S,1,X); \ + _FP_PACK_RAW_1(S,val,X); \ + } while (0) + +#define FP_PACK_SP(val,X) \ + do { \ + _FP_PACK_CANONICAL(S,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(S,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_S(val,X) \ + do { \ + _FP_PACK_SEMIRAW(S,1,X); \ + _FP_PACK_RAW_1(S,val,X); \ + } while (0) + +#define FP_PACK_SEMIRAW_SP(val,X) \ + do { \ + _FP_PACK_SEMIRAW(S,1,X); \ + if (!FP_INHIBIT_RESULTS) \ + _FP_PACK_RAW_1_P(S,val,X); \ + } while (0) + +#define FP_ISSIGNAN_S(X) _FP_ISSIGNAN(S,1,X) +#define FP_NEG_S(R,X) _FP_NEG(S,1,R,X) +#define FP_ADD_S(R,X,Y) _FP_ADD(S,1,R,X,Y) +#define FP_SUB_S(R,X,Y) _FP_SUB(S,1,R,X,Y) +#define FP_MUL_S(R,X,Y) _FP_MUL(S,1,R,X,Y) +#define FP_DIV_S(R,X,Y) _FP_DIV(S,1,R,X,Y) +#define FP_SQRT_S(R,X) _FP_SQRT(S,1,R,X) +#define _FP_SQRT_MEAT_S(R,S,T,X,Q) _FP_SQRT_MEAT_1(R,S,T,X,Q) + +#define FP_CMP_S(r,X,Y,un) _FP_CMP(S,1,r,X,Y,un) +#define FP_CMP_EQ_S(r,X,Y) _FP_CMP_EQ(S,1,r,X,Y) +#define FP_CMP_UNORD_S(r,X,Y) _FP_CMP_UNORD(S,1,r,X,Y) + +#define FP_TO_INT_S(r,X,rsz,rsg) _FP_TO_INT(S,1,r,X,rsz,rsg) +#define FP_FROM_INT_S(X,r,rs,rt) _FP_FROM_INT(S,1,X,r,rs,rt) + +#define _FP_FRAC_HIGH_S(X) _FP_FRAC_HIGH_1(X) +#define _FP_FRAC_HIGH_RAW_S(X) _FP_FRAC_HIGH_1(X) diff --git a/contrib/gcc/config/soft-fp/soft-fp.h b/contrib/gcc/config/soft-fp/soft-fp.h new file mode 100644 index 00000000000..dbf080e7f48 --- /dev/null +++ b/contrib/gcc/config/soft-fp/soft-fp.h @@ -0,0 +1,209 @@ +/* Software floating-point emulation. + Copyright (C) 1997,1998,1999,2000,2002,2003,2005,2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com), + Jakub Jelinek (jj@ultra.linux.cz), + David S. Miller (davem@redhat.com) and + Peter Maydell (pmaydell@chiark.greenend.org.uk). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef SOFT_FP_H +#define SOFT_FP_H + +#ifdef _LIBC +#include +#else +#include "sfp-machine.h" +#endif + +/* Allow sfp-machine to have its own byte order definitions. */ +#ifndef __BYTE_ORDER +#ifdef _LIBC +#include +#else +#error "endianness not defined by sfp-machine.h" +#endif +#endif + +#define _FP_WORKBITS 3 +#define _FP_WORK_LSB ((_FP_W_TYPE)1 << 3) +#define _FP_WORK_ROUND ((_FP_W_TYPE)1 << 2) +#define _FP_WORK_GUARD ((_FP_W_TYPE)1 << 1) +#define _FP_WORK_STICKY ((_FP_W_TYPE)1 << 0) + +#ifndef FP_RND_NEAREST +# define FP_RND_NEAREST 0 +# define FP_RND_ZERO 1 +# define FP_RND_PINF 2 +# define FP_RND_MINF 3 +#endif +#ifndef FP_ROUNDMODE +# define FP_ROUNDMODE FP_RND_NEAREST +#endif + +/* By default don't care about exceptions. */ +#ifndef FP_EX_INVALID +#define FP_EX_INVALID 0 +#endif +#ifndef FP_EX_OVERFLOW +#define FP_EX_OVERFLOW 0 +#endif +#ifndef FP_EX_UNDERFLOW +#define FP_EX_UNDERFLOW 0 +#endif +#ifndef FP_EX_DIVZERO +#define FP_EX_DIVZERO 0 +#endif +#ifndef FP_EX_INEXACT +#define FP_EX_INEXACT 0 +#endif +#ifndef FP_EX_DENORM +#define FP_EX_DENORM 0 +#endif + +#ifdef _FP_DECL_EX +#define FP_DECL_EX \ + int _fex = 0; \ + _FP_DECL_EX +#else +#define FP_DECL_EX int _fex = 0 +#endif + +#ifndef FP_INIT_ROUNDMODE +#define FP_INIT_ROUNDMODE do {} while (0) +#endif + +#ifndef FP_HANDLE_EXCEPTIONS +#define FP_HANDLE_EXCEPTIONS do {} while (0) +#endif + +#ifndef FP_INHIBIT_RESULTS +/* By default we write the results always. + * sfp-machine may override this and e.g. + * check if some exceptions are unmasked + * and inhibit it in such a case. + */ +#define FP_INHIBIT_RESULTS 0 +#endif + +#define FP_SET_EXCEPTION(ex) \ + _fex |= (ex) + +#define FP_UNSET_EXCEPTION(ex) \ + _fex &= ~(ex) + +#define FP_CLEAR_EXCEPTIONS \ + _fex = 0 + +#define _FP_ROUND_NEAREST(wc, X) \ +do { \ + if ((_FP_FRAC_LOW_##wc(X) & 15) != _FP_WORK_ROUND) \ + _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND); \ +} while (0) + +#define _FP_ROUND_ZERO(wc, X) (void)0 + +#define _FP_ROUND_PINF(wc, X) \ +do { \ + if (!X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \ + _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \ +} while (0) + +#define _FP_ROUND_MINF(wc, X) \ +do { \ + if (X##_s && (_FP_FRAC_LOW_##wc(X) & 7)) \ + _FP_FRAC_ADDI_##wc(X, _FP_WORK_LSB); \ +} while (0) + +#define _FP_ROUND(wc, X) \ +do { \ + if (_FP_FRAC_LOW_##wc(X) & 7) \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + switch (FP_ROUNDMODE) \ + { \ + case FP_RND_NEAREST: \ + _FP_ROUND_NEAREST(wc,X); \ + break; \ + case FP_RND_ZERO: \ + _FP_ROUND_ZERO(wc,X); \ + break; \ + case FP_RND_PINF: \ + _FP_ROUND_PINF(wc,X); \ + break; \ + case FP_RND_MINF: \ + _FP_ROUND_MINF(wc,X); \ + break; \ + } \ +} while (0) + +#define FP_CLS_NORMAL 0 +#define FP_CLS_ZERO 1 +#define FP_CLS_INF 2 +#define FP_CLS_NAN 3 + +#define _FP_CLS_COMBINE(x,y) (((x) << 2) | (y)) + +#include "op-1.h" +#include "op-2.h" +#include "op-4.h" +#include "op-8.h" +#include "op-common.h" + +/* Sigh. Silly things longlong.h needs. */ +#define UWtype _FP_W_TYPE +#define W_TYPE_SIZE _FP_W_TYPE_SIZE + +typedef int QItype __attribute__((mode(QI))); +typedef int SItype __attribute__((mode(SI))); +typedef int DItype __attribute__((mode(DI))); +typedef unsigned int UQItype __attribute__((mode(QI))); +typedef unsigned int USItype __attribute__((mode(SI))); +typedef unsigned int UDItype __attribute__((mode(DI))); +#if _FP_W_TYPE_SIZE == 32 +typedef unsigned int UHWtype __attribute__((mode(HI))); +#elif _FP_W_TYPE_SIZE == 64 +typedef USItype UHWtype; +#endif + +#define SI_BITS (__CHAR_BIT__ * (int)sizeof(SItype)) +#define DI_BITS (__CHAR_BIT__ * (int)sizeof(DItype)) + +#ifndef umul_ppmm +#ifdef _LIBC +#include +#else +#include "longlong.h" +#endif +#endif + +#ifdef _LIBC +#include +#else +extern void abort (void); +#endif + +#endif diff --git a/contrib/gcc/config/soft-fp/subdf3.c b/contrib/gcc/config/soft-fp/subdf3.c new file mode 100644 index 00000000000..3978b52998d --- /dev/null +++ b/contrib/gcc/config/soft-fp/subdf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a - b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +DFtype __subdf3(DFtype a, DFtype b) +{ + FP_DECL_EX; + FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_D(A, a); + FP_UNPACK_SEMIRAW_D(B, b); + FP_SUB_D(R, A, B); + FP_PACK_SEMIRAW_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/subsf3.c b/contrib/gcc/config/soft-fp/subsf3.c new file mode 100644 index 00000000000..f1cbdd1ff1f --- /dev/null +++ b/contrib/gcc/config/soft-fp/subsf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a - b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +SFtype __subsf3(SFtype a, SFtype b) +{ + FP_DECL_EX; + FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_S(A, a); + FP_UNPACK_SEMIRAW_S(B, b); + FP_SUB_S(R, A, B); + FP_PACK_SEMIRAW_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/subtf3.c b/contrib/gcc/config/soft-fp/subtf3.c new file mode 100644 index 00000000000..7ba4c8c5ea0 --- /dev/null +++ b/contrib/gcc/config/soft-fp/subtf3.c @@ -0,0 +1,49 @@ +/* Software floating-point emulation. + Return a - b + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +TFtype __subtf3(TFtype a, TFtype b) +{ + FP_DECL_EX; + FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R); + TFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(A, a); + FP_UNPACK_SEMIRAW_Q(B, b); + FP_SUB_Q(R, A, B); + FP_PACK_SEMIRAW_Q(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/t-softfp b/contrib/gcc/config/soft-fp/t-softfp new file mode 100644 index 00000000000..4a3f91e15ee --- /dev/null +++ b/contrib/gcc/config/soft-fp/t-softfp @@ -0,0 +1,108 @@ +# Copyright (C) 2006 Free Software Foundation, Inc. + +# This file is part of GCC. + +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# 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, 51 Franklin Street, Fifth Floor, +# Boston MA 02110-1301, USA. + +# Targets using soft-fp should define the following variables: +# +# softfp_float_modes: a list of soft-float floating-point modes, +# e.g. sf df +# softfp_int_modes: a list of integer modes for which to define conversions, +# e.g. si di +# softfp_extensions: a list of extensions between floating-point modes, +# e.g. sfdf +# softfp_truncations: a list of truncations between floating-point modes, +# e.g. dfsf +# softfp_machine_header: the target sfp-machine.h file (relative to config/), +# e.g. rs6000/sfp-machine.h +# +# Extensions and truncations should include those where only one mode +# is a soft-float mode; for example, sftf where sf is hard-float and +# tf is soft-float. +# +# If the libgcc2.c functions should not be replaced, also define: +# +# softfp_exclude_libgcc2 := y +# +# Avoiding replacing the libgcc2.c functions is a temporary measure +# for targets with both hard-float and soft-float multilibs, since +# these variables apply for all multilibs. With toplevel libgcc, +# soft-fp can be used conditionally on the multilib instead. +# +# If the code should not be compiled at all for some multilibs, define: +# +# softfp_wrap_start: text to put at the start of wrapper source files, +# output with echo +# e.g. '#ifndef __powerpc64__' +# softfp_wrap_end: text to put at the end of wrapper source files, +# e.g. '#endif' +# +# This is another temporary measure. + +softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \ + neg$(m)2 sub$(m)3 unord$(m)2 +softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \ + float$(i)$(m) floatun$(i)$(m) + +softfp_func_list := \ + $(foreach m,$(softfp_float_modes), \ + $(softfp_float_funcs) \ + $(foreach i,$(softfp_int_modes), \ + $(softfp_floatint_funcs))) \ + $(foreach e,$(softfp_extensions),extend$(e)2) \ + $(foreach t,$(softfp_truncations),trunc$(t)2) + +ifeq ($(softfp_exclude_libgcc2),y) +# This list is taken from mklibgcc.in and doesn't presently allow for +# 64-bit targets where si should become di and di should become ti. +softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \ + fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \ + floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \ + floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list)) +endif + +ifeq ($(softfp_wrap_start),) +softfp_file_list := \ + $(addsuffix .c,$(addprefix $(srcdir)/config/soft-fp/,$(softfp_func_list))) +else +softfp_file_list := $(addsuffix .c,$(softfp_func_list)) + +$(softfp_file_list): + echo $(softfp_wrap_start) > $@ + echo '#include "config/soft-fp/$@"' >> $@ + echo $(softfp_wrap_end) >> $@ +endif + +LIB2FUNCS_EXTRA += $(softfp_file_list) + +ifneq ($(softfp_exclude_libgcc2),y) +# Functions in libgcc2.c are excluded for each soft-float mode (a +# target may have both soft-float and hard-float modes), for the fixed +# list of integer modes (si and di) for which libgcc2.c defines any +# such functions. Depending on the target, the si and di symbols may +# in fact define di and ti functions. + +LIB2FUNCS_EXCLUDE += \ + $(addprefix _,$(foreach m,$(softfp_float_modes), \ + $(foreach i,si di, \ + $(softfp_floatint_funcs)))) +endif + +SFP_MACHINE := sfp-machine.h + +$(SFP_MACHINE): $(srcdir)/config/$(softfp_machine_header) + cp $(srcdir)/config/$(softfp_machine_header) $(SFP_MACHINE) diff --git a/contrib/gcc/config/soft-fp/truncdfsf2.c b/contrib/gcc/config/soft-fp/truncdfsf2.c new file mode 100644 index 00000000000..bd953912e98 --- /dev/null +++ b/contrib/gcc/config/soft-fp/truncdfsf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Truncate IEEE double into IEEE single + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "double.h" + +SFtype __truncdfsf2(DFtype a) +{ + FP_DECL_EX; + FP_DECL_D(A); + FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_D(A, a); +#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D + FP_TRUNC(S,D,1,2,R,A); +#else + FP_TRUNC(S,D,1,1,R,A); +#endif + FP_PACK_SEMIRAW_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/trunctfdf2.c b/contrib/gcc/config/soft-fp/trunctfdf2.c new file mode 100644 index 00000000000..c3827b08abe --- /dev/null +++ b/contrib/gcc/config/soft-fp/trunctfdf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Truncate IEEE quad into IEEE double + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" +#include "quad.h" + +DFtype __trunctfdf2(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + FP_DECL_D(R); + DFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_TRUNC(D,Q,2,4,R,A); +#else + FP_TRUNC(D,Q,1,2,R,A); +#endif + FP_PACK_SEMIRAW_D(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/trunctfsf2.c b/contrib/gcc/config/soft-fp/trunctfsf2.c new file mode 100644 index 00000000000..676c937e20a --- /dev/null +++ b/contrib/gcc/config/soft-fp/trunctfsf2.c @@ -0,0 +1,54 @@ +/* Software floating-point emulation. + Truncate IEEE quad into IEEE single + Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Richard Henderson (rth@cygnus.com) and + Jakub Jelinek (jj@ultra.linux.cz). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" +#include "quad.h" + +SFtype __trunctfsf2(TFtype a) +{ + FP_DECL_EX; + FP_DECL_Q(A); + FP_DECL_S(R); + SFtype r; + + FP_INIT_ROUNDMODE; + FP_UNPACK_SEMIRAW_Q(A, a); +#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q + FP_TRUNC(S,Q,1,4,R,A); +#else + FP_TRUNC(S,Q,1,2,R,A); +#endif + FP_PACK_SEMIRAW_S(r, R); + FP_HANDLE_EXCEPTIONS; + + return r; +} diff --git a/contrib/gcc/config/soft-fp/unorddf2.c b/contrib/gcc/config/soft-fp/unorddf2.c new file mode 100644 index 00000000000..c83a5632759 --- /dev/null +++ b/contrib/gcc/config/soft-fp/unorddf2.c @@ -0,0 +1,45 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "double.h" + +int +__unorddf2(DFtype a, DFtype b) +{ + FP_DECL_D(A); FP_DECL_D(B); + int r; + + FP_UNPACK_RAW_D(A, a); + FP_UNPACK_RAW_D(B, b); + FP_CMP_UNORD_D(r, A, B); + + return r; +} diff --git a/contrib/gcc/config/soft-fp/unordsf2.c b/contrib/gcc/config/soft-fp/unordsf2.c new file mode 100644 index 00000000000..8de75635660 --- /dev/null +++ b/contrib/gcc/config/soft-fp/unordsf2.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "single.h" + +int +__unordsf2(SFtype a, SFtype b) +{ + FP_DECL_S(A); + FP_DECL_S(B); + int r; + + FP_UNPACK_RAW_S(A, a); + FP_UNPACK_RAW_S(B, b); + FP_CMP_UNORD_S(r, A, B); + + return r; +} diff --git a/contrib/gcc/config/soft-fp/unordtf2.c b/contrib/gcc/config/soft-fp/unordtf2.c new file mode 100644 index 00000000000..134b1d09b8a --- /dev/null +++ b/contrib/gcc/config/soft-fp/unordtf2.c @@ -0,0 +1,46 @@ +/* Software floating-point emulation. + Return 1 iff a or b is a NaN, 0 otherwise. + Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Joseph Myers (joseph@codesourcery.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + In addition to the permissions in the GNU Lesser General Public + License, the Free Software Foundation gives you unlimited + permission to link the compiled version of this file into + combinations with other programs, and to distribute those + combinations without any restriction coming from the use of this + file. (The Lesser General Public License restrictions do apply in + other respects; for example, they cover modification of the file, + and distribution when not linked into a combine executable.) + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "soft-fp.h" +#include "quad.h" + +int +__unordtf2(TFtype a, TFtype b) +{ + FP_DECL_Q(A); + FP_DECL_Q(B); + int r; + + FP_UNPACK_RAW_Q(A, a); + FP_UNPACK_RAW_Q(B, b); + FP_CMP_UNORD_Q(r, A, B); + + return r; +} diff --git a/contrib/gcc/config/sol2-10.h b/contrib/gcc/config/sol2-10.h new file mode 100644 index 00000000000..1da6bee10de --- /dev/null +++ b/contrib/gcc/config/sol2-10.h @@ -0,0 +1,24 @@ +/* Operating system specific defines to be used when targeting GCC for any + Solaris 2 system starting from Solaris 10. + Copyright 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Solaris 10 has the float and long double forms of math functions. */ +#undef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS 1 diff --git a/contrib/gcc/config/sol2-6.h b/contrib/gcc/config/sol2-6.h new file mode 100644 index 00000000000..d5b7dda2a5f --- /dev/null +++ b/contrib/gcc/config/sol2-6.h @@ -0,0 +1,27 @@ +/* Operating system specific defines to be used when targeting GCC for any + Solaris 2 system up to Solaris 2.6. + Copyright 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "\ +%{pthreads|pthread:-D_REENTRANT -D_PTHREADS95} \ +%{!pthreads:%{!pthread:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}}} \ +%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \ +" diff --git a/contrib/gcc/config/sol2-c.c b/contrib/gcc/config/sol2-c.c new file mode 100644 index 00000000000..173583be26b --- /dev/null +++ b/contrib/gcc/config/sol2-c.c @@ -0,0 +1,272 @@ +/* Solaris support needed only by C/C++ frontends. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tree.h" +#include "tm.h" +#include "tm_p.h" +#include "toplev.h" + +#include "c-format.h" +#include "intl.h" + +#include "cpplib.h" +#include "c-pragma.h" +#include "c-common.h" + +/* cmn_err only accepts "l" and "ll". */ +static const format_length_info cmn_err_length_specs[] = +{ + { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89 }, + { NULL, 0, 0, NULL, 0, 0 } +}; + +static const format_flag_spec cmn_err_flag_specs[] = +{ + { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, + { 0, 0, 0, NULL, NULL, 0 } +}; + + +static const format_flag_pair cmn_err_flag_pairs[] = +{ + { 0, 0, 0, 0 } +}; + +static const format_char_info bitfield_string_type = + { "b", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }; + +static const format_char_info cmn_err_char_table[] = +{ + /* C89 conversion specifiers. */ + { "dD", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, + { "oOxX",0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, + { "c", 0, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "c", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "cR", NULL }, + { "b", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "", &bitfield_string_type }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +const format_kind_info solaris_format_types[] = { + { "cmn_err", cmn_err_length_specs, cmn_err_char_table, "", NULL, + cmn_err_flag_specs, cmn_err_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, + 'w', 0, 0, 0, 'L', + &integer_type_node, &integer_type_node + } +}; + +/* Handle #pragma align ALIGNMENT (VAR [, VAR]...) */ + +static void +solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) +{ + tree t, x; + enum cpp_ttype ttype; + HOST_WIDE_INT low; + + if (pragma_lex (&x) != CPP_NUMBER + || pragma_lex (&t) != CPP_OPEN_PAREN) + { + warning (0, "malformed %<#pragma align%>, ignoring"); + return; + } + + low = TREE_INT_CST_LOW (x); + if (TREE_INT_CST_HIGH (x) != 0 + || (low != 1 && low != 2 && low != 4 && low != 8 && low != 16 + && low != 32 && low != 64 && low != 128)) + { + warning (0, "invalid alignment for %<#pragma align%>, ignoring"); + return; + } + + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma align%>, ignoring"); + return; + } + + while (1) + { + tree decl = identifier_global_value (t); + if (decl && DECL_P (decl)) + warning (0, "%<#pragma align%> must appear before the declaration of " + "%D, ignoring", decl); + else + solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x), + solaris_pending_aligns); + + ttype = pragma_lex (&t); + if (ttype == CPP_COMMA) + { + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma align%>"); + return; + } + } + else if (ttype == CPP_CLOSE_PAREN) + { + if (pragma_lex (&t) != CPP_EOF) + warning (0, "junk at end of %<#pragma align%>"); + return; + } + else + { + warning (0, "malformed %<#pragma align%>"); + return; + } + } +} + +/* Handle #pragma init (function [, function]...) */ + +static void +solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) +{ + tree t; + enum cpp_ttype ttype; + + if (pragma_lex (&t) != CPP_OPEN_PAREN) + { + warning (0, "malformed %<#pragma init%>, ignoring"); + return; + } + + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma init%>, ignoring"); + return; + } + + while (1) + { + tree decl = identifier_global_value (t); + if (decl && DECL_P (decl)) + { + tree init_list = build_tree_list (get_identifier ("init"), + NULL); + tree attrs = tree_cons (get_identifier ("used"), NULL, init_list); + decl_attributes (&decl, attrs, 0); + } + else + solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits); + + ttype = pragma_lex (&t); + if (ttype == CPP_COMMA) + { + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma init%>"); + return; + } + } + else if (ttype == CPP_CLOSE_PAREN) + { + if (pragma_lex (&t) != CPP_EOF) + warning (0, "junk at end of %<#pragma init%>"); + return; + } + else + { + warning (0, "malformed %<#pragma init%>"); + return; + } + } +} + +/* Handle #pragma fini (function [, function]...) */ + +static void +solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) +{ + tree t; + enum cpp_ttype ttype; + + if (pragma_lex (&t) != CPP_OPEN_PAREN) + { + warning (0, "malformed %<#pragma fini%>, ignoring"); + return; + } + + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma fini%>, ignoring"); + return; + } + + while (1) + { + tree decl = identifier_global_value (t); + if (decl && DECL_P (decl)) + { + tree fini_list = build_tree_list (get_identifier ("fini"), + NULL); + tree attrs = tree_cons (get_identifier ("used"), NULL, fini_list); + decl_attributes (&decl, attrs, 0); + } + else + solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis); + + ttype = pragma_lex (&t); + if (ttype == CPP_COMMA) + { + ttype = pragma_lex (&t); + if (ttype != CPP_NAME) + { + warning (0, "malformed %<#pragma fini%>"); + return; + } + } + else if (ttype == CPP_CLOSE_PAREN) + { + if (pragma_lex (&t) != CPP_EOF) + warning (0, "junk at end of %<#pragma fini%>"); + return; + } + else + { + warning (0, "malformed %<#pragma fini%>"); + return; + } + } +} + +/* Register Solaris-specific #pragma directives. */ + +void +solaris_register_pragmas (void) +{ + c_register_pragma_with_expansion (0, "align", solaris_pragma_align); + c_register_pragma (0, "init", solaris_pragma_init); + c_register_pragma (0, "fini", solaris_pragma_fini); +} diff --git a/contrib/gcc/config/sol2-protos.h b/contrib/gcc/config/sol2-protos.h new file mode 100644 index 00000000000..757c6f83901 --- /dev/null +++ b/contrib/gcc/config/sol2-protos.h @@ -0,0 +1,24 @@ +/* Operating system specific prototypes to be used when targeting GCC for any + Solaris 2 system. + Copyright 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +extern void solaris_insert_attributes (tree, tree *); +extern void solaris_register_pragmas (void); +extern void solaris_output_init_fini (FILE *, tree); diff --git a/contrib/gcc/config/sol2.c b/contrib/gcc/config/sol2.c new file mode 100644 index 00000000000..e3d3147cafe --- /dev/null +++ b/contrib/gcc/config/sol2.c @@ -0,0 +1,120 @@ +/* General Solaris system support. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tree.h" +#include "tm.h" +#include "rtl.h" +#include "tm_p.h" +#include "toplev.h" +#include "ggc.h" + +tree solaris_pending_aligns, solaris_pending_inits, solaris_pending_finis; + +/* Attach any pending attributes for DECL to the list in *ATTRIBUTES. + Pending attributes come from #pragma or _Pragma, so this code is + only useful in the C family front ends, but it is included in + all languages to avoid changing the target machine initializer + depending on the language. */ + +void +solaris_insert_attributes (tree decl, tree *attributes) +{ + tree *x, next; + + if (solaris_pending_aligns != NULL && TREE_CODE (decl) == VAR_DECL) + for (x = &solaris_pending_aligns; *x; x = &TREE_CHAIN (*x)) + { + tree name = TREE_PURPOSE (*x); + tree value = TREE_VALUE (*x); + if (DECL_NAME (decl) == name) + { + if (lookup_attribute ("aligned", DECL_ATTRIBUTES (decl)) + || lookup_attribute ("aligned", *attributes)) + warning (0, "ignoring %<#pragma align%> for explicitly " + "aligned %q+D", decl); + else + *attributes = tree_cons (get_identifier ("aligned"), value, + *attributes); + next = TREE_CHAIN (*x); + ggc_free (*x); + *x = next; + break; + } + } + + if (solaris_pending_inits != NULL && TREE_CODE (decl) == FUNCTION_DECL) + for (x = &solaris_pending_inits; *x; x = &TREE_CHAIN (*x)) + { + tree name = TREE_PURPOSE (*x); + if (DECL_NAME (decl) == name) + { + *attributes = tree_cons (get_identifier ("init"), NULL, + *attributes); + *attributes = tree_cons (get_identifier ("used"), NULL, + *attributes); + next = TREE_CHAIN (*x); + ggc_free (*x); + *x = next; + break; + } + } + + if (solaris_pending_finis != NULL && TREE_CODE (decl) == FUNCTION_DECL) + for (x = &solaris_pending_finis; *x; x = &TREE_CHAIN (*x)) + { + tree name = TREE_PURPOSE (*x); + if (DECL_NAME (decl) == name) + { + *attributes = tree_cons (get_identifier ("fini"), NULL, + *attributes); + *attributes = tree_cons (get_identifier ("used"), NULL, + *attributes); + next = TREE_CHAIN (*x); + ggc_free (*x); + *x = next; + break; + } + } +} + +/* Output initializer or finalizer entries for DECL to FILE. */ + +void +solaris_output_init_fini (FILE *file, tree decl) +{ + if (lookup_attribute ("init", DECL_ATTRIBUTES (decl))) + { + fprintf (file, "\t.pushsection\t\".init\"\n"); + ASM_OUTPUT_CALL (file, decl); + fprintf (file, "\t.popsection\n"); + } + + if (lookup_attribute ("fini", DECL_ATTRIBUTES (decl))) + { + fprintf (file, "\t.pushsection\t\".fini\"\n"); + ASM_OUTPUT_CALL (file, decl); + fprintf (file, "\t.popsection\n"); + } +} + diff --git a/contrib/gcc/config/sol2.h b/contrib/gcc/config/sol2.h index 955cd0e7d1b..5ffaf575830 100644 --- a/contrib/gcc/config/sol2.h +++ b/contrib/gcc/config/sol2.h @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for any Solaris 2 system. - Copyright 2002, 2003 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* We use stabs-in-elf for debugging, because that is what the native toolchain uses. */ @@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */ #undef WINT_TYPE_SIZE #define WINT_TYPE_SIZE BITS_PER_WORD -#define HANDLE_PRAGMA_REDEFINE_EXTNAME 1 +#define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME 1 /* ??? Note: in order for -compat-bsd to work fully, we must somehow arrange to fixincludes /usr/ucbinclude @@ -47,8 +47,8 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC "\ -%{pthreads:-D_REENTRANT -D_PTHREADS} \ -%{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \ +%{pthreads|pthread:-D_REENTRANT -D_PTHREADS} \ +%{!pthreads:%{!pthread:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}}} \ %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \ " @@ -60,7 +60,6 @@ Boston, MA 02111-1307, USA. */ builtin_define_std ("sun"); \ builtin_define ("__svr4__"); \ builtin_define ("__SVR4"); \ - builtin_define ("__PRAGMA_REDEFINE_EXTNAME"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=svr4"); \ /* For C++ we need to add some additional macro \ @@ -94,8 +93,8 @@ Boston, MA 02111-1307, USA. */ "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ %{!shared:\ %{!symbolic:\ - %{pthreads:-lpthread} \ - %{!pthreads:%{threads:-lthread}} \ + %{pthreads|pthread:-lpthread} \ + %{!pthreads:%{!pthread:%{threads:-lthread}}} \ %{p|pg:-ldl} -lc}}" #undef ENDFILE_SPEC @@ -142,13 +141,19 @@ Boston, MA 02111-1307, USA. */ #undef LINK_SPEC #define LINK_SPEC \ "%{h*} %{v:-V} \ - %{b} %{Wl,*:%*} \ + %{b} \ %{static:-dn -Bstatic} \ %{shared:-G -dy %{!mimpure-text:-z text}} \ %{symbolic:-Bsymbolic -G -dy -z text} \ %(link_arch) \ %{Qy:} %{!Qn:-Qy}" +/* The Solaris linker doesn't understand constructor priorities. (The + GNU linker does support constructor priorities, so GNU ld + configuration files for Solaris override this setting.) */ +#undef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY 0 + /* This defines which switch letters take arguments. It is as in svr4.h but with -R added. */ #undef SWITCH_TAKES_ARG @@ -193,7 +198,7 @@ extern void __enable_execute_stack (void *); \ void \ __enable_execute_stack (void *addr) \ { \ - extern int mprotect (void *, size_t, int); \ + extern int mprotect(void *, size_t, int); \ if (!need_enable_exec_stack) \ return; \ else { \ @@ -206,3 +211,35 @@ __enable_execute_stack (void *addr) \ perror ("mprotect of trampoline code"); \ } \ } + +/* Support Solaris-specific format checking for cmn_err. */ +#define TARGET_N_FORMAT_TYPES 1 +#define TARGET_FORMAT_TYPES solaris_format_types + +/* #pragma init and #pragma fini are implemented on top of init and + fini attributes. */ +#define SOLARIS_ATTRIBUTE_TABLE \ + { "init", 0, 0, true, false, false, NULL }, \ + { "fini", 0, 0, true, false, false, NULL } + +/* This is how to declare the size of a function. For Solaris, we output + any .init or .fini entries here. */ +#undef ASM_DECLARE_FUNCTION_SIZE +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ + do \ + { \ + if (!flag_inhibit_size_directive) \ + ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ + solaris_output_init_fini (FILE, DECL); \ + } \ + while (0) + +/* Register the Solaris-specific #pragma directives. */ +#define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas () + +extern GTY(()) tree solaris_pending_aligns; +extern GTY(()) tree solaris_pending_inits; +extern GTY(()) tree solaris_pending_finis; + +/* Allow macro expansion in #pragma pack. */ +#define HANDLE_PRAGMA_PACK_WITH_EXPANSION diff --git a/contrib/gcc/config/sparc/biarch64.h b/contrib/gcc/config/sparc/biarch64.h index b825f4f3e5b..097831f0ee0 100644 --- a/contrib/gcc/config/sparc/biarch64.h +++ b/contrib/gcc/config/sparc/biarch64.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Specify this in a cover file to provide bi-architecture (32/64) support. */ diff --git a/contrib/gcc/config/sparc/crtfastmath.c b/contrib/gcc/config/sparc/crtfastmath.c index df3f907bb33..d46a16ad171 100644 --- a/contrib/gcc/config/sparc/crtfastmath.c +++ b/contrib/gcc/config/sparc/crtfastmath.c @@ -22,8 +22,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * the Free Software Foundation, 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/sparc/cypress.md b/contrib/gcc/config/sparc/cypress.md index c2345940fb7..67596b0b974 100644 --- a/contrib/gcc/config/sparc/cypress.md +++ b/contrib/gcc/config/sparc/cypress.md @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; The Cypress is a pretty simple single-issue processor. diff --git a/contrib/gcc/config/sparc/freebsd.h b/contrib/gcc/config/sparc/freebsd.h index c6f7398d952..9e432a39701 100644 --- a/contrib/gcc/config/sparc/freebsd.h +++ b/contrib/gcc/config/sparc/freebsd.h @@ -1,5 +1,5 @@ /* Definitions for Sun SPARC64 running FreeBSD using the ELF format - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by David E. O'Brien and BSDi. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -32,8 +32,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define LINK_SPEC "%(link_arch) \ %{!mno-relax:%{!r:-relax}} \ - %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ - %{Wl,*:%*} \ + %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ %{symbolic:-Bsymbolic} \ @@ -62,10 +61,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) -/* Constant which presents upper bound of the above value. */ -#undef MAX_LONG_DOUBLE_TYPE_SIZE -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - /* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */ #if defined(__arch64__) || defined(__LONG_DOUBLE_128__) @@ -76,11 +71,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Definitions for 64-bit SPARC running systems with ELF. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ - {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)"); @@ -131,14 +121,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* XXX2 */ -/* This is how to output a reference to an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABELREF -#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ - fprintf (FILE, ".L%s%d", PREFIX, NUM) - /* XXX2 */ /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where @@ -168,9 +150,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* #define DWARF_OFFSET_SIZE PTR_SIZE */ #undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" \ - FBSD_ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + FBSD_ENDFILE_SPEC /* We use GNU ld so undefine this so that attribute((init_priority)) works. */ #undef CTORS_SECTION_ASM_OP diff --git a/contrib/gcc/config/sparc/hypersparc.md b/contrib/gcc/config/sparc/hypersparc.md index d617efd9fc8..185be6f3ff2 100644 --- a/contrib/gcc/config/sparc/hypersparc.md +++ b/contrib/gcc/config/sparc/hypersparc.md @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; The HyperSPARC is a dual-issue processor. It is not all that fancy. diff --git a/contrib/gcc/config/sparc/libgcc-sparc-glibc.ver b/contrib/gcc/config/sparc/libgcc-sparc-glibc.ver index e3ba0bbdb65..ed280fe05a7 100644 --- a/contrib/gcc/config/sparc/libgcc-sparc-glibc.ver +++ b/contrib/gcc/config/sparc/libgcc-sparc-glibc.ver @@ -26,3 +26,36 @@ GLIBC_VER { __frame_state_for __register_frame_info_table } + +%if !defined (__arch64__) && defined (__LONG_DOUBLE_128__) + +# long double 128 bit support from 32-bit libgcc_s.so.1 is only available +# when configured with --with-long-double-128. Make sure all the +# symbols are available at @@GCC_LDBL_* versions to make it clear +# there is a configurable symbol set. + +%exclude { + __fixtfdi + __fixunstfdi + __floatditf + + __divtc3 + __multc3 + __powitf2 +} + +%inherit GCC_LDBL_3.0 GCC_3.0 +GCC_LDBL_3.0 { + __fixtfdi + __fixunstfdi + __floatditf +} + +%inherit GCC_LDBL_4.0.0 GCC_4.0.0 +GCC_LDBL_4.0.0 { + __divtc3 + __multc3 + __powitf2 +} + +%endif diff --git a/contrib/gcc/config/sparc/linux-unwind.h b/contrib/gcc/config/sparc/linux-unwind.h new file mode 100644 index 00000000000..958cb2d66ae --- /dev/null +++ b/contrib/gcc/config/sparc/linux-unwind.h @@ -0,0 +1,158 @@ +/* DWARF2 EH unwinding support for SPARC Linux. + Copyright 2004, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file with other programs, and to distribute +those programs without any restriction coming from the use of this +file. (The General Public License restrictions do apply in other +respects; for example, they cover modification of the file, and +distribution when not linked into another program.) + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + +/* Handle multilib correctly. */ +#if defined(__arch64__) + +/* 64-bit SPARC version */ +#define MD_FALLBACK_FRAME_STATE_FOR sparc64_fallback_frame_state + +static _Unwind_Reason_Code +sparc64_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned int *pc = context->ra; + long new_cfa, i; + long regs_off, fpu_save_off; + long this_cfa, fpu_save; + + if (pc[0] != 0x82102065 /* mov NR_rt_sigreturn, %g1 */ + || pc[1] != 0x91d0206d) /* ta 0x6d */ + return _URC_END_OF_STACK; + regs_off = 192 + 128; + fpu_save_off = regs_off + (16 * 8) + (3 * 8) + (2 * 4); + this_cfa = (long) context->cfa; + new_cfa = *(long *)((context->cfa) + (regs_off + (14 * 8))); + new_cfa += 2047; /* Stack bias */ + fpu_save = *(long *)((this_cfa) + (fpu_save_off)); + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 14; + fs->cfa_offset = new_cfa - (long) context->cfa; + for (i = 1; i < 16; ++i) + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = + this_cfa + (regs_off + (i * 8)) - new_cfa; + } + for (i = 0; i < 16; ++i) + { + fs->regs.reg[i + 16].how = REG_SAVED_OFFSET; + fs->regs.reg[i + 16].loc.offset = + this_cfa + (i * 8) - new_cfa; + } + if (fpu_save) + { + for (i = 0; i < 64; ++i) + { + if (i > 32 && (i & 0x1)) + continue; + fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; + fs->regs.reg[i + 32].loc.offset = + (fpu_save + (i * 4)) - new_cfa; + } + } + /* Stick return address into %g0, same trick Alpha uses. */ + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = + this_cfa + (regs_off + (16 * 8) + 8) - new_cfa; + fs->retaddr_column = 0; + return _URC_NO_REASON; +} + +#else + +/* 32-bit SPARC version */ +#define MD_FALLBACK_FRAME_STATE_FOR sparc_fallback_frame_state + +static _Unwind_Reason_Code +sparc_fallback_frame_state (struct _Unwind_Context *context, + _Unwind_FrameState *fs) +{ + unsigned int *pc = context->ra; + int new_cfa, i, oldstyle; + int regs_off, fpu_save_off; + int fpu_save, this_cfa; + + if (pc[1] != 0x91d02010) /* ta 0x10 */ + return _URC_END_OF_STACK; + if (pc[0] == 0x821020d8) /* mov NR_sigreturn, %g1 */ + oldstyle = 1; + else if (pc[0] == 0x82102065) /* mov NR_rt_sigreturn, %g1 */ + oldstyle = 0; + else + return _URC_END_OF_STACK; + if (oldstyle) + { + regs_off = 96; + fpu_save_off = regs_off + (4 * 4) + (16 * 4); + } + else + { + regs_off = 96 + 128; + fpu_save_off = regs_off + (4 * 4) + (16 * 4) + (2 * 4); + } + this_cfa = (int) context->cfa; + new_cfa = *(int *)((context->cfa) + (regs_off+(4*4)+(14 * 4))); + fpu_save = *(int *)((this_cfa) + (fpu_save_off)); + fs->cfa_how = CFA_REG_OFFSET; + fs->cfa_reg = 14; + fs->cfa_offset = new_cfa - (int) context->cfa; + for (i = 1; i < 16; ++i) + { + if (i == 14) + continue; + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset = + this_cfa + (regs_off+(4 * 4)+(i * 4)) - new_cfa; + } + for (i = 0; i < 16; ++i) + { + fs->regs.reg[i + 16].how = REG_SAVED_OFFSET; + fs->regs.reg[i + 16].loc.offset = + this_cfa + (i * 4) - new_cfa; + } + if (fpu_save) + { + for (i = 0; i < 32; ++i) + { + fs->regs.reg[i + 32].how = REG_SAVED_OFFSET; + fs->regs.reg[i + 32].loc.offset = + (fpu_save + (i * 4)) - new_cfa; + } + } + /* Stick return address into %g0, same trick Alpha uses. */ + fs->regs.reg[0].how = REG_SAVED_OFFSET; + fs->regs.reg[0].loc.offset = this_cfa+(regs_off+4)-new_cfa; + fs->retaddr_column = 0; + return _URC_NO_REASON; +} + +#endif diff --git a/contrib/gcc/config/sparc/linux.h b/contrib/gcc/config/sparc/linux.h index 7ddf2a35fdc..5af67a6a34d 100644 --- a/contrib/gcc/config/sparc/linux.h +++ b/contrib/gcc/config/sparc/linux.h @@ -1,5 +1,5 @@ /* Definitions for SPARC running Linux-based GNU systems with ELF. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Eddie C. Dost (ecd@skynet.be) @@ -17,18 +17,20 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=linux"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=posix"); \ + builtin_define_std ("unix"); \ + builtin_define_std ("linux"); \ + builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + if (TARGET_LONG_DOUBLE_128) \ + builtin_define ("__LONG_DOUBLE_128__"); \ } \ while (0) @@ -44,12 +46,7 @@ Boston, MA 02111-1307, USA. */ object constructed before entering `main'. */ #undef STARTFILE_SPEC -#ifdef USE_GNULIBC_1 -#define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" -#elif defined HAVE_LD_PIE +#if defined HAVE_LD_PIE #define STARTFILE_SPEC \ "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" @@ -86,11 +83,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with ELF)"); -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ -{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -104,37 +96,14 @@ Boston, MA 02111-1307, USA. */ #define WCHAR_TYPE_SIZE 32 #undef CPP_SUBTARGET_SPEC -#ifdef USE_GNULIBC_1 #define CPP_SUBTARGET_SPEC \ -"%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \ -%{mlong-double-128:-D__LONG_DOUBLE_128__}" -#else -#define CPP_SUBTARGET_SPEC \ -"%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \ -%{pthread:-D_REENTRANT} %{mlong-double-128:-D__LONG_DOUBLE_128__}" -#endif +"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" #undef LIB_SPEC -/* We no longer link with libc_p.a or libg.a by default. If you - want to profile or debug the GNU/Linux C library, please add - -lc_p or -ggdb to LDFLAGS at the link time, respectively. */ -#if 1 -#ifdef USE_GNULIBC_1 -#define LIB_SPEC \ - "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \ - %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}" -#else #define LIB_SPEC \ "%{pthread:-lpthread} \ %{shared:-lc} \ %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" -#endif -#else -#define LIB_SPEC \ - "%{!shared: \ - %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \ - %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}" -#endif /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support for the special GCC options -static and -shared, which allow us to @@ -152,25 +121,26 @@ Boston, MA 02111-1307, USA. */ /* If ELF is the default format, we should not use /lib/elf. */ -#undef LINK_SPEC -#ifdef USE_GNULIBC_1 -#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ - %{!shared: \ - %{!ibcs: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \ - %{static:-static}}}" +#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#if UCLIBC_DEFAULT +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" #else +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#endif +#define LINUX_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + + +#undef LINK_SPEC #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ %{!mno-relax:%{!r:-relax}} \ %{!shared: \ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \ %{static:-static}}}" -#endif /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). It's safe to pass -s always, even if -g is not used. */ @@ -198,13 +168,6 @@ do { \ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* This is how to output a reference to an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABELREF -#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ - fprintf (FILE, ".L%s%d", PREFIX, NUM) - /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. @@ -219,9 +182,6 @@ do { \ SPARC ABI says that long double is 4 words. */ #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) -/* Constant which presents upper bound of the above value. */ -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - /* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */ #ifdef __LONG_DOUBLE_128__ @@ -233,7 +193,7 @@ do { \ #undef DITF_CONVERSION_LIBFUNCS #define DITF_CONVERSION_LIBFUNCS 1 -#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR) +#if defined(HAVE_LD_EH_FRAME_HDR) #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif @@ -251,78 +211,36 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack - -/* Determine whether the the entire c99 runtime is present in the +/* Determine whether the entire c99 runtime is present in the runtime library. */ -#define TARGET_C99_FUNCTIONS 1 +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 +#endif -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned int *pc_ = (CONTEXT)->ra; \ - int new_cfa_, i_, oldstyle_; \ - int regs_off_, fpu_save_off_; \ - int fpu_save_, this_cfa_; \ - \ - if (pc_[1] != 0x91d02010) /* ta 0x10 */ \ - break; \ - if (pc_[0] == 0x821020d8) /* mov NR_sigreturn, %g1 */ \ - oldstyle_ = 1; \ - else if (pc_[0] == 0x82102065) /* mov NR_rt_sigreturn, %g1 */ \ - oldstyle_ = 0; \ - else \ - break; \ - if (oldstyle_) \ - { \ - regs_off_ = 96; \ - fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4); \ - } \ - else \ - { \ - regs_off_ = 96 + 128; \ - fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4) + (2 * 4); \ - } \ - this_cfa_ = (int) (CONTEXT)->cfa; \ - new_cfa_ = *(int *)(((CONTEXT)->cfa) + (regs_off_+(4*4)+(14 * 4))); \ - fpu_save_ = *(int *)((this_cfa_) + (fpu_save_off_)); \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 14; \ - (FS)->cfa_offset = new_cfa_ - (int) (CONTEXT)->cfa; \ - for (i_ = 1; i_ < 16; ++i_) \ - { \ - if (i_ == 14) \ - continue; \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset = \ - this_cfa_ + (regs_off_+(4 * 4)+(i_ * 4)) - new_cfa_; \ - } \ - for (i_ = 0; i_ < 16; ++i_) \ - { \ - (FS)->regs.reg[i_ + 16].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 16].loc.offset = \ - this_cfa_ + (i_ * 4) - new_cfa_; \ - } \ - if (fpu_save_) \ - { \ - for (i_ = 0; i_ < 32; ++i_) \ - { \ - (FS)->regs.reg[i_ + 32].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 32].loc.offset = \ - (fpu_save_ + (i_ * 4)) - new_cfa_; \ - } \ - } \ - /* Stick return address into %g0, same trick Alpha uses. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = this_cfa_+(regs_off_+4)-new_cfa_; \ - (FS)->retaddr_column = 0; \ - goto SUCCESS; \ - } while (0) +#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h" + +/* Linux currently uses RMO in uniprocessor mode, which is equivalent to + TMO, and TMO in multiprocessor mode. But they reserve the right to + change their minds. */ +#undef SPARC_RELAXED_ORDERING +#define SPARC_RELAXED_ORDERING true + +#undef NEED_INDICATE_EXEC_STACK +#define NEED_INDICATE_EXEC_STACK 1 + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* sparc glibc provides __stack_chk_guard in [%g7 + 0x14]. */ +#define TARGET_THREAD_SSP_OFFSET 0x14 +#endif + +/* Define if long doubles should be mangled as 'g'. */ +#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING diff --git a/contrib/gcc/config/sparc/linux64.h b/contrib/gcc/config/sparc/linux64.h index bb1c591fc38..b0ddf4b3d3b 100644 --- a/contrib/gcc/config/sparc/linux64.h +++ b/contrib/gcc/config/sparc/linux64.h @@ -1,5 +1,5 @@ /* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF. - Copyright 1996, 1997, 1998, 2000, 2002, 2003, 2004 + Copyright 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by David S. Miller (davem@caip.rutgers.edu) @@ -17,20 +17,22 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("unix"); \ - builtin_define_std ("linux"); \ - builtin_define ("_LONGLONG"); \ - builtin_define ("__gnu_linux__"); \ - builtin_assert ("system=linux"); \ - builtin_assert ("system=unix"); \ - builtin_assert ("system=posix"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + builtin_define_std ("linux"); \ + builtin_define ("_LONGLONG"); \ + builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + if (TARGET_ARCH32 && TARGET_LONG_DOUBLE_128) \ + builtin_define ("__LONG_DOUBLE_128__"); \ + } \ while (0) /* Don't assume anything about the header files. */ @@ -41,7 +43,8 @@ Boston, MA 02111-1307, USA. */ #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 + || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \ + || TARGET_CPU_DEFAULT == TARGET_CPU_niagara /* A 64 bit v9 compiler with stack-bias, in a Medium/Low code model environment. */ @@ -54,13 +57,6 @@ Boston, MA 02111-1307, USA. */ #undef ASM_CPU_DEFAULT_SPEC #define ASM_CPU_DEFAULT_SPEC "-Av9a" -#ifdef SPARC_BI_ARCH - -#undef CPP_ARCH32_SPEC -#define CPP_ARCH32_SPEC "%{mlong-double-128:-D__LONG_DOUBLE_128__}" - -#endif - /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add the GNU/Linux magical crtbegin.o file (see crtstuff.c) which provides part of the support for getting C++ file-scope static @@ -101,11 +97,6 @@ Boston, MA 02111-1307, USA. */ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_MEDLOW -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ -{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -117,10 +108,6 @@ Boston, MA 02111-1307, USA. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) -/* Constant which presents upper bound of the above value. */ -#undef MAX_LONG_DOUBLE_TYPE_SIZE -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - /* Define this to set long double type size to use in libgcc2.c, which can not depend on target_flags. */ #if defined(__arch64__) || defined(__LONG_DOUBLE_128__) @@ -131,7 +118,6 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC "\ -%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ %{posix:-D_POSIX_SOURCE} \ %{pthread:-D_REENTRANT} \ " @@ -158,6 +144,20 @@ Boston, MA 02111-1307, USA. */ /* If ELF is the default format, we should not use /lib/elf. */ +#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" +#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#if UCLIBC_DEFAULT +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}" +#else +#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}" +#endif +#define LINUX_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) +#define LINUX_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + #ifdef SPARC_BI_ARCH #undef SUBTARGET_EXTRA_SPECS @@ -166,13 +166,13 @@ Boston, MA 02111-1307, USA. */ { "link_arch64", LINK_ARCH64_SPEC }, \ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ { "link_arch", LINK_ARCH_SPEC }, - + #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ %{!shared: \ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}} \ %{static:-static}}} \ " @@ -181,7 +181,7 @@ Boston, MA 02111-1307, USA. */ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}} \ %{static:-static}}} \ " @@ -262,7 +262,7 @@ Boston, MA 02111-1307, USA. */ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}} \ %{static:-static}}} \ %{mlittle-endian:-EL} \ %{!mno-relax:%{!r:-relax}} \ @@ -289,9 +289,6 @@ Boston, MA 02111-1307, USA. */ #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(REGNO) (REGNO) -#define DWARF2_DEBUGGING_INFO 1 -#define DBX_DEBUGGING_INFO 1 - #undef ASM_OUTPUT_ALIGNED_LOCAL #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ do { \ @@ -307,13 +304,6 @@ do { \ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* This is how to output a reference to an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABELREF -#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ - fprintf (FILE, ".L%s%d", PREFIX, NUM) - /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. @@ -353,133 +343,37 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack - -/* Determine whether the the entire c99 runtime is present in the +/* Determine whether the entire c99 runtime is present in the runtime library. */ -#define TARGET_C99_FUNCTIONS 1 +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" -/* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -/* Handle multilib correctly. */ -#if defined(__arch64__) -/* 64-bit SPARC version */ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned int *pc_ = (CONTEXT)->ra; \ - long new_cfa_, i_; \ - long regs_off_, fpu_save_off_; \ - long this_cfa_, fpu_save_; \ - \ - if (pc_[0] != 0x82102065 /* mov NR_rt_sigreturn, %g1 */ \ - || pc_[1] != 0x91d0206d) /* ta 0x6d */ \ - break; \ - regs_off_ = 192 + 128; \ - fpu_save_off_ = regs_off_ + (16 * 8) + (3 * 8) + (2 * 4); \ - this_cfa_ = (long) (CONTEXT)->cfa; \ - new_cfa_ = *(long *)(((CONTEXT)->cfa) + (regs_off_ + (14 * 8))); \ - new_cfa_ += 2047; /* Stack bias */ \ - fpu_save_ = *(long *)((this_cfa_) + (fpu_save_off_)); \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 14; \ - (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ - for (i_ = 1; i_ < 16; ++i_) \ - { \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset = \ - this_cfa_ + (regs_off_ + (i_ * 8)) - new_cfa_; \ - } \ - for (i_ = 0; i_ < 16; ++i_) \ - { \ - (FS)->regs.reg[i_ + 16].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 16].loc.offset = \ - this_cfa_ + (i_ * 8) - new_cfa_; \ - } \ - if (fpu_save_) \ - { \ - for (i_ = 0; i_ < 64; ++i_) \ - { \ - if (i_ > 32 && (i_ & 0x1)) \ - continue; \ - (FS)->regs.reg[i_ + 32].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 32].loc.offset = \ - (fpu_save_ + (i_ * 4)) - new_cfa_; \ - } \ - } \ - /* Stick return address into %g0, same trick Alpha uses. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = \ - this_cfa_ + (regs_off_ + (16 * 8) + 8) - new_cfa_; \ - (FS)->retaddr_column = 0; \ - goto SUCCESS; \ - } while (0) -#else -/* 32-bit SPARC version */ -#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ - do { \ - unsigned int *pc_ = (CONTEXT)->ra; \ - int new_cfa_, i_, oldstyle_; \ - int regs_off_, fpu_save_off_; \ - int fpu_save_, this_cfa_; \ - \ - if (pc_[1] != 0x91d02010) /* ta 0x10 */ \ - break; \ - if (pc_[0] == 0x821020d8) /* mov NR_sigreturn, %g1 */ \ - oldstyle_ = 1; \ - else if (pc_[0] == 0x82102065) /* mov NR_rt_sigreturn, %g1 */ \ - oldstyle_ = 0; \ - else \ - break; \ - if (oldstyle_) \ - { \ - regs_off_ = 96; \ - fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4); \ - } \ - else \ - { \ - regs_off_ = 96 + 128; \ - fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4) + (2 * 4); \ - } \ - this_cfa_ = (int) (CONTEXT)->cfa; \ - new_cfa_ = *(int *)(((CONTEXT)->cfa) + (regs_off_+(4*4)+(14 * 4))); \ - fpu_save_ = *(int *)((this_cfa_) + (fpu_save_off_)); \ - (FS)->cfa_how = CFA_REG_OFFSET; \ - (FS)->cfa_reg = 14; \ - (FS)->cfa_offset = new_cfa_ - (int) (CONTEXT)->cfa; \ - for (i_ = 1; i_ < 16; ++i_) \ - { \ - if (i_ == 14) \ - continue; \ - (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_].loc.offset = \ - this_cfa_ + (regs_off_+(4 * 4)+(i_ * 4)) - new_cfa_; \ - } \ - for (i_ = 0; i_ < 16; ++i_) \ - { \ - (FS)->regs.reg[i_ + 16].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 16].loc.offset = \ - this_cfa_ + (i_ * 4) - new_cfa_; \ - } \ - if (fpu_save_) \ - { \ - for (i_ = 0; i_ < 32; ++i_) \ - { \ - (FS)->regs.reg[i_ + 32].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[i_ + 32].loc.offset = \ - (fpu_save_ + (i_ * 4)) - new_cfa_; \ - } \ - } \ - /* Stick return address into %g0, same trick Alpha uses. */ \ - (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ - (FS)->regs.reg[0].loc.offset = this_cfa_+(regs_off_+4)-new_cfa_; \ - (FS)->retaddr_column = 0; \ - goto SUCCESS; \ - } while (0) +/* Use --as-needed -lgcc_s for eh support. */ +#ifdef HAVE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED 1 #endif + +#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h" + +/* Linux currently uses RMO in uniprocessor mode, which is equivalent to + TMO, and TMO in multiprocessor mode. But they reserve the right to + change their minds. */ +#undef SPARC_RELAXED_ORDERING +#define SPARC_RELAXED_ORDERING true + +#undef NEED_INDICATE_EXEC_STACK +#define NEED_INDICATE_EXEC_STACK 1 + +#ifdef TARGET_LIBC_PROVIDES_SSP +/* sparc glibc provides __stack_chk_guard in [%g7 + 0x14], + sparc64 glibc provides it at [%g7 + 0x28]. */ +#define TARGET_THREAD_SSP_OFFSET (TARGET_ARCH64 ? 0x28 : 0x14) +#endif + +/* Define if long doubles should be mangled as 'g'. */ +#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING diff --git a/contrib/gcc/config/sparc/little-endian.opt b/contrib/gcc/config/sparc/little-endian.opt new file mode 100644 index 00000000000..eb039fd79a6 --- /dev/null +++ b/contrib/gcc/config/sparc/little-endian.opt @@ -0,0 +1,28 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mlittle-endian +Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists +Generate code for little-endian + +mbig-endian +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Generate code for big-endian diff --git a/contrib/gcc/config/sparc/long-double-switch.opt b/contrib/gcc/config/sparc/long-double-switch.opt new file mode 100644 index 00000000000..ffbecbe77f2 --- /dev/null +++ b/contrib/gcc/config/sparc/long-double-switch.opt @@ -0,0 +1,28 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mlong-double-128 +Target Report RejectNegative Mask(LONG_DOUBLE_128) MaskExists +Use 128-bit long double + +mlong-double-64 +Target Report RejectNegative InverseMask(LONG_DOUBLE_128) +Use 64-bit long double diff --git a/contrib/gcc/config/sparc/netbsd-elf.h b/contrib/gcc/config/sparc/netbsd-elf.h index bc92eb2a337..b07fee3bc81 100644 --- a/contrib/gcc/config/sparc/netbsd-elf.h +++ b/contrib/gcc/config/sparc/netbsd-elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for ELF on NetBSD/sparc and NetBSD/sparc64. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Matthew Green (mrg@eterna.com.au). This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ @@ -51,28 +51,14 @@ Boston, MA 02111-1307, USA. */ #undef PTRDIFF_TYPE #define PTRDIFF_TYPE "long int" -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG - /* This is the char to use for continuation (in case we need to turn continuation back on). */ #undef DBX_CONTIN_CHAR #define DBX_CONTIN_CHAR '?' -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(REGNO) \ - (TARGET_FLAT && REGNO == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO) - #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* This is how to output a reference to an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABELREF -#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ - fprintf (FILE, ".L%s%d", PREFIX, NUM) - /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. @@ -209,13 +195,6 @@ Boston, MA 02111-1307, USA. */ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, -/* What extra switches do we need? */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ - {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - - /* Build a compiler that supports -m32 and -m64? */ #ifdef SPARC_BI_ARCH @@ -223,9 +202,6 @@ Boston, MA 02111-1307, USA. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) -#undef MAX_LONG_DOUBLE_TYPE_SIZE -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - #if defined(__arch64__) || defined(__LONG_DOUBLE_128__) #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 #else @@ -245,7 +221,7 @@ Boston, MA 02111-1307, USA. */ #define MULTILIB_DEFAULTS { "m64" } #endif -/* Name the port. */ +/* Name the port. */ #undef TARGET_NAME #define TARGET_NAME (DEFAULT_ARCH32_P ? TARGET_NAME32 : TARGET_NAME64) @@ -257,9 +233,6 @@ Boston, MA 02111-1307, USA. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE 128 -#undef MAX_LONG_DOUBLE_TYPE_SIZE -#define MAX_LONG_DOUBLE_TYPE_SIZE 128 - #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 @@ -278,9 +251,6 @@ Boston, MA 02111-1307, USA. */ #undef LONG_DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE 64 -#undef MAX_LONG_DOUBLE_TYPE_SIZE -#define MAX_LONG_DOUBLE_TYPE_SIZE 64 - #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 diff --git a/contrib/gcc/config/sparc/niagara.md b/contrib/gcc/config/sparc/niagara.md new file mode 100644 index 00000000000..ea431b521d6 --- /dev/null +++ b/contrib/gcc/config/sparc/niagara.md @@ -0,0 +1,119 @@ +;; Scheduling description for Niagara. +;; Copyright (C) 2006 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Niagara is a single-issue processor. + +(define_automaton "niagara_0") + +(define_cpu_unit "niag_pipe" "niagara_0") + +(define_insn_reservation "niag_5cycle" 5 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "multi,flushw,iflush,trap")) + "niag_pipe*5") + +(define_insn_reservation "niag_4cycle" 4 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "savew")) + "niag_pipe*4") + +/* Most basic operations are single-cycle. */ +(define_insn_reservation "niag_ialu" 1 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "ialu,shift,compare,cmove")) + "niag_pipe") + +(define_insn_reservation "niag_imul" 11 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "imul")) + "niag_pipe*11") + +(define_insn_reservation "niag_idiv" 72 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "idiv")) + "niag_pipe*72") + +(define_insn_reservation "niag_branch" 3 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "call,sibcall,call_no_delay_slot,uncond_branch,branch")) + "niag_pipe*3") + +(define_insn_reservation "niag_3cycle_load" 3 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "load")) + "niag_pipe*3") + +(define_insn_reservation "niag_9cycle_load" 9 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpload")) + "niag_pipe*9") + +(define_insn_reservation "niag_1cycle_store" 1 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "store")) + "niag_pipe") + +(define_insn_reservation "niag_8cycle_store" 8 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpstore")) + "niag_pipe*8") + +/* Things incorrectly modelled here: + * FPADD{s,d}: 26 cycles + * FPSUB{s,d}: 26 cycles + * FABSD: 26 cycles + * F{s,d}TO{s,d}: 26 cycles + * F{s,d}TO{i,x}: 26 cycles + * FSMULD: 29 cycles + */ +(define_insn_reservation "niag_fmov" 8 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpmove,fpcmove,fpcrmove")) + "niag_pipe*8") + +(define_insn_reservation "niag_fpcmp" 26 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpcmp")) + "niag_pipe*26") + +(define_insn_reservation "niag_fmult" 29 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpmul")) + "niag_pipe*29") + +(define_insn_reservation "niag_fdivs" 54 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpdivs")) + "niag_pipe*54") + +(define_insn_reservation "niag_fdivd" 83 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fpdivd")) + "niag_pipe*83") + +/* Things incorrectly modelled here: + * FPADD{16,32}: 10 cycles + * FPSUB{16,32}: 10 cycles + * FALIGNDATA: 10 cycles + */ +(define_insn_reservation "niag_vis" 8 + (and (eq_attr "cpu" "niagara") + (eq_attr "type" "fga,fgm_pack,fgm_mul,fgm_cmp,fgm_pdist")) + "niag_pipe*8") diff --git a/contrib/gcc/config/sparc/openbsd1-64.h b/contrib/gcc/config/sparc/openbsd1-64.h index 1310538d728..4af8c44a9f2 100644 --- a/contrib/gcc/config/sparc/openbsd1-64.h +++ b/contrib/gcc/config/sparc/openbsd1-64.h @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #define OBSD_HAS_DECLARE_FUNCTION_NAME #define OBSD_HAS_DECLARE_FUNCTION_SIZE diff --git a/contrib/gcc/config/sparc/openbsd64.h b/contrib/gcc/config/sparc/openbsd64.h index e13c8862554..49f8d2820bc 100644 --- a/contrib/gcc/config/sparc/openbsd64.h +++ b/contrib/gcc/config/sparc/openbsd64.h @@ -1,5 +1,5 @@ /* Configuration file for sparc64 OpenBSD target. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc64 OpenBSD ELF)") @@ -51,6 +51,9 @@ Boston, MA 02111-1307, USA. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX +/* Inherited from sp64-elf. */ +#undef NO_IMPLICIT_EXTERN_C + #undef ASM_SPEC #define ASM_SPEC "\ %{v:-V} -s %{fpic|fPIC|fpie|fPIE:-K PIC} \ diff --git a/contrib/gcc/config/sparc/predicates.md b/contrib/gcc/config/sparc/predicates.md new file mode 100644 index 00000000000..048d651c2e5 --- /dev/null +++ b/contrib/gcc/config/sparc/predicates.md @@ -0,0 +1,478 @@ +;; Predicate definitions for SPARC. +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; Predicates for numerical constants. + +;; Return true if OP is the zero constant for MODE. +(define_predicate "const_zero_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (mode)"))) + +;; Return true if OP is the one constant for MODE. +(define_predicate "const_one_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST1_RTX (mode)"))) + +;; Return true if OP is the integer constant 4096. +(define_predicate "const_4096_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 4096"))) + +;; Return true if OP is a constant that is representable by a 13-bit +;; signed field. This is an acceptable immediate operand for most +;; 3-address instructions. +(define_predicate "small_int_operand" + (and (match_code "const_int") + (match_test "SPARC_SIMM13_P (INTVAL (op))"))) + +;; Return true if OP is a constant operand for the umul instruction. That +;; instruction sign-extends immediate values just like all other SPARC +;; instructions, but interprets the extended result as an unsigned number. +(define_predicate "uns_small_int_operand" + (match_code "const_int,const_double") +{ +#if HOST_BITS_PER_WIDE_INT == 32 + return ((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000) + || (GET_CODE (op) == CONST_DOUBLE + && CONST_DOUBLE_HIGH (op) == 0 + && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000)); +#else + return (GET_CODE (op) == CONST_INT + && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000) + || (INTVAL (op) >= 0xFFFFF000 + && INTVAL (op) <= 0xFFFFFFFF))); +#endif +}) + +;; Return true if OP is a constant that can be loaded by the sethi instruction. +;; The first test avoids emitting sethi to load zero for example. +(define_predicate "const_high_operand" + (and (match_code "const_int") + (and (not (match_operand 0 "small_int_operand")) + (match_test "SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode))")))) + +;; Return true if OP is a constant whose 1's complement can be loaded by the +;; sethi instruction. +(define_predicate "const_compl_high_operand" + (and (match_code "const_int") + (and (not (match_operand 0 "small_int_operand")) + (match_test "SPARC_SETHI_P (~INTVAL (op) & GET_MODE_MASK (mode))")))) + +;; Return true if OP is a FP constant that needs to be loaded by the sethi/losum +;; pair of instructions. +(define_predicate "fp_const_high_losum_operand" + (match_operand 0 "const_double_operand") +{ + gcc_assert (mode == SFmode); + return fp_high_losum_p (op); +}) + + +;; Predicates for symbolic constants. + +;; Return true if OP is either a symbol reference or a sum of a symbol +;; reference and a constant. +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + enum machine_mode omode = GET_MODE (op); + + if (omode != mode && omode != VOIDmode && mode != VOIDmode) + return false; + + switch (GET_CODE (op)) + { + case SYMBOL_REF: + return !SYMBOL_REF_TLS_MODEL (op); + + case LABEL_REF: + return true; + + case CONST: + op = XEXP (op, 0); + return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF + && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) + || GET_CODE (XEXP (op, 0)) == LABEL_REF) + && GET_CODE (XEXP (op, 1)) == CONST_INT); + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a symbolic operand for the TLS Global Dynamic model. +(define_predicate "tgd_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_GLOBAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand for the TLS Local Dynamic model. +(define_predicate "tld_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand for the TLS Initial Exec model. +(define_predicate "tie_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_INITIAL_EXEC"))) + +;; Return true if OP is a symbolic operand for the TLS Local Exec model. +(define_predicate "tle_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC"))) + +;; Return true if the operand is an argument used in generating PIC references +;; in either the medium/low or embedded medium/anywhere code models on V9. +;; Check for (const (minus (symbol_ref:GOT) +;; (const (minus (label) (pc))))) +(define_predicate "medium_pic_operand" + (match_code "const") +{ + /* Check for (const (minus (symbol_ref:GOT) + (const (minus (label) (pc))))). */ + op = XEXP (op, 0); + return GET_CODE (op) == MINUS + && GET_CODE (XEXP (op, 0)) == SYMBOL_REF + && GET_CODE (XEXP (op, 1)) == CONST + && GET_CODE (XEXP (XEXP (op, 1), 0)) == MINUS; +}) + +;; Return true if OP is a LABEL_REF of mode MODE. +(define_predicate "label_ref_operand" + (and (match_code "label_ref") + (match_test "GET_MODE (op) == mode"))) + +;; Return true if OP is a data segment reference. This includes the readonly +;; data segment or, in other words, anything but the text segment. +;; This is needed in the embedded medium/anywhere code model on V9. These +;; values are accessed with EMBMEDANY_BASE_REG. */ +(define_predicate "data_segment_operand" + (match_code "symbol_ref,plus,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF : + return ! SYMBOL_REF_FUNCTION_P (op); + case PLUS : + /* Assume canonical format of symbol + constant. + Fall through. */ + case CONST : + return data_segment_operand (XEXP (op, 0), VOIDmode); + default : + gcc_unreachable (); + } +}) + +;; Return true if OP is a text segment reference. +;; This is needed in the embedded medium/anywhere code model on V9. +(define_predicate "text_segment_operand" + (match_code "label_ref,symbol_ref,plus,const") +{ + switch (GET_CODE (op)) + { + case LABEL_REF : + return true; + case SYMBOL_REF : + return SYMBOL_REF_FUNCTION_P (op); + case PLUS : + /* Assume canonical format of symbol + constant. + Fall through. */ + case CONST : + return text_segment_operand (XEXP (op, 0), VOIDmode); + default : + gcc_unreachable (); + } +}) + + +;; Predicates for registers. + +;; Return true if OP is either the zero constant or a register. +(define_predicate "register_or_zero_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "const_zero_operand"))) + +;; Return true if OP is a register operand in a floating point register. +(define_predicate "fp_register_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); /* Possibly a MEM */ + return REG_P (op) && SPARC_FP_REG_P (REGNO (op)); +}) + +;; Return true if OP is an integer register. +(define_special_predicate "int_register_operand" + (ior (match_test "register_operand (op, SImode)") + (match_test "TARGET_ARCH64 && register_operand (op, DImode)"))) + +;; Return true if OP is a floating point condition code register. +(define_predicate "fcc_register_operand" + (match_code "reg") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) + return false; + +#if 0 /* ??? 1 when %fcc0-3 are pseudos first. See gen_compare_reg(). */ + if (reg_renumber == 0) + return REGNO (op) >= FIRST_PSEUDO_REGISTER; + return REGNO_OK_FOR_CCFP_P (REGNO (op)); +#else + return ((unsigned) REGNO (op) - SPARC_FIRST_V9_FCC_REG) < 4; +#endif +}) + +;; Return true if OP is the floating point condition code register fcc0. +(define_predicate "fcc0_register_operand" + (match_code "reg") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) + return false; + + return REGNO (op) == SPARC_FCC_REG; +}) + +;; Return true if OP is an integer or floating point condition code register. +(define_predicate "icc_or_fcc_register_operand" + (match_code "reg") +{ + if (REGNO (op) == SPARC_ICC_REG) + { + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && GET_MODE (op) != CCmode && GET_MODE (op) != CCXmode) + return false; + + return true; + } + + return fcc_register_operand (op, mode); +}) + + +;; Predicates for arithmetic instructions. + +;; Return true if OP is a register, or is a constant that is representable +;; by a 13-bit signed field. This is an acceptable operand for most +;; 3-address instructions. +(define_predicate "arith_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "small_int_operand"))) + +;; 64-bit: Same as above. +;; 32-bit: Return true if OP is a register, or is a constant that is +;; representable by a couple of 13-bit signed fields. This is an +;; acceptable operand for most 3-address splitters. +(define_predicate "arith_double_operand" + (match_code "const_int,const_double,reg,subreg") +{ + bool arith_simple_operand = arith_operand (op, mode); + HOST_WIDE_INT m1, m2; + + if (TARGET_ARCH64 || arith_simple_operand) + return arith_simple_operand; + +#if HOST_BITS_PER_WIDE_INT == 32 + if (GET_CODE (op) != CONST_DOUBLE) + return false; + m1 = CONST_DOUBLE_LOW (op); + m2 = CONST_DOUBLE_HIGH (op); +#else + if (GET_CODE (op) != CONST_INT) + return false; + m1 = trunc_int_for_mode (INTVAL (op), SImode); + m2 = trunc_int_for_mode (INTVAL (op) >> 32, SImode); +#endif + + return SPARC_SIMM13_P (m1) && SPARC_SIMM13_P (m2); +}) + +;; Return true if OP is suitable as second operand for add/sub. +(define_predicate "arith_add_operand" + (ior (match_operand 0 "arith_operand") + (match_operand 0 "const_4096_operand"))) + +;; Return true if OP is suitable as second double operand for add/sub. +(define_predicate "arith_double_add_operand" + (match_code "const_int,const_double,reg,subreg") +{ + bool _arith_double_operand = arith_double_operand (op, mode); + + if (_arith_double_operand) + return true; + + return TARGET_ARCH64 && const_4096_operand (op, mode); +}) + +;; Return true if OP is a register, or is a CONST_INT that can fit in a +;; signed 10-bit immediate field. This is an acceptable SImode operand for +;; the movrcc instructions. +(define_predicate "arith10_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "SPARC_SIMM10_P (INTVAL (op))")))) + +;; Return true if OP is a register, or is a CONST_INT that can fit in a +;; signed 11-bit immediate field. This is an acceptable SImode operand for +;; the movcc instructions. +(define_predicate "arith11_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "SPARC_SIMM11_P (INTVAL (op))")))) + +;; Return true if OP is a register or a constant for the umul instruction. +(define_predicate "uns_arith_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "uns_small_int_operand"))) + + +;; Predicates for miscellaneous instructions. + +;; Return true if OP is valid for the lhs of a comparison insn. +(define_predicate "compare_operand" + (match_code "reg,subreg,zero_extract") +{ + if (GET_CODE (op) == ZERO_EXTRACT) + return (register_operand (XEXP (op, 0), mode) + && small_int_operand (XEXP (op, 1), mode) + && small_int_operand (XEXP (op, 2), mode) + /* This matches cmp_zero_extract. */ + && ((mode == SImode + && INTVAL (XEXP (op, 2)) > 19) + /* This matches cmp_zero_extract_sp64. */ + || (TARGET_ARCH64 + && mode == DImode + && INTVAL (XEXP (op, 2)) > 51))); + else + return register_operand (op, mode); +}) + +;; Return true if OP is a valid operand for the source of a move insn. +(define_predicate "input_operand" + (match_code "const_int,const_double,const_vector,reg,subreg,mem") +{ + enum mode_class mclass; + + /* If both modes are non-void they must be the same. */ + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) + return false; + + mclass = GET_MODE_CLASS (mode); + + /* Allow any 1-instruction integer constant. */ + if (mclass == MODE_INT + && (small_int_operand (op, mode) || const_high_operand (op, mode))) + return true; + + /* If 32-bit mode and this is a DImode constant, allow it + so that the splits can be generated. */ + if (TARGET_ARCH32 + && mode == DImode + && (GET_CODE (op) == CONST_DOUBLE || GET_CODE (op) == CONST_INT)) + return true; + + if ((mclass == MODE_FLOAT && GET_CODE (op) == CONST_DOUBLE) + || (mclass == MODE_VECTOR_INT && GET_CODE (op) == CONST_VECTOR)) + return true; + + if (register_operand (op, mode)) + return true; + + /* If this is a SUBREG, look inside so that we handle paradoxical ones. */ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + /* Check for valid MEM forms. */ + if (GET_CODE (op) == MEM) + return memory_address_p (mode, XEXP (op, 0)); + + return false; +}) + +;; Return true if OP is an address suitable for a call insn. +;; Call insn on SPARC can take a PC-relative constant address +;; or any regular memory address. +(define_predicate "call_address_operand" + (ior (match_operand 0 "symbolic_operand") + (match_test "memory_address_p (Pmode, op)"))) + +;; Return true if OP is an operand suitable for a call insn. +(define_predicate "call_operand" + (and (match_code "mem") + (match_test "call_address_operand (XEXP (op, 0), mode)"))) + + +;; Predicates for operators. + +;; Return true if OP is a comparison operator. This allows the use of +;; MATCH_OPERATOR to recognize all the branch insns. +(define_predicate "noov_compare_operator" + (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu") +{ + enum rtx_code code = GET_CODE (op); + if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode + || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) + /* These are the only branches which work with CC_NOOVmode. */ + return (code == EQ || code == NE || code == GE || code == LT); + return true; +}) + +;; Return true if OP is a 64-bit comparison operator. This allows the use of +;; MATCH_OPERATOR to recognize all the branch insns. +(define_predicate "noov_compare64_operator" + (and (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu") + (match_test "TARGET_V9")) +{ + enum rtx_code code = GET_CODE (op); + if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) + /* These are the only branches which work with CCX_NOOVmode. */ + return (code == EQ || code == NE || code == GE || code == LT); + return (GET_MODE (XEXP (op, 0)) == CCXmode); +}) + +;; Return true if OP is a comparison operator suitable for use in V9 +;; conditional move or branch on register contents instructions. +(define_predicate "v9_register_compare_operator" + (match_code "eq,ne,ge,lt,le,gt")) + +;; Return true if OP is an operator which can set the condition codes +;; explicitly. We do not include PLUS and MINUS because these +;; require CC_NOOVmode, which we handle explicitly. +(define_predicate "cc_arith_operator" + (match_code "and,ior,xor")) + +;; Return true if OP is an operator which can bitwise complement its +;; second operand and set the condition codes explicitly. +;; XOR is not here because combine canonicalizes (xor (not ...) ...) +;; and (xor ... (not ...)) to (not (xor ...)). */ +(define_predicate "cc_arith_not_operator" + (match_code "and,ior")) + +;; Return true if OP is memory operand with just [%reg] addressing mode. +(define_predicate "memory_reg_operand" + (and (match_code "mem") + (and (match_operand 0 "memory_operand") + (match_test "REG_P (XEXP (op, 0))")))) diff --git a/contrib/gcc/config/sparc/rtemself.h b/contrib/gcc/config/sparc/rtemself.h index ffb2a7233bd..f94b0a2b741 100644 --- a/contrib/gcc/config/sparc/rtemself.h +++ b/contrib/gcc/config/sparc/rtemself.h @@ -1,5 +1,5 @@ /* Definitions for rtems targeting a SPARC using ELF. - Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2002, 2005 Free Software Foundation, Inc. Contributed by Joel Sherrill (joel@OARcorp.com). This file is part of GCC. @@ -16,16 +16,19 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Target OS builtins. */ -#define TARGET_SUB_OS_CPP_BUILTINS() \ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("sparc"); \ builtin_define ("__rtems__"); \ builtin_define ("__USE_INIT_FINI__"); \ builtin_assert ("system=rtems"); \ } \ while (0) + +/* Use the default */ +#undef LINK_GCC_C_SEQUENCE_SPEC diff --git a/contrib/gcc/config/sparc/sol2-64.h b/contrib/gcc/config/sparc/sol2-64.h index d53747a6eb0..d0dd284daf0 100644 --- a/contrib/gcc/config/sparc/sol2-64.h +++ b/contrib/gcc/config/sparc/sol2-64.h @@ -4,13 +4,4 @@ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ + \ - MASK_STACK_BIAS + MASK_FPU + MASK_LONG_DOUBLE_128) - -/* Target OS builtins. */ -#undef TARGET_SUB_OS_CPP_BUILTINS -#define TARGET_SUB_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("sparc"); \ - } \ - while (0) + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) diff --git a/contrib/gcc/config/sparc/sol2-bi.h b/contrib/gcc/config/sparc/sol2-bi.h index 80ec1daf05f..87d14f0f1cd 100644 --- a/contrib/gcc/config/sparc/sol2-bi.h +++ b/contrib/gcc/config/sparc/sol2-bi.h @@ -1,9 +1,11 @@ /* Definitions of target machine for GCC, for bi-arch SPARC running Solaris 2 using the system assembler and linker. */ -/* The default code model. */ +/* The default code model used to be CM_MEDANY on Solaris + but even Sun eventually found it to be quite wasteful + and changed it to CM_MEDMID in the Studio 9 compiler. */ #undef SPARC_DEFAULT_CMODEL -#define SPARC_DEFAULT_CMODEL CM_MEDANY +#define SPARC_DEFAULT_CMODEL CM_MEDMID #define AS_SPARC64_FLAG "-xarch=v9" @@ -37,6 +39,15 @@ #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b" #endif +#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara +#undef CPP_CPU64_DEFAULT_SPEC +#define CPP_CPU64_DEFAULT_SPEC "" +#undef ASM_CPU32_DEFAULT_SPEC +#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusb" +#undef ASM_CPU64_DEFAULT_SPEC +#define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "b" +#endif + #if DEFAULT_ARCH32_P #define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}" #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}" @@ -55,7 +66,7 @@ %{mcpu=sparclite|mcpu-f930|mcpu=f934:-D__sparclite__} \ %{mcpu=v8:" DEF_ARCH32_SPEC("-D__sparcv8") "} \ %{mcpu=supersparc:-D__supersparc__ " DEF_ARCH32_SPEC("-D__sparcv8") "} \ -%{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-D__sparcv8") "} \ +%{mcpu=v9|mcpu=ultrasparc|mcpu=ultrasparc3|mcpu=niagara:" DEF_ARCH32_SPEC("-D__sparcv8") "} \ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \ " @@ -64,7 +75,8 @@ %{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "} \ %{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "a") "} \ %{mcpu=ultrasparc3:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \ -%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}} \ +%{mcpu=niagara:" DEF_ARCH32_SPEC("-xarch=v8plusb") DEF_ARCH64_SPEC(AS_SPARC64_FLAG "b") "} \ +%{!mcpu=niagara:%{!mcpu=ultrasparc3:%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC(AS_SPARC64_FLAG) "}}}}} \ %{!mcpu*:%(asm_cpu_default)} \ " @@ -236,10 +248,3 @@ #else #define MULTILIB_DEFAULTS { "m64" } #endif - -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG - -#if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG) -# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}" -#endif diff --git a/contrib/gcc/config/sparc/sol2-c1.asm b/contrib/gcc/config/sparc/sol2-c1.asm index a1cc68d6756..fdd6e2b07fb 100644 --- a/contrib/gcc/config/sparc/sol2-c1.asm +++ b/contrib/gcc/config/sparc/sol2-c1.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/sparc/sol2-ci.asm b/contrib/gcc/config/sparc/sol2-ci.asm index 3dc793c0c89..5726d62d994 100644 --- a/contrib/gcc/config/sparc/sol2-ci.asm +++ b/contrib/gcc/config/sparc/sol2-ci.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/sparc/sol2-cn.asm b/contrib/gcc/config/sparc/sol2-cn.asm index 49e070f34f4..6e2fb2c6e49 100644 --- a/contrib/gcc/config/sparc/sol2-cn.asm +++ b/contrib/gcc/config/sparc/sol2-cn.asm @@ -23,8 +23,8 @@ ! ! You should have received a copy of the GNU General Public License ! along with this program; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. +! the Free Software Foundation, 51 Franklin Street, Fifth Floor, +! Boston, MA 02110-1301, USA. ! ! As a special exception, if you link this library with files ! compiled with GCC to produce an executable, this does not cause diff --git a/contrib/gcc/config/sparc/sol2-gas-bi.h b/contrib/gcc/config/sparc/sol2-gas-bi.h index bea2b3cf6b4..88b3954f820 100644 --- a/contrib/gcc/config/sparc/sol2-gas-bi.h +++ b/contrib/gcc/config/sparc/sol2-gas-bi.h @@ -3,9 +3,3 @@ #undef AS_SPARC64_FLAG #define AS_SPARC64_FLAG "-TSO -64 -Av9" - -/* Emit a DTP-relative reference to a TLS variable. */ -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - sparc_output_dwarf_dtprel (FILE, SIZE, X) -#endif diff --git a/contrib/gcc/config/sparc/sol2-gas.h b/contrib/gcc/config/sparc/sol2-gas.h new file mode 100644 index 00000000000..942e39de8a4 --- /dev/null +++ b/contrib/gcc/config/sparc/sol2-gas.h @@ -0,0 +1,13 @@ +/* Definitions of target machine for GCC, for SPARC running Solaris 2 + using the GNU assembler. */ + +/* Undefine this so that BNSYM/ENSYM pairs are emitted by STABS+. */ +#undef NO_DBX_BNSYM_ENSYM + +/* Use GNU extensions to TLS support. */ +#ifdef HAVE_AS_TLS +#undef TARGET_SUN_TLS +#undef TARGET_GNU_TLS +#define TARGET_SUN_TLS 0 +#define TARGET_GNU_TLS 1 +#endif diff --git a/contrib/gcc/config/sparc/sol2.h b/contrib/gcc/config/sparc/sol2.h index e5ed818f21a..d07e0c63685 100644 --- a/contrib/gcc/config/sparc/sol2.h +++ b/contrib/gcc/config/sparc/sol2.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for SPARC running Solaris 2 - Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 - Free Software Foundation, Inc. + Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, + 2006 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@netcom.com). Additional changes by David V. Henkel-Wallace (gumby@cygnus.com). @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Supposedly the same as vanilla sparc svr4, except for the stuff below: */ @@ -41,11 +41,17 @@ Boston, MA 02111-1307, USA. */ #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb" #endif +#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara +#undef ASM_CPU_DEFAULT_SPEC +#define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusb" +#endif + #undef ASM_CPU_SPEC #define ASM_CPU_SPEC "\ %{mcpu=v9:-xarch=v8plus} \ %{mcpu=ultrasparc:-xarch=v8plusa} \ %{mcpu=ultrasparc3:-xarch=v8plusb} \ +%{mcpu=niagara:-xarch=v8plusb} \ %{!mcpu*:%(asm_cpu_default)} \ " @@ -57,11 +63,6 @@ Boston, MA 02111-1307, USA. */ /* However it appears that Solaris 2.0 uses the same reg numbering as the old BSD-style system did. */ -/* Same as sparc.h */ -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(REGNO) \ - (TARGET_FLAT && (REGNO) == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO) - /* The Solaris 2 assembler uses .skip, not .zero, so put this back. */ #undef ASM_OUTPUT_SKIP #define ASM_OUTPUT_SKIP(FILE,SIZE) \ @@ -70,13 +71,6 @@ Boston, MA 02111-1307, USA. */ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* This is how to output a reference to an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABELREF -#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ - fprintf (FILE, ".L%s%d", PREFIX, NUM) - /* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. @@ -95,7 +89,7 @@ Boston, MA 02111-1307, USA. */ { \ HOST_WIDE_INT size; \ \ - if (DECL_THREAD_LOCAL (DECL)) \ + if (DECL_THREAD_LOCAL_P (DECL)) \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_object"); \ else \ ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ @@ -113,12 +107,9 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* The Solaris assembler cannot grok r_tls_dtpoff. This is - a kludge as ASM_OUTPUT_DWARF_DTPREL is defined in sparc.h, - undefined here and defined again in sol2-gas-bi.h. */ -#ifdef HAVE_AS_TLS -#undef ASM_OUTPUT_DWARF_DTPREL -#endif +/* The Solaris assembler cannot grok .stabd directives. */ +#undef NO_DBX_BNSYM_ENSYM +#define NO_DBX_BNSYM_ENSYM 1 #undef ENDFILE_SPEC @@ -137,12 +128,7 @@ Boston, MA 02111-1307, USA. */ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) #endif -/* The Solaris linker doesn't understand constructor priorities. */ -#undef SUPPORTS_INIT_PRIORITY -#define SUPPORTS_INIT_PRIORITY 0 -/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h. - Instead, it is enabled here, because it does work under Solaris. */ /* Define for support of TFmode long double. SPARC ABI says that long double is 4 words. */ #define LONG_DOUBLE_TYPE_SIZE 128 @@ -168,4 +154,20 @@ Boston, MA 02111-1307, USA. */ /* Solaris allows 64 bit out and global registers in 32 bit mode. sparc_override_options will disable V8+ if not generating V9 code. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_V8PLUS + MASK_FPU + MASK_LONG_DOUBLE_128) +#define TARGET_DEFAULT (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU \ + + MASK_LONG_DOUBLE_128) + +/* Solaris-specific #pragmas are implemented on top of attributes. Hook in + the bits from config/sol2.c. */ +#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes +#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE + +/* Output a simple call for .init/.fini. */ +#define ASM_OUTPUT_CALL(FILE, FN) \ + do \ + { \ + fprintf (FILE, "\tcall\t"); \ + print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0); \ + fprintf (FILE, "\n\tnop\n"); \ + } \ + while (0) diff --git a/contrib/gcc/config/sparc/sp-elf.h b/contrib/gcc/config/sparc/sp-elf.h new file mode 100644 index 00000000000..ef49b82be1c --- /dev/null +++ b/contrib/gcc/config/sparc/sp-elf.h @@ -0,0 +1,80 @@ +/* Definitions of target machine for GCC, + for SPARC running in an embedded environment using the ELF file format. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparc-elf)") + +/* Don't assume anything about the header files. */ +#define NO_IMPLICIT_EXTERN_C + +/* The sun bundled assembler doesn't accept -Yd, (and neither does gas). + It's safe to pass -s always, even if -g is not used. */ +#undef ASM_SPEC +#define ASM_SPEC \ + "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \ + %{fpic|fpie|fPIC|fPIE:-K PIC} %(asm_cpu)" + +/* Use the default. */ +#undef LINK_SPEC + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + crtend.o%s crtn.o%s" + +/* Don't set the target flags, this is done by the linker script */ +#undef LIB_SPEC +#define LIB_SPEC "" + +/* This defines which switch letters take arguments. + It is as in svr4.h but with -R added. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ + || (CHAR) == 'R' \ + || (CHAR) == 'h' \ + || (CHAR) == 'z') + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM)) + +/* ??? Inherited from sol2.h. Probably wrong. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE "long int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE BITS_PER_WORD + +/* ??? until fixed. */ +#undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 64 diff --git a/contrib/gcc/config/sparc/sp64-elf.h b/contrib/gcc/config/sparc/sp64-elf.h index 650c3ff907b..53f2144e86a 100644 --- a/contrib/gcc/config/sparc/sp64-elf.h +++ b/contrib/gcc/config/sparc/sp64-elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC, for SPARC64, ELF. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005 Free Software Foundation, Inc. Contributed by Doug Evans, dje@cygnus.com. @@ -17,19 +17,13 @@ GNU General Public License for more details. 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. */ - -/* ??? We're taking the scheme of including another file and then overriding - the values we don't like a bit too far here. The alternative is to more or - less duplicate all of svr4.h, sparc/sysv4.h, and sparc/sol2.h here - (suitably cleaned up). */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc64-elf)") /* A 64 bit v9 compiler in a Medium/Anywhere code model environment. */ - #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \ @@ -38,14 +32,8 @@ Boston, MA 02111-1307, USA. */ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_EMBMEDANY -/* Target OS builtins for config/sol.h. */ -#undef TARGET_SUB_OS_CPP_BUILTINS -#define TARGET_SUB_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("sparc"); \ - } \ - while (0) +/* Don't assume anything about the header files. */ +#define NO_IMPLICIT_EXTERN_C /* __svr4__ is used by the C library (FIXME) */ #undef CPP_SUBTARGET_SPEC @@ -84,18 +72,33 @@ crtbegin.o%s \ /* Use the default (for now). */ #undef LIB_SPEC -/* V9 chips can handle either endianness. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"big-endian", -MASK_LITTLE_ENDIAN, N_("Generate code for big endian") }, \ -{"little-endian", MASK_LITTLE_ENDIAN, N_("Generate code for little endian") }, +/* This defines which switch letters take arguments. + It is as in svr4.h but with -R added. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ + || (CHAR) == 'R' \ + || (CHAR) == 'h' \ + || (CHAR) == 'z') #undef BYTES_BIG_ENDIAN #define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) #undef WORDS_BIG_ENDIAN #define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM)) + /* ??? This should be 32 bits for v9 but what can we do? */ #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" @@ -113,12 +116,3 @@ crtbegin.o%s \ this 0 to not confuse the branch shortening code. */ #undef JUMP_TABLES_IN_TEXT_SECTION #define JUMP_TABLES_IN_TEXT_SECTION 0 - -/* System V Release 4 uses DWARF debugging info. - GDB doesn't support 64 bit stabs yet and the desired debug format is DWARF - anyway so it is the default. */ - -#define DBX_DEBUGGING_INFO 1 - -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG diff --git a/contrib/gcc/config/sparc/sparc-modes.def b/contrib/gcc/config/sparc/sparc-modes.def index ea2a99d5ae1..5687a44c889 100644 --- a/contrib/gcc/config/sparc/sparc-modes.def +++ b/contrib/gcc/config/sparc/sparc-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC, for Sun SPARC. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). 64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, at Cygnus Support. @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* 128-bit floating point */ FLOAT_MODE (TF, 16, ieee_quad_format); @@ -42,3 +42,7 @@ CC_MODE (CC_NOOV); CC_MODE (CCX_NOOV); CC_MODE (CCFP); CC_MODE (CCFPE); + +/* Vector modes. */ +VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */ +VECTOR_MODES (INT, 4); /* V4QI V2HI */ diff --git a/contrib/gcc/config/sparc/sparc-protos.h b/contrib/gcc/config/sparc/sparc-protos.h index 3216f38698d..4fb862cc908 100644 --- a/contrib/gcc/config/sparc/sparc-protos.h +++ b/contrib/gcc/config/sparc/sparc-protos.h @@ -1,5 +1,5 @@ /* Prototypes of target machine for SPARC. - Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, at Cygnus Support. @@ -18,30 +18,22 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef __SPARC_PROTOS_H__ #define __SPARC_PROTOS_H__ -extern bool sparc_emitting_epilogue; - #ifdef TREE_CODE extern struct rtx_def *function_value (tree, enum machine_mode, int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *, enum machine_mode, tree, int, int); -extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern int function_arg_pass_by_reference (const CUMULATIVE_ARGS *, - enum machine_mode, tree, int); -extern struct rtx_def *sparc_builtin_saveregs (void); #ifdef RTX_CODE extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); extern void sparc_va_start (tree, rtx); #endif -extern struct rtx_def *sparc_va_arg (tree, tree); extern unsigned long sparc_type_code (tree); #ifdef ARGS_SIZE_RTX /* expr.h defines ARGS_SIZE_RTX and `enum direction' */ @@ -49,24 +41,24 @@ extern enum direction function_arg_padding (enum machine_mode, tree); #endif /* ARGS_SIZE_RTX */ #endif /* TREE_CODE */ -extern void load_pic_register (void); extern void order_regs_for_local_alloc (void); -extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int); +extern HOST_WIDE_INT sparc_compute_frame_size (HOST_WIDE_INT, int); +extern void sparc_expand_prologue (void); +extern void sparc_expand_epilogue (void); +extern bool sparc_can_use_return_insn_p (void); extern int check_pic (int); extern int short_branch (int, int); -extern int sparc_flat_epilogue_delay_slots (void); -extern HOST_WIDE_INT sparc_flat_compute_frame_size (HOST_WIDE_INT); extern void sparc_profile_hook (int); extern void sparc_override_options (void); -extern int leaf_return_peephole_ok (void); extern void sparc_output_scratch_registers (FILE *); #ifdef RTX_CODE extern enum machine_mode select_cc_mode (enum rtx_code, rtx, rtx); /* Define the function that build the compare insn for scc and bcc. */ -extern rtx gen_compare_reg (enum rtx_code code, rtx, rtx); +extern rtx gen_compare_reg (enum rtx_code code); extern void sparc_emit_float_lib_cmp (rtx, rtx, enum rtx_code); -extern void sparc_emit_floatunsdi (rtx [2]); +extern void sparc_emit_floatunsdi (rtx [2], enum machine_mode); +extern void sparc_emit_fixunsdi (rtx [2], enum machine_mode); extern void emit_tfmode_binop (enum rtx_code, rtx *); extern void emit_tfmode_unop (enum rtx_code, rtx *); extern void emit_tfmode_cvt (enum rtx_code, rtx *); @@ -82,15 +74,18 @@ extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx); extern rtx legitimize_tls_address (rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); extern void sparc_defer_case_vector (rtx, rtx, int); +extern bool sparc_expand_move (enum machine_mode, rtx *); extern void sparc_emit_set_const32 (rtx, rtx); extern void sparc_emit_set_const64 (rtx, rtx); extern void sparc_emit_set_symbolic_const64 (rtx, rtx, rtx); extern int sparc_splitdi_legitimate (rtx, rtx); extern int sparc_absnegfloat_split_legitimate (rtx, rtx); extern const char *output_ubranch (rtx, int, rtx); -extern char *output_cbranch (rtx, rtx, int, int, int, int, rtx); +extern const char *output_cbranch (rtx, rtx, int, int, int, rtx); +extern const char *output_return (rtx); extern const char *output_sibcall (rtx, rtx); -extern char *output_v9branch (rtx, rtx, int, int, int, int, int, rtx); +extern const char *output_v8plus_shift (rtx *, rtx, const char *); +extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx); extern void emit_v9_brxx_insn (enum rtx_code, rtx, rtx); extern void print_operand (FILE *, rtx, int); extern int mems_ok_for_ldd_peep (rtx, rtx, rtx); @@ -99,29 +94,27 @@ extern int arith_4096_operand (rtx, enum machine_mode); extern int zero_operand (rtx, enum machine_mode); extern int fp_zero_operand (rtx, enum machine_mode); extern int reg_or_0_operand (rtx, enum machine_mode); -extern int tls_symbolic_operand (rtx); extern int empty_delay_slot (rtx); -extern int eligible_for_epilogue_delay (rtx, int); +extern int eligible_for_return_delay (rtx); extern int eligible_for_sibcall_delay (rtx); extern int tls_call_delay (rtx); extern int emit_move_sequence (rtx, enum machine_mode); extern int fp_sethi_p (rtx); extern int fp_mov_p (rtx); extern int fp_high_losum_p (rtx); +extern bool sparc_tls_referenced_p (rtx); extern int mem_min_alignment (rtx, int); extern int pic_address_needs_scratch (rtx); extern int reg_unused_after (rtx, rtx); extern int register_ok_for_ldd (rtx); extern int registers_ok_for_ldd_peep (rtx, rtx); -extern int sparc_flat_eligible_for_epilogue_delay (rtx, int); extern int v9_regcmp_p (enum rtx_code); -extern char *sparc_v8plus_shift (rtx *, rtx, const char *); /* Function used for V8+ code generation. Returns 1 if the high 32 bits of REG are 0 before INSN. */ extern int sparc_check_64 (rtx, rtx); extern rtx gen_df_reg (rtx, int); extern int sparc_extra_constraint_check (rtx, int, int); -extern void sparc_output_dwarf_dtprel (FILE*, int, rtx); +extern void sparc_expand_compare_and_swap_12 (rtx, rtx, rtx, rtx); #endif /* RTX_CODE */ #endif /* __SPARC_PROTOS_H__ */ diff --git a/contrib/gcc/config/sparc/sparc.c b/contrib/gcc/config/sparc/sparc.c index 86524cc3732..692e46e5584 100644 --- a/contrib/gcc/config/sparc/sparc.c +++ b/contrib/gcc/config/sparc/sparc.c @@ -1,6 +1,7 @@ /* Subroutines for insn-output.c for SPARC. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, at Cygnus Support. @@ -19,8 +20,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -32,6 +33,7 @@ Boston, MA 02111-1307, USA. */ #include "hard-reg-set.h" #include "real.h" #include "insn-config.h" +#include "insn-codes.h" #include "conditions.h" #include "output.h" #include "insn-attr.h" @@ -47,24 +49,197 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "target-def.h" #include "cfglayout.h" +#include "tree-gimple.h" +#include "langhooks.h" -/* 1 if the caller has placed an "unimp" insn immediately after the call. - This is used in v8 code when calling a function that returns a structure. - v9 doesn't have this. Be careful to have this test be the same as that - used on the call. */ +/* Processor costs */ +static const +struct processor_costs cypress_costs = { + COSTS_N_INSNS (2), /* int load */ + COSTS_N_INSNS (2), /* int signed load */ + COSTS_N_INSNS (2), /* int zeroed load */ + COSTS_N_INSNS (2), /* float load */ + COSTS_N_INSNS (5), /* fmov, fneg, fabs */ + COSTS_N_INSNS (5), /* fadd, fsub */ + COSTS_N_INSNS (1), /* fcmp */ + COSTS_N_INSNS (1), /* fmov, fmovr */ + COSTS_N_INSNS (7), /* fmul */ + COSTS_N_INSNS (37), /* fdivs */ + COSTS_N_INSNS (37), /* fdivd */ + COSTS_N_INSNS (63), /* fsqrts */ + COSTS_N_INSNS (63), /* fsqrtd */ + COSTS_N_INSNS (1), /* imul */ + COSTS_N_INSNS (1), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (1), /* idiv */ + COSTS_N_INSNS (1), /* idivX */ + COSTS_N_INSNS (1), /* movcc/movr */ + 0, /* shift penalty */ +}; -#define SKIP_CALLERS_UNIMP_P \ -(!TARGET_ARCH64 && current_function_returns_struct \ - && ! integer_zerop (DECL_SIZE (DECL_RESULT (current_function_decl))) \ - && (TREE_CODE (DECL_SIZE (DECL_RESULT (current_function_decl))) \ - == INTEGER_CST)) +static const +struct processor_costs supersparc_costs = { + COSTS_N_INSNS (1), /* int load */ + COSTS_N_INSNS (1), /* int signed load */ + COSTS_N_INSNS (1), /* int zeroed load */ + COSTS_N_INSNS (0), /* float load */ + COSTS_N_INSNS (3), /* fmov, fneg, fabs */ + COSTS_N_INSNS (3), /* fadd, fsub */ + COSTS_N_INSNS (3), /* fcmp */ + COSTS_N_INSNS (1), /* fmov, fmovr */ + COSTS_N_INSNS (3), /* fmul */ + COSTS_N_INSNS (6), /* fdivs */ + COSTS_N_INSNS (9), /* fdivd */ + COSTS_N_INSNS (12), /* fsqrts */ + COSTS_N_INSNS (12), /* fsqrtd */ + COSTS_N_INSNS (4), /* imul */ + COSTS_N_INSNS (4), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (4), /* idiv */ + COSTS_N_INSNS (4), /* idivX */ + COSTS_N_INSNS (1), /* movcc/movr */ + 1, /* shift penalty */ +}; + +static const +struct processor_costs hypersparc_costs = { + COSTS_N_INSNS (1), /* int load */ + COSTS_N_INSNS (1), /* int signed load */ + COSTS_N_INSNS (1), /* int zeroed load */ + COSTS_N_INSNS (1), /* float load */ + COSTS_N_INSNS (1), /* fmov, fneg, fabs */ + COSTS_N_INSNS (1), /* fadd, fsub */ + COSTS_N_INSNS (1), /* fcmp */ + COSTS_N_INSNS (1), /* fmov, fmovr */ + COSTS_N_INSNS (1), /* fmul */ + COSTS_N_INSNS (8), /* fdivs */ + COSTS_N_INSNS (12), /* fdivd */ + COSTS_N_INSNS (17), /* fsqrts */ + COSTS_N_INSNS (17), /* fsqrtd */ + COSTS_N_INSNS (17), /* imul */ + COSTS_N_INSNS (17), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (17), /* idiv */ + COSTS_N_INSNS (17), /* idivX */ + COSTS_N_INSNS (1), /* movcc/movr */ + 0, /* shift penalty */ +}; + +static const +struct processor_costs sparclet_costs = { + COSTS_N_INSNS (3), /* int load */ + COSTS_N_INSNS (3), /* int signed load */ + COSTS_N_INSNS (1), /* int zeroed load */ + COSTS_N_INSNS (1), /* float load */ + COSTS_N_INSNS (1), /* fmov, fneg, fabs */ + COSTS_N_INSNS (1), /* fadd, fsub */ + COSTS_N_INSNS (1), /* fcmp */ + COSTS_N_INSNS (1), /* fmov, fmovr */ + COSTS_N_INSNS (1), /* fmul */ + COSTS_N_INSNS (1), /* fdivs */ + COSTS_N_INSNS (1), /* fdivd */ + COSTS_N_INSNS (1), /* fsqrts */ + COSTS_N_INSNS (1), /* fsqrtd */ + COSTS_N_INSNS (5), /* imul */ + COSTS_N_INSNS (5), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (5), /* idiv */ + COSTS_N_INSNS (5), /* idivX */ + COSTS_N_INSNS (1), /* movcc/movr */ + 0, /* shift penalty */ +}; + +static const +struct processor_costs ultrasparc_costs = { + COSTS_N_INSNS (2), /* int load */ + COSTS_N_INSNS (3), /* int signed load */ + COSTS_N_INSNS (2), /* int zeroed load */ + COSTS_N_INSNS (2), /* float load */ + COSTS_N_INSNS (1), /* fmov, fneg, fabs */ + COSTS_N_INSNS (4), /* fadd, fsub */ + COSTS_N_INSNS (1), /* fcmp */ + COSTS_N_INSNS (2), /* fmov, fmovr */ + COSTS_N_INSNS (4), /* fmul */ + COSTS_N_INSNS (13), /* fdivs */ + COSTS_N_INSNS (23), /* fdivd */ + COSTS_N_INSNS (13), /* fsqrts */ + COSTS_N_INSNS (23), /* fsqrtd */ + COSTS_N_INSNS (4), /* imul */ + COSTS_N_INSNS (4), /* imulX */ + 2, /* imul bit factor */ + COSTS_N_INSNS (37), /* idiv */ + COSTS_N_INSNS (68), /* idivX */ + COSTS_N_INSNS (2), /* movcc/movr */ + 2, /* shift penalty */ +}; + +static const +struct processor_costs ultrasparc3_costs = { + COSTS_N_INSNS (2), /* int load */ + COSTS_N_INSNS (3), /* int signed load */ + COSTS_N_INSNS (3), /* int zeroed load */ + COSTS_N_INSNS (2), /* float load */ + COSTS_N_INSNS (3), /* fmov, fneg, fabs */ + COSTS_N_INSNS (4), /* fadd, fsub */ + COSTS_N_INSNS (5), /* fcmp */ + COSTS_N_INSNS (3), /* fmov, fmovr */ + COSTS_N_INSNS (4), /* fmul */ + COSTS_N_INSNS (17), /* fdivs */ + COSTS_N_INSNS (20), /* fdivd */ + COSTS_N_INSNS (20), /* fsqrts */ + COSTS_N_INSNS (29), /* fsqrtd */ + COSTS_N_INSNS (6), /* imul */ + COSTS_N_INSNS (6), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (40), /* idiv */ + COSTS_N_INSNS (71), /* idivX */ + COSTS_N_INSNS (2), /* movcc/movr */ + 0, /* shift penalty */ +}; + +static const +struct processor_costs niagara_costs = { + COSTS_N_INSNS (3), /* int load */ + COSTS_N_INSNS (3), /* int signed load */ + COSTS_N_INSNS (3), /* int zeroed load */ + COSTS_N_INSNS (9), /* float load */ + COSTS_N_INSNS (8), /* fmov, fneg, fabs */ + COSTS_N_INSNS (8), /* fadd, fsub */ + COSTS_N_INSNS (26), /* fcmp */ + COSTS_N_INSNS (8), /* fmov, fmovr */ + COSTS_N_INSNS (29), /* fmul */ + COSTS_N_INSNS (54), /* fdivs */ + COSTS_N_INSNS (83), /* fdivd */ + COSTS_N_INSNS (100), /* fsqrts - not implemented in hardware */ + COSTS_N_INSNS (100), /* fsqrtd - not implemented in hardware */ + COSTS_N_INSNS (11), /* imul */ + COSTS_N_INSNS (11), /* imulX */ + 0, /* imul bit factor */ + COSTS_N_INSNS (72), /* idiv */ + COSTS_N_INSNS (72), /* idivX */ + COSTS_N_INSNS (1), /* movcc/movr */ + 0, /* shift penalty */ +}; + +const struct processor_costs *sparc_costs = &cypress_costs; + +#ifdef HAVE_AS_RELAX_OPTION +/* If 'as' and 'ld' are relaxing tail call insns into branch always, use + "or %o7,%g0,X; call Y; or X,%g0,%o7" always, so that it can be optimized. + With sethi/jmp, neither 'as' nor 'ld' has an easy way how to find out if + somebody does not branch between the sethi and jmp. */ +#define LEAF_SIBCALL_SLOT_RESERVED_P 1 +#else +#define LEAF_SIBCALL_SLOT_RESERVED_P \ + ((TARGET_ARCH64 && !TARGET_CM_MEDLOW) || flag_pic) +#endif /* Global variables for machine-dependent things. */ /* Size of frame. Need to know this to emit return insns from leaf procedures. - ACTUAL_FSIZE is set by compute_frame_size() which is called during the - reload pass. This is important as the value is later used in insn - scheduling (to see what can go in a delay slot). + ACTUAL_FSIZE is set by sparc_compute_frame_size() which is called during the + reload pass. This is important as the value is later used for scheduling + (to see what can go in a delay slot). APPARENT_FSIZE is the size of the stack less the register save area and less the outgoing argument area. It is used when saving call preserved regs. */ static HOST_WIDE_INT apparent_fsize; @@ -74,13 +249,15 @@ static HOST_WIDE_INT actual_fsize; saved (as 4-byte quantities). */ static int num_gfregs; +/* The alias set for prologue/epilogue register save/restore. */ +static GTY(()) int sparc_sr_alias_set; + +/* The alias set for the structure return value. */ +static GTY(()) int struct_value_alias_set; + /* Save the operands last given to a compare for use when we generate a scc or bcc insn. */ -rtx sparc_compare_op0, sparc_compare_op1; - -/* Coordinate with the md file wrt special insns created by - sparc_nonflat_function_epilogue. */ -bool sparc_emitting_epilogue; +rtx sparc_compare_op0, sparc_compare_op1, sparc_compare_emitted; /* Vector to say how input registers are mapped to output registers. HARD_FRAME_POINTER_REGNUM cannot be remapped by this function to @@ -123,20 +300,32 @@ struct machine_function GTY(()) { /* Some local-dynamic TLS symbol name. */ const char *some_ld_name; + + /* True if the current function is leaf and uses only leaf regs, + so that the SPARC leaf function optimization can be applied. + Private version of current_function_uses_only_leaf_regs, see + sparc_expand_prologue for the rationale. */ + int leaf_function_p; + + /* True if the data calculated by sparc_expand_prologue are valid. */ + bool prologue_data_valid_p; }; -/* Name of where we pretend to think the frame pointer points. - Normally, this is "%fp", but if we are in a leaf procedure, - this is "%sp+something". We record "something" separately as it may be - too big for reg+constant addressing. */ +#define sparc_leaf_function_p cfun->machine->leaf_function_p +#define sparc_prologue_data_valid_p cfun->machine->prologue_data_valid_p -static const char *frame_base_name; +/* Register we pretend to think the frame pointer is allocated to. + Normally, this is %fp, but if we are in a leaf procedure, this + is %sp+"something". We record "something" separately as it may + be too big for reg+constant addressing. */ +static rtx frame_base_reg; static HOST_WIDE_INT frame_base_offset; +/* 1 if the next opcode is to be specially indented. */ +int sparc_indent_opcode = 0; + +static bool sparc_handle_option (size_t, const char *, int); static void sparc_init_modes (void); -static int save_regs (FILE *, int, int, const char *, int, int, HOST_WIDE_INT); -static int restore_regs (FILE *, int, int, const char *, int, int); -static void build_big_number (FILE *, HOST_WIDE_INT, const char *); static void scan_record_type (tree, int *, int *, int *); static int function_arg_slotno (const CUMULATIVE_ARGS *, enum machine_mode, tree, int, int, int *, int *); @@ -147,34 +336,23 @@ static int hypersparc_adjust_cost (rtx, rtx, rtx, int); static void sparc_output_addr_vec (rtx); static void sparc_output_addr_diff_vec (rtx); static void sparc_output_deferred_case_vectors (void); -static int check_return_regs (rtx); +static rtx sparc_builtin_saveregs (void); static int epilogue_renumber (rtx *, int); static bool sparc_assemble_integer (rtx, unsigned int, int); static int set_extends (rtx); -static void output_restore_regs (FILE *, int); -static void sparc_output_function_prologue (FILE *, HOST_WIDE_INT); -static void sparc_output_function_epilogue (FILE *, HOST_WIDE_INT); -static void sparc_flat_function_epilogue (FILE *, HOST_WIDE_INT); -static void sparc_flat_function_prologue (FILE *, HOST_WIDE_INT); -static void sparc_flat_save_restore (FILE *, const char *, int, - unsigned long, unsigned long, - const char *, const char *, - HOST_WIDE_INT); -static void sparc_nonflat_function_epilogue (FILE *, HOST_WIDE_INT, int); -static void sparc_nonflat_function_prologue (FILE *, HOST_WIDE_INT, int); +static void emit_pic_helper (void); +static void load_pic_register (bool); +static int save_or_restore_regs (int, int, rtx, int, int); +static void emit_save_or_restore_regs (int); +static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT); +static void sparc_asm_function_epilogue (FILE *, HOST_WIDE_INT); #ifdef OBJECT_FORMAT_ELF -static void sparc_elf_asm_named_section (const char *, unsigned int); +static void sparc_elf_asm_named_section (const char *, unsigned int, tree); #endif -static void sparc_aout_select_section (tree, int, unsigned HOST_WIDE_INT) - ATTRIBUTE_UNUSED; -static void sparc_aout_select_rtx_section (enum machine_mode, rtx, - unsigned HOST_WIDE_INT) - ATTRIBUTE_UNUSED; static int sparc_adjust_cost (rtx, rtx, rtx, int); static int sparc_issue_rate (void); static void sparc_sched_init (FILE *, int, int); -static int sparc_use_dfa_pipeline_interface (void); static int sparc_use_sched_lookahead (void); static void emit_soft_tfmode_libcall (const char *, int, rtx *); @@ -185,6 +363,12 @@ static void emit_hard_tfmode_operation (enum rtx_code, rtx *); static bool sparc_function_ok_for_sibcall (tree, tree); static void sparc_init_libfuncs (void); +static void sparc_init_builtins (void); +static void sparc_vis_init_builtins (void); +static rtx sparc_expand_builtin (tree, rtx, rtx, enum machine_mode, int); +static tree sparc_fold_builtin (tree, tree, bool); +static int sparc_vis_mul8x16 (int, int); +static tree sparc_handle_vis_mul8x16 (int, tree, tree, tree); static void sparc_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static bool sparc_can_output_mi_thunk (tree, HOST_WIDE_INT, @@ -196,11 +380,28 @@ static rtx sparc_tls_got (void); static const char *get_some_local_dynamic_name (void); static int get_some_local_dynamic_name_1 (rtx *, void *); static bool sparc_rtx_costs (rtx, int, int, int *); +static bool sparc_promote_prototypes (tree); +static rtx sparc_struct_value_rtx (tree, int); +static bool sparc_return_in_memory (tree, tree); +static bool sparc_strict_argument_naming (CUMULATIVE_ARGS *); +static tree sparc_gimplify_va_arg (tree, tree, tree *, tree *); +static bool sparc_vector_mode_supported_p (enum machine_mode); +static bool sparc_pass_by_reference (CUMULATIVE_ARGS *, + enum machine_mode, tree, bool); +static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *, + enum machine_mode, tree, bool); +static void sparc_dwarf_handle_frame_unspec (const char *, rtx, int); +static void sparc_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; +static void sparc_file_end (void); +#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING +static const char *sparc_mangle_fundamental_type (tree); +#endif +#ifdef SUBTARGET_ATTRIBUTE_TABLE +const struct attribute_spec sparc_attribute_table[]; +#endif /* Option handling. */ -/* Code model option as passed by user. */ -const char *sparc_cmodel_string; /* Parsed value. */ enum cmodel sparc_cmodel; @@ -217,7 +418,10 @@ struct sparc_cpu_select sparc_select[] = /* CPU type. This is set from TARGET_CPU_DEFAULT and -m{cpu,tune}=xxx. */ enum processor_type sparc_cpu; - + +/* Whether an FPU option was specified. */ +static bool fpu_option_set = false; + /* Initialize the GCC target structure. */ /* The sparc default is to use .half rather than .short for aligned @@ -241,9 +445,9 @@ enum processor_type sparc_cpu; #define TARGET_ASM_INTEGER sparc_assemble_integer #undef TARGET_ASM_FUNCTION_PROLOGUE -#define TARGET_ASM_FUNCTION_PROLOGUE sparc_output_function_prologue +#define TARGET_ASM_FUNCTION_PROLOGUE sparc_asm_function_prologue #undef TARGET_ASM_FUNCTION_EPILOGUE -#define TARGET_ASM_FUNCTION_EPILOGUE sparc_output_function_epilogue +#define TARGET_ASM_FUNCTION_EPILOGUE sparc_asm_function_epilogue #undef TARGET_SCHED_ADJUST_COST #define TARGET_SCHED_ADJUST_COST sparc_adjust_cost @@ -251,8 +455,6 @@ enum processor_type sparc_cpu; #define TARGET_SCHED_ISSUE_RATE sparc_issue_rate #undef TARGET_SCHED_INIT #define TARGET_SCHED_INIT sparc_sched_init -#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE sparc_use_dfa_pipeline_interface #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD sparc_use_sched_lookahead @@ -261,11 +463,19 @@ enum processor_type sparc_cpu; #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS sparc_init_libfuncs +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS sparc_init_builtins -#ifdef HAVE_AS_TLS +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN sparc_expand_builtin +#undef TARGET_FOLD_BUILTIN +#define TARGET_FOLD_BUILTIN sparc_fold_builtin + +#if TARGET_TLS #undef TARGET_HAVE_TLS #define TARGET_HAVE_TLS true #endif + #undef TARGET_CANNOT_FORCE_CONST_MEM #define TARGET_CANNOT_FORCE_CONST_MEM sparc_cannot_force_const_mem @@ -279,8 +489,104 @@ enum processor_type sparc_cpu; #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_0 +/* This is only needed for TARGET_ARCH64, but since PROMOTE_FUNCTION_MODE is a + no-op for TARGET_ARCH32 this is ok. Otherwise we'd need to add a runtime + test for this value. */ +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true + +/* This is only needed for TARGET_ARCH64, but since PROMOTE_FUNCTION_MODE is a + no-op for TARGET_ARCH32 this is ok. Otherwise we'd need to add a runtime + test for this value. */ +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true + +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES sparc_promote_prototypes + +#undef TARGET_STRUCT_VALUE_RTX +#define TARGET_STRUCT_VALUE_RTX sparc_struct_value_rtx +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY sparc_return_in_memory +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE sparc_pass_by_reference +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES sparc_arg_partial_bytes + +#undef TARGET_EXPAND_BUILTIN_SAVEREGS +#define TARGET_EXPAND_BUILTIN_SAVEREGS sparc_builtin_saveregs +#undef TARGET_STRICT_ARGUMENT_NAMING +#define TARGET_STRICT_ARGUMENT_NAMING sparc_strict_argument_naming + +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR sparc_gimplify_va_arg + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P sparc_vector_mode_supported_p + +#undef TARGET_DWARF_HANDLE_FRAME_UNSPEC +#define TARGET_DWARF_HANDLE_FRAME_UNSPEC sparc_dwarf_handle_frame_unspec + +#ifdef SUBTARGET_INSERT_ATTRIBUTES +#undef TARGET_INSERT_ATTRIBUTES +#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES +#endif + +#ifdef SUBTARGET_ATTRIBUTE_TABLE +#undef TARGET_ATTRIBUTE_TABLE +#define TARGET_ATTRIBUTE_TABLE sparc_attribute_table +#endif + +#undef TARGET_RELAXED_ORDERING +#define TARGET_RELAXED_ORDERING SPARC_RELAXED_ORDERING + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION sparc_handle_option + +#if TARGET_GNU_TLS +#undef TARGET_ASM_OUTPUT_DWARF_DTPREL +#define TARGET_ASM_OUTPUT_DWARF_DTPREL sparc_output_dwarf_dtprel +#endif + +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END sparc_file_end + +#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING +#undef TARGET_MANGLE_FUNDAMENTAL_TYPE +#define TARGET_MANGLE_FUNDAMENTAL_TYPE sparc_mangle_fundamental_type +#endif + struct gcc_target targetm = TARGET_INITIALIZER; - + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +sparc_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mfpu: + case OPT_mhard_float: + case OPT_msoft_float: + fpu_option_set = true; + break; + + case OPT_mcpu_: + sparc_select[1].string = arg; + break; + + case OPT_mtune_: + sparc_select[2].string = arg; + break; + } + + return true; +} + /* Validate and override various options, and do some machine dependent initialization. */ @@ -315,6 +621,7 @@ sparc_override_options (void) { TARGET_CPU_v9, "v9" }, { TARGET_CPU_ultrasparc, "ultrasparc" }, { TARGET_CPU_ultrasparc3, "ultrasparc3" }, + { TARGET_CPU_niagara, "niagara" }, { 0, 0 } }; const struct cpu_default *def; @@ -350,6 +657,8 @@ sparc_override_options (void) /* TI ultrasparc III */ /* ??? Check if %y issue still holds true in ultra3. */ { "ultrasparc3", PROCESSOR_ULTRASPARC3, MASK_ISA, MASK_V9|MASK_DEPRECATED_V8_INSNS}, + /* UltraSPARC T1 */ + { "niagara", PROCESSOR_NIAGARA, MASK_ISA, MASK_V9|MASK_DEPRECATED_V8_INSNS}, { 0, 0, 0, 0 } }; const struct cpu_table *cpu; @@ -400,8 +709,7 @@ sparc_override_options (void) for (def = &cpu_default[0]; def->name; ++def) if (def->cpu == TARGET_CPU_DEFAULT) break; - if (! def->name) - abort (); + gcc_assert (def->name); sparc_select[0].string = def->name; for (sel = &sparc_select[0]; sel->name; ++sel) @@ -428,13 +736,9 @@ sparc_override_options (void) } /* If -mfpu or -mno-fpu was explicitly used, don't override with - the processor default. Clear MASK_FPU_SET to avoid confusing - the reverse mapping from switch values to names. */ - if (TARGET_FPU_SET) - { - target_flags = (target_flags & ~MASK_FPU) | fpu; - target_flags &= ~MASK_FPU_SET; - } + the processor default. */ + if (fpu_option_set) + target_flags = (target_flags & ~MASK_FPU) | fpu; /* Don't allow -mvis if FPU is disabled. */ if (! TARGET_FPU) @@ -464,7 +768,8 @@ sparc_override_options (void) /* Supply a default value for align_functions. */ if (align_functions == 0 && (sparc_cpu == PROCESSOR_ULTRASPARC - || sparc_cpu == PROCESSOR_ULTRASPARC3)) + || sparc_cpu == PROCESSOR_ULTRASPARC3 + || sparc_cpu == PROCESSOR_NIAGARA)) align_functions = 32; /* Validate PCC_STRUCT_RETURN. */ @@ -478,10 +783,62 @@ sparc_override_options (void) /* Do various machine dependent initializations. */ sparc_init_modes (); + /* Acquire unique alias sets for our private stuff. */ + sparc_sr_alias_set = new_alias_set (); + struct_value_alias_set = new_alias_set (); + /* Set up function hooks. */ init_machine_status = sparc_init_machine_status; + + switch (sparc_cpu) + { + case PROCESSOR_V7: + case PROCESSOR_CYPRESS: + sparc_costs = &cypress_costs; + break; + case PROCESSOR_V8: + case PROCESSOR_SPARCLITE: + case PROCESSOR_SUPERSPARC: + sparc_costs = &supersparc_costs; + break; + case PROCESSOR_F930: + case PROCESSOR_F934: + case PROCESSOR_HYPERSPARC: + case PROCESSOR_SPARCLITE86X: + sparc_costs = &hypersparc_costs; + break; + case PROCESSOR_SPARCLET: + case PROCESSOR_TSC701: + sparc_costs = &sparclet_costs; + break; + case PROCESSOR_V9: + case PROCESSOR_ULTRASPARC: + sparc_costs = &ultrasparc_costs; + break; + case PROCESSOR_ULTRASPARC3: + sparc_costs = &ultrasparc3_costs; + break; + case PROCESSOR_NIAGARA: + sparc_costs = &niagara_costs; + break; + }; + +#ifdef TARGET_DEFAULT_LONG_DOUBLE_128 + if (!(target_flags_explicit & MASK_LONG_DOUBLE_128)) + target_flags |= MASK_LONG_DOUBLE_128; +#endif } +#ifdef SUBTARGET_ATTRIBUTE_TABLE +/* Table of valid machine attributes. */ +const struct attribute_spec sparc_attribute_table[] = +{ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ + SUBTARGET_ATTRIBUTE_TABLE, + { NULL, 0, 0, false, false, false, NULL } +}; +#endif + /* Miscellaneous utilities. */ /* Nonzero if CODE, a comparison, is suitable for use in v9 conditional move @@ -494,58 +851,6 @@ v9_regcmp_p (enum rtx_code code) || code == LE || code == GT); } - -/* Operand constraints. */ - -/* Return nonzero only if OP is a register of mode MODE, - or const0_rtx. */ - -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - if (op == const0_rtx) - return 1; - if (GET_MODE (op) == VOIDmode && GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && CONST_DOUBLE_LOW (op) == 0) - return 1; - if (fp_zero_operand (op, mode)) - return 1; - return 0; -} - -/* Return nonzero only if OP is const1_rtx. */ - -int -const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return op == const1_rtx; -} - -/* Nonzero if OP is a floating point value with value 0.0. */ - -int -fp_zero_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE_CLASS (GET_MODE (op)) != MODE_FLOAT) - return 0; - return op == CONST0_RTX (mode); -} - -/* Nonzero if OP is a register operand in floating point register. */ - -int -fp_register_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - return GET_CODE (op) == REG && SPARC_FP_REG_P (REGNO (op)); -} - /* Nonzero if OP is a floating point constant which can be loaded into an integer register using a single sethi instruction. */ @@ -559,12 +864,8 @@ fp_sethi_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (SPARC_SETHI_P (i)) - return 1; + return !SPARC_SIMM13_P (i) && SPARC_SETHI_P (i); } return 0; @@ -583,12 +884,8 @@ fp_mov_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (SPARC_SIMM13_P (i)) - return 1; + return SPARC_SIMM13_P (i); } return 0; @@ -610,763 +907,161 @@ fp_high_losum_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (! SPARC_SETHI_P (i) - && ! SPARC_SIMM13_P (i)) - return 1; + return !SPARC_SIMM13_P (i) && !SPARC_SETHI_P (i); } return 0; } -/* Nonzero if OP is an integer register. */ +/* Expand a move instruction. Return true if all work is done. */ -int -intreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +bool +sparc_expand_move (enum machine_mode mode, rtx *operands) { - return (register_operand (op, SImode) - || (TARGET_ARCH64 && register_operand (op, DImode))); -} - -/* Nonzero if OP is a floating point condition code register. */ - -int -fcc_reg_operand (rtx op, enum machine_mode mode) -{ - /* This can happen when recog is called from combine. Op may be a MEM. - Fail instead of calling abort in this case. */ - if (GET_CODE (op) != REG) - return 0; - - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) - return 0; - -#if 0 /* ??? ==> 1 when %fcc0-3 are pseudos first. See gen_compare_reg(). */ - if (reg_renumber == 0) - return REGNO (op) >= FIRST_PSEUDO_REGISTER; - return REGNO_OK_FOR_CCFP_P (REGNO (op)); -#else - return (unsigned) REGNO (op) - SPARC_FIRST_V9_FCC_REG < 4; -#endif -} - -/* Nonzero if OP is a floating point condition code fcc0 register. */ - -int -fcc0_reg_operand (rtx op, enum machine_mode mode) -{ - /* This can happen when recog is called from combine. Op may be a MEM. - Fail instead of calling abort in this case. */ - if (GET_CODE (op) != REG) - return 0; - - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) - return 0; - - return REGNO (op) == SPARC_FCC_REG; -} - -/* Nonzero if OP is an integer or floating point condition code register. */ - -int -icc_or_fcc_reg_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == REG && REGNO (op) == SPARC_ICC_REG) + /* Handle sets of MEM first. */ + if (GET_CODE (operands[0]) == MEM) { - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && GET_MODE (op) != CCmode && GET_MODE (op) != CCXmode) - return 0; - return 1; + /* 0 is a register (or a pair of registers) on SPARC. */ + if (register_or_zero_operand (operands[1], mode)) + return false; + + if (!reload_in_progress) + { + operands[0] = validize_mem (operands[0]); + operands[1] = force_reg (mode, operands[1]); + } } - return fcc_reg_operand (op, mode); -} - -/* Nonzero if OP can appear as the dest of a RESTORE insn. */ -int -restore_operand (rtx op, enum machine_mode mode) -{ - return (GET_CODE (op) == REG && GET_MODE (op) == mode - && (REGNO (op) < 8 || (REGNO (op) >= 24 && REGNO (op) < 32))); -} - -/* Call insn on SPARC can take a PC-relative constant address, or any regular - memory address. */ - -int -call_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - abort (); - op = XEXP (op, 0); - return (symbolic_operand (op, mode) || memory_address_p (Pmode, op)); -} - -int -call_operand_address (rtx op, enum machine_mode mode) -{ - return (symbolic_operand (op, mode) || memory_address_p (Pmode, op)); -} - -/* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode, - otherwise return 0. */ - -int -tls_symbolic_operand (rtx op) -{ - if (GET_CODE (op) != SYMBOL_REF) - return 0; - return SYMBOL_REF_TLS_MODEL (op); -} - -int -tgd_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_GLOBAL_DYNAMIC; -} - -int -tld_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_DYNAMIC; -} - -int -tie_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_INITIAL_EXEC; -} - -int -tle_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_EXEC; -} - -/* Returns 1 if OP is either a symbol reference or a sum of a symbol - reference and a constant. */ - -int -symbolic_operand (register rtx op, enum machine_mode mode) -{ - enum machine_mode omode = GET_MODE (op); - - if (omode != mode && omode != VOIDmode && mode != VOIDmode) - return 0; - - switch (GET_CODE (op)) + /* Fixup TLS cases. */ + if (TARGET_HAVE_TLS + && CONSTANT_P (operands[1]) + && GET_CODE (operands[1]) != HIGH + && sparc_tls_referenced_p (operands [1])) { - case SYMBOL_REF: - return !SYMBOL_REF_TLS_MODEL (op); + rtx sym = operands[1]; + rtx addend = NULL; - case LABEL_REF: - return 1; + if (GET_CODE (sym) == CONST && GET_CODE (XEXP (sym, 0)) == PLUS) + { + addend = XEXP (XEXP (sym, 0), 1); + sym = XEXP (XEXP (sym, 0), 0); + } - case CONST: - op = XEXP (op, 0); - return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF - && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && GET_CODE (XEXP (op, 1)) == CONST_INT); + gcc_assert (SPARC_SYMBOL_REF_TLS_P (sym)); + sym = legitimize_tls_address (sym); + if (addend) + { + sym = gen_rtx_PLUS (mode, sym, addend); + sym = force_operand (sym, operands[0]); + } + operands[1] = sym; + } + + /* Fixup PIC cases. */ + if (flag_pic && CONSTANT_P (operands[1])) + { + if (pic_address_needs_scratch (operands[1])) + operands[1] = legitimize_pic_address (operands[1], mode, 0); + + if (GET_CODE (operands[1]) == LABEL_REF && mode == SImode) + { + emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1])); + return true; + } + + if (GET_CODE (operands[1]) == LABEL_REF && mode == DImode) + { + gcc_assert (TARGET_ARCH64); + emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1])); + return true; + } + + if (symbolic_operand (operands[1], mode)) + { + operands[1] = legitimize_pic_address (operands[1], + mode, + (reload_in_progress ? + operands[0] : + NULL_RTX)); + return false; + } + } + + /* If we are trying to toss an integer constant into FP registers, + or loading a FP or vector constant, force it into memory. */ + if (CONSTANT_P (operands[1]) + && REG_P (operands[0]) + && (SPARC_FP_REG_P (REGNO (operands[0])) + || SCALAR_FLOAT_MODE_P (mode) + || VECTOR_MODE_P (mode))) + { + /* emit_group_store will send such bogosity to us when it is + not storing directly into memory. So fix this up to avoid + crashes in output_constant_pool. */ + if (operands [1] == const0_rtx) + operands[1] = CONST0_RTX (mode); + + /* We can clear FP registers if TARGET_VIS, and always other regs. */ + if ((TARGET_VIS || REGNO (operands[0]) < SPARC_FIRST_FP_REG) + && const_zero_operand (operands[1], mode)) + return false; + + if (REGNO (operands[0]) < SPARC_FIRST_FP_REG + /* We are able to build any SF constant in integer registers + with at most 2 instructions. */ + && (mode == SFmode + /* And any DF constant in integer registers. */ + || (mode == DFmode + && (reload_completed || reload_in_progress)))) + return false; + + operands[1] = force_const_mem (mode, operands[1]); + if (!reload_in_progress) + operands[1] = validize_mem (operands[1]); + return false; + } + + /* Accept non-constants and valid constants unmodified. */ + if (!CONSTANT_P (operands[1]) + || GET_CODE (operands[1]) == HIGH + || input_operand (operands[1], mode)) + return false; + + switch (mode) + { + case QImode: + /* All QImode constants require only one insn, so proceed. */ + break; + + case HImode: + case SImode: + sparc_emit_set_const32 (operands[0], operands[1]); + return true; + + case DImode: + /* input_operand should have filtered out 32-bit mode. */ + sparc_emit_set_const64 (operands[0], operands[1]); + return true; + default: - return 0; + gcc_unreachable (); } + + return false; } -/* Return truth value of statement that OP is a symbolic memory - operand of mode MODE. */ +/* Load OP1, a 32-bit constant, into OP0, a register. + We know it can't be done in one insn when we get + here, the move expander guarantees this. */ -int -symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) != MEM) - return 0; - op = XEXP (op, 0); - return ((GET_CODE (op) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (op)) - || GET_CODE (op) == CONST || GET_CODE (op) == HIGH - || GET_CODE (op) == LABEL_REF); -} - -/* Return truth value of statement that OP is a LABEL_REF of mode MODE. */ - -int -label_ref_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != LABEL_REF) - return 0; - if (GET_MODE (op) != mode) - return 0; - return 1; -} - -/* Return 1 if the operand is an argument used in generating pic references - in either the medium/low or medium/anywhere code models of sparc64. */ - -int -sp64_medium_pic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* Check for (const (minus (symbol_ref:GOT) - (const (minus (label) (pc))))). */ - if (GET_CODE (op) != CONST) - return 0; - op = XEXP (op, 0); - if (GET_CODE (op) != MINUS) - return 0; - if (GET_CODE (XEXP (op, 0)) != SYMBOL_REF) - return 0; - /* ??? Ensure symbol is GOT. */ - if (GET_CODE (XEXP (op, 1)) != CONST) - return 0; - if (GET_CODE (XEXP (XEXP (op, 1), 0)) != MINUS) - return 0; - return 1; -} - -/* Return 1 if the operand is a data segment reference. This includes - the readonly data segment, or in other words anything but the text segment. - This is needed in the medium/anywhere code model on v9. These values - are accessed with EMBMEDANY_BASE_REG. */ - -int -data_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF : - return ! SYMBOL_REF_FUNCTION_P (op); - case PLUS : - /* Assume canonical format of symbol + constant. - Fall through. */ - case CONST : - return data_segment_operand (XEXP (op, 0), VOIDmode); - default : - return 0; - } -} - -/* Return 1 if the operand is a text segment reference. - This is needed in the medium/anywhere code model on v9. */ - -int -text_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case LABEL_REF : - return 1; - case SYMBOL_REF : - return SYMBOL_REF_FUNCTION_P (op); - case PLUS : - /* Assume canonical format of symbol + constant. - Fall through. */ - case CONST : - return text_segment_operand (XEXP (op, 0), VOIDmode); - default : - return 0; - } -} - -/* Return 1 if the operand is either a register or a memory operand that is - not symbolic. */ - -int -reg_or_nonsymb_mem_operand (register rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode)) - return 1; - - return 0; -} - -int -splittable_symbolic_memory_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != MEM) - return 0; - if (! symbolic_operand (XEXP (op, 0), Pmode)) - return 0; - return 1; -} - -int -splittable_immediate_memory_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != MEM) - return 0; - if (! immediate_operand (XEXP (op, 0), Pmode)) - return 0; - return 1; -} - -/* Return truth value of whether OP is EQ or NE. */ - -int -eq_or_neq (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == EQ || GET_CODE (op) == NE); -} - -/* Return 1 if this is a comparison operator, but not an EQ, NE, GEU, - or LTU for non-floating-point. We handle those specially. */ - -int -normal_comp_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - if (GET_RTX_CLASS (code) != '<') - return 0; - - if (GET_MODE (XEXP (op, 0)) == CCFPmode - || GET_MODE (XEXP (op, 0)) == CCFPEmode) - return 1; - - return (code != NE && code != EQ && code != GEU && code != LTU); -} - -/* Return 1 if this is a comparison operator. This allows the use of - MATCH_OPERATOR to recognize all the branch insns. */ - -int -noov_compare_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - if (GET_RTX_CLASS (code) != '<') - return 0; - - if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode - || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) - /* These are the only branches which work with CC_NOOVmode. */ - return (code == EQ || code == NE || code == GE || code == LT); - return 1; -} - -/* Return 1 if this is a 64-bit comparison operator. This allows the use of - MATCH_OPERATOR to recognize all the branch insns. */ - -int -noov_compare64_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - if (! TARGET_V9) - return 0; - - if (GET_RTX_CLASS (code) != '<') - return 0; - - if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) - /* These are the only branches which work with CCX_NOOVmode. */ - return (code == EQ || code == NE || code == GE || code == LT); - return (GET_MODE (XEXP (op, 0)) == CCXmode); -} - -/* Nonzero if OP is a comparison operator suitable for use in v9 - conditional move or branch on register contents instructions. */ - -int -v9_regcmp_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - if (GET_RTX_CLASS (code) != '<') - return 0; - - return v9_regcmp_p (code); -} - -/* Return 1 if this is a SIGN_EXTEND or ZERO_EXTEND operation. */ - -int -extend_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND; -} - -/* Return nonzero if OP is an operator of mode MODE which can set - the condition codes explicitly. We do not include PLUS and MINUS - because these require CC_NOOVmode, which we handle explicitly. */ - -int -cc_arithop (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == AND - || GET_CODE (op) == IOR - || GET_CODE (op) == XOR) - return 1; - - return 0; -} - -/* Return nonzero if OP is an operator of mode MODE which can bitwise - complement its second operand and set the condition codes explicitly. */ - -int -cc_arithopn (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* XOR is not here because combine canonicalizes (xor (not ...) ...) - and (xor ... (not ...)) to (not (xor ...)). */ - return (GET_CODE (op) == AND - || GET_CODE (op) == IOR); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 13 bit immediate field. This is an acceptable SImode operand for - most 3 address instructions. */ - -int -arith_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - if (GET_CODE (op) != CONST_INT) - return 0; - return SMALL_INT32 (op); -} - -/* Return true if OP is a constant 4096 */ - -int -arith_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return 0; - else - return INTVAL (op) == 4096; -} - -/* Return true if OP is suitable as second operand for add/sub */ - -int -arith_add_operand (rtx op, enum machine_mode mode) -{ - return arith_operand (op, mode) || arith_4096_operand (op, mode); -} - -/* Return true if OP is a CONST_INT or a CONST_DOUBLE which can fit in the - immediate field of OR and XOR instructions. Used for 64-bit - constant formation patterns. */ -int -const64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT - && SPARC_SIMM13_P (INTVAL (op))) -#if HOST_BITS_PER_WIDE_INT != 64 - || (GET_CODE (op) == CONST_DOUBLE - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)) - && (CONST_DOUBLE_HIGH (op) == - ((CONST_DOUBLE_LOW (op) & 0x80000000) != 0 ? - (HOST_WIDE_INT)-1 : 0))) -#endif - ); -} - -/* The same, but only for sethi instructions. */ -int -const64_high_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT - && (INTVAL (op) & ~(HOST_WIDE_INT)0x3ff) != 0 - && SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode)) - ) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & ~(HOST_WIDE_INT)0x3ff) != 0 - && SPARC_SETHI_P (CONST_DOUBLE_LOW (op)))); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 11 bit immediate field. This is an acceptable SImode operand for - the movcc instructions. */ - -int -arith11_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SPARC_SIMM11_P (INTVAL (op)))); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 10 bit immediate field. This is an acceptable SImode operand for - the movrcc instructions. */ - -int -arith10_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SPARC_SIMM10_P (INTVAL (op)))); -} - -/* Return true if OP is a register, is a CONST_INT that fits in a 13 bit - immediate field, or is a CONST_DOUBLE whose both parts fit in a 13 bit - immediate field. - v9: Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in a 13 bit immediate field. This is an acceptable DImode operand - for most 3 address instructions. */ - -int -arith_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SMALL_INT (op)) - || (! TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x1000) < 0x2000 - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_HIGH (op) + 0x1000) < 0x2000) - || (TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x1000) < 0x2000 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x1000) == 0x1000) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x1000) == 0)))); -} - -/* Return true if OP is a constant 4096 for DImode on ARCH64 */ - -int -arith_double_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (TARGET_ARCH64 && - ((GET_CODE (op) == CONST_INT && INTVAL (op) == 4096) || - (GET_CODE (op) == CONST_DOUBLE && - CONST_DOUBLE_LOW (op) == 4096 && - CONST_DOUBLE_HIGH (op) == 0))); -} - -/* Return true if OP is suitable as second operand for add/sub in DImode */ - -int -arith_double_add_operand (rtx op, enum machine_mode mode) -{ - return arith_double_operand (op, mode) || arith_double_4096_operand (op, mode); -} - -/* Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in an 11 bit immediate field. This is an acceptable DImode - operand for the movcc instructions. */ -/* ??? Replace with arith11_operand? */ - -int -arith11_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x400) < 0x800 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x400) == 0x400) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x400) == 0))) - || (GET_CODE (op) == CONST_INT - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x400) < 0x800)); -} - -/* Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in an 10 bit immediate field. This is an acceptable DImode - operand for the movrcc instructions. */ -/* ??? Replace with arith10_operand? */ - -int -arith10_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned) (CONST_DOUBLE_LOW (op) + 0x200) < 0x400 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x200) == 0x200) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x200) == 0))) - || (GET_CODE (op) == CONST_INT - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x200) < 0x400)); -} - -/* Return truth value of whether OP is an integer which fits the - range constraining immediate operands in most three-address insns, - which have a 13 bit immediate field. */ - -int -small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && SMALL_INT (op)); -} - -int -small_int_or_double (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT && SMALL_INT (op)) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)))); -} - -/* Recognize operand values for the umul instruction. That instruction sign - extends immediate values just like all other sparc instructions, but - interprets the extended result as an unsigned number. */ - -int -uns_small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ -#if HOST_BITS_PER_WIDE_INT > 32 - /* All allowed constants will fit a CONST_INT. */ - return (GET_CODE (op) == CONST_INT - && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000) - || (INTVAL (op) >= 0xFFFFF000 - && INTVAL (op) <= 0xFFFFFFFF))); -#else - return ((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000)); -#endif -} - -int -uns_arith_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) || uns_small_int (op, mode); -} - -/* Return truth value of statement that OP is a call-clobbered register. */ -int -clobbered_register (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == REG && call_used_regs[REGNO (op)]); -} - -/* Return 1 if OP is a valid operand for the source of a move insn. */ - -int -input_operand (rtx op, enum machine_mode mode) -{ - /* If both modes are non-void they must be the same. */ - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) - return 0; - - /* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and result in 0/1. */ - if (GET_CODE (op) == CONSTANT_P_RTX) - return 1; - - /* Allow any one instruction integer constant, and all CONST_INT - variants when we are working in DImode and !arch64. */ - if (GET_MODE_CLASS (mode) == MODE_INT - && ((GET_CODE (op) == CONST_INT - && (SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode)) - || SPARC_SIMM13_P (INTVAL (op)) - || (mode == DImode - && ! TARGET_ARCH64))) - || (TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && ((CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SETHI_P (CONST_DOUBLE_LOW (op))) - || -#if HOST_BITS_PER_WIDE_INT == 64 - (CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op))) -#else - (SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)) - && (((CONST_DOUBLE_LOW (op) & 0x80000000) == 0 - && CONST_DOUBLE_HIGH (op) == 0) - || (CONST_DOUBLE_HIGH (op) == -1 - && CONST_DOUBLE_LOW (op) & 0x80000000) != 0)) -#endif - )))) - return 1; - - /* If !arch64 and this is a DImode const, allow it so that - the splits can be generated. */ - if (! TARGET_ARCH64 - && mode == DImode - && GET_CODE (op) == CONST_DOUBLE) - return 1; - - if (register_operand (op, mode)) - return 1; - - if (GET_MODE_CLASS (mode) == MODE_FLOAT - && GET_CODE (op) == CONST_DOUBLE) - return 1; - - /* If this is a SUBREG, look inside so that we handle - paradoxical ones. */ - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - /* Check for valid MEM forms. */ - if (GET_CODE (op) == MEM) - return memory_address_p (mode, XEXP (op, 0)); - - return 0; -} - -/* Return 1 if OP is valid for the lhs of a compare insn. */ - -int -compare_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == ZERO_EXTRACT) - return (register_operand (XEXP (op, 0), mode) - && small_int_or_double (XEXP (op, 1), mode) - && small_int_or_double (XEXP (op, 2), mode) - /* This matches cmp_zero_extract. */ - && ((mode == SImode - && ((GET_CODE (XEXP (op, 2)) == CONST_INT - && INTVAL (XEXP (op, 2)) > 19) - || (GET_CODE (XEXP (op, 2)) == CONST_DOUBLE - && CONST_DOUBLE_LOW (XEXP (op, 2)) > 19))) - /* This matches cmp_zero_extract_sp64. */ - || (mode == DImode - && TARGET_ARCH64 - && ((GET_CODE (XEXP (op, 2)) == CONST_INT - && INTVAL (XEXP (op, 2)) > 51) - || (GET_CODE (XEXP (op, 2)) == CONST_DOUBLE - && CONST_DOUBLE_LOW (XEXP (op, 2)) > 51))))); - else - return register_operand (op, mode); -} - - -/* We know it can't be done in one insn when we get here, - the movsi expander guarantees this. */ void sparc_emit_set_const32 (rtx op0, rtx op1) { enum machine_mode mode = GET_MODE (op0); rtx temp; - if (GET_CODE (op1) == CONST_INT) - { - HOST_WIDE_INT value = INTVAL (op1); - - if (SPARC_SETHI_P (value & GET_MODE_MASK (mode)) - || SPARC_SIMM13_P (value)) - abort (); - } - - /* Full 2-insn decomposition is needed. */ if (reload_in_progress || reload_completed) temp = op0; else @@ -1374,20 +1069,15 @@ sparc_emit_set_const32 (rtx op0, rtx op1) if (GET_CODE (op1) == CONST_INT) { + gcc_assert (!small_int_operand (op1, mode) + && !const_high_operand (op1, mode)); + /* Emit them as real moves instead of a HIGH/LO_SUM, this way CSE can see everything and reuse intermediate values if it wants. */ - if (TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64 - && (INTVAL (op1) & 0x80000000) != 0) - emit_insn (gen_rtx_SET - (VOIDmode, temp, - immed_double_const (INTVAL (op1) & ~(HOST_WIDE_INT)0x3ff, - 0, DImode))); - else - emit_insn (gen_rtx_SET (VOIDmode, temp, - GEN_INT (INTVAL (op1) - & ~(HOST_WIDE_INT)0x3ff))); + emit_insn (gen_rtx_SET (VOIDmode, temp, + GEN_INT (INTVAL (op1) + & ~(HOST_WIDE_INT)0x3ff))); emit_insn (gen_rtx_SET (VOIDmode, op0, @@ -1401,17 +1091,16 @@ sparc_emit_set_const32 (rtx op0, rtx op1) gen_rtx_HIGH (mode, op1))); emit_insn (gen_rtx_SET (VOIDmode, op0, gen_rtx_LO_SUM (mode, temp, op1))); - } } - /* Load OP1, a symbolic 64-bit constant, into OP0, a DImode register. - If TEMP is non-zero, we are forbidden to use any other scratch + If TEMP is nonzero, we are forbidden to use any other scratch registers. Otherwise, we are allowed to generate them as needed. Note that TEMP may have TImode if the code model is TARGET_CM_MEDANY or TARGET_CM_EMBMEDANY (see the reload_indi and reload_outdi patterns). */ + void sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) { @@ -1502,10 +1191,8 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) it TImode). Pick the other one to use as our scratch. */ if (rtx_equal_p (temp, op0)) { - if (ti_temp) - temp = gen_rtx_REG (DImode, REGNO (temp) + 1); - else - abort(); + gcc_assert (ti_temp); + temp = gen_rtx_REG (DImode, REGNO (temp) + 1); } temp1 = op0; temp2 = temp; /* op0 is _not_ allowed, see above. */ @@ -1576,10 +1263,8 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) it TImode). Pick the other one to use as our scratch. */ if (rtx_equal_p (temp, op0)) { - if (ti_temp) - temp = gen_rtx_REG (DImode, REGNO (temp) + 1); - else - abort(); + gcc_assert (ti_temp); + temp = gen_rtx_REG (DImode, REGNO (temp) + 1); } temp1 = op0; temp2 = temp; /* op0 is _not_ allowed, see above. */ @@ -1608,56 +1293,52 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) break; default: - abort(); + gcc_unreachable (); } } +#if HOST_BITS_PER_WIDE_INT == 32 +void +sparc_emit_set_const64 (rtx op0 ATTRIBUTE_UNUSED, rtx op1 ATTRIBUTE_UNUSED) +{ + gcc_unreachable (); +} +#else /* These avoid problems when cross compiling. If we do not go through all this hair then the optimizer will see invalid REG_EQUAL notes or in some cases none at all. */ -static void sparc_emit_set_safe_HIGH64 (rtx, HOST_WIDE_INT); +static rtx gen_safe_HIGH64 (rtx, HOST_WIDE_INT); static rtx gen_safe_SET64 (rtx, HOST_WIDE_INT); static rtx gen_safe_OR64 (rtx, HOST_WIDE_INT); static rtx gen_safe_XOR64 (rtx, HOST_WIDE_INT); -#if HOST_BITS_PER_WIDE_INT == 64 -#define GEN_HIGHINT64(__x) GEN_INT ((__x) & ~(HOST_WIDE_INT)0x3ff) -#define GEN_INT64(__x) GEN_INT (__x) -#else -#define GEN_HIGHINT64(__x) \ - immed_double_const ((__x) & ~(HOST_WIDE_INT)0x3ff, 0, DImode) -#define GEN_INT64(__x) \ - immed_double_const ((__x) & 0xffffffff, \ - ((__x) & 0x80000000 ? -1 : 0), DImode) -#endif - /* The optimizer is not to assume anything about exactly which bits are set for a HIGH, they are unspecified. Unfortunately this leads to many missed optimizations during CSE. We mask out the non-HIGH bits, and matches a plain movdi, to alleviate this problem. */ -static void -sparc_emit_set_safe_HIGH64 (rtx dest, HOST_WIDE_INT val) +static rtx +gen_safe_HIGH64 (rtx dest, HOST_WIDE_INT val) { - emit_insn (gen_rtx_SET (VOIDmode, dest, GEN_HIGHINT64 (val))); + return gen_rtx_SET (VOIDmode, dest, GEN_INT (val & ~(HOST_WIDE_INT)0x3ff)); } static rtx gen_safe_SET64 (rtx dest, HOST_WIDE_INT val) { - return gen_rtx_SET (VOIDmode, dest, GEN_INT64 (val)); + return gen_rtx_SET (VOIDmode, dest, GEN_INT (val)); } static rtx gen_safe_OR64 (rtx src, HOST_WIDE_INT val) { - return gen_rtx_IOR (DImode, src, GEN_INT64 (val)); + return gen_rtx_IOR (DImode, src, GEN_INT (val)); } static rtx gen_safe_XOR64 (rtx src, HOST_WIDE_INT val) { - return gen_rtx_XOR (DImode, src, GEN_INT64 (val)); + return gen_rtx_XOR (DImode, src, GEN_INT (val)); } /* Worker routines for 64-bit constant formation on arch64. @@ -1682,7 +1363,7 @@ sparc_emit_set_const64_quick1 (rtx op0, rtx temp, else high_bits = low_bits; - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if (!is_neg) { emit_insn (gen_rtx_SET (VOIDmode, op0, @@ -1721,7 +1402,7 @@ sparc_emit_set_const64_quick2 (rtx op0, rtx temp, if ((high_bits & 0xfffffc00) != 0) { - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if ((high_bits & ~0xfffffc00) != 0) emit_insn (gen_rtx_SET (VOIDmode, op0, gen_safe_OR64 (temp, (high_bits & 0x3ff)))); @@ -1765,7 +1446,7 @@ sparc_emit_set_const64_longway (rtx op0, rtx temp, if ((high_bits & 0xfffffc00) != 0) { - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if ((high_bits & ~0xfffffc00) != 0) emit_insn (gen_rtx_SET (VOIDmode, sub_temp, @@ -1789,7 +1470,7 @@ sparc_emit_set_const64_longway (rtx op0, rtx temp, gen_rtx_ASHIFT (DImode, sub_temp, GEN_INT (32)))); - sparc_emit_set_safe_HIGH64 (temp2, low_bits); + emit_insn (gen_safe_HIGH64 (temp2, low_bits)); if ((low_bits & ~0xfffffc00) != 0) { emit_insn (gen_rtx_SET (VOIDmode, temp3, @@ -1896,9 +1577,7 @@ analyze_64bit_constant (unsigned HOST_WIDE_INT high_bits, } /* If there are no bits set this should have gone out as one instruction! */ - if (lowest_bit_set == -1 - || highest_bit_set == -1) - abort (); + gcc_assert (lowest_bit_set != -1 && highest_bit_set != -1); all_bits_between_are_set = 1; for (i = lowest_bit_set; i <= highest_bit_set; i++) { @@ -1968,8 +1647,7 @@ create_simple_focus_bits (unsigned HOST_WIDE_INT high_bits, lo = 0; hi = ((high_bits >> (lowest_bit_set - 32)) << shift); } - if (hi & lo) - abort (); + gcc_assert (! (hi & lo)); return (hi | lo); } @@ -1986,22 +1664,14 @@ sparc_emit_set_const64 (rtx op0, rtx op1) rtx temp = 0; /* Sanity check that we know what we are working with. */ - if (! TARGET_ARCH64) - abort (); - - if (GET_CODE (op0) != SUBREG) - { - if (GET_CODE (op0) != REG - || (REGNO (op0) >= SPARC_FIRST_FP_REG - && REGNO (op0) <= SPARC_LAST_V9_FP_REG)) - abort (); - } + gcc_assert (TARGET_ARCH64 + && (GET_CODE (op0) == SUBREG + || (REG_P (op0) && ! SPARC_FP_REG_P (REGNO (op0))))); if (reload_in_progress || reload_completed) temp = op0; - if (GET_CODE (op1) != CONST_DOUBLE - && GET_CODE (op1) != CONST_INT) + if (GET_CODE (op1) != CONST_INT) { sparc_emit_set_symbolic_const64 (op0, op1, temp); return; @@ -2010,28 +1680,8 @@ sparc_emit_set_const64 (rtx op0, rtx op1) if (! temp) temp = gen_reg_rtx (DImode); - if (GET_CODE (op1) == CONST_DOUBLE) - { -#if HOST_BITS_PER_WIDE_INT == 64 - high_bits = (CONST_DOUBLE_LOW (op1) >> 32) & 0xffffffff; - low_bits = CONST_DOUBLE_LOW (op1) & 0xffffffff; -#else - high_bits = CONST_DOUBLE_HIGH (op1); - low_bits = CONST_DOUBLE_LOW (op1); -#endif - } - else - { -#if HOST_BITS_PER_WIDE_INT == 64 - high_bits = ((INTVAL (op1) >> 32) & 0xffffffff); - low_bits = (INTVAL (op1) & 0xffffffff); -#else - high_bits = ((INTVAL (op1) < 0) ? - 0xffffffff : - 0x00000000); - low_bits = INTVAL (op1); -#endif - } + high_bits = ((INTVAL (op1) >> 32) & 0xffffffff); + low_bits = (INTVAL (op1) & 0xffffffff); /* low_bits bits 0 --> 31 high_bits bits 32 --> 63 */ @@ -2070,8 +1720,8 @@ sparc_emit_set_const64 (rtx op0, rtx op1) else if (lowest_bit_set == 0) shift = -(63 - highest_bit_set); - if (! SPARC_SIMM13_P (the_const)) - abort (); + gcc_assert (SPARC_SIMM13_P (the_const)); + gcc_assert (shift != 0); emit_insn (gen_safe_SET64 (temp, the_const)); if (shift > 0) @@ -2086,8 +1736,6 @@ sparc_emit_set_const64 (rtx op0, rtx op1) gen_rtx_LSHIFTRT (DImode, temp, GEN_INT (-shift)))); - else - abort (); return; } @@ -2103,10 +1751,10 @@ sparc_emit_set_const64 (rtx op0, rtx op1) create_simple_focus_bits (high_bits, low_bits, lowest_bit_set, 10); - if (! SPARC_SETHI_P (focus_bits)) - abort (); + gcc_assert (SPARC_SETHI_P (focus_bits)); + gcc_assert (lowest_bit_set != 10); - sparc_emit_set_safe_HIGH64 (temp, focus_bits); + emit_insn (gen_safe_HIGH64 (temp, focus_bits)); /* If lowest_bit_set == 10 then a sethi alone could have done it. */ if (lowest_bit_set < 10) @@ -2119,8 +1767,6 @@ sparc_emit_set_const64 (rtx op0, rtx op1) op0, gen_rtx_ASHIFT (DImode, temp, GEN_INT (lowest_bit_set - 10)))); - else - abort (); return; } @@ -2163,26 +1809,20 @@ sparc_emit_set_const64 (rtx op0, rtx op1) || (((~high_bits) & 0xffffffff) == 0xffffffff && ((~low_bits) & 0x80000000) != 0)) { - int fast_int = (~low_bits & 0xffffffff); + unsigned HOST_WIDE_INT fast_int = (~low_bits & 0xffffffff); if ((SPARC_SETHI_P (fast_int) && (~high_bits & 0xffffffff) == 0) || SPARC_SIMM13_P (fast_int)) emit_insn (gen_safe_SET64 (temp, fast_int)); else - sparc_emit_set_const64 (temp, GEN_INT64 (fast_int)); + sparc_emit_set_const64 (temp, GEN_INT (fast_int)); } else { rtx negated_const; -#if HOST_BITS_PER_WIDE_INT == 64 negated_const = GEN_INT (((~low_bits) & 0xfffffc00) | (((HOST_WIDE_INT)((~high_bits) & 0xffffffff))<<32)); -#else - negated_const = immed_double_const ((~low_bits) & 0xfffffc00, - (~high_bits) & 0xffffffff, - DImode); -#endif sparc_emit_set_const64 (temp, negated_const); } @@ -2218,9 +1858,7 @@ sparc_emit_set_const64 (rtx op0, rtx op1) lowest_bit_set, 0); /* We can't get here in this state. */ - if (highest_bit_set < 32 - || lowest_bit_set >= 32) - abort (); + gcc_assert (highest_bit_set >= 32 && lowest_bit_set < 32); /* So what we know is that the set bits straddle the middle of the 64-bit word. */ @@ -2249,6 +1887,7 @@ sparc_emit_set_const64 (rtx op0, rtx op1) #endif sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits); } +#endif /* HOST_BITS_PER_WIDE_INT == 32 */ /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point, @@ -2282,7 +1921,7 @@ select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED) return CCFPEmode; default: - abort (); + gcc_unreachable (); } } else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS @@ -2306,11 +1945,20 @@ select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED) return the rtx for the cc reg in the proper mode. */ rtx -gen_compare_reg (enum rtx_code code, rtx x, rtx y) +gen_compare_reg (enum rtx_code code) { + rtx x = sparc_compare_op0; + rtx y = sparc_compare_op1; enum machine_mode mode = SELECT_CC_MODE (code, x, y); rtx cc_reg; + if (sparc_compare_emitted != NULL_RTX) + { + cc_reg = sparc_compare_emitted; + sparc_compare_emitted = NULL_RTX; + return cc_reg; + } + /* ??? We don't have movcc patterns so we cannot generate pseudo regs for the fcc regs (cse can't tell they're really call clobbered regs and will remove a duplicate comparison even if there is an intervening function @@ -2389,22 +2037,20 @@ gen_compare_reg (enum rtx_code code, rtx x, rtx y) int gen_v9_scc (enum rtx_code compare_code, register rtx *operands) { - rtx temp, op0, op1; - if (! TARGET_ARCH64 && (GET_MODE (sparc_compare_op0) == DImode || GET_MODE (operands[0]) == DImode)) return 0; - op0 = sparc_compare_op0; - op1 = sparc_compare_op1; - /* Try to use the movrCC insns. */ if (TARGET_ARCH64 - && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT - && op1 == const0_rtx + && GET_MODE_CLASS (GET_MODE (sparc_compare_op0)) == MODE_INT + && sparc_compare_op1 == const0_rtx && v9_regcmp_p (compare_code)) { + rtx op0 = sparc_compare_op0; + rtx temp; + /* Special case for op0 != 0. This can be done with one instruction if operands[0] == sparc_compare_op0. */ @@ -2447,7 +2093,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) } else { - operands[1] = gen_compare_reg (compare_code, op0, op1); + operands[1] = gen_compare_reg (compare_code); switch (GET_MODE (operands[1])) { @@ -2457,7 +2103,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) case CCFPmode : break; default : - abort (); + gcc_unreachable (); } emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx)); emit_insn (gen_rtx_SET (VOIDmode, operands[0], @@ -2477,6 +2123,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) void emit_v9_brxx_insn (enum rtx_code code, rtx op0, rtx label) { + gcc_assert (sparc_compare_emitted == NULL_RTX); emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, gen_rtx_IF_THEN_ELSE (VOIDmode, @@ -2511,8 +2158,7 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) int i; /* We only expect to be called for conversions, unary, and binary ops. */ - if (nargs < 2 || nargs > 3) - abort (); + gcc_assert (nargs == 2 || nargs == 3); for (i = 0; i < nargs; ++i) { @@ -2575,8 +2221,7 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) { rtx ret; - if (nargs != 2) - abort (); + gcc_assert (nargs == 2); ret = emit_library_call_value (func_sym, operands[0], LCT_NORMAL, GET_MODE (operands[0]), 1, @@ -2609,7 +2254,7 @@ emit_soft_tfmode_binop (enum rtx_code code, rtx *operands) func = "_Qp_div"; break; default: - abort (); + gcc_unreachable (); } emit_soft_tfmode_libcall (func, 3, operands); @@ -2620,14 +2265,8 @@ emit_soft_tfmode_unop (enum rtx_code code, rtx *operands) { const char *func; - switch (code) - { - case SQRT: - func = "_Qp_sqrt"; - break; - default: - abort (); - } + gcc_assert (code == SQRT); + func = "_Qp_sqrt"; emit_soft_tfmode_libcall (func, 2, operands); } @@ -2649,7 +2288,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_dtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2663,7 +2302,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtod"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2677,7 +2316,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_xtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2691,7 +2330,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_uxtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2705,7 +2344,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtox"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2719,12 +2358,12 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtoux"; break; default: - abort (); + gcc_unreachable (); } break; default: - abort (); + gcc_unreachable (); } emit_soft_tfmode_libcall (func, 2, operands); @@ -2738,7 +2377,7 @@ emit_hard_tfmode_operation (enum rtx_code code, rtx *operands) { rtx op, dest; - if (GET_RTX_CLASS (code) == '1') + if (GET_RTX_CLASS (code) == RTX_UNARY) { operands[1] = force_reg (GET_MODE (operands[1]), operands[1]); op = gen_rtx_fmt_e (code, GET_MODE (operands[0]), operands[1]); @@ -2789,14 +2428,6 @@ emit_tfmode_cvt (enum rtx_code code, rtx *operands) emit_soft_tfmode_cvt (code, operands); } -/* Return nonzero if a return peephole merging return with - setting of output register is ok. */ -int -leaf_return_peephole_ok (void) -{ - return (actual_fsize == 0); -} - /* Return nonzero if a branch/jump/call instruction will be emitting nop into its delay slot. */ @@ -2816,133 +2447,8 @@ empty_delay_slot (rtx insn) return 1; } -/* Return nonzero if TRIAL can go into the function epilogue's - delay slot. SLOT is the slot we are trying to fill. */ - -int -eligible_for_epilogue_delay (rtx trial, int slot) -{ - rtx pat, src; - - if (slot >= 1) - return 0; - - if (GET_CODE (trial) != INSN || GET_CODE (PATTERN (trial)) != SET) - return 0; - - if (get_attr_length (trial) != 1) - return 0; - - /* If there are any call-saved registers, we should scan TRIAL if it - does not reference them. For now just make it easy. */ - if (num_gfregs) - return 0; - - /* If the function uses __builtin_eh_return, the eh_return machinery - occupies the delay slot. */ - if (current_function_calls_eh_return) - return 0; - - /* In the case of a true leaf function, anything can go into the delay slot. - A delay slot only exists however if the frame size is zero, otherwise - we will put an insn to adjust the stack after the return. */ - if (current_function_uses_only_leaf_regs) - { - if (leaf_return_peephole_ok ()) - return ((get_attr_in_uncond_branch_delay (trial) - == IN_BRANCH_DELAY_TRUE)); - return 0; - } - - pat = PATTERN (trial); - - /* Otherwise, only operations which can be done in tandem with - a `restore' or `return' insn can go into the delay slot. */ - if (GET_CODE (SET_DEST (pat)) != REG - || REGNO (SET_DEST (pat)) < 24) - return 0; - - /* If this instruction sets up floating point register and we have a return - instruction, it can probably go in. But restore will not work - with FP_REGS. */ - if (REGNO (SET_DEST (pat)) >= 32) - { - if (TARGET_V9 && ! epilogue_renumber (&pat, 1) - && (get_attr_in_uncond_branch_delay (trial) == IN_BRANCH_DELAY_TRUE)) - return 1; - return 0; - } - - /* The set of insns matched here must agree precisely with the set of - patterns paired with a RETURN in sparc.md. */ - - src = SET_SRC (pat); - - /* This matches "*return_[qhs]i" or even "*return_di" on TARGET_ARCH64. */ - if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT - && arith_operand (src, GET_MODE (src))) - { - if (TARGET_ARCH64) - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); - else - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode); - } - - /* This matches "*return_di". */ - else if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT - && arith_double_operand (src, GET_MODE (src))) - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); - - /* This matches "*return_sf_no_fpu". */ - else if (! TARGET_FPU && restore_operand (SET_DEST (pat), SFmode) - && register_operand (src, SFmode)) - return 1; - - /* If we have return instruction, anything that does not use - local or output registers and can go into a delay slot wins. */ - else if (TARGET_V9 && ! epilogue_renumber (&pat, 1) - && (get_attr_in_uncond_branch_delay (trial) == IN_BRANCH_DELAY_TRUE)) - return 1; - - /* This matches "*return_addsi". */ - else if (GET_CODE (src) == PLUS - && arith_operand (XEXP (src, 0), SImode) - && arith_operand (XEXP (src, 1), SImode) - && (register_operand (XEXP (src, 0), SImode) - || register_operand (XEXP (src, 1), SImode))) - return 1; - - /* This matches "*return_adddi". */ - else if (GET_CODE (src) == PLUS - && arith_double_operand (XEXP (src, 0), DImode) - && arith_double_operand (XEXP (src, 1), DImode) - && (register_operand (XEXP (src, 0), DImode) - || register_operand (XEXP (src, 1), DImode))) - return 1; - - /* This can match "*return_losum_[sd]i". - Catch only some cases, so that return_losum* don't have - to be too big. */ - else if (GET_CODE (src) == LO_SUM - && ! TARGET_CM_MEDMID - && ((register_operand (XEXP (src, 0), SImode) - && immediate_operand (XEXP (src, 1), SImode)) - || (TARGET_ARCH64 - && register_operand (XEXP (src, 0), DImode) - && immediate_operand (XEXP (src, 1), DImode)))) - return 1; - - /* sll{,x} reg,1,reg2 is add reg,reg,reg2 as well. */ - else if (GET_CODE (src) == ASHIFT - && (register_operand (XEXP (src, 0), SImode) - || register_operand (XEXP (src, 0), DImode)) - && XEXP (src, 1) == const1_rtx) - return 1; - - return 0; -} - /* Return nonzero if TRIAL can go into the call delay slot. */ + int tls_call_delay (rtx trial) { @@ -2976,13 +2482,138 @@ tls_call_delay (rtx trial) return 1; } -/* Return nonzero if TRIAL can go into the sibling call +/* Return nonzero if TRIAL, an insn, can be combined with a 'restore' + instruction. RETURN_P is true if the v9 variant 'return' is to be + considered in the test too. + + TRIAL must be a SET whose destination is a REG appropriate for the + 'restore' instruction or, if RETURN_P is true, for the 'return' + instruction. */ + +static int +eligible_for_restore_insn (rtx trial, bool return_p) +{ + rtx pat = PATTERN (trial); + rtx src = SET_SRC (pat); + + /* The 'restore src,%g0,dest' pattern for word mode and below. */ + if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT + && arith_operand (src, GET_MODE (src))) + { + if (TARGET_ARCH64) + return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); + else + return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode); + } + + /* The 'restore src,%g0,dest' pattern for double-word mode. */ + else if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT + && arith_double_operand (src, GET_MODE (src))) + return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); + + /* The 'restore src,%g0,dest' pattern for float if no FPU. */ + else if (! TARGET_FPU && register_operand (src, SFmode)) + return 1; + + /* The 'restore src,%g0,dest' pattern for double if no FPU. */ + else if (! TARGET_FPU && TARGET_ARCH64 && register_operand (src, DFmode)) + return 1; + + /* If we have the 'return' instruction, anything that does not use + local or output registers and can go into a delay slot wins. */ + else if (return_p && TARGET_V9 && ! epilogue_renumber (&pat, 1) + && (get_attr_in_uncond_branch_delay (trial) + == IN_UNCOND_BRANCH_DELAY_TRUE)) + return 1; + + /* The 'restore src1,src2,dest' pattern for SImode. */ + else if (GET_CODE (src) == PLUS + && register_operand (XEXP (src, 0), SImode) + && arith_operand (XEXP (src, 1), SImode)) + return 1; + + /* The 'restore src1,src2,dest' pattern for DImode. */ + else if (GET_CODE (src) == PLUS + && register_operand (XEXP (src, 0), DImode) + && arith_double_operand (XEXP (src, 1), DImode)) + return 1; + + /* The 'restore src1,%lo(src2),dest' pattern. */ + else if (GET_CODE (src) == LO_SUM + && ! TARGET_CM_MEDMID + && ((register_operand (XEXP (src, 0), SImode) + && immediate_operand (XEXP (src, 1), SImode)) + || (TARGET_ARCH64 + && register_operand (XEXP (src, 0), DImode) + && immediate_operand (XEXP (src, 1), DImode)))) + return 1; + + /* The 'restore src,src,dest' pattern. */ + else if (GET_CODE (src) == ASHIFT + && (register_operand (XEXP (src, 0), SImode) + || register_operand (XEXP (src, 0), DImode)) + && XEXP (src, 1) == const1_rtx) + return 1; + + return 0; +} + +/* Return nonzero if TRIAL can go into the function return's + delay slot. */ + +int +eligible_for_return_delay (rtx trial) +{ + rtx pat; + + if (GET_CODE (trial) != INSN || GET_CODE (PATTERN (trial)) != SET) + return 0; + + if (get_attr_length (trial) != 1) + return 0; + + /* If there are any call-saved registers, we should scan TRIAL if it + does not reference them. For now just make it easy. */ + if (num_gfregs) + return 0; + + /* If the function uses __builtin_eh_return, the eh_return machinery + occupies the delay slot. */ + if (current_function_calls_eh_return) + return 0; + + /* In the case of a true leaf function, anything can go into the slot. */ + if (sparc_leaf_function_p) + return get_attr_in_uncond_branch_delay (trial) + == IN_UNCOND_BRANCH_DELAY_TRUE; + + pat = PATTERN (trial); + + /* Otherwise, only operations which can be done in tandem with + a `restore' or `return' insn can go into the delay slot. */ + if (GET_CODE (SET_DEST (pat)) != REG + || (REGNO (SET_DEST (pat)) >= 8 && REGNO (SET_DEST (pat)) < 24)) + return 0; + + /* If this instruction sets up floating point register and we have a return + instruction, it can probably go in. But restore will not work + with FP_REGS. */ + if (REGNO (SET_DEST (pat)) >= 32) + return (TARGET_V9 + && ! epilogue_renumber (&pat, 1) + && (get_attr_in_uncond_branch_delay (trial) + == IN_UNCOND_BRANCH_DELAY_TRUE)); + + return eligible_for_restore_insn (trial, true); +} + +/* Return nonzero if TRIAL can go into the sibling call's delay slot. */ int eligible_for_sibcall_delay (rtx trial) { - rtx pat, src; + rtx pat; if (GET_CODE (trial) != INSN || GET_CODE (PATTERN (trial)) != SET) return 0; @@ -2992,11 +2623,11 @@ eligible_for_sibcall_delay (rtx trial) pat = PATTERN (trial); - if (current_function_uses_only_leaf_regs) + if (sparc_leaf_function_p) { /* If the tail call is done using the call instruction, we have to restore %o7 in the delay slot. */ - if ((TARGET_ARCH64 && ! TARGET_CM_MEDLOW) || flag_pic) + if (LEAF_SIBCALL_SLOT_RESERVED_P) return 0; /* %g1 is used to build the function address */ @@ -3009,7 +2640,7 @@ eligible_for_sibcall_delay (rtx trial) /* Otherwise, only operations which can be done in tandem with a `restore' insn can go into the delay slot. */ if (GET_CODE (SET_DEST (pat)) != REG - || REGNO (SET_DEST (pat)) < 24 + || (REGNO (SET_DEST (pat)) >= 8 && REGNO (SET_DEST (pat)) < 24) || REGNO (SET_DEST (pat)) >= 32) return 0; @@ -3018,89 +2649,7 @@ eligible_for_sibcall_delay (rtx trial) if (reg_mentioned_p (gen_rtx_REG (Pmode, 15), pat)) return 0; - src = SET_SRC (pat); - - if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT - && arith_operand (src, GET_MODE (src))) - { - if (TARGET_ARCH64) - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); - else - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode); - } - - else if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT - && arith_double_operand (src, GET_MODE (src))) - return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode); - - else if (! TARGET_FPU && restore_operand (SET_DEST (pat), SFmode) - && register_operand (src, SFmode)) - return 1; - - else if (GET_CODE (src) == PLUS - && arith_operand (XEXP (src, 0), SImode) - && arith_operand (XEXP (src, 1), SImode) - && (register_operand (XEXP (src, 0), SImode) - || register_operand (XEXP (src, 1), SImode))) - return 1; - - else if (GET_CODE (src) == PLUS - && arith_double_operand (XEXP (src, 0), DImode) - && arith_double_operand (XEXP (src, 1), DImode) - && (register_operand (XEXP (src, 0), DImode) - || register_operand (XEXP (src, 1), DImode))) - return 1; - - else if (GET_CODE (src) == LO_SUM - && ! TARGET_CM_MEDMID - && ((register_operand (XEXP (src, 0), SImode) - && immediate_operand (XEXP (src, 1), SImode)) - || (TARGET_ARCH64 - && register_operand (XEXP (src, 0), DImode) - && immediate_operand (XEXP (src, 1), DImode)))) - return 1; - - else if (GET_CODE (src) == ASHIFT - && (register_operand (XEXP (src, 0), SImode) - || register_operand (XEXP (src, 0), DImode)) - && XEXP (src, 1) == const1_rtx) - return 1; - - return 0; -} - -static int -check_return_regs (rtx x) -{ - switch (GET_CODE (x)) - { - case REG: - return IN_OR_GLOBAL_P (x); - - case CONST_INT: - case CONST_DOUBLE: - case CONST: - case SYMBOL_REF: - case LABEL_REF: - return 1; - - case SET: - case IOR: - case AND: - case XOR: - case PLUS: - case MINUS: - if (check_return_regs (XEXP (x, 1)) == 0) - return 0; - case NOT: - case NEG: - case MEM: - return check_return_regs (XEXP (x, 0)); - - default: - return 0; - } - + return eligible_for_restore_insn (trial, false); } int @@ -3132,7 +2681,7 @@ reg_unused_after (rtx reg, rtx insn) if (GET_CODE (insn) == CODE_LABEL) return 1; - if (GET_RTX_CLASS (code) == 'i') + if (INSN_P (insn)) { rtx set = single_set (insn); int in_src = set && reg_overlap_mentioned_p (reg, SET_SRC (set)); @@ -3159,6 +2708,7 @@ sparc_cannot_force_const_mem (rtx x) { case CONST_INT: case CONST_DOUBLE: + case CONST_VECTOR: /* Accept all non-symbolic constants. */ return false; @@ -3183,17 +2733,16 @@ sparc_cannot_force_const_mem (rtx x) case UNSPEC: return true; default: - abort (); + gcc_unreachable (); } } -/* The table we use to reference PIC data. */ +/* PIC support. */ +static GTY(()) char pic_helper_symbol_name[256]; +static GTY(()) rtx pic_helper_symbol; +static GTY(()) bool pic_helper_emitted_p = false; static GTY(()) rtx global_offset_table; -/* The function we use to get at it. */ -static GTY(()) rtx get_pc_symbol; -static GTY(()) char get_pc_symbol_name[256]; - /* Ensure that we are not using patterns that are not OK with PIC. */ int @@ -3202,14 +2751,13 @@ check_pic (int i) switch (flag_pic) { case 1: - if (GET_CODE (recog_data.operand[i]) == SYMBOL_REF - || (GET_CODE (recog_data.operand[i]) == CONST - && ! (GET_CODE (XEXP (recog_data.operand[i], 0)) == MINUS - && (XEXP (XEXP (recog_data.operand[i], 0), 0) - == global_offset_table) - && (GET_CODE (XEXP (XEXP (recog_data.operand[i], 0), 1)) - == CONST)))) - abort (); + gcc_assert (GET_CODE (recog_data.operand[i]) != SYMBOL_REF + && (GET_CODE (recog_data.operand[i]) != CONST + || (GET_CODE (XEXP (recog_data.operand[i], 0)) == MINUS + && (XEXP (XEXP (recog_data.operand[i], 0), 0) + == global_offset_table) + && (GET_CODE (XEXP (XEXP (recog_data.operand[i], 0), 1)) + == CONST)))); case 2: default: return 1; @@ -3254,7 +2802,7 @@ legitimate_constant_p (rtx x) /* Offsets of TLS symbols are never valid. Discourage CSE from creating them. */ if (GET_CODE (inner) == PLUS - && tls_symbolic_operand (XEXP (inner, 0))) + && SPARC_SYMBOL_REF_TLS_P (XEXP (inner, 0))) return false; break; @@ -3265,10 +2813,17 @@ legitimate_constant_p (rtx x) /* Floating point constants are generally not ok. The only exception is 0.0 in VIS. */ if (TARGET_VIS - && (GET_MODE (x) == SFmode - || GET_MODE (x) == DFmode - || GET_MODE (x) == TFmode) - && fp_zero_operand (x, GET_MODE (x))) + && SCALAR_FLOAT_MODE_P (GET_MODE (x)) + && const_zero_operand (x, GET_MODE (x))) + return true; + + return false; + + case CONST_VECTOR: + /* Vector constants are generally not ok. + The only exception is 0 in VIS. */ + if (TARGET_VIS + && const_zero_operand (x, GET_MODE (x))) return true; return false; @@ -3314,10 +2869,10 @@ legitimate_pic_operand_p (rtx x) { if (pic_address_needs_scratch (x)) return false; - if (tls_symbolic_operand (x) + if (SPARC_SYMBOL_REF_TLS_P (x) || (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS - && tls_symbolic_operand (XEXP (XEXP (x, 0), 0)))) + && SPARC_SYMBOL_REF_TLS_P (XEXP (XEXP (x, 0), 0)))) return false; return true; } @@ -3355,7 +2910,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) && GET_CODE (rs2) != SUBREG && GET_CODE (rs2) != LO_SUM && GET_CODE (rs2) != MEM - && !tls_symbolic_operand (rs2) + && ! SPARC_SYMBOL_REF_TLS_P (rs2) && (! symbolic_operand (rs2, VOIDmode) || mode == Pmode) && (GET_CODE (rs2) != CONST_INT || SMALL_INT (rs2))) || ((REG_P (rs1) @@ -3395,7 +2950,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) rs2 = NULL; imm1 = XEXP (rs1, 1); rs1 = XEXP (rs1, 0); - if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1)) + if (! CONSTANT_P (imm1) || SPARC_SYMBOL_REF_TLS_P (rs1)) return 0; } } @@ -3404,7 +2959,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) rs1 = XEXP (addr, 0); imm1 = XEXP (addr, 1); - if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1)) + if (! CONSTANT_P (imm1) || SPARC_SYMBOL_REF_TLS_P (rs1)) return 0; /* We can't allow TFmode in 32-bit mode, because an offset greater @@ -3453,6 +3008,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) /* Construct the SYMBOL_REF for the tls_get_offset function. */ static GTY(()) rtx sparc_tls_symbol; + static rtx sparc_tls_get_addr (void) { @@ -3479,6 +3035,24 @@ sparc_tls_got (void) return temp; } +/* Return 1 if *X is a thread-local symbol. */ + +static int +sparc_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) +{ + return SPARC_SYMBOL_REF_TLS_P (*x); +} + +/* Return 1 if X contains a thread-local symbol. */ + +bool +sparc_tls_referenced_p (rtx x) +{ + if (!TARGET_HAVE_TLS) + return false; + + return for_each_rtx (&x, &sparc_tls_symbol_ref_1, 0); +} /* ADDR contains a thread-local SYMBOL_REF. Generate code to compute this (thread-local) address. */ @@ -3488,8 +3062,7 @@ legitimize_tls_address (rtx addr) { rtx temp1, temp2, temp3, ret, o0, got, insn; - if (no_new_pseudos) - abort (); + gcc_assert (! no_new_pseudos); if (GET_CODE (addr) == SYMBOL_REF) switch (SYMBOL_REF_TLS_MODEL (addr)) @@ -3605,11 +3178,11 @@ legitimize_tls_address (rtx addr) break; default: - abort (); + gcc_unreachable (); } else - abort (); /* for now ... */ + gcc_unreachable (); /* for now ... */ return ret; } @@ -3631,10 +3204,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (! reload_in_progress && ! reload_completed); + reg = gen_reg_rtx (Pmode); } if (flag_pic == 2) @@ -3649,26 +3220,25 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, won't get confused into thinking that these two instructions are loading in the true address of the symbol. If in the future a PIC rtx exists, that should be used instead. */ - if (Pmode == SImode) - { - emit_insn (gen_movsi_high_pic (temp_reg, orig)); - emit_insn (gen_movsi_lo_sum_pic (temp_reg, temp_reg, orig)); - } - else + if (TARGET_ARCH64) { emit_insn (gen_movdi_high_pic (temp_reg, orig)); emit_insn (gen_movdi_lo_sum_pic (temp_reg, temp_reg, orig)); } + else + { + emit_insn (gen_movsi_high_pic (temp_reg, orig)); + emit_insn (gen_movsi_lo_sum_pic (temp_reg, temp_reg, orig)); + } address = temp_reg; } else address = orig; - pic_ref = gen_rtx_MEM (Pmode, - gen_rtx_PLUS (Pmode, - pic_offset_table_rtx, address)); + pic_ref = gen_const_mem (Pmode, + gen_rtx_PLUS (Pmode, + pic_offset_table_rtx, address)); current_function_uses_pic_offset_table = 1; - RTX_UNCHANGING_P (pic_ref) = 1; insn = emit_move_insn (reg, pic_ref); /* Put a REG_EQUAL note on this insn, so that it can be optimized by loop. */ @@ -3686,20 +3256,14 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (! reload_in_progress && ! reload_completed); + reg = gen_reg_rtx (Pmode); } - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else - abort (); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (offset) == CONST_INT) { @@ -3709,7 +3273,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, offset = force_reg (Pmode, offset); else /* If we reach here, then something is seriously wrong. */ - abort (); + gcc_unreachable (); } return gen_rtx_PLUS (Pmode, base, offset); } @@ -3751,7 +3315,7 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (x != orig_x && legitimate_address_p (mode, x, FALSE)) return x; - if (tls_symbolic_operand (x)) + if (SPARC_SYMBOL_REF_TLS_P (x)) x = legitimize_tls_address (x); else if (flag_pic) x = legitimize_pic_address (x, mode, 0); @@ -3768,41 +3332,57 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) return x; } -/* Emit special PIC prologues. */ +/* Emit the special PIC helper function. */ -void -load_pic_register (void) +static void +emit_pic_helper (void) +{ + const char *pic_name = reg_names[REGNO (pic_offset_table_rtx)]; + int align; + + switch_to_section (text_section); + + align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); + if (align > 0) + ASM_OUTPUT_ALIGN (asm_out_file, align); + ASM_OUTPUT_LABEL (asm_out_file, pic_helper_symbol_name); + if (flag_delayed_branch) + fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n", + pic_name, pic_name); + else + fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n", + pic_name, pic_name); + + pic_helper_emitted_p = true; +} + +/* Emit code to load the PIC register. */ + +static void +load_pic_register (bool delay_pic_helper) { - /* Labels to get the PC in the prologue of this function. */ int orig_flag_pic = flag_pic; - if (! flag_pic) - abort (); - - /* If we haven't emitted the special get_pc helper function, do so now. */ - if (get_pc_symbol_name[0] == 0) + /* If we haven't initialized the special PIC symbols, do so now. */ + if (!pic_helper_symbol_name[0]) { - int align; - - ASM_GENERATE_INTERNAL_LABEL (get_pc_symbol_name, "LGETPC", 0); - text_section (); - - align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); - if (align > 0) - ASM_OUTPUT_ALIGN (asm_out_file, align); - (*targetm.asm_out.internal_label) (asm_out_file, "LGETPC", 0); - fputs ("\tretl\n\tadd\t%o7, %l7, %l7\n", asm_out_file); + ASM_GENERATE_INTERNAL_LABEL (pic_helper_symbol_name, "LADDPC", 0); + pic_helper_symbol = gen_rtx_SYMBOL_REF (Pmode, pic_helper_symbol_name); + global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); } - /* Initialize every time through, since we can't easily - know this to be permanent. */ - global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); - get_pc_symbol = gen_rtx_SYMBOL_REF (Pmode, get_pc_symbol_name); + /* If we haven't emitted the special PIC helper function, do so now unless + we are requested to delay it. */ + if (!delay_pic_helper && !pic_helper_emitted_p) + emit_pic_helper (); + flag_pic = 0; - - emit_insn (gen_get_pc (pic_offset_table_rtx, global_offset_table, - get_pc_symbol)); - + if (TARGET_ARCH64) + emit_insn (gen_load_pcrel_symdi (pic_offset_table_rtx, global_offset_table, + pic_helper_symbol)); + else + emit_insn (gen_load_pcrel_symsi (pic_offset_table_rtx, global_offset_table, + pic_helper_symbol)); flag_pic = orig_flag_pic; /* Need to emit this whether or not we obey regdecls, @@ -3824,6 +3404,13 @@ mem_min_alignment (rtx mem, int desired) if (GET_CODE (mem) != MEM) return 0; + /* Obviously... */ + if (!TARGET_UNALIGNED_DOUBLES + && MEM_ALIGN (mem) / BITS_PER_UNIT >= (unsigned)desired) + return 1; + + /* ??? The rest of the function predates MEM_ALIGN so + there is probably a bit of redundancy. */ addr = XEXP (mem, 0); base = offset = NULL_RTX; if (GET_CODE (addr) == PLUS) @@ -4031,6 +3618,12 @@ sparc_init_modes (void) else sparc_mode_class[i] = 0; break; + case MODE_VECTOR_INT: + if (GET_MODE_SIZE (i) <= 4) + sparc_mode_class[i] = 1 << (int)SF_MODE; + else if (GET_MODE_SIZE (i) == 8) + sparc_mode_class[i] = 1 << (int)DF_MODE; + break; case MODE_FLOAT: case MODE_COMPLEX_FLOAT: if (GET_MODE_SIZE (i) <= 4) @@ -4079,128 +3672,16 @@ sparc_init_modes (void) } } -/* Save non call used registers from LOW to HIGH at BASE+OFFSET. - N_REGS is the number of 4-byte regs saved thus far. This applies even to - v9 int regs as it simplifies the code. */ - -static int -save_regs (FILE *file, int low, int high, const char *base, - int offset, int n_regs, HOST_WIDE_INT real_offset) -{ - int i; - - if (TARGET_ARCH64 && high <= 32) - { - for (i = low; i < high; i++) - { - if (regs_ever_live[i] && ! call_used_regs[i]) - { - fprintf (file, "\tstx\t%s, [%s+%d]\n", - reg_names[i], base, offset + 4 * n_regs); - if (dwarf2out_do_frame ()) - dwarf2out_reg_save ("", i, real_offset + 4 * n_regs); - n_regs += 2; - } - } - } - else - { - for (i = low; i < high; i += 2) - { - if (regs_ever_live[i] && ! call_used_regs[i]) - { - if (regs_ever_live[i+1] && ! call_used_regs[i+1]) - { - fprintf (file, "\tstd\t%s, [%s+%d]\n", - reg_names[i], base, offset + 4 * n_regs); - if (dwarf2out_do_frame ()) - { - char *l = dwarf2out_cfi_label (); - dwarf2out_reg_save (l, i, real_offset + 4 * n_regs); - dwarf2out_reg_save (l, i+1, real_offset + 4 * n_regs + 4); - } - n_regs += 2; - } - else - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - reg_names[i], base, offset + 4 * n_regs); - if (dwarf2out_do_frame ()) - dwarf2out_reg_save ("", i, real_offset + 4 * n_regs); - n_regs += 2; - } - } - else - { - if (regs_ever_live[i+1] && ! call_used_regs[i+1]) - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - reg_names[i+1], base, offset + 4 * n_regs + 4); - if (dwarf2out_do_frame ()) - dwarf2out_reg_save ("", i + 1, real_offset + 4 * n_regs + 4); - n_regs += 2; - } - } - } - } - return n_regs; -} - -/* Restore non call used registers from LOW to HIGH at BASE+OFFSET. - - N_REGS is the number of 4-byte regs saved thus far. This applies even to - v9 int regs as it simplifies the code. */ - -static int -restore_regs (FILE *file, int low, int high, const char *base, - int offset, int n_regs) -{ - int i; - - if (TARGET_ARCH64 && high <= 32) - { - for (i = low; i < high; i++) - { - if (regs_ever_live[i] && ! call_used_regs[i]) - fprintf (file, "\tldx\t[%s+%d], %s\n", - base, offset + 4 * n_regs, reg_names[i]), - n_regs += 2; - } - } - else - { - for (i = low; i < high; i += 2) - { - if (regs_ever_live[i] && ! call_used_regs[i]) - if (regs_ever_live[i+1] && ! call_used_regs[i+1]) - fprintf (file, "\tldd\t[%s+%d], %s\n", - base, offset + 4 * n_regs, reg_names[i]), - n_regs += 2; - else - fprintf (file, "\tld\t[%s+%d], %s\n", - base, offset + 4 * n_regs, reg_names[i]), - n_regs += 2; - else if (regs_ever_live[i+1] && ! call_used_regs[i+1]) - fprintf (file, "\tld\t[%s+%d], %s\n", - base, offset + 4 * n_regs + 4, reg_names[i+1]), - n_regs += 2; - } - } - return n_regs; -} - /* Compute the frame size required by the function. This function is called - during the reload pass and also by output_function_prologue(). */ + during the reload pass and also by sparc_expand_prologue. */ HOST_WIDE_INT -compute_frame_size (HOST_WIDE_INT size, int leaf_function) +sparc_compute_frame_size (HOST_WIDE_INT size, int leaf_function_p) { - int n_regs = 0, i; int outgoing_args_size = (current_function_outgoing_args_size + REG_PARM_STACK_SPACE (current_function_decl)); - - /* N_REGS is the number of 4-byte regs saved thus far. This applies - even to v9 int regs to be consistent with save_regs/restore_regs. */ + int n_regs = 0; /* N_REGS is the number of 4-byte regs saved thus far. */ + int i; if (TARGET_ARCH64) { @@ -4221,14 +3702,14 @@ compute_frame_size (HOST_WIDE_INT size, int leaf_function) || (regs_ever_live[i+1] && ! call_used_regs[i+1])) n_regs += 2; - /* Set up values for use in `function_epilogue'. */ + /* Set up values for use in prologue and epilogue. */ num_gfregs = n_regs; - if (leaf_function && n_regs == 0 - && size == 0 && current_function_outgoing_args_size == 0) - { - actual_fsize = apparent_fsize = 0; - } + if (leaf_function_p + && n_regs == 0 + && size == 0 + && current_function_outgoing_args_size == 0) + actual_fsize = apparent_fsize = 0; else { /* We subtract STARTING_FRAME_OFFSET, remember it's negative. */ @@ -4239,108 +3720,15 @@ compute_frame_size (HOST_WIDE_INT size, int leaf_function) /* Make sure nothing can clobber our register windows. If a SAVE must be done, or there is a stack-local variable, - the register window area must be allocated. - ??? For v8 we apparently need an additional 8 bytes of reserved space. */ - if (leaf_function == 0 || size > 0) - actual_fsize += (16 * UNITS_PER_WORD) + (TARGET_ARCH64 ? 0 : 8); + the register window area must be allocated. */ + if (! leaf_function_p || size > 0) + actual_fsize += FIRST_PARM_OFFSET (current_function_decl); return SPARC_STACK_ALIGN (actual_fsize); } -/* Build big number NUM in register REG and output the result to FILE. - REG is guaranteed to be the only clobbered register. The function - will very likely emit several instructions, so it must not be called - from within a delay slot. */ - -static void -build_big_number (FILE *file, HOST_WIDE_INT num, const char *reg) -{ -#if HOST_BITS_PER_WIDE_INT == 64 - HOST_WIDE_INT high_bits = (num >> 32) & 0xffffffff; - - if (high_bits == 0 -#else - if (num >= 0 -#endif - || ! TARGET_ARCH64) - { - /* We don't use the 'set' macro because it appears to be broken - in the Solaris 7 assembler. */ - fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", - num, reg); - if ((num & 0x3ff) != 0) - fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n", - reg, num, reg); - } -#if HOST_BITS_PER_WIDE_INT == 64 - else if (high_bits == 0xffffffff) /* && TARGET_ARCH64 */ -#else - else /* num < 0 && TARGET_ARCH64 */ -#endif - { - /* Sethi does not sign extend, so we must use a little trickery - to use it for negative numbers. Invert the constant before - loading it in, then use xor immediate to invert the loaded bits - (along with the upper 32 bits) to the desired constant. This - works because the sethi and immediate fields overlap. */ - HOST_WIDE_INT inv = ~num; - HOST_WIDE_INT low = -0x400 + (num & 0x3ff); - - fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", - inv, reg); - fprintf (file, "\txor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", - reg, low, reg); - } -#if HOST_BITS_PER_WIDE_INT == 64 - else /* TARGET_ARCH64 */ - { - /* We don't use the 'setx' macro because if requires a scratch register. - This is the translation of sparc_emit_set_const64_longway into asm. - Hopefully we will soon have prologue/epilogue emitted as RTL. */ - HOST_WIDE_INT low1 = (num >> (32 - 12)) & 0xfff; - HOST_WIDE_INT low2 = (num >> (32 - 12 - 12)) & 0xfff; - HOST_WIDE_INT low3 = (num >> (32 - 12 - 12 - 8)) & 0x0ff; - int to_shift = 12; - - /* We don't use the 'set' macro because it appears to be broken - in the Solaris 7 assembler. */ - fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n", - high_bits, reg); - if ((high_bits & 0x3ff) != 0) - fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n", - reg, high_bits, reg); - - if (low1 != 0) - { - fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); - fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", - reg, low1, reg); - to_shift = 12; - } - else - { - to_shift += 12; - } - if (low2 != 0) - { - fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); - fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", - reg, low2, reg); - to_shift = 8; - } - else - { - to_shift += 8; - } - fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg); - if (low3 != 0) - fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n", - reg, low3, reg); - } -#endif -} - /* Output any necessary .register pseudo-ops. */ + void sparc_output_scratch_registers (FILE *file ATTRIBUTE_UNUSED) { @@ -4358,341 +3746,469 @@ sparc_output_scratch_registers (FILE *file ATTRIBUTE_UNUSED) && ! sparc_hard_reg_printed [i]) { sparc_hard_reg_printed [i] = 1; - fprintf (file, "\t.register\t%%g%d, #scratch\n", i); + /* %g7 is used as TLS base register, use #ignore + for it instead of #scratch. */ + fprintf (file, "\t.register\t%%g%d, #%s\n", i, + i == 7 ? "ignore" : "scratch"); } if (i == 3) i = 5; } #endif } -/* This function generates the assembly code for function entry. - FILE is a stdio stream to output the code to. - SIZE is an int: how many units of temporary storage to allocate. - Refer to the array `regs_ever_live' to determine which registers - to save; `regs_ever_live[I]' is nonzero if register number I - is ever used in the function. This macro is responsible for - knowing which registers should not be saved even if used. */ +/* Save/restore call-saved registers from LOW to HIGH at BASE+OFFSET + as needed. LOW should be double-word aligned for 32-bit registers. + Return the new OFFSET. */ -/* On SPARC, move-double insns between fpu and cpu need an 8-byte block - of memory. If any fpu reg is used in the function, we allocate - such a block here, at the bottom of the frame, just in case it's needed. +#define SORR_SAVE 0 +#define SORR_RESTORE 1 - If this function is a leaf procedure, then we may choose not - to do a "save" insn. The decision about whether or not - to do this is made in regclass.c. */ - -static void -sparc_output_function_prologue (FILE *file, HOST_WIDE_INT size) +static int +save_or_restore_regs (int low, int high, rtx base, int offset, int action) { - if (TARGET_FLAT) - sparc_flat_function_prologue (file, size); + rtx mem, insn; + int i; + + if (TARGET_ARCH64 && high <= 32) + { + for (i = low; i < high; i++) + { + if (regs_ever_live[i] && ! call_used_regs[i]) + { + mem = gen_rtx_MEM (DImode, plus_constant (base, offset)); + set_mem_alias_set (mem, sparc_sr_alias_set); + if (action == SORR_SAVE) + { + insn = emit_move_insn (mem, gen_rtx_REG (DImode, i)); + RTX_FRAME_RELATED_P (insn) = 1; + } + else /* action == SORR_RESTORE */ + emit_move_insn (gen_rtx_REG (DImode, i), mem); + offset += 8; + } + } + } else - sparc_nonflat_function_prologue (file, size, - current_function_uses_only_leaf_regs); + { + for (i = low; i < high; i += 2) + { + bool reg0 = regs_ever_live[i] && ! call_used_regs[i]; + bool reg1 = regs_ever_live[i+1] && ! call_used_regs[i+1]; + enum machine_mode mode; + int regno; + + if (reg0 && reg1) + { + mode = i < 32 ? DImode : DFmode; + regno = i; + } + else if (reg0) + { + mode = i < 32 ? SImode : SFmode; + regno = i; + } + else if (reg1) + { + mode = i < 32 ? SImode : SFmode; + regno = i + 1; + offset += 4; + } + else + continue; + + mem = gen_rtx_MEM (mode, plus_constant (base, offset)); + set_mem_alias_set (mem, sparc_sr_alias_set); + if (action == SORR_SAVE) + { + insn = emit_move_insn (mem, gen_rtx_REG (mode, regno)); + RTX_FRAME_RELATED_P (insn) = 1; + } + else /* action == SORR_RESTORE */ + emit_move_insn (gen_rtx_REG (mode, regno), mem); + + /* Always preserve double-word alignment. */ + offset = (offset + 7) & -8; + } + } + + return offset; } -/* Output code for the function prologue. */ +/* Emit code to save call-saved registers. */ static void -sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size, - int leaf_function) +emit_save_or_restore_regs (int action) { - sparc_output_scratch_registers (file); + HOST_WIDE_INT offset; + rtx base; + + offset = frame_base_offset - apparent_fsize; + + if (offset < -4096 || offset + num_gfregs * 4 > 4095) + { + /* ??? This might be optimized a little as %g1 might already have a + value close enough that a single add insn will do. */ + /* ??? Although, all of this is probably only a temporary fix + because if %g1 can hold a function result, then + sparc_expand_epilogue will lose (the result will be + clobbered). */ + base = gen_rtx_REG (Pmode, 1); + emit_move_insn (base, GEN_INT (offset)); + emit_insn (gen_rtx_SET (VOIDmode, + base, + gen_rtx_PLUS (Pmode, frame_base_reg, base))); + offset = 0; + } + else + base = frame_base_reg; + + offset = save_or_restore_regs (0, 8, base, offset, action); + save_or_restore_regs (32, TARGET_V9 ? 96 : 64, base, offset, action); +} + +/* Generate a save_register_window insn. */ + +static rtx +gen_save_register_window (rtx increment) +{ + if (TARGET_ARCH64) + return gen_save_register_windowdi (increment); + else + return gen_save_register_windowsi (increment); +} + +/* Generate an increment for the stack pointer. */ + +static rtx +gen_stack_pointer_inc (rtx increment) +{ + return gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + gen_rtx_PLUS (Pmode, + stack_pointer_rtx, + increment)); +} + +/* Generate a decrement for the stack pointer. */ + +static rtx +gen_stack_pointer_dec (rtx decrement) +{ + return gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + gen_rtx_MINUS (Pmode, + stack_pointer_rtx, + decrement)); +} + +/* Expand the function prologue. The prologue is responsible for reserving + storage for the frame, saving the call-saved registers and loading the + PIC register if needed. */ + +void +sparc_expand_prologue (void) +{ + rtx insn; + int i; + + /* Compute a snapshot of current_function_uses_only_leaf_regs. Relying + on the final value of the flag means deferring the prologue/epilogue + expansion until just before the second scheduling pass, which is too + late to emit multiple epilogues or return insns. + + Of course we are making the assumption that the value of the flag + will not change between now and its final value. Of the three parts + of the formula, only the last one can reasonably vary. Let's take a + closer look, after assuming that the first two ones are set to true + (otherwise the last value is effectively silenced). + + If only_leaf_regs_used returns false, the global predicate will also + be false so the actual frame size calculated below will be positive. + As a consequence, the save_register_window insn will be emitted in + the instruction stream; now this insn explicitly references %fp + which is not a leaf register so only_leaf_regs_used will always + return false subsequently. + + If only_leaf_regs_used returns true, we hope that the subsequent + optimization passes won't cause non-leaf registers to pop up. For + example, the regrename pass has special provisions to not rename to + non-leaf registers in a leaf function. */ + sparc_leaf_function_p + = optimize > 0 && leaf_function_p () && only_leaf_regs_used (); /* Need to use actual_fsize, since we are also allocating space for our callee (and our own register save area). */ - actual_fsize = compute_frame_size (size, leaf_function); + actual_fsize + = sparc_compute_frame_size (get_frame_size(), sparc_leaf_function_p); - if (leaf_function) + /* Advertise that the data calculated just above are now valid. */ + sparc_prologue_data_valid_p = true; + + if (sparc_leaf_function_p) { - frame_base_name = "%sp"; + frame_base_reg = stack_pointer_rtx; frame_base_offset = actual_fsize + SPARC_STACK_BIAS; } else { - frame_base_name = "%fp"; + frame_base_reg = hard_frame_pointer_rtx; frame_base_offset = SPARC_STACK_BIAS; } - /* This is only for the human reader. */ - fprintf (file, "\t%s#PROLOGUE# 0\n", ASM_COMMENT_START); + if (actual_fsize == 0) + /* do nothing. */ ; + else if (sparc_leaf_function_p) + { + if (actual_fsize <= 4096) + insn = emit_insn (gen_stack_pointer_inc (GEN_INT (-actual_fsize))); + else if (actual_fsize <= 8192) + { + insn = emit_insn (gen_stack_pointer_inc (GEN_INT (-4096))); + /* %sp is still the CFA register. */ + RTX_FRAME_RELATED_P (insn) = 1; + insn + = emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); + } + else + { + rtx reg = gen_rtx_REG (Pmode, 1); + emit_move_insn (reg, GEN_INT (-actual_fsize)); + insn = emit_insn (gen_stack_pointer_inc (reg)); + REG_NOTES (insn) = + gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, + gen_stack_pointer_inc (GEN_INT (-actual_fsize)), + REG_NOTES (insn)); + } + + RTX_FRAME_RELATED_P (insn) = 1; + } + else + { + if (actual_fsize <= 4096) + insn = emit_insn (gen_save_register_window (GEN_INT (-actual_fsize))); + else if (actual_fsize <= 8192) + { + insn = emit_insn (gen_save_register_window (GEN_INT (-4096))); + /* %sp is not the CFA register anymore. */ + emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); + } + else + { + rtx reg = gen_rtx_REG (Pmode, 1); + emit_move_insn (reg, GEN_INT (-actual_fsize)); + insn = emit_insn (gen_save_register_window (reg)); + } + + RTX_FRAME_RELATED_P (insn) = 1; + for (i=0; i < XVECLEN (PATTERN (insn), 0); i++) + RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, i)) = 1; + } + + if (num_gfregs) + emit_save_or_restore_regs (SORR_SAVE); + + /* Load the PIC register if needed. */ + if (flag_pic && current_function_uses_pic_offset_table) + load_pic_register (false); +} + +/* This function generates the assembly code for function entry, which boils + down to emitting the necessary .register directives. */ + +static void +sparc_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + /* Check that the assumption we made in sparc_expand_prologue is valid. */ + gcc_assert (sparc_leaf_function_p == current_function_uses_only_leaf_regs); + + sparc_output_scratch_registers (file); +} + +/* Expand the function epilogue, either normal or part of a sibcall. + We emit all the instructions except the return or the call. */ + +void +sparc_expand_epilogue (void) +{ + if (num_gfregs) + emit_save_or_restore_regs (SORR_RESTORE); if (actual_fsize == 0) /* do nothing. */ ; - else if (! leaf_function) + else if (sparc_leaf_function_p) { if (actual_fsize <= 4096) - fprintf (file, "\tsave\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - actual_fsize); + emit_insn (gen_stack_pointer_dec (GEN_INT (- actual_fsize))); else if (actual_fsize <= 8192) { - fprintf (file, "\tsave\t%%sp, -4096, %%sp\n"); - fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - actual_fsize - 4096); + emit_insn (gen_stack_pointer_dec (GEN_INT (-4096))); + emit_insn (gen_stack_pointer_dec (GEN_INT (4096 - actual_fsize))); } else { - build_big_number (file, -actual_fsize, "%g1"); - fprintf (file, "\tsave\t%%sp, %%g1, %%sp\n"); + rtx reg = gen_rtx_REG (Pmode, 1); + emit_move_insn (reg, GEN_INT (-actual_fsize)); + emit_insn (gen_stack_pointer_dec (reg)); } } - else /* leaf function */ - { - if (actual_fsize <= 4096) - fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - actual_fsize); - else if (actual_fsize <= 8192) - { - fprintf (file, "\tadd\t%%sp, -4096, %%sp\n"); - fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - actual_fsize - 4096); - } - else - { - build_big_number (file, -actual_fsize, "%g1"); - fprintf (file, "\tadd\t%%sp, %%g1, %%sp\n"); - } - } - - if (dwarf2out_do_frame () && actual_fsize) - { - char *label = dwarf2out_cfi_label (); - - /* The canonical frame address refers to the top of the frame. */ - dwarf2out_def_cfa (label, (leaf_function ? STACK_POINTER_REGNUM - : HARD_FRAME_POINTER_REGNUM), - frame_base_offset); - - if (! leaf_function) - { - /* Note the register window save. This tells the unwinder that - it needs to restore the window registers from the previous - frame's window save area at 0(cfa). */ - dwarf2out_window_save (label); - - /* The return address (-8) is now in %i7. */ - dwarf2out_return_reg (label, 31); - } - } - - /* If doing anything with PIC, do it now. */ - if (! flag_pic) - fprintf (file, "\t%s#PROLOGUE# 1\n", ASM_COMMENT_START); - - /* Call saved registers are saved just above the outgoing argument area. */ - if (num_gfregs) - { - HOST_WIDE_INT offset, real_offset; - int n_regs; - const char *base; - - real_offset = -apparent_fsize; - offset = -apparent_fsize + frame_base_offset; - if (offset < -4096 || offset + num_gfregs * 4 > 4096) - { - /* ??? This might be optimized a little as %g1 might already have a - value close enough that a single add insn will do. */ - /* ??? Although, all of this is probably only a temporary fix - because if %g1 can hold a function result, then - output_function_epilogue will lose (the result will get - clobbered). */ - build_big_number (file, offset, "%g1"); - fprintf (file, "\tadd\t%s, %%g1, %%g1\n", frame_base_name); - base = "%g1"; - offset = 0; - } - else - { - base = frame_base_name; - } - - n_regs = save_regs (file, 0, 8, base, offset, 0, real_offset); - save_regs (file, 32, TARGET_V9 ? 96 : 64, base, offset, n_regs, - real_offset); - } } -/* Output code to restore any call saved registers. */ +/* Return true if it is appropriate to emit `return' instructions in the + body of a function. */ -static void -output_restore_regs (FILE *file, int leaf_function ATTRIBUTE_UNUSED) +bool +sparc_can_use_return_insn_p (void) { - HOST_WIDE_INT offset; - int n_regs; - const char *base; - - offset = -apparent_fsize + frame_base_offset; - if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/) - { - build_big_number (file, offset, "%g1"); - fprintf (file, "\tadd\t%s, %%g1, %%g1\n", frame_base_name); - base = "%g1"; - offset = 0; - } - else - { - base = frame_base_name; - } - - n_regs = restore_regs (file, 0, 8, base, offset, 0); - restore_regs (file, 32, TARGET_V9 ? 96 : 64, base, offset, n_regs); + return sparc_prologue_data_valid_p + && (actual_fsize == 0 || !sparc_leaf_function_p); } - -/* This function generates the assembly code for function exit, - on machines that need it. - - The function epilogue should not depend on the current stack pointer! - It should use the frame pointer only. This is mandatory because - of alloca; we also take advantage of it to omit stack adjustments - before returning. */ - + +/* This function generates the assembly code for function exit. */ + static void -sparc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) +sparc_asm_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { - if (TARGET_FLAT) - sparc_flat_function_epilogue (file, size); - else - sparc_nonflat_function_epilogue (file, size, - current_function_uses_only_leaf_regs); + /* If code does not drop into the epilogue, we have to still output + a dummy nop for the sake of sane backtraces. Otherwise, if the + last two instructions of a function were "call foo; dslot;" this + can make the return PC of foo (i.e. address of call instruction + plus 8) point to the first instruction in the next function. */ + + rtx insn, last_real_insn; + + insn = get_last_insn (); + + last_real_insn = prev_real_insn (insn); + if (last_real_insn + && GET_CODE (last_real_insn) == INSN + && GET_CODE (PATTERN (last_real_insn)) == SEQUENCE) + last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0); + + if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN) + fputs("\tnop\n", file); + + sparc_output_deferred_case_vectors (); } - -/* Output code for the function epilogue. */ - + +/* Output a 'restore' instruction. */ + static void -sparc_nonflat_function_epilogue (FILE *file, - HOST_WIDE_INT size ATTRIBUTE_UNUSED, - int leaf_function) +output_restore (rtx pat) { - const char *ret; + rtx operands[3]; - if (current_function_epilogue_delay_list == 0) + if (! pat) { - /* If code does not drop into the epilogue, we need - do nothing except output pending case vectors. - - We have to still output a dummy nop for the sake of - sane backtraces. Otherwise, if the last two instructions - of a function were call foo; dslot; this can make the return - PC of foo (ie. address of call instruction plus 8) point to - the first instruction in the next function. */ - rtx insn, last_real_insn; - - insn = get_last_insn (); - - last_real_insn = prev_real_insn (insn); - if (last_real_insn - && GET_CODE (last_real_insn) == INSN - && GET_CODE (PATTERN (last_real_insn)) == SEQUENCE) - last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0); - - if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN) - fputs("\tnop\n", file); - - if (GET_CODE (insn) == NOTE) - insn = prev_nonnote_insn (insn); - if (insn && GET_CODE (insn) == BARRIER) - goto output_vectors; + fputs ("\t restore\n", asm_out_file); + return; } - if (num_gfregs) - output_restore_regs (file, leaf_function); + gcc_assert (GET_CODE (pat) == SET); - /* Work out how to skip the caller's unimp instruction if required. */ - if (leaf_function) - ret = (SKIP_CALLERS_UNIMP_P ? "jmp\t%o7+12" : "retl"); - else - ret = (SKIP_CALLERS_UNIMP_P ? "jmp\t%i7+12" : "ret"); + operands[0] = SET_DEST (pat); + pat = SET_SRC (pat); - if (! leaf_function) + switch (GET_CODE (pat)) { + case PLUS: + operands[1] = XEXP (pat, 0); + operands[2] = XEXP (pat, 1); + output_asm_insn (" restore %r1, %2, %Y0", operands); + break; + case LO_SUM: + operands[1] = XEXP (pat, 0); + operands[2] = XEXP (pat, 1); + output_asm_insn (" restore %r1, %%lo(%a2), %Y0", operands); + break; + case ASHIFT: + operands[1] = XEXP (pat, 0); + gcc_assert (XEXP (pat, 1) == const1_rtx); + output_asm_insn (" restore %r1, %r1, %Y0", operands); + break; + default: + operands[1] = pat; + output_asm_insn (" restore %%g0, %1, %Y0", operands); + break; + } +} + +/* Output a return. */ + +const char * +output_return (rtx insn) +{ + if (sparc_leaf_function_p) + { + /* This is a leaf function so we don't have to bother restoring the + register window, which frees us from dealing with the convoluted + semantics of restore/return. We simply output the jump to the + return address and the insn in the delay slot (if any). */ + + gcc_assert (! current_function_calls_eh_return); + + return "jmp\t%%o7+%)%#"; + } + else + { + /* This is a regular function so we have to restore the register window. + We may have a pending insn for the delay slot, which will be either + combined with the 'restore' instruction or put in the delay slot of + the 'return' instruction. */ + if (current_function_calls_eh_return) { - if (current_function_epilogue_delay_list) - abort (); - if (SKIP_CALLERS_UNIMP_P) - abort (); + /* If the function uses __builtin_eh_return, the eh_return + machinery occupies the delay slot. */ + gcc_assert (! final_sequence); - fputs ("\trestore\n\tretl\n\tadd\t%sp, %g1, %sp\n", file); + if (! flag_delayed_branch) + fputs ("\tadd\t%fp, %g1, %fp\n", asm_out_file); + + if (TARGET_V9) + fputs ("\treturn\t%i7+8\n", asm_out_file); + else + fputs ("\trestore\n\tjmp\t%o7+8\n", asm_out_file); + + if (flag_delayed_branch) + fputs ("\t add\t%sp, %g1, %sp\n", asm_out_file); + else + fputs ("\t nop\n", asm_out_file); } - /* If we wound up with things in our delay slot, flush them here. */ - else if (current_function_epilogue_delay_list) + else if (final_sequence) { - rtx delay = PATTERN (XEXP (current_function_epilogue_delay_list, 0)); + rtx delay, pat; - if (TARGET_V9 && ! epilogue_renumber (&delay, 1)) + delay = NEXT_INSN (insn); + gcc_assert (delay); + + pat = PATTERN (delay); + + if (TARGET_V9 && ! epilogue_renumber (&pat, 1)) { - epilogue_renumber (&delay, 0); - fputs (SKIP_CALLERS_UNIMP_P - ? "\treturn\t%i7+12\n" - : "\treturn\t%i7+8\n", file); - final_scan_insn (XEXP (current_function_epilogue_delay_list, 0), - file, 1, 0, 0, NULL); + epilogue_renumber (&pat, 0); + return "return\t%%i7+%)%#"; } else { - rtx insn, src; - - if (GET_CODE (delay) != SET) - abort(); - - src = SET_SRC (delay); - if (GET_CODE (src) == ASHIFT) - { - if (XEXP (src, 1) != const1_rtx) - abort(); - SET_SRC (delay) - = gen_rtx_PLUS (GET_MODE (src), XEXP (src, 0), - XEXP (src, 0)); - } - - insn = gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, delay, - gen_rtx_RETURN (VOIDmode))); - insn = emit_jump_insn (insn); - - sparc_emitting_epilogue = true; - final_scan_insn (insn, file, 1, 0, 1, NULL); - sparc_emitting_epilogue = false; + output_asm_insn ("jmp\t%%i7+%)", NULL); + output_restore (pat); + PATTERN (delay) = gen_blockage (); + INSN_CODE (delay) = -1; } } - else if (TARGET_V9 && ! SKIP_CALLERS_UNIMP_P) - fputs ("\treturn\t%i7+8\n\tnop\n", file); else - fprintf (file, "\t%s\n\trestore\n", ret); - } - /* All of the following cases are for leaf functions. */ - else if (current_function_calls_eh_return) - abort (); - else if (current_function_epilogue_delay_list) - { - /* eligible_for_epilogue_delay_slot ensures that if this is a - leaf function, then we will only have insn in the delay slot - if the frame size is zero, thus no adjust for the stack is - needed here. */ - if (actual_fsize != 0) - abort (); - fprintf (file, "\t%s\n", ret); - final_scan_insn (XEXP (current_function_epilogue_delay_list, 0), - file, 1, 0, 1, NULL); - } - /* Output 'nop' instead of 'sub %sp,-0,%sp' when no frame, so as to - avoid generating confusing assembly language output. */ - else if (actual_fsize == 0) - fprintf (file, "\t%s\n\tnop\n", ret); - else if (actual_fsize <= 4096) - fprintf (file, "\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - ret, actual_fsize); - else if (actual_fsize <= 8192) - fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", - ret, actual_fsize - 4096); - else - { - build_big_number (file, actual_fsize, "%g1"); - fprintf (file, "\t%s\n\tadd\t%%sp, %%g1, %%sp\n", ret); + { + /* The delay slot is empty. */ + if (TARGET_V9) + return "return\t%%i7+%)\n\t nop"; + else if (flag_delayed_branch) + return "jmp\t%%i7+%)\n\t restore"; + else + return "restore\n\tjmp\t%%o7+%)\n\t nop"; + } } - output_vectors: - sparc_output_deferred_case_vectors (); + return ""; } /* Output a sibling call. */ @@ -4700,144 +4216,61 @@ sparc_nonflat_function_epilogue (FILE *file, const char * output_sibcall (rtx insn, rtx call_operand) { - int leaf_regs = current_function_uses_only_leaf_regs; - rtx operands[3]; - int delay_slot = dbr_sequence_length () > 0; + rtx operands[1]; - if (num_gfregs) - { - /* Call to restore global regs might clobber - the delay slot. Instead of checking for this - output the delay slot now. */ - if (delay_slot) - { - rtx delay = NEXT_INSN (insn); - - if (! delay) - abort (); - - final_scan_insn (delay, asm_out_file, 1, 0, 1, NULL); - PATTERN (delay) = gen_blockage (); - INSN_CODE (delay) = -1; - delay_slot = 0; - } - output_restore_regs (asm_out_file, leaf_regs); - } + gcc_assert (flag_delayed_branch); operands[0] = call_operand; - if (leaf_regs) + if (sparc_leaf_function_p) { -#ifdef HAVE_AS_RELAX_OPTION - /* If as and ld are relaxing tail call insns into branch always, - use or %o7,%g0,X; call Y; or X,%g0,%o7 always, so that it can - be optimized. With sethi/jmpl as nor ld has no easy way how to - find out if somebody does not branch between the sethi and jmpl. */ - int spare_slot = 0; -#else - int spare_slot = ((TARGET_ARCH32 || TARGET_CM_MEDLOW) && ! flag_pic); -#endif - HOST_WIDE_INT size = 0; + /* This is a leaf function so we don't have to bother restoring the + register window. We simply output the jump to the function and + the insn in the delay slot (if any). */ - if ((actual_fsize || ! spare_slot) && delay_slot) - { - rtx delay = NEXT_INSN (insn); + gcc_assert (!(LEAF_SIBCALL_SLOT_RESERVED_P && final_sequence)); - if (! delay) - abort (); - - final_scan_insn (delay, asm_out_file, 1, 0, 1, NULL); - PATTERN (delay) = gen_blockage (); - INSN_CODE (delay) = -1; - delay_slot = 0; - } - if (actual_fsize) - { - if (actual_fsize <= 4096) - size = actual_fsize; - else if (actual_fsize <= 8192) - { - fputs ("\tsub\t%sp, -4096, %sp\n", asm_out_file); - size = actual_fsize - 4096; - } - else - { - build_big_number (asm_out_file, actual_fsize, "%g1"); - fputs ("\tadd\t%%sp, %%g1, %%sp\n", asm_out_file); - } - } - if (spare_slot) - { - output_asm_insn ("sethi\t%%hi(%a0), %%g1", operands); - output_asm_insn ("jmpl\t%%g1 + %%lo(%a0), %%g0", operands); - if (size) - fprintf (asm_out_file, "\t sub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size); - else if (! delay_slot) - fputs ("\t nop\n", asm_out_file); - } + if (final_sequence) + output_asm_insn ("sethi\t%%hi(%a0), %%g1\n\tjmp\t%%g1 + %%lo(%a0)%#", + operands); else - { - if (size) - fprintf (asm_out_file, "\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size); - /* Use or with rs2 %%g0 instead of mov, so that as/ld can optimize - it into branch if possible. */ - output_asm_insn ("or\t%%o7, %%g0, %%g1", operands); - output_asm_insn ("call\t%a0, 0", operands); - output_asm_insn (" or\t%%g1, %%g0, %%o7", operands); - } - return ""; - } - - output_asm_insn ("call\t%a0, 0", operands); - if (delay_slot) - { - rtx delay = NEXT_INSN (insn), pat; - - if (! delay) - abort (); - - pat = PATTERN (delay); - if (GET_CODE (pat) != SET) - abort (); - - operands[0] = SET_DEST (pat); - pat = SET_SRC (pat); - switch (GET_CODE (pat)) - { - case PLUS: - operands[1] = XEXP (pat, 0); - operands[2] = XEXP (pat, 1); - output_asm_insn (" restore %r1, %2, %Y0", operands); - break; - case LO_SUM: - operands[1] = XEXP (pat, 0); - operands[2] = XEXP (pat, 1); - output_asm_insn (" restore %r1, %%lo(%a2), %Y0", operands); - break; - case ASHIFT: - operands[1] = XEXP (pat, 0); - output_asm_insn (" restore %r1, %r1, %Y0", operands); - break; - default: - operands[1] = pat; - output_asm_insn (" restore %%g0, %1, %Y0", operands); - break; - } - PATTERN (delay) = gen_blockage (); - INSN_CODE (delay) = -1; + /* Use or with rs2 %%g0 instead of mov, so that as/ld can optimize + it into branch if possible. */ + output_asm_insn ("or\t%%o7, %%g0, %%g1\n\tcall\t%a0, 0\n\t or\t%%g1, %%g0, %%o7", + operands); } else - fputs ("\t restore\n", asm_out_file); + { + /* This is a regular function so we have to restore the register window. + We may have a pending insn for the delay slot, which will be combined + with the 'restore' instruction. */ + + output_asm_insn ("call\t%a0, 0", operands); + + if (final_sequence) + { + rtx delay = NEXT_INSN (insn); + gcc_assert (delay); + + output_restore (PATTERN (delay)); + + PATTERN (delay) = gen_blockage (); + INSN_CODE (delay) = -1; + } + else + output_restore (NULL_RTX); + } + return ""; } /* Functions for handling argument passing. - For v8 the first six args are normally in registers and the rest are + For 32-bit, the first 6 args are normally in registers and the rest are pushed. Any arg that starts within the first 6 words is at least partially passed in a register unless its data type forbids. - For v9, the argument registers are laid out as an array of 16 elements + For 64-bit, the argument registers are laid out as an array of 16 elements and arguments are added sequentially. The first 6 int args and up to the first 16 fp args (depending on size) are passed in regs. @@ -4862,7 +4295,7 @@ output_sibcall (rtx insn, rtx call_operand) Here SP = %sp if -mno-stack-bias or %sp+stack_bias otherwise. - Integral arguments are always passed as 64 bit quantities appropriately + Integral arguments are always passed as 64-bit quantities appropriately extended. Passing of floating point values is handled as follows. @@ -4879,7 +4312,80 @@ output_sibcall (rtx insn, rtx call_operand) appropriate integer reg and the appropriate fp reg. If the value is not one of the first 6 arguments the value is passed in the appropriate fp reg and in memory. - */ + + + Summary of the calling conventions implemented by GCC on SPARC: + + 32-bit ABI: + size argument return value + + small integer <4 int. reg. int. reg. + word 4 int. reg. int. reg. + double word 8 int. reg. int. reg. + + _Complex small integer <8 int. reg. int. reg. + _Complex word 8 int. reg. int. reg. + _Complex double word 16 memory int. reg. + + vector integer <=8 int. reg. FP reg. + vector integer >8 memory memory + + float 4 int. reg. FP reg. + double 8 int. reg. FP reg. + long double 16 memory memory + + _Complex float 8 memory FP reg. + _Complex double 16 memory FP reg. + _Complex long double 32 memory FP reg. + + vector float any memory memory + + aggregate any memory memory + + + + 64-bit ABI: + size argument return value + + small integer <8 int. reg. int. reg. + word 8 int. reg. int. reg. + double word 16 int. reg. int. reg. + + _Complex small integer <16 int. reg. int. reg. + _Complex word 16 int. reg. int. reg. + _Complex double word 32 memory int. reg. + + vector integer <=16 FP reg. FP reg. + vector integer 1632 memory memory + + float 4 FP reg. FP reg. + double 8 FP reg. FP reg. + long double 16 FP reg. FP reg. + + _Complex float 8 FP reg. FP reg. + _Complex double 16 FP reg. FP reg. + _Complex long double 32 memory FP reg. + + vector float <=16 FP reg. FP reg. + vector float 1632 memory memory + + aggregate <=16 reg. reg. + aggregate 1632 memory memory + + + +Note #1: complex floating-point types follow the extended SPARC ABIs as +implemented by the Sun compiler. + +Note #2: integral vector types follow the scalar floating-point types +conventions to match what is implemented by the Sun VIS SDK. + +Note #3: floating-point vector types follow the aggregate types +conventions. */ + /* Maximum number of int regs for args. */ #define SPARC_INT_ARG_MAX 6 @@ -4903,6 +4409,23 @@ init_cumulative_args (struct sparc_args *cum, tree fntype, cum->libcall_p = fntype == 0; } +/* Handle the TARGET_PROMOTE_PROTOTYPES target hook. + When a prototype says `char' or `short', really pass an `int'. */ + +static bool +sparc_promote_prototypes (tree fntype ATTRIBUTE_UNUSED) +{ + return TARGET_ARCH32 ? true : false; +} + +/* Handle the TARGET_STRICT_ARGUMENT_NAMING target hook. */ + +static bool +sparc_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) +{ + return TARGET_ARCH64 ? true : false; +} + /* Scan the record type TYPE and return the following predicates: - INTREGS_P: the record contains at least one field or sub-field that is eligible for promotion in integer registers. @@ -4923,7 +4446,9 @@ scan_record_type (tree type, int *intregs_p, int *fpregs_p, int *packed_p) { if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE) scan_record_type (TREE_TYPE (field), intregs_p, fpregs_p, 0); - else if (FLOAT_TYPE_P (TREE_TYPE (field)) && TARGET_FPU) + else if ((FLOAT_TYPE_P (TREE_TYPE (field)) + || TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE) + && TARGET_FPU) *fpregs_p = 1; else *intregs_p = 1; @@ -4958,91 +4483,100 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, ? SPARC_INCOMING_INT_ARG_FIRST : SPARC_OUTGOING_INT_ARG_FIRST); int slotno = cum->words; + enum mode_class mclass; int regno; *ppadding = 0; - if (type != 0 && TREE_ADDRESSABLE (type)) + if (type && TREE_ADDRESSABLE (type)) return -1; + if (TARGET_ARCH32 - && type != 0 && mode == BLKmode + && mode == BLKmode + && type && TYPE_ALIGN (type) % PARM_BOUNDARY != 0) return -1; - switch (mode) - { - case VOIDmode : - /* MODE is VOIDmode when generating the actual call. - See emit_call_1. */ - return -1; + /* For SPARC64, objects requiring 16-byte alignment get it. */ + if (TARGET_ARCH64 + && (type ? TYPE_ALIGN (type) : GET_MODE_ALIGNMENT (mode)) >= 128 + && (slotno & 1) != 0) + slotno++, *ppadding = 1; - case TImode : case CTImode : - if (TARGET_ARCH64 && (slotno & 1) != 0) - slotno++, *ppadding = 1; + mclass = GET_MODE_CLASS (mode); + if (type && TREE_CODE (type) == VECTOR_TYPE) + { + /* Vector types deserve special treatment because they are + polymorphic wrt their mode, depending upon whether VIS + instructions are enabled. */ + if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE) + { + /* The SPARC port defines no floating-point vector modes. */ + gcc_assert (mode == BLKmode); + } + else + { + /* Integral vector types should either have a vector + mode or an integral mode, because we are guaranteed + by pass_by_reference that their size is not greater + than 16 bytes and TImode is 16-byte wide. */ + gcc_assert (mode != BLKmode); + + /* Vector integers are handled like floats according to + the Sun VIS SDK. */ + mclass = MODE_FLOAT; + } + } + + switch (mclass) + { + case MODE_FLOAT: + case MODE_COMPLEX_FLOAT: + if (TARGET_ARCH64 && TARGET_FPU && named) + { + if (slotno >= SPARC_FP_ARG_MAX) + return -1; + regno = SPARC_FP_ARG_FIRST + slotno * 2; + /* Arguments filling only one single FP register are + right-justified in the outer double FP register. */ + if (GET_MODE_SIZE (mode) <= 4) + regno++; + break; + } /* fallthrough */ - case QImode : case CQImode : - case HImode : case CHImode : - case SImode : case CSImode : - case DImode : case CDImode : + case MODE_INT: + case MODE_COMPLEX_INT: if (slotno >= SPARC_INT_ARG_MAX) return -1; regno = regbase + slotno; break; - case TFmode : case TCmode : - if (TARGET_ARCH64 && (slotno & 1) != 0) - slotno++, *ppadding = 1; - /* fallthrough */ + case MODE_RANDOM: + if (mode == VOIDmode) + /* MODE is VOIDmode when generating the actual call. */ + return -1; - case SFmode : case SCmode : - case DFmode : case DCmode : - if (TARGET_ARCH32) - { - if (slotno >= SPARC_INT_ARG_MAX) - return -1; - regno = regbase + slotno; - } - else - { - if (TARGET_FPU && named) - { - if (slotno >= SPARC_FP_ARG_MAX) - return -1; - regno = SPARC_FP_ARG_FIRST + slotno * 2; - if (mode == SFmode) - regno++; - } - else - { - if (slotno >= SPARC_INT_ARG_MAX) - return -1; - regno = regbase + slotno; - } - } - break; - - case BLKmode : - /* For sparc64, objects requiring 16 byte alignment get it. */ - if (TARGET_ARCH64) - { - if (type && TYPE_ALIGN (type) == 128 && (slotno & 1) != 0) - slotno++, *ppadding = 1; - } + gcc_assert (mode == BLKmode); if (TARGET_ARCH32 - || (type && TREE_CODE (type) == UNION_TYPE)) + || !type + || (TREE_CODE (type) != VECTOR_TYPE + && TREE_CODE (type) != RECORD_TYPE)) { if (slotno >= SPARC_INT_ARG_MAX) return -1; regno = regbase + slotno; } - else + else /* TARGET_ARCH64 && type */ { int intregs_p = 0, fpregs_p = 0, packed_p = 0; /* First see what kinds of registers we would need. */ - scan_record_type (type, &intregs_p, &fpregs_p, &packed_p); + if (TREE_CODE (type) == VECTOR_TYPE) + fpregs_p = 1; + else + scan_record_type (type, &intregs_p, &fpregs_p, &packed_p); /* The ABI obviously doesn't specify how packed structures are passed. These are defined to be passed in int regs @@ -5053,10 +4587,12 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, /* If all arg slots are filled, then must pass on stack. */ if (fpregs_p && slotno >= SPARC_FP_ARG_MAX) return -1; + /* If there are only int args and all int arg slots are filled, then must pass on stack. */ if (!fpregs_p && intregs_p && slotno >= SPARC_INT_ARG_MAX) return -1; + /* Note that even if all int arg slots are filled, fp members may still be passed in regs if such regs are available. *PREGNO isn't set because there may be more than one, it's up @@ -5066,7 +4602,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, break; default : - abort (); + gcc_unreachable (); } *pregno = regno; @@ -5129,9 +4665,14 @@ function_arg_record_value_1 (tree type, HOST_WIDE_INT startbitpos, { HOST_WIDE_INT bitpos = startbitpos; - if (DECL_SIZE (field) != 0 - && host_integerp (bit_position (field), 1)) - bitpos += int_bit_position (field); + if (DECL_SIZE (field) != 0) + { + if (integer_zerop (DECL_SIZE (field))) + continue; + + if (host_integerp (bit_position (field), 1)) + bitpos += int_bit_position (field); + } /* ??? FIXME: else assume zero offset. */ @@ -5140,7 +4681,8 @@ function_arg_record_value_1 (tree type, HOST_WIDE_INT startbitpos, bitpos, parms, packed_p); - else if (FLOAT_TYPE_P (TREE_TYPE (field)) + else if ((FLOAT_TYPE_P (TREE_TYPE (field)) + || TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE) && TARGET_FPU && parms->named && ! packed_p) @@ -5170,8 +4712,12 @@ function_arg_record_value_1 (tree type, HOST_WIDE_INT startbitpos, /* There's no need to check this_slotno < SPARC_FP_ARG MAX. If it wasn't true we wouldn't be here. */ - parms->nregs += 1; - if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE) + if (TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE + && DECL_MODE (field) == BLKmode) + parms->nregs += TYPE_VECTOR_SUBPARTS (TREE_TYPE (field)); + else if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE) + parms->nregs += 2; + else parms->nregs += 1; } else @@ -5217,8 +4763,8 @@ function_arg_record_value_3 (HOST_WIDE_INT bitpos, at the moment but may wish to revisit. */ if (intoffset % BITS_PER_WORD != 0) - mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, - MODE_INT, 0); + mode = smallest_mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD, + MODE_INT); else mode = word_mode; @@ -5267,9 +4813,14 @@ function_arg_record_value_2 (tree type, HOST_WIDE_INT startbitpos, { HOST_WIDE_INT bitpos = startbitpos; - if (DECL_SIZE (field) != 0 - && host_integerp (bit_position (field), 1)) - bitpos += int_bit_position (field); + if (DECL_SIZE (field) != 0) + { + if (integer_zerop (DECL_SIZE (field))) + continue; + + if (host_integerp (bit_position (field), 1)) + bitpos += int_bit_position (field); + } /* ??? FIXME: else assume zero offset. */ @@ -5278,40 +4829,48 @@ function_arg_record_value_2 (tree type, HOST_WIDE_INT startbitpos, bitpos, parms, packed_p); - else if (FLOAT_TYPE_P (TREE_TYPE (field)) + else if ((FLOAT_TYPE_P (TREE_TYPE (field)) + || TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE) && TARGET_FPU && parms->named && ! packed_p) { int this_slotno = parms->slotno + bitpos / BITS_PER_WORD; - int regno; + int regno, nregs, pos; enum machine_mode mode = DECL_MODE (field); rtx reg; function_arg_record_value_3 (bitpos, parms); - regno = SPARC_FP_ARG_FIRST + this_slotno * 2 - + ((mode == SFmode || mode == SCmode) - && (bitpos & 32) != 0); - switch (mode) - { - case SCmode: mode = SFmode; break; - case DCmode: mode = DFmode; break; - case TCmode: mode = TFmode; break; - default: break; + + if (TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE + && mode == BLKmode) + { + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (field))); + nregs = TYPE_VECTOR_SUBPARTS (TREE_TYPE (field)); } + else if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE) + { + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (field))); + nregs = 2; + } + else + nregs = 1; + + regno = SPARC_FP_ARG_FIRST + this_slotno * 2; + if (GET_MODE_SIZE (mode) <= 4 && (bitpos & 32) != 0) + regno++; reg = gen_rtx_REG (mode, regno); + pos = bitpos / BITS_PER_UNIT; XVECEXP (parms->ret, 0, parms->stack + parms->nregs) - = gen_rtx_EXPR_LIST (VOIDmode, reg, - GEN_INT (bitpos / BITS_PER_UNIT)); + = gen_rtx_EXPR_LIST (VOIDmode, reg, GEN_INT (pos)); parms->nregs += 1; - if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE) + while (--nregs > 0) { regno += GET_MODE_SIZE (mode) / 4; reg = gen_rtx_REG (mode, regno); + pos += GET_MODE_SIZE (mode); XVECEXP (parms->ret, 0, parms->stack + parms->nregs) - = gen_rtx_EXPR_LIST (VOIDmode, reg, - GEN_INT ((bitpos + GET_MODE_BITSIZE (mode)) - / BITS_PER_UNIT)); + = gen_rtx_EXPR_LIST (VOIDmode, reg, GEN_INT (pos)); parms->nregs += 1; } } @@ -5400,15 +4959,14 @@ function_arg_record_value (tree type, enum machine_mode mode, if (nregs + slotno > SPARC_INT_ARG_MAX) nregs = SPARC_INT_ARG_MAX - slotno; } - if (nregs == 0) - abort (); + gcc_assert (nregs != 0); parms.ret = gen_rtx_PARALLEL (mode, rtvec_alloc (parms.stack + nregs)); /* If at least one field must be passed on the stack, generate (parallel [(expr_list (nil) ...) ...]) so that all fields will also be passed on the stack. We can't do much better because the - semantics of FUNCTION_ARG_PARTIAL_NREGS doesn't handle the case + semantics of TARGET_ARG_PARTIAL_BYTES doesn't handle the case of structures for which the fields passed exclusively in registers are not at the beginning of the structure. */ if (parms.stack) @@ -5421,8 +4979,7 @@ function_arg_record_value (tree type, enum machine_mode mode, function_arg_record_value_2 (type, 0, &parms, false); function_arg_record_value_3 (typesize * BITS_PER_UNIT, &parms); - if (parms.nregs != nregs) - abort (); + gcc_assert (parms.nregs == nregs); return parms.ret; } @@ -5450,14 +5007,47 @@ function_arg_union_value (int size, enum machine_mode mode, int slotno, if (slotno == SPARC_INT_ARG_MAX - 1) nwords = 1; - /* Unions are passed left-justified. */ regs = gen_rtx_PARALLEL (mode, rtvec_alloc (nwords)); for (i = 0; i < nwords; i++) - XVECEXP (regs, 0, i) - = gen_rtx_EXPR_LIST (VOIDmode, - gen_rtx_REG (word_mode, regno + i), - GEN_INT (UNITS_PER_WORD * i)); + { + /* Unions are passed left-justified. */ + XVECEXP (regs, 0, i) + = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (word_mode, regno), + GEN_INT (UNITS_PER_WORD * i)); + regno++; + } + + return regs; +} + +/* Used by function_arg and function_value to implement the conventions + for passing and returning large (BLKmode) vectors. + Return an expression valid as a return value for the two macros + FUNCTION_ARG and FUNCTION_VALUE. + + SIZE is the size in bytes of the vector. + BASE_MODE is the argument's base machine mode. + REGNO is the FP hard register the vector will be passed in. */ + +static rtx +function_arg_vector_value (int size, enum machine_mode base_mode, int regno) +{ + unsigned short base_mode_size = GET_MODE_SIZE (base_mode); + int nregs = size / base_mode_size, i; + rtx regs; + + regs = gen_rtx_PARALLEL (BLKmode, rtvec_alloc (nregs)); + + for (i = 0; i < nregs; i++) + { + XVECEXP (regs, 0, i) + = gen_rtx_EXPR_LIST (VOIDmode, + gen_rtx_REG (base_mode, regno), + GEN_INT (base_mode_size * i)); + regno += base_mode_size / 4; + } return regs; } @@ -5485,48 +5075,59 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, ? SPARC_INCOMING_INT_ARG_FIRST : SPARC_OUTGOING_INT_ARG_FIRST); int slotno, regno, padding; - rtx reg; + enum mode_class mclass = GET_MODE_CLASS (mode); slotno = function_arg_slotno (cum, mode, type, named, incoming_p, ®no, &padding); - if (slotno == -1) return 0; - if (TARGET_ARCH32) + /* Vector types deserve special treatment because they are polymorphic wrt + their mode, depending upon whether VIS instructions are enabled. */ + if (type && TREE_CODE (type) == VECTOR_TYPE) { - reg = gen_rtx_REG (mode, regno); - return reg; + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert ((TARGET_ARCH32 && size <= 8) + || (TARGET_ARCH64 && size <= 16)); + + if (mode == BLKmode) + return function_arg_vector_value (size, + TYPE_MODE (TREE_TYPE (type)), + SPARC_FP_ARG_FIRST + 2*slotno); + else + mclass = MODE_FLOAT; } - + + if (TARGET_ARCH32) + return gen_rtx_REG (mode, regno); + + /* Structures up to 16 bytes in size are passed in arg slots on the stack + and are promoted to registers if possible. */ if (type && TREE_CODE (type) == RECORD_TYPE) { - /* Structures up to 16 bytes in size are passed in arg slots on the - stack and are promoted to registers where possible. */ - - if (int_size_in_bytes (type) > 16) - abort (); /* shouldn't get here */ + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert (size <= 16); return function_arg_record_value (type, mode, slotno, named, regbase); } + + /* Unions up to 16 bytes in size are passed in integer registers. */ else if (type && TREE_CODE (type) == UNION_TYPE) { HOST_WIDE_INT size = int_size_in_bytes (type); - - if (size > 16) - abort (); /* shouldn't get here */ + gcc_assert (size <= 16); return function_arg_union_value (size, mode, slotno, regno); } + /* v9 fp args in reg slots beyond the int reg slots get passed in regs but also have the slot allocated for them. If no prototype is in scope fp values in register slots get passed in two places, either fp regs and int regs or fp regs and memory. */ - else if ((GET_MODE_CLASS (mode) == MODE_FLOAT - || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) - && SPARC_FP_REG_P (regno)) + else if ((mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT) + && SPARC_FP_REG_P (regno)) { - reg = gen_rtx_REG (mode, regno); + rtx reg = gen_rtx_REG (mode, regno); if (cum->prototype_p || cum->libcall_p) { /* "* 2" because fp reg numbers are recorded in 4 byte @@ -5587,18 +5188,22 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, } } } - else + + /* All other aggregate types are passed in an integer register in a mode + corresponding to the size of the type. */ + else if (type && AGGREGATE_TYPE_P (type)) { - /* Scalar or complex int. */ - reg = gen_rtx_REG (mode, regno); + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert (size <= 16); + + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); } - return reg; + return gen_rtx_REG (mode, regno); } -/* Handle the FUNCTION_ARG_PARTIAL_NREGS macro. - For an arg passed partly in registers and partly in memory, - this is the number of registers used. +/* For an arg passed partly in registers and partly in memory, + this is the number of bytes of registers used. For args passed entirely in registers or entirely in memory, zero. Any arg that starts in the first 6 regs but won't entirely fit in them @@ -5607,9 +5212,9 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, values that begin in the last fp reg [where "last fp reg" varies with the mode] will be split between that reg and memory. */ -int -function_arg_partial_nregs (const struct sparc_args *cum, - enum machine_mode mode, tree type, int named) +static int +sparc_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, bool named) { int slotno, regno, padding; @@ -5624,84 +5229,92 @@ function_arg_partial_nregs (const struct sparc_args *cum, if ((slotno + (mode == BLKmode ? ROUND_ADVANCE (int_size_in_bytes (type)) : ROUND_ADVANCE (GET_MODE_SIZE (mode)))) - > NPARM_REGS (SImode)) - return NPARM_REGS (SImode) - slotno; - return 0; + > SPARC_INT_ARG_MAX) + return (SPARC_INT_ARG_MAX - slotno) * UNITS_PER_WORD; } else { + /* We are guaranteed by pass_by_reference that the size of the + argument is not greater than 16 bytes, so we only need to return + one word if the argument is partially passed in registers. */ + if (type && AGGREGATE_TYPE_P (type)) { int size = int_size_in_bytes (type); - int align = TYPE_ALIGN (type); - if (align == 16) - slotno += slotno & 1; - if (size > 8 && size <= 16 + if (size > UNITS_PER_WORD && slotno == SPARC_INT_ARG_MAX - 1) - return 1; + return UNITS_PER_WORD; } else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT && ! (TARGET_FPU && named))) { /* The complex types are passed as packed types. */ - if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD) - return 0; - - if (GET_MODE_ALIGNMENT (mode) == 128) - { - slotno += slotno & 1; - - /* ??? The mode needs 3 slots? */ - if (slotno == SPARC_INT_ARG_MAX - 2) - return 1; - } - else - { - if (slotno == SPARC_INT_ARG_MAX - 1) - return 1; - } + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD + && slotno == SPARC_INT_ARG_MAX - 1) + return UNITS_PER_WORD; } else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT) { - if (GET_MODE_ALIGNMENT (mode) == 128) - slotno += slotno & 1; if ((slotno + GET_MODE_SIZE (mode) / UNITS_PER_WORD) > SPARC_FP_ARG_MAX) - return 1; + return UNITS_PER_WORD; } - return 0; } + + return 0; } -/* Handle the FUNCTION_ARG_PASS_BY_REFERENCE macro. - !v9: The SPARC ABI stipulates passing struct arguments (of any size) and - quad-precision floats by invisible reference. - v9: Aggregates greater than 16 bytes are passed by reference. - For Pascal, also pass arrays by reference. */ +/* Handle the TARGET_PASS_BY_REFERENCE target hook. + Specify whether to pass the argument by reference. */ -int -function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED, - enum machine_mode mode, tree type, - int named ATTRIBUTE_UNUSED) +static bool +sparc_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode, tree type, + bool named ATTRIBUTE_UNUSED) { if (TARGET_ARCH32) - { - return ((type && AGGREGATE_TYPE_P (type)) - || mode == SCmode - || GET_MODE_SIZE (mode) > 8); - } + /* Original SPARC 32-bit ABI says that structures and unions, + and quad-precision floats are passed by reference. For Pascal, + also pass arrays by reference. All other base types are passed + in registers. + + Extended ABI (as implemented by the Sun compiler) says that all + complex floats are passed by reference. Pass complex integers + in registers up to 8 bytes. More generally, enforce the 2-word + cap for passing arguments in registers. + + Vector ABI (as implemented by the Sun VIS SDK) says that vector + integers are passed like floats of the same size, that is in + registers up to 8 bytes. Pass all vector floats by reference + like structure and unions. */ + return ((type && (AGGREGATE_TYPE_P (type) || VECTOR_FLOAT_TYPE_P (type))) + || mode == SCmode + /* Catch CDImode, TFmode, DCmode and TCmode. */ + || GET_MODE_SIZE (mode) > 8 + || (type + && TREE_CODE (type) == VECTOR_TYPE + && (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8)); else - { - return ((type && TREE_CODE (type) == ARRAY_TYPE) - /* Consider complex values as aggregates, so care - for CTImode and TCmode. */ - || GET_MODE_SIZE (mode) > 16 - || (type - && AGGREGATE_TYPE_P (type) - && (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 16)); - } + /* Original SPARC 64-bit ABI says that structures and unions + smaller than 16 bytes are passed in registers, as well as + all other base types. + + Extended ABI (as implemented by the Sun compiler) says that + complex floats are passed in registers up to 16 bytes. Pass + all complex integers in registers up to 16 bytes. More generally, + enforce the 2-word cap for passing arguments in registers. + + Vector ABI (as implemented by the Sun VIS SDK) says that vector + integers are passed like floats of the same size, that is in + registers (up to 16 bytes). Pass all vector floats like structure + and unions. */ + return ((type + && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE) + && (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 16) + /* Catch CTImode and TCmode. */ + || GET_MODE_SIZE (mode) > 16); } /* Handle the FUNCTION_ARG_ADVANCE macro. @@ -5764,50 +5377,177 @@ function_arg_padding (enum machine_mode mode, tree type) return DEFAULT_FUNCTION_ARG_PADDING (mode, type); } +/* Handle the TARGET_RETURN_IN_MEMORY target hook. + Specify whether to return the return value in memory. */ + +static bool +sparc_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) +{ + if (TARGET_ARCH32) + /* Original SPARC 32-bit ABI says that structures and unions, + and quad-precision floats are returned in memory. All other + base types are returned in registers. + + Extended ABI (as implemented by the Sun compiler) says that + all complex floats are returned in registers (8 FP registers + at most for '_Complex long double'). Return all complex integers + in registers (4 at most for '_Complex long long'). + + Vector ABI (as implemented by the Sun VIS SDK) says that vector + integers are returned like floats of the same size, that is in + registers up to 8 bytes and in memory otherwise. Return all + vector floats in memory like structure and unions; note that + they always have BLKmode like the latter. */ + return (TYPE_MODE (type) == BLKmode + || TYPE_MODE (type) == TFmode + || (TREE_CODE (type) == VECTOR_TYPE + && (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8)); + else + /* Original SPARC 64-bit ABI says that structures and unions + smaller than 32 bytes are returned in registers, as well as + all other base types. + + Extended ABI (as implemented by the Sun compiler) says that all + complex floats are returned in registers (8 FP registers at most + for '_Complex long double'). Return all complex integers in + registers (4 at most for '_Complex TItype'). + + Vector ABI (as implemented by the Sun VIS SDK) says that vector + integers are returned like floats of the same size, that is in + registers. Return all vector floats like structure and unions; + note that they always have BLKmode like the latter. */ + return ((TYPE_MODE (type) == BLKmode + && (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 32)); +} + +/* Handle the TARGET_STRUCT_VALUE target hook. + Return where to find the structure return value address. */ + +static rtx +sparc_struct_value_rtx (tree fndecl, int incoming) +{ + if (TARGET_ARCH64) + return 0; + else + { + rtx mem; + + if (incoming) + mem = gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx, + STRUCT_VALUE_OFFSET)); + else + mem = gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, + STRUCT_VALUE_OFFSET)); + + /* Only follow the SPARC ABI for fixed-size structure returns. + Variable size structure returns are handled per the normal + procedures in GCC. This is enabled by -mstd-struct-return */ + if (incoming == 2 + && sparc_std_struct_return + && TYPE_SIZE_UNIT (TREE_TYPE (fndecl)) + && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (fndecl))) == INTEGER_CST) + { + /* We must check and adjust the return address, as it is + optional as to whether the return object is really + provided. */ + rtx ret_rtx = gen_rtx_REG (Pmode, 31); + rtx scratch = gen_reg_rtx (SImode); + rtx endlab = gen_label_rtx (); + + /* Calculate the return object size */ + tree size = TYPE_SIZE_UNIT (TREE_TYPE (fndecl)); + rtx size_rtx = GEN_INT (TREE_INT_CST_LOW (size) & 0xfff); + /* Construct a temporary return value */ + rtx temp_val = assign_stack_local (Pmode, TREE_INT_CST_LOW (size), 0); + + /* Implement SPARC 32-bit psABI callee returns struck checking + requirements: + + Fetch the instruction where we will return to and see if + it's an unimp instruction (the most significant 10 bits + will be zero). */ + emit_move_insn (scratch, gen_rtx_MEM (SImode, + plus_constant (ret_rtx, 8))); + /* Assume the size is valid and pre-adjust */ + emit_insn (gen_add3_insn (ret_rtx, ret_rtx, GEN_INT (4))); + emit_cmp_and_jump_insns (scratch, size_rtx, EQ, const0_rtx, SImode, 0, endlab); + emit_insn (gen_sub3_insn (ret_rtx, ret_rtx, GEN_INT (4))); + /* Assign stack temp: + Write the address of the memory pointed to by temp_val into + the memory pointed to by mem */ + emit_move_insn (mem, XEXP (temp_val, 0)); + emit_label (endlab); + } + + set_mem_alias_set (mem, struct_value_alias_set); + return mem; + } +} + /* Handle FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE, and LIBCALL_VALUE macros. For v9, function return values are subject to the same rules as arguments, - except that up to 32-bytes may be returned in registers. */ + except that up to 32 bytes may be returned in registers. */ rtx function_value (tree type, enum machine_mode mode, int incoming_p) { + /* Beware that the two values are swapped here wrt function_arg. */ + int regbase = (incoming_p + ? SPARC_OUTGOING_INT_ARG_FIRST + : SPARC_INCOMING_INT_ARG_FIRST); + enum mode_class mclass = GET_MODE_CLASS (mode); int regno; + /* Vector types deserve special treatment because they are polymorphic wrt + their mode, depending upon whether VIS instructions are enabled. */ + if (type && TREE_CODE (type) == VECTOR_TYPE) + { + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert ((TARGET_ARCH32 && size <= 8) + || (TARGET_ARCH64 && size <= 32)); + + if (mode == BLKmode) + return function_arg_vector_value (size, + TYPE_MODE (TREE_TYPE (type)), + SPARC_FP_ARG_FIRST); + else + mclass = MODE_FLOAT; + } + if (TARGET_ARCH64 && type) { - int regbase = (incoming_p - ? SPARC_OUTGOING_INT_ARG_FIRST - : SPARC_INCOMING_INT_ARG_FIRST); - + /* Structures up to 32 bytes in size are returned in registers. */ if (TREE_CODE (type) == RECORD_TYPE) { - /* Structures up to 32 bytes in size are passed in registers, - promoted to fp registers where possible. */ - - if (int_size_in_bytes (type) > 32) - abort (); /* shouldn't get here */ + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert (size <= 32); return function_arg_record_value (type, mode, 0, 1, regbase); } + + /* Unions up to 32 bytes in size are returned in integer registers. */ else if (TREE_CODE (type) == UNION_TYPE) { HOST_WIDE_INT size = int_size_in_bytes (type); - - if (size > 32) - abort (); /* shouldn't get here */ + gcc_assert (size <= 32); return function_arg_union_value (size, mode, 0, regbase); } + + /* Objects that require it are returned in FP registers. */ + else if (mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT) + ; + + /* All other aggregate types are returned in an integer register in a + mode corresponding to the size of the type. */ else if (AGGREGATE_TYPE_P (type)) { /* All other aggregate types are passed in an integer register in a mode corresponding to the size of the type. */ - HOST_WIDE_INT bytes = int_size_in_bytes (type); + HOST_WIDE_INT size = int_size_in_bytes (type); + gcc_assert (size <= 32); - if (bytes > 32) - abort (); - - mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0); + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); /* ??? We probably should have made the same ABI change in 3.4.0 as the one we made for unions. The latter was @@ -5819,17 +5559,20 @@ function_value (tree type, enum machine_mode mode, int incoming_p) try to be unduly clever, and simply follow the ABI for unions in that case. */ if (mode == BLKmode) - return function_arg_union_value (bytes, mode, 0, regbase); + return function_arg_union_value (size, mode, 0, regbase); + else + mclass = MODE_INT; } - else if (GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_SIZE (mode) < UNITS_PER_WORD) + + /* This must match PROMOTE_FUNCTION_MODE. */ + else if (mclass == MODE_INT && GET_MODE_SIZE (mode) < UNITS_PER_WORD) mode = word_mode; } - if (incoming_p) - regno = BASE_RETURN_VALUE_REG (mode); + if ((mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT) && TARGET_FPU) + regno = SPARC_FP_ARG_FIRST; else - regno = BASE_OUTGOING_VALUE_REG (mode); + regno = regbase; return gen_rtx_REG (mode, regno); } @@ -5838,14 +5581,14 @@ function_value (tree type, enum machine_mode mode, int incoming_p) to determine if stdarg or varargs is used and return the address of the first unnamed parameter. */ -rtx +static rtx sparc_builtin_saveregs (void) { int first_reg = current_function_args_info.words; rtx address; int regno; - for (regno = first_reg; regno < NPARM_REGS (word_mode); regno++) + for (regno = first_reg; regno < SPARC_INT_ARG_MAX; regno++) emit_move_insn (gen_rtx_MEM (word_mode, gen_rtx_PLUS (Pmode, frame_pointer_rtx, @@ -5853,7 +5596,7 @@ sparc_builtin_saveregs (void) + (UNITS_PER_WORD * regno)))), gen_rtx_REG (word_mode, - BASE_INCOMING_ARG_REG (word_mode) + regno)); + SPARC_INCOMING_INT_ARG_FIRST + regno)); address = gen_rtx_PLUS (Pmode, frame_pointer_rtx, @@ -5863,7 +5606,7 @@ sparc_builtin_saveregs (void) return address; } -/* Implement `va_start' for varargs and stdarg. */ +/* Implement `va_start' for stdarg. */ void sparc_va_start (tree valist, rtx nextarg) @@ -5872,119 +5615,105 @@ sparc_va_start (tree valist, rtx nextarg) std_expand_builtin_va_start (valist, nextarg); } -/* Implement `va_arg'. */ +/* Implement `va_arg' for stdarg. */ -rtx -sparc_va_arg (tree valist, tree type) +static tree +sparc_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { HOST_WIDE_INT size, rsize, align; tree addr, incr; - rtx addr_rtx; - int indirect = 0; + bool indirect; + tree ptrtype = build_pointer_type (type); - /* Round up sizeof(type) to a word. */ - size = int_size_in_bytes (type); - rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; - align = 0; - - if (TARGET_ARCH64) + if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) { - if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD) - align = 2 * UNITS_PER_WORD; - - /* Consider complex values as aggregates, so care - for CTImode and TCmode. */ - if ((unsigned HOST_WIDE_INT) size > 16) - { - indirect = 1; - size = rsize = UNITS_PER_WORD; - align = 0; - } - else if (AGGREGATE_TYPE_P (type)) - { - /* SPARC-V9 ABI states that structures up to 16 bytes in size - are given whole slots as needed. */ - if (size == 0) - size = rsize = UNITS_PER_WORD; - else - size = rsize; - } + indirect = true; + size = rsize = UNITS_PER_WORD; + align = 0; } else { - if (AGGREGATE_TYPE_P (type) - || TYPE_MODE (type) == SCmode - || GET_MODE_SIZE (TYPE_MODE (type)) > 8) + indirect = false; + size = int_size_in_bytes (type); + rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; + align = 0; + + if (TARGET_ARCH64) { - indirect = 1; - size = rsize = UNITS_PER_WORD; + /* For SPARC64, objects requiring 16-byte alignment get it. */ + if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD) + align = 2 * UNITS_PER_WORD; + + /* SPARC-V9 ABI states that structures up to 16 bytes in size + are left-justified in their slots. */ + if (AGGREGATE_TYPE_P (type)) + { + if (size == 0) + size = rsize = UNITS_PER_WORD; + else + size = rsize; + } } } incr = valist; if (align) { - incr = fold (build (PLUS_EXPR, ptr_type_node, incr, - build_int_2 (align - 1, 0))); - incr = fold (build (BIT_AND_EXPR, ptr_type_node, incr, - build_int_2 (-align, -1))); + incr = fold (build2 (PLUS_EXPR, ptr_type_node, incr, + ssize_int (align - 1))); + incr = fold (build2 (BIT_AND_EXPR, ptr_type_node, incr, + ssize_int (-align))); } - addr = incr = save_expr (incr); + gimplify_expr (&incr, pre_p, post_p, is_gimple_val, fb_rvalue); + addr = incr; + if (BYTES_BIG_ENDIAN && size < rsize) + addr = fold (build2 (PLUS_EXPR, ptr_type_node, incr, + ssize_int (rsize - size))); + + if (indirect) { - addr = fold (build (PLUS_EXPR, ptr_type_node, incr, - build_int_2 (rsize - size, 0))); + addr = fold_convert (build_pointer_type (ptrtype), addr); + addr = build_va_arg_indirect_ref (addr); } - incr = fold (build (PLUS_EXPR, ptr_type_node, incr, - build_int_2 (rsize, 0))); - - incr = build (MODIFY_EXPR, ptr_type_node, valist, incr); - TREE_SIDE_EFFECTS (incr) = 1; - expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL); - - addr_rtx = expand_expr (addr, NULL, Pmode, EXPAND_NORMAL); - /* If the address isn't aligned properly for the type, we may need to copy to a temporary. FIXME: This is inefficient. Usually we can do this in registers. */ - if (align == 0 - && TYPE_ALIGN (type) > BITS_PER_WORD - && !indirect) + else if (align == 0 + && TYPE_ALIGN (type) > BITS_PER_WORD) { - /* FIXME: We really need to specify that the temporary is live - for the whole function because expand_builtin_va_arg wants - the alias set to be get_varargs_alias_set (), but in this - case the alias set is that for TYPE and if the memory gets - reused it will be reused with alias set TYPE. */ - rtx tmp = assign_temp (type, 0, 1, 0); - rtx dest_addr; + tree tmp = create_tmp_var (type, "va_arg_tmp"); + tree dest_addr = build_fold_addr_expr (tmp); - addr_rtx = force_reg (Pmode, addr_rtx); - addr_rtx = gen_rtx_MEM (BLKmode, addr_rtx); - set_mem_alias_set (addr_rtx, get_varargs_alias_set ()); - set_mem_align (addr_rtx, BITS_PER_WORD); - tmp = shallow_copy_rtx (tmp); - PUT_MODE (tmp, BLKmode); - set_mem_alias_set (tmp, 0); - - dest_addr = emit_block_move (tmp, addr_rtx, GEN_INT (rsize), - BLOCK_OP_NORMAL); - if (dest_addr != NULL_RTX) - addr_rtx = dest_addr; - else - addr_rtx = XCEXP (tmp, 0, MEM); + tree copy = build_function_call_expr + (implicit_built_in_decls[BUILT_IN_MEMCPY], + tree_cons (NULL_TREE, dest_addr, + tree_cons (NULL_TREE, addr, + tree_cons (NULL_TREE, size_int (rsize), + NULL_TREE)))); + + gimplify_and_add (copy, pre_p); + addr = dest_addr; } + else + addr = fold_convert (ptrtype, addr); - if (indirect) - { - addr_rtx = force_reg (Pmode, addr_rtx); - addr_rtx = gen_rtx_MEM (Pmode, addr_rtx); - set_mem_alias_set (addr_rtx, get_varargs_alias_set ()); - } + incr = fold (build2 (PLUS_EXPR, ptr_type_node, incr, ssize_int (rsize))); + incr = build2 (MODIFY_EXPR, ptr_type_node, valist, incr); + gimplify_and_add (incr, post_p); - return addr_rtx; + return build_va_arg_indirect_ref (addr); +} + +/* Implement the TARGET_VECTOR_MODE_SUPPORTED_P target hook. + Specify whether the vector mode is supported by the hardware. */ + +static bool +sparc_vector_mode_supported_p (enum machine_mode mode) +{ + return TARGET_VIS && VECTOR_MODE_P (mode) ? true : false; } /* Return the string to output an unconditional branch to LABEL, which is @@ -5996,51 +5725,29 @@ const char * output_ubranch (rtx dest, int label, rtx insn) { static char string[64]; - bool noop = false; + bool v9_form = false; char *p; - /* TurboSPARC is reported to have problems with - with - foo: b,a foo - i.e. an empty loop with the annul bit set. The workaround is to use - foo: b foo; nop - instead. */ - - if (! TARGET_V9 && flag_delayed_branch - && (INSN_ADDRESSES (INSN_UID (dest)) - == INSN_ADDRESSES (INSN_UID (insn)))) + if (TARGET_V9 && INSN_ADDRESSES_SET_P ()) { - strcpy (string, "b\t"); - noop = true; + int delta = (INSN_ADDRESSES (INSN_UID (dest)) + - INSN_ADDRESSES (INSN_UID (insn))); + /* Leave some instructions for "slop". */ + if (delta >= -260000 && delta < 260000) + v9_form = true; } + + if (v9_form) + strcpy (string, "ba%*,pt\t%%xcc, "); else - { - bool v9_form = false; - - if (TARGET_V9 && INSN_ADDRESSES_SET_P ()) - { - int delta = (INSN_ADDRESSES (INSN_UID (dest)) - - INSN_ADDRESSES (INSN_UID (insn))); - /* Leave some instructions for "slop". */ - if (delta >= -260000 && delta < 260000) - v9_form = true; - } - - if (v9_form) - strcpy (string, "ba%*,pt\t%%xcc, "); - else - strcpy (string, "b%*\t"); - } + strcpy (string, "b%*\t"); p = strchr (string, '\0'); *p++ = '%'; *p++ = 'l'; *p++ = '0' + label; *p++ = '%'; - if (noop) - *p++ = '#'; - else - *p++ = '('; + *p++ = '('; *p = '\0'; return string; @@ -6055,15 +5762,13 @@ output_ubranch (rtx dest, int label, rtx insn) REVERSED is nonzero if we should reverse the sense of the comparison. - ANNUL is nonzero if we should generate an annulling branch. + ANNUL is nonzero if we should generate an annulling branch. */ - NOOP is nonzero if we have to follow this branch by a noop. */ - -char * +const char * output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, - int noop, rtx insn) + rtx insn) { - static char string[50]; + static char string[64]; enum rtx_code code = GET_CODE (op); rtx cc_reg = XEXP (op, 0); enum machine_mode mode = GET_MODE (cc_reg); @@ -6079,7 +5784,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, to be,pn %xcc, .+12 - nop + nop ba .LC30 and @@ -6089,7 +5794,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, to fbe,pt %fcc2, .+16 - nop + nop ba .LC29 */ far = TARGET_V9 && (get_attr_length (insn) >= 3); @@ -6152,7 +5857,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, break; default: - abort (); + gcc_unreachable (); } /* ??? !v9: FP branches cannot be preceded by another floating point @@ -6207,7 +5912,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, break; default: - abort (); + gcc_unreachable (); } strcpy (string, branch); } @@ -6244,17 +5949,14 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, labelno = v9_fcc_labelno; if (v8) { - if (REGNO (cc_reg) == SPARC_FCC_REG) - labelno = ""; - else - abort (); + gcc_assert (REGNO (cc_reg) == SPARC_FCC_REG); + labelno = ""; } } else if (mode == CCXmode || mode == CCX_NOOVmode) { labelno = "%%xcc, "; - if (v8) - abort (); + gcc_assert (! v8); } else { @@ -6283,19 +5985,19 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, p = strchr (p, '\0'); if (far) { - strcpy (p, ".+12\n\tnop\n\tb\t"); - if (annul || noop) + strcpy (p, ".+12\n\t nop\n\tb\t"); + /* Skip the next insn if requested or + if we know that it will be a nop. */ + if (annul || ! final_sequence) p[3] = '6'; - p += 13; + p += 14; } *p++ = '%'; *p++ = 'l'; - /* Set the char indicating the number of the operand containing the - label_ref. */ *p++ = label + '0'; + *p++ = '%'; + *p++ = '#'; *p = '\0'; - if (noop) - strcpy (p, "\n\tnop"); return string; } @@ -6350,8 +6052,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) break; default: - abort(); - break; + gcc_unreachable (); } if (TARGET_ARCH64) @@ -6359,7 +6060,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) if (GET_CODE (x) != MEM) { slot0 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0); - emit_insn (gen_rtx_SET (VOIDmode, slot0, x)); + emit_move_insn (slot0, x); } else slot0 = x; @@ -6367,7 +6068,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) if (GET_CODE (y) != MEM) { slot1 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0); - emit_insn (gen_rtx_SET (VOIDmode, slot1, y)); + emit_move_insn (slot1, y); } else slot1 = y; @@ -6443,14 +6144,12 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) optabs would emit if we didn't have TFmode patterns. */ void -sparc_emit_floatunsdi (rtx *operands) +sparc_emit_floatunsdi (rtx *operands, enum machine_mode mode) { rtx neglab, donelab, i0, i1, f0, in, out; - enum machine_mode mode; out = operands[0]; in = force_reg (DImode, operands[1]); - mode = GET_MODE (out); neglab = gen_label_rtx (); donelab = gen_label_rtx (); i0 = gen_reg_rtx (DImode); @@ -6474,6 +6173,47 @@ sparc_emit_floatunsdi (rtx *operands) emit_label (donelab); } +/* Generate an FP to unsigned DImode conversion. This is the same code + optabs would emit if we didn't have TFmode patterns. */ + +void +sparc_emit_fixunsdi (rtx *operands, enum machine_mode mode) +{ + rtx neglab, donelab, i0, i1, f0, in, out, limit; + + out = operands[0]; + in = force_reg (mode, operands[1]); + neglab = gen_label_rtx (); + donelab = gen_label_rtx (); + i0 = gen_reg_rtx (DImode); + i1 = gen_reg_rtx (DImode); + limit = gen_reg_rtx (mode); + f0 = gen_reg_rtx (mode); + + emit_move_insn (limit, + CONST_DOUBLE_FROM_REAL_VALUE ( + REAL_VALUE_ATOF ("9223372036854775808.0", mode), mode)); + emit_cmp_and_jump_insns (in, limit, GE, NULL_RTX, mode, 0, neglab); + + emit_insn (gen_rtx_SET (VOIDmode, + out, + gen_rtx_FIX (DImode, gen_rtx_FIX (mode, in)))); + emit_jump_insn (gen_jump (donelab)); + emit_barrier (); + + emit_label (neglab); + + emit_insn (gen_rtx_SET (VOIDmode, f0, gen_rtx_MINUS (mode, in, limit))); + emit_insn (gen_rtx_SET (VOIDmode, + i0, + gen_rtx_FIX (DImode, gen_rtx_FIX (mode, f0)))); + emit_insn (gen_movdi (i1, const1_rtx)); + emit_insn (gen_ashldi3 (i1, i1, GEN_INT (63))); + emit_insn (gen_xordi3 (out, i0, i1)); + + emit_label (donelab); +} + /* Return the string to output a conditional branch to LABEL, testing register REG. LABEL is the operand number of the label; REG is the operand number of the reg. OP is the conditional expression. The mode @@ -6483,15 +6223,13 @@ sparc_emit_floatunsdi (rtx *operands) REVERSED is nonzero if we should reverse the sense of the comparison. - ANNUL is nonzero if we should generate an annulling branch. + ANNUL is nonzero if we should generate an annulling branch. */ - NOOP is nonzero if we have to follow this branch by a noop. */ - -char * +const char * output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, - int annul, int noop, rtx insn) + int annul, rtx insn) { - static char string[50]; + static char string[64]; enum rtx_code code = GET_CODE (op); enum machine_mode mode = GET_MODE (XEXP (op, 0)); rtx note; @@ -6506,7 +6244,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, to brz,pn %g1, .+12 - nop + nop ba,pt %xcc, .LC30 and @@ -6516,7 +6254,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, to brlz,pt %o1, .+16 - nop + nop ba,pt %xcc, .LC29 */ far = get_attr_length (insn) >= 3; @@ -6526,8 +6264,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, code = reverse_condition (code); /* Only 64 bit versions of these instructions exist. */ - if (mode != DImode) - abort (); + gcc_assert (mode == DImode); /* Start by writing the branch condition. */ @@ -6558,7 +6295,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, break; default: - abort (); + gcc_unreachable (); } p = strchr (string, '\0'); @@ -6597,10 +6334,12 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, veryfar = 0; } - strcpy (p, ".+12\n\tnop\n\t"); - if (annul || noop) + strcpy (p, ".+12\n\t nop\n\t"); + /* Skip the next insn if requested or + if we know that it will be a nop. */ + if (annul || ! final_sequence) p[3] = '6'; - p += 11; + p += 12; if (veryfar) { strcpy (p, "b\t"); @@ -6615,11 +6354,10 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, *p++ = '%'; *p++ = 'l'; *p++ = '0' + label; + *p++ = '%'; + *p++ = '#'; *p = '\0'; - if (noop) - strcpy (p, "\n\tnop"); - return string; } @@ -6646,7 +6384,7 @@ epilogue_renumber (register rtx *where, int test) if (REGNO (*where) >= 8 && REGNO (*where) < 24) /* oX or lX */ return 1; if (! test && REGNO (*where) >= 24 && REGNO (*where) < 32) - *where = gen_rtx (REG, GET_MODE (*where), OUTGOING_REGNO (REGNO(*where))); + *where = gen_rtx_REG (GET_MODE (*where), OUTGOING_REGNO (REGNO(*where))); case SCRATCH: case CC0: case PC: @@ -6733,8 +6471,7 @@ int sparc_splitdi_legitimate (rtx reg, rtx mem) { /* Punt if we are here by mistake. */ - if (! reload_completed) - abort (); + gcc_assert (reload_completed); /* We must have an offsettable memory reference. */ if (! offsettable_memref_p (mem)) @@ -6916,42 +6653,60 @@ print_operand (FILE *file, rtx x, int code) switch (code) { case '#': - /* Output a 'nop' if there's nothing for the delay slot. */ - if (dbr_sequence_length () == 0) + /* Output an insn in a delay slot. */ + if (final_sequence) + sparc_indent_opcode = 1; + else fputs ("\n\t nop", file); return; case '*': /* Output an annul flag if there's nothing for the delay slot and we - are optimizing. This is always used with '(' below. */ - /* Sun OS 4.1.1 dbx can't handle an annulled unconditional branch; - this is a dbx bug. So, we only do this when optimizing. */ - /* On UltraSPARC, a branch in a delay slot causes a pipeline flush. + are optimizing. This is always used with '(' below. + Sun OS 4.1.1 dbx can't handle an annulled unconditional branch; + this is a dbx bug. So, we only do this when optimizing. + On UltraSPARC, a branch in a delay slot causes a pipeline flush. Always emit a nop in case the next instruction is a branch. */ - if (dbr_sequence_length () == 0 - && (optimize && (int)sparc_cpu < PROCESSOR_V9)) + if (! final_sequence && (optimize && (int)sparc_cpu < PROCESSOR_V9)) fputs (",a", file); return; case '(': /* Output a 'nop' if there's nothing for the delay slot and we are not optimizing. This is always used with '*' above. */ - if (dbr_sequence_length () == 0 - && ! (optimize && (int)sparc_cpu < PROCESSOR_V9)) + if (! final_sequence && ! (optimize && (int)sparc_cpu < PROCESSOR_V9)) fputs ("\n\t nop", file); + else if (final_sequence) + sparc_indent_opcode = 1; + return; + case ')': + /* Output the right displacement from the saved PC on function return. + The caller may have placed an "unimp" insn immediately after the call + so we have to account for it. This insn is used in the 32-bit ABI + when calling a function that returns a non zero-sized structure. The + 64-bit ABI doesn't have it. Be careful to have this test be the same + as that used on the call. The exception here is that when + sparc_std_struct_return is enabled, the psABI is followed exactly + and the adjustment is made by the code in sparc_struct_value_rtx. + The call emitted is the same when sparc_std_struct_return is + present. */ + if (! TARGET_ARCH64 + && current_function_returns_struct + && ! sparc_std_struct_return + && (TREE_CODE (DECL_SIZE (DECL_RESULT (current_function_decl))) + == INTEGER_CST) + && ! integer_zerop (DECL_SIZE (DECL_RESULT (current_function_decl)))) + fputs ("12", file); + else + fputc ('8', file); return; case '_': /* Output the Embedded Medium/Anywhere code model base register. */ fputs (EMBMEDANY_BASE_REG, file); return; - case '@': - /* Print out what we are using as the frame pointer. This might - be %fp, or might be %sp+offset. */ - /* ??? What if offset is too big? Perhaps the caller knows it isn't? */ - fprintf (file, "%s+"HOST_WIDE_INT_PRINT_DEC, frame_base_name, frame_base_offset); - return; case '&': /* Print some local dynamic TLS name. */ assemble_name (file, get_some_local_dynamic_name ()); return; + case 'Y': /* Adjust the operand to take into account a RESTORE operation. */ if (GET_CODE (x) == CONST_INT) @@ -7005,7 +6760,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_MODE (x) == CCXmode) fputs ("%xcc", file); else - abort (); + gcc_unreachable (); } else /* %fccN register */ @@ -7308,7 +7063,7 @@ sparc_type_code (register tree type) /* Carefully distinguish all the standard types of C, without messing up if the language is not C. We do this by - testing TYPE_PRECISION and TREE_UNSIGNED. The old code used to + testing TYPE_PRECISION and TYPE_UNSIGNED. The old code used to look at both the names and the above fields, but that's redundant. Any type whose size is between two C types will be considered to be the wider of the two types. Also, we do not have a @@ -7318,16 +7073,16 @@ sparc_type_code (register tree type) size, but that's fine, since neither can the assembler. */ if (TYPE_PRECISION (type) <= CHAR_TYPE_SIZE) - return (qualifiers | (TREE_UNSIGNED (type) ? 12 : 2)); + return (qualifiers | (TYPE_UNSIGNED (type) ? 12 : 2)); else if (TYPE_PRECISION (type) <= SHORT_TYPE_SIZE) - return (qualifiers | (TREE_UNSIGNED (type) ? 13 : 3)); + return (qualifiers | (TYPE_UNSIGNED (type) ? 13 : 3)); else if (TYPE_PRECISION (type) <= INT_TYPE_SIZE) - return (qualifiers | (TREE_UNSIGNED (type) ? 14 : 4)); + return (qualifiers | (TYPE_UNSIGNED (type) ? 14 : 4)); else - return (qualifiers | (TREE_UNSIGNED (type) ? 15 : 5)); + return (qualifiers | (TYPE_UNSIGNED (type) ? 15 : 5)); case REAL_TYPE: /* If this is a range type, consider it to be the underlying @@ -7350,15 +7105,13 @@ sparc_type_code (register tree type) existing front-ends. */ return (qualifiers | 7); /* Who knows? */ - case CHAR_TYPE: /* GNU Pascal CHAR type. Not used in C. */ - case BOOLEAN_TYPE: /* GNU Fortran BOOLEAN type. */ - case FILE_TYPE: /* GNU Pascal FILE type. */ - case SET_TYPE: /* GNU Pascal SET type. */ + case VECTOR_TYPE: + case BOOLEAN_TYPE: /* Boolean truth value type. */ case LANG_TYPE: /* ? */ return qualifiers; default: - abort (); /* Not a type! */ + gcc_unreachable (); /* Not a type! */ } } @@ -7426,14 +7179,15 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) aligned on a 16 byte boundary so one flush clears it all. */ emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, tramp)))); if (sparc_cpu != PROCESSOR_ULTRASPARC - && sparc_cpu != PROCESSOR_ULTRASPARC3) + && sparc_cpu != PROCESSOR_ULTRASPARC3 + && sparc_cpu != PROCESSOR_NIAGARA) emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode, plus_constant (tramp, 8))))); /* Call __enable_execute_stack after writing onto the stack to make sure the stack address is accessible. */ #ifdef ENABLE_EXECUTE_STACK - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif @@ -7468,735 +7222,18 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, tramp)))); if (sparc_cpu != PROCESSOR_ULTRASPARC - && sparc_cpu != PROCESSOR_ULTRASPARC3) + && sparc_cpu != PROCESSOR_ULTRASPARC3 + && sparc_cpu != PROCESSOR_NIAGARA) emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8))))); /* Call __enable_execute_stack after writing onto the stack to make sure the stack address is accessible. */ #ifdef ENABLE_EXECUTE_STACK - emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), LCT_NORMAL, VOIDmode, 1, tramp, Pmode); #endif } -/* Subroutines to support a flat (single) register window calling - convention. */ - -/* Single-register window sparc stack frames look like: - - Before call After call - +-----------------------+ +-----------------------+ - high | | | | - mem | caller's temps. | | caller's temps. | - | | | | - +-----------------------+ +-----------------------+ - | | | | - | arguments on stack. | | arguments on stack. | - | | | | - +-----------------------+FP+92->+-----------------------+ - | 6 words to save | | 6 words to save | - | arguments passed | | arguments passed | - | in registers, even | | in registers, even | - | if not passed. | | if not passed. | - SP+68->+-----------------------+FP+68->+-----------------------+ - | 1 word struct addr | | 1 word struct addr | - +-----------------------+FP+64->+-----------------------+ - | | | | - | 16 word reg save area | | 16 word reg save area | - | | | | - SP->+-----------------------+ FP->+-----------------------+ - | 4 word area for | - | fp/alu reg moves | - FP-16->+-----------------------+ - | | - | local variables | - | | - +-----------------------+ - | | - | fp register save | - | | - +-----------------------+ - | | - | gp register save | - | | - +-----------------------+ - | | - | alloca allocations | - | | - +-----------------------+ - | | - | arguments on stack | - | | - SP+92->+-----------------------+ - | 6 words to save | - | arguments passed | - | in registers, even | - low | if not passed. | - memory SP+68->+-----------------------+ - | 1 word struct addr | - SP+64->+-----------------------+ - | | - I 16 word reg save area | - | | - SP->+-----------------------+ */ - -/* Structure to be filled in by sparc_flat_compute_frame_size with register - save masks, and offsets for the current function. */ - -struct sparc_frame_info -{ - HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */ - HOST_WIDE_INT var_size; /* # bytes that variables take up. */ - int args_size; /* # bytes that outgoing arguments take up. */ - int extra_size; /* # bytes of extra gunk. */ - int gp_reg_size; /* # bytes needed to store gp regs. */ - int fp_reg_size; /* # bytes needed to store fp regs. */ - unsigned long gmask; /* Mask of saved gp registers. */ - unsigned long fmask; /* Mask of saved fp registers. */ - int reg_offset; /* Offset from new sp to store regs. */ - int initialized; /* Nonzero if frame size already calculated. */ -}; - -/* Current frame information calculated by sparc_flat_compute_frame_size. */ -struct sparc_frame_info current_frame_info; - -/* Zero structure to initialize current_frame_info. */ -struct sparc_frame_info zero_frame_info; - -#define RETURN_ADDR_REGNUM 15 -#define HARD_FRAME_POINTER_MASK (1 << (HARD_FRAME_POINTER_REGNUM)) -#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM)) - -/* Tell prologue and epilogue if register REGNO should be saved / restored. */ - -static bool -sparc_flat_must_save_register_p (int regno) -{ - /* General case: call-saved registers live at some point. */ - if (!call_used_regs[regno] && regs_ever_live[regno]) - return true; - - /* Frame pointer register (%i7) if needed. */ - if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) - return true; - - /* PIC register (%l7) if needed. */ - if (regno == (int) PIC_OFFSET_TABLE_REGNUM - && flag_pic && current_function_uses_pic_offset_table) - return true; - - /* Return address register (%o7) if needed. */ - if (regno == RETURN_ADDR_REGNUM - && (regs_ever_live[RETURN_ADDR_REGNUM] - /* When the PIC offset table is used, the PIC register - is set by using a bare call that clobbers %o7. */ - || (flag_pic && current_function_uses_pic_offset_table))) - return true; - - return false; -} - -/* Return the bytes needed to compute the frame pointer from the current - stack pointer. */ - -HOST_WIDE_INT -sparc_flat_compute_frame_size (HOST_WIDE_INT size) - /* # of var. bytes allocated. */ -{ - int regno; - HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */ - HOST_WIDE_INT var_size; /* # bytes that variables take up. */ - int args_size; /* # bytes that outgoing arguments take up. */ - int extra_size; /* # extra bytes. */ - int gp_reg_size; /* # bytes needed to store gp regs. */ - int fp_reg_size; /* # bytes needed to store fp regs. */ - unsigned long gmask; /* Mask of saved gp registers. */ - unsigned long fmask; /* Mask of saved fp registers. */ - int reg_offset; /* Offset to register save area. */ - int need_aligned_p; /* 1 if need the save area 8 byte aligned. */ - - /* This is the size of the 16 word reg save area, 1 word struct addr - area, and 4 word fp/alu register copy area. */ - extra_size = -STARTING_FRAME_OFFSET + FIRST_PARM_OFFSET(0); - var_size = size; - gp_reg_size = 0; - fp_reg_size = 0; - gmask = 0; - fmask = 0; - reg_offset = 0; - need_aligned_p = 0; - - args_size = 0; - if (!leaf_function_p ()) - { - /* Also include the size needed for the 6 parameter registers. */ - args_size = current_function_outgoing_args_size + 24; - } - total_size = var_size + args_size; - - /* Calculate space needed for gp registers. */ - for (regno = 1; regno <= 31; regno++) - { - if (sparc_flat_must_save_register_p (regno)) - { - /* If we need to save two regs in a row, ensure there's room to bump - up the address to align it to a doubleword boundary. */ - if ((regno & 0x1) == 0 && sparc_flat_must_save_register_p (regno+1)) - { - if (gp_reg_size % 8 != 0) - gp_reg_size += 4; - gp_reg_size += 2 * UNITS_PER_WORD; - gmask |= 3 << regno; - regno++; - need_aligned_p = 1; - } - else - { - gp_reg_size += UNITS_PER_WORD; - gmask |= 1 << regno; - } - } - } - - /* Calculate space needed for fp registers. */ - for (regno = 32; regno <= 63; regno++) - { - if (regs_ever_live[regno] && !call_used_regs[regno]) - { - fp_reg_size += UNITS_PER_WORD; - fmask |= 1 << (regno - 32); - } - } - - if (gmask || fmask) - { - int n; - reg_offset = FIRST_PARM_OFFSET(0) + args_size; - /* Ensure save area is 8 byte aligned if we need it. */ - n = reg_offset % 8; - if (need_aligned_p && n != 0) - { - total_size += 8 - n; - reg_offset += 8 - n; - } - total_size += gp_reg_size + fp_reg_size; - } - - /* If we must allocate a stack frame at all, we must also allocate - room for register window spillage, so as to be binary compatible - with libraries and operating systems that do not use -mflat. */ - if (total_size > 0) - total_size += extra_size; - else - extra_size = 0; - - total_size = SPARC_STACK_ALIGN (total_size); - - /* Save other computed information. */ - current_frame_info.total_size = total_size; - current_frame_info.var_size = var_size; - current_frame_info.args_size = args_size; - current_frame_info.extra_size = extra_size; - current_frame_info.gp_reg_size = gp_reg_size; - current_frame_info.fp_reg_size = fp_reg_size; - current_frame_info.gmask = gmask; - current_frame_info.fmask = fmask; - current_frame_info.reg_offset = reg_offset; - current_frame_info.initialized = reload_completed; - - /* Ok, we're done. */ - return total_size; -} - -/* Save/restore registers in GMASK and FMASK at register BASE_REG plus offset - OFFSET. - - BASE_REG must be 8 byte aligned. This allows us to test OFFSET for - appropriate alignment and use DOUBLEWORD_OP when we can. We assume - [BASE_REG+OFFSET] will always be a valid address. - - WORD_OP is either "st" for save, "ld" for restore. - DOUBLEWORD_OP is either "std" for save, "ldd" for restore. */ - -static void -sparc_flat_save_restore (FILE *file, const char *base_reg, int offset, - unsigned long gmask, unsigned long fmask, - const char *word_op, const char *doubleword_op, - HOST_WIDE_INT base_offset) -{ - int regno; - - if (gmask == 0 && fmask == 0) - return; - - /* Save registers starting from high to low. We've already saved the - previous frame pointer and previous return address for the debugger's - sake. The debugger allows us to not need a nop in the epilog if at least - one register is reloaded in addition to return address. */ - - if (gmask) - { - for (regno = 1; regno <= 31; regno++) - { - if ((gmask & (1L << regno)) != 0) - { - if ((regno & 0x1) == 0 && ((gmask & (1L << (regno+1))) != 0)) - { - /* We can save two registers in a row. If we're not at a - double word boundary, move to one. - sparc_flat_compute_frame_size ensures there's room to do - this. */ - if (offset % 8 != 0) - offset += UNITS_PER_WORD; - - if (word_op[0] == 's') - { - fprintf (file, "\t%s\t%s, [%s+%d]\n", - doubleword_op, reg_names[regno], - base_reg, offset); - if (dwarf2out_do_frame ()) - { - char *l = dwarf2out_cfi_label (); - dwarf2out_reg_save (l, regno, offset + base_offset); - dwarf2out_reg_save - (l, regno+1, offset+base_offset + UNITS_PER_WORD); - } - } - else - fprintf (file, "\t%s\t[%s+%d], %s\n", - doubleword_op, base_reg, offset, - reg_names[regno]); - - offset += 2 * UNITS_PER_WORD; - regno++; - } - else - { - if (word_op[0] == 's') - { - fprintf (file, "\t%s\t%s, [%s+%d]\n", - word_op, reg_names[regno], - base_reg, offset); - if (dwarf2out_do_frame ()) - dwarf2out_reg_save ("", regno, offset + base_offset); - } - else - fprintf (file, "\t%s\t[%s+%d], %s\n", - word_op, base_reg, offset, reg_names[regno]); - - offset += UNITS_PER_WORD; - } - } - } - } - - if (fmask) - { - for (regno = 32; regno <= 63; regno++) - { - if ((fmask & (1L << (regno - 32))) != 0) - { - if (word_op[0] == 's') - { - fprintf (file, "\t%s\t%s, [%s+%d]\n", - word_op, reg_names[regno], - base_reg, offset); - if (dwarf2out_do_frame ()) - dwarf2out_reg_save ("", regno, offset + base_offset); - } - else - fprintf (file, "\t%s\t[%s+%d], %s\n", - word_op, base_reg, offset, reg_names[regno]); - - offset += UNITS_PER_WORD; - } - } - } -} - -/* Set up the stack and frame (if desired) for the function. */ - -static void -sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size) -{ - const char *sp_str = reg_names[STACK_POINTER_REGNUM]; - unsigned long gmask = current_frame_info.gmask; - - sparc_output_scratch_registers (file); - - /* This is only for the human reader. */ - fprintf (file, "\t%s#PROLOGUE# 0\n", ASM_COMMENT_START); - fprintf (file, "\t%s# vars= "HOST_WIDE_INT_PRINT_DEC", " - "regs= %d/%d, args= %d, extra= %d\n", - ASM_COMMENT_START, - current_frame_info.var_size, - current_frame_info.gp_reg_size / 4, - current_frame_info.fp_reg_size / 4, - current_function_outgoing_args_size, - current_frame_info.extra_size); - - size = SPARC_STACK_ALIGN (size); - size = (! current_frame_info.initialized - ? sparc_flat_compute_frame_size (size) - : current_frame_info.total_size); - - /* These cases shouldn't happen. Catch them now. */ - if (size == 0 && (gmask || current_frame_info.fmask)) - abort (); - - /* Allocate our stack frame by decrementing %sp. - At present, the only algorithm gdb can use to determine if this is a - flat frame is if we always set %i7 if we set %sp. This can be optimized - in the future by putting in some sort of debugging information that says - this is a `flat' function. However, there is still the case of debugging - code without such debugging information (including cases where most fns - have such info, but there is one that doesn't). So, always do this now - so we don't get a lot of code out there that gdb can't handle. - If the frame pointer isn't needn't then that's ok - gdb won't be able to - distinguish us from a non-flat function but there won't (and shouldn't) - be any differences anyway. The return pc is saved (if necessary) right - after %i7 so gdb won't have to look too far to find it. */ - if (size > 0) - { - int reg_offset = current_frame_info.reg_offset; - const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM]; - static const char *const t1_str = "%g1"; - - /* Things get a little tricky if local variables take up more than ~4096 - bytes and outgoing arguments take up more than ~4096 bytes. When that - happens, the register save area can't be accessed from either end of - the frame. Handle this by decrementing %sp to the start of the gp - register save area, save the regs, update %i7, and then set %sp to its - final value. Given that we only have one scratch register to play - with it is the cheapest solution, and it helps gdb out as it won't - slow down recognition of flat functions. - Don't change the order of insns emitted here without checking with - the gdb folk first. */ - - /* Is the entire register save area offsettable from %sp? */ - if (reg_offset < 4096 - 64 * UNITS_PER_WORD) - { - if (size <= 4096) - { - fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", - sp_str, size, sp_str); - if (gmask & HARD_FRAME_POINTER_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - fp_str, sp_str, reg_offset); - fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" - "\t%s# set up frame pointer\n", - sp_str, size, fp_str, ASM_COMMENT_START); - reg_offset += 4; - } - } - else - { - build_big_number (file, size, t1_str); - fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); - if (gmask & HARD_FRAME_POINTER_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - fp_str, sp_str, reg_offset); - fprintf (file, "\tadd\t%s, %s, %s\t%s# set up frame pointer\n", - sp_str, t1_str, fp_str, ASM_COMMENT_START); - reg_offset += 4; - } - } - if (dwarf2out_do_frame ()) - { - char *l = dwarf2out_cfi_label (); - if (gmask & HARD_FRAME_POINTER_MASK) - { - dwarf2out_reg_save (l, HARD_FRAME_POINTER_REGNUM, - reg_offset - 4 - size); - dwarf2out_def_cfa (l, HARD_FRAME_POINTER_REGNUM, 0); - } - else - dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, size); - } - if (gmask & RETURN_ADDR_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - reg_names[RETURN_ADDR_REGNUM], sp_str, reg_offset); - if (dwarf2out_do_frame ()) - dwarf2out_return_save ("", reg_offset - size); - reg_offset += 4; - } - sparc_flat_save_restore (file, sp_str, reg_offset, - gmask & ~(HARD_FRAME_POINTER_MASK | RETURN_ADDR_MASK), - current_frame_info.fmask, - "st", "std", -size); - } - else - { - /* Subtract %sp in two steps, but make sure there is always a - 64-byte register save area, and %sp is properly aligned. */ - - /* Amount to decrement %sp by, the first time. */ - HOST_WIDE_INT size1 = ((size - reg_offset + 64) + 15) & -16; - - /* Amount to decrement %sp by, the second time. */ - HOST_WIDE_INT size2 = size - size1; - - /* Offset to register save area from %sp after first decrement. */ - int offset = (int)(size1 - (size - reg_offset)); - - if (size1 <= 4096) - { - fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", - sp_str, size1, sp_str); - if (gmask & HARD_FRAME_POINTER_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n" - "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" - "\t%s# set up frame pointer\n", - fp_str, sp_str, offset, sp_str, size1, - fp_str, ASM_COMMENT_START); - offset += 4; - } - } - else - { - build_big_number (file, size1, t1_str); - fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); - if (gmask & HARD_FRAME_POINTER_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n" - "\tadd\t%s, %s, %s\t%s# set up frame pointer\n", - fp_str, sp_str, offset, sp_str, t1_str, - fp_str, ASM_COMMENT_START); - offset += 4; - } - } - if (dwarf2out_do_frame ()) - { - char *l = dwarf2out_cfi_label (); - if (gmask & HARD_FRAME_POINTER_MASK) - { - dwarf2out_reg_save (l, HARD_FRAME_POINTER_REGNUM, - offset - 4 - size1); - dwarf2out_def_cfa (l, HARD_FRAME_POINTER_REGNUM, 0); - } - else - dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, size1); - } - if (gmask & RETURN_ADDR_MASK) - { - fprintf (file, "\tst\t%s, [%s+%d]\n", - reg_names[RETURN_ADDR_REGNUM], sp_str, offset); - if (dwarf2out_do_frame ()) - /* offset - size1 == reg_offset - size - if reg_offset were updated above like offset. */ - dwarf2out_return_save ("", offset - size1); - offset += 4; - } - sparc_flat_save_restore (file, sp_str, offset, - gmask & ~(HARD_FRAME_POINTER_MASK | RETURN_ADDR_MASK), - current_frame_info.fmask, - "st", "std", -size1); - if (size2 <= 4096) - fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", - sp_str, size2, sp_str); - else - { - build_big_number (file, size2, t1_str); - fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str); - } - if (dwarf2out_do_frame ()) - if (! (gmask & HARD_FRAME_POINTER_MASK)) - dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, size); - } - } - - fprintf (file, "\t%s#PROLOGUE# 1\n", ASM_COMMENT_START); -} - -/* Do any necessary cleanup after a function to restore stack, frame, - and regs. */ - -static void -sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size) -{ - rtx epilogue_delay = current_function_epilogue_delay_list; - int noepilogue = FALSE; - - /* This is only for the human reader. */ - fprintf (file, "\t%s#EPILOGUE#\n", ASM_COMMENT_START); - - /* The epilogue does not depend on any registers, but the stack - registers, so we assume that if we have 1 pending nop, it can be - ignored, and 2 it must be filled (2 nops occur for integer - multiply and divide). */ - - size = SPARC_STACK_ALIGN (size); - size = (!current_frame_info.initialized - ? sparc_flat_compute_frame_size (size) - : current_frame_info.total_size); - - if (size == 0 && epilogue_delay == 0) - { - rtx insn = get_last_insn (); - - /* If the last insn was a BARRIER, we don't have to write any code - because a jump (aka return) was put there. */ - if (GET_CODE (insn) == NOTE) - insn = prev_nonnote_insn (insn); - if (insn && GET_CODE (insn) == BARRIER) - noepilogue = TRUE; - } - - if (!noepilogue) - { - int reg_offset = current_frame_info.reg_offset; - int reg_offset1; - const char *const sp_str = reg_names[STACK_POINTER_REGNUM]; - const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM]; - static const char *const t1_str = "%g1"; - - /* In the reload sequence, we don't need to fill the load delay - slots for most of the loads, also see if we can fill the final - delay slot if not otherwise filled by the reload sequence. */ - - if (size > 4096) - build_big_number (file, size, t1_str); - - if (frame_pointer_needed) - { - if (size > 4096) - fprintf (file,"\tsub\t%s, %s, %s\t\t%s# sp not trusted here\n", - fp_str, t1_str, sp_str, ASM_COMMENT_START); - else - fprintf (file,"\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s" - "\t\t%s# sp not trusted here\n", - fp_str, size, sp_str, ASM_COMMENT_START); - } - - /* Is the entire register save area offsettable from %sp? */ - if (reg_offset < 4096 - 64 * UNITS_PER_WORD) - { - reg_offset1 = 0; - } - else - { - /* Restore %sp in two steps, but make sure there is always a - 64-byte register save area, and %sp is properly aligned. */ - - /* Amount to increment %sp by, the first time. */ - reg_offset1 = ((reg_offset - 64 - 16) + 15) & -16; - - /* Offset to register save area from %sp. */ - reg_offset = reg_offset1 - reg_offset; - - if (reg_offset1 > 4096) - { - build_big_number (file, reg_offset1, t1_str); - fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str); - } - else - fprintf (file, "\tsub\t%s, -%d, %s\n", sp_str, reg_offset1, sp_str); - } - - /* We must restore the frame pointer and return address reg first - because they are treated specially by the prologue output code. */ - if (current_frame_info.gmask & HARD_FRAME_POINTER_MASK) - { - fprintf (file, "\tld\t[%s+%d], %s\n", - sp_str, reg_offset, fp_str); - reg_offset += 4; - } - if (current_frame_info.gmask & RETURN_ADDR_MASK) - { - fprintf (file, "\tld\t[%s+%d], %s\n", - sp_str, reg_offset, reg_names[RETURN_ADDR_REGNUM]); - reg_offset += 4; - } - - /* Restore any remaining saved registers. */ - sparc_flat_save_restore (file, sp_str, reg_offset, - current_frame_info.gmask & ~(HARD_FRAME_POINTER_MASK | RETURN_ADDR_MASK), - current_frame_info.fmask, - "ld", "ldd", 0); - - /* If we had to increment %sp in two steps, record it so the second - restoration in the epilogue finishes up. */ - if (reg_offset1 > 0) - { - size -= reg_offset1; - if (size > 4096) - build_big_number (file, size, t1_str); - } - - if (current_function_returns_struct) - fprintf (file, "\tjmp\t%%o7+12\n"); - else - fprintf (file, "\tretl\n"); - - /* If the only register saved is the return address, we need a - nop, unless we have an instruction to put into it. Otherwise - we don't since reloading multiple registers doesn't reference - the register being loaded. */ - - if (epilogue_delay) - { - if (size) - abort (); - final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, NULL); - } - - else if (size > 4096) - fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str); - - else if (size > 0) - fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n", - sp_str, size, sp_str); - - else - fprintf (file, "\tnop\n"); - } - - /* Reset state info for each function. */ - current_frame_info = zero_frame_info; - - sparc_output_deferred_case_vectors (); -} - -/* Define the number of delay slots needed for the function epilogue. - - On the sparc, we need a slot if either no stack has been allocated, - or the only register saved is the return register. */ - -int -sparc_flat_epilogue_delay_slots (void) -{ - if (!current_frame_info.initialized) - (void) sparc_flat_compute_frame_size (get_frame_size ()); - - if (current_frame_info.total_size == 0) - return 1; - - return 0; -} - -/* Return true if TRIAL is a valid insn for the epilogue delay slot. - Any single length instruction which doesn't reference the stack or frame - pointer is OK. */ - -int -sparc_flat_eligible_for_epilogue_delay (rtx trial, int slot ATTRIBUTE_UNUSED) -{ - rtx pat = PATTERN (trial); - - if (get_attr_length (trial) != 1) - return 0; - - if (! reg_mentioned_p (stack_pointer_rtx, pat) - && ! reg_mentioned_p (frame_pointer_rtx, pat)) - return 1; - - return 0; -} - /* Adjust the cost of a scheduling dependency. Return the new cost of a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ @@ -8363,21 +7400,11 @@ sparc_sched_init (FILE *dump ATTRIBUTE_UNUSED, { } -static int -sparc_use_dfa_pipeline_interface (void) -{ - if ((1 << sparc_cpu) & - ((1 << PROCESSOR_ULTRASPARC) | (1 << PROCESSOR_CYPRESS) | - (1 << PROCESSOR_SUPERSPARC) | (1 << PROCESSOR_HYPERSPARC) | - (1 << PROCESSOR_SPARCLITE86X) | (1 << PROCESSOR_TSC701) | - (1 << PROCESSOR_ULTRASPARC3))) - return 1; - return 0; -} - static int sparc_use_sched_lookahead (void) { + if (sparc_cpu == PROCESSOR_NIAGARA) + return 0; if (sparc_cpu == PROCESSOR_ULTRASPARC || sparc_cpu == PROCESSOR_ULTRASPARC3) return 4; @@ -8393,6 +7420,7 @@ sparc_issue_rate (void) { switch (sparc_cpu) { + case PROCESSOR_NIAGARA: default: return 1; case PROCESSOR_V9: @@ -8558,7 +7586,7 @@ sparc_output_deferred_case_vectors (void) return; /* Align to cache line in the function's code section. */ - function_section (current_function_decl); + switch_to_section (current_function_section ()); align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); if (align > 0) @@ -8585,8 +7613,7 @@ sparc_check_64 (rtx x, rtx insn) int set_once = 0; rtx y = x; - if (GET_CODE (x) != REG) - abort (); + gcc_assert (GET_CODE (x) == REG); if (GET_MODE (x) == DImode) y = gen_rtx_REG (SImode, REGNO (x) + WORDS_BIG_ENDIAN); @@ -8635,8 +7662,8 @@ sparc_check_64 (rtx x, rtx insn) /* Returns assembly code to perform a DImode shift using a 64-bit global or out register on SPARC-V8+. */ -char * -sparc_v8plus_shift (rtx *operands, rtx insn, const char *opcode) +const char * +output_v8plus_shift (rtx *operands, rtx insn, const char *opcode) { static char asm_code[60]; @@ -8687,13 +7714,14 @@ sparc_profile_hook (int labelno) #ifdef OBJECT_FORMAT_ELF static void -sparc_elf_asm_named_section (const char *name, unsigned int flags) +sparc_elf_asm_named_section (const char *name, unsigned int flags, + tree decl) { if (flags & SECTION_MERGE) { /* entsize cannot be expressed in this section attributes encoding style. */ - default_elf_asm_named_section (name, flags); + default_elf_asm_named_section (name, flags, decl); return; } @@ -8714,10 +7742,12 @@ sparc_elf_asm_named_section (const char *name, unsigned int flags) } #endif /* OBJECT_FORMAT_ELF */ -/* We do not allow sibling calls if -mflat, nor - we do not allow indirect calls to be optimized into sibling calls. - - Also, on sparc 32-bit we cannot emit a sibling call when the +/* We do not allow indirect calls to be optimized into sibling calls. + + We cannot use sibling calls when delayed branches are disabled + because they will likely require the call delay slot to be filled. + + Also, on SPARC 32-bit we cannot emit a sibling call when the current function returns a structure. This is because the "unimp after call" convention would cause the callee to return to the wrong place. The generic code already disallows cases where the @@ -8726,7 +7756,7 @@ sparc_elf_asm_named_section (const char *name, unsigned int flags) It may seem strange how this last case could occur. Usually there is code after the call which jumps to epilogue code which dumps the return value into the struct return area. That ought to invalidate - the sibling call right? Well, in the c++ case we can end up passing + the sibling call right? Well, in the C++ case we can end up passing the pointer to the struct return area to a constructor (which returns void) and then nothing else happens. Such a sibling call would look valid without the added check here. */ @@ -8734,7 +7764,7 @@ static bool sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) { return (decl - && ! TARGET_FLAT + && flag_delayed_branch && (TARGET_ARCH64 || ! current_function_returns_struct)); } @@ -8749,7 +7779,7 @@ sparc_init_libfuncs (void) /* Use the subroutines that Sun's library provides for integer multiply and divide. The `*' prevents an underscore from being prepended by the compiler. .umul is a little faster - than .mul. */ + than .mul. */ set_optab_libfunc (smul_optab, SImode, "*.umul"); set_optab_libfunc (sdiv_optab, SImode, "*.div"); set_optab_libfunc (udiv_optab, SImode, "*.udiv"); @@ -8786,12 +7816,14 @@ sparc_init_libfuncs (void) set_conv_libfunc (sfix_optab, SImode, TFmode, "_Q_qtoi"); set_conv_libfunc (ufix_optab, SImode, TFmode, "_Q_qtou"); set_conv_libfunc (sfloat_optab, TFmode, SImode, "_Q_itoq"); + set_conv_libfunc (ufloat_optab, TFmode, SImode, "_Q_utoq"); if (DITF_CONVERSION_LIBFUNCS) { set_conv_libfunc (sfix_optab, DImode, TFmode, "_Q_qtoll"); set_conv_libfunc (ufix_optab, DImode, TFmode, "_Q_qtoull"); set_conv_libfunc (sfloat_optab, TFmode, DImode, "_Q_lltoq"); + set_conv_libfunc (ufloat_optab, TFmode, DImode, "_Q_ulltoq"); } if (SUN_CONVERSION_LIBFUNCS) @@ -8835,31 +7867,361 @@ sparc_init_libfuncs (void) gofast_maybe_init_libfuncs (); } -/* ??? Similar to the standard section selection, but force reloc-y-ness - if SUNOS4_SHARED_LIBRARIES. Unclear why this helps (as opposed to - pretending PIC always on), but that's what the old code did. */ +#define def_builtin(NAME, CODE, TYPE) \ + lang_hooks.builtin_function((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, \ + NULL_TREE) + +/* Implement the TARGET_INIT_BUILTINS target hook. + Create builtin functions for special SPARC instructions. */ static void -sparc_aout_select_section (tree t, int reloc, unsigned HOST_WIDE_INT align) +sparc_init_builtins (void) { - default_select_section (t, reloc | SUNOS4_SHARED_LIBRARIES, align); + if (TARGET_VIS) + sparc_vis_init_builtins (); } -/* Use text section for a constant unless we need more alignment than - that offers. */ +/* Create builtin functions for VIS 1.0 instructions. */ static void -sparc_aout_select_rtx_section (enum machine_mode mode, rtx x, - unsigned HOST_WIDE_INT align) +sparc_vis_init_builtins (void) { - if (align <= MAX_TEXT_ALIGN - && ! (flag_pic && (symbolic_operand (x, mode) - || SUNOS4_SHARED_LIBRARIES))) - readonly_data_section (); + tree v4qi = build_vector_type (unsigned_intQI_type_node, 4); + tree v8qi = build_vector_type (unsigned_intQI_type_node, 8); + tree v4hi = build_vector_type (intHI_type_node, 4); + tree v2hi = build_vector_type (intHI_type_node, 2); + tree v2si = build_vector_type (intSI_type_node, 2); + + tree v4qi_ftype_v4hi = build_function_type_list (v4qi, v4hi, 0); + tree v8qi_ftype_v2si_v8qi = build_function_type_list (v8qi, v2si, v8qi, 0); + tree v2hi_ftype_v2si = build_function_type_list (v2hi, v2si, 0); + tree v4hi_ftype_v4qi = build_function_type_list (v4hi, v4qi, 0); + tree v8qi_ftype_v4qi_v4qi = build_function_type_list (v8qi, v4qi, v4qi, 0); + tree v4hi_ftype_v4qi_v4hi = build_function_type_list (v4hi, v4qi, v4hi, 0); + tree v4hi_ftype_v4qi_v2hi = build_function_type_list (v4hi, v4qi, v2hi, 0); + tree v2si_ftype_v4qi_v2hi = build_function_type_list (v2si, v4qi, v2hi, 0); + tree v4hi_ftype_v8qi_v4hi = build_function_type_list (v4hi, v8qi, v4hi, 0); + tree v4hi_ftype_v4hi_v4hi = build_function_type_list (v4hi, v4hi, v4hi, 0); + tree v2si_ftype_v2si_v2si = build_function_type_list (v2si, v2si, v2si, 0); + tree v8qi_ftype_v8qi_v8qi = build_function_type_list (v8qi, v8qi, v8qi, 0); + tree di_ftype_v8qi_v8qi_di = build_function_type_list (intDI_type_node, + v8qi, v8qi, + intDI_type_node, 0); + tree di_ftype_di_di = build_function_type_list (intDI_type_node, + intDI_type_node, + intDI_type_node, 0); + tree ptr_ftype_ptr_si = build_function_type_list (ptr_type_node, + ptr_type_node, + intSI_type_node, 0); + tree ptr_ftype_ptr_di = build_function_type_list (ptr_type_node, + ptr_type_node, + intDI_type_node, 0); + + /* Packing and expanding vectors. */ + def_builtin ("__builtin_vis_fpack16", CODE_FOR_fpack16_vis, v4qi_ftype_v4hi); + def_builtin ("__builtin_vis_fpack32", CODE_FOR_fpack32_vis, + v8qi_ftype_v2si_v8qi); + def_builtin ("__builtin_vis_fpackfix", CODE_FOR_fpackfix_vis, + v2hi_ftype_v2si); + def_builtin ("__builtin_vis_fexpand", CODE_FOR_fexpand_vis, v4hi_ftype_v4qi); + def_builtin ("__builtin_vis_fpmerge", CODE_FOR_fpmerge_vis, + v8qi_ftype_v4qi_v4qi); + + /* Multiplications. */ + def_builtin ("__builtin_vis_fmul8x16", CODE_FOR_fmul8x16_vis, + v4hi_ftype_v4qi_v4hi); + def_builtin ("__builtin_vis_fmul8x16au", CODE_FOR_fmul8x16au_vis, + v4hi_ftype_v4qi_v2hi); + def_builtin ("__builtin_vis_fmul8x16al", CODE_FOR_fmul8x16al_vis, + v4hi_ftype_v4qi_v2hi); + def_builtin ("__builtin_vis_fmul8sux16", CODE_FOR_fmul8sux16_vis, + v4hi_ftype_v8qi_v4hi); + def_builtin ("__builtin_vis_fmul8ulx16", CODE_FOR_fmul8ulx16_vis, + v4hi_ftype_v8qi_v4hi); + def_builtin ("__builtin_vis_fmuld8sux16", CODE_FOR_fmuld8sux16_vis, + v2si_ftype_v4qi_v2hi); + def_builtin ("__builtin_vis_fmuld8ulx16", CODE_FOR_fmuld8ulx16_vis, + v2si_ftype_v4qi_v2hi); + + /* Data aligning. */ + def_builtin ("__builtin_vis_faligndatav4hi", CODE_FOR_faligndatav4hi_vis, + v4hi_ftype_v4hi_v4hi); + def_builtin ("__builtin_vis_faligndatav8qi", CODE_FOR_faligndatav8qi_vis, + v8qi_ftype_v8qi_v8qi); + def_builtin ("__builtin_vis_faligndatav2si", CODE_FOR_faligndatav2si_vis, + v2si_ftype_v2si_v2si); + def_builtin ("__builtin_vis_faligndatadi", CODE_FOR_faligndatadi_vis, + di_ftype_di_di); + if (TARGET_ARCH64) + def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrdi_vis, + ptr_ftype_ptr_di); else - data_section (); + def_builtin ("__builtin_vis_alignaddr", CODE_FOR_alignaddrsi_vis, + ptr_ftype_ptr_si); + + /* Pixel distance. */ + def_builtin ("__builtin_vis_pdist", CODE_FOR_pdist_vis, + di_ftype_v8qi_v8qi_di); } +/* Handle TARGET_EXPAND_BUILTIN target hook. + Expand builtin functions for sparc intrinsics. */ + +static rtx +sparc_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, + enum machine_mode tmode, int ignore ATTRIBUTE_UNUSED) +{ + tree arglist; + tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); + unsigned int icode = DECL_FUNCTION_CODE (fndecl); + rtx pat, op[4]; + enum machine_mode mode[4]; + int arg_count = 0; + + mode[arg_count] = tmode; + + if (target == 0 + || GET_MODE (target) != tmode + || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) + op[arg_count] = gen_reg_rtx (tmode); + else + op[arg_count] = target; + + for (arglist = TREE_OPERAND (exp, 1); arglist; + arglist = TREE_CHAIN (arglist)) + { + tree arg = TREE_VALUE (arglist); + + arg_count++; + mode[arg_count] = insn_data[icode].operand[arg_count].mode; + op[arg_count] = expand_normal (arg); + + if (! (*insn_data[icode].operand[arg_count].predicate) (op[arg_count], + mode[arg_count])) + op[arg_count] = copy_to_mode_reg (mode[arg_count], op[arg_count]); + } + + switch (arg_count) + { + case 1: + pat = GEN_FCN (icode) (op[0], op[1]); + break; + case 2: + pat = GEN_FCN (icode) (op[0], op[1], op[2]); + break; + case 3: + pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]); + break; + default: + gcc_unreachable (); + } + + if (!pat) + return NULL_RTX; + + emit_insn (pat); + + return op[0]; +} + +static int +sparc_vis_mul8x16 (int e8, int e16) +{ + return (e8 * e16 + 128) / 256; +} + +/* Multiply the vector elements in ELTS0 to the elements in ELTS1 as specified + by FNCODE. All of the elements in ELTS0 and ELTS1 lists must be integer + constants. A tree list with the results of the multiplications is returned, + and each element in the list is of INNER_TYPE. */ + +static tree +sparc_handle_vis_mul8x16 (int fncode, tree inner_type, tree elts0, tree elts1) +{ + tree n_elts = NULL_TREE; + int scale; + + switch (fncode) + { + case CODE_FOR_fmul8x16_vis: + for (; elts0 && elts1; + elts0 = TREE_CHAIN (elts0), elts1 = TREE_CHAIN (elts1)) + { + int val + = sparc_vis_mul8x16 (TREE_INT_CST_LOW (TREE_VALUE (elts0)), + TREE_INT_CST_LOW (TREE_VALUE (elts1))); + n_elts = tree_cons (NULL_TREE, + build_int_cst (inner_type, val), + n_elts); + } + break; + + case CODE_FOR_fmul8x16au_vis: + scale = TREE_INT_CST_LOW (TREE_VALUE (elts1)); + + for (; elts0; elts0 = TREE_CHAIN (elts0)) + { + int val + = sparc_vis_mul8x16 (TREE_INT_CST_LOW (TREE_VALUE (elts0)), + scale); + n_elts = tree_cons (NULL_TREE, + build_int_cst (inner_type, val), + n_elts); + } + break; + + case CODE_FOR_fmul8x16al_vis: + scale = TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (elts1))); + + for (; elts0; elts0 = TREE_CHAIN (elts0)) + { + int val + = sparc_vis_mul8x16 (TREE_INT_CST_LOW (TREE_VALUE (elts0)), + scale); + n_elts = tree_cons (NULL_TREE, + build_int_cst (inner_type, val), + n_elts); + } + break; + + default: + gcc_unreachable (); + } + + return nreverse (n_elts); + +} +/* Handle TARGET_FOLD_BUILTIN target hook. + Fold builtin functions for SPARC intrinsics. If IGNORE is true the + result of the function call is ignored. NULL_TREE is returned if the + function could not be folded. */ + +static tree +sparc_fold_builtin (tree fndecl, tree arglist, bool ignore) +{ + tree arg0, arg1, arg2; + tree rtype = TREE_TYPE (TREE_TYPE (fndecl)); + + + if (ignore && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis + && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrdi_vis) + return build_int_cst (rtype, 0); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + case CODE_FOR_fexpand_vis: + arg0 = TREE_VALUE (arglist); + STRIP_NOPS (arg0); + + if (TREE_CODE (arg0) == VECTOR_CST) + { + tree inner_type = TREE_TYPE (rtype); + tree elts = TREE_VECTOR_CST_ELTS (arg0); + tree n_elts = NULL_TREE; + + for (; elts; elts = TREE_CHAIN (elts)) + { + unsigned int val = TREE_INT_CST_LOW (TREE_VALUE (elts)) << 4; + n_elts = tree_cons (NULL_TREE, + build_int_cst (inner_type, val), + n_elts); + } + return build_vector (rtype, nreverse (n_elts)); + } + break; + + case CODE_FOR_fmul8x16_vis: + case CODE_FOR_fmul8x16au_vis: + case CODE_FOR_fmul8x16al_vis: + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + STRIP_NOPS (arg0); + STRIP_NOPS (arg1); + + if (TREE_CODE (arg0) == VECTOR_CST && TREE_CODE (arg1) == VECTOR_CST) + { + tree inner_type = TREE_TYPE (rtype); + tree elts0 = TREE_VECTOR_CST_ELTS (arg0); + tree elts1 = TREE_VECTOR_CST_ELTS (arg1); + tree n_elts = sparc_handle_vis_mul8x16 (DECL_FUNCTION_CODE (fndecl), + inner_type, elts0, elts1); + + return build_vector (rtype, n_elts); + } + break; + + case CODE_FOR_fpmerge_vis: + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + STRIP_NOPS (arg0); + STRIP_NOPS (arg1); + + if (TREE_CODE (arg0) == VECTOR_CST && TREE_CODE (arg1) == VECTOR_CST) + { + tree elts0 = TREE_VECTOR_CST_ELTS (arg0); + tree elts1 = TREE_VECTOR_CST_ELTS (arg1); + tree n_elts = NULL_TREE; + + for (; elts0 && elts1; + elts0 = TREE_CHAIN (elts0), elts1 = TREE_CHAIN (elts1)) + { + n_elts = tree_cons (NULL_TREE, TREE_VALUE (elts0), n_elts); + n_elts = tree_cons (NULL_TREE, TREE_VALUE (elts1), n_elts); + } + + return build_vector (rtype, nreverse (n_elts)); + } + break; + + case CODE_FOR_pdist_vis: + arg0 = TREE_VALUE (arglist); + arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + STRIP_NOPS (arg0); + STRIP_NOPS (arg1); + STRIP_NOPS (arg2); + + if (TREE_CODE (arg0) == VECTOR_CST + && TREE_CODE (arg1) == VECTOR_CST + && TREE_CODE (arg2) == INTEGER_CST) + { + int overflow = 0; + unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg2); + HOST_WIDE_INT high = TREE_INT_CST_HIGH (arg2); + tree elts0 = TREE_VECTOR_CST_ELTS (arg0); + tree elts1 = TREE_VECTOR_CST_ELTS (arg1); + + for (; elts0 && elts1; + elts0 = TREE_CHAIN (elts0), elts1 = TREE_CHAIN (elts1)) + { + unsigned HOST_WIDE_INT + low0 = TREE_INT_CST_LOW (TREE_VALUE (elts0)), + low1 = TREE_INT_CST_LOW (TREE_VALUE (elts1)); + HOST_WIDE_INT high0 = TREE_INT_CST_HIGH (TREE_VALUE (elts0)); + HOST_WIDE_INT high1 = TREE_INT_CST_HIGH (TREE_VALUE (elts1)); + + unsigned HOST_WIDE_INT l; + HOST_WIDE_INT h; + + overflow |= neg_double (low1, high1, &l, &h); + overflow |= add_double (low0, high0, l, h, &l, &h); + if (h < 0) + overflow |= neg_double (l, h, &l, &h); + + overflow |= add_double (low, high, l, h, &low, &high); + } + + gcc_assert (overflow == 0); + + return build_int_cst_wide (rtype, low, high); + } + + default: + break; + } + return NULL_TREE; +} + int sparc_extra_constraint_check (rtx op, int c, int strict) { @@ -8893,6 +8255,9 @@ sparc_extra_constraint_check (rtx op, int c, int strict) case 'T': break; + case 'Y': + return const_zero_operand (op, GET_MODE (op)); + default: return 0; } @@ -8926,333 +8291,11 @@ sparc_extra_constraint_check (rtx op, int c, int strict) static bool sparc_rtx_costs (rtx x, int code, int outer_code, int *total) { + enum machine_mode mode = GET_MODE (x); + bool float_mode_p = FLOAT_MODE_P (mode); + switch (code) { - case PLUS: case MINUS: case ABS: case NEG: - case FLOAT: case UNSIGNED_FLOAT: - case FIX: case UNSIGNED_FIX: - case FLOAT_EXTEND: case FLOAT_TRUNCATE: - if (FLOAT_MODE_P (GET_MODE (x))) - { - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - case PROCESSOR_ULTRASPARC3: - *total = COSTS_N_INSNS (4); - return true; - - case PROCESSOR_SUPERSPARC: - *total = COSTS_N_INSNS (3); - return true; - - case PROCESSOR_CYPRESS: - *total = COSTS_N_INSNS (5); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - default: - *total = COSTS_N_INSNS (1); - return true; - } - } - - *total = COSTS_N_INSNS (1); - return true; - - case SQRT: - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (13); - else - *total = COSTS_N_INSNS (23); - return true; - - case PROCESSOR_ULTRASPARC3: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (20); - else - *total = COSTS_N_INSNS (29); - return true; - - case PROCESSOR_SUPERSPARC: - *total = COSTS_N_INSNS (12); - return true; - - case PROCESSOR_CYPRESS: - *total = COSTS_N_INSNS (63); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - *total = COSTS_N_INSNS (17); - return true; - - default: - *total = COSTS_N_INSNS (30); - return true; - } - - case COMPARE: - if (FLOAT_MODE_P (GET_MODE (x))) - { - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - case PROCESSOR_ULTRASPARC3: - *total = COSTS_N_INSNS (1); - return true; - - case PROCESSOR_SUPERSPARC: - *total = COSTS_N_INSNS (3); - return true; - - case PROCESSOR_CYPRESS: - *total = COSTS_N_INSNS (5); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - default: - *total = COSTS_N_INSNS (1); - return true; - } - } - - /* ??? Maybe mark integer compares as zero cost on - ??? all UltraSPARC processors because the result - ??? can be bypassed to a branch in the same group. */ - - *total = COSTS_N_INSNS (1); - return true; - - case MULT: - if (FLOAT_MODE_P (GET_MODE (x))) - { - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - case PROCESSOR_ULTRASPARC3: - *total = COSTS_N_INSNS (4); - return true; - - case PROCESSOR_SUPERSPARC: - *total = COSTS_N_INSNS (3); - return true; - - case PROCESSOR_CYPRESS: - *total = COSTS_N_INSNS (7); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - *total = COSTS_N_INSNS (1); - return true; - - default: - *total = COSTS_N_INSNS (5); - return true; - } - } - - /* The latency is actually variable for Ultra-I/II - And if one of the inputs have a known constant - value, we could calculate this precisely. - - However, for that to be useful we would need to - add some machine description changes which would - make sure small constants ended up in rs1 of the - multiply instruction. This is because the multiply - latency is determined by the number of clear (or - set if the value is negative) bits starting from - the most significant bit of the first input. - - The algorithm for computing num_cycles of a multiply - on Ultra-I/II is: - - if (rs1 < 0) - highest_bit = highest_clear_bit(rs1); - else - highest_bit = highest_set_bit(rs1); - if (num_bits < 3) - highest_bit = 3; - num_cycles = 4 + ((highest_bit - 3) / 2); - - If we did that we would have to also consider register - allocation issues that would result from forcing such - a value into a register. - - There are other similar tricks we could play if we - knew, for example, that one input was an array index. - - Since we do not play any such tricks currently the - safest thing to do is report the worst case latency. */ - if (sparc_cpu == PROCESSOR_ULTRASPARC) - { - *total = (GET_MODE (x) == DImode - ? COSTS_N_INSNS (34) : COSTS_N_INSNS (19)); - return true; - } - - /* Multiply latency on Ultra-III, fortunately, is constant. */ - if (sparc_cpu == PROCESSOR_ULTRASPARC3) - { - *total = COSTS_N_INSNS (6); - return true; - } - - if (sparc_cpu == PROCESSOR_HYPERSPARC - || sparc_cpu == PROCESSOR_SPARCLITE86X) - { - *total = COSTS_N_INSNS (17); - return true; - } - - *total = (TARGET_HARD_MUL ? COSTS_N_INSNS (5) : COSTS_N_INSNS (25)); - return true; - - case DIV: - case UDIV: - case MOD: - case UMOD: - if (FLOAT_MODE_P (GET_MODE (x))) - { - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (13); - else - *total = COSTS_N_INSNS (23); - return true; - - case PROCESSOR_ULTRASPARC3: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (17); - else - *total = COSTS_N_INSNS (20); - return true; - - case PROCESSOR_SUPERSPARC: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (6); - else - *total = COSTS_N_INSNS (9); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - if (GET_MODE (x) == SFmode) - *total = COSTS_N_INSNS (8); - else - *total = COSTS_N_INSNS (12); - return true; - - default: - *total = COSTS_N_INSNS (7); - return true; - } - } - - if (sparc_cpu == PROCESSOR_ULTRASPARC) - *total = (GET_MODE (x) == DImode - ? COSTS_N_INSNS (68) : COSTS_N_INSNS (37)); - else if (sparc_cpu == PROCESSOR_ULTRASPARC3) - *total = (GET_MODE (x) == DImode - ? COSTS_N_INSNS (71) : COSTS_N_INSNS (40)); - else - *total = COSTS_N_INSNS (25); - return true; - - case IF_THEN_ELSE: - /* Conditional moves. */ - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - *total = COSTS_N_INSNS (2); - return true; - - case PROCESSOR_ULTRASPARC3: - if (FLOAT_MODE_P (GET_MODE (x))) - *total = COSTS_N_INSNS (3); - else - *total = COSTS_N_INSNS (2); - return true; - - default: - *total = COSTS_N_INSNS (1); - return true; - } - - case MEM: - /* If outer-code is SIGN/ZERO extension we have to subtract - out COSTS_N_INSNS (1) from whatever we return in determining - the cost. */ - switch (sparc_cpu) - { - case PROCESSOR_ULTRASPARC: - if (outer_code == ZERO_EXTEND) - *total = COSTS_N_INSNS (1); - else - *total = COSTS_N_INSNS (2); - return true; - - case PROCESSOR_ULTRASPARC3: - if (outer_code == ZERO_EXTEND) - { - if (GET_MODE (x) == QImode - || GET_MODE (x) == HImode - || outer_code == SIGN_EXTEND) - *total = COSTS_N_INSNS (2); - else - *total = COSTS_N_INSNS (1); - } - else - { - /* This handles sign extension (3 cycles) - and everything else (2 cycles). */ - *total = COSTS_N_INSNS (2); - } - return true; - - case PROCESSOR_SUPERSPARC: - if (FLOAT_MODE_P (GET_MODE (x)) - || outer_code == ZERO_EXTEND - || outer_code == SIGN_EXTEND) - *total = COSTS_N_INSNS (0); - else - *total = COSTS_N_INSNS (1); - return true; - - case PROCESSOR_TSC701: - if (outer_code == ZERO_EXTEND - || outer_code == SIGN_EXTEND) - *total = COSTS_N_INSNS (2); - else - *total = COSTS_N_INSNS (3); - return true; - - case PROCESSOR_CYPRESS: - if (outer_code == ZERO_EXTEND - || outer_code == SIGN_EXTEND) - *total = COSTS_N_INSNS (1); - else - *total = COSTS_N_INSNS (2); - return true; - - case PROCESSOR_HYPERSPARC: - case PROCESSOR_SPARCLITE86X: - default: - if (outer_code == ZERO_EXTEND - || outer_code == SIGN_EXTEND) - *total = COSTS_N_INSNS (0); - else - *total = COSTS_N_INSNS (1); - return true; - } - case CONST_INT: if (INTVAL (x) < 0x1000 && INTVAL (x) >= -0x1000) { @@ -9272,22 +8315,210 @@ sparc_rtx_costs (rtx x, int code, int outer_code, int *total) return true; case CONST_DOUBLE: - if (GET_MODE (x) == DImode - && ((XINT (x, 3) == 0 - && (unsigned HOST_WIDE_INT) XINT (x, 2) < 0x1000) - || (XINT (x, 3) == -1 - && XINT (x, 2) < 0 - && XINT (x, 2) >= -0x1000))) + if (GET_MODE (x) == VOIDmode + && ((CONST_DOUBLE_HIGH (x) == 0 + && CONST_DOUBLE_LOW (x) < 0x1000) + || (CONST_DOUBLE_HIGH (x) == -1 + && CONST_DOUBLE_LOW (x) < 0 + && CONST_DOUBLE_LOW (x) >= -0x1000))) *total = 0; else *total = 8; return true; + case MEM: + /* If outer-code was a sign or zero extension, a cost + of COSTS_N_INSNS (1) was already added in. This is + why we are subtracting it back out. */ + if (outer_code == ZERO_EXTEND) + { + *total = sparc_costs->int_zload - COSTS_N_INSNS (1); + } + else if (outer_code == SIGN_EXTEND) + { + *total = sparc_costs->int_sload - COSTS_N_INSNS (1); + } + else if (float_mode_p) + { + *total = sparc_costs->float_load; + } + else + { + *total = sparc_costs->int_load; + } + + return true; + + case PLUS: + case MINUS: + if (float_mode_p) + *total = sparc_costs->float_plusminus; + else + *total = COSTS_N_INSNS (1); + return false; + + case MULT: + if (float_mode_p) + *total = sparc_costs->float_mul; + else if (! TARGET_HARD_MUL) + *total = COSTS_N_INSNS (25); + else + { + int bit_cost; + + bit_cost = 0; + if (sparc_costs->int_mul_bit_factor) + { + int nbits; + + if (GET_CODE (XEXP (x, 1)) == CONST_INT) + { + unsigned HOST_WIDE_INT value = INTVAL (XEXP (x, 1)); + for (nbits = 0; value != 0; value &= value - 1) + nbits++; + } + else if (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE + && GET_MODE (XEXP (x, 1)) == VOIDmode) + { + rtx x1 = XEXP (x, 1); + unsigned HOST_WIDE_INT value1 = CONST_DOUBLE_LOW (x1); + unsigned HOST_WIDE_INT value2 = CONST_DOUBLE_HIGH (x1); + + for (nbits = 0; value1 != 0; value1 &= value1 - 1) + nbits++; + for (; value2 != 0; value2 &= value2 - 1) + nbits++; + } + else + nbits = 7; + + if (nbits < 3) + nbits = 3; + bit_cost = (nbits - 3) / sparc_costs->int_mul_bit_factor; + bit_cost = COSTS_N_INSNS (bit_cost); + } + + if (mode == DImode) + *total = sparc_costs->int_mulX + bit_cost; + else + *total = sparc_costs->int_mul + bit_cost; + } + return false; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + *total = COSTS_N_INSNS (1) + sparc_costs->shift_penalty; + return false; + + case DIV: + case UDIV: + case MOD: + case UMOD: + if (float_mode_p) + { + if (mode == DFmode) + *total = sparc_costs->float_div_df; + else + *total = sparc_costs->float_div_sf; + } + else + { + if (mode == DImode) + *total = sparc_costs->int_divX; + else + *total = sparc_costs->int_div; + } + return false; + + case NEG: + if (! float_mode_p) + { + *total = COSTS_N_INSNS (1); + return false; + } + /* FALLTHRU */ + + case ABS: + case FLOAT: + case UNSIGNED_FLOAT: + case FIX: + case UNSIGNED_FIX: + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + *total = sparc_costs->float_move; + return false; + + case SQRT: + if (mode == DFmode) + *total = sparc_costs->float_sqrt_df; + else + *total = sparc_costs->float_sqrt_sf; + return false; + + case COMPARE: + if (float_mode_p) + *total = sparc_costs->float_cmp; + else + *total = COSTS_N_INSNS (1); + return false; + + case IF_THEN_ELSE: + if (float_mode_p) + *total = sparc_costs->float_cmove; + else + *total = sparc_costs->int_cmove; + return false; + + case IOR: + /* Handle the NAND vector patterns. */ + if (sparc_vector_mode_supported_p (GET_MODE (x)) + && GET_CODE (XEXP (x, 0)) == NOT + && GET_CODE (XEXP (x, 1)) == NOT) + { + *total = COSTS_N_INSNS (1); + return true; + } + else + return false; + default: return false; } } +/* Emit the sequence of insns SEQ while preserving the registers REG and REG2. + This is achieved by means of a manual dynamic stack space allocation in + the current frame. We make the assumption that SEQ doesn't contain any + function calls, with the possible exception of calls to the PIC helper. */ + +static void +emit_and_preserve (rtx seq, rtx reg, rtx reg2) +{ + /* We must preserve the lowest 16 words for the register save area. */ + HOST_WIDE_INT offset = 16*UNITS_PER_WORD; + /* We really need only 2 words of fresh stack space. */ + HOST_WIDE_INT size = SPARC_STACK_ALIGN (offset + 2*UNITS_PER_WORD); + + rtx slot + = gen_rtx_MEM (word_mode, plus_constant (stack_pointer_rtx, + SPARC_STACK_BIAS + offset)); + + emit_insn (gen_stack_pointer_dec (GEN_INT (size))); + emit_insn (gen_rtx_SET (VOIDmode, slot, reg)); + if (reg2) + emit_insn (gen_rtx_SET (VOIDmode, + adjust_address (slot, word_mode, UNITS_PER_WORD), + reg2)); + emit_insn (seq); + if (reg2) + emit_insn (gen_rtx_SET (VOIDmode, + reg2, + adjust_address (slot, word_mode, UNITS_PER_WORD))); + emit_insn (gen_rtx_SET (VOIDmode, reg, slot)); + emit_insn (gen_stack_pointer_inc (GEN_INT (size))); +} + /* Output the assembler code for a thunk function. THUNK_DECL is the declaration for the thunk function itself, FUNCTION is the decl for the target function. DELTA is an immediate constant offset to be @@ -9300,20 +8531,41 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, tree function) { rtx this, insn, funexp; + unsigned int int_arg_first; reload_completed = 1; epilogue_completed = 1; no_new_pseudos = 1; - current_function_uses_only_leaf_regs = 1; + reset_block_changes (); emit_note (NOTE_INSN_PROLOGUE_END); + if (flag_delayed_branch) + { + /* We will emit a regular sibcall below, so we need to instruct + output_sibcall that we are in a leaf function. */ + sparc_leaf_function_p = current_function_uses_only_leaf_regs = 1; + + /* This will cause final.c to invoke leaf_renumber_regs so we + must behave as if we were in a not-yet-leafified function. */ + int_arg_first = SPARC_INCOMING_INT_ARG_FIRST; + } + else + { + /* We will emit the sibcall manually below, so we will need to + manually spill non-leaf registers. */ + sparc_leaf_function_p = current_function_uses_only_leaf_regs = 0; + + /* We really are in a leaf function. */ + int_arg_first = SPARC_OUTGOING_INT_ARG_FIRST; + } + /* Find the "this" pointer. Normally in %o0, but in ARCH64 if the function returns a structure, the structure return pointer is there instead. */ if (TARGET_ARCH64 && aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)) - this = gen_rtx_REG (Pmode, SPARC_INCOMING_INT_ARG_FIRST + 1); + this = gen_rtx_REG (Pmode, int_arg_first + 1); else - this = gen_rtx_REG (Pmode, SPARC_INCOMING_INT_ARG_FIRST); + this = gen_rtx_REG (Pmode, int_arg_first); /* Add DELTA. When possible use a plain add, otherwise load it into a register first. */ @@ -9338,8 +8590,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, rtx vcall_offset_rtx = GEN_INT (vcall_offset); rtx scratch = gen_rtx_REG (Pmode, 1); - if (vcall_offset >= 0) - abort (); + gcc_assert (vcall_offset < 0); /* SCRATCH = *THIS. */ emit_move_insn (scratch, gen_rtx_MEM (Pmode, this)); @@ -9392,9 +8643,70 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, TREE_USED (function) = 1; } funexp = XEXP (DECL_RTL (function), 0); - funexp = gen_rtx_MEM (FUNCTION_MODE, funexp); - insn = emit_call_insn (gen_sibcall (funexp)); - SIBLING_CALL_P (insn) = 1; + + if (flag_delayed_branch) + { + funexp = gen_rtx_MEM (FUNCTION_MODE, funexp); + insn = emit_call_insn (gen_sibcall (funexp)); + SIBLING_CALL_P (insn) = 1; + } + else + { + /* The hoops we have to jump through in order to generate a sibcall + without using delay slots... */ + rtx spill_reg, spill_reg2, seq, scratch = gen_rtx_REG (Pmode, 1); + + if (flag_pic) + { + spill_reg = gen_rtx_REG (word_mode, 15); /* %o7 */ + spill_reg2 = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM); + start_sequence (); + /* Delay emitting the PIC helper function because it needs to + change the section and we are emitting assembly code. */ + load_pic_register (true); /* clobbers %o7 */ + scratch = legitimize_pic_address (funexp, Pmode, scratch); + seq = get_insns (); + end_sequence (); + emit_and_preserve (seq, spill_reg, spill_reg2); + } + else if (TARGET_ARCH32) + { + emit_insn (gen_rtx_SET (VOIDmode, + scratch, + gen_rtx_HIGH (SImode, funexp))); + emit_insn (gen_rtx_SET (VOIDmode, + scratch, + gen_rtx_LO_SUM (SImode, scratch, funexp))); + } + else /* TARGET_ARCH64 */ + { + switch (sparc_cmodel) + { + case CM_MEDLOW: + case CM_MEDMID: + /* The destination can serve as a temporary. */ + sparc_emit_set_symbolic_const64 (scratch, funexp, scratch); + break; + + case CM_MEDANY: + case CM_EMBMEDANY: + /* The destination cannot serve as a temporary. */ + spill_reg = gen_rtx_REG (DImode, 15); /* %o7 */ + start_sequence (); + sparc_emit_set_symbolic_const64 (scratch, funexp, spill_reg); + seq = get_insns (); + end_sequence (); + emit_and_preserve (seq, spill_reg, 0); + break; + + default: + gcc_unreachable (); + } + } + + emit_jump_insn (gen_indirect_jump (scratch)); + } + emit_barrier (); /* Run just enough of rest_of_compilation to get the insns emitted. @@ -9405,7 +8717,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, insn_locators_initialize (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; @@ -9450,7 +8762,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } static int @@ -9469,10 +8781,22 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) return 0; } -/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. +/* Handle the TARGET_DWARF_HANDLE_FRAME_UNSPEC hook. + This is called from dwarf2out.c to emit call frame instructions + for frame-related insns containing UNSPECs and UNSPEC_VOLATILEs. */ +static void +sparc_dwarf_handle_frame_unspec (const char *label, + rtx pattern ATTRIBUTE_UNUSED, + int index ATTRIBUTE_UNUSED) +{ + gcc_assert (index == UNSPECV_SAVEW); + dwarf2out_window_save (label); +} + +/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL. We need to emit DTP-relative relocations. */ -void +static void sparc_output_dwarf_dtprel (FILE *file, int size, rtx x) { switch (size) @@ -9484,10 +8808,142 @@ sparc_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs ("\t.xword\t%r_tls_dtpoff64(", file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs (")", file); } +/* Do whatever processing is required at the end of a file. */ + +static void +sparc_file_end (void) +{ + /* If we haven't emitted the special PIC helper function, do so now. */ + if (pic_helper_symbol_name[0] && !pic_helper_emitted_p) + emit_pic_helper (); + + if (NEED_INDICATE_EXEC_STACK) + file_end_indicate_exec_stack (); +} + +#ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING +/* Implement TARGET_MANGLE_FUNDAMENTAL_TYPE. */ + +static const char * +sparc_mangle_fundamental_type (tree type) +{ + if (!TARGET_64BIT + && TYPE_MAIN_VARIANT (type) == long_double_type_node + && TARGET_LONG_DOUBLE_128) + return "g"; + + /* For all other types, use normal C++ mangling. */ + return NULL; +} +#endif + +/* Expand code to perform a 8 or 16-bit compare and swap by doing 32-bit + compare and swap on the word containing the byte or half-word. */ + +void +sparc_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval) +{ + rtx addr1 = force_reg (Pmode, XEXP (mem, 0)); + rtx addr = gen_reg_rtx (Pmode); + rtx off = gen_reg_rtx (SImode); + rtx oldv = gen_reg_rtx (SImode); + rtx newv = gen_reg_rtx (SImode); + rtx oldvalue = gen_reg_rtx (SImode); + rtx newvalue = gen_reg_rtx (SImode); + rtx res = gen_reg_rtx (SImode); + rtx resv = gen_reg_rtx (SImode); + rtx memsi, val, mask, end_label, loop_label, cc; + + emit_insn (gen_rtx_SET (VOIDmode, addr, + gen_rtx_AND (Pmode, addr1, GEN_INT (-4)))); + + if (Pmode != SImode) + addr1 = gen_lowpart (SImode, addr1); + emit_insn (gen_rtx_SET (VOIDmode, off, + gen_rtx_AND (SImode, addr1, GEN_INT (3)))); + + memsi = gen_rtx_MEM (SImode, addr); + set_mem_alias_set (memsi, ALIAS_SET_MEMORY_BARRIER); + MEM_VOLATILE_P (memsi) = MEM_VOLATILE_P (mem); + + val = force_reg (SImode, memsi); + + emit_insn (gen_rtx_SET (VOIDmode, off, + gen_rtx_XOR (SImode, off, + GEN_INT (GET_MODE (mem) == QImode + ? 3 : 2)))); + + emit_insn (gen_rtx_SET (VOIDmode, off, + gen_rtx_ASHIFT (SImode, off, GEN_INT (3)))); + + if (GET_MODE (mem) == QImode) + mask = force_reg (SImode, GEN_INT (0xff)); + else + mask = force_reg (SImode, GEN_INT (0xffff)); + + emit_insn (gen_rtx_SET (VOIDmode, mask, + gen_rtx_ASHIFT (SImode, mask, off))); + + emit_insn (gen_rtx_SET (VOIDmode, val, + gen_rtx_AND (SImode, gen_rtx_NOT (SImode, mask), + val))); + + oldval = gen_lowpart (SImode, oldval); + emit_insn (gen_rtx_SET (VOIDmode, oldv, + gen_rtx_ASHIFT (SImode, oldval, off))); + + newval = gen_lowpart_common (SImode, newval); + emit_insn (gen_rtx_SET (VOIDmode, newv, + gen_rtx_ASHIFT (SImode, newval, off))); + + emit_insn (gen_rtx_SET (VOIDmode, oldv, + gen_rtx_AND (SImode, oldv, mask))); + + emit_insn (gen_rtx_SET (VOIDmode, newv, + gen_rtx_AND (SImode, newv, mask))); + + end_label = gen_label_rtx (); + loop_label = gen_label_rtx (); + emit_label (loop_label); + + emit_insn (gen_rtx_SET (VOIDmode, oldvalue, + gen_rtx_IOR (SImode, oldv, val))); + + emit_insn (gen_rtx_SET (VOIDmode, newvalue, + gen_rtx_IOR (SImode, newv, val))); + + emit_insn (gen_sync_compare_and_swapsi (res, memsi, oldvalue, newvalue)); + + emit_cmp_and_jump_insns (res, oldvalue, EQ, NULL, SImode, 0, end_label); + + emit_insn (gen_rtx_SET (VOIDmode, resv, + gen_rtx_AND (SImode, gen_rtx_NOT (SImode, mask), + res))); + + sparc_compare_op0 = resv; + sparc_compare_op1 = val; + cc = gen_compare_reg (NE); + + emit_insn (gen_rtx_SET (VOIDmode, val, resv)); + + sparc_compare_emitted = cc; + emit_jump_insn (gen_bne (loop_label)); + + emit_label (end_label); + + emit_insn (gen_rtx_SET (VOIDmode, res, + gen_rtx_AND (SImode, res, mask))); + + emit_insn (gen_rtx_SET (VOIDmode, res, + gen_rtx_LSHIFTRT (SImode, res, off))); + + emit_move_insn (result, gen_lowpart (GET_MODE (result), res)); +} + #include "gt-sparc.h" diff --git a/contrib/gcc/config/sparc/sparc.h b/contrib/gcc/config/sparc/sparc.h index 9f72bc80525..8a2121cf27c 100644 --- a/contrib/gcc/config/sparc/sparc.h +++ b/contrib/gcc/config/sparc/sparc.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Sun SPARC. Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997, 1998, 1999 - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com). 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, at Cygnus Support. @@ -19,12 +19,90 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Note that some other tm.h files include this one and then override whatever definitions are necessary. */ +/* Define the specific costs for a given cpu */ + +struct processor_costs { + /* Integer load */ + const int int_load; + + /* Integer signed load */ + const int int_sload; + + /* Integer zeroed load */ + const int int_zload; + + /* Float load */ + const int float_load; + + /* fmov, fneg, fabs */ + const int float_move; + + /* fadd, fsub */ + const int float_plusminus; + + /* fcmp */ + const int float_cmp; + + /* fmov, fmovr */ + const int float_cmove; + + /* fmul */ + const int float_mul; + + /* fdivs */ + const int float_div_sf; + + /* fdivd */ + const int float_div_df; + + /* fsqrts */ + const int float_sqrt_sf; + + /* fsqrtd */ + const int float_sqrt_df; + + /* umul/smul */ + const int int_mul; + + /* mulX */ + const int int_mulX; + + /* integer multiply cost for each bit set past the most + significant 3, so the formula for multiply cost becomes: + + if (rs1 < 0) + highest_bit = highest_clear_bit(rs1); + else + highest_bit = highest_set_bit(rs1); + if (highest_bit < 3) + highest_bit = 3; + cost = int_mul{,X} + ((highest_bit - 3) / int_mul_bit_factor); + + A value of zero indicates that the multiply costs is fixed, + and not variable. */ + const int int_mul_bit_factor; + + /* udiv/sdiv */ + const int int_div; + + /* divX */ + const int int_divX; + + /* movcc, movr */ + const int int_cmove; + + /* penalty for shifts, due to scheduling rules etc. */ + const int shift_penalty; +}; + +extern const struct processor_costs *sparc_costs; + /* Target CPU builtins. FIXME: Defining sparc is for the benefit of Solaris only; otherwise just define __sparc__. Sadly the headers are such a mess there is no Solaris-specific header. */ @@ -113,8 +191,6 @@ enum cmodel { CM_EMBMEDANY }; -/* Value of -mcmodel specified by user. */ -extern const char *sparc_cmodel_string; /* One of CM_FOO. */ extern enum cmodel sparc_cmodel; @@ -126,6 +202,19 @@ extern enum cmodel sparc_cmodel; #define SPARC_DEFAULT_CMODEL CM_32 +/* The SPARC-V9 architecture defines a relaxed memory ordering model (RMO) + which requires the following macro to be true if enabled. Prior to V9, + there are no instructions to even talk about memory synchronization. + Note that the UltraSPARC III processors don't implement RMO, unlike the + UltraSPARC II processors. Niagara does not implement RMO either. + + Default to false; for example, Solaris never enables RMO, only ever uses + total memory ordering (TMO). */ +#define SPARC_RELAXED_ORDERING false + +/* Do not use the .note.GNU-stack convention by default. */ +#define NEED_INDICATE_EXEC_STACK 0 + /* This is call-clobbered in the normal ABI, but is reserved in the home grown (aka upward compatible) embedded ABI. */ #define EMBMEDANY_BASE_REG "%g4" @@ -149,10 +238,12 @@ extern enum cmodel sparc_cmodel; #define TARGET_CPU_sparc64 7 /* alias */ #define TARGET_CPU_ultrasparc 8 #define TARGET_CPU_ultrasparc3 9 +#define TARGET_CPU_niagara 10 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \ || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \ - || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 + || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \ + || TARGET_CPU_DEFAULT == TARGET_CPU_niagara #define CPP_CPU32_DEFAULT_SPEC "" #define ASM_CPU32_DEFAULT_SPEC "" @@ -173,6 +264,10 @@ extern enum cmodel sparc_cmodel; #define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__" #define ASM_CPU64_DEFAULT_SPEC "-Av9b" #endif +#if TARGET_CPU_DEFAULT == TARGET_CPU_niagara +#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__" +#define ASM_CPU64_DEFAULT_SPEC "-Av9b" +#endif #else @@ -263,6 +358,7 @@ extern enum cmodel sparc_cmodel; %{mcpu=v9:-D__sparc_v9__} \ %{mcpu=ultrasparc:-D__sparc_v9__} \ %{mcpu=ultrasparc3:-D__sparc_v9__} \ +%{mcpu=niagara:-D__sparc_v9__} \ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(cpp_cpu_default)}}}}}}} \ " #define CPP_ARCH32_SPEC "" @@ -312,6 +408,7 @@ extern enum cmodel sparc_cmodel; %{mcpu=v9:-Av9} \ %{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \ %{mcpu=ultrasparc3:%{!mv8plus:-Av9b}} \ +%{mcpu=niagara:%{!mv8plus:-Av9b}} \ %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:%(asm_cpu_default)}}}}}}} \ " @@ -392,131 +489,14 @@ extern enum cmodel sparc_cmodel; /* Show we can debug even without a frame pointer. */ #define CAN_DEBUG_WITHOUT_FP +/* Option handling. */ + #define OVERRIDE_OPTIONS sparc_override_options () - -/* Generate DBX debugging information. */ - -#define DBX_DEBUGGING_INFO 1 -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Nonzero if we should generate code to use the fpu. */ -#define MASK_FPU 1 -#define TARGET_FPU (target_flags & MASK_FPU) - -/* Nonzero if we should assume that double pointers might be unaligned. - This can happen when linking gcc compiled code with other compilers, - because the ABI only guarantees 4 byte alignment. */ -#define MASK_UNALIGNED_DOUBLES 4 -#define TARGET_UNALIGNED_DOUBLES (target_flags & MASK_UNALIGNED_DOUBLES) - -/* Nonzero means that we should generate code for a v8 sparc. */ -#define MASK_V8 0x8 -#define TARGET_V8 (target_flags & MASK_V8) - -/* Nonzero means that we should generate code for a sparclite. - This enables the sparclite specific instructions, but does not affect - whether FPU instructions are emitted. */ -#define MASK_SPARCLITE 0x10 -#define TARGET_SPARCLITE (target_flags & MASK_SPARCLITE) - -/* Nonzero if we're compiling for the sparclet. */ -#define MASK_SPARCLET 0x20 -#define TARGET_SPARCLET (target_flags & MASK_SPARCLET) - -/* Nonzero if we're compiling for v9 sparc. - Note that v9's can run in 32 bit mode so this doesn't necessarily mean - the word size is 64. */ -#define MASK_V9 0x40 -#define TARGET_V9 (target_flags & MASK_V9) - -/* Nonzero to generate code that uses the instructions deprecated in - the v9 architecture. This option only applies to v9 systems. */ -/* ??? This isn't user selectable yet. It's used to enable such insns - on 32 bit v9 systems and for the moment they're permanently disabled - on 64 bit v9 systems. */ -#define MASK_DEPRECATED_V8_INSNS 0x80 -#define TARGET_DEPRECATED_V8_INSNS (target_flags & MASK_DEPRECATED_V8_INSNS) - /* Mask of all CPU selection flags. */ #define MASK_ISA \ (MASK_V8 + MASK_SPARCLITE + MASK_SPARCLET + MASK_V9 + MASK_DEPRECATED_V8_INSNS) -/* Nonzero means don't pass `-assert pure-text' to the linker. */ -#define MASK_IMPURE_TEXT 0x100 -#define TARGET_IMPURE_TEXT (target_flags & MASK_IMPURE_TEXT) - -/* Nonzero means that we should generate code using a flat register window - model, i.e. no save/restore instructions are generated, which is - compatible with normal sparc code. - The frame pointer is %i7 instead of %fp. */ -#define MASK_FLAT 0x200 -#define TARGET_FLAT (target_flags & MASK_FLAT) - -/* Nonzero means use the registers that the SPARC ABI reserves for - application software. This must be the default to coincide with the - setting in FIXED_REGISTERS. */ -#define MASK_APP_REGS 0x400 -#define TARGET_APP_REGS (target_flags & MASK_APP_REGS) - -/* Option to select how quad word floating point is implemented. - When TARGET_HARD_QUAD is true, we use the hardware quad instructions. - Otherwise, we use the SPARC ABI quad library functions. */ -#define MASK_HARD_QUAD 0x800 -#define TARGET_HARD_QUAD (target_flags & MASK_HARD_QUAD) - -/* Nonzero on little-endian machines. */ -/* ??? Little endian support currently only exists for sparclet-aout and - sparc64-elf configurations. May eventually want to expand the support - to all targets, but for now it's kept local to only those two. */ -#define MASK_LITTLE_ENDIAN 0x1000 -#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) - -/* 0x2000, 0x4000 are unused */ - -/* Nonzero if pointers are 64 bits. */ -#define MASK_PTR64 0x8000 -#define TARGET_PTR64 (target_flags & MASK_PTR64) - -/* Nonzero if generating code to run in a 64 bit environment. - This is intended to only be used by TARGET_ARCH{32,64} as they are the - mechanism used to control compile time or run time selection. */ -#define MASK_64BIT 0x10000 -#define TARGET_64BIT (target_flags & MASK_64BIT) - -/* 0x20000,0x40000 unused */ - -/* Nonzero means use a stack bias of 2047. Stack offsets are obtained by - adding 2047 to %sp. This option is for v9 only and is the default. */ -#define MASK_STACK_BIAS 0x80000 -#define TARGET_STACK_BIAS (target_flags & MASK_STACK_BIAS) - -/* 0x100000,0x200000 unused */ - -/* Nonzero means -m{,no-}fpu was passed on the command line. */ -#define MASK_FPU_SET 0x400000 -#define TARGET_FPU_SET (target_flags & MASK_FPU_SET) - -/* Use the UltraSPARC Visual Instruction Set extensions. */ -#define MASK_VIS 0x1000000 -#define TARGET_VIS (target_flags & MASK_VIS) - -/* Compile for Solaris V8+. 32 bit Solaris preserves the high bits of - the current out and global registers and Linux 2.2+ as well. */ -#define MASK_V8PLUS 0x2000000 -#define TARGET_V8PLUS (target_flags & MASK_V8PLUS) - -/* Force a the fastest alignment on structures to take advantage of - faster copies. */ -#define MASK_FASTER_STRUCTS 0x4000000 -#define TARGET_FASTER_STRUCTS (target_flags & MASK_FASTER_STRUCTS) - -/* Use IEEE quad long double. */ -#define MASK_LONG_DOUBLE_128 0x8000000 -#define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128) - /* TARGET_HARD_MUL: Use hardware multiply instructions but not %y. TARGET_HARD_MUL32: Use hardware multiply instructions with rd %y to get high 32 bits. False in V8+ or V9 because multiply stores @@ -531,97 +511,11 @@ extern int target_flags; (TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET \ || TARGET_DEPRECATED_V8_INSNS || TARGET_V8PLUS) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - { {"fpu", MASK_FPU | MASK_FPU_SET, \ - N_("Use hardware fp") }, \ - {"no-fpu", -MASK_FPU, \ - N_("Do not use hardware fp") }, \ - {"no-fpu", MASK_FPU_SET, NULL, }, \ - {"hard-float", MASK_FPU | MASK_FPU_SET, \ - N_("Use hardware fp") }, \ - {"soft-float", -MASK_FPU, \ - N_("Do not use hardware fp") }, \ - {"soft-float", MASK_FPU_SET, NULL }, \ - {"unaligned-doubles", MASK_UNALIGNED_DOUBLES, \ - N_("Assume possible double misalignment") }, \ - {"no-unaligned-doubles", -MASK_UNALIGNED_DOUBLES, \ - N_("Assume all doubles are aligned") }, \ - {"impure-text", MASK_IMPURE_TEXT, \ - N_("Pass -assert pure-text to linker") }, \ - {"no-impure-text", -MASK_IMPURE_TEXT, \ - N_("Do not pass -assert pure-text to linker") }, \ - {"flat", MASK_FLAT, \ - N_("Use flat register window model") }, \ - {"no-flat", -MASK_FLAT, \ - N_("Do not use flat register window model") }, \ - {"app-regs", MASK_APP_REGS, \ - N_("Use ABI reserved registers") }, \ - {"no-app-regs", -MASK_APP_REGS, \ - N_("Do not use ABI reserved registers") }, \ - {"hard-quad-float", MASK_HARD_QUAD, \ - N_("Use hardware quad fp instructions") }, \ - {"soft-quad-float", -MASK_HARD_QUAD, \ - N_("Do not use hardware quad fp instructions") }, \ - {"v8plus", MASK_V8PLUS, \ - N_("Compile for v8plus ABI") }, \ - {"no-v8plus", -MASK_V8PLUS, \ - N_("Do not compile for v8plus ABI") }, \ - {"vis", MASK_VIS, \ - N_("Utilize Visual Instruction Set") }, \ - {"no-vis", -MASK_VIS, \ - N_("Do not utilize Visual Instruction Set") }, \ - /* ??? These are deprecated, coerced to -mcpu=. Delete in 2.9. */ \ - {"cypress", 0, \ - N_("Optimize for Cypress processors") }, \ - {"sparclite", 0, \ - N_("Optimize for SPARCLite processors") }, \ - {"f930", 0, \ - N_("Optimize for F930 processors") }, \ - {"f934", 0, \ - N_("Optimize for F934 processors") }, \ - {"v8", 0, \ - N_("Use V8 SPARC ISA") }, \ - {"supersparc", 0, \ - N_("Optimize for SuperSPARC processors") }, \ - /* End of deprecated options. */ \ - {"ptr64", MASK_PTR64, \ - N_("Pointers are 64-bit") }, \ - {"ptr32", -MASK_PTR64, \ - N_("Pointers are 32-bit") }, \ - {"32", -MASK_64BIT, \ - N_("Use 32-bit ABI") }, \ - {"64", MASK_64BIT, \ - N_("Use 64-bit ABI") }, \ - {"stack-bias", MASK_STACK_BIAS, \ - N_("Use stack bias") }, \ - {"no-stack-bias", -MASK_STACK_BIAS, \ - N_("Do not use stack bias") }, \ - {"faster-structs", MASK_FASTER_STRUCTS, \ - N_("Use structs on stronger alignment for double-word copies") }, \ - {"no-faster-structs", -MASK_FASTER_STRUCTS, \ - N_("Do not use structs on stronger alignment for double-word copies") }, \ - {"relax", 0, \ - N_("Optimize tail call instructions in assembler and linker") }, \ - {"no-relax", 0, \ - N_("Do not optimize tail call instructions in assembler or linker") }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT, ""}} - /* MASK_APP_REGS must always be the default because that's what FIXED_REGISTERS is set to and -ffixed- is processed before CONDITIONAL_REGISTER_USAGE is called (where we process -mno-app-regs). */ #define TARGET_DEFAULT (MASK_APP_REGS + MASK_FPU) -/* This is meant to be redefined in target specific files. */ -#define SUBTARGET_SWITCHES - /* Processor type. These must match the values for the cpu attribute in sparc.md. */ enum processor_type { @@ -638,7 +532,8 @@ enum processor_type { PROCESSOR_TSC701, PROCESSOR_V9, PROCESSOR_ULTRASPARC, - PROCESSOR_ULTRASPARC3 + PROCESSOR_ULTRASPARC3, + PROCESSOR_NIAGARA }; /* This is set from -m{cpu,tune}=xxx. */ @@ -648,20 +543,6 @@ extern enum processor_type sparc_cpu; Every file includes us, but not every file includes insn-attr.h. */ #define sparc_cpu_attr ((enum attr_cpu) sparc_cpu) -#define TARGET_OPTIONS \ -{ \ - { "cpu=", &sparc_select[1].string, \ - N_("Use features of and schedule code for given CPU"), 0}, \ - { "tune=", &sparc_select[2].string, \ - N_("Schedule code for given CPU"), 0}, \ - { "cmodel=", &sparc_cmodel_string, \ - N_("Use given SPARC code model"), 0}, \ - SUBTARGET_OPTIONS \ -} - -/* This is meant to be redefined in target specific files. */ -#define SUBTARGET_OPTIONS - /* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. @@ -714,6 +595,8 @@ extern struct sparc_cpu_select sparc_select[]; #define MIN_UNITS_PER_WORD 4 #endif +#define UNITS_PER_SIMD_WORD (TARGET_VIS ? 8 : UNITS_PER_WORD) + /* Now define the sizes of the C data types. */ #define SHORT_TYPE_SIZE 16 @@ -722,18 +605,9 @@ extern struct sparc_cpu_select sparc_select[]; #define LONG_LONG_TYPE_SIZE 64 #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 - -#ifdef SPARC_BI_ARCH -#define MAX_LONG_TYPE_SIZE 64 -#endif - -#if 0 -/* ??? This does not work in SunOS 4.x, so it is not enabled here. - Instead, it is enabled in sol2.h, because it does work under Solaris. */ -/* Define for support of TFmode long double. - SPARC ABI says that long double is 4 words. */ -#define LONG_DOUBLE_TYPE_SIZE 128 -#endif +/* LONG_DOUBLE_TYPE_SIZE is defined per OS even though the + SPARC ABI says that it is 128-bit wide. */ +/* #define LONG_DOUBLE_TYPE_SIZE 128 */ /* Width in bits of a pointer. See also the macro `Pmode' defined below. */ @@ -744,54 +618,24 @@ extern struct sparc_cpu_select sparc_select[]; if ptr_mode and Pmode are the same. */ #define POINTERS_EXTEND_UNSIGNED 1 -/* A macro to update MODE and UNSIGNEDP when an object whose type - is TYPE and which has the specified mode and signedness is to be - stored in a register. This macro is only called when TYPE is a - scalar type. */ -#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ -if (TARGET_ARCH64 \ - && GET_MODE_CLASS (MODE) == MODE_INT \ - && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ - (MODE) = DImode; - -/* Define this macro if the promotion described by PROMOTE_MODE - should also be done for outgoing function arguments. */ -/* This is only needed for TARGET_ARCH64, but since PROMOTE_MODE is a no-op - for TARGET_ARCH32 this is ok. Otherwise we'd need to add a runtime test - for this value. */ -#define PROMOTE_FUNCTION_ARGS - -/* Define this macro if the promotion described by PROMOTE_MODE - should also be done for the return value of functions. - If this macro is defined, FUNCTION_VALUE must perform the same - promotions done by PROMOTE_MODE. */ -/* This is only needed for TARGET_ARCH64, but since PROMOTE_MODE is a no-op - for TARGET_ARCH32 this is ok. Otherwise we'd need to add a runtime test - for this value. */ -#define PROMOTE_FUNCTION_RETURN - -/* Define this macro if the promotion described by PROMOTE_MODE - should _only_ be performed for outgoing function arguments or - function return values, as specified by PROMOTE_FUNCTION_ARGS - and PROMOTE_FUNCTION_RETURN, respectively. */ -/* This is only needed for TARGET_ARCH64, but since PROMOTE_MODE is a no-op - for TARGET_ARCH32 this is ok. Otherwise we'd need to add a runtime test - for this value. For TARGET_ARCH64 we need it, as we don't have instructions +/* For TARGET_ARCH64 we need this, as we don't have instructions for arithmetic operations which do zero/sign extension at the same time, so without this we end up with a srl/sra after every assignment to an user variable, which means very very bad code. */ -#define PROMOTE_FOR_CALL_ONLY +#define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \ +if (TARGET_ARCH64 \ + && GET_MODE_CLASS (MODE) == MODE_INT \ + && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ + (MODE) = word_mode; /* Allocation boundary (in *bits*) for storing arguments in argument list. */ #define PARM_BOUNDARY (TARGET_ARCH64 ? 64 : 32) /* Boundary (in *bits*) on which stack pointer should be aligned. */ /* FIXME, this is wrong when TARGET_ARCH64 and TARGET_STACK_BIAS, because - then sp+2047 is 128-bit aligned so sp is really only byte-aligned. */ + then %sp+2047 is 128-bit aligned so %sp is really only byte-aligned. */ #define STACK_BOUNDARY (TARGET_ARCH64 ? 128 : 64) -/* Temporary hack until the FIXME above is fixed. This macro is used - only in pad_to_arg_alignment in function.c; see the comment there - for details about what it does. */ +/* Temporary hack until the FIXME above is fixed. */ #define SPARC_STACK_BOUNDARY_HACK (TARGET_ARCH64 && TARGET_STACK_BIAS) /* ALIGN FRAMES on double word boundaries */ @@ -854,15 +698,6 @@ if (TARGET_ARCH64 \ because the linker fails to align the text section enough! Put them in the data section. This macro is only used in this file. */ #define MAX_TEXT_ALIGN 32 - -/* This forces all variables and constants to the data section when PIC. - This is because the SunOS 4 shared library scheme thinks everything in - text is a function, and patches the address to point to a loader stub. */ -/* This is defined to zero for every system which doesn't use the a.out object - file format. */ -#ifndef SUNOS4_SHARED_LIBRARIES -#define SUNOS4_SHARED_LIBRARIES 0 -#endif /* Standard register usage. */ @@ -875,7 +710,7 @@ if (TARGET_ARCH64 \ SPARC has 32 integer registers and 32 floating point registers. 64 bit SPARC has 32 additional fp regs, but the odd numbered ones are not accessible. We still account for them to simplify register computations - (eg: in CLASS_MAX_NREGS). There are also 4 fp condition code registers, so + (e.g.: in CLASS_MAX_NREGS). There are also 4 fp condition code registers, so 32+32+32+4 == 100. Register 100 is used as the integer condition code register. Register 101 is used as the soft frame pointer register. */ @@ -900,7 +735,7 @@ if (TARGET_ARCH64 \ /* Argument passing regs. */ #define SPARC_OUTGOING_INT_ARG_FIRST 8 -#define SPARC_INCOMING_INT_ARG_FIRST (TARGET_FLAT ? 8 : 24) +#define SPARC_INCOMING_INT_ARG_FIRST 24 #define SPARC_FP_ARG_FIRST 32 /* 1 for registers that have pervasive standard uses @@ -1021,19 +856,6 @@ do \ fixed_regs[4] = 1; \ else if (fixed_regs[4] == 2) \ fixed_regs[4] = 0; \ - if (TARGET_FLAT) \ - { \ - int regno; \ - /* Let the compiler believe the frame pointer is still \ - %fp, but output it as %i7. */ \ - fixed_regs[31] = 1; \ - reg_names[HARD_FRAME_POINTER_REGNUM] = "%i7"; \ - /* Disable leaf functions */ \ - memset (sparc_leaf_regs, 0, FIRST_PSEUDO_REGISTER); \ - /* Make LEAF_REG_REMAP a noop. */ \ - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \ - leaf_reg_remap [regno] = regno; \ - } \ } \ while (0) @@ -1071,6 +893,11 @@ extern int sparc_mode_class[]; #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ((hard_regno_mode_classes[REGNO] & sparc_mode_class[MODE]) != 0) +/* Value is 1 if it is OK to rename a hard register FROM to another hard + register TO. We cannot rename %g1 as it may be used before the save + register window instruction in the prologue. */ +#define HARD_REGNO_RENAME_OK(FROM, TO) ((FROM) != 1) + /* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, @@ -1089,9 +916,6 @@ extern int sparc_mode_class[]; /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ -/* SPARC pc isn't overloaded on a register that the compiler knows about. */ -/* #define PC_REGNUM */ - /* Register to use for pushing function arguments. */ #define STACK_POINTER_REGNUM 14 @@ -1125,17 +949,9 @@ extern int sparc_mode_class[]; /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed via the stack pointer) in functions that seem suitable. - This is computed in `reload', in reload1.c. - Used in flow.c, global.c, and reload1.c. - - Being a non-leaf function does not mean a frame pointer is needed in the - flat window model. However, the debugger won't be able to backtrace through - us with out it. */ -#define FRAME_POINTER_REQUIRED \ - (TARGET_FLAT \ - ? (current_function_calls_alloca \ - || !leaf_function_p ()) \ - : ! (leaf_function_p () && only_leaf_regs_used ())) + Used in flow.c, global.c, ra.c and reload1.c. */ +#define FRAME_POINTER_REQUIRED \ + (! (leaf_function_p () && only_leaf_regs_used ())) /* Base register for access to arguments of the function. */ #define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM @@ -1155,37 +971,12 @@ extern int sparc_mode_class[]; #define DEFAULT_PCC_STRUCT_RETURN -1 -/* SPARC ABI says that quad-precision floats and all structures are returned - in memory. - For v9: unions <= 32 bytes in size are returned in int regs, - structures up to 32 bytes are returned in int and fp regs. */ - -#define RETURN_IN_MEMORY(TYPE) \ -(TARGET_ARCH32 \ - ? (TYPE_MODE (TYPE) == BLKmode \ - || TYPE_MODE (TYPE) == TFmode) \ - : (TYPE_MODE (TYPE) == BLKmode \ - && (unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 32)) - /* Functions which return large structures get the address to place the wanted value at offset 64 from the frame. Must reserve 64 bytes for the in and local registers. v9: Functions which return large structures get the address to place the wanted value from an invisible first argument. */ -/* Used only in other #defines in this file. */ #define STRUCT_VALUE_OFFSET 64 - -#define STRUCT_VALUE \ - (TARGET_ARCH64 \ - ? 0 \ - : gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \ - STRUCT_VALUE_OFFSET))) - -#define STRUCT_VALUE_INCOMING \ - (TARGET_ARCH64 \ - ? 0 \ - : gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx, \ - STRUCT_VALUE_OFFSET))) /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. @@ -1224,11 +1015,12 @@ extern int sparc_mode_class[]; because reg_class_subunion[GENERAL_REGS][FP_REGS] will yield FP_REGS, because FP_REGS > GENERAL_REGS. - It is also important that one class contain all the general and all the - fp regs. Otherwise when spilling a DFmode reg, it may be from EXTRA_FP_REGS - but find_reloads() may use class GENERAL_OR_FP_REGS. This will cause - allocate_reload_reg() to bypass it causing an abort because the compiler - thinks it doesn't have a spill reg when in fact it does. + It is also important that one class contain all the general and all + the fp regs. Otherwise when spilling a DFmode reg, it may be from + EXTRA_FP_REGS but find_reloads() may use class + GENERAL_OR_FP_REGS. This will cause allocate_reload_reg() to die + because the compiler thinks it doesn't have a spill reg when in + fact it does. v9 also has 4 floating point condition code registers. Since we don't have a class that is the union of FPCC_REGS with either of the others, @@ -1405,8 +1197,8 @@ extern char leaf_reg_remap[]; : (C) == 'c' ? FPCC_REGS \ : NO_REGS)) -/* The letters I, J, K, L and M in a register constraint string - can be used to stand for particular ranges of immediate operands. +/* The letters I, J, K, L, M, N, O, P in a register constraint string + can be used to stand for particular ranges of CONST_INTs. This macro defines what the ranges are. C is the letter, and VALUE is a constant value. Return 1 if VALUE is in the range specified by C. @@ -1417,20 +1209,32 @@ extern char leaf_reg_remap[]; `L' is used for the range of constants supported by the movcc insns. `M' is used for the range of constants supported by the movrcc insns. `N' is like K, but for constants wider than 32 bits. - `O' is used for the range which is just 4096. */ + `O' is used for the range which is just 4096. + `P' is free. */ +/* Predicates for 10-bit, 11-bit and 13-bit signed constants. */ #define SPARC_SIMM10_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x200 < 0x400) #define SPARC_SIMM11_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x400 < 0x800) #define SPARC_SIMM13_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x1000 < 0x2000) -/* 10 and 11 bit immediates are only used for a few specific insns. + +/* 10- and 11-bit immediates are only used for a few specific insns. SMALL_INT is used throughout the port so we continue to use it. */ #define SMALL_INT(X) (SPARC_SIMM13_P (INTVAL (X))) -/* 13 bit immediate, considering only the low 32 bits */ -#define SMALL_INT32(X) (SPARC_SIMM13_P (trunc_int_for_mode \ - (INTVAL (X), SImode))) + +/* Predicate for constants that can be loaded with a sethi instruction. + This is the general, 64-bit aware, bitwise version that ensures that + only constants whose representation fits in the mask + + 0x00000000fffffc00 + + are accepted. It will reject, for example, negative SImode constants + on 64-bit hosts, so correct handling is to mask the value beforehand + according to the mode of the instruction. */ #define SPARC_SETHI_P(X) \ (((unsigned HOST_WIDE_INT) (X) \ & ((unsigned HOST_WIDE_INT) 0x3ff - GET_MODE_MASK (SImode) - 1)) == 0) + +/* Version of the above predicate for SImode constants and below. */ #define SPARC_SETHI32_P(X) \ (SPARC_SETHI_P ((unsigned HOST_WIDE_INT) (X) & GET_MODE_MASK (SImode))) @@ -1444,13 +1248,12 @@ extern char leaf_reg_remap[]; : (C) == 'O' ? (VALUE) == 4096 \ : 0) -/* Similar, but for floating constants, and defining letters G and H. +/* Similar, but for CONST_DOUBLEs, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. */ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? fp_zero_operand (VALUE, GET_MODE (VALUE)) \ + ((C) == 'G' ? const_zero_operand (VALUE, GET_MODE (VALUE)) \ : (C) == 'H' ? arith_double_operand (VALUE, DImode) \ - : (C) == 'O' ? arith_double_4096_operand (VALUE, DImode) \ : 0) /* Given an rtx X being reloaded into a reg required to be @@ -1473,7 +1276,7 @@ extern char leaf_reg_remap[]; || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! TARGET_FPU) \ || (GET_MODE (X) == TFmode \ - && ! fp_zero_operand (X, TFmode))) \ + && ! const_zero_operand (X, TFmode))) \ ? NO_REGS \ : (!FP_REG_CLASS_P (CLASS) \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_INT) \ @@ -1565,41 +1368,26 @@ extern char leaf_reg_remap[]; /* Stack layout; function entry, exit and calling. */ -/* Define the number of register that can hold parameters. - This macro is only used in other macro definitions below and in sparc.c. - MODE is the mode of the argument. - !v9: All args are passed in %o0-%o5. - v9: %o0-%o5 and %f0-%f31 are cumulatively used to pass values. - See the description in sparc.c. */ -#define NPARM_REGS(MODE) \ -(TARGET_ARCH64 \ - ? (GET_MODE_CLASS (MODE) == MODE_FLOAT ? 32 : 6) \ - : 6) - /* Define this if pushing a word on the stack makes the stack pointer a smaller address. */ #define STACK_GROWS_DOWNWARD -/* Define this if the nominal address of the stack frame +/* Define this to nonzero if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. */ -#define FRAME_GROWS_DOWNWARD +#define FRAME_GROWS_DOWNWARD 1 /* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING of the first local allocated. */ -/* This allows space for one TFmode floating point value. */ +/* This allows space for one TFmode floating point value, which is used + by SECONDARY_MEMORY_NEEDED_RTX. */ #define STARTING_FRAME_OFFSET \ (TARGET_ARCH64 ? -16 \ : (-SPARC_STACK_ALIGN (LONG_DOUBLE_TYPE_SIZE / BITS_PER_UNIT))) -/* If we generate an insn to push BYTES bytes, - this says how many the stack pointer really advances by. - On SPARC, don't define this because there are no push insns. */ -/* #define PUSH_ROUNDING(BYTES) */ - /* Offset of first parameter from the argument pointer register value. !v9: This is 64 for the ins and locals, plus 4 for the struct-return reg even if this function isn't going to use it. @@ -1624,7 +1412,6 @@ extern char leaf_reg_remap[]; #define REG_PARM_STACK_SPACE(DECL) (6 * UNITS_PER_WORD) /* Definitions for register elimination. */ -/* ??? In TARGET_FLAT mode we needn't have a hard frame pointer. */ #define ELIMINABLE_REGS \ {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ @@ -1637,22 +1424,16 @@ extern char leaf_reg_remap[]; #define CAN_ELIMINATE(FROM, TO) \ ((TO) == HARD_FRAME_POINTER_REGNUM || !FRAME_POINTER_REQUIRED) -#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ - do { \ - (OFFSET) = 0; \ - if ((TO) == STACK_POINTER_REGNUM) \ - { \ - /* Note, we always pretend that this is a leaf function \ - because if it's not, there's no point in trying to \ - eliminate the frame pointer. If it is a leaf \ - function, we guessed right! */ \ - if (TARGET_FLAT) \ - (OFFSET) = \ - sparc_flat_compute_frame_size (get_frame_size ()); \ - else \ - (OFFSET) = compute_frame_size (get_frame_size (), 1); \ - } \ - (OFFSET) += SPARC_STACK_BIAS; \ +/* We always pretend that this is a leaf function because if it's not, + there's no point in trying to eliminate the frame pointer. If it + is a leaf function, we guessed right! */ +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + do { \ + if ((TO) == STACK_POINTER_REGNUM) \ + (OFFSET) = sparc_compute_frame_size (get_frame_size (), 1); \ + else \ + (OFFSET) = 0; \ + (OFFSET) += SPARC_STACK_BIAS; \ } while (0) /* Keep the stack pointer constant throughout the function. @@ -1670,40 +1451,13 @@ extern char leaf_reg_remap[]; #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 -/* Some subroutine macros specific to this machine. - When !TARGET_FPU, put float return values in the general registers, - since we don't have any fp registers. */ -#define BASE_RETURN_VALUE_REG(MODE) \ - (TARGET_ARCH64 \ - ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32 : 8) \ - : (TARGET_FPU && FLOAT_MODE_P (MODE) && (MODE) != TFmode ? 32 : 8)) - -#define BASE_OUTGOING_VALUE_REG(MODE) \ - (TARGET_ARCH64 \ - ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32 \ - : TARGET_FLAT ? 8 : 24) \ - : (TARGET_FPU && FLOAT_MODE_P (MODE) && (MODE) != TFmode ? 32\ - : (TARGET_FLAT ? 8 : 24))) - -#define BASE_PASSING_ARG_REG(MODE) \ - (TARGET_ARCH64 \ - ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32 : 8) \ - : 8) - -/* ??? FIXME -- seems wrong for v9 structure passing... */ -#define BASE_INCOMING_ARG_REG(MODE) \ - (TARGET_ARCH64 \ - ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32 \ - : TARGET_FLAT ? 8 : 24) \ - : (TARGET_FLAT ? 8 : 24)) - /* Define this macro if the target machine has "register windows". This C expression returns the register number as seen by the called function corresponding to register number OUT as seen by the calling function. Return OUT if register number OUT is not an outbound register. */ #define INCOMING_REGNO(OUT) \ - ((TARGET_FLAT || (OUT) < 8 || (OUT) > 15) ? (OUT) : (OUT) + 16) + (((OUT) < 8 || (OUT) > 15) ? (OUT) : (OUT) + 16) /* Define this macro if the target machine has "register windows". This C expression returns the register number as seen by the calling function @@ -1711,14 +1465,14 @@ extern char leaf_reg_remap[]; Return IN if register number IN is not an inbound register. */ #define OUTGOING_REGNO(IN) \ - ((TARGET_FLAT || (IN) < 24 || (IN) > 31) ? (IN) : (IN) - 16) + (((IN) < 24 || (IN) > 31) ? (IN) : (IN) - 16) /* Define this macro if the target machine has register windows. This C expression returns true if the register is call-saved but is in the register window. */ #define LOCAL_REGNO(REGNO) \ - (TARGET_FLAT ? 0 : (REGNO) >= 16 && (REGNO) <= 31) + ((REGNO) >= 16 && (REGNO) <= 31) /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). @@ -1751,7 +1505,7 @@ extern char leaf_reg_remap[]; /* Define the size of space to allocate for the return value of an untyped_call. */ -#define APPLY_RESULT_SIZE 16 +#define APPLY_RESULT_SIZE (TARGET_ARCH64 ? 24 : 16) /* 1 if N is a possible register number for function argument passing. On SPARC, these are the "output" registers. v9 also uses %f0-%f31. */ @@ -1795,13 +1549,6 @@ init_cumulative_args (& (CUM), (FNTYPE), (LIBNAME), (FNDECL)); #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ function_arg_advance (& (CUM), (MODE), (TYPE), (NAMED)) -/* Nonzero if we do not know how to pass TYPE solely in registers. */ - -#define MUST_PASS_IN_STACK(MODE,TYPE) \ - ((TYPE) != 0 \ - && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ - || TREE_ADDRESSABLE (TYPE))) - /* Determine where to put an argument to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. @@ -1824,22 +1571,6 @@ function_arg (& (CUM), (MODE), (TYPE), (NAMED), 0) #define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (& (CUM), (MODE), (TYPE), (NAMED), 1) -/* For an arg passed partly in registers and partly in memory, - this is the number of registers used. - For args passed entirely in registers or entirely in memory, zero. */ - -#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ -function_arg_partial_nregs (& (CUM), (MODE), (TYPE), (NAMED)) - -/* A C expression that indicates when an argument must be passed by reference. - If nonzero for an argument, a copy of that argument is made in memory and a - pointer to the argument is passed instead of the argument itself. - The pointer is passed in whatever way is appropriate for passing a pointer - to that type. */ - -#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ -function_arg_pass_by_reference (& (CUM), (MODE), (TYPE), (NAMED)) - /* If defined, a C expression which determines whether, and in which direction, to pad out an argument with extra space. The value should be of type `enum direction': either `upward' to pad above the argument, @@ -1865,6 +1596,7 @@ function_arg_padding ((MODE), (TYPE)) extern GTY(()) rtx sparc_compare_op0; extern GTY(()) rtx sparc_compare_op1; +extern GTY(()) rtx sparc_compare_emitted; /* Generate the special assembly code needed to tell the assembler whatever @@ -1934,15 +1666,9 @@ do { \ (get_frame_size () != 0 \ || current_function_calls_alloca || current_function_outgoing_args_size) -#define DELAY_SLOTS_FOR_EPILOGUE \ - (TARGET_FLAT ? sparc_flat_epilogue_delay_slots () : 1) -#define ELIGIBLE_FOR_EPILOGUE_DELAY(trial, slots_filled) \ - (TARGET_FLAT ? sparc_flat_eligible_for_epilogue_delay (trial, slots_filled) \ - : eligible_for_epilogue_delay (trial, slots_filled)) - /* Define registers used by the epilogue and return instruction. */ -#define EPILOGUE_USES(REGNO) \ - (!TARGET_FLAT && REGNO == 31) +#define EPILOGUE_USES(REGNO) ((REGNO) == 31 \ + || (current_function_calls_eh_return && (REGNO) == 1)) /* Length in units of the trampoline for entering a nested function. */ @@ -1960,31 +1686,10 @@ do { \ else \ sparc_initialize_trampoline (TRAMP, FNADDR, CXT) -/* Generate necessary RTL for __builtin_saveregs(). */ - -#define EXPAND_BUILTIN_SAVEREGS() sparc_builtin_saveregs () - /* Implement `va_start' for varargs and stdarg. */ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \ sparc_va_start (valist, nextarg) -/* Implement `va_arg'. */ -#define EXPAND_BUILTIN_VA_ARG(valist, type) \ - sparc_va_arg (valist, type) - -/* Define this macro if the location where a function argument is passed - depends on whether or not it is a named argument. - - This macro controls how the NAMED argument to FUNCTION_ARG - is set for varargs and stdarg functions. With this macro defined, - the NAMED argument is always true for named arguments, and false for - unnamed arguments. If this is not defined, but SETUP_INCOMING_VARARGS - is defined, then all arguments are treated as named. Otherwise, all named - arguments except the last are treated as named. - For the v9 we want NAMED to mean what it says it means. */ - -#define STRICT_ARGUMENT_NAMING TARGET_V9 - /* Generate RTL to flush the register windows so as to make arbitrary frames available. */ #define SETUP_FRAME_ADDRESSES() \ @@ -1992,11 +1697,14 @@ do { \ /* Given an rtx for the address of a frame, return an rtx for the address of the word in the frame - that holds the dynamic chain--the previous frame's address. - ??? -mflat support? */ + that holds the dynamic chain--the previous frame's address. */ #define DYNAMIC_CHAIN_ADDRESS(frame) \ plus_constant (frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS) +/* Given an rtx for the frame pointer, + return an rtx for the address of the frame. */ +#define FRAME_ADDR_RTX(frame) plus_constant (frame, SPARC_STACK_BIAS) + /* The return address isn't on the stack, it is in a register, so we can't access it from the current frame pointer. We can access it from the previous frame pointer though by reading a value from the register window @@ -2168,7 +1876,9 @@ do { \ integer register, needed for ldd/std instructions. 'W' handles the memory operand when moving operands in/out - of 'e' constraint floating point registers. */ + of 'e' constraint floating point registers. + + 'Y' handles the zero vector constant. */ #ifndef REG_OK_STRICT @@ -2353,12 +2063,6 @@ do { \ (! TARGET_PTR64 ? SImode : flag_pic ? DImode : TARGET_CM_MEDLOW ? SImode : DImode) #endif -/* Define as C expression which evaluates to nonzero if the tablejump - instruction expects the table to contain offsets from the address of the - table. - Do not define this if the table should contain absolute addresses. */ -/* #define CASE_VECTOR_PC_RELATIVE 1 */ - /* Define this as 1 if `char' should by default be signed; else as 0. */ #define DEFAULT_SIGNED_CHAR 1 @@ -2366,15 +2070,10 @@ do { \ in one reasonably fast instruction. */ #define MOVE_MAX 8 -#if 0 /* Sun 4 has matherr, so this is no good. */ -/* This is the value of the error code EDOM for this machine, - used by the sqrt instruction. */ -#define TARGET_EDOM 33 +/* If a memory-to-memory move would take MOVE_RATIO or more simple + move-instruction pairs, we will do a movmem or libcall instead. */ -/* This is how to refer to the variable errno. */ -#define GEN_ERRNO_RTX \ - gen_rtx_MEM (SImode, gen_rtx_SYMBOL_REF (Pmode, "errno")) -#endif /* 0 */ +#define MOVE_RATIO (optimize_size ? 3 : 8) /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ @@ -2383,7 +2082,7 @@ do { \ /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD will either zero-extend or sign-extend. The value of this macro should be the code that says which one of the two operations is implicitly - done, NIL if none. */ + done, UNKNOWN if none. */ #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND /* Nonzero if access to memory by bytes is slow and undesirable. @@ -2392,9 +2091,6 @@ do { \ and maybe make use of that. */ #define SLOW_BYTE_ACCESS 1 -/* When a prototype says `char' or `short', really pass an `int'. */ -#define PROMOTE_PROTOTYPES (TARGET_ARCH32) - /* Define this to be nonzero if shift instructions ignore all but the low-order few bits. */ #define SHIFT_COUNT_TRUNCATED 1 @@ -2406,9 +2102,6 @@ do { \ /* Specify the machine mode used for addresses. */ #define Pmode (TARGET_ARCH64 ? DImode : SImode) -/* Generate calls to memcpy, memcmp and memset. */ -#define TARGET_MEM_FUNCTIONS - /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point, CCFP[E]mode is used. CC_NOOVmode should be used when the first operand @@ -2457,7 +2150,8 @@ do { \ || (GENERAL_OR_I64 (CLASS1) && FP_REG_CLASS_P (CLASS2)) \ || (CLASS1) == FPCC_REGS || (CLASS2) == FPCC_REGS) \ ? ((sparc_cpu == PROCESSOR_ULTRASPARC \ - || sparc_cpu == PROCESSOR_ULTRASPARC3) ? 12 : 6) : 2) + || sparc_cpu == PROCESSOR_ULTRASPARC3 \ + || sparc_cpu == PROCESSOR_NIAGARA) ? 12 : 6) : 2) /* Provide the cost of a branch. For pre-v9 processors we use a value of 3 to take into account the potential annulling of @@ -2467,22 +2161,30 @@ do { \ On v9 and later, which have branch prediction facilities, we set it to the depth of the pipeline as that is the cost of a - mispredicted branch. */ + mispredicted branch. + + On Niagara, normal branches insert 3 bubbles into the pipe + and annulled branches insert 4 bubbles. */ #define BRANCH_COST \ ((sparc_cpu == PROCESSOR_V9 \ || sparc_cpu == PROCESSOR_ULTRASPARC) \ ? 7 \ : (sparc_cpu == PROCESSOR_ULTRASPARC3 \ - ? 9 : 3)) + ? 9 \ + : (sparc_cpu == PROCESSOR_NIAGARA \ + ? 4 \ + : 3))) #define PREFETCH_BLOCK \ ((sparc_cpu == PROCESSOR_ULTRASPARC \ - || sparc_cpu == PROCESSOR_ULTRASPARC3) \ + || sparc_cpu == PROCESSOR_ULTRASPARC3 \ + || sparc_cpu == PROCESSOR_NIAGARA) \ ? 64 : 32) #define SIMULTANEOUS_PREFETCHES \ - ((sparc_cpu == PROCESSOR_ULTRASPARC) \ + ((sparc_cpu == PROCESSOR_ULTRASPARC \ + || sparc_cpu == PROCESSOR_NIAGARA) \ ? 2 \ : (sparc_cpu == PROCESSOR_ULTRASPARC3 \ ? 8 : 3)) @@ -2505,12 +2207,6 @@ do { \ #define ASM_APP_OFF "" -/* ??? Try to make the style consistent here (_OP?). */ - -#define ASM_FLOAT ".single" -#define ASM_DOUBLE ".double" -#define ASM_LONGDOUBLE ".xxx" /* ??? Not known (or used yet). */ - /* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */ @@ -2666,16 +2362,25 @@ do { \ #define ASM_OUTPUT_IDENT(FILE, NAME) \ fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME); -/* Emit a dtp-relative reference to a TLS variable. */ +/* Prettify the assembly. */ -#ifdef HAVE_AS_TLS -#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ - sparc_output_dwarf_dtprel (FILE, SIZE, X) -#endif +extern int sparc_indent_opcode; + +#define ASM_OUTPUT_OPCODE(FILE, PTR) \ + do { \ + if (sparc_indent_opcode) \ + { \ + putc (' ', FILE); \ + sparc_indent_opcode = 0; \ + } \ + } while (0) + +#define SPARC_SYMBOL_REF_TLS_P(RTX) \ + (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0) #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ - ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^' \ - || (CHAR) == '(' || (CHAR) == '_' || (CHAR) == '&') + ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '(' \ + || (CHAR) == ')' || (CHAR) == '_' || (CHAR) == '&') /* Print operand X (an rtx) in assembler syntax to file FILE. CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. @@ -2701,10 +2406,9 @@ do { \ base = XEXP (addr, 0), index = XEXP (addr, 1); \ if (GET_CODE (base) == LO_SUM) \ { \ - if (! USE_AS_OFFSETABLE_LO10 \ - || TARGET_ARCH32 \ - || TARGET_CM_MEDMID) \ - abort (); \ + gcc_assert (USE_AS_OFFSETABLE_LO10 \ + && TARGET_ARCH64 \ + && ! TARGET_CM_MEDMID); \ output_operand (XEXP (base, 0), 0); \ fputs ("+%lo(", FILE); \ output_address (XEXP (base, 1)); \ @@ -2720,7 +2424,7 @@ do { \ else if (GET_CODE (index) == SYMBOL_REF \ || GET_CODE (index) == CONST) \ fputc ('+', FILE), output_addr_const (FILE, index); \ - else abort (); \ + else gcc_unreachable (); \ } \ } \ else if (GET_CODE (addr) == MINUS \ @@ -2762,69 +2466,16 @@ do { \ } \ } +/* TLS support defaulting to original Sun flavor. GNU extensions + must be activated in separate configuration files. */ #ifdef HAVE_AS_TLS #define TARGET_TLS 1 #else #define TARGET_TLS 0 #endif + #define TARGET_SUN_TLS TARGET_TLS #define TARGET_GNU_TLS 0 -/* Define the codes that are matched by predicates in sparc.c. */ - -#define PREDICATE_CODES \ -{"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"const1_operand", {CONST_INT}}, \ -{"fp_zero_operand", {CONST_DOUBLE}}, \ -{"fp_register_operand", {SUBREG, REG}}, \ -{"intreg_operand", {SUBREG, REG}}, \ -{"fcc_reg_operand", {REG}}, \ -{"fcc0_reg_operand", {REG}}, \ -{"icc_or_fcc_reg_operand", {REG}}, \ -{"restore_operand", {REG}}, \ -{"call_operand", {MEM}}, \ -{"call_operand_address", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE, \ - ADDRESSOF, SUBREG, REG, PLUS, LO_SUM, CONST_INT}}, \ -{"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ -{"symbolic_memory_operand", {SUBREG, MEM}}, \ -{"label_ref_operand", {LABEL_REF}}, \ -{"sp64_medium_pic_operand", {CONST}}, \ -{"data_segment_operand", {SYMBOL_REF, PLUS, CONST}}, \ -{"text_segment_operand", {LABEL_REF, SYMBOL_REF, PLUS, CONST}}, \ -{"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \ -{"splittable_symbolic_memory_operand", {MEM}}, \ -{"splittable_immediate_memory_operand", {MEM}}, \ -{"eq_or_neq", {EQ, NE}}, \ -{"normal_comp_operator", {GE, GT, LE, LT, GTU, LEU}}, \ -{"noov_compare_op", {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU}}, \ -{"noov_compare64_op", {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU}}, \ -{"v9_regcmp_op", {EQ, NE, GE, LT, LE, GT}}, \ -{"extend_op", {SIGN_EXTEND, ZERO_EXTEND}}, \ -{"cc_arithop", {AND, IOR, XOR}}, \ -{"cc_arithopn", {AND, IOR}}, \ -{"arith_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith_add_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith11_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith10_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith_double_add_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith11_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith10_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"small_int", {CONST_INT}}, \ -{"small_int_or_double", {CONST_INT, CONST_DOUBLE}}, \ -{"uns_small_int", {CONST_INT}}, \ -{"uns_arith_operand", {SUBREG, REG, CONST_INT}}, \ -{"clobbered_register", {REG}}, \ -{"input_operand", {SUBREG, REG, CONST_INT, MEM, CONST}}, \ -{"compare_operand", {SUBREG, REG, ZERO_EXTRACT}}, \ -{"const64_operand", {CONST_INT, CONST_DOUBLE}}, \ -{"const64_high_operand", {CONST_INT, CONST_DOUBLE}}, \ -{"tgd_symbolic_operand", {SYMBOL_REF}}, \ -{"tld_symbolic_operand", {SYMBOL_REF}}, \ -{"tie_symbolic_operand", {SYMBOL_REF}}, \ -{"tle_symbolic_operand", {SYMBOL_REF}}, - /* The number of Pmode words for the setjmp buffer. */ #define JMP_BUF_SIZE 12 - -#define DONT_ACCESS_GBLS_AFTER_EPILOGUE (flag_pic) diff --git a/contrib/gcc/config/sparc/sparc.md b/contrib/gcc/config/sparc/sparc.md index b50d10a5a57..ed68f1e8a1e 100644 --- a/contrib/gcc/config/sparc/sparc.md +++ b/contrib/gcc/config/sparc/sparc.md @@ -1,6 +1,6 @@ ;; Machine description for SPARC chip for GCC ;; Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -;; 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005,2006 Free Software Foundation, Inc. ;; Contributed by Michael Tiemann (tiemann@cygnus.com) ;; 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, ;; at Cygnus Support. @@ -19,15 +19,15 @@ ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. (define_constants [(UNSPEC_MOVE_PIC 0) (UNSPEC_UPDATE_RETURN 1) - (UNSPEC_GET_PC 2) + (UNSPEC_LOAD_PCREL_SYM 2) (UNSPEC_MOVE_PIC_LABEL 5) (UNSPEC_SETH44 6) (UNSPEC_SETM44 7) @@ -45,15 +45,34 @@ (UNSPEC_TLSIE 33) (UNSPEC_TLSLE 34) (UNSPEC_TLSLD_BASE 35) + + (UNSPEC_FPACK16 40) + (UNSPEC_FPACK32 41) + (UNSPEC_FPACKFIX 42) + (UNSPEC_FEXPAND 43) + (UNSPEC_FPMERGE 44) + (UNSPEC_MUL16AL 45) + (UNSPEC_MUL8UL 46) + (UNSPEC_MULDUL 47) + (UNSPEC_ALIGNDATA 48) + (UNSPEC_ALIGNADDR 49) + (UNSPEC_PDIST 50) + + (UNSPEC_SP_SET 60) + (UNSPEC_SP_TEST 61) ]) (define_constants [(UNSPECV_BLOCKAGE 0) (UNSPECV_FLUSHW 1) (UNSPECV_GOTO 2) - (UNSPECV_GOTO_V9 3) (UNSPECV_FLUSH 4) (UNSPECV_SETJMP 5) + (UNSPECV_SAVEW 6) + (UNSPECV_MEMBAR 7) + (UNSPECV_CAS 8) + (UNSPECV_SWAP 9) + (UNSPECV_LDSTUB 10) ]) ;; The upper 32 fp regs on the v9 can't hold SFmode values. To deal with this @@ -62,6 +81,7 @@ ;; constraint letter is 'e'. To avoid any confusion, 'e' is used instead of ;; 'f' for all DF/TFmode values, including those that are specific to the v8. + ;; Attribute for cpu type. ;; These must match the values for enum processor_type in sparc.h. (define_attr "cpu" @@ -74,31 +94,25 @@ sparclet,tsc701, v9, ultrasparc, - ultrasparc3" + ultrasparc3, + niagara" (const (symbol_ref "sparc_cpu_attr"))) ;; Attribute for the instruction set. ;; At present we only need to distinguish v9/!v9, but for clarity we ;; test TARGET_V8 too. -(define_attr "isa" "v6,v8,v9,sparclet" +(define_attr "isa" "v7,v8,v9,sparclet" (const (cond [(symbol_ref "TARGET_V9") (const_string "v9") (symbol_ref "TARGET_V8") (const_string "v8") (symbol_ref "TARGET_SPARCLET") (const_string "sparclet")] - (const_string "v6")))) - -;; Architecture size. -(define_attr "arch" "arch32bit,arch64bit" - (const - (cond [(symbol_ref "TARGET_ARCH64") (const_string "arch64bit")] - (const_string "arch32bit")))) + (const_string "v7")))) ;; Insn type. - (define_attr "type" "ialu,compare,shift, load,sload,store, - uncond_branch,branch,call,sibcall,call_no_delay_slot, + uncond_branch,branch,call,sibcall,call_no_delay_slot,return, imul,idiv, fpload,fpstore, fp,fpmove, @@ -109,34 +123,49 @@ fga,fgm_pack,fgm_mul,fgm_pdist,fgm_cmp, cmove, ialuX, - multi,flushw,iflush,trap" + multi,savew,flushw,iflush,trap" (const_string "ialu")) -;; true if branch/call has empty delay slot and will emit a nop in it +;; True if branch/call has empty delay slot and will emit a nop in it (define_attr "empty_delay_slot" "false,true" (symbol_ref "empty_delay_slot (insn)")) -(define_attr "branch_type" "none,icc,fcc,reg" (const_string "none")) +(define_attr "branch_type" "none,icc,fcc,reg" + (const_string "none")) (define_attr "pic" "false,true" (symbol_ref "flag_pic != 0")) -(define_attr "current_function_calls_alloca" "false,true" +(define_attr "calls_alloca" "false,true" (symbol_ref "current_function_calls_alloca != 0")) -(define_attr "flat" "false,true" - (symbol_ref "TARGET_FLAT != 0")) +(define_attr "calls_eh_return" "false,true" + (symbol_ref "current_function_calls_eh_return !=0 ")) + +(define_attr "leaf_function" "false,true" + (symbol_ref "current_function_uses_only_leaf_regs != 0")) + +(define_attr "delayed_branch" "false,true" + (symbol_ref "flag_delayed_branch != 0")) ;; Length (in # of insns). ;; Beware that setting a length greater or equal to 3 for conditional branches ;; has a side-effect (see output_cbranch and output_v9branch). (define_attr "length" "" - (cond [(eq_attr "type" "uncond_branch,call,sibcall") + (cond [(eq_attr "type" "uncond_branch,call") (if_then_else (eq_attr "empty_delay_slot" "true") (const_int 2) (const_int 1)) + (eq_attr "type" "sibcall") + (if_then_else (eq_attr "leaf_function" "true") + (if_then_else (eq_attr "empty_delay_slot" "true") + (const_int 3) + (const_int 2)) + (if_then_else (eq_attr "empty_delay_slot" "true") + (const_int 2) + (const_int 1))) (eq_attr "branch_type" "icc") - (if_then_else (match_operand 0 "noov_compare64_op" "") + (if_then_else (match_operand 0 "noov_compare64_operator" "") (if_then_else (lt (pc) (match_dup 1)) (if_then_else (lt (minus (match_dup 1) (pc)) (const_int 260000)) (if_then_else (eq_attr "empty_delay_slot" "true") @@ -156,7 +185,7 @@ (const_int 2) (const_int 1))) (eq_attr "branch_type" "fcc") - (if_then_else (match_operand 0 "fcc0_reg_operand" "") + (if_then_else (match_operand 0 "fcc0_register_operand" "") (if_then_else (eq_attr "empty_delay_slot" "true") (if_then_else (eq (symbol_ref "TARGET_V9") (const_int 0)) (const_int 3) @@ -198,17 +227,18 @@ ] (const_int 1))) ;; FP precision. -(define_attr "fptype" "single,double" (const_string "single")) +(define_attr "fptype" "single,double" + (const_string "single")) ;; UltraSPARC-III integer load type. -(define_attr "us3load_type" "2cycle,3cycle" (const_string "2cycle")) +(define_attr "us3load_type" "2cycle,3cycle" + (const_string "2cycle")) (define_asm_attributes [(set_attr "length" "2") (set_attr "type" "multi")]) ;; Attributes for instruction and branch scheduling - (define_attr "tls_call_delay" "false,true" (symbol_ref "tls_call_delay (insn)")) @@ -224,19 +254,13 @@ (const_string "true") (const_string "false")))) -(define_delay (eq_attr "type" "call") - [(eq_attr "in_call_delay" "true") (nil) (nil)]) - (define_attr "eligible_for_sibcall_delay" "false,true" (symbol_ref "eligible_for_sibcall_delay (insn)")) -(define_delay (eq_attr "type" "sibcall") - [(eq_attr "eligible_for_sibcall_delay" "true") (nil) (nil)]) +(define_attr "eligible_for_return_delay" "false,true" + (symbol_ref "eligible_for_return_delay (insn)")) -(define_attr "leaf_function" "false,true" - (const (symbol_ref "current_function_uses_only_leaf_regs"))) - -;; ??? Should implement the notion of predelay slots for floating point +;; ??? !v9: Should implement the notion of predelay slots for floating-point ;; branches. This would allow us to remove the nop always inserted before ;; a floating point branch. @@ -266,6 +290,12 @@ (const_string "true") (const_string "false"))) +(define_delay (eq_attr "type" "call") + [(eq_attr "in_call_delay" "true") (nil) (nil)]) + +(define_delay (eq_attr "type" "sibcall") + [(eq_attr "eligible_for_sibcall_delay" "true") (nil) (nil)]) + (define_delay (eq_attr "type" "branch") [(eq_attr "in_branch_delay" "true") (nil) (eq_attr "in_annul_branch_delay" "true")]) @@ -273,7 +303,11 @@ (define_delay (eq_attr "type" "uncond_branch") [(eq_attr "in_uncond_branch_delay" "true") (nil) (nil)]) - + +(define_delay (eq_attr "type" "return") + [(eq_attr "eligible_for_return_delay" "true") (nil) (nil)]) + + ;; Include SPARC DFA schedulers (include "cypress.md") @@ -282,10 +316,15 @@ (include "sparclet.md") (include "ultra1_2.md") (include "ultra3.md") +(include "niagara.md") + + +;; Operand and operator predicates. + +(include "predicates.md") + - ;; Compare instructions. -;; This controls RTL generation and register allocation. ;; We generate RTL for comparisons and branches by having the cmpxx ;; patterns store away the operands. Then, the scc and bcc patterns @@ -300,8 +339,6 @@ ;; the patterns. Finally, we have the DEFINE_SPLITs for some of the scc ;; insns that actually require more than one machine instruction. -;; Put cmpsi first among compare insns so it matches two CONST_INT operands. - (define_expand "cmpsi" [(set (reg:CC 100) (compare:CC (match_operand:SI 0 "compare_operand" "") @@ -319,7 +356,7 @@ (define_expand "cmpdi" [(set (reg:CCX 100) (compare:CCX (match_operand:DI 0 "compare_operand" "") - (match_operand:DI 1 "arith_double_operand" "")))] + (match_operand:DI 1 "arith_operand" "")))] "TARGET_ARCH64" { if (GET_CODE (operands[0]) == ZERO_EXTRACT && operands[1] != const0_rtx) @@ -379,13 +416,13 @@ (define_insn "*cmpdi_sp64" [(set (reg:CCX 100) (compare:CCX (match_operand:DI 0 "register_operand" "r") - (match_operand:DI 1 "arith_double_operand" "rHI")))] + (match_operand:DI 1 "arith_operand" "rI")))] "TARGET_ARCH64" "cmp\t%0, %1" [(set_attr "type" "compare")]) (define_insn "*cmpsf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:SF 1 "register_operand" "f") (match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" @@ -397,7 +434,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpdf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" @@ -410,7 +447,7 @@ (set_attr "fptype" "double")]) (define_insn "*cmptf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" @@ -422,7 +459,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpsf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:SF 1 "register_operand" "f") (match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" @@ -434,7 +471,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpdf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" @@ -447,7 +484,7 @@ (set_attr "fptype" "double")]) (define_insn "*cmptf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" @@ -547,7 +584,7 @@ ;; ??? v9: Operand 0 needs a mode, so SImode was chosen. ;; However, the code handles both SImode and DImode. (define_expand "seq" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (eq:SI (match_dup 1) (const_int 0)))] "" { @@ -599,7 +636,7 @@ ;; ??? v9: Operand 0 needs a mode, so SImode was chosen. ;; However, the code handles both SImode and DImode. (define_expand "sne" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ne:SI (match_dup 1) (const_int 0)))] "" { @@ -649,7 +686,7 @@ }) (define_expand "sgt" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (gt:SI (match_dup 1) (const_int 0)))] "" { @@ -669,7 +706,7 @@ }) (define_expand "slt" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (lt:SI (match_dup 1) (const_int 0)))] "" { @@ -689,7 +726,7 @@ }) (define_expand "sge" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ge:SI (match_dup 1) (const_int 0)))] "" { @@ -709,7 +746,7 @@ }) (define_expand "sle" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (le:SI (match_dup 1) (const_int 0)))] "" { @@ -729,7 +766,7 @@ }) (define_expand "sgtu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (gtu:SI (match_dup 1) (const_int 0)))] "" { @@ -763,7 +800,7 @@ }) (define_expand "sltu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ltu:SI (match_dup 1) (const_int 0)))] "" { @@ -772,11 +809,11 @@ if (gen_v9_scc (LTU, operands)) DONE; } - operands[1] = gen_compare_reg (LTU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LTU); }) (define_expand "sgeu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (geu:SI (match_dup 1) (const_int 0)))] "" { @@ -785,11 +822,11 @@ if (gen_v9_scc (GEU, operands)) DONE; } - operands[1] = gen_compare_reg (GEU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (GEU); }) (define_expand "sleu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (leu:SI (match_dup 1) (const_int 0)))] "" { @@ -826,7 +863,7 @@ ;; The SEQ and SNE patterns are special because they can be done ;; without any branching and do not involve a COMPARE. We want -;; them to always use the splitz below so the results can be +;; them to always use the splits below so the results can be ;; scheduled. (define_insn_and_split "*snesi_zero" @@ -1160,7 +1197,7 @@ ;; ??? Combine should canonicalize these next two to the same pattern. (define_insn "*x_minus_y_minus_sltu" [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC 100) (const_int 0))))] "" @@ -1169,7 +1206,7 @@ (define_insn "*x_minus_sltu_plus_y" [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (plus:SI (ltu:SI (reg:CC 100) (const_int 0)) (match_operand:SI 2 "arith_operand" "rI"))))] "" @@ -1194,12 +1231,13 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") - (match_operator:SI 2 "noov_compare_op" - [(match_operand 1 "icc_or_fcc_reg_operand" "") + (match_operator:SI 2 "noov_compare_operator" + [(match_operand 1 "icc_or_fcc_register_operand" "") (const_int 0)]))] - ;; 32 bit LTU/GEU are better implemented using addx/subx - "TARGET_V9 && REGNO (operands[1]) == SPARC_ICC_REG + "TARGET_V9 + && REGNO (operands[1]) == SPARC_ICC_REG && (GET_MODE (operands[1]) == CCXmode + /* 32 bit LTU/GEU are better implemented using addx/subx. */ || (GET_CODE (operands[2]) != LTU && GET_CODE (operands[2]) != GEU))" [(set (match_dup 0) (const_int 0)) (set (match_dup 0) @@ -1235,7 +1273,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (EQ, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (EQ); }) (define_expand "bne" @@ -1258,7 +1296,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (NE, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (NE); }) (define_expand "bgt" @@ -1281,7 +1319,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (GT, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (GT); }) (define_expand "bgtu" @@ -1291,7 +1329,7 @@ (pc)))] "" { - operands[1] = gen_compare_reg (GTU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (GTU); }) (define_expand "blt" @@ -1314,7 +1352,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (LT, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LT); }) (define_expand "bltu" @@ -1324,7 +1362,7 @@ (pc)))] "" { - operands[1] = gen_compare_reg (LTU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LTU); }) (define_expand "bge" @@ -1347,7 +1385,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (GE); }) (define_expand "bgeu" @@ -1357,7 +1395,7 @@ (pc)))] "" { - operands[1] = gen_compare_reg (GEU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (GEU); }) (define_expand "ble" @@ -1380,7 +1418,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LE); }) (define_expand "bleu" @@ -1390,7 +1428,7 @@ (pc)))] "" { - operands[1] = gen_compare_reg (LEU, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LEU); }) (define_expand "bunordered" @@ -1407,8 +1445,7 @@ emit_jump_insn (gen_beq (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNORDERED, sparc_compare_op0, - sparc_compare_op1); + operands[1] = gen_compare_reg (UNORDERED); }) (define_expand "bordered" @@ -1424,8 +1461,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (ORDERED, sparc_compare_op0, - sparc_compare_op1); + operands[1] = gen_compare_reg (ORDERED); }) (define_expand "bungt" @@ -1441,7 +1477,7 @@ emit_jump_insn (gen_bgt (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNGT, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (UNGT); }) (define_expand "bunlt" @@ -1457,7 +1493,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNLT, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (UNLT); }) (define_expand "buneq" @@ -1473,7 +1509,7 @@ emit_jump_insn (gen_beq (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNEQ, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (UNEQ); }) (define_expand "bunge" @@ -1489,7 +1525,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNGE, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (UNGE); }) (define_expand "bunle" @@ -1505,7 +1541,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (UNLE, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (UNLE); }) (define_expand "bltgt" @@ -1521,7 +1557,7 @@ emit_jump_insn (gen_bne (operands[0])); DONE; } - operands[1] = gen_compare_reg (LTGT, sparc_compare_op0, sparc_compare_op1); + operands[1] = gen_compare_reg (LTGT); }) ;; Now match both normal and inverted jump. @@ -1529,7 +1565,7 @@ ;; XXX fpcmp nop braindamage (define_insn "*normal_branch" [(set (pc) - (if_then_else (match_operator 0 "noov_compare_op" + (if_then_else (match_operator 0 "noov_compare_operator" [(reg 100) (const_int 0)]) (label_ref (match_operand 1 "" "")) (pc)))] @@ -1537,7 +1573,7 @@ { return output_cbranch (operands[0], operands[1], 1, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "icc")]) @@ -1545,7 +1581,7 @@ ;; XXX fpcmp nop braindamage (define_insn "*inverted_branch" [(set (pc) - (if_then_else (match_operator 0 "noov_compare_op" + (if_then_else (match_operator 0 "noov_compare_operator" [(reg 100) (const_int 0)]) (pc) (label_ref (match_operand 1 "" ""))))] @@ -1553,7 +1589,7 @@ { return output_cbranch (operands[0], operands[1], 1, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "icc")]) @@ -1562,7 +1598,7 @@ (define_insn "*normal_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFP 0 "fcc_reg_operand" "c") + [(match_operand:CCFP 0 "fcc_register_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] @@ -1570,7 +1606,7 @@ { return output_cbranch (operands[1], operands[2], 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]) @@ -1579,7 +1615,7 @@ (define_insn "*inverted_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFP 0 "fcc_reg_operand" "c") + [(match_operand:CCFP 0 "fcc_register_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] @@ -1587,7 +1623,7 @@ { return output_cbranch (operands[1], operands[2], 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]) @@ -1596,7 +1632,7 @@ (define_insn "*normal_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFPE 0 "fcc_reg_operand" "c") + [(match_operand:CCFPE 0 "fcc_register_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] @@ -1604,7 +1640,7 @@ { return output_cbranch (operands[1], operands[2], 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]) @@ -1613,7 +1649,7 @@ (define_insn "*inverted_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFPE 0 "fcc_reg_operand" "c") + [(match_operand:CCFPE 0 "fcc_register_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] @@ -1621,7 +1657,7 @@ { return output_cbranch (operands[1], operands[2], 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]) @@ -1634,7 +1670,7 @@ ;; XXX (define_insn "*normal_int_branch_sp64" [(set (pc) - (if_then_else (match_operator 0 "v9_regcmp_op" + (if_then_else (match_operator 0 "v9_register_compare_operator" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (label_ref (match_operand 2 "" "")) @@ -1643,7 +1679,7 @@ { return output_v9branch (operands[0], operands[2], 1, 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "reg")]) @@ -1651,7 +1687,7 @@ ;; XXX (define_insn "*inverted_int_branch_sp64" [(set (pc) - (if_then_else (match_operator 0 "v9_regcmp_op" + (if_then_else (match_operator 0 "v9_register_compare_operator" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (pc) @@ -1660,84 +1696,53 @@ { return output_v9branch (operands[0], operands[2], 1, 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), - ! final_sequence, insn); + insn); } [(set_attr "type" "branch") (set_attr "branch_type" "reg")]) - -;; Load program counter insns. -(define_insn "get_pc" - [(clobber (reg:SI 15)) - (set (match_operand 0 "register_operand" "=r") - (unspec [(match_operand 1 "" "") (match_operand 2 "" "")] UNSPEC_GET_PC))] - "flag_pic && REGNO (operands[0]) == 23" - "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\tadd\t%0, %%lo(%a1+4), %0" - [(set_attr "type" "multi") - (set_attr "length" "3")]) - -;; Move instructions +(define_mode_macro P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) + +;; Load in operand 0 the (absolute) address of operand 1, which is a symbolic +;; value subject to a PC-relative relocation. Operand 2 is a helper function +;; that adds the PC value at the call point to operand 0. + +(define_insn "load_pcrel_sym" + [(set (match_operand:P 0 "register_operand" "=r") + (unspec:P [(match_operand:P 1 "symbolic_operand" "") + (match_operand:P 2 "call_address_operand" "")] UNSPEC_LOAD_PCREL_SYM)) + (clobber (reg:P 15))] + "" +{ + if (flag_delayed_branch) + return "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\t add\t%0, %%lo(%a1+4), %0"; + else + return "sethi\t%%hi(%a1-8), %0\n\tadd\t%0, %%lo(%a1-4), %0\n\tcall\t%a2\n\t nop"; +} + [(set (attr "type") (const_string "multi")) + (set (attr "length") + (if_then_else (eq_attr "delayed_branch" "true") + (const_int 3) + (const_int 4)))]) + + +;; Integer move instructions (define_expand "movqi" - [(set (match_operand:QI 0 "general_operand" "") + [(set (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "general_operand" ""))] "" { - /* Working with CONST_INTs is easier, so convert - a double if needed. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - operands[1] = GEN_INT (trunc_int_for_mode - (CONST_DOUBLE_LOW (operands[1]), QImode)); - } - - /* Handle sets of MEM first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (reg_or_0_operand (operands[1], QImode)) - goto movqi_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (QImode, operands[1]); - } - } - - /* Fixup TLS cases. */ - if (tls_symbolic_operand (operands [1])) - operands[1] = legitimize_tls_address (operands[1]); - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], QImode, 0); - - if (symbolic_operand (operands[1], QImode)) - { - operands[1] = legitimize_pic_address (operands[1], - QImode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - goto movqi_is_ok; - } - } - - /* All QI constants require only one insn, so proceed. */ - - movqi_is_ok: - ; + if (sparc_expand_move (QImode, operands)) + DONE; }) (define_insn "*movqi_insn" [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m") (match_operand:QI 1 "input_operand" "rI,m,rJ"))] "(register_operand (operands[0], QImode) - || reg_or_0_operand (operands[1], QImode))" + || register_or_zero_operand (operands[1], QImode))" "@ mov\t%1, %0 ldub\t%1, %0 @@ -1746,75 +1751,19 @@ (set_attr "us3load_type" "*,3cycle,*")]) (define_expand "movhi" - [(set (match_operand:HI 0 "general_operand" "") + [(set (match_operand:HI 0 "nonimmediate_operand" "") (match_operand:HI 1 "general_operand" ""))] "" { - /* Working with CONST_INTs is easier, so convert - a double if needed. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - - /* Handle sets of MEM first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (reg_or_0_operand (operands[1], HImode)) - goto movhi_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (HImode, operands[1]); - } - } - - /* Fixup TLS cases. */ - if (tls_symbolic_operand (operands [1])) - operands[1] = legitimize_tls_address (operands[1]); - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], HImode, 0); - - if (symbolic_operand (operands[1], HImode)) - { - operands[1] = legitimize_pic_address (operands[1], - HImode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - goto movhi_is_ok; - } - } - - /* This makes sure we will not get rematched due to splittage. */ - if (! CONSTANT_P (operands[1]) || input_operand (operands[1], HImode)) - ; - else if (CONSTANT_P (operands[1]) - && GET_CODE (operands[1]) != HIGH - && GET_CODE (operands[1]) != LO_SUM) - { - sparc_emit_set_const32 (operands[0], operands[1]); - DONE; - } - movhi_is_ok: - ; + if (sparc_expand_move (HImode, operands)) + DONE; }) -(define_insn "*movhi_const64_special" - [(set (match_operand:HI 0 "register_operand" "=r") - (match_operand:HI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") - (define_insn "*movhi_insn" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m") (match_operand:HI 1 "input_operand" "rI,K,m,rJ"))] "(register_operand (operands[0], HImode) - || reg_or_0_operand (operands[1], HImode))" + || register_or_zero_operand (operands[1], HImode))" "@ mov\t%1, %0 sethi\t%%hi(%a1), %0 @@ -1827,109 +1776,34 @@ (define_insn "*movhi_lo_sum" [(set (match_operand:HI 0 "register_operand" "=r") (ior:HI (match_operand:HI 1 "register_operand" "%r") - (match_operand:HI 2 "small_int" "I")))] + (match_operand:HI 2 "small_int_operand" "I")))] "" "or\t%1, %2, %0") (define_expand "movsi" - [(set (match_operand:SI 0 "general_operand" "") + [(set (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "general_operand" ""))] "" { - /* Working with CONST_INTs is easier, so convert - a double if needed. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - - /* Handle sets of MEM first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (reg_or_0_operand (operands[1], SImode)) - goto movsi_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (SImode, operands[1]); - } - } - - /* Fixup TLS cases. */ - if (tls_symbolic_operand (operands [1])) - operands[1] = legitimize_tls_address (operands[1]); - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], SImode, 0); - - if (GET_CODE (operands[1]) == LABEL_REF) - { - /* shit */ - emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1])); - DONE; - } - - if (symbolic_operand (operands[1], SImode)) - { - operands[1] = legitimize_pic_address (operands[1], - SImode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - goto movsi_is_ok; - } - } - - /* If we are trying to toss an integer constant into the - FPU registers, force it into memory. */ - if (GET_CODE (operands[0]) == REG - && REGNO (operands[0]) >= SPARC_FIRST_FP_REG - && REGNO (operands[0]) <= SPARC_LAST_V9_FP_REG - && CONSTANT_P (operands[1])) - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - - /* This makes sure we will not get rematched due to splittage. */ - if (! CONSTANT_P (operands[1]) || input_operand (operands[1], SImode)) - ; - else if (CONSTANT_P (operands[1]) - && GET_CODE (operands[1]) != HIGH - && GET_CODE (operands[1]) != LO_SUM) - { - sparc_emit_set_const32 (operands[0], operands[1]); - DONE; - } - movsi_is_ok: - ; + if (sparc_expand_move (SImode, operands)) + DONE; }) -;; This is needed to show CSE exactly which bits are set -;; in a 64-bit register by sethi instructions. -(define_insn "*movsi_const64_special" - [(set (match_operand:SI 0 "register_operand" "=r") - (match_operand:SI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") - (define_insn "*movsi_insn" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,f,r,r,r,f,m,m,d") - (match_operand:SI 1 "input_operand" "rI,!f,K,J,m,!m,rJ,!f,J"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,!f,!f,!m,d") + (match_operand:SI 1 "input_operand" "rI,K,m,rJ,f,m,f,J"))] "(register_operand (operands[0], SImode) - || reg_or_0_operand (operands[1], SImode))" + || register_or_zero_operand (operands[1], SImode))" "@ mov\t%1, %0 - fmovs\t%1, %0 sethi\t%%hi(%a1), %0 - clr\t%0 - ld\t%1, %0 ld\t%1, %0 st\t%r1, %0 + fmovs\t%1, %0 + ld\t%1, %0 st\t%1, %0 fzeros\t%0" - [(set_attr "type" "*,fpmove,*,*,load,fpload,store,fpstore,fga")]) + [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga")]) (define_insn "*movsi_lo_sum" [(set (match_operand:SI 0 "register_operand" "=r") @@ -2001,90 +1875,12 @@ "or\t%1, %%lo(%a3-(%a2-.)), %0") (define_expand "movdi" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "") + [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" ""))] "" { - /* Where possible, convert CONST_DOUBLE into a CONST_INT. */ - if (GET_CODE (operands[1]) == CONST_DOUBLE -#if HOST_BITS_PER_WIDE_INT == 32 - && ((CONST_DOUBLE_HIGH (operands[1]) == 0 - && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) == 0) - || (CONST_DOUBLE_HIGH (operands[1]) == (HOST_WIDE_INT) 0xffffffff - && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0)) -#endif - ) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - - /* Handle MEM cases first. */ - if (GET_CODE (operands[0]) == MEM) - { - /* If it's a REG, we can always do it. - The const zero case is more complex, on v9 - we can always perform it. */ - if (register_operand (operands[1], DImode) - || (TARGET_V9 - && (operands[1] == const0_rtx))) - goto movdi_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (DImode, operands[1]); - } - } - - /* Fixup TLS cases. */ - if (tls_symbolic_operand (operands [1])) - operands[1] = legitimize_tls_address (operands[1]); - - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], DImode, 0); - - if (GET_CODE (operands[1]) == LABEL_REF) - { - if (! TARGET_ARCH64) - abort (); - emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1])); - DONE; - } - - if (symbolic_operand (operands[1], DImode)) - { - operands[1] = legitimize_pic_address (operands[1], - DImode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - goto movdi_is_ok; - } - } - - /* If we are trying to toss an integer constant into the - FPU registers, force it into memory. */ - if (GET_CODE (operands[0]) == REG - && REGNO (operands[0]) >= SPARC_FIRST_FP_REG - && REGNO (operands[0]) <= SPARC_LAST_V9_FP_REG - && CONSTANT_P (operands[1])) - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - - /* This makes sure we will not get rematched due to splittage. */ - if (! CONSTANT_P (operands[1]) || input_operand (operands[1], DImode)) - ; - else if (TARGET_ARCH64 - && GET_CODE (operands[1]) != HIGH - && GET_CODE (operands[1]) != LO_SUM) - { - sparc_emit_set_const64 (operands[0], operands[1]); - DONE; - } - - movdi_is_ok: - ; + if (sparc_expand_move (DImode, operands)) + DONE; }) ;; Be careful, fmovd does not exist when !v9. @@ -2099,13 +1895,39 @@ ;; (reg:DI 2 %g2)) ;; +(define_insn "*movdi_insn_sp32" + [(set (match_operand:DI 0 "nonimmediate_operand" + "=o,T,U,o,r,r,r,?T,?f,?f,?o,?f") + (match_operand:DI 1 "input_operand" + " J,U,T,r,o,i,r, f, T, o, f, f"))] + "! TARGET_V9 + && (register_operand (operands[0], DImode) + || register_or_zero_operand (operands[1], DImode))" + "@ + # + std\t%1, %0 + ldd\t%1, %0 + # + # + # + # + std\t%1, %0 + ldd\t%1, %0 + # + # + #" + [(set_attr "type" "store,store,load,*,*,*,*,fpstore,fpload,*,*,*") + (set_attr "length" "2,*,*,2,2,2,2,*,*,2,2,2")]) + (define_insn "*movdi_insn_sp32_v9" [(set (match_operand:DI 0 "nonimmediate_operand" "=T,o,T,U,o,r,r,r,?T,?f,?f,?o,?e,?e,?W") (match_operand:DI 1 "input_operand" " J,J,U,T,r,o,i,r, f, T, o, f, e, W, e"))] - "! TARGET_ARCH64 && TARGET_V9 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + "! TARGET_ARCH64 + && TARGET_V9 + && (register_operand (operands[0], DImode) + || register_or_zero_operand (operands[1], DImode))" "@ stx\t%%g0, %0 # @@ -2126,82 +1948,23 @@ (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,*,*") (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*")]) -(define_insn "*movdi_insn_sp32" - [(set (match_operand:DI 0 "nonimmediate_operand" - "=o,T,U,o,r,r,r,?T,?f,?f,?o,?f") - (match_operand:DI 1 "input_operand" - " J,U,T,r,o,i,r, f, T, o, f, f"))] - "! TARGET_ARCH64 +(define_insn "*movdi_insn_sp64" + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,m,?e,?e,?W,b") + (match_operand:DI 1 "input_operand" "rI,N,m,rJ,e,W,e,J"))] + "TARGET_ARCH64 && (register_operand (operands[0], DImode) - || register_operand (operands[1], DImode))" - "@ - # - std\t%1, %0 - ldd\t%1, %0 - # - # - # - # - std\t%1, %0 - ldd\t%1, %0 - # - # - #" - [(set_attr "type" "store,store,load,*,*,*,*,fpstore,fpload,*,*,*") - (set_attr "length" "2,*,*,2,2,2,2,*,*,2,2,2")]) - -;; The following are generated by sparc_emit_set_const64 -(define_insn "*movdi_sp64_dbl" - [(set (match_operand:DI 0 "register_operand" "=r") - (match_operand:DI 1 "const64_operand" ""))] - "(TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64)" - "mov\t%1, %0") - -;; This is needed to show CSE exactly which bits are set -;; in a 64-bit register by sethi instructions. -(define_insn "*movdi_const64_special" - [(set (match_operand:DI 0 "register_operand" "=r") - (match_operand:DI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") - -(define_insn "*movdi_insn_sp64_novis" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,m,?e,?e,?W") - (match_operand:DI 1 "input_operand" "rI,N,J,m,rJ,e,W,e"))] - "TARGET_ARCH64 && ! TARGET_VIS - && (register_operand (operands[0], DImode) - || reg_or_0_operand (operands[1], DImode))" + || register_or_zero_operand (operands[1], DImode))" "@ mov\t%1, %0 sethi\t%%hi(%a1), %0 - clr\t%0 - ldx\t%1, %0 - stx\t%r1, %0 - fmovd\t%1, %0 - ldd\t%1, %0 - std\t%1, %0" - [(set_attr "type" "*,*,*,load,store,fpmove,fpload,fpstore") - (set_attr "fptype" "*,*,*,*,*,double,*,*")]) - -(define_insn "*movdi_insn_sp64_vis" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,m,?e,?e,?W,b") - (match_operand:DI 1 "input_operand" "rI,N,J,m,rJ,e,W,e,J"))] - "TARGET_ARCH64 && TARGET_VIS && - (register_operand (operands[0], DImode) - || reg_or_0_operand (operands[1], DImode))" - "@ - mov\t%1, %0 - sethi\t%%hi(%a1), %0 - clr\t%0 ldx\t%1, %0 stx\t%r1, %0 fmovd\t%1, %0 ldd\t%1, %0 std\t%1, %0 fzero\t%0" - [(set_attr "type" "*,*,*,load,store,fpmove,fpload,fpstore,fga") - (set_attr "fptype" "*,*,*,*,*,double,*,*,double")]) + [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga") + (set_attr "fptype" "*,*,*,*,double,*,*,double")]) (define_expand "movdi_pic_label_ref" [(set (match_dup 3) (high:DI @@ -2262,7 +2025,7 @@ (define_insn "*sethi_di_medlow_embmedany_pic" [(set (match_operand:DI 0 "register_operand" "=r") - (high:DI (match_operand:DI 1 "sp64_medium_pic_operand" "")))] + (high:DI (match_operand:DI 1 "medium_pic_operand" "")))] "(TARGET_CM_MEDLOW || TARGET_CM_EMBMEDANY) && check_pic (1)" "sethi\t%%hi(%a1), %0") @@ -2418,7 +2181,9 @@ /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ - if (low == high && (low & 0x3ff) != 0 && low + 0x1000 >= 0x2000) + if (low == high + && ! SPARC_SETHI32_P (high) + && ! SPARC_SIMM13_P (high)) emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); else @@ -2446,8 +2211,8 @@ /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ if (CONST_DOUBLE_LOW (operands[1]) == CONST_DOUBLE_HIGH (operands[1]) - && !(SPARC_SETHI32_P (CONST_DOUBLE_HIGH (operands[1])) - || SPARC_SIMM13_P (CONST_DOUBLE_HIGH (operands[1])))) + && ! SPARC_SETHI32_P (CONST_DOUBLE_HIGH (operands[1])) + && ! SPARC_SIMM13_P (CONST_DOUBLE_HIGH (operands[1]))) { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); @@ -2543,7 +2308,7 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") - (const_int 0))] + (match_operand:DI 1 "const_zero_operand" ""))] "reload_completed && (! TARGET_V9 || (! TARGET_ARCH64 @@ -2555,16 +2320,29 @@ emit_insn (gen_movsi (adjust_address (operands[0], SImode, 4), const0_rtx)); DONE; }) - -;; Floating point move insns -(define_insn "*movsf_insn_novis" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,*r,*r,*r,*r,*r,f,m,m") - (match_operand:SF 1 "input_operand" "f,G,Q,*rR,S,m,m,f,*rG"))] - "(TARGET_FPU && ! TARGET_VIS) - && (register_operand (operands[0], SFmode) - || register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode))" + +;; Floating point and vector move instructions + +;; We don't define V1SI because SI should work just fine. +(define_mode_macro V32 [SF V2HI V4QI]) + +;; Yes, you guessed it right, the former movsf expander. +(define_expand "mov" + [(set (match_operand:V32 0 "nonimmediate_operand" "") + (match_operand:V32 1 "general_operand" ""))] + "mode == SFmode || TARGET_VIS" +{ + if (sparc_expand_move (mode, operands)) + DONE; +}) + +(define_insn "*movsf_insn" + [(set (match_operand:V32 0 "nonimmediate_operand" "=d,f,*r,*r,*r,f,*r,m,m") + (match_operand:V32 1 "input_operand" "GY,f,*rRY,Q,S,m,m,f,*rGY"))] + "TARGET_FPU + && (register_operand (operands[0], mode) + || register_or_zero_operand (operands[1], mode))" { if (GET_CODE (operands[1]) == CONST_DOUBLE && (which_alternative == 2 @@ -2582,90 +2360,42 @@ switch (which_alternative) { case 0: - return "fmovs\t%1, %0"; - case 1: - return "clr\t%0"; - case 2: - return "sethi\t%%hi(%a1), %0"; - case 3: - return "mov\t%1, %0"; - case 4: - return "#"; - case 5: - case 6: - return "ld\t%1, %0"; - case 7: - case 8: - return "st\t%r1, %0"; - default: - abort(); - } -} - [(set_attr "type" "fpmove,*,*,*,*,load,fpload,fpstore,store")]) - -(define_insn "*movsf_insn_vis" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,*r,*r,*r,*r,*r,f,m,m") - (match_operand:SF 1 "input_operand" "f,G,G,Q,*rR,S,m,m,f,*rG"))] - "(TARGET_FPU && TARGET_VIS) - && (register_operand (operands[0], SFmode) - || register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode))" -{ - if (GET_CODE (operands[1]) == CONST_DOUBLE - && (which_alternative == 3 - || which_alternative == 4 - || which_alternative == 5)) - { - REAL_VALUE_TYPE r; - long i; - - REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]); - REAL_VALUE_TO_TARGET_SINGLE (r, i); - operands[1] = GEN_INT (i); - } - - switch (which_alternative) - { - case 0: - return "fmovs\t%1, %0"; - case 1: return "fzeros\t%0"; + case 1: + return "fmovs\t%1, %0"; case 2: - return "clr\t%0"; + return "mov\t%1, %0"; case 3: return "sethi\t%%hi(%a1), %0"; case 4: - return "mov\t%1, %0"; - case 5: return "#"; + case 5: case 6: - case 7: return "ld\t%1, %0"; + case 7: case 8: - case 9: return "st\t%r1, %0"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "fpmove,fga,*,*,*,*,load,fpload,fpstore,store")]) + [(set_attr "type" "fga,fpmove,*,*,*,fpload,load,fpstore,store")]) ;; Exactly the same as above, except that all `f' cases are deleted. ;; This is necessary to prevent reload from ever trying to use a `f' reg ;; when -mno-fpu. -(define_insn "*movsf_no_f_insn" - [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,r,m") - (match_operand:SF 1 "input_operand" "G,Q,rR,S,m,rG"))] +(define_insn "*movsf_insn_no_fpu" + [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,m") + (match_operand:SF 1 "input_operand" "rR,Q,S,m,rG"))] "! TARGET_FPU && (register_operand (operands[0], SFmode) - || register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode))" + || register_or_zero_operand (operands[1], SFmode))" { if (GET_CODE (operands[1]) == CONST_DOUBLE - && (which_alternative == 1 - || which_alternative == 2 - || which_alternative == 3)) + && (which_alternative == 0 + || which_alternative == 1 + || which_alternative == 2)) { REAL_VALUE_TYPE r; long i; @@ -2678,28 +2408,28 @@ switch (which_alternative) { case 0: - return "clr\t%0"; + return "mov\t%1, %0"; case 1: return "sethi\t%%hi(%a1), %0"; case 2: - return "mov\t%1, %0"; - case 3: return "#"; - case 4: + case 3: return "ld\t%1, %0"; - case 5: + case 4: return "st\t%r1, %0"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "*,*,*,*,load,store")]) + [(set_attr "type" "*,*,*,load,store")]) + +;; The following 3 patterns build SFmode constants in integer registers. (define_insn "*movsf_lo_sum" [(set (match_operand:SF 0 "register_operand" "=r") (lo_sum:SF (match_operand:SF 1 "register_operand" "r") - (match_operand:SF 2 "const_double_operand" "S")))] - "fp_high_losum_p (operands[2])" + (match_operand:SF 2 "fp_const_high_losum_operand" "S")))] + "" { REAL_VALUE_TYPE r; long i; @@ -2712,8 +2442,8 @@ (define_insn "*movsf_high" [(set (match_operand:SF 0 "register_operand" "=r") - (high:SF (match_operand:SF 1 "const_double_operand" "S")))] - "fp_high_losum_p (operands[1])" + (high:SF (match_operand:SF 1 "fp_const_high_losum_operand" "S")))] + "" { REAL_VALUE_TYPE r; long i; @@ -2726,136 +2456,21 @@ (define_split [(set (match_operand:SF 0 "register_operand" "") - (match_operand:SF 1 "const_double_operand" ""))] - "fp_high_losum_p (operands[1]) - && (GET_CODE (operands[0]) == REG - && REGNO (operands[0]) < 32)" + (match_operand:SF 1 "fp_const_high_losum_operand" ""))] + "REG_P (operands[0]) && REGNO (operands[0]) < 32" [(set (match_dup 0) (high:SF (match_dup 1))) (set (match_dup 0) (lo_sum:SF (match_dup 0) (match_dup 1)))]) -(define_expand "movsf" - [(set (match_operand:SF 0 "general_operand" "") - (match_operand:SF 1 "general_operand" ""))] - "" +(define_mode_macro V64 [DF V2SI V4HI V8QI]) + +;; Yes, you again guessed it right, the former movdf expander. +(define_expand "mov" + [(set (match_operand:V64 0 "nonimmediate_operand" "") + (match_operand:V64 1 "general_operand" ""))] + "mode == DFmode || TARGET_VIS" { - /* Force SFmode constants into memory. */ - if (GET_CODE (operands[0]) == REG - && CONSTANT_P (operands[1])) - { - /* emit_group_store will send such bogosity to us when it is - not storing directly into memory. So fix this up to avoid - crashes in output_constant_pool. */ - if (operands [1] == const0_rtx) - operands[1] = CONST0_RTX (SFmode); - - if (TARGET_VIS && fp_zero_operand (operands[1], SFmode)) - goto movsf_is_ok; - - /* We are able to build any SF constant in integer registers - with at most 2 instructions. */ - if (REGNO (operands[0]) < 32) - goto movsf_is_ok; - - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - } - - /* Handle sets of MEM first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode)) - goto movsf_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (SFmode, operands[1]); - } - } - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], SFmode, 0); - - if (symbolic_operand (operands[1], SFmode)) - { - operands[1] = legitimize_pic_address (operands[1], - SFmode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - } - } - - movsf_is_ok: - ; -}) - -(define_expand "movdf" - [(set (match_operand:DF 0 "general_operand" "") - (match_operand:DF 1 "general_operand" ""))] - "" -{ - /* Force DFmode constants into memory. */ - if (GET_CODE (operands[0]) == REG - && CONSTANT_P (operands[1])) - { - /* emit_group_store will send such bogosity to us when it is - not storing directly into memory. So fix this up to avoid - crashes in output_constant_pool. */ - if (operands [1] == const0_rtx) - operands[1] = CONST0_RTX (DFmode); - - if ((TARGET_VIS || REGNO (operands[0]) < 32) - && fp_zero_operand (operands[1], DFmode)) - goto movdf_is_ok; - - /* We are able to build any DF constant in integer registers. */ - if (REGNO (operands[0]) < 32 - && (reload_completed || reload_in_progress)) - goto movdf_is_ok; - - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - } - - /* Handle MEM cases first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode)) - goto movdf_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (DFmode, operands[1]); - } - } - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], DFmode, 0); - - if (symbolic_operand (operands[1], DFmode)) - { - operands[1] = legitimize_pic_address (operands[1], - DFmode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - } - } - - movdf_is_ok: - ; + if (sparc_expand_move (mode, operands)) + DONE; }) ;; Be careful, fmovd does not exist when !v9. @@ -2865,8 +2480,7 @@ "TARGET_FPU && ! TARGET_V9 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ ldd\t%1, %0 std\t%1, %0 @@ -2881,15 +2495,13 @@ [(set_attr "type" "fpload,fpstore,load,store,*,*,*,*,*,*") (set_attr "length" "*,*,*,*,2,2,2,2,2,2")]) -(define_insn "*movdf_no_e_insn_sp32" +(define_insn "*movdf_insn_sp32_no_fpu" [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,o,r,o") (match_operand:DF 1 "input_operand" "T,U,G,ro,r"))] "! TARGET_FPU && ! TARGET_V9 - && ! TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ ldd\t%1, %0 std\t%1, %0 @@ -2899,61 +2511,15 @@ [(set_attr "type" "load,store,*,*,*") (set_attr "length" "*,*,2,2,2")]) -(define_insn "*movdf_no_e_insn_v9_sp32" - [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,T,r,o") - (match_operand:DF 1 "input_operand" "T,U,G,ro,rG"))] - "! TARGET_FPU - && TARGET_V9 - && ! TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" - "@ - ldd\t%1, %0 - std\t%1, %0 - stx\t%r1, %0 - # - #" - [(set_attr "type" "load,store,store,*,*") - (set_attr "length" "*,*,*,2,2")]) - -;; We have available v9 double floats but not 64-bit -;; integer registers and no VIS. -(define_insn "*movdf_insn_v9only_novis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,T,W,U,T,f,*r,o") - (match_operand:DF 1 "input_operand" "e,W#F,G,e,T,U,o#F,*roF,*rGf"))] +;; We have available v9 double floats but not 64-bit integer registers. +(define_insn "*movdf_insn_sp32_v9" + [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,T,W,U,T,f,*r,o") + (match_operand:V64 1 "input_operand" "GY,e,W#F,GY,e,T,U,o#F,*roGYF,*rGYf"))] "TARGET_FPU && TARGET_V9 - && ! TARGET_VIS && ! TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" - "@ - fmovd\t%1, %0 - ldd\t%1, %0 - stx\t%r1, %0 - std\t%1, %0 - ldd\t%1, %0 - std\t%1, %0 - # - # - #" - [(set_attr "type" "fpmove,load,store,store,load,store,*,*,*") - (set_attr "length" "*,*,*,*,*,*,2,2,2") - (set_attr "fptype" "double,*,*,*,*,*,*,*,*")]) - -;; We have available v9 double floats but not 64-bit -;; integer registers but we have VIS. -(define_insn "*movdf_insn_v9only_vis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,e,T,W,U,T,f,*r,o") - (match_operand:DF 1 "input_operand" "G,e,W#F,G,e,T,U,o#F,*roGF,*rGf"))] - "TARGET_FPU - && TARGET_VIS - && ! TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + && (register_operand (operands[0], mode) + || register_or_zero_operand (operands[1], mode))" "@ fzero\t%0 fmovd\t%1, %0 @@ -2969,40 +2535,31 @@ (set_attr "length" "*,*,*,*,*,*,*,2,2,2") (set_attr "fptype" "double,double,*,*,*,*,*,*,*,*")]) -;; We have available both v9 double floats and 64-bit -;; integer registers. No VIS though. -(define_insn "*movdf_insn_sp64_novis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,W,*r,*r,m,*r") - (match_operand:DF 1 "input_operand" "e,W#F,e,*rG,m,*rG,F"))] - "TARGET_FPU - && ! TARGET_VIS - && TARGET_ARCH64 +(define_insn "*movdf_insn_sp32_v9_no_fpu" + [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,T,r,o") + (match_operand:DF 1 "input_operand" "T,U,G,ro,rG"))] + "! TARGET_FPU + && TARGET_V9 + && ! TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ - fmovd\t%1, %0 ldd\t%1, %0 std\t%1, %0 - mov\t%r1, %0 - ldx\t%1, %0 stx\t%r1, %0 + # #" - [(set_attr "type" "fpmove,load,store,*,load,store,*") - (set_attr "length" "*,*,*,*,*,*,2") - (set_attr "fptype" "double,*,*,*,*,*,*")]) + [(set_attr "type" "load,store,store,*,*") + (set_attr "length" "*,*,*,2,2")]) -;; We have available both v9 double floats and 64-bit -;; integer registers. And we have VIS. -(define_insn "*movdf_insn_sp64_vis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,e,W,*r,*r,m,*r") - (match_operand:DF 1 "input_operand" "G,e,W#F,e,*rG,m,*rG,F"))] +;; We have available both v9 double floats and 64-bit integer registers. +(define_insn "*movdf_insn_sp64" + [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,W,*r,*r,m,*r") + (match_operand:V64 1 "input_operand" "GY,e,W#F,e,*rGY,m,*rGY,F"))] "TARGET_FPU - && TARGET_VIS && TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + && (register_operand (operands[0], mode) + || register_or_zero_operand (operands[1], mode))" "@ fzero\t%0 fmovd\t%1, %0 @@ -3016,27 +2573,27 @@ (set_attr "length" "*,*,*,*,*,*,*,2") (set_attr "fptype" "double,double,*,*,*,*,*,*")]) -(define_insn "*movdf_no_e_insn_sp64" +(define_insn "*movdf_insn_sp64_no_fpu" [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m") (match_operand:DF 1 "input_operand" "r,m,rG"))] "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ mov\t%1, %0 ldx\t%1, %0 stx\t%r1, %0" [(set_attr "type" "*,load,store")]) +;; This pattern build DFmode constants in integer registers. (define_split [(set (match_operand:DF 0 "register_operand" "") (match_operand:DF 1 "const_double_operand" ""))] "TARGET_FPU && (GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32) - && ! fp_zero_operand(operands[1], DFmode) + && ! const_zero_operand(operands[1], DFmode) && reload_completed" [(clobber (const_int 0))] { @@ -3049,27 +2606,26 @@ if (TARGET_ARCH64) { -#if HOST_BITS_PER_WIDE_INT == 64 +#if HOST_BITS_PER_WIDE_INT == 32 + gcc_unreachable (); +#else HOST_WIDE_INT val; val = ((HOST_WIDE_INT)(unsigned long)l[1] | ((HOST_WIDE_INT)(unsigned long)l[0] << 32)); - emit_insn (gen_movdi (operands[0], GEN_INT (val))); -#else - emit_insn (gen_movdi (operands[0], - immed_double_const (l[1], l[0], DImode))); + emit_insn (gen_movdi (operands[0], gen_int_mode (val, DImode))); #endif } else { emit_insn (gen_movsi (gen_highpart (SImode, operands[0]), - GEN_INT (l[0]))); + gen_int_mode (l[0], SImode))); /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ if (l[1] == l[0] - && !(SPARC_SETHI32_P (l[0]) - || SPARC_SIMM13_P (l[0]))) + && ! SPARC_SETHI32_P (l[0]) + && ! SPARC_SIMM13_P (l[0])) { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); @@ -3077,7 +2633,7 @@ else { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), - GEN_INT (l[1]))); + gen_int_mode (l[1], SImode))); } } DONE; @@ -3089,8 +2645,8 @@ ;; careful when V9 but not ARCH64 because the integer ;; register DFmode cases must be handled. (define_split - [(set (match_operand:DF 0 "register_operand" "") - (match_operand:DF 1 "register_operand" ""))] + [(set (match_operand:V64 0 "register_operand" "") + (match_operand:V64 1 "register_operand" ""))] "(! TARGET_V9 || (! TARGET_ARCH64 && ((GET_CODE (operands[0]) == REG @@ -3105,30 +2661,37 @@ rtx set_src = operands[1]; rtx dest1, dest2; rtx src1, src2; + enum machine_mode half_mode; - dest1 = gen_highpart (SFmode, set_dest); - dest2 = gen_lowpart (SFmode, set_dest); - src1 = gen_highpart (SFmode, set_src); - src2 = gen_lowpart (SFmode, set_src); + /* We can be expanded for DFmode or integral vector modes. */ + if (mode == DFmode) + half_mode = SFmode; + else + half_mode = SImode; + + dest1 = gen_highpart (half_mode, set_dest); + dest2 = gen_lowpart (half_mode, set_dest); + src1 = gen_highpart (half_mode, set_src); + src2 = gen_lowpart (half_mode, set_src); /* Now emit using the real source and destination we found, swapping the order if we detect overlap. */ if (reg_overlap_mentioned_p (dest1, src2)) { - emit_insn (gen_movsf (dest2, src2)); - emit_insn (gen_movsf (dest1, src1)); + emit_move_insn_1 (dest2, src2); + emit_move_insn_1 (dest1, src1); } else { - emit_insn (gen_movsf (dest1, src1)); - emit_insn (gen_movsf (dest2, src2)); + emit_move_insn_1 (dest1, src1); + emit_move_insn_1 (dest2, src2); } DONE; }) (define_split - [(set (match_operand:DF 0 "register_operand" "") - (match_operand:DF 1 "memory_operand" ""))] + [(set (match_operand:V64 0 "register_operand" "") + (match_operand:V64 1 "memory_operand" ""))] "reload_completed && ! TARGET_ARCH64 && (((REGNO (operands[0]) % 2) != 0) @@ -3136,29 +2699,34 @@ && offsettable_memref_p (operands[1])" [(clobber (const_int 0))] { - rtx word0 = adjust_address (operands[1], SFmode, 0); - rtx word1 = adjust_address (operands[1], SFmode, 4); + enum machine_mode half_mode; + rtx word0, word1; - if (reg_overlap_mentioned_p (gen_highpart (SFmode, operands[0]), word1)) + /* We can be expanded for DFmode or integral vector modes. */ + if (mode == DFmode) + half_mode = SFmode; + else + half_mode = SImode; + + word0 = adjust_address (operands[1], half_mode, 0); + word1 = adjust_address (operands[1], half_mode, 4); + + if (reg_overlap_mentioned_p (gen_highpart (half_mode, operands[0]), word1)) { - emit_insn (gen_movsf (gen_lowpart (SFmode, operands[0]), - word1)); - emit_insn (gen_movsf (gen_highpart (SFmode, operands[0]), - word0)); + emit_move_insn_1 (gen_lowpart (half_mode, operands[0]), word1); + emit_move_insn_1 (gen_highpart (half_mode, operands[0]), word0); } else { - emit_insn (gen_movsf (gen_highpart (SFmode, operands[0]), - word0)); - emit_insn (gen_movsf (gen_lowpart (SFmode, operands[0]), - word1)); + emit_move_insn_1 (gen_highpart (half_mode, operands[0]), word0); + emit_move_insn_1 (gen_lowpart (half_mode, operands[0]), word1); } DONE; }) (define_split - [(set (match_operand:DF 0 "memory_operand" "") - (match_operand:DF 1 "register_operand" ""))] + [(set (match_operand:V64 0 "memory_operand" "") + (match_operand:V64 1 "register_operand" ""))] "reload_completed && ! TARGET_ARCH64 && (((REGNO (operands[1]) % 2) != 0) @@ -3166,19 +2734,26 @@ && offsettable_memref_p (operands[0])" [(clobber (const_int 0))] { - rtx word0 = adjust_address (operands[0], SFmode, 0); - rtx word1 = adjust_address (operands[0], SFmode, 4); + enum machine_mode half_mode; + rtx word0, word1; - emit_insn (gen_movsf (word0, - gen_highpart (SFmode, operands[1]))); - emit_insn (gen_movsf (word1, - gen_lowpart (SFmode, operands[1]))); + /* We can be expanded for DFmode or integral vector modes. */ + if (mode == DFmode) + half_mode = SFmode; + else + half_mode = SImode; + + word0 = adjust_address (operands[0], half_mode, 0); + word1 = adjust_address (operands[0], half_mode, 4); + + emit_move_insn_1 (word0, gen_highpart (half_mode, operands[1])); + emit_move_insn_1 (word1, gen_lowpart (half_mode, operands[1])); DONE; }) (define_split - [(set (match_operand:DF 0 "memory_operand" "") - (match_operand:DF 1 "fp_zero_operand" ""))] + [(set (match_operand:V64 0 "memory_operand" "") + (match_operand:V64 1 "const_zero_operand" ""))] "reload_completed && (! TARGET_V9 || (! TARGET_ARCH64 @@ -3186,19 +2761,26 @@ && offsettable_memref_p (operands[0])" [(clobber (const_int 0))] { + enum machine_mode half_mode; rtx dest1, dest2; - dest1 = adjust_address (operands[0], SFmode, 0); - dest2 = adjust_address (operands[0], SFmode, 4); + /* We can be expanded for DFmode or integral vector modes. */ + if (mode == DFmode) + half_mode = SFmode; + else + half_mode = SImode; - emit_insn (gen_movsf (dest1, CONST0_RTX (SFmode))); - emit_insn (gen_movsf (dest2, CONST0_RTX (SFmode))); + dest1 = adjust_address (operands[0], half_mode, 0); + dest2 = adjust_address (operands[0], half_mode, 4); + + emit_move_insn_1 (dest1, CONST0_RTX (half_mode)); + emit_move_insn_1 (dest2, CONST0_RTX (half_mode)); DONE; }) (define_split - [(set (match_operand:DF 0 "register_operand" "") - (match_operand:DF 1 "fp_zero_operand" ""))] + [(set (match_operand:V64 0 "register_operand" "") + (match_operand:V64 1 "const_zero_operand" ""))] "reload_completed && ! TARGET_ARCH64 && ((GET_CODE (operands[0]) == REG @@ -3208,97 +2790,39 @@ && REGNO (SUBREG_REG (operands[0])) < 32))" [(clobber (const_int 0))] { + enum machine_mode half_mode; rtx set_dest = operands[0]; rtx dest1, dest2; - dest1 = gen_highpart (SFmode, set_dest); - dest2 = gen_lowpart (SFmode, set_dest); - emit_insn (gen_movsf (dest1, CONST0_RTX (SFmode))); - emit_insn (gen_movsf (dest2, CONST0_RTX (SFmode))); + /* We can be expanded for DFmode or integral vector modes. */ + if (mode == DFmode) + half_mode = SFmode; + else + half_mode = SImode; + + dest1 = gen_highpart (half_mode, set_dest); + dest2 = gen_lowpart (half_mode, set_dest); + emit_move_insn_1 (dest1, CONST0_RTX (half_mode)); + emit_move_insn_1 (dest2, CONST0_RTX (half_mode)); DONE; }) (define_expand "movtf" - [(set (match_operand:TF 0 "general_operand" "") + [(set (match_operand:TF 0 "nonimmediate_operand" "") (match_operand:TF 1 "general_operand" ""))] "" { - /* Force TFmode constants into memory. */ - if (GET_CODE (operands[0]) == REG - && CONSTANT_P (operands[1])) - { - /* emit_group_store will send such bogosity to us when it is - not storing directly into memory. So fix this up to avoid - crashes in output_constant_pool. */ - if (operands [1] == const0_rtx) - operands[1] = CONST0_RTX (TFmode); - - if (TARGET_VIS && fp_zero_operand (operands[1], TFmode)) - goto movtf_is_ok; - - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - } - - /* Handle MEM cases first, note that only v9 guarantees - full 16-byte alignment for quads. */ - if (GET_CODE (operands[0]) == MEM) - { - if (register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode)) - goto movtf_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (TFmode, operands[1]); - } - } - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], TFmode, 0); - - if (symbolic_operand (operands[1], TFmode)) - { - operands[1] = legitimize_pic_address (operands[1], - TFmode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - } - } - - movtf_is_ok: - ; + if (sparc_expand_move (TFmode, operands)) + DONE; }) -;; Be careful, fmovq and {st,ld}{x,q} do not exist when !arch64 so -;; we must split them all. :-( (define_insn "*movtf_insn_sp32" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,U,r") - (match_operand:TF 1 "input_operand" "oe,GeUr,o,roG"))] + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,U,r") + (match_operand:TF 1 "input_operand" "G,oe,GeUr,o,roG"))] "TARGET_FPU - && ! TARGET_VIS && ! TARGET_ARCH64 && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "#" - [(set_attr "length" "4")]) - -(define_insn "*movtf_insn_vis_sp32" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,U,r") - (match_operand:TF 1 "input_operand" "Goe,GeUr,o,roG"))] - "TARGET_FPU - && TARGET_VIS - && ! TARGET_ARCH64 - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "4")]) @@ -3306,94 +2830,52 @@ ;; This is necessary to prevent reload from ever trying to use a `e' reg ;; when -mno-fpu. -(define_insn "*movtf_no_e_insn_sp32" +(define_insn "*movtf_insn_sp32_no_fpu" [(set (match_operand:TF 0 "nonimmediate_operand" "=o,U,o,r,o") (match_operand:TF 1 "input_operand" "G,o,U,roG,r"))] "! TARGET_FPU && ! TARGET_ARCH64 && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "4")]) -;; Now handle the float reg cases directly when arch64, -;; hard_quad, and proper reg number alignment are all true. -(define_insn "*movtf_insn_hq_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,e,m,o,r") - (match_operand:TF 1 "input_operand" "e,m,e,Gr,roG"))] - "TARGET_FPU - && ! TARGET_VIS - && TARGET_ARCH64 - && TARGET_HARD_QUAD - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "@ - fmovq\t%1, %0 - ldq\t%1, %0 - stq\t%1, %0 - # - #" - [(set_attr "type" "fpmove,fpload,fpstore,*,*") - (set_attr "length" "*,*,*,2,2")]) - -(define_insn "*movtf_insn_hq_vis_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,e,m,eo,r,o") - (match_operand:TF 1 "input_operand" "e,m,e,G,roG,r"))] - "TARGET_FPU - && TARGET_VIS - && TARGET_ARCH64 - && TARGET_HARD_QUAD - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "@ - fmovq\t%1, %0 - ldq\t%1, %0 - stq\t%1, %0 - # - # - #" - [(set_attr "type" "fpmove,fpload,fpstore,*,*,*") - (set_attr "length" "*,*,*,2,2,2")]) - -;; Now we allow the integer register cases even when -;; only arch64 is true. (define_insn "*movtf_insn_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,r") - (match_operand:TF 1 "input_operand" "oe,Ger,orG"))] + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,r") + (match_operand:TF 1 "input_operand" "G,oe,Ger,roG"))] "TARGET_FPU - && ! TARGET_VIS && TARGET_ARCH64 && ! TARGET_HARD_QUAD && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "2")]) -(define_insn "*movtf_insn_vis_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,r") - (match_operand:TF 1 "input_operand" "Goe,Ger,orG"))] +(define_insn "*movtf_insn_sp64_hq" + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,e,m,o,r") + (match_operand:TF 1 "input_operand" "G,e,m,e,rG,roG"))] "TARGET_FPU - && TARGET_VIS && TARGET_ARCH64 - && ! TARGET_HARD_QUAD + && TARGET_HARD_QUAD && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "#" - [(set_attr "length" "2")]) + || register_or_zero_operand (operands[1], TFmode))" + "@ + # + fmovq\t%1, %0 + ldq\t%1, %0 + stq\t%1, %0 + # + #" + [(set_attr "type" "*,fpmove,fpload,fpstore,*,*") + (set_attr "length" "2,*,*,*,2,2")]) -(define_insn "*movtf_no_e_insn_sp64" +(define_insn "*movtf_insn_sp64_no_fpu" [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o") (match_operand:TF 1 "input_operand" "orG,rG"))] "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "2")]) @@ -3435,7 +2917,7 @@ (define_split [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "fp_zero_operand" ""))] + (match_operand:TF 1 "const_zero_operand" ""))] "reload_completed" [(clobber (const_int 0))] { @@ -3453,7 +2935,7 @@ dest2 = adjust_address (set_dest, DFmode, 8); break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_movdf (dest1, CONST0_RTX (DFmode))); @@ -3514,8 +2996,9 @@ gen_df_reg (set_src, 1))); DONE; }) - -;; SPARC V9 conditional move instructions. + + +;; SPARC-V9 conditional move instructions. ;; We can handle larger constants here for some flavors, but for now we keep ;; it simple and only allow those constants supported by all flavors. @@ -3546,8 +3029,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } }) @@ -3575,8 +3057,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } }) @@ -3600,8 +3081,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } @@ -3610,8 +3090,8 @@ (define_expand "movdicc" [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operand 1 "comparison_operator" "") - (match_operand:DI 2 "arith10_double_operand" "") - (match_operand:DI 3 "arith10_double_operand" "")))] + (match_operand:DI 2 "arith10_operand" "") + (match_operand:DI 3 "arith10_operand" "")))] "TARGET_ARCH64" { enum rtx_code code = GET_CODE (operands[1]); @@ -3626,8 +3106,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } @@ -3656,8 +3135,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } }) @@ -3685,8 +3163,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } }) @@ -3714,8 +3191,7 @@ } else { - rtx cc_reg = gen_compare_reg (code, - sparc_compare_op0, sparc_compare_op1); + rtx cc_reg = gen_compare_reg (code); operands[1] = gen_rtx_fmt_ee (code, GET_MODE (cc_reg), cc_reg, const0_rtx); } }) @@ -3725,7 +3201,7 @@ (define_insn "*movqi_cc_sp64" [(set (match_operand:QI 0 "register_operand" "=r,r") (if_then_else:QI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:QI 3 "arith11_operand" "rL,0") (match_operand:QI 4 "arith11_operand" "0,rL")))] @@ -3738,7 +3214,7 @@ (define_insn "*movhi_cc_sp64" [(set (match_operand:HI 0 "register_operand" "=r,r") (if_then_else:HI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:HI 3 "arith11_operand" "rL,0") (match_operand:HI 4 "arith11_operand" "0,rL")))] @@ -3751,7 +3227,7 @@ (define_insn "*movsi_cc_sp64" [(set (match_operand:SI 0 "register_operand" "=r,r") (if_then_else:SI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:SI 3 "arith11_operand" "rL,0") (match_operand:SI 4 "arith11_operand" "0,rL")))] @@ -3761,14 +3237,13 @@ mov%c1\t%x2, %4, %0" [(set_attr "type" "cmove")]) -;; ??? The constraints of operands 3,4 need work. (define_insn "*movdi_cc_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) - (match_operand:DI 3 "arith11_double_operand" "rLH,0") - (match_operand:DI 4 "arith11_double_operand" "0,rLH")))] + (match_operand:DI 3 "arith11_operand" "rL,0") + (match_operand:DI 4 "arith11_operand" "0,rL")))] "TARGET_ARCH64" "@ mov%C1\t%x2, %3, %0 @@ -3778,10 +3253,10 @@ (define_insn "*movdi_cc_sp64_trunc" [(set (match_operand:SI 0 "register_operand" "=r,r") (if_then_else:SI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) - (match_operand:SI 3 "arith11_double_operand" "rLH,0") - (match_operand:SI 4 "arith11_double_operand" "0,rLH")))] + (match_operand:SI 3 "arith11_operand" "rL,0") + (match_operand:SI 4 "arith11_operand" "0,rL")))] "TARGET_ARCH64" "@ mov%C1\t%x2, %3, %0 @@ -3791,7 +3266,7 @@ (define_insn "*movsf_cc_sp64" [(set (match_operand:SF 0 "register_operand" "=f,f") (if_then_else:SF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:SF 3 "register_operand" "f,0") (match_operand:SF 4 "register_operand" "0,f")))] @@ -3804,7 +3279,7 @@ (define_insn "movdf_cc_sp64" [(set (match_operand:DF 0 "register_operand" "=e,e") (if_then_else:DF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:DF 3 "register_operand" "e,0") (match_operand:DF 4 "register_operand" "0,e")))] @@ -3818,7 +3293,7 @@ (define_insn "*movtf_cc_hq_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") (if_then_else:TF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") (match_operand:TF 4 "register_operand" "0,e")))] @@ -3831,7 +3306,7 @@ (define_insn_and_split "*movtf_cc_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") (if_then_else:TF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") (match_operand:TF 4 "register_operand" "0,e")))] @@ -3873,7 +3348,7 @@ (define_insn "*movqi_cc_reg_sp64" [(set (match_operand:QI 0 "register_operand" "=r,r") - (if_then_else:QI (match_operator 1 "v9_regcmp_op" + (if_then_else:QI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:QI 3 "arith10_operand" "rM,0") @@ -3886,7 +3361,7 @@ (define_insn "*movhi_cc_reg_sp64" [(set (match_operand:HI 0 "register_operand" "=r,r") - (if_then_else:HI (match_operator 1 "v9_regcmp_op" + (if_then_else:HI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:HI 3 "arith10_operand" "rM,0") @@ -3899,7 +3374,7 @@ (define_insn "*movsi_cc_reg_sp64" [(set (match_operand:SI 0 "register_operand" "=r,r") - (if_then_else:SI (match_operator 1 "v9_regcmp_op" + (if_then_else:SI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:SI 3 "arith10_operand" "rM,0") @@ -3910,27 +3385,13 @@ movr%d1\t%2, %r4, %0" [(set_attr "type" "cmove")]) -;; ??? The constraints of operands 3,4 need work. (define_insn "*movdi_cc_reg_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") - (if_then_else:DI (match_operator 1 "v9_regcmp_op" + (if_then_else:DI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) - (match_operand:DI 3 "arith10_double_operand" "rMH,0") - (match_operand:DI 4 "arith10_double_operand" "0,rMH")))] - "TARGET_ARCH64" - "@ - movr%D1\t%2, %r3, %0 - movr%d1\t%2, %r4, %0" - [(set_attr "type" "cmove")]) - -(define_insn "*movdi_cc_reg_sp64_trunc" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (if_then_else:SI (match_operator 1 "v9_regcmp_op" - [(match_operand:DI 2 "register_operand" "r,r") - (const_int 0)]) - (match_operand:SI 3 "arith10_double_operand" "rMH,0") - (match_operand:SI 4 "arith10_double_operand" "0,rMH")))] + (match_operand:DI 3 "arith10_operand" "rM,0") + (match_operand:DI 4 "arith10_operand" "0,rM")))] "TARGET_ARCH64" "@ movr%D1\t%2, %r3, %0 @@ -3939,7 +3400,7 @@ (define_insn "*movsf_cc_reg_sp64" [(set (match_operand:SF 0 "register_operand" "=f,f") - (if_then_else:SF (match_operator 1 "v9_regcmp_op" + (if_then_else:SF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:SF 3 "register_operand" "f,0") @@ -3952,7 +3413,7 @@ (define_insn "movdf_cc_reg_sp64" [(set (match_operand:DF 0 "register_operand" "=e,e") - (if_then_else:DF (match_operator 1 "v9_regcmp_op" + (if_then_else:DF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:DF 3 "register_operand" "e,0") @@ -3966,7 +3427,7 @@ (define_insn "*movtf_cc_reg_hq_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") - (if_then_else:TF (match_operator 1 "v9_regcmp_op" + (if_then_else:TF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") @@ -3979,7 +3440,7 @@ (define_insn_and_split "*movtf_cc_reg_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") - (if_then_else:TF (match_operator 1 "v9_regcmp_op" + (if_then_else:TF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") @@ -4021,7 +3482,7 @@ [(set_attr "length" "2")]) -;;- zero extension instructions +;; Zero-extension instructions ;; These patterns originally accepted general_operands, however, slightly ;; better code is generated by only accepting register_operands, and then @@ -4137,7 +3598,6 @@ [(set_attr "type" "load") (set_attr "us3load_type" "3cycle")]) - ;; ??? Write truncdisi pattern using sra? (define_expand "zero_extendsidi2" @@ -4301,7 +3761,8 @@ "andcc\t%1, 0xff, %0" [(set_attr "type" "compare")]) -;;- sign extension instructions + +;; Sign-extension instructions ;; These patterns originally accepted general_operands, however, slightly ;; better code is generated by only accepting register_operands, and then @@ -4486,7 +3947,8 @@ ldsw\t%1, %0" [(set_attr "type" "shift,sload") (set_attr "us3load_type" "*,3cycle")]) - + + ;; Special pattern for optimizing bit-field compares. This is needed ;; because combine uses this as a canonical form. @@ -4494,23 +3956,14 @@ [(set (reg:CC 100) (compare:CC (zero_extract:SI (match_operand:SI 0 "register_operand" "r") - (match_operand:SI 1 "small_int_or_double" "n") - (match_operand:SI 2 "small_int_or_double" "n")) + (match_operand:SI 1 "small_int_operand" "I") + (match_operand:SI 2 "small_int_operand" "I")) (const_int 0)))] - "(GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 19) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_LOW (operands[2]) > 19)" + "INTVAL (operands[2]) > 19" { - int len = (GET_CODE (operands[1]) == CONST_INT - ? INTVAL (operands[1]) - : CONST_DOUBLE_LOW (operands[1])); - int pos = 32 - - (GET_CODE (operands[2]) == CONST_INT - ? INTVAL (operands[2]) - : CONST_DOUBLE_LOW (operands[2])) - len; + int len = INTVAL (operands[1]); + int pos = 32 - INTVAL (operands[2]) - len; HOST_WIDE_INT mask = ((1 << len) - 1) << pos; - operands[1] = GEN_INT (mask); return "andcc\t%0, %1, %%g0"; } @@ -4520,29 +3973,20 @@ [(set (reg:CCX 100) (compare:CCX (zero_extract:DI (match_operand:DI 0 "register_operand" "r") - (match_operand:SI 1 "small_int_or_double" "n") - (match_operand:SI 2 "small_int_or_double" "n")) + (match_operand:SI 1 "small_int_operand" "I") + (match_operand:SI 2 "small_int_operand" "I")) (const_int 0)))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 51) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_LOW (operands[2]) > 51))" + "TARGET_ARCH64 && INTVAL (operands[2]) > 51" { - int len = (GET_CODE (operands[1]) == CONST_INT - ? INTVAL (operands[1]) - : CONST_DOUBLE_LOW (operands[1])); - int pos = 64 - - (GET_CODE (operands[2]) == CONST_INT - ? INTVAL (operands[2]) - : CONST_DOUBLE_LOW (operands[2])) - len; + int len = INTVAL (operands[1]); + int pos = 64 - INTVAL (operands[2]) - len; HOST_WIDE_INT mask = (((unsigned HOST_WIDE_INT) 1 << len) - 1) << pos; - operands[1] = GEN_INT (mask); return "andcc\t%0, %1, %%g0"; } [(set_attr "type" "compare")]) - + + ;; Conversions between float, double and long double. (define_insn "extendsfdf2" @@ -4622,7 +4066,8 @@ "TARGET_FPU && TARGET_HARD_QUAD" "fqtod\t%1, %0" [(set_attr "type" "fp")]) - + + ;; Conversion between fixed point and floating point. (define_insn "floatsisf2" @@ -4672,9 +4117,9 @@ (define_expand "floatunsdisf2" [(use (match_operand:SF 0 "register_operand" "")) - (use (match_operand:DI 1 "register_operand" ""))] + (use (match_operand:DI 1 "general_operand" ""))] "TARGET_ARCH64 && TARGET_FPU" - "sparc_emit_floatunsdi (operands); DONE;") + "sparc_emit_floatunsdi (operands, SFmode); DONE;") (define_insn "floatdidf2" [(set (match_operand:DF 0 "register_operand" "=e") @@ -4686,9 +4131,9 @@ (define_expand "floatunsdidf2" [(use (match_operand:DF 0 "register_operand" "")) - (use (match_operand:DI 1 "register_operand" ""))] + (use (match_operand:DI 1 "general_operand" ""))] "TARGET_ARCH64 && TARGET_FPU" - "sparc_emit_floatunsdi (operands); DONE;") + "sparc_emit_floatunsdi (operands, DFmode); DONE;") (define_expand "floatditf2" [(set (match_operand:TF 0 "nonimmediate_operand" "") @@ -4757,6 +4202,12 @@ [(set_attr "type" "fp") (set_attr "fptype" "double")]) +(define_expand "fixuns_truncsfdi2" + [(use (match_operand:DI 0 "register_operand" "")) + (use (match_operand:SF 1 "general_operand" ""))] + "TARGET_ARCH64 && TARGET_FPU" + "sparc_emit_fixunsdi (operands, SFmode); DONE;") + (define_insn "fix_truncdfdi2" [(set (match_operand:DI 0 "register_operand" "=e") (fix:DI (fix:DF (match_operand:DF 1 "register_operand" "e"))))] @@ -4765,6 +4216,12 @@ [(set_attr "type" "fp") (set_attr "fptype" "double")]) +(define_expand "fixuns_truncdfdi2" + [(use (match_operand:DI 0 "register_operand" "")) + (use (match_operand:DF 1 "general_operand" ""))] + "TARGET_ARCH64 && TARGET_FPU" + "sparc_emit_fixunsdi (operands, DFmode); DONE;") + (define_expand "fix_trunctfdi2" [(set (match_operand:DI 0 "register_operand" "") (fix:DI (match_operand:TF 1 "general_operand" "")))] @@ -4783,8 +4240,9 @@ (unsigned_fix:DI (match_operand:TF 1 "general_operand" "")))] "TARGET_FPU && TARGET_ARCH64 && ! TARGET_HARD_QUAD" "emit_tfmode_cvt (UNSIGNED_FIX, operands); DONE;") - -;;- arithmetic instructions + + +;; Integer addition/subtraction instructions. (define_expand "adddi3" [(set (match_operand:DI 0 "register_operand" "") @@ -4842,12 +4300,149 @@ } [(set_attr "length" "2")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" ""))) +;; LTU here means "carry set" +(define_insn "addx" + [(set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (plus:SI (match_operand:SI 1 "arith_operand" "%r") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] + "" + "addx\t%1, %2, %0" + [(set_attr "type" "ialuX")]) + +(define_insn_and_split "*addx_extend_sp32" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (plus:SI (plus:SI + (match_operand:SI 1 "register_or_zero_operand" "%rJ") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] + "! TARGET_ARCH64" + "#" + "&& reload_completed" + [(set (match_dup 3) (plus:SI (plus:SI (match_dup 1) (match_dup 2)) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))) + (set (match_dup 4) (const_int 0))] + "operands[3] = gen_lowpart (SImode, operands[0]); + operands[4] = gen_highpart_mode (SImode, DImode, operands[1]);" + [(set_attr "length" "2")]) + +(define_insn "*addx_extend_sp64" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] + "TARGET_ARCH64" + "addx\t%r1, %2, %0" + [(set_attr "type" "ialuX")]) + +(define_insn_and_split "" + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) + (match_operand:DI 2 "register_operand" "r"))) (clobber (reg:CC 100))] - "! TARGET_ARCH64 && reload_completed" + "! TARGET_ARCH64" + "#" + "&& reload_completed" + [(parallel [(set (reg:CC_NOOV 100) + (compare:CC_NOOV (plus:SI (match_dup 3) (match_dup 1)) + (const_int 0))) + (set (match_dup 5) (plus:SI (match_dup 3) (match_dup 1)))]) + (set (match_dup 6) + (plus:SI (plus:SI (match_dup 4) (const_int 0)) + (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] + "operands[3] = gen_lowpart (SImode, operands[2]); + operands[4] = gen_highpart (SImode, operands[2]); + operands[5] = gen_lowpart (SImode, operands[0]); + operands[6] = gen_highpart (SImode, operands[0]);" + [(set_attr "length" "2")]) + +(define_insn "*adddi3_sp64" + [(set (match_operand:DI 0 "register_operand" "=r,r") + (plus:DI (match_operand:DI 1 "register_operand" "%r,r") + (match_operand:DI 2 "arith_add_operand" "rI,O")))] + "TARGET_ARCH64" + "@ + add\t%1, %2, %0 + sub\t%1, -%2, %0") + +(define_insn "addsi3" + [(set (match_operand:SI 0 "register_operand" "=r,r,d") + (plus:SI (match_operand:SI 1 "register_operand" "%r,r,d") + (match_operand:SI 2 "arith_add_operand" "rI,O,d")))] + "" + "@ + add\t%1, %2, %0 + sub\t%1, -%2, %0 + fpadd32s\t%1, %2, %0" + [(set_attr "type" "*,*,fga") + (set_attr "fptype" "*,*,single")]) + +(define_insn "*cmp_cc_plus" + [(set (reg:CC_NOOV 100) + (compare:CC_NOOV (plus:SI (match_operand:SI 0 "arith_operand" "%r") + (match_operand:SI 1 "arith_operand" "rI")) + (const_int 0)))] + "" + "addcc\t%0, %1, %%g0" + [(set_attr "type" "compare")]) + +(define_insn "*cmp_ccx_plus" + [(set (reg:CCX_NOOV 100) + (compare:CCX_NOOV (plus:DI (match_operand:DI 0 "arith_operand" "%r") + (match_operand:DI 1 "arith_operand" "rI")) + (const_int 0)))] + "TARGET_ARCH64" + "addcc\t%0, %1, %%g0" + [(set_attr "type" "compare")]) + +(define_insn "*cmp_cc_plus_set" + [(set (reg:CC_NOOV 100) + (compare:CC_NOOV (plus:SI (match_operand:SI 1 "arith_operand" "%r") + (match_operand:SI 2 "arith_operand" "rI")) + (const_int 0))) + (set (match_operand:SI 0 "register_operand" "=r") + (plus:SI (match_dup 1) (match_dup 2)))] + "" + "addcc\t%1, %2, %0" + [(set_attr "type" "compare")]) + +(define_insn "*cmp_ccx_plus_set" + [(set (reg:CCX_NOOV 100) + (compare:CCX_NOOV (plus:DI (match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (match_dup 1) (match_dup 2)))] + "TARGET_ARCH64" + "addcc\t%1, %2, %0" + [(set_attr "type" "compare")]) + +(define_expand "subdi3" + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (match_operand:DI 1 "register_operand" "") + (match_operand:DI 2 "arith_double_add_operand" "")))] + "" +{ + if (! TARGET_ARCH64) + { + emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, + gen_rtx_SET (VOIDmode, operands[0], + gen_rtx_MINUS (DImode, operands[1], + operands[2])), + gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (CCmode, SPARC_ICC_REG))))); + DONE; + } +}) + +(define_insn_and_split "subdi3_insn_sp32" + [(set (match_operand:DI 0 "register_operand" "=r") + (minus:DI (match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "arith_double_operand" "rHI"))) + (clobber (reg:CC 100))] + "! TARGET_ARCH64" + "#" + "&& reload_completed" [(parallel [(set (reg:CC_NOOV 100) (compare:CC_NOOV (minus:SI (match_dup 4) (match_dup 5)) @@ -4875,46 +4470,13 @@ else #endif operands[8] = gen_highpart_mode (SImode, DImode, operands[2]); -}) - -;; LTU here means "carry set" -(define_insn "addx" - [(set (match_operand:SI 0 "register_operand" "=r") - (plus:SI (plus:SI (match_operand:SI 1 "arith_operand" "%r") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] - "" - "addx\t%1, %2, %0" - [(set_attr "type" "ialuX")]) - -(define_insn_and_split "*addx_extend_sp32" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (plus:SI (plus:SI - (match_operand:SI 1 "reg_or_0_operand" "%rJ") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] - "! TARGET_ARCH64" - "#" - "&& reload_completed" - [(set (match_dup 3) (plus:SI (plus:SI (match_dup 1) (match_dup 2)) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))) - (set (match_dup 4) (const_int 0))] - "operands[3] = gen_lowpart (SImode, operands[0]); - operands[4] = gen_highpart_mode (SImode, DImode, operands[1]);" +} [(set_attr "length" "2")]) -(define_insn "*addx_extend_sp64" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] - "TARGET_ARCH64" - "addx\t%r1, %2, %0" - [(set_attr "type" "ialuX")]) - +;; LTU here means "carry set" (define_insn "subx" [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] "" @@ -4923,7 +4485,7 @@ (define_insn "*subx_extend_sp64" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] "TARGET_ARCH64" @@ -4932,7 +4494,7 @@ (define_insn_and_split "*subx_extend" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] "! TARGET_ARCH64" @@ -4945,162 +4507,6 @@ operands[4] = gen_highpart (SImode, operands[0]);" [(set_attr "length" "2")]) -(define_insn_and_split "" - [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "register_operand" "r"))) - (clobber (reg:CC 100))] - "! TARGET_ARCH64" - "#" - "&& reload_completed" - [(parallel [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (plus:SI (match_dup 3) (match_dup 1)) - (const_int 0))) - (set (match_dup 5) (plus:SI (match_dup 3) (match_dup 1)))]) - (set (match_dup 6) - (plus:SI (plus:SI (match_dup 4) (const_int 0)) - (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] - "operands[3] = gen_lowpart (SImode, operands[2]); - operands[4] = gen_highpart (SImode, operands[2]); - operands[5] = gen_lowpart (SImode, operands[0]); - operands[6] = gen_highpart (SImode, operands[0]);" - [(set_attr "length" "2")]) - -(define_insn "*adddi3_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (plus:DI (match_operand:DI 1 "register_operand" "%r,r") - (match_operand:DI 2 "arith_double_add_operand" "rHI,O")))] - "TARGET_ARCH64" - "@ - add\t%1, %2, %0 - sub\t%1, -%2, %0") - -(define_insn "addsi3" - [(set (match_operand:SI 0 "register_operand" "=r,r,d") - (plus:SI (match_operand:SI 1 "register_operand" "%r,r,d") - (match_operand:SI 2 "arith_add_operand" "rI,O,d")))] - "" - "@ - add\t%1, %2, %0 - sub\t%1, -%2, %0 - fpadd32s\t%1, %2, %0" - [(set_attr "type" "*,*,fga")]) - -(define_insn "*cmp_cc_plus" - [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (plus:SI (match_operand:SI 0 "arith_operand" "%r") - (match_operand:SI 1 "arith_operand" "rI")) - (const_int 0)))] - "" - "addcc\t%0, %1, %%g0" - [(set_attr "type" "compare")]) - -(define_insn "*cmp_ccx_plus" - [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (plus:DI (match_operand:DI 0 "arith_double_operand" "%r") - (match_operand:DI 1 "arith_double_operand" "rHI")) - (const_int 0)))] - "TARGET_ARCH64" - "addcc\t%0, %1, %%g0" - [(set_attr "type" "compare")]) - -(define_insn "*cmp_cc_plus_set" - [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (plus:SI (match_operand:SI 1 "arith_operand" "%r") - (match_operand:SI 2 "arith_operand" "rI")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=r") - (plus:SI (match_dup 1) (match_dup 2)))] - "" - "addcc\t%1, %2, %0" - [(set_attr "type" "compare")]) - -(define_insn "*cmp_ccx_plus_set" - [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (plus:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_ARCH64" - "addcc\t%1, %2, %0" - [(set_attr "type" "compare")]) - -(define_expand "subdi3" - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "arith_double_add_operand" "")))] - "" -{ - if (! TARGET_ARCH64) - { - emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, - gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_MINUS (DImode, operands[1], - operands[2])), - gen_rtx_CLOBBER (VOIDmode, - gen_rtx_REG (CCmode, SPARC_ICC_REG))))); - DONE; - } -}) - -(define_insn_and_split "*subdi3_sp32" - [(set (match_operand:DI 0 "register_operand" "=r") - (minus:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI"))) - (clobber (reg:CC 100))] - "! TARGET_ARCH64" - "#" - "&& reload_completed - && (GET_CODE (operands[2]) == CONST_INT - || GET_CODE (operands[2]) == CONST_DOUBLE)" - [(clobber (const_int 0))] -{ - rtx highp, lowp; - - highp = gen_highpart_mode (SImode, DImode, operands[2]); - lowp = gen_lowpart (SImode, operands[2]); - if ((lowp == const0_rtx) - && (operands[0] == operands[1])) - { - emit_insn (gen_rtx_SET (VOIDmode, - gen_highpart (SImode, operands[0]), - gen_rtx_MINUS (SImode, - gen_highpart_mode (SImode, DImode, - operands[1]), - highp))); - } - else - { - emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]), - gen_lowpart (SImode, operands[1]), - lowp)); - emit_insn (gen_subx (gen_highpart (SImode, operands[0]), - gen_highpart_mode (SImode, DImode, operands[1]), - highp)); - } - DONE; -} - [(set_attr "length" "2")]) - -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "register_operand" ""))) - (clobber (reg:CC 100))] - "! TARGET_ARCH64 - && reload_completed" - [(clobber (const_int 0))] -{ - emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]), - gen_lowpart (SImode, operands[1]), - gen_lowpart (SImode, operands[2]))); - emit_insn (gen_subx (gen_highpart (SImode, operands[0]), - gen_highpart (SImode, operands[1]), - gen_highpart (SImode, operands[2]))); - DONE; -}) - (define_insn_and_split "" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_operand:DI 1 "register_operand" "r") @@ -5125,7 +4531,7 @@ (define_insn "*subdi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") (minus:DI (match_operand:DI 1 "register_operand" "r,r") - (match_operand:DI 2 "arith_double_add_operand" "rHI,O")))] + (match_operand:DI 2 "arith_add_operand" "rI,O")))] "TARGET_ARCH64" "@ sub\t%1, %2, %0 @@ -5140,11 +4546,12 @@ sub\t%1, %2, %0 add\t%1, -%2, %0 fpsub32s\t%1, %2, %0" - [(set_attr "type" "*,*,fga")]) + [(set_attr "type" "*,*,fga") + (set_attr "fptype" "*,*,single")]) (define_insn "*cmp_minus_cc" [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (minus:SI (match_operand:SI 0 "reg_or_0_operand" "rJ") + (compare:CC_NOOV (minus:SI (match_operand:SI 0 "register_or_zero_operand" "rJ") (match_operand:SI 1 "arith_operand" "rI")) (const_int 0)))] "" @@ -5154,7 +4561,7 @@ (define_insn "*cmp_minus_ccx" [(set (reg:CCX_NOOV 100) (compare:CCX_NOOV (minus:DI (match_operand:DI 0 "register_operand" "r") - (match_operand:DI 1 "arith_double_operand" "rHI")) + (match_operand:DI 1 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "subcc\t%0, %1, %%g0" @@ -5162,7 +4569,7 @@ (define_insn "cmp_minus_cc_set" [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (compare:CC_NOOV (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") @@ -5174,15 +4581,16 @@ (define_insn "*cmp_minus_ccx_set" [(set (reg:CCX_NOOV 100) (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")) + (match_operand:DI 2 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_dup 1) (match_dup 2)))] "TARGET_ARCH64" "subcc\t%1, %2, %0" [(set_attr "type" "compare")]) - -;; Integer Multiply/Divide. + + +;; Integer multiply/divide instructions. ;; The 32 bit multiply/divide instructions are deprecated on v9, but at ;; least in UltraSPARC I, II and IIi it is a win tick-wise. @@ -5196,9 +4604,9 @@ [(set_attr "type" "imul")]) (define_expand "muldi3" - [(set (match_operand:DI 0 "register_operand" "=r") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + [(set (match_operand:DI 0 "register_operand" "") + (mult:DI (match_operand:DI 1 "arith_operand" "") + (match_operand:DI 2 "arith_operand" "")))] "TARGET_ARCH64 || TARGET_V8PLUS" { if (TARGET_V8PLUS) @@ -5210,8 +4618,8 @@ (define_insn "*muldi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (mult:DI (match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "mulx\t%1, %2, %0" [(set_attr "type" "imul")]) @@ -5220,8 +4628,8 @@ ;; XXX (define_insn "muldi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=r,h") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r,0") - (match_operand:DI 2 "arith_double_operand" "rI,rI"))) + (mult:DI (match_operand:DI 1 "arith_operand" "%r,0") + (match_operand:DI 2 "arith_operand" "rI,rI"))) (clobber (match_scratch:SI 3 "=&h,X")) (clobber (match_scratch:SI 4 "=&h,X"))] "TARGET_V8PLUS" @@ -5310,7 +4718,7 @@ (define_insn "const_mulsidi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=h,r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "small_int" "I,I"))) + (match_operand:DI 2 "small_int_operand" "I,I"))) (clobber (match_scratch:SI 3 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5351,7 +4759,7 @@ (define_insn "const_mulsidi3_sp32" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "I")))] + (match_operand:DI 2 "small_int_operand" "I")))] "TARGET_HARD_MUL32" { return TARGET_SPARCLET @@ -5368,7 +4776,7 @@ (define_insn "const_mulsidi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "I")))] + (match_operand:DI 2 "small_int_operand" "I")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "smul\t%1, %2, %0" [(set_attr "type" "imul")]) @@ -5408,7 +4816,7 @@ (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5425,7 +4833,7 @@ (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")) + (match_operand:SI 3 "small_int_operand" "I,I")) 4)) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" @@ -5440,8 +4848,8 @@ [(set (match_operand:SI 0 "register_operand" "=h,r") (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "small_int" "i,i")) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:DI 2 "small_int_operand" "I,I")) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5467,7 +4875,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "i")) + (match_operand:DI 2 "small_int_operand" "i")) (const_int 32))))] "TARGET_HARD_MUL32" "smul\t%1, %2, %%g0\n\trd\t%%y, %0" @@ -5545,7 +4953,7 @@ (define_insn "const_umulsidi3_sp32" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")))] + (match_operand:DI 2 "uns_small_int_operand" "")))] "TARGET_HARD_MUL32" { return TARGET_SPARCLET @@ -5562,7 +4970,7 @@ (define_insn "const_umulsidi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")))] + (match_operand:DI 2 "uns_small_int_operand" "")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "umul\t%1, %s2, %0" [(set_attr "type" "imul")]) @@ -5571,7 +4979,7 @@ (define_insn "const_umulsidi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=h,r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "uns_small_int" ""))) + (match_operand:DI 2 "uns_small_int_operand" ""))) (clobber (match_scratch:SI 3 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5615,7 +5023,7 @@ (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (zero_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5629,8 +5037,8 @@ [(set (match_operand:SI 0 "register_operand" "=h,r") (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "uns_small_int" "")) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:DI 2 "uns_small_int_operand" "")) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5656,15 +5064,15 @@ [(set (match_operand:SI 0 "register_operand" "=r") (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")) + (match_operand:DI 2 "uns_small_int_operand" "")) (const_int 32))))] "TARGET_HARD_MUL32" "umul\t%1, %s2, %%g0\n\trd\t%%y, %0" [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The v8 architecture specifies that there must be 3 instructions between -;; a y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be 3 instructions between +;; a Y register write and a use of it for correct results. (define_expand "divsi3" [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") @@ -5720,7 +5128,7 @@ (define_insn "divdi3" [(set (match_operand:DI 0 "register_operand" "=r") (div:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "sdivx\t%1, %2, %0" [(set_attr "type" "idiv")]) @@ -5748,17 +5156,19 @@ ;; XXX (define_expand "udivsi3" [(set (match_operand:SI 0 "register_operand" "") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "input_operand" "")))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") +;; The V8 architecture specifies that there must be 3 instructions between +;; a Y register write and a use of it for correct results. + (define_insn "udivsi3_sp32" [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "r,r,m") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS) + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); @@ -5777,7 +5187,7 @@ (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r") (match_operand:SI 2 "input_operand" "rI")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "wr\t%%g0, 0, %%y\n\tudiv\t%1, %2, %0" @@ -5787,7 +5197,7 @@ (define_insn "udivdi3" [(set (match_operand:DI 0 "register_operand" "=r") (udiv:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "udivx\t%1, %2, %0" [(set_attr "type" "idiv")]) @@ -5844,103 +5254,73 @@ "TARGET_SPARCLET" "umacd\t%1, %2, %L0" [(set_attr "type" "imul")]) - -;;- Boolean instructions + + +;; Boolean instructions. + ;; We define DImode `and' so with DImode `not' we can get ;; DImode `andn'. Other combinations are possible. -(define_expand "anddi3" - [(set (match_operand:DI 0 "register_operand" "") - (and:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] +(define_mode_macro V64I [DI V2SI V4HI V8QI]) +(define_mode_macro V32I [SI V2HI V4QI]) + +(define_expand "and3" + [(set (match_operand:V64I 0 "register_operand" "") + (and:V64I (match_operand:V64I 1 "arith_double_operand" "") + (match_operand:V64I 2 "arith_double_operand" "")))] "" "") -(define_insn "*anddi3_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (and:DI (match_operand:DI 1 "arith_double_operand" "%r,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*and3_sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (and:V64I (match_operand:V64I 1 "arith_double_operand" "%r,b") + (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] "! TARGET_ARCH64" "@ # fand\t%1, %2, %0" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*anddi3_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (and:DI (match_operand:DI 1 "arith_double_operand" "%r,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*and3_sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (and:V64I (match_operand:V64I 1 "arith_operand" "%r,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ and\t%1, %2, %0 fand\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "andsi3" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (and:SI (match_operand:SI 1 "arith_operand" "%r,d") - (match_operand:SI 2 "arith_operand" "rI,d")))] +(define_insn "and3" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (and:V32I (match_operand:V32I 1 "arith_operand" "%r,d") + (match_operand:V32I 2 "arith_operand" "rI,d")))] "" "@ and\t%1, %2, %0 fands\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) (define_split [(set (match_operand:SI 0 "register_operand" "") (and:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (and:SI (not:SI (match_dup 3)) (match_dup 1)))] { operands[4] = GEN_INT (~INTVAL (operands[2])); }) -;; Split DImode logical operations requiring two instructions. -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (match_operator:DI 1 "cc_arithop" ; AND, IOR, XOR - [(match_operand:DI 2 "register_operand" "") - (match_operand:DI 3 "arith_double_operand" "")]))] - "! TARGET_ARCH64 - && reload_completed - && ((GET_CODE (operands[0]) == REG - && REGNO (operands[0]) < 32) - || (GET_CODE (operands[0]) == SUBREG - && GET_CODE (SUBREG_REG (operands[0])) == REG - && REGNO (SUBREG_REG (operands[0])) < 32))" - [(set (match_dup 4) (match_op_dup:SI 1 [(match_dup 6) (match_dup 8)])) - (set (match_dup 5) (match_op_dup:SI 1 [(match_dup 7) (match_dup 9)]))] -{ - operands[4] = gen_highpart (SImode, operands[0]); - operands[5] = gen_lowpart (SImode, operands[0]); - operands[6] = gen_highpart (SImode, operands[2]); - operands[7] = gen_lowpart (SImode, operands[2]); -#if HOST_BITS_PER_WIDE_INT == 32 - if (GET_CODE (operands[3]) == CONST_INT) - { - if (INTVAL (operands[3]) < 0) - operands[8] = constm1_rtx; - else - operands[8] = const0_rtx; - } - else -#endif - operands[8] = gen_highpart_mode (SImode, DImode, operands[3]); - operands[9] = gen_lowpart (SImode, operands[3]); -}) - -(define_insn_and_split "*and_not_di_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (and:DI (not:DI (match_operand:DI 1 "register_operand" "r,b")) - (match_operand:DI 2 "register_operand" "r,b")))] +(define_insn_and_split "*and_not__sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (and:V64I (not:V64I (match_operand:V64I 1 "register_operand" "%r,b")) + (match_operand:V64I 2 "register_operand" "r,b")))] "! TARGET_ARCH64" "@ # @@ -5961,87 +5341,87 @@ operands[8] = gen_lowpart (SImode, operands[2]);" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*and_not_di_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (and:DI (not:DI (match_operand:DI 1 "register_operand" "r,b")) - (match_operand:DI 2 "register_operand" "r,b")))] +(define_insn "*and_not__sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (and:V64I (not:V64I (match_operand:V64I 1 "register_operand" "%r,b")) + (match_operand:V64I 2 "register_operand" "r,b")))] "TARGET_ARCH64" "@ andn\t%2, %1, %0 fandnot1\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*and_not_si" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (and:SI (not:SI (match_operand:SI 1 "register_operand" "r,d")) - (match_operand:SI 2 "register_operand" "r,d")))] +(define_insn "*and_not_" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (and:V32I (not:V32I (match_operand:V32I 1 "register_operand" "%r,d")) + (match_operand:V32I 2 "register_operand" "r,d")))] "" "@ andn\t%2, %1, %0 fandnot1s\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) -(define_expand "iordi3" - [(set (match_operand:DI 0 "register_operand" "") - (ior:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] +(define_expand "ior3" + [(set (match_operand:V64I 0 "register_operand" "") + (ior:V64I (match_operand:V64I 1 "arith_double_operand" "") + (match_operand:V64I 2 "arith_double_operand" "")))] "" "") -(define_insn "*iordi3_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (ior:DI (match_operand:DI 1 "arith_double_operand" "%r,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*ior3_sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (ior:V64I (match_operand:V64I 1 "arith_double_operand" "%r,b") + (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] "! TARGET_ARCH64" "@ # for\t%1, %2, %0" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*iordi3_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (ior:DI (match_operand:DI 1 "arith_double_operand" "%r,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*ior3_sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (ior:V64I (match_operand:V64I 1 "arith_operand" "%r,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ or\t%1, %2, %0 for\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "iorsi3" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (ior:SI (match_operand:SI 1 "arith_operand" "%r,d") - (match_operand:SI 2 "arith_operand" "rI,d")))] +(define_insn "ior3" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (ior:V32I (match_operand:V32I 1 "arith_operand" "%r,d") + (match_operand:V32I 2 "arith_operand" "rI,d")))] "" "@ or\t%1, %2, %0 fors\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) (define_split [(set (match_operand:SI 0 "register_operand" "") (ior:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (ior:SI (not:SI (match_dup 3)) (match_dup 1)))] { operands[4] = GEN_INT (~INTVAL (operands[2])); }) -(define_insn_and_split "*or_not_di_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (ior:DI (not:DI (match_operand:DI 1 "register_operand" "r,b")) - (match_operand:DI 2 "register_operand" "r,b")))] +(define_insn_and_split "*or_not__sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (ior:V64I (not:V64I (match_operand:V64I 1 "register_operand" "r,b")) + (match_operand:V64I 2 "register_operand" "r,b")))] "! TARGET_ARCH64" "@ # @@ -6062,85 +5442,77 @@ operands[8] = gen_lowpart (SImode, operands[2]);" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*or_not_di_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (ior:DI (not:DI (match_operand:DI 1 "register_operand" "r,b")) - (match_operand:DI 2 "register_operand" "r,b")))] +(define_insn "*or_not__sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (ior:V64I (not:V64I (match_operand:V64I 1 "register_operand" "r,b")) + (match_operand:V64I 2 "register_operand" "r,b")))] "TARGET_ARCH64" "@ orn\t%2, %1, %0 fornot1\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*or_not_si" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (ior:SI (not:SI (match_operand:SI 1 "register_operand" "r,d")) - (match_operand:SI 2 "register_operand" "r,d")))] +(define_insn "*or_not_" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (ior:V32I (not:V32I (match_operand:V32I 1 "register_operand" "r,d")) + (match_operand:V32I 2 "register_operand" "r,d")))] "" "@ orn\t%2, %1, %0 fornot1s\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) -(define_expand "xordi3" - [(set (match_operand:DI 0 "register_operand" "") - (xor:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" "")))] +(define_expand "xor3" + [(set (match_operand:V64I 0 "register_operand" "") + (xor:V64I (match_operand:V64I 1 "arith_double_operand" "") + (match_operand:V64I 2 "arith_double_operand" "")))] "" "") -(define_insn "*xordi3_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (xor:DI (match_operand:DI 1 "arith_double_operand" "%r,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*xor3_sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (xor:V64I (match_operand:V64I 1 "arith_double_operand" "%r,b") + (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] "! TARGET_ARCH64" "@ # fxor\t%1, %2, %0" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*xordi3_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (xor:DI (match_operand:DI 1 "arith_double_operand" "%rJ,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b")))] +(define_insn "*xor3_sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (xor:V64I (match_operand:V64I 1 "arith_operand" "%rJ,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ xor\t%r1, %2, %0 fxor\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*xordi3_sp64_dbl" - [(set (match_operand:DI 0 "register_operand" "=r") - (xor:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "const64_operand" "")))] - "(TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64)" - "xor\t%1, %2, %0") - -(define_insn "xorsi3" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (xor:SI (match_operand:SI 1 "arith_operand" "%rJ,d") - (match_operand:SI 2 "arith_operand" "rI,d")))] +(define_insn "xor3" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (xor:V32I (match_operand:V32I 1 "arith_operand" "%rJ,d") + (match_operand:V32I 2 "arith_operand" "rI,d")))] "" "@ xor\t%r1, %2, %0 fxors\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) (define_split [(set (match_operand:SI 0 "register_operand" "") (xor:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (not:SI (xor:SI (match_dup 3) (match_dup 1))))] { @@ -6150,23 +5522,55 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (not:SI (xor:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" "")))) + (match_operand:SI 2 "const_compl_high_operand" "")))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (xor:SI (match_dup 3) (match_dup 1)))] { operands[4] = GEN_INT (~INTVAL (operands[2])); }) +;; Split DImode logical operations requiring two instructions. +(define_split + [(set (match_operand:V64I 0 "register_operand" "") + (match_operator:V64I 1 "cc_arith_operator" ; AND, IOR, XOR + [(match_operand:V64I 2 "register_operand" "") + (match_operand:V64I 3 "arith_double_operand" "")]))] + "! TARGET_ARCH64 + && reload_completed + && ((GET_CODE (operands[0]) == REG + && REGNO (operands[0]) < 32) + || (GET_CODE (operands[0]) == SUBREG + && GET_CODE (SUBREG_REG (operands[0])) == REG + && REGNO (SUBREG_REG (operands[0])) < 32))" + [(set (match_dup 4) (match_op_dup:SI 1 [(match_dup 6) (match_dup 8)])) + (set (match_dup 5) (match_op_dup:SI 1 [(match_dup 7) (match_dup 9)]))] +{ + operands[4] = gen_highpart (SImode, operands[0]); + operands[5] = gen_lowpart (SImode, operands[0]); + operands[6] = gen_highpart (SImode, operands[2]); + operands[7] = gen_lowpart (SImode, operands[2]); +#if HOST_BITS_PER_WIDE_INT == 32 + if (GET_CODE (operands[3]) == CONST_INT && mode == DImode) + { + if (INTVAL (operands[3]) < 0) + operands[8] = constm1_rtx; + else + operands[8] = const0_rtx; + } + else +#endif + operands[8] = gen_highpart_mode (SImode, mode, operands[3]); + operands[9] = gen_lowpart (SImode, operands[3]); +}) + ;; xnor patterns. Note that (a ^ ~b) == (~a ^ b) == ~(a ^ b). ;; Combine now canonicalizes to the rightmost expression. -(define_insn_and_split "*xor_not_di_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (not:DI (xor:DI (match_operand:DI 1 "register_operand" "r,b") - (match_operand:DI 2 "register_operand" "r,b"))))] +(define_insn_and_split "*xor_not__sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (not:V64I (xor:V64I (match_operand:V64I 1 "register_operand" "r,b") + (match_operand:V64I 2 "register_operand" "r,b"))))] "! TARGET_ARCH64" "@ # @@ -6187,28 +5591,29 @@ operands[8] = gen_lowpart (SImode, operands[2]);" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*xor_not_di_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,b") - (match_operand:DI 2 "arith_double_operand" "rHI,b"))))] +(define_insn "*xor_not__sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (not:V64I (xor:V64I (match_operand:V64I 1 "register_or_zero_operand" "rJ,b") + (match_operand:V64I 2 "arith_operand" "rI,b"))))] "TARGET_ARCH64" "@ xnor\t%r1, %2, %0 fxnor\t%1, %2, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*xor_not_si" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (not:SI (xor:SI (match_operand:SI 1 "reg_or_0_operand" "rJ,d") - (match_operand:SI 2 "arith_operand" "rI,d"))))] +(define_insn "*xor_not_" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (not:V32I (xor:V32I (match_operand:V32I 1 "register_or_zero_operand" "rJ,d") + (match_operand:V32I 2 "arith_operand" "rI,d"))))] "" "@ xnor\t%r1, %2, %0 fxnors\t%1, %2, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) ;; These correspond to the above in the case where we also (or only) ;; want to set the condition code. @@ -6216,7 +5621,7 @@ (define_insn "*cmp_cc_arith_op" [(set (reg:CC 100) (compare:CC - (match_operator:SI 2 "cc_arithop" + (match_operator:SI 2 "cc_arith_operator" [(match_operand:SI 0 "arith_operand" "%r") (match_operand:SI 1 "arith_operand" "rI")]) (const_int 0)))] @@ -6227,9 +5632,9 @@ (define_insn "*cmp_ccx_arith_op" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 2 "cc_arithop" - [(match_operand:DI 0 "arith_double_operand" "%r") - (match_operand:DI 1 "arith_double_operand" "rHI")]) + (match_operator:DI 2 "cc_arith_operator" + [(match_operand:DI 0 "arith_operand" "%r") + (match_operand:DI 1 "arith_operand" "rI")]) (const_int 0)))] "TARGET_ARCH64" "%A2cc\t%0, %1, %%g0" @@ -6238,12 +5643,12 @@ (define_insn "*cmp_cc_arith_op_set" [(set (reg:CC 100) (compare:CC - (match_operator:SI 3 "cc_arithop" + (match_operator:SI 3 "cc_arith_operator" [(match_operand:SI 1 "arith_operand" "%r") (match_operand:SI 2 "arith_operand" "rI")]) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") - (match_operator:SI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))] + (match_operator:SI 4 "cc_arith_operator" [(match_dup 1) (match_dup 2)]))] "GET_CODE (operands[3]) == GET_CODE (operands[4])" "%A3cc\t%1, %2, %0" [(set_attr "type" "compare")]) @@ -6251,12 +5656,12 @@ (define_insn "*cmp_ccx_arith_op_set" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 3 "cc_arithop" - [(match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")]) + (match_operator:DI 3 "cc_arith_operator" + [(match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")]) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") - (match_operator:DI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))] + (match_operator:DI 4 "cc_arith_operator" [(match_dup 1) (match_dup 2)]))] "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])" "%A3cc\t%1, %2, %0" [(set_attr "type" "compare")]) @@ -6264,7 +5669,7 @@ (define_insn "*cmp_cc_xor_not" [(set (reg:CC 100) (compare:CC - (not:SI (xor:SI (match_operand:SI 0 "reg_or_0_operand" "%rJ") + (not:SI (xor:SI (match_operand:SI 0 "register_or_zero_operand" "%rJ") (match_operand:SI 1 "arith_operand" "rI"))) (const_int 0)))] "" @@ -6274,8 +5679,8 @@ (define_insn "*cmp_ccx_xor_not" [(set (reg:CCX 100) (compare:CCX - (not:DI (xor:DI (match_operand:DI 0 "reg_or_0_operand" "%rJ") - (match_operand:DI 1 "arith_double_operand" "rHI"))) + (not:DI (xor:DI (match_operand:DI 0 "register_or_zero_operand" "%rJ") + (match_operand:DI 1 "arith_operand" "rI"))) (const_int 0)))] "TARGET_ARCH64" "xnorcc\t%r0, %1, %%g0" @@ -6284,7 +5689,7 @@ (define_insn "*cmp_cc_xor_not_set" [(set (reg:CC 100) (compare:CC - (not:SI (xor:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") + (not:SI (xor:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ") (match_operand:SI 2 "arith_operand" "rI"))) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") @@ -6296,8 +5701,8 @@ (define_insn "*cmp_ccx_xor_not_set" [(set (reg:CCX 100) (compare:CCX - (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ") - (match_operand:DI 2 "arith_double_operand" "rHI"))) + (not:DI (xor:DI (match_operand:DI 1 "register_or_zero_operand" "%rJ") + (match_operand:DI 2 "arith_operand" "rI"))) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_dup 1) (match_dup 2))))] @@ -6308,9 +5713,9 @@ (define_insn "*cmp_cc_arith_op_not" [(set (reg:CC 100) (compare:CC - (match_operator:SI 2 "cc_arithopn" + (match_operator:SI 2 "cc_arith_not_operator" [(not:SI (match_operand:SI 0 "arith_operand" "rI")) - (match_operand:SI 1 "reg_or_0_operand" "rJ")]) + (match_operand:SI 1 "register_or_zero_operand" "rJ")]) (const_int 0)))] "" "%B2cc\t%r1, %0, %%g0" @@ -6319,9 +5724,9 @@ (define_insn "*cmp_ccx_arith_op_not" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 2 "cc_arithopn" - [(not:DI (match_operand:DI 0 "arith_double_operand" "rHI")) - (match_operand:DI 1 "reg_or_0_operand" "rJ")]) + (match_operator:DI 2 "cc_arith_not_operator" + [(not:DI (match_operand:DI 0 "arith_operand" "rI")) + (match_operand:DI 1 "register_or_zero_operand" "rJ")]) (const_int 0)))] "TARGET_ARCH64" "%B2cc\t%r1, %0, %%g0" @@ -6330,12 +5735,12 @@ (define_insn "*cmp_cc_arith_op_not_set" [(set (reg:CC 100) (compare:CC - (match_operator:SI 3 "cc_arithopn" + (match_operator:SI 3 "cc_arith_not_operator" [(not:SI (match_operand:SI 1 "arith_operand" "rI")) - (match_operand:SI 2 "reg_or_0_operand" "rJ")]) + (match_operand:SI 2 "register_or_zero_operand" "rJ")]) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") - (match_operator:SI 4 "cc_arithopn" + (match_operator:SI 4 "cc_arith_not_operator" [(not:SI (match_dup 1)) (match_dup 2)]))] "GET_CODE (operands[3]) == GET_CODE (operands[4])" "%B3cc\t%r2, %1, %0" @@ -6344,12 +5749,12 @@ (define_insn "*cmp_ccx_arith_op_not_set" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 3 "cc_arithopn" - [(not:DI (match_operand:DI 1 "arith_double_operand" "rHI")) - (match_operand:DI 2 "reg_or_0_operand" "rJ")]) + (match_operator:DI 3 "cc_arith_not_operator" + [(not:DI (match_operand:DI 1 "arith_operand" "rI")) + (match_operand:DI 2 "register_or_zero_operand" "rJ")]) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") - (match_operator:DI 4 "cc_arithopn" + (match_operator:DI 4 "cc_arith_not_operator" [(not:DI (match_dup 1)) (match_dup 2)]))] "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])" "%B3cc\t%r2, %1, %0" @@ -6418,7 +5823,7 @@ (define_insn "*cmp_ccx_neg" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "subcc\t%%g0, %0, %%g0" @@ -6436,7 +5841,7 @@ (define_insn "*cmp_ccx_set_neg" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (neg:DI (match_operand:DI 1 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (neg:DI (match_operand:DI 1 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (neg:DI (match_dup 1)))] @@ -6446,15 +5851,15 @@ ;; We cannot use the "not" pseudo insn because the Sun assembler ;; does not know how to make it work for constants. -(define_expand "one_cmpldi2" - [(set (match_operand:DI 0 "register_operand" "") - (not:DI (match_operand:DI 1 "register_operand" "")))] +(define_expand "one_cmpl2" + [(set (match_operand:V64I 0 "register_operand" "") + (not:V64I (match_operand:V64I 1 "register_operand" "")))] "" "") -(define_insn_and_split "*one_cmpldi2_sp32" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (not:DI (match_operand:DI 1 "register_operand" "r,b")))] +(define_insn_and_split "*one_cmpl2_sp32" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (not:V64I (match_operand:V64I 1 "register_operand" "r,b")))] "! TARGET_ARCH64" "@ # @@ -6473,26 +5878,27 @@ operands[5] = gen_lowpart (SImode, operands[1]);" [(set_attr "type" "*,fga") (set_attr "length" "2,*") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "*one_cmpldi2_sp64" - [(set (match_operand:DI 0 "register_operand" "=r,b") - (not:DI (match_operand:DI 1 "arith_double_operand" "rHI,b")))] +(define_insn "*one_cmpl2_sp64" + [(set (match_operand:V64I 0 "register_operand" "=r,b") + (not:V64I (match_operand:V64I 1 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ xnor\t%%g0, %1, %0 fnot1\t%1, %0" [(set_attr "type" "*,fga") - (set_attr "fptype" "double")]) + (set_attr "fptype" "*,double")]) -(define_insn "one_cmplsi2" - [(set (match_operand:SI 0 "register_operand" "=r,d") - (not:SI (match_operand:SI 1 "arith_operand" "rI,d")))] +(define_insn "one_cmpl2" + [(set (match_operand:V32I 0 "register_operand" "=r,d") + (not:V32I (match_operand:V32I 1 "arith_operand" "rI,d")))] "" "@ xnor\t%%g0, %1, %0 fnot1s\t%1, %0" - [(set_attr "type" "*,fga")]) + [(set_attr "type" "*,fga") + (set_attr "fptype" "*,single")]) (define_insn "*cmp_cc_not" [(set (reg:CC 100) @@ -6504,7 +5910,7 @@ (define_insn "*cmp_ccx_not" [(set (reg:CCX 100) - (compare:CCX (not:DI (match_operand:DI 0 "arith_double_operand" "rHI")) + (compare:CCX (not:DI (match_operand:DI 0 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "xnorcc\t%%g0, %0, %%g0" @@ -6522,7 +5928,7 @@ (define_insn "*cmp_ccx_set_not" [(set (reg:CCX 100) - (compare:CCX (not:DI (match_operand:DI 1 "arith_double_operand" "rHI")) + (compare:CCX (not:DI (match_operand:DI 1 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_dup 1)))] @@ -6549,7 +5955,8 @@ "TARGET_ARCH64" "orcc\t%1, 0, %0" [(set_attr "type" "compare")]) - + + ;; Floating point arithmetic instructions. (define_expand "addtf3" @@ -6909,8 +6316,9 @@ "TARGET_FPU" "fsqrts\t%1, %0" [(set_attr "type" "fpsqrts")]) - -;;- arithmetic shift instructions + + +;; Arithmetic shift instructions. (define_insn "ashlsi3" [(set (match_operand:SI 0 "register_operand" "=r") @@ -6918,14 +6326,12 @@ (match_operand:SI 2 "arith_operand" "rI")))] "" { - if (operands[2] == const1_rtx) - return "add\t%1, %1, %0"; if (GET_CODE (operands[2]) == CONST_INT) operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); return "sll\t%1, %2, %0"; } [(set (attr "type") - (if_then_else (match_operand 2 "const1_operand" "") + (if_then_else (match_operand 2 "const_one_operand" "") (const_string "ialu") (const_string "shift")))]) (define_expand "ashldi3" @@ -6949,14 +6355,12 @@ (match_operand:SI 2 "arith_operand" "rI")))] "TARGET_ARCH64" { - if (operands[2] == const1_rtx) - return "add\t%1, %1, %0"; if (GET_CODE (operands[2]) == CONST_INT) operands[2] = GEN_INT (INTVAL (operands[2]) & 0x3f); return "sllx\t%1, %2, %0"; } [(set (attr "type") - (if_then_else (match_operand 2 "const1_operand" "") + (if_then_else (match_operand 2 "const_one_operand" "") (const_string "ialu") (const_string "shift")))]) ;; XXX UGH! @@ -6966,7 +6370,7 @@ (match_operand:SI 2 "arith_operand" "rI,rI,rI"))) (clobber (match_scratch:SI 3 "=X,X,&h"))] "TARGET_V8PLUS" - { return sparc_v8plus_shift (operands, insn, "sllx"); } + "* return output_v8plus_shift (operands, insn, \"sllx\");" [(set_attr "type" "multi") (set_attr "length" "5,5,6")]) @@ -7033,17 +6437,10 @@ [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0) (const_int 32)) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) < 64) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && CONST_DOUBLE_LOW (operands[2]) >= 32 - && CONST_DOUBLE_LOW (operands[2]) < 64))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) < 64" { operands[2] = GEN_INT (INTVAL (operands[2]) - 32); - return "sra\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7083,7 +6480,7 @@ (match_operand:SI 2 "arith_operand" "rI,rI,rI"))) (clobber (match_scratch:SI 3 "=X,X,&h"))] "TARGET_V8PLUS" - { return sparc_v8plus_shift (operands, insn, "srax"); } + "* return output_v8plus_shift (operands, insn, \"srax\");" [(set_attr "type" "multi") (set_attr "length" "5,5,6")]) @@ -7106,14 +6503,8 @@ [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (subreg:DI (lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "arith_operand" "r")) 0) - (match_operand 3 "" "")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[3]) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (operands[3]) == 0 - && CONST_DOUBLE_LOW (operands[3]) == 0xffffffff) - || (HOST_BITS_PER_WIDE_INT >= 64 - && GET_CODE (operands[3]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) == 0xffffffff))" + (match_operand 3 "const_int_operand" "")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) == 0xffffffff" "srl\t%1, %2, %0" [(set_attr "type" "shift")]) @@ -7123,17 +6514,11 @@ (define_insn "*lshrsi3_extend2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extract:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0) - (match_operand 2 "small_int_or_double" "n") + (match_operand 2 "small_int_operand" "I") (const_int 32)))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (operands[2]) == 0 - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (32 - INTVAL (operands[2])); - return "srl\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7172,7 +6557,7 @@ (match_operand:SI 2 "arith_operand" "rI,rI,rI"))) (clobber (match_scratch:SI 3 "=X,X,&h"))] "TARGET_V8PLUS" - { return sparc_v8plus_shift (operands, insn, "srlx"); } + "* return output_v8plus_shift (operands, insn, \"srlx\");" [(set_attr "type" "multi") (set_attr "length" "5,5,6")]) @@ -7180,16 +6565,10 @@ [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (subreg:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "r") (const_int 32)) 4) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (INTVAL (operands[2]) + 32); - return "srax\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7198,16 +6577,10 @@ [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (subreg:SI (ashiftrt:DI (match_operand:DI 1 "register_operand" "r") (const_int 32)) 4) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (INTVAL (operands[2]) + 32); - return "srlx\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7215,10 +6588,9 @@ (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (subreg:SI (ashiftrt:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:SI 2 "small_int_or_double" "n")) 4) - (match_operand:SI 3 "small_int_or_double" "n")))] + (match_operand:SI 2 "small_int_operand" "I")) 4) + (match_operand:SI 3 "small_int_operand" "I")))] "TARGET_ARCH64 - && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 32 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) < 32 && (unsigned HOST_WIDE_INT) (INTVAL (operands[2]) + INTVAL (operands[3])) < 64" @@ -7232,10 +6604,9 @@ (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (subreg:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:SI 2 "small_int_or_double" "n")) 4) - (match_operand:SI 3 "small_int_or_double" "n")))] + (match_operand:SI 2 "small_int_operand" "I")) 4) + (match_operand:SI 3 "small_int_operand" "I")))] "TARGET_ARCH64 - && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 32 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) < 32 && (unsigned HOST_WIDE_INT) (INTVAL (operands[2]) + INTVAL (operands[3])) < 64" @@ -7245,8 +6616,10 @@ return "srlx\t%1, %2, %0"; } [(set_attr "type" "shift")]) - -;; Unconditional and other jump instructions + + +;; Unconditional and other jump instructions. + (define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" @@ -7258,8 +6631,7 @@ (use (label_ref (match_operand 1 "" "")))])] "" { - if (GET_MODE (operands[0]) != CASE_VECTOR_MODE) - abort (); + gcc_assert (GET_MODE (operands[0]) == CASE_VECTOR_MODE); /* In pic mode, our address differences are against the base of the table. Add that base value back in; CSE ought to be able to combine @@ -7290,16 +6662,9 @@ "jmp\t%a0%#" [(set_attr "type" "uncond_branch")]) -;; This pattern recognizes the "instruction" that appears in -;; a function call that wants a structure value, -;; to inform the called function if compiled with Sun CC. -;(define_insn "*unimp_insn" -; [(match_operand:SI 0 "immediate_operand" "")] -; "GET_CODE (operands[0]) == CONST_INT && INTVAL (operands[0]) > 0" -; "unimp\t%0" -; [(set_attr "type" "marker")]) -;;- jump to subroutine +;; Jump to subroutine instructions. + (define_expand "call" ;; Note that this expression is not used for generating RTL. ;; All the RTL is generated explicitly below. @@ -7309,10 +6674,11 @@ ;; operands[3] is struct_value_size_rtx. "" { - rtx fn_rtx, nregs_rtx; + rtx fn_rtx; - if (GET_MODE (operands[0]) != FUNCTION_MODE) - abort (); + gcc_assert (GET_MODE (operands[0]) == FUNCTION_MODE); + + gcc_assert (GET_CODE (operands[3]) == CONST_INT); if (GET_CODE (XEXP (operands[0], 0)) == LABEL_REF) { @@ -7323,6 +6689,7 @@ call-clobbered registers? We lose this if it is a JUMP_INSN. Why cannot we have delay slots filled if it were a CALL? */ + /* We accept negative sizes for untyped calls. */ if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) emit_jump_insn (gen_rtx_PARALLEL @@ -7343,42 +6710,22 @@ fn_rtx = operands[0]; - /* Count the number of parameter registers being used by this call. - if that argument is NULL, it means we are using them all, which - means 6 on the sparc. */ -#if 0 - if (operands[2]) - nregs_rtx = GEN_INT (REGNO (operands[2]) - 8); - else - nregs_rtx = GEN_INT (6); -#else - nregs_rtx = const0_rtx; -#endif - + /* We accept negative sizes for untyped calls. */ if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0) emit_call_insn (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), + gen_rtvec (3, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx), operands[3], gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); else emit_call_insn (gen_rtx_PARALLEL (VOIDmode, - gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx), + gen_rtvec (2, gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx), gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))))); finish_call: -#if 0 - /* If this call wants a structure value, - emit an unimp insn to let the called function know about this. */ - if (! TARGET_ARCH64 && INTVAL (operands[3]) > 0) - { - rtx insn = emit_insn (operands[3]); - SCHED_GROUP_P (insn) = 1; - } -#endif DONE; }) @@ -7430,8 +6777,11 @@ (match_operand 2 "immediate_operand" "") (clobber (reg:SI 15))] ;;- Do not use operand 1 for most machines. - "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0" - "call\t%a0, %1\n\tnop\n\tunimp\t%2" + "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xfff); + return "call\t%a0, %1\n\t nop\n\tunimp\t%2"; +} [(set_attr "type" "call_no_delay_slot") (set_attr "length" "3")]) @@ -7443,8 +6793,11 @@ (match_operand 2 "immediate_operand" "") (clobber (reg:SI 15))] ;;- Do not use operand 1 for most machines. - "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 0" - "call\t%a0, %1\n\tnop\n\tunimp\t%2" + "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0" +{ + operands[2] = GEN_INT (INTVAL (operands[2]) & 0xfff); + return "call\t%a0, %1\n\t nop\n\tunimp\t%2"; +} [(set_attr "type" "call_no_delay_slot") (set_attr "length" "3")]) @@ -7457,11 +6810,12 @@ (clobber (reg:SI 15))] ;;- Do not use operand 1 for most machines. "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" - "call\t%a0, %1\n\tnop\n\tnop" + "call\t%a0, %1\n\t nop\n\tnop" [(set_attr "type" "call_no_delay_slot") (set_attr "length" "3")]) -;; This is a call that wants a structure value. +;; This is a call that may want a structure value. This is used for +;; untyped_calls. (define_insn "*call_symbolic_untyped_struct_value_sp32" [(call (mem:SI (match_operand:SI 0 "symbolic_operand" "s")) (match_operand 1 "" "")) @@ -7469,7 +6823,7 @@ (clobber (reg:SI 15))] ;;- Do not use operand 1 for most machines. "! TARGET_ARCH64 && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0" - "call\t%a0, %1\n\tnop\n\tnop" + "call\t%a0, %1\n\t nop\n\tnop" [(set_attr "type" "call_no_delay_slot") (set_attr "length" "3")]) @@ -7483,26 +6837,16 @@ ;; operand 3 is next_arg_register "" { - rtx fn_rtx, nregs_rtx; + rtx fn_rtx; rtvec vec; - if (GET_MODE (operands[1]) != FUNCTION_MODE) - abort (); + gcc_assert (GET_MODE (operands[1]) == FUNCTION_MODE); fn_rtx = operands[1]; -#if 0 - if (operands[3]) - nregs_rtx = GEN_INT (REGNO (operands[3]) - 8); - else - nregs_rtx = GEN_INT (6); -#else - nregs_rtx = const0_rtx; -#endif - vec = gen_rtvec (2, gen_rtx_SET (VOIDmode, operands[0], - gen_rtx_CALL (VOIDmode, fn_rtx, nregs_rtx)), + gen_rtx_CALL (VOIDmode, fn_rtx, const0_rtx)), gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15))); emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec)); @@ -7553,21 +6897,22 @@ (define_expand "untyped_call" [(parallel [(call (match_operand 0 "" "") (const_int 0)) - (match_operand 1 "" "") + (match_operand:BLK 1 "memory_operand" "") (match_operand 2 "" "")])] "" { - int i; + rtx valreg1 = gen_rtx_REG (DImode, 8); + rtx valreg2 = gen_rtx_REG (TARGET_ARCH64 ? TFmode : DFmode, 32); + rtx result = operands[1]; /* Pass constm1 to indicate that it may expect a structure value, but we don't know what size it is. */ emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, constm1_rtx)); - for (i = 0; i < XVECLEN (operands[2], 0); i++) - { - rtx set = XVECEXP (operands[2], 0, i); - emit_move_insn (SET_DEST (set), SET_SRC (set)); - } + /* Save the function value registers. */ + emit_move_insn (adjust_address (result, DImode, 0), valreg1); + emit_move_insn (adjust_address (result, TARGET_ARCH64 ? TFmode : DFmode, 8), + valreg2); /* The optimizer does not know that the call sets the function value registers we stored in the result block. We avoid problems by @@ -7578,7 +6923,8 @@ DONE; }) -;;- tail calls +;; Tail call instructions. + (define_expand "sibcall" [(parallel [(call (match_operand 0 "call_operand" "") (const_int 0)) (return)])] @@ -7626,10 +6972,77 @@ "* return output_sibcall(insn, operands[1]);" [(set_attr "type" "sibcall")]) -(define_expand "sibcall_epilogue" + +;; Special instructions. + +(define_expand "prologue" [(const_int 0)] "" - "DONE;") +{ + sparc_expand_prologue (); + DONE; +}) + +;; The "save register window" insn is modelled as follows so that the DWARF-2 +;; backend automatically emits the required call frame debugging information +;; while it is parsing it. Therefore, the pattern should not be modified +;; without first studying the impact of the changes on the debug info. +;; [(set (%fp) (%sp)) +;; (set (%sp) (unspec_volatile [(%sp) (-frame_size)] UNSPECV_SAVEW)) +;; (set (%i7) (%o7))] + +(define_insn "save_register_window" + [(set (reg:P 30) (reg:P 14)) + (set (reg:P 14) (unspec_volatile:P [(reg:P 14) + (match_operand:P 0 "arith_operand" "rI")] UNSPECV_SAVEW)) + (set (reg:P 31) (reg:P 15))] + "" + "save\t%%sp, %0, %%sp" + [(set_attr "type" "savew")]) + +(define_expand "epilogue" + [(return)] + "" +{ + sparc_expand_epilogue (); +}) + +(define_expand "sibcall_epilogue" + [(return)] + "" +{ + sparc_expand_epilogue (); + DONE; +}) + +(define_expand "return" + [(return)] + "sparc_can_use_return_insn_p ()" + "") + +(define_insn "*return_internal" + [(return)] + "" + "* return output_return (insn);" + [(set_attr "type" "return") + (set (attr "length") + (cond [(eq_attr "leaf_function" "true") + (if_then_else (eq_attr "empty_delay_slot" "true") + (const_int 2) + (const_int 1)) + (eq_attr "calls_eh_return" "true") + (if_then_else (eq_attr "delayed_branch" "true") + (if_then_else (eq_attr "isa" "v9") + (const_int 2) + (const_int 3)) + (if_then_else (eq_attr "isa" "v9") + (const_int 3) + (const_int 4))) + (eq_attr "empty_delay_slot" "true") + (if_then_else (eq_attr "delayed_branch" "true") + (const_int 2) + (const_int 3)) + ] (const_int 1)))]) ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and ;; all of memory. This blocks insns from being moved across this point. @@ -7681,16 +7094,29 @@ DONE; }) -;; This is a bit of a hack. We're incrementing a fixed register (%i7), -;; and parts of the compiler don't want to believe that the add is needed. +;; Adjust the return address conditionally. If the value of op1 is equal +;; to all zero then adjust the return address i.e. op0 = op0 + 4. +;; This is technically *half* the check required by the 32-bit SPARC +;; psABI. This check only ensures that an "unimp" insn was written by +;; the caller, but doesn't check to see if the expected size matches +;; (this is encoded in the 12 lower bits). This check is obsolete and +;; only used by the above code "untyped_return". (define_insn "update_return" [(unspec:SI [(match_operand:SI 0 "register_operand" "r") (match_operand:SI 1 "register_operand" "r")] UNSPEC_UPDATE_RETURN)] "! TARGET_ARCH64" - "cmp\t%1, 0\;be,a\t.+8\;add\t%0, 4, %0" - [(set_attr "type" "multi") - (set_attr "length" "3")]) +{ + if (flag_delayed_branch) + return "cmp\t%1, 0\n\tbe,a\t.+8\n\t add\t%0, 4, %0"; + else + return "cmp\t%1, 0\n\tbne\t.+12\n\t nop\n\tadd\t%0, 4, %0"; +} + [(set (attr "type") (const_string "multi")) + (set (attr "length") + (if_then_else (eq_attr "delayed_branch" "true") + (const_int 3) + (const_int 4)))]) (define_insn "nop" [(const_int 0)] @@ -7714,7 +7140,6 @@ "jmp\t%a0%#" [(set_attr "type" "uncond_branch")]) -;; ??? Doesn't work with -mflat. (define_expand "nonlocal_goto" [(match_operand:SI 0 "general_operand" "") (match_operand:SI 1 "general_operand" "") @@ -7722,9 +7147,6 @@ (match_operand:SI 3 "" "")] "" { -#if 0 - rtx chain = operands[0]; -#endif rtx lab = operands[1]; rtx stack = operands[2]; rtx fp = operands[3]; @@ -7750,27 +7172,10 @@ and reload the appropriate value into %fp. */ emit_move_insn (hard_frame_pointer_rtx, stack); - /* USE of frame_pointer_rtx added for consistency; not clear if - really needed. */ - /*emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx));*/ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); - -#if 0 - /* Return, restoring reg window and jumping to goto handler. */ - if (TARGET_V9 && GET_CODE (chain) == CONST_INT - && ! (INTVAL (chain) & ~(HOST_WIDE_INT)0xffffffff)) - { - emit_jump_insn (gen_goto_handler_and_restore_v9 (labreg, - static_chain_rtx, - chain)); - emit_barrier (); - DONE; - } - /* Put in the static chain register the nonlocal label address. */ - emit_move_insn (static_chain_rtx, chain); -#endif - emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx)); + + /* ??? The V9-specific version was disabled in rev 1.65. */ emit_jump_insn (gen_goto_handler_and_restore (labreg)); emit_barrier (); DONE; @@ -7786,31 +7191,17 @@ (define_insn "goto_handler_and_restore" [(unspec_volatile [(match_operand 0 "register_operand" "=r")] UNSPECV_GOTO)] "GET_MODE (operands[0]) == Pmode" - "jmp\t%0+0\n\trestore" - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -;;(define_insn "goto_handler_and_restore_v9" -;; [(unspec_volatile [(match_operand:SI 0 "register_operand" "=r,r") -;; (match_operand:SI 1 "register_operand" "=r,r") -;; (match_operand:SI 2 "const_int_operand" "I,n")] UNSPECV_GOTO_V9)] -;; "TARGET_V9 && ! TARGET_ARCH64" -;; "@ -;; return\t%0+0\n\tmov\t%2, %Y1 -;; sethi\t%%hi(%2), %1\n\treturn\t%0+0\n\tor\t%Y1, %%lo(%2), %Y1" -;; [(set_attr "type" "multi") -;; (set_attr "length" "2,3")]) -;; -;;(define_insn "*goto_handler_and_restore_v9_sp64" -;; [(unspec_volatile [(match_operand:DI 0 "register_operand" "=r,r") -;; (match_operand:DI 1 "register_operand" "=r,r") -;; (match_operand:SI 2 "const_int_operand" "I,n")] UNSPECV_GOTO_V9)] -;; "TARGET_V9 && TARGET_ARCH64" -;; "@ -;; return\t%0+0\n\tmov\t%2, %Y1 -;; sethi\t%%hi(%2), %1\n\treturn\t%0+0\n\tor\t%Y1, %%lo(%2), %Y1" -;; [(set_attr "type" "multi") -;; (set_attr "length" "2,3")]) +{ + if (flag_delayed_branch) + return "jmp\t%0\n\t restore"; + else + return "mov\t%0,%%g1\n\trestore\n\tjmp\t%%g1\n\t nop"; +} + [(set (attr "type") (const_string "multi")) + (set (attr "length") + (if_then_else (eq_attr "delayed_branch" "true") + (const_int 2) + (const_int 4)))]) ;; For __builtin_setjmp we need to flush register windows iff the function ;; calls alloca as well, because otherwise the register window might be @@ -7829,7 +7220,7 @@ { if (! current_function_calls_alloca) return ""; - if (! TARGET_V9 || TARGET_FLAT) + if (! TARGET_V9) return "\tta\t3\n"; fputs ("\tflushw\n", asm_out_file); if (flag_pic) @@ -7846,10 +7237,8 @@ } [(set_attr "type" "multi") (set (attr "length") - (cond [(eq_attr "current_function_calls_alloca" "false") + (cond [(eq_attr "calls_alloca" "false") (const_int 0) - (eq_attr "flat" "true") - (const_int 1) (eq_attr "isa" "!v9") (const_int 1) (eq_attr "pic" "true") @@ -7862,25 +7251,20 @@ [(const_int 0)] "" { - if (TARGET_ARCH64) - emit_insn (gen_setjmp_64 ()); - else - emit_insn (gen_setjmp_32 ()); + rtx mem; + + mem = gen_rtx_MEM (Pmode, + plus_constant (stack_pointer_rtx, + SPARC_STACK_BIAS + 14 * UNITS_PER_WORD)); + emit_insn (gen_rtx_SET (VOIDmode, mem, frame_pointer_rtx)); + + mem = gen_rtx_MEM (Pmode, + plus_constant (stack_pointer_rtx, + SPARC_STACK_BIAS + 15 * UNITS_PER_WORD)); + emit_insn (gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (Pmode, 31))); DONE; }) -(define_expand "setjmp_32" - [(set (mem:SI (plus:SI (reg:SI 14) (const_int 56))) (match_dup 0)) - (set (mem:SI (plus:SI (reg:SI 14) (const_int 60))) (reg:SI 31))] - "" - { operands[0] = frame_pointer_rtx; }) - -(define_expand "setjmp_64" - [(set (mem:DI (plus:DI (reg:DI 14) (const_int 112))) (match_dup 0)) - (set (mem:DI (plus:DI (reg:DI 14) (const_int 120))) (reg:DI 31))] - "" - { operands[0] = frame_pointer_rtx; }) - ;; Special pattern for the FLUSH instruction. ; We do SImode and DImode versions of this to quiet down genrecog's complaints @@ -7900,8 +7284,8 @@ { return TARGET_V9 ? "flush\t%f0" : "iflush\t%f0"; } [(set_attr "type" "iflush")]) - -;; find first set. + +;; Find first set instructions. ;; The scan instruction searches from the most significant bit while ffs ;; searches from the least significant bit. The bit index and treatment of @@ -8097,165 +7481,8 @@ (compare:CCX (match_dup 1) (const_int 0)))])] "") -;; Return peepholes. These are generated by sparc_nonflat_function_epilogue -;; who then immediately calls final_scan_insn. -(define_insn "*return_qi" - [(set (match_operand:QI 0 "restore_operand" "") - (match_operand:QI 1 "arith_operand" "rI")) - (return)] - "sparc_emitting_epilogue" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %%g0, %1, %Y0"; - else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT - || IN_OR_GLOBAL_P (operands[1]))) - return "return\t%%i7+8\n\tmov\t%Y1, %Y0"; - else - return "ret\n\trestore %%g0, %1, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_hi" - [(set (match_operand:HI 0 "restore_operand" "") - (match_operand:HI 1 "arith_operand" "rI")) - (return)] - "sparc_emitting_epilogue" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %%g0, %1, %Y0"; - else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT - || IN_OR_GLOBAL_P (operands[1]))) - return "return\t%%i7+8\n\tmov\t%Y1, %Y0"; - else - return "ret\;restore %%g0, %1, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_si" - [(set (match_operand:SI 0 "restore_operand" "") - (match_operand:SI 1 "arith_operand" "rI")) - (return)] - "sparc_emitting_epilogue" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %%g0, %1, %Y0"; - else if (TARGET_V9 && (GET_CODE (operands[1]) == CONST_INT - || IN_OR_GLOBAL_P (operands[1]))) - return "return\t%%i7+8\n\tmov\t%Y1, %Y0"; - else - return "ret\;restore %%g0, %1, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_sf_no_fpu" - [(set (match_operand:SF 0 "restore_operand" "=r") - (match_operand:SF 1 "register_operand" "r")) - (return)] - "sparc_emitting_epilogue" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %%g0, %1, %Y0"; - else if (TARGET_V9 && IN_OR_GLOBAL_P (operands[1])) - return "return\t%%i7+8\n\tmov\t%Y1, %Y0"; - else - return "ret\;restore %%g0, %1, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_df_no_fpu" - [(set (match_operand:DF 0 "restore_operand" "=r") - (match_operand:DF 1 "register_operand" "r")) - (return)] - "sparc_emitting_epilogue && TARGET_ARCH64" -{ - if (IN_OR_GLOBAL_P (operands[1])) - return "return\t%%i7+8\n\tmov\t%Y1, %Y0"; - else - return "ret\;restore %%g0, %1, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_addsi" - [(set (match_operand:SI 0 "restore_operand" "") - (plus:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "arith_operand" "rI"))) - (return)] - "sparc_emitting_epilogue" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %r1, %2, %Y0"; - /* If operands are global or in registers, can use return */ - else if (TARGET_V9 && IN_OR_GLOBAL_P (operands[1]) - && (GET_CODE (operands[2]) == CONST_INT - || IN_OR_GLOBAL_P (operands[2]))) - return "return\t%%i7+8\n\tadd\t%Y1, %Y2, %Y0"; - else - return "ret\;restore %r1, %2, %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_losum_si" - [(set (match_operand:SI 0 "restore_operand" "") - (lo_sum:SI (match_operand:SI 1 "register_operand" "r") - (match_operand:SI 2 "immediate_operand" "in"))) - (return)] - "sparc_emitting_epilogue && ! TARGET_CM_MEDMID" -{ - if (! TARGET_ARCH64 && current_function_returns_struct) - return "jmp\t%%i7+12\n\trestore %r1, %%lo(%a2), %Y0"; - /* If operands are global or in registers, can use return */ - else if (TARGET_V9 && IN_OR_GLOBAL_P (operands[1])) - return "return\t%%i7+8\n\tor\t%Y1, %%lo(%a2), %Y0"; - else - return "ret\;restore %r1, %%lo(%a2), %Y0"; -} - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_di" - [(set (match_operand:DI 0 "restore_operand" "") - (match_operand:DI 1 "arith_double_operand" "rHI")) - (return)] - "sparc_emitting_epilogue && TARGET_ARCH64" - "ret\;restore %%g0, %1, %Y0" - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_adddi" - [(set (match_operand:DI 0 "restore_operand" "") - (plus:DI (match_operand:DI 1 "arith_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI"))) - (return)] - "sparc_emitting_epilogue && TARGET_ARCH64" - "ret\;restore %r1, %2, %Y0" - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_losum_di" - [(set (match_operand:DI 0 "restore_operand" "") - (lo_sum:DI (match_operand:DI 1 "arith_operand" "%r") - (match_operand:DI 2 "immediate_operand" "in"))) - (return)] - "sparc_emitting_epilogue && TARGET_ARCH64 && ! TARGET_CM_MEDMID" - "ret\;restore %r1, %%lo(%a2), %Y0" - [(set_attr "type" "multi") - (set_attr "length" "2")]) - -(define_insn "*return_sf" - [(set (reg:SF 32) - (match_operand:SF 0 "register_operand" "f")) - (return)] - "sparc_emitting_epilogue" - "ret\;fmovs\t%0, %%f0" - [(set_attr "type" "multi") - (set_attr "length" "2")]) +;; Prefetch instructions. ;; ??? UltraSPARC-III note: A memory operation loading into the floating point register ;; ??? file, if it hits the prefetch cache, has a chance to dual-issue with other memory @@ -8293,10 +7520,8 @@ int read_or_write = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (read_or_write != 0 && read_or_write != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (read_or_write == 0 || read_or_write == 1); + gcc_assert (locality >= 0 && locality < 4); return prefetch_instr [read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load")]) @@ -8320,42 +7545,15 @@ int read_or_write = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (read_or_write != 0 && read_or_write != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (read_or_write == 0 || read_or_write == 1); + gcc_assert (locality >= 0 && locality < 4); return prefetch_instr [read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load")]) - -(define_expand "prologue" - [(const_int 1)] - "flag_pic && current_function_uses_pic_offset_table" -{ - load_pic_register (); - DONE; -}) -;; We need to reload %l7 for -mflat -fpic, -;; otherwise %l7 should be preserved simply -;; by loading the function's register window -(define_expand "exception_receiver" - [(const_int 0)] - "TARGET_FLAT && flag_pic" -{ - load_pic_register (); - DONE; -}) -;; Likewise -(define_expand "builtin_setjmp_receiver" - [(label_ref (match_operand 0 "" ""))] - "TARGET_FLAT && flag_pic" -{ - load_pic_register (); - DONE; -}) - +;; Trap instructions. + (define_insn "trap" [(trap_if (const_int 1) (const_int 5))] "" @@ -8363,29 +7561,36 @@ [(set_attr "type" "trap")]) (define_expand "conditional_trap" - [(trap_if (match_operator 0 "noov_compare_op" - [(match_dup 2) (match_dup 3)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(match_dup 2) (match_dup 3)]) (match_operand:SI 1 "arith_operand" ""))] "" - "operands[2] = gen_compare_reg (GET_CODE (operands[0]), - sparc_compare_op0, sparc_compare_op1); + "operands[2] = gen_compare_reg (GET_CODE (operands[0])); + if (GET_MODE (operands[2]) != CCmode && GET_MODE (operands[2]) != CCXmode) + FAIL; operands[3] = const0_rtx;") (define_insn "" - [(trap_if (match_operator 0 "noov_compare_op" [(reg:CC 100) (const_int 0)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CC 100) (const_int 0)]) (match_operand:SI 1 "arith_operand" "rM"))] "" - "t%C0\t%1" +{ + if (TARGET_V9) + return "t%C0\t%%icc, %1"; + else + return "t%C0\t%1"; +} [(set_attr "type" "trap")]) (define_insn "" - [(trap_if (match_operator 0 "noov_compare_op" [(reg:CCX 100) (const_int 0)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CCX 100) (const_int 0)]) (match_operand:SI 1 "arith_operand" "rM"))] "TARGET_V9" "t%C0\t%%xcc, %1" [(set_attr "type" "trap")]) -;; TLS support + +;; TLS support instructions. + (define_insn "tgd_hi22" [(set (match_operand:SI 0 "register_operand" "=r") (high:SI (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] @@ -8947,3 +8152,335 @@ "TARGET_TLS && TARGET_ARCH64" "stx\t%0, [%1 + %2], %%tldo_add(%3)" [(set_attr "type" "store")]) + + +;; Stack protector instructions. + +(define_expand "stack_protect_set" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx tlsreg = gen_rtx_REG (Pmode, 7); + rtx addr = gen_rtx_PLUS (Pmode, tlsreg, GEN_INT (TARGET_THREAD_SSP_OFFSET)); + operands[1] = gen_rtx_MEM (Pmode, addr); +#endif + if (TARGET_ARCH64) + emit_insn (gen_stack_protect_setdi (operands[0], operands[1])); + else + emit_insn (gen_stack_protect_setsi (operands[0], operands[1])); + DONE; +}) + +(define_insn "stack_protect_setsi" + [(set (match_operand:SI 0 "memory_operand" "=m") + (unspec:SI [(match_operand:SI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:SI 2 "=&r") (const_int 0))] + "TARGET_ARCH32" + "ld\t%1, %2\;st\t%2, %0\;mov\t0, %2" + [(set_attr "type" "multi") + (set_attr "length" "3")]) + +(define_insn "stack_protect_setdi" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:DI 1 "memory_operand" "m")] UNSPEC_SP_SET)) + (set (match_scratch:DI 2 "=&r") (const_int 0))] + "TARGET_ARCH64" + "ldx\t%1, %2\;stx\t%2, %0\;mov\t0, %2" + [(set_attr "type" "multi") + (set_attr "length" "3")]) + +(define_expand "stack_protect_test" + [(match_operand 0 "memory_operand" "") + (match_operand 1 "memory_operand" "") + (match_operand 2 "" "")] + "" +{ +#ifdef TARGET_THREAD_SSP_OFFSET + rtx tlsreg = gen_rtx_REG (Pmode, 7); + rtx addr = gen_rtx_PLUS (Pmode, tlsreg, GEN_INT (TARGET_THREAD_SSP_OFFSET)); + operands[1] = gen_rtx_MEM (Pmode, addr); +#endif + if (TARGET_ARCH64) + { + rtx temp = gen_reg_rtx (Pmode); + emit_insn (gen_stack_protect_testdi (temp, operands[0], operands[1])); + sparc_compare_op0 = temp; + sparc_compare_op1 = const0_rtx; + } + else + { + emit_insn (gen_stack_protect_testsi (operands[0], operands[1])); + sparc_compare_op0 = operands[0]; + sparc_compare_op1 = operands[1]; + sparc_compare_emitted = gen_rtx_REG (CCmode, SPARC_ICC_REG); + } + emit_jump_insn (gen_beq (operands[2])); + DONE; +}) + +(define_insn "stack_protect_testsi" + [(set (reg:CC 100) + (unspec:CC [(match_operand:SI 0 "memory_operand" "m") + (match_operand:SI 1 "memory_operand" "m")] + UNSPEC_SP_TEST)) + (set (match_scratch:SI 3 "=r") (const_int 0)) + (clobber (match_scratch:SI 2 "=&r"))] + "TARGET_ARCH32" + "ld\t%0, %2\;ld\t%1, %3\;xorcc\t%2, %3, %2\;mov\t0, %3" + [(set_attr "type" "multi") + (set_attr "length" "4")]) + +(define_insn "stack_protect_testdi" + [(set (match_operand:DI 0 "register_operand" "=&r") + (unspec:DI [(match_operand:DI 1 "memory_operand" "m") + (match_operand:DI 2 "memory_operand" "m")] + UNSPEC_SP_TEST)) + (set (match_scratch:DI 3 "=r") (const_int 0))] + "TARGET_ARCH64" + "ldx\t%1, %0\;ldx\t%2, %3\;xor\t%0, %3, %0\;mov\t0, %3" + [(set_attr "type" "multi") + (set_attr "length" "4")]) + + +;; Vector instructions. + +(define_insn "addv2si3" + [(set (match_operand:V2SI 0 "register_operand" "=e") + (plus:V2SI (match_operand:V2SI 1 "register_operand" "e") + (match_operand:V2SI 2 "register_operand" "e")))] + "TARGET_VIS" + "fpadd32\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "addv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (plus:V4HI (match_operand:V4HI 1 "register_operand" "e") + (match_operand:V4HI 2 "register_operand" "e")))] + "TARGET_VIS" + "fpadd16\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +;; fpadd32s is emitted by the addsi3 pattern. + +(define_insn "addv2hi3" + [(set (match_operand:V2HI 0 "register_operand" "=f") + (plus:V2HI (match_operand:V2HI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")))] + "TARGET_VIS" + "fpadd16s\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "single")]) + +(define_insn "subv2si3" + [(set (match_operand:V2SI 0 "register_operand" "=e") + (minus:V2SI (match_operand:V2SI 1 "register_operand" "e") + (match_operand:V2SI 2 "register_operand" "e")))] + "TARGET_VIS" + "fpsub32\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "subv4hi3" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (minus:V4HI (match_operand:V4HI 1 "register_operand" "e") + (match_operand:V4HI 2 "register_operand" "e")))] + "TARGET_VIS" + "fpsub16\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +;; fpsub32s is emitted by the subsi3 pattern. + +(define_insn "subv2hi3" + [(set (match_operand:V2HI 0 "register_operand" "=f") + (minus:V2HI (match_operand:V2HI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")))] + "TARGET_VIS" + "fpsub16s\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "single")]) + +;; All other logical instructions have integer equivalents so they +;; are defined together. + +;; (ior (not (op1)) (not (op2))) is the canonical form of NAND. + +(define_insn "*nand_vis" + [(set (match_operand:V64 0 "register_operand" "=e") + (ior:V64 (not:V64 (match_operand:V64 1 "register_operand" "e")) + (not:V64 (match_operand:V64 2 "register_operand" "e"))))] + "TARGET_VIS" + "fnand\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "*nand_vis" + [(set (match_operand:V32 0 "register_operand" "=f") + (ior:V32 (not:V32 (match_operand:V32 1 "register_operand" "f")) + (not:V32 (match_operand:V32 2 "register_operand" "f"))))] + "TARGET_VIS" + "fnands\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "single")]) + +;; Hard to generate VIS instructions. We have builtins for these. + +(define_insn "fpack16_vis" + [(set (match_operand:V4QI 0 "register_operand" "=f") + (unspec:V4QI [(match_operand:V4HI 1 "register_operand" "e")] + UNSPEC_FPACK16))] + "TARGET_VIS" + "fpack16\t%1, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "fpackfix_vis" + [(set (match_operand:V2HI 0 "register_operand" "=f") + (unspec:V2HI [(match_operand:V2SI 1 "register_operand" "e")] + UNSPEC_FPACKFIX))] + "TARGET_VIS" + "fpackfix\t%1, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "fpack32_vis" + [(set (match_operand:V8QI 0 "register_operand" "=e") + (unspec:V8QI [(match_operand:V2SI 1 "register_operand" "e") + (match_operand:V8QI 2 "register_operand" "e")] + UNSPEC_FPACK32))] + "TARGET_VIS" + "fpack32\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "fexpand_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (unspec:V4HI [(match_operand:V4QI 1 "register_operand" "f")] + UNSPEC_FEXPAND))] + "TARGET_VIS" + "fexpand\t%1, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +;; It may be possible to describe this operation as (1 indexed): +;; (vec_select (vec_duplicate (vec_duplicate (vec_concat 1 2))) +;; 1,5,10,14,19,23,28,32) +;; Note that (vec_merge:V8QI [(V4QI) (V4QI)] (10101010 = 170) doesn't work +;; because vec_merge expects all the operands to be of the same type. +(define_insn "fpmerge_vis" + [(set (match_operand:V8QI 0 "register_operand" "=e") + (unspec:V8QI [(match_operand:V4QI 1 "register_operand" "f") + (match_operand:V4QI 2 "register_operand" "f")] + UNSPEC_FPMERGE))] + "TARGET_VIS" + "fpmerge\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +;; Partitioned multiply instructions +(define_insn "fmul8x16_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (mult:V4HI (match_operand:V4QI 1 "register_operand" "f") + (match_operand:V4HI 2 "register_operand" "e")))] + "TARGET_VIS" + "fmul8x16\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +;; Only one of the following two insns can be a multiply. +(define_insn "fmul8x16au_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (mult:V4HI (match_operand:V4QI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")))] + "TARGET_VIS" + "fmul8x16au\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +(define_insn "fmul8x16al_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (unspec:V4HI [(match_operand:V4QI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")] + UNSPEC_MUL16AL))] + "TARGET_VIS" + "fmul8x16al\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +;; Only one of the following two insns can be a multiply. +(define_insn "fmul8sux16_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (mult:V4HI (match_operand:V8QI 1 "register_operand" "e") + (match_operand:V4HI 2 "register_operand" "e")))] + "TARGET_VIS" + "fmul8sux16\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +(define_insn "fmul8ulx16_vis" + [(set (match_operand:V4HI 0 "register_operand" "=e") + (unspec:V4HI [(match_operand:V8QI 1 "register_operand" "e") + (match_operand:V4HI 2 "register_operand" "e")] + UNSPEC_MUL8UL))] + "TARGET_VIS" + "fmul8ulx16\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +;; Only one of the following two insns can be a multiply. +(define_insn "fmuld8sux16_vis" + [(set (match_operand:V2SI 0 "register_operand" "=e") + (mult:V2SI (match_operand:V4QI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")))] + "TARGET_VIS" + "fmuld8sux16\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +(define_insn "fmuld8ulx16_vis" + [(set (match_operand:V2SI 0 "register_operand" "=e") + (unspec:V2SI [(match_operand:V4QI 1 "register_operand" "f") + (match_operand:V2HI 2 "register_operand" "f")] + UNSPEC_MULDUL))] + "TARGET_VIS" + "fmuld8ulx16\t%1, %2, %0" + [(set_attr "type" "fpmul") + (set_attr "fptype" "double")]) + +;; Using faligndata only makes sense after an alignaddr since the choice of +;; bytes to take out of each operand is dependent on the results of the last +;; alignaddr. +(define_insn "faligndata_vis" + [(set (match_operand:V64I 0 "register_operand" "=e") + (unspec:V64I [(match_operand:V64I 1 "register_operand" "e") + (match_operand:V64I 2 "register_operand" "e")] + UNSPEC_ALIGNDATA))] + "TARGET_VIS" + "faligndata\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(define_insn "alignaddr_vis" + [(set (match_operand:P 0 "register_operand" "=r") + (unspec:P [(match_operand:P 1 "register_or_zero_operand" "rJ") + (match_operand:P 2 "register_or_zero_operand" "rJ")] + UNSPEC_ALIGNADDR))] + "TARGET_VIS" + "alignaddr\t%r1, %r2, %0") + +(define_insn "pdist_vis" + [(set (match_operand:DI 0 "register_operand" "=e") + (unspec:DI [(match_operand:V8QI 1 "register_operand" "e") + (match_operand:V8QI 2 "register_operand" "e") + (match_operand:DI 3 "register_operand" "0")] + UNSPEC_PDIST))] + "TARGET_VIS" + "pdist\t%1, %2, %0" + [(set_attr "type" "fga") + (set_attr "fptype" "double")]) + +(include "sync.md") diff --git a/contrib/gcc/config/sparc/sparc.opt b/contrib/gcc/config/sparc/sparc.opt new file mode 100644 index 00000000000..8cdf11cf735 --- /dev/null +++ b/contrib/gcc/config/sparc/sparc.opt @@ -0,0 +1,126 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT +; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +; License for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mfpu +Target Report Mask(FPU) +Use hardware FP + +mhard-float +Target RejectNegative Mask(FPU) MaskExists +Use hardware FP + +msoft-float +Target RejectNegative InverseMask(FPU) +Do not use hardware FP + +munaligned-doubles +Target Report Mask(UNALIGNED_DOUBLES) +Assume possible double misalignment + +mimpure-text +Target Report +Pass -assert pure-text to linker + +mapp-regs +Target Report Mask(APP_REGS) +Use ABI reserved registers + +mhard-quad-float +Target Report RejectNegative Mask(HARD_QUAD) +Use hardware quad FP instructions + +msoft-quad-float +Target Report RejectNegative InverseMask(HARD_QUAD) +Do not use hardware quad fp instructions + +mv8plus +Target Report Mask(V8PLUS) +Compile for V8+ ABI + +mvis +Target Report Mask(VIS) +Use UltraSPARC Visual Instruction Set extensions + +mptr64 +Target Report RejectNegative Mask(PTR64) +Pointers are 64-bit + +mptr32 +Target Report RejectNegative InverseMask(PTR64) +Pointers are 32-bit + +m64 +Target Report RejectNegative Mask(64BIT) +Use 64-bit ABI + +m32 +Target Report RejectNegative InverseMask(64BIT) +Use 32-bit ABI + +mstack-bias +Target Report Mask(STACK_BIAS) +Use stack bias + +mfaster-structs +Target Report Mask(FASTER_STRUCTS) +Use structs on stronger alignment for double-word copies + +mrelax +Target +Optimize tail call instructions in assembler and linker + +mcpu= +Target RejectNegative Joined +Use features of and schedule code for given CPU + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +mcmodel= +Target RejectNegative Joined Var(sparc_cmodel_string) +Use given SPARC-V9 code model + +mstd-struct-return +Target Report RejectNegative Var(sparc_std_struct_return) +Enable strict 32-bit psABI struct return checking. + +Mask(LITTLE_ENDIAN) +;; Generate code for little-endian + +Mask(LONG_DOUBLE_128) +;; Use 128-bit long double + +Mask(SPARCLITE) +;; Generate code for SPARClite + +Mask(SPARCLET) +;; Generate code for SPARClet + +Mask(V8) +;; Generate code for SPARC-V8 + +Mask(V9) +;; Generate code for SPARC-V9 + +Mask(DEPRECATED_V8_INSNS) +;; Generate code that uses the V8 instructions deprecated +;; in the V9 architecture. diff --git a/contrib/gcc/config/sparc/sparclet.md b/contrib/gcc/config/sparc/sparclet.md index 15020ba113e..fdc03ab0985 100644 --- a/contrib/gcc/config/sparc/sparclet.md +++ b/contrib/gcc/config/sparc/sparclet.md @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; The SPARClet is a single-issue processor. diff --git a/contrib/gcc/config/sparc/supersparc.md b/contrib/gcc/config/sparc/supersparc.md index 93e4cf77923..8aaa75fa5c6 100644 --- a/contrib/gcc/config/sparc/supersparc.md +++ b/contrib/gcc/config/sparc/supersparc.md @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; The SuperSPARC is a tri-issue, which was considered quite parallel ;; at the time it was released. Much like UltraSPARC-I and UltraSPARC-II diff --git a/contrib/gcc/config/sparc/sync.md b/contrib/gcc/config/sparc/sync.md new file mode 100644 index 00000000000..133792127e5 --- /dev/null +++ b/contrib/gcc/config/sparc/sync.md @@ -0,0 +1,208 @@ +;; GCC machine description for SPARC synchronization instructions. +;; Copyright (C) 2005 +;; Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; 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, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +(define_mode_macro I12MODE [QI HI]) +(define_mode_macro I24MODE [HI SI]) +(define_mode_macro I48MODE [SI (DI "TARGET_ARCH64 || TARGET_V8PLUS")]) +(define_mode_attr modesuffix [(SI "") (DI "x")]) + +(define_expand "memory_barrier" + [(set (mem:BLK (match_dup 0)) + (unspec_volatile:BLK [(mem:BLK (match_dup 0)) (match_dup 1)] + UNSPECV_MEMBAR))] + "TARGET_V8 || TARGET_V9" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); + MEM_VOLATILE_P (operands[0]) = 1; + if (TARGET_V9) + /* member #StoreStore | #LoadStore | #StoreLoad | #LoadLoad */ + operands[1] = GEN_INT (15); + else + /* stbar */ + operands[1] = GEN_INT (8); +}) + +(define_insn "*stbar" + [(set (match_operand:BLK 0 "" "") + (unspec_volatile:BLK [(match_operand:BLK 1 "" "") + (const_int 8)] UNSPECV_MEMBAR))] + "TARGET_V8" + "stbar" + [(set_attr "type" "multi")]) + +(define_insn "*membar" + [(set (match_operand:BLK 0 "" "") + (unspec_volatile:BLK [(match_operand:BLK 1 "" "") + (match_operand:SI 2 "immediate_operand" "I")] + UNSPECV_MEMBAR))] + "TARGET_V9" + "membar\t%2" + [(set_attr "type" "multi")]) + +(define_expand "sync_compare_and_swap" + [(match_operand:I12MODE 0 "register_operand" "") + (match_operand:I12MODE 1 "memory_operand" "") + (match_operand:I12MODE 2 "register_operand" "") + (match_operand:I12MODE 3 "register_operand" "")] + "TARGET_V9" +{ + sparc_expand_compare_and_swap_12 (operands[0], operands[1], + operands[2], operands[3]); + DONE; +}) + +(define_expand "sync_compare_and_swap" + [(parallel + [(set (match_operand:I48MODE 0 "register_operand" "=r") + (match_operand:I48MODE 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(match_operand:I48MODE 2 "register_operand" "") + (match_operand:I48MODE 3 "register_operand" "")] + UNSPECV_CAS))])] + "TARGET_V9" +{ + if (! REG_P (XEXP (operands[1], 0))) + { + rtx addr = force_reg (Pmode, XEXP (operands[1], 0)); + operands[1] = replace_equiv_address (operands[1], addr); + } + emit_insn (gen_memory_barrier ()); +}) + +(define_insn "*sync_compare_and_swap" + [(set (match_operand:I48MODE 0 "register_operand" "=r") + (match_operand:I48MODE 1 "memory_reg_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(match_operand:I48MODE 2 "register_operand" "r") + (match_operand:I48MODE 3 "register_operand" "0")] + UNSPECV_CAS))] + "TARGET_V9 && (mode == SImode || TARGET_ARCH64)" + "cas\t%1, %2, %0" + [(set_attr "type" "multi")]) + +(define_insn "*sync_compare_and_swapdi_v8plus" + [(set (match_operand:DI 0 "register_operand" "=h") + (match_operand:DI 1 "memory_reg_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:DI + [(match_operand:DI 2 "register_operand" "h") + (match_operand:DI 3 "register_operand" "0")] + UNSPECV_CAS))] + "TARGET_V8PLUS" +{ + if (sparc_check_64 (operands[3], insn) <= 0) + output_asm_insn ("srl\t%L3, 0, %L3", operands); + output_asm_insn ("sllx\t%H3, 32, %H3", operands); + output_asm_insn ("or\t%L3, %H3, %L3", operands); + if (sparc_check_64 (operands[2], insn) <= 0) + output_asm_insn ("srl\t%L2, 0, %L2", operands); + output_asm_insn ("sllx\t%H2, 32, %H3", operands); + output_asm_insn ("or\t%L2, %H3, %H3", operands); + output_asm_insn ("casx\t%1, %H3, %L3", operands); + return "srlx\t%L3, 32, %H3"; +} + [(set_attr "type" "multi") + (set_attr "length" "8")]) + +(define_expand "sync_lock_test_and_set" + [(match_operand:I12MODE 0 "register_operand" "") + (match_operand:I12MODE 1 "memory_operand" "") + (match_operand:I12MODE 2 "arith_operand" "")] + "!TARGET_V9" +{ + if (operands[2] != const1_rtx) + FAIL; + if (TARGET_V8) + emit_insn (gen_memory_barrier ()); + if (mode != QImode) + operands[1] = adjust_address (operands[1], QImode, 0); + emit_insn (gen_ldstub (operands[0], operands[1])); + DONE; +}) + +(define_expand "sync_lock_test_and_setsi" + [(parallel + [(set (match_operand:SI 0 "register_operand" "") + (unspec_volatile:SI [(match_operand:SI 1 "memory_operand" "")] + UNSPECV_SWAP)) + (set (match_dup 1) + (match_operand:SI 2 "arith_operand" ""))])] + "" +{ + if (! TARGET_V8 && ! TARGET_V9) + { + if (operands[2] != const1_rtx) + FAIL; + operands[1] = adjust_address (operands[1], QImode, 0); + emit_insn (gen_ldstubsi (operands[0], operands[1])); + DONE; + } + emit_insn (gen_memory_barrier ()); + operands[2] = force_reg (SImode, operands[2]); +}) + +(define_insn "*swapsi" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec_volatile:SI [(match_operand:SI 1 "memory_operand" "+m")] + UNSPECV_SWAP)) + (set (match_dup 1) + (match_operand:SI 2 "register_operand" "0"))] + "TARGET_V8 || TARGET_V9" + "swap\t%1, %0" + [(set_attr "type" "multi")]) + +(define_expand "ldstubqi" + [(parallel [(set (match_operand:QI 0 "register_operand" "") + (unspec_volatile:QI [(match_operand:QI 1 "memory_operand" "")] + UNSPECV_LDSTUB)) + (set (match_dup 1) (const_int -1))])] + "" + "") + +(define_expand "ldstub" + [(parallel [(set (match_operand:I24MODE 0 "register_operand" "") + (zero_extend:I24MODE + (unspec_volatile:QI [(match_operand:QI 1 "memory_operand" "")] + UNSPECV_LDSTUB))) + (set (match_dup 1) (const_int -1))])] + "" + "") + +(define_insn "*ldstubqi" + [(set (match_operand:QI 0 "register_operand" "=r") + (unspec_volatile:QI [(match_operand:QI 1 "memory_operand" "+m")] + UNSPECV_LDSTUB)) + (set (match_dup 1) (const_int -1))] + "" + "ldstub\t%1, %0" + [(set_attr "type" "multi")]) + +(define_insn "*ldstub" + [(set (match_operand:I24MODE 0 "register_operand" "=r") + (zero_extend:I24MODE + (unspec_volatile:QI [(match_operand:QI 1 "memory_operand" "+m")] + UNSPECV_LDSTUB))) + (set (match_dup 1) (const_int -1))] + "" + "ldstub\t%1, %0" + [(set_attr "type" "multi")]) diff --git a/contrib/gcc/config/sparc/sysv4-only.h b/contrib/gcc/config/sparc/sysv4-only.h index da265a0c0df..dca78baf1c9 100644 --- a/contrib/gcc/config/sparc/sysv4-only.h +++ b/contrib/gcc/config/sparc/sysv4-only.h @@ -1,5 +1,5 @@ /* Target macros for GCC for SPARC running System V.4 - Copyright (C) 2003 + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Provide a set of pre-definitions and pre-assertions appropriate for the SPARC running svr4. __svr4__ is our extension. */ @@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define_std ("sparc"); \ builtin_define_std ("unix"); \ builtin_define ("__svr4__"); \ builtin_assert ("system=unix"); \ diff --git a/contrib/gcc/config/sparc/sysv4.h b/contrib/gcc/config/sparc/sysv4.h index 776debc1a9a..0c0c8e0d055 100644 --- a/contrib/gcc/config/sparc/sysv4.h +++ b/contrib/gcc/config/sparc/sysv4.h @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc ELF)"); diff --git a/contrib/gcc/config/sparc/t-linux b/contrib/gcc/config/sparc/t-linux new file mode 100644 index 00000000000..a3e513087f5 --- /dev/null +++ b/contrib/gcc/config/sparc/t-linux @@ -0,0 +1,5 @@ +# Override t-slibgcc-elf-ver to export some libgcc symbols with +# the symbol versions that glibc used. +# Avoid the t-linux version file. +SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ + $(srcdir)/config/sparc/libgcc-sparc-glibc.ver diff --git a/contrib/gcc/config/sparc/t-linux64 b/contrib/gcc/config/sparc/t-linux64 index 3e3fa4cae7e..7a1d5b1e145 100644 --- a/contrib/gcc/config/sparc/t-linux64 +++ b/contrib/gcc/config/sparc/t-linux64 @@ -8,12 +8,6 @@ INSTALL_LIBGCC = install-multilib EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \ crtfastmath.o -# Override t-slibgcc-elf-ver to export some libgcc symbols with -# the symbol versions that glibc used. -# Avoid the t-linux version file. -SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ - $(srcdir)/config/sparc/libgcc-sparc-glibc.ver - CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \ -print-multi-os-directory) \ = x../lib64; then echo -mcmodel=medany; fi` diff --git a/contrib/gcc/config/sparc/ultra1_2.md b/contrib/gcc/config/sparc/ultra1_2.md index e58c624abd2..b7329fd1100 100644 --- a/contrib/gcc/config/sparc/ultra1_2.md +++ b/contrib/gcc/config/sparc/ultra1_2.md @@ -1,5 +1,5 @@ ;; Scheduling description for UltraSPARC-I/II. -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; UltraSPARC-I and II are quad-issue processors. Interesting features ;; to note: @@ -80,7 +80,7 @@ (define_insn_reservation "us1_single" 1 (and (eq_attr "cpu" "ultrasparc") - (eq_attr "type" "multi,flushw,iflush,trap")) + (eq_attr "type" "multi,savew,flushw,iflush,trap")) "us1_single_issue") (define_insn_reservation "us1_simple_ieuN" 1 diff --git a/contrib/gcc/config/sparc/ultra3.md b/contrib/gcc/config/sparc/ultra3.md index 238beab2910..7f9905f9edd 100644 --- a/contrib/gcc/config/sparc/ultra3.md +++ b/contrib/gcc/config/sparc/ultra3.md @@ -1,5 +1,5 @@ ;; Scheduling description for UltraSPARC-III. -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -15,8 +15,8 @@ ;; ;; 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. +;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;; UltraSPARC-III is a quad-issue processor. ;; @@ -37,7 +37,7 @@ (define_insn_reservation "us3_single" 1 (and (eq_attr "cpu" "ultrasparc3") - (eq_attr "type" "multi,flushw,iflush,trap")) + (eq_attr "type" "multi,savew,flushw,iflush,trap")) "us3_single_issue") (define_insn_reservation "us3_integer" 1 diff --git a/contrib/gcc/config/svr3.h b/contrib/gcc/config/svr3.h index 21595eac273..283ebf0cdd7 100644 --- a/contrib/gcc/config/svr3.h +++ b/contrib/gcc/config/svr3.h @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for generic System V Release 3 system. - Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1991, 1996, 2000, 2002, 2004 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Define a symbol indicating that we are using svr3.h. */ #define USING_SVR3_H @@ -54,7 +54,7 @@ Boston, MA 02111-1307, USA. */ do { \ int align = exact_log2 (ROUNDED); \ if (align > 2) align = 2; \ - data_section (); \ + switch_to_section (data_section); \ ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \ ASM_OUTPUT_LABEL ((FILE), (NAME)); \ fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \ @@ -70,10 +70,6 @@ Boston, MA 02111-1307, USA. */ #define NO_DOLLAR_IN_LABEL -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - /* System V Release 3 uses COFF debugging info. */ #define SDB_DEBUGGING_INFO 1 @@ -163,33 +159,3 @@ do { \ } while (0) #endif /* STACK_GROWS_DOWNWARD */ - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_init, in_fini - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ - INIT_SECTION_FUNCTION \ - FINI_SECTION_FUNCTION - -#define INIT_SECTION_FUNCTION \ -void \ -init_section () \ -{ \ - if (in_section != in_init) \ - { \ - fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ - in_section = in_init; \ - } \ -} - -#define FINI_SECTION_FUNCTION \ -void \ -fini_section () \ -{ \ - if (in_section != in_fini) \ - { \ - fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ - in_section = in_fini; \ - } \ -} diff --git a/contrib/gcc/config/svr4.h b/contrib/gcc/config/svr4.h index ca65cd84aae..6fa88fcd821 100644 --- a/contrib/gcc/config/svr4.h +++ b/contrib/gcc/config/svr4.h @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. To use this file, make up a line like that in config.gcc: @@ -203,4 +203,4 @@ Boston, MA 02111-1307, USA. #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -#define TARGET_HAS_F_SETLKW +#define TARGET_POSIX_IO diff --git a/contrib/gcc/config/t-darwin b/contrib/gcc/config/t-darwin index a7076ab295d..8ab072f53dd 100644 --- a/contrib/gcc/config/t-darwin +++ b/contrib/gcc/config/t-darwin @@ -1,24 +1,33 @@ darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h \ conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \ - reload.h function.h $(GGC_H) langhooks.h $(TM_P_H) gt-darwin.h + reload.h function.h $(GGC_H) langhooks.h $(TARGET_H) $(TM_P_H) gt-darwin.h \ + config/darwin-sections.def $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin.c darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c + $(TM_H) $(CPPLIB_H) $(TREE_H) c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \ + c-incpath.h flags.h $(C_COMMON_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES) gt-darwin.h : s-gtype ; @true -# Explain how to build crt2.o -$(T)crt2$(objext): $(srcdir)/config/darwin-crt2.c $(GCC_PASSES) \ +# How to build crt3.o +EXTRA_MULTILIB_PARTS=crt3.o +# Pass -fno-tree-dominator-opts to work around bug 26840. +$(T)crt3$(objext): $(srcdir)/config/darwin-crt3.c $(GCC_PASSES) \ $(TCONFIG_H) stmp-int-hdrs tsystem.h $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \ - -c $(srcdir)/config/darwin-crt2.c -o $(T)crt2$(objext) + -fno-tree-dominator-opts $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) \ + -c $(srcdir)/config/darwin-crt3.c -o $(T)crt3$(objext) # Use unwind-dw2-fde-darwin LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c -TARGET_LIBGCC2_CFLAGS = -fPIC +# -pipe because there's an assembler bug, 4077127, which causes +# it to not properly process the first # directive, causing temporary +# file names to appear in stabs, causing the bootstrap to fail. Using -pipe +# works around this by not having any temporary file names. +TARGET_LIBGCC2_CFLAGS = -fPIC -pipe diff --git a/contrib/gcc/config/t-dfprules b/contrib/gcc/config/t-dfprules new file mode 100644 index 00000000000..6bf6246d8c7 --- /dev/null +++ b/contrib/gcc/config/t-dfprules @@ -0,0 +1,10 @@ +# Use DFP_ENABLE to build decimal floating point support routines for +# all decimal floating point types (32-bit, 64-bit and 128-bit). We +# use `true' for clarity, but any value will do. +# +DFP_ENABLE = true + +# DFP_CFLAGS can be used to pass target-specific CFLAGS when compiling +# dfp-bit.c. This is useful for overriding the definition of macros. +# +# DFP_CFLAGS = -DFOO=bar diff --git a/contrib/gcc/config/t-libunwind-elf b/contrib/gcc/config/t-libunwind-elf index a9609e70b0d..1fa8aa25251 100644 --- a/contrib/gcc/config/t-libunwind-elf +++ b/contrib/gcc/config/t-libunwind-elf @@ -5,25 +5,26 @@ LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c SHLIBUNWIND_SOVERSION = 7 -SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION) -SHLIBUNWIND_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION) +SHLIBUNWIND_SONAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION) SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \ -nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \ - -Wl,-z,text -Wl,-z,defs -o $(SHLIBUNWIND_NAME).tmp \ + -Wl,-z,text -Wl,-z,defs -o $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \ @multilib_flags@ $(SHLIB_OBJS) -lc && \ - rm -f $(SHLIB_SOLINK) && \ - if [ -f $(SHLIBUNWIND_NAME) ]; then \ - mv -f $(SHLIBUNWIND_NAME) $(SHLIBUNWIND_NAME).backup; \ + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ + if [ -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) ]; then \ + mv -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \ + $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).backup; \ else true; fi && \ - mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \ - $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK) + mv $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \ + $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) && \ + $(LN_S) $(SHLIBUNWIND_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. SHLIBUNWIND_INSTALL = \ $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_DATA) $(SHLIBUNWIND_NAME) \ + $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ $(LN_S) $(SHLIBUNWIND_SONAME) \ diff --git a/contrib/gcc/config/t-linux b/contrib/gcc/config/t-linux index f25ab6430e9..f3e792bcc01 100644 --- a/contrib/gcc/config/t-linux +++ b/contrib/gcc/config/t-linux @@ -10,4 +10,4 @@ SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver # Use unwind-dw2-fde-glibc LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c -LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c gthr-gnat.c +LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c diff --git a/contrib/gcc/config/t-lynx b/contrib/gcc/config/t-lynx new file mode 100644 index 00000000000..a14a53c614e --- /dev/null +++ b/contrib/gcc/config/t-lynx @@ -0,0 +1,15 @@ +# Compile crtbeginS.o and crtendS.o with pic. +CRTSTUFF_T_CFLAGS_S = -fPIC + +# Compile libgcc2.a with pic. +TARGET_LIBGCC2_CFLAGS = -fPIC + +MULTILIB_OPTIONS = mthreads +MULTILIB_DIRNAMES = thread + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib + +Local Variables: +mode: makefile +End: diff --git a/contrib/gcc/config/t-slibgcc-darwin b/contrib/gcc/config/t-slibgcc-darwin index b820441744d..0c6eded3de4 100644 --- a/contrib/gcc/config/t-slibgcc-darwin +++ b/contrib/gcc/config/t-slibgcc-darwin @@ -1,34 +1,101 @@ # Build a shared libgcc library with the darwin linker. -SHLIB_MINOR = 1 -SHLIB_REVISION = 0 -SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION) +SHLIB_SOVERSION = 1 +SHLIB_VERSTRING = -compatibility_version $(SHLIB_SOVERSION) -current_version $(SHLIB_SOVERSION).0 SHLIB_EXT = .dylib -SHLIB_SOLINK = @shlib_base_name@.dylib -SHLIB_SONAME = @shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib -SHLIB_NAME = @shlib_dir@@shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib +SHLIB_SUFFIX = `if test @multilib_dir@ = ppc64 ; then echo _@multilib_dir@ ; fi` +SHLIB_INSTALL_NAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SONAME = @shlib_base_name@.$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SOLINK = @shlib_base_name@.so SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ -SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ +SHLIB_DIR = @multilib_dir@ +SHLIB_LC = -lc +# Darwin only searches in /usr/lib for shared libraries, not in subdirectories, +# so the libgcc variants have different names not different locations. +# Note that this version is used for the loader, not the linker; the linker +# uses the stub versions named by $(LIBGCC). SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \ - -Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \ - -Wl,-flat_namespace -o $(SHLIB_NAME).tmp \ + -Wl,-install_name,$(slibdir)/$(SHLIB_INSTALL_NAME) \ + -single_module -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ + -Wl,-exported_symbols_list,$(SHLIB_MAP) \ $(SHLIB_VERSTRING) \ - @multilib_flags@ $(SHLIB_OBJS) -lc && \ - rm -f $(SHLIB_SOLINK) && \ - if [ -f $(SHLIB_NAME) ]; then \ - mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \ - else true; fi && \ - mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \ - $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK) + @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) + # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. SHLIB_INSTALL = \ - $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_DATA) $(SHLIB_NAME) \ - $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ - rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ - $(LN_S) $(SHLIB_SONAME) \ - $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) -SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk -SHLIB_MAPFILES = $(srcdir)/libgcc-darwin.ver + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \ + $(INSTALL_DATA) $(SHLIB_SONAME) \ + $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME) + +SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk +SHLIB_MKMAP_OPTS = -v leading_underscore=1 +SHLIB_MAPFILES += $(srcdir)/libgcc-std.ver + +# Must use a different directive for hidden visibility in assembly sources. +ASM_HIDDEN_OP = .private_extern + +# In order to support -mmacosx-version-min, you need to have multiple +# different libgcc_s libraries that actually get linked against, one for +# each system version supported. They are 'stub' libraries that +# contain no code, just a list of exported symbols. +# The actual use of the libraries is controlled by REAL_LIBGCC_SPEC. +# +# This assumes each multilib corresponds to a different architecture. +libgcc_s.%.dylib : $(SHLIB_VERPFX).%.ver stmp-multilib + # When building multilibbed target libraries, all the required + # libraries are expected to exist in the multilib directory. + MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ + | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ + for mlib in $$MLIBS ; do \ + rm -f $${mlib}/$@ || exit 1 ; \ + $(LN_S) ../$@ $${mlib}/$@ || exit 1 ; \ + done + MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ + | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ + for mlib in '' $$MLIBS ; do \ + $(STRIP_FOR_TARGET) -o $(@)_T$${mlib} \ + -s $(SHLIB_VERPFX).$(*).ver -c -u \ + ./$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp || exit 1 ; \ + done + $(LIPO_FOR_TARGET) -output $@ -create $(@)_T* + rm $(@)_T* + +libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT): stmp-multilib libgcc_s.10.4.dylib \ + libgcc_s.10.5.dylib + # When building multilibbed target libraries, all the required + # libraries are expected to exist in the multilib directory. + MLIBS=`$(GCC_FOR_TARGET) --print-multi-lib \ + | sed -e 's/;.*$$//' -e '/^\.$$/d'` ; \ + for mlib in '' $$MLIBS ; do \ + cp ./$${mlib}/libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT).tmp \ + ./libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T_$${mlib} || exit 1 ; \ + done + $(LIPO_FOR_TARGET) -output libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) \ + -create libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + rm libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)_T* + +# From the point-of-view of the Makefiles, libgcc is built by the 'strip' +# and 'lipo' commands above. +LIBGCC=libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT) libgcc_s.10.4.dylib \ + libgcc_s.10.5.dylib stmp-multilib + +INSTALL_FILES=libgcc_s.10.4.dylib libgcc_s.10.5.dylib libgcc_s.1.dylib + +install-darwin-libgcc-stubs : $(INSTALL_FILES) installdirs + for d in $(INSTALL_FILES) ; do \ + $(INSTALL_DATA) $$d $(DESTDIR)$(slibdir)/$$d || exit 1 ; \ + done + if [ -f $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib ]; then \ + rm -f $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib; \ + else true; fi + $(LN_S) libgcc_s.1.dylib \ + $(DESTDIR)$(slibdir)/libgcc_s_ppc64.1.dylib + if [ -f $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib ]; then \ + rm -f $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib; \ + else true; fi + $(LN_S) libgcc_s.1.dylib \ + $(DESTDIR)$(slibdir)/libgcc_s_x86_64.1.dylib + +INSTALL_LIBGCC = install-darwin-libgcc-stubs install-multilib diff --git a/contrib/gcc/config/t-slibgcc-elf-ver b/contrib/gcc/config/t-slibgcc-elf-ver index 5086500166c..346143c5c53 100644 --- a/contrib/gcc/config/t-slibgcc-elf-ver +++ b/contrib/gcc/config/t-slibgcc-elf-ver @@ -4,28 +4,30 @@ SHLIB_EXT = .so SHLIB_SOLINK = @shlib_base_name@.so SHLIB_SOVERSION = 1 -SHLIB_SONAME = @shlib_so_name@.so.$(SHLIB_SOVERSION) -SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIB_SOVERSION) +SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION) SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ +SHLIB_DIR = @multilib_dir@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ SHLIB_LC = -lc SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ -Wl,--soname=$(SHLIB_SONAME) \ -Wl,--version-script=$(SHLIB_MAP) \ - -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \ - rm -f $(SHLIB_SOLINK) && \ - if [ -f $(SHLIB_NAME) ]; then \ - mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \ + -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ + $(SHLIB_OBJS) $(SHLIB_LC) && \ + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ + if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ + mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ + $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ else true; fi && \ - mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \ - $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK) + mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ + $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. SHLIB_INSTALL = \ - $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_DATA) $(SHLIB_NAME) \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ $(LN_S) $(SHLIB_SONAME) \ diff --git a/contrib/gcc/config/t-slibgcc-sld b/contrib/gcc/config/t-slibgcc-sld index 44e7f187ffc..02d21c6de67 100644 --- a/contrib/gcc/config/t-slibgcc-sld +++ b/contrib/gcc/config/t-slibgcc-sld @@ -2,27 +2,28 @@ SHLIB_EXT = .so SHLIB_SOLINK = @shlib_base_name@.so -SHLIB_SONAME = @shlib_so_name@.so.1 -SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.1 +SHLIB_SONAME = @shlib_base_name@.so.1 SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ +SHLIB_DIR = @multilib_dir@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ -Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \ - -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \ + -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ @multilib_flags@ $(SHLIB_OBJS) -lc && \ - rm -f $(SHLIB_SOLINK) && \ - if [ -f $(SHLIB_NAME) ]; then \ - mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \ + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ + if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ + mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ + $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ else true; fi && \ - mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \ - $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK) + mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ + $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. SHLIB_INSTALL = \ - $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_DATA) $(SHLIB_NAME) \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ + $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ $(LN_S) $(SHLIB_SONAME) \ diff --git a/contrib/gcc/config/t-sol2 b/contrib/gcc/config/t-sol2 new file mode 100644 index 00000000000..2339a0bc98f --- /dev/null +++ b/contrib/gcc/config/t-sol2 @@ -0,0 +1,12 @@ +# Solaris-specific format checking and pragmas +sol2-c.o: $(srcdir)/config/sol2-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + tree.h c-format.h intl.h $(CPPLIB_H) c-pragma.h $(TM_H) $(TM_P_H) \ + toplev.h $(C_COMMON_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/sol2-c.c + +# Solaris-specific attributes +sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + tree.h $(TM_H) $(TM_P_H) toplev.h $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/sol2.c diff --git a/contrib/gcc/config/t-vxworks b/contrib/gcc/config/t-vxworks index ebf47e1bcce..677b3b45443 100644 --- a/contrib/gcc/config/t-vxworks +++ b/contrib/gcc/config/t-vxworks @@ -1,8 +1,7 @@ -# Since we have a functional assert.h, use it. -INSTALL_ASSERT_H = +# Don't run fixproto. +STMP_FIXPROTO = # Build libgcc using the multilib mechanism - LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib @@ -15,8 +14,14 @@ LIBGCC2_DEBUG_CFLAGS = # Extra libgcc2 module used by gthr-vxworks.h functions LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c +# Some runtime modules need these. Can't set extra_headers in config.gcc +# because the paths are always made absolute to the cpu config dir. +EXTRA_HEADERS += $(srcdir)/gthr-vxworks.h gthr-default.h + # This ensures that the correct target headers are used; some # VxWorks system headers have names that collide with GCC's # internal (host) headers, e.g. regs.h. # FIXME: May not be necessary anymore. LIBGCC2_INCLUDES="-I$(SYSTEM_HEADER_DIR)" + +EXTRA_MULTILIB_PARTS = diff --git a/contrib/gcc/config/usegas.h b/contrib/gcc/config/usegas.h index 54fa9bd6285..8e1b47a9019 100644 --- a/contrib/gcc/config/usegas.h +++ b/contrib/gcc/config/usegas.h @@ -14,8 +14,8 @@ 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. */ + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* Just set a single flag we can test for it inside other files. */ #define USE_GAS 1 diff --git a/contrib/gcc/config/vx-common.h b/contrib/gcc/config/vx-common.h new file mode 100644 index 00000000000..cb8d7a0808e --- /dev/null +++ b/contrib/gcc/config/vx-common.h @@ -0,0 +1,88 @@ +/* Target-independent configuration for VxWorks and VxWorks AE. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* VxWorks headers are C++-aware. */ +#undef NO_IMPLICIT_EXTERN_C +#define NO_IMPLICIT_EXTERN_C + +/* Most of these will probably be overridden by subsequent headers. We + undefine them here just in case, and define VXWORKS_ versions of each, + to be used in port-specific vxworks.h. */ +#undef LIB_SPEC +#undef LINK_SPEC +#undef LIBGCC_SPEC +#define LIBGCC_SPEC VXWORKS_LIBGCC_SPEC +#undef STARTFILE_SPEC +#undef ENDFILE_SPEC + +/* Most of these macros are overridden in "config/vxworks.h" or + "config/vxworksae.h" and are here merely for documentation + purposes. */ +#define VXWORKS_ADDITIONAL_CPP_SPEC "" +#define VXWORKS_LIB_SPEC "" +#define VXWORKS_LINK_SPEC "" +#define VXWORKS_LIBGCC_SPEC "" +#define VXWORKS_STARTFILE_SPEC "" +#define VXWORKS_ENDFILE_SPEC "" + +/* VxWorks cannot have dots in constructor labels, because it uses a + mutant variation of collect2 that generates C code instead of + assembly. Thus each constructor label must be a legitimate C + symbol. FIXME: Have VxWorks use real collect2 instead. */ +#undef NO_DOLLAR_IN_LABEL +#define NO_DOT_IN_LABEL + +/* VxWorks uses wchar_t == unsigned short (UCS2) on all architectures. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE "short unsigned int" +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 16 + +/* Dwarf2 unwind info is not supported. */ +#define DWARF2_UNWIND_INFO 0 + +/* VxWorks uses DWARF2. */ +#define DWARF2_DEBUGGING_INFO 1 +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +/* None of these other formats is supported. */ +#undef DWARF_DEBUGGING_INFO +#undef DBX_DEBUGGING_INFO +#undef SDB_DEBUGGING_INFO +#undef XCOFF_DEBUGGING_INFO +#undef VMS_DEBUGGING_INFO + +/* Kernel mode doesn't have ctors/dtors, but RTP mode does. */ +#define TARGET_HAVE_CTORS_DTORS false +#define VXWORKS_OVERRIDE_OPTIONS /* empty */ + +/* No math library needed. */ +#define MATH_LIBRARY "" + +/* No profiling. */ +#define VXWORKS_FUNCTION_PROFILER(FILE, LABELNO) do \ +{ \ + sorry ("profiler support for VxWorks"); \ +} while (0) + +/* We occasionally need to distinguish between the VxWorks variants. */ +#define VXWORKS_KIND_NORMAL 1 +#define VXWORKS_KIND_AE 2 diff --git a/contrib/gcc/config/vxlib.c b/contrib/gcc/config/vxlib.c index 20a257e02c4..8625981a315 100644 --- a/contrib/gcc/config/vxlib.c +++ b/contrib/gcc/config/vxlib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Zack Weinberg This file is part of GCC. @@ -15,11 +15,8 @@ for more details. 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. */ - -/* Threads compatibility routines for libgcc2 for VxWorks. - These are out-of-line routines called from gthr-vxworks.h. */ +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ /* As a special exception, if you link this library with other files, some of which are compiled with GCC, to produce an executable, @@ -28,14 +25,24 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ +/* Threads compatibility routines for libgcc2 for VxWorks. + These are out-of-line routines called from gthr-vxworks.h. */ + #include "tconfig.h" #include "tsystem.h" #include "gthr.h" +#if defined(__GTHREADS) #include +#ifndef __RTP__ #include +#endif #include +#ifndef __RTP__ #include +#else +# include +#endif /* Init-once operation. @@ -57,8 +64,12 @@ __gthread_once (__gthread_once_t *guard, void (*func)(void)) if (guard->done) return 0; +#ifdef __RTP__ + __gthread_lock_library (); +#else while (!vxTas ((void *)&guard->busy)) taskDelay (1); +#endif /* Only one thread at a time gets here. Check ->done again, then go ahead and call func() if no one has done it yet. */ @@ -68,29 +79,37 @@ __gthread_once (__gthread_once_t *guard, void (*func)(void)) guard->done = 1; } +#ifdef __RTP__ + __gthread_unlock_library (); +#else guard->busy = 0; +#endif return 0; } -/* Thread-specific data. +/* Thread-local storage. We reserve a field in the TCB to point to a dynamically allocated - array which is used to store TSD values. A TSD key is simply an + array which is used to store TLS values. A TLS key is simply an offset in this array. The exact location of the TCB field is not known to this code nor to vxlib.c -- all access to it indirects - through the routines __gthread_get_tsd_data and - __gthread_set_tsd_data, which are provided by the VxWorks kernel. + through the routines __gthread_get_tls_data and + __gthread_set_tls_data, which are provided by the VxWorks kernel. There is also a global array which records which keys are valid and which have destructors. A task delete hook is installed to execute key destructors. The - routines __gthread_enter_tsd_dtor_context and - __gthread_leave_tsd_dtor_context, which are also provided by the + routines __gthread_enter_tls_dtor_context and + __gthread_leave_tls_dtor_context, which are also provided by the kernel, ensure that it is safe to call free() on memory allocated by the task being deleted. (This is a no-op on VxWorks 5, but a major undertaking on AE.) + The task delete hook is only installed when at least one thread + has TLS data. This is a necessary precaution, to allow this module + to be unloaded - a module with a hook can not be removed. + Since this interface is used to allocate only a small number of keys, the table size is small and static, which simplifies the code quite a bit. Revisit this if and when it becomes necessary. */ @@ -98,23 +117,29 @@ __gthread_once (__gthread_once_t *guard, void (*func)(void)) #define MAX_KEYS 4 /* This is the structure pointed to by the pointer returned - by __gthread_get_tsd_data. */ -struct tsd_data + by __gthread_get_tls_data. */ +struct tls_data { + int *owner; void *values[MAX_KEYS]; unsigned int generation[MAX_KEYS]; }; +/* To make sure we only delete TLS data associated with this object, + include a pointer to a local variable in the TLS data object. */ +static int self_owner; + +/* The number of threads for this module which have active TLS data. + This is protected by tls_lock. */ +static int active_tls_threads; /* kernel provided routines */ -extern void *__gthread_get_tsd_data (WIND_TCB *tcb); -extern void __gthread_set_tsd_data (WIND_TCB *tcb, void *data); +extern void *__gthread_get_tls_data (void); +extern void __gthread_set_tls_data (void *data); -extern void __gthread_enter_tsd_dtor_context (WIND_TCB *tcb); -extern void __gthread_leave_tsd_dtor_context (WIND_TCB *tcb); +extern void __gthread_enter_tls_dtor_context (void); +extern void __gthread_leave_tls_dtor_context (void); -typedef void (*fet_callback_t) (WIND_TCB *, unsigned int); -extern void __gthread_for_all_tasks (fet_callback_t fun, unsigned int number); /* This is a global structure which records all of the active keys. @@ -128,71 +153,100 @@ extern void __gthread_for_all_tasks (fet_callback_t fun, unsigned int number); stored in this structure is equal to the generation count stored in T's specific-value structure. */ -typedef void (*tsd_dtor) (void *); +typedef void (*tls_dtor) (void *); -struct tsd_keys +struct tls_keys { - tsd_dtor dtor[MAX_KEYS]; + tls_dtor dtor[MAX_KEYS]; unsigned int generation[MAX_KEYS]; }; -#define KEY_VALID_P(key) !(tsd_keys.generation[key] & 1) +#define KEY_VALID_P(key) !(tls_keys.generation[key] & 1) /* Note: if MAX_KEYS is increased, this initializer must be updated to match. All the generation counts begin at 1, which means no key is valid. */ -static struct tsd_keys tsd_keys = +static struct tls_keys tls_keys = { { 0, 0, 0, 0 }, { 1, 1, 1, 1 } }; -/* This lock protects the tsd_keys structure. */ -static __gthread_mutex_t tsd_lock; +/* This lock protects the tls_keys structure. */ +static __gthread_mutex_t tls_lock; -static __gthread_once_t tsd_init_guard = __GTHREAD_ONCE_INIT; +static __gthread_once_t tls_init_guard = __GTHREAD_ONCE_INIT; /* Internal routines. */ /* The task TCB has just been deleted. Call the destructor - function for each TSD key that has both a destructor and + function for each TLS key that has both a destructor and a non-NULL specific value in this thread. - This routine does not need to take tsd_lock; the generation + This routine does not need to take tls_lock; the generation count protects us from calling a stale destructor. It does - need to read tsd_keys.dtor[key] atomically. */ + need to read tls_keys.dtor[key] atomically. */ static void -tsd_delete_hook (WIND_TCB *tcb) +tls_delete_hook (void *tcb ATTRIBUTE_UNUSED) { - struct tsd_data *data = __gthread_get_tsd_data (tcb); + struct tls_data *data = __gthread_get_tls_data (); __gthread_key_t key; - if (data) + if (data && data->owner == &self_owner) { - __gthread_enter_tsd_dtor_context (tcb); + __gthread_enter_tls_dtor_context (); for (key = 0; key < MAX_KEYS; key++) { - if (data->generation[key] == tsd_keys.generation[key]) + if (data->generation[key] == tls_keys.generation[key]) { - tsd_dtor dtor = tsd_keys.dtor[key]; + tls_dtor dtor = tls_keys.dtor[key]; if (dtor) dtor (data->values[key]); } } free (data); - __gthread_set_tsd_data (tcb, 0); - __gthread_leave_tsd_dtor_context (tcb); + + /* We can't handle an error here, so just leave the thread + marked as loaded if one occurs. */ + if (__gthread_mutex_lock (&tls_lock) != ERROR) + { + active_tls_threads--; + if (active_tls_threads == 0) + taskDeleteHookDelete ((FUNCPTR)tls_delete_hook); + __gthread_mutex_unlock (&tls_lock); + } + + __gthread_set_tls_data (0); + __gthread_leave_tls_dtor_context (); } } -/* Initialize global data used by the TSD system. */ +/* Initialize global data used by the TLS system. */ static void -tsd_init (void) +tls_init (void) { - taskDeleteHookAdd ((FUNCPTR)tsd_delete_hook); - __GTHREAD_MUTEX_INIT_FUNCTION (&tsd_lock); + __GTHREAD_MUTEX_INIT_FUNCTION (&tls_lock); +} + +static void tls_destructor (void) __attribute__ ((destructor)); +static void +tls_destructor (void) +{ +#ifdef __RTP__ + /* All threads but this one should have exited by now. */ + tls_delete_hook (NULL); +#else + /* Unregister the hook forcibly. The counter of active threads may + be incorrect, because constructors (like the C++ library's) and + destructors (like this one) run in the context of the shell rather + than in a task spawned from this module. */ + taskDeleteHookDelete ((FUNCPTR)tls_delete_hook); +#endif + + if (tls_init_guard.done && __gthread_mutex_lock (&tls_lock) != ERROR) + semDelete (tls_lock); } /* External interface */ @@ -204,13 +258,13 @@ tsd_init (void) this key, with the value as its sole argument. */ int -__gthread_key_create (__gthread_key_t *keyp, tsd_dtor dtor) +__gthread_key_create (__gthread_key_t *keyp, tls_dtor dtor) { __gthread_key_t key; - __gthread_once (&tsd_init_guard, tsd_init); + __gthread_once (&tls_init_guard, tls_init); - if (__gthread_mutex_lock (&tsd_lock) == ERROR) + if (__gthread_mutex_lock (&tls_lock) == ERROR) return errno; for (key = 0; key < MAX_KEYS; key++) @@ -218,14 +272,14 @@ __gthread_key_create (__gthread_key_t *keyp, tsd_dtor dtor) goto found_slot; /* no room */ - __gthread_mutex_unlock (&tsd_lock); + __gthread_mutex_unlock (&tls_lock); return EAGAIN; found_slot: - tsd_keys.generation[key]++; /* making it even */ - tsd_keys.dtor[key] = dtor; + tls_keys.generation[key]++; /* making it even */ + tls_keys.dtor[key] = dtor; *keyp = key; - __gthread_mutex_unlock (&tsd_lock); + __gthread_mutex_unlock (&tls_lock); return 0; } @@ -238,21 +292,21 @@ __gthread_key_delete (__gthread_key_t key) if (key >= MAX_KEYS) return EINVAL; - __gthread_once (&tsd_init_guard, tsd_init); + __gthread_once (&tls_init_guard, tls_init); - if (__gthread_mutex_lock (&tsd_lock) == ERROR) + if (__gthread_mutex_lock (&tls_lock) == ERROR) return errno; if (!KEY_VALID_P (key)) { - __gthread_mutex_unlock (&tsd_lock); + __gthread_mutex_unlock (&tls_lock); return EINVAL; } - tsd_keys.generation[key]++; /* making it odd */ - tsd_keys.dtor[key] = 0; + tls_keys.generation[key]++; /* making it odd */ + tls_keys.dtor[key] = 0; - __gthread_mutex_unlock (&tsd_lock); + __gthread_mutex_unlock (&tls_lock); return 0; } @@ -266,17 +320,17 @@ __gthread_key_delete (__gthread_key_t key) void * __gthread_getspecific (__gthread_key_t key) { - struct tsd_data *data; + struct tls_data *data; if (key >= MAX_KEYS) return 0; - data = __gthread_get_tsd_data (taskTcb (taskIdSelf ())); + data = __gthread_get_tls_data (); if (!data) return 0; - if (data->generation[key] != tsd_keys.generation[key]) + if (data->generation[key] != tls_keys.generation[key]) return 0; return data->values[key]; @@ -289,31 +343,37 @@ __gthread_getspecific (__gthread_key_t key) key_create/key_delete; the worst thing that can happen is that a value is successfully stored into a dead generation (and then immediately becomes invalid). However, we do have to make sure - to read tsd_keys.generation[key] atomically. */ + to read tls_keys.generation[key] atomically. */ int __gthread_setspecific (__gthread_key_t key, void *value) { - struct tsd_data *data; - WIND_TCB *tcb; + struct tls_data *data; unsigned int generation; if (key >= MAX_KEYS) return EINVAL; - tcb = taskTcb (taskIdSelf ()); - data = __gthread_get_tsd_data (tcb); + data = __gthread_get_tls_data (); if (!data) { - data = malloc (sizeof (struct tsd_data)); + if (__gthread_mutex_lock (&tls_lock) == ERROR) + return ENOMEM; + if (active_tls_threads == 0) + taskDeleteHookAdd ((FUNCPTR)tls_delete_hook); + active_tls_threads++; + __gthread_mutex_unlock (&tls_lock); + + data = malloc (sizeof (struct tls_data)); if (!data) return ENOMEM; - memset (data, 0, sizeof (struct tsd_data)); - __gthread_set_tsd_data (tcb, data); + memset (data, 0, sizeof (struct tls_data)); + data->owner = &self_owner; + __gthread_set_tls_data (data); } - generation = tsd_keys.generation[key]; + generation = tls_keys.generation[key]; if (generation & 1) return EINVAL; @@ -323,3 +383,4 @@ __gthread_setspecific (__gthread_key_t key, void *value) return 0; } +#endif /* __GTHREADS */ diff --git a/contrib/gcc/config/vxworks.h b/contrib/gcc/config/vxworks.h index 085eb8ce648..70345e24608 100644 --- a/contrib/gcc/config/vxworks.h +++ b/contrib/gcc/config/vxworks.h @@ -1,64 +1,103 @@ -/* Common VxWorks target definitions for GCC. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Common VxWorks target definitions for GNU compiler. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Wind River Systems. + Rewritten by CodeSourcery, LLC. This file is part of GCC. -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. 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. */ +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ -/* Specify what to link with. */ -/* VxWorks does all the library stuff itself. */ -#undef LIB_SPEC -#define LIB_SPEC "" +/* In kernel mode, VxWorks provides all the libraries itself, as well as + the functionality of startup files, etc. In RTP mode, it behaves more + like a traditional Unix, with more external files. Most of our specs + must be aware of the difference. */ -#undef LINK_SPEC -#define LINK_SPEC "-r" +/* The directory containing the VxWorks target headers. */ +#define VXWORKS_TARGET_DIR "/home/tornado/base6/target" -/* VxWorks provides the functionality of crt0.o and friends itself. */ -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "" +/* Since we provide a default -isystem, expand -isystem on the command + line early. */ +#undef VXWORKS_ADDITIONAL_CPP_SPEC +#define VXWORKS_ADDITIONAL_CPP_SPEC " \ + %{!nostdinc:%{isystem*}} \ + %{mrtp: -D__RTP__=1 \ + %{!nostdinc:-isystem " VXWORKS_TARGET_DIR "/usr/h}} \ + %{!mrtp:-D_WRS_KERNEL=1 \ + %{!nostdinc:-isystem " VXWORKS_TARGET_DIR "/h}}" -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "" +/* The references to __init and __fini will be satisfied by + libc_internal.a. */ +#undef VXWORKS_LIB_SPEC +#define VXWORKS_LIB_SPEC \ +"%{mrtp:%{shared:-u " USER_LABEL_PREFIX "__init -u " USER_LABEL_PREFIX "__fini} \ + %{!shared:%{non-static:-u " USER_LABEL_PREFIX "_STI__6__rtld -ldl} \ + --start-group -lc -lgcc -lc_internal -lnet -ldsi \ + --end-group}}" -/* VxWorks cannot have dots in constructor labels, because it uses a - mutant variation of collect2 that generates C code instead of - assembly. Thus each constructor label must be a legitimate C - symbol. FIXME: Have VxWorks use real collect2 instead. */ +/* The no-op spec for "-shared" below is present because otherwise GCC + will treat it as an unrecognized option. */ +#undef VXWORKS_LINK_SPEC +#define VXWORKS_LINK_SPEC \ +"%{!mrtp:-r} \ + %{!shared: \ + %{mrtp:-q %{h*} \ + %{R*} %{!Wl,-T*: %{!T*: %(link_start) }} \ + %(link_target) %(link_os)}} \ + %{v:-V} \ + %{shared:-shared} \ + %{Bstatic:-Bstatic} \ + %{Bdynamic:-Bdynamic} \ + %{!Xbind-lazy:-z now} \ + %{Xbind-now:%{Xbind-lazy: \ + %e-Xbind-now and -Xbind-lazy are incompatible}} \ + %{mrtp:%{!shared:%{!non-static:-static} \ + %{non-static:--force-dynamic --export-dynamic}}}" -#undef NO_DOLLAR_IN_LABEL -#define NO_DOT_IN_LABEL +/* For VxWorks, the system provides libc_internal.a. This is a superset + of libgcc.a; we want to use it. Make sure not to dynamically export + any of its symbols, though. Always look for libgcc.a first so that + we get the latest versions of the GNU intrinsics during our builds. */ +#undef VXWORKS_LIBGCC_SPEC +#define VXWORKS_LIBGCC_SPEC \ + "-lgcc %{mrtp:--exclude-libs=libc_internal,libgcc -lc_internal}" -/* enable #pragma pack(n) */ -#define HANDLE_SYSV_PRAGMA +#undef VXWORKS_STARTFILE_SPEC +#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:crt0.o%s}}" +#define VXWORKS_ENDFILE_SPEC "" -/* No underscore is prepended to any C symbol name. */ -#undef USER_LABEL_PREFIX -#define USER_LABEL_PREFIX "" +/* We can use .ctors/.dtors sections only in RTP mode. + Unfortunately this must be an integer constant expression; + fix up in override_options. */ +#undef VXWORKS_OVERRIDE_OPTIONS +#define VXWORKS_OVERRIDE_OPTIONS do { \ + targetm.have_ctors_dtors = TARGET_VXWORKS_RTP; \ +} while (0) -/* VxWorks uses wchar_t == unsigned short (UCS2) on all architectures. */ -#undef WCHAR_TYPE -#define WCHAR_TYPE "short unsigned int" -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE 16 +/* The VxWorks runtime uses a clever trick to get the sentinel entry + (-1) inserted at the beginning of the .ctors segment. This trick + will not work if we ever generate any entries in plain .ctors + sections; we must always use .ctors.PRIORITY. */ +#define ALWAYS_NUMBER_CTORS_SECTIONS 1 -/* Dwarf2 unwind info is not supported. */ -#define DWARF2_UNWIND_INFO 0 -/* Weak symbols and link-once sections are not enabled by default. */ -#define DEFAULT_USE_WEAK 0 +/* The name of the symbol for the table of GOTs in a particular + RTP. */ +#define VXWORKS_GOTT_BASE "__GOTT_BASE__" +/* The name of the symbol for the index into the table of GOTs for the + GOT associated with the current shared library. */ +#define VXWORKS_GOTT_INDEX "__GOTT_INDEX__" -/* Only supported debug format is Dwarf2. */ -#undef DBX_DEBUGGING_INFO +#define VXWORKS_KIND VXWORKS_KIND_NORMAL diff --git a/contrib/gcc/config/vxworks.opt b/contrib/gcc/config/vxworks.opt new file mode 100644 index 00000000000..98a44f57a6c --- /dev/null +++ b/contrib/gcc/config/vxworks.opt @@ -0,0 +1,32 @@ +; Processor-independent options for VxWorks. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by CodeSourcery, LLC. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 2, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; 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, 51 Franklin Street, Fifth Floor, Boston, MA +; 02110-1301, USA. + +mrtp +Target Report RejectNegative Mask(VXWORKS_RTP) Condition(VXWORKS_KIND == VXWORKS_KIND_NORMAL) +Assume the VxWorks RTP environment + +; VxWorks AE has two modes: kernel mode and vThreads mode. In +; general, back ends do not actually need to know which mode they're +; in, so we do not have to set any flags. +mvthreads +Target RejectNegative Condition(VXWORKS_KIND == VXWORKS_KIND_AE) +Assume the VxWorks vThreads environment diff --git a/contrib/gcc/config/vxworksae.h b/contrib/gcc/config/vxworksae.h new file mode 100644 index 00000000000..b63192ecb15 --- /dev/null +++ b/contrib/gcc/config/vxworksae.h @@ -0,0 +1,58 @@ +/* Common VxWorks AE target definitions for GNU compiler. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by CodeSourcery, LLC. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +/* This header should be included after including vx-common.h. */ + +/* Most of the definitions below this point are versions of the + vxworks.h definitions, without the -mrtp bits. */ + +/* The directory containing the VxWorks AE target headers. */ +#define VXWORKSAE_TARGET_DIR \ + "/home/tornado/vxworks-ae/latest/target" + +/* Include target/vThreads/h or target/h (depending on the compilation + mode), and then target/val/h (in either mode). The macros defined + are in the user's namespace, but the VxWorks headers require + them. */ +#undef VXWORKS_ADDITIONAL_CPP_SPEC +#define VXWORKS_ADDITIONAL_CPP_SPEC " \ + %{!nostdinc:%{isystem*}} \ + %{mvthreads:-DVTHREADS=1 \ + %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR "/vThreads/h}} \ + %{!mvthreads:-DAE653_BUILD=1 \ + %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR "/h}} \ + %{!nostdinc:-isystem " VXWORKSAE_TARGET_DIR "/val/h}" + +#undef VXWORKS_LIB_SPEC +#define VXWORKS_LIB_SPEC "" + +#undef VXWORKS_LINK_SPEC +#define VXWORKS_LINK_SPEC \ + "-r %{v:-V}" + +#undef VXWORKS_LIBGCC_SPEC +#define VXWORKS_LIBGCC_SPEC \ + "-lgcc" + +#undef VXWORKS_STARTFILE_SPEC +#define VXWORKS_STARTFILE_SPEC "" + +#define VXWORKS_KIND VXWORKS_KIND_AE diff --git a/contrib/gcc/config/windiss.h b/contrib/gcc/config/windiss.h index 7aef9b67881..0c1eae1de6f 100644 --- a/contrib/gcc/config/windiss.h +++ b/contrib/gcc/config/windiss.h @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* windiss uses wchar_t == unsigned short (UCS2) on all architectures. */ diff --git a/contrib/gcc/config/x-darwin b/contrib/gcc/config/x-darwin new file mode 100644 index 00000000000..c2ffd7d5c89 --- /dev/null +++ b/contrib/gcc/config/x-darwin @@ -0,0 +1,3 @@ +host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h toplev.h config/host-darwin.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/contrib/gcc/config/x-hpux b/contrib/gcc/config/x-hpux new file mode 100644 index 00000000000..fa0c5553c3d --- /dev/null +++ b/contrib/gcc/config/x-hpux @@ -0,0 +1,4 @@ +host-hpux.o : $(srcdir)/config/host-hpux.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/host-hpux.c diff --git a/contrib/gcc/config/x-linux b/contrib/gcc/config/x-linux index d14586b0b36..e4aa040bceb 100644 --- a/contrib/gcc/config/x-linux +++ b/contrib/gcc/config/x-linux @@ -1,4 +1,4 @@ host-linux.o : $(srcdir)/config/host-linux.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h + coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/host-linux.c diff --git a/contrib/gcc/config/x-solaris b/contrib/gcc/config/x-solaris index 782f4a36802..59c7bf61f5c 100644 --- a/contrib/gcc/config/x-solaris +++ b/contrib/gcc/config/x-solaris @@ -1,4 +1,4 @@ host-solaris.o : $(srcdir)/config/host-solaris.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h + coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/host-solaris.c diff --git a/contrib/gcc/configure b/contrib/gcc/configure index 91f9326d9b2..a248d39c213 100755 --- a/contrib/gcc/configure +++ b/contrib/gcc/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP GNATBIND ac_ct_GNATBIND strict1_warn warn_cflags WERROR nocommon_flag EGREP valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN LN_S RANLIB ac_ct_RANLIB INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LIBICONV_DEP manext objext extra_modes_file FORBUILD PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS CROSS ALL SYSTEM_HEADER_DIR inhibit_libc BUILD_PREFIX BUILD_PREFIX_1 CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO libgcc_visibility gthread_flags GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir gcc_version gcc_version_full gcc_version_trigger host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure symbolic_link thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines target_noncanonical c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -770,6 +770,14 @@ ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP +ac_env_GMPLIBS_set=${GMPLIBS+set} +ac_env_GMPLIBS_value=$GMPLIBS +ac_cv_env_GMPLIBS_set=${GMPLIBS+set} +ac_cv_env_GMPLIBS_value=$GMPLIBS +ac_env_GMPINC_set=${GMPINC+set} +ac_env_GMPINC_value=$GMPINC +ac_cv_env_GMPINC_set=${GMPINC+set} +ac_cv_env_GMPINC_value=$GMPINC # # Report the --help message. @@ -854,14 +862,17 @@ Optional Features: put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex. + --enable-werror-always enable -Werror always --enable-werror enable -Werror in bootstrap stage2 and later --enable-checking=LIST enable expensive run-time checks. With LIST, enable only specific categories of checks. - Categories are: misc,tree,rtl,rtlflag,gc,gcac,fold; - default is no checking + Categories are: yes,no,all,none,release. + Flags are: assert,fold,gc,gcac,misc, + rtlflag,rtl,runtime,tree,valgrind. + --enable-mapped-location location_t is fileline integer cookie --enable-coverage=LEVEL - enable compiler\'s code coverage collection. + enable compiler's code coverage collection. Use to measure compiler performance and locate unused parts of the compiler. With LEVEL, specify optimization. Values are opt, noopt, @@ -869,15 +880,21 @@ Optional Features: --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering --enable-multilib enable library support for multiple ABIs --enable-__cxa_atexit enable __cxa_atexit for C++ + --enable-decimal-float enable decimal float extension to C --enable-threads enable thread usage for target GCC --enable-threads=LIB use LIB thread package for target GCC + --enable-tls enable or disable generation of tls code + overriding the assembler check for tls support --enable-objc-gc enable the use of Boehm's garbage collector with the GNU Objective-C runtime --disable-shared don't provide a shared libgcc --enable-intermodule build the compiler in one step + --enable-languages=LIST specify which front-ends to build + --disable-rpath do not hardcode runtime library paths --enable-initfini-array use .init_array/.fini_array sections --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling + --enable-secureplt enable -msecure-plt by default for PowerPC --disable-win32-registry disable lookup of installation paths in the Registry on Windows hosts @@ -895,6 +912,7 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-build-libsubdir=DIR Directory where to find libraries for build system --with-local-prefix=DIR specifies directory to put local include --with-gxx-include-dir=DIR specifies directory to put g++ header files @@ -903,17 +921,26 @@ Optional Packages: (relative to PREFIX) as well as PREFIX/bin --with-gnu-ld arrange to work with GNU ld. --with-ld arrange to use the specified ld (full pathname) + --with-demangler-in-ld try to use demangler in GNU ld. --with-gnu-as arrange to work with GNU as --with-as arrange to use the specified as (full pathname) --with-stabs arrange to use stabs instead of host debug format --with-dwarf2 force the default debug format to be DWARF 2 + --with-build-sysroot=sysroot + use sysroot as the system root during the build --with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR. - --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-system-libunwind use installed libunwind - --with-gc={simple,page,zone} choose the garbage collection mechanism to use + --with-long-double-128 Use 128-bit long double by default. + --with-gc={page,zone} choose the garbage collection mechanism to use with the compiler --with-system-zlib use installed libz - --with-slibdir=DIR shared libraries in DIR LIBDIR + --with-slibdir=DIR shared libraries in DIR [LIBDIR] + --with-datarootdir=DIR Use DIR as the data root [PREFIX/share] + --with-docdir=DIR Install documentation in DIR [DATAROOTDIR] + --with-htmldir=DIR html documentation in in DIR [DOCDIR] Some influential environment variables: CC C compiler command @@ -923,6 +950,8 @@ Some influential environment variables: CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor + GMPLIBS How to link GMP + GMPINC How to find GMP include files Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1366,6 +1395,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers auto-host.h:config.in" +gcc_version=`cat $srcdir/BASE-VER` + # Determine the host, build, and target systems ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do @@ -1492,11 +1523,36 @@ esac esac + + # Determine the target- and build-specific subdirectories - # Prefix 'build-' so this never conflicts with target_subdir. + +# post-stage1 host modules use a different CC_FOR_BUILD so, in order to +# have matching libraries, they should use host libraries: Makefile.tpl +# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR). +# However, they still use the build modules, because the corresponding +# host modules (e.g. bison) are only built for the host when bootstrap +# finishes. So: +# - build_subdir is where we find build modules, and never changes. +# - build_libsubdir is where we find build libraries, and can be overridden. + +# Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" -# Not really a subdirectory, but here for completeness. -host_subdir=. + +# Check whether --with-build-libsubdir or --without-build-libsubdir was given. +if test "${with_build_libsubdir+set}" = set; then + withval="$with_build_libsubdir" + build_libsubdir="$withval" +else + build_libsubdir="$build_subdir" +fi; +# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories +if ( test $srcdir = . && test -d gcc ) \ + || test -d $srcdir/../host-${host_noncanonical}; then + host_subdir="host-${host_noncanonical}" +else + host_subdir=. +fi # No prefix. target_subdir=${target_noncanonical} @@ -1621,12 +1677,16 @@ no) ;; esac fi; +# This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO. if test x${gcc_gxx_include_dir} = x; then if test x${enable_version_specific_runtime_libs} = xyes; then gcc_gxx_include_dir='${libsubdir}/include/c++' else - topsrcdir=${srcdir}/.. . ${srcdir}/../config.if - gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir} + libstdcxx_incdir='include/c++/$(version)' + if test x$host != x$target; then + libstdcxx_incdir="$target_alias/$libstdcxx_incdir" + fi + gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/$libstdcxx_incdir" fi fi @@ -1692,8 +1752,9 @@ if test "${with_ld+set}" = set; then fi; if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then - { echo "$as_me:$LINENO: WARNING: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&5 -echo "$as_me: WARNING: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&2;} + { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&5 +echo "$as_me: error: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&2;} + { (exit 1); exit 1; }; } elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gnu_ld_flag=yes fi @@ -1719,6 +1780,16 @@ else echo "${ECHO_T}no" >&6 fi +# With demangler in GNU ld + +# Check whether --with-demangler-in-ld or --without-demangler-in-ld was given. +if test "${with_demangler_in_ld+set}" = set; then + withval="$with_demangler_in_ld" + demangler_in_ld="$with_demangler_in_ld" +else + demangler_in_ld=no +fi; + # ---------------------- # Find default assembler # ---------------------- @@ -1741,8 +1812,9 @@ if test "${with_as+set}" = set; then fi; if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test ! -x "$DEFAULT_ASSEMBLER"; then - { echo "$as_me:$LINENO: WARNING: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&5 -echo "$as_me: WARNING: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&2;} + { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&5 +echo "$as_me: error: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&2;} + { (exit 1); exit 1; }; } elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gas_flag=yes fi @@ -2802,6 +2874,22 @@ _ACEOF fi +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + # autoconf is lame and doesn't give us any substitution variable for this. if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then NO_MINUS_C_MINUS_O=yes @@ -2811,68 +2899,18 @@ fi +# Remove the -O2: for historical reasons, unless bootstrapping we prefer +# optimizations to be activated explicitly by the toplevel. +case "$CC" in + */prev-gcc/xgcc*) ;; + *) CFLAGS=`echo $CFLAGS | sed "s/-O[s0-9]* *//" ` ;; +esac + + # ------------------------- # Check C compiler features # ------------------------- - -echo "$as_me:$LINENO: checking whether ${CC-cc} accepts -Wno-long-long" >&5 -echo $ECHO_N "checking whether ${CC-cc} accepts -Wno-long-long... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_no_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - save_CFLAGS="$CFLAGS" -CFLAGS="-Wno-long-long" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_no_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_no_long_long=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$save_CFLAGS" -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_no_long_long" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_no_long_long" >&6 - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3107,6 +3145,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then @@ -3179,873 +3218,7 @@ _ACEOF esac -echo "$as_me:$LINENO: checking for long long int" >&5 -echo $ECHO_N "checking for long long int... $ECHO_C" >&6 -if test "${ac_cv_c_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -long long int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_long_long=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_long_long" >&5 -echo "${ECHO_T}$ac_cv_c_long_long" >&6 - if test $ac_cv_c_long_long = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - - fi -echo "$as_me:$LINENO: checking for __int64" >&5 -echo $ECHO_N "checking for __int64... $ECHO_C" >&6 -if test "${ac_cv_c___int64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -__int64 i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c___int64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c___int64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c___int64" >&5 -echo "${ECHO_T}$ac_cv_c___int64" >&6 - if test $ac_cv_c___int64 = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE___INT64 1 -_ACEOF - - fi - -echo "$as_me:$LINENO: checking for built-in _Bool" >&5 -echo $ECHO_N "checking for built-in _Bool... $ECHO_C" >&6 -if test "${gcc_cv_c__bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -_Bool foo; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gcc_cv_c__bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gcc_cv_c__bool=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $gcc_cv_c__bool" >&5 -echo "${ECHO_T}$gcc_cv_c__bool" >&6 -if test $gcc_cv_c__bool = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE__BOOL 1 -_ACEOF - -fi - - # sizeof(char) is 1 by definition. -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 -if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (void *) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_void_p=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_void_p != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_void_p = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for void *" >&5 -echo "$as_me: error: cannot determine a size for void *" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 -if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (short) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_short=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_short != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_short = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for short" >&5 -echo "$as_me: error: cannot determine a size for short" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - - -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (int) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_int=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_int != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_int = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for int" >&5 -echo "$as_me: error: cannot determine a size for int" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (long) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_long = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for long" >&5 -echo "$as_me: error: cannot determine a size for long" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -if test $ac_cv_c_long_long = yes; then - echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (long long) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long_long=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long_long != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_long_long = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for long long" >&5 -echo "$as_me: error: cannot determine a size for long long" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -fi -if test $ac_cv_c___int64 = yes; then - echo "$as_me:$LINENO: checking size of __int64" >&5 -echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 -if test "${ac_cv_sizeof___int64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (__int64) == $ac_size):; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof___int64=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof___int64 != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof___int64 = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for __int64" >&5 -echo "$as_me: error: cannot determine a size for __int64" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 -echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 -_ACEOF - - -fi - -# ----------------- -# Find Ada compiler -# ----------------- - -# See if GNAT has been installed - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. -set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_GNATBIND+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$GNATBIND"; then - ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -GNATBIND=$ac_cv_prog_GNATBIND -if test -n "$GNATBIND"; then - echo "$as_me:$LINENO: result: $GNATBIND" >&5 -echo "${ECHO_T}$GNATBIND" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_GNATBIND"; then - ac_ct_GNATBIND=$GNATBIND - # Extract the first word of "gnatbind", so it can be a program name with args. -set dummy gnatbind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_GNATBIND+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_GNATBIND"; then - ac_cv_prog_ac_ct_GNATBIND="$ac_ct_GNATBIND" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GNATBIND="gnatbind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_GNATBIND" && ac_cv_prog_ac_ct_GNATBIND="no" -fi -fi -ac_ct_GNATBIND=$ac_cv_prog_ac_ct_GNATBIND -if test -n "$ac_ct_GNATBIND"; then - echo "$as_me:$LINENO: result: $ac_ct_GNATBIND" >&5 -echo "${ECHO_T}$ac_ct_GNATBIND" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - GNATBIND=$ac_ct_GNATBIND -else - GNATBIND="$ac_cv_prog_GNATBIND" -fi - -echo "$as_me:$LINENO: checking whether compiler driver understands Ada" >&5 -echo $ECHO_N "checking whether compiler driver understands Ada... $ECHO_C" >&6 -if test "${gcc_cv_cc_supports_ada+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.adb <&1 || echo failure` -if test x"$errors" = x && test -f conftest.$ac_objext; then - gcc_cv_cc_supports_ada=yes - break -fi -rm -f conftest.* -fi -echo "$as_me:$LINENO: result: $gcc_cv_cc_supports_ada" >&5 -echo "${ECHO_T}$gcc_cv_cc_supports_ada" >&6 - -if test x$GNATBIND != xno && test x$gcc_cv_cc_supports_ada != xno; then - have_gnat=yes -else - have_gnat=no -fi - - -# --------------------- -# Warnings and checking -# --------------------- - -strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes ; then - strict1_warn="-pedantic -Wno-long-long" -fi - - -# If the native compiler is GCC, we can enable warnings even in stage1. -# That's useful for people building cross-compilers, or just running a -# quick `make'. -warn_cflags= -if test "x$GCC" = "xyes"; then - warn_cflags='$(GCC_WARN_CFLAGS)' -fi - - -# Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. -# Check whether --enable-werror or --disable-werror was given. -if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - -else - enable_werror=no -fi; -if test x$enable_werror = xyes ; then - WERROR=-Werror -fi - - -# Enable expensive internal checks -# Check whether --enable-checking or --disable-checking was given. -if test "${enable_checking+set}" = set; then - enableval="$enable_checking" - ac_checking= -ac_tree_checking= -ac_rtl_checking= -ac_rtlflag_checking= -ac_gc_checking= -ac_gc_always_collect= -ac_fold_checking= -case "${enableval}" in -yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ; - ac_rtlflag_checking=1 ;; -no) ;; -*) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," - set fnord $enableval; shift - IFS="$ac_save_IFS" - for check - do - case $check in - misc) ac_checking=1 ;; - tree) ac_tree_checking=1 ;; - rtlflag) ac_rtlflag_checking=1 ;; - rtl) ac_rtl_checking=1 ;; - gc) ac_gc_checking=1 ;; - gcac) ac_gc_always_collect=1 ;; - fold) ac_fold_checking=1 ;; - valgrind) ac_checking_valgrind=1 ;; - *) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5 -echo "$as_me: error: unknown check category $check" >&2;} - { (exit 1); exit 1; }; } ;; - esac - done - ;; -esac - -else - # By default, disable all checks for release versions of GCC. -ac_checking=; ac_tree_checking=; ac_gc_checking=; ac_rtlflag_checking=; -fi; -nocommon_flag="" -if test x$ac_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_CHECKING 1 -_ACEOF - - nocommon_flag=-fno-common -fi - -if test x$ac_tree_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_TREE_CHECKING 1 -_ACEOF - -fi -if test x$ac_rtl_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_RTL_CHECKING 1 -_ACEOF - -fi -if test x$ac_rtlflag_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_RTL_FLAG_CHECKING 1 -_ACEOF - -fi -if test x$ac_gc_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_GC_CHECKING 1 -_ACEOF - -fi -if test x$ac_gc_always_collect != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_GC_ALWAYS_COLLECT 1 -_ACEOF - -fi -if test x$ac_fold_checking != x ; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_FOLD_CHECKING 1 -_ACEOF - -fi -valgrind_path_defines= -valgrind_command= - echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 @@ -4300,6 +3473,3143 @@ fi done +echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 +if test "${ac_cv_type_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((void * *) 0) + return 0; +if (sizeof (void *)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_void_p=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 + +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +if test "${ac_cv_sizeof_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (void *))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_void_p=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_void_p=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((short *) 0) + return 0; +if (sizeof (short)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 +if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + +echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long long)); } +unsigned long ulongval () { return (long) (sizeof (long long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +fi + +echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +if test "${ac_cv_type___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((__int64 *) 0) + return 0; +if (sizeof (__int64)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type___int64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6 +if test $ac_cv_type___int64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE___INT64 1 +_ACEOF + +echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +if test "${ac_cv_type___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((__int64 *) 0) + return 0; +if (sizeof (__int64)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type___int64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6 + +echo "$as_me:$LINENO: checking size of __int64" >&5 +echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int64" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int64=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (__int64)); } +unsigned long ulongval () { return (long) (sizeof (__int64)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int64))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof___int64=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int64=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + +fi + + +# --------------------- +# Warnings and checking +# --------------------- + +# Check $CC warning features (if it's GCC). +# We want to use -pedantic, but we don't want warnings about +# * 'long long' +# * variadic macros +# * overlong strings +# So, we only use -pedantic if we can disable those warnings. + +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-long-long" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-long-long... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_no_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-long-long" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_no_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_no_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_long_long" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_long_long" >&6 + +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-variadic-macros" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-variadic-macros... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_no_variadic_macros+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-variadic-macros" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_no_variadic_macros=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_no_variadic_macros=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_variadic_macros" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_variadic_macros" >&6 + +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-overlength-strings" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-overlength-strings... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_no_overlength_strings+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-overlength-strings" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_no_overlength_strings=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_no_overlength_strings=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_overlength_strings" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_overlength_strings" >&6 + +strict1_warn= +if test $ac_cv_prog_cc_w_no_long_long = yes \ + && test $ac_cv_prog_cc_w_no_variadic_macros = yes \ + && test $ac_cv_prog_cc_w_no_overlength_strings = yes ; then + strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings" +fi + +# Add -Wold-style-definition if it's accepted +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wold-style-definition" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wold-style-definition... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_old_style_definition+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wold-style-definition" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_old_style_definition=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_old_style_definition=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_old_style_definition" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_old_style_definition" >&6 +if test $ac_cv_prog_cc_w_old_style_definition = yes ; then + strict1_warn="${strict1_warn} -Wold-style-definition" +fi + +# Add -Wmissing-format-attribute if it's accepted +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wmissing-format-attribute" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wmissing-format-attribute... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_missing_format_attribute+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wmissing-format-attribute" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_missing_format_attribute=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_missing_format_attribute=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_missing_format_attribute" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_missing_format_attribute" >&6 +if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then + strict1_warn="${strict1_warn} -Wmissing-format-attribute" +fi + +# Enable -Werror, period. +# Check whether --enable-werror_always or --disable-werror_always was given. +if test "${enable_werror_always+set}" = set; then + enableval="$enable_werror_always" + +else + enable_werror_always=no +fi; +if test x${enable_werror_always} = xyes ; then + strict1_warn="${strict1_warn} -Werror" + WERROR=-Werror +fi + + + +# Get C++ compatibility warning flag, if supported. +echo "$as_me:$LINENO: checking whether ${CC} accepts -Wc++-compat" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wc++-compat... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_w_cxx_compat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="-Wc++-compat" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_w_cxx_compat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_w_cxx_compat=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_cxx_compat" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_cxx_compat" >&6 +if test x${ac_cv_prog_cc_w_cxx_compat} = xyes; then + cxx_compat_warn="-Wc++-compat" +fi + + + +# If the native compiler is GCC, we can enable warnings even in stage1. +# That's useful for people building cross-compilers, or just running a +# quick `make'. +warn_cflags= +if test "x$GCC" = "xyes"; then + warn_cflags='$(GCC_WARN_CFLAGS)' +fi + + +# Enable -Werror in bootstrap stage2 and later. +is_release= +if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then + is_release=yes +fi +# Check whether --enable-werror or --disable-werror was given. +if test "${enable_werror+set}" = set; then + enableval="$enable_werror" + +else + if test x$is_release = x ; then + # Default to "yes" on development branches. + enable_werror=yes +else + # Default to "no" on release branches. + enable_werror=no +fi +fi; +if test x$enable_werror = xyes ; then + WERROR=-Werror +fi + + +# Enable expensive internal checks +# Check whether --enable-checking or --disable-checking was given. +if test "${enable_checking+set}" = set; then + enableval="$enable_checking" + ac_checking_flags="${enableval}" +else + +# Determine the default checks. +if test x$is_release = x ; then + ac_checking_flags=yes +else + ac_checking_flags=release +fi +fi; +ac_assert_checking=1 +ac_checking= +ac_fold_checking= +ac_gc_checking= +ac_gc_always_collect= +ac_rtl_checking= +ac_rtlflag_checking= +ac_runtime_checking=1 +ac_tree_checking= +ac_valgrind_checking= +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in $ac_checking_flags +do + case $check in + # these set all the flags to specific states + yes) ac_assert_checking=1 ; ac_checking=1 ; + ac_fold_checking= ; ac_gc_checking=1 ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + no|none) ac_assert_checking= ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking= ; + ac_tree_checking= ; ac_valgrind_checking= ;; + all) ac_assert_checking=1 ; ac_checking=1 ; + ac_fold_checking=1 ; ac_gc_checking=1 ; + ac_gc_always_collect=1 ; ac_rtl_checking=1 ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + release) ac_assert_checking=1 ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking=1 ; + ac_tree_checking= ; ac_valgrind_checking= ;; + # these enable particular checks + assert) ac_assert_checking=1 ;; + fold) ac_fold_checking=1 ;; + gc) ac_gc_checking=1 ;; + gcac) ac_gc_always_collect=1 ;; + misc) ac_checking=1 ;; + rtl) ac_rtl_checking=1 ;; + rtlflag) ac_rtlflag_checking=1 ;; + runtime) ac_runtime_checking=1 ;; + tree) ac_tree_checking=1 ;; + valgrind) ac_valgrind_checking=1 ;; + *) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5 +echo "$as_me: error: unknown check category $check" >&2;} + { (exit 1); exit 1; }; } ;; + esac +done +IFS="$ac_save_IFS" + +nocommon_flag="" +if test x$ac_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CHECKING 1 +_ACEOF + + nocommon_flag=-fno-common +fi + +if test x$ac_assert_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_ASSERT_CHECKING 1 +_ACEOF + +fi + +if test x$ac_runtime_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RUNTIME_CHECKING 1 +_ACEOF + +fi +if test x$ac_tree_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_TREE_CHECKING 1 +_ACEOF + + TREEBROWSER=tree-browser.o +fi + +if test x$ac_rtl_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RTL_CHECKING 1 +_ACEOF + +fi +if test x$ac_rtlflag_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RTL_FLAG_CHECKING 1 +_ACEOF + +fi +if test x$ac_gc_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GC_CHECKING 1 +_ACEOF + +fi +if test x$ac_gc_always_collect != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_GC_ALWAYS_COLLECT 1 +_ACEOF + +fi +if test x$ac_fold_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_FOLD_CHECKING 1 +_ACEOF + +fi +valgrind_path_defines= +valgrind_command= + if test "${ac_cv_header_valgrind_h+set}" = set; then echo "$as_me:$LINENO: checking for valgrind.h" >&5 echo $ECHO_N "checking for valgrind.h... $ECHO_C" >&6 @@ -4445,7 +6755,7 @@ fi -if test x$ac_checking_valgrind != x ; then +if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 @@ -4630,22 +6940,42 @@ fi +# Check whether --enable-mapped-location or --disable-mapped-location was given. +if test "${enable_mapped_location+set}" = set; then + enableval="$enable_mapped_location" + +else + enable_mapped_location=no +fi; + +if test "$enable_mapped_location" = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define USE_MAPPED_LOCATION 1 +_ACEOF + +fi + # Enable code coverage collection # Check whether --enable-coverage or --disable-coverage was given. if test "${enable_coverage+set}" = set; then enableval="$enable_coverage" case "${enableval}" in -yes|noopt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" - ;; -opt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" - ;; -*) - { { echo "$as_me:$LINENO: error: unknown coverage setting $enableval" >&5 + yes|noopt) + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" + ;; + opt) + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" + ;; + no) + # a.k.a. --disable-coverage + coverage_flags="" + ;; + *) + { { echo "$as_me:$LINENO: error: unknown coverage setting $enableval" >&5 echo "$as_me: error: unknown coverage setting $enableval" >&2;} { (exit 1); exit 1; }; } - ;; + ;; esac else coverage_flags="" @@ -4698,6 +7028,37 @@ if test "${enable___cxa_atexit+set}" = set; then fi; +# Enable C extension for decimal float if target supports it. +# Check whether --enable-decimal-float or --disable-decimal-float was given. +if test "${enable_decimal_float+set}" = set; then + enableval="$enable_decimal_float" + + if test x$enablevar = xyes ; then + case $target in + powerpc*-*-linux* | i?86*-*-linux*) + enable_decimal_float=yes + ;; + *) + { echo "$as_me:$LINENO: WARNING: decimal float is not supported for this target" >&5 +echo "$as_me: WARNING: decimal float is not supported for this target" >&2;} + enable_decimal_float=no + ;; + esac + fi + +else + enable_decimal_float=no +fi; + + + +dfp=`if test $enable_decimal_float = yes; then echo 1; else echo 0; fi` + +cat >>confdefs.h <<_ACEOF +#define ENABLE_DECIMAL_FLOAT $dfp +_ACEOF + + # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package @@ -4708,8 +7069,23 @@ if test "${enable_threads+set}" = set; then else enable_threads='' fi; -# Save in case it gets overwritten in config.gcc -enable_threads_flag=$enable_threads + +# Check whether --enable-tls or --disable-tls was given. +if test "${enable_tls+set}" = set; then + enableval="$enable_tls" + + case $enable_tls in + yes | no) ;; + *) { { echo "$as_me:$LINENO: error: '$enable_tls' is an invalid value for --enable-tls. +Valid choices are 'yes' and 'no'." >&5 +echo "$as_me: error: '$enable_tls' is an invalid value for --enable-tls. +Valid choices are 'yes' and 'no'." >&2;} + { (exit 1); exit 1; }; } ;; + esac + +else + enable_tls='' +fi; # Check whether --enable-objc-gc or --disable-objc-gc was given. if test "${enable_objc_gc+set}" = set; then @@ -4756,6 +7132,13 @@ fi; +# Check whether --with-build-sysroot or --without-build-sysroot was given. +if test "${with_build_sysroot+set}" = set; then + withval="$with_build_sysroot" + +fi; + + # Check whether --with-sysroot or --without-sysroot was given. if test "${with_sysroot+set}" = set; then withval="$with_sysroot" @@ -4809,6 +7192,38 @@ else fi; +# Sanity check enable_languages in case someone does not run the toplevel +# configure # script. +# Check whether --enable-languages or --disable-languages was given. +if test "${enable_languages+set}" = set; then + enableval="$enable_languages" + case ,${enable_languages}, in + ,,|,yes,) + # go safe -- we cannot be much sure without the toplevel + # configure's + # analysis of which target libs are present and usable + enable_languages=c + ;; + *,all,*) + { { echo "$as_me:$LINENO: error: only the toplevel supports --enable-languages=all" >&5 +echo "$as_me: error: only the toplevel supports --enable-languages=all" >&2;} + { (exit 1); exit 1; }; } + ;; + *,c,*) + ;; + *) + enable_languages=c,${enable_languages} + ;; +esac +else + enable_languages=c +fi; + +# Used by documentation targets + + + + # ------------------------- # Checks for other programs # ------------------------- @@ -4884,7 +7299,7 @@ fi test -n "$AWK" && break done -# We need awk to run opts.sh (to create options.c and options.h). +# We need awk to create options.c and options.h. # Bail out if it's missing. case ${AWK} in "") { { echo "$as_me:$LINENO: error: can't build without awk, bailing out" >&5 @@ -4892,41 +7307,6 @@ echo "$as_me: error: can't build without awk, bailing out" >&2;} { (exit 1); exit 1; }; } ;; esac -echo "$as_me:$LINENO: checking whether ln works" >&5 -echo $ECHO_N "checking whether ln works... $ECHO_C" >&6 -if test "${gcc_cv_prog_LN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -f conftestdata_t -echo >conftestdata_f -if ln conftestdata_f conftestdata_t 2>/dev/null -then - gcc_cv_prog_LN="ln" -else - if ln -s conftestdata_f conftestdata_t 2>/dev/null - then - gcc_cv_prog_LN="ln -s" - else - gcc_cv_prog_LN=cp - fi -fi -rm -f conftestdata_f conftestdata_t - -fi -LN="$gcc_cv_prog_LN" -if test "$gcc_cv_prog_LN" = "ln"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - if test "$gcc_cv_prog_LN" = "ln -s"; then - echo "$as_me:$LINENO: result: no, using ln -s" >&5 -echo "${ECHO_T}no, using ln -s" >&6 - else - echo "$as_me:$LINENO: result: no, and neither does ln -s, so using cp" >&5 -echo "${ECHO_T}no, and neither does ln -s, so using cp" >&6 - fi -fi - echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 if test "${gcc_cv_prog_LN_S+set}" = set; then @@ -4942,7 +7322,12 @@ else then gcc_cv_prog_LN_S=ln else - gcc_cv_prog_LN_S=cp + if cp -p conftestdata_f conftestdata_t 2>/dev/null + then + gcc_cv_prog_LN_S="cp -p" + else + gcc_cv_prog_LN_S=cp + fi fi fi rm -f conftestdata_f conftestdata_t @@ -4957,11 +7342,37 @@ else echo "$as_me:$LINENO: result: no, using ln" >&5 echo "${ECHO_T}no, using ln" >&6 else - echo "$as_me:$LINENO: result: no, and neither does ln, so using cp" >&5 -echo "${ECHO_T}no, and neither does ln, so using cp" >&6 + echo "$as_me:$LINENO: result: no, and neither does ln, so using $gcc_cv_prog_LN_S" >&5 +echo "${ECHO_T}no, and neither does ln, so using $gcc_cv_prog_LN_S" >&6 fi fi +echo "$as_me:$LINENO: checking whether ln works" >&5 +echo $ECHO_N "checking whether ln works... $ECHO_C" >&6 +if test "${acx_cv_prog_LN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f conftestdata_t +echo >conftestdata_f +if ln conftestdata_f conftestdata_t 2>/dev/null +then + acx_cv_prog_LN=ln +else + acx_cv_prog_LN=no +fi +rm -f conftestdata_f conftestdata_t + +fi +if test $acx_cv_prog_LN = no; then + LN="$LN_S" + echo "$as_me:$LINENO: result: no, using $LN" >&5 +echo "${ECHO_T}no, using $LN" >&6 +else + LN="$acx_cv_prog_LN" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -5042,6 +7453,19 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +case "${host}" in +*-*-darwin*) + # By default, the Darwin ranlib will not treat common symbols as + # definitions when building the archive table of contents. Other + # ranlibs do that; pass an option to the Darwin ranlib that makes + # it behave similarly. + ranlib_flags="-c" + ;; +*) + ranlib_flags="" +esac + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -5176,16 +7600,14 @@ echo "${ECHO_T}no" >&6 fi -# Do we have a single-tree copy of texinfo? -if test -f $srcdir/../texinfo/Makefile.in; then - MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo' - gcc_cv_prog_makeinfo_modern=yes - echo "$as_me:$LINENO: result: Using makeinfo from the unified source tree." >&5 -echo "${ECHO_T}Using makeinfo from the unified source tree." >&6 -else - # See if makeinfo has been installed and is modern enough - # that we can use it. - # Extract the first word of "makeinfo", so it can be a program name with args. +MISSING="${CONFIG_SHELL-/bin/sh} $srcdir/../missing" + +# See if makeinfo has been installed and is modern enough +# that we can use it. + +ac_executable_extensions="$build_exeext" + +# Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -5229,10 +7651,10 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:5232: version of makeinfo is $ac_prog_version" >&5 + echo "configure:7654: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; - 4.[2-9]*) + 4.[4-9]*) gcc_cv_prog_makeinfo_modern=yes;; *) gcc_cv_prog_makeinfo_modern=no;; esac @@ -5244,9 +7666,8 @@ else gcc_cv_prog_makeinfo_modern=no fi -fi - if test $gcc_cv_prog_makeinfo_modern = no; then + MAKEINFO="$MISSING makeinfo" { echo "$as_me:$LINENO: WARNING: *** Makeinfo is missing or too old. *** Info documentation will not be built." >&5 @@ -5258,6 +7679,7 @@ else BUILD_INFO=info fi + # Is pod2man recent enough to regenerate manpages? echo "$as_me:$LINENO: checking for recent Pod::Man" >&5 echo $ECHO_N "checking for recent Pod::Man... $ECHO_C" >&6 @@ -5271,12 +7693,12 @@ echo "${ECHO_T}no" >&6 GENERATED_MANPAGES= fi + # How about lex? -if test -f $srcdir/../flex/skel.c; then - FLEX='$(objdir)/../flex/flex' -else - # Extract the first word of "flex", so it can be a program name with args. -set dummy flex; ac_word=$2 +for ac_prog in flex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_FLEX+set}" = set; then @@ -5292,14 +7714,13 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_FLEX="flex" + ac_cv_prog_FLEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done - test -z "$ac_cv_prog_FLEX" && ac_cv_prog_FLEX="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex" fi fi FLEX=$ac_cv_prog_FLEX @@ -5311,15 +7732,16 @@ else echo "${ECHO_T}no" >&6 fi -fi + test -n "$FLEX" && break +done +test -n "$FLEX" || FLEX="$MISSING flex" + # Bison? -# The -L switch is so bison can find its skeleton file. -if test -f $srcdir/../bison/bison.simple; then - BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/' -else - # Extract the first word of "bison", so it can be a program name with args. -set dummy bison; ac_word=$2 +for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BISON+set}" = set; then @@ -5335,14 +7757,13 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_BISON="bison" + ac_cv_prog_BISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done - test -z "$ac_cv_prog_BISON" && ac_cv_prog_BISON="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison" fi fi BISON=$ac_cv_prog_BISON @@ -5354,7 +7775,100 @@ else echo "${ECHO_T}no" >&6 fi + test -n "$BISON" && break +done +test -n "$BISON" || BISON="$MISSING bison" + + +# Binutils are not build modules, unlike bison/flex/makeinfo. So we +# check for build == host before using them. + +# NM +if test x${build} = x${host} && test -f $srcdir/../binutils/nm.c \ + && test -d ../binutils ; then + NM='$(objdir)/../binutils/nm-new' +else + # Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="nm" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_NM" && ac_cv_prog_NM="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing nm" fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi + +# AR +if test x${build} = x${host} && test -f $srcdir/../binutils/ar.c \ + && test -d ../binutils ; then + AR='$(objdir)/../binutils/ar' +else + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar" +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi + # -------------------- # Checks for C headers @@ -5661,67 +8175,6 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for working stdbool.h" >&5 -echo $ECHO_N "checking for working stdbool.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdbool_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -bool foo = false; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdbool_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdbool_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 -if test $ac_cv_header_stdbool_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STDBOOL_H 1 -_ACEOF - -fi - echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 if test "${gcc_cv_header_string+set}" = set; then @@ -5876,7 +8329,8 @@ fi -for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h \ + +for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h @@ -6142,8 +8596,7 @@ echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. + # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6152,13 +8605,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif + ; return 0; } @@ -6194,13 +8648,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if BYTE_ORDER != BIG_ENDIAN not big endian #endif + ; return 0; } @@ -6239,11 +8694,69 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6251,7 +8764,9 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main () { +int +main () +{ /* Are we little or big endian? From Harbison&Steele. */ union { @@ -6285,67 +8800,26 @@ fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -if test $ac_cv_c_bigendian = unknown; then -echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 -echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 - -cat >conftest.c <&6 - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&6 - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&6 - fi - fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -fi -if test $ac_cv_c_bigendian = yes; then +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HOST_WORDS_BIG_ENDIAN 1 -_ACEOF - - BYTEORDER=4321 -else - BYTEORDER=1234 -fi - -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF - -if test $ac_cv_c_bigendian = unknown; then - { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 -echo "$as_me: error: unknown endianess - sorry" >&2;} - { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; } -fi + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac # -------- @@ -6363,13 +8837,6 @@ vax-*-*) stage1_cflags="-J" fi ;; -powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac @@ -6809,11 +9276,21 @@ fi -for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \ - sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \ - scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \ - setlocale + + + + + + + + + + + +for ac_func in times clock kill getrlimit setrlimit atoll atoq \ + sysconf strsignal getrusage nl_langinfo scandir alphasort \ + gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7182,13 +9659,11 @@ else fi -echo "$as_me:$LINENO: checking whether the printf functions support %p" >&5 -echo $ECHO_N "checking whether the printf functions support %p... $ECHO_C" >&6 -if test "${gcc_cv_func_printf_ptr+set}" = set; then + +echo "$as_me:$LINENO: checking for sys/mman.h" >&5 +echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_mman_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - gcc_cv_func_printf_ptr=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7196,53 +9671,141 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_sys_mman_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int main() + ac_cv_header_sys_mman_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 +if test $ac_cv_header_sys_mman_h = yes; then + gcc_header_sys_mman_h=yes +else + gcc_header_sys_mman_h=no +fi + +echo "$as_me:$LINENO: checking for mmap" >&5 +echo $ECHO_N "checking for mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mmap to an innocuous variant, in case declares mmap. + For example, HP-UX 11i declares gettimeofday. */ +#define mmap innocuous_mmap + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mmap (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef mmap + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" { - char buf[64]; - char *p = buf, *q = NULL; - sprintf(buf, "%p", p); - sscanf(buf, "%p", &q); - return (p != q); +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mmap (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mmap) || defined (__stub___mmap) +choke me +#else +char (*f) () = mmap; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mmap; + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext +rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gcc_cv_func_printf_ptr=yes + ac_cv_func_mmap=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -gcc_cv_func_printf_ptr=no +ac_cv_func_mmap=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core core.* *.core -fi -echo "$as_me:$LINENO: result: $gcc_cv_func_printf_ptr" >&5 -echo "${ECHO_T}$gcc_cv_func_printf_ptr" >&6 -if test $gcc_cv_func_printf_ptr = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRINTF_PTR 1 -_ACEOF - +echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 +echo "${ECHO_T}$ac_cv_func_mmap" >&6 +if test $ac_cv_func_mmap = yes; then + gcc_func_mmap=yes +else + gcc_func_mmap=no fi -if test $ac_cv_header_sys_mman_h != yes \ - || test $ac_cv_func_mmap != yes; then +if test "$gcc_header_sys_mman_h" != yes \ + || test "$gcc_func_mmap" != yes; then gcc_cv_func_mmap_file=no gcc_cv_func_mmap_dev_zero=no gcc_cv_func_mmap_anon=no @@ -7866,73 +10429,576 @@ fi + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi +fi +echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - am_cv_lib_iconv_ldpath= # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi - done + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -for ac_header in iconv.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done echo "$as_me:$LINENO: checking for iconv" >&5 @@ -7993,7 +11059,7 @@ rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" - LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" + LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8055,6 +11121,21 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 if test "${am_cv_proto_iconv+set}" = set; then @@ -8132,11 +11213,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF fi - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="$am_cv_lib_iconv_ldpath -liconv" - fi - # Until we have in-tree GNU iconv: LIBICONV_DEP= @@ -8206,15 +11282,119 @@ _ACEOF fi + + echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 +if test "${am_cv_langinfo_codeset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_langinfo_codeset=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_langinfo_codeset=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 + if test $am_cv_langinfo_codeset = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LANGINFO_CODESET 1 +_ACEOF + + fi + + # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" -for ac_func in getenv atol sbrk abort atof getcwd getwd \ - strsignal putc_unlocked fputs_unlocked fwrite_unlocked \ - fprintf_unlocked strstr errno snprintf vasprintf \ - malloc realloc calloc free basename getopt clock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \ + strsignal strstr strverscmp \ + errno snprintf vsnprintf vasprintf malloc realloc calloc \ + free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then @@ -8289,108 +11469,14 @@ _ACEOF fi done -if test x = y ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETENV 1 -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_ATOL 1 -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_SBRK 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_ABORT 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_ATOF 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETCWD 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETWD 1 -_ACEOF - \ - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRSIGNAL 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 -_ACEOF - \ - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_FPRINTF_UNLOCKED 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_STRSTR 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_ERRNO 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_SNPRINTF 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_VASPRINTF 1 -_ACEOF - \ - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_MALLOC 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_REALLOC 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_CALLOC 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_FREE 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_BASENAME 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETOPT 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_CLOCK 1 -_ACEOF -fi for ac_func in getrlimit setrlimit getrusage do - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then @@ -8469,20 +11555,6 @@ _ACEOF fi done -if test x = y ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETRLIMIT 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_SETRLIMIT 1 -_ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_GETRUSAGE 1 -_ACEOF -fi cat >conftest.$ac_ext <<_ACEOF @@ -8541,9 +11613,14 @@ _ACEOF fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# On AIX 5.2, conflicts with , as both define incompatible +# FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname +# in collect2.c, isn't visible, but the configure test below needs +# to undef these macros to get the correct value for HAVE_DECL_LDGETNAME. + for ac_func in ldgetname do - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then @@ -8561,6 +11638,8 @@ cat >>conftest.$ac_ext <<_ACEOF #include "ansidecl.h" #include "system.h" #ifdef HAVE_LDFCN_H +#undef FREAD +#undef FWRITE #include #endif @@ -8622,17 +11701,12 @@ _ACEOF fi done -if test x = y ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_LDGETNAME 1 -_ACEOF -fi for ac_func in times do - ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then @@ -8711,12 +11785,88 @@ _ACEOF fi done -if test x = y ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DECL_TIMES 1 + + +for ac_func in sigaltstack +do + ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` +echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 +if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#undef $ac_tr_decl +#define $ac_tr_decl 1 + +#include "ansidecl.h" +#include "system.h" +#include + + +int +main () +{ +#ifndef $ac_func +char *(*pfn) = (char *(*)) $ac_func ; +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "gcc_cv_have_decl_$ac_func=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "gcc_cv_have_decl_$ac_func=no" fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF +#define $ac_tr_decl 1 +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF +#define $ac_tr_decl 0 +_ACEOF + +fi + +done # More time-related stuff. @@ -8855,71 +12005,6 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for uchar" >&5 -echo $ECHO_N "checking for uchar... $ECHO_C" >&6 -if test "${gcc_cv_type_uchar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include "ansidecl.h" -#include "system.h" - -int -main () -{ -if ((uchar *)0) return 0; - if (sizeof(uchar)) return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uchar=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_uchar=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gcc_cv_type_uchar" >&5 -echo "${ECHO_T}$gcc_cv_type_uchar" >&6 -if test $ac_cv_type_uchar = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_UCHAR 1 -_ACEOF - -fi - # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" @@ -9085,6 +12170,15 @@ if test "${with_system_libunwind+set}" = set; then fi; +# config.gcc also contains tests of with_system_libunwind. +if test x$with_system_libunwind = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETIPINFO 1 +_ACEOF + +fi + # -------------------------------------------------------- # Build, host, and target specific configuration fragments # -------------------------------------------------------- @@ -9182,6 +12276,14 @@ _ACEOF fi +if test x$use_long_long_for_widest_fast_int = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_LONG_LONG_FOR_WIDEST_FAST_INT 1 +_ACEOF + +fi + count=a for f in $host_xm_file; do count=${count}x @@ -9215,8 +12317,69 @@ if test "$host_xm_file" != "$build_xm_file"; then fi fi +case ${host} in + powerpc*-*-darwin*) + echo "$as_me:$LINENO: checking whether mcontext_t fields have underscores" >&5 +echo $ECHO_N "checking whether mcontext_t fields have underscores... $ECHO_C" >&6 +if test "${gcc_cv_mcontext_underscores+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + +#include +#include +int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; } + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gcc_cv_mcontext_underscores=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_mcontext_underscores=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gcc_cv_mcontext_underscores" >&5 +echo "${ECHO_T}$gcc_cv_mcontext_underscores" >&6 + if test $gcc_cv_mcontext_underscores = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_MCONTEXT_T_UNDERSCORES +_ACEOF + + fi + ;; +esac + +# --------- +# Threading +# --------- + # Check if a valid thread package -case ${enable_threads_flag} in +case ${enable_threads} in "" | no) # No threads target_thread_file='single' @@ -9225,12 +12388,12 @@ case ${enable_threads_flag} in # default target_thread_file='single' ;; - aix | dce | gnat | irix | posix | rtems | \ + aix | dce | gnat | irix | posix | posix95 | rtems | \ single | solaris | vxworks | win32 ) - target_thread_file=${enable_threads_flag} + target_thread_file=${enable_threads} ;; *) - echo "${enable_threads_flag} is an unknown thread package" 1>&2 + echo "${enable_threads} is an unknown thread package" 1>&2 exit 1 ;; esac @@ -9241,9 +12404,24 @@ if test x${thread_file} = x; then thread_file=${target_thread_file} fi +# Make gthr-default.h if we have a thread file. +gthread_flags= +if test $thread_file != single; then + rm -f gthr-default.h + echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h + gthread_flags=-DHAVE_GTHR_DEFAULT +fi + + +# -------- +# UNSORTED +# -------- + +use_cxa_atexit=no if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then - echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 + if test x$host = x$target; then + echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 echo $ECHO_N "checking for __cxa_atexit... $ECHO_C" >&6 if test "${ac_cv_func___cxa_atexit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9334,15 +12512,167 @@ fi echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5 echo "${ECHO_T}$ac_cv_func___cxa_atexit" >&6 if test $ac_cv_func___cxa_atexit = yes; then - -cat >>confdefs.h <<\_ACEOF -#define DEFAULT_USE_CXA_ATEXIT 1 -_ACEOF - + use_cxa_atexit=yes else echo "__cxa_atexit can't be enabled on this target" fi + else + # We can't check for __cxa_atexit when building a cross, so assume + # it is available + use_cxa_atexit=yes + fi + if test x$use_cxa_atexit = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define DEFAULT_USE_CXA_ATEXIT 2 +_ACEOF + + fi +fi + +use_getipinfo=yes +if test x$with_system_libunwind = xyes; then + if test x$host = x$target; then + echo "$as_me:$LINENO: checking for library containing _Unwind_GetIPInfo" >&5 +echo $ECHO_N "checking for library containing _Unwind_GetIPInfo... $ECHO_C" >&6 +if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search__Unwind_GetIPInfo=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _Unwind_GetIPInfo (); +int +main () +{ +_Unwind_GetIPInfo (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search__Unwind_GetIPInfo="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search__Unwind_GetIPInfo" = no; then + for ac_lib in unwind; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _Unwind_GetIPInfo (); +int +main () +{ +_Unwind_GetIPInfo (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search__Unwind_GetIPInfo="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search__Unwind_GetIPInfo" >&5 +echo "${ECHO_T}$ac_cv_search__Unwind_GetIPInfo" >&6 +if test "$ac_cv_search__Unwind_GetIPInfo" != no; then + test "$ac_cv_search__Unwind_GetIPInfo" = "none required" || LIBS="$ac_cv_search__Unwind_GetIPInfo $LIBS" + +else + use_getipinfo=no +fi + + fi +fi + +if test x$use_getipinfo = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETIPINFO 1 +_ACEOF + +else + echo "The system unwind library does not support _Unwind_GetIPInfo." fi # Look for a file containing extra machine modes. @@ -9356,6 +12686,13 @@ _ACEOF fi +# Convert extra_options into a form suitable for Makefile use. +extra_opt_files= +for f in $extra_options; do + extra_opt_files="$extra_opt_files \$(srcdir)/config/$f" +done + + # auto-host.h is the file containing items generated by autoconf and is # the first file included by config.h. # If host=build, it is correct to have bconfig include auto-host.h @@ -9364,7 +12701,6 @@ fi if test x$host = x$build then build_auto=auto-host.h - FORBUILD=.. else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new @@ -9381,6 +12717,7 @@ else saved_CFLAGS="${CFLAGS}" CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias CFLAGS="${saved_CFLAGS}" @@ -9390,7 +12727,6 @@ else cd .. rm -rf $tempdir build_auto=auto-build.h - FORBUILD=../${build_subdir} fi @@ -9400,21 +12736,12 @@ host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" # We don't want ansidecl.h in target files, write code there in ISO/GNU C. # put this back in temporarily. -xm_file="ansidecl.h ${xm_file}" +xm_file="auto-host.h ansidecl.h ${xm_file}" # -------- # UNSORTED # -------- -# Get the version trigger filename from the toplevel -if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger -else - gcc_version_trigger=${srcdir}/version.c -fi -gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` -gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` - # Compile in configure arguments. if test -f configargs.h ; then # Being re-configured. @@ -9443,11 +12770,6 @@ static const struct { EOF # Internationalization -PACKAGE=gcc -VERSION="$gcc_version" - - - # If we haven't got the data from the intl directory, # assume NLS is disabled. USE_NLS=no @@ -9457,8 +12779,9 @@ INCINTL= XGETTEXT= GMSGFMT= POSUB= -if test -f ../intl/config.intl; then - . ../intl/config.intl + +if test -f ../intl/config.intl; then + . ../intl/config.intl fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 @@ -9490,8 +12813,8 @@ echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 # by the backticks, then collapsed again by the double quotes, # leaving us with one backslash in the sed expression (right # before the dot that mustn't act as a wildcard). - cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` - lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` + cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e "s!\\\\.gmo!!"` # The user is allowed to set LINGUAS to a list of languages to # install catalogs for. If it's empty that means "all of them." if test "x$LINGUAS" = x; then @@ -9508,6 +12831,16 @@ echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 LINGUAS="$XLINGUAS" echo "$as_me:$LINENO: result: $LINGUAS" >&5 echo "${ECHO_T}$LINGUAS" >&6 + + + DATADIRNAME=share + + INSTOBJEXT=.mo + + GENCAT=gencat + + CATOBJEXT=.gmo + fi # If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get @@ -9516,25 +12849,23 @@ case "$LIBINTL" in *$LIBICONV*) LIBICONV= ;; esac +# Check whether --enable-secureplt or --disable-secureplt was given. +if test "${enable_secureplt+set}" = set; then + enableval="$enable_secureplt" + +fi; + # Windows32 Registry support for specifying GCC installation paths. # Check whether --enable-win32-registry or --disable-win32-registry was given. if test "${enable_win32_registry+set}" = set; then enableval="$enable_win32_registry" fi; + case $host_os in - win32 | pe | cygwin* | mingw32* | uwin*) -echo "$as_me:$LINENO: checking whether windows registry support is requested" >&5 -echo $ECHO_N "checking whether windows registry support is requested... $ECHO_C" >&6 -if test "x$enable_win32_registry" != xno; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_WIN32_REGISTRY 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking for library containing RegOpenKeyExA" >&5 + win32 | pe | cygwin* | mingw32* | uwin*) + if test "x$enable_win32_registry" != xno; then + echo "$as_me:$LINENO: checking for library containing RegOpenKeyExA" >&5 echo $ECHO_N "checking for library containing RegOpenKeyExA... $ECHO_C" >&6 if test "${ac_cv_search_RegOpenKeyExA+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9658,41 +12989,29 @@ echo "${ECHO_T}$ac_cv_search_RegOpenKeyExA" >&6 if test "$ac_cv_search_RegOpenKeyExA" != no; then test "$ac_cv_search_RegOpenKeyExA" = "none required" || LIBS="$ac_cv_search_RegOpenKeyExA $LIBS" -fi - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + enable_win32_registry=no fi -# Check if user specified a different registry key. -case "x${enable_win32_registry}" in -x | xyes) - # default. - gcc_cv_win32_registry_key="$VERSION" - ;; -xno) - # no registry lookup. - gcc_cv_win32_registry_key='' - ;; -*) - # user-specified key. - gcc_cv_win32_registry_key="$enable_win32_registry" - ;; -esac + fi -if test "x$enable_win32_registry" != xno; then - echo "$as_me:$LINENO: checking registry key on windows hosts" >&5 -echo $ECHO_N "checking registry key on windows hosts... $ECHO_C" >&6 + if test "x$enable_win32_registry" != xno; then -cat >>confdefs.h <<_ACEOF -#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key" +cat >>confdefs.h <<\_ACEOF +#define ENABLE_WIN32_REGISTRY 1 _ACEOF - echo "$as_me:$LINENO: result: $gcc_cv_win32_registry_key" >&5 -echo "${ECHO_T}$gcc_cv_win32_registry_key" >&6 -fi -;; + + if test "x$enable_win32_registry" != xyes \ + && test "x$enable_win32_registry" != x; then + +cat >>confdefs.h <<_ACEOF +#define WIN32_REGISTRY_KEY "$enable_win32_registry" +_ACEOF + + fi + fi + ;; esac # Get an absolute path to the GCC top-level source directory @@ -9722,37 +13041,33 @@ do done tmake_file="${tmake_file_}" -symbolic_link='ln -s' - # If the host doesn't support symlinks, modify CC in # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works. # Otherwise, we can use "CC=$(CC)". rm -f symtest.tem -if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null -then - cc_set_by_configure="\$(CC)" - quoted_cc_set_by_configure="\$(CC)" - stage_prefix_set_by_configure="\$(STAGE_PREFIX)" - quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)" -else - rm -f symtest.tem - if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null - then - symbolic_link="cp -p" - else - symbolic_link="cp" - fi - cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`" - quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`" - stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`" - quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`" -fi -rm -f symtest.tem +case "$LN_S" in + *-s*) + cc_set_by_configure="\$(CC)" + quoted_cc_set_by_configure="\$(CC)" + stage_prefix_set_by_configure="\$(STAGE_PREFIX)" + quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)" + ;; + *) + cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`" + quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`" + stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`" + quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`" + ;; +esac + +# This is a terrible hack which will go away some day. +host_cc_for_libada=${CC} + out_object_file=`basename $out_file .c`.o -tm_file_list= -tm_include_list= +tm_file_list="options.h" +tm_include_list="options.h" for f in $tm_file; do case $f in defaults.h ) @@ -9841,11 +13156,21 @@ done CROSS= ALL=all.internal SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' + +if test "x$with_build_sysroot" != x; then + build_system_header_dir=$with_build_sysroot'$(NATIVE_SYSTEM_HEADER_DIR)' +else + # This value is used, even on a native system, because + # CROSS_SYSTEM_HEADER_DIR is just + # $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR). + build_system_header_dir='$(CROSS_SYSTEM_HEADER_DIR)' +fi + if test x$host != x$target then CROSS="-DCROSS_COMPILE" ALL=all.cross - SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + SYSTEM_HEADER_DIR=$build_system_header_dir case "$host","$target" in # Darwin crosses can use the host system's libraries and headers, # because of the fat library support. Of course, it must be the @@ -9867,8 +13192,7 @@ then CROSS="$CROSS -DNATIVE_CROSS" ;; esac elif test "x$TARGET_SYSTEM_ROOT" != x; then - # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR) - SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + SYSTEM_HEADER_DIR=$build_system_header_dir fi # If this is a cross-compiler that does not @@ -9879,11 +13203,11 @@ fi # then define inhibit_libc in LIBGCC2_CFLAGS. # This prevents libgcc2 from containing any code which requires libc # support. -inhibit_libc= +inhibit_libc=false if { { test x$host != x$target && test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; } && { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then - inhibit_libc=-Dinhibit_libc + inhibit_libc=true fi @@ -9892,11 +13216,8 @@ fi # Also, we cannot run fixincludes or fix-header. # These are the normal (build=host) settings: -BUILD_PREFIX= -BUILD_PREFIX_1=ignore- CC_FOR_BUILD='$(CC)' BUILD_CFLAGS='$(ALL_CFLAGS)' - STMP_FIXINC=stmp-fixinc # Possibly disable fixproto, on a per-target basis. @@ -9913,13 +13234,12 @@ esac # And these apply if build != host, or we are generating coverage data if test x$build != x$host || test "x$coverage_flags" != x then - BUILD_PREFIX=build- - BUILD_PREFIX_1=build- BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' if test "x$TARGET_SYSTEM_ROOT" = x; then - STMP_FIXINC= - STMP_FIXPROTO= + if test "x$STMP_FIXPROTO" != x; then + STMP_FIXPROTO=stmp-install-fixproto + fi fi fi @@ -9931,6 +13251,13 @@ for file in ${extra_headers} ; do extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}" done +# Define collect2 in Makefile. +case $host_can_use_collect2 in + no) collect2= ;; + *) collect2='collect2$(exeext)' ;; +esac + + # Add a definition of USE_COLLECT2 if system wants one. case $use_collect2 in no) use_collect2= ;; @@ -9938,9 +13265,20 @@ case $use_collect2 in *) host_xm_defines="${host_xm_defines} USE_COLLECT2" xm_defines="${xm_defines} USE_COLLECT2" + case $host_can_use_collect2 in + no) + { { echo "$as_me:$LINENO: error: collect2 is required but cannot be built on this system" >&5 +echo "$as_me: error: collect2 is required but cannot be built on this system" >&2;} + { (exit 1); exit 1; }; } + ;; + esac ;; esac +# --------------------------- +# Assembler & linker features +# --------------------------- + # Identify the assembler which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the assembler # which will be driven by the driver program. @@ -9948,30 +13286,87 @@ esac # If build != host, and we aren't building gas in-tree, we identify a # build->target assembler and hope that it will have the same features # as the host->target assembler we'll be using. -echo "$as_me:$LINENO: checking what assembler to use" >&5 -echo $ECHO_N "checking what assembler to use... $ECHO_C" >&6 -in_tree_gas=no -gcc_cv_as= gcc_cv_gas_major_version= gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas + +if test "${gcc_cv_as+set}" = set; then + : +else + if test -x "$DEFAULT_ASSEMBLER"; then gcc_cv_as="$DEFAULT_ASSEMBLER" -elif test -x "$AS"; then - gcc_cv_as="$AS" -elif test -x as$host_exeext; then - # Build using assembler in the current directory. - gcc_cv_as=./as$host_exeext elif test -f $gcc_cv_as_gas_srcdir/configure.in \ - && test -f ../gas/Makefile; then - # Single tree build which includes gas. + && test -f ../gas/Makefile \ + && test x$build = x$host; then + gcc_cv_as=../gas/as-new$build_exeext +elif test -x as$build_exeext; then + # Build using assembler in the current directory. + gcc_cv_as=./as$build_exeext +elif test -x $AS_FOR_TARGET; then + gcc_cv_as="$AS_FOR_TARGET" +else + # Extract the first word of "$AS_FOR_TARGET", so it can be a program name with args. +set dummy $AS_FOR_TARGET; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_gcc_cv_as+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $gcc_cv_as in + [\\/]* | ?:[\\/]*) + ac_cv_path_gcc_cv_as="$gcc_cv_as" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_gcc_cv_as="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +gcc_cv_as=$ac_cv_path_gcc_cv_as + +if test -n "$gcc_cv_as"; then + echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 +echo "${ECHO_T}$gcc_cv_as" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +fi + + +ORIGINAL_AS_FOR_TARGET=$gcc_cv_as + + +echo "$as_me:$LINENO: checking what assembler to use" >&5 +echo $ECHO_N "checking what assembler to use... $ECHO_C" >&6 +if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then + # Single tree build which includes gas. We want to prefer it + # over whatever linker top-level may have detected, since + # we'll use what we're building after installation anyway. + echo "$as_me:$LINENO: result: newly built gas" >&5 +echo "${ECHO_T}newly built gas" >&6 in_tree_gas=yes gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd for f in $gcc_cv_as_bfd_srcdir/configure \ $gcc_cv_as_gas_srcdir/configure \ $gcc_cv_as_gas_srcdir/configure.in \ $gcc_cv_as_gas_srcdir/Makefile.in ; do - gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` + gcc_cv_gas_version=`sed -n -e 's/^[ ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f` if test x$gcc_cv_gas_version != x; then break fi @@ -9986,8 +13381,6 @@ gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \ + $gcc_cv_gas_minor_version \) \* 1000 \ + $gcc_cv_gas_patch_version` - rm -f as$host_exeext - $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null in_tree_gas_is_elf=no if grep 'obj_format = elf' ../gas/Makefile > /dev/null \ || (grep 'obj_format = multi' ../gas/Makefile \ @@ -9995,77 +13388,11 @@ gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \ then in_tree_gas_is_elf=yes fi -fi - -if test "x$gcc_cv_as" = x; then - # Search the same directories that the installed compiler will - # search. Else we may find the wrong assembler and lose. If we - # do not find a suitable assembler binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an assembler, then use whatever - # one we can find in the users's path. - # user's path. - if test "x$program_prefix" != xNONE; then - gcc_cv_as=${program_prefix}as$host_exeext - else - gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext - fi - - test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ - $test_prefix/libexec/gcc/$target_noncanonical \ - /usr/lib/gcc/$target_noncanonical/$gcc_version \ - /usr/lib/gcc/$target_noncanonical \ - $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ - $test_prefix/$target_noncanonical/bin" - - if test x$host = x$target; then - test_dirs="$test_dirs \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - fi - - for dir in $test_dirs; do - if test -x $dir/as$host_exeext; then - gcc_cv_as=$dir/as$host_exeext - break; - fi - done -fi -case $in_tree_gas in - yes) - echo "$as_me:$LINENO: result: \"newly built gas\"" >&5 -echo "${ECHO_T}\"newly built gas\"" >&6 - ;; - no) - echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 +else + echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 echo "${ECHO_T}$gcc_cv_as" >&6 - ;; -esac + in_tree_gas=no +fi # Identify the linker which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the linker @@ -10074,166 +13401,248 @@ esac # If build != host, and we aren't building gas in-tree, we identify a # build->target linker and hope that it will have the same features # as the host->target linker we'll be using. -echo "$as_me:$LINENO: checking what linker to use" >&5 -echo $ECHO_N "checking what linker to use... $ECHO_C" >&6 -in_tree_ld=no -gcc_cv_ld= gcc_cv_gld_major_version= gcc_cv_gld_minor_version= gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd + +if test "${gcc_cv_ld+set}" = set; then + : +else + if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" -elif test -x "$LD"; then - gcc_cv_ld="$LD" -elif test -x collect-ld$host_exeext; then - # Build using linker in the current directory. - gcc_cv_ld=./collect-ld$host_exeext elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ - && test -f ../ld/Makefile; then - # Single tree build which includes ld. + && test -f ../ld/Makefile \ + && test x$build = x$host; then + gcc_cv_ld=../ld/ld-new$build_exeext +elif test -x collect-ld$build_exeext; then + # Build using linker in the current directory. + gcc_cv_ld=./collect-ld$build_exeext +elif test -x $LD_FOR_TARGET; then + gcc_cv_ld="$LD_FOR_TARGET" +else + # Extract the first word of "$LD_FOR_TARGET", so it can be a program name with args. +set dummy $LD_FOR_TARGET; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_gcc_cv_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $gcc_cv_ld in + [\\/]* | ?:[\\/]*) + ac_cv_path_gcc_cv_ld="$gcc_cv_ld" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_gcc_cv_ld="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +gcc_cv_ld=$ac_cv_path_gcc_cv_ld + +if test -n "$gcc_cv_ld"; then + echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 +echo "${ECHO_T}$gcc_cv_ld" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +fi + + +ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld + + +echo "$as_me:$LINENO: checking what linker to use" >&5 +echo $ECHO_N "checking what linker to use... $ECHO_C" >&6 +if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then + # Single tree build which includes ld. We want to prefer it + # over whatever linker top-level may have detected, since + # we'll use what we're building after installation anyway. + echo "$as_me:$LINENO: result: newly built ld" >&5 +echo "${ECHO_T}newly built ld" >&6 in_tree_ld=yes in_tree_ld_is_elf=no if (grep 'EMUL = .*elf' ../ld/Makefile \ - || grep 'EMUL = .*linux' ../ld/Makefile) > /dev/null; then + || grep 'EMUL = .*linux' ../ld/Makefile \ + || grep 'EMUL = .*lynx' ../ld/Makefile) > /dev/null; then in_tree_ld_is_elf=yes fi for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in do - gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` + gcc_cv_gld_version=`sed -n -e 's/^[ ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f` if test x$gcc_cv_gld_version != x; then break fi done gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` - rm -f collect-ld$host_exeext - $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \ - 2>/dev/null -fi - -if test "x$gcc_cv_ld" = x; then - # Search the same directories that the installed compiler will - # search. Else we may find the wrong linker and lose. If we - # do not find a suitable linker binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an linker, then use whatever - # one we can find in the users's path. - # user's path. - if test "x$program_prefix" != xNONE; then - gcc_cv_ld=${program_prefix}ld$host_exeext - else - gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext - fi - - test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ - $test_prefix/libexec/gcc/$target_noncanonical \ - /usr/lib/gcc/$target_noncanonical/$gcc_version \ - /usr/lib/gcc/$target_noncanonical \ - $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ - $test_prefix/$target_noncanonical/bin" - - if test x$host = x$target; then - test_dirs="$test_dirs \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - fi - - for dir in $test_dirs; do - if test -x $dir/ld$host_exeext; then - gcc_cv_ld=$dir/ld$host_exeext - break; - fi - done -fi -case $in_tree_ld in - yes) - echo "$as_me:$LINENO: result: \"newly built ld\"" >&5 -echo "${ECHO_T}\"newly built ld\"" >&6 - ;; - no) - echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 +else + echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 echo "${ECHO_T}$gcc_cv_ld" >&6 - ;; -esac + in_tree_ld=no +fi # Figure out what nm we will be using. gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils +if test "${gcc_cv_nm+set}" = set; then + : +else + +if test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile \ + && test x$build = x$host; then + gcc_cv_nm=../binutils/nm-new$build_exeext +elif test -x nm$build_exeext; then + gcc_cv_nm=./nm$build_exeext +elif test -x $NM_FOR_TARGET; then + gcc_cv_nm="$NM_FOR_TARGET" +else + # Extract the first word of "$NM_FOR_TARGET", so it can be a program name with args. +set dummy $NM_FOR_TARGET; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_gcc_cv_nm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $gcc_cv_nm in + [\\/]* | ?:[\\/]*) + ac_cv_path_gcc_cv_nm="$gcc_cv_nm" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_gcc_cv_nm="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +gcc_cv_nm=$ac_cv_path_gcc_cv_nm + +if test -n "$gcc_cv_nm"; then + echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 +echo "${ECHO_T}$gcc_cv_nm" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +fi + + echo "$as_me:$LINENO: checking what nm to use" >&5 echo $ECHO_N "checking what nm to use... $ECHO_C" >&6 -in_tree_nm=no -if test -x nm$host_exeext; then - gcc_cv_nm=./nm$host_exeext -elif test -f $gcc_cv_binutils_srcdir/configure.in \ - && test -f ../binutils/Makefile; then +if test "$gcc_cv_nm" = ../binutils/nm-new$build_exeext; then # Single tree build which includes binutils. + echo "$as_me:$LINENO: result: newly built nm" >&5 +echo "${ECHO_T}newly built nm" >&6 in_tree_nm=yes - gcc_cv_nm=./nm$host_exeext - rm -f nm$host_exeext - $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null -elif test "x$program_prefix" != xNONE; then - gcc_cv_nm=${program_prefix}nm$host_exeext else - gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext + echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 +echo "${ECHO_T}$gcc_cv_nm" >&6 + in_tree_nm=no fi -case $in_tree_nm in - yes) echo "$as_me:$LINENO: result: \"newly built nm\"" >&5 -echo "${ECHO_T}\"newly built nm\"" >&6 ;; - no) echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 -echo "${ECHO_T}$gcc_cv_nm" >&6 ;; -esac + +ORIGINAL_NM_FOR_TARGET=$gcc_cv_nm + # Figure out what objdump we will be using. +if test "${gcc_cv_objdump+set}" = set; then + : +else + +if test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile \ + && test x$build = x$host; then + # Single tree build which includes binutils. + gcc_cv_objdump=../binutils/objdump$build_exeext +elif test -x objdump$build_exeext; then + gcc_cv_objdump=./objdump$build_exeext +elif test -x $OBJDUMP_FOR_TARGET; then + gcc_cv_objdump="$OBJDUMP_FOR_TARGET" +else + # Extract the first word of "$OBJDUMP_FOR_TARGET", so it can be a program name with args. +set dummy $OBJDUMP_FOR_TARGET; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_gcc_cv_objdump+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $gcc_cv_objdump in + [\\/]* | ?:[\\/]*) + ac_cv_path_gcc_cv_objdump="$gcc_cv_objdump" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_gcc_cv_objdump="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +gcc_cv_objdump=$ac_cv_path_gcc_cv_objdump + +if test -n "$gcc_cv_objdump"; then + echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 +echo "${ECHO_T}$gcc_cv_objdump" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +fi + + echo "$as_me:$LINENO: checking what objdump to use" >&5 echo $ECHO_N "checking what objdump to use... $ECHO_C" >&6 -in_tree_objdump=no -if test -x objdump$host_exeext; then - gcc_cv_objdump=./objdump$host_exeext -elif test -f $gcc_cv_binutils_srcdir/configure.in \ - && test -f ../binutils/Makefile; then +if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then # Single tree build which includes binutils. - in_tree_objdump=yes - gcc_cv_objdump=./objdump$host_exeext - rm -f objdump$host_exeext - $symbolic_link ../binutils/objdump$host_exeext \ - objdump$host_exeext 2>/dev/null -elif test "x$program_prefix" != xNONE; then - gcc_cv_objdump=${program_prefix}objdump$host_exeext + echo "$as_me:$LINENO: result: newly built objdump" >&5 +echo "${ECHO_T}newly built objdump" >&6 +elif test x$gcc_cv_objdump = x; then + echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6 else - gcc_cv_objdump=`echo objdump | \ - sed ${program_transform_name}`$host_exeext + echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 +echo "${ECHO_T}$gcc_cv_objdump" >&6 fi -case $in_tree_objdump in - yes) echo "$as_me:$LINENO: result: \"newly built objdump\"" >&5 -echo "${ECHO_T}\"newly built objdump\"" >&6 ;; - no) echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 -echo "${ECHO_T}$gcc_cv_objdump" >&6 ;; -esac # Figure out what assembler alignment features are present. echo "$as_me:$LINENO: checking assembler for .balign and .p2align" >&5 @@ -10397,6 +13806,43 @@ _ACEOF fi +echo "$as_me:$LINENO: checking assembler for .weakref" >&5 +echo $ECHO_N "checking assembler for .weakref... $ECHO_C" >&6 +if test "${gcc_cv_as_weakref+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_weakref=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` + then gcc_cv_as_weakref=yes +fi + elif test x$gcc_cv_as != x; then + echo ' .weakref foobar, barfnot' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_weakref=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_weakref" >&5 +echo "${ECHO_T}$gcc_cv_as_weakref" >&6 +if test $gcc_cv_as_weakref = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GAS_WEAKREF 1 +_ACEOF + +fi + echo "$as_me:$LINENO: checking assembler for .nsubspa comdat" >&5 echo $ECHO_N "checking assembler for .nsubspa comdat... $ECHO_C" >&6 if test "${gcc_cv_as_nsubspa_comdat+set}" = set; then @@ -10496,8 +13942,12 @@ else -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ -].*$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` + ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` + ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` if test 0"$ld_date" -lt 20020404; then if test -n "$ld_date"; then # If there was date string, but was earlier than 2002-04-04, fail @@ -10506,9 +13956,6 @@ else # If there was no date string nor ld version number, something is wrong gcc_cv_ld_hidden=no else - ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` - ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` - ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` test -z "$ld_vers_patch" && ld_vers_patch=0 if test "$ld_vers_major" -lt 2; then gcc_cv_ld_hidden=no @@ -10535,6 +13982,7 @@ echo "$as_me:$LINENO: result: $gcc_cv_ld_hidden" >&5 echo "${ECHO_T}$gcc_cv_ld_hidden" >&6 libgcc_visibility=no + if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then libgcc_visibility=yes @@ -10667,11 +14115,14 @@ cat > conftest.big </dev/null \ | tail -3 > conftest.got \ - && { cmp conftest.lit conftest.got > /dev/null 2>&1 \ - || cmp conftest.big conftest.got > /dev/null 2>&1; } + && { diff -b conftest.lit conftest.got > /dev/null 2>&1 \ + || diff -b conftest.big conftest.got > /dev/null 2>&1; } then gcc_cv_as_eh_frame=yes elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null' @@ -10735,12 +14186,137 @@ fi echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6 +if test $gcc_cv_as_shf_merge = no; then + echo "$as_me:$LINENO: checking assembler for section merging support" >&5 +echo $ECHO_N "checking assembler for section merging support... $ECHO_C" >&6 +if test "${gcc_cv_as_shf_merge+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_shf_merge=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0` + then gcc_cv_as_shf_merge=yes +fi + elif test x$gcc_cv_as != x; then + echo '.section .rodata.str, "aMS", %progbits, 1' > conftest.s + if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_shf_merge=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 +echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6 + +fi cat >>confdefs.h <<_ACEOF #define HAVE_GAS_SHF_MERGE `if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi` _ACEOF +echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 +echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6 +if test "${gcc_cv_as_comdat_group+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_comdat_group=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0` + then gcc_cv_as_comdat_group=yes +fi + elif test x$gcc_cv_as != x; then + echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s + if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_comdat_group=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group" >&5 +echo "${ECHO_T}$gcc_cv_as_comdat_group" >&6 + +if test $gcc_cv_as_comdat_group = yes; then + gcc_cv_as_comdat_group_percent=no +else + echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 +echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6 +if test "${gcc_cv_as_comdat_group_percent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_comdat_group_percent=no + if test $in_tree_gas = yes; then + if test $in_tree_gas_is_elf = yes \ + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0` + then gcc_cv_as_comdat_group_percent=yes +fi + elif test x$gcc_cv_as != x; then + echo '.section .text,"axG",%progbits,.foo,comdat' > conftest.s + if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_comdat_group_percent=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group_percent" >&5 +echo "${ECHO_T}$gcc_cv_as_comdat_group_percent" >&6 + +fi +if test $in_tree_ld != yes && test x"$ld_vers" != x; then + comdat_group=yes + if test 0"$ld_date" -lt 20050308; then + if test -n "$ld_date"; then + # If there was date string, but was earlier than 2005-03-08, fail + comdat_group=no + elif test "$ld_vers_major" -lt 2; then + comdat_group=no + elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then + comdat_group=no + fi + fi +else + # assume linkers other than GNU ld don't support COMDAT group + comdat_group=no +fi +if test $comdat_group = no; then + gcc_cv_as_comdat_group=no + gcc_cv_as_comdat_group_percent=no +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_COMDAT_GROUP `if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi` +_ACEOF + + # Thread-local storage - the check is heavily parametrized. conftest_s= tls_first_major= @@ -10770,6 +14346,57 @@ foo: .long 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + frv*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +x: .long 25 + .text + call #gettlsoff(x)' + tls_first_major=2 + tls_first_minor=14 + ;; + hppa*-*-linux*) + conftest_s=' +t1: .reg %r20 +t2: .reg %r21 +gp: .reg %r19 + .section ".tdata","awT",@progbits +foo: .long 25 + .text + .align 4 + addil LT%foo-$tls_gdidx$,gp + ldo RT%foo-$tls_gdidx$(%r1),%arg0 + b __tls_get_addr + nop + addil LT%foo-$tls_ldidx$,gp + b __tls_get_addr + ldo RT%foo-$tls_ldidx$(%r1),%arg0 + addil LR%foo-$tls_dtpoff$,%ret0 + ldo RR%foo-$tls_dtpoff$(%r1),%t1 + mfctl %cr27,%t1 + addil LT%foo-$tls_ieoff$,gp + ldw RT%foo-$tls_ieoff$(%r1),%t2 + add %t1,%t2,%t3 + mfctl %cr27,%t1 + addil LR%foo-$tls_leoff$,%t1 + ldo RR%foo-$tls_leoff$(%r1),%t2' + tls_first_major=2 + tls_first_minor=15 + tls_as_opt=--fatal-warnings + ;; + arm*-*-*) + conftest_s=' + .section ".tdata","awT",%progbits +foo: .long 25 + .text +.word foo(gottpoff) +.word foo(tpoff) +.word foo(tlsgd) +.word foo(tlsldm) +.word foo(tlsldo)' + tls_first_major=2 + tls_first_minor=17 + ;; i[34567]86-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -10823,6 +14450,23 @@ foo: data8 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + mips*-*-*) + conftest_s=' + .section .tdata,"awT",@progbits +x: + .word 2 + .text + addiu $4, $28, %tlsgd(x) + addiu $4, $28, %tlsldm(x) + lui $4, %dtprel_hi(x) + addiu $4, $4, %dtprel_lo(x) + lw $4, %gottprel(x)($28) + lui $4, %tprel_hi(x) + addiu $4, $4, %tprel_lo(x)' + tls_first_major=2 + tls_first_minor=16 + tls_as_opt='-32 --fatal-warnings' + ;; powerpc-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -10936,6 +14580,15 @@ foo: .long 25 ;; sparc*-*-*) case "$target" in + sparc*-sun-solaris2.[56789]*) + # TLS was introduced in the Solaris 9 4/04 release but + # we do not enable it by default on Solaris 9 either. + if test "x$enable_tls" = xyes ; then + on_solaris=yes + else + enable_tls=no; + fi + ;; sparc*-sun-solaris2.*) on_solaris=yes ;; @@ -10997,7 +14650,12 @@ foo: .long 25 fi ;; esac -if test -z "$tls_first_major"; then +set_have_as_tls=no +if test "x$enable_tls" = xno ; then + : # TLS explicitly disabled. +elif test "x$enable_tls" = xyes ; then + set_have_as_tls=yes # TLS explicitly enabled. +elif test -z "$tls_first_major"; then : # If we don't have a check, assume no support. else echo "$as_me:$LINENO: checking assembler for thread-local storage support" >&5 @@ -11030,16 +14688,68 @@ fi echo "$as_me:$LINENO: result: $gcc_cv_as_tls" >&5 echo "${ECHO_T}$gcc_cv_as_tls" >&6 if test $gcc_cv_as_tls = yes; then + set_have_as_tls=yes +fi +fi +if test $set_have_as_tls = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_AS_TLS 1 _ACEOF -fi fi # Target-specific assembler checks. +echo "$as_me:$LINENO: checking linker -Bstatic/-Bdynamic option" >&5 +echo $ECHO_N "checking linker -Bstatic/-Bdynamic option... $ECHO_C" >&6 +gcc_cv_ld_static_dynamic=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then + gcc_cv_ld_static_dynamic=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports -Bstatic/-Bdynamic option + if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ + && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then + gcc_cv_ld_static_dynamic=yes + fi +fi +if test x"$gcc_cv_ld_static_dynamic" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_STATIC_DYNAMIC 1 +_ACEOF + +fi +echo "$as_me:$LINENO: result: $gcc_cv_ld_static_dynamic" >&5 +echo "${ECHO_T}$gcc_cv_ld_static_dynamic" >&6 + +if test x"$demangler_in_ld" = xyes; then + echo "$as_me:$LINENO: checking linker --demangle support" >&5 +echo $ECHO_N "checking linker --demangle support... $ECHO_C" >&6 + gcc_cv_ld_demangle=no + if test $in_tree_ld = yes; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \ + gcc_cv_ld_demangle=yes + fi + elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then + # Check if the GNU linker supports --demangle option + if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then + gcc_cv_ld_demangle=yes + fi + fi + if test x"$gcc_cv_ld_demangle" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_DEMANGLE 1 +_ACEOF + + fi + echo "$as_me:$LINENO: result: $gcc_cv_ld_demangle" >&5 +echo "${ECHO_T}$gcc_cv_ld_demangle" >&6 +fi + case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) @@ -11375,6 +15085,55 @@ fi ;; i[34567]86-*-* | x86_64-*-*) + case $target_os in + cygwin* | pe | mingw32*) + # Used for DWARF 2 in PE + echo "$as_me:$LINENO: checking assembler for .secrel32 relocs" >&5 +echo $ECHO_N "checking assembler for .secrel32 relocs... $ECHO_C" >&6 +if test "${gcc_cv_as_ix86_pe_secrel32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_ix86_pe_secrel32=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91` + then gcc_cv_as_ix86_pe_secrel32=yes +fi + elif test x$gcc_cv_as != x; then + echo '.text +foo: nop +.data + .secrel32 foo' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + if test x$gcc_cv_ld != x \ + && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1; then + gcc_cv_as_ix86_pe_secrel32=yes + fi + rm -f conftest + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_pe_secrel32" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_pe_secrel32" >&6 +if test $gcc_cv_as_ix86_pe_secrel32 = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GAS_PE_SECREL32_RELOC 1 +_ACEOF + +fi + ;; + esac + echo "$as_me:$LINENO: checking assembler for filds and fists mnemonics" >&5 echo $ECHO_N "checking assembler for filds and fists mnemonics... $ECHO_C" >&6 if test "${gcc_cv_as_ix86_filds_fists+set}" = set; then @@ -11443,6 +15202,39 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_AS_IX86_CMOV_SUN_SYNTAX 1 _ACEOF +fi + + echo "$as_me:$LINENO: checking assembler for ffreep mnemonic" >&5 +echo $ECHO_N "checking assembler for ffreep mnemonic... $ECHO_C" >&6 +if test "${gcc_cv_as_ix86_ffreep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_ix86_ffreep=no + if test x$gcc_cv_as != x; then + echo 'ffreep %st(1)' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_ix86_ffreep=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_ffreep" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_ffreep" >&6 +if test $gcc_cv_as_ix86_ffreep = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_IX86_FFREEP 1 +_ACEOF + fi # This one is used unconditionally by i386.[ch]; it is to be defined @@ -11533,11 +15325,45 @@ fi powerpc*-*-*) case $target in - *-*-aix*) conftest_s=' .csect .text[PR] + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[PR] mfcr 3,128';; - *-*-darwin*) conftest_s=' .text + *-*-darwin*) + echo "$as_me:$LINENO: checking assembler for .machine directive support" >&5 +echo $ECHO_N "checking assembler for .machine directive support... $ECHO_C" >&6 +if test "${gcc_cv_as_machine_directive+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_machine_directive=no + if test x$gcc_cv_as != x; then + echo ' .machine ppc7400' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_machine_directive=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_machine_directive" >&5 +echo "${ECHO_T}$gcc_cv_as_machine_directive" >&6 + + if test x$gcc_cv_as_machine_directive != xyes; then + echo "*** This target requires an assembler supporting \".machine\"" >&2 + echo you can get it from: ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg >&2 + test x$build = x$target && exit 1 + fi + conftest_s=' .text mfcr r3,128';; - *) conftest_s=' .text + *) conftest_s=' .machine power4 + .text mfcr 3,128';; esac @@ -11576,6 +15402,148 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_AS_MFCRF 1 _ACEOF +fi + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[PR] + popcntb 3,3';; + *) conftest_s=' .machine power5 + .text + popcntb 3,3';; + esac + + echo "$as_me:$LINENO: checking assembler for popcntb support" >&5 +echo $ECHO_N "checking assembler for popcntb support... $ECHO_C" >&6 +if test "${gcc_cv_as_powerpc_popcntb+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_powerpc_popcntb=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` + then gcc_cv_as_powerpc_popcntb=yes +fi + elif test x$gcc_cv_as != x; then + echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_powerpc_popcntb=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_popcntb" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_popcntb" >&6 +if test $gcc_cv_as_powerpc_popcntb = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_POPCNTB 1 +_ACEOF + +fi + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5x" + .csect .text[PR] + frin 1,1';; + *) conftest_s=' .machine power5 + .text + frin 1,1';; + esac + + echo "$as_me:$LINENO: checking assembler for fp round support" >&5 +echo $ECHO_N "checking assembler for fp round support... $ECHO_C" >&6 +if test "${gcc_cv_as_powerpc_fprnd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_powerpc_fprnd=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` + then gcc_cv_as_powerpc_fprnd=yes +fi + elif test x$gcc_cv_as != x; then + echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_powerpc_fprnd=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_fprnd" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_fprnd" >&6 +if test $gcc_cv_as_powerpc_fprnd = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_FPRND 1 +_ACEOF + +fi + + case $target in + *-*-aix*) conftest_s=' .csect .text[PR] +LCF..0: + addis 11,30,_GLOBAL_OFFSET_TABLE_-LCF..0@ha';; + *-*-darwin*) + conftest_s=' .text +LCF0: + addis r11,r30,_GLOBAL_OFFSET_TABLE_-LCF0@ha';; + *) conftest_s=' .text +.LCF0: + addis 11,30,_GLOBAL_OFFSET_TABLE_-.LCF0@ha';; + esac + + echo "$as_me:$LINENO: checking assembler for rel16 relocs" >&5 +echo $ECHO_N "checking assembler for rel16 relocs... $ECHO_C" >&6 +if test "${gcc_cv_as_powerpc_rel16+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_powerpc_rel16=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` + then gcc_cv_as_powerpc_rel16=yes +fi + elif test x$gcc_cv_as != x; then + echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_powerpc_rel16=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_rel16" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_rel16" >&6 +if test $gcc_cv_as_powerpc_rel16 = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_REL16 1 +_ACEOF + fi ;; @@ -11615,9 +15583,26 @@ if test $gcc_cv_as_mips_explicit_relocs = yes; then else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS" fi fi - ;; esac + +# Mips and HP-UX need the GNU assembler. +# Linux on IA64 might be able to use the Intel assembler. + +case "$target" in + mips*-*-* | *-*-hpux* ) + if test x$gas_flag = xyes \ + || test x"$host" != x"$build" \ + || test ! -x "$gcc_cv_as" \ + || "$gcc_cv_as" -v < /dev/null 2>&1 | grep GNU > /dev/null; then + : + else + echo "*** This configuration requires the GNU assembler" >&2 + exit 1 + fi + ;; +esac + # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any # info to the output file. So, as supported targets are added to gas 2.11, @@ -11627,7 +15612,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \ - | xstormy16*-*-* | cris-*-* | xtensa-*-*) + | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-*) insn="nop" ;; ia64*-*-* | s390*-*-*) @@ -11662,8 +15647,9 @@ fi echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } then - # ??? This fails with non-gnu grep. Maybe use objdump? - if grep debug_line conftest.o > /dev/null 2>&1; then + if test x$gcc_cv_objdump != x \ + && $gcc_cv_objdump -h conftest.o 2> /dev/null \ + | grep debug_line > /dev/null 2>&1; then gcc_cv_as_dwarf2_debug_line=yes fi else @@ -11861,6 +15847,7 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_eh_frame_hdr=yes fi fi + if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -11895,63 +15882,115 @@ fi echo "$as_me:$LINENO: result: $gcc_cv_ld_pie" >&5 echo "${ECHO_T}$gcc_cv_ld_pie" >&6 -echo "$as_me:$LINENO: checking linker -Bstatic/-Bdynamic option" >&5 -echo $ECHO_N "checking linker -Bstatic/-Bdynamic option... $ECHO_C" >&6 -gcc_cv_ld_static_dynamic=no -if test $in_tree_ld = yes ; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then - gcc_cv_ld_static_dynamic=yes - fi -elif test x$gcc_cv_ld != x; then - # Check if linker supports -Bstatic/-Bdynamic option - if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ - && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then - gcc_cv_ld_static_dynamic=yes - fi -fi -if test x"$gcc_cv_ld_static_dynamic" = xyes; then +# -------- +# UNSORTED +# -------- -cat >>confdefs.h <<\_ACEOF -#define HAVE_LD_STATIC_DYNAMIC 1 -_ACEOF - -fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_static_dynamic" >&5 -echo "${ECHO_T}$gcc_cv_ld_static_dynamic" >&6 - -case "$target" in - *-*-linux*) - echo "$as_me:$LINENO: checking linker --as-needed support" >&5 +echo "$as_me:$LINENO: checking linker --as-needed support" >&5 echo $ECHO_N "checking linker --as-needed support... $ECHO_C" >&6 if test "${gcc_cv_ld_as_needed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gcc_cv_ld_as_needed=no - if test $in_tree_ld = yes ; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes; then - gcc_cv_ld_as_needed=yes - fi - elif test x$gcc_cv_ld != x; then - # Check if linker supports --as-needed and --no-as-needed options - if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then - gcc_cv_ld_as_needed=yes - fi - fi +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_as_needed=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports --as-needed and --no-as-needed options + if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then + gcc_cv_ld_as_needed=yes + fi +fi fi echo "$as_me:$LINENO: result: $gcc_cv_ld_as_needed" >&5 echo "${ECHO_T}$gcc_cv_ld_as_needed" >&6 - if test x"$gcc_cv_ld_as_needed" = xyes; then +if test x"$gcc_cv_ld_as_needed" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LD_AS_NEEDED 1 +_ACEOF + +fi + +case "$target:$tm_file" in + powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) + echo "$as_me:$LINENO: checking linker support for omitting dot symbols" >&5 +echo $ECHO_N "checking linker support for omitting dot symbols... $ECHO_C" >&6 +if test "${gcc_cv_ld_no_dot_syms+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_ld_no_dot_syms=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2; then + gcc_cv_ld_no_dot_syms=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x ; then + cat > conftest1.s < conftest2.s < /dev/null 2>&1 \ + && $gcc_cv_as -a64 -o conftest2.o conftest2.s > /dev/null 2>&1 \ + && $gcc_cv_ld -melf64ppc -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then + gcc_cv_ld_no_dot_syms=yes + fi + rm -f conftest conftest1.o conftest2.o conftest1.s conftest2.s + fi + +fi +echo "$as_me:$LINENO: result: $gcc_cv_ld_no_dot_syms" >&5 +echo "${ECHO_T}$gcc_cv_ld_no_dot_syms" >&6 + if test x"$gcc_cv_ld_no_dot_syms" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_NO_DOT_SYMS 1 _ACEOF fi ;; esac +echo "$as_me:$LINENO: checking linker --sysroot support" >&5 +echo $ECHO_N "checking linker --sysroot support... $ECHO_C" >&6 +if test "${gcc_cv_ld_sysroot+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_ld_sysroot=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then + gcc_cv_ld_sysroot=yes + fi + elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then + gcc_cv_ld_sysroot=yes + fi + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_ld_sysroot" >&5 +echo "${ECHO_T}$gcc_cv_ld_sysroot" >&6 +if test x"$gcc_cv_ld_sysroot" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_SYSROOT 1 +_ACEOF + +fi + if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then @@ -11961,142 +16000,94 @@ _ACEOF fi -# Figure out what language subdirectories are present. -# Look if the user specified --enable-languages="..."; if not, use -# the environment variable $LANGUAGES if defined. $LANGUAGES might -# go away some day. -# NB: embedded tabs in this IF block -- do not untabify -if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - { echo "$as_me:$LINENO: WARNING: setting LANGUAGES is deprecated, use --enable-languages instead" >&5 -echo "$as_me: WARNING: setting LANGUAGES is deprecated, use --enable-languages instead" >&2;} - - else - enable_languages=all - fi +# Test for stack protector support in target C library. +case "$target" in + *-*-linux*) + echo "$as_me:$LINENO: checking __stack_chk_fail in target GNU C library" >&5 +echo $ECHO_N "checking __stack_chk_fail in target GNU C library... $ECHO_C" >&6 +if test "${gcc_cv_libc_provides_ssp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x"${enable_languages}" = x \ - || test x"${enable_languages}" = xyes; - then - { { echo "$as_me:$LINENO: error: --enable-languages needs at least one language argument" >&5 -echo "$as_me: error: --enable-languages needs at least one language argument" >&2;} - { (exit 1); exit 1; }; } + gcc_cv_libc_provides_ssp=no + if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then + if test "x$with_sysroot" = x; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + elif test "x$with_sysroot" = xyes; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" + else + glibc_header_dir="${with_sysroot}/usr/include" fi + else + glibc_header_dir=/usr/include + fi + # glibc 2.4 and later provides __stack_chk_fail and + # either __stack_chk_guard, or TLS access to stack guard canary. + if test -f $glibc_header_dir/features.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__GNU_LIBRARY__[ ]+([1-9][0-9]|[6-9])' \ + $glibc_header_dir/features.h > /dev/null; then + if $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC__[ ]+([1-9][0-9]|[3-9])' \ + $glibc_header_dir/features.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes + elif $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC__[ ]+2' \ + $glibc_header_dir/features.h > /dev/null \ + && $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC_MINOR__[ ]+([1-9][0-9]|[4-9])' \ + $glibc_header_dir/features.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes + fi + fi fi -enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` +echo "$as_me:$LINENO: result: $gcc_cv_libc_provides_ssp" >&5 +echo "${ECHO_T}$gcc_cv_libc_provides_ssp" >&6 ;; + *) gcc_cv_libc_provides_ssp=no ;; +esac +if test x$gcc_cv_libc_provides_ssp = xyes; then -# First scan to see if an enabled language requires some other language. -# We assume that a given config-lang.in will list all the language -# front ends it requires, even if some are required indirectly. -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. - ${srcdir}/[*]/config-lang.in) - ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; - esac -done +cat >>confdefs.h <<\_ACEOF +#define TARGET_LIBC_PROVIDES_SSP 1 +_ACEOF -expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'` -found_languages= -subdirs= -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. - ${srcdir}/[*]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - found_languages="${found_languages} ${lang_alias}" - if test x"${add_this_lang}" = xyes; then - case $lang in - ${srcdir}/ada/config-lang.in) - if test x$have_gnat = xyes ; then - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - fi - ;; - *) - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - ;; - esac - fi - ;; - esac -done - -missing_languages= -for expected_language in ${expected_languages} .. -do - if test "${expected_language}" != ..; then - missing_language="${expected_language}" - if test "${expected_language}" = "c" \ - || test "${expected_language}" = "all"; then - missing_language= - fi - for found_language in ${found_languages} .. - do - if test "${found_language}" != ..; then - if test "${expected_language}" = "${found_language}"; then - missing_language= - fi - fi - done - if test "x${missing_language}" != x; then - missing_languages="${missing_languages} ${missing_language}" - fi - fi -done - -if test "x$missing_languages" != x; then - { { echo "$as_me:$LINENO: error: -The following requested languages were not found:${missing_languages} -The following languages were available: c${found_languages}" >&5 -echo "$as_me: error: -The following requested languages were not found:${missing_languages} -The following languages were available: c${found_languages}" >&2;} - { (exit 1); exit 1; }; } fi -# Make gthr-default.h if we have a thread file. -gthread_flags= -if test $thread_file != single; then - rm -f gthr-default.h - echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h - gthread_flags=-DHAVE_GTHR_DEFAULT -fi +# Check if TFmode long double should be used by default or not. +# Some glibc targets used DFmode long double, but with glibc 2.4 +# and later they can use TFmode. +case "$target" in + powerpc*-*-*gnu* | \ + sparc*-*-linux* | \ + s390*-*-linux* | \ + alpha*-*-linux*) +# Check whether --with-long-double-128 or --without-long-double-128 was given. +if test "${with_long_double_128+set}" = set; then + withval="$with_long_double_128" + gcc_cv_target_ldbl128="$with_long_double_128" +else + gcc_cv_target_ldbl128=no + if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then + if test "x$with_sysroot" = x; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + elif test "x$with_sysroot" = xyes; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" + else + glibc_header_dir="${with_sysroot}/usr/include" + fi + else + glibc_header_dir=/usr/include + fi + grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ + $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \ + && gcc_cv_target_ldbl128=yes + +fi; + ;; +esac +if test x$gcc_cv_target_ldbl128 = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define TARGET_DEFAULT_LONG_DOUBLE_128 1 +_ACEOF + +fi # Find out what GC implementation we want, or may, use. @@ -12104,8 +16095,16 @@ fi if test "${with_gc+set}" = set; then withval="$with_gc" case "$withval" in - simple | page | zone) + page) GGC=ggc-$withval + ;; + zone) + GGC=ggc-$withval + +cat >>confdefs.h <<\_ACEOF +#define GGC_ZONE 1 +_ACEOF + ;; *) { { echo "$as_me:$LINENO: error: $withval is an invalid option to --with-gc" >&5 @@ -12153,32 +16152,24 @@ else MAINT='#' fi +# -------------- +# Language hooks +# -------------- + # Make empty files to contain the specs and options for each language. # Then add #include lines to for a compiler that has specs and/or options. +subdirs= lang_opt_files= lang_specs_files= lang_tree_files= -for subdir in . $subdirs -do - if test -f $srcdir/$subdir/lang.opt; then - lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" - fi - if test -f $srcdir/$subdir/lang-specs.h; then - lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" - fi - if test -f $srcdir/$subdir/$subdir-tree.def; then - lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" - fi -done - # These (without "all_") are set in each config-lang.in. # `language' must be a single word so is spelled singularly. all_languages= all_boot_languages= all_compilers= all_stagestuff= -all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders' +all_outputs='Makefile gccbug mklibgcc libada-mk' # List of language makefile fragments. all_lang_makefrags= # List of language subdirectory makefiles. Deprecated. @@ -12189,6 +16180,10 @@ all_gtfiles="$target_gtfiles" all_gtfiles_files_langs= all_gtfiles_files_files= +# These are the languages that are set in --enable-languages, +# and are available in the GCC tree. +all_selected_languages= + # Add the language fragments. # Languages are added via two mechanisms. Some information must be # recorded in makefile variables, these are defined in config-lang.in. @@ -12198,77 +16193,122 @@ all_gtfiles_files_files= language_hooks="Make-hooks" -for s in $subdirs +for lang in ${srcdir}/*/config-lang.in do - language= - boot_language= - compilers= - stagestuff= - outputs= - gtfiles= - . ${srcdir}/$s/config-lang.in - if test "x$language" = x - then - echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2 - exit 1 - fi - all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$s/Make-lang.in" - if test -f ${srcdir}/$s/Makefile.in - then all_lang_makefiles="$s/Makefile" - fi - all_languages="$all_languages $language" - if test "x$boot_language" = xyes - then - all_boot_languages="$all_boot_languages $language" - fi - all_compilers="$all_compilers $compilers" - all_stagestuff="$all_stagestuff $stagestuff" - all_outputs="$all_outputs $outputs" - all_gtfiles="$all_gtfiles $gtfiles" - for f in $gtfiles - do - all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " - all_gtfiles_files_files="$all_gtfiles_files_files ${f} " - done + test "$lang" = "${srcdir}/*/config-lang.in" && continue + + lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` + if test "x$lang_alias" = x + then + echo "$lang doesn't set \$language." 1>&2 + exit 1 + fi + subdir="`echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" + subdirs="$subdirs $subdir" + case ",$enable_languages," in + *,$lang_alias,*) + all_selected_languages="$all_selected_languages $lang_alias" + if test -f $srcdir/$subdir/lang-specs.h; then + lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" + fi + ;; + esac + + language= + boot_language= + compilers= + stagestuff= + outputs= + gtfiles= + subdir_requires= + . ${srcdir}/$subdir/config-lang.in + if test "x$language" = x + then + echo "${srcdir}/$subdir/config-lang.in doesn't set \$language." 1>&2 + exit 1 + fi + + ok=: + case ",$enable_languages," in + *,$lang_alias,*) ;; + *) + for i in $subdir_requires; do + test -f "${srcdir}/$i/config-lang.in" && continue + ok=false + break + done + ;; + esac + $ok || continue + + all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$subdir/Make-lang.in" + if test -f $srcdir/$subdir/lang.opt; then + lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" + fi + if test -f $srcdir/$subdir/$subdir-tree.def; then + lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" + fi + if test -f ${srcdir}/$subdir/Makefile.in + then all_lang_makefiles="$subdir/Makefile" + fi + all_languages="$all_languages $language" + if test "x$boot_language" = xyes + then + all_boot_languages="$all_boot_languages $language" + fi + all_compilers="$all_compilers $compilers" + all_stagestuff="$all_stagestuff $stagestuff" + all_outputs="$all_outputs $outputs" + all_gtfiles="$all_gtfiles $gtfiles" + for f in $gtfiles + do + all_gtfiles_files_langs="$all_gtfiles_files_langs ${subdir} " + all_gtfiles_files_files="$all_gtfiles_files_files ${f} " + done done # Pick up gtfiles for c gtfiles= -s="c" +subdir="c" . ${srcdir}/c-config-lang.in all_gtfiles="$all_gtfiles $gtfiles" for f in $gtfiles do - all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " + all_gtfiles_files_langs="$all_gtfiles_files_langs ${subdir} " all_gtfiles_files_files="$all_gtfiles_files_files ${f} " done check_languages= -for language in $all_languages +for language in $all_selected_languages do - check_languages="$check_languages check-$language" + check_languages="$check_languages check-$language" done # We link each language in with a set of hooks, reached indirectly via -# lang.${target}. +# lang.${target}. Only do so for selected languages. rm -f Make-hooks touch Make-hooks -target_list="all.build all.cross start.encap rest.encap tags \ - install-normal install-common install-man \ +target_list="all.cross start.encap rest.encap tags \ + install-common install-man install-info dvi pdf html \ uninstall info man srcextra srcman srcinfo \ mostlyclean clean distclean maintainer-clean \ stage1 stage2 stage3 stage4 stageprofile stagefeedback" + for t in $target_list do x= - for lang in $all_languages + for lang in $all_selected_languages do - x="$x $lang.$t" + x="$x $lang.$t" done echo "lang.$t: $x" >> Make-hooks done +# -------- +# UNSORTED +# -------- + # Create .gdbinit. echo "dir ." > .gdbinit @@ -12349,6 +16389,36 @@ fi; objdir=`${PWDCMD-pwd}` + +# Check whether --with-datarootdir or --without-datarootdir was given. +if test "${with_datarootdir+set}" = set; then + withval="$with_datarootdir" + datarootdir="\${prefix}/$with_datarootdir" +else + datarootdir='$(prefix)/share' +fi; + + + +# Check whether --with-docdir or --without-docdir was given. +if test "${with_docdir+set}" = set; then + withval="$with_docdir" + docdir="\${prefix}/$with_docdir" +else + docdir='$(datarootdir)' +fi; + + + +# Check whether --with-htmldir or --without-htmldir was given. +if test "${with_htmldir+set}" = set; then + withval="$with_htmldir" + htmldir="\${prefix}/$with_htmldir" +else + htmldir='$(docdir)' +fi; + + # Substitute configuration variables @@ -12412,35 +16482,6 @@ objdir=`${PWDCMD-pwd}` - - - - - - - - -if test x"$SET_GCC_LIB_PATH_CMD" != x; then - # SET_GCC_LIB_PATH_CMD is "XXX=path; export XXX;". It is expanded to - # - # eval "set_gcc_lib_path=XXX=path; export XXX;" - # - eval "set_gcc_lib_path=$SET_GCC_LIB_PATH_CMD" - # It will set set_gcc_lib_path to "export XXX=path" for GNU make. - set_gcc_lib_path="export $set_gcc_lib_path" -else - set_gcc_lib_path= -fi - - - -# If it doesn't already exist, create document directory -echo "checking for the document directory." 1>&2 -if test -d doc ; then - true -else - mkdir doc -fi # Echo link setup. if test x${build} = x${host} ; then @@ -12460,6 +16501,9 @@ else fi fi + + + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs) @@ -12994,8 +17038,6 @@ cat >>$CONFIG_STATUS <<_ACEOF # subdirs='$subdirs' -symbolic_link='$symbolic_link' - _ACEOF @@ -13106,6 +17148,8 @@ s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t +s,@target_noncanonical@,$target_noncanonical,;t t +s,@build_libsubdir@,$build_libsubdir,;t t s,@build_subdir@,$build_subdir,;t t s,@host_subdir@,$host_subdir,;t t s,@target_subdir@,$target_subdir,;t t @@ -13120,29 +17164,34 @@ s,@OBJEXT@,$OBJEXT,;t t s,@NO_MINUS_C_MINUS_O@,$NO_MINUS_C_MINUS_O,;t t s,@OUTPUT_OPTION@,$OUTPUT_OPTION,;t t s,@CPP@,$CPP,;t t -s,@GNATBIND@,$GNATBIND,;t t -s,@ac_ct_GNATBIND@,$ac_ct_GNATBIND,;t t +s,@EGREP@,$EGREP,;t t s,@strict1_warn@,$strict1_warn,;t t +s,@cxx_compat_warn@,$cxx_compat_warn,;t t s,@warn_cflags@,$warn_cflags,;t t s,@WERROR@,$WERROR,;t t s,@nocommon_flag@,$nocommon_flag,;t t -s,@EGREP@,$EGREP,;t t +s,@TREEBROWSER@,$TREEBROWSER,;t t s,@valgrind_path@,$valgrind_path,;t t s,@valgrind_path_defines@,$valgrind_path_defines,;t t s,@valgrind_command@,$valgrind_command,;t t s,@coverage_flags@,$coverage_flags,;t t s,@enable_multilib@,$enable_multilib,;t t +s,@enable_decimal_float@,$enable_decimal_float,;t t s,@enable_shared@,$enable_shared,;t t s,@TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t s,@CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t s,@onestep@,$onestep,;t t +s,@datarootdir@,$datarootdir,;t t +s,@docdir@,$docdir,;t t +s,@htmldir@,$htmldir,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@AWK@,$AWK,;t t -s,@LN@,$LN,;t t s,@LN_S@,$LN_S,;t t +s,@LN@,$LN,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@ranlib_flags@,$ranlib_flags,;t t s,@INSTALL@,$INSTALL,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t @@ -13153,19 +17202,21 @@ s,@BUILD_INFO@,$BUILD_INFO,;t t s,@GENERATED_MANPAGES@,$GENERATED_MANPAGES,;t t s,@FLEX@,$FLEX,;t t s,@BISON@,$BISON,;t t +s,@NM@,$NM,;t t +s,@AR@,$AR,;t t s,@stage1_cflags@,$stage1_cflags,;t t s,@COLLECT2_LIBS@,$COLLECT2_LIBS,;t t s,@GNAT_LIBEXC@,$GNAT_LIBEXC,;t t s,@LDEXP_LIB@,$LDEXP_LIB,;t t s,@TARGET_GETGROUPS_T@,$TARGET_GETGROUPS_T,;t t s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t s,@LIBICONV_DEP@,$LIBICONV_DEP,;t t s,@manext@,$manext,;t t s,@objext@,$objext,;t t +s,@gthread_flags@,$gthread_flags,;t t s,@extra_modes_file@,$extra_modes_file,;t t -s,@FORBUILD@,$FORBUILD,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t +s,@extra_opt_files@,$extra_opt_files,;t t s,@USE_NLS@,$USE_NLS,;t t s,@LIBINTL@,$LIBINTL,;t t s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t @@ -13174,18 +17225,28 @@ s,@XGETTEXT@,$XGETTEXT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@POSUB@,$POSUB,;t t s,@CATALOGS@,$CATALOGS,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@GENCAT@,$GENCAT,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@host_cc_for_libada@,$host_cc_for_libada,;t t s,@CROSS@,$CROSS,;t t s,@ALL@,$ALL,;t t s,@SYSTEM_HEADER_DIR@,$SYSTEM_HEADER_DIR,;t t s,@inhibit_libc@,$inhibit_libc,;t t -s,@BUILD_PREFIX@,$BUILD_PREFIX,;t t -s,@BUILD_PREFIX_1@,$BUILD_PREFIX_1,;t t s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t s,@STMP_FIXINC@,$STMP_FIXINC,;t t s,@STMP_FIXPROTO@,$STMP_FIXPROTO,;t t +s,@collect2@,$collect2,;t t +s,@gcc_cv_as@,$gcc_cv_as,;t t +s,@ORIGINAL_AS_FOR_TARGET@,$ORIGINAL_AS_FOR_TARGET,;t t +s,@gcc_cv_ld@,$gcc_cv_ld,;t t +s,@ORIGINAL_LD_FOR_TARGET@,$ORIGINAL_LD_FOR_TARGET,;t t +s,@gcc_cv_nm@,$gcc_cv_nm,;t t +s,@ORIGINAL_NM_FOR_TARGET@,$ORIGINAL_NM_FOR_TARGET,;t t +s,@gcc_cv_objdump@,$gcc_cv_objdump,;t t s,@libgcc_visibility@,$libgcc_visibility,;t t -s,@gthread_flags@,$gthread_flags,;t t s,@GGC@,$GGC,;t t s,@zlibdir@,$zlibdir,;t t s,@zlibinc@,$zlibinc,;t t @@ -13204,6 +17265,7 @@ s,@all_gtfiles_files_files@,$all_gtfiles_files_files,;t t s,@all_lang_makefrags@,$all_lang_makefrags,;t t s,@all_lang_makefiles@,$all_lang_makefiles,;t t s,@all_languages@,$all_languages,;t t +s,@all_selected_languages@,$all_selected_languages,;t t s,@all_stagestuff@,$all_stagestuff,;t t s,@build_exeext@,$build_exeext,;t t s,@build_install_headers_dir@,$build_install_headers_dir,;t t @@ -13225,10 +17287,6 @@ s,@extra_programs@,$extra_programs,;t t s,@float_h_file@,$float_h_file,;t t s,@gcc_config_arguments@,$gcc_config_arguments,;t t s,@gcc_gxx_include_dir@,$gcc_gxx_include_dir,;t t -s,@libstdcxx_incdir@,$libstdcxx_incdir,;t t -s,@gcc_version@,$gcc_version,;t t -s,@gcc_version_full@,$gcc_version_full,;t t -s,@gcc_version_trigger@,$gcc_version_trigger,;t t s,@host_exeext@,$host_exeext,;t t s,@host_xm_file_list@,$host_xm_file_list,;t t s,@host_xm_include_list@,$host_xm_include_list,;t t @@ -13245,7 +17303,6 @@ s,@out_file@,$out_file,;t t s,@out_object_file@,$out_object_file,;t t s,@stage_prefix_set_by_configure@,$stage_prefix_set_by_configure,;t t s,@quoted_stage_prefix_set_by_configure@,$quoted_stage_prefix_set_by_configure,;t t -s,@symbolic_link@,$symbolic_link,;t t s,@thread_file@,$thread_file,;t t s,@tm_file_list@,$tm_file_list,;t t s,@tm_include_list@,$tm_include_list,;t t @@ -13255,11 +17312,11 @@ s,@tm_p_include_list@,$tm_p_include_list,;t t s,@xm_file_list@,$xm_file_list,;t t s,@xm_include_list@,$xm_include_list,;t t s,@xm_defines@,$xm_defines,;t t -s,@target_noncanonical@,$target_noncanonical,;t t s,@c_target_objs@,$c_target_objs,;t t s,@cxx_target_objs@,$cxx_target_objs,;t t s,@target_cpu_default@,$target_cpu_default,;t t -s,@set_gcc_lib_path@,$set_gcc_lib_path,;t t +s,@GMPLIBS@,$GMPLIBS,;t t +s,@GMPINC@,$GMPINC,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t /@language_hooks@/r $language_hooks @@ -13840,7 +17897,7 @@ case ${CONFIG_HEADERS} in echo > cstamp-h ;; esac # Make sure all the subdirs exist. -for d in $subdirs +for d in $subdirs doc build do test -d $d || mkdir $d done @@ -13850,18 +17907,20 @@ done # FLAGS_TO_PASS has been modified to solve the problem there. # This is virtually a duplicate of what happens in configure.lang; we do # an extra check to make sure this only happens if ln -s can be used. -if test "$symbolic_link" = "ln -s"; then - for d in ${subdirs} fixinc ; do +case "$LN_S" in + *-s*) + for d in ${subdirs} ; do STARTDIR=`${PWDCMD-pwd}` cd $d for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include do rm -f $t - $symbolic_link ../$t $t 2>/dev/null + $LN_S ../$t $t 2>/dev/null done cd $STARTDIR - done -else true ; fi + done + ;; +esac ;; esac done diff --git a/contrib/gcc/configure.ac b/contrib/gcc/configure.ac index d9151dddfc0..b6c394ca268 100644 --- a/contrib/gcc/configure.ac +++ b/contrib/gcc/configure.ac @@ -1,7 +1,7 @@ # configure.ac for GCC # Process this file with autoconf to generate a configuration script. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. #This file is part of GCC. @@ -18,25 +18,27 @@ #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. # -------------------------------- # Initialization and sanity checks # -------------------------------- -AC_PREREQ(2.57) +AC_PREREQ(2.59) AC_INIT AC_CONFIG_SRCDIR(tree.c) AC_CONFIG_HEADER(auto-host.h:config.in) +gcc_version=`cat $srcdir/BASE-VER` + # Determine the host, build, and target systems AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET # Determine the noncanonical target name, for directory use. -_GCC_TOPLEV_NONCANONICAL_TARGET +ACX_NONCANONICAL_TARGET # Determine the target- and build-specific subdirectories GCC_TOPLEV_SUBDIRS @@ -130,13 +132,17 @@ no) ;; *) gcc_gxx_include_dir=$with_gxx_include_dir ;; esac]) +# This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO. if test x${gcc_gxx_include_dir} = x; then if test x${enable_version_specific_runtime_libs} = xyes; then gcc_gxx_include_dir='${libsubdir}/include/c++' else - topsrcdir=${srcdir}/.. . ${srcdir}/../config.if + libstdcxx_incdir='include/c++/$(version)' + if test x$host != x$target; then + libstdcxx_incdir="$target_alias/$libstdcxx_incdir" + fi changequote(<<, >>)dnl - gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir} + gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/$libstdcxx_incdir" changequote([, ])dnl fi fi @@ -192,7 +198,7 @@ AC_ARG_WITH(ld, DEFAULT_LINKER="$with_ld") if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then - AC_MSG_WARN([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) + AC_MSG_ERROR([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gnu_ld_flag=yes fi @@ -211,6 +217,12 @@ else AC_MSG_RESULT(no) fi +# With demangler in GNU ld +AC_ARG_WITH(demangler-in-ld, +[ --with-demangler-in-ld try to use demangler in GNU ld.], +demangler_in_ld="$with_demangler_in_ld", +demangler_in_ld=no) + # ---------------------- # Find default assembler # ---------------------- @@ -226,7 +238,7 @@ AC_ARG_WITH(as, DEFAULT_ASSEMBLER="$with_as") if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test ! -x "$DEFAULT_ASSEMBLER"; then - AC_MSG_WARN([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER]) + AC_MSG_ERROR([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER]) elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gas_flag=yes fi @@ -260,7 +272,7 @@ rm -f a.out a.exe b.out # Find the native compiler AC_PROG_CC -AC_PROG_CC_C_O +AM_PROG_CC_C_O # autoconf is lame and doesn't give us any substitution variable for this. if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then NO_MINUS_C_MINUS_O=yes @@ -270,53 +282,138 @@ fi AC_SUBST(NO_MINUS_C_MINUS_O) AC_SUBST(OUTPUT_OPTION) +# Remove the -O2: for historical reasons, unless bootstrapping we prefer +# optimizations to be activated explicitly by the toplevel. +case "$CC" in + */prev-gcc/xgcc*) ;; + *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; +esac +AC_SUBST(CFLAGS) + # ------------------------- # Check C compiler features # ------------------------- -AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long, -ac_cv_prog_cc_no_long_long, -[save_CFLAGS="$CFLAGS" -CFLAGS="-Wno-long-long" -AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes, - ac_cv_prog_cc_no_long_long=no) -CFLAGS="$save_CFLAGS"]) - AC_PROG_CPP AC_C_INLINE -gcc_AC_C_LONG_LONG -gcc_AC_C__BOOL - # sizeof(char) is 1 by definition. -AC_COMPILE_CHECK_SIZEOF(void *) -AC_COMPILE_CHECK_SIZEOF(short) -AC_COMPILE_CHECK_SIZEOF(int) -AC_COMPILE_CHECK_SIZEOF(long) -if test $ac_cv_c_long_long = yes; then - AC_COMPILE_CHECK_SIZEOF(long long) -fi -if test $ac_cv_c___int64 = yes; then - AC_COMPILE_CHECK_SIZEOF(__int64) -fi - -# ----------------- -# Find Ada compiler -# ----------------- - -# See if GNAT has been installed -gcc_AC_PROG_GNAT +AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) +AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) # --------------------- # Warnings and checking # --------------------- +# Check $CC warning features (if it's GCC). +# We want to use -pedantic, but we don't want warnings about +# * 'long long' +# * variadic macros +# * overlong strings +# So, we only use -pedantic if we can disable those warnings. + +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-long-long], + [ac_cv_prog_cc_w_no_long_long], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-long-long" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_long_long=yes], + [ac_cv_prog_cc_w_no_long_long=no]) + CFLAGS="$save_CFLAGS" + ]) + +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-variadic-macros], + [ac_cv_prog_cc_w_no_variadic_macros], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-variadic-macros" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_variadic_macros=yes], + [ac_cv_prog_cc_w_no_variadic_macros=no]) + CFLAGS="$save_CFLAGS" + ]) + +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-overlength-strings], + [ac_cv_prog_cc_w_no_overlength_strings], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-overlength-strings" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_overlength_strings=yes], + [ac_cv_prog_cc_w_no_overlength_strings=no]) + CFLAGS="$save_CFLAGS" + ]) + strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes ; then - strict1_warn="-pedantic -Wno-long-long" +if test $ac_cv_prog_cc_w_no_long_long = yes \ + && test $ac_cv_prog_cc_w_no_variadic_macros = yes \ + && test $ac_cv_prog_cc_w_no_overlength_strings = yes ; then + strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings" fi + +# Add -Wold-style-definition if it's accepted +AC_CACHE_CHECK( + [whether ${CC} accepts -Wold-style-definition], + [ac_cv_prog_cc_w_old_style_definition], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wold-style-definition" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_old_style_definition=yes], + [ac_cv_prog_cc_w_old_style_definition=no]) + CFLAGS="$save_CFLAGS" + ]) +if test $ac_cv_prog_cc_w_old_style_definition = yes ; then + strict1_warn="${strict1_warn} -Wold-style-definition" +fi + +# Add -Wmissing-format-attribute if it's accepted +AC_CACHE_CHECK( + [whether ${CC} accepts -Wmissing-format-attribute], + [ac_cv_prog_cc_w_missing_format_attribute], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wmissing-format-attribute" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_missing_format_attribute=yes], + [ac_cv_prog_cc_w_missing_format_attribute=no]) + CFLAGS="$save_CFLAGS" + ]) +if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then + strict1_warn="${strict1_warn} -Wmissing-format-attribute" +fi + +# Enable -Werror, period. +AC_ARG_ENABLE(werror_always, +[ --enable-werror-always enable -Werror always], [], +[enable_werror_always=no]) +if test x${enable_werror_always} = xyes ; then + strict1_warn="${strict1_warn} -Werror" + WERROR=-Werror +fi + AC_SUBST(strict1_warn) +# Get C++ compatibility warning flag, if supported. +AC_CACHE_CHECK( + [whether ${CC} accepts -Wc++-compat], + [ac_cv_prog_cc_w_cxx_compat], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wc++-compat" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_cxx_compat=yes], + [ac_cv_prog_cc_w_cxx_compat=no]) + CFLAGS="$save_CFLAGS" + ]) +if test x${ac_cv_prog_cc_w_cxx_compat} = xyes; then + cxx_compat_warn="-Wc++-compat" +fi +AC_SUBST(cxx_compat_warn) + + # If the native compiler is GCC, we can enable warnings even in stage1. # That's useful for people building cross-compilers, or just running a # quick `make'. @@ -327,10 +424,19 @@ fi AC_SUBST(warn_cflags) # Enable -Werror in bootstrap stage2 and later. -# Change the default to "no" on release branches. +is_release= +if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then + is_release=yes +fi AC_ARG_ENABLE(werror, [ --enable-werror enable -Werror in bootstrap stage2 and later], [], -[enable_werror=no]) +[if test x$is_release = x ; then + # Default to "yes" on development branches. + enable_werror=yes +else + # Default to "no" on release branches. + enable_werror=no +fi]) if test x$enable_werror = xyes ; then WERROR=-Werror fi @@ -341,41 +447,67 @@ AC_ARG_ENABLE(checking, [ --enable-checking[=LIST] enable expensive run-time checks. With LIST, enable only specific categories of checks. - Categories are: misc,tree,rtl,rtlflag,gc,gcac,fold; - default is no checking], -[ac_checking= -ac_tree_checking= -ac_rtl_checking= -ac_rtlflag_checking= + Categories are: yes,no,all,none,release. + Flags are: assert,fold,gc,gcac,misc, + rtlflag,rtl,runtime,tree,valgrind.], +[ac_checking_flags="${enableval}"],[ +# Determine the default checks. +if test x$is_release = x ; then + ac_checking_flags=yes +else + ac_checking_flags=release +fi]) +ac_assert_checking=1 +ac_checking= +ac_fold_checking= ac_gc_checking= ac_gc_always_collect= -ac_fold_checking= -case "${enableval}" in -yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ; - ac_rtlflag_checking=1 ;; -no) ;; -*) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," - set fnord $enableval; shift - IFS="$ac_save_IFS" - for check - do - case $check in - misc) ac_checking=1 ;; - tree) ac_tree_checking=1 ;; - rtlflag) ac_rtlflag_checking=1 ;; - rtl) ac_rtl_checking=1 ;; - gc) ac_gc_checking=1 ;; - gcac) ac_gc_always_collect=1 ;; - fold) ac_fold_checking=1 ;; - valgrind) ac_checking_valgrind=1 ;; - *) AC_MSG_ERROR(unknown check category $check) ;; - esac - done - ;; -esac -], -# By default, disable all checks for release versions of GCC. -[ac_checking=; ac_tree_checking=; ac_gc_checking=; ac_rtlflag_checking=;]) +ac_rtl_checking= +ac_rtlflag_checking= +ac_runtime_checking=1 +ac_tree_checking= +ac_valgrind_checking= +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in $ac_checking_flags +do + case $check in + # these set all the flags to specific states + yes) ac_assert_checking=1 ; ac_checking=1 ; + ac_fold_checking= ; ac_gc_checking=1 ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + no|none) ac_assert_checking= ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking= ; + ac_tree_checking= ; ac_valgrind_checking= ;; + all) ac_assert_checking=1 ; ac_checking=1 ; + ac_fold_checking=1 ; ac_gc_checking=1 ; + ac_gc_always_collect=1 ; ac_rtl_checking=1 ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + release) ac_assert_checking=1 ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking=1 ; + ac_tree_checking= ; ac_valgrind_checking= ;; + # these enable particular checks + assert) ac_assert_checking=1 ;; + fold) ac_fold_checking=1 ;; + gc) ac_gc_checking=1 ;; + gcac) ac_gc_always_collect=1 ;; + misc) ac_checking=1 ;; + rtl) ac_rtl_checking=1 ;; + rtlflag) ac_rtlflag_checking=1 ;; + runtime) ac_runtime_checking=1 ;; + tree) ac_tree_checking=1 ;; + valgrind) ac_valgrind_checking=1 ;; + *) AC_MSG_ERROR(unknown check category $check) ;; + esac +done +IFS="$ac_save_IFS" + nocommon_flag="" if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, @@ -384,12 +516,25 @@ if test x$ac_checking != x ; then nocommon_flag=-fno-common fi AC_SUBST(nocommon_flag) +if test x$ac_assert_checking != x ; then + AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, +[Define if you want assertions enabled. This is a cheap check.]) +fi +GCC_TARGET_TEMPLATE(ENABLE_RUNTIME_CHECKING) +if test x$ac_runtime_checking != x ; then + AC_DEFINE(ENABLE_RUNTIME_CHECKING, 1, +[Define if you want runtime assertions enabled. This is a cheap check.]) +fi if test x$ac_tree_checking != x ; then AC_DEFINE(ENABLE_TREE_CHECKING, 1, [Define if you want all operations on trees (the basic data structure of the front ends) to be checked for dynamic type safety - at runtime. This is moderately expensive.]) + at runtime. This is moderately expensive. The tree browser debugging + routines will also be enabled by this option. + ]) + TREEBROWSER=tree-browser.o fi +AC_SUBST(TREEBROWSER) if test x$ac_rtl_checking != x ; then AC_DEFINE(ENABLE_RTL_CHECKING, 1, [Define if you want all operations on RTL (the basic data structure @@ -426,26 +571,26 @@ dnl # an if statement. This was the source of very frustrating bugs dnl # in converting to autoconf 2.5x! AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) -if test x$ac_checking_valgrind != x ; then +if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. AC_MSG_CHECKING(for VALGRIND_DISCARD in ) - AC_TRY_CPP( - [#include + AC_PREPROC_IFELSE([AC_LANG_SOURCE( + [[#include #ifndef VALGRIND_DISCARD #error VALGRIND_DISCARD not defined -#endif], +#endif]])], [gcc_cv_header_valgrind_memcheck_h=yes], [gcc_cv_header_valgrind_memcheck_h=no]) AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h) AC_MSG_CHECKING(for VALGRIND_DISCARD in ) - AC_TRY_CPP( - [#include + AC_PREPROC_IFELSE([AC_LANG_SOURCE( + [[#include #ifndef VALGRIND_DISCARD #error VALGRIND_DISCARD not defined -#endif], - [gcc_cv_header_memcheck_h=yes], - gcc_cv_header_memcheck_h=no) +#endif]])], + [gcc_cv_header_memcheck_h=yes], + [gcc_cv_header_memcheck_h=no]) AC_MSG_RESULT($gcc_cv_header_memcheck_h) AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind, [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1]) @@ -472,24 +617,37 @@ fi AC_SUBST(valgrind_path_defines) AC_SUBST(valgrind_command) +AC_ARG_ENABLE(mapped-location, +[ --enable-mapped-location location_t is fileline integer cookie],, +enable_mapped_location=no) + +if test "$enable_mapped_location" = yes ; then + AC_DEFINE(USE_MAPPED_LOCATION, 1, +[Define if location_t is fileline integer cookie.]) +fi + # Enable code coverage collection AC_ARG_ENABLE(coverage, [ --enable-coverage[=LEVEL] - enable compiler\'s code coverage collection. + enable compiler's code coverage collection. Use to measure compiler performance and locate unused parts of the compiler. With LEVEL, specify optimization. Values are opt, noopt, default is noopt], [case "${enableval}" in -yes|noopt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" - ;; -opt) - coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" - ;; -*) - AC_MSG_ERROR(unknown coverage setting $enableval) - ;; + yes|noopt) + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" + ;; + opt) + coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" + ;; + no) + # a.k.a. --disable-coverage + coverage_flags="" + ;; + *) + AC_MSG_ERROR(unknown coverage setting $enableval) + ;; esac], [coverage_flags=""]) AC_SUBST(coverage_flags) @@ -523,15 +681,47 @@ AC_ARG_ENABLE(__cxa_atexit, [ --enable-__cxa_atexit enable __cxa_atexit for C++], [], []) +# Enable C extension for decimal float if target supports it. +AC_ARG_ENABLE(decimal-float, +[ --enable-decimal-float enable decimal float extension to C], +[ + if test x$enablevar = xyes ; then + case $target in + powerpc*-*-linux* | i?86*-*-linux*) + enable_decimal_float=yes + ;; + *) + AC_MSG_WARN(decimal float is not supported for this target, ignored) + enable_decimal_float=no + ;; + esac + fi +], [enable_decimal_float=no]) + +AC_SUBST(enable_decimal_float) + +dfp=`if test $enable_decimal_float = yes; then echo 1; else echo 0; fi` +AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_FLOAT, $dfp, +[Define to 1 to enable decimal float extension to C.]) + # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package AC_ARG_ENABLE(threads, [ --enable-threads enable thread usage for target GCC --enable-threads=LIB use LIB thread package for target GCC],, -enable_threads='') -# Save in case it gets overwritten in config.gcc -enable_threads_flag=$enable_threads +[enable_threads='']) + +AC_ARG_ENABLE(tls, +[ --enable-tls enable or disable generation of tls code + overriding the assembler check for tls support], +[ + case $enable_tls in + yes | no) ;; + *) AC_MSG_ERROR(['$enable_tls' is an invalid value for --enable-tls. +Valid choices are 'yes' and 'no'.]) ;; + esac +], [enable_tls='']) AC_ARG_ENABLE(objc-gc, [ --enable-objc-gc enable the use of Boehm's garbage collector with @@ -567,6 +757,10 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) +AC_ARG_WITH(build-sysroot, + [ --with-build-sysroot=sysroot + use sysroot as the system root during the build]) + AC_ARG_WITH(sysroot, [ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.], [ @@ -577,7 +771,7 @@ AC_ARG_WITH(sysroot, TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)' - + if test "x$exec_prefix" = xNONE; then if test "x$prefix" = xNONE; then test_prefix=/usr/local @@ -613,6 +807,33 @@ esac], [onestep=""]) AC_SUBST(onestep) +# Sanity check enable_languages in case someone does not run the toplevel +# configure # script. +AC_ARG_ENABLE(languages, +[ --enable-languages=LIST specify which front-ends to build], +[case ,${enable_languages}, in + ,,|,yes,) + # go safe -- we cannot be much sure without the toplevel + # configure's + # analysis of which target libs are present and usable + enable_languages=c + ;; + *,all,*) + AC_MSG_ERROR([only the toplevel supports --enable-languages=all]) + ;; + *,c,*) + ;; + *) + enable_languages=c,${enable_languages} + ;; +esac], +[enable_languages=c]) + +# Used by documentation targets +AC_SUBST(datarootdir) +AC_SUBST(docdir) +AC_SUBST(htmldir) + # ------------------------- # Checks for other programs # ------------------------- @@ -621,15 +842,28 @@ AC_PROG_MAKE_SET # Find some useful tools AC_PROG_AWK -# We need awk to run opts.sh (to create options.c and options.h). +# We need awk to create options.c and options.h. # Bail out if it's missing. case ${AWK} in "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; esac -gcc_AC_PROG_LN gcc_AC_PROG_LN_S +ACX_PROG_LN($LN_S) AC_PROG_RANLIB +case "${host}" in +*-*-darwin*) + # By default, the Darwin ranlib will not treat common symbols as + # definitions when building the archive table of contents. Other + # ranlibs do that; pass an option to the Darwin ranlib that makes + # it behave similarly. + ranlib_flags="-c" + ;; +*) + ranlib_flags="" +esac +AC_SUBST(ranlib_flags) + gcc_AC_PROG_INSTALL # See if cmp has --ignore-initial. @@ -638,68 +872,76 @@ gcc_AC_PROG_CMP_IGNORE_INITIAL # See if we have the mktemp command. AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no) -# Do we have a single-tree copy of texinfo? -if test -f $srcdir/../texinfo/Makefile.in; then - MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo' - gcc_cv_prog_makeinfo_modern=yes - AC_MSG_RESULT([Using makeinfo from the unified source tree.]) -else - # See if makeinfo has been installed and is modern enough - # that we can use it. - gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, - [GNU texinfo.* \([0-9][0-9.]*\)], - [4.[2-9]*]) -fi +MISSING="${CONFIG_SHELL-/bin/sh} $srcdir/../missing" +# See if makeinfo has been installed and is modern enough +# that we can use it. +gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, + [GNU texinfo.* \([0-9][0-9.]*\)], + [4.[4-9]*]) if test $gcc_cv_prog_makeinfo_modern = no; then + MAKEINFO="$MISSING makeinfo" AC_MSG_WARN([ *** Makeinfo is missing or too old. *** Info documentation will not be built.]) BUILD_INFO= else - BUILD_INFO=info AC_SUBST(BUILD_INFO) + BUILD_INFO=info fi +AC_SUBST(BUILD_INFO) # Is pod2man recent enough to regenerate manpages? AC_MSG_CHECKING([for recent Pod::Man]) if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then AC_MSG_RESULT(yes) - GENERATED_MANPAGES=generated-manpages AC_SUBST(GENERATED_MANPAGES) + GENERATED_MANPAGES=generated-manpages else AC_MSG_RESULT(no) GENERATED_MANPAGES= fi +AC_SUBST(GENERATED_MANPAGES) # How about lex? dnl Don't use AC_PROG_LEX; we insist on flex. dnl LEXLIB is not useful in gcc. -if test -f $srcdir/../flex/skel.c; then - FLEX='$(objdir)/../flex/flex' -else - AC_CHECK_PROG(FLEX, flex, flex, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex) -fi +AC_CHECK_PROGS([FLEX], flex, [$MISSING flex]) # Bison? -# The -L switch is so bison can find its skeleton file. -if test -f $srcdir/../bison/bison.simple; then - BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/' +AC_CHECK_PROGS([BISON], bison, [$MISSING bison]) + +# Binutils are not build modules, unlike bison/flex/makeinfo. So we +# check for build == host before using them. + +# NM +if test x${build} = x${host} && test -f $srcdir/../binutils/nm.c \ + && test -d ../binutils ; then + NM='$(objdir)/../binutils/nm-new' else - AC_CHECK_PROG(BISON, bison, bison, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison) + AC_CHECK_PROG(NM, nm, nm, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing nm) fi +# AR +if test x${build} = x${host} && test -f $srcdir/../binutils/ar.c \ + && test -d ../binutils ; then + AR='$(objdir)/../binutils/ar' +else + AC_CHECK_PROG(AR, ar, ar, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar) +fi + + # -------------------- # Checks for C headers # -------------------- AC_MSG_CHECKING(for GNU C library) AC_CACHE_VAL(gcc_cv_glibc, -[AC_TRY_COMPILE( - [#include ],[ +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], [[ #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__) #error Not a GNU C library system -#endif], - [gcc_cv_glibc=yes], - gcc_cv_glibc=no)]) +#endif]])], + [gcc_cv_glibc=yes], + [gcc_cv_glibc=no])]) AC_MSG_RESULT($gcc_cv_glibc) if test $gcc_cv_glibc = yes; then AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library]) @@ -711,10 +953,9 @@ AC_PROG_CPP_WERROR AC_HEADER_STDC AC_HEADER_TIME -gcc_AC_HEADER_STDBOOL -gcc_AC_HEADER_STRING +ACX_HEADER_STRING AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \ +AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h) @@ -725,7 +966,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) # These tests can't be done till we know if we have limits.h. gcc_AC_C_CHAR_BIT -AC_C_BIGENDIAN_CROSS +AC_C_BIGENDIAN # -------- # UNSORTED @@ -742,13 +983,6 @@ vax-*-*) stage1_cflags="-J" fi ;; -powerpc-*-darwin*) - # The spiffy cpp-precomp chokes on some legitimate constructs in GCC - # sources; use -no-cpp-precomp to get to GNU cpp. - # Apple's GCC has bugs in designated initializer handling, so disable - # that too. - stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" - ;; esac AC_SUBST(stage1_cflags) @@ -794,12 +1028,12 @@ AC_SUBST(LDEXP_LIB) # doesn't clash with , and declares intmax_t. AC_MSG_CHECKING(for inttypes.h) AC_CACHE_VAL(gcc_cv_header_inttypes_h, -[AC_TRY_COMPILE( - [#include -#include ], - [intmax_t i = -1;], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#include +#include ]], + [[intmax_t i = -1;]])], [gcc_cv_header_inttypes_h=yes], - gcc_cv_header_inttypes_h=no)]) + [gcc_cv_header_inttypes_h=no])]) AC_MSG_RESULT($gcc_cv_header_inttypes_h) if test $gcc_cv_header_inttypes_h = yes; then AC_DEFINE(HAVE_INTTYPES_H, 1, @@ -809,23 +1043,27 @@ fi dnl Disabled until we have a complete test for buggy enum bitfields. dnl gcc_AC_C_ENUM_BF_UNSIGNED -AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \ - sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \ - scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \ - setlocale) +define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl + ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl + fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl + fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl + putchar_unlocked putc_unlocked) +AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ + sysconf strsignal getrusage nl_langinfo scandir alphasort \ + gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + gcc_UNLOCKED_FUNCS) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, -[ AC_TRY_RUN([#include +[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int main() { mbstowcs(0, "", 0); return 0; -}], - gcc_cv_func_mbstowcs_works=yes, - gcc_cv_func_mbstowcs_works=no, - gcc_cv_func_mbstowcs_works=yes)]) +}]])], + [gcc_cv_func_mbstowcs_works=yes], + [gcc_cv_func_mbstowcs_works=no], + [gcc_cv_func_mbstowcs_works=yes])]) if test x$gcc_cv_func_mbstowcs_works = xyes; then AC_DEFINE(HAVE_WORKING_MBSTOWCS, 1, [Define this macro if mbstowcs does not crash when its @@ -855,7 +1093,6 @@ else fi AC_SUBST(TARGET_GETGROUPS_T) -gcc_AC_FUNC_PRINTF_PTR gcc_AC_FUNC_MMAP_BLACKLIST case "${host}" in @@ -866,7 +1103,7 @@ case "${host}" in ac_cv_func_vfork_works=yes ;; esac -AC_FUNC_VFORK +AC_FUNC_FORK AM_ICONV # Until we have in-tree GNU iconv: @@ -875,13 +1112,15 @@ AC_SUBST(LIBICONV_DEP) AM_LC_MESSAGES +AM_LANGINFO_CODESET + # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" -gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \ - strsignal putc_unlocked fputs_unlocked fwrite_unlocked \ - fprintf_unlocked strstr errno snprintf vasprintf \ - malloc realloc calloc free basename getopt clock, , ,[ +gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \ + strsignal strstr strverscmp \ + errno snprintf vsnprintf vasprintf malloc realloc calloc \ + free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" #include "system.h"]) @@ -893,19 +1132,25 @@ gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[ #endif ]) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_RESOURCE_H #include #endif -],[rlim_t l = 0;],,[AC_DEFINE([rlim_t],[long], +]], [[rlim_t l = 0;]])],[],[AC_DEFINE([rlim_t],[long], [Define to \`long' if doesn't define.])]) +# On AIX 5.2, conflicts with , as both define incompatible +# FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname +# in collect2.c, isn't visible, but the configure test below needs +# to undef these macros to get the correct value for HAVE_DECL_LDGETNAME. gcc_AC_CHECK_DECLS(ldgetname, , ,[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_LDFCN_H +#undef FREAD +#undef FWRITE #include #endif ]) @@ -918,15 +1163,21 @@ gcc_AC_CHECK_DECLS(times, , ,[ #endif ]) +gcc_AC_CHECK_DECLS(sigaltstack, , ,[ +#include "ansidecl.h" +#include "system.h" +#include +]) + # More time-related stuff. AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [ -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_TIMES_H #include #endif -], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)]) +]], [[struct tms tms;]])],[ac_cv_struct_tms=yes],[ac_cv_struct_tms=no])]) if test $ac_cv_struct_tms = yes; then AC_DEFINE(HAVE_STRUCT_TMS, 1, [Define if defines struct tms.]) @@ -935,28 +1186,15 @@ fi # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE. # revisit after autoconf 2.50. AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [ -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" -], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)]) +]], [[clock_t x;]])],[gcc_cv_type_clock_t=yes],[gcc_cv_type_clock_t=no])]) if test $gcc_cv_type_clock_t = yes; then AC_DEFINE(HAVE_CLOCK_T, 1, [Define if defines clock_t.]) fi -AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar, -[AC_TRY_COMPILE([ -#include "ansidecl.h" -#include "system.h" -], -[if ((uchar *)0) return 0; - if (sizeof(uchar)) return 0;], -ac_cv_type_uchar=yes, ac_cv_type_uchar=no)]) -if test $ac_cv_type_uchar = yes; then - AC_DEFINE(HAVE_UCHAR, 1, - [Define if defines \`uchar'.]) -fi - # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" @@ -984,6 +1222,12 @@ AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, AC_ARG_WITH(system-libunwind, [ --with-system-libunwind use installed libunwind]) +# config.gcc also contains tests of with_system_libunwind. +if test x$with_system_libunwind = xyes; then + AC_DEFINE(HAVE_GETIPINFO, 1, +[Define to 1 if system unwind library has _Unwind_GetIPInfo.]) +fi + # -------------------------------------------------------- # Build, host, and target specific configuration fragments # -------------------------------------------------------- @@ -1075,6 +1319,12 @@ if test x$need_64bit_hwint = xyes; then [Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).]) fi +if test x$use_long_long_for_widest_fast_int = xyes; then + AC_DEFINE(USE_LONG_LONG_FOR_WIDEST_FAST_INT, 1, +[Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still +efficiently supported by the host hardware.]) +fi + count=a for f in $host_xm_file; do count=${count}x @@ -1108,8 +1358,29 @@ if test "$host_xm_file" != "$build_xm_file"; then fi fi +case ${host} in + powerpc*-*-darwin*) + AC_CACHE_CHECK([whether mcontext_t fields have underscores], + gcc_cv_mcontext_underscores, + AC_COMPILE_IFELSE([ +#include +#include +int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; } +], + gcc_cv_mcontext_underscores=no, gcc_cv_mcontext_underscores=yes)) + if test $gcc_cv_mcontext_underscores = yes; then + AC_DEFINE(HAS_MCONTEXT_T_UNDERSCORES,,dnl + [mcontext_t fields start with __]) + fi + ;; +esac + +# --------- +# Threading +# --------- + # Check if a valid thread package -case ${enable_threads_flag} in +case ${enable_threads} in "" | no) # No threads target_thread_file='single' @@ -1118,12 +1389,12 @@ case ${enable_threads_flag} in # default target_thread_file='single' ;; - aix | dce | gnat | irix | posix | rtems | \ + aix | dce | gnat | irix | posix | posix95 | rtems | \ single | solaris | vxworks | win32 ) - target_thread_file=${enable_threads_flag} + target_thread_file=${enable_threads} ;; *) - echo "${enable_threads_flag} is an unknown thread package" 1>&2 + echo "${enable_threads} is an unknown thread package" 1>&2 exit 1 ;; esac @@ -1134,15 +1405,51 @@ if test x${thread_file} = x; then thread_file=${target_thread_file} fi +# Make gthr-default.h if we have a thread file. +gthread_flags= +if test $thread_file != single; then + rm -f gthr-default.h + echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h + gthread_flags=-DHAVE_GTHR_DEFAULT +fi +AC_SUBST(gthread_flags) + +# -------- +# UNSORTED +# -------- + +use_cxa_atexit=no if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then - AC_CHECK_FUNC(__cxa_atexit, - [AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1, - [Define if you want to use __cxa_atexit, rather than atexit, to - register C++ destructors for local statics and global objects. - This is essential for fully standards-compliant handling of - destructors, but requires __cxa_atexit in libc.])], - echo "__cxa_atexit can't be enabled on this target") + if test x$host = x$target; then + AC_CHECK_FUNC(__cxa_atexit,[use_cxa_atexit=yes], + [echo "__cxa_atexit can't be enabled on this target"]) + else + # We can't check for __cxa_atexit when building a cross, so assume + # it is available + use_cxa_atexit=yes + fi + if test x$use_cxa_atexit = xyes; then + AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 2, + [Define if you want to use __cxa_atexit, rather than atexit, to + register C++ destructors for local statics and global objects. + This is essential for fully standards-compliant handling of + destructors, but requires __cxa_atexit in libc.]) + fi +fi + +use_getipinfo=yes +if test x$with_system_libunwind = xyes; then + if test x$host = x$target; then + AC_SEARCH_LIBS(_Unwind_GetIPInfo, unwind,, [use_getipinfo=no]) + fi +fi +GCC_TARGET_TEMPLATE(HAVE_GETIPINFO) +if test x$use_getipinfo = xyes; then + AC_DEFINE(HAVE_GETIPINFO, 1, + [Define to 1 if system unwind library has _Unwind_GetIPInfo.]) +else + echo "The system unwind library does not support _Unwind_GetIPInfo." fi # Look for a file containing extra machine modes. @@ -1154,6 +1461,13 @@ if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then for this architecture.]) fi +# Convert extra_options into a form suitable for Makefile use. +extra_opt_files= +for f in $extra_options; do + extra_opt_files="$extra_opt_files \$(srcdir)/config/$f" +done +AC_SUBST(extra_opt_files) + # auto-host.h is the file containing items generated by autoconf and is # the first file included by config.h. # If host=build, it is correct to have bconfig include auto-host.h @@ -1162,7 +1476,6 @@ fi if test x$host = x$build then build_auto=auto-host.h - FORBUILD=.. else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new @@ -1179,6 +1492,7 @@ else saved_CFLAGS="${CFLAGS}" CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias CFLAGS="${saved_CFLAGS}" @@ -1188,9 +1502,8 @@ else cd .. rm -rf $tempdir build_auto=auto-build.h - FORBUILD=../${build_subdir} fi -AC_SUBST(FORBUILD) +AC_SUBST(build_subdir) tm_file="${tm_file} defaults.h" tm_p_file="${tm_p_file} tm-preds.h" @@ -1198,22 +1511,13 @@ host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" # We don't want ansidecl.h in target files, write code there in ISO/GNU C. # put this back in temporarily. -xm_file="ansidecl.h ${xm_file}" +xm_file="auto-host.h ansidecl.h ${xm_file}" # -------- # UNSORTED # -------- -# Get the version trigger filename from the toplevel -if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger -else - gcc_version_trigger=${srcdir}/version.c -fi changequote(,)dnl -gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` -gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` - # Compile in configure arguments. if test -f configargs.h ; then # Being re-configured. @@ -1243,11 +1547,6 @@ EOF changequote([,])dnl # Internationalization -PACKAGE=gcc -VERSION="$gcc_version" -AC_SUBST(PACKAGE) -AC_SUBST(VERSION) - ZW_GNU_GETTEXT_SISTER_DIR # If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get @@ -1256,6 +1555,10 @@ case "$LIBINTL" in *$LIBICONV*) LIBICONV= ;; esac +AC_ARG_ENABLE(secureplt, +[ --enable-secureplt enable -msecure-plt by default for PowerPC], +[], []) + # Windows32 Registry support for specifying GCC installation paths. AC_ARG_ENABLE(win32-registry, [ --disable-win32-registry @@ -1265,42 +1568,28 @@ AC_ARG_ENABLE(win32-registry, --enable-win32-registry=KEY use KEY instead of GCC version as the last portion of the registry key],,) + case $host_os in - win32 | pe | cygwin* | mingw32* | uwin*) -AC_MSG_CHECKING(whether windows registry support is requested) -if test "x$enable_win32_registry" != xno; then - AC_DEFINE(ENABLE_WIN32_REGISTRY, 1, -[Define to 1 if installation paths should be looked up in Windows32 - Registry. Ignored on non windows32 hosts.]) - AC_MSG_RESULT(yes) - AC_SEARCH_LIBS(RegOpenKeyExA, advapi32) -else - AC_MSG_RESULT(no) -fi + win32 | pe | cygwin* | mingw32* | uwin*) + if test "x$enable_win32_registry" != xno; then + AC_SEARCH_LIBS(RegOpenKeyExA, advapi32,, [enable_win32_registry=no]) + fi -# Check if user specified a different registry key. -case "x${enable_win32_registry}" in -x | xyes) - # default. - gcc_cv_win32_registry_key="$VERSION" - ;; -xno) - # no registry lookup. - gcc_cv_win32_registry_key='' - ;; -*) - # user-specified key. - gcc_cv_win32_registry_key="$enable_win32_registry" - ;; -esac + if test "x$enable_win32_registry" != xno; then + AC_DEFINE(ENABLE_WIN32_REGISTRY, 1, + [Define to 1 if installation paths should be looked up in the Windows + Registry. Ignored on non-Windows hosts.]) -if test "x$enable_win32_registry" != xno; then - AC_MSG_CHECKING(registry key on windows hosts) - AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key", - [Define to be the last portion of registry key on windows hosts.]) - AC_MSG_RESULT($gcc_cv_win32_registry_key) -fi -;; + if test "x$enable_win32_registry" != xyes \ + && test "x$enable_win32_registry" != x; then + AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$enable_win32_registry", + [Define to be the last component of the Windows registry key under which + to look for installation paths. The full key used will be + HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}. + The default is the GCC version number.]) + fi + fi + ;; esac # Get an absolute path to the GCC top-level source directory @@ -1330,37 +1619,33 @@ do done tmake_file="${tmake_file_}" -symbolic_link='ln -s' - # If the host doesn't support symlinks, modify CC in # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works. # Otherwise, we can use "CC=$(CC)". rm -f symtest.tem -if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null -then - cc_set_by_configure="\$(CC)" - quoted_cc_set_by_configure="\$(CC)" - stage_prefix_set_by_configure="\$(STAGE_PREFIX)" - quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)" -else - rm -f symtest.tem - if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null - then - symbolic_link="cp -p" - else - symbolic_link="cp" - fi - cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`" - quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`" - stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`" - quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`" -fi -rm -f symtest.tem +case "$LN_S" in + *-s*) + cc_set_by_configure="\$(CC)" + quoted_cc_set_by_configure="\$(CC)" + stage_prefix_set_by_configure="\$(STAGE_PREFIX)" + quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)" + ;; + *) + cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`" + quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`" + stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`" + quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`" + ;; +esac + +# This is a terrible hack which will go away some day. +host_cc_for_libada=${CC} +AC_SUBST(host_cc_for_libada) out_object_file=`basename $out_file .c`.o -tm_file_list= -tm_include_list= +tm_file_list="options.h" +tm_include_list="options.h" for f in $tm_file; do case $f in defaults.h ) @@ -1449,11 +1734,21 @@ done CROSS= AC_SUBST(CROSS) ALL=all.internal AC_SUBST(ALL) SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' AC_SUBST(SYSTEM_HEADER_DIR) + +if test "x$with_build_sysroot" != x; then + build_system_header_dir=$with_build_sysroot'$(NATIVE_SYSTEM_HEADER_DIR)' +else + # This value is used, even on a native system, because + # CROSS_SYSTEM_HEADER_DIR is just + # $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR). + build_system_header_dir='$(CROSS_SYSTEM_HEADER_DIR)' +fi + if test x$host != x$target then CROSS="-DCROSS_COMPILE" ALL=all.cross - SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + SYSTEM_HEADER_DIR=$build_system_header_dir case "$host","$target" in # Darwin crosses can use the host system's libraries and headers, # because of the fat library support. Of course, it must be the @@ -1475,8 +1770,7 @@ then CROSS="$CROSS -DNATIVE_CROSS" ;; esac elif test "x$TARGET_SYSTEM_ROOT" != x; then - # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR) - SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + SYSTEM_HEADER_DIR=$build_system_header_dir fi # If this is a cross-compiler that does not @@ -1487,11 +1781,11 @@ fi # then define inhibit_libc in LIBGCC2_CFLAGS. # This prevents libgcc2 from containing any code which requires libc # support. -inhibit_libc= +inhibit_libc=false if { { test x$host != x$target && test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; } && { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then - inhibit_libc=-Dinhibit_libc + inhibit_libc=true fi AC_SUBST(inhibit_libc) @@ -1500,11 +1794,8 @@ AC_SUBST(inhibit_libc) # Also, we cannot run fixincludes or fix-header. # These are the normal (build=host) settings: -BUILD_PREFIX= AC_SUBST(BUILD_PREFIX) -BUILD_PREFIX_1=ignore- AC_SUBST(BUILD_PREFIX_1) CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD) BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS) - STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC) # Possibly disable fixproto, on a per-target basis. @@ -1521,13 +1812,12 @@ AC_SUBST(STMP_FIXPROTO) # And these apply if build != host, or we are generating coverage data if test x$build != x$host || test "x$coverage_flags" != x then - BUILD_PREFIX=build- - BUILD_PREFIX_1=build- BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' if test "x$TARGET_SYSTEM_ROOT" = x; then - STMP_FIXINC= - STMP_FIXPROTO= + if test "x$STMP_FIXPROTO" != x; then + STMP_FIXPROTO=stmp-install-fixproto + fi fi fi @@ -1539,6 +1829,13 @@ for file in ${extra_headers} ; do extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}" done +# Define collect2 in Makefile. +case $host_can_use_collect2 in + no) collect2= ;; + *) collect2='collect2$(exeext)' ;; +esac +AC_SUBST([collect2]) + # Add a definition of USE_COLLECT2 if system wants one. case $use_collect2 in no) use_collect2= ;; @@ -1546,9 +1843,18 @@ case $use_collect2 in *) host_xm_defines="${host_xm_defines} USE_COLLECT2" xm_defines="${xm_defines} USE_COLLECT2" + case $host_can_use_collect2 in + no) + AC_MSG_ERROR([collect2 is required but cannot be built on this system]) + ;; + esac ;; esac +# --------------------------- +# Assembler & linker features +# --------------------------- + # Identify the assembler which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the assembler # which will be driven by the driver program. @@ -1556,26 +1862,38 @@ esac # If build != host, and we aren't building gas in-tree, we identify a # build->target assembler and hope that it will have the same features # as the host->target assembler we'll be using. -AC_MSG_CHECKING(what assembler to use) -in_tree_gas=no -gcc_cv_as= gcc_cv_gas_major_version= gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas + +m4_pattern_allow([AS_FOR_TARGET])dnl +AS_VAR_SET_IF(gcc_cv_as,, [ if test -x "$DEFAULT_ASSEMBLER"; then gcc_cv_as="$DEFAULT_ASSEMBLER" -elif test -x "$AS"; then - gcc_cv_as="$AS" -elif test -x as$host_exeext; then - # Build using assembler in the current directory. - gcc_cv_as=./as$host_exeext elif test -f $gcc_cv_as_gas_srcdir/configure.in \ - && test -f ../gas/Makefile; then - # Single tree build which includes gas. + && test -f ../gas/Makefile \ + && test x$build = x$host; then + gcc_cv_as=../gas/as-new$build_exeext +elif test -x as$build_exeext; then + # Build using assembler in the current directory. + gcc_cv_as=./as$build_exeext +elif test -x $AS_FOR_TARGET; then + gcc_cv_as="$AS_FOR_TARGET" +else + AC_PATH_PROG(gcc_cv_as, $AS_FOR_TARGET) +fi]) + +ORIGINAL_AS_FOR_TARGET=$gcc_cv_as +AC_SUBST(ORIGINAL_AS_FOR_TARGET) + +AC_MSG_CHECKING(what assembler to use) +if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then + # Single tree build which includes gas. We want to prefer it + # over whatever linker top-level may have detected, since + # we'll use what we're building after installation anyway. + AC_MSG_RESULT(newly built gas) in_tree_gas=yes _gcc_COMPUTE_GAS_VERSION - rm -f as$host_exeext - $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null in_tree_gas_is_elf=no if grep 'obj_format = elf' ../gas/Makefile > /dev/null \ || (grep 'obj_format = multi' ../gas/Makefile \ @@ -1583,76 +1901,11 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \ then in_tree_gas_is_elf=yes fi +else + AC_MSG_RESULT($gcc_cv_as) + in_tree_gas=no fi -if test "x$gcc_cv_as" = x; then - # Search the same directories that the installed compiler will - # search. Else we may find the wrong assembler and lose. If we - # do not find a suitable assembler binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an assembler, then use whatever - # one we can find in the users's path. - # user's path. - if test "x$program_prefix" != xNONE; then - gcc_cv_as=${program_prefix}as$host_exeext - else - gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext - fi - - test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ - $test_prefix/libexec/gcc/$target_noncanonical \ - /usr/lib/gcc/$target_noncanonical/$gcc_version \ - /usr/lib/gcc/$target_noncanonical \ - $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ - $test_prefix/$target_noncanonical/bin" - - if test x$host = x$target; then - test_dirs="$test_dirs \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - fi - - for dir in $test_dirs; do - if test -x $dir/as$host_exeext; then - gcc_cv_as=$dir/as$host_exeext - break; - fi - done -fi -case $in_tree_gas in - yes) - AC_MSG_RESULT("newly built gas") - ;; - no) - AC_MSG_RESULT($gcc_cv_as) - ;; -esac - # Identify the linker which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the linker # which will be driven by the driver program. @@ -1660,161 +1913,111 @@ esac # If build != host, and we aren't building gas in-tree, we identify a # build->target linker and hope that it will have the same features # as the host->target linker we'll be using. -AC_MSG_CHECKING(what linker to use) -in_tree_ld=no -gcc_cv_ld= gcc_cv_gld_major_version= gcc_cv_gld_minor_version= gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd + +AS_VAR_SET_IF(gcc_cv_ld,, [ if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" -elif test -x "$LD"; then - gcc_cv_ld="$LD" -elif test -x collect-ld$host_exeext; then - # Build using linker in the current directory. - gcc_cv_ld=./collect-ld$host_exeext elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ - && test -f ../ld/Makefile; then - # Single tree build which includes ld. + && test -f ../ld/Makefile \ + && test x$build = x$host; then + gcc_cv_ld=../ld/ld-new$build_exeext +elif test -x collect-ld$build_exeext; then + # Build using linker in the current directory. + gcc_cv_ld=./collect-ld$build_exeext +elif test -x $LD_FOR_TARGET; then + gcc_cv_ld="$LD_FOR_TARGET" +else + AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET) +fi]) + +ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld +AC_SUBST(ORIGINAL_LD_FOR_TARGET) + +AC_MSG_CHECKING(what linker to use) +if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then + # Single tree build which includes ld. We want to prefer it + # over whatever linker top-level may have detected, since + # we'll use what we're building after installation anyway. + AC_MSG_RESULT(newly built ld) in_tree_ld=yes in_tree_ld_is_elf=no if (grep 'EMUL = .*elf' ../ld/Makefile \ - || grep 'EMUL = .*linux' ../ld/Makefile) > /dev/null; then + || grep 'EMUL = .*linux' ../ld/Makefile \ + || grep 'EMUL = .*lynx' ../ld/Makefile) > /dev/null; then in_tree_ld_is_elf=yes fi for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in do changequote(,)dnl - gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` -changequote([,])dnl + gcc_cv_gld_version=`sed -n -e 's/^[ ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f` if test x$gcc_cv_gld_version != x; then break fi done -changequote(,)dnl gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` changequote([,])dnl - rm -f collect-ld$host_exeext - $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \ - 2>/dev/null +else + AC_MSG_RESULT($gcc_cv_ld) + in_tree_ld=no fi -if test "x$gcc_cv_ld" = x; then - # Search the same directories that the installed compiler will - # search. Else we may find the wrong linker and lose. If we - # do not find a suitable linker binary, then try the user's - # path. - # - # Also note we have to check MD_EXEC_PREFIX before checking the - # user's path. Unfortunately, there is no good way to get at the - # value of MD_EXEC_PREFIX here. So we do a brute force search - # through all the known MD_EXEC_PREFIX values. Ugh. This needs - # to be fixed as part of the make/configure rewrite too. - - if test "x$exec_prefix" = xNONE; then - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - else - test_prefix=$exec_prefix - fi - - # If the loop below does not find an linker, then use whatever - # one we can find in the users's path. - # user's path. - if test "x$program_prefix" != xNONE; then - gcc_cv_ld=${program_prefix}ld$host_exeext - else - gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext - fi - - test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ - $test_prefix/libexec/gcc/$target_noncanonical \ - /usr/lib/gcc/$target_noncanonical/$gcc_version \ - /usr/lib/gcc/$target_noncanonical \ - $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ - $test_prefix/$target_noncanonical/bin" - - if test x$host = x$target; then - test_dirs="$test_dirs \ - /usr/libexec \ - /usr/ccs/gcc \ - /usr/ccs/bin \ - /udk/usr/ccs/bin \ - /bsd43/usr/lib/cmplrs/cc \ - /usr/cross64/usr/bin \ - /usr/lib/cmplrs/cc \ - /sysv/usr/lib/cmplrs/cc \ - /svr4/usr/lib/cmplrs/cc \ - /usr/bin" - fi - - for dir in $test_dirs; do - if test -x $dir/ld$host_exeext; then - gcc_cv_ld=$dir/ld$host_exeext - break; - fi - done -fi -case $in_tree_ld in - yes) - AC_MSG_RESULT("newly built ld") - ;; - no) - AC_MSG_RESULT($gcc_cv_ld) - ;; -esac - # Figure out what nm we will be using. gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils -AC_MSG_CHECKING(what nm to use) -in_tree_nm=no -if test -x nm$host_exeext; then - gcc_cv_nm=./nm$host_exeext -elif test -f $gcc_cv_binutils_srcdir/configure.in \ - && test -f ../binutils/Makefile; then - # Single tree build which includes binutils. - in_tree_nm=yes - gcc_cv_nm=./nm$host_exeext - rm -f nm$host_exeext - $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null -elif test "x$program_prefix" != xNONE; then - gcc_cv_nm=${program_prefix}nm$host_exeext +AS_VAR_SET_IF(gcc_cv_nm,, [ +if test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile \ + && test x$build = x$host; then + gcc_cv_nm=../binutils/nm-new$build_exeext +elif test -x nm$build_exeext; then + gcc_cv_nm=./nm$build_exeext +elif test -x $NM_FOR_TARGET; then + gcc_cv_nm="$NM_FOR_TARGET" else - gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext + AC_PATH_PROG(gcc_cv_nm, $NM_FOR_TARGET) +fi]) + +AC_MSG_CHECKING(what nm to use) +if test "$gcc_cv_nm" = ../binutils/nm-new$build_exeext; then + # Single tree build which includes binutils. + AC_MSG_RESULT(newly built nm) + in_tree_nm=yes +else + AC_MSG_RESULT($gcc_cv_nm) + in_tree_nm=no fi -case $in_tree_nm in - yes) AC_MSG_RESULT("newly built nm") ;; - no) AC_MSG_RESULT($gcc_cv_nm) ;; -esac + +ORIGINAL_NM_FOR_TARGET=$gcc_cv_nm +AC_SUBST(ORIGINAL_NM_FOR_TARGET) # Figure out what objdump we will be using. -AC_MSG_CHECKING(what objdump to use) -in_tree_objdump=no -if test -x objdump$host_exeext; then - gcc_cv_objdump=./objdump$host_exeext -elif test -f $gcc_cv_binutils_srcdir/configure.in \ - && test -f ../binutils/Makefile; then +AS_VAR_SET_IF(gcc_cv_objdump,, [ +if test -f $gcc_cv_binutils_srcdir/configure.in \ + && test -f ../binutils/Makefile \ + && test x$build = x$host; then # Single tree build which includes binutils. - in_tree_objdump=yes - gcc_cv_objdump=./objdump$host_exeext - rm -f objdump$host_exeext - $symbolic_link ../binutils/objdump$host_exeext \ - objdump$host_exeext 2>/dev/null -elif test "x$program_prefix" != xNONE; then - gcc_cv_objdump=${program_prefix}objdump$host_exeext + gcc_cv_objdump=../binutils/objdump$build_exeext +elif test -x objdump$build_exeext; then + gcc_cv_objdump=./objdump$build_exeext +elif test -x $OBJDUMP_FOR_TARGET; then + gcc_cv_objdump="$OBJDUMP_FOR_TARGET" else - gcc_cv_objdump=`echo objdump | \ - sed ${program_transform_name}`$host_exeext + AC_PATH_PROG(gcc_cv_objdump, $OBJDUMP_FOR_TARGET) +fi]) + +AC_MSG_CHECKING(what objdump to use) +if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then + # Single tree build which includes binutils. + AC_MSG_RESULT(newly built objdump) +elif test x$gcc_cv_objdump = x; then + AC_MSG_RESULT(not found) +else + AC_MSG_RESULT($gcc_cv_objdump) fi -case $in_tree_objdump in - yes) AC_MSG_RESULT("newly built objdump") ;; - no) AC_MSG_RESULT($gcc_cv_objdump) ;; -esac # Figure out what assembler alignment features are present. gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align, @@ -1855,6 +2058,11 @@ gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak, [ .weak foobar],, [AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])]) +gcc_GAS_CHECK_FEATURE([.weakref], gcc_cv_as_weakref, + [2,17,0],, + [ .weakref foobar, barfnot],, +[AC_DEFINE(HAVE_GAS_WEAKREF, 1, [Define if your assembler supports .weakref.])]) + gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat, [2,15,91],, [ .SPACE $TEXT$ @@ -1891,8 +2099,12 @@ changequote(,)dnl -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ -].*$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` + ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` + ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` if test 0"$ld_date" -lt 20020404; then if test -n "$ld_date"; then # If there was date string, but was earlier than 2002-04-04, fail @@ -1901,9 +2113,6 @@ changequote(,)dnl # If there was no date string nor ld version number, something is wrong gcc_cv_ld_hidden=no else - ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` - ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` - ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` test -z "$ld_vers_patch" && ld_vers_patch=0 if test "$ld_vers_major" -lt 2; then gcc_cv_ld_hidden=no @@ -1928,6 +2137,7 @@ changequote([,])dnl fi]) libgcc_visibility=no AC_SUBST(libgcc_visibility) +GCC_TARGET_TEMPLATE([HAVE_GAS_HIDDEN]) if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then libgcc_visibility=yes AC_DEFINE(HAVE_GAS_HIDDEN, 1, @@ -2012,11 +2222,14 @@ cat > conftest.big </dev/null \ | tail -3 > conftest.got \ - && { cmp conftest.lit conftest.got > /dev/null 2>&1 \ - || cmp conftest.big conftest.got > /dev/null 2>&1; } + && { diff -b conftest.lit conftest.got > /dev/null 2>&1 \ + || diff -b conftest.big conftest.got > /dev/null 2>&1; } then gcc_cv_as_eh_frame=yes elif AC_TRY_COMMAND($gcc_cv_as -o conftest.o --traditional-format /dev/null); then @@ -2034,10 +2247,49 @@ fi gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge, [elf,2,12,0], [--fatal-warnings], [.section .rodata.str, "aMS", @progbits, 1]) +if test $gcc_cv_as_shf_merge = no; then + gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge, + [elf,2,12,0], [--fatal-warnings], + [.section .rodata.str, "aMS", %progbits, 1]) +fi AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE, [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`], [Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.]) +gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group, + [elf,2,16,0], [--fatal-warnings], + [.section .text,"axG",@progbits,.foo,comdat]) +if test $gcc_cv_as_comdat_group = yes; then + gcc_cv_as_comdat_group_percent=no +else + gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group_percent, + [elf,2,16,0], [--fatal-warnings], + [.section .text,"axG",%progbits,.foo,comdat]) +fi +if test $in_tree_ld != yes && test x"$ld_vers" != x; then + comdat_group=yes + if test 0"$ld_date" -lt 20050308; then + if test -n "$ld_date"; then + # If there was date string, but was earlier than 2005-03-08, fail + comdat_group=no + elif test "$ld_vers_major" -lt 2; then + comdat_group=no + elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then + comdat_group=no + fi + fi +else + # assume linkers other than GNU ld don't support COMDAT group + comdat_group=no +fi +if test $comdat_group = no; then + gcc_cv_as_comdat_group=no + gcc_cv_as_comdat_group_percent=no +fi +AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP, + [`if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi`], +[Define 0/1 if your assembler and linker support COMDAT groups.]) + # Thread-local storage - the check is heavily parametrized. conftest_s= tls_first_major= @@ -2068,6 +2320,57 @@ foo: .long 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + frv*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +x: .long 25 + .text + call #gettlsoff(x)' + tls_first_major=2 + tls_first_minor=14 + ;; + hppa*-*-linux*) + conftest_s=' +t1: .reg %r20 +t2: .reg %r21 +gp: .reg %r19 + .section ".tdata","awT",@progbits +foo: .long 25 + .text + .align 4 + addil LT%foo-$tls_gdidx$,gp + ldo RT%foo-$tls_gdidx$(%r1),%arg0 + b __tls_get_addr + nop + addil LT%foo-$tls_ldidx$,gp + b __tls_get_addr + ldo RT%foo-$tls_ldidx$(%r1),%arg0 + addil LR%foo-$tls_dtpoff$,%ret0 + ldo RR%foo-$tls_dtpoff$(%r1),%t1 + mfctl %cr27,%t1 + addil LT%foo-$tls_ieoff$,gp + ldw RT%foo-$tls_ieoff$(%r1),%t2 + add %t1,%t2,%t3 + mfctl %cr27,%t1 + addil LR%foo-$tls_leoff$,%t1 + ldo RR%foo-$tls_leoff$(%r1),%t2' + tls_first_major=2 + tls_first_minor=15 + tls_as_opt=--fatal-warnings + ;; + arm*-*-*) + conftest_s=' + .section ".tdata","awT",%progbits +foo: .long 25 + .text +.word foo(gottpoff) +.word foo(tpoff) +.word foo(tlsgd) +.word foo(tlsldm) +.word foo(tlsldo)' + tls_first_major=2 + tls_first_minor=17 + ;; i[34567]86-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -2121,6 +2424,23 @@ foo: data8 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + mips*-*-*) + conftest_s=' + .section .tdata,"awT",@progbits +x: + .word 2 + .text + addiu $4, $28, %tlsgd(x) + addiu $4, $28, %tlsldm(x) + lui $4, %dtprel_hi(x) + addiu $4, $4, %dtprel_lo(x) + lw $4, %gottprel(x)($28) + lui $4, %tprel_hi(x) + addiu $4, $4, %tprel_lo(x)' + tls_first_major=2 + tls_first_minor=16 + tls_as_opt='-32 --fatal-warnings' + ;; powerpc-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -2234,6 +2554,15 @@ foo: .long 25 ;; sparc*-*-*) case "$target" in + sparc*-sun-solaris2.[56789]*) + # TLS was introduced in the Solaris 9 4/04 release but + # we do not enable it by default on Solaris 9 either. + if test "x$enable_tls" = xyes ; then + on_solaris=yes + else + enable_tls=no; + fi + ;; sparc*-sun-solaris2.*) on_solaris=yes ;; @@ -2296,17 +2625,64 @@ foo: .long 25 ;; changequote([,])dnl esac -if test -z "$tls_first_major"; then +set_have_as_tls=no +if test "x$enable_tls" = xno ; then + : # TLS explicitly disabled. +elif test "x$enable_tls" = xyes ; then + set_have_as_tls=yes # TLS explicitly enabled. +elif test -z "$tls_first_major"; then : # If we don't have a check, assume no support. else gcc_GAS_CHECK_FEATURE(thread-local storage support, gcc_cv_as_tls, [$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],, - [AC_DEFINE(HAVE_AS_TLS, 1, - [Define if your assembler supports thread-local storage.])]) + [set_have_as_tls=yes]) +fi +if test $set_have_as_tls = yes ; then + AC_DEFINE(HAVE_AS_TLS, 1, + [Define if your assembler supports thread-local storage.]) fi # Target-specific assembler checks. +AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option) +gcc_cv_ld_static_dynamic=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then + gcc_cv_ld_static_dynamic=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports -Bstatic/-Bdynamic option + if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ + && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then + gcc_cv_ld_static_dynamic=yes + fi +fi +if test x"$gcc_cv_ld_static_dynamic" = xyes; then + AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1, +[Define if your linker supports -Bstatic/-Bdynamic option.]) +fi +AC_MSG_RESULT($gcc_cv_ld_static_dynamic) + +if test x"$demangler_in_ld" = xyes; then + AC_MSG_CHECKING(linker --demangle support) + gcc_cv_ld_demangle=no + if test $in_tree_ld = yes; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \ + gcc_cv_ld_demangle=yes + fi + elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then + # Check if the GNU linker supports --demangle option + if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then + gcc_cv_ld_demangle=yes + fi + fi + if test x"$gcc_cv_ld_demangle" = xyes; then + AC_DEFINE(HAVE_LD_DEMANGLE, 1, +[Define if your linker supports --demangle option.]) + fi + AC_MSG_RESULT($gcc_cv_ld_demangle) +fi + case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) @@ -2420,6 +2796,26 @@ foo: changequote(,)dnl i[34567]86-*-* | x86_64-*-*) changequote([,])dnl + case $target_os in + cygwin* | pe | mingw32*) + # Used for DWARF 2 in PE + gcc_GAS_CHECK_FEATURE([.secrel32 relocs], + gcc_cv_as_ix86_pe_secrel32, + [2,15,91],, +[.text +foo: nop +.data + .secrel32 foo], + [if test x$gcc_cv_ld != x \ + && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1; then + gcc_cv_as_ix86_pe_secrel32=yes + fi + rm -f conftest], + [AC_DEFINE(HAVE_GAS_PE_SECREL32_RELOC, 1, + [Define if your assembler and linker support 32-bit section relative relocs via '.secrel32 label'.])]) + ;; + esac + gcc_GAS_CHECK_FEATURE([filds and fists mnemonics], gcc_cv_as_ix86_filds_fists, [2,9,0],, [filds mem; fists mem],, @@ -2432,6 +2828,12 @@ changequote([,])dnl [AC_DEFINE(HAVE_AS_IX86_CMOV_SUN_SYNTAX, 1, [Define if your assembler supports the Sun syntax for cmov.])]) + gcc_GAS_CHECK_FEATURE([ffreep mnemonic], + gcc_cv_as_ix86_ffreep,,, + [ffreep %st(1)],, + [AC_DEFINE(HAVE_AS_IX86_FFREEP, 1, + [Define if your assembler supports the ffreep mnemonic.])]) + # This one is used unconditionally by i386.[ch]; it is to be defined # to 1 if the feature is present, 0 otherwise. gcc_GAS_CHECK_FEATURE([GOTOFF in data], @@ -2460,11 +2862,22 @@ changequote([,])dnl powerpc*-*-*) case $target in - *-*-aix*) conftest_s=' .csect .text[[PR]] + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[[PR]] mfcr 3,128';; - *-*-darwin*) conftest_s=' .text + *-*-darwin*) + gcc_GAS_CHECK_FEATURE([.machine directive support], + gcc_cv_as_machine_directive,,, + [ .machine ppc7400]) + if test x$gcc_cv_as_machine_directive != xyes; then + echo "*** This target requires an assembler supporting \".machine\"" >&2 + echo you can get it from: ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg >&2 + test x$build = x$target && exit 1 + fi + conftest_s=' .text mfcr r3,128';; - *) conftest_s=' .text + *) conftest_s=' .machine power4 + .text mfcr 3,128';; esac @@ -2473,6 +2886,55 @@ changequote([,])dnl [$conftest_s],, [AC_DEFINE(HAVE_AS_MFCRF, 1, [Define if your assembler supports mfcr field.])]) + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[[PR]] + popcntb 3,3';; + *) conftest_s=' .machine power5 + .text + popcntb 3,3';; + esac + + gcc_GAS_CHECK_FEATURE([popcntb support], + gcc_cv_as_powerpc_popcntb, [2,17,0],, + [$conftest_s],, + [AC_DEFINE(HAVE_AS_POPCNTB, 1, + [Define if your assembler supports popcntb field.])]) + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5x" + .csect .text[[PR]] + frin 1,1';; + *) conftest_s=' .machine power5 + .text + frin 1,1';; + esac + + gcc_GAS_CHECK_FEATURE([fp round support], + gcc_cv_as_powerpc_fprnd, [2,17,0],, + [$conftest_s],, + [AC_DEFINE(HAVE_AS_FPRND, 1, + [Define if your assembler supports fprnd.])]) + + case $target in + *-*-aix*) conftest_s=' .csect .text[[PR]] +LCF..0: + addis 11,30,_GLOBAL_OFFSET_TABLE_-LCF..0@ha';; + *-*-darwin*) + conftest_s=' .text +LCF0: + addis r11,r30,_GLOBAL_OFFSET_TABLE_-LCF0@ha';; + *) conftest_s=' .text +.LCF0: + addis 11,30,_GLOBAL_OFFSET_TABLE_-.LCF0@ha';; + esac + + gcc_GAS_CHECK_FEATURE([rel16 relocs], + gcc_cv_as_powerpc_rel16, [2,17,0], -a32, + [$conftest_s],, + [AC_DEFINE(HAVE_AS_REL16, 1, + [Define if your assembler supports R_PPC_REL16 relocs.])]) ;; mips*-*-*) @@ -2483,9 +2945,26 @@ changequote([,])dnl then target_cpu_default=MASK_EXPLICIT_RELOCS else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS" fi]) - ;; esac + +# Mips and HP-UX need the GNU assembler. +# Linux on IA64 might be able to use the Intel assembler. + +case "$target" in + mips*-*-* | *-*-hpux* ) + if test x$gas_flag = xyes \ + || test x"$host" != x"$build" \ + || test ! -x "$gcc_cv_as" \ + || "$gcc_cv_as" -v < /dev/null 2>&1 | grep GNU > /dev/null; then + : + else + echo "*** This configuration requires the GNU assembler" >&2 + exit 1 + fi + ;; +esac + # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any # info to the output file. So, as supported targets are added to gas 2.11, @@ -2495,7 +2974,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \ - | xstormy16*-*-* | cris-*-* | xtensa-*-*) + | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-*) insn="nop" ;; ia64*-*-* | s390*-*-*) @@ -2513,8 +2992,9 @@ if test x"$insn" != x; then gcc_GAS_CHECK_FEATURE([dwarf2 debug_line support], gcc_cv_as_dwarf2_debug_line, [elf,2,11,0],, [$conftest_s], - [# ??? This fails with non-gnu grep. Maybe use objdump? - if grep debug_line conftest.o > /dev/null 2>&1; then + [if test x$gcc_cv_objdump != x \ + && $gcc_cv_objdump -h conftest.o 2> /dev/null \ + | grep debug_line > /dev/null 2>&1; then gcc_cv_as_dwarf2_debug_line=yes fi]) @@ -2606,6 +3086,7 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_eh_frame_hdr=yes fi fi +GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR]) if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1, [Define if your linker supports --eh-frame-hdr option.]) @@ -2631,197 +3112,181 @@ if test x"$gcc_cv_ld_pie" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_pie) -AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option) -gcc_cv_ld_static_dynamic=no +# -------- +# UNSORTED +# -------- + +AC_CACHE_CHECK(linker --as-needed support, +gcc_cv_ld_as_needed, +[gcc_cv_ld_as_needed=no if test $in_tree_ld = yes ; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then - gcc_cv_ld_static_dynamic=yes + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_as_needed=yes fi elif test x$gcc_cv_ld != x; then - # Check if linker supports -Bstatic/-Bdynamic option - if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ - && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then - gcc_cv_ld_static_dynamic=yes + # Check if linker supports --as-needed and --no-as-needed options + if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then + gcc_cv_ld_as_needed=yes fi fi -if test x"$gcc_cv_ld_static_dynamic" = xyes; then - AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1, -[Define if your linker supports -Bstatic/-Bdynamic option.]) +]) +if test x"$gcc_cv_ld_as_needed" = xyes; then + AC_DEFINE(HAVE_LD_AS_NEEDED, 1, +[Define if your linker supports --as-needed and --no-as-needed options.]) fi -AC_MSG_RESULT($gcc_cv_ld_static_dynamic) -case "$target" in - *-*-linux*) - AC_CACHE_CHECK(linker --as-needed support, - gcc_cv_ld_as_needed, - [gcc_cv_ld_as_needed=no +case "$target:$tm_file" in + powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) + AC_CACHE_CHECK(linker support for omitting dot symbols, + gcc_cv_ld_no_dot_syms, + [gcc_cv_ld_no_dot_syms=no if test $in_tree_ld = yes ; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes; then - gcc_cv_ld_as_needed=yes + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2; then + gcc_cv_ld_no_dot_syms=yes fi - elif test x$gcc_cv_ld != x; then - # Check if linker supports --as-needed and --no-as-needed options - if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then - gcc_cv_ld_as_needed=yes + elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x ; then + cat > conftest1.s < conftest2.s < /dev/null 2>&1 \ + && $gcc_cv_as -a64 -o conftest2.o conftest2.s > /dev/null 2>&1 \ + && $gcc_cv_ld -melf64ppc -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then + gcc_cv_ld_no_dot_syms=yes fi + rm -f conftest conftest1.o conftest2.o conftest1.s conftest2.s fi ]) - if test x"$gcc_cv_ld_as_needed" = xyes; then - AC_DEFINE(HAVE_LD_AS_NEEDED, 1, - [Define if your linker supports --as-needed and --no-as-needed options.]) + if test x"$gcc_cv_ld_no_dot_syms" = xyes; then + AC_DEFINE(HAVE_LD_NO_DOT_SYMS, 1, + [Define if your PowerPC64 linker only needs function descriptor syms.]) fi ;; esac +AC_CACHE_CHECK(linker --sysroot support, + gcc_cv_ld_sysroot, + [gcc_cv_ld_sysroot=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then + gcc_cv_ld_sysroot=yes + fi + elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then + gcc_cv_ld_sysroot=yes + fi + fi]) +if test x"$gcc_cv_ld_sysroot" = xyes; then + AC_DEFINE(HAVE_LD_SYSROOT, 1, + [Define if your linker supports --sysroot.]) +fi + if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include", [Define to PREFIX/include if cpp should also search that directory.]) fi -# Figure out what language subdirectories are present. -# Look if the user specified --enable-languages="..."; if not, use -# the environment variable $LANGUAGES if defined. $LANGUAGES might -# go away some day. -# NB: embedded tabs in this IF block -- do not untabify -if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - AC_MSG_WARN([setting LANGUAGES is deprecated, use --enable-languages instead]) - +# Test for stack protector support in target C library. +case "$target" in + *-*-linux*) + AC_CACHE_CHECK(__stack_chk_fail in target GNU C library, + gcc_cv_libc_provides_ssp, + [gcc_cv_libc_provides_ssp=no + if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then + if test "x$with_sysroot" = x; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + elif test "x$with_sysroot" = xyes; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" else - enable_languages=all + glibc_header_dir="${with_sysroot}/usr/include" fi -else - if test x"${enable_languages}" = x \ - || test x"${enable_languages}" = xyes; - then - AC_MSG_ERROR([--enable-languages needs at least one language argument]) + else + glibc_header_dir=/usr/include + fi + # glibc 2.4 and later provides __stack_chk_fail and + # either __stack_chk_guard, or TLS access to stack guard canary. + if test -f $glibc_header_dir/features.h \ + && $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__GNU_LIBRARY__[ ]+([1-9][0-9]|[6-9])' \ + $glibc_header_dir/features.h > /dev/null; then + if $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__GLIBC__[ ]+([1-9][0-9]|[3-9])' \ + $glibc_header_dir/features.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes + elif $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__GLIBC__[ ]+2' \ + $glibc_header_dir/features.h > /dev/null \ + && $EGREP '^@<:@ @:>@*#[ ]*define[ ]+__GLIBC_MINOR__[ ]+([1-9][0-9]|[4-9])' \ + $glibc_header_dir/features.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi + fi]) ;; + *) gcc_cv_libc_provides_ssp=no ;; +esac +if test x$gcc_cv_libc_provides_ssp = xyes; then + AC_DEFINE(TARGET_LIBC_PROVIDES_SSP, 1, + [Define if your target C library provides stack protector support]) fi -enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` -# First scan to see if an enabled language requires some other language. -# We assume that a given config-lang.in will list all the language -# front ends it requires, even if some are required indirectly. -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. +# Check if TFmode long double should be used by default or not. +# Some glibc targets used DFmode long double, but with glibc 2.4 +# and later they can use TFmode. +case "$target" in + powerpc*-*-*gnu* | \ + sparc*-*-linux* | \ + s390*-*-linux* | \ + alpha*-*-linux*) + AC_ARG_WITH(long-double-128, +[ --with-long-double-128 Use 128-bit long double by default.], + gcc_cv_target_ldbl128="$with_long_double_128", + [gcc_cv_target_ldbl128=no + if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then + if test "x$with_sysroot" = x; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + elif test "x$with_sysroot" = xyes; then + glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" + else + glibc_header_dir="${with_sysroot}/usr/include" + fi + else + glibc_header_dir=/usr/include + fi changequote(,)dnl - ${srcdir}/[*]/config-lang.in) - ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; + grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ + $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \ + && gcc_cv_target_ldbl128=yes changequote([,])dnl - esac -done - -expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'` -found_languages= -subdirs= -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. -changequote(,)dnl - ${srcdir}/[*]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - found_languages="${found_languages} ${lang_alias}" - if test x"${add_this_lang}" = xyes; then - case $lang in - ${srcdir}/ada/config-lang.in) - if test x$have_gnat = xyes ; then - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - fi - ;; - *) - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - ;; - esac - fi - ;; -changequote([,])dnl - esac -done - -missing_languages= -for expected_language in ${expected_languages} .. -do - if test "${expected_language}" != ..; then - missing_language="${expected_language}" - if test "${expected_language}" = "c" \ - || test "${expected_language}" = "all"; then - missing_language= - fi - for found_language in ${found_languages} .. - do - if test "${found_language}" != ..; then - if test "${expected_language}" = "${found_language}"; then - missing_language= - fi - fi - done - if test "x${missing_language}" != x; then - missing_languages="${missing_languages} ${missing_language}" - fi - fi -done - -if test "x$missing_languages" != x; then - AC_MSG_ERROR([ -The following requested languages were not found:${missing_languages} -The following languages were available: c${found_languages}]) + ]) + ;; +esac +if test x$gcc_cv_target_ldbl128 = xyes; then + AC_DEFINE(TARGET_DEFAULT_LONG_DOUBLE_128, 1, + [Define if TFmode long double should be the default]) fi -# Make gthr-default.h if we have a thread file. -gthread_flags= -if test $thread_file != single; then - rm -f gthr-default.h - echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h - gthread_flags=-DHAVE_GTHR_DEFAULT -fi -AC_SUBST(gthread_flags) - # Find out what GC implementation we want, or may, use. AC_ARG_WITH(gc, -[ --with-gc={simple,page,zone} choose the garbage collection mechanism to use +[ --with-gc={page,zone} choose the garbage collection mechanism to use with the compiler], [case "$withval" in - simple | page | zone) + page) GGC=ggc-$withval ;; + zone) + GGC=ggc-$withval + AC_DEFINE(GGC_ZONE, 1, [Define if the zone collector is in use]) + ;; *) AC_MSG_ERROR([$withval is an invalid option to --with-gc]) ;; @@ -2861,32 +3326,24 @@ else fi AC_SUBST(MAINT)dnl +# -------------- +# Language hooks +# -------------- + # Make empty files to contain the specs and options for each language. # Then add #include lines to for a compiler that has specs and/or options. +subdirs= lang_opt_files= lang_specs_files= lang_tree_files= -for subdir in . $subdirs -do - if test -f $srcdir/$subdir/lang.opt; then - lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" - fi - if test -f $srcdir/$subdir/lang-specs.h; then - lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" - fi - if test -f $srcdir/$subdir/$subdir-tree.def; then - lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" - fi -done - # These (without "all_") are set in each config-lang.in. # `language' must be a single word so is spelled singularly. all_languages= all_boot_languages= all_compilers= all_stagestuff= -all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders' +all_outputs='Makefile gccbug mklibgcc libada-mk' # List of language makefile fragments. all_lang_makefrags= # List of language subdirectory makefiles. Deprecated. @@ -2897,6 +3354,10 @@ all_gtfiles="$target_gtfiles" all_gtfiles_files_langs= all_gtfiles_files_files= +# These are the languages that are set in --enable-languages, +# and are available in the GCC tree. +all_selected_languages= + # Add the language fragments. # Languages are added via two mechanisms. Some information must be # recorded in makefile variables, these are defined in config-lang.in. @@ -2906,77 +3367,124 @@ all_gtfiles_files_files= language_hooks="Make-hooks" -for s in $subdirs +for lang in ${srcdir}/*/config-lang.in do - language= - boot_language= - compilers= - stagestuff= - outputs= - gtfiles= - . ${srcdir}/$s/config-lang.in - if test "x$language" = x - then - echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2 - exit 1 - fi - all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$s/Make-lang.in" - if test -f ${srcdir}/$s/Makefile.in - then all_lang_makefiles="$s/Makefile" - fi - all_languages="$all_languages $language" - if test "x$boot_language" = xyes - then - all_boot_languages="$all_boot_languages $language" - fi - all_compilers="$all_compilers $compilers" - all_stagestuff="$all_stagestuff $stagestuff" - all_outputs="$all_outputs $outputs" - all_gtfiles="$all_gtfiles $gtfiles" - for f in $gtfiles - do - all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " - all_gtfiles_files_files="$all_gtfiles_files_files ${f} " - done +changequote(,)dnl + test "$lang" = "${srcdir}/*/config-lang.in" && continue + + lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` + if test "x$lang_alias" = x + then + echo "$lang doesn't set \$language." 1>&2 + exit 1 + fi + subdir="`echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" + subdirs="$subdirs $subdir" + case ",$enable_languages," in + *,$lang_alias,*) + all_selected_languages="$all_selected_languages $lang_alias" + if test -f $srcdir/$subdir/lang-specs.h; then + lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h" + fi + ;; + esac +changequote([,])dnl + + language= + boot_language= + compilers= + stagestuff= + outputs= + gtfiles= + subdir_requires= + . ${srcdir}/$subdir/config-lang.in + if test "x$language" = x + then + echo "${srcdir}/$subdir/config-lang.in doesn't set \$language." 1>&2 + exit 1 + fi + + ok=: + case ",$enable_languages," in + *,$lang_alias,*) ;; + *) + for i in $subdir_requires; do + test -f "${srcdir}/$i/config-lang.in" && continue + ok=false + break + done + ;; + esac + $ok || continue + + all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$subdir/Make-lang.in" + if test -f $srcdir/$subdir/lang.opt; then + lang_opt_files="$lang_opt_files $srcdir/$subdir/lang.opt" + fi + if test -f $srcdir/$subdir/$subdir-tree.def; then + lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def" + fi + if test -f ${srcdir}/$subdir/Makefile.in + then all_lang_makefiles="$subdir/Makefile" + fi + all_languages="$all_languages $language" + if test "x$boot_language" = xyes + then + all_boot_languages="$all_boot_languages $language" + fi + all_compilers="$all_compilers $compilers" + all_stagestuff="$all_stagestuff $stagestuff" + all_outputs="$all_outputs $outputs" + all_gtfiles="$all_gtfiles $gtfiles" + for f in $gtfiles + do + all_gtfiles_files_langs="$all_gtfiles_files_langs ${subdir} " + all_gtfiles_files_files="$all_gtfiles_files_files ${f} " + done done # Pick up gtfiles for c gtfiles= -s="c" +subdir="c" . ${srcdir}/c-config-lang.in all_gtfiles="$all_gtfiles $gtfiles" for f in $gtfiles do - all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} " + all_gtfiles_files_langs="$all_gtfiles_files_langs ${subdir} " all_gtfiles_files_files="$all_gtfiles_files_files ${f} " done check_languages= -for language in $all_languages +for language in $all_selected_languages do - check_languages="$check_languages check-$language" + check_languages="$check_languages check-$language" done # We link each language in with a set of hooks, reached indirectly via -# lang.${target}. +# lang.${target}. Only do so for selected languages. rm -f Make-hooks touch Make-hooks -target_list="all.build all.cross start.encap rest.encap tags \ - install-normal install-common install-man \ +target_list="all.cross start.encap rest.encap tags \ + install-common install-man install-info dvi pdf html \ uninstall info man srcextra srcman srcinfo \ mostlyclean clean distclean maintainer-clean \ stage1 stage2 stage3 stage4 stageprofile stagefeedback" + for t in $target_list do x= - for lang in $all_languages + for lang in $all_selected_languages do - x="$x $lang.$t" + x="$x $lang.$t" done echo "lang.$t: $x" >> Make-hooks done +# -------- +# UNSORTED +# -------- + # Create .gdbinit. echo "dir ." > .gdbinit @@ -3040,7 +3548,7 @@ AC_ARG_ENABLE(version-specific-runtime-libs, installed in a compiler-specific directory]) AC_ARG_WITH(slibdir, -[ --with-slibdir=DIR shared libraries in DIR [LIBDIR]], +[ --with-slibdir=DIR shared libraries in DIR [[LIBDIR]]], slibdir="$with_slibdir", if test "${enable_version_specific_runtime_libs+set}" = set; then slibdir='$(libsubdir)' @@ -3054,6 +3562,24 @@ AC_SUBST(slibdir) objdir=`${PWDCMD-pwd}` AC_SUBST(objdir) +AC_ARG_WITH(datarootdir, +[ --with-datarootdir=DIR Use DIR as the data root [[PREFIX/share]]], +datarootdir="\${prefix}/$with_datarootdir", +datarootdir='$(prefix)/share') +AC_SUBST(datarootdir) + +AC_ARG_WITH(docdir, +[ --with-docdir=DIR Install documentation in DIR [[DATAROOTDIR]]], +docdir="\${prefix}/$with_docdir", +docdir='$(datarootdir)') +AC_SUBST(docdir) + +AC_ARG_WITH(htmldir, +[ --with-htmldir=DIR html documentation in in DIR [[DOCDIR]]], +htmldir="\${prefix}/$with_htmldir", +htmldir='$(docdir)') +AC_SUBST(htmldir) + # Substitute configuration variables AC_SUBST(subdirs) AC_SUBST(srcdir) @@ -3065,6 +3591,7 @@ AC_SUBST(all_gtfiles_files_files) AC_SUBST(all_lang_makefrags) AC_SUBST(all_lang_makefiles) AC_SUBST(all_languages) +AC_SUBST(all_selected_languages) AC_SUBST(all_stagestuff) AC_SUBST(build_exeext) AC_SUBST(build_install_headers_dir) @@ -3086,10 +3613,6 @@ AC_SUBST(extra_programs) AC_SUBST(float_h_file) AC_SUBST(gcc_config_arguments) AC_SUBST(gcc_gxx_include_dir) -AC_SUBST(libstdcxx_incdir) -AC_SUBST(gcc_version) -AC_SUBST(gcc_version_full) -AC_SUBST(gcc_version_trigger) AC_SUBST(host_exeext) AC_SUBST(host_xm_file_list) AC_SUBST(host_xm_include_list) @@ -3106,7 +3629,6 @@ AC_SUBST(out_file) AC_SUBST(out_object_file) AC_SUBST(stage_prefix_set_by_configure) AC_SUBST(quoted_stage_prefix_set_by_configure) -AC_SUBST(symbolic_link) AC_SUBST(thread_file) AC_SUBST(tm_file_list) AC_SUBST(tm_include_list) @@ -3116,24 +3638,12 @@ AC_SUBST(tm_p_include_list) AC_SUBST(xm_file_list) AC_SUBST(xm_include_list) AC_SUBST(xm_defines) -AC_SUBST(target_noncanonical) AC_SUBST(c_target_objs) AC_SUBST(cxx_target_objs) AC_SUBST(target_cpu_default) AC_SUBST_FILE(language_hooks) -sinclude(../config/gcc-lib-path.m4) -TL_AC_GNU_MAKE_GCC_LIB_PATH - -# If it doesn't already exist, create document directory -echo "checking for the document directory." 1>&2 -if test -d doc ; then - true -else - mkdir doc -fi - # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then @@ -3152,6 +3662,9 @@ else fi fi +AC_ARG_VAR(GMPLIBS,[How to link GMP]) +AC_ARG_VAR(GMPINC,[How to find GMP include files]) + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs) @@ -3166,7 +3679,7 @@ case ${CONFIG_HEADERS} in echo > cstamp-h ;; esac # Make sure all the subdirs exist. -for d in $subdirs +for d in $subdirs doc build do test -d $d || mkdir $d done @@ -3176,20 +3689,20 @@ done # FLAGS_TO_PASS has been modified to solve the problem there. # This is virtually a duplicate of what happens in configure.lang; we do # an extra check to make sure this only happens if ln -s can be used. -if test "$symbolic_link" = "ln -s"; then - for d in ${subdirs} fixinc ; do +case "$LN_S" in + *-s*) + for d in ${subdirs} ; do STARTDIR=`${PWDCMD-pwd}` cd $d for t in stage1 stage2 stage3 stage4 stageprofile stagefeedback include do rm -f $t - $symbolic_link ../$t $t 2>/dev/null + $LN_S ../$t $t 2>/dev/null done cd $STARTDIR - done -else true ; fi + done + ;; +esac ], -[subdirs='$subdirs' -symbolic_link='$symbolic_link' -]) +[subdirs='$subdirs']) AC_OUTPUT diff --git a/contrib/gcc/conflict.c b/contrib/gcc/conflict.c index a23bad35c19..43f7860820e 100644 --- a/contrib/gcc/conflict.c +++ b/contrib/gcc/conflict.c @@ -1,5 +1,5 @@ /* Register conflict graph computation routines. - Copyright (C) 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ /* References: @@ -117,7 +117,6 @@ struct conflict_graph_def static hashval_t arc_hash (const void *); static int arc_eq (const void *, const void *); static int print_conflict (int, int, void *); -static void mark_reg (rtx, rtx, void *); /* Callback function to compute the hash value of an arc. Uses current_graph to locate the graph to which the arc belongs. */ @@ -148,7 +147,7 @@ arc_eq (const void *arcp1, const void *arcp2) conflict_graph conflict_graph_new (int num_regs) { - conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def)); + conflict_graph graph = XNEW (struct conflict_graph_def); graph->num_regs = num_regs; /* Set up the hash table. No delete action is specified; memory @@ -160,7 +159,7 @@ conflict_graph_new (int num_regs) obstack_init (&graph->arc_obstack); /* Create and zero the lookup table by register number. */ - graph->neighbor_heads = xcalloc (num_regs, sizeof (conflict_graph_arc)); + graph->neighbor_heads = XCNEWVEC (conflict_graph_arc, num_regs); return graph; } @@ -190,8 +189,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2) void **slot; /* A reg cannot conflict with itself. */ - if (reg1 == reg2) - abort (); + gcc_assert (reg1 != reg2); dummy.smaller = smaller; dummy.larger = larger; @@ -210,7 +208,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2) arc->smaller = smaller; arc->larger = larger; - /* Link the conflict into into two lists, one for each reg. */ + /* Link the conflict into two lists, one for each reg. */ arc->smaller_next = graph->neighbor_heads[smaller]; graph->neighbor_heads[smaller] = arc; arc->larger_next = graph->neighbor_heads[larger]; @@ -324,10 +322,11 @@ print_conflict (int reg1, int reg2, void *contextp) is the interesting one. */ if (reg1 == context->reg) reg = reg2; - else if (reg2 == context->reg) - reg = reg1; else - abort (); + { + gcc_assert (reg2 == context->reg); + reg = reg1; + } /* Print the conflict. */ fprintf (context->fp, " %d", reg); @@ -364,134 +363,3 @@ conflict_graph_print (conflict_graph graph, FILE *fp) fputc ('\n', fp); } } - -/* Callback function for note_stores. */ - -static void -mark_reg (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data) -{ - regset set = (regset) data; - - if (GET_CODE (reg) == SUBREG) - reg = SUBREG_REG (reg); - - /* We're only interested in regs. */ - if (GET_CODE (reg) != REG) - return; - - SET_REGNO_REG_SET (set, REGNO (reg)); -} - -/* Allocates a conflict graph and computes conflicts over the current - function for the registers set in REGS. The caller is responsible - for deallocating the return value. - - Preconditions: the flow graph must be in SSA form, and life - analysis (specifically, regs live at exit from each block) must be - up-to-date. - - This algorithm determines conflicts by walking the insns in each - block backwards. We maintain the set of live regs at each insn, - starting with the regs live on exit from the block. For each insn: - - 1. If a reg is set in this insns, it must be born here, since - we're in SSA. Therefore, it was not live before this insns, - so remove it from the set of live regs. - - 2. For each reg born in this insn, record a conflict between it - and every other reg live coming into this insn. For each - existing conflict, one of the two regs must be born while the - other is alive. See Morgan or elsewhere for a proof of this. - - 3. Regs clobbered by this insn must have been live coming into - it, so record them as such. - - The resulting conflict graph is not built for regs in REGS - themselves; rather, partition P is used to obtain the canonical reg - for each of these. The nodes of the conflict graph are these - canonical regs instead. */ - -conflict_graph -conflict_graph_compute (regset regs, partition p) -{ - conflict_graph graph = conflict_graph_new (max_reg_num ()); - regset_head live_head; - regset live = &live_head; - regset_head born_head; - regset born = &born_head; - basic_block bb; - - INIT_REG_SET (live); - INIT_REG_SET (born); - - FOR_EACH_BB_REVERSE (bb) - { - rtx insn; - rtx head; - - /* Start with the regs that are live on exit, limited to those - we're interested in. */ - COPY_REG_SET (live, bb->global_live_at_end); - AND_REG_SET (live, regs); - - /* Walk the instruction stream backwards. */ - head = BB_HEAD (bb); - insn = BB_END (bb); - for (insn = BB_END (bb); insn != head; insn = PREV_INSN (insn)) - { - int born_reg; - int live_reg; - rtx link; - - /* Are we interested in this insn? */ - if (INSN_P (insn)) - { - /* Determine which regs are set in this insn. Since - we're in SSA form, if a reg is set here it isn't set - anywhere else, so this insn is where the reg is born. */ - CLEAR_REG_SET (born); - note_stores (PATTERN (insn), mark_reg, born); - AND_REG_SET (born, regs); - - /* Regs born here were not live before this insn. */ - AND_COMPL_REG_SET (live, born); - - /* For every reg born here, add a conflict with every other - reg live coming into this insn. */ - EXECUTE_IF_SET_IN_REG_SET - (born, FIRST_PSEUDO_REGISTER, born_reg, - { - EXECUTE_IF_SET_IN_REG_SET - (live, FIRST_PSEUDO_REGISTER, live_reg, - { - /* Build the conflict graph in terms of canonical - regnos. */ - int b = partition_find (p, born_reg); - int l = partition_find (p, live_reg); - - if (b != l) - conflict_graph_add (graph, b, l); - }); - }); - - /* Morgan's algorithm checks the operands of the insn - and adds them to the set of live regs. Instead, we - use death information added by life analysis. Regs - dead after this instruction were live before it. */ - for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_DEAD) - { - unsigned int regno = REGNO (XEXP (link, 0)); - - if (REGNO_REG_SET_P (regs, regno)) - SET_REGNO_REG_SET (live, regno); - } - } - } - } - - FREE_REG_SET (live); - FREE_REG_SET (born); - - return graph; -} diff --git a/contrib/gcc/convert.c b/contrib/gcc/convert.c index 9096541fe2a..96bdf5d21bb 100644 --- a/contrib/gcc/convert.c +++ b/contrib/gcc/convert.c @@ -1,6 +1,6 @@ /* Utility routines for data type conversion for GCC. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998, - 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ /* These routines are somewhat language-independent utility function @@ -33,38 +33,41 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "langhooks.h" #include "real.h" -/* Convert EXPR to some pointer or reference type TYPE. +/* Convert EXPR to some pointer or reference type TYPE. EXPR must be pointer, reference, integer, enumeral, or literal zero; in other cases error is called. */ tree convert_to_pointer (tree type, tree expr) { + if (TREE_TYPE (expr) == type) + return expr; + if (integer_zerop (expr)) { - expr = build_int_2 (0, 0); - TREE_TYPE (expr) = type; - return expr; + tree t = build_int_cst (type, 0); + if (TREE_OVERFLOW (expr) || TREE_CONSTANT_OVERFLOW (expr)) + t = force_fit_type (t, 0, TREE_OVERFLOW (expr), + TREE_CONSTANT_OVERFLOW (expr)); + return t; } switch (TREE_CODE (TREE_TYPE (expr))) { case POINTER_TYPE: case REFERENCE_TYPE: - return build1 (NOP_EXPR, type, expr); + return fold_build1 (NOP_EXPR, type, expr); case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: - if (TYPE_PRECISION (TREE_TYPE (expr)) == POINTER_SIZE) - return build1 (CONVERT_EXPR, type, expr); + if (TYPE_PRECISION (TREE_TYPE (expr)) != POINTER_SIZE) + expr = fold_build1 (NOP_EXPR, + lang_hooks.types.type_for_size (POINTER_SIZE, 0), + expr); + return fold_build1 (CONVERT_EXPR, type, expr); - return - convert_to_pointer (type, - convert ((*lang_hooks.types.type_for_size) - (POINTER_SIZE, 0), expr)); default: error ("cannot convert to a pointer type"); @@ -99,7 +102,8 @@ strip_float_extensions (tree exp) return build_real (type, real_value_truncate (TYPE_MODE (type), orig)); } - if (TREE_CODE (exp) != NOP_EXPR) + if (TREE_CODE (exp) != NOP_EXPR + && TREE_CODE (exp) != CONVERT_EXPR) return exp; sub = TREE_OPERAND (exp, 0); @@ -131,57 +135,92 @@ convert_to_real (tree type, tree expr) present in runtime. */ /* Convert (float)sqrt((double)x) where x is float into sqrtf(x) */ if (optimize - && (fcode == BUILT_IN_SQRT - || fcode == BUILT_IN_SQRTL - || fcode == BUILT_IN_SIN - || fcode == BUILT_IN_SINL - || fcode == BUILT_IN_COS - || fcode == BUILT_IN_COSL - || fcode == BUILT_IN_EXP - || fcode == BUILT_IN_EXPL - || fcode == BUILT_IN_LOG - || fcode == BUILT_IN_LOGL) && (TYPE_MODE (type) == TYPE_MODE (double_type_node) || TYPE_MODE (type) == TYPE_MODE (float_type_node))) { - tree arg0 = strip_float_extensions (TREE_VALUE (TREE_OPERAND (expr, 1))); - tree newtype = type; - - /* We have (outertype)sqrt((innertype)x). Choose the wider mode from - the both as the safe type for operation. */ - if (TYPE_PRECISION (TREE_TYPE (arg0)) > TYPE_PRECISION (type)) - newtype = TREE_TYPE (arg0); - - /* Be careful about integer to fp conversions. - These may overflow still. */ - if (FLOAT_TYPE_P (TREE_TYPE (arg0)) - && TYPE_PRECISION (newtype) < TYPE_PRECISION (itype) - && (TYPE_MODE (newtype) == TYPE_MODE (double_type_node) - || TYPE_MODE (newtype) == TYPE_MODE (float_type_node))) - { - tree arglist; - tree fn = mathfn_built_in (newtype, fcode); - - if (fn) + switch (fcode) + { +#define CASE_MATHFN(FN) case BUILT_IN_##FN: case BUILT_IN_##FN##L: + CASE_MATHFN (ACOS) + CASE_MATHFN (ACOSH) + CASE_MATHFN (ASIN) + CASE_MATHFN (ASINH) + CASE_MATHFN (ATAN) + CASE_MATHFN (ATANH) + CASE_MATHFN (CBRT) + CASE_MATHFN (COS) + CASE_MATHFN (COSH) + CASE_MATHFN (ERF) + CASE_MATHFN (ERFC) + CASE_MATHFN (EXP) + CASE_MATHFN (EXP10) + CASE_MATHFN (EXP2) + CASE_MATHFN (EXPM1) + CASE_MATHFN (FABS) + CASE_MATHFN (GAMMA) + CASE_MATHFN (J0) + CASE_MATHFN (J1) + CASE_MATHFN (LGAMMA) + CASE_MATHFN (LOG) + CASE_MATHFN (LOG10) + CASE_MATHFN (LOG1P) + CASE_MATHFN (LOG2) + CASE_MATHFN (LOGB) + CASE_MATHFN (POW10) + CASE_MATHFN (SIN) + CASE_MATHFN (SINH) + CASE_MATHFN (SQRT) + CASE_MATHFN (TAN) + CASE_MATHFN (TANH) + CASE_MATHFN (TGAMMA) + CASE_MATHFN (Y0) + CASE_MATHFN (Y1) +#undef CASE_MATHFN { - arglist = build_tree_list (NULL_TREE, fold (convert_to_real (newtype, arg0))); - expr = build_function_call_expr (fn, arglist); - if (newtype == type) - return expr; + tree arg0 = strip_float_extensions (TREE_VALUE (TREE_OPERAND (expr, 1))); + tree newtype = type; + + /* We have (outertype)sqrt((innertype)x). Choose the wider mode from + the both as the safe type for operation. */ + if (TYPE_PRECISION (TREE_TYPE (arg0)) > TYPE_PRECISION (type)) + newtype = TREE_TYPE (arg0); + + /* Be careful about integer to fp conversions. + These may overflow still. */ + if (FLOAT_TYPE_P (TREE_TYPE (arg0)) + && TYPE_PRECISION (newtype) < TYPE_PRECISION (itype) + && (TYPE_MODE (newtype) == TYPE_MODE (double_type_node) + || TYPE_MODE (newtype) == TYPE_MODE (float_type_node))) + { + tree arglist; + tree fn = mathfn_built_in (newtype, fcode); + + if (fn) + { + arglist = build_tree_list (NULL_TREE, fold (convert_to_real (newtype, arg0))); + expr = build_function_call_expr (fn, arglist); + if (newtype == type) + return expr; + } + } } + default: + break; } } if (optimize && (((fcode == BUILT_IN_FLOORL || fcode == BUILT_IN_CEILL - || fcode == BUILT_IN_ROUND - || fcode == BUILT_IN_TRUNC - || fcode == BUILT_IN_NEARBYINT) + || fcode == BUILT_IN_ROUNDL + || fcode == BUILT_IN_RINTL + || fcode == BUILT_IN_TRUNCL + || fcode == BUILT_IN_NEARBYINTL) && (TYPE_MODE (type) == TYPE_MODE (double_type_node) || TYPE_MODE (type) == TYPE_MODE (float_type_node))) || ((fcode == BUILT_IN_FLOOR || fcode == BUILT_IN_CEIL || fcode == BUILT_IN_ROUND + || fcode == BUILT_IN_RINT || fcode == BUILT_IN_TRUNC || fcode == BUILT_IN_NEARBYINT) && (TYPE_MODE (type) == TYPE_MODE (float_type_node))))) @@ -190,12 +229,18 @@ convert_to_real (tree type, tree expr) if (fn) { - tree arg0 = strip_float_extensions (TREE_VALUE (TREE_OPERAND (expr, - 1))); - tree arglist = build_tree_list (NULL_TREE, - fold (convert_to_real (type, arg0))); + tree arg + = strip_float_extensions (TREE_VALUE (TREE_OPERAND (expr, 1))); - return build_function_call_expr (fn, arglist); + /* Make sure (type)arg0 is an extension, otherwise we could end up + changing (float)floor(double d) into floorf((float)d), which is + incorrect because (float)d uses round-to-nearest and can round + up to the next integer. */ + if (TYPE_PRECISION (type) >= TYPE_PRECISION (TREE_TYPE (arg))) + return + build_function_call_expr (fn, + build_tree_list (NULL_TREE, + fold (convert_to_real (type, arg)))); } } @@ -203,10 +248,12 @@ convert_to_real (tree type, tree expr) if (itype != type && FLOAT_TYPE_P (type)) switch (TREE_CODE (expr)) { - /* Convert (float)-x into -(float)x. This is always safe. */ + /* Convert (float)-x into -(float)x. This is safe for + round-to-nearest rounding mode. */ case ABS_EXPR: case NEGATE_EXPR: - if (TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr))) + if (!flag_rounding_math + && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr))) return build1 (TREE_CODE (expr), type, fold (convert_to_real (type, TREE_OPERAND (expr, 0)))); @@ -226,15 +273,37 @@ convert_to_real (tree type, tree expr) && FLOAT_TYPE_P (TREE_TYPE (arg1))) { tree newtype = type; + + if (TYPE_MODE (TREE_TYPE (arg0)) == SDmode + || TYPE_MODE (TREE_TYPE (arg1)) == SDmode) + newtype = dfloat32_type_node; + if (TYPE_MODE (TREE_TYPE (arg0)) == DDmode + || TYPE_MODE (TREE_TYPE (arg1)) == DDmode) + newtype = dfloat64_type_node; + if (TYPE_MODE (TREE_TYPE (arg0)) == TDmode + || TYPE_MODE (TREE_TYPE (arg1)) == TDmode) + newtype = dfloat128_type_node; + if (newtype == dfloat32_type_node + || newtype == dfloat64_type_node + || newtype == dfloat128_type_node) + { + expr = build2 (TREE_CODE (expr), newtype, + fold (convert_to_real (newtype, arg0)), + fold (convert_to_real (newtype, arg1))); + if (newtype == type) + return expr; + break; + } + if (TYPE_PRECISION (TREE_TYPE (arg0)) > TYPE_PRECISION (newtype)) newtype = TREE_TYPE (arg0); if (TYPE_PRECISION (TREE_TYPE (arg1)) > TYPE_PRECISION (newtype)) newtype = TREE_TYPE (arg1); if (TYPE_PRECISION (newtype) < TYPE_PRECISION (itype)) { - expr = build (TREE_CODE (expr), newtype, - fold (convert_to_real (newtype, arg0)), - fold (convert_to_real (newtype, arg1))); + expr = build2 (TREE_CODE (expr), newtype, + fold (convert_to_real (newtype, arg0)), + fold (convert_to_real (newtype, arg1))); if (newtype == type) return expr; } @@ -248,19 +317,22 @@ convert_to_real (tree type, tree expr) switch (TREE_CODE (TREE_TYPE (expr))) { case REAL_TYPE: - return build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR, - type, expr); + /* Ignore the conversion if we don't need to store intermediate + results and neither type is a decimal float. */ + return build1 ((flag_float_store + || DECIMAL_FLOAT_TYPE_P (type) + || DECIMAL_FLOAT_TYPE_P (itype)) + ? CONVERT_EXPR : NOP_EXPR, type, expr); case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: return build1 (FLOAT_EXPR, type, expr); case COMPLEX_TYPE: return convert (type, - fold (build1 (REALPART_EXPR, - TREE_TYPE (TREE_TYPE (expr)), expr))); + fold_build1 (REALPART_EXPR, + TREE_TYPE (TREE_TYPE (expr)), expr)); case POINTER_TYPE: case REFERENCE_TYPE: @@ -297,53 +369,119 @@ convert_to_integer (tree type, tree expr) return error_mark_node; } + /* Convert e.g. (long)round(d) -> lround(d). */ + /* If we're converting to char, we may encounter differing behavior + between converting from double->char vs double->long->char. + We're in "undefined" territory but we prefer to be conservative, + so only proceed in "unsafe" math mode. */ + if (optimize + && (flag_unsafe_math_optimizations + || (long_integer_type_node + && outprec >= TYPE_PRECISION (long_integer_type_node)))) + { + tree s_expr = strip_float_extensions (expr); + tree s_intype = TREE_TYPE (s_expr); + const enum built_in_function fcode = builtin_mathfn_code (s_expr); + tree fn = 0; + + switch (fcode) + { + CASE_FLT_FN (BUILT_IN_CEIL): + /* Only convert in ISO C99 mode. */ + if (!TARGET_C99_FUNCTIONS) + break; + if (outprec < TYPE_PRECISION (long_integer_type_node) + || (outprec == TYPE_PRECISION (long_integer_type_node) + && !TYPE_UNSIGNED (type))) + fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL); + else if (outprec == TYPE_PRECISION (long_long_integer_type_node) + && !TYPE_UNSIGNED (type)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL); + break; + + CASE_FLT_FN (BUILT_IN_FLOOR): + /* Only convert in ISO C99 mode. */ + if (!TARGET_C99_FUNCTIONS) + break; + if (outprec < TYPE_PRECISION (long_integer_type_node) + || (outprec == TYPE_PRECISION (long_integer_type_node) + && !TYPE_UNSIGNED (type))) + fn = mathfn_built_in (s_intype, BUILT_IN_LFLOOR); + else if (outprec == TYPE_PRECISION (long_long_integer_type_node) + && !TYPE_UNSIGNED (type)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLFLOOR); + break; + + CASE_FLT_FN (BUILT_IN_ROUND): + if (outprec < TYPE_PRECISION (long_integer_type_node) + || (outprec == TYPE_PRECISION (long_integer_type_node) + && !TYPE_UNSIGNED (type))) + fn = mathfn_built_in (s_intype, BUILT_IN_LROUND); + else if (outprec == TYPE_PRECISION (long_long_integer_type_node) + && !TYPE_UNSIGNED (type)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLROUND); + break; + + CASE_FLT_FN (BUILT_IN_NEARBYINT): + /* Only convert nearbyint* if we can ignore math exceptions. */ + if (flag_trapping_math) + break; + /* ... Fall through ... */ + CASE_FLT_FN (BUILT_IN_RINT): + if (outprec < TYPE_PRECISION (long_integer_type_node) + || (outprec == TYPE_PRECISION (long_integer_type_node) + && !TYPE_UNSIGNED (type))) + fn = mathfn_built_in (s_intype, BUILT_IN_LRINT); + else if (outprec == TYPE_PRECISION (long_long_integer_type_node) + && !TYPE_UNSIGNED (type)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLRINT); + break; + + CASE_FLT_FN (BUILT_IN_TRUNC): + { + tree arglist = TREE_OPERAND (s_expr, 1); + return convert_to_integer (type, TREE_VALUE (arglist)); + } + + default: + break; + } + + if (fn) + { + tree arglist = TREE_OPERAND (s_expr, 1); + tree newexpr = build_function_call_expr (fn, arglist); + return convert_to_integer (type, newexpr); + } + } + switch (TREE_CODE (intype)) { case POINTER_TYPE: case REFERENCE_TYPE: if (integer_zerop (expr)) - expr = integer_zero_node; - else - expr = fold (build1 (CONVERT_EXPR, (*lang_hooks.types.type_for_size) - (POINTER_SIZE, 0), expr)); + return build_int_cst (type, 0); - return convert_to_integer (type, expr); + /* Convert to an unsigned integer of the correct width first, + and from there widen/truncate to the required type. */ + expr = fold_build1 (CONVERT_EXPR, + lang_hooks.types.type_for_size (POINTER_SIZE, 0), + expr); + return fold_convert (type, expr); case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: /* If this is a logical operation, which just returns 0 or 1, we can - change the type of the expression. For some logical operations, - we must also change the types of the operands to maintain type - correctness. */ + change the type of the expression. */ - if (TREE_CODE_CLASS (ex_form) == '<') + if (TREE_CODE_CLASS (ex_form) == tcc_comparison) { expr = copy_node (expr); TREE_TYPE (expr) = type; return expr; } - else if (ex_form == TRUTH_AND_EXPR || ex_form == TRUTH_ANDIF_EXPR - || ex_form == TRUTH_OR_EXPR || ex_form == TRUTH_ORIF_EXPR - || ex_form == TRUTH_XOR_EXPR) - { - expr = copy_node (expr); - TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0)); - TREE_OPERAND (expr, 1) = convert (type, TREE_OPERAND (expr, 1)); - TREE_TYPE (expr) = type; - return expr; - } - - else if (ex_form == TRUTH_NOT_EXPR) - { - expr = copy_node (expr); - TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0)); - TREE_TYPE (expr) = type; - return expr; - } - /* If we are widening the type, put in an explicit conversion. Similarly if we are not changing the width. After this, we know we are truncating EXPR. */ @@ -351,6 +489,7 @@ convert_to_integer (tree type, tree expr) else if (outprec >= inprec) { enum tree_code code; + tree tem; /* If the precision of the EXPR's type is K bits and the destination mode has more bits, and the sign is changing, @@ -361,14 +500,20 @@ convert_to_integer (tree type, tree expr) conversion necessitates an explicit sign-extension. In the signed-to-unsigned case the high-order bits have to be cleared. */ - if (TREE_UNSIGNED (type) != TREE_UNSIGNED (TREE_TYPE (expr)) + if (TYPE_UNSIGNED (type) != TYPE_UNSIGNED (TREE_TYPE (expr)) && (TYPE_PRECISION (TREE_TYPE (expr)) != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr))))) code = CONVERT_EXPR; else code = NOP_EXPR; - return build1 (code, type, expr); + tem = fold_unary (code, type, expr); + if (tem) + return tem; + + tem = build1 (code, type, expr); + TREE_NO_WARNING (tem) = 1; + return tem; } /* If TYPE is an enumeral type or a type with a precision less @@ -378,8 +523,8 @@ convert_to_integer (tree type, tree expr) else if (TREE_CODE (type) == ENUMERAL_TYPE || outprec != GET_MODE_BITSIZE (TYPE_MODE (type))) return build1 (NOP_EXPR, type, - convert ((*lang_hooks.types.type_for_mode) - (TYPE_MODE (type), TREE_UNSIGNED (type)), + convert (lang_hooks.types.type_for_mode + (TYPE_MODE (type), TYPE_UNSIGNED (type)), expr)); /* Here detect when we can distribute the truncation down past some @@ -408,9 +553,7 @@ convert_to_integer (tree type, tree expr) /* We can pass truncation down through right shifting when the shift count is a nonpositive constant. */ if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST - && tree_int_cst_lt (TREE_OPERAND (expr, 1), - convert (TREE_TYPE (TREE_OPERAND (expr, 1)), - integer_one_node))) + && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) <= 0) goto trunc1; break; @@ -420,7 +563,7 @@ convert_to_integer (tree type, tree expr) the target type is unsigned. */ if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) >= 0 - && TREE_UNSIGNED (type) + && TYPE_UNSIGNED (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST) { /* If shift count is less than the width of the truncated type, @@ -436,12 +579,12 @@ convert_to_integer (tree type, tree expr) but (int) a << 32 is undefined and would get a warning. */ - tree t = convert_to_integer (type, integer_zero_node); + tree t = build_int_cst (type, 0); /* If the original expression had side-effects, we must preserve it. */ if (TREE_SIDE_EFFECTS (expr)) - return build (COMPOUND_EXPR, type, expr, t); + return build2 (COMPOUND_EXPR, type, expr, t); else return t; } @@ -462,8 +605,8 @@ convert_to_integer (tree type, tree expr) && outprec >= TYPE_PRECISION (TREE_TYPE (arg1)) /* If signedness of arg0 and arg1 don't match, we can't necessarily find a type to compare them in. */ - && (TREE_UNSIGNED (TREE_TYPE (arg0)) - == TREE_UNSIGNED (TREE_TYPE (arg1)))) + && (TYPE_UNSIGNED (TREE_TYPE (arg0)) + == TYPE_UNSIGNED (TREE_TYPE (arg1)))) goto trunc1; break; } @@ -490,8 +633,8 @@ convert_to_integer (tree type, tree expr) /* Can't do arithmetic in enumeral types so use an integer type that will hold the values. */ if (TREE_CODE (typex) == ENUMERAL_TYPE) - typex = (*lang_hooks.types.type_for_size) - (TYPE_PRECISION (typex), TREE_UNSIGNED (typex)); + typex = lang_hooks.types.type_for_size + (TYPE_PRECISION (typex), TYPE_UNSIGNED (typex)); /* But now perhaps TYPEX is as wide as INPREC. In that case, do nothing special here. @@ -509,22 +652,30 @@ convert_to_integer (tree type, tree expr) signed-overflow undefinedness. And we may need to do it as unsigned if we truncate to the original size. */ - if (TREE_UNSIGNED (TREE_TYPE (expr)) - || (TREE_UNSIGNED (TREE_TYPE (arg0)) - && (TREE_UNSIGNED (TREE_TYPE (arg1)) + if (TYPE_UNSIGNED (TREE_TYPE (expr)) + || (TYPE_UNSIGNED (TREE_TYPE (arg0)) + && (TYPE_UNSIGNED (TREE_TYPE (arg1)) || ex_form == LSHIFT_EXPR || ex_form == RSHIFT_EXPR || ex_form == LROTATE_EXPR || ex_form == RROTATE_EXPR)) - || ex_form == LSHIFT_EXPR) - typex = (*lang_hooks.types.unsigned_type) (typex); + || ex_form == LSHIFT_EXPR + /* If we have !flag_wrapv, and either ARG0 or + ARG1 is of a signed type, we have to do + PLUS_EXPR or MINUS_EXPR in an unsigned + type. Otherwise, we would introduce + signed-overflow undefinedness. */ + || ((!TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg0)) + || !TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg1))) + && (ex_form == PLUS_EXPR + || ex_form == MINUS_EXPR))) + typex = lang_hooks.types.unsigned_type (typex); else - typex = (*lang_hooks.types.signed_type) (typex); + typex = lang_hooks.types.signed_type (typex); return convert (type, - fold (build (ex_form, typex, + fold_build2 (ex_form, typex, convert (typex, arg0), - convert (typex, arg1), - 0))); + convert (typex, arg1))); } } } @@ -535,30 +686,18 @@ convert_to_integer (tree type, tree expr) /* This is not correct for ABS_EXPR, since we must test the sign before truncation. */ { - tree typex = type; + tree typex; - /* Can't do arithmetic in enumeral types - so use an integer type that will hold the values. */ - if (TREE_CODE (typex) == ENUMERAL_TYPE) - typex = (*lang_hooks.types.type_for_size) - (TYPE_PRECISION (typex), TREE_UNSIGNED (typex)); - - /* But now perhaps TYPEX is as wide as INPREC. - In that case, do nothing special here. - (Otherwise would recurse infinitely in convert. */ - if (TYPE_PRECISION (typex) != inprec) - { - /* Don't do unsigned arithmetic where signed was wanted, - or vice versa. */ - if (TREE_UNSIGNED (TREE_TYPE (expr))) - typex = (*lang_hooks.types.unsigned_type) (typex); - else - typex = (*lang_hooks.types.signed_type) (typex); - return convert (type, - fold (build1 (ex_form, typex, - convert (typex, - TREE_OPERAND (expr, 0))))); - } + /* Don't do unsigned arithmetic where signed was wanted, + or vice versa. */ + if (TYPE_UNSIGNED (TREE_TYPE (expr))) + typex = lang_hooks.types.unsigned_type (type); + else + typex = lang_hooks.types.signed_type (type); + return convert (type, + fold_build1 (ex_form, typex, + convert (typex, + TREE_OPERAND (expr, 0)))); } case NOP_EXPR: @@ -575,32 +714,31 @@ convert_to_integer (tree type, tree expr) case COND_EXPR: /* It is sometimes worthwhile to push the narrowing down through the conditional and never loses. */ - return fold (build (COND_EXPR, type, TREE_OPERAND (expr, 0), + return fold_build3 (COND_EXPR, type, TREE_OPERAND (expr, 0), convert (type, TREE_OPERAND (expr, 1)), - convert (type, TREE_OPERAND (expr, 2)))); + convert (type, TREE_OPERAND (expr, 2))); default: break; } - return build1 (NOP_EXPR, type, expr); + return build1 (CONVERT_EXPR, type, expr); case REAL_TYPE: return build1 (FIX_TRUNC_EXPR, type, expr); case COMPLEX_TYPE: return convert (type, - fold (build1 (REALPART_EXPR, - TREE_TYPE (TREE_TYPE (expr)), expr))); + fold_build1 (REALPART_EXPR, + TREE_TYPE (TREE_TYPE (expr)), expr)); case VECTOR_TYPE: - if (GET_MODE_SIZE (TYPE_MODE (type)) - != GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))) + if (!tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (expr)))) { error ("can't convert between vector values of different size"); return error_mark_node; } - return build1 (NOP_EXPR, type, expr); + return build1 (VIEW_CONVERT_EXPR, type, expr); default: error ("aggregate value used where an integer was expected"); @@ -621,9 +759,8 @@ convert_to_complex (tree type, tree expr) case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: - case CHAR_TYPE: - return build (COMPLEX_EXPR, type, convert (subtype, expr), - convert (subtype, integer_zero_node)); + return build2 (COMPLEX_EXPR, type, convert (subtype, expr), + convert (subtype, integer_zero_node)); case COMPLEX_TYPE: { @@ -632,23 +769,22 @@ convert_to_complex (tree type, tree expr) if (TYPE_MAIN_VARIANT (elt_type) == TYPE_MAIN_VARIANT (subtype)) return expr; else if (TREE_CODE (expr) == COMPLEX_EXPR) - return fold (build (COMPLEX_EXPR, - type, + return fold_build2 (COMPLEX_EXPR, type, convert (subtype, TREE_OPERAND (expr, 0)), - convert (subtype, TREE_OPERAND (expr, 1)))); + convert (subtype, TREE_OPERAND (expr, 1))); else { expr = save_expr (expr); return - fold (build (COMPLEX_EXPR, - type, convert (subtype, - fold (build1 (REALPART_EXPR, - TREE_TYPE (TREE_TYPE (expr)), - expr))), + fold_build2 (COMPLEX_EXPR, type, convert (subtype, - fold (build1 (IMAGPART_EXPR, - TREE_TYPE (TREE_TYPE (expr)), - expr))))); + fold_build1 (REALPART_EXPR, + TREE_TYPE (TREE_TYPE (expr)), + expr)), + convert (subtype, + fold_build1 (IMAGPART_EXPR, + TREE_TYPE (TREE_TYPE (expr)), + expr))); } } @@ -672,16 +808,15 @@ convert_to_vector (tree type, tree expr) { case INTEGER_TYPE: case VECTOR_TYPE: - if (GET_MODE_SIZE (TYPE_MODE (type)) - != GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))) + if (!tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (expr)))) { error ("can't convert between vector values of different size"); return error_mark_node; } - return build1 (NOP_EXPR, type, expr); + return build1 (VIEW_CONVERT_EXPR, type, expr); default: error ("can't convert value to a vector"); - return convert_to_vector (type, integer_zero_node); + return error_mark_node; } } diff --git a/contrib/gcc/convert.h b/contrib/gcc/convert.h index fe3bcbb8441..77722e4c40f 100644 --- a/contrib/gcc/convert.h +++ b/contrib/gcc/convert.h @@ -1,5 +1,5 @@ /* Definition of functions in convert.c. - Copyright (C) 1993, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1993, 2000, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -15,11 +15,16 @@ for more details. 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. */ + +#ifndef GCC_CONVERT_H +#define GCC_CONVERT_H extern tree convert_to_integer (tree, tree); extern tree convert_to_pointer (tree, tree); extern tree convert_to_real (tree, tree); extern tree convert_to_complex (tree, tree); extern tree convert_to_vector (tree, tree); + +#endif /* GCC_CONVERT_H */ diff --git a/contrib/gcc/coretypes.h b/contrib/gcc/coretypes.h index e800d004252..6173bd8e8fe 100644 --- a/contrib/gcc/coretypes.h +++ b/contrib/gcc/coretypes.h @@ -1,5 +1,5 @@ /* GCC core type declarations. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ for more details. 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. */ /* Provide forward declarations of core types which are referred to by most of the compiler. This allows header files to use these types @@ -37,12 +37,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef USED_FOR_TARGET +struct bitmap_head_def; +typedef struct bitmap_head_def *bitmap; struct rtx_def; typedef struct rtx_def *rtx; struct rtvec_def; typedef struct rtvec_def *rtvec; union tree_node; typedef union tree_node *tree; +union section; +typedef union section section; /* Provide forward struct declaration so that we don't have to include all of cpplib.h whenever a random prototype includes a pointer. @@ -50,6 +54,17 @@ typedef union tree_node *tree; struct cpp_reader; +/* The thread-local storage model associated with a given VAR_DECL + or SYMBOL_REF. This isn't used much, but both trees and RTL refer + to it, so it's here. */ +enum tls_model { + TLS_MODEL_NONE, + TLS_MODEL_GLOBAL_DYNAMIC, + TLS_MODEL_LOCAL_DYNAMIC, + TLS_MODEL_INITIAL_EXEC, + TLS_MODEL_LOCAL_EXEC +}; + #else struct _dont_use_rtx_here_; diff --git a/contrib/gcc/coverage.c b/contrib/gcc/coverage.c index 85ba608380b..5eaf4888fe3 100644 --- a/contrib/gcc/coverage.c +++ b/contrib/gcc/coverage.c @@ -1,6 +1,6 @@ /* Read and write coverage files, and associated functionality. Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, - 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by James E. Wilson, UC Berkeley/Cygnus Support; based on some ideas from Dain Samples of UC Berkeley. Further mangling by Bob Manson, Cygnus Support. @@ -20,8 +20,8 @@ for more details. 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. */ #define GCOV_LINKAGE @@ -39,11 +39,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "function.h" #include "toplev.h" #include "ggc.h" -#include "target.h" #include "coverage.h" -#include "libfuncs.h" #include "langhooks.h" #include "hashtab.h" +#include "tree-iterator.h" +#include "cgraph.h" #include "gcov-io.c" @@ -96,7 +96,11 @@ static char *da_file_name; /* Hash table of count data. */ static htab_t counts_hash = NULL; -/* The names of the counter tables. */ +/* Trees representing the counter table arrays. */ +static GTY(()) tree tree_ctr_tables[GCOV_COUNTERS]; + +/* The names of the counter tables. Not used if we're + generating counters at tree level. */ static GTY(()) rtx ctr_labels[GCOV_COUNTERS]; /* The names of merge functions for counters. */ @@ -116,7 +120,22 @@ static tree build_ctr_info_type (void); static tree build_ctr_info_value (unsigned, tree); static tree build_gcov_info (void); static void create_coverage (void); + +/* Return the type node for gcov_type. */ +tree +get_gcov_type (void) +{ + return lang_hooks.types.type_for_size (GCOV_TYPE_SIZE, false); +} + +/* Return the type node for gcov_unsigned_t. */ + +static tree +get_gcov_unsigned_t (void) +{ + return lang_hooks.types.type_for_size (32, true); +} static hashval_t htab_counts_entry_hash (const void *of) @@ -161,7 +180,7 @@ read_counts_file (void) if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC)) { - warning ("`%s' is not a gcov data file", da_file_name); + warning (0, "%qs is not a gcov data file", da_file_name); gcov_close (); return; } @@ -172,7 +191,7 @@ read_counts_file (void) GCOV_UNSIGNED2STRING (v, tag); GCOV_UNSIGNED2STRING (e, GCOV_VERSION); - warning ("`%s' is version `%.*s', expected version `%.*s'", + warning (0, "%qs is version %q.*s, expected version %q.*s", da_file_name, 4, v, 4, e); gcov_close (); return; @@ -243,16 +262,16 @@ read_counts_file (void) entry = *slot; if (!entry) { - *slot = entry = xcalloc (1, sizeof (counts_entry_t)); + *slot = entry = XCNEW (counts_entry_t); entry->ident = elt.ident; entry->ctr = elt.ctr; entry->checksum = checksum; entry->summary.num = n_counts; - entry->counts = xcalloc (n_counts, sizeof (gcov_type)); + entry->counts = XCNEWVEC (gcov_type, n_counts); } else if (entry->checksum != checksum) { - error ("coverage mismatch for function %u while reading execution counters.", + error ("coverage mismatch for function %u while reading execution counters", fn_ident); error ("checksum is %x instead of %x", entry->checksum, checksum); htab_delete (counts_hash); @@ -260,7 +279,7 @@ read_counts_file (void) } else if (entry->summary.num != n_counts) { - error ("coverage mismatch for function %u while reading execution counters.", + error ("coverage mismatch for function %u while reading execution counters", fn_ident); error ("number of counters is %d instead of %d", entry->summary.num, n_counts); htab_delete (counts_hash); @@ -288,14 +307,12 @@ read_counts_file (void) } gcov_sync (offset, length); if ((is_error = gcov_is_error ())) - break; - } - - if (!gcov_is_eof ()) - { - error (is_error < 0 ? "`%s' has overflowed" : "`%s' is corrupted", - da_file_name); - htab_delete (counts_hash); + { + error (is_error < 0 ? "%qs has overflowed" : "%qs is corrupted", + da_file_name); + htab_delete (counts_hash); + break; + } } gcov_close (); @@ -316,7 +333,9 @@ get_coverage_counts (unsigned counter, unsigned expected, static int warned = 0; if (!warned++) - inform ("file %s not found, execution counts assumed to be zero", + inform ((flag_guess_branch_prob + ? "file %s not found, execution counts estimated" + : "file %s not found, execution counts assumed to be zero"), da_file_name); return NULL; } @@ -326,7 +345,7 @@ get_coverage_counts (unsigned counter, unsigned expected, entry = htab_find (counts_hash, &elt); if (!entry) { - warning ("no coverage for function '%s' found.", IDENTIFIER_POINTER + warning (0, "no coverage for function %qs found", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl))); return 0; } @@ -334,7 +353,7 @@ get_coverage_counts (unsigned counter, unsigned expected, checksum = compute_checksum (); if (entry->checksum != checksum) { - error ("coverage mismatch for function '%s' while reading counter '%s'.", + error ("coverage mismatch for function %qs while reading counter %qs", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), ctr_names[counter]); error ("checksum is %x instead of %x", entry->checksum, checksum); @@ -342,7 +361,7 @@ get_coverage_counts (unsigned counter, unsigned expected, } else if (entry->summary.num != expected) { - error ("coverage mismatch for function '%s' while reading counter '%s'.", + error ("coverage mismatch for function %qs while reading counter %qs", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), ctr_names[counter]); error ("number of counters is %d instead of %d", entry->summary.num, expected); @@ -367,14 +386,21 @@ coverage_counter_alloc (unsigned counter, unsigned num) if (!num) return 1; - if (!ctr_labels[counter]) + if (!tree_ctr_tables[counter]) { - /* Generate and save a copy of this so it can be shared. */ + /* Generate and save a copy of this so it can be shared. Leave + the index type unspecified for now; it will be set after all + functions have been compiled. */ char buf[20]; - + tree gcov_type_node = get_gcov_type (); + tree gcov_type_array_type + = build_array_type (gcov_type_node, NULL_TREE); + tree_ctr_tables[counter] + = build_decl (VAR_DECL, NULL_TREE, gcov_type_array_type); + TREE_STATIC (tree_ctr_tables[counter]) = 1; ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1); - ctr_labels[counter] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); - SYMBOL_REF_FLAGS (ctr_labels[counter]) = SYMBOL_FLAG_LOCAL; + DECL_NAME (tree_ctr_tables[counter]) = get_identifier (buf); + DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (gcov_type_node); } fn_b_ctrs[counter] = fn_n_ctrs[counter]; fn_n_ctrs[counter] += num; @@ -382,24 +408,19 @@ coverage_counter_alloc (unsigned counter, unsigned num) return 1; } -/* Generate a MEM rtl to access COUNTER NO. */ +/* Generate a tree to access COUNTER NO. */ -rtx -coverage_counter_ref (unsigned counter, unsigned no) +tree +tree_coverage_counter_ref (unsigned counter, unsigned no) { - unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1); - enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0); - rtx ref; + tree gcov_type_node = get_gcov_type (); - if (no >= fn_n_ctrs[counter] - fn_b_ctrs[counter]) - abort (); + gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]); no += prg_n_ctrs[counter] + fn_b_ctrs[counter]; - ref = plus_constant (ctr_labels[counter], gcov_size / BITS_PER_UNIT * no); - ref = gen_rtx_MEM (mode, ref); - set_mem_alias_set (ref, new_alias_set ()); - MEM_NOTRAP_P (ref) = 1; - return ref; + /* "no" here is an array index, scaled to bytes later. */ + return build4 (ARRAY_REF, gcov_type_node, tree_ctr_tables[counter], + build_int_cst (NULL_TREE, no), NULL, NULL); } /* Generate a checksum for a string. CHKSUM is the current @@ -417,35 +438,43 @@ coverage_checksum_string (unsigned chksum, const char *string) as the checksums are used only for sanity checking. */ for (i = 0; string[i]; i++) { + int offset = 0; + if (!strncmp (string + i, "_GLOBAL__N_", 11)) + offset = 11; if (!strncmp (string + i, "_GLOBAL__", 9)) - for (i = i + 9; string[i]; i++) - if (string[i]=='_') - { - int y; - unsigned seed; + offset = 9; - for (y = 1; y < 9; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 9 || string[i + 9] != '_') - continue; - for (y = 10; y < 18; y++) - if (!(string[i + y] >= '0' && string[i + y] <= '9') - && !(string[i + y] >= 'A' && string[i + y] <= 'F')) - break; - if (y != 18) - continue; - if (!sscanf (string + i + 10, "%X", &seed)) - abort (); - if (seed != crc32_string (0, flag_random_seed)) - continue; - string = dup = xstrdup (string); - for (y = 10; y < 18; y++) - dup[i + y] = '0'; - break; - } - break; + /* C++ namespaces do have scheme: + _GLOBAL__N___functionname + since filename might contain extra underscores there seems + to be no better chance then walk all possible offsets looking + for magicnuber. */ + if (offset) + { + for (i = i + offset; string[i]; i++) + if (string[i]=='_') + { + int y; + + for (y = 1; y < 9; y++) + if (!(string[i + y] >= '0' && string[i + y] <= '9') + && !(string[i + y] >= 'A' && string[i + y] <= 'F')) + break; + if (y != 9 || string[i + 9] != '_') + continue; + for (y = 10; y < 18; y++) + if (!(string[i + y] >= '0' && string[i + y] <= '9') + && !(string[i + y] >= 'A' && string[i + y] <= 'F')) + break; + if (y != 18) + continue; + if (!dup) + string = dup = xstrdup (string); + for (y = 10; y < 18; y++) + dup[i + y] = '0'; + } + break; + } } chksum = crc32_string (chksum, string); @@ -460,10 +489,11 @@ coverage_checksum_string (unsigned chksum, const char *string) static unsigned compute_checksum (void) { - unsigned chksum = DECL_SOURCE_LINE (current_function_decl); + expanded_location xloc + = expand_location (DECL_SOURCE_LOCATION (current_function_decl)); + unsigned chksum = xloc.line; - chksum = coverage_checksum_string (chksum, - DECL_SOURCE_FILE (current_function_decl)); + chksum = coverage_checksum_string (chksum, xloc.file); chksum = coverage_checksum_string (chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl))); @@ -483,8 +513,8 @@ coverage_begin_output (void) if (!bbg_function_announced) { - const char *file = DECL_SOURCE_FILE (current_function_decl); - unsigned line = DECL_SOURCE_LINE (current_function_decl); + expanded_location xloc + = expand_location (DECL_SOURCE_LOCATION (current_function_decl)); unsigned long offset; if (!bbg_file_opened) @@ -506,8 +536,8 @@ coverage_begin_output (void) gcov_write_unsigned (compute_checksum ()); gcov_write_string (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl))); - gcov_write_string (file); - gcov_write_unsigned (line); + gcov_write_string (xloc.file); + gcov_write_unsigned (xloc.line); gcov_write_length (offset); bbg_function_announced = 1; @@ -525,7 +555,7 @@ coverage_end_function (void) if (bbg_file_opened > 1 && gcov_is_error ()) { - warning ("error writing `%s'", bbg_file_name); + warning (0, "error writing %qs", bbg_file_name); bbg_file_opened = -1; } @@ -533,7 +563,7 @@ coverage_end_function (void) { struct function_list *item; - item = xmalloc (sizeof (struct function_list)); + item = XNEW (struct function_list); *functions_tail = item; functions_tail = &item->next; @@ -558,20 +588,21 @@ coverage_end_function (void) static tree build_fn_info_type (unsigned int counters) { - tree type = (*lang_hooks.types.make_type) (RECORD_TYPE); + tree type = lang_hooks.types.make_type (RECORD_TYPE); tree field, fields; tree array_type; /* ident */ - fields = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + fields = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); /* checksum */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; - array_type = build_index_type (build_int_2 (counters - 1, 0)); - array_type = build_array_type (unsigned_type_node, array_type); + array_type = build_int_cst (NULL_TREE, counters - 1); + array_type = build_index_type (array_type); + array_type = build_array_type (get_gcov_unsigned_t (), array_type); /* counters */ field = build_decl (FIELD_DECL, NULL_TREE, array_type); @@ -596,33 +627,32 @@ build_fn_info_value (const struct function_list *function, tree type) tree array_value = NULL_TREE; /* ident */ - value = tree_cons (fields, - convert (unsigned_intSI_type_node, - build_int_2 (function->ident, 0)), - value); + value = tree_cons (fields, build_int_cstu (get_gcov_unsigned_t (), + function->ident), value); fields = TREE_CHAIN (fields); /* checksum */ - value = tree_cons (fields, - convert (unsigned_intSI_type_node, - build_int_2 (function->checksum, 0)), - value); + value = tree_cons (fields, build_int_cstu (get_gcov_unsigned_t (), + function->checksum), value); fields = TREE_CHAIN (fields); /* counters */ for (ix = 0; ix != GCOV_COUNTERS; ix++) if (prg_ctr_mask & (1 << ix)) { - tree counters = convert (unsigned_type_node, - build_int_2 (function->n_ctrs[ix], 0)); + tree counters = build_int_cstu (get_gcov_unsigned_t (), + function->n_ctrs[ix]); array_value = tree_cons (NULL_TREE, counters, array_value); } - array_value = build_constructor (TREE_TYPE (fields), nreverse (array_value)); + /* FIXME: use build_constructor directly. */ + array_value = build_constructor_from_list (TREE_TYPE (fields), + nreverse (array_value)); value = tree_cons (fields, array_value, value); - value = build_constructor (type, nreverse (value)); + /* FIXME: use build_constructor directly. */ + value = build_constructor_from_list (type, nreverse (value)); return value; } @@ -632,13 +662,13 @@ build_fn_info_value (const struct function_list *function, tree type) static tree build_ctr_info_type (void) { - tree type = (*lang_hooks.types.make_type) (RECORD_TYPE); + tree type = lang_hooks.types.make_type (RECORD_TYPE); tree field, fields = NULL_TREE; - tree gcov_ptr_type = build_pointer_type (GCOV_TYPE_NODE); + tree gcov_ptr_type = build_pointer_type (get_gcov_type ()); tree gcov_merge_fn_type; /* counters */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; @@ -650,7 +680,7 @@ build_ctr_info_type (void) /* merge */ gcov_merge_fn_type = build_function_type_list (void_type_node, - gcov_ptr_type, unsigned_type_node, + gcov_ptr_type, get_gcov_unsigned_t (), NULL_TREE); field = build_decl (FIELD_DECL, NULL_TREE, build_pointer_type (gcov_merge_fn_type)); @@ -675,26 +705,29 @@ build_ctr_info_value (unsigned int counter, tree type) /* counters */ value = tree_cons (fields, - convert (unsigned_intSI_type_node, - build_int_2 (prg_n_ctrs[counter], 0)), + build_int_cstu (get_gcov_unsigned_t (), + prg_n_ctrs[counter]), value); fields = TREE_CHAIN (fields); if (prg_n_ctrs[counter]) { - tree array_type, array; + tree array_type; - array_type = build_index_type (build_int_2 (prg_n_ctrs[counter] - 1, 0)); + array_type = build_int_cstu (get_gcov_unsigned_t (), + prg_n_ctrs[counter] - 1); + array_type = build_index_type (array_type); array_type = build_array_type (TREE_TYPE (TREE_TYPE (fields)), array_type); - array = build_decl (VAR_DECL, NULL_TREE, array_type); - TREE_STATIC (array) = 1; - DECL_NAME (array) = get_identifier (XSTR (ctr_labels[counter], 0)); - assemble_variable (array, 0, 0, 0); + TREE_TYPE (tree_ctr_tables[counter]) = array_type; + DECL_SIZE (tree_ctr_tables[counter]) = TYPE_SIZE (array_type); + DECL_SIZE_UNIT (tree_ctr_tables[counter]) = TYPE_SIZE_UNIT (array_type); + assemble_variable (tree_ctr_tables[counter], 0, 0, 0); value = tree_cons (fields, - build1 (ADDR_EXPR, TREE_TYPE (fields), array), + build1 (ADDR_EXPR, TREE_TYPE (fields), + tree_ctr_tables[counter]), value); } else @@ -712,7 +745,8 @@ build_ctr_info_value (unsigned int counter, tree type) build1 (ADDR_EXPR, TREE_TYPE (fields), fn), value); - value = build_constructor (type, nreverse (value)); + /* FIXME: use build_constructor directly. */ + value = build_constructor_from_list (type, nreverse (value)); return value; } @@ -742,15 +776,14 @@ build_gcov_info (void) if (prg_ctr_mask & (1 << ix)) n_ctr_types++; - type = (*lang_hooks.types.make_type) (RECORD_TYPE); + type = lang_hooks.types.make_type (RECORD_TYPE); const_type = build_qualified_type (type, TYPE_QUAL_CONST); /* Version ident */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; - value = tree_cons (field, convert (unsigned_intSI_type_node, - build_int_2 (GCOV_VERSION, 0)), + value = tree_cons (field, build_int_cstu (TREE_TYPE (field), GCOV_VERSION), value); /* next -- NULL */ @@ -760,11 +793,10 @@ build_gcov_info (void) value = tree_cons (field, null_pointer_node, value); /* stamp */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; - value = tree_cons (field, convert (unsigned_intSI_type_node, - build_int_2 (local_tick, 0)), + value = tree_cons (field, build_int_cstu (TREE_TYPE (field), local_tick), value); /* Filename */ @@ -781,9 +813,9 @@ build_gcov_info (void) filename_string = build_string (filename_len + 1, filename); if (filename != da_file_name) free (filename); - TREE_TYPE (filename_string) = - build_array_type (char_type_node, - build_index_type (build_int_2 (filename_len, 0))); + TREE_TYPE (filename_string) = build_array_type + (char_type_node, build_index_type + (build_int_cst (NULL_TREE, filename_len))); value = tree_cons (field, build1 (ADDR_EXPR, string_type, filename_string), value); @@ -799,21 +831,23 @@ build_gcov_info (void) { tree array_type; - array_type = build_index_type (build_int_2 (n_fns - 1, 0)); + array_type = build_index_type (build_int_cst (NULL_TREE, n_fns - 1)); array_type = build_array_type (fn_info_type, array_type); - fn_info_value = build_constructor (array_type, nreverse (fn_info_value)); + /* FIXME: use build_constructor directly. */ + fn_info_value = build_constructor_from_list (array_type, + nreverse (fn_info_value)); fn_info_value = build1 (ADDR_EXPR, fn_info_ptr_type, fn_info_value); } else fn_info_value = null_pointer_node; /* number of functions */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; value = tree_cons (field, - convert (unsigned_type_node, build_int_2 (n_fns, 0)), + build_int_cstu (get_gcov_unsigned_t (), n_fns), value); /* fn_info table */ @@ -823,25 +857,26 @@ build_gcov_info (void) value = tree_cons (field, fn_info_value, value); /* counter_mask */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; value = tree_cons (field, - convert (unsigned_type_node, - build_int_2 (prg_ctr_mask, 0)), + build_int_cstu (get_gcov_unsigned_t (), prg_ctr_mask), value); /* counters */ ctr_info_type = build_ctr_info_type (); - ctr_info_ary_type = build_index_type (build_int_2 (n_ctr_types, 0)); + ctr_info_ary_type = build_index_type (build_int_cst (NULL_TREE, + n_ctr_types)); ctr_info_ary_type = build_array_type (ctr_info_type, ctr_info_ary_type); for (ix = 0; ix != GCOV_COUNTERS; ix++) if (prg_ctr_mask & (1 << ix)) ctr_info_value = tree_cons (NULL_TREE, build_ctr_info_value (ix, ctr_info_type), ctr_info_value); - ctr_info_value = build_constructor (ctr_info_ary_type, - nreverse (ctr_info_value)); + /* FIXME: use build_constructor directly. */ + ctr_info_value = build_constructor_from_list (ctr_info_ary_type, + nreverse (ctr_info_value)); field = build_decl (FIELD_DECL, NULL_TREE, ctr_info_ary_type); TREE_CHAIN (field) = fields; @@ -850,7 +885,8 @@ build_gcov_info (void) finish_builtin_struct (type, "__gcov_info", fields, NULL_TREE); - value = build_constructor (type, nreverse (value)); + /* FIXME: use build_constructor directly. */ + value = build_constructor_from_list (type, nreverse (value)); return value; } @@ -862,70 +898,42 @@ build_gcov_info (void) static void create_coverage (void) { - tree gcov_info, gcov_info_value; - char name[20]; - char *ctor_name; - tree ctor; - rtx gcov_info_address; + tree gcov_info, gcov_init, body, t; + char name_buf[32]; no_coverage = 1; /* Disable any further coverage. */ if (!prg_ctr_mask) return; - gcov_info_value = build_gcov_info (); - - gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (gcov_info_value)); - DECL_INITIAL (gcov_info) = gcov_info_value; + t = build_gcov_info (); + gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (t)); TREE_STATIC (gcov_info) = 1; - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0); - DECL_NAME (gcov_info) = get_identifier (name); + ASM_GENERATE_INTERNAL_LABEL (name_buf, "LPBX", 0); + DECL_NAME (gcov_info) = get_identifier (name_buf); + DECL_INITIAL (gcov_info) = t; /* Build structure. */ assemble_variable (gcov_info, 0, 0, 0); - /* Build the constructor function to invoke __gcov_init. */ - ctor_name = concat (IDENTIFIER_POINTER (get_file_function_name ('I')), - "_GCOV", NULL); - ctor = build_decl (FUNCTION_DECL, get_identifier (ctor_name), - build_function_type (void_type_node, NULL_TREE)); - free (ctor_name); - DECL_EXTERNAL (ctor) = 0; + /* Build a decl for __gcov_init. */ + t = build_pointer_type (TREE_TYPE (gcov_info)); + t = build_function_type_list (void_type_node, t, NULL); + t = build_decl (FUNCTION_DECL, get_identifier ("__gcov_init"), t); + TREE_PUBLIC (t) = 1; + DECL_EXTERNAL (t) = 1; + gcov_init = t; - /* It can be a static function as long as collect2 does not have - to scan the object file to find its ctor/dtor routine. */ - TREE_PUBLIC (ctor) = ! targetm.have_ctors_dtors; - TREE_USED (ctor) = 1; - DECL_RESULT (ctor) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); - DECL_UNINLINABLE (ctor) = 1; + /* Generate a call to __gcov_init(&gcov_info). */ + body = NULL; + t = build_fold_addr_expr (gcov_info); + t = tree_cons (NULL, t, NULL); + t = build_function_call_expr (gcov_init, t); + append_to_statement_list (t, &body); - ctor = (*lang_hooks.decls.pushdecl) (ctor); - rest_of_decl_compilation (ctor, 0, 1, 0); - announce_function (ctor); - current_function_decl = ctor; - make_decl_rtl (ctor, NULL); - init_function_start (ctor); - expand_function_start (ctor, 0); - /* Actually generate the code to call __gcov_init. */ - gcov_info_address = force_reg (Pmode, XEXP (DECL_RTL (gcov_info), 0)); - emit_library_call (gcov_init_libfunc, LCT_NORMAL, VOIDmode, 1, - gcov_info_address, Pmode); - - expand_function_end (); - /* Create a dummy BLOCK. */ - DECL_INITIAL (ctor) = make_node (BLOCK); - TREE_USED (DECL_INITIAL (ctor)) = 1; - - rest_of_compilation (ctor); - - if (! quiet_flag) - fflush (asm_out_file); - current_function_decl = NULL_TREE; - - if (targetm.have_ctors_dtors) - (* targetm.asm_out.constructor) (XEXP (DECL_RTL (ctor), 0), - DEFAULT_INIT_PRIORITY); + /* Generate a constructor to run it. */ + cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY); } /* Perform file-level initialization. Read in data file, generate name @@ -937,12 +945,12 @@ coverage_init (const char *filename) int len = strlen (filename); /* Name of da file. */ - da_file_name = xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1); + da_file_name = XNEWVEC (char, len + strlen (GCOV_DATA_SUFFIX) + 1); strcpy (da_file_name, filename); strcat (da_file_name, GCOV_DATA_SUFFIX); /* Name of bbg file. */ - bbg_file_name = xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1); + bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1); strcpy (bbg_file_name, filename); strcat (bbg_file_name, GCOV_NOTE_SUFFIX); diff --git a/contrib/gcc/coverage.h b/contrib/gcc/coverage.h index 9756bbaafa8..e070d837e25 100644 --- a/contrib/gcc/coverage.h +++ b/contrib/gcc/coverage.h @@ -1,5 +1,6 @@ /* coverage.h - Defines data exported from coverage.c - Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +16,8 @@ for more details. 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. */ #ifndef GCC_COVERAGE_H #define GCC_COVERAGE_H @@ -25,7 +26,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA extern void coverage_init (const char *); extern void coverage_finish (void); -extern void coverage_read_counts_file (void); /* Complete the coverage information for the current function. Once per function. */ @@ -38,11 +38,13 @@ extern int coverage_begin_output (void); /* Allocate some counters. Repeatable per function. */ extern int coverage_counter_alloc (unsigned /*counter*/, unsigned/*num*/); /* Use a counter from the most recent allocation. */ -extern rtx coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/); +extern tree tree_coverage_counter_ref (unsigned /*counter*/, unsigned/*num*/); /* Get all the counters for the current function. */ extern gcov_type *get_coverage_counts (unsigned /*counter*/, unsigned /*expected*/, const struct gcov_ctr_summary **); +extern tree get_gcov_type (void); + #endif diff --git a/contrib/gcc/cp/ChangeLog b/contrib/gcc/cp/ChangeLog index 198fc908ba5..e2cc82e4013 100644 --- a/contrib/gcc/cp/ChangeLog +++ b/contrib/gcc/cp/ChangeLog @@ -1,48 +1,3214 @@ -2006-03-05 Release Manager +2007-05-13 Release Manager - * GCC 3.4.6 released. + * GCC 4.2.0 released. -2006-02-23 Volker Reichelt +2007-04-28 Andrew Pinski + + PR C++/30221 + * decl.c (reshape_init_r): Don't reshape the first element if it + is a pointer to member function. + +2007-04-26 Andrew Pinski + + PR C++/30016 + * typeck.c (build_reinterpret_cast_1): Only allow conversion to + integeral types from vectors types. + +2007-04-26 Jakub Jelinek + + PR c++/31598 + * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO + for type dependent OMP_CLAUSE_DECLs. + +2007-04-24 Paolo Carlini + + PR c++/30500 + * pt.c (instantiate_decl): Set in_system_header. + +2007-04-17 Simon Martin + + PR c++/31517 + * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs. + +2007-04-16 Mark Mitchell + + PR c++/31513 + * call.c (convert_for_arg_passing): Convert bitfields to their + declared types. + +2007-04-13 Jason Merrill + + PR c++/31074 + * call.c (reference_binding): Add c_cast_p parm. If true, + add quals to TO as needed to make it reference-compatible. + +2007-04-10 Mike Stump + + * class.c (dfs_accumulate_vtbl_inits): Slam the vtbl type back to + vtbl_ptr_type_node to ensure the mode is correct. + +2007-04-09 Mark Mitchell + + PR c++/31449 + * class.c (build_base_path): Ensure that the converted pointer has + the same cv-qualification as the input. + +2007-04-03 Jakub Jelinek + + PR c++/30847 + * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void + type issue error and return early. + +2007-03-30 Jason Merrill + + PR c++/31187 + * typeck.c (cp_type_readonly): New fn. + * cp-tree.h: Declare it. + * decl.c (start_decl): Set implicit DECL_THIS_STATIC here. + (cp_finish_decl): Not here. + +2007-03-31 Diego Novillo + Mark Mitchell + + PR 29585 + * class.c (dfs_accumulate_vtbl_inits): Use build_address + to build the vtbl entry. + +2007-03-22 Mark Mitchell + + PR c++/30863 + * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do + not consume tokens when failing. + +2007-03-22 Jim Wilson + Mark Mitchell + + PR c++/31273 + * call.c (standard_conversion): Use type_decays_to. Keep FCODE + consistent with FROM. + +2007-03-14 Andrew Pinski + + PR c++/31165 + * call.c (convert_default_arg): Instead of copying the node, + unshare it. + +2007-03-13 Mark Mitchell + + PR bootstrap/30899 + * Make-lang.in (doc/g++.1): Use $< to specify the location from + which to copy. + +2007-03-11 Mark Mitchell + + PR c++/31038 + * parser.c (cp_parser_postfix_expression): Disallow compound + literals in constant expressions. + +2007-03-11 Ian Lance Taylor + + Backported -fstrict-overflow/-Wstrict-overflow from mainline: + 2007-01-17 Ian Lance Taylor + + * class.c (add_method): Call VEC_reserve_exact rather than passing + a negative size to VEC_reserve. + +2007-03-11 Mark Mitchell + + PR c++/31038 + * parser.c (cp_parser_postfix_expression): Disallow compound + literals in constant expressions. + + PR c++/30328 + * semantics.c (finish_typeof): Use unlowered_expr_type. + +2007-03-10 Mark Mitchell + + PR c++/30274 + * cp-tree.h (unlowered_expr_type): New function. + * typeck.c (is_bitfield_expr_with_lowered_type): Handle + COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR. + (unlowered_expr_type): New function. + (build_unary_op): Disallow predecrements of bool bitfields. + * call.c (build_conditional_expr): Use unlowered_expr_type. + * pt.c (type_unification_real): Likewise. + +2007-03-08 Andrew Pinski + + PR C++/30168 + * optimize.c (update_cloned_parm): Copy DECL_COMPLEX_GIMPLE_REG_P also. + +2007-03-08 Volker Reichelt + + PR c++/30852 + * semantics.c (finish_offsetof): Handle COMPOUND_EXPR. + +2007-03-07 Manuel Lopez-Ibanez + + * typeck.c (build_binary_op): Replace -Wstring-literal-comparison + and -Walways-true with -Waddress. + * cvt.c (convert_to_void): Replace unconditional warning with + -Waddress. + +2007-03-05 Simon Martin + + PR c++/30895 + * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees. + +2007-02-22 Simon Martin + + PR c++/29475 + * cp-tree.h (struct deferred_access_check): New structure to represent a + deferred access check. It replaces the previous representation as a tree. + (get_deferred_access_checks): Return a vector of struct + deferred_access_check instead of a tree list. + (perform_access_checks): Take a vector of struct deferred_access_check + instead of a tree list. + (enforce_access, perform_or_defer_access_check): Added an + extra argument that represents the declaration to use to print + potential error messages. + * semantics.c (struct deferred_access): Store the deferred access checks + as a vector of struct deferred_access_check instead of a tree list. + (push_deferring_access_checks): Handle the change in struct + deferred_access. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + (perform_access_checks): Take a vector of struct deferred_access_check + instead of a tree list. + (finish_non_static_data_member, check_accessibility_of_qualified_id, + finish_id_expression): Adjusted the call to perform_or_defer_access_check. + (pop_to_parent_deferring_access_checks, perform_access_checks, + perform_or_defer_access_check): Adjusted the call to enforce_access. + * parser.c (struct tree_check): New structure to store various data + associated with a CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID token. + (struct cp_token): Changed the value field to be a union with a pointer to + a struct tree_check for CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID + tokens and a tree field for all other tokens. + (eof_token): Adjusted due to the change in struct cp_token. + (cp_lexer_get_preprocessor_token): Likewise. + (cp_lexer_purge_token): Likewise. + (cp_lexer_purge_tokens_after): Likewise. + (cp_lexer_print_token): Likewise. + (cp_parser_error): Likewise. + (cp_parser_identifier): Likewise. + (cp_parser_string_literal): Likewise. + (cp_parser_primary_expression): Likewise. + (cp_parser_unqualified_id): Likewise. + (cp_parser_parenthesized_expression_list): Likewise. + (cp_parser_storage_class_specifier_opt): Likewise. + (cp_parser_function_specifier_opt): Likewise. + (cp_parser_type_specifier): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_initializer_list): Likewise. + (cp_parser_member_specification_opt): Likewise. + (cp_parser_attribute_list): Likewise. + (cp_parser_objc_expression): Likewise. + (cp_parser_objc_protocol_qualifiers): Likewise. + (cp_parser_objc_selector): Likewise. + (cp_parser_objc_declaration): Likewise. + (cp_parser_objc_statement): Likewise. + (cp_parser_omp_clause_name): Likewise. + (cp_parser_omp_clause_default): Likewise. + (cp_parser_omp_clause_schedule): Likewise. + (cp_parser_omp_parallel): Likewise. + (cp_parser_initial_pragma): Likewise. + (pragma_lex): Likewise. + (cp_parser_pre_parsed_nested_name_specifier): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + Use cp_token::u::tree_check_value to save the token's value, the + associated deferred checks and its qualifying scope. + (cp_parser_template_id): Likewise. + (cp_parser_template_declaration_after_export): Adjusted the call to + get_deferred_access_checks. + (cp_parser_init_declarator): Take the access checks as a vector of struct + deferred_access_check instead of a tree list. + (cp_parser_single_declaration): Likewise. + (cp_parser_perform_template_parameter_access_checks): Likewise. + (cp_parser_simple_declaration): Adjusted the call to + cp_parser_init_declarator. + (cp_parser_explicit_specialization): Adjusted the call to + cp_parser_single_declaration. + (cp_parser_template_id, cp_parser_pre_parsed_nested_name_specifier): + Adjusted the call to perform_or_defer_access_check. + * init.c (build_offset_ref): Adjusted the call to + perform_or_defer_access_check. + * class.c (alter_access, resolve_address_of_overloaded_function): + Likewise. + * decl.c (make_typename_type, make_unbound_class_template): Likewise. + * search.c (lookup_member): Likewise. + * friend.c (add_friend): Likewise. + * call.c (enforce_access): Use the new extra argument to build the + error message. + (build_op_delete_call): Adjusted the call to + perform_or_defer_access_check. + (build_over_call): Likewise. + +2007-02-19 Mark Mitchell + + * call.c (build_new_method_call): Ensure that explicit calls of + destructors have type "void". + +2007-02-11 Mark Mitchell + + PR c++/26988 + * pt.c (determine_specialization): Use skip_artificial_parms_for. + (fn_type_unificiation): Likewise. + (get_bindings): Likewise. + +2007-02-06 Mark Mitchell + + PR target/29487 + * decl.c (finish_function): Use DECL_REPLACEABLE. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + +2007-02-07 Jakub Jelinek + + PR c++/30703 + * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref + parameters and result decls in omp clauses. + (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs + by reference. + +2007-02-02 Jakub Jelinek + + PR c++/30536 + * decl.c (grokdeclarator): If __thread is used together with + a storage class other than extern and static, clear thread_p + after issuing diagnostics and fall through to checking the + storage class. + +2007-01-28 Andrew Pinski + + PR C++/28988 + * semantics.c (finish_pseudo_destructor_expr): Check the + destrutor name by calling check_dtor_name. + +2007-01-10 Mark Mitchell + + PR c++/28999 + * decl.c (make_typename_type): If the qualified name is not a + type, issue an error. + * parser.c (cp_parser_elaborated_type_specifier): Fix comment + formatting. + +2006-12-11 Mark Mitchell + + PR c++/29732 + * cp-tree.h (DECL_USE_TEMPLATE): Mention partial specializations. + (explicit_class_specialization_p): Declare. + * pt.c (explicit_class_specialization_p): New function. + * parser.c (cp_parser_init_declarator): Check correct number of + template parameters for in-class function definitions. + (cp_parser_check_declarator_template_parameters): Stop looking for + template classes when we find an explicit specialization. + +2006-12-07 Lee Millward + + PR c++/29980 + * cp_parser_elaborated_type_specifier: Check + the return value of check_elaborated_type_specifier. + +2006-12-06 Mark Mitchell + + PR c++/29730 + * parser.c (cp_parser_init_declarator): Reject initialization of + functions. + +2006-12-06 Mark Mitchell + + PR c++/29729 + * decl2.c (check_member_template): Move check for member + templates in local classes to ... + * parser.c (cp_parser_template_declaration_after_export): + ... here. + +2006-12-05 Mark Mitchell + + PR c++/29728 + * decl.c (check_array_designated_initializer): New function. + (maybe_deduce_size_from_array_init): Use it. + (reshape_init_array): Likewise. + +2006-12-04 Mark Mitchell + + PR c++/29733 + * pt.c (tsubst_decl): Disallow variables of function type. + +2006-12-04 Mark Mitchell + + PR c++/29632 + * call.c (add_builtin_candidate): Do not permit NULL pointer + constants to be compared with template parameters. + +2006-12-04 Richard Henderson + Andrew Pinski + + PR C++/14329 + * error.c (cp_printer) <'D'>: Handle DECL_DEBUG_EXPR. + +2006-12-01 Volker Reichelt + + PR c++/30022 + * typeck.c (type_after_usual_arithmetic_conversions): + Fix assertion for vector types. + (build_binary_op): Use temporary for inner type of vector types. + +2006-11-29 Lee Millward + + PR c++/29022 + * parser.c (cp_parser_class_head): Move processing + of any base classes to... + (cp_parser_class_specifier) ...here. Take an extra + tree* parameter for any base classes. Only process + them if the opening brace was found. + +2006-11-28 Jakub Jelinek + + PR c++/29735 + * decl.c (grokfndecl): Check main's type after applying + attributes, not before. + +2006-11-26 Mark Mitchell + + PR c++/29886 + * parser.c (cp_parser): Add in_function_body. + (cp_parser_new): Initialize it. + (cp_parser_primary_expression): Use parser->in_function_body + instead of at_function_scope_p. + (cp_parser_asm_definition): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_class_specifier): Clear parser->in_function_body. + (cp_parser_constructor_declarator_p): Use parser->in_function_body + instead of at_function_scope_p. + (cp_parser_function_body_after_declarator): Set + parser->in_function_body. + +2006-11-21 Jakub Jelinek + + PR c++/29570 + * decl.c (cp_finish_decl): Check for value dependent brace enclosed + scalar initializer. + + PR c++/29734 + * cp-tree.h (WANT_VECTOR): Define. + (WANT_ARITH): Add WANT_VECTOR. + * cvt.c (build_expr_type_conversion): Handle vector types. + * typeck.c (build_unary_op): Add WANT_VECTOR to + build_expr_type_conversion flags. + +2006-11-13 Mark Mitchell + + PR c++/29518 + * pt.c (coerce_template_parms): Do not skip_evaluation while + substituting template arguments. + +2006-10-22 Nathan Sidwell + + PR c++/20647 + * rtti.c (tinfo_base_init): The type info string is always global. + +2006-10-20 Lee Millward + Mark Mitchell + + PR c++/28053 + * decl2.c (grokbitfield): Detect invalid non-integral + types earlier when possible. + +2006-10-18 Mark Shinwell + + PR c++/26884 + * typeck2.c (digest_init): Raise error upon attempts to + initialize arrays with variables. + +2006-10-17 Lee Millward + + PR c++/27952 + * cp-tree.h (xref_basetypes): Return bool instead of void. + * decl.c (xref_basetypes): Adjust definition. Return false + if the class bases are invalid. + * parser.c (cp_parser_class_head): Check the return value + from xref_basetypes. + +2006-10-17 Mark Mitchell + + PR c++/28261 + * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Add + comment. + + PR c++/28261 + * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): New + function. + (cp_parser_constructor_declarator_p): Use it. + (cp_parser_check_type_definition): Return a value indicating + whether or not the definition is valid. + (cp_parser_enum_specifier): Skip invalid enum definitions. + +2006-10-17 Mark Mitchell + + PR c++/29039 + * typeck2.c (build_functional_cast): Don't zero-initialize + non-PODs; instead, call their constructors. + * method.c (synthesize_method): Always build mem-initializers, if + we're synthesizing the default constructor. + +2006-10-17 Mark Mitchell + + PR c++/27270 + * decl.c (reshape_init_class): Move check for designated + to ... + * parser.c (cp_parser_initializer_list): ... here. + * pt.c (tsubst_copy_and_build): Use finish_compound_literal. + +2006-10-16 Mark Mitchell + + PR c++/27270 + * typeck2.c (process_init_constructor_array): Reword comment. + * pt.c (tsubst_copy_and_built): Call reshape_init before calling + digest_init. + + PR c++/29408 + * parser.c (cp_parser_using_declaration): Stop parsing when + something goes wrong with an access declaration. + + PR c++/29435 + * typeck.c (cxx_sizeof_or_alignof_type): Complete non-dependent + types when their sizes are required. Refine test for VLAs. + + PR c++/28211 + * parser.c (cp_parser_template_argument): Don't consider "&var" a + possible constant-expression. + * pt.c (convert_nontype_argument): Refine handling of arguments of + pointer type. + +2006-10-13 Mark Mitchell + + PR c++/28506 + * parser.c (function_declarator_p): New function. + (cp_parser_init_declarator): Use it. + (cp_parser_member_declaration): Likewise. + +2006-10-12 Mark Mitchell + + PR c++/29318 + * rtti.c (get_tinfo_decl): Refuse to create type info objects for + variably modified types. + +2006-10-12 Lee Millward + + PR c++/27961 + * decl.c (start_decl): Return error_mark_node if a + function is initialized like a variable. + (check_var_type): If a variable of field is declared void, + set the type to error_mark_node. + (grokdeclarator): Check the return type of check_var_type. + * class.c (finish_struct_1): Robustify. + +2006-10-11 Mark Mitchell + + PR c++/29175 + * decl.c (check_initializer): Issue errors about trying to + initialize arrays whose elements have variable size. + +2006-10-11 Lee Millward + + PR c++/29024 + * cp-tree (struct cp_decl_specifier_seq): Rename to + conflicting_specifiers_p + * parser.c (cp_parser_set_storage_class): Set + conflicting_specifiers_p for the input decl specifier + if a typedef specifier is present. Rename uses of + multiple_specifiers_p to conflicting_specifiers_p. + (cp_parser_decl_specifier_seq) : If a storage + class specifier has already been set for this declaration, + set conflicting_specifiers_p to true on the decl_specs. + * decl.c (grokdeclarator): Rename uses of + multiple_specifiers_p to conflicting_specifiers_p. + +2006-10-10 Brooks Moses + + * Make-lang.in: Added "c++.pdf" target support. + +2006-10-10 Richard Guenther + + PR rtl-optimization/29323 + * decl.c (finish_function): Set TREE_NOTHROW only for + functions that bind local. + +2006-10-09 Richard Henderson + + Revert emutls patch. + +2006-10-04 Richard Henderson + Jakub Jelinek + + * decl.c (grokvardecl): Don't error if !have_tls. + (grokdeclarator): Likewise. + * parser.c (cp_parser_omp_threadprivate): Likewise. + +2006-10-03 Mark Mitchell + + PR c++/29020 + * friend.c (do_friend): Improve comments; add assertion. + * parser.c (cp_parser_nested_name_specifier_opt): Resolve + typenames for qualified names used in declarations, even when + caching qualified name lookup. + + PR c++/29138 + * decl2.c (grokfield): Don't handle access declarations here. + * parser.c (cp_parser_using_declaration): Handle access + declarations too. + (cp_parser_block_declaration): Adjust calls to + cp_parser_using_declaration. + (cp_parser_member_declaration): Likewise. Use + cp_parser_using_declaration to look for access_declarations. + +2006-10-03 Volker Reichelt + + PR c++/29291 + * init.c (build_new): Check for invalid init. + +2006-10-02 Mark Mitchell + + PR c++/29226 + * typeck.c (cxx_sizeof_or_alignof_type): Tidy. In templates, do + not try to actually evaluate sizeof for a VLA type. + +2006-10-01 Mark Mitchell + + PR c++/29105 + * pt.c (tsubst_baselink): Substituteinto the qualifying scope. + * semantics.c (baselink_for_fns): Build a baselink, even when + processing a template. + + PR c++/29080 + * parser.c (cp_parser_postfix_dot_deref_expression): Use + BASELINK_ACCESS_BINFO as the qualifying scope when calling + adjust_result_of_qualified_name_lookup. + +2006-09-25 Lee Millward + + PR c++/27329 + PR c++/26938 + * cp-tree.h (redeclare_class_template): Adjust declaration + to return bool instead of void. + * pt.c (redeclare_class_template): Update definition. + Return false on error. + * decl.c (xref_tag): Return error_mark_node if + redeclare_class_template returned false. + + PR c++/27667 + * cp-tree.h (begin_specialization): Return bool + instead of void. + * pt.c (check_specialization_scope): Likwise. + Adjust comment. Return false if a specialization + isn't permitted in the current scope. + (begin_specialization): Use the return value of + check_specialization_scope. + * parser.c (cp_parser_explicit_specialization): If + begin_specialization returned false, skip the rest + of the specialization. + +2006-09-21 Mark Mitchell + + PR c++/29016 + * typeck.c (build_unary_op): Don't form an ADDR_EXPR around a + BASELINK. + +2006-09-21 Lee Millward + + PR c++/28861 + * decl.c (shadow_tag): Return error_mark_node + if maybe_process_partial_specialization failed. + + PR c++/28303 + * decl.c (grokdeclarator): Return error_mark_node on + declaration with two or more data types. + +2006-09-20 Danny Smith + + PR target/27650 + * class.c (check_for_override): Remove dllimport from virtual + methods. + +2006-09-18 Steven Bosscher + + PR c++/29087 + * parser.c (cp_parser_labeled_statement): Return nothing. Do + not take in_statement_expr and in_compound as arguments. Rename + to cp_parser_label_for_labeled_statement. Parse only the label, + not the statement. + (cp_parser_statement): Parse the statement of a labeled-statement + from here, using tail recursion. + +2006-09-14 Andrew Pinski + + PR C++/29002 + * init.c (build_zero_init): If we have an error mark node for + the array size, return. + +2006-09-10 Mark Mitchell + + PR c++/28991 + * cp-objcp-common.c (cxx_staticp): New function. + * cp-objcp-common.h (LANG_HOOOKS_STATICP): Use it. + * cp-tree.h (cxx_staticp): New function. + +2006-09-09 Jason Merrill + + PR c++/28996 + * cvt.c (convert_to_void): Strip COMPONENT_REF to functions. + +2006-09-08 Volker Reichelt + + PR c++/28858 + * parser.c (cp_parser_skip_until_found): Rename to + cp_parser_skip_to_end_of_template_parameter_list. Remove last two + parameters. Track levels of '< ... >'. Stop at '{', '}', or ';'. + Reorganize. Adjust comment. + (cp_parser_template_declaration_after_export): Adjust call. + (cp_parser_enclosed_template_argument_list): Likewise. + +2006-09-07 Andrew Pinski + + PR C++/28906 + * init.c (build_new_1): Build a distinct type copy + for the array type that was returned from + build_cplus_array_type. + +2006-09-07 Jason Merrill + + PR c++/27371 + * cvt.c (convert_to_void): Enable previous change. + + PR c++/26957 + * method.c (use_thunk): Clear DECL_HAS_VALUE_EXPR_P on copied + parms. + +2006-09-07 Simon Martin + + PR c++/28284 + * pt.c (fold_non_dependent_expr): Make sure expr is not + dereferenced if it is NULL. + +2006-09-06 Zak Kipling + + PR c++/26195 + * decl.c (make_rtl_for_nonlocal_decl), + (start_preparsed_function): Don't use lbasename on + input_filename when calling get_fileinfo. + * semantics.c (begin_class_definition): Likewise. + * lex.c (cxx_make_type): Likewise. + (handle_pragma_interface): Call get_fileinfo on input_filename, + not on the parameter to the directive. + +2006-09-06 Mark Mitchell + + PR c++/28903 + * pt.c (tsubst): Use fold_non_dependent_expr to fold array + dimensions. + + PR c++/28886 + * pt.c (unify): Avoid unnecessary calls to fold_build2 for array + dimensions. + +2006-09-06 Jason Merrill + + PR c++/27371 + * cvt.c (convert_to_void): Strip useless TARGET_EXPR. + * cp-tree.h (TARGET_EXPR_IMPLICIT_P): New macro. + * tree.c (build_cplus_new): Set it. + + PR c++/26696 + * cvt.c (convert_to_void): Replace a subexpression with no side + effects with void_zero_node. + * tree.c (is_overloaded_fn): Look through COMPONENT_REF. + (get_first_fn): Ditto. + * decl.c (grokdeclarator): No need to look through COMPONENT_REF. + +2006-09-05 Jason Merrill + + PR c++/26571 + * parser.c (cp_parser_diagnose_invalid_type_name): Handle the case + where the name is a type used incorrectly. + + PR c++/26671 + * typeck.c (maybe_warn_about_returning_address_of_local): Look + through COMPONENT_REF and ARRAY_REF. + + PR c++/26102 + * name-lookup.c (do_class_using_decl): Try to find the base even + if bases_dependent_p. + * pt.c (type_dependent_expression_p): A USING_DECL is dependent. + + PR c++/19809 + * pt.c (tsubst_friend_function): Set DECL_INITIAL before pushdecl. + +2006-09-04 Nathan Sidwell + + PR 23287 Revert my 2006-09-01 patch. + * parser.c: Reverted. + * pt.c: Reverted. + +2006-09-02 Lee Millward + + PR c++/27670 + PR c++/27493 + PR c++/27494 + PR c++/27397 + * parser.c (cp_parser_template_parameter_list): Add + invalid template parameters to the parameter list as + error_mark_node. + +2006-09-02 Jakub Jelinek + + PR c++/28878 + * except.c (build_throw): Only set current_function_returns_abnormally + if cfun is not NULL. + + PR c++/26917 + * repo.c (repo_file): Remove. + (open_repo_file, reopen_repo_file_for_write): Return fopened + FILE * instead of setting global repo_file variable. + (init_repo): Adjust caller. + (finish_repo): Likewise. Return instead of goto out before + reopen_repo_file_for_write has been called. + +2006-09-01 Nathan Sidwell + + PR c++/28705 + * semantics.c (finish_call_expr): Add assert. + * name-lookup.c (lookup_arg_dependent): Check we found an overload + or an object. + + PR c++/23287 + * parser.c (cp_parser_id_expression): Add member_p + argument. Update all callers. + (cp_parser_unqualified_id): Likewise. Lookup a destructor name in + the object's scope, if valid. + (cp_parser_global_scope_opt): Add object_scope_valid_p. Update + callers. + (cp_parser_postfix_dot_deref_expression): Set object_scope. + * pt.c (tsubst_copy_and_build): Lookup dependent dtor name here. + +2006-08-30 Jason Merrill + + PR c++/26670 + * class.c (check_field_decls): Don't unset TYPE_PACKED until all + the fields have been processed. + +2006-08-29 Andrew Pinski + + PR C++/28349 + * call.c (build_x_va_arg): Remove the reference type + from the type before creating the pointer type. + +2006-08-29 J"orn Rennecke + + PR c++/28139 + * except.c (expand_start_catch_block): Use correct types for bitwise + copy. + +2006-08-28 Jason Merrill + + PR c++/26670 + * class.c (check_field_decls): Unset TYPE_PACKED (t) if one of the + fields can't be packed. + + PR c++/26577 + * cvt.c (convert_to_void): Don't automatically load from volatiles + of TREE_ADDRESSABLE type. + +2006-08-28 Volker Reichelt + + PR c++/28860 + * cp-tree.h (maybe_process_partial_specialization): Return + tree instead of void. + * parser.c (cp_parser_class_head): Use return value of + maybe_process_partial_specialization. + * pt.c (maybe_process_partial_specialization): Return error_mark_node + for broken specializations, TYPE otherwise. Check for template + template parameters. + +2006-08-27 Mark Mitchell + + PR c++/28058 + * pt.c (register_specialization): Return error_mark_node for + specialization-after-instantiation. + * decl2.c (mark_used): Mark the main function used when one of its + clones is used. + +2006-08-27 Lee Millward + + PR c++/26573 + * class.c (check_field_decls): Don't issue error about + local classes containing static data members. + +2006-08-26 Joseph S. Myers + + PR c++/24009 + * parser.c (struct cp_token): Add input_file_stack_index. + (eof_token): Update. + (cp_lexer_get_preprocessor_token): Save input_file_stack_tick. + (cp_lexer_set_source_position_from_token): Restore input file + stack. + +2006-08-26 Lee Millward + + PR c++/28736 + PR c++/28737 + PR c++/28738 + * pt.c (process_template_parm): Store invalid template + parameters as a TREE_LIST with a TREE_VALUE of error_mark_node. + (push_inline_template_parms_recursive): Check for template + parameters having a TREE_VALUE of error_mark_node rather than + check the parameter itself. + (mangle_class_name_for_template): Likewise. + (comp_template_parms): When comparing the individual template + parameters, return 1 if either is error_mark_node. + (current_template_args): Robustify. + (redeclare_class_template): Likewise. + +2006-08-26 Mark Mitchell + + PR c++/28588 + * class.c (resolve_address_of_overloaded_function): Add + access_path parameter. Perform access checks. + (instantiate_type): Adjust call to + resolve_address_of_overloaded_function. Remove unnecessary code. + * tree.c (is_overloaded_fn): Document. Return 2 when there are + acutally multiple functions. + (really_overloaded_fn): Use is_overloaded_fn. + * mangle.c (write_expression): Handle BASELINKs. + * cp-tree.h (really_overloaded_fn): Return bool. + (baselink_for_fns): Declare. + * search.c (lookup_member): Check access for single static + functions here. + * pt.c (convert_nontype_argument_function): Handle BASELINKs. + (tsubst_copy_and_build): Generate BASELINKs for template-ids. + * semantics.c (finish_call_expr): Use baselink_for_fns. + (baselink_for_fns): New function. + (finish_id_expression): Use it. + * parser.c (cp_parser_template_argument): Don't strip BASELINKs. + + PR c++/28595 + * pt.c (tsubst): Issue errors about attempts to create VLAs at + template-instantiation time. + +2006-08-25 Volker Reichelt + + PR c++/28853 + * typeck2.c (cxx_incomplete_type_diagnostic): Handle template + template parameters. Improve error message for template type + parameters. + + PR c++/28852 + * cp-tree.h (grok_op_properties): Return bool instead of void. + * decl.c (grokfndecl): Discard invalid operator declarations. + (copy_fn_p): Revert change for PR 27547. + (grok_op_properties): Return error status (true on success). + * pt.c (tsubst_decl): Discard invalid operator declarations. + +2006-08-25 Mark Mitchell + + PR c++/28056 + * decl.c (grokdeclarator): Disallow declarations with qualified + names in local scopes. + +2006-08-25 Nathan Sidwell + + PR c++/27787 + * decl.c (make_typename_type): Only try and resolve it when + context is not dependent. Refactor. + * decl2.c (check_classfn): Push to class scope before looking for + the function. + +2006-08-24 Danny Smith + + PR driver/28528 + * g++spec.c (lang_specific_driver): Always check if we need to + swallow a space-separated arg to '-x'. + * lang-specs.h: Don't create ouput files for '-xc++-header' + if -fsyntax-only. + +2006-08-23 Jason Merrill + + PR c++/27714 + * pt.c (push_template_decl_real): A friend template with class + scope isn't primary. + +2006-08-23 Benjamin Smedberg + + PR c++/28687 + * rtti.c (build_dynamic_cast, build_dynamic_cast_1): + Move -fno-rtti check to be more specific. + +2006-08-22 Jason Merrill + + PR c++/23372 + * call.c (build_over_call): Don't make a copy here if build_call + will make one too. + +2006-08-22 Andrew Pinski + + PR C++/28450 + * cp/init.c (build_zero_init): Handle VECTOR_TYPE and + COMPLEX_TYPEs. + +2006-08-22 Simon Martin + + PR c++/28420 + * parser.c (cp_parser_postfix_expression): Make sure that the + saved value for parser->type_definition_forbidden_message is + restored before returning to avoid an invalid free(). + +2006-08-22 Jason Merrill + + PR c++/28659 + * typeck.c (merge_types): If either of the types have the right + attributes, return that one. + + * tree.c (cp_build_type_attribute_variant): Make sure we aren't + doing this to class types. + * typeck.c (original_type): Deal with type quals properly. + +2006-08-21 Jason Merrill + + PR c++/27115 + * semantics.c (finish_stmt_expr_expr): Don't try to voidify here, + just leave the expression as it is. + (finish_stmt_expr): If the statement-expression has class type, + wrap it in a TARGET_EXPR. + * cp-gimplify.c (cp_gimplify_init_expr): Don't bother with + CLEANUP_POINT_EXPR. + * except.c (build_throw): Give the CLEANUP_POINT_EXPR void type. + +2006-08-21 Lee Millward + + PR c++/26269 + * decl.c (duplicate_decls): Return early if either + newdecl or olddecl is error_mark_node. + + PR c++/28505 + * decl.c (grokdeclarator): Return early after + issuing diagnostic about an incomplete type. + + PR c++/28741 + * tree.c (decl_anon_ns_mem_p): Robustify. + * decl2.c (determine_visibility): Likewise. + +2006-08-20 Mark Mitchell + + PR c++/28341 + * tree.c (cast_valid_in_integral_constant_expression_p): New + function. + * cp-tree.h (tsubst_copy_and_build): Adjust prototype. + * pt.c (tsubst_expr): Add integral_constant_expression_p + parameter. + (fold_non_dependent_expr): Adjust callers of + tsubst_{expr,copy_and_build}. + (tsubst_friend_function): Likewise. + (tsubst_template_arg): Likewise. + (tsubst_default_argument): Likewise. + (tsubst_decl): Likewise. + (tsubst): Likewise. + (tsubst_omp_clasuses): Likewise. + (regenerate_decl_fromp_template): Likewise. + (instantiate_decl): Likewise. + (tsubst_initializer_list): Likewise. + (tsubst_enum): Likewise. + (tsubst_expr): Use RECUR throughout. + (tsubst_copy_and_build): Change definition of RECUR. Do not allow + invalid casts in integral constant expressions. + * parser.c (cp_parser_postfix_expression): Use + cast_valid_in_integral_constant_expression_p. + (cp_parser_cast_expression): Likewise. + (cp_parser_functional_cast): Likewise. + + PR c++/28346 + * pt.c (tsubst_qualified_id): Do not strip references from + OFFSET_REFs. + +2006-08-17 Volker Reichelt + + PR c++/28606 + * parser.c (cp_parser_diagnose_invalid_type_name): Handle BIT_NOT_EXPR. + Fix formatting. + (cp_parser_parse_and_diagnose_invalid_type_name): Tighten condition + for valid type-names. + (cp_parser_unqualified_id): Fix error handling for destructors. + + PR c++/28710 + * decl.c (xref_tag): Improve error message. Return early on error. + + PR c++/28711 + * pt.c (tsubst_copy_and_build) : Robustify. + +2006-08-17 Paolo Bonzini + + PR c++/28573 + * semantics.c (finish_offsetof): Add new argument to fold_offsetof. + +2006-08-16 Andrew Pinski + + PR c++/28302 + * typeck.c (build_unary_op ): Don't call + perform_integral_promotions for non integral type. + +2006-08-16 Jason Merrill + + PR c++/28385 + * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Ignore quals from template + if arg is a function. + +2006-08-16 Volker Reichelt + + PR c++/28593 + * init.c (build_new): Return early on invalid placement. + +2006-08-15 Lee Millward + + PR c++/28594 + * pt.c (process_template_parm): Robustify. + +2006-08-14 Steve Ellcey + + PR c++/28288 + PR c++/14556 + * operators.def: Remove , ?= operators. + * parser.c: Remove CPP_MIN, CPP_MAX, CPP_MIN_EQ, and CPP_MAX_EQ. + (cp_parser_warn_min_max): Remove. + +2006-08-11 Jason Merrill + + PR c++/28559 + * parser.c (cp_parser_elaborated_type_specifier): Also ignore + attributes applied to a TYPENAME_TYPE. + +2006-08-09 Lee Millward + + PR c++/28637 + * pt.c (coerce_template_parms): Copy across the + invalid template arguments to the new template inner arguments. + (retrieve_specialization): Robustify. + + PR c++/28638 + * pt.c (coerce_template_template_parms): Robustify. + + PR c++/28639 + * error.c (dump_template_parms): Robustify. + + PR c++/28640 + * pt.c (redeclare_class_template): Robustify. + + PR c++/28641 + * pt.c (type_unification_real): Robustify. + +2006-08-03 Lee Millward + + PR c++/28347 + * decl.c (start_decl): Return error_mark_node if a + diagnostic was issed for an invalid typedef initialization. + +2006-08-03 Volker Reichelt + + PR c++/27508 + * parser.c (cp_parser_unqualified_id): Check for invalid scopes + when parsing destructor names. + + PR c++/28274 + * decl.c (duplicate_decls): Call check_default_args here. + (start_preparsed_function): Do not call check_default_args. + * name-lookup.c (pushdecl_maybe_friend): Only call + check_default_args if duplicate_decls got bypassed. + +2006-08-02 Richard Guenther + + PR c++/28479 + Revert + 2006-07-05 Richard Guenther + Andrew Pinski + + PR c++/27084 + * cp-objcp-common.c (cxx_types_compatible_p): Ignore + top level qualifiers for pointer type comparisons. + +2006-08-02 Mark Mitchell + + PR c++/28557 + * pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE. + +2006-07-31 Mark Mitchell + + PR c++/28523 + * tree.c (stabilize_expr): Tweak documentation. Add assertion. + (stabilize_call): Tweak documentation. + (stabilize_init): Only call stabilize_call for calls. + +2006-08-01 Steve Ellcey + + PR c++/28432 + * decl2.c (check_classfn): Remove early return. + * search.c (lookup_member): Return NULL with bad type. + +2006-08-01 Steve Ellcey + + PR c++/28256 + * decl.c (check_initializer): Check for 1 initializer on scalar types. + +2006-08-01 Daniel Jacobowitz + + PR debug/23336 + * pt.c (tsubst_copy_and_build): Mark used enum types. + * semantics.c (finish_id_expression): Likewise. + +2006-07-31 Volker Reichelt + + PR c++/6634 + * decl.c (grokdeclarator): Check whether "long" or "short" was + specified for non-integral types. + +2006-07-28 Volker Reichelt + + * Make-lang.in: Use $(HEADER_H) instead of header.h in dependencies. + +2006-07-28 Lee Millward + + PR c++/27668 + PR c++/27962 + * pt.c (process_template_parm) Store invalid template + parameters as error_mark_node in the paramater list. + (push_inline_template_parms_recursive): Handle invalid + template parameters. + (comp_template_parms): Likewise. + (check_default_tmpl_arg): Likewise. + (coerce_template_template_parms): Likewise. + (mangle_class_name_for_template): Likewise. + (tsubst_template_parms): Likewise. + * error.c (dump_template_argument_list): Likewise. + +2006-07-28 Kazu Hirata + + * cp-tree.h: Fix a comment typo. + +2006-07-24 Volker Reichelt + + PR c++/27572 + * decl.c (grokdeclarator): Return error_mark_node after invalid + typedef. + +2006-07-23 Daniel Jacobowitz + + PR c++/28460 + * decl.c (grokvardecl): Use FROB_CONTEXT. + * pt.c (register_specialization): Likewise. + +2006-07-23 Mark Mitchell + + PR c++/28025 + * cp-tree.h (LOOKUP_HIDDEN): New macro. Reformat comments. + * name-lookup.c (unqualified_namespace_lookup): There is no way to + have a hidden name in non-namespace scopes. + * pt.c (tsubst_friend_class): Look for hidden names. + * decl.c (lookup_and_check_tag): Fix typo in comment. + + * semantics.c (finish_compound_literal): Fix typo in comment. + +2006-07-21 Jason Merrill + + * decl2.c (determine_visibility): Don't propagate visibility from + type to decl. + (constrain_class_visibility): Don't warn in system headers. + Don't warn about pointer fields. + +2006-07-20 Mike Stump + + * decl2.c (determine_visibility_from_class): Don't use hidden + visibility for explicit instantiations. + +2006-07-21 Volker Reichelt + + PR c++/28250 + * pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to + valid decls. Cleanup. + + PR c++/28363 + * semantics.c (check_template_template_default_arg): Simplify + error handling. + +2006-07-20 Jason Merrill + + PR c++/28407 + * decl.c (grokvardecl): Set DECL_THIS_STATIC on file-scope + const variables with implicit internal linkage. + * tree.c (decl_linkage): Only return lk_external if it's set. + + PR c++/28409 + * decl2.c (constrain_visibility): Ignore the anonymous namespace + for extern "C" decls. + (VISIBILITY_STATIC): Rename to VISIBILITY_ANON. + + * decl2.c (constrain_visibility): Remove specified and reason + parameters. Don't touch decls that already have explicit visibility. + (determine_visibility): Do copy DECL_VISIBILITY_SPECIFIED from + template. + (determine_visibility_from_class): Reverse sense of + DECL_VISIBILITY_SPECIFIED test for target-specific visibility rules. + (constrain_class_visibility): Only complain about member visibility + if the member type is another class. Don't change visibility of the + current class. + +2006-07-19 Mark Mitchell + + PR c++/28338 + * decl.c (layout_var_decl): Don't call push_local_name here. + (initialize_artificial_var): Assert artificiality. + (cp_finish_decl): Call push_local_name here. + +2006-07-18 Mark Mitchell + + PR c++/28337 + * typeck.c (build_binary_op): Short-circuit pointer arithmetic in + templates. + +2006-07-18 Mark Mitchell + + PR c++/28048 + * semantics.c (check_accessibility_of_qualified_id): Robustify. + + PR c++/28235 + * pt.c (tsubst_decl): Handling substitutions into a static data + member from within the scope of the tempalte itself. + +2006-07-18 Lee Millward + + PR c++/28258 + * method.c (locate_copy): Check for non_reference + returning error_mark_node. + + PR c++/28260 + * decl.c (duplicate_decls): Return error_mark_node + on ambiguous declaration. + +2006-07-18 Steve Ellcey + + PR c++/27495 + * search.c (adjust_result_of_qualified_name_lookup): Change + assert to part of if statement. + +2006-07-17 Steve Ellcey + + PR c++/28291 + * decl.c (reshape_init_class): Return error_mark_node on error. + +2006-07-17 Steve Ellcey + + PR c++/28304 + * decl2.c (check_classfn): Return NULL_TREE on error. + +2006-07-17 Volker Reichelt + + PR c++/28250 + * name-lookup.c (pushdecl_maybe_friend): Return early on + error_mark_node. + * except.c (expand_start_catch_block): Use error_mark_node instead + of NULL_TREE for invalid decls. + * parser.c (cp_parser_exception_declaration): Return error_mark_node + on invalid catch parameter. Simplify. + +2006-07-16 Jakub Jelinek + + PR c++/28370 + * decl2.c (note_vague_linkage_var): Removed. + (finish_static_data_member_decl): Add decl to pending_statics vector + directly. Do it even for non-public decls. + +2006-07-15 Lee Millward + + PR c++/28292 + * decl2.c (acceptable_java_type): Robustify. Use + proper Boolean return type instead of return 1. + (check_java_method): Don't issue error about + type not being an acceptable Java parameter if + it's error_mark_node. + + PR c++/28269 + * parser.c (cp_parser_elaborated_type_specifier): + Return early if an invalid type was detected. + +2006-07-15 Volker Reichelt + + PR c++/28249 + * parser.c (cp_parser_check_decl_spec): New function. + (cp_parser_decl_specifier_seq): Factor out check for repeated + decl-specifiers into cp_parser_check_decl_spec. Use it. + (cp_parser_type_specifier_seq): Use it. + + PR c++/28294 + * semantics.c (finish_offsetof): Use TREE_OPERAND for COMPONENT_REFs + only. + + PR c++/28387 + * decl2.c (cplus_decl_attributes): Check for invalid decls. + +2006-07-14 Volker Reichelt + + PR c++/28343 + * decl.c (cp_finish_decl): Check asmspec_tree for error_mark_node. + * decl2.c (grokfield): Likewise. + +2006-07-12 Geoffrey Keating + + * decl2.c (determine_visibility): Don't change visibility of + function locals because of -fvisibility-inlines-hidden. + +2006-07-12 Jason Merrill + + PR c++/28217 + * semantics.c (note_decl_for_pch): Don't premangle templates. + +2006-07-12 Martin Michlmayr + + * typeck.c (string_conv_p): Remove spurious quotation mark in + warning. + +2006-07-07 Lee Millward + Andrew Pinski + + PR c++/27820 + * decl.c (define_label): Return error_mark_node on error. + * semantics.c (finish_label_stmt): Don't call + add_stmt for invalid labels. + +2006-07-06 Jason Merrill + + PR c++/28279 + * decl2.c (finish_static_data_member_decl): Don't assert + TREE_PUBLIC. + +2006-07-05 Jason Merrill + + PR c++/13983 + PR c++/17519 + * class.c (check_field_decls): Check TYPE_PACKED after + stripping array types. + (finish_struct_bits): Don't copy TYPE_SIZE here. + + PR c++/18681 + * friend.c (is_friend): Fix DR 45 implementation. + +2006-07-05 Richard Guenther + Andrew Pinski + + PR c++/27084 + * cp-objcp-common.c (cxx_types_compatible_p): Ignore + top level qualifiers for pointer type comparisons. + +2006-07-01 Jason Merrill + + PR c++/28215 + * method.c (make_thunk): Unset DECL_USE_TEMPLATE and + DECL_TEMPLATE_INFO. + +2006-06-30 Jason Merrill + + PR c++/26577 + * call.c (build_new_method_call): Force evaluation of the + instance pointer, not the object. + +2006-06-30 Kazu Hirata + + * decl2.c: Fix a comment typo. + +2006-06-30 Jason Merrill + + PR c++/18698 + * decl2.c (grokfield): Only try to treat the decl as an access + declaration if the scope is a class. + +2006-06-29 Jason Merrill + + PR c++/26905 + PR c++/26612 + PR c++/27000 + PR c++/26984 + PR c++/19134 + * decl2.c (determine_visibility): Overhaul. + (determine_visibility_from_class): Likewise. + (min_vis_r, type_visibility, constrain_visibility): New fns. + (constrain_visibility_for_template): Likewise. + (constrain_class_visibility): Likewise. + * decl.c (cp_finish_decl): Call determine_visibility for function + decls, too. + * name-lookup.c (pushtag): Call determine_visibility. + * decl.c (duplicate_decls): Don't copy visibility from template to + specialization. + * pt.c (check_explicit_specialization): Likewise. + (lookup_template_class, tsubst_decl): Call determine_visibility. + * class.c (finish_struct_1): Call constrain_class_visibility. + + PR c++/26905 + PR c++/21675 + PR c++/17470 + * parser.c (cp_parser_explicit_instantiation): Pass the attributes + to grokdeclarator. + (cp_parser_type_specifier): Allow 'enum __attribute ((...)) E'. + (cp_parser_enum_specifier): Likewise. + (cp_parser_elaborated_type_specifier): Apply attributes if this + declares only the class. + (cp_parser_class_specifier): Apply leading attributes immediately. + * semantics.c (begin_class_definition): Add attributes parameter, + apply them to the type. + + PR c++/21581 + PR c++/25915 + * tree.c (decl_anon_ns_mem_p): New function. + * cp-tree.h: Declare it. + * decl2.c (determine_visibility): Make anonymous namespace + members static. + (min_vis_r, constrain_visibility): Likewise. + * rtti.c (create_pseudo_type_info): Set TREE_PUBLIC on + pseudo-types. + * decl.c (cxx_init_decl_processing): Set TREE_PUBLIC on + global_namespace. + * name-lookup.c (push_namespace_with_attribs): Don't set TREE_PUBLIC + on anonymous namespaces. + +2006-06-28 Jason Merrill + + PR c++/27424 + * pt.c (convert_template_argument): Pass all template arguments + on to coerce_template_template_parms. + +2006-06-25 Lee Millward + Mark Mitchell + + PR c++/28054 + * decl2.c (grokbitfied): Remove check for grokdeclarator + returning NULL_TREE, instead check for error_mark_node + to indicate failure. + * decl.c (grokdeclarator): Adjust block comment. + +2006-06-25 Lee Millward + + PR c++/28051 + * mangle.c (mangle_conv_op_name_for_type): Check for + invalid types. + * name-lookup.c (push_class_level_binding): Robustify. + (do_class_using_decl): Return early if name is error_mark_node. + +2006-06-23 Steve Ellcey + + PR c++/28114 + * name-lookup.c (pushtag): Return if we have error_mark_node. + +2006-06-23 Steve Ellcey + + PR c++/27019 + * typeck2.c (process_init_constructor_array): Set ce->value on errors. + +2006-06-23 Volker Reichelt + + PR c++/28112 + * parser.c (cp_parser_attribute_list): Skip attributes with invalid + arguments. Fix comment. + + PR c++/11468 + * init.c (build_new_1): Handle error_mark_nodes returned by + build_java_class_ref. + (build_java_class_ref): Do not abort compilation, but return + error_mark_node. Improve error message. Fix indentation. + +2006-06-23 Danny Smith + + PR target/27789 + * decl.c (start_decl): Check that dllimports are not initialized. + +2006-06-22 Lee Millward + + PR c++/27805 + * typeck2.c (build_m_component_ref): Use error_operand_p. + + PR c++/27821 + * decl.c (grokdeclarator): Return error_mark_node on + invalid uses of the scope resolution operator. + +2006-06-22 Volker Reichelt + + PR c++/28111 + * pt.c (determine_specialization): Check for invalid decls. + + PR c++/28110 + * pt.c (unify) : Check for invalid + parameters. + + PR c++/28109 + * rtti.c (get_tinfo_decl_dynamic): Robustify. + +2006-06-20 Volker Reichelt + + PR c++/28052 + * init.c (push_base_cleanups): Skip members with invalid types. + * typeck.c (build_class_member_access_expr): Robustify. + +2006-06-19 Mark Mitchell + + * pt.c (instantiate_template): Fix typo in comment. + +2006-06-19 Richard Guenther + + * parser.c (CP_LEXER_BUFFER_SIZE): Adjust to assure near + power-of-two token vector size. + +2006-06-16 Mark Mitchell + + PR c++/28016 + * decl.c (cp_finsh_decl): Do not emit uninstantiated static data + members. + + PR c++/27979 + * call.c (standard_conversion): Strip cv-qualifiers from bitfield + types. + + PR c++/27884 + * decl.c (have_extern_spec): Remove. + (start_decl): Do not check have_extern_spec. + (start_function): Likewise. + * cp-tree.h (have_extern_spec): Remove. + * parser.c (cp_parser_linkage_specification): Don't set + have_extern_spec. + (cp_parser_init_declarator): Likewise. + (cp_parser_parameter_declaration): Do not treat parameters as + within the scope of an unbraced linkage specification. + +2006-06-15 Mark Mitchell + + PR c++/27689 + * cp-tree.h (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): New + macro. + * pt.c (unify): Use it. + + PR c++/27666 + * call.c (build_conditional_expr): Robustify. + + PR c++/27640 + * pt.c (instantiate_template): Set processing_template_decl to + zero while performing substitutions. + +2006-06-14 Mark Mitchell + + PR c++/27665 + * parser.c (cp_parser_unqualified_id): Use constructor_name_p to + identify destructors. + (cp_parser_nested_name_specifier_opt): Remove invalid + optimization. + (cp_parser_template_id): Refine heuristic for determining whether + we are entering a scope. + + PR c++/27648 + * parser.c (cp_parser_declarator): Robustify. + + PR c++/26559 + * pt.c (tsubst_expr): Use finish_omp_atomic. + (value_dependent_expression_p): All CALL_EXPRs are dependent. + * semantics.c (finish_omp_atomic): Rework to use standard + paradigms for handling non-dependent expressions. + +2006-06-14 Gabriel Dos Reis + + * typeck.c (build_modify_expr): Tidy diagnostic message. + +2006-06-14 Mark Mitchell + + PR c++/28018 + * typeck.c (build_modify_expr): Disallow array assignment. + +2006-06-14 Gabriel Dos Reis + + * cp-tree.def: Fix typo. + +2006-06-13 Mark Mitchell + + PR c++/27227 + * decl.c (decls_match): Allow an extern "C" variable declarations + from different namespaces to match. + (duplicate_decls): Disallow redeclaring a variable with a + different linkage specification. + +2006-06-13 Jakub Jelinek + + PR middle-end/27793 + * cp-tree.h (cxx_int_tree_map): New struct. + (struct language_function): Add extern_decl_map field. + * name-lookup.c (pushdecl_maybe_friend): Add x -> t mapping + to cp_function_chain->extern_decl_map hash table instead of + copying over DECL_UID. + * cp-gimplify.c (cxx_int_tree_map_eq, cxx_int_tree_map_hash): New + functions. + (cp_genericize_r): Remap DECL_EXTERN local decls using + cp_function_chain->extern_decl_map hash table. + * decl.c (finish_function): Clear extern_decl_map. + +2006-06-12 Volker Reichelt + + PR c++/27601 + * semantics.c (finish_offsetof): Handle pseudo-destructors. + + PR c++/27933 + * name-lookup.c (lookup_qualified_name): Always return error_mark_node + if lookup fails. + + PR c++/27951 + * decl2.c (finish_anon_union): Return early if build_anon_union_vars + fails. + +2006-06-12 Roger Sayle + + PR c++/21210 + * typeck2.c (build_functional_cast): Use cp_convert to construct + non-aggregate initializers instead of the user-level build_c_cast. + +2006-06-07 Volker Reichelt + + PR c++/27601 + * cp-tree.h (finish_offsetof): Add prototype. + * semantics.c (finish_offsetof): New function. + * parser.c (cp_parser_builtin_offsetof): Call it instead of + fold_offsetof. + * pt.c (tsubst_copy_and_build): Likewise. + +2006-06-06 Mark Mitchell + + PR c++/27177 + * call.c (standard_conversion): Require that the derived type be + complete when performing a derived-to-base conversion. + +2006-06-04 Mark Mitchell + + PR c++/27819 + * decl.c (cp_finish_decl): Process initializers for static data + members with non-dependent initializers, even in templates. + + PR c++/27722 + * decl.c (maybe_deduce_size_from_array_init): If the declaration + is erroneous, give it an erroneous type. + (layout_var_decl): If the type is erroneous, give up. + (check_initializer): Likewise. + + PR c++/27807 + * cp-tree.h (TYPE_OBJ_P): New macro. + (TYPE_PTROB_P): Use it. + (TYPE_REF_OBJ_P): Likewise. + * semantics.c (finish_compound_literal): Do not permit compound + literals of non-object types. + + PR c++/27806 + * typeck.c (original_type): Robustify. + +2006-06-05 Volker Reichelt + + PR c++/27804 + * init.c (constant_value_1): Return decl instead of error_mark_node + for invalid initializers. + +2006-06-01 Andrew Pinski + + PR c++/27592 + * rtti.c (build_dynamic_cast_1): Call c_common_truthvalue_conversion + on operand of the COND_EXPR for the null pointer check. + +2006-06-01 Andrew Pinski + + PR c++/26740 + * typeck.c (build_unary_op): Mark the function as being used. + +2006-06-01 Alexandre Oliva + + PR c++/26660 + * parser.c (cp_parser_initial_pragma): Read one more token for + caller after reading PCH file in. + +2006-05-31 Mark Mitchell + + PR c++/27801 + * call.c (perform_implicit_conversion): Do not actually perform + conversions in templates. + + PR c++/26496 + * call.c (resolve_args): Check for invalid uses of bound + non-static member functions. + * init.c (build_offset_ref): Return error_mark_node for errors. + + PR c++/27385 + * decl.c (reshape_init): Robustify. + (reshape_init_array_1): Likewise. + +2006-05-30 Mark Mitchell + + PR c++/27808 + * parser.c (cp_parser_decl_specifier_seq): Issue errors about + "friend" specifiers that do not appear in class scopes. + + PR c++/27803 + * class.c (check_bitfield_decl): Ensure that all bitfields have + integral type. + +2006-05-29 Kazu Hirata + + * pt.c (convert_nontype_argument): Fix a typo in an error + message. + +2006-05-28 Kazu Hirata + + * decl.c, decl2.c, parser.c: Fix comment typos. Follow + spelling conventions. + +2006-05-24 Mark Mitchell + + PR c++/20103 + * decl.c (cp_make_fname_decl): Don't set DECL_INITIAL to + error_mark_node to indicate an initialization is OK. + (start_decl): Likewise. Adjust call to start_decl_1. + (start_decl_1): Add initialized parameter. Simplify. + * except.c (initialize_handler_parm): Adjust call to + setart_decl_1. + (expand_start_catch_block): Let cp_finish_decl initialize catch + parameters. + * cp-tree.h (start_decl_1): Adjust prototype. + * pt.c (tsubst_expr): Don't set DECL_INITIAL to error_mark_node. + (instantiate_decl): Let cp_finish_decl handle initialization. + * semantics.c (finish_compound_literal): Create a temporary + variable for the literal. + * typeck.c (build_unary_op): Remove COMPOUND_LITERAL_P special + cases. + * decl2.c (finish_static_data_member_decl): Don't set + DECL_INITIAL. + (grokfield): Do not try to initialize functions. + +2006-05-23 Mark Mitchell + + PR c++/20173 + * pt.c (determine_specialization): Disallow partial + specializations of templates. + +2006-05-22 Volker Reichelt + + PR c++/27716 + * typeck.c (build_modify_expr): Test arguments for error_operand_p. + + * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE. + +2006-05-21 Mark Mitchell + + PR c++/27210 + * cp-tree.h (cp_save_expr): New function. + * init.c (build_new): Correct logic for zero-element array + warning. Use cp_save_expr. + * tree.c (cp_save_expr): New function. + +2006-05-21 Volker Reichelt + + PR c++/27398 + * decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE + or void_type_node. + +2006-05-19 Mike Stump + + * typeck.c (default_conversion): Remove static. + +2006-05-19 Mark Mitchell + + PR c++/26433 + * cp-tree.h (begin_function_try_block): Change prototype. + (finish_function_handler_sequence): Likewise. + * parser.c (cp_parser_function_try_block): Adjust calls. + * pt.c (tsubst_expr): Adjust calls. + * semantics.c (begin_function_try_block): Create an artificial + outer scope. + (finish_function_handler_sequence): Close it. + +2006-05-18 Mark Mitchell + + PR c++/27471 + PR c++/27506 + * typeck.c (decay_conversion): Convert bitfields to their declared + types here. Improve documentation. Avoid use of cp_convert. + (default_conversion): Make it static. Perform integral promotions + before lvalue-to-rvalue, function-to-pointer, and array-to-pointer + conversions. + * init.c (build_init): Remove. + (expand_default_init): Do not call rvalue. + * call.c (null_ptr_cst_p): Robustify. + (build_conditional_expr): Tidy. + * except.c (build_throw): Do not perform lvalue-to-rvalue + conversion on operand before initializing temporary. + * tree.c (convert.h): Include it. + (convert_bitfield_to_declared_type): Use convert_to_integer, not + cp_convert. + (rvalue): Don't convert bitfields to their declared type here. + * cp-tree.h (build_init): Remove. + (default_conversion): Likewise. + * typeck2.c (build_m_component_ref): Do not perform + lvalue-to-rvalue, function-to-pointer, or array-to-pointer + conversions here. Correct error message. + +2006-05-17 Mark Mitchell + + PR c++/26122 + * decl2.c (check_member_template): Remove checks for virtual + functions. + * parser.c (cp_parser_function_specifier_opt): Complain about + virtual templates. + (cp_parser_pure_specifier): Likewise. + + PR c++/26068 + * parser.c (cp_parser_set_storage_class): Check for + invalid uses of storage classes on unbraced linkage + specifications. + (cp_parser_decl_specifier_seq): Pass keywords, not storage classes, + to cp_parser_set_storage_class. + +2006-05-17 Jakub Jelinek + + PR c++/27491 + * semantics.c (finish_compound_literal): Only set TREE_HAS_CONSTRUCTOR + on CONSTRUCTORs. + + PR middle-end/27415 + * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED + on combined parallel workshare constructs. + * pt.c (tsubst_expr): Copy OMP_PARALLEL_COMBINED flag. + +2006-05-16 H.J. Lu + + PR driver/26885 + * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS). + +2006-05-15 Mark Mitchell + + PR c++/27339 + * cp-tree.h (perform_access_checks): New function. + * semantics.c (perform_access_checks): New function. + (perform_deferred_access_checks): Use it. + * parser.c (cp_parser_simple_declaration): Adjust call to + cp_parser_init_declarator. + (cp_parser_type_parameter): Do not defer checks in default + arguments. + (cp_parser_explicit_specialization): Adjust call to + cp_parser_single_declaration. + (cp_parser_init_declarator): Perform template-parameter access + checks. + (cp_parser_parameter_declaration): Do not defer checks for + template parameter default arguments. + (cp_parser_template_declaration_after_export): Gather access + checks for template parameters, and pass them to + cp_parser_single_declaration. + (cp_parser_template_parameter_access_checks): New function. + (cp_parser_single_declaration): Add checks parameter. + + PR c++/27505 + * call.c (convert_like_real): Convert bitfields to their declared + types when forming an rvalue. + * tree.c (convert_bitfield_to_declared_type): New function. + (rvalue): Use it. + * cp-tree.h (convert_bitfield_to_declare_type): Declare it. + +2006-05-15 Volker Reichelt + + PR c++/27582 + * pt.c (any_dependent_template_arguments_p): Return early on invalid + argument list. + + PR c++/27581 + * search.c (adjust_result_of_qualified_name_lookup): Skip on + invalid context_class. + + PR c++/27315 + * pt.c (do_decl_instantiation): Return early on invalid decl. + + PR c++/27559 + * pt.c (push_template_decl_real): Return error_mark_node instead + of broken decl. + + PR c++/27496 + * pt.c (tsubst_friend_class): Return early on invalid friend + declarations. + +2006-05-14 H.J. Lu + + * Make-lang.in (cp/decl.o): Add dependency on $(TARGET_H). + (cp/decl2.o): Likewise. + (cp/typeck.o): Likewise. + (cp/cvt.o): Likewise. + (cp/parser.o): Likewise. + (cp/call.o): Replace target.h with $(TARGET_H). + +2006-05-14 Alexandre Oliva + + * pt.c (build_non_dependent_expr): Leave ADDR_EXPR of + COMPONENT_REF alone. + +2006-05-11 Volker Reichelt + + PR c++/27547 + * decl.c (copy_fn_p): Return early on non-member functions. + +2006-05-08 Volker Reichelt + + PR c++/27447 + * decl2.c (build_memfn_type): Skip invalid functions and class types. + +2006-05-06 Volker Reichelt + + PR c++/27427 + * pt.c (convert_nontype_argument): Return early on invalid arguments. + + * pt.c (process_template_parm): Remove superfluous temporary. + + PR c++/27430 + * pt.c (process_template_parm): Handle erroneous non-type parameters. + + PR c++/27423 + * typeck.c (convert_for_initialization): Skip erroneous types. + + PR c++/27422 + * typeck.c (convert_arguments): Return early on args with + invalid types. + +2006-05-03 Aldy Hernandez + + PR/21391 + * typeck.c (build_static_cast_1): Save casted types in used types + hash table. + (build_reinterpret_cast_1): Same. + * rtti.c (build_dynamic_cast_1): Same. + +2006-05-04 Jakub Jelinek + + PR c++/27359 + * parser.c (cp_parser_omp_for_loop): Only call + cp_parser_abort_tentative_parse if cp_parser_parse_definitely was not + called. + +2006-05-02 Mark Mitchell + + PR c++/27102 + * decl.c (grokdeclarator): Robustify checks for defining members + of incomplete types. + + PR c++/27309 + * class.c (add_method): Call grok_special_member_properties. + * decl.c (grokdeclarator): Don't call it here. + (copy_fn_p): A TEMPLATE_DECL is never a copy constructor or + assignment operator. Set TYPE_HAS_CONSTURCTOR if DECL is a + constructor. + (start_method): Don't call grok_special_member_properties. + * method.c (implicitly_declare_fn): Likewise. + * pt.c (instantiate_class_template): Likewise. + * decl2.c (grokfield): Likewise. + +2006-05-02 Jakub Jelinek + + PR middle-end/27337 + * cp-gimplify.c (cxx_omp_privatize_by_reference): New function. + * cp-tree.h (cxx_omp_privatize_by_reference): New prototype. + * cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define. + +2006-04-30 Mark Mitchell + + PR c++/27094 + * pt.c (tsubst_default_argument): Increment function_depth around + call to tsubst_expr. + * parser.c (cp_parser_parameter_declaration): Likewise. + * decl2.c (mark_used): Tidy. + +2006-04-30 Volker Reichelt + + PR c++/27278 + * decl.c (grok_op_properties): Skip operators with invalid args + when checking for class-type or enum-type args. + +2006-04-29 Volker Reichelt + + PR c++/27279 + * decl.c (copy_fn_p): Skip functions with invalid first arg. + +2006-04-27 Mark Mitchell + + PR c++/27292 + * tree.c (rvalue): Convert bitfields to their declared types. + + PR c++/27102 + * typeck2.c (cxx_incomplete_type_diagnostic): Handle + TYPENAME_TYPE. + +2006-04-24 Mark Mitchell + + PR c++/27292 + * typeck.c (decay_conversion): Don't adjust bitfield types. + (perform_integral_promotions): Treat bitfield enums as enums, not + as short integer types. + * tree.c (rvalue): Convert bitfields to their correct types. + +2006-04-24 Volker Reichelt + + PR c++/19963 + * class.c (layout_class_type): Skip fields with invalid types. + +2006-04-23 Mark Mitchell + + PR c++/26912 + * cp-tree.h (build_this_parm): Declare. + (grok_method_quals): Remove. + (build_memfn_type): Declare. + (build_artificial_parm): Declare. + (do_friend): Remove quals parameter. + * decl.c (build_this_parm): New function. + (grokfndecl): Use it. Do not pass quals to grokclassfn. + (grokdeclarator): Rename quals to memfn_quals. Avoid allocating + unnecessary TYPE_DECLs. Correct qualification of member function + types. Tidy. + * method.c (implicitly_declare_fn): Use build_this_parm. + * friend.c (do_friend): Remove quals parameter. + * decl2.c (grok_method_quals): Remove. + (build_memfn_type): New function. + (build_artificial_parm): Give it external linkage. + (grokclassfn): Remove quals parameter. Do not build "this" + PARM_DECL here. + + PR c++/26534 + * cp-tree.h (is_bitfield_expr_with_lowered_type): New function. + * typeck.c (is_bitfield_expr_with_lowered_type): New function. + (decay_conversion): Convert bitfield expressions to the correct + type. + (build_modify_expr): Remove spurious conversions. + * class.c (layout_class_type): Modify the type of bitfields to + indicate a limited range. + * call.c (standard_conversion): Adjust the type of bitfield + expressions used in an rvalue context. + (build_conditional_expr): Likewise. + +2006-04-22 Kazu Hirata + + * decl.c: Fix comment typos. + +2006-04-21 Eric Christopher + + * decl.c: Fix typo in function name. + +2006-04-19 Volker Reichelt + + PR c++/26558 + * parser.c (cp_parser_class_name): Check for invalid typenames. + Rearrange code. + + PR c++/26739 + * pt.c (tsubst_friend_function): Return early if + pushdecl_namespace_level fails. + + PR c++/26036 + * typeck.c (convert_arguments): Return error_mark_node instead of + error_mark_list. + * cp-tree.h (error_mark_list): Remove declaration. + * decl.c (error_mark_list): Remove definition. + (cxx_init_decl_processing): Do not initialize error_mark_list. + + PR c++/10385 + * rtti.c (build_dynamic_cast_1): Check for invalid conversions + before calling convert_to_reference. + * cvt.c (convert_to_reference): Assert that reftype is a + REFERENCE_TYPE. + +2006-04-19 Mark Mitchell + + PR c++/27102 + * class.c (currently_open_class): Tidy. + * decl.c (grokdeclarator): If we encounter an erroneous + declarator, assume that we have already issued an error message + and return. Return error_mark_node instead of NULL_TREE in more + places. Issue errors about function definitions that do not have + a function declarator. Check for complete types for all function + definitions. + * cp-tree.h (cp_error_declarator): Remove. + (currently_open_class): Change return type. + * parser.c (cp_parser_id_expression): Add optional_p parameter. + (cp_parser_parse_diagnose_invalid_type_name): Adjust calls. + (cp_parser_id_expression): Likewise. + (cp_parser_unqualified_id): If the name is optional, return + NULL_TREE. + (cp_parser_postfix_dot_deref_expression): Adjust calls. + (cp_parser_type_parameter): Likewise. + (cp_parser_unqualified_id): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_declarator_id): Add optional_p parameter. + (cp_parser_function_definition_from_specifiers_and_declarator): + Assume that start_function indicates failure only if it has issued + an error. + (cp_parser_omp_var_list_no_open): Adjust calls. + +2006-04-17 Janis Johnson + + PR c++/26114, c++/26115 + * typeck.c (cxx_mark_addressable): Restore check for extra_warnings. + * class.c (check_field_decls): Ditto. + +2006-04-17 Volker Reichelt + + * init.c (build_offset_ref): Remove superfluous temporary. + +2006-04-16 Mark Mitchell + + PR c++/26365 + * typeck.c (finish_class_member_access_expr): Robustify + +2006-04-15 Kazu Hirata + + * Make-lang.in (cp/pt.o): Depend on vecprim.h. + * pt.c: Include vecprim.h. + (inline_parm_levels): Change the type to VEC(int,heap) *. + (inline_parm_levels_used): Remove. + (maybe_begin_member_template_processing, + maybe_end_member_template_processing): Use VEC instead of + VARRAY. + + * cp/call.c: Fix comment typos. + +2006-04-12 Mark Mitchell + + * parser.c (cp_parser_init_declarator): Initialize local variables + aggressively. + +2006-04-12 Roger Sayle + + * parser.c (cp_parser_init_declarator): Initialise + is_parenthesized_init to false to avoid compiler warning. + +2006-04-11 Mark Mitchell + + * cp-tree.h (build_operator_new_call): Adjust prototype. + (build_new_method_call): Likewise. + (build_op_delete_call): Likewise. + * init.c (build_raw_new_expr): New function. + (build_new_1): Pass information as parameters, rather than + bundling it into a NEW_EXPR. + (build_new): Adjust accordingly. + (build_vec_delete_1): Adjust for changes to build_op_delete_call. + (build_delete): Likewise. + * decl.c (finish_destructor_body): Likewise. + * call.c (build_operator_new_call): Return the allocation function + used. + (build_op_delete_call): Take allocation function as parameter. + (build_special_member_call): Adjust call to build_new_method_call. + (build_new_method_call): Return function called. + * pt.c (tsubst_copy_and_build): Adjust call to + build_new_method_call. + * semantics.c (finish_call_expr): Likewise. + * parser.c (cp_parser_postfix_expression): Likewise. + * typeck2.c (cxx_incomplete_type_diagnostic): Refer to + "incomplete", not "undefined", types. + + PR c++/26295 + * decl.c (grokdeclarator): Remove namespace-handling code for + pointers-to-members. + * parser.c (cp_parser_ptr_operator): Check for qualified names + using namespaces. + + PR c++/26122 + * parser.c (cp_parser_init_declarator): Adjust logic for deciding + whether or not to look for a pure-specifier. + (cp_parser_member_declaration): Likewise. + +2006-04-08 Kazu Hirata + + * decl2.c, pt.c, semantics.c: Fix comment typos. + +2006-04-06 Roger Sayle + + * call.c (null_ptr_cst_p): Add explicit TREE_CONSTANT_OVERFLOW check. + +2006-04-05 Jason Merrill + + * name-lookup.c (push_namespace_with_attribs): Temporarily disable + default hidden visibility for anonymous namespace. + +2006-03-29 Roger Sayle + + PR c++/22494 + * init.c (build_vec_delete_1): Convert BASE pointer's type to + the base pointer type to avoid a type mismatch in the EQ_EXPR. + +2006-03-24 Carlos O'Donell + + * search.c (maybe_suppress_debug_info): If + flag_emit_class_debug_always then don't suppress. + +2006-03-22 Jason Merrill + + * name-lookup.c (push_namespace_with_attribs): Only apply hidden + visibility to anonymous namespaces if HAVE_GAS_HIDDEN. + +2006-03-21 Jakub Jelinek + + PR c++/26691 + * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle default arguments. + +2006-03-21 Jason Merrill + + PR c++/21581 + * parser.c (cp_parser_declaration): Support attributes on + anonymous namespaces. + * name-lookup.c (push_namespace_with_attribs): Anonymous + namespaces default to hidden visibility. + +2006-03-20 Jason Merrill + + PR c++/21764, c++/19238 + * decl.c (cp_finish_decl): Call determine_visibility later. + (start_preparsed_function): Likewise. + * cp-tree.h (CP_TYPE_CONTEXT, TYPE_NAMESPACE_SCOPE_P): New macros. + (TYPE_CLASS_SCOPE_P, TYPE_FUNCTION_SCOPE_P): New macros. + * name-lookup.h (struct cp_binding_level): Add has_visibility + bitfield. + * name-lookup.c: Include c-pragma.h. + (push_namespace_with_attribs): Split out from push_namespace. + Push visibility if appropriate. Set TREE_PUBLIC on namespaces. + (leave_scope): Pop visibility if appropriate. + * decl2.c (determine_visibility_from_class): Split out from... + (determine_visibility): ...here. Handle function scope and + nested classes. + (import_export_decl): Move visibility handling to + determine_visibility_from_class. + * parser.c (cp_parser_declaration, cp_parser_namespace_name): Allow + attributes on namespace declarations. + +2006-03-15 Volker Reichelt + + PR c++/6634 + * decl.c (grokdeclarator): Do not accept long long double. + Reorganize checks for invalid (combinations of) type modifiers. + Quote modifiers in messages. + +2006-03-09 Jason Merrill + + PR c++/16387, c++/16389 + * typeck.c (cxx_alignof_expr, cxx_sizeof_expr): New functions. + (cxx_sizeof_or_alignof_expr): Split out from here. + +2006-03-09 Diego Novillo + + Merge from gomp-20050608-branch + + 2006-02-02 Diego Novillo + + * decl.c (pop_labels_1): Use appropriate pointer casting. + (poplevel_named_label_1): Likewise. + (named_label_entry_hash): Likewise. + (named_label_entry_eq): Likewise. + (check_goto): Likewise. + (define_label): Likewise. + + 2006-01-26 Diego Novillo + + * cp-tree.h (CP_OMP_CLAUSE_INFO): Use TREE_TYPE instead + of TREE_BLOCK. + * pt.c: Use OMP_CLAUSE_CODE and OMP_CLAUSE_OPERAND + instead of TREE_CODE/TREE_OPERAND. + * semantics.c: Likewise. + * parser.c: Likewise. + + 2005-11-10 Diego Novillo + + * parser.c (cp_parser_omp_threadprivate): Emit diagnostic if + target does not support TLS. + + 2005-11-09 Jakub Jelinek + + * decl.c (redeclaration_error_message): Don't error about + DECL_THREAD_LOCAL_P mismatches if CP_DECL_THREADPRIVATE_P + (olddecl). + + 2005-11-08 Jakub Jelinek + + PR c++/24735 + * semantics.c (finish_omp_barrier, finish_omp_flush): New + functions. + * parser.c (cp_parser_omp_barrier): Call finish_omp_barrier. + (cp_parser_omp_flush): Call finish_omp_flush. + * cp-tree.h (finish_omp_barrier, finish_omp_flush): New + prototypes. + + PR c++/24734 + * pt.c (tsubst_expr): Handle OMP_MASTER and OMP_ORDERED. + + 2005-11-03 Jakub Jelinek + + * semantics.c (finish_omp_threadprivate): Error on class-scope + variables. + + 2005-11-02 Jakub Jelinek + + * parser.c (cp_parser_omp_all_clauses): If some clause + type is not allowed, don't remove just one of the + clauses, but all clauses added in that loop round. + + * semantics.c (finish_omp_clauses): Fix function + comment. Don't handle non-const or mutable specially, + as const and not mutable is predetermined shared and + that leads to double error. Don't ICE if copyin var is + PARM_DECL. + + PR c++/24613 + * parser.c (cp_parser_pragma): Diagnose + PRAGMA_OMP_SECTION outside of PRAGMA_OMP_SECTIONS + construct. + + * semantics.c (finish_omp_threadprivate): Error if V + is automatic variable or has incomplete type. + + 2005-11-01 Diego Novillo + + * parser.c (cp_parser_omp_all_clauses): Use + OMP_CLAUSE_CHAIN instead of TREE_CHAIN. + + 2005-11-01 Diego Novillo + + * parser.c (cp_parser_omp_all_clauses): When emitting an + error message, remove the invalid clause from the list. + + 2005-10-31 Diego Novillo + + * parser.c (cp_parser_omp_parallel): Do not allow 'nowait' in + combined parallel+workshare directives. + + 2005-10-31 Richard Henderson + + * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DTOR): + Use cxx_omp_clause_dtor. + * cp-tree.h (CP_OMP_CLAUSE_INFO): New. + (cxx_omp_clause_dtor): New. + * cp-gimplify.c (cxx_omp_clause_apply_fn): New. + (cxx_omp_clause_default_ctor): Use it. + (cxx_omp_clause_copy_ctor, cxx_omp_clause_assign_op): + Likewise. + (cxx_omp_clause_dtor): New. + * semantics.c (finish_omp_clauses): Rewrite cdtor + checking to fill in CP_OMP_CLAUSE_INFO. Don't + specialcase LASTPRIVATE for removal. + (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor, + cxx_omp_clause_assign_op): Move to cp-gimplify.c. + + 2005-10-28 Jakub Jelinek + + * semantics.c (finish_omp_threadprivate): If + DECL_RTL_SET_P, call make_decl_rtl again so that + encode_section_info can update SYMBOL_REF's flags. + + 2005-10-26 Jakub Jelinek + + * semantics.c (finish_omp_for): Don't segfault if COND + or INCR is NULL. If not calling c_finish_omp_for + right away and one of COND and INCR is NULL, issue + error and don't expand anything. + + PR c++/24512 + * cp-tree.h (finish_omp_for): Add PRE_BODY argument. + * semantics.c (finish_omp_for): Likewise. Set + OMP_FOR_PRE_BODY to PRE_BODY if deferring, add it + into the current statement list if not processing + template decl or pass it to c_finish_omp_for. + + * parser.c (cp_parser_omp_for_loop): Expand optional DECL_EXPRs + into PRE_BODY statement list. Pass it to finish_omp_for. + * pt.c (tsubst_expr) : tsubst_expr also + OMP_FOR_PRE_BODY into PRE_BODY stmt list, pass it to + finish_omp_for. Put all the statements into sk_omp + scope. + + 2005-10-25 Jakub Jelinek + + PR c++/24516 + * parser.c (struct cp_parser): Rename in_iteration_statement + field to in_statement. + (IN_SWITCH_STMT, IN_ITERATION_STMT): Define. + (IN_OMP_BLOCK, IN_OMP_FOR): Change values. + (cp_parser_new, cp_parser_begin_omp_structured_block, + cp_parser_end_omp_structured_block, + cp_parser_omp_for_loop): Adjust for + in_iteration_statement renaming. + (cp_parser_selection_statement): Save + parser->in_iteration, or it temporarily with + IN_SWITCH_STMT for the + cp_parser_implicitly_scoped_statement call. + (cp_parser_iteration_statement): Adjust for + in_iteration_statement renaming. Use + IN_ITERATION_STMT rather than true. + (cp_parser_jump_statement): Adjust for + in_iteration_statement renaming and new values. Don't + error on break in a switch statement within OMP_FOR or + OpenMP structured block. + + PR c++/24513 + * parser.c (cp_parser_cache_group): Don't stop if next + token is CPP_PRAGMA_EOL and end is CPP_PRAGMA_EOL as + well. If current token is CPP_PRAGMA, consume + everything until CPP_PRAGMA_EOL inclusive. + + 2005-10-24 Jakub Jelinek + + PR c++/24502 + * semantics.c (finish_omp_for): Handle MODOP_EXPR in + addition to MODIFY_EXPR. + + 2005-10-23 Richard Henderson + + * cp-gimplify.c (struct cp_gimplify_ctx): Remove. + (bc_label): New. + (begin_bc_block, finish_bc_block): Use it. + (push_context, pop_context): Remove. + (cp_genericize): Don't use them. Assert bc_label is null. + * semantics.c (finish_omp_clauses): Create a fake data + element of TYPE for probing ctors. + + 2005-10-23 Richard Henderson + + * cp-objcp-common.h (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): New. + (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR): New. + (LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): New. + (LANG_HOOKS_OMP_CLAUSE_DTOR): New. + * semantics.c (finish_omp_clauses): Look through + arrays when looking up special member calls. Also + remove FIRSTPRIVATE when LASTPRIVATE fails. + (cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor): New. + (cxx_omp_clause_assign_op): New. + * cp-tree.h: Declare them. + + 2005-10-21 Richard Henderson + + * decl.c (check_previous_goto_1): Return false if error. + (check_switch_goto): Likewise. + (finish_case_label): Don't emit the case label on error. + * parser.c (struct cp_parser): Revert + in_switch_statement_p changes. + (cp_parser_labeled_statement, + cp_parser_selection_statement): Likewise. + (cp_parser_begin_omp_structured_block): Don't save... + (cp_parser_end_omp_structured_block): or restore + in_switch_statement_p. + + 2005-10-21 Richard Henderson + + * semantics.c (finish_omp_threadprivate): Set + decl_flags.u2sel when necessary. + + 2005-10-21 Richard Henderson + + * decl.c (poplevel_named_label_1): Restore creation of the + bad_decls list. + (decl_jump_unsafe): Check for error_mark_node types. + (check_goto): Don't check cdtor_label. Don't use identify_goto. + * semantics.c (finish_return_stmt): Do check_omp_return before + converting to cdtor_label goto. + + 2005-10-21 Richard Henderson + + PR c++/24451 + * decl.c (check_omp_return): Return false on error. + * cp-tree.h (check_omp_return): Update decl. + * semantics.c (finish_return_stmt): Avoid adding + return on error. + + 2005-10-21 Richard Henderson + + * cp-tree.h (struct language_function): Remove + x_named_label_uses. + Change x_named_labels to a hashtable. + (check_omp_return): Declare. + * decl.c (struct named_label_use_entry): Rename from + named_label_use_list. Remove label_decl. + (struct named_label_entry): Rename from + named_label_list. Remove old_value and next. Change + in_try_scope and in_catch_scope to bool. Add + in_omp_scope. + (pop_labels_1): New. + (pop_labels): Use it. + (pop_local_label, poplevel_named_label_1): New. + (poplevel): Use them. + (named_label_entry_hash, named_label_entry_eq): New. + (make_label_decl): Create named_labels. Move label + creation bits from lookup_label. + (declare_local_label): Tidy. + (identify_goto): Split out from ... + (check_previous_goto_1): Add exited_omp argument. + Handle omp scopes. + + (use_label): Merge into... + (check_goto): ... here. Handle omp scopes. + (check_omp_return): New. + (check_previous_gotos): Merge into... + (define_label): ... here. + (save_function_data): Remove x_named_label_uses reference. + (finish_function): Likewise. + * name-lookup.h (sk_omp): New. + * name-lookup.c (begin_scope): Handle it. + * parser.c (cp_parser_omp_for): Don't create extra + compound stmt. + + (cp_parser_omp_sections): Likewise. + * semantics.c (finish_return_stmt): Call check_omp_return. + (begin_omp_structured_block): Use sk_omp. + (finish_omp_structured_block): Use do_poplevel. Don't build a + MUST_NOT_THROW expression here. + (begin_omp_parallel, finish_omp_parallel): Don't create extra + compound statements. + + 2005-10-21 Diego Novillo + + PR 24455 + * cp/cp-tree.h (struct lang_decl_flags): Add field + threadprivate_p. + (CP_DECL_IS_THREADPRIVATE): Define. + * cp/semantics.c (finish_omp_threadprivate): Set. Do + not error out if CP_DECL_IS_THREADPRIVATE is set + already. + * cp/decl.c (duplicate_decls): Merge + CP_DECL_THREADPRIVATE_P. + + 2005-10-20 Richard Henderson + + * cp-gimplify.c (cp_gimplify_omp_for): New. + (cp_gimplify_expr): Call it. + * cp-tree.h (OMP_FOR_GIMPLIFYING_P): New. + * parser.c (struct cp_parser): Rename + in_iteration_statement_p to in_iteration_statement and + change to unsigned char. Similarly with + in_switch_statement. Update all users. + (IN_OMP_BLOCK, IN_OMP_FOR): New. + (cp_parser_labeled_statement): Diagnose case labels + binding closer to an openmp block nested than the + switch. + (cp_parser_jump_statement): Diagnose break and + continue labels binding closer to an openmp block than + an iteration or switch. + (cp_parser_omp_for_loop): Mark in_iteration_statement + for an omp for. + (cp_parser_begin_omp_structured_block): New. + (cp_parser_end_omp_structured_block): New. + (cp_parser_omp_structured_block): Use them. + (cp_parser_omp_for, cp_parser_omp_sections_scope): Likewise. + (cp_parser_omp_parallel): Likewise. + + 2005-10-20 Richard Henderson + + * semantics.c (begin_omp_structured_block): New. + (finish_omp_structured_block): New. + (begin_omp_parallel, finish_omp_parallel): Use them. + * parser.c (cp_parser_omp_structured_block): Likewise. + (cp_parser_omp_for): Likewise. + (cp_parser_omp_sections_scope): Likewise. + * cp-tree.h: Declare them. + + 2005-10-20 Richard Henderson + + * parser.c (cp_parser_omp_master): Return the statement. + (cp_parser_omp_ordered): Likewise. + (cp_parser_omp_construct): Set the locus for them. + + 2005-10-19 Richard Henderson + + * semantics.c (finish_omp_atomic): Revert to + uses_template_parms. + + 2005-10-19 Richard Henderson + + * semantics.c (finish_omp_clauses): Avoid + DECL_THREAD_LOCAL_P on a PARM_DECL. Remove some + stub asserts guaranteed to fail. + + 2005-10-19 Richard Henderson + + * cp-tree.h (OMP_ATOMIC_DEPENDENT_P, OMP_ATOMIC_CODE): New. + (finish_omp_clauses, finish_omp_for, finish_omp_atomic): New. + * parser.c (cp_parser_omp_clause_copyin): Remove. + (cp_parser_omp_all_clauses): Use cp_parser_omp_var_list instead. + Call finish_omp_clauses. + (cp_parser_omp_clause_if): Don't do error checking here. + (cp_parser_omp_clause_num_threads): Likewise. + (cp_parser_omp_clause_schedule): Likewise. + (cp_parser_omp_atomic): Use finish_omp_atomic. + (cp_parser_omp_for_loop): Don't discard DECL_EXPR. + Don't decompose assignment statment here. Use + finish_omp_for. + + * pt.c (tsubst_omp_clauses): New. + (tsubst_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, + OMP_SINGLE, OMP_SECTION, OMP_CRITICAL, OMP_ATOMIC. + * semantics.c (finish_omp_clauses): New. + (begin_omp_parallel, finish_omp_parallel): Know Less about the + internals of the stmt_list stack. + (finish_omp_for, finish_omp_atomic): New. + + 2005-10-18 Jakub Jelinek + + * semantics.c (cxx_omp_predetermined_sharing): New function. + * cp-tree.h (cxx_omp_predetermined_sharing): New prototype. + * cp-objcp-common.h + (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. + + 2005-10-18 Richard Henderson + + * parser.c (cp_parser_omp_single): Use make_node and accessors + instead of build. + + 2005-10-17 Richard Henderson + + * parser.c (cp_parser_omp_for_loop): Handle declarations. + + 2005-10-12 Richard Henderson + + * Make-lang.in (CXX_C_OBJS): Add c-omp.o. + * cp-tree.h (begin_omp_parallel, finish_omp_parallel): Declare. + (finish_omp_threadprivate): Declare. + * parser.c (struct cp_lexer): Add in_pragma. + (cp_lexer_consume_token): Don't consume a PRAGMA_EOL + when in_pragma. + (cp_parser_skip_to_closing_parenthesis): Stop at PRAGMA_EOL. + (cp_parser_skip_to_end_of_statement): Likewise. + (cp_parser_skip_to_end_of_block_or_statement): Likewise. + (cp_parser_skip_to_closing_brace): Likewise. + (cp_parser_skip_to_pragma_eol): Reset in_pragma. + (cp_parser_require_pragma_eol): New. + (cp_parser_statement): Add in_compound argument; + update all callers. + Restart if a non-statement pragma seen outside a + compound. + (cp_parser_statement_seq_opt): Stop at PRAGMA_EOL. + (cp_parser_declaration_seq_opt): Likewise. + (cp_parser_member_specification_opt): Likewise. + (cp_parser_function_definition_after_decl): Likewise. + (cp_parser_skip_until_found): Likewise. + (cp_parser_cache_group): Likewise. + (enum pragma_omp_clause, cp_parser_omp_clause_name, + check_no_duplicate_clause, + cp_parser_omp_var_list_no_open, + cp_parser_omp_var_list, cp_parser_omp_clause_copyin, + cp_parser_omp_clause_default, cp_parser_omp_clause_if, + cp_parser_omp_clause_nowait, + cp_parser_omp_clause_num_threads, + cp_parser_omp_clause_ordered, + cp_parser_omp_clause_reduction, + cp_parser_omp_clause_schedule, + cp_parser_omp_all_clauses, + cp_parser_omp_structured_block, cp_parser_omp_atomic, + cp_parser_omp_barrier, cp_parser_omp_critical, + cp_parser_omp_flush, cp_parser_omp_for_loop, + cp_parser_omp_for, cp_parser_omp_master, + cp_parser_omp_ordered, cp_parser_omp_sections_scope, + cp_parser_omp_sections, cp_parser_omp_parallel, + cp_parser_omp_single, cp_parser_omp_threadprivate, + cp_parser_omp_construct): New. + (cp_parser_pragma): Handle OpenMP pragmas. + * semantics.c (finish_omp_threadprivate): New. + (begin_omp_parallel, finish_omp_parallel): New. + + 2005-10-11 Richard Henderson + + * parser.c (struct cp_token): Add pragma_kind. + (eof_token): Initialize it. + (cp_lexer_handle_pragma): Remove. + (cp_parser_initial_pragma): New. + (cp_lexer_new_main): Use it. + (cp_lexer_get_preprocessor_token): Initialize pragma_kind. + (cp_lexer_print_token): Don't handle CPP_PRAGMA. + (cp_parser_skip_to_pragma_eol): New. + (cp_parser_error): Use it. + (pragma_lex): New. + + 2005-10-09 Richard Henderson + + * lex.c (parse_strconst_pragma): Update for c_lex name change. + (handle_pragma_java_exceptions): Likewise. + * parser.c (cp_lexer_new_main): Likewise. + + 2005-10-06 Richard Henderson + + * parser.c (cp_lexer_new_main): Comment out defer_pragmas. + (cp_lexer_handle_pragma): Comment out + cpp_handle_deferred_pragma. + + 2005-10-01 Richard Henderson + + * name-lookup.c (lookup_name): Remove prefer_type argument. + (lookup_name_prefer_type): New function. + * name-lookup.h (lookup_name_prefer_type): Declare it. + * decl.c (lookup_and_check_tag): Use it. + * pt.c (tsubst_friend_class): Likewise. Update for + lookup_name change. + (lookup_template_class, tsubst_copy_and_build): Likewise. + +2006-03-06 Volker Reichelt + + PR c++/15759 + * tree.c (bot_manip): Don't call mark_used. + +2006-03-02 Mike Stump + + * decl2.c (import_export_decl): Remove redundant call to + targetm.cxx.key_method_may_be_inline (). + +2006-03-02 Richard Sandiford + + * decl.c (start_decl): Use have_global_bss_p when deciding + whether to make the decl common. + +2006-03-01 Mike Stump + + PR darwin/25908 + * decl2.c (import_export_decl): Fix ABI breakage on darwin. + +2006-02-24 Geoffrey Keating + + * except.c (expand_start_catch_block): Handle + flag_use_cxa_get_exception_ptr. + +2006-02-22 Volker Reichelt PR c++/26291 * decl.c (grok_op_properties): Check for ellipsis in arguments of operators. +2006-02-20 Rafael Ávila de Espíndola + + * Make-lang.in (C++): Remove. + (.PHONY): Remove C++. + +2006-02-18 Mark Mitchell + + PR c++/26266 + * cp-tree.h (cp_finish_decl): Adjust declaration. + (grokbitfield): Likewise. + (finish_static_data_member_decl): Likewise. + * init.c (constant_value_1): Ensure processing_template_decl when + folding non-dependent initializers for static data members of + dependent types. Return error_mark_node for erroneous + initailizers. + * class.c (get_vtable_decl): Use finish_decl, not cp_finish_decl. + * decl.c (cp_make_fname_decl): Adjust call to cp_finish_decl. + (cp_finish_decl): Add init_const_expr_p parameter. Set + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here. + (finish_decl): Adjust call to cp_finish_decl. + (compute_array_index_type): Robustify. + (start_method): Use finish_decl, not cp_finish_decl. + * rtti.c (emit_tinfo_decl): Likewise. + * except.c (initialize_handler_parm): Adjust call to + cp_finish_decl. + (expand_start_catch_block): Likewise. + * cvt.c (build_up_reference): Adjust call to cp_finish_decl. + * pt.c (instantiate_class_template): Adjust call to + finish_static_data_member_decl. + (tsubst_expr): Use finish_decl, not cp_finish_decl. + (instantiate_decl): Adjust call to cp_finish_decl. + * name-lookup.c (pushdecl_top_level_1): Use finish_decl, not + cp_finish_decl. + * decl2.c (finish_static_data_member_decl): Add init_const_expr_p + parameter. + (grokfield): Likewise. + * parser.c (cp_parser_condition): Check for constant initializers. + (cp_parser_init_declarator): Adjust calls to grokfield and + cp_finish_decl. Don't set + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here. + (cp_parser_member_declaration): Likewise. + (cp_parser_objc_class_ivars): Likewise. + +2006-02-14 Volker Reichelt + + * call.c (standard_conversion): Return NULL instead of 0. + (build_user_type_conversion_1): Likewise. + (tourney): Likewise. + * decl.c (redeclaration_error_message): Likewise. + * error.c (language_to_string): Likewise. + +2006-02-13 Volker Reichelt + + * cp-tree.h (warn_hidden): Remove prototype. + * class.c (warn_hidden): Make static. + + * cp-tree.h (build_type_conversion): Remove prototype. + * cvt.c (build_type_conversion): Add prototype, make static. + + * cp-tree.h (push_tinst_level): Remove prototype. + (pop_tinst_level): Likewise. + * pt.c (push_tinst_level): Add prototype, make static. + (pop_tinst_level): Likewise. + +2006-02-13 Volker Reichelt + + * decl.c (grokdeclarator): Return NULL_TREE instead of 0. + * typeck.c (unary_complex_lvalue): Likewise. + +2006-02-13 Volker Reichelt + + * lex.c (parse_strconst_pragma): Return error_mark_node instead of + "(tree)-1" to indicate failure. Simplify. + (handle_pragma_interface): Test for error_mark_node instead of + "(tree)-1". + (handle_pragma_implementation): Likewise. + +2006-02-13 Volker Reichelt + + PR c++/26151 + * parser.c (cp_parser_decl_specifier_seq): Check for duplicate + decl-specifiers. Remove extra check for duplicate 'friend'. + * decl.c (grokdeclarator): Remove check for duplicate + decl-specifiers. Set longlong together with long_p. + +2006-02-12 Jason Merrill + + PR c++/24996 + * except.c (build_throw): Add a CLEANUP_POINT_EXPR inside the + TRY_CATCH_EXPR or MUST_NOT_THROW_EXPR. + +2006-02-10 Volker Reichelt + + * class.c (debug_class): Remove extern. + (debug_thunks): Likewise. + +2006-02-09 Gabriel Dos Reis + + * typeck.c (string_conv_p): Don't test for flag_const_strings. + +2006-02-08 Jason Merrill + + PR c++/25979 + * cp-gimplify.c (cp_gimplify_expr): Don't call + cp_gimplify_init_expr for MODIFY_EXPRs. + * typeck2.c (split_nonconstant_init_1): Use INIT_EXPR. + 2006-02-08 Volker Reichelt + PR c++/26071 + * decl.c (grokdeclarator): Set dname also for destructor. + PR c++/26070 - * decl.c (grokdeclarator): Clear RID_STATIC together with staticp. + * decl.c (grokdeclarator): Clear storage_class together with staticp. -2006-02-01 Volker Reichelt +2006-02-07 Gabriel Dos Reis - Backport: - 2005-12-22 Mark Mitchell + * cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error. + (cp_build_qualified_type): Propogate renaming. + * call.c (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer, convert_to_reference): Likewise. + * decl.c (make_typename_type, grokdeclarator): Likewise. + * pt.c (tsubst_friend_function, instantiate_class_template, + tsubst_default_argument, instantiate_decl, + tsubst_initializer_list, tsubst_enum): Likewise. + * semantics.c (finish_template_type): Likewise. + * typeck.c (build_ptrmemfunc, convert_for_assignment): Likewise. - PR c++/25369 - * pt.c (tsubst_copy): Call mark_used on the member referenced by an - OFFSET_REF. - * decl2.c (mark_used): Accept BASELINKs. +2006-02-07 Dirk Mueller -2006-02-01 Volker Reichelt + * typeck.c (build_binary_op): Annotate div-by-zero + warnings to make -Wno-div-by-zero have an effect. - Backport: - 2005-12-19 Mark Mitchell +2006-02-07 Mark Mitchell - PR c++/24915 - * class.c (add_method): Do not treat templates as identical unless - their return types are the same. + PR c++/9737 + * pt.c (coerce_template_template_parms): Do not templates with + excess default arguments to match template template parameters + with fewer parameters. + (coerce_template_parms): Add use_default_args parameter; use + default arguments only when true. + (lookup_template_class): Adjust call to coerce_template_parms. + (fn_type_unification): Likewise. + (unify): Likewise. + (get_bindings): Likewise. + (dependent_type_p): Add assertions. -2006-02-01 Volker Reichelt +2006-02-06 Roger Sayle - Backport: - 2005-12-19 Mark Mitchell + * decl.c (grokdeclarator): Don't bother checking for CHAR_TYPE. + * rtti.c (typeinfo_in_lib_p): Likewise. + * cp-tree.h (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P): Likewise. + * name-lookup.c (arg_assoc_type): Likewise. - PR c++/24278 - * init.c (expand_member_init): Print messages about baseclasses - using %T rather than %D. +2006-02-04 Gabriel Dos Reis + + * cp-tree.h (tf_warn_or_error): New substituion flag. + (cp_build_qualified_type): Use it. + * call.c (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_reference): Likewise. + * decl.c (make_typename_type): Likewise. + (grokdeclarator): Likewise. + * pt.c (tsubst_friend_function): Likewise. + (tsubst_friend_class): Likewise. + (instantiate_class_template): Likewise. + (tsubst_default_argument): Likewise. + (instantiate_decl): Likewise. + (tsubst_initializer_list): Likewise. + (tsubst_enum): Likewise. + * semantics.c (finish_template_type): Likewise. + * typeck.c (build_ptrmemfunc): Likewise. + (convert_for_assignment): Likewise. + +2006-02-03 Lee Millward + + * typeck.c (string_conv_p): Pass appropiate + OPT_Wxxxx values when calling warning(). + (build_array_ref, cxx_mark_addressable): Likewise. + (check_return_expr): Likewise. + + * init.c (perform_member_init): Likewise. + (sort_mem_initializers, emit_mem_initializers): Likewise. + + * class.c (check_field_decls): Likewise. + (warn_about_ambiguous_bases): Likewise. + + * decl.c (pop_label, poplevel): Likewise. + (duplicate_decls, grok_op_properties): Likewise. + (start_preparsed_function, finish_function): Likewise. + + * name-lookup.c (pushdecl_maybe_friend): Likewise. + (pushdecl_maybe_friend): Likewise. + + * parser.c (cp_parser_warn_min_max): Likewise. + (cp_parser_cast_expression): Likewise. + + * method.c (lazily_declare_fn): Likewise. + * cvt.c (convert_to_void): Likewise. + * mangle.c (finish_mangling): Likewise. + * cp-gimplify.c (gimplify_expr_stmt): Likewise. + +2006-02-03 Mark Mitchell + + * name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P, + not IDENTIFIER_OPNAME_P. + +2006-01-31 Mark Mitchell + + PR c++/25342 + * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Revise + documentation. + * pt.c (determine_specialization): Use INNERMOST_TEMPLATE_PARMS, + not TREE_VALUE. + (instantiate_class_template): Simplify. + (verify_class_unification): Remove. + (unify): Document parameters. Use INNERMOST_TEMPLATE_ARGS to + permit multiple levels of template arguments. + (more_specialized_class): Simplify. + (get_class_bindings): Pass full arguments to unify. Fold + verify_class_unification into this function. Return full + arguments. + (most_specialized_class): Adjust for changes to + get_class_bindings. Issue errors here for ambiguity. Return the + fully deduced arguments for the most specialized class, in + addition to the partial specialization. + +2006-01-31 Ben Elliston + + * mangle.c: Comment fix. + +2006-01-29 Gabriel Dos Reis + + * Make-lang.in (cp-warn): Include CXX_COMPAT_WARN. + * repo.c (extract_string, afgets): Use cast when converting from + void *. + +2006-01-29 Gabriel Dos Reis + + * call.c (alloc_conversion): Use cast when converting from void *. + (alloc_conversions): Likewise. + (add_candidate): Likewise. + (print_z_candidates): Likewise. + (add_warning): Likewise. + * pt.c (retrieve_local_specialization): Likewise. + (process_partial_specialization): Likewise. + (mangle_class_name_for_template): Likewise. + (tsubst_template_args): Likewise. + * typeck2.c (pat_calc_hash): Likewise. + (pat_compare): Likewise. + (abstract_virtuals_error): Likewise. + * class.c (method_name_cmp): Likewise. + (resort_method_name_cmp): Likewise. + (get_vfield_name): Likewise. + * decl2.c (generate_ctor_and_dtor_functions_for_priority): Likewise. + * lex.c (init_reswords): Likewise. + * rtti.c (create_pseudo_type_info): Likewise. + * search.c (dfs_lookup_base): Likewise. + (dfs_dcast_hint_pre): Likewise. + (dfs_dcast_hint_post): Likewise. + * tree.c (hash_tree_cons): Likewise. + * repo.c (extract_string): Likewise. + (afgets): Likewise. + * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + +2006-01-28 Gabriel Dos Reis + + * call.c (joust): Pass option code to warning. Use inform for + explanation. + * class.c (check_bases): Likewise. + (maybe_warn_about_overly_private_class): Likewise. + (check_field_decls): Likewise. + (layout_empty_base): Likewise. + (layout_virtual_bases): Likewise. + (layout_class_type): Likewise. + +2006-01-28 Mark Mitchell + + PR c++/25999 + * decl.c (start_preparsed_function): Call maybe_apply_pragma_weak + here, not ... + (start_function): ... here. + +2006-01-28 Mark Mitchell + + PR c++/25855 + * class.c (resolve_address_of_overloaded_function): Adjust use of + return value from most_specialized_instantiation. + * pt.c (determine_specialization): Avoid multiple calls to + get_bindings. + (most_specialized_instantiation): When a tie occurs, set the + current presumed champion to the next template. Return the + TREE_LIST node containing the template, rather than the template + itself. + (most_specialized): Remove. + * name-lookup.c (push_overloaded_decl): When duplicate_decls + indicates a failed redeclaration, report that to callers. + +2006-01-26 Jason Merrill + + PR c++/16021 + * name-lookup.c (parse_using_directive): Require strong using to + name a nested namespace. + +2006-01-25 Volker Reichelt + + Revert: + * cp-tree.h (do_poplevel): Remove prototype. + * semantics.c (do_poplevel): Add prototype. Make static. + + Revert: + * cp-tree.h (default_conversion): Remove prototype. + * typeck.c (default_conversion): Make static. + +2006-01-25 Volker Reichelt + + * cp-tree.h (get_primary_binfo): Remove prototype. + (push_using_decl): Likewise. + (current_template_args): Likewise. + (more_specialized_class): Likewise. + (mark_class_instantiated): Likewise. + (default_conversion): Likewise. + (pfn_from_ptrmemfunc): Likewise. + * class.c (get_primary_binfo): Add prototype, make static, simplify. + * name-lookup.c (push_using_decl): Make static. + * pt.c (current_template_args): Likewise. + (more_specialized_class): Likewise. + (mark_class_instantiated): Likewise. + * typeck.c (default_conversion): Make static. + (pfn_from_ptrmemfunc): Add prototype, make static. + +2006-01-24 Dirk Mueller + + * typeck.c (build_binary_op): Use OPT_Wfloat_equal in warning(). 2006-01-24 Volker Reichelt + PR c++/25552 + * parser.c (cp_parser_unqualified_id): Check that destructor name + and scope match. + * call.c (check_dtor_name): Do not expect a BIT_NOT_EXPR. + Adjust comment. Return early if possible. + Use same_type_p to compare types. + * typeck.c (lookup_destructor): Adjust call to check_dtor_name. + +2006-01-24 Mark Mitchell + + * semantics.c: Remove outdated comment. + +2006-01-23 Volker Reichelt + + * cp-tree.h (do_poplevel): Remove prototype. + * semantics.c (do_poplevel): Add prototype. Make static. + + * cp-tree.h (original_type): Remove prototype. + * typeck.c (original_type): Make static. + + * cp-tree.h (declare_global_var): Remove prototype. + * decl.c (declare_global_var): Make static. + + * cp-tree.h (implicitly_declare_fn): Remove prototype. + * method.c (implicitly_declare_fn): Make static. + + * cp-tree.h (fold_decl_constant_value): Remove prototype. + * pt.c (fold_decl_constant_value): Make static. + + * cp-tree.h (build_x_delete): Remove prototype. + * init.c (build_vec_delete_1): Call build_op_delete_call directly + and not via build_x_delete. + (build_x_delete): Remove. + + * cp-tree.h (get_vtt_name): Remove prototype. + * class.c (get_vtt_name): Remove. + (build_vtt): Call mangle_vtt_for_type instead of get_vtt_name. + +2006-01-22 Gabriel Dos Reis + + * rtti.c (build_dynamic_cast): Fix comment. + +2006-01-22 Gabriel Dos Reis + + PR c++/10891 + * rtti.c (build_dynamic_cast): Reject dynamic_cast use if + -fno-rtti. + +2006-01-21 Mark Mitchell + + PR c++/25895 + * class.c (build_base_path): Generate a NOP_EXPR instead of a + COMPONENT_REF if the base and derived classes are at the same + address. + + PR c++/25856 + * decl.c (begin_destructor_body): Robustify. + + PR c++/25858 + * parser.c (cp_parser_direct_declarator): Robustify. + +2006-01-20 Volker Reichelt + + * parser.c (cp_lexer_next_token_is_keyword): Simplify. + + * parser.c (clear_decl_specs): Remove prototype. + + * parser.c (cp_parser_expression_fn): Remove. + + * call.c (add_builtin_candidates): Remove superfluous return. + * name-lookup.c (do_toplevel_using_decl): Likewise. + * parser.c (cp_parser_type_specifier_seq): Likewise. + (cp_parser_save_default_args): Likewise. + +2006-01-20 Dirk Mueller + + PR c++/5520 + * semantics.c (finish_if_stmt): Call empty_body_warning. + * parser.c (cp_parser_implicitly_scoped_statement): + Mark empty statement with an empty stmt. + +2006-01-19 Mark Mitchell + + PR c++/22136 + * name-lookup.c (do_class_using_decl): Don't try to look up base + classes in templates with dependent base types. + +2006-01-19 Volker Reichelt + + PR c++/25854 + * pt.c (maybe_process_partial_specialization): Return early on + error_mark_node. + +2006-01-19 Volker Reichelt + PR c++/16829 * decl.c (start_preparsed_function): Check default arguments unconditionally. @@ -53,85 +3219,521 @@ * decl2.c (check_default_args): Set missing default arguments to error_mark_node. -2006-01-19 Volker Reichelt +2006-01-18 Mark Mitchell - PR c++/25854 - * pt.c (maybe_process_partial_specialization): Return early on - error_mark_node. + PR c++/25836 + * cp-tree.h (push_class_stack): New function. + (pop_class_stack): Likewise. + * class.c (class_stack_node): Add hidden field. + (pushclass): Clear it. + (push_class_stack): New function. + (pop_class_stack): Likewise. + (currently_open_class): Ignore hidden classes. + (currently_open_derived_class): Likewise. + * name-lookup.c (push_to_top_level): Call push_class_stack. + (pop_from_top_level): Call pop_class_stack. -2005-12-19 Volker Reichelt +2006-01-18 Kazu Hirata - PR c++/20552 - Backport: - 2004-03-08 Mark Mitchell + * tree.c (find_tree_t, find_tree): Remove. + * cp-tree.h: Remove the prototype for find_tree. - * decl.c (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS. +2006-01-18 Jakub Jelinek + + * search.c (lookup_conversions_r): Fix a pasto. + +2006-01-17 Eric Christopher + + * call.c (convert_like_real): When issuing conversion + warnings, depend on OPT_Wconversion. + * cvt.c (build_expr_type_conversion): Ditto. + +2006-01-17 Kazu Hirata + + * name-lookup.c (lookup_namespace_name): Remove. + * name-lookup.h: Remove the prototype for + lookup_namespace_name. + +2006-01-17 Jakub Jelinek + + PR c/25682 + * decl.c (compute_array_index_type): After issuing not an integral + constant-expression error, set size to 1 to avoid ICEs later on. + +2006-01-16 Ian Lance Taylor + + * parser.c: Include "cgraph.h". + (cp_parser_asm_definition): Call cgraph_add_asm_node rather than + assemble_asm. + +2006-01-16 Rafael �ila de Esp�dola + + * g++spec.c (lang_specific_spec_functions): Remove. + +2006-01-15 Gabriel Dos Reis + + * decl.c (check_initializer): Fix thinko. + +2006-01-14 Mark Mitchell + + PR c++/25663 + * parser.c (cp_parser_direct_declarator): Use cp_parser_error + instead of error. + +2006-01-13 Jason Merrill + + * pt.c (check_explicit_specialization): Use CP_DECL_CONTEXT even more. + + * name-lookup.c (set_decl_namespace): Use CP_DECL_CONTEXT. + * pt.c (check_explicit_specialization): Likewise. + +2006-01-12 Jason Merrill + + PR libstdc++/24660 + * pt.c (check_explicit_specialization): Handle namespace + association. + * name-lookup.c (set_decl_namespace): Likewise. + +2006-01-12 Nathan Sidwell + + PR c++/24824 + * class.c (handle_using_decl): Pass correct scope to + cp_emit_debug_info_for_using. + +2006-01-11 Nathan Sidwell + + PR c++/25386 + * tree.c (lvalue_p_1): Any part of a COMPONENT_REF affects + packedness. + +2006-01-06 Gabriel Dos Reis + + * parser.c (cp_parser_primary_expression): Document the grammar + for the built-in offsetof, a GNU extension. + +2006-01-04 Zdenek Dvorak + + PR c++/25632 + * init.c (constant_value_1): Unshare use of DECL_INITIAL. Fix a typo + in condition. + +2006-01-04 Chris Lattner + + * typeck2.c: update copyright to 2006 + (split_nonconstant_init_1): Set TREE_CONSTANT to true. + +2006-01-04 Mark Mitchell + + PR c++/24782 + * parser.c (cp_parser_nested_name_specifier_opt): Preserve access + checks, even when parsing tentatively. + +2006-01-04 Richard Henderson + + Merge from gomp branch. + * lex.c (handle_pragma_java_exceptions): Fix whitespace. + * parser.c (struct cp_token): Add pragma_kind. + (eof_token): Update to match. + (struct cp_lexer): Add in_pragma; rearrange next for better packing. + (cp_parser_initial_pragma): New. + (cp_lexer_new_main): Use it. Don't bother clearing + c_lex_return_raw_strings. + (cp_lexer_get_preprocessor_token): Always initialize keyword + and pragma_kind fields. Handle CPP_PRAGMA. + (cp_lexer_consume_token): Don't allow CPP_PRAGMA_EOL when + in_pragma is set. + (cp_lexer_handle_pragma): Remove. Update callers to cp_parser_pragma. + (cp_lexer_print_token) : Don't print as a string. + (cp_parser_skip_to_pragma_eol): New. + (cp_parser_error): Use it. + (cp_parser_skip_to_closing_parenthesis): Stop at CPP_PRAGMA_EOL; + rearrange with switch statement. + (cp_parser_skip_to_end_of_statement): Likewise. + (cp_parser_skip_to_end_of_block_or_statement): Likewise. + (cp_parser_skip_to_closing_brace): Likewise. + (cp_parser_skip_until_found): Likewise. + (cp_parser_statement): Add in_compound argument; update callers. + Use it to decide how to handle pragma parsing. + (cp_parser_labeled_statement): Add in_compound argument; pass + it on to cp_parser_statement. + (cp_parser_statement_seq_opt): Stop at CPP_PRAGMA_EOL. + (cp_parser_declaration_seq_opt): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_specification_opt): Likewise. + (cp_parser_function_definition_after_decl): Likewise. + (cp_parser_cache_group): Handle CPP_PRAGMA/CPP_PRAGMA_EOL pairs. + (cp_parser_pragma): New. + (pragma_lex): New. + +2006-01-04 Dirk Mueller + + * decl.c (finish_constructor_body): create simple + compound stmt instead of a if(1) { } construct. + +2006-01-03 Mark Mitchell + + PR c++/25492 + * name-lookup.c (push_class_level_binding): When a derived class + provides a type binding, eliminate any type binding from a base + class. + + PR c++/25625 + * repo.c (repo_emit_p): Always instantiate static data members + initialized by constant expressions, so that there values are + available. + +2006-01-02 Mark Mitchell + + PR c++/25635 + * class.c (add_method): Set TYPE_HAS_CONVERSION for classes with a + conversion operator. + * decl.c (grokdeclarator): Do not set TYPE_HAS_CONVERSION here. + + PR c++/25638 + * class.c (add_method): Never associate more than one destructor + with a single class. + + PR c++/25637 + * cp-tree.h (do_friend): Adjust prototype. + * decl.c (grokfndecl): Make funcdef_flag a bool, not an int. + (grokdeclarator): Likewise. Refine check for invalid + declarations/definitions of member functions outside of their own + class. + * friend.c (do_friend): Make funcdef_flag a bool, not an int. + + PR c++/25633 + * parser.c (cp_parser_mem_initializer_list): Check result of + cp_parser_mem_initializer against error_mark_node, not NULL_TREE. + (cp_parser_mem_initializer): Return error_mark_node for failure. + + PR c++/25634 + * parser.c (cp_parser_template_parameter_list): Call + begin_template_parm_list and end_template_parm_list here. + (cp_parser_type_parameter): Not here. + (cp_parser_template_declaration_after_export): Or here. + (cp_parser_elaborated_type_specifier): Call + cp_parser_check_template_parameters. + + * tree.c (build_target_expr_with_type): Use force_target_expr. + + * decl2.c (mark_used): Fix typo in comment. + +2006-01-02 Volker Reichelt + + * parser.c (cp_parser_using_declaration): Skip name-lookup on + invalid scope. + +2005-12-30 Gabriel Dos Reis + + * cxx-pretty-print.c (pp_cxx_constant): New. Print + string-literal in parens if input program says so. + (pp_cxx_primary_expression): Hand off constant printing to + pp_cxx_constant. + (pp_cxx_pretty_printer_init): Set pp->c_base.constant. + (pp_cxx_expression): Use pp_cxx_constant for literals. + * error.c (dump_expr): Use pp_constant for literals. + +2005-12-29 Nathan Sidwell + + * method.c (make_thunk): Don't set comdat_linkage here. + (use_thunk): Make thunk one only here, if thunk target is + DECL_ONE_ONLY. + +2005-12-26 Mark Mitchell + + PR c++/25439 + * decl.c (grokdeclarator): Remove dead code. + * ptree.c (cxx_print_xnode): Handle BASELINK. + * parser.c (make_id_declarator): Add sfk parameter. + (cp_parser_direct_declarator): Do not pass TYPE_DECLs to + make_id_declarator. + (cp_parser_declarator_id): Simplify BASELINKs here. + (cp_parser_member_declaration): Adjust calls to + make_id_declarator. + +2005-12-26 Mark Mitchell + + PR c++/23171, c++/23172, c++/25417. + * typeck.c (build_unary_op): Create temporary variables for + compound literals whose addresses are taken. + * init.c (expand_aggr_init_1): Use COMPOUND_LITERAL_P. + * decl.c (reshape_init_vector): Likewise. + (reshape_init): Give it external linkage. + (check_initializer): Use COMPOUND_LITERAL_P. + (initialize_artificial_var): Allow the initializer to be a + CONSTRUCTOR. + * call.c (make_temporary_var_for_ref_to_temp): Use + create_temporary_var. + * cp-tree.h (COMPOUND_LITERAL_P): New macro. + (rehape_init): Declare. + * typeck2.c (digest_init): Use COMPOUND_LITERAL_P. + * semantics.c (finish_compound_literal): Use reshape_init. + +2005-12-23 Mark Mitchell + + PR c++/24671 + * pt.c (instantiate_template): Handle SFINAE. + +2005-12-23 Volker Reichelt + + * decl.c (grokdeclarator): Improve diagnostic for friend + declarations of class members. + +2005-12-22 Mark Mitchell + + PR c++/25369 + * tree.c (really_overloaded_fn): Tweak comment. + * pt.c (tsubst_call_declarator_parms): Remove. + (tsubst_copy): Call mark_used on the member referenced by an + OFFSET_REF. + * semantics.c (finish_qualified_id_expr): Simplify. + * decl2.c (mark_used): Accept BASELINKs. + + PR c++/25364 + * typeck.c (build_unary_op): Pass DECLs not names to + build_offset_refs. + * init.c (build_offset_ref): Do not do name lookup. Do not call + mark_used. + * call.c (build_call): Simplify and tidy. + * semantics.c (finish_qualified_id_expr): Call mark_used. + +2005-12-22 Volker Reichelt + + PR c++/23333 + * parser.c (cp_parser_pure_specifier): Check for PURE_ZERO to + identify a single '0'. + +2005-12-20 Mark Mitchell + + PR c++/21228 + * decl.c (use_eh_spec_block): New function. + (store_parm_decls): Use it. + (finish_function): Likewise. + +2005-12-19 Mark Mitchell + + PR c++/24278 + * init.c (expand_member_init): Print messages about baseclasses + using %T rather than %D. + + PR c++/24915 + * class.c (add_method): Do not treat templates as identical unless + their return types are the same. + +2005-12-12 Mark Mitchell + + PR c++/25300 + * tree.c (build_qualified_name): Return error_mark_node for + erroneous input. + +2005-12-10 Mark Mitchell + + PR c++/25337 + * pt.c (tsubst_copy_and_build): Permit dependent types for the + object in a class member access expression. + +2005-12-10 Terry Laurenzo + + PR java/9861 + * mangle.c (write_bare_function_type): Mangle return type for + methods of Java classes + +2005-12-08 Th�dore Papadopoulo + + * call.c (build_conditional_expr): Print types in error messages. 2005-12-07 Volker Reichelt - PR c++/19397 - PR c++/19762 - PR c++/19764 - * parser.c (cp_parser_declarator_id): Check for error_mark_node - before building a SCOPE_REF. + * expr.c (cxx_expand_expr): Call gcc_unreachable instead of abort. 2005-12-07 Volker Reichelt - Backport: - 2005-10-20 Mark Mitchell + * cp-gimplify.c (gimplify_cp_loop): Use fold_build3. - PR c++/22618 - * search.c (accessible_p): Check access in the outermost set of - template parameters. +2005-12-07 Rafael �ila de Esp�dola -2005-12-06 Volker Reichelt + * Make-lang.in (c++.all.build, c++.install-normal): Remove. - Backport: - 2005-10-18 Nathan Sidwell +2005-12-07 Rafael �ila de Esp�dola - PR c++/21383 - * name-lookup.c (arg_assoc): Template args can be null in a - template-id-expr. + * Make-lang.in: Remove all dependencies on s-gtype. -2005-12-05 Volker Reichelt +2005-12-06 Aldy Hernandez - Backport: - 2005-10-13 Mark Mitchell + PR C++/24138 + * decl.c (reshape_init_array_1): Handle max_index of -1. - PR c++/22352 - * pt.c (tsubst_template_parms): Set processing_template_decl while - processing the parameters. - (tsubst_decl): Set processing_template_decl when substituting into - a TEMPLATE_DECL. +2005-12-06 Roger Sayle -2005-12-05 Volker Reichelt + * typeck.c (build_binary_op): Issue warning if either operand of a + comparison operator is a string literal, except for testing equality + or inequality against NULL. - Backport: - 2005-10-13 Mark Mitchell +2005-12-06 Roger Sayle - PR c++/22464 - * semantics.c (finish_id_expression): Issue errors about uses of - local variables in containing functions even in templates. + PR c++/25263 + * decl.c (compute_array_index_type): Check that itype is an + INTEGER_CST node before testing/clearing TREE_OVERFLOW. -2005-12-05 Volker Reichelt +2005-12-05 Daniel Berlin - Backport: - 2005-10-13 Mark Mitchell + * ptree.c (cxx_print_decl): Update to check for decl_common + structure. - PR c++/23307 - * pt.c (push_template_decl_real): Complain about attempts to - declare template variables. +2005-12-02 Mark Mitchell -2005-11-30 Release Manager + PR c++/24173 + * decl.c (duplicate_decls): Don't rely on DECL_TEMPLATE_INFO after + clobbering newdecl. - * GCC 3.4.5 released. +2005-12-02 Richard Guenther -2005-11-23 Jakub Jelinek + * semantics.c (simplify_aggr_init_expr): Use buildN instead + of build. - PR c++/21983 - * class.c (find_final_overrider): Move diagnostic about no unique final - overrider to... - (update_vtable_entry_for_fn): ... here. +2005-12-02 Gabriel Dos Reis + + * parser.c (cp_lexer_new_main): Usr GGC_RESIZEVEC instead of + ggc_realloc. + (cp_parser_template_argument_list): Use XRESIZEVEC instead of + xrealloc. + * class.c (pushclass): Likewise. + +2005-12-02 Gabriel Dos Reis + + * decl2.c (get_priority_info): Use XNEW, not xmalloc. + * decl.c (push_switch): Likewise. + * lex.c (handle_pragma_implementation): Likewise. + * cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW, + not ggc_alloc. + (cxx_initialize_diagnostics): Use XNEW, not xmalloc. + * class.c (init_class_processing): Use XNEWVEC, not xmalloc. + * g++spec.c (lang_specific_driver): Likewise. + * mangle.c (save_partially_mangled_name): Likewise. + * parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc. + (cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc. + (cp_parser_sizeof_operand): Likewise. + * repo.c (open_repo_file, open_repo_file): Likewise. + +2005-12-01 Gabriel Dos Reis + + * parser.c (cp_parser_make_typename_type): Call make_typename_type + with tf_none instead of magic value 0. + (cp_parser_explicit_instantiation): Call do_type_instantiation + with tf_error instead of magic value 1. + (cp_parser_elaborated_type_specifier): Call make_typename_type + with tf_error instead of magic value 1. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name): Likewise. + +2005-12-01 Gabriel Dos Reis + + * parser.c (cp_parser_declaration): Set token2.type to CPP_EOF, + not RID_MAX. + +2005-11-30 Jason Merrill + + PR c++/21123 + * cp-gimplify.c (cp_genericize_r): Don't dereference invisible reference + parms in a thunk. + +2005-11-30 Ben Elliston + + * typeck.c (build_x_unary_op): Correct spelling in error message. + +2005-11-28 Nathan Sidwell + + PR c++/21166 + * class.c (check_field_decls): Only set DECL_PACKED on a field + when its natural alignment is > BITS_PER_UNIT. + +2005-11-27 Volker Reichelt + + PR c++/24979 + * cp-tree.h (DECL_MAIN_P): Remove duplicate definition. + +2005-11-26 Richard Henderson + + * lex.c: Update for pragma_lex rename. + * parser.c: Likewise. + +2005-11-25 Volker Reichelt + + PR c++/9278 + * decl.c (grokparms): Do not allow typedef-names in a '(void)' + parmlist. + +2005-11-25 Volker Reichelt + + * typeck2.c (process_init_constructor_union): Remove check for + unnamed union members. + +2005-11-25 Volker Reichelt + + * name-lookup.c (lookup_name_real): Merge two if's. + +2005-11-25 Volker Reichelt + + * pt.c (instantiate_class_template): Clean-up. + +2005-11-25 Volker Reichelt + + * pt.c (template_class_depth_real): Remove. Move functionality to ... + (template_class_depth): ... here, replacing count_specializations + with 0. Adjust comment. + +2005-11-24 Richard Guenther + Dirk Mueller + + PR c++/14024 + * typeck.c (build_reinterpret_cast_1): Use + strict_aliasing_warning. + +2005-11-23 Gabriel Dos Reis + + PR c++/24235 + * pt.c (check_instantiated_args): Reword diagnostic message about + template argument involving local types. + +2005-11-23 Gabriel Dos Reis + + PR c++/21667 + * typeck.c (build_array_ref): Avoid code duplicate. Use common + C/C++ diagnostic function warn_array_subscript_with_type_char. + +2005-11-21 Gabriel Dos Reis + + PR c++/22238 + * error.c (resolve_virtual_fun_from_obj_type_ref): New. + (dump_expr): Use it in . + +2005-11-21 Richard Henderson + + * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch. + + * name-lookup.c (lookup_name): Remove prefer_type argument. + (lookup_name_prefer_type): New. + * decl.c (lookup_and_check_tag): Use them. + * pt.c (tsubst_friend_class): Likewise. + (lookup_template_class): Likewise. + (tsubst_copy_and_build): Likewise. + * name-lookup.h (lookup_name_prefer_type): New. + (lookup_name): Remove declaration. + +2005-11-18 Mark Mitchell + + PR c++/8355 + * decl.c (grokfndecl): Set up DECL_TEMPLATE_INFO before calling + set_decl_namespace. + * name-lookup.c (set_decl_namespace): + +2005-11-18 Mike Stump + + * cp-objcp-common.h (LANG_HOOKS_LOOKUP_NAME): Add. + * name-lookup.c (lookup_name_two): Remove. + (lookup_name_one): Add. + * name-lookup.h (lookup_name_two): Remove. + (lookup_name_one): Add. 2005-11-15 Jason Merrill @@ -139,11 +3741,428 @@ * method.c (locate_copy): Also use skip_artificial_parms here. (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking for RECORD_TYPE. + (locate_ctor): Abort if we fail to find a default constructor. -2005-11-16 Volker Reichelt +2005-11-15 Mike Stump - Backport from mainline: - 2005-10-12 Nathan Sidwell + * name-lookup.c (lookup_name_two): Add. + * name-lookup.h: Likewise. + +2005-11-15 Mark Mitchell + + PR c++/24667 + * typeck.c (check_for_casting_away_constness): Use the diag_fn. + (build_const_cast_1): Call it, for C-style casts. + +2005-11-14 Mark Mitchell + + PR c++/24687 + * pt.c (check_explicit_specialization): Don't check for C linkage. + (push_template_decl_real): Likewise. + * parser.c (cp_parser_explicit_specialization): Check here. + (cp_parser_template_declaration_after_export): And here. + + * parser.c (cp_lexer_get_preprocessor_token): Initialize keyword + field. + +2005-11-14 Jason Merrill + + PR c++/24580 + * method.c (locate_ctor): Skip all artificial parms, not just + 'this'. + +2005-11-14 Mark Mitchell + + * parser.c (eof_token): Add initializer for ambiguous_p. + +2005-11-13 Mark Mitchell + + PR c++/24817 + * decl.c (check_redeclaration_exception_specification): New + function. + (duplicate_decls): Use it. + * error.c (fndecl_to_string): Print the template parameter list. + + PR c++/20293 + * cxx-pretty-print.c (pp_cxx_statement): Print qualifying scopes + for namespaces. + (pp_cxx_original_namespace_definition): Likewise. + * name-lookup.c (ambiguous_decl): Don't issue error messages; + instead return lists of ambiguous candidates. + (select_decl): Handle ambiguous namespace lookups. + * parser.c (cp_token): Add ambiguous_p. + (cp_lexer_get_preprocessor_token): Set it. + (cp_parser_diagnose_invalid_type_name): Avoid duplicate messages + when a qualified name uses an invalid scope. + (cp_parser_primary_expression): Print ambiguous candidates. + (cp_parser_type_parameter): Adjust comment to reflect new + parameter name for cp_parser_lookup_name. + (cp_parser_template_argument): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Print ambiguous candidates. + (cp_parser_lookup_name): Rename ambiguous_p parameter to + ambiguous_decls. Use it to return a list of ambiguous candiates + when a lookup is ambiguous. + (cp_parser_lookup_name_simple): Adjust comment to reflect new + parameter name for cp_parser_lookup_name. + +2005-11-12 Jakub Jelinek + + PR c++/24780 + * typeck.c (complete_type): Set TYPE_NEEDS_CONSTRUCTING + and TYPE_HAS_NONTRIVIAL_DESTRUCTOR flags for all variants + of array type. + + PR c++/24761 + * pt.c (tsubst_copy_asm_operands): New function. + (tsubst_expr) : Use it. + +2005-11-08 Jakub Jelinek + + PR c++/19450 + * decl.c (redeclaration_error_message): Issue diagnostics about + olddecl and newdecl disagreement on __thread property. + (grokdeclarator): Set DECL_TLS_MODEL on class static variables. + +2005-11-08 Jason Merrill + + PR c++/21123 + * method.c (use_thunk): Use build_cplus_new instead of + force_target_expr. + +2005-11-06 Jason Merrill + James A. Morrison + + PR c++/17256 + * decl2.c (cp_finish_file): Fix conditions for undefined warning. + Set TREE_NO_WARNING instead of TREE_PUBLIC. + * pt.c (instantiate_pending_templates): Set DECL_INITIAL to avoid + a warning on a function we didn't instantiate because of excessive + recursion. + +2005-11-06 Mark Mitchell + + * class.c (record_subobject_offsets): Don't record offsets past + biggest empty class for non-empty base classes. + (layout_class_type): Use TYPE_SIZE_UNIT, not TYPE_SIZE, when + keeping track of the size of emptyclasses. + + PR c++/21308 + * class.c (sizeof_biggest_empty_class): New variable. + (record_subobject_offsets): Don't record offsets past biggest + empty class for data members. Replace vbases_p parameter with + is_data_member parameter. + (build_base_field): Adjust call. + (layout_class_type): Likewise. Maintain + sizeof_biggest_empty_class. + +2005-11-05 Kazu Hirata + + * decl2.c, init.c, typeck.c: Fix comment typos. + +2005-11-04 Richard Guenther + + PR c++/22487 + * init.c (build_vec_init): Build comparison of matching + types. + +2005-11-03 Josh Conner + + PR c++/19989 + pt.c (tsubst): Accept zero-length array if tf_error is set + in complain flags. Change error message for negative- + length array. + +2005-11-04 Joseph S. Myers + + * cp-tree.h (cp_cpp_error), error.c (cp_cpp_error): Take va_list* + parameter. + +2005-11-03 Joseph S. Myers + + PR c++/17964 + * error.c (cp_cpp_error): New function. + * cp-tree.h (cp_cpp_error): Declare. + * parser.c (cp_lexer_new_main): Set CPP option client_diagnostic + and error callback after lexing. + +2005-11-03 Mark Mitchell + + PR c++/21627 + * pt.c (register_specialization): Update inline flags on clones.y + +2005-11-03 Andrew Pinski + + PR c++/24582 + * decl.c (declare_local_label): Return 0 for variables + with error_mark_node as their types. + +2005-11-02 Mark Mitchell + + PR c++/22434 + * call.c (build_conditional_expr): Do bad conversions, if there's + no other choice. + + PR c++/24560 + * parser.c (cp_parser_postfix_dot_deref_expression): Improve error + message for use of overloaded functions on LHS of "." operator. + + PR c++/19253 + * parser.c (cp_parser_postfix_expression): Use + cp_parser_elaborated_type_specifier to handle typename-types in + functional casts. + (cp_parser_enclosed_argument_list): Skip ahead to the end of the + template argument list if the closing ">" is not found. + + PR c++/24569 + * pt.c (instantiate_decl): Use cp_finish_decl, not + finish_static_data_member_decl. + +2005-10-28 Andrew Pinski + + * decl.c (grokfndecl): Remove the setting + of the return type of the function type + of main after erroring about must returning + int. + +2005-10-28 Andrew Pinski + + PR C++/23229 + * decl.c (grokfndecl): Create a new function type + after erroring out about main not returning int. + +2005-10-28 Josh Conner + + PR c++/22153 + * parser.c (cp_parser_member_declaration): Detect and handle + a template specialization. + +2005-10-28 Andrew Pinski + + PR C++/23426 + * decl.c (start_decl): Check that the decl is an + error_mark_node before getting the type. + Remove the check for the decl's type being an + error_mark_node. + +2005-10-21 Mark Mitchell + + PR c++/24260 + * parser.c (cp_parser_init_declarator): Pass attributes to + grokfield. + +2005-10-20 Mark Mitchell + + PR c++/22618 + * search.c (accessible_p): Check access in the outermost set of + template parameters. + +2005-10-20 Richard Guenther + + * decl.c (grokdeclarator): Fix ambiguous pedwarn message. + +2005-10-18 Volker Reichelt + + PR c++/22293 + * decl.c (grokdeclarator): Reject unqualified destructors in + friend declarations. + +2005-10-18 Mark Mitchell + + PR c++/23293 + * pt.c (convert_template_argument): Use canonical type variants in + template specializations. + +2005-10-18 Nathan Sidwell + + PR c++/21383 + * name-lookup.c (arg_assoc): Template args can be null in a + template-id-expr. + + PR c++/22604 + * class.c (update_vtable_entry_for_fn): Don't process invalid + covariant overriders. + + PR c++/23118 + * cp-tree.h (add_method): Add return value. + * class.c (add_method): Return success indicator. + * semantics.c (finish_member_declaration): Don't add an invalid + method to the method list. + +2005-10-17 Mark Mitchell + + PR c++/21908 + * call.c (build_new_method_call): Do not show VTT parameters to + the user. + +2005-10-17 Volker Reichelt + + PR c++/23440 + * parser.c (cp_parser_statement): If the parser reached CPP_EOF, + only complain about missing statement. + +2005-10-17 Nathan Sidwell + + PR c++/24386 + * cp-tree.h (BASELINK_QUALIFIED_P): New. + * pt.c (tsubst_copy_and_build): : Use it. + * typeck.c (finish_class_member_access_expr): Set it. + + PR c++/21353 + * decl.c (check_default_argument): Don't check + processing_template_decl or uses_template_parms here. + (grokparms): Only call check_default_argument when not processing + a template decl. + * parser.c (cp_parser_late_parsing_default_arg): Call + check_default_argument when not processing a template decl. + +2005-10-16 Mark Mitchell + + PR c++/24389 + * decl2.c (mark_used): Use uses_template_parms instead of + dependent_type_p. + * init.c (constant_value_1): Handle uninstantiated templates + specially. + * pt.c (instantiate_decl): Add sanity check. + +2005-10-16 Mark Mitchell + + PR c++/22173 + * typeck.c (check_template_keyword): Fix thinko. + +2005-10-16 Andrew Pinski + + PR c++/23959 + * decl.c (pop_switch): Only call c_do_switch_warnings + when not processing templates. + +2005-10-16 Mark Mitchell + + PR c++/22173 + * cp-tree.h (QUALIFIED_NAME_IS_TEMPLATE): New macro. + (check_template_keyword): New function. + (finish_id_expression): Change prototoype. + (finish_qualified_id_expr): Change prototype. + (build_qualified_name): New function. + (finish_class_member_access_expr): Change prototype. + * init.c (build_offset_ref): Use build_qualified_name. + * mangle.c (write_expression): Likewise. + * parser.c (cp_parser_primary_expression): Remove qualifying_class + parameter. Add address_p and template_arg_p. Use + build_qualified_name. + (cp_parser_id_expression): Default *template_p to + template_keyword_p. Check for invalid uses of the template + keyword. + (cp_parser_postfix_expression): Eliminate special handling for + qualified names. Adjust call to cp_parser_primary_expression. + (cp_parser_postfix_dot_deref_expression): Adjust call to + cp_parser_id_expression and finish_class_member_access_expr. + (cp_parser_template_argument_list): Add comment. + (cp_parser_template_argument): Adjust use of + cp_parser_primary_expression. Remove call to + finish_qualified_id_expr. + (cp_parser_lookup_name): Use build_qualified_name. + * pt.c (tsubst): Use build_qualified_name. + (tsubst_qualified_id): Likewise. Adjust call to + finish_qualified_id_expr. + (tsubst_copy): Use build_qualified_name. + (tsubst_copy_and_build): Adjusts call to finish_id_expression and + finish_class_member_access_expr. + * semantics.c (finish_non_static_data_member): Use + build_qualified_name. + (finish_qualified_id_expr): Add template_p and template_arg_p + parameters. + (finish_id_expression): Remove qualifiying_class parameter. Add + template_p, done, address_p, and template_arg_p. Use + build_qualified_name. Adjust calls to + finish_class_member_acess_expr. + * tree.c (build_qualified_name): New function. + * typeck.c (check_template_keyword): New function. + (finish_class_member_access_expr): Add template_p argument. Check + for invalid uses of the template keyword. + +2005-10-15 Mark Mitchell + + PR c++/21347 + * class.c (maybe_warn_about_overly_private_class): Lazy + constructors are public. + +2005-10-14 Mark Mitchell + + PR c++/19565 + * call.c (convert_like_real): Rely on convert_and_check to issue + warnings about overflow and conversion to unsigned. + * decl.c (finish_enum): Use the location of the enumerators, not + the closing brace of the enumeration, when reporting warnings + about conversions. + (build_enumerator): Use error_mark_node for erroneous values. + * typeck2.c (digest_init): Remove reference to "signature pointer" + from comment. + +2005-10-14 Nathan Sidwell + + PR c++/17796 + * optimize.c (update_cloned_parm): Add FIRST parameter. Use it. + (maybe_clone_body): Track the first clone. + +2005-10-13 Nathan Sidwell + + PR c++/23984 + * class.c (build_base_path): The vtable is always the first thing + in the vtt. + +2005-10-13 Mark Mitchell + + PR c++/20721 + * cp-tree.h (DECL_NONTRIVIALLY_INITIALIZED_P): New macro. + * decl.c (duplicate_decls): Merge it into new declarations. + (decl_jump_unsafe): Use it, rather than DECL_INITIAL. + (cp_finish_decl): Set it, when appropriate. + + PR c++/22180 + * call.c (build_new_method_call): Correct pretty-printing of + destructor names. + * pt.c (tsubst_qualified_id): Recognize invalid uses of "~T" as an + identifier. + + PR c++/23694 + * decl.c (start_method): Return error_mark_node for errors. + + PR c++/23307 + * pt.c (push_template_decl_real): Complain about attempts to + declare template variables. + + PR c++/22352 + * pt.c (tsubst_template_parms): Set processing_template_decl while + processing the parameters. + (tsubst_decl): Set processing_template_decl when substituting into + a TEMPLATE_DECL. + + PR c++/22405 + * pt.c (most_specialized_instantiation): Robustify. + + PR c++/22464 + * semantics.c (finish_id_expression): Issue errors about uses of + local variables in containing functions even in templates. + +2005-10-12 Danny Smith + + PR target/21801 + PR target/23589 + * class.c (finish_struct_1): Call + targetm.cxx.adjust_class_at_definition. + + +2005-10-12 Nathan Sidwell + + PR c++/21592 + * pt.c (build_non_dependent_expr): Don't wrap a COMPONENT_REF + with already looked up member functions. Assert we're not + returning a NON_DEPENDENT_EXPR with unknown type. + * typeck.c (finish_class_member_access_expr): We can get + non-template-id-expr baselinks. If the lookup finds a baselink, + remember it even inside templates. PR c++/23797 * parser.c (cp_parser_functional_cast): Cope when TYPE is not a @@ -153,35 +4172,17 @@ (type_dependent_expression_p): Assert we've not been given a TYPE_DECL. -2005-11-15 Volker Reichelt + PR c++/21117 + * decl.c (check_function_type): Correctly overwrite incomplete + return type with void type. + * typeck.c (check_return_expr): If the function's return type is + void, don't try and convert a return expr. - PR c++/19253 - PR c++/22172 - Backport from mainline: - 2005-11-02 Mark Mitchell +2005-10-12 David Edelsohn - * parser.c (cp_parser_postfix_expression): Use - cp_parser_elaborated_type_specifier to handle typename-types in - functional casts. - (cp_parser_enclosed_argument_list): Skip ahead to the end of the - template argument list if the closing ">" is not found. - -2005-11-14 Jason Merrill - - PR c++/24580 - * method.c (locate_ctor): Skip all artificial parms, not just - 'this'. - -2005-10-28 Josh Conner - - PR c++/22153 - * parser.c (cp_parser_member_declaration): Detect and handle - a template specialization. - -2005-10-20 Volker Reichelt - - PR c++/22508 - * init.c (build_new_1): Remove misleading comment. + PR c++/23730 + * call.c (build_object_call): If BINFO is NULL, bypass + lookup_fnfields and set fns to NULL_TREE. 2005-10-12 Paolo Bonzini @@ -189,157 +4190,441 @@ * error.c (dump_expr): Pass LABEL_DECL to dump_decl. Print an ADDR_EXPR of a LABEL_DECL as &&. -2005-10-11 Volker Reichelt +2005-10-12 Nathan Sidwell - Backport: - 2004-09-23 Andrew Pinski - PR c++/17618 - * cvt.c (cp_convert_to_pointer): Return early when the type is - an error_mark_node. + PR c++/19964 + * class.c (walk_subobject_offsets): Don't walk error_mark_node. - 2004-05-22 Roger Sayle - * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by - returning when TREE_TYPE is error_mark_node. - * typeck.c (require_complete_type): Return error_mark_node if - value's type is an error_mark_node. +2005-10-11 Ian Lance Taylor - 2004-11-02 Mark Mitchell - PR c++/18177 - * typeck.c (build_const_cast): Use error_operand_p. + PR c++/8057 + * cvt.c (convert_to_void): Don't warn about unused values when + processing a template declaration. + +2005-10-11 Mark Mitchell + + PR c++/21089 + * call.c (convert_like_real): Use decl_constant_value, not + integral_constant_value. + * init.c (constant_value_1): New function. + (integral_constant_value): Use it. + (decl_constant_value): Likewise. + * typeck.c (decay_conversion): Use decl_constant_value, not + integral_constant_value. + + PR c++/21369 + * parser.c (cp_parser_elaborated_type_specifier): Don't treat + class types as templates if the type is not appearing as part of a + type definition or declaration. + +2005-10-10 Mark Mitchell + + PR c++/24277 + * pt.c (instantiate_decl): Call finish_static_data_member_decl for + static data members. + +2005-10-10 Giovanni Bajo + Mark Mitchell + + PR c++/23437 + * parser.c (cp_parser_template_argument_list): Do not treat + contents of argument list as part of a constant expression. + +2005-10-10 Mark Mitchell + + PR c++/24139 + * decl.c (grokdeclarator): Do not require template parameter lists + for explicitly specialized class. + * error.c (dump_aggr_type): Do not dump template arguments for + non-primary specializations. + (dump_function_name): Likewise. + + PR c++/24275 + * pt.c (instantiate_decl): Instantiate the initializer of + a static data member in the namespace containing the class + containing the static data member. + +2005-10-08 James A. Morrison + + PR c++/22172 + * parser.c (cp_parser_postfix_expression) : Treat nontype + scopes as nondependent. 2005-10-06 Volker Reichelt * call.c (resolve_args): Remove redundant test. +2005-10-05 Paolo Bonzini + + PR tree-optimization/21419 + PR tree-optimization/24146 + PR tree-optimization/24151 + + * semantics.c (finish_asm_stmt): Call readonly_error if outputs are + read-only. Set ASM_VOLATILE_P for asms without outputs. + +2005-10-05 Nathan Sidwell + + PR c++/23513 + * call.c (joust): Adjust length count to more_specialized_fn. + * pt.c (more_specialized_fn): Cope with non-static member vs + non-member. + +2005-10-04 Andrew Pinski + + PR middle-end/23125 + * decl.c (make_rtl_for_nonlocal_decl): Use set_user_assembler_name + instead of change_decl_assembler_name. + +2005-10-03 Alexandre Oliva + + * error.c (dump_type) : Print reworded message. + +2005-10-03 Mark Mitchell + + PR c++/17775 + * repo.c: Include flags.h. + (finish_repo): Add -frandom-seed to the arguments. + +2005-10-02 Mark Mitchell + + PR c++/22621 + * parser.c (cp_parser_template_argument): Don't turn "T::f" into + "(*this).T::f". + * pt.c (convert_nontype_argument): Remove ??? comment. + + PR c++/23840 + * tree.c (lvalue_p_1): A VA_ARG_EXPR with class type is an lvalue, + when class rvalues are lvalues. + +2005-09-28 Mark Mitchell + + PR c++/16782 + * decl.c (grokdeclarator): Always pedwarn about overqualified + member names. + +2005-09-27 Mark Mitchell + + PR c++/22147 + * name-lookup.c (maybe_process_template_type_declaration): Don't + treat forward declarations of classes as templates just because + we're processing_template_decl. + * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INFO for friend + functions. + +2005-09-26 Jason Merrill + + PR c++/13764 + * cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): New macro. + * name-lookup.c (pushdecl_maybe_friend): Check it. + * decl.c (begin_function_body): Do nothing if it's false. + (finish_function_body): Ditto. + (outer_curly_brace_block): New fn. + (finish_function): Use it. + +2005-09-26 Richard Guenther + + PR middle-end/15855 + * decl2.c (do_static_destruction): Remove. + (finish_static_initialization_or_destruction): Likewise. + (DECL_EFFECTIVE_INIT_PRIORITY): New macro. + (NEEDS_GUARD_P): Likewise. + (do_static_initialization): Rename to + do_static_initialization_or_destruction. Process all + initializers/destructors and handle common conditionalizing. + (start_static_initialization_or_destruction): Rename to + one_static_initialization_or_destruction. Handle only + decl-specific conditionalizing. + (cp_finish_file): Call do_static_initialization_or_destruction. + +2005-09-22 Jakub Jelinek + + PR c++/21983 + * class.c (find_final_overrider): Move diagnostic about no unique final + overrider to... + (update_vtable_entry_for_fn): ... here. + +2005-09-21 Mark Mitchell + + PR c++/23993 + * init.c (integral_constant_value): Use DECL_INTEGRAL_CONSTANT_VAR_P. + 2005-09-21 Volker Reichelt PR c++/23965 * call.c (resolve_args): Return error_mark_node on arguments whose TREE_TYPE is error_mark_node. -2005-09-21 Volker Reichelt +2005-09-20 Jakub Jelinek - PR c++/17609 - Backport: + PR c++/23947 + * rtti.c (get_pseudo_ti_init): Recompute ti pointer after + get_tinfo_ptr calls. - 2004-03-08 Mark Mitchell - * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL - in the innermost scope, rather than at namespace scope. - * name-lookup.c (push_local_binding): Give it external linkage. - * name-lookup.h (push_local_binding): Declare it. +2005-09-16 Mark Mitchell -2005-09-17 Volker Reichelt + PR c++/23914 + * parser.c (cp_parser_enclosed_template_argument_list): Make sure + skip_evaluation is false when processing template arguments. - Backport: + PR c++/21514 + * pt.c (check_instantiated_args): Treat uses of anonymous types as + causing type-deduction failure. - 2004-11-27 Mark Mitchell - PR c++/18368 - * parser.c (cp_parser_check_for_definition_in_return_type): Take - the defined type as a parameter, and inform the user about the - possibility of a missing semicolon. - (cp_parser_explicit_instantiation): Adjust call to - cp_parser_check_for_definition_in_return_type. - (cp_parser_init_declarator): Likewise. - (cp_parser_member_declaration): Likewise. +2005-09-15 Jason Merrill -2005-09-17 Volker Reichelt + PR c++/23357 + * cp-tree.def (SIZEOF_EXPR, ALIGNOF_EXPR): Change code class to + tcc_expression. - PR c++/18803 - Revert: +2005-09-15 Mark Mitchell - 2005-09-02 Volker Reichelt - PR c++/18445 - * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with - unknown_type as non matching. - * pt.c (build_non_dependent_expr): Do not build a - NON_DEPENDENT_EXPR for a VAR_DECL. + PR c++/23896 + * pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when + processing template arguments. + + * pt.c (check_explicit_instantiation_namespace): Fix typo. + + PR c++/13140 + * decl.c (check_class_member_definition_namespace): New function. + (grokfndecl): Use it. + (grokvardecl): Likewise. + (grokdecl): Improve documentation. + * pt.c (check_explicit_instantiation_namespace): New function. + (register_specialization): Call check_specialization_namespace + when replacing an implicitly instantiated function. + (check_explicit_specialization): Ensure that DECL_CONTEXT is set + correctly for namespace-scope specializations. + (do_decl_instantiation): Use + check_explicit_instantiation_namespace. + (do_type_instantiation): Likewise. + +2005-09-15 Nathan Sidwell + + PR c++/23725 + * error.c (dump_decl): Use USING_DECL_SCOPE. + +2005-09-13 Bastian Blank + + PR c++/16171 + * mangle.c (find_substitution): Do not use special substitutions + for identifiers not in std::. + +2005-09-13 Mark Mitchell + + PR c++/23839 + * typeck.c (cxx_mark_addressable): Only check DECL_HARD_REGISTER + for VAR_DECLs. + +2005-09-13 Mark Mitchell + + PR c++/23842 + * pt.c (tsubst_default_argument): Do treat default argument + expressions as occurring in the context of the function called. + +2005-09-12 Mark Mitchell + + PR c++/23841 + * parser.c (cp_parser_primary_expression): Recognize the closing + ">" of a template-argument-list after a floating-point literal as + the end of a cast expression. + +2005-09-12 Mark Mitchell + + PR c++/23789 + * cvt.c (perform_qualification_conversions): Don't create + unnecessary NOP_EXPRs. + * pt.c (tsubst_template_arg): Use fold_non_dependent_expr. + +2005-09-12 Ian Lance Taylor + + PR g++/7874 + * cp-tree.h (struct lang_decl_flags): Add hidden_friend_p + bitfield. Make dummy bitfield one bit smaller. + (DECL_HIDDEN_FRIEND_P): Define. + (pushdecl_maybe_friend): Declare. + (pushdecl_top_level_maybe_friend): Declare. + * decl.c (duplicate_decls): Add newdecl_is_friend parameter. + Change prototype and all callers. Add assertion that a + DECL_ARTIFICIAL FUNCTION_DECL is not DECL_HIDDEN_FRIEND_P. Set + DECL_ANTICIPATED and DECL_HIDDEN_FRIEND_P in duplicated decl if + appropriate. + * name-lookup.c (supplement_binding): Don't ignore a + DECL_HIDDEN_FRIEND_P. + (pushdecl_maybe_friend): Break out contents of pushdecl. Add + is_friend parameter. Set DECL_ANTICIPATED and + DECL_HIDDEN_FRIEND_P for a friend function. + (pushdecl): Just call pushdecl_maybe_friend. + (pushdecl_with_scope): Add is_friend parameter. Change prototype + and all callers. + (pushdecl_namespace_level): Likewise. + (push_overloaded_decl): Likewise. Check DECL_HIDDEN_FRIEND_P as + well as DECL_ANTICIPATED when checking for a builtin. + (do_nonmember_using_decl): Check DECL_HIDDEN_FRIEND_P as well as + DECL_ANTICIPATED when checking for a builtin. + (do_nonmember_using_decl): Likewise. + (pushdecl_top_level_1): Add is_friend parameter. Change all + callers. + (pushdecl_top_level_maybe_friend): New function. + (remove_hidden_names): New function. + (struct arg_lookup): Add args field. + (friend_of_associated_class_p): New static function. + (arg_assoc_namespace): Ignore hidden functions which are not + friends of an associated class of some argument. + (lookup_arg_dependent): Remove hidden functions from list passed + in. Initialize k.args. + * name-lookup.h (remove_hidden_names): Declare. + * friend.c (do_friend): Call pushdecl_maybe_friend instead of + pushdecl. + * call.c (add_function_candidate): Change DECL_ANTICIPATED test to + an assertion, with a check for DECL_HIDDEN_FRIEND_P. + (build_new_function_call): Add koenig_p parameter. Change + prototype and callers. + * pt.c (register_specialization): Add is_friend parameter. Change + all callers. + (push_template_decl_real): Change is_friend parameter to bool. + Change prototype and all callers. + (tsubst_friend_class): Call pushdecl_top_level_maybe_friend + instead of pushdecl_top_level. + +2005-09-11 Richard Henderson + + * decl2.c (build_anon_union_vars): Copy attributes from the base addr. + * pt.c (tsubst_decl): Substitute in DECL_VALUE_EXPR. + +2005-09-09 Gabriel Dos Reis + + * parser.c (cp_parser_translation_unit): Simplify. The while-block + was actually executed at most once. + +2005-09-09 Richard Henderson + + PR debug/20998 + * cp-tree.def (ALIAS_DECL): Remove. + * cp-lang.c (cp_init_ts): Remove support for it. + * error.c (dump_decl): Likewise. + * name-lookup.c (pushdecl): Likewise. + * semantics.c (finish_id_expression): Likewise. + * decl2.c (build_anon_union_vars): Use a VAR_DECL with + DECL_VALUE_EXPR instead. + +2005-09-09 Mark Mitchell + + PR c++/22252 + * decl.c (start_preparsed_function): Do not pay attention to + #pragma interface for implicitly-defined methods. + * decl2.c (cp_finish_file): Do not complain about uses of inline + functions that have bodies, even if we decided not to emit the + body in this translation unit. + * semantics.c (note_decl_for_pch): Do not mess with linkage. + (expand_or_defer_fn): Make inline, non-template functions COMDAT + at this point. + +2005-09-08 Richard Henderson + + PR debug/23190 + * decl.c (wrapup_globals_for_namespace): Call + emit_debug_global_declarations. + * decl2.c (cp_finish_file): Likewise. + +2005-09-08 Mark Mitchell + + PR c++/23691 + * decl2.c (mark_used): Instantiate static data members initialized + by constants, even in a template. + +2005-09-08 Andrew Pinski + + PR obj-c++/16816 + * parser.c (cp_parser_objc_selector_expression): Treat CPP_SCOPE as + two CPP_COLON. + +2005-09-07 Richard Guenther + + * cp-gimplify.c (cp_gimplify_expr): Create empty CONSTRUCTOR + for EMPTY_CLASS_EXPR. + +2005-09-06 Jakub Jelinek + + PR c/23075 + * typeck.c (check_return_expr): Add no_warning argument. Set + *no_warning to true if "return-statement with no value, in function + returning" warning has been issued. + * cp-tree.h (check_return_expr): Adjust prototype. + * semantics.c (finish_return_stmt): Set TREE_NO_WARNING if + check_return_expr set *no_warning to true. + +2005-09-06 Mark Mitchell + + * cp-tree.h (rvalue): New function. + * call.c (build_conditional_expr): Use it. + * init.c (build_new_1): Likewise. + * rtti.c (build_dynamic_cast_1): Likewise. + * tree.c (rvalue): New function. + * typeck.c (build_unary_op): Use it. + (build_static_cast_1): Likewise. + + PR c++/9782 + * init.c (build_new_1): Make sure the entire array type is + complete, not just its element types. 2005-09-06 Volker Reichelt - Backport: + * decl.c (check_elaborated_type_specifier): Remove redundant check. - 2004-12-14 Mark Mitchell - PR c++/18738 - * decl.c (make_typename_type): Do not handle namespace-scoped - names here. - (tag_name): Handle typename_type. - (check_elaborated_type_specifier): Handle typenames. - * parser.c (cp_parser_diagnose_invalid_type_name): Do not call - make_typename_type for namespace-scoped names here. - (cp_parser_elaborated_type_specifier): Use - cp_parser_diagnose_invalid_type_name. +2005-09-06 Jakub Jelinek -2005-09-03 Volker Reichelt + PR c++/23056 + * typeck.c (ignore_overflows): New helper function. + (build_static_cast_1): Use it. - Backport: +2005-09-06 Kazu Hirata - 2005-08-26 Mark Mitchell - PR c++/19004 - * pt.c (uses_template_parms): Handle IDENTIFIER_NODE. - (type_dependent_expression_p): Allow BASELINKs whose associated - functions are simply a FUNCTION_DECL. + * cp-tree.h, decl.c, decl2.c, semantics.c: Fix comment typos. + Follow spelling conventions. -2005-09-02 Volker Reichelt +2005-09-05 Mark Mitchell - PR c++/22233 - * pt.c (push_template_decl_real): Return error_mark_node if the - number of template parameters does not match previous definition. - * decl.c (start_function): Handle error_mark_node returned by - push_template_decl. + PR c++/23667 + * pt.c (tsubst_decl): Clear DECL_TEMPLATE_INSTANTIATED when + copying a VAR_DECL. -2005-09-02 Volker Reichelt +2005-09-05 Mark Mitchell - Backport: + PR c++/21440 + * semantics.c (finish_stmt_expr_expr): Add an explicit + initialization to the last statement in the statement-expression. + * (finish_stmt_expr): Adjust accordingly. - 2004-11-25 Mark Mitchell - PR c++/18466 - * decl.c (grokvardecl): Keep track of whether or not a there was - explicit qualification. - * name-lookup.c (set_decl_namespace): Complain about explicit - qualification of a name within its own namespace. +2005-09-03 Mark Mitchell -2005-09-02 Volker Reichelt + PR c++/23699 + * decl2.c (mark_used): Always instantiate static data members + initialized by constant expressions. + * pt.c (instantiate_decl): Instantiate the initializers for static + data members initialized by constant expressions. - Backport: + PR c++/21687 + * semantics.c (expand_or_defer_fn): Do not call ggc_collect when + finishing processing for a template function in a local class. + Revert: + 2005-09-02 Mark Mitchell + * parser.c (cp_parser_class_specifier): Push/pop GC contexts + around functions in local classes. - 2004-11-25 Mark Mitchell - PR c++/18445 - * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with - unknown_type as non matching. - * pt.c (build_non_dependent_expr): Do not build a - NON_DEPENDENT_EXPR for a VAR_DECL. +2005-09-02 Mark Mitchell -2005-09-01 Volker Reichelt + PR c++/21687 + * parser.c (cp_parser_class_specifier): Push/pop GC contexts + around functions in local classes. - Backport: +2005-08-31 Andrew Pinski - 2004-11-27 Mark Mitchell - PR c++/18512 - * parser.c (cp_parser_postfix_expression): Robustify. + PR obj-c++/23640 + * decl2.c (cp_finish_file): If this is obj-c++ and we need a static + init, call generate_ctor_or_dtor_function. -2005-09-01 Volker Reichelt - - Backport: - - 2004-11-25 Mark Mitchell - PR c++/18545 - * typeck.c (check_return_expr): Robustify. - -2005-09-01 Volker Reichelt - - Backport: - - 2005-02-22 Mark Mitchell - PR c++/20153 - * decl2.c (build_anon_union_vars): Add type parameter. - (finish_anon_union): Pass it. - - 2005-07-28 Mark Mitchell - PR c++/22545 - * call.c (add_builtin_candidate): Adjust for changes in - representation of pointer-to-member types. - -2005-09-01 Volker Reichelt +2005-08-31 Volker Reichelt PR c++/13377 * parser.c (cp_parser_lookup_name): Pass LOOKUP_COMPLAIN to @@ -347,57 +4632,581 @@ 2005-08-31 Volker Reichelt + PR c++/23639 + * semantics.c (qualified_name_lookup_error): Do not complain again + on invalid scope. + +2005-08-30 Volker Reichelt + PR c++/23586 * parser.c (cp_parser_namespace_name): Move diagnostic for invalid namespace-name to here from ... * name-lookup.c (do_namespace_alias): ... here and ... (do_using_directive): ... here. Remove dead code. -2005-08-31 Volker Reichelt +2005-08-28 Mark Mitchell - PR c++/23639 - * semantics.c (qualified_name_lookup_error): Do not complain again - on invalid scope. + PR c++/23099 + * cp-tree.h (saved_scope): Add skip_evaluation. + * decl.c (start_decl): Use DECL_INITIALIZED_IN_CLASS_P, not + DECL_INITIAL, to determine whether or not a static data member was + initialized in the class-specifier. + (cp_finish_decl): Add comment. + * init.c (integral_constant_value): Subtitute into the + initializers for static data members in templates. + * name-lookup.c (push_to_top_level): Save skip_evaluation. + (pop_from_top_level): Restore it. + * pt.c (instantiate_class_template): Do not substitute into the + intializers of static data members when instantiating a class. + (regenerate_decl_from_template): Simplify. + (instantiate_decl): Tidy. Substitute into the initializer for a + static data member even when the definition of the data member is + not available. -2005-07-28 Giovanni Bajo +2005-08-26 Mark Mitchell - Backport: + PR c++/19004 + * pt.c (uses_template_parms): Handle IDENTIFIER_NODE. + (type_dependent_expression_p): Allow BASELINKs whose associated + functions are simply a FUNCTION_DECL. - 2004-09-16 Mark Mitchell - PR c++/16002 - * parser.c (cp_parser_simple_declaration): Commit to tentative - parses after seeing a decl-specifier. - (cp_parser_simple_declaration): Eliminate spurious message. - (cp_parser_init_declarator): Adjust error message. + PR c++/23491 + * cp-tree.h (build_vec_init): Adjust prototype. + * init.c (perform_member_init): Adjust call to build_vec_init. + (build_aggr_init): Likewise. + (build_new_1): Do not call build_default_init for array types. + (build_vec_init): Add explicit_default_init_p parameter. Perform + default initialization of vector elements when set. + * typeck.c (build_modify_expr): Adjust call to build_vec_init. + +2005-08-25 Nathan Sidwell + + PR c++/20817 + * typeck.c (build_x_unary_op): Make sure OFFSET_REF is not for a + ->*. + +2005-08-24 Nathan Sidwell + + PR c++/22454 + * parser.c (cp_lexer_peek_nth_token): Relax assert. + +2005-08-23 Nathan Sidwell + + PR c++/23044 + * pt.c (tsubst_qualified_id): A SCOPE_REF can still remain. + +2005-08-22 James E Wilson + + PR tree-optimization/23426 + * decl.c (grokdeclarator): Use TYPE_SIZE_UNIT not TYPE_SIZE for + array size check. + +2005-08-22 Volker Reichelt + + PR c++/22233 + * pt.c (push_template_decl_real): Return error_mark_node if the + number of template parameters does not match previous definition. + +2005-08-22 Volker Reichelt + + PR c++/23089 + * decl.c (require_complete_types_for_parms): Mark incomplete types + as invalid. + +2005-08-19 Volker Reichelt + + * parser.c (cp_parser_nth_token_starts_template_argument_list_p): + Fix typo in leading comment. + +2005-08-15 Kaveh R. Ghazi + + * name-lookup.c, ptree.c: Delete HOST_PTR_PRINTF. + +2005-08-15 Fariborz Jahanian + + * cp-tree.h (can_convert_arg, fn_type_unification): New argument. + * call.c (add_template_candidate_real): Pass down 'flags' to + fn_type_unification. + (can_convert_arg): New 'flags' argument. Pass it to call to + implicit_conversion instead of LOOKUP_NORMAL. + (can_convert): Add LOOKUP_NORMAL to call to can_convert_arg. + * class.c (resolve_address_of_overloaded_function): Ditto. + (resolve_address_of_overloaded_function): Ditto. + * decl.c (reshape_init, check_default_argument): Ditto. + * typeck.c (build_ptrmemfunc): Ditto. + * pt.c (type_unification_real): Add 'flags' argument. + (fn_type_unification): Pass 'flags' to type_unification_real. + (type_unification_real): Pass new 'flags' argument to call to + can_convert_arg. + +2005-08-12 Giovanni Bajo + Nathan Sidwell + + PR c++/21799 + PR c++/8271 + * pt.c (unify) : Check this-pointer cv-qualifiers + explicitly. + +2005-08-12 Nathan Sidwell + + PR c++/21799 + Revert my 2005-07-08 patch + * pt.c (type_unification_real): Remove is_method_argument and + assoicated checks. + (fn_type_unification, unify): Adjust type_unification_real calls. + +2005-08-11 Volker Reichelt + + PR c++/23266 + * decl2.c (grokfield): Check that method is not static before + marking it as pure. + +2005-08-11 Nathan Sidwell + + PR c++/23219 + * name-lookup.c (pushtag): Process the template type before + altering the identifier lookup fields. Remove unreachable code + creating an empty stub decl. + +2005-08-10 Volker Reichelt + + PR c++/20646 + * decl.c (grokdeclarator): Reset storage_class after error. + +2005-08-08 Volker Reichelt + + PR c++/22508 + * init.c (build_new_1): Check for empty candidate list. + +2005-08-06 Volker Reichelt + + PR c++/23191 + * pt.c (tsubst) : Check for error_mark_node + before calling build_exception_variant. + +2005-08-06 Volker Reichelt + + PR c++/19498 + * pt.c (tsubst_decl) : Return ERROR_MARK_NODE + if substitution of template args did not succeed. + +2005-08-06 Michael Matz + + * method.c (use_thunk): Call init_insn_lengths. + +2005-08-05 James A. Morrison + + PR c++/22514 + * name-lookup.c (cp_emit_debug_info_for_using): Do nothing if + sorrycount or errorcount are nonzero. + +2005-08-05 Mark Mitchell + + * name-lookup.c (pushtag): Remove accidental commit from: + 2004-12-21 Mark Mitchell + PR c++/19063 + * decl.c (grokdeclarator): Return error_mark_node, not + void_type_node, to indicate errors. + * parser.c (cp_parser_template_parameter_list): Robustify. + (cp_parser_template_parameter): Likewise. + +2005-08-01 Kazu Hirata + + * class.c, decl.c, name-lookup.c, pt.c, typeck.c, typeck2.c: + Fix comment typos. + +2005-07-29 Kazu Hirata + + * method.c: Fix a comment typo. + +2005-07-28 Mark Mitchell + + PR c++/22545 + * call.c (add_builtin_candidate): Adjust for changes in + representation of pointer-to-member types. + +2005-07-28 Mike Stump + + * pt.c (check_explicit_specialization): Add visibility logic. + (lookup_template_class): Likewise. + (instantiate_class_template): Likewise. + +2005-07-27 Devang Patel + + * name-lookup.c (pushtag): Do no set DECL_IGNORED_P bit. + +2005-07-25 Ian Lance Taylor + + * ptree.c (cxx_print_identifier): Print a leading space if the + indent level is 0. + +2005-07-24 Kaveh R. Ghazi + + * call.c (convert_for_arg_passing): Check function pointers when + -Wmissing-format-attribute is activated. + * typeck.c (convert_for_assignment): Likewise. + +2005-07-22 Manfred Hollstein + + * parser.c (cp_parser_declaration): Fix unitialised warnings. + +2005-07-21 Andrew Pinski + + * class.c (build_base_path): Fix typo. + +2005-07-21 Andrew Pinski + + PR C++/22358 + * class.c (build_base_path): Convert BINFO_OFFSET to the correct type. + +2005-07-21 Volker Reichelt + + * call.c: Fix comment typo(s). + * cxx-pretty-print.h: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + +2005-07-20 Douglas Gregor + + PR c++/2922 + * semantics.c (perform_koenig_lookup): For dependent calls, just + return the set of functions we've found so far. Later, it will be + augmented by those found through argument-dependent lookup. + * name-lookup.c (lookup_arg_dependent): Implement DR 164 by removing + the optimization that skips namespaces where the functions were + originally found. + +2005-07-20 Giovanni Bajo + + Make CONSTRUCTOR use VEC to store initializers. + * call.c (convert_default_arg): Update call to digest_init. + * class.c (dump_class_hierarchy, dump_array): Update to cope with + VEC in CONSTRUCTOR_ELTS. + * cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise. + (finish_compound_literal, digest_init): Update declaration. + * decl.c (struct reshape_iter): New data type. + (reshape_init_array): Rename to... + (reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS. + (reshape_init): Rewrite from scratch. Split parts into... + (reshape_init_array, reshape_init_vector, reshape_init_class, + reshape_init_r): New functions. + (check_initializer): Update call to reshape_init. Remove obsolete + code. + (initialize_artificial_var, cp_complete_array_type): Update to cope + with VEC in CONSTRUCTOR_ELTS. + * decl2.c (grokfield): Update calls to digest_init. + (mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS. + * error.c (dump_expr_init_vec): New function. + (dump_expr): Use dump_expr_init_vec. + * init.c (build_zero_init, build_vec_init): Update to cope with VEC + in CONSTRUCTOR_ELTS. + (expand_default_init): Update call to digest_init. + * parser.c (cp_parser_postfix_expression): Use a VEC for the + initializers. + (cp_parser_initializer_list): Build a VEC of initializers. + * pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC + in CONSTRUCTOR_ELTS. + * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer, + ptm_initializer, class_initializer, get_pseudo_ti_init): Use + build_constructor_from_list instead of build_constructor. + * semantics.c (finish_compound_literal): Update call to digest_init. + * tree.c (stabilize_init): Update to cope with VEC in + CONSTRUCTOR_ELTS. + * typeck.c (build_ptrmemfunc1): Likewise. + * typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1): + Likewise. + (store_init_value): Use build_constructor_from_list and update call + to digest_init. + (digest_init): Rewrite. + (process_init_constructor): Rewrite from scratch. Split into... + (process_init_constructor_array, picflag_from_initializer, + process_init_constructor_record, process_init_constructor_union): + New functions. + (PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE): + New macros. + (build_functional_cast): Use build_constructor_from_list instead of + build_constructor. + +2005-07-18 Mark Mitchell + + PR c++/22263 + * cp-tree.h (instantiate_decl): Change prototype. + * decl2.c (mark_used): Adjust accordingly. + * pt.c (do_decl_instantiation): Likewise. + (instantiate_class_member): Likewise. + (instantiate_decl): Rename undefined_ok as expl_inst_class_mem_p. + Clear DECL_INTERFACE_KNOWN for an explicitly instantiated template + that has no definition available. + (instantiate_pending_templates): Adjust call to instantiate_decl. + +2005-07-17 Mark Mitchell + + PR c++/22139 + * cp-tree.h (DECL_TEMPLATE_INFO): Improve documentation. + * decl.c (duplicate_decls): Re-register template specializations + for functions that have DECL_TEMLPLATE_INFO, even if they do not + have DECL_TEMPLATE_INSTANTIATION set. + +2005-07-16 Kaveh R. Ghazi + + * call.c (diagnostic_fn_t): New. + (build_temp, convert_like_real): Use diagnostic_fn_t. + +2005-07-15 Mark Mitchell + + PR c++/22204 + * repo.c (repo_emit_p): Robustify. + +2005-07-14 Daniel Berlin + + Fix PR c++/22452 + * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL. + +2005-07-15 Mark Mitchell + + PR c++/22132 + * call.c (implicit_conversion): Add c_cast_p parameter. + (standard_conversion): Likewise. Allow conversions between + differently-qualified pointer types when performing a C-style + cast. + (add_function_candidate): Adjust callee. + (build_builtin_candidate): Likewise. + (build_user_type_conversion_1): Likewise. + (conditional_conversion): Likewise. + (can_convert_arg): Likewise. + (can_convert_arg_bad): Likewise. + (perform_implicit_conversion): Likewise. + * cp-tree.h (comp_ptr_ttypes_const): Declare. + * typeck.c (comp_ptr_ttypes_const): Give it external linkage. + Return bool. + +2005-07-12 Volker Reichelt + Nathan Sidwell + + PR c++/20172 + * pt.c (tsubst_template_parms): Check for invalid non-type + parameters. + +2005-07-09 Andrew Pinski + + * cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup, + decl_shadowed_for_var_insert): Move over to cp-objcp-common.c. + (cp_init_ts): Call init_shadowed_var_for_decl. + Remove include of gt-cp-cp-lang.h. + * cp-objcp-common.c (shadowed_var_for_decl, + decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from + cp-lang.c. + (init_shadowed_var_for_decl): New function to initialize + shadowed_var_for_decl. + Include gt-cp-cp-objcp-common.h. + * Make-lang.in (gt-cp-lang.h): Remove. + (gt-cp-cp-objcp-common.h): Add. + (cp/cp-lang.o): Remove dependancy on gt-cp-lang.h. + (cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h. + * config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c. + * cp-tree (init_shadowed_var_for_decl): Add prototype. + +2005-07-08 Daniel Berlin + + * Make-lang.in: Add gt-cp-lang.h. + (cp-lang.o): Ditto. + * class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on + the field. + * config-lang.in: Add cp-lang.c to gtfiles. + * cp-lang.c: Include hashtab.h. + (cp_init_ts): New function. + (LANG_HOOK_INIT_TS): Use macro. + (decl_shadowed_for_var_lookup): New function. + (decl_shadowed_for_var_insert): Ditto. + * cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common. + (NON_THUNK_FUNCTION_CHECK): Ditto. + (DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common. + (DECL_INIT_PRIORITY): Ditto. + (DECL_HAS_SHADOWED_FOR_VAR_P): Ditto. + (DECL_SHADOWED_FOR_VAR): Use hashtable. + (SET_DECL_SHADOWED_FOR_VAR): Ditto. + * decl.c (duplicate_decls): Update for new/updated structures. + (poplevel): Use SET_DECL_SHADOWED_FOR_VAR. + * decl2.c (start_static_initialization_or_destruction): Deal with + priority. + * pt.c (tsubst_decl): Check TS_DECL_WRTL before doing + SET_DECL_RTL. + * tree.c (handle_init_priority_attribute): Handle priority. + +2005-07-08 Nathan Sidwell + + PR c++/21799 + * pt.c (type_unification_real): Add is_method argument. Use it + for this pointer unification. + (fn_type_unification): Adjust type_unification_real call. + (unify): Likewise. + +2005-07-07 Nathan Sidwell + + * pt.c (type_unification_real): Remove allow_incomplete argument. + Remove unreachable code. + (fn_type_unification): Adjust call to type_unification_real. + (unify): Likewise. + +2005-07-05 Paolo Bonzini + + * Makefile.in (class.o, decl2.o): Adjust dependencies. + * class.c: Include tree-dump.h. + * decl2.c: Include tree-dump.h. + +2005-07-02 Gabriel Dos Reis + + * dump.c: Use dump_string_field. + +2005-07-03 Joseph S. Myers + + * cp-tree.h (GCC_DIAG_STYLE): #undef before defining. Change + minimum GCC version for format checking to 4.1. + +2005-07-02 Kazu Hirata + + * Make-lang.in (cc1plus-checksum.c): Use + build/genchecksum$(build_exeext), not build/genchecksum$(exeext). + +2005-07-02 Joseph S. Myers + + * name-lookup.c, parser.c: Use %q, %< and %> to quote in + diagnostics. + +2005-07-02 Zack Weinberg + Joseph S. Myers + + * error.c (location_of): Add comment. + (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. + * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. + * call.c, class.c, decl.c, decl2.c, friend.c, init.c, + name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c, + typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at + or cp_pedwarn_at. Mark up some diagnostic strings with N_. + +2005-06-30 Daniel Berlin + + * decl.c (require_complete_types_for_parms): Call relayout_decl + instead of layout_decl. + +2005-06-30 Zack Weinberg + Jakub Jelinek + + * cp-lang.c: No need to include cxx-pretty-print.h. + * error.c (cp_printer): Update signature. No need to process + flags. + (print_instantiation_partial_context): Output last newline + with pp_base_newline. + * Make-lang.in: Update dependencies. + +2005-06-30 Steven Bosscher + + * decl.c (start_decl): Replace DECL_THREAD_LOCAL with + DECL_THREAD_LOCAL_P. + (cp_finish_decl): Likewise. + (grokvardecl): Set the default DECL_TLS_MODEL here. + +2005-06-28 Joseph S. Myers + + * cvt.c (ocp_convert): Use invalid_conversion hook. + * typeck.c (build_binary_op): Use invalid_binary_op hook. + (build_unary_op): Use invalid_unary_op hook. + +2005-06-28 Paul Brook + + * Make-lang.in (cp/except.o): Depend on $(TARGET_H) + * except.c: Include target.h. + (init_exception_processing): Initialize unwind_resume_libfunc. + * doc/tm.texi: Document TARGET_ASM_TTYPE + +2005-06-26 Kaveh R. Ghazi + + * call.c (build_over_call): Pass in named argument list to + `check_function_arguments'. + * typeck.c (build_function_call): Likewise. + +2005-06-26 Kaveh R. Ghazi + + * cp-tree.h (lang_check_failed): Add noreturn attribute. + +2005-06-25 Kelley Cook + + * all files: Update FSF address in copyright headers. + +2005-06-23 Jason Merrill + + PR c++/19317 + * semantics.c (simplify_aggr_init_expr): Use + CALL_EXPR_RETURN_SLOT_OPT, not CALL_EXPR_HAS_RETURN_SLOT_ADDR. + +2005-06-23 Volker Reichelt + + * pt.c (register_specialization): Remove superfluous assertion. + +2005-06-18 Kaveh R. Ghazi + + * call.c (convert_like_real): Add format attribute. + * typeck.c (check_for_casting_away_constness, + build_static_cast_1): Likewise. + * typeck2.c (readonly_error, cxx_incomplete_type_diagnostic): + Likewise. + +2005-06-17 Geoffrey Keating - 2005-06-17 Geoffrey Keating PR c++/17413 * pt.c (type_unification_real): Apply template type deduction even to procedure parameters that are not dependent on a template parameter. - 2004-11-02 Mark Mitchell - PR c++/18124 - * parser.c (cp_parser_type_parameter): Robustify. - PR c++/18155 - * parser.c (cp_parser_single_declaration): Disallow template - typedefs. - (cp_parser_typedef_p): New function. +2005-06-16 Nathan Sidwell - 2004-12-21 Mark Mitchell - PR c++/18378 - * call.c (convert_like_real): Do not permit the use of a copy - constructor to copy a packed field. + * rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might + change. + (create_pseudo_type_info): First parameter is an int. -2005-07-25 Giovanni Bajo +2005-06-15 Nathan Sidwell - PR c++/19208 - * pt.c (tsubst): Use fold_non_dependent_expr to fold array domains. + PR c++/20678 + * error.c (dump_expr) : Check DECL_NAME is not + null. -2005-06-14 Mark Mitchell + * Make-lang.in: Reformat some long lines. + (gt-cp-rtti.h): New target. + (cp/rtti.o): Add dependency. + * config-lang.in (gtfiles): Add cp/rtti.c. + * cp-tree.h (CPTI_TI_DESC_TYPE, CPTI_BLTN_DESC_TYPE, + CPTI_PTR_DESC_TYPE, CPTI_ARY_DESC_TYPE, CPTI_FUNC_DESC_TYPE, + CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, + CPTI_SI_CLASS_DESC_TYPE, CPTI_VMI_CLASS_DESC_TYPE, + CPTI_PTM_DESC_TYPE, CPTI_BASE_DESC_TYPE): Remove. + (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node, + ary_desc_type_node, func_desc_type_node, enum_desc_type_node, + class_desc_type_node, si_class_desc_type_node, + vmi_class_desc_type_node, ptm_desc_type_node, + base_desc_type_node): Remove. + * decl.c: Adjust documentation of global trees. + * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL, + TINFO_REAL_NAME): Remove. + (struct tinfo_s): New. + (enum tinfo_kind): New. + (tinfo_descs): New. + (get_tinfo_decl): Adjust use of tinfo descriptor. + (tinfo_base_init, generic_initializer, ptr_initializer, + ptm_initializer, class_initializer): Likewise. + (get_pseudo_ti_init): Take descriptor index. Adjust. + (create_pseudo_type_info): Likewise. + (get_pseudo_ti_desc): Return descriptor index. Adjust. + (create_tinfo_types): Adjust use of create_pseudo_type_info. + (emit_tinfo_decl): Adjust use of tinfo descriptor. - PR c++/21987 - * decl.c (grok_op_properties): Add missing warn_conversion check. +2005-06-14 Roger Sayle + + * decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST. + +2005-06-13 Geoffrey Keating + + * Make-lang.in (c++.install-man): Doesn't really depend on installdirs. + (rule for installing g++.1 manpage): Does depend on installdirs. 2005-06-13 Nathan Sidwell @@ -405,6 +5214,25 @@ * decl.c (cp_finish_decl): Clear runtime runtime initialization if in-class decl's initializer is bad. + PR c++/21929 + * parser.c (struct cp_parser): Document that scope could be + error_mark. + (cp_parser_diagnose_invalid_type_name): Cope with error_mark for + scope. + (cp_parser_nested_name_specifier): Return NULL_TREE on error. + (cp_parser_postfix_expression): Deal with null or error_mark + scope. + (cp_parser_elaborated_type_specifier): Adjust + cp_parser_nested_name_specifier call. + + * parser (cp_parser_skip_to_end_of_block_or_statement): Cleanup. + +2005-06-12 Roger Sayle + + PR c++/21930 + * error.c (dump_expr): UNARY_PLUS_EXPR need not handle void types. + Treat CONVERT_EXPR identically to NOP_EXPR. + 2005-06-10 Aldy Hernandez PR c++/10611 @@ -412,42 +5240,91 @@ * typeck.c (build_binary_op): Handle vectors. (common_type): Same. (type_after_usual_arithmetic_conversions): Same. - * testsuite/g++.dg/conversion/simd2.C: New. 2005-06-08 Nathan Sidwell - PR c++/21903 - * cp-tree.def (DEFAULT_ARG): Document TREE_CHAIN use. - * parser.c (cp_parser_late_parsing_default_args): Propagate parsed - argument to any early instantiations. - * pt.c (tsubst_arg_types): Chain early instantiation of default - arg. - - PR c++/19884 - * pt.c (check_explicit_specialization): Make sure namespace - binding lookup found an overloaded function. - (lookup_template_function): Just assert FNS is an overloaded - function. - - PR c++/19608 - * parser.c (cp_parser_late_parsing_for_member): Use - current_function_decl as scope to push to and from. - testsuite: + PR c++/19497 + * cp-tree.def (USING_DECL): Update documentation. + * cp-tree.h (DECL_DEPENDENT_P): New. + (USING_DECL_DECLS, USING_DECL_SCOPE): New. + * class.c (handle_using_decl): Move most of the processing to ... + * name-lookup.c (do_class_using_decl): ... here. Make stricter. + (push_using_decl): Use USING_DECL_SCOPE. + (cp_emit_debug_info_for_using): Make extern. + * cxx-pretty-print.c (pp_cxx_statement) : Adjust. + * name-lookup.h (cp_emit_debug_info_for_using): Declare. + * pt.c (tsubst_decl) : Use do_class_using_decl + when tsubsting. + (tsubst_expr): Use USING_DECL_SCOPE. + * search.c (lookup_field_1): Use DECL_DEPENDENT_P. + * semantics.c (finish_member_declaration): Likewise. 2005-06-08 Volker Reichelt + PR c++/19894 + * pt.c (tsubst): Reject pointer-to-member of type void. + PR c++/20563 * parser.c (cp_parser_label_declaration): Deal with invalid/missing identifiers. +2005-06-07 Nathan Sidwell + + * cp-tree.def (DEFAULT_ARG): Adjust documentation. + * cp-tree.h (DEFARG_INSTANTIATIONS): New. + (struct tree_default_arg): Add instantiations member. + * parser.c (cp_parser_late_parsing_default_args): Adjust to use a + VEC. + * pt.c (tsubst_arg_types): Likewise. + + * parser.c (cp_parser_late_parsing_default_args): Fix overeager + assert in previous patch. + +2005-06-06 Jakub Jelinek + + * error.c (locate_error): Use gmsgid instead of msgid for argument + name. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise. + +2005-06-06 Nathan Sidwell + + PR 21903 + * cp-tree.def (DEFAULT_ARG): Document TREE_CHAIN use. + * parser.c (cp_parser_late_parsing_default_args): Propagate parsed + argument to any early instantiations. + * pt.c (tsubst_arg_types): Chain early instantiation of default arg. + + PR c++/20637 + * cp-tree.h (add_method): Add using_decl parameter. + * class.c (add_method): Add using_decl parameter. Adjust error + messages. + (handle_using_decl): Pass the using decl to add_method. + (clone_function_decl): Adjust add_member calls. + * decl2.c (check_classfn): Likewise. + * method.c (lazily_declare_fn): Likewise. + * semantics.c (finish_member_declaration): Likewise. + + * method.c (synthesize_method): Use inform, not warning. + +2005-06-06 Hans-Peter Nilsson + + * config-lang.in (target_libs): Remove target-gperf. + +2005-06-05 Mark Mitchell + + PR c++/21619 + * cp-tree.h (DECL_IS_BUILTIN_CONSTANT_P): New macro. + * parser.c (cp_parser_postfix_expression): Allow non-constant + expressions as arguments to __builtin_constant_p. + * tree.c (builtin_valid_in_constant_expr_p): Use + DECL_IS_BUILTIN_CONSTANT_P. + 2005-06-03 Mark Mitchell PR c++/21853 * typeck.c (casts_away_constness_r): Do not drop cv-qualifiers on the pointed-to type for a pointer-to-member. -2005-06-03 Mark Mitchell - PR c++/21336 * cp-tree.h (grok_op_properties): Remove friendp parameter. * decl.c (grokfndecl): Adjust call. @@ -455,73 +5332,516 @@ a member by looking at its DECL_CONTEXT, not current_class_type. * pt.c (tsubst_decl): Adjust call to grok_op_properties. +2005-06-02 Nathan Sidwell + + * method.c (synthesize_method): Add addtional arg to warning call. + + PR c++/21280 + * Make-lang.in (method.o): Add diagnostic.h + * decl.c (start_preparsed_function): Use decl's location for file + info. + * decl2.c (cp_finish_file): Set input_location before synthesizing + a function. + (mark_used): When deferring a synthesized function, save current + location. Do not set function's location when actually + synthesizing it. + * method.c: #include diagnostic.h. + (synthesize_method): Set the functions source location. Show + needed location if errors are emitted. + + * decl.c (start_decl): Simplify specialization handling. Remove + unneeded CLASSTYPE_TEMPLATE_INSTANTIATION check. + * mangle.c (discriminator_for_local_entity): Use VEC_index. + + PR c++/20350 + * decl.c (duplicate_decls): Copy all of DECL_USE_TEMPLATE. + + PR c++/21151 + * name-lookup.c (pushtag): Push local class even in a template. + +2005-05-31 Nathan Sidwell + + PR c++/21165 + * init.c (integral_constant_value): Check the type of the + initializer, not the decl. + +2005-05-30 Mark Mitchell + + PR c++/21784 + * name-lookup.c (do_nonmember_using_decl): Ignore builtin + functions, even when the used name is not a function. + +2005-05-30 Kazu Hirata + + * operators.def, optimize.c: Update copyright. + +2005-05-28 Mark Mitchell + + PR c++/21210 + * call.c (standard_conversion): Permit conversions to complex + types if conversion to the corresponding scalar type would be + permitted. + + PR c++/21340 + * method.c (implicitly_declare_fn): Clear processing_template_decl + when generating implicit declaration. + +2005-05-27 Mark Mitchell + + PR c++/21614 + * typeck.c (get_member_function_from_ptrfunc): Do not attempt + conversions to base classes of incomplete types. + +2005-05-27 Ian Lance Taylor + + * semantics.c (add_stmt): Add C++ frontend specific version. + * cp-tree.h (STMT_IS_FULL_EXPR_P): Define. + (stmts_are_full_exprs_p): Declare. + +2005-05-27 Roger Sayle + Giovanni Bajo + + * cp-tree.def (UNARY_PLUS_EXPR): New C++ unary tree code. + * parser.c (cp_parser_unary_expression): Use UNARY_PLUS_EXPR instead + of CONVERT_EXPR. + (cp_parser_unary_expression): Likewise. + * typeck.c (build_unary_op): Likewise. + * call.c (add_builtin_candidate, build_new_op): Likewise. + * error.c (dump_expr): Likewise. + * pt.c (tsubst_copy, tsubst_copy_and_build): Likewise. + * decl.c (ambi_op_p, grok_op_properties): Likewise. + * dump.c (dump_op): Likewise. + * lex.c (init_operators): Likewise. + * operators.def ("+"): Likewise. + * cp-gimplify.c (cp_gimplify_expr): Handle UNARY_PLUS_EXPR like a + conversion, if the result and argument types differ. + * tree.c (fold_if_not_in_template): Fold UNARY_PLUS_EXPR much + like a NOP_EXPR when !processing_template_decl. + + * cxx-pretty-print.c (pp_cxx_cast_expression): Prototype. + (pp_cxx_unary_expression): Handle new UNARY_PLUS_EXPR tree code. + +2005-05-27 Nathan Sidwell + + PR c++/21455 + * typeck.c (get_delta_difference): Cope with incomplete but equal + classes. Reorder if. + + PR c++/21681 + * parser.c (cp_parser_late_parsing_for_member): Disable access + checking for template functions. + 2005-05-26 Volker Reichelt PR c++/21768 * pt.c (redeclare_class_template): Change error message according to coding conventions. -2005-05-19 Release Manager +2005-05-26 Volker Reichelt - * GCC 3.4.4 released. + * call.c (build_op_delete_call): Fix quoting in error message. -2005-05-08 Nathan Sidwell +2005-05-25 Richard Henderson - PR c++/21427 - Backport 2005-03-01 Nathan Sidwell - * class.c (update_vtable_entry_for_fn): Don't crash on invalid - covariancy. + PR libgcj/21692 + * cp-tree.h (make_alias_for): Declare. + * decl2.c (build_java_method_aliases): New. + (cp_finish_file): Call it. + * method.c (make_alias_for): Split out from ... + (make_alias_for_thunk): ... here. - * cp-tree.h (THUNK_TARGET): Expand comment. - * method.c (use_thunk): Make sure we also use the target, if that - is a thunk. +2005-05-25 Volker Reichelt - Backport 2005-02-11 Nathan Sidwell - * class.c (update_vtable_entry_for_fn): Walk the covariant's binfo - chain rather than using lookup_base. + PR c++/21686 + * semantics.c (finish_id_expression): Fix quoting in error message. -2005-05-04 Mark Mitchell +2005-05-25 DJ Delorie - Backport: - 2004-12-21 Mark Mitchell - PR c++/19034 - * tree.c (cp_tree_equal): Handle OVERLOAD. + * decl.c (duplicate_decls): Move warning control from if() to + warning(OPT_*). + * name-lookup.c (parse_using_directive): Likewise. + * parser.c (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_init_declarator): Likewise. + * tree.c (handle_com_interface_attribute): Likewise. -2005-05-02 Mark Mitchell +2005-05-24 Ziemowit Laski - Revert: - 2005-05-01 Mark Mitchell - * typeck.c (unary_complex_lvalue): In a template, always refuse - simplifications. + * class.c (layout_class_type): Do not issue C++ ABI warnings + for ObjC structs. + * decl.c (objc_mark_locals_volatile): Streamline by calling + objc_volatilize_decl(). + * parser.c (cp_parser_objc_message_expression): Allow simple + type specifiers (instead of merely type names) as message + receivers. + * pt.c (template_args_equal): Do not call objc_comptypes(). + * typeck.c (composite_pointer_type): If both pointers are + ObjC-esque, arbitrarily choose the first; do not call + objc_comptypes(). + (comptypes): Do not call objc_comptypes(). + (convert_for_assignment): Call objc_compare_types(). + (comp_ptr_ttypes_real): Call objc_type_quals_match() before + concluding that types do not match. -2005-05-01 Mark Mitchell +2005-05-24 Andrew Pinski - Backport: - 2005-02-22 Mark Mitchell - PR c++/19991 - * init.c (decl_constant_value): Iterate if the value of a decl - is itself a constant. + PR C++/21645 + * optimize.c (update_cloned_parm): Copy the TYPE also from the + original one. -2005-05-01 Mark Mitchell +2005-05-19 Jakub Jelinek - Backport: - 2004-12-22 Mark Mitchell - PR c++/18464 - * call.c (build_this): In templates, do not bother with - build_unary_op. - * typeck.c (unary_complex_lvalue): In a template, always refuse - simplifications. + PR c++/21495 + * decl.c (grokdeclarator): Fix "storage class specified for" + error reporting. -2005-04-25 Roger Sayle - Mark Mitchell +2005-05-19 Kazu Hirata - PR c++/20995 - Partial backport from mainline. - 2004-09-27 Mark Mitchell - * tree.c (fold_if_not_in_template): New function. - * cp-tree.h (fold_if_not_in_template): Prototype here. - * call.c (build_conditional_expr): Use fold_if_not_in_template. - * typeck.c (build_binary_op): Likewise. + * parser.c: Fix comment typos. + +2005-05-18 Geoffrey Keating + + * Make-lang.in (cc1plus-dummy): New. + (cc1plus-checksum.c): New. + (cc1plus-checksum.o): New. + (cc1plus): Add cc1plus-checksum.o. + +2005-05-17 H.J. Lu + + PR C++/19664 + * decl2.c (determine_visibility): Don't set visibility to + hidden if it has been set explicitly by user. + +2005-05-17 Ziemowit Laski + Mike Stump + + Yet more Objective-C++... + + * cp-objcp-common.h (cxx_get_alias_set): Move from + here... + (cxx_warn_unused_global_decl): Likewise. + (cp_expr_size): Likewise. + (cp_tree_size): Likewise. + (cp_var_mod_type_p): Likewise. + (cxx_initialize_diagnostics): Likewise. + (cxx_types_compatible_p): Likewise. + * cp-tree.h: to here. + (do_poplevel): Add. + * lex.c (D_OBJC): Add. + (init_reswords): Add. + * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h. + * parser.c: Add c-common.h include. + * pt.c: Add c-common.h and cp-objcp-common.h includes. + (template_args_equal): Use objc_comptypes as well. + (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well. + * semantics.c (do_poplevel): Remove static. + + * decl.c (objc_mark_locals_volatile): Don't change decls that are + already ok. + * decl2.c (generate_ctor_or_dtor_function): Add code to initialize + Objective C++ early enough. + * lex.c (struct resword reswords): Add Objective-C++ support. + * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++. + (cp_parser_objc_message_receiver): Add. + (cp_parser_objc_message_args): Likewise. + (cp_parser_objc_message_expression): Likewise. + (cp_parser_objc_encode_expression): Likewise. + (cp_parser_objc_defs_expression): Likewise. + (cp_parser_objc_protocol_expression): Likewise. + (cp_parser_objc_selector_expression): Likewise. + (cp_parser_objc_expression): Likewise. + (cp_parser_objc_visibility_spec): Likewise. + (cp_parser_objc_method_type): Likewise. + (cp_parser_objc_protocol_qualifiers): Likewise. + (cp_parser_objc_typename): Likewise. + (cp_parser_objc_selector_p): Likewise. + (cp_parser_objc_selector): Likewise. + (cp_parser_objc_method_keyword_params): Likewise. + (cp_parser_objc_method_tail_params_opt): Likewise. + (cp_parser_objc_interstitial_code): Likewise. + (cp_parser_objc_method_signature): Likewise. + (cp_parser_objc_method_prototype_list): Likewise. + (cp_parser_objc_method_definition_list): Likewise. + (cp_parser_objc_class_ivars): Likewise. + (cp_parser_objc_identifier_list): Likewise. + (cp_parser_objc_alias_declaration): Likewise. + (cp_parser_objc_class_declaration): Likewise. + (cp_parser_objc_protocol_declaration): Likewise. + (cp_parser_objc_protocol_refs_opt): Likewise. + (cp_parser_objc_superclass_or_category): Likewise. + (cp_parser_objc_class_interface): Likewise. + (cp_parser_objc_class_implementation): Likewise. + (cp_parser_objc_end_implementation): Likewise. + (cp_parser_objc_declaration): Likewise. + (cp_parser_objc_try_catch_finally_statement): Likewise. + (cp_parser_objc_synchronized_statement): Likewise. + (cp_parser_objc_throw_statement): Likewise. + (cp_parser_objc_statement): Likewise. + (cp_parser_primary_expression): Add Objective-C++. + (cp_parser_statement): Likewise. + (cp_parser_declaration): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_type_name): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_member_declaration) Likewise. + * tree.c: Include debug.h. + * typeck.c (composite_pointer_type): Add Objective-C++ support. + (finish_class_member_access_expr): Likewise. + (build_function_call): Allow objc to rewrite FUNCTION_DECLs. + (build_modify_expr): Allow objc to generate write barriers. + + * Make-lang.in (cp/tree.o): Add debug.h. + * tree.c (lvalue_p_1, case CONST_DECL): Add. + +2005-05-18 Jan Hubicka + + * method.c: Include tree-pass.h + (use_thunk): Lower body before expanding. + +2005-05-17 Jakub Jelinek + + PR c++/21454 + * decl.c (maybe_deduce_size_from_array_init): Call + cp_apply_type_quals_to_decl after completing array type. + +2005-05-16 Richard Henderson + + * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ... + (build_library_fn): ... here. + +2005-05-12 Ian Lance Taylor + + * cp-tree.h (cp_stmt_codes): Don't define. + (statement_code_p): Declare. + (STATEMENT_CODE_P): Define. + * lex.c (statement_code_p): Define. + (cxx_init): Use actual codes in stmt_codes initializer, not + cp_stmt_codes macro. Initialize statement_code_p directly, rather + than using INIT_STATEMENT_CODES. + +2005-05-09 Mark Mitchell + + * typeck.c (build_unary_op): Do not resort to address arithmetic + when taking the address of a COMPONENT_REF. + +2005-05-08 Kazu Hirata + + * class.c (vtbl_init_data_s): Change the type of fns to + VEC(tree,gc)*. + (build_vtbl_initializer, add_vcall_offset, add_vcall_offset): + Use VEC instead of VARRAY. + +2005-05-07 Richard Sandiford + + * mangle.c: Remove a reference to the MIPS -mint64 option. + +2005-05-07 Kazu Hirata + + * decl.c (wrapup_globals_for_namespace): Use VEC instead of + VARRAY. + * name-lookup.c (add_decl_to_level, begin_scope): Likewise. + * name-lookup.h (cp_binding_level): Change the type of + static_decls to VEC(tree,gc)*. + + * mangle.c (globals): Change the type of substitutions to + VEC(tree,gc)*. + (dump_substitution_candidates, add_substitution, + find_substitution, finish_mangling, init_mangle): Use VEC + instead of VARRAY. + +2005-05-06 Kazu Hirata + + * decl2.c (spew_debug): Remove. + + * decl2.c (ssdf_decls, start_static_storage_duration_function, + generate_ctor_or_dtor_function): Use VEC instead of VARRAY. + + * decl2.c (pending_statics, note_vague_linkage_var, + cp_finish_file): Use VEC instead of VARRAY. + (pending_statics_used): Remove. + +2005-05-05 Kazu Hirata + + * decl2.c (deferred_fns, note_vague_linkage_fn, + cp_finish_file): Use VEC instead of VARRAY. + +2005-05-05 Mark Mitchell + + PR c++/21352 + * pt.c (build_non_dependent_expr): Use is_overloaded_fn. + +2005-05-05 Kazu Hirata + + * pt.c: Fix a comment typo. + +2005-05-04 Kazu Hirata + + * cp-tree.h (language_function): Change the type of + x_local_names to VEC. + * decl.c (push_local_name): Adjust uses of local_names. + +2005-05-03 Kazu Hirata + + * friend.c, lex.c, mangle.c, repo.c: Update copyright. + +2005-05-02 Kazu Hirata + + * class.c (local_classes, init_class_processing): Use VEC + instead of VARRAY. + * cp-tree.h (local_classes): Likewise. + * mangle.c (discriminator_for_local_entity): Likewise. + * name-lookup.c (pushtag): Likewise. + + * class.c (current_lang_depth, push_lang_context, + pop_lang_context): Use VEC instead of VARRAY. + * cp-tree.h (saved_scope): Use VEC for lang_base instead of + VARRAY. + * name-lookup.c (push_to_top_level): Use VEC instead of + VARRAY. + +2005-05-02 Paolo Bonzini + + * semantics.c (finish_call_expr): Call resolve_overloaded_builtin + for BUILT_IN_MD built-ins. + +2005-05-02 Michael Matz + + PR c++/19542 + * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C + common frontend. + (null_node): Remove. + * lex.c (cxx_init): Move null_node initialisation to C common frontend. + +2005-04-25 Ian Lance Taylor + + * cp-tree.def: Add EXPR_STMT. + * cp-tree.h (cp_stmt_codes): Add EXPR_STMT. + (EXPR_STMT_EXPR): Define. + * cp-gimplify.c: Include "flags.h". + (gimplify_expr_stmt): New static function. + (cp_gimplify_expr): Handle EXPR_STMT. + * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression + rather than pp_expression. + (pp_cxx_statement): Handle EXPR_STMT. + * dump.c (cp_dump_tree): Handle EXPR_STMT. + * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes + initializer. + +2005-04-25 Andrew Pinski + + PR C++/21188 + * rtti.c (ifnonnull): Cast the zero comparison operand + to the correct type. + +2005-04-24 Jakub Jelinek + + PR middle-end/20991 + * class.c: Include cgraph.h. + (cp_fold_obj_type_ref): Set node->local.vtable_method. + * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H). + +2005-04-12 Markus F.X.J. Oberhumer + + * mangle.c (write_builtin_type): Handle integer types which are + not one of the shared integer type nodes and emit a "vendor + extended builtin type" with an encoding in the form of "u5int96". + +2005-04-24 Ian Lance Taylor + + * cp-tree.def (USING_STMT): Change class to tcc_statement. + (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise. + (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise. + (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise. + +2005-04-23 DJ Delorie + + * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c, + init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c, + repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning() + callers. + +2005-04-22 Per Bothner + + * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if + input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__. + +2005-04-22 Alexandre Oliva + + PR c++/21087 + * name-lookup.c (push_overloaded_decl): Do not overload with + non-duplicate anticipated built-in. + +2005-04-21 Kazu Hirata + + * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT, + VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove. + +2005-04-21 Nathan Sidwell + + * cp-tree.h: Adjust for new VEC API. + Define VEC(tree_pair_s,gc). + (struct save_scope): Adjust. + (struct lang_type_class): Adjust. + (unemitted_tinfo_decls): Adjust. + * class.c (add_method, resort_type_method_vec, + finish_struct_methods, struct find_final_overrider_data, + dfs_find_final_overrider_pre, find_final_overrider, + get_vcall_index, warn_hidden, walk_subobject_offsets, + check_methods, fixup_inline_methods, end_of_class, + warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer, + add_vcall_offset): Adjust. + * decl.c (xref_basetypes, finish_method): Adjust. + * decl2.c (check_classfn): Adjust. + * init.c (sort_mem_initializers, push_base_cleanups): Adjust. + * method.c (do_build_copy_constructor): Adjust. + * name-lookup.c (new_class_binding, store_binding, + store_bindings, store_class_bindings): Adjust. + * name-lookup.h: Define VEC(cxx_saved_binding,gc), + VEC(cp_class_binding,gc). + (struct cp_binding_level): Adjust. + * parser.c: Define VEC(cp_token_position,heap). + (struct cp_lexer): Adjust. + (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy, + cp_lexer_save_tokens): Adjust. + * pt.c (retrieve_specialization, + check_explicit_specialization): Adjust. + * rtti.c (unemitted_tinfo_decls): Adjust. + (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init, + get_pseudo_ti_desc): Adjust. + * search.c (dfs_access_in_type, lookup_conversion_operator, + lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible, + dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust. + * semantics.c: Define VEC(deferred_access,gc). + (push_deferring_access_checks): Adjust. + * typeck2.c (abstract_virtuals_error): Adjust. + +2005-04-20 Ian Lance Taylor + + * cp-tree.def: Add STMT_EXPR. + * cp-tree.h (STMT_EXPR_NO_SCOPE): Define. + (STMT_EXPR_STMT): Define. + * cxx-pretty-print.c (pp_cxx_primary_expression): Handle + STMT_EXPR. + (pp_cxx_expression): Likewise. + (pp_cxx_statement): Call pp_cxx_statement, not pp_statement. + * dump.c (cp_dump_tree): Handle STMT_EXPR. + +2005-04-18 Kazu Hirata + + * decl.c (expand_static_init): Call build2 and build3 instead + of build. + + * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove. + +2005-04-17 Ian Lance Taylor + + * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR. + * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle + ARROW_EXPR. + (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR. + (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and + ALIGNOF_EXPR. + * typeck.c (cxx_sizeof_or_alignof_type): Update call to + c_sizeof_or_alignof_type for change in parameter type. 2005-04-16 Mark Mitchell @@ -529,29 +5849,302 @@ * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to which sizeof/alignof is dependent, rather than just whether we are processing_template_decl. - + +2005-04-17 Kazu Hirata + + * cp-tree.h (LOOKUP_GLOBAL): Remove. + (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION, + LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES, + LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust + their values. + +2005-04-15 Richard Henderson + + PR middle-end/14311 + * semantics.c (finish_call_expr): Call resolve_overloaded_builtin. + +2005-04-15 Kazu Hirata + + * cp-tree.h (lang_type_class): Remove redefined. Move + java_interface into where redefined was. Increment the width + of dummy. + (TYPE_REDEFINED): Remove. + +2005-04-14 Kazu Hirata + + * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS, + CLASSTYPE_TEMPLATE_LEVEL): Remove. + +2005-04-11 Mark Mitchell + + * decl2.c (determine_visibility): Don't use export_class_data. + (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and + TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. + +2005-04-09 Kazu Hirata + + * cp-tree.h (cxx_alignof): Remove. + + * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove. + + * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST, + CONV_STATIC_CAST): Remove. + + * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove. + + * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove. + + * cp-tree.h (cp_deprecated): Remove. + +2005-04-08 Ian Lance Taylor + + * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT. + * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, + BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. + (WHILE_COND, WHILE_BODY): Define. + (DO_COND, DO_BODY): Define. + (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. + (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. + * cp-gimplify.c (enum bc_t): Define. + (struct cp_gimplify_ctx, ctxp): Define. + (push_context, pop_context): New static functions. + (begin_bc_block, finish_bc_block): New static functions. + (build_bc_goto): New static function. + (gimplify_cp_loop, gimplify_for_stmt): New static functions. + (gimplify_while_stmt, gimplify_do_stmt): Likewise. + (gimplify_switch_stmt): Likewise. + (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, + SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. + (cp_genericize): Call push_context and pop_context. + * semantics.c (finish_break_stmt): Just call build_stmt + (BREAK_STMT) rather than build_break_stmt. + (finish_continue_stmt): Corresponding change. + * decl.c (pop_switch): Update call to c_do_switch_warnings for new + parameters. + * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, + WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. + * dump.c (cp_dump_tree): Likewise. + +2005-04-08 Mark Mitchell + + PR c++/20905 + * parser.c (cp_parser_type_specifier_seq): Add is_condition + parameter. + (cp_parser_new_type_id): Pass it. + (cp_parser_condition): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_type_specifier_seq): In a condition, do not allow + invalid type-specifier combinations. + (cp_parser_exception_declaration): Adjust call to + cp_parser_type_specifier_seq. + + * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P. + * cp-tree.h (struct tinst_level): Add in_system_header_p. + (TINST_IN_SYSTEM_HEADER_P): New macro. + (make_tinst_level): Remove. + * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on + the instantiated class. + (push_tinst_level): Do not use make_tinst_level. Set + TINST_IN_SYSTEM_HEADER_P. + (pop_tinst_level): Likewise. + (instantiate_class_template): Set in_system_header. + (instantiate_pending_templates): Likewise. + * tree.c (make_tinst_level): Remove. + +2005-04-06 Joseph S. Myers + + * decl.c (start_decl): Apply pending #pragma weak regardless of + scope. + +2005-04-06 Mark Mitchell + + PR c++/20212 + * pt.c (regenerate_decl_from_template): Copy attributes for + parameters from the pattern to the instantiation. + +2005-04-05 Mark Mitchell + + PR c++/20734 + * cp-tree.def (OFFSET_REF): Correct comments. + * init.c (build_offset_ref): Remove misleading comment. + * typeck.c (build_unary_op): Handle pointer-to-member creation + here, rather than ... + (unary_complex_lvalue): ... here. + 2005-04-06 Jason Merrill PR c++/19312 * tree.c (stabilize_init): Don't bother trying to stabilize something with no side-effects. +2005-04-05 Mark Mitchell + + PR c++/20763 + * decl.c (grokdeclarator): Correct attribute handling. + +2005-04-05 Mark Mitchell + + PR c++/19159 + * decl2.c (import_export_decl): Use non-COMDAT external linkage + for virtual tables, typeinfo, etc. that will be emitted in only + one translation unit on systems without weak symbols. + 2005-04-04 Mark Mitchell PR c++/20679 * parser.c (cp_parser_template_name): Fix thinko. -2005-04-03 Gabriel Dos Reis +2005-04-04 Nathan Sidwell + + PR c++/20746 + * method.c (use_thunk): Protect covariant pointer return + adjustments from NULL pointers. + +2005-04-04 Jan Hubicka + + * decl2.c (finish_objects): Revert my previous patch. + (cp_finish_file): Likewise. + +2005-04-03 Kazu Hirata + + * pt.c: Fix comment typos. + +2005-04-03 Nathan Sidwell + + PR c++/20723 + * pt.c (more_specialized_fn): Member functions are unordered wrt + non-members. Conversion operators are unordered wrt other + functions. + +2005-04-01 Nathan Sidwell + + * call.c (add_template_candidates_real): Remove length parameter + from fn_type_unification call. + * class.c (resolve_address_of_overloaded_function): Likewise + * cp-tree.h (fn_type_unification): Remove length parameter. + * pt.c (get_bindings_overload): Remove. + (get_bindings_real): Rename to ... + (get_bindings): ... here. Remove length and strict + parameters. Change return type flag to boolean. Remove original + forwarding function. + (determine_specialization): Adjust get_bindings call. + (fn_type_unification): Remove length parameter. Adjust. + (type_unification_real): Remove length parameter. Adjust. + (resolve_overloaded_unification): Adjust get_bindings call. + (try_one_overload): Simplify confusing cascaded if control flow. + (unify): Remove length paramter from type_unification_real call. + (most_specialized_instantiation): Adjust get_bindings calls. + (most_specialized): Likewise. + +2005-03-31 Nathan Sidwell + + PR c++/19203, implement DR 214 + * call.c (joust): Use more_specialized_fn. + * cp-tree.h (DEDUCE_ORDER): Remove. + (more_specialized): Replace with ... + (more_specialized_fn): ... this. + * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER + case. + (type_unification_real): Remove DEDUCE_ORDER case. + (more_specialized): Replace with ... + (more_specialized_fn): ... this. Implement DR 214. + (most_specialized_instantiation): Use get_bindings_real directly. + +2005-03-31 Gabriel Dos Reis PR c++/18644 * call.c (build_new_op): Remove check for -Wsynth. +2005-03-31 Jan Hubicka + + * decl2.c (finish_objects): Mark ctor as needed. + (cp_finish_file): Output variables only in nonunit-at-a-time. + +2005-03-29 Richard Henderson + + PR c/20519 + * decl.c (cp_complete_array_type): Rename from complete_array_type. + Use the new complete_array_type in c-common.c. Update all callers. + * cp-tree.h (cp_complete_array_type): Update to match. + +2005-03-24 Geoffrey Keating + + * typeck.c (build_static_cast_1): Allow scalar_cast between + any integral, floating, or enumeration type. + +2005-03-24 Steven Bosscher + + * typeck.c (comptypes): First determine if the types are compatible + from a target-independent point of view. Check target attributes + last. + + * class.c (build_base_path): + (build_vbase_offset_vtbl_entries): + (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN. + * error.c (dump_expr): Likewise. + * init.c (build_zero_init, expand_cleanup_for_base, + build_vec_delete_1): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (thunk_adjust): Likewise. + * pt.c (convert_nontype_argument, tsubst, unify): Likewise. + * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise. + * typeck.c (build_ptrmemfunc_access_expr, + (get_member_function_from_ptrfunc): Likewise. + +2005-03-23 Joseph S. Myers + + * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-23 Joseph S. Myers + + * cp-tree.h (perform_integral_promotions): Remove. + (default_conversion): Add. + +2005-03-22 Mark Mitchell + + * parser.c (cp_parser_warn_min_max): New function. + (cp_parser_binary_expression): Use it. + (cp_parser_assignment_operator_opt): Likewise. + (cp_parser_operator): Likewise. + +2005-03-22 Volker Reichelt + + PR c++/19980 + * decl.c (start_preparsed_function): Robustify. + +2005-03-22 Volker Reichelt + + PR c++/20499 + * parser.c (cp_parser_class_head): Return NULL_TREE when + encountering a redefinition. + +2005-03-22 Nathan Sidwell + + PR c++/20465 + PR c++/20381 + * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a + template. + +2005-03-21 Paolo Carlini + + PR c++/20461 + PR c++/20536 + * init.c (emit_mem_initializers): Don't crash on undefined + types. + 2005-03-21 Paolo Carlini PR c++/20147 * semantics.c (finish_stmt_expr_expr): Return immediately if error_operand_p (expr). +2005-03-21 Joseph S. Myers + + * cp-tree.h (lvalue_or_else, lvalue_p): New. + * typeck.c (lvalue_or_else): New. Call lvalue_error. + 2005-03-19 Kriang Lerdsuwanakij PR c++/20240 @@ -563,14 +6156,134 @@ * parser.c (cp_parser_postfix_expression) : Check the return value of cp_parser_nested_name_specifier. +2005-03-18 Dale Johannesen + + * cp/tree.c (cp_tree_equal): Handle SSA_NAME. + +2005-03-18 Paolo Carlini + + PR c++/20463 + * parser.c (cp_parser_diagnose_invalid_type_name): + Check TYPE_BINFO (current_class_type) before attempting + to emit inform messages. + +2005-03-17 Paolo Carlini + + PR c++/19966 + * cp-tree.h (grok_op_properties): Change return type to void. + * decl.c (grok_op_properties): Return early - don't check the + arity - in case of a static member or an operator that cannot + be non-member; tidy a bit. + +2005-03-17 Nathan Sidwell + + PR c++/20186 + * pt.c (contains_dependent_cast_p): Remove. + (fold_non_dependent_expr): Don't use it. + (value_dependent_expression_p): Use a switch statement. + reference_exprs can be dependent. + +2005-03-14 Kriang Lerdsuwanakij + + PR c++/4403 + PR c++/9783, DR433 + * name-lookup.c (pushtag): Skip template parameter scope when + scope is ts_global. Don't push tag into template parameter + scope. + * pt.c (instantiate_class_template): Reorder friend class + template substitution to handle non-dependent friend class + that hasn't been previously declared. + +2005-03-14 Kriang Lerdsuwanakij + + Friend class name lookup 5/n + PR c++/1016 + * cp-tree.h (pushtag): Adjust declaration. + * decl.c (lookup_and_check_tag): Call lookup_type_scope if + lookup_name fails. + (xref_tag): Adjust call to pushtag. Make hidden class visible. + (start_enum): Adjust call to pushtag. + * name-lookup.c (ambiguous_decl): Ignore hidden names. + (qualify_lookup): Change return type to bool. + (hidden_name_p): New function. + (lookup_namespace_name, unqualified_namespace_lookup, + lookup_name_real): Use it. + (lookup_type_scope): Update comments. + (maybe_process_template_type_declaration): Change parameter name + from globalize to is_friend. + (pushtag): Change globalize parameter of type int to tag_scope. + Hide name if introduced by friend declaration. + * name-lookup.h (hidden_name_p): Add declaration. + * parser.c (cp_parser_lookup_name): Don't deal with hidden name + here. + * pt.c (push_template_decl_real): Make hidden class template + visible. + (lookup_template_class, instantiate_class_template): Adjust call + to pushtag. + * semantics.c (begin_class_definition): Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast_1, + tinfo_base_init, emit_support_tinfos): Use ts_current instead of + ts_global. + +2005-03-13 Mark Mitchell + + PR c++/20157 + * pt.c (determine_specialization): Reject non-specializations. + +2005-03-11 Per Bothner + + * cp-tree.h (struct cp_declarator): New id_loc field. + * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's + location using c_lex_with_flags, instead of input_location. + (cp_parser_direct_declarator): Set declarator's id_loc from + cp_token's id_loc. + +2005-03-10 Jakub Jelinek + + PR c++/18384, c++/18327 + * decl.c (reshape_init_array): Use UHWI type for max_index_cst + and index. Convert max_index to size_type_node if it isn't + host_integerp (, 1). + +2005-03-09 Mark Mitchell + + PR c++/20208 + * pt.c (tsubst_decl): Apply array-to-pointer and + function-to-pointer conversions to function arguments. + (regenerate_decl_from_template): Likewise. + +2005-03-09 Paolo Carlini + + PR c++/16859 + * decl.c (complete_array_type): In pedantic mode, return + 3 for an empty initializer list as the initializer for an + array of unknown bound (8.5.1/4). + (maybe_deduce_size_from_array_init): Fix final test to use + the above. + +2005-03-08 Nathan Sidwell + + PR c++/20186 + * pt.c (contains_dependent_cast_p): New. + (fold_non_dependent_expr): Call it. + 2005-03-08 Mark Mitchell PR c++/20142 + * cp-tree.h (target_type): Remove. + * decl.c (layout_var_decl): Remove #if 0'd code. + (cp_finish_decl): Remove dead code. * init.c (build_vec_init): When determining whether or not the element type has an asignment operator, look through all array - dimensions. + dimensions. + * typeck.c (target_type): Remove. -2005-03-06 Kriang Lerdsuwanakij +2005-03-07 Mark Mitchell + + * class.c (finish_struct_1): Do not warn about non-virtual + destructors in Java classes. + +2005-03-05 Kriang Lerdsuwanakij PR c++/19311 * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF. @@ -587,23 +6300,200 @@ decl matches the old one. * decl.c (redeclaration_error_message): Likewise. +2005-03-01 Per Bothner + + * decl.c (finish_function): Use SET_EXPR_LOCATION instead of + unavailable annotate_with_file_line, if USE_MAPPED_LOCATION. + +2005-03-01 Nathan Sidwell + + PR c++/20232 + * class.c (update_vtable_entry_for_fn): Don't crash on invalid + covariancy. + + * cp-tree.g (THUNK_TARGET): Expand comment. + * method.c (use_thunk): Make sure we also use the target, if that + is a thunk. + +2005-02-27 Jakub Jelinek + + PR c++/20206 + * decl.c (cxx_comdat_group): Put thunks for + TARGET_USE_LOCAL_THUNK_ALIAS_P (function) functions into the same + comdat group as the thunk target. + +2005-02-24 Volker Reichelt + + * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c, + parser.c: Fix comment typo(s). + 2005-02-24 Jakub Jelinek PR c++/20175 * decl.c (reshape_init): Don't warn about missing braces if STRING_CST initializes a char/wchar_t array. -2005-02-21 Alexandre Oliva +2005-02-23 Mark Mitchell + + PR c++/19878 + * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations + with internal linkage. + +2005-02-23 Alexandre Oliva + + * decl.c (grokvardecl): Don't exempt anonymous types from having + linkage for variables that have linkage other than "C". + +2005-02-23 Kazu Hirata + + * cp-objcp-common.h, error.c: Update copyright. + +2005-02-22 Mark Mitchell + + PR c++/20073 + * decl.c (start_decl_1): Don't clear TREE_READONLY. + (cp_finish_decl): Likewise. + (complete_vars): Call cp_apply_type_quals_to_decl. + * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in + cases where that's not valid. + + PR c++/19991 + * init.c (integral_constant_value): Iterate if the value of a decl + is itself a constant. + + PR c++/20152 + * parser.c (cp_parser_class_head): Check for redefintions here. + * semantics.c (begin_class_definition): Not here. + + PR c++/20153 + * decl2.c (build_anon_union_vars): Add type parameter. + (finish_anon_union): Pass it. + + PR c++/20148 + * error.c (dump_expr): Do not print the body of a BIND_EXPR. + Handle STATEMENT_LIST. + + PR c++/19883 + * parser.c (cp_parser_direct_declarator): Always complain about + non-constant array bounds when in a function scope. + * semantics.c (finish_id_expression): Do not mark dependent names + as non-constant. + +2005-02-21 Douglas Gregor + + PR c++/19076 + PR c++/6628 + * cp-tree.h (cp_apply_type_quals_to_decl): Declared. + * decl.c (grokdeclarator): Pedwarn about qualifying a function + type. + Add qualifiers when declaring a typedef of a function type. + Member function pointers pick up the qualifiers of the typedef + used to declare them. + Don't complain about creating cv-qualified function types. + Complain about qualified function typedefs that are used to + declare non-static member functions or free functions. + Use cp_apply_type_quals_to_decl. + (start_preparsed_function): Use cp_apply_type_quals_to_decl. + (grokclassfn): Use cp_apply_type_quals_to_decl. + * error.c (dump_type_suffix): Print qualifiers for function + types. + * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl. + (tsubst): When substituting a function type into a member + pointer type, pass along the qualifiers. + (unify): Unify member pointers to member function pointers. + * tree.c (cp_build_qualified_type_real): Function types may be + qualified. This includes restrict qualifiers. + * typeck.c (cp_apply_type_quals_to_decl): New function to replace + use of c_apply_type_quals_to_decl. Drops qualifiers that are being + added to function types. + +2005-02-20 Zack Weinberg + + PR 18785 + * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to + c_common_to_target_charset. Delete bogus comment. + +2005-02-18 Richard Henderson + + PR libstdc++/10606 + * except.c (do_get_exception_ptr): New. + (expand_start_catch_block): Use it. + +2005-02-19 Jakub Jelinek + + * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING + if type is not error_mark_node. + +2005-01-20 Giovanni Bajo + + PR c++/19508 + * decl2.c (grokfield): Do not apply attributes to template parameters + as they are ignored by tsubst anyway. + +2005-02-18 Jakub Jelinek + + PR c++/19813 + * decl.c (start_decl_1): Clear TREE_READONLY flag if + its type has TYPE_NEEDS_CONSTRUCTING. + (complete_vars): Likewise. + +2005-02-17 Alexandre Oliva PR c++/20028 * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a template along with TYPE_SIZE. -2005-02-14 Mark Mitchell + PR c++/20022 + * semantics.c (perform_deferred_access_checks): Use + get_deferred_access_checks to get the top of the stack. + +2005-02-15 Alexandre Oliva + + PR c++/17788 + * class.c (add_implicitly_declared_members, check_field_decl) + (check_field_decls, check_bases): Remove arguments, tests and + assignments of cant_have_default_ctor-related variables. + +2005-02-15 Alexandre Oliva + + * decl2.c (mark_used): Set the source location of the used decl to + the current input location here... + * method.c (synthesize_method): ... not here. Set input_location + from the decl instead. + +2005-02-14 Nathan Sidwell + + PR c++/19608 + * parser.c (cp_parser_late_parsing_for_member): Use + current_function_decl as scope to push to and from. + + PR c++/19884 + * pt.c (check_explicit_specialization): Make sure namespace + binding lookup found an overloaded function. + (lookup_template_function): Just assert FNS is an overloaded + function. + + PR c++/19895 + * decl.c (grokdeclarator): Check for error mark node in ptrmem + construction. + +2005-02-14 Alexandre Oliva + + PR c++/17816 + * decl.c (redeclaration_error_message): Report redefinition of + pure virtual function. + +2005-02-14 Nathan Sidwell + + PR c++/19891 + * class.c (build_simple_base_path): Build the component_ref + directly. + (update_vtable_entry_for_fn): Walk the covariant's binfo chain + rather than using lookup_base. + * search.c (dfs_walk_once): Add non-recursive assert check. + * typeck.c (build_class_member_access_expr): It is possible for + the member type to be both const and volatile. - * decl.c (reshape_init): Use explicit quotes in error message - instead of %q. - 2005-02-12 Kriang Lerdsuwanakij PR c++/14479 @@ -613,33 +6503,161 @@ * name-lookup.c (maybe_process_template_type_declaration): Don't use maybe_check_template_type. +2005-02-11 Richard Henderson + + PR c++/19632 + * pt.c (get_mostly_instantiated_function_type): Save and restore + flag_access_control instead of push/pop_access_scope. + 2005-02-10 Mark Mitchell PR c++/19755 * decl.c (reshape_init): Issue warnings about missing braces. +2005-02-11 Kazu Hirata + + * cp-tree.def, except.c, ptree.c: Update copyright. + 2005-02-09 Mark Mitchell + PR c++/19811 + * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before + attempting name lookup. + * parser.c (cp_parser_unqualified_id): Initialize type_decl. PR c++/19787 * call.c (initialize_reference): Robustify. + PR ++/19732 + * decl.c (grokdeclarator): Check for invalid use of destructor + names. + PR c++/19762 * parser.c (cp_parser_unqualified_id): Avoid creating destructor names with invalid types. + PR c++/19826 + * parser.c (cp_parser_direct_declarator): Allow type-dependent + expressions as array bounds. + PR c++/19739 * parser.c (cp_parser_attributes_list): Allow empty lists. 2005-02-08 Mark Mitchell PR c++/19733 + * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR. + (check_bases): Give warnings about a base class with a + non-virtual destructor, even if it is implicit. + (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR. + (maybe_warn_about_overly_private_class): Don't use + TYPE_HAS_DESTRUCTOR. + (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR. + (check_for_override): Give it external linkage. + (add_implicitly_declared_members): Generate destructors lazily. + (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not + TYPE_HAS_DESTRUCTOR. + (check_bases_and_members): Call check_methods before + check_field_decls. + (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not + TYPE_HAS_DESTRUCTOR. + (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR. + * cp-tree.def (PSEUDO_DTOR_EXPR): Document. + * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove. + (lang_type_class): Add lazy_destructor. + (CLASSTYPE_LAZY_DESTRUCTOR): New macro. + (CLASSTYPE_DESTRUCTORS): Robustify. + (TYPE_HAS_DESTRUCTOR): Remove. + (check_for_override): Declare. + (build_vbase_delete): Remove. * cvt.c (convert_to_void): Issue errors about pseudo-destructor expressions. + * decl.c (cxx_maybe_build_cleanup): Remove dead code. + * except.c (dtor_nothrow): Lazily create destructors if necessary. + (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + * init.c (build_delete): Lazily create destructors, if necessary. + (build_vbase_delete): Remove. + * method.c (locate_dtor): Simplify. + (implicitly_declare_fn): Add support for destructors. + * parser.c (cp_parser_lookup_name): Lazily create destructors, if + necessary. + * pt.c (check_explicit_specialization): Don't use + TYPE_HAS_DESTRUCTOR. + (instantiate_class_template): Likewise. + * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR. + * rtti.c (emit_support_tinfos): Robustify. + * search.c (lookup_fnfields_1): Lazily create destructors. + * typeck.c (build_class_member_access_expr): Remove + PSEUDO_DTOR_EXPR handling. + (lookup_destructor): Likewise. + +2005-02-08 Kazu Hirata + + * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update + copyright. + +2005-02-07 Mark Mitchell + + * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations + on boolean variables. + (cp_lexer_stop_debugging): Likewise. + +2005-02-03 Giovanni Bajo + + PR c++/17401 + * parser.c (cp_parser_pure_specifier): Emit a specific error + message with an invalid pure specifier. + * decl2.c (grok_function_init): Remove. + (grokfield): An initializer for a method is a always a pure + specifier. + +2005-02-02 Matt Austern + + PR c++/19628 + * cp-tree.h (builtin_valid_in_constant_expr_p): Declare. + * parser.c (cp_parser_postfix_expression): Accept function call in + constant expression if builtin_valid_in_constant_expr_p is true + for that function. + * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly. + * semantics.c (finish_id_expression): Accept function call in constant + expression if builtin_valid_in_constant_expr_p is true for that + function. + * tree.c (builtin_valid_in_constant_expr_p): New. + +2005-02-02 Volker Reichelt + + PR c++/17413 + * pt.c (check_instantiated_args): Improve error message. + Fix logic when to print its second part. + +2005-02-02 Volker Reichelt + + * cp-tree.h (complete_type_or_else): Remove macro. + (complete_type_or_diagnostic): Rename to complete_type_or_else + and remove last argument. + * typeck.c (complete_type_or_diagnostic): Rename to + complete_type_or_else and remove last argument. + +2005-02-02 Volker Reichelt + + * cp-tree.h (commonparms): Remove prototype. + (convert_arguments): Likewise. + (PFN_FROM_PTRMEMFUNC): Remove. + * typeck.c (commonparms): Make static. + (convert_arguments): Add prototype. Make static. + (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc. + +2005-01-31 Mark Mitchell + + * parser.c (cp_parser_primary_expression): Don't complain about + floating-point literals in integral constant expressions when + !pedantic. 2005-02-01 Alexandre Oliva + * parser.c (cp_parser_template_id): Revert comment patch too. + PR c++/18757 PR c++/19366 PR c++/19499 @@ -648,1835 +6666,281 @@ * pt.c (fn_type_unification): Return early if the explicit template arg list is an error_mark_node. -2005-01-27 J"orn Rennecke +2005-01-31 Mark Mitchell + + * decl.c (build_enumerator): Do not issue duplicate error messages + about invalid enumeration constants. + * parser.c (cp_parser_non_integral_constant_expression): Always + set parser->non_integral_constant_expression_p. + (cp_parser_primary_expression): Add cast_p parameter. Issue + errors about invalid uses of floating-point literals in + cast-expressions. + (cp_parser_postfix_expression): Add cast_p parameter. + (cp_parser_open_square_expression): Pass it. + (cp_parser_parenthesized_expression_list): Add cast_p parameter. + (cp_parser_unary_expression): Likewise. + (cp_parser_new_placement): Pass it. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_new_initializer): Likewise. + (cp_parser_cast_expression): Add cast_p parameter. + (cp_parser_binary_expression): Likewise. + (cp_parser_question_colon_clause): Likewise. + (cp_parser_assignment_expression): Likewise. + (cp_parser_expression): Likewise. + (cp_parser_constant_expression): If an integral constant + expression is invalid, return error_mark_node. + (cp_parser_expression_statement): Pass cast_p. + (cp_parser_condition): Likewise. + (cp_parser_iteration_statement): Likewise. + (cp_parser_jump_statement): Likewise. + (cp_parser_mem_initializer): Likewise. + (cp_parser_template_argument): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_initializer): Likewise. + (cp_parser_throw_expression): Likewise. + (cp_parser_attribute_list): Likewise. + (cp_parser_simple_cast_expression): Likewise. + (cp_parser_functional_cast): Likewise. + (cp_parser_late_parsing_default_args): Likewise. + (cp_parser_sizeof_operand): Save/restore + non_integral_constant_expression_p. + +2005-01-31 Mike Stump + + * parser.c (cp_lexer_new_main): Get the first token, first, before + doing anything. + +2005-01-31 Mark Mitchell + + * decl.c (start_decl): Add missing parentheses. + +2005-01-30 Mark Mitchell + + PR c++/19555 + * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation. + * decl.c (duplicate_decls): Do not discard + DECL_IMPLICIT_INSTANTIATION when merging declarations. + (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for + variables that do not have DECL_USE_TEMPLATE. + + PR c++/19395 + * decl.c (grokdeclarator): Refactor code so that qualified names + are never allowed as the declarator in a typedef. + + PR c++/19367 + * name-lookup.c (do_nonmember_using_decl): Avoid overloading + builtin declarations. + + PR c++/19457 + * call.c (convert_like_real): Inline call to + dubious_conversion_warnings here. + * cp-tree.h (dubious_conversion_warnings): Remove. + * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before + setting TREE_NEGATED_INT. + * typeck.c (dubious_conversion_warnings): Remove. + + PR c++/19349 + * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd + memory. + +2005-01-28 Mark Mitchell + + PR c++/19253 + * parser.c (cp_parser_diagnose_invalid_type_name): Commit to + tentative parses. + + PR c++/19667 + * pt.c (redeclare_class_template): Robustify. + +2005-01-27 Steven Bosscher + + * decl.c (finish_case_label): Use SWITCH_STMT accessor macros + instead of SWITCH_EXPR ones. + * pt.c (tsubst_expr): Likewise. + * semantics.c (begin_switch_stmt, finish_switch_cond, + finish_switch_stmt): Likewise. + +2005-01-26 J"orn Rennecke PR c++/18370 * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p. +2005-01-25 Andrew Pinski + + * class.c (abort_fndecl_addr): New variable. + (build_vtbl_initializer): If we have a pure virtual function + share the abort function's address. + Include gt-cp-class.h at the end. + * config-lang.in (gtfiles): Add cp/class.c. + +2005-01-25 Volker Reichelt + + * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static. + (pp_cxx_function_definition): Make static. + * cxx-pretty-print.h (pp_cxx_statement): Remove prototype. + (pp_cxx_function_definition): Likewise. + +2005-01-25 Volker Reichelt + + * name-lookup.c (print_binding_level): Make static. + (constructor_name_full): Make static inline. + (current_decl_namespace): Make static. + * name-lookup.h (constructor_name_full): Remove prototype. + (print_binding_level): Likewise. + (current_decl_namespace): Likewise. + +2005-01-25 Volker Reichelt + + * decl.h (debug_bindings_indentation): Remove. + +2005-01-23 Kazu Hirata + + * typeck.c: Fix a comment typo. + +2005-01-21 Giovanni Bajo + + PR c++/19208 + * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr + at least once. + (tsubst): Use fold_decl_constant_value in place of a bare call to + integral_constant_value. + +2005-01-20 Kazu Hirata + + * typeck.c (more_qualified_p): Remove. + * cp-tree.h: Remove the corresponding prototype. + +2005-01-19 Matt Austern + + * typeck.c (comptypes): Handle return code from objc_comptypes + correctly. + +2005-01-19 Kazu Hirata + + * cp-tree.h, name-lookup.h: Remove unused prototypes. + 2005-01-19 Kriang Lerdsuwanakij PR c++/19375 * semantics.c (finish_id_expression): Disable access checking for already lookuped FIELD_DECL. -2005-01-19 Kriang Lerdsuwanakij +2005-01-18 Kazu Hirata - PR c++/19258 - * parser.c (cp_parser_late_parsing_default_args): Handle friend - defined in class. - * pt.c (push_access_scope, pop_access_scope): Likewise. + * decl.c (delete_block): Remove. + * cp-tree.h: Remove the corresponding prototype. + + * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data, + walk_vtables_r, walk_vtables, walk_globals_r, walk_globals): + Remove. + * cp-tree.h: Remove the corresponding prototypes. + + * tree.c (count_functions, bound_pmf_p, cp_is_overload_p, + cp_update_decl_after_saving, name_p): Remove. + * cp-tree.h: Remove the corresponding prototypes. + +2005-01-18 Andrew Pinski + + PR c/19472 + * semantics.c (finish_asm_stmt): Strip nops off + input memory operands. + +2005-01-18 Kazu Hirata + + * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c, + typeck2.c: Update copyright. + +2005-01-16 Kazu Hirata + + * class.c (get_enclosing_class): Remove. + * cp-tree.h: Remove the corresponding prototypes. + + * cvt.c (convert_lvalue): Remove. + * cp-tree.h: Remove the corresponding prototype. + + * pt.c (tinst_for_decl): Remove. + * cp-tree.h: Remove the corresponding prototypes. + + * tree.c (hash_chainon): Remove. + * cp-tree.h: Remove the corresponding prototypes. 2005-01-15 Jakub Jelinek PR c++/19263 * typeck2.c (split_nonconstant_init_1) : Put a copy of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified. - Store code to *pcode. -2004-12-28 Jakub Jelinek +2005-01-12 Kaveh R. Ghazi - PR c++/18384, c++/18327 - * decl.c (reshape_init_array): Use UHWI type for max_index_cst - and index. Convert max_index to size_type_node if it isn't - host_integerp (, 1). + * Make-lang.in (cp-warn): Don't append $(WERROR). -2004-12-23 Alexandre Oliva +2005-01-10 Kazu Hirata - PR c++/18962 - * pt.c (check_explicit_specialization): Use the argument list from - the definition in a template function specialization definition. + * cp-tree.h: Fix a comment typo. -2004-12-23 Alexandre Oliva +2005-01-07 Nathan Sidwell - PR c++/18757 - * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID - if parsing failed. + PR c++/19298 + * pt.c (tsubst_qualified_id): Call convert_from_reference. -2004-12-17 Nathan Sidwell +2005-01-06 Mark Mitchell - PR c++/18975 - * method.c (do_build_copy_constructor): Refactor. Don't const - qualify a mutable field. - (do_build_assign_ref): Likewise. + PR c++/19244 + * class.c (add_implicitly_declared_members): Remove dead code. + * decl.c (grokfndecl): Add sfk parameter. Use it do set + DECL_CONSTRUCTOR_P. + (grokdeclarator): Adjust calls to grokfndecl. + * method.c (implicitly_declare_fn): Improve documentation. + * parser.c (cp_parser_direct_declarator): Do not consider a + function to be a constructor if the containing class was + originally anonymous. -2004-12-10 Volker Reichelt +2005-01-06 Kriang Lerdsuwanakij - PR c++/18731 - * parser.c (cp_parser_class_head): Reject typedef-name in class head. + PR c++/17154 + * search.c (lookup_field_1): Handle using declaration in + class template partial specialization. -2004-12-09 Nathan Sidwell +2005-01-06 Kriang Lerdsuwanakij - PR c++/16681 - * init.c (build_zero_init): Build a RANGE_EXPR for an array - initializer. + PR c++/19258 + * pt.c (push_access_scope): Handle friend defined in class. + (pop_access_scope): Likewise. -2004-12-08 Kriang Lerdsuwanakij +2005-01-06 Nathan Sidwell - PR c++/18100 - * name-lookup.c (push_class_level_binding): Diagnose nested - class template with the same name as enclosing class. + PR c++/19270 + * pt.c (tsubst_copy) : Handle separately. + (tsubst_copy_and_build) : Remove obsolete + array-new handling code. Use build_x_binary_op. -2004-12-04 Kriang Lerdsuwanakij +2005-01-05 Nathan Sidwell - PR c++/17011, c++/17971 - * pt.c (tsubst_copy) : Check and diagnose - invalid field. - (tsubst_copy_and_build) : Check - error_mark_node after member substitution. - * semantics.c (finish_id_expression): Call - finish_non_static_data_member for dependent FIELD_DECL. - -2004-12-02 Kriang Lerdsuwanakij - - PR c++/18123 - * parser.c (cp_parser_type_specifier): Don't create new enum - type if it is not in the form 'enum [identifier] { [...] };'. - Catch template declaration of enum. - -2004-12-01 Nathan Sidwell - - PR c++/17431 - * call.c (standard_conversion): Add FLAGS parameter. Do not allow - derived to base conversion when checking constructor - accessibility. - (implicit_conversion): Pass FLAGS to standard_conversion. - (check_constructir_callable): Disallow conversion functions. - -2004-11-12 Mark Mitchell - - PR c++/18389 - * decl.c (start_decl): Make sure to set *pop_scope_p. Return - error_mark_node to indicate errors. - - PR c++/18436 - * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an - unqualified name resolves to a member function. - - PR c++/18407 - * pt.c (tsubst_copy_and_build): Handle qualified names used from a - derived class correctly. - -2004-11-04 Release Manager - - * GCC 3.4.3 released. - -2004-10-31 Mark Mitchell - - PR c++/15172 - * typeck2.c (store_init_value): Use split_nonconstant_init even - for types that require construction. - -2004-10-28 Mark Mitchell - - PR c++/17132 - * pt.c (instantiate_class_template): Increment - processing_template_decl when substituting into a member class - template. - -2004-10-27 Mark Mitchell - - PR c++/18140 - * parser.c (cp_parser_next_token_ends_template_argument_p): Do not - include ">>". - -2004-10-27 Andrew Pinski - - PR c++/13560 - * error.c (cp_error_at): Output the context as it might be - different file as the other location. - -2004-10-26 Mark Mitchell - - PR c++/18093 - * search.c (current_scope): Return the innermost non-block scope, - not the innermost non-block, non-namespace scope. - (at_namespace_scope_p): Adjust accordingly. - (dfs_accessible_post): Do not pass namespaces to is_friend. - (dfs_walk_once_accessible_r): Likewise. - * decl.c (grokvardecl): Adjust call to current_scope. - (build_enumerator): Likewise. - * parser.c (cp_parser_using_declaration): Likewise. - (cp_parser_direct_declarator): Use at_namespace_scope_p instead of - current_scope. - (cp_parser_class_head): Adjust call to current_scope. - * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the - alias. - - PR c++/18020 - * pt.c (tusbst_copy_and_build): Resolve enumeration constants to - their underlying values. - -2004-10-17 Andrew Pinski - - PR c++/16301 - * name-lookup.c (parse_using_directive): If we have a - error_mark_node, do not set the decl namespace associations - on it. - -2004-10-14 Mark Mitchell - - PR c++/17976 - * decl.c (cp_finish_decl): Do not call expand_static_init more - than once for a single variable. - -2004-10-11 Mark Mitchell - - PR c++/15786 - * parser.c (cp_parser_declarator): Add member_p parameter. - (cp_parser_condition): Adjust calls to cp_parser_declarator. - (cp_parser_explicit_instantiation): Likewise. - (cp_parser_init_declarator): Likewise. - (cp_parser_direct_declarator): Add member_p parameter. Do not - parse tentatively when parsing the parameters to a member. - (cp_parser_type_id): Adjust calls to cp_parser_declarator. - (cp_parser_parameter_declaration): Likewise. - (cp_parser_member_declaration): Likewise. - (cp_parser_exception_declaration): Likewise. - -2004-10-11 Mark Mitchell - - * decl2.c (finish_anon_union): Robustify. - -2004-10-10 Mark Mitchell - - PR c++/17393 - * decl.c (grokdeclarator): Robustify error-recovery on invalid - declarations. - -2004-10-09 Mark Mitchell - - PR c++/17821 - * parser.c (cp_parser_postfix_dot_deref_expression): If the - pseduo-destructor-name production does not work, fall back to the - ordinary production. - - PR c++/17826 - * tree.c (cp_tree_equal): Handle a BASELINK. - -2004-10-09 Mark Mitchell - - PR c++/17524 - * cp-tree.h (check_var_type): New function. - * decl.c (check_var_type): New function, split out from ... - (grokdeclarator): ... here. - * pt.c (tsubst_decl): Use check_var_type. - - PR c++/17685 - * decl.c (grokdeclarator): Disallow declarations of operators as - non-functions. - -2004-10-08 Volker Reichelt - - PR c++/17868 - * error.c (dump_expr): Add missing case for RDIV_EXPR. - -2004-10-08 Nathan Sidwell - - PR c++/17829 - * parser.c (cp_parser_postfix_expression): Inhibit Koenig when - unqualified lookup finds a member function. - -2004-09-28 Roger Sayle - - PR driver/17537 - * g++spec.c (lang_specific_driver): Unrecognized libraries, other - than -lc and -lm, may require linking against libstc++. - -2004-09-27 Mark Mitchell - - PR c++/17585 - * cp-tree.h (shared_member_p): Declare. - * search.c (shared_member_p): Give it external linkage. - * semantics.c (finish_qualified_id_expr): Use it. - (finish_id_expression): Likewise. - -2004-09-22 Giovanni Bajo - - PR c++/14179 - * parser.c (cp_parser_initializer): Speed up parsing of simple - literals as initializers. - -2004-09-21 Giovanni Bajo - - PR c++/14179 - * decl.c (reshape_init): Extract array handling into... - (reshape_init_array): New function. Use integers instead of trees - for indices. Handle out-of-range designated initializers. - -2004-09-16 Mark Mitchell - - PR c++/17501 - * parser.c (cp_parser_nested_name_specifier): Do not resolve - typename types if the user explicitly said "typename". - -2004-09-13 Mark Mitchell - - PR c++/16162 - * parser.c (cp_parser_id_expression): Correct value for - is_declarator. - (cp_parser_nested_name_specifier_opt): Look through typenames as - necessary. - (cp_parser_template_name): Honor check_dependency_p. - -2004-09-13 Mark Mitchell - - PR c++/17327 - * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with - gcc_unreacable. - -2004-09-06 Release Manager - - * GCC 3.4.2 released. - -2004-08-25 Roger Sayle - - PR middle-end/16693 - PR tree-optimization/16372 - * decl.c (finish_enum): Make the precision of the enumerated type - the same width as the underlying integer type. - -2004-08-24 Jason Merrill - - PR c++/16851 - * tree.c (stabilize_init): See through a COMPOUND_EXPR. - - PR c++/15461 - * semantics.c (nullify_returns_r): Replace a DECL_STMT - for the NRV with an INIT_EXPR. - -2004-08-24 Nathan Sidwell - - PR c++/16889 - * (is_subobject_of_p): Resurrect & optimize. - (lookup_field_r): Use it. - -2004-08-24 Kriang Lerdsuwanakij - - PR c++/16706 - * search.c (friend_accessible_p): Increment processing_template_decl - when deal with TEMPLATE_DECL of SCOPE. - -2004-08-23 Janis Johnson - - Backports from mainline: - - 2004-02-27 Ziemowit Laski - 2004-03-24 Ziemowit Laski - - * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H). - * mangle.c (write_type): Add call to 'mangle_fundamental_type' - target hook. - * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs. - -2004-08-19 Mark Mitchell - - PR c++/15890 - * pt.c (push_template_decl_real): Disallow template allocation - functions with fewer than two parameters. - -2004-08-18 Mark Mitchell - - PR c++/17068 - * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as - dependent. - -2004-08-17 Mark Mitchell - - PR c++/16246 - * pt.c (unify): Make sure that non-type arguments have the same - type as the corresponding parameter. - -2004-08-12 Mark Mitchell - - PR c++/16273 - * class.c (count_depth_data): New type. - (dfs_depth_post): New function. - (dfs_depth_q): Likewise. - (find_final_overrider_data_s): Change type of vpath. - Add vpath_list. - (dfs_find_final_overrider_1): New function. - (dfs_find_final_overrider): Use it. - (dfs_find_final_overrider_q): Adjust use of vpath. - (dfs_find_final_overrider_post): Likewise. - (find_final_overrider): Use dfs_depth. Allocate and deallocate - vpath_list. - -2004-08-12 Jan Beulich - - * parser.c (cp_parser_asm_definition): Properly consume scope operator - tokens preceding the clobbers. Don't check for scope operator - following inputs. Simplify inputs handling to match that now used for - clobbers. - -2004-08-11 Mark Mitchell - - PR c++/16698 - * except.c (build_throw): Allocate cleanup_type and the function - for __cxa_throw separately. - -2004-08-11 Mark Mitchell - - PR c++/16717 - * semantics.c (expand_body): Do not update static_ctors and - static_dtors here. - (expand_or_defer_fn): Do it here, instead. - - PR c++/16853 - * call.c (standard_conversion): Do not accept conversions between - pointers to members if the class types are unrelated. - - PR c++/16870 - * pt.c (tsubst): Just return the unknown_type_node. - - PR c++/16964 - * parser.c (cp_parser_class_specifier): Robustify. - - PR c++/16904 - * pt.c (tsubst_copy_and_build): Complain about invalid - qualification. - - PR c++/16929 - * pt.c (tsubst_default_argument): Clear out current_class_ptr and - current_class_ref while tsubsting. - -2004-08-01 Mark Mitchell - - PR c++/16224 - * name-lookup.c (decl_namespace): Remove. - (current_decl_namespace): Use decl_namespace_context instead of - decl_namespace. - (push_decl_namespace): Likewise. - (arg_assoc_class): Likewise. - (arg_assoc_type): Likewise. - * pt.c (check_specialization_namespace): New function. - (maybe_process_partial_specialization): Use it. - (register_specialization): Likewise. - -2004-08-01 Mark Mitchell - - PR c++/16489 - * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro. - * call.c (null_ptr_cst_p): Handle variables with constant - initializers. - * pt.c (convert_nontype_argument): Use - DECL_INTEGRAL_CONSTANT_VAR_P. - * semantics.c (finish_id_expression): Likewise. - - PR c++/16529 - * decl.c (duplicate_decls): Reject duplicate namespace - declarations. - - PR c++/16810 - * typeck.c (build_ptrmemfunc): Loosen assertion. - -2004-07-28 Kriang Lerdsuwanakij - - PR c++/13092 - * init.c (build_offset_ref): Build SCOPE_REF with non-null - TREE_TYPE for non-dependent names. - * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF. - * pt.c (type_dependent_expression_p): Handle SCOPE_REF with - unknown_type_node as its TREE_TYPE. - * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. - * error.c (dump_decl) : Use pp_expression. - (dump_expr) : Likewise. - -2004-07-21 Kriang Lerdsuwanakij - - PR c++/16175 - * error.c (dump_type) : Output - cv qualifier. - -2004-07-20 Mark Mitchell - - (cp_parser_simple_type_specifier): Fix typo. - - PR c++/16637 - * parser.c (cp_parser_simple_type_specifier): Do not record usage - of globally-qualified names. - -2004-07-12 Andrew Pinski - - PR c++/16475 - Revert: - 2004-07-07 H.J. Lu - PR c++/16276 - * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo - is not public. - - -2004-07-07 H.J. Lu - - PR c++/16276 - * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo - is not public. - -2004-07-01 Release Manager - - * GCC 3.4.1 released. - -2004-06-28 Nathan Sidwell - - PR C++/16174 - * call.c (build_temp): Declare. - (check_constructor_callable): New. - (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for - CONSTRUCTOR_CALLABLE. - (convert_like_real, initialize_reference): Use - check_constructor_callable. - * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New. - (LOOKUP_*): Renumber. - -2004-06-25 Jan Hubicka - - PR C++/14865 - * decl2.c (maybe_emit_vtables): Always import_export_vtable for the - reachability analysis. - -2004-06-22 Jan Hubicka - - PR C++/14950 - * pt.c (instantiate_decl): Clean TI_PENDING_TEMPLATE_FLAG before - expanding the function. - -2004-06-21 Nathan Sidwell - - PR c++/3518 - * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer - level. - - PR c++/14007 - * pt.c (check_cv_quals_for_unify): Correct logic for disallowed - cv-qualifier unification. - * tree.c (cp_build_qualified_type_real): Renable DR295 logic. - -2004-06-15 Giovanni Bajo - - PR c++/15967 - * search.c (build_new_1): Robustify. - -2004-06-14 Giovanni Bajo - - PR c++/15947 - * parser.c (cp_parser_template_name): Ctors/dtors never need a - template keyword to disambiguate. - -2004-06-14 Mark Mitchell - - PR c++/15096 - * decl.c (grokdeclarator): Ignore pointer-to-members when - computing template depth. - - PR c++/14930 - * name-lookup.c (pushtag): Do not try to put class declarations in - explicit specialization scopes. - -i2004-06-11 Mark Mitchell - - PR c++/15862 - * name-lookup.c (unqualified_namespace_lookup): Do not ignore type - bindings for undeclared built-ins. - -2004-06-10 Jason Merrill - - PR c++/15875 - Revert: - 2004-06-01 Kriang Lerdsuwanakij - * init.c (build_offset_ref): Build SCOPE_REF with non-null - TREE_TYPE for non-dependent names. - * pt.c (type_dependent_expression_p): Handle SCOPE_REF with - unknown_type_node as its TREE_TYPE. - * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. - * error.c (dump_decl) : Use pp_expression. - (dump_expr) : Likewise. - -2004-06-10 Mark Mitchell - - PR c++/15227 - * parser.c (cp_parser_direct_declarator): Robustify. - - PR c++/15877 - * pt.c (tsubst_copy): Use decl_constant_value on enumeration - constants in non-dependent contexts. - - PR c++/14211 - PR c++/15076 - * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when - necessary. - -2004-06-09 Mark Mitchell - - Revert: - PR c++/15815 - 2004-06-07 Mark Mitchell - * lex.c (handle_pragma_interface): Deprecate. - (handle_pragma_implementation): Likewise. - -2004-06-07 Dan Kegel - - PR c++/14808 - * method.c (make_alias_for_thunk, use_thunk): Use TARGET_IS_PE_COFF - instead of __CYWGIN__ and __MINGW32__. - -2004-06-07 Mark Mitchell - - PR c++/15815 - * lex.c (handle_pragma_interface): Deprecate. - (handle_pragma_implementation): Likewise. - - PR c++/15766 - * parser.c (cp_parser_iteration_statement): Fix typo in error - message. - - PR c++/14777 - * pt.c (tsubst_default_argument): Do not defer access checks - while substituting into the default argument. - - PR c++/15554 - * pt.c (tsubst_copy): Do not try to substitute for an enumeration - constant in a non-dependent context. - - PR c++/15057 - * except.c (build_throw): Ensure that temp_expr has been - initialized. - -2004-06-06 Giovanni Bajo - - PR c++/15503 - * parser.c (cp_parser_mem_initializer_id): Gracefully reject - 'typename', and accept 'template'. - -2004-06-01 Jason Merrill - - PR c++/15142 - * call.c (call_builtin_trap): Remove type parm. - (convert_arg_to_ellipsis): Change a non-POD argument to integer type. - (build_x_va_arg): Dereference a null pointer for a non-POD argument. - -2004-06-01 Kriang Lerdsuwanakij - - PR c++/13092 - * init.c (build_offset_ref): Build SCOPE_REF with non-null - TREE_TYPE for non-dependent names. - * pt.c (type_dependent_expression_p): Handle SCOPE_REF with - unknown_type_node as its TREE_TYPE. - * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. - * error.c (dump_decl) : Use pp_expression. - (dump_expr) : Likewise. - -2004-06-01 Giovanni Bajo - - PR c++/14932 - * parser.c (cp_parser_postfix_expression): Allow subscript - operator in offsetof. - -2004-05-31 Mark Mitchell - - PR c++/15701 - * friend.c (add_friend): Do not try to perform access checks for - functions from dependent classes. - - PR c++/15742 - * call.c (build_over_call): Set - current_function_returns_abnormally even in template functions. - - PR c++/15696 - * cp-tree.h (invalid_nonstatic_memfn_p): New function. - * cvt.c (convert_to_void): Use it. - * typeck.c (invalid_nonstatic_memfn_p): New function. - (decay_conversion): Use it. - - PR c++/15625 - * pt.c (tsubst_decl): Set DECL_FRIEND_CONTEXT for instantiated - templates. - - PR c++/15629 - * name-lookup.c (arg_assoc_class): Do not find template - specializations. - - PR c++/15209 - * tree.c (lvalue_p_1): Only consider the right-hand side of "." - expressions when determining whether or not an express is packed. - -2004-05-28 Mark Mitchell - - PR c++/15083 - * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR, - even in a templat.e - * init.c (build_new): Likewise. - - PR c++/15640 - * name-lookup.c (arg_assoc): Robustify. - - PR c++/15471 - * typeck.c (unary_complex_lvalue): Use context_for_name_lookup - when determining the scope to use for a pointer to member. - (lookup_anon_field): Give it external linkage. - * cp-tree.h (lookup_anon_field): Declare it. - * expr.c (cplus_expand_constant): Use it. - - PR c++/14668 - * parser.c (cp_parser_simple_type_specifier): Call - maybe_note_name_used_in_class. - -2004-05-23 Mark Mitchell - - PR c++/15044 - * parser.c (cp_parser_class_head): Robustify. - - PR c++/15317 - * parser.c (cp_parser_decl_specifier_seq): Correct error in - comment. - (cp_parser_constructor_declarator_p): Treat attributes - as decl-specifiers. - - PR c++/15329 - * typeck.c (build_unary_op): Do not attempt to resolve casts to - base classes in templates. - - PR c++/15165 - * pt.c (instantiate_template): Robustify. - - PR c++/15025 - * decl.c (xref_tag): Issue errors about redeclaring template - classes as non-template classes. - - PR c++/14821 - * name-lookup.c (supplement_binding): Allow redefinitions of - namespace aliases. - - PR c++/14883 - * parser.c (cp_parser_template_argument): Robustify. - -2004-05-22 Mark Mitchell - - PR c++/15285 - PR c++/15299 - * pt.c (build_non_dependent_expr): Expand the set of tree nodes - recognized as overloaded functions. - - PR c++/15507 - * class.c (layout_nonempty_base_or_field): Do not try to avoid - layout conflicts for unions. - - PR c++/15542 - * typeck.c (build_x_unary_op): Instantiate template class - specializations before looking for "operator &". - - PR c++/15427 - * typeck.c (complete_type): Layout non-dependent array types, even - in templates. - - PR c++/15287 - * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a - template. - -2004-04-23 Giovanni Bajo - - PR c++/15064 - * parser.c (cp_parser_postfix_expression): typeid operator cannot be - used in integral constant expressions. - -2004-04-18 Release Manager - - * GCC 3.4.0 released. - -2004-04-08 Danny Smith - - PR c++/14808 - * method.c (make_alias_for_thunk): Just return function decl - for one_only functions if __CYGWIN__ or __MINGW32__ - (use_thunk): Don't put function and thunk in same one_only - section if __CYGWIN__ or __MINGW32__. - -2004-04-08 Jakub Jelinek - - * decl2.c (mark_used): Don't segfault if cfun != NULL but - current_function_decl == NULL. - -2004-04-01 Mark Mitchell - - PR c++/14803 - * typeck.c (get_delta_difference): Call fold before returning the - value. - -2004-04-01 Richard Henderson - - PR c++/14804 - * decl.c (cp_finish_decl): Preserve TREE_READONLY more often. - * typeck2.c (split_nonconstant_init): Clear TREE_READONLY. - -2004-04-01 Mark Mitchell - - PR c++/14810 - * name-lookup.c (maybe_push_cleanup_level): Robustify. - -2004-03-30 Mark Mitchell - - PR c++/14724 - * decl.c (start_decl_1): Do not decide whether or not to create a - new cleanup level until after the type has been completed. - - PR c++/14763 - * pt.c (tsubst_default_argument): Clear current_function_decl. - -2004-03-28 Jan Hubicka - - PR C++/14639 - * method.c (use_think): Do not mark thunk as referenced. - -2004-03-21 Mark Mitchell - - PR c++/14616 - * decl.c (cp_finish_decl): Compute the size of arrays declared in - templates, if their type is non-dependent. - -2004-03-19 Mark Mitchell - - * call.c (build_op_delete_call): Do not forget the placement - arguments when iterating through mutiple delete operators. - - * cp-tree.h (svaed_scope): Remove last_parms. - (NEW_DELETE_OPNAME_P): New macro. - (last_function_parms): Remove. - (do_friend): Adjust prototype. - * decl.c (grokparms): Return the PARM_DECLs directly, rather than - using last_function_parms. - (grokfndecl): Take the PARM_DECLs as an argument, rather than - using last_function_parms. - (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs - for class-specific operator new and operator delete. - (grok_op_properties): Do not look for allocation functions with - METHOD_TYPEs. - (start_function): Use DECL_ARGUMENTS instead of - last_function_parms. - * decl.h (last_function_parms): Do not declare. - * decl2.c (grokclassfn): Do not use last_function_parms. - * friend.c (do_friend): Remove parmdecls parameter. - * name-lookup.c (push_to_top_level): Do not save last_function_parms. - (pop_from_top_level): Do not restore it. - * pt.c (check_explicit_specialization): Do not adjust - last_function_parms. - - * name-lookup.c (do_local_using_decl): Create a local binding for - types brought in via using declarations. - - * name-lookup.c (lookup_arg_dependent): Handle block-scope - function declarations correctly. - - * semantics.c (finish_id_expression): Correct handling of - conversion operators to dependent types. - - * typeck.c (lookup_destructor): Allow the use of destructors from - base classes. - -2004-03-19 Giovanni Bajo - - PR c++/14545 - * parser.c (cp_parser_functional_cast): A cast to anything - but integral or enumaration type is not an integral constant - expression. - * pt.c (value_dependent_expression_p): Handle cast expressions - without operands (such as "int()"). - -2004-03-18 Mark Mitchell - - * semantics.c (finish_pseudo_destructor_expr): Allow differing - cv-qualification between the type named by the - pseudo-destructor-name and the object-type. - - * search.c (accessible_base_p): Handle non-proper bases. - - * name-lookup.c (do_nonmember_using_decl): If a using declaration - refers to a single overloaded function, set the type of the - function. - * tree.c (lvalue_type): Simplify. - * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an - unknown type. - (build_unary_op): Handle OVERLOADs with known types. - - * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for - function templates. - - * parser.c (cp_parser_postfix_expression): Handle the use of - "typename" in non-dependent contexts. Convert appropriately when - when using a qualified name after "->" or ".". - - * call.c (conditional_conversion): Honor the requirement that some - conversions refer to the original object. - - * call.c (build_conditional_expr): Do not call force_rvalue for - operands of void_type when the conditional expression itself has - void type. - * name-lookup.c (pushdecl): Don't consider a declaration of a - function named "main" to be an overload of a type named "main". - * parser.c (cp_parser_template_name): Perform name lookup when the - template name is proceeded by "template" if the qualifying scope - is non-dependent. - * typeck.c (composite_pointer_type_r): Correctly handle - pointer-to-member types. - (build_const_cast): Likewise. - -2004-03-16 Mark Mitchell - - PR c++/14586 - * cp-tree.h (build_new_op): Change prototype. - (build_x_binary_op): Likewise. - * call.c (build_new_op): Add overloaded_p parameter. - * decl2.c (grok_array_decl): Adjust call to build_new_op. - * parser.c (cp_parser_binary_expression): Note that uses of - overloaded operators prevents an expression from being considered - an integral constant. - * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or - build_x_binary_op. - * semantics.c (finish_call_expr): Likewise. - * typeck.c (rationalize_conditional_expr): Likewise. - (build_x_indirect_ref): Likewise. - (build_x_binary_op): Likewise. - (build_x_unary_op): Likewise. - (build_x_compound_expr): Likewise. - (build_modify_expr): Likewise. - * typeck2.c (build_x_arrow): Likewise. - -2004-03-13 Mark Mitchell - - PR c++/14550 - * parser.c (cp_parser_non_integral_constant_expression): Encode - more of the idiom that surrounded calls to this function within - the function itself - (cp_parser_primary_expression): Adjust accordingly. - (cp_parser_postfix_expression): Likewise. - (cp_parser_unary_expression): Likewise. - (cp_parser_cast_expression): Likewise. - (cp_parser_assignment_expression): Likewise. - (cp_parser_expression): Likewise. - (cp_parser_new_expression): Note that new-expressions are not - allowed in integral constant expressions. - (cp_parser_delete_expression): Likewise. - -2004-03-11 Mark Mitchell - - PR c++/14476 - * decl.c (xref_tag): Do not create dummy ENUMERAL_TYPEs. - -2004-03-10 Mark Mitchell - - PR c++/14510 - * decl.c (xref_tag): Disregard non-type declarations when - looking up a tagged type. - -2004-03-10 Jason Merrill - - PR c++/14452 - * tree.c (stabilize_init): Return whether or not it worked. - * init.c (build_new_1): If not, use a sentry. - * cp-tree.h: Adjust prototype. - -2004-03-09 Nathan Sidwell - - PR c++/14397 - * call.c (convert_like_real): Build a const qualified temporary, - when testing ctor access. - -2004-03-09 Mark Mitchell - - * call.c (initialize_reference): Fix typo. - -2004-03-09 Giovanni Bajo - - PR c++/14409 - * pt.c (determine_specialization): For member templates, match also - constness. - - PR c++/14448 - * parser.c (cp_parser_initializer_clause): Fold initializer if it is - non-dependent. - * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs. - -2004-03-09 Mark Mitchell - - PR c++/14230 - * call.c (initialize_reference): Handle initializers that are - class-member access expressions applies to rvalues. - - PR c++/14432 - * name-lookup.c (supplement_binding): Ignore functions that are - marked DECL_ANTICIPATED. - -2004-03-08 Mark Mitchell - - PR c++/14401 - * class.c (check_field_decls): Complain about non-static data - members of reference type in unions. Propagate - CLASSTYPE_REF_FIELDS_NEED_INIT and - CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static - data members. - * init.c (perform_member_init): Complain about mbmers with const - type that are not explicitly initialized. - -2004-03-08 Jason Merrill - - PR c++/13170 - * decl.c (xref_tag): Remove attribute handling. - * cp-tree.h: Adjust prototype. - * decl.c, parser.c, rtti.c: Adjust callers. - * parser.c (cp_parser_class_head): Pass back attributes in the - class head. - (cp_parser_class_specifier): Adjust. - -2004-03-08 Matt Austern - - PR debug/14079 - * name-lookup.c (add_decl_to_level): Add extern variables, as well - as static, to static_decls array. - -2004-03-01 Jason Merrill - - PR c++/13944 - * except.c (do_free_exception): Remove #if 0 wrapper. - (build_throw): Use it if we elide a copy into the - exception object. - - * tree.c (stabilize_call): Fix thinko. - - * init.c (build_new_1): Preevaluate initializer. Simplify EH code. - (build_init): Call a constructor rather than call build_aggr_init - for classes. - * except.c (stabilize_throw_expr): Remove. - (build_throw): Use stabilize_init instead of stabilize_throw_expr. - * tree.c (stabilize_call, stabilize_init): New fns. - * call.c (build_over_call): A constructor no longer returns the - address of the object. - -2004-03-01 Mark Mitchell - - PR c++/14324 - * lex.c (retrofit_lang_decl): Treat entities with no linkage as - having C++ linkage for name-mangling purposes. - - PR c++/14260 - * parser.c (cp_parser_direct_declarator): Recognize constructor - declarators that use a template-id to name the class being - constructed. - - PR c++/14337 - * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes. - (tsubst_expr): Do not call tsubst_copy, even when - processing_template_decl. - -2004-03-01 Mark Mitchell - - PR c++/14369 - * pt.c (build_non_dependent_expr): Do not create a - NON_DEPENDENT_EXPR for a THROW_EXPR. - - PR c++/14360 - * parser.c (cp_parser_postfix_expression): Do not perform Koenig - lookup if ordinary name-lookup finds a non-function. - * pt.c (tsubst_copy_and_build): Likewise. - - PR c++/14361 - * parser.c (cp_parser_late_parsing_default_args): Check that there - are no extra tokens after the end of the default-argument - expression. - - PR c++/14359 - Backport 2004-02-12 Mark Mitchell - * decl.c (redeclaration_error_message): Correct handling of - templates. - * pt.c (tsubst_friend_declaration): Adjust code to determine - whether or not a friend template is a definition. - (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs. - -2004-03-01 Gabriel Dos Reis - - PR c++/14369 - * error.c (dump_expr): Handle THROW_EXPR. - -2004-02-29 Mark Mitchell - - PR c++/14138 - * name-lookup.h (push_scope): Change prototype. - * name-lookup.c (push_scope): Do not reenter the current class - scope. - * decl.c (grokfndecl): Check return code from push_scope before - calling pop_scope. + PR c++/19030 + * cp-tree.h (start_decl): Take pointer to pushed scope, not bool. + * name-lookup.h (push_scope): Return pushed scope, not flag. + * name-lookup.c (push_scope): Return scope that should be popped, + not a flag. + * decl.c (start_decl): Adjust. + (grokfndecl): Adjust scope push and pop. * decl2.c (check_classfn): Likewise. - * parser.c (cp_parser_conversion_function_id): Likewise. - (cp_parser_init_declarator): Likewise. - (cp_parser_direct_declarator): Likewise. - (cp_parser_class_specifier): Likewise. - (cp_parser_class_head): Likewise. - (cp_parser_lookup_name): Likewise. - (cp_parser_constructor_declarator_p): Likewise. - * pt.c (instantiate_class_template): Likewise. - (resolve_typename_type): Likewise. - -2004-02-27 Mark Mitchell - - PR debug/12103 - * class.c (update_vtable_entry_for_fn): Do not go through - covariance machinery if the type returned by an overrider is the - same as the original. - -2004-02-27 Giovanni Bajo - - PR c++/14284 - * pt.c (dependent_type_p_r): A template template parameter is a - dependent type. - -2004-02-26 Mark Mitchell - - PR c++/14278 - * parser.c (cp_parser_parameter_declaration_list): Commit - to fewer tentative parses. - -2004-02-26 Giovanni Bajo - - PR c++/14246 - * mangle.c (write_template_arg_literal): Don't rely on identity for - boolean constants. - -2004-02-23 Giovanni Bajo - - PR c++/14250 - * cvt.c (build_expr_type_conversion): Type must be complete before - looking up for conversions. - -2004-02-20 Mark Mitchell - - PR c++/14199 - * pt.c (tsubst_copy): Call mark_used for a PARM_DECL. - - PR c++/14173 - * semantics.c (begin_class_definition): Set TYPE_PACKED correctly - for all type variants. - -2004-02-19 Mark Mitchell - - PR c++/14186 - * name-lookup.c (push_class_level_binding): Do not complain about - adding a binding for a member whose name is the same as the - enclosing class if the member is located in a base class of the - current class. - -2004-02-19 Giovanni Bajo - - PR c++/14181 - * parser.c (cp_parser_new_expression): Parse an ill-formed - direct-new-declarator after a parenthesized type-id to emit good - diagnostic. - -2004-02-17 Mark Mitchell - - PR c++/11326 - * cp-tree.h (abi_version_at_least): Remove. - * mangle.c: Include flags.h. - -2004-02-15 Mark Mitchell - - PR c++/13971 - * call.c (build_conditional_expr): Handle conversions between - class types which result in differently cv-qualified type - variants. - - PR c++/14086 - * class.c (delete_duplicate_fields_1): Remove. - (delete_duplicate_fields): Likewise. - (finish_struct_anon): Remove check for members with the same name - as their enclosing class. - (check_field_decls): Do not call duplicate_fields. - * decl.c (grokdeclarator): Remove check for static data members - with the same name as their enclosing class. - * name-lookup.c (push_class_level_binding): Check for members with - the same name as their enclosing class. - -2004-02-15 Gabriel Dos Reis - - PR c++/14085 - * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM. - -2004-02-14 Kriang Lerdsuwanakij - - PR c++/13635 - * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL - has full set of arguments. - -2004-02-13 Mark Mitchell - - PR c++/14122 - * cp-tree.h (delete_sanity): Change prototype. - * decl2.c (delete_sanity): Make doing_vec a bool, not an int. - Remove dead code. Adjust code to warn about deleting an array. - * typekc.c (decay_conversion): Use build_address and build_nop. - - PR c++/14108 - * search.c (accessible_p): Do not check access in thunks. - -2004-02-13 Giovanni Bajo - - PR c++/13927 - * error.c (dump_decl) : Dump as simple declarations. - -2004-02-13 Mark Mitchell - - PR c++/14083 - * call.c (build_conditional_expr): Call force_rvalue on the - non-void operand in the case that one result is a throw-expression - and the other is not. - -2004-02-13 Ian Lance Taylor - - PR c++/9851 - * parser.c (cp_parser_pseudo_destructor_name): Check for errors on - the type name and look ahead for ::~, and bail out early with a - better error message if the parse is going to fail. - -2004-02-10 Mark Mitchell - - * typeck.c (lookup_destructor): Fix typo in error message. - -2004-02-07 Zack Weinberg - - Bug 13856 - * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS. - * decl.c (duplicate_decls, start_function): Likewise. - -2004-02-07 Zack Weinberg - - * name-lookup.c (pushdecl): Issue shadow warnings directly. - * parser.c (free_parser_stacks): Delete. - -2004-02-07 Kazu Hirata - - * rtti.c, tree.c: Update copyright. - -2003-02-06 Giovanni Bajo - - PR c++/14033 - * decl.c (require_complete_types_for_parms): Do not insert - error_mark_node in the parameter list. - -2003-02-06 Giovanni Bajo - - PR c++/14028 - * parser.c (cp_parser_enclosed_template_argument_list): Emit straight - error when terminator can not be found. - -2004-02-05 Kelley Cook - - Make-lang.in (po-generated): Delete. - -2004-02-05 Rainer Orth - - PR middle-end/13750 - Revert: - 2004-01-15 Geoffrey Keating - PR pch/13361 - * cp/lex.c (handle_pragma_interface): Duplicate string from tree. - (handle_pragma_implementation): Likewise. - -2004-02-05 Mark Mitchell - - PR c++/13714 - * typeck.c (lookup_destructor): Tweak error message. - -2004-02-05 Paul Brook - - Backport from mainline. - - 2003-11-05 Mark Mitchell - - * decl.c (cxx_push_function_context): Do not set - current_function_is_thunk. - * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the - actual function. - -2004-02-04 Mark Mitchell - - PR c++/13932 - * call.c (convert_like_real): Use "converting" rather than - "argument" as the descriptive keyword to - dubious_conversion_warnings. - * typeck.c (convert_for_assignment): Do not call - dubious_conversion_warnings. - -2004-02-04 Giovanni Bajo - - PR c++/13086 - * init.c (build_delete): Emit a more informative error message in - case of an incomplete type, and on the correct source line. - -2004-02-04 Mark Mitchell - - PR c++/9941 - * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the - linkage for the typeinfo name string. - - PR c++/13969 - * cp-tree.h (fold_non_dependent_expr): New function. - * parser.c (cp_parser_fold_non_dependent_expr): Remove. - (cp_parser_template_argument): Use fold_non_dependent_expr. - (cp_parser_direct_declarator): Likewise. - * pt.c (fold_non_dependent_expr): New function. - (convert_nontype_argument): Use it. - (tsubst_qualified_id): Simplify. - (tsubst_copy_and_build): Likewise. - -2003-02-04 Giovanni Bajo - - PR c++/13997 - * pt.c (more_specialized_class): Increase processing_template_decl - while partial ordering. - -2004-02-03 Mark Mitchell - - PR c++/13950 - * parser.c (cp_parser_class_name): Robustify. - - PR c++/13970 - * parser.c (cp_parser_cache_group): Do not consume the EOF token. - -2004-02-03 Mark Mitchell - - PR c++/13925 - * decl.c (start_function): Do not call pushdecl for any - instantiation or specialization of a primary template. - - PR c++/14002 - * semantics.c (finish_id_expression): Do not return an - IDENTIFIER_NODE when lookup finds a PARM_DECL. - - PR c++/13978 - * pt.c (build_non_dependent_expr): Do not build - NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs. - - PR c++/13968 - * semantics.c (finish_id_expression): Do not return an - IDENTIFIER_NODE when lookup finds a VAR_DECL. - - PR c++/13975 - * parser.c (cp_parser_simple_declaration): When skipping to the - end of the statement swallow the terminating semicolon. - -2004-02-02 Giovanni Bajo - - DR206 - PR c++/13813 - * decl.c (grokdeclarator): Check immediatly type completeness for - non-dependent types. - -2004-01-30 Mark Mitchell - - PR c++/13113 - * init.c (build_offset_ref): Improve error recovery for invalid - uses of non-static member functions. - - PR c++/13854 - * cp-tree.h (cp_build_type_attribute_variant): New function. - * class.c (build_clone): Use cp_build_type_attribute_variant. - * decl.c (duplicate_decls): Likewise. - * pt.c (copy_default_args_to_explicit_spec): Likewise. - (tsubst_function_type): Likewise. - * tree.c (build_exception_variant): Check attributes before - concluding that two types are the same. - (cp_build_type-attribute_variant): New method. - * typeck.c (merge_types): Use cp_build_type_attribute_variant. - - PR c++/13907 - * call.c (convert_class_to_reference): Keep better track of - pedantically invalid user-defined conversions. - -2004-02-02 Giovanni Bajo - - PR c++/13957 - * pt.c (tsubst_qualified_id): Improved error message when a type - is expected but not found. - -2004-01-30 Michael Matz - - * parser.c (cp_parser_labeled_statement): Accept case ranges. - -2004-01-28 Jan Hubicka - - PR c++/13683 - * call.c (convert_arg_to_ellipsis): Don't emit a warning if within - a sizeof expression.block - -2004-01-29 Giovanni Bajo - - * parser.c (cp_parser_template_id): Parse tentatively `[:' after a - template name as it was `<::' (digraph typo). - (cp_parser_nth_token_starts_template_argument_list_p): New function. - (cp_parser_id_expression): Use it. - (cp_parser_nested_name_specifier_opt): Likewise. - (cp_parser_template_name): Likewise. - (cp_parser_class_name): Likewise. - (cp_lexer_get_preprocessor_token): Use c_lex_with_flags. - -2004-01-29 Mark Mitchell - - PR c++/13883 - * mangle.c (write_encoding): Correct encoding of member template - constructors. - -2004-01-28 Mark Mitchell - - PR c++/13791 - * typeck.c (merge_types): Do not merge attributes into - TYPENAME_TYPEs. - -2004-01-28 Mark Mitchell - - PR c++/13736 - * parser.c (cp_parser_direct_declarator): Do not prevent - backtracking inside a parenthesized declarator. - (cp_parser_parameter_declaration): Fix typo in comment. - -2004-01-26 Kaveh R. Ghazi - - * cp-tree.h (language_function, lang_type_header): Use - BOOL_BITFIELD. - * name-lookup.h (cp_binding_level): Likewise. - -2004-01-26 Mark Mitchell - - PR c++/13663 - * semantics.c (finish_for_expr): Check for unresolved overloaded - functions. - -2004-01-26 Mark Mitchell - - * class.c (add_method): Just check processing_template_decl to - determine whether or not we are within a template. - * decl2.c (maybe_retrofit_in_chrg): Likewise. - * init.c (decl_constant_value): Check the type of the declaration, - not TREE_READONLY. - * name-lookup.c (maybe_push_to_top_level): Rename to ... - (push_to_top_level): ... this. - * name-lookup.h (maybe_push_to_top_level): Do not declare it. - * pt.c (push_template_decl_real): Reorder condition for speed. - (convert_template_argument): Use dependency-checking functions in - place of uses_template_parms. - (lookup_template_class): Avoid calling uses_template_parms more - than once. - (uses_template_parms): Reimplement, using dependency-checking - functions. - (instantiate_class_template): Use push_to_top_level, not - maybe_push_to_top_level. - (type_unification_real): Simplify. - (type_dependent_expression_p): Handle OFFSET_REFs and - TEMPLATE_DECLs. - (any_dependent_template_arguments_p): Handle multiple levels of - template argument. - * semantics.c (expand_or_defer_fn): Do not check - uses_template_parms for template instantiations. - * typeck.c (comptypes): Avoid calling cp_type_quals. - -2004-01-25 Mark Mitchell - - PR c++/13833 - * call.c (build_over_call): Do not convert arguments when - processing a template. - * pt.c (build_non_dependent_expr): Do not build a - NON_DEPENDENT_EXPR for arithmetic constants. - -2004-01-25 Giovanni Bajo - - PR c++/13810 - * parser.c (cp_parser_type_parameter): When cp_parser_id_expression - returns a TYPE_DECL. no further lookup is required. - * semantics.c (check_template_template_default_arg): A TYPE_DECL - is invalid. Rework to give better diagnostics. - -2004-01-25 Kriang Lerdsuwanakij - - PR c++/13797 - * pt.c (instantiate_class_template): Add an error_mark_node - check. - (tsubst_decl) : Likewise. - -2004-01-24 Kazu Hirata - - * call.c: Update copyright. - * class.c: Likewise. - * decl2.c: Likewise. - * except.c: Likewise. - * expr.c: Likewise. - * init.c: Likewise. - * mangle.c: Likewise. - * optimize.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2004-01-23 Andrew Pinski - - PR c++/13701 - * decl.c (finish_function): Move the call to - finish_fname_decls below the call to - finish_eh_spec_block. - -2004-01-21 Zdenek Dvorak - - * parser.c (cp_parser_class_specifier): Prevent garbage collection. - -2004-01-20 Kelley Cook - - * Make-lang.in: Replace $(docdir) with doc. - (c++.info, c++.srcinfo): Dummy entry. - (c++.man, c++.srcman): New rules. - (c++.install-man): Revamp rule. - -2004-01-19 Kelley Cook - - * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME, - CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a - immediate $(shell) instead of deferred backquote. - -2004-01-19 Mark Mitchell - - PR c++/13651 - * parser.c (cp_parser_postfix_expression): When encountering - incomplete type on left-hand side of "->" or ".", treat the entire - expression as erroneous. - -2004-01-19 Mark Mitchell - - PR c++/13592 - * call.c (build_field_call): Remove. - (n_build_method_call): Likewise. - (build_method_call): Likewise. - (build_new_method_call): Do not call build_field_call. - * class.c (n_build_method_call): Remove. - (print_class_statistics): Do not print it. - * cp-tree.h (build_method_call): Remove declaration. - (finish_object_call_expr): Likewise. - (build_new_1): Do not use build_method_call. - * parser.c (cp_parser_postfix_expression): Use finish_call_expr - when the function appearing on the right-hand-side of "." or "->" - is not actually a function. - * pt.c (tsubst_copy_and_build): Likewise. - * semantics.c (finish_object_call_expr): Remove. - -2004-01-18 Mark Mitchell - - PR c++/13710 - * pt.c (tsubst): Use finish_typeof. - -2004-01-18 Jason Merrill - - PR c++/11725 - * except.c (build_throw): In a template, set - current_function_returns_abnormally. - -2004-01-17 Fred Fish - - PR c++/11895 - * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, - except don't call array_type_nelts() with a VECTOR_TYPE. - -2004-01-16 Jan Hubicka - - * mangle.c (write_mangled_name): Remove inline modifier. - -2004-01-16 Mark Mitchell - - PR c++/13574 - * decl.c (compute_array_index_type): Fix grammar in comment. - * init.c (build_zero_init): Handle zero-sized arrays correctly. - - PR c++/13178 - * call.c (name_as_c_string): Print conversion operator names - correctly. - - PR c++/13478 - * call.c (initialize_reference): Pass -1 for inner parameter to - convert_like_real. - -2004-01-15 Giovanni Bajo - - PR c++/13407 - * parser.c (cp_parser_base_specifier): Check for an invalid - keyword `typename' and emit an user-friendly error message. - -2004-01-15 Geoffrey Keating - - PR pch/13361 - * cp/lex.c (handle_pragma_interface): Duplicate string from tree. - (handle_pragma_implementation): Likewise. - -2004-01-15 Giovanni Bajo - - PR c++/9259 - * typeck.c (build_class_member_access_expr): Allow to access members - of the currently open class. - (finish_class_member_access_expr): Likewise. - -2004-01-15 Alexandre Oliva - - PR c++/13659 - * name-lookup.c (validate_nonmember_using_decl): Take scope and - name by value, instead of computing them. - (do_local_using_decl, do_toplevel_using_decl): Add scope and name - arguments. Pass them to validate_nonmember_using_decl. - * name-lookup.h (do_local_using_decl): Adjust. - (do_toplevel_using_decl): Likewise. - * parser.c (cp_parser_using_declaration): Likewise. - * pt.c (tsubst_expr): Likewise. - -2004-01-15 Alexandre Oliva - - PR c++/13594 - PR c++/13658 - * name-lookup.c (qualified_lookup_using_namespace): Search - strongly-associated namespaces first, and only then try other - namespaces. - -2004-01-15 Kelley Cook - - * Make-lang.in (c++.srcextra): Dummy entry. - -2004-01-15 Giovanni Bajo - - PR c++/8856 - * parser.c (cp_parser_template_name): Don't try to parse a - conversion-function-id, as it cannot be a template-name. - (cp_parser_simple_type_specifier): Check for invalid template-ids - even after a built-in type. - -2004-01-14 Jan Hubicka - - PR c++/12850 - * pt.c (instantiate_decl): Do not increase function_depth. - -2004-01-14 Danny Smith - - PR c++/9021 - PR c++/11005 - * parser.c (cp_parser_elaborated_type_specifier): Warn about - attributes and discard. - * decl.c (xref_tag): Don't overwite existing attributes with - NULL_TREE. - -2004-01-14 Giovanni Bajo - - PR c++/12335 - * parser.c (cp_parser_lookup_name): Return error_mark_node if there - is no destructor while looking up a BIT_NOT_EXPR. - -2004-01-13 Ian Lance Taylor - - * cxxfilt.c: Remove unused file. - -2004-01-14 Jan Hubicka - - Partial fix to PR c++/12850 - * decl2.c (mark_used): Do not proactively instantiate templates - when compiling in unit-at-a-time or not optimizing. - * optimize.c (maybe_clone_body): Do not increase function depth. - -2004-01-13 Giovanni Bajo - - PR c++/13474 - * pt.c (tsubst) : Remove obsolete array index tweaking. - -2003-01-12 Steven Bosscher - - PR c++/13558 - * parser.c (cp_parser_member_declaration): Any non-type is also - not a class or a function. - -2004-01-12 Jason Merrill - - PR c++/12815 - * class.c (build_base_path): Do not mark vtable references as - TREE_CONSTANT. - (build_vtbl_ref_1): Likewise. - -2004-01-12 Richard Henderson - - PR opt/10776 - * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New. - (store_init_value): Use it. - * decl.c (check_initializer): Expect full initialization code - from store_init_value. - * init.c (expand_aggr_init_1): Likewise. - * decl2.c (maybe_emit_vtables): Abort if runtime init needed. - -2004-01-12 Mark Mitchell - - * class.c (layout_class_type): For non-POD class types, also copy - the DECL_SIZE and DECL_MODE of fields to the base class type. - -2004-01-12 Kriang Lerdsuwanakij - - PR c++/13289 - * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before - calling regenerate_decl_from_template. - -2004-01-12 Scott Brumbaugh - - PR c++/4100 - * parser.c (cp_parser_decl_specifier_seq): Add check for a friend - decl-specifier occurring along with a class definition. - -2004-01-12 Ian Lance Taylor - - * parser.c (cp_parser_decl_specifier_seq): Add parenthetical - clauses to comments describing declares_class_or_enum. - (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not - false. - -2004-01-12 Jan Hubicka - - * pt.c (for_each_template_parm): Do not check for duplicates. - (for_each_template_parm): Use walk_tree duplicate checking code. - -2004-01-11 Ian Lance Taylor - - PR c++/3478 - * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec - is error_mark_node, don't add any more decl_specs. - (cp_parser_init_declarator): After committing to a declaration, if - the decl_specifiers start with error_mark_node, issue an error and - change the type to "int". - -2004-01-09 Nathanael Nerode - - PR bootstrap/7817 - * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so. - -2004-01-10 Giovanni Bajo - - DR 337 - PR c++/9256 - * pt.c (tsubst): Substitution must fail if we are attempting to - create an array with element type that is an abstract class type. - * decl.c (cp_finish_decl): Strip pointers and array types recursively - before calling abstract_virtuals_error. - -2004-01-09 Alexandre Oliva - - * name-lookup.c (qualified_lookup_using_namespace): Consider - strong using directives even if we've already found a binding. - -2004-01-09 Mark Mitchell - - * cp-tree.h (cxx_expand_expr): Change prototype. - * expr.c (cxx_expand_expr): Add alt_rtl parameter. - -2004-01-08 Giovanni Bajo - - PR c++/12573 - * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by - looking into them recursively. They can be there because of the - new __offsetof__ extension. - -2004-01-07 Zack Weinberg - - * parser.c (cp_parser_save_member_function_body): Mark the - definition static. - -2004-01-05 Mark Mitchell - - PR c++/13057 - * class.c (build_clone): Copy type attributes from the original - function to the clone. - - PR c++/12815 - * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable - references as constant. - - PR c++/12132 - * parser.c (cp_parser_explicit_instantiation): Improve error - recovery. - (cp_parser_require): Improve indication of the error location. - - PR c++/13451 - * parser.c (cp_parser_class_head): Reorder logic to check for - invalid qualification. - -2004-01-04 Mark Mitchell - - PR c++/13157 - * name-lookup.c (lookup_using_namespace): Remove spacesp - parameter. - (unqualified_namespace_lookup): Likewise. - (lookup_qualified_name): Adjust accordingly. - (lookup_name_real): Likewise. - (lookup_arg_dependent): Do not eliminate the namespace of the - functions found by unqualified name lookup unless that is the - current namespace. - -2004-01-04 Andrew Pinski - - * semantics.c (push_deferring_access_checks): Fix format. - (resume_deferring_access_checks): Likewise. - (stop_deferring_access_checks): Likewise. - (pop_deferring_access_checks): Likewise. - (get_deferred_access_checks): Likewise. - (pop_to_parent_deferring_access_checks): Likewise. - (perform_deferred_access_checks): Likewise. - (perform_or_defer_access_check): Likewise. - -2004-01-04 Richard Henderson - - * call.c (build_over_call): Don't create a save_expr of an - aggregate, but rather its address. - -2004-01-04 Mark Mitchell - - PR c++/13529 - * parser.c (cp_parser_postfix_expression): Allow "." to appear in - an offsetof expression. - - * parser.c (cp_parser_parameter_declaration): Fix comment. - - PR c++/12226 - * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro. - (reference_binding): Set it when appropriate. - (build_temp): New function, split out from ... - (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P. - (initialize_reference): Likewise. - - PR c++/13536 - * parser.c (cp_parser): Add in_type_id_in_expr_p. - (cp_parser_new): Initialize it. - (cp_parser_postfix_expression): Set it. - (cp_parser_sizeof_operand): Likewise. - (cp_parser_parameteR_declaration): Do not commit early to tenative - parsers when in_type_id_in_expr_p is set. - -2004-01-03 Kriang Lerdsuwanakij - - PR c++/13094 - * parser.c (cp_parser_template_argument): Don't call - make_unbound_class_template directly. - (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from - UNBOUND_CLASS_TEMPLATE tree node. - -2004-01-02 Richard Sandiford - - PR target/12729 - * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr. - -2004-01-02 Kriang Lerdsuwanakij - - PR c++/13520 - * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro. - (DECL_FUNCTION_TEMPLATE_P): Use it. - (DECL_CLASS_TEMPLATE_P): Likewise. - * parser.c (cp_parser_lookup_name): Add is_template parameter. - (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name. - (cp_parser_template_name): Likewise. - (cp_parser_elaborated_type_specifier): Likewise. - (cp_parser_namespace_name): Likewise. - (cp_parser_class_name): Likewise. - (cp_parser_lookup_name_simple): Likewise. - -See ChangeLog.3 for earlier changes. + * parser.c (cp_parser_condition, cp_parser_conversion_function_id, + cp_parser_init_declarator, cp_parser_direct_declarator, + cp_parser_class_specifier, cp_parser_class_head, + cp_parser_lookup_name, + cp_parser_constructor_declarator_p): Likewise. + * pt.c (instantiate_class_template, + resolve_typename_type): Likewise. + +2005-01-03 Volker Reichelt + + PR c++/14136 + * parser.c (cp_parser_unqualified_id): Do not issue error message + for typedef-name as destructor declarator when performing an + uncommitted tentative parse. + +2005-01-01 Steven Bosscher + + PR middle-end/17544 + * decl.c (finish_function): Fix comment. Annotate the compiler + generated return with the current file name and line 0. diff --git a/contrib/gcc/cp/ChangeLog-1993 b/contrib/gcc/cp/ChangeLog-1993 new file mode 100644 index 00000000000..074a7d2d8d2 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1993 @@ -0,0 +1,606 @@ +Tue Dec 28 21:10:03 1993 Mike Stump + + * cp-init.c (expand_vec_init): Remove comptypes test, as it is too + harsh here. + +Tue Dec 28 13:42:22 1993 Mike Stump + + * cp-pt.c (do_pending_expansions): Decide to expand a template + member function, based upon it's class type, not the class type of + the first place it was declared. + +Tue Dec 28 05:42:31 1993 Mike Stump + + * cp-class.c (is_normal): New routine, use to determine when the + given binfo is the normal one. (The one that should have the simple + vtable name.) + * cp-class.c (modify_other_vtable_entries): Use DECL_ASSEMBLER_NAME + to check if two fndecls are `the same'. Sometimes this routine can + modify the main vtable, and normal should be 1, in that case, so use + is_normal() to determine if this is the main vtable for the class. + Don't recurse down virtual bases, as they are shared, and we take + care of them elsewhere. + * cp-class.c (modify_vtable_entries): If we have already updated the + vtable with the new virtual, don't do it again. + * cp-class.c (finish_struct): Set CLASSTYPE_VFIELD_PARENT as + appropriate. Do virtual function overriding in virtual bases, after + normal overriding, so that the base function list in DECL_VINDEX is + not overridden, before we have a chance to run through the list. + Use DECL_ASSEMBLER_NAME to check if two fndecls are `the same'. + Make sure we pass the right address into modify_vtable_entries. + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): New field to indicate which + binfo is the one that has the vtable that we based our vtable on. + +Fri Dec 24 09:40:52 1993 Michael Tiemann + + * cp-typeck.c (c_expand_start_case): Use default_conversion to + convert expression from reference type if necessary. + +Wed Dec 22 17:58:43 1993 Jason Merrill + + * cp-typeck.c (build_unary_op): Make sure that it's a TREE_LIST before + trying to read its TREE_VALUE. + + * cp-class.c (finish_struct_methods): Clear DECL_IN_AGGR_P here. + (finish_struct): Instead of here. + +Tue Dec 21 14:34:25 1993 Brendan Kehoe + + * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't + have TYPE_PTRMEMFUNC_P set before we try to build its + CLASSTYPE_ID_AS_LIST. + (get_decl_list): Likewise, when trying to read it. + + * cp-tree.h (VTABLE_NAME): No def with NO_{DOLLAR,DOT} defined. + (VTABLE_NAME_P): Use it instead of VTABLE_NAME_FORMAT. + +Mon Dec 20 13:35:03 1993 Brendan Kehoe + + * cp-typeck.c (rationalize_conditional_expr): New function. + (unary_complex_lvalue): Use it. + (build_modify_expr): Use it, since trying to do an ADDR_EXPR of it + with build_unary_op won't cut it. Don't wrap the COND_EXPR with a + SAVE_EXPR either. + + * cp-decl2.c (explicit_warn_return_type): Deleted variable. + (lang_decode_option): Set warn_return_type, not explicit_*, for + -Wreturn-type and -Wall. This is what rest_of_compilation uses to + decide if it should go into jump_optimize or not. + * cp-tree.h (explicit_warn_return_type): Deleted. + * cp-decl.c (grokdeclarator): Use warn_return_type, not explicit_*. + (finish_function): Also complain about no return in a non-void fn if + we're being pedantic (don't rely on use of -Wreturn-type). + +Fri Dec 17 15:45:46 1993 Brendan Kehoe + + * cp-decl.c (grokdeclarator): Forbid declaration of a function as + static if it's being done inside another function. + + * cp-search.c (compute_visibility): Check for friendship both ways. + +Fri Dec 17 14:28:25 1993 Jason Merrill + + * cp-cvt.c (build_default_binary_type_conversion): Make error + messages more helpful. + + * cp-error.c (op_as_string): New function, returns "operator ==" + given EQ_EXPR or suchlike. + +Fri Dec 17 13:28:11 1993 Brendan Kehoe + + * cp-call.c (print_n_candidates): New function. + (build_overload_call_real): Use it when we complain about a call + being ambiguous. + +Fri Dec 17 12:41:17 1993 Jason Merrill + + * cp-call.c (build_method_call): Fix checking for static call + context. + + * cp-method.c (build_opfncall): Call build_indirect_ref on argument + to operator new. + + * cp-init.c (build_new): Don't mess with rval when building + indirect ref. + +Thu Dec 16 16:48:05 1993 Kung Hsu + + * cp-lex.c (default_assign_ref_body): Add check when TYPE_NESTED_ + NAME(type) may not be exist. It's not a problem for old compiler. + +Thu Dec 16 14:46:06 1993 Brendan Kehoe + + * cp-tree.h (CLASSTYPE_ALTERS_VISIBILITIES_P): Delete macro, it's + never used for anything. + (struct lang_type, member type_flags): Delete field + `alters_visibility', and up `dummy' by 1. + * cp-class.c (finish_base_struct): Delete code that copies the + setting of CLASSTYPE_ALTERS_VISIBILITIES_P. + (finish_struct): Delete code that sets it. + +Thu Dec 16 14:44:39 1993 Jason Merrill + + * cp-decl.c, cp-init.c, cp-typeck.c: Fix arguments to + build_method_call that I messed up before. + + * cp-search.c (get_base_distance): If protect > 1, allow immediate + private base. + + * cp-class.c (finish_base_struct): Set cant_synth_* correctly. + (finish_struct): Likewise. Well, nigh-correctly; it won't deal + properly with the case where a class contains an object of an + ambiguous base class which has a protected op=. Should be fixed + when the access control code gets overhauled. + (finish_struct_methods): Set TYPE_HAS_NONPUBLIC_* correctly. + +Thu Dec 16 12:17:06 1993 Brendan Kehoe + + * cp-lex.c (real_yylex): Turn the code back on that deals with + __FUNCTION__ and __PRETTY_FUNCTION__. Don't use lookup_name, to + avoid the ambiguity problems that led to it being turned off in the + first place. + + * cp-method.c (hack_identifier): Also check for a TYPE_PTRMEMFUNC_P + to see if something is a method. + +Wed Dec 15 18:35:58 1993 Mike Stump + + * cp-typeck.c (build_modify_expr): Avoid error messages on small + enum bit fields. + * cp-typeck.c (convert_for_assignment): Add missing argument to + cp_warning and cp_pedwarn calls. + +Wed Dec 15 18:25:32 1993 Jason Merrill + + * cp-parse.y (member_init): ANSI C++ doesn't forbid old-style base + initializers; it's just anachronistic. + + * cp-decl.c (finish_decl): Don't require external-linkage arrays + to have a complete type at declaration time when pedantic. + +Tue Dec 14 11:37:23 1993 Jason Merrill + + * cp-decl.c (pushdecl): Don't set DECL_CONTEXT if it's already set. + + * cp-call.c (build_method_call): Don't dereference pointer given + as instance. + + * cp-decl.c (finish_function): Don't pass pointer to + build_method_call. + (finish_function): Likewise. + + * cp-typeck.c (build_x_function_call): Likewise. + + * cp-method.c (build_component_type_expr): Likewise. + + * cp-init.c (build_member_call): Likewise. + (build_new): Likewise. + +Mon Dec 13 18:04:33 1993 Kung Hsu + + * cp-decl.c (xref_tag): Fix regression created by changes made + in Dec. 7 1993. + * cp-decl.c (xref_defn_tag): Fix parallel nested class problem. + +Fri Dec 10 12:40:25 1993 Brendan Kehoe + + * cp-call.c (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print + out the final evaluation of the function, so we can see if ELLIPSIS, + USER, and EVIL were set at the end. + + * cp-call.c (convert_harshness_ansi): When the parm isn't an lvalue, + only go for setting TRIVIAL_CODE if we are dealing with types that + are compatible. + +Thu Dec 9 18:27:22 1993 Mike Stump + + * cp-decl.c (flag_huge_objects): New flag to allow large objects. + * toplev.c (lang_options): Likewise. + * cp-decl2.c (flag_huge_objects, lang_f_options): Likewise. + * cp-decl.c (delta_type_node): New type for delta entries. + * cp-tree.h (delta_type_node): Likewise. + * cp-decl.c (init_decl_processing): Setup delta_type_node. + * cp-decl.c (init_decl_processing, build_ptrmemfunc_type): Use + delta_type_node instead of short_integer_type_node. + * cp-class.c (build_vtable_entry): Likewise. + +Thu Dec 9 16:19:05 1993 Brendan Kehoe + + * cp-tree.h (OPERATOR_TYPENAME_P): Define outside of + NO_{DOLLAR,DOT} macro checks, so it always gets defined. + (VTABLE_NAME_P): Define for NO_DOT && NO_DOLLAR_IN_LABEL. + +Wed Dec 8 17:38:06 1993 Mike Stump + + * cp-decl.c (finish_decl): Make sure things that can go into + "common", do go into common, if -fcommon is given. + +Wed Dec 8 13:01:54 1993 Brendan Kehoe + + * cp-call.c (print_harshness) [DEBUG_MATCHING]: New function. + (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print out + argument matching diagnostics to make instantly clear what the + compiler is doing. + + * cp-call.c (convert_harshness_ansi): If the parm isn't an lvalue, + then check to see if the penalty was increased due to + signed/unsigned mismatch, and use a TRIVIAL_CODE if it wasn't. + +Tue Dec 7 18:29:14 1993 Kung Hsu + + * cp-decl.c (xref_tag, pushtag): Fix nested class search/resolution + problem. + +Tue Dec 7 16:09:34 1993 Jason Merrill + + * cp-class.c (finish_struct): Before synthesizing methods, if no + methods have yet been declared then set nonprivate_method. Don't + set non_private method after synthesizing a method. + + * cp-lex.c (extract_interface_info): If flag_alt_external_templates + is set, tie emitted code to the location of template instantiation, + rather than definition. + + * cp-tree.h: Declare flag_alt_external_templates. + + * cp-decl2.c (lang_decode_option): Support -falt-external-templates. + + * toplev.c (lang_options): Likewise. + +Mon Oct 4 12:50:02 1993 Chip Salzenberg + + [changes propagated from 930810 snapshot] + * cp-decl.c (init_decl_processing): Make long long available for use + as SIZE_TYPE and PTRDIFF_TYPE. + (finish_decl): Allow file-scope static incomplete array. + (grokdeclarator): Don't pass on const and volatile fron function + value type to function type. + Warn here for volatile fn returning non-void type. + * cp-parse.y (attrib): Accept attributes `volatile' with alias + `noreturn', and `const'. + * cp-typeck.c (default_conversion): Don't lose const and volatile. + (build_binary_op_nodefault): Generate pedantic warning for comparison + of complete pointer type with incomplete pointer type. + (build_c_cast): Be careful that null pointer constant be INTEGER_CST. + +Tue Dec 7 10:46:48 1993 Jason Merrill + + * cp-init.c (expand_vec_init): When creating a temporary for copying + arrays, use the type of the source, not the target. + + * cp-cvt.c (convert): Pass an argument for errtype to + convert_to_reference. + + * cp-error.c (dump_expr, COMPONENT_REF & CALL_EXPR): Deal with + methods, -> and `this'. + +Mon Dec 6 17:12:33 1993 Jason Merrill + + * cp-error.c (parm_as_string): New function; returns `this' or arg + number. Corresponds to %P. + (dump_expr): Deal with method calls. + + * cp-cvt.c (convert_to_reference): Stop using warn_for_assignment. + * cp-typeck.c (convert_for_assignment): Likewise. + (warn_for_assignment): Lose. + +Mon Dec 6 11:33:35 1993 Brendan Kehoe + + * cp-call.c (ideal_candidate_ansi): Delete code that was never + doing anything useful. Instead, sort once, and DO NOT wipe + out any codes with EVIL_CODE, since that's what we use as a + marker for the end of the list of candidates. + + * cp-cvt.c (convert_to_aggr): Make sure to always set H_LEN. + +Mon Dec 6 12:49:17 1993 Jason Merrill + + * cp-init.c (get_aggr_from_typedef): New function, like + is_aggr_typedef but returns the _TYPE. + + * cp-call.c, cp-init.c, cp-method.c: Eradicate err_name. + +Sun Dec 5 18:12:48 1993 Brendan Kehoe + + * cp-lex.c (readescape): Pedwarn when a hex escape is out of range. + +Thu Nov 25 23:50:19 1993 Chip Salzenberg + + Delay language context change until beginning of next decl. + + * cp-lex.h (c_header_level): Removed. + (pending_lang_change): Declared. + * cp-lex.c (c_header_level): Renamed from in_c_header, made static. + (pending_lang_change): Defined. + (check_newline): Rework code that recognizes line number and + filename changes. Instead of pushing and popping lang context, + increment and decrement pending_lang_change. + (do_pending_lang_change): Push and pop lang context according + to value of pending_lang_change. + * cp-parse.y (extdefs): Use lang_extdef instead of extdef. + (extdef): Same as extdef, but call do_pending_lang_change() first. + +Mon Nov 15 15:39:15 1993 Chip Salzenberg + + * cp-typeck.c (build_binary_op_nodefault): Warn for ordered + compare of ptr with 0 only if pedantic in both cases. + +Thu Nov 25 13:31:37 1993 Chip Salzenberg + + Reinstate the below patch, which got lost in the Cygnus merge: + Tue Nov 23 13:59:24 1993 Hallvard B Furuseth (hbf@durin.uio.no) + * cp-parse.y (maybe_type_qual): Don't fail to set $$. + +Wed Nov 17 19:03:30 1993 Chip Salzenberg + + * cp-parse.y (attrib): Allow "ident(ident)" like the C front end. + +Fri Oct 22 20:43:37 1993 Paul Eggert + + * cp-lex.c (real_yylex): Diagnose floating point constants + that are too large. + +Wed Nov 17 19:10:37 1993 Chip Salzenberg + + * cp-type2.c (build_functional_cast): ARM page 16: When a class + and an object, function or enumerator are declared in the same + scope with the same name, the class name is hidden. + +Wed Nov 17 19:07:18 1993 Chip Salzenberg + + * cp-call.c (convert_harshness_ansi): Distinguish float, double, + and long double from each other when overloading. + (compute_conversion_costs_{ansi,old}, build_method_call, + build_overlay_call_real, convert_to_aggr): Always set and + always use H_LEN member of candidate structure. + +Mon Oct 11 23:10:53 1993 Chip Salzenberg + + * cp-decl.c (duplicate_decls): Note redeclarations of library + functions, and generate distinct warnings for them. + +Mon Oct 4 12:26:49 1993 Chip Salzenberg + + Support format warnings in G++. + + * cp-tree.h: Protect against multiple inclusion. + Declare all public functions in c-common.c (copy from c-tree.h). + (STDIO_PROTO): Define. + (warn_format): Declare. + (record_format_info): Remove declaration. + * cp-decl.c (init_decl_processing): Call init_function_format_info. + * cp-decl2.c (lang_decode_option): Make "-Wall" include warn_format. + * cp-typeck.c (build_function_call_real): Call check_function_format. + (record_format_info): Remove -- obsolete stub. + +Sat Jul 24 12:04:29 1993 Chip Salzenberg + + * cp-decl.c (duplicate_decls): Don't warn for non-extern var decl + following an extern one (for -Wredundant-decls). + * cp-parse.y (primary): In statement expression case, if compstmt + returns something other than a BLOCK, return it unchanged. + +Thu Dec 2 20:44:58 1993 Chip Salzenberg + + * cp-decl.c (warn_extern_redeclared_static): New function made + from code extracted from pushdecl. + (duplicate_decls, pushdecl): Call new function. + (lookup_name_current_level): Allow for IDENTIFIER_GLOBAL_VALUE + to be a TREE_LIST when function is declared in 'extern "C" {}'. + +Fri Dec 3 16:01:10 1993 Jason Merrill + + * cp-class.c (duplicate_tag_error): Use cp_error. + (finish_base_struct): Check for ambiguity with direct base, and don't + generate op= or copy ctor if it exists. + +Fri Dec 3 15:32:34 1993 Kung Hsu + + * cp-init.c (expand_member_init): When initializer name is null, + don't try to build it now because emit_base_init will handle it. + +Fri Dec 3 12:28:59 1993 Jason Merrill + + * cp-lex.c (init_lex): Initialize input_filename to "" for + code such as ExceptionHandler::operator=. + +Fri Dec 3 10:32:08 1993 Jason Merrill + + * cp-decl.c (grokdeclarator): Don't try to print out dname when + complaining about arrays of references if decl_context==TYPENAME, + since it will be null. + + * cp-decl2.c: Default to flag_ansi_overloading. + +Thu Dec 2 18:05:56 1993 Kung Hsu + + * cp-call.c (build_method_call): Use binfo from instance if it's + different from binfo (basetype_path) passed from above. + +Wed Nov 17 19:14:29 1993 Chip Salzenberg + + cp-error.c (dump_expr): Use unsigned chars to output a + TREE_REAL_CST in hex. + +Thu Dec 2 11:05:48 1993 Jason Merrill + + * cp-class.c (finish_struct): Fix typo in setting + cant_synth_asn_ref. + + * cp-tree.h (TYPE_NESTED_NAME): New macro, does + DECL_NESTED_TYPENAME (TYPE_NAME (NODE)). + + * cp-lex.c (default_copy_constructor_body): Change + DECL_NAME (TYPE_NAME (btype)) to TYPE_NESTED_NAME (btype). + (default_assign_ref_body): Likewise. + (default_copy_constructor_body): Call operator= explicitly for + base classes that have no constructor. + +Thu Dec 2 10:47:15 1993 Michael Tiemann + + * cp-call.c (build_method_call): If the instance variable is + converted to error_mark_node when we're trying to convert it to the + base type of a method we're looking up, return error_mark_node. + +Thu Dec 2 10:41:16 1993 Torbjorn Granlund + + * cp-typeck.c (build_binary_op_nodefault): In *_DIV_EXPR *_MOD_EXPR + cases, tests for unsigned operands by peeking inside a NOP_EXPR. + +Wed Dec 1 13:33:34 1993 Brendan Kehoe + + * cp-call.c (compute_conversion_costs_ansi): Use the size of struct + harshness_code, not the size of short, for clearing out the + ansi_harshness. + + * cp-call.c (print_candidates): New function. + (build_method_call): When we had some candidates, but didn't get a + usable match, don't report that we got an error with the first + candidate. Instead, say there were no matches, and list the + candidates with print_candidates. In the second pass, make sure we + clear out ever_seen, so we can accurately count the number of + functions that qualified. + +Wed Dec 1 09:53:59 1993 Torbjorn Granlund + + * cp-typeck.c (build_binary_op_nodefault): Shorten for *_MOD_EXPR + only if op1 is known to be != -1. + (build_binary_op_nodefault): Handle *_DIV_EXPR likewise. + +Tue Nov 30 14:07:26 1993 Brendan Kehoe + + * cp-method.c (hack_identifier): If the field itself is private, and + not from a private base class, say so. + +Mon Nov 29 03:00:56 1993 Jason Merrill + + * cp-decl.c (grokdeclarator): Always warn on initialization of + const member. + +Wed Nov 24 00:49:35 1993 Jason Merrill + + * cp-class.c (finish_struct): Set TYPE_GETS_CONST_* properly. + (finish_base_struct): Set cant_synth_asn_ref properly. + + * cp-lex.c (cons_up_default_function): Add section for operator=. + (default_assign_ref_body): New function, mostly cribbed from + default_copy_constructor_body. + + * cp-class.c (base_info): Add members cant_synth_copy_ctor, + cant_synth_asn_ref, no_const_asn_ref. + (finish_base_struct): Update no_const_asn_ref, note that you should + update cant_synth_*, propagate TYPE_GETS_ASSIGN_REF. + (finish_struct): Add decls for cant_synth_*, no_const_asn_ref, and + initialize them properly. Set no_const_asn_ref properly. Set + cant_synth_* in some of the situations where they should be set. + Propagate TYPE_GETS_ASSIGN_REF. Use cant_synth_copy_ctor. Add call + to cons_up_default_function for operator=. + +Tue Nov 23 20:24:58 1993 Mike Stump + + * cp-cvt.c (convert_force): Add code to perform casting of pointer + to member function types. + * cp-typeck.c (build_ptrmemfunc): Add FORCE parameter to indicate + when the conversion should be done, regardless. + * cp-tree.h (build_ptrmemfunc): Likewise. + * cp-type2.c (digest_init): Likewise. + * cp-typeck.c (convert_for_assignment): Likewise. + +Tue Nov 23 18:06:58 1993 Jason Merrill + + * cp-error.c (dump_expr): Do the right thing for variables of + reference type. + + * cp-decl.c (grok_op_properties): Set TYPE_HAS_ASSIGN_REF + and its kin properly. + (xref_tag): Propagate TYPE_GETS_ASSIGN_REF. + +Tue Nov 23 12:26:13 1993 Mike Stump + + * cp-method.c (build_opfncall): Don't count pointer to member + functions as aggregates here, as we don't want to look up methods in + them. The compiler would core dump if we did, as they don't have + normal names. + * cp-typeck.c (build_indirect_ref): Improve wording on error + message. + +Mon Nov 22 14:22:23 1993 Jason Merrill + + * cp-decl.c (grok_op_properties): Allow operator?: with pedwarn + (since it's supported in other compiler bits). + + * cp-method.c (report_type_mismatch): Use cp_error; ignore err_name + argument. + + * cp-error.c (dump_function_decl): Don't print return type for + constructors and destructors. + + * cp-cvt.c (cp_convert_to_pointer): Import code from + convert_to_pointer so we can return error_mark_node in the case of an + error, and to allow more meaningful error messages. + (build_type_conversion): Don't go through void* when trying + to convert to a pointer type. + + * cp-decl.c (grokfndecl): Move call to grok_op_properties back + after grokclassfn so that it's dealing with the right decl. + (grok_op_properties): Don't assert !methodp for op new and op delete. + + * cp-init.c (build_delete): Don't use TYPE_BUILT_IN (there are now + no uses of it in the compiler). + + * cp-call.c (build_scoped_method_call): Fix for destructors of simple + types. + (build_method_call): Likewise. + +Fri Nov 19 12:59:38 1993 Jason Merrill + + * cp-tree.c (count_functions): Abstraction function. + + * cp-call.c (build_overload_call_real): Deal with new overloading + properly, remove dead code. + + * gcc.c (default_compilers): Generate and use .ii files in the + intermediate stage of compiling C++ source. + +Fri Nov 19 11:26:09 1993 Jim Wilson + + * cp-expr.c (cplus_expand_expr): Make call_target a valid memory + address before using it, so it can be later safely compared. + +Fri Nov 12 15:30:27 1993 Jason Merrill + + * cp-pt.c (tsubst): Deal with new overloading. + + * cp-typeck.c (fntype_p): Is the arg function type? + (comp_target_parms): pedwarn on conversion from (anything) to (...). + (build_x_function_call): Deal with new overloading. + + * cp-tree.c (decl_list_length): Deal with new overloading. + (decl_value_member): Like value_member, but for DECL_CHAINs. + + * cp-decl.c (duplicate_decls): Deal with new overloading. + (start_decl): Likewise. + + * cp-class.c (instantiate_type): Deal with new overloading. + + * cp-call.c (convert_harshness_ansi): Deal with new overloading. + (convert_harshness_old): Deal with new overloading. + (build_overload_call_real): Likewise. + +Mon Nov 8 13:50:49 1993 Jason Merrill + + * cp-tree.c (get_unique_fn): New function; returns FUNCTION_DECL + if unambiguous, NULL_TREE otherwise. + (get_first_fn): Returns the first appropriate FUNCTION_DECL. + (is_overloaded_fn): Returns whether or not the passed tree is + a function or list of functions. + + * cp-init.c (init_init_processing): Use `get_first_fn' to find + the FUNCTION_DEFN for new and delete. + + * cp-decl.c (push_overloaded_decl): Use new overloading strategy, cut + code size in half (I spit on special cases). + +Tue Sep 7 20:03:33 1993 Jason Merrill + + * cp-decl.c: Allow references and template type parameters as well diff --git a/contrib/gcc/cp/ChangeLog-1994 b/contrib/gcc/cp/ChangeLog-1994 new file mode 100644 index 00000000000..24d635df7d3 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1994 @@ -0,0 +1,5405 @@ +Fri Dec 30 17:57:30 1994 Mike Stump + + * gc.c (build_bltn_desc): Handle bool as a built-in type. + +Fri Dec 30 14:20:21 1994 Mike Stump + + * tree.c (layout_vbasetypes): Ensure that we don't loose alignment + on the complete type because of small virtual bases. + +Fri Dec 30 12:22:29 1994 Mike Stump + + * decl.c (n_incomplete): Bump n_incomplete up to int to match C + front end. + (pushdecl): Also count decls pushed that are of a type being defined + as incomplete things. + * class.c (finish_struct): Move hack_incomplete_structures up to + just after we set it as not being defined, so that the decls we + build for RTTI don't count as incomplete. + +Thu Dec 29 18:20:57 1994 Mike Stump + + * pt.c (tsubst): Fix problem with defining constructors in templated + classes with virtual bases. + +Wed Dec 28 08:31:00 1994 Mike Stump + + * parse.y (TYPEID): Strip top-level cv-qualifiers on typeid + expressions. + * gc.c (build_typeid): Likewise. + +Thu Dec 22 17:26:33 1994 Mike Stump + + * cvt.c (build_up_reference): Fix breakage introduced on Nov 29, + don't assert on complex AGGR inits. + +Thu Dec 22 14:32:31 1994 Mike Stump + + * method.c (build_overload_value): Handle pointer to members as + template arguments. + +Thu Dec 22 13:09:07 1994 Mike Stump + + * typeck.c (unary_complex_lvalue): Don't call sorry if we know how + to do take the address of a data member for a pointer to data + member. + +Thu Dec 22 10:04:19 1994 Mike Stump + + * decl.c (grokdeclarator): Use the typedef name for linkage if the + type doesn't otherwise have a name. + + * decl2.c (grokfield): Likewise. + + * class.c (finish_struct): Since we reuse the TYPE_DECL for the + DECL_NAME of enums, structs and classes, we have to avoid trying to + put it in the TYPE_FIELDS again. + +Wed Dec 21 11:07:05 1994 Mike Stump + + * decl2.c (check_classfn): Ignore this parameter on static functions + when checking to see if we match. + +Tue Dec 20 17:47:02 1994 Mike Stump + + * typeck.c (unary_complex_lvalue): Handle address of non-left most + pointers to members by calling get_delta_difference. + +Mon Dec 19 22:40:53 1994 Mike Stump + + * decl2.c (check_classfn): Don't use decls_match yet, as it modifies + static functions to early. + +Thu Dec 19 22:37:48 1994 Mike Stump + + * method.c (make_thunk): Handle encoding of positive thunk offsets. + +Sat Dec 17 13:29:50 1994 Doug Evans + + * Make-lang.in (.PHONY): Tell GNU make C++ and c++ are phony targets. + +Thu Dec 15 16:32:12 1994 Mike Stump + + * decl2.c (check_classfn): Use decls_match to check if this has + already been declared, as the DECL_ASSEMBLER_NAME may have been + changed via asm("new_name"). + * decl.c (decls_match): Make public. + +Thu Dec 15 15:17:55 1994 Mike Stump + + * *.[chy] (expand_aggr_init): Add fourth argument to handle + distinction between = init and (init) style of initializations. + * *.[chy] (finish_decl): Add fifth argument to handle + distinction between = init and (init) style of initializations. + +Tue Dec 13 19:16:05 1994 Mike Stump + + Fix some random `explicit' bugs. + + * cvt.c (convert_to_reference): Add third parameter to + convert_force. + (convert_force): Likewise. + * call.c (build_method_call): Likewise. + * decl2.c (setup_vtbl_ptr): Likewise. + * init.c (expand_virtual_init): Likewise. + (build_member_call): Likewise. + (build_delete): Likewise. + (build_vbase_delete): Likewise. + * typeck.c (build_component_addr): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + * cp-tree.h (CONV_NONCONVERTING): Likewise. Add so that we can + distinguish the context in which the conversion appears. Add thrid + argument to build_c_cast. + * cvt.c (cp_convert): Pass whether or not we want to consider + non-converting constructors down to build_method_call. + * decl2.c (reparse_absdcl_as_casts): Add third argument to + build_c_cast. + * gc.c (build_m_desc): Likewise. + * init.c (build_new): Likewise. + * parse.y (expr_no_commas): Likewise. + (primary): Likewise. + * typeck.c (build_x_function_call): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_c_cast): Likewise. + (build_ptrmemfunc): Likewise. + * typeck2.c (build_functional_cast): Likewise. + * init.c (expand_aggr_init): Added LOOKUP_ONLYCONVERTING to + expand_aggr_init_1 as inits are converted to the destination type. + +Tue Dec 13 16:18:57 1994 Jason Merrill + + * Make-lang.in (cc1plus): Depends on c-pragma.o. + + * Makefile.in (OBJ{DEP,}S): Add ../c-pragma.o. + + * lex.c (check_newline): If the #pragma is not recognized by g++, + try machine-specific ones too. + (handle_sysv_pragma): Copied from c-lex.c. + +Mon Dec 12 23:53:06 1994 Mike Stump + + * except.c (expand_throw): Fix Dec 6th change, build_new likes a + reference better. + +Mon Dec 12 18:01:00 1994 Jason Merrill + + * typeck.c (build_binary_op): Lose checks on TYPE_PTRMEMFUNC_P with + IS_AGGR_TYPE, since now they will not both be set on the same type. + + * pt.c (do_pending_expansions): Don't clear TREE_PUBLIC on + instantiations controlled by -fexternal-templates. + + * decl.c (duplicate_decls): Don't complain about different values of + __attribute__ ((const)) and ((noreturn)). + +Fri Dec 9 18:17:37 1994 Doug Evans + + * Makefile.in (BISONFLAGS): Delete --yacc. + (PARSE_H): Depend on $(PARSE_C), for parallel makes. + (PARSE_C): Undo last patch. + +Fri Dec 2 10:44:36 1994 Mike Stump + + * Makefile.in (BISONFLAGS): Add --yacc so that output winds up in + y.tab.c. + +Thu Dec 8 17:39:46 1994 Jason Merrill + + * decl.c (finish_decl): Don't call obscure_complex_init for decls + of indeterminate size. + +Wed Dec 7 16:49:22 1994 Jason Merrill + + * decl.c (obscure_complex_init): Function to tweak the decl to + prevent expand_decl from tring to initialize it. + (finish_decl): Use it rather than writing the same code in three + different places. + + * parse.y (bad_parm): Stop trying to support parms without types. + +Wed Dec 7 12:06:56 1994 Mike Stump + + * decl2.c (grokfield): Make asm specs on static member functions + work. + +Tue Dec 6 15:43:20 1994 Mike Stump + + * except.c (expand_throw): Make a copy of the thrown object. + +Tue Dec 6 14:16:34 1994 Jason Merrill + + * parse.y: : Has lower precedence than =. + +Tue Dec 6 12:46:17 1994 Mike Stump + + * decl.c (pushdecl): Use DECL_NAME of VAR_DECLs to avoid namespace + manglings. + (grokvardecl): Add namespace into variable name. + +Tue Dec 6 11:26:55 1994 Mike Stump + + * decl2.c (current_namespace_id): New routine to transform a simple + name into a name in a namespace. + * decl.c (grokdeclarator): Use it. + * decl2.c (get_namespace_id): Find the name of the current + namespace. + (push_namespace, pop_namespace): Complete out missing + functionality. + +Mon Dec 5 17:11:51 1994 Jason Merrill + + * class.c (finish_struct): Don't use LONG_LONG_TYPE_SIZE, as it may + not be defined. Fix warning message for enums and restore warning + for non-enums. + + * decl2.c (push_namespace): Dummy function. + (pop_namespace): Likewise. + (do_namespace_alias): Likewise. + (do_using_decl): Likewise. + (do_using_directive): Likewise. + + * parse.y: New token NSNAME for namespace names. + (extdef): Add namespace, using definitions. + (using_decl): New rule for using declarations. + (any_id): New rule for identifiers with any degree of scoping. + (identifier): Add NSNAME. + (notype_identifier): Likewise. + (component_decl): Add using_decl. + (nested_name_specifier): Add NSNAME SCOPE. + + * typeck.c (convert_for_assignment): Handle conversions between + enums and bool. + + * decl.c (duplicate_decls): Only propagate DECL_MAIN_VARIANT on + FUNCTION_DECLs. + +Mon Dec 5 13:03:16 1994 Mike Stump + + * class.c (finish_struct): Give an error if one tries to declare a + bit-field's size greater than a long long, as the backend will dump. + It is not an error to declare an enum bit-field greater than its + precision. Warn if an enum bit-field is too small to hold all + its values. + +Mon Dec 5 11:41:50 1994 Mike Stump + + * typeck.c (convert_for_assignment): Use cp_convert instead of + convert so that we don't get static casts. + +Sun Dec 4 11:59:01 1994 Mike Stump + + * cvt.c (cp_convert): Don't complain about int->enum conversion if + we are doing static casts. + +Fri Dec 2 18:32:41 1994 Mike Stump + + * error.c (dump_expr): Do something more intelligent with SAVE_EXPRs + when dumping expressions in error messages. + +Fri Dec 2 17:04:27 1994 Mike Stump + + * gc.c (build_dynamic_cast): Change interface to libg++, ensure that + the return type is the right type, and make references work. + +Fri Dec 2 16:36:43 1994 Jason Merrill + + * decl.c (poplevel): Don't be confused by function-scope + declarations of non-nested functions. + (duplicate_decls): Propagate DECL_MAIN_VARIANT. + (pushdecl): Use duplicate_decls to copy info from old decl into new + function-scope one rather than doing it here. + + * decl2.c (mark_inline_for_output): Deal with the DECL_MAIN_VARIANT + of this decl, in case this is a function-scope declaration. + + * decl.c (finish_enum): Make sure that the type has the right + precision when we call fixup_*_type. + +Tue Nov 29 19:12:07 1994 Jason Merrill + + * cvt.c (build_up_reference): Strip superfluous NOP_EXPRs; we do + want to build up references to rvalues if possible. + (cp_convert): Stick on a NOP_EXPR when converting to the same type. + +Tue Nov 29 11:28:59 1994 Mike Stump + + * parse.y (maybe_raises): Handle throw (). + * parse.y (ansi_raise_identifier): Grok type-ids in exception + specifications. + * tree.c (build_exception_variant): Use list compare to check if + two exception specifications match. + * decl.c (duplicate_decls, bad_specifiers): Enhance wording on error + messages. + * call.c (build_method_call): Remove TREE_RAISES. + * cvt.c (convert_to_aggr): Likewise. + * typeck.c (build_function_call_real, convert_arguments): Likewise. + * init.c (expand_aggr_init_1): Likewise. + +Tue Nov 29 09:50:39 1994 Mike Stump + + * except.c: Add support for m68k and mips exception handling + support. + +Tue Nov 29 08:48:33 1994 Mike Stump + + * except.c (expand_end_all_catch): Throw into outer context, if we + fall off end of catch handlers. + +Mon Nov 28 16:44:41 1994 Mike Stump + + * Makefile.in: Make is easier to decide where parse.[ch] will be + built. + +Thu Nov 17 20:11:24 1994 Doug Evans + + * cp/Make-lang.in (CXX_INSTALL_NAME): Use program_transform_name. + (GXX_INSTALL_NAME): Likewise. + (CXX_CROSS_NAME): Use program_transform_cross_name. + (GXX_CROSS_NAME): Likewise. + (c++.install-man): Use program_transform_name on g++.1. + (c++.uninstall): Likewise. + +Mon Nov 28 13:53:03 1994 Mike Stump + + * parse.y (THROW): Fix precedence of throw expressions. + +Mon Nov 28 13:15:16 1994 Mike Stump + + * typeck.c (build_unary_op): Allow promotions from bool to int on + unary ~. + +Sun Nov 27 00:16:21 1994 Jason Merrill + + * method.c (build_overload_name): Use DECL_ASSEMBLER_NAME for + classes when appropriate. + (build_overload_nested_name): When dealing with a function context, + use ASM_FORMAT_PRIVATE_NAME to tweak the name of the function to + avoid conflicts between local classes of the same name. + +Wed Nov 23 17:59:42 1994 Mike Stump + + * gxx.gperf, parse.y, lex.h, hash.h, lex.c (init_lex), delc.c + (duplicate_decls, grokdeclarator), cp-tree.h: Add support for + `explicit'. + * cvt.c (convert_to_reference, cp_convert, build_type_conversion_1, + build_type_conversion): Use LOOKUP_ONLYCONVERTING in + build_method_calls so that non-converting constructors are not used. + * call.c (build_method_call): If we shouldn't use a non-converting + constructor, then don't. + +Wed Nov 23 14:46:56 1994 Jason Merrill + + * call.c (build_method_call): Don't try to synthesize methods yet. + +Tue Nov 22 12:45:21 1994 Jason Merrill + + * pt.c (push_template_decls): Create CONST_DECLs for template + constant parameters, not VAR_DECLs. + +Sat Nov 19 15:28:31 1994 Jim Wilson + + * typeck.c (build_binary_op_nodefault): Can shorten shift only if + shift count is less than size in bits of arg0. + +Thu Nov 17 15:30:50 1994 Mike Stump + + * gxx.gperf, hash.h, lex.c (init_lex, real_yylex), parse.y: Add new + ANSI keywords and, and_eq, bitand, bitor, explicit, namespace, not, + not_eq, or, or_eq, typename, using, xor, xor_eq to g++. Still need + to add support for explicit, namespace, typename, and using, support + for the rest is already in. + +Fri Nov 4 19:04:18 1994 Mike Stump + + * gc.c (get_bad_cast_node): New routine to support compile time + throws of bad_cast. + * gc.c (build_dynamic_cast): Support throwing of bad_cast at compile + time. + +Fri Nov 4 11:12:00 1994 Mike Stump + + * except.c: Add hppa support. + +Fri Nov 4 10:50:50 1994 Mike Stump + + * except.c: Add rs6000 support. + +Thu Nov 3 14:24:23 1994 Mike Stump + + * except.c (do_unwind): Add i[34]86 support. + +Thu Nov 3 00:10:46 1994 Jason Merrill + + * pt.c (do_pending_expansions): Unset TREE_PUBLIC on implicit + instantiations. + +Wed Nov 2 15:08:24 1994 Kung Hsu + + * decl.c (finish_function): Emit types used in method parameters + into symbol table. + +Wed Nov 2 15:05:47 1994 Jason Merrill + + * pt.c (process_template_parm): Allow pointer to member function + template parameter types. + (uses_template_parms): Handle pointer to member function + CONSTRUCTORs. + + * g++.c (main): Cast first argument of bzero to (char *). + Pass -lstdc++ instead of -lg++ unless we are invoked as 'g++'. + +Mon Oct 31 14:50:48 1994 Kung Hsu + + * gc.c (build_dynamic_cast): Rewrite to make it work. + * class.c (finish_vtbls): Build more vtables if flag_rtti is on. + * class.c (modify_all_direct_vtables): Likewise. + * init.c (expand_direct_vtbls_init): Expand more vtables if + flag_rtti is on. + * decl.c (init_type_desc): Add default return. + +Tue Oct 25 17:13:09 1994 Kung Hsu + + * tree.c (debug_binfo): Get rid of the initial size entry of + vtable. + * cp-tree.h: Change flag_dossier to flag rtti, define type + descriptor type nodes. + * decl.c (init_type_desc): New function to initialize type + descriptor type nodes. + * decl.c (record_builtin_type): Change flag_dossier to flag_rtti. + * lex.c (init_lex): Likewise. + * decl.c: Change variable flag_dossier to flag_rtti. + * decl.c (duplicate_decls): Get rid initial size entry of vtable. + * decl.c (hack_incomplete_structures): Take out assert 164. + * search.c (get_abstract_virtuals_1): Likewise. + * search.c (dfs_init_vbase_pointers): Change CLASSTYPE_DOSSIER to + CLASSTYPE_RTTI. + * parse.y: Likewise. + * class.c (prepare_fresh_vtable): For virtual bases, get right + offset. + * class.c (add_virtual_function): Change flag_dossier to + flag_rtti. + * class.c (modify_one_vtable): Modify the right rtti entry. + * class.c (override_one_vtable): Get rid of size entry. + * class.c (finish_struct): Change flag_dossier to flag_rtti, and + build extra vtables, build type descriptors for polymorphic + classes. + * gc.c (build_headof): Make headof() works correctly with new + rtti. + * gc.c (build_typeid): Make this function work with new rtti. + * gc.c (get_typeid): Make this function work with new rtti. + * gc.c (build_bltn_desc): New function for new rtti. + * gc.c (build_user_desc): Likewise. + * gc.c (build_class_desc): Ditto. + * gc.c (build_ptr_desc): Ditto. + * gc.c (build_attr_desc): Ditto. + * gc.c (build_func_desc): Ditto. + * gc.c (build_ptmf_desc): Ditto. + * gc.c (build_ptmd_desc): Ditto. + * gc.c (build_t_desc): Ditto. + * gc.c: Comment out old build_t_desc, build_i_desc, build_m_desc. + +Tue Oct 25 13:37:41 1994 Jason Merrill + + * call.c (convert_harshness): Check for TREE_UNSIGNED differences + after checking for integral conversions. + +Wed Nov 30 19:13:50 1994 Mike Stump + + * Version 2.6.3 released. + +Thu Nov 17 10:56:50 1994 Jason Merrill + + * typeck2.c (build_m_component_ref): Check the basetype of the + member pointer against the main variant of the object type. + +Mon Nov 14 14:21:52 1994 Jason Merrill + + * cvt.c (convert_to_reference): Make sure that the original expr + gets its type back when converting a reference. + + * method.c (build_overload_name): Clear numeric_outputed_need_bar here. + (build_decl_overload): Instead of here. + +Tue Nov 8 17:11:24 1994 Jason Merrill + + * cvt.c (cp_convert): Don't build a TARGET_EXPR if we're not in a + function. + + * typeck.c (convert_for_initialization): Handle initialization from + a TARGET_EXPR. + +Sun Nov 6 01:34:24 1994 Jason Merrill + + * pt.c (lookup_nested_type_by_name): Fix list-walking logic. + (tsubst): When replacing a TEMPLATE_TYPE_PARM, propagate + TYPE_READONLY and TYPE_VOLATILE from the argument. + (unify): When unifying with a TEMPLATE_TYPE_PARM, remove cv-quals + present in parm from arg. + (type_unification): Strip REFERENCE_TYPE from the argument type. + (unify): Don't strip REFERENCE_TYPE from the argument type. + +Sat Nov 5 22:42:15 1994 Greg McGary + + * pt.c (do_type_instantiation): Check to see if there's a + IDENTIFIER_TEMPLATE on a class before calling + instantiate_member_templates(). + +Sat Nov 12 06:35:42 1994 Mike Stump + + * Version 2.6.2 released. + +Thu Nov 3 18:48:19 1994 Paul Eggert + + * Makefile.in (spew.o, lex.o, pt.o): + Depend on $(srcdir)/parse.h, not parse.h. + +Tue Nov 1 19:19:41 1994 Mike Stump + + * Version 2.6.1 released. + +Sun Oct 23 13:19:55 1994 Jason Merrill + + * decl2.c: Declare flag_access_control. + (struct lang_f_options): Add access-control. + * expr.c (cplus_expand_expr, NEW_EXPR): Unset flag_access_control + for the call to expand_aggr_init to copy the object out of the + pcc_struct_return slot. + * search.c (compute_access): if (!flag_access_control) return + access_public. + +Fri Oct 21 00:32:54 1994 Jason Merrill + + * lex.c (cons_up_default_function): Don't try to defer method + synthesis now. + + * decl.c (init_decl_processing): Use __pure_virtual for abort_fndecl + instead of abort, since the OSF/1 dynamic linker doesn't like to see + relocation entries for abort. + + * tree.c (array_type_nelts_total): Use sizetype, not + integer_type_node. + (array_type_nelts_top): Likewise. + +Thu Oct 20 15:48:27 1994 Mike Stump + + * decl.c (grokdeclarator): Added handling for catch parameters + (CATCHPARM). + * except.c (expand_start_catch_block): Use the new CATCHPARM context + instead of NORMAL. + * except.c (expand_throw): Don't let convert_to_reference complain + about what we are doing. + +Thu Oct 20 12:55:24 1994 Jim Wilson + + * method.c (emit_thunk): Call instantiate_virtual_regs. + +Wed Oct 19 14:15:33 1994 Mike Stump + + * except.c (expand_exception_blocks): Make sure throw code doesn't + get put in function that won't be output. + +Mon Oct 17 18:03:15 1994 Jason Merrill + + * decl.c (init_decl_processing): Make alloca a builtin. + +Thu Oct 27 21:10:25 1994 Craig Burley + + * g++.c (main): Only decrement "added" and set "library" to + NULL when "library" != NULL (just like 940829 fix). + +Mon Oct 17 15:56:11 1994 Mike Stump + + * except.c (expand_start_catch_block): Make sure the false label + gets onto the permanent obstack, as it is used for the exception + table. + +Fri Oct 14 18:54:48 1994 Mike Stump + + * class.c (modify_one_vtable): Since the DECL_CONTEXT of fndecl can + be set just below, use current_fndecl instead. + +Fri Oct 14 15:12:22 1994 Jason Merrill + + * init.c (expand_aggr_vbase_init_1): Don't call expand_aggr_init_1 + with LOOKUP_SPECULATIVELY. + (expand_default_init): Abort if build_method_call returns NULL_TREE. + + * typeck.c (build_modify_expr): Don't just build a MODIFY_EXPR if + the rhs is a TARGET_EXPR. + + * parse.y (left_curly): Anonymous types are not affected by #pragma + interface/implementation. + + * method.c (synthesize_method): Don't call setup_vtbl_ptr for the + default constructor if it isn't needed. + + * lex.c (cons_up_default_function): Do synthesize methods for + anonymous types if necessary. + +Thu Oct 13 17:44:55 1994 Jason Merrill + + * method.c (build_decl_overload): Set numeric_outputed_need_bar to 0. + +Wed Oct 12 13:27:57 1994 Jason Merrill + + * typeck.c (build_modify_expr): Understand how to copy an aggregate. + + * init.c (expand_default_init): Likewise. Also remove some of the + crufty code that assumes methods will not be synthesized properly. + + * lex.c (cons_up_default_function): If the containing type has no + name, these functions should never need to be called, so just + declare them. + + * lex.c (real_yylex): Use HOST_BITS_PER_WIDE_INT to determine the + bitmask for lexing character constants. + + * call.c (build_method_call): Disable code that tries to do tricky + stuff with a default parameter that is a constructor call, but + actually does other tricky stuff that breaks things. + +Wed Oct 12 16:14:01 1994 Benoit Belley + + * decl.c (finish_enum): Disable code which forces enums to be signed, + since this conflicts with their use as bitfields. type_promotes_to + handles promotion of enums of underlying unsigned types to signed + integer types. + +Wed Oct 12 13:24:03 1994 Jason Merrill + + * cvt.c (type_promotes_to): Also promote enums to long if + appropriate. + + * typeck.c (default_conversion): Don't expect type_promotes_to to + return a main variant. + +Wed Oct 12 12:19:45 1994 Jason Merrill + + * call.c (build_scoped_method_call): Don't lose side effects in the + object expression when calling a non-existent destructor. + +Fri Sep 2 19:05:21 1994 Rohan Lenard + + * call.c (build_scoped_method_call): Remove erroneous error message + when destructor call is written as a scoped call. + +Tue Oct 11 23:48:31 1994 Jason Merrill + + * various: Cast pointer arguments to bzero and bcopy to char *. + +Tue Oct 11 19:34:32 1994 Mike Stump + + * class.c (get_derived_offset): Added a type parameter to limit how + far up the CLASSTYPE_VFIELD_PARENT chain we search. + * class.c (modify_one_vtable, fixup_vtable_deltas): When forming the + offset to put into the vtable for the this parameter, make sure we + don't offset from a parent of the DECL_CONTEXT of the function. + +Tue Oct 11 16:10:52 1994 Jason Merrill + + * pt.c (do_function_instantiation): Set DECL_EXTERNAL and + TREE_STATIC when setting DECL_INTERFACE_KNOWN. + (do_type_instantiation): Likewise. + + * lex.c (cons_up_default_function): Set DECL_INTERFACE_KNOWN, + DECL_EXTERNAL and TREE_STATIC as appropriate. + + * decl2.c (finish_file): Also synthesize methods that don't have + DECL_EXTERNAL set. Set interface_unknown before doing so. + + * decl.c (start_function): If DECL_INTERFACE_KNOWN is set on the + function decl, don't muck with TREE_PUBLIC and DECL_EXTERNAL. + +Mon Oct 10 00:56:53 1994 Jason Merrill + + * lex.c (cons_up_default_function): Mark methods in a template class + as template instances. Store the values of interface_unknown and + interface_only for do_pending_inlines. + (do_pending_inlines): Use them. + + * decl2.c (finish_file): If we haven't seen a definition of a + function declared static, make the decl non-PUBLIC so compile_file + can give an error. + +Sun Oct 9 02:42:29 1994 Jason Merrill + + * method.c (do_build_copy_constructor): Handle anonymous unions. + (do_build_assign_ref): Likewise. + (largest_union_member): Move from lex.c. + +Sat Oct 8 14:59:43 1994 Jason Merrill + + Re-implement g++'s vague linkage independent of TREE_PUBLIC. + * pt.c (instantiate_member_templates): Lose redundant + -fexternal-templates handling. + (tsubst): Set TREE_PUBLIC and DECL_EXTERNAL on new decls. Don't set + TREE_STATIC or DECL_INTERFACE_KNOWN. + (do_pending_expansions): Predicate on DECL_INTERFACE_KNOWN instead + of DECL_EXTERNAL for explicit instantiations. + (do_function_instantiation): Do the new thing. + (do_type_instantiation): Likewise. + (instantiate_template): Deal with member templates defined in a .cc + file with -fexternal-templates. + * except.c (expand_exception_blocks): Use DECL_LINKAGE_KNOWN to + decide whether to stick builtin_throw here. + * decl2.c (import_export_inline): Predicate on DECL_INTERFACE_KNOWN + rather than TREE_PUBLIC. Generally fix rules. + (finish_file): Use DECL_INITIAL to determine whether or not a method + has been synthesized, rather than TREE_ASM_WRITTEN. + * decl.c (warn_extern_redeclared_static): Use DECL_PUBLIC instead of + TREE_PUBLIC. + (pushdecl): Likewise. + (duplicate_decls): Likewise. Deal with DECL_DECLARED_STATIC and + DECL_INTERFACE_KNOWN. + (redeclaration_error_message): Fix checking for conflicting linkage. + (define_function): Set DECL_INTERFACE_KNOWN. + (grokfndecl): Function decls are PUBLIC until we are sure about + their linkage. Set DECL_DECLARED_STATIC as needed. + (start_function): Deal with linkage. Move pushdecl after linkage + magic. + (finish_function): Don't set TREE_ASM_WRITTEN on discarded inlines. + * cp-tree.h (lang_decl_flags): Add interface_known and + declared_static. + (DECL_INTERFACE_KNOWN): New macro. + (DECL_DECLARED_STATIC): New macro. + (DECL_PUBLIC): New macro. + + Clean up bogus use of TREE_PUBLIC. + * class.c (alter_access): Fix mistaken use of TREE_PUBLIC (it + doesn't correspond to TREE_PROTECTED and TREE_PRIVATE). + * init.c (do_friend): Don't arbitrarily set TREE_PUBLIC. + +Wed Oct 5 13:44:41 1994 Jason Merrill + + * call.c (build_overload_call_real): Don't immediately do + array->pointer conversion. + + * pt.c (type_unification): If not passing to a reference, strip + cv-quals. Also handle array->pointer conversion. + +Tue Oct 4 17:45:37 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't warn about applying const to a + const typedef or template type parameter. + + * decl2.c (finish_file): Also synthesize methods after walking the + vtables. Ugly ugly ugly. + +Mon Oct 3 15:02:41 1994 Jason Merrill + + * various: Remove lingering remnants of old exception handling code. + + * decl2.c (finish_file): Synthesize methods before walking the + vtables, so that the vtables get emitted as needed. + + * decl.c (shadow_tag): Remove obsolete code for pushing tags and + dealing with exceptions. + +Mon Oct 3 13:05:27 1994 Ian Lance Taylor + + * Make-lang.in (g++-cross): Depend upon version.o and $(LIBDEPS). + +Mon Oct 3 02:59:28 1994 Jason Merrill + + * decl2.c (finish_file): Fix inline handling. + +Sun Oct 2 00:21:56 1994 Jason Merrill + + * decl.c (grokdeclarator): Handle redundant scope even better. + ({push,pop}_cp_function_context): Take toplev parameter. + + * method.c (synthesize_method): Pass toplev parameter to + {push,pop}_cp_function_context depending on decl_function_context + (fndecl). + + * typeck.c (build_x_unary_op): Unary & on OFFSET_REFs is always the + built-in version. + + * method.c (synthesize_method): Don't be confused by __in_chrg + parameter. + + * class.c (popclass): Set C_C_D like start_function does. + + * decl.c (grokdeclarator): Handle redundant scope better. + + * parse.y (expr_or_declarator): Add '(' expr_or_declarator ')' rule. + (direct_notype_declarator): Likewise. + (complex_direct_notype_declarator): Remove it here. + +Sat Oct 1 21:42:18 1994 Jason Merrill + + * init.c (resolve_offset_ref): Fix types used in resolving .* + expressions. + +Sat Oct 1 15:18:49 1994 Jason Merrill + + Beginnings of work to synthesize methods only when needed. + * call.c (build_method_call): Synthesize methods as necessary + (currently never necessary). + * class.c (popclass): Don't try to set C_C_D here, as it'll end up + on the wrong obstack. + * decl.c (push_cp_function_context): Mostly copied from + push_c_function_context. + (pop_cp_function_context): Similarly. + (finish_function): Reverse order of poplevel and pop_nested_class so + that current_class_decl is restored properly. + (start_function): Likewise. + (finish_function): Add parameter 'nested'. Don't call + permanent_allocation if (nested). + * various: Pass extra parameter to finish_function. + * decl2.c (finish_file): Reorganize end-of-file inline handling, + synthesizing methods as necessary. + * lex.c (cons_up_default_function): Call mark_inline_for_output. + Only synthesize methods immediately if #pragma implementation + (currently disabled). + (do_pending_inlines): Call synthesize_method. + * method.c (synthesize_method): New function; all method synthesis + goes through here. Calls do_build_assign_ref and + do_build_copy_constructor. + (build_default_constructor): Remove. + (build_dtor): Likewise. + (build_assign_ref): Rename to do_build_assign_ref and remove stuff + done by synthesize_method. + (build_copy_constructor): Similarly. + +Thu Sep 29 16:58:52 1994 Mike Stump + + * typeck.c (c_expand_return): Use magic so the backend can fixup the + assignment into the return register, so cleanups won't clobber it. + +Thu Sep 29 13:08:50 1994 Jason Merrill + + * method.c (hack_identifier): Don't call assemble_external for + template decls. + + * decl.c (finish_decl): Also end temporary allocation if the decl in + question has a type of error_mark_node. + +Wed Sep 28 21:45:00 1994 Mike Stump + + * typeck.c (build_modify_expr): When optimizing ?: on lhs, make sure + that if the ?: was a reference type, that the subparts will be also. + +Wed Sep 28 16:14:04 1994 Brendan Kehoe + + * except.c (register_exception_table): Use Pmode, not PTRmode. + +Fri Sep 23 13:54:27 1994 Jason Merrill + + * lex.c (do_pending_inlines): Do method synthesis after the + pending_inlines have been reversed. + +Thu Sep 22 12:53:03 1994 Per Bothner + + * decl2.c (finish_file): Fix Brendan's fix: Only call + register_exception_table if there is a non-empty exception table. + +Thu Sep 22 12:03:46 1994 Brendan Kehoe + + * decl2.c (finish_file): Only do register_exception_table if + -fhandle-exceptions is being used. + +Wed Sep 21 19:01:51 1994 Per Bothner + + * except.c (output_exception_table_entry): Simplify + by using assemble_integer. + (build_exception_table): Change to return a count. + Cleanup to use standard macros, instead of hard-wired + sparc asm format. Don't make __EXCEPTION_TABLE__ global. + (register_exception_table): New function. Generate call to builtin. + * decl2.c (finish_file): Call register_exception_table. + * cp-tree.h (build_exception_table): Fix prototype. + +Wed Sep 21 13:20:42 1994 Brendan Kehoe + + * tree.c (break_out_calls): Don't try to duplicate the DECL_INITIAL. + + * decl2.c (delete_sanity): Give an error at trying to delete a + function. + +Wed Sep 21 11:47:10 1994 Jason Merrill + + * lex.c (cons_up_default_function): Mark synthesized destructors + inline. + + * decl.c (duplicate_decls): Ignore redeclarations of wchar_t as + something other than __wchar_t, complaining if -pedantic and not in + a system header. + +Tue Sep 20 09:43:28 1994 Jason Merrill + + * decl.c (xref_tag): Set up BINFO_INHERITANCE_CHAIN on base binfos + here. + + * typeck.c (build_modify_expr): Require complete type after checking + for error_mark_node. + + * call.c (build_method_call): Print parmtypes when complaining of + ambiguous call. + + * typeck.c (build_modify_expr): Handle assignment to array from + non-array. + + * decl.c (lookup_name_real): Deal with got_scope == error_mark_node. + + * call.c (build_method_call): Don't bother with the exact match. + +Mon Sep 19 00:51:39 1994 Jason Merrill + + * init.c (expand_aggr_init): If we munge the type of the variable, + also munge the type of the initializer. + + * decl.c (grokdeclarator): Use <= when comparing to RID_LAST_MODIFIER. + (init_decl_processing): Push artificial declaration of wchar_t so + people don't have to declare it before they can use it. + + * error.c (cp_line_of): Return lineno in lieu of 0. + + * typeck.c (convert_for_assignment): Handle conversion of pmfs to + int and bool. + (build_component_ref): Fold the COMPONENT_REF in case it can be + reduced. + + * typeck2.c (store_init_value): Don't pedwarn about non-constant + bracketed initializers for automatic variables. + +Sun Sep 18 10:12:12 1994 Jason Merrill + + * error.c (dump_decl): Don't say `typedef enum foo foo'. + + * decl.c (start_decl): Don't set TREE_PUBLIC on template decls just + because they're affected by #pragma i/i. We'll deal with that when + they get instantiated. + + * typeck.c (build_unary_op): Clean up cruft in ADDR_EXPR case. + + * class.c (instantiate_type): Set TREE_CONSTANT on instantiated + ADDR_EXPRs if appropriate. + + * decl.c (build_ptrmemfunc_type): Unset IS_AGGR_TYPE on pmf types. + + * typeck.c (build_ptrmemfunc): Handle &overloaded_method as an + initializer properly. + * typeck2.c (digest_init): Likewise. + + * tree.c (cp_build_type_variant): Like c_build_type_variant, except + it uses build_cplus_array_type. + * *.c: Use cp_build_type_variant instead of c_build_type_variant. + + * pt.c (do_type_instantiation): Don't try to instantiate nested + enums. + +Tue Sep 13 10:56:58 1994 Jason Merrill + + * cvt.c (build_up_reference): Handle preincrement and predecrement + properly. + +Tue Sep 13 09:51:59 1994 Brendan Kehoe + + * decl.c (finish_decl): Only lay out the rtl for DECL if it is, in + fact, static. + +Mon Sep 12 14:40:30 1994 Brendan Kehoe + + * decl.c (finish_decl): Lay out the rtl for DECL before doing + grok_reference_init, in case it's static. + +Mon Sep 12 12:45:38 1994 Jason Merrill + + * class.c (finish_struct): Don't synthesize constructors if the + class has a field with the same name as the class. Don't die on + classes with no constructors or destructors. Don't die if the head + and tail of the class are in different files. + + * decl.c (grokdeclarator): Don't treat a function pointer field + with the same name as the class as a constructor. + +Fri Sep 9 13:17:00 1994 Jason Merrill + + * typeck.c (build_c_cast): Pull constant values out of their + variables here. + + * decl.c (duplicate_decls): Only propagate DECL_CHAIN in + FUNCTION_DECLs and TEMPLATE_DECLs. + +Thu Sep 8 10:07:48 1994 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_CHAIN in all DECLs that + have it. + + * pt.c (unify): REALs and INTEGERs only unify with their own genus. + (instantiate_member_templates): Don't muck with DECL_EXTERNAL and + TREE_PUBLIC unless -fexternal-templates. + +Wed Sep 7 13:17:10 1994 Jason Merrill + + * pt.c (do_type_instantiation): Call instantiate_member_templates. + Deal with specializations. + (tsubst): Don't stick the mangled name in DECL_NAME for function + instantiations. Don't push them, either. + + * decl2.c (grokfield): Move code for generating the + DECL_ASSEMBLER_NAME for static members from here. + * method.c (build_static_name): To here. + * decl.c (grokvardecl): Call build_static_name. + (duplicate_decls): Keep old DECL_ASSEMBLER_NAME. + +Mon Sep 5 12:49:18 1994 Jason Merrill + + * call.c (build_method_call): If -Wsynth, warn when selecting + synthesized op= over user-supplied one cfront would select. + * decl2.c (lang_decode_option): Handle -Wsynth. + +Fri Sep 2 15:11:59 1994 Jason Merrill + + * decl.c (finish_enum): Overhaul to fix several bugs. + (start_enum): Disable useless code. + +Thu Sep 1 16:04:54 1994 Jason Merrill + + * typeck.c (c_expand_return): Warn about returning a reference to a + temporary. + (convert_arguments): Increment argument counter when using default + arguments, too. + +Wed Aug 31 14:29:22 1994 Jason Merrill + + * decl.c (finish_decl): If the type of decl is error_mark_node, + don't bother trying to do anything. + + * typeck.c (convert_for_initialization): If the rhs contains a + constructor call, pretend the lhs type needs to be constructed. + + * init.c (expand_default_init): If we stick the object inside the + initializer, mark the initializer used. + +Tue Aug 30 13:50:18 1994 Jason Merrill + + * method.c (build_assign_ref): Return *this; + (build_assign_ref): Fix base assignment order. + (build_copy_constructor): Fix member init order. + +Mon Aug 29 13:54:39 1994 Brendan Kehoe + + * g++.c (main): Remember to clear out SAW_SPECLANG after we see + its argument. + +Sat Aug 27 09:36:03 1994 Jason Merrill + + * method.c (build_copy_constructor): Also copy virtual bases. + +Fri Aug 26 17:05:15 1994 Jason Merrill + + * lex.c (do_pending_inlines): Clear out pending_inlines before doing + any synthesis. Also first set deja_vu on all pending_inlines. + + * method.c (build_assign_ref): Use build_member_call to invoke base + operator=, rather than build_modify_expr. And use + build_reference_type instead of TYPE_REFERENCE_TO. + (build_copy_constructor): Use TYPE_NESTED_NAME to identify the + basetype. + + * decl2.c (grokfield): Don't complain about undefined local class + methods. + + * class.c (finish_struct): Don't try to synthesize methods here. + * lex.c (do_pending_inlines): Instead, synthesize them here. + (init_lex): Initialize synth_obstack. + (cons_up_default_function): Stick synthesis request on + pending_inlines. + +Fri Aug 26 12:24:14 1994 Brendan Kehoe + + * call.c (build_method_call) [PCC_STATIC_STRUCT_RETURN]: Also + accept an RTL_EXPR in what we're about to use for the instance, + since anything which would end up with pcc_struct_return set + inside cplus_expand_expr. + + * cp-tree.h (cons_up_default_function): Note change of prototype. + +Thu Aug 25 23:05:30 1994 Gerald Baumgartner + + * class.c (finish_struct): Undid change from Aug 21 testing + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. + * parse.y (left_curly): Likewise, undid change from Aug 21. + * decl.c (xref_tag): Undid change from Aug 21, set + CLASSTYPE_INTERFACE correctly, and added comments. + +Thu Aug 25 00:36:31 1994 Jason Merrill + + Rework approach to synthesized methods; don't go through the parser + anymore. + * class.c (finish_struct): Use new synthesis approach. + * lex.c (cons_up_default_function): Now just creates declaration, + not code. + (largest_union_member): #if 0 out. + (default_assign_ref_body): Likewise. + (default_copy_constructor_body): Likewise. + * method.c (build_default_constructor): New function to synthesize X(). + (build_copy_constructor): Synthesize X(X&). + (build_assign_ref): Synthesize X::operator=(X&). + (build_dtor): Synthesize ~X(). + + * error.c (cp_line_of): If we're dealing with an artificial + TYPE_DECL, look at the type instead. + +Wed Aug 24 11:11:50 1994 Jason Merrill + + * init.c (sort_member_init): Check warn_reorder. + * decl2.c (lang_decode_option): Handle -W{no-,}reorder. + + * cp-tree.h (CLASSTYPE_SOURCE_LINE): New macro. + * error.c (cp_line_of): Use CLASSTYPE_SOURCE_LINE for aggregates. + * class.c (finish_struct): Set CLASSTYPE_SOURCE_LINE. + +Tue Aug 23 09:28:35 1994 Mike Stump + + * error.c (dump_decl): Improve wording, so that error messages + dont't read template<, class foo>... + +Mon Aug 22 15:30:51 1994 Brendan Kehoe + + * parse.y (label_colon): Also match a TYPENAME as a label name, + since they may have declared a class by that name but have also + tried to have a local label under the same name. + + * pt.c (coerce_template_parms): Call cp_error, not cp_error_at, + for the message so they know at what point it was instantiated. + +Sun Aug 21 23:07:35 1994 Gerald Baumgartner + + * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING for signatures up to left_curly time. + * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING for signatures down to left_curly time. + * parse.y (left_curly): New final resting place for setting + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING for signatures. + + * class.c (finish_struct): Don't test for function/field name + conflicts in signatures, since all the fields are compiler-constructed. + +Fri Aug 19 14:04:47 1994 Kung Hsu + + * method.c (build_overload_nested_name): In qualified name + mangling, the template with value instantiation will have numeric + at end and may mixed with the name length of next nested level. + Add a '_' in between. + * method.c (build_overload_name): Ditto. + * method.c (build_overload_identifier): Ditto. + +Thu Aug 18 16:24:43 1994 Mike Stump + + * error.c (dump_decl): Handle NULL args. + +Thu Sep 29 16:15:36 1994 Michael I Bushnell + + * g++.c: Rework last change so it's done like collect.c (and + gcc.c). + +Wed Sep 14 10:17:27 1994 Michael I Bushnell + + * g++.c: Include in case `errno' is a macro + as permitted by ANSI C. + +Thu Aug 18 12:48:09 1994 Mike Stump + + * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING up to left_curly time. + * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING down to left_curly time. + * parse.y (left_curly): New final resting place for setting + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. + +Thu Aug 11 11:32:42 1994 H.J. Lu + + * g++.c (main): Only decrement "added" and set "library" to + NULL when "library" != NULL. + +Sat Aug 13 00:14:52 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't set TREE_PUBLIC on a function decl + just because its class has a known interface. + (decls_match): Deal with new format of template parms. + + * lex.c (cons_up_default_function): Don't play with TREE_PUBLIC and + DECL_EXTERNAL here. + +Fri Aug 12 01:55:15 1994 Jason Merrill + + * decl.c (pushtag): SET_DECL_ARTIFICIAL on gratuitous typedefs. + (xref_defn_tag): Likewise. + (pushdecl): Only allow artificial typedefs to be shadowed. + + * init.c (emit_base_init): Pass the right binfos to + expand_aggr_init_1. + + * class.c (delete_duplicate_fields_1): Make it work right. + (finish_struct): Catch function/field name conflict. + + * decl2.c (check_classfn): Pass the function to cp_error, not just + the name. + + * init.c (sort_member_init): Warn when order of member initializers + does not match order of member declarations. + (emit_base_init): Call expand_aggr_init_1 with LOOKUP_PROTECT. + + * error.c (dump_expr): Handle lists of functions. + + * decl.c (start_function): #pragma interface only affects functions + that would otherwise be static. + (finish_decl): Don't warn about an unused variable if it has both + constructor and destructor, since the 'resource allocation is + initialization' idiom is relatively common. + + * typeck.c (comp_target_types): Don't handle TEMPLATE_TYPE_PARMs. + (comp_target_parms): Likewise. + (compparms): Never consider default parms. + (common_base_type): Don't choose a virtual baseclass if there is a + more derived class in common. + (build_conditional_expr): If pedantic, pedwarn about conversion to + common base in conditional expr. + + * class.c (instantiate_type): Handle template instantiation better. + + * typeck.c (convert_arguments): Don't try to get tricky and convert + to int directly when PROMOTE_PROTOTYPES is set, as it breaks + user-defined conversions. + + * lex.c (check_for_missing_semicolon): Also give error at end of + file. + + * call.c (build_method_call): Don't promote arrays to pointers here. + + * typeck.c (convert_arguments): Don't require the actual parameter + to be of a complete type if the formal parameter is a reference. + +Thu Aug 11 15:21:40 1994 Jason Merrill + + * decl.c (grokdeclarator): Soften 'static' on member function error + to pedwarn. + + * init.c (build_new): Don't automatically save rval. + (build_offset_ref): Do field lookup with proper basetype_path. + +Thu Aug 11 12:46:54 1994 Brendan Kehoe + + * errfn.c (cp_silent): Declare to mark when we should avoid + emitting warnings and errors. + (cp_error): Check it. + (cp_warning): Likewise. + (cp_pedwarn): Likewise. + (cp_compiler_error): Likewise. + (cp_error_at): Likewise. + (cp_warning_at): Likewise. + (cp_pedwarn_at): Likewise. + * call.c (compute_conversion_costs): Set CP_SILENT when we start + out, and make sure we turn it off before we leave. + +Thu Aug 11 00:02:54 1994 Jason Merrill + + * decl2.c (grok_array_decl): Try computing *(A+B) if neither + argument is obviously an array. + +Wed Aug 10 15:32:04 1994 Jason Merrill + + * typeck.c (c_expand_start_case): Do cleanups here. + + * parse.y (xcond): Do bool conversion here, too. + (simple_stmt, SWITCH case): Don't do cleanups here. + + * decl.c (duplicate_decls): Don't treat builtins that have been + explicitly declared specially. + +Tue Aug 9 01:16:09 1994 Jason Merrill + + * tree.c (make_deep_copy): Support copying pointer, reference, + function, array, offset and method types. + + * decl.c (init_decl_processing): Mark exit and abort as + BUILT_IN_NONANSI so that duplicate_decls is kinder about + redeclaration. + (duplicate_decls): Don't give two errors for redeclaring a C + function with the same parms but a different return type. + + * parse.y (paren_cond_or_null): Do cleanup and bool conversion here. + (condition): Instead of here. + (simple_stmt, SWITCH case): Also do cleanup here. + + * decl2.c (finish_anon_union): Only break out FIELD_DECLs. + + * call.c (build_method_call): Don't throw away the side effects of + the object in a call to a non-existent constructor. + * parse.y (primary): Likewise. + + * method.c (build_decl_overload): Oop. + + * decl2.c (lang_decode_option): Deal with flag_no_nonansi_builtin, + warn about uselessness of specifying -fansi-overloading. + + * method.c (build_decl_overload): Treat any non-member new with one + parameter as __builtin_new. + + * decl.c (init_decl_processing): Setup built-in meanings of exit, + _exit and abort. + +Mon Aug 8 15:03:30 1994 Jason Merrill + + * error.c (dump_readonly_or_volatile): Put a space between const and + volatile if both apply. + + * init.c (perform_member_init): Clean up after this initialization. + (emit_base_init): Clean up after each base init, not after all have + been done. + (expand_aggr_vbase_init_1): Clean up after this init. + +Sun Aug 7 14:55:05 1994 Jason Merrill + + * call.c (build_method_call): Deal with destroying references. + + * parse.y (condition): Do bool_truthvalue_conversion here. + (paren_expr_or_null): And here. + (simple_if): Not here. + (simple_stmt): Or here. + +Sat Aug 6 22:29:45 1994 Jason Merrill + + * parse.y (paren_expr_or_null): Wrap the expression in a + CLEANUP_POINT_EXPR. + (condition): Likewise. + +Sat Aug 6 19:46:37 1994 Rohan Lenard + + * call.c (build_scoped_method_call): Fix error message when + destructor call refers to a nonexistent type. + +Sat Apr 16 22:43:30 1993 Gerald Baumgartner + + * lex.h (rid): Deleted RID_RAISES, it's never used. + Moved RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_EXCEPTION, + RID_TEMPLATE and RID_SIGNATURE to the end of the enumeration, + they don't need to be touched in `grokdeclarator.' + (RID_LAST_MODIFIER): Defined macro to be RID_MUTABLE. + + * decl.c (grokdeclarator): Use RID_LAST_MODIFIER instead of + RID_MAX as loop limit for finding declaration specifiers. + +Sat Apr 3 21:59:07 1993 Gerald Baumgartner + + * lex.c (debug_yytranslate): Moved to parse.y since it needs to + access `yytname,' which is static in parse.c. + +Fri Apr 2 23:36:57 1993 Gerald Baumgarnter + + * cp-tree.h (GNU_xref_ref): Fixed typo in extern declaration, it + was `GNU_xref_def' instead of `GNU_xref_ref.' + +Fri Aug 5 14:20:16 1994 Jason Merrill + + * pt.c (do_function_instantiation): Don't set TREE_PUBLIC and + DECL_EXTERNAL on 'extern' instantiations; wait until EOF to do that. + (do_type_instantiation): Likewise. + + * decl2.c (import_export_inline): Decides at EOF what an inline's + linkage should be. + (finish_file): Call it. + + * decl.c (start_function): Don't rely on the settings of TREE_PUBLIC + and DECL_EXTERNAL from do_*_instantiation. Only set + DECL_DEFER_OUTPUT on inlines whose linkage might actually change. + (finish_function): Use DECL_DEFER_OUTPUT to decide which inlines to + mark for later consideration, rather than DECL_FUNCTION_MEMBER_P. + +Fri Aug 5 01:12:20 1994 Mike Stump + + * class.c (get_class_offset_1, get_class_offset): New routine to + find the offset of the class where a virtual function is defined, + from the complete type. + * class.c (modify_one_vtable, fixup_vtable_deltas): Use + get_class_offset instead of virtual_offset as get_class_offset will + always provide the right answer. + * tree.c (virtual_offset): Remove. It only ever worked some of the + time. + +Tue Aug 2 12:44:21 1994 Jason Merrill + + * call.c (build_method_call): Put back unary_complex_lvalue call + that I thought was redundant. + + * typeck.c (c_expand_return): Fix a case I missed before. + +Sun Jul 31 17:54:02 1994 Jason Merrill + + * pt.c (unify): Strip cv-quals from template type arguments (when + 'const T*' is matched to 'const char*', that does not mean that T is + 'const char'). + +Fri Jul 29 01:03:06 1994 Jason Merrill + + * pt.c (do_type_instantiation): Instantiate nested TAGS, not + typedefs. Third time's the charm? + + * parse.y (template_parm): Support default template parms. + * pt.c (process_template_parm): Likewise. + (end_template_parm_list): Likewise. + (coerce_template_parms): Likewise. + (mangle_class_name_for_template): Likewise. + (push_template_decls): Likewise. + (unify): Likewise. + * method.c (build_overload_identifier): Likewise. + * error.c (dump_decl): Likewise. + +Wed Jul 27 17:47:00 1994 Jason Merrill + + * pt.c (do_type_instantiation): Only instantiate nested *classes*. + +Tue Jul 26 13:22:40 1994 Jason Merrill + + * search.c (note_debug_info_needed): Also emit debugging information + for the types of fields. + +Mon Jul 25 00:34:44 1994 Jason Merrill + + * pt.c (lookup_template_class): Pass 'template' to + coerce_template_parms instead of 'in_decl', since it's a more + meaningful context. + + * typeck.c (c_expand_return): Make sure any cleanups for the return + expression get run. + (build_c_cast): Use CONVERT_EXPR for conversion to void. + + * pt.c (do_type_instantiation): Also instantiate nested types. + + * typeck.c (convert_for_assignment): Don't die when comparing + pointers with different levels of indirection. + + * decl.c (grokdeclarator): The sub-call to grokdeclarator for + class-local typedefs sets DECL_ARGUMENTS, so we need to clear it + out. + + * decl2.c (finish_anon_union): Don't die if the union has no + members. + + * decl.c (grokdeclarator): Undo changes to declspecs when we're done + so that 'typedef int foo, bar;' will work. + + * decl2.c (finish_file): Don't call expand_aggr_init for + non-aggregates. + +Mon Jul 25 00:03:10 1994 Teemu Torma + + * decl.c (finish_function): We can't inline constructors and + destructors under some conditions with -fpic, but don't unset + DECL_INLINE. + +Mon Jul 25 00:03:10 1994 Jason Merrill + + * typeck.c (build_object_ref): Make sure 'datum' is a valid object. + +Sun Jul 24 14:19:31 1994 Jason Merrill + + * class.c (finish_struct): Don't set DECL_FIELD_BITPOS on + non-fields. + (finish_struct_methods): Use copy_assignment_arg_p. + + * cvt.c (cp_convert): If expr is an OFFSET_REF, resolve it instead + of giving an error. + + * typeck.c (build_binary_op_nodefault): Don't set result_type if we + don't know how to compare the operands. + + * decl.c (grokdeclarator): Avoid seg fault when someone uses '__op' + as a declarator-id in their program. Like the Linux headers do. + Arrgh. + + * tree.c (lvalue_p): Treat calls to functions returning objects by + value as lvalues again. + + * typeck.c (build_component_addr): Use convert_force to convert the + pointer in case the component type is also a private base class. + + * search.c (get_matching_virtual): Fix bogus warning of overloaded + virtual. + + * pt.c (overload_template_name): Set DECL_ARTIFICIAL on the created + TYPE_DECL to fix bogus shadowing warnings. + +Fri Jul 22 01:15:32 1994 Jason Merrill + + * init.c (expand_aggr_init_1): const and volatile mismatches do not + prevent a TARGET_EXPR from initializing an object directly. + +Tue Jul 19 17:55:37 1994 Jason Merrill + + * cvt.c (build_up_reference): Allow building up references to + `this', don't warn about making references to artificial variables + (like `this'). + + * tree.c (lvalue_p): `this' is not an lvalue. + + * call.c (build_method_call): Accept using a typedef name (or + template type parameter) for explicit destructor calls. + +Thu Jul 14 09:42:23 1994 Mike Stump + + * Version 2.6.0 released. + +Wed Jul 13 03:57:54 1994 Jason Merrill + + * method.c (hack_identifier): Put back old code so lists of + non-functions will be handled properly. + + * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): #if 0 out; this macro is now + defined in the language-independent tree.h. + + * tree.c (count_functions): Avoid bogus warning when compiling this + function. + +Mon Jul 11 18:37:20 1994 Jason Merrill + + * decl.c (grok_reference_init): Always save the initializer of a + reference. + +Fri Jul 8 17:41:46 1994 Mike Stump + + * decl.c (cplus_expand_expr_stmt): Wrap statement expressions inside + CLEANUP_POINT_EXPRs so that the stack slots can be reused. + (disabled for now) + +Fri Jul 8 12:59:38 1994 Jason Merrill + + * method.c (hack_identifier): Fix for new overloading. + + * typeck.c (build_binary_op_nodefault): Don't mess with division by + zero. + +Fri Jul 8 13:20:28 1994 Gerald Baumgartner + + * decl2.c (finish_file): Only call walk_sigtables, if + flag_handle_signatures is turned on, don't waste time otherwise. + +Fri Jul 8 02:27:41 1994 Jason Merrill + + * decl.c (push_overloaded_decl): Don't create overloads of one when + shadowing a class type. + * typeck.c (build_x_function_call): Complain about overloads of one. + + * decl.c (grokdeclarator): Don't try to treat a char* as a tree. + (grokdeclarator): Fix setting of TREE_STATIC. + (start_decl): Clear DECL_IN_AGGR_P after calling duplicate_decls. + +Thu Jul 7 22:20:46 1994 Gerald Baumgartner + + * cp-tree.h (walk_sigtables): Created extern declaration. + * decl2.c (walk_sigtables): Created function, patterned after + walk_vtables, even though we only need it to write out sigtables. + (finish_sigtable_vardecl): Created function. + (finish_vtable_vardecl): Changed 0 to NULL_PTR. + (finish_file): Call walk_sigtables. + + * sig.c (build_signature_table_constructor): Mark class member + function pointed to from signature table entry as addressable. + +Thu Jul 7 13:39:37 1994 Jason Merrill + + * decl.c (start_decl): Check new decl of static member variable + against the declaration in the class here. + (grokvardecl): Instead of here. + + * class.c (prepare_fresh_vtable): Call import_export_vtable if not + -fvtable-thunks. + (build_vtable): Likewise. + + * decl2.c (import_export_vtable): Move logic for deciding the + interface of a template class from here. + (import_export_template): To here. + (finish_vtable_vardecl): Call import_export_template before + import_export_vtable. + +Wed Jul 6 20:25:48 1994 Mike Stump + + * except.c (init_exception_processing): Setup interim_eh_hook to + call lang_interim_eh. + * except.c (do_unwind): Propagate throw object value across + stack unwinding. + * except.c (saved_throw_value): Used to hold the value of the object + being thrown. It is always a reference to the real value. + * except.c (expand_start_catch_block): Add handling for the + value of the exception object. + * except.c (expand_start_catch_block): Add handler for the handler, + so that throws inside the handler go to the outer block. + * except.c (expand_end_catch_block): Likewise. + * parse.y (handler_args): Use parm instead, as the other doesn't yet + handle references correctly. + +Wed Jul 6 17:55:32 1994 Per Bothner + + * decl2.c (mark_vtable_entries): If -ftable-thunks, set the + vtable entry properly to abort. + +Tue Jul 5 14:07:54 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Downgrade division by zero + errors to warnings. + + * call.c (build_overload_call_real): Handle fnname being a list of + functions. + * typeck.c (build_x_function_call): Pass list of functions to + build_overload_call, not just the name. + * tree.c (count_functions): Complain when called for invalid + argument. + + * decl.c (grokdeclarator): Fix settings of TREE_STATIC, TREE_PUBLIC + and DECL_EXTERNAL on static members and initialized const members. + * decl2.c (grokfield): Reflect this change. + +Fri Jul 1 09:35:51 1994 Jason Merrill + + * parse.y (init): ANSI C++ does not forbid { }. + +Thu Jun 30 00:35:22 1994 Jason Merrill + + * decl2.c (lang_decode_option): Set warn_nonvdtor along with -Wall. + warn_nonvdtor defaults to off. + + * class.c (instantiate_type): Use comptypes rather than relying on + types to satisfy ==. + + * decl.c (start_function): Set DECL_DEFER_OUTPUT on all inlines that + might be static. + + * tree.c (build_cplus_new): Never build WITH_CLEANUP_EXPRs. + + * decl.c (grok_reference_init): Deal with ADDR_EXPRs of TARGET_EXPRs. + + * cvt.c (cp_convert): Pass 0 to with_cleanup_p arg of + build_cplus_new. + +Wed Jun 29 22:31:09 1994 Jason Merrill + + * decl2.c (finish_file): Maybe consider static inlines multiple + times, in case they reference each other. + +Tue Jun 28 11:58:38 1994 Gerald Baumgartner + + * class.c (finish_struct): Don't `cons_up_default_function's + for signatures. + (finish_struct): Handle an empty method_vec correctly. + + * decl.c (grokdeclarator): Don't warn about a signature being + empty in a signature pointer declaration if we only saw a + forward declaration of the signature. Changed `warning's into + `cp_warning's. + + * sig.c (build_sigtable): Don't die if a null signature table + constructor is returned. + (build_signature_pointer_constructor): If the signature table + constructor is null, the _sptr field is set to a null pointer + and cast to the appropriate type. Make copies of all null + pointers so that the type null_pointer_node doesn't get changed. + (build_signature_table_constructor): Added comments. + + * sig.c (build_signature_pointer_constructor): Complain if we + try to assign to/initialize a signature pointer/reference of + an undefined signature. + +Mon Jun 27 14:05:16 1994 Gerald Baumgartner + + * typeck2.c (store_init_value): Don't be pedantic about + non-constant initializers of signature tables/pointers/references. + +Fri Jun 24 16:49:41 1994 Gerald Baumgartner + + * decl.c (grokdeclarator): If we are grokking an opaque typedef + in a signature, don't complain about it begin static. + +Wed Jun 29 16:44:45 1994 Mike Stump + + Fixes a problem of the this pointer being wrong in virtual calls to + methods that are not overridden in more derived classes. + + * class.c (fixup_vtable_delta): New routine. It will fixup the + delta entries in vtables, wheever they need updating. + * class.c (finish_struct): Call the new routine for all virtual + bases, as they can have different offsets, than those used in base + classes that we derive our vtable from. + +Tue Jun 28 23:49:28 1994 Jason Merrill + + * typeck.c (build_binary_op): Use the types before default + conversions in the error message. + + * *.c: Use c_build_type_variant instead of build_type_variant where + the type might be an array. + + * call.c (build_method_call): Call build_type_variant and + build_reference_type in the right order. + * decl.c (record_builtin_type): Likewise. + +Wed Jun 29 16:58:53 1994 Jason Merrill + + * call.c (build_method_call): Call build_type_variant and + build_reference_type in the right order. + * decl.c (record_builtin_type): Likewise. + +Tue Jun 28 23:49:28 1994 Jason Merrill + + * typeck.c (build_binary_op): Use the types before default + conversions in the error message. + + * *.c: Use c_build_type_variant instead of build_type_variant where + the type might be an array. + +Sat Jun 25 11:50:54 1994 Jason Merrill + + * cvt.c (convert_to_reference): Try UDC's before doing the + reinterpret_cast thang, though. + +Fri Jun 24 01:24:01 1994 Jason Merrill + + * typeck.c (c_expand_return): Don't USE the return value location + after we've expanded the jump. + + * decl2.c (finish_file): Make sure DECL_SAVED_INSNS is not 0 before + trying to write out an inline. + + * cvt.c (build_up_reference): Also do address adjustment when the + target type uses MI. + (convert_to_reference): Try UDCs only after built-in conversions. + (build_type_conversion_1): Don't play games with the argument to the + method. + (build_type_conversion): #if 0 out code for binding to reference. + +Thu Jun 23 00:22:28 1994 Jason Merrill + + * decl2.c (finish_file): Use TREE_SYMBOL_REFERENCED to decide + whether to emit inlines. + + * decl.c (grokdeclarator): Set explicit_int for decls that just + specify, say, 'long'. + + * init.c (do_friend): Do overload C functions (or call pushdecl, + anyaway). + +Wed Jun 22 13:40:49 1994 Jason Merrill + + * cvt.c (build_up_reference): Don't call readonly_error. + (convert_to_reference): Propagate const and volatile from expr to + its type. + + * tree.c (lvalue_p): Random CALL_EXPRs are not lvalues. + + * cvt.c (build_up_reference): Break out WITH_CLEANUP_EXPR when + creating a temporary. + (convert_to_reference): Lose excessive and incorrect trickiness. + (cp_convert): Call build_cplus_new with with_cleanup_p set. + + * typeck2.c (build_functional_cast): Likewise. + +Tue Jun 21 17:38:38 1994 Jason Merrill + + * decl.c (grokdeclarator): signed, unsigned, long and short all + imply 'int'. + + * decl.c (grokdeclarator): Allow "this is a type" syntax. + (grok_reference_init): Simplify and fix. + +Sun Jun 19 17:08:48 1994 Jason Merrill + + * decl.c (grokdeclarator): pedwarn about a typedef that specifies no + type. + +Sat Jun 18 04:16:50 1994 Jason Merrill + + * decl.c (start_function): Move TREE_PUBLIC and DECL_EXTERNAL + tinkering to after call to pushdecl. + +Fri Jun 17 14:48:28 1994 Jason Merrill + + * call.c (build_method_call): Handle destructors for non-aggregate + types properly. + +Thu Jun 16 16:48:05 1994 Jason Merrill + + * call.c (build_method_call): Make sure that the name given for the + destructor matches the constructor_name of the instance. + + * pt.c (do_function_instantiation): A non-extern instantiation + overrides a later extern one. + (do_type_instantiation): Likewise. + +Wed Jun 15 19:34:54 1994 Jason Merrill + + * init.c (expand_aggr_init): Use TYPE_MAIN_VARIANT to get the + unqualified array type. + + * cp-tree.h (EMPTY_CONSTRUCTOR_P): Tests whether NODE is a + CONSTRUCTOR with no elements. + + * decl.c (various): Lose empty_init_node. + (finish_decl): Use EMPTY_CONSTRUCTOR_P, do the empty CONSTRUCTOR + thing depending on the value of DECL_COMMON instead of + flag_conserve_space, do the empty CONSTRUCTOR thing for types that + don't have constructors, don't treat a real empty CONSTRUCTOR + specially. + + * typeck2.c (process_init_constructor): Don't treat empty_init_node + specially. + +Wed Jun 15 19:05:25 1994 Mike Stump + + * class.c (override_one_vtable): Don't forget to merge in an old + overrider when we wanted to reuse a vtable, but couldn't. + +Wed Jun 15 15:03:16 1994 Jason Merrill + + * decl.c (start_decl): Put statics in common again. + + * decl.c (grokdeclarator): Return NULL_TREE for an error rather than + setting the type to error_mark_node. + + * typeck.c (build_modify_expr): Build up a COMPOUND_EXPR for enum + bitfield assignments. + +Tue Jun 14 12:23:38 1994 Jason Merrill + + * decl.c (grok_op_properties): Const objects can be passed by value. + +Mon Jun 13 03:10:59 1994 Jason Merrill + + * decl2.c (import_export_vtable): Force implicit instantiations to + be interface_only when -fno-implicit-templates. + + * decl.c (duplicate_decls): Redeclaring a class template name is an + error. + + * pt.c (end_template_decl): Call GNU_xref_decl for class templates. + * xref.c (GNU_xref_decl): Support templates. + +Sat Jun 11 17:09:05 1994 Jason Merrill + + * decl.c (grok_op_properties): Split out checking for whether this + function should suppress the default assignment operator. + * decl2.c (grok_function_init): Likewise. + (copy_assignment_arg_p): New function to do just that. + Now considers virtual assignment operators that take a base as an + argument to count as copy assignment operators. + + * search.c (dfs_debug_mark): Lose checks for DWARF_DEBUG and + TREE_ASM_WRITTEN, as they are redundant. + + * pt.c (end_template_decl): Don't try to set DECL_CLASS_CONTEXT on a + decl that has no LANG_SPECIFIC part. + (do_type_instantiation): Force the debugging information for this + type to be emitted. + + * decl.c (start_decl): Clear up uses of various types of templates + (say sorry for static data members, rather than "invalid template"). + (expand_static_init): Fix initialization of static data members of + template classes. + +Fri Jun 10 00:41:19 1994 Jason Merrill + + * decl.c (grokdeclarator): Set DECL_CONTEXT on static data members. + + * g++.c (main): Use -xc++-cpp-output for .i files. + + * pt.c (tsubst): Give meaningful error about declaring template for + a copy constructor which was not declared in the class template. + (do_type_instantiation): Explicit instantiation before the class + template is an error. + (instantiate_template): Don't die if tsubst returns error_mark_node. + +Thu Jun 9 19:04:59 1994 Jason Merrill + + Don't synthesize the copy assignment operator if the one in a base + class is pure virtual. + * cp-tree.h (TYPE_HAS_ABSTRACT_ASSIGN_REF): New macro to indicate + whether the type has a pure virtual copy assignment operator. + * class.c (finish_base_struct): Don't generate the copy assignment + operator if a base class has a pure virtual one. + * decl.c (grok_op_properties): Add disabled code to set + TYPE_HAS_ABSTRACT_ASSIGN_REF with comment pointing to where it is + actually set. + * decl2.c (grok_function_init): Set TYPE_HAS_ABSTRACT_ASSIGN_REF. + + * decl2.c (import_export_vtable): Always treat template + instantiations as if write_virtuals >= 2, and treat implicit + instantiations as external if -fno-implicit-templates. + (finish_file): Output all pending inlines if + flag_keep_inline_functions. + +Wed Jun 8 20:48:02 1994 Mike Stump + + * tree.c (layout_vbasetypes): Align virtual base classes inside + complete objects, so that we don't core dump on machines such as + SPARCs when we access members that require larger than normal + alignments, such as a double. Also, we bump up the total alignment + on the complete type, as necessary. + +Wed Jun 8 16:18:14 1994 Jason Merrill + + * gxxint.texi (Free Store): New section with code for examining + cookie. + (Limitations of g++): Remove operator delete entry, since it is no + longer accurate. Fix access control entry. + + * typeck.c (build_unary_op): Pedwarn about taking the address of or + incrementing a cast to non-reference type. + (build_modify_expr): Use convert instead of convert_force again. + + * search.c (get_base_distance): Use IS_AGGR_TYPE_CODE to check for + class type, not == RECORD_TYPE. + + * decl.c (grokdeclarator): Cope with grokfndecl returning NULL_TREE. + + * typeck2.c (report_case_error): #if 0 out. + * lex.c (real_yylex): Lose RANGE. + * parse.y: Likewise. + +Tue Jun 7 18:17:35 1994 Jason Merrill + + * parse.y (simple_stmt, case ranges): Use ELLIPSIS instead of RANGE. + +Mon Jun 6 19:39:57 1994 Jason Merrill + + * typeck.c (build_c_cast): Don't shortcut conversions to the same + type. Don't replace consts with their values here, since that's now + done in cp_convert. + + * cvt.c (cp_convert): When converting to bool, take + integer_zero_node to false_node and all other INTEGER_CSTs to + true_node. + (build_type_conversion): Don't complain about multiple conversions + to float if we're not really converting. + +Fri Jun 3 02:10:56 1994 Jason Merrill + + Implement 'extern template class A;' syntax for suppressing + specific implicit instantiations. + * cp-tree.h: Update prototypes for do_*_instantiation. + * pt.c (do_pending_expansions): Don't compile 'extern' explicit + instantiations. + (do_function_instantiation): Set DECL_EXTERNAL on 'extern' explicit + instantiations. + (do_type_instantiation): Likewise. + * parse.y (explicit_instantiation): Support 'extern template class + A;' syntax. + * decl.c (start_function): Don't modify the settings of TREE_PUBLIC + and DECL_EXTERNAL on explicit instantiations. + + * cvt.c (cp_convert): Replace constants with their values before + converting. + (cp_convert): Consistently use 'e' instead of 'expr'. + +Thu Jun 2 03:53:30 1994 Jason Merrill + + * typeck2.c (build_x_arrow): Resolve OFFSET_REFs first. + +Wed Jun 1 18:57:35 1994 Jason Merrill + + * typeck2.c (digest_init): Handle initializing a pmf with an + overloaded method. + * typeck.c (build_ptrmemfunc): Handle overloaded methods. + + * decl.c (pushtag): Use build_decl to make TYPE_DECLs. + (xref_defn_tag): Likewise. + * pt.c (process_template_parm): Likewise. + (lookup_template_class): Likewise. + (push_template_decls): Likewise. + (instantiate_class_template): Likewise. + (create_nested_upt): Likewise. + * class.c (finish_struct): Don't try to set DECL_CLASS_CONTEXT on + TYPE_DECLs. + + * typeck.c (convert_arguments): Make sure type is not NULL before + checking its TREE_CODE. + +Wed Jun 1 17:40:39 1994 Mike Stump + + * class.c (get_derived_offset): New routine. + * class.c (finish_base_struct): Make sure we set BINFO_VTABLE and + BINFO_VIRTUALS when we choose a new base class to inherit from. + * class.c (modify_one_vtable): Use get_derived_offset to get the + offset to the most base class subobject that we derived this binfo + from. + * class.c (finish_struct): Move code to calculate the + DECL_FIELD_BITPOS of the vfield up, as we need might need it for + new calls to get_derived_offset in modify_one_vtable. + +Wed Jun 1 16:50:59 1994 Jason Merrill + + * init.c (build_member_call): Use build_pointer_type instead of + TYPE_POINTER_TO. + +Wed Jun 1 11:11:15 1994 Brendan Kehoe + + * decl.c (grokdeclarator): Make sure we have a DNAME set before we + try to use it in an error. + +Wed Jun 1 09:48:49 1994 Mike Stump + + * typeck.c (convert_arguments, convert_for_initialization): Don't + strip NOP_EXPRs, when we are converting to a reference. + +Wed Jun 1 01:11:38 1994 Jason Merrill + + * typeck.c (build_modify_expr): Don't dereference references when + initializing them. + + * decl2.c (grokfield): Don't check for grokdeclarator returning + error_mark_node any more. + + * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. + (start_method): Return void_type_node instead of error_mark_node. + + * typeck.c (build_modify_expr): Resolve offset refs earlier. + +Tue May 31 16:06:58 1994 Jason Merrill + + * call.c (build_method_call): Resolve OFFSET_REFs in the object. + + * typeck.c (build_modify_expr): Dereference references before trying + to assign to them. + + * call.c (build_method_call): Don't confuse type conversion + operators with constructors. + * typeck2.c (build_functional_cast): Just call build_c_cast if there + was only one parameter. + * method.c (build_typename_overload): Don't set + IDENTIFIER_GLOBAL_VALUE on these identifiers. + * decl.c (grok_op_properties): Warn about defining a type conversion + operator that converts to a base class (or reference to it). + * cvt.c (cp_convert): Don't try to use a type conversion operator + when converting to a base class. + (build_type_conversion_1): Don't call constructor_name_full on an + identifier. + * cp-tree.h (DERIVED_FROM_P): Should be self-explanatory. + + * decl.c (start_decl): Don't complain that error_mark_node is an + incomplete type. + (finish_decl): Check for type == error_mark_node. + +Mon May 30 23:38:55 1994 Jason Merrill + + * decl.c (start_function): Set DECL_DEFER_OUTPUT on implicit + instantiations and inline members. + + * spew.c (yylex): Set looking_for_template if the next token is a '<'. + + * lex.h: Declare looking_for_template. + + * decl.c (lookup_name_real): Use looking_for_template to arbitrate + between type and template interpretations of an identifier. + +Sat May 28 04:07:40 1994 Jason Merrill + + * pt.c (instantiate_template): Zero out p if we found a + specialization. + + * decl.c (grokdeclarator): Elucidate warning. + (grokdeclarator): If pedantic AND -ansi, complain about long long. + + Make explicit instantiation work reasonably. It is now appropriate + to deprecate the use of -fexternal-templates. + * pt.c (instantiate_template): Set DECL_TEMPLATE_SPECIALIZATION or + DECL_IMPLICIT_INSTANTIATION on fndecl as appropriate. + (end_template_instantiation): Reflect changes in USE_TEMPLATE + semantics. + (do_pending_expansions): if (!flag_implicit_templates) DECIDE(0); + (do_function_instantiation): Don't set EXPLICIT_INST if + flag_external_templates is set. Do set TREE_PUBLIC and DECL_EXTERN + appropriately otherwise. + (do_type_instantiation): Set interface info for class. Set + TREE_PUBLIC and DECL_EXTERN for methods. Do none of this if + flag_external_templates is set. + * parse.y: Reflect changes in USE_TEMPLATE semantics. + * decl2.c: New flag flag_implicit_templates determines whether or + not implicit instantiations get emitted. This flag currently + defaults to true, and must be true for -fexternal-templates to work. + (finish_file): Consider flag_implement_inlines when + setting DECL_EXTERNAL. Consider flag_implicit_templates when + deciding whether or not to emit a static copy. + * decl.c (start_function): Set TREE_PUBLIC and DECL_EXTERNAL + properly for template instantiations. + (start_method): Set DECL_IMPLICIT_INSTANTIATION on methods of a + template class. + * cp-tree.h (CLASSTYPE_USE_TEMPLATE): Change semantics. + (DECL_USE_TEMPLATE): Parallel macro for FUNCTION and VAR_DECLs. + (various others): Accessor macros for the above. + +Fri May 27 13:57:40 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Division by constant zero is + an error. + +Fri May 27 13:50:15 1994 Mike Stump + + * class.c (override_one_vtable): Don't modify things we don't own. + +Fri May 27 01:42:58 1994 Jason Merrill + + * decl.c (finish_decl): Don't postpone processing the initializer of + a decl with DECL_EXTERNAL set, and do call rest_of_compilation for a + PUBLIC const at toplevel. + (grokdeclarator): pedwarn about initializing non-const or + non-integral statics in the class body. + + * decl.c (pushtag): Don't try to set DECL_CLASS_CONTEXT on a + TYPE_DECL. + + * call.c (convert_harshness): Dereference reference on rhs before + proceeding, properly grok passing const things to non-const + references. + + * typeck.c (build_unary_op): Soften error about taking the address + of main() to a pedwarn. + + * lex.c (default_copy_constructor_body): Unambiguously specify base + classes (i.e. A((const class ::A&)_ctor_arg) ). + (default_assign_ref_body): Likewise. + +Thu May 26 13:13:55 1994 Gerald Baumgartner + + * decl2.c (grokfield): Don't complain about local signature + method declaration without definition. + + * call.c (convert_harshness): If `type' is a signature pointer + and `parmtype' is a pointer to a signature, just return 0. We + don't really convert in this case; it's a result of making the + `this' parameter of a signature method a signature pointer. + + * call.c (build_method_call): Distinguish calling the default copy + constructor of a signature pointer/reference from a signature + member function call. + +Thu May 26 12:56:25 1994 Jason Merrill + + * decl2.c (grokfield): Don't set TREE_PUBLIC on member function + declarations. + + * decl.c (duplicate_decls): A previous function declaration as + static overrides a subsequent non-static definition. + (grokdeclarator): Don't set TREE_PUBLIC on inline method + declarations. + +Wed May 25 14:36:38 1994 Jason Merrill + + * decl.c (grokdeclarator): Handle initialization of static const + members. + (finish_decl): Likewise. + + * decl2.c (grokfield): Allow initialization of static const members + even when pedantic. + + * decl2.c (grokfield): Deal with grokdeclarator returning + error_mark_node. + + * decl.c (grok_ctor_properties): Return 0 for A(A) constructor. + (grokfndecl): Check the return value of grok_ctor_properties. + (start_method): Likewise. + + * parse.y (absdcl): Expand type_quals inline. + +Tue May 24 19:10:32 1994 Jason Merrill + + * decl.c (pushtag): Use IS_AGGR_TYPE rather than checking for a + RECORD_TYPE. + +Tue May 24 18:09:16 1994 Per Bothner + + * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, + always use "__vt_%s". + * decl2.c (finish_vtable_vardecl): Don't consider abstract virtuals + when looking for a "sentinal" method (to decide on emitting vtables). + * decl2.c (finish_file): Scan all decls for thunks that need + to be emitted. + * decl2.c (finish_vtable_vardecl): Don't bother calling emit_thunk. + * method.c (make_thunk): Use a more meaningful label. If there + exists a matching top-level THUNK_DECL re-use it; otherwise + create a new THUNK_DECL (and declare it). + * method.c (emit_thunk): Make thunk external/public depending + on the underlying method. + +Tue May 24 00:22:04 1994 Jason Merrill + + * pt.c (tsubst): Use lookup_name_nonclass to find guiding decls, not + lookup_name. + + * call.c (build_overload_call_real): Don't immediately pick a + function which matches perfectly. + + * decl.c (grokdeclarator): Use c_build_type_variant for arrays. + (grokdeclarator): Warn about, and throw away, cv-quals attached to a + reference (like 'int &const j'). + + * typeck.c (convert_arguments): Don't mess with i for methods. + * call.c (build_method_call): Pass the function decl to + convert_arguments. + + * typeck.c (comp_ptr_ttypes_real): New function. Implements the + checking for which multi-level pointer conversions are allowed. + (comp_target_types): Call it. + (convert_for_assignment): Check const parity on the ultimate target + type, too. And make those warnings pedwarns. + +Mon May 23 14:11:24 1994 Jason Merrill + + * error.c (dump_char): Use TARGET_* for character constants. + +Mon May 23 13:03:03 1994 Brendan Kehoe + + * tree.c (debug_no_list_hash): Make static. + + * decl.c (decls_match): Say the types don't match if newdecl ends up + with a null type, after we've checked if olddecl does. + (pushdecl): Check if the decls themselves match before looking for + an extern redeclared as static, to avoid inappropriate and incorrect + warnings. + +Fri May 20 14:04:34 1994 Jason Merrill + + * decl.c (grokdeclarator): Make warning about duplicate short, etc. + a pedwarn. + + * typeck.c (build_c_cast): Casting to function or method type is an + error. + + * class.c (finish_struct): Make warning for anonymous class with no + instances a pedwarn. + + * Makefile.in (stamp-parse): Expect a s/r conflict. + + * typeck.c (build_modify_expr): pedwarn about using a non-lvalue + cast as an lvalue. + +Thu May 19 12:08:48 1994 Jason Merrill + + * cvt.c (type_promotes_to): Make sure bool promotes to int rather + than unsigned on platforms where sizeof(char)==sizeof(int). + +Wed May 18 14:27:06 1994 Jason Merrill + + * typeck.c (build_c_cast): Tack on a NOP_EXPR when casting to + another variant. + (build_modify_expr): Don't strip NOP_EXPRs, and don't get tricky + and treat them as lvalues. + + * decl.c (shadow_tag): Do complain about forward declarations of + enums and empty declarations. + * parse.y: Don't complain about forward declarations of enums and + empty declarations. + + * typeck.c (convert_for_assignment): Complain about changing + the signedness of a pointer's target type. + + * parse.y (stmt): Move duplicated code for checking case values from + here. + * decl2.c (check_cp_case_value): To here. And add a call to + constant_expression_warning. + + * typeck.c (convert_for_assignment): Don't complain about assigning + a negative value to bool. + + * decl.c (init_decl_processing): Make bool unsigned. + + * class.c (finish_struct): Allow bool bitfields. + +Wed May 18 12:35:27 1994 Ian Lance Taylor + + * Make-lang.in (c++.install-man): Get g++.1 from $(srcdir)/cp. + +Wed May 18 03:28:35 1994 Jason Merrill + + * cvt.c (build_type_conversion): Lose special handling of + truthvalues. + + * search.c (dfs_pushdecls): Improve shadowing warning. + +Tue May 17 13:34:46 1994 Jason Merrill + + * init.c (build_delete): Throw away const and volatile on `this'. + + * decl.c (finish_enum): Put the constants in TYPE_VALUES again, + rather than the enumerators. + (pushtag): s/cdecl/c_decl/g + +Mon May 16 23:04:01 1994 Stephen R. van den Berg + + * cp/typeck.c (common_type): Attribute merging. + (comp_types): Utilize COMP_TYPE_ATTRIBUTES macro. + + * cp/parse.y: Revamp attribute parsing. + +Mon May 16 01:40:34 1994 Jason Merrill + + * decl.c (shadow_tag): Also check for inappropriate use of auto and + register. + + * method.c (build_overload_name): Clarify that the illegal case is a + pointer or reference to array of unknown bound. + + * error.c (dump_type_prefix): Print references to arrays properly. + + * typeck.c (various): Be more helpful in pointer + comparison diagnostics. + + * tree.c (lvalue_p): MODIFY_EXPRs are lvalues again. Isn't this + fun? + + * parse.y: Also catch an error after valid stmts. + + * search.c (dfs_init_vbase_pointers): Don't abort because `this' is + const. + + * typeck.c (convert_for_initialization): If call to + convert_to_reference generated a diagnostic, print out the parm + number and function decl if any. + + * errfn.c (cp_thing): Check atarg1 to determine whether or not we're + specifying a line, not atarg. + + * tree.c (build_cplus_method_type): Always make `this' const. + + * decl2.c (grokclassfn): If -fthis-is-variable and this function is + a constructor or destructor, make `this' non-const. + + * typeck.c (build_modify_expr): Don't warn specially about + assignment to `this' here anymore, since it will be caught by the + usual machinery. + + * various: Disallow specific GNU extensions (variable-size arrays, + etc.) when flag_ansi is set, not necessarily when pedantic is set, + so that people can compile with -pedantic-errors for tighter const + checking and such without losing desirable extensions. + + * typeck2.c (build_functional_cast): Call build_method_call with + LOOKUP_PROTECT. + (process_init_constructor): Only process FIELD_DECLs. + + * decl.c (finish_decl): Also force static consts with no explicit + initializer that need constructing into the data segment. + + * init.c (build_delete): Undo last patch, as it interferes with + automatic cleanups. + +Sat May 14 01:59:31 1994 Jason Merrill + + * call.c, class.h, cp-tree.h, cvt.c, decl2.c: Lose old overloading + code. + + * init.c (build_delete): pedwarn about using plain delete to delete + an array. + +Fri May 13 16:45:07 1994 Jason Merrill + + * typeck.c (comp_target_types): Be more helpful in contravariance + warnings, and make them pedwarns. + + * decl.c (grokdeclarator): Use decl_context to decide whether or not + this is an access declaration. + + * class.c (finish_struct_bits): Set TYPE_HAS_INT_CONVERSION if it + has a conversion to enum or bool, too. + +Fri May 13 16:31:27 1994 Mike Stump + + * method.c (emit_thunk): Make declaration for + current_call_is_indirect local (needed for hppa). + +Fri May 13 16:16:37 1994 Jason Merrill + + * pt.c (uses_template_parms): Grok BOOLEAN_TYPE. + (tsubst): Likewise. + +Fri May 13 16:23:32 1994 Mike Stump + + * pt.c (tsubst): If there is already a function for this expansion, + use it. + * pt.c (instantiate_template): Likewise. + +Fri May 13 10:30:42 1994 Brendan Kehoe + + * parse.y (implicitly_scoped_stmt, simple_stmt case): Use + kept_level_p for MARK_ENDS argument to expand_end_bindings, to avoid + generating debug info for unemitted symbols on some systems. + + * cp-tree.h (build_static_cast, build_reinterpret_cast, + build_const_cast): Add declarations. + +Fri May 13 09:50:31 1994 Mike Stump + + * search.c (expand_indirect_vtbls_init): Fix breakage from Apr 27 + fix. We now try get_binfo, and if that doesn't find what we want, + we go back to the old method, which still sometimes fails. + +Fri May 13 01:43:18 1994 Jason Merrill + + * parse.y (initdcl): Call cplus_decl_attributes on the right + variable. + * decl2.c (cplus_decl_attributes): Don't call decl_attributes for + void_type_node. + + * typeck.c (build_binary_op_nodefault): Change result_type for + comparison ops to bool. + (build_binary_op): Convert args of && and || to bool. + * cvt.c (build_default_binary_type_conversion): Convert args of && + and || to bool. + (build_default_unary_type_conversion): Convert arg of ! to bool. + (type_promotes_to): bool promotes to int. + +Fri May 13 01:43:18 1994 Mike Stump + + Implement the new builtin `bool' type. + * typeck.c (build_binary_op_nodefault): Convert args of && and || to + bool. + (build_unary_op): Convert arg of ! to bool. + * parse.y: Know true and false. Use bool_truthvalue_conversion. + * method.c (build_overload_value): Know bool. + (build_overload_name): Likewise. + * lex.c (init_lex): Set up RID_BOOL. + * gxx.gperf: Add bool, true, false. + * error.c (*): Know bool. + * decl.c (init_decl_processing): Set up bool, true, false. + * cvt.c (cp_convert): Handle conversion to bool. + (build_type_conversion): Likewise. + * *.c: Accept bool where integers and enums are accepted (use + INTEGRAL_CODE_P macro). + +Thu May 12 19:13:54 1994 Richard Earnshaw + + * g++.c: Use #ifdef for __MSDOS__, not #if. + +Thu May 12 18:05:18 1994 Mike Stump + + * decl2.c (lang_f_options): Handle -fshort-temps. -fshort-temps + gives old behavior , and destroys temporaries earlier. Default + behavior now conforms to the ANSI working paper. + +Thu May 12 14:45:35 1994 Jason Merrill + + * typeck.c (build_modify_expr): Understand MODIFY_EXPR as an lvalue. + Use convert_force to convert the result of a recursive call when we + are dealing with a NOP_EXPR. Don't automatically wrap MODIFY_EXPRs + in COMPOUND_EXPRs any more. + (various): Lose pedantic_lvalue_warning. + (unary_complex_lvalue): Understand MODIFY_EXPR. + + * cvt.c (convert_to_reference): Allow DECL to be error_mark_node if + we don't know what we're initializing. + +Wed May 11 01:59:36 1994 Jason Merrill + + * cvt.c (convert_to_reference): Modify to use convtype parameter. + Only create temporaries when initializing a reference, not when + casting. + (cp_convert): New main function. + (convert): Call cp_convert. + * cvt.c, decl.c, typeck.c: Fix calls to convert_to_reference. + * cp-tree.h (CONV_*): New constants used by conversion code for + selecting conversions to perform. + + * tree.c (lvalue_p): MODIFY_EXPRs are no longer lvalues. + + * typeck.c (build_{static,reinterpret,const_cast): Stubs that just + call build_c_cast. + * parse.y: Add {static,reinterpret,const}_cast. + * gxx.gperf: Likewise. + + * typeck.c (common_type): Allow methods with basetypes of different + UPTs. + (comptypes): Deal with UPTs. + (build_modify_expr): Wrap all MODIFY_EXPRs in a COMPOUND_EXPR. + + * pt.c (end_template_decl): Check for multiple definitions of member + templates. + + * call.c (build_method_call): Complain about calling an abstract + virtual from a constructor. + + * typeck.c (pointer_int_sum): Check for the integer operand being 0 + after checking the validity of the pointer operand. + + * typeck2.c (digest_init): Pedwarn about string initializer being + too long. + +Tue May 10 12:10:28 1994 Jason Merrill + + * decl.c (push_overloaded_decl): Only throw away a builtin if the + decl in question is the artificial one. + + * parse.y (simple_stmt, switch): Use implicitly_scoped_stmt because + expand_{start,end}_case cannot happen in the middle of a block. + + * cvt.c (build_type_conversion_1): Use convert again. + +Tue May 10 11:52:04 1994 Brendan Kehoe + + * typeck2.c (digest_init): Make sure we check for signed and + unsigned chars as well when warning about string initializers. + + * init.c (emit_base_init): Check if there's a DECL_NAME on the + member before trying to do an initialization for it. + +Tue May 10 11:34:37 1994 Mike Stump + + * except.c: Don't do anything useful when cross compiling. + +Tue May 10 03:04:13 1994 Jason Merrill + + * decl.c (duplicate_decls): Fix up handling of builtins yet again. + (push_overloaded_decl): Likewise. + + * cvt.c (convert): Don't look for void type conversion. + +Mon May 9 18:05:41 1994 Jason Merrill + + * init.c (do_friend): Only do a pushdecl for friends, not + pushdecl_top_level. + +Mon May 9 13:36:34 1994 Jim Wilson + + * decl.c (lookup_name_current_level): Put empty statement after + the label OUT to make the code valid C. + +Mon May 9 12:20:57 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Only complain about + comparing void * and a function pointer if void * is smaller. + +Sun May 8 01:29:13 1994 Jason Merrill + + * decl.c (lookup_name_current_level): Move through temporary binding + levels. + + * parse.y (already_scoped_stmt): Revive. + (simple_stmt): Use it again. + + * decl.c (poplevel): Always call poplevel recursively if we're + dealing with a temporary binding level. + +Sat May 7 10:52:28 1994 Mike Stump + + * decl.c (finish_decl): Make sure we run cleanups for initial values + of decls. Cures memory leak. + * decl.c (expand_static_init): Likewise for static variables. + * decl2.c (finish_file): Likewise for globals. + +Sat May 7 03:57:44 1994 Jason Merrill + + * typeck.c (commonparms): Don't complain about redefining default + args. + + * decl.c (duplicate_decls): Don't complain twice about conflicting + function decls. + (decls_match): Don't look at default args. + (redeclaration_error_message): Complain about redefining default + args. + + * call.c (build_overload_call_real): Also deal with guiding + declarations coming BEFORE the template decl. + + * pt.c (unify): Allow different parms to have different + cv-qualifiers. + (unify): Allow trivial conversions on non-template parms. + +Fri May 6 03:53:23 1994 Jason Merrill + + * pt.c (tsubst): Support OFFSET_TYPEs. + (unify): Likewise. + + * decl2.c (finish_decl_parsing): Call push_nested_class with a type. + + * init.c (build_offset_ref): Fix error message. + * search.c (lookup_field): Likewise. + + * call.c (build_scoped_method_call): Pass binfo to + build_method_call. + * typeck.c (build_object_ref): Likewise. + + * typeck2.c (binfo_or_else): Don't return a _TYPE. + + * class.c (finish_struct): Don't complain about re-use of inherited + names or shadowing of type decls. + * decl.c (pushdecl_class_level): Likewise. + + * decl.c (finish_enum): Set the type of all the enums. + + * class.c (finish_struct): Don't get confused by access decls. + + * cp-tree.h (TYPE_MAIN_DECL): New macro to get the _DECL for a + _TYPE. You can stop using TYPE_NAME for that now. + + * parse.y: Lose doing_explicit (check $0 instead). + * gxx.gperf: 'template' now has a RID. + * lex.h (rid): Likewise. + * lex.c (init_lex): Set up the RID for 'template'. + + * parse.y (type_specifier_seq): typed_typespecs or + nonempty_type_quals. Use it. + (handler_args): Fix bogus syntax. + (raise_identifier{,s}, optional_identifier): Lose. + * except.c (expand_start_catch_block): Use grokdeclarator to parse + the catch variable. + (init_exception_processing): The second argument to + __throw_type_match is ptr_type_node. + + Fri May 6 07:18:54 1994 Chip Salzenberg + + [ change propagated from c-decl.c of snapshot 940429 ] + * cp/decl.c (finish_decl): Setting asmspec_tree should not + zero out the old RTL. + +Fri May 6 01:25:38 1994 Mike Stump + + Add alpha exception handling support to the compiler. + Quick and dirty backend in except.c. + + * cp/*: Remove most remnants of old exception handling support. + * decl.c (finish_function): Call expand_exception_blocks to put + the exception hanlding blocks at the end of the function. + * dec.c (hack_incomplete_structures): Make sure expand_decl_cleanup + comes after expand_decl_init. + * except.c: Reimplementation. + * expr.c (cplus_expand_expr): Handle THROW_EXPRs. + * lex.c (init_lex): Always have catch, try and throw be reserved + words, so that we may always parse exception handling. + * parse.y: Cleanup to support new interface into exception handling. + * tree.def (THROW_EXPR): Add. + +Thu May 5 17:35:37 1994 Jason Merrill + + * parse.y (simple_stmt, for loops): Use implicitly_scoped_stmt. + (various): Lose .kindof_pushlevel and partially_scoped_stmt. + +Thu May 5 16:17:27 1994 Kung Hsu + + * parse.y (already_scoped_stmt): Move expand_end_binding() to + fix the unmatched LBB/LBE in stabs. + +Thu May 5 14:36:17 1994 Jason Merrill + + * decl.c (set_nested_typename): Set TREE_MANGLED on the new + identifiers. + (pushdecl): Check TREE_MANGLED. + (xref_tag): Likewise. + * cp-tree.h (TREE_MANGLED): This identifier is a + DECL_NESTED_TYPENAME (named to allow for future use to denote + mangled function names as well). + + Implement inconsistency checking specified in [class.scope0]. + * decl.c (lookup_name_real): Don't set ICV here after all. + (finish_enum): Also set the type of the enumerators themselves. + (build_enumerator): Put the CONST_DECL in the list instead of its + initial value. + (pushdecl_class_level): Check inconsistent use of a name in the + class body. + * class.c (finish_struct): Check inconsistent use of a name in the + class body. Don't set DECL_CONTEXT on types here anymore. + * parse.y (qualified_type_name): Note that the identifier has now + been used (as a type) in the class body. + * lex.c (do_identifier): Note that the identifier has now been used + (as a constant) in the class body. + * error.c (dump_decl): Print type and enum decls better. + +Thu May 5 09:35:35 1994 Brendan Kehoe + + * typeck.c (build_modify_expr): Warn about assignment to `this'. + +Wed May 4 15:55:49 1994 Jason Merrill + + * init.c (build_delete): Use the global operator delete when + requested. + + * decl.c (lookup_name_real): If we find the type we're looking in a + base class while defining a class, set IDENTIFIER_CLASS_VALUE for + the type. + + * class.c (finish_struct): Remove a couple of dependencies on + language linkage. + + * decl.c (pushtag): Classes do nest in extern "C" blocks. + (pushdecl): Only set DECL_NESTED_TYPENAME on the canonical one for + the type. + (pushtag): Remove another dependency on the language linkage. + + * lex.c (cons_up_default_function): Don't set DECL_CLASS_CONTEXT to + a const-qualified type. + + * decl.c (push_overloaded_decl): Throw away built-in decls here. + (duplicate_decls): Instead of here. + +Wed May 4 15:27:40 1994 Per Bothner + + * typeck.c (get_member_function_from_ptrfunc): Do The Right + Thing (I hope) if we're using thunks. + +Wed May 4 13:52:38 1994 Jason Merrill + + * parse.y (specialization): aggr template_type_name ';'. + (named_class_head_sans_basetype): Use it. + (explicit_instantiation): Likewise. + (tmpl.2): Revert. + + * cvt.c (build_type_conversion_1): Use convert_for_initialization, + rather than convert, to do conversions after the UDC. + + * cp-tree.h (SHARED_MEMBER_P): This member is shared between all + instances of the class. + + * search.c (lookup_field): If the entity found by two routes is the + same, it's not ambiguous. + +Wed May 4 12:10:00 1994 Per Bothner + + * decl.c (lookup_name_real): Check for a NULL TREE_VALUE, + to prevent the compiler from crashing ... + +Wed May 4 11:19:45 1994 Jason Merrill + + * call.c (build_method_call): If we don't have an object, check + basetype_path to figure out where to look up the function. + + * typeck.c (convert_for_initialization): Pass TYPE_BINFO (type) to + build_method_call in case exp is NULL_TREE. + +Tue May 3 16:02:53 1994 Per Bothner + + Give a vtable entries a unique named type, for the sake of gdb. + * class.c (build_vtable_entry): The address of a thunk now has + type vtable_entry_type, not ptr_type_node. + * method.c (make_thunk): Fix type of THUNK_DECL. + * class.c (add_virtual_function, override_one_vtable): Use + vfunc_ptr_type_node, instead of ptr_type_node. + * cp-tree.h (vfunc_ptr_type_node): New macro. + * decl.c (init_decl_processing): Make vtable_entry_type + be a unique type of pointer to a unique function type. + +Tue May 3 09:20:44 1994 Jason Merrill + + * parse.y (do_explicit): Sets doing_explicit to 1. + (explicit_instantiation): Use do_explicit rather than TEMPLATE + directly, add "do_explicit error" rule. + (datadef): Set doing_explicit to 0 after an explicit instantiation. + (tmpl.2): Don't instantiate if we see a ';' unless we're doing an + explicit instantiation. + (named_class_head_sans_basetype): Remove aggr template_type_name + ';' again. + +Mon May 2 23:17:21 1994 Jason Merrill + + * search.c (lookup_nested_tag): Lose. + + * decl2.c (grokfield): Set DECL_CONTEXT on TYPE_DECLs. + (lookup_name_nonclass): Lose. + + * decl.c (poplevel_class): Add force parameter. + (lookup_name_real): Fix handling of explicit scoping which specifies + a class currently being defined. Add 'nonclass' argument. + (lookup_name, lookup_name_nonclass): Shells for lookup_name_real. + + * class.c (finish_struct): Don't unset IDENTIFIER_CLASS_VALUEs here. + (popclass): Force clearing of IDENTIFIER_CLASS_VALUEs if we're being + called from finish_struct. + +Mon May 2 19:06:21 1994 Per Bothner + + * decl.c (init_decl_processing), cp-tree.h: Removed memptr_type. + (It seeems redundant, given build_ptrmemfunc_type.) + * typeck.c (get_member_function_from_ptrfunc), gc.c (build_headof, + build_classof): Use vtable_entry_type instead of memptr_type. + * method.c (emit_thunk): Call poplevel with functionbody==0 + to prevent DECL_INITIAL being set to a BLOCK. + +Mon May 2 15:02:11 1994 Jason Merrill + + * parse.y (named_class_head_sans_basetype): Add "aggr + template_type_name ';'" rule for forward declaration of + specializations. + +Mon May 2 15:02:11 1994 Jason Merrill + + * class.c (instantiate_type): Deal with pmf's. + + * Make-lang.in (cc1plus): Don't depend on OBJS or BC_OBJS, since + stamp-objlist does. + + * Makefile.in (../cc1plus): Depend on OBJDEPS. + (OBJDEPS): Dependency version of OBJS. + +Mon May 2 12:51:31 1994 Kung Hsu + + * search.c (dfs_debug_mark): Unmark TYPE_DECL_SUPPRESS_DEBUG, not + DECL_IGNORED_P. + +Fri Apr 29 12:29:56 1994 Jason Merrill + + * class.c (finish_struct): Clear out memory of local tags. And + typedefs. + + * decl2.c (grokclassfn): Don't set DECL_CONTEXT to a cv-qualified + type. + * search.c (get_matching_virtual): Be more helpful in error message. + + * *: Use DECL_ARTIFICIAL (renamed from DECL_SYNTHESIZED). + + * lex.c (default_assign_ref_body): Expect TYPE_NESTED_NAME to work. + (default_copy_constructor_body): Likewise. + + * class.c (finish_struct): Don't gratuitously create multiple decls + for nested classes. + +Thu Apr 28 23:39:38 1994 Jason Merrill + + Avoid clobbering the arg types of other functions when reverting + static member functions. + * decl.c (revert_static_member_fn): Rearrange arguments, don't + require values for 'fn' and 'argtypes', add warning to comment + above. + (decls_match): Rearrange arguments in call to rsmf. + (grok_op_properties): Don't pass values for fn and argtypes. + * pt.c (instantiate_template): Don't pass values for fn and argtypes. + +Thu Apr 28 16:29:11 1994 Doug Evans + + * Make-lang.in (cc1plus): Depend on stamp-objlist. + * Makefile.in (BC_OBJS): Delete. + (OBJS): Cat ../stamp-objlist to get language independent files. + Include ../c-common.o. + (../cc1plus): Delete reference to BC_OBJS. + +Thu Apr 28 02:12:08 1994 Jason Merrill + + * search.c (compute_access): No really, deal with static members + properly. Would I lie to you? + + Implement lexical hiding of function declarations. + * pt.c (tsubst): Use lookup_name to look for function decls to guide + instantiation. + * method.c (build_opfncall): Use lookup_name_nonclass to look for + non-member functions. + * init.c (do_friend): Use lookup_name_nonclass to look for + functions. + * error.c (ident_fndecl): Use lookup_name to look for functions. + * decl2.c (lookup_name_nonclass): New function, skips over + CLASS_VALUE. + * decl.c (struct binding_level): Lose overloads_shadowed field. + (poplevel): Don't deal with overloads_shadowed. + (push_overloaded_decl): Do lexical hiding for functions. + * class.c (instantiate_type): Don't check non-members if we have + members with the same name. + * call.c (build_method_call): Use lookup_name_nonclass instead of + IDENTIFIER_GLOBAL_VALUE to check for non-member functions. + (build_overload_call_real): Likewise. + + * decl.c (duplicate_decls): Check for ambiguous overloads here. + (push_overloaded_decl): Instead of here. + + * decl.c (pushdecl): Back out Chip's last change. + + * decl.c (grok_op_properties): Operators cannot be static members. + + * cp-tree.h (DECL_SYNTHESIZED): DECL_SOURCE_LINE == 0 + (SET_DECL_SYNTHESIZED): DECL_SOURCE_LINE = 0 + * lex.c (cons_up_default_function): Use SET_DECL_SYNTHESIZED. + + * method.c (do_inline_function_hair): Don't put friends of local + classes into global scope, either. + + * typeck2.c (build_functional_cast): Don't look for a function call + interpretation. + +Thu Apr 28 15:19:46 1994 Mike Stump + + * cp-tree.h: Disable use of backend EH. + +Wed Apr 27 21:01:24 1994 Doug Evans + + * Make-lang.in (c++.distdir): mkdir tmp/cp first. + * Makefile.in (INCLUDES): Move definition to same place as + parent makefile. + (ALLOCA): Define. + (OLDAR_FLAGS): Delete. + (OLDCC): Define. + (DIR): Delete. + (CLIB): Define. + (####site): Delete. + (SUBDIR_USE_ALLOCA): Don't use ALLOCA if compiling with gcc. + +Wed Apr 27 19:10:04 1994 Kung Hsu + + * decl.c (xref_tag): Not to use strstr(), it's not available on + all platforms. + +Wed Apr 27 18:10:12 1994 Jason Merrill + + * class.c (finish_struct): Resolve yet another class/pmf confusion. + + * call.c (build_overload_call_real): Don't take the single-function + shortcut if we're dealing with an overloaded operator. + +Wed Apr 27 17:35:37 1994 Mike Stump + + * search.c (get_base_distance): Search the virtual base class + binfos, incase someone wants to convert to a real virtual base + class. + * search.c (expand_indirect_vtbls_init): Use convert_pointer_to_real + instead of convert_pointer_to, as it now will work. + +Wed Apr 27 15:36:49 1994 Jason Merrill + + * cvt.c (convert_to_reference): Don't complain about casting away + const and volatile. + + * typeck.c (build_unary_op): References are too lvalues. + +Wed Apr 27 13:58:05 1994 Mike Stump + + * class.c (override_one_vtable): We have to prepare_fresh_vtable + before we modify it, not after, also, we cannot reuse an old vtable, + once we commit to a new vtable. Implement ambiguous overrides in + virtual bases as abstract. Hack until we make the class + ill-formed. + +Wed Apr 27 01:17:08 1994 Jason Merrill + + * parse.y (unary_expr): Expand new_placement[opt] and + new_initializer[opt] inline. + + * search.c (lookup_fnfields): Don't throw away the inheritance + information here, either. + (compute_access): Handle static members properly. + + * init.c (build_member_call): Always set basetype_path, and pass it + to lookup_fnfields. + + * search.c (lookup_field): Deal properly with the case where + xbasetype is a chain of binfos; don't throw away the inheritance + information. + (compute_access): protected_ok always starts out at 0. + + * init.c (resolve_offset_ref): Don't cast `this' to the base type + until we've got our basetype_path. + + * cp-tree.h (IS_OVERLOAD_TYPE): aggregate or enum. + + * cvt.c (build_up_reference): Use build_pointer_type rather than + TYPE_POINTER_TO. + + * call.c (convert_harshness_ansi): Call type_promotes_to for reals + as well. + + * cvt.c (type_promotes_to): Retain const and volatile, add + float->double promotion. + + * decl.c (grokdeclarator): Don't bash references to arrays into + references to pointers in function parms. Use type_promotes_to. + +Tue Apr 26 23:44:36 1994 Mike Stump + + Finish off Apr 19th work. + + * class.c (finish_struct_bits): Rename has_abstract_virtuals to + might_have_abstract_virtuals. + * class.c (strictly_overrides, override_one_vtable, + merge_overrides): New routines to handle virtual base overrides. + * class.c (finish_struct): Call merge_overrides to handle overrides + in virtual bases. + +Tue Apr 26 12:45:53 1994 Jason Merrill + + * typeck.c (build_function_call): Call build_function_call_real with + LOOKUP_NORMAL. + + * *: Don't deal with TYPE_EXPRs. + + * tree.c (lvalue_p): If the type of the expression is a reference, + it's an lvalue. + + * cvt.c (convert_to_reference): Complain about passing const + lvalues to non-const references. + (convert_from_reference): Don't arbitrarily throw away const and + volatile on the target type. + + * parse.y: Simplify and fix rules for `new'. + + * decl.c (grok_op_properties): operator void is illegal. + +Mon Apr 25 02:36:28 1994 Jason Merrill + + * parse.y (components): Anonymous bitfields can still have declspecs. + + * decl.c (pushdecl): Postpone handling of function templates like we + do C functions. + + * search.c (expand_indirect_vtbls_init): Fix infinite loop when + convert_pointer_to fails. + + * call.c (compute_conversion_costs_ansi): A user-defined conversion + by itself is better than that UDC followed by standard conversions. + Don't treat integers and reals specially. + + * cp-tree.h: Declare flag_ansi. + + * typeck.c (c_expand_return): pedwarn on return in void function + even if the expression is of type void. + (build_c_cast): Don't do as much checking for casts to void. + (build_modify_expr): pedwarn about array assignment if this code + wasn't generated by the compiler. + + * tree.c (lvalue_p): A comma expression is an lvalue if its second + operand is. + + * typeck.c (default_conversion): Move code for promoting enums and + ints from here. + * cvt.c (type_promotes_to): To here. + * call.c (convert_harshness_ansi): Use type_promotes_to. Also fix + promotion semantics for reals. + +Sun Apr 24 16:52:51 1994 Doug Evans + + * Make-lang.in (c++.install-common): Check for g++-cross. + * Makefile.in: Remove Cygnus cruft. + (config.status): Delete. + (RTL_H): Define. + (TREE_H): Use complete pathname, some native makes have minimal + VPATH support. + (*.o): Use complete pathname to headers in parent dir. + (doc, info, dvi): Delete. + +Sun Apr 24 16:52:51 1994 Doug Evans + + * Make-lang.in (c++.install-common): Check for g++-cross. + * Makefile.in: Remove Cygnus cruft. + (config.status): Delete. + (RTL_H): Define. + (TREE_H): Use complete pathname, some native makes have minimal + VPATH support. + (*.o): Use complete pathname to headers in parent dir. + (doc, info, dvi): Delete. + +Sun Apr 24 00:47:49 1994 Jason Merrill + + * decl.c (pushdecl): Avoid redundant warning on redeclaring function + with different return type. + (decls_match): Compare return types strictly. + +Fri Apr 22 12:55:42 1994 Jason Merrill + + * cvt.c (build_type_conversion): Do try to convert through other + pointers. This will fail if the class defines multiple pointer + conversions. + + * error.c (dump_type_prefix): Print out pointers to arrays properly. + (dump_type_suffix): Likewise. (was 'int *[]', now 'int (*)[]') + + * typeck.c (build_unary_op): Disallow ++/-- on pointers to + incomplete type. + + * decl.c (duplicate_decls): Check mismatched TREE_CODES after + checking for shadowing a builtin. If we're redeclaring a builtin + function, bash the old decl to avoid an ambiguous overload. + + * cvt.c (convert_to_reference): Don't force arrays to decay here. + + * tree.c (lvalue_p): A MODIFY_EXPR is an lvalue. + + * decl.c (duplicate_decls): Don't assume that the decls will have + types. + + Mon Apr 18 11:35:32 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940318 snapshot ] + * c-decl.c (pushdecl): Warn if type mismatch with another external decl + in a global scope. + + Fri Apr 22 06:38:56 1994 Chip Salzenberg + + * cp/typeck2.c (signature_error): Use cp_error for "%T". + + Mon Apr 18 11:59:59 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940415 snapshot ] + * cp/decl.c (duplicate_decls, pushdecl, builtin_function): + Use DECL_FUNCTION_CODE instead of DECL_SET_FUNCTION_CODE. + + Mon Apr 18 11:55:18 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940409 snapshot ] + * cp/decl.c (duplicate_decls): Put new type in same obstack as + old ones, or permanent if old ones in different obstacks. + + Mon Apr 18 11:48:49 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940401 snapshot ] + * cp/parse.y (attrib): Handle string args as expressions, + merging the two rules. `mode' attribute now takes a string arg. + Delete the rule for an identifier as arg. + + Mon Apr 18 11:24:00 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940312 snapshot ] + * cp/typeck.c (pointer_int_sum): Multiplication should be done signed. + (pointer_diff): Likewise the division. + + Sun Mar 6 19:43:39 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940304 snapshot ] + * cp/decl.c (finish_decl): Issue warning for large objects, + if requested. + + Sat Feb 19 22:20:32 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940218 snapshot ] + * cp/parse.y (attrib): Handle attribute ((section ("string"))). + * cp/decl.c (duplicate_decls): Merge section name into new decl. + + Tue Feb 8 09:49:17 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940206 snapshot ] + * cp/typeck.c (signed_or_unsigned_type): Check for any + INTEGRAL_TYPE_P not just INTEGER_TYPE. + + Mon Dec 6 13:35:31 1993 Norbert Kiesel + + * cp/decl.c (finish_enum): Start from 0 when determining precision + for short enums. + + Fri Dec 3 17:07:58 1993 Ralph Campbell + + * cp/parse.y (unary_expr): Look at $1 for tree_code rather than + casting $$. + + Wed Nov 17 19:22:09 1993 Chip Salzenberg + + * cp/typeck.c (build_binary_op_nodefault): Propagate code + from C front-end to optimize unsigned short division. + (build_conditional_expr): Fix bug in "1 ? 42 : (void *) 8". + + Wed Nov 17 19:17:18 1993 Chip Salzenberg + + * cp/call.c (convert_harshness_ansi): Given an (e.g.) char + constant, prefer 'const char &' to 'int'. + + Wed Feb 3 13:11:48 1993 Chip Salzenberg + + * cp/class.c (finish_struct_methods): Handle multiple + constructors in fn_fields list. + +Fri Apr 22 12:48:10 1994 Kung Hsu + + * class.c (finish_struct): Use TYPE_DECL_SUPPRESS_DEBUG to flag + types not to be dumped in stabs, like types in #pragma interface. + * decl.c (init_decl_processing): Use TYPE_DECL_SUPPRESS_DEBUG to + mark unknown type. + +Fri Apr 22 03:27:26 1994 Doug Evans + + * Language directory reorganization. + See parent makefile. + +Thu Apr 21 18:27:57 1994 Per Bothner + + * cp-tree.h (THUNK_DELTA): It is normally negative, so + use signed .i variant of frame_size rather than unsigned .u. + * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, + use "VT" rather than "vt" due to binary incompatibility. + * class.c (get_vtable_name): Use strlen of VTABLE_NAME_FORMAT, + rather than sizeof, since it is now an expression. + * class.c (modify_one_vtable): Modify to skip initial element + containing a count of the vtable. + +Thu Apr 21 00:09:02 1994 Jason Merrill + + * lex.c (check_newline): Force interface_unknown on main input file. + + * pt.c (do_pending_expansions): Always emit functions that have been + explicitly instantiated. + (do_function_instantiation): Set DECL_EXPLICITLY_INSTANTIATED. + (do_type_instantiation): Set CLASSTYPE_VTABLE_NEEDS_WRITING and + DECL_EXPLICITLY_INSTANTIATED on all my methods. + * parse.y (explicit_instantiation): Call do_type_instantiation for + types. + * decl2.c (finish_vtable_vardecl): Call import_export_vtable. + * decl.c (start_function): Don't set DECL_EXTERNAL on a function + that has been explicitly instantiated. + * cp-tree.h (DECL_EXPLICITLY_INSTANTIATED): Alias for + DECL_LANG_FLAG_4. + * class.c: Move import_export_vtable to decl2.c, and comment out all + uses. + +Wed Apr 20 16:51:06 1994 Jason Merrill + + * lex.c (process_next_inline): Don't muck with DECL_INLINE. + (do_pending_inlines): Likewise. + +Tue Apr 19 22:25:41 1994 Mike Stump + + Reimplement vtable building, and most vtable pointer setting. + Allows for earier maintenance, easier understandability, and most + importantly, correct semantics. + + * class.c (build_vtable): Removed unneeded + SET_BINFO_VTABLE_PATH_MARKED. + * class.c (prepare_fresh_vtable): Likewise. Added argument. + * class.c (modify_vtable_entry): General cleanup. + * class.c (related_vslot, is_normal, modify_other_vtable_entries, + modify_vtable_entries): Removed. + * class.c (add_virtual_function): General cleanup. + * class.c (finish_base_struct): Setup BINFO_VTABLE and + BINFO_VIRTUALS as early as we can, so that modify_all_vtables can + work. + * class.c (finish_vtbls): New routine, mostly from + unmark_finished_struct. + * class.c (overrides): New routine. + * class.c (modify_one_vtable): New routine, mostly from + modify_other_vtable_entries and modify_vtable_entries. + * class.c (modify_all_direct_vtables, modify_all_indirect_vtables, + modify_all_vtables): New routines. + * class.c (finish_struct): Added arguemnt to prepare_fresh_vtable + call. General cleanup on how pending_hard_virtuals are handled. + General cleanup on modifying vtables. Use finish_vtbls, instead of + unmark_finished_struct. + * cp-tree.h (init_vtbl_ptrs, expand_direct_vtbls_init, + get_first_matching_virtual, get_matching_virtual, + expand_vbase_vtables_init, expand_indirect_vtbls_init): Update. + * cvt.c (convert_pointer_to_real): Cleanup error message. + * decl.c (grokfndecl): General cleanup. + * decl.c (finish_function): Change init_vtbl_ptrs call to + expand_direct_vtbls_init. Change expand_vbase_vtables_init call to + expand_indirect_vtbls_init. + * init.c (expand_virtual_init): Remove unneeded argument. + * init.c (init_vtbl_ptrs): Rename to expand_direct_vtbls_init, added + two arguments to make more general. Made more general. Now can be + used for vtable pointer initialization from virtual bases. + * init.c (emit_base_init): Change expand_vbase_vtables_init call to + expand_indirect_vtbls_init. Change init_vtbl_ptrs call to + expand_direct_vtbls_init. + * init.c (expand_virtual_init): General cleanup. + * init.c (expand_default_init): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * init.c (expand_recursive_init_1): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * init.c (expand_recursive_init): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * search.c (get_first_matching_virtual): Rename to + get_matching_virtual. General cleanup and remove setting of + DECL_CONTEXT. That is now done in a cleaner way in + modify_vtable_entry and add_virtual_function. + * search.c (expand_vbase_vtables_init): Rename to + expand_indirect_vtbls_init. General cleanup. Use + expand_direct_vtbls_init to do hard work. Ensures that _all_ vtable + pointers from virtual bases are set up. + * search.c (bfs_unmark_finished_struct, unmark_finished_struct): + Removed. + + * *.[chy]: Remove support for VTABLE_USES_MASK. + +Tue Apr 19 12:51:59 1994 Jason Merrill + + * cvt.c (convert_to_reference): Use NOP_EXPRs to switch between + reference and pointer types instead of bashing the types directly. + + * call.c (build_overload_call_real): Use the TREE_CODE to determine + whether the function is overloaded or not, rather than + TREE_OVERLOADED. + * *: Remove all uses of TREE_OVERLOADED. + + * decl.c (grokdeclarator): Only complain about initializing const + fields when -ansi or -pedantic. + +Tue Apr 19 12:42:42 1994 Doug Evans + + * cp-tree.h (THUNK_DELTA): frame_size is now a union. + +Mon Apr 18 00:17:13 1994 Jason Merrill + + Do overloading on a block-by-block basis, not function-by-function. + * decl.c: Lose overloads_to_forget. + (struct binding_level): Add overloads_shadowed field. + (poplevel): Restore overloads_shadowed. + (push_overloaded_decl): Use overloads_shadowed instead of + overloads_to_forget. + (finish_function): Don't look at overloads_to_forget. + + Copy enum_overflow logic from c-decl.c. + * decl.c (start_enum): Initialize enum_overflow. + (build_enumerator): Use enum_overflow. Also use current_scope(). + + * search.c (current_scope): Move Brendan's comment from + build_enumerator here. + + * typeck.c (convert_for_assignment): Change warnings to pedwarns for + discarding const/volatile. + +Sat Apr 16 01:18:21 1994 Jason Merrill + + * typeck.c (comp_target_parms): Accept TEMPLATE_TYPE_PARMs on the rhs. + (comp_target_types): Likewise. + + * decl.c (lookup_name): Don't unset got_scope here. + + * spew.c (yylex): Only replace yylval with the TYPE_NESTED_NAME if + got_scope != NULL_TREE. + +Fri Apr 15 16:36:33 1994 Jason Merrill + + Horrible kludge to prevent templates from being instantiated by + their base classes. + * parse.y (template_instantiate_once): Unset TYPE_BEING_DEFINED + before we get to left_curly. + * pt.c (instantiate_class_template): Set TYPE_BEING_DEFINED. + + * error.c (dump_decl): If it's a typedef, print out the name of the + decl, not just the underlying type. + + * decl.c (pushdecl): If the old duplicate decl was a TYPE_DECL, + update the IDENTIFIER_TYPE_VALUE of its name. + + * decl2.c (finish_file): When processing the initializer for a + static member, pretend that the dummy function is a member of the + same class. + +Fri Apr 15 15:56:35 1994 Kung Hsu + + * class.c (build_vtable_entry): Revert Apr 4 change. + * decl2.c (mark_vtable_entries): Replace pure virtual function + decl with abort's. + +Fri Apr 15 13:49:33 1994 Jason Merrill + + * typeck.c (build_conditional_expr): Pedwarn on pointer/integer + mismatch, and don't pedwarn on 0/function pointer mismatch. + + * typeck2.c (digest_init): Lose code for special handling of unions. + (process_init_constructor): Since they're handled just fine here. + Pedwarn on excess elements. + + * decl2.c (grokfield): Complain about local class method declaration + without definition. + +Fri Apr 15 13:19:40 1994 Per Bothner + + * method.c (emit_thunk): Add extern declaration for + current_call_is_indirect (needed for hppa). + +Thu Apr 14 16:12:31 1994 Jason Merrill + + Improve local class support; allow classes in different blocks to + have the same name. + * decl.c (pushtag): Support local classes better. + (pushdecl_nonclass_level): New function for pushing mangled decls of + nested types into the appropriate scope. + (xref_defn_tag): Use pushdecl_nonclass_level instead of + pushdecl_top_level. + (grokfndecl): Don't mess with IDENTIFIER_GLOBAL_VALUE for local + class methods. + * method.c (do_inline_function_hair): Likewise. + + * class.c (finish_struct): It is legal for a class with no + constructors to have nonstatic const and reference members. + +Thu Apr 14 07:15:11 1994 Brendan Kehoe + + * decl.c (push_overloaded_decl): Avoid giving errors about + built-ins, since duplicate_decls will have given warnings/errors + for them. + +Thu Apr 14 03:45:12 1994 Jason Merrill + + * cvt.c (convert_to_reference): Warn about casting pointer type to + reference type when this is probably not what they wanted. + +Wed Apr 13 13:12:35 1994 Per Bothner + + * decl.c (finish_decl): Don't mindlessly set TREE_USED for + static consts any more (toplev.c has now been modified to + not emit warnings if they are unused). + +Wed Apr 13 00:22:35 1994 Jason Merrill + + * decl.c (grok_op_properties): If op new/delete get here with + METHOD_TYPEs, do a revert_static_member_fn. + + * cp-tree.h (IDENTIFIER_CLASS_TYPE_VALUE): Lose. + * init.c (is_aggr_typedef): Don't look at + IDENTIFIER_CLASS_TYPE_VALUE. + (get_aggr_from_typedef): Likewise. + (get_type_value): Likewise. + * call.c (build_scoped_method_call): Don't rely on overloaded + template names having IDENTIFIER_CLASS_VALUE set. + + * parse.y (component_decl_1, fn.def2): Revert rules for + constructors. + (component_decl_1, fn.def2): Use $1 instead of $$, since $$ is being + clobbered. + + * decl.c (start_function): Only warn about `void main()' if pedantic + || warn_return_type. + +Tue Apr 12 02:14:17 1994 Jason Merrill + + Clean up overloading of the template name. + * class.c (pushclass): Overload the template name whenever pushing + into the scope of a template class, not just if it is + uninstantiated. + (popclass): Correspondingly. + * search.c (push_class_decls): Don't overload_template_name. + * pt.c (overload_template_name): Don't set IDENTIFIER_LOCAL_VALUE or + DECL_CONTEXT on things. + * parse.y (left_curly): Don't overload_template_name. + * class.c (finish_struct): Don't undo_template_name_overload. + + * method.c (build_opfncall): Only pass one argument to global op + delete. + + * call.c (build_method_call): Use TYPE_VEC_DELETE_TAKES_SIZE to + decide how many arguments to use for vec delete. + + * decl.c (grok_op_properties): Be consistent in modifying + current_class_type. + (grokdeclarator): Only complain about function decls with no return + type if we're being pedantic. + +Mon Apr 11 00:10:53 1994 Jason Merrill + + Add support for operator new [] and operator delete []. + + * tree.def: Add VEC_NEW_EXPR and VEC_DELETE_EXPR. + * ptree.c (print_lang_type): Indicate vec new/delete. + * parse.y: Support vec new/delete. + * method.c (build_decl_overload): Deal with vec new/delete. + (build_opfncall): Likewise. + * lex.c (init_lex): Set up values of ansi_opname and opname_tab for + vec new/delete. vec new uses "__vn", and vec delete uses "__vd". + * init.c (init_init_processing): Set up BIVN and BIVD. + (do_friend): Don't clean up after mistaken setting of TREE_GETS_NEW, + since it doesn't happen any more. + (build_new): Support vec new. Always call something. + (build_x_delete): Support vec delete. + (build_vec_delete): Lose dtor_dummy argument, add use_global_delete, + and pass it to build_x_delete. + * decl2.c (delete_sanity): Don't change behavior by whether or not + the type has a destructor. Pass use_global_delete to + build_vec_delete. + (coerce_delete_type): Make sure that the type returned has a first + argument of ptr_type_node. + * decl.c (init_decl_processing): Also declare the global vec + new/delete. + (grokdeclarator): Also force vec new/delete to be static. + (grok_op_properties): Note presence of vec new/delete, and play with + their args. If vec delete takes the optional size_t argument, set + TYPE_VEC_DELETE_TAKES_SIZE. + * cp-tree.h (TYPE_GETS_{REG,VEC}_DELETE): New macros to simplify + checking for one delete or the other. + (lang_type): gets_new and gets_delete are now two bits long. The + low bit is for the non-array version. Lose gets_placed_new. + (TYPE_VEC_DELETE_TAKES_SIZE): New macro indicating that the vec + delete defined by this class wants to know how much space it is + deleting. + (TYPE_VEC_NEW_USES_COOKIE): New macro to indicate when vec new must + add a header containing the number of elements in the vector; i.e. + when the elements need to be destroyed or vec delete wants to know + the size. + * class.c (finish_struct_methods): Also check for overloading vec + delete. + * call.c (build_method_call): Also delete second argument for vec + delete. + + * decl.c (grokdeclarator): Correct complaints again. + (grokdeclarator): Fix segfault on null declarator. + (decls_match): Also accept redeclaration with no arguments if both + declarations were in C context. Bash TREE_TYPE (newdecl) here. + (duplicate_decls): Instead of here. + + * parse.y (nested_name_specifier_1): Lose rules for dealing with + syntax errors nicely, since they break parsing of 'const i;'. + + * decl.c (lookup_name): if (got_scope == current_class_type) + val = IDENTIFIER_CLASS_VALUE (name). + + * search.c (lookup_nested_tag): Look in enclosing classes, too. + + * spew.c (yylex): Only look one character ahead when checking for a + SCOPE. + + * lex.c (check_newline): Read first nonwhite char before + incrementing lineno. + + * decl.c (grokdeclarator): Don't claim that typedefs are variables + in warning. + + * parse.y: Divide up uses of unqualified_id into + notype_unqualified_id and unqualified_id, so that TYPENAME can be + used as an identifier after an object. + + * class.c (push_nested_class): Don't push into non-class scope. + + * decl.c (grokdeclarator): If an identifier could be a type + conversion operator, but has no associated type, it's not a type + conversion operator. + + * pt.c (unify): Check for equality of constants better. + + * decl.c (grokdeclarator): Don't complain about access decls. + +Sun Apr 10 02:39:55 1994 Jason Merrill + + * decl.c (grokdeclarator): pedwarn about data definitions without + types here. + + * parse.y (datadef): Don't pedwarn about decls without types here, + since that is valid for functions. + (fn.def2, component_decl): Support constructors with declmods again. + (nomods_initdecls): For decls without any mods, so that we don't try + to get declspecs from some arbitrary $0. + + * search.c (lookup_field): Use cp_error. + + * parse.y (nested_name_specifier_1): Don't check aggr/non-aggr type + here; it breaks destructors for non-aggr types. + + * decl.c (lookup_name): Only look for TYPE_DECLs in base classes of + a type being defined, like the comment says. + If got_scope is not an aggregate, just return NULL_TREE. + + * pt.c (create_nested_upt): Kung's code for creating types nested + within uninstantiated templates now lives here (it used to live in + hack_more_ids). It needs to be expanded. + + * parse.y: Stop calling see_typename so much. + + * decl.c (lookup_name): Deal with TTPs and UPTs. + + * lex.c (real_yylex): Don't set looking_for_typename just because we + saw a 'new'. + (dont_see_typename): #if 0 out. + + * spew.c (yylex): Increment looking_for_typename if the next + character is SCOPE, rather than setting it to 1; this way, the value + from seeing an aggr specifier will not be lost. This kinda relies + on looking_for_typename never being < 0, which is now true. + + * parse.y (nested_name_specifier_1): Accept TEMPLATE_TYPE_PARMs, + too. + (named_class_head_sans_basetype): Accept template types, too. Oops. + +Fri Apr 8 16:39:35 1994 Jason Merrill + + * decl2.c (reparse_decl_as_expr1): Handle SCOPE_REFs. + + * parse.y: Lose START_DECLARATOR. + + * search.c (lookup_nested_tag): New function to scan CLASSTYPE_TAGS + for a class. + + * parse.y: Simplify fn.def2 and component_decl. Support 'enum + A::foo' syntax. Catch invalid scopes better. + + * parse.y, lex.c: Lose TYPENAME_COLON. + + * decl2.c (groktypefield): #if 0 out. + + * decl.c (lookup_name): If the type denoted by got_scope is + currently being defined, look in CLASSTYPE_TAGS rather than FIELDS. + + * class.c (push_nested_class): Don't try to push into + error_mark_node. + +Fri Apr 8 07:26:36 1994 Brendan Kehoe + + * Makefile.in (stamp-parse): Update count of conflicts to 33. + +Thu Apr 7 17:47:53 1994 Jason Merrill + + A saner implementation of nested types that treats template types + no differently from non-template types. There are still some + shortcomings of our system; most notably, it is difficult to look + for a nested type that is hidden by another name, because of the way + we keep track of hidden types. But this shouldn't be a problem for + just about anyone. Perhaps lookup_field should be fixed up a bit. + + * spew.c: Moved handling of nested types/scoping from the lexer + into the parser. Removed variable template_type_seen_before_scope. + Removed functions frob_identifier, hack_more_ids, and various cruft + that was #if 0'd out in the past, reducing the size of the file from + 1146 lines to 450 lines. We can't quite do away with spew.c yet, + though; we still need it for do_aggr () and checking for SCOPE after + the current identifier. And setting lastiddecl. + + * parse.y: Moved handling of nested types/scoping from the lexer + into the parser, using a new global variable `got_scope'. Reduced + the number of states by 53. Implemented all uses of explicit global + scope. Removed terminals SCOPED_TYPENAME and SCOPED_NAME. Removed + nonterminals tmpl.1, scoped_base_class, id_scope, typename_scope, + scoped_typename. Added nonterminals nested_type, + qualified_type_name, complete_type_name, qualified_id, ptr_to_mem, + nested_name_specifier, global_scope, overqualified_id, type_name. + Changed many others. Added 9 new reduce/reduce conflicts, which are + nested type parallels of 9 that were already in the grammar for + non-nested types. Eight of the now 33 conflicts should be removed + in the process of resolving the late binding between variable and + function decls. + + * gxxint.texi (Parser): Update. + + * cp-tree.h (IS_AGGR_TYPE_CODE): Add UNINSTANTIATED_P_TYPE. + + * lex.h: Add decl for got_scope. + + * lex.c (see_typename): Claim to be the lexer when calling + lookup_name. + + * decl.c (lookup_name): When called from the lexer, look at + got_scope and looking_at_typename; otherwise don't. + +Thu Apr 7 22:05:47 1994 Mike Stump + + 31th Cygnus<->FSF merge. + +Thu Apr 7 17:47:53 1994 Jason Merrill + + * decl2.c (mark_vtable_entries): Call this to mark all the + entries in the vtable addressable. + (finish_decl_parsing): Handle SCOPE_REFs. + + * decl.c (decls_match): Always call compparms with strict == 1. + Handle the special case of C function redecl here. + (duplicate_decls): Only keep the old type if the new decl takes no + arguments. + + * typeck.c (compparms): Also allow t1 to be ... if strict == 0. + +Thu Apr 7 16:17:50 1994 Mike Stump + + * class.c (build_vtable_entry): Fix breakage introduced Apr 5 + 17:48:41. + +Wed Apr 6 16:05:10 1994 Per Bothner + + * init.c (build_virtual_init), search.c (build_vbase_vtables_init), + ch-tree.h: Every place these functions were called, the result was + immediately passed to expand_expr_stmt. Reduce redundancy by + calling expand_expr_init *inside* these functions. These + makes for a simpler interface, and we don't have to build + compound expressions. Hence, rename these function to: + expand_virtual_init and expand_vbase_vtables_init respectively. + * init.c, decl.c: Change callers of these functions. + * init.c, cp-tree.h (expand_virtual_init): Make static. + + * decl2.c (finish_file): Check TREE_PUBLIC||TREE_ADDRESSABLE + rather than DECL_SAVED_INSNS before emitting inlines. + +Wed Apr 6 13:06:39 1994 Jason Merrill + + * spew.c (init_spew): #if 0 out stuff used by arbitrate_lookup. + + * decl.c (duplicate_decls): If this is a new declaration of an + extern "C" function, keep the type (for the argtypes). + (redeclaration_error_message): Don't check DECL_LANGUAGE here. + (decls_match): Call compparms with a value of strict dependent on + the value of strict_prototypes for DECL_LANGUAGE (oldecl). + + * typeck.c (compparms): ... is only equivalent to non-promoting + parms if we're not being strict. + + * parse.y (empty_parms): Don't check flag_ansi || pedantic here. + + * decl.c (init_decl_processing): if (flag_ansi || pedantic) + strict_prototypes_lang_c = strict_prototypes_lang_cplusplus; + + * decl2.c (grok_function_init): Don't set DECL_INITIAL on pure + virtuals. + +Tue Apr 5 17:48:41 1994 Per Bothner + + Support for implementing vtables with thunks. + * tree.def (THUNK_DECL): New TREE_CODE. + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY), tree.c + (fnaddr_from_vtable_entry): Handle flag_vtable_thunks case. + * cp-tree.h (memptr_type): New variable. + * class.c (build_vtable_entry): Build thunk if necessary. + * class.c (build_vfn_ref): If using thunks, don't need + to add delta field from vtable (there is none!). + * decl.c: Add memptr_type as well as vtable_entry_type. + If using thunks, the latter is just ptr_type_node. + * gc.c, typeck.c: Use memptr_typeChange, not vtable_entry_type. + * decl2.c (finish_vtable_vardecl): Handle thunks. + * expr.c (cplus_expand_expr): Support THUNK_DECL. + + * decl.c (grokdeclarator): Set DECL_THIS_EXTERN if "extern". + * decl.c (start_function): Set current_extern_inline based on + DECL_THIS_EXTERN, not TREE_PUBLIC. + * decl.c (finish_function): Call mark_inline_for_output if needed, + + Improve intelligence about when to emit inlines. + * cp-tree.h (lang_decl_flags): New field saved_inline. + * cp-tree.h (DECL_SAVED_INLINE): New macro. + * class.c (add_virtual_function): Don't set TREE_ADDRESSABLE. + * decl.h, decl.c (pending_addressable_inlines): Removed. + * decl2.c (pending_addressable_inlines): Renamed to saved_inlines. + * decl2.c (mark_inline_for_output): Do nothing if + DECL_SAVED_INLINE; otherwise set it (and add to saved_inlines list). + * decl2.c (finish_vtable_vardecl): SET_CLASSTYPE_INTERFACE_KNOWN + and set CLASSTYPE_INTERFACE_ONLY if there is a non-inline virtual. + * decl2.c (finish_file): Writing out inlines later, so we can + also handle the ones needed for vtbales. + * decl2.c (write_vtable_entries, finish_vtable_typedecl): Removed. + + * cp-tree.h, class.c, decl2.c, search.c: Remove -fvtable-hack + and flag_vtable_hack. Use -fvtable-thunks and flag_vtable_thunks + instead. (The rationale is that these optimizations both break binary + compatibility, but should become the default in a future release.) + +Wed Apr 6 10:53:56 1994 Mike Stump + + * class.c (modify_vtable_entries): Never reset the DECL_CONTEXT + of a fndecl, as we might not be from that vfield. + +Tue Apr 5 17:43:35 1994 Kung Hsu + + * class.c (add_virtual_function): Fix bug for pure virtual, so + that DECL_VINDEX of the dummy decl copied won't be error. + (see also Apr 4 change) + +Tue Apr 5 17:23:45 1994 Per Bothner + + * typeck.c (c_expand_return): Before checking that we're not + returning the address of a local, make sure it's a VAR_DECL. + (And don't worry about it being a TREE_LIST.) + +Tue Apr 5 13:26:42 1994 Jason Merrill + + * parse.y (YYDEBUG): Always define. + * lex.c (YYDEBUG): Likewise. + +Mon Apr 4 11:28:17 1994 Kung Hsu + + * class.c (finish_struct): Backup out the change below, put the + new change for the same purpose. The change below breaks code. + + * class.c (finish_struct): If pure virtual, copy node and make + RTL point to abort, then put in virtual table. + * decl2.c (grok_function_iit): Reinstate Mar 31 change. + +Sat Apr 2 03:12:58 1994 Jason Merrill + + * init.c (build_new): pedwarn about newing const and volatile + types. + + * tree.c (get_identifier_list): Only do the special handling + thing if we're dealing with the main variant of the record type. + + * cvt.c (convert_to_reference): When converting between + compatible reference types, use the pointer conversion machinery. + Don't just blindly overwrite the old type. + +Fri Apr 1 17:14:42 1994 Jason Merrill + + * call.c (build_method_call): When looking at global functions, + be sure to use instance_ptr for the first argument, not some version + of it that has been cast to a base class. Also do this before + comparing candidates. + +Thu Mar 31 19:50:35 1994 Jason Merrill + + * call.c (build_method_call): Constructors can be called for + const objects. + +Thu Mar 31 16:20:16 1994 Kung Hsu + + * decl2.c (grok_func_init): Do not abort as rtl for pur virtual + functions. They can be defined somewhere else. + +Sat Jan 23 23:23:26 1994 Stephen R. van den Berg + + * decl.c (init_decl_processing): Declare __builtin_return_address + and __builtin_frame_address for C++ as well. + +Thu Mar 31 12:35:49 1994 Mike Stump + + * typeck2.c (store_init_value): Integral constant variables are + always constant, even when doing -fpic. + +Sat Jan 23 23:23:26 1994 Stephen R. van den Berg + + * decl.c (redeclaration_error_message): Pass the types to + comptypes. + +Wed Mar 30 21:29:25 1994 Mike Stump + + Cures incorrect errors about pure virtuals in a class, when they + have been overridden in a derived class. + + * search.c (get_abstract_virtuals): Reimplement. + * search.c (get_abstract_virtuals_1): New routine. + +Wed Mar 30 14:10:04 1994 Jason Merrill + + * pt.c (push_template_decls): Make the pushed level pseudo + global. + + * parse.y (extdefs): Don't pop everything if the current binding + level is pseudo_global. + + * decl.c (pop_everything): Stop on reaching a pseudo-global + binding level. + + * cp-tree.h (DECL_FUNCTION_MEMBER_P): Change to more reliable test. + + * decl.c (duplicate_decls): Only copy DECL_SOURCE_{FILE_LINE} if + the old decl actually had an initializer. + + * {various}: Clean up gcc -W complaints. + + * cp-tree.h (DECL_FUNCTION_MEMBER_P): Currently defined to be + (DECL_CONTEXT (NODE) != NULL_TREE). + + * parse.y (lang_extdef): Call pop_everything if necessary. + + * decl.c (pop_everything): New function for popping binding + levels left over after a syntax error. + (pushdecl): Use DECL_FUNCTION_MEMBER_P to decide whether or not + a function is a member. + +Wed Mar 30 14:20:50 1994 Mike Stump + + Cures calling a more base base class function, when a more derived + base class member should be called in some MI situations. + + * search.c (make_binfo): Use more the more specialized base + binfos from the binfo given as the second argument to make_binfo, + instead of the unspecialized ones from the TYPE_BINFO. + * class.c (finish_base_struct): Likewise, update callers. + * search.c (dfs_get_vbase_types): Likewise. + * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. + * decl.c (xref_tag): Use NULL_TREE instead of 0. + * lex.c (make_lang_type): Likewise. + +Wed Mar 30 14:10:04 1994 Jason Merrill + + * decl.c (pushdecl): If pushing a C-linkage function, only do a + push_overloaded_decl. + (duplicate_decls): Standard overloading does not shadow built-ins. + +Tue Mar 29 00:54:18 1994 Jason Merrill + + * pt.c (end_template_decl): Don't call push_overloaded_decl. + + * init.c (do_friend): Don't call push_overloaded_decl. + + * decl.c (pushdecl): Call push_overloaded_decl for functions and + function templates. + (duplicate_decls): Functions and function templates are not + duplicates, but don't complain about calling this function to + compare them. + (push_overloaded_decl): Don't deal with linkage. Call + duplicate_decls. + (redeclaration_error_message): Deal with linkage. + + * decl.c (start_function): If push_overloaded_decl returns an + older version of the function, deal with it. + + * decl.c (start_function): Be sure only to push_overloaded_decl + for non-members. + + * decl.c (grokfndecl): Put back clearing of DECL_CHAIN for + methods. + (start_function): Lose broken and redundant code for checking old + decl. + + * init.c (add_friend): Give line numbers of both friend decls + when warning about re-friending. + + * pt.c (tsubst): Use comptypes rather than == to compare the + types of the method as declared and as defined, since default + parameters may be different. + + * call.c (build_method_call): Use brendan's candidate printing + routine. + + * decl.c (start_method): Methods defined in the class body are + inline whether or not it's a template class. + +Mon Mar 28 16:39:26 1994 Jason Merrill + + * parse.y (initdcl0): Add "extern" to current_declspecs if + have_extern_spec && ! used_extern_spcec. + + * tree.c (really_overloaded_fn): A fn with more than one + overload. + + * pt.c (end_template_decl): Use really_overloaded_fn. + + * decl.c (duplicate_decls): When smashing a decl into a previous + definition, keep the old file and line. + Don't deal with overloaded functions. + Lose old code for checking arg types of functions. + Check for overloaded C functions. + (pushdecl): Deal with overloaded functions. + (start_decl): Expect pushdecl to return an appropriate function decl. + (start_function): Likewise. + (push_overloaded_decl): Don't check for overloaded C functions. + + * *.c: Stop using DECL_OVERLOADED, it being archaic. + TREE_OVERLOADED should probably go, too. + +Mon Mar 28 14:00:45 1994 Ron Guilmette + + * typeck.c (comp_target_types): Call comp_target_parms with + strict == 1. + +Sun Mar 27 00:07:45 1994 Jason Merrill + + * parse.y (empty_parms): Don't parse () as (...) in extern "C" + sections if we're compiling with -ansi or -pedantic. + + * decl.c (decls_match): Don't treat (int) and (int&) as matching. + + * decl2.c (grokfield): Don't pedwarn twice about initializing + field. + + * decl.c (push_overloaded_decl): Warn about shadowing + constructor. + (redeclaration_error_message): Don't allow 'int a; int a;' + + * cvt.c (build_up_reference): Only check for valid upcast if + LOOKUP_PROTECT is set, not just any flag. + +Fri Mar 25 01:22:31 1994 Jason Merrill + + * lex.c (check_newline): When we see a #pragma implementation, + also set it for the main input file. + + * init.c (build_new): Convert array size argument to size_t. + + * parse.y (primary): If we're doing a parenthesized type-id, call + groktypename before passing it to build_new. + + * call.c (build_method_call): Deal properly with const and + volatile for instances of reference type. + + * decl.c (store_return_init): Change 'if (pedantic) error' to 'if + (pedantic) pedwarn'. + + * decl.c (grokdeclarator): Don't complain about putting `static' + and `inline' on template function decls. + +Thu Mar 24 23:18:19 1994 Jason Merrill + + * call.c (build_method_call): Preserve const & volatile on + `this'. + +Thu Mar 24 16:21:52 1994 Mike Stump + + * init.c (build_new, build_vec_delete): Use global new and delete + for arrays. + * decl2.c (delete_sanity): Likewise. + +Thu Mar 24 02:10:46 1994 Jason Merrill + + * cvt.c (convert_to_reference): If i is an lvalue, + (int &)i -> *(int*)&i, as per 5.2.8p9 of the latest WP. + (convert_force): Call convert_to_reference with LOOKUP_COMPLAIN. + +Wed Mar 23 17:45:37 1994 Jason Merrill + + * decl.c (duplicate_decls): Also propagate DECL_TEMPLATE_MEMBERS + and DECL_TEMPLATE_INSTANTIATIONS. + + * init.c (build_new): Handle array typedefs properly. + +Wed Mar 23 18:23:33 1994 Mike Stump + + 30th Cygnus<->FSF merge. + +Wed Mar 23 00:46:24 1994 Mike Stump + + * class.c (modify_vtable_entries): Avoid running off the end of the + virtuals list when processing a virtual destructor. + * class.c (get_vtable_entry): Likewise. + +Wed Mar 23 00:23:59 1994 Jason Merrill + + * decl.c (duplicate_decls): If two template decls don't match, + just return 0. + +Tue Mar 22 23:49:41 1994 Jason Merrill + + * typeck.c (convert_for_assignment): Don't pedwarn about + converting function pointer to void *. + +Tue Mar 22 22:23:19 1994 Mike Stump + + Major revamp of pointer to member functions. Cures major + nonfunctionality when used in casts, and MI situations. + + * cvt.c (convert_force): Update call site of build_ptrmemfunc. + * typeck.c (convert_for_assignment): Likewise. + * typeck2.c (digest_init): Likewise. + * typeck2.c (process_init_constructor): Simplify by moving code into + digest_init. + * typeck2.c (digest_init): Do default_conversions on init value, if + we are processing pointer to member functions. + * class.c (get_vfield_offset): Now non-static. Convert bit offset + into byte offset. + * cp-tree.h (get_vfield_offset): Likewise. + * typeck.c (get_member_function_from_ptrfunc): Convert down to right + instance, before fetching vtable pointer. + * typeck.c (get_delta_difference): New routine. + * typeck.c (build_ptrmemfunc): Revamp to handle casting better, also + get vtable pointer out of right subobject. + +Tue Mar 22 17:56:48 1994 Mike Stump + + * search.c (get_binfo): Return NULL instead of aborting, when + passed a UNION_TYPE. + +Tue Mar 22 12:44:54 1994 Jason Merrill + + These patches implement handling of redefinition/redeclaration of + templates. + + * typeck.c (comptypes): Simplify. All TEMPLATE_TYPE_PARMs are + considered compatible. + + * parse.y (template_def): Pass defn argument to end_template_decl. + + * pt.c (end_template_decl): Add defn argument. Check for + redefinition. Simplify. + + * error.c (OB_UNPUT): New macro, to remove mistakes. + (aggr_variety): Subroutine of dump_aggr_type. + + * decl.c (decls_match): Support templates. + (duplicate_decls): No longer static. Don't try to lay out template + decls. + (pushdecl): Simplify. + + * cp-tree.h (DECL_TEMPLATE_MEMBERS): Use DECL_SIZE instead of + DECL_INITIAL. + +Mon Mar 21 11:46:55 1994 Jason Merrill + + * error.c (dump_decl): Support class template decls. + (dump_type): Don't adorn template type parms. + + * decl.c (duplicate_decls): Save DECL_TEMPLATE_INFO from old decl + if it was a definition. + (redeclaration_error_message): Do the cp_error thang, and reject + redefinition of templates. + +Mon Mar 21 19:36:06 1994 Per Bothner + + * decl.c (grokdeclarator): Set TREE_PUBLIC for METHOD_TYPE + in FIELD context, when appropriate. Also, + CLASSTYPE_INTERFACE_ONLY is irrelevant to setting TREE_PUBLIC. + Also, simplify check for bogus return specifiers. + +Mon Mar 21 11:46:55 1994 Jason Merrill + + * parse.y (after_type_declarator1): Expand type_quals. + (notype_declarator1): Likewise. + (absdcl1): Likewise. + +Sat Mar 19 01:05:17 1994 Jason Merrill + + * decl.c (grokdeclarator): Treat class-local typedefs like static + members; i.e. 'typedef int f();' means that f is a function type, + not a method type. + + * parse.y (decl): Change direct_* back to *. + (type_id): Change direct_abstract_declarator to absdcl. + (direct_declarator, direct_initdecls, direct_initdcl0): Remove again. + +Fri Mar 18 12:47:59 1994 Jason Merrill + + These two patches fix crashes on instantiating a template inside a + function with C linkage or containing labels. + + * class.c (current_lang_stacksize): No longer static. + + * decl.c (struct saved_scope): Add lang_base, lang_stack, + lang_name, lang_stacksize, and named_labels. + (push_to_top_level): Save them. + (pop_from_top_level): Restore them. + + * gxxint.texi (Parser): Update. + + These two patches finish moving the task of expr/declarator + ambiguity resolution from the lexer to the parser, and add one more + r/r conflict. START_DECLARATOR can now be nuked. + + * parse.y (decl): Add "direct_" in typespec X rules. + (direct_declarator): New nonterminal for + direct_after_type_declarator and direct_notype_declarator. + (direct_initdecls): Like initdecls, but uses direct_initdcl0. + (direct_initdcl0): Like initdcl0, but uses direct_declarator. + (named_parm): Add typespec direct_declarator rule. + + * spew.c (yylex): #if 0 out START_DECLARATOR insertion. + + These two patches disable some excessive cleverness on the part of + g++; a non-class declaration always hides a class declaration in the + same scope, and g++ was trying to unhide it depending on the + enclosing expression. + + * spew.c (arbitrate_lookup): #if 0 out. + + * decl.c (lookup_name): Never call arbitrate_lookup. + + * parse.y (complex_notype_declarator1): Add '*' + complex_notype_declarator1 and '&' complex_notype_declarator1 rules. + + * parse.y (complex_direct_notype_declarator): Restore id_scope + see_typename TYPENAME rule, remove all other rules beginning with + those tokens. + (notype_unqualified_id): Add '~' see_typename IDENTIFIER rule. + +Thu Mar 17 17:30:01 1994 Jason Merrill + + These changes fix the compiler's handling of the functional cast/ + object declaration ambiguities in section 6.8 of the ARM. They also + add 11 reduce/reduce conflicts. Sigh. + + * parse.y: Add precedence decls for OPERATOR and '~'. + (notype_unqualified_id): New nonterminal, encompasses all of the + ANSI unqualified-id nonterminal except TYPENAMEs. + (expr_or_declarator): New nonterminal to delay parsing of code like + `int (*a)'. + (primary): Use notype_unqualified_id. + (decl): Add typespec initdecls ';' and typespec declarator ';' + rules. + (initdcl0): Deal with the above. + (complex_notype_declarator1): A notype_declarator that is not also + an expr_or_declarator. + (complex_direct_notype_declarator): A direct_notype_declarator that + doesn't conflict with expr_or_declarator. Use + notype_unqualified_id. Remove id_scope see_typename TYPENAME rule. + (functional_cast): New nonterminal, for the three functional cast + rules. So that they can be moved after + complex_direct_notype_declarator. + (see_typename): Don't accept type_quals any more. + + * decl2.c (reparse_decl_as_expr): New function to deal with parse + nodes for code like `int (*a)++;'. + (reparse_decl_as_expr1): Recursive subroutine of the above. + (finish_decl_parsing): New function to deal with parse nodes for + code like `int (*a);'. See the difference? + +Thu Mar 17 12:16:10 1994 Mike Stump + + These changes break binary compatibility in code with classes + that use virtual bases. + + * search.c (dfs_get_vbase_types): Simplify and correct to make + sure virtual bases are initialized in dfs ordering. + * search.c (get_vbase_types): Simplify and make readable. + +Thu Mar 17 12:01:10 1994 Jason Merrill + + * parse.y: s/ typename / type_id /g + +Wed Mar 16 17:42:52 1994 Kung Hsu + + * parse.y (typespec): Add SCOPE TYPENAME for global scoped + type. e.g. ::B x. + + * decl.c (complete_array_type): Fix a bug that in -pendantic + mode even there's no initializer, it will continue to build + default index. + +Wed Mar 16 17:43:07 1994 Jason Merrill + + * parse.y (direct_notype_declarator): Add PTYPENAME rule, remove + all of the scoped PTYPENAME rules. + +Wed Mar 16 16:39:02 1994 Mike Stump + + * init.c (build_offset_ref): The value of A::typedef_name is + always the TYPE_DECL, and never an error. + +Tue Mar 15 20:02:35 1994 Jason Merrill + + * search.c (get_base_distance_recursive): Two binfos can only + represent the same object if they are both via_virtual. + + * class.c (finish_base_struct): Check vbases for ambiguity, too. + + * search.c (get_vbase_types): Accept binfo argument, too. + +Tue Mar 15 19:22:05 1994 Kung Hsu + + * decl.c (complete_array_type): Complete TYPE_DOMAIN of the + initializer also, because back-end requires it. + +Tue Mar 15 15:33:31 1994 Jason Merrill + + * error.c (dump_expr): Support member functions (which show up as + OFFSET_REFs). + +Mon Mar 14 16:24:36 1994 Mike Stump + + * init.c (build_new): Set the return type of multidimensional + news correctly. + +Fri Mar 11 15:35:39 1994 Kung Hsu + + * call.c (build_method_call): If basetype not equal to type + of the instance, use the type of the instance in building + destructor. + +Thu Mar 10 17:07:10 1994 Kung Hsu + + * parse.y (direct_notype_declarator): Add push_nested_type for + 'template_type SCOPED_NAME' rule. + +Tue Mar 8 00:19:58 1994 Jason Merrill + + * parse.y (parm): Add typed_declspec1 {absdcl, epsilon} rules. + +Sat Mar 5 04:47:48 1994 Jason Merrill + + * parse.y (regcast_or_absdcl): New nonterminal to implement late + reduction of constructs like `int ((int)(int)(int))'. + (cast_expr): Use it. + (sub_cast_expr): Everything that can come after a cast. + (typed_declspecs1): typed_declspecs that are not typed_typespecs. + (direct_after_type_declarator): Lose PAREN_STAR_PAREN rule. + (direct_abstract_declarator): Replace '(' parmlist ')' rule with + '(' complex_parmlist ')' and regcast_or_absdcl. + (parmlist): Split + (complex_parmlist): Parmlists that are not also typenames. + (parms_comma): Enabler. + (named_parm): A parm that is not also a typename. Use declarator + rather than dont_see_typename abs_or_notype_decl. Expand + typed_declspecs inline. + (abs_or_notype_decl): Lose. + (dont_see_typename): Comment out. + (bad_parm): Break out abs_or_notype_decl into two rules. + +Fri Mar 4 18:22:39 1994 Jason Merrill + + * decl2.c (reparse_decl_as_casts): New function to change parse + nodes for `(int)(int)(int)' from "function taking int and returning + function taking int and returning function taking int" to "... cast + to int, cast to int, cast to int". + + * decl2.c (reparse_decl_as_expr): Recursive function to change + parse nodes for `A()()' from "function returning function returning + A" to "A().operator()". + + * parse.y (primary): Replace `typespec LEFT_RIGHT' rule with + `typespec fcast_or_absdcl' rule. + (fcast_or_absdcl): New nonterminal to implement late reduction of + constructs like `A()()()()'. + (typename): Replace `typespec absdcl1' rule with + `typespec direct_abstract_declarator' rule. + (direct_abstract_declarator): Replace `LEFT_RIGHT type_quals' rule + with `fcast_or_absdcl type_quals' rule. + +Fri Mar 4 16:18:03 1994 Mike Stump + + * tree.c (lvalue_p): Improve OFFSET_REF handling, so that it + matches Section 5.5. + +Fri Mar 4 14:01:59 1994 Jason Merrill + + * error.c (dump_type_prefix): Don't print basetype twice for + pmfs. + +Fri Mar 4 13:24:33 1994 Mike Stump + + * typeck.c (convert_arguments): Handle setHandler(A::handlerFn) + so that it is like setHandler(&A::handlerFn). Cures an `invalid + lvalue in unary `&''. + +Fri Mar 4 11:15:59 1994 Jason Merrill + + * gxxint.texi (Copying Objects): New section discussing default + op= problems with virtual inheritance. + + * decl2.c (grokoptypename): Just does grokdeclarator and + build_typename_overload, since the parser can't call grokdeclarator + directly. + + * method.c (build_typename_overload): Set IDENTIFIER_GLOBAL_VALUE + and TREE_TYPE on generated identifiers. + + * decl.c (grokdeclarator): Don't deal with TYPE_EXPRs anymore. + + * parse.y (parm): Convert `const char *' to `__opPCc' here. + + * error.c (dump_decl): Say sorry rather than my_friendly_aborting + if we can't figure out what to do. + (dump_type*): Likewise. + + * typeck2.c (build_m_component_ref): 'component' is an expr, not + a decl. Also move the IS_AGGR_TYPE check after the stripping of + REFERENCE_TYPE. + +Fri Mar 4 04:46:05 1994 Mike Stump + + * call.c (build_method_call): Handle b->setHandler(A::handlerFn) + so that it is like b->setHandler(&A::handlerFn). Cures an `invalid + lvalue in unary `&''. + +Thu Mar 3 12:38:15 1994 Jason Merrill + + * parse.y: Add precedence specification for START_DECLARATOR. + (type_quals): Move before primary. + (typename): Move before typed_declspecs, add 'typespec absdcl1' rule. + + * decl2.c (grokoptypename): Lose. + + * decl.c (grokdeclarator): Parse TYPE_EXPRs in the initial scan, + rather than waiting until later. + +Wed Mar 2 14:12:23 1994 Jason Merrill + + * parse.y (unary_expr): Use 'typename' in 'new' rules, rather + than expanding it inline. + (typename): Expand empty option of (former) absdcl inline. + (abs_or_notype_decl): Likewise. + (absdcl): Lose empty rule. + (conversion_declarator): New nonterminal for 'typename' of 'operator + typename'. + (operator_name): Use it instead of absdcl. + + * parse.y: Add precedence declarations for SCOPED_TYPENAME, + TYPEOF, and SIGOF. + (typed_declspecs): Accept typed_typespecs, rather than typespec + directly. Add rules with reserved_typespecquals. + (reserved_declspecs): Don't accept typespecqual_reserved at the + beginning of the list. The typed_declspecs rule will deal with this + omission. + (declmods): Accept nonempty_type_quals, rather than TYPE_QUAL + directly. + + * parse.y (direct_notype_declarator, + direct_after_type_declarator, direct_abstract_declarator): Split up + the declarator1 nonterminals to match the draft standard and avoid + ambiguities. + (new_type_id, new_declarator, direct_new_declarator, + new_member_declarator): New nonterminals to implement the subset of + 'typename' allowed in new expressions. + (unary_expr): Use new_type_id instead of typename. + (after_type_declarator1, absdcl1): Fix semantics of member pointers. + (abs_member_declarator, after_type_member_declarator): Lose. + + * parse.y (absdcl1): Don't require parens around + abs_member_declarator. + (abs_member_declarator): Lose see_typename from rules. + (after_type_member_declarator): Likewise. + + * tree.c (get_identifier_list): New function, containing code + previously duplicated in get_decl_list and list_hash_lookup_or_cons. + (get_decl_list): Use it. + (list_hash_lookup_or_cons): Likewise. + + * parse.y (typed_declspecs, declmods): It's not necessary to hash + the declspecs on class_obstack, so don't. This way typed_typespecs + can reduce to typed_declspecs. + +Wed Mar 2 14:29:18 1994 Jason Merrill + + * cvt.c (build_up_reference): If we aren't checking visibility, + also allow base->derived conversions. + +Mon Feb 28 15:14:29 1994 Per Bothner + + * typeck.c (build_c_cast): Remove bogus hack when converting + to a reference type. + + * cp-tree.h (lang_decl::vbase_init_list, DECL_VBASE_INIT_LIST): + Removed, not used. + (lang_stype::methods, lang_decl::next_method): New fields. + (CLASSTYPE_METHODS, DECL_NEXT_METHOD): New macros. + * decl.c (duplicate_decls): Preserve DECL_NEXT_METHOD. + + * cp-tree.h, decl2.c (flag_vtable_hack): New flag. + * decl2.c (finish_vtable_vardecl): If flag_vtable_hack, + and !CLASSTYPE_INTERFACE_KNOWN, try to use the presence of + a non-inline virtual function to control emitting of vtables. + * class.c (finish_struct): Build CLASSTYPE_METHODS list. + * search.c (build_vbase_vtables_init): Don't assemble_external + (yet) if flag_vtable_hack. + * class.c (build_vfn_ref): Likewise. + +Mon Feb 28 14:54:13 1994 Jason Merrill + + * parse.y (component_decl): Don't include "typed_declspecs + declarator ';'" speedup, since it breaks enums. + +Fri Feb 25 15:43:44 1994 Per Bothner + + * class.c (finish_struct): Minor optimization for building + fn_fields list. + +Fri Feb 25 15:23:42 1994 Jason Merrill + + * decl.c (start_function): Fix detection of function overloading. + +Thu Feb 24 22:26:19 1994 Mike Stump + + * lex.c (check_newline): #pragma interface can take a string + argument, just like #pragma implementation. #pragma implementation + checks for garbage on the line, line #pragma interface does. Main + input files do not auto implement like named files, #pragma + implementation must be used explicitly. + +Thu Feb 24 17:09:01 1994 Jason Merrill + + * parse.y (components): Handle list of one again. + (notype_components): Likewise. + (after_type_declarator1): Take maybe_raises out again. + + * gxxint.texi (Parser): Document additional r/r conflict. + +Wed Feb 23 14:42:55 1994 Jason Merrill + + * gxxint.texi (Parser): Add node. + + * Makefile.in (stamp-parse): Update expected conflict count. + + * parse.y (various): Replace "declmods declarator" with "declmods + notype_declarator". The comment saying that "declmods declarator ';'" + corresponds to "int i;" was wrong; it corresponds to "const i;". + (component_decl): Add "typed_declspecs declarator ';'" rule; this + *does* correspond to "int i;". Change "declmods components" to + "declmods notype_components". + (components): Don't deal with a list of one anymore. + (notype_components): New nonterminal, corresponds to notype_declarator. + ({after_,no}type_component_decl{,0}): More new nonterminals. + ({after_,no}type_declarator): Fold in START_DECLARATOR token. + Eliminates four reduce/reduce conflicts. + + (expr): Depend on nontrivial_exprlist instead of nonnull_exprlist. + (nontrivial_exprlist): New nonterminal: A list of at least two + expr_no_commas's. + (nonnull_exprlist): Depend on nontrival_exprlist. + Eliminates four reduce/reduce conflicts. + + (named_class_head): Move intermediate code block into separate + nonterminal so that we can stick %prec EMPTY on it. + + Add more %prec EMPTY's to eliminate remaining shift/reduce + conflicts. + + (after_type_declarator): Add maybe_raises to fndecl rules. + (after_type_declarator_no_typename): Remove. + For correctness. + + Document remaining reduce/reduce conflicts. + +Tue Feb 22 12:10:32 1994 Jason Merrill + + * search.c (get_base_distance): Only bash BINFO_INHERITANCE_CHAIN + (TYPE_BINFO (type)) if we care about the path. + + * tree.c (lvalue_p): A COND_EXPR is an lvalue if both of the + options are. + +Mon Feb 21 19:59:40 1994 Mike Stump + + * Makefile.in (mostlyclean): lex.c is a source file, don't + remove. + +Sat Feb 19 01:27:14 1994 Jason Merrill + + * parse.y: Eliminate 20 shift/reduce conflicts. + +Fri Feb 18 11:49:42 1994 Jason Merrill + + * pt.c (type_unification): Add subr argument; if set, it means + that we are calling ourselves recursively, so a partial match is OK. + (unify): Support pointers to methods and functions. + (tsubst): Support method pointers. + * decl.c (build_ptrmemfunc_type): No longer static, so that + tsubst can get at it. + + * init.c (is_aggr_typedef): Pretend template type parms are + aggregates. + * decl2.c (build_push_scope): If cname refers to a template type + parm, just grin and nod. + + * call.c (build_overload_call_real): Pass subr argument to + type_unification. + * pt.c (do_function_instantiation): Likewise. + * class.c (instantiate_type): Likewise. + + * search.c (get_base_distance): If BINFO is a binfo, use it and + don't mess with its BINFO_INHERITANCE_CHAIN. + + * cvt.c (convert_to_reference): Fix temporary generation. + If ambiguous, return error_mark_node. + + * init.c (build_new): Put back some necessary code. + +Thu Feb 17 15:39:47 1994 Jason Merrill + + * init.c (build_new): Deal with array types properly. + + * search.c (get_binfo): Become a shell for get_base_distance. + (get_binfo_recursive): Lose. + (get_base_distance_recursive): Find the path to the via_virtual base + that provides the most access. + (get_base_distance): Likewise. + + * parse.y (explicit_instantiation): Syntax is 'template class + A', not 'template A'. + + * typeck.c (convert_for_initialization): Remove bogus warning. + + * parse.y (datadef): Revert patch of Oct 27. + +Thu Feb 17 15:12:29 1994 Per Bothner + + * class.c (build_vfn_ref): Cast delta field to ptrdiff_type_node, + rather than integer_type_node. Does wonders for the Alpha. + +Thu Feb 17 13:36:21 1994 Jason Merrill + + * decl.c (build_ptrmemfunc_type): Make sure that the pmf type + goes onto the same obstack as its target type. + +Wed Feb 16 00:34:46 1994 Jason Merrill + + * cvt.c (convert_to_reference): If converting via constructor + on local level, go back to build_cplus_new approach. + + * tree.c (build_cplus_new): If with_cleanup_p, set cleanup slot + to error_mark_node to prevent expand_expr from building a cleanup + for this variable. + + * lex.c (default_assign_ref_body): Return *this from the memcpy + version, too. + + * decl.c (grok_reference_init): Just return if called with + error_mark_node, don't worry about initializing non-const reference + with temporary. + + * cvt.c (convert_to_reference): Do the right thing for + non-aggregate reference conversions, pedwarn when generating a + non-const reference to a temporary. + + * class.c (finish_struct): TYPE_HAS_COMPLEX_{INIT,ASSIGN}_REF and + TYPE_NEEDS_CONSTRUCTING all depend on TYPE_USES_VIRTUAL_BASECLASSES + again. + +Tue Feb 15 19:47:19 1994 Jason Merrill + + * decl.c (grok_reference_init): Pawn off a lot of the work on + convert_to_reference. Generally do the right thing. + + * cvt.c (convert_to_reference): Conform to the initial comment; + i.e. don't create temps if decl != error_mark_node. Handle + cleanups better for temps that do get created. Don't pretend + that we can use an 'A' to initialize a 'const double &' just by + tacking on a NOP_EXPR. Support LOOKUP_SPECULATIVELY. + + * call.c (build_method_call): Set TREE_HAS_CONSTRUCTOR on + constructor calls. + +Mon Feb 14 14:50:17 1994 Jason Merrill + + * decl.c (grok_reference_init): Make a temporary for initializing + const reference from constant expression. + +Mon Feb 14 11:31:31 1994 Per Bothner + + * cp-tree.h, decl.c (set_identifier_local_value): Deleted function. + * decl.c (pushdecl): Define decl in correct binding_level + (which isn't always the inner_binding_level). + + * cvt.c (build_up_reference): Don't ever call expand_aggr_init. + It's ugly, and I don't think it's the right thing to do. + + * cp-tree.h, class.c, decl.c, decl2.c, sp/search.c: + Remove NEW_CLASS_SCOPING, assuming it is always 1. + * decl.c (pop_decl_level): Removed; manually inlined. + +Sun Feb 13 19:04:56 1994 Jason Merrill + + * class.h (candidate): Add basetypes field. + + * call.c (build_method_call): Do access checking after choosing a + function, not before. + + * Makefile.in (cvt.o, call.o, method.o): Depend on class.h. + (mostlyclean): Remove ../cc1plus. + +Fri Feb 11 11:52:26 1994 Jason Merrill + + * class.c (finish_struct): Don't allow adjusting access to a field + of a base class if a local field has the same name. + + * error.c (dump_type_prefix): Output basetype for METHOD_TYPEs. + +Thu Jan 13 17:55:51 1994 Gnanasekaran Swaminathan + + * cp-tree.h (DESTRUCTOR_NAME_P): Do not confuse AUTO_TEMP names + with destructor names when either NO_DOLLAR_IN_LABEL or + NO_DOT_IN_LABEL are not defined. + + Now `template class A {...}' works. + + * pt.c (grok_template_type): Substitute template parm types + with actual types in complex type as well. + (coerce_template_parms): Update the grok_template_type () + function call. + + * pt.c (tsubst): Traverse method list using DECL_CHAIN. + + * decl.c (grok_op_properties): Allow operator++/-- to have + default arguments. + + * typeck2.c (store_init_value): Don't abort when called to + initialize a type that needs constructing with a CONSTRUCTOR. + + * init.c (expand_aggr_init_1, CONSTRUCTOR case): If + store_init_value fails, build and expand an INIT_EXPR. If + store_init_value succeeds, call expand_decl_init. + +Fri Feb 11 02:49:23 1994 Mike Stump + + * class.c (build_vbase_path): Use complete_type_p instead of + resolves_to_fixed_type_p to determine if the virtual bases are in + their right place for the type of expr. Cures problem of thinking a + virtual base class is one place, when it is in fact someplace else. + +Fri Feb 11 00:26:46 1994 Mike Stump + + * init.c (resolve_offset_ref): Make sure we first convert to + intermediate type, if given, when dealing with members off `this'. + Solves an incorrrect `type `foo' is not a base type for type + `multiple'' when it is infact, a base type. + +Thu Feb 10 21:49:35 1994 Mike Stump + + * class.c (modify_other_vtable_entries): Use get_binfo, instead + of binfo_value. Solves problem with compiler giving a `base class + `B' ambiguous in binfo_value (compiler error)' on complex MI + herarchies, when a virtual function is first defied in a virtual + base class. + +Thu Feb 10 17:19:32 1994 Mike Stump + + * class.c (build_vbase_path): Don't complain about ambiguous + intermediate conversion when converting down to a virtual base + class, even if they might seem to be ambiguous. + +Thu Feb 10 12:18:26 1994 Jason Merrill + + * typeck2.c (build_functional_cast): #if 0 out constructor + inheritance code, improve error messages. + + * class.c (finish_base_struct): Complain about base with only + non-default constructors in derived class with no constructors. + + * decl.c (grokdeclarator): Fix detection of virtual new/delete. + +Wed Feb 9 22:02:32 1994 Mike Stump + + * search.c (build_mi_virtuals, add_mi_virtuals, + report_ambiguous_mi_virtuals): Removed unneeded code. + * class.c (finish_struct_bits): Likewise. + +Wed Feb 9 11:27:17 1994 Jason Merrill + + * pt.c (end_template_instantiation): Push decl before + pop_from_top_level. + + * typeck2.c (build_m_component_ref): Make sure datum is of + aggregate type. + + * init.c (get_type_value): New function, returns + IDENTIFIER_TYPE_VALUE or IDENTIFIER_CLASS_TYPE_VALUE or NULL_TREE. + + * call.c (build_method_call): Don't die on call to destructor for + non-type. + + * decl.c (grokdeclarator): Complain about virtual op new and op + delete, make static virtuals unvirtual instead of unstatic. + + * typeck.c (build_c_cast): Also call default_conversion on + methods. + + * decl.c (grokdeclarator): Don't complain about anonymous + bitfields. + + * parse.y (simple_stmt, for loops): Move the continue point after + the cleanups. + + * class.c (finish_struct): Fix setting of + TYPE_HAS_COMPLEX_INIT_REF. + +Tue Feb 8 13:21:40 1994 Jason Merrill + + * init.c (build_new): Deal with `new double (1)'. + + * class.c (finish_struct): TYPE_HAS_COMPLEX_*_REF are supersets of + TYPE_HAS_REAL_*_REF, but TYPE_HAS_COMPLEX_INIT_REF is independent of + TYPE_NEEDS_CONSTRUCTING. + + * decl.c (duplicate_decls): Propagate access decls. + + * typeck2.c (process_init_constructor): Accept empty_init_node + for initializing unions. + + * class.c, lex.c, cp-tree.h: Use + TYPE_HAS_COMPLEX_ASSIGN_REF where TYPE_HAS_REAL_ASSIGN_REF was used + before, use TYPE_HAS_COMPLEX_INIT_REF for TYPE_NEEDS_CONSTRUCTING in + some places. + + * decl.c (finish_decl): Don't complain about uninitialized const + if it was initialized before. + +Mon Feb 7 18:12:34 1994 Jason Merrill + + * lex.c (default_assign_ref_body): Don't deal with vbases for + now. + + * decl.c (finish_decl): Fix reversed logic for objects and other + things that need to be constructed but have no initializer. + + * class.c (finish_struct): Don't set TYPE_HAS_* flags that are + set by grok_op_properties or finish_decl. + + * decl.c: Don't warn about extern redeclared inline unless + -Wextern-inline is given. + * decl2.c (lang_decode_option): Likewise. + * cp-tree.h: Likewise. + +Mon Feb 7 17:29:24 1994 Per Bothner + + * decl.c (pushdecl_with_scope): Fix thinko. Add forward + declaration. + + * decl.c (pushdecl_with_scope): New function. + * decl.c (pushdecl_top_level): Use new function. + * decl.c (pushtag): Initialize newdecl. + * decl.c (pushtag): Push new type decl into correct scope. + +Mon Feb 7 14:42:03 1994 Jason Merrill + + * call.c, cvt.c, init.c, search.c, cp-tree.h: + Eradicate LOOKUP_PROTECTED_OK. + +Mon Feb 7 13:57:19 1994 Per Bothner + + * decl.c (pushtag, xref_tag), cp-tree.h: Add extra parameter + 'globalize' to signify implicit declarations. + * decl.c (globalize_nested_type, maybe_globalize_type): Removed. + * decl.c (set_identifier_type_value_with_scope): New function. + * decl.c (set_identifier_local_value): Simplify. + * spew.c (yylex, do_addr): Modify to return a _DEFN if a + forward declaration (followed by ';' and not preceded by 'friend'). + * class.c, decl.c, except.c, init.c, parse.y, + pt.c, search.c: Add new argument to calls to xref_tag and + pushtag. + +Mon Feb 7 00:22:59 1994 Jason Merrill + + * cp-tree.h (ACCESSIBLY_UNIQUELY_DERIVED_P): New macro, means what + ACCESSIBLY_DERIVED_FROM_P meant before. + (ACCESSIBLY_DERIVED_FROM_P): Now disregards ambiguity. + + * cvt.c (build_up_reference): Call get_binfo with PROTECT == 1. + + * search.c (get_base_distance_recursive): Members and friends of + a class X can implicitly convert an X* to a pointer to a private or + protected immediate base class of X. + (get_binfo_recursive): Likewise. + (get_base_distance): Ignore ambiguity if PROTECT < 0. + (get_binfo): Lose multiple values of PROTECT. + (compute_access): Protected is OK if the start of the + search is an accessible base class of current_class_type. + + * method.c (build_opfncall): Do check access on operator new here. + + * decl.c (finish_function): Don't check access on operator new + here. + +Sun Feb 6 14:06:58 1994 Jason Merrill + + * decl.c (xref_tag): The base of a derived struct is NOT always + public. Duh. + + * pt.c (do_explicit_instantiation): New function, called from + parser to do explicit function instantiation. + (type_unification): Allow the args list to be terminated with + void_list_node. + (do_pending_expansions): Look at i->interface for non-member + templates. + + * parse.y (datadef): Move explicit_instantiation here. + (structsp): From here. + (datadef): Complain about `int;'. + +Sun Feb 6 12:33:18 1994 Per Bothner + + * pt.c (end_template_instantiation), cp-tree.h: Remove unused + second parameter, and simplify first from a TREE_LIST where + we only care about its TREE_VALUE to just the value (an IDENTIFIER). + * pt.c (instantiate_member_templates): Simplify argument list + from a TREE_LIST to just an IDENTIFIER. + * lex.c (yyprint): PRE_PARSED_CLASS_DECL is now just an IDENTIFIER. + * parse.y (template_instantiate_once): Simplify accordingly. + * decl.c (inner_binding_level): New. Use various places to + simplify. + +Sun Feb 6 02:49:37 1994 Jason Merrill + + * typeck2.c (build_functional_cast): int() -> int(0). + +Sat Feb 5 00:53:21 1994 Jason Merrill + + * class.c (finish_struct): Don't do a bitwise copy for op= if the + class has a virtual function table. + + * typeck.c (convert_for_initialization): Restore warnings about + not using defined op=. Should really be my_friendly_aborts, I + s'pose. + +Fri Feb 4 14:21:00 1994 Jason Merrill + + * class.c (finish_struct): Tidy up conditions for doing bitwise + copies of objects. + + * decl.c (build_default_constructor): #if 0 out. + + * *: Eradicate TYPE_GETS_{ASSIGNMENT,ASSIGN_REF,CONST_ASSIGN_REF, + CONST_INIT_REF}, TYPE_HAS_REAL_CONSTRUCTOR. + + * decl.c (grokdeclarator): Don't return void_type_node for + friends being defined here. + + * init.c (perform_member_init): Only do the init if it's useful. + + * lex.c (default_copy_constructor_body): If we don't need to do + memberwise init, just call __builtin_memcpy. + (default_assign_ref_body): Likewise. + + * decl.c (grokdeclarator): If friendp && virtualp, friendp = 0. + +Fri Feb 4 13:02:56 1994 Mike Stump + + * lex.c (reinit_parse_for_method, cons_up_default_function): + Don't give warn_if_unknown_interface warning when it came from a + system header file. + * pt.c (end_template_decl, instantiate_template): Likewise. + * decl.c (start_decl): Likewise. + +Fri Feb 4 00:41:21 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't try to set TYPE_WAS_ANONYMOUS on + enums. + + * decl2.c (constructor_name_full): Use IS_AGGR_TYPE_CODE instead of + IS_AGGR_TYPE, since we don't know it's a type. + +Thu Feb 3 11:36:46 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't complain about anonymous unions. + + * cp-tree.h (TYPE_WAS_ANONYMOUS): This struct was originally + anonymous, but had a name given to it by a typedef. + + * decl.c (grokdeclarator): When renaming an anonymous struct, set + TYPE_WAS_ANONYMOUS. + + * decl2.c (constructor_name_full): Use TYPE_WAS_ANONYMOUS. + + * cp-tree.h (DECL_UNDEFINED_FRIENDS): #if 0 out. + + * init.c (xref_friend): Don't set up DECL_UNDEFINED_FRIENDS. + (embrace_waiting_friends): Don't use DECL_UNDEFINED_FRIENDS. + + * decl.c (grokdeclarator): Set TYPE_NESTED_NAME properly on nested + anonymous structs that get typedef'd. + + * decl.c (grokdeclarator): Always return void_type_node for + friends. + + * error.c (dump_function_decl): Don't use DECL_CLASS_CONTEXT for + friends. + (dump_function_decl): Don't print out default args for + a function used in an expression. + + * decl.c (grokdeclarator): Give error on abstract declarator used + in an invalid context (i.e. `void (*)();'). + + * error.c (cp_line_of): Support _TYPE nodes. + (cp_file_of): Likewise. + + * cvt.c (build_up_reference): Don't abort if passed a SAVE_EXPR; + it can happen for the RHS of an assignment stmt where the LHS is + a COND_EXPR. + + * init.c (expand_aggr_init_1): Deal with bracketed initializer + lists properly. + + * class.c (finish_struct): Deal with enumerators and typedefs + again. + +Wed Feb 2 11:30:22 1994 Jason Merrill + + * class.c (finish_struct): Tidy up loop over fields. + + * errfn.c (cp_thing): Don't advance twice after a format. + + * class.c (finish_struct): Complain about needing a constructor + if a member has only non-default constructors, and don't try to + generate a default constructor. + + * decl.c (finish_decl): Also do the constructor thing if + TYPE_NEEDS_CONSTRUCTING is set (for arrays). + + * search.c (unuse_fields): New function: mark all fields in this + type unused. + (dfs_unuse_fields): Helper function. + + * class.c (pushclass): If the new class is the same as the old + class, still unuse the fields. + (unuse_fields): Move to search.c. + + * decl.c (grok_op_properties): Add friendp argument. + (grokfndecl): Pass it. + (start_method): Likewise. + + * decl2.c (delete_sanity): Add use_global_delete parameter to catch + ::delete calls. + + * parse.y (unary_expr): Pass new parameter to delete_sanity. + + * lex.c (default_copy_constructor_body): Don't choke if the union + has no fields. + (default_assign_ref_body): Likewise. + + * call.c (compute_conversion_costs_ansi): Do the right thing for + ellipsis matches. + + * decl.c (push_to_top_level): Optimize. + + * decl.c (start_function): Look for the lexical scope of a friend + in DECL_CLASS_CONTEXT. + + * init.c (do_friend): Set DECL_CLASS_CONTEXT on global friends. + +Tue Feb 1 15:59:24 1994 Jason Merrill + + * cp-tree.h (TREE_GETS_PLACED_NEW): New macro. + + * init.c (init_init_processing): Don't assign BIN/BID to the + IDENTIFIER_GLOBAL_VALUEs of their respective operators. + (build_new): Check TREE_GETS_PLACED_NEW. + + * decl.c (grok_op_properties): Don't set TREE_GETS_NEW for a decl of + op new with placement, set TREE_GETS_PLACED_NEW. + + * cp-tree.h (ANON_UNION_P): New macro. Applies to decls. + + * class.c (finish_struct): Don't treat anonymous unions like + other aggregate members. Do synthesize methods for unions without + a name, since they may or may not be "anonymous unions". + + * decl2.c (grok_x_components): Wipe out memory of synthesized methods + in anonymous unions. + + * lex.c (default_copy_constructor_body): Support unions. + (default_assign_ref_body): Likewise. + +Mon Jan 31 12:07:30 1994 Jason Merrill + + * cp-tree.h: Fix documentation of LOOKUP_GLOBAL, add prototypes. + + * error.c (args_as_string): New function (%A), like type_as_string + except NULL_TREE -> "..." + + * call.c (build_overload_call_real): Fix for new overloading. + + * decl.c (grok_op_properties): Set all of the TYPE_OVERLOADS_* flags + here. + + * parse.y (operator_name): Instead of here. + + * typeck2.c (build_functional_cast): Treat a TREE_LIST as a list + of functions. + + * call.c (build_overload_call_real): Support LOOKUP_SPECULATIVELY. + + * method.c (build_opfncall): Don't need to massage return value + any more, call build_overload_call with all flags. + + * typeck.c (build_x_binary_op): Put back speculative call to + build_opfncall. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + +Mon Jan 31 10:00:30 1994 Mike Stump + + * cvt.c (build_type_conversion_1): Change call to pedwarn into + warning, and conditionalize upon warn_cast_qual. + +Fri Jan 28 11:48:15 1994 Jason Merrill + + * search.c (lookup_field): If xbasetype is a binfo, copy it to + avoid clobbering its inheritance info. + + * call.c (build_method_call): Don't overwrite basetype_path with + TYPE_BINFO (inst_ptr_basetype) if they have the same type. + + * search.c (compute_access): Fix handling of protected inheritance + and friendship with the enclosing class. + + * typeck2.c (store_init_value): Allow passing of TREE_CHAIN for + initialization of arbitrary variable. + + * typeck2.c (build_functional_cast): Only try calling a method if + one exists. + + * decl.c (grokdeclarator): Move handling of constructor syntax + initialization into first loop for generality. + (parmlist_is_random): Lose. + + * lex.c (cons_up_default_function): Set TREE_PARMLIST on arguments + to default function. + +Thu Jan 27 19:26:51 1994 Jason Merrill + + * decl.c (grokparms): Abort if we get called with something we don't + expect. + +Thu Jan 27 17:37:25 1994 Mike Stump + + * call.c (build_overload_call_real): Change argument complain to + flags to match style of rest of code. Pass it down to + build_function_call_real as necessary. + * call.c (build_overload_call, build_overload_call_maybe): Change + argument complain to flags to match style of rest of code. + * cp-tree.h (build_function_call_real): Added fourth flags + argument. + * cvt.c (convert_to_reference): Only give warning messages, if + LOOKUP_COMPLAIN is set. + * typeck.c (build_x_function_call): Change simple complain + argument to build_overload_call_maybe and build_overload_call, to + LOOKUP_COMPLAIN to match style of rest of code. + * typeck2.c (build_functional_cast): Likewise. + * typeck.c (build_function_call_real): Add flags, so that we can + not complain, if we don't want to complain. Complain about + arguments, if we are complaining, otherwise don't. + * typeck.c (build_function_call, build_function_call_maybe): + Stick in flags argument. + * typeck.c (build_x_binary_op, build_x_unary_op, + build_x_conditional_expr, build_x_compound_expr): Follow style of + build_x_indirect_ref, as it is more correct and more common. + +Thu Jan 27 14:36:20 1994 Jason Merrill + + * call.c (build_method_call): Don't check for being called with + a pointer. + + * decl2.c (finish_file): Don't play with DECL_CLASS_CONTEXT for the + static initializer function. + + * init.c (build_member_call): Use convert_force here, too. + + * search.c (compute_access): Only treat static members specially + if they are referenced directly. + +Wed Jan 26 18:28:14 1994 Jason Merrill + + * gxxint.texi (Access Control): New node. + + * search.c (current_scope): New function; returns whichever of + current_class_type and current_function_decl is the most nested. + (compute_access): Total overhaul to make it clearer and more + correct. Don't use the cache for now; in the only situation where + it was used before, it gained nothing. This frees up three of the + DECL_LANG_FLAGs for possible other use! + + * cp-tree.h: #if 0 out DECL_PUBLIC & friends. + + * typeck.c (build_component_ref_1): Don't check DECL_PUBLIC. + + * call.c (build_method_call): Use convert_force to cast `this' -- + rely on the access checking for the method itself. + + * init.c (is_friend): Do the nesting thing, handle types. I am + my own friend. + (is_friend_type): Become a shell for is_friend. + (add_friend): Never stick in ctype. + Why are the friendship functions in init.c, anyway? + +Wed Jan 26 17:50:00 1994 Mike Stump + + * cvt.c (build_type_conversion_1): Don't conditionalize call to + pedwarn upon pedantic. + +Wed Jan 26 17:20:46 1994 Mike Stump + + * cvt.c (convert_to_reference): Add 8.4.3 checking so that one + gets a warning if one tries to initialize a non-const & from a + non-lvalue. + * cvt.c (convert_to_reference): Use %P format for argument + numbers in warnings. + +Wed Jan 26 14:35:06 1994 Mike Stump + + * init.c (build_delete): Follow style in call.c to construct the + virtual call to the desctructor, as that code is right. Fixes a + problem of the compiler saying a pointer conversion is ambiguous. + +Wed Jan 26 11:28:14 1994 Jason Merrill + + * cp-tree.h (VTABLE_NAME_P): Change other occurrence of + VTABLE_NAME_FORMAT to VTABLE_NAME. + + * *: s/visibility/access/g + +Tue Jan 25 18:39:12 1994 Jason Merrill + + * typeck.c (build_modify_expr): Don't smash references if INIT_EXPR. + +Tue Jan 25 13:54:29 1994 Mike Stump + + * init.c (build_delete): Back out Jan 17th & 18th pacthes, as + they break libg++. + +Tue Jan 25 13:11:45 1994 Jason Merrill + + * decl.c (duplicate_decls): Fix pointer arithmetic. + +Mon Jan 24 15:50:06 1994 Chip Salzenberg + + [ cp-* changes propagated from c-* changes in 940114 snapshot ] + * cp-parse.y (maybe_attribute): Allow multiple __attribute__ + clauses on a declaration. + +Mon Jan 24 17:06:23 1994 Jason Merrill + + * class.c (finish_struct): Do synthesize methods for anon + structs, just not unions. + +Mon Jan 24 13:50:13 1994 Kung Hsu + + * decl.c (xref_tag): Handle anonymous nested type. + * decl.c (globalize_nested_type): Add no globalize bit check. + * spew.c (hack_more_ids): Templated nested decl not push top + level. + + * parse.y: Get rid of 'goto do_components'. It is much better + for debugging. + + * decl.c (is_anon_name): Get rid of the function and use the + macro ANON_AGGRNAME_P. + * pt.c: Ditto. + +Fri Jan 21 14:06:02 1994 Jason Merrill + + * class.c (finish_struct): Don't synthesize any methods for + anonymous structs/unions. + + * typeck.c (build_modify_expr): Don't treat pmf's as class objects. + +Thu Jan 20 18:56:46 1994 Jason Merrill + + * method.c (build_opfncall): Call build_indirect_ref on + synthesized instance for operator delete. + + * pt.c (type_unification): Don't abort if called with a list of + types in ARGS. + + * class.c (instantiate_type): Deal with function templates. + +Thu Jan 20 16:55:35 1994 Jim Wilson + + * Makefile.in (CC): Default to cc not gcc. + +Thu Jan 20 13:47:54 1994 Jason Merrill + + * typeck.c (build_modify_expr): Call constructor if appropriate. + + * decl.c (push_to_top_level): Clear out class-level bindings cache. + +Wed Jan 19 13:51:22 1994 Jason Merrill + + * call.c (resolve_scope_to_name): Work recursively (previously only + looked down one level). + + * lex.c (do_pending_inlines): If we're still dealing with the last + batch of inlines, don't start working on a new one. + + * Makefile.in (stamp-parse): Update conflict count. + (TAGS): Fix. + + * parse.y (explicit_instantiation): New rule; implements + 'template A' syntax (though not 'template foo(int)' yet). + (structsp): Add explicit_instantiation. + +Tue Jan 18 13:53:05 1994 Jason Merrill + + * class.c (finish_struct, etc.): Simplify decision to synthesize + a destructor. + + * call.c, class.c, cp-tree.h, decl.c, init.c, + ptree.c, search.c, typeck.c, typeck2.c: Nuke + TYPE_NEEDS_CONSTRUCTOR (change all calls to TYPE_NEEDS_CONSTRUCTING). + * init.c (expand_aggr_init_1): Don't try non-constructor methods + of initializing objects. + (build_new): Don't try other methods if the constructor lookup fails. + + * class.c (finish_base_struct): Set cant_have_default_ctor and + cant_synth_copy_ctor properly. + (finish_struct): Likewise. + +Mon Jan 17 13:58:18 1994 Jason Merrill + + * typeck.c (build_modify_expr_1): #if 0 out again. + (build_modify_expr): #if 0 out memberwise init code again. + + * lex.c (default_copy_constructor_body): Be const-correct. + (default_assign_ref_body): Likewise. + + * init.c (perform_member_init): Use TYPE_HAS_CONSTRUCTOR to decide + whether or not to use it, rather than TYPE_NEEDS_CONSTRUCTING. + (expand_aggr_init): Disable silent conversion from initializer list + to list of args for a constructor. + + * class.c (base_info): Lose needs_default_ctor. + (finish_base_struct): Likewise. + (finish_struct): Likewise. + + * decl.c (init_decl_processing): Don't turn off flag_default_inline + just because flag_no_inline is on. + (finish_decl): Use TYPE_HAS_CONSTRUCTOR to decide to use + constructor. + + * class.c (finish_struct): Synthesize default ctor whenever + allowed. + + * Makefile.in (TAGS): Don't try to run etags on cp-parse.y. + +Sat Jan 15 18:34:33 1994 Mike Stump + + * Makefile.in, configure: Handle the C++ front-end in a + subdirectory. + * cp-*: Move C++ front-end to cp/*. + +Fri Jan 14 14:09:37 1994 Jason Merrill + + * cp-typeck.c (build_function_call_real): Modify to match other + instances of taking the address of the function. + + * cp-class.c (finish_struct): Set TYPE_HAS_REAL_CONSTRUCTOR to 1 if + there are non-synthesized constructors. + Only set TYPE_NEEDS_CONSTRUCTOR if TYPE_HAS_REAL_CONSTRUCTOR. + Always generate copy constructor if possible. + + * cp-tree.h (lang_type): Add has_real_constructor bitfield. + (TYPE_HAS_REAL_CONSTRUCTOR): Define. + + * cp-lex.c (default_copy_constructor_body): Use init syntax + for all bases. + + * cp-type2.c (store_init_value): Only give error for initializer list + if TYPE_HAS_REAL_CONSTRUCTOR. + +Thu Jan 13 15:38:29 1994 Jason Merrill + + * cp-tree.h (DECL_SYNTHESIZED): Add defn. + (lang_decl): Add synthesized bitfield to decl_flags. + + * cp-lex.c (cons_up_default_function): Use DECL_SYNTHESIZED to mark + artificial methods, rather than a line # of 0. + +Fri Jan 14 18:25:29 1994 Kung Hsu + + * cp-decl (xref_tag): Fix a bug in conflict type. + * cp-parse.y: Add SCOPED_NAME for uninstantiated template nested + type reference. + * cp-spew.c (yylex): Generated SCOPED_NAME token. + * cp-lex.c (yyprint): Handle SCOPED_NAME. + +Fri Jan 14 17:00:29 1994 Mike Stump + + * cp-decl.c (pushdecl): Revert patch from Jan 11 19:33:03, as it is + not right. + +Thu Jan 13 14:00:35 1994 Kung Hsu + + * cp-decl2.c (grok_x_components): Fix a bug that enum type does not + have type_flags. + +Thu Jan 13 11:39:34 1994 Mike Stump + + Ensure that all vtable pointers are initialized with all the right + values. + + * cp-class.c (is_normal): Changed to reflect new meaning of + CLASSTYPE_VFIELD_PARENT. + * cp-class.c (maybe_fixup_vptrs): Use of + CLASSTYPE_NEEDS_VIRTUAL_REINIT here is misguided. Use + BINFO_MODIFIED instead. + * cp-class.c (finish_struct): Changed to reflect new meaning of + CLASSTYPE_VFIELD_PARENT. + * cp-decl.c (get_binfo_from_vfield): Removed, unneeded now. + * cp-decl.c (finish_function): Use init_vtbl_ptrs, instead of open + coding it here. + * cp-init.c (init_vfields): Changed name to init_vtbl_ptrs, and + re-implement. + * cp-init.c (emit_base_init): Use new name init_vtbl_ptrs. + * cp-tree.h (vfield_parent): Changed to integer. + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Changed docs to reflect new + meaning. + * cp-tree.h (init_vtbl_ptrs): Added init_vtbl_ptrs. + +Wed Jan 12 18:24:16 1994 Kung Hsu + + * cp-decl.c (xref_tag): Re-implement globalize nested type. + * cp-decl2.c (grok_x_components): Ditto. + * cp-parse.y: Ditto. + * cp-tree.h (lang_type): Add no_globalize bit in type_flags. + +Wed Jan 12 14:08:09 1994 Jason Merrill + + * cp-decl.c (grokdeclarator): Don't set TREE_PUBLIC on friend + decls with a definition attached. + + * cp-typeck.c (build_modify_expr): Undo previous change in the case + of INIT_EXPRs. + +Tue Jan 11 19:33:03 1994 Jason Merrill + + * cp-typeck.c (build_modify_expr): Replace code for generating + assignment semantics for classes with an error. + (build_modify_expr_1): #if 0 out. + + * cp-decl.c (pushdecl): Patch bogus design of pushdecl + behavior for overloaded functions (it doesn't push anything). + + * cp-class.c (finish_struct): When generating default op=, + set TYPE_HAS_ASSIGNMENT. + +Mon Jan 10 18:48:06 1994 Mike Stump + + * cp-cvt.c (convert): Make {double, clashing enum} -> enum + invalid. + * cp-typeck.c (convert_for_assignment): Simplify. + * cp-decl2.c (warn_enum_clash): Removed. + * invoke.texi (-Wenum-clash): Removed. + * toplev.c (-Wenum-clash): Removed. + +Mon Jan 10 17:48:37 1994 Kung Hsu + + * cp-decl.c (finish_decl): Fix incorrect popclass call. + + * cp-decl.c (is_anon_name): New function, check whether the name + is anonymous name generated by compiler. + * cp-decl.c (grokdeclarator): Allow nested SCOPE_REF + * cp-spew.c (hack_more_ids): Handle nested type in template. + * cp-parse.y: Handle nested type reference in uninstantiated + template. + * cp-call.c (build_method_call): Handle uninstantiated template + case. + * cp-pt.c (search_nested_type_in_tmpl): New function, search nested + type in template. + * cp-pt.c (lookup_nested_type_by_name): New function, lookup nested + type by name. + * cp-pt.c (tsubst): Handle nested type search by name. + +Mon Jan 10 14:32:18 1994 Jason Merrill + + * cp-init.c (build_member_call): Propagate qualifiers to new type. + + * cp-call.c (build_method_call): Count functions the new way. + +Fri Jan 7 19:03:26 1994 Jason Merrill + + * cp-decl.c (pushtag): Set DECL_ASSEMBLER_NAME for nested classes, + too. + +Tue Jan 4 16:45:51 1994 Kung Hsu + + * cp-parse.y: Change to handle whether to globalize nested class. + * cp-decl.c (xref_tag, maybe_globalize_type): Likewise. + +Mon Jan 3 22:22:32 1994 Gerald Baumgartner + + * Makefile.in cp-call.c cp-class.c cp-cvt.c cp-decl.c cp-decl2.c + cp-error.c cp-init.c cp-lex.c cp-lex.h cp-method.c cp-parse.y + cp-spew.c cp-tree.c cp-tree.h cp-type2.c cp-typeck.c cp-xref.c + gplus.gperf toplev.c: Incorporated C++ signature extension. + * cp-sig.c: New file, contains most of signature processing. + * cp-hash.h: Regenerated from gplus.gperf. + + * gcc.1 g++.1: Added explanation for the `-fhandle-signatures' + and `-fno-handle-signatures' command line flags. + + * gcc.texi: Changed the last-modification date. + * invoke.texi: Added `-fhandle-signatures' in the list of + C++ language options. Added explanation for this option. + diff --git a/contrib/gcc/cp/ChangeLog-1995 b/contrib/gcc/cp/ChangeLog-1995 new file mode 100644 index 00000000000..c4f4046ad05 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1995 @@ -0,0 +1,3791 @@ +Thu Dec 28 11:13:15 1995 Mike Stump + + * except.c (expand_builtin_throw): Use RETURN_ADDR_OFFSET instead of + NORMAL_RETURN_ADDR_OFFSET. + (end_eh_unwinder): Likewise. + +Wed Dec 27 22:18:16 1995 Mike Stump + + * gc.c (build_dynamic_cast): Make sure we don't cast away const + when dealing with references, and make sure we handle dynamic + casting to a cv qualified reference. + +Thu Dec 21 23:50:35 1995 Mike Stump + + * except.c (struct eh_context): New structure top hold eh context + information. + (push_eh_context): New routine. + (pop_eh_context): Likewise. + * decl.c (push_cp_function_context): Use them. + (pop_cp_function_context): Likewise. + +Wed Dec 20 12:42:51 1995 Jason Merrill + + * decl2.c (finish_file): Also prune uninteresting functions in the + inline emission loop. + +Wed Dec 20 02:32:07 1995 Jeffrey A Law + + * sig.c (build_signature_table_constructor): Mark functions + in the signature as referenced. + +Tue Dec 19 22:36:56 1995 Jason Merrill + + * decl2.c (finish_file): Do all the vtable/synthesis stuff before + the inline emission stuff. + +Mon Dec 18 15:51:33 1995 Jason Merrill + + * cp-tree.h, decl2.c (flag_weak): New flag to control the use of + weak symbols. + * lang-options.h: Add -f{no-,}weak. + * decl.c (init_decl_processing): If the target does not support weak + symbols, don't use them. + * decl2.c, pt.c: s/SUPPORTS_WEAK/flag_weak/. + +Sun Dec 17 21:13:23 1995 Rusty Russell + + * init.c (expand_member_init): warning for base init after members. + +Fri Dec 15 15:32:18 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Don't convert to a reference + type. + +Thu Dec 14 16:05:58 1995 Mike Stump + + * method.c (report_type_mismatch): Improve wording for volatile + mismatches. + +Thu Dec 14 14:16:26 1995 Mike Stump + + * init.c (expand_aggr_init_1): Use expand_aggr_init_1 instead of + expand_assignment, as the later doesn't handle things that have + copy constructors well. The compiler would do bitwise copying, + instead of ctor calling in some cases. + +Wed Dec 13 17:05:54 1995 Paul Eggert + + * g++.c (my_strerror): Return "cannot access" if errno is 0. + (pfatal_with_name, perror_exec): Don't assume that + the returned value from my_strerror contains no '%'s. + (concat): Remove. + (sys_nerror): Declare only if HAVE_STRERROR is not defined. + +Wed Dec 13 16:22:38 1995 Jason Merrill + + Lose CLASSTYPE_METHODS/DECL_NEXT_METHOD chain; make + TYPE_METHODS/TREE_CHAIN mean what they used to. + * decl2.c (constructor_name_full): Refer to CLASSTYPE_METHOD_VEC + instead of TYPE_METHODS. + * decl.c (duplicate_decls): Lose references to DECL_NEXT_METHOD. + * tree.c (tree_copy_lang_decl_for_deferred_output): Likewise. + * cp-tree.h (CLASSTYPE_METHODS): Lose. + (CLASSTYPE_METHOD_VEC): Point to lang_spec->methods instead of + TYPE_METHODS. + (struct lang_decl): Lose next_method field. + (DECL_NEXT_METHOD): Lose. + * class.c (finish_struct_methods): Don't mess with TYPE_METHODS. + (finish_struct): Just use TYPE_METHODS; we don't need fn_fields + anymore. + (finish_struct_methods): Don't mess with the TREE_CHAINs in + fn_fields. + + * search.c (add_conversions): Don't use TREE_CHAIN to traverse method + vector. + + * call.c (build_method_call): Synthesize here even when not inlining. + * typeck.c (build_function_call_real): Likewise. + +Wed Dec 13 15:02:39 1995 Ian Lance Taylor + + * cp/lex.c (check_newline): If DBX_DEBUGGING_INFO and write_symbols + == DBX_DEBUG, call dbxout_start_new_source_file and + dbxout_resume_previous_source_file when appropriate. + +Tue Dec 12 20:38:55 1995 Mike Stump + + * except.c (start_anon_func): Push to the top level. + (end_anon_func): Pop from the top level. + +Mon Dec 11 18:56:14 1995 Mike Stump + + * cp-tree.h (build_cleanup): New routine to build cleanups. + * decl.c (expand_static_init): Use build_cleanup to build a cleanup + call at ctor time and use atexit to run it later. + * decl2.c (build_cleanup): New routine, taken from finish_file. + (finish_file): Use build_cleanup instead, and don't put function + local statics in global dtor list. + +Wed Dec 6 14:34:29 1995 Mike Stump + + * except.c (expand_throw): Ensure that we have cleanups, if we try + and expand cleanups. + +Wed Dec 6 11:48:21 1995 Mike Stump + + * except.c (expand_throw): Add logic to manage dynamic cleanups for + the EH object. + (expand_end_catch_block): Use the magic of expand_goto, instead of + emit_jump so that we get the cleanup for any catch clause parameter + and the cleanup for the exception object. Update to reflect label + changes. + (push_eh_cleanup): New routine to register a cleanup for an + exception object. + (empty_fndecl): Used to default cleanup actions to + nothing. + (init_exception_processing): Setup empty_fndecl. Setup + saved_cleanup. + (expand_start_catch_block): Update to reflect label changes. Call + push_eh_object to register the cleanup for the EH object. + (start_anon_func): New routine to start building lambda expressions + from trees. + (end_anon_func): New routine to end them. + (struct labelNode): Change so that we can use tree labels, or rtx + labels. + (saved_cleanup): Object to check for dynamic cleanups for the + exception handling object. + (push_label_entry): Change so that we can use tree labels, or rtx + labels. + (pop_label_entry): Likewise. + (top_label_entry): Likewise. + (expand_start_all_catch): Use tree label instead of rtx label, so + that we can get the magic of expand_goto. + (expand_end_all_catch): Update to reflect label changes. + + * class.c (build_vfn_ref): Remove building_cleanup logic, as we now + use UNSAVE_EXPRs. + * typeck.c (get_member_function_from_ptrfunc): Remove remnants of + building_cleanup logic, as we now use UNSAVE_EXPRs. + * cp-tree.h (unsave_expr): Declare it. + * decl.c (building_cleanup): Remove. + (maybe_build_cleanup): Remove building_cleanup logic, and use + UNSAVE_EXPR instead. + +Sun Dec 3 01:34:58 1995 Mike Stump + + * gc.c (build_t_desc): Update error message to say . + +Thu Nov 30 12:30:05 1995 Brendan Kehoe + + * decl.c (pushdecl): Only warn about shadowing a local variable if + warn_shadow is true. + +Sun Nov 26 16:06:55 1995 Rusty Russell + + * typeck.c (build_binary_op_nodefault): Added warning about + comparisons between different enum types with -Wall, unless + -fenum-int-equiv set. + +Wed Nov 22 15:44:02 1995 Mike Stump + + * class.c (finish_struct_1): Skip down to the inner type in + multidimensional arrays. Ensures ctors will be made for types that + need constructing. + +Wed Nov 22 14:19:22 1995 Mike Stump + + * decl.c (last_dtor_insn): New to track the last compiler generated + insn in a dtor. + (store_parm_decls): Set it. + (finish_function): Use it to see if the dtor is empty. Avoid doing + vtable setup all the time, if we can. + (struct cp_function): Add last_dtor_insn. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + +Wed Nov 22 11:52:19 1995 Paul Russell + + * typeck.c (build_unary_op): Set TREE_NO_UNUSED_WARNING to avoid + warnings. + +Tue Nov 21 17:15:23 1995 Mike Stump + + * typeck.c (expand_target_expr): Make sure targets get put into the + current temp_slot_level, so that the free_temp_slots call will reuse + them. + +Tue Nov 21 13:32:03 1995 Mike Stump + + * class.c (finish_struct_1): Delay delta fixups for virtual bases + until after we have done the hard virtuals, to avoid a bogus `every + virtual function must have a unique final overrider' for virtual + functions that are only overridden by hard virtuals. + +Thu Nov 9 13:35:30 1995 Jason Merrill + + * pt.c (do_function_instantiation): Don't try to find a file-scope + template for a member function. + +Tue Nov 14 06:20:35 1995 Mike Stump + + * g++.c (main): Add handling of -nodefaultlibs. + +Mon Nov 13 15:45:34 1995 Mike Stump + + * cp-tree.h (INDIRECT_BIND): Add a way for the frontend to + distinguish between direct bindings of reference variables, and + indirect bindings of reference variables. + * cvt.c (build_up_reference): Use it. + * typeck.c (convert_arguments): Use it to indicate this is an + indirect binding. + * decl.c (cp_finish_decl): Ensure that we reuse stack slots as fast + as they are unused. + (expand_static_init): Likewise. + (cplus_expand_expr_stmt): Likewise. + * decl2.c (finish_file): Likewise. + * init.c (perform_member_init): Likewise. + (emit_base_init): Likewise. + (expand_aggr_vbase_init_1): Likewise. + +Fri Nov 10 09:18:09 1995 Brendan Kehoe + + * decl.c (push_namespace): Rewrite to use build_lang_decl, so we + get a DECL_LANG_SPECIFIC node. + * cp-tree.h (lang_decl_flags): Add new member `level'. + (NAMESPACE_LEVEL): Don't use decl.arguments, instead use the + decl_flags level member. + +Mon Nov 6 18:36:13 1995 Brendan Kehoe + + * call.c (build_method_call): Make sure instance has a + TYPE_LANG_SPECIFIC node before we dive into it. + +Sat Nov 4 20:01:52 1995 Jason Molenda + + * method.c (make_thunk): Use TREE_SET_CODE to set thunk's tree code. + +Thu Nov 2 17:56:57 1995 Mike Stump + + * decl.c (duplicate_decls): When smashing decls, smash staticness in + the usual way. + +Thu Nov 2 16:44:02 1995 Mike Stump + + * decl.c (poplevel): Handle the merging of subblocks of cleanups + when finishing blocks that have already been created (usually due to + the fixup goto code). Fixes bad debugging information. + +Wed Nov 1 12:33:53 1995 Jason Merrill + + * method.c (hack_identifier): Don't abort when we get a TREE_LIST + that's not a list of overloaded functions. + +Wed Nov 1 11:38:58 1995 Brendan Kehoe + + * decl2.c (mark_vtable_entries): Check DECL_LANG_SPECIFIC on fn + before trying to use DECL_ABSTRACT_VIRTUAL_P. + +Tue Oct 31 11:56:55 1995 Jason Merrill + + * decl2.c (mark_used): New function for hooking into setting of + TREE_USED on decls. + * call.c (build_method_call): Use it. + * class.c (instantiate_type): Likewise. + * init.c (build_offset_ref): Likewise. Don't call assemble_external + for all like-named functions. + * method.c (hack_identifier): Likewise. + (emit_thunk): Don't call assemble_external. + (make_thunk): Create thunk as a FUNCTION_DECL so that it + gets the right mode and ENCODE_SECTION_INFO works. + + * parse.y: Use mark_used. Pass operator names to do_identifier. + * lex.c (do_identifier): Handle operator names. + + * decl2.c (grokclassfn): Tweak __in_chrg attributes. + +Thu Oct 26 16:45:58 1995 Brendan Kehoe + + * errfn.c: Include stdio.h. + (cp_sprintf): Take out decl of sprintf, and cast sprintf to errorfn*. + +Wed Oct 25 18:58:41 1995 Mike Stump + + * typeck2.c (digest_init): Always convert initializers to the + right type. + +Wed Oct 25 13:25:24 1995 Mike Stump + + * init.c (member_init_ok_or_else): Don't allow member initializers + for indirect members, as it is invalid. + +Wed Oct 25 11:35:28 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow `friend signed ()'. + +Fri Oct 20 10:30:59 1995 Mike Stump + + * parse.y (for.init.statement): Catch compound statements inside for + initializations, if we're being pedantic. + +Fri Oct 20 10:03:42 1995 Mike Stump + + * decl.c (lookup_tag): Return NULL_TREE if we don't find what we are + looking for. + +Thu Oct 19 14:26:10 1995 Mike Stump + + * error.c (dump_expr): Don't core dump when a boolean expression is + used as a default argument. + +Thu Oct 19 10:36:30 1995 Jason Merrill + + * class.c (finish_struct_bits): Check aggregate_value_p instead of + RETURN_IN_MEMORY. + +Wed Oct 18 18:12:32 1995 Jason Merrill + + * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE on a + BLKmode type that would otherwise be returned in registers. + +Mon Oct 16 12:32:19 1995 Brendan Kehoe + + * g++.c (WITHLIBC): New macro. + (main): Declare saw_libc. Use WITHLIBC if `-lc' was used; set + saw_libc and pass it at the end if it was set. + +Wed Oct 11 16:30:34 1995 Brendan Kehoe + + * parse.y (fn.def1): Call split_specs_attrs in + declmods notype_declarator case. + +Sun Nov 26 14:47:42 1995 Richard Kenner + + * Version 2.7.2 released. + +Mon Nov 20 14:05:00 1995 Mike Stump + + * g++.c (pfatal_with_name): Add missing third argument to concat. + +Thu Oct 26 13:59:54 1995 Mike Stump + + * init.c (expand_aggr_init): Handle cv qualifiers on the object's + type. + +Sat Nov 11 08:25:55 1995 Richard Kenner + + * Version 2.7.1 released. + +Thu Nov 2 17:02:47 1995 Jason Merrill + + * call.c (convert_harshness): Handle references to arrays. + +Fri Oct 27 14:20:21 1995 Jason Merrill + + * typeck.c (comp_target_types): Check multi-level pointer + conversions in both directions. + +Tue Oct 17 21:39:05 1995 Jason Merrill + + * parse.y (explicit_instantiation): Fix 'extern template' with no + return type. + +Mon Oct 16 14:35:20 1995 Jason Merrill + + * parse.y (explicit_instantiation): Support automatic instantiation + of constructors. + (named_class_head_*): Support out-of-class definition of nested + types. + +Wed Oct 11 12:20:56 1995 Mike Stump + + * search.c (envelope_add_decl): New routine. Fix so that + methods are hidden in the same way that other members are. + (dfs_pushdecls): Cleanup and move functionality out of line, + into envelope_add_decl. + +Tue Oct 10 15:46:01 1995 Mike Stump + + * typeck.c (mark_addressable): Only call assemble_external if we + have started the output file. + +Tue Oct 10 11:27:18 1995 Jason Merrill + + * decl.c (start_function): Fix earlier cv-quals change. + +Mon Oct 9 23:53:05 1995 Mike Stump + + * parse.y (complex_direct_notype_declarator): Only push the class if + we are not already in the class. + +Mon Oct 9 11:22:03 1995 Doug Evans + + * decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + (grokdeclarator): #if 0 out call to build_decl_attribute_variant. + * typeck.c (common_type): Call merge_machine_type_attributes. + +Fri Oct 6 14:44:27 1995 Mike Stump + + * typeck.c (mark_addressable): Add missing call to + assemble_external. + +Wed Oct 4 15:06:39 1995 Mike Stump + + * decl.c (store_parm_decls): Make sure the unwinder start comes + before the exception specification start. + * except.c (expand_exception_blocks): Make sure the unwinder end + comes after the terminate protected catch clause region and after + the end of the exception specification region. + +Wed Oct 4 12:47:02 1995 Jason Merrill + + * lex.c (real_yylex): Fix identifier case for linemode. + (handle_sysv_pragma): Don't abort when we see a pragma we don't + recognize. + +Tue Oct 3 14:09:46 1995 Mike Stump + + * decl.c (store_parm_decls): Add a call to start_eh_unwinder. + * except.c (init_exception_processing): __throw doesn't take any + arguments. + (expand_builtin_throw): Likewise. Always use Pmode, instead of SImode + for all pointers. Use expand_builtin_return_addr to unwind the + first level off the stack. + (do_unwind): Always use Pmode, instead of SImode for all pointers. + (expand_exception_blocks): Add a call to end_eh_unwinder. + (start_eh_unwinder, end_eh_unwinder): New routines to build machine + independent stack unwinders for function/method calls. + +Mon Oct 2 17:20:42 1995 Mike Stump + + * tree.c (unsave_expr_now): Make sure we process the argument list + of any called functions. Fixes incorrect code generation for + cleanups. + +Mon Oct 2 13:04:16 1995 Mike Stump + + * typeck.c (get_member_function_from_ptrfunc): Save function if it + needs it. Cures core dump on things like (this->*(f()))(). + +Sat Sep 23 22:51:25 1995 Jason Merrill + + * decl.c (start_function): Conform to gcc cv-quals convention (no + expression has a cv-qualified type) in RESULT_DECLs. + * method.c (make_thunk): Likewise. + +Fri Sep 22 10:21:13 1995 Mike Stump + + * decl.c (pushtag): Add in the namespace name for the tag. + +Thu Sep 21 13:11:13 1995 Mike Stump + + * parse.y (maybe_base_class_list, base_class_list, base_class, + base_class_access_list): Make sure we see the typenames for base + classes. + * lex.c (see_typename): Instead of failing to see a typename when + there is no next token, perfer a typename, and get the next token. + +Wed Sep 20 12:35:27 1995 Michael Meissner + + * decl.c (init_decl_processing): Add __builtin_expect. + +Tue Sep 19 16:48:11 1995 Mike Stump + + * cvt.c (cp_convert_to_pointer): Don't allow leftover conversions to + or from pointer to member functions, they must all be handled before + this point. + +Fri Sep 15 17:14:47 1995 Brendan Kehoe + + * init.c (resolve_offset_ref): Fix wording of non-static member + being referenced as a static. + +Fri Sep 15 12:39:11 1995 Jason Merrill + + * typeck.c (build_indirect_ref): Only bash pointer if we actually + call build_expr_type_conversion. + +Thu Sep 14 18:24:56 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversion from + reference. + * typeck.c (build_indirect_ref): Avoid infinite recursion. + +Thu Sep 14 17:23:28 1995 Mike Stump + + * decl.c (expand_start_early_try_stmts): New routine to start a try + block at the start of the function, for function-try-blocks. + * cp-tree.h (expand_start_early_try_stmts): Declare it. + * parse.y (function_try_block): Use it, instead of doing it here, as + we don't want to include rtl.h here, as that conflicts with RETURN + in the parser. + +Wed Sep 13 18:32:24 1995 Mike Stump + + * lex.c (reinit_parse_for_block): Support saving inline + function-try-blocks, uses peekyylex. + * parse.y (eat_saved_input): New rule, permit the parser to see that + END_OF_SAVED_INPUT is ok, as it can see this when parsing the + handlers of a function-try-block. + (fndef): Use it. + (component_decl): Make sure TRY and RETURN can come after fn.def2. + * spew.c (peekyylex): New routine to peek at what will come next. + +Wed Sep 13 16:52:06 1995 Jason Merrill + + * typeck.c (comptypes): Tighten up comparisons of template type + parms. + + * decl.c (duplicate_decls): Turn off whining about virtual functions + redeclared inline for now. + +Wed Sep 13 11:13:40 1995 Mike Stump + + * decl.c (store_in_parms): New routine to put things before we + put base inits. + * cp-tree.h (store_in_parms): Declare it. + * decl.c (store_parm_decls): Use it to makr sure the starting of the + eh spec comes before base inits. + (finish_function): Use sequences instead of the obsolete + reorder_insns. + * parse.y (fndef): Enhance readability and maintainability. Update + to include function_try_block syntax. + (function_try_block): Add. + +Tue Sep 12 17:43:07 1995 Brendan Kehoe + + * call.c (convert_harshness): Use comptypes, not ==, to check if + TYPE and PARMTYPE are equivalent on a function type. + +Tue Sep 12 17:31:33 1995 Douglas Rupp + + * Make-lang.in (cc1plus): Removed unnecessary $(exeext). + +Mon Sep 11 23:24:07 1995 Mike Stump + + * except.c (expand_throw): Never allocate storage for thrown pointer + to objects. + +Mon Sep 11 19:36:45 1995 Mike Stump + + * except.c (expand_start_catch_block): Pointers to objects come + back from catch matching already dereferenced, don't dereference + again. + +Mon Sep 11 15:46:28 1995 Mike Stump + + * except.c (expand_throw): Only decay the throw expression, don't do + any default conversions. This is so that one can throw and catch + characters, and not have them match integers. + +Mon Sep 11 13:46:45 1995 Mike Stump + + * error.c (dump_aggr_type): Deal with anonymous unions that don't + have a TYPE_NAME. + +Fri Sep 8 20:40:27 1995 Brendan Kehoe + + * lex.c (handle_sysv_pragma): Deal with getting a comma from yylex. + +Fri Sep 8 15:51:41 1995 Mike Stump + + * except.c (expand_end_eh_spec): Handle empty EH specifications. + +Fri Sep 8 15:27:22 1995 Mike Stump + + * cp-tree.h (expand_start_eh_spec): Declare new routine. + (expand_end_eh_spec): Likewise. + * decl.c (store_parm_decls): Call expand_start_eh_spec to process + exception specifications. + * except.c (expand_leftover_cleanups): Remove unused parameter. + (expand_end_catch_block): Likewise. + (expand_exception_blocks): Likewise. + (expand_start_eh_spec): New routine to mark the start of an + exception specification region. + (expand_end_eh_spec): New routine to mark the end of an exception + specification region. + (expand_exception_blocks): Call expand_end_eh_spec to process + exception specifications. + +Fri Sep 8 14:40:48 1995 Per Bothner + + * lex.c (do_identifier): Use global binding in preference of + dead for local variable. + +Wed Sep 6 19:32:59 1995 Mike Stump + + * cp-tree.h (build_exception_variant): Remove used first argument. + * decl.c (duplicate_decls): Likewise. + (grokfndecl): Likewise. + (revert_static_member_fn): Likewise. + * decl2.c (grok_method_quals): Likewise. + * tree.c (build_exception_variant): Likewise. + * typeck.c (common_type): Likewise. + * decl2.c (grokclassfn): After changing the type, call + build_exception_variant, if necessary. + +Tue Sep 5 15:56:27 1995 Mike Stump + + * except.c (expand_throw): Run cleanups for the throw expression. + +Wed Aug 30 15:24:38 1995 Stephen L. Favor + + * except.c (expand_builtin_throw): Moved gen_label_rtx calls beyond + the store_parm_decls call which does initialization in the emit_* + code concerning label numbering. + +Thu Aug 31 09:01:07 1995 Mike Stump + + * except.c (expand_internal_throw): Let the frontend be responsible + for managing all frontend EH parameters, the backend routine only + needs to deal with backend values. type and value are no longer + passed to __throw. + (init_exception_processing): Likewise. + (expand_start_all_catch): Likewise. + (expand_end_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + +Tue Aug 29 15:04:36 1995 Jason Merrill + + * cp-tree.h (DECL_REAL_CONTEXT): Give the real declaration context + for a decl. + * decl.c (cp_finish_decl): Use it. + +Tue Aug 29 10:30:27 1995 Mike Stump + + * except.c (expand_internal_throw): Oops, almost forgot type and + value are now trees. + +Mon Aug 28 17:57:45 1995 Brendan Kehoe + + Fix the attribute handling to make sure they get noted before we + create the function's RTL, in case they can affect that. + * decl.c (grokfndecl): New arg ATTRLIST. Run + cplus_decl_attributes before creating the decl's rtl. + (grokdeclarator): New arg ATTRLIST, passed down into grokfndecl. + (shadow_tag, groktypename, start_decl, start_method): Pass a + NULL_TREE to grokdeclarator's new last arg. + * decl2.c (grokfield): New arg ATTRLIST, passed into grokdeclarator. + (grokbitfield, grokoptypename): Pass a NULL_TREE to + grokdeclarator's new last arg. + * except.c (expand_start_catch_block): Likewise. + * pt.c (process_template_parm, end_template_decl, + do_function_instantiation): Likewise. + * cp-tree.h (grokfield): Add arg. + (grokdeclarator): Move the prototype from here... + * decl.h: ...to here. + * lex.c (cons_up_default_function): Pass NULL_TREE to grokfield + ATTRLIST argument. + * parse.y: Create a list for the grokfield arg where appropriate, + and pass it down instead of calling cplus_decl_attributes. + +Mon Aug 28 15:07:24 1995 Mike Stump + + * except.c: Always allow turning on exception handling. Allow cross + compilations to use EH. + +Thu Aug 24 17:39:24 1995 Mike Stump + + * except.c (saved_pc, saved_throw_type, saved_throw_value): Use + trees, instead of rtxs, and don't depend on using special machine + dependent registers. + (expand_internal_throw): Likewise. + (init_exception_processing): Likewise. + (expand_start_all_catch): Likewise. + (expand_end_all_catch): Likewise. + (expand_start_catch_block): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + +Wed Aug 23 17:25:51 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversions to + reference types. + +Wed Aug 23 15:33:59 1995 Mike Stump + + * except.c (do_unwind): Work around backend bug with -fpic. + +Tue Aug 22 17:20:07 1995 Per Bothner + + * decl2.c (flag_new_for_scope): Add a new mode that follows ANSI + for-scoping, but supports (and warns about) old programs. + Make the new mode (with value 1) the default. + (lang_f_options): The on-value for flag_new_for_scope is now 2. + * cp-tree.h (DECL_DEAD_FOR_LOCAL, DECL_ERROR_REPORTED): New macros + (DECL_SHADOWED_FOR_VAR): Likewise. + * decl.c (struct binding_level): New fields dead_vars_from_for + and is_for_scope. + (note_level_for_for): New function. + (poplevel): Special processing if is_for_scope. + (pushdecl): Warn if for-scope variable shadows local. + * lex.c (do_identifier): Handle old (non-ANSI) for scoping, + and warn if conflicts. + * parse.y (FOR): Call note_level_for_for. + +Mon Aug 21 10:28:31 1995 Jason Merrill + + * decl2.c (import_export_inline): Class interface hackery does not + apply to synthesized methods. + +Sun Aug 20 16:29:00 1995 Mike Stump + + * search.c (virtual_context): Find the right context more often. + Solves a `recoverable compiler error, fixups for virtual function' + problem. + +Sun Aug 20 13:53:24 1995 Mike Stump + + * except.c (expand_start_all_catch): Ensure that we always transfer + control to the right EH handler, by rethrowing the end label on the + region, instead of hoping we are nested and falling through. + (expand_leftover_cleanups): Likewise. + (end_protect): Since we now rethrow the end label, put a + nop after it, so that outer regions are recognized. + * init.c (build_vec_delete_1): New routine to handle most of vector + deleting, all code moved here from build_vec_delete. + (build_array_eh_cleanup): Use build_vec_delete_1 to do all the real + work. + (expand_vec_init): If the array needs partial destructing, setup an + EH region to handle it. + (build_vec_delete): Move lots of code to build_vec_delete_1, use + build_vec_delete_1 to do the grunt work. + +Sat Aug 19 14:25:33 1995 Brendan Kehoe + + Handle decl attributes properly for function definitions without + previous attribute-loaded declarations. + * decl.c (start_function): New arg ATTRS. Add a call to + cplus_decl_attributes with it before we create the RTL. + * cp-tree.h (start_function): Update prototype. + * parse.y (fn.def1): Pass ATTRS into start_function instead of + trying to call cplus_decl_attributes too late. Pass a NULL_TREE + for other use. + * decl2.c (finish_file): Pass NULL_TREE as fourth arg to + start_function. + * method.c (synthesize_method): Likewise. + * except.c (expand_builtin_throw): Likewise for start on __throw. + +Sat Aug 19 13:36:08 1995 Mike Stump + + * class.c (set_rtti_entry): Turn on -fvtable-thunk -frtti support. + This changes -fvtable-thunks vtable layout, so a recompile will be + necessary, if you use -fvtable-thunks. + (get_vtable_entry): Use n, instead of i to be consistent with the + rest of the compiler. + (get_vtable_entry_n): Likewise. + (add_virtual_function): Add a slot for the tdesc, if -fvtable-thunks + are being used. + (finish_struct_1): Likewise. + (skip_rtti_stuff): New routine to collapse similar code from many + different parts of the compiler. I think I got them all. + (modify_one_vtable): Use it. + (fixup_vtable_deltas1): Likewise. + (override_one_vtable): Likewise. + * decl2.c (mark_vtable_entries): Likewise. + * tree.c (debug_binfo): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (get_abstract_virtuals_1): Likewise. Use virtuals, instead of tmp to + consistent with the rest of the compiler. + (get_abstract_virtuals): Likewise. + * cp-tree.h (skip_rtti_stuff): New routine, declare it. + * gc.c (build_headof): Support -fvtable-thunk and -frtti together. + (build_typeid): Likewise. + (build_classof): Remove old style way of doing rtti. Remove support + for `classof' and `headof'. + * gxx.gperf: Likewise. + * hash.h: Likewise. + * parse.y: Likewise. + +Fri Aug 18 17:31:58 1995 Jason Merrill + + * decl.c (start_function): Clear ctor_label and dtor_label. + + * class.c (finish_struct_1): Fix handling of access decls. + +Tue Aug 15 19:21:54 1995 Jason Merrill + + * class.c (finish_struct): Only do minimal processing here, so it + can be used for class template definitions, as well. + (finish_struct_1): New function with the rest of the code. + +Tue Aug 15 09:46:16 1995 Mike Stump + + * class.c (prepare_fresh_vtable): On second though, always build the + offset (see Aug 10 change), unless -fvtable-thunks is given. It + does this by calling the new routine set_rtti_entry. + (finish_struct): Likewise. + (set_rtti_entry): New routine to update the rtti information at the + start of the vtable. + +Mon Aug 14 12:21:22 1995 Brendan Kehoe + + * error.c (dump_decl, case IDENTIFIER_NODE): Only work on a dtor + if it's declared in the C++ language spec. + (dump_function_decl): Likewise. + (dump_function_name): Likewise. + (ident_fndecl): Make sure we got something back from lookup_name. + * decl.c (start_function): Likewise. + +Fri Aug 11 16:52:15 1995 Jason Merrill + + * call.c (build_method_call): Don't call build_new when calling a + constructor without an instance. + +Thu Aug 10 20:00:17 1995 Mike Stump + + * class.c (prepare_fresh_vtable): Always build the offset to the + complete object, as it doesn't cost much. This allows dynamic_cast + to void * to work when -frtti isn't given. + (finish_struct): Likewise. + +Thu Aug 10 16:31:28 1995 Mike Stump + + * except.c (build_eh_type): Split out some functionality to new + routine named build_eh_type_type. + (build_eh_type_type): New routine. + (expand_start_catch_block): Use build_eh_type_type, as we never want + the dynamic type of the catch parameter, just the static type. + Fixes core dumps when -frtti is used and one catchs pointers to + classes. + +Thu Aug 10 14:55:29 1995 Mike Stump + + * except.c (expand_builtin_throw): Since we now use normal calling + conventions for __throw, we have to remove the first layer off the + stack, so that the next context we search for handlers is the outer + context instead of the context that had the call to __throw, if we + don't immediately find the desired context. + +Tue Aug 8 17:44:23 1995 Jason Merrill + + * tree.c (cp_expand_decl_cleanup): Returns int, not tree. + * cp-tree.h: Update. + + * parse.y (template_type_parm): Add support for `typename'. + +Tue Aug 8 12:06:31 1995 Mike Stump + + * except.c (expand_internal_throw): New internal routine to throw a + value. + (expand_end_all_catch, expand_leftover_cleanups): All throwers + changed to use `expand_internal_throw' instead of jumping to throw + label. + (expand_end_catch_block, expand_throw): Likewise. + (throw_label): Removed. + (expand_builtin_throw): Changed so that EH parameters are passed by + normal function call conventions. Completes Aug 4th work. + +Fri Aug 4 17:17:08 1995 Mike Stump + + * cp-tree.h (expand_builtin_throw): Declare it. + * decl2.c (finish_file): Call expand_builtin_throw. + * except.c (make_first_label): Remove. + (init_exception_processing): Don't use a LABEL_REF for throw_label, + instead use a SYMBOL_REF, this is so that we don't use LABEL_REFs in + other functions that don't really appear in those functions. This + solves a problem where cc1plus consumed exponential amounts of + memory when -Wall was used. + (expand_end_all_catch, expand_leftover_cleanups, + expand_end_catch_block, expand_throw): Change all uses of + throw_label to match new style. + (do_unwind): Rename parameter to inner_throw_label, as it is now + different from throw_label. Also, assume that our caller will wrap + the passed label with a LABEL_REF, if needed. + (expand_builtin_throw): Make external, change so that the generated + throw is now a real function. + (expand_exception_blocks): Never generate throw code inside another + function. + +Fri Aug 4 12:20:02 1995 Mike Stump + + * decl.c (grokdeclarator): Move checking of mutable const objects + and mutable static objects down, as we might decide during parsing + to unset staticp or constp (for example, when const is part of the + object being pointed to). + +Thu Aug 3 17:13:43 1995 Mike Stump + + * except.c (output_exception_table_entry): Enhance portability to + weird machines. + (emit_exception_table): Likewise. + +Thu Aug 3 16:41:38 1995 Mike Stump + + * typeck.c (build_ptrmemfunc): Handle casting of pointer to + non-virtual member functions. + +Wed Aug 2 11:58:25 1995 Mike Stump + + * gc.c (build_typeid): Strip cv qualifiers so that const T&, T&, T + and const T all match. + +Wed Aug 2 11:25:33 1995 Mike Stump + + * except.c (build_eh_type): Strip cv qualifiers so that const T&, + T&, T and const T all match. + +Tue Aug 1 14:20:16 1995 Mike Stump + + * except.c: Fix up comments, cleanup code and eliminate exceptNode, + exceptStack, exceptstack, push_except_stmts, pop_except_stmts, + new_except_stack, push_last_insn, pop_last_insn, insn_save_node and + InsnSave. Also, numerous speed improvements, and correctness + improvements. Double faulting in all situations should now be + handled correctly. + (expand_start_all_catch): Instead of having many terminate protected + regions, just have one. + (expand_start_catch_block): No longer have to protect + false_label_rtx, as it isn't used for EH region marking. + (expand_end_catch_block): Expand out EH cleanups here by using + expand_leftover_cleanups. + (expand_end_all_catch): Use sequences instead of playing with insn + links directly. + (expand_exception_blocks): Likewise. Also protect all catch clauses + with one terminate region. + +Mon Jul 31 13:24:30 1995 Jason Merrill + + * method.c (report_type_mismatch): Don't talk about an object + parameter for non-methods. + +Sun Jul 30 13:13:02 1995 Jason Merrill + + * class.c (finish_struct): Catch private and protected members of + anonymous unions here. + * decl2.c (finish_anon_union): And here. + * parse.y: Instead of here. + + * errfn.c (ARGSLIST): Support passing four args. + * error.c (cv_as_string): New function. + (cp_printers): Add it. + * call.c (build_method_call): Report 'const' at end of pseudo-decl. + + * method.c (report_type_mismatch): Deal with a bad_arg of 0. + + * init.c (expand_aggr_init): Handle volatile objects, too. + +Sat Jul 29 13:42:03 1995 Jason Merrill + + * decl.c (struct binding_level): Keep list of incomplete decls. + (print_binding_level): Use list_length to count them. + (pushdecl): Build up the list. + (hack_incomplete_structures): Walk it and prune completed decls. + +Fri Jul 28 15:26:44 1995 Jason Merrill + + * typeck.c (comp_target_types): Don't check const and volatile for + function types. + (comp_ptr_ttypes_real): Likewise. + +Thu Jul 27 15:40:48 1995 Jason Merrill + + * typeck.c (comp_target_types): Fix. + +Thu Jul 27 15:10:48 1995 Mike Stump + + * cp-tree.h (unsave_expr_now, build_unsave_expr, + cp_expand_decl_cleanup): Declare new routines. + * decl.c (cp_finish_decl, store_parm_decls, + hack_incomplete_structures): Change all cals from + expand_decl_cleanup to cp_expand_decl_cleanup. + * gc.c (protect_value_from_gc): Likewise. + * expr.c (cplus_expand_expr): Handle UNSAVE_EXPRs. + * tree.c (unsave_expr): New routine to build an UNSAVE_EXPR. + (unsave_expr_now): Backend routine used by tree expander. + (cp_expand_decl_cleanup): Wrap second argument in an UNSAVE_EXPR to + work around a limitation in the backend. The backend uses the + cleanups multiple times, on disjoint control flows, so we cannot + pass unsaved SAVE_EXPRs to the backend. + * tree.def (UNSAVE_EXPR): New tree code. + * typeck.c (c_expand_return): Move goto/return code up inside + conditional, as we don't always want to do this, we only want to do + this when we don't otherwise finish with this control flow. + +Thu Jul 27 10:38:43 1995 Brendan Kehoe + + * parse.y (typespec): Only complain about typeof if we're not + getting it from a system header. + +Thu Jul 27 10:26:23 1995 Doug Evans + + Clean up prefix attribute handling. + * parse.y (reserved_declspecs): Link prefix attributes with declspecs. + (declmods): Likewise. + (all rules that reference typed_declspecs and declmods): Call + split_specs_attrs or strip_attrs to separate declspecs and attrs. + (lang_extdef): Delete resetting of prefix_attributes. + (template_def, notype_declarator rule): Use NULL_TREE for + prefix_attributes. + (condition): Use NULL_TREE for prefix_attributes. + (setattrs): Deleted. + (nomods_initdcl0): Set prefix_attributes to NULL_TREE. + (component_decl): Delete resetting of prefix_attributes. + (component_decl_1, notype_components rule): Use NULL_TREE for + prefix_attributes. + (simple_stmt): Delete resetting of prefix_attributes. + +Mon Jul 24 13:37:53 1995 Jason Merrill + + * call.c (convert_harshness): Deal with reference conversions before + others. Actually do array->pointer decay. Call comp_target_types + with pointer types rather than their targets. + + * typeck.c (comp_target_types): Avoid assigning D const * to B *. + +Mon Jul 24 08:54:46 1995 Brendan Kehoe + + * pt.c (to_be_restored): Move decl to global scope. + +Sat Jul 22 12:22:11 1995 Jason Merrill + + * decl.c (start_decl): Put back clearing of DECL_IN_AGGR_P. + +Fri Jul 21 17:09:02 1995 Jason Merrill + + * decl.c (grokdeclarator): Downgrade error about 'extern int A::i' + to pedwarn. + + * pt.c (instantiate_template): Also avoid instantiation if the + function has already been declared to be a specialization. + + * decl2.c (check_classfn): Ignore cname argument, and return the + matching function. + + * decl.c (start_decl): Handle declarations of member functions + outside of the class (i.e. specialization declarations). + +Thu Jul 20 10:34:48 1995 Jason Merrill + + * class.c (finish_struct): Don't mess with the type of bitfields. + + * various.c: s/TYPE_POINTER_TO/build_pointer_type/. + +Thu Jul 20 01:43:10 1995 Mike Stump + + * init.c (expand_aggr_init): Assume LOOKUP_ONLYCONVERTING if init + is not a parameter list (TREE_LIST). + (expand_default_init): If LOOKUP_ONLYCONVERTING is set, then set + LOOKUP_NO_CONVERSION so that we don't allow two-level conversions, + but don't set it otherwise. + +Wed Jul 19 20:32:01 1995 Mike Stump + + * init.c (expand_default_init): Don't allow two-level conversions + during construction. + +Wed Jul 19 18:06:37 1995 Mike Stump + + * gc.c (build_headof): The type of dyncasting to a pointer to cv + void, should be pointer to cv void. + +Wed Jul 19 17:25:43 1995 Mike Stump + + * gc.c (build_dynamic_cast): Allow casting in const. + +Wed Jul 19 16:34:27 1995 Mike Stump + + * typeck.c (build_const_cast): If we are passed error_mark_node, + return it. + +Wed Jul 19 15:24:48 1995 Brendan Kehoe + + * class.c (push_nested_class): Make sure TYPE is non-nil. + + * cvt.c (type_promotes_to): Watch for error_mark_node on the + incoming TYPE. + +Wed Jul 19 13:23:12 1995 Gerald Baumgartner + + * cp-tree.h (SIGTABLE_VT_OFF_NAME): Renamed from SIGTABLE_OFFSET_NAME. + (SIGTABLE_VB_OFF_NAME): New macro. + (vt_off_identifier): Renamed from offset_identifier. + (vb_off_identifier): Added extern declaration. + + * decl.c (vt_off_identifier): Renamed from offset identifier. + (vb_off_identifier): New variable to hold the identifier for the + sigtable field vb_off. + (init_decl_processing): Initialize vb_off_identifier. + Renamed vt_off_identifier from offset_identifier. + * sig.c (build_signature_method_call): Renamed offset_identifier and + local variable offset to vt_off_identifier and vt_off, respectively. + * sig.c (build_signature_table_constructor): Renamed offset to vt_off. + + * decl.c (init_decl_processing): Add vb_off field to + sigtable_entry_type. Reorder fields so that pfn gets properly + aligned at a 64 bit boundary on the Alpha. + * sig.c (build_signature_table_constructor): Build the constructor + according to the new layout. Set the vb_off field to -1 for now. + + * decl.c (init_decl_processing): Align sigtable_entry_type on word + boundaries instead of double word boundaries to save space. + +Tue Jul 18 16:58:37 1995 Mike Stump + + * cvt.c (cp_convert): Always call build_cplus_new for a ctor. + +Tue Jul 18 14:24:53 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Only forbid private/protected + in anonymous unions. We need to make this know when the type is + defined for an object, to not give the error. + +Mon Jul 17 14:22:44 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Don't allow access control + as private or protected for union members. + +Sun Jul 16 14:01:00 1995 Jim Wilson + + * lex.c (check_newline): For 'p' case, move goto skipline line to + before end brace for 'pragma'. + +Fri Jul 7 13:55:58 1995 Mike Stump + + * g++.1: Tiny updates. + +Fri Jul 7 13:05:20 1995 Mike Stump + + * decl.c (cp_finish_decl): Only destruct local static variables if + they are constructed, and only construct the first time control + passes completely through its declaration (if not initialized with a + constant-expression). + (expand_static_init): Likewise. + +Wed Jul 5 14:05:04 1995 Brendan Kehoe + + * typeck.c (comptypes, case OFFSET_REF): If either offset basetype + is a TEMPLATE_TYPE_PARM, give a match. + +Fri Jun 30 15:42:57 1995 Mike Stump + + * method.c (build_overload_value): Handle encoding of null pointer + constants (or any pointer with a constant numeric value) for + templates. + +Fri Jun 30 13:45:51 1995 Brendan Kehoe + + * call.c (convert_harshness): Add QUAL_CODE when we're faced with + const vs non-const for void conversions. + +Fri Jun 30 10:19:52 1995 Mike Stump + + * except.c (expand_start_all_catch): Fix problem with finding an + outer nested try block when there is no code to separate it from an + inner try block. + +Fri Jun 30 02:22:26 1995 Mike Stump + + * search.c (dfs_pushdecls): Consume 2 or 3 orders of magnitude less + memory please when virtual bases are used. + +Thu Jun 29 19:03:47 1995 Mike Stump + + * class.c (build_vbase_path): Avoid testing things that cannot be + null to see if they are null. + * cvt.c (convert_pointer_to_vbase): Remove code that doesn't work. + * decl.c (finish_function): Pass a type into the new + convert_pointer_to_vbase instead of a binfo. + * search.c (convert_pointer_to_vbase): Rewritten to use get_vbase + and convert_pointer_to_real. + (expand_indirect_vtbls_init): Use convert_pointer_to_vbase instead + of the more cryptic call to get_vbase. + +Thu Jun 29 09:35:05 1995 Mike Stump + + * decl.c (BOOL_TYPE_SIZE): Fix broken SLOW_BYTE_ACCESS check. + +Thu Jun 29 03:43:55 1995 Jason Merrill + + * pt.c (instantiate_template): Don't strip 'this' twice. + + * pt.c (coerce_template_parms): Allow null pointer constants. + + * decl.c (revert_static_member_fn): But only if DECL_ARGUMENTS is + set. + +Wed Jun 28 18:39:03 1995 Jason Merrill + + * decl.c (revert_static_member_fn): Also remove 'this' from + DECL_ARGUMENTS. + * decl2.c (check_classfn): Don't revert this function until we get a + match. + +Wed Jun 28 14:07:27 1995 Brendan Kehoe + + * parse.y (component_decl): Clear PREFIX_ATTRIBUTES here. + +Wed Jun 28 11:05:13 1995 Mike Stump + + * decl2.c (finish_file): Handle global vector news. + * init.c (build_new): Encode vector news so that later we will know + how many elements there are. + +Mon Jun 26 13:38:06 1995 Jason Merrill + + * expr.c (cplus_expand_expr): Don't mess with temp slots. + + * decl2.c (warn_if_unknown_interface): Don't crash if tinst_for_decl + returns null. + + * decl2.c (check_classfn): Use revert_static_member_fn. + * decl.c (revert_static_member_fn): Diagnose static member functions + declared const or volatile. + + * decl2.c (grokfield): Check for missing default args here, too. + (check_default_args): Function to do the checking. + * decl.c (pushdecl): Use it. + + * decl.c (pushdecl): Don't warn about shadowing a member of `this' + if there is no `this'. + +Sun Jun 25 11:34:25 1995 Jason Merrill + + * call.c (build_method_call): Downgrade 'called before definition' + to a warning, as it ought to go away after Monterey. + +Sat Jun 24 14:18:42 1995 Jason Merrill + + * pt.c (coerce_template_parms): Don't do extra checking on pointer + to member arguments. + + * class.c (finish_struct): const and reference members don't prevent + a class from being an aggregate. + + * class.c (finish_struct): Signatures are always aggregates. + +Fri Jun 23 17:20:29 1995 Jason Merrill + + * decl2.c (check_classfn): Improve error message. + + * pt.c (tsubst): Handle PROMOTE_PROTOTYPES. + +Thu Jun 22 01:50:42 1995 Jason Merrill + + * typeck.c (comptypes): Don't ignore method quals. + + * class.c (finish_struct): Non-abstract virtuals are always USED. + + * decl.c (build_ptrmemfunc_type): The underlying union type isn't + IS_AGGR_TYPE, either. + * class.c (finish_struct): Use CLASSTYPE_NON_AGGREGATE instead. + * cp-tree.h: Likewise. + + * cp-tree.h (lang_type): Add aggregate. + (CLASSTYPE_AGGREGATE): New macro. + (TYPE_NON_AGGREGATE_CLASS): Likewise. + * class.c (finish_struct): Determine whether a class is an + aggregate. + * decl.c (cp_finish_decl): Check TYPE_NON_AGGREGATE_CLASS instead of + TYPE_NEEDS_CONSTRUCTING. + * typeck2.c (digest_init): Check TYPE_NON_AGGREGATE_CLASS for + subobjects, too. + + * pt.c (tsubst, PARM_TYPE): Propagate DECL_ARTIFICIAL. + + * decl.c (start_function): For pre-parsed functions, layout all of + the parm decls again. + (grokvardecl): TREE_PUBLIC depends on DECL_THIS_EXTERN, not + DECL_EXTERNAL. + + * pt.c (coerce_template_parms): Improve checking for invalid + template parms. + +Wed Jun 21 12:01:16 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Forbid declaration of a static member + with the same name as its enclosing class. + +Mon Jun 19 10:28:14 1995 Jason Merrill + + * decl.c (finish_function): Clear current_class_decl. + + * typeck.c (build_conditional_expr): Use convert (boolean_type_node + instead of truthvalue_conversion. + + * class.c (finish_struct): A data member with the same name as the + class doesn't suppress constructors. + +Fri Jun 16 18:11:39 1995 Gerald Baumgartner + + * decl.c (start_function): If current_class_decl is a signature + pointer, don't dereference it but set C_C_D to current_class_decl. + +Fri Jun 16 17:06:28 1995 Jason Merrill + + * decl.c (duplicate_decls): Complain about virtual functions + redeclared to be inline. + +Fri Jun 16 13:20:38 1995 Mike Stump + + * decl.c (get_unique_name): New routine to name unnamed namespaces. + (push_namespace): Use get_unique_name for naming unnamed namespaces. + +Thu Jun 15 15:00:41 1995 Jason Merrill + + * parse.y: Call cplus_decl_attributes with prefix_attributes where + appropriate. + +Wed Jun 14 19:24:49 1995 Mike Stump + + * search.c (get_vbase): New routine to switch hierarchies from the + CLASSTYPE_VBASECLASSES to the normal one. + (expand_indirect_vtbls_init): Use get_vbase to figure out how we + want to convert to a vbase pointer. + +Mon Jun 12 17:50:30 1995 Jason Merrill + + * pt.c (instantiate_class_template): Add the new instantiation to + template_classes. + (do_pending_expansions): Call instantiate_member_templates on all of + the classes in template_classes. + +Mon Jun 12 12:36:59 1995 Mike Stump + + * decl.c (complete_array_type): Fill in the TYPE_DOMAIN of our + TYPE_MAIN_VARIANT if it is not filled in. + * init.c (build_delete): If the TYPE_DOMAIN is not set, give an + error instead of core dumping. + +Mon Jun 12 10:41:40 1995 Jason Merrill + + * call.c (can_convert): Also check for distance > 0. + (can_convert_arg): Likewise. + (user_harshness): Likewise. + +Fri Jun 9 19:17:21 1995 Jason Merrill + + * g++.c (MATH_LIBRARY): Provide default. + (main): Always link with the math library if we link with libstdc++. + + * decl.c (start_function): Complain about redefinition of a function + even when the pending_inline version is compiled after the other + version. + +Thu Jun 8 15:44:38 1995 Jason Merrill + + * gc.c (build_dynamic_cast): Build up a reference to a parameter of + aggregate type. + +Wed Jun 7 15:31:57 1995 Brendan Kehoe + + * init.c (build_vec_delete): Resolve an offset ref before we try to + use it. + +Wed Jun 7 14:19:32 1995 Jason Merrill + + * typeck.c (build_modify_expr): If the class lacks a constructor or + assignment operator, return error_mark_node. + (common_type): Use build_cplus_array_type. + +Tue Jun 6 09:41:27 1995 Mike Stump + + * class.c (dont_allow_type_definitions): New variable set when types + cannot be defined. + (finish_struct): Use it. + * cp-tree.h (dont_allow_type_definitions): Define it. + * parse.y (primary, handler_seq): Set it. + +Mon Jun 5 18:49:38 1995 Mike Stump + + * method.c (build_opfncall): Use DECL_CHAIN, not TREE_CHAIN for + results from lookup_fnfields. Always give warning/error on bad + code. + +Mon Jun 5 11:39:37 1995 Brendan Kehoe + + * init.c (member_init_ok_or_else): Don't allow initialization of + an ancestor's member from within a constructor. + +Mon Jun 5 11:20:34 1995 Gerald Baumgartner + + * sig.c (build_signature_table_constructor): Use DECL_CONTEXT + instead of DECL_CLASS_CONTEXT for calculating the vfield offset so + abstract virtual functions are handled correctly. + + * sig.c (build_signature_table_constructor): Store the correct + delta in signature table entries. It does not yet work for + classes with virtual base classes as implementations of signatures. + (build_signature_method_call): Add the delta to the object_ptr + before generating the function call. + + * call.c (build_method_call): Make instance_ptr the signature + pointer itself instead of dereferencing the optr. + * sig.c (build_signature_method_call): Dereference the optr for the + direct and virtual calls. + + * sig.c (build_signature_table_constructor): Make the tag for + default implementations -1 instead of 2. + (build_signature_method_call): Change the generated conditional + expression correspondingly. + + * sig.c (build_signature_pointer_constructor): Deleted the sorry + message that said we can't handle multiple inheritance for + implementations of signatures + (build_signature_method_call): Use the offset from the sigtable + entry instead of the vptr field from the signature pointer for + building a virtual function call. + + * class.c (build_vfn_ref): Deleted signature specific code, we don't + call this function anymore from build_signature_method_call. + + * cp-tree.h (SIGNATURE_VPTR_NAME): Deleted. We use the right vptr + field in the object now instead of in the signature pointer/ref. + (build_vptr_ref): Deleted extern declaration. + * sig.c (build_vptr_ref): Deleted. + (build_signature_pointer_or_reference_type): Deleted construction of + the vptr field. + (build_signature_pointer_constructor): Deleted initialization of/ + assignment to the vptr field. + + * sig.c (build_signature_table_constructor): Convert the signature + table entry fields to their correct types. + + * sig.c (build_signature_table_constructor): Don't call digest_init + for the fields of a sigtable entry, it's wasted time. + + * sig.c (build_signature_table_constructor): Correctly set the + offset and index fields of a sigtable entry. Build the constructor + the way digest_init does, digest_init can't handle initializing an + anonymous union inside a struct. + (build_signature_method_call): Use the index field instead of the + delta field to get the vtable index. + + * decl.c (init_decl_processing): Fix number of fields for building + sigtable_entry_type. + + * cp-tree.h (tag_identifier, offset_identifier): Added extern decls. + (SIGTABLE_CODE_NAME): Renamed to SIGTABLE_TAG_NAME. + (SIGTABLE_PFN_NAME): Deleted, we'll use VTABLE_PFN_NAME instead. + * decl.c (tag_identifier, offset_identifier): New variables to + hold the identifiers for the sigtable fields tag and offset. + (init_decl_processing): Initialize these variables. + (init_decl_processing): Use these variables to build the + sigtable_entry_type structure. Rename the code and offset fields + to tag and delta, respectively; add offset and index fields. Changed + types of fields from short_integer_type_node to delta_type_node. + * sig.c (build_signature_table_constructor): Rename code and offset + to tag and delta, respectively. + (build_signature_method_call): Likewise. Use above variables. + +Thu Jun 1 17:03:51 1995 Jason Merrill + + * decl.c (lookup_name_real): Don't try to look anything up in an + erroneous object. + +Fri Jun 2 10:30:14 1995 Mike Stump + + * method.c (build_overload_int): New routine. Break out + functionality from build_overload_value so we can reuse it. + (build_overload_value): Handle pointer to member functions as value + parameters for templates. + (build_overload_identifier): Since template parameters are shared + among all instantiations, we have to substitute in the real types + in TREE_TYPE (parm). + pt.c (coerce_template_parms): Likewise. + (push_template_decls): Likewise. + (grok_template_type): Deleted as template parameters are shared + among all instantiations. + +Wed May 31 19:10:32 1995 Mike Stump + + * decl.c (grokdeclarator): Always give errors on constant overflow + for array indices. + +Wed May 31 11:39:43 1995 Jason Merrill + + * typeck.c (commonparms): Don't abort if simple_cst_equal returns < 0. + (build_c_cast): Don't tack on a NON_LVALUE_EXPR when casting to + reference type. + (build_indirect_ref): Fix check for *&. + +Fri Jun 16 06:54:03 1995 Mike Stump + + * Version 2.7.0 released. + +Fri Jun 16 15:07:29 1995 Richard Kenner + + * Make-lang.in (DEMANGLER_PROG): Add LIBS. + +Thu Jun 15 15:00:41 1995 Jason Merrill + + * decl.c (define_function): Don't set DECL_INTERFACE_KNOWN. + +Wed Jun 7 20:00:31 1995 Mike Stump + + * *.[chy]: Change all callers of finish_decl to cp_finish_decl. + * decl.c (finish_decl): New routine to handle call backs from the + mid end (declare_hidden_char_array). + +Wed Jun 7 19:02:50 1995 Jason Merrill + + * decl.c (start_function): Handle setting C_C_D here. + (set_C_C_D): Removed. + (struct saved_scope): Remove class_decl. + (push_to_top_level): Don't save current_class_decl. + (pop_from_top_level): Don't restore current_class_decl or C_C_D. + (struct cp_function): Add C_C_D. + (push_cp_function_context): Save C_C_D. + (pop_cp_function_context): Restore C_C_D. + +Fri Jun 2 11:05:58 1995 Jason Merrill + + * decl.c (set_C_C_D): New function. suspend_momentary before + building C_C_D. + (pop_from_top_level): Call it. + (start_function): Likewise. + (pop_cp_function_context): Likewise. + + * class.c, cp-tree.h, decl.c, decl2.c, parse.y: Lose all references + to current_vtable_decl, CLASSTYPE_INST_VAR and CLASSTYPE_VTBL_PTR. + + * decl.c (push_cp_function_context): Save current_class_decl. + (pop_cp_function_context): Restore current_class_decl and set C_C_D. + (pop_from_top_level): Don't use CLASSTYPE_INST_VAR to set C_C_D. + (start_function): Likewise. + + * class.c (popclass): Don't mess with current_class_decl, + current_vtable_decl, or C_C_D. + +Mon May 29 12:45:10 1995 Paul Eggert + + * Make-lang.in (c++.mostlyclean): Remove $(DEMANGLER_PROG). + +Wed May 24 15:55:18 1995 Richard Kenner + + * decl.c (duplicate_decls): Check simple_cst_equal result against 0. + * decl2.c (finish_anon_union): Likewise. + * method.c (largest_union_member): Likewise. + +Wed May 24 14:41:11 1995 H.J. Lu + + * Make-lang.in (cxxmain.o): Replace single quotes with backslashes. + +Mon May 22 17:38:48 1995 Richard Kenner + + * Make-lang.in (g++, g++-cross, cc1plus, DEMANGLER_PROG): + Use $@ instead of output name so works even if have .exe. + (cxxmain.o): Use cp if ln -s fails. + (c++.install-man): Use $(exeext) in executable names. + (c++.mostlyclean, stage[1-4]): Use $(objext) in object file names. + * Makefile.in (../cc1plus): Use $(exeext) in name of executable. + +Wed May 24 01:39:03 1995 Jason Merrill + + * call.c (build_method_call): Parms can be null, duh. + +Tue May 23 01:32:09 1995 Jason Merrill + + * call.c (build_method_call): If convert_arguments failed, just bail. + +Fri May 19 10:31:11 1995 Jason Merrill + + * cvt.c (convert_force): Pass LOOKUP_NORMAL to cp_convert. + + * tree.c (copy_to_permanent): Oops. + +Fri May 19 10:01:07 1995 Brendan Kehoe + + * cp-tree.h (break_out_target_exprs): Add decl. + +Thu May 18 13:02:30 1995 Jason Merrill + + * decl.c (start_function): Move *all* interface handling stuff after + the pushdecl. + + * tree.c (mapcar): Renamed from make_deep_copy and generalized. + (perm_manip): Return t if permanent, otherwise 0. + (copy_to_permanent): Use them. + (bot_manip): Helper for break_out_target_exprs. + (break_out_target_exprs): New function. Uses mapcar. + + * typeck.c (convert_arguments): Use it. + + * method.c (hack_identifier): Use convert_from_reference to + dereference a reference. + +Wed May 17 17:54:54 1995 Mike Stump + + * call.c (convert_harshness): Move reference bashing before pointer + to member bashing. + +Wed May 17 16:57:53 1995 Mike Stump + + * cvt.c (convert_to_reference): Only complain, if complaints are + wanted. + * typeck.c (build_function_call_real): Likewise. If + LOOKUP_SPECULATIVELY is set and something won't work, return + NULL_TREE. + * cvt.c (cp_convert): Likewise. Pass flags down to build_method_call. + (convert): Pass LOOKUP_NORMAL to cp_convert. + * typeck.c (convert_for_assignment): Likewise. + (convert_force): Pass LOOKUP_COMPLAIN to cp_convert. + (convert_arguments): Get out early if we get an error_mark_node. + (convert_for_initialization): Use cp_convert instead of convert so + that we can pass flags down. + * cp-tree.h (LOOKUP_SPECULATIVELY): Added documentation. + +Wed May 17 01:43:58 1995 Jason Merrill + + * typeck2.c (store_init_value): Don't take the MAIN_VARIANT of the + decl type. + + * class.c (finish_struct): Don't complain about a class with no + user-defined constructors but with a member that has no default + constructor, as this is OK for aggregates. + + * expr.c (cplus_expand_expr, NEW_EXPR): If this is an explicit + constructor call, mark slot addressable. + +Tue May 16 18:37:51 1995 Douglas Rupp + + * g++.c: Changed WINNT to _WIN32. + +Tue May 16 12:40:16 1995 Jason Merrill + + * lex.c (handle_sysv_pragma): Don't use token_buffer. + +Tue May 16 12:05:26 1995 Mike Stump + + * call.c (resolve_scope_to_name): Add initial semantic support for + namespaces. + * class.c (finish_struct): Likewise. + * cp-tree.h (NAMESPACE_LEVEL): Likewise. + * cvt.c (build_up_reference, convert_to_reference): Likewise. + * decl.c (binding_level::namespace_p, suspend_binding_level): Likewise. + (resume_binding_level, toplevel_bindings_p): Likewise + (namespace_bindings_p, declare_namespace_level): Likewise. + (resume_level, push_namespace, pop_namespace): Likewise. + (pop_everything, pushtag, duplicate_decls, pushdecl): Likewise. + (implicitly_declare, lookup_namespace_name): Likewise. + (lookup_name_real, start_decl, make_temporary_for_reference): Likewise. + (obscure_complex_init, finish_decl, expand_static_init): Likewise. + (grokvardecl, grokdeclarator, parmlist_is_exprlist): Likewise. + (store_parm_decls, hack_incomplete_structures): Likewise. + * decl2.c (get_temp_name, finish_anon_union): Likewise. + (current_namespace, push_namespace, pop_namespace): Likewise. + (do_namespace_alias, do_toplevel_using_decl): Likewise. + (do_class_using_decl): Likewise. + * error.c (dump_decl): Likewise. + * init.c (build_member_call, build_offset_ref): Likewise. + * lex.c (identifier_type): Likewise. + * parse.y (lang_extdef, using_decl, extdef): Likewise. + (component_decl_1, nested_name_specifier_1): Likewise. + * spew.c (yylex): Likewise. + * tree.def (NAMESPACE_DECL): Likewise. + +Tue May 16 11:55:35 1995 Jason Merrill + + * decl.c (push_overloaded_decl): Return the new decl even if it + can't be pushed. + +Tue May 16 11:00:37 1995 Jason Merrill + + * typeck.c (decay_conversion): Split out from default_conversion. + (default_conversion): Call it. + (build_binary_op): Likewise. + (build_binary_op_nodefault): Use decay_conversion for truth ops. + +Mon May 15 12:47:56 1995 Jason Merrill + + * decl.c (warn_extern_redeclared_static): This is a pedwarn. + (duplicate_decls): Always use the old decl's linkage info. Don't + play with linkage of consts. + (pushdecl): Don't play with linkage of consts. + (redeclaration_error_message): Don't complain about an old public + decl and a new non-public decl here. + (grokvardecl): Handle linkage of consts here. + (grokdeclarator): An 'extern inline' is public. Pass constp to + grokvardecl. + (start_function): Wait until after the pushdecl to do some linkage + stuff. + + * decl2.c (import_export_vtable): Make duplicates weak rather than + static if supported. + (import_export_inline): Likewise. + * pt.c (do_pending_expansions): Likewise. + + * class.c (build_vbase_path): flag_assume_nonnull_objects only + affects reference conversion. + + * init.c (emit_base_init): Build up an RTL_EXPR and add it to + rtl_expr_chain. + * decl.c, decl2.c: s/base_init_insns/base_init_expr/. + +Tue May 16 07:06:28 1995 Paul Eggert + + * method.c (numeric_output_need_bar): Renamed from misspelling. + + * typeck.c (build_ptrmemfunc): Fix misspellings in messages. + +Sun May 14 10:26:22 1995 Richard Kenner + + * lang-options.h, lang-specs.h: New files. + +Thu May 11 00:31:48 1995 Jason Merrill + + * typeck.c (default_conversion): Don't check for BLKmode before + pulling out the decl_constant_value. + + * decl.c (start_function): Clear named_labels and shadowed_labels. + + * typeck.c (build_function_call_real): Also synthesize methods here. + +Wed May 10 00:55:59 1995 Jason Merrill + + * decl2.c (finish_file): Synthesize exported methods before the + reconsider loop. + + * parse.y: Move declaration of flag_new_for_scope to file scope. + +Tue May 9 19:10:33 1995 Mike Stump + + * decl2.c: Add flag_new_for_scope for new -ffor-scope flag. + * parse.y (FOR): Conditionalize the pushing and popping of scope for + the for-init-statement upon the new flag_new_for_scope. + * parse.y (try_block): Simplify and use compstmt. + +Mon May 8 12:41:52 1995 Jason Merrill + + * decl.c (define_function): Mark function decl artificial. + +Sun May 7 00:51:28 1995 Jason Merrill + + * parse.y (simple_stmt, FOR): Put back push/pop for condition scope. + + * decl2.c (grokclassfn): DECLs don't have cv-qualified types. + * tree.c (build_cplus_method_type): Likewise. + + * cp-tree.h (SET_DECL_ARTIFICIAL): Just set DECL_ARTIFICIAL to 1. + + * typeck.c (build_function_call_real): If convert_arguments failed, + just bail. + (convert_arguments): If one of the arguments is error_mark_node, + just bail. + +Sat May 6 02:39:41 1995 Jason Merrill + + * decl.c (duplicate_decls): Don't check DECL_NOT_REALLY_EXTERN for + decls that don't include it. + +Fri May 5 14:23:30 1995 Jason Merrill + + * decl.c (duplicate_decls): Decls that have DECL_INTERFACE_KNOWN or + DECL_NOT_REALLY_EXTERN set aren't extern decls. + + * typeck.c (build_indirect_ref): Don't call default_conversion for a + parameter of reference_type. + * cvt.c (convert_from_reference): Just use build_indirect_ref. + + * pt.c (do_type_instantiation): Only instantiate member functions + that actually come from templates. + +Fri May 5 09:46:05 1995 Mike Stump + + * parse.y: Generalized cleanup of poplevels, and compound statements + and compound statements in try blocks. Rewritten `for' rule so that + the scope of variables declared in the for clause is shortened to + span just to the end of the statement, instead of the whole + containing block. + +Fri May 5 00:37:14 1995 Jason Merrill + + * call.c (convert_harshness): Handle pointers to members better. + +Thu May 4 16:00:26 1995 Jason Merrill + + * decl2.c (delete_sanity): Do access control here. + * init.c (build_delete): Instead of here. + + * Make-lang.in: Build c++filt. + +Wed May 3 02:59:53 1995 Jason Merrill + + * decl2.c (cplus_decl_attributes): If we just modified a TYPE_DECL, + update our IDENTIFIER_TYPE_VALUE. + +Fri Apr 28 07:58:41 1995 Jason Merrill + + * lex.c (cons_up_default_function): Fix linkage of #pragma + implemented functions. + +Thu Apr 27 16:56:24 1995 Jason Merrill + + * method.c (build_overload_name): Simplify and fix repeated type + folding. + + * decl.c (grokdeclarator): Prohibit pointers to void or reference + members. + +Thu Apr 27 09:49:07 1995 Mike Stump + + * typeck2.c (process_init_constructor): Make sure initializers are + fully digested. + +Thu Apr 27 01:11:55 1995 Jason Merrill + + * lex.c (cons_up_default_function): Always defer synthesis. + +Thu Apr 27 00:20:37 1995 Jason Merrill + + * decl2.c (mark_inline_for_output): Don't play with pending_inline + stuff. + +Wed Apr 26 17:48:24 1995 Jason Merrill + + * call.c (user_harshness): New function; like build_type_conversion, + but doesn't actually build anything. + (compute_conversion_costs): Use it instead of build_type_conversion. + +Wed Apr 26 17:11:25 1995 Jason Merrill + + * typeck.c (build_function_call_real): Improve error message for + calling a non-function. + + * method.c (hack_identifier): Lose check for calling a data member. + +Wed Apr 26 16:59:13 1995 Mike Stump + + * typeck2.c (build_functional_cast): Remove very old cruft. + Seems like good code is generated without it. + +Wed Apr 26 00:47:16 1995 Jason Merrill + + * method.c (do_build_assign_ref): Fix handling of anonymous unions. + (do_build_copy_constructor): Likewise. + + * parse.y (simple_stmt, SWITCH): Call {push,pop}_switch. + + * decl.c (push_switch): New function. + (pop_switch): Likewise. + (define_case_label): Check for jumping over initialization. + + * call.c (build_method_call): Check for an inline function being + called before its definition has been seen. + * typeck.c (build_function_call_real): Likewise. + + * decl.c (duplicate_decls): Check for a function being redeclared + inline after its address has been taken. + + * typeck.c (build_conditional_expr): Handle related class lvalues. + +Tue Apr 25 13:20:45 1995 Jason Merrill + + * pt.c (do_pending_expansions): Don't expand unused templates. + + * parse.y (component_decl): Accept a lone semicolon. + +Tue Apr 25 00:25:56 1995 Jason Merrill + + * call.c (build_method_call): Don't allow an RTL_EXPR to serve as the + object parameter anymore. + + * expr.c (cplus_expand_expr): Don't create RTL_EXPRs with no insns. + +Mon Apr 24 12:35:48 1995 Jason Merrill + + * parse.y (simple_stmt, decl case): Clear prefix_attributes. + (lang_extdef): Likewise. + + * parse.y (maybe_parmlist): New rule for use in declarators where + this could either be a list of expressions or parameters. Calls + suspend_momentary before deciding which. + (direct_after_type_declarator): Use it. + (complex_direct_notype_declarator): Use it. + + * pt.c (tsubst): Propagate attributes const and noreturn. + + * typeck.c (build_modify_expr): If warn_synth, call build_opfncall + before doing the default thing. + +Thu Apr 27 21:49:36 1995 Doug Evans + + * typeck.c (common_type): Call lookup_attribute instead of + value_member. + +Tue Apr 25 18:07:43 1995 Richard Kenner + + * Make-lang.in: Change "realclean" to "maintainer-clean". + +Sun Apr 23 12:32:38 1995 Mike Stump + + * decl2.c (finish_file): Fix broken linked list handling. + +Fri Apr 21 18:08:43 1995 Jason Merrill + + * class.c (finish_base_struct): Don't set TYPE_HAS_COMPLEX_*_REF + as often. + (finish_struct): Likewise. + + * various: Use TYPE_HAS_TRIVIAL_* instead of TYPE_HAS_COMPLEX_*. + + * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): New macro. + (TYPE_HAS_TRIVIAL_ASSIGN_REF): New macro. + +Fri Apr 21 15:52:22 1995 Jason Merrill + + * typeck.c (c_expand_return): Only expand a returned TARGET_EXPR if + it is of the same type as the return value. + +Fri Apr 21 03:01:46 1995 Jason Merrill + + * decl2.c (finish_file): Reconsider if synthesizing a method wrote + out its assembly. + + * typeck.c (convert_for_initialization): Don't call a trivial copy + constructor. + + * typeck2.c (store_init_value): Only abort if the type has a + non-trivial copy constructor. + + * typeck.c (c_expand_return): If we're returning in a register and + the return value is a TARGET_EXPR, expand it. Only do + expand_aggr_init if we're returning in memory. + (expand_target_expr): Function to expand a TARGET_EXPR. + (build_modify_expr): Use it. + + * tree.c (build_cplus_new): Layout the slot. + + * expr.c (cplus_expand_expr): Use expand_call to expand the call + under a NEW_EXPR, so the target is not discarded. + +Thu Apr 20 14:59:31 1995 Mike Stump + + * gc.c (build_dynamic_cast): Tighten error checking. + +Thu Apr 20 11:23:54 1995 Jason Merrill + + * expr.c (cplus_expand_expr): Only abort if the returned target is + different from what we expected if the type has a non-trivial copy + constructor. + + * decl2.c (cplus_decl_attributes): Attributes applied to a template + really apply to the template's result. + + * tree.c (lvalue_p): Check IS_AGGR_TYPE instead of TREE_ADDRESSABLE + to decide whether to consider a CALL_EXPR an lvalue. + + * class.c (finish_struct_bits): Only set TREE_ADDRESSABLE if the + type has a non-trivial copy constructor. + + * decl.c (start_function): If interface_known, unset + DECL_NOT_REALLY_EXTERN on the function. + +Wed Apr 19 16:53:13 1995 Jason Merrill + + * pt.c (do_function_instantiation): Handle explicit instantiation of + member functions. + (do_type_instantiation): Handle 'inline template class foo', + meaning just spit out the vtable. + + * lex.c (cons_up_default_function): Set DECL_NOT_REALLY_EXTERN on + the consed functions. + + * decl2.c (import_export_inline): Set DECL_INTERFACE_KNOWN. + +Wed Apr 19 16:28:17 1995 Brendan Kehoe + + * call.c, class.c, decl2.c, gc.c, init.c, parse.y, pt.c, search.c, + typeck.c: Include output.h. + +Wed Apr 19 14:57:21 1995 Gerald Baumgartner + + * call.c (build_method_call): Allow a signature member functions to + be called from a default implementation. + +Wed Apr 19 10:21:17 1995 Jason Merrill + + * repo.c (finish_repo): Remember what directory we are in. + + * search.c (expand_upcast_fixups): Don't mess with abort_fndecl. + + * repo.c: Use obstacks instead of fixed-size buffers. Don't spit + out the second copy of the symbol name. Don't remember COLLECT_GCC. + +Wed Apr 19 02:32:40 1995 Mike Stump + + * search.c (virtual_context): New function to get the virtual + context of a function. + (expand_upcast_fixups): New function to generate runtime vtables. + (fixup_virtual_upcast_offsets): Likewise. + (expand_indirect_vtbls_init): Use fixup_virtual_upcast_offsets to + ensure that the this offsets for upcasts from virtual bases into + other virtual bases or non-virtual bases are correct at construction + time and destruction time. + * class.c (fixup_vtable_deltas): Modify to fixup all offsets in all + vtables in all virtual bases, instead of just one vtable in each + virtual base. + (fixup_vtable_deltas1): Likewise. + +Tue Apr 18 03:57:35 1995 Michael Meissner + + * Makefile.in (lex.o): Add dependency on c-pragma.h. + + * lex.c (handle_sysv_pragma): Use NULL_PTR and NULL_TREE as + appropriate, instead of 0. + +Mon Apr 17 12:28:42 1995 Jason Merrill + + * decl.c (pushdecl): Use decls_match, not duplicate_decls, for + comparing local and global decls. + +Fri Apr 14 01:46:52 1995 Jason Merrill + + * typeck.c (convert_arguments): Only prohibit passing to ... of + types with non-trivial copy constructors. + + * repo.c (repo_template_used): Don't try to mess with no id. + +Fri Apr 14 23:32:50 1995 Per Bothner + + * decl.c (duplicate_decls): Use cp_warning_at for redundant-decls. + +Thu Apr 13 15:37:42 1995 Brendan Kehoe + + * cp-tree.h (current_tinst_level): Delete declaration, since it's + static inside pt.c. + + * typeck.c (build_modify_expr): Catch incompatible array assignment. + + * parse.y (attribute_list, attrib): Rewrite actions to feed the + right stuff to decl_attributes. + +Thu Apr 13 11:24:10 1995 Jason Merrill + + * search.c (dfs_debug_mark): Check for magic virtual like + import_export_vtable. + + * typeck.c (build_binary_op_nodefault): Don't call cp_pedwarn with + four args. + +Wed Apr 12 12:02:57 1995 Jason Merrill + + * decl2.c (finish_file): Move prevtable pass before needs_messing_up + decision. + +Tue Apr 11 11:20:27 1995 Jason Merrill + + * decl.c (finish_decl): If we're writing out a static data member of + a class, we want the debug info for that class. + + * gc.c (build_t_desc): Check linkage of a class properly. + + * class.c (finish_struct): Set the 'headof' offset for the main + vtable properly. + (prepare_fresh_vtable): Fix typeinfo pointer here. + (modify_one_vtable): Instead of here. + +Mon Apr 10 12:15:59 1995 Jason Merrill + + * repo.c (repo_get_id): New function to return the interesting + identifier for a repo entity. + (repo_template_used): Use it. + (repo_template_instantiated): Mark the id as chosen. + (init_repo): Record whether or not the id was chosen. + (finish_repo): Note if an id was newly chosen. + + * pt.c (do_function_instantiation): Call repo_template_instantiated. + (do_type_instantiation): Likewise. Don't diagnose multiple + instantiation. + + * decl2.c (finish_file): Use DECL_NOT_REALLY_EXTERN when deciding + whether or not to synthesize a method. + + Undo these changes: + * class.c (finish_vtbls): Build more vtables if flag_rtti is on. + * class.c (modify_all_direct_vtables): Likewise. + * init.c (expand_direct_vtbls_init): Expand more vtables if + flag_rtti is on. + +Sat Apr 8 17:45:41 1995 Mike Stump + + * gc.c (build_headof): Use ptrdiff_type_node instead of + integer_type_node on pointer arithmetic. + +Sat Apr 8 11:57:04 1995 Jason Merrill + + * typeck.c (build_modify_expr): Undo previous change. + +Thu Apr 6 01:23:50 1995 Jason Merrill + + * Makefile.in (compiler): Remove ../cc1plus before rebuilding it. + + * repo.c (get_base_filename): Put the .rpo file in the directory + with the object file, not the source. + + * typeck.c (build_conditional_expr): Handle pmf's better. + + * repo.c (finish_repo): Also use ASM_OUTPUT_LABELREF to print out + the name of the symbol. + +Wed Apr 5 15:24:12 1995 Jason Merrill + + * repo.c (open_repo_file): Make repo filename DOS-compliant. + (*): Also write a new repo file if some previously-used + templates are no longer used. Only remember the identifier. + + * lex.c (cons_up_default_function): If this function belongs to a + template class, call repo_template_used for it. + + * repo.c (repo_template_used): Using a class means using its vtable, + if any. + (finish_repo): Likewise. + + * typeck.c (build_modify_expr): Only wrap TARGET_EXPRs in RTL_EXPRs + if the type has a complex copy constructor. + + * decl2.c (lang_decode_option): -frepo implies + -fno-implicit-templates. + + * decl.c (start_function): Clear current_{base,member}_init_list. + + * lex.c (init_lex): Also unset *_eq if ! flag_operator_names. + +Tue Apr 4 16:11:08 1995 Jason Merrill + + * decl.c (struct cp_function): Add {base,member}_init_list. + (push_cp_function_context): Save current_{base,member}_init_list. + (pop_cp_function_context): Restore them. + +Mon Apr 3 16:55:08 1995 Jason Merrill + + * repo.c (get_base_filename): Take filename parm, fix logic bug. + + * typeck.c (build_compound_expr): Do not warn about a compound expr + in which the first expression has no side effects. + (build_x_compound_expr): Warn here instead. + (build_conditional_expr): Don't warn about a conditional expression + between an enum and the type it promotes to. + + * init.c (build_new): Handle initialization of arrays of builtins + properly. + +Mon Apr 3 15:08:04 1995 Brendan Kehoe + + * repo.c: Include config.h to get definitions of bcopy and rindex + on systems that don't have them (e.g., SVR4). + +Mon Apr 3 14:41:55 1995 Mike Stump + + * decl2.c (finish_table): Pass NULL_TREE instead of init to + finish_decl so that it won't try and do error checking on the + initializer. + +Mon Apr 3 10:45:50 1995 Jason Merrill + + * repo.c (get_base_filename): Analyze COLLECT_GCC_OPTIONS to + determine whether this compile used -c -o. + (open_repo_file): Use get_base_filename. Remove the extension. + (finish_repo): Spit out the values of main_input_filename, + COLLECT_GCC and COLLECT_GCC_OPTIONS. + + * parse.y (structsp): Add TYPENAME_KEYWORD complex_type_name. + +Sun Apr 2 23:43:51 1995 Jason Merrill + + * search.c (compute_access): Don't try to do access control on + nested types. + +Fri Mar 31 10:14:23 1995 Jason Merrill + + * repo.c: New file to handle things repo. + + * pt.c (instantiate_template): Call repo_template_used if the + definition is accessible. + (mark_function_instantiated): Split out from + do_function_instantiation. + (mark_class_instantiated): Split out from do_type_instantiation. + + * parse.y (template_instantiate_once): Call repo_template_used. + + * lex.c (lang_init): Call init_repo. + + * decl2.c: Handle flag_use_repository. + (finish_file): Call finish_repo. + + * decl.c (start_method): Call repo_template_used if this is a + template method. + + * Makefile.in (CXX_OBJS): Add repo.o. + (repo.o): Add dependencies. + + * Make-lang.in (CXX_SRCS): Add repo.c. + + * decl.c (start_function): If DECL_INTERFACE_KNOWN and + DECL_NOT_REALLY_EXTERN are both set, unset DECL_EXTERNAL. + + * typeck.c (build_binary_op_nodefault): Identify the invalid operand + types used. + + * decl.c (duplicate_decls): Propagate DECL_NOT_REALLY_EXTERN. + +Thu Mar 30 17:54:42 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Tidy up use of build_type + and result_type. When checking for comparison between signed + and unsigned, use result_type rather than the (possibly shortened) + type of op0. Also, don't warn about equality comparison of a + signed operand to an unsigned constant that fits in the signed + type. + + * method.c (do_build_copy_constructor): Reverse + current_base_init_list after we've built it up. + +Thu Mar 30 14:35:18 1995 Mike Stump + + * except.c (build_throw): Never warn about the value of throw not + being used. + +Thu Mar 30 13:16:54 1995 Mike Stump + + * except.c (expand_start_catch_block): Check for bad catch parameter + declarations. + +Thu Mar 30 13:06:11 1995 Jason Merrill + + * decl.c (finish_function): Only set DECL_NOT_REALLY_EXTERN if + DECL_EXTERNAL is not already set. + +Thu Mar 30 11:26:24 1995 Mike Stump + + * method.c (emit_thunk): Let poplevel know that the last level is + for a function so it can create a BLOCK_NODE and set DECL_INITIAL. + +Thu Mar 30 11:15:06 1995 Jason Merrill + + * decl2.c (import_export_inline): Don't set DECL_NOT_REALLY_EXTERN + here. + + * decl.c (grokdeclarator): OK, don't abort if we see a decl with + METHOD_TYPE. + (finish_function): Set DECL_EXTERNAL and DECL_NOT_REALLY_EXTERN on + all deferred inlines. + +Wed Mar 29 19:35:02 1995 Jason Merrill + + * cp-tree.h (DECL_THIS_INLINE): New macro. + (DECL_NOT_REALLY_EXTERN): New macro. + (DECL_THIS_STATIC): New macro. + + * decl.c: Lose all references to current_extern_inline. Break + inline semantics into DECL_INLINE for actual inlining and + DECL_THIS_INLINE for the linkage wierdness. Use DECL_THIS_STATIC. + * decl2.c: Use DECL_NOT_REALLY_EXTERN to indicate that we want to + emit an inline here. Associated changes. + * lex.c: Likewise. + * pt.c: Likewise. + * typeck.c: Likewise. + + * call.c (build_method_call): Don't bother trying to handle inlines + specially. + * cvt.c (convert_to_aggr): Likewise. + + * pt.c (do_function_instantiation): Handle instantiation of + public inlines, too. + +Wed Mar 29 16:04:25 1995 Mike Stump + + * except.c (init_exception_processing): Change the interface for + __throw_type_match and add decl for new rtti matching routine + __throw_type_match_rtti. + (build_eh_type): New routine to build a run time descriptor for the + expression given. + (expand_start_catch_block): Update to use new calling convention for + the matcher. + (expand_throw): Update to use build_eh_type. + +Mon Mar 27 07:14:33 1995 Warner Losh + + * g++.c: Removed __NetBSD__ from conditional. + Declare strerror if HAVE_STRERROR is defined; otherwise + declare sys_errlist and sys_nerr. + (my_strerror): New function. + +Tue Mar 28 14:16:35 1995 Jason Merrill + + * search.c (get_binfo): Don't try to be so clever. + + * tree.c (copy_to_permanent): Also suspend_momentary(). + + * cvt.c (cp_convert_to_pointer): Hand off to convert_fn_pointer even + if the types are the same. + + * decl.c (start_function): Handle extern inlines more like C++ says + we should. + + * init.c (build_member_call): Hand constructor calls off to + build_functional_cast. + + * typeck2.c (build_functional_cast): Use DECL_NESTED_TYPENAME to get + the name of the type. + +Tue Mar 28 13:13:56 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Check for the decl returned by + grokfndecl to be null before using build_decl_attribute_variant. + +Mon Mar 27 18:04:41 1995 Brendan Kehoe + + * init.c (build_new): Use build_pointer_type instead of + TYPE_POINTER_TO. + +Fri Mar 24 12:11:24 1995 Jason Merrill + + * typeck.c (build_conditional_expr): Handle pmfs. + (convert_for_assignment): Fix pmf support. + + * cvt.c (convert_fn_ptr): Support !flag_vtable_thunks. + (cp_convert_to_pointer): Handle pmfs. + (cp_convert): Pass pmfs to cp_convert_to_pointer. + + * typeck.c (common_type): Handle inheritance for pmfs. + + * typeck2.c (build_m_component_ref): Do access control. + + * typeck.c (comp_target_types): Check for conversion to void * + before checking trickier conversions. + + * decl.c (duplicate_decls): Propagate DECL_ABSTRACT_VIRTUAL_P. + + * pt.c (push_tinst_level): Complain if template instantiation depth + is greater than max_tinst_depth. + + * typeck.c (common_type): Assume that we can call common_type to + unify the target type of a pointer. + +Thu Mar 23 00:48:44 1995 Jason Merrill + + * decl2.c (finish_file): Don't synthesize methods at + finish_vtable_prevardecl time. Do synthesize methods that are not + used, but are public and not external. + + * cvt.c (build_type_conversion): Only give an error if for_sure. + + * typeck.c (comp_target_types): Only support pointer conversions if + nptrs > 0. + +Wed Mar 22 19:30:15 1995 Brendan Kehoe + + * init.c (build_new): Catch use of an initializer list where it + shouldn't be. + +Wed Mar 22 16:21:07 1995 Jason Merrill + + * init.c (build_new): Wrap alloc_expr in an RTL_EXPR if nelts is + non-constant. + + * decl2.c: temp_name_counter is now public. + + * decl.c (struct cp_function): Add temp_name_counter field. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + + * typeck.c (common_type): Handle unifying function types, and unify + unmatched things to void* with a compiler_error, rather than + silently like before. + +Wed Mar 22 15:10:34 1995 Mike Stump + + * decl2.c (finish_prevtable_vardecl, finish_vtable_vardecl): Revert + Brendan's last change and fix latent problem that causes TD entries + to not come out when the things that need them has yet to be + expanded. + +Wed Mar 22 15:12:00 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault, comparison ops): Update type0 + and type1, since we might have changed op0 or op1. + +Wed Mar 22 13:33:45 1995 Jason Merrill + + * typeck.c (common_type): Don't mess up templates. + +Wed Mar 22 04:56:00 1995 Jason Merrill + + * typeck.c (common_type): Handle ptms properly. Also handle + T* -> void*. + (build_binary_op_nodefault): New variable build_type controls what + type is given to the expression when it is created. Set this to + boolean_type_node for comparison ops instead of using result_type. + (comp_target_types): Allow T * -> void *. + + * cvt.c (cp_convert_to_pointer): Do access control when converting + ptms, too. + +Tue Mar 21 17:25:06 1995 Brendan Kehoe + + * parse.y (extern_lang_string): Catch use of linkage specs that + aren't all naming the same language. + + * class.c (finish_struct): Delete accidental duplicate code. + +Tue Mar 21 14:00:57 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Disable pedwarns about + comparing functions and incomplete types. + + * decl.c (finish_function): Only unset current_function_decl if + !nested. + (duplicate_decls): Last change went too far; we only want to stop + checking for value/reference ambiguity. + +Tue Mar 21 01:26:39 1995 Mike Stump + + * gc.c (build_generic_desc): Zap the DECL_SIZE so that we can lay it + out fresh, as the new type may be larger. + +Mon Mar 20 19:01:10 1995 Jason Merrill + + * expr.c (extract_init): Try to expand the RTL for the + initialization and figure out what it will look like so we can avoid + run-time initialization. Disabled for now. + (extract_scalar_init): Helper for scalar initialization. + (extract_aggr_init): Helper for aggregate initialization. + + * decl.c (duplicate_decls): Don't complain about ambiguous + declarations. + (obscure_complex_init): Now returns a tree. Call extract_init if + we're optimizing and this is a toplevel decl. + (finish_decl): Update accordingly. + + * lex.c (check_newline): If we're just changing files (not pushing + or popping), update input_file_stack->name. + +Mon Mar 20 17:55:04 1995 Mike Stump + + * pt.c (type_unification): Only TEMPLATE_DECLs are handled right now + in the transitive unification code. + +Mon Mar 20 16:07:50 1995 Brendan Kehoe + + * decl.c (shadow_tag): Don't allow inline, virtual, or explicit on + non-functions. + (grokdeclarator): Don't allow friends to be defined in local classes. + +Sat Mar 18 04:03:33 1995 Jason Merrill + + * decl2.c (finish_prevtable_vardecl): Use DECL_DECLARED_STATIC + rather than DECL_SAVED_INSNS to decide whether or not this method + was declared inline. + + * method.c (synthesize_method): Turn off DECL_INLINE if + function_cannot_inline_p thinks we're too large. + + * typeck.c (build_indirect_ref): Use build_expr_type_conversion. + +Fri Mar 17 17:47:36 1995 Jason Merrill + + * class.c (instantiate_type): Handle pmfs. + + * typeck.c (convert_for_assignment): Check types when assigning one + pmf to another. + + * decl.c (define_label): Fix logic for printing out the name of the + label in an error message. + + * error.c (dump_expr): Support ARRAY_REF. + +Fri Mar 17 17:43:02 1995 Brendan Kehoe + + * decl2.c (finish_vtable_vardecl): Call build_t_desc here. + (finish_prevtable_vardecl): Instead of here. + +Fri Mar 17 14:40:45 1995 Jason Merrill + + * decl.c (expand_static_init): Also use expand_aggr_init if the + initializer is a TREE_LIST. + (grokdeclarator): Only pedwarn about extra qualification if -pedantic. + + * pt.c (unify): Fix unification of return type. + + * expr.c (fixup_result_decl): Use store_expr, rather than + emit_move_insn, to move the return value into the place where + callers will expect it. + +Thu Mar 16 22:05:25 1995 Jason Merrill + + * init.c (build_offset_ref): Call assmble_external on functions. + * typeck.c (build_component_ref): Likewise. + +Thu Mar 16 20:28:16 1995 Brendan Kehoe + + * decl.c (struct saved_scope): Add members base_init_list and + member_init_list. + (push_to_top_level): Save current_base_init_list and + current_member_init_list to them. + (pop_from_top_level): Put it back. + +Thu Mar 16 19:21:14 1995 Jason Merrill + + * pt.c (instantiate_template): Call assemble_external. + +Thu Mar 16 18:07:54 1995 Brendan Kehoe + + * class.c: Include rtl.h, to get NULL_RTX. + (finish_struct): Also zero out DECL_SAVED_INSNS, to avoid problems + on hosts with different sizes for each part of the union. + * tree.c: Also include rtl.h. + (layout_basetypes): Same change for DECL_SAVED_INSNS. + +Thu Mar 16 13:57:36 1995 Jason Merrill + + * pt.c (unify): Fix array domain unification for 64-bit targets. + + * decl2.c (finish_file): Push bizarre type decl before walking the + vtables the first time. + (walk_vtables): OK, don't set prev to vars if the vardecl_fn messed + with TREE_CHAIN (prev). + + * init.c (emit_base_init): Use convert_pointer_to_real instead of + convert_pointer_to when converting to a direct base. + +Wed Mar 15 20:26:29 1995 Mike Stump + + * pt.c (type_unification): Handle transitive unification better. + +Wed Mar 15 13:56:16 1995 Jason Merrill + + * decl2.c (walk_vtables): Always set prev to vars. + (mark_vtable_entries): Call assemble_external on the vtable entries. + + * class.c (finish_struct): Set the vtable's size to NULL_TREE before + calling layout_decl, so that it gets updated properly. + + Finally re-enable dynamic synthesis. This time it works. + * method.c (synthesize_method): Pass decl_function_context (fndecl) + to {push,pop}_cp_function_context. + * decl.c (push_cp_function_context): Now takes a tree argument. + (pop_cp_function_context): Likewise. + * call.c (build_method_call): Enable synthesis. + * lex.c (cons_up_default_function): Likewise. + +Tue Mar 14 19:14:19 1995 Doug Evans + + * parse.y (setattrs): Chain onto prefix_attributes rather than + setting it. + +Wed Mar 15 13:00:00 1995 Brendan Kehoe + + * decl.c (pushdecl): Check if the type of the VAR_DECL is an + error_mark_node before trying to read TYPE_LANG_SPECIFIC. + +Mon Mar 13 21:00:28 1995 Brendan Kehoe + + * decl.c (grokdeclarator, case ARRAY_REF): Wrap the exp with fold, + and convert the size and integer_one_node to the index type. + +Mon Mar 13 08:01:02 1995 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Save the instance + argument, and tack it onto the front of the COND_EXPR to make the + semantics come out right. Grab the instance argument from + '*instance_ptrptr', rather than having it passed in separately. + + * various: Change various consed-up comparison operations to have + boolean type. Remove the instance argument in calls to + get_member_function_from_ptrfunc. + + * error.c (dump_expr): Dump true and false as "true" and "false". + + * decl2.c (finish_file): Also set DECL_STATIC_FUNCTION_P on the + global init function. + + * decl.c (finish_function): Only set DECL_EXTERNAL here if the + inline function is public. + +Sat Mar 11 00:58:03 1995 Jason Merrill + + * init.c (is_friend): Be more careful about checking + DECL_CLASS_CONTEXT on non-member functions. + + * decl2.c (finish_vtable_vardecl): Don't bother calling + assemble_external here. + (prune_vtable_vardecl): New function that just splices out the + vtable decl from the top-level decls. + (import_export_inline): Unset DECL_EXTERNAL at first. + (finish_file): Don't bother calling assemble_external here. Do + splice out all of the vtables. + +Fri Mar 10 14:42:29 1995 Jason Merrill + + * decl.c (finish_function): If we're not emitting the function yet, + call assemble_external for it. + + * decl2.c (finish_prevtable_vardecl): Don't call mark_vtable_entries + here. + (finish_vtable_vardecl): Don't do the linkage deduction thing here. + Also don't splice out the current vtable if it is unused. + (finish_file): Move the second walk_vtables and the synthesis check + inside the 'reconsider' loop. Move thunk emission after the + 'reconsider' loop. + +Thu Mar 9 16:28:16 1995 Brendan Kehoe + + * pt.c (tsubst): Don't bother calling cp_build_type_variant, since it + was passing bogus values for readonly and volatile from the original + template decl, not the resultant type of the tsubst call. + + * class.c (duplicate_tag_error): Use cp_error_at to point out the + previous definition of the tag. + +Thu Mar 9 10:46:17 1995 Jason Merrill + + * decl.c (start_function): Clear base_init_insns and protect_list. + (struct cp_function): Add base_init_insns field. + (push_cp_function_context): Also save base_init_insns. + (pop_cp_function_context): Also restore base_init_insns. + +Wed Mar 8 13:31:44 1995 Jason Merrill + + * init.c (member_init_ok_or_else): Check for initializing a static + member here. + (emit_base_init): Instead of here. + +Tue Mar 7 16:03:26 1995 Jason Merrill + + * call.c (build_method_call): Disable synthesis as needed. + * lex.c (cons_up_default_function): Likewise. + +Tue Mar 7 10:14:29 1995 Brendan Kehoe + + * parse.y: New rules to allow attributes in a prefix position. + (prefix_attributes): New variable. Pass it into cplus_decl_attributes. + (setattr): New rule. + (reserved_declspecs, declmods): Catch attributes here. + * decl2.c (cplus_decl_attributes): Add PREFIX_ATTRIBUTES argument. + * decl.c (duplicate_decls): Pass DECL_MACHINE_ATTRIBUTES to + descendent typedef. + (grokdeclarator): Added code to support machine attributes. + * Makefile.in (stamp-parse): Expect 5 shift/reduce failures. + +Mon Mar 6 15:07:02 1995 Jason Merrill + + * call.c (build_method_call): Don't synthesize methods outside of a + function. + + Make base initialization more re-entrant so that synthesis on the + fly will work (and, eventually, template instantiation on the fly). + * init.c (sort_member_init): Don't bother with members that can't be + initialized. Reorganize a bit. Don't initialize base members here. + (sort_base_init): New function, like sort_member_init, but for base + classes. Steals some code from emit_base_init. + (emit_base_init): Simplify. Call sort_{member,base}_init before + doing any initialization, so we don't have to save + current_{member,base}_init_list in push_cp_function_context. + (expand_aggr_vbase_init_1): Adjust for sort_base_init. + (expand_aggr_vbase_init): Simplify. + * decl.c (struct cp_function): Add protect_list field. + (push_cp_function_context): Also save protect_list. + (pop_cp_function_context): Also restore protect_list. + * call.c (build_method_call): Enable synthesis at point of call. + * lex.c (cons_up_default_function): Likewise. + + * parse.y: Turn -ansi checks back into -pedantic checks. + + * init.c (build_new): Fix -fcheck-new for array new. + +Sat Mar 4 15:55:42 1995 Fergus Henderson + + * typeck.c (build_compound_expr): warn if left-hand operand of + comma expression has no side-effects. + +Fri Mar 3 15:16:45 1995 Jason Merrill + + * parse.y (primary): Change 'object qualified_id *' rules to 'object + overqualified_id *'. + +Fri Mar 3 12:48:17 1995 Brendan Kehoe + + * parse.y (unary_expr): Catch doing sizeof an overloaded function. + Make the error look the same as the one we issue in c_sizeof. + + * typeck.c (build_binary_op_nodefault): Give an error for trying + to compare a pointer-to-member to `void *'. + +Fri Mar 3 11:28:50 1995 Jason Merrill + + * typeck.c (build_unary_op): Handle bool increment with smoke and + mirrors here, rather than in expand_increment where it belongs, + because Kenner doesn't agree with me. + +Fri Mar 3 00:08:10 1995 Brendan Kehoe + + * decl.c (grokparms): Catch a PARM_DECL being used for a default + argument as well. + +Thu Mar 2 20:05:54 1995 Brendan Kehoe + + * init.c (build_new): Don't allow new on a function type. + + * parse.y (primary): Avoid a crash when seeing if the arg is of + the same type as that given for the typespec in an explicit dtor call. + +Thu Mar 2 00:49:38 1995 Jason Merrill + + * decl.c (finish_function): Change test for calling + mark_inline_for_output. + +Wed Mar 1 11:23:46 1995 Jason Merrill + + * typeck.c (build_modify_expr): Complain if + build_default_binary_type_conversion fails. + + * init.c (expand_default_init): Handle arguments of unknown type + properly. + + * cvt.c (build_expr_type_conversion): Only complain about ambiguity + if 'complain'. + * various: Pass 'complain'. + + * typeck.c (comptypes): Be more picky about comparing UPTs. + +Wed Mar 1 11:03:41 1995 Brendan Kehoe + + * decl.c (grokdeclarator): If declarator is null, say that the + type used has an incomplete type. + +Wed Mar 1 10:06:20 1995 Jason Merrill + + * pt.c (instantiate_template): Copy the template arguments to the + permanent_obstack. Also use simple_cst_equal to compare them when + looking for a previous instantiation. + + * tree.c (make_deep_copy): Support copying INTEGER_TYPEs (assuming + they are array domain types). + +Tue Feb 28 23:24:55 1995 Jason Merrill + + * cp-tree.h: Define WANT_* constants for passing to + build_expr_type_conversion. + * cvt.c (build_expr_type_conversion): New function to build + conversion to one of a group of suitable types. + (build_default_binary_type_conversion): Use it. + * decl2.c (grok_array_decl): Likewise. + * typeck.c (build_unary_op): Likewise. + (build_array_ref): Tidy up a bit. + (build_binary_op): Likewise. + +Tue Feb 28 19:57:31 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow decl of an argument as `void'. + +Tue Feb 28 17:23:36 1995 Jason Merrill + + * parse.y (typed_declspecs1): Add 'typespec reserved_typespecquals + reserved_declspecs' rule. + + * parse.y (expr_or_declarator): Remove notype_qualified_id rule. + (direct_notype_declarator): Likewise. + (complex_direct_notype_declarator): Add notype_qualified_id rule. + + * lex.c (real_yylex): Handle :> digraph properly. + +Tue Feb 28 12:26:29 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Check if it's a friend, not if it's + non-virtual, that's being initialized. Move the check up to + before FRIENDP would get cleared. Catch an unnamed var/field + being declared void. Say just `field' instead of `structure field' + in the error message. Only go for the operator name if DECLARATOR + is non-null. + +Tue Feb 28 00:08:01 1995 Jason Merrill + + * decl.c (start_function): Complain about abstract return type. + (grokdeclarator): Complain about declaring constructors and + destructors to be const or volatile. Complain about declaring + destructors to be static. + + * pt.c (uses_template_parms): Handle pmfs. + + * decl.c (grokdeclarator): Don't call variable_size for array bounds + that only depend on template constant parameters. + +Mon Feb 27 15:38:16 1995 Brendan Kehoe + + * error.c (dump_decl): Only look to see if it's a vtable if we + actually have a name to check out. + +Mon Feb 27 13:37:53 1995 Jason Merrill + + * cvt.c (convert_to_aggr): Lose misleading shortcut. + +Sun Feb 26 17:27:32 1995 Doug Evans + + * decl.c (set_nested_typename): Always set DECL_IGNORED_P, + not just for dwarf. + +Sun Feb 26 00:10:18 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow a static member to be + declared `register'. + + * init.c (make_friend_class): Move up to a pedwarn for the warning + about a class declaring friends with itself. + + * decl.c (grokdeclarator): You can't do `volatile friend class foo' + or `inline friend class foo'. Only try to make a friend out of + TYPE if we didn't already reset it to integer_type_node. + +Sat Feb 25 22:32:03 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow initialization of a + non-virtual function. + + * decl.c (start_function): Do a pedwarn if we're changing `main' + to have an int return type. + +Sat Feb 25 00:02:05 1995 Jason Merrill + + * typeck.c (build_modify_expr): Handle simple assignment from + TARGET_EXPRs by building up an RTL_EXPR to force expansion. Whew. + +Fri Feb 24 18:27:14 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Also don't allow virtual outside of a + class decl for a scope method definition performed at global binding. + + * init.c (build_offset_ref): Don't allow creation of an OFFSET_REF + of a bitfield. + + * decl.c (grokdeclarator): Don't allow a const to be declared mutable. + + * typeck.c (build_binary_op): Return an error_mark_node if either + one of the args turned into an error_mark_node when we tried to + use default_conversion. + + * typeck.c (build_unary_op): Forbid using postfix -- on a bool. + + * decl.c (grokdeclarator): Allow `signed' and `unsigned' to be + used on `__wchar_t'. + +Fri Feb 24 13:59:53 1995 Mike Stump + + * except.c (end_protect_partials): Do it the right way. + +Wed Feb 22 15:42:56 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Upgrade warning about + comparing distinct pointer types to pedwarn. + + * typeck2.c (digest_init): Cope with extra braces. + + * typeck.c (build_binary_op_nodefault): Use tree_int_cst_sgn instead + of INT_CST_LT (..., interger_zero_node). + +Wed Feb 22 14:45:52 1995 Brendan Kehoe + + * except.c [!TRY_NEW_EH] (end_protect_partials): Define dummy + function for systems that don't have EH. + +Tue Feb 21 19:18:31 1995 Jason Merrill + + * call.c (can_convert_arg): Like can_convert, but takes an arg as + well. + + * pt.c (type_unification): Allow implicit conversions for parameters + that do not depend on template parameters. + +Tue Feb 21 18:43:48 1995 Douglas Rupp + + * Make-lang.in, config-lang.in: ($exeext): New macro. + * Make-lang.in: Try a "cp" if "ln" fails. + * cp-tree.h (decl_attributes): Added argument. + * decl2.c (cplus_decl_attribute): Add arg to decl_attributes. + * cp/g++.c: Added #ifdefs for sys/file.h and process.h for NT. + Modified spawnvp to have to correct number of arguments for OS/2, NT. + +Tue Feb 21 18:36:55 1995 Mike Stump + + * decl.c (finish_function): Add calls to end_protect_partials to end + the exception region that protects constructors so that partially + constructed objects can be partially destructed when the constructor + throws an exception. + * init.c (perform_member_init, sort_member_init, emit_base_init): + Added support for partially constructed objects. + * init.c (build_partial_cleanup_for): New routine to do partial + cleanups of a base class. + * decl2.c (finish_file): Move the emitting of the exception table + down, after we emit all code that might have exception regions in + them. + * except.c (end_protect_partials, might_have_exceptions_p): New + routines. + (emit_exception_table): Always output table if called. + * cp-tree.h (protect_list, end_protect_partials, + might_have_exceptions_p, emit_exception_table): Added. + +Tue Feb 21 16:05:59 1995 Brendan Kehoe + + * gc.c (build_typeid): Pass a NULL_TREE, not the bogus, unused + address of a local variable. + * class.c (build_vfn_ref): Only try to build the PLUS_EXPR if we + were given a non-null PTR_TO_INSTPTR. + +Tue Feb 21 01:53:18 1995 Jason Merrill + + * decl.c (duplicate_decls): Always lay out the merged decl. + + * decl2.c (finish_vtable_vardecl): Don't do vtable hack on templates. + (finish_prevtable_vardecl): Likewise. + + * method.c (synthesize_method): Set interface_{unknown,only} + according to the settings for our class, not the file where it comes + from. + +Sat Feb 18 12:26:48 1995 Mike Stump + + * except.c: Handle systems that define __i386__ but not __i386. + +Fri Feb 17 15:31:31 1995 Jason Merrill + + * decl2.c (reparse_decl_as_expr): Support being called without a + type argument. + + * parse.y (primary): Add '(' expr_or_declarator ')'. Adds 4 r/r + conflicts. Sigh. + +Fri Feb 17 12:02:06 1995 Mike Stump + + * parse.y (template_def, fndef, fn.def1, return_init, condition, + initdcl0, initdcl, notype_initdcl0, nomods_initdcl0, + component_decl_1, after_type_component_declarator0, + notype_component_declarator0, after_type_component_declarator, + notype_component_declarator, after_type_component_declarator, + full_parm, maybe_raises, exception_specification_opt): Fix up, + include exception_specification_opt maybeasm maybe_attribute and + maybe_init if missing. Rename maybe_raises to + exception_specification_opt to match draft wording. Use maybe_init + to simplify rules. + +Fri Feb 17 01:54:46 1995 Jason Merrill + + * init.c (build_new): Set TREE_NO_UNUSED_WARNING on COMPOUND_EXPRs + built for news of scalar types. + +Thu Feb 16 17:48:28 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Update code for warning + about signed/unsigned comparisons from C frontend. Realize that the + code in the C frontend is, if anything, even more bogus. Fix it. + (build_binary_op): Undo default_conversion if it wasn't useful. + + * typeck.c (build_unary_op, ADDR_EXPR): Lose bogus special case for + PRE*CREMENT_EXPR. + + * decl2.c (import_export_vtable): Don't try the vtable hack + if the class doesn't have any real non-inline virtual functions. + (finish_vtable_vardecl): Don't bother trying to find a non-inline + virtual function in a non-polymorphic class. + (finish_prevtable_vardecl): Likewise. + + * decl2.c (import_export_vtable): Use and set DECL_INTERFACE_KNOWN. + + * cp-tree.h (DECL_INTERFACE_KNOWN): Use DECL_LANG_FLAG_5. + + * init.c (expand_virtual_init): Always call assemble_external. + + * class.c (build_vfn_ref): Always call assemble_external. + (build_vtable): Always call import_export_vtable. + (prepare_fresh_vtable): Likewise. + (add_virtual_function): Don't bother setting TREE_ADDRESSABLE. + +Thu Feb 16 03:28:49 1995 Jason Merrill + + * class.c (finish_struct): Use TYPE_{MIN,MAX}_VALUE to determine + whether an enumerated type fits in a bitfield. + +Wed Feb 15 15:38:12 1995 Jason Merrill + + * class.c (grow_method): Update method_vec after growing the class + obstack. + +Wed Feb 15 13:42:59 1995 Mike Stump + + * parse.y (handler_seq): Push a level for the catch parameters. + +Wed Feb 15 12:42:57 1995 Jason Merrill + + * init.c (emit_base_init): Update BINFO_INHERITANCE_CHAIN on my + bases, in case they've been clobbered. + +Wed Feb 15 12:07:29 1995 Mike Stump + + * class.c (finish_base_struct): Set up BINFO_INHERITANCE_CHAIN here, + so that one day it will always be valid. + * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. + + * cp-tree.h (copy_binfo): Removed, unused. + * tree.c (copy_binfo): Likewise. + +Wed Feb 15 00:05:30 1995 Jason Merrill + + * init.c (build_new): Save the allocation before calling + expand_vec_init on it. + + * decl.c (finish_enum): The TYPE_PRECISION of the enum type mush + match the TYPE_PRECISION of the underlying type for constant folding + to work. + +Tue Feb 14 15:31:25 1995 Mike Stump + + * except.c (push_eh_entry, expand_start_all_catch, + expand_leftover_cleanups, expand_end_catch_block): Keep track of + the context in which the exception region occurs. + (build_exception_table): If the region was not output, don't output + the entry in the eh table for it. + +Tue Feb 14 02:15:43 1995 Jason Merrill + + * init.c (expand_default_init): Only use a previous constructor call + if it's a call to our constructor. Does the word "Duh" mean + anything to you? + + * decl.c (grokparms): Fine, just don't call + convert_for_initialization at all. OK? Happy now? + +Mon Feb 13 02:23:44 1995 Jason Merrill + + * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Make sure that the class + method vector has a second element before returning it. + + * decl.c (grokparms): Don't strip REFERENCE_TYPE before calling + convert_for_initialization. + +Sun Feb 12 03:57:06 1995 Jason Merrill + + * typeck.c (build_modify_expr): Compare function name to + constructor_name (current_class_type) instead of current_class_name. + + * decl.c (grokparms): Don't do anything with the return value of + convert_for_initialization. + + * error.c (dump_decl): Also dump_readonly_or_volatile on the decl. + + * decl.c (duplicate_decls): Tweak error message. + + * typeck.c (build_const_cast): Implement checking. + (build_reinterpret_cast): Implement some checking. + + * cp-tree.h (CONV_FORCE_TEMP): Require a new temporary when + converting to the same aggregate type. + (CONV_STATIC_CAST): Include it. + (CONV_C_CAST): Likewise. + * cvt.c (convert_force): Use CONV_C_CAST instead of CONV_OLD_CONVERT. + (cp_convert): Only force a new temporary if CONV_FORCE_TEMP. + +Fri Feb 10 16:18:52 1995 Jason Merrill + + * typeck.c (build_c_cast): Use non_lvalue to tack something on + where necessary. + + * decl.c (auto_function): Now a function. + * except.c (init_exception_processing): terminate, unexpected, + set_terminate, and set_unexpected have C++ linkage. + + * typeck.c (build_unary_op, TRUTH_NOT_EXPR): Use convert instead of + truthvalue_conversion for converting to bool, as it handles + user-defined conversions properly. + (condition_conversion): Likewise. + + * except.c (expand_throw): Don't call convert_to_reference. + Pass the correct parameters to build_new. + + * method.c (do_build_assign_ref): Don't use access control when + converting to a base reference here. + (do_build_copy_constructor): Or here. + + * init.c (build_new): Unset TREE_READONLY on the dereferenced + pointer before assigning to it. + + * decl.c (maybe_build_cleanup): Don't bother stripping const here. + + * decl2.c (delete_sanity): You can now delete pointer to const. + +Fri Feb 10 13:28:38 1995 Jason Merrill + + * decl.c (finish_function): Don't rely on actual parameters being + evaluated left-to-right. + * except.c (expand_end_catch_block): Likewise. + +Fri Feb 10 00:52:04 1995 Jason Merrill + + * tree.c (real_lvalue_p): Like lvalue_p, but class temps aren't + considered lvalues. + * cvt.c (convert_to_reference): Use real_lvalue_p instead of + lvalue_p. + + * cvt.c (build_type_conversion_1): Don't call convert on aggregate + types. + (convert_to_reference): Fix erroneous text substitution. + + * typeck2.c (initializer_constant_valid_p): Update from C frontend. + Add new argument to all callers. + + * typeck.c (convert_arguments): Check for error_mark_node before + trying to do anything with the actual parameter. + + * typeck.c (condition_conversion): Build up a CLEANUP_POINT_EXPR and + fold it. + (bool_truthvalue_conversion): Remove. Fix all callers to call + truthvalue_conversion instead. + (various): Fold CLEANUP_POINT_EXPRs. + + * parse.y (conditions): Call condition_conversion rather than + building up a CLEANUP_POINT_EXPR. + + * pt.c (end_template_decl): Don't warn_if_unknown_interface here + under -falt-external-templates. + +Thu Feb 9 05:24:10 1995 Jason Merrill + + * init.c (build_new): Complain about new of const type without + initializer. Other cleanup. + + * call.c (compute_conversion_costs): Don't call + build_type_conversion with a reference type; convert to the target + type and check its lvaluetude. + * cvt.c (convert_to_reference): Likewise. + + * cvt.c (build_type_conversion_1): There will never be any need to + dereference references here now. + +Thu Feb 9 00:37:47 1995 Mike Stump + + * except.c (expand_builtin_throw): Make sure we only `use' the + value of return_val_rtx. + +Wed Feb 8 15:45:55 1995 Jason Merrill + + * parse.y (structsp): Don't complain about declaring a type being + defined to be a friend. + + * decl2.c (warn_if_unknown_interface): Note the template in question + and the point of instantiation, for -falt-external-templates. + * lex.c (reinit_parse_for_method): Pass the decl to + warn_if_unknown_interface. + * pt.c (instantiate_template): Likewise. + (end_template_decl): Likewise. + + * decl.c (set_nested_typename): Set IDENTIFIER_TYPE_VALUE on the + nested name again, to make local classes work a bit better. + + * typeck.c (build_function_call_real): Dereference reference after + checking for incomplete type. + + * init.c (build_new): Accept new of const and volatile types. + +Wed Feb 8 14:04:16 1995 Jason Merrill + + * decl.c (grokdeclarator): Fix error message. + +Wed Feb 8 03:16:15 1995 Jason Merrill + + * typeck.c (convert_for_initialization): Do bash arrays when + converting to a reference to non-array. + +Tue Feb 7 15:50:33 1995 Jason Merrill + + * cvt.c (cp_convert): Don't call convert_to_reference, or + automatically dereference references. Do pass reference conversions + to cp_convert_to_pointer. + (cp_convert_to_pointer): Support references. + + * call.c (build_method_call): Don't build up a reference to the + parameter here; let build_overload_call handle that. + + * typeck.c (build_c_cast): Call convert_to_reference directly if + converting to a reference type. + * method.c (do_build_copy_constructor): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + + * call.c (build_method_call): Dereference a returned reference. + * typeck.c (build_function_call_real): Likewise. + + * decl.c (xref_basetypes): Check for unions with basetypes here. + (xref_tag): Instead of here. + + * pt.c (process_template_parm): Template type parm decls are + artificial. + +Mon Feb 6 04:32:09 1995 Jason Merrill + + * parse.y (typed_declspecs): Add missing semicolon. + (do_xref_defn): Resurrect. + (named_class_head_sans_basetype): Move template specialization + definition cases to named_class_head_sans_basetype_defn. + + * decl2.c (grokfield): Call pushdecl_class_level after setting the + TYPE_NAME, not before. + +Sun Feb 5 02:50:45 1995 Jason Merrill + + * call.c (convert_harshness): Don't call sorry here. Don't allow + conversions between function pointer types if pedantic. + + * pt.c (overload_template_name): Pass globalize=1 to xref_tag. + + * lex.c (cons_up_default_function): Use the full name for the return + type of op=. + + * decl.c (set_nested_typename): Don't worry about anonymous types, + as they already have a unique name. + (pushdecl): Remove redundant set_nested_typename + (xref_tag): Split out base handling into xref_basetypes. + + * cp-tree.h (TYPE_INCOMPLETE): New macro; TEMPLATE_TYPE_PARMs are + not considered incomplete even though their definition is unknown. + + * decl.c (xref_defn_tag): Lose. + (xref_tag): xref_next_defn = ! globalize. + (pushdecl): Don't set DECL_NESTED_TYPENAME on artificial decls. The + ones that should have it set will have it set by pushtag. + (pushdecl_class_level): Likewise. + (pushtag): Tidy up a bit. + (set_nested_typename): Push a decl for the nested typename from + here, rather than from xref_defn_tag. + + * parse.y (do_xref): Lose. + (named_class_head): If we see 'class foo:' we know it's a + definition, so don't worry about base lists for non-definitions. + + * pt.c (push_template_decls): Template parm decls are artificial. + + * decl.c (duplicate_decls): Restore check for qualifier + disagreement for non-functions. + (decls_match): Remove check for qualifier disagreement. + +Fri Feb 3 14:58:58 1995 Jason Merrill + + * decl.c (grok_reference_init): Convert initializer from + reference. + * typeck.c (convert_for_initialization): Likewise. + + * decl.c (duplicate_decls): Propagate DECL_NESTED_TYPENAME. + + * cvt.c (cp_convert): Don't convert to the same class type by just + tacking on a NOP_EXPR. + (convert_to_reference): Use comp_target_types instead of comptypes + so that we don't allow conversions two levels down. + +Thu Feb 2 15:07:58 1995 Jason Merrill + + * class.c (build_vbase_path): Bash types to make the backend happy. + * cvt.c (build_up_reference): Bash the types bashed by + build_vbase_path to be reference types instead of pointer types. + (convert_to_reference): Likewise. + + * typeck.c (build_c_cast): Don't strip NOPs if we're converting to a + reference type. + + * parse.y (structsp): Put back error for 'struct B: public A;'. + +Wed Feb 1 23:02:06 1995 Mike Stump + + * except.c: Add support for mips systems that don't define __mips + but do define mips, like Ultrix. + +Wed Feb 1 22:39:07 1995 Mike Stump + + * except.c: Add support for exception handling on the Alpha. + +Wed Feb 1 10:12:14 1995 Mike Stump + + * decl2.c (finish_file): Fix bug in Jan 31st change. + +Tue Jan 31 16:59:15 1995 Gerald Baumgartner + + * sig.c (build_signature_pointer_or_reference_type): Don't set + IS_AGGR_TYPE for signature pointers/reference so expand_default_init + doesn't expect to find a copy constructor. + * call.c (build_method_call): Treat signature pointers/reference + as if IS_AGGR_TYPE were set. + +Tue Jan 31 13:28:56 1995 Mike Stump + + * gc.c (get_typeid): Pawn off error messages to build_t_desc. + (build_t_desc): Inform the user here if they try and build + with -frtti and don't include . + + * decl2.c (finish_prevtable_vardecl): Support rescanning. + (finish_file): Move finish_prevtable_vardecl up to before the global + initializers are done as tdecls are initialized in the global + initializer. Also Pick up any new tdecls or vtables needed by + synthesized methods. + + * class.c (finish_struct): Simplify. We have to do rtti scanning at + end, so we might as well do all of it there. + +Tue Jan 31 05:35:02 1995 Jason Merrill + + * call.c (build_method_call): Fix -fthis-is-variable for 32-bit + targets, too. + +Tue Jan 31 00:11:04 1995 Mike Stump + + * decl2.c (finish_prevtable_vardecl): New routine, mostly split from + finish_vtable_vardecl. It has the first half functionality from + that routine. + * decl2.c (finish_vtable_vardecl): Update to not include stuff not + in finish_prevtable_vardecl. + * decl2.c (finish_file): Call finish_prevtable_vardecl. + * gc.c (build_generic_desc): Allow it to be called when not at the + global binding layer, but behave as if we were. + (build_t_desc): Rearrange a bit so that it really works and is + easier to follow. + * class.c (finish_struct): Don't decide on tdecls here, as we have + to wait until the end of the file in general to decide whether or + not they come out. + +Mon Jan 30 01:00:40 1995 Jason Merrill + + * init.c (build_delete): Check access to operator delete before + calling the destructor. + * method.c (build_opfncall, DELETE_EXPR): build_method is allowed to + return error_mark_node. + * call.c (build_method_call): Use the one-argument op delete even if + it's an error. + + * init.c (build_new): Fix -fthis-is-variable support. + * call.c (build_method_call): Likewise. + + * call.c (convert_harshness): Make conversion from a pointer to bool + worse than conversion to another pointer. + +Sat Jan 28 16:46:10 1995 Jason Merrill + + * init.c (build_new): Check new return value if -fcheck-new. + + * lex.c (check_newline): Clear end_of_file when we're done, too. + +Sat Jan 28 10:38:39 1995 Mike Stump + + * decl2.c (finish_vtable_vardecl): Make rtti TD tables follow + vtables whereever they go. + + * gc.c (build_t_desc): Remove old way of setting it up, as it wasn't + right. + +Sat Jan 28 09:10:44 1995 Mike Stump + + * decl2.c (finish_vtable_vardecl): Now set the + interface/implementation of vtables on the first virtual function, + if one exists, otherwise we use the old method. This is a major win + in terms of cutting down the size of objects and executables in + terms of text space and data space. Now most of the savings that + #pragma interface/implementation gives is automatic in a fair number + of cases. + +Sat Jan 28 04:57:33 1995 Jason Merrill + + * decl.c (grokdeclarator): Discard the template parameters in a + template constructor declaration so that the function is always + named constructor_name (ctype). + + * lex.c (check_newline): Use ungetc to put back the character before + calling HANDLE_PRAGMA. + +Fri Jan 27 17:23:47 1995 Mike Stump + + * decl2.c (check_classfn): If the cname is T and fn_name is T, + make sure we still match them. + +Fri Jan 27 16:32:10 1995 Jason Merrill + + * parse.y: Add END_OF_LINE token. + + * lex.c (check_newline): Set linemode when we see a # directive, and + unset it when we're done. Turn all 'return's into 'goto skipline'. + Fix all uses of '\n', since we won't see it anymore. Put back the + character we read before checking for a sysv or target pragma. + (real_yylex): If we see an EOF in linemode, return END_OF_LINE. + (handle_sysv_pragma): Don't look at the input stream; quit when we + see an END_OF_LINE token. + + * input.c (getch): Return EOF if we're in line mode and at the end + of a line. + (put_back): Don't put back an EOF. + +Thu Jan 26 19:26:34 1995 Mike Stump + + * except.c (expand_throw): Do the newing of the exception object + before we load the type descriptor or the address so that we don't + wipe any of the values out. + +Thu Jan 26 19:20:00 1995 Mike Stump + + * except.c (init_exception_processing): Don't use r12 on the rs6000. + +Tue Jan 24 16:36:31 1995 Jason Merrill + + * decl.c (grokparms): Don't try to build up a reference at this point. + + * typeck2.c (build_functional_cast): Don't assume that a NOP_EXPR + will suffice to convert from integer_zero_node. + +Wed Jan 25 15:02:09 1995 David S. Miller + + * class.c (instantiate_type): Change error message text. + * typeck2.c (store_init_value): Likewise. + +Mon Jan 23 21:57:14 1995 Mike Stump + + * pt.c (tsubst): When we copy a node, don't forget to copy + TREE_CHAIN, we use it later. + +Mon Jan 23 03:33:47 1995 Jason Merrill + + * typeck.c (convert_for_assignment): Initialize variable before use. + +Fri Jan 20 01:17:59 1995 Jason Merrill + + * g++.c (main): Link with both libstdc++ and libg++ if called as + something ending with "g++", otherwise only libstdc++. Move -lm to + the end of the line. + +Thu Jan 19 15:43:11 1995 Jason Merrill + + * call.c (build_method_call): Don't mess with 'this' before calling + compute_conversion_costs. + +Wed Jan 18 15:40:55 1995 Jason Merrill + + * search.c (get_matching_virtual): Give line number for previous + declaration. + + * call.c (convert_harshness): Handle conversions to references + better. + + * cvt.c (build_up_reference): OK, handle {MIN,MAX}_EXPR *properly*. + +Wed Jan 18 15:21:38 1995 Mike Stump + + * class.c (instantiate_type): Use DECL_CHAIN to walk lists instead, + as the TREE_CHAIN for methods will take us to the next differently + named function, DECL_CHAIN won't. + +Wed Jan 18 14:26:59 1995 Jason Merrill + + * tree.c (lvalue_p): Handle {MIN,MAX}_EXPR. + + * decl2.c (lang_decode_option): -Wall implies -Wparentheses. + warn_parentheses defaults to 0. + + * decl.c (grokparms): Put back call to require_instantiated_type. + +Tue Jan 17 19:56:15 1995 Mike Stump + + * except.c (exception_section): Use the data section on the rs6000. + Change calling convention for named_section. + +Wed Jan 17 18:20:57 1994 Fergus Henderson + + * cp-tree.h: Make if (x=0) warn with wall + * parse.y: Make if (x=0) warn with wall + +Tue Jan 17 14:12:00 1995 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): BITS_PER_WORD if SLOW_BYTE_ACCESS, + BITS_PER_UNIT otherwise. + + * search.c (get_matching_virtual): Don't check the binfo if the + types are the same. + + * cvt.c (cp_convert): Just call truthvalue_conversion to convert to + bool. + +Mon Jan 16 13:28:48 1995 Jason Merrill + + * various: Use boolean_type_node, boolean_true_node, + boolean_false_node. + + * search.c (get_matching_virtual): Allow covariant returns that + don't require pointer adjustment. + + * typeck.c (build_conditional_expr): Don't call default_conversion + on ifexp. + + * cvt.c (build_up_reference): Handle MIN_EXPR and MAX_EXPR. + + * decl.c (grokdeclarator): Upgrade warning about &const to pedwarn. + +Sun Jan 15 22:17:32 1995 David Binderman + + * pt.c (do_function_instantiation): Free targs once we're done. + +Sun Jan 15 22:17:32 1995 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): Defaults to BITS_PER_WORD. + (init_decl_processing): Use BOOL_TYPE_SIZE instead of CHAR_TYPE_SIZE + for bool. + +Sat Jan 14 05:33:55 1995 Jason Merrill + + * decl2.c (finish_file): We need to mess up if there are any + variables in the list, not just if there is one with a constructor. + +Fri Jan 13 14:42:55 1995 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_STATIC_{CON,DE}STRUCTOR. + (finish_function): Handle DECL_STATIC_{CON,DE}STRUCTOR. + (finish_function): Trust rest_of_compilation. + + * decl2.c (finish_file): Also call functions designated as static + constructors/destructors. + + * decl.c (grokdeclarator): Allow access decls of operator functions. + (grokparms): Only do convert_for_initialization if the initializer + has a type. + (duplicate_decls): Put back push_obstacks_nochange call. + + * lex.c (real_yylex): Downgrade complaint about the escape sequence + being too large from pedwarn to warning. + + * decl.c (grokdeclarator): Don't complain about long long in system + headers. + + * lex.c (real_yylex): Handle digraphs. + +Thu Jan 12 12:17:24 1995 Jason Merrill + + * decl.c (init_decl_processing): -f{no-,}strict-prototype only + affects C linkage declarations now. + + * typeck.c (comp_target_types): Grok simple contravariant conversions. + (common_type): t1 and t2 are interchangeable. + + * various: Test return value of comp_target_types differently in + different places; it now returns -1 for a contravariant conversion + (which is fine in symmetric cases). + + (common_type): Prefer long double to double even when + they have the same precision. + + * decl.c (grokparms): Call convert_for_initialization to check + default arguments. + + * init.c (build_new): void_type_node has a size (of 0). + + * decl.c (decls_match): Also check for agreement of TREE_READONLY + and TREE_THIS_VOLATILE. + (push_class_level_binding): Properly handle shadowing of + nested tags by fields. + + * search.c (dfs_pushdecls): Likewise. + + * decl2.c (finish_file): Don't second-guess self-initialization. + + * cvt.c (convert_to_reference): Work with expr directly, rather than + a copy. + + * decl.c (push_overloaded_decl): Only shadow artificial TYPE_DECLs. + + * init.c (add_friend): Downgrade duplicate friend message from + pedwarn to warning. + + * decl.c (duplicate_decls): Push obstacks before calling common_type. + +Thu Jan 12 17:15:21 1995 Michael Ben-Gershon + + * except.c (push_eh_entry): Set LABEL_PRESERVE_P flag for + exception table labels. + (expand_start_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + * except.c (make_first_label): New function. + (expand_start_all_catch): Add a call to make_first_label() before + using a label as a jump destination. + (expand_end_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + * except.c: Add ARM processor support for exception handling. + +Thu Jan 12 12:17:24 1995 Jason Merrill + + (complete_array_type): Copy code from C frontend. + + * lex.c (real_yylex): Don't multiply the length of a wide string + literal by WCHAR_BYTES. + + * decl.c (pushdecl): Check for redeclaration of wchar_t here. + (duplicate_decls): Instead of here. + (define_label): Complain about a label named wchar_t. + (grokdeclarator): Complain about declarations of + operator-function-ids as non-functions. + + * typeck.c (unary_complex_lvalue): Also wrap prefix -- and ++ in + COMPOUND_EXPRs. + (build_unary_op): Wrap unary plus in a NON_LVALUE_EXPR. + + * lex.c (real_yylex): Don't skip whitespace when reading the next + character after ->. + +Wed Jan 11 16:32:49 1995 Mike Stump + + * except.c: Allow cc1plus to be built with native compiler on rs6000. + (expand_start_all_catch): Add assemble_external calls for various + routines we call. + (expand_leftover_cleanups): Likewise. + (expand_start_catch_block): Likewise. + (do_unwind): Likewise. + (expand_builtin_throw): Likewise. + +Wed Jan 11 01:05:42 1995 Jason Merrill + + * decl.c (pushtag): Only look for a previous decl in the current + binding level. Use explicit global scope in DECL_NESTED_TYPENAME. + + * gxx.gperf: Add __signature__ and __sigof__ keywords. + + * decl2.c (lang_decode_option): -ansi does not set flag_no_asm. It + does set flag_no_gnu_keywords and flag_operator_names. + + * lex.c (init_lex): 'overload' is not a keyword unless -traditional. + Unset extension keywords if -fno-gnu-keywords. + Allow operator names ('bitand') if -foperator-names. + Never unset 'asm'; -fno-asm only affects 'typeof'. + + * decl.c (lookup_name_real): The got_object special lookup only + applies to types. + +Tue Jan 10 18:07:51 1995 Jason Merrill + + * spew.c (yylex): Also use DECL_NESTED_TYPENAME if got_object is set. + + * parse.y (primary): Unset got_object after all rules that use the + 'object' nonterminal. + (object): Set got_object. + + * lex.h: Declare got_object. + + * decl.c (lookup_name_real): Also lookup names in the context of an + object specified. + +Tue Jan 10 14:30:30 1995 Mike Stump + + * typeck.c (get_member_function_from_ptrfunc): Use ptrdiff_type_node + for things that have to be added to pointers, not size_type. Cures + problems with pointer to members on Alphas. + (build_binary_op_nodefault): Likewise. + (get_delta_difference_: Likewise. + (build_ptrmemfunc): Likewise. + +Tue Jan 10 01:49:25 1995 Jason Merrill + + * decl.c (pushtag): Stick the new decl in TYPE_NAME before pushing + it. + + * typeck.c (build_component_ref): Don't build up a COMPONENT_REF + when dealing with overloaded member functions; just act like + build_offset_ref. + (commonparms): Remove misleading comment. + + * decl.c (duplicate_decls): Complain about repeated default + arguments here. + (redeclaration_error_message): Instead of here. + (pushdecl): Complain about missing default arguments here. + (grokparms): Instead of here. + (lookup_name_current_level): Also match on DECL_ASSEMBLER_NAME. + (grok_reference_init): Do not complain about missing initializer if + declared 'extern'. + + * search.c (lookup_field): Don't return a TYPE_DECL if there is a + function alternative and want_type is not set. + +Mon Jan 9 18:16:23 1995 Jason Merrill + + * decl.c (pushtag): Don't set TYPE_NAME to an identifier. Do push + the decl when the type has no TYPE_NAME. + (lookup_nested_type): Don't assume that type has TYPE_NAME set. + (lookup_name_real): Call lookup_field with want_type = + prefer_type. + + * search.c (lookup_field): Handle want_type properly in the presence + of fields with the same name. + + * decl.c (set_nested_typename): Set nested name for file-scope types + to include leading ::. + (pushdecl): Set the nested typename if the decl doesn't have one, + rather than if the type's canonical decl doesn't have one. + +Mon Jan 9 03:44:33 1995 Jason Merrill + + * typeck.c (convert_for_assignment): Complain about contravariance + violation here. + (comp_target_types): Instead of here. + (build_unary_op): resolve_offset_ref before checking for a valid + type. + + * spew.c (yylex): Decrement looking_for_typename after we see a + _DEFN. + + * decl.c (pushdecl): Don't install an artificial TYPE_DECL in + IDENTIFIER_LOCAL_VALUE if we already have a decl with that name. + + * typeck.c (convert_for_assignment): Converting pointers to bool + does not need a cast. + +Sun Jan 8 18:16:45 1995 Jason Merrill + + * class.c (instantiate_type): Initialize nsubsts parm. + + * pt.c (do_function_instantiation): Likewise. + +Sat Jan 7 14:37:05 1995 Jason Merrill + + * pt.c (tsubst): Use TREE_STATIC instead of DECL_INLINE && + DECL_SAVED_INSNS to determine whether or not we've seen a definition + of this function. + (instantiate_template): Likewise. + + * call.c (convert_harshness): Allow const reference binding when + called from the overloading code, but not when called from + can_convert (since it isn't a conversion). + (convert_harshness): Put back some disabled code. + +Fri Jan 6 14:10:57 1995 Jason Merrill + + * call.c (convert_harshness): There is no implicit conversion from + void* to other pointer types (unless the parameter is (void*)0). + (convert_harshness): Non-lvalues do not convert to reference types. + + * class.c (finish_struct_methods): Still set + TYPE_HAS_{INT,REAL}_CONVERSION. + + * call.c (can_convert): Don't use aggregate initialization. + + * cp-tree.h: Declare lookup_conversions. + +Thu Jan 5 21:08:00 1995 Mike Stump + + * parse.y (simple_stmt): Fix duplicate case value error messages to + be more readable. + +Wed Jan 4 16:44:19 1995 Jason Merrill + + * cvt.c (build_type_conversion): Total rewrite to use + convert_harshness instead of reproducing conversion logic here. Now + much shorter. + + * call.c (convert_harshness): Support conversions to bool. + (can_convert): Checks whether a conversion is less harsh + than USER_CODE, for build_type_conversion. + + * search.c (add_conversions): Function for passing to dfs_walk which + adds all the type conversion operators in the current type to a list. + (lookup_conversions): Calls dfs_walk with add_conversions and return + the list. + (dfs_walk): Don't require a qfn. + + * cp-tree.h: Lose CLASSTYPE_CONVERSIONS hackery. + (CLASSTYPE_FIRST_CONVERSION): Points to elt 1 of CLASSTYPE_METHOD_VEC. + + * class.c (finish_struct_bits): Lose CLASSTYPE_CONVERSIONS hackery. + (grow_method): A separate function for building onto the growing + method vector. + (finish_struct_methods): Use it. Put all type conversion operators + right after the constructors. Perhaps we should sort the methods + alphabetically? + +Mon Jan 2 14:42:58 1995 Jason Merrill + + * call.c (build_method_call): Lose another misleading shortcut. + diff --git a/contrib/gcc/cp/ChangeLog-1996 b/contrib/gcc/cp/ChangeLog-1996 new file mode 100644 index 00000000000..348378beb15 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1996 @@ -0,0 +1,4047 @@ +Tue Dec 31 20:25:50 1996 Mike Stump + + * search.c (expand_upcast_fixups): Fix bogus code generation + problem where the generated code uses the wrong index into the + runtime built vtable on the stack. Old code could clobber random + stack values. + +Tue Dec 31 15:16:56 1996 Mike Stump + + * init.c (perform_member_init): Make sure the partial EH cleanups + live on the function_obstack. + +Fri Dec 27 10:31:40 1996 Paul Eggert + + * Make-lang.in (g++spec.o): Don't use $< with an explicit target; + this isn't portable to some versions of `make' (e.g. Solaris 2.5.1). + +Tue Dec 24 10:24:03 1996 Jeffrey A Law + + * decl.c (grokvardecl): Avoid ANSI style initialization. + +Sun Dec 22 04:22:06 1996 Jason Merrill + + * pt.c (tsubst): Tweak arg types for a FUNCTION_TYPE. + +Fri Dec 20 17:09:25 1996 Jason Merrill + + * pt.c (instantiate_class_template): Call grok_{ctor,op}_properties. + +Fri Dec 20 12:17:12 1996 Brendan Kehoe + + * g++spec.c (lang_specific_driver): Put missing hyphen in front of + arguments we compare against. Start the count of I at 1, not 0, + since argv[0] is still the command. + +Thu Dec 19 11:53:57 1996 Stan Shebs + + * lang-specs.h: Accept .cp as an C++ extension. + +Mon Dec 16 22:43:31 1996 Brendan Kehoe + + * cp-tree.h (ptr_reasonably_similar): Add decl. + +Thu Dec 12 15:00:35 1996 Brendan Kehoe + + * decl.c (grokvardecl): Change SPECBITS parm to be the SPECBITS_IN + pointer. New local SPECBITS with the parm's value. + (grokdeclarator): Pass &specbits down. + + * parse.y (expr_no_commas): Make sure $$ is not an error_mark_node + before we try to do C_SET_EXP_ORIGINAL_CODE on it. + + * search.c (envelope_add_decl): Check that the CLASSTYPE_CID of + CONTEXT is not 0 before we try to use TYPE_DERIVES_FROM. + + * decl.c (cplus_expand_expr_stmt): Only expand the expr if EXP is + not an error_mark_node. + +Sat Dec 7 17:20:22 1996 Jason Merrill + + * cp-tree.h (TYPE_MAIN_DECL): Use TYPE_STUB_DECL. + * *.c: Use TYPE_MAIN_DECL instead of TYPE_NAME where appropriate. + +Fri Dec 6 14:40:09 1996 Jason Merrill + + * decl.c (grokdeclarator): When giving an anonymous struct a name, + replace TYPE_NAME instead of TYPE_IDENTIFIER (so TYPE_STUB_DECL is + not affected). + + * typeck2.c (build_m_component_ref): If component is a pointer + to data member, resolve the OFFSET_REF now. + + * call.c (convert_like): Don't go into infinite recursion. + + * pt.c (coerce_template_parms): Use tsubst_expr for non-type args. + + * class.c (finish_struct_1): Set DECL_ARTIFICIAL on the vptr. + * tree.c (layout_basetypes): And on the vbase ptr. + +Thu Dec 5 02:11:28 1996 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): Define in terms of POINTER_SIZE or + CHAR_TYPE_SIZE so bool is always the same size as another type. + + * decl.c (pushtag): Set DECL_IGNORED_P for DWARF, too. + +Tue Dec 3 23:18:37 1996 Jason Merrill + + * decl2.c (grok_x_components): Remove synthesized methods from + TYPE_METHODS of an anonymous union, complain about member + functions. + * decl.c (shadow_tag): Wipe out memory of synthesized methods in + anonymous unions. + (finish_function): Just clear the DECL_RTL of our arguments. + +Fri Nov 29 21:54:17 1996 Jason Merrill + + * decl2.c (finish_file): Emit DWARF debugging info for static data + members. + + * pt.c (tsubst): If t is a stub decl, return the stub decl for type. + +Wed Nov 27 14:47:15 1996 Bob Manson + + * typeck.c (build_component_ref): Don't die if COMPONENT isn't a + IDENTIFIER_NODE. + +Wed Nov 27 16:05:19 1996 Michael Meissner + + * Make-lang.in (g++-cross$(exeext)): Fix typo. + +Wed Nov 27 08:14:00 1996 Brendan Kehoe + + Make the g++ driver now be a standalone program, rather than one + that tries to run the gcc driver after munging up the options. + * Make-lang.in (g++.c, g++spec.o): New rules. + (g++.o): New rule, based on gcc.o with -DLANG_SPECIFIC_DRIVER + added. + (g++$(exeext)): New rule, based on xgcc rule. + (g++-cross$(exeext)): Now just copies g++$(exeext) over. + * g++spec.c: New file. + * g++.c: Removed file. + +Tue Nov 26 19:01:09 1996 Mike Stump + + * cvt.c (build_up_reference): Arrange for any temporary values + that have been keep in registers until now to be put into memory. + +Mon Nov 25 15:16:41 1996 Kaveh R. Ghazi + + * Make-lang.in (c++.stage[1234]): Depend upon stage[1-4]-start, so + that make -j3 bootstrap works better. + +Sun Nov 24 02:09:39 1996 Jason Merrill + + * decl.c (pushtag): Do pushdecl for anon tags. + +Thu Nov 21 16:30:24 1996 Jason Merrill + + * typeck.c (c_expand_return): Fix logic. + (unary_complex_lvalue): Avoid unused warning on address of INIT_EXPR. + +Wed Nov 20 18:47:31 1996 Bob Manson + + * g++.c (main): Make sure arglist has a final NULL entry. Add + PEXECUTE_LAST to the flags passed to pexecute, as otherwise + stdin/stdout of the invoked program are redirected to + nowheresville. + +Tue Nov 19 16:12:44 1996 Jason Merrill + + * decl.c (implicitly_declare): Set DECL_ARTIFICIAL. + +Tue Nov 19 15:48:19 1996 Mike Stump + + * init.c (resolve_offset_ref): Handle obj.vfn better. + * typeck.c (build_component_ref): Set TREE_TYPE on result from + build_vfn_ref. + +Tue Nov 19 13:14:33 1996 Mike Stump + + * typeck.c (convert_for_assignment): Also handle anachronistic + implicit conversions from (::*)() to cv void*. + * cvt.c (cp_convert_to_pointer): Likewise. + +Mon Nov 18 17:05:26 1996 Jason Merrill + + * lex.c (handle_cp_pragma): Fix bogus warning. + +Mon Nov 18 16:10:43 1996 Mike Stump + + * cvt.c (cp_convert_to_pointer): Avoid thinking a POINTER_TYPE + (METHOD_TYPE) is a TYPE_PTRMEMFUNC_P. + +Thu Nov 14 23:18:17 1996 Jason Merrill + + * class.c (finish_struct_1): Support DWARF2_DEBUG. + * search.c (dfs_debug_mark): Likewise. + * decl2.c (finish_vtable_vardecl): Likewise. + * decl.c (pushtag, finish_enum): Likewise. + * lex.c (check_newline): Use debug_* instead of calling *out + functions directly. + +Thu Nov 14 15:21:46 1996 Brendan Kehoe + + * Make-lang.in (cplib2.ready): Add else clause to avoid problems + on some picky hosts. + +Wed Nov 13 12:32:07 1996 Jason Merrill + + * class.c (finish_struct_1): A class has a non-trivial copy + constructor if it has virtual functions. + + * cvt.c (cp_convert): Always call a constructor. + + * call.c (reference_binding): Still tack on a REF_BIND + for bad conversions. + (build_user_type_conversion_1): Propagate ICS_BAD_FLAG. + + * typeck.c (convert_arguments): Pass LOOKUP_ONLYCONVERTING. + (c_expand_return): Likewise. + * typeck2.c (digest_init): Likewise for { }. + * init.c (expand_aggr_init_1): Keep the CONSTRUCTOR handling. + * cvt.c (cp_convert): Handle failure better. + +Wed Nov 13 11:51:20 1996 Brendan Kehoe + + * g++.c (main): Also set PEXECUTE_SEARCH, to make the invocation + of GCC be path-relative. + +Wed Nov 13 11:27:16 1996 Michael Meissner + + * Make-lang.in (g++-cross): G++-cross doesn't need version.o, but + it does need choose-temp.o and pexecute.o. + +Wed Nov 13 07:53:38 1996 Brendan Kehoe + + * g++.c (error) [!HAVE_VPRINTF]: Put error back for the only time + that we still use it. + (P_tmpdir, R_OK, W_OK, X_OK) [__MSDOS__]: Delete unnecessary macros. + +Wed Nov 13 02:00:26 1996 Jason Merrill + + * init.c (expand_default_init): Avoid calling constructors to + initialize reference temps. + + * cvt.c (convert_to_reference): Fix. + +Tue Nov 12 19:10:07 1996 Jason Merrill + + * cvt.c (cp_convert): Simplify for flag_ansi_overloading. + (convert_to_reference): Likewise. + * typeck.c (convert_for_initialization): Likewise. + * init.c (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + * cp-tree.h (CONV_NONCONVERTING): Lose. + * typeck.c (build_c_cast): Lose allow_nonconverting parm. + * *.c: Adjust. + * call.c (build_user_type_conversion_1): Assume LOOKUP_ONLYCONVERTING. + +Tue Nov 12 16:29:04 1996 Brendan Kehoe + + * pt.c (tsubst_expr): Reverse args to expand_start_catch_block. + +Tue Nov 12 15:26:17 1996 Jason Merrill + + * init.c (expand_aggr_init_1): Don't crash on non-constructor + TARGET_EXPR. + +Tue Nov 12 14:00:50 1996 Brendan Kehoe + + * g++.c: Include gansidecl.h. + (VPROTO, PVPROTO, VA_START): Delete. + (choose_temp_base_try, choose_temp_base, perror_exec, + run_dos) [__MSDOS__]: Delete fns. + (pfatal_with_name): Delete fn. + (temp_filename): Declare like in gcc.c. + (pexecute, pwait, choose_temp_base): Declare from gcc.c. + (error_count, signal_count): Define. + (error): Delete both definitions. + (PEXECUTE_{FIRST,LAST,SEARCH,VERBOSE}): Define from gcc.c. + (pfatal_pexecute): Add fn from gcc.c. + (main): Rename local VERBOSE var to VERBOSE_FLAG. Rewrite the + code to use the pexecute stuff also used by gcc.c. + (MIN_FATAL_STATUS): Define. + * Make-lang.in (g++): Add dependency on and linking with + choose-temp.o and pexecute.o. + + * cp-tree.h: Include gansidecl.h. + (STDIO_PROTO): Delete #undef/#define. + * cvt.c (NULL): Delete #undef/#define. + * expr.c (NULL): Likewise. + * init.c (NULL): Likewise. + * rtti.c (NULL): Likewise. + * xref.c (NULL): Likewise. + + * cp-tree.h (build_user_type_conversion): Add prototype. + * call.c (build_user_type_conversion): Delete prototype. Correct + decl of FLAGS arg to be an int. + * cvt.c (build_user_type_conversion): Likewise. + +Tue Nov 12 12:16:20 1996 Jason Merrill + + * cp-tree.def: Add TRY_BLOCK and HANDLER. + * except.c (expand_start_catch_block): Support templates. + * parse.y (try_block, handler_seq): Likewise. + * pt.c (tsubst_expr): Support TRY_BLOCK and HANDLER. + +Mon Nov 11 13:57:31 1996 Jason Merrill + + * pt.c (current_template_args): New fn. + (push_template_decl): Use it. + * decl.c (grokdeclarator): Use it. + + * decl2.c (build_expr_from_tree): Dereference ref vars. + + * decl.c (grokdeclarator): Generalize handling of TYPENAME_TYPEs in + the decl-specifier-seq. + + * decl.c (grok_op_properties): Don't force the type of a conversion + op to be complete. Don't warn about converting to the same type + for template instantiations. + + * decl2.c (finish_file): Don't call instantiate_decl on synthesized + methods. + +Mon Nov 11 13:20:34 1996 Bob Manson + + * typeck.c (get_delta_difference): Remove previous bogusness. + Don't give errors if force is set. + +Fri Nov 8 17:38:44 1996 Jason Merrill + + * decl2.c (finish_file): Don't emit debug info. + * decl.c (pushdecl): Lose obsolete code. + (grokdeclarator): Still do the long long thing after complaining. + * search.c (note_debug_info_needed): Don't do anything if we're in a + template. + * method.c (synthesize_method): For non-local classes, + push_to_top_level first. + +Fri Nov 8 11:52:28 1996 Bob Manson + + * typeck.c (get_delta_difference): Add no_error parameter. + (build_ptrmemfunc): Call get_delta_difference with no_error set; + we don't want error messages when converting unrelated + pointer-to-member functions. + +Thu Nov 7 11:16:24 1996 Mike Stump + + * error.c (dump_expr): Improve the wording on error messages that + involve pointer to member functions. + +Tue Nov 5 17:12:05 1996 Mike Stump + + * cvt.c (cp_convert_to_pointer): Move code for conversions from + (::*)() to void* or (*)() up a bit, so that we can convert from + METHOD_TYPEs as well. + +Tue Nov 5 14:54:17 1996 Jason Merrill + + * rtti.c (get_tinfo_fn): Make sure 'type' is permanent. + There are no 'member' types. + (get_tinfo_fn_dynamic): Diagnose typeid of overloaded fn. + (build_x_typeid): Handle errors. + +Mon Nov 4 17:43:12 1996 Mike Stump + + * typeck.c (convert_for_assignment): Handle anachronistic implicit + conversions from (::*)() to void* or (*)(). + * cvt.c (cp_convert_to_pointer): Likewise. + (cp_convert_to_pointer_force): Remove cp_convert_to_pointer + conversions from here. + * decl2.c (lang_decode_option): Add -W{no-,}pmf-conversions. + * lang-options.h: Likewise. + * decl2.c (warn_pmf2ptr): Define. + * cp-tree.h: Declare it. + * typeck2.c (digest_init): Allow pmfs down into + convert_for_initialization. + +Sun Nov 3 09:43:00 1996 Jason Merrill + + * typeck.c (c_expand_return): Fix for returning overloaded fn. + +Fri Nov 1 08:53:17 1996 Jason Merrill + + * cp-tree.h (DIRECT_BIND): Change from INDIRECT_BIND. + * decl.c (grok_reference_init): Pass DIRECT_BIND. + * cvt.c (build_up_reference): Don't mark 'this' addressable. Use + DIRECT_BIND. + * call.c (convert_like): Don't pass INDIRECT_BIND. + * typeck.c (convert_arguments): Likewise. + * typeck.c (mark_addressable): Allow &this if flag_this_is_variable. + +Thu Oct 31 17:08:49 1996 Jason Merrill + + * typeck.c (mark_addressable): Support TARGET_EXPR, unify with + similar code in build_up_ref. + * cvt.c (build_up_reference): Drastically simplify. + +Mon Oct 28 12:45:05 1996 Jeffrey A Law + + * typeck.c (signed_or_unsigned_type): If the given type already + as the correct signedness, then just return it. + + * typeck.c ({un,}signed_type): If can't do anything, call + signed_or_unsigned_type. + +Thu Oct 24 14:21:59 1996 Bob Manson + + * decl2.c (copy_assignment_arg_p): Don't buy the farm if + current_class_type is NULL. + +Wed Oct 23 00:43:10 1996 Jason Merrill + + * class.c (finish_struct_1): Avoid empty structs by adding a field + so layout_type gets the mode right. + + * typeck.c (c_expand_return): Drastically simplify. + +Mon Oct 21 22:34:02 1996 Jason Merrill + + * typeck.c (decay_conversion): Handle overloaded methods. + +Fri Oct 18 16:03:48 1996 Jason Merrill + + * call.c (build_over_call): A TARGET_EXPR has side-effects. + +Thu Oct 17 11:31:59 1996 Mike Stump + + * cvt.c (convert_to_pointer_force): Add code to support pointer to + member function to pointer to function conversions. + * init.c (resolve_offset_ref): Add code to allow faked up objects, + ignoring them if they are not used, and giving an error, if they + are needed. + * typeck.c (get_member_function_from_ptrfunc): Fold e1 to improve + code, and so that we can give an error, if we needed an object, + and one was not provided. + (build_c_cast): Don't call default_conversion when we want to + convert to pointer to function from a METHOD_TYPE. + +Mon Oct 14 00:28:51 1996 Jason Merrill + + * Make-lang.in (cplib2.ready): Fix logic. + + * decl.c (shadow_tag): Only complain about non-artificial function + members. + + * class.c (finish_struct_1): Add synthesized methods to TYPE_METHODS. + +Fri Oct 11 16:12:40 1996 Jason Merrill + + * expr.c (cplus_expand_expr): Pre-tweak call_target like + expand_inline_function would. + + * pt.c (mark_decl_instantiated): If extern_p, call + mark_inline_for_output. + +Thu Oct 10 15:58:08 1996 Mike Stump + + * typeck.c (unary_complex_lvalue): Add code to handle intermediate + pmd conversions. + + * typeck.c (get_delta_difference): Fix wording, as we can be used + for pointer to data members. + +Tue Oct 8 12:43:51 1996 Bob Manson + + * pt.c (tsubst): If the function decl isn't a member of this + template, return a copy of the decl (including copying the + lang-specific part) so we don't hose ourselves later. + +Thu Oct 3 16:24:28 1996 Jason Merrill + + * class.c (finish_struct): Remove DWARF-specific tag handling. + * decl.c (pushtag): Likewise. + (finish_function): Always clear DECL_ARGUMENTS on function decls with + no saved RTX. + * decl2.c (finish_file): Emit DWARF debugging info for static data + members. + +Wed Oct 2 21:58:01 1996 Bob Manson + + * decl.c (duplicate_decls): Make sure the old DECL_LANG_SPECIFIC + isn't the same as the new one before we whack it. + +Mon Sep 30 13:38:24 1996 Jason Merrill + + * class.c, cp-tree.h, cvt.c, decl.c, decl2.c, gxx.gperf, hash.h, + lex.c, method.c, parse.y, typeck.c, typeck2.c: Remove + warn_traditional and warn_strict_prototypes; remove ancient + 'overload' code; remove references to flag_traditional. + +Mon Sep 30 12:58:40 1996 Mike Stump + + * input.c (sub_getch): Handle 8-bit characters in string literals. + +Sun Sep 29 03:12:01 1996 Jason Merrill + + * tree.c (mapcar): Handle CONSTRUCTORs. + (copy_to_permanent): Handle expression_obstack properly. + + * Make-lang.in (cplib2.txt): Also depend on the headers. + + * rtti.c (get_tinfo_var): Don't assume that POINTER_SIZE == + INT_TYPE_SIZE. + (expand_class_desc): Use USItype for offset field. + * tinfo.h (struct __class_type_info): Likewise. + + * method.c (build_overload_int): TYPE_PRECISION should be applied + to types. + +Sat Sep 28 14:44:50 1996 Jason Merrill + + * call.c (build_new_op): A COND_EXPR involving void must be a + builtin. + +Fri Sep 27 16:40:30 1996 Jason Merrill + + * typeck.c (build_x_component_ref): New fn. + (build_object_ref): Use it. + * parse.y (primary): Use it. + * decl2.c (build_expr_from_tree): Use it. + * cp-tree.h: Declare it. + + * decl.c (start_decl): Variable-sized arrays cannot be initialized. + * error.c (dump_type_suffix): Handle variable arrays. + +Fri Sep 27 13:14:05 1996 Brendan Kehoe + + * Make-lang.in (exception.o): Put back compiling it with -fPIC. + +Fri Sep 27 03:00:09 1996 Jason Merrill + + * decl.c (lookup_name_real): Don't try to look up anything in a + TYPENAME_TYPE. + + * tinfo2.cc (__throw_type_match_rtti): Oops. + +Thu Sep 26 22:11:05 1996 Brendan Kehoe + + * Make-lang.in (exception.o): Use -fno-PIC for now. + +Thu Sep 26 10:59:00 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Pass tinfo fns rather than + calling them. + (get_tinfo_fn_dynamic): Extracted from build_typeid. + * tinfo2.cc (__dynamic_cast): Adjust. + + * rtti.c (build_typeid): Use resolves_to_fixed_type_p. + (build_x_typeid): Likewise. + + * parse.y: Call build_x_typeid instead of build_typeid. + * cp-tree.def: Add TYPEID_EXPR. + * pt.c (tsubst_copy): Handle typeid. + * decl2.c (build_expr_from_tree): Likewise. + * rtti.c (build_x_typeid): Throw bad_typeid from here. + (build_typeid): Not here. + * cp-tree.h: Declare build_x_typeid. + +Wed Sep 25 17:26:16 1996 Jason Merrill + + * call.c (convert_like): Pull out constant values. + + * tree.c (mapcar): Use build_cplus_array_type, not build_array_type. + +Wed Sep 25 17:28:53 1996 Michael Meissner + + * decl.c (init_decl_processing): Create short int types before + creating size_t in case a machine description needs to use + unsigned short for size_t. + +Tue Sep 24 18:18:44 1996 Jason Merrill + + * Make-lang.in (exception.o): Turn off pic. + + * tinfo2.cc (__throw_type_match_rtti): Fix cv-variants of the same + type, multi-level ptr conversions. + + * rtti.c (call_void_fn): Renamed and genericized from throw_bad_cast. + (throw_bad_cast): Use it. + (throw_bad_typeid): New fn. + (build_typeid): Throw bad_typeid as needed. + Use build_call. + (synthesize_tinfo_fn): Handle functions and arrays before checking + for cv-quals. + + * Remove .h from standard C++ headers, add new.h, move into inc + subdirectory. + + * exception*: Remove pointer from object, constructors. Add + default exception::what that uses type_info::name. Add + __throw_bad_typeid. + + * init.c (build_new): Don't add a cookie to new (void *) T[2]. + +Mon Sep 23 15:21:53 1996 Jason Merrill + + * Make-lang.in: Building C++ code depends on cc1plus. + +Mon Sep 23 12:38:40 1996 Brendan Kehoe + + * decl.c (struct saved_scope): Declare PROCESSING_TEMPLATE_DECL as + a HOST_WIDE_INT, not a tree. + +Mon Sep 23 12:36:02 1996 Jason Merrill + + * exception.cc: Don't include . + + * Make-lang.in (c++.clean): Remove cplib2.*. + +Mon Sep 23 09:42:19 1996 Doug Evans + + * parse.y (component_decl_1, component_costructor_declarator case): + Pass attributes/prefix_attributes in tree list. + +Mon Sep 23 01:18:50 1996 Jason Merrill + + * tinfo{,2}.cc: #include instead of . + +Sun Sep 22 05:31:22 1996 Jason Merrill + + * lex.c (do_identifier): Don't do deferred lookup in a template + header. + + * typeck2.c (store_init_value): Oops. + + * new.{h,cc}, exception.{h,cc}, typeinfo.h, tinfo{2.cc,.cc,.h}: + New files for C++ lang-support library. + * Make-lang.in (CXX_EXTRA_HEADERS): Define. + (CXX_LIB2FUNCS): Define. + And rules for building the C++ lang-support code. + * config-lang.in (headers): Define. + (lib2funcs): Define. + +Sat Sep 21 19:17:28 1996 Jason Merrill + + * decl2.c (build_expr_from_tree): If CONSTRUCTOR has a type, call + digest_init. + * pt.c (tsubst_copy): Compute type for CONSTRUCTOR. + * typeck2.c (store_init_value): Check for initializing pmf with { } + here. + (process_init_constructor): Not here. + +Thu Sep 19 16:41:07 1996 Jason Merrill + + * pt.c (begin_template_parm_list): Increment + processing_template_decl here. + (end_template_parm_list): Not here. + (process_template_parm): No need to add 1 to it now. + * *.c: Use processing_template_decl instead of current_template_parms + to check for being in a template. + + * pt.c (uses_template_parms): Handle SCOPE_REF. Fix CONSTRUCTOR. + (tsubst_copy): Handle CONSTRUCTOR. + (instantiate_decl): Set up context properly for variables. + * decl2.c (build_expr_from_tree): Handle CONSTRUCTOR. + * class.c (finish_struct): Reverse CLASSTYPE_TAGS. + +Wed Sep 18 13:30:20 1996 Brendan Kehoe + + * lex.c (enum tree_node_kind) [GATHER_STATISTICS]: Put the enum back. + +Wed Sep 18 04:24:07 1996 Jason Merrill + + * method.c (make_thunk): Call comdat_linkage before setting the + TREE_CODE. + + * decl2.c (comdat_linkage): Use make_decl_one_only. + (import_export_decl): Likewise. + * decl.c (init_decl_processing): Check supports_one_only instead of + SUPPORTS_WEAK. + +Sat Sep 14 08:34:41 1996 Jason Merrill + + * decl2.c (grokfield): Tighten checking for access decls. + + * decl.c (make_typename_type): Resolve references to + current_class_type. Set CLASSTYPE_GOT_SEMICOLON. + (lookup_name_real): Types that depend on a template parameter get + an implicit 'typename' unless they're in the current scope. + (start_decl_1): We don't care about incomplete types that depend + on a template parm. + (grokdeclarator): Resolve 'typename's in the type specifier that + refer to members of the current scope. + + * call.c (build_over_call): Remove 'inline called before + definition' diagnostic. + (build_method_call): Likewise. + * decl.c (duplicate_decls): Downgrade 'used before declared + inline' to a warning, only with -Winline. + +Fri Sep 13 17:31:40 1996 Stan Shebs + + * mpw-make.sed: Fix include paths, add @DASH_C_FLAG@ to compile. + +Wed Sep 11 22:38:13 1996 Gerald Baumgartner + + * call.c (build_method_call): When calling a signature + default implementation, as in other cases, let instance_ptr simply + be instance. + +Wed Sep 11 22:14:44 1996 Mike Stump + + * parse.y (simple_stmt): Cleanup and use do_poplevel (). + +Wed Sep 11 22:10:48 1996 Mike Stump + + * except.c (expand_start_catch_block): Add a pushlevel so that -g + works on hppa and SPARC. + +Wed Sep 11 10:18:06 1996 Brendan Kehoe + + * typeck.c (build_indirect_ref): Catch PTR being an error_mark_node. + +Mon Sep 9 19:51:14 1996 Gerald Baumgartner + + * call.c (build_over_call): Check first whether DECL_CONTEXT exists + before testing whether it's a signature. + +Sun Sep 8 16:06:57 1996 Gerald Baumgartner + + * call.c (build_new_method_call): Don't complain about signature + pointers and references not being an aggr type. + (build_this): If a signature pointer or reference was passed in, + just return it. + (build_new_method_call): If instance is a signature pointer, set + basetype to the signature type of instance. + * sig.c (build_signature_method_call): Deleted basetype and + instance parameters, they can be found as the DECL_CONTEXT of + function and as the first argument passed in. + * cp-tree.h: Changed declaration of build_signature_method_call. + * call.c (build_method_call): Deleted first two arguments in call + of build_signature_method_call. + (build_over_call): Added call to build_signature_method_call. + +Thu Sep 5 16:51:28 1996 Jason Merrill + + * typeck.c (build_c_cast): Don't tack a non_lvalue_expr onto a + target_expr. + +Thu Sep 5 10:05:38 1996 Brendan Kehoe + + * cvt.c (convert_to_reference): Use %#T, not %#D, for error. + +Wed Sep 4 17:16:09 1996 Bob Manson + + * except.c (expand_start_try_stmts): Move to except.c in the backend. + (expand_end_try_stmts): Remove. + + * init.c (perform_member_init): Use add_partial_entry () instead + of directly manipulating lists. + (emit_base_init): Likewise. + +Wed Sep 4 12:14:36 1996 Mike Stump + + * except.c (expand_exception_blocks): Always make sure USE and + CLOBBER insns that came at the end still do, the backend relies + upon this. + +Wed Sep 4 07:44:48 1996 Jason Merrill + + * call.c (build_over_call): We can only use a TARGET_EXPR of the + right type. + +Tue Sep 3 19:26:05 1996 Jason Merrill + + * cvt.c (convert_to_reference): Revert last change, don't complain + about temp without target decl. + +Tue Sep 3 10:22:56 1996 Mike Stump + + * decl.c (grokdeclarator): Don't core dump when void() is given. + +Tue Sep 3 02:38:56 1996 Jason Merrill + + * decl.c (copy_args_p): Don't crash. + +Fri Aug 30 14:26:57 1996 Mike Stump + + * pt.c (tsubst): And support template args inside the exception + specification. + + * pt.c (tsubst): Add support for exception specifications in + template functions. + +Fri Aug 30 10:01:55 1996 Mike Stump + + * cp-tree.def (DECL_STMT): Eliminate the throw spec field, only 3 + fields now. + * cp-tree.h (start_decl): Eliminate the throw spec parameter. + (start_function): Likewise. + (start_method): Likewise. + (grokfield): Likewise. + (make_call_declarator): Add throw spec parameter. + (set_quals_and_spec): Add routine. + * lex.c (set_quals_and_spec): Likewise. + * decl.h (grokdeclarator): Eliminate the throw spec parameter. + * decl.c (shadow_tag): Eliminate the throw spec parameter to + grokdeclarator. + (groktypename): Likewise. + (start_decl): Eliminate the throw spec parameter. Eliminate the + throw spec parameter to grokdeclarator. Eliminate the throw spec + field in DECL_STMT. + (cp_finish_decl): Eliminate the throw spec field in DECL_STMT. + (grokfndecl): Remove useless set of raises. + (grokdeclarator): Eliminate the throw spec parameter. Eliminate + the throw spec parameter to start_decl. Pull the throw spec out + of the call declarator. + (grokparms): Eliminate the throw spec parameter to grokdeclarator. + (start_function): Eliminate the throw spec parameter. Eliminate + the throw spec parameter to grokdeclarator. + (start_method): Likewise. + * decl2.c (grokfield): Likewise. + (grokbitfield): Eliminate the throw spec parameter to grokdeclarator. + (grokoptypename): Likewise. + (finish_file): Eliminate the throw spec parameter to + start_function. Add throw spec to make_call_declarator. + * except.c (init_exception_processing): Add throw spec to + make_call_declarator. Eliminate the throw spec parameter to + start_decl. + (expand_start_catch_block): Eliminate the throw spec parameter to + grokdeclarator. + (expand_builtin_throw): Add throw spec to make_call_declarator. + Eliminate the throw spec parameter to start_function. + (start_anon_func): Likewise. + * lex.c (make_call_declarator): Add throw spec parameter. + (set_quals_and_spec): New routine. + (cons_up_default_function): Add throw spec to make_call_declarator. + Eliminate the throw spec parameter to grokfield. + * method.c (synthesize_method): Eliminate the throw spec parameter + to start_function. + * pt.c (process_template_parm): Eliminate the throw spec parameter + to grokdeclarator. + (tsubst): Add throw spec to make_call_declarator. + (tsubst_expr): Eliminate the throw spec parameter to start_decl. + (do_function_instantiation): Eliminate the throw spec parameter to + grokdeclarator. Eliminate the throw spec parameter to + start_function. + * rtti.c (synthesize_tinfo_fn): Eliminate the throw spec parameter + to start_function. + * parse.y (datadef): Remove non-winning optimization. + (decl): Likewise. + (fndef): Remove ambiguous error productions uncovered by grammar + fixing. + (constructor_declarator): Add exception_specification_opt here. + (component_constructor_declarator): Likewise. + (direct_after_type_declarator): Likewise. + (complex_direct_notype_declarator): Likewise. + (direct_abstract_declarator): Likewise. + (fn.def1): Remove exception_specification_opt. + (fn.def2): Likewise. + (condition): Likewise. + (initdcl0): Likewise. + (initdcl): Likewise. + (notype_initdcl0): Likewise. + (nomods_initdcl0): Likewise. + (component_decl_1): Likewise. + (component_declarator): Likewise. + (after_type_component_declarator0): Likewise. + (after_type_component_declarator): Likewise. + (notype_component_declarator): Likewise. + +Wed Aug 28 01:40:30 1996 Jason Merrill + + * call.c (build_over_call): Also use an INIT_EXPR when + initializing anything from an rvalue. + + * call.c (build_over_call): Call stabilize_reference when building + an INIT_EXPR instead of calling the copy ctor. + + * call.c (joust): Extend the previous change to all comparisons. + + * decl2.c, method.c, lex.c: Use MAKE_DECL_ONE_ONLY and + NO_LINKAGE_HEURISTICS. + + * decl2.c (finish_file): Emit any statics that weren't already. + + * typeck.c (build_static_cast): Implement. + * tree.c (build_cplus_new): Handle getting a TARGET_EXPR. + * decl.c (grokparms): Use can_convert_arg instead of + implicit_conversion directly. + (copy_args_p): New fn. + * cvt.c (convert_to_reference): Don't complain about temp with + static_cast. + (build_up_reference): Handle TARGET_EXPRs. + * call.c (build_over_call): Elide unnecessary temps. + (can_convert*): Use new overloading code. + +Tue Aug 27 13:12:21 1996 Jason Merrill + + * call.c: Move TYPE_PTR*_MACROS ... + * cp-tree.h: To here. + * typeck.c (build_reinterpret_cast): Implement. + + * call.c (add_builtin_candidate): Use TYPE_PTROB_P instead of + ptr_complete_ob. + (joust): If we're comparing a function to a builtin and the worst + conversion for the builtin is worse than the worst conversion for the + function, take the function. + + * typeck.c (build_const_cast): Implement. + (comp_ptr_ttypes_const): Like comp_ptr_ttypes, for const_cast. + (comp_ptr_ttypes_reinterpret): Like cpt, for reinterpret_cast. + +Tue Aug 27 13:14:58 1996 Bob Manson + + * rtti.c (build_dynamic_cast): Don't try to dereference exprtype + too early. Make sure we explode if exprtype turns out to be a + NULL_TREE when it shouldn't be. + +Tue Aug 27 10:56:21 1996 Mike Stump + + * cp-tree.h: New routine make_call_declarator. + * lex.c (make_call_declarator): Define it. + * except.c (init_exception_processing): Use it. + (expand_builtin_throw): Likewise. + (start_anon_func): Likewise. + * decl2.c (finish_file): Likewise. + * lex.c (cons_up_default_function): Likewise. + * parse.y: Likewise. + * pt.c (tsubst): Likewise. + +Mon Aug 26 17:40:03 1996 Mike Stump + + * decl2.c (groktypefield): Remove unused code. + +Mon Aug 26 17:00:33 1996 Mike Stump + + * gxx.gperf: Change TYPE_QUAL into CV_QUALIFIER. + * parse.y: Likewise. Change maybe_type_qual into maybe_cv_qualifier. + Change type_quals into cv_qualifiers. Change nonempty_type_quals into + nonempty_cv_qualifiers. + * hash.h: Rebuild. + + * lex.c (make_pointer_declarator): Change type_quals into + cv_qualifiers. + (make_reference_declarator): Likewise. + +Thu Aug 22 01:09:22 1996 Jason Merrill + + * decl.c (start_function): Only check interface_* for templates + with flag_alt_external_templates. + + * call.c (build_new_op): Check for comparison of different enum types. + (build_over_call): Fix arg # output. + + * typeck.c (build_component_ref): Handle pre-found TYPE_DECL. + +Wed Aug 21 00:13:15 1996 Jason Merrill + + * call.c (build_new_op): Check for erroneous args. + + * call.c (build_new_method_call): Add missing args to cp_error. + + * tree.c (error_type): Don't print reference-to-array. + + * typeck.c (convert_for_assignment): Don't say contravariance for + removing const. + +Tue Aug 20 13:23:00 1996 Jason Merrill + + * call.c (build_over_call): Diagnose bad convs for `this'. + + * lex.c (cons_up_default_function): Set DECL_ARTIFICIAL + on _ctor_arg. + + * call.c (convert_like): Handle bad convs. + (build_over_call): Handle bad convs better. + + * decl2.c: -fansi-overloading is now the default. + + * call.c (build_new_method_call): Check for erroneous args. + + * pt.c (instantiate_class_template): Propagate + TYPE_USES_MULTIPLE_INHERITANCE. + +Tue Aug 20 13:09:57 1996 Mike Stump + + * call.c (enforce_access): Add static to routine. + +Sun Aug 18 14:35:54 1996 Jason Merrill + + * call.c (build_user_type_conversion_1): Fix bad handling. + (compare_ics): Likewise. + +Sat Aug 17 21:54:11 1996 Jason Merrill + + * call.c (standard_conversion): Oops. + +Sat Aug 17 16:28:11 1996 Geoffrey Noer + + * g++.c: Update test for win32 (&& ! cygwin32). + +Sat Aug 17 03:45:31 1996 Jason Merrill + + * typeck.c (comp_ptr_ttypes_real): Handle OFFSET_TYPEs properly. + (ptr_reasonably_similar): New fn. + * call.c (BAD_RANK): New rank. + (ICS_BAD_FLAG): New macro. + (standard_conversion): Handle almost-right pointer conversions. + (reference_binding): Handle bad rvalue bindings. + (add_*_candidate): Stuff. + (build_over_call): Pass bad conversions to convert_for_initialization. + (compare_ics): Handle bad convs. + (joust): Likewise. + +Fri Aug 16 15:02:19 1996 Bob Manson + + * init.c (expand_vec_init): Use ptrdiff_type_node instead of + integer_type_node when computing pointer offsets. + +Fri Aug 16 01:28:32 1996 Jason Merrill + + * tree.c (lvalue_type): New fn. + (error_type): New fn. + * call.c (op_error): Use error_type. + (add_conv_candidate): Use lvalue_type. + (add_builtin_candidates): Likewise. + * error.c (args_as_string): Use error_type. + +Thu Aug 15 17:27:13 1996 Jason Merrill + + * pt.c (instantiate_decl): Evaluate DECL_INITIAL of a VAR_DECL here. + (tsubst): Not here. + + * decl.c (init_decl_processing): With -ansi, __null's type is the + signed integral type with the same number of bits as a pointer. + Introduce a new variable null_node for it. + * cp-tree.h: Adjust. + * call.c (null_ptr_cst_p): Adjust. + +Thu Aug 15 17:09:54 1996 Mike Stump + + * except.c (do_unwind): Mark %i7 as used on the SPARC so we can + optimize. + +Thu Aug 15 01:36:49 1996 Jason Merrill + + * decl2.c (import_export_decl): Ignore #pragma interface for tinfo + fns of classes without virtual functions. + + * call.c (add_function_candidate): Handle `this' specially. + (compare_ics): Likewise. + +Tue Aug 13 12:16:10 1996 Jason Merrill + + * typeck.c (build_conditional_expr): Fix handling of __null. + + * decl2.c (comdat_linkage): New fn. + (import_export_vtable): Use it. + (import_export_decl): Use it. + * method.c (make_thunk): Use it. + +Mon Aug 12 00:09:18 1996 Jason Merrill + + * pt.c (end_template_decl): If we don't actually have parms, return. + * parse.y (template_header): Accept 'template <>'. + + * errfn.c: Allow 5 args. + +Sun Aug 11 15:20:58 1996 Jason Merrill + + * tree.c (make_temp_vec): New fn. + * pt.c (push_template_decl): Handle partial specs. + (instantiate_class_template): Likewise. + (more_specialized): Use get_bindings. + (more_specialized_class): New fn. + (get_class_bindings): New fn. + (most_specialized_class): New fn. + (do_function_instantiation): List candidates for ambiguous case. + * decl.c (duplicate_decls): Lose reference to DECL_TEMPLATE_MEMBERS. + (shadow_tag): Call push_template_decl for partial specializations. + * parse.y: Likewise. + * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Replaces + DECL_TEMPLATE_MEMBERS. + * call.c (print_z_candidates): Reduce duplication. + +Fri Aug 9 14:36:08 1996 Jason Merrill + + * decl2.c (lang_decode_option): Allow -fansi-overloading. + +Thu Aug 8 17:04:18 1996 Jason Merrill + + * pt.c (get_bindings): New fn. + (most_specialized): Likewise. + (do_function_instantiation): Use them. + (add_maybe_template): New fn. + * cp-tree.h (DECL_MAYBE_TEMPLATE): New macro. + * call.c (build_new_op): Handle guiding decls. + (build_new_function_call): Likewise. + * decl2.c (finish_file): Likewise. + + * decl2.c (mark_used): Do synthesis here. + * call.c (build_method_call): Not here. + (build_over_call): Or here. + * typeck.c (build_function_call_real): Or here. + * tree.c (bot_manip): Call mark_used on functions used in default + args. + +Thu Aug 8 17:48:16 1996 Michael Meissner + + * decl2.c (import_export_vtable): Delete code that disabled vtable + heuristic on systems with ASM_OUTPUT_EXTERNAL. + +Wed Aug 7 12:44:11 1996 Jason Merrill + + * typeck.c (build_x_function_call): Handle static call context + better. + + * decl.c (finish_function): Set the DECL_CONTEXT of the result to + the function, not its outer block. + + * call.c (build_field_call): Pass fields on to build_opfncall + regardless of TYPE_OVERLOADS_CALL_EXPR. + (build_method_call): Pass on to build_new_method_call sooner. + + * typeck.c (build_ptrmemfunc): Just return what instantiate_type + gives us. + * class.c (instantiate_type): Don't put a POINTER_TYPE to + METHOD_TYPE on an expression. Also make a copy of rhs instead of + modifying it. + +Tue Aug 6 12:58:46 1996 Jason Merrill + + * call.c (compare_ics): Handle qual_conv after lvalue_conv. + (add_builtin_candidate): Don't take enums for ++. + (build_new_method_call): Handle non-aggregates and field calls. + Move new overloading code from... + * cvt.c: Here. + + * decl.c (grokparms): Don't check default args in templates. + +Mon Aug 5 17:17:06 1996 Jason Merrill + + * cvt.c (build_new_op): Fix args to build_unary_op. + (add_builtin_candidates): Don't call type_promotes_to on float. + + * decl.c (grokparms): Check the type of the default arg. + + * cvt.c (build_new_op): Pass non-overloaded cases on rather than + returning NULL_TREE. + + * typeck.c (build_x_binary_op): Avoid doing extra work. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + * cvt.c (build_over_call): Return. + (add_builtin_candidate): Fix MEMBER_REF. + (build_new_op): Likewise. + +Mon Aug 5 17:07:47 1996 Mike Stump + + * method.c (build_overload_name): Put bug fix into code but leave + disabled for now so we can be bug compatible with older releases + that do repeats incorrectly. In the future, we can enable it. + +Mon Aug 5 13:46:28 1996 Jason Merrill + + * cvt.c (convert_like): Don't call build_cplus_new twice. + + * call.c, cp-tree.h, cvt.c, decl2.c, init.c, method.c, pt.c, typeck.c: + Control new overloading code with -fansi-overloading. + +Sun Aug 4 15:29:11 1996 Jason Merrill + + * cvt.c (build_over_call): Call build_cplus_new. + * call.c (build_method_call): Likewise. + * typeck.c (build_function_call_real): Likewise. + (build_conditional_expr): If both operands are TARGET_EXPRs, wrap + the COND_EXPR in a TARGET_EXPR so they use the same slot. + + * cvt.c (build_up_reference): Propagate INDIRECT_BIND to + recursive calls. + * typeck.c (complete_type): Propagate + TYPE_NEEDS_{CONSTRUCTING,DESTRUCTOR}. + +Sat Aug 3 14:05:07 1996 Jason Merrill + + * cvt.c (joust): More ?: kludging. Sigh. + (build_over_call): Don't try to synthesize global fns. + + * search.c (lookup_conversions): Use binfo marking. + +Sat Aug 3 12:33:42 1996 Bob Manson + + * search.c (build_mi_matrix): Use the correct value of cid + when determining the new mi_size. + +Sat Aug 3 01:27:41 1996 Jason Merrill + + * cvt.c (add_builtin_candidates): Do consider type conversion ops + for the first parms of += et al. + (strip_top_quals): New fn. + (reference_binding): Use it instead of TYPE_MAIN_VARIANT. + (implicit_conversion): Likewise. + (add_builtin_candidates): Be careful about arrays. + (build_new_method_call): Handle vtable optimization. + +Fri Aug 2 01:26:59 1996 Jason Merrill + + * cp-tree.h (LOOKUP_NO_TEMP_BIND): New flag. + * cvt.c (reference_binding): Use it. + (implicit_conversion): Use it. + (add_builtin_candidate, COND_EXPR): Use it. + + * cvt.c (build_new_function_call): Check for error args. + + * typeck.c (comptypes): Just check DERIVED_FROM_P, not UNIQUELY. + + * gxx.gperf: Add __null. + * hash.h: Regenerate. + * lex.h: Add RID_NULL. + * lex.c (init_lex): Create null_pointer_node here, stick it in + RID_NULL. + * decl.c (init_decl_processing): Still set its type here. + * cvt.c (cp_convert_to_pointer): Don't produce null_pointer_node. + (convert_to_pointer_force): Likewise. + (null_ptr_cst_p): Check for null_pointer_node; only accept (void*)0 + if (! pedantic). + * call.c (convert_harshness): Use null_ptr_cst_p. + * typeck.c (convert_for_assignment): Likewise. Don't produce + null_pointer_node. + + * error.c (args_as_string): Handle lists of actual args, too. + * cvt.c (null_ptr_cst): Support (void*)0 for now. + (build_user_type_conversion_1): Improve diagnostics. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_method_call): Likewise. Move call before def diagnostic... + (build_over_call): Here. + + * cvt.c (build_new_method_call): Don't complain about no match if + LOOKUP_SPECULATIVELY. + (build_over_call): Fix 'this' for virtual fn. + (build_new_method_call): Add diagnostic. + +Thu Aug 1 16:45:09 1996 Jason Merrill + + * cvt.c (add_function_candidate): Expect 'this' and 'in_chrg' for + constructors to be passed in. + (build_over_call): Likewise. + (build_user_type_conversion_1): Pass them in. + (convert_like): Likewise. + (build_object_call): Handle overloaded conversions. + (build_over_call): Pass the right args to build_vfn_ref. + (standard_conversion): Fix pmf convs. + (joust): Handle comparing statics and non-statics. + (build_new_method_call): New fn. + * call.c (build_method_call): Call it if NEW_OVER. + +Thu Aug 1 16:06:14 1996 Mike Stump + + * lex.c (do_identifier): Don't use %O on IDENTIFIER_OPNAME_Ps, use + %D instead. + +Thu Aug 1 15:24:02 1996 Mike Stump + + * except.c (expand_throw): Use maybe_build_cleanup_and_delete + instead of just maybe_build_cleanup so that we deallocate the + thrown object. + +Thu Aug 1 15:18:00 1996 Brendan Kehoe + + * decl2.c (finish_prevtable_vardecl): Make non-static for pt.c's use. + * cp-tree.h (finish_prevtable_vardecl): Add decl. + +Thu Aug 1 11:53:51 1996 Bob Manson + + * pt.c (instantiate_class_template): Call complete_type. Also, if + we're at the end of the file and we just instantiated a template + class with a vtable, call finish_prevtable_vardecl. + + * error.c (dump_decl): Don't explode (or explode more gracefully + as appropriate) if the object being dumped has a null type. + (dump_expr): Likewise. + + * search.c (build_mi_matrix): Ensure that mi_size is large enough, + by counting the number of nodes that we'll need before allocating + the array. + (lookup_fnfields): Fix comment. + (breadth_first_search): Fix comment. + +Wed Jul 31 09:57:05 1996 Jason Merrill + + * pt.c (instantiate_class_template): Propagate TYPE_PACKED and + TYPE_ALIGN. + * class.c (finish_struct): Call cplus_decl_attributes here. + (finish_struct_1): Not here. + * cp-tree.h: Adjust. + + * pt.c (type_unification): New parameter STRICT. + (unify): If STRICT, don't allow cv addition or base deduction. + * call.c, class.c, cvt.c, cp-tree.h: Adjust. + +Tue Jul 30 13:06:13 1996 Jason Merrill + + * search.c (get_template_base{_recursive}): New fns. + * pt.c (more_specialized): New fn. + (do_function_instantiation): Use it. + (unify): Handle base deduction. + * cvt.c (joust): Use more_specialized. + Don't arbitrarily choose between non-builtin candidates. + (build_over_call): Call require_complete_type. + + * decl.c (start_function): Statics are static even in a #pragma + interface file. + + * decl2.c (import_export_vtable): Disable vtable heuristic on + systems with ASM_OUTPUT_EXTERNAL. + + * cvt.c (compare_ics): Fix comparison of PMEM_CONV and BASE_CONV. + (standard_conversion): No std conv to enum type. + + * cvt.c (standard_conversion): Fix order of args to DERIVED_FROM_P + for ptm's. + + * cvt.c (reference_binding): Bind directly to a base subobject of + a class rvalue. + + * cvt.c (build_new_op): Enforce access control. + +Tue Jul 30 09:22:53 1996 Bob Manson + + * typeck2.c (process_init_constructor): When scanning the + union for a named field, skip things that aren't FIELD_DECLs. + + * method.c (synthesize_method): Don't scan fndecl's rtl if + we're at the end of the file; just assume the function can't + be inlined. + +Mon Jul 29 15:48:30 1996 Jason Merrill + + * cvt.c (build_builtin_candidate): Stick a dummy conversion in if + it failed. + + * cvt.c (build_user_type_conversion_1): Handle overloaded + conversion ops. + + * cvt.c (add_builtin_candidates): Don't consider type conversion + operators for the first parameter of operator=. + +Mon Jul 29 15:33:55 1996 Bob Manson + + * typeck.c (complete_type): Only call layout_type if we're not + expanding a template. + +Mon Jul 29 14:40:38 1996 Jason Merrill + + * cvt.c (compare_ics): Oops. + + * cvt.c (op_error): Oops. + + * cp-tree.def: Add RVALUE_CONV, rename EXACT_CONV to IDENTITY_CONV. + * cvt.c: Add IDENTITY_RANK before others. Use real_lvalue_p. + (build_conv): Use them. + (implicit_conversion): Use them. + (convert_like): Handle them. + (build_new_op): Handle builtin COND_EXPR again. + (add_builtin_candidates): Strip cv-quals. Fix oops. Include enums + in lists of types for COND_EXPR. + (add_builtin_candidate): Add enum candidates for COND_EXPR. + +Mon Jul 29 12:05:40 1996 Bob Manson + + * typeck.c (build_modify_expr): Always attempt to build a call to + the assignment operator, even if we're using a default one. + (convert_for_initialization): Call complete_type. + +Mon Jul 29 11:25:08 1996 Jason Merrill + + * cvt.c (reference_binding): A REF_BIND gets the reference type. + (implicit_conversion): Likewise. + (convert_like): Likewise. + (compare_ics): Likewise. + (compare_qual): Likewise. + (print_z_candidates): Handle no candidates. + (build_new_op): Don't handle builtin COND_EXPR for now. + +Sat Jul 27 11:27:47 1996 Stan Shebs + + * cvt.c (build_builtin_candidate): Init local var in an ANSI way. + +Fri Jul 26 01:07:22 1996 Jason Merrill + + * cvt.c (joust): If the candidates are the same, arbitrarily pick one. + + * cvt.c (build_builtin_candidate): Oops. + (build_new_op): Oops. + + * method.c (build_opfncall): Pass COND_EXPR on. + * cvt.c (build_builtin_candidate): Reorganize, support COND_EXPR. + (add_builtin_candidate{,s}): Likewise. + (add_builtin_candidates): Likewise. + (print_z_candidates, op_error, build_new_op): Likewise. + (type_decays_to): New fn. + * lex.c (init_lex): Just say ?: for COND_EXPR. + +Thu Jul 25 09:33:33 1996 Jason Merrill + + * typeck.c (complete_type): Call layout_type rather than building + a new array type. + + * cvt.c (add_builtin_candidate): Pointer arithmetic candidates + only use ptrdiff_t. + +Wed Jul 24 12:45:08 1996 Jason Merrill + + * cvt.c: Always compile the new overloading code (but don't use it). + (implicit_conversion): Add a BASE_CONV when converting to + the same class type. + (convert_like): Handle BASE_CONV. + +Tue Jul 23 12:46:30 1996 Jason Merrill + + * cvt.c (build_new_op): Support {MAX,MIN}_EXPR. + (add_builtin_candidate): Likewise. + + NEW_OVER changes: + * typeck.c (build_x_function_call): Try an operator function + whenever we call an object of class type. + * method.c (build_opfncall): Pass CALL_EXPRs through. + * cvt.c (implicit_conversion): Do const-ref case first. + (add_conv_candidate, build_object_call, op_error): New fns. + (ptr_complete_ob, TYPE_PTROB_P): void is not an object type. + ({add,build}_builtin_candidate{,s}, print_z_candidates): Display + builtin candidates. + (build_new_op): Handle CALL_EXPR. Don't try to decay void. + Fall back on preincrement handling. Use op_error. + Handle warn_synth. + (convert_like): Pass INDIRECT_BIND. Don't try to do anything with + an error_mark_node. + (build_over_call): Handle PROMOTE_PROTOTYPES and ellipsis promotions + properly. + +Mon Jul 22 16:21:55 1996 Bob Manson + + * pt.c (tsubst_expr): Handle CONTINUE_STMT. + +Mon Jul 22 15:38:58 1996 Mike Stump + + * typeck.c (build_component_ref_1): Use build_component_ref + instead of open coding it here. + +Mon Jul 22 12:18:54 1996 Jason Merrill + + * g++.c (main): Don't link with -lg++. + + NEW_OVER changes: + * cvt.c (convert_to_reference): Don't use convert_from_reference on + result of build_type_conversion. + (cp_convert): Only call build_method_call for ctors if + build_type_conversion failed. + (ptr_complete_ob): New function. + (TYPE_PTR{,OB,MEM}_P): New macros. + ({add,build}_builtin_candidate{,s}): New functions. + (print_z_candidates): Handle builtins. + (build_user_type_conversion_1): Don't use conversion fns for + converting to a base type. + (build_user_type_conversion_1): Set ICS_USER_FLAG on AMBIG_CONVs. + (build_user_type_conversion): Use convert_from_reference. + (build_new_op): New function. + (build_over_call): Fix handling of methods. + (compare_ics): Handle AMBIG_CONV properly. + * typeck2.c: Increment abort count. + * method.c (build_opfncall): Forward most requests to build_new_op. + * cp-tree.h (IS_OVERLOAD_TYPE): Tweak. + +Fri Jul 19 17:59:29 1996 Brendan Kehoe + + * error.c (dump_expr, case CONSTRUCTOR, case CAST_EXPR): Take out + invalid second argument to dump_expr_list. + +Fri Jul 19 14:04:05 1996 Mike Stump + + * decl.c (lookup_name_real): Make sure we do obj->X::i correctly. + +Thu Jul 18 14:48:23 1996 Bob Manson + + * decl2.c (import_export_vtable): ASM_OUTPUT_EXTERNAL, not + ASSEMBLE_EXTERNAL. + +Mon Jul 15 17:48:43 1996 Mike Stump + + * typeck2.c (process_init_constructor): New pedwarn for using { } + to initialize a pointer to member function. + * typeck.c (build_ptrmemfunc1): Avoid use of digest_init so that + we can avoid the new error. + +Mon Jul 15 15:42:03 1996 Mike Stump + + * typeck.c (build_ptrmemfunc1): New function to hide details of + pointer to member functions better. + +Mon Jul 15 14:23:02 1996 Mike Stump + + * init.c (resolve_offset_ref): Resolve OFFSET_REFs that are + methods into the actual method, as we know the implied object is + not used. + +Mon Jul 15 13:08:29 1996 Brendan Kehoe + + * parse.y (maybecomma_warn): Only emit the pedwarn if we're not + inside a system header. + +Fri Jul 12 16:30:05 1996 Bob Manson + + * call.c (build_method_call): Call complete_type on the + instance type. + +Thu Jul 11 17:16:40 1996 Mike Stump + + * typeck.c (build_component_ref): Always build up an OFFSET_REF + for obj_ptr->func so that we can know which object to use in a + method call. + +Wed Jul 10 19:36:37 1996 Mike Stump + + * typeck.c (build_ptrmemfunc): Remove sorry, now we can cast + around things. Also improve maintainability. + +Wed Jul 10 18:20:11 1996 Bob Manson + + * decl.c (grokdeclarator): Check for overflow when evaluating an + array dimension. + +Wed Jul 10 17:26:19 1996 Jason Merrill + + * cvt.c (cp_convert): Don't check for ambiguity with constructor + if NEW_OVER. + + * typeck.c (build_x_function_call): Pass function overload + questions to new overloading code if NEW_OVER. + * init.c (expand_aggr_init_1): Only check for type conversion ops + if we're doing copy-initialization (i.e. LOOKUP_ONLYCONVERTING). + Don't check for ambiguity with constructor if NEW_OVER. + * cvt.c (convert_to_reference): Dereference the result of a type + conversion operator. + (build_conv): Propagate ICS_USER_FLAG. + (implicit_conversion): Call instantiate_type. + Pass LOOKUP_ONLYCONVERTING instead of LOOKUP_NORMAL. + (add_function_candidate): Fix cv-quals on argtype. + (print_z_candidates): New function. + (build_new_function_call): Call it. + (build_user_type_conversion_1): If LOOKUP_ONLYCONVERTING, don't + consider non-converting constructors. + Call print_z_candidates. + Return an AMBIG_CONV for an ambiguous conversion. + (build_user_type_conversion): Handle AMBIG_CONV. + (convert_like): Fix test for building TARGET_EXPR. + Call instantiate_type. + Handle AMBIG_CONV and LVALUE_CONV. + (build_over_call): Handle 0 args and ellipsis. + * cp-tree.def: Add AMBIG_CONV. + +Tue Jul 9 17:48:48 1996 Mike Stump + + * decl.c (lookup_name_real): If we find mem in obj when parsing + `obj->mem', make sure we return the right value. + +Tue Jul 9 16:11:28 1996 Bob Manson + + * search.c (get_base_distance): Call complete_type. + +Tue Jul 9 12:46:34 1996 Mike Stump + + * decl.c (store_bindings): Make static. + +Mon Jul 8 16:42:31 1996 Jason Merrill + + * init.c (expand_aggr_init_1): Don't check type conversions if + NEW_OVER. + + * cvt.c (z_candidate): Put back template field. + (add_function_candidate): Set it. + (add_template_candidate): Likewise. + (joust): Use it. + (compare_qual): Handle references and pointers to members. + (compare_ics): Handle reference bindings. + + * decl.c (duplicate_decls): Propagate DECL_ONE_ONLY. + +Mon Jul 8 16:18:56 1996 Bob Manson + + * call.c (compute_conversion_costs): Call complete_type. + + * tree.c (vec_binfo_member): Use comptypes instead of comparing + pointers, so we can handle template parameters. + +Fri Jul 5 16:51:53 1996 Bob Manson + + * cvt.c (cp_convert_to_pointer): We have to call complete_type + here; let's make it explicit instead of a side effect of an + error check. + +Wed Jul 3 16:29:51 1996 Jason Merrill + + * cvt.c (z_candidate): Remove template field. + (reference_binding): Handle binding to temporary. + (implicit_conversion): Likewise. + (add_function_candidate): Handle artificial constructor parms. + Handle functions with too few parms. + (add_template_candidate): New function. + (build_user_type_conversion_1): Handle constructors. + (convert_like): Likewise. + (build_over_call): Likewise. + (build_new_function_call): Support templates. + (compare_ics): Fix reference, inheritance handling. + +Mon Jul 1 22:58:18 1996 Bob Manson + + * decl.c: Add signed_size_zero_node. + (init_decl_processing): Build it. + * class.c (prepare_fresh_vtable): Use it instead of size_zero_node + when we're trying to make a negative delta. + +Mon Jul 1 17:56:19 1996 Brendan Kehoe + + Stop doing this damn index==strchr variable name confusion. + * class.c (add_virtual_function): Change local var INDEX to be + named IDX. + (add_method): Likewise. + * lex.c (print_parse_statistics): Likewise. + * search.c (make_memoized_table_entry): Likewise. + (lookup_fnfields_here): Likewise. + (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (get_baselinks): Likewise. + * sig.c (build_signature_table_constructor): Likewise. + (build_signature_method_call): Likewise. + * typeck.c (build_x_array_ref): Change INDEX parm to be named IDX. + (get_member_function_from_ptrfunc): Likewise. + (build_ptrmemfunc): Change local var INDEX to be IDX. + (c_expand_start_case): Likewise. + +Sat Jun 29 14:05:46 1996 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Move user-defined type conversion + handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE. + (convert_to_reference): Use build_type_conversion to convert to + the reference type directly. + (standard_conversion): Fix void* case, non-conversions. + (reference_binding): Fix expr == 0 case, non-conversions. + (convert_like): Support REF_BIND. + (compare_qual): Split out from compare_ics. + (compare_ics): Use it, handle icses with only a qual_conv. + + * init.c (expand_vec_init): Don't crash if decl is NULL. + +Fri Jun 28 11:52:51 1996 Stan Shebs + + * mpw-config.in: New file, configury for Mac MPW. + * mpw-make.sed: New file, makefile editing for MPW. + +Thu Jun 27 15:18:30 1996 Jason Merrill + + * pt.c (instantiate_class_template): Call repo_template_used. + + * search.c (lookup_conversions): Only lookup conversions in + complete types. + +Thu Jun 27 12:59:53 1996 Brendan Kehoe + + * cp-tree.def: Renamed from tree.def, to avoid confusion with + gcc's tree.def. + * cp-tree.h, lex.c: Include cp-tree.def. + * Makefile.in (CXX_TREE_H): Reference cp-tree.def. + +Wed Jun 26 18:29:47 1996 Bob Manson + + * init.c (build_vec_delete_1): Call complete_type. + +Mon Jun 24 17:17:32 1996 Mike Stump + + * except.c (start_anon_func): Make sure anonymous functions are + never external. + +Fri Jun 21 15:10:58 1996 Jason Merrill + + * decl.c (finish_function): If function_depth > 1, set nested. + + * decl2.c (grokbitfield): Revert Bob's change. + * class.c (finish_struct_1): Fix handling of named bitfield widths. + +Thu Jun 20 23:35:38 1996 Jason Merrill + + * pt.c (add_pending_template): Handle types. + (lookup_template_class): With -fexternal-templates, just add the class + to pending_templates instead of instantiating it now. + * decl2.c (finish_file): Handle types in pending_templates. + +Thu Jun 20 14:08:40 1996 Bob Manson + + * decl2.c (grokbitfield): Handle constant decls appropriately. + Give an appropriate error message now instead of spewing core + later. + +Thu Jun 20 13:01:51 1996 Jason Merrill + + * decl2.c: Don't turn on thunks by default for now. + +Wed Jun 19 11:37:04 1996 Jason Merrill + + * typeck.c (complete_type): Handle error_mark_node. + (common_type, OFFSET_TYPE): Handle template_type_parms. + +Tue Jun 18 10:02:15 1996 Jason Merrill + + * pt.c (instantiate_decl): If at_eof, call import_export_decl + regardless of DECL_INLINE. + + * typeck.c (mark_addressable): Set TREE_ADDRESSABLE on CONSTRUCTORs. + + * class.c (finish_struct_bits): Copy TYPE_SIZE. + + * rtti.c (build_dynamic_cast): Support templates. + * tree.def: Support DYNAMIC_CAST_EXPR. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + +Mon Jun 17 15:23:36 1996 Jason Merrill + + * typeck.c (build_static_cast): Support templates. + (build_const_cast): Likewise. + * tree.def: Support CONST/STATIC_CAST_EXPR. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + +Sun Jun 16 12:33:57 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Don't trust + TREE_SYMBOL_REFERENCED for vtables of local classes. + +Fri Jun 14 18:13:36 1996 Jason Merrill + + * pt.c (tsubst_copy): Handle operator T. + +Wed Jun 12 17:52:40 1996 Brendan Kehoe + + * init.c (build_delete): Move creation of PARMS inside test of + TYPE_HAS_DESTRUCTOR, since it's never used outside of that block. + +Tue Jun 11 15:09:18 1996 Bob Manson + + * typeck.c (build_conditional_expr): Don't assume that + the arguments to ?: are always pointers or records. + +Tue Jun 11 13:56:23 1996 Jason Merrill + + * decl2.c (import_export_decl): Still emit static/weak/comdat + copies of inline template functions with -fno-implicit-templates. + +Tue Jun 11 11:42:13 1996 Bob Manson + + * init.c (build_delete): Determine the complete basetype + path to the destructor we're calling. + +Fri Jun 7 15:30:10 1996 Bob Manson + + * decl.c (build_enumerator): Always copy the INTEGER_CST used to + initialize the enum, because we really and truly don't know where + it came from. + (start_enum): Don't copy integer_zero_node because + build_enumerator will do it. + +Fri Jun 7 11:11:09 1996 Jason Merrill + + * decl.c (finish_function): Do access control on base destructors. + + * pt.c (tsubst, case FUNCTION_DECL): Set up + IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't + hose us. + +Fri Jun 7 10:37:33 1996 Mike Stump + + * cvt.c (build_up_reference): If we have already extended the + lifetime of the temporary, don't try it again. + * typeck.c (c_expand_return): Don't try and convert the return + value twice when we want a reference, once is enough. + +Tue Jun 4 15:41:45 1996 Jason Merrill + + * pt.c (tsubst_expr, case DECL_STMT): Don't pass + LOOKUP_ONLYCONVERTING at all for now. + + * search.c (add_conversions): Put the conversion function in + TREE_VALUE, the basetype in TREE_PURPOSE. + * cvt.c (build_type_conversion): Adjust. + * cvt.c (build_expr_type_conversion): Adjust. + * call.c (user_harshness): Adjust. + +Mon Jun 3 15:30:52 1996 Jason Merrill + + * method.c (emit_thunk): Pretend this is a FUNCTION_DECL for the + backend's benefit. + +Mon Jun 10 18:58:19 1996 Mike Stump + + * except.c (expand_start_catch_block): Add a dummy region, if we + get an error, so that we can avoid core dumping later. + +Fri May 31 14:56:13 1996 Mike Stump + + * cp-tree.h (OFFSET_REF): Remove. + * tree.def (CP_OFFSET_REF): Rename to OFFSET_REF. + * expr.c (cplus_expand_expr): Cleanup callers of expand_expr. + * init.c (expand_aggr_init_1): Likewise. + (build_new): Likewise. + * typeck.c (expand_target_expr): Likewise. + +Fri May 31 14:22:08 1996 Jason Merrill + + * typeck.c (build_modify_expr): Don't use TREE_VALUE on a + TARGET_EXPR. + +Wed May 29 17:04:33 1996 Mike Stump + + * cvt.c (build_up_reference): Redo how and when temporaries are + created. + * decl.c (grok_reference_init): Don't try and be smart about + running cleanups. + +Wed May 29 16:02:08 1996 Mike Stump + + * cvt.c (build_up_reference): Add NULL_TREE to all calls to build + (TARGET_EXPR...), now that it has 4 arguments. + * tree.c (build_cplus_new): Likewise. + +Thu May 23 16:40:30 1996 Jason Merrill + + * error.c (dump_expr, case CAST_EXPR): Handle T() properly. + + * pt.c (instantiate_decl): Don't call push/pop_cp_function_context. + * decl.c (struct saved_scope): Remove named_labels, + {base,member}_init_list. + (maybe_push_to_top_level): Don't set them. Call + push_cp_function_context if appropriate. + (pop_from_top_level): Likewise. + + * method.c (do_build_assign_ref): Remove obsolete check of + TYPE_HAS_ASSIGN_REF (basetype). + + * decl.c (grokfndecl): Diagnose user definition of + implicitly-declared methods. + +Thu May 23 12:13:08 1996 Bob Manson + + * method.c (do_build_copy_constructor): Add code to give + meaningful error messages instead of crashing. + (do_build_assign_ref): Don't synthesize assignment operators for + classes containing reference or const members. + + * class.c (struct base_info): Remove cant_synth_copy_ctor + and cant_synth_asn_ref. + (finish_base_struct): Remove the code that tries to conditionalize + synthesis of copy constructors & assignment operators based on + access permissions. Instead, let it fail when it tries to + synthesize the copy constructor. This will give meaningful error + messages instead of silently generating code to perform a bitcopy. + +Wed May 22 11:45:19 1996 Bob Manson + + * lex.c (real_yylex): Remove old-n-crufty #if 0 code for + determining types for constant values. + + * decl.c (struct named_label_list): Use instead of stuffing + random items into a TREE_LIST node. + (named_label_uses): Use the new struct. + (poplevel): Likewise. + (lookup_label): Likewise. + (define_label): Add an error message to tell the user the line + where the goto is located in addition to the destination of the + goto. + (init_decl_processing): Use NULL instead of NULL_TREE to initialize + named_label_uses. + (finish_function): Likewise. + + (start_decl): Complain about defining a static data member + in a different type from which it was declared. + +Wed May 22 09:33:23 1996 Jason Merrill + + * cvt.c (build_expr_type_conversion): Adjust. + +Tue May 21 11:21:56 1996 Jason Merrill + + * call.c (build_method_call): Always convert 'this' to the + appropriate type. + + * search.c (add_conversions): Put the conversion function in + TREE_VALUE, the type in TREE_PURPOSE. + * cvt.c (build_type_conversion): Adjust. + * call.c (user_harshness): Adjust. + + * method.c (emit_thunk): Call temporary_allocation and + permanent_allocation around the ASM_OUTPUT_MI_THUNK case, too. + + * tree.c (build_cplus_array_type): Handle tweaking of + TYPE_MAIN_VARIANT here. + * typeck.c (common_type): Not here. + + * typeck.c (complete_type): Only try to complete an array type if + it has a domain. + +Mon May 20 14:55:59 1996 Jason Merrill + + * decl.c (grokvardecl): Call complete_type. + (grokdeclarator): Call complete_type for PARM_DECLs. + +Fri May 17 16:41:17 1996 Jason Merrill + + * pt.c (instantiate_class_template): Re-set + CLASSTYPE_GOT_SEMICOLON after calling finish_struct_1. + +Fri May 17 14:56:55 1996 Mike Stump + + * cp-tree.h (cp_expand_decl_cleanup): Remove, the backend is now + smart enough to do it right. + * tree.c (cp_expand_decl_cleanup): Likewise. + * decl.c (cp_finish_decl): Use expand_decl_cleanup instead of + cp_expand_decl_cleanup. + (store_parm_decls): Likewise. + (hack_incomplete_structures): Likewise. + * except.c (push_eh_cleanup): Likewise. + +Fri May 17 13:13:51 1996 Mike Stump + + * expr.c (expand_expr, cond UNSAVE_EXPR): Move from the C++ + frontend to the backend where it belongs. + * tree.c (unsave_expr): Likewise. + (unsave_expr_now): Likewise. + * tree.def (UNSAVE_EXPR): Likewise. + * cp-tree.h (unsave_expr): Likewise. + (unsave_expr_now): Likewise. + +Fri May 17 11:02:41 1996 Mike Stump + + * init.c (emit_base_init): Make sure the partial EH cleanups live + on the function_obstack. + +Thu May 16 15:29:33 1996 Bob Manson + + * expr.c (do_case): Don't try to dereference null TREE_TYPEs + when checking for pointer types. + +Thu May 16 13:38:58 1996 Jason Merrill + + * pt.c (instantiate_class_template): Remove obsolete check for + access declarations. + +Thu May 16 13:34:15 1996 Mike Stump + + * call.c (build_overload_call): Simplify calls to + build_overload_call by removing last parameter. + (build_method_call): Likewise. + * cp-tree.h: Likewise. + * method.c (build_opfncall): Likewise. + * typeck.c (build_x_function_call): Likewise. + +Thu May 16 13:15:43 1996 Mike Stump + + * call.c (default_parm_conversions): Factor out common code. + (build_method_call): Use it. + (build_overload_call_real): Use it. + +Wed May 15 14:46:14 1996 Mike Stump + + * call.c (build_method_call): Allow implicit & on METHOD_TYPEs, + but pedwarn as the code is bogus. + * typeck.c (decay_conversion): Likewise. + (build_function_call_real): Use build_addr_func instead of + default_conversion. Don't allow pointer-to-method functions down + here. + (build_unary_op): Use real pointer-to-member functions instead of + fake ones. + (build_ptrmemfunc): Use build_addr_func instead of build_unary_op. + (convert_for_assignment): Removed some obsolete code. + * decl2.c (reparse_absdcl_as_expr): Pass current_class_ref to + build_x_function_call instead of current_class_ptr. Only call + digest_init once on an initializer, we do this just checking + TREE_TYPE. + (build_expr_from_tree): Pass current_class_ref to + build_x_function_call instead of current_class_ptr. + * init.c (build_member_call): Likewise. + * pase.y: Likewise. + * error.c (dump_expr): Handle OFFSET_REFs better. + * pt.c (unify): Handle pointer-to-member functions better. + * decl.c (finish_function): Clear out current_class_ref just like + we do for current_class_ptr. + + * typeck.c (get_delta_difference): Handle virtual bases better. + +Tue May 14 16:37:37 1996 Jason Merrill + + * sig.c (build_signature_table_constructor): Use the delta for + the original basetype for this virtual function with thunks. + (build_signature_method_call): We still need to adjust 'this' + with thunks. + +Tue May 14 16:27:25 1996 Mike Stump + + * call.c (build_addr_func): New routine. Used to get the `real' + address of a function or a method. Needed to avoid getting a + pointer-to-member function. + (build_call): New routine to build CALL_EXPRs. + (build_method_call): Use it. + * cvt.c (convert_to_aggr): Likewise. + * typeck.c (build_function_call_real): Likewise. + * sig.c (build_signature_table_constructor): Use build_addr_func. + * cp-tree.h (build_call, build_addr_func): Declare them. + +Tue May 14 12:47:47 1996 Mike Stump + + * cp-tree.h (LOOKUP_AGGR): Remove, unused. + * parse.y: Remove uses of LOOKUP_AGGR. + +Tue May 14 12:07:51 1996 Mike Stump + + * *.[chy]: Rename current_class_decl to current_class_ptr, and + C_C_D to current_class_ref. + +Mon May 13 16:55:23 1996 Jason Merrill + + * call.c (convert_harshness): Tighten up pointer conversions. + +Sat May 11 04:33:50 1996 Doug Evans + + * decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef. + (finish_file): Likewise. + +Fri May 10 11:09:57 1996 Jason Merrill + + * cvt.c (convert_fn_ptr): We don't use thunks for pmfs. + + * method.c (emit_thunk): Set flag_omit_frame_pointer in default + code. + +Thu May 9 18:18:30 1996 Jason Merrill + + * decl2.c: Turn on thunks by default where supported. + +Tue May 7 20:39:57 1996 Mike Stump + + * cp-tree.h (build_overload_call_maybe): Removed. + * call.c (build_overload_call_real): Invert meaning of last arg to + be require_complete. + (build_overload_call): Likewise. + * typeck.c (build_x_function_call): Use build_overload_call_real + instead of build_overload_call_maybe. + +Mon May 6 01:23:32 1996 Jason Merrill + + * decl2.c (finish_file): Don't try to emit functions that haven't + been compiled. + +Fri May 3 09:30:13 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Oops. + + * decl.c (maybe_push_to_top_level): Do save previous_class_*. + Also store the bindings from previous_class_values. + (pop_from_top_level): Restore them. + +Thu May 2 21:56:49 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Only write out vtable if its + symbol has been referenced. + (finish_file): Re-join synthesis/vtable loop with inline emission + loop, disable inlining when an inline is output. + +Thu May 2 17:20:02 1996 Mike Stump + + * except.c (init_exception_processing): Setup saved_in_catch. + (push_eh_cleanup): Reset __eh_in_catch. + (expand_start_catch_block): Set __eh_in_catch. + +Thu May 2 16:21:17 1996 Mike Stump + + * except.c (push_eh_cleanup): Add tracking for whether or not we + have an active exception object. + (expand_builtin_throw): Use it to make sure a rethrow without an + exception object is caught. + +Thu May 2 11:26:41 1996 Jason Merrill + + * decl.c (maybe_push_to_top_level): Clear out class-level bindings + cache. + +Wed May 1 11:26:52 1996 Jason Merrill + + * decl2.c (finish_file): Also use sentries for vars with + DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be + created). + + * lex.c (handle_cp_pragma): Disable #pragma + interface/implementation if SUPPORTS_ONE_ONLY > 1. + +Tue Apr 30 11:25:46 1996 Jason Merrill + + * method.c (emit_thunk): Wrap default case in + temporary/permanent_allocation. + + * method.c (make_thunk): Use DECL_ONE_ONLY. + (emit_thunk): Call assemble_end_function. + +Mon Apr 29 15:38:29 1996 Jason Merrill + + * decl2.c (import_export_vtable): Use DECL_ONE_ONLY. + (import_export_decl): Likewise. + (finish_prevtable_vardecl): Disable vtable hack if + SUPPORTS_ONE_ONLY > 1. + +Mon Apr 29 14:32:47 1996 Mike Stump + + * typeck.c (build_modify_expr): PREINCREMENT_EXPR and + PREDECREMENT_EXPRs take two arguments, not one. + +Mon Apr 29 00:27:53 1996 Jason Merrill + + * class.c (build_vtable_entry): Don't build thunks for abstract + virtuals. + + * lex.c (real_yylex): Fix handling of __PRETTY_FUNCTION__ like C + frontend. + +Sat Apr 27 16:45:35 1996 Jason Merrill + + * class.c (set_rtti_entry): Use size_zero_node. + (build_vtable): Likewise. + +Sat Apr 27 14:48:57 1996 Jason Merrill + + * class.c (finish_struct_1): Pass size_zero_node to set_rtti_entry. + (prepare_fresh_vtable): Likewise. + +Fri Apr 26 13:14:14 1996 Jason Merrill + + * method.c (emit_thunk): Call mark_used on the target function. + + * call.c (build_method_call): Don't warn about pending templates. + +Thu Apr 25 14:55:44 1996 Jason Merrill + + * decl2.c (finish_file): Fix list walking logic. + + * typeck2.c (check_for_new_type): Only warn if -pedantic. + +Wed Apr 24 15:41:15 1996 Bob Manson + + * class.c (finish_struct_1): Remove old code for + dont_allow_type_definitions. + * cp-tree.h: Likewise. + * spew.c: Make sure cp-tree.h is included before parse.h, so the + definition of flagged_type_tree is found before it is used. + * lex.c: Likewise. + * parse.y: Added the ftype member to the type union, and changed a + number of rules to use it instead of ttype. Added calls to + check_for_new_type() as appropriate. + * typeck2.c (check_for_new_type): New function for checking + if a newly defined type appears in the specified tree. + * cp-tree.h: Add new type flagged_type_tree. Add a prototype + for check_for_new_type(). + +Wed Apr 24 00:36:21 1996 Jason Merrill + + * decl2.c (finish_file): Only use a sentry if the decl is public. + + * pt.c (tsubst_expr, DECL_STMT): If we don't have an initializer, + don't pass LOOKUP_ONLYCONVERTING. + +Tue Apr 23 17:18:47 1996 Bob Manson + + * typeck.c (common_type): Fix the ARRAY_TYPE case so it + properly keeps track of const and volatile type modifiers. + +Tue Apr 23 10:52:56 1996 Jason Merrill + + * tree.c (cp_tree_equal): C++ version of simple_cst_equal. + * pt.c (comp_template_args): Use it. + + * rtti.c (get_tinfo_fn, build_dynamic_cast, expand_*_desc): Call + assemble_external for artificial function decls. + + * decl.c (cp_finish_decl): Oops. + +Mon Apr 22 17:28:27 1996 Jason Merrill + + * decl2.c (import_export_decl): Put static data member templates + into common storage, or make them weak, depending on whether they + are dynamically or statically initialized. + (get_sentry): New function. + (finish_file): Do import_export_decl for static data members before + building the init/fini functions. Don't init/fini a variable that's + EXTERNAL. Use a sentry for variables in common. Fix mismatching + push/pop_temp_slots. + * decl.c (cp_finish_decl): If DECL_NOT_REALLY_EXTERN, do the + expand_static_init thang. + * method.c (get_id_2): New function. + +Mon Apr 22 15:32:45 1996 Bob Manson + + * parse.y (empty_parms): Make sure we use C++-style prototypes + when we're declaring member functions. + +Sun Apr 21 10:08:22 1996 Jason Merrill + + * Makefile.in (CONFLICTS): 16 s/r conflicts. + * parse.y (self_template_type): New nonterminal. + +Thu Apr 18 08:56:54 1996 Jason Merrill + + * decl.c (make_typename_type): Handle getting a TYPE_DECL for a + name. + * parse.y (base_class.1): Allow 'typename foo::bar'. + + * lex.c (check_newline): Remove #pragma code that plays with the + input stream, since we now deal with tokens. Clear nextchar when + we're done. + (handle_cp_pragma): Use real_yylex. + (handle_sysv_pragma): Don't do skipline here. Only call real_yylex + in one place. + + * lex.c (check_for_missing_semicolon): Handle SELFNAME. + + * lex.c (handle_cp_pragma): Fix "#pragma implementation". + +Wed Apr 17 16:51:33 1996 Jason Merrill + + * parse.y: New token SELFNAME for potential constructor. + * spew.c (yylex): Handle it. + * lex.c (identifier_type): Produce it. + + * parse.y (complete_type_name): In :: case, don't push class binding. + (complex_type_name): Likewise. + +Wed Apr 17 15:02:40 1996 Mike Stump + + * typeck.c (build_reinterpret_cast): Handle pointer to member + functions. + +Wed Apr 17 12:28:26 1996 Brendan Kehoe + + * lex.c (handle_cp_pragma): New function, with decl, doing the cc1plus + pragmas. + (check_newline): Put the vtable/unit/implementation/interface pragma + code into handle_cp_pragma, replacing it with a call. + (handle_sysv_pragma): Give int return type, and take FINPUT and TOKEN + args. Get the next token after handling the pragma token. + +Wed Apr 17 10:28:34 1996 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Avoid doing base analysis on pmfs. + (convert_to_pointer_force): Likewise. + + * init.c (build_new): Fix array new without -fcheck-new. + +Tue Apr 16 13:44:58 1996 Jason Merrill + + * cp-tree.h, call.c, class.c, decl.c, parse.y, pt.c, rtti.c, + tree.c: Lose TYPE_NESTED_NAME. + + * parse.y (nested_name_specifier_1): Don't treat non-identifiers + as identifiers. + + * tree.def: Add VEC_INIT_EXPR. + * expr.c (cplus_expand_expr): Handle it. + * init.c (build_new): Use it instead of the RTL_EXPR nastiness and + the extra file-scope symbol nastiness. + +Mon Apr 15 16:21:29 1996 Jason Merrill + + * method.c (make_thunk): Thunks are static. + (emit_thunk): Use ASM_OUTPUT_MI_THUNK if it's defined. + + * decl2.c (mark_vtable_entries): Emit thunks as needed. + (finish_file): Don't emit them here. + +Sun Apr 14 11:34:39 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle null pointers. + (ifnonnull): New function. + +Fri Apr 12 09:08:27 1996 Bob Manson + + * call.c (build_method_call): Remember the original basetype we + were called with. Give an error message instead of trying + (incorrectly) to call a non-static member function through a + non-inherited class. + + * search.c (expand_upcast_fixups): Mark the new fixup as + DECL_ARTIFICIAL. + +Thu Apr 11 03:57:09 1996 Jason Merrill + + * init.c (build_new): Use a TARGET_EXPR for alloc_expr. + + * class.c (set_rtti_entry): Fix for thunks. + + * decl2.c (import_export_decl): Still emit typeinfo fns for + cv-variants of builtin types. + + * rtti.c (expand_class_desc): Set up base_info_type_node here. + (init_rtti_processing): Instead of here. + +Wed Apr 10 14:17:13 1996 Jason Merrill + + * rtti.c (init_rtti_processing): Do init regardless of -frtti. + (build_typeid): Only complain about taking dynamic typeid without + -frtti. + + * decl2.c: flag_rtti defaults to 1. + + * rtti.c (get_tinfo_var): The general class case is now smaller. + (init_rtti_processing): Pack the latter three fields of base_info + into 32 bits. + +Wed Apr 10 13:50:14 1996 Mike Stump + + * init.c (expand_member_init): Don't dump if name is NULL_TREE. + +Wed Apr 10 12:56:02 1996 Mike Stump + + * search.c (make_memoized_table_entry): Undefer the pop, if necessary. + (push_memoized_context): Split out code to undefer pop_type_level to + (clear_memoized_cache): here. + (pop_memoized_context): We can only handle one layer of deferral of + pop_type_level so clear the cache, if there was a previous level. + +Tue Apr 9 23:06:09 1996 Jason Merrill + + * rtti.c (init_rtti_processing): Build up base_info_type_node. + (expand_class_desc): Use one pointer to an array of base_info + structs, passed using a CONSTRUCTOR. + +Tue Apr 9 14:20:57 1996 Mike Stump + + * class.c (build_vbase_path): Remove block extern for + flag_assume_nonnull_objects here. + (build_vfn_ref): Split out functionality into build_vtbl_ref. + (build_vtbl_ref): New routine. + (build_vtable): Set up rtti info here. + (add_virtual_function): Note in CLASSTYPE_RTTI the best + place where we can get the rtti pointers from to avoid having to + search around for a place. + (finish_base_struct): Likewise. + (finish_struct_1): Likewise. Never create totally new vtables + with totally new vtable pointers for rtti. Disable code to layout + vtable pointers better until we want to break binary + compatibility. + * rtti.c (build_headof_sub): New routine to convert down to a + sub-object that has an rtti pointer in the vtable. + (build_headof): Use it. Also, use build_vtbl_ref now to be more + maintainable. + (build_dynamic_cast): Make sure we have saved it, if we need to. + * search.c (dfs_init_vbase_pointers): Disable code that deals with + a more efficient vtable layout, enable later. + * call.c (flag_assume_nonnull_objects): Moved declaration to + * cp-tree.h: here. Declare build_vtbl_ref. + * pt.c (instantiate_class_template): Use NULL_TREE instead of 0 in + function calls that want a tree. + +Tue Apr 9 12:10:26 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle downcasting to X* given + other X subobjects in the most derived type. Ack. + + * rtti.c (build_dynamic_cast): No need to strip cv-quals here, + get_typeid will do it for us. + (get_typeid_1): Break out call-building for expand_*_desc to use. + (get_typeid): Call it. + (expand_*_desc): Likewise. + * decl.c (init_decl_processing): Don't set TYPE_BUILT_IN on char * + and void *. + (init_decl_processing): Lose builtin_type_tdescs lossage. + * decl2.c (finish_vtable_vardecl): Remove obsolete code. + +Mon Apr 8 17:23:23 1996 Bob Manson + + * pt.c (tsubst): When calling set_nested_typename, use + TYPE_NESTED_NAME (current_class_type) instead of + current_class_name. + + * decl.c (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (grokdeclarator): Use NULL_TREE instead of 0 in the call to + set_nested_typename. + +Sun Apr 7 10:44:31 1996 Jason Merrill + + * rtti.c (synthesize_tinfo_fn): Handle arrays. + + * cp-tree.h (DECL_REALLY_EXTERN): New macro. + +Sat Apr 6 13:56:27 1996 Jason Merrill + + * rtti.c (throw_bad_cast): Use entry point __throw_bad_cast. + (init_rtti_processing): Lose bad_cast_type. + (build_dynamic_cast): Use throw_bad_cast. + + * rtti.c (synthesize_tinfo_fn): Handle enums and pmfs. + + * decl2.c (finish_file): Don't synthesize artificial functions + that are external and not inline. + + * rtti.c (get_tinfo_fn): If at_eof, call import_export_decl. + + * decl2.c (finish_file): Handle having new inlines added to + saved_inlines by synthesis. + + * rtti.c (get_bad_cast_node): Don't require . + +Fri Apr 5 17:02:09 1996 Jason Merrill + + RTTI rewrite to initialize nodes as needed, not require that + users #include , complete functionality and reduce wasted + space. + * rtti.c (init_rtti_processing): New fn. + (build_typeid): The vtable entry is now a function. + (get_tinfo_var): New fn. + (get_tinfo_fn): Likewise. + (get_typeid): Use it. + (build_dynamic_cast): Declare and use entry point __dynamic_cast. + (build_*_desc): Rename to expand_*_desc and rewrite to use entry + points __rtti_*. + (add_uninstantiated_desc, get_def_to_follow, build_t_desc): Lose. + (synthesize_tinfo_fn): New fn. + * method.c (build_t_desc_overload): Lose. + (build_overload_with_type): More generic. + * decl.c (init_decl_processing): Call init_rtti_processing. + * class.c (set_rtti_entry): Use get_tinfo_fn. + * decl2.c (mark_vtable_entries): Mark the rtti function. + (finish_prevtable_vardecl): Don't build_t_desc. + (import_export_decl): Handle tinfo functions. + (finish_file): Likewise. + * typeck.c (inline_conversion): New fn. + (build_function_call_real): Use it. + * cp-tree.h: Add decls. + + * method.c (hack_identifier): Also convert component_refs from + references. + + * lex.c (cons_up_default_function): Use the type, not the name, in + declspecs. + + * decl2.c (import_export_vtable): Fix weak vtables. + +Fri Apr 5 13:30:17 1996 Bob Manson + + * search.c (get_base_distance_recursive): Fix access checks for + protected bases. + +Fri Apr 5 11:02:06 1996 Brendan Kehoe + + * call.c (unary_complex_lvalue): Delete unneeded decl, it's in + cp-tree.h. + (convert_harshness): Add prototypes wrapped by PROTO. + * decl2.c (grok_function_init): Likewise. + (do_toplevel_using_decl): Change to void return type. + * class.c (build_vtable_entry): Remove decl of make_thunk. + (merge_overrides): Fix order of arg definitions. + (finish_vtbls): Likewise. + (fixup_vtable_deltas): Likewise. + (modify_all_direct_vtables): Likewise. + (modify_all_indirect_vtables): Likewise. + * search.c (get_base_distance_recursive): Likewise. + (get_abstract_virtuals_1): Likewise. + (fixup_virtual_upcast_offsets): Likewise. + (lookup_fnfields_1): Add prototypes wrapped by PROTO. + * init.c (perform_member_init): Fix order of arg definitions. + (expand_aggr_init_1): Add prototypes wrapped by PROTO. + * cp-tree.h (make_thunk): Add decl. + (overload_template_name, push_template_decl): Add decls. + (do_toplevel_using_decl): Change to void return type. + (vec_binfo_member): Add decl. + +Thu Apr 4 13:33:10 1996 Brendan Kehoe + + * typeck.c (mark_addressable, convert_for_assignment, + convert_for_initialization, pointer_int_sum, pointer_diff, + unary_complex_lvalue): Add prototypes wrapped by PROTO. + (convert_sequence): #if 0 fn decl, since definition also is. + +Thu Apr 4 11:00:53 1996 Mike Stump + + * rtti.c (build_dynamic_cast): Make sure we strip qualifiers on + cast to pointer types for type searching. + +Wed Apr 3 17:10:57 1996 Brendan Kehoe + + * typeck.c (get_delta_difference): Use cp_error, not error, in the + case where BINFO == 0. + +Wed Apr 3 12:01:02 1996 Mike Stump + + * call.c (build_method_call): Fix wording of error messages so + constructors come out right. + +Tue Apr 2 16:06:59 1996 Bob Manson + + * decl.c (push_overloaded_decl): Don't warn about hidden + constructors when both the type and the function are declared + in a system header file. + +Mon Apr 1 09:03:13 1996 Bob Manson + + * class.c (finish_struct_1): Propagate the TYPE_PACKED + flag for the type to the type's fields. + +Sat Mar 30 12:14:33 1996 Brendan Kehoe + + * parse.y (complex_parmlist, ELLIPSES): Take out ARM-based warning. + +Fri Mar 29 15:51:36 1996 Bob Manson + + * class.c (base_info, finish_base_struct): Replace + needs_virtual_dtor with base_has_virtual. + + (finish_struct_1): Remove the old code that tried to make default + destructors virtual. Use base_has_virtual when checking if we need + to add a vtable entry for the rtti code. + +Fri Mar 29 14:02:36 1996 Jason Merrill + + * pt.c (push_template_decl): Complain about template decl with + inappropriate declaration. + +Fri Mar 29 12:15:35 1996 Bob Manson + + * typeck.c (build_x_unary_op): Remove bogus check for taking + the address of a member function. + +Fri Mar 29 11:56:02 1996 Jason Merrill + + * parse.y (constructor_declarator): Only push the class if + we are not already in the class. + +Fri Mar 29 09:41:02 1996 Jeffrey A. Law + + * method.c (emit_thunk): Remove current_call_is_indirect nonsense. + Add additional argument to INIT_CUMULATIVE_ARGS. + +Thu Mar 28 16:41:39 1996 Jason Merrill + + * decl.c (shadow_tag): Fix error about anon union with methods. + + * parse.y (self_reference): Only generate a self-reference if this + is a non-template class. + (opt.component_decl_list): Only use it if it was generated. + + * parse.y (component_decl_1): Use constructor_declarator. + (fn.def2): Likewise. + (notype_component_declarator0): Likewise. + +Thu Mar 28 15:11:35 1996 Bob Manson + + * typeck.c (build_x_unary_op): Add checks for taking the address + of a TARGET_EXPR or of a member function, and give appropriate + warnings. + +Thu Mar 28 14:49:26 1996 Jason Merrill + + * pt.c (process_template_parm): Allow template type parms to be + used as types for template const parms. + +Wed Mar 27 15:51:19 1996 Mike Stump + + * init.c (expand_vec_init): Ensure the eh cleanups are on the + function_obstack. + +Wed Mar 27 10:14:30 1996 Jason Merrill + + * decl.c (lookup_name_real): Be even more picky about the + ambiguous lookup warning. + (grokdeclarator): Tweak SCOPE_REF constructor declarators here. + * parse.y (constructor_declarator): Rather than here. + + * parse.y (constructor_declarator): New nonterminal. + (fn.def1): Use it. + (explicit_instantiation): Likewise. + +Tue Mar 26 13:41:33 1996 Jason Merrill + + Add implicit declaration of class name at class scope. + * decl.c (lookup_name_real): Restrict pedwarn about ambiguous lookup. + * parse.y (self_reference): New nonterminal. + (opt.component_decl_list): Use it. + (fn.def1): Add nested_name_specifier type_name cases. + * class.c (build_self_reference): New function. + (finish_struct): Handle access_default later, move self-reference + decl to the end. + * pt.c (lookup_template_class): Handle getting a TYPE_DECL. + * cp-tree.h: Adjust. + + * pt.c (do_function_instantiation): Separate handling of member + functions and non-member functions properly. + +Mon Mar 25 14:23:22 1996 Jason Merrill + + * pt.c (process_template_parm): Improve error for 'volatile class K'. + + * class.c (finish_struct_1): Check the right slot for destructors. + + * decl.c (start_enum): Complain about enum templates. + +Mon Mar 25 13:25:31 1996 Mike Stump + + * init.c (resolve_offset_ref): Offset pointers to member data by one. + * typeck.c (unary_complex_lvalue): Likewise. + +Mon Mar 25 13:30:42 1996 Bob Manson + + * typeck.c (c_expand_return): Check for a returned local + array name, similar to the check for an ADDR_EXPR. + +Mon Mar 25 13:07:19 1996 Jason Merrill + + * decl.c (cp_finish_decl): Don't build cleanups for static + variables here. + +Fri Mar 22 17:57:55 1996 Mike Stump + + * typeck.c (build_modify_expr): Fix error messages to be more + accurate. + * cp-tree.h (assop_as_string): Parallel to op_as_string, but for + assignment operators. + * error.c (assop_as_string): Likewise. Add support for `%Q' for + assignment operators. + +Fri Mar 22 13:48:29 1996 Jason Merrill + + * decl.c (grokdeclarator): Call bad_specifiers for typedefs. Also + give an error if initialized. pedwarn about nested type with the + same name as its enclosing class. + + * pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT. + + * typeck.c (require_complete_type): Be sure to instantiate the + MAIN_VARIANT of the type. + + * decl2.c (finish_file): Instantiate pending templates before + processing static constructors and destructors. + + * pt.c (instantiate_decl): Don't instantiate functions at toplevel + unless at_eof. + +Fri Mar 22 09:30:17 1996 Bob Manson + + * decl2.c (delete_sanity): If error_mark_node is passed + in as an expression, quit while we're ahead. + + * decl.c (grokdeclarator): Give an error message if `friend' + is combined with any storage class specifiers. + +Wed Mar 20 14:51:55 1996 Jason Merrill + + * parse.y (named_complex_class_head_sans_basetype): Don't crash on + definition of nonexistent nested type. + + * error.c (dump_decl, case TYPE_DECL): Fix decision for whether or + not to say 'typedef'. + +Wed Mar 20 00:11:47 1996 Brendan Kehoe + + * cp-tree.h (struct lang_type): Make search_slot a tree, not a char*. + * search.c (dfs_walk, dfs_init_vbase_pointers, + expand_upcast_fixups): Remove cast of CLASSTYPE_SEARCH_SLOT. + (dfs_find_vbases): Remove cast for CLASSTYPE_SEARCH_SLOT init. + +Tue Mar 19 17:56:03 1996 Jason Merrill + + * except.c (build_throw): Support minimal parse. + * pt.c (tsubst_copy): Support THROW_EXPR. + * decl2.c (build_expr_from_tree): Likewise. + + * pt.c (mangle_class_name_for_template): Always allocate + scratch_firstobj. + +Tue Mar 19 16:34:31 1996 Bob Manson + + * cvt.c (cp_convert_to_pointer): Give an appropriate error + when trying to cast from an incomplete type. + +Tue Mar 19 16:00:33 1996 Jason Merrill + + * pt.c (instantiate_class_template): Don't bother setting up + CLASSTYPE_TAGS explicitly, as the nested types will add + themselves. + +Tue Mar 19 15:48:43 1996 Bob Manson + + * decl.c (shadow_tag): Remove old error check for usage of + an enum without a previous declaration. + (xref_tag): Add error message about usage of enums without a + previous declaration. + +Tue Mar 19 09:21:35 1996 Jason Merrill + + * lex.c (do_identifier): Only do name consistency check if we're + parsing. + + * pt.c (push_template_decl): Don't crash if we get a member defn + that doesn't match. + + * decl.c (xref_tag_from_type): New function to do an xref without + always having to figure out code_type_node. + * cp-tree.h: Declare it. + * pt.c (instantiate_class_template): Use it for friend classes. + (lookup_template_class): Use it. + + * typeck2.c (build_functional_cast): Pull out a single parm before + passing it to build_c_cast. + +Tue Mar 19 09:07:15 1996 Bob Manson + + * expr.c (do_case): Give an error message if a pointer is + given as a case value. + +Mon Mar 18 21:57:54 1996 Jason Merrill + + * typeck.c (build_c_cast): Don't pull single TEMPLATE_DECL out of + an overload list. + + * lex.c (cons_up_default_function): Really, now, interface hackery + does not apply to synthesized methods. + +Mon Mar 18 18:20:57 1996 Mike Stump + + * call.c (build_method_call): Ctors and dtors now have special names + with respect to lookups. + * class.c (add_method): Likewise. + (grow_method): Likewise. + (finish_struct_methods): Likewise. + (warn_hidden): Likewise. + (finish_struct_1): Likewise. + * cvt.c (convert_to_reference): Likewise. + (convert_to_aggr): Likewise. + (cp_convert): Likewise. + * decl2.c (check_classfn): Likewise. + * init.c (expand_member_init): Likewise. + (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + (build_offset_ref): Likewise. + (build_new): Likewise. + (build_delete): Likewise. + * lex.c (do_inline_function_hair): Likewise. + * search.c (lookup_field_1): Likewise. + (lookup_fnfields_here): Likewise. + (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (get_virtual_destructor): Likewise. + (dfs_debug_mark): Likewise. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + * tree.c (layout_basetypes): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_x_function_call): Likewise. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + (build_functional_cast): Likewise. + * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Likewise. + (CTOR_NAME): New. + (DTOR_NAME): New. + * decl.c (ctor_identifier): New. + (dtor_identifier): New. + (init_decl_processing): Set them. + +Mon Mar 18 18:00:51 1996 Mike Stump + + * typeck.c (build_component_ref): Don't get confused by fields whose + context has no type name, like pointer to member functions. + +Mon Mar 18 13:19:03 1996 Jason Merrill + + * decl.c (grokdeclarator): Handle typedef without declarator. + + * pt.c (tsubst): Handle SCOPE_REF in declarator. + + * parse.y (bad_parm): Catch another case of missing `typename'. + + * lex.c (yyprint): Handle TYPE_DECLs. + + * decl.c (start_function): Don't try to be clever. + + * lex.c: Lose compiler_error_with_decl. + * typeck2.c: Lose error_with_aggr_type. + (incomplete_type_error): Use cp_* instead of old functions. + (readonly_error): Likewise. + * typeck.c (convert_arguments): Likewise. + * search.c (lookup_nested_field): Likewise. + * method.c (make_thunk): Likewise. + * decl.c (grokparms): Likewise. + * cp-tree.h: Update. + + * tree.c (min_tree_cons): Call copy_to_permanent for the purpose + and value. + +Mon Mar 18 11:25:52 1996 Bob Manson + + * method.c (build_opfncall): When deleting a pointer to an + array, build a new pointer to the tree past any ARRAY_TYPE + nodes. + +Mon Mar 18 10:11:46 1996 Brendan Kehoe + + * decl.c (lookup_name_real): Initialize local var TYPE to NULL_TREE. + +Fri Mar 15 11:03:57 1996 Jason Merrill + + * pt.c (instantiate_decl): Only call import_export_decl if at_eof + and ! DECL_INLINE. + + * decl.c (finish_function): Don't set nested based on + hack_decl_function_context. + * parse.y (function_try_block): Check for nested function. + (pending_inlines): Likewise. + + * decl2.c (build_expr_from_tree): If a unary op already has a + type, just return it. + + * decl2.c (finish_prevtable_vardecl): Use ADJUST_VTABLE_LINKAGE. + + * decl2.c (walk_vtables): vardecl_fn returns int; return 1 if it does. + (finish_file): Check the return value of walk_vtables. + (finish_prevtable_vardecl): Return int. + (finish_vtable_vardecl): Likewise. + (prune_vtable_vardecl): Likewise. + * lex.c (set_vardecl_interface_info): Likewise. + * cp-tree.h: Adjust return types. + + * class.c (delete_duplicate_fields_1): Don't complain about + duplicate nested types if they're the same type. + (finish_struct): Remove check for duplicate. + * decl2.c (grokfield): Don't check for typedef of anonymous type. + +Thu Mar 14 10:00:19 1996 Jason Merrill + + * cp-tree.h: Lose SIGNATURE_GROKKING_TYPEDEF. + + * decl.c (grokdeclarator): Lose special handling of class-level + typedef. Lose SIGNATURE_GROKKING_TYPEDEF. Set + SIGNATURE_HAS_OPAQUE_TYPEDECLS later. + + * cvt.c (convert_pointer_to_real): Retain cv-quals in conversion. + + * pt.c (tsubst_copy): Strip cv-quals from destructor name types. + + * search.c (compute_access): Fix handling of anonymous union + members. + * class.c (finish_struct_anon): Propagate TREE_{PRIVATE,PROTECTED} + from anonymous unions to their members. + + * typeck.c (build_x_function_call): For static member functions, + hand off to build_member_call. + +Wed Mar 13 14:03:34 1996 Jason Merrill + + * typeck.c (build_component_ref): Handle OFFSET_REFs. + + * init.c (expand_vec_init): Fix init == 0 case. + +Tue Mar 12 14:36:02 1996 Jason Merrill + + * init.c (build_new): pedwarn about init and array new. + (expand_vec_init): Handle lists, use convert_for_initialization. + + * typeck.c (convert_for_initialization): Pass LOOKUP_NO_CONVERSION + when converting to an aggregate type. + * cvt.c (cp_convert): Pass it through. + + * typeck.c (build_conditional_expr): Handle user-defined + conversions to slightly different types. + + * decl.c (grokdeclarator): Force an array type in a parm to be + permanent. + + * decl2.c (do_using_directive): Sorry. + (do_namespace_alias): Likewise. + * lex.c (real_yylex): Warn about using the `namespace' keyword. + +Sun Mar 10 22:26:09 1996 Jason Merrill + + * parse.y (datadef): Move call to note_list_got_semicolon up. + +Fri Mar 8 11:47:26 1996 Mike Stump + + * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs. + +Fri Mar 8 11:29:06 1996 Mike Stump + + * decl.c (cp_finish_decl): The exception regions have to be + nested, not overlapping. We start the exception region for a + decl, after it has been fully built, and all temporaries for it + have been cleaned up. + +Thu Mar 7 17:46:06 1996 Mike Stump + + * tree.c (vec_binfo_member): Don't core dump if we have no bases. + +Thu Mar 7 14:11:49 1996 Jason Merrill + + * tree.def: Add RETURN_INIT. + * pt.c (instantiate_decl): Handle RETURN_INIT. + * decl.c (store_return_init): Handle minimal_parse_mode. + + * tree.c (cp_build_type_variant): Just return an error_mark_node. + * decl.c (make_typename_type): Don't try to get the file and line + of an identifier. + * typeck.c (comptypes): Handle TYPENAME_TYPE. + +Wed Mar 6 18:47:50 1996 Per Bothner + + * decl.c (poplevel): Make sure we clear out and restore old local + non-VAR_DECL values by default when they go out of scope. + +Wed Mar 6 09:57:36 1996 Jason Merrill + + * method.c (build_overload_value): Use DECL_ASSEMBLER_NAME in + referring to addresses of variables and functions. + + * error.c (dump_expr): Support SIZEOF_EXPR. + + * init.c (do_friend): Use the return value of check_classfn. + + * typeck.c (convert_arguments): Call complete_type. + + * method.c (hack_identifier): After giving an error, set value to + error_mark_node. + +Tue Mar 5 16:00:15 1996 Jason Merrill + + * tree.c (hack_decl_function_context): Kludge around DECL_CONTEXT + lossage for local classes. + * cp-tree.h: Declare it. + * decl.c (lookup_name_real): Evil, painful hack for local classes. + (grokfndecl): Set DECL_CLASS_CONTEXT and DECL_NO_STATIC_CHAIN here. + Use hack_decl_function_context. + (grokdeclarator): Don't set DECL_NO_STATIC_CHAIN here. + (start_function): Use hack_decl_function_context. + (finish_function): Likewise. + * method.c (synthesize_method): Likewise. + * lex.c (process_next_inline): Likewise. + (do_pending_inlines): Likewise. + * decl2.c (finish_file): Unset DECL_STATIC_FUNCTION_P when we're + done with it. + +Mon Mar 4 22:38:39 1996 Gerald Baumgartner + + * sig.c (build_signature_pointer_or_reference_type): Align + signature pointers/references on 8-byte boundaries so they can be + grabbed 2 words at a time on a SPARC. + +Tue Mar 5 10:21:01 1996 Jason Merrill + + * method.c (hack_identifier): Requiring a static chain is now a + hard error. + * decl.c (grokdeclarator): Set DECL_NO_STATIC_CHAIN on nested + functions. + +Mon Mar 4 20:03:33 1996 Jason Merrill + + * init.c (build_offset_ref): Call complete_type. + + * decl.c (pop_from_top_level): Always pop previous_class_type. + + * parse.y: Handle multiple decls in a for-init-statement. + * pt.c (tsubst_expr): Likewise. + + * pt.c (tsubst): Use tsubst_expr for the second operand of an + ARRAY_REF. + + * decl.c (maybe_push_to_top_level): Don't save previous_class_type. + (poplevel_class): Set it here. + (pop_from_top_level): Pop it here if we're returning to class scope. + * class.c (pushclass): Don't set it here. + + * decl.c (maybe_push_to_top_level): Save current_template_parms, + and clear it if !pseudo. + (pop_from_top_level): Restore it. + + * decl2.c (finish_file): Push the dummy each time we walk the list + of vtables. + + * error.c (dump_expr): Support LOOKUP_EXPR and actually do + something for CAST_EXPR. + +Mon Feb 19 14:49:18 1996 Rusty Russell + + * cvt.c (cp_convert): Warn about implicit conversion of the + address of a function to bool, as it is always true. + +Fri Feb 23 23:06:01 1996 Rusty Russell + + * typeck.c (c_expand_return): Fix warning for local externs returned. + +Mon Mar 4 15:03:11 1996 Jason Merrill + + * tree.c (mapcar): Propagate const and volatile properly. + + * typeck.c (complete_type): Be sure to instantiate the + MAIN_VARIANT of the type. + + * method.c (synthesize_method): Class interface hackery does not + apply to synthesized methods. + +Mon Mar 4 14:05:23 1996 Jason Merrill + + * pt.c (comp_template_args): Use comptypes rather than just + checking for TEMPLATE_TYPE_PARM equivalence. + + * typeck.c (build_x_function_call): Call complete_type before + checking TYPE_OVERLOADS_CALL_EXPR. + +Mon Mar 4 18:48:30 1996 Manfred Hollstein + + * g++.c (main): Check also for new define ALT_LIBM. + +Fri Mar 1 13:09:33 1996 Jason Merrill + + * pt.c (instantiate_class_template): If we don't have a pattern + yet, that's OK. + (coerce_template_parms): If we see a local class, bail. + + * decl.c (grok_reference_init): Make sure there's a type before + checking its code. + + * pt.c (do_function_instantiation): Avoid crashing on invalid decls. + (push_template_decl): Likewise. + + * parse.y (named_class_head): Set + CLASSTYPE_TEMPLATE_SPECIALIZATION here if we have basetypes. + + * decl.c (xref_tag): Diagnose redeclaration of template + type-parameter name. + + * error.c (dump_type): Handle anonymous template type parms. + + * pt.c (instantiate_template): Use TYPE_MAIN_DECL instead of + TYPE_STUB_DECL. + (coerce_template_parms): Likewise. + +Thu Feb 29 16:26:01 1996 Mike Stump + + * class.c (instantiate_type, case {ARRAY,INDIRECT}_REF, + case ADDR_EXPR): Don't modify rhs if a subinstantiation fails. + +Thu Feb 29 08:20:25 1996 Jason Merrill + + * pt.c (instantiate_template): Take the MAIN_VARIANT of the type + before trying to get its STUB_DECL. + (coerce_template_parms): Likewise. + + * parse.y (template_type_parm): If they didn't use 'class', + pretend they did after giving an error. + + * pt.c (coerce_template_parms): Diagnose use of local class. + + * decl.c (grok_reference_init): Use instantiate_type. + + * error.c (dump_expr): Handle TEMPLATE_DECLs. + + * parse.y (named_class_head): Diagnose mismatching types and tags. + + * decl.c (pushdecl): Type decls and class templates clash with + artificial type decls, not hide them. + + * decl.c (redeclaration_error_message): Diagnose redefinition of + templates properly. + (duplicate_decls): Diagnose disallowed overloads for template + functions, too. + + * decl.c (start_decl): Call complete_type before checking for a + destructor. + + * pt.c (tsubst): Use tsubst_expr on the elts of a VEC. + + * decl.c (xref_tag): A TEMPLATE_TYPE_PARM is a match. + +Wed Feb 28 09:28:44 1996 Jason Merrill + + * decl.c (grok_op_properties): Don't check for operator++(int) in + a template. + + * tree.c (perm_manip): Return a copy of variable and function + decls with external linkage. + + * tree.def: Change some of the min tree codes to type "1". + * pt.c (uses_template_parms): Handle 'e's, return 1 for LOOKUP_EXPRs. + * method.c (build_overload_int): Emit something arbitrary for + anything but an INTEGER_CST if we're in a template. + + * decl.c (cp_finish_decl): Call complete_type before deciding + whether or not to lay out the decl. + + * lex.c (do_identifier): Check for DECL_INITIAL before using it. + +Tue Feb 27 16:35:32 1996 Jason Merrill + + * typeck2.c (build_x_arrow): Call complete_type. + + * pt.c (add_pending_template): Broken out. + (lookup_template_class): If -fexternal-templates, call it for all + the methods of implemented types. + (instantiate_class_template): Instead of instantiating them here. + (instantiate_decl): Handle -fexternal-templates earlier. + +Tue Feb 27 15:51:32 1996 Brendan Kehoe + + * search.c, lex.c, decl.c, class.c, cp-tree.h: Don't wrap the + memoized lookup stuff inside GATHER_STATISTICS. + +Tue Feb 27 10:38:08 1996 Jason Merrill + + * decl.c (start_decl): Complain about array of incomplete type + here. + (grokdeclarator): Not here. + + * parse.y (template_parm): Expand full_parm inline so we can set + the rule's precedence. + + * pt.c (tsubst_expr): If we're in a template, just do tsubst_copy. + (tsubst): tsubst_expr the DECL_INITIAL of FIELD_DECLs. + * decl2.c (grokbitfield): Don't check for integer constant here. + * class.c (finish_struct_1): Check here. + + * decl.c (define_label): Make the min decl go on permanent_obstack. + + * pt.c (unify): Don't handle CONST_DECLs. + (uses_template_parms): Don't check DECL_INITIAL on a CONST_DECL. + (tsubst_copy): Likewise. + + * lex.c (do_identifier): Do pull the DECL_INITIAL out of a + CONST_DECL for a template parm. + +Mon Feb 26 12:48:18 1996 Jason Merrill + + * decl.c (grokdeclarator): Complain about array of incomplete type + here. + (start_decl_1): Not here. + + * pt.c (tsubst): Handle pointer-to-function declarators. + + * method.c (hack_identifier): If pedantic, diagnose local class + methods that require a static chain. + + * decl.c (grok_op_properties): No longer static. + * cp-tree.h: Declare it. + * pt.c (tsubst): Call it for operators. + Use tsubst_copy for TREE_VECs. + + * parse.y (template_arg): The expr has precedence like '>'. + +Fri Feb 23 14:51:52 1996 Jason Merrill + + * pt.c (coerce_template_parms): Don't coerce an expression using + template parms. + (uses_template_parms): Also check DECL_INITIAL in CONST_DECLs. + (tsubst): Don't use build_index_2_type if the max_value uses template + parms. + * method.c (build_overload_int): Emit something arbitrary for an + expression using template parms. + + * parse.y (template_close_bracket): New non-terminal to catch use + of '>>' instead of '> >' in template class names. + (template_type): Use it. + * Makefile.in (CONFLICTS): Causes one more r/r conflict. + + * tree.def: Add CAST_EXPR. + * typeck2.c (build_functional_cast): Use CAST_EXPR instead of + CONVERT_EXPR for minimal_parse_mode. + * typeck.c (build_c_cast): Likewise. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + * error.c (dump_expr): Likewise. + +Fri Feb 23 10:36:46 1996 Brendan Kehoe + + * except.c (SetTerminate, SetUnexpected): Put back global vars. + (init_exception_processing): Put back decl/init of + set_unexpected_fndecl and set_terminate_fndecl, needed to get the + fns from libstdc++. + + * decl.c (struct binding_level): Delete ACCEPT_ANY bitfield. + (declare_uninstantiated_type_level, uninstantiated_type_level_p): + Delete unused fns. + * cp-tree.h (declare_uninstantiated_type_level, + uninstantiated_type_level_p): Delete prototypes. + +Thu Feb 22 19:36:15 1996 Jason Merrill + + * pt.c (tsubst_expr): Add default return. + +Thu Feb 22 16:47:24 1996 Brendan Kehoe + + * error.c (fndecl_as_string): Delete unused arg CNAME. + * sig.c (build_signature_table_constructor, + build_signature_method_call): Fix calls. + + * class.c (the_null_vtable_entry): Delete var definition. + (init_class_processing): Delete tree the_null_vtable_entry init. + * decl.c (no_print_{functions, builtins}): Declare as static. + (__tp_desc_type_node): #if 0 var definition. + (init_type_desc): #if 0 init of __tp_desc_type_node. + (vb_off_identifier): Move var decl into init_decl_processing. + (current_function_assigns_this): Declare as static. + (int_ftype_ptr_ptr_int, void_ftype_ptr_int_int): Delete var decls. + (init_decl_processing): Delete init of void_ftype_ptr_ptr_int. + Move decls of string_ftype_ptr_ptr and int_ftype_string_string here. + * decl2.c (delete_sanity): Delete definition/mod of local var ELT_SIZE. + * init.c (BI_header_type, BI_header_size): Declare as static. + * pt.c (template_classes): Delete unused var. + (add_pending_template): Delete decl for non-existent fn. + (lookup_template_class): Delete vars CODE and TAG_CODE. + (instantiate_template): Delete unused var TARGS. + * cp-tree.h (vb_off_identifier, current_function_assigns_this): + Delete decls. + (__tp_desc_type_node): #if 0 var decl. + (fndecl_as_string): Fix prototype. + +Thu Feb 22 15:56:19 1996 Jason Merrill + + * tree.def: Add GOTO_STMT. + * pt.c (tsubst_expr): Support goto and labels. + * decl.c (define_label): Support minimal parsing. + * parse.y (simple_stmt): Likewise. + +Thu Feb 22 15:30:12 1996 Brendan Kehoe + + * xref.c (GNU_xref_member): Only define/set var I if + XREF_SHORT_MEMBER_NAMES is defined, to match when it's actually + used. + (GNU_xref_end_scope): Delete unused fifth arg TRNS. + (GNU_xref_end): Fix call. + * decl.c (poplevel, poplevel_class, finish_method): Fix calls. + * cp-tree.h (GNU_xref_end_scope): Fix prototype. + + * tree.c (build_exception_variant): Delete unused vars I, A, T, + T2, and CNAME. + (layout_vbasetypes): Delete unused var NONVIRTUAL_VAR_SIZE. + (mapcar): Delete unused var CODE. + (build_cplus_new): Delete unused arg WITH_CLEANUP_P. + (break_out_cleanups): Fix call. + (bot_manip): Likewise. + * call.c (build_method_call): Likewise. + * cvt.c (build_up_reference, convert_to_reference, cp_convert): + Likewise. + * typeck.c (unary_complex_lvalue, build_modify_expr, + convert_for_initialization): Likewise. + * typeck2.c (build_functional_cast): Likewise. + * cp-tree.h (build_cplus_new): Fix prototype. + + * repo.c (open_repo_file): Delete unused var Q. + (repo_compile_flags, repo_template_declared, + repo_template_defined, repo_class_defined, repo_inline_used, + repo_vtable_used, repo_tinfo_used): #if 0 unused fns. + (repo_get_id, repo_vtable_used): Declare as static. + * cp-tree.h (mark_{decl,class}_instantiated, finish_repo): Add + prototypes. + +Thu Feb 22 14:53:35 1996 Jason Merrill + + * parse.y (pending_inlines): Add function_try_block case. + + * pt.c (unify): Fix for template const parms. + +Thu Feb 22 13:24:15 1996 Brendan Kehoe + + * lex.c (extract_interface_info): Delete forward decl. + (default_copy_constructor_body, default_assign_ref_body): Delete + decls for non-existent functions. + (synth_firstobj, inline_text_firstobjs): Delete unused vars. + (init_lex): Delete setting them. + (cons_up_default_function): Delete unused vars FUNC_BUF, + FUNC_LEN, and COMPLEX. Delete code setting COMPLEX. Delete old + #if 0'd synth code. + (toplevel, expression_obstack): Delete unused extern decls. + (tree_node_kind): Delete unused enum. + (tree_node_counts, tree_node_sizes): Wrap with #ifdef + GATHER_STATISTICS. + (tree_node_kind_names): Delete unused extern decl. + (synth_obstack): Delete unused var. + (init_lex): Don't set it. + (init_parse): Add decl before use. + (reduce_count): Only define #ifdef GATHER_STATISTICS && REDUCE_LENGTH. + (current_unit_{name, language}): Delete unused vars. + (check_newline): Don't bother setting them, just accept the #pragma. + * cp-tree.h (init_repo, peek_yylex): Add prototypes. + (current_unit_{name, language}): Delete decls. + + * search.c: Wrap all of the memoized functions, macros, and + variables inside #ifdef GATHER_STATISTICS. + (lookup_field, lookup_fnfields): Likewise. + (init_search_processing): Likewise. + (reinit_search_statistics): Wrap whole function. + * lex.c (reinit_lang_specific): Wrap call to reinit_search_statistics. + + * decl.c (finish_function): Only call pop_memoized_context if + GATHER_STATISTICS is defined. + (start_function): Likewise for push_memoized_context. + * class.c (pushclass, popclass): Likewise. + + * cp-tree.h (CLASSTYPE_MTABLE_ENTRY): Move definition from here... + * search.c (CLASSTYPE_MTABLE_ENTRY): ... to here. + + * cvt.c (cp_convert): Delete unused local var FORM. + * cp-tree.h (can_convert, can_convert_arg, real_lvalue_p): Add + prototypes. + +Thu Feb 22 13:19:44 1996 Jason Merrill + + * pt.c (do_poplevel): Oops; really return what we get from + poplevel this time. + +Thu Feb 22 11:41:44 1996 Brendan Kehoe + + * cp-tree.h (is_aggr_type): Add prototype. + + * cp-tree.h ({push,pop}_cp_function_context): Add decls. + * method.c ({push,pop}_cp_function_context): Delete decls. + * except.c (start_eh_unwinder, end_eh_unwinder): Declare as void. + (SetUnexpected, SetTerminate): Delete unused vars. + (init_exception_processing): Don't set SetUnexpected or + SetTerminate. Don't set SET_UNEXPECTED_FNDECL or SET_TERMINATE_FNDECL. + (output_exception_table_entry): Delete unused array LABEL. + (expand_internal_throw): Delete unused var PARAMS. + (expand_start_catch_block): Delete unused var CLEANUP. + (emit_exception_table): Delete unused var EH_NODE_DECL. + (expand_builtin_throw): Delete unused vars UNWIND_AND_THROW and + GOTO_UNWIND_AND_THROW. Don't set them. + (end_eh_unwinder): Add top decl. + (pop_rtl_from_perm): Delete unused decl of PERMANENT_OBSTACK. + (exception_section, push_rtl_perm, do_function_call, + lang_interim_eh, push_eh_cleanup, eh_outer_context, + expand_end_eh_spec, end_eh_unwinder): Declare as static. + (saved_pc, saved_throw_type, saved_throw_value, saved_cleanup, + throw_used): Likewise. + * cp-tree.h (expand_end_eh_spec): Delete prototype. + + * search.c (dfs_mark, dfs_mark_vtable_path, + dfs_unmark_vtable_path, dfs_mark_new_vtable, + dfs_unmark_new_vtable, dfs_clear_search_slot, + dfs_search_slot_nonempty_p, bfs_markedp, bfs_unmarkedp, + bfs_marked_vtable_pathp, bfs_unmarked_vtable_pathp, + bfs_marked_new_vtablep, bfs_unmarked_new_vtablep): #if 0 unused + functions. + (n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1, + n_calls_lookup_fnfields, n_calls_lookup_fnfields_1, + n_calls_get_base_type, n_outer_fields_searched, n_contexts_saved): + Only define #ifdef GATHER_STATISTICS. + (reinit_search_statistics): Only init some vars if GATHER_STATISTICS + is defined. + (vbase_decl): Delete var definition. + (init_search): Delete old decl. + (init_vbase_pointers): Delete building of VBASE_DECL, since it's + never actually used. + (expand_indirect_vtbls_init): Delete init of VBASE_DECL. + (get_base_distance_recursive): Delete unused fourth arg + BASETYPE_PATH. Fix call . + (get_base_distance): Fix call. + (push_class_decls): Delete unused var ID. + (make_memoized_table_entry): Declare as static. + (breadth_first_search): Declare as static. + (tree_has_any_destructor_p): Declare as static. + (pop_class_decls): Delete unused arg pop_class_decls. + * class.c (popclass): Fix call to pop_class_decls. + * cp-tree.h (make_memoized_table_entry, breadth_first_search, + tree_has_any_destructor_p): Delete prototypes. + + * rtti.c (build_ptmf_desc): Delete unused arg TYPE. + (build_t_desc): Fix call. Delete unused vars ELEMS and TT. + (build_dynamic_cast): Delete unused local vars TMP1 and RETVAL. + (build_user_desc): Delete unused var T. + (build_class_desc): Delete unused vars T and OFF. + (build_t_desc): Delete unused var NAME_STRING. + (build_headof): Make static. + (get_bad_cast_node): Likewise. + (get_def_to_follow): Likewise. + * cp-tree.h (init_type_desc): Add prototype. + (build_headof): Remove prototype. + +Thu Feb 22 00:54:22 1996 Jason Merrill + + * pt.c (tsubst): Only look for matching decls at file scope for + non-member functions. + + * call.c (build_scoped_method_call): Handle scoped destructor + calls in templates. + + * decl.c (*_top_level): Also save previous_class_values. + + * pt.c (tsubst_expr): Support do {} while loops. + * parse.y (simple_stmt): Likewise. + * tree.def: Likewise. + + * method.c (build_overload_identifier): For a class nested in a + template class, don't mangle in the template parms from our + context. + + * lex.c, cp-tree.h: Remove support for template instantiations in + the pending_inlines code. + * pt.c: Remove dead functions and unused arguments. + (uses_template_parms): TYPENAME_TYPEs always use template parms. + * parse.y: Stop passing anything to end_template_decl. + * tree.c (print_lang_statistics): Only print tinst info #ifdef + GATHER_STATISTICS. + +Wed Feb 21 16:57:33 1996 Brendan Kehoe + + * init.c (expand_recursive_init{,_1}): Delete decls. + (sort_member_init): Delete unused var INIT. + (emit_base_init): Delete unused var X. + (build_offset_ref): Delete unused var CNAME. + (sort_member_init): Delete unused var FIELDS_TO_UNMARK. + (emit_base_init): Delete unused local var BASE. Delete extern + decl of IN_CHARGE_IDENTIFIER. + (build_delete): Delete unused local var VIRTUAL_SIZE. + + * init.c (build_vec_delete): Delete unused third arg ELT_SIZE. + (build_delete): Fix call. + * decl2.c (delete_sanity): Likewise. + * cp-tree.h (build_vec_delete): Update prototype. + + * typeck.c (common_base_type): Delete unused var TMP. + (build_binary_op): Delete local var ARGS_SAVE. + (build_array_ref): Delete unused var ITYPE. + (c_expand_return): Delete unused var USE_TEMP. + + * typeck.c (compexcepttypes): Delete unused arg STRICT. + (comptypes): Fix calls. + * decl.c (duplicate_decls): Likewise. + * cp-tree.h (compexcepttypes): Delete extra arg. + + * decl2.c (check_classfn): Delete unused second arg CNAME. + * decl.c (start_decl, grokfndecl): Fix calls. + * init.c (do_friend): Likewise. + * cp-tree.h (check_classfn): Update prototype. + + * cp-tree.h (signature_error, import_export_vtable, + append_signature_fields, id_in_current_class, mark_used, + copy_assignment_arg_p): Add decls. + * decl2.c (mark_used): Delete decl. + + * class.c (n_*): Wrap with #ifdef GATHER_STATISTICS. + + * class.c (get_vtable_entry): Disable unused function. + (doing_hard_virtuals): Delete unused static global var. + (finish_struct_1): Don't init DOING_HARD_VIRTUALS. + (prepare_fresh_vtable): Delete unused vars PATH and RESULT. + (overrides): Delete unused vars RETTYPE and BASE_RETTYPE. + (modify_one_vtable): Delete unused var OLD_RTTI. + (finish_struct_anon): Delete unused vars OFFSET and X. + (finish_struct_bits): Delete unused var METHOD_VEC. + (get_basefndecls): Delete unused var PURPOSE. Delete unused + for-scope local variable METHODS. + + * call.c (user_harshness): Delete unused/unneeded arg PARM. + (ideal_candidate): Delete unused args BASETYPE and PARMS. + (build_method_call): Delete unused args passed into ideal_candidate. + (build_overload_call_real): Likewise. Delete unused var OVERLOAD_NAME. + * cp-tree.h (synthesize_method): Add decl. + + * decl.c (note_level_for_for): Give void return type. + (pushdecl_nonclass_level): Likewise. + (finish_function): Delete unused vars VFIELDS and ALLOCATED_THIS. + (poplevel): Delete unused var IMPLICIT_TRY_BLOCK. + (suspend_binding_level): Delete unused var LEVEL. + (duplicate_decls): Delete unused var CTYPE. + (duplicate_decls): Delete unused var PREVIOUS_C_DECL. + (init_decl_processing): Delete unused vars FLOAT_ENDLINK and + PTR_ENDLINK. + (grokdeclarator): Delete unused var C. + (grokdeclarator): Delete unused var SIZE_VARIES. + (grokparms): Delete unused var SAW_VOID. + (start_function): Delete unused var OLDDECL. + (cplus_expand_expr_stmt): Delete unused var + REMOVE_IMPLICIT_IMMEDIATELY. + + * cp-tree.h (pushdecl_nonclass_level): Fix prototype. + + * Makefile.in (CONFLICTS): Update to 12 shift/reduce. + +Wed Feb 21 00:06:17 1996 Jason Merrill + + * tree.c (build_min): Set TREE_COMPLEXITY to lineno. + (build_min_nt): Likewise. + * pt.c (do_pushlevel): Emit line note. + (do_poplevel): Return what we get from poplevel. + (tsubst_expr): Set lineno from TREE_COMPLEXITY in stmt nodes. + * parse.y: Use do_pushlevel and do_poplevel. + * cp-tree.h: Declare do_poplevel. + + * cp-tree.h: Declare at_eof. + * decl.c (cp_finish_decl): Pass it to rest_of_decl_compilation. + * decl2.c (import_export_decl): Renamed from import_export_inline. + (finish_file): Call it to do interface handling for statics. + * pt.c (tsubst_copy): Call mark_used on variables and functions + used here. + + * decl2.c (finish_file): Don't emit statics we can't generate. + * pt.c (instantiate_decl): Don't set interface on instantiations + we can't generate. + + * cp-tree.h (struct tinst_level): Change 'classname' to 'decl'. + * tree.c (print_lang_statistics): Print max template depth. + * pt.c (push_tinst_level): Dump entire instantiation context. + (instantiate_class_template): Use it and pop_tinst_level. + (instantiate_decl): Likewise. + + * call.c class.c cp-tree.h decl.c decl2.c error.c lex.c method.c + pt.c ptree.c tree.def: Remove all traces of UNINSTANTIATED_P_TYPE. + +Tue Feb 20 18:21:51 1996 Jason Merrill + + * call.c class.c cp-tree.h cvt.c decl.c decl2.c error.c expr.c + init.c lex.c method.c parse.y pt.c repo.c search.c spew.c tree.c + tree.def typeck.c typeck2.c xref.c: Massive, systemic changes for + the new template implementation. + +Tue Feb 20 17:14:29 1996 Brendan Kehoe + + * decl2.c (check_cp_case_value): Use STRIP_TYPE_NOPS. + +Thu Feb 15 18:44:42 1996 Mike Stump + + * decl.c (cp_finish_decl): Delay emitting the debug information for + a typedef that has been installed as the canonical typedef, if the + type has not yet been defined. + +Thu Feb 15 09:39:08 1996 Jason Merrill + + * decl2.c (grokfield): Still call pop_nested_class for access decls. + +Wed Feb 14 17:30:04 1996 Brendan Kehoe + + * decl.c (lookup_label): Call label_rtx. + + * decl.c (make_binding_level): New function. + (pushlevel, pushlevel_class): Call it instead of explicit + duplicate calls to xmalloc. + + * decl.c (init_decl_processing): Delete useless build_pointer_type + call. + + * decl.c (float_ftype_float, ldouble_ftype_ldouble): Add definitions. + (sizet_ftype_string): Delete variable. + (init_decl_processing): Add built-in functions fabsf, fabsl, + sqrtf, sqrtl, sinf, sin, sinl, cosf, cos, cosl. New local + variable strlen_ftype, used for strlen. + +Wed Feb 14 16:21:25 1996 Jason Merrill + + * decl.c (push_to_top_level): Start from current_binding_level + again for now; the stl hacks depend on g++ being broken in this + way, and it'll be fixed in the template rewrite. + + * tree.def: Add USING_DECL. + * decl2.c (do_class_using_decl): Implement. + (grokfield): Pass access decls off to do_class_using_decl instead of + grokdeclarator. + * error.c (dump_decl): Handle USING_DECLs. + * decl.c (grokdeclarator): Remove code for handling access decls. + * class.c (finish_struct_1): Adjust accordingly, treat using-decls + as access decls for now. + (finish_struct): Don't check USING_DECLs for other uses of the name. + + * search.c (get_matching_virtual): Use cp_error_at. + +Wed Feb 14 10:36:58 1996 Brendan Kehoe + + * typeck.c (comptypes): Default COMP_TYPE_ATTRIBUTES to 1, to + match c-typeck.c. + (self_promoting_args_p): Move the check that TYPE is non-nil + before trying to look at its main variant. + (unsigned_type, signed_type): Add checking of DI/SI/HI/QI nodes. + + * cp-tree.h (DECL_WAITING_FRIENDS, SET_DECL_WAITING_FRIENDS): + Delete macros. + * init.c (xref_friend, embrace_waiting_friends): Delete functions. + (do_friend): Delete call to xref_friend. + * class.c (finish_struct_1): Delete call to embrace_waiting_friends. + + * typeck.c (convert_sequence): #if 0 unused function. + + * cp-tree.h (DECL_IN_MEMORY_P): New macro w/ the check that used to + be in decl_in_memory_p. + (decl_in_memory_p): Delete decl. + * expr.c (decl_in_memory_p): Delete fn. + * typeck.c (mark_addressable): Use DECL_IN_MEMORY_P. + + * decl.c (cp_finish_decl): Use DECL_IN_MEMORY_P. + +Tue Feb 13 12:51:21 1996 Jason Merrill + + * class.c (finish_struct_1): Check for a pure-specifier on a + non-virtual function here. + + * decl2.c (grok_function_init): Don't check whether the function + is virtual here. + (grokfield): Don't call check_for_override here. + + * decl.c (push_to_top_level): Start from inner_binding_level, + check class_shadowed in class levels. + +Mon Feb 12 17:46:59 1996 Mike Stump + + * decl.c (resume_level): Ignore things that don't have names, instead + of core dumping. + +Mon Feb 12 15:47:44 1996 Brendan Kehoe + + * decl2.c (grokfield): Set DECL_VINDEX properly for FUNCTION_DECLs. + +Sat Feb 10 17:59:45 1996 Jason Merrill + + * class.c (finish_struct_1): Set DECL_VINDEX properly on a + synthesized dtor. + + * parse.y (complete_type_name): Bind global_scope earlier. + (complex_type_name): Likewise. + (qualified_type_name): Remove. + +Thu Feb 8 15:15:14 1996 Jason Merrill + + * decl.c (grokfndecl): Move code that looks for virtuals in base + classes... + * class.c (check_for_override): ... to a new function. + (finish_struct_1): Call it. + + * cp-tree.h: Declare warn_sign_compare. + + * typeck.c (build_binary_op_nodefault): Check warn_sign_compare + rather than extra_warnings to decide whether to warn about + comparison of signed and unsigned. + + * decl2.c (lang_decode_option): Handle warn_sign_compare. -Wall + implies -Wsign-compare. -Wall doesn't imply -W. + +Wed Feb 7 15:27:57 1996 Mike Stump + + * typeck.c (build_component_ref): Fix to handle anon unions in base + classes as well. + +Wed Feb 7 14:29:12 1996 Brendan Kehoe + + * class.c (resolves_to_fixed_type_p): Delete code dealing with + a WITH_CLEANUP_EXPR, since we don't generate them any more. + * cvt.c (build_up_reference): Likewise. + * decl.c (grok_reference_init): Likewise. + (cp_finish_decl): Likewise. + * error.c (dump_expr): Likewise. + * tree.c (real_lvalue_p): Likewise. + (lvalue_p): Likewise. + (build_cplus_new): Likewise. + (unsave_expr_now): Likewise. + * typeck.c (unary_complex_lvalue, build_modify_expr, + c_expand_return): Likewise. + +Tue Feb 6 13:39:22 1996 Brendan Kehoe + + Make the C++ front-end pay attention to attributes for structures. + * class.c (finish_struct): New argument ATTRIBUTES, passed down into + finish_struct_1. + (finish_struct_1): New argument ATTRIBUTES; call cplus_decl_attributes. + Take out old round_up_size use and setting the DECL_ALIGN possibly + using it. Take out setting of TYPE_ALIGN to round_up_size, which + can override what the attribute set. + * cp-tree.h (finish_struct): Update prototype. + * parse.y (template_instantiate_once): Pass a NULL_TREE for the + attributes to finish_struct. + (structsp): For a CLASS decl, add maybe_attribute to rule and pass that + value down into finish_struct. + * Makefile.in (CONFLICTS): Switch to 7 shift/reduce conflicts. + +Tue Feb 6 13:12:15 1996 Per Bothner + + * decl.c (poplevel): Re-word dead for local handling. + (pushdecl): Remove useless DECL_DEAD_FOR_LOCAL test. + (cp_finish_decl): If is_for_scope, check for duplicates so + we can disable is_for_scope. Otherwise, preserve_temp_slots. + + * lex.c (do_identifier): Use global binding in preference of + dead for local variable. + +Mon Feb 5 17:46:46 1996 Mike Stump + + * init.c (initializing_context): Handle anon union changes, the + context where fields of anon unions can be initialized now has to be + found by walking up the TYPE_CONTEXT chain. + +Fri Feb 2 14:54:04 1996 Doug Evans + + * decl.c (start_decl): #ifdef out code to set DECL_COMMON + if ASM_OUTPUT{,_ALIGNED}_BSS is defined. + (obscure_complex_init): If bss is supported, always set + DECL_INITIAL to error_mark_node. + +Thu Feb 1 16:19:56 1996 Brendan Kehoe + + * init.c (is_friend): Make sure there's a context before we see if + it's an aggr type. + +Thu Feb 1 15:44:53 1996 Mike Stump + + * init.c (is_friend): Classes are not friendly with nested classes. + +Thu Feb 1 15:27:37 1996 Doug Evans + + * lex.c (check_newline): Pass last character read to HANDLE_PRAGMA, + and record its result. + +Thu Feb 1 09:27:01 1996 Mike Stump + + * class.c (finish_struct_anon): Switch around code to not move anon + union elements around, nor mess up their contexts, nor offsets, + instead we now build up the right number of COMPONENT_REFs for all + the anon unions that may be present at build_component_ref time. + * typeck.c (lookup_anon_field): New routine to handle field lookup + on fields without names. We find them, based upon their unique type + instead. + * typeck.c (build_component_ref): Allow FIELD_DECL components. + Handle finding components in anonymous unions, and ensure that a + COMPONENT_REF is built for each level as necessary. + +Tue Jan 30 18:18:23 1996 Mike Stump + + * cvt.c (build_up_reference): Make the INDIRECT_BIND case come after + code that ensures that copy ctors are used if appropriate. + +Tue Jan 30 17:35:14 1996 Brendan Kehoe + + * init.c (build_vec_delete): Only give an error if base isn't an + error_mark_node. + +Mon Jan 29 17:09:06 1996 Mike Stump + + * spew.c (do_aggr): `new struct S;' isn't a forward declaration. + (yylex): If we see `new', keep slurping. + +Thu Jan 25 18:31:36 1996 Mike Stump + + * class.c (finish_struct_1): Move code for handling anon unions... + (finish_struct_anon): to here. Fixup so that we do the offset + calculations right, and so that the fields are physically moved to + the containers's chain. + +Thu Jan 25 18:27:37 1996 Brendan Kehoe + + * decl.c (grokdeclarator): Avoid trying to get an operand off an + identifier node. + +Wed Jan 24 11:25:30 1996 Jim Wilson + + * typeck.c (pointer_int_sum): Use TYPE_PRECISION (sizetype) not + POINTER_SIZE to agree with expr.c. + +Thu Jan 25 13:01:23 1996 Mike Stump + + * search.c (lookup_field): Don't report ambiguities if protect is 0, + instead return NULL_TREE. + +Wed Jan 24 13:01:26 1996 Mike Stump + + * class.c (finish_struct_1): Call warn_hidden if we want warnings + about overloaded virtual functions. + (warn_hidden): New routine to warn of virtual functions that are + hidden by other virtual functions, that are not overridden. + (get_basefndecls): New routine, used by warn_hidden. + (mark_overriders): New routine, used by warn_hidden. + * search.c (get_matching_virtual): Remove old warning that just + isn't very useful. + +Tue Jan 23 12:26:10 1996 Brendan Kehoe + + * decl.c (output_builtin_tdesc_entries): #if 0 the function definition. + + * typeck.c (null_ptr_cst_p): Delete unused fn. + (build_function_call_maybe): Delete unused fn. + + * expr.c (extract_init): #if 0 the code after unconditional return 0 + for now. + + Delete old cadillac code. + * edsel.c: Remove file. + * Make-lang.in (CXX_SRCS): Take edsel.c off the list. + * Makefile.in (CXX_OBJS): Delete edsel.o. + (edsel.o): Delete rule. + * cp-tree.h (flag_cadillac): Delete var decl. + * lang-options.h: Delete "-fcadillac" and "-fno-cadillac". + * decl2.c (flag_cadillac): Delete var definition. + (lang_decode_option): Delete handling of -fcadillac and -fno-cadillac. + (grokfield): Delete code depending on flag_cadillac. + (finish_anon_union): Likewise. + * class.c (finish_struct_1): Likewise. + (pushclass): Likewise. + (popclass): Likewise. + (push_lang_context): Likewise. + (pop_lang_context): Likewise. + * decl.c (init_decl_processing): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (xref_tag): Likewise. + (finish_enum): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (finish_stmt): Likewise. + * lex.c (lang_init): Likewise. + (check_newline): Likewise. + + * lex.c (do_pending_inlines): Delete synthesized method kludge. + + Delete defunct, ancient garbage collection implementation. + * rtti.c: New file with the RTTI stuff from gc.c. + * gc.c: Removed file (moved the remaining stuff into rtti.c). + * Makefile.in (CXX_OBJS): Replace gc.o with rtti.o. + (rtti.o): New rule, replacing gc.o. + * Make-lang.in (CXX_SRCS): Replace gc.c with rtti.c. + * cp-tree.h: Delete gc-related fn decls. + (DECL_GC_OFFSET): Delete macro. + (flag_gc): Delete extern decl. + * decl.c (current_function_obstack_index): Delete var decl. + (current_function_obstack_usage): Delete var decl. + (start_function): Delete clearing of current_function_obstack_index + and current_function_obstack_usage. + (init_decl_processing): Delete code relying on -fgc. + Delete call to init_gc_processing. + (cp_finish_decl): Delete calls to build_static_gc_entry and + type_needs_gc_entry. Delete gc code setting DECL_GC_OFFSET. + (store_parm_decls): Delete -fgc calls to cp_expand_decl_cleanup + and to expand_expr of a __gc_main call. + (maybe_gc_cleanup): Delete var decl. + (finish_function): Delete call to expand_gc_prologue_and_epilogue. + * decl2.c (flag_gc): Delete var decl. + (lang_f_options): Delete offering of -fgc. + (lang_decode_option): Delete -fgc and -fno-gc handling. + (get_temp_regvar): Delete gc code. + * init.c (build_new): Delete gc code. + * lex.c (init_lex): Delete checking of flag_gc. + + * typeck.c (convert_arguments): Delete gc code. + (build_component_addr): Delete -fgc warning. + (build_modify_expr): Delete gc code. + + * decl2.c (build_push_scope): Delete fn. + * cp-tree.h (build_push_scope): Delete decl. + + * search.c (clear_search_slots): Delete fn. + * cp-tree.h (clear_search_slots): Delete decl. + + * search.c (tree_needs_constructor_p): Delete fn. + * cp-tree.h (tree_needs_constructor_p): Delete decl. + + * tree.c (id_cmp): Delete fn. + + * tree.c (set_fnaddr_from_vtable_entry): Delete fn. + * cp-tree.h (set_fnaddr_from_vtable_entry): Delete decl. + + * tree.c (decl_value_member): Delete fn. + * cp-tree.h (decl_value_member): Delete decl. + + * tree.c (list_hash_lookup_or_cons): Delete fn. + * cp-tree.h (list_hash_lookup_or_cons): Delete decl. + + * method.c (cplus_exception_name): Delete fn. + (EXCEPTION_NAME_{PREFIX, LENGTH}): Delete macros. + + * spew.c (shift_tokens): Delete fn. + +Mon Jan 22 17:49:33 1996 Jason Merrill + + * except.c (init_exception_processing): Pass 1 to needs_pop in calls + to cp_finish_decl. + * parse.y: Likewise. + +Mon Jan 22 17:34:29 1996 Brendan Kehoe + + * tree.c (build_cplus_staticfn_type): Delete function definition; + never used. + * cp-tree.h (build_cplus_staticfn_type): Delete decl. + + * tree.c (virtual_member): Delete function definition; never used. + * cp-tree.h (virtual_member): Delete decl. + +Fri Jan 19 18:03:14 1996 Mike Stump + + * typeck.c (build_component_ref): Handle getting vbase pointers + out of complex multiple inheritance better. + +Fri Jan 19 16:27:40 1996 Mike Stump + + * typeck.c (build_object_ref): Make sure we use the real type, not + any reference type. + +Fri Jan 19 16:01:47 1996 Mike Stump + + * tree.c (build_exception_variant): Don't create new types if we + don't have to, also build new types on the right obstack. + +Fri Jan 19 14:09:44 1996 Jason Merrill + + * decl.c (store_bindings): Split out from push_to_top_level. + (push_to_top_level): Call it for b->type_shadowed on class binding + levels. + +Fri Jan 19 13:53:14 1996 Mike Stump + + * search.c (expand_upcast_fixups): Fix so that offsets stored in + vbase_offsets are always right. Fixes a problem where virtual base + upcasting and downcasting could be wrong during conversions on this + during virtual function dispatch at ctor/dtor time when dynamic + vtable fixups for deltas are needed. This only sounds easier than + it is. :-) + (fixup_virtual_upcast_offsets): Change to reflect new calling + convention for expand_upcast_fixups. + +Fri Jan 19 12:23:08 1996 Brendan Kehoe + + * decl2.c (grokbitfield): Strip the NOPs from WIDTH before we + check that it's usable as the bitfield width. + +Wed Jan 17 21:22:40 1996 Brendan Kehoe + + * decl2.c (grokfield): Call cplus_decl_attributes with the attrlist. + Pass a null tree to grokdeclarator for its ATTRLIST arg, since it's + only ever used for functions in it. + +Wed Jan 17 12:10:38 1996 Jason Merrill + + * parse.y (qualified_type_name): Use the TYPE_DECL, not the type. + (nested_type): Likewise. + (nested_name_specifier): Use lastiddecl. + + * decl.c (grokdeclarator): Adjust accordingly. + * init.c (expand_member_init): Likewise. + * parse.y (base_class): Likewise. + * typeck2.c (build_functional_cast): Likewise. + + * typeck2.c (build_functional_cast): Fill in name after we've + checked for non-aggr type. + +Wed Jan 17 10:18:01 1996 Mike Stump + + * decl2.c (warn_pointer_arith): Default to on. + +Tue Jan 16 12:45:38 1996 Jason Merrill + + * lex.c (is_rid): New function. + * decl.c (grokdeclarator): Diagnose reserved words used as + declarator-ids. + +Tue Jan 16 11:39:40 1996 Jason Merrill + + * tree.c (get_decl_list): Don't lose cv-quals. + + * decl.c (grokdeclarator): Fix SCOPE_REF handling and diagnose + typespecs used as declarator-ids. + +Tue Jan 16 11:09:42 1996 Mike Stump + + * decl.c (poplevel): When popping a level, don't give a warning for + any subblocks that already exist. + +Tue Jan 16 00:25:33 1996 Jason Merrill + + * typeck.c (build_object_ref): Finish what I started. + + * parse.y (qualified_type_name): Don't check TYPE_BUILT_IN. + + * decl2.c (constructor_name_full): Handle TEMPLATE_TYPE_PARMs. + + * decl.c (grokdeclarator): Also accept TEMPLATE_TYPE_PARM as a + scope. + +Mon Jan 15 16:19:32 1996 Jason Merrill + + * decl.c (xref_tag): Handle passing a type in directly. + + * parse.y (qualified_type_name): Pull out the type. + (nested_type): Likewise. + Take types directly instead of as identifiers. + * call.c (build_scoped_method_call): Take types directly instead of + as identifiers. + * decl.c (xref_basetypes): Likewise. + * init.c (expand_member_init): Likewise. + (build_member_call): Likewise. + (build_offset_ref): Likewise. + * typeck2.c (build_scoped_ref): Likewise, remove bogus code. + * method.c (do_build_assign_ref): Likewise. + * decl.c (grokdeclarator): Handle a type appearing as the + declarator-id for constructors. + * method.c (do_build_copy_constructor): current_base_init_list now + uses the types directly, not their names. + * init.c (sort_base_init): Likewise. + (expand_member_init): Likewise. + * init.c (is_aggr_type): New function, like is_aggr_typedef. + +Mon Jan 15 08:45:01 1996 Jeffrey A Law + + * tree.c (layout_basetypes): Call build_lang_field_decl instead + of build_lang_decl if first arg is a FIELD_DECL. + +Thu Jan 11 14:55:07 1996 Brendan Kehoe + + * decl.c (cp_finish_decl): Only clear TREE_USED if DECL_NAME is + non-empty. + * except.c (expand_start_catch_block): Set TREE_USED to avoid + warnings about the catch handler. + +Mon Jan 8 17:35:12 1996 Jason Merrill + + * typeck.c (build_modify_expr): Use a COMPOUND_EXPR instead of + expand_target_expr. + +Thu Jan 4 12:30:32 1996 Brendan Kehoe + + Fix access control to use trees rather than integers. + * class.c (access_{default, public, protected, private, + default_virtual, public_virtual, private_virtual}_node): Add + definitions. + (init_class_processing): Do creation of those nodes. + * cp-tree.h (access_type): Delete enum decl. + (access_{default, public, protected, private, default_virtual, + public_virtual, private_virtual}_node): Add decls. + (compute_access): Change return type. + * search.c (compute_access): Have tree return type, instead of enum. + (lookup_field): Declare THIS_V and NEW_V to be tree nodes. + * lex.c (real_yylex): Use yylval.ttype for giving the value of the + access_* node for each of RID_{PUBLIC, PRIVATE, PROTECTED}. + * parse.y (VISSPEC): Make ttype rather than itype. + (base_class_access_list): Likewise. + * *.[cy]: Change all refs of `access_public' to `access_public_node', + etc. + * call.c (build_method_call): Make ACCESS be a tree. + * class.c (alter_access, finish_struct_1, filter_struct): Likewise. + * cvt.c (convert_to_aggr): Likewise. + * init.c (build_offset_ref, resolve_offset_ref, build_delete): + Likewise. + * method.c (hack_identifier): Likewise. + * typeck.c (build_component_ref_1, build_component_ref): ): Likewise. + +Thu Jan 4 11:02:20 1996 Mike Stump + + * typeck.c (pointer_int_sum, pointer_diff): Make code agree with C + frontend, and make it more consistent with respect to + warn_pointer_arith. + +Tue Jan 2 00:13:38 1996 Rusty Russell + + * decl.c (pushdecl): Check for duplicate parameter names. + +Wed Jan 3 09:25:48 1996 Mike Stump + + * decl.c (expand_static_init): Call assemble_external for atexit. + +Wed Jan 3 07:55:19 1996 Mike Stump + + * except.c (do_unwind): Remove some generated dead code. + (eh_outer_context): New routine, factor out some common code from + expand_builtin_throw and end_eh_unwinder. Add code to do return + address masking for the PA. + (expand_builtin_throw): Use eh_outer_context instead of open coding + it here. + (end_eh_unwinder): Likewise. + +Tue Jan 2 17:00:56 1996 Mike Stump + + * except.c (expand_throw): Call assemble_external for __empty, if we + use it. + diff --git a/contrib/gcc/cp/ChangeLog-1997 b/contrib/gcc/cp/ChangeLog-1997 new file mode 100644 index 00000000000..8e2c7343428 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1997 @@ -0,0 +1,2607 @@ +Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi + + * call.c (add_builtin_candidate): Add default case in enumeration + switch. + (build_new_op): Likewise. + (convert_like): Likewise. + * cvt.c (build_expr_type_conversion): Likewise. + * tree.c (real_lvalue_p): Likewise. + (lvalue_p): Likewise. + (cp_tree_equal): Likewise. + * typeck.c (comptypes): Likewise. + (build_component_ref): Likewise. + (build_function_call_real): Likewise. + (build_binary_op_nodefault): Likewise. + (build_unary_op): Likewise. + (build_modify_expr): Likewise. + * typeck2.c (initializer_constant_valid_p): Likewise. + +Sun Dec 21 15:59:00 1997 Nick Clifton + + * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas. + +Thu Dec 18 14:51:50 1997 Mark Mitchell + + * pt.c (coerce_template_parms): Make sure to digest_init if + possible. + + * decl.c (duplicate_decls): Make the newdecl virtual if the + olddecl was, just as is done with other attributes of olddecl. + +Thu Dec 18 14:43:19 1997 Jason Merrill + + * typeck.c (unary_complex_lvalue): Ignore op0 when taking the + address of an OFFSET_REF. + + * cp-tree.def: Add AGGR_INIT_EXPR. + * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with + AGGR_INIT_EXPR where appropriate. + * expr.c (cplus_expand_expr): Likewise. Simplify. + + * decl2.c (finish_file): Remove call to register_exception_table. + +Wed Dec 17 17:08:52 1997 Benjamin Kosnik + + * pt.c (instantiate_class_template): Don't do injection when + processing_template_decl is true, as pollutes current_binding_level + for base classes. + +Wed Dec 17 21:17:39 1997 Peter Schmid + + * pt.c (maybe_fold_nontype_arg): Add prototype. + +Tue Dec 16 10:31:20 1997 Jason Merrill + + * tree.c (mapcar): Handle TRY_CATCH_EXPR et al. + * error.c (dump_expr): Likewise. + +Mon Dec 15 12:22:04 1997 Jason Merrill + + * typeck.c (build_function_call_real): Remove "inline called before + definition" pedwarn. + + * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg. + +Sun Dec 14 22:34:20 1997 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's. + + * pt.c (type_unification_real): Change __null to type void* with + a warning. + +Sun Dec 14 20:38:35 1997 Mark Mitchell + + * call.c (implicit_conversion): Don't call + build_user_type_conversion_1 with a NULL expr, since it will + crash. + + * pt.c (unify): Don't try to unify array bounds if either array is + unbounded. + +Fri Dec 12 16:09:14 1997 Jason Merrill + + * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at): + Replace extern decls with casts. + + * decl.c (expand_start_early_try_stmts): Don't mess with a sequence. + Update last_parm_cleanup_insn. + (store_after_parms): Remove. + * cp-tree.h: Adjust. + +Thu Dec 11 22:18:37 1997 Jason Merrill + + * decl2.c (comdat_linkage): Also set DECL_COMDAT. + (finish_file): Check DECL_COMDAT instead of weak|one_only. + (import_export_vtable): Use make_decl_one_only instead of + comdat_linkage for win32 tweak. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + + * decl2.c (finish_file): Lose handling of templates in pending_statics. + +Thu Dec 11 21:12:09 1997 Jason Merrill + + * decl2.c (finish_file): Lose call to expand_builtin_throw. + * except.c (expand_builtin_throw): Remove. + * cp-tree.h: Remove ptr_ptr_type_node. + * decl.c: Likewise. + +Thu Dec 11 20:43:33 1997 Teemu Torma + + * decl.c (ptr_ptr_type_node): Define. + (init_decl_processing): Initialize it. + * cp-tree.h: Declare it. + * exception.cc (__cp_exception_info): Use __get_eh_info. + (__cp_push_exception): Likewise. + (__cp_pop_exception): Likewise. + + From Scott Snyder : + * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of + saved_pc. + (init_exception_processing): Removed saved_pc initialization. + +Wed Dec 10 11:04:45 1997 Jason Merrill + + * pt.c (instantiate_decl): Defer all templates but inline functions. + +Mon Dec 8 23:17:13 1997 Jason Merrill + + * init.c (expand_vec_init): Don't fold a list of parameters. + + * decl.c (copy_args_p): Handle copy elision for types with virtual + bases. + * call.c (build_over_call): Likewise. + +Sun Dec 7 22:38:12 1997 Mark Mitchell + + * pt.c (lookup_template_function): Copy the template arguments, + not just the list containing them, to the permanent obstack. + +Sun Dec 7 15:53:06 1997 Jason Merrill + + * except.c (expand_start_catch_block): suspend_momentary for the + terminate handler. + + * error.c (dump_decl): Handle LOOKUP_EXPR. + +Sun Dec 7 15:45:07 1997 Mark Mitchell + + * rtti.c (build_dynamic_cast): Copy the cast-to type to the + permanent obstack if we are processing a template decl. + * typeck.c (build_static_cast): Likewise. + (build_const_cast): Likewise. + (build_reinterpret_cast): Likewise. + + * pt.c (coerce_template_parms): Coerce some expressions, even + when processing_template_decl. + +Sun Dec 7 01:46:33 1997 Bruno Haible + + * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric + handling of pointer difference expressions. + + * typeck.c (comp_target_types): Comparison of function/method types + is independent of nptrs. + +Sun Dec 7 01:40:27 1997 Mark Mitchell + + * pt.c (tsubst): Avoid creating pointer to reference and + reference to reference types. + +Sat Dec 6 01:29:37 1997 Jason Merrill + + * parse.y (do_id): New nonterminal. + (template_id): Use it. + +Fri Dec 5 01:17:34 1997 Jason Merrill + + * parse.y (template_id): do_identifier for PFUNCNAMEs, too. + * spew.c (yylex): Don't do_identifier here. + * decl2.c (build_expr_from_tree): Revert last change. + + * decl2.c (build_expr_from_tree): Expand the name for a method call. + * parse.y (object_template_id): Don't try to take the DECL_NAME. + +Wed Dec 3 20:02:39 1997 Jason Merrill + + * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for + alloc_expr. + * call.c (build_op_delete_call): Adjust. + + * except.c (expand_end_catch_block): Lose rethrow region. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Don't expand_leftover_cleanups. + +Wed Dec 3 13:24:04 1997 Benjamin Kosnik + + * pt.c (tsubst): Remove tree_cons call (places redundant info into + DECL_TEMPLATE_INSTANTIATION). + +Wed Dec 3 11:44:52 1997 Jason Merrill + + * tree.c (is_overloaded_fn): Handle getting a fn template. + (really_overloaded_fn): Likewise. + * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better. + * pt.c (check_explicit_specialization): Tweak. + (determine_explicit_specialization): Tweak. + + * tree.c, cp-tree.h (get_target_expr): New fn. + +Wed Dec 3 08:47:27 1997 Paul Eggert + + * pt.c (check_explicit_specialization): Fix misspelling in + diagnostic: `preceeded'. + * typeck.c (get_delta_difference): Fix misspelling in diagnostic: + `conversiona'. + +1997-12-02 Mark Mitchell + + * pt.c (determine_explicit_specialization): Avoid an internal + error for bad specializations. + + * method.c (build_overload_value): Handle SCOPE_REF. + +Tue Dec 2 19:18:50 1997 Mike Stump + + * class.c (prepare_fresh_vtable): Enable even more complex MI + vtable names. + +Tue Dec 2 01:37:19 1997 Jason Merrill + + * exception.cc (__check_eh_spec): Optimize a bit. + + * exception.cc (__cp_pop_exception): Lose handler arg. + * except.c (do_pop_exception): Likewise. + (push_eh_cleanup): Let the cleanup mechanism supply the handler. + (expand_end_catch_block): Likewise. + +Fri Nov 28 01:58:14 1997 Jason Merrill + + * pt.c (check_explicit_specialization): Complain about using a + template-id for a non-specialization. + +Fri Nov 28 12:35:19 1997 Scott Christley + + * repo.c: Prototype rindex only if needed. + * xref.c: Likewise. + +Fri Nov 28 01:56:35 1997 Bruno Haible + + * error.c (dump_decl): Handle TEMPLATE_ID_EXPR. + +Thu Nov 27 00:59:46 1997 Jason Merrill + + * typeck.c (build_const_cast): Handle references here instead of + handing off to convert_to_reference. + + * except.c: Lose Unexpected, SetTerminate, SetUnexpected, + TerminateFunctionCall. + (init_exception_processing): Likewise. Terminate et al are now + the fns, not ADDR_EXPRs. + (various): Lose redundant assemble_external calls. + (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/. + + * cp-tree.h (struct lang_decl_flags): Add comdat. + (DECL_COMDAT): New macro. + * decl.c (duplicate_decls): Propagate it. + (cp_finish_decl): Handle it. + * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs. + + * class.c: Remove static pending_hard_virtuals. + (add_virtual_function): Take pointers to pending_virtuals + and pending_hard_virtuals. + (finish_struct_1): Pass them. Declare pending_hard_virtuals. + +Wed Nov 26 20:28:49 1997 Jason Merrill + + * decl2.c (import_export_vtable): If we support one_only but not + weak symbols, mark instantiated template vtables one_only. + (import_export_decl): Likewise for tinfo functions. + (finish_vtable_vardecl): Also write out vtables from explicitly + instantiated template classes. + * pt.c (mark_class_instantiated): Revert last change. + + * except.c (expand_throw): Call mark_used on the destructor. + +Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com) + + * lex.c (lang_init): Enable flag_exceptions by default if no + command line switch was specified. + +1997-11-26 Mark Mitchell + + * pt.c (unify): Handle `void' template parameters in + specializations. + +Wed Nov 26 01:11:24 1997 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle template case here. + (build_dynamic_cast_1): Not here. + + * typeck2.c (digest_init): Make copies where appropriate. + + * decl2.c (delete_sanity): resolve_offset_ref. + + * except.c: Call terminate without caching so many bits. + + * except.c (expand_start_catch_block): Fix catching a reference + to pointer. + +Tue Nov 25 11:28:21 1997 Jason Merrill + + * init.c (build_new): Copy size to the saveable obstack. + + * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the + TRY_CATCH_EXPR for now. + +Mon Nov 24 12:15:55 1997 Jason Merrill + + * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL + has DECL_LANG_SPECIFIC. + + * exception.cc (struct cp_eh_info): Add handlers field. + (__cp_push_exception): Initialize it. + (__cp_pop_exception): Decrement it. Don't pop unless it's 0. + (__throw_bad_exception): Remove. + * except.c (call_eh_info): Add handlers field. + (get_eh_handlers): New fn. + (push_eh_cleanup): Increment handlers. + +Fri Nov 21 12:22:07 1997 Jason Merrill + + * except.c (expand_start_eh_spec): Use the try/catch code. + (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of + doing everything inline. + (init_exception_processing): throw_type_match now takes + const void pointers. + * exception.cc (__check_eh_spec): New fn. + * inc/exception: Neither terminate nor unexpected return. + * decl.c: Make const_ptr_type_node public. + * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly. + + * except.c (expand_start_catch_block): We only need the rethrow + region for non-sjlj exceptions. + (expand_end_catch_block): Likewise. Use outer_context_label_stack. + +Thu Nov 20 14:40:17 1997 Jason Merrill + + * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs. + (various.o): Likewise. + * inc/new: Add placement deletes. Add throw specs for default new. + * new.cc (set_new_handler): Move here from libgcc2. + * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler. + (new): Move from libgcc2. Throw bad_alloc. + * new2.cc: Move the rest of the op news and op deletes from libgcc2. + * decl.c (init_decl_processing): Update exception specs on new and + delete. + + * method.c (build_decl_overload_real): Don't mess with global + placement delete. + + * init.c (build_new): Check for null throw spec, not nothrow_t. + + * decl.c (duplicate_decls): Don't complain about different exceptions + from an internal declaration. + + * call.c (build_op_delete_call): Fix check for member fns again. + + * decl2.c (import_export_decl): Interface hackery affects + virtual synthesized methods. + +Wed Nov 19 18:24:14 1997 Jason Merrill + + * decl.c (start_decl): Don't just complain about a mismatched + scope, fix it. + + * decl.c (make_implicit_typename): Handle case where t is not + actually from context. + * tree.c (get_type_decl): Lose identifier case. + * spew.c (yylex): Lose useless call to identifier_typedecl_value. + * parse.y (nonnested_type): Just use lookup_name. + (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE. + +Wed Nov 19 11:45:07 1997 Michael Tiemann + + * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case + T was built in C language context (for example, by + output_func_start_profiler). + +Wed Nov 19 10:39:27 1997 Jason Merrill + + * decl.c (make_implicit_typename): New fn. + (lookup_name_real): Use it. Use current_class_type as the context. + +Mon Nov 17 23:42:03 1997 Bruno Haible + + * pt.c (do_poplevel): Don't prohibit jumps into this contour. + +Mon Nov 17 02:01:28 1997 Jason Merrill + + * friend.c (do_friend): Warn about non-template friends in templates. + + * call.c (build_op_delete_call): Fix handling of inherited delete. + + * search.c (dfs_record_inheritance): Ignore template type parms. + +Sat Nov 15 00:30:51 1997 Jason Merrill + + * call.c (build_new_op): Fix copy error. + (build_op_new_call): New fn. + (build_op_delete_call): New fn. + * cp-tree.h: Declare them. + * init.c (build_new): Use them. Support placement delete. + (build_x_delete): Use build_op_delete_call. + (build_delete): Likewise. + * decl2.c (delete_sanity): Likewise. + (coerce_delete_type): Don't complain about placement delete. + +Thu Nov 13 01:52:36 1997 Jason Merrill + + * call.c (build_new_function_call): Remove unused 'obj' parm. + * cp-tree.h, typeck.c: Adjust. + + * init.c (build_new): Make the cleanup last longer. + (expand_vec_init): Call do_pending_stack_adjust. + +Wed Nov 12 11:04:33 1997 Jason Merrill + + * pt.c (do_type_instantiation): Fix typo. + (mark_class_instantiated): If we support one_only but not weak + symbols, don't mark this as known. + + * init.c (build_new): Handle vec delete in EH cleanup. + +Wed Nov 12 08:11:55 1997 Benjamin Kosnik + + * call.c (build_method_call): Call complete_type before checking + for destructor. + +Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com) + + * decl.c (add_block_current_level): Delete. + * init.c (build_vec_delete_1): Delete build_block and + add_block_current_level calls. + +Wed Nov 12 00:48:16 1997 Jason Merrill + + * init.c (build_new): Handle freeing allocated memory when the + constructor throws. + + * call.c (build_new_method_call): Fix flags arg. + + * pt.c (do_type_instantiation): Don't try to instantiate + member templates. + (mark_decl_instantiated): If we support one_only but not + weak symbols, mark this one_only. + * decl2.c (import_export_vtable): Don't defer handling of vtables + if MULTIPLE_SYMBOL_SPACES. + +Tue Nov 11 12:02:12 1997 Jason Merrill + + * except.c (expand_end_catch_block): Lose call to __sjpopnthrow. + +Tue Nov 11 02:53:44 1997 Jason Merrill + + * except.c (do_pop_exception): Return a value. + +Mon Nov 10 20:25:31 1997 Jason Merrill + + * call.c (build_new_method_call): Handle getting a + TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field + if we got template parms. + * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR, + not just the args. + * decl2.c (build_expr_from_tree): Tweak last change. + * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE. + (maybe_fold_nontype_arg): Split out from tsubst_copy. + * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR. + +Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij + + * pt.c (tsubst_copy): Handle explicit template arguments in + function calls. + * typeck.c (build_x_function_call): Likewise. + * decl2.c (build_expr_from_tree): Lookup function name if it + hasn't been done. + + * pt.c (tsubst): Instantiate template functions properly when + template parameter does not appear in function arguments and return + type. + (comp_template_args): Handle member templates required by tsubst. + +Mon Nov 10 20:08:38 1997 Jason Merrill + + * decl.c (grokdeclarator): Tweak conditions for pedwarn in + previous change. + +Mon Nov 10 20:08:29 1997 Bruno Haible + + * pt.c (coerce_template_parms): Tweak error message. + + * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a + return type defaults to `int', even if there are storage-class + specifiers. + +Mon Nov 10 03:04:20 1997 Jason Merrill + + Complete nested exception support. + * except.c (do_pop_exception): Split out... + (push_eh_cleanup): From here. Handle the EH region by hand. + (expand_start_catch_block): Add a new level for the catch parm. + Move the rethrow region outside the two cleanup regions. + Protect the initializer for the catch parm with terminate. + (expand_end_catch_block): Likewise. End the region for the eh_cleanup. + * exception.cc (__cp_pop_exception): Now takes two parms. Handle + popping off the middle of the stack. + * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR, + WITH_CLEANUP_EXPR, and UNSAVE_EXPR. + (build_cplus_new): Only wrap CALL_EXPRs. + * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around + the constructor call. + +Sun Nov 9 18:00:26 1997 Richard Kenner + + * Make-lang.in (c++.distdir): Make inc subdirectory. + +Fri Nov 7 11:57:28 1997 Jason Merrill + + * decl2.c (finish_file): Put back some code. + +Thu Nov 6 11:28:14 1997 Jason Merrill + + * decl2.c (finish_file): Remove redundant code. + * method.c (emit_thunk): Don't let the backend defer generic thunks. + +Wed Nov 5 23:52:50 1997 Jason Merrill + + * except.c (call_eh_info): Split out... + (push_eh_info): From here. + (expand_builtin_throw): Use it. + (expand_start_catch_block): Move region start back. + +Tue Nov 4 13:45:10 1997 Doug Evans + + * lex.c (MULTIBYTE_CHARS): #undef if cross compiling. + (real_yylex): Record wide strings using target endianness, not host. + +1997-11-03 Brendan Kehoe + + * repo.c (rindex): Add decl unconditionally. + (get_base_filename, open_repo_file): Don't cast rindex. + * xref.c (rindex): Add decl unconditionally. + (index): Remove unused decl. + (open_xref_file): Don't cast rindex. + +Sun Nov 2 15:04:12 1997 Jason Merrill + + * class.c (build_vbase_path): Propagate the result type properly. + +1997-11-01 Brendan Kehoe + + * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace + remaining use of saved_throw_type with a call to get_eh_type. + +1997-10-31 Brendan Kehoe + + * lex.c (FILE_NAME_NONDIRECTORY): Delete macro. + (file_name_nondirectory): New function, doing the same as the macro. + (set_typedecl_interface_info): Use it instead of the macro. + (check_newline): Likewise. + (handle_cp_pragma): Likewise. + + * repo.c (get_base_filename): Cast result of rindex to char*. + (open_repo_file): Likewise. + * xref.c (open_xref_file): Likewise. + * error.c (dump_char): Make its arg int, not char. + + * except.c (push_eh_info): Pass the number of fields - 1 down, not + the exact number of fields. + +Fri Oct 31 01:47:57 1997 Jason Merrill + + Support for nested exceptions. + * tinfo2.cc (__is_pointer): New fn. + * exception.cc (struct cp_eh_info): Define. + (__cp_exception_info, __uncatch_exception): New fns. + (__cp_push_exception, __cp_pop_exception): New fns. + * except.c: Lose saved_throw_{type,value,cleanup,in_catch}. + Lose empty_fndecl. + (init_exception_processing): Likewise. __eh_pc is now external. + (push_eh_info): New fn. + (get_eh_{info,value,type,caught}): New fns. + (push_eh_cleanup): Just call __cp_pop_exception. + (expand_start_catch_block): Use push_eh_info. Start the eh region + sooner. + (expand_end_eh_spec): Use push_eh_info. + (expand_throw): Call __cp_push_exception to set up the exception info. + Just pass the destructor or 0 as the cleanup. Call __uncatch_exception + when we rethrow. + (expand_builtin_throw): Don't refer to empty_fndecl. + +Thu Oct 23 02:01:30 1997 Jason Merrill + + * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl. + +1997-10-22 Brendan Kehoe + + * method.c (build_template_parm_names, build_decl_overload_real): + Add static to definitions. + * pt.c (add_to_template_args, note_template_header, + processing_explicit_specialization, type_unification_real): Likewise. + ({determine,check}_explicit_specialization): Use a single string for + error messages. + +Mon Oct 20 12:06:34 1997 Jason Merrill + + * except.c (expand_exception_blocks): Call do_pending_stack_adjust. + (expand_end_catch_block): Likewise. + (expand_end_eh_spec): Likewise. + +Mon Oct 20 11:44:20 1997 Mark Mitchell + + * decl.c (duplicate_decls): Handle template specializations + correctly. + * error.c (dump_function_name): Fix printing of specializations of + member functions that are not member templates. + * cp-tree.h (processing_specialization): Make global. + * pt.c (processing_specialization): Likewise. + * lex.c (cons_up_default_function): Save and restore + processing_specialization to avoid confusion. + +Mon Oct 20 10:52:22 1997 Jason Merrill + + * decl.c (init_decl_processing): Give null_node unknown* type. + * typeck.c (comp_target_types): Handle UNKNOWN_TYPE. + (common_type): Likewise. + * error.c (args_as_string): Recognize null_node. + +Sun Oct 19 09:13:01 1997 Richard Kenner + + * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR. + (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR. + + * decl.c (init_decl_processing): Call using_eh_for_cleanups. + + * Make-lang.in (g++): Include prefix.o. + +Thu Oct 16 15:31:09 1997 Judy Goldberg + + * pt.c (determine_explicit_specialization): Initialize "dummy" + to keep Purify quiet. + +Thu Oct 16 00:14:48 1997 Jason Merrill + + * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here. + (build_overload_int): Not here. + +Wed Oct 15 00:35:28 1997 Mike Stump + + * class.c (build_type_pathname): Remove. + (prepare_fresh_vtable): Fix problem with complex MI vtable names. + +1997-10-14 Brendan Kehoe + + * parse.y (unary_expr): Give a pedwarn if someone tries to use the + &&label GNU extension. + +Tue Oct 14 12:01:00 1997 Mark Mitchell + + * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it, + so as to avoid incorrect manglings. + * method.c (build_decl_overload_real): Don't mangle return types + for constructors. + +Tue Oct 14 11:46:14 1997 Jason Merrill + + * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec, + scratch_tree_cons): Define as macros for now. + * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c, + lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c, + typeck2.c: Use them and the expression_obstack variants. + +Mon Oct 13 17:41:26 1997 Benjamin Kosnik + + * decl.c (store_return_init): Allow classes with explicit ctors to + be used with the named return values extension. + +Fri Oct 10 12:21:11 1997 Jason Merrill + + * pt.c (instantiate_decl): Fix previous change. + +Thu Oct 9 12:08:21 1997 Jason Merrill + + * pt.c (tsubst): Fix thinko. + (instantiate_decl): Really use the original template. + + * call.c (build_new_method_call): Use simple constructor_name for + error messages. + +Wed Oct 8 22:44:42 1997 Jeffrey A Law + + * method.c (build_underscore_int): Don't use ANSI specific + features. + +Wed Oct 8 00:18:22 1997 Jason Merrill + + * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN + for our key method; it might have been inlined by -O3. + +Tue Oct 7 23:00:12 1997 Mark Mitchell + + * decl.c (make_typename_type): Do not try to call lookup_field for + non-aggregate types. + +Tue Oct 7 22:52:10 1997 Jason Merrill + + * typeck.c (build_reinterpret_cast): Tweak. + +Tue Oct 7 22:45:31 1997 Alexandre Oliva + + * typeck.c (build_reinterpret_cast): Converting a void pointer + to function pointer with a reinterpret_cast produces a warning + if -pedantic is issued. + +Tue Oct 7 22:43:43 1997 Bruno Haible + + * typeck.c (c_expand_return): Don't warn about returning a + reference-type variable as a reference. + +Tue Oct 7 21:11:22 1997 Jason Merrill + + * method.c (build_static_name): Fix typo. + +1997-10-07 Brendan Kehoe + + * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on + OLDDECL before we try to do DECL_USE_TEMPLATE. + +Tue Oct 7 00:48:36 1997 Jason Merrill + + * decl.c (duplicate_decls): Don't warn about template instances. + + * typeck.c (mark_addressable): Lose ancient code that unsets + DECL_EXTERNAL. + + * pt.c (do_decl_instantiation): Lose support for instantiating + non-templates. + + * call.c (build_new_function_call): Fix handling of null explicit + template args. + (build_new_method_call): Likewise. + +Mon Oct 6 23:44:34 1997 Mark Mitchell + + * method.c (build_underscore_int): Fix typo. + +1997-10-06 Brendan Kehoe + + * tree.c (print_lang_statistics): #if 0 call to + print_inline_obstack_statistics until its definition is checked in. + +Mon Oct 6 09:27:29 1997 Jason Merrill + + * decl2.c (finish_file): Move dump_tree_statistics to end. + + * pt.c (instantiate_decl): Look for the original template. + (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations + of member templates. + +Wed Oct 1 08:41:38 1997 Jason Merrill + + * Makefile.in (g++FAQ.*): New rules. + (CONFLICTS): Update. + * g++FAQ.texi: Moved from libg++. + + * parse.y (PFUNCNAME): Only specify the type once. + +1997-10-01 Brendan Kehoe + + * lex.c (real_yylex): Clean up the code to fully behave the way + the c-lex.c parser does for complex and real numbers. + +Tue Sep 30 08:51:36 1997 Jason Merrill + + * method.c (build_decl_overload_real): Reformat. + +Tue Sep 30 00:18:26 1997 Jason Merrill + + * method.c (synthesize_method): If at_eof, determine our linkage. + +1997-09-29 Paul Eggert + + * lex.c (real_yylex): Treat `$' just like `_', except issue a + diagnostic if !dollars_in_ident or if pedantic. + + * lang-specs.h (@c++): -ansi no longer implies -$. + + * decl2.c (lang_decode_option): + -traditional and -ansi now do not mess with + dollars_in_ident. + +Mon Sep 29 19:57:51 1997 H.J. Lu + + * Makefile.in (parse.o, decl.o): Also depend on + $(srcdir)/../except.h $(srcdir)/../output.h. + (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h + $(srcdir)/../except.h $(srcdir)/../output.h. + (typeck.o, init.o): Also depend on $(srcdir)/../expr.h + ../insn-codes.h. + + * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping. + + * expr.c (cplus_expand_expr): Make it static. + + * decl2.c, init.c, typeck.c: Include "expr.h". + (expand_expr): Use proper values when calling the function. + +Mon Sep 29 11:05:54 1997 Alexandre Oliva + + * lang-options.h: New -Wold-style-cast flag. + * cp-tree.h (warn_old_style_cast): New variable. + * decl2.c (warn_old_style_cast): Likewise. + (lang_decode_option): Support -Wold-style-cast. + (reparse_absdcl_as_casts): Produce old-style-cast warning. + +Mon Sep 29 09:20:53 1997 Benjamin Kosnik + + * decl.c (cp_finish_decl): Allow expand_aggr_init to set + TREE_USED, reset value based on already_used. + + * init.c (expand_member_init): Revert change. + +Mon Sep 29 08:57:53 1997 Jason Merrill + + * cp-tree.h, decl.c, decl2.c, pt.c: + Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public. + + * decl2.c (lang_decode_option): Add missing ;. + +Sat Sep 27 16:22:48 1997 Jason Merrill + + * friend.c (do_friend): Disable injection for all template-derived + decls. + * decl2.c (lang_decode_option): Handle -fguiding-decls. + * parse.y (notype_template_declarator): New nonterminal. + (direct_notype_declarator): Use it. + (complex_direct_notype_declarator): Likewise. + (object_template_id): Accept any kind of identifier after TEMPLATE. + (notype_qualified_id): Don't add template declarators here. + +Sat Sep 27 16:21:58 1997 Mark Mitchell + + * call.c (add_template_candidate): Add explicit_targs parameter. + (build_scoped_method_call): Use it. + (build_overload_call_real): Likewise. + (build_user_type_conversion_1): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + (build_new_function_call): Handle TEMPLATE_ID_EXPR. + (build_new_method_call): Likewise. + + * class.c (finish_struct_methods): Add specialization pass to + determine which methods were specializing which other methods. + (instantiate_type): Handle TEMPLATE_ID_EXPR. + + * cp-tree.def (TEMPLATE_ID_EXPR): New tree code. + + * cp-tree.h (name_mangling_version): New variable. + (flag_guiding_decls): Likewise. + (build_template_decl_overload): New function. + (begin_specialization): Likewise. + (reset_specialization): Likewise. + (end_specialization): Likewise. + (determine_explicit_specialization): Likewise. + (check_explicit_specialization): Likewise. + (lookup_template_function): Likewise. + (fn_type_unification): Add explicit_targs parameter. + (type_unification): Likewise. + + * decl.c (duplicate_decls): Add smarts for explicit + specializations. + (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function + specializations. + (grokfndecl): Call check_explicit_specialization. + + * decl2.c (lang_decode_option): Handle -fname-mangling-version. + (build_expr_from_tree): Handle TEMPLATE_ID_EXPR. + (check_classfn): Handle specializations. + + * error.c (dump_function_name): Print specialization arguments. + + * friend.c (do_friend): Don't call pushdecl for template + instantiations. + + * init.c (build_member_call): Handle TEMPLATE_ID_EXPR. + + * lang-options.h: Add -fname-mangling-version, -fguiding-decls, + and -fno-guiding-decls. + + * lex.c (identifier_type): Return PFUNCNAME for template function + names. + + * method.c (build_decl_overload_real): New function. + (build_template_parm_names): New function. + (build_overload_identifier): Use it. + (build_underscore_int): New function. + (build_overload_int): Use it. Add levels for template + parameters. + (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs. + (build_overload_nested_names): Handle template type parameters. + (build_template_decl_overload): New function. + + * parse.y (YYSTYPE): New ntype member. + (nested_name_specifier): Use it. + (nested_name_specifier_1): Likewise. + (PFUNCNAME): New token. + (template_id, object_template_id): New non-terminals. + (template_parm_list): Note specializations. + (template_def): Likewise. + (structsp): Likewise. + (fn.def2): Handle member template specializations. + (component_decl_1): Likewise. + (direct_notype_declarator): Handle template-ids. + (component_decl_1): Likewise. + (direct_notype_declarator): Handle template-ids. + (primary): Handle TEMPLATE_ID_EXPR, and template-ids. + + * pt.c (processing_specializations): New variable. + (template_header_count): Likewise. + (type_unification_real): New function. + (processing_explicit_specialization): Likewise. + (note_template_header): Likewise. + (is_member_template): Handle specializations. + (end_template_decl): Call reset_specialization. + (push_template_decl): Handle member template specializations. + (tsubst): Likewise. + (tsubst_copy): Handle TEMPLATE_ID_EXPR. + (instantiate_template): Handle specializations. + (instantiate_decl): Likewise. + (fn_type_unification): Handle explicit_targs. + (type_unification): Likewise. Allow incomplete unification + without an error message, if allow_incomplete. + (get_bindings): Use new calling sequence for fn_type_unification. + + * spew.c (yylex): Handle PFUNCNAME. + + * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR. + (really_overloaded_fn): Likewise. + (get_first_fn): Handle function templates. + + * typeck.c (build_x_function_call): Use really_overloaded_fn. + Handle TEMPLATE_ID_EXPR. + (build_x_unary_op): Likewise. + (build_unary_op): Likewise. + (mark_addressable): Templates whose address is taken are marked + as used. + +1997-09-25 Andreas Schwab + + * decl.c (init_decl_processing): Declare __builtin_constant_p as + accepting any kind of type, not only int. + +Fri Sep 26 00:22:56 1997 Jason Merrill + + * search.c (get_matching_virtual): Notice virtual bases when sorrying + about covariant returns. + + * parse.y (member_init): Also imply typename here. Remove ancient + extension for initializing base members. + +Thu Sep 25 11:11:13 1997 Jason Merrill + + Handle multi-level typenames and implicit typename in base list. + * parse.y (typename_sub{,[0-2]}): New rules. + (structsp, rule TYPENAME_KEYWORD): Use typename_sub. + (nonnested_type): New rule. + (complete_type_name): Use it. + (base_class.1): Use typename_sub and nonnested_type. + (nested_name_specifier): Don't elide std:: here. + * decl.c (make_typename_type): Handle getting a type for NAME. + (lookup_name_real): Turn std:: into :: here. + + Rvalue conversions were removed in London. + * call.c (is_subseq): Don't consider lvalue transformations. + (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK. + (joust): Re-enable ?: kludge. + +1997-09-22 Brendan Kehoe + + * decl.c (start_function): Up warning of no return type to be a + pedwarn. + +Mon Sep 22 14:15:34 1997 Benjamin Kosnik + + * init.c (expand_member_init): Don't set TREE_USED. + * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED + set,don't clear TREE_USED wholesale. + +Sat Sep 20 15:31:00 1997 Jason Merrill + + * call.c (build_over_call): Do require_complete_type before + build_cplus_new. + +Thu Sep 18 16:47:52 1997 Jason Merrill + + * search.c (lookup_field): Call complete_type in all cases. + + * decl.c (finish_function): Just warn about flowing off the end. + +Wed Sep 17 10:31:25 1997 Jason Merrill + + * decl.c (grokparms): Don't bash a permanent list node if we're + in a function. + +1997-09-17 Brendan Kehoe + + * Makefile.in (CONFLICTS): Fix s/r conflict count to 18. + +Tue Sep 16 14:06:56 1997 Jason Merrill + + * call.c (build_new_op): Give better error for syntactically + correct, but semantically invalid, use of undeclared template. + + * call.c (compare_qual): Handle pmfs. + + * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn + after the exception spec. + +Mon Sep 15 11:52:13 1997 Jason Merrill + + * call.c (null_ptr_cst_p): Integer type, not integral type. + + * call.c (joust): Disable warnings until they can be moved to the + right place. + +Fri Sep 12 16:11:13 1997 Per Bothner + + * Makefile.in, config-lang.in: Convert to autoconf. + +Thu Sep 11 17:14:55 1997 Jason Merrill + + * decl.c (lookup_name_real): Add implicit 'typename' to types from + base classes. + + * pt.c (most_specialized_class): Fix typo. + (tsubst): Move constant folding to TREE_VEC case. + +Thu Sep 11 10:08:45 1997 Mark Mitchell + + * pt.c (do_poplevel): Don't warn about unused local variables + while processing_template_decl since we don't always know whether + or not they will need constructing/destructing. + + * pt.c (uses_template_parms): Check the values of an enumeration + type to make sure they don't depend on template parms. + + * decl.c (make_typename_type): Don't lookup the field if the + context uses template parms, even if we're not + processing_template_decl at the moment. + + * pt.c (coerce_template_parms): Avoid looking at the + TYPE_LANG_DECL portion of a typename type, since there won't be + one. + (tsubst): Do constant folding as necessary to make sure that + arguments passed to lookup_template_class really are constants. + +Wed Sep 10 16:39:26 1997 Jim Wilson + + * Make-lang.in (LN, LN_S): New macros, use where appropriate. + +Wed Sep 10 11:21:55 1997 Jason Merrill + + * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO. + * decl2.c (finish_file): Only register exception tables if we + need to. + + * decl.c (init_decl_processing): Add __builtin_[fs]p. + +Tue Sep 9 19:49:38 1997 Jason Merrill + + * pt.c (unify): Just return 0 for a TYPENAME_TYPE. + +Tue Sep 9 17:57:25 1997 Mark Mitchell + + * error.c (dump_decl): Avoid crashing when presented with a + uninitialized constant, as can occur with a template parameter. + (dump_expr): Make sure that there are enough levels of + current_template_parms before we start diving through them. + +1997-09-09 Brendan Kehoe + + * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to + c-typeck.c. + +Tue Sep 9 09:36:39 1997 Benjamin Kosnik + + * except.c (expand_throw): Call build_delete for all + exception types, not just objects with destructors. + +Mon Sep 8 02:33:20 1997 Jody Goldberg + + * decl.c (current_local_enum): Remove static. + * pt.c (tsubst_enum): Save and restore value of current_local_enum + in case template is expanded in enum decl. + (instantiate_class_template): Use new tsubst_enum signature. + (tsubst_expr): Likewise. + +Mon Sep 8 01:21:43 1997 Mark Mitchell + + * pt.c (begin_member_template_processing): Take a function as + argument, not a set of template arguments. Use the template + parameters, rather than the arguments. Handle non-type parameters + correctly. Push a binding level for the parameters so that multiple + member templates using the same parameter names can be declared. + (end_member_template_processing): Pop the binding level. + (push_template_decl): Mark member templates as static when + appropriate. + + * lex.c (do_pending_inlines): Pass the function, not its template + arguments, to begin_member_template_processing. + (process_next_inline): Likewise. + (do_pending_defargs): Likewise. + + * error.c (dump_expr): Obtain the correct declaration for a + TEMPLATE_CONST_PARM. + + * call.c (add_template_conv_candidate): New function. + (build_object_call): Handle member templates, as done in the other + build_ functions. + +Sat Sep 6 10:20:27 1997 Mark Mitchell + + * decl.c (replace_defag): Undo previous change. + * lex.c (do_pending_defargs): Deal with member templates. + + * pt.c (is_member_template): Avoid crashing when passed a + non-function argument. + +Fri Sep 5 17:27:38 1997 Jason Merrill + + * class.c (grow_method): Remove check for redeclaration. + +Fri Sep 5 01:37:17 1997 Mark Mitchell + + * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro. + (DECL_INNERMOST_TEMPLATE_PARMS): Likewise. + (PRIMARY_TEMPLATE_P): Use it. + * call.c (build_overload_call_real): Use it. + * class.c (instantiate_type): Likewise. + * decl.c (decls_match): Likewise. + * method.c (build_overload_identifier): Likewise. + * pt.c (push_template_decl): Likewise. + (classtype_mangled_name): Likewise. + (lookup_template_class): Likewise. + + * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to + DECL_NTPARMS to conform to usage elsewhere. + * call.c (add_template_candidate): Likewise. + * class.c (instantiate_type): Likewise. + * pt.c (instantiate_template): Likewise. + (get_bindings): Likewise. + + * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of + is_member_template. + + * pt.c (unify): Undo changes to allow multiple levels of template + parameters. + (type_unification): Likewise. + (fn_type_unification): Likewise. + (get_class_bindings): Likewise. + * cp-tree.h (Likewise). + + * decl.c (replace_defarg): Check that the type of the default + parameter does not invlove a template type before complaining + about the initialization. + + * error.c (dump_expr): Deal with template constant parameters in + member templates correctly. + + * pt.c (is_member_template): Deal with class specializations + correctly. + (tsubst): Handle "partial instantiation" of member templates + correctly. + +Wed Sep 3 12:30:24 1997 Mark Mitchell + + * pt.c (type_unification): Change calling sequence to allow for + multiple levels of template parameters. + (tsubst_expr): Likewise. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (instantiate_template): Likewise. + (unify): Likewise. + * call.c (build_overload_call_real): Use it. + (add_builtin_candidate): Use it. + (build_new_method_call): Use it. + * class.c (instantiate_type): Use it. + * decl.c (grokdeclarator): Use it. + * decl2.c (finish_file): Use it. + * method.c (build_overload_identifier): Use it. + + * call.c (add_template_candidate): Add additional parameter for + the function return type. Call fn_type_unification istead of + type_unification. + (build_user_type_conversion_1): Handle member templates. + (build_new_function_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + + * class.c (grow_method): Don't give an error message indicating + that two member templates with the same name are ambiguous. + (finish_struct): Treat member template functions just like member + functions. + + * cp-tree.h (check_member_template): Add declaration. + (begin_member_template_processing): Likewise. + (end_member_template_processing): Likewise. + (fn_type_unification): Likewise. + (is_member_template): Likewise. + (tsubst): Change prototype. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (instantiate_template): Likewise. + (get_bindings): Likewise. + + * decl.c (decls_match): Handle multiple levels of template + parameters. + (pushdecl): Handle template type params just like other type + declarations. + (push_class_level_binding): Return immediately if the + class_binding_level is NULL. + (grokfndecl): If check_classfn() returns a member_template, use + the result of the template, not the template itself. + + * decl2.c (check_member_template): New function. Check to see + that the entity declared to be a member template can be one. + (check_classfn): Allow redeclaration of member template functions + with different types; the new functions can be specializations or + explicit instantiations. + + * error.c (dump_decl): Handle multiple levels of template + parameters. + (dump_function_decl): Update to handle function templates. + + * lex.c (do_pending_inlines): Set up template parameter context + for member templates. + (process_next_inline): Likewise. + + * method.c (build_overload_identifier): Adjust for multiple levels + of template parameters. + + * parse.y (fn.def2): Add member templates. + (component_decl_1): Likewise. + + * pt.c (begin_member_template_processing): New function. + (end_member_template_processing): Likewise. + (is_member_template): Likewise. + (fn_type_unification): Likewise. + (current_template_parms): Return a vector of all the template + parms, not just the innermost level of parms. + (push_template_decl): Deal with the possibility of member + templates. + (lookup_template_class): Likewise. + (uses_template_parms): Likewise. + (tsubst): Modify processing to TEMPLATE_TYPE_PARM and + TEMPLATE_CONST_PARM to deal with multiple levels of template + arguments. Add processing of TEMPLATE_DECL to produce new + TEMPLATE_DECLs from old ones. + (do_decl_instantiation): Handle member templates. + + * search.c (lookup_fnfields_1): Handle member template conversion + operators. + + * tree.c (cp_tree_equal): Check the levels, as well as the + indices, of TEMPLATE_CONST_PARMs. + + * typeck.c (comptypes): Check the levels, as well as the indices, + fo TEMPLATE_TYPE_PARMs. + (build_x_function_call): Treat member templates like member + functions. + +Wed Sep 3 11:09:25 1997 Jason Merrill + + * typeck.c (c_expand_return): Always convert_for_initialization + before checking for returning a pointer to local. + + * pt.c (type_unification): If strict and the function parm doesn't + use template parms, just compare types. + +Wed Sep 3 10:35:49 1997 Klaus Espenlaub + + * method.c (build_overloaded_value): Replace direct call + to the floating point emulator with REAL_VALUE_TO_DECIMAL macro. + +Wed Sep 3 00:02:53 1997 Jason Merrill + + * typeck.c (convert_arguments): Don't arbitrarily choose the first + of a set of overloaded functions. + +Tue Sep 2 12:09:13 1997 Jason Merrill + + * lex.c (real_yylex): Don't elide __FUNCTION__. + + * method.c (build_overload_value): Add in_template parm. + (build_overload_int): Likewise. + (build_overload_identifier): Pass it. + + * decl.c (duplicate_decls): Don't bash a previous template + definition with a redeclaration. + + * pt.c (unify): float doesn't match double. + + * pt.c (do_type_instantiation): Handle getting a _TYPE or a + TYPE_DECL. Handle getting non-template types. + * parse.y (explicit_instantiation): Use typespec instead of + aggr template_type. + +Tue Sep 2 10:27:08 1997 Richard Henderson + + * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings. + +Mon Sep 1 13:19:04 1997 Eugene Mamchits + + * call.c (add_builtin_candidate): Add missing TREE_TYPE. + (compare_ics): Likewise. + +Mon Sep 1 13:19:04 1997 Jason Merrill + + * call.c (joust): Warn about choosing one conversion op over + another because of 'this' argument when the other return type is + better. + (source_type): New fn. + + * call.c (build_new_op): Strip leading REF_BIND from first operand + to builtin operator. + + * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we + use its RTL. + +Thu Aug 28 09:45:23 1997 Jason Merrill + + * call.c (null_ptr_cst_p): Remove support for (void*)0. + +Wed Aug 27 02:03:34 1997 Jeffrey A Law + + * typeck.c (expand_target_expr): Make definition match declaration. + + * class.c (get_basefndecls): Make definition match declaration. + +Mon Aug 25 14:30:02 1997 Jason Merrill + + * input.c (sub_getch): Eventually give up and release the input file. + + * decl.c (cp_finish_decl): If #p i/i, put inline statics in the + right place. + + * call.c (joust): Tweak message. + +Sat Aug 23 18:02:59 1997 Mark Mitchell + + * error.c (type_as_string): Put const/volatile on template type + parameters where appropriate. + +Sat Aug 23 17:47:22 1997 Jeffrey A Law + + * call.c (strictly_better): Make arguments unsigned ints. + +Thu Aug 21 18:48:44 1997 Jason Merrill + + * lex.c (real_yylex): Refer to __complex instead of complex. + +Thu Aug 21 22:25:46 1997 J"orn Rennecke + + * lex.c (real_yylex): Don't use getc directly. + +Wed Aug 20 17:25:08 1997 Jason Merrill + + * call.c (is_subseq): Don't try to be clever. + +Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * parse.y, pt.c: Include "except.h". + * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c, + error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c, + lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c, + sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish + prototyping. + +Wed Aug 20 01:34:40 1997 Jason Merrill + + * decl2.c (mark_vtable_entries): Instead of replacing pure + virtuals with a reference to __pure_virtual, copy the decl and + change the RTL. + +Tue Aug 19 02:26:07 1997 Jason Merrill + + * pt.c (lookup_nested_type_by_name): Handle typedef wierdness. + + * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com. + + * pt.c (instantiate_class_template): Call repo_template_used + before finish_prevtable_vardecl. + + * call.c (is_subseq): New fn. + (compare_ics): Use it. + + * repo.c (finish_repo): Don't crash on no args. + + * parse.y (named_complex_class_head_sans_basetype): Handle + explicit global scope. + * decl2.c (handle_class_head): New fn. + + * pt.c (unify): Add CONST_DECL case. + +Thu Aug 14 10:05:13 1997 Brendan Kehoe + + * rtti.c (permanent_obstack): Fix decl to not be a pointer. + + * cp-tree.h (report_type_mismatch): Add prototype. + * call.c (build_overload_call_real): Remove erroneous fourth + argument to report_type_mismatch. + (build_user_type_conversion_1): Remove erroneous second arg to + tourney. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + +Wed Aug 13 19:19:25 1997 Jason Merrill + + * error.c (dump_decl): Don't bother processing a function with no + DECL_LANG_SPECIFIC. + + * method.c (emit_thunk): Call init_function_start in the macro case. + +Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not + defined and used to set flag_vtable_thunks. + +Tue Aug 12 20:13:57 1997 Jason Merrill + + * parse.y: Don't clear the inlines from their obstack until they've + all been processed. + + * decl.c (duplicate_decls): Don't complain about exception + specification mismatch if flag_exceptions is off. + +Mon Aug 11 15:01:56 1997 Marc Lehmann + + * Make-lang.in (c++.distclean): Remove g++.c on make distclean. + +Sun Aug 10 12:06:09 1997 Paul Eggert + + * cp-tree.h: Replace STDIO_PROTO with PROTO in include files. + * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c: + Include before include files that formerly used STDIO_PROTO. + + * decl.c, g++spec.c, lex.c, method.c, repo.c: + Include "config.h" first, as per autoconf manual. + +Fri Aug 8 11:47:48 1997 Jason Merrill + + * decl.c (duplicate_decls): Tweak wording. + * lex.c (do_pending_defargs): Don't die if we see a default arg + that isn't a DEFAULT_ARG. + * error.c (dump_expr): Handle DEFAULT_ARG. + + * decl2.c (lang_decode_option): Handle -fhandle-exceptions. + * lang-options.h: Add -fhandle-exceptions. + + * class.c (build_vtable): Vtables are artificial. + (prepare_fresh_vtable): Likewise. + +Wed Aug 6 11:02:36 1997 Jason Merrill + + * cvt.c (ocp_convert): After converting to the target type, set + LOOKUP_NO_CONVERSION. + + * call.c (joust): Warn about potentially confusing promotion rules + with -Wsign-promo. + * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo. + +Tue Aug 5 15:15:07 1997 Michael Meissner + + * exception.cc: Declare __terminate_func with noreturn attribute. + +Fri Aug 1 03:18:15 1997 Jason Merrill + + * parse.y: Break out eat_saved_input, handle errors. + (function_try_block): Use compstmt instead of compstmt_or_error. + +Thu Jul 31 17:14:04 1997 Jason Merrill + + * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE. + +Fri Jul 4 01:45:16 1997 Andreas Schwab + + * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for + existence of cc1plus check whether $(LANGUAGES) contains C++. + +Wed Jul 30 13:04:21 1997 Andreas Schwab + + * method.c (do_build_copy_constructor): When copying an anonymous + union member loop around to handle nested anonymous unions. Use + the offset of the member relative to the outer structure, not the + union. + +Tue Jul 29 21:17:29 1997 Jason Merrill + + * call.c (resolve_args): New fn. + (build_new_function_call): Use it. + (build_object_call): Likewise. + (build_new_method_call): Likewise. + +Mon Jul 28 16:02:36 1997 Jason Merrill + + * call.c (build_over_call): tsubst all default parms from templates. + +Wed Jul 23 13:36:25 1997 Jason Merrill + + * decl.c (struct cp_function): Add static_labelno. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + +Tue Jul 22 14:43:29 1997 Jason Merrill + + * typeck.c (build_component_ref_1): Convert from reference. + +Tue Jul 22 11:06:23 1997 Brendan Kehoe + + * parse.y (current_declspecs, prefix_attributes): Initialize to + NULL_TREE. + + * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil + before we try to force it to be a TREE_LIST. + (decl): Make sure $1.t is non-nil. + +Sun Jul 20 11:53:07 1997 Jason Merrill + + * pt.c (uses_template_parms): Handle template first-parse codes. + + * decl.c (cp_finish_decl): Only warn about user-defined statics. + +Fri Jul 18 17:56:08 1997 Jason Merrill + + * pt.c (unify): Handle BOOLEAN_TYPE. + + * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE. + * pt.c (tsubst): Don't set it. + * call.c (build_over_call): Use uses_template_parms. + +Thu Jul 17 18:06:30 1997 Jason Merrill + + * method.c (build_overload_nested_name): Use static_labelno + instead of var_labelno. + (build_qualified_name): New fn. + (build_overload_name): Split out from here. + (build_static_name): Use build_qualified_name. + * decl.c (cp_finish_decl): Statics in extern inline functions + have comdat linkage. + (start_function): Initialize static_labelno. + +Thu Jul 17 11:20:17 1997 Benjamin Kosnik + + * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy + before "all member functions in class [] are private". + +Wed Jul 16 23:47:08 1997 Jason Merrill + + * lex.c (do_scoped_id): convert_from_reference. + * init.c (build_offset_ref): Likewise. + +Wed Jul 16 12:34:29 1997 Benjamin Kosnik + + * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list. + +Mon Jul 14 03:23:46 1997 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Promote index + before saving it. + +Sun Jul 13 00:11:52 1997 Jason Merrill + + * tree.c (layout_basetypes): Move non-virtual destructor warning. + * decl.c (xref_basetypes): Remove non-virtual destructor warning. + +Sat Jul 12 12:47:12 1997 Jason Merrill + + * decl.c (grokdeclarator): Call add_defarg_fn for the function + type, too. + * lex.c (add_defarg_fn): Adjust. + (do_pending_defargs): Adjust. Don't skip the first parm. + +Fri Jul 11 01:39:50 1997 Jason Merrill + + * decl.c (build_enumerator): Global enumerators are also readonly. + + * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast. + (build_dynamic_cast): Call it and convert_from_reference. + + * lex.c (add_defarg_fn): New fn. + (snarf_defarg): Don't add to defarg_types. + (do_pending_defargs): Lose defarg_types. All fns we process now + have defargs. + * decl.c (grokfndecl): Call add_defarg_fn. + + * Makefile.in (CONFLICTS): Expect 18 s/r conflicts. + * cp-tree.def: Add DEFAULT_ARG. + * spew.c (yylex): Call snarf_defarg as appropriate. + * parse.y: New tokens DEFARG and DEFARG_MARKER. + (defarg_again, pending_defargs, defarg, defarg1): New rules. + (structsp): Use pending_defargs. + (parms, full_parm): Use defarg. + * lex.c (init_lex): Initialize inline_text_firstobj. + (do_pending_inlines): Never pass the obstack to feed_input. + (process_next_inline): Call end_input instead of restore_pending_input. + (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs, + finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns. + * input.c (end_input): New fn. + (sub_getch): At the end of some fed input, just keep returning EOF + until someone calls end_input. + Remove 'obstack' field from struct input_source. + * decl.c (grokparms): Handle DEFAULT_ARG. + (replace_defarg): New fn. + * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros. + +Wed Jul 9 13:44:12 1997 Jason Merrill + + * call.c (implicit_conversion): If nothing else works, try binding + an rvalue to a reference. + +Wed Jul 9 13:04:38 1997 Geoffrey Noer + + * decl.c (init_decl_processing): Fix Jun 30 patch -- move + ifndef for Cygwin32 to include SIGSEGV. + +Thu Jul 3 01:44:05 1997 Jason Merrill + + * class.c (finish_struct_1): Only complain about pointers without + copy stuff if there are any constructors. + + * rtti.c (build_dynamic_cast): Call complete_type on the types. + + * decl.c (grokfndecl): If the function we chose doesn't actually + match, die. + + * decl2.c (grokclassfn): Don't specify 'const int' for the + artificial destructor parm. + + * pt.c (type_unification): If we are called recursively, nothing + decays. + +Mon Jun 30 17:53:21 1997 Geoffrey Noer + + * decl.c (init_decl_processing): Stop trying to catch signals + other than SIGABRT since the Cygwin32 library doesn't support + them correctly yet. This fixes a situation in which g++ causes + a hang on SIGSEGVs and other such signals in our Win32-hosted + tools. + +Mon Jun 30 14:50:01 1997 Jason Merrill + + * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data. + +Fri Jun 27 15:18:49 1997 Jason Merrill + + * typeck2.c (store_init_value): Always return the value if our + type needs constructing. + + * method.c (hack_identifier): Convert class statics from + reference, too. + +Thu Jun 26 11:44:46 1997 Jason Merrill + + * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency. + +Thu Jun 19 16:49:28 1997 Mike Stump + + * typeck.c (c_expand_return): Make sure we clean up temporaries at + the end of return x; + +Thu Jun 19 12:28:43 1997 Brendan Kehoe + + * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER. + +Tue Jun 17 18:35:57 1997 Mike Stump + + * except.c (expand_builtin_throw): Add support + -fno-sjlj-exceptions -fPIC exception handling on the SPARC. + +Mon Jun 16 01:24:37 1997 Jason Merrill + + * repo.c (extract_string): Null-terminate. + + * cp-tree.h (TI_SPEC_INFO): New macro. + (CLASSTYPE_TI_SPEC_INFO): New macro. + * pt.c (push_template_decl): Correctly determine # of template parms + for partial specs. + + * call.c (compare_ics): Really fix 'this' conversions. + + * pt.c (do_decl_instantiation): Don't crash on explicit inst of + non-template fn. + + * pt.c (push_template_decl): Complain about mismatch in # of + template parms between a class template and a member template. + +Sun Jun 15 02:38:20 1997 Jason Merrill + + * method.c (synthesize_method): You can't call + function_cannot_inline_p after finish_function. + * decl.c (finish_function): Turn on flag_inline_functions and turn + off DECL_INLINE before handing a synthesized method to the + backend. + +Thu Jun 12 17:35:28 1997 Jason Merrill + + * method.c (synthesize_method): Remove July 30 change to never set + DECL_INLINE if at_eof. + +Thu Jun 12 15:25:08 1997 Mike Stump + + * xref.c (GNU_xref_member): Ensure that the node has a + decl_lang_specific part before checking DECL_FRIEND_P. + +Thu Jun 12 12:36:05 1997 Jason Merrill + + * pt.c (instantiate_class_template): Diagnose non-class types used + as bases. + +Wed Jun 11 17:33:40 1997 Jason Merrill + + * typeck.c (build_conditional_expr): Use convert_for_initialization + instead of convert_and_check. + +Wed Jun 11 12:31:33 1997 Brendan Kehoe + + * parse.y (typespec): Don't pedwarn for typeof. + +Tue Jun 10 00:22:09 1997 Jason Merrill + + * repo.c (finish_repo): Only check changes if we would write a + repo file. + + * call.c (compare_ics): Fix handling of 'this' conversions. + + * pt.c (do_decl_instantiation): Support static data too. Rename + from do_function_instantiation. + * cp-tree.h: Adjust. + * parse.y: Adjust. + + * repo.c (extract_string): New fn. + (get_base_filename): Use it. + (init_repo): Compare old args with current args. + +Mon Jun 9 14:25:30 1997 Mike Stump + + * Makefile.in, Make-lang.in: Protect C-ls with a comment + character, idea from Paul Eggert . + +Mon Jun 9 01:52:03 1997 Jason Merrill + + * typeck.c (c_expand_return): Be more persistent in looking for + returned temps. + + * cvt.c (build_up_reference): Use NOP_EXPR for switching from + pointer to reference. + + * class.c (build_vbase_path): Don't do anything if PATH has no steps. + +Sun Jun 8 03:07:05 1997 Jason Merrill + + * init.c (build_member_call, build_offset_ref): + Use do_scoped_id instead of do_identifier. + + * cvt.c (convert): Remove bogosity. + +Sat Jun 7 20:50:17 1997 Brendan Kehoe + + * cvt.c (build_up_reference): Do checks of ARGTYPE and + TARGET_TYPE before trying to use get_binfo. + +Fri Jun 6 17:36:39 1997 Jason Merrill + + * cvt.c (build_up_reference): Call get_binfo to get access control. + + * decl2.c (import_export_decl): If we don't support weaks, leave + statics undefined. + +Fri Jun 6 15:55:49 1997 Mike Stump + + * except.c (expand_builtin_throw): Add support for machines that + cannot access globals after throw's epilogue when + -fno-sjlj-exceptions is used. + +Thu Jun 5 16:28:43 1997 Jason Merrill + + * parse.y: 'std::' becomes '::'. + * lex.c (real_yylex): Remove 'namespace' warning. + * init.c (build_member_call): Ignore 'std::'. + (build_offset_ref): Likewise. + * decl2.c (do_using_directive): Ignore 'using namespace std;'. + (do_toplevel_using_decl): Ignore 'using std::whatever'. + * decl.c (push_namespace): Just sorry. + (pop_namespace): Nop. + (init_decl_processing): Declare std namespace. + +Tue Jun 3 18:08:23 1997 Jason Merrill + + * search.c (push_class_decls): A name which ambiguously refers to + several instantiations of the same template just refers to the + template. + +Tue Jun 3 12:30:40 1997 Benjamin Kosnik + + * decl.c (build_enumerator): Fix problem with unsigned long + enumerated values being smashed to ints, causing overflow + when computing next enumerated value (for enum values around + MAX_VAL). + +Mon Jun 2 17:40:56 1997 Jason Merrill + + * typeck.c (build_component_ref): Only call mark_used on a decl. + +Thu May 29 15:54:17 1997 Brendan Kehoe + + * typeck.c (build_c_cast): Make the check for a ptr to function + more specific before possible default_conversion call. + +Thu May 29 13:02:06 1997 Mike Stump + + * except.c (expand_exception_blocks): Simplify and fix and make + sure we don't end a region in a sequence, as expand_end_bindings + doesn't like it. + +Wed May 28 17:08:03 1997 Mike Stump + + * except.c (init_exception_processing): Mark terminate as not + returning so that the optimizer can optimize better. + +Tue May 27 19:49:19 1997 Mike Stump + + * cvt.c (convert): Don't do any extra work, if we can avoid it + easily. + +Tue May 27 18:21:47 1997 Mike Stump + + * *.[chy]: Change cp_convert to ocp_convert, change convert to + cp_convert. convert is now reserved for the backend, and doesn't + have the semantics a frontend person should ever want. + +Fri May 23 10:58:31 1997 Jason Merrill + + * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled. + Lose -traditional support. + +Thu May 22 15:41:28 1997 Jason Merrill + + * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype). + + * parse.y (self_reference): Do it for templates, too. + * class.c (pushclass): Don't overload_template_name; the alias + generated by build_self_reference serves the same purpose. + + * tree.c (list_hash): Make static, take more args. + (list_hash_lookup): Likewise. + (list_hash_add): Make static. + (list_hash_canon): Lose. + (hash_tree_cons): Only build a new node if one isn't already in the + hashtable. + (hash_tree_chain): Use hash_tree_cons. + * cp-tree.h: Adjust. + * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead + of calling lookup_name. + +Wed May 21 18:24:19 1997 Jason Merrill + + * pt.c (instantiate_class_template): TYPE_VALUES for an enum + doesn't refer to the CONST_DECLs. + +Tue May 20 21:09:32 1997 Bob Manson + + * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever + is bigger. + (expand_class_desc): Convert the last argument to a sizetype. + +Tue May 20 13:55:57 1997 Brendan Kehoe + + * gxx.gperf (__complex, __complex__, __imag, __imag__, __real, + __real__): Add reswords. + * hash.h: Regenerate. + * lex.h (rid): Add RID_COMPLEX. + (RID_LAST_MODIFIER): Set to RID_COMPLEX. + * lex.c (init_lex): Add building of RID_COMPLEX. + (real_yylex): General cleanup in line with what c-lex.c also has, + sans the cruft for traditional; add handling of SPEC_IMAG, complex + types, and imaginary numeric constants. + * parse.y (REALPART, IMAGPART): Add tokens. + (unary_expr): Add REALPART and IMAGPART rules. + * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare. + * decl.c (complex_{integer,float,double,long}_type_node): Define + types. + (init_decl_processing): Set up the types. + (grokdeclarator): Add handling of RID_COMPLEX. Set and use + DEFAULTED_INT instead of EXPLICIT_INT when we default to int type. + * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases. + * cvt.c (cp_convert): Handle COMPLEX_TYPE. + * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add + COMPLEX_TYPE case. + * method.c (build_overload_name): Add handling of the different + COMPLEX_TYPEs, prefixing them with `J'. + * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE + as a template parm. + (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case. + * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases. + (mapcar): Handle COMPLEX_CST. + * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE. + (common_type): Add code for complex types. + (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases. + (convert_for_assignment): Likewise. + (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases. + +Mon May 19 12:26:27 1997 Jason Merrill + + * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to + tsubst_expr, as it might try to do overload resolution. + +Sat May 17 10:48:31 1997 Jason Merrill + + * pt.c (instantiate_class_template): Oops. + +Fri May 16 14:23:57 1997 Jason Merrill + + * cp-tree.def: Add TAG_DEFN. + * pt.c (tsubst_enum): New fn. + (instantiate_class_template): Use it. + (tsubst_expr): Support TAG_DEFN. + (tsubst): Support local enums. + (tsubst_copy): Likewise. + * decl.c (finish_enum): Likewise. + (start_enum): If this is a local enum, switch to permanent_obstack. + +Wed May 14 19:08:28 1997 Mike Stump + + * decl.c (store_parm_decls): Set last_parm_cleanup_insn here. + (finish_function): Put the base init code for constructors just + after the parm cleanup insns. + (struct cp_function): Add last_parm_cleanup_insn. + (push_cp_function_context): Likewise. + (pop_cp_function_context): Likewise. + +Tue May 13 15:51:20 1997 Jason Merrill + + * pt.c (tsubst_copy): Handle BIT_NOT_EXPR. + +Wed May 7 11:17:59 1997 Brendan Kehoe + + * method.c (emit_thunk) [ASM_OUTPUT_MI_THUNK]: Build up the RTL + for THUNK_FNDECL before we switch to temporary allocation. + +Mon May 5 14:46:53 1997 Jason Merrill + + * call.c (build_new_op): Handle null arg2 for ?:. + +Thu May 1 18:26:37 1997 Mike Stump + + * except.c (expand_exception_blocks): Ensure that we flow through + the end of the exception region for the exception specification. + Move exception region for the exception specification in, so that + it doesn't protect the parm cleanup. Remove some obsolete code. + * decl.c (store_parm_decls): Likewise. + (finish_function): Likewise. + +Tue Apr 29 15:38:54 1997 Jason Merrill + + * init.c (build_new): Fix nothrow handling. + +Tue Apr 29 14:29:50 1997 Brendan Kehoe + + * init.c (emit_base_init): Don't warn about the initialization + list for an artificial member. + +Fri Apr 25 17:47:59 1997 Brendan Kehoe + + * expr.c (do_case): Handle !START case for the error msg. + +Fri Apr 25 11:55:23 1997 Jason Merrill + + * decl2.c, lang-options.h: New option -Weffc++. + * class.c, decl.c, init.c, typeck.c: Move Effective C++ warnings + to -Weffc++. + + * decl2.c (finish_prevtable_vardecl): Change NO_LINKAGE_HEURISTICS + to MULTIPLE_SYMBOL_SPACES. + +Wed Apr 23 18:06:50 1997 Jason Merrill + + * method.c (emit_thunk, generic case): Set current_function_is_thunk. + + * method.c (emit_thunk, macro case): Set up DECL_RESULT. + + * typeck.c (c_expand_return): Don't complain about returning void + to void in an artificial function. + * method.c (make_thunk): Change settings of READONLY/VOLATILE, + don't set DECL_RESULT, set DECL_ARTIFICIAL. + (emit_thunk, generic code): Also set up DECL_LANG_SPECIFIC. + +Wed Apr 23 14:43:06 1997 Mike Stump + + * init.c (init_decl_processing): Add support for setjmp/longjmp based + exception handling. + * except.c (init_exception_processing): Likewise. + (expand_end_catch_block): Likewise. + (expand_exception_blocks): Likewise. + (expand_throw): Likewise. + * exception.cc (__default_terminate): Likewise. + + * init.c (perform_member_init): Use new method of expr level + cleanups, instead of cleanups_this_call and friends. + (emit_base_init): Likewise. + (expand_aggr_vbase_init_1): Likewise. + (expand_vec_init): Likewise. + * decl.c (cp_finish_decl): Likewise. + (expand_static_init): Likewise. + (store_parm_decls): Likewise. + (cplus_expand_expr_stmt): Likewise. + * decl2.c (finish_file): Likewise. + + * Make-lang.in (exception.o): Ok to compile with -O now. + + * decl.c (maybe_build_cleanup_1): We no longer have to unsave, as + we know it will be done later by the backend. + + * decl2.c (lang_f_options): Remove support for short temps. + * lang-options.h: Likewise. + +Wed Apr 23 04:12:06 1997 Jason Merrill + + * tree.c (varargs_function_p): New fn. + * method.c (emit_thunk): Replace broken generic code with code to + generate a heavyweight thunk function. + +Tue Apr 22 02:45:18 1997 Jason Merrill + + * pt.c (process_template_parm): pedwarn about floating-point parms. + + * decl.c (grokdeclarator): inline no longer implies static. + + * spew.c (yylex): Always return the TYPE_DECL if we got a scope. + +Mon Apr 21 15:42:27 1997 Jason Merrill + + * class.c (check_for_override): The signature of an overriding + function is not changed. + + * call.c (build_over_call): Move setting of conv into the loop. + Note: this change, along with the related changes of the 18th thru + the 20th of April, fix an infinite loop problem in conversions. + +Sun Apr 20 16:24:29 1997 Jason Merrill + + * call.c (build_user_type_conversion_1): Really ignore rvalue + conversions when looking for a REFERENCE_TYPE. + + * cvt.c (build_up_reference): Eviscerate, use build_unary_op. + * cp-tree.h (TREE_REFERENCE_EXPR): #if 0. + * typeck.c (decay_conversion): Don't set TREE_REFERENCE_EXPR. + (build_unary_op): Likewise. + * call.c (build_over_call): See through a CONVERT_EXPR around the + ADDR_EXPR for on a temporary. + * typeck.c (c_expand_return): See through a CONVERT_EXPR around + the ADDR_EXPR for a local variable. + +Fri Apr 18 12:11:33 1997 Jason Merrill + + * call.c (build_user_type_conversion_1): If we're trying to + convert to a REFERENCE_TYPE, only consider lvalue conversions. + (build_new_function_call): Print candidates. + (implicit_conversion): Try a temp binding if the lvalue conv is BAD. + (reference_binding): Binding a temporary of a reference-related type + is BAD. + +Thu Apr 17 14:37:22 1997 Brendan Kehoe + + * inc/typeinfo (type_info::before): Add cv-qualifier-seq. + * tinfo2.cc (type_info::before): Likewise. + +Mon Apr 14 12:38:17 1997 Jason Merrill + + * call.c (implicit_conversion): Oops. + +Fri Apr 11 02:18:30 1997 Jason Merrill + + * call.c (implicit_conversion): Try to find a reference conversion + before binding a const reference to a temporary. + +Wed Apr 2 12:51:36 1997 Mike Stump + + * exception.cc (__default_unexpected): Call terminate by default, + so that if the user overrides terminate, the correct function will + be called. + +Wed Mar 19 14:14:45 1997 Mike Stump + + * parse.y (left_curly): Avoid trying to use any fields of + error_mark_node, as there aren't any. + +Thu Mar 13 16:33:22 1997 Jason Merrill + + * lex.c (do_identifier): Avoid breaking on overloaded methods + as default arguments. + +Wed Mar 12 13:55:10 1997 Hans-Peter Nilsson + + * call.c (add_template_candidate): Initialize the variable "dummy". + +Mon Mar 10 15:13:14 1997 Brendan Kehoe + + * decl.c (start_decl): Make sure TYPE isn't an error_mark_node + before we try to use TYPE_SIZE and TREE_CONSTANT on it. + +Fri Mar 7 13:19:36 1997 Brendan Kehoe + + * cp-tree.h (comp_ptr_ttypes, more_specialized): Add decl. + (debug_binfo): Delete decl, not needed. + + * tree.c (fnaddr_from_vtable_entry, function_arg_chain, + promotes_to_aggr_type): Delete fns. + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY, + SET_FNADDR_FROM_VTABLE_ENTRY, FUNCTION_ARG_CHAIN, + PROMOTES_TO_AGGR_TYPE): Delete alternates to #if 1. + + * decl.c (pending_invalid_xref{,_file,_line}): Delete unused vars. + + * friend.c (is_friend_type): Delete fn. + * cp-tree.h (is_friend_type): Delete decl. + + * decl.c (original_result_rtx, double_ftype_double, + double_ftype_double_double, int_ftype_int, long_ftype_long, + float_ftype_float, ldouble_ftype_ldouble, last_dtor_insn): Make static. + * typeck.c (original_result_rtx, warn_synth): Delete extern decls. + + * decl.c (push_overloaded_decl{,_top_level}): Make static, adding + fwd decls. + * cp-tree.h (push_overloaded_decl{,_top_level}): Delete decls. + + * decl.c (pushdecl_nonclass_level): #if 0, unused. + * cp-tree.h (pushdecl_nonclass_level): #if 0 decl. + + * lex.c (reinit_lang_specific): #if 0, unused. + * cp-tree.h (reinit_lang_specific): #if 0 decl. + + * decl.c (revert_static_member_fn): Make static, adding fwd decl. + * cp-tree.h (revert_static_member_fn): Delete decl. + + * class.c (root_lang_context_p): Delete fn. + * cp-tree.h (root_lang_context_p): Delete decl. + + * decl.c (set_current_level_tags_transparency): #if 0, unused. + * cp-tree.h (set_current_level_tags_transparency): #if 0 decl. + + * lex.c (set_vardecl_interface_info): Make static. + * cp-tree.h (set_vardecl_interface_info): Delete decl. + + * call.c (find_scoped_type): Make static. + * cp-tree.h (find_scoped_type): Delete decl. + + * search.c (convert_pointer_to_vbase): Make static. + * cp-tree.h (convert_pointer_to_vbase): Delete decl. + + * decl.c (const_ptr_type_node): Likewise. + * cp-tree.h (const_ptr_type_node): Delete decl. + + * typeck.c (common_base_type): Make static. + * cp-tree.h (common_base_types): Delete erroneous decl. + + * pt.c (classtype_mangled_name): Make static. + * cp-tree.h (classtype_mangled_name): Delete decl. + + * lex.c (check_newline): Make static. + * cp-tree.h (check_newline): Delete decl. + + * typeck.c (build_x_array_ref): Delete fn, same idea as + grok_array_decl. + * cp-tree.h (build_x_array_ref): Delete decl. + + * lex.c (copy_decl_lang_specific): Delete fn, same idea as + copy_lang_decl. + * cp-tree.h (copy_decl_lang_specific): #if 0 decl. + + * class.c (build_vtable_entry): Make static. + * cp-tree.h (build_vtable_entry): Delete decl. + + * class.c (build_vbase_pointer): Make static. + * cp-tree.h (build_vbase_pointer): Delete decl. + + * sig.c (build_sptr_ref): Add forward decl and make static. + * cp-tree.h (build_sptr_ref): Delete decl. + + * call.c (build_new_method_call): Add forward decl and make static. + * cp-tree.h (build_new_method_call): Delete decl. + + * call.c (build_object_call): Make static. + * class.c (check_for_override, complete_type_p, mark_overriders): + Likewise. + * decl.c (cp_function_chain): Likewise. + * lex.c (set_typedecl_interface_info, reinit_parse_for_block): + Likewise. + * pt.c (comp_template_args, get_class_bindings, push_tinst_level): + Likewise. + * tree.c (build_cplus_array_type_1): Likewise. + * typeck.c (comp_ptr_ttypes_{const,real,reinterpret}): Likewise. + (comp_target_parms): Likewise. + + * init.c (build_builtin_call): Make static. + * cp-tree.h (build_builtin_call): Delete decl. + + * typeck.c (binary_op_error): Delete decl. + * cp-tree.h (binary_op_error): Likewise. + +Thu Mar 6 16:13:52 1997 Brendan Kehoe + + * call.c (build_method_call): Compare against error_mark_node + directly, rather than the ERROR_MARK tree code. + * cvt.c (cp_convert): Likewise. + * decl.c (print_binding_level): Likewise. + (duplicate_decls): Likewise. + (grokdeclarator): Likewise. + (grokdeclarator): Likewise. + * init.c (expand_aggr_init_1): Likewise. + (decl_constant_value): Likewise. + * method.c (build_opfncall): Likewise. + (hack_identifier): Likewise. + * typeck.c (build_modify_expr): Likewise. + + * typeck.c (build_c_cast): Don't decl TYPE as register tree. + +Sun Mar 2 02:54:36 1997 Bruno Haible + + * pt.c (unify): Strip NOP_EXPR wrappers before unifying integer values. + + * pt.c (coerce_template_parms): Add new error message. + + * method.c (build_overload_value): Implement name mangling for + floating-point template arguments. + + * method.c (build_overload_int, icat, dicat): Fix mangling of template + arguments whose absolute value doesn't fit in a signed word. + +Mon Mar 3 12:14:54 1997 Brendan Kehoe + + * friend.c: New file; put all of the friend stuff in here. + * init.c: Instead of here. + * Makefile.in (CXX_OBJS): Add friend.o. + (friend.o): Add dependencies. + * Make-lang.in (CXX_SRCS): Add $(srcdir)/cp/friend.c. + +Sun Mar 2 11:04:43 1997 Jason Merrill + + * call.c (build_scoped_method_call): Complain if the scope isn't a + base. + +Wed Feb 26 11:31:06 1997 Jason Merrill + + * parse.y (left_curly): Don't crash on erroneous type. + + * init.c (build_delete): Fix type of ref. + +Tue Feb 25 12:41:48 1997 Jason Merrill + + * search.c (get_vbase_1): Renamed from get_vbase. + (get_vbase): Wrapper, now non-static. + (convert_pointer_to_vbase): Now static. + + * call.c (build_scoped_method_call): Accept a binfo for BASETYPE. + * init.c (build_delete): Pass one. + (build_partial_cleanup_for): Use build_scoped_method_call. + * decl.c (finish_function): Pass a binfo. + +Mon Feb 24 15:00:12 1997 Jason Merrill + + * call.c (build_over_call): Only synthesize non-trivial copy ctors. + + * typeck.c (build_c_cast): Lose other reference to flag. + + * call.c (build_field_call): Don't look for [cd]tor_identifier. + * decl2.c (delete_sanity): Remove meaningless use of + LOOKUP_HAS_IN_CHARGE. + * decl.c (finish_function): Use build_scoped_method_call instead + of build_delete for running vbase dtors. + * init.c (build_delete): Call overload resolution code instead of + duplicating it badly. + +Thu Feb 20 15:12:15 1997 Jason Merrill + + * call.c (build_over_call): Call mark_used before trying to elide + the call. + + * decl.c (implicitly_declare): Don't set DECL_ARTIFICIAL. + +Wed Feb 19 11:18:53 1997 Brendan Kehoe + + * typeck.c (build_modify_expr): Always pedwarn for a cast to + non-reference used as an lvalue. + +Wed Feb 19 10:35:37 1997 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Convert from 0 to a pmf properly. + +Tue Feb 18 15:40:57 1997 Jason Merrill + + * parse.y (handler): Fix template typo. + +Sun Feb 16 02:12:28 1997 Jason Merrill + + * error.c (lang_decl_name): New fn. + * tree.c (lang_printable_name): Use it. + +Fri Feb 14 16:57:05 1997 Mike Stump + + * g++spec.c: Include config.h so that we can catch bzero #defines + from the config file. + +Tue Feb 11 13:50:48 1997 Mike Stump + + * new1.cc: Include a declaration for malloc, to avoid warning, and + avoid lossing on systems that require one (ones that define malloc + in xm.h). + +Mon Feb 10 22:51:13 1997 Bruno Haible + + * decl2.c (max_tinst_depth): New variable. + (lang_decode_option): Parse "-ftemplate-depth-NN" command line + option. + * pt.c (max_tinst_depth): Variable moved. + * lang-options.h: Declare "-ftemplate-depth-NN" command line option + as legal. + +Fri Feb 7 15:43:34 1997 Jason Merrill + + * decl.c (xref_basetypes): Allow a base class that depends on + template parms to be incomplete. + + * decl2.c (build_expr_from_tree): Support typeid(type). + * rtti.c (get_typeid): Support templates. + (expand_si_desc, expand_class_desc): Fix string length. + (expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. + +Tue Feb 4 11:28:24 1997 Jason Merrill + + * pt.c (unify, case TEMPLATE_CONST_PARM): Use cp_tree_equal. + + * pt.c (tsubst): Put it back for -fno-ansi-overloading. + +Mon Feb 3 18:41:12 1997 Jason Merrill + + * pt.c (tsubst, case FUNCTION_DECL): Lose obsolete code that + smashes together template and non-template decls of the same + signature. + +Thu Jan 30 19:18:00 1997 Jason Merrill + + * pt.c (tsubst): Don't recurse for the type of a TYPENAME_TYPE. + +Wed Jan 29 11:40:35 1997 Brendan Kehoe + + * decl.c (duplicate_decls): Next route, pedwarn about different + exceptions if -pedantic *or* olddecl !DECL_IN_SYSTEM_HEADER. + +Tue Jan 28 20:43:29 1997 Brendan Kehoe + + * cp-tree.h (HAS_DEFAULT_IMPLEMENTATION): Delete macro. + (struct lang_type): Delete has_default_implementation member. + Increase dummy to 21. + * decl.c (start_method): Delete usage. + + * cp-tree.h (build_call, null_ptr_cst_p, in_function_p, + store_after_parms, start_decl_1, auto_function): Add decls. + (get_arglist_len_in_bytes, declare_implicit_exception, + have_exceptions_p, make_type_decl, typedecl_for_tag, + store_in_parms, pop_implicit_try_blocks, push_exception_cleanup, + build_component_type_expr, cplus_exception_name, + {make,clear}_anon_parm_name, dont_see_typename): Removed decls. + * call.c (build_this): Make static. + (is_complete): Likewise. + (implicit_conversion): Likewise. + (reference_binding): Likewise. + (standard_conversion): Likewise. + (strip_top_quals): Likewise. + (non_reference): Likewise. + (build_conv): Likewise. + (user_harshness): Likewise. + (rank_for_ideal): Likewise. + * decl.c (start_decl_1): Delete forward decl. + (push_decl_level): Make static. + (resume_binding_level): Make static. + (namespace_bindings_p): Make static. + (declare_namespace_level): Make static. + (lookup_name_real): Make static. + (duplicate_decls): Make static. Take register off NEWDECL and + OLDDECL parm decls. + * decl2.c (get_sentry): Make static. + (temp_name_p): Delete fn. + * except.c (auto_function): Delete decl. + * lex.c (handle_{cp,sysv}_pragma): Make static. + (handle_sysv_pragma) [HANDLE_SYSV_PRAGMA]: Add forward decl. + * method.c (do_build_{copy_constructor,assign_ref}): Make static. + * pt.c (tsubst_expr_values): Make static. + * rtti.c (combine_strings): Delete decl. + +Tue Jan 28 16:40:40 1997 Jason Merrill + + * pt.c (push_template_decl): Handle getting a typedef. + + * call.c (build_new_function_call): Complain about void arg. + +Tue Jan 28 15:25:09 1997 Brendan Kehoe + + * decl.c (duplicate_decls): Give pedwarn of different exceptions + if -pedantic, instead of olddecl !DECL_IN_SYSTEM_HEADER. + +Mon Jan 27 19:21:29 1997 Mike Stump + + * except.c (expand_throw): Don't expand the cleanup tree here, + since we are not going to write the rtl out. Fixes problem with + -g -O on SPARC. + +Mon Jan 27 16:24:35 1997 Sean McNeil + + * Make-lang.in: Add $(exeext) as necessary. + +Mon Jan 27 13:20:39 1997 Mike Stump + + * parse.y (handler_seq): Must have at least one catch clause. + +Sat Jan 25 12:00:05 1997 Jason Merrill + + * call.c (add_builtin_candidate): Restore ?: hack. + + * decl.c (grok_op_properties): More warnings. + +Sat Jan 25 08:50:03 1997 Brendan Kehoe + + * decl.c (duplicate_decls): On second thought, do it as a pedwarn + still but only if !DECL_IN_SYSTEM_HEADER (olddecl). + + * decl.c (duplicate_decls): Scale back to a warning, and only do + 'em if -pedantic. + +Fri Jan 24 17:52:54 1997 Mike Stump + + * decl.c (duplicate_decls): pedwarn mismatched exception + specifications. + +Thu Jan 23 18:18:54 1997 Mike Stump + + * call.c (build_new_method_call): Don't display the invisible + argument for controlling virtual bases. + +Thu Jan 23 16:48:10 1997 Mike Stump + + * new: Add nothrow new and delete, bad_alloc and throw specifications + for delete. + * decl.c (init_decl_processing): Add throw specification for delete. + * new.cc (nothrow): Define. + * lex.c (real_yylex): Removing warning that throw and friends are + keywords. + * new1.cc (operator new (size_t sz, const nothrow_t&)): Define. + * new2.cc (operator new[] (size_t sz, const nothrow_t&): Define. + * Make-lang.in: Add new{1,2}.{cc,o}. + +Thu Jan 23 16:39:06 1997 Jason Merrill + + * lex.c (cons_up_default_function): Fix return type of synth op=. + + * init.c (emit_base_init): Add warnings for uninitialized members + and bases. + + * decl.c (xref_basetypes): Add warning for non-polymorphic type + with destructor used as base type. + + * decl.c (grok_op_properties): Add warning for op= returning void. + * typeck.c (c_expand_return): Add warning for op= returning anything + other than *this. + + * class.c (finish_struct_1): Add warning for class with pointers + but not copy ctor or copy op=. + + * cp-tree.h (TI_PENDING_TEMPLATE_FLAG): New macro. + * pt.c (add_pending_template): Use it instead of LANG_FLAG_0. + (instantiate_template): If -fexternal-templates, add this + instantiation to pending_templates. + + * decl2.c (copy_assignment_arg_p): Disable old hack to support + Booch components. + +Tue Jan 21 18:32:04 1997 Mike Stump + + * cvt.c (cp_convert): pedwarn enum to pointer conversions. + +Mon Jan 20 17:59:51 1997 Jason Merrill + + * call.c (standard_conversion): Handle getting references. Tack + on RVALUE_CONV here. Do it for non-class types, too. + (reference_binding): Pass references to standard_conversion. + (implicit_conversion): Likewise. + (add_builtin_candidate): Disable one ?: kludge. + (convert_like): Handle RVALUE_CONVs for non-class types. + (joust): Disable the other ?: kludge. + +Mon Jan 20 14:53:13 1997 Brendan Kehoe + + * decl.c (init_decl_processing): Add code to build up common + function types beforehand, to avoid creation then removal of + things already in the hash table. + +Mon Jan 20 14:43:49 1997 Jason Merrill + + * decl.c (finish_function): Also zero out DECL_INCOMING_RTL for + the arguments. + + * error.c (dump_expr, TEMPLATE_CONST_PARM): Don't require + current_template_parms. + +Fri Jan 17 10:25:42 1997 Jason Merrill + + * search.c (lookup_field): Don't return a function, check want_type. + +Thu Jan 16 18:14:35 1997 Brendan Kehoe + + * init.c (build_new): Make sure PLACEMENT has a type. + +Thu Jan 16 17:40:28 1997 Jason Merrill + + * init.c (build_new): Support new (nothrow). + +Wed Jan 15 12:38:14 1997 Jason Merrill + + * pt.c (instantiate_decl): Also do push_to_top_level before setting + up DECL_INITIAL. + + * cp-tree.h (PARM_DEFAULT_FROM_TEMPLATE): New macro. + * pt.c (tsubst): Defer instantiation of default args. + * call.c (build_over_call): Until here. + +Wed Jan 15 10:08:10 1997 Brendan Kehoe + + * search.c (lookup_field): Make sure we have an + IDENTIFIER_CLASS_VALUE before we try to return it. + +Thu Jan 9 07:19:01 1997 Brendan Kehoe + + * call.c (build_method_call): Delete unused var PARM. + (build_overload_call_real): Likewise. + (build_object_call): Delete unused var P. + (build_new_op): Likewise. + * decl.c (builtin_type_tdescs_{arr, len, max}): #if 0 out static + var definitions, which are never used. + (shadow_tag): Delete unused var FN. + * expr.c (cplus_expand_expr): Delete unused var ORIGINAL_TARGET. + * init.c (build_new): Delete unused var ALLOC_TEMP. + * method.c (hack_identifier): Delete unused var CONTEXT. + (do_build_copy_constructor): Delete unused var NAME. + (synthesize_method): Delete unused var BASE. + * pt.c (lookup_template_class): Delete unused var CODE_TYPE_NODE. + * rtti.c (build_headof): Delete unused var VPTR. + (get_typeid): Delete unused var T. + * typeck.c (build_conditional_expr): Delete unused vars ORIG_OP1 + and ORIG_OP2. + (build_ptrmemfunc): Delete unused vars U and NINDEX. + * typeck2.c (build_functional_cast): Delete unused var BINFO. + +Wed Jan 8 13:09:54 1997 Jason Merrill + + * search.c (lookup_field): Use IDENTIFIER_CLASS_VALUE to look up + things in a type being defined. + * decl.c (finish_enum): Reverse the values so that they are in + the correct order. + + * pt.c (instantiate_class_template): Don't initialize + BINFO_BASETYPES until the vector is filled out. + (unify): Don't abort on conflicting bindings, just fail. + (instantiate_decl): Do push_tinst_level before any tsubsting. + + * method.c (build_overload_value): Handle getting a + TEMPLATE_CONST_PARM for a pointer. + +Tue Jan 7 14:00:58 1997 Jason Merrill + + * init.c (expand_member_init): Don't give 'not a base' error for + templates. + + * pt.c (instantiate_decl): Call import_export_decl later. + + * pt.c (instantiate_class_template): Return a value. + + * parse.y (extension): New rule for __extension__. + (extdef, unary_expr, decl, component_decl): Use it. + +Tue Jan 7 09:20:28 1997 Mike Stump + + * class.c (base_binfo): Remove unused base_has_virtual member. + (finish_base_struct): Likewise. + (finish_struct_1): Likewise. + diff --git a/contrib/gcc/cp/ChangeLog-1998 b/contrib/gcc/cp/ChangeLog-1998 new file mode 100644 index 00000000000..1b4e301d025 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1998 @@ -0,0 +1,6887 @@ +Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi + + * Makefile.in (cvt.o): Depend on toplev.h. + + * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes. + + * cvt.c: Include toplev.h. + + * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and + definitions. + + * init.c (expand_vec_init): Initialize variable `itype'. + + * lex.c (yyerror): Cast the argument passed to a ctype function to + an unsigned char. + + * method.c (build_mangled_C9x_name): Wrap prototype and definition + in "HOST_BITS_PER_WIDE_INT >= 64". + + * typeck.c (build_binary_op): Mark parameter `convert_p' with + ATTRIBUTE_UNUSED. + +1998-12-22 Mark Mitchell + + * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation. + * tree.c (build_exception_variant): Don't crash on empty throw + specs. + +1998-12-18 DJ Delorie + + * cvt.c (convert_to_reference): Check for both error_mark_node + and NULL_NODE after call to convert_for_initialization. + +1998-12-17 Jason Merrill + + * error.c (interesting_scope_p): New fn. + (dump_simple_decl): Use it. + (dump_expr, case CONSTRUCTOR): Force a & for a PMF. + (dump_expr, case OFFSET_REF): Print ->* if appropriate. + +1998-12-16 Mark Mitchell + + * class.c (resolve_address_of_overloaded_function): Do conversion + to correct type here, rather than ... + (instantiate_type): Here. + + * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro. + (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it. + (decl_template_parm_p): Remove. + * decl.c (pushdecl): Don't set DECL_CONTEXT for a template + parameter. + * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P. + * pt.c (push_inline_template_parms_recursive): Set it. + (decl_template_parm_p): Remove. + (check_template_shadow): Use DECL_TEMPLATE_PARM_P. + (process_template_parm): Set it. + +Wed Dec 16 16:33:58 1998 Dave Brolley + + * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus + if configured with cpplib. + +1998-12-15 Mark Mitchell + + * decl.c (poplevel): Make sure ns_binding is initialized. + + * decl.c (finish_function): Undo inadvertent change in previous + patch. + +1998-12-14 Mark Mitchell + + * class.c (pushclass): Tweak handling of class-level bindings. + (resolve_address_of_overloaded_function): Update pointer-to-member + handling. + (instantiate_type): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (pop_binding): Take the DECL to pop, not just the name. + Deal with `struct stat' hack. + (binding_level): Add to documentation. + (push_binding): Clear BINDING_TYPE. + (add_binding): New function. + (push_local_binding): Use it. + (push_class_binding): Likewise. + (poplevel): Adjust calls to pop_binding. + (poplevel_class): Likewise. + (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden + declarations to current binding level. + (push_class_level_binding): Likewise. + (push_overloaded_decl): Adjust handling of OVERLOADs in local + bindings. + (lookup_namespace_name): Don't crash when confronted with a + TEMPLATE_DECL. + (lookup_name_real): Do `struct stat' hack in local binding + contexts. + (build_ptrmemfunc_type): Adjust documentation. + (grokdeclarator): Don't avoid building real array types when + processing templates unless really necessary. + (finish_method): Adjust calls to pop_binding. + * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves, + not reparse_decl_as_expr. + (build_expr_from_tree): Deal with a template-id as the function to + call in a METHOD_CALL_EXPR. + * pt.c (convert_nontype_argument): Tweak pointer-to-member handling. + (maybe_adjust_types_For_deduction): Don't do peculiar things with + METHOD_TYPEs here. + (resolve_overloaded_unification): Handle COMPONENT_REFs. Build + pointer-to-member types where necessary. + * tree.c (build_cplus_array_type_1): Don't avoid building real + array types when processing templates unless really necessary. + (build_exception_variant): Compare the exception lists correctly. + +1998-12-13 Mark Mitchell + + * cp-tree.def (CPLUS_BINDING): Update documentation. + * cp-tree.h (LOCAL_BINDING_P): New macro. + (lang_identifier): Rename local_value to bindings. + (tree_binding): Make `scope' of type `void*', not `tree'. + (BINDING_SCOPE): Update documentation. + (IDENTIFIER_LOCAL_VALUE): Remove. + (IDENTIFIER_CLASS_VALUE): Document. + (IDENTIFIER_BINDING): New macro. + (IDENTIFIER_VALUE): Likewise. + (TIME_IDENTIFIER_TIME): Likewise. + (TIME_IDENTIFIER_FILEINFO): Likewise. + (IMPLICIT_TYPENAME_P): Likewise. + (set_identifier_local_value): Remove. + (push_local_binding): New function. + (push_class_binding): Likewise. + * class.c (pushclass): Update comments; use push_class_binding. + * decl.c (set_identifier_local_value_with_scope): Remove. + (set_identifier_local_value): Likewise. + (push_binding): New function. + (pop_binding): Likewise. + (binding_level): Update documentation. Remove shadowed. + (BINDING_LEVEL): New macro. + (free_binding_nodes): New variable. + (poplevel): Adjust for new name-lookup scheme. Don't mess up + BLOCK_VARs when doing for-scope extension. Remove effectively + dead code. + (pushlevel_class): Tweak formatting. + (poplevel_class): Adjust for new name-lookup scheme. + (print_binding_level): Likewise. + (store_bindings): Likewise. + (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_overloaded_decl): Update comments. Adjust for new + name-lookup scheme. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (cp_finish_decl): Likewise. + (require_complete_types_for_parms): Likewise. Remove misleading + #if 0'd code. + (grok_parms): Likewise. Don't call + require_complete_types_for_parms here. + (grok_ctor_properties): Don't treat templates as copy + constructors. + (grop_op_properties): Or as assignment operators. + (start_function): Document. Adjust for new name-lookup scheme. + (finish_function): Likewise. + * decl2.c (do_local_using_decl): Use push_local_binding. + * lex.c (begin_definition_of_inclass_inline): New function, split + out from ... + (do_pending_inlines): Here, and ... + (process_next_inline): Here. + (get_time_identifier): Use TIME_IDENTIFIER_* macros. + (init_filename_times): Likewise. + (extract_interface_info): Likewise. + (ste_typedecl_interface_info): Likewise. + (check_newline): Likewise. + (dump_time_statistics): Likewise. + (handle_cp_pragma): Likewise. + (do_identifier): Adjust for new name-lookup scheme. + * parse.y (function_try_block): Return ctor_initializer_opt value. + (fndef): Use it. + (fn.defpen): Pass appropriate values to start_function. + (pending_inline): Use functor_try_block value, and pass + appropriate values to finish_function. + * pt.c (is_member_template): Update documentation; remove handling + of FUNCTION_DECLs. As per name, this function should deal only in + TEMPLATE_DECLs. + (decl_template_parm_p): Change name of olddecl parameter to decl. + (check_template_shadow): Adjust for new name-lookup scheme. + (lookup_template_class): Likewise. + (tsubst_decl): Tweak so as not to confuse member templates with + copy constructors and assignment operators. + (unify): Handle UNION_TYPEs. + * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme. + (lang_print_xnode): Adjust for new name-lookup scheme. + * typeck.c (mark_addressable): Likewise. + (c_expand_return): Likewise. + +1998-12-08 Jason Merrill + + * decl.c (grokdeclarator): Allow field with same name as class + in extern "C". + + * decl.c (lookup_name_real): Don't limit field lookup to types. + * class.c (check_member_decl_is_same_in_complete_scope): No error + if icv and x are the same. + * lex.c (do_identifier): Tweak error message. + +1998-12-10 Mark Mitchell + + * decl.c (start_enum): Use push_obstacks, not + end_temporary_allocation. + (finish_enum): Call pop_obstacks. + +1998-12-10 Mark Mitchell + + * class.c (instantiate_type): Return error_mark_node rather than + junk. + +1998-12-09 Mark Mitchell + + * cp-tree.h (most_specialized_instantiation): New function. + (print_candidates): Likewise. + * class.c (validate_lhs): Remove. + (resolve_address_of_overloaded_function): New function, split out + and then substantially reworked, from ... + (instantiate_type): Use it. Simplify. + * cvt.c (convert_to_reference): Complain when caller has indicated + that's the right thing to do. Don't crash if instantiate_type + fails. + * pt.c: Substitute `parameters' for `paramters' throughout. + (print_candidates): Don't make it static. + (most_specialized_instantiation): Split out from ... + (most_specialized): Here. + +Wed Dec 9 15:33:01 1998 Dave Brolley + + * lex.c (lang_init_options): Initialize cpplib. + * decl2.c (parse_options,cpp_initialized): Removed. + (lang_decode_option): Move initialization of cpplib to + lang_init_options. + +1998-12-09 Mark Mitchell + + * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as + well as the TYPE_DECL, when a typedef name is assigned to a + previously anonymous type. + +1998-12-08 Andrew MacLeod + + * cp/except.c (call_eh_info): Use __start_cp_handler instead of + __cp_eh_info for getting the eh info pointer. Add table_index to + field list. + (push_eh_cleanup): Don't increment 'handlers' data field. + (process_start_catch_block): Don't set the 'caught' field. + + * cp/exception.cc (CP_EH_INFO): New macro for getting the + exception info pointer within library routines. + (__cp_eh_info): Use CP_EH_INFO. + (__start_cp_handler): Get exception info pointer, set caught field, + and increment the handlers field. Avoids this being done by handlers. + (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro. + (uncaught_exception): Use CP_EH_INFO macro. + +Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h + +Mon Dec 7 17:56:06 1998 Mike Stump + + * lex.c (check_newline): Add support for \ as `natural' + characters in file names in #line to be consistent with #include + handling. We support escape processing in the # 1 "..." version of + the command. See also support in cp/lex.c. + +1998-12-07 Zack Weinberg + + * cp/decl2.c: s/data/opts/ when initializing cpp_reader + structure. + +1998-12-07 Jason Merrill + + * decl.c (build_typename_type): Set DECL_ARTIFICIAL. + + * error.c (dump_simple_decl): Also print namespace context. + (dump_function_decl): Likewise. + + * decl2.c (ambiguous_decl): Don't print old value if it's + error_mark_node. + + * decl.c (lookup_name_real): Fix handling of local types shadowed + by a non-type decl. Remove obsolete code. + * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro. + + * lang-options.h: Add -fpermissive. + * decl2.c: Likewise. + * cp-tree.h: Add flag_permissive. + * decl.c (init_decl_processing): If neither -fpermissive or -pedantic + were specified, set flag_pedantic_errors. + * call.c (build_over_call): Turn dropped qualifier messages + back into pedwarns. + * cvt.c (convert_to_reference): Likewise. + * typeck.c (convert_for_assignment): Likewise. + +1998-12-05 Jason Merrill + + * decl2.c (coerce_new_type): Use same_type_p. + (coerce_delete_type): Likewise. + + * call.c (check_dtor_name): Return 1, not error_mark_node. + +1998-12-04 Jason Merrill + + * lex.c (handle_cp_pragma): Disable #pragma interface/implementation + if MULTIPLE_SYMBOL_SPACES. + + * pt.c (check_template_shadow): New fn. + * decl2.c (grokfield): Use it. + * decl.c (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (start_method): Likewise. + (xref_tag): Don't try to use 't' if we're defining. + + * call.c (check_dtor_name): Just return an error_mark_node. + * pt.c (lookup_template_class): Complain about using non-template here. + * parse.y (apparent_template_type): Not here. + + * pt.c (check_explicit_specialization): Complain about specialization + with C linkage. + + * lang-options.h: Add -f{no-,}implicit-inline-templates. + + * pt.c (convert_nontype_argument): Don't assume that any integer + argument is intended to be a constant-expression. + +1998-12-03 Mark Mitchell + + * class.c (handle_using_decl): Fix comment. Don't lookup + constructors in base classes. + (validate_lhs): Fix typo in comment. + * search.c (lookup_field_1): Don't return a USING_DECL. + + * cp-tree.h (DECL_ACCESS): Improve documentation. + + * decl.c (expand_static_init): Don't set the initialization-done + flag until the initialization is done. + +1998-12-02 Mark Mitchell + + * decl2.c (validate_nonmember_using_decl): Complain about using + declarations for class members. + +1998-11-29 Jason Merrill + + * typeck2.c (process_init_constructor): Use same_type_p. + + * decl.c (check_tag_decl): Don't warn about null decl inside a + class. + + * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than + UNIFY_ALLOW_NONE. + (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE. + (resolve_overloaded_unification): Strip baselinks. + +Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi + + * g++spec.c: Don't prototype xmalloc. + +1998-11-25 Jason Merrill + + * except.c (expand_throw): Use TYPE_PTR_P to check for pointers. + + * decl.c (check_tag_decl): Do complain about null friend decl at + file scope. + +1998-11-25 Andreas Schwab + + * lex.c (make_lang_type): Clear the whole struct lang_type, not + only the first multiple of sizeof (int). + +1998-11-24 Jason Merrill + + * decl.c (start_decl): An explicit specialization of a static data + member is only a definition if it has an initializer. + + * except.c (expand_throw): Use cp_finish_decl for the throw temp. + * cvt.c (build_up_reference): Pass DIRECT_BIND down into + cp_finish_decl. + * init.c (expand_default_init): Check for DIRECT_BIND instead of + DECL_ARTIFICIAL. + + * call.c (build_over_call): Use build_decl. + + * except.c (expand_throw): Just use convert, not + build_reinterpret_cast. + + * lex.c (handle_generic_pragma): Use token_buffer. + + * decl.c (check_tag_decl): Don't complain about null friend decl. + +1998-11-24 Dave Pitts + + * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the + first position. + * lex.c (check_newline): Use ISALPHA. + (readescape): Use ISGRAPH. + (yyerror): Use ISGRAPH. + +1998-11-24 Nathan Sidwell + + * search.c (get_abstract_virtuals): Do not use initial + CLASSTYPE_ABSTRACT_VIRTUALS. + * typeck2.c (abstract_virtuals_error): Show location of abstract + declaration. + * call.c (build_new_method_call): Use + CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate. + * class.c (finish_struct_bits): Don't bother working out whether + get_abstract_virtuals will do anything, just do it. + +1998-11-24 Graham + + * typeck.c (build_component_ref): Remove unused statement. + +1998-11-24 Jason Merrill + + * class.c (add_method): Catch invalid overloads. + + * class.c (add_method): Build up OVERLOADs properly for conversion ops. + * search.c (lookup_conversions): Handle getting real OVERLOADs. + (add_conversions): Likewise. Revert last change. + * call.c (add_conv_candidate): Pass totype to add_candidate instead + of fn. Don't add a new candidate if the last one was for the same + type. + (print_z_candidates): Handle getting a type as a function. + (joust): If we got two conversion candidates to the same type, + just pick one. + (build_object_call): Lose 'templates'. + (build_user_type_conversion_1): Handle getting real OVERLOADs. + +1998-11-23 Jason Merrill + + * typeck2.c (process_init_constructor): If there are elements + that don't have initializers and they need to have constructors + run, supply them with initializers. + + * class.c (finish_struct_1): A class with a 0-width bitfield is + still empty. + +1998-11-23 Mark Mitchell + + * pt.c (instantiate_class_template): Don't try to figure out what + specialization to use for a partial instantiation. Correct + typos in a couple of comments. Avoid calling uses_template_parms + multiple times. + +1998-11-23 Benjamin Kosnik + + * method.c (process_overload_item): Add call to + build_mangled_C9x_name for intTI_type_nodes. + (build_mangled_C9x_name): Add prototype, define. + * decl.c (init_decl_processing): Add names for + TImode_type_node. + +1998-11-23 Jason Merrill + + * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS. + + * class.c (finish_struct_1): Set things up for 0-width bitfields + like we do for others. + + * decl.c (check_tag_decl): New fn. + (shadow_tag): Split out from here. + * decl2.c (grok_x_components): Call it. + +1998-11-22 Jason Merrill + + * decl.c: Lose warn_about_return_type. + (grokdeclarator): Always complain about implicit int, except for + `main () { ... }'. + + * decl.c (tag_name): New fn. + (xref_tag): Complain about using typedef-name after class-key. + + * init.c (expand_vec_init): Also keep going if from_array. + + * tree.c (is_overloaded_fn): Also handle the output of + build_offset_ref. + + * decl.c (grokdeclarator): Use constructor_name when comparing + field name against enclosing class. + * class.c (finish_struct_anon): Likewise. + +1998-11-22 Mark Mitchell + + * decl.c (poplevel): Remove code to handle KEEP == 2. + (finish_function): Don't confuse BLOCK-order when + processing a destructor. + +1998-11-21 Jason Merrill + + * decl.c (require_complete_types_for_parms): Call layout_decl + after we've completed the type. + +1998-11-21 Martin von Löwis + + * decl2.c (validate_nonmember_using_decl): Allow using templates + from the global namespace. + +1998-11-21 Jason Merrill + + Handle specifying template args to member function templates. + * tree.c (build_overload): Always create an OVERLOAD for a template. + * search.c (add_conversions): Handle finding an OVERLOAD. + * decl2.c (check_classfn): Likewise. + * lex.c (identifier_type): See through a baselink. + * parse.y (do_id): Don't call do_identifier if we got a baselink. + * class.c (instantiate_type, case TREE_LIST): Recurse. + + * decl.c (grokdeclarator): Allow a boolean constant for array + bounds, odd as that sounds. + + * pt.c (unify): Be more strict about non-type parms, except for + array bounds. + (UNIFY_ALLOW_INTEGER): New macro. + +1998-11-19 Manfred Hollstein + + * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir). + +1998-11-19 Jason Merrill + + * semantics.c (begin_class_definition): Call + maybe_process_partial_specialization before push_template_decl. + Don't call push_template_decl for a specialization. + * search.c (lookup_field): Do return a member template class. + * decl2.c (handle_class_head): Handle member template classes. + + * decl.c (grokdeclarator): A parm type need not be complete. + + * pt.c (convert_nontype_argument): Fix thinko. + +1998-11-18 Mark Mitchell + + * cp-tree.h (PTRMEM_CST_CLASS): Fix typo. + (global_delete_fndecl): New variable. + * decl.c (global_delete_fndecl): Define it. + (init_decl_processing): Set it. + * init.c (build_builtin_delete_call): Use it. + * tree.c (mapcar): Recursively call mapcar for the type of EXPR + nodes. + +1998-11-18 Jason Merrill + + * decl.c (cplus_expand_expr_stmt): Always complain about unresolved + type. + + * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue. + * call.c (build_object_call): Also support references to functions. + * typeck.c (convert_for_initialization): Don't decay a function + if the target is a reference to function. + + * search.c (add_conversions): Get all the overloads from a class. + + * decl.c (grok_ctor_properties): Complain about any constructor + that will take a single arg of the class type by value. + + * typeck2.c (build_functional_cast): Can't create objects of + abstract classes this way. + * cvt.c (ocp_convert): Likewise. + + * decl.c (grokfndecl): Member functions of local classes are not + public. + +1998-11-18 Mark Mitchell + + * Make-lang.in (cc1plus): Add dependency on hash.o. + +1998-11-18 Jason Merrill + + * search.c (get_abstract_virtuals): Complain about virtuals with + no final overrider. + * typeck2.c (abstract_virtuals_error): Remove handling for virtuals + with no final overrider. + * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P + on virtuals with no final overrider. + + * lex.c (reinit_parse_for_block): Add a space after the initial ':'. + + * class.c (finish_struct_1): Don't remove zero-width bit-fields until + after layout_type. + + * friend.c (do_friend): Don't set_mangled_name_for_decl. + + * class.c (finish_struct_anon): Complain about non-fields. + * decl2.c (build_anon_union_vars): Likewise. + + * decl.c (grokdeclarator): Normal data members can't have the same + name as the class, either. + * class.c (finish_struct_anon): Neither can members of an + anonymous union. + +1998-11-17 Mark Mitchell + + * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses. + (TYPE_BINFO): Likewise. + (IS_AGGR_TYPE): Tweak. + (SET_IS_AGGR_TYPE): New macro. + (CLASS_TYPE_P): Tweak. + (lang_type): Group mark bitfields together. Remove linenum. + (CLASSTYPE_SOURCE_LINE): Remove macro. + (CLASSTYPE_MARKED_N): New macro. + (SET_CLASSTYPE_MARKED_N): Likewise. + (CLEAR_CLASSTYPE_MARKED_N): Likewise. + (CLASS_TYPE_MARKED_*): Use them. + (SET_CLASSTYPE_MARKED_*): Likewise. + (CLEAR_CLASSTYPE_MARKED_*): Likewise. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. + (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well. + (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE. + * class.c (class_cache_obstack): New variable. + (class_cache_firstobj): Likewise. + (finish_struct): Don't set CLASSTYPE_SOURCE_LINE. + (pushclass): Free the cache, when appropriate. + (popclass): Tidy. + (maybe_push_cache_obstack): Use class_cache_obstack. + * decl.c (include hash.h). + (typename_hash): New function. + (typename_compare): Likewise. + (build_typename_type): Check the hash table to avoid creating + duplicates. + (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE. + (grokdeclarator): Use CLASS_TYPE_P. + (xref_basetypes): Likewise. + (start_function): Likewise. Don't put current_class_ref on the + permanent obstack. + * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO + and TYPE_TI_ARGS. + * lex.c (note_got_semicolon): Use CLASS_TYPE_P. + (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated + fields for types other than class types. Do clear TYPE_ALIAS_SET + for types other than class types, though. + * method.c (build_overload_identifier): Use CLASS_TYPE_P and + TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + * pt.c (process_template_parm): Don't set + CLASSTYPE_GOT_SEMICOLON. + (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + Coerce arguments on the momentary obstack. + (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + (instantiate_class_template): Calculate template arguments on the + momentary obstack. Tidy. + (tsubst_template_arg_vector): Use make_temp_vec. + (tsubst_aggr_type): Put template arguments on the momentary + obstack. + (tsubst_decl): Likewise. + (tsubst): Copy the array bounds index to the permanent obstack + before building index types. Use new macros. + (unify): Use new macros. + (do_type_instantiation): Likewise. + * search.c (lookup_fnfields_1): Use new macros. + (dfs_pushdecls): Build envelopes on the cache obstack. + (dfs_compress_decls): Use new macros. + (push_class_decls): Build on the cache obstack. + * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON. + * sign.c (build_signature_pointer_or_reference_type): Use + SET_IS_AGGR_TYPE. + * tree.c (make_binfo): Check CLASS_TYPE_P. + (copy_template_template_parm): Adjust. + (make_temp_vec): Use push_expression_obstack. + * typeck.c (complete_type): Use new macros. + (comptypes): Likewise. + +1998-11-17 Jason Merrill + + * pt.c (tsubst): Add diagnostics for invalid array, reference + and pointer to member types. + +1998-11-16 Jason Merrill + + * typeck2.c (my_friendly_abort): Don't fatal twice in a row. + + * typeck.c (c_expand_start_case): Use build_expr_type_conversion. + Simplify. + + * parse.y (structsp): Fix cut-and-paste error. + + * init.c (build_new): Complain about non-integral size. + + * parse.y (unary_expr): Complain about defining types in sizeof. + + * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn. + + * rtti.c (build_x_typeid): Complain about typeid without + including . + (get_typeid): Likewise. Complain about typeid of incomplete type. + (get_tinfo_fn_dynamic): Likewise. + (get_typeid_1): Not static anymore. + * except.c (build_eh_type_type): Use get_typeid_1. + + * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to + ambiguous or private bases. Fix warning for reference cast. + +1998-11-16 Mark Mitchell + + * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro. + * decl.c (duplicate_decls): Remove special-case code to deal with + template friends, and just do the obvious thing. + * pt.c (register_specialization): Tweak for clarity, and also to + clear DECL_INITIAL for an instantiation before it is merged with a + specialization. + (check_explicit_specialization): Fix indentation. + (tsubst_friend_function): Handle both definitions in friend + declaration and outside friend declarations. + (tsubst_decl): Don't clear DECL_INITIAL for an instantiation. + (regenerate_decl_from_template): Tweak accordingly. + (instantiate_decl): Likewise. + +1998-11-16 Jason Merrill + + * decl.c (cplus_expand_expr_stmt): Promote warning about naked + member function reference to error. + * cvt.c (ocp_convert): Complain about converting an overloaded + function to void. + + * init.c (build_offset_ref): Just return a lone static member + function. + + * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs, + not internal ones. + + * typeck.c (build_binary_op_nodefault): Improve error handling. + + * decl.c (grokfndecl): Complain about making 'main' a template. + + * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*. + + * call.c (build_method_call): Handle a BIT_NOT_EXPR around a + TYPE_DECL in a template. + +1998-11-15 Jason Merrill + + * typeck2.c (my_friendly_abort): Add URL in the other case, too. + + * decl.c (struct cp_function): Add named_label_uses. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + (define_label): Also complain about jumping into the scope of + non-POD objects that don't have constructors. + * tree.c (pod_type_p): New fn. + + * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner. + * rtti.c (synthesize_tinfo_fn): Call import_export_decl here. + (get_tinfo_fn): Not here. + * repo.c (repo_get_id): Abort if we get called for an incomplete + type. + +1998-11-13 Mark Mitchell + + * except.c (expand_throw): Make sure first argument to + __cp_push_exception is of type `void*' to avoid spurious error + messages. + +1998-11-11 Jason Merrill + + * pt.c (try_one_overload): Take orig_targs again. Only check for + mismatches against them; we don't care what a previous call found. + (resolve_overloaded_unification): Adjust. + + * search.c (lookup_field): Don't return anything for a non-type + field from a dependent type. + * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class + in an array declarator. + (start_decl): Push into the class before looking for the field. + +1998-11-08 Mark Mitchell + + * method.c (build_overload_value): Handle REFERENCE_TYPE. + +1998-11-08 Martin von Löwis + + * decl.c (grokdeclarator): Allow namespace-scoped members if they + are friends. + +1998-11-08 Jason Merrill + + * pt.c (tsubst_decl): Don't mess with the global value of an + un-mangled DECL_ASSEMBLER_NAME. + +1998-11-03 Christopher Faylor + + * decl.c (init_decl_processing): Remove CYGWIN conditional + since CYGWIN is now able to deal with trapping signals. + +Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi + + * cp-tree.h: Don't include gansidecl.h. + * exception.cc: Include gansidecl.h (since we don't include config.h) + * g++spec.c: Don't include gansidecl.h. + +1998-11-06 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease + size of dummy. + (DECL_DEFINED_IN_CLASS_P): New macro. + (TEMPLATE_PARMS_FOR_INLINE): Document. + (check_static_variable_definition): New function. + * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if + appropriate. + (check_static_variable_definition): Split out from ... + (grokdeclarator): Here. + * pt.c (check_default_tmpl_args): New function, split out from ... + (push_template_decl_real): Here. + (instantiate_template): Fix comment. + +1998-11-04 Mark Mitchell + + * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued. + (CP_TYPE_VOLATILE_P): Likewise. + (CP_TYPE_RESTRICT_P): Likewise. + +1998-11-03 Mark Mitchell + + * pt.c (tsubst): Use build_index_type, not build_index_2_type. + +1998-11-02 Jason Merrill + + * class.c (instantiate_type): Be more helpful. + + * decl2.c (import_export_decl): Call import_export_class. + + * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR. + * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR. + * pt.c (tsubst_copy): Likewise. + +1998-11-02 Mark Mitchell + + * init.c (expand_vec_init): Fix off-by-one error. + +1998-11-02 Alexandre Oliva + + * parse.y (apparent_template_type): New type. + (named_complex_class_head_sans_basetype): Use it. + * Makefile.in (CONFLICTS): One new conflict. + * parse.c: Regenerated. + +1998-11-01 Mark Mitchell + + * cp-tree.h (COMPARE_STRICT): New macro. + (COMPARE_BASE): Likewise. + (COMPARE_RELAXED): Likewise. + (COMPARE_REDECLARATION): Likewise. + (same_type_p): Likewise. + (same_or_base_type_p): Likewise. + * call.c (standard_conversion): Use them, in place of comptypes + with numeric arguments. + (reference_binding): Likewise. + (convert_like): Likewise. + (build_over_call): Likewise. + (is_subseq): Likewise. + (is_properly_derived_from): Likewise. + (compare_ics): Likewise. + (joust): Likewise. + * class.c (delete_duplicate_fields_1): Likewise. + (resolves_to_fixed_type_p): Likewise. + (instantiate_type): Likewise. Remove #if 0'd code. + * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here. + (pushdecl): Likewise. + (lookup_name_real): Likewise. + (grokdeclarator): Likewise. Check for illegal array declarations. + (grokparms): Likewise. + (grok_op_properties): Likewise. + * decl2.c (check_classfn): Likewise. + * friend.c (is_friend): Likewise. + (make_friend_class): Likewise. + * init.c (expand_aggr_init): Likewise. + (expand_vec_init): Likewise. + * pt.c (is_member_template_class): Remove declaration. + (is_specialization_of): Use COMPARE_* and new macros. + (comp_template_parms): Likewise. + (convert_nontype_argument): Likewise. + (coerce_template_template_parms): Likewise. + (template_args_equal): Likewise. + (lookup_template_class): Likewise. + (type_unification_real): Likewise. + (unify): Likewise. + (get_bindings_real): Likewise. + * search.c (covariant_return_p): Likewise. + (get_matching_virtual): Likewise. + * sig.c (match_method_types): Likewise. + * tree.c (vec_binfo_member): Likewise. + (cp_tree_equal): Likewise. + * typeck.c (common_type): Likewise. + (comp_array_types): Likewise. Get issues involving unknown array + bounds right. + (comptypes): Update comments. Use new flags. + (comp_target_types): Use new macros. + (compparms): Likewise. + (comp_target_parms): Likewise. + (string_conv_p): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_conditional_expr): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_assignment): Likewise. + (comp_ptr_ttypes_real): Likewise. + (ptr_reasonably_similar): Likewise. + (comp_ptr_ttypes_const): Likewise. + +1998-10-31 Jason Merrill + + * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error. + +1998-10-30 Mark Mitchell + + * decl2.c (delete_sanity): Pass integer_zero_node, not + integer_two_node, to build_vec_delete. + * init.c (build_array_eh_cleanup): Remove. + (expand_vec_init_try_block): New function. + (expand_vec_init_catch_clause): Likewise. + (build_vec_delete_1): Don't deal with case that auto_delete_vec + might be integer_two_node anymore. + (expand_vec_init): Rework for initialization-correctness and + exception-correctness. + * typeck2.c (process_init_constructor): Make mutual exclusivity + of cases more obvious. + +1998-10-29 Jason Merrill + + * decl.c (lookup_name_real): OK, only warn if not lexing. + Simplify suggested fix. + + * cp-tree.h (IDENTIFIER_MARKED): New macro. + * search.c (lookup_conversions): Use breadth_first_search. + (add_conversions): Avoid adding two conversions to the same type. + (breadth_first_search): Work with base binfos, rather + than binfos and base indices. + (get_virtual_destructor): Adjust. + (tree_has_any_destructor_p): Adjust. + (get_matching_virtual): Adjust. + + * pt.c (push_template_decl_real): Generalize check for incorrect + number of template parms. + (is_member_template_class): #if 0. + +1998-10-29 Richard Henderson + + * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@, + last. + +1998-10-28 Zack Weinberg + + * lex.c: Call check_newline from lang_init always. After + calling cpp_start_read, set yy_cur and yy_lim to read from the + cpplib token buffer. + +1998-10-28 Jason Merrill + + * class.c (instantiate_type): Don't consider templates for a normal + match. + + * class.c (finish_struct_1): Don't complain about non-copy + assignment ops in union members. + + * class.c (build_vtable): Don't pass at_eof to import_export_vtable. + (prepare_fresh_vtable): Likewise. + (finish_struct_1): Don't call import_export_class. + * decl2.c (finish_vtable_vardecl): Do import/export stuff. + (finish_prevtable_vardecl): Lose. + (finish_file): Don't call it. + * pt.c (instantiate_class_template): Likewise. + * cp-tree.h: Remove it. + + * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here. + * decl.c (finish_function): Not here. + (start_function): Do set DECL_INITIAL. + + * pt.c (push_template_decl_real): Complain about default template + args for enclosing classes. + + * call.c (add_function_candidate): Treat conversion functions + as coming from the argument's class. + * cp-tree.h (DECL_CONV_FN_P): New fn. + (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE. + * class.c (add_method): Use DECL_CONV_FN_P. + * decl2.c (check_classfn): Likewise. + * error.c (dump_function_name): Likewise. + (dump_function_decl): Likewise. + * pt.c (fn_type_unification): Likewise. + * search.c (add_conversions): Likewise. + +1998-10-27 Jason Merrill + + * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL. + * method.c (hack_identifier): Also check for using RESULT_DECL + from outer context. + +1998-10-27 Mark Mitchell + + * decl.c (grokdeclarator): Use type_quals, rather than constp, + consistently. + +1998-10-27 Jason Merrill + + * call.c (standard_conversion): instantiate_type here. + (reference_binding): And here. + (implicit_conversion): Not here. + (build_op_delete_call): No need to cons up an OVERLOAD. + * cvt.c (cp_convert_to_pointer): instantiate_type here. + (convert_to_reference): And here. + * decl.c (grok_reference_init): Not here. + (grokparms): Or here. + * typeck2.c (digest_init): Or here. + * typeck.c (decay_conversion): Take the address of overloaded + functions, too. + (require_instantiated_type): Lose. + (convert_arguments): Don't handle unknown types here. + (build_c_cast): Likewise. + (build_binary_op): Gut. + (build_conditional_expr): Don't require_instantiated_type. + (build_modify_expr): Likewise. + (build_static_cast): Don't instantiate_type. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (convert_for_initialization): Likewise. + (build_ptrmemfunc): Use type_unknown_p. + (convert_for_assignment): Also do default_conversion on overloaded + functions. Hand them off to ocp_convert. + +1998-10-26 Mark Mitchell + + * error.c (dump_decl): Deal with TEMPLATE_DECLs that are + VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type. + + * class.c (finish_struct_1): Use build_cplus_array_type to build + array types. + * decl.c (init_decl_processing): Likewise. + * except.c (expand_end_eh_spec): Likewise. + * search.c (expand_upcast_fixups): Simplify very slightly. + +1998-10-26 Jason Merrill + + * decl.c (grokdeclarator): Complain about a variable using + constructor syntax coming back null from start_decl. + + * friend.c (make_friend_class): Complain about trying to make + a non-class type a friend. + + * decl.c (grokfndecl): Set DECL_INITIAL for a defn here. + (start_function): Not here. + +1998-10-26 Brendan Kehoe + + * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration. + +1998-10-26 Jason Merrill + + * typeck2.c (process_init_constructor): Only skip anonymous fields + if they are bitfields. + + * cp-tree.def (TYPEOF_TYPE): New code. + * error.c (dump_type_real): Handle it. + * pt.c (tsubst): Likewise. + * tree.c (search_tree): Likewise. + * semantics.c (finish_typeof): New fn. + * parse.y (typespec): Use it. + * cp-tree.h: Declare it. + +1998-10-26 Manfred Hollstein + + * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional. + +1998-10-26 Jason Merrill + + * typeck.c (convert_arguments): Don't handle pmf references + specially. + + * init.c (build_member_call): Don't try to convert to the base type + if it's ambiguous or pedantic. + + * typeck2.c (check_for_new_type): Only depend on pedantic for + C-style casts. + +1998-10-25 Mark Mitchell + + * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all + non-converting constructors. + +1998-10-24 Martin von Löwis + + * gxxint.texi: Correct documentation for n, N, Q, and B. + +1998-10-23 Martin von Löwis + + * parse.y (condition): Convert VAR_DECL from reference to indirect + reference. + +1998-10-23 Andrew MacLeod + + * exception.cc (__cp_pop_exception): Free the original exception + value, not the potentially coerced one. + +1998-10-23 Mark Mitchell + + * Makefile.in (hash.h): Run gperf when necessary. + + * cp-tree.h (CP_TYPE_READONLY): Remove. + (CP_TYPE_VOLATILE): Likewise. + (CP_TYPE_QUALS): New macro. + (CP_TYPE_CONST_P): Likewise. + (CP_TYPE_VOLATILE_P): Likewise. + (CP_TYPE_RESTRICT_P): Likewise. + (CP_TYPE_CONST_NON_VOLATILE_P): Likewise. + (cp_build_type_variant): Rename to ... + (cp_build_qualified_type): New function. + (c_apply_type_quals_to_decl): Declare. + (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'. + (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise. + (cp_type_qual_from_rid): New function. + (compparms): Remove unused parameter. All callers changed. + (cp_type_quals): New function. + (at_least_as_qualified_p): Likewise. + (more_qualified_p): Likewise. + + * call.c (standard_conversion): Replace calls to + cp_build_type_variant with cp_build_qualified_type. Use + CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to + compare them. Use CP_TYPE_* macros to check qualifiers. + (reference_binding): Likewise. + (implicit_conversion): Likewise. + (add_builtin_candidates): Likewise. + (build_over_call): Likewise. + * class.c (overrides): Compare all qualifiers, not just `const', + on method declarations. + * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc. + (convert_pointer_to_real): Likewise. + (type_promotes_to): Likewise. + * decl.c (check_for_uninitialized_const_var): New function. + (init_decl_processing): More CP_TYPE_QUALS conversion, etc. + (cp_finish_decl): Use check_for_uninitialized_const_var. + (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to + handle `restrict'. + (grok_ctor_properties): Likewise. + (grok_op_properties): Likewise. + (start_function): Likewise. + (rever_static_member_fn): Likewise. + * decl2.c (grok_method_quals): Likewise. + (grokfield): Likewise. + * error.c (dump_readonly_or_volatile): Rename to ... + (dump_qualifiers): New function. Handle `restrict'. + (dump_type_real): Use it. + (dump_aggr_type): Likewise. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_function_decl): Likewise. + (cv_as_string): Likewise. + * gxx.gperf: Add __restrict and __restrict__. + * gxxint.texi: Document `u' as used for `__restrict', and a few + other previously undocumented codes. + * hash.h: Regenerated. + * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc. + (build_member_call): Likewise. + (build_new_1): Likewise. + * lex.c (init_parse): Add entry for RID_RESTRICT. + (cons_up_default_function): More CP_TYPE_QUALS conversion, etc. + (cp_type_qual_from_rid): Define. + * lex.h (enum rid): Add RID_RESTRICT. + * method.c (process_modifiers): Deal with `restrict'. + * parse.y (primary): More CP_TYPE_QUALS conversion, etc. + * parse.c: Regenerated. + * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc. + (tsubst_aggr_type): Likewise. + (tsubst): Likewise. + (check_cv_quals_for_unify): Likewise. + (unify): Likewise. + * rtti.c (init_rtti_processing): Likewise. + (build_headof): Likewise. + (get_tinfo_var): Likewise. + (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling. + (expand_class_desc): Likewise. + (expand_attr_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (covariant_return_p): Likewise. Fix `volatile' handling. + (get_matching_virtual): Likewise. + (expand_upcast_fixups): Likewise. + * sig.c (build_signature_pointer_or_reference_name): Take + type_quals, not constp and volatilep. + (build_signature_pointer_or_reference_type): Likewise. + (match_method_types): More CP_TYPE_QUALS conversion, etc. + (build_signature_pointer_constructor): Likewise. + (build_signature_method_call): Likewise. + * tree.c (build_cplus_array_type): Likewise. + (cp_build_type_variant): Rename to ... + (cp_build_qualified_type): New function. Deal with `__restrict'. + (canonical_type_variant): More CP_TYPE_QUALS conversion, etc. + (build_exception_variant): Likewise. + (mapcar): Likewise. + * typeck.c (qualif_type): Likewise. + (common_type): Likewise. + (comptypes): Likewise. + (comp_cv_target_types): Likewise. + (at_least_as_qualified_p): Define. + (more_qualified_p): Likewise. + (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc. + (compparms): Likewise. + (inline_conversion): Likewise. + (string_conv_p): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_array_ref): Likewise. + (build_unary_op): Likewise. + (build_conditional_expr): Likewise. + (build_static_cast): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_For_assignment): Likewise. + (comp_ptr_ttypes_real): Likewise. + (cp_type_quals): New function. + +1998-10-23 Jason Merrill + + * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays. + (CP_TYPE_VOLATILE): Likewise. + * decl.c (grokdeclarator): Use them. + * tree.c (canonical_type_variant): Likewise. + +1998-10-22 Martin von Löwis + + * parse.y (named_class_head): Push into class while parsing the + base class list. + * decl2.c (push_scope, pop_scope): New functions. + * cp-tree.h: Declare them. + * init.c (build_new_1): Delay cleanup until end of full expression. + +1998-10-21 Jason Merrill + + * typeck.c (build_component_ref): Use of a type here is an error. + +1998-10-19 Jason Merrill + + Revamp references to member functions. + * method.c (hack_identifier): Call build_component_ref for a + reference to a member function. + * typeck.c (build_component_ref): Only return a single function + if it's static. Otherwise, return a COMPONENT_REF. + (build_x_function_call): Handle a COMPONENT_REF. + (build_unary_op): Handle all unknown-type things. + * decl2.c (arg_assoc): Handle COMPONENT_REF. + * class.c (instantiate_type): Complain if the function we get is a + nonstatic member function. Remove code for finding "compatible" + functions. + * pt.c (tsubst_copy): Handle NOP_EXPR. + * tree.c (build_dummy_object): New fn. + (maybe_dummy_object): New fn. + (is_dummy_object): New fn. + * cp-tree.h: Declare them. + * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object. + * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object. + * init.c (build_member_call): Use maybe_dummy_object and + is_dummy_object. + (build_offset_ref): Use maybe_dummy_object. + (resolve_offset_ref): Use is_dummy_object. + * typeck.c (build_x_function_call): Call build_dummy_object. + (unary_complex_lvalue): Call is_dummy_object. + + * typeck.c (build_component_addr): Make sure field is a field. + + * call.c (build_new_op): Delete obsolete code. + + * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. + +1998-10-18 Martin von Löwis + + * decl2.c (validate_nonmember_using_decl): Fix using-directives of + std if std is ignored. + +1998-10-18 Jason Merrill + + * decl.c (grokvardecl): Fix thinko. + + * decl.c (grokdeclarator): Embedded attrs bind to the right, + not the left. + + * parse.y (fn.def2): Fix 'attrs' format. + +1998-10-18 Alastair J. Houghton + + * Makefile.in (CONFLICTS): Update. + * parse.y (expr_or_declarator_intern): New rule. + (expr_or_declarator, direct_notype_declarator, primary, + functional_cast): Use it. + (notype_declarator_intern): New rule. + (notype_declarator, complex_notype_declarator): Use it. + +1998-10-17 Jason Merrill + + * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate. + (grokvardecl): Likewise. + +Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi + + * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR). + (add_method): Likewise for arguments 1 & 2 of `bcopy'. + + * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN. + + * pt.c (process_partial_specialization): Cast 1st argument of + `bzero' to (PTR). + + * tree.c (build_base_fields): Cast `base_align' to (int) when + comparing against one. + +1998-10-16 Mark Mitchell + + * decl.c (lookup_name_real): Handle template parameters for member + templates where said parameters have the same name as the + surrounding class. + + * decl.c (expand_static_init): Build cleanups before entering the + anonymous function used to do them to avoid access-checking + confusion. + + * decl.c (grokfndecl): Add back call to cplus_decl_attributes + accidentally removed by previous change, and make DECL_RTL here. + * class.c (add_method): Don't make DECL_RTL here. + + * pt.c (for_each_template_parm): Don't examine uninstantiated + default arguments. + +1998-10-16 Dave Brolley + + * lex.c (real_yylex): Fix unaligned access of wchar_t. + +1998-10-16 Mark Mitchell + + * class.c (add_method): Fix documentation to reflect previous + changes. Check for duplicate method declarations here. + * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL + correctly; such things never match. + (grokfndecl): Don't look for duplicate methods here. + * decl2.c (check_classfn): Don't assume names are mangled. + Don't add bogus member function declarations to a class before the + class type is complete. + (grokfield): Reformat error message. + * method.c (set_mangled_name_for_decl): Don't mangle names while + processing_template_decl. + +1998-10-16 Jason Merrill + + * typeck.c (build_indirect_ref): Complain about a pointer to data + member, too. + * typeck2.c (build_m_component_ref): Don't indirect a pointer to + data member. + * init.c (resolve_offset_ref): Don't undo the above. + + * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros. + (struct lang_decl_flags): Add `bitfield'. + * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of + DECL_BIT_FIELD. + * decl2.c (grokbitfield, grok_alignof): Likewise. + * init.c (build_offset_ref): Likewise. + * typeck.c (build_component_addr, expr_sizeof): Likewise. + * cvt.c (build_up_reference): Don't crash if taking the address + returns error_mark_node. + + * decl.c (grokfndecl): Also check ctype when checking for ::main(). + +1998-10-15 Jason Merrill + + * decl.c (grokfndecl): ::main and __builtin_* get C linkage. + Do mangling here. + (grokdeclarator): Instead of here. + * friend.c (do_friend): Lose special handling of ::main and + __builtin_*. + * cp-tree.h (DECL_MAIN_P): Check for C linkage. + + * spew.c (yylex): Clear looking_for_typename if we got + 'enum { ... };'. + +1998-10-15 Mark Mitchell + + * class.c (maybe_warn_about_overly_private_class): Improve error + messages for class with only private constructors. + + * cp-tree.def (TYPENAME_TYPE): Add to documentation. + * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document. + (build_typename_type): New function. + * decl.c (build_typename_type): Broken out from ... + (make_typename_type): Use it. + * search.c (lookup_field): Likewise. + +1998-10-14 Benjamin Kosnik + + * pt.c (convert_nontype_argument): Check against type_referred_to. + * decl.c (grokvardecl): Check for declarator name before building + DECL_ASSEMBLER_NAME. + +1998-10-14 Mark Mitchell + + * pt.c (lookup_template_class): Add comment. + (instantiate_class_template): Don't mark the _TYPE node for + member class templates as an instantiation. + +1998-10-14 Jason Merrill + + * decl.c (grokfndecl): Fix my thinko. + +1998-10-13 Jason Merrill + + * tinfo2.cc (fast_compare): Remove. + (before): Just use strcmp. + * tinfo.cc (operator==): Just use strcmp. + +1998-10-13 Klaus-Georg Adams + + * decl.c (grokfndecl): Don't check for linkage in `extern "C"' + declarations. + +1998-10-13 Mark Mitchell + + * cp-tree.h (specializations_of_same_template_p): Remove. + * search.c (get_template_base): Don't use it. + (get_template_base_recursive): Likewise. + * pt.c (specializations_of_same_template_p): Remove. + (unify): Don't use it. + (lookup_template_class): Find the correct parent when setting + CLASSTYPE_TI_TEMPLATE. + +1998-10-12 Jason Merrill + + * tinfo.cc (operator==): Always compare names. + +1998-10-12 Herman ten Brugge + + * decl.c (start_function): Fix cut-and-paste error. + +1998-10-12 Jason Merrill + + * inc/typeinfo: Add #pragma interface. + (operator!=): Just call operator==. + * tinfo.cc: Add #pragma implementation. + (operator==): Move from inc/typeinfo and tinfo2.cc. + Check __COMMON_UNRELIABLE instead of _WIN32. + + * typeck2.c (my_friendly_abort): Add URL. + +1998-10-12 Alastair J. Houghton + + * decl.c (start_method): Added extra parameter for attributes. + * cp-tree.h (start_method): Update prototype. + * parse.y (fn.def2): Update start_method parameter list. + +1998-10-11 Mark Mitchell + + * cp-tree.h (specializations_of_same_template_p): Declare. + * pt.c (specializations_of_same_template_p): New function. + (unify): Use it. + * search.c (get_template_base): Use it. + (get_template_base_recursive): Likewise. + +1998-10-10 Manfred Hollstein + + * decl2.c (start_objects): Add new variable `joiner' and + initialize it properly. + +1998-10-09 Mark Mitchell + + * search.c (expand_upcast_fixups): Tweak to match 1998-10-07 + change to vtable types. + + * cvt.c (ocp_convert): Avoid infinite recursion caused by + 1998-10-03 change. + +1998-10-08 Jason Merrill + + * pt.c (resolve_overloaded_unification): New fn. + (try_one_overload): Likewise. + (unify): Don't fail on unknown type. + (type_unification_real): Likewise. Use resolve_overloaded_unification + to handle an overloaded argument. + (template_args_equal): Split out... + (comp_template_args): From here. + (determine_specialization): Also allow a template with more + parms than were explicitly specified. + * cp-tree.h: Add template_args_equal. + * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code. + +Thu Oct 8 15:58:30 1998 Anthony Green + + * semantics.c (finish_asm_stmt): Revert my 1998-09-28 + change. + +Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com) + + * typeck.c (unsigned_type): Only return TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + (signed_type): Likewise. + * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + (init_decl_processing): Only create TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + +Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi + + * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf. + (gxx.gperf): Update comments describing invocation flags. + (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs). + +1998-10-07 Mark Mitchell + + * class.c (finish_struct_1): Add commentary on previous change. + + * cp-tree.h (vtbl_ptr_type_node): New variable. + * class.c (build_vtbl_ref): Don't indirect through the vptr; it's + already of the right type. + (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node. + Simplify code to grow vtable. + * decl.c (vtbl_ptr_type_node): Define. + (init_decl_processing): Initialize it. + +1998-10-06 Mark Mitchell + + * cp-tree.def (PTRMEM_CST): New tree node. + * cp-tree.h (ptrmem_cst): New type. + (lang_type): Remove local_typedecls. + (dummy): Increase to 12 bits from 11. + (CLASSTYPE_LOCAL_TYPEDECLS): Remove. + (PTRMEM_CST_CLASS): New macro. + (PTRMEM_CST_MEMBER): Likewise. + (current_access_specifier): New variable. + (current_class_type): Remove duplicate declaration. + (finish_struct): Change prototype. + (unreverse_member_declarations): New function. + (pushdecl_class_level): Change prototype. + (grok_enum_decls): Remove. + (fixup_anonymous_union): New function. + (grok_x_components): Change prototype. + (tsubst_chain): Remove. + (finish_member_template_decl): Likewise. + (check_explicit_specialization): Fix indentation. + (finish_class_definition): Change prototype. + (finish_member_class_template): Likewise. + (finish_member_declaration): New function. + (check_multiple_declarators): Likewise. + * class.c (class_stack_node_t): New type. + (current_class_base): Remove. + (current_class_stack): Change type. + (current_access_specifier): New variable. + (grow_method): Remove. + (check_member_decl_is_same_in_complete_scope): Break out from + finish_struct. + (make_method_vec): New function. + (free_method_vec): Likewise. + (add_implicitly_declared_members): Break out from finish_struct_1. + (free_method_vecs): New variable. + (add_method): Rework for direct use from parser. + (handle_using_decl): Watch for NULL_TREE while iterating through + CLASSTYPE_METHOD_VEC. + (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; + just do some error-checking. + (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. + (finish_struct_1): Simplify. Use add_implicitly_declared_members. + (finish_struct): Change prototype. Simplify; fields and methods + are already set up at this point. + (init_class_processing): Set up current_class_stack. + (pushclass): Save current_access_specifier. + (popclass): Restore it. + (currently_open_class): Simplify. + (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. + * decl.c (saved_scope): Add access_specifier. + (maybe_push_to_top_level): Save it. + (pop_from_top_level): Restore it. + (maybe_process_template_type_declaration): Use + finish_member_declaration. + (pushtag): Likewise. + (pushdecl_class_level): Don't return a value. + (fixup_anonymous_union): Break out from grok_x_components. + (shadow_tag): Use it. + (xref_tag): Complain about using an elaborated type specifier to + reference a template type parameter or typedef name. + (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. + (current_local_enum): Remove. + (build_enumerator): Call finish_member_declaration. + (grok_enum_decls): Remove. + * decl2.c (grok_x_components): Simplify. + (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. + (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. + (merge_functions): Add to comment. + (arg_assoc_type): Prototype. + (arg_assoc): Pass as many arguments as there are parameters. + * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of + OFFSET_REF. + * expr.c (cpls_expand_expr): Remove dead code. Handle + PTRMEM_CST. + * friend.c (do_friend): Lookup friends when in nested classes. + Change comments. + * init.c (build_offset_ref): Do lookup even for classes that are + only partially defined. + (decl_constant_value): Remove dead code. + * method.c (build_overload_value): Remove hack where by TYPE was + not a TYPE. Handle PTRMEM_CST. + (build_template_parm_names): Don't pass a PARM_DECL where a TYPE + should go. + * parse.y (components, notype_components, component_decl, + component_decl_1, component_declarator, component_declarator0): + Now all are itype rather than ttype. Rework to add members to + classes on the fly. + (typesqpecqual_reserved): Use check_multiple_declarators. + (structsp): Update class to finish_class_definition. + (do_xref_defn): Unsplit into named_class_head. + (access_specifier): Set current_access_specifier. + * pt.c (set_current_access_from_decl): New function. + (finish_member_template_decl): Don't take the parameters. + (comp_template_args): Make more robust. + (lookup_template_class): Don't use current_local_enum. + (for_each_template_parm): Handle PTRMEM_CST. + (instantiate_class_template): Use set_current_access_from_decl, + finish_member_declaration and unreverse_member_declarations. Set + lineno/input_filename before generating implicit member functions. + (type_unification_real): Don't assume back-unification happens + only for the last argument. + (regenerate_decl_from_template): Call pushclass a bit earlier. + (tsubst_chain): Remove. + (tsubst_enum): Use set_current_access_from_decl. + (set_mangled_name_for_template_decl): Fix indentation. + * search.c (lookup_fnfields_1): Change iteration through + CLASSTYPE_METHOD_VEC. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + (add_conversions): Likewise. + * semantics.c (finish_class_definition): Don't take components. + Change call to finish_struct. + (finish_member_declaration): New function. + (finish_member_class_template): Don't take template parameters. + Change call to grok_x_components. Call finish_member_template_decl. + (check_multiple_declarators): New function. + * sig.c (append_signature_fields): Work from the TYPE_METHODS, not + a passed in fieldlist. + * tree.c (search_tree): Handle PTRMEM_CST. + (mapcar): Likewise. + * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not + INTEGER_CSTs, for pointer-to-data members. + + * call.c (resolve_args): Resolve template specializations, if + possible. + +Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi + + * Makefile.in (spew.o): Depend on toplev.h. + + * call.c (compare_ics): Initialize variables `deref_from_type2', + `deref_to_type1' and `deref_to_type2'. + + * except.c (get_eh_type): Hide prototype and definition. + (process_start_catch_block_old): Remove unused static prototype. + + * pt.c (tsubst_decl): Initialize variable `argvec'. + + * spew.c: Include toplev.h. + +1998-10-05 Jason Merrill + + * pt.c (instantiate_decl): Do save and restore file position. + +1998-10-05 Martin von Löwis + + * method.c (build_decl_overload_real): Clear + numeric_output_need_bar after __. + +1998-10-05 Nathan Sidwell + + * call.c (build_new_method_call): Issue 'incomplete type' error, + if class is not defined. + +1998-10-05 Kaveh R. Ghazi + + * call.c (build_object_call): Move declaration of variable + `fn' into the scope where it is used. Don't access variable + `fn' when it is uninitialized, instead use `fns'. + +1998-10-04 Theodore Papadopoulo + + * errfn.c (cp_thing): Print buf as a string not as a printf format + to avoid problems with the operator%. Consequently, `%%' sequences + in format are copied as `%' in buf. + +1998-10-04 Jason Merrill + + * pt.c (pop_tinst_level): Call extract_interface_info. + (instantiate_decl): Don't save and restore file position. + + * decl.c (cp_finish_decl): Make statics in extern inlines and + templates common, if possible and the target doesn't support weak + symbols. + + * decl.c (grokdeclarator): Remove redundant calls to + build_type_variant and some duplicated code. + * sig.c (build_signature_reference_type): Only take the type parm. + (build_signature_pointer_type): Likewise. + * tree.c (build_cplus_method_type): Adjust. + * cp-tree.h: Update. + +1998-10-04 Mark Mitchell + + * call.c (build_over_call): Make pedwarns about dropped qualifiers + into full-fledged errors. + * cvt.c (convert_to_reference): Likewise. + * typeck.c (convert_for_assignment): Likewise. + + * search.c (expand_upcast_vtables): In addition to unsetting + TREE_READONLY, remove top-level const type qualifier. + +1998-10-03 Mark Mitchell + + * class.c (current_class_ptr, current_class_ref): Clarify + documentation. + * cvt.c (ocp_convert): Don't expect fold to remove all trivial + NOP type conversions. + * decl.c (decls_match): Use comptypes directly; ignore + qualifiers on the DECL. + (duplicate_decls): Remove qualifier checks on DECL. + (grokdeclarator): Make the type built up include top-level + qualifiers. + * decl2.c (do_dtors): Fix spelling error. + * error.c (dump_simple_decl): Don't look at qualifiers on the decl + when printing type information. + * init.c (build_new_1): Add documentation. Deal with the fact + that type of allocated memory now contains qualifiers. + * lex.c (is_global): Improve error-recovery. + * sig.c (build_member_function_pointer): Don't cast away const + on fields of sigtable_entry_type. + * tree.c (lvalue_type): Don't look at top-level qualifiers on + expressions. + * typeck.c (decay_conversion): Likewise. + (build_component_ref): Make sure the type of the COMPONENT_REF + contains top-level qualifiers, as appropriate. Improve + error-handling. + (build_indirect_ref): Simplify. Don't strip top-level qualifiers. + (build_array_ref): Likewise. + (build_unary_op): Improve error-recovery. + (unary_complex_lvalue): Make taking the address a bound member + function an error, not a sorry. + (build_conditional_expr): Look at the type qualifiers, not the + qualifiers on the expression itself. + +1998-10-03 Jason Merrill + + * decl2.c (merge_functions): Remove duplicates. + + * decl2.c: Add -f{no-,}implicit-inline-templates. + (import_export_decl): Check it. + + * decl.c (lookup_name_real): Template parms also take precedence + over implicit typename. Only warn if yylex. + + * typeck.c (build_conditional_expr): Only fold if ifexp is an + INTEGER_CST. + + * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN + instead of linkage. + +1998-10-01 Jason Merrill + + * cp-tree.h (FORMAT_VBASE_NAME): New macro. + * class.c (build_vbase_pointer): Use it. + * rtti.c (expand_class_desc): Likewise. + * tree.c (build_vbase_pointer_fields): Likewise. + +Thu Oct 1 10:43:45 1998 Nick Clifton + + * decl.c (start_decl): Add invocation of + SET_DEFAULT_DECL_ATTRIBUTES, if defined. + (start_function): Add invocation of + SET_DEFAULT_DECL_ATTRIBUTES, if defined. + + * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with + HANDLE_GENERIC_PRAGMAS. + +1998-09-28 Anthony Green + + * semantics.c (finish_asm_stmt): Always permit volatile asms. + +1998-09-28 Mark Mitchell + + * decl.c (grokdeclarator): Tighten checks for invalid + destructors. Improve error-messages and error-recovery. + * decl2.c (check_classfn): Don't assume that mangled destructor + names contain type information. + +1998-09-25 Jason Merrill + + * search.c (get_base_distance): Remove assert. + + * decl2.c (build_anon_union_vars): Don't process a field with no + name. + (finish_anon_union): Also complain about local anon unions with no + members. + +1998-09-25 Martin von Löwis + + * decl.c (lookup_namespace_name): If the name is a namespace, + return it immediately. + +Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi + + * cp-tree.h (define_case_label): Remove unused parameter. + (check_java_method): Likewise. + (grokclassfn): Likewise. + (expand_aggr_init): Likewise. + (build_x_delete): Likewise. + (maybe_end_member_template_processing): Likewise. + (unshare_base_binfos): Add prototype. + (string_conv_p): Likewise. + (my_friendly_abort): Mark with ATTRIBUTE_NORETURN. + + * cvt.c (build_up_reference): Remove unused parameter + `checkconst', all callers changed. + (build_type_conversion): Mark parameter `code' with + ATTRIBUTE_UNUSED. + (build_expr_type_conversion): Initialize variable `conv'. + + * decl.c (push_namespace): Initialize variable `d'. + (define_case_label): Remove unused parameter `decl', all callers + changed. + + * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter + `argc' with ATTRIBUTE_UNUSED. + (grokclassfn): Remove unused parameter `cname', all callers + changed. + (check_java_method): Likewise for parameter `ctype'. + (copy_assignment_arg_p): Mark parameter `virtualp' with + ATTRIBUTE_UNUSED. + (finish_prevtable_vardecl): Likewise for parameter `prev'. + + * expr.c (extract_init): Likewise for parameters `decl' and `init'. + + * init.c (expand_aggr_init_1): Remove unused parameter + `alias_this', all callers changed. + (expand_aggr_init): Likewise. + (expand_default_init): Likewise. + (build_new_1): Initialize variable `susp'. + (build_x_delete): Remove unused parameter `type', all callers + changed. + + * lex.c (set_typedecl_interface_info): Mark parameter `prev' with + ATTRIBUTE_UNUSED. + (readescape): Use (unsigned) value in shift. + (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when + comparing to a signed quantity. + + * pt.c (maybe_end_member_template_processing): Remove unused + parameter `decl', all callers changed. + (check_explicit_specialization): Add braces around empty body in + an else-statement. + (current_template_args): Initialize variable `args'. + (lookup_template_class): Likewise for variable `prev_local_enum'. + (tsubst_decl): Likewise for variable `r'. + (set_mangled_name_for_template_decl): Initialize variable + `context'. + + * spew.c (scan_tokens): Change type of parameter `n' to unsigned. + Likewise for variable `i'. + (yylex): Initialize variable `trrr'. + + * typeck.c (compparms): Mark variable `strict' with + ATTRIBUTE_UNUSED. + + * xref.c (simplify_type): Cast argument of ctype function to + `unsigned char'. + +1998-09-24 Mark Mitchell + + * cp-tree.h (language_lvalue_valid): Remove. + * decl.c (grokdeclarator): Don't disallow references to functions. + * tree.c (lvalue_p_1): New function, combining duplicated + code from ... + (lvalue_p): Use it. + (real_lvalue_p): Likewise. + * typeck.c (language_lvalue_valid): Remove. + (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though + they don't have TREE_READONLY set. + * typeck2.c (readonly_error): Add case for FUNCTION_DECLs. + +1998-09-24 Benjamin Kosnik + + * spew.c (yylex): Give diagnostic. + * hash.h (is_reserved_word): Add export. + * gxx.gperf: Likewise. + * lex.h (rid): Add RID_EXPORT. + * lex.c (init_parse): Likewise. + +Tue Sep 22 21:01:19 1998 Gerald Pfeifer + + * friend.c (do_friend): Make warning a full sentence. + +1998-09-22 Mark Mitchell + + * parse.y (component_decl_list): Improve error-recovery. + +1998-09-22 Benjamin Kosnik + + * decl.c (make_typename_type): Move error to point where name + variable can be used by dump_type. + +1998-09-22 Mark Mitchell + + * decl.c (grokfndecl): Improve error-recovery. + * decl2.c (grokfield): Likewise. + * pt.c (finish_member_template_decl): Likewise. + +1998-09-20 Martin von Löwis + + * method.c (hack_identifier): Finding multiple members is always + an error. + +1998-09-21 Per Bothner + + * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o. + +Mon Sep 21 01:53:05 1998 Felix Lee + + * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT (). + +1998-09-20 Mark Mitchell + + * class.c (maybe_warn_about_overly_private_class): Reformat. + +1998-09-17 Andrew MacLeod + + * exception.cc (__cplus_type_matcher): Realign some code. + +1998-09-16 Mark Mitchell + + * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling. + (tinfo2.o): Likewise. + (exception.o): Likewise. + (new.o): Likewise. + (opnew.o): Likewise. + (opnewnt.o): Likewise. + (opvnew.o): Likewise. + (opvnewnt.o): Likewise. + (opdel.o): Likewise. + (opdelnt.o): Likewise. + (opvdel.o): Likewise. + (opvdelnt.o): Likewise. + +1998-09-16 Richard Henderson + + * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp. + +1998-09-15 Alexandre Oliva + + * call.c (build_field_call): Handle static data members too. + + * typeck.c (comptypes): When comparing pointer types, check + whether referred types match even in strictest modes. + +1998-09-15 Mark Mitchell + + * cp-tree.h: Revert previous change. + (finish_struct_methods): Remove declaration. + * class.c: Revert previous change. + (maybe_warn_about_overly_private_class): New function. + (finish_struct_methods): Declare here, and make static. Remove + unnecessary parameters. Tidy slightly. Use + maybe_warn_about_overly_private_class. + (finish_struct_1): Adjust. Remove check for private constructors, + now done elsewhere. + (finish_struct): Adjust. + +1998-09-15 Andrew MacLeod + + * except.c (expand_start_catch_block): No need to check for new + exception model. + (process_start_catch_block_old): Deleted. + (process_start_catch_block): Add call to start_decl_1(). + (expand_end_catch_block): Add call to end_catch_handler(). + * exception.cc (__cplus_type_matcher): Only check the exception + language if there is an exception table. + +1998-09-15 Andrew MacLeod + + * search.c (expand_indirect_vtbls_init): Mark temporary stack slots + as used to prevent conflicts with virtual function tables. + +1998-09-14 Mark Mitchell + + * cp-tree.h (lang_type): Add has_non_private_static_mem_fn. + (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it. + * class.c (maybe_class_too_private_p): New function. + (finish_struct_methods): Use it. + (finish_struct_1): Likewise. + (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if + appropriate. + + * pt.c (check_specialization_scope): Fix spelling error. + (check_explicit_specialization): Remove code to handle explicit + specializations in class scope; they are now correctly diagnosed + as errors. + +1998-09-10 Mark Mitchell + + * decl.c (pushdecl): Don't copy types if the + DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the + type. + +1998-09-09 Kriang Lerdsuwanakij + + * class.c (get_enclosing_class): New function. + (is_base_of_enclosing_class): Likewise. + * cp-tree.h (get_enclosing_class): Declare. + (is_base_of_enclosing_class): Likewise. + * pt.c (coerce_template_parms): Use them. + +1998-09-09 Jason Merrill + + * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is + null to decide whether to use it. + + * error.c (dump_type_real): Handle NAMESPACE_DECL. + * parse.y (base_class.1): Avoid crash on error. + +1998-09-08 Martin von Löwis + + * decl.c (make_typename_type): If context is a namespace, the code + is in error. + +1998-09-08 Mumit Khan + + * parse.y (nomods_initdcl0): Set up the parser stack correctly. + +1998-09-08 Mark Mitchell + + * cp-tree.h (anonymous_namespace_name): Declare. + * decl.c: Define it. + (push_namespace): Use anonymous_namespace_name, rather than local + static anon_name. + * error.c (dump_decl): If a namespace is named + anonymous_namespace_name, call it {anonymous}. + + * decl.c (grokparms): Distinguish between references and pointers + in error message. + +1998-09-08 Richard Henderson + Mark Mitchell + + * pt.c (process_partial_specialization): Consistently allocate + and zero tpd.parms based on ntparms. Use tpd2.parms, not + tpd.parms, where appropriate. + +Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INCLUDES): Update after recent toplevel gcc + reorganizations. + +1998-09-05 Mark Mitchell + + * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove. + * class.c (finish_struct): Remove hackery to deal with explicit + specializations in class scope. + * decl.c (grokfndecl): Improve error-recovery. + * decl2.c (grokfield): Likewise. + * pt.c (check_specialization_scope): New function. + (begin_specialization): Call it. + (process_partial_specialization): New function, split out from + push_template_decl. Check partial specializations more + stringently. + (push_template_decl): Call it. + (check_explicit_specialization): Don't attempt to handle explicit + specializations in class scope. + (template_parm_data): Document. Add current_arg and + arg_uses_template_parms. + (mark_template_parm): Set it. + (tsubst_arg_types): Remove unused variable. + * semantics.c (begin_class_definition): Tweak. + +1998-09-04 Mark Mitchell + + * inc/typeinfo (type_info::type_info(const char*)): Make + `explicit'. + + * cp-tree.h (hash_tree_cons_simple): New macro. + * pt.c (tsubst_arg_types): New function. Use hash_tree_cons. + (coerce_template_parms): Use make_temp_vec, instead of + make_tree_vec. Document this behavior. + (lookup_template_class): Likewise. + (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types. + Remove dead code (and add assertion to check its deadness). Fix + bug w.r.t. exception specifications. + +1998-09-03 Jason Merrill + + * decl2.c (import_export_vtable): Always make artificials comdat. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + +1998-09-03 Mark Mitchell + + * cp-tree.h (finish_globally_qualified_member_call_expr): + Rename to ... + (finish_qualified_call_expr). + * semantics.c: Likewise. + * parse.y (primary): Use it. + * method.c (hack_identifier): Remove redundant code. + + * init.c (resolve_offset_ref): Call convert_from_reference to + handle members of reference type. Improve error recovery. + +1998-09-03 Benjamin Kosnik + + * cp-tree.h: Declare warn_nontemplate_friend. + * decl2.c (lang_decode_option): Set. + * lang-options.h: Add -Wnon-template-friend. + * friend.c (do_friend): Use to toggle non-template function warning. + +1998-09-03 Mark Mitchell + + * decl.c (finish_enum): Don't resolve CONST_DECLs to their + corresponding INTEGER_CSTs when processing_template_decl. + * pt.c (tsubst_enum): Tweak accordingly. + +1998-09-03 Benjamin Kosnik + + * decl.c (pushdecl_class_level): Add warning here. + (pushdecl): Tweak. + +1998-09-02 Jason Merrill + + * cvt.c (convert_pointer_to_real): Tidy. + * search.c (get_base_distance_recursive): Simplify. + (get_base_distance): Likewise. + + * pt.c (unify): Only special-case INTEGER_TYPE if it uses template + parms. + +Wed Sep 02 09:25:29 1998 Nick Clifton + + * lex.c (check_newline): Call HANDLE_PRAGMA before + HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages + if unknown pragmas are encountered. + (handle_sysv_pragma): Interpret return code from + handle_pragma_token (). Return success/failure indication rather + than next unprocessed character. + (pragma_getc): New function: retrieves characters from the + input stream. Defined when HANDLE_PRAGMA is defined. + (pragma_ungetc): New function: replaces characters back into the + input stream. Defined when HANDLE_PRAGMA is defined. + +1998-09-01 Jason Merrill + + * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands. + * class.c (build_vtable_entry_ref): Likewise. + +1998-09-01 Mark Mitchell + + * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro. + * decl2.c (import_export_decl): Likewise. + * pt.c (instantiate_decl): Use it. + +1998-09-01 Jason Merrill + + * decl.c (lookup_name_real): Also do implicit typename thing for + artificial TYPE_DECLs. + * search.c (lookup_field): Likewise. + (lookup_fnfields, lookup_field): Adjust for implicit typename kludge. + * semantics.c (begin_constructor_declarator): Use enter_scope_of. + (enter_scope_of): Extract type from implicit typename. + (begin_class_definition): Likewise. + * lex.c (identifier_type): Handle implicit typename when checking + for SELFNAME. + + * cp-tree.h: Declare flag_strict_prototype. + * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if + -fstrict-prototype. + * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't + specified, set it to the value of pedantic. + +1998-09-01 Mark Mitchell + + * decl2.c (arg_assoc): Handle template-id expressions as arguments. + +1998-08-31 Mark Mitchell + + * decl.c (finish_enum): Handle member enums of classes declared in + template functions. + + * decl2.c (grok_x_components): Strip attributes before calling + groktypename. + +1998-08-31 Jason Merrill + + * cp-tree.h, decl2.c: Remove support for -fall-virtual, + -fenum-int-equivalence and -fno-nonnull-objects. + * class.c (check_for_override): Remove support for -fall-virtual. + (finish_struct_1): Likewise. + * call.c (build_new_op): Remove support for -fenum-int-equivalence. + * typeck.c (build_binary_op_nodefault): Likewise. + * cvt.c (ocp_convert): Likewise. + * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects. + * class.c (build_vbase_path): Likewise. + +Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org) + + * Makefile.in (INTERFACE): New, set to 1. + +1998-08-30 Mark Mitchell + + * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when + comparing with global_namespace. + (dump_aggr_type): Likewise. + + * decl.c (grokfndecl): Issue error on declaration of friend + templates with explicit template arguments. + + * pt.c (convert_template_argument): New function, split out + from... + (coerce_template_parms): Here. + (tsubst): Attempt better error-recovery. + +1998-08-28 Benjamin Kosnik + + * pt.c (decl_template_parm_p): Add checks for + TEMPLATE_TEMPLATE_PARM. + +1998-08-28 Mark Mitchell + + * lex.c (do_identifier): Fix thinko in previous change. + +1998-08-28 Jason Merrill + + * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns. + * decl2.c (output_vtable_inherit): Call binfo_for_vtable. + +1998-08-28 Richard Henderson + + Add support for discarding unused virtual functions. + * lang-options.h: Add -fvtable-gc. + * cp-tree.h: Add flag_vtable_gc. + * decl2.c (output_vtable_inherit): New fn. + (finish_vtable_vardecl): Call it. + * class.c (build_vtable_entry_ref): New fn. + (build_vtbl_ref): Call it. + +1998-08-28 Mark Mitchell + + * cp-tree.h (build_enumerator): Take the enumeration type as a + parameter. + * decl.c (finish_enum): Don't set the TREE_TYPE for the + enumeration constant values if we're processing_template_decls. + Don't set the type for the CONST_DECLs either; that's done in + build_enumerator. + (build_enumerator): Take the enumeration type as a + parameter. + * lex.c (do_identifier): Don't resolve enumeration constants while + processing template declarations, even if they happen to be + TEMPLATE_PARM_INDEXs. + + * parse.y (current_enum_type): New variable. + (primary): Don't allow statement-expression in local classes just + as we don't in global classes. + (structsp): Use current_enum_type. + (enum_list): Likewise. + * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by + finish_enum; they no longer occur. + + * cp-tree.h (finish_base_specifier): New function. + * parse.y (base_class): Use it. + * semantics.c (finish_base_specifier): Define it. + + * parse.y (structsp): Warn on use of typename outside of template + declarations. + +1998-08-27 Jason Merrill + + * lex.c (handle_cp_pragma): Remove #pragma vtable. + * lang-options.h: Remove +e options. + * decl2.c (lang_decode_option): Likewise. + (import_export_vtable): Don't check write_virtuals. + (finish_vtable_vardecl, finish_file): Likewise. + * search.c (dfs_debug_mark): Likewise. + * semantics.c (begin_class_definition): Likewise. + * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise. + + * call.c (build_over_call): Check flag_elide_constructors. + * decl2.c: flag_elide_constructors defaults to 1. + * typeck.c (convert_arguments): Remove return_loc parm. + (build_function_call_real): Adjust. + + * search.c: Tear out all mi_matrix and memoize code. + (lookup_field, lookup_fnfields): Use scratch_tree_cons. + * lang-options.h: Remove documentation for -fhandle-exceptions, + -fmemoize-lookups and -fsave-memoized. + * cp-tree.h: Lose mi_matrix and memoize support. + * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized. + * class.c: Lose struct class_level. + (pushclass, popclass): Lose memoize support. + * init.c (build_offset_ref): Likewise. + + Never change BINFO_INHERITANCE_CHAIN. + * init.c (emit_base_init): Change modification of + BINFO_INHERITANCE_CHAIN to an assert. + * search.c (get_base_distance_recursive): Likewise. + (get_base_distance): Likewise. + (lookup_member): Likewise. + (convert_pointer_to_single_level): Likewise. + (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs. + (lookup_fnfields): Likewise. + * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos. + (unshare_base_binfos): Don't call propagate_binfo_offsets. + (layout_basetypes): Call propagate_binfo_offsets instead of + unshare_base_binfos. + * decl.c (xref_basetypes): Call unshare_base_binfos. + * pt.c (instantiate_class_template): Likewise. + * tree.c (reverse_path): Remove 'copy' parm; always make a + temporary copy. + * class.c (build_vbase_path): Just call it. + * search.c (compute_access): Likewise. Don't re-reverse. + +1998-08-27 Mark Mitchell + + * class.c (build_vbase_path): Use reverse_path. + (finish_base_struct): Move warnings for inaccessible bases to + layout_basetypes. + (modify_one_vtable): Remove check of TREE_USED (binfo). + (fixup_vtable_deltas1): Likewise. + * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here. + (xref_tag): Remove binfos parameter. + (make_binfo): Remove chain parameter. + (reverse_path): Add copy parameter. + * decl.c (init_decl_processing): Change calls to xref_tag. + (xref_tag): Remove binfos parameter. + (xref_basetypes): Change calls to make_binfo. + * decl2.c (grok_x_components): Change calls to xref_tag. + (handle_class_head): Likewise. + * friend.c (do_friend): Likewise. + * lex.c (make_lang_type): Change calls to make_binfo. + * parse.y (structsp): Change calls to xref_tag. + (named_complex_class_head_sans_basetype): Likewise. + (named_class_head): Likewise. + * rtti.c (init_rtti_processing): Likewise. + * search.c (compute_access): Change calls to reverse_path. + (dfs_get_vbase_types): Change calls to make_binfo. + (get_vbase_types): Remove dead code. + * tree.c (unshare_base_binfos): Change calls to make_binfo. + (layout_basetypes): Warn here about inaccessible bases. + (make_binfo): Remove chain parameter. + (reverse_path): Add copy parameter. + +1998-08-27 Jason Merrill + + * class.c: #if 0 complete_type_p. + * init.c (build_java_class_ref, build_new_1): Remove unused locals. + * method.c (process_overload_item): Likewise. + * typeck.c (comp_target_types): Likewise. + + Stop sharing binfos for indirect virtual bases. + * tree.c (propagate_binfo_offsets): Unshare vbases, too. + (layout_basetypes): Likewise. + (unshare_base_binfos): Copy vbases, too. + * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED, + BINFO_VBASE_INIT_MARKED): Remove obsolete macros. + (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED, + CLEAR_BINFO_PUSHDECLS_MARKED): New macros. + * search.c (lookup_field, lookup_fnfields, lookup_member): Remove + reference to BINFO_VIA_PUBLIC. + (marked_pushdecls_p, unmarked_pushdecls_p): New fns. + (push_class_decls): Use them. + (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED. + (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED. + +1998-08-27 Mark Mitchell + + * decl.c (build_enumerator): Set DECL_CONTEXT for the + CONST_DECLs. + +1998-08-26 Mark Mitchell + + * cp-tree.h (finish_enum): Change prototype. + * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a + VALUES parameter. Don't try to compute mins/maxs if + processing_template_decl. + * parse.y (structsp): Use new calling sequence for finish_enum. + * pt.c (tsubst_enum): Likewise. Take the new type as input. + (lookup_template_class): Remove unused variables. Tweak. + Register enums on instantiation list before substituting + enumeration constants. + (tsubst_decl): Remove unused variables. + (regenerate_decl_from_template): Likewise. + + * decl.c (duplicate_decls): Don't obliterate the + DECL_TEMPLATE_INFO for a template if we're not replacing it with + anything. + + * lex.c (do_identifier): Fix typo in comment. + +Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi + + * errfn.c: Remove stdarg.h/varargs.h. + * tree.c: Likewise. + +1998-08-25 Brendan Kehoe + + * pt.c (tsubst_copy): Only do typename overloading on an + IDENTIFIER_NODE that happens to look like a typename if it actually + has a type for us to use. + +1998-08-25 Jason Merrill + + * typeck.c (comp_cv_target_types): Split out... + (comp_target_types): From here. Don't allow cv-qual changes under + a pointer if nptrs == 0. Fix OFFSET_TYPE handling. + (build_ptrmemfunc): Pass 1 to nptrs. + * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. + +1998-08-25 Mark Mitchell + + * search.c (dependent_base_p): Don't compare a binfo to + current_class_type; use the TREE_TYPE of the binfo instead. + + * cp-tree.h (CLASS_TYPE_P): Revise definition. + +1998-08-25 Jason Merrill + + * decl.c (duplicate_decls): Don't complain about different + exceptions from an internal decl even if pedantic. + + * typeck.c (convert_for_assignment): Converting from pm of vbase + to derived is an error, not a sorry. + + * call.c (build_over_call): Use convert_pointer_to_real for 'this'. + * class.c (fixed_type_or_null): Rename from + resolves_to_fixed_type_p. Return the dynamic type of the + expression, if fixed, or null. + (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type + does not match the static type. + (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use + resolves_to_fixed_type_p again. + +1998-08-24 Mark Mitchell + + * pt.c (tsubst_decl): Move special case code for dealing with + tricky friend templates here from ... + (regenerate_decl_from_template): Here. + +1998-08-24 Jason Merrill + + * decl.c (start_decl): Remove redundant linkage check. + +1998-08-24 Gavin Romig-Koch + + * typeck.c (c_expand_return): Handle the case that valtype + is wider than the functions return type. + +1998-08-24 Mark Mitchell + + * cp-tree.h (CLASS_TYPE_P): New macro. + * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE. + * pt.c (process_template_parm): Undo previous change. + +1998-08-24 Benjamin Kosnik + + * cp-tree.h: Declare. + * pt.c (decl_template_parm_p): New function. + * decl.c (pushdecl): Check decls for redeclaring template parms. + (xref_tag): Make redeclaration an error, print decl. + * decl2.c (grokfield): Check field_decls for redeclaration as well. + +1998-08-24 Jason Merrill + + * parse.y (primary): Fix up the type of string constants. + +1998-08-24 Mark Mitchell + + * typeck.c (convert_for_initialization): Move check for odd uses + of NULL to avoid duplicate warnings. + +1998-08-24 Jason Merrill + + * tree.c (lvalue_type): Fix for arrays. + * typeck.c (string_conv_p): New fn. + (convert_for_assignment): Use it. + (build_unary_op): Use lvalue_type. + * call.c (standard_conversion, convert_like): Use string_conv_p. + (add_function_candidate): Use lvalue_type. + * cvt.c (convert_to_reference): Likewise. + * decl2.c (lang_decode_option): Ignore -traditional. + * decl.c (init_decl_processing): flag_writable_strings inhibits + flag_const_strings. + +1998-08-24 Andrew MacLeod + + * lang-options.h (lang_options): Add fconst-strings to the list + of valid options. + * decl2.c (lang_f_options, lang_decode_option): Likewise. + +1998-08-24 Nathan Sidwell + + * lex.c (real_yylex): Don't warn about long long constants if + we're allowing long long. + +1998-08-24 Martin von Löwis + + * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of + accessing bindings directly. + + * search.c (my_tree_cons): Reimplement. + + * lang-specs.h: Remove __HONOR_STD. + * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise. + +1998-08-23 Mark Mitchell + + * decl.c (grokdeclarator): Complain about in-class initialization + of aggregates and/or references. + * pt.c (process_template_parm): Clear IS_AGGR_TYPE for + TEMPLATE_TYPE_PARMs. + + * decl2.c (grok_array_decl): Add comment. + (mark_used): Don't instantiate an explicit instantiation. + * friend.c (make_friend_class): Remove bogus comment. Fix check + for partial specializations. + * pt.c (check_explicit_specialization): Don't + SET_DECL_EXPLICIT_INSTANTIATION here. + (mark_decl_instantiated): Or here. + (do_decl_instantiation): Do it here, instead. Add checks for + duplicate explicit instantiations, etc. Tidy. + (do_type_instantiation): Likewise. + (instantiate_decl): Improve comments. Complain about explicit + instantiations where no definition is available. + + * cp-tree.h (ansi_null_node): Remove. + * call.c (build_over_call): Warn about converting NULL to an + arithmetic type. + * cvt.c (build_expr_type_conversion): Likewise. Use + null_ptr_cst_p instead of expanding it inline. + * decl.c (ansi_null_node): Remove. + (init_decl_processing): Make null_node always have integral type. + * except.c (build_throw): Warn about converting NULL to an + arithmetic type. + * lex.c (init_parse): Remove handling of ansi_null_node. + * pt.c (type_unification_real): Don't convert NULL to void* type. + * typeck.c (build_binary_op_nodefault): Fix NULL warnings. + (convert_for_assignment): Warn about converting NULL to an + arithmetic type. + (convert_for_initialization): Likewise. + +1998-08-20 Jason Merrill + + * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn. + * pt.c (coerce_template_parms): Use no_linkage_check. + * decl.c (grokvardecl): Likewise. + (grokfndecl): Likewise. Members of anonymous types have no linkage. + + * method.c (process_overload_item): Remove useless code. + +1998-08-20 Per Bothner + + Handle new'ing of Java classes. + * init.c (build_class_classref): New function. + (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject; + constructor does not return this; don't need to exception-protect. + + * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag. + * decl2.c (acceptable_java_type): Handle template-derived types. + +1998-08-20 Per Bothner + + * decl2.c (import_export_vtable): Suppress vtables for Java classes. + +1998-08-20 Mark Mitchell + + * decl.c (duplicate_decls): Always merge the old and new patterns + for templates, regardless of whether or not the new one has + DECL_INITIAL. Don't throw away specializations. Merge + DECL_SAVED_TREE. + * pt.c (tsubst_decl): Use the right pattern when calculating the + complete args for a new template instance. + (do_decl_instantiation): Fix typo in comment. + (regenerate_decl_from_template): Deal with tricky friend template + case. + (instantiate_decl): Likewise. + +Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com) + + * init.c (build_builtin_delete_call): Add missing assemble_external + call. + +1998-08-20 Jason Merrill + + * parse.y (notype_unqualified_id): Also accept ~A. + +1998-08-19 Mark Mitchell + + * typeck.c (build_binary_op_nodefault): Warn on use of NULL in + arithmetic. + * except.c (build_throw): Warn when NULL is thrown, even with + -ansi. Use ansi_null_node, rather than integer_zero_node, in the + thrown expression. + + * cp-tree.h (ansi_null_node): New variable. + * decl.c (ansi_null_node): New variable. + (init_decl_processing): Initialize its type. + * lex.c (init_parse): Initialize its value. Use ansi_null_node + for null_node in non-ANSI mode. + * typeck.c (build_binary_op_nodefault): Use ansi_null_node in + place of null_node to avoid spurious errors. + +1998-08-17 Mark Mitchell + + * cp-tree.h (enter_scope_of): New function. + * parse.y (complex_direct_notype_declarator): Use it. + * semantics.c (enter_scope_of): New function. + +1998-08-17 Jason Merrill + + * decl.c (grokparms): No, here. + + * decl.c (grokdeclarator): Catch parm with pointer to array of + unknown bound here... + * method.c (process_overload_item): ...not here. + + * gxxint.texi: Remove obsolete documentation of overloading code. + + * decl.c (finish_enum): Also set TYPE_SIZE_UNIT. + * class.c (finish_struct_bits): Likewise. + + * tree.c (lvalue_type): Fix for arrays. + * typeck.c (build_unary_op): Use lvalue_type. + * call.c (add_function_candidate): Likewise. + * cvt.c (convert_to_reference): Likewise. + + * decl2.c (lang_decode_option): Ignore -traditional. + + * init.c (build_offset_ref): Don't mess with error_mark_node. + * lex.c (do_scoped_id): Use cp_error. + + * rtti.c (get_tinfo_fn): Don't mess with the context for now. + +1998-08-17 Benjamin Kosnik + + * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified. + +Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com) + + * cp-tree.h (set_identifier_local_value): Provide prototype. + + * decl2.c (do_namespace_alias): Remove unused variables `binding' + and `old'. + +Fri Aug 14 16:42:27 1998 Nick Clifton + + * Makefile.in: Rename BBISON to BISON so that it can be properly + inherited from the parent makefile. + +1998-08-13 Jason Merrill + + * lang-options.h: Add -finit-priority. + * decl2.c: Likewise. Check flag_init_priority instead of + USE_INIT_PRIORITY. + + * decl2.c (setup_initp): New fn. + (start_objects, finish_objects, do_ctors): Handle init_priority. + (do_dtors, finish_file): Likewise. + +1998-08-13 Jason Merrill + + * pt.c (tsubst_copy): Hush warning. + + * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P. + +1998-08-12 Mark Mitchell + + * pt.c (print_template_context): Don't abort when instantiating a + synthesized method. + + * decl.c (grokdeclarator): Issue errors on namespace qualified + declarators in parameter lists or in class scope. + +1998-08-09 Mark Mitchell + + * pt.c (check_explicit_specialization): Don't abort on bogus + explicit instantiations. + +1998-08-07 Mark Mitchell + + * typeck.c (require_complete_type): Use complete_type_or_else. + (complete_type_or_else): Always return NULL_TREE on failure, as + documented. + + * pt.c (tsubst_aggr_type): Prototype. + (tsubst_decl): New function, split out from tsubst. Set + input_filename and lineno as appropriate. + (pop_tinst_level): Restore the file and line number saved in + push_tinst_level. + (instantiate_class_template): Set input_filename and lineno as + appropriate. + (tsubst): Move _DECL processing to tsubst_decl. Make sure the + context for a TYPENAME_TYPE is complete. + + * decl2.c (grokbitfield): Issue errors on bitfields declared with + function type. + (do_dtors): As in do_ctors, pretend to be a member of the same + class as a static data member while generating a call to its + destructor. + + * cvt.c (cp_convert_to_pointer): Handle NULL pointer + conversions, even in complex virtual base class hierarchies. + +1998-08-06 Mark Mitchell + + * cp-tree.h (ENUM_TEMPLATE_INFO): New macro. + (TYPE_TEMPLATE_INFO): Likewise. + (SET_TYPE_TEMPLATE_INFO): Likewise. + (ENUM_TI_TEMPLATE): Likewise. + (ENUM_TI_ARGS): Likewise. + (lookup_nested_type_by_name): Remove. + * decl.c (maybe_process_template_type_declaration): Handle enums. + (start_enum): Don't check for primary-template enum declarations + here. + (finish_enum): Clean up, document. Make sure template enum + constants get the correct type. + (build_enumerator): Copy initializers for template enumerations, + too. + (grok_enum_decls): Document. + * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit + better. Build LOOKUP_EXPRs for local variables, even if they are + TREE_PERMANENT. + * pt.c (tsubst_enum): Remove field_chain parameter. + (template_class_depth): Include the depth of surrounding function + contexts. + (push_template_decl): Check for primary-template enum declarations + here. Deal with enumeration templates. + (lookup_template_class): Likewise. + (for_each_template_parm): Likewise. + (instantiate_class_template): Don't call tsubst_enum directly, + call tsubst instead, to instantiate enums. Deal with all + field_chain issues here, not in tsubst_enum. + (lookup_nested_type_by_name): Remove. + (tsubst_aggr_type): Revise handling of enumeration types. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs. + +1998-08-04 Mark Mitchell + + * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it + uses template parameters. + * method.c (build_template_parm_names): Use the full set of + template arguments for tsubst'ing. + (build_overload_identifier): Pass the full set of template + arguments to build_template_parm_names, not just the + innermost_args. + * pt.c (TMPL_ARGS_DEPTH): Define using + TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity. + (NUM_TMPL_ARGS): New macro. + (add_outermost_template_args): Deal with the case where the outer + args will be completely discarded. + (coerce_template_parms): Use the full set of template arguments + for tsubst'ing. Simplify. Add some asserts. Improve + error messages. + (lookup_template_class): Pass the full set of template arguments + to coerce_template_parms. + (tsubst): Add assertion. + (do_type_instantiation): Don't instantiate member template + classes. + + * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose + name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE. + +1998-08-03 Jason Merrill + + * method.c (set_mangled_name_for_decl): Change return type to void. + + * decl.c (lookup_name_real): A namespace-level decl takes priority + over implicit typename. Avoid doing the same lookup twice. + + * search.c (dependent_base_p): New fn. + (dfs_pushdecls, dfs_compress_decls): Use it. + + * typeck.c (get_member_function_from_ptrfunc): Don't try to handle + virtual functions if the type doesn't have any. + +1998-08-03 Mark Mitchell + + * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it + uses template parameters. + +1998-08-02 Mark Mitchell + + * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument. + * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation. + * lex.c (do_identifier): Don't use a second argument, or a type, + when building LOOKUP_EXPRs. + (do_identifier): Likewise. + (do_scoped_id): Likewise. + * method.c (hack_identifier): Improve error message. + * pt.c (lookup_template_function): Don't needlessly call + copy_to_permanent or build_min. + (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if + necessary. + (do_decl_instantiation): Improve error message. + * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy. + (build_min): Copy the type to the permanent obstack, too. + +1998-08-01 Jason Merrill + + * init.c (init_init_processing): Remove BI* handling. + (build_builtin_call): Remove. + (build_builtin_delete_call): New fn. + (build_delete): Use it. + +1998-07-31 Mark Mitchell + + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro. + (maybe_check_template_type): New function. + * decl.c (maybe_process_template_type_declaration): New function, + split out from pushtag Call maybe_check_template_type. + (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P. + (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P. + * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P. + * pt.c (template_class_depth_real): Generalization of ... + (template_class_depth): Use it. + (register_specialization): Use duplicate_decls for duplicate + declarations of specializations. + (maybe_check_template_type): New function. + (push_template_decl_real): Fix comment. + (convert_nontype_argument): Likewise. + (lookup_template_class): Likewise. Avoid an infinite loop on + erroneous code. + (tsubst_friend_function): Fix comment. + (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is + an IDENTIFIER_NODE. + * semantics.c (begin_function_definition): Use + reset_specialization to note that template headers don't apply + directly to declarations after the opening curly for a function. + +1998-07-29 Jason Merrill + + * decl.c (push_overloaded_decl): Use current_namespace instead of + DECL_CONTEXT (decl) to determine where we go. + + * decl.c (lookup_name_real): Fix typo. + +1998-07-28 Mark Mitchell + + * friend.c (is_friend): Be lenient with member functions to deal + with nested friends. + +1998-07-28 Jason Merrill + + * class.c (finish_struct_1): Convert integer_zero_node to + ssizetype before passing it to set_rtti_entry. + * typeck2.c (initializer_constant_valid_p): Allow conversion of 0 + of any size to a pointer. + +1998-07-27 Mark Mitchell + + * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. + (build_template_decl_overload): Remove. + (set_mangled_name_for_decl): New function. + (innermost_args): Remove is_spec parameter. + (most_specialized, most_specialized_class): Remove declarations. + (lookup_template_class): Add entering_scope parameter. + (maybe_process_partial_specialization): New function. + (finish_template_decl): Likewise. + (finish_template_type): Likewise. + * class.c (finish_struct): Clean up processing of member template + specializations. + * decl.c (pushtag): Fix formatting. + (lookup_tag): Improve handling of pseudo-global levels. + (make_typename_type): Adjust call to lookup_template_class. + (shadow_tag): Use maybe_process_partial_specialization. + (xref_tag): Improve handling of member friends. + (start_function): Call push_nested_class before + push_template_decl. Don't call push_template_decl for + specializations. + * decl2.c (grok_x_components): Don't call xref_tag for + template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. + (grokclassfn): Use set_mangled_name_for_decl. + (arg_assoc_class): Adjust call to innermost_args. + (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. + * error.c (dump_function_name): Improve printing of template + function names. + * friend.c (is_friend): Don't compare types of decls to determine + friendship, unless flag_guiding_decls. + (make_friend_class): Partial specializations cannot be friends. + (do_friend): Use set_mangled_name_for_decl. Call + push_template_decl_real instead of push_template_decl. + * method.c (build_decl_overload_real): Remove prototype. Give it + external linkage. + (build_overload_identifier): Adjust call to innermost_args. + (build_template_decl_overload): Remove. + (set_mangled_name_for_decl): New function. + * parse.y (.finish_template_type): New non-terminal. + (template_def): Use finish_template_decl. Use template_extdef + instead of extdef. + (template_extdef, template_datadef): New non-terminals, containing + only those rules for things which can be templates. + (datadef): Tidy. + (template_type, self_template_type): Use .finish_template_type. + (named_class_head): Use maybe_process_partial_specialization. + * pt.c (mangle_class_name_for_template): Remove context parameter. + (get_class_bindings): Remove outer_args parameter. + (complete_template_args): Remove. + (add_outermost_template_args): New function. + (register_specialization): Return the specialization. + (unregister_specialization): New function. + (tsubst_template_parms): Likewise. + (most_specialized, most_specialized_class): Prototype here as + static. + (original_template): Rename to most_general_template. + (tsubst_template_parms): New function. + (set_mangled_name_for_template_decl): Likewise. + (TMPL_ARGS_DEPTH): New macro. + (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. + (TMPL_ARGS_LEVEL): New macro. + (SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG): Likewise. + (SET_TMPL_ARG): Likewise. + (TMPL_ARGS_DEPTH): Likewise. + (finish_member_template_decl): Use finish_template_decl. + (maybe_process_partial_specialization): New function, split out + from tsubst. + (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. + (maybe_begin_member_template_processing): Use new macros. + (is_member_template): Likewise. + (is_member_template_class): Likewise. + (add_to_template_args): Likewise. Deal with multiple levels of + args. + (maybe_process_partial_specialization): New function. + (retrieve_specialization): Add consistency check. + (determine_specialization): Return full argument list. + (check_explicit_specialization): Tweak friend handling. Use full + argument lists. Simplify. + (current_template_args): Use new macros. + (push_template_decl_real): Change ill-named mainargs to specargs. + Check that a partial specialization actually specializes at least + one parameter. Improve friend handling. Modify for full + template arguments. + (classtype_mangled_name): Don't mangle the names of + specializations. + (lookup_template_class): Add entering_scope parameter. Use it to + avoid finding a template type when an instantiation is required. + Simplify. Use full template arguments. + (tsubst_friend_function): Use unregister_specialization. Use new + macros. Use full template arguments. + (tsubst_friend_class): Substitute, using tsubst_template_parms, + into the template parameters before passing them to + redeclare_class_template. + (instantiate_class_template): Simplify. Use full template + arguments. Adjust calls to get_class_bindings. Use + SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. + (innermost_args): Use new macros. + (tsubst_aggr_type): New function, split out from tsubst. + (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling + conventions for lookup_template_class. Refine handling of partial + instantiations. Remove calls to complete_template_args. + Simplify. Add consistency checks. Use set_mangled_name_for_decl + and set_mangled_name_for_template_decl. + (tsubst_copy): Use tsubst_aggr_type. + (instantiate_template): Use full template arguments. + (more_specialized): Improve formatting. + (more_specialized_class): Adjust calls to get_class_bindings. + (get_bindings_real): Don't call complete_template_args. + (most_specialized): Don't overwrite input; create a new list. + (most_specialized_class): Use most_general_template. + (regenerate_decl_from_template): Use unregister_specialization. + Use full template arguments. + (instantiate_decl): Use full template arguments. + (set_mangled_name_for_template_decl): New function. + * semantics.c (begin_class_definition): Use + maybe_process_partial_specialization. + (finish_member_class_template): New function. + (finish_template_decl): Likewise. + (finish_template_type): Likewise. + (typeck.c): Don't crash after issuing a compiler_error. + * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. + +1998-07-27 Jason Merrill + + * typeck2.c (build_functional_cast): Handle default-initialization. + + * call.c (build_over_call): Pass 1 to popclass. + + * parse.y (direct_notype_declarator): Add precedence declaration + to notype_unqualified_id case. + * Makefile.in (EXPECT): Adjust. + + * tree.c (ovl_member): Fix for single function in OVL. + +1998-07-27 Dave Brolley + + * c-lex.c (yylex): Fix boundary conditions in character literal and + string literal loops. + +1998-07-24 Jason Merrill + + * decl.c (lookup_name_real): OK, do return the from_obj value + unless got_object depends on template parms. + + * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT. + + * pt.c (coerce_template_parms): Also complain about local enums. + + * cp-tree.h: Add prototype for set_identifier_local_value. + * decl.c (set_identifier_local_value_with_scope): Make static, + prototype. + * search.c (covariant_return_p): Likewise. + * except.c (build_terminate_handler, alloc_eh_object): Likewise. + + * call.c (build_method_call): Only pull out the type of a destructor + if it's a template type parm. + * decl.c (lookup_name_real): Never return the from_obj value. + +1998-07-23 Jason Merrill + + * except.c (process_start_catch_block_old): Call start_decl_1 for + catch parm. + * decl.c (start_decl_1): Avoid duplicate error. + + * init.c (expand_default_init): Only perform the initialization if + it will do something. + +1998-07-23 H.J. Lu (hjl@gnu.org) + + * parse.y (base_class): Check for invalid base class. + +1998-07-23 Jason Merrill + + * decl2.c (import_export_template): Fold in... + (import_export_class): ...to here. Handle dllimport/export. + + * class.c (build_vtable): Pass at_eof to import_export_vtable. + (prepare_fresh_vtable): Likewise. + * decl2.c (import_export_class): Split out... + (finish_prevtable_vardecl): From here. + * class.c (finish_struct_1): Call import_export_class if at_eof. + + * decl.c (start_function): #if 0 mysterious code I wrote and have + forgotten why. + * rtti.c (get_tinfo_fn): If this is for a class type, set + DECL_CONTEXT. + +1998-07-22 Jason Merrill + + * inc/exception: Change terminate and unexpected to (). + + * parse.y (named_class_head_sans_basetype_defn): A + named_class_head_sans_basetype followed by '{' or ':' is a defn. + +1998-07-21 Jason Merrill + + * tree.c (canonical_type_variant): New fn to handle arrays. + * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove. + * pt.c (unify, default case): Also fold arg. Fix array bounds case. + * method.c (process_overload_item): Use build_overload_value for + arrays. + +1998-07-20 Dave Brolley + + * lex.c (mbchar.h): #include it. + (GET_ENVIRONMENT): New macro. + (init_parse): Set character set based on LANG environment variable. + (real_yylex): Handle multibyte characters in character literals. + (real_yylex): Handle multibyte characters in string literals. + +1998-07-19 Jason Merrill + + * lex.c (do_identifier): Look for class value even if we don't + have a global value. Do implicit declaration if parsing is 2. + * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig + lookup. + +1998-07-19 Mark Mitchell + + * decl.c (pushtag): Revert previous change. + * pt.c (lookup_template_class): Don't put out debugging + information for types that use template parameters. + + * decl.c (pushtag): Don't put out debugging information for + compiler-generated typedefs. + + * error.c (dump_type_real): Don't crash when presented with + intQI_type_node or the like. + + * semantics.c (finish_translation_unit): Fix spelling error in + comment. + +1998-07-17 Jason Merrill + + * decl.c (lookup_name_real): Pull out single function here. + (select_decl): Not here. + (unqualified_namespace_lookup): Use CP_DECL_CONTEXT. + + * decl.c (qualify_lookup): Tweak again. + + * pt.c (lookup_template_class): Don't mess with the context of the + instantiation. + * decl2.c (current_decl_namespace): Remove special handling for + templates. + + * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for + a member template specialization. + + * tree.c (ovl_member): Use decls_match to compare functions. + * decl.c (decls_match): Check the context of a function. + + * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER + in Koenig lookup support rules. + * semantics.c (finish_call_expr): Handle the new cases. + + * typeck.c (build_x_function_call): Handle overloaded methods. + + * decl.c (grokvardecl): Don't call build_static_name for extern "C". + +1998-07-16 Mark Mitchell + + * semantics.c (finish_object_call_expr): Revert previous change. + * call.c (build_new_method_call): Likewise. Instead, convert + TYPE_DECLs to IDENTIFIERs here, in the presence of templates. + +1998-07-16 Jason Merrill + + * decl.c (qualify_lookup): Handle templates. + + * decl2.c (do_using_directive): Don't pass ancestor. + * decl.c (push_using_directive): Calculate ancestor. + + * decl2.c (do_nonmember_using_decl): Allow for type shadowing. + * decl.c (pushdecl): Move type shadowing handling from here... + (duplicate_decls): ...to here. + * decl.c (set_identifier_local_value_with_scope): New fn. + (pushdecl): Use it. + (set_identifier_local_value, lookup_type_current_level): New fns. + * decl2.c (do_local_using_decl): Handle types and binding level + stuff properly. + + * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD. + * decl.c (select_decl): Extract a lone function from an OVERLOAD. + (lookup_namespace_name): Likewise. + * typeck.c (build_unary_op): Not here anymore. + + * decl2.c (do_class_using_decl): Make sure we get an identifier. + * class.c (handle_using_decl): Ignore TYPE_DECLs. + + * decl.c (qualify_lookup): New fn. + (lookup_name_real): Use it. + +1998-07-16 Martin v. Loewis + + * decl2.c (add_using_namespace): When directly using a namespace + that was indirect before, promote it. + + * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES, + LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY, + LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros. + * decl.c (select_decl): Replace two flag parameters by one. + (unqualified_namespace_lookup): Likewise, pass flag. + (lookup_flags): New function. + (lookup_name_real): Compute flags, pass them. + (lookup_namespace_name): Call with zero-flag. + * decl2.c (ambiguous_decl): Add flag parameter, complain only + according to flags. + (lookup_using_namespace, qualified_lookup_using_namespace): + Add flag parameter, pass them through. + * lex.c (do_scoped_id): Call with zero-flag. + +1998-07-16 Jason Merrill + + * typeck.c (convert_for_assignment): Use comptypes. + +1998-07-16 Mark Mitchell + + * semantics.c (finish_object_call_expr): Move test for the + function called being a TYPE_DECL to ... + * call.c (build_new_method_call): Here. + +1998-07-15 Jason Merrill + + * decl2.c (arg_assoc_class): Also look at template arguments, if any. + (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST. + + * lex.c (looking_for_typename): Don't initialize. + + * decl2.c (ambiguous_decl): Clarify error message. + + * decl.c (push_using_directive): Iterate over namespaces used + indirectly. + +1998-07-15 Martin v. Löwis + + * decl2.c (add_using_namespace): Iterate over namespaces used + indirectly. + + * decl.c (lookup_name_real): Accept namespace aliases as locals. + (cat_namespace_levels): Ignore aliases. + (duplicate_decls): Ignore duplicate aliases. + * decl2.c (do_namespace_alias): Process block level namespace + aliases. Store alias with pushdecl. Remove odr errors. + * parse.y (namespace_alias): New non-terminal. + (extdef): Use it. + +1998-07-15 Jason Merrill + + * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE. + Handle TEMPLATE_TYPE_PARM. + (arg_assoc): Rewrite. + + * pt.c (complete_template_args): Don't look at the context unless + we have to. + + * method.c (build_decl_overload_real): Fix namespace handling. + + * typeck.c (build_unary_op): Extract a lone function from an + OVERLOAD. + + * call.c (build_scoped_method_call): Handle getting a namespace + for basetype in a destructor call. + (check_dtor_name): Handle enums. + + * parse.y (using_directive): New nonterminal. + (extdef, simple_stmt): Use it. + +1998-07-14 Martin von Löwis + + * decl2.c (add_function): Move error message ... + (arg_assoc_namespace): ... from here. + +1998-07-14 Jason Merrill + + * parse.y (namespace_qualifier): Fix multiple level handling. + * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT. + (arg_assoc): Don't skip the first argument of a function. + +Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com) + + * search.c (my_tree_cons): Clean up. + +1998-07-14 Jason Merrill + + * call.c (joust): Don't warn about "confusing" conversions to the + same type. + +1998-07-14 Martin von Löwis + + * class.c (push_nested_class): Complain about namespaces. + * decl.c (start_decl): Enter the object's namespace. + (cp_finish_decl): Leave it. + (grokdeclarator): Likewise. + * decl2.c (check_decl_namespace): New function. + (finish_file): Call it. + * parse.y (complex_direct_notype_declarator): Set complexity + of namespace-qualified ids to -1, enter the namespace. + + * method.c (build_template_decl_overload): Expect _DECL as first + parameter. Put context temporarily into current_namespace. + * pt.c (check_explicit_specialization): Change caller. + (tsubst): Likewise. + + * init.c (build_offset_ref): Call mark_used and + convert_from_reference for namespace members. + +Mon Jul 13 23:25:28 1998 Martin von Löwis + + * search.c (my_tree_cons): The bitfield is at index 2. + +Mon Jul 13 17:21:01 1998 Nick Clifton + + * lang-options.h: Format changed to work with new --help support + in gcc/toplev.c + +1998-07-12 Martin von Löwis + + * decl2.c (build_expr_from_tree): Change calls of do_identifier. + Do Koenig lookup in CALL_EXPR. + (arg_assoc): Handle error_mark. + * lex.c (is_global): New function. + (do_identifier): Expect arguments for Koenig lookup. + * parse.y (primary): Add rules for calls of unqualified function calls. + (do_id): Change call of do_identifier. + * pt.c (finish_stmt_expr): Likewise. + * semantics.c (finish_id_expr): Likewise. + (finish_call_expr): Add integer parameter to indicate + argument-dependent lookup. + + * decl.c (struct binding_level): New field using_directives. + (push_using_decl): Not sorry anymore. + (push_using_directive): New function. + (lookup_tag): Use CP_DECL_CONTEXT to iterate. + (unqualified_namespace_lookup): New function, code from ... + (lookup_name_real): ... here. + * decl2.c (lookup_using_namespace): Pass using list instead of + initial scope. + (validate_nonmember_using_decl): New function. + (do_nonmember_using_decl): New function. + (do_toplevel_using_decl): Use them. + (do_local_using_decl): New function. + (do_using_directive): Support block-level directives. + * parse.y (simple_stmt): Support using declarations and + directives. + (namespace_qualifier, namespace_using_decl): New non-terminals. + + * xref.c (classname): New function. + (GNU_xref_hier): Change class and base parameters to tree. + * decl.c (xref_baseypes): Change caller. + * friend.c (make_friend_class): Likewise. + +1998-07-12 Kriang Lerdsuwanakij + + * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter + comparison. + + * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a + template template parameter, record its use. + (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse + its template arguments if exists. + + * pt.c (coerce_template_template_parms): New function equivalent + to coerce_template_parms when IS_TMPL_PARM is true. + (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter, + all callers changed. + + (coerce_template_parms): Access ARGLIST properly when creating a + new vector. Only accept implicit TYPE_DECL as valid argument for + a template template parameter when it is a base class of + current_class_type. Don't display error message when COMPLAIN is + false. + +1998-07-12 Klaus Kaempf (kkaempf@progis.de) + + * repo.c (get_base_filename): Use file_name_nondirectory. + (open_repo_file): Likewise. + * cp-tree.h (file_name_nondirectory): Add prototype. + +1998-07-12 Jason Merrill + + * friend.c (do_friend): Pull the identifier out of declarator. + Use cp_error and friends. + * decl2.c (qualified_lookup_using_namespace): Fix call to + purpose_member. + * decl.c (lookup_name_real): Don't call complete_type on a namespace. + (grokvardecl): Use DECL_CLASS_SCOPE_P. + * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner. + * class.c (warn_hidden): Fix for OVERLOAD. + From grahams@rcp.co.uk: + * cp-tree.h (DEFARG_NODE_CHECK): New macro. + (DEFARG_LENGTH, DEFARG_POINTER): Use it. + +Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com) + + * g++.1 (-traditional): Remove duplicated documentation. + +1998-07-11 Mark Mitchell + + * method.c (flush_repeats): Add nrepeats parameter. + (issue_nrepeats): Likewise. + (is_back_referenceable_type): New function. Don't back-reference + TEMPLATE_TYPE_PARMs as well as simple types like integers. + (build_mangled_name_for_type): Likewise. + (build_mangled_name_for_type_with_Gcode): Likewise. + (lasttype): Remove. + (nrepeats): Likewise. + (Nrepeats): Likewise. + (start_squangling): Don't clear the variables removed above. + (end_squangling): Likewise. + (flush_repeats): Tidy. Use nrepeats parameter rather than + Nrepeats global. + (issue_nrepeats): Likewise, but with nrepeats global. Use + is_backreferenceable_type. + (build_overload_nested_name): Tidy. Add comment. Use + build_mangled_name_for_type. + (build_underscore_int): Comment. + (build_overload_scope_ref): Use build_mangled_name_for_type. + (build_overload_int): Likewise. + (build_template_template_parm_names): Tidy. + (build_template_parm_names): Use build_mangled_name_for_type. + (build_overload_identifier): Add comments. + (build_mangled_name_for_type_with_Gcode): Split out from + build_mangled_name. + (build_mangled_name_for_type): Use it. + (build_mangled_name): Rework to use build_mangled_name_for_type + and to not use global nrepeats/Nrepeats. Tidy. + (process_modifiers): Tidy. + (check_btype): Use is_backreferenceable_type. Add comment. + Rename `node' to `type'. + (process_overload_item): Set numeric_output_need_bar here. + Use build_mangled_name_for_type. Tidy. + (build_decl_overload_real): Tidy. Don't use Nrepeats. Use + build_mangled_name_for_type. + + * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO + for TYPE_DECLs. + +1998-07-08 Vladimir N. Makarov + + * cp-tree.h (warn_long_long): Define. + * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for + warning "ANSI C++ does not support `long long'". + * decl2.c (warn_long_long): Define. + (lang_decode_option): Parse -Wlong-long, -Wno-long-long options. + +1998-07-07 Jason Merrill + + * decl.c (xref_tag): Handle attributes between 'class' and name. + * parse.y (aggr): Likewise. + * semantics.c (finish_class_definition): Likewise. + * Makefile.in (EXPECTED): Adjust. + + * cp-tree.h: Declare flag_optional_diags and warn_multichar. + * decl2.c: Define them. + (lang_decode_option): Handle them. + * lang-options.h: Add -foptional-diags. + * class.c (finish_struct): Don't complain about multiple meanings of + name if -fno-optional-diags. + * decl.c (pushdecl_class_level): Likewise. + * lex.c (real_yylex): Check warn_multichar. + +1998-07-06 Jason Merrill + + * decl.c (lookup_tag): Use CP_DECL_CONTEXT. + + * tree.c (make_binfo): Fix length. + +1998-06-30 Benjamin Kosnik + + * decl2.c (lang_decode_option): Remove warn_template_debugging. + * lang-options.h: Likewise. + +Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi + + * except.c (build_eh_type_type_ref): Remove unused variable `susp'. + (process_start_catch_block): Likewise for variables + `false_label_rtx', `call_rtx' and `return_value_rtx'. + +1998-06-29 Brendan Kehoe + + * tree.c (build_srcloc): Make sure we allocate this node on the + permanent obstack. + +Sat Jun 27 23:34:18 1998 Fred Fish + + * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined. + (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY. + (lang_specific_driver): Only add -lm automatically if need_math is + nonzero. + +Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o + +Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi + + * Makefile.in (EXPR_H): New dependency variable. + (decl2.o): Depend on $(EXPR_H). + (typeck.o): Likewise. + (init.o): Likewise. + (expr.o): Likewise. + +1998-06-25 Benjamin Kosnik + + * decl.c (start_enum): Put local enums on permanent_obstack. + +1998-06-25 Mark Mitchell + + * cp-tree.h (c_get_alias_set): Declare. + * decl.c (init_decl_processing): Set lang_get_alias_set. + +1998-06-25 Andrew MacLeod + + * cp-tree.h (mark_all_runtime_matches): Add function prototype. + * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED + flag for all function decls which are in the exception table. + * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match. + * decl2.c (finish_file): Call mark_all_runtime_matches to make sure + code is emitted for any referenced rtti function. + +1998-06-25 Dave Brolley + + * lang-specs.h: Use new | syntax to eliminate + string concatenation. + +1998-06-25 Jason Merrill + + * cp-tree.h (CP_DECL_CONTEXT): New macro. + * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it. + * method.c (build_overload_nested_name): Likewise. + * sig.c (build_signature_pointer_or_reference_type): Don't set + DECL_CONTEXT. + +1998-06-24 Martin v. Löwis + + Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. + * cp-tree.h (FROB_CONTEXT): New macro. + (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE. + * decl.c (namespace_binding): Replace NULL_TREE with + global_namespace. + (set_namespace_binding, pop_namespace, lookup_name_real): Likewise. + * decl2.c (is_namespace_ancestor, lookup_using_namespace): + Likewise. + * decl.c (pushtag): Use FROB_CONTEXT. + (pushdecl, make_typename_type, define_function, grokdeclarator): + Likewise. + * decl2.c (set_decl_namespace, do_namespace_alias): Likewise. + * pt.c (push_template_decl_real, lookup_template_class, tsubst): + Likewise. + * decl2.c (decl_namespace): Return global_namespace if no context. + * method.c (build_overload_nested_name): Expect null as context. + * pt.c (mangle_class_name_for_template): Do nothing for null + contexts. + (lookup_template_class): Allow for null id_context. + +1998-06-25 Richard Henderson + + * method.c (emit_thunk): Set current_function_is_thunk for the + ASM_OUTPUT_MI_THUNK case as well. + +1998-06-23 Andrew MacLeod + + * exception.cc (__cplus_type_matcher): Get a match_info pointer + instead of an exception table entry as a parameter. + +1998-06-23 Andrew MacLeod + + * parse.y (function_try_block): Don't call start_catch_handler. + * except.c (call_eh_info): Remove coerced field from declaration. + (build_eh_type_type_ref): New function to create an address of a + rtti function for the new style exception tables. + (expand_start_catch_block): Split function, this contains the + common part. + (process_start_catch_block_old): New function to perform the rest + of expand_start_catch_block under old style exceptions. + (process_start_catch_block_old): New function to perform the rest + of expand_start_catch_block under new style exceptions. + (expand_end_catch_block): Only pop the false label off the stack under + the old style of exceptions. + * semantics.c (finish_try_block): Don't call start_catch_handler. + * exception.cc (struct cp_eh_info): Add original_value field. + (__cplus_type_matcher): Perform type matching on the original exception + value, and if we have a match, set the current value. + (__cp_push_exception): Set the original exception value. + +1998-06-23 Jason Merrill + + * call.c (joust): Fix confusing conversion warning. + + * call.c (build_op_delete_call): Add placement parm. Check + LOOKUP_SPECULATIVELY. + * cp-tree.h, decl2.c, init.c: Adjust. + * decl.c (finish_function): Use it. + + * pt.c (tsubst): Diagnose creating void fields or variables. + +Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi + + * call.c (build_scoped_method_call): Remove unused variable `tmp'. + + * cp-tree.h (check_dtor_name): Add prototype. + + * init.c (expand_member_init): Remove unused variables + `ptr_type_node', `parm' and `rval'. + + * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier + in call to fprintf. + (lang_print_xnode): Likewise. + + * typeck2.c (enum_name_string): Cast argument to sprintf to long + and use %ld specifier. + + * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC + specifier in call to fprintf. + (GNU_xref_member): Cast argument to sprintf to int. + +Fri Jun 19 23:22:42 1998 Bruno Haible + + * typeck2.c (pop_init_level): Warn about implicit zero initialization + of struct members. + +Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi + + * cp-tree.h: Prototype function `check_java_method'. + +1998-06-17 Jason Merrill + + * class.c (finish_struct): Make conflicting use of id a pedwarn. + * decl.c (pushdecl_class_level): Likewise. + +1998-06-17 Mark Mitchell + + * pt.c (convert_nontype_argument): Issue an error when presented + with an integer (real) constant that cannot be simplified to an + INT_CST (REAL_CST). + + * cp-tree.h (c_get_alias_set): Remove declaration added in + 1998-06-13 change that should never have been checked in. + +1998-06-17 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Change % in format strings + to %%. + + * decl.c (grokvardecl): Don't build_static_name for decls that + aren't at namespace scope. + + * init.c (perform_member_init): Catch default-initialization of + references. + +1998-06-17 Mark Mitchell + + * errfn.c (cp_thing): Handle the `%%' formatting sequence. + +1998-06-17 Jason Merrill + + * method.c (hack_identifier): Complain about getting a namespace + or class template. + * typeck.c (decay_conversion): Remove check for namespaces. + * typeck2.c (incomplete_type_error): Likewise. + * parse.y (template_arg): Add PTYPENAME expansion. + +1998-06-16 Andrew MacLeod + + * decl.c (grokvardecl): Don't build external assembler names for + TYPENAMEs in other namespaces as there is no declarator. + * error.c (cp_file_of, cp_line_of): Don't extract file or line number + info from DECL_CONTEXT if it is NULL. + +1998-06-16 Jason Merrill + + * call.c (check_dtor_name): Split out. + (build_scoped_method_call): Use it. + (build_method_call): Use it. + * init.c (build_offset_ref): Use it. + + * typeck.c (build_static_cast): Fix handling of pointers to members. + + * decl.c (finish_function): Just return nothing from a constructor. + * typeck.c (c_expand_return): Complain about returning a void + expression from a destructor. + +1998-06-13 Mark Mitchell + + * class.c (alter_access): Accept a BINFO explaining how to get + from the entity whose accessed is being altered to the type doing + the altering. + (handle_using_decl): New function containing code split out from ... + (finish_struct_1): Here. + + * cp-tree.h (complete_type_or_else): Declare. + * init.c (build_new_1, build_delete): Use it. + * typeck.c (require_complete_type): Use complete_type, rather than + expanding it inline. + (complete_type_or_else): New function. + (build_component_ref): Use it. + (pointer_int_sum): Make sure the type pointed to is complete. + (pointer_diff): Likewise. + + * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for + types. + + * search.c (get_matching_virtual): Note that member templates + cannot override virtual functions. + +1998-06-12 Brendan Kehoe + + * pt.c (check_explicit_specialization): If DECLARATOR turned into + an error_mark_node from lookup_template_function, return the same. + (determine_specialization): Also make sure TEMPLATE_ID isn't an + error_mark_node, before we try to read its operands. + * decl.c (grokdeclarator): If we got an error_mark_node from + check_explicit_specialization, just return it right back. + +1998-06-12 Mark Mitchell + + * class.c (instantiate_type): Don't treat template-ids that don't + specify any template arguments as equivalent to ordinary + identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to + pointer-to-members for member templates. Tidy slightly. + * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation. + * init.c (build_offset_ref): Handle template-ids like ordinary + identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the + offset part of the OFFSET_REF. + * typeck.c (build_unary_op): Change check for unknown types to + look for OFFSET_REFs, not SCOPE_REFs. + +1998-06-11 Mark Mitchell + + * pt.c (is_member_template_class): New function. + (push_template_decl_real): Use it. + +1998-06-11 Benjamin Kosnik + + * friend.c (do_friend): Add support for nested classes using + member functions of the enclosing class as friends. + +1998-06-10 Mark Mitchell + + * call.c (convert_default_arg): Make global, not static. + (convert_arg_for_ellipsis): Split out from ... + (build_over_call): Here. + * cp-tree.h (convert_default_arg); Declare. + (convert_arg_to_ellipsis): Likewise. + (do_member_init): Remove. + * init.c (do_member_init): Remove; this code is dead. + (expand_member_init): Remove much of this code; it is dead. + * typeck.c (convert_arguments): Use convert_default_arg and + convert_arg_for_ellipsis, rather than duplicating here. + + * call.c (convert_like): Don't fail silently if + build_user_type_conversion fails. Always return error_mark_node + for failure. + +1998-06-10 Jason Merrill + + * search.c (covariant_return_p): Complain about ambiguous base. + + * typeck.c (build_component_ref): Diagnose ref to nested type. + +1998-06-10 Brendan Kehoe + + * decl.c (grokparms): Check that INIT isn't an error_mark_node + before giving error about invalid type for default arg. + +1998-06-10 Jason Merrill + + * call.c (build_method_call): Fix thinko. + +1998-06-10 Dave Brolley + + * decl2.c (lang_decode_option): New argc/argv interface. + * cp-tree.h (lang_decode_option): New argc/argv interface. + * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is + specified for cpplib-enabled compilers. + * lex.c (lang_init): Don't check_newline for cpplib. + (init_parse): Don't initialize cpplib here. + +1998-06-10 Brendan Kehoe + + * typeck.c (build_component_ref): Make sure FIELD has a lang_specific + piece before checking DECL_MUTABLE_P. + +1998-06-10 John Carr + + * tree.c (debug_binfo): Make printf format match arguments. + + * error.c (OB_PUTI): Make printf format match arguments. + +1998-06-10 Jason Merrill + + * init.c (perform_member_init): Handle default-initialization. + + * except.c (build_throw): Handle throwing NULL. + + * typeck.c (build_x_function_call): Use resolve_offset_ref. + + * search.c (compute_access): Only strip an anonymous union + for a FIELD_DECL. + + * call.c (add_builtin_candidates): Tweak. + + * cvt.c (build_expr_type_conversion): Restore code for conversion + from class types. + * decl2.c (delete_sanity): Use it. Clean up. + + * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons. + +1998-06-10 Branko Cibej + + * typeck.c (c_expand_return): Don't warn about void expressions on + return statements in functions returning void. + +1998-06-09 Mark Mitchell + + * pt.c (fn_type_unification): Revise documentation. Tidy. + (type_unification): Likewise. + +1998-06-09 Andrew MacLeod + + * semantics.c (finish_try_block): Rename expand_start_catch, and delete + expand_end_catch. + * parse.y (function_try_block): Rename expand_start_catch, and delete + expand_end_catch. + * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete + expand_end_catch. + +1998-06-09 Jason Merrill + + * search.c (lookup_member): New fn. + * class.c (finish_struct_1): Use it. + * decl.c (lookup_name_real): Use it. + +Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi + + * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h. + + * cp-tree.h: Add prototype for `maybe_print_template_context' and + `maybe_make_one_only'. + + * decl.c (auto_function): Remove unused variable `decl'. + + * decl2.c: Include dwarf2out.h and dwarfout.h. + + * lex.c: Remove redundant declarations of `set_float_handler' and + `asm_out_file'. + +1998-06-08 Andrew MacLeod + + * except.c (init_exception_processing): Remove NEW_EH_MODEL compile + time flag. Call __cp_eh_info instead of __cp_exception_info. + * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag. + (__cp_exception_info): Return offset into cp_eh_info structure to + match what use to be the start of this structure. + (__cp_eh_info): New function to return a pointer to cp_eh_info struct. + (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL + compile time flag. + (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call + __cp_eh_info instead of __cp_exception_info. + +1998-06-08 Jason Merrill + + * decl.c (cp_finish_decl): Disable inlining of extern inlines + with static variables. + +1998-06-08 Mark Mitchell + + * init.c (build_offset_ref): Correct previous change to use build, + not build_min. + +1998-06-07 Mark Mitchell + + * class.c (instantiate_type): Handle pointer-to-members where the + member is a template. + * init.c (build_offset_ref): Likewise. + * typeck.c (build_unary_op): Likewise. + +1998-06-07 Richard Henderson + + * lex.c (lang_init_options): New function. + (lang_init): Remove flag_exceptions == 2 hack. + +1998-06-05 Jason Merrill + + * search.c (envelope_add_decl): Tweak for implicit typename. + + * call.c (joust): Also warn about confusing conversion op/constructor + overload resolution. + + * spew.c (yylex): Also return the TYPE_DECL if got_object. + Don't clear got_object after '~'. + * call.c (build_scoped_method_call): Tweak destructor handling. + (build_method_call): Likewise. + * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with + TYPE_MAIN_VARIANT for destructors. + * semantics.c (finish_object_call_expr): Complain about calling a + TYPE_DECL. + +1998-06-05 Per Bothner + + * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles): + Define - update needed by gcc.c change. + +1998-06-05 Jason Merrill + + * error.c (cp_printers): Use 'o' instead of '_' for the null entry. + +1998-06-05 Martin v. Loewis + + * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. + * decl.c (lookup_name_real): Add namespaces_only parameter. + If set, return only NAMESPACE_DECLs. + (select_decl): Likewise. + (identifier_type_value): Give additional parameter. + (lookup_name_nonclass): Likewise. + (lookup_name): Likewise. + (find_binding): Skip namespace aliases. + (binding_for_name): Likewise. + (push_namespace): Check for namespace aliases. + (lookup_name_namespace_only): New function. + (begin_only_namespace_names, end_only_namespace_names): New functions. + * decl2.c (set_decl_namespace): Skip namespace aliases. + (do_using_directive): Likewise. + (do_namespace_alias): Produce namespace aliases, fix alias + redeclaration. + * error.c (dump_decl): Support SCOPE_REF. + * parse.y (extdef): Wrap lookup with namespace_only for namespace + aliases and using declarations. + +1998-06-04 Jason Merrill + + * tree.c (really_overloaded_fn): Only see through one TREE_LIST. + + * error.c (dump_expr): Clean up NEW_EXPR case. + +1998-06-04 Martin von Löwis + + Suggested by Brendan Kehoe + * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, + treat it as using ::decl. + + * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE. + + * tree.c (mapcar): Support NEW_EXPR. + + * error.c (dump_expr): Support NEW_EXPR. + +1998-06-03 Jason Merrill + + * method.c (make_thunk): Use overload machinery to make name. + * search.c (covariant_return_p): New fn. + (get_matching_virtual): Use it. + + * init.c (build_new_1): Fix check for void. + +1998-06-01 Per Bothner + + * cp-tree.h (TYPE_FOR_JAVA): New macro. + * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node, + java_int_type_node, java_long_type_node, java_float_type_node, + java_double_type_node, java_char_type_node, java_boolean_type_node): + New "primitive" types, with predefined names __java_byte etc. + (record_builtin_java_type): New function. + (init_decl_processing): Make Java types with record_builtin_java_type. + (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA". + (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class. + (grokfndecl): Call check_java_method for Java classes. + * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA. + (process_overload_item): Match types against specific + java_XX_type_node types, rather than using is_java_type. + * class.c (finish_struct_1): Don't add default copy constructor + or operator= if TYPE_FOR_JAVA. + (pop_lang_conext): Restore strict_prototyp proper if Java. + * decl2.c (acceptable_java_type, check_java_method): New functions. + * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern. + (tsubst): Move common statement after if statement. + * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match. + +1998-06-01 Jason Merrill + + * pt.c (for_each_template_parm): Use first_rtl_op. + + * tree.c (build_cplus_array_type_1): Also check index_type for + template parms. + +1998-05-31 Jason Merrill + + * pt.c (tsubst): Always copy BINFO_BASETYPES. + +1998-05-29 scott snyder + + * tree.c (layout_basetypes): If we change TYPE_SIZE, change + TYPE_SIZE_UNIT too. + +1998-05-29 Mark Mitchell + + * decl.c (grokdeclarator): Don't complain about in-class + initialization of static consts if we don't really know the type + of the variable. + +1998-05-29 Jason Merrill + + * cp-tree.h (DECL_DESTRUCTOR_P): New macro. + * method.c (build_destructor_name): New fn. + * decl2.c (maybe_retrofit_in_chrg): Split out... + (grokclassfn): From here. Reorganize. + * decl.c (grok_ctor_properties): Make sure ctors for types with + vbases have the in_chrg parm. + * pt.c (instantiate_class_template): Update + TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call + grok_*_properties. + (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg. + +1998-05-28 Mark Mitchell + + * pt.c (instantiate_decl): Make test for whether or not static + variables should be instantiated early match its comment. + +1998-05-28 Jason Merrill + + * decl.c (start_decl): Always pedwarn about vacuously redeclaring + a member. + (start_function): Call check_default_args. + * decl2.c (grokfield): Don't call check_default_args. + (check_default_args): Use cp_error_at. + * lex.c (do_pending_defargs): Call check_default_args. + +1998-05-27 Brendan Kehoe + + * call.c (build_method_call): Make sure get_type_value returns + something before we try to use its TYPE_MAIN_VARIANT. + (build_scoped_method_call): Likewise. + +1998-05-27 Jason Merrill + + * typeck2.c (digest_init): Complain about getting a TREE_LIST to + initialize an array. + + * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and + DECL_VIRTUAL_P. + + * friend.c (do_friend): Clarify template warning. + +1998-05-27 Mark Mitchell + + * decl.c (shadow_label): Don't treat decls as identifiers. + (maybe_push_to_top_level): Clear shadowed_labels. + + * pt.c (instantiate_decl): Reset lineno and filename after calling + regenerate_decl_from_template. + + * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an + error_mark_node. + +1998-05-27 Kevin Buhr + + * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE. + +1998-05-26 Kriang Lerdsuwanakij + + * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes. + (convert_nontype_argument): Handle cases when nontype template + parameters become classes after substitution. + +1998-05-26 Mark Mitchell + + * friend.c (is_friend): Use comptypes, rather than == to compare + types. Modify for new representation of template friends. + (make_friend_class): Likewise. + * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak. + (instantiate_class_template): Deal with template friends. + + * decl.c (store_parm_decls): Remove redundant call to + expand_main_function. + +1998-05-26 Benjamin Kosnik + + * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before + DECL_USE_TEMPLATE. + +1998-05-26 Per Bothner + + * language_as_string: Handle lang_java. + +1998-05-26 Jason Merrill + + * decl.c (pushdecl): Don't copy the type_decl. + +1998-05-26 Martin v. Löwis + + * class.c (pushclass): Always store TYPE_MAIN_VARIANT in + current_class_type. + * decl.c (grokdeclarator): Put typedefs on the type's obstack. + + * parse.y (complex_direct_notype_declarator): Use $1 to access + scope of notype_qualified_id. + +1998-05-26 Dave Brolley + + * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib. + (init_parse): Initialize cpplib interface. + + * Makefile.in (CXX_OBJS): Make sure dependencies never end with an + empty continuation. + +1998-05-26 Mark Mitchell + + * decl.c (pushtag): Avoid crashing on erroneous input. + +1998-05-25 Martin v. Löwis + + * decl.c (push_namespace): Only produce one unique name for + anonymous namespaces. + (get_unique_name): Remove. + +1998-05-25 Mark Mitchell + + * call.c (tourney): Don't do any extra comparisons. + + * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions. + + * cp-tree.h (processing_template_parmlist): Declare. + * decl.c (pushtag): Don't call push_template_decl when we + shouldn't. + * pt.c (processing_template_parmlist): New variable. + (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro. + (complete_template_args): Use it. + (add_to_template_args): Likewise. + (innermost_args): Likewise. + (tsubst): Likewise. + (begin_template_parm_list): Use processing_template_parmlist. + (end_template_parm_list): Likewise. + + * cp-tree.h (ANON_UNION_TYPE_P): New macro. + * decl.c (grokdeclarator): Use it. + * decl2.c (grok_x_components): Likewise. + * init.c (initializing_context): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + * search.c (compute_access): Likewise. + * typeck.c (build_component_ref): Likewise. + + * decl.c (grokdeclarator): Don't give a cv-qualified version of an + unnamed type a typedef name "for linkage purposes". + + * pt.c (lookup_template_class): Don't look at + IDENTIFIER_CLASS_VALUE when there's no current_class_type. + + * method.c (build_overload_int): Handle error cases gracefully. + + * pt.c (instantiate_decl): Handle static member variables + correctly. + + * pt.c (tsubst): Use the tsubst'd type when producing new + TEMPLATE_PARM_INDEX nodes. + +1998-05-24 Mark Mitchell + + * tree.c (cp_tree_equal): Handle pointers to member functions. + + * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make + sure the type of the REF_BIND is a reference type. + (maybe_handle_ref_bind, compare_ics): Rename reference_type to + target_type for clarity. + + * parse.y (xcond): Move call to condition_conversion ... + * semantics.c (finish_for_cond): Here. + * parse.c: Regenerated. + +1998-05-24 Jason Merrill + + * decl.c (push_namespace): Namespaces have type void. + * typeck2.c (incomplete_type_error): Complain about namespace + used as expression. + * typeck.c (decay_conversion): Likewise. + +1998-05-24 Martin von Löwis + + * error.c (dump_expr): Support namespaces. + +1998-05-23 Jason Merrill + + * cp-tree.def: Add SRCLOC. + * cp-tree.h: Add struct tree_srcloc and accessor macros. + * tree.c (build_srcloc, build_srcloc_here): New fns. + * pt.c (add_pending_template): Use build_srcloc_here. + (push_tinst_level): Update last_template_error_tick before erroring. + (instantiate_decl): Restore lineno and input_filename before + calling add_pending_template. + * decl2.c (finish_file): Set up lineno and input_filename for + pending templates. + +1998-05-22 Jason Merrill + + * decl.c (lang_print_error_function): New fn. + (init_decl_processing): Set print_error_function to use it. + * errfn.c (cp_thing): Don't call maybe_print_template_context here. + + * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and + ICS_BAD_FLAG. + + * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for + copy-initialization. + + * class.c (build_vtable_entry): Use int_fits_type_p. + (build_vtable): Pass a signed offset to build_vtable_entry. + (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1, + set_rtti_entry): Likewise. + +1998-05-22 Per Bothner + + * cp-tree.h: Add comments documenting which LANG_FLAGS are used. + (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used. + +1998-05-22 Jason Merrill + + * pt.c (print_template_context): Use fprintf instead of cp_error. + + * pt.c (determine_specialization): Just return an error_mark_node. + Also print the decl we want in error messages. If we complain, + return error_mark_node. + (tsubst_friend_function): Set lineno and input_filename so + error messages will be useful. + (instantiate_template): Just return an error_mark_node. + (check_explicit_specialization): Don't mess with a returned + error_mark_node. + + * pt.c (print_template_context): Add new argument. + (maybe_print_template_context): New fn. + (push_tinst_level): Increment tinst_level_tick. + (pop_tinst_level): Likewise. + * errfn.c (cp_thing): Call maybe_print_template_context. Use + xrealloc instead of xmalloc. + + * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT. + +1998-05-21 Jason Merrill + + * pt.c (tsubst_friend_class): Don't call redeclare_class_template + if the template we looked up is the same as the one we already + have. + +Thu May 21 11:54:44 1998 Dave Brolley + + * lex.c: (handle_sysv_pragma): FILE* parameter not used. + (cpp_reader,parse_in): Add for cpplib. + (check_newline): Call handle_sysv_pragma with new interface. + (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line. + + * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib. + (sub_getch): Call GETC for cpplib. + + * cp-tree.h: (get_directive_line): Different prototype for cpplib. + (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line. + + * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib. + +1998-05-21 Jason Merrill + + * decl2.c (maybe_make_one_only): New fn. + (import_export_vtable): Use it. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + +1998-05-21 Mark Mitchell + + * decl2.c (find_representative_member): Rename to ... + (build_anon_union_vars): New function. + (finish_anon_union): Fix stupidity of previous change. + +1998-05-20 Jason Merrill + + * decl.c (grokfndecl): Handle definition of specialization in + friend declaration. + + * error.c (dump_decl): Fix LOOKUP_EXPR handling. + +1998-05-20 Mark Mitchell + + * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P + to look for type declarations. + (finish_struct): Deal with templates on the CLASSTYPE_TAGS list. + * cp-tree.h (DECL_DECLARES_TYPE_P): New macro. + (finish_member_class_template): Declare. + * decl.c (pushtag): Put member class templates on the + CLASSTYPE_TAGS list, just as for ordinary member classes. + (pushdecl_class_level): Use DECL_DECLARES_TYPE_P. + (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with + IDENTIFIER_NAMESPACE_VALUEs. + * parse.y (component_decl): Move code to ... + * semantics.c (finish_member_class_template): New function. + Don't put member class templates on the list of components for a + class. + * parse.c: Regenerated. + * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. + In fact, don't use DECL_CONTEXT at all here. + +1998-05-20 Martin von Loewis + + * decl.c (record_unknown_type): New function. + (init_decl_processing): Call it for the unknown and global type + nodes. + +1998-05-20 Mark Mitchell + + * decl2.c (find_representative_member): New function. + (finish_anon_union): Use it. + + * cp-tree.h (MAIN_NAME_P): New macro. + (DECL_MAIN_P): Likwise. + * decl.c (pushdecl): Avoid crashing on redefinitions of `main'. + (grokfndecl): Use the new macros. + (grokdeclarator): Likewise. + (start_function): Likewise. + (store_parm_decls): Likewise. + (finsh_function): Likewise. + * friend.c (do_friend): Likewise. + * typeck.c (build_function_call_real): Likewise. + (build_unary_op): Likewise. + +Wed May 20 02:16:01 1998 Jason Merrill + + * decl2.c (start_objects, finish_objects, do_dtors, + do_ctors): Split out from... + (finish_file): ...here. + +Tue May 19 20:36:23 1998 Jason Merrill + + * tree.c (is_overloaded_fn): Don't abort on placeholders from + push_class_decls. + +Tue May 19 15:16:22 1998 Brendan Kehoe + + * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node. + + * error.c (dump_expr): Handle an ARROW_EXPR. + +Tue May 19 15:13:39 1998 Mark Mitchell + + * decl.c (saveable_obstack): Declare. + (pushdecl): Copy TYPE_DECLs to the same obstack as the type they + declare, if necessary. + +Tue May 19 14:50:27 1998 Mark Mitchell + + * call.c (compare_qual): Remove. + (is_subseq): Tweak. + (is_properly_derived_from): New function. + (maybe_handle_ref_bind): Likewise. + (maybe_handle_implicit_object): Likewise. + (compare_ics): Modify substantially to bring into conformance with + the standard. + * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro. + (comp_cv_qualification): Declare. + (comp_cv_qual_signature): Likewise. + * typeck.c (comp_cv_qualification): Likewise. + (comp_cv_qual_signature): Likewise. + +Tue May 19 10:05:02 1998 Kaveh R. Ghazi + + * Makefile.in (parse.o): Depend on toplev.h. + + * class.c (typecode_p): Remove prototype and definition. + + * cp-tree.h (currently_open_class, is_empty_class, member_p): + Add prototype. + + * decl.c (push_overloaded_decl_top_level): Remove prototype and + definition. + + * errfn.c (cp_error): Cast function pointer `error' to (errorfn *) + in call to `cp_thing'. + (cp_warning): Likewise for function pointer `warning'. + + * except.c (do_function_call): Remove prototype and definition. + (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL. + + * method.c (is_java_type): Add prototype and make it static. + + * parse.y: Include toplev.h. + + * pt.c (type_unification): Remove unused variable `arg'. + (instantiate_decl): Likewise for `save_ti'. + + * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'. + +Tue May 19 02:43:25 1998 Jason Merrill + + * init.c (build_member_call): Handle template_ids. + * parse.y (primary): Add global_scope template_id. + +Mon May 18 23:22:52 1998 Jason Merrill + + * decl2.c (get_sentry): Use end_temporary_allocation. + Don't declare permanent_obstack. + +Mon May 18 12:28:44 1998 Mark Mitchell + + * parse.y (.finish_new_placement): New non-terminal. + (unary_expr, new_type_id): Use it. + * parse.c: Regenerated. + +Mon May 18 12:20:27 1998 Brendan Kehoe + + * pt.c (redeclare_class_template): Say where the original definition + of the template-parameter's default argument appeared. + +Mon May 18 03:00:57 1998 Jason Merrill + + * call.c (build_over_call): Tweak empty class handling. + + * decl.c (make_typename_type): Use currently_open_class. + + * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. + +Mon May 18 01:43:01 1998 Martin v. Loewis + + * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE + for a type unless it is one. + + * class.c (finish_struct_1): Use OVL_CURRENT in error message. + +Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (program_transform_name, objdir): Define. + + * Makefile.in (BISON): Use bison from the build tree if it exists. + (FLEX): Likewise. + +Sun May 17 14:52:08 1998 Martin v. Loewis + + * typeck.c (type_unknown_p): Return true for TREE_LIST also. + + * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs. + +Sun May 17 14:51:41 1998 Jason Merrill + + * call.c (build_scoped_method_call): Likewise. + +Sun May 17 13:53:48 1998 Mark Mitchell + + * init.c (build_new_1): Call suspend_momentary around the creation + of values that must be saved for exception handling. + * parse.y (.build_new_placement): New non-terminal. + (unary_expr, new_placement): Use it. + * parse.c: Regenerated. + +Sun May 17 12:32:08 1998 Jason Merrill + + * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare + old and new types. + + * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the + canonical type. + + * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace. + +Fri May 15 20:28:00 1998 Jason Merrill + + * decl.c (start_decl): Revert problem change. + + * Makefile.in (CONFLICTS): Fix. + +Fri May 15 15:34:02 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits. + +Fri May 15 00:46:05 1998 Jason Merrill + + * class.c (finish_struct_1): Use BINFO_SIZE. + + * decl.c (start_decl): Use 'tem'. + +Thu May 14 16:30:47 1998 Andrew MacLeod + + * exception.cc: Include eh-common.h. + (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL. + (__cplus_type_matcher): First stab at new C++ runtime type matcher. + (__cp_push_exception): Initialize eh_info struct as well. + * except.c: Remove local structs and include eh-common.h. + (init_exception_processing): Set language and version codes. + (call_eh_info): Add presence of eh_info to runtime description of + struct cp_eh_info. + (expand_end_eh_spec): Call start_catch_block() and end_catch_block(). + * semantics.c (finish_try_block): Call start_catch_block() and + end_catch_block(). + * parse.y (function_try_block): Call start_catch_block() and + end_catch_block(). + +Thu May 14 12:27:34 1998 Brendan Kehoe + + * typeck.c (original_type): New function. + (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2, + to see if they're actually the same. + * cp-tree.h (original_type): Declare. + +Wed May 13 12:54:30 1998 Kaveh R. Ghazi + + * Makefile.in (lex.o): Depend on output.h. + + * call.c (add_function_candidate): Remove unused variable `cand'. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + + * cp-tree.h: Add prototype for `types_overlap_p'. + + * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED. + + * decl2.c (merge_functions): Remove unused variables `tmp' and + `tempn'. + + * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED. + (code_as_string): Likewise. + (language_as_string): Likewise. + (parm_as_string): Likewise. + (op_as_string): Likewise. + (assop_as_string): Likewise. + (cv_as_string): Likewise. + + * lex.c: Include output.h. + + * pt.c (type_unification): Cast first argument of `bzero' to a char*. + + * search.c (dfs_no_overlap_yet): Mark parameter `t' with + ATTRIBUTE_UNUSED. + + * tinfo.cc (__class_type_info::dcast): Change the type of variable + `i' from int to size_t. + + * typeck.c (language_lvalue_valid): Mark parameter `exp' with + ATTRIBUTE_UNUSED. + +Tue May 12 21:37:49 1998 Jason Merrill + + * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or + DECL_NAMESPACE_SCOPE_P. + (lang_decl_name): Likewise. + * pt.c (tsubst_friend_function, tsubst): Likewise. + * decl.c (pushdecl, redeclaration_error_message, start_decl, + cp_finish_decl, start_function): Likewise. + * class.c (finish_struct_1): Likewise. + * call.c (build_over_call): Likewise. + (compare_ics): Use DERIVED_FROM_P. + +Tue May 12 07:24:18 1998 Mark Mitchell + + * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro. + * method.c (build_mangled_name): Use it. + (build_decl_overload_real): Likewise. + + * error.c (dump_simple_decl): New function, broken out from ... + (dump_decl): Use it. + +Mon May 11 11:38:07 1998 Mark Mitchell + + * ptree.c (lang_print_xnode): Add missing `break'. + + * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE. + + * call.c (add_template_candidate): Adjust for changes to + fn_type_unification. + (add_template_candidate_real): Likewise. + (add_template_conv_candidate): Likewise. + (build_user_type_conversion_1): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + * class.c (instantiate_type): Likewise. + * cp-tree.h (unification_kind_t): New type. + (fn_type_unification): Adjust prototype. + (type_unificaiton): Likewise. + * pt.c (UNIFY_ALLOW_NONE): New macro. + (UNIFY_ALLOW_MORE_CV_QUAL): Likewise. + (UNIFY_ALLOW_LESS_CV_QUAL): Likewise. + (UNIFY_ALLOW_DERIVED): Likewise. + (unify): Change prototype. + (maybe_adjust_types_for_deduction): New function. + (check_cv_quals_for_unify): Likewise. + (determine_specialization): Adjust. + (fn_type_unification): Likewise. + (type_unification): Likewise. + (type_unification_real): Likewise. Use + maybe_adjust_types_for_deduction. Fix mishandling of + back-unification of template functions passed as arguments. Pass + appropriate combination of UNIFY_ALLOW_* to unify. + (unify): Remove unused NTPARMS parameter. Use + check_cv_quals_for_unify. Remove bogus code that allowed + too-generous unification in order to adhere more closely to standard. + (get_bindings_real): Adjust. + (get_class_bindings): Likewise. + + * method.c (build_overload_identifier): Only use the innermost + template arguments when mangling. + * pt.c (tsubst_template_argument_vector): New function. + (complete_template_args): Deal with the situation where the + extra_args contain more than one level of arguments. + (lookup_template_class): Deal with member template classes, which + may have more than one level of arguments. + (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE. + Improve handling of member template classes. Use + DECL_PRIMARY_TEMPLATE instead of inline expansion. Use + tsubst_template_argument_vector where appropriate. + (regenerate_decl_from_template): Break out from ... + (instantiate_decl): Here. + + * lex.c (yyprint): Remove TYPENAME_ELLIPSIS. + * parse.h: Regenerated. + * parse.c: Really regenerated. + + * cp-tree.h (finish_unary_op_expr): New function. + (finish_id_expr): Likewise. + (begin_new_placement): Likewise. + (finish_new_placement): Likewise. + (finish_declarator): Likewise. + (finish_translation_unit): Likewise. + (finish_parmlist): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_default_args): Likewise. + (finish_inline_definitions): Likewise. + * parse.y (GCC_ASM_KEYWORD): Remove. + (TYPENAME_ELLIPSIS): Likewise. + * parse.c: Regenerated. + Use new functions in semantics.c in the actions for many rules. + * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD. + * hash.h: Regenerated. + * semantics.c (finish_expr_stmt): Allow NULL expr. + (finish_unary_op_expr): New function, containing + code previously in parse.y. + (finish_id_expr): Likewise. + (begin_new_placement): Likewise. + (finish_new_placement): Likewise. + (finish_declarator): Likewise. + (finish_translation_unit): Likewise. + (finish_parmlist): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_default_args): Likewise. + (finish_inline_definitions): Likewise. + +Sun May 10 23:43:13 1998 Mark Mitchell + + * typeck.c (build_c_cast): Don't decay arrays and functions to + pointer type when converting to a class type. + +Sun May 10 22:53:56 1998 Jason Merrill + + * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro. + (DECL_CLASS_SCOPE_P): Likewise. + +Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org) + + * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT. + * decl2.c (constructor_name_full): Likewise. + +Sun May 10 22:48:12 1998 Mike Stump + + * tree.c (mapcar): Add OVERLOAD support. + + * init.c (resolve_offset_ref): We must use basetype_path before we + destroy it with a call to convert_pointer_to. + +Sat May 9 14:44:37 1998 Jason Merrill + + * class.c (currently_open_class): New fn. + * decl.c (lookup_name_real): Use it. + * search.c (lookup_field): Likewise. + +Fri May 8 23:32:42 1998 Martin von Loewis + + * cp-tree.def (OVERLOAD): New node. + * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, + SET_IDENTIFIER_NAMESPACE_VALUE): Define. + (NAMESPACE_BINDING): Remove. + (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use + namespace_binding. + (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED): + Define. + (tree_overload): New struct. + (IDENTIFIER_TYPE_VALUE): Use identifier_type_value. + (REAL_IDENTIFIER_TYPE_VALUE): Define. + (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE. + (lang_decl_flags): Remove in_namespace. + (lang_decl): Remove chain. + (DECL_CHAIN, DECL_NAMESPACE): Remove. + (flag_honor_std): Declare extern. + (identifier_type_value, pushdecl_namespace_level, push_using_decl, + namespace_binding, set_namespace_binding, + lookup_function_nonclass, cat_namespace_levels, + set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons, + scratch_ovl_cons, ovl_member, build_overload): Declare. + (decl_list_length, get_namespace_id, current_namespace_id, + overloaded_globals_p): Remove. + (lookup_using_namespace, qualified_lookup_using_namespace): Change + return type. + (push_scratch_obstack): New macro. + * call.c (add_function_candidate): Special-case type of OVERLOAD node. + (build_user_conversions_1): Iterate using OVL_NEXT for ctors, + convs, fns. + (build_new_function_call): Iterate using OVL_CHAIN. + Print DECL_NAME in when reporting ambiguities. + (build_object_call): Iterate using OVL_NEXT for fns, convs. + (build_new_op): Call lookup_function_nonclass. + Iterate using OVL_NEXT. + (build_op_delete_call): Change detection of members. + Do not wrap TREE_LIST around fields and single global functions. + (build_over_call): Don't push a class level if the context is a + namespace. + (build_new_method_call): Iterate using OVL_NEXT. + * class.c (add_method): Chain overloaded members using + build_overload. Remove copying of method. + (grow_method): When iterating through the obstack, expect OVERLOAD + nodes. Chain overload members. + (finish_struct_methods): Chain overload members. Unpack OVERLOAD + nodes in call to get_baselinks. + (duplicate_tag_error): Expect OVERLOAD nodes when unchaining. + (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle + fdecls that are OVERLOAD nodes. + (validate_lhs): New function. + (instantiate_type): Do not copy OVERLOAD nodes. Remove dead + code. Use DECL_NAME in error messages. Split code between global + and member function processing. + * decl.c (global_type_node): New static variable. + (in_std): New global. + (struct binding_level): New field usings. + (resume_binding_level): Assert that we are not in a class. + (toplevel_bindings_p): Just check for namespace_p or + pseudo_global. + (resume_level): Remove. + (find_binding): New function. + (binding_for_name): Call it. + (namespace_binding, set_namespace_binding): New functions. + (push_namespace): Associate binding level with new namespace, + resume_binding_level for existing namespace. Remove old code. + Fake std by counting. + (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE. + (maybe_push_to_top_level): Save current namespace. + (pop_from_top_level): Restore saved namespace. + (pop_namespace): Call suspend_binding_level. Remove old code. + (cat_namespace_levels): New function. + (set_identifier_type_value_with_scope): For namespace bindings, + set BINDING_TYPE, and use global_type_node. + Use REAL_IDENTIFIER_TYPE_VALUE otherwise. + (identifier_type_value): New function. + (pushtag): If no context, use current_namespace. + (duplicate_decls): Don't process DECL_CHAIN. + (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not + already set. Never reset it to NULL_TREE. Lookup global variables + in their namespace. Push overloaded templates if they are on + namespace level. + (pushdecl_namespace_level): New function. + (pushdecl_top_level): Implement using pushdecl_namespace_level. + (pushdecl_using_decl): New function. + (overloaded_globals_p): Remove. + (push_overloaded_decl): Create OVERLOAD nodes, and iterate through + them. Use namespace_binding and set_namespace_value. + (redeclaration_error_message): Complain if the declarations come + from different namespaces. + (lookup_tag): On namespace level, look in the BINDING_TYPE. + (lookup_namespace_name): Pass tree_bindings from stack. Remove + old code. + (select_decl): New function. + (lookup_name_real): Call it for qualified and unqualified lookup. + Pass tree_bindings from the stack. + If prefer_type is 1, also accept namespaces. + (lookup_function_nonclass): New function. + (init_decl_processing): Set the binding level of the global + namespace to global_binding_level. + Build a proper type list for __builtin_apply. + Initialize std_node to "fake std" if flag_honor_std is set. + Initialize global_type_node. + Allocated bad_alloc in namespace std if flag_honor_std. + (define_function): Set the DECL_CONTEXT to the current_namespace. + (start_decl): A namespace is not considered as a context here. If + the DECL_CONTEXT is a namespace, push the decl. + (cp_finish_decl): Check for namespaces used as initializers. + (grokfndecl): Add namespace parameter. Remove processing of + DECL_CHAIN. + (grokvardecl): Add namespace parameter. + (grokdeclarator): Process SCOPEs that are namespaces. For + mangling, temporarily set the DECL_CONTEXT on anonymous structs. + (start_function): Check for contexts that are namespaces. + Set context for declarations that have not been pushed. + (store_parm_decls): Check for ::main only. + (finish_function): Likewise. + (start_method): Check for contexts that are namespaces. + (start_method): Remove DECL_CHAIN processing. + * decl2.c (flag_honor_std): Declare. + (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given. + (decl_namespace_list): New static global. + (grok_x_components): Ignore namespaces as type contexts. + (check_classfn): Expect OVERLOAD nodes. + (grokfield): Remove DECL_CHAIN processing. + (finish_file): Call cat_namespace_levels. + (merge_functions): New function. + (ambiguous_decl): Rewrite. + (lookup_using_namespace): Produce tree_bindings. + (qualified_lookup_using_namespace): Likewise. + (set_decl_namespace, decl_namespace, current_decl_namespace, + push_decl_namespace, pop_decl_namespace): New functions. + (arg_lookup): New struct. + (add_function, arg_assoc_namespace, arg_assoc_class, + arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent): + New functions. + (get_namespace_id, current_namespace_id): Remove. + (do_toplevel_using_decl): Rewrite. + (do_class_using_decl): Complain about namespace qualifiers. + (do_using_directive): Sorry if not on namespace level. Complain + about unknown namespaces. + * error.c (dump_aggr_type): Check for namespace contexts. + * except.c (init_exception_processing): Push terminate into std. + * friend.c (is_friend): A namespace is not a context, here. + * init.c (expand_member_init): Remove DECL_CHAIN processing. + (build_offset_ref): Process OVERLOAD nodes. + * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std. + * lex.c (identifier_type): Loop using OVL_CHAIN. + (see_typename): Set looking_for_typename to 2. + (real_yylex): Likewise. + (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs. + (do_scoped_id): Expect OVERLOAD nodes. + Change calling convention for qualified_lookup_using_namespace. + (build_lang_decl): Don't set in_namespace anymore. + * method.c (typevec_size): New global. + (build_overload_nested_name): Return if global_namespace. + Otherwise, always expect a declaration context. + (build_qualified_name): Likewise. + Make sure we don't write beyond typevec_size. + (build_decl_overload_real): Likewise. + Allocate one extra slot for the namespace. + (hack_identifier): Mark code dead. + Process OVERLOAD and NAMESPACE_DECL nodes. + * parse.y (program): Pop namespaces until in global namespace. + (extdef): In a using-declaration, don't discard the identifier if + there is no declaration. + (left_curly): Ignore type contexts which are namespaces. + (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type + used as scope. + * pt.c (template_class_depth): Expect types to be namespaces. + (determine_specialization): Simplify by expecting OVERLOAD nodes. + (push_template_decl): Push into namespace level. + Reset ctx if it is a namespace. + Set DECL_CONTEXT to current_namespace if not set already. + Ignore real contexts that are namespaces. + (mangle_class_name_for_template): Skip global_namespace. + Mangle other namespaces as declarations. + (lookup_template_function): Set type of OVERLOAD nodes to unknown. + (lookup_template_class): Push into namespace of context. + If the context is a namespace, set it to global_namespace. + Use id_context for mangling. + (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes. + (tsubst_friend_function): Ignore namespace contexts. + Push into namespace level. + (tsubst): Handle NAMESPACE_DECL nodes. + Remove DECL_CHAIN processing. + (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes. + * ptree.c (print_lang_identifier): Print bindings. + (lang_print_xnode): Print OVERLOAD nodes. + * rtti.c (init_rtti_processing): Push type_info into std. + * search.c (lookup_fnfields_here): Expect OVERLOAD nodes. + (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual, + dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions, + lookup_fnfields_here): Likewise. + Process all nodes, instead of going through TREE_CHAIN. + * sig.c (build_signature_pointer_or_reference_type): Set context + to global_namespace. + (build_signature_table_constructor): Expect OVERLOAD nodes. + * spew.c (yylex): Save old setting of looking_for_typename. + * tree.c (decl_list_length): Remove. + (binding_init): New function. + (count_functions): Rewrite. + (is_overloaded_fn): Expect OVERLOAD nodes. + (really_overloaded_fn, get_first_fn, lvalue_type): Likewise. + (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after, + ovl_member): New functions. + * typeck.c (require_complete_type): Expect OVERLOAD nodes. + (type_unknown_p): Likewise. + (require_instantiated_type): Likewise. + (build_component_ref): Declare code dead. + (build_x_function_call): Create and expect OVERLOAD nodes. + (build_function_call_real): Check for ::main only. + (build_unary_op): Likewise. Expect OVERLOAD nodes. + (convert_for_assignment): Check for TREE_LIST before accessing + TREE_VALUE. + * decl.c (duplicate_decls): Check for namespace bindings instead + of global bindings. + (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real, + lookup_name_current_level, start_decl, xref_tag, + finish_enum): Likewise. + * init.c (build_offset_ref): Likewise. + * search.c (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (dfs_debug_mark): Likewise. + * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE. + (poplevel_class, pop_from_top_level): Likewise. + * decl2.c (finish_method): Likewise. + * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE. + * decl.c (record_builtin_type): Likewise. + (init_decl_processing, grokfndecl): Likewise. + * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise. + (make_lang_type): Likewise. + * parse.y (make_thunk): Likewise. + * pt.c (tsubst): Likewise. + * tree.c (debug_binfo): Likewise. + * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h, + tinfo2.cc, inc/new.h: Add std qualifications. + * inc/new: Wrap with namespace std if __HONOR_STD. + * inc/typeinfo: Likewise. + +Fri May 8 00:43:50 1998 Jason Merrill + + * call.c (build_user_type_conversion_1): Handle second_conv + properly for templates. + +Thu May 7 17:09:25 1998 Andrew MacLeod + + * method.c (build_decl_overload_real): Set TREE_USED flag to + zero for build_type_variants nodes as well. + +Wed May 6 19:27:09 1998 Jason Merrill + + * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE. + +Wed May 6 16:49:48 1998 Jim Wilson + + * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o, + except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o, + rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o, + xref.o): Add toplev.h dependencies. + +Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com) + + * errfn.c (cp_error, cp_warning): Remove declarations for + error and warning respectively. + +Wed May 6 14:28:18 1998 Kaveh R. Ghazi + + * error.c: Convert to using ctype macros defined in system.h. + * method.c: Likewise. + * xref.c: Likewise. + * lex.c: Likewise. Also remove redundant system header stuff. + +Wed May 6 06:36:41 1998 Robert Lipe + + * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c, + expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c, + search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c, + xref.c: Add include of toplev.h. + +Wed May 6 02:33:39 1998 Jason Merrill + + * tree.c (perm_manip): Also regenerate the RTL of an extern. + (copy_to_permanent): Use end_temporary_allocation. + +Tue May 5 23:54:04 1998 Jason Merrill + + * init.c (expand_vec_init): The initialization of each array + element is a full-expression. + +Tue May 5 18:24:13 1998 Andrew MacLeod + + * method.c (build_mangled_name): Add a call to build_type_variant + to get the right type. + +Tue May 5 01:25:03 1998 Jason Merrill + + * Makefile.in: Add .SUFFIXES. + + * cp-tree.def: Remove NAMESPACE_DECL. + +Sun May 3 01:32:14 1998 Jason Merrill + + * call.c (build_over_call): Do evaluate arg even if it has empty + class type. + * decl.c (start_function): Don't push a member function. + +Thu Apr 30 18:59:23 1998 Jim Wilson + + * Makefile.in (g++FAQ.info): Put -o option before input file. + +Thu Apr 30 13:05:33 1998 Andrew MacLeod + + * gxxint.texi: Add info for squangling codes K and B. + +Tue Apr 28 13:22:01 1998 Mark Mitchell + + * semantics.c (begin_stmt_expr): Avoid duplicating the effect of + the expression in templates. + (finish_stmt_expr): Likewise. + +1998-04-28 Brendan Kehoe + + * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int. + +Mon Apr 27 13:58:10 1998 Mark Mitchell + + * decl.c (maybe_push_to_top_level): Always clear + current_template_parms and processing_template_decl. + (pushtag): Remove check of current_class_type and some comments, + since maybe_push_to_top_level no longer creates confusion. + +Sun Apr 26 12:10:18 1998 Mark Mitchell + + * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro. + (DECL_CLASS_TEMPLATE_P): Likewise. + (DECL_PRIMARY_TEMPLATE): Likewise. + (PRIMARY_TEMPLATE_P): Use it. + (push_template_decl_real): New function. + (redeclare_class_template): Take new template parameters as + input. + (is_specialization_of): New function. + (comp_template_args): Declare. + * decl.c (pushtag): Handle friend template classes. + (xref_tag): Likewise. Use new calling convention for + redeclare_class_template. + * decl2.c (grok_x_components): Handle friend templates. + * friend.c (is_friend): Use is_specialization_of where + appropriate. Deal with friend class templates. + (make_friend_class): Let a class template be friends with itself. + * pt.c (comp_template_args): Remove declaration. + (tsubst_friend_class): New function. + (push_template_decl_real): New function. + (push_template_decl): Use it. + (redeclare_class_template): Adjust for new calling convention. + (comp_template_args): Give it external linkage. + (instantiate_class_type): Use tsubst_friend_class to deal + with friend templates. + * typeck.c (comptypes): Use comp_template_args, rather than + expanding it inline. + * parse.y (component_decl): Handle a nested template type + like other component type declarations. + + * pt.c (check_explicit_specialization): Handle overloaded + constructors correctly. + + * pt.c (mabybe_get_template_decl_from_type_decl): New function. + (lookup_template_class): Use it. + +Thu Apr 23 21:19:06 1998 Jason Merrill + + * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops. + * cp-tree.h: Add WRAPPER support. + * call.c (add_candidate): Split out from add_*_candidate fns. + (build_over_call): Take the candidate instead of function and args. + Enforce access control here. Emit overload warnings here. + (add_warning): New fn. + (joust): Add WARN parm. If not set, call add_warning instead of + printing a warning. Re-enable some warnings. + (tourney): Pass it. + (convert_like): Adjust. + (build_new_op): Adjust. + (build_new_function_call): Adjust. + (build_user_type_conversion_1): Adjust. + (USER_CONV_FN): Adjust. + * tree.c (build_expr_wrapper, build_expr_ptr_wrapper, + build_int_wrapper): New fns. + +Thu Apr 23 18:27:53 1998 Mark P. Mitchell + + * pt.c (unify): Fix typo in previous change. + +Thu Apr 23 09:32:58 1998 Jason Merrill + + * error.c (dump_type_real): Declare canonical_name. + + * typeck.c (comp_target_types): Fix PMFs. + +Wed Apr 22 13:24:48 1998 Mark Mitchell + + * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for + the DECL_RESULTs of a member TEMPLATE_DECL, not just the + TEMPLATE_DECL. + + * pt.c (tsubst): Decrease the template-level of + TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a + TEMPLATE_PARM_INDEX. + (template_decl_level): New function. + (unify): Make sure to record unifications for template + parameters, even when the parameters exactly match the arguments. + Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and + TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that + aren't from the level we're currently working on. + +Tue Apr 21 22:00:04 1998 Mark Mitchell + + * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory. + + * decl2.c (check_member_template): Set DECL_IGNORED for member + class templates, too. + + * decl2.c (grokfield): Remangle the name of a member TYPE_DECL. + +Tue Apr 21 18:59:11 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function. + +Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com) + + * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare. + * decl.c (intTI_type_node, unsigned_intTI_type_node): Define. + (init_decl_processing): Handle TI types. + * typeck.c (unsigned_type, signed_type): Handle TI types. + +Sat Apr 18 15:25:21 1998 Jim Wilson + + * g++spec.c (lang_specific_driver): New argument in_added_libraries. + New local added_libraries. Increment count when add library to + arglist. + +Fri Apr 17 21:25:00 1998 Mark Mitchell + + * cp-tree.h (type_as_string_real): New function. + * pt.c (mangle_class_name_for_template): Use it. + * error.c (dump_aggr_type): Change prototype. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_type_real): Convert from dump_type. If desired, the + "canonica" name of a typedef, i.e., the name of the underlying + type, can be printed. + (dump_type): Call dump_type_real. + +Fri Apr 17 14:30:45 1998 Jason Merrill + + * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks. + + * typeck.c (comp_target_types): Tweak pedantic case. + (comp_target_parms): Tweak pedantic case. Clean up somewhat. + Return -1 or 1 instead of 1 or 2. + (compparms): Remove STRICT handling. + (convert_for_assignment): Fix handling of pmfs. + +Fri Apr 17 14:04:16 1998 Mark Mitchell + + * typeck.c (comp_target_types): Handle references like pointers. + (comp_target_parms): Note that return code from comp_target_types + can be negative to indicate failure. + +Fri Apr 17 09:10:52 1998 Andreas Schwab + + * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG), + which requires a working target compiler to build. + +Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com) + + * tree.c (avoid_overlap): Add prototype. + + * spew.c (num_tokens): Add prototype. + (nth_noken, add_token, consume_token, debug_yychar): Likewise. + + * search.c (dfs_check_overlap): Add prototype. + (dfs_no_overlap_yet): Likewise. + + * pt.c (original_template): Add prototype. + (inline_needs_template_parms): Likewise. + (push_inline_template_parms_recursive): Likewise. + (retrieve_specialization, register_specialization): Likewise. + (print_candidates, reduce_template_parm_level): Likewise. + (build_template_decl, mark_template_parm): Likewise. + (tsubst_friend_function, get_bindings_real): Likewise. + + * method.c (start_squangling): Add prototype. + (end_squangling, check_ktype, issue_ktype): Likewise. + (build_overloaded_scope_ref, check_btype): Likewise. + (build_mangled_template_parm_index): Likewise. + + * lex.c (init_cpp_parse): Add prototype. + (handle_cp_pragma, handle_sysv_pragma): Likewise. + (reduce_cmp, token_cmp): Likewise. + + * except.c (call_eh_info): Add prototype. + (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise. + (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise. + + * decl2.c (is_namespace_ancestor): Add prototype. + (namespace_ancestor, add_using_namespace): Likewise. + (ambiguous_decl): Likewise. + + * decl.c (indent): Add prototype. + + * call.c (add_template_candidate_real): Add prototype. + +Fri Apr 17 01:57:12 1998 Jason Merrill + + * decl2.c (build_expr_from_tree): Just return a PMF. + +Fri Apr 17 00:45:12 1998 Mark Mitchell + + * typeck2.c (process_init_constructor): Don't strip cv-qualifiers + when doing initializations. + + * pt.c (unify): Use comptypes to compare type args. + +Fri Apr 17 00:24:22 1998 Jason Merrill + + * decl.c (duplicate_decls): Fix check for when it's safe to free + the new decl. + + * pt.c (mangle_class_name_for_template): Don't pass a typedef type + to type_as_string. + +Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com) + + * pt.c (build_template_parm_index): Add prototype. + + * search.c (my_tree_cons): Don't clear words outside the + newly allocated node. + +Wed Apr 15 15:34:44 1998 Dave Brolley + + * lex.c (init_parse): Now returns char* containing the filename. + +Wed Apr 15 13:20:06 1998 John Carr + Jeff Law + + * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer + than a pointer. + +Sun Apr 12 22:31:19 1998 Richard Kenner + + * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION. + +Fri Apr 10 12:16:49 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Don't warn for redundant decls if + friend: let add_friend take care of it. + +Thu Apr 9 02:40:48 1998 Jason Merrill + + * sig.c (build_signature_pointer_constructor): Don't set + TREE_HAS_CONSTRUCTOR for a signature pointer. + * cvt.c (ocp_convert): Don't force a temporary for internal structs. + * init.c (resolve_offset_ref): Warn about implicit & on pmfs + here, too. + * typeck.c (build_unary_op): Only allow taking the address of a + real constructor. + * typeck2.c (digest_init): Simplify. + (store_init_value): Don't pedwarn about using { } for pmfs. + +Thu Apr 9 22:16:57 1998 Per Bothner + + * cp-tree.h (start_decl): Update prototype. + * decl.c (start_decl): Like the C version, new parameters + for the attributes. Call cplus_decl_attributes here, + (pushdecl): Like C version, do build_type_copy if TYPE_DECL, + (grokdeclarator): Pass NULL for new start_decl arguments. + * pt.c (tsubst_expr): Likewise. + * parse.y: Merge cplus_decl_attribute calls into start_decl calls. + * typeck.c (common_type): Check TYPE_MAIN_VARIANT. + * lex.c (build_lang_decl): Add lang_name_java. + * class.c (push_lang_context): Add lang_name_java. + * method.c (build_mangled_name): Check for is_java_type. + +Thu Apr 9 22:16:57 1998 Benjamin Kosnik + + * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT. + * call.c (build_scoped_method_call): Check for TREE_CODE for + VOID_TYPE instead of type == void_type_node. + (build_method_call): Likewise. + * decl.c (lookup_name_real): Likewise. + (grokdeclarator): Likewise. + (start_decl): Likewise. + (grokparms): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (start_method): Likewise. + +Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com) + + * lex.c (finput): New variable. + (init_cpp_parse): Renamed from init_parse. + (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished. + (finish_parse): New function. + * cp-tree.h (init_lex, init_parse): Remove declarations. + +Mon Apr 6 02:25:05 1998 Jason Merrill + + * call.c (build_call): Still evaluate the actual argument. + * class.c (is_empty_class): Update for -fnew-abi. + + * decl2.c: -fnew-abi implies -fsquangle. + + * method.c (do_build_assign_ref): Don't do anything to copy + an empty class. + (do_build_copy_constructor): Likewise. + * call.c (build_over_call): Likewise. + +Sat Apr 4 18:43:58 1998 Jason Merrill + + * tree.c (avoid_overlap): Return a value. + +Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com) + + * method.c (check_btype): Add missing argument to xrealloc. + (check_ktype): Likewise. + +Fri Apr 3 02:22:59 1998 Jason Merrill + + Implement empty base optimization. + * class.c (finish_struct_1): Add vbase fields earlier. Set + CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty. + * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns. + (types_overlap_p): New fn. + * tree.c (avoid_overlap): New fn. + (build_base_fields): Use it to avoid overlapping empty bases. + * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi. + + * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs. + + Re-implement allocation of base class subobjects. + * tree.c (unshare_base_binfos): New fn. + (layout_basetypes): Use it. Now handles offsets of both virtual and + non-virtual bases, after layout_type. + (layout_vbasetypes): Remove. + (build_base_fields): Generate FIELD_DECLs for each non-virtual base. + (build_vbase_pointer_fields): Split out from old layout_basetypes. + * class.c (finish_base_struct): Lose offset handling code. + Move nonvdtor warning here. Don't mess with t_binfo anymore. + (finish_struct_1): Don't mess with t_binfo anymore. Use fns above. + * cp-tree.h: Adjust. + +Thu Apr 2 14:25:13 1998 Jason Merrill + + * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff. + * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise. + * class.c (duplicate_tag_error): Likewise. + (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN. + * tree.c (layout_vbasetypes): Update from layout_record, remove + var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE. + (layout_basetypes): Likewise. + +Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com) + + * class.c, Make sure system.h is included just after config.h. + Delete lingering stdio and errno references too. + * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise. + +Wed Apr 1 15:38:36 1998 Jason Merrill + + * friend.c (is_friend): Fix access control for local classes. + + * class.c (is_empty_class): New fn. + * call.c (build_call): Don't pass empty class objects to a function. + +Wed Apr 1 14:58:35 1998 Mark Mitchell + + * call.c (build_over_call): Do name resolution for default + arguments of function templates in the scope of the templates. + +Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com) + + * call.c: Include system.h. Remove includes, declarations and + defines provided by system.h. + * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise. + * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise. + * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise. + * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise. + * typeck2.c, xref.c: Likewise. + * Makefile.in: Dependencies updated as appropriate. + * Make-lang.in: Likewise. + +Mon Mar 30 12:15:00 1998 Mark Mitchell + + * pt.c (fn_type_unification): Allow incomplete unification without + an immediate error message. + +Mon Mar 30 08:55:42 1998 Jason Merrill + + * tree.c (member_p): New fn. + * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for + initializing class members. + + * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'. + * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX. + + * call.c (build_method_call): Handle non-scoped destructors, too. + * pt.c (tsubst_copy): Likewise. + + * pt.c (print_template_context): Split out... + (push_tinst_level): ...from here. + + * friend.c (is_friend): Don't pass a type to decl_function_context. + + * typeck.c (convert_for_initialization): Always hand off + conversions to class type. + +Sun Mar 29 20:01:59 1998 Jason Merrill + + * friend.c (is_friend): Local classes have the same access as the + enclosing function. + +Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com) + + * typeck.c (expand_target_expr): Delete dead function. + + * search.c: Put various prototypes inside #ifdef MI_MATRIX. + + * repo.c (save_string): Delete dead function. + + * method.c (thunk_printable_name): Delete dead function. + + * lex.c (yynextch): Delete dead function. + + * expr.c (tree_extract_aggr_init): #if 0 out. + + * except.c (do_unwind): Delete dead function. + (easy_expand_asm): Likewise. + + * cvt.c (build_conversion_type_1): Delete dead function. + + * cp-tree.h (push_expression_obstack): Declare. + + * call.c (source_type): #if 0 out. + + * class.c (alter_access): Remove unused label. Add braces + around empty else clause. + + * lex.c (yyprint): Fix argument to printf. + +Sat Mar 28 17:43:52 1998 Mark Mitchell + + * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs. + + * pt.c (instantiate_class_template): Make sure template + arguments are permanent. + * init.c (resolve_offset_ref): Don't go looking around in + template types. + + * semantics.c: Add routines to handle expressions, and some + declaration processing. + * parse.y: Use them. + (current_class_depth): Move declaration to cp-tree.h. + * parse.c: Regenerated. + * cp-tree.h: Use them. + (current_class_depth): Declare. + * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr. + +Fri Mar 27 20:23:18 1998 Mark Mitchell + + * error.c (dump_decl): Be a bit more explicit with template + type arguments, when verbose. + +Fri Mar 27 18:16:40 1998 Jason Merrill + + * inc/exception: Reorder closing braces. + +Fri Mar 27 13:22:18 1998 Mark Mitchell + + * pt.c (redeclare_class_template): New function. + * cp_tree.h (redeclare_class_template): Declare it. + * decl.c (xref_tag): Use it. + +Thu Mar 26 11:16:30 1998 Jason Merrill + + * call.c (build_over_call): Check IS_AGGR_TYPE, not + TYPE_LANG_SPECIFIC. + * typeck.c (convert_arguments): Likewise. + + * decl.c (grokdeclarator): Remove const and volatile from type after + setting constp and volatilep. + + * class.c (finish_struct_1): Don't warn about bool bitfield larger + than one bit. + +Thu Mar 26 10:25:52 1998 Mark Mitchell + + * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate. + +Thu Mar 26 10:24:05 1998 Mark Mitchell + + * call.c (build_object_call): Complain about ambiguous operator(), + rather that crashing. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + +Thu Mar 26 10:23:24 1998 Mark Mitchell + + * cvt.c (perform_qualification_conversions): Use comp_target_types + instead of comp_ptr_ttypes. + +Wed Mar 25 16:10:50 1998 Mark Mitchell + + * cp-tree.h (enforce_access): Declare. + * call.c (enforce_access): Make it extern, not static. + * class.c (alter_access): Use enforce_access; modify code for ISO + compliance, rather than ARM rules. + +Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij + + * cp-tree.h: Fix typo. + +Wed Mar 25 02:01:02 1998 Jason Merrill + + * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing + if (aggregate_value_p (type)). + + * decl2.c (constructor_name_full): Handle TYPENAME_TYPE. + +Tue Mar 24 16:12:01 1998 Mark Mitchell + + * tree.c (mapcar): When dealing with a DECL, use it's constant + value, if any. + * pt.c (lookup_template_class): Don't mangle the names of template + classes whose arguments are unknown. + + * pt.c (tsubst_expr): Handle GOTO_STMT correctly. + +Tue Mar 24 12:21:55 1998 Benjamin Kosnik + + * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1. + +Tue Mar 24 12:21:48 1998 Jim Wilson + + * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for + boolean_type_node to 1. + +Tue Mar 24 10:23:47 1998 Mark Mitchell + + * error.c (dump_expr): Remove unused variable `l'. + + * pt.c (for_each_template_parm): New function, created by + converting uses_template_parms. + (tree_fn_t): New typedef. + (uses_template_parms): Use it. + (mark_template_parm): New function. + (push_template_decl): Check that the argument list of a partial + specialization uses all the template parameters. + + * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done + with it; we might want it for debugging. + * cp-tree.h (type_unification): Change interface. + * class.c (finish_struct_1): Skip nested template types, just like + ordinary nested types. + (instantiate_type): Use new interface to type_unification. + * lex.c (init_lex): Add __sz as opname for sizeof. + * method.c (build_overload_scope_ref): New function. + (build_overload_int): Handle complex expressions. Set + numeric_output_need_bar if necessary. + (build_overload_value): Handle non-PARM_DECL nodes; this + routine is now used by build_overload_int. Remove some + assignments to numeric_output_need_bar. Use + build_overload_scope_ref. + (build_qualified_name): Note that some template mangled names end + with digits, and set numeric_output_need_bar appropriately. Use + build_underscore_int. + * pt.c (unify): Change interface. + (type_unification_real): Likewise. + (determine_specialization): Use new interfaces. + (tsubst): Deal gracefully with situations in which the argument + vector is not fully filled. + (fn_type_unification): Use new interfaces. + (type_unification): Likewise. Remove NOP_EXPR hack. + (type_unification_real): Likewise. + (unify): Likewise. Deal with unification of complex expressions. + +Mon Mar 23 12:24:37 1998 Jason Merrill + + * pt.c (complete_template_args): Initialize skip properly. + + * decl.c (make_typename_type): Revert. + (make_implicit_typename): Remove. + (lookup_name_real): Don't call it. Call lookup_field if we see a + TYPE_DECL from a template base. + * search.c (lookup_field): Do implicit typename stuff. + +Sun Mar 22 00:50:42 1998 Nick Clifton + Geoff Noer + + * Makefile.in: Various fixes for building cygwin32 native toolchains. + * Make-lang.in: Likewise. + +Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij + + * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify. + +Fri Mar 20 10:42:07 1998 Jason Merrill + + * decl.c (make_implicit_typename): Rewrite removed code. + (make_typename_type): Call it if the type we look up comes from + a base that uses template parms. + + * pt.c (complete_template_args): Rewrite. + (tsubst, FUNCTION_DECL): Use it. + +Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org) + + * semantics.c (finish_asm_stmt): Fix combine strings. Call + c_expand_asm_operands () if output_operands, input_operands or + clobbers is not NULL_TREE. + +Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij + + * pt.c (complete_template_args): New function. + (get_bindings): Deal with specializations of function templates + with return type containing parameters from outer class + templates. + (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level, + substitute arguments and compose a new type. + +Thu Mar 19 19:01:48 1998 Mark Mitchell + + * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new + FUNCTION_DECLs. + +Thu Mar 19 11:51:58 1998 Jason Merrill + + * decl.c (make_implicit_typename): Lose useless code. + + * call.c (standard_conversion): Handle A* -> const A* properly. + + * pt.c (get_bindings_real): Rename from get_bindings. Add + check_rettype parm. + (get_bindings): Pass 1. + (get_bindings_overload): Pass 0. + +Wed Mar 19 09:08:12 1998 Mark Mitchell + + * pt.c (check_explicit_specialization): When reverting a static + member function, also remove the `this' parameter from + last_function_parms. + +Thu Mar 19 02:27:48 1998 Jason Merrill + + * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting + a function context. + + * decl.c (store_bindings): Use free_binding_vecs. + (pop_from_top_level): Likewise. + +Wed Mar 18 12:41:43 1998 Jason Merrill + + * decl.c (make_implicit_typename): Only change the type of a + TYPENAME_TYPE. + +Wed Mar 18 10:09:51 1998 Mark Mitchell + + * semantics.c: New file, containing routines to perform the + semantic phase of parsing. + * parse.y: Use it. + * pt.c (tsubst_expr): Likewise. + * cp-tree.h: Declare the various functions in semantics.c. + Provide macros to access _STMT tree nodes. + * cp-tree.def: Add ASM_STMT tree node. + * Makefile.in, Make-lang.in: Add dependencies on and for + semantics.c. + +Wed Mar 18 00:24:10 1998 Jason Merrill + + * pt.c (push_template_decl): Only check primary templates. + + * pt.c (check_explicit_specialization): Complain about default args + in explicit specialization. + + * parse.y (nomods_initdcl0): Also call cp_finish_decl for a + constructor_declarator. + +Tue Mar 17 14:44:54 1998 Mark Mitchell + + * typeck2.c (build_x_arrow): Don't crash when an aggregate type + has no overloaded operator ->. + + * call.c (build_field_call): Don't crash when presented with a + field that is actually a nested type. + + * decl.c (pushtag): Deal with friend class injection in local + classes. + + * call.c (build_object_call): Don't crash if OBJ is a + pointer-to-member-function. + +Tue Mar 17 11:40:26 1998 Jason Merrill + + * pt.c (push_template_decl): Complain about template with C linkage, + anonymous template class. + +Mon Mar 16 12:10:39 1998 Jason Merrill + + * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX. + * search.c: Likewise. + + * lex.c (do_pending_defargs): Only call + maybe_{begin,end}_member_template_processing for FUNCTION_DECLs. + + * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al. + +Mon Mar 16 10:47:22 1998 Mark Mitchell + + * parse.y: Deal with CONSTRUCTORS in new_initializers. + +Mon Mar 16 10:54:21 1998 Mark Mitchell + + * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more + closely mimics the behavior in parse.y. + (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing + into a compound statement. + +Sun Mar 15 02:07:26 1998 Jason Merrill + + * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro. + * pt.c (inline_needs_template_parms): New fn. + (original_template): New fn. + (push_inline_template_parms_recursive): New fn. + (maybe_begin_member_template_processing): Use them. + (maybe_end_member_template_processing): Likewise. + (is_member_or_friend_template): Rename to is_member_template. + Member functions of local classes are never member templates. + +Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij + + * lex.c (do_identifier): Handle TEMPLATE_DECL that was + added in the class scope to catch redefinition error. + + * pt.c (reduce_template_parm_level): Also copy + the DECL_TEMPLATE_PARMS field. + +Sun Mar 15 10:54:08 1998 Mark Mitchell + + * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a + reduced-level template type parameter. + +Sun Mar 15 12:26:02 1998 Manfred Hollstein + + * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider. + (DECL_NEEDS_FINAL_OVERRIDER_P): New macro. + * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P. + * decl.c (duplicate_decls): Propagate it. + * typeck2.c (abstract_virtuals_error): Use two loops to emit + abstract virtual functions and virtual functions which need a + final overrider separately. + +Thu Mar 12 09:39:40 1998 Manfred Hollstein + + * lang-specs.h: Properly put brackets around array elements in + initializer. + + * typeck.c (build_binary_op_nodefault): Correctly place parens around + && and || in expression. + +Thu Mar 12 09:26:04 1998 Manfred Hollstein + + * call.c (default_parm_conversions): Remove prototype definition. + (build_method_call): Remove unused variable result. + + * cvt.c (ocp_convert): Remove unused variable conversion. + + * decl2.c (ambiguous_decl): Add explicit parameter definition for name. + + * except.c (do_unwind): #if 0 definition of unused variables fcall + and next_pc. + + * expr.c (extract_scalar_init): #if 0 prototype and function + definition. + + * init.c (expand_aggr_init_1): Remove unused variable init_type. + (build_new_1): Remove unused variable t. + + * pt.c (instantiate_class_template): Remove unused variable newtag; + cast called function return value to void. + (do_decl_instantiation): Remove unused variables name and fn. + + * tree.c (get_type_decl): Add default return to shut up compiler from + complaining control reaches end of non-void function. + + * typeck.c (build_x_conditional_expr): Remove unused variable rval. + +Thu Mar 12 09:12:15 1998 Manfred Hollstein + + * call.c (default_parm_conversions): Remove prototype definition. + (build_method_call): Remove unused variable result. + (build_over_call): Add default case in enumeration switch. + +Thu Mar 12 08:39:13 1998 Manfred Hollstein + + * decl2.c (lang_decode_option): Change j's type to size_t. + + * tree.c (layout_vbasetypes): record_align and desired_align are of + type unsigned int; const_size and nonvirtual_const_size likewise. + +Wed Mar 11 07:25:20 1998 Mark Mitchell + + * parse.y (new_initializer): Make sure all initializers are + lists. + +Tue Mar 10 07:32:36 1998 Mark Mitchell + + * decl2.c (import_export_decl): Mark tinfo functions for + cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN. + +Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com) + + * method.c: Fix typo. + +Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi + + * method.c: Include "system.h" to get stdlib.h, stdio.h, + ctype.h, string.h, etc. + (issue_nrepeats): Add default case in enumeration switch. + (check_btype): Likewise. + (process_overload_item): Likewise. + + * Makefile.in (method.o): Depend on system.h. + +Wed Mar 4 22:26:53 1998 Andreas Schwab + + * lex.c (do_scoped_id): Fix parenthesizing. + +Wed Mar 4 12:11:53 1998 Michael Tiemann + + * rtti.c (get_tinfo_fn_dynamic): If this function is called an + FLAG_RTTI is unset, initialize type info machinery and continue + with FLAG_RTTI enabled. + (get_typeid): Likewise. + +Wed Mar 4 11:47:55 1998 Jason Merrill + + * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes + from B. + +Wed Mar 4 11:28:08 1998 Mark Mitchell + + * pt.c (finish_member_template_decl): Deal more gracefully with + invalid declarations. + +Tue Mar 3 01:38:17 1998 Jason Merrill + + * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c, + cp-tree.h: Clean up more old overloading code, old RTTI code, and + some formatting quirks. + + * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c, + method.c, pt.c, ptree.c, typeck.c: Remove support for + -fno-ansi-overloading and overloading METHOD_CALL_EXPR. + * class.h: Remove. + * Makefile.in: Adjust. + + * pt.c (unify): Don't allow reduced cv-quals when strict. + + * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from + *type_unification* and unify. + +Mon Mar 2 12:11:06 1998 Jason Merrill + + * parse.y (explicit_template_type): Remove TEMPLATE keyword. + (nested_name_specifier): And add it before this use. + (typename_sub0): And this use. Also add use without the keyword. + (typename_sub1): Likewise. + * pt.c (instantiate_class_template): Don't actually instantiate + anything if our type uses template parms. + +Mon Mar 2 11:04:59 1998 Jim Wilson + + * decl.c (start_function): Don't call temporary_allocation for a + nested function. + +Sun Mar 1 21:06:37 1998 Jason Merrill + + * pt.c (instantiate_class_template): Don't mess with friends if + our type uses template parms. + +Sat Feb 28 12:06:44 1998 Jason Merrill + + * parse.y (nested_name_specifier): Use explicit_template_type. + (typename_sub): Allow a template_type, an explicit_template_type, + or an implicit template type at the end. + * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL. + * decl.c (make_typename_type): Handle template-id where the name + is a TEMPLATE_DECL. + * call.c (build_scoped_method_call): Handle member template + destructor call. + * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member + destructor is represented by the type. + + * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro. + * parse.y (nested_name_specifier): Add 'template' case. + (explicit_template_type): New rule. + (typename_sub): Use it. + * decl.c (make_typename_type): Handle getting a template-id for NAME. + * pt.c (tsubst): Likewise. + +Fri Feb 27 11:17:50 1998 Jason Merrill + + * pt.c (add_to_template_args): Fix thinko. + (instantiate_class_template): Call it later. + + * pt.c (get_class_bindings): Add outer_args parm. + (most_specialized_class): Likewise. + (instantiate_class_template): Pass it. + (more_specialized_class): Likewise. + (lookup_template_class): Get context from template if none + was specified. + (finish_member_template_decl): Don't do anything with a + partial specialization. + * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of + AGGREGATE_TYPE_P. + * class.c (finish_struct): Member class templates have already been + checked for name clashes. + * decl.c (pushdecl_with_scope): Handle pushing at class level. + +Fri Feb 27 02:25:16 1998 Jason Merrill + + * pt.c (tsubst, TEMPLATE_DECL): Support member class templates. + (tsubst, *_PARM): Support multiple levels of template classes. + (instantiate_class_template): Look up the pattern from the + original template. + (lookup_template_class): Handle getting a template for d1. + (push_template_decl): Correct setting of 'primary'. + (reduce_template_parm_level): Add 'levels' parm. + (finish_member_template_decl): Support member class templates. + (template_class_depth): Handle multiple levels. + * parse.y (component_decl_1, fn.def2): Remove member template case. + (component_decl): Add member template cases. + * decl2.c (check_member_template): We now handle member template + classes. + * decl.c (pushtag): Handle member templates. + * method.c (do_inline_function_hair): Don't touch + IDENTIFIER_GLOBAL_VALUE. + * init.c (build_offset_ref): If name isn't an identifier, just + return it. + * spew.c (yylex): Handle PTYPENAME like TYPENAME. + + * typeck.c (get_delta_difference): Do adjust for conversions to + and from virtual base. + +Wed Feb 25 09:51:29 1998 Jason Merrill + + * typeck.c (get_delta_difference): Give hard error for conversion + from virtual base. + + * cp-tree.h: Tweak formatting. + +Wed Feb 25 00:35:33 1998 Jason Merrill + + * decl.c (push_namespace): Handle redeclaration error. + + * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro. + (IDENTIFIER_NAMESPACE_BINDINGS): New macro. + (NAMESPACE_BINDING): New macro. + (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING. + * *.c: Use them. + + * pt.c (push_template_decl): Use innermost_args. + + * decl.c (get_unique_name): Tweak from earlier in the name. + +Tue Feb 24 22:15:04 1998 Martin von Loewis + + * cp-tree.def: Add CPLUS_BINDING node. + * cp-tree.h (tree_binding): New struct. + (BINDING_SCOPE, BINDING_VALUE): New macros. + (current_namespace, global_namespace): Declare extern. + (struct lang_decl_flags): New field in_namespace. + (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros. + (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros. + (TREE_INDIRECT_USING): New macro. + * decl2.c (current_namespace, global_namespace): Declare. The + value is a NAMESPACE_DECL now, not a TREE_LIST. + (is_namespace_ancestor, namespace_ancestor): New static functions. + (add_using_namespace, ambiguous_decl): Likewise. + (lookup_using_namespace): New support function for lookup_name. + (qualified_lookup_using_namespace): New support function for + do_scoped_id and lookup_namespace_name. + (get_namespace_id): Mark as obsolete. + (current_namespace_id): Likewise. + (do_namespace_alias): Implement. + (do_using_directive): Implement as call to add_using_namespace. + * decl.c (binding_for_name): New function. + (push_namespace, pop_namespace): Implement. + (push_decl): Don't install a FUNCTION_DECL in the global branch. + (lookup_namespace_name): Implement using qualified lookup. + (lookup_name_real): For global scoping, lookup in + global_namespace. For namespace scoping, lookup in given + namespace. For unscoped lookup, iterate over namespace, + considering using directives. + (init_decl_processing): Initialize global_namespace. + (grokvardecl): Build assembler name as static name for globals. + (grokdeclarator): Remove old namespace mangling. + (xref_tag): When installing a global binding for the + tag, make sure we have an identifier. + * method.c (build_overload_nested_name): Mangle namespaces. + (build_qualified_name): Likewise. + (build_decl_overload_real): Likewise. + * lex.c (build_lang_decl): Set namespace for new declaration to + current_namespace. + (do_scoped_id): Find global names in global or current + namespace, or using qualified namespace lookup, depending on + context. + * init.c (build_member_call): When scope is namespace, use + build_x_function_call instead. + (build_offset_ref): When scope is namespace, collapse processing + to lookup_namespace_name instead. + * error.c (dump_decl): Support NAMESPACE_DECL. + * decl.c (pushdecl): Bind globals to current namespace. + (push_overloaded_decl): Likewise. + (lookup_tag): Likewise. + (lookup_name_current_level): Likewise. + (xref_tag): Likewise. + (start_function): Likewise. + * lex.c (do_identifier): Likewise. + (identifier_typedecl_value): Likewise. + (real_yylex): Likewise. + * method.c (do_inline_function_hair): Likewise. + * parse.y (unscoped): Likewise. + * pt.c (check_explicit_specialization): Likewise. + (lookup_template_class): Likewise. + * rtti.c (call_void_fn): Likewise. + * sig.c (build_sigtable): Likewise. + * ptree.c (lang_print_xnode): New function. + +Tue Feb 24 01:40:24 1998 Jason Merrill + + * pt.c (instantiate_class_template): Don't instantiate if pedantic + and the args use template parms. + + * pt.c (push_tinst_level): If the instantiation uses template parms, + fail silently. + * decl.c (xref_basetypes): Do call complete_type for basetypes + that involve template parameters. + +Tue Feb 24 00:36:43 1998 Jason Merrill + + * typeck2.c (process_init_constructor): Fix labeled init check. + +Mon Feb 23 05:08:55 1998 Jason Merrill + + * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS + argument to tsubst and friends. + + * pt.c (tsubst, FUNCTION_DECL): Tidy. + + * typeck.c (build_x_function_call): Handle static member function + templates like non-templates. Handle friend templates like normal + function templates. + * pt.c (tsubst, *_PARM): Don't use orig_level. + (get_bindings): Don't call add_to_template_args. + (instantiate_template): Likewise. + (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate. + * ptree.c (print_lang_type): Print index/level for template parms. + +Mon Feb 23 02:52:29 1998 Mark Mitchell + + * Make-lang.in (cc1plus): Note that cc1plus depends on + cp/cp-tree.h and cp/cp-tree.def. + + * cp-tree.def (TEMPLATE_CONST_PARM): Remove. + (TEMPLATE_PARM_INDEX): New tree code, used to indicate a + position in a template parameter list. + * cp-tree.h (template_parm_index): New structure, used as the tree + structure for a TEMPLATE_PARM_INDEX. + (TEMPLATE_PARM_IDX): New macro. + (TEMPLATE_PARM_LEVEL): Likewise. + (TEMPLATE_PARM_DESCENDANTS): Likewise. + (TEMPLATE_PARM_ORIG_LEVEL): Likewise. + (TEMPLATE_PARM_DECL): Likewise. + (TEMPLATE_TYPE_PARM_INDEX): Likewise. + (TEMPLATE_TYPE_ORIG_LEVEL): Likewise. + (TEMPLATE_TYPE_DECL): Likewise. + (TEMPLATE_CONST_IDX): Remove. + (TEMPLATE_CONST_LEVEL): Likewise. + (TEMPLATE_CONST_SET_INFO): Likewise. + (TEMPLATE_TYPE_SET_INFO): Likewise. + (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX + node. + (TEMPLATE_TYPE_LEVEL): Likewise. + * decl.c (decls_match): Call comp_template_parms, rather than + expanding it inline. + (duplicate_decls): If two template declarations are being merged, + then their TEMPLATE_INFOs should be merged as well. + (grokfndecl): Save template-id information when declaring a friend + with explicit template arguments. Pass arguments to + check_explicit_specialization via correct convention; at some + point check_explicit_specialization changed, but these call-sites + did not. + (grokdeclarator): Tidy up slightly. + * decl2.c (check_classfn): Tidy up slightly. Don't assume that + two template functions with the same DECL_ASSEMBLER_NAME the same, + since the names are not yet mangled. + * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the + decl for a non-type parameter, rather than printing `'. + * friend.c (is_friend): Handle TEMPLATE_DECL friends. + (do_friend): Deal with template friends. + * lex.c (do_pending_inlines): Call + maybe_begin_member_template_processing, rather than + conditionally calling begin_member_template_processing. + (process_next_inline): Likewise. Call + maybe_end_member_template_processing, rather than + conditionally calling end_member_template_processing. + (do_pending_defargs): Likewise. + (do_identifier): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + * method.c (build_mangled_template_parm_index): New function. + (build_overload_value): Use it. + (build_overload_name): Likewise. + * pt.c (finish_member_template_decl): Allow friend declarations. + (template_class_depth): New function. + (is_member_template): Rename, and modify, to become... + (is_member_or_friend_template): New function. + (end_member_template_processing): Rename, and modify, to become... + (maybe_end_member_template_processing). + (build_template_parm_index): New function. + (reduce_template_parm_level): New function. + (process_template_parm): Modify to use build_template_parm_index. + (push_template_decl): Deal with friend templates. + (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + (tsubst_friend_function): New function. + (instantiate_class_template): Generate the DECL_FRIENDLIST + for a new instantiation by using tsubst_friend_function rather + than just tsubst. + (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL. + Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the + appropriate new macros. Use reduce_template_parm_level to + generate lower-level template parameters. Handle tsubst'ing into + TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget + to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created + templates. Similarly for the template parameters for a new + template. + (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead + of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them. + (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM. + (get_bindings): Call add_to_template_args if necessary. + (instantiate_decl): Handle instantiations of friend templates. + * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a + TEMPLATE_TYPE_PARM as a list of fields; it's not! + * spew.c (yylex): Do a little manual constant propagation to + clarify the code. + +Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com) + + * error.c: Include sys/types.h. + +Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com) + + * method.c (build_mangled_name): Start CPP directives in column zero. + +Thu Feb 19 10:36:48 1998 Jason Merrill + + * typeck2.c (process_init_constructor): Sorry about non-trivial + labeled initializers. + * parse.y (initlist): Re-enable labeled initializers. + +Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij + + * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm, + all callers changed. Rely on the new parameter instead of arg + being a TREE_LIST when determine whether we are working inside + template template parameter. Clean up is_type test. + +Thu Feb 19 10:04:12 1998 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT. + * typeck2.c (initializer_constant_valid_p): Allow conversions + between pointers and references. + +1998-02-19 Brendan Kehoe + + * typeck.c (build_unary_op): Only warn about incr/decr a pointer + if pedantic || warn_pointer_arith. + +Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij + + * pt.c (unify): Handle TEMPLATE_DECL. + +1998-02-18 Brendan Kehoe + + * cp-tree.h (strip_attrs): Remove decl. + +1998-02-18 Doug Evans + + * decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + (strip_attrs): Remove function. + * typeck.c (common_type): Call merge_machine_type_attributes. + +Tue Feb 17 14:07:52 1998 Mark Mitchell + + * parse.y (initdcl0_innards): New grammar symbol. + (nomods_initdecls, nomods_initdcl0): Change type from itype to + none, since the resulting value is never used. + (parse_decl): New function. + (datadef): Remove redundant actions. + (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards. + * parse.c: Regenerated. + +Tue Feb 17 11:54:16 1998 Jason Merrill + + * parse.y (simple_stmt): Use getdecls() to check for decl. + +Sat Feb 14 11:50:51 1998 Manfred Hollstein + + * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New + macros. + (c++.install-common): Install c++filt properly as native or as cross + variant. + (c++.uninstall): Add c++filt. + +Fri Feb 13 14:55:37 1998 Jason Merrill + + * call.c (standard_conversion): Fix multi-level ptr conversions. + +Fri Feb 13 14:06:22 1998 Mike Stump + + * init.c (build_new): Propagate error_mark_node up. + +Fri Feb 13 13:24:32 1998 Jason Merrill + + * parse.y (simple_stmt): If the condition isn't a declaration, + start the controlled block after the test. + +Fri Feb 13 02:26:10 1998 Andreas Schwab + + * call.c (build_over_call): Convert builtin abs, labs and fabs to + tree-codes. + * decl.c (init_decl_processing): Re-enable abs, labs and fabs as + builtins. + +Fri Feb 13 01:36:42 1998 Jason Merrill + + * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV. + +Fri Feb 13 00:21:59 1998 Jason Merrill + + * cp-tree.h: Add access_protected_virtual_node. + * class.c (init_class_processing): Initialize it. + * decl.c (xref_basetypes): Use it. + * parse.y (base_class_access_list): Likewise. + + * Make-lang.in (DEMANGLER_PROG): Add $(exeext). + (c++.install-common): Install c++filt. + +Thu Feb 12 12:46:51 1998 Benjamin Kosnik + + * decl.c (shadow_tag): Give error for typedef-ing built-in types. + +Wed Feb 11 23:28:05 1998 Mark Mitchell + + * call.c (reference_binding): Use comptypes when comparing + TYPE_MAIN_VARIANTS to handle non-canonical array/index types. + +Wed Feb 11 16:42:04 1998 Mark Mitchell + + * tree.c (is_overloaded_fn): Use really_overloaded_fn. + (really_overloaded_fn): Move check here from is_overloaded_fn. + (get_first_fn): Use really_overloaded_fn and is_overloaded_fn. + +Wed Feb 11 15:54:18 1998 Mark Mitchell + + * typeck.c (build_ptrmemfunc): Type-check pointer-to-member + conversions. + +Mon Feb 9 22:23:31 1998 Mark Mitchell + + * cp-tree.h (push_template_decl): Return the decl passed in, or an + equivalent duplicate. + * decl.c (pushtag): Use the return value from push_template_decl. + (duplicate_decls): When duplicating a template declaration, merge + the DECL_TEMPLATE_RESULTs as well. + (make_implicit_typename): Don't try to dive into typename types to + find a context for making a new implicit typename. + (start_decl): Use the return value from push_template_decl. + (grokdeclarator): Complain about declarations list `const operator + int'. Since we don't correctly handle in-class initializations of + non-static data members, complain about this (now illegal) + practice. Issue an error for initializations of non-const statics + since that is illegal as well, and since we don't handle that case + correctly either. + (start_function): Use the return value from push_template_decl. + (start_method): Likewise. + * decl2.c (grokfield): Likewise. Since the change to + grokdeclarator ensures that all initialized fields are in fact + static, remove a redundant test for TREE_PUBLIC. + * parse.y (initlist): Disable labeled initializers since they do + not work as per the documentation, and since they do not use the + same syntax as the C front end. + * pt.c (push_template_decl): Return the decl passed in, or an + equivalent duplicate. + (lookup_template_class): When searching in a nested context, + use the right arguments. + (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL. + * typeck.c (build_component_ref): Assign the correct type to the + result of build_vfn_ref. + +Tue Feb 10 23:56:46 1998 Jason Merrill + + * pt.c (convert_nontype_argument): Fix typo. + (check_explicit_specialization): Allow old-style specialization + of class template members. + +Tue Feb 10 20:36:52 1998 Jason Merrill + Manfred Hollstein + + * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead + when deciding to override DECL_ASSEMBLER_NAME. + +Tue Feb 10 15:30:55 1998 Andrew MacLeod + + * decl2.c (lang_f_options): Add -fsquangle to option processing list. + * cp-tree.h (flag_do_squangling): Add declaration. + * lang-options.h: Add -fsquangle and -fno-squangle. + * method.c: Add macros and static variables for squangling. + (build_overload_name): Rename to build_mangled_name, add logic for B + compression, and split into process_modifiers and + process_overload_item. + (process_modifiers): New function, to handle constant, reference, + and pointer types. + (process_overload_item): New function, handles issue of type codes. + (build_overload_name): New function, start squangling and call + build_mangled_name. + (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline. + (start_squangling): New function to initialize squangling structs. + (end_squangling): New function to destroy squangling structs. + (nrepeats): Rename variable to Nrepeats. + (issue_nrepeats): New function for issuing 'n' type repeats. + (check_ktype): New function to check for type K name compression. + (build_overload_nested_name): Add a check for K name compression. + (build_qualified_name): Add a check for K name compression and don't + use DECL_ASSEMBLER_NAME when squangling is on. + (check_btype): New function, checks for B type compression. + (build_static_name, build_decl_overload_real): Initiate squangling. + (build_typename_overload, build_overload_with_type): Initiate + squangling + +Sun Feb 8 23:47:38 1998 scott snyder + + * method.c (make_thunk): Avoid name buffer overflow. + +Sat Feb 7 16:48:54 1998 Jason Merrill + + * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we + don't define them yet. + + * parse.y (nomods_initdcl0): Add constructor_declarator case. + +Fri Feb 6 21:32:25 1998 Richard Kenner + + * config-lang.in (diff_excludes): Use basename only. + +Thu Feb 5 19:10:40 1998 Jason Merrill + + * tinfo2.cc: Add tinfo for signed char. + +Thu Feb 5 14:38:23 1998 Mike Stump + + * search.c (compute_access): Handle protected constructors in derived + classes as accessible. + +Wed Feb 4 01:26:49 1998 Jason Merrill + + * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code): + Call convert_from_reference sooner. + +Tue Feb 3 23:50:52 1998 Mark Mitchell + + * cvt.c (ocp_convert): Obtain the constant values from constant + decls even if the destination type is the same as the type of the + decl. + + * decl2.c (finish_file): Make sure that static inlines with + definitions are not marked DECL_EXTERNAL before returning. + +Tue Feb 3 22:43:42 1998 Jason Merrill + + * decl.c: Lose arg_looking_for_template. + (lookup_name_real): Likewise. + * parse.y: Lose processing_template_arg, template_arg1. + (primary): Likewise. + * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too. + +Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij + + * error.c (dump_decl): Fix type of default arguments for template + template parameters and nontype template parameters. + * parse.y (template_parm): Handle invalid default template + template arguments here. + + * parse.y (template_parm): Use template_arg instead of PTYPENAME + for default template template argument. + * pt.c (coerce_template_parms): Merge default template argument + codes. Can treat RECORD_TYPE as template name if it is implicitly + created. Fix argument index in error message. + * typeck.c (comptypes): Merge template argument comparison codes in + TEMPLATE_TEMPLATE_PARM and RECORD_TYPE. + +Tue Jan 6 01:42:44 1998 Mumit Khan + + * lex.c (file_name_nondirectory): Also check for '/'. + +Mon Feb 2 11:24:22 1998 Mark Mitchell + + * parse.y (primary): Deal with statement-expressions in + templates. + * pt.c (tsubst_copy): Handle BIND_EXPR. + * tree.c (mapcar): Likewise. + + * call.c (add_template_candidate_real): Pass extra parameter to + fn_type_unification. + * cp-tree.h (fn_type_unification): Add parameter. + * pt.c (fn_type_unification): Add additional parameter to deal with + static member functions. + (get_bindings): Deal with static member functions. + + * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro. + (revert_static_member_fn): Declare. + * decl.c (revert_static_member_fn): Remove declaration. Change + linkage from internal to external. + (cp_finish_decl): Deal with virtual functions in classes local to + template functions. + * decl2.c (finish_file): Don't forget to emit increment/decrement + expressions in initializers for file-scope variables. + * parse.y (typename_sub2): If the typename doesn't names a + template, rather than a type, issue an error message. + * pt.c (check_explicit_specialization): Handle specializations of + static member functions. + (coerce_template_parms): Handle offset references to lists of + member functions. + * search.c (note_debug_info_needed): Don't crash when handed a + type which is being defined. + * typeck.c (complete_type): Don't crash when handed NULL_TREE; + that can happen with some illegal code. + +Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi + + * call.c (user_harshness): Initialize `code' to 0. + (build_method_call): Initialize `candidates', `cp' and `len' to 0. + (null_ptr_cst_p): Add parentheses around && within ||. + (standard_conversion): Likewise. + (z_candidate): Likewise. + (build_user_type_conversion_1): Initialize `args' to NULL_TREE. + (build_object_call): Likewise for `mem_args'. + (build_new_op): Likewise for `mem_arglist'. Add `return' from + default case in enumeration switch. + + * class.c (build_vtable_entry): Add explicit braces to avoid + ambiguous `else'. + (build_class_init_list): Likewise. + (finish_struct_1): Initialize `width' to 0. + (instantiate_type): Initialize `name' to NULL_TREE. Add + explicit braces to avoid ambiguous `else'. + + * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous + `else'. + + * decl.c (grok_reference_init): Eliminate unused parameter, all + callers changed. + (record_builtin_type): Initialize `tdecl' to NULL_TREE. + (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE. + (cp_finish_decl): Initialize `ttype' to NULL_TREE. + (grokdeclarator): Add parentheses around && within ||. Add + explicit braces to avoid ambiguous `else'. + (grokparms): Initialize `type' to NULL_TREE. + (xref_tag): Remove unused label `just_return'. + (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE. + (finish_function): Initialize `cond' and `thenclause' to NULL_TREE. + (hack_incomplete_structures): Add parentheses around assignment + used as truth value. + + * decl2.c (coerce_delete_type): Hide definition of `e3'. + + * error.c: Include . + (dump_expr): Change the type of `i' to size_t. Remove unused + label `error'. + + * except.c (init_exception_processing): Remove unused variable `d'. + (expand_throw): Likewise for `label'. + + * friend.c (add_friends): Add explicit braces to avoid ambiguous + `else'. + + * init.c (sort_member_init): Initialize `last_field' to NULL_TREE. + (sort_base_init): Likewise for `binfo'. + (expand_member_init): Likewise for `rval'. + (build_member_call): Add parentheses around assignment used as + truth value. + (build_offset_ref): Add explicit braces to avoid ambiguous `else'. + (build_new): Initialize `nelts' to NULL_TREE. Initialize + `old_immediate_size_expand' to 0. + (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE. + (build_vec_delete_1): Remove unused variable `block'. + (expand_vec_init): Initialize `itype' to NULL_TREE. + + * lex.c: Include if we don't have . Protect + declaration of `index' and `rindex' with autoconf macros. + (reinit_parse_for_expr): Remove unused variables + `look_for_semicolon' and `look_for_lbrac'. + (cons_up_default_function): Initialize `args' to NULL_TREE. + (readescape): Initialize `firstdig' to 0. + (real_yylex): Add parentheses around assignment used as truth value. + + * method.c: Include if we don't have . + Protect declaration of `index' with autoconf macro. + + * parse.y (primary): Add explicit braces to avoid ambiguous `else'. + Initialize `type' to NULL_TREE. + (structsp): Remove unused variable `id'. + + * pt.c (coerce_template_parms): Add explicit braces to avoid + ambiguous `else'. + (lookup_template_class): Initialize `template' to NULL_TREE. + (instantiate_class_template): Remove unused variable `name' and `e'. + (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE. + (do_poplevel): Initialize `saved_warn_unused' to 0. + (type_unification): Remove unused varable `parm'. + (unify): Likewise for `j'. + + * repo.c (init_repo): Add parentheses around assignment used as + truth value. + (finish_repo): Remove unused varable `p'. + + * search.c (get_binfo): Initialize `type' to NULL_TREE. + (get_base_distance): Likewise. + (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path' + and `new_v' to NULL_TREE. + (lookup_fnfields): Likewise for `rval_binfo_h'. + (breadth_first_search): Add parentheses around assignment used as + truth value. + (get_template_base): Initialize `type' to NULL_TREE. + + * sig.c (append_signature_fields): Initialize `last_mfptr' to + NULL_TREE. + (build_signature_table_constructor): Likewise for + `last_rhs_field', `pfn' and `vt_off'. + (build_sigtable): Likewise for `init'. + + * tree.c (break_out_calls): Initialize `t2' to NULL_TREE. + (propagate_binfo_offsets): Likewise for `delta'. + (hash_tree_cons): Initialize hashcode to 0. + (can_free): Likewise for `size'. + (cp_tree_equal): Add explicit braces to avoid ambiguous `else'. + + * typeck.c (convert_sequence): Hide prototype. + (common_type): Add explicit braces to avoid ambiguous `else'. + (comp_target_types): Likewise. + (build_x_function_call): Initialize `ctypeptr' to NULL_TREE. + (build_function_call_real): Add explicit braces to avoid ambiguous + `else'. + (convert_arguments): Initialize `called_thing' to 0. + (convert_for_initialization): Initialize `savew' and `savee' to 0. + + * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0. + (digest_init): Initialize `old_tail_contents' to NULL_TREE. + (build_x_arrow): Likewise for `last_rval'. + + * xref.c (GNU_xref_decl): Initialize `cls' to 0. + +Sun Feb 1 12:45:34 1998 J"orn Rennecke + + * decl.c (init_decl_processing): Use set_sizetype. + * decl2.c (sizetype): Don't declare. + * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype. + (c_sizeof_nowarn, build_binary_op_nodefault): Likewise. + (build_component_addr, unary_complex_lvalue): Likewise. + * rtti.c (expand_class_desc): Likewise. + * class.c (get_vfield_offset): Likewise. + +Thu Jan 29 10:39:30 1998 Mark Mitchell + + * pt.c (convert_nontype_argument): Move check for is_overloaded_fn + early to avoid bogus error. Handle overloaded function + names provided as template arguments correctly. + (coerce_template_parms): Don't mishandle overloaded functions when + dealing with template template parameters. + (lookup_template_class): Issue an error message, rather than + crashing, when the TYPE_DECL provided is not a template type. + +Wed Jan 28 23:14:44 1998 Jason Merrill + + * class.c (instantiate_type): Don't just return a known type if + it's wrong. + +Wed Jan 28 11:04:07 1998 Mark Mitchell + + * class.c (instantiate_type): Remove handling of FUNCTION_DECL + since that code could never be reached. + + * error.c (dump_decl): Avoid aborting in the midst of printing an + error message about an illegal template declaration. + + * parse.y (structsp): Print an error message, rather than crashing, + when a class-head does not name a class. + + * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE + template arguments as a g++ extension. + + * cp-tree.def (ALIGNOF_EXPR): New tree code. + * decl2.c (grok_alignof): If processing_template_decl, just store + the expression. + * typeck.c (c_alignof): Likewise. + * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR. + * error.c (dump_expr): Likewise. + * pt.c (tsubst_copy): Likewise. + * tree.c (cp_tree_equal): Likewise. + * pt.c (uses_template_parms): Correctly determine whether or not a + SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant + folding can be done. + + * cp-tree.h (grok_enum_decls): Remove type parameter. + * decl.c (grok_enum_decls): Likewise. + * decl2.c (grok_x_components): Call grok_enum_decls + unconditionally, since it will do nothing if there is no + current_local_enum. Use the new calling sequence. + * pt.c (tsubst_enum): Use the new calling sequence for + grok_enum_decls. + + * decl.c (start_function): Make member functions of local classes + in extern inline functions have comdat linkage here... + (grokdeclarator): Rather than here. + +Wed Jan 28 10:55:47 1998 Jason Merrill + + * pt.c (convert_nontype_argument): Use decl_constant_value. + +Tue Jan 27 16:42:21 1998 Mark Mitchell + + * call.c (add_template_candidate_real): New function. + (add_template_candidate): Use it. + (add_template_conv_candidate): Likewise. + (joust): Pass extra argument to more_specialized. + * class.c (instantiate_type): Handle a single FUNCTION_DECL. + (is_local_class): Remove. + (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG. + * cp-tree.h (is_local_class): Remove. + (perform_array_to_pointer_conversion): Likewise. + (finish_member_template_decl): Add. + (check_explicit_specialization): Return a tree, not an int. + (more_specialized): Take additional argument. + (get_bindings): Likewise. + (TI_PENDING_SPECIALIZATION_FLAG): New macro. + * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. + (perform_array_to_pointer_conversion): Remove. + * decl.c (saved_scope): Add processing_specialization, + processing_explicit_instantiation fields. + (maybe_push_to_top_level): Save them. + (pop_from_top_level): Restore them. + (grokfndecl): Use new return value from + check_explicit_specialization. + (start_decl): Don't check flag_guiding_decls before pushing + decls. + (cp_finish_decl): Remove previous (bogus) change. + (grok_declarator): Use decl_function_context rather than + is_local_class. + * decl2.c (finish_file): Pass extra argument to get_bindings. + (build_expr_from_tree): Let build_x_component_ref check + validity of arguments rather than doing it here. + * lex.c (cons_up_default_function): Remove code fooling with + processing_specialization, processing_explicit_instantiation + flags, as that is now done in {maybe_push_top,pop_from}_top_level. + * method.c (build_overload_identifier): Mangle local classes in + template functions correctly. + * parse.y (finish_member_template_decl): Move to pt.c. + * pt.c (finish_member_template_decl): Moved here from parse.y. + (print_candidates): New function. + (determine_specialization): Change interface. Properly look for + most specialized versions of template candidates. + (check_explicit_specialization): Fully process explicit + instantiations. + (push_template_decl): Avoid looking at CLASSTYPE fields in + FUNCTION_DECLS. + (determine_overloaded_function): Remove. + (convert_nontype_argument): Change name from + convert_nontype_parameter. Use determine_overloaded_function + instead of instantiate_type. + (mangle_class_name_for_template): Handle type contexts as well as + function contexts. + (classtype_mangled_name): Likewise. + (lookup_template_class): Likewise. + (tsubst): Likewise. + (more_specialized): Take explicit template arguments as a + parameter. + (most_specialized): Likewise. + (get_bindings): Likewise. Check that return types match before + proclaiming a function a match. + (do_decl_instantiation): Remove code searching for function to + instantiate; that is now done in check_explicit_specialization. + (add_maybe_template): Pass extra argument to get_bindings. + * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify + implementation. + * typeck.c (build_component_ref): Check for invalid arguments. + +Tue Jan 27 01:44:02 1998 Jason Merrill + + * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that + return_target and call_target are equivalent. + + * pt.c (type_unification_real): Just accept function parms that + don't use any template parms. + +Sun Jan 25 03:30:00 1998 Jason Merrill + + * decl.c (cp_finish_decl): When bailing on a comdat variable, also + unset DECL_NOT_REALLY_EXTERN. + + * parse.y (typename_sub*): Fix std::. + +Sat Jan 24 12:13:54 1998 Jason Merrill + + * error.c (dump_decl): Fix type default template args. + (dump_type): Hand TEMPLATE_DECL off to dump_decl. + +Fri Jan 23 18:34:37 1998 Mumit Khan + + * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined. + (file_name_nondirectory): Use. + +Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij + + * pt.c (coerce_template_parms): Don't access elements of ARGLIST + that are not really present. Substitute default arguments in + template template arguments. Correctly convert TEMPLATE_DECL to + TEMPLATE_TEMPLATE_PARM. + (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM + are no longer treated specially here. + * parse.y (template_template_parm): Fix copy error. + * decl.c (grokdeclarator): Warn about missing `typename' for nested + type created from template template parameters. + * parse.y (bad_parm): Likewise + + * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM. + (push_nested_class): Likewise. + * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code. + * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro. + (copy_template_template_parm): Declare. + * decl.c (arg_looking_for_template): New variable. + (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM. + Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM + node if arg_looking_for_template is nonzero. + (pushdecl): Handle TEMPLATE_TEMPLATE_PARM. + (grok_op_properties, xref_tag, xref_basetypes): Likewise. + (grokdeclarator): Handle TEMPLATE_DECL. + * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM. + * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM. + (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM. + (dump_decl): Handle unnamed template type parameters. + Handle template template parameters. + (dump_function_name): Handle template template parameters. + * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef): + Handle TEMPLATE_TEMPLATE_PARM. + * method.c (build_template_template_parm_names): New function. + (build_template_parm_names): Handle TEMPLATE_DECL. + (build_overload_nested_name, build_overload_name): + Handle TEMPLATE_TEMPLATE_PARM. + * parse.y (maybe_identifier): New nonterminal. + (template_type_parm): Use it. + (template_template_parm, template_arg1): New nonterminal. + (template_parm): Add template_template_parm rules. + (template_arg): Set processing_template_arg. + (template_arg1): Rules moved from template_arg. + (primary, nonnested_type): Set arg_looking_for_template if we are + processing template arguments. + * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL. + (process_template_parm): Handle template template parameters. + (coerce_template_parms, comp_template_args): Likewise. + (mangle_class_name_for_template, lookup_template_class): Likewise. + (uses_template_parms): Handle TEMPLATE_DECL and + TEMPLATE_TEMPLATE_PARM. + (current_template_args): Handle TEMPLATE_DECL. + (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM. + * search.c (dfs_walk, dfs_record_inheritance): + Handle TEMPLATE_TEMPLATE_PARM. + * tree.c (copy_template_template_parm): New function. + (mapcar): Handle TEMPLATE_TEMPLATE_PARM. + * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM. + +Mon Jan 19 22:40:03 1998 Mark Mitchell + + * decl.c (start_decl): Don't allow duplicate definitions of static + data members. + + * call.c (build_user_type_conversion_1): Handle user-defined + template conversion operators correctly. + + * decl2.c (build_expr_from_tree): Issue an error message if the + object in a COMPONENT_REF is a TEMPLATE_DECL. + + * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs. + + * class.c (is_local_class): New function. + * cp-tree.h (is_local_class): Declare it. + (last_tree): Likewise. + (begin_tree): Likewise. + (end_tree): Likewise. + (lookup_template_class): Change prototype. + * decl.c (cp_finish_decl): Check for NULL where necessary. + Consider FUNCTION_DECLS to declare objects with top-level binding, + when calling make_decl_rtl. + (grokdeclarator): Give members of local classes internal linkage. + (start_function): Remove declaration of last_tree. + (finish_function): Set flag_keep_inline_functions around call to + rest_of_compilation if we are processing a member function in a + local class. + (start_method): Call push_template_decl for member functions of + local classes in template functions. + * decl2.c (import_export_decl): Don't give external linkage to + instantiations of templates with internal linkage. + * parse.y (last_tree): Remove declaration. + (template_type): Pass extra parameter to lookup_template_class. + (self_template_type): Likewise. + (structsp): Move call to reset_specialization into left_curly. + (left_curly): Call reset_specialization, and begin_tree. + * pt.c (saved_trees): New variable. + (mangle_class_name_for_template): Change prototype. Use + additional function context to name local classes in templates + correctly. + (classtype_mangled_name): Pass the context. + (push_template_decl): Handle local classes and templates, and + member functions for such classes. + (convert_nontype_parameter): Fix handling of pointer-to-member + constants. + (lookup_template_class): Handle local classes in templates. + (tsubst): Likewise. Don't assume that template instantiations + have external linkage; pay attention to the template declaration. + (mark_decl_instantiated): Likewise. + (begin_tree): New function. + (end_tree): Likewise. + + * decl.c (xref_basetypes): Don't call complete_type for basetypes + that involve template parameters; that can lead to infinite + recursion unnecessarily. + + * pt.c (register_specialization): Do not register specializations + that aren't ready to be registered yet. + (check_explicit_specialization): Handle explicit specialization of + constructors and destructors. + (build_template_decl): New function. + (push_template_delc): Handle out-of-class specializations of + member templates. + + * pt.c (check_explicit_specialization): Set up the template + information before registering the specialization. + (coerce_template_parms): Fix thinko. + (tsubst): Handle specializations of member templates correctly. + + * class.c (finish_struct_methods): Remove calls to + check_explicit_specialization from here. + (finish_struct): And insert them here. + * cp-tree.h (perform_qualification_conversions): New function. + (perform_array_to_pointer_conversion): Likewise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (determine_specialization): Renamed from + determine_explicit_specialization. + (comp_template_parms): New function. + (processing_explicit_instantiation): New variable. + * cvt.c (perform_qualification_conversions): New function. + (perform_array_to_pointer_conversion): Likewise. + * decl.c (duplicate_decls): Don't consider template functions + alike unless they have the same parameters. Refine handling of + instantiation/specialization mismatches. + (start_decl): Don't call pushdecl for template specializations, + since they don't affect overloading. + (start_function): Likewise. + (grokfndecl): Call check_explicit_specialization a little later. + Don't call duplicate_decls for memberm template specializations. + (grokdeclarator): Don't update template_count for classes that are + themselves specializations. Remove use of `2' as parameter to + grokfndecl since that value isn't used. + * lex.c (cons_up_default_function): Save and restore + processing_explicit_instantiation around calls to grokfield. + * parse.y (finish_member_template_decl): New function. + (component_decl_1): Use it. + (fn.def2): Likewise. + (template_arg_list_opt): New nonterminal. + (template_type): Use it. + (self_template_type): Likewise. + (template_id): Likewise. + (object_template_id): Likewise. + (notype_template_declarator): Likwise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (explicit_instantiation): Use them. + * pt.c (coerce_template_parms): Add parameters. + (processing_explicit_instantiation): New variable. + (convert_nontype_parameter): New function. + (determine_overloaded_function): Likewise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (retrieve_specialization): Likewise. + (register_specialization): Likewise. + (processing_explicit_specialization): Removed. + (determine_specialization): Handle specializations of member + functions of template class instantiations. + (check_explicit_specialization): Refine to conform to standard. + (comp_template_parms): New function. + (coerce_template_parms): Call convert_nontype_parameter. + (tsubst): Refine handling of member templates. Use + register_specialization. + (instantiate_template): Use retrieve_specialization. + (do_decl_instantiation): Likewise. + (instantiate_decl): Likewise. + (type_unification): Improve handling of explicit template + arguments. + * tree.c (mapcar): Return error_mark_node, rather than aborting, + on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS. + * typeck.c (build_unary_op): Call determine_specialization, rather + than determine_explicit_specialization. + +Mon Jan 19 13:18:51 1998 Jason Merrill + + * cvt.c (build_up_reference): A TARGET_EXPR has side effects. + +Fri Jan 16 11:40:50 1998 Bruno Haible + + * error.c (dump_decl): For enum tags, output the tag, not its value. + +1998-01-13 Brendan Kehoe + + * decl.c (init_decl_processing): Only call init_rtti_processing + FLAG_RTTI is set. + +Mon Jan 12 01:35:18 1998 Jason Merrill + + * init.c (build_new_1): Split out from build_new. + (build_new): Just return a NEW_EXPR. + * expr.c (cplus_expand_expr): Handle NEW_EXPR. + + * decl2.c (get_temp_regvar): Tweak. + + * cp-tree.h (TREE_CALLS_NEW): Comment out. + * class.c (resolves_to_fixed_type_p): Remove use. + * method.c (build_opfncall): Likewise. + * call.c (build_new_op): Likewise. + +Wed Jan 7 23:47:13 1998 Jason Merrill + + * exception.cc (__eh_alloc, __eh_free): New fns. + (__cp_push_exception, __cp_pop_exception): Use them. + (__uncatch_exception): Call terminate here if no exception. + * except.c (build_terminate_handler): New fn. + (expand_start_catch_block): Use it. + (expand_exception_blocks): Likewise. + (alloc_eh_object): New fn. + (expand_throw): Use it. Protect exception init with terminate. + * typeck.c (build_modify_expr): Remove code that ignores trivial + methods. + diff --git a/contrib/gcc/cp/ChangeLog-1999 b/contrib/gcc/cp/ChangeLog-1999 new file mode 100644 index 00000000000..4b17345d166 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-1999 @@ -0,0 +1,6787 @@ +1999-12-31 Mark Mitchell + + * cp-tree.h (VF_NORMAL_VALUE): Remove. + * class.c (struct base_info): Remove vfield, vfields, and rtti. + (set_primary_base): New function, split out from ... + (finish_base_struct): ... here. Rename to ... + (determine_primary_base): ... this. Simplify. + (create_vtable_ptr): Tweak accordingly. + (finish_struct_1): Simplify. + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation. + (CLASSTYPE_N_BASECLASSES): Likewise. + (BINFO_FOR_VBASE): New macro. + (get_vbase_types): Change prototype. + * class.c (build_vbase_path): Use BINFO_FOR_VBASE. + (prepare_fresh_vtable): Likewise. + (finish_vtbls): Likewise. + (get_class_offset_1): Likewise. + (modify_all_indirect_vtables): Likewise. + (build_vbase_pointer_fields): Likewise. + * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here. + * init.c (sort_base_init): Use BINFO_FOR_VBASE. + (expand_member_init): Likewise. + * search.c (get_base_distance): Likewise. + (lookup_field_queue_p): Likewise. + (virtual_context): Likewise. + (get_vbase_types): Don't return a value. Set + CLASSTYPE_VBASECLASSES here. + * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE. + +1999-12-30 Mark Mitchell + + * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS. + +1999-12-29 Mark Mitchell + + * class.c (create_vtable_ptr): Put the vtable at the beginning of + the class, not the end, in the new ABI. + * tree.c (propagate_binfo_offsets): Do the right thing for the new + ABI. + +1999-12-29 Mark Mitchell + + * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy. + (CLASSTYPE_NEARLY_EMPTY_P): New macro. + * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P. + (check_field_decls): Likewise. + (check_bases_and_members): Likewise. + +1999-12-28 Mark Mitchell + + * cp-tree.h (do_inline_function_hair): Remove. + * class.c (layout_class_type): New function, split out from + finish_struct_1. + (fixup_pending_inline): Likewise. + (fixup_inline_methods): New function. + * method.c (fixup_pending_inline): Remove. + (do_inline_function_hair): Likewise. + + * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the + new ABI. + + * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals. + (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ... + (CLASSTYPE_PURE_VIRTUALS): ... this. + (lang_decl_flags): Replace abstract_virtual with pure_virtual. + (DECL_ABSTRACT_VIRTUAL_P): Rename to ... + (DECL_PURE_VIRTUAL_P): ... this. + (get_abstract_virtuals): Rename to ... + (get_pure_virtuals): ... this. + * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with + DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with + CLASSTYPE_PURE_VIRTUALS. + * class.c (build_vtable_entry): Likewise. + (finish_struct_bits): Likewise. Call get_pure_virtuals, not + get_abstract_virtuals. + (build_vtbl_initializer): Likewise. + (override_one_vtable): Likewise. + (check_methods): Likewise. + * decl.c (duplicate_decls): Likewise. + (redeclaration_error_message): Likewise. + (lang_mark_tree): Likewise. + * decl2.c (grok_function_init): Likewise. + (import_export_vtable): Likewise. + (import_expor_class): Likewise. + * typeck2.c (abstract_virtuals_error): Likewise. + * xref.c (GNU_xref_member): Likewise. + * search.c (get_abstract_virtuals): Rename to get_pure_virtuals. + +1999-12-26 Zack Weinberg + + * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING + throughout. + +1999-12-26 Mark Mitchell + + * decl.c (store_return_init): Use mode of old RTL generated for + DECL_RESULT, not the mode of DECL_RESULT itself. + * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE + for functions that used named return values. + +1999-12-24 Mark Mitchell + + * semantics.c (expand_body): Use + note_deferral_of_defined_inline_function. + +1999-12-22 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle CTOR_STMTs. + +1999-12-22 Alexandre Oliva + + * error.c (dump_decl): Support named return values. + +1999-12-20 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments. + (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro. + (CLASSTYPE_PRIMARY_BINFO): Likewise. + * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF, + TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here. + (check_bases_and_members): Set them here instead. + (create_vtable_ptr): New function, split out from ... + (finish_struct_1): ... here. Use it. Tidy. Use + CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO. + * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as + the first field in the class. + * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle + seeing TYPE_VFIELD as the first field in the class. + + * cp-tree.h (TYPE_VIRTUAL_P): Rename to ... + (TYPE_POLYMORPHIC_P): ... this. + (TYPE_USES_COMPLEX_INHERITANCE): Rename to ... + (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this. + (TREE_CALLS_NEW): Remove. + (TREE_MANGLED): Likewise. + * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, + and TYPE_POLYMORPHIC_P. + * class.c (check_bases): Likewise. + (finish_base_struct): Likewise. + (finish_struct_bits): Likewise. + (check_for_override): Likewise. + (finish_struct_1): Likewise. + (get_vfield_name): Likewise. + * decl.c (xref_basetypes): Likewise. + * decl2.c (import_export_class): Likewise. + (import_export_decl): Likewise. + * error.c (dump_function_decl): Likewise. + * pt.c (instantiate_class_template): Likewise. + * repo.c (repo_inline_used): Likewise. + * rtti.c (build_headof): Likewise. + (get_tinfo_fn_dynamic): Likewise. + (build_x_typeid): Likewise. + (get_tinfo_var): Likewise. + (build_dynamic_cast_1): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (lookup_field_1): Likewise. + (dfs_debug_mark): Likewise. + (maybe_suppress_debug_info): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_component_addr): Likewise. + * typeck2.c (process_init_constructor): Likewise. + +1999-12-20 Nathan Sidwell + + * typeck.c (strip_all_pointer_quals): New static function. + (build_static_cast): Use it. Don't use at_least_as_qualified_p. + +1999-12-16 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE. + (dso_handle_node): New macro. + (flag_use_cxa_atexit): New variable. + (declare_global_var): New function. + (start_anon_func): Remove declaration. + (end_anon_func): Likewise. + * decl.c (get_atexit_node): New function, split out from + destroy_local_static. Handle flag_use_cxa_atexit. + (get_dso_handle_node): Likewise. + (start_cleanup_fn): Renamed from start_anon_func. Moved here from + except.c. Handle flag_use_cxa_atexit. + (end_cleanup_fn): Renamed from end_anon_func. Moved here from + except.c. + (declare_global_var): New variable. + (destroy_local_static): Handle flag_use_cxa_atexit. + * decl2.c (flag_use_cxa_atexit): New variable. + (lang_f_options): Likewise. + * except.c (start_anon_func): Remove. + (end_anon_func): Liekwise. + * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit. + * rtti.c (get_tinfo_var): Use declare_global_var. + +1999-12-16 Mark Mitchell + + * class.c (check_field_decls): Don't return a value. + (avoid_overlap): Moved here from tree.c. + (build_base_fields): Likewise. + (check_bases): New function, split out from finish_base_struct. + (check_bases_and_members): New function, split out from + finish_struct_1. + (struct base_info): Remove cant_have_default_ctor, + cant_have_const_ctor, cant_have_asn_ref. + (finish_base_struct): Split semantic analysis into check_bases. + (finish_struct_methods): Fix bogus assertion. + (check_field_decls): Call finish_struct_anon here. + (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES. + (finish_struct_1): Use check_bases_and_members. Reorganize. + * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. + (build_base_fields): Don't declare. + * tree.c (avoid_overlap): Remove. + (build_base_fields): Likewise. + + * optimize.c (struct inline_data): Remove scope_stmt. + (remap_block): Don't use insert_block_after_note. Don't update + scope_stmt. + (expand_call_inline): Don't update scope_stmt. + (optimize_function): Don't initialize scope_stmt. + * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted + NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes. + +1999-12-15 Mark Mitchell + + * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS + out of the class, rather than taking them as parameters. + (build_vbase_pointer_fields): Move here from tree.c. + (build_vtbl_or_vbase_field): New function. + (check_methods): Likewise. + (remove_zero_width_bitfields): Likewise. + (add_virtual_function): Use tree_cons instead of temp_tree_cons. + (delete_duplicate_fields_1): Tidy. Don't delete duplicate + USING_DECLs here. + (finish_struct_methods): Handle the case where there are no + methods here. + (get_basefndecls): Use tree_cons instead of temp_tree_cons. + (check_field_decls): Call delete_duplicate_fields here. + (finish_struct_1): Tidy. Use check_methods and + remove_zero_width_bitfields. + * cp-tree.h (build_vbase_pointer_fields): Remove. + * decl.c (grokdeclarator): Use tree_cons instead of + temp_tree_cons. + * decl2.c (qualified_lookup_using_namespace): Use tree_cons + instead of temp_tree_cons. + * lex.c (cons_up_default_function): Remove dead code. + * method.c (fixup_pending_inline): New function, split out from ... + (do_inline_function_hair): ... here. + * tree.c (build_vbase_pointer_fields): Remove. + +1999-12-15 Jason Merrill + + * tree.c (walk_tree): Walk operand subtrees in forward order. + * optimize.c (expand_call_inline): Likewise. + (optimize_function): Initialize id->scope_stmt to something useful. + (remap_block): Assume id->scope_stmt has a useful value. + +1999-12-15 Nathan Sidwell + + * typeck.c (build_c_cast): Expand warning message. Move pointer + alignment warning to after the cast. Don't warn about pointer + alignment when given a pointer to incomplete. + +1999-12-15 Richard Henderson + + * cp-tree.h (make_aggr_type): Declare. + * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE. + (make_aggr_type): New. + + * decl.c (build_typename_type, init_decl_processing): Use it. + (build_ptrmemfunc_type, xref_tag): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * pt.c (process_template_parm, lookup_template_class): Likewise. + * rtti.c (expand_class_desc): Likewise. + * semantics.c (begin_class_definition, finish_typeof): Likewise. + * tree.c (copy_template_template_parm): Likewise. + +1999-12-15 Jason Merrill + + * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using + sizeof (struct tree_common). + +1999-12-14 Jason Merrill + + * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the + outermost block to point to the inlined function decl. + + * error.c (dump_decl): operator==, not operator ==. + (op_to_string): Likewise. + + * decl.c (compute_array_index_type): Handle null name. + + * decl2.c (ambiguous_decl): Fix to match comment. + (lookup_using_namespace): Adjust. + + * decl2.c (import_export_class): Don't ignore dllimport. + +1999-12-14 Mark Mitchell + + * class.c (check_field_decls): Split out from ... + (finish_struct_1): ... here. Use it. Tidy. + + * cp-tree.h (remap_save_expr): Add walk_subtrees parameter. + * optimize.c (copy_body_r): Pass it. + * tree.c (remap_save_expr): Clear walk_subtrees for an + already-handled SAVE_EXPR. + (cp_unsave_r): Pass walk_subtrees to remap_save_expr. + + * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS. + * ir.texi (DECL_NAMESPACE_ALIAS): Document it. + + * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION. + +1999-12-14 Mumit Khan + + * class.c (finish_base_struct): Allow multiple COM base classes + as well as non-COM bases as long as it's not the leftmost. + +1999-12-13 Mumit Khan + + * lex.c (saving_parse_to_obstack): New global. + (reinit_parse_for_block): Use. + (reinit_parse_for_expr): Use. + (check_newline): Use. + +1999-12-13 Mark Mitchell + + * optimize.c (initialize_inlined_parameters): Take FN to which the + parameters belong as an argument. + (expand_call_inline): Expand calls into the parameter + initializations before pushing the function onto the list of + functions we are presently expanding. + +1999-12-11 Kaveh R. Ghazi + + * class.c (get_vtable_name): Use a literal format string and + VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT. + (prepare_fresh_vtable): Likewise. + + * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of + VTABLE_NAME_FORMAT. + + * decl.c (make_rtl_for_local_static): Remove unused variable `type'. + + * init.c (build_vec_init): Initialize variable `try_body'. + + * lex.c (yyerror): Don't call a variadic function with a + non-literal format string. + + * optimize.c (optimize_function): Call memset, not bzero. + + * pt.c (for_each_template_parm_r): Add static prototype. + +1999-12-09 Andreas Jaeger + + * except.c (expand_throw): Add static attribute to match + prototype. + + * Makefile.in (semantics.o): Add dependency on output.h. + * semantics.c: Include output.h for declaration of + make_function_rtl. + +1999-12-09 Mark Mitchell + + * decl.c (init_decl_processing): Reenable inlining on trees. + (finish_function): Likewise. + * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here. + * semantics.c (simplify_aggr_init_exprs): New function. + (expand_body): Use it. + * tree.c (walk_tree): Special-case TARGET_EXPRs since they + sometimes present the same sub-tree twice. + + * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not + `csl'. + + * semantics.c (finish_switch_cond): Do conversions here, not ... + * typeck.c (c_expand_start_case): Here. + + * semantics.c (do_poplevel): Remove unused variable. + +1999-12-06 Mark Mitchell + + * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE + unless we're declaring the variable in question. + +1999-12-06 Mark Mitchell + + * decl.c (init_decl_processing): #if 0 last patch. + (finish_function): Likewise. + +1999-12-05 Mark Mitchell + + * decl.c (init_decl_processing): Set flag_inline_trees if + !flag_no_inline. + + * cp-tree.h (calls_setjmp_p): Declare. + * decl.c (finish_function): Mark functions that call setjmp as + uninlinable. + * optimize.c (calls_setjmp_r): New function. + (calls_setjmp_p): Likewise. + +1999-12-04 Mark Mitchell + + * optimize.c (expand_call_inline): Wrap the expanded call in an + EXPR_WITH_FILE_LOCATION node to get correct line numbers for + inlined functions. + + * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add + in_target_cleanup_p. + (remap_decl): New function. + (remap_block): Likewise. + (copy_scope_stmt): Likewise. + (copy_body_r): Use remap_decl and copy_scope_stmt. + (copy_body): Use VARRAY_TOP_TREE. + (initialize_inlined_parameters): Likewise. + (declare_return_variable): Likewise. + (inlinable_function_p): Check flag_inline_trees. + (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs + specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the + parameters of the inlined function. + (optimize_function): Prevent recursion into partially complete + functions. + + * cp-tree.def (SCOPE_STMT): Take one operand. + * cp-tree.h (SCOPE_STMT_BLOCK): New macro. + (SCOPE_NULLIFIED_P): Redefine. + (SCOPE_NO_CLEANUPS_P): New macro. + (add_scope_stmt): Change prototype. + * decl.c (poplevel): Tidy. Warn about unused variables here. + Record SCOPE_STMT_BLOCKs. + (finish_function): Keep DECL_INITIAL for functions that might be + inlined. + * ir.texi: Document SCOPE_NO_CLEANUPS_P. + * semantics.c: Include rtl.h. + (add_scope_stmt): Return the new scope statement and, for an + end-of-scope statement, its matching begin statement. Don't set + SCOPE_NULLIFIED_P. + (do_pushlevel): Simplify, now that we are always + function-at-a-time. + (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs. + (expand_stmt): Don't call expand_start_bindings or + expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set. + * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting + SCOPE_NULLIFIED_P. + * Makefile.in (semantics.o): Depend on RTL_H. + + * decl2.c (pending_statics_used): Make it a macro. + (saved_inlines_used): Likewise. + (finish_static_data_member_decl): Use VARRAY_PUSH_TREE. + (mark_inline_for_output): Likewise. + (ssdf_decls_used): Remove. + (start_static_storage_duration_function): Use VARRAY_PUSH_TREE. + (generate_ctor_or_dtor_function): Adjust accordingly. + +1999-11-24 Geoffrey Keating + Greg McGary + + * decl.c (duplicate_decls): Merge + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, + DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. + +1999-12-02 Mike Stump + + * init.c (perform_member_init): Handle parse errors better. + +1999-12-01 Mark Mitchell + + * cp-tree.h (min_tree_cons): Remove. + (scratch_ovl_cons): Likewise. + * decl.c (saveable_obstack): Don't declare. + (duplicate_decls): Tweak error-message. + (initialize_local_var): Explicitly mark the definition as static. + (finish_function): Call permanent_allocation, just so + that the middle-end sees the obstacks it expects. + (mark_cp_function_context): Likewise. + * init.c (build_new): Don't use min_tree_cons. + * lex.c (permanent_obstack): Don't declare. + (current_obstack, saveable_obstack): Likewise. + * spew.c (current_obstack, saveable_obstack): Likewise. + * tree.c (current_obstack, saveable_obstack): Likewise. + (scratch_ovl_cons): Remove. + (build_min_nt): Don't mess with obstacks. + (build_min): Likewise. + (min_tree_cons): Remove + * typeck.c (build_component_ref): Don't use scratch_ovl_cons. + (build_x_function_call): Likewise. + (build_c_cast): Don't use min_tree_cons. + +1999-11-29 Mark Mitchell + + * pt.c (tsubst_decl): Robustify. + +1999-11-27 Mark Mitchell + + * decl2.c (finish_file): Call expand_body for inline functions + that will be written out but that do not yet have RTL. + * semantics.c (expand_body): Do not generate RTL For inline + functions that do not yet need to be written out. + +1999-11-25 Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add optimize.c. + * Makefile.in (CXX_OBJS): Add optimize.o. + (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). + (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. + (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. + (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. + (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. + (dump.o): Likewise. + (optimize.o): New target. + * class.c: Don't include splay-tree.h. + * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. + * cp-tree.h: Include splay-tree.h. + (DECL_UNINLINABLE): New macro. + (CTOR_BEGIN_P, CTOR_END_P): New macros. + (flag_inline_trees): New variable. + (local_variable_p): New function. + (nonstatic_local_decl_p): Likewise. + (optimize_function): Likewise. + (cplus_unsave_expr_now): Remove. + (copy_tree_r): Declare. + (remap_save_expr): Likewise. + * decl.c (local_variable_p): Don't + make it static. + (local_variable_p_walkfn): New function. + (make_rtl_for_local_static): Remove code to try to avoid writing + out static constants. + (emit_local_var): Fix indentation. + (nonstatic_local_decl_p): New function. + (check_default_argument): Use local_variable_p_walkfn, not + local_variable_p, when walking the tree. + (start_function): Set the DECL_CONTEXT for automatically generated + labels. + (finish_constructor_body): Use CTOR_STMT to mark the end of a + constructor. + * decl2.c: Don't include splay-tree.h. + (flag_inline_trees): Define. + * dump.c: Don't include + splay-tree.h. + * except.c (expand_end_catch_block): Fix comment formatting. + (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. + (expand_throw): Tidy comment. + * init.c (build_vec_delete_1): Use create_temporary_var. + * lex.c (cplus_tree_code_type): Make it static. + (cplus_tree_code_length): Likewise. + (cplus_tree_code_name): Likewise. + * optimize.c: New file. + * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions + with computed gotos. + (setup_vtbl_ptr): Mark the beginnings of constructors with + CTOR_STMT. + (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. + (expand_body): Call optimize_function. Save bodies if we're doing + inlining on trees. + * tree.c: Don't include splay-tree.h. Include insn-config.h and + integrate.h. + (copy_tree_r): Make it public. + (statement_code_p): New function. + (mark_local_for_remap_r): Likewise. + (cp_usave_r): Likewise. + (cp_unsave): Likewise. + (build_cplus_new): Set DECL_CONTEXT for temporary variables. + (walk_tree): Walk into `s' class nodes. Walk statement chains. + (copy_tree_r): Handle 's' class nodes. Restore chains for + statements. Nullify scopes. Don't copy types. + (init_tree): Set lang_unsave to cp_unsave. + (remap_save_expr): Define. + * ir.texi: Document CTOR_STMT. + +1999-11-24 Jason Merrill + + * search.c (note_debug_info_needed): Do perform this optimization + for dwarf2. + (maybe_suppress_debug_info): Likewise. Start by clearing + TYPE_DECL_SUPPRESS_DEBUG. + +1999-11-24 Mark Mitchell + + * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs. + + * decl2.c (finish_vtable_vardecl): Don't prune vtables here. + +1999-11-23 Kaveh R. Ghazi + + * decl.c (pushdecl, grokdeclarator): Don't call a variadic + function with a non-literal format string. + + * lex.c (do_identifier): Likewise. + + * typeck.c (build_unary_op): Likewise. + +1999-11-23 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation. + +1999-11-22 Mark Mitchell + + * cp-tree.def (CTOR_COMPLETE): New tree node. + * decl.c (finish_constructor_body): Add it, to mark the end of the + constructor. + (finish_function): Don't call end_protect_partials here. + * ir.texi (CTOR_COMPLETE): Document it. + * semantics.c (expand_stmt): Handle it. + + * cp-tree.def (FUNCTION_NAME): New tree node. + * cp-tree.h (current_function_name_declared): Tweak documentation. + (lang_decl_flags): Add pretty_function_p, adjust dummy. + (DECL_PRETTY_FUNCTION_P): New macro. + * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__, + etc., in a template function. Use at_function_scope_p instead of + expanding it inline. + * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations + specially. + (tsubst): Handle FUNCTION_NAME. + (tsubst_copy): Likewise. + (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__, + etc. in instantiation. + * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc., + even in template functions. + (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the + conditional scope at the top of a destructor. + + * error.c (dump_function_decl): Use `[ with ... ]' syntax for + specializations too. + +1999-11-22 Nathan Sidwell + + * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT + when actually negative. + + * typeck.c (convert_for_assignment): Expand comment about + strange NULL check, moved from ... + (convert_for_initialization): ... here. Remove unneeded + code. + +1999-11-21 Alexandre Oliva + + * cp-tree.h (build_vec_delete): Remove `auto_delete' argument. + * init.c (build_vec_delete, build_vec_delete_1): Likewise. + Always destruct virtual bases of array components, but never + delete them. + (build_vec_init): Adjust invocations. + (build_delete): Likewise. + * decl2.c (delete_sanity): Likewise. + +1999-11-19 Nathan Sidwell + + * cp-tree.h (grok_method_quals): Return this pointer qualifiers. + * decl.c (grokdeclarator): Adjust calls to grok_method_quals. + * decl2.c (grok_method_quals): Accept `restrict' as applying to + the object pointer. Return such qualifiers. + (grokclassfn): Apply this pointer qualifiers. Cleanup unused + variables. + +1999-11-18 Mark Mitchell + + * except.c (expand_end_catch_block): Fix typo. + (expand_exception_blocks): Simplify. Don't call + expand_leftover_cleanups. + +1999-11-15 Jason Merrill + + * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic. + * pt.c (tsubst, case INTEGER_TYPE): Call it. + Check uses_template_parms. + + * class.c (finish_struct): If we're a local class in a template + function, add a TAG_DEFN. + * pt.c (lookup_template_class): If this is a local class in a + template function, call pushtag. + (tsubst_expr, case TAG_DEFN): Handle classes, too. + + Emit debug info with the vtable. + * search.c (maybe_suppress_debug_info): New function... + * class.c (finish_struct_1): ...split out from here. + * cp-tree.h: Declare it. + * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG + if we're writing out the vtable. + * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p, + note_debug_info_needed): #if 0 out. + +1999-11-14 Mark Mitchell + + * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro. + * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not + TREE_PERMANENT. + * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P. + * decl2.c (lookup_arg_dependent): Use it. + + * cp-tree.h (cp_finish_decl): Change prototype. + (finish_static_data_member_decl): Likewise. + (push_permanent_obstack): Remove declaration. + (push_expression_obstack): Likewise. + (push_scratch_obstack): Likewise. + (DECL_TEMPLATE_PARM_P): Robustify. + (SET_DECL_TEMPLATE_PARM_P): New macro. + * class.c (add_method): Don't manipulate obstacks. + (finish_vtbls): Likewise. + * cvt.c (build_up_reference): Adjust calls to cp_finish_decl. + * decl.c (binding_for_name): Don't manipulate obstacks. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (duplicate_decls): Likewise. + (pushdecl): Likewise. + (implicitly_declare): Likewise. + (build_typename_type): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (finish_decl): Likewise. + (destroy_local_static): Likewise. + (expand_static_init): Likewise. + (complete_array_type): Likewise. + (grokvardecl): Likewise. + (build_ptrmemfnc_type): Likewise. + (grokdeclarator): Likewise. + (xref_tag): Likewise. + (xref_basetypes): Likewise. + (start_enum): Likewise. + (finish_enum): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (start_method): Adjust call to cp_finish_decl. + * decl2.c (finish_static_data_member_decl): Don't manipulate + obstacks. + (grokfield): Likewise. + (grokbitfield): Likewise. + (get_temp_name): Likewise. + (get_sentry): Likewise. + (fnish_file): Likewise. + (lookup_arg_dependent): Likewise. + * except.c (call_eh_info): Likewise. + (push_eh_info): Likewise. + (do_pop_exception): Likewise. + (initialize_handler_parm): Likewise. + (expand_end_eh_spec): Likewise. + (alloc_eh_object): Likewise. + (expand_throw): Likewise. + * expr.c (extract_scalar_init): Likewise. + * init.c (build_java_class_ref): Likewise. + * lex.c (get_time_identifier): Likewise. + (snarf_defarg): Likewise. + (add_defarg_fn): Likewise. + (is_global): Simplify. + (do_identifier): Don't check TREE_PERMANENT. + * method.c (emit_thunk): Don't manipulate obstacks. + * parse.y (condition): Adjust call to cp_finish_decl. + (primary): Likewise. + (initdcl): Likewise. + (initdcl0_innards): Likewise. + (nomods_initdcl0): Likewise. + * pt.c (push_inline_template_parms_recursive): Use + SET_DECL_TEMPLATE_PARM_P. + (process_template_parm): Likewise. + (lookup_template_class): Don't manipulate obstacks. + (instantiate_class_template): Adjust call to + finish_static_data_member_decl. + (tsubst_decl): Don't manipulate obstacks. + (tsubst_expr): Likewise. + (instantiate_template): Likewise. + (instantiate_decl): Adjust calls to cp_finish_decl. + * rtti.c (call_void_fn): Don't manipulate obstacks. + (get_tinfo_var): Likewise. + (get_tinfo_fn_unused): Likewise. + (build_dynamic_cast_1): Likewise. + (expand_si_desc): Likewise. + (expand_class_desc): Likewise. + (expand_ptr_desc): Likewise. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (expand_upcast_fixups): Likewise. + * semantics.c (finish_asm_stmt): Likewise. + (finish_named_return_value): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_typeof): Likewise. + * tree.c (build_cplus_method_type): Likewise. + (reverse_path): Likewise. + (copy_template_template_parm): Likewise. + (build_expr_ptr_wrapper): Likewise. + (push_expression_obstack): Remove. + (push_permanent_obstack): Likewise. + * typeck.c (mark_addressable): Likewise. + +1999-11-13 Mark Mitchell + + * call.c (build_conditional_expr): Use build_target_expr_with_type. + (convert_like): Likewise. + (build_over_call): Likewise. + * cp-tree.h (build_target_expr): Remove. + (build_target_expr_with_type): New function. + * cvt.c (build_up_reference): Use get_target_expr. + * decl.c (build_target_expr): Move to ... + * tree.c (build_target_expr): Here. Make it static. + (build_target_expr_with_type): New function. Set DECL_CONTEXT on + the temporary VAR_DECLs. + (get_target_expr): Use it. + +1999-11-13 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. + * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT. + * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. + * class.c (set_rtti_entry): Use it. + +1999-11-12 Mark Mitchell + + * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups + here. + * semantics.c (finish_expr_stmt): Call it here instead. Move + default_conversion logic to semantic-analysis time. + +1999-11-12 Jason Merrill + + * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT. + +Fri Nov 12 12:56:32 MST 1999 Diego Novillo + + * init.c (init_init_processing): Re-instated Nov 11 patch after + approval. + +Fri Nov 12 10:42:02 MST 1999 Diego Novillo + + * init.c (init_init_processing): Undo patch from Nov 11, 1999. + Patch had not been approved yet. + +1999-11-12 Mark Mitchell + + * decl.c (compute_array_index_type): New function, split out from + grokdeclarator. + (create_array_type_for_decl): Likewise. + (grokdeclarator): Use them. + + * semantics.c (expand_stmt): Don't suspend_momentary or + resume_momentary. + +Thu Nov 11 12:42:11 MST 1999 Diego Novillo + + * init.c (init_init_processing): Header information for + arrays allocated via `new' should have the same alignment used by + malloc. + +1999-11-10 Mark Mitchell + + * error.c (dump_function_name): Don't crash if given a friend + pseudo-instantiation. + + * cp-tree.h (build_enumerator): Change prototype. + * decl.c (enum_next_value): Remove. + (enum_overflow): Likewise. + (init_decl_processing): Don't register enum_next_value as a root. + (start_enum): Clear TYPE_VALUES for a redefined enum. + (finish_enum): Reset the type of enumeration constants. + (build_enumerator): Fix indentation. Don't copy CONST_DECLs when + we don't need to. Maintain the TYPE_VALUES list and look there + for the previously defined enumeration constant. Let enumeration + constants have the type of their values until the enumeration type + is complete. + * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value. + (structsp): Adjust. + * parse.c: Regenerated. + * pt.c (tsubst_enum): Adjust according to build_enumerator changes. + +Wed Nov 10 12:43:21 1999 Philippe De Muyter + Kaveh R. Ghazi + + * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. + +1999-11-09 Mark Mitchell + + * cp-tree.h (language_function): Remove x_last_dtor_insn and + x_last_parm_cleanup_insn. + * decl.c (last_dtor_insn): Remove. + (last_parm_cleanup_insn): Likewise. + (expand_start_early_try_stmts): Don't set them. + (store_parm_decls): Likewise. + (save_function_data): Or save them. + (mark_lang_function): Or mark them. + +1999-11-08 Mark Mitchell + + * decl.c (store_parm_decls): Generate cleanup code at + semantic-analysis time. Destroy objects in the correct order. + +1999-11-07 Mark Mitchell + + * cp-tree.h (begin_new_placement): Remove. + (finish_new_placement): Likewise. + * class.c (finish_struct_1): Don't suspend_momentary or + resume_momentary. + * decl.c (grokdeclarator): Likewise. + (maybe_build_cleanup_1): Likewise. + * except.c (push_eh_cleanup): Likewise. + (build_terminate_handler): Likewise. + * init.c (build_new_1): Likewise. + * parse.y (parse_decl): Change prototype. + (initdecls, notype_initdecls, initdcl): Don't return int. + (initdcl0, notype_initdcl0, initdcl0_innards): Likewise. + (.begin_new_placement): Remove. + (.finish_new_placement): Likewise. + (nonmomentary_expr): Likewise. + (suspend_mom): Likewise. + (condition): Don't suspend_momentary, resume_momentary, or keep + track of need to resume. + (unary_expr): Likewise. + (new_placement): Likewise. + (decl): Likewise. + (structsp): Likewise. + (new_type_id): Likewise. + (maybe_parmlist): Likewise. + (direct_after_type_declaration): Likewise. + (direct_new_declarator): Likewise. + (direct_abstract_declaration): Likewise. + * parse.c: Regenerated. + * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary. + * semantics.c (begin_new_placement): Remove. + (finish_new_placement): Likewise. + +1999-11-05 Martin v. Löwis + + * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. + (DECL_TEMPLATE_INFO): Use it. + * decl.c (warn_extern_redeclared_static): Do nothing for + TEMPLATE_DECLs. + * decl2.c (mark_used): Explicitly check for function or variable. + * semantics.c (finish_unary_op_expr): Check whether result is also + an INTEGER_CST. + +1999-11-05 Mark Mitchell + + * Makefile.in (typeck2.o): Depend on output.h. + * typeck2.c: Include output.h. + + * decl.c (flag_ansi): Remove declaration. + + * pt.c (tinst_level_tick): Make it static. + (last_template_error_tick): Likewise. + + * cp-tree.h (mapcar): Remove declaration. + (search_tree): Likewise. + (walk_tree_fn): New typedef. + (walk_tree): New function. + * tree.c (bot_manip): Change prototype. Adjust to be called via + walk_tree. + (bot_replace): Likewise. + (no_linkage_helper): Likewise. + (copy_tree_r): New function. + (search_tree): Rename, and adjust, to become ... + (walk_tree): New function. + (mapcar): Remove. + (target_remap): Remove. + (target_remap_count): Likewise. + (break_out_target_exprs): Use walk_tree. + * decl.c (local_variable_p): Change prototype. + (check_default_argument): Use walk_tree. + * pt.c (for_each_template_parm_r): New function, split out from ... + (for_each_template_parm): Here. Use it, via walk_tree. + +1999-11-03 Mark Mitchell + + * class.c (check_bitfield_decl): New function, split out from + finish_stuct_1. + (check_field_decl): Likewise. Recursively examine members of + anonymous structs. + (finish_struct_1): Use them. + * cp-tree.h (ANON_UNION_TYPE_P): New macro. + +1999-11-02 Mark Mitchell + + * decl.c (grokfndecl): Remove dead code. + + * dump.c (dequeue_and_dump): Fix thinko for catch-clauses. + +1999-11-02 Scott Snyder + + * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and + IMAGPART_EXPR. + * pt.c (tsubst_copy): Likewise. + +1999-11-01 Jason Merrill + + * decl2.c (maybe_make_one_only): Always make things comdat on + ELF targets, too. + +1999-10-31 Mark Mitchell + + * decl.c (finish_function): Call free_after_parsing for functions + we are not immediately turning into RTL. + +1999-10-31 Brendan Kehoe + + * cp-tree.h (flag_dump_translation_unit): Add decl. + +Sat Oct 30 22:42:50 1999 Stephen L Moshier + + * lex.c (yylex): Accept 'f' in mantissa of hex float constant. + +1999-10-30 Mark Mitchell + + * decl.c (pop_cp_function_context): Don't call free on a NULL + pointer. + * semantics.c: Include ggc.h. + (expand_body): Do garbage-collection after processing a template + function. Clear DECL_SAVED_TREE after generating RTL for a + function. + * Makefile.in (semantics.o): Depend on ggc.h. + +1999-10-29 Mark Mitchell + + * cp-tree.h (make_typename_type): Change prototype. + * decl.c (make_typename_type): Only complain if so requested. + * parse.y (nested_name_specifier): Adjust calls. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + * parse.c: Regenerated. + * pt.c (convert_template_argument): Pass complain to + make_typename_type. + (tsubst): Likewise. + +1999-10-28 Mark Mitchell + + * semantics.c (finish_handler): End the scope of the handler + before attaching it to the statement-tree. + +1999-10-28 Ian Lance Taylor + + * rtti.c (build_dynamic_cast_1): Give a better error message for + an attempt to dynamic_cast from a non-polymorphic type. + +1999-10-27 Mark Mitchell + + * cp-tree.h (make_temp_vec): Remove. + (make_scratch_vec): Likewise. + * call.c (add_function_candidate): Use make_tree_vec. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (add_template_candidate_real): Likewise. + * class.c (resolve_address_of_overloaded_function): Likewise. + * decl.c (start_function): Don't fool with the momentary obstack. + (finish_function): Likewise. + * init.c (expand_direct_vtbls_init): Likewise. + (begin_init_stmts): Likewise. + (finish_init_stmts): Likewise. + * pt.c (add_to_template_args): Use make_tree_vec. + (check_explicit_specialization): Likewise. + (coerce_template_parms): Likewise. + (lookup_template_class): Don't fool with the momentary obstack. + (instantiate_class_template): Likewise. + (tsubst_template_arg_vector): Use make_tree_vec. + (tsubst_aggr_type): Don't fool with the momentary obstack. + (tsubst_decl): Likewise. Use make_tree_vec. + (try_one_overload): Likewise. + (try_class_unification): Don't fool with the momentary obstack. + (get_bindings_real): Use make_tree_vec. + (set_mangled_name_for_template_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack. + * semantics.c (finish_expr_stmt): Likewise. + (finish_do_stmt): Likewise. + (finish_for_expr): Likewise. + (finish_switch_cond): Likewise. + (do_pushlevel): Likewise. + (do_poplevel): Likewise. + * tree.c (make_temp_vec): Remove. + + * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump + CLEANUP_P for a TRY_BLOCK. + * ir.texi: Document SAVE_EXPR. + +Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) + + * call.c (build_over_call): Check that the built-in function is + of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS. + * typeck.c (build_function_call_real): Similarly. + +1999-10-26 Mark Mitchell + + * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call + remember_end_note. + +1999-10-24 Mark Mitchell + + * decl.c (push_overloaded_decl_1): Use pushdecl. + + * decl.c (auto_function): Replace #ifdef'd __inline with just + plain inline. + * lex.c (my_get_run_time): Likeise. + (yyprint): Likewise. + (identifier_type): Likewise. + * method.c (start_squangling): Likewise. + (end_squangling): Likewise. + (icat): Likewise. + (old_backref_index): Likewise. + (flush_repeats): Likewise. + (issue_ktype): Likewise. + * parse.y (empty_parms): Likewise. + * parse.c: Regenerated. + +1999-10-21 Mark Mitchell + + * dump.c (dequeue_and_dump): Replace several uses of + queue_and_dump_index with dump_child. + +1999-10-21 Kaveh R. Ghazi + + * expr.c: Include tm_p.h. + +1999-10-21 Mark Mitchell + + * cp-tree.h (SCOPE_PARTIAL_P): New macro. + (pushlevel_temporary): Remove. + (add_scope_stmt): New function. + * decl.c (pushlevel_temporary): Remove. + (poplevel): Use add_scope_stmt. + (start_decl_1): Likewise. + * semantics.c (add_scope_stmt): New function. + (do_pushlevel): Use it. + (do_poplevel): Use it. + (expand_stmt): Check SCOPE_PARTIAL_P. + + * cp-tree.def (EMPTY_CLASS_EXPR): New tree node. + * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR. + * expr.c (cplus_expand_expr): Expand it. + * ir.texi: Document EMPTY_CLASS_EXPR. + +1999-10-20 Mark Mitchell + + * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template + parameters as having namespace scope. + +1999-10-19 Mark Mitchell + + * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove. + (mangling_flags): New type. + (build_overload_int): Change prototype. + (build_overload_value): Likewise. + (numeric_output_need_bar): Improve comment. + (mangle_expression): New function, broken out from ... + (build_overload_int): Here. + (build_overload_value): Adjust for use of mangling flags. Don't + warn about real-valued template parameters here. Do handle + complex expressions involving real-valued template parameters. + (build_template_parm_names): Encase non-type template parameters + in underscores, if necessary. + (process_overload_item): Remove conditional on + PARM_CAN_BE_ARRAY_TYPE. + +1999-10-17 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR. + + * ir.texi: Clean up documentation of RETURN_INIT. + +1999-10-15 Greg McGary + + * lex.c (lang_init_options): Set flag_bounds_check as "unspecified". + (lang_init): Set default for flag_bounds_check if still "unspecified". + +1999-10-13 Andrew Haley + + * class.c (finish_struct_1): Force alignment of non-bitfields to + BITS_PER_UNIT. + +Wed Oct 13 22:01:35 1999 J"orn Rennecke + + * typeck2.c (process_init_constructor): Handle empty constructors. + +1999-10-13 Jason Merrill + + * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL. + + * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size + array error. + +1999-10-13 Mark Mitchell + + * decl.c (make_rtl_for_local_static): Don't create register RTL + for addressable constants. + +1999-10-13 Nathan Sidwell + + * cp-tree.h (build_x_va_arg): Prototype new function. + * call.c (build_x_va_arg): Define it. + * parse.y (unary_expr): Call build_x_va_arg. + + * cp-tree.h (convert_type_from_ellipsis): Prototype new function. + * call.c (convert_type_from_ellipsis): Define it. + * decl.c (init_decl_processing): Set lang_type_promotes_to. + + * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates. + +1999-10-11 Jason Merrill + + * class.c (fixed_type_or_null): Always set *nonnull. + +1999-10-10 Kaveh R. Ghazi + + * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing + __GNUC__ and __GNUC_MINOR__. + +1999-10-09 Mark Mitchell + + * cp-tree.h (make_rtl_for_local_static): New function. + * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for + local statics ... + (make_rtl_for_local_static): Here. + * semantics.c (expand_stmt): Use make_rtl_for_local_static. + +1999-10-08 Kaveh R. Ghazi + + * method.c: Include tm_p.h. + +1999-10-7 Franz Sirl + + * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. + * lex.c (cp_make_lake_type): Likewise. + * tree.c (init_tree): Init make_lang_type_fn. + +1999-10-07 Mark Mitchell + + * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch + parameter. + + * semantics.c (expand_stmt): Don't pretend to have asmspecs for + local statics if we don't really have them. + + * ir.texi: Improve documentation for STMT_EXPR. Describe + CLEANUP_POINT_EXPR. + +1999-10-07 Jason Merrill + + * class.c (build_vtable_entry_ref): Use finish_asm_stmt. + +1999-10-07 Greg McGary + + * class.c (finish_struct_1): Use simpler method of + removing elements of a singly-linked list which doesn't + lose for classes without data members. + +1999-10-07 Mark Mitchell + + * friend.c (make_friend_class): Robustify. + + * semantics.c (finish_object_call_expr): Reject calls to template + types. + +1999-10-06 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR. + + * cp-tree.h (CLASSTYPE_VFIELD): Remove. + * call.c (build_vfield_ref): Use TYPE_VFIELD, not + CLASSTYPE_VFIELD. + * class.c (get_vfield_offset): Likewise. + (finish_base_struct): Likewise. + (modify_one_vtable): Likewise. + (fixup_vtable_deltas): Likewise. + (finish_struct_1): Likewise. + * init.c (expand_virtual_init): Likewise. + * search.c (lookup_field_1): Likewise. + (expand_upcast_fixups): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_binary_op_nodefault): Likewise. + + * dump.c (dqueue_and_dump): Dump TYPE_VFIELD. + * ir.texi: Document TYPE_VFIELD. + +1999-10-06 Brendan Kehoe + + * decl.c (grokdeclarator): Only warn about nonzero arrays if + !in_system_header (linux socketbits.h can give this for + __cmsg_data, which is using a GNU extension). + +1999-10-05 Mark Mitchell + + * decl2.c (start_static_storage_duration_function): Push the + function declaration so it ends up in namespace scope. + + * dump.c (DUMP_CHILDREN): Remove. + (DUMP_BINFO): Adjust. + (struct dump_node_info): Remove dump_children_p. + (queue_and_dump_type): Remove dump_children_p parameter. + (queue): Don't set dump_children_p. + (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to + queue_and_dump_index. + (dequeue_and_dump): Unconditionally print children. Adjust calls + to functions mentioned above. + (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue. + + * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR. + * dump.c (dequeue_and_dump): Dump them. + + * method.c (synthesize_method): Call setup_vtbl_ptr for destructors. + + * decl.c (start_function): Set current_in_charge_parm for + constructors, too, where appropriate. + * search.c (fixup_all_virtual_upcast_offsets): New function. + (expand_indirect_vtbls_init): Use it. + +1999-10-04 Nathan Sidwell + + * decl2.c (grok_alignof): Don't decay lvalues. + + * init.c (build_new): Remove unused variable. + +1999-10-04 Mark Mitchell + + * cp-tree.h (struct language_function): Remove static_labelno. + (static_labelno): Remove macro. + * method.c (build_overload_nested_name): Make static_labelno + static here. + + * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, + to decide whether or not a function is defined. + + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for + situations where make_node will do it automatically. + * decl.c (grok_reference_init): Likewise. + (expand_static_init): Likewise. + (do_static_initialization): Likewise. + * init.c (perform_member_init): Likewise. + (expand_aggr_init_1): Likewise. + (build_new_1): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + * search.c (expand_upcast_fixups): Likewise. + * semantics.c (finish_stmt_expr): Likewise. + * typeck.c (build_unary_op): Likewise. + (check_return_expr): Likewise. + +1999-10-04 Jason Merrill + + * init.c (build_vec_delete_1): Fold COND_EXPRs. + +1999-10-03 Mark Mitchell + + * cp-tree.def (VEC_INIT_EXPR): Remove. + * cp-tree.h (struct stmt_tree): New type. + (struct saved_scope): Remove firstobj. Add x_saved_tree, + x_stmt_tree. + (class_cache_firstobj): Remove. + (struct language_function): Remove stmts_are_full_exprs_p, + x_last_tree, and x_last_expr_type. Add x_stmt_tree. + (current_stmt_tree): New macro. + (last_tree): Adjust. + (last_expr_type): Likewise. + (doing_semantic_analysis_p): Simplify. + (stmts_are_full_exprs_p): Adjust. + (begin_tree): Remove prototype. + (end_tree): Likewise. + (begin_stmt_tree): Change prototype. + (finish_stmt_tree): Likewise. + (building_stmt_tree): Simplify. + * decl.c (mark_stmt_tree): New function. + (mark_saved_scope): Use it. + (start_function): Rearrange slightly to call begin_stmt_tree + earlier. + (save_function_data): Tweak. + (finish_function): Adjust call to finish_stmt_tree. + (mark_lang_function): Use mark_stmt_tree. + * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. + * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. + (build_vec_init): Remove creation of stand-in initializer. + * pt.c (begin_tree): Remove. + (end_tree): Likewise. + * semantics.c (SET_LAST_STMT): New macro. Use it throughout. + (begin_compound_stmt): Handle a compound-statement outside of a + function. + (begin_stmt_expr): Handle a statement-expression outsidef of a + function. + (finish_stmt_expr): Likewise. + (begin_class_definition): Don't call begin_tree. + (finish_inline_definitions): Don't call end_tree. + (begin_stmt_tree): Take a pointer to tree, not a function as input. + (finish_stmt_tree): Likewise. + * tree.c (search_tree): Don't handle VEC_INIT_EXPR. + (mapcar): Likewise. + + * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. + * parse.c: Regenerated. + + * dump.c (dqueue_and_dump): Dump bitfieldness. + + * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for + bitfields, rather than DECL_BIT_FIELD. + * ir.texi: Document how to tell whether or not a field is a + bitfield. + + * lex.c (make_lang_type): Fix typo in comment. + +1999-10-01 Jason Merrill + + * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. + +1999-10-01 Mark Mitchell + + * pt.c (tsubst_decl): If the type of a template instantiation is + bogus, so is the whole instantiation. + +1999-09-30 Mark Mitchell + + * decl.c (initialize_local_var): Handle static variables here. + (cp_finish_decl): Tweak handling of function-scope static + variables. + * semantics.c (expand_stmt): Handle DECL_STMTs for static + variables. + + * method.c (emit_thunk): Don't crash when -fsyntax-only. + + * cp-tree.h (lang_decl_flags): Add global_ctor_p and + global_dtor_p. Add init_priority. + (DECL_ACCESS): Adjust accordingly. + (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros. + (GLOBAL_INIT_PRIORITY): Likewise. + * decl.c (lang_mark_tree): Adjust accordingly. + (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P, + and GLOBAL_INIT_PRIORITY. + * dump.c (dequeue_and_dump): Print them. + * ir.texi: Document them. + + * decl2.c (struct priority_info_s): Remove initialization_sequence + and destruction_sequence. + (start_static_storage_duration_function): Return the body of the + function. Convert for function-at-a-time mode. + (generate_inits_for_priority): Remove. + (finish_static_storage_duration_function): Change prototype. + Adjust for function-at-a-time mode. + (do_static_initialization): Likewise. + (do_static_destruction): Likewise. + (do_static_initialization_and_destruction): Remove. + (start_static_initialization_or_destruction): New function. + (finish_static_initialization_or_destruction): Likewise. + (get_priority_info): Don't manipulation initialization_sequence or + destruction_sequence. + (prune_vars_needing_no_initialization): New function. + (write_out_vars): Likewise. + (finish_file): Use the various new functions instead of the old. + +Thu Sep 30 00:13:27 1999 Dirk Zoller + + * cp-tree.h (warn_float_equal): Declare. + * decl2.c (warn_float_equal): Define. + (lang_decode_option): Recognize -W[no-]float-equal. + * typeck.c (build_binary_op_nodefault): Conditionally warn + about equality tests of floating point types. + +1999-09-29 Jason Merrill + + Support normal type_info-based EH mechanisms with -fno-rtti. + * except.c (build_eh_type_type): Remove special -fno-rtti handling. + (build_eh_type_type_ref): Likewise. + (build_eh_type): Remove. + (expand_throw): Call build_eh_type_type, not build_eh_type. + * decl2.c (import_export_decl): Don't associate the tinfo fn with + the vtable if -fno-rtti. + * decl.c (init_decl_processing): Always init_rtti_processing. + + * rtti.c (get_typeid): Don't complain about -fno-rtti. + + * class.c (class_cache_obstack, class_obstack): Remove. + (init_class_processing): Don't initialize class_obstack. + (push_cache_obstack): Remove. + (pushclass): Don't call it. + * cp-tree.h: Remove prototype for push_cache_obstack. + * decl.c (decl_obstack, decl_stack, push_decl_level): Remove. + (pushlevel_class): Don't push_decl_level. + (poplevel_class): Don't pop_stack_level. + (push_class_level_binding): Don't push_cache_obstack. + (init_decl_processing): Don't initialize decl_obstack. + * search.c (push_class_decls): Don't push_cache_obstack. + * tree.c (list_hash_add): Put hash node on permanent_obstack. + (hash_tree_cons): Don't mess with obstacks. + (print_lang_statistics): Don't print stats for class_obstack and + decl_obstack. + +1999-09-29 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL. + * ir.texi: Document DECL_EXTERNAL. + + * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs. + * ir.texi: Document THUNK_DECLs. + + * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c. + (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. + * error.c (dump_template_bindings): Remove unused parameter. + Handle multiple levels of template parameters. + (dump_template_decl): Use `parms', not `args', for template + parameters. Fix thinko. + (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass + flags to dump_template_bindings. + * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h. + (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. + (tsubst_copy): Clarify variable name. + (most_general_template): Robustify. + +1999-09-29 Nathan Sidwell + + * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME + to change primary template rendering. + +1999-09-29 Mark Mitchell + + * cp-tree.h (UPT_TEMPLATE): Remove. + (UPT_PARMS): Likewise. + (DECL_NEEDED_P): New macro. + * decl2.c (finish_vtable_vardecl): Use it. + (finish_objects): Don't crash with -fsyntax-only. + (finish_file): Use DECL_NEEDED_P. Don't prune vtables when + -fsyntax-only. + * pt.c (tsubst_friend_function): Remove FIXME that talks about + obstacks. + (tsubst_expr): Correct handling of function try-blocks. + * semantics.c: Include flags.h. + (expand_body): Don't do RTL generation if -fsyntax-only. + * Makefile.in (semantics.o): Depends on flags.h. + +1999-09-28 Gabriel Dos Reis + + * pt.c (most_general_template): Adjust declaration. + + * cp-tree.h: (most_general_template): Declare. + + * error.c (dump_template_value): Rename to ... + (dump_template_argument): This. + (dump_template_argument_list): New function. + (dump_type): Use it. + (dump_template_parameter): New function. + (dump_template_decl): Use it. + (dump_template_bindings): New function. + (dump_function_decl): Use it. Pretty print function template + instantiations. + +1999-09-28 Nathan Sidwell + + * decl.c (grokdeclarator): Distinguish parameter context for + diagnostics. Tidy up missing type diagnostic. + Diagnose `explicit' in one place. Diagnose `mutable' in one place. + +1999-09-28 Mark Mitchell + + * ir.texi: Improve documentation for TARGET_EXPR. + +1999-09-27 Nathan Sidwell + + Augment stringification of trees. + * cp-tree.h (tree_string_flags): New error stringifying enumeration. + (fndecl_as_string, type_as_string_real, args_as_string, + code_as_string, language_as_string, parm_as_string, + op_as_string, assop_as_string, cv_as_string): Remove. + (type_as_string, decl_as_string, expr_as_string): Adjust prototype. + (context_as_string): Declare new function. + * error.c (cp_printers): Move definition. + (OB_UNPUT): Remove. + (OB_END_TEMPLATE_ID): Adjust. + (interesting_scope_p): Remove. + (dump_scope): New static function. + (dump_qualifiers): Adjust prototype, reimplement. + (dump_template_value): Use tree_string_flags. + (dump_type_real): Move back to dump_type. + (dump_type): Adjust prototype. Use tree_string_flags. + (dump_aggr_type): Likewise. Use dump_template_parms. + (dump_type_prefix): Adjust prototype. Use tree_string_flags. + Return pad flag. + (dump_type_suffix): Adjust prototype. Use tree_string_flags. + (dump_simple_decl): Likewise. + (dump_decl): Likewise. Use dump_template_decl. + (dump_template_decl): New static function broken out of dump_decl. + (dump_function_decl): Adjust prototype. Use tree_string_flags. + (dump_parameters): Likewise. Prefix space. + (dump_exception_spec): Adjust prototype. Use tree_string_flags. + (dump_function_name): Likewise. Use dump_template_parms. + (dump_template_parms): New static function broken out of + dump_function_name. + (dump_expr_list): Adjust prototype. Use tree_string_flags. + (dump_expr): Likewise. + (fndecl_as_string): Removed + (type_as_string_real): Removed + (dump_binary_op): Adjust prototype. Use tree_string_flags. + (dump_unary_op): Likewise. + (type_as_string): Likewise. + (expr_as_string): Likewise. + (decl_as_string): Likewise. + (context_as_string): New function. + (lang_decl_name): Adjust. + (decl_to_string): New static print callback. + (expr_to_string): Likewise. + (fndecl_to_string): Likewise. + (code_as_string): Renamed to ... + (code_to_string): ... here. Adjust. + (language_as_string): Renamed to ... + (language_to_string): ... here. Adjust. + (parm_as_string): Renamed to ... + (parm_to_string): ... here. + (op_as_string): Renamed to ... + (op_to_string): ... here. + (assop_as_string): Renamed to ... + (assop_to_string): ... here. + (type_to_string): New static print callback. + (args_as_string): Renamed to ... + (args_to_string): ... here. Adjust. + (cv_as_string): Renamed to ... + (cv_to_string): ... here. Adjust. + * pt.c (mangle_class_name_for_template): Use tree_string_flags. + (print_template_context): Likewise. + +1999-09-26 Mark Mitchell + + * cp-tree.h (expand_throw): Remove prototype. + * except.c (expand_throw): Make it static. Use tree-generation + functions, rather than RTL-generation functions. + (build_throw): Use it. + * expr.c: Include except.h. + (cplus_expand_expr): Don't call expand_throw here. + * Makefile.in (expr.o): Depend on except.h. + * ir.texi: Update documentation for THROW_EXPR. + + * decl.c (start_function): Set x_dont_save_pending_sizes rather + than calling get_pending_sizes. + * init.c (build_new): Don't save and restore + immediate_size_expand; instead, assert that it has the expected + value already. + +1999-09-26 Kaveh R. Ghazi + + * lex.c (compiler_error): Add missing call to va_end(). + +1999-09-25 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle RESULT_DECL. + * ir.texi: Document RESULT_DECL and DECL_RESULT. + + * cp-tree.h (check_return_expr): New function. + * decl.c (finish_constructor_body): New function. + (pushdecl): Put global friend functions in namespace binding + level, not the class binding level. + (finish_destructor_body): Make sure the dtor_label is always + defined. Fix typo in comment. + (finish_function): Move generation of constructor-termination code + to semantic-analysis time. Move generation of implicit `main' + return value to semantic-analysis time. + * semantics.c (finish_return_stmt): Generate goto's to + ctor_label/dtor_label here. Use check_return_expr to do semantic + analysis on the returned expression. + * typeck.c (maybe_warn_about_returning_address_of_local): New + function split out from c_expand_return. + (check_return_expr): Likewise. + (c_expand_return): Just generate the RTL for the return. + +1999-09-24 Mark Mitchell + + * cp-tree.h (CPTI_CLEANUP_TYPE): New macro. + (cleanup_type): Likewise. + (search_tree): Change prototype. + * decl.c (local_variable_p): Adjust for new interface to + search_tree. + (check_default_argument): Likewise. + * error.c (dump_expr): Handle INIT_EXPR. + * except.c (expand_throw): Don't make cleanup_type a local static. + * expr.c (cplus_expand_expr): Don't handle NEW_EXPR. + * init.c (build_new): Call build_new_1 directly, rather than + building a NEW_EXPR. + (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when + processing file-scope initializers. + * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR. + * tree.c: Include splay-tree.h + (no_linkage_helper): Adjust for new interface to search_tree. + (search_tree): Pass around pointers to tree nodes, rather than the + nodes themselves. Handle VEC_INIT_EXPR. + (no_linkage_check): Adjust for new interface to search_tree. + (mapcar): Handle VEC_INIT_EXPR. + (target_remap): New variable. + (bot_manip): Use it. + (bot_replace): New function. + (break_out_target_exprs): Use it to remap all variables used in a + default argument expression. + * typeck.c (build_modify_expr): Don't crash when outside a + function and presented with an INIT_EXPR assignment + * Makefile.in (tree.o): Depend on splay-tree.h. + +Fri Sep 24 10:48:10 1999 Bernd Schmidt + + * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than + DECL_BUILT_IN. + (builtin_function): New arg CLASS. Arg CODE now of type int. All + callers changed. + Set the builtin's DECL_BUILT_IN_CLASS. + +1999-09-24 Mark Mitchell + + * decl.c (pushdecl): Don't make local declarations of extern + variables give the variable a DECL_CONTEXT for the function. + (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify. + Don't accidentally make RTL for local declarations. + (emit_local_var): Handle declarations with asm-specifiers here. + +1999-09-23 Mark Mitchell + + * ir.texi: Improve documentation for TARGET_EXPRs. Discuss + STMT_IS_FULL_EXPR_P. + + * cp-tree.h (language_function): Add cannot_inline. + * decl.c (start_function): Restore current_function_cannot_inline + from the saved value. + (save_function_data): Save current_function_cannot_inline. + * decl2.c (start_objects): Change prototype. Build the function + in function-at-a-time mode. + (finish_objects): Likewise. + (generate_ctor_or_dtor_function): Adjust accordingly. + + * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro. + * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS. + Don't call expand_anon_union_decl here + * semantics.c (exapnd_stmt): Call it here, instead. + * typeck.c (mark_addressable): Addressed variables are implicitly + used. + +1999-09-23 Martin v. Löwis + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. + (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. + (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK. + * cp-tree.h: Add tree checking macros to various tree access + macros. + * ptree.c (print_lang_decl): Test for function or variable + before accessing template info. + +1999-09-23 Jason Merrill + + * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. + * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__. + * decl2.c (lang_f_options): Add -fshort-wchar. + * cp-tree.h: Declare flag_short_wchar. + * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned + int' for wchar_t. + +1999-09-23 Martin v. Löwis + + * ir.texi: Fix formatting errors and typos. + +1999-09-22 Mark Mitchell + + * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT. + + * decl.c (pushdecl): Do create a binding for extern "C" functions, + but not for their DECL_ASSEMBLER_NAMEs. + (lookup_name_current_level): Fix formatting. + (xref_tag): Likewise. + * decl2.c (start_objects): Mark static constructors and + destructors as used. + +1999-09-22 Jason Merrill + + * decl.c (define_case_label): Don't crash if we're not in a switch. + + * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags. + * lang-options.h: Restore -fthis-is-variable. Remove help strings + for unsupported flags. + +1999-09-21 Jason Merrill + + * decl2.c (lang_decode_option): Accept and ignore -finit-priority. + Accept and warn about -fthis-is-variable. + +1999-09-21 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle START_CATCH_STMT, + CLEANUP_STMT, and SCOPE_STMT. + + * decl2.c (lang_decode_option): Adjust, in the wake of recent + changes to option processing. + +1999-09-21 Martin v. Löwis + + * typeck.c (get_member_function_from_ptrfunc): Allow extraction of + function pointer from pmfs with no object given. + (convert_for_assignment): Do not return error when converting + pmfs. + +1999-09-21 Alex Samuel + + * lex.c (internal_filename): New variable. + (INTERNAL_FILENAME): New macro. + (init_parse): Allocate internal_filename and mark as root. Use it + instead of a string constant. + +1999-09-21 Nathan Sidwell + + Reimplement dynamic cast and catch matching. + * cp-tree.h (get_dynamic_cast_base_type): Prototype new function + * search.c (dynamic_cast_base_recurse): New function. + (get_dynamic_cast_base_type): New function for dynamic cast. + * rtti.c (build_dynamic_cast_1): Determine source and target + class relationship. Call __dynamic_cast_2. + * tinfo.h (__user_type_info::upcast): New catch dispatcher. + (__user_type_info::dyncast): New dynamic cast dispatcher. + (__user_type_info::sub_kind): New nested enumeration. + (__user_type_info::contained_p): sub_kind predicate. + (__user_type_info::contained_public_p): Likewise. + (__user_type_info::contained_nonpublic_p): Likewise. + (__user_type_info::contained_nonvirtual_p: Likewise. + (__user_type_info::upcast_result): New nested struct. + (__user_type_info::dyncast_result): New nested struct. + (*::do_upcast): New catch function. + (*::do_dyncast): New dynamic cast function. + (__user_type_info::find_public_subobj): New dynamic cast + helper dispatcher. + (*::do_find_public_subobj): New dynamic cast helper function. + * tinfo.cc (__user_type_info::upcast): Define catch dispatcher. + (__user_type_info::dyncast): Define dynamic cast dispatcher. + (*::do_upcast): Define catch function. + (*::do_dyncast): Define dynamic cast function. + (*::do_find_public_subobj): Define dynamic cast helper function. + * tinfo2.cc (__throw_type_match_rtti_2): Use upcast. + (__dynamic_cast): Backwards compatibility wrapper. Use dyncast. + (__dynamic_cast_2): New dynamic cast runtime. + +1999-09-20 Mark Mitchell + + * cp-tree.h (finish_stmt_expr): Change prototype. + * expr.c (cplus_expand_expr): Adjust call accordingly. + * init.c (finish_init_stmts): Likewise. + * parse.y (primary): Likewise. + * pt.c (tsubst_copy): Likewise. + * semantics.c (finish_stmt_expr): Don't take two parameters. + Don't remove generated BLOCKs from the block-tree. + + Remove support for assigning to `this'. + * NEWS: Note that fact. + * class.c (build_vbase_path): Don't check flag_this_is_variable. + * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. + (language_function): Remove assigns_this, just_assigned_this, and + x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. + (base_init_expr): Remove. + (current_vcalls_possible_p): New macro. + (vtbls_set_up_p): Likewise. + (emit_base_init): Change prototype. + * decl.c (finish_destructor_body): New function, split out from + finish_function. + (current_function_assigns_this): Remove. + (current_function_just_assigned_this): Likewise. + (start_function): Don't set them. + (finish_function): Don't check them. Don't emit + base-initialization code here. Generate code for destructors when + doing semantic analysis. + (finish_stmt): Don't check current_function_just_assigned_this. + * decl2.c (lang_f_options): Remove this-is-variable. + (lang_decode_option): Likewise. + (grokclassfn): Don't check flag_this_is_variable. + * init.c (emit_base_init): Return the expression generated. + (construct_virtual_bases): Don't push/pop obstacks. Fix + typo. + (build_new_1): Don't check flag_this_is_variable. + (get_temp_regvar): Don't set DECL_REGISTER. + (build_vec_init): Don't call use_variable. + * lang-options.h: Remove "-fthis-is-variable" and + "-fno-this-is-variable". + * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. + * search.c (expand_upcast_fixups): Use finish_expr_stmt, not + expand_expr_stmt. + * semantics.c (finish_expr_stmt_real): Rename to ... + (finish_expr_stmt): This. Remove assigned_this parameter. + (begin_if_stmt): Call do_pushlevel before starting the statement. + (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less + blocks. + (setup_vtbl_ptr): Emit initialization code for bases and members + at semantic-analysis time. Emit code to initialize vtables in + destructors here. + (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. + Don't handle CTOR_INITIALIZER any more. + * typeck.c (build_modify_expr): Don't check for assignments to + this. + (c_expand_return): Don't suggest assigning to `this'. + + * Makefile.in (decl.o): Depend on RTL_H. + (decl2.o): Likewise. + (class.o): Likewise. + (call.o): Likewise. + (method.o): Likewise. + (search.o): Likewise. + (tree.o): Likewise. + (pt.o): Likewise. + + * decl.c (duplicate_decls): When a builtin function is redeclared + as static, make sure it is mangled correctly. + + * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add + detail about the statement-tree. + +1999-09-20 Nathan Sidwell + + * parse.y (primary): Use build_functional_cast for CV_QUALIFIER. + +1999-09-20 Nick Clifton + + * decl2.c (lang_decode_option): Extend comment. + +Mon Sep 20 10:49:05 1999 Bernd Schmidt + + * typeck.c: Include "tm_p.h". + +1999-09-19 Mark Mitchell + + * ir.texi: New file. + +1999-09-19 Paul Burchard + + * semantics.c (expand_stmt): Initialize return value. + +1999-09-18 Paul Burchard + + * gxxint.texi: G++ now implements namespaces. + +1999-09-18 Mark Mitchell + + * decl.c (pop_label): Don't warn about unused labels more than + once. + * semantics.c (finish_goto_stmt): Always marked used labels as + used. + + * decl.c (layout_var_decl): Change prototype. Call layout_decl + even when the declaration is external. + (cp_finish_decl): Adjust call to layout_var_decl. + * pt.c (tsubst_expr): Make sure to initialize stmt before using it. + +1999-09-18 Martin von Loewis + + * typeck.c (get_member_function_from_ptrfunc): Always consider + virtuality inside member pointer. + +1999-09-17 Mark Mitchell + + Turn on function-at-a-time processing. + * cp-tree.h (doing_semantic_analysis_p): New macro. + (SF_DEFAULT): Define to zero, not SF_EXPAND. + (start_handler_parms): Change prototype. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Likewise. + (expand_start_eh_spec): Likewise. + (expand_end_eh_spec): Declare. + (finish_handler_parms): Change prototype. + (begin_catch_block): Declare. + (finish_handler): Change prototype. + (do_pushlevel): Declare. + (do_poplevel): Likewise. + * decl.c (pushlevel): Don't create + binding levels when not doing semantic analysis. + (poplevel): Don't pop them. + (pushdecl): Assert that we are never called when not doing + semantic analysis. + (pushdecl_top_level): Use push_to_top_level. + (make_label_decl): Don't fiddle with obstacks. Make RTL For the + label when expanding. + (cp_finish_decl): Only inject for-scope variables when doing + semantic analysis. Add comments. + (start_handler_parms): Return the handler parm. + (start_function): Reorganize. Don't clear DECL_INITIAL if it is + already set. Reinitialize from saved function data if available. + Don't pushlevel when not doing semantic analysis. + (store_parm_decls): Only generate RTL when expanding. Only + pushdecl when doing semantic analysis. Set + current_eh_spec_try_block if appropriate. + (finish_function): Simplify. Use do_pushlevel and do_poplevel. + Combine common code. Don't poplevel when not doing semantic + analysis. + (push_cp_function_context): Don't expand functions without an + explicit call to expand_body. + (mark_lang_function): Make eh_spec_try_block and + x_scope_stmt_stack. + * except.c (expand_end_eh_spec): Don't + declare. + (process_start_catch_block): Likewise. + (push_eh_cleanup): Use finish_decl_cleanup. + (initialize_handler_parm): New function. + (expand_start_catch_block): Use it. + (expand_end_catch_block): Use tree-generation functions, not + RTL-generation functions. + (expand_start_eh_spec): Likewise. + (expand_end_eh_spec): Likewise. + (expand_exception_blocks): Simplify. + (start_anon_func): Use do_pushlevel. + (end_anon_func): Use do_poplvel. Call expand_body for the + function. + * expr.c (do_case): Don't call define_case_label. + * init.c (create_temporary_var): Set DECL_CONTEXT for local + variables. + * method.c (emit_thunk): Call expand_body for the + thunk. + (sythesize_method): Likewise. + * parse.y (handler_args): Give it ttype. + (eat_saved_input): Call expand_body. + (base_init): Use do_pushlevel. + (pending_inline): Call expand_body. + (handler): Adjust calls to finish_handler_parms and + finish_handler. + (handler_args): Don't call expand_start_catch_block. Return the + catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. + * parse.c: Regenerated. + * rtti.c (synthesize_tinfo_fn): Call finish_function. + * semantics.c (do_pushlevel): Give it external linkage. Build + SCOPE_STMTs. + (do_poplevel): Likewise. + (finish_case_label): Call define_case_label when doing semantic + analysis. + (finish_goto_stmt): Create RTL for labels. + (finish_function_try_block): Set in_function_try_handler + unconditionally. + (finish_function_handler_sequence): Unset it. + (finish_handler_parms): Use expand_start_catch_block even when + building a statement-tree. + (begin_catch_block): New function. + (finish_handler): Move a little RTL-generation logic here. + (finish_decl_cleanup): Allow cleanups for empty declarations. + (finish_named_return_value): Don't pushdecl when not doing + semantic analysis. + (expand_stmt): Don't do semantic analysis for variable + declarations. Handle START_CATCH_STMT. Call expand_label + directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust + HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. + (expand_body): Let expand_stmt handle CTOR_INITIALIZER, + RETURN_INIT and function try blocks. + + * cp-tree.h (language_function): Add x_eh_spec_try_block. Add + x_scope_stmt_stack. Add x_in_charge_parm. + (current_eh_spec_try_block): New macro. + (current_scope_stmt_stack): Likewise. + (current_in_charge_parm): Likewise. + * decl.c (start_function): Initialize current_in_charge_parm. + (finish_function): Use current_in_charge_parm rather than looking + up __in_chrg. + * search.c (expand_indirect_vtbls_init): Likewise. + + * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. + (TRY_BLOCK): Likewise. + (HANDLER): Likewise. + (START_CATCH_STMT): New tree node. + (SCOPE_STMT): Likewise. + * cp-tree.h (SCOPE_BEGIN_P): New macro. + (SCOPE_NULLIFIED_P): Likewise. + (struct lang_decl_flags): Add pending_inline_p. Adjust dummy. + (struct lang_decl): Add saved_language_function. + (DECL_PENDING_INLINE_INFO): Adjust documentation. + (DECL_PENDING_INLINE_P): New macro. + (TYPE_TI_ARGS): Fix typo in comment. + (DECL_SAVED_TREE): Add to documentation. + (DECL_SAVED_FUNCTION_DATA): New macro. + (START_CATCH_TYPE): Likewise. + (SCOPE_END_P): New macro. + (declare_parm_level): Don't declare. + * decl.c (mark_lang_function): New function, split out from + mark_cp_function_context. + (save_function_data): New function. + (declare_parm_level): Remove. + (finish_function): Use save_function_data to squirrel away + important stuff for later use. + (mark_cp_function_context): Use mark_function_data. + (lang_mark_tree): Likewise. + * lex.c (begin_definition_of_inclass_inline): Set + DECL_PENDING_INLINE_P. + (store_pending_inline): Clear it. + * pt.c (tsubst_decl): Likewise. + +1999-09-17 Nathan Sidwell + + * call.c (perform_implicit_conversion): Deal with error_mark_node. + +1999-09-17 Mark Mitchell + + * decl.c (warn_extern_redeclared_static): Don't get confused by + static member functions. + (duplicate_decls): Merge DECL_THIS_STATIC. + + * decl.c (expand_static_init): Make sure assignments to local + statics actually occur. + +1999-09-17 Mark Mitchell + + * cp-tree.h (poplevel_class): Declare. + * class.c (popclass): Use poplevel_class, not poplevel. + * decl.c (poplevel_class): Don't make it static. Don't return a + value. + (poplevel): Don't call poplevel_class; abort in a class + binding level is seen. + * semantics.c (finish_translation_unit): Use pop_everything. + * parse.y (member_init): Allow errors. + (pending_inline): Call finish_function. + * parse.c: Regenerated. + * Makefile.in (CONFLICTS): Adjust. + +1999-09-17 Gabriel Dos Reis + + * error.c: Reduce code duplication. + (dump_template_value): New function. + (dump_type_real): Use it. + (dump_decl): Likewise. + (dump_function_name): Likewise. + (dump_function_decl): Don't be too talkative about function return + type variety. + +1999-09-16 Kaveh R. Ghazi + + * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero. + + * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy. + +1999-09-16 Jason Merrill + + * decl2.c (finish_file): Also call check_global_declarations for + the pending_statics list. + +1999-09-15 Jason Merrill + + * lex.c (cp_pragma_implementation): Allow #pragma implementation + in header files. + +1999-09-15 Richard Henderson + + * lex.c (mark_impl_file_chain): Follow the next chain. + +1999-09-15 Mark Mitchell + + * decl.c (warn_extern_redeclared_static): Simplify. Catch + problems with extern "C" functions redeclared as static. + (duplicate_decls): When a builtin is redeclared static, make the + new function have internal linkage. + +1999-09-15 Mark Mitchell + + * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR. + * pt.c (tsubst_copy): Likewise. + * tree.c (search_tree): Likewise. + (mapcar): Likewise. + +1999-09-15 Kaveh R. Ghazi + + * typeck2.c (ack): Don't declare progname. + +1999-09-14 Alexandre Oliva + + * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy + filenames with ggc_alloc_string. + +1999-09-14 Mark Mitchell + + * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the + TARGET_EXPR. + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on + the TARGET_EXPR. + * cvt.c (build_up_reference): Likewise. + * tree.c (build_cplus_new): Likewise. + (get_target_expr): Likewise. + +Tue Sep 14 01:45:10 1999 Marc Espie + + * Makefile.in: Prepend $(SHELL) to move-if-change calls. + +1999-09-13 Mark Mitchell + + * cp-tree.h (build_target_expr): New function. + * call.c (build_conditional_expr): Use build_target_expr. + (convert_like): Likewise. + (build_over_call): Likewise. + * cvt.c (build_up_reference): Likewise. + * decl.c (build_cleanup_on_safe_obstack): Fold into ... + (destroy_local_var): Here. + (build_target_expr): New function. + * tree.c (build_cplus_new): Use it. + (get_target_expr): Likewise. + +1999-09-13 Nathan Sidwell + + * typeck.c (expr_sizeof): Don't decay arrays and functions. + Remove misleading comment. + (build_compound_expr): Don't decay arrays. + +1999-09-13 Jason Merrill + + * call.c (build_conditional_expr): Always use a TARGET_EXPR for + class rvalues again. + +Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi + + * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. + + * g++spec.c: Include gcc.h. + (lang_specific_driver): Constify a char*. Call xcalloc, not + xmalloc/bzero. All calls to the function pointer parameter now + explicitly call `fatal'. + +1999-09-12 Mark Mitchell + + * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs. + * cvt.c (ocp_convert): Complete the from and destination types. + Adjust warning about functions always being `true' in conditionals. + * decl.c (duplicate_decls): Don't play funny games with abort. + * error.c (dump_expr): Handle OVERLOADs. + * spew.c (probe_obstack): Remove. + * typeck.c (condition_conversion): Use perform_implicit_conversion. + +1999-09-12 Bernd Schmidt + + * cp-tree.h (auto_function, define_function): Adjust prototypes. + * decl.c (define_function): Lose FUNCTION_CODE arg. All callers + changed. + (auto_function): Likewise, for CODE arg. + Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to... + (builtin_function): ... here. + +1999-09-11 Mark Mitchell + + * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion. + (init_decl_processing): Don't set TREE_PERMANENT for the + error_mark_node. + (start_decl): Don't rebuild non-permanent ARRAY_TYPEs. + (grokdeclarator): Likewise. + (grokparms): Don't check TREE_PERMANENT when building up lists. + * decl2.c (grokfield): Don't assert TREE_PERMANENT. + (mark_inline_for_output): Likewise. + * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT. + * init.c (build_offset_ref): Don't check TREE_PERMANENT. + * lex.c (check_newline): Don't check ggc_p; it is always one. + * pt.c (process_template_parm): Don't check TREE_PERMANENT. + * spew.c (yylex): Don't copy_node or probe_obstacks for + non-permanent CONSTANTs and STRINGs. + * tree.c (build_cplus_array_type_1): Don't fuss with + TREE_PERMANENT on ARRAY_TYPEs. + + * cp-tree.def (CLEANUP_STMT): New node. + * cp-tree.h (language_function): Add name_declared. + (current_function_name_declared): New macro. + (CLEANUP_DECL): New macro. + (CLEANUP_EXPR): Likewise. + (emit_local_var): Likewise. + (finish_decl_cleanup): New function. + * cvt.c (build_up_reference): Simplify. + (ocp_convert): Remove dead code. + * decl.c (start_decl): Remove call to add_decl_stmt. + (grok_reference_init): Adjust, to handle bindings temporaries to + references. Remove dead code. + (initialize_local_var): Don't generate RTL for + declarations here, or build cleanups here. Don't fuss with + obstacks. Replace expand_start_target_temps calls with explicit + setting of stms_are_full_exprs_p. + (destroy_local_var): New function. + (emit_local_var): Likewise. + (cp_finish_decl): Use them, as appropriate. + (start_function): Announce template functions. + (store_parm_decls): Don't call declare_function_name here. + (finish_stmt): Don't start emit base-initialization code when just + building the statement-tree. + * init.c (create_temporary_var): Move add_decl_stmt call ... + (get_temp_regvar): Here. + * pt.c (tsubst_expr): Make DECL_INITIAL look like what + cp_finish_decl would expect. Don't call add_decl_stmt. + * semantics.c (begin_compound_stmt): Call declare_function_name, + if appropriate. + (finish_decl_cleanup): New function. + (expand_stmt): Use emit_local_var to output variables. + (expand_body): Set current_function_name_declared. + +1999-09-10 Mark Mitchell + + * cp-tree.h (finish_cleanup_try_block): New function. + * semantics.c (finish_cleanup_try_block): Add comment. + +Fri Sep 10 10:32:32 1999 Bernd Schmidt + + * cp-tree.h: Delete declarations for all tree nodes now moved to + global_trees. + * decl.c: Delete their definitions. + (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, + FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't + provide defaults. + (init_decl_processing): Call build_common_tree_nodes and + build_common_tree_nodes_2 instead of building their nodes here. + Don't add gc roots for them. + +1999-09-10 Mark Mitchell + + * cp-tree.h (language_function): Rename expanding_p to + x_expanding_p. Rename named_label_uses to x_named_label_uses. + (expanding_p): Adjust accordingly. + (TREE_VIA_PRIVATE): Fix typo in comment. + (DECL_REFERENCE_SLOT): Remove. + (SET_DECL_REFERENCE_SLOT): Likewise. + * decl.c (named_label_uses): Adjust. Remove chicken comment. + (push_overloaded_decl): Don't truncate the chain of bindings when + adding an overloaded function. + (grok_reference_init): Don't use DECL_REFERENCE_SLOT. + (initialize_local_var): Fix typo in comment. + (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up. + * decl2.c (start_objects): Make the fact that we are expanding + the generated function right away explicit. + (start_static_storage_duration_function): Likewise. + (finish_file): Fix typo in comment. + * init.c (build_vec_init): Correct bugs in handling cleanups. + * semantics.c (maybe_convert_cond): New function. + (FINISH_COND): Always store the condition, even if there's + a declaration. + (finish_if_stmt_cond): Use maybe_convert_cond. + (finish_while_stmt_cond): Likewise. + (finish_do_stmt): Likewise. + (finish_for_cond): Likewise. + (expand_cond): Adjust. + + * cp-tree.h (FN_TRY_BLOCK_P): New macro. + * init.c (perform_member_init): Remove obstack machinations. + (expand_cleanup_for_base): Likewise. + (finish_init_stmts): Mark the statement-expression as used. + * method.c (emit_thunk): Use tree-generating functions, not + RTL. + (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + (synthesize_method): Likewise. Keep track of line numbers. + * pt.c (tsubst_expr): Handle various kinds of try blocks. + * semantics.c (expand_stmts): Remove. + (begin_function_try_block): Set FN_TRY_BLOCK_P. + (finish_function_try_block): Be careful rechaining + function try blocks. + (expand_stmt): Loop through all the statements at a given level. + (exapnd_body): Be careful with line-numbers here too. Prepare for + being called directly from the parser. + + * cp-tree.h (finish_function): Adjust prototype. + * decl.c (finish_function): Return the function compiled. + * pt.c (instantiate_decl): Don't play games with obstacks. + * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF. + (search_tree): Likewise. + * typeck.c: Fix typo in comment. + * typeck2.c (store_init_value): Add comment. + + * cp-tree.h (CPTI_ATEXIT): New macro. + (atexit_node): Likewise. + * decl.c (destroy_local_static): New function, broken out from ... + (expand_static_init): Here. + + * rtti.c (get_tinfo_var): These should always be global + (expand_si_desc): Use tree, not RTL, functions to generate code. + (expand_class_desc): Likewise. + (expand_ptr_desc): Likewise. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + +1999-09-09 Mark Mitchell + + * semantics.c (RECHAIN_STMTS): Remove `last' parameter. + (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with + RECHAIN_STMTS. + (RECHAIN_STMST_FROM_CHAIN): Likewise. + + * parse.y (simple_stmt): Fix typo in last change. + + * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro. + (STMT_IS_FULL_EXPR_P): Likewise. + (STMT_LINENO_FOR_FN_P): Likewise. + (prep_stmt): New function. + (building_stmt_tree): Tweak for safety. + * pt.c (tsubst_expr): Use prep_stmt throughout. + (add_tree): Move it to semantics.c + * semantics.c (add_tree): Move it here. + (finish_expr_stmt_real): New function. + (finish_expr_stmt): Use it. + (finish_if_stmt_cond): Use FINISH_COND. + (finish_while_stmt_cond): Likewise. + (finish_for_cond): Likewise. + (finish_stmt_tree): Tweak line-number handling. + (prep_stmt): New function. + (expand_stmt): Use it. + + * cp-tree.h (begin_switch_stmt): Adjust prototype. + (finish_switch_cond): Likewise. + * parse.y (simple_stmt): Adjust accordingly. + * parse.c: Regenerated. + * pt.c (tsubst_expr): Adjust accordingly. + * semantics.c (expand_cond): New function. + (FINISH_COND): New macro. + (begin_switch_stmt): Build the SWITCH_STMT here. + (finish_switch_stmt_cond): Not here. + (expand_stmt): Adjust calls to begin_switch_stmt and + finish_switch_cond. Use expand_cond throughout. + + * dump.c (dequeue_and_dump): Dump types for constants. + Describe DECL_ARG_TYPE more intuitively. + Handle ARRAY_REF. + + * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC. + (lang_cleanup_tree): Remove. + * lex.c (make_lang_type): Use ggc_alloc to allocate + TYPE_LANG_SPECIFIC. + + Reorganize per-function data. + * cp-tree.h (saved_scope): Add function_decl, bindings. + (language_function): Rename binding_level to bindings. + (cp_function_chain): Use the current_function, not the + outer_function_chain. + (current_class_ptr): Make it work, even when there's no + current function. + (current_class_ref): Likewise. + (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New + macros. + (clear_temp_name): Remove. + * decl.c (check_function_type): New function, broken out from + start_function. + (current_binding_level): Adjust definition. + (pushlevel): Simplify. + (poplevel): Don't use named_label_uses when we're outside + a function scope. + (mark_saved_scope): Mark function_decl and bindings. + (maybe_push_to_top_level): Don't unconditionally push a new + function context. Save bindings and the current_function_decl. + Don't clear named_labels. + (pop_from_top_level): Pop function context if appropriate. + (init_decl_processing): Set init_lang_status and free_lang_status, + rather than save_lang_status and restore_lang_status. + (start_function): Take SF_* flags. Don't clear per-function data. + Reorder and simplify to use new per-function data code. Add + asserts. + (store_parm_decls): Don't call init_function_start here. + (finish_function): Adjust for new handling of per-function data. + (push_cp_function_context): Simplify. + (mark_cp_function_context): Change binding_level to bindings. + * decl2.c (clear_temp_name): Remove. + (start_objects): Use SF flags to start_function. + (start_static_storage_duration_function): Likewise. + * except.c (start_anon_func): Remove redundant calls to + push_function_context_to. Use SF flags to start function. + (end_anon_func): Remove redundant call to pop_function_context + from. + * lex.c (reinit_parse_for_function): Don't initialize per-function + data. + * method.c (emit_thunk): Clear current_function after calling + assemble_end_function. Use SF flags for start_function. + (synthesize_method): Use SF flags for start_function. + * parse.c: Regenerated. + * parse.y (fn.defpen): Likewise. + (pending_inline): Clear current_function, even if something goes + wrong. + * pt.c (instantiate_decl): Use SF flags to start_function. + Don't save and restore expanding_p. + (add_tree): Handle the case where we are outside any function. + (end_tree): Likewise. + * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function. + * semantics.c (begin_function_definition): Likewise. + (expand_body): Likewise. + +1999-09-09 Nathan Sidwell + + * cp-tree.h (convert_to_void): Prototype new function. + (require_complete_type_in_void): Remove prototype. + * cvt.c (convert_to_void): New function. + (ocp_convert): Use convert_to_void. + * decl.c (cplus_expand_expr_stmt): Likewise, for complete + expressions. + * typeck.c (require_complete_type_in_void): Remove function. + (build_compound_expr): Use convert_to_void. + (build_static_cast): Likewise. + (build_c_cast): Likewise. + * semantics.c (finish_expr_stmt): Do not decay full expressions. + + * typeck.c (build_x_compound_expr): Add FIXME. + +1999-09-08 Mark Mitchell + + * cp-tree.h (scratch_tree_cons): Remove. + * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons, + and perm_tree_cons with plain tree_cons. + * class.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * method.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + * parse.c: Regenerated. + * tree.c (build_srcloc): Simplify. + +1999-09-08 Bruce Korb autogen@linuxbox.com + + * Makefile.in: Give the gperf user a hint about why "gperf -F" fails. + +1999-09-08 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove permanent_attr. + Remove next. + (LANG_DECL_PERMANENT): Remove. + * decl.c (duplicate_decls): Don't mess about with obstacks trying + to free memory. + (lang_mark_tree): Mark DECL_LANG_SPECIFIC. + * lex.c (free_lang_decl_chain): Remove. + (build_lang_decl): Don't use obstacks. + (retrofit_lang_decl): Likewise. + (copy_lang_decl): Likewise. + + * cp-tree.h (saved_scope): Remove old_binding_level and + function_decl. Tidy up. + * decl.c (mark_saved_scope): Don't set them. + (maybe_push_to_top_level): Clear memory. + + * decl.c (layout_var_decl): Change prototype. Don't complete + types for external objects. + (check_initializer): Likewise. Tidy. + (initialize_local_var): Complete types here. + (cp_finish_decl): Not here. Reorganize a little. + (grokvardecl): Don't complete types here. + + * decl.c (start_function): Clear last_dtor_insn and + last_parm_cleanup_insn. + (push_cp_function_context): Just copy over a little of + the old context, not all of it. + + * cp-tree.h (copy_to_permanent): Remove. + (permanent_p): Likewise. + * decl.c (building_typename_type): Don't use copy_to_permanent. + (start_decl): Likewise. + (grok_reference_init): Likewise. + (cp_finish_decl): Likewise. + * init.c (build_new_1): Don't use mapcar. + (build_vec_delete_1): Don't use copy_to_permanent. + (build_vec_init): Likewise. + * parse.y (primary): Likewise. + * parse.c: Regenerated. + * pt.c (push_template_decl_real): Don't use copy_to_permanent. + (lookup_template_class): Likewise. + (tsubst_friend_function): Likewise. + (instantiate_class_template): Likewise. + (tsubst_decl): Likewise. + (tsubst): Likewise. + (instantiate_template): Likewise. + (unify): Likewise. + * rtti.c (get_tinfo_fn): Likewise. + (build_dynamic_cast): Likewise. + * semantics.c (finish_if_stmt_cond): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_do_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_cleanup): Likewise. + (add_decl_stmt): Likewise. + (finish_named_return_value): Likewise. + (finish_qualified_call_expr): Likewise. + * tree.c (perm_manip): Remove. + (build_exception_variant): Don't use copy_to_permanent. + (permanent_p): Remove. + (copy_to_permament): Remove. + (build_min_nt): Don't use copy_to_permanent. + (build_min): Likewise. + (min_tree_cons): Likewise. + * typeckc.c (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + +1999-09-07 Mark Mitchell + + * decl.c (ggc_p): Set it to 1. + (mark_saved_scope): Add prototype. + +1999-09-07 Richard Henderson + + * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete. + * typeck.c (self_promoting_args_p): Delete. + +1999-09-07 Jason Merrill + + * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. + (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove. + +1999-09-07 Mark Mitchell + + * Makefile.in (tree.o): Depend on ggc.h. + * class.c (make_method_vec): Remove. + (free_method_vec): Likewise. + (free_method_vecs): Remove. + (add_method): Don't use them. + * cp-tree.def (PTRMEM_CST): Make it longer. + (TEMPLATE_PARM_INDEX): Make it shorter. + * cp-tree.h (BINDING_HAS_LEVEL_P): New macro. + (template_parm_index): Remove RTL field. + (ptrmem_cst): Add RTL field. + (finish_function): Removed parameter. + (process_next_inline): Change prototype. + (init_cplus_unsave): Rename to init_tree. + (binding_init): Remove. + * decl.c (free_binding_nodes): Remove. + (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P. + (pop_binding): Don't use free_binding_nodes. + (free_binding_vecs): Remove. + (store_bindings): Don't use them. + (pop_from_top_level): Likewise. + (lookup_namespace_name): Simplify. + (build_typename_type): Don't use obstack_free. + (unqualified_namespace_lookup): Simplify. + (lookup_name_real): Simplify. + (start_function): Remove comment about leaks. + (finish_function): Removed nested parameter. Call + expand_end_bindings even when building_stmt_tree. + Call ggc_push_context and ggc_pop_context around + rest_of_compilation, if necessary. + (mark_cp_function_context): Handle a NULL language-context. + (lang_mark_false_label_stack): Fix typo. + (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD, + TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on + pointer to method types. + (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC. + * decl2.c (finish_objects): Adjust call to finish_function. + (finish_static_store_duration_function): Likewise. + (do_nonmember_using_decl): Remove call to binding_init. + * except.c (end_anon_func): Adjust call to finish_function. + * lex.c (mark_impl_file_chain): New function. + (init_parse): Call init_tree, not init_cplus_unsave. + Add GC roots. + (cp_pramga_interface): Use xmalloc, not permalloc. + (cp_pragma_implementation): Likewise. + (begin_definition_of_inclass_inline): Simplify. + (process_next_inline): Adjust prototype. + (do_scoped_id): Don't call binding_init. + (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc. + * method.c (emit_thunk): Adjust call to finish_function. + (synthesize_method): Likewise. + * parse.y (%union): Add a new `pi' variant. + (PRE_PARSED_FUNCTION_DECL): Use it. + (fn.defpen): Likewise. + (fndef): Adjust call to finish_function. + * pt.c (instantiate_decl): Likewise. + * rtti.c (syntheisze_tinfo_fn): Likewise. + * semantics.c (expand_body): Likewise. + * tree.c: Include ggc.h. + (mark_list_hash): New function. + (binding_init): Remove. + (init_cplus_unsave): Rename to ... + (init_tree): This. Add GC roots. + +1999-09-05 Mark Mitchell + + Get ready for garbage collection. + * Makefile.in (CXX_TREE_H): Add varray.h + (lex.o): Depend on ggc.h. + (decl.o): Likewise. + (decl2.o): Likewise. + (method.o): Likewise. + (search.o): Likewise. + (pt.o): Likewise. + (repo.o): Likewise. + * class.c: Include ggc.h. + (current_class_name): Remove. + (current_class_type): Likewise. + (current_access_specifier): Likewise. + (previous_class_type): Likewise. + (previous_class_values): Likewise. + (class_cache_firstobj): Likewise. + (current_lang_base): Likewise. + (current_lang_stack): Likewise. + (current_lang_stacksize): Likewise. + (lang_name_c): Likewise. + (lang_name_cplusplus): Likewise. + (lang_name_java): Likewise. + (current_lang_name): Likewise. + (base_layout_decl): Likewise. + (access_default_node): Likewise. + (access_public_node): Likewise. + (access_protected_node): Likewise. + (access_private_node): Likewise. + (access_default_virtual_node): Likewise. + (access_public_virtual_node): Likewise. + (access_protected_virtual_node): Likewise. + (access_private_virtual_node): Likewise. + (signed_zero_node): Likewise. + (init_class_processing): Don't build base_layout_decl. + (push_lang_context): Adjust now that current_lang_base is a varray. + (pop_lang_context): Likewise. + * cp-tree.h: Include varray.h. + (cp_global_trees): Add access_default, access_public, + access_protected, access_private, access_default_virtual, + access_public_virtual, access_protected_virtual, + access_private_virtual, ctor_identifier, delta2_identifier, + delta_identifier, dtor_identifier, in_charge_identifier, + index_identifier, nelts_identifier, this_identifier, + pfn_identifier, pfn_or_delta2_identifier, vptr_identifier, + lang_name_c, lang_name_cplusplus, lang_name_java, + empty_except_spec, null, jclass, minus_one, terminate. + (saved_scope): Move here from decl.c. Define globals in terms of + saved_scope: current_namespace, current_class_name, + current_class_type, current_access_specifier, current_lang_stack, + current_lang_base, current_lang_name, current_function_parms, + current_template_parms, processing_template_decl, + processing_specialization, processing_explicit_instantiation, + previous_class_type, previous_class_values, class_cache_firstobj. + (scope_chain): New variable. + (init_pt): New function. + * decl.c (current_namespace): Remove. + (this_identifier, in_charge_identifier, ctor_identifier): Likewise. + (dtor_identifier, pfn_identifier, index_identifier): Likewise. + (delta_identifier, delta2_identifier): Likewise. + (pfn_or_delta2_identifier, tag_identifier): Likewise + (vt_off_identifier, empty_except_spec, null_node): Likewise. + (current_function_parms, current_lang_base): Remove. + (current_lang_stack, previous_class_values): Remove. + (class_binding_level): Macroize. + (saved_scope): Remove. + (current_saved_scope): Rename to scope_chain. + (mark_saved_scope): Adjust for new scope structure. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (duplicate_decls): Adjust now that current_lang_base is a varray. + (build_typename_type): Call ggc_add_tree_hash_table_root. + (init_decl_processing): Call init_pt. Call push_to_top_level to + set up globals. Add GC roots. + (xref_basetypes): Adjust now that current_lang_base is a varray. + * decl.h (this_identifier): Remove. + (in_charge_identifier): Likewise. + * decl2.c: Don't include varray.h. + (current_namespace): Remove. + (init_decl2): Add GC roots. + * except.c (Terminate): Remove. + (init_exception_processing): Use terminate_node instead. + (build_terminate_handler): Likewise. + * init.c (nc_nelts_field_id): Remove. + (minus_one): Likewise. + (init_init_processing): Use minus_one_node and nelts_identifier + instead. Add GC roots. + (jclass_node): Remove. + (build_new_1): Use nelts_identifier. + (build_vec_init): Likewise. + (build_vec_delete): Likewise. + * lex.c: Include ggc.h. + (defarg_fn): Move declaration early. + (defarg_parms): Likewise. + (init_parse): Add GC roots. + (handle_cp_pragma): Remove redundant declaration of + pending_vtables. + * method.c: Include ggc.h. + (btypelist): Make it a varray. All uses changed. + (ktypelist): Likewise. + (init_method): Add GC roots. + * pt.c: Don't include varray.h. Include ggc.h. + (current_template_parms): Remove. + (processing_template_decl): Likewise. + (processing_specialization): Likewise. + (processing_explicit_instantiation): Likewise. + (init_pt): New function. + * repo.c: Include ggc.h. + (init_repo): Add GC roots. + * search.c: Don't include varray.h. + (_vptr_name): Remove. + (lookup_field_1): Use vtpr_identifier instead. + (expand_indirect_vtbls_init): Remove redundant declaration of + in_charge_identifier. + (init_search_processing): Use vptr_identifier. + +1999-09-05 Richard Henderson + Bernd Schmidt + Mark Mitchell + + * Makefile.in (parse.o): Depend on ggc.h. + (decl2.o): Depend on ggc.h. + (init.o): Depend on ggc.h. + * cp-tree.h (init_decl2): Declare. + (cp_parse_init): Likewise. + * decl.c (ggc_p): Define to zero. + (mark_saved_scope): New function. + (init_decl_processing): Call cp_parse_init, and cp_decl2. + Register GC roots. + (expand_static_init): Add GC roots. + * decl2.c: Include ggc.h. + (init_decl2): New function. + * init.c: Include ggc.h. + (init_init_processing): Add GC roots. + * parse.y: Include ggc.h. + (cp_parse_init): New function. + +1999-09-04 Mark Mitchell + + * decl.c (init_decl_processing): Set mark_lang_status. + (lang_mark_false_label_stack): Adjust prototype. + * decl2.c (grok_function_init): Remove extraneous declaration of + abort_fndecl. + + * Make-lang.in (cc1plus): Remove dependency on GGC. + * Makefile.in (OBJS): Don't mention ggc-simple.o. + (OBJDEPS): Don't mention ggc-simple.o. + + * Make-lang.in (cc1plus): Depend on $(GGC). + * Makefile.in (OBJS): Add ggc-simple.o. + (OBJDEPS): Likewise. + * cp-tree.h (language_function): Rename members to `x_' versions; + we now have x_named_labels, x_ctor_label, x_dtor_label, + x_base_init_list, x_member_init_list, x_base_init_expr, + x_current_class_ptr, x_current_class_ref, x_last_tree, + x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and + x_result_rtx. + (dtor_label, ctor_label, current_base_init_list, + current_member_init_list, base_init_expr, current_class_ptr, + current_class_ref, last_tree, last_expr_type): Adjust accordingly. + * decl.c: Include ggc.h. + (last_dtor_insn): Adjust to use x_ names. + (last_parm_cleanup_insn): Likewise. + (original_result_rtx): Likewise. + (named_labels): Likewise. + (mark_binding_level): New function. + (mark_cp_function_context): Likewise. + (mark_false_label_stack): Likewise. + (lang_mark_tree): Likewise. + (lang_cleanup_tree): Likewise. + +1999-09-03 Mark Mitchell + + * Makefile.in (CXX_TREE_H): Include function.h. + (decl.o): Don't depend on function.h. + (decl2.o): Likewise. + (typeck.o): Likewise. + (init.o): Likewise. + (method.o): Likewise. + * cp-tree.h: Include function.h. + (cp_function): Rename to language_function. Remove next. + (cp_function_chain): Make it a macro, not a variable. + (push_cp_function_context): Don't declare. + (pop_cp_function_context): Likewise. + * decl.c: Don't include function.h. + (push_cp_function_context): Make it static. Make it suitable for + a save_lang_status callback. + (pop_cp_function_context): Likewise. + (maybe_push_to_top_level): Call push_function_context_to, not + push_cp_function_context. + (pop_from_top_level): Call pop_function_context_from, not + pop_cp_function_context. + (init_decl_processing): Set save_lang_status and + restore_lang_status. Call push_function_context_to, not + push_cp_function_context. + (cp_function_chain): Remove. + * decl2.c: Don't include function.h. + * except.c: Don't include function.h. + (start_anon_func): Call push_function_context_to, not + push_cp_function_context. + (end_anon_func): Call pop_function_context_from, not + pop_cp_function_context. + * init.c: Don't include function.h. + * lex.c (begin_definition_of_inclass_inline): Call + push_function_context_to, not push_cp_function_context. + (process_next_inline): Call pop_function_context_from, not + pop_cp_function_context. + * method.c: Don't include function.h. + (synthesize_method): Call push_function_context_to, not + push_cp_function_context. Call pop_function_context_from, not + pop_cp_function_context. + * typeck.c: Don't include function.h. + + * decl.c (expand_static_init): Tweak handling of static + initializations for objects without constructors. + +1999-09-03 Nathan Sidwell + + * typeck.c (build_indirect_ref): Reject dereference of pointer to + void. + +1999-09-02 Mark Mitchell + + * cp-tree.h (cp_function): Move here, from decl.c. + (cp_function_chain): Declare. + (dtor_label): New macro, instead of variable. + (ctor_label): Likewise. + (current_base_init_list): Likewise. + (current_member_init_list): Likewise. + (base_init_expr): Likewise. + (current_class_ptr): Likewise. + (current_class_ref): Likewise. + (last_tree): Likewise. + (last_expr_type): Likewise. + (current_function_returns_value): Likewise. + (current_function_returns_null): Likewise. + (current_function_just_assigned_this): Likewise. + (current_function_parms_stored): Likewise. + (temp_name_counter): Likewise. + (static_labelno): Likewise. + (expanding_p): Likewise. + (stmts_are_full_exprs_p): Likewise. + (in_function_try_handler): Likewise. + (lang_type): Remove nested type_flags. All uses changed. + * call.c (ctor_label): Remove. + (dtor_label): Likewise. + * class.c (current_class_ptr): Remove. + (current_class_ref): Likewise. + * decl.c (static_labelno): Remove. + (dtor_label): Likewise. + (last_dtor_insn): New macro, instead of variable. + (last_parm_cleanup_insn): Likewise. + (original_result_rtx): Likewise. + (in_function_try_handler): Remove. + (named_label_uses): New macro, instead of variable. + (named_labels): Likewise. + (current_function_returns_value): Remove. + (current_function_returns_null): Likewise. + (current_function_assigns_this): New macro, instead of variable. + (current_function_just_assigned_this): Likewise. + (current_binding_level): Likewise. + (init_decl_processing): Call push_cp_function_context. + (cp_function): Move to cp-tree.h + (cp_function_chain): Make it global. + (temp_name_counter): Remove. + (push_cp_function_context): Simplify. + (pop_cp_function_context): Likewise. + * decl2.c (temp_name_counter): Remove. + * init_c (current_base_init_list): Likewise. + (current_member_init_list): Likewise. + (base_init_expr): Likewise. + * method.c (static_labelno): Likewise. + * pt.c (last_tree): Likewise. + * semantics.c (expanding_p): Likewise. + (stmts_are_full_exprs_p): Likewise. + (last_expr_type): Likewise. + * typeck.c (dtor_label): Likewise. + (ctor_label): Likewise. + +1999-09-01 Alex Samuel + + * decl2.c (arg_assoc_template_arg): New prototype. New function. + (arg_assoc_class): Use arg_assoc_template_arg for template + arguments. + (arg_assoc): Likewise. + * pt.c (mangle_class_name_for_template): Allow member template + template arguments. + +1999-09-02 Nathan Sidwell + + * call.c (build_conditional_expr): Warn on enum mismatches. + (convert_arg_to_ellipsis): Move non-pod check to after + conversion. + +1999-09-01 Kaveh R. Ghazi + + * gxx.gperf (hash, is_reserved_word): Add prototypes. + + * init.c (build_vec_init): Initialize variable `try_block'. + + * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts. + Likewise for bzero/memset. + (token_getch, token_put_back): Add static prototypes. Remove + `inline' from the definitions. + (retrofit_lang_decl): Call memset, not bzero, to avoid casts. + +1999-09-01 Mark Mitchell + + * cp-tree.h (lang_type): Move align into type_flags. + (CLASSTYPE_ALIGN): Adjust accordingly. + * call.c (direct_reference_binding): Remove misleading comment. + +1999-08-30 Kaveh R. Ghazi + + * parse.y (language_string): Constify. + +1999-08-30 Kaveh R. Ghazi + + * repo.c (getpwd): Don't prototype. + * xref.c (getpwd): Likewise + +1999-08-30 Kaveh R. Ghazi + + * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a. + Remove hacks for stuff which now comes from libiberty. + +1999-08-30 Jason Merrill + + * cp-tree.h (IS_AGGR_TYPE_2): Fix typo. + +1999-08-30 Mark Mitchell + + * cp-tree.h (begin_init_stmts): Declare. + (finish_init_stmts): Likewise. + * cvt.c (build_up_reference): Wrap the declaration of a temporary + in a statement-expression so that we will see it when expanding + tree structure later. + * init.c (begin_init_stmts): Don't make it static. + (finish_init_stmts): Likewise. + + * cp-tree.h (start_handler_parms): New function. + (expand_start_catch_block): Take only one parameter. + (start_handler_parms): New function. + * decl.c (start_handler_parms): Define it. + * except.c (process_start_catch_block): Take only one parameter. + Don't call grokdeclarator here. + (expand_start_catch_block): Don't call grokdeclarator here, + either. + * parse.y (handler_args): Adjust call to + expand_start_catch_block. Use start_handler_parms. + * pt.c (push_template_decl_real): Make permanent lists have + permanent elements. + (tsubst_expr): Adjust calls to expand_start_catch_block + appropriately. + * semantics.c (expand_stmt): Likewise. + +1999-08-29 Alex Samuel + + * pt.c (push_template_decl_real): Use template declaration from + class type if it exists. + +1999-08-29 Mark Mitchell + + * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition. + (maybe_inject_for_scope_var): Declare it. + (initialize_local_var): Likewise. + * decl.c (maybe_inject_for_scope_var): Make it global. + (initialize_local_var): Likewise. Move cleanup handling here, + from cp_finish_decl. + (make_rtl_for_nonlocal_decl): Use + push_obstacks_nochange/pop_obstacks, rather than + end_temporary_allocation/resume_temporary_allocation. + (cp_finish_decl): Try to complete the type of a variable when it + is declared. Move cleanup-handling to initialize_local_var. + (expand_static_init): Use tree-building code, rather than + RTL-building code. + * decl2.c (get_temp_name): Assert non-initializedness of + temporaries. + * init.c (create_temporary_var): Move RTL-assigning code to ... + (get_temp_regvar): Here. + * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here. + * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just + call initialize_local_var to generate initialization code. + +1999-08-29 Kaveh R. Ghazi + + * cp-tree.h (fndecl_as_string, type_as_string, + type_as_string_real, args_as_string, decl_as_string, + expr_as_string, code_as_string, language_as_string, + parm_as_string, op_as_string, assop_as_string, cv_as_string, + lang_decl_name, cp_file_of, lang_printable_name): Constify a char*. + + * errfn.c (cp_printer): Likewise. + + * error.c (cp_printer, fndecl_as_string, type_as_string_real, + type_as_string, expr_as_string, decl_as_string, lang_decl_name, + cp_file_of, code_as_string, language_as_string, parm_as_string, + op_as_string, assop_as_string, args_as_string, cv_as_string): + Likewise. + + * tree.c (lang_printable_name): Likewise. + +1999-08-28 Richard Henderson + + * decl2.c (arg_assoc_class): Bail if the class is a builtin type. + +1999-08-28 Mark Mitchell + + * cp-tree.h (strip_array_types): New function. + * decl.c (maybe_deduce_size_from_array_init): New function, split + out from cp_finish_decl. + (layout_var_decl): Likewise. + (maybe_commonize_var): Likewise. + (maybe_inject_for_scope_var): Likewise. + (initialize_local_var): Likewise. + (build_cleanup_on_safe_obstack): Likewise. + (check_initializer): Likewise. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Use them. + * typeck.c (strip_array_types): New function. + + * cp-tree.def (LABEL_STMT): New tree node. + * cp-tree.h (LABEL_STMT_LABEL): New macro. + (shadow_label): Remove. + (declare_local_label): New function. + (finish_label_decl): Likewise. + * decl.c (make_label_decl): New function, split out from + lookup_label. + (shadowed_labels): Remove. + (binding_level): Add shadowed_labels. + (clear_binding_level): Remove. + (push_binding_level): Just bzero the new binding level. + (pushlevel): Fix indentation. + (pop_label): New function. + (pop_labels): Likewise, split out from poplevel. + (poplevel): Pop local labels. Use pop_labels. + (maybe_push_to_top_level): Don't clear shadowed_labels. + (lookup_label): Use make_label_decl. + (shadow_label): Remove. + (declare_local_label): New function. + (define_label): Simplify. + (start_function): Don't clear shadowed_labels. + (cp_function): Remove shadowed_labels. + (push_cp_function_context): Don't save shadowed_labels. + (pop_cp_function_context): Don't restore it. + * dump.c (dequeue_and_dump): Handle LABEL_STMT. + * parse.y (label_decl): Use finish_label_decl. + * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label + declarations. + * semantics.c (finish_label_stmt): Add a LABEL_STMT when + building_stmt_tree. + (finish_label_decl): New function. + (expand_stmt): Handle LABEL_STMTs and local label declarations. + +1999-08-26 Mark Mitchell + + * decl.c (lookup_label): Build labels on the permanent obstack + when building statement trees. Don't build RTL for labels when + building statement trees. + * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when + building statement trees. + (finish_label_stmt): Likewise. + (expand_stmt): Adjust accordingly. + * pt.c (tsubst_expr); Likewise. + (do_decl_instantiation): Robustify. + + * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro. + * tree.c (build_cplus_new): Set it. + * expr.c (cplus_expand_expr): Use it. + * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR. + + * decl.c (store_parm_decls): Reset immediate_size_expand. + (finish_function): Likewise. + + * tree.c (cplus_unsave_expr_now): Don't return a value. + + * semantics.c (do_poplevel): Always initialize the return value. + +1999-08-26 Gavin Romig-Koch + + * cp-tree.h (cplus_unsave_expr_now) : Correct return type. + * tree.h (cplus_unsave_expr_now) : Same. + +1999-08-25 Mark Mitchell + + * decl.c (grokdeclarator): Amend comment. + * except.c (expand_start_catch_block): Call push_template_decl for + catch-block parameters. + * method.c (synthesize_method): Build an empty compound statement + for the body of a constructor. + +1999-08-25 Jason Merrill + + * tree.c (cp_build_qualified_type_real): If we're asking for the + same quals we already have, just return. + +1999-08-25 Mark Mitchell + + * cp-tree.def (SUBOBJECT): New tree node. + * cp-tree.h (CLEANUP_P): New macro. + (SUBOBJECT_CLEANUP): Likewise. + (keep_next_level): Add parameter. + (get_temp_regvar): Don't declare. + (emit_base_init): Remove parameter. + (expand_aggr_init): Rename to build_aggr_init. + (expand_vec_init): Rename to build_vec_init. + (do_pushlevel): Remove. + (do_poplevel): Likewise. + (finish_cleanup): New function. + (finish_subobject): Likewise. + (stmts_are_full_exprs_p): New variable. + * decl.c (keep_next_level): Add parameter. + (cp_finish_decl): Use build_aggr_init, not + expand_aggr_init. Use finish_expr_stmt to expand the code. + (expand_static_init): Use tree-generating, not RTL-generating, + functions to handle the initialization. + (start_function): Remove dead code. Always have a momentary + obstack inside the function, even before hitting the first curly + brace. + (cplus_expand_expr_stmt): Move calls to + expand_{start,end}_target_temps into semantics.c. + (cp_function): Add stmts_are_full_exprs_p. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + * decl2.c (get_temp_regvar): Move to init.c. + (do_static_initialization): Use build_{aggr,vec}_init. + (do_static_destruction): Fix typo in comment. + * dump.c (dequeue_and_dump): Handle INIT_EXPR. + * except.c (expand_throw): Use create_temporary_var. + * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. + * init.c (expand_vec_init_try_block): Remove. + (expand_vec_init_catch_clause): Likewise. + (get_temp_regvar): New function. + (begin_init_stmts): Likewise. + (finish_init_stmts): Likewise. + (perform_member_init): Use build_{aggr,vec}_init. Build up tree + structure here. + (emit_base_init): Likewise. Remove unused parameter. + (expand_virtual_init): Likewise. + (expand_cleanup_for_base): Use finish_subobject. + (expand_aggr_vbase_init_1): Simplify. + (construct_virtual_bases): Use tree-generating functions to build + up initialization. + (expand_aggr_init): Likewise. Rename to build_aggr_init. + (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + (expand_vec_init): Rename to build_vec_init. + * method.c (do_build_copy_constructor): Use tree-generating + functions. Don't call clear_last_expr. + (do_build_assign_ref): Likewise. + (synthesize_method): Call clear_last_expr here. + * parse.y (base_init): Don't call clear_last_expr here. + (nodecls): Likewise. + * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. + * semantics.c (do_pushlevel): Move to here. + (do_poplevel): Likewise. + (stmts_are_full_exprs_p): New variable. + (finish_expr_stmt): Handle logic for temoprary cleanup here. + (finish_for_stmt): Use finish_expr_stmt. + (finish_cleanup): New function. + (finish_function_try_block): Fix indentation. + (finish_subobject): New function. + (setup_vtbl_ptr): Call keep_next_level here. + (finish_stmt_expr): Handle a block with no scope inside the + statement-expression. + (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle + SUBOBJECT. + * tree.c (search_tree): Handle INIT_EXPR. + (mapcar): Likewise. + * typeck.c (build_modify_expr): Don't build an RTL_EXPR. + * typeck2.c (store_init_value): Change expand_aggr_init to + build_aggr_init in comment. + +1999-08-25 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump TARGET_EXPRs. + +1999-08-25 Nathan Sidwell + + * decl2.c (handle_class_head): Be graceful about additional + scope qualifiers. Adjust comments to reflect reality. + +1999-08-24 Jason Merrill + + * call.c (build_conditional_expr): Fix typo. + * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an + lvalue before trying to mess with the sides. + + * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly. + +Mon Aug 23 22:17:20 1999 Mumit Khan + + * g++spec.c (lang_specific_driver): Add room for NULL in arglist. + +1999-08-23 Jason Merrill + + * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2. + Return arbitrary pointer or NULL. + (check_eh_spec): Call __throw_type_match_rtti_2. + * tinfo.h (*::dcast): Return int. Add valp parm. + * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers. + * tinfo2.cc (__throw_type_match_rtti_2): Likewise. + (__throw_type_match_rtti): Now just a wrapper. + + * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind. + (init_exception_processing): Don't initialize them. + +1999-08-23 Paul Burchard + + * decl.c (check_default_argument): Fix typo. + +1999-08-22 Mark Mitchell + + * cp-tree.def (STMT_EXPR): Fix typo in node name. + + * dump.c (dump_next_stmt): New function. + (dequeue_and_dump): Use it. + + * pt.c (tsubst_copy): Make sure to initialize return value for a + STMT_EXPR, even when processing_template_decl. + * semantics.c (finish_stmt_expr): A statement-expression whose + last statement is not an expression-statement has type `void'. + +1999-08-20 Mark Mitchell + + * semantics.c (finish_stmt_expr): Fix typo in comment. + * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR. + (mapcar): Likewise. + * init.c (build_vec_delete_1): Make the children of a permanent + BIND_EXPR permanent. + * pt.c (register_specialization): Don't register a specialization + more than once. + +1999-08-18 Andrew Haley + + * method.c (process_overload_item): Call build_mangled_C9x_name () + for all integer parameter types larger than long long. + +1999-08-19 Mark Mitchell + + * pt.c (redeclare_class_template): Merge default template + arguments in both directions. + + * typeck.c (common_type): Undo 1999-08-18 change. Remove + compiler_error message. + +1999-08-19 Jason Merrill + + * cp-tree.h: Declare flag_use_repository. + * pt.c (do_decl_instantiation): Don't complain about duplicate + instantiation with -frepo. + (do_type_instantiation): Likewise. + + * pt.c (push_template_decl_real): Complain about everything + that isn't a valid template. + + * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't + affect inlines. + +1999-08-19 Mark Mitchell + + * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code. + * decl2.c (build_expr_from_tree): Handle it. + * error.c (dump_expr): Likewise. + * pt.c (for_each_template_parm): Likewise. + (tsubst_copy): Likewise. + * tree.c (search_tree): Likewise. + * semantics.c (finish_pseudo_destructor_call): Create it. + +1999-08-18 Mark Mitchell + + * search.c (setup_class_bindings): Robustify. + * typeck.c (common_type): Use same_type_p, not pointer equality, + to compare types. + + * cp-tree.h (build_lang_field_decl): Remove. + * class.c (build_vtable): Replace calls to build_lang_field_decl + with build_lang_decl. + (prepare_fresh_vtable): Likewise. + (finish_struct_1): Likewise. + (init_class_processing): Likewise. + * decl.c (push_using_decl): Likewise. + (init_decl_processing): Likewise. + (grokvardecl): Likewise. + (build_ptrmemfunc_type): Likewise. + (grokdeclarator): Likewise. + (build_enumerator): Likewise. + * decl2.c (grok_x_components): Likewise. + (do_class_using_decl): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * rtti.c (expand_class_decl): Likewise. + * tree.c (build_base_fields): Likewise. + (build_vbase_pointer_fields): Likewise. + * lex.c (build_lang_decl): Build declarations on the permanent + obstack if we're building statmeent trees. + (retrofit_lang_decl): Handle both the full lang_decl and also the + smaller lang_decl_flags here. + (build_lang_field_decl): Remove. + * pt.c (push_template_decl_real): Issue errors for variable + declarations that are not static members. + +1999-08-18 Richard Henderson + + * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too. + (mapcar): Likewise. + +1999-08-17 Mark Mitchell + + * cp-tree.h (back_end_hook): New variable. + * decl2.c (back_end_hook): Define it. + (finish_file): If it's non-NULL, call it. + + * decl.c (add_decl_to_level): New function. + (push_local_binding): Use it. + (find_binding): Fix typo in comment. + (pushdecl): Use add_decl_to_level. Put templates on the + corresponding namespace-scope binding levels. + * dump.c (dequeue_and_dump): Print the specializations of a + template. + * pt.c (push_template_decl_real): Don't push a template multiple + times. + +1999-08-17 Mark Mitchell + + * cp-tree.h (CALL_DECLARATOR_PARMS): New macro. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECARATOR_EXCEPTION_SPEC): Likewise. + * decl.c (grokdeclarator): Adjust to use them. + * decl2.c (grokfield): Likewise. + (reparse_absdcl_as_casts): Likewise. + * lex.c (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + * pt.c (tsubst): Likewise. + * tree.c (mapcar): Remove special hack to handle third operand of + a CALL_EXPR. + +1999-08-16 Mark Mitchell + + * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro. + * class.c (build_vtable): Use build_lang_field_decl to build the + VAR_DECLs for vtables. + (prepare_fresh_vtable): Likewise. + * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if + CAN_HAVE_FULL_LANG_DECL_P. + (push_using_decl): Use build_lang_decl to build USING_DECLs. + (grokdeclarator): Use build_lang_decl to build TYPE_DECLs. + * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P. + (build_lang_field_decl): Likewise. + (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much + to copy. + + * cp-tree.def (STMT_EXPR): New tree node. + * cp-tree.h (STMT_EXPR_STMT): New macro. + (store_return_init): Change prototype. + (finish_named_return_value): New function. + (expand_stmt): Likewise. + (expand_body): Likewise. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (expanding_p): New variable. + (last_expr_type): Likewise. + (building_stmt_tree): New macro. + * decl.c (start_function): Use building_stmt_tree, not + processing_template_decl, where appropriate. + (store_parm_decls): Likewise. + (store_return_init): Move most of the body to semantics.c. + (finish_function): Use building_stmt_tree. + (finish_stmt): Clear last_expr_type here. + (cp_function): Add expanding_p, last_tree, last_expr_type. + (push_cp_function_context): Save them. + (pop_cp_function_context): Restore them. + * decl2.c (setup_vtbl_ptr): Move to semantics.c. + * error.c (dump_expr): Handle STMT_EXPR. + * except.c (expand_start_catch_block): Use building_stmt_tree. + Use add_decl_stmt. + * expr.c (cplus_expand_expr): Handle STMT_EXPR. + (do_case): Move add_tree call to semantics.c. + * parse.y (return_init): Use finish_named_return_value. + (for.init.statement): Use finish_expr_stmt. + * parse.c: Regenerated. + * pt.c (do_pushlevel): Move to semantics.c. + (do_poplevel): Likewise. + (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. + (tsubst_expr): Don't expand all the way to RTL here. Handle + RETURN_INIT and CTOR_INITIALIZER. + (instantiate_decl): Call expand_body after tsubst'ing into + DECL_SAVED_TREE. + * semantics.c (expand_stmts): New function. + (expanding_p): New variable. + (last_expr_type): Likewise. + (finish_expr_stmt): Use building_stmt_tree. + (begin_if_stmt): Likewise. + (finish_if_stmt_cond): Likewise. + (finish_then_clause): Likewise. + (begin_else_clause): Likewise. + (finish_else_clause): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_while_stmt): Likewise. + (finish_do_body): Likewise. + (finish_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (fnish_for_init_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (finish_switch_cond): Likewise. + (finish_switch_stmt): Likewise. + (finish_case_label): Call add_tree here if necessary. + (finish_goto_statement): Use building_stmt_tree. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (finish_try_block): Likewise. + (finish_function_try_block): Likewise. + (finish_handler_sequence): Likewise. + (finish_function_handler_sequence): Likewise. + (begin_handler): Likewise. + (finish_handler_parms): Likewise. + (finish_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (finish_named_return_value): New function. + (setup_vtbl_ptr): Moved here from decl2.c. + (do_pushlevel): Moved here from pt.c. + (do_poplevel): Likewise. + (begin_stmt_expr): Use building_stmt_tree. + (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, + when building_stmt_tree. + (begin_stmt_tree): New function. + (finish_stmt_tree): Likewise. + (expand_stmt): Likewise. + (expand_body): Likewise. + * tree.c (build_cplus_method_type): Make sure the argument types + end up on the same obstack as the METHOD_TYPE. + (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, + THROW_EXPR, STMT_EXPR. + (mapcar): Break out common cases. Handle COMPOUND_EXPR, + MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than + sorry, if an unsupported node is encountered. + * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. + (c_expand_return): Don't call add_tree here. + +1999-08-15 Mark Mitchell + + * pt.c (check_default_tmpl_args): Don't check in local scopes. + (tsubst_decl): Make sure the declaration is on a saveable + obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local + variable. + (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs. + +1999-08-14 Jason Merrill + + Speed up Koenig lookup. + * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm + to return namespaces we've looked at. + * decl2.c (lookup_using_namespace): Likewise. + (add_function): Don't call ovl_member. + (lookup_arg_dependent): Initialize k.namespaces to the list of + namespaces seen in unqualified lookup. + * call.c (equal_functions): Move here from tree.c. + (joust): Use it to handle duplicate candidates. + * tree.c (ovl_member): Use ==. + +1999-08-13 Mark Mitchell + + * cp-tree.def (DECL_STMT): Make it smaller. + * cp-tree.h (lang_decl_flags): Move saved_tree to ... + (lang_decl): ... here. Add next. + (DECL_SAVED_TREE): Adjust accordingly. + (DECL_IMPLICIT_TYPEDEF_P): New macro. + (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. + (DECL_STMT_DECL): Likewise. + (create_implicit_typedef): New function. + (maybe_push_decl): Likewise. + (tsubst_default_argument): New function. + (at_function_scope_p): Likewise. + (add_decl_stmt): Likewise. + (push_permanent_obstack): Likewise. + * call.c (convert_default_arg): Use tsubst_default_argument. + * class.c (add_method): Use push_permanent_obstack. + (build_self_reference): Create a TEMPLATE_DECL for the + self-reference, if necessary. + * decl.c (pseudo_global_level_p): Only look at the current binding + level. + (push_binding): Use push_permanent_obstack. + (create_implicit_typedef): New function. + (pushtag): Use it. + (duplicate_decls): Use push_permanent_obstack. + (maybe_push_decl): New function. + (start_decl): Use it. Remove dead code. Use add_decl_stmt. + (start_decl_1): Remove dead code. + (cp_finish_decl): Remove DECL_STMT handling here. Don't use + pseudo_global_level_p. + (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a + template. + (grokdeclarator): Likewise, for TYPE_DECLs. Don't use + pseudo_global_level_p. + * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in + a template. + (get_sentry): Use push_permanent_obstack. + * dump.c (dequeue_and_dump): Enable DECL_STMT. + * except.c (call_eh_info): Use push_permanent_obstack. + (build_eh_type_ref): Likewise. + (do_pop_exception): Likewise. + (expand_eh_spec): Likewise. + (alloc_eh_object): Likewise. + (expand_throw): Likewise. + * init.c (build_java_class_ref): Likewise. + * lex.c (get_time_identifier): Likewise. + (free_lang_decl_chain): Correct type. + (retrofit_lang_decl): Adjust accordingly. + (build_lang_field_decl): Likewise. + * lex.h (free_lang_decl_chain): Likewise. + * parse.y (lang_extdef): Don't use pseudo_global_level_p. + * parse.c: Regenerated. + * pt.c (tsubst_default_arguments): New function. + (retrieve_local_specialization): Likewise. + (register_local_specialization): Likewise. + (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use + pseudo_global_level_p to determine whether or not a template is + primary. + (lookup_template_class): Likewise. Use create_implicit_typedef. + (instantiate_class_template): Call tsubst_default_arguments for + member functions, if appropriate. + (tsubst_default_argument): New function. + (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs. + * search.c (at_function_scope_p): New function. + * semantics.c (finish_asm_stmt): Use push_permanent_obstack. + (finish_label_stmt): Likewise. + (add_decl_stmt): New function. + (begin_class_definition): Likewise. + (finish_typeof): Likewise. + * tree.c (copy_template_template_parm): Likewise. + (copy_to_permanent): Likewise. + (push_permanent_obstack): Define. + (mark_addressable): Use it. + * typeck.c (mark_addressable): Likewise. + +1999-08-13 Gavin Romig-Koch + + * cp-tree.h (init_cplus_unsave): New. + (cplus_unsave_expr_now): New. + * lex.c (init_parse): Call init_cplus_unsave. + * tree.c (init_cplus_unsave): New. + (cplus_unsave_expr_now): New. + +1999-08-13 Mark Mitchell + + * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and + decl_constant_value to simplify array bounds. + +1999-08-11 Jason Merrill + + * lang-options.h: Add -fms-extensions. + * cp-tree.h: Declare flag_ms_extensions. + * decl2.c: Define it. + * class.c (instantiate_type): Don't complain about taking the address + of a bound member function if -fms-extensions. + * typeck.c (build_unary_op): Likewise. + * decl.c (grokdeclarator): Or about implicit int. + * init.c (resolve_offset_ref): Or about implicit '&'. + +1999-08-11 Mark Mitchell + + * cp-tree.h (minimal_parse_mode): Remove. + (finish_label_stmt): New function. + * decl.c (saved_scope): Remove minimal parse mode. + (maybe_push_to_top_level): Don't save it. + (pop_from_top_level): Don't restore it. + (define_label): Split out template-handling code to semantics.c. + (start_decl): Don't use minimal_parse_mode. + (cp_finish_decl): Likewise. + (start_function): Don't increment it. + (store_return_init): Don't use it. + (finish_function): Don't decrement it. + * parse.y (label_colon): Use finish_label_stmt throughout. + * parse.c: Regenerated. + * pt.c (minimal_parse_mode): Don't define it. + (tsubst_expr): Use finish_label_stmt. + * semantics.c (finish_label_stmt): New function. + + * dump.c (queue): Be careful when computing bitmasks. + (dequeue_and_dump): Describe binfos as binfos, not as + vectors. + + * parse.y (pedantic): Give it itype. Adjust usage accordingly + throughout. + * parse.c: Regenerated. + + * Make-lang.in (CXX_SRCS): Remove sig.c. + * Makefile.in (CXX_OBJS): Remove sig.o. + (sig.o): Remove. + * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. + (CPTI_SIGNATURE_TYPE): Likewise. + (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. + (opaque_type_node): Likewise. + (signature_type_node): Likewise. + (sigtable_entry_type): Likewise. + (flag_handle_signatures): Likewise. + (lang_type): Remove is_signature, is_signature_pointer, + is_signature_reference, has_opaque_typedecls, + sigtables_has_been_generated. Adjust dummy. Remove signature, + signature_pointer_to, signature_reference_to. + (IS_SIGNATURE): Remove. + (SET_SIGNATURE): Remove. + (CLEAR_SIGNATURE): Remove. + (IS_SIGNATURE_POINTER): Remove. + (IS_SIGNATURE_REFERENCE): Remove. + (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. + (SIGTABLE_HAS_BEEN_GENERATED): Remove. + (CLASSTYPE_SIGNATURE): Remove. + (SIGNATURE_TYPE): Remove. + (SIGNATURE_METHOD_VEC): Remove. + (SIGNATURE_POINTER_TO): Remove. + (SIGNATURE_REFERENCE_TO): Remove. + (lang_decl_flags): Remove is_default_implementation. Rename + memfunc_pointer_to to saved_tree. + (IS_DEFAULT_IMPLEMENTATION): Remove. + (DECL_MEMFUNC_POINTER_TO): Remove. + (DECL_MEMFUNC_POINTING_TO): Remove. + (DECL_SAVED_TREE): Adjust definition. + (tag_types): Remove signature_type_node. + (SIGNATURE_FIELD_NAME): Remove. + (SIGNATURE_FIELD_NAME_FORMAT): Likewise. + (SIGNATURE_OPTR_NAME): Likewise. + (SIGNATURE_SPTR_NAME): Likewise. + (SIGNATURE_POINTER_NAME): Likewise. + (SIGNATURE_POINTER_NAME_FORMAT): Likewise. + (SIGNATURE_REFERENCE_NAME): Likewise. + (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. + (SIGTABLE_PTR_TYPE): Likewise. + (SIGTABLE_NAME_FORMAT): Likewise. + (SIGTABLE_NAME_FORMAT_LONG): Likewise. + (SIGTABLE_TAG_NAME): Likewise. + (SIGTABLE_VB_OFF_NAME): Likewise. + (SIGTABLE_VT_OFF_NAME): Likewise. + (finish_base_specifiers): Change prototype. + (build_signature_pointer_type): Remove. + (build_signature_reference_type): Remove. + (build_signature_pointer_constructor): Remove. + (build_signature_method_call): Remove. + (build_optr_ref): Likewise. + (append_signature_fields): Likewise. + (signature_error): Likewise. + * call.c (build_this): Remove signature support. + (build_over_call): Likewise. + (build_new_method_call): Likewise. + * class.c (add_implicitly_declared_members): Likewise. + (finish_struct_1): Likewise. + (finish_struct): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_pointer_force): Likewise. + (ocp_convert): Likewise. + * decl.c (sigtable_decl_p): Remove. + (init_decl_processing): Remove support for signatures. + (cp_finish_decl): Likewise. + (grokdeclarator): Likewise. + (grokparms): Likewise. + (xref_tag): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl2.c (finish_sigtable_vardecl): Remove. + (flag_handle_signatures): Remove. + (lang_f_options): Remove handle-signatures. + (grokfield): Remove support for signatures. + (grokbitfield): Likewise. + (finish_file): Likewise. + (reparse_absdcl_as_casts): Likewise. + * error.c (dump_type_real): Likewise. + (dump_function_decl): Likewise. + * friend.c (make_friend_class): Likewise. + * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. + * hash.h: Regenerated. + * init.c (build_new_1): Remove support for signatures. + * lang-options.h: Remove -fhandle-signatures, + -fno-handle-signatures. + * lex.c (init_parse): Remove support for signatures. + (yyprint): Likewise. + * lex.h (rid): Remove RID_SIGNATURE. + * method.c (build_decl_overload_real): Remove support for + signatures. + (hack_identifier): Likewise. + * parse.y (base_class): Likewise. + (base_class.1): Likewise. + (access_specifier): Likewise. + * search.c (lookup_member): Likewise. + * semantics.c (finish_qualified_object_call_expr): Likewise. + (finish_template_type_parm): Likewise. + (begin_class_definition): Likewise. + (finish_base_specifier): Likewise. + * sig.c: Remove. + * tree.c (build_cplus_method_type): Remove support for signatures. + * typeck.c (require_complete_type): Likewise. + (c_sizeof): Likewise. + (c_alignof): Likewise. + (build_object_ref): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (signature_error): Remove. + (store_init_value): Remove support for signatures. + (digest_init): Likewise. + (build_x_arrow): Likewise. + (build_functional_cast): Likewise. + * xref.c (GNU_xref_decl): Likewise. + +1999-08-10 Martin v. Loewis + + * lex.c (do_identifier): Remove unnecessary lookup of class field. + +1999-08-09 Martin v. Loewis + + * decl2.c (set_decl_namespace): Do not complain about non-matching + decls if processing a template. + +1999-08-09 Mark Mitchell + + * decl.c (build_ptrmemfunc_type): Handle qualified + pointer-to-member types here. + * tree.c (cp_build_qualified_type_real): Simplify handling here. + +1999-08-09 Kaveh R. Ghazi + + * lex.c (lang_identify): Likewise. + +1999-08-09 Bernd Schmidt + + * Makefile.in: Update dependencies. + * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with + NULL_RTX. + * decl.c: Include "function.h" + (cleanup_label, return_label): Delete declarations. + (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX. + (finish_function): Rename last_parm_insn variable to + fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX. + * decl2.c: Include "function.h". + (rtl_expr_chain): Delete declaration. + * method.c: Include "function.h" + * tree.c (build_vbase_pointer_fields): Don't initialize + DECL_SAVED_INSNS with NULL_RTX. + * typeck.c: Include "function.h" + +1999-08-09 Jason Merrill + + * semantics.c (begin_function_try_block, finish_function_try_block, + finish_function_handler_sequence): New fns. + * parse.y (function_try_block): Use them. + * pt.c (instantiate_decl): Likewise. + + * cp-tree.h: Declare in_function_try_handler. + * decl.c: Define it. + (start_function): Clear it. + (struct cp_function, push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + * parse.y (function_try_block): Set and clear it. + * except.c (expand_end_catch_block): Rethrow if we reach the end + of a function-try-block handler in a ctor or dtor. + * typeck.c (c_expand_return): Complain about returning from a + function-try-block handler of a ctor. + + * parse.y (function_try_block): Call end_protect_partials + before expand_start_all_catch. + +1999-08-08 Jason Merrill + + * decl.c (struct binding_level): Add eh_region field. + (push_binding_level): Set it. + (define_label): Complain about jumping into an EH block. + + * ptree.c (print_lang_type): Print the real type of a PMF. + Print what exceptions a fn type throws. + +1999-08-07 Kaveh R. Ghazi + + * class.c (count_fields, add_fields_to_vec): Add static prototype. + + * cp-tree.h (opname_tab, assignop_tab, operator_name_string, + get_id_2, composite_pointer_type, dump_node_to_file): Constify a + char*. + + * decl.c (named_label_list, cp_finish_decl, grokdeclarator): + Constify a char*. + + * decl2.c (finish_static_data_member_decl, grokfield): Constify a + char*. + + * dump.c (queue_and_dump_index, dump_int, dump_string, + dump_string_field, dequeue_and_dump, dump_node_to_file): Constify + a char*. + (dump_stmt): Add static prototype. + + * errfn.c (cp_thing): Constify a char*. + + * error.c (dump_unary_op, dump_binary_op, aggr_variety, + dump_aggr_type, dump_global_iord, dump_decl, dump_function_name, + dump_expr): Constify a char*. + + * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc, + read_line_number): Add static prototype. + (opname_tab, assignop_tab, operator_name_string): Constify a char*. + (real_yylex): Move label `letter' into the scope where it is used. + + * method.c (build_mangled_template_parm_index, build_overload_int, + build_decl_overload_real, get_id_2): Constify a char*. + + * search.c (check_final_overrider): Make static. + + * typeck.c (composite_pointer_type): Constify a char*. + +1999-08-06 Jason Merrill + + * pt.c (maybe_get_template_decl_from_type_decl): Make sure that + we're looking at a class. + + * decl.c (lookup_name_real): Set the complain flag if we're + looking for a namespace member. + + * lex.c (real_yylex): We can have a number with no digits. + + * cvt.c (cp_convert_to_pointer): Don't force pmf conversions. + + * search.c (binfo_from_vbase): New fn. + * cp-tree.h: Declare it. + * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion + from pointer to member of virtual base. + * typeck.c (get_delta_difference): Likewise. + +1999-08-06 Alexandre Oliva + + * pt.c (tsubst): Use build_index_type to build in-template array + index type. Fixes g++.oliva/dwarf1.C. + * decl.c (grokdeclarator): Likewise, just for consistency, as it + doesn't seem to trigger the bug without it. + +1999-08-06 Jason Merrill + + * typeck2.c (add_exception_specifier): Use complete_type. + +1999-08-06 Mark Mitchell + + * error.c (dump_expr): Handle EXACT_DIV_EXPR. + (dump_binary_op): Bulletproof. + * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR]. + * tree.c (search_tree): Don't enumerate all the nodes of classes + `1', `2', and `<'; handle them generically. Don't be sorry about + "unrecognized tree codes"; just abort. + (no_linkage_check): Don't do linkage checks for templates. + + * tree.c (cp_build_qualified_type_real): Handle + pointer-to-member-function types correctly. + +1999-08-05 Jason Merrill + + * decl.c (pushdecl): Only give an error for shadowing a parm + from *this* function. + +Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) + + * typeck2.c: Update URLs and mail addresses. + +1999-08-04 Nathan Sidwell + + * cp-tree.h (empty_except_spec): New global var. + (compexcepttypes): Remove prototype. + (comp_except_specs): Prototype new global function. + (add_exception_specifier): Prototype new global function. + * decl.c (empty_except_spec): Define new global var. + (duplicate_decls): Use comp_except_specs, reword error message. + (init_decl_processing): Initialize empty_except_spec. + Adjust build_exception_variant calls. + * parse.y (exception_specification_opt): Use empty_except_spec. + (ansi_raise_identifier): Call check_for_new_type. + (ansi_raise_identifiers): Use add_exception_specifier. + * pt.c (tsubst): Use add_exception_specifier to build exception + specifier. + * search.c (check_final_overrider): New static function, broken + out of get_matching_virtual. Check throw specifiers, reword + diagnostics. + (get_matching_virtual): Use check_final_overrider. + * tree.c (build_exception_variant): Use comp_except_specs. + * typeck.c (compexcepttypes): Remove. + (comp_except_types): New static function, helper for + comp_except_specs. Compare two types as exception specifiers. + (comp_except_specs): New global function, compare two exception + specifiers. + (comptypes): Adjust for comp_except_specs. + * typeck2.c (add_exception_specifier): New global function. + + * class.c (check_for_override): Reword error message. + +1999-08-03 Nathan Sidwell + + * call.c (convert_arg_to_ellipsis): Use pod_type_p. + * cp-tree.h (struct lang_type): Added non_pod_class flag. + (CLASSTYPE_NON_POD_P): New macro to access it. + * class.c (finish_struct_1): Determine non-PODness. + Check for arrays of pointers (-Weffc++). + Remove array inspection duplicated code. + * tree.c (pod_type_p): Detect non-pod non-aggregate types. + Use CLASSTYPE_NON_POD_P. + +1999-08-03 Nathan Sidwell + + * class.c (duplicate_tag_error): Preserve template information. + +1999-08-03 Nathan Sidwell + + * decl.c (start_enum): Show location of previous definition. + * parse.y (enumlist_opt): New reduction. + (structsp): Simplify enum rules to use enumlist_opt. + +1999-08-03 Jason Merrill + + * lex.c (yyprint): Handle PFUNCNAME. + + * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only + build_expr_from_tree on the args of a TEMPLATE_ID_EXPR. + +1999-08-03 Mumit Khan + + * decl.c (start_decl): Set attributes before duplicate_decls call. + +1999-08-02 Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add dump.c. + * Makefile.in (CXX_OBJS): Add dump.o. + (dump.o): New target. + * cp-tree.h (DECL_CONV_FN_P): Document. + (DECL_OVERLOADED_OPERATOR_P): New function. + (TYPE_PTRMEM_CLASS_TYPE): New macro. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE. + (ASM_VOLATILE_P): New macro. + (STMT_LINENO): Likewise. + (cp_namespace_decls): New function. + (dump_node_to_file): New function. + * decl.c (cp_namespace_decls): New function. + (walk_namespaces_r): Use it. + (wrapup_globals_for_namespace): Likewise. + * decl2.c (flag_dump_translation_unit): New variable. + (lang_decode_option): Handle -fdump-translation-unit. + (finish_file): If flag_dump_translation_unit is set, dump the + translation unit. + * dump.c: New file. + * lang-options.h: Add -fdump-translation-unit. + * pt.c (tsubst_template_parms): Robustify. + (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P. + (tsubst_expr): Use STMT_LINENO. + * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check + for invalid cv-qualifiers even while building templates. + +1999-08-02 Richard Henderson + + * call.c: Include defaults.h instead of expr.h. + * decl.c: Likewise. + * pt.c: Likewise. + * typeck.c: Include defaults.h. + +1999-08-02 Mark Mitchell + + * lex.c (errorcount, sorrycount): Don't declare. + * repo.c (errorcount, sorrycount): Likewise. + * typeck2.c (errorcount, sorrycount): Likewise. + +1999-08-02 Jakub Jelinek + + * call.c (convert_default_arg, build_over_call): Change all uses of + PROMOTE_PROTOTYPES, so that it tests it as a C expression. + Ensure expr.h is included. + * decl.c (grokparams): Ditto. + * pt.c (tsubst_decl): Ditto. + * typeck.c (convert_arguments): Ditto. + +1999-08-02 Jason Merrill + + * class.c (mark_overriders): Fix order of args to overrides. + (warn_hidden): Likewise. Fix for having virtual and non-virtual + functions with the same name. + +1999-08-02 Richard Henderson + + * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null. + +1999-08-01 Mark Mitchell + + * call.c (build_conditional_expr): Fix typo in comment. + +1999-08-01 Bernd Schmidt + + * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack, + case_stack; use in_control_zone_p. + * typeck.c (c_expand_return): Likewise. + +1999-07-31 Bernd Schmidt + + * except.c (catch_clauses): Delete declaration. + +1999-07-30 Mark Mitchell + + * call.c (build_conditional_expr): Call convert_from_reference to + avoid reference/non-reference type confusion. Fix typo. + +1999-07-30 Richard Henderson + + * typeck2.c (initializer_constant_valid_p): Moved to c-common.c. + * cp-tree.h (initializer_constant_valid_p): Remove. + +1999-07-28 Mark Mitchell + + * call.c (conditional_conversion): Don't build BASE_CONVs for + conversions between things that have the same type. + (build_conditional_expr): Tweak. + (convert_like): Some BASE_CONVs really do require the generation + of code. + + * init.c (perform_member_init): Don't go through build_modify_expr + for simple initializations. + +1999-07-27 Jason Merrill + + * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro. + * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for + virtual functions and MI. Simplify. + + * method.c: Remove prototype for largest_union_member. + * pt.c (determine_specialization): Fix uninitialized warning. + * lex.c (real_yylex): Likewise. + +1999-07-27 Mark Mitchell + + * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS + here too. + + * cp-tree.h (BINFO_VIRTUALS): Document new format. + * class.c (modify_one_vtable): Change prototype accordingly. + (modify_all_vtables): Likewise. + (modify_all_direct_vtables): Likewise. + (modify_all_indirect_vtables): Likewise. + (build_vtable_entry_for_fn): New function. + (set_rtti_entry): Simplify for new BINFO_VIRTUALS format. + (modify_vtable_entry): Likewise. + (add_virtual_function): Likewise. + (build_vtbl_initializer): New function. + (finish_vtbls): Simplify for new BINFO_VIRTUALS format. + (fixup_vtable_deltas1): Likewise. + (fixup_vtable_deltas): Likewise. + (override_one_vtable): Likewise. + (finish_struct_1): Likewise. + + * error.c (dump_expr): Likewise. + * search.c (get_abstract_virtuals_1): Likewise. + (get_abstract_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to + __pure_virtual here. + +1999-07-26 Mark Mitchell + + * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error + as per 1999-07-26 change. + + * typeck.c (c_sizeof): Don't allow non-static data members. + (expr_sizeof): Likewise. + +1999-07-26 Jason Merrill + + * input.c (feed_input): Only touch lineno and input_filename + if !USE_CPPLIB. Save the old values before setting the new ones. + + * input.c (feed_input): Add file, line parms. + * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust. + (real_yylex): Check linemode before input_redirected(). + + * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL + from op new to warning. + +1999-07-26 Mark Mitchell + + * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion. + * call.c: All uses changed. + * typeck.c: Likewise. + +1999-07-26 Nathan Sidwell + + * exception.cc (__cplus_type_matcher): Match __eh_matcher + prototype. + +1999-07-26 Mark Mitchell + + * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro. + (ARITHMETIC_TYPE_P): Adjust definition for standard conformance. + (strip_top_quals): Declare. + (ncp_convert): Likewise. + (type_after_usual_arithmetic_conversions): Likewise. + (composite_pointer_type): Likewise. + * call.c (strip_top_quals): Don't make it static. + (promoted_arithmetic_type_p): New function. + (conditional_conversion): Likewise. + (null_ptr_cst_p): Allow `false' as a NULL pointer constant. + (standard_conversion): Use same_type_p. Don't build BASE_CONVs + for converting a type to itself. + (reference_binding): Honor LOOKUP_NO_TEMP_BIND. + (implicit_conversion): Make sure the from and to types are + complete. + (add_builtin_candidate): Correct handling of ?: operator. + (add_builtin_candidates): Improve documentation. + (build_conditional_expr): New function. + (can_convert): Implement in terms of can_convert_arg. + (ncp_convert): New function. + * typeck.c (type_after_usual_arithmetic_conversions): New + function, split out from common_type. + (composite_pointer_type): New function, split out from + build_conditional_expr. + (common_type): Use type_after_usual_arithmetic_conversions. + Remove redundant attribute merging. + (comptypes): Tidy. Handle COMPLEX_TYPE. + (build_binary_op_nodefault): Use null_ptr_cst_p. + (build_conditional_expr): Remove. + (convert_for_assignment): Use new conversion functions. + + * cp-tree.h (abstract_virtuals_error): Change declaration. + * typeck2.c (abstract_virtuals_error): Check to see if an error + occurred, and return a boolean value accordingly. + (build_functional_cast): Adjust accordingly. + * class.c (finish_struct_1): Likewise. + * cvt.c (ocp_convert): Likewise. + * decl.c (cp_finish_decl): Likewise. + (grokparams): Likewise. + (grok_op_properties): Likewise. + (start_function): Likewise. + * init.c (build_new_1): Likewise. + + * pt.c (unify): Don't get confused by pointers-to-member functions. + + * search.c (build_cplus_new): Robustify. + +1999-07-24 Richard Henderson + + * gxx.gperf (__builtin_va_arg): New. + * parse.y (VA_ARG): New token. + (unary_expr): Recognize it. + +Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com) + + * g++FAQ.texi: Deleted per Joe Buck's request. + * Makefile.in: Corresponding changes. + +1999-07-23 Jason Merrill + + * lex.c: Sync with C frontend. + (whitespace_cr): New fn. + (skip_white_space): Use it. + (init_parse): Reorder. + (yyprint): Support CONSTANT. + (pragma_getc, pragma_ungetc): Bring back. + (read_line_number): Change in_system_header directly. + (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file. + (parse_float): Update to C version. + (yylex): Handle '$' under the letter case. + Remove looking_for_typename handling. + Support hex floating point constants. + Follow C's lead for choosing type of integer constants. + Rearrange stuff to match C frontend. + (yyungetc, reinit_parse_for_block, yylex): Support indent_level. + * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC. + +1999-07-23 Mark Mitchell + + * call.c (reference_binding): Tweak. + (mayble_handle_implicit_object): Use direct_reference_binding to + create the right implicit conversion sequence. + +1999-07-22 Mark Mitchell + + * pt.c (convert_nontype_argument): Don't call decl_constant_value + if we're converting to a reference type. + + * call.c (NEED_TEMPORARY_P): New macro. + (standard_conversion): Set it, for derived-to-base conversions. + (reference_related_p): New function. + (reference_compatible_p): Likewise. + (convert_class_to_reference): Likewise. + (direct_reference_binding): Likewise. + (reference_binding): Rework for standards-compliance. + (convert_like): Adjust accordingly. + (maybe_handle_ref_bind): Simplify; the right conversion sequences + are now built up in reference_binding. + (initialize_reference): New function. + * cp-tree.h (ICS_USER_FLAG): Document. + (ICS_THIS_FLAG): Likewise. + (ICS_BAD_FLAG): Likewise. + (NEED_TEMPORARY_P): Likewise. + (cp_lvalue_kind): New type. + (real_lvalue_p): Return it. + * error.c (dump_expr): Provide more accurate representation for + AGGR_INIT_EXPRs. + * init.c (expand_default_init): Do not try to perform implicit + conversions for a brace-enclosed initializer. + * search.c (lookup_conversions): Document. + * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate + appropriately. + (real_lvalue_p): Adjust accordingly. + (lvalue_p): Likewise. + (build_cplus_new): Don't allow the creation of an abstract class. + * typeck.c (convert_for_initialization): Use initialize_reference. + +1999-07-21 Gavin Romig-Koch + + * lex.c (real_yylex) : Correct the test for overflow when lexing + integer literals. + +1999-07-20 Jason Merrill + + * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL, + not DECL_BUILT_IN, to determine if a function is internally declared. + (duplicate_decls): Likewise. Improve handling of builtins. + (push_overloaded_decl): Remove special handling of builtins. + + * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P. + + * decl.c (grokdeclarator): Pull out decl_constant_value in + templates, too. + + * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm. + * cp-tree.h, pt.c, semantics.c: Adjust. + * method.c (largest_union_member): Remove. + + * lang-specs.h (c++-cpp-output): Pass -fpreprocessed. + + * lex.c (token_getch, token_put_back): New fns. + (real_yylex): Use them. + + * lex.c (lang_init): Generalize. + (lang_init_options): Tell cpplib this is C++. + (nextchar): Remove. Replace uses with put_back. + (skip_white_space): Handle linemode here. Optimize for cpplib. + (extend_token_buffer_to): New fn. + (extend_token_buffer): Use it. + (read_line_number, check_newline): Just deal with tokens. + (real_yylex): More cpplib optimizations. Simplify. Don't produce + EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here. + * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING. + * parse.y (PAREN_STAR_PAREN): Remove. + * input.c: Don't use the putback machinery with cpplib. + (sub_getch): Fold back into getch. + (getch): Don't handle linemode here. + (feed_input): Unget any text in the token buffer. + + * lex.c (set_typedecl_interface_info, set_vardecl_interface_info, + nextyychar, nextyylval): Remove. + +1999-07-20 Michael Tiemann + Jason Merrill + + * lex.c (indent_level): New variable. + (init_parse): Set cpp_token to CPP_DIRECTIVE. + (consume_string): Make this smart about USE_CPPLIB. + (yyungetc): Use put_back function. + (pragma_getc, pragma_ungetc): Functions deleted. + (check_newline): Rewrite to be intelligent about USE_CPPLIB. + Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and + pragma_ungetc. + (real_yylex): Rewrite to be intelligent about USE_CPPLIB. + Also, clean up cases where we redundantly set token_buffer[0]. + (read_line_number): New fn. + * input.c (feed_input): Use integrated cpplib if USE_CPPLIB. + (end_input): Call cpp_pop_buffer if USE_CPPLIB. + (sub_getch): Conditionalize out code that's not appropriate if + USE_CPPLIB. + (put_back): Rewrite in case USE_CPPLIB is defined. + (input_redirected): Ditto. + +Tue Jul 20 11:24:19 1999 Bernd Schmidt + + * cp-tree.h: Delete lots of declarations of tree nodes; replaced by + c_global_trees and accessor macros defined in c-common.h. + (cp_tree_index): New enumeration. + (cp_global_trees): Declare new array. Add accessor macros for it, and + delete declarations of tree nodes replaced by it. + (builtin_function): Delete macro, add declaration for new function. + Include c-common.h. + * decl.c: Delete definitions for tree nodes that were replaced by + cp_global_trees and c_global_trees. + (init_decl_processing): Call c_common_nodes_and_builtins; delete code + to generate the common builtins here. + (builtin_function): New function. + * decl2.c (abort_fndecl): Delete declaration. + * except.c (expand_builtin_return_address): Delete declaration. + (builtin_return_address_fndecl): Delete variable. + (const_ptr_type_node): Delete declaration. + * lex.c (cons_up_default_function): Delete declaration of + void_list_node. + * parse.y (void_list_node): Delete declaration. + * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type): + Delete variables. + (const_string_type_node): Delete declaration. + * search.c (abort_fndecl): Delete declaration. + * Makefile.in: Update dependencies. + +1999-07-19 Mark Mitchell + + * pt.c (check_default_tmpl_args): Move test for missing default + arguments here, from ... + (end_template_parm_list): Here. + +1999-07-18 Mark Mitchell + + * decl.c (lookup_nested_type): Remove. + (pushtag): Don't call it. + +Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INTERFACE): Bump to 2. + +1999-07-17 Alexandre Oliva + + * typeck2.c (my_friendly_abort): Updated URL with bug reporting + instructions to gcc.gnu.org. Removed e-mail address. + +1999-07-17 Mark Mitchell + + * pt.c (determine_specialization): Tighten error-checking. + (end_template_parm_list): Likewise. + +1999-07-14 Mark Mitchell + + * pt.c (check_default_tmpl_args): Handle friends defined in the + class just like member functions defined in the class. + +1999-07-09 Michael Tiemann + Jason Merrill + + * cp-tree.h (struct lang_decl): Added field for storing sorted + FIELD_DECLs (used in TYPE_DECLs). + (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union. + (DECL_SORTED_FIELDS): New macro. + * class.c (method_name_cmp): New function. + (finish_struct_methods): Modified to support sorting and searching + methods. + (finish_struct_anon): Changed code in inner loop to use ELT rather + than UELT (which required an extra indirection for every reference). + (field_decl_cmp): New function to support sorting FIELD_DECLs. + (finish_struct_1): Sort fields. + * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them. + (lookup_fnfields_1): Search sorted methods in METHOD_VEC. + Also, switch to using array indexing rather than a changing pointer. + * ptree.c (print_lang_decl): Handle TYPE_DECLs that have + DECL_SORTED_FIELDS. + +1999-07-09 Jason Merrill + + * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style + casts in system headers or extern "C" blocks. + + * pt.c (do_decl_instantiation): Downgrade duplicate instantiation + errors to pedwarn. + +1999-07-09 Michael Tiemann + + * decl2.c (write_virtuals): Deleted declaration. + * cp-tree.h (write_virtuals): Deleted extern declaration. + * class.c (finish_struct_1): Removed #if 0'd code that mentions + write_virtuals. + * semantics.c (begin_class_definition): Rewrite code to not depend + on write_virtuals. + + * lex.c (cp_pragma_interface): New function. + (cp_pragma_implementation): Likewise. + (handle_cp_pragma): Call them. + + * typeck.c (comptypes): Simplify C code in look_hard. + + * xref.c (PALLOC): Use xcalloc, not calloc. + (SALLOC): Use xmalloc, not malloc. + + * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary. + + * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS + is NO_DEBUG. + + * decl.c (duplicate_decls): If a redeclaration doesn't match the + initial declaration, then don't save the inline info and by all + means don't mark the function as a builtin function. + + * decl.c (lookup_name_real): Set NONCLASS to 1 if + CURRENT_CLASS_TYPE is 0. + + * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to + NULL_TREE. + + * ptree.c (print_lang_type): Added vtable-needs-writing. + +Wed Jul 7 01:26:47 1999 Alexandre Oliva + + * decl2.c (mark_vtable_entries): Fix check for rtti offset. + +1999-07-06 Gavin Romig-Koch + + * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Merged into c-common. + +1999-07-05 Dave Brolley + + * lex.c (errorcount): Declare it. + (finish_parse): Update errorcount for when using CPPLIB. + +1999-07-05 Mark Mitchell + + * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template + parameters. + (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro. + * decl.c (push_class_binding): Use it. + (lookup_name_real): Likewise. + +1999-07-02 Gavin Romig-Koch + + * cp-tree.h (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + * decl.c (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + (init_decl_processing): Handle/use the two new types. + * lex.c (real_yylex): Same. + * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Same. + +1999-07-01 Mark Mitchell + + * decl.c (grokdeclarator): Don't give names "for linkage purposes" + to anonymous cv-qualified types. + +1999-07-01 Gavin Romig-Koch + + * lex.c (real_yylex) : Change integer literal overflow handling to + be like c-lex.c. + + * lex.c (real_yylex): Improve 'integer constant out of range' messages. + +1999-06-28 Richard Henderson + + * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. + +1999-06-28 Jason Merrill + + * error.c (dump_type_real): Handle TREE_LIST again. + + * typeck.c (comp_target_parms): Don't complain about + converting from () to (...) if !flag_strict_prototype. + + * decl.c (grokdeclarator): Update the names of all variants when + de-anonymizing. + +1999-06-21 Mark Mitchell + + * init.c (expand_aggr_vbase_init): Rename to + construct_virtual_bases. Conditionalize construction here, + rather than ... + (emit_base_init): Here. + +1999-06-19 Mark Mitchell + + * semantics.c (finish_asm_stmt): Apply decay conversions to + input operands. + + * decl.c (expand_static_init): When building an anonymous function + for use with atexit, compute its body before and after entering + the function. + + * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and + EXIT_EXPR. + +1999-06-18 Mark Mitchell + + * init.c (expand_aggr_vbase_init): Add flag parameter. + (build_partial_cleanup_for): Remove, inlining into .. + (expand_cleanup_for_base): ... here. Take flag parameter. + (emit_base_init): Pass the in_chrg parameter to + emit_aggr_vbase_init. + (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base. + +1999-06-16 Mark Mitchell + + * decl2.c (import_export_decl): Use same_type_p, rather than + relying on pointer-equality for types. + + * method.c (do_build_copy_constructor): Simplify. + + * call.c (build_method_call): Remove bogus code for two-argument + delete. + * init.c (build_new_1): Expand on comment, and remove dead code. + + * init.c (expand_cleanup_for_base): New function, split out + from ... + (emit_base_init): Here. + (expand_aggr_vbase_init): Use it. + +1999-06-15 Mark Mitchell + + * cp-tree.h (class_cache_firstobj): Declare. + (maybe_push_cache_obstack): Rename to push_cache_obstack. + * class.c (permanent_obstack): Remove declaration. + (class_cache_firstobj): Make it global. + (add_method): Don't use permanent_obstack directly. + (pushclass): Only free the class_cache_obstack if we know how far + back to free it. + (maybe_push_cache_obstack): Rename to push_cache_obstack. + * decl.c: Remove dead comment. + (saved_scope): Add class_cache_firstobj. + (push_to_top_level): Save it. + (pop_from_top_level): Restore it. + (push_class_level_binding): Use push_cache_obstack, not + maybe_push_cache_obstack. + * search.c (push_class_decls): Likewise. + +1999-06-14 Martin von Löwis + + * pt.c (tsubst_friend_function): Push into namespace of friend + function before pushdecl'ing it. + +1999-06-14 Nathan Sidwell + + * call.c (build_new_op): Remove REF_BIND from all operands. + +1999-06-13 Alexandre Oliva + + * init.c (build_new_1): Look up operator delete even if there was + no explicit new placement. + +1999-06-08 Nathan Sidwell + + * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out + of ... + (build_throw): ... here. Call it. + (process_start_catch_block): Call it. + +1999-06-07 Mark Mitchell + + * search.c (convert_pointer_to_single_level): Reimplement without + using get_binfo. + +1999-06-06 Mark Mitchell + + * method.c (is_back_referenceable_type): Back-reference bools when + not squangling. + +1999-06-07 Dave Brolley + + * lex.c (real_yylex): Replace unused bytes from bad multibyte char. + * input.c (putback_buffer): New structure type. + (putback): Replaces putback_char member. + (putback): Replaces putback_char static variable. + (feed_input): Use putback. + (end_input): Use putback. + (sub_getch): Use putback. + (put_back): Use putback. + +1999-06-05 Mark Mitchell + + * decl.c (grokdeclarator): Fix typo in last change. + +1999-06-04 Jason Merrill + + * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack. + (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise. + +1999-06-04 Nathan Sidwell + + * except.c (build_throw): Check throw expression validity. + +1999-06-03 Mark Mitchell + + * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned + just because flag_signed_bitfields is false. + +1999-06-03 Nathan Sidwell + + * semantics.c (begin_class_definition): Update the struct's + location here ... + * class.c (finish_struct): ... rather than here. + + * decl.c (make_typename_type): Don't rely on uninitialized + variable. + +1999-05-31 Kaveh R. Ghazi + + * Makefile.in (ALL_CFLAGS): Add '-W -Wall'. + +1999-05-31 Mark Mitchell + + * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange + and friends rather than messing with current_obstack directly. + (cp_build_qualified_type_real): Rework ARRAY_TYPE + allocation to match practice throughout the rest of the + compiler. + +1999-05-30 Mark Mitchell + + * lex.c (make_lang_type): Create TYPE_BINFO for + TEMPLATE_TYPE_PARMs just like for non-template types. + + * decl.c (start_decl): Move checks on initialization to ... + (cp_finish_decl): Here. Tidy formatting slightly. + +1999-05-28 Mark Mitchell + + * decl.c (add_binding): Don't complain about a redeclaration of a + semantically identical typedef in a local scope. + +1999-05-28 Nathan Sidwell + + * decl.c (complete_array_type): Allocate off same obstack. Fix + DO_DEFAULT comment to match reality. + + * friend.c (make_friend_class): Fix diagnostic typo. + +1999-05-28 Mark Mitchell + + * decl.c (lookup_namespace_name): Handle getting a + TEMPLATE_ID_EXPR. + (expand_static_init): Don't call pushdecl for implicitly declared + `atexit' used to register destructors. + +1999-05-25 Mark Mitchell + + * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to + initialize a vtable. + + * cp-tree.h (NAMESPACE_LEVEL): Reformat. + (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes + by combining TEMPLATE_INFO and LEVEL into a single union. + (DECL_TEMPLATE_INFO): Reformat. + (DECL_SAVED_TREE): Document. + (DECL_TEMPLATE_INJECT): Remove. + * class.c (finish_struct): Remove code to deal with + DECL_TEMPLATE_INJECT. + + * decl.c (maybe_process_template_type_declaration): Handle all new + types in templates uniformly. + * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not + DECL_CONTEXT. + * pt.c (lookup_template_class): Inject template instantiations of + forward-declarations. + (instantiate_class_template): Remove code processing + DECL_TEMPLATE_INJECT. + + * pt.c (lookup_template_class): Tweak lookup to find member + templates. + + * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into + ASM_CV_QUAL. + * semantics.c (finish_asm_stmt): Make strings permanent if they're + used in a template. + +1999-05-25 Jason Merrill + + * typeck.c (casts_away_constness, casts_away_constness_r): Strip both + parts of pointer to data member types. + +1999-05-24 Mark Mitchell + + * decl2.c (mark_vtable_entries): Don't make a copy of a function, + and then make it look like `abort'. Just use `abort' instead. + + * typeck.c (build_static_cast): Don't allow static_casts that cast + away constness. + (casts_away_constness_r): New function. + (casts_away_constness): Likewise. + + * decl.c (lookup_tag): Remove code no longer needed after + name-lookup improvements. + * decl2.c (handle_class_head): Make error-recovery more robust. + * friend.c (make_friend_class): Reject templated typename types. + * lex.c (is_global): A template parameter isn't global. + * parse.y (class_head): Robustify. + * parse.c: Regenerated. + +1999-05-22 Mark Mitchell + + * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs, + INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs. + + * cp-tree.h (push_nested_namespace): Declare. + (pop_nested_namespace): Likewise. + * decl.c (push_nested_namespace): New function. + (pop_nested_namespace): Likewise. + * pt.c (instantiate_class_template): Use them. + + * tree.c (mapcar): Handle NON_LVALUE_EXPR. + + * cp-tree.h (cplus_expand_constant): Declare. + * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're + converted from one pointer-to-object type to another. + * expr.c (cplus_expand_constant): Don't make it static. + * typeck.c (build_component_ref): Don't crash when presented with + a component which is a TEMPLATE_DECL. + (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a + cast from a pointer-to-member constant to its own type does not + result in a valid non-type template argument. + +1999-05-21 Mark Mitchell + Nathan Sidwell + + * Make-lang.in (cc1plus): Make it depend on gxx.gperf. + * cp-tree.h: Fix typo in documentation on pointers-to-members. + (cp_build_qualified_type): Make it a macro. + (cp_build_qualified_type_real): Declare. + * decl.c (grokdeclarator): Remove misleading comment. Avoid + problem with template parameters and restrict-qualification. + * gxx.gperf: Replace NORID with RID_UNUSED throughout. + * hash.h: Regenerated. + * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into + the enumeration. + (NORID): Remove definition. + * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real. + (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs. + (fn_type_unification): Check that the function type resulting from + the deduction is legal. + (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially. + (unify): Use cp_build_qualified_type_real. + * tree.c (build_cplus_array_type_1): Handle error_marks as inputs. + (cp_build_qualified_type): Rename to ... + (cp_build_qualified_type_real): Add additional COMPLAIN parameter + and modify appropriately. + + * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to + reveal optimization opportunities. + + * pt.c (tsubst): Don't issue error messages when we're not + complaining, even if we see a qualified function type. + (check_cv_quals_for_unify): Don't allow a qualified function + type. + +1999-05-20 Jason Merrill + + * class.c (instantiate_type): Downgrade errors for object-dependent + memfn refs to pedwarn. + +1999-05-20 Mark Mitchell + + * decl.c (grokdeclarator): Don't treat [] as indicating a + zero-sized array in a typedef. + + * call.c (build_object_call): Don't look at DECL_NAME for a type. + (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. + (typeck.c): Or TYPE_MAIN_VARIANT for a type. + + * pt.c (for_each_template_parm): Rework to match documentation. + Don't be fooled by a COMPONENT_REF with no TREE_TYPE. + +1999-05-20 Jason Merrill + + * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P. + + * class.c (finish_base_struct): Allow non-COM bases for COM classes + except at the leftmost position. + (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable): + Pass the binfo's class, not the most derived, to skip_rtti_stuff. + * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise. + + * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue. + (build_cplus_new): Make sure that what we return is of the right type. + +1999-05-20 Mark Mitchell + + * cp-tree.h (make_ptrmem_cst): New function. + * expr.c (cplus_expand_constant): Split out from ... + (cplus_expand_expr): Here. Use cplus_expand_constant. + (init_cplus_expand): Set lang_expand_constant. + * pt.c (convert_nontype_argument): Use make_ptrmem_cst. + + * tree.c (make_ptrmem_cst): Define. + * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst. + * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst. + +1999-05-19 Mark Mitchell + + * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P. + + * decl2.c (start_static_storage_duration_function): Fix comment. + (finish_file): Create static storage duration functions lazily. + +1999-05-19 Jason Merrill + + Implement anonymous structs. + * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P. + * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust. + * class.c (finish_struct_1): Remove redundant check for anon struct. + * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union. + (check_tag_decl): Check for anonymous struct here. + * decl2.c (build_anon_union_vars): Catch anon struct at file scope. + * init.c (sort_member_init, emit_base_init): Handle getting fields + as well as names in current_member_init_list. + (perform_member_init): Handle getting an anon aggr. + * method.c (do_build_assign_ref): Don't descend into anon aggrs. + (do_build_copy_constructor): Likewise. + +1999-05-19 Mark Mitchell + + * tree.c (cp_build_qualified_type): Don't allow qualified function + types. + +Wed May 19 02:50:53 1999 Arvind Sankar + + * gxxint.texi: Fix typo. + +1999-05-19 Jason Merrill + + * call.c (find_scoped_type, resolve_scope_to_name): Lose. + * class.c (finish_struct_1): Use CLASS_TYPE_P. + * ptree.c (print_lang_type): Likewise. + * typeck.c (build_modify_expr, c_expand_asm_operands): Use + IS_AGGR_TYPE_CODE. + * typeck2.c (digest_init): Likewise. + +1999-05-18 Jason Merrill + + * call.c (joust): Compare the types of the conv ops, not the + target types of the conversions. + +Tue May 18 00:21:34 1999 Zack Weinberg + + * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc + was not given. + +1999-05-17 Mark Mitchell + + * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation. + * decl.c (grokfndecl): Don't allow inline declarations of friend + template specializations, or friend template specializations with + default arguments. + * pt.c (tsubst): Handle substitution into array types that does + not yield a fixed upper bound, even when not processing a + template. + (tsubst_copy): Deal with the fact that the second operand to a + TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC. + * search.c (marked_pushdecls_p): Don't descend into + TEMPLATE_TYPE_PARMs and the like. + (unmarked_pushdecls_p): Likewise. + + * call.c (build_over_call): Don't throw away + initializations/copies of empty classes; use MODIFY_EXPR and + INIT_EXPR as for non-empty classes. + * class.c (finish_struct_1): Put the padding byte for an empty + class on the TYPE_NONCOPIED_PARTS list for the class. + +1999-05-16 Mark Mitchell + + * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that + indicate a reference to a field that is a qualified name. + +1999-05-16 Jason Merrill + + * decl2.c (finish_objects): Don't use .?tors.* if we don't have + ASM_OUTPUT_CONSTRUCTOR. + + * friend.c (do_friend): Add attrlist arg. Remove support for + getting a non-decl as 'decl'. + * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or + rtl. + (grokdeclarator): Adjust. + * cp-tree.h: Adjust. + +1999-05-16 Mark Mitchell + + * cp-tree.h (permanent_p): New function. + * init.c (build_new_1): Use mapcar, not copy_node, to copy a + possibly complex tree node. + * tree.c (mapcar): Adjust comments, and follow coding standards in + conditional. + (permanent_p): New function. + +1999-05-13 Per Bothner + + * class.c (push_lang_context): Turn off DECL_IGNORED_P for + primitive Java types, if we actually see `extern "Java"'. + +1999-05-10 18:21 -0400 Zack Weinberg + + * lang-specs.h: Pass -$ to the preprocessor. + +1999-05-10 Jason Merrill + + * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too. + Don't bother wrapping an OFFSET_TYPE around unknown_type_node. + (resolve_offset_ref): Don't handle a raw baselink. + * cvt.c (build_expr_type_conversion): Likewise. + * typeck.c (decay_conversion, build_c_cast, convert_for_assignment, + convert_for_initialization): Likewise. + * class.c (instantiate_type): Handle seeing a baselink under an + OFFSET_REF. + * error.c (dump_expr): Likewise. + * pt.c (for_each_template_parm): Likewise. + (resolve_overloaded_unification): Likewise. + * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise. + * typeck.c (expr_sizeof): Also complain about other permutations + of overloaded functions. + +1999-05-07 Jason Merrill + + * init.c (resolve_offset_ref): Don't return a raw method. + Use BASELINK_P. + * typeck.c (decay_conversion): Don't handle a raw method. + Resolve all OFFSET_REFs. + (get_member_function_from_ptrfunc): 0 is a valid vtable index. + (build_binary_op_nodefault): Handle resolving overloaded fns. Use + same_type_p for pmf bits. Don't use build_binary_op to compare + raw pointers to methods. + (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE, + to decide when to call resolve_offset_ref. + (build_c_cast, convert_for_initialization): Likewise. + * cvt.c (build_expr_type_conversion): Likewise. + +1999-05-06 Nathan Sidwell + + * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class. + +1999-05-05 Mark Mitchell + + * decl2.c (start_objects): Don't let static constructors and + destructors get inlined. + + * parse.y (nested_name_specifier): Make sure ordinary types are + complete, just like template types. + * parse.c: Regenerated. + + * pt.c (check_explicit_specialization): Improve error messages. + +1999-05-04 Martin von Löwis + + * typeck.c (string_conv_p): Use same_type_p to check whether we + try to convert between char and wchar_t. + +1999-05-03 Mark Mitchell + + * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous + lookup to error_mark_node here. + (lookup_member): Revise documentation. Add comments. Don't set + the TREE_TYPE to error_mark_node here, and don't build up an extra + TREE_LIST for ambiguous lookups. + (setup_class_bindings): Adjust accordingly. + (push_class_decls): Revise out-of-date comments. + + * typeck.c (build_const_cast): Tighten checks for legality. + +1999-05-02 Martin von Löwis + + * init.c (build_member_call): Lookup names coming from + namespace-scoped LOOKUP_EXPR. + +1999-05-03 Jim Blandy + + * gxxint.texi: Add documentation for 'I'. + +1999-05-02 Martin von Löwis + + * tinfo.cc (operator==): Qualify type_info with std::. + +1999-05-02 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy. + (DECL_COMDAT): Remove definition. + +1999-05-01 Mark Mitchell + + * decl.c (wrapup_globals_for_namespace): Fix thinko in previous + change. + +1999-04-30 Mark Mitchell + + * class.c (build_vtable): Use build_lang_decl when building + vtables, not just build_decl. + (prepare_fresh_vtable): Likewise. + * decl.c (wrapup_globals_for_namespace): Mark vtables as + DECL_EXTERNAL when calling wrapup_global_declarations. + * decl2.c (priority_info_s): Add initializations_p and + destructions_p members. + (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED, + when deciding what vtables to write out. + (ssdf_decls): New variable. + (ssdf_decls_used): Likewise. + (start_static_storage_duration_function): Deal with being called + multiple times. Avoid inlining this function. + (generate_inits_for_priority): Deal with reuse of priority map. + (get_priority_info): Clear initializations_p and destructions_p. + (do_static_initialization): Tweak comment. + (do_static_destruction): Likewise. Fix condition on sentries for + destruction. + (generate_ctor_or_dtor_function): Call all of the static storage + duration functions. + (generate_ctor_or_dtor_function_for_priority): Check + initializations_p and destructions_p to see what priorities need + initialization functions. + (finish_file): Rework to generate multiple static storage duration + functions, rather than just one. + + * typeck.c (build_const_cast): Tweak last change to handle + templates correctly. + + * typeck.c (build_const_cast): Disallow use of const_cast to + anything but a pointer or reference type. + +1999-04-30 Nathan Sidwell + + * decl.c (cp_finish_decl): Don't permit arrays of abstract or + signature type. + +1999-04-29 Mark Mitchell + + * decl2.c (do_static_destruction): Remove obsolete FIXME comment. + (finish_file): Indent comments properly. + +1999-04-29 Richard Henderson + + * decl2.c (do_static_initialization): Call do_pending_stack_adjust. + (do_static_destruction): Likewise. + +1999-04-29 Nathan Sidwell + + * cp-tree.h (TYPE_NOTHROW_P): New macro. + * decl2.c (delete_sanity): Warn on deleting void *. + * init.c (build_new_1): Use TYPE_NOTHROW_P. + * typeck.c (c_expand_return): cp_pedwarn on returning NULL from + throwing operator new. + +1999-04-28 Nathan Sidwell + + * cp-tree.h (build_component_addr): Remove prototype. + * typeck.c (build_component_addr): Make static. Remove MSG + argument. + (build_component_addr): Remove MSG parameter, clean up + comment. + (build_x_function_call): Use cp_error. + (build_unary_op): Adjust call of build_component_addr. + +1999-04-28 Mark Mitchell + + * pt.c (tsubst_friend_class): Check for NULL. + +Wed Apr 28 11:42:22 1999 Andreas Schwab + + * search.c (binfo_for_vtable): Initialize bfvi.var. + +1999-04-27 Nathan Sidwell + + * rtti.c (build_x_typeid): Check rtti is enabled. + +1999-04-26 Mark Mitchell + + * search.c (is_subobject_of_p): Make sure we're looking at the + right baseclasses. + +1999-04-26 Marc Espie + + * Make-lang.in (cplib2.ready): Don't depend on phony targets. + +1999-04-23 Mark Mitchell + + * decl2.c (finish_file): Tweak handling of extern inlines so that + they are not unnecessarily put out. + + * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and + such as base classes. + +1999-04-22 Brendan Kehoe + + * tree.c (build_exception_variant): Fix typo: use the chain of U, + not trying V, while cycling through U. + +1999-04-22 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove returns_first_arg and + preserves_first_arg. Enlarge dummy accordingly. + (DECL_TINFO_FN_P): New macro. + (SET_DECL_TINFO_FN_P): Likeiwse. + (DECL_RETURNS_FIRST_ARG): Remove. + (DECL_PRESERVES_THIS): Likewise. + (DECL_INIT_PRIORITY): New macro. + (finish_struct_1): Change prototype. + (cat_namespace_levels): Remove prototype. + (vtable_decl_p): New prototype. + (vtype_decl_p): Likewise. + (sigtable_decl_p): Likewise. + (walk_globals_pred): New typedef. + (walk_globals_fn): Likewise. + (walk_globals): New prototype. + (walk_namespaces_fn): New typedef. + (walk_namespaces): New prototype. + (wrapup_globals_for_namespace): Likewise. + (walk_vtables): Remove prototype. + (walk_sigtables): Likewise. + (instantiate_pending_templates): New prototype. + * class.c (finish_struct_1): Don't return a value. + * decl.h (pending_statics): Remove declaration. + * decl.c (walk_namespaces_r): New function. + (walk_globals_r): Likewise. + (vtable_decl_p): Likewise. + (vtype_decl_p): Likewise. + (sigtable_decl_p): Likewise. + (walk_namespaces): Likewise. + (walk_globals_data): New type. + (walk_globals): New function. + (wrapup_globals_for_namespace): Likewise. + (expand_static_init): Remove assertion. Remove redundancy in + conditional. Don't put static data members in static_aggregates + Tidy. + (finish_function): Remove redundancy in conditional. Don't set + DECL_RETURNS_FIRST_ARG. + (cat_namespace_levels): Remove. + * decl2.c: Include splay-tree.h and varray.h. + (priority_info_s): New structure. + (finish_vtable_vardecl): Change prototype. Adjust for new calling + conventions. + (prune_vtable_vardecl): Likewise. + (finish_sigtable_vardecl): Likewise. + (setup_initp): Remove. + (do_dtors): Remove. + (do_ctors): Remove. + (start_static_storage_duration_function): New function. + (generate_inits_for_priority): Likewise. + (finish_static_storage_duration_function): Likewise. + (get_priority_info): Likewise. + (do_static_initialization): Likewise. + (do_static_destruction): Likewise. + (do_static_initialization_and_destruction): Likewise. + (generate_ctor_or_dtor_function): Likewise. + (generate_ctor_and_dtor_functions_for_priority): Likewise. + (pending_statics): Make it a varray. + (pending_statics_used): New variable. + (saved_inlines): Make it a varray. + (saved_inlines_used): New variable. + (finish_static_data_member): Change method of updating + pending_statics. + (mark_inline_for_output): Remove #if 0'd code. Change method of + updating saved_inlines. + (walk_vtables): Remove. + (walk_sigtables): Likewise. + (import_export_decl): Use DECL_TINFO_FN_P. + (pending_templates): Remove declaration. + (maybe_templates): Likewise. + (static_aggregates_initp): Likewise. + (setup_initp): Likewise. + (finish_objects): Simplify. + (INITIALIZE_P_IDENTIFIER): New macro. + (PRIORITY_IDENTIFIER): New macro. + (SSDF_IDENTIFIER): New macro. + (initialize_p_decl): New variable. + (priority_decl): Likewise. + (ssdf_decl): Likewise. + (priority_info_map): Likewise. + (finish_file): Recode output of static intializers and other + file-scope finalization tasks. + * error.c (OB_END_TEMPLATE_ID): New macro. + (dump_type_real): Use it. + (dump_decl): Likewise. + (dump_function_name): Likewise. + * lex.c (set_typedecl_interface_info): Adjust for new walk_globals + interface. + (check_newline): Use walk_globals, not walk_vtables. + * pt.c (pending_tempalte_expansions): Remove. + (set_vardecl_interface_info): Likewise. + (pending_templates): Make static. + (maybe_templates): Likewise. + (instantiate_class_template): Adjust call to finish_struct_1. + (instantiate_pending_templates): New function. + * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P. + * tree.c (static_aggregates_initp): Remove. + (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY + instead. + * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h. + + * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes + with the RTL code RETURN. + * hash.h: Regenerated. + * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD. + * parse.y: Replace RETURN with RETURN_KEYWORD throughout. + * parse.c: Regenerated. + * pt.c: Include varray.h. Include rtl.h since varray.h requires + it. + (inline_parm_levels): New variable. + (inline_parm_levels_used): Likewise. + (maybe_begin_member_template_processing): Update them. + (maybe_end_member_template_processing): Use them, rather than + guessing how many levels to pop. + + * decl.c (make_typename_type): Tighten error-checking. + +1999-04-20 Mark Mitchell + + * cp-tree.h (build_binary_op): Remove unneeded parameter. + * class.c (build_vrable_entry_ref): Adjust call to + build_binary_op. + * decl.c (expand_static_init): Likewise. + (grokdeclarator): Likewise. + (finish_function): Likewise. + * decl2.c (delete_sanity): Likewise. + (do_dtors): Likewise. + (do_ctors): Likewise. + * error.c (dump_type_suffix): Likewise. + * expr.c (cplus_expand_expr): Likewise. + * init.c (resolve_offset_ref): Likewise. + (build_new): Likewise. + (build_new_1): Likewise. + (build_vec_delete_1): Likewise. + (expand_vec_init_catch_clause): Likewise. + (build_delete): Likewise. + * pt.c (tsubst): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (expand_direct_vtbls_init): Likewise. + * typeck.c (get_member_function_from_ptrfunc): Likewise. + (build_binary_op_nodefault): Likewise. + (point_int_sum): Likewise. + (pointer_diff): Likewise. + (build_unary_op): Likewise. + (build_modify_expr): Likewise. + (get_delta_difference): Likewise. + (build_ptrmemfunc): Likewise. + (expand_ptrmemfunc_cst): Likewise. + +1999-04-20 Jason Merrill + + * decl.c (grokfndecl): Always call cplus_decl_attributes. + * decl2.c (grokfield): Pass attrlist to grokdeclarator. + +1999-04-19 Mark Mitchell + + * cp-tree.h (finish_static_data_member_decl): New function. + * decl2.c (finish_static_data_member_decl): Split out from ... + (grokfield): Here. + * pt.c (instantiate_class_template): Use it here instead of + trying to fake it. + (tsubst_decl): Don't set DECL_ASSEMBLER_NAME; + finish_static_data_member_decl will do that. Explicit set + DECL_EXTERNAL to match non-template processing. + +1999-04-18 Mark Mitchell + + * cp-tree.h (finish_class_definition): Add parameter. + * parse.y (structsp): Use it. Don't call pop_scope here. + * parse.c: Regenerated. + * semantics.c (finish_class_definition): Pop it here. + +1999-04-17 Mark Mitchell + + * decl.c (xref_tag): Revise handling of nested template + declarations. + * pt.c (check_explicit_specialization): Tweak handling of friend + templates in template classes. + (tsubst_friend_class): Handle friend declarations for nested + member template classes. + +1999-04-16 Mark Mitchell + + * class.c (finish_struct): Remove unused variable. + (pushclass): Likewise. + (invalidate_class_lookup_cache): Likewise. + * cp-tree.def (TYPENAME_TYPE): Improve documentation. + * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME + doesn't get obliterated. + (make_typename_type): Handle template classes correctly. + + * cp-tree.h (TREE_NONLOCAL_FLAG): Remove. + (storetags): Declare. + * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG. + (pushclass): Likewise. Use storetags to install tag declarations, + not pushtag. + (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG. + * decl.c (storetags): Make it global. + (push_class_binding): Set INHERITED_VALUE_BINDING_P for an + implicit typename declaration. + (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG. + * method.c (hack_identifier): Likewise. + * search.c (lookup_member): Likewise. + + * decl.c (warn_about_implicit_typename_lookup): New function. + (lookup_name_real): Use it. Rework handling of implicit typename + extension. + +1999-04-15 Mark Mitchell + + * cp-tree.h (lookup_nested_field): Remove. + * class.c (push_nested_class): Handle UNION_TYPEs. + (pop_nested_class): Likewise. + * decl.c (lookup_name_real): Don't call lookup_nested_field. + (start_decl): Use push_nested_class, not just pushclass. + (cp_finish_decl): Use pop_nested_class, not just popclass. + * search.c (lookup_nested_field): Remove. + + * cp-tree.h (lang_type): Add documentation. + * decl2.c (handle_class_head): Create template declarations here, + as appropriate. + * parse.y (class_head): Return whether or not we entered a new + scope, as well as the type named. + (named_class_head): Likewise. + (named_complex_class_head_sans_basetype): Likewise. + (structsp): Adjust accordingly. Pop scope when required. + * parse.c: Regenerated. + * pt.c (check_default_tmpl_args): Robustify. + (redeclare_class_template): Likewise. + (instantiate_class_template): An instantiation of an + anonymous union is itself an anonymous union. + * semantics.c (begin_class_definition): Don't create template + declarations here. + +1999-04-15 Jason Merrill + + * parse.y (after_type_declarator_intern): New nonterminal. + (after_type_declarator): Use it. + (direct_after_type_declarator): Likewise. Move above + nonnested_type to fix reduce/reduce conflict resolution. + (declmods): Reducing from just 'attributes' has EMPTY precedence. + * Makefile.in (CONFLICTS): Update. + + * decl.c (define_label): Downgrade error for jumping over a + non-POD decl to pedwarn. + +1999-04-14 Mark Mitchell + + * cp-tree.h (popclass): Change declaration. + (pop_nested_class): Likewise. + (poplevel_class): Remove declaration. + * call.c (convert_default_argument): Pass no arguments to + popclass. + * class.c (finish_struct_1): Likewise. + (finish_struct): Likewise. + (popclass): Remove argument. Simplify code accordingly. + (pop_nested_class): Likewise. + * decl.c (poplevel_class): Declare it here, and make it static. + (poplevel): Handle class scopes. + (poplevel_class): Don't take an rgument. Simplify. + (pop_everything): Pass no arguments to pop_nested_class. + (cp_finish_decl): Pass no arguments to popclass. + (grokdeclarator): Pass no arguments to pop_nested_class. + (finish_function): Likewise. + * decl2.c (grokfield): Likewise. + (pop_scope): Pass no arguments to popclass. + * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class. + * pt.c (instantiate_class_template): Move call to pushclass, and + document. Pass no arguments to popclass. + (regenerate_decl_from_template): Likewise. + +1999-04-14 Jason Merrill + + * typeck.c (build_unary_op): Handle taking the address of a unique + bound non-static member function. + +1999-04-13 Martin von Loewis + + * lang-options.h (-Wdeprecated): New flag. + * decl2.c (warn_deprecated): New flag. + (lang_decode_option): Deprecated this-is-variable, + external-templates, alt-external-templates. + Support -Wdeprecated. + * errfn.c (cp_deprecated): New function. + +1999-04-13 Jason Merrill + + * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead + of the decls themselves. + + * pt.c (tsubst_function_type): Copy attributes over. + + * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority + and com_interface. + * cp-tree.h: Add prototype. + * decl.c (init_decl_processing): Set valid_lang_attribute. + +1999-04-13 Mark Mitchell + + * class.c (finish_struct_1): Look at the const-ness of the field's + type, not the TREE_READONLY-ness of the declaration. + * method.c (synthesize_method): Likewise. + * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when + creating new declarations. + +1999-04-13 Mike Stump + + * decl2.c (import_export_decl): Because vtables always reference + virtual functions, even if they are inlined, don't allow + -fno-implement-inlines to not emit them, instead, emit them with + the vtable. + * decl.c (start_function): Likewise. + +1999-04-12 Jason Merrill + + * cp-tree.h (struct lang_type): Add com_interface. + (CLASSTYPE_COM_INTERFACE): New macro. + * class.c (set_rtti_entry): COM interface classes have no RTTI + entries in their vtables; adjust. + (add_virtual_function, finish_base_struct, skip_rtti_stuff, + modify_one_vtable, fixup_vtable_deltas1, override_one_vtable, + finish_struct_1): Likewise. + * decl2.c (mark_vtable_entries): Likewise. + * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise. + * search.c (get_abstract_virtuals_1, get_abstract_virtuals, + expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + + * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro. + * typeck.c (comptypes): If we get it, ignore attributes. + * class.c (instantiate_type): Use BASELINK_P. Change complain + parameter to flags; 2 means ignore attributes. + * call.c (build_op_delete_call): Pass it. + + * decl.c (xref_tag): Only complain once about using a typedef-name + with 'struct'. Downgrade to pedwarn. + + * decl.c (grokdeclarator): Allow [] syntax for zero-length array. + + * parse.y (absdcl_intern): New nonterminal. + (absdcl, direct_abstract_declarator): Use it. + + * pt.c (lookup_template_class): Look through implict typename. + +1999-04-11 Mark Mitchell + + * friend.c (add_friend): Deal gracefully with error_mark_node. + * method.c (build_overload_value): Handle pointers-to-members as + template parameters. + + * decl.c (push_binding): Fix typo in comment. + +1999-04-10 Mark Mitchell + + * error.c (dump_type_real): If a typename is a template-id, put + out the template arguments. + (dump_expr): Handle TEMPLATE_ID_EXPR. + * pt.c (lookup_template_class): Now that full arguments are + available everywhere, remove code that tried to guess them. + +1999-04-09 Mark Mitchell + + * decl.c (make_typename_type): Complain if we don't find a type + when trying to make a typename type for a non-template type. + +1999-04-09 Jason Merrill + + * decl.c (start_decl): Pass attributes to grokdeclarator. + (grokdeclarator): Handle attributes on constructor-syntax + initializers. + +1999-04-08 Mark Mitchell + + * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands + don't have types. + + * search.c (template_self_reference_p): Tweak. + +1999-04-07 Mark Mitchell + + * init.c (build_offset_ref): Don't build yet another weird data + structure to describe overloaded functions. + +1999-04-06 Mark Mitchell + + * cp-tree.h (BASELINK_P): New macro. + (SET_BASELINK_P): Likewise. + * init.c (build_member_call): Remove needless assignment in if + statement. + * search.c (lookup_field_r): Fix handling when we are looking + specifically for a type; these are not hidden by functions and + variables. + (lookup_member): Use SET_BASELINK_P. + * tree.c (is_overloaded_fn): Use BASELINK_P. + (really_overloaed_fn): Likewise. + (get_first_fn): Likewise. + +1999-04-05 Mark Mitchell + + * decl.c (lookup_name_current_level): Tweak, and improve + documentation. + + * class.c (maybe_fixup_vptrs): Remove declaration. + (build_class_init_list): Likewise. + * decl.c (pushdecl_class_level): Call check_template_shadow here + ... + (push_class_level_binding): ... not here. + * search.c (dfs_push_type_decls): Only avoid + template-self-reference TYPE_DECLs if they are from base classes. + +1999-04-04 Mark Mitchell + + * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL + nodes. Tidy. + +1999-04-03 Jason Merrill + + * class.c (maybe_fixup_vptrs, build_class_init_list): Lose. + (finish_struct_1): Don't call build_class_init_list. + +1999-04-02 Mark Mitchell + + * tinfo.h (__class_type_info): Fix illegal declaration. + + * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. + * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. + (IDENTIFIER_CLASS_VALUE): Improve documentation. + (is_properly_derived_from): Declare. + (invalidate_class_lookup_cache): Likewise. + (maybe_maybe_note_name_used_in_class): Likewise. + (note_name_declared_in_class): Likewise. + (push_using_decl): Remove duplicate declaration. + (id_in_current_class): Remove declaration. + (push_class_binding): Change prototype. + (clear_identitifer_class_values): Declare. + * call.c (is_properly_derived_from): Make it global. + (build_new_function_call): Be careful about updating candidates. + (build_new_method_call): Handle COMPONENT_REFs. Don't crash when + asked to make illegal calls. + * class.c: Include splay-tree.h. + (class_stack_node): Add names_used slot. + (check_member_decl_is_same_in_complete_scope): Remove. + (add_method): Fix comment. Push the declaration into class + scope. + (finish_struct_1): When popping the class, pop the bindings too. + Remove check for data member/function member conflict. + (finish_struct): Remove calls to + check_member_decl_is_same_in_complete_scope. Change calls to + popclass. + (pushclass): Clear names_used in the class stack entry. + Use invalidate_class_lookup_cache to remove cached entries, rather + than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE + before entering a new class. Remove dead code. Don't mess with + current_function_decl when pushing declarations. + (invalidate_class_lookup_cache): New function, split out from ... + (popclass): Here. Clean up names_used on our way out. + (instantiate_type): Adjust. + (build_self_reference): Don't push the declaration here. + (maybe_note_name_used_in_class): New function. + (note_name_declared_in_class): Likewise. + * decl.c (add_binding): Change prototype. + (find_class_binding_level): New function. + (innermost_nonclass_level): Likewise. + (current_binding_level): Update documentation. + (inner_binding_level): Remove. Replace with current_binding_level + throughout. + (push_binding_level): Remove special handling of + class_binding_level. + (pop_binding_level): Likewise. Use find_class_binding_level. + (suspend_binding_level): Likewise. + (global_bindings_p): Use innermost_nonclass_level. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (pseudo_global_level_p): Likewise. + (push_binding): Clear INHERITED_VALUE_BINDING_P. + (add_binding): Check for illegal multiple declarations. Return a + value indicating whether or not the new binding was legal. + (push_local_binding): Skip over class binding levels. Check + return value from add_binding. + (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call + note_name_declared_in_class. + (pushlevel_class): Remove "fake out the rest of the compiler" + code. + (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. + (clear_identifier_class_values): New function. + (pop_from_top_level): Use it. + (pop_everything): Tweak. + (maybe_process_template_type_declaration): Don't push the + declaration for the template here. + (pushtag): Don't push tag declarations into class scope here. + (pushdecl): Apply DeMorgan's law for readability. + (pushdecl_class_level): Remove special-case code for + TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. + (push_class_level_bindng): Deal with inherited bindings. + (lookup_name_real): Remove special-case code for + TYPE_BEING_DEFINED, and some implicit typename magic. + (grokdeclarator): Handle COMPONENT_REF for a template function. + (build_enumerator): Don't call pushdecl_class_level here. + (id_in_current_class): Remove. + * decl2.c (grokfield): Don't call pushdecl_class_level or + check_template_shadow. + * errfn.c (cp_file_of): Don't declare. + (cp_line_of): Likewise. + * error.c (dump_decl): Handle an OVERLOAD. + (cp_file_of): Likewise. + (cp_line_of): Likewise. + * init.c (build_member_call): Handle a COMPONENT_REF. + * lex.c (do_identifier): Call maybe_note_name_used_in_class, not + pushdecl_class_level. + * method.c (hack_identifier): Build COMPONENT_REFs for references + to member templates as well as member functions. Remove dead + code. + * parse.y (left_curly): Remove. + (nonnested_type): Call maybe_note_name_used_in_class, not + pushdecl_class_level. + * parse.c: Regenerated. + (nested_name_specifier_1): Likewise. + * pt.c (check_explicit_specialization): Adjust, for robustness. + (check_template_shadow): Handle OVERLOADs. + (build_template_decl): Set DECL_CONSTRUCTOR_P on the + TEMPLATE_DECL, if appropriate. + * search.c (envelope_add_decl): Remove. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + (dfs_push_decls): New function. + (dfs_push_type_decls): Likewise. + (setup_class_bindings): Likewise. + (template_self_reference_p): Likewise. + (lookup_field_r): Use it. + (looup_member): Remove old comment. Deal with ambiguity. + (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, + and remove envelope processing. + * semantics.c (begin_class_definition): Let pushclass push + declarations for base classes. + (finish_member_declaration): Push declarations into class scope. + * typeck.c (build_component_ref): Just put an OVERLOAD into the + COMPONENT_REF, not a TREE_LIST of an OVERLOAD. + (build_x_function_call): Deal with OVERLOAD. Handle template-ids. + * Makefile.in (class.o): Depend on splay-tree.h. + +Wed Mar 31 11:30:43 1999 Nathan Sidwell + + * cvt.c (convert_pointer_to_real): Use same_type_p. + * typeck.c (comp_target_types): Use same_type_p. + +1999-03-31 Jason Merrill + + * semantics.c (begin_inline_definitions, + finish_inline_definitions): Rename from finish_default_args and + begin_inline_definitions, respectively, to something that isn't a + total lie. :) + * parse.y (structsp): Adjust. + + * tree.c (hash_tree_cons): Remove obsolete via_* parms. + (list_hash_lookup): Likewise. + (hash_tree_chain): Adjust. + * pt.c (tsubst): Adjust. + (tsubst_arg_types): Use plain hash_tree_cons. + * cp-tree.h (hash_tree_cons_simple): Lose. + * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons. + +Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi + + * Makefile.in (hash.h): Generate using gperf language 'C', not + 'KR-C', so gperf uses the `const' keyword on strings. + + * gxx.gperf (resword): Const-ify a char*. + +1999-03-30 Jason Merrill + + * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, + CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES, + CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH, + CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST, + CLASSTYPE_BINFO_AS_LIST): Remove cruft. + * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c, + tree.c: Adjust. + +1999-03-29 Jason Merrill + + * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall. + +1999-03-28 Jason Merrill + + * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops. + +1999-03-27 Mark Mitchell + + * cp-tree.h (add_friend): Declare. + (add_friends): Likewise. + * friend.c (add_friend): Make it global. Don't add to + DECL_BEFRIENDING_CLASSES if the befriending class is a template. + (add_friends): Make it global. + (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the + befriending class is a template. + * parse.y (component_decl_1): Fix typo in comment. + * parse.c: Regenerated. + * pt.c (instantiate_class_template): Use add_friend and + add_friends rather that duplicating some of their functionality + here. + +1999-03-27 Jason Merrill + + * call.c (build_field_call): Unify 'this' and non-'this' cases. + + * typeck.c (build_indirect_ref): Check for 'this' sooner. + +Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi + + * call.c (op_error): Const-ify a char*. + (add_candidate, source_type, add_warning): Add static prototype. + (print_z_candidates): Const-ify a char*. + + * class.c (resolve_address_of_overloaded_function, + fixed_type_or_null, build_vtable_entry_ref): Add static prototype. + (get_vtable_name, finish_struct_1): Const-ify a char*. + + * cvt.c (convert_to_reference): Likewise. + + * decl.c (redeclaration_error_message, record_builtin_type, + record_unknown_type, member_function_or_else, bad_specifiers): + Likewise. + (find_binding, select_decl, unqualified_namespace_lookup, + lookup_flags, qualify_lookup, record_builtin_java_type, tag_name): + Add static prototype. + (warn_extern_redeclared_static, duplicate_decls, pushdecl, + implicitly_declare, record_builtin_java_type, define_function, + grok_op_properties, tag_name): Const-ify a char*. + + * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const. + (define_function, finish_builtin_type): Const-ify a char*. + (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn, + cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args. + (file_name_nondirectory): Const-ify a char*. + (init_filename_times): Don't prototype. + (compiler_error): Prototype. + (yyerror, init_repo): Const-ify a char*. + (build_srcloc): Don't prototype. + (build_x_indirect_ref, build_indirect_ref, build_component_addr): + Const-ify a char*. + (warn_for_assignment): Don't prototype. + (convert_for_initialization, readonly_error, check_for_new_type, + GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call): + Const-ify a char*. + + * decl2.c (acceptable_java_type, output_vtable_inherit, + setup_initp, start_objects, finish_objects, do_dtors, do_ctors, + merge_functions, decl_namespace, validate_nonmember_using_decl, + do_nonmember_using_decl): Add static prototype. + (lang_f_options): Const-ify a char*. + (finish_builtin_type): Likewise. + (add_function, arg_assoc_namespace, arg_assoc_class): Add static + prototype. + + * errfn.c: Include cp-tree.h. + (cp_thing): Add static prototype. + (compiler_error): Don't protoptype. + (cp_compiler_error): Cast `compiler_error' to `errorfn' before + passing it to `cp_thing'. + + * error.c (interesting_scope_p): Add static prototype. + + * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify + a char*. + + * init.c (compiler_error): Don't prototype. + (member_init_ok_or_else): Const-ify a char*. + (build_java_class_ref): Add static prototype. + + * lex.c (compiler_error): Don't prototype. + (get_time_identifier, interface_strcmp, extend_token_buffer, + handle_cp_pragma): Const-ify a char*. + (is_global, init_filename_times): Add static prototype. + (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*. + (compiler_error): Change from fixed args to variable args. + (yyerror): Const-ify a char*. + + * parse.y (cond_stmt_keyword): Const-ify a char*. + (parse_decl): Add static prototype. + + * pt.c (template_args_equal, print_template_context): Likewise. + (print_candidates, check_default_tmpl_args): Const-ify a char*. + (instantiate_class_template): Likewise. + + * repo.c (get_base_filename, open_repo_file, init_repo): Likewise. + + * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc, + expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise. + + * search.c (lookup_field_info, lookup_member): Likewise. + (lookup_member): Cast the first argument of `bzero' to a PTR. + + * sig.c (compiler_error): Don't prototype. + (build_signature_pointer_or_reference_nam): Const-ify a char*. + (get_sigtable_name, build_member_function_pointer): Likewise. + + * tree.c (compiler_error): Don't prototype. + (no_linkage_helper, build_srcloc): Add static prototype. + (build_vbase_pointer_fields): Const-ify a char*. + (__eprintf): Don't unnecessarily handle `const' when !__STDC__. + + * typeck.c (compiler_error): Don't prototype. + (convert_for_assignment): Const-ify a char*. + (comp_cv_target_types): Add static prototype. + (build_x_indirect_ref, build_indirect_ref, convert_arguments, + build_component_addr, build_unary_op, convert_for_initialization): + Const-ify a char*. + + * typeck2.c (ack): Add static prototype and change from fixed args + to variable args. + (readonly_error, check_for_new_type): Const-ify a char*. + + * xref.c (_XREF_FILE, find_file, filename, fctname, declname, + fixname, open_xref_file, classname, GNU_xref_begin): Likewise. + (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'. + (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, + gen_assign, GNU_xref_member): Const-ify a char*. + +1999-03-25 Martin von Löwis + + * gxxint.texi: Remove old discussion on copying virtual bases. + +1999-03-25 Zack Weinberg + + * Make-lang.in: Remove all references to g++.o/g++.c. + Link g++ from gcc.o. + +1999-03-25 Jason Merrill + + * decl2.c (comdat_linkage): Treat vtables like functions. + +1999-03-25 Mark Mitchell + + * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES. + +1999-03-25 Nathan Sidwell + + * decl.c (init_decl_processing): Add `signed' type as a synonym + for `int'. + +1999-03-25 Jason Merrill + + * typeck.c (common_type): Handle cv-qual unification for pointers + to members. + + * decl.c (unqualified_namespace_lookup): Return error_mark_node + on error. + (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing. + * lex.c (do_identifier): If we got error_mark_node, call + lookup_name again. + +1999-03-24 Martin von Löwis + + * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty + classes. + +1999-03-24 Jason Merrill + + * decl.c (lookup_name_real): Do nested field lookup regardless of + TYPE_BEING_DEFINED. + +1999-03-24 Mark Mitchell + + * cp-tree.h (lang_type): Remove has_assignment and + has_real_assignment. Add befriending_classes. + (TYPE_HAS_ASSIGNMENT): Remove. + (TYPE_HAS_REAL_ASSIGNMENT): Likewise. + (CLASSTYPE_BEFRIENDING_CLASSES): New macro. + (lang_decl): Document. + (DECL_BEFRIENDING_CLASSES): New macro. + (FRIEND_NAME): Move declaration to more obvious location. + (FRIEND_DECLS): Likewise. + * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT. + * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES. + (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT. + (grok_op_properties): Likewise. + * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS. + (add_friend): Likewise. Don't do weird things with assignment + operators. Update DECL_BEFRIENDING_CLASSES. + (add_friends): Don't do weird things with assignment operators. + (make_friend_class): Likewise. Update + CLASSTYPE_BEFRIENDING_CLASSES. + * pt.c (instantiate_class_template): Don't set + TYPE_HAS_ASSIGNMENT. + (tsubst_copy): Substitute the TREE_TYPE for more unary + expressions. + * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT. + * search.c (protected_accessible_p): New function. + (friend_accessible_p): Likewise. + (accessible_p): Use them. + +1999-03-23 Mark Mitchell + + * pt.c (convert_nontype_argument): Don't create things that aren't + PTRMEM_CSTs when applying a qualification conversion to a + PTRMEM_CST. + +1999-03-23 Mark Mitchell + + * Makefile.in (OBJS): Don't mention hash.o. + (OBJDEPS): Likewise. + +1999-03-23 Jason Merrill + + * decl2.c (finish_file): Set at_eof to 2 after expanding ctors. + * decl.c (expand_static_init): Make sure we don't add any after + then. + + * decl.c (cp_finish_decl): Move intelligence about handling + DECL_COMDAT for variables from here... + * decl2.c (comdat_linkage): ...to here. + (maybe_make_one_only): Tweak. + (import_export_decl): Call comdat_linkage for variables, too. + (finish_file): Handle template statics properly. + +1999-03-22 Mark Mitchell + + * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG. + Document internals of pointer-to-member-functions. + (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc. + (PFN_FROM_PTRMEMFUNC): Likewise. + (build_type_conversion): Remove unused parameter. + (build_ptrmemfunc1): Declare. + (expand_ptrmemfunc_cst): New function. + (delta2_from_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + * cvt.c (cp_convert_to_pointer): Remove unused parameter to + build_type_conversion. Use TYPE_PTRMEM_P for readability. + (convert_to_reference): Remove unused parameter to + build_type_conversion. + (ocp_convert): Likewise. + (build_user_type_conversion): Likewise. + * error.c (dump_expr): Handle NULL pointer-to-member functions. + * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions. + * method.c (build_overload_value): Don't go splitting CONSTRUCTORs + open when handling pointer-to-member functions. + * pt.c (convert_nontype_argument): Clean up error messages. Be + more stringent with pointers-to-members. + * typeck.c (build_ptrmemfunc1): Don't declare. Make it global. + (build_unary_op): Tidy ever-so-slightly. + (build_conditional_expr): Remove extra parameter to + build_type_conversion. + (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function + we're using. + (expand_ptrmemfunc_cst): Define. + (delta2_from_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + +1999-03-19 Mark Mitchell + + * init.c (build_member_call): Handle template-id expressions + correctly. + * typeck.c (build_x_function_call): Likewise. + +1999-03-19 Chip Salzenberg + + * friend.c (make_friend_class): Avoid core dump when + not-yet-defined friend type lacks TYPE_LANG_SPECIFIC(). + +1999-03-18 Jason Merrill + + * decl.c (start_function): Suppress normal linkage heuristics + for #pragma interface under MULTIPLE_SYMBOL_SPACES. + +1999-03-19 Alexandre Oliva + + * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. + ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. + +1999-03-17 Martin von Löwis + + * parse.y (named_complex_class_head_sans_basetype): + Do not push a scope for error_mark_node. + (maybe_base_class_list): Likewise. + + * decl.c (start_decl): Check for error_mark_node as a type. + Detected by g++.brendan/array-refs.C. + (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C. + (maybe_build_cleanup_1): Likewise. Detected by + g++.jason/incomplete1.C. + + * tree.c (build_dummy_object): Use void_zero_node instead of the + error_mark_node. + (is_dummy_object): Check for such a node. + Detected by g++.bob/inherit1.C + +1999-03-16 Jason Merrill + + * method.c (old_backref_index): Split out... + (flush_repeats): From here. Rename back from try_old_backref. + (build_mangled_name): Put back some old-style repeat handling. + +Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi + + * lex.c: Don't include setjmp.h. + (parse_float): New static function. + (pf_args): New struct. + (real_yylex): Use them in call to `do_float_handler'. + +1999-03-15 Mark Mitchell + + * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here. + * tree.c (layout_basetypes): Not here. + * search.c (dfs_search): Remove; no longer used. + +1999-03-12 Mark Mitchell + + * decl2.c (validate_nonmember_using_decl): Issue sensible + error-messages on bogus qualifiers. + +1999-03-14 Jason Merrill + + * call.c (add_function_candidate): Fix uninitialized variable. + + * Makefile.in (search.o): Add dependency on varray.h. + +1999-03-13 Jason Merrill + + * decl.c (duplicate_decls): Use same_type_p. + * method.c (try_old_backref): Renamed from flush_repeats. Use + same_type_p. Don't try to handle repeats. Return success. + (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support + calls from old-style code, too. + (check_ktype): Use same_type_p. + (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT. + (build_qualified_name): Simplify logic. + (process_overload_item): Strip typedefs and quals at the top. + (build_mangled_name_for_type_with_Gcode): Remove call to + type_canonical_variant. + (build_mangled_name): Likewise. Remove support for old-style + repeats, which have been disabled since 2.7.2. Don't mess with + TREE_USED. + (build_decl_overload_real): Don't mess with TREE_USED. + +1999-03-13 Nathan Sidwell + + * error.c (cp_printers): Add 'F' escape character. + (dump_type_real): Remove TREE_LIST (fnargs) printing. + Functionality moved to dump_parameters. + (dump_type_suffix): Use dump_parameters and dump_exception_spec. + (dump_function_decl): Extend meaning of V parameter. Use + dump_parameters and dump_exception_spec. + (dump_parameters): New static function. + (dump_exception_spec): New static function. + (fndecl_as_string): Change argument semantics. Use + dump_function_decl directly. + + * sig.c (build_signature_table_constructor): Use cp_error. + +1999-03-13 Martin von Löwis + + * semantics.c (finish_switch_cond): Handle error cases gracefully. + Detected by g++.law/enum5.C. + + * typeck.c (build_modify_expr): Check for errors after resolving + offsets. Detected by g++.brendan/static1.C. + + * decl.c (complete_array_type): Ignore initial_value if it is an + error. Detected by g++.benjamin/17930.C. + + * typeck2.c (process_init_constructor): Return error if one argument + is in error. Detected by g++.benjamin/13478.C. + +1999-03-12 Martin von Löwis + + * decl.c (select_decl): Allow class templates when we need types. + * decl2.c (ambiguous_decl): Likewise. + +1999-03-12 Mark Mitchell + + * lex.c (do_identifier): Correct call to enforce_access. + * search.c (accessible_p): Tweak comment. + +1999-03-10 Mark Mitchell + + * semantics.c (begin_class_definition): Call build_self_reference. + (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs. + + * search.c (assert_canonical_unmarked): Fix typo in prototype. + + * search.c (dfs_canonical_queue): New function. + (dfs_assert_unmarked_p): Likewise. + (assert_canonical_unmarked): Likewise. + (access_in_type): Use it. + (accessible_p): Likewise. Walk the whole tree when umarking. + + * sig.c (build_signature_table_constructor): Use accessible_p + instead of compute_access. + +1999-03-09 Jason Merrill + + * call.c (add_builtin_candidates): Handle overloaded conversion ops. + +1999-03-09 Mark Mitchell + + * cp-tree.h (flag_access_control): Declare. + (TREE_VIA_PPUBLIC): Document. + (DECL_NONSTATIC_MEMBER_P): New macro. + (enforce_access): Return an indication of whether or not access + was permitted. + (build_self_reference): Change prototype. + (compute_access): Replace with ... + (accessible_p): New function. + (dfs_walk): Change prototype. + (dfs_unmark): Likewise. + (markedp): Likewise. + * call.c (enforce_access): Use accessible_p. + * class.c (build_self_reference): Insert the declaration into the + list of members for this type, and make it public. + * decl.c (xref_basetypes): Avoid ill-timed recursion. + * init.c (build_offset_ref): Use lookup_member, not three separate + name-lookups. Call enforce_access rather than checking for + illegal accesses here. + (resolve_offset_ref): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * parse.y (self_reference): Remove. + (opt_component_decl_list): Don't use it. + * parse.c: Regenerated. + * pt.c (print_candidates): Generalize to handle lists of + overloaded functions. + (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's + not set. + (get_template_base): Use new calling convention for dfs_walk. + * search.c: Include varray.h. Add prototypes. + (dfs_walk): Accept a data pointer to pass to the work functions. + All callers changed. All work functions changed. + (breadth_first_search): Rename to bfs_walk, and make consistent + with dfs_walk. + (dfs_walk_real): New function. + (canonical_binfo): New function. + (context_for_name_lookup): Likewise. + (shared_marked_p): Likewise. + (shared_unmarked_p): Likewise. + (lokup_field_queue_p): Likewise. + (lookup_field_r): Generalize to handle both functions and fields. + (lookup_field): Just call lookup_member. + (lookup_fnfields): Likewise. + (lookup_member): Move body of lookup_field here and generalize. + (dfs_accessible_queue_p): Likewise. + (dfs_accessible_p): Likewise. + (dfs_access_in_type): Likewise. + (access_in_type): Likewise. + (compute_access): Remove, and replace with ... + (accessible_p): New function. + (vbase_types): Remove. + (vbase_decl_ptr_intermediate): Likewise. + (vbase_decl_ptr): Likewise. + (vbase_init_result): Likewise. + (closed_envelopes): Likewise. + (bvtable): Likewise. + +1999-03-09 Jason Merrill + + * call.c (add_function_candidate): Check for proper number of args + before checking the validity of those args. + +1999-03-06 Jason Merrill + + * cp-tree.h (struct lang_type): Add anon_union field. + (ANON_UNION_TYPE_P): Use it instead of examining type. + (SET_ANON_UNION_TYPE_P): New macro. + * decl.c (check_tag_decl): Use it. + + * search.c (compute_access): Handle non-type contexts earlier, and + handle NULL_TREE. + + * tree.c (build_exception_variant): Use copy_to_permanent. + + * decl2.c (setup_initp): Give statics with no priority the default + priority here. + (do_dtors, do_ctors, finish_file): Remove special handling of + non-prioritized statics. + +1999-03-05 Mark Mitchell + + * cp-tree.h (ANON_UNION_TYPE_P): Robustify. + * decl.c (make_typename_type): Don't issue an error if an + immediate lookup fails; it migt be resolved later. + * friend.c (is_friend): Add comment. + * search.c (breadth_first_search): Add POSTFN and DATA + parameters. Tidy. All callers changed. + (lookup_field_queue_p): New function. + (lookup_field_r): Likewise. + (lookup_field_post): Likewise. + (lookup_field): Use them, via breadth_first_search, instead of + duplicating logic. + (compute_access): Robustify. + (lookup_fnfield_info): New structure. + +1999-03-05 Jason Merrill + + * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again. + +1999-03-03 Jason Merrill + + * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4 + cc happy. + + * decl2.c (import_export_class): Also return if + CLASSTYPE_INTERFACE_ONLY is set. + +1999-03-03 Martin von Löwis + + * decl.c (push_overloaded_decl): Only overwrite the old binding if + there was one. + * decl2.c (do_local_using_decl): Fix loop termination. + +1999-03-02 Mark Mitchell + + * cp-tree.h (determine_specialization): Don't declare. + * pt.c (determine_specialization): Make it static. Eliminate + complain parameter. Note that decl is always non-NULL now, and + simplify accordingly. + + * decl.c (maybe_push_to_top_level): Always call + push_cp_function_context. + (pop_from_top_level): Always call pop_cp_function_context. + +1999-02-26 Nathan Sidwell + + * typeck.c (complete_type_or_else): Add VALUE arg, for helpful + diagnostics. + * cp-tree.h (complete_type_or_else): Added VALUE parameter. + * init.c (build_new_1): Extra arg to complete_type_or_else. + (build_delete): Likewise. + * typeck.c (require_complete_type): Likewise. + (pointer_int_sum): Likewise. + (pointer_diff): Likewise. + (build_component_ref): Likewise. + + * typeck2.c (incomplete_type_error): Always use cp_error. + Show declaration of undefined type, if appropriate. + Deal with UNKNOWN_TYPE nodes. + + * typeck.c (require_complete_type): Use TYPE_SIZE as + size_zero_node to mean incomplete type. + (require_complete_type_in_void): New function. + (build_compound_expr): Call complete_type_in_void for LHS. + (build_c_cast): Call complete_type_in_void for void cast. + * cvt.c (ocp_convert): Call complete_type_in_void for void cast. + * decl.c (cplus_expand_expr_stmt): Void expression checks moved to + require_complete_type_in_void. Call it. + * cp-tree.h (require_complete_type_in_void): Prototype new function. + + * typeck.c (convert_arguments): Use alternative format for + function decls. Don't require_complete_type here. Simplify + diagnostic printing. + (convert_for_initialization): Don't require_complete_type on RHS yet. + * call.c (convert_arg_to_ellipsis): Call require_complete_type. + + * call.c (build_over_call): Cope with qualified void return type. + * semantics.c (finish_call_expr): Likewise. + * typeck.c (build_function_call_real): Likewise. + (c_expand_return): Likewise. + * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type. + + * call.c (print_z_candidates): Use alternate print format, to be + consistent with (pt.c) print_candidates. + * method.c (hack_identifier): List candidate members. + * search.c (lookup_field): Build ambiguous list, and show it, if + ambiguous. + +1999-02-26 Mark Mitchell + + * typeck.c (decay_conversion): Don't confuse constant array + variables with their initializers. + + * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when + merging decls. + * pt.c (regenerate_decl_from_template): Tweak for clarity. + (instantiate_decl): Mark a decl instantiated before regenerating + it to avoid recursion. + * tree.c (mapcar): Don't call decl_constant_value unless we know + something is TREE_READONLY_DECL_P. + + * class.c (check_for_override): Don't stop checking when we find + the first overridden function. Delete #if 0'd code. + * search.c (get_matching_virtual): Likewise. + +1999-02-25 Richard Henderson + + * lang-specs.h: Define __FAST_MATH__ when appropriate. + +1999-02-24 Mike Stump + + * typeck.c (convert_for_assignment): Allow boolean integral constant + expressions to convert to null pointer. + +1999-02-24 Martin von Loewis + + * decl.c (lookup_namespace_name): Resolve namespace aliases. + + * class.c (push_nested_class): Allow namespaces. + + * decl2.c (set_decl_namespace): Add friendp parameter. + * decl.c (grokfndecl): Pass it. + (grokvardecl): Likewise. + * cp-tree.h: Change declaration. + +1999-02-24 Jason Merrill + + * pt.c (tsubst): Allow an array of explicit size zero. + +1999-02-23 Jason Merrill + + * errfn.c: Change varargs code to look like toplev.c. + + * method.c (process_modifiers): Don't prepend 'U' for char or + wchar_t. + +1999-02-20 Craig Burley + + * Make-lang.in (cplib2.ready): Don't consider updating + cplib2 stuff if the current directory isn't writable, as + it won't work (such as during a `make install'). + +Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org) + + * decl2.c (start_objects): Make file scope constructors and + destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and + ASM_OUTPUT_DESTRUCTOR are defined. + +1999-02-19 Mark Mitchell + + * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment. + (fn_type_unification): Adjust prototype. + (lookup_fnfields_1): Declare. + * call.c (add_template_candidate_real): Adjust call to + fn_type_unification. + * class.c (add_method): Don't allow duplicate declarations of + constructors or destructors. + (resolve_address_of_overloaded_function): Remove unused variable. + Adjust call to fn_type_unification. + * decl.c (grokfndecl): Be more robust in the face of illegal + specializations. + * decl2.c (check_classfn): Remove hokey handling of member + templates. + * pt.c (determine_specialization): Improve comments. Adjust to + handle template argument deduction as per the standard. + (check_explicit_specialization): Fix comment spacing. Handle + type-conversion operators correctly. Improve error-recovery. + (fn_type_unification): Remove EXTRA_FN_ARG parameter. + (get_bindings_real): Simplify handling of static members. + * search.c (lookup_fnfields_1): Make it have external linkage. + * typeck.c (compparms): Fix comment. + (build_unary_op): Don't try to figure out which template + specialization is being referred to when when the address-of + operator is used with a template function. + +Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi + + * cp-tree.h (lvalue_or_else): Qualify a char* with the `const' + keyword to match an analogous change at the top level. + + * tree.c (lvalue_or_else): Likewise. + +1999-02-17 Mark Mitchell + + * decl.c (xref_basetypes): Comment. + * pt.c (instantiate_class_template): Use xref_basetypes. + +1999-02-16 Mark Mitchell + + * cp-tree.h (tsubst): Change prototype. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (type_unification): Remove prototype. + * call.c (convert_default_arg): Adjust call to tsubst_expr. + * class.c (resolve_address_of_overloaded_function): Just use + fn_type_unification. + * decl.c (grokdeclarator): Adjust call to tsubst. + * method.c (build_template_parm_names): Likewise. + * pt.c (GTB_VIA_VIRTUAL): New macro. + (GTB_IGNORE_TYPE): Likewise. + (resolve_overloaded_unification): Add `complain' parameter. + (try_one_overload): Likewise. + (tsubst_template_arg_vector): Likewise. + (tsubst_template_parms): Likewise. + (tsubst_aggr_type): Likewise. + (tsubst_arg_types): Likewise. + (tsubst_call_declarator_parms): Likewise. + (unify): Remove explicit_mask. + (type_unification_real): Likewise. + (get_template_base_recursive): Likewise. + (coerce_template_template_parms): Provide prototype. + (tsubst_function_type): Likewise. + (try_class_unification): New function. + All callers changed to use new complain parameter. + (get_template_base): Use try_class_unification. + (unify): Adjust handling of classes derived from template types. + (fn_type_unification): Substitute explicit arguments before + unification. + +1999-02-16 Kriang Lerdsuwanakij + + * decl.c (pushdecl): Remove dead code. + +1999-02-16 Jason Merrill + + * decl2.c (finish_objects): Fix code I missed in previous change. + +1999-02-13 Jason Merrill + + * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. + (grokdeclarator): Don't expect error_mark_node from grokfndecl. + + * pt.c (maybe_process_partial_specialization): Complain about + 'template <>' on non-specialization. + +1999-02-10 Jason Merrill + + * decl.c (grokdeclarator): Catch weird declarators. + * decl2.c (finish_file): Don't abort because of namespace parsing + failure. + (check_decl_namespace): Remove. + +1999-02-09 Mark Mitchell + + * cp-tree.h (get_template_base): Don't declare. + (dfs_walk): Declare. + (dfs_unmark): Likewise. + (markedp): Likewise. + * pt.c (unify): Remove duplicate declaration. Pass tparms and + targs to get_template_base. + (get_template_base_recursive): Move here from search.c. Check to + see that the base found can be instantiated to form the desired + type. + (get_template_base): Likewise. + (get_class_bindings): Simplify. + * search.c (get_template_base_recursive): Move to pt.c. + (get_template_base): Likewise. + (markedp): Make it global. + (dfs_walk): Likewise. + (dfs_unmark): Likewise. + +1999-02-07 Jason Merrill + + * pt.c (maybe_process_partial_specialization): Complain about + specialization in wrong namespace. + * tree.c (decl_namespace_context): New fn. + +1999-02-06 Kriang Lerdsuwanakij + + * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM. + * pt.c (coerce_template_template_parms): Handle nested + template template parameters. + +Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com) + + * typeck2.c: Update email addresses. + +1999-02-04 Kriang Lerdsuwanakij + + * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag + turned off. + +1999-02-04 Jason Merrill + + * lex.c (retrofit_lang_decl): Split out... + (build_lang_decl): From here. + * decl.c (pushdecl): Call it for functions generated by the middle + end that don't have DECL_LANG_SPECIFIC. + * cp-tree.h: Declare it. + + * decl2.c: Remove flag_init_priority. Always enable initp stuff. + (start_objects, finish_objects): Only use special + init_priority code if the user specified a priority. + (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp + objects. + +Wed Feb 3 22:50:17 1999 Marc Espie + + * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and + mkstemp.o. Get them from libiberty now. + (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o. + +Tue Feb 2 22:38:48 1999 Theodore Papadopoulo + + * decl2.c (lang_decode_option): Use read_integral_parameter. + +1999-02-01 Mark Mitchell + + * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED + before calling complete_type_or_else. + +Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi + + * input.c (inline): Don't define, its handled by system.h. + +Sun Jan 31 20:34:29 1999 Zack Weinberg + + * decl2.c: Don't define flag_no_ident here. Don't process + -f(no-)ident here. + * cp-tree.h: Don't declare flag_no_ident here. + * lang-specs.h: Map -Qn to -fno-ident. + +1999-01-28 Jason Merrill + + * cp-tree.h (struct tree_binding): Replace scope field with a union. + (BINDING_SCOPE): Adjust. + * decl.c (BINDING_LEVEL): Adjust. + +1999-01-26 Jason Merrill + + * pt.c (instantiate_class_template): Set up the DECL_INITIAL of + member constants. + + * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in + a ctor initializer. + + * tree.c (equal_functions): Fix name in prototype. + + * decl.c (push_local_binding): Add FLAGS argument. + (pushdecl, push_overloaded_decl): Pass it. + * decl2.c (do_local_using_decl): Likewise. + * cp-tree.h: Adjust prototype. + * decl.c (poplevel): Fix logic. + + * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST. + (poplevel): Handle that. Fix logic for removing TREE_LISTs. + (cat_namespace_levels): Don't loop forever. + +1999-01-25 Richard Henderson + + * typeck.c (build_reinterpret_cast): Fix typo in duplicated test. + +1999-01-25 Jason Merrill + + * class.c (resolve_address_of_overloaded_function): Mark the + chosen function used. + + * call.c (build_call): Make sure that a function coming in has + been marked used already. + * decl.c (expand_static_init): Call mark_used instead of + assemble_external. + * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec, + alloc_eh_object, expand_throw): Likewise. + * init.c (build_builtin_delete_call): Likewise. + * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1, + expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, + expand_generic_desc): Likewise. + +1999-01-25 Martin von Löwis + + * tree.c (equal_functions): New function. + (ovl_member): Call it. + +1999-01-24 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. + +1999-01-25 Martin von Loewis + + * decl.c (decls_match): Return 1 if old and new are identical. + (push_overloaded_decl): Set OVL_USED when PUSH_USING. + +1999-01-24 Jason Merrill + + * decl.c (start_function): Make member functions one_only on windows. + * decl2.c (import_export_decl): Likewise. + + * decl.c (grokdeclarator): Don't complain about implicit int in + a system header. Change same-name field check to not complain in + a system header instead of within extern "C". + +1999-01-21 Mark Mitchell + + * cp-tree.h (PUSH_GLOBAL): New macro. + (PUSH_LOCAL): Likewise. + (PUSH_USING): Likewise. + (namespace_bindings_p): Declare. + (push_overloaded_decl): Likewise. + * decl.c (push_overloaded_decl): Don't make it static. Check for + illegal declarations after using declarations here. + (namespace_bindings_p): Likewise. + (duplicate_decls): Don't consider declarations from different + namespaces to be the same. + (pushdecl): Use symbolic PUSH_ constants in calls to + push_overloaded_decl. + (push_overloaded_decl_1): Likewise. + * decl2.c (validate_nonmember_using_decl): Tweak `std' handling. + (do_nonmember_using_decl): Check for illegal using declarations + after ordinary declarations here. + (do_local_using_decl): Call pushdecl to insert declarations. + +1999-01-21 Jason Merrill + + * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo. + +1999-01-21 Mark Mitchell + + * tree.c (build_cplus_array_type_1): Don't call build_array_type + for types involving template parameters. + + * cp-tree.h (PARM_DECL_EXPR): Delete. + (convert_default_arg): Change prototype. + (check_default_argument): Declare. + (search_tree): Likewise. + * call.c (convert_default_arg): Take the function to which the + default argument belongs as a parameter, and do any necessary + instantiation here, instead of ... + (build_over_call): Here. + * decl.c (local_variable_p): New function. + (check_default_argument): Likewise, split out and tidied from ... + (grokparms): Here. + * error.c (dump_expr): Don't set PARM_DECL_EXPR. + * pt.c (tsubst_call_declarator_parms): New function. + (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing + with CALL_EXPRs, rather than trying to be clever. + (tsubst): Use tsubst_call_declarator_parms. + * tree.c (search_tree): Don't make it static. + * typeck.c (convert_arguments): Use new interface to + convert_default_arg. + +1999-01-20 Mark Mitchell + + * error.c (dump_function_decl): Don't print the argument types for + a function when the verbosity level is negative. + + * call.c (build_over_call): Check format attributes at call-time. + + * pt.c (tsubst_copy): Fix comment. + (unify): Don't allow unification with variable-sized arrays. + + * semantics.c (finish_stmt_expr): When processing a template make + the BIND_EXPR long-lived. + +1999-01-19 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Make vtables comdat here. + (import_export_vtable): Not here. + +1999-01-18 Jason Merrill + + * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique + non-static member function. + +1999-01-18 Nathan Sidwell + + * class.c (instantiate_type): Only diagnose illegal address of member + function if complaining. + + * decl.c (lookup_name_real): Remove duplicate code. + +1999-01-18 Jason Merrill + + * tree.c (copy_template_template_parm): Use permanent_obstack. + +1999-01-18 Kriang Lerdsuwanakij + + * pt.c (unify): Remove restrictions on deduction of argument + of template template parameters. + +1999-01-18 Nathan Sidwell + + * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs. + + * class.c (resolve_address_of_overloaded_function): Show list of + all candidates, when none of them match. + +1999-01-18 Chip Salzenberg + + * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up + definition of 'casting away const' in reinterpret_cast<>. + +1999-01-18 Graham + + * cvt.c: Add include for decl.h, remove extern for + static_aggregates which is now provided by decl.h. + + * Makefile.in (cvt.o): Add dependency for decl.h and missing + dependencies for convert.h and flags.h. + +1999-01-18 Nathan Sidwell + + * decl2.c (do_dtors): Set current location to that of the + decl, for sensible diagnostics and debugging. + (check_classfn): Issue `incomplete type' error, if + class is not defined. + +1999-01-16 Jason Merrill + + * cp-tree.h: Add prototype for bound_pmf_p. + +1999-01-16 Jason Merrill + Manfred Hollstein + + * decl.c (grokdeclarator): Don't make 'main(){}' an error with only + -Wreturn-type. + +1999-01-16 Nathan Sidwell + + * cp-tree.h (struct lang_type): Added has_mutable flag. + (CLASSTYPE_HAS_MUTABLE): New macro to access it. + (TYPE_HAS_MUTABLE_P): New macro to read it. + (cp_has_mutable_p): Prototype for new function. + * class.c (finish_struct_1): Set has_mutable from members. + * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if + it contains a mutable. + * typeck.c (cp_has_mutable_p): New function. + +1999-01-15 Mark Mitchell + + * pt.c (process_template_parm): Ignore top-level qualifiers on + non-type parameters. + + * decl.c (start_function): Use current_function_parms in the call + to require_complete_type_for_parms, not the probably empty + DECL_ARGUMENTS. + +1999-01-14 Jason Merrill + + * semantics.c (finish_asm_stmt): Don't warn about redundant volatile. + + * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means + that we don't suppress the other copies. + * lex.c (handle_cp_pragma): Likewise. + +1999-01-13 Mark Mitchell + + * decl.c (grokdeclarator): Undo 1998-12-14 change. + * tree.c (build_cplus_array_type_1): Likewise. + * pt.c (instantiate_class_template): Remove misleading comment. + (tsubst_aggr_type): Substitute if there are template parameters, + regardless of whether or not they use template arguments. + (unify): Likewise, but for unification. + +1999-01-12 Richard Henderson + + * cp-tree.h (flag_permissive): Declare extern. + +1999-01-06 Mark Mitchell + + * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT + here. + (lang_type): Add is_partial_instantiation. Decrease width of + dummy. + (PARTIAL_INSTANTIATION_P): New macro. + (OPERATOR_TYPENAME_P): Remove. + * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not + OPERATOR_TYPENAME_P. + (grok_op_properties): Likewise. + * friend.c (do_friend): Handle friends that are member functions + correctly. + * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT. + * pt.c (instantiate_class_template): Rework for clarity. Avoid + leaving TYPE_BEING_DEFINED set in obscure cases. Don't do + any more partial instantiation than is absolutely necessary for + implicit typename. Set PARTIAL_INSTANTIATION_P. + (tsubst_decl): Use IDENTIFIER_TYPENAME_P. + * semantics.c (begin_class_definition): Handle partial + specializations of a type that was previously partially + instantiated. + +Wed Jan 6 03:18:53 1999 Mark Elbrecht + + * Make-lang.in (g++.o): Depend on prefix.h. + +1999-01-04 Jason Merrill + + * tree.c (bound_pmf_p): New fn. + * typeck.c (build_c_cast): Use it. + + * decl.c (grok_op_properties): Use same_type_p. diff --git a/contrib/gcc/cp/ChangeLog-2000 b/contrib/gcc/cp/ChangeLog-2000 new file mode 100644 index 00000000000..4855669fd62 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-2000 @@ -0,0 +1,7274 @@ +2000-12-29 Jakub Jelinek + + * decl.c (init_decl_processing): Fix sign of wchar_type_node. + +2000-12-29 Mark Mitchell + + * class.c (pushclass): Remove #if 0'd code. + * cp-tree.h (overload_template_name): Remove. + * decl.c (store_bindings): Simplify. + (pop_from_top_level): Likewise. + * pt.c (overload_template_name): Remove. + (instantiate_decl): Don't call push_to_top_level if it's not + needed. + +2000-12-28 Mark Mitchell + + * pt.c (register_local_specialization): Don't return a value. + (lookup_template_class): Use move-to-front heuristic when looking + up template instantiations. + (instantiate_decl): Only push_to_top_level when we're actually + going to instantiate the template. + +2000-12-29 Hans-Peter Nilsson + + * search.c (binfo_for_vtable): Return least derived class, not + most. Handle secondary vtables. + +2000-12-22 Jason Merrill + + * pt.c (more_specialized): Don't optimize len==0. + (fn_type_unification): If we're adding the return type, increase len. + + * typeck.c (build_binary_op): Fix pmf comparison logic. + + * call.c (joust): Use DECL_NONSTATIC_MEMBER_FUNCTION_P, not + DECL_STATIC_FUNCTION_P. + + * semantics.c (genrtl_finish_function): Don't try to jump to + return_label unless it exists. + + In partial ordering for a call, ignore parms for which we don't have + a real argument. + * call.c (joust): Pass len to more_specialized. + (add_template_candidate_real): Strip 'this', pass len. + * pt.c (more_specialized): Pass len down. Lose explicit_args parm. + (get_bindings_order): New fn. Pass len down. + (get_bindings_real): Strip 'this', pass len. + (fn_type_unification): Likewise. + (type_unification_real): Succeed after checking 'len' args. + (most_specialized_instantiation): Lose explicit_args parm. + * class.c (resolve_address_of_overloaded_function): Strip 'this', + pass len. + +2000-12-21 Jason Merrill + + * pt.c (tsubst_decl): A FUNCTION_DECL has DECL_RESULT, not + DECL_TEMPLATE_RESULT. + + * search.c (lookup_field_r): Call lookup_fnfields_1, not + lookup_fnfields_here. + + * parse.y (typename_sub2): Return the TYPE_DECL, not the type. + + * call.c (build_object_call): Also allow conversions that return + reference to pointer to function. + (add_conv_candidate): Handle totype being ref to ptr to fn. + (build_field_call): Also allow members of type reference to function. + Lose support for calling pointer to METHOD_TYPE fields. + + * error.c (dump_expr): Handle *_CAST_EXPR. + + * typeck2.c (build_scoped_ref): Always convert to the naming class. + + * tree.c (break_out_cleanups): Lose. + * cp-tree.h: Remove prototype. + * typeck.c (build_component_ref): Don't break_out_cleanups. + (build_compound_expr): Likewise. + * semantics.c (finish_expr_stmt): Likewise. + +2000-12-20 Richard Henderson + + * cp-tree.h: Update declarations. + * decl.c (finish_case_label): Return the new stmt node. + * semantics.c (finish_goto_stmt): Likewise. + (finish_expr_stmt, finish_return_stmt): Likewise. + (finish_break_stmt, finish_continue_stmt): Likewise. + (finish_asm_stmt): Likewise. + * parse.y (already_scoped_stmt): Set STMT_LINENO. + (compstmt, implicitly_scoped_stmt, stmt): Likewise. + (simple_if, simple_stmt): Return the new stmt node. + (save_lineno): New. + +2000-12-18 Joseph S. Myers + + * cp-tree.h: Don't declare warn_long_long. + +2000-12-15 Kriang Lerdsuwanakij + + * tree.c (no_linkage_helper): Use CLASS_TYPE_P instead of + IS_AGGR_TYPE. + +2000-12-15 Kriang Lerdsuwanakij + + * pt.c (unify): Handle when both ARG and PARM are + BOUND_TEMPLATE_TEMPLATE_PARM. + +2000-12-15 Kriang Lerdsuwanakij + + * pt.c (reduce_template_parm_level): Set DECL_ARTIFICIAL and + DECL_TEMPLATE_PARM_P. + +2000-12-15 Jason Merrill + + * init.c (build_new_1): Reorganize. Now with 100% fewer SAVE_EXPRs! + + * init.c (build_new_1): Don't strip quals from type. + + * decl.c (pushdecl): Don't check for linkage on a non-decl. + + * call.c (build_op_delete_call): See through ARRAY_TYPEs. + + * call.c (build_new_function_call): Lose space before paren in + error message. + (build_new_method_call): Likewise. + + * typeck2.c (build_m_component_ref): Propagate quals from datum. + +2000-12-14 Kriang Lerdsuwanakij + + * pt.c (check_explicit_specialization): Propagate default + function arguments to explicit specializations. + +2000-12-13 DJ Delorie + + * typeck.c (build_binary_op): Do signed/unsigned warnings for >? + and + + * error.c (dump_function_name): Don't let the user see __comp_ctor. + + Clean up copy-initialization in overloading code. + * call.c (build_user_type_conversion_1): Die if we are asked to + convert to the same or a base type. + (implicit_conversion): Avoid doing so. Lose reference binding code. + (convert_like_real): Treat BASE_CONV and RVALUE_CONV as implicit + direct-initialization. Also do direct-init part of copy-init. + (build_user_type_conversion): Don't provide context to convert_like. + * cvt.c (ocp_convert): build_user_type_conversion will now provide + the constructor call for copy-init. + + * pt.c (tsubst_decl): Call clone_function_decl here if this is an + instantiation of a member template. + (do_decl_instantiation): Not here. + +2000-12-07 Nathan Sidwell + + * class.c (check_field_decls): Don't special case anonymous + fields in error messages. + (note_name_declared_in_class): Use %D on diagnostic. + + * tree.c (pod_type_p): Use strip_array_types. + (cp_valid_lang_attribute): Likewise. + * typeck.c (cp_type_quals): Strip arrays separately, to avoid + multiple evaluations. + (cp_has_mutable_p): Use strip_array_types. + +2000-12-07 Nathan Sidwell + + * cp-tree.h (sufficient_parms_p): Declare new function. + * call.c (sufficient_parms_p): New function, broken out of ... + (add_function_candidate): ... here. Use it. + (add_conv_candidate): Use it. + * decl.c (grok_ctor_properties): Use it. + +2000-12-07 Jakub Jelinek + + * optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT. + +2000-12-07 Joseph S. Myers + + * decl2.c (lang_decode_option): Handle -Wformat-security. + +2000-12-06 Kriang Lerdsuwanakij + + * pt.c (verify_class_unification): New function. + (get_class_bindings): Use it. + (try_class_unification): Tidy. + (unify): Handle when argument of a template-id is not + template parameter dependent. + (template_args_equal): Handle when TREE_CODE's do not match. + +2000-12-06 Alexandre Oliva + + * lang-specs.h (c++): When invoking the stand-alone preprocessor + for -save-temps, pass all relevant -Defines to it, and then don't + pass them to cc1plus. + +2000-12-05 Will Cohen + + * decl.c (finish_case_label): Cleared + more_cleanups_ok in surrounding function scopes. + (define_label): Likewise. + +2000-12-05 Nathan Sidwell + + * cp-tree.h (IDENTIFIER_VIRTUAL_P): Document. + (get_matching_virtual): Remove. + (look_for_overrides): Declare new function. + * decl.c (grokfndecl): Don't set IDENTIFIER_VIRTUAL_P or + DECL_VINDEX here. + * class.c (check_for_override): Move base class iteration code + to look_for_overrides. + * search.c (next_baselink): Remove. + (get_virtuals_named_this): Remove. + (get_virtual_destructor): Remove. + (tree_has_any_destructors_p): Remove. + (struct gvnt_info): Remove. + (check_final_overrider): Remove `virtual' from error messages. + (get_matching_virtuals): Remove. Move functionality to ... + (look_for_overrides): ... here, and ... + (look_for_overrides_r): ... here. Set DECL_VIRTUAL_P, if found + to be overriding. + +2000-12-05 Nathan Sidwell + + * typeck.c (get_delta_difference): If via a virtual base, + return zero. + * cvt.c (cp_convert_to_pointer): If via a virtual base, do no + adjustment. + +2000-12-04 Richard Henderson + + * error.c (dump_tree): Use output_add_string not OB_PUTS. + +2000-12-04 Jason Merrill + + * mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector". + (write_builtin_type): Pass intSI_type_node and the like through + type_for_mode. + * method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'. + Pass intSI_type_node and the like through type_for_mode. + * decl2.c (arg_assoc_type): Handle VECTOR_TYPE like COMPLEX_TYPE. + * pt.c (tsubst, unify): Likewise. + * tree.c (walk_tree): Likewise. + * error.c (dump_type): Likewise. + (dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE. + + * Make-lang.in: Tweak top comment for emacs. + (cp/TAGS): Restore. + + * except.c (expand_throw): Use push_throw_library_fn for _Jv_Throw. + + * class.c (clone_function_decl): Robustify. + +2000-12-04 Michael Matz + + * decl.c (store_bindings): Only search in the non modified + old_bindings for duplicates. + +2000-12-04 Nathan Sidwell + + * error.c (dump_function_decl): Use DECL_VIRTUAL_P, not + TYPE_POLYMORPHIC_P. + + * typeck.c (build_static_cast): Remove unused variable. + +2000-12-01 Kriang Lerdsuwanakij + + * pt.c: Fix typo in comment. + +2000-12-01 Joseph S. Myers + + * decl2.c (warn_format): Remove definition. + (lang_decode_option): Handle -Wformat-nonliteral, + -Wno-format-extra-args and -Wno-format-y2k. Use set_Wformat. + +2000-12-01 Joseph S. Myers + + * decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define. + (init_decl_processing): Don't create string_type_node, + const_string_type_node, wint_type_node, intmax_type_node, + uintmax_type_node, default_function_type, ptrdiff_type_node and + unsigned_ptrdiff_type_node. Adjust position of call to + c_common_nodes_and_builtins. + (identifier_global_value): New function. + +2000-12-01 Nathan Sidwell + + * call.c (standard_conversion): Reject pointer to member + conversions from ambiguous, inaccessible or virtual bases. + * typeck.c (build_static_cast): Don't check pointers to members + specially. + +2000-11-30 Nathan Sidwell + + * method.c (do_build_copy_constructor): Preserve cv + qualifications when accessing source object members. + (do_build_assign_ref): Likewise. Remove separate diagnostics for + unnamed fields. + +2000-11-30 Nathan Sidwell + + * method.c (do_build_assign_ref): Construct appropriately + CV-qualified base reference. Don't allow const casts in base + conversion. + +2000-11-30 Nathan Sidwell + + * call.c (build_over_call): Use VOID_TYPE_P. Don't die on + incomplete return type. + +2000-11-28 Nathan Sidwell + + * parse.y (base_class.1): Produce a _TYPE not a _DECL. + * semantics.c (finish_base_specifier): Accept a _TYPE not a + _DECL. + +2000-11-28 Nathan Sidwell + + * spew.c (yyerror): Cope if yylval.ttype is NULL. + +2000-11-28 Nathan Sidwell + + * decl.c (grokdeclarator): Diagnose undefined template contexts. + +2000-11-28 Nathan Sidwell + + * decl.c (grokdeclarator): Do type access control on friend + class. + +2000-11-27 Nathan Sidwell + + * decl.c (grokfndecl): Undo COMPONENT_REF damage caused by + bison parser ickiness. + * pt.c (tsubst_friend_function): Enter namespace scope when + tsubsting the function name. + * cp-tree.h (DECL_TI_TEMPLATE): Update comment to reflect reality. + +2000-11-27 Nathan Sidwell + + * cp-tree.h (binfo_from_vbase): Return the virtual base's binfo. + * cvt.c (cp_convert_to_pointer): Add force parameter. + Allow conversions via virtual base if forced. + (convert_to_pointer_force): Adjust call to cp_convert_to_pointer. + (ocp_convert): Likewise. + * search.c (binfo_from_vbase): Return the virtual base's binfo. + * typeck.c (get_delta_difference): Adjust handling of virtual + bases. + +2000-11-26 Mark Mitchell + + * tree.c (struct list_hash): Remove. + (list_hash_table): Make it be an htab. + (struct list_proxy): New type. + (list_hash_eq): New function. + (list_hash_pieces): Renamed from ... + (list_hash): ... this. + (list_hash_lookup): Remove. + (list_hash_add): Remove. + (hash_tree_cons): Use the generic hashtable. + (mark_list_hash): Remove. + (init_tree): Create the hashtable. + +2000-11-25 Joseph S. Myers + + * method.c (build_mangled_C9x_name): Rename to + build_mangled_C99_name. Change C9X references in comments to + refer to C99. + +2000-11-24 Nathan Sidwell + + * parse.y (unary_expr): Move VA_ARG from here ... + (primary): ... to here. + +2000-11-24 Nathan Sidwell + + * semantics.c (finish_id_expr): If type is error_mark, return + error_mark. + +2000-11-23 Nathan Sidwell + + * pt.c (lookup_template_class): Simplify loop exit constructs. + Cope when there is no partial instantiation of a template + template member. + +2000-11-23 J"orn Rennecke + + * Make-lang.in (g++spec.o, cxxmain.o): Depend on $(CONFIG_H). + +2000-11-22 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Don't use `__op' + prefix. + + * pt.c (do_decl_instantiate): Explicitly clone constructors and + destructors that haven't already been cloned. + +2000-11-20 Richard Henderson + + * parse.y (yyparse_1): Rename the parser entry point. + +2000-11-20 Alex Samuel + + * mangle.c (write_name): Use for names directly in + function scope. + (write_unscoped_name): Accept names directly in function scope. + +2000-11-20 Nathan Sidwell + + * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. + * parse.y (extdef): Add EXPORT reduction. + * spew.c (yylex): Don't skip export here. + +2000-11-19 Mark Mitchell + + * decl.c (init_decl_processing): Correct name of pure virtual + function under the new ABI. + * rtti.c (throw_bad_cast): Likewise, for bad cast function. + (throw_bad_typeid): Likewise for bad typeid function. + +2000-11-18 Mark Mitchell + + * decl.c (grokparms): Don't even function types of `void' type, + either. + * mangle.c (write_type): Don't crash when confronted with the + error_mark_node. + + * decl.c (grokparms): Don't create parameters of `void' type. + +2000-11-17 Zack Weinberg + + * lex.c (mark_impl_file_chain): Delete. + (init_parse): Remove call to ggc_add_string_root. No need to + ggc_strdup a string constant. Do not add impl_file_chain to GC + roots. + (handle_pragma_implementation): No need to ggc_strdup main_filename. + +2000-11-17 Nathan Sidwell + + * pt.c (tsubst_expr, DECL_STMT): Instantiate decl's type. + +2000-11-17 Nathan Sidwell + + * cp-tree.h (PARMLIST_ELLIPSIS_P): New macro. + * decl.c (grokdeclarator): Don't reject void parms here. + (require_complete_types_for_parms): Simplify, use + complete_type_or_else. + (grokparms): Remove bitrot. Remove funcdef parm. + Deal with ellipsis parm lists here. + * semantics.c (finish_parmlist): Don't append void_list_node + here. Set PARMLIST_ELLIPSIS_P. + +2000-11-17 Nathan Sidwell + + * typeck2.c (incomplete_type_error): Reorganize to avoid + excessive diagnostics. + +2000-11-16 Zack Weinberg + + * lex.c (struct impl_files, internal_filename): Constify a char *. + +2000-11-16 Mark Mitchell + + * mangle.c (write_special_name_constructor): Don't generate + assembler junk when confronted with an old-style constructor. + (write_special_name_destructor): Likewise. + (mangle_decl_string): Do it here instead. + +2000-11-16 Nathan Sidwell + + * call.c (op_error): Make error messages clearer. + +2000-11-15 Mark Mitchell + + * decl.c (wrapup_globals_for_namespace): Don't mark things + TREE_ASM_WRITTEN when they're not. + +2000-11-15 Jason Merrill + + * typeck2.c (friendly_abort): Uncount the error before handing + off to fancy_abort. + +2000-11-15 Nathan Sidwell + + * typeck.c (lookup_anon_field): Cope with qv qualifiers. + +2000-11-14 Mark Mitchell + + * class.c (build_vtbl_initializer): Fix typo in comment. + * typeck.c (expr_sizeof): Don't crash on errors. + +2000-11-14 Jim Wilson + + * lang-specs.h: Add %2 after %(cc1_options). + +2000-11-14 Richard Henderson + + * typeck.c (c_sizeof): Be strict about casting result value + back to c_size_type_node. + (expr_sizeof, c_sizeof_nowarn, c_alignof): Likewise. + +2000-11-13 Joseph S. Myers + + * typeck.c (build_unary_op): Use boolean_increment from + c-common.c, moving the relevant code there. + +2000-11-11 Jason Merrill + + * typeck.c (mark_addressable): Don't call put_var_into_stack. + + * decl.c (maybe_commonize_var): Set DECL_UNINLINABLE for statics + in inlines. + +2000-11-10 Kaveh R. Ghazi + + * decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy. + * lex.c (copy_lang_decl): Likewise. + +2000-11-09 Mark Mitchell + + * dump.c (cp_dump_tree): Don't dump function bodies here. + + * Make-lang.in (CXX_C_OBJS): Add c-dump.o. + (dump.o): Update dependency list. + * cp-tree.h (DECL_MAYBE_TEMPLATE): Remove. + (flag_dump_translation_unit): Likewise. + (CP_TYPE_QUALS): Adjust definition. + (DECL_C_BIT_FIELD): Remove. + (SET_DECL_C_BIT_FIELD): Likewise. + (CLEAR_DECL_C_BIT_FIELD): Likewise. + (add_maybe_template): Likewise. + (strip_array_types): Likewise. + (dump_node_to_file): Likewise. + (cp_dump_tree): New function. + * decl.c (init_decl_processing): Set lang_dump_tree. + * decl2.c (flag_dump_translation_unit): Remove. + * dump.c: Move most of it to ../c-dump.c. + (cp_dump_tree): New function. + * pt.c (add_maybe_template): Remove. + * typeck.c (strip_array_types): Likewise. + +2000-11-07 Eric Christopher + + * decl.c (init_decl_processing): Change definition of + __wchar_t to wchar_t. Remove artificial declaration of + wchar_t. + * lex.c: Change instances of __wchar_t to wchar_t. + +2000-11-09 Nathan Sidwell + + * lex.c (do_identifier): Don't lookup_name for operators. + * parse.y (operator): Save looking_for_typename. + (unoperator): Restore it. + * spew.c (frob_opname): Use nth_token for lookahead. + +2000-11-08 Nathan Sidwell + + * decl.c (grok_op_properties): Always use coerce_new_type and + coerce_delete_type. + * decl2.c (coerce_new_type): Use c_size_type_node. Preserve + exception specification. Tidy up. + (coerce_delete_type): Preserve exception specification. Tidy up. + +2000-11-07 Joseph S. Myers + + * class.c (duplicate_tag_error, build_vtbl_initializer), decl.c + (push_binding_level), error.c (cp_tree_printer), pt.c + (process_partial_specialization, tsubst_template_arg_vector), + search.c (lookup_member): Use memset () instead of bzero (). + +2000-11-07 Nathan Sidwell + + * decl.c (build_ptrmemfunc_type): Allow error_mark_node. + +2000-11-05 Joseph S. Myers + + * Make-lang.in (c++.distdir): Remove. + +2000-11-04 Mark Mitchell + + * decl2.c (do_nonmember_using_decl): Allow `extern "C"' + declarations from different namespaces to be combined. + +2000-11-03 Zack Weinberg + + * decl.c: Include tm_p.h. + +2000-11-03 Joseph S. Myers + + * tree.c (cp_tree_equal): Use memcmp () instead of bcmp (). + +2000-11-02 Joseph S. Myers + + * dump.c (dequeue_and_dump), lex.c (interface_strcmp), method.c + (build_overload_value), repo.c (open_repo_file), xref.c + (open_xref_file): Use strchr () and strrchr () instead of index () + and rindex (). + +2000-11-01 Bernd Schmidt + + * call.c (build_over_call): Call fold on the CALL_EXPR. + +2000-11-01 Gabriel Dos Reis + + * error.c (dump_template_decl): Separate template hearders with + space not comma. + +2000-10-31 Gabriel Dos Reis + + * error.c: Move TFF_ macros into cp-tree.h. Throughout, replace + TS_* flags with corresponding TFF_*. Adjust prototypes of + functions (which used to take a tree_string_flags) to take an int. + + * cp-tree.h (enum tree_string_flags): Remove + (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, + TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPEDEF, TFF_DECL_SPECIFIERS, + TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, + TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, + TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, + TFF_TEMPLATE_NAME, TFF_EXPR_IN_PARENS, TFF_SCOPE): New macros. + (type_as_string, decl_as_string, expr_as_string, + context_as_string): Adjust prototype. + + * class.c (dump_class_hierarchy_r): Use TFF_PLAIN_IDENTIFIER + instead of TS_PLAIN. + + * pt.c (mangle_class_name_for_template): Use TFF_CHASE_TYPEDEF + instead of TF_CHASE_TYPEDEFS. Use TFF_PLAIN_IDENTIFIER instead of + plain `0'. + +2000-10-30 Mark Mitchell + + * cp-tree.h (DECL_EXTERNAL_LINKAGE_P): New macro. + (linkage_kind): New enumeration. + (decl_linkage): New function. + * decl2.c (comdat_linkage): Extend comment. + * error.c (dump_function_decl): Print the arguments used to + instantiate a template, even when not printing the type of the + function. + * pt.c (convert_nontype_argument): Use DECL_EXTERNAL_LINKAGE_P, + not TREE_PUBLIC, to test for external linkage. + * tree.c (decl_linkage): New function. + +2000-10-28 Mark Mitchell + + * pt.c (instantiate_decl): Always instantiate static data members + initialized in-class. + +2000-10-27 Zack Weinberg + + * Make-lang.in: Move all build rules here from Makefile.in, + adapt to new context. Wrap all rules that change the current + directory in parentheses. Expunge all references to $(P). + When one command depends on another and they're run all at + once, use && to separate them, not ;. Add OUTPUT_OPTION to + all object-file generation rules. Delete obsolete variables. + + * Makefile.in: Delete. + * config-lang.in: Delete outputs= line. + +2000-10-26 Gabriel Dos Reis + + * error.c (dump_function_decl): Print no space between + `ptr-operator' the `type-specifier' of the return type. + (dump_type_prefix): Make sure we put space at the appropriate + place. + +2000-10-23 Jason Merrill + + * call.c (equal_functions): Also call decls_match for extern "C" fns. + +2000-10-22 Jason Merrill + + * call.c (build_conditional_expr): Use ocp_convert to force + rvalue conversion. + +2000-10-22 Mark Mitchell + + * call.c (standard_conversion): Use RVALUE_CONVs for all + expressions that satisfy lvalue_p, not just those that satisfy + real_lvalue_p. + + * optimize.c (copy_body_r): Don't treat CALL_EXPRs specially. + + * typeck.c (c_sizeof): Return an expression of `size_t' type, + not one with TYPE_IS_SIZETYPE set. + (dubious_conversion_warnings): Remove special-case code. + +2000-10-21 Geoffrey Keating + + * decl2.c (arg_assoc_type): Handle VECTOR_TYPE. + * error.c (dump_type): Handle VECTOR_TYPE like POINTER_TYPE. + (dump_type_prefix): Print vector-of-int as 'int vector'. + (dump_type_suffix): Handle VECTOR_TYPE like POINTER_TYPE. + * tree.c (walk_tree): Handle VECTOR_TYPE. + + * decl.c (init_decl_processing): Call MD_INIT_BUILTINS. + +2000-10-21 Jason Merrill + + * parse.y (operator): Set got_object from got_scope. + Set looking_for_typename. + * decl.c (lookup_name_real): Clear val after setting from_obj. + Reorganize diagnostic. + +2000-10-20 Jason Merrill + + * tree.c (walk_tree): Don't walk into default args. + + * error.c (dump_expr): Use host_integerp. + +2000-10-20 David Edelsohn + + * typeck2.c (abstract_virtuals_error): Use "because" instead of + "since" in error message. + +2000-10-20 Richard Kenner + + * typeck.c (dubious_conversion_warning): Suppress if TYPE_IS_SIZETYPE. + +2000-10-20 Jeffrey Oldham + + * decl.c (revert_static_member_fn): Fixed typo. + +2000-10-19 Mark Mitchell + + * class.c (subobject_offset_fn): New type. + (dfs_record_base_offsets): Remove. + (record_base_offsets): Likewise. + (dfs_search_base_offsets): Likewise. + (record_subobject_offset): New function. + (check_subobject_offset): Likewise. + (walk_subobject_offsets): Likewise. + (record_subobject_offsets): Likewise. + (layout_conflict_p): Reimplement. + (layout_nonempty_base_or_field): Correct handling of type + conflicts during layout. + (layout_empty_base): Likewise. + (build_base_field): Adjust to handle new representation of empty + base offset table. + (build_base_fields): Likewise. + (layout_virtual_bases): Likewise. + (splay_tree_compare_integer_csts): New function. + (layout_class_type): Use a splay_tree, rather than a varray, to + represent the offsets of empty bases. + + * cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL. + * decl.c (select_decl): Don't return declarations that are + DECL_ANTICIPATED. + +2000-10-18 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD. + (fake_std_node): New macro. + * decl.c (in_std): Rename to ... + (in_fake_std): ... this. + (flag_no_builtin): Remove. + (flag_no_nonansi_builtin): Likewise. + (walk_namespaces_r): Use fake_std_node. + (push_namespace): Use std_identifier. + (pop_namespace): Use in_fake_std. + (lookup_name_real): Use fake_std_node. + (init_decl_processing): When -fhonor-std, create the `std' + namespace. Don't create a dummy fake_std_node in that case. + Adjust call to c_common_nodes_and_builtins. Use std_identifier. + (builtin_function): Put builtins whose names don't begin + with `_' in the std namespace. + * decl2.c (flag_no_builtin): Remove. + (flag_no_nonansi_builtin): Likewise. + (set_decl_namespace): Use fake_std_node. + (validate_nonmember_using_decl): Likewise. + (do_using_directive): Likewise. + (handle_class_head): Likewise. + * dump.c (dequeue_and_dump): Likewise. + * except.c (init_exception_processing): Use std_identifier. + * init.c (build_member_call): Use fake_std_node. + * rtti.c (init_rtti_processing): Use std_identifier. + +2000-10-17 Mark Mitchell + + * cp-tree.h (back_end_hook): Remove declaration. + * decl2.c (back_end_hook): Remove definition. + + * dump.c (dequeue_and_dump): Dump TREE_USED. + +2000-10-17 Brad Lucier + + * spew.c (snarf_defarg): Cast 2nd arg to obstack_blank to (int). + +2000-10-17 Joseph S. Myers + + * decl.c (WINT_TYPE): Define. + (init_decl_processing): Create types unsigned_ptrdiff_type_node, + c_size_type_node, signed_size_type_node and wint_type_node. + +2000-10-17 Joseph S. Myers + + * decl2.c (warn_missing_format_attribute): New variable. + (lang_decode_option): Decode -Wmissing-format-attribute. + +2000-10-16 Mark Mitchell + + * typeck.c (qualify_type): Remove. + (composite_pointer_type): Fix handling of conversions to `cv void*'. + +2000-10-14 Kaveh R. Ghazi + + * Makefile.in (parse.c, parse.h): Fix think-o in last patch. + +2000-10-13 Kaveh R. Ghazi + + * Makefile.in (parse.c, parse.h): Create atomically. + +2000-10-12 Mark Mitchell + + * class.c (current_obstack): Remove. + * decl.c (ggc_p): Remove. + (start_decl): Don't use decl_tree_cons. + (grokdeclarator): Don't use build_decl_list. + (start_function): Don't use decl_tree_cons. + (finish_function): Don't mess with obstacks. + * decl2.c (grok_x_components): Don't use build_decl_list. + * lex.c (make_call_declarator): Don't call decl_tree_cons. + (implicitly_declare_fn): Don't call build_decl_list. + * parse.y (frob_specs): Don't call build_decl_list or + decl_tree_cons. + (expr_or_declarator_intern): Don't call decl_tree_cons. + (primary): Don't call build_decl_list. + (fcast_or_absdcl): Likewise. + (typed_declspecs): Don't call decl_tree_cons. + (reserved_declspecs): Don't call build_decl_list. + (declmods): Likewise. + (reserved_typespecquals): Likewise. + (aggr): Likewise. + (new_type_id): Likewise. + (cv_qualifiers): Likewise. + (after_type_declarator_intern): Likewise. + (notype_declarator_intern): Likewise. + (absdcl_intern): Likewise. + (named_parm): Likewise. + * pt.c (most_specialized_class): Likewise. + * repo.c (temporary_obstack): Make it a structure, not a pointer. + (init_repo): Initialize it. + * search.c (current_obstack): Remove. + * typeck2.c (add_exception_specifier): Don't call build_decl_list. + +2000-10-09 Richard Henderson + + * Make-lang.in (CXX_EXTRA_HEADERS): Remove. + (c++ language support bits for libgcc): Remove. + (c++.clean): Remove cplib2.txt cleanup. + * config-lang.in (headers, lib2funcs): Remove. + + * exception.cc, new.cc, new1.cc, new2.cc: Remove files. + * tinfo.cc, tinfo.h, tinfo2.cc, vec.cc: Remove files. + * inc/cxxabi.h, inc/exception, inc/new: Remove files. + * inc/new.h, inc/typeinfo: Remove files. + +2000-10-08 Joseph S. Myers + + * decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already + defined. + (init_decl_processing): Initialize intmax_type_node and + uintmax_type_node. + +2000-10-06 Richard Henderson + + * cp-tree.h (struct cp_language_function): Remove x_result_rtx. + (original_result_rtx): Remove. + * decl.c (save_function_data): Don't clear x_result_rtx. + (mark_lang_function): Don't mark it either. + * expr.c (fixup_result_decl): Remove. + * semantics.c (genrtl_named_return_value): Frob the return decl + before calling emit_local_var. + (genrtl_finish_function): Don't call fixup_result_decl. + Always emit the jump to return_label. + +2000-10-06 Nathan Sidwell + + * pt.c (lookup_template_class): Set current access for enum. + (tsubst_enum): Set file & line for enum decl. + + * spew.c (yylex): Remove unused variable. + +2000-10-05 Richard Henderson + + * semantics.c (genrtl_finish_function): Don't init or check + can_reach_end; remove noreturn and return value checks. + +2000-10-05 Tom Tromey + + * init.c (build_java_class_ref): Use `build_static_name' with a + suffix, not a prefix, to build the class object's name. + +2000-10-05 Nathan Sidwell + + * cp-tree.h (access_kind): Fix comment typo. + * decl2.c (grokfield): Fix diagnostic typo. + * semantics.c (finish_template_type): Fix comment typo. + (finish_qualified_object_call_expr): Likewise. + +2000-10-05 Nathan Sidwell + + * pt.c (tsubst_expr, DECL_STMT case): Don't process if + tsubsting fails. + +2000-10-05 Nathan Sidwell + + * spew.c (frob_id): New static function. + (frob_opname): Use it. + (yylex): Use it. + +2000-10-01 Mark Mitchell + + * decl.c (lang_mark_false_label_stack): Remove. + * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. + +2000-09-30 Joseph S. Myers + + * gxxint.texi: Use @email for formatting email addresses. + +2000-09-29 Gabriel Dos Reis + + * error.c: Remove direct obstack manipulation. Replace with + output_buffer-based formatting. Adjust calls to removed macros. + (obstack_chunk_alloc, obstack_chunk_free): Remove. + (OB_INIT, OB_PUTC, OB_PUTC2, OB_PUTS, OB_PUTID, OB_PUTCP, + OB_FINISH, OB_PUTI, OB_END_TEMPLATE): Likewise. + +2000-09-24 Mark Mitchell + + * ir.texi: Move to ../c-tree.texi. + +2000-09-20 Jason Merrill + + * decl2.c (get_guard): Check DECL_FUNCTION_SCOPE_P. + +2000-09-21 Andreas Jaeger + + * errfn.c: Move declaration of cp_printer and cp_printers to ... + * cp-tree.h: ... here. + + * error.c: Remove declaration of cp_printer. + +2000-09-20 Mark Mitchell + + * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. + +2000-09-20 Hans-Peter Nilsson + + * except.c: Delete #if 0:d EXCEPTION_SECTION_ASM_OP-default and + users. + +2000-09-18 Mark Mitchell + + * decl.c (start_function): Robustify. + +2000-09-18 Kaveh R. Ghazi + + * cp-tree.h (check_function_format): Accept a `status' parameter. + + * call.c, typeck.c: Updates calls to `check_function_format'. + +2000-09-17 Geoffrey Keating + + * decl2.c (handle_class_head): Always push some scope even + in the error case. + +2000-09-16 Mark Mitchell + + * cp-tree.h (struct cp_language_function): Remove + x_scope_stmt_stack and name_declared. + (current_scope_stmt_stack): Remove. + (function_name_declared_p): New macro. + (struct lang_decl_flags): Use c_lang_decl as a base class. + (context): Remove. + (struct lang_decl): Replace saved_tree with context. + (DECL_FRIEND_CONTEXT): Adjust accordingly. + (SET_DECL_FRIEND_CONTEXT): Likewise. + (DECL_VIRTUAL_CONTEXT): Likewise. + (DECL_SAVED_TREE): Remove. + (C_DECLARED_LABEL_FLAG): Likewise. + (cplus_expand_expr_stmt): Don't declare. + (add_decl_stmt): Likewise. + (add_scope_stmt): Likewise. + * decl.c (mark_stmt_tree): Remove. + (case_compare): Likewise. + (finish_case_label): Use c_add_case_label. + (init_decl_processing): Set more language-specific hooks. + (build_enumerator): Fix typo in comment. + (cplus_expand_expr_stmt): Remove. + (mark_lang_function): Use mark_c_language_function. + (lang_mark_tree): Use c_mark_lang_decl. + * decl2.c: Change order of inclusion. + * except.c: Likewise. + * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall + back on c_expand_expr. + * friend.c: Include expr.h. + * init.c: Change order of inclusion. + * Makefile.in: Update dependencies. + * lex.h (free_lang_decl_chain): Remove. + * optimize.c (maybe_clone_body): Use function_name_declared_p. + * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if + it doesn't exist. + (instantiate_decl): Use function_name_declared_p. + * semantics.c (lang_expand_expr_stmt): Remove. + (set_current_function_name_declared): Likewise. + (current_function_name_declared): Likewise. + (begin_compound_stmt): Use function_name_declared_p. + (add_decl_stmt): Remove. + (setup_vtbl_ptr): Use function_name_declared_p. + (add_scope_stmt): Remove. + (current_scope_stmt_stack): New function. + (cp_expand_stmt): Don't handle SCOPE_STMTs. + (expand_body): Use function_name_declared_p. + * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. + * typeck.c: Change order of includes. + (convert_sequence): Remove. + +2000-09-14 Joseph S. Myers + + * lex.c (reswords): Add _Complex. + +2000-09-14 Richard Kenner + + * Make-lang.in (cplib2.txt): Depend on cp/Makefile. + +2000-09-13 J. David Anglin + + * init.c (begin_init_stmts): Don't use // comments. + +2000-09-12 Jason Merrill + + * decl.c (maybe_deduce_size_from_array_init): Set do_default for + all non-extern arrays. + + * decl.c (grokdeclarator): Complain about 'friend T' for implicit + typenames, too. Downgrade complaint to pedwarn. + (xref_tag): Warn about surprising behavior of 'friend struct T'. + * decl2.c (handle_class_head): Generate a TYPENAME_TYPE for + 'class This::Inherited'. + +2000-09-12 Mark Mitchell + + * decl.c (finish_case_label): Given the LABEL_DECL a + DECL_CONTEXT. + +2000-09-12 Gabriel Dos Reis + + * error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, + TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPDEF, + TFF_DECL_SPECIFIERS, TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, + TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, + TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, TFF_SCOPE): + New macros. + (sorry_for_unsupported_tree, print_scope_operator, + print_left_paren, print_right_paren, print_left_bracket, + print_right_bracket, print_whitespace): Likewise. + (aggr_variety): Rename to class_key_or_enum. + (print_type): Rename to print_type_id. + (print_type_specifier_seq, print_simple_type_specifier, + print_elaborated_type_specifier, + print_rest_of_abstract_declarator, + print_parameter_declaration_clause, print_exception_specification, + print_nested_name_specifier, print_template_id, + typedef_original_name, print_template_argument_list_start, + print_template_argument_list_end): New functions. + +2000-09-11 Gabriel Dos Reis + + * ir.texi: Add more documentation. + +2000-09-11 Mark Mitchell + + * cp-tree.h (struct saved_scope): Remove x_function_parms. + (current_function_parms): Don't define. + (struct cp_language_function): Remove parms_stored. + (current_function_just_assigned_this): Don't define. + (current_function_parms_stored): Likewise. + (static_ctors): Declare. + (static_dtors): Likewise. + (SF_EXPAND): Don't define. + (expand_start_early_try_stmts): Remove declaration. + (store_parm_decls): Likewise. + * decl.c (static_ctors): Don't declare. + (static_dtors): Likewise. + (struct binding_level): Remove this_block. + (poplevel): Remove dead code. + (set_block): Likewise. + (mark_binding_level): Don't mark this_block. + (mark_saved_scope): Don't mark x_function_parms. + (init_decl_processing): Don't add current_function_parms as a GC + root. + (check_function_type): Change prototype. + (start_function): Remove RTL-generation code. + (expand_start_early_try_stmts): Remove. + (store_parm_decls): Give it internal linkage. Remove + RTL-generation code. + (finish_function): Remove RTL-generation code. + * decl2.c (static_ctors): Fix formatting. + (static_dtors): Likewise. + * method.c (use_thunk): Don't call store_parm_decls. + (synthesize_method): Likewise. + * optimize.c (maybe_clone_body): Likewise. + * parse.y (fn.def2): Likewise. + (.set_base_init): Likewise. + (nodecls): Likewise. + * pt.c (instantiate_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * semantics.c (genrtl_try_block): Simplify. + (expand_body): Use genrtl_start_function and + genrtl_finish_function. + (genrtl_start_function): New function. + (genrtl_finish_function): Likewise. + +2000-09-11 Nathan Sidwell + + * error.c (cp_tree_printer, case 'P'): Append break. + +2000-09-11 Nathan Sidwell + + * cp-tree.h (frob_opname): Declare. + * parse.y (saved_scopes): New static variable. + (cp_parse_init): Adjust. + (do_id): If lastiddecl is NULL, do do_identifier. + (operator): Save scope information. + (unoperator): New reduction. Restore scope information. + (operator_name): Append unoperator. Call frob_opname. + * spew.c (frob_opname): Define. + +2000-09-10 Zack Weinberg + + * decl.c, rtti.c: Include defaults.h if not already included. + Don't define the *_TYPE_SIZE macros. + +2000-09-09 Mark Mitchell + + * cp-tree.h (push_switch): Change prototype. + (check_cp_case_value): Remove declaration. + (decl_constant_value): Likewise. + * decl.c (struct cp_switch): Add switch_stmt and cases. + (case_compare): New function. + (push_switch): Set switch_stmt. Initialize cases. + (pop_switch): Clean up cases. + (define_case_label): Rename to ... + (finish_case_label): ... this. Do semantic analysis for case + labels here. + (start_function): Correct comment. + * decl2.c (check_cp_case_value): Remove. + * expr.c (do_case): Remove. + * pt.c (tsubst_expr): Adjust call to finish_case_label. + * semantics.c (genrtl_do_poplevel): Remove declaration. + (RECHAIN_STMTS): Remove. + (finish_break_stmt): Use build_break_stmt. + (finish_continue_stmt): Use build_continue_stmt. + (finish_switch_cond): Adjust condition here, rater than in + c_expand_start_case. + (finish_case_label): Remove. + * typeck.c (c_expand_return): Remove. + (c_expand_start_case): Likewise. + +2000-09-07 Gabriel Dos Reis + + * ir.texi: Document type nodes. + +2000-09-06 Mark Mitchell + + * cp-tree.h (init_cp_semantics): Declare. + (genrtl_try_block): Don't declare. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_named_return_value): Likewise. + * lex.c (init_parse): Call init_cp_semantics. + * semantics.c (genrtl_try_block): Give it internal linkage. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_named_return_value): Likewise. + (lang_expand_stmt): Rename to ... + (cp_expand_stmt): ... this. Only handle C++-specific nodes. + (init_cp_semantics): Define. + + * decl.c (initialize_local_var): Remove RTL-generating code. + * semantics.c (genrtl_try_block): Fix formatting. + + Move statement-tree facilities from C++ to C front-end. + * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. + (void_zero_node): Remove. + (stmt_tree): Likewise. + (scope_chain): Adjust. + (language_function): Rename to cp_language_function. + (cp_function_chain): Adjust. + (current_stmt_tree): Remove. + (last_tree): Likewise. + (last_expr_type): Likewise. + (struct lang_decl): Adjust. + (STMT_IS_FULL_EXPR_P): Remove. + (add_tree): Remove. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (walk_tree_fn): Likewise. + (walk_stmt_tree): Likewise. + * class.c (finish_struct): Replace use of add_tree with add_stmt. + * decl.c (mark_stmt_tree): Adjust type. + (init_decl_processing): Don't build void_zero_node. + (initialize_local_var): Adjust usage of current_stmt_tree. + (finish_enum): Use add_stmt, not add_tree. + (save_function_data): Adjust use of language_function. + (finish_constructor_body): Use add_stmt, not add_tree. + (finish_destructor_body): Likewise. + (push_cp_function_context): Adjust use of language_function. + (pop_cp_function_context): Likewise. + (mark_lang_function): Likewise. + (mark_cp_function_context): Likewise. + * init.c (build_aggr_init): Adjust use of current_stmt_tree. + (build_vec_init): Likewise. + * semantics.c (SET_LAST_STMT): Remove. + (RECHAIN_STMTS): Don't use it. + (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. + (current_stmt_tree): Define. + (add_tree): Remove. + (finish_goto_stmt): Use add_stmt, not add_tree. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (finish_then_clause): Likewise. + (begin_while_stmt): Likewise. + (begin_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_case_label): Likewise. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (begin_handler): Likewise. + (begin_catch_block): Likewise. + (begin_compound_stmt): Likewise. + (begin_asm_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (add_decl_stmt): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (setup_vtbl_ptr): Likewise. + (add_scope_stmt): Likewise. + (finish_stmt_expr): Likewise. + (prune_unused_decls): Remove. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (prep_stmt): Adjust use of current_stmt_tree. + (lang_expand_stmt): Likewise. + * tree.c (statement_code_p): Remove. + (cp_statement_code_p): New function. + (walk_stmt_tree): Remove. + (init_tree): Set lang_statement_code_p. + +2000-09-06 Zack Weinberg + + Integrated preprocessor. + + * Make-lang.in, Makefile.in: Remove all references to input.c, + gxx.gperf, and hash.h. Add ../c-lex.o to C_OBJS. + * gxx.gperf, hash.h, input.c: Delete. + * lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is + initialized properly. + + * class.c (fixup_pending_inline): Take a tree, not a + struct pending_inline *. All callers changed. + (init_class_processing): Set RID_PUBLIC, RID_PRIVATE, + RID_PROTECTED entries in ridpointers[] array here. + * decl.c (duplicate_decls): Do not refer to struct + pending_inline. + (record_builtin_type, init_decl_processing): Use RID_MAX not + CP_RID_MAX. + (grokdeclarator): Use C_IS_RESERVED_WORD. + * decl2.c (lang_decode_option): Ignore -lang-c++ for sake of + cpplib. + (grok_x_components): Do not inspect pending_inlines chain. + + * cp-tree.h (struct lang_identifier): Add rid_code entry. + (C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New. + (flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare. + (DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME, + TIME_IDENTIFIER_FILEINFO): Kill. + Update prototypes. + * lex.h: Expunge cp_rid. Rewrite RIDBIT macros to use just a + single 32-bit word. + * parse.y: Call do_pending_inlines unconditionally. + reinit_parse_for_method is now snarf_method. fn.defpen is no + longer necessary. Remove unnecessary annotation on + SCOPE. Do not refer to end_of_file or struct pending_inline. + * semantics.c (begin_inline_definitions): Call + do_pending_inlines unconditionally. + + * lex.c: Remove all code now shared with C front end. + Initialize cpplib properly if USE_CPPLIB. Put reserved words + into the get_identifier table. Rewrite pragma handling to + work with the registry. Move code to save tokens for later + processing to spew.c. + + * spew.c: Rewrite everything in terms of token streams instead + of text. Move routines here from lex.c / input.c as + appropriate. GC-mark trees hanging off the pending inlines + chain. + +2000-09-06 Mark Mitchell + + * NEWS: Mention that the named return value extension has been + deprecated. + * cp-tree.h (original_result_rtx): Define. + (TREE_REFERENCE_EXPR): Remove. + (DECL_VPARENT): Likewise. + (pushdecl_nonclass_level): Likewise. + (store_return_init): Likewise. + (reinit_lang_specific): Likewise. + (genrtl_named_return_value): Change prototype. + * decl.c (original_result_rtx): Remove. + (cp_finish_decl): Don't build DECL_STMTs for RESULT_DECLs. + Do not generate RTL for local variables here. + (store_return_init): Remove. + * semantics.c (genrtl_named_return_value): Simplify. Fold in + store_return_init. + (finish_named_return_value): Adjust accordingly. Warn that this + extension is deprecated. + (lang_expand_stmt): Adjust call to genrtl_named_return_value. + +2000-09-06 Nathan Sidwell + + * pt.c (type_unification_real): Replace switch with if. + (unify): Tsubst non-type parms before comparing. + +2000-09-06 Nathan Sidwell + + * error.c (dump_typename): New function, broken out of ... + (dump_type): ... here. Use it. + * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. + +2000-09-06 Nathan Sidwell + + * init.c (build_offset_ref): Deal with namespace scoped + TEMPLATE_ID_EXPRs. + +2000-09-06 Nathan Sidwell + + * class.c (resolve_address_of_overloaded_function): Add + explanation message. + * decl.c (define_case_label): Reformat explanation. + * decl2.c (finish_static_data_member_decl): Likewise. + (grokfield): Likewise. + * friend.c (do_friend): Likewise. + +2000-09-05 Zack Weinberg + + * tree.c (walk_tree): Expose tail recursion. + (walk_stmt_tree): New function. + * cp-tree.h: Prototype walk_stmt_tree. + * semantics.c (prune_unused_decls): Operate on SCOPE_STMTs not + the BLOCKs directly. If a BLOCK has no variables after + pruning, discard it. + (finish_stmt_tree): Use walk_stmt_tree. No need to save and + restore the line number. + +2000-09-05 Mark Mitchell + + * Makefile.in (CXX_TREE_H): Add dependency on HTAB_H. + (pt.o): Remove dependency on HTAB_H. + * cp-tree.h: Include hashtab.h. + (walk_tree): Change prototype. + (walk_tree_without_duplicates): New function. + * decl.c (check_default_argument): Use it. + * optimize.c (remap_decl): Adjust calls to walk_tree. + (copy_body): Likewise. + (expand_calls_inline): Likewise. + (calls_setjmp_p): Use walk_tree_without_duplicates. + * pt.c: Don't include hashtab.h. + (for_each_template_parm): Use walk_tree_without_duplicates. + * semantics.c (finish-stmt_tree): Likewise. + (expand_body): Likewise. + * tree.c (walk_tree): Add additional parameter. + (walk_tree_without_duplicates): New function. + (count_trees): Use it. + (verify_stmt_tree): Adjust call to walk_tree. + (find_tree): Use walk_tree_without_duplicates. + (no_linkage_check): Likewise. + (break_out_target_exprs): Adjust call to walk_tree. + (cp_unsave): Likewise. + +2000-09-04 Kriang Lerdsuwanakij + + * cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. + (TEMPLATE_TEMPLATE_PARM): Adjust comment. + * cp-tree.h (TYPE_BINFO): Adjust comment. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. + (TEMPLATE_TYPE_PARM_INDEX): Likewise. + (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. + (TYPE_TEMPLATE_INFO): Likewise. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise. + * class.c (push_nested_class): Likewise. + * decl.c (lookup_name_real): Likewise. + (grokdeclarator): Likewise. + (grok_op_properties): Likewise. + (xref_tag): Likewise. + (xref_basetypes): Likewise. + * decl2.c (constructor_name_full): Likewise. + (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case. + (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. + * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case. + (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (dump_type_suffix): Likewise. + * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM + instead. + (get_aggr_from_typedef): Likewise. + * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case. + (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (write_template_parm): Likewise. + (write_template_template_parm): Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + * method.c (build_overload_nested_name): Add + BOUND_TEMPLATE_TEMPLATE_PARM. + (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case. + * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (convert_template_argument): Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case. + (for_each_template_parm): Adjust comment. + (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. + (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. Use + template_args_equal to compare template template parameter cases. + * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM. + * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM + instead. + * tree.c (copy_template_template_parm): Decide whether to create + a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node. + (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (copy_tree_r): Likewise. + * typeck.c (comptypes): Likewise. Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + +2000-09-04 Mark Elbrecht + + * decl.c (finish_function): Move the code for handling functions + marked with the constructor and destructor attributes inside the + expand_p block. + +2000-09-04 Nathan Sidwell + + * init.c (resolve_offset_ref): Deal with TEMPLATE_ID_EXPR. + +2000-09-04 Nathan Sidwell + + * pt.c (lookup_template_class): Remove abort. + * tree.c (get_type_decl): Allow error_mark_node. + +2000-09-04 Nathan Sidwell + + * decl2.c (arg_assoc): Deal with COMPONENT_REFs inside + TEMPLATE_ID_EXPRs. + +2000-09-03 Mark Mitchell + + * operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Change + new ABI mangling. + +2000-09-01 Nathan Sidwell + + * parse.y (named_class_head): Check for TYPENAME_TYPE. Simplify + union tag mismatch error reporting. + +2000-09-01 Nathan Sidwell + + * call.c (build_scoped_method_call): Check it is not a namespace. + +2000-08-30 Jason Merrill + + * cp-tree.h (LOCAL_CLASS_P): Use decl_function_context. + + * tree.c (bot_manip): Check TREE_CONSTANT rather than + !TREE_SIDE_EFFECTS. Call break_out_target_exprs and + build_target_expr_with_type for the non-AGGR_INIT_EXPR case. + + * decl.c (start_function): Always call make_function_rtl. + +2000-08-29 Zack Weinberg + + * semantics.c (prune_unused_decls): New function. + (finish_stmt_tree): Call it via walk_tree. + +2000-08-29 Zack Weinberg + + * class.c (build_secondary_vtable): Constify a char *. + * decl.c (init_decl_processing): Initialize function_id_node, + pretty_function_id_node, and func_id_node. + * input.c (struct input_source): Constify 'str'. + (feed_input): Constify first argument. + * mangle.c (write_identifier): Constify argument. + * pt.c (mangle_class_name_for_template): Constify argument. + +2000-08-29 Mark Mitchell + + * typeck.c (mark_addressable): Remove code that pokes around in + RTL. + +2000-08-28 Jason Merrill + + * lex.c (file_name_nondirectory): Move to toplev.c. + + * cp-tree.h (LOCAL_CLASS_P): New macro. + * class.c (finish_struct_1): Use it. + +2000-08-27 Alex Samuel + + * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo. + (write_encoding): Pass another argument to write_name. + (write_name): Add ignore_local_scope parameter. Fix handling of + local names. + (write_nested_name): Use write_unqualified_name. + (write_prefix): Likewise. Skip out on FUNCTION_DECLs. + (write_template_prefix): Use write_unqualified_name. + (write_component): Remove. + (write_local_name): Add parameter. Use direct local entity to + discriminator calculation. + (write_class_enum_type): Pass another argument to write_name. + (write_template_template_arg): Likewise. + (make_guard_variable): Likewise. + +2000-08-27 Jason Merrill + + * decl.c (pushdecl): Matching decls for local externs are found in + the current level. Propagate linkage information from previous + declarations. + +2000-08-26 Gabriel Dos Reis + + * ir.texi (Expressions): Fix typo. + +2000-08-25 Greg McGary + + * tree.c (init_tree): Use ARRAY_SIZE. + +2000-08-25 Gabriel Dos Reis + + * error.c (cp_tree_printer): Rework. + +2000-08-25 Mark Mitchell + + * Make-lang.in (CXX_LIB2FUNCS): Remove cp-demangle.o and + dyn-string.o. + (CXX_LIB2SRCS): Remove cp-demangle.c and dyn-string.c. + (cp-demangle.o): Remove target. + (dyn-string.o): Likewise. + + * decl.c (grokfndecl): Require that `main' return an `int'. + * mangle.c (write_encoding): Don't mangle return types for + conversion functions. + +2000-08-25 Gabriel Dos Reis + + * error.c (tree_formatting_info): New data type. + (tree_being_formatted): New macro. + (tree_formatting_flags): Likewise. + (put_whitespace): Likewise. + (print_tree_identifier): Likewise. + (print_identifier): Likewise. + (cp_tree_printer, print_function_argument_list, print_declaration, + print_expression, print_function_declaration, + print_function_parameter, print_type, print_cv_qualifier): New + functions. + (init_error): Initialize lang_printer. + +2000-08-24 Jason Merrill + + * typeck.c (build_ptrmemfunc): Just reinterpret if there's no + adjustment necessary. + +2000-08-24 Greg McGary + + * cp-tree.h (MAIN_NAME_P): Remove macro. + +2000-08-24 Gabriel Dos Reis + + * error.c (print_instantiation_context): Don't forget to flush the + buffer. + +2000-08-23 Jason Merrill + + * typeck.c (build_ptrmemfunc): Save the input pmf. + + * method.c (process_modifiers): Use same_type_p. + +2000-08-23 Mark Mitchell + + * cp-tree.h (DECL_CLONED_FUNCTION_P): Check DECL_LANG_SPECIFIC. + * mangle.c (write_function_type): Change prototype. + (write_encoding): Don't mangle return types for + constructors or destructors. + (write_type): Adjust call to write_function_type. + * pt.c (instantiate_template): Instantiate alternate entry points + when instantiating the main function. + +2000-08-23 Gabriel Dos Reis + + * error.c (cp_print_error_function): Don't use embedded '\n' in + output_printf. + +2000-08-23 Gabriel Dos Reis + + * decl.c (init_decl_processing): Remove bogus initialization. + * error.c (lang_print_error_function): Restore here. + (init_error): Initialize print_error_function. + +2000-08-22 Theodore Papadopoulo + + * decl2.c (arg_assoc): Revert my 2000-08-11 change. + +2000-08-22 Gabriel Dos Reis + + * Makefile.in (error.o): Depends on diagnostic.h + + * cp-tree.h (problematic_instantiation_changed, + record_last_problematic_instantiation, current_instantiation, + print_instantiation_context): Declare. + (maybe_print_template_context): Remove. + + * decl.c (init_decl_processing): Set print_error_function to NULL. + (lang_print_error_function): Remove, since we're using a new + machinery. + + * error.c: #include diagnostic.h + (function_category): New function. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (maybe_print_instantiation_context): Likewise. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (print_instantiation_context): Define. + (init_error): Initialize diagnostic pager and finalizer. + + * pt.c (problematic_instantiation_changed): Define. + (record_last_problematic_instantiation): Likewise. + (current_instantiation): Likewise. + (maybe_print_template_context): Remove. + (print_template_context): Likewise. + (current_tinst_level): Make static to reflect Brendan Kehoe's + change of 1995-04-13. + (push_tinst_level): Call print_instantiation_context. + +2000-08-21 Nix + + * lang-specs.h: Do not process -o or run the assembler if + -fsyntax-only. + +2000-08-21 Joseph S. Myers + + * decl.c (flag_hosted, flag_noniso_default_format_attributes): New + variables. + * decl2.c (lang_decode_option): Disable gettext attributes for + -ansi. + +2000-08-21 Gabriel Dos Reis + + * lex.c (lang_init_options): Default diagnostic message maximum + length to 80, when line-wrapping. + +2000-08-20 Mark Mitchell + + * class.c (build_vtbl_initializer): Clear the entire + vtbl_init_data. Start keeping track of the functions for which we + have created vcall offsets here. + (dfs_build_vcall_offset_vtbl_entries): Remove. + (build_vcall_offset_vtbl_entries): Reimplement. + (add_vcall_offset_vtbl_entries_r): New function. + (add_vcall_offset_vtbl_entries_1): Likewise. Tweak logic for + computing when vcall offsets are necessary. + +2000-08-18 Nathan Sidwell + + * decl.c (member_function_or_else): Use cp_error ... %T. + (grokdeclarator): Likewise. + (start_method): Likewise. + * friend.c (make_friend_class): Use cp_pedwarn ... %T. + +2000-08-18 Nathan Sidwell + + * decl2.c (grokfield): Set CLASSTYPE_GOT_SEMICOLON on class + TYPE_DECLs. + +2000-08-18 Nathan Sidwell + + * cp-tree.h (PTRMEM_OK_P): New macro. + (itf_ptrmem_ok): New enumeration value. + * class.c (resolve_address_of_overloaded_function): Add PTRMEM + argument. Diagnose implicit pointer to member. + (instantiate_type): Don't diagnose implicit pointer to member + here. Pass itf_ptrmem_ok if ok. Adjust calls to + resolve_address_of_overloaded_function. + * init.c (build_offset_ref): Set PTRMEM_OK_P. + (resolve_offset_ref): Don't diagnose implicit pointer to member here. + * semantics.c (finish_parenthesized_expr): Clear OFFSET_REFs here. + * typeck.c (build_x_unary_op): Calculate PTRMEM_OK_P. + (build_unary_op): Deal with single non-static member in + microsoft-land. + +2000-08-18 Nathan Sidwell + + * decl2.c (arg_assoc_type): Cope with TYPENAME_TYPE. + +2000-08-18 Nathan Sidwell + + * cp-tree.h (enum_name_string): Remove prototype. + (report_case_error): Remove prototype. + * cp/typeck2.c (enum_name_string): Remove. + (report_case_error): Remove. + * error.c (dump_expr): Deal with enum values directly. + Correctly negate integer constant. + +2000-08-17 Nathan Sidwell + + * inc/cxxabi.h (__cxa_vec_new2, __cxa_vec_new3): Declare. + (__cxa_vec_delete2, __cxa_vec_delete3): Declare. + * vec.cc (__cxa_vec_new2, __cxa_vec_new3): Implement. + (__cxa_vec_delete2, __cxa_vec_delete3): Implement. + (__cxa_vec_new): Use __cxa_vec_new2. + (__cxa_vec_delete): Use __cxa_vec_delete2. + +2000-08-17 Nathan Sidwell + + * vec.cc (__cxa_vec_new): Set "C" linkage. + (__cxa_vec_ctor): Likewise. + (__cxa_vec_cctor): Likewise. + (__cxa_vec_dtor): Likewise. + (__cxa_vec_delete): Likewise. + * inc/cxxabi.h (__cxa_vec_new): Set "C" linkage. + (__cxa_vec_ctor): Likewise. + (__cxa_vec_cctor): Likewise. + (__cxa_vec_dtor): Likewise. + (__cxa_vec_delete): Likewise. + +2000-08-17 Nathan Sidwell + + * class.c (instantiate_type): Reinstate local variable + deleted in previous change. + + * cvt.c (cp_convert_to_pointer): Pass itf_complain, not + itf_no_attributes. + +2000-08-17 Nathan Sidwell + + * cp-tree.h (instantiate_type_flags): New enumeration. + (instantiate_type): Change parameter. + * class.c (instantiate_type): Adjust prototype. Adjust. + * call.c (standard_conversion): Adjust instantiate_type call. + (reference_binding): Likewise. + (build_op_delete_call): Likewise. + (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_reference): Likewise. + * pt.c (convert_nontype_argument): Likewise. + * typeck.c (build_binary_op): Likewise. + (build_ptrmemfunc): Likewise. + (convert_for_assignment): Likewise. + +2000-08-17 Nathan Sidwell + + * cp-tree.h (CPTR_AGGR_TAG): New global tree node. + (current_aggr): Define. + * decl.c (grokdeclarator): Make sure a friend class is an + elaborated type specifier. + * parse.y (current_aggr): Remove static definition. + (cp_parse_init): Adjust. + (structsp): Clear and restore current_aggr. + (component_decl_list): Clear current_aggr. + + * error.c (dump_type, case TYPENAME_TYPE): Don't emit the + aggregate tag on the typename's context. + + * pt.c (tsubst_friend_class): Return error_mark_node, if + parms becomes NULL. + (instantiate_class_template): Ignore error_mark_node friend types. + +2000-08-14 Nathan Sidwell + + * cvt.c (warn_ref_binding): New static function, broken out of ... + (convert_to_reference): ... here. Use it. + +2000-08-11 Kriang Lerdsuwanakij + + * parse.y (template_arg): Add rule for template qualified with + global scope. + +2000-08-11 Theodore Papadopoulo + + * decl2.c (add_function): Reorganize. + (arg_assoc): Do not consider function template decls. + +2000-08-11 Jason Merrill + + * decl.c (lookup_name_real): Don't forget the TYPENAME_TYPE we're + looking inside. + +2000-08-11 Nathan Sidwell + + * cp-tree.h (resolve_scope_to_name): Remove unused prototype. + (lookup_nested_tag): Likewise. + + * decl2.c (grokfield): Fix comment to reflect many types of _DECLs + can be produced. + +2000-08-11 Nathan Sidwell + + * parse.y (named_complex_class_head_sans_basetype): Remove + always true if. + +2000-08-11 Nathan Sidwell + + * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Build + explicit TEMPLATE_ID_EXPR args. + (build_expr_from_tree, case CALL_EXPR): Likewise. + +2000-08-11 Nathan Sidwell + + * decl.c (check_tag_decl): Diagnose typename's which don't + declare anything. + +2000-08-10 Nathan Sidwell + + * init.c (build_aggr_init): Reject bogus array initializers + early. + +2000-08-09 Nathan Sidwell + + * rtti.c (build_dynamic_cast_1): Set "C" linkage for new abi + runtime. + * cp/tinfo.cc (__dynamic_cast): Likewise. + * cp/inc/cxxabi.h (__dynamic_cast): Likewise. + +2000-08-09 Nathan Sidwell + + * cvt.c (convert_to_pointer_force): Fix error message when + attempting to cast from ambiguous base. + +2000-08-08 Jason Merrill + + * pt.c (tsubst_aggr_type): Bail if creating the argvec fails. + (tsubst_template_arg_vector): Likewise. + + * decl2.c (build_anon_union_vars): Choose the largest field; don't + assume that one will be as large as the union. + +2000-08-07 Kazu Hirata + + * cp-tree.h (CLASSTYPE_HAS_PRIMARY_BASE_P): Fix a comment typo. + * decl.c (pop_labels): Likewise. + +2000-08-04 Jeffrey Oldham + + * inc/cxxabi.h (__pbase_type_info): Changed member names to match + specifications. + (__pointer_to_member_type_info): Likewise. + (__base_class_info): Likewise. + (__class_type_info): Likewise. + (__si_class_type_info): Likewise. + (__vmi_class_type_info): Likewise. + * tinfo.cc (__si_class_type_info::__do_find_public_src): + Changed member names to match specifications. + (__vmi_class_type_info::__do_find_public_src): Likewise. + (__si_class_type_info::__do_dyncast): Likewise. + (__vmi_class_type_info::__do_dyncast): Likewise. + (__si_class_type_info::__do_upcast): Likewise. + (__vmi_class_type_info::__do_upcast): Likewise. + * tinfo2.cc (__pbase_type_info::__do_catch): Likewise. + (__pbase_type_info::__pointer_catch): Likewise. + (__pointer_type_info::__pointer_catch): Likewise. + (__pointer_to_member_type_info::__pointer_catch): Likewise. + +2000-08-04 Zack Weinberg + + * Make-lang.in (cc1plus): Depend on $(BACKEND), not stamp-objlist. + * Makefile.in: Add C_OBJS, BACKEND; delete OBJS, OBJDEPS. + (cc1plus): Link with $(BACKEND) and $(C_OBJS). + +2000-08-04 Mark Mitchell + + * cp-tree.h (add_method): Change prototype. + * class.c (add_method): Remove FIELDS parameter. Add ERROR_P. + Don't double the size of the method vector in the error case. + (handle_using_decl): Adjust call to add_method. + (add_implicitly_declared_members): Likewise. + (clone_function_decl): Likewise. + * decl2.c (check_classfn): Likewise. + * semantics.c (finish_member_declaration): Likewise. + +2000-08-04 Joseph S. Myers + + * decl.c (flag_isoc94): New variable. + +2000-08-02 Jason Merrill + + * pt.c (do_type_instantiation): Add complain parm; don't complain + if called recursively. + * cp-tree.h, parse.y: Adjust. + +2000-08-02 Zack Weinberg + + * decl2.c: Silently ignore -Wstrict-prototypes; warn about + -Wno-strict-prototypes. + + * g++spec.c: Adjust type of second argument to + lang_specific_driver, and update code as necessary. + + * cp-tree.h: Don't prototype min_precision here. + (my_friendly_assert): Cast expression to void. + * semantics.c (do_poplevel): Initialize scope_stmts. + +2000-08-02 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak. + +2000-07-28 Jason Merrill + + * lang-specs.h: Use %i in rule for .ii files. + +2000-07-31 Zack Weinberg + + * lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0. + +2000-07-30 Mark Mitchell + + Allow indirect primary bases. + * cp-tree.h (struct lang_type): Remove vfield_parent. Add + primary_base. + (CLASSTYPE_VFIELD_PARENT): Remove. + (CLASSTYPE_PRIMARY_BINFO): Reimplement. + (BINFO_PRIMARY_BINFO): Remove. + (CLASSTYPE_HAS_PRIMARY_BASE_P): Reimplement. + (BINFO_VBASE_PRIMARY_P): Likewise. + (BINFO_PRIMARY_BASE_OF): New macro. + (BINFO_INDIRECT_PRIMARY_P): Likewise. + (get_primary_binfo): New function. + * decl.c (lang_mark_tree): Make lang_type::primary_base. + * class.c (vcall_offset_data_s): Rename to ... + (vtbl_init_data_s): ... this. Rename primary_p to primary_vtbl_p, + and add ctor_vtbl_p. + (get_derived_offset): Use get_primary_binfo. + (dfs_mark_primary_bases): Adjust handling of virtual primary + bases. + (mark_primary_bases): Likewise. + (set_primary_base): Take a binfo, not an integer, as a + representation of the primary base. + (indirect_primary_base_p): Remove. + (determine_primary_base): Adjust for indirect primary bases. + (dfs_find_final_overrider): Fix typo in coment. + (update_vtable_entry_for_fn): Use get_primary_binfo. + (layout_nonempty_base_or_field): Tweak. + (build_base_fields): Adjust for new primary base semantics. + (dfs_propagate_binfo_offsets): Remove. + (propagate_binfo_offsets): Rewrite. + (dfs_set_offset_for_shared_vbases): Remove. + (layout_virtual_bases): Don't use it. + (layout_class_type): Set CLASSTYPE_SIZE correctly under the new + ABI. + (finish_struct_1): Set CLASSTYPE_PRIMARY_BINFO, not + CLASSTYPE_VFIELD_PARENT. + (dfs_get_primary_binfo): New function. + (get_primary_binfo): Likewise. + (dump_class_hierarchy_r): Tweak printing of primary bases. + (build_vtbl_initializer): Fix typo in comments. Use + vtbl_init_data. + (build_vcall_and_vbase_vtbl_entries): Likewise. + (build_vbaes_offset_vtbl_entries): Likewise. + (dfs_build_vcall_offset_vtbl_entries): Adjust setting of + BV_VCALL_INDEX to handle indirect primary bases. + (build_vcall_offset_vtbl_entries): Use vtbl_init_data. + (build_rtti_vtbl_entries): Likewise. + * search.c (get_shared_vbase_if_not_primary): Tweak. + (find_vbase_instance): Likewise. + (binfo_for_vtable): Simplify. + * tree.c (unshare_base_binfos): Clear BINFO_PRIMARY_BASE_OF. + (make_binfo): Make it have 11 entries. + +2000-07-30 Alex Samuel + + * mangle.c (DECL_TEMPLATE_ID_P): Remove. + (CLASSTYEP_TEMPLATE_ID_P): Check template info, and context when + ascertaining primaryness. + (G): Remove template_args. + (decl_is_template_id): New function. + (write_encoding): Use decl_is_template_id. + (write_name): Likewise. Handle type_decls. Get main variant of + type decls. + (write_nested_name): Likewise. + (write_prefix): Likewise. + (write_template_prefix): Likewise. + (write_special_name_constructor): Remove defunct production from + comment. + (write_bare_function_type): Remove comment about absent parameter. + (write_template_template_arg): Add missing grammar production to + comment. + +2000-07-27 Jason Merrill + + * decl.c (duplicate_decls): If common_type produces a non-typedef + type for a typedef, just use the old type. + +2000-07-27 Mark Mitchell + + * cp-tree.h (function_depth): Declare. + (verify_stmt_tree): Likewise. + (find_tree): Likewise. + * decl.c (function_depth): Give it external linkage. + * optimize.c (optimize_function): Increment and decrement it. + * tree.c (verify_stmt_tree_r): New function. + (verify_stmt_tree): Likewise. + (find_tree_r): Likewise. + (find_tree): Likewise. + +2000-07-27 Jason Merrill + + * pt.c (for_each_template_parm_r, case RECORD_TYPE): Use + TYPE_PTRMEMFUNC_P. + * cp-tree.h (TYPE_TEMPLATE_INFO): Check for TYPE_LANG_SPECIFIC. + +2000-07-26 Mark Mitchell + + * decl.c (start_cleanup_fn): Mark the function as `inline'. + * decl2.c (get_guard): Call cp_finish_decl, not + rest_of_decl_compilation, for local guards. + * lex.c (do_identifier): Remove unused variable. + +2000-07-26 Marc Espie + + * parse.y: Add missing ';'. + +2000-07-26 Mark Mitchell + + * parse.y (empty_parms): Use `()', not `(...)', when in the scope + of `extern "C++"'. + +2000-07-25 Nathan Sidwell + + Kill strict_prototype. Backwards compatibility only for + non NO_IMPLICIT_EXTERN_C systems. + * cp-tree.h (flag_strict_prototype): Remove. + (strict_prototype): Remove. + (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. + * decl.c (maybe_push_to_top_level): Adjust. + (pop_from_top_level): Adjust. + (decls_match): Only allow sloppy parm matching for ancient + system headers. + (init_decl_processing): Adjust. + (grokdeclarator): Adjust. + * decl2.c (flag_strict_prototype): Remove. + (strict_prototype): Remove. + (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. + (lang_f_options): Remove "strict-prototype". + (unsupported-options): Add "strict-prototype". + * lex.c (do_identifier): Adjust. + (do_scoped_id): Adjust. + * parse.y (empty_parms): Adjust. + * class.c (push_lang_context): Adjust. + (pop_lang_context): Adjust. + * typeck.c (comp_target_parms): Adjust. + +2000-07-25 Nathan Sidwell + + * decl.c (poplevel): Deal with anonymous variables at for scope. + (maybe_inject_for_scope_var): Likewise. + +2000-07-25 Zack Weinberg + + * decl.c: Remove all signal handling code, now done in toplev.c. + +2000-07-23 Mark Mitchell + + * decl.c (make_rtl_for_nonlocal_decl): Rework. + + * pt.c (lookup_template_class): Ensure that TYPE_CONTEXT is set + correctly. + +2000-07-20 Zack Weinberg + + * cp-tree.h: Use __FUNCTION__ not __PRETTY_FUNCTION__. + Define my_friendly_assert and my_friendly_abort as macros + which may call friendly_abort. Prototype friendly abort, not + my_friendly_abort or my_friendly_assert. + * decl.c (signal_catch): Report the signal caught in the error + message. Call fatal directly. + * typeck2.c (ack, my_friendly_assert): Delete. + (my_friendly_abort): Rename to friendly_abort. Expect file, + line, and function parameters. Report the abort code, then + call fancy_abort. Do not mask an abort if errors have + already occurred. + +2000-07-18 Nathan Sidwell + + * typeck.c (comp_target_parms): Remove obsolete parameter. + (comp_target_types): Adjust. + +2000-07-17 Jason Merrill + + * typeck.c (mark_addressable): Never set TREE_USED. + * call.c (build_call): Don't abort on calls to library functions + that have been declared normally. + + * typeck.c (build_binary_op): Fix grammar in warning. + + * exception.cc (__eh_free): Fix prototype. + + * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR. + + * decl.c (pushdecl): Handle seeing an OVERLOAD in + IDENTIFIER_NAMESPACE_VALUE. + +2000-07-16 Mark Mitchell + + * cp-tree.h (THUNK_VCALL_OFFSET): Update documentation. + * method.c (use_thunk): Correct handling of vcall offsets. + +2000-07-14 Zack Weinberg + + * .cvsignore: parse.h and parse.c have no cp- prefix. + +2000-07-13 Mark Mitchell + + * .cvsignore: New file. + +2000-07-13 Zack Weinberg + + * lang-specs.h: Use the new named specs. Remove unnecessary braces. + +2000-07-12 Mark Mitchell + + * Makefile.in ($(PARSE_H)): Depend directly on parse.y. + * parse.c: Remove. + * parse.h: Likewise. + +2000-07-11 Mark Mitchell + + * class.c (layout_class_type): Add pointers to virtual bases after + base classes under the old ABI. + +2000-07-10 Benjamin Chelf + + * semantics.c (finish_for_stmt): Remove call to emit_line_note. + (finish_continue_stmt): Likewise. + (begin_for_stmt): Remove call to note_level_for_for. + (finish_goto_stmt): Change call from build_min_nt + to build_stmt. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_case_label): Likewise. + (genrtl_try_block): Likewise. + (begin_try_block): Likewise. + (begin_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (add_decl_stmt): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (setup_vtbl_ptr): Likewise. + (add_scope_stmt): Likewise. + * decl.c (finish_constructor_body): Likewise. + (finish_destructor_body): Likewise. + * optimize.c (copy_body_r): Likewise. + (initialize_inlined_parameters): Likewise. + (declare_return_variable): Likewise. + (expand_call_inline): Likewise. + +2000-07-10 Jakub Jelinek + + * semantics.c (expand_body): Sync interface information + at the end of function body expansion. + +2000-07-09 Jason Merrill + + * init.c (build_new_1): Bail early if the call to new fails. + + * decl.c (compute_array_index_type): Check specifically for + an INTEGER_CST, not just TREE_CONSTANT. + + * decl.c (duplicate_decls): Don't call duplicate_decls on + the DECL_TEMPLATE_RESULT. + (decls_match): Return 0 if the DECL_TEMPLATE_RESULTs have different + codes. + + * error.c (dump_template_bindings): Don't crash if we had an + invalid argument list. + + * typeck.c (c_expand_start_case): Do narrowing here. + * semantics.c (finish_switch_cond): Not here. + +2000-07-09 Hidvegi Zoli + + * parse.y (asm_clobbers): Do string concatenation. + +2000-07-09 Mark Mitchell + + * decl.c (pushtag): Don't put local classes in template functions + on the local_classes list. + +2000-07-04 Scott Snyder + + * decl2.c (get_guard): Add missing return for old ABI local + variable case. + +2000-07-09 Mark Mitchell + + * cp-tree.h (char_type_p): New function. + * decl.c (init_decl_processing): Don't initialize + signed_wchar_type_node or unsigned_wchar_type_node. + (complete_array_type): Handle brace-enclosed string-constants. + * rtti.c (emit_support_tinfos): Remove #if 0'd code. + * tree.c (char_type_p): New function. + * typeck2.c (digest_init): Use char_type_p. + +2000-07-06 Nathan Sidwell + + * pt.c (tsubst): Don't layout type, if it's error_mark. + +2000-07-06 Nathan Sidwell + + * pt.c (instantiate_pending_templates): Reset template level. + +2000-07-05 Jason Merrill + + * call.c (joust): Don't complain about `operator char *()' beating + `operator const char *() const'. + +2000-07-04 scott snyder + Jason Merrill + + * repo.c (repo_get_id): Handle the case where a class with virtual + bases has a null TYPE_BINFO_VTABLE. + +2000-07-04 Kevin Buhr + Jason Merrill + + * parse.y (member_init): Just pass in the type. + * init.c (expand_member_init): Handle getting a type. + +2000-07-04 Martin v. Löwis + Jason Merrill + + * decl.c (finish_function): Warn if a function has no return + statement. + Suggested by Andrew Koenig. + * typeck.c (check_return_expr): Do set current_function_returns_value + if we got an error_mark_node. + +2000-07-03 Nathan Sidwell + + * decl2.c (push_decl_namespace): Push the original namespace. + +2000-07-03 Nathan Sidwell + + * pt.c (instantiate_class_template): Set CLASSTYPE_VBASECLASSES. + * semantics.c (begin_class_definition): Clear it. + +2000-07-02 Benjamin Chelf + + * cp-tree.h (genrtl_goto_stmt): Remove declaration. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + + * init.c (begin_init_stmts): Remove call to + genrtl_begin_compound_stmt. + (finish_init_stmts): Remove call to genrtl_finish_compound_stmt. + + * semantics.c (lang_expand_stmt): Changed call to + genrtl_compound_stmt to ignore return value. + +2000-07-02 Mark Mitchell + + * mangle.c (canonicalize_for_substitution): Return the canonical + variant of a type. + + * decl.c (duplicate_decls): Preserve DECL_ORIGINAL_TYPE for a + TYPE_DECL. + * typeck.c (commonparms): Remove obstack manipulations. + +2000-07-01 Benjamin Chelf + + * Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. + + * Makefile.in (OBJS): Added ../c-semantics.o. + (OBJDEPS): Likewise. + + * cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to + ../c-common.h. + (struct stmt_tree): Added comment. + (current_function_name_declared): Removed. + (stmts_are_full_exprs_p): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. + (DECL_ANON_UNION_ELEMS): Likewise. + (emit_local_var): Likewise. + (make_rtl_for_local_static): Likewise. + (do_case): Likewise. + (expand_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (c_expand_asm_operands): Likewise. + (c_expand_return): Likewise. + (c_expand_start_case): Likewise. + + * decl.c (make_rtl_for_local_static): Moved to c-semantics.c. + (emit_local_var): Likewise. + (initialize_local_var): Change reference to + stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). + Change reference to stmts_are_full_exprs_p to + current_stmt_tree->stmts_are_full_exprs_p. + (push_cp_function_context): Likewise. + + * expect.c (expand_throw): Change reference to + stmts_are_full_exprs_p. + + * init.c (build_aggr_init): Change reference to + stmts_are_full_exprs_p. + (build_vec_init): Likewise. + + * optimize.c (maybe_clone_body): Change reference to + current_function_name_declared to + cp_function_chain->name_declared. + + * pt.c (instantiate_decl): Change reference to + current_function_name_declared to + cp_function_chain->name_declared. + + * semantics.c (expand_cond): Moved declaration to c-common.h. + (genrtl_do_pushlevel): Moved to c-semantics.c. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (gerntl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (expand_cond): Likewise. + (expand_stmt): Renamed to ... + (lang_expand_stmt): ... this. + (lang_expand_expr_stmt): Initialize. + (set_current_function_name_declared): Likewise. + (stmts_are_full_exprs_p): Likewise. + (current_function_name_declared): Likewise. + (anon_aggr_type_p): Likewise. + (do_poplevel): Change reference to + stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). + Change reference to stmts_are_full_exprs_p to + current_stmt_tree->stmts_are_full_exprs_p. + (add_tree): Likewise. + (finish_expr_stmt): Likewise. + (prep_stmt): Likewise. + (lang_expand_stmt): Likewise. + (begin_compound_stmt): Change reference to + current_function_name_declared to + cp_function_chain->name_declared and call to + current_function_name_declared(). + (setup_vtbl_ptr): Likewise. + (genrtl_do_poplevel): Removed. + +2000-06-30 Jason Merrill + + * init.c (init_init_processing): Go back to aligning like + double_type_node for old ABI. + (get_cookie_size): Make cookie larger if we get a type that needs + more alignment. + (build_vec_delete): Call it. + + * typeck.c (qualify_type_recursive): New fn. + (composite_pointer_type): Use it. + (build_binary_op): Use composite_pointer_type. + +2000-06-24 Carlos O'Ryan + Jason Merrill + + * typeck.c (check_return_expr): Don't complain about returning + NULL from operator new if -fcheck-new. + * cp-tree.h: Declare flag_check_new here. + * init.c: Not here. + +2000-06-28 Alex Samuel + + * mangle.c (find_substitution): Use same_type_p. + (write_encoding): Don't check for substitutions. + +2000-06-30 Nathan Sidwell + + * parse.y (expr_no_comma_rangle): New non-terminal. + (template_parm): Use it for default parameter case. + (template_arg): Use it. + (expr_no_commas): Remove commented out undefined extensions. + * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. + * parse.h, parse.c: Rebuilt. + +2000-06-30 Mark Mitchell + + * semantics.c (genrtl_asm_stmt): Don't decay input operands here. + (finish_asm_stmt): Do it here, instead. + + * cp-tree.h (ridpointers): Don't declare. + * decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX. + (record_builtin_java_type): Likewise. + (init_decl_processing): Likewise. + * lex.c: Move inclusion of lex.h. + (ridpointers): Don't define. + (init_parse): Initialize ripdointers. Use CP_RID_MAX instead of + RID_MAX. + * lex.h (enum rid): Rename to ... + (enum cp_rid): ... this. + (ridpointers): Don't declare. + * parse.y: Move inclusion of lex.h. + * parse.c: Regenerated. + * spew.c: Move inclusion of lex.h. + + * cp-tree.h (struct language_function): Remove temp_name_counter. + (temp_name_counter): Remove. + (get_temp_name): Change prototype. + (get_guard): New function. + (get_guard_cond): Likewise. + (set_guard): Likewise. + * cvt.c (build_up_reference): Adjust call to get_temp_name. + * decl.c (expand_static_init): Use get_guard and friends to + implement guard variables. + * decl2.c (get_temp_name): Assume that the variables created are + always static. + (get_sentry): Rename to ... + (get_guard): ... this. Implement new ABI guard variables. + (get_guard_bits): New function. + (get_guard_cond): Likewise. + (set_guard): Likewise. + (start_static_initialization_or_destruction): Use them. + (do_static_initialization): Replace sentry with guard throughout. + (do_static_destruction): Likewise. + * init.c (create_temporary_var): Add comment. + +2000-06-28 Alex Samuel + + * mangle.c (find_substitution): Use same_type_p. + (write_encoding): Don't check for substitutions. + +2000-06-30 Nathan Sidwell + + * parse.y (expr_no_comma_rangle): New non-terminal. + (template_parm): Use it for default parameter case. + (template_arg): Use it. + (expr_no_commas): Remove commented out undefined extensions. + * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. + * parse.h, parse.c: Rebuilt. + +2000-06-29 Mark Mitchell + + * cp-tree.h (flag_const_strings): Remove. + (warn_parentheses): Likewise. + (warn_format): Likewise. + (common_type): Likewise. + (default_conversion): Likewise. + (build_binary_op): Likewise. + (cp_build_binary_op): New macro. + * call.c (build_new_op): Use cp_build_binary_op instead of + build_binary_op. + * class.c (build_vtable_entry_ref): Likewise. + * decl.c (expand_static_init): Likewise. + (compute_array_index_type): Likewise. + (build_enumerator): Likewise. + * decl2.c (delete_sanity): Likewise. + (start_static_initialization_or_destruction): Likewise. + * error.c (dump_type_suffix): Likewise. + * init.c (resolve_offset_ref): Likewise. + (build_new): Likewise. + (build_new_1): Likewise. + (build_vec_delete_1): Likewise. + (build_vec_init): Likewise. + (build_delete): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + (synthesize_tinfo_var): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + * typeck.c (build_array_ref): Likewise. + (get_member_function_from_ptrfunc): Likewise. + (build_binary_op): Add parameter. + (pointer_int_sum): Use cp_build_binary_op. + (pointer_diff): Likewise. + (build_modify_expr): Likewise. + (get_delta_difference): Likewise. + (build_ptrmemfunc): Likewise. + +2000-06-29 Nathan Sidwell + + * cp-tree.h (SET_DECL_ARTIFICIAL): Remove. + * decl.c (create_implicit_typedef): Adjust. + * decl2.c (build_artificial_parm): Adjust. + * method.c (implicitly_declare_fn): Adjust. + * pt.c (push_inline_template_parms_recursive): Adjust. + (process_template_parm): Adjust. + (overloaded_template_name): Adjust. + * semantics.c (finish_template_template_parm): Adjust. + +2000-06-28 Mark Mitchell + + * cp-tree.h (CLEAR_BINFO_NEW_VTABLE_MARKED): Remove. + * class.c (update_vtable_entry_for_fn): Correct logic for deciding + where to emit thunks. + (build_vtt): Adjust call to build_vtt_inits. + (build_vtt_inits): Add parameter to indicate whether or not + sub-VTTs for virtual bases should be included. Adjust handling of + construction vtables. + (get_matching_base): New function. + (dfs_build_vtt_inits): Rename to ... + (dfs_build_secondary_vptr_vtt_inits): Adjust handling of + construction vtables. + (dfs_fixup_binfo_vtbls): Likewise. + (build_ctor_vtbl_groups): Build construction vtables for virtual + bases, too. + (accumulate_vtbl_inits): Tweak logic for deciding whether or not + to build construction vtbls. + (dfs_accumulate_vtbl_inits): Adjust handling of + construction vtables. + + * pt.c (tsubst, case TEMPLATE_TEMPLATE_PARM): Handle cv-qualified + types correctly. + +2000-06-27 Mark Mitchell + + * decl.c (grokfndecl): Set DECL_CONTEXT for static functions too. + +2000-06-26 Nathan Sidwell + + * search.c (hides): Remove. + (is_subobject_of_p): Add most_derived parameter. Use + CANONICAL_BINFO. + (lookup_field_queue_p): Adjust. + (lookup_field_r): Adjust. + +2000-06-26 Nathan Sidwell + + * decl2.c (handle_class_head): Bash typedefs to the type's main + decl. + +2000-06-25 Mark Mitchell + + * cp-tree.h (genrtl_begin_stmt_expr): Rename to ... + (begin_global_stmt_expr): ... this. + (genrtl_finish_stmt_expr): Rename to ... + (finish_global_stmt_expr): ... this. + * init.c (begin_init_stmts): Adjust calls. + (finish_init_stmts): Likewise. + * semantics.c (genrtl_begin_stmt_expr): Rename to ... + (begin_global_stmt_expr): ... this. + (genrtl_finish_stmt_expr): Rename to ... + (finish_global_stmt_expr): ... this. + +2000-06-25 Theodore Papadopoulo + + * search.c (lookup_member): Fix typo in comment. + +2000-06-24 Jason Merrill + + * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. + (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. + +2000-06-24 Martin v. Löwis + + * parse.y (complex_direct_notype_declarator): Support global_scope. + * Makefile.in: Adjust conflict count. + +2000-06-23 Kriang Lerdsuwanakij + + * parse.y (template_arg): Convert TEMPLATE_DECL + that is a template template parameter to + TEMPLATE_TEMPLATE_PARM here. + + * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Adjust comment. + * cp-tree.h (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): New macro. + (copy_template_template_parm): Adjust prototype. + * decl.c (grokdeclarator): Remove dead code. + * pt.c (process_template_parm): Tidy. + (lookup_template_class): Construct nodes in + copy_template_template_parm. + (tsubst): Pass TEMPLATE_DECL rather than IDENTIFIER_NODE to + lookup_template_class. Use TYPE_TI_TEMPLATE. + * tree.c (copy_template_template_parm): Add NEWARGS + parameter. + (mapcar): Adjust call to copy_template_template_parm. + * typeck.c (comptypes): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL. + * method.c (build_template_template_parm_names): Change error + code to avoid compilation warning. + + * gxxint.texi: Document template template parameter + name mangling. + +2000-06-21 Alex Samuel + + * Make-lang.in (CXX_LIB2FUNCS): Add cp-demangle.o and dyn-string.o. + (CXX_LIB2SRCS): Add cp-demangle.c and dyn-string.c. + (cp-demangle.o): New rule. + (dyn-string.o): Likewise. + * inc/cxxabi.h (__cxa_demangle): New declaration. + +2000-06-22 Mark Mitchell + + * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. + (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. + (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset + a tree, not an int. + (THUNK_GENERATE_WITH_VTABLE_P): New macro. + (make_thunk): Change prototype. + (emit_thunk): Rename to use_thunk. + (mangle_thunk): Change prototype. + * class.c (get_derived_offset): Simplify. + (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and + BV_GENERATE_THUNK_WITH_VTABLE_P. + (build_primary_vtable): Simplify. + (add_virtual_function): Use BV_FN, rather than TREE_VALUE. + (dfs_find_base): Remove. + (update_vtable_entry_for_fn): Correct bug in finding the base + where a virtual function was first declared. Figure out whether + or not to emit a vcall-thunk with the vtables in which it appears. + Correct logic for deciding whether to use an ordinary thunk, or a + vcall thunk. + (finish_struct_1): Remove unnecssary code. + (build_vtbl_initializer): Use ssize_int for the running counter of + negative indices. + (build_vtbl_initializer): Only use vcall thunks where necessary. + Mark thunks as needing to be emitted with their vtables, or not. + (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in + indices. Use size_binop. + (dfs_build_vcall_offset_vtbl_entries): Don't rely on + BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use + size_binop. + (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. + (build_vtable_entry): Mark thunks as needing to be emitted with + their vtables, or not. + * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. + * decl2.c (mark_vtable_entries): Use use_thunk instead of + emit_thunk. + * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk + information. + * error.c (dump_expr): Use BV_FN. + * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, + not an int. + * method.c (make_thunk): Likewise. + (emit_thunk): Rename to use_thunk. Allow callers to decide + whether or not to actually emit the thunk. Adjust for changes in + representation of vcall offsets. + * search.c (dfs_get_pure_virtuals): Use BV_FN. + * semantics.c (emit_associated_thunks): New function. + (expand_body): Use it. + * ir.texi: Adjust descriptions of thunks. + +2000-06-22 Jason Merrill + + * pt.c (tsubst_decl, case FUNCTION_DECL): Clear DECL_SAVED_TREE. + (tsubst_friend_function): Copy it here. + + * decl.c (grok_op_properties): Fix typo. + + * decl2.c (delete_sanity): Clarify warning, avoid failure on + deleting void*. + + * pt.c (check_explicit_specialization): Clarify error. + + * decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from + an old OVERLOAD when we're declaring a non-function. + (pushdecl, destroy_local_var): Check for error_mark_node. + (warn_extern_redeclared_static): Also bail early if + we're a CONST_DECL. + (push_overloaded_decl): Ignore an old error_mark_node. + +2000-06-22 Nathan Sidwell + + * call.c (build_x_va_arg): Check if in a template decl. + * pt.c (tsubst_copy, case VA_ARG_EXPR): Use build_x_va_arg. + +2000-06-20 Alexandre Petit-Bianco + + * class.c (push_lang_context): TYPE_NAME gets you to the Java + types DECLs. + * decl.c (check_goto): Computed gotos assumed OK. + +2000-06-20 Jason Merrill + + * pt.c (tsubst_decl, case TYPE_DECL): Fix test for TYPE_DECLs + for which we don't need to look for instantiations. + +2000-06-21 Nathan Sidwell + + * parse.y (program): Always call finish_translation_unit. + * parse.c, parse.h: Rebuilt. + +2000-06-20 Zack Weinberg + + * method.c: Don't include hard-reg-set.h. + +2000-06-20 Nathan Sidwell + + * rtti.c (get_base_offset): Cope when vbase field is in a base. + +2000-06-20 Nathan Sidwell + + * call.c (build_conditional_expr): Use VOID_TYPE_P. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_void): Likewise. + * error.c (dump_expr): Likewise. + * except.c (complete_ptr_ref_or_void_ptr_p): Likewise. + * init.c (build_delete): Likewise. + * method.c (emit_thunk): Likewise. + * optmize.c (declare_return_variable): Likewise. + * rtti.c (get_tinfo_decl_dynamic): Likewise. + (get_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + * typeck.c (composite_pointer_type): Likewise. + (common_type): Likewise. + (build_indirect_ref): Likewise. + (build_binary_op): Likewise. + (build_x_compound_expr): Likewise. + (check_return_expr): Likewise. + * typeck2.c (add_exception_specifier): Likewise. + + * mangle.c (write_method_parms): Use direct comparison for end + of parmlist. + +2000-06-19 Benjamin Chelf + + * cp-tree.h (genrtl_try_block): Declare function. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_decl_cleanup): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_named_return_value): Likewise. + (genrtl_begin_stmt_expr): Likewise. + (genrtl_finish_stmt_expr): Likewise. + (finish_for_stmt): Removed first argument. + (finish_switch_stmt): Likewise. + + * semantics.c (genrtl_try_block): Define function. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_decl_cleanup): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_named_return_value): Likewise. + (genrtl_begin_stmt_expr): Likewise. + (genrtl_finish_stmt_expr): Likewise. + (finish_for_stmt): Removed first argument and generate rtl + specific code. + (finish_switch_stmt): Likewise. + (do_poplevel): Removed generate rtl specific code. + (do_pushlevel): Likewise. + (add_tree): Likewise. + (finish_goto_stmt): Likewise. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (finish_if_stmt_cond): Likewise. + (finish_then_clause): Likewise. + (begin_else_clause): Likewise. + (finish_else_clause): Likewise. + (finish_if_stmt): Likewise. + (clear_out_block): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_while_stmt): Likewise. + (begin_do_stmt): Likewise. + (finish_do_body): Likewise. + (finish_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_init_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_switch_cond): Likewise. + (finish_case_label): Likewise. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (finish_try_block): Likewise. + (finish_cleanup_try_block): Likewise. + (finish_cleanup): Likewise. + (finish_function_try_block): Likewise. + (finish_handler_sequence): Likewise. + (finish_function_handler_sequence): Likewise. + (begin_handler): Likewise. + (finish_handler_parms): Likewise. + (begin_catch_block): Likewise. + (finish_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (finish_label_decl): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (begin_stmt_expr): Likewise. + (finish_stmt_expr): Likewise. + + * decl.c (initialize_local_var): Changed call to finish_expr_stmt + to call genrtl_expr_stmt when appropriate. + + * init.c (begin_init_stmts): Changed calls to begin_stmt_expr and + begin_compound_expr to call genrtl_begin_stmt_expr and + genrtl_begin_compound_expr when appropriate. + (finish_init_stmts): Changed calls to finish_compound_expr and + finish_stmt_expr to call genrtl_finish_compound_expr and + genrtl_finish_stmt_expr when appropriate. + (expand_default_init): Changed call to finish_expr_stmt to call + genrtl_expr_stmt when appropriate. + (build_vec_init): Likewise. + + * parse.y (simple_stmt): Removed first argument from call to + finish_for_stmt. Removed first argument from call to + finish_switch_stmt. + + * parse.c: Regenerated. + + * pt.c (tsubst_expr): Removed first argument from call to + finish_for_stmt. Removed first argument from call to + finish_switch_stmt. + +2000-06-16 Benjamin Chelf + + * cp-tree.h (enum cplus_tree_code): Changed __DUMMY to + CP_DUMMY_TREE_CODE. Remove #include "c-common.def". + + * lex.c (cplus_tree_code_type[]): Removed #include "c-common.def". + (cplus_tree_code_length[]): Likewise. + (cplus_tree_code_name[]): Likewise. + (init_parse): Added call to add_c_tree_codes. Changed + LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE. + +2000-06-16 Mark Mitchell + + * cp-tree.h (finish_mem_initializers): Declare. + (count_trees): Likewise. + * parse.y (base_init): Use finish_mem_initializers. + * semantics.c (finish_mem_initializers): New function. + + * tree.c (count_trees_r): Prototype. Use DATA parameter to store + the number of trees. + (n_trees): Remove. + (count_trees): Don't use it. + +2000-06-15 Jason Merrill + + * tree.c (count_trees): New debugging function. + + * typeck.c (build_x_function_call): Use DECL_FUNCTION_TEMPLATE_P. + * init.c (build_member_call): Pull out the name of a DECL. + + * Makefile.in (semantics.o, pt.o): Depend on TIMEVAR_H. + * semantics.c (expand_body): Push to TV_INTEGRATION here. + * optimize.c (optimize_function): Not here. + * pt.c (instantiate_decl): Push to TV_PARSE. + +2000-06-15 Mark Mitchell + + * cp-tree.h (struct language_function): Remove x_base_init_list + and x_member_init_list. + (current_base_init_list): Remove. + (current_member_init_list): Likewise. + (setup_vtbl_ptr): Change prototype. + (emit_base_init): Likewise. + (expand_member_init): Likewise. + (reinit_parse_for_function): Remove. + * decl.c (save_function_data): Don't clear x_base_init_list and + x_member_init_list. + (mark_language_function): Don't mark them. + * init.c (perform_member_init): Tweak comment. + (sort_member_init): Take the list of initializers as an argument. + (sort_base_init): Likewise. + (emit_base_init): Likewise. + (expand_member_init): Return the initializer. Don't use global + variables. + * lex.c (reinit_parse_for_function): Remove. + * method.c (build_template_parm_names): Correct substitution. + (do_build_copy_constructor): Don't use current_member_init_list + and current_base_init_list. + (synthesize_method): Likewise. + * parse.y (base_init): Split mem-initializers into + base-initializers and field-initializers. + (member_init_list): Build up the list here. + (member_init): Return the initializer. + (fn.depfn): Don't use reinit_parse_for_function. + * parse.c: Regenerated. + * pt.c (convert_nontype_argument): Don't make an ADDR_EXPR of the + ERROR_MARK. + (tsubst_expr): Don't use current_member_init_list + and current_base_init_list. + (tsubst_expr_values): Rename to ... + (tsubst_initializer_list): ... this. Use convert_from_reference. + * semantics.c (setup_vtbl_ptr): Don't use current_member_init_list + and current_base_init_list. + (begin_function_definition): Don't call reinit_parse_for_function. + + * dump.c (dequeue_and_dump): Use TREE_VEC_LENGTH with vectors. + + * error.c (dump_expr): Handle ADDR_EXPRs with REFERENCE_TYPE + correctly. + + * cp-tree.h (DECL_PENDING_INLINE_P): Relax checking. + +2000-06-14 Benjamin Chelf + + * cp-tree.h (IF_COND): Move to c-common.h. + (THEN_CLAUSE): Likewise. + (ELSE_CLAUSE): Likewise. + (WHILE_COND): Likewise. + (WHILE_BODY): Likewise. + (DO_COND): Likewise. + (DO_BODY): Likewise. + (RETURN_EXPR): Likewise. + (EXPR_STMT_EXPR): Likewise. + (FOR_INIT_STMT): Likewise. + (FOR_COND): Likewise. + (FOR_EXPR): Likewise. + (FOR_BODY): Likewise. + (SWITCH_COND): Likewise. + (SWITCH_BODY): Likewise. + (CASE_LOW): Likewise. + (CASE_HIGH): Likewise. + (GOTO_DESTINATION): Likewise. + (COMPOUND_BODY): Likewise. + (ASM_CV_QUAL): Likewise. + (ASM_STRING): Likewise. + (ASM_OUTPUTS): Likewise. + (ASM_INPUTS): Likewise. + (ASM_CLOBBERS): Likewise. + (DECL_STMT_DECL): Likewise. + (STMT_EXPR_STMT): Likewise. + (LABEL_STMT_LABEL): Likewise. + (SCOPE_BEGIN_P): Likewise. + (SCOPE_END_P): Likewise. + (SCOPE_STMT_BLOCK): Likewise. + (SCOPE_NULLIFIED_P): Likewise. + (SCOPE_NO_CLEANUPS_P): Likewise. + (SCOPE_PARTIAL_P): Likewise. + (ASM_VOLATILE_P): Likewise. + (STMT_LINENO): Likewise. + (STMT_LINENO_FOR_FN_P): Likewise. + + * cp-tree.def: Removed SRCLOC, SIZEOF_EXPR, ARROW_EXPR, + ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, + FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, + SCOPE_STMT, CASE_LABEL, STMT_EXPR. + + * Makefile.in (CXX_TREE_H): Added $(srcdir)/../c-common.def. + + * Make-lang.in (CXX_SRCS): Added $(srcdir)/c-common.def. + (cc1plus$(exeext)): Added $(srcdir)/c-common.def. + + * lex.c (cplus_tree_code_type[]): Added '#include "c-common.def"'. + (cplus_tree_code_length[]): Added '#include "c-common.def"'. + (cplus_tree_code_name[]): Added '#include "c-common.def"'. + +2000-06-14 Mark Mitchell + + * cp-tree.h (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH): New macro. + * class.c (dfs_find_final_overrider): Set it appropriately. + (dfs_built_vtt_inits): Check BINFO_OVERRIDE_ALONG_VIRTUAL_PATH to + avoid unneeded secondary vptrs. + +2000-06-13 Jakub Jelinek + + * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. + (check_bitfield_decl, check_field_decl): Likewise. + (build_vtbl_or_vbase_field, build_base_field): Likewise. + (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. + * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. + (xfer_tag, finish_enum): Likewise. + * decl2.c (finish_builtin_type): Likewise. + * init.c (init_init_processing): Likewise. + * pt.c (instantiate_class_template): Likewise. + * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. + * cp-tree.h (struct lang_type): Add user_align member. + (CLASSTYPE_USER_ALIGN): Define. + +2000-06-13 Maciej W. Rozycki + + * Make-lang.in (c++.install-common): Install g++-cross in + $(gcc_tooldir)/bin as g++ and c++; g++ in $(bindir) as + $(target_alias)-g++ and $(target_alias)-c++. + +2000-06-12 Mark Mitchell + + * class.c (vcall_offset_data_s): Add last_init and fns. + (overrides): Rename to same_signature_p. + (dfs_find_final_overrider): Adjust accordingly. + (mark_overriders): Likewise. + (warn_hidden): Likewise. + (build_vtbl_initializer): Reorganize machinery for building things + at negative offsets. + (build_vcall_and_vbase_vtbl_entries): Likewise. + (build_vbase_offset_vtbl_entries): Likewise. + (dfs_build_vcall_offset_vtbl_entries): Correct order of vcall + offset entries. Do not create two entries for functions with the + same signature. + (build_vcall_offset_vtbl_entries): Initialize vod->fns. + (build_rtti_vtbl_entries): Reorganize machinery for building things + at negative offsets. + + * optimize.c (expand_call_inline): Don't recurse into the code + used to initialize the parameters more than once. + +2000-06-11 Mark Mitchell + + * mangle.c (NESTED_TEMPLATE_MATCH): Fix typo in comment. + (is_std_substitution): Don't check CLASSTYPE_USE_TEMPLATE here. + (find_substitution): Only use the `Sa' substitution for + std::allocator, not instantiations of it. + (write_template_prefix): Move comment. Only use a TREE_LIST to + represent substitutions for a member template. + (write_array_type): Mangle array dimensions correctly. + * optimize.c (maybe_clone_body): Copy more information from the + cloned function. + * pt.c (regenerate_decl_from_template): Preserve DECL_USE_TEMPLATE + on the regenerated declaration. + +2000-06-11 Chip Salzenberg + Mark Mitchell + + * class.c (build_vtable): Clarify comment. + (build_ctor_vtbl_group): Pass the most derived type to + build_vtable. + +2000-06-11 Kaveh R. Ghazi + + * decl2.c (compare_options): Don't needlessly cast away const-ness. + +2000-06-10 Mark Mitchell + + * decl.c (add_binding): Handle duplicate declarations of external + variables. + +2000-06-09 Chip Salzenberg + Mark Mitchell + + * mangle.c (write_number): Take an unsigned HOST_WIDE_INT as an + argument. + (write_signed_number): New macro. + (write_unsigned_number): Likewise. + (write_source_name): Use them. + (write_number): Handle signed and unsigned values. + (write_integer_cst): Use tree_int_cst_sgn, and use + write_unsigned_number or write_signed_number as appropriate. + (write_discriminator): Use write_unsigned_number or + write_signed_number as appropriate. + (write_template_arg_literal): Likewise. + (write_array_type): Use tree_low_cst. + (write_template_parm): Use write_unsigned_number or + write_signed_number as appropriate. + (write_substitution): Adjust call to write_number. + (write_type): Get the TYPE_MAIN_VARIANT before mangling it. + (write_expression): Handle non-type template arguments of + reference type correctly. + (mangle_thunk): Use write_signed_number. + +2000-06-09 Chip Salzenberg + + * mangle.c (find_substition): Don't mangle objects with typename + substitutions (e.g. "cin" as "Si"). + +2000-06-09 Zack Weinberg + + * call.c (add_candidate): Use ggc_alloc_cleared. + * decl.c (lookup_label): Likewise. + * lex.c (retrofit_lang_decl): Likewise. + +2000-06-09 Jason Merrill + + * semantics.c (expand_body): Push to TV_EXPAND. + * optimize.c (optimize_function): Push to TV_INTEGRATION. + * decl.c (start_function): Always call announce_function. + + * tinfo2.cc: Just declare abort. + +2000-06-09 Gabriel Dos Reis + + * lex.c (DEF_OPERATOR): Say `operator@' -not- `operator @' + whenever @ is a symbolic name. + +2000-06-08 Jakub Jelinek + + * method.c (make_thunk): Clear DECL_VTT_PARM in thunk. + +2000-06-07 Mark Mitchell + + * decl.c (pushdecl): Look up functions by DECL_NAME, not + DECL_ASSEMBLER_NAME. + +2000-06-06 Mark Mitchell + + * decl2.c (c_language): Define. + +2000-06-06 Gabriel Dos Reis + + * lex.c (lang_init_options): Tweak. + + * decl2.c: Remove #inclusion of diagnostic.h + (lang_decode_option): Move diagnostic formatting options to + toplevel. + + * lang-options.h: Remove documentation for diagnostic options. + + * Makefile.in (lex.o): Depends upon diagnostic.h + +2000-06-06 Mark Mitchell + + * decl.c (redeclaration_error_message): If two TEMPLATE_DECLs have + the same DECL_RESULT, it's not a redefinition. + * pt.c (tsubst_decl): Remove code to handle illegal + specializations. + +2000-06-06 Nathan Sidwell + + * exception.cc: (__eh_alloc, __eh_free): Moved to libgcc2.c + +2000-06-05 Jason Merrill + + * search.c (maybe_suppress_debug_info): Don't check + CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set. + + * pt.c (mark_decl_instantiated): Do SET_DECL_EXPLICIT_INSTANTIATION + here if extern_p. + + Remember instantiation context in deferred instantiations. + * cp-tree.h (struct tinst_level): Remove. + (TINST_DECL, TINST_LINE, TINST_FILE): New macros. + * pt.c (current_tinst_level): Now a tree. + (print_template_context, push_tinst_level, pop_tinst_level, + tinst_for_decl): Adjust. + (reopen_tinst_level): New fn. + (init_pt): Register current_tinst_level as a root. + (add_pending_template): Put current_tinst_level in TREE_PURPOSE + of the pending templates list. + (instantiate_pending_templates): Adjust. Call reopen_tinst_level. + * lex.c (extract_interface_info): Adjust. + * decl2.c (warn_if_unknown_interface): Adjust. + +2000-06-05 Mark Mitchell + + * class.c (indirect_primary_base_p): New function. + (determine_primary_base): Use it. + +2000-06-05 Nathan Sidwell + + Update new-abi dynamic cast algorithm. + * tinfo.cc (__class_type_info::__dyncast_result): Add + whole_details. Adjust constructor. + (__vmi_class_type_info::__do_dyncast): Adjust for vmi_flags. + Avoid unnecessary searching. + (__dynamic_cast): Adjust for __dyncast_result::whole_details. + +2000-06-05 Richard Kenner + + * decl.c (init_decl_processing): Don't call record_component_aliases. + * tree.c (build_cplus_array_type_1): Likewise. + +2000-06-04 Mark Mitchell + + * ir.texi: Correct typo. + * mangle.c (write_expression): Handle non-type template arguments + with reference type. + * method.c (build_overload_value): Likewise. + * pt.c (convert_nontype_argument): Explicitly represent conversion + to a reference with an ADDR_EXPR. + (unify): Always unify arguments in left-to-right order. + +2000-06-03 Alex Samuel + Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add mangle.c. + * Makefile.in (CXX_OBJS): Add mangle.o. + (mangle.o): New rule. + + * class.c (local_classes): New variable. + * class.c (get_vtable_name): Use mangle_vtable_for_type for new ABI. + (get_vtt_name): Use mangle_vtt_name for new ABI. + (init_class_processing): Initialize local_classes. + (build_ctor_vtbl_group): Use mangle_ctor_vtbl_for_type for new ABI. + * cp-tree.h (cp_tree_index): Add CPTI_STD_IDENTIFIER. + (std_identifier): New macro. + (DECL_VOLATILE_MEMFUNC_P): New macro. + (DECL_NAMESPACE_STD_P): Likewise. + (local_classes): Declare. + (get_mostly_instantiated_function_type): Declare. + (init_mangle): Declare. + (mangle_decl): Likewise. + (mangle_type_string): Likewise. + (mangle_type): Likewise. + (mangle_typeinfo_for_type): Likewise. + (mangle_typeinfo_string_for_type): Likewise. + (mangle_vtbl_for_type): Likewise. + (mangle_vtt_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_conv_op_name_for_type): Likewise. + (mangle_guard_variable): Likewise. + * decl.c (pushtag): Keep track of local classes. + (initialize_predefined_identifiers): Initialize std_identifier. + (init_decl_processing): Use std_identifier. + (start_decl): Don't treat instantiations as specializations. + (grokdeclarator): Likewise. + (grokvardecl): Call mangle_decl for new ABI. Only set mangled + name for fully-instantiated templates. + * decl2.c (grokclassfn): Use set_mangled_name_for_decl for + destructors with the new ABI. + (finish_static_data_member_decl): Use mangle_decl under the new ABI. + (grokfield): Use mangle_type for new ABI. + (grokoptypename): Use mangle_conv_op_for_type for new ABI. + (get_sentry): Use mangle_guard_variable for new ABI. + (start_static_initialization_or_destruction): Likewise. + * expr.c (extract_aggr_init): Remove. + (extract_scalar_init): Likewise. + (extract_init): Remove #if 0'd code. + * mangle.c: New function. + * method.c (build_mangled_name): Assert not flag_new_abi. + (build_static_name): Likewise. + (build_decl_overload_real): Likewise. + (build_typename_overload): Likewise. + (build_overload_with_type): Likewise. + (build_overload_name): Likewise. + (get_ctor_vtbl_name): Likewise. + (start_squangling): Likewise. + (get_id_2): Likewise. + (set_mangled_name_for_decl): Call mangle_decl for new ABI. + (init_method): Call init_mangle for new ABI. + (make_thunk): Call mangle_thunk for new ABI. + * operators.def: Correct new ABI manglings for the `%' operator. + Add `::' operator. + * pt.c (build_template_decl): Copy DECL_OVERLOADED_OPERATOR_P and + DECL_ASSIGNMENT_OPERATOR_P to the TEMPLATE_DECL. + (lookup_template_class): Call mangle_decl for new ABI. + (get_mostly_instantiated_function_type): New function. + (set_mangled_name_for_template_decl): Use it. + (tsubst_decl): Use set_mangled_name_for_decl for destructors with + the new ABI. Use mangle_conv_op_name_for_type for instantiated + conversion op names. + * rtti.c (tinfo_name): Call mangle_type_string for new ABI. + (get_tinfo_decl): Call mangle_typeinfo_for_type for new ABI. + (tinfo_base_init): Likewise. Mangle typeinfo string name with + mangle_typeinfo_string_for_type. + +2000-06-03 Mark Mitchell + + * cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment. + (INNERMOST_TEMPLATE_ARGS): New macro. + (innermost_args): Remove. + (get_innermost_template_args): New function. + * decl2.c (arg_assoc_class): Use INNERMOST_TEMPLATE_ARGS. + * error.c (dump_function_decl): Be caution when using + most_general_template. + * method.c (build_template_parm_names): Use + INNERMOST_TEMPLATE_ARGS. + * pt.c (add_to_template_args): Tidy comment + (get_innermost_template_args): New function. + (check_explicit_specialization): Clear DECL_INITIAL for a new + specialization. + (process_partial_specialization): Use INNERMOST_TEMPLATE_ARGS. + Tidy. + (push_template_decl): Always register specializations of the most + general template. + (convert_template_argument): Use INNERMOST_TEMPLATE_ARGS. + (coerce_template_parms): Likewise. + (lookup_template_class): Likewise. + (innermost_args): Remove. + (tsubst_decl): Use INNERMOST_TEMPLATE_ARGS. + (tsubst_decl): Handle tricky specializations. Use + get_innermost_template_args. + (instantiate_template): Simplify handling of partial + instantiations. + (get_class_bindings): Use INNERMOST_TEMPLATE_ARGS. + (most_general_template): Reimplement, in a more straightforward + manner. + (regenerate_decl_from_template): Tweak formatting. Use + TMPL_ARGS_DEPTH for clarity. + (set_mangled_name_for_template_decl): Use INNERMOST_ARGS. + + * dump.c (dequeue_and_dump): Dump information about thunks. + +2000-06-01 Richard Henderson + + * decl.c (init_decl_processing): Set lang_get_alias_set first thing. + +2000-06-01 Richard Henderson + + * decl2.c (unsupported_options): Fix typo, make const. + (lang_decode_option): Fix bsearch argument order. + +2000-06-01 Mark Mitchell + + * init.c (resolve_offset_ref): Remove check for TREE_ADDRESSABLE + on FIELD_DECLs. + +2000-05-31 Richard Kenner + + * cp-tree.h (c_get_alias_set): Deleted. + * Makefile.in (decl.o): Include ../expr.h. + * decl.c (expr.h): Include. + (init_decl_processing): Call record_component_aliases for arrays. + (grokdeclarator): Likewise. + Set TREE_ADDRESSABLE for fields that aren't bitfields. + * tree.c (build_cplus_array_type_1): Call record_component_aliases. + +2000-05-31 Mark Mitchell + + Remove guiding declaration support. + * cp/cp-tree.h (flag_dump_translation_unit): Make it const. + (flag_guiding_decls): Remove. + * call.c (build_user_type_conversion_1): Remove support for + guiding decls. + (build_new_function_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + * decl.c (start_function): Likewise. + * friend.c (is_friend): Likewise. + (do_friend): Likewise. + * decl2.c ((flag_dump_translation_unit): Make it const. + (flag_guiding_decls): Remove. + (unsupported_options): New variable + (compare_options): New function. + (lang_decode_option): Use them. + + * decl.c (build_cp_library_fn): Set DECL_CONTEXT. + + * method.c (mangle_expression): Adjust test for legal expression + operators. + + * pt.c (instantiate_decl): Save and restore the local + specializations list. + +2000-05-30 Jason Merrill + + * decl.c (grok_reference_init): Pass LOOKUP_ONLYCONVERTING. + +2000-05-30 Mark Mitchell + + * call.c (add_template_candidate_real): Handle member template + constructors for classes with virtual bases. + (build_user_type_conversion_1): Use in_charge_arg_for_name. + (build_new_method_call): Use DECL_NONSTATIC_MEMBER_FUNCTION_P. + + * ir.texi: Update thunk documentation. + + * call.c (joust): Fix handling of overloaded builtin operators. + +2000-05-30 Zack Weinberg + + * cp-tree.h (DECL_ANTICIPATED): New macro. + Document new use of DECL_LANG_FLAG_7. + * decl.c (builtin_function): Set DECL_ANTICIPATED on builtins + in the user namespace. + * lex.c (do_identifier): If the identifier's declaration has + DECL_ANTICIPATED on, it has not yet been declared. But do not + replace it with an ordinary implicit declaration. + + * tinfo2.cc: Include stdlib.h. + +2000-05-29 Mark Mitchell + + * cp-tree.h (CLASSTYPE_ALIGN_UNIT): New macro. + * class.c (layout_empty_base): Use CLASSTYPE_ALIGN_UNIT, not + CLASSTYPE_ALIGN. + +2000-05-28 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Use skip_leading_substring instead + of plain strncmp. + +2000-05-28 Alexandre Oliva + + * operators.def (?): this. Fixed. + +2000-05-27 Alex Samuel + Mark Mitchell + + * cp-tree.h (ansi_opname): Make it a macro. + (ansi_assopname): Likewise. + (struct lang_decl_flags): Add assignment_operator_p. + (struct lang_decl): Add operator_code. + (DECL_VTT_PARM): Adjust. + (DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an + overloaded operator. + (SET_OVERLOADED_OPERATOR_CODE): New macro. + (DECL_ASSIGNMENT_OPERATOR_P): New macro. + (DECL_ARRAY_DELETE_OPERATOR_P): Adjust. + (opname_tab): Remove. + (assignop_tab): Likewise. + (operator_name_info_t): New type. + (operator_name_info): New variable. + (assignment_operator_name_info): Likewise. + (build_cp_library_fn): Remove declaration. + (push_cp_library_fn): Likewise. + (operator_name_string): Likewise. + (build_decl_overload): Likewise. + * call.c (print_z_candidates): Simplify. + (build_object_call): Adjust usage of ansi_opname. Use + DECL_OVERLOADED_OPERATOR_P. + (op_error): Adjust operator name lookup. + (build_conditional_expr): Adjust usage of ansi_opname. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (build_over_call): Likewise. + (joust): Use DECL_OVERLOADED_OPERATOR_P. + * decl.c (duplicate_decls): Copy operator_code. + (init_decl_processing): Adjust parameters to push_cp_library_fn. + (builtin_function): Adjust parameters to build_library_fn_1. + (build_library_fn_1): Accept an overloaded operator code. + (build_library_fn): Pass ERROR_MARK. + (build_cp_library_fn): Accept an overloaded operator code. + (push_cp_library_fn): Likewise. + (grokfndecl): Tweak. + (grokdeclarator): Simplify code to compute names of overloaded + operators. Adjust use of ansi_opname. + (ambi_op_p): Work on tree_codes, not identifiers. + (unary_op_p): Likewise. + (grok_op_properties): Likewise. + (start_function): Use DECL_OVERLOADED_OPERATOR_P. + (lang_mark_tree): Don't try to mark the operator_code. + * decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P. + * error.c (dump_decl): Remove special handling for operator + names. + (dump_function_name): Likewise. + (dump_expr): Adjust name lookup of operators. + (op_to_string): Simplify. + (assop_to_string): Likewise. + * init.c (build_new_1): Adjust use of ansi_opname. + * lex.c (opname_tab): Remove. + (assignop_tab): Likewise. + (ansi_opname): Likewise. + (ansi_assopname): Likewise. + (operator_name_string): Likewise. + (reinit_lang_specific): Likewise. + (operator_name_info): New variable. + (assignment_operator_name_info): Likewise. + (init_operators): New function. + (init_parse): Use it. + (do_identifier): Adjust use of ansi_opname. + * method.c (mangle_expression): Don't use ansi_opname for + mangling. + (build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P. + (build_decl_overload): Remove. + (build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly. + (do_build_assign_ref): Adjust use of ansi_opname. + (synthesize_method): Likewise. + (implicitly_declare_fn): Likewise. + * operators.def: New file. + * parse.y (operator): Adjust use of ansi_opname. + * pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P. + (set_mangled_name_for_template_decl): Don't play games with + current_namespace. + (special_function_p): Adjust use of ansi_opname. + * typeck.c (check_return_expr): Likewise. + * Make-lang.in (cc1plus): Depend on operators.def. + * Makefile.in (lex.o): Likewise. + (decl.o): Likewise. + +2000-05-27 Zack Weinberg + + * Make-lang.in (cplib2.ready): Eradicate. + +2000-05-27 Richard Kenner + + * method.c (mangle_expression): Use TREE_CODE_LENGTH. + * tree.c (break_out_calls, build_min_nt): Use TREE_CODE_LENGTH. + (built_min, cp_tree_equal): Likewise. + +2000-05-26 Mark Mitchell + + * class.c (layout_nonempty_base_or_field): Replace + `record_layout_info' with `record_layout_info_s'. + +2000-05-26 Jason Merrill + + Fix goto checking. + * cp-tree.h (struct language_function): x_named_labels is now + a struct named_label_list*. + * decl.c (struct named_label_use_list): Renamed from... + (struct named_label_list): ...this. New struct. + (push_binding_level): Don't set eh_region. + (note_level_for_eh): New fn. + (pop_label): Take label and old value directly. + (pop_labels): Adjust for new named_labels format. + (lookup_label): Likewise. + (poplevel): Note characteristics of a binding level containing a + named label. Mess with named label lists earlier. + (mark_named_label_lists): New fn. + (mark_lang_function): Call it. + (use_label): New fn, split out from... + (make_label_decl): ...here. Don't call it. + (decl_jump_unsafe, check_previous_goto, check_previous_goto_1, + check_previous_gotos): New fns, split out from... + (define_label): ...here. + (check_switch_goto): New fn. + (define_case_label): Call it. + (check_goto): New fn. + * semantics.c (finish_goto_stmt): Call it and use_label. + (begin_compound_stmt): If we're a try block, call note_level_for_eh. + (expand_stmt): Never pass 1 as DONT_JUMP_IN to expand_end_bindings. + +2000-05-26 Mark Mitchell + + * class.c (build_vtable_entry_ref): Correct usage of + get_vtbl_decl_for_binfo. + + * decl2.c (grokclassfn): Set DECL_LANGUAGE here. + * method.c (implicitly_declare_fn): Not here. + +2000-05-26 Nathan Sidwell + + * cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ... + (CPTI_PTMD_DESC_TYPE): ... here. + (ptmd_desc_type_node): Rename to ... + (ptm_desc_type_node): ... here. + * decl.c: Likewise. + * rtti.c (ptmd_initializer): Rename to ... + (ptm_initializer): ... here. + (sythesize_tinfo_var): Adjust. Deal with pointer to member + function. + (create_tinfo_types): Adjust. + +2000-05-25 Mark Mitchell + + Finish implementation of VTTs. + * cp-tree.h (cp_tree_index): Add CPTI_VTT_PARM_TYPE and + CPTI_VTT_PARM_IDENTIFIER. + (vtt_parm_identifier): New macro. + (vtt_parm_type): Likewise. + (BINFO_SUBVTT_INDEX): Likewise. + (BINFO_VPTR_INDEX): Likewise. + (struct lang_decl): Add vtt_parm. + (DECL_VTT_PARM): New macro. + (DECL_USE_VTT_PARM): Likewise. + (DECL_NEEDS_VTT_PARM_P): Likewise. + (get_vtt_name): Declare. + (build_artificial_parm): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + (expand_indirect_vtbls_init): Remove. + * call.c (build_new_method_call): Pass the vtt to subobject + constructors and destructors. + * class.c (get_vtt_name): Give it external linkage. + (build_clone): Handle the magic VTT parameters for clones. + (clone_function_decl): Fix typo in comment. + (build_vtt): Keep track of the indices in the VTTs where various + entities are stored. + (build_vtt_inits): Likewise. + (dfs_build_vtt_inits): Likewise. + (build_ctor_vtbl_group): Tweak type of construction vtables. + (dfs_accumulate_vtbl_inits): Build vtables for all bases, even + primary bases, when building construction vtables. + * decl.c (duplicate_decls): Handle DECL_VTT_PARM. + (initialize_predefined_identifiers): Add vtt_parm_identifier. + (init_decl_processing): Initialize vtt_parm_type. + (grokfndecl): Use DECL_OVERLOADED_OPERATOR_P. + (lang_mark_tree): Make vtt_parm. + * decl2.c (build_artificial_parm): New function. + (maybe_retrofit_in_chrg): Use it. Add VTT parameters. + (grokclassfn): Use build_artificial_parm. + * init.c (initialize_vtbl_ptrs): Call + fixup_all_virtual_upcast_offsets directly. + (perform_member_init): Use the complete subobject destructor for + member cleanups. + (build_vtbl_address): New function. + (expand_virtual_init): Handle VTTs. + * optimize (maybe_clone_body): Likewise. + * search.c (fixup_all_virtual_upcast_offsets): Give it external + linkage. + (expand_indirect_vtbls_init): Remove. + * semantics.c (setup_vtbl_ptr): Fix typos in comment. + * tree.c (make_binfo): Make them bigger. + +2000-05-25 Nathan Sidwell + + * inc/cxxabi.h (__pbase_type_info): Define, based on + __pointer_type_info. + (__pointer_type_info): Derive from __pbase_type_info. Adjust. + (__pointer_to_member_type_info): Likewise. + * tinfo2.cc (__pbase_type_info::~__pbase_type_info): Implement. + (__pointer_to_member_type_info::__is_pointer_p): Remove. + (__pointer_type_info::__do_catch): Rename to ... + (__pbase_type_info::__do_catch): ... here. Adjust. + (__pbase_type_info::__pointer_catch): Implement. + (__pointer_type_info::__pointer_catch): Adjust. + (__pointer_to_member_type_info::__pointer_catch): Adjust. + +2000-05-25 Nathan Sidwell + + * tinfo.h (__user_type_info::contained_virtual_p): New + predicate. + * tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond + shaped hierarchy. + (__vmi_class_type_info::__do_upcast): Fix bug with NULL pointer to + diamond shaped hierarchy. Add early out for mixed diamond and + duplicate shaped hierarchy. + +2000-05-24 Mark Mitchell + + * cp-tree.h (build_delete): Change prototype. + (build_vec_delete): Likewise. + * call.c (build_scoped_method_call): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_method_call): Likewise. + * decl.c (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. Rename to ... + (maybe_build_cleanup): ... this. + * decl2.c (delete_sanity): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_cleanup): Likewise. + * init.c (perform_member_init): Likewise. + (build_vec_delete_1): Likewise. + (build_dtor_call): Simplify. + (build_delete): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_vbase_delete): Likewise. + (build_vec_delete): Likewise. + + * init.c (sort_member_init): Fix typo in error message generation + code. + +2000-05-15 Donald Lindsay + + * semantics.c (begin_class_definition): make the packed + attribute be sensitive to the "-fpack-struct" command line flag + +2000-05-24 Nathan Sidwell + + Update new-abi upcast algorithm. + * inc/cxxabi.h (__class_type_info::__do_upcast): Change + prototype and meaning of return value. + (__si_class_type_info::__do_upcast): Likewise. + (__vmi_class_type_info::__do_upcast): Likewise. + * tinfo.cc (__class_type_info::__upcast_result): Replace + whole2dst with part2dst. Adjust ctor. + (__class_type_info::__do_upcast): Adjust call of worker function. + (__class_type_info::__do_upcast): Adjust. + (__si_class_type_info::__do_upcast): Adjust. Use parent's + __do_upcast. + (__vmi_class_type_info::__do_upcast): Likewise. Fix private + virtual base in diamond hierarchy bug. + +2000-05-23 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable + and bitfield to tinfo_fn_p. + (DECL_TINFO_FN_P): Adjust. + (SET_DECL_TINFO_FN_P): Likewise. + (DECL_MUTABLE_P): Likewise. + (DECL_C_BIT_FIELD): Likewise. + (SET_DECL_C_BIT_FIELD): Likewise. + (CLEAR_DECL_C_BIT_FIELD): Likewise. + (DECL_UNINLINABLE): Likewise. + * class.c (alter_access): Call retrofit_lang_decl if ncessary. + (handle_using_decl): Remove assertion. + (build_vtbl_or_vbase_field): Use build_decl, not build_lang_decl, + to build FIELD_DECLs. + (build_base_field): Likewise. + (layout_class_type): Likewise. + * decl.c (init_decl_processing): Likewise. + (build_ptrmemfunc_type): Likewise. + (grokdeclarator): Likewise. + * decl2.c (grok_x_components): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * rtti.c (expand_class_desc): Likewise. + (create_pseudo_type_info): Likewise. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + * ptree.c (print_lang_decl): Adjust. + * typeck.c (build_component_ref): Don't check DECL_LANG_SPECIFIC + before checking DECL_MUTABLE_P. + + * decl2.c (maybe_retrofit_in_chrg): Don't create in-charge + parameters for template functions. + * pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for + destructors as well as constructors. + +2000-05-22 Mark Mitchell + + * class.c (build_ctor_vtbl_group): Set inits. + * optimize.c (maybe_clone_body): Set DECL_INLINE and + DECL_THIS_INLINE appropriately for clones. + + * cp-tree.h (IDENTIFIER_TYPENAME_P): Use a flag, not strncmp. + (DECL_CONV_FN_P): Simplify. + (DECL_OPERATOR): Remove. + (language_to_string): Declare. + * decl.c (duplicate_decls): Fix typo in comment. + (grokdeclarator): Adjust use of IDENTIFIER_TYPENAME_P. + (grok_op_properties): Use DECL_CONV_FN_P instead of + IDENTIFIER_TYPENAME_P. + * dump.c (dequeue_and_dump): Dump the language linkage of + declarations. + * error.c (language_to_string): Give it external linkage. + * method.c (build_typename_overload): Set IDENTIFIER_TYPENAME_P. + (implicitly_declare_fn): Set DECL_LANGUAGE. + * pt.c (check_explicit_specialization): Use DECL_CONV_FN_P, not + IDENTIFIER_TYPENAME_P. + (tsubst_decl): Likewise. + (tsubst_copy): Adjust use of IDENTIFIER_TYPENAME_P. + * semantics.c (finish_member_declaration): Don't mark members of + classes declared in an extern "C" region as extern "C". + +2000-05-22 Martin v. Löwis + + * decl2.c (qualified_lookup_using_namespace): Look through + namespace aliases. + + * decl.c (push_using_decl): Return the old decl on namespace level. + +2000-05-21 Mark Mitchell + + * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks. + (VTT_NAME_PREFIX): New macro. + (CTOR_VTBL_NAME_PREFIX): Likewise. + (get_ctor_vtbl_name): New function. + * class.c (get_vtable_name): Simplify. + (get_vtt_name): New function. + (get_vtable_decl): Don't set IDENTIFIER_GLOBAL_VALUE. + (dfs_mark_primary_bases): Update the CLASSTYPE_VBASECLASSES list + when a virtual base becomes primary. + (finish_struct_1): Set CLASSTYPE_VFIELDS a little earlier. Build + VTTs. + (finish_vtbls): Adjust calls to accumulate_vtbl_inits to pass in + additional parameters. + (dfs_finish_vtbls): Don't clear BINFO_NEW_VTABLE_MARKED. + (initialize_array): New function. + (build_vtt): Likewise. + (build_vtt_inits): Likewise. + (dfs_build_vtt_inits): Likewise. + (dfs_fixup_binfo_vtbls): Likewise. + (build_ctor_vtbl_group): Likewise. + (initialize_vtable): Use initialize_array. + (accumulate_vtbl_inits): Reimplement to handle construction + vtables. + (dfs_accumulate_vtbl_inits): Likewise. + (bulid_vtbl_initializer): Adjust parameter name. + * method.c (build_typename_overload): Remove #if 0'd code. + (get_ctor_vtbl_name): New function. + * search.c (dfs_walk_real): Use BINFO_N_BASETYPES. + (init_vbase_pointers): Don't mess with the TREE_CHAIN of a binfo. + + * cp-tree.h (struct lang_type): Remove search_slot. + (CLASSTYPE_SEARCH_SLOT): Remove. + (emit_base_init): Change prototype. + (initialize_vtbl_ptrs): Likewise. + (expand_indirect_vtbls_init): Likewise. + (clear_search_slots): Remove. + * decl.c (lang_mark_tree): Don't mark search_slot. + * init.c (initialize_vtbl_ptrs): Simplify. + (emit_base_init): Likewise. + * search.c (struct vbase_info): Document decl_ptr. + (convert_pointer_to_single_level): Remove. + (dfs_find_vbases): Remove. + (dfs_init_base_pointers): Simplify. + (dfs_clear_vbase_slots): Remove. + (dfs_vtable_path_unmark): New function. + (init_vbase_pointers): Simplify. + (expand_upcast_fixups): Don't rely on CLASSTYPE_SEARCH_SLOT. + (expand_indirect_vtbls_init): Simplify. Don't call + mark_all_temps_used. + * semantics.c (setup_vtbl_ptr): Adjust calls to emit_base_init and + initialize_vtbl_ptrs. + +2000-05-20 Zack Weinberg + + * except.c: Add static prototypes. + +2000-05-20 H.J. Lu + + * Make-lang.in (cplib2.ready): Also depend on cc1plus$(exeext). + +2000-05-19 Mark Mitchell + + Don't create a separate copy of virtual bases for the + CLASSTYPE_VBASECLASSES list. + * cp-tree.h (CLASSTYPE_VBASECLASSES): Change documentation. + (BINFO_FOR_VBASE): Remove. + (CANONICAL_BINFO): Adjust. + (binfo_for_vbase): New function. + * class.c (build_vbase_pointer_fields): Use binfo_for_vbase + instead of BINFO_FOR_VBASE. + (build_vbase_pointer): Likewise. + (build_secondary_vtable): Likewise. + (dfs_mark_primary_bases): Likewise. + (mark_primary_bases): Likewise. + (layout_nonempty_base_or_field): Likewise. + (dfs_set_offset_for_shared_vbases): Likewise. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Likewise. Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (dump_class_hierarchy_r): Use binfo_for_vbase + instead of BINFO_FOR_VBASE. + (dump_class_hierarchy): Likewise. + (finish_vtbls): Likewise. + (build_vtbl_initializer): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (build_vbase_offset_vtbl_entries): Use binfo_for_vbase. + * decl.c (finish_destructor_body): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + * init.c (sort_base_init): Use binfo_for_vbase. + (construct_virtual_bases): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (expand_member_init): Use binfo_for_vbase. + (build_vbase_delete): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + * method.c (do_build_copy_constructor): Likewise. + * rtti.c (get_base_offset): Use binfo_for_vbase. + (expand_class_desc): Remove #if 0'd code. + * search.c (struct vbase_info): Remove vbase_types. + (get_base_distance): Use binfo_for_vbase. + (lookup_field_queue_p): Use CANONICAL_BINFO. + (get_shared_vbase_if_not_primary): Use binfo_for_vbase. + (get_pure_virtuals): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (dfs_find_vbases): Use binfo_for_vbase. + (dfs_init_vbase_pointers): Likewise. + (init_vbase_pointers): Don't initialize vi.vbase_types. + (virtual_context): Use binfo_for_vbase. + (fixup_all_virtual_upcast_offsets): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (expand_indirect_vtbls_init): Simplify. + (dfs_get_vbase_types): Don't replicate virtual bases. + (find_vbase_instance): Use binfo_for_vbase. + (binfo_for_vbase): New function. + * typeck.c (get_delta_difference): Use binfo_for_vbase. + +2000-05-17 Mark Mitchell + + * decl2.c (finish_anon_union): Generalize error messages to handle + anonymous structures. + * init.c (perform_member_init): Remove `name' parameter. + (build_field_list): New function. + (sort_member_init): Handle anonymous union initialization order + correctly. Check for multiple initializations of the same union. + (emit_base_init): Don't look up fields by name here. + (expand_member_init): Record the result of name lookup for future + reference. + * typeck.c (build_component_ref): Fix formatting. + +2000-05-17 Andrew Cagney + + * decl.c (pop_label): Replace warn_unused with warn_unused_label. + * typeck.c (build_x_compound_expr): Replace warn_unused with + warn_unused_value. + + * decl2.c (lang_decode_option): Update -Wall unused flags by + calling set_Wunused. + +2000-05-16 Mark Mitchell + + * cp-treeh (BINFO_NEW_VTABLE_MARKED): Update documentation. + * init.c (dfs_vtable_path_unmark): Remove. + * search.c (marked_new_vtable_p): Likewise. + (unmarked_new_vtable_p): Likewise. + (dfs_search_slot_nonempty_p): Likewise. + (dfs_mark): Likewise. + (dfs_vtable_path_unmark): Likewise. + (dfs_find_vbases): Don't set BINFO_NEW_VTABLE_MARKED. + (dfs_int_vbase_pointers): Don't clear BINFO_VTABLE_PATH_MARKED. + (dfs_init_vbase_pointers): Remove special-case new ABI code. + (dfs_clear_vbase_slots): Don't clear BINFO_NEW_VTABLE_MARKED. + (init_vbase_pointers): Simplify. + (expand_indirect_vtbls_init): Likewise. + + * class.c (copy_virtuals): New function. + (build_primary_table): Use it. + (build_secondary_vtable): Likewise. + (modify_vtable_entry): Use NULL_TREE, not integer_zero_node, to + indicate that no vcall offset is required. + (add_virtual_function): Likewise. + (modify_all_vtables): Likewise. + (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. + (dfs_accumulate_vtbl_inits): Likewise. + (build_vtbl_initializer): Make changes to handle construction + vtables. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_rtti_vtbl_entries): Likewise. + (build_vtable_entries): Handle a NULL vcall_index. + +2000-05-15 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Fix thinko. + +2000-05-14 Jason Merrill + + * except.c (check_handlers): New fn. + * cp-tree.h: Declare it. + * semantics.c (finish_handler_sequence): Call it. + (finish_function_handler_sequence): Likewise. + (finish_handler_parms): Set TREE_TYPE on the handler. + * cp-tree.h (PUBLICLY_UNIQUELY_DERIVED_P): New macro. + * search.c (get_base_distance_recursive): If protect>1, ignore + special access. + (get_base_distance): Don't reduce watch_access. + +2000-05-13 Gabriel Dos Reis + + * lex.c: #include diagnostic.h. + (lang_init_options): Set default prefixing rules. + + * lang-options.h: Add -fdiagnostics-show-location=. + + * decl2.c: #include diagnostic.h. + (lang_decode_option): Handle -fdiagnostics-show-location=. + +2000-05-12 Nathan Sidwell + + * tinfo.cc: Revert my 2000-05-08 and 2000-05-07 changes. + * vec.cc: Revert my 2000-05-07 change. + +2000-05-11 Jason Merrill + + * class.c (check_field_decls): Complain about non-static data + members with same name as class in class with constructor. + +2000-05-10 Jason Merrill + + * decl.c (grokdeclarator): Allow non-static data members with + same name as class. + +2000-05-09 Zack Weinberg + + * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, + and pending_inline.filename. Update prototypes. + * decl.c (define_label): Constify filename parameter. + * decl2.c (warn_if_unknown_interface): Constify local char *. + * input.c Constify input_source.filename. Don't declare + input_filename or lineno. Constify filename parameter to feed_input. + * lex.c (init_parse): Constify parameter and return value. + (cp_pragma_interface, cp_pragma_implementation): Constify + filename argument. + (reinit_parse_for_method, reinit_parse_for_block, + reinit_parse_for_expr, feed_defarg, handle_cp_pragma): + Constify local char *. + * pt.c: Don't declare lineno or input_filename. + (print_template_context, tsubst_friend_function, tsubst_decl, + tsubst, instantiate_decl): Constify local char *. + * semantics.c (expand_body): Constify local char *. + * tree.c (build_srcloc): Constify filename parameter. + * typeck.c (c_expand_asm_operands): Constify filename + parameter. + +2000-05-08 Nathan Sidwell + + * tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix + offsetof expansion. + +2000-05-08 Branko Cibej + + * inc/cxxabi.h: Fix typos in comment. + (__base_class_info::__offset): Use a static_cast. + +2000-05-07 Nathan Sidwell + + * inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place + of std::size_t and std::ptrdiff_t respectively. + * tinfo.cc: Likewise. + * vec.cc: Likewise. + +2000-05-06 Richard Henderson + + * typeck.c (build_c_cast): Don't warn integer->pointer size + mismatch for constants. + +2000-05-06 Nathan Sidwell + + * rtti.c (ptmd_initializer): Set non-public, if class is + incomplete. + + * inc/cxxabi.h (__dynamic_cast): Explicitly say extern "C++". + (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Likewise. + * tinfo.cc (__dynamic_cast): Likewise. + * vec.cc (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Likewise. + +2000-05-04 Mark Mitchell + + * cp-tree.h (DELTA_FROM_VTABLE_ENTRY): Remove. + (SET_FNADDR_FROM_VTABLE_ENTRY): Likewise. + (lang_decl_flags): Add vcall_offset. + (THUNK_VCALL_OFFSET): Use it. + * decl.c (lang_mark_tree): Don't mark DECL_ACCESS for a thunk. + * method.c (make_thunk): Create the lang_decl here, not in + emit_thunk. + (emit_thunk): Make generic thunks into ordinary functions once + they have been fed to expand_body. + * semantics.c (expand_body): Set current_function_is_thunk here. + +2000-05-04 Kaveh R. Ghazi + + * class.c (update_vtable_entry_for_fn): Prototype. + + * pt.c (tsubst_decl): Initialize variables `argvec', `gen_tmpl' + and `tmpl'. + + * search.c (dfs_build_inheritance_graph_order): Prototype. + +2000-05-04 Mark Mitchell + + * cp-tree.h (special_function_kind): Add various kinds of + destructors. + (special_function_p): New function. + * class.c (overrides): Don't let one kind of destructor override + another. + * decl2.c (mark_used): Use DECL_NON_THUNK_FUNCTION_P when deciding + whether or not to instantiate a template. + * tree.c (special_function_p): Define. + +2000-05-03 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Remove. + * cp-tree.h (DECL_THUNK_P): New macro. + (DECL_NON_THUNK_FUNCTION_P): Likewise. + (DECL_EXTERN_C_FUNCTION_P): Likewise. + (SET_DECL_THUNK_P): Likewise. + (DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P. + (FNADDR_FROM_VTABLE_ENTRY): Likewise. + (DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P. + * decl.c (decls_match): Use DECL_EXTERN_C_P. + (duplicate_decls): Likewise. + (pushdecl): Likewise. Adjust thunk handling. + (grokfndecl): Use DECL_EXTERN_C_P. + * decl2.c (mark_vtable_entries): Use DECL_THUNK_P. + * dump.c (dequeue_and_dump): Remove THUNK_DECL handling. + * except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P. + * expr.c (cplus_expand_expr): Remove THUNK_DECL handling. + * method.c (make_thunk): Use SET_DECL_THUNK_P. Set + DECL_NO_STATIC_CHAIN. + (emit_thunk): Don't play games with TREE_CODE on thunks. Don't + set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk. + * search.c (covariant_return_p): Remove THUNK_DECL handling. + * ir.texi: Update. + +2000-05-01 Jason Merrill + + * tree.c (walk_tree): Set lineno. + +2000-05-01 Mark Mitchell + + * exception.cc: Update license notice. + * new.cc: Likewise. + * new1.cc: Likewise. + * new2.cc: Likewise. + * tinfo.cc: Likewise. + * tinfo2.cc: Likewise. + * vec.cc: Likewise. + * inc/cxxabi.h: Likewise. + * inc/exception: Likewise. + * inc/new: Likewise. + * inc/new.h: Likewise. + * inc/typeinfo: Likewise. + +2000-05-01 Jason Merrill + + * tree.c (build_target_expr_with_type): If we already have a + TARGET_EXPR, just return it. + + * optimize.c (initialize_inlined_parameters): Don't generate an + EXPR_STMT if we can just use DECL_INITIAL. + * decl.c (emit_local_var): Only make the initialization a + full-expression if stmts_are_full_exprs_p. + +2000-05-01 Mark Mitchell + + * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): New + macro. + * call.c (standard_conversion): Use it. + (direct_reference_binding): Likewise. + (build_over_call): Likewise. + (is_properly_derived_from): Likewise. + (compare_ics): Likewise. + * class.c (resolves_to_fixed_type_p): Likewise. + * optimize.c (declare_return_variable): Likewise. + * pt.c (is_specialization_of): Likewise. + (unify): Likewise. + * typeck.c (comp_target_parms): Likeiwse. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (comp_ptr_ttypes_real): Likewise. + (comp_ptr_ttypes_const): Likewise. + * typeck2.c (process_init_constructor): Likewise. + +2000-04-30 Scott Snyder + + * decl.c (finish_destructor_body): Use the base destructor when + destroying virtual bases. + +2000-04-30 Mark Mitchell + + * expr.c (cplus_expand_expr): Preserve temporaries when expanding + STMT_EXPRs. + * optimize.c (struct inline_data): Add target_exprs field. + (declare_return_variable): When a function returns an aggregate, + use the variable declared in the TARGET_EXPR as the remapped + DECL_RESULT. + (expand_call_inline): Update the pending target_exprs stack. + (optimize_function): Initialize the stack. + + * decl2.c (finish_file): Fix typo in comment. + + * method.c (emit_thunk): Don't try to return a `void' value. + + * optimize.c (initialize_inlined_parameters): If the parameter is + addressable, we need to make a new VAR_DECL, even if the + initializer is constant. + +2000-04-28 Cosmin Truta + + * decl.c (grok_op_properties): Add an extra check of argtypes. + +2000-04-27 Mark Mitchell + + * optimize.c (copy_body_r): Use STRIP_TYPE_NOPS when copying + variables. + (initialize_inlined_parameters): Try to avoid creating new + VAR_DECLs. + +2000-04-27 Alex Samuel + + * lex.c (my_get_run_time): Remove. + (init_filename_times): Use get_run_time instead of my_get_run_time. + (check_newline): Likewise. + (dump_time_statistics): Likewise. + * decl2.c (finish_file): Push and pop timevar TV_VARCONST instead + of computing elapsed time explicitly. + +2000-04-26 Mark Mitchell + + * cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P. + * init.c (decl_constant_value): Check TREE_READONLY_DECL_P. + * call.c (convert_like_real): Don't test TREE_READONLY_DECL_P + before calling decl_constant_value. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (ocp_convert): Likewise. + (convert): Likewise. + * decl.c (compute_array_index_type): Likewise. + (build_enumerator): Likewise. + * decl2.c (check_cp_case_value): Likewise. + * pt.c (convert_nontype_argument): Likewise. + (tsubst): Likewise. + * typeck.c (decay_conversion): Likewise. + (build_compound_expr): Likewise. + (build_reinterpret_cast): Likewise. + (build_c_cast): Likewise. + (convert_for_assignment): Likewise. + +2000-04-26 Jason Merrill + + * decl.c (finish_function): Don't play games with DECL_INLINE. + +2000-04-25 Gabriel Dos Reis + + * ir.texi: Correct typo. + +2000-04-25 Martin v. Löwis + + * decl.c (grokdeclarator): Reject VLAs as members. + +2000-04-24 Gabriel Dos Reis + + * call.c (standard_conversion): Accept conversion between + COMPLEX_TYPEs. + + * cvt.c (ocp_convert): Handle conversion to COMPLEX_TYPE. + +2000-04-24 Zack Weinberg + + * decl2.c (finish_file): Remove double setup for accounting + compile time. + +2000-04-24 Robert Lipe + + * cp-tree.h (lang_type): Member `language' now ENUM_BITFIELD. + +2000-04-23 Benjamin Kosnik + + * new.cc (set_new_handler): Needs to be in std::. + +2000-04-23 Mark Mitchell + + * cp-tree.h (lang_decl): Remove pretty_function_p. + (DECL_PRETTY_FUNCTION_P): Use TREE_LANG_FLAG_0, not a bit in the + language-specific node. + * decl.c (cp_make_fname_decl): Use build_decl, not + build_lang_decl, to build the variables. + (grokvardecl): Don't call build_lang_decl for local variables in + templates. + (grokdeclarator): Don't call build_lang_decl for local type + declarations in templates. + * lex.c (retrofit_lang_decl): Use ggc_alloc_obj to allocated + zero'd memory, rather than calling memset. + * pt.c: Include hashtab.h. + (local_specializations): New variable. + (retrieve_local_specialization): Use it. + (register_local_specialization): Likewise. + (tsubst_decl): Don't assume local variables have + DECL_LANG_SPECIFIC. + (instantiate_decl): Set up local_specializations. + * Makefile.in (HTAB_H): New variable. + +2000-04-23 Richard Henderson + + * typeck.c (c_expand_asm_operands): Restore the original + contents of the output list. + +2000-04-22 Gabriel Dos Reis + + * ir.texi: Document complex number representation. + +2000-04-20 Nathan Sidwell + + * rtti.c (init_rtti_processing): Set tinfo_var_id in new-abi. + (target_incomplete_p): New function. + (tinfo_base_init): Create comdat NTBS name variable. + (ptr_initializer): Add non_public parameter. Calculate it. + (ptmd_initializer): Likewise. + (synthesize_tinfo_var): Adjust. Emit incomplete class tinfo. + (create_real_tinfo_var): Add non_public parameter. Use it. + Push proxy into global namespace. + * inc/cxxabi.h (__pointer_type_info::incomplete_class_mask): + New enumeration. + * inc/typeinfo (type_info::before, type_info::operator==): + Compare __name addresses. + + * tinfo2.cc: Remove new-abi builtins comment. + +2000-04-20 Jason Merrill + + * typeck.c (build_x_function_call): Resolve an OFFSET_REF. + + * call.c (joust): Exit early if we get the same function, too. + + * decl2.c (key_method): Return NULL_TREE for template classes. + (import_export_class): Don't need to check for template classes. + +2000-04-18 Zack Weinberg + + * lex.c: Remove references to cccp.c. + +2000-04-18 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove const_memfunc and + volatile_memfunc. Add destructor_attr. Adjust dummy. + (DECL_DESTRUCTOR_P): Use destructor_attr. + (DECL_CONST_MEMFUNC_P): Reimplement. + (DECL_VOLATILE_MEMFUNC_P): Remove. + * class.c (finish_struct_methods): Use CLASSTYPE_DESTRUCTORS. + (overrides): Use DECL_DESTRUCTOR_P. + (check_for_override): Likewise. + * decl.c (start_function): Likewise. + * decl2.c (grokfclassfn): Likewise. + (check_classfn): Likewise. + (grok_function_init): Likewise. + +2000-04-17 Mark Mitchell + + * decl2.c (grokfield): Issue error on illegal data member + declaration. + +2000-04-17 Mark P Mitchell + + * method.c (make_thunk): Set DECL_CONTEXT for a THUNK_DECL. + +2000-04-16 Mark Mitchell + + * class.c (build_vtable_entry): Don't build thunks for type-info + functions. + +2000-04-16 Jason Merrill + + * decl.c (decls_match): Allow a redeclaration of a builtin to + specify args while the builtin did not. + +2000-04-15 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Add to documentation. + * cp-tree.h (flag_huge_objects): Declare. + * class.c (modify_vtable_entry): Tidy. + (update_vtable_entry_for_fn): Split out from dfs_modify_vtables. + Calculate delta appropriately for the new ABI. + (dfs_modify_vtables): Use it. + (modify_all_vtables): Fix thinko in code to add overriding copies + of functions to primary vtables. + (build_clone): Fix typo in comment. + (clone_function_decl): Correct order of destructors in vtable. + (build_vbase_offset_vtbl_entries): Adjust comment. + (dfs_vcall_offset_queue_p): Remove. + (dfs_build_vcall_offset_vtbl_entries): Update BV_VCALL_INDEX. + (build_vcall_offset_vtbl_entries): Juse use dfs_skip_vbases. + (build_vtable_entry): Correct check for pure virtual functions. + Don't declare flag_huge_objects. + * decl.c (flag_huge_objects): Remove declaration. + * method.c (make_thunk): Tweak mangling for vcall offset thunks. + Use int_size_in_bytes. + (emit_thunk): Handle vcall offset thunks. + +2000-04-15 Richard Kenner + + * decl2.c (parse_time, varconst_time): Delete declarations. + (finish_file): Delete LINENO declaration. + START_TIME and THIS_TIME now long. + +2000-04-13 Nathan Sidwell + + * class.c (build_base_field): Reformat comment. + + * inc/cxxabi.h (stddef.h): Comment inclusion. + (__base_class_info::__offset): Comment shift. + +2000-04-12 Mark Mitchell + + * cp-tree.h (IDENTIFIER_CTOR_OR_DTOR_P): New macro. + (cp_tree_index): Add CPTI_PUSH_EXCEPTION_IDENTIFIER. + (cp_push_exception_identifier): New macro. + (DECL_COMPLETE_DESTRUCTOR_P): New macro. + (DECL_BASE_DESTRUCTOR_P): Likewise. + (DECL_DELETING_DESTRUCTOR_P): Likewise. + (get_vtbl_decl_for_binfo): Fix formatting. + (in_charge_arg_for_name): New macro. + (maybe_build_cleanup_and_delete): Remove declaration. + * call.c (build_field_call): Use IDENTIFIER_CTOR_OR_DTOR_P. + (in_charge_arg_for_name): New function. + (build_new_method_call): Use it. Handle cloned destructors. + (build_clone): Don't make the base constructor virtual. + Automatically defer generated functions. + (clone_function_decl): Handle destructors, too. + (clone_constructors_and_destructors): Likewise. + (create_vtable_ptr): Don't create a vtable entry for a cloned + function. + * decl.c (predefined_identifier): Add ctor_or_dtor_p. + (initialize_predefined_identifiers): Update appropriately. + (finish_destructor_body): Simplify. + (maybe_build_cleanup_and_delete): Remove. + * except.c (expand_throw): Handle new-ABI destructors. + * init.c (expand_cleanup_for_base): Use base_dtor_identifier. + (build_dtor_call): New function. + (build_delete): Use it. Simplify. + * optimize.c (maybe_clone_body): Handle destructors. + * search.c (lookup_field_queue_p): Use IDENTIFIER_CTOR_OR_DTOR_P. + + * exception.cc (cleanup_fn): New typedef. + (CALL_CLEANUP): New macro. + (cp_eh_info): Use them. + (__cp_push_exception): Likewise. + (__cp_pop_exception): Likewise. + +2000-04-11 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER. + (complete_dtor_identifier): New macro. + (CLASSTYPE_FIRST_CONVERSION): Remove. + (CLASSTYPE_CONSTRUCTOR_SLOT): New macro. + (CLASSTYPE_DESTRUCTOR_SLOT): Likewise. + (CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise. + (CLASSTYPE_CONSTRUCTORS): Likewise. + (CLASSTYPE_DESTRUCTORS): Likewise. + (lang_decl): Add cloned_function. + (DECL_COMPLETE_CONSTRUCTOR_P): New macro. + (DECL_BASE_CONSTRUCTOR_P): Likewise. + (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise. + (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise. + (DECL_CLONED_FUNCTION_P): Likewise. + (DECL_CLONED_FUNCTION): Likewise. + (clone_function_decl): Declare. + (maybe_clone_body): Likewise. + * call.c (build_user_type_conversion_1): Call complete object + constructors in the new ABI. + (build_new_method_call): Don't add in-charge parameters under the + new ABI. + * class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P, + DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and + CLASSTYPE_DESTRUCTOR_SLOT. + (build_clone): New function. + (clone_function_decl): Likewise. + (clone_constructors_and_destructors): Likewise. + (check_bases_and_members): Use it. + * decl.c (iniitialize_predefined_identifiers): Initialize + complete_dtor_identifier. + (finish_function): Don't add extra code to a clone. + (lang_mark_tree): Mark cloned_function. + * decl2.c (mark_used): Don't bother trying to instantiate things + we synthesized. + * dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice. + * method.c (set_mangled_name_for_decl): Don't treat clones as + constructors. + (synthesize_method): Sythesize cloned functions, not the clones. + * optimize.c (inline_data): Update comment on ret_label. + (remap_block): Don't assume DECL_INITIAL exists. + (copy_body_r): Allow ret_label to be NULL. + (maybe_clone_body): Define. + * pt.c (tsubst_decl): Handle clones. + (instantiate_clone): New function. + (instantiate_template): Use it. + (set_mangled_name_for_template_decl): Don't treat clones as + constructors. + * search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT, + CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT. + * semantics.c (expand_body): Clone function bodies as necessary. + + * optimize.c (remap_decl): Avoid sharing structure for arrays + whose size is only known at run-time. + * tree.c (copy_tree_r): Don't copy PARM_DECLs. + + * cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr + to has_in_charge_parm_p. + (DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ... + (DECL_HAS_IN_CHARGE_PARM_P): ... this. + (DECL_COPY_CONSTRUCTOR_P): New macro. + * call.c (add_function_candidate): Use DECL_HAS_IN_CHARGE_PARM_P. + (build_user_type_conversion_1): Likewise. + (convert_like_real): Likewise. + (build_over_call): Likeiwse. Use DECL_COPY_CONSTRUCTOR_P. + * decl.c (grokdeclarator): Use DECL_HAS_IN_CHARGE_PARM_P. + (copy_args_p): Likewise. + (grok_ctor_properties): Likewise. + (start_function): Likewise. + * decl2.c (maybe_retrofit_in_charge): Likewise. Set it. + * error.c (dump_function_decl): Use DECL_HAS_IN_CHARGE_PARM_P. + * init.c (emit_base_init): Use DECL_COPY_CONSTRUCTOR_P. + * method.c (do_build_copy_constructor): Use + DECL_HAS_IN_CHARGE_PARM_P. + (synthesize_method): Likewise. + * pt.c (instantiate_template): Remove goto. + * tree.c (build_cplus_method_type): Remove mention of obstacks in + comment. + + * cp-tre.h (finish_function): Change prototype. + * decl.c (end_cleanup_fn): Adjust caller. + (finish_function): Take only one parameter. + * decl2.c (finish_objects): Adjust caller. + (finish_static_storage_duration_function): Likewise. + * method.c (emit_thunk): Likewise. + * parse.y: Likewise. + * parse.c: Regenerated. + * pt.c (instantiate_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * semantics.c (expand_body): Likewise. + + * cp-tree.h (copy_decl): New function. + * class.c (finish_struct_1): Use it. + * lex.c (copy_decl): Define it. + * pt.c (tsubst_decl): Likewise. + * tree.c (copy_template_template_parm): Likewise. + + * cp-tree.h (lang_type): Remove has_nonpublic_ctor and + has_nonpublic_assign_ref. + (TYPE_HAS_NONPUBLIC_CTOR): Don't declare. + (TYPE_HAS_NONPUBLIC_ASSIGN_REF): Likewise. + * class.c (finish_struct_methods): Don't set + TYPE_HAS_NONPUBLIC_CTOR or TYPE_HAS_NONPUBLIC_ASSIGN_REF. + (interface_only): Don't declare. + (interface_unknown): Likewise. + +2000-04-11 Martin v. Löwis + + * tree.h (HAVE_TEMPLATES): Remove definition. + * lang-options.h (-fthis-is-variable): Remove documentation. + +2000-04-10 Jason Merrill + + * class.c (instantiate_type): Handle object-relative template-id. + + * semantics.c (finish_expr_stmt): Call convert_to_void here. + * decl.c (cplus_expand_expr_stmt): Not here. + + * rtti.c (build_dynamic_cast_1): Call non_lvalue. + Initialize exprtype earlier. + + * parse.y (fn.def1): Check for defining types in return types. + + * decl.c (check_tag_decl): Notice extra fundamental types. + Diagnose empty decls in classes, too. + + * decl.c (grokdeclarator): Don't override an anonymous name if no + declarator was given. + + * cvt.c (convert_to_void): Call resolve_offset_ref. + + * typeck.c (build_x_function_call): Abort if we get an OFFSET_REF. + + * decl2.c (decl_namespace): Handle getting a type. + + * typeck.c (build_c_cast): Re-enable warning for cast between + pointer and integer of different size. + +2000-04-10 Nathan Sidwell + + * inc/cxxabi.h (__pointer_type_info): Add restrict and + incomplete flags. + (__pointer_type_info::__pointer_catch): New virtual function. + (__pointer_to_member_type_info): Derive from + __pointer_type_info. Adjust. + (__pointer_to_member_type_info::__do_catch): Remove. + (__pointer_to_member_type_info::__is_pointer_p): Declare. + (__pointer_to_member_type_info::__pointer_catch): Declare. + * rtti.c (qualifier_flags): Add restrict flag. + (ptmd_initializer): Reorder members. + (create_tinfo_types): Expand comments. Reorder + ptmd_desc_type_node members. + * tinfo2.cc (__pointer_to_member_type_info::__is_pointer_p): + Implement. + (__pointer_type_info::__do_catch): Move specific code into + __pointer_catch. Call it. + (__pointer_type_info::__pointer_catch): Non-pointer-to-member + specific catch checking. Fix void conversion check. + (__pointer_to_member_type_info::__do_catch): Remove. + (__pointer_to_member_type_info::__pointer_catch): Implement. + +2000-04-10 Martin v. Löwis + + * lex.c (init_parse): Remove traces of classof and headof. + * decl2.c (flag_operator_names): Default to 1. + (lang_decode_option): Do not set it for -ansi. + +2000-04-09 Mark Mitchell + + * cp-tree.h (struct lang_decl): Remove main_decl_variant. + (DECL_MAIN_VARIANT): Remove. + * decl.c (duplicate_decls): Don't set it. + (start_function): Likewise. + (lang_mark_tree): Don't mark it. + * decl2.c (defer_fn): Don't use it. + * lex.c (retrofit_lang_decl): Don't set it. + * pt.c (tsubst_decl): Likewise. + * ptree.c (print_lang_decl): Don't print it. + * typeck.c (mark_addressable): Don't use it. + +2000-04-09 Nathan Sidwell + + * vec.cc: Include and . + (__cxa_vec_ctor): Use __cxa_vec_dtor for cleanup. + (__cxa_vec_dtor): Catch dtor exceptions, and rethrow or + terminate. + (__cxa_vec_delete): Catch dtor exceptions. + +2000-04-09 Nathan Sidwell + + Prepend __ to implementation defined names. + * inc/typeinfo (type_info): Rename _name to __name. + (type_info::type_info): Rename parameter. + (type_info::operator==, type_info::operator!=, + type_info::before): Likewise. + (type_info::is_pointer_p, type_info::is_function_p, + type_info::do_catch, type_info::do_upcast): Prepend __. Rename + parameters. + * inc/cxxabi.h + (__fundamental_type_info::__fundamental_type_info) Rename parameters. + (__pointer_type_info::__pointer_type_info): Likewise. + (__pointer_type_info::is_pointer_p, + __pointer_type_info::do_catch): Prepend __. Rename parameters. + (__array_type_info::__array_type_info): Rename parameters. + (__function_type_info::__function_type_info): Likewise. + (__function_type_info::is_function_p): Prepend __. + (__enum_type_info::__enum_type_info): Rename parameters. + (__pointer_to_member_type_info::__pointer_to_member_type_info): + Likewise. + (__pointer_to_member_type_info::do_catch): Prepend __. Rename + parameters. + (__base_class_info::is_virtual_p, is_public_p, offset): Prepend __. + (__class_type_info::__class_type_info): Rename parameters. + (__class_type_info::sub_kind): Prepend __. Adjust member names. + (__class_type_info::upcast_result, + __class_type_info::dyncast_result): Prepend __. Move definition + into tinfo.cc. + (__class_type_info::do_upcast, __class_type_info::do_catch, + __class_type_info::find_public_src, + __class_type_info::do_dyncast, + __class_type_info::do_find_public_src): Prepend __. Rename + parameters. + (__si_class_type_info::__si_class_type_info): Rename parameters. + (__si_class_type_info::do_upcast, __si_class_type_info::do_dyncast, + __si_class_type_info::do_find_public_src): Prepent __. Rename + parameters. + (__vmi_class_type_info::__vmi_class_type_info): Rename parameters. + (__vmi_class_type_info::do_upcast, __vmi_class_type_info::do_dyncast, + __vmi_class_type_info::do_find_public_src): Prepent __. Rename + parameters. + (__dynamic_cast): Rename parameters. + * tinfo.cc (type_info::is_pointer_p, type_info::is_function_p, + type_info::do_catch, type_info::do_upcast): Prepend __. + (contained_p, public_p, virtual_p, contained_public_p, + contained_nonpublic_p, contained_nonvirtual_p): Adjust. + (__class_type_info::do_catch, + __class_type_info::do_upcast): Prepend __. Adjust. + (__class_type_info::__upcast_result, + __class_type_info::__dyncast_result): Move from inc/cxxabi.h. + Adjust. + (__class_type_info::find_public_src): Prepend __. Adjust. + (__class_type_info::do_find_public_src, + __si_class_type_info::do_find_public_src, + __vmi_class_type_info::do_find_public_src): Likewise. + (__class_type_info::do_dyncast, + __si_class_type_info::do_dyncast, + __vmi_class_type_info::do_dyncast): Likewise. + (__class_type_info::do_upcast, + __si_class_type_info::do_upcast, + __vmi_class_type_info::do_upcast): Likewise. + (__dynamic_cast): Adjust. + * tinfo2.cc (__pointer_type_info::is_pointer_p): Prepend __. + (__function_type_info::is_function_p): Likewise. + (__pointer_type_info::do_catch): Likewise. Adjust. + (__pointer_to_member_type_info::do_catch): Likewise. Adjust. + (__throw_type_match_rtti_2): Adjust. + (__is_pointer): Adjust. + +2000-04-08 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_COMPLETE_CTOR_IDENTIFIER. + (complete_ctor_identifier): New macro. + (special_function_kind): Add sfk_copy_constructor and + sfk_assignment_operator. + (LOOKUP_HAS_IN_CHARGE): Remove. + (cons_up_default_function): Rename to ... + (implicitly_declare_fn): ... this. + * call.c (build_new_method_call): Add in-charge parameters for + constructors here. + * class.c (add_implicitly_declared_members): Change parameter name + from cant_have_assignment to cant_have_const_assignment. + Replace calls to cons_up_default_function to implicitly_declare_fn. + * cvt.c (ocp_convert): Use complete_ctor_identifier. + * decl.c (initialize_predefined_identifiers): Initialize it. + (start_function): Use DECL_CONSTRUCTOR_FOR_VBASE_P instead of + complex expression. + * init.c (expand_default_init): Don't calculate the in-charge + parameter here. + (build_new_1): Likewise. + * lex.c (cons_up_default_function): Move to method.c. + * method.c (synthesize_method): Use DECL_DESTRUCTOR_P. + (implicitly_declare_fn): New function. + * typeck.c (build_static_cast): Use complete_ctor_identifier. + (build_modify_expr): Likewise. + * typeck2.c (build_functional_cast): Likewise. + + Under the new ABI, constructors don't return `this'. + * cp-tree.h (warn_reorder): Declare. + (special_function_kind): New enum. + (global_base_init_list): Remove declaration. + (emit_base_init): Don't return a value. + (check_base_init): Don't declare. + (is_aggr_typedef): Likewise. + * decl.c (check_special_function_return_type): New function. + (return_types): Remove. + (grokdeclarator): Use check_special_function_return_type. + (start_function): Don't initialize ctor_label under the new ABI. + (finish_construtor_body): Don't create a corresponding LABEL_STMT. + * init.c (begin_init_stmts): Move to top of file. + (finish_init_stmts): Likewise. + (warn_reorder): Don't declare. + (emit_base_init): Don't create a STMT_EXPR here. Don't return a + value. + (check_base_init): Remove. + (is_aggr_typedef): Likewise. + (build_new_1): Don't use the return value of a constructor. + * semantics.c (setup_vtbl_ptr): Don't use the return value + of emit_base_init. + * typeck.c (check_return_expr): Don't magically convert return + statements into `return this' in constructors under the new ABI. + + * cp-tree.h (cp_tree_index): Add CPTI_BASE_CTOR_IDENTIFIER, + CPTI_BASE_DTOR_IDENTIFIER, and CPTI_DELETING_DTOR_IDENTIFIER. + (base_ctor_identifier): New macro. + (base_dtor_identifier): Likewise. + (deleting_dtor_identifier): Likewise. + * decl.c: Don't include obstack.h. + (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Likewise. + (struct predefined_identifier): New type. + (initialize_predefined_identifiers): New function. + (init_decl_processing): Use it. + (debug_temp_inits): Remove. + (start_method): Don't call preserve_data. + (hack_incomplete_structures): Update comment. + * init.c (init_init_processing): Don't initialize + nelts_identifier. + (build_offset_rf): Remove dead code. + (build_delete): Use CLASSTYPE_N_BASECLASSES. + * search.c (init_search_processing): Don't initialize + vptr_identifier. + +2000-04-08 Kaveh R. Ghazi + + * typeck.c (build_binary_op): Call `tree_expr_nonnegative_p' to elide + some sign_compare warnings. + +2000-04-07 Nathan Sidwell + + Rename abi::__vmi_class_type_info members. + * inc/cxxabi.h (__vmi_class_type_info): Rename details, n_bases, + base_list, detail_masks members to vmi_flags, vmi_base_count, + vmi_bases and vmi_flags_masks respectively. + (__vmi_class_type_info::vmi_flags_masks): Rename + details_unknown_mask to flags_unknown_mask. + * tinfo.cc (__class_type_info::do_upcast): Adjust. + (__vmi_class_type_info::do_find_public_src): Adjust. + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Adjust. + +2000-04-07 Nathan Sidwell + + * tinfo.cc (convert_to_base): New function. + (get_vbase_offset): Remove. Move into convert_to_base. + (__vmi_class_type_info::do_find_public_src): Adjust. + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Adjust. + +2000-04-06 Jason Merrill + + * tinfo.cc (operator=): Use __builtin_strcmp. + * tinfo2.cc (before): Likewise. + +2000-04-06 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Rename saved_inline to deferred. + (DECL_SAVED_INLINE): Rename to ... + (DECL_DEFERRED_FN): ... this. + (in_function_p): Remove declaration. + (mark_inline_for_output): Rename to ... + (defer_fn): ... this. + * decl.c (finish_function): Adjust call to mark_inline_for_output. + (in_function_p): Remove definition. + * decl2.c (saved_inlines): Rename to ... + (deferred_fns): ... this. + (saved_inlines_used): Rename to ... + (deferred_fns_used): ... this. + (mark_inline_for_output): Rename to ... + (defer_fn): ... this. + (finish_file): Adjust accordingly. + (init_decl2): Likewise. + * lex.c (cons_up_default_function): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + (instantiate_decl): Don't set DECL_DEFER_OUTPUT under any + circumstances. + * rtti.c (get_tinfo_decl): Adjust call to mark_inline_for_output. + * semantics.c (expand_body): Defer more functions. + +2000-04-06 Nathan Sidwell + + * vec.cc: New file. + * Make-lang.in (CXX_LIB2FUNCS): Add it. + (vec.o): Build it. + * inc/cxxabi.h (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Declare. + +2000-04-06 Nathan Sidwell + + * rtti.c (dfs_class_hint_mark): New static function. + (dfs_class_hint_unmark): New static function. + (class_hint_flags): Use them. + +2000-04-05 Benjamin Kosnik + + * decl2.c: Make flag_honor_std dependent on ENABLE_STD_NAMESPACE. + +2000-04-05 Mark Mitchell + + * cp-tree.h (instantiate_decl): Change prototype. + * decl2.c (mark_used): Adjust call. + * optimize.c (inlinable_function_p): Adjust handling of templates. + * pt.c (do_decl_instantiation): Adjust call to instantiate_decl. + (do_type_instantiation): Likewise. + (instantiate_decl): Defer more templates. + (instantiate_pending_templates): Adjust logic to handle inline + friend functions. + + * Makefile.in (GGC_H): New variable. Use it throughout in place + of ggc.h. + + * call.c: Don't include obstack.h. Include ggc.h. + (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Likewise. + (add_candidate): Allocate the z_candidate with ggc_alloc_obj. + * decl.c (push_switch): Use xmalloc to allocate the cp_switch. + (pop_switch): Free it. + + * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs. + + * dump.c (dequeue_and_dump): Don't try to print the bit_position + if we don't have a DECL_FIELD_OFFSET. + +Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka + + * optimize.c (calls_setjmp_r): Use setjmp_call_p instead of + special_function_p. + +2000-04-04 Kaveh R. Ghazi + + * cfns.gperf (hash, libc_name_p): Prototype. + + * rtti.c (build_dynamic_cast_1): Constification. + + * search.c (dfs_debug_unmarkedp, dfs_debug_mark): Unhide prototypes. + + * semantics.c (deferred_type_access_control): Prototype. + +2000-04-04 Mark Mitchell + + Correct many new ABI issues regarding vbase and vcall offset + layout. + * cp-tree.h (BINFO_VTABLE): Document. + (struct lang_type): Tweak formatting. + (BINFO_PRIMARY_BINFO): Add to documentation. + (CLASSTYPE_VSIZE): Fix typo in comment. + (CLASSTYPE_VBASECLASSES): Update documentation. + (BINFO_VBASE_MARKED): Remove. + (SET_BINFO_VBASE_MARKED): Likewise. + (CLEAR_BINFO_VBASE_MARKED): Likewise. + (BINFO_FIELDS_MARKED): Remove. + (SET_BINFO_FIELDS_MARKED): Likewise. + (CLEAR_BINFO_FIELDS_MARKED): Likewise. + (enum access_kind): New enumeration. + (num_extra_vtbl_entries): Remove declaration. + (size_extra_vtbl_entries): Likewise. + (get_vtbl_decl_for_binfo): New function. + (dfs_vbase_unmark): Remove declaration. + (mark_primary_bases): Likewise. + * class.c (SAME_FN): Remove. + (struct vcall_offset_data_s): Move definition. + (build_vbase_pointer): Use `build', not `build_binary_op', to + access the vbase pointer under the new ABI. + (build_vtable_entry_ref): Use get_vtbl_decl_for_binfo. + (build_primary_vtable): Likewise. + (dfs_mark_primary_bases): Move here from search.c. + (mark_primary_bases): Likewise. + (determine_primary_bases): Under the new ABI, don't make a base + class a primary base just because we don't yet have any virtual + functions. + (layout_vtable_decl): Use get_vtbl_decl_for_binfo. + (num_vfun_entries): Remove. + (dfs_count_virtuals): Likewise. + (num_extra_vtbl_entries): Likewise. + (size_extra_vtbl_entries): Likewise. + (layout_virtual_bases): Iterate in inheritance graph order under + the new ABI. + (finish_struct_1): Use TYPE_VFIELD, not CLASSTYPE_VSIZE, to + indicate that a vfield is present. + (init_class_processing): Initialize access_public_node, etc., from + ak_public, etc. + (get_vtbl_decl_for_binfo): New function. + (dump_class_hierarchy_r): Likewise. + (dump_class_hierarchy): Use it. + (finish_vtbls): Build the vtbls in inheritance graph order. + (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. + (initialize_vtable): Use get_vtbl_decl_for_binfo. + (accumulate_vtbl_inits): Add comments explaining why a pre-order + walk is required. + (dfs_accumulate_vtbl_inits): Set BINFO_VTABLE to the location + where the vptr points, even for primary vtables. + (build_vtbl_initializer): Adjust handling of vbase and vcall + offsets. + (build_vcall_and_vbase_vtable_entries): New function. + (dfs_build_vbase_offset_vtbl_entries): Remove. + (build_vbase_offset_vtbl_entries): Reimplement. + (dfs_build_vcall_offset_vtbl_entries): Don't include virtuals that + were already handled in a primary base class vtable. + (build_vcall_offset_vtbl_entries): Adjust. + (build_rtti_vtbl_entries): Adjust. + * decl2.c (output_vtable_inherit): Use get_vtbl_decl_for_binfo. + * init.c (expand_virtual_init): Simplify. + * repo.c (repo_get_id): Use get_vtbl_decl_for_binfo. + * rtti.c (create_pseudo_type_info): Adjust calculation of vptr. + * search.c (BINFO_ACCESS): New macro. + (SET_BINFO_ACCESS): Likewise. + (dfs_access_in_type): Manipulate access_kinds, not access nodes. + (access_in_type): Likewise. + (dfs_accessible_p): Likewise. + (protected_accessible_p): Likewise. + (lookup_fnfields_1): Adjust documentation. + (dfs_mark_primary_bases): Move to class.c + (mark_primary_bases): Likewise. + (dfs_vbase_unmark): Remove. + (virtual_context): Use BINFO_FOR_VBASE. + (dfs_get_vbase_types): Simplify. + (dfs_build_inheritance_graph_order): New function. + (get_vbase_types): Use it. + * tree.c (debug_binfo): Use get_vtbl_decl_for_binfo. + + * tinfo.cc (get_vbase_offset): New function. + (__vmi_class_type_info::do_find_public_src): Use it. + (__vmi_class_type_info::do_dyncast): Likewise. + (__vmi_class_type_info::do_upcast): Likewise. + +2000-04-03 Zack Weinberg + + * lang-specs.h: Pass -fno-show-column to the preprocessor. + +2000-03-30 Nathan Sidwell + + * rtti.c (class_hint_flags): Rename flags. + (class_initializer): Remove flags. + (synthesize_tinfo_var): Combine offset and flags. Add flags + for __vmi_class_type_info. + (create_tinfo_types): Remove flags from __class_type_info and + __si_class_type_info. Merge flags and offset from + base_class_type_info. + * inc/cxxabi.h (__base_class_info): Merge offset and vmi_flags. + (__base_class_info::is_virtual_p): Adjust. + (__base_class_info::is_public_p): Adjust. + (__base_class_info::offset): New accessor. + (__class_type_info::details): Remove member. + (__class_type_info::__class_type_info): Lose details. + (__class_type_info::detail_masks): Remove. + (__si_class_type_info::__si_class_type_info): Lose details. + (__vmi_class_type_info::details): New member. + (__vmi_class_type_info::__vmi_class_type_info): Adjust. + (__vmi_class_type_info::detail_masks): New member. + * tinfo.cc (__class_type_info::do_upcast): Initialize result + with unknown_details_mask. + (__vmi_class_type_info::do_find_public_src): Adjust + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Set result details, if + needed. Adjust. + (__dynamic_cast): Temporarily #if out optimization. + +2000-03-29 Nathan Sidwell + + * rtti.c (get_tinfo_decl): Mark used. + (emit_tinfo_decl): Don't optimize polymorphic type_info. Only + mark as dealt with, if we output it. + +2000-03-28 Mark Mitchell + + * class.c: Reorganize to put virtual function table initialization + machinery at the end of the file. + +2000-03-28 Jason Merrill + + * class.c (finish_struct): Use bitsize_zero_node. + * pt.c (instantiate_class_template): Likewise. + +2000-03-28 Mark Mitchell + + Put RTTI entries at negative offsets in new ABI. + * class.c (dfs_build_vbase_offset_vtbl_entries): Put the first + vbase offset at index -3, not -1. + (build_vtabe_offset_vtbl_entries): Use unmarked_vtable_pathp, not + dfs_vtable_path_unmarked_real_bases_queue_p to walk bases. + (dfs_build_vcall_offset_vtbl_entries): Don't use skip_rtti_stuff. + (build_rtti_vtbl_entries): New function. + (set_rtti_entry): Remove. + (build_primary_vtable): Don't use it. + (build_secondary_vtable): Likewise. + (start_vtable): Remove. + (first_vfun_index): New function. + (set_vindex): Likewise. + (add_virtual_function): Don't call start_vtable. Do call + set_vindex. + (set_primary_base): Rename parameter. + (determine_primary_base): Likewise. + (num_vfun_entries): Don't use skip_rtti_stuff. + (num_extra_vtbl_entries): Include RTTI information. + (build_vtbl_initializer): Use build_rtti_vtbl_entries. + (skip_rtti_stuff): Remove. + (dfs_modify_vtables): Don't use it. + (modify_all_vtables): Don't use start_vtable. Do use set_vindex. + (layout_nonempty_base_or_field): Update size handling. + (create_vtable_ptr): Tweak. + (layout_class_type): Adjust parameter names. + (finish_struct_1): Simplify. + * cp-tree.h (CLASSTYPE_VSIZE): Tweak documentation. + (skip_rtti_stuff): Remove. + (first_vfun_index): New function. + (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. + (dfs_vtable_path_marked_real_bases_queue_p): Remove. + (marked_vtable_pathp): Declare. + (unmarked_vtable_pathp): Likewise. + * error.c (dump_expr): Use first_vfun_index to calculate vtable + offsets. + * rtti.c (build_headof): Look for RTTI at negative offsets. + (get_tinfo_decl_dynamic): Likewise. + (tinfo_base_init): Don't take the address of the TINFO_VTABLE_DECL + here. + (create_pseudo_type_info): Do it here instead. Adjust so that + vptr points at first virtual function. + * search.c (marked_vtable_pathp): Make it global. + (unmarked_vtable_pathp): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. + (dfs_vtable_path_marked_real_bases_queue_p): Likewise. + (dfs_get_pure_virtuals): Don't use skip_rtti_stuff. + (get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + * tinfo.cc (__dynamic_cast): Look for vtable_prefix at appropriate + negative offset. + +2000-03-26 Richard Kenner + + * class.c (check_field_decl): Fix typo. + (build_vtbl_or_vbase_field): Don't clear DECL_SAVED_INSNS. + (check_methods): Likewise. + (check_field_decls): Likewise. + Use DECL_CONTEXT, not DECL_FIELD_CONTEXT. + * cp-tree.h (DECL_SHADOWED_FOR_VAR, DECL_TEMPLATE_RESULT): + Use DECL_RESULT_FLD, not DECL_RESULT. + * decl.c (xref_tag): Use DECL_TEMPLATE_RESULT. + * lex.c (identifier_type): Likewise. + * pt.c (determine_specialization, lookup_template_class): Likewise. + (tsubst_friend_function, tsubst_decl, instantiate_template): Likewise. + (resolve_overloaded_unification, more_specialized): Likewise. + * semantics.c (finish_member_declaration): Likewise. + * typeck.c (build_x_function_call): Likewise. + +2000-03-26 Mark Mitchell + + * class.c (layout_empty_base): Handle empty bases with non-byte + alignment. + (build_base_field): Likewise. + (layout_virtual_bases): Likewise. + + * class.c (finish_struct_1): Fix typo in this change: + + Sat Mar 25 09:12:10 2000 Richard Kenner + +2000-03-25 Mark Mitchell + + * decl.c (grokdeclarator): Count partial specializations when + keeping track of how many template classes have been seen. + + * dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT. + +2000-03-25 Richard Kenner + + * class.c (build_vbase_pointer_fields): layout_field now place_field. + (get_vfield_offset): Use byte_position. + (set_rtti_entry): Set OFFSET to ssizetype zero. + (get_binfo_offset_as_int): Deleted. + (dfs_record_base_offsets): Use tree_low_cst. + (dfs_search_base_offsets): Likewise. + (layout_nonempty_base_or_field): Reflect changes in RLI format + and call byte_position. + (layout_empty_base): Convert offset to ssizetype. + (build_base_field): use rli_size_unit_so_far. + (dfs_propagate_binfo_offsets): Do computation in proper type. + (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. + (layout_class_type): Reflect changes in RLI names and fields. + (finish_struct_1): Set DECL_FIELD_OFFSET. + * dump.c (dequeue_and_dump): Call bit_position. + * expr.c (cplus_expand_constant): Use byte_position. + * rtti.c (expand_class_desc): Use bitsize_one_node. + * typeck.c (build_component_addr): Use byte_position and don't + special case for zero offset. + +2000-03-24 Nathan Sidwell + + * decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P. + + * rtti.c (get_tinfo_decl): Set comdat linkage on new-abi + tinfo object. + (emit_tinfo_decl): Only emit polymorphic tinfo's when emitting + vtable. + +2000-03-20 Theodore Papadopoulo + + * call.c (check_dtor_name, build_new_method_call): Use TYPE_P and + DECL_P macros. + * decl.c (push_class_binding, poplevel, pushtag, lookup_namespace_name, + make_typename_type, check_initializer, cp_finish_decl, + xref_tag): Likewise. + * decl2.c (grokfield, build_expr_from_tree, build_expr_from_tree, + decl_namespace, arg_assoc_template_arg, arg_assoc, + validate_nonmember_using_decl, do_class_using_decl): Likewise. + * error.c (dump_template_argument, dump_expr, cp_file_of, cp_line_of, + args_to_string): Likewise. + * friend.c (is_friend): Likewise. + * lex.c (note_got_semicolon, note_list_got_semicolon, + is_global): Likewise. + * method.c (build_overload_nested_name, build_overload_value, + build_qualified_name, build_qualified_name, hack_identifier): Likewise. + * parse.y (typename_sub, typename_sub1): Likewise. + * pt.c (push_inline_template_parms_recursive, check_template_shadow, + process_partial_specialization, convert_template_argument, + template_args_equal, add_pending_template, lookup_template_class, + for_each_template_parm_r, maybe_fold_nontype_arg, + tsubst, instantiate_template, type_unification_real, unify, + instantiate_pending_templates, set_mangled_name_for_template_decl): + Likewise. + * repo.c (repo_get_id, repo_template_used): Likewise. + * search.c (lookup_field_1): Likewise. + * tree.c (walk_tree, get_type_decl, cp_tree_equal, member_p): Likewise. + * xref.c (classname): Likewise. + +2000-03-22 Mark Mitchell + + * cp-tree.h (BINFO_FOR_VBASE): Adjust documentation. + (CANONICAL_BINFO): New macro. + (BINFO_NEW_VTABLE_MARKED): Use it. + (SET_BINFO_NEW_VTABLE_MARKED): Likewise. + (CLEAR_BINFO_NEW_VTABLE_MARKED): Likewise. + * class.c (dfs_build_vbase_offset_vtbl_entries): Use BINFO_TYPE, + not TREE_TYPE. + (build_primary_vtable): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (build_secondary_vtable): Likewise. + (dfs_finish_vtbls): Likewise. + (dfs_accumulate_vtbl_inits): Likewise. + (accumulate_vtbl_inits): New function. + (finish_vtbls): Make sure that virtual bases come after + non-virtual bases in the vtable group. + (record_base_offsets): Don't save and restore TREE_VIA_VIRTUAL. + (finish_struct_1): Adjust usage of BINFO_NEW_VTABLE_MARKED. + * search.c (struct vbase_info): Move definition. + (marked_new_vtable_p): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (unmarked_new_vtable_p): Likewise. + (dfs_mark_vtable_path): Remove. + (dfs_mark_new_vtable): Remove. + (dfs_unmark_new_vtable): Likewise. + (dfs_clear_search_slot): Likewise. + (dfs_find_vbases): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (dfs_clear_vbase_slots): Likewise. + (init_vbase_pointers): LIkewise. + +2000-03-22 Jason Merrill + + * typeck.c (type_after_usual_arithmetic_conversions): Prefer a + SIZETYPE to a non-SIZETYPE. + +2000-03-21 Mark Mitchell + + * class.c (layout_virtual_bases): Adjust names in conditionally + compiled code. + + * class.c (record_base_offsets): New function. + (layout_conflict_p): Likewise. + (layout_nonempty_base_or_field): Use it. + (layout_empty_base): New function. + (build_base_field): Use it. + (build_base_fields): Update comment. + (layout_virtual_bases): Fold in a little code form + layout_basetypes. Use layout_empty_base. + (layout_basetypes): Remove. + (end_of_class): New function. + (layout_class_type): Use it. Adjust. + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Fix typo in comment. + (fntype_p): Remove. + * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Fix typo in + comment. + (dfs_skip_nonprimary_vbases_markedp): Likewise. + * typeck.c (fntype_p): Remove. + + * cp-tree.h (TI_SPEC_INFO): Remove. + (CLASSTYPE_TI_SPEC_INFO): Likewise. + * pt.c (process_partial_specialization): Likewise. + + * class.c (build_base_field): Fix thinko in computation of binfo + offsets. + + * tree.c (mark_local_for_remap_p): Mark variables declared in + TARGET_EXPRs as well. + +2000-03-21 Nathan Sidwell + + * typeck.c (require_complete_type, complete_type, + complete_type_or_else, c_sizeof, c_sizeof_nowarn, + build_array_ref, convert_arguments, pointer_diff, + build_x_unary_op, build_unary_op, build_c_cast, + build_modify_expr): Use COMPLETE_TYPE_P etc. + * call.c (is_complete, convert_like_real, + build_new_method_call): Likewise. + * class.c (build_vbase_pointer_fields, check_bases, + build_base_field, finish_struct_1, pushclass): Likewise. + * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. + * decl.c (maybe_process_template_type_declaration, pushtag, + pushdecl, redeclaration_error_message, start_decl, start_decl_1, + layout_var_decl, check_initializer, cp_finish_decl, + grokdeclarator, require_complete_types_for_parms, + grok_op_properties, xref_tag, xref_basetypes, + check_function_type): Likewise. + * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_offset_ref): Likewise. + * parse.y (structsp): Likewise. + * pt.c (maybe_process_partial_specialization, + tsubst_friend_function, instantiate_class_template, tsubst, + do_type_instantiation, instantiate_pending_templates): Likewise. + * repo.c (repo_get_id): Likewise. + * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, + synthesize_tinfo_var, emit_support_tinfos): Likewise. + * search.c (lookup_fnfields_1, lookup_conversions): Likewise. + * semantics.c (begin_class_definition): Likewise. + * tree.c (build_cplus_method_type): Likewise. + * typeck2.c (digest_init, build_functional_cast, + add_exception_specifier): Likewise. + * parse.h, parse.c: Regenerated. + +2000-03-21 Nathan Sidwell + + * inc/cxxabi.h: New header file. Define new-abi entry points. + (__pointer_type_info::target): Rename member to ... + (__pointer_type_info::type): ... here. + (__base_class_info::type): Rename member to ... + (__base_class_info::base): ... here. + * Make-lang.in (CXX_EXTRA_HEADERS): Add cxxabi.h + * cp-tree.h (CPTI_ABI): New global tree enumeration. + (abi_node): New global tree node. + * decl.c (abi_node): Document. + (init_decl_processing): Initialize abi_node. + * rtti.c (build_dynamic_cast_1): Use abi_node for new-abi. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + (emit_support_tinfos): Likewise. + * tinfo.h (cxxabi.h): Include for new-abi. + Move rtti class definitions to new header file. + * tinfo.cc (abi): Use the namespace. + (std): Move new abi rtti classes from here ... + (__cxxabiv1): ... to here. + * tinfo2.cc (cxxabi.h): Include for new-abi. + Move rtti class definitions to new header file. + (std): Move new abi rtti classes from here ... + (__cxxabiv1): ... to here. + * inc/typeinfo (__class_type_info): Move into __cxxabiv1 + namespace. + +2000-03-20 Jed Wing + Jason Merrill + + * method.c (build_overload_int): Use host_integerp. + +2000-03-20 Theodore Papadopoulo + + * init.c (build_offset_ref): Handle the case of a templated member + function. + +2000-03-19 Martin v. Löwis + + * except.c (expand_exception_blocks): Clear catch_clauses_last. + +2000-03-18 Mark Mitchell + + * cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro. + * class.c (check_bitfield_decl): Turn illegal bitfields into + non-bitfields. + (dfs_propagate_binfo_offsets): Adjust for new size_binop + semantics. + (dfs_offset_for_unshared_vbases): Likewise. + * cvt.c (cp_convert_to_pointer): Convert NULL to a + pointer-to-member correctly under the new ABI. + * expr.c (cplus_expand_constant): Don't use cp_convert when + turning an offset into a pointer-to-member. + * init.c (resolve_offset_ref): Don't adjust pointers-to-members + when dereferencing them under the new ABI. + * typeck.c (get_member_function_from_ptrfunc): Tweak calculation + of pointers-to-members under the new ABI. + + * class.c (check_bitfield_decl): Remove restriction on really long + bitfields. + (layout_class_type): Implement new ABI handling of bitfields + longer than their types. + +2000-03-18 Martin v. Löwis + + * parse.y (extdefs): Call ggc_collect. + * parse.c: Regenerated. + +2000-03-18 Nathan Sidwell + + * class.c (build_base_field): Use TYPE_ALIGN to examine a type. + (note_name_declared_in_class): Use OVL_CURRENT to get at a + potential overload. + +2000-03-17 Richard Kenner + + * class.c (build_vbase_path): Use integer_zerop. + (build_vtable_entry): Use tree_low_cst. + (get_vfield_offset): Use bit_position. + (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. + Use tree_low_cst. + (check_bitfield_decl): Set DECL_SIZE using convert. + (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. + (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. + Use tree_low_cst. + (finish_struct_1): Use bit_position. + (dump_class_hierarchy): Use tree_low_cst. + * cp-tree.h (min_precision): Add declaration. + * decl.c (xref_tag, xref_basetypes): Use tree_low_cst. + * error.c (dump_type_suffix): Use host_integerp and tree_low_cst. + (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. + * expr.c (cplus_expand_constant): Use bit_position. + * init.c (build_vec_init): Use host_integerp and tree_low_cst. + * rtti.c (get_base_offset): Use bit_position. + * typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, + host_integerp, and tree_low_cst. + (pointer_int_sum): Use integer_zerop. + (build_component_addr): Use bit_position. + +2000-03-17 Nathan Sidwell + + * typeck.c (require_complete_type): Don't assume size_zero_node. + (complete_type_or_else): Likewise. + +2000-03-16 Steven Grady + Jason Merrill + + * rtti.c (build_dynamic_cast_1): Improve diagnostics. + +2000-03-16 Nathan Sidwell + + * decl2.c (grokfield): Bail out if type is error_mark_node. + +2000-03-15 Nathan Sidwell + + * tinfo2.cc (__ptr_to_member_data): Rename to ... + (__pointer_to_member_data): ... here. Adjust. + * rtti.c (create_tinfo_types): Adjust. + +2000-03-15 Nathan Sidwell + + * cp-tree.h (CPTI_REF_DESC_TYPE, ref_desc_type_node): Remove. + * decl.c (ref_desc_type_node): Undocument. + * rtti.c (ptr_ref_initializer): Rename to ... + (ptr_initializer): ... here. Adjust comments. + (ptmd_initializer): Fix comment thinko. + (synthesize_tinfo_var): Remove REFERENCE_TYPE case. + (create_tinfo_types): Remove ref_desc_type_node init. + * tinfo2.cc (__reference_type_info): Remove. + +2000-03-15 Nathan Sidwell + + * decl.c (cp_finish_decl): Remove obsolete comment. + + * typeck.c (build_ptrmemfunc1): Kill uninitialized warning. + +2000-03-14 Mark Mitchell + + * cp-tree.h: Tweak documentation. + * class.c (build_vbase_pointer_fields): Layout the fields, too. + (avoid_overlap): Remove. + (get_binfo_offset_as_int): New function. + (dfs_serach_base_offsets): Likewise. + (layout_nonempty_base_or_field): Likewise. + (build_base_field): Layout fields here. Avoid placing two objects + of the same type at the same address, under the new ABI. + (build_base_fields): Adjust accordingly. + (create_vtable_ptr): Return the new field, but don't attach it to + TYPE_FIELDS. + (remove_base_field): Remove. + (remove_base_fields): Remove. + (layout_basetypes): Adjust accordingly. + (layout_class_type): Call layout_field for each field, rather than + just making a wholesale call to layout_type. + +2000-03-14 Jeff Sturm + + * except.c (expand_throw): Fix typo in _Jv_Sjlj_Throw. + +2000-03-13 Jason Merrill + + * decl.c (grokfndecl): Set TREE_NOTHROW if TYPE_NOTHROW_P. + + * except.c (dtor_nothrow): New fn. + (do_pop_exception): Use it. Take type parm. + (push_eh_cleanup): Take type parm. + (expand_start_catch_block): Pass it. + (build_eh_type_type_ref): Accept null type. + +2000-03-12 Mark Mitchell + + * cp-tree.h (revert_static_member_fn): Change prototype. + * decl.c (grokfndecl): Adjust call to revert_static_member_fn. + (grok_op_properties): Likewise. + (start_function): Likewise. + (revert_static_member_fn): Simplify. + * pt.c (check_explicit_specialization): Adjust call to + revert_static_member_fn. + +2000-03-11 Mark Mitchell + + * cp-tree.h (scope_kind): New type. + (tmpl_spec_kind): Likewise. + (declare_pseudo_global_level): Remove. + (pseudo_global_level_p): Rename to template_parm_scope_p. + (pushlevel): Remove declaration. + (begin_scope): New function. + (finish_scope): Likewise. + (current_tmpl_spec_kind): Likewise. + * decl.c (struct binding_level): Shorten parm_flag to 2 bits. + Shorten keep to 2 bits. Rename pseudo_global to template_parms_p. + Add template_spec_p. + (toplevel_bindings_p): Adjust. + (declare_pseudo_global_level): Remove. + (pseudo_global_level_p): Rename to template_parm_scope_p. + (current_tmpl_spec_kind): New function. + (begin_scope): Likewise. + (finish_scope): Likewise. + (maybe_push_to_top_level): Adjust. + (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + (pushdecl_nonclass_level): Likewise. + (lookup_tag): Likewise. + (grokfndecl): Handle member template specializations. Share + constructor and non-constructor code. + * decl2.c (check_classfn): Handle member template specializations. + * pt.c (begin_template_parm_list): Use begin_scope. + (begin_specialization): Likewise. + (end_specialization): Likewise. + (check_explicit_specialization): Use current_tmpl_spec_kind. + Handle member template specializations. + (end_template_decl): Use finish_scope. Remove call to + get_pending_sizes. + (push_template_decl_real): Remove bogus error message. + (tsubst_decl): Fix typo in code contained in comment. + (instantiate_template): Handle member template specializations. + (most_general_template): Likewise. + +2000-03-11 Gabriel Dos Reis + + * lex.c (whitespace_cr): Compress consecutive calls to warning(). + (do_identifier): Ditto for error(). + + * pt.c (convert_nontype_argument): Ditto for cp_error(). + (convert_template_argument): Ditto for cp_pedwarn(). + +2000-03-11 Jason Merrill + + * exception.cc (__check_null_eh_spec): New fn. + * except.c (expand_end_eh_spec): Call it if the spec is throw(). + +2000-03-10 Jason Merrill + + * decl.c (push_throw_library_fn): Take the FUNCTION_TYPE. + * except.c (expand_end_eh_spec): Add the return type. + * rtti.c (throw_bad_cast): Add the parmtypes. + (throw_bad_typeid): Likewise. + + * semantics.c (expand_stmt): Only leave out rtl for unused + artificials, and set DECL_IGNORED_P on them as well. + * decl.c (wrapup_globals_for_namespace): Likewise. + +2000-03-09 Nathan Sidwell + + * decl.c (maybe_commonize_var): Skip all artificial decls. + * pt.c (tsubst_decl): Don't copy TREE_ASM_WRITTEN. + +2000-03-10 Jason Merrill + + * lang-options.h, decl2.c: Add -fno-enforce-eh-specs. + * cp-tree.h: Declare flag_enforce_eh_specs. + * decl.c (store_parm_decls, finish_function): Check it. + + C library functions don't throw. + * Makefile.in (cfns.h): New target. + (except.o): Depend on it. + * Make-lang.in (cc1plus): Depend on cfns.gperf. + * cfns.gperf: New file. + * cfns.h: Generated. + * except.c: Include it. + (nothrow_libfn_p): New fn. + * decl.c (grokfndecl): Use it. + * cp-tree.h: Declare it. + + * decl.c (push_overloaded_decl_1, auto_function, + define_function): Lose. + (build_library_fn_1): New static fn. + (builtin_function): Use it. + (get_atexit_node): Use build_library_fn_ptr. + (build_library_fn, build_cp_library_fn, build_library_fn_ptr, + build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn, + push_void_library_fn, push_throw_library_fn): New fns. + * cp-tree.h: Declare them. + (cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID. + (throw_bad_cast_node, throw_bad_typeid_node): Lose. + * except.c (init_exception_processing, call_eh_info, do_pop_exception, + (expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns. + * rtti.c (build_runtime_decl): Lose. + (throw_bad_cast, throw_bad_typeid, get_tinfo_decl, + build_dynamic_cast_1, expand_si_desc, expand_class_desc, + expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns. + + * call.c (build_call): Remove result_type parm. + Call mark_used on unused artificial fns. + * init.c, method.c, typeck.c, except.c, rtti.c: Adjust. + +2000-03-09 Jason Merrill + + * call.c (build_call): Set TREE_NOTHROW on the CALL_EXPR as + appropriate. + * decl.c (define_function): Set TREE_NOTHROW on the FUNCTION_DECL. + * except.c (call_eh_info, alloc_eh_object, expand_throw): Set + TREE_NOTHROW or TREE_THIS_VOLATILE on the function as appropriate. + * rtti.c (build_runtime_decl, get_tinfo_decl, build_dynamic_cast_1, + expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, + expand_generic_desc): Likewise. + +2000-03-08 Nathan Sidwell + + * exception.cc (__cp_pop_exception): Cleanup the original object. + +2000-03-08 Nathan Sidwell + + * decl.c (grok_op_properties): Merge conversion to void warning + with other silly op warnings. + +2000-03-08 Jason Merrill + + * typeck2.c (process_init_constructor): Set TREE_PURPOSE of + array CONSTRUCTOR elements. Don't use expr_tree_cons. + +2000-03-08 Nathan Sidwell + + * decl.c (cp_make_fname_decl): New function. + (wrapup_globals_for_namespace): Don't emit unused static vars. + (init_decl_processing): Remove comment about use of + array_domain_type. Set make_fname_decl. + (cp_finish_decl): Remove __FUNCTION__ nadgering. + * semantics.c (begin_compound_stmt): Remove + current_function_name_declared flagging. + (expand_stmt): Don't emit unused local statics. + * typeck.c (decay_conversion): Don't treat __FUNCTION__ decls + specially. + +2000-03-08 Nathan Sidwell + + * typeck.c (convert_for_assignment): Don't look at array + initializer. + * call.c (convert_like_real): Likewise. + +2000-03-07 Jason Merrill + + Add initial support for '\uNNNN' specifier. + * lex.c (read_ucs): New fn. + (readescape, skip_white_space): Call it. + (is_extended_char, is_extended_char_1): New fns. + (utf8_extend_token): New fn, #if 0'd out. + (real_yylex): Treat extended chars like letters. + + * search.c (note_debug_info_needed): Walk the bases even if we + weren't deferring the type itself. + +2000-03-07 Kaveh R. Ghazi + + * decl2.c (finish_objects): Constify a char*. + + * method.c (emit_thunk): Likewise. + +2000-03-06 Nathan Sidwell + + * typeck.c (dubious_conversion_warnings): Look through + REFERENCE_TYPE. + +2000-03-06 Richard Kenner + + * class.c (dfs_modify_vtables): I is now unsigned. + (check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int. + (build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT. + * error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned. + * init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. + * method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned. + * typeck.c (build_binary_op, case TRUNC_DIV_EXPR): + Call integer_all_onesp. + * typeck2.c (process_init_constructor): Use compare_tree_int. + + * lang-specs.h (as): Don't call if -syntax-only. + +2000-03-06 Mark Mitchell + + * expr.c (cplus_expand_expr, case STMT_EXPR): Don't set + RTL_EXPR_HAS_NO_SCOPE after all. + +2000-03-05 Mark Mitchell + + * expr.c (cplus_expand_expr, case STMT_EXPR): Use + expand_start_stmt_expr and expand_end_stmt_expr directly. Set + RTL_EXPR_HAS_NO_SCOPE. + + * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG a little + later. + + * dump.c (dequeue_and_dump): Dump SCOPE_NO_CLEANUPS_P. + +2000-03-05 Nathan Sidwell + + * call.c (convert_like): Macrofy. + (convert_like_with_context): New macro. + (convert_like_real): Renamed from convert_like. Add calling + context parameters, for diagnostics. Add recursive flag. Call + dubious_conversion_warnings for outer conversion. + (build_user_type_conversion): Use convert_like_with_context. + (build_over_call): Likewise. Don't warn about dubious + conversions here. Adjust convert_default_arg calls. + (convert_default_arg): Add context parameters for diagnostics. + Pass through to convert_like_with_context. + * cp-tree.h (convert_default_arg): Add context parameters. + (dubious_conversion_warnings): Prototype new function. + * typeck.c (convert_arguments): Adjust convert_default_arg call. + (dubious_conversion_warnings): New function, broken + out of convert_for_assignment. + (convert_for_assignment): Adjust. + +2000-03-03 Jason Merrill + + * decl2.c (key_method): Break out from... + (import_export_vtable, import_export_class): ...here. + + * decl.c (finish_function): Don't mess with flag_keep_inline_functions. + * decl2.c (finish_vtable_vardecl): Don't check decl_function_context. + + * search.c (note_debug_info_needed, dfs_debug_mark, + dfs_debug_unmarkedp): Uncomment. Adjust for new scheme. + * decl2.c (finish_vtable_vardecl): Call note_debug_info_needed. + +2000-03-03 Nathan Sidwell + + * decl.c (cp_finish_decl): Remove obsolete obstack comments, fix + typos. + +2000-03-02 Mark Mitchell + + * cp-tree.h (TYPE_NEEDS_DESTRUCTOR): Rename to ... + (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): ... this. + (TYPE_HAS_TRIVIAL_DESTRUCTOR): New macro. + (lang_type): Split gets_new into has_new and has_array_new. + (TYPE_VEC_NEW_USES_COOKIE): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (TYPE_GETS_NEW): Split into ... + (TYPE_HAS_NEW_OPERATOR): ... this, and ... + (TYPE_HAS_ARRAY_NEW_OPERATOR): ... this. + (DECL_ARRAY_DELETE_OPERATOR_P): New macro + (build_op_new_call): Don't declare. + (build_new_1): Likewise. + * call.c (build_op_new_call): Remove. + * class.c (check_bases): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR + instead of TYPE_NEEDS_DESTRUCTOR. + (finish_struct_bits): Likewise. + (add_implicitly_declared_members): Likewise. + (check_field_decl): Likewise. + (check_methods): Set TYPE_VEC_DELETE_TAKES_SIZE here, and set it + correctly under the new ABI. + * decl.c (start_decl_1): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR + instead of TYPE_NEEDS_DESTRUCTOR. + (initialize_local_var): Likewise. + (destroy_local_var): Likewise. + (cp_finish_decl): Likewise. + (register_dtor_fn): Likewise. + (grok_op_properties): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. Don't set + TYPE_VEC_DELETE_TAKES_SIZE here. + (xref_basetypes): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. + (store_parm_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. + * decl2.c (do_static_destruction): Likewise. + * init.c (build_new_1): Make it static. + (perform_member_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (expand_cleanup_for_base): Likewise. + (get_cookie_size): New function. + (build_new_1): Handle array-new cookies correctly under the new + ABI. + (build_vec_delete_1): Likewise. + (build_vec_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (build_delete): Likewise. + (build_vec_delete): Handle array-new cookies correctly under the new + ABI. + * lex.c (do_identifier): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + * pt.c (instantiate_class_template): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR. + * ptree.c (print_lang_type): Check them. + * search.c (context_for_name_lookup): Fix typo in comment. + (tree_has_any_destructor_p): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + * tree.c (break_out_cleanups): Likewise. + (build_cplus_array_test_1): Likewise. + (cp_build_qualified_type_real): Likewise. + * typeck.c (complete_type): Likewise. + + * g++spec.c (lang_specific_driver): Add -fnew-abi at the start of + the command-line, not the end. + +2000-03-01 Jason Merrill + + * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG. + +2000-03-02 Tom Tromey + + * cp-tree.h (build_java_class_ref): Declare. + * init.c (build_java_class_ref): No longer static. + * except.c (expand_throw): Generate a Java-style `throw' if the + thrown object is a "Java" object. + (initialize_handler_parm): Generate a Java-style lookup of + exception info if the caught object is a "Java" object. + (catch_language, catch_language_init): New globals. + (decl_is_java_type): New function. + (expand_start_catch_block): Don't call push_eh_info() or + push_eh_cleanup() when handling a Java-style "catch". Pass Java + class reference to build_catch_block. + +2000-03-02 Richard Kenner + + * typeck.c (comptypes): Treat sizetype like its language equivalent. + +2000-03-01 Bernd Schmidt + + * typeck.c (maybe_warn_about_returning_address_of_local): Reorganize + to merge reference/pointer code and fix incorrect warnings. + +2000-02-29 Jason Merrill + + * search.c (protected_accessible_p): Use context_for_name_lookup. + + * init.c (construct_virtual_bases): Fix thinko. + * typeck.c (expand_ptrmemfunc_cst): Fix thinko. + +2000-03-01 Martin von Loewis + + * decl.c (current_function_decl): Move to toplev.c. + +2000-02-29 Nathan Sidwell + + * pt.c (fn_type_unification): Unify return type, whenever + provided. + (get_bindings_real): Only pass return type when necessary. + Remove explicit return type check. + * class.c (resolve_address_of_overloaded_function): Pass desired + return type to fn_type_unification. + +2000-02-28 Richard Kenner + + * class.c (build_vtbl_or_vbase_field, check_methods): Don't clear + DECL_FIELD_SIZE. + (check_bitfield_decl, check_field_decls): Set DECL_SIZE, not + DECL_FIELD_SIZE. + * rtti.c (expand_class_desc): Likewise. + * cp-tree.h (DECL_INIT_PRIORITY): Use underlying union name. + (THUNK_VCALL_OFFSET): Likewise. + (THUNK_DELTA): Reflect changes in ../tree.h. + +2000-02-28 Jason Merrill + + * search.c (protected_accessible_p): Also allow the access if + the member is public in DERIVED. Lose TYPE parm. + (friend_accessible_p): Lose TYPE parm. + (accessible_p): Adjust. + +2000-02-27 Richard Kenner + + * class.c (dfs_build_vtable_offset_vtbl_entries): Don't use size_binop + on things that are not sizes; ssize_binop deleted. + Call size_diffop when appropriate. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_primary_vtable, build_secondary_vtable): Likewise. + (dfs_set_offset_for_unshared_vbases, dfs_modify_vtables): Likewise. + Variable I is HOST_WIDE_INT. + (get_vfield_offset): Pass proper types to size_binop. + (size_extra_vtbl_entries, layout_virtual_bases): Likewise. + (finish_struct_1): Likewise. + (skip_rtti_stuff): Arg N is now pointer to signed. + (layout_class_type): Use size_zero_node. + * cp-tree.h (skip_rtti_stuff): Arg N is pointer to signed. + * cvt.c (cp_convert_to_pointer): Pass proper types to size_binop. + * decl.c (complete_arry_type): Pass proper types to size_binop. + (xref_basetypes): BINFO_OFFSET is sizetype. + * error.c (dump_expr): Don't use size_binop non-sizes. + * expr.c (cplus_expand_constant): Pass proper types to size_binop. + * init.c (construct_virtual_bases): Fix type error. + (build_vec_delete_1): Pass proper type to size_binop and don't + fold result. + * lex.c (cp_make_lang_type): BINFO_OFFSET is sizetype. + * rtti.c (get_base_offset): Pass proper type to size_binop. + * search.c (dfs_find_vbases): Fix type error. + (expand_upcast_fixups): Arg to skip_rtti_stuff is pointer to signed. + (dfs_get_vbase_types): BINFO_OFFSET is sizetype. + * tree.c (debug_binfo): Variable N is signed. + Use HOST_WIDE_INT_PRINT_DEC. + * typeck.c (comptypes): sizetype is same as equivalent integer type. + (c_sizeof, c_sizeof_nowarn, expr_sizeof): Use TYPE_SIZE_UNIT, + size_one_node and size_zero_node. + (c_alignof): Use size_one_node. + (build_component_addr): Pass proper types to size_binop. + (expand_ptrmemfunc_cst): Don't use size_binop on non-sizes. + +2000-02-26 Jason Merrill + + Implement class scope using-declarations for functions. + * class.c (handle_using_decl): Call add_method for used functions. + Use IDENTIFIER_CLASS_VALUE to check for conflicts. + (add_method): Used functions are hidden by local functions. + (check_bases_and_members): Handle using-decls before finalizing + CLASSTYPE_METHOD_VEC. + * call.c (add_function_candidate): Add ctype parm; if nonzero, + override the type of 'this' accordingly. + (add_template_candidate, add_template_candidate_real): Add ctype parm. + (convert_class_to_reference, build_user_type_conversion_1, + build_new_function_call, build_object_call, build_new_op, + build_new_method_call): Pass ctype parm. + + * search.c (lookup_member): Put rval_binfo, not basetype_path, in + the baselink. + * call.c (convert_class_to_reference, build_user_type_conversion_1, + build_new_function_call, build_object_call, build_new_op, + build_new_method_call, build_op_delete_call): Don't get basetype_path + from a baselink. + * typeck.c (build_component_ref): Likewise. + * init.c (build_offset_ref): Likewise. + (resolve_offset_ref): Don't call enforce_access. + Call build_scoped_ref. + * typeck2.c (build_scoped_ref): Simplify. Do nothing if it + would cause an error or if -pedantic. + * class.c (alter_access): Lose binfo parm. + +2000-02-26 Mark Mitchell + + * semantics.c (simplify_aggr_init_exprs_p): Don't walk into + types. + +2000-02-25 Alfred Minarik + + * rtti.c (get_vmi_pseudo_type_info): Move __vmi_class_type_info + pseudo_type_info creation into the std namespace + +2000-02-26 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF. + (import_export_class): Remove declaration. + * decl2.c (import_export_class): Make it static. + * dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR, + PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, + EXPR_WITH_FILE_LOCATION. + * lex.c (check_newline): Tweak filename/lineno setting. + * semantics.c (begin_while_stmt): Fix typo in comment. + +2000-02-26 Richard Kenner + + * lang-options.h (-fmessage-length=): Add missing option. + + * Make-lang.in (CXX_SRCS): Add .h files and sort list. + +2000-02-26 Zack Weinberg + + * Make-lang.in: Delete refs to LIBGCC2_DEPS. + +2000-02-25 Jim Wilson + + * optimize.c (expand_call_inline): Emit the return label before + evaluating the return value. + +2000-02-24 Mark Mitchell + + * lex.c (check_newline): Use push_srcloc and pop_srcloc, rather + than duplicating functionality here. + * optimize.c: Include input.h. + (expand_call_inline): Use push_srcloc and pop_srcloc. + * parse.y (maybe_cv_qualifier): Remove calls to emit_line_note. + * parse.c: Regenerated. + * Makefile.in (lex.o): Depend on input.h. + (optimize.o): Likewise. + +2000-02-24 Nathan Sidwell + + * decl.c (grokdeclarator): Diagnose qualifiers on non-member + function type, rather than ICE. + +2000-02-23 Jason Merrill + + * decl.c (grokdeclarator): Call decl_type_access_control. + * parse.y (parse_end_decl): Don't call decl_type_access_control if + decl is null. + +2000-02-23 Nathan Sidwell + + * decl.c (decls_match): Remove obsolete static member nadgering. + +2000-02-21 Martin v. Löwis + + * decl.c (grokdeclarator): Change ANSI to ISO. + * lex.c (consume_string, readescape, do_identifier): Likewise. + (parse_float, real_yylex): Likewise. + * parse.y (paren_expr_or_null, paren_cond_or_null): Likewise. + (unary_expr, new_initializer, cast_expr, primary, primary_no_id, + new_type_id, maybe_label_decls, simple_stmt, + for.init.statement): Likewise. + * pt.c (do_decl_instantiation, do_type_instantiation): Likewise. + * semantics.c (finish_named_return_value): Likewise. + * parse.c: Regenerate. + +2000-02-21 Mark Mitchell + + * cp-tree.h (CPTI_VTABLE_INDEX_TYPE): New macro. + (CPTI_CLASS_STAR_TYPE): Remove. + (vtable_index_type): Likewise. + (class_star_type_node): Remove. + (TYPE_PTRMEMFUNC_FN_TYPE): Adjust for the new ABI. + (build_binary_op_nodefault): Remove. + * call.c (build_new_op): Use build_binary_op instead of + build_binary_op_nodefault. + * decl.c (init_decl_processing): Remove class_star_type_node + initialization. Make delta_type_node ptrdiff_type_node under the + new ABI. Initialize vtable_index_type. + (build_ptrmemfunc_type): Build different structures for the new + ABI. + (build_enumerator): Use build_binary_op instead of + build_binary_op_nodefault. + * method.c (build_overload_value): Mangle pointers-to-members + appropriately under the new ABI. + * typeck.c (build_array_ref): Use build_binary_op instead of + build_binary_op_nodefault. + (get_member_function_from_ptrfunc): Adjust for the new ABI. + (build_binary_op_nodefault): Rename to ... + (build_binary_op): ... this. Remove old version. Adjust for + pointer-to-member comparisons under the new ABI. + (build_ptrmemfunc1): Remove dead code. Adjust for the new ABI. + (build_ptrmemfunc): Adjust for the new ABI. + (expand_ptrmemfunc_cst): Likewise. + (delta2_from_ptrmemfunc): Assert that we're not using the new ABI. + (pfn_from_ptrmemfunc): Adjust for the new ABI. + +2000-02-21 Gabriel Dos Reis + + * call.c (build_object_call): Compress consecutive calls to + cp_error. + (build_conditional_expr): Say 'ISO C++' not 'ANSI C++'. + (build_op_delete_call): Adjust message formatting. + + * class.c (check_bases): Compress consecutive calls to + cp_pedwarn. + (finish_struct_anon): Say 'ISO C++'. + + * decl.c (start_decl): Same here. + (grok_reference_init): Likewise. + (grokfndecl): Correct message formatting. + (grokfndecl): Improve diagnostic. + (check_static_variable_definition): Likewise. Say 'ISO C++' + (compute_array_index_type): Say 'ISO C++' + (create_array_type_for_decl): Compress consecutive calls to + cp_error. + (grokdeclarator): Say 'ISO C++' + (grok_op_properties): Likewise. + + * decl2.c (delete_sanity): Clairify diagnostic. + (check_member_template): Same here. + (grok_function_init): Use consistent terminology. + + * expr.c (do_case): Say 'ISO C++' + + * friend.c (do_friend): Compress consecutive calls to warning. + +2000-02-20 Mark Mitchell + + * cp-tree.h (merge_primary_and_secondary_vtables_p): New macro. + * class.c (build_secondary_vtable): Reorganize. Don't create a + new vtable under the new ABI. + (layout_vtable_decl): Don't add num_extra_vtbl_entries when + computing the size. + (build_vtbl_initializer): Don't return a CONSTRUCTOR; just return + the initializing elements. + (initialize_vtable): New function. + (dfs_finish_vtbls): Use it. + (dfs_accumulate_vtbl_inits): New function. + (finish_vtbls): Merge primary and secondary vtables under the new + ABI. + (finish_struct_1): Remove redundant call to layout_vtable_decl. + * init.c (expand_virtual_init): Deal with BINFO_VTABLEs that + aren't VAR_DECLs. + + * class.c (build_vtable): New function, split out from ... + (get_vtable_decl): ... here, and ... + (build_secondary_vtable): ... here. + + * pt.c (tsubst_decl): Fix formatting. + +2000-02-19 Richard Kenner + + * class.c (build_primary_vtable, layout_vtable_decl): Likewise. + (avoid_overlap, build_base_field): Likewise. + (build_base_field, build_base_fields, is_empty_class): + Test DECL_SIZE with integer_zero. + (layout_class_type): Set CLASSTYPE_SIZE_UNIT. + * cp-tree.h (struct lang_type): New field size_unit. + (CLASSTYPE_SIZE_UNIT): New macro. + * decl.c (init_decl_processing): Set DECL_SIZE_UNIT. + (cp_finish_decl): Delete -Wlarger-than processing. + * optimize.c (remap_decl): Walk DECL_SIZE_UNIT. + * pt.c (tsubst_decl): Set DECL_SIZE_UNIT. + * tree.c (make_binfo): binfo vector is one entry longer. + (walk_tree): Walk DECL_SIZE_UNIT. + +2000-02-19 Mark Mitchell + + * class.c (dfs_build_vcall_offset_vtbl_entries): Fix typo in + comment. + (build_vtable_entry): Don't assume all vtable entries are + functions. + (build_vtbl_initializer): Adjust accordingly. + (get_vtable_decl): Fix formatting. + +2000-02-18 Jason Merrill + + * semantics.c (deferred_type_access_control): Walk the entire + type_lookups list. + (save_type_access_control): Rename from + initial_deferred_type_access_control. Just remember the value. + (decl_type_access_control): New fn. + (begin_function_definition): Use deferred_type_access_control, after + we've started the function. Set type_lookups to error_mark_node. + * parse.y (frob_specs, fn.def1): Adjust. + (parse_decl0, parse_field, parse_field0, parse_bitfield): New fns. + (parse_end_decl, parse_bitfield0, parse_method): New fns. + (fn.def2, initdcl, initdcl0_innards, nomods_initdcl0): Use them. + (after_type_component_declarator0): Likewise. + (after_type_component_declarator): Likewise. + (notype_component_declarator): Likewise. + * cp-tree.h: Adjust. + + * decl.c (redeclaration_error_message): Allow redeclaration of + namespace-scope decls. + +2000-02-18 Martin von Loewis + + * typeck2.c (my_friendly_abort): Use GCCBUGURL. + +2000-02-17 Mark Mitchell + + * class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT. + * decl2.c (grokclassfn): Likewise. + + * ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS. + + * decl2.c (lang_decode_option): Don't set default message length + here. + * lex.c (lang_init_options): Set it here. + +2000-02-16 Mark Mitchell + + Make DECL_CONTEXT mean the class in which a member function was + declared, even for a virtual function. + * cp-tree.h (DECL_CLASS_CONTEXT): Adjust. + (DECL_FRIEND_CONTEXT): New macro. + (DECL_REAL_CONTEXT): Remove. + (SET_DECL_FRIEND_CONTEXT): Likewise. + (DECL_VIRTUAL_CONTEXT): Adjust. + (DECL_CLASS_SCOPE_P): Use TYPE_P. + (add_friends): Remove. + (hack_decl_function_context): Likewise. + * call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with + CP_DECL_CONTEXT. + (build_over_call): Fix indentation. Use DECL_CONTEXT + instead of DECL_CLASS_CONTEXT. + * class.c (dfs_build_vcall_offset_vtbl_entries): Likewise. + (add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. + (strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT. + (build_base_field): Likewise. + (finish_struct_1): Likewise. + (build_self_reference): Likewise. + * decl.c (push_class_binding): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (pushtag): Use decl_function_context, not + hack_decl_function_context. + (decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + (duplicate_decls): Use DECL_VIRTUAL_CONTEXT. + (pushdecl): Remove bogus code. + (start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT. + (cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + (grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + Use decl_function_context, nothack_decl_function_context. + (grokvardecl): Don't set DECL_CLASS_CONTEXT. + (grokdeclarator): Likewise. Use decl_function_context, not + hack_decl_function_context. + (copy_args_p): Document. Don't use DECL_CLASS_CONTEXT. + (start_function): Use DECL_FRIEND_CONTEXT, not + DECL_CLASS_CONTEXT. Use decl_function_context, not + hack_decl_function_context. + (finish_function): Use decl_function_context, not + hack_decl_function_context. + (maybe_retrofit_in_chrg): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + (grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT. + (finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT. + (grokfield): Likewise. + (finish_builtin_type): Likewise. + (finish_vtable_vardec): Use decl_function_context, not + hack_decl_function_context. + (import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (start_static_initialization_or_destruction): Likewise. + (finish_static_initialization_or_destruction): Likewise. + (mark_used): Adjust logic for deciding when to synthesize methods. + * dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + * error.c (dump_function_decl): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * friend.c (is_friend): Likewise. + (add_friends): Remove. + (do_friend): Use SET_DECL_FRIEND_CONTEXT. + * lex.c (begin_definition_of_inclass_inline): Use + decl_function_context, not hack_decl_function_context. + (process_next_inline): Likewise. + (do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + * method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not + DECL_CLASSS_CONTEXT. + (hack_identifier): Likewise. + (synthesize_method): Use decl_function_context, not + hack_decl_function_context. + * pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (is_member_template): Use decl_function_context, not + hack_decl_function_context. Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + (build_template_decl): Set DECL_VIRTUAL_CONTEXT, not + DECL_CLASS_CONTEXT. + (check_default_tmpl_args): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (push_template_decl_real): Likewise. + (instantiate_class_template): Don't call add_friends. + (tsubst_default_argument): Use DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. + Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (set_meangled_name_for_template_decl): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * repo.c (repo_inline_used): Likewise. + * search.c (current_scope): Adjust for new _CONTEXT macros. + (context_for_name_lookup): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (lookup_fnfields_here):Likewise. + (check_final_overrider): Likewise. + (init_vbase_pointers): Likewise. + (virtual_context): Likewise. + * semantics.c (finish_member_declaration): Just set DECL_CONTEXT. + (expand_body): Use decl_function_context, not + hack_decl_function_context. + * tree.c (hack_decl_function_context): Remove. + * typeck.c (build_x_function_call): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * typeck2.c (error_not_base_type): Likewise. + +2000-02-15 Jason Merrill + + * decl.c (xref_tag): Don't SET_IDENTIFIER_NAMESPACE_VALUE. + +2000-02-16 Kaveh R. Ghazi + + * Make-lang.in (g++spec.o): Depend on $(GCC_H), not gcc.h. + +2000-02-15 Jonathan Larmour + + * lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to default spec. + +2000-01-16 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Enable automatic line wrapping. + +2000-02-13 Jason Merrill + + * parse.y (frob_specs): Split out... + (parse_decl): From here. + (fn.def2): Call initial_deferred_type_access_control. + (after_type_component_declarator0): Call frob_specs. + (notype_component_declarator0): Likewise. + * search.c (friend_accessible_p): Nested classes are friends of their + enclosing classes. + +2000-02-10 Mark Mitchell + + * ir.texi (ADDR_EXPR): Document the fact that an ADDR_EXPR can be + used to create an implicit temporary. + + * class.c (dfs_modify_vtables): Tweak calculation of functions to + override. + +2000-02-08 Nathan Sidwell + + * typeck.c (strip_all_pointer_quals): Use TYPE_MAIN_VARIANT, to + strip array element qualifiers too. + +2000-02-07 Mark Mitchell + + * decl.c (store_parm_decls): Don't build cleanups for parameters + while processing_template_decl. + +2000-02-07 Jason Merrill + + * cp-tree.h (struct saved_scope): Add incomplete field. + (namespace_scope_incomplete): New macro. + * decl.c (pushdecl): Use it. + (hack_incomplete_structures): Use it. See through artificial + binding levels. + (mark_saved_scope): Mark it. + + Implement access control for nested types. + * search.c (type_access_control): New fn. + (accessible_p): Now we do perform access control for types. + * semantics.c (deferred_type_access_control): New fn. + (initial_deferred_type_access_control): New fn. + (begin_function_definition): Call it. Add lookups parm. + * decl.c (struct binding_level): Add this_class field. + (pushlevel_class): Set it. + (mark_binding_level): Mark it. + (lookup_name_real): Use it. Call type_access_control. + (mark_saved_scope): Mark lookups field. + * cp-tree.h (flagged_type_tree): Add lookups field. + (struct saved_scope): Add lookups field. + (type_lookups): New macro. + * parse.y (declmods): Now . + (parse_decl): Add lookups parm. Call + initial_deferred_type_access_control. + (lang_extdef): Clear type_lookups. + (typed_declspecs, declmods, typespec): Set lookups field. + (initdcl): Call deferred_type_access_control. + (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, + component_decl_1, named_parm): Adjust. + * friend.c (is_friend): Nested classes are friends of their + enclosing classes. + + * class.c (currently_open_derived_class): New fn. + * method.c (hack_identifier): Use it. + + * lex.c (do_identifier): Remove obsolete code. + + * parse.y (typed_typespecs): Propagate new_type_flag properly. + +2000-02-05 Zack Weinberg + + * tinfo.h: Remove apostrophes from C++ comment (xgettext + thinks this file is plain C). + +2000-02-05 Kaveh R. Ghazi + + * Makefile.in (call.o): Depend on $(EXPR_H). + + * call.c: Include "expr.h". + + * class.c (dump_class_hierarchy): Add prototype. + + * search.c (dfs_get_pure_virtuals): Likewise. + +2000-02-1 Ulrich Drepper + + * parse.y (simple_stmt): Allow :: token in asm parameter list. + * parse.c: Rebuilt. + +2000-01-31 Jim Wilson + + * class.c (build_vtbl_or_vbase_field): New parameter fcontext. + Store it in DECL_FCONTEXT. + (build_vbase_pointer_fields, create_vtable_ptr): Fix callers. + +2000-01-31 Jason Merrill + + * tinfo.h (old abi): #include "tconfig.h". + * tinfo.cc (convert_to_base): Move into old abi section. + +2000-01-31 Mark Mitchell + + * cp-tree.h (BINFO_VIRTUALS): Tweak documentation. + (CLASSTYPE_PRIMARY_BINFO): Use BINFO_PRIMARY_BINFO. + (BINFO_PRIMARY_BINFO): New macro. + (BF_DELTA): Rename to ... + (BV_DELTA): ... this. + (BF_VCALL_INDEX): Rename to ... + (BV_VCALL_INDEX): ... this. + (BF_FN): Rename to ... + (BV_FN): ... this. + * class.c (build_vbase_path): Adjust for changes to reverse_path. + (set_rtti_entry): Rename BF_ macros to BV_ variants. + (modify_vtable_entry): Simplify. + (add_virtual_function): Rename BF_ macros to BV_ variants. + (build_vtable_initializer): Likewise. + (get_class_offset_1): Remove. + (dfs_get_class_offset): Likewise. + (get_class_offset): Likewise. + (dfs_find_final_overrider): New function. + (find_final_overrider): Likewise. + (modify_one_vtable): Remove. + (dfs_find_base): New function. + (dfs_modify_vtables): Fold modify_one_vtable in here. Use + find_final_overrider. + (modify_all_vtables): Adjust. Set BV_VCALL_INDEX on new + virtuals. + (dfs_fixup_vtable_deltas): Remove. + (override_one_vtable): Remove. + (merge_overrides): Likewise. + (layout_virtual_bases): Make sure BINFO_OFFSET is set right for + unreal chilren of virtual bases. + (finish_struct_1): Don't use merge_overrides. Don't use + dfs_fixup_vtable_deltas. + * tree.c (reverse_path): Return a TREE_LIST, not a chain of + BINFOs. + +2000-01-31 Herman A.J. ten Brugge + Jason Merrill + + * tinfo.h: Rename USItype to myint32, depend on BITS_PER_UNIT. + +2000-01-31 Alfred Minarik + + * exception.cc (__throw_bad_typeid): Add missing std::. + +2000-01-31 Kaveh R. Ghazi + + * cp-tree.h (make_thunk): PROTO -> PARAMS. + +2000-01-31 Nathan Sidwell + + * cp-tree.h (new_abi_rtti_p): Use flag_new_abi. + + Runtime support for new-abi rtti. + * inc/typeinfo (type_info::operator!=): Define in class. + (type_info::before, type_info::name, type_info::operator==, + type_info::operator!=): Define new ABI implementations. + (type_info::is_pointer_p, type_info::is_function_p): Declare + new virtual functions. + (type_info::do_catch, type_info::do_upcast): Likewise. + + * tinfo.h (__base_class_info): Define new class. + (__class_type_info): Likewise. + (__si_class_type_info): Likewise. + (__vmi_class_type_info): Likewise. + (__dynamic_cast): Prototype. + + * tinfo.cc: Conditionalize old and new rtti mechanisms. + (type_info::is_pointer_p): Define new function. + (type_info::is_function_p): Likewise. + (type_info::do_catch): Likewise. + (type_info::do_upcast): Likewise. + (vtable_prefix): New structure for vtable access. + (adjust_pointer): Define new template function. + (contained_p, public_p, virtual_p, contained_public_p, + contained_nonpublic_p, contained_nonvirtual_p): Define new + functions. + (nonvirtual_base_type): New local variable. + (__class_type_info::~__class_type_info): Define. + (__si_class_type_info::~__si_class_type_info): Likewise. + (__vmi_class_type_info::~__vmi_class_type_info): Likewise. + (__class_type_info::do_catch): Define new function. + (__class_type_info::do_upcast): Likewise. + (__class_type_info::find_public_src): Likewise. + (__class_type_info::do_find_public_src): Likewise. + (__si_class_type_info::do_find_public_src): Likewise. + (__vmi_class_type_info::do_find_public_src): Likewise. + (__class_type_info::do_dyncast): Likewise. + (__si_class_type_info::do_dyncast): Likewise. + (__vmi_class_type_info::do_dyncast): Likewise. + (__class_type_info::do_upcast): Likewise. + (__si_class_type_info::do_upcast): Likewise. + (__vmi_class_type_info::do_upcast): Likewise. + (__dynamic_cast): Likewise. + + * tinfo2.cc (__fundamental_type_info): Define new class. + (__pointer_type_info): Likewise. + (__reference_type_info): Likewise. + (__array_type_info): Likewise. + (__function_type_info): Likewise. + (__enum_type_info): Likewise. + (__ptr_to_member_type_info): Likewise. + (__fundamental_type_info::~__fundamental_type_info): Define. + (__pointer_type_info::~__pointer_type_info): Likewise. + (__reference_type_info::~__reference_type_info): Likewise. + (__array_type_info::~__array_type_info): Likewise. + (__function_type_info::~__function_type_info): Likewise. + (__enum_type_info::~__enum_type_info): Likewise. + (__ptr_to_member_type_info::~__ptr_to_member_type_info): Likewise. + (__pointer_type_info::do_catch): Define new function. + (__ptr_to_member_type_info::do_catch): Define new function. + + (__throw_type_match_rtti_2): Use new ABI interface, if enabled. + (__is_pointer): Likewise. + + * exception.cc (__cplus_type_matcher): Deal with new-abi rtti. + +2000-01-30 Mark Mitchell + + * cp/class.c (build_vtable): Rename to build_primary_vtable. + (prepare_fresh_vtable): Rename to build_secondary_vtable. + (make_new_vtable): New function. + (modify_vtable_entry): Handle generation of new vtables correctly. + (modify_one_vtable): Remove unused parameter. + (dfs_fixup_vtable_deltas): Likewise. + (override_one_vtable): Use build_secondary_vtable. + (finish_struct_1): Use build_primary_vtable and + build_secondary_vtable. + +2000-01-28 Ulrich Drepper + + * cp/decl.c: Adjust variable names, comments, help strings. + +2000-01-29 Nathan Sidwell + + * new2.cc (operator delete[]): Use operator delete, don't assume + implementation. + +2000-01-29 Nathan Sidwell + + * class.c (build_vtbl_initializer): Add argument to + build_vtable_entry call. + +2000-01-27 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Discuss vcall indices. + * cp-tree.h (BINFO_VIRTUALS): Update documentation. + (BF_DELTA): New macro. + (BF_VCALL_INDEX): Likewise. + (BF_FN): Likewise. + (THUNK_VCALL_OFFSET): Likewise. + (make_thunk): Change prototype. + * class.c (build_vtable_entry): Integrate + build_vtable_entry_for_fn. Handle vcall indices. + (build_vtable_entry_for_fn): Remove. + (set_rtti_entry): Handle vcall indices. Use BF_DELTA, + BF_VCALL_INDEX, BF_FN. + (modify_vtable_entry): Integrate common code from + modify_one_vtable and dfs_fixup_vtable_deltas. + (add_virtual_function): Set BF_VCALL_INDEX. + (build_vtbl_initializer): Simplify. Use BF_DELTA, BF_VCALL_INDEX, + and BF_FN. + (modify_one_vtable): Simplify. + (dfs_fixup_vtable_deltas): Likewise. + (override_one_vtable): Use BF_DELTA, BF_VCALL_INDEX, BF_FN. + * method.c (make_thunk): Handle vcall indices. + +2000-01-28 Nathan Sidwell + + Compiler side new abi rtti (not enabled). + * cp-tree.h (new_abi_rtti_p): New macro. + (emit_support_tinfos): Prototype new function. + (tinfo_decl_p): Likewise. + (emit_tinfo_decl): Likwise. + * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL): New accessor + macros. + (doing_runtime): New local static. + (init_rtti_processing): Add new-abi initializer. + (get_tinfo_decl): Add new-abi logic. + (tinfo_from_decl): Likewise. + (build_dynamic_cast_1): Likewise. + (qualifier_flags): New static function. + (tinfo_base_init): Likewise. + (generic_initializer): Likewise. + (ptr_ref_initializer): Likewise. + (ptmd_initializer): Likewise. + (class_hint_flags): Likewise. + (class_initializer): Likewise. + (synthesize_tinfo_var): Likewise. + (create_real_tinfo_var): Likewise. + (create_pseudo_type_info): Likewise. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + (emit_support_tinfos): New global function. + (tinfo_decl_p): New global predicate. + (emit_tinfo_decl): New global function. + * class.c (set_rtti_entry): Generalize for old and new rtti. + (build_vtbl_initializer): Likewise. + * decl2.c (finish_file): Likewise. + +2000-01-27 Jim Wilson + + * optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t) + and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))). + +2000-01-27 Mike Stump + + * decl.c (pushdecl): Fix up shadow warnings with respect to implicit + for scopes. + +2000-01-26 Jason Merrill + + * pt.c (unify): Use fold, not maybe_fold_nontype_arg. + +2000-01-26 J"orn Rennecke + + * optimize.c (calls_setjmp_r): Supply new argument + to special_function_p. + +2000-01-26 Kaveh R. Ghazi + + * call.c: PROTO -> PARAMS. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl.h: Likewise. + * decl2.c: Likewise. + * dump.c: Likewise. + * errfn.c: Likewise. + * error.c: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * init.c: Likewise. + * input.c: Likewise. + * lex.c: Likewise. + * lex.h: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + * xref.c: Likewise. + +2000-01-25 Richard Henderson + + * typeck.c (build_binary_op_nodefault): Remove UNNE_EXPR. + +2000-01-25 Mark Mitchell + + * cp-tree.h (vcall_offset_in_vtable_p): New macro. + * class.c (build_vbase_offset_vtbl_entries): Fix typo in commment. + (struct vcall_offset_data_s): New type. + (dfs_vcall_offset_queue_p): New function. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_vcall_offset_vtbl_entries): Likewise. + (layout_vtable_decl): Likewise. + (num_vfun_entries): Likewise. + (num_extra_vtbl_entries): Add the entries for vcall offsets. + (build_vtbl_initializer): Likewise. + (dfs_finish_vtabls): Use layout_vtable_decl. + (modify_one_vtables): Always duplicate vtables under the new ABI. + (finish_struct_1): Use layout_vtable_decl. + +2000-01-25 Kaveh R. Ghazi + + * decl.c (member_function_or_else): Change third arg from a format + specifier to an `enum overload_flags'. Callers changed. + +2000-01-25 Gabriel Dos Reis + + * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof, + build_binary_op_nodefault, build_unary_op, build_reinterpret_cast, + build_const_cast, get_delta_difference, check_return_expr): Avoid + ANSI string concatenation usage. + +2000-01-24 Mark Mitchell + + * class.c (layout_class_type): Put the fields required to make a + class non-empty at the end, not the beginning, of the TYPE_FIELDs + list. + +2000-01-24 Jason Merrill + + * pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a + template. + + * decl2.c (mark_used): Do instantiate inlines that have been + explicitly instantiated. + +2000-01-24 Richard Henderson + + * call.c (build_over_call): Use expand_tree_builtin. + * typeck.c (build_function_call_real): Likewise. + (build_binary_op_nodefault): Handle unordered compares. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (CPTI_BAD_CAST, CPTI_BAD_TYPEID, CPTI_DCAST): New + cp_tree_index values. + (throw_bad_cast_node, throw_bad_typeid_node, dynamic_cast_node): + New global node #defines for them. + * rtti.c (call_void_fn): Replace with ... + (build_runtime_decl): ... new static function. + (throw_bad_cast): Use throw_bad_cast_node and build_runtime_decl. + (throw_bad_typeid): Use throw_bad_typeid_node and build_runtime_decl. + (build_dynamic_cast_1): Always produce correctly typed result. + Explicitly produce type_info addresses. Use dynamic_cast_node. + * exception.cc (__throw_bad_cast): Return `void *'. + (__throw_bad_typeid): Return `const type_info &'. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (get_vtable_decl): Prototype new function. + * class.c (get_vtable_decl): New function. Broken out from ... + (build_vtable): ... here. Use it. + * decl2.c (finish_vtable_vardecl): Ignore dummy vtables created + by get_vtable_decl. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE, + CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE, + CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations. + (CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE, + CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE, + CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations. + (CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ... + (CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here. + (CPTI_TINFO_VAR_ID): New enumeration. + (__tp_desc_type_node, __access_mode_type_node, + __bltn_desc_type_node, __user_desc_type_node, + __class_desc_type_node, __ptr_desc_type_node, + __attr_desc_type_node, __func_desc_type_node, + __ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines. + (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node, + ref_desc_type_node, ary_desc_type_node, func_desc_type_node, + enum_desc_type_node, class_desc_type_node, + si_class_desc_type_node, vmi_class_desc_type_node, + ptmd_desc_type_node, base_desc_type_node): New #defines. + (tinfo_fn_id, tinfo_fn_type): Rename to ... + (tinfo_decl_id, tinfo_decl_type): ... here. Adjust. + (tinfo_var_id): New enumeration. + (DECL_TINFO_FN_P): Augment comment. + * decl.c (cp_global_trees): Adjust documentation. + * rtti.c (init_rtti_processing): Adjust for tinfo_decl_id, + tinfo_decl_type and tinfo_var_id. + (get_tinfo_decl_dynamic): Adjust for tinfo_decl_type. + (build_typeid): Remove unused variable. + (get_tinfo_var): Use tinfo_var_id. + (tinfo_name): New static function. + (get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type. + (tinfo_from_decl): Likewise. + (get_base_offset): New static function, broken out of + expand_class_desc. + (expand_si_desc): Use tinfo_name. + (expand_class_desc): Likewise. Lose local static variable. + Use base_desc_type_node. Use get_base_offset. + (expand_ptr_desc): Use tinfo_name. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + + * tinfo.cc (__GXX_ABI_VERSION): Test value and existence. + * tinfo.h (__GXX_ABI_VERSION): Test value and existence. + +2000-01-23 Mark Mitchell + + * cp-tree.h (__eprintf): Remove declaration. + * tree.c (__eprintf): Remove definition. + +2000-01-23 Zack Weinberg + Mark Mitchell + + * cp-tree.h (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N, + CLEAR_CLASSTYPE_MARKED_N): Avoid signed vs. unsigned warnings. + +2000-01-23 Brad Lucier + + * class.c (dump_class_hierarchy): Print HOST_WIDE_INT properly. + +2000-01-23 Mark Mitchell + + * cp-tree.h (register_dtor_fn): New function. + * decl.c (destroy_local_static): Rename to ... + (register_dtor_fn): ... this. Give it external linkage. + (expand_static_init): Use it. + * decl2.c (do_static_initialization): Likewise, if using + __cxa_atexit. + (do_static_destruction): Check that __cxa_atexit is not in use. + (finish_file): Don't call do_static_destruction if using + __cxa_atexit. + + * typeck.c (convert_arguments): Restore two-message error + reporting. + +2000-01-20 Nathan Sidwell + + Remap dynamic cast hint values to be consistent across ABIs. + * search.c (dynamic_cast_base_recurse): Remap generated value. + (get_dynamic_cast_base_type): Adjust documentation. + * tinfo.h (__user_type_info::dyncast): Likewise. + (__user_type_info::find_public_subobj): Remap BOFF meaning. + * tinfo.cc (__si_type_info::do_dyncast): Remap BOFF meaning. + (__class_type_info::do_dyncast): Likewise. + (__class_type_info::do_find_public_subobj): Likewise. + * tinfo2.cc (__dynamic_cast): Remap BOFF parameter. + +2000-01-19 Gabriel Dos Reis + + * typeck.c (build_unary_op): Use cp_pedwarn, not pedwarn. + + * typeck2.c (incomplete_type_error): Restore previous + cp_error and cp_error_at call sequence. + +2000-01-20 Brad Lucier + + * class.c (dump_class_hierarchy): Make format agree with argument; + cast pointer to unsigned long and print with %lx. + +2000-01-19 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Set default line-wrap length to 72. + + * typeck.c (composite_pointer_type, common_type, + comp_target_parms, c_sizeof, expr_sizeof, build_array_ref, + build_function_call_real, convert_arguments, + build_binary_op_nodefault, pointer_int_sum, pointer_diff, + build_unary_op, mark_addressable, build_compound_expr, + build_static_cast, build_reinterpret_cast, build_const_cast, + build_c_cast, build_modify_expr, get_delta_difference, + build_ptrmemfunc, check_return_expr): Replace 'ANSI C++' with + 'ISO C++'. Fusion consecutive calls to diagnostic message routines + into a single one. + * typeck2.c (readonly_error, abstract_virtuals_error, + process_init_constructor, check_for_new_type): Likewise. + +2000-01-19 Mark Mitchell + + * tree.c (bot_manip): Set DECL_CONTEXT for newly created + VAR_DECLs. + +2000-01-18 Nathan Sidwell + + * cp-tree.h (get_tinfo_fn_dynamic): Remove prototype. + (build_x_typeid): Likewise. + (get_tinfo_fn): Likewise. + (get_tinfo_fn_unused): Rename to ... + (get_tinfo_decl): ... here. + * rtti.c (build_headof): Replace logic error with assertion. + (get_tinfo_fn_dynamic): Rename to ... + (get_tinfo_decl_dynamic): ... here. Make static. Use + complete_type_or_else. + (build_x_typeid): Move into ... + (build_typeid): ... here. Adjust call to + get_tinfo_decl_dynamic. Use tinfo_from_decl. Simplify + throw_bad_typeid expression. + (get_tinfo_fn_unused): Rename to ... + (get_tinfo_decl): ... here. Adjust comment. + (get_tinfo_fn): Delete. + (tinfo_from_decl): New static function. + (get_typeid_1): Call get_tinfo_decl and tinfo_from_decl. + (get_typeid): Use complete_type_or_else. + (build_dynamic_cast_1): Adjust calls to + get_tinfo_decl_dynamic. Simplify throw_bad_cast expression. + * parse.y (primary): Adjust call to build_typeid. + * except.c (build_eh_type_type_ref): Adjust call to + get_tinfo_decl. Mark as used. + * class.c (set_rtti_entry): Adjust call to get_tinfo_decl. + * decl2.c (build_expr_from_tree): Adjust call to build_typeid. + * parse.c: Regenerated. + +2000-01-17 Mark Mitchell + + * class.c (fixed_type_or_null): Don't clear NONNULL. Document + calling convention. + (resolves_to_fixed_type_p): Document calling convention. + * rtti.c (build_x_typeid): Initialize NONNULL. + + * cp-tree.h (build_shared_int_cst): New function. + * call.c (build_over_call): Use DECL_VIRTUAL_CONTEXT, for clarity. + * class.c (modify_vtable_entry): Likewise. + (add_virtual_function): Split out code to generated shared + INTEGER_CSTs to build_share_int_cst. + (modify_all_vtables): Handle all the overridden functions here. + Add overridden functions from non-primary virtual bases to the + primary vtable. + (finish_struct_1): Adjust call to modify_all_vtables. Add + overridden functions from non-primary bases to the vtable. + * tree.c (build_shared_int_cst): New function. + + * cp-tree.h (scratchalloc): Remove. + (build_scratch_list): Likewise. + * call.c (convert_class_to_reference): Replace build_scratch_list + and build_expr_list with build_tree_list. + (add_candidate): Replace scratchalloc with expralloc. Note memory + leak. + (build_user_type_conversion_1): Replace build_scratch_list + and build_expr_list with build_tree_list. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (convert_like): Likewise. + * cvt.c (ocp_convert): Likewise. + * decl.c (start_decl): Likewise. + (start_function): Likewise. + (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. + * decl2.c (reparse_decl_as_expr): Likewise. + * init.c (perform_member_init): Likewise. + (expand_cleanup_for_base): Likewise. + (build_builtin_delete_call): Likewise. + (build_new_1): Likewise. + (build_delete): Likewise. + * method.c (do_build_assign_ref): Likewise. + * parse.y (already_scoped_stmt): Likewise. + (nontrivial_exprlist): Likewise. + (net_initializer): Likewise. + (initlist): Likewise. + * parse.c: Regenerated. + * rtti.c (build_x_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + * typeck.c (build_x_compound_expr): Likewise. + (build_static_cast): Likewise. + (build_modify_expr): Likewise. + + * cp-tree.h (DECL_VINDEX): Add documentation. + * class.c (build_vtable_entry): Likewise. + (start_vtable): Add comment. + (add_virtual_function): Replace pending_hard_virtuals with + overridden_virtuals and pending_virtuals with new_virtuals. + Replace redundant assignments with assertions. + (check_for_override): Add comment. + (check_bases_and_members): Replace pending_hard_virtuals with + overridden_virtuals and pending_virtuals with new_virtuals. + (create_vtbl_ptr): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Likewise. Add comments. + +2000-01-16 Mark Mitchell + + * class.c (finish_struct_1): Replace redundant code with + assertions. + + * cp-tree.h (flag_new_abi): Move. + (flag_use_cxa_atexit): Likewise. + (flag_honor_std): Likewise. + (flag_rtti): Likewise. + (vbase_offsets_in_vtable_p): Define. + (vptrs_present_everywhere_p): Likewise. + (TYPE_CONTAINS_VPTR_P): Likewise. + (dfs_walk_real): Declare. + * class.c (build_vbase_pointer_fields): Check + vbase_offsets_in_vtable_p. + (dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in + BINFO_VPTR_FIELD. + (build_vbase_offset_vtbl_entries): Simplify. + (build_vbase_offset_vtbl_entries): Adjust. + (build_vbase_pointer): Add ability to look up vbase offsets in + vtable. + (start_vtable): New function. + (add_virtual_function): Use it. + (determine_primary_base): Use TYPE_CONTAINS_VPTR_P. + (num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p. + (build_vtbl_initializer): Take the type of the complete object as + input. Use it to correctly calculate vbase offsets. + (dfs_finish_vtbls): Pass the complete type to + build_vtbl_initializer. + (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. + (create_vtable_ptr): Create a vtable even if there are no + new virtual functions, under the new ABI. + (finish_struct_1): Likewise. + (get_vfield_name): Use TYPE_CONTAINS_VPTR_P. + * decl.c (exapnd_static_init): Remove call to + preserve_initializer. + * decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in + vtables. + * init.c (initialize_vtbl_ptrs): Initialize them in pre-order. + (expand_virtual_init): Use vbase_offsets_in_vtable_p. + (construct_virtual_bases): Don't initialize virtual base pointers + under the new ABI. + (build_aggr_init): Clean up comment. + (expand_aggr_init_1): Likewise. + * rtti.c (expand_class_desc): Store the virtual function table + index where the vbase offset lives in the offset field. + * search.c (dfs_walk_real): Make it global. + (dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P. + * tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD. + + * tinfo.h (USItype): Make it signed under the new ABI. + * tinfo.cc (convert_to_base): New function. Encapsulate base + conversion logic here. + (__class_type_info::do_upcast): Use it. + (__class_type_info::do_dyncast): Likewise. + (__class_type_info::do_find_public_subobj): Likewise. + + * init.c (construct_virtual_bases): Don't look up the addresses of + virtual bases at run-time. + + * class.c (build_vbase_pointer): Relocate. + (build_vbase_pointer_fields): Likewise. + (dfs_build_vbase_offset_vtbl_entries): Likewise. + (build_vbase_offset_vtbl_entries): Likewise. + + * decl.c (init_decl_processing): Complain if -fnew-abi + -fno-vtable-thunks is used. + + * decl2.c (lang_decode_option): Don't couple flag_honor_std to + flag_new_abi. + +2000-01-15 Mark Mitchell + + * cp-tree.h (num_extra_vtbl_entries): New function. + (size_extra_vtbl_entries): Likewise. + (dfs_vtable_path_unmark): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): Likewise. + (dfs_vtable_path_marked_real_bases_queue_p): Likewise. + * class.c (num_extra_vtbl_entries): New function. + (size_extra_vtbl_entries): Likewise. + (dfs_build_vbase_offset_vtbl_entries): New function. + (build_vbase_offset_vtbl_entries): Likewise. + (build_vtbl_initializer): Use it. + (finish_struct_1): Adjust vtable sizes (using + num_extra_vtbl_entries). + * expr.c (cplus_expand_expr): Assert that the DECL_RTL for a + THUNK_DECL is non-NULL before expanding it. + * init.c (expand_virtual_init): Adjust the vtable pointer by + size_extra_vtbl_entries before storing it. + * search.c (get_shared_vase_if_not_primary): Adjust prototype. + Handle TREE_LIST parameters here, not in the dfs_* functions. + (dfs_unmarked_real_bases_queue_p): Adjust. + (dfs_marked_real_bases_queue_p): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): New function. + (dfs_vtable_path_marked_real_bases_queue_p): New function. + (dfs_vtable_path_unmark): Likewise. + +2000-01-14 Mark Mitchell + + * optimize.c (copy_body_r): Clear the operand three of a + TARGET_EXPR when copying it. + +2000-01-14 Martin v. Löwis + + * method.c (build_decl_overload_real): Check whether we are in :: + before returning __builtin_new/delete. + +2000-01-13 Mark Mitchell + + * pt.c (tsubst_friend_function): Improve comment. + (instantiate_decl): Avoid crashing when a "nested" function is + instantiated from the top level. + + * dump.c (dqeueue_and_dump): Dump + DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. + +2000-01-13 Kaveh R. Ghazi + + * call.c: If GATHER_STATISTICS, declare `n_build_method_call'. + +2000-01-13 Nathan Sidwell + + * g++spec.c (lang_specific_driver): Add -fnew-abi if + ENABLE_NEW_GXX_ABI defined. + * Make-lang.in (tinfo.o, tinfo2.o, exception.o, new.o, + opnew.o, opnewnt.o, opvnew.o, opvnewnt.o, opdel.o, opdelnt.o, + opvdel.o, opvdelnt.o): Use GXX_ABI_FLAG switch. + +2000-01-12 Mark Mitchell + + * decl.c (start_cleanup_fn): Call pushdecl. + + * call.c (convert_class_to_reference): Fix typos. + (build_conditional_expr): Handle errors gracefully. + * class.c (push_nested_class): Likewise. + * cp-tree.h (VAR_FUNCTION_OR_PARM_DECL_CHECK): New macro. + (DECL_THIS_EXTERN): Use it. + (DECL_THIS_STATIC): Likewise. + * cvt.c (convert_to_void): Handle errors gracefully. + (build_expr_type_conversion): Likewise. + * decl.c (maybe_push_decl): Likewise. + (start_decl_1): Likewise. + (require_complete_types_for_parms): Likewise. + * parse.y (structsp): Likewise. + (base_class): Likewise. + * parse.c: Regenerated. + * pt.c (finish_member_template_decl): Likewise. + * typeck.c (decay_conversion): Likewise. + + * cp-tree.h (dfs_skip_vbases): New function. + (find_vbase_instance): Likewise. + * class.c (determine_primary_base): Allow a nearly empty base to + serve as a primary base class under the new ABI. + (get_class_offset_1): Rename to ... + (dfs_get_class_offset): ... this. Simplify. Don't issue error + messages here. + (get_class_offset): Use it. Issue error messages here. + (dfs_modify_vtables): Rely on dfs_unmarked_real_bases_queue_p to + find the right copies of virtual bases. + (fixup_vtable_deltas1): Rename to ... + (dfs_fixup_vtable_deltas): ... this. Adjust to handle virtual + bases as primary bases. + (fixup_vtable_deltas): Remove. + (override_one_vtable): Handle virtual bases as primary bases. + (merge_overrides): Likewise. + (finish_struct_1): Likewise. + (dump_class_hierarchy): Dump primary-ness of bases as well. + * search.c (mark_primary_bases): Use a pre-order traversal to + handle primary virtual bases. + (dfs_skip_vbases): New fiunction. + (expand_upcast_fixups): Adjust to handle primary virtual bases. + (fixup_virtual_upcast_offsets): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + (dfs_find_vbase_instances): New function. + (find_vbase_instance): Likewise. + +2000-01-11 Mumit Khan + + * lex.c (DIR_SEPARATOR): Delete macro. + +2000-01-12 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Handle automatic line wrapping + option. + +2000-01-11 Mark Mitchell + + * friend.c (do_friend): Don't resolve scopes when processing + template declarations, even if the qualifying scope doesn't + involve template parameters. + +2000-01-10 Mark Mitchell + + * class.c (dfs_modify_vtables_queue_p): Remove. + (modify_all_vtables): Use dfs_unmarked_real_bases_queue_p + and dfs_marked_real_bases_queue_p instead of + dfs_modify_vtables_queue_p. + + * class.c (build_vbase_path): Simplify. + (dfs_propagate_binfo_offsets): New function. + (propagate_binfo_offsets): Use it. + (remove_base_field): Simplify. + (dfs_set_offset_for_vbases): Remove. + (dfs_set_offset_for_shared_vbases): New function. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Use them. + (layout_basetypes): Don't call propagate_binfo_offsets. + * search.c (dfs_get_vbase_types): Clone completely fresh binfos + for the vbases. + + * class.c (build_base_field): New function, split out from ... + (build_base_fields): ... here. Use it. Allocate primary bases + first, under the new ABI. + (get_vtable_entry): Remove. + (remove_base_field): New function, split out from ... + (remove_base_fields): ... here. Adjust since primary bases come + first under the new ABI. + + * cp-tree.h (expand_direct_vtbls_init): Remove declaration. + (initialize_vtbl_ptrs): New function. + (expand_indirect_vtbls_init): Change prototype. + (convert_pointer_to_vbase): Declare. + * init.c (expand_direct_vtbls_init): Remove. + (dfs_initialize_vtbl_ptrs): New function. + (initialize_vtbl_ptrs): Likewise. + (emit_base_init): Use initialize_vtbl_ptrs. + * search.c (convert_pointer_to_vbase): Make it global. + (expand_indirect_vtbls_init): Remove vtable initialization code. + * semantics.c (setup_vtbl_ptr): Use initialize_vtbl_ptrs. + + * class.c (dfs_finish_vtbls): New function. + (finish_vtbls): Use it. + (dump_class_hierarchy): New function. + + * cp-tree.h (BINFO_PRIMARY_MARKED_P): Change definition. + (BINFO_VBASE_PRIMARY_P): New macro. + (BINFO_VIRTUALS): Add to documentation. + (SET_BINFO_PRIMARY_MARKED_P): Remove. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (dfs_mark_primary_bases_queue_p): Likewise. + (dfs_unmarked_real_bases_queue_p): New function. + (dfs_marked_real_bases_queue_p): Likewise. + * search.c (dfs_mark_primary_bases): Adjust. + (mark_primary_bases): Likewise. + (get_shared_vbase_if_not_primary): New function. + (dfs_unmarked_real_bases_queue_p): Likewise. + (dfs_marked_real_bases_queue_p): Likewise. + (dfs_get_pure_virtuals): Simplify. + (get_pure_virtuals): Likewise. + +2000-01-10 Kaveh R. Ghazi + + * lex.c: Include tm_p.h. + +2000-01-07 Nathan Sidwell + + * lang-specs.h (__GXX_ABI_VERSION): New preprocessor macro. + +2000-01-06 Jason Merrill + + * decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT. + * pt.c (instantiate_decl): Defer comdat templates that might not be + needed. + + * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT. + * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT. + (finish_file): Likewise. + + * decl2.c (import_export_class): Undo 12/14 change. + + * error.c (dump_decl): operator new, not operatornew. + + * class.c (field_decl_cmp): A nontype is "greater" than a type. + * search.c (lookup_field_1): Look for the last field with the + desired name. + +2000-01-05 Nathan Sidwell + + * decl2.c (lookup_arg_dependent): Deal with FNS not being a + FUNCTION_DECL. + +2000-01-05 Nathan Sidwell + + * typeck.c (build_static_cast): Don't strip target qualifiers + when casting from a class. + +2000-01-04 Kaveh R. Ghazi + + * class.c (warn_hidden): Initialize variable `fndecl'. + +2000-01-03 Ulrich Drepper + + * decl.c (flag_isoc9x): New variable to be able to use code in + c-common.c. For now always zero. + +2000-01-03 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. + * class.c (layout_basetypes): Don't set BINFO_INHERITANCE_CHAIN + or unshare_base_binfos for virtual bases here. + * search.c (dfs_get_vbase_types): Do it here. + (get_vbase_types): Adjust. + +2000-01-02 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VFIELDS): Move definition. + (BINFO_PRIMARY_MARKED_P): Use flag 5. + (SET_BINFO_PRIMARY_MARKED_P): Likewise. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (unmark_primary_bases): Remove declaration. + (unmarkedp): Declare. + (dfs_vbase_unmark): Likewise. + * class.c (determine_primary_base): Return immediately if there + are no base classes. Call mark_primary_bases here. + (modify_all_direct_vtables): Remove. + (modify_all_indirect_vtables): Remove. + (dfs_modify_vtables_queue_p): New function. + (dfs_modify_vtables): New function. + (modify_all_vtables): Use them. + (build_base_fields): Build FIELD_DECLs for primary virtual base + classes. + (create_vtable_ptr): Don't call determine_primary_base here. + (dfs_mark_primary_bases_and_set_vbase_offsets): Rename to ... + (dfs_set_offset_for_vbases): ... this. + (layout_virtual_bases): Use it. + (layout_class_type): Call determine_primary_base here. + * search.c (unmarkedp): Make it global. + (shared_marked_p): Simplify. + (shared_unmarked_p): Likewise. + (dfs_primary_bases_queue_p): Remove. + (dfs_unmark_primary_bases): Likewise. + (unmark_primary_bases): Likewise. + (mark_primary_bases): Simplify. + (get_pure_virtuals): Don't call mark_primary_bases here. + (dfs_vbase_unmark): New function. + (get_vbase_types): Simplify. + + * class.c (struct base_info): Remove. + (determine_primary_base): Take has_virtual_p rather than a + base_info as input. Don't calculate max_has_virtual. + (finish_struct_bits): Remove max_has_virtual argument. + (create_vtable_ptr): Remove max_has_virtual_p argument. + (layout_virtual_bases): Remove max argument. + (layout_basetypes): Likewise. + (layout_class_type): Remove max_has_virtual_p argument. + (finish_struct_1): Remove max_has_virtual. + + * cp-tree.h (dfs_mark_primary_bases_queue_p): New function. + (layout_basetypes): Remove. + * class.c (propagate_binfo_offsets): Moved here from tree.c. + Update to handle primary virtual bases. + (remove_base_fields): New function, split out from + layout_basetypes. + (dfs_mark_primary_bases_and_set_vbase_offsets): New function. + (layout_virtual_bases): New function, split out from + layout_basetypes. Update to handle primary virtual bases. + (layout_basetypes): Moved here from tree.c. Use + remove_base_fields and layout_virtual_bases. + * search.c (dfs_mark_primary_bases_queue_p): New function. + (mark_primary_bases): Use it. + * tree.c (CEIL): Remove. + (propagate_binfo_offsets): Remove. + (layout_basetypes): Remove. + +2000-01-01 Mark Mitchell + + * cp-tree.h (CLASSTYPE_N_BASECLASSES): Use BINFO_N_BASETYPES. + (BINFO_PRIMARY_MARKED_P): New macro. + (SET_BINFO_PRIMARY_MARKED_P): Likewise. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (mark_primary_bases): New function. + (unmark_primary_bases): Likewise. + * search.c (get_abstract_virtuals_1): Remove. + (dfs_mark_primary_bases): New function. + (mark_primary_bases): Likewise. + (dfs_unmark_primary_bases): Likewise. + (unmark_primary_bases): Likewise. + (dfs_get_pure_virtuals): Likewise. + +2000-01-01 Mark Mitchell + + * cp-tree.h (skip_rtti_stuff): Adjust prototype. + * class.c (skip_rtti_stuff): Reorganize parameters and return value. + (modify_one_vtable): Adjust. + (fixup_vtable_deltas1): Likewise. + (override_one_vtable): Likewise. + * search.c (get_abstract_virtuals_1): Likewise. + (get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + + * class.c (build_vtable): Don't return a value. Don't rebuild + vtables for bases that have already been handled. + (prepare_fresh_vtable): Don't rebuild vtables for bases that have + already been handled. + (modify_one_vtable): Adjust accordingly. + (fixup_vtable_deltas1): Likewise. + (finish_struct_1): Likewise. + +2000-01-01 Martin v. Löwis + + * call.c (build_new_method_call): Also check destructors. + diff --git a/contrib/gcc/cp/ChangeLog-2001 b/contrib/gcc/cp/ChangeLog-2001 new file mode 100644 index 00000000000..9643357b261 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-2001 @@ -0,0 +1,3895 @@ +2001-12-29 Nathan Sidwell + + * call.c (build_user_type_conversion_1): Use my_friendly_assert + rather than if ... abort. + * cvt.c (convert_to_reference): Likewise. + * semantics.c (setup_vtbl_ptr): Likewise. + * pt.c (lookup_template_class): Comment typo. + +2001-12-29 Nathan Sidwell + + PR c++/5125 + * pt.c (push_template_decl_real): Make sure DECL has + DECL_LANG_SPECIFIC. + +2001-12-29 Nathan Sidwell + + PR c++/335 + * init.c (resolve_offset_ref): Copy cv qualifiers of this pointer + for non-reference fields. + * typeck.c (require_complete_type): Use resolve_offset_ref). + +2001-12-26 Nathan Sidwell + + PR c++/196 + * parse.y (bad_parm): Better diagnostic when given a SCOPE_REF. + +2001-12-24 Nathan Sidwell + + PR c++/160 + * typeck.c (build_modify_expr): Remove old unreachable code & tidy + up. Don't stabilize_references when initializing a reference. + +2001-12-23 Kaveh R. Ghazi + + * decl2.c (lang_f_options): Const-ify. + +2001-12-20 Joseph S. Myers + + * config-lang.in (diff_excludes): Remove. + +2001-12-19 Nathan Sidwell + + PR c++/90 + * typeck.c (build_function_call_real): Use original function + expression for errors. + +2001-12-18 Jason Merrill + + PR c++/3242 + * class.c (add_method): Do compare 'this' quals when trying to match a + used function. Don't defer to another used function. + +2001-12-18 Nathan Sidwell + + * pt.c (instantiate_clone): Remove, fold into ... + (instantiate_template): ... here. Simplify by removing mutual + recursion. + * typeck2.c (build_m_component_ref): Don't cv qualify the function + pointed to by a pointer to function. + * class.c (delete_duplicate_fields_1): Typo. + +2001-12-18 Jason Merrill + + C++ ABI change: destroy value arguments in caller. + * semantics.c (genrtl_start_function, genrtl_finish_function): Don't + create an extra binding level for the parameters. + * decl.c (store_parm_decls): Don't do parameter cleanups. + +2001-12-18 Nathan Sidwell + + * call.c (build_new_method_call): Use '%#V'. + * error.c (cv_to_string): Use V parameter to determine padding. + +2001-12-18 Joseph S. Myers + + * call.c, decl2.c, init.c: Use "built-in" and "bit-field" + spellings in messages. + +2001-12-17 Zack Weinberg + + * cp-tree.h: Delete #defines for cp_error, cp_warning, + cp_pedwarn, and cp_compiler_error. + * call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c, + except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c, + rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, + typeck2.c: Change calls to the above macros to use their + language-independent equivalents: error, warning, pedwarn, and + internal_error respectively. + +2001-12-16 Neil Booth + + * decl2.c (finish_file): Remove back_end_hook. + +2001-12-16 Joseph S. Myers + + * ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c, + cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c, + pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors. + +2001-12-15 Joseph S. Myers + + * lang-options.h: Use American spelling in messages. + +2001-12-13 Jason Merrill + + * Make-lang.in (parse.h): Separate rule, just depend on parse.c. + + Use cleanups to run base and member destructors. + * init.c (push_base_cleanups): New function, split out from... + (build_delete): ...here. Lose !TYPE_HAS_DESTRUCTOR code. + * decl.c (finish_destructor_body): Move vbase destruction code to + push_base_cleanups. + (begin_function_body, finish_function_body): New fns. + (finish_function): Move [cd]tor handling and call_poplevel to + finish_function_body. + (pushdecl): Skip the new level. + * semantics.c (genrtl_try_block): Don't call end_protect_partials. + (setup_vtbl_ptr): Call push_base_cleanups. + * method.c (synthesize_method): Call {begin,end}_function_body. + * pt.c (tsubst_expr): Handle COMPOUND_STMT_BODY_BLOCK. + * cp-tree.h: Declare new fns. + * parse.y (function_body, .begin_function_body): New nonterminals. + (fndef, pending_inline, function_try_block): Use function_body. + (ctor_initializer_opt, function_try_block): No longer has a value. + (base_init): Remove .set_base_init token. + (.set_base_init, compstmt_or_error): Remove. + * Make-lang.in (parse.c): Expect two fewer s/r conflicts. + + * optimize.c (maybe_clone_body): Fix parameter updating. + +2001-12-12 Jason Merrill + + * decl.c (store_parm_decls): Remove parms_have_cleanups cruft. + * semantics.c (genrtl_start_function): Don't pass + parms_have_cleanups or push an extra binding level. + (genrtl_finish_function): Lose cleanup_label cruft. + + * cp-tree.h (struct cp_language_function): Remove x_ctor_label. + (ctor_label): Remove. + * semantics.c (finish_return_stmt): Lose ctor_label support. + * decl.c (finish_constructor_body, mark_lang_function): Likewise. + * typeck.c (check_return_expr): Check DECL_DESTRUCTOR_P, not + dtor_label. + + * call.c (build_new_method_call): Let resolves_to_fixed_type_p + check for [cd]tors. + * class.c (fixed_type_or_null, case INDIRECT_REF): Fix. + + * decl.c (finish_function): Check VMS_TARGET, not VMS. + + * decl.c (start_cleanup_fn): Remove redundant pushlevel. + (end_cleanup_fn): And poplevel. + + * semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER + if we're in a template. + +2001-12-12 Jakub Jelinek + + * cp-tree.h (DESTRUCTOR_DECL_PREFIX, DESTRUCTOR_NAME_P, + ANON_PARMNAME_FORMAT, ANON_PARMNAME_P, DESTRUCTOR_NAME_FORMAT, + THIS_NAME_P): Delete. + * spew.c (read_process_identifier): Remove DESTRUCTOR_NAME_P, + THIS_NAME_P and ANON_PARMNAME_P tests from warning about clash + with internal naming scheme. + * error.c (dump_decl): Remove DESTRUCTOR_NAME_P use. + +2001-12-12 Nathan Sidwell + + * decl.c (grokdeclarator): Deprecated implicit typename use. + +2001-12-11 Nathan Sidwell + + PR g++/51 + * parse.y (frob_specs): Indicate it is a language linkage which + contained the extern. + * decl.c (grokdeclarator): Allow extern language linkage with + other specifiers. + +2001-12-10 Nathan Sidwell + + PR g++/72 + * decl.c (add_binding): Don't reject duplicate typedefs involving + template parameters. + +2001-12-10 Neil Booth + + * parse.y, semantics.c: Similarly. + +2001-12-09 Nathan Sidwell + + PR g++/87 + * cp-tree.h (DECL_COPY_CONSTRUCTOR_P): Use copy_fn_p. + (copy_args_p): Rename to ... + (copy_fn_p): ... here. + (grok_special_member_properties): New function. + (grok_op_properties): Lose VIRTUALP parameter. + (copy_assignment_arg_p): Remove. + * call.c (build_over_call): Use copy_fn_p. + * decl.c (grokfndecl): Reformat. Adjust call to + grok_op_properties. + (copy_args_p): Rename to ... + (copy_fn_p): ... here. Reject template functions. Check for pass + by value. + (grok_special_member_properties): Remember special functions. + (grok_ctor_properties): Don't remember them here, just check. + (grok_op_properties): Likewise. + (start_method): Call grok_special_member_properties. + * decl2.c (grokfield): Likewise. + (copy_assignment_arg_p): Remove. + (grok_function_init): Don't remember abstract assignment here. + * pt.c (instantiate_class_template): Call + grok_special_member_properties. + (tsubst_decl): Adjust grok_op_properties call. + +2001-12-08 Aldy Hernandez + + * lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and + RID_TYPES_COMPATIBLE_P. + +2001-12-08 John David Anglin + + * semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in + call to build_aggr_init. + * cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND. + +2001-12-08 Neil Booth + + * parse.y: Replace uses of the string non-terminal with STRING. + Don't perform string concatentaion here. + (string): Remove non-terminal. + * semantics.c (finish_asm_stmt): Don't concatenate strings here. + +2001-12-05 Jason Merrill + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Define. + * tree.c (cp_start_inlining, cp_end_inlining): New fns. + * pt.c (push_tinst_level): No longer static. + * cp-tree.h: Declare them. + + * init.c (resolve_offset_ref): Don't check access for the base + conversion to access a FIELD_DECL. + + * cp-tree.h (TYPE_REFFN_P): New macro. + * decl.c (bad_specifiers): Check it, too. + + * rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY + on the __*_type_info type if we haven't seen a definition. + +2001-12-05 Neil Booth + + * decl.c: Include c-common.h. + (shadow_warning): Move to c-common.c. + +2001-12-05 Richard Kenner + + * decl.c (duplicate_decls): Don't copy DECL_NO_CHECK_MEMORY_USAGE. + +2001-12-04 Nathan Sidwell + + * pt.c (end_template_parm_list): Clear TREE_CHAIN of each parm. + +2001-12-04 Nathan Sidwell + + PR g++/164 + * init.c (sort_base_init): Allow binfos to be directly specified. + * method.c (do_build_copy_constructor): Explicitly convert to the + base instance. + (do_build_assign_ref): Likewise. + +2001-12-03 Hans-Peter Nilsson + + * decl.c (xref_basetypes): Don't use C99 construct in tag_code + declaration and initialization. + +2001-12-03 Neil Booth + + * typeck2.c: Remove leading capital from diagnostic messages, as + per GNU coding standards. + +2001-12-03 Mumit Khan + + PR c++/3394 + * decl.c (xref_basetypes): Handle attributes between + 'class' and name. + +2001-12-03 Nathan Sidwell + + PR g++/3381 + * parse.y (named_complex_class_head_sans_basetype): Add new + reduction. + * Make-lang.in (parse.c): Adjust expected conflict count. + +2001-12-03 Jason Merrill + + * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the + immediate binfos for our virtual bases. + +2001-12-02 Neil Booth + + * call.c (build_java_interface_fn_ref): Similarly. + * except.c (is_admissible_throw_operand): Similarly. + * init.c (build_java_class_ref): Similarly. + * xref.c (open_xref_file): Similarly. + +2001-12-01 Neil Booth + + * class.c (finish_struct): Remove trailing periods from messages. + * decl.c (check_tag_decl): Similarly. + * lex.c (cxx_set_yydebug): Similarly. + * typeck2.c (friendly_abort): Similarly. + +2001-11-29 Mark Mitchell + + PR c++/3048 + * cp-tree.h (ovl_member): Remove. + * decl2.c (merge_functions): Handle extern "C" functions + specially. + * tree.c (ovl_member): Remove. + +2001-11-29 Mark Mitchell + + PR c++/4842 + * class.c (get_basefndecls): Take an IDENTIFIER_NODE, not a + FUNCTION_DECL, as input. + (mark_overriders): Remove. + (warn_hidden): Rework for the new ABI. + +2001-11-29 Mark Mitchell + + PR c++/3471 + * call.c (convert_like_real): Do not build additional temporaries + for rvalues of class type. + +2001-11-28 Nathan Sidwell + + * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Use lookup base. + (ACCESSIBLY_UNIQUELY_DERIVED_FROM_P): Likewise. + (PUBLICLY_UNIQUELY_DERIVED_FROM_P: Likewise. + (DERIVED_FROM_P): Likewise. + (enum base_access): Renumber, add ba_quiet bit mask. + (get_binfo): Remove. + (get_base_distance): Remove. + (binfo_value): Remove. + (ACCESSIBLY_DERIVED_FROM_P): Remove. + * call.c (standard_conversion): Use lookup_base. + * class.c (strictly_overrides): Likewise. + (layout_virtual_bases): Likewise. + (warn_about_ambiguous_direct_bases): Likewise. + (is_base_of_enclosing_class): Likewise. + (add_vcall_offset_vtbl_entries_1): Likewise. + * cvt.c (build_up_reference): Adjust comment. + * init.c (build_member_call): Reformat. + * search.c (get_binfo): Remove. + (get_base_distance_recursive): Remove. + (get_base_distance): Remove. + (lookup_base_r): Tweak. + (lookup_base): Add ba_quiet control. Complete the types here. + (covariant_return_p): Use lookup_base. + * tree.c (binfo_value): Remove. + (maybe_dummy_object): Use lookup_base. + * typeck.c (build_static_cast): Use lookup_base. + (get_delta_difference): Likewise. + * typeck2.c (binfo_or_else): Use lookup_base. + (build_scoped_ref): Add back error_mark_check. + (build_m_component_ref): Use lookup_base. + +2001-11-29 Joseph S. Myers + + * Make-lang.in (c++.generated-manpages): New dummy target. + +2001-11-27 Richard Kenner + + * Make-lang.in (cp-lang.o): Depends on c-common.h. + * cp-lang.c (c-common.h): Include. + (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. + * decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p. + * expr.c (init_cplus_expand): Don't set lang_expand_constant. + +2001-11-26 Neil Booth + + * decl2.c (c_language): Move to c-common.c. + * lex.c (cxx_post_options, cxx_init_options): Use c-common.c + functions. + (cxx_init): Update. + +2001-11-26 Jason Merrill + + * call.c (joust): Remove COND_EXPR hack. + +2001-11-25 Aldy Hernandez + + * search.c (lookup_base_r): Declare bk in variable declaration + space. + +2001-11-25 Nathan Sidwell + + PR g++/3145 + * class.c (build_vbase_pointer): Remove. + (build_vbase_path): Remove. + (build_base_path): New function. + * cp-tree.h (base_access, base_kind): New enumerations. + (build_base_path): Declare. + (convert_pointer_to_real): Remove. + (convert_pointer_to): Remove. + (lookup_base): Declare. + (convert_pointer_to_vbase): Remove. + * call.c (build_scoped_method_call): Use lookup_base & + build_base_path instead of convert_pointer_to_real, + get_base_distance & get_binfo. + (build_over_call): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_pointer_force): Likewise. + (build_up_reference): Likewise. + (convert_pointer_to_real): Remove. + (convert_pointer_to): Remove. + * init.c (dfs_initialize_vtbl_ptrs): Use build_base_path + instead of convert_pointer_to_vbase & build_vbase_path. + (emit_base_init): Use build_base_path instead of + convert_pointer_to_real. + (expand_virtual_init): Lose unrequired conversions. + (resolve_offset_ref): Use lookup_base and build_base_path + instead of convert_pointer_to. + * rtti.c (build_dynamic_cast_1): Use lookup_base & + build_base_path instead of get_base_distance & build_vbase_path. + * search.c (get_vbase_1): Remove. + (get_vbase): Remove. + (convert_pointer_to_vbase): Remove. + (lookup_base_r): New function. + (lookup_base): New function. + * typeck.c (require_complete_type): Use lookup_base & + build_base_path instead of convert_pointer_to. + (build_component_ref): Likewise. + (build_x_function_call): Likewise. + (get_member_function_from_ptrfunc): Likewise. + (build_component_addr): Likewise. + * typeck2.c (build_scoped_ref): Likewise. + +2001-11-22 Bryce McKinlay + + * cp-tree.h (CP_TYPE_QUALS): Removed. + * decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. + * cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and + LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN. + * dump.c (cp_dump_tree): Use void* dump_info argument to match + lang-hooks prototype. + * call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, + rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to + CP_TYPE_QUALS changed to cp_type_quals. + * Make-lang.in: References to c-dump.h changed to tree-dump.h. + (CXX_C_OBJS): Remove c-dump.o. + +2001-11-21 Mark Mitchell + + PR c++/3637 + * pt.c (lookup_template_class): Ensure that all specializations + are registered on the list corresponding to the most general + template. + +2001-11-20 Mark Mitchell + + * call.c (non_reference): Add documentation. + (convert_class_to_reference): Do not strip reference types + from conversion operators. + (maybe_handle_ref_bind): Simplify. + (compare_ics): Correct handling of references. + +2001-11-19 John Wilkinson + + * dump.c (dump_op): New function. + (cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use + dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs. + DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P, + +2001-11-19 Mark Mitchell + + PR4629 + * semantics.c (finish_sizeof): Make sure that expression created + while processing a template do not have a type. + (finish_alignof): Likewise. + * typeck.c (c_sizeof): Likewise. + (expr_sizeof): Likewise. + +2001-11-18 Neil Booth + + * lex.c (cxx_finish): Call c_common_finish. + (finish_parse): Remove. + +2001-11-17 Kriang Lerdsuwanakij + + * decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE + when displaying error message about missing array bounds. + +2001-11-17 Kriang Lerdsuwanakij + + * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR, + CONST_CAST_EXPR. + * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR. + +2001-11-16 Neil Booth + + * cp-tree.h (print_class_statistics): Restore. + +2001-11-15 Jason Merrill + + * method.c (use_thunk): Don't emit debugging information for thunks. + + * parse.y: Add ... IDENTIFIER SCOPE and ... PTYPENAME SCOPE expansions. + * decl.c (make_typename_type): Handle getting a class template. + * search.c (lookup_field_r): A class template is good enough for + want_type. + + * call.c (convert_like_real): Only use cp_convert for the bad part. + (standard_conversion): Also allow bad int->enum. + * typeck.c (ptr_reasonably_similar): Also allow functions to + interconvert. Pointers to same-size integers are reasonably + similar. + + * cvt.c (convert_to_void): If we build a new COND_EXPR, always + give it void type. + +2001-11-15 Nathan Sidwell + + PR g++/3154 + * init.c (sort_base_init): Remove unreachable code. + (expand_member_init): Adjust comment to reflect reality. Simplify + and remove unreachable code. + +2001-11-15 Neil Booth + + * cp-tree.h (init_reswords, cxx_init_decl_processing): New. + (cxx_init): Update prototype. + * decl.c (init_decl_processing): Rename. Move null node init + to its creation time. + * lex.c (cxx_init_options): Update. + (cxx_init): Combine with old init_parse; also call + cxx_init_decl_processing. + +2001-11-14 Richard Sandiford + + * decl.c (check_initializer): Try to complete the type of an + array element before checking whether it's complete. Don't + complain about arrays with complete element types but an + unknown size. + (cp_finish_decl): Build the hierarchical constructor before + calling maybe_deduce_size_from_array_init. + +2001-11-14 Joseph S. Myers + + * Make-lang.in: Change all uses of $(manext) to $(man1ext). + +2001-11-13 Nathan Sidwell + + PR g++/4206 + * parse.y (already_scoped_stmt): Remove. + (simple_stmt, WHILE & FOR): Use implicitly_scoped_stmt. + +2001-11-12 H.J. Lu + + * cvt.c (ocp_convert): Don't warn the address of a weak + function is always `true'. + +2001-11-09 Neil Booth + + * cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override. + * cp-tree.h (print_class_statistics): Remove. + (cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type, + cxx_print_identifier, cxx_set_yydebug): New. + * lex.c (set_yydebug): Rename c_set_yydebug. + * ptree.c (print_lang_decl, print_lang_type, print_lang_identifier, + lang_print_xnode): Rename. + * tree.c (print_lang_statistics): Rename. + +2001-11-09 Kaveh R. Ghazi + + * class.c (dump_array): Fix format specifier warning. + +2001-11-09 Neil Booth + + * cp-lang.c (LANG_HOOKS_NAME): Override. + (struct lang_hooks): Constify. + * lex.c (cxx_init_options): Update. + (lang_identify): Remove. + * parse.y (language_string): Remove. + +2001-11-08 Andreas Franck + + * Make-lang.in (CXX_INSTALL_NAME, GXX_CROSS_NAME, + DEMANGLER_CROSS_NAME): Handle program_transform_name the way + suggested by autoconf. + (GXX_TARGET_INSTALL_NAME, CXX_TARGET_INSTALL_NAME): Define. + (c++.install-common): Use the transformed target alias names. + +2001-11-06 Neil Booth + + * Make-lang.in: Update. + * cp-lang.c: Include langhooks-def.h. + +2001-11-04 Kriang Lerdsuwanakij + + * pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR. + +2001-11-03 Kaveh R. Ghazi + + * lex.c (copy_lang_type): Add static prototype. + +2001-11-02 Kriang Lerdsuwanakij + + * pt.c (unify): Handle SCOPE_REF. + +2001-11-01 Jakub Jelinek + + * tree.c (cp_copy_res_decl_for_inlining): Adjust + DECL_ABSTRACT_ORIGIN for the return variable. + +2001-10-31 Zack Weinberg + + * Make-lang.in: Replace $(INTL_TARGETS) with po-generated. + +2001-10-28 Joseph S. Myers + + * ChangeLog.1, ChangeLog.2, ChangeLog, class.c, decl2.c, search.c, + semantics.c, spew.c: Fix spelling errors. + +2001-10-27 Kriang Lerdsuwanakij + + * decl2.c (validate_nonmember_using_decl): Handle NAMESPACE_DECL. + +2001-10-25 Zack Weinberg + + * cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to + pop_everything. + +2001-10-23 Richard Kenner + + * cp-lang.c (cxx_get_alias_set): New function. + Point LANG_HOOKS_GET_ALIAS_SET to it. + +2001-10-23 Kriang Lerdsuwanakij + + * cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node. + * cp-tree.h (make_unbound_class_template): Prototype new function. + * decl.c (make_unbound_class_template): New function. + * decl2.c (arg_assoc_template_arg): Handle UNBOUND_CLASS_TEMPLATE. + * error.c (dump_type): Likewise. + * mangle.c (write_type): Likewise. + * parse.y (template_parm): Likewise. + (template_argument): Use make_unbound_class_template. + * pt.c (convert_template_argument): Handle UNBOUND_CLASS_TEMPLATE. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (unify): Likewise. + * tree.c (walk_tree): Likewise. + * typeck.c (comptypes): Likewise. + +2001-10-21 Kaveh R. Ghazi + + * xref.c (GNU_xref_member): Use safe-ctype macros and/or fold + extra calls into fewer ones. + +2001-10-18 Alexandre Oliva + + * decl.c (duplicate_decls): Propagate DECL_UNINLINABLE. + Warn when merging inline with attribute noinline. + (start_decl, start_function): Warn if inline and attribute + noinline appear in the same declaration. + +2001-10-16 H.J. Lu + + * cp-tree.h (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Defined + for tree checking disabled. + +2001-10-16 Hans-Peter Nilsson + + * cp-tree.h (VFIELD_NAME_FORMAT) [NO_DOLLAR_IN_LABEL && + NO_DOT_IN_LABEL]: Adjust to match VFIELD_NAME. + +2001-10-15 Richard Sandiford + + * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Define. + (unify): Only handle MINUS_EXPR specially if the above flag is set + and the subtracted constant is 1. Clear the flag on recursive calls. + Set it when unifying the maximum value in an INTEGER_TYPE's range. + +2001-10-15 Richard Sandiford + + * decl.c (bad_specifiers): Don't allow exception specifications + on any typedefs. + +2001-10-14 Neil Booth + + * cp/lex.c (init_cp_pragma): Similarly. + +2001-10-13 Kriang Lerdsuwanakij + + * pt.c (lookup_template_class): Build complete template arguments + for BOUND_TEMPLATE_TEMPLATE_PARM. + +2001-10-12 Kriang Lerdsuwanakij + + * cp-tree.h (TYPE_BINFO): Update comment. + (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): New macro. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Use template_info. + (TYPENAME_TYPE_FULLNAME): Use TYPE_FIELDS. + (copy_type): Prototype new function. + * lex.c (copy_lang_decl): Gather tree node statistics. + (copy_lang_type): New function. + (copy_type): Likewise. + (cp_make_lang_type): Create lang_type for + BOUND_TEMPLATE_TEMPLATE_PARM. Set TYPE_BINFO for TYPENAME_TYPE + and BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (tsubst): Use copy_type instead of copy_node. + * search.c (lookup_field_1): Ignore TYPENAME_TYPE. + +2001-10-12 Kriang Lerdsuwanakij + + * pt.c (determine_specialization): Ignore functions without + DECL_TEMPLATE_INFO. + +2001-10-12 Nathan Sidwell + + PR g++/4476 + * typeck2.c (abstract_virtuals_error): Ignore incomplete classes. + +2001-10-11 Jason Merrill + + * typeck2.c (store_init_value): Don't re-digest a bracketed + initializer. + + * class.c (finish_struct_anon): Use TYPE_ANONYMOUS_P instead of + ANON_AGGR_TYPE_P. + +2001-10-11 Richard Henderson + + * class.c (build_vtable_entry_ref): Create a VTABLE_REF instead + of an asm statement. + (build_vtbl_ref_1): Split out from build_vtbl_ref. + (build_vfn_ref): Use it to handle vtable descriptors before + calling build_vtable_entry_ref. + * decl2.c (output_vtable_inherit): Use assemble_vtable_inherit. + +2001-10-10 Richard Henderson + + * parse.y (asm_operand): Allow named operands. + * semantics.c (finish_asm_stmt): Tweek for changed location + of the operand constraint. + +2001-10-09 Jason Merrill + + * call.c (standard_conversion): Add bad conversion between + integers and pointers. + (convert_like_real): Don't use convert_for_initialization for bad + conversions; complain here and use cp_convert. + (build_over_call): Don't handle bad conversions specially. + (perform_implicit_conversion): Allow bad conversions. + (can_convert_arg_bad): New fn. + * cp-tree.h: Declare it. + * typeck.c (convert_for_assignment): Use it. + (ptr_reasonably_similar): Any target type is similar to void. + +2001-10-08 Alexandre Oliva + + * Make-lang.in (CXX_OBJS): Added cp-lang.o. + (cp/cp-lang.o): New rule. + * cp-tree.h: Declare hooks. + * tree.c: Make hooks non-static. + (init_tree): Don't initialize hooks here. + * lex.c: Likewise. Move definition of lang_hooks to... + * cp-lang.c: ... new file. + +2001-10-08 Richard Henderson + + * cp-tree.h (struct lang_decl_flags): Remove declared_inline. + (DECL_DECLARED_INLINE_P): Use the bit in struct c_lang_decl. + +2001-10-07 Kaveh R. Ghazi + + * class.c (build_vtable_entry_ref): Const-ify. + * decl.c (predefined_identifier, + initialize_predefined_identifiers): Likewise. + * init.c (build_new_1): Likewise. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): + Likewise. + +2001-10-05 Alexandre Oliva + + * optimize.c (struct inline_data): Moved to ../tree-inline.c. + (INSNS_PER_STMT): Likewise. + (remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise. + (copy_body, initialize_inlined_parameters): Likewise. + (declare_return_variable, inlinable_function_p): Likewise. + (expand_call_inline, expand_calls_inline): Likewise. + (optimize_inline_calls, clone_body): Likewise. + * tree.c (walk_tree): Moved to ../tree-inline.c. + (walk_tree_without_duplicates): Likewise. + (copy_tree_r, remap_save_expr): Likewise. + +2001-10-04 Alexandre Oliva + + * Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. + (cp/pt.o, cp/semantics.o, cp/optimize.o): Likewise. + * cp-tree.h (lang_decl): Moved inlined_fns to tree_decl. + (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved to ../tree.h. + (flag_inline_trees): Moved declaration to ../tree-inline.h. + (walk_tree): Moved declaration to ../tree-inline.h. + (walk_tree_without_duplicates, copy_tree_r): Likewise. + (remap_save_expr): Likewise. + * decl.c: Include tree-inline.h. + (lang_mark_tree): Don't mark inlined_fns. + * decl2.c (flag_inline_trees): Moved defn to ../tree-inline.c. + * optimize.c: Include tree-inline.h. + (optimize_inline_calls): Move declaration to ../tree.h, as + non-static. + (remap_decl): Use language-independent constructs and hooks. + (remap_block, copy_body_r, declare_return_variable): Likewise. + (inlinable_function_p): Likewise. Don't test for + DECL_LANG_SPECIFIC before DECL_INLINED_FNS as inlined_fns is + no longer language-specific. + (optimize_inline_calls): Likewise. Make it non-static. Moved + call of dump_function to... + (optimize_function): Here... + (clone_body): New function, extracted from... + (maybe_clone_body): ... here. Build decl_map locally and pass + it on to clone_body. + * pt.c, semantics.c: Include tree-inline.h. + * tree.c: Likewise. + (cp_walk_subtrees): New language-specific hook for tree inlining. + (cp_cannot_inline_tree_fn, cp_add_pending_fn_decls, + cp_is_overload_p, cp_auto_var_in_fn_p, + cp_copy_res_decl_for_inlining): Likewise. + (walk_tree): Move language-specific constructs into... + (cp_walk_subtrees): this new function. + (copy_tree_r): Use language-independent constructs and hooks. + (init_tree): Initialize tree inlining hooks. + (remap_save_expr): Adjust prototype so that the declaration + does not require the definition of splay_tree. + +2001-10-03 John David Anglin + + * rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used + to build the declaration instead of the declaration itself. + +2001-10-02 Jason Merrill + + * decl2.c (cxx_decode_option): Add 'else'. + + * spew.c (end_input): No longer static. + * cp-tree.h: Declare it. + * parse.y (datadef): Add "error END_OF_SAVED_INPUT" expansion. + +2001-10-02 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call_real): + Pass type attributes to check_function_format rather than name or + assembler name. Don't require there to be a name or assembler + name to check formats. + +2001-10-02 Joseph S. Myers + + * decl.c (init_decl_processing): Don't call + init_function_format_info. Initialize lang_attribute_table + earlier. + (builtin_function): Call decl_attributes. + (insert_default_attributes): New. + +2001-10-01 Jason Merrill + + * decl.c (grokdeclarator): Copy array typedef handling from C + frontend. + + * decl.c (grokdeclarator): Copy too-large array handling from C + frontend. + +2001-09-29 Alexandre Oliva + + * config-lang.in (target_libs): Added target-gperf, so that we + don't try to build it if C++ is disabled. + +2001-09-23 Zack Weinberg + + * Make-lang.in (CXX_OBJS): Take out cp/errfn.o. + (cp/errfn.o): Delete rule. + (cp/error.o): Depend on flags.h. + * errfn.c: Delete file. + * cp-tree.h: Declare warn_deprecated. Remove definitions of + TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, + and TFF_TEMPLATE_DEFAULT_ARGUMENTS. #define cp_error, cp_warning, + cp_pedwarn, and cp_compiler_error to error, warning, pedwarn, and + internal_error respectively. Make cp_deprecated into a macro. + Don't define cp_printer typedef or declare cp_printers. + * error.c: Include flags.h. + Delete: struct tree_formatting_info, print_function_argument_list, + print_declaration, print_expression, print_function_declaration, + print_function_parameter, print_type_id, print_cv_qualifier_seq, + print_type_specifier_seq, print_simple_type_specifier, + print_elaborated_type_specifier, print_rest_of_abstract_declarator, + print_parameter_declaration_clause, print_exception_specification, + print_nested_name_specifier, and definition of cp_printers. + (locate_error): New function. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Moved here and + rewritten in terms of locate_error and diagnostic.c. + (cp_tree_printer): Rename cp_printer; wire up to *_to_string + instead of deleted print_* routines. Handle %C, %L, %O, %Q also. + (init_error): Adjust to match. + +2001-09-22 Richard Kenner + + * Make-lang.in (CXX_C_OBJS): Add attribs.o. + +2001-09-21 Richard Henderson + + * class.c (set_vindex): Mind TARGET_VTABLE_USES_DESCRIPTORS. + (build_vtbl_initializer): Likewise. + (build_vfn_ref): New. + * cp-tree.h: Declare it. + * call.c (build_over_call): Use it. + * decl2.c (mark_vtable_entries): Mark FDESC_EXPR. + * typeck.c (get_member_function_from_ptrfunc): Mind descriptors. + +2001-09-21 J"orn Rennecke + + * decl.c (grokdeclarator): Use C syntax for attr_flags declaration. + +2001-09-21 Joseph S. Myers + + Table-driven attributes. + * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. + * decl2.c (cplus_decl_attributes): Only take one attributes + parameter. + * cp-tree.c (cplus_decl_attributes): Update prototype. + * class.c (finish_struct), decl.c (start_decl, start_function), + decl2.c (grokfield), friend.c (do_friend), parse.y + (parse_bitfield): Update calls to cplus_decl_attributes. + * decl.c (grokdeclarator): Take a pointer to a single ordinary + attribute list. + * decl.h (grokdeclarator): Update prototype. + * decl2.c (grokfield): Take a single ordinary attribute list. + * friend.c (do_friend): Likewise. + * decl.c (shadow_tag, groktypename, start_decl, + start_handler_parms, grokdeclarator, grokparms, start_function, + start_method), decl2.c (grokfield, grokbitfield, grokoptypename), + parse.y (parse_field, parse_bitfield, component_decl_1), pt.c + (process_template_parm, do_decl_instantiation): Pass single + ordinary attribute lists around. + * decl.c (grokdeclarator): Correct handling of nested attributes. + Revert the patch + 1998-10-18 Jason Merrill + * decl.c (grokdeclarator): Embedded attrs bind to the right, + not the left. + . + * cp-tree.h (cp_valid_lang_attribute): Remove declaration + (cp_attribute_table): Declare. + * decl.c (valid_lang_attribute): Don't define. + (lang_attribute_table): Define. + (init_decl_processing): Initialize lang_attribute_table instead of + valid_lang_attribute. + * tree.c (cp_valid_lang_attribute): Remove. + (handle_java_interface_attribute, handle_com_interface_attribute, + handle_init_priority_attribute): New functions. + (cp_attribute_table): New array. + * decl2.c (import_export_class): Don't use + targetm.valid_type_attribute. + +2001-09-15 Gabriel Dos Reis + + * Make-lang.in (cp/error.o): Depend on real.h + * error.c: #include "real.h" + +2001-09-15 Kaveh R. Ghazi + + * mangle.c (mangle_conv_op_name_for_type): Use concat in lieu of + xmalloc/strcpy/strcat. + +2001-09-13 Kaveh R. Ghazi + + * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): + Const-ification. + * pt.c (tsubst_decl): Likewise. + +2001-09-12 Kaveh R. Ghazi + + * decl2.c (lang_f_options): Const-ification. + * lex.c (cplus_tree_code_name): Likewise. + * spew.c (yyerror): Likewise. + +2001-09-06 Nathan Sidwell + + PR c++/3986 + * class.c (force_canonical_binfo_r): Check & move an indirect + primary base first. + (force_canonical_binfo): Check that it's not already + canonical. + (mark_primary_virtual_base): Remove BINFO parameter. + (mark_primary_bases): Adjust, set BINFO_LOST_PRIMARY_P here. + +2001-09-06 Nathan Sidwell + + Remove TYPE_NONCOPIED_PARTS. + * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto + CLASSTYPE_PURE_VIRTUALS. + (TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO. + * class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS. + (layout_class_type): Don't call fixup_inline_methods here ... + (finish_struct_1): ... call it here. + +2001-09-04 Mark Mitchell + + * decl.c (duplicate_decls): Remove code deadling with + DECL_SAVED_INSNS. + * decl2.c (finish_file): Likewise. + * pt.c (instantiate_decl): Likewise. + * semantics.c (expand_body): Don't defer local functions if + they wouldn't be deferred for some other reason. Don't + generate RTL for functions that will not be emitted. + (genrtl_start_function): Remove code deadling with + DECL_SAVED_INSNS. + (genrtl_finish_function): Likewise. + +2001-09-04 Nathan Sidwell + + PR c++/4203 + * call.c (build_over_call): Do not optimize any empty base + construction. + +2001-08-31 Kriang Lerdsuwanakij + + * error.c (dump_template_decl): Output template parameters + together with their specifiers. + Output `class' prefix for template template parameter. + (dump_decl): Fix formatting. + +2001-08-30 Kurt Garloff + + * optimize.c (inlinable_function_p): Allow only smaller single + functions. Halve inline limit after reaching recursive limit. + +2001-08-30 Joern Rennecke + Jason Merrill + + * class.c (build_vtable_entry_ref): Subtract in char*, not + ptrdiff_t. + +2001-08-23 Jason Merrill + + * tree.c (cp_build_qualified_type_real): Use get_qualified_type. + (build_cplus_array_type): Use cp_build_qualified_type, not + TYPE_MAIN_VARIANT, to get an unqualified version. + + * decl2.c (grok_alignof): Lose. + (build_expr_from_tree): Use expr_sizeof and c_alignof_expr. + * typeck.c (c_alignof): Lose. + * semantics.c (finish_sizeof, finish_alignof): New. + * parse.y: Use them. + * cp-tree.h: Declare them. + +2001-08-22 Jason Merrill + + * pt.c (tsubst_expr): Hand off to the TREE_CHAIN of a statement. + Don't loop in COMPOUND_STMT, FOR_STMT or TRY_BLOCK. + * tree.c (cp_statement_code_p): A TAG_DEFN is a statement. + +2001-08-19 Jakub Jelinek + + * typeck2.c (add_exception_specifier): Only require complete type if + not in processing template declaration. + +2001-08-18 Kaveh R. Ghazi + + * decl.c: Cast argument to size_t, not HOST_WIDE_INT, in calls to + GNU_xref_start_scope and GNU_xref_end_scope. + + * tree.c (TYPE_HASH): Moved to ../tree.h. + +2001-08-16 Mark Mitchell + + * cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS + on COMPOUND_EXPRs. + +2001-08-14 Richard Henderson + + * class.c, cp-tree.h (build_vfn_ref): Remove. + * call.c, rtti.c: Replace all refernces with build_vtbl_ref. + +2001-08-13 Mark Mitchell + + * call.c (build_over_call): Mark COMPOUND_EXPRs generated for + empty class assignment as having side-effects to avoid + spurious warnings. + +2001-08-13 Zack Weinberg + + * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. + * except.c: Include libfuncs.h. + +2001-08-11 Gabriel Dos Reis + + * decl.c (grokdeclarator): Clarify diagnostic message. + +2001-08-13 Kriang Lerdsuwanakij + + * decl2.c (do_nonmember_using_decl): Replace using directive + with using declaration in the error message. + +2001-08-11 Kriang Lerdsuwanakij + + * pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the + criterion to avoid rebuilding expression tree instead of + processing_template_decl. + +2001-08-07 Jason Merrill + + Support named return value optimization for inlines, too. + * decl.c (finish_function): Nullify returns here. + * semantics.c (genrtl_start_function): Not here. + (cp_expand_stmt): Don't mess with CLEANUP_STMTs. + (nullify_returns_r): No longer static. Just clear RETURN_EXPR. + Also nullify the CLEANUP_STMT for the nrv. + * cp-tree.h: Declare it. + * optimize.c (declare_return_variable): Replace the nrv with the + return variable. + * typeck.c (check_return_expr): Be more flexible on alignment check. + Ignore cv-quals when checking for a matching type. + +2001-08-09 Richard Henderson + + * decl2.c (finish_objects): Use target hooks instead of + assemble_constructor and assemble_destructor. + +2001-08-08 John David Anglin + + * g++spec.c (lang_specific_driver): Quote argument after `-Xlinker'. + +2001-08-07 Nathan Sidwell + + PR c++/3820 + Stop using TYPE_NONCOPIED_PARTS. + * call.c (build_over_call): Be careful when copy constructing + or assigning to an empty class. + * class.c (check_bases_and_members): It has a + COMPLEX_ASSIGN_REF if it has a vptr. + (layout_class_type): Don't add empty class padding to + TYPE_NONCOPIED_PARTS. + (finish_struct_1): Don't add the VFIELD either. + * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): Mention _copy_ + initialization. + +2001-08-07 Jason Merrill + + * tree.c (walk_tree): Walk siblings even if !walk_subtrees. + +2001-08-06 Richard Henderson + + * decl2.c (finish_objects): Pass a symbol_ref and priority to + assemble_{constructor,destructor}. Remove priority handling. + +2001-08-05 Gabriel Dos Reis + + Don't allow template-id in using-declaration. + * decl2.c (validate_nonmember_using_decl): Handle template-ids. + (do_class_using_decl): Likewise. + +2001-08-04 Neil Booth + + * cp/spew.c (read_token): No need to pop buffers. + +2001-08-02 Stan Shebs + + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY): Remove, no longer used. + (fnaddr_from_vtable_entry): Remove decl. + * method.c (use_thunk): Update comment. + +2001-08-01 Andrew Cagney + + * repo.c (get_base_filename): Change return value to const char + pointer. + +2001-08-02 Nathan Sidwell + + Kill -fhonor-std. + * NEWS: Document. + * cp-tree.h (flag_honor_std): Remove. + (CPTI_FAKE_STD): Remove. + (std_node): Remove comment about it being NULL. + (fake_std_node): Remove. + * decl.c (in_fake_std): Remove. + (walk_namespaces_r): Remove fake_std_node check. + (push_namespace): Remove in_fake_std code. + (pop_namespace): Likewise. + (lookup_name_real): Remove fake_std_node check. + (init_decl_processing): Always create std_node. Always add + std:: things there. + (builtin_function): Always put non '_' fns in std. + * decl2.c (flag_honor_std): Remove. + (lang_f_options): Remove honor-std. + (unsupported_options): Add honor-std. + (set_decl_namespace): Remove fake_std_node check. + (validate_nonmember_using_decl): Likewise. + (do_using_directive): Likewise. + (handle_class_head): Likewise. + * dump.c (cp_dump_tree): Likewise. + * except.c (init_exception_processing): Adjust. + * init.c (build_member_call): Remove fake_std_node check. + (build_offset_ref): Likewise. + * lang-options.h: Remove -fhonor-std, -fno-honor-std. + * rtti.c (init_rtti_processing): Adjust. + +2001-07-31 Alexandre Petit-Bianco + + * tree.c (cp_tree_equal): WITH_CLEANUP_EXPR node to use its second + operand while calling cp_tree_equal. + +2001-07-31 Nathan Sidwell + + The 3.0 ABI no longer has vbase pointer fields. + * cp-tree.h (VBASE_NAME, VBASE_NAME_FORMAT, VBASE_NAME_P, + FORMAT_VBASE_NAME): Remove. + * method.c (do_build_copy_constructor): Adjust. + (do_build_assign_ref): Adjust. + * search.c (lookup_field_r): Adjust. + * typeck.c (build_component_ref): Adjust. + + The 3.0 ABI always has a vtable pointer at the start of every + polymorphic class. + * rtti.c (build_headof_sub): Remove. + (build_headof): Adjust. + (get_tinfo_decl_dynamic): No need to check flag_rtti + here. Adjust. + (create_real_tinfo_var): Explain why we need a hidden name. + +2001-07-31 Nathan Sidwell + + PR c++/3631 + * class.c (update_vtable_entry_for_fn): The fixed adjustment + of a virtual thunk should be from declaring base. + +2001-07-31 Nathan Sidwell + + * class.c (dfs_ctor_vtable_bases_queue_p): Always walk into + the shared virtual base, so preserving inheritance graph order. + +2001-07-30 Andreas Jaeger + + * decl2.c: Remove unused var global_temp_name_counter. + +2001-07-28 Richard Henderson + + * method.c (pending_inlines): Remove. + +2001-07-27 Nathan Sidwell + + * class.c (mark_primary_virtual_base): Don't adjust base + offsets here. + (dfs_unshared_virtual_bases): Adjust them here. + (mark_primary_bases): Explain why we adjust at the end. + +2001-07-27 Nathan Sidwell + + * class.c (finish_struct_1): When copying the primary base's + VFIELD, make sure we find it is at offset zero. + +2001-07-26 Kriang Lerdsuwanakij + + * pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and + tsubst_expr for default template arguments. + +2001-07-26 Nathan Sidwell + + PR c++/3621 + * spew.c (yylex): Only copy the token's lineno, if it is + nonzero. + +2001-07-26 Nathan Sidwell + + PR c++/3624 + * call.c (resolve_args): Simplify, call + convert_from_reference. + (build_new_op): Resolve and convert from reference ARG1 + earlier. Adjust ARG2 & ARG3 resolve and conversion. + +2001-07-26 Nathan Sidwell + + * decl.c (last_function_parm_tags): Remove. + (current_function_parm_tags): Remove. + (init_decl_processing): Adjust. + (start_function): Adjust. + (store_parm_decls): Adjust. + + PR c++/3152 + * decl.c (grokdeclarator): Detect when a function typedef is + declaring a function, and create last_function_parms correctly. + +2001-07-25 Jason Merrill + + * call.c (joust): Only prefer a non-builtin candidate to a builtin + one if they have the same signature. + + * cvt.c (build_up_reference): Take DECL parm. Check TREE_STATIC on + it rather than toplevel_bindings_p. Give it a mangled name if static. + (convert_to_reference): Adjust. + * decl2.c (get_temp_name): Lose. + * mangle.c (mangle_ref_init_variable): New fn. + (mangle_guard_variable): Strip the ref-init header. + * cp-tree.h: Adjust. + * decl.c (cp_finish_decl): Add the DECL_STMT after processing the + initializer. + (grok_reference_init): Always use DECL_INITIAL. + +2001-07-25 Nathan Sidwell + + PR c++/3416 + * call.c (build_conditional_expr): Recheck args after + conversions. + * cp-tree.h (build_conditional_expr): Move to correct file. + * typeck.c (decay_conversion): Diagnose any unknown types + reaching here. + (build_binary_op): Don't do initial decay or default + conversions on overloaded functions. + (build_static_cast): Don't do a decay conversion here. + +2001-07-25 Nathan Sidwell + + PR c++/3543 + * typeck.c (condition_conversion): Resolve an OFFSET_REF. + * expr.c (cplus_expand_expr): An OFFSET_REF should never get here. + +2001-07-25 Nathan Sidwell + + * class.c (build_vtbl_or_vbase_field): Remove, move into ... + (create_vtbl_ptr): ... here. + +2001-07-25 Nathan Sidwell + + * class.c (build_vbase_offset_vbtl_entries): Look for + non-primary base of which we are a sub vtable. + +2001-07-24 Phil Edwards + + * semantics.c (finish_this_expr): Remove unused code. + +2001-07-24 Nathan Sidwell + + Simplify rtti, now we've only one ABI. + * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID, + CPTI_TINFO_VAR_ID. + (tinfo_decl_id, tinfo_var_id): Remove. + (get_typeid_1): Remove. + * rtti.c + (init_rtti_processing): Remove tinfo_decl_id & tinfo_var_id. + (typeid_ok_p): New function. + (build_type_id): Call typeid_ok_p. Don't call tinfo_from_decl. + (get_tinfo_decl): Remove old abi documentation. + (tinfo_from_decl): Remove. + (get_type_id): Call typeid_ok_p. Absorb get_typeid_1. + (get_typeid_1): Remove. + (get_base_offset): Remove. + (synthesize_tinfo_var): Absorb get_base_offset. + (create_real_tinfo_var): Don't use tinfo_decl_id. + +2001-07-23 Graham Stott + + * cp/class.c (type_requires_array_cookie): Fix use of uninitialized + variable has_two_argument_delete_p. + +2001-07-21 Nathan Sidwell + + Remove flag_vtable_thunk. It is always on for the 3.0 ABI. + * cp-tree.h (CPTI_DELTA2_IDENTIFIER): Remove. + (CPTI_INDEX_IDENTIFIER): Remove. + (CPT_PFN_OR_DELTA2_IDENTIFIER): Remove. + (delta2_identifier): Remove. + (index_identifier): Remove. + (pfn_or_delta2_identifier): Remove. + (flag_vtable_thunks): Remove. + (VTABLE_DELTA2_NAME): Remove. + (VTABLE_INDEX_NAME): Remove. + (FNADDR_FROM_VTABLE_ENTRY): Adjust. + (vfunc_ptr_type_node): Adjust. + (VTABLE_NAME_PREFIX): Adjust. + (build_vfn_ref): Lose first parameter. + (fixup_all_virtual_upcast_offsets): Remove. + * decl.c (initialize_predefined_identifiers): Remove + delta2_identifier, index_identifier, pfn_or_delta2_identifier. + (init_decl_processing): Remove no-vtable-thunk code. + * decl2.c (flag_vtable_thunks): Remove. + (mark_vtable_entries): Remove no-vtable-thunk code. + * error.c (dump_decl): Remove no-vtable-thunk code. + (dump_expr): Adjust ptr to member function code. + * init.c (initialize_vtable_ptrs): Remove no-vtable-thunk + code. + * rtti.c (build_headof): Remove no-vtable-thunk code. + (get_tinfo_decl_dynamic): Adjust build_vfn_ref call. + * search.c (get_base_distance): Remove expand_upcast_fixups case. + (virtual_context) Remove. + (expand_upcast_fixups): Remove. + (fixup_virtual_upcast_offsets): Remove. + (fixup_all_virtual_upcast_offsets): Remove. + * typeck.c (get_member_function_from_ptrfunc): Remove + no-vtable-thunk code. + * call.c (build_over_call): Adjust call to build_vfn_ref. + * class.c (build_vfn_ref): Lose first parameter. Remove + no-vtable-thunk code. + (build_rtti_vtbl_entries): Remove no-vtable-thunk code. + (build_vtable_entry): Remove no-vtable-thunk code. + +2001-07-20 Nathan Sidwell + + Remove old-abi remnants. Remove comments about old abi + behavior. Remove references to 'new-abi' in comments. + * cp-tree.h: Adjust comments. + (vbase_offsets_in_vtable_p): Delete. + (vcall_offsets_in_vtable_p): Delete. + (vptrs_present_everywhere_p): Delete. + (all_overridden_vfuns_in_vtables_p): Delete. + (merge_primary_and_secondary_vtables_p): Delete. + (TYPE_CONTAINS_VPTR_P): Adjust. + (VTT_NAME_PREFIX): Remove. + (CTOR_VTBL_NAME_PREFIX): Remove. + (init_vbase_pointers): Remove. + * class.c: Adjust coments. + (build_vbase_pointer_fields): Delete. + (build_vbase_pointer): Remove old-abi code. + (build_secondary_vtable): Likewise. + (modify_all_vtables): Likewise. + (create_vtable_ptr): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Likewise. + (finish_vtbls): Likewise. + (dfs_finish_vtbls): Delete. + (build_vbase_offset_vtbl_entries): Remove old-abi code. + * cvt.c: Adjust comments. + * decl.c: Adjust comments. + * decl2.c: Adjust comments. + * init.c: Adjust comments. + (construct_virtual_bases): Remove old-abi code. + * lang-specs.h: Remove -fno-new-abi. + * mangle.c: Adjust comments. + * rtti.c: Adjust comments. + (get_base_offset): Remove old-abi-code. + * search.c: Adjust comments. + (dfs_init_vbase_pointers): Remove. + (dfs_vtable_path_unmark): Remove. + (init_vbase_pointers): Remove. + * semantics.c: Adjust comments. + (emit_associated_thunks): Remove old-abi code. + * typeck.c: Adjust comments. + +2001-07-20 Daniel Berlin + + * Make-lang.in (cp/optimize.o): Depend on $(PARAMS_H), not + params.h. + +2001-07-19 Mark Mitchell + + * class.c (finish_struct_anon): Forbid nested classes. + +2001-07-19 Neil Booth + + * decl2.c: Don't include dwarfout.h and dwarf2out.h. + * optimize.c: Include debug.h. + (maybe_clone_body): Use debug hook. + * semantics.c: Include debug.h. + (expand_body): Use debug hook. + +2001-07-19 Neil Booth + + * spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases. + +2001-07-18 Mark Mitchell + + * class.c (type_requires_array_cookie): New function. + (check_methods): Don't try to figure out whether the type needs a + cookie here. + (check_bases_and_members): Set TYPE_VEC_NEW_USES_COOKIE here. + * cp-tree.h (TYPE_VEC_DELETE_TAKES_SIZE): Remove. + (TYPE_VEC_NEW_USES_COOKIE): Reimplement. + * pt.c (instantiate_class_template): Don't set + TYPE_VEC_DELETE_TAKES_SIZE. + * NEWS: Document ABI changes from GCC 3.0. + +2001-07-18 Xavier Delacour , + Gerald Pfeifer + + * NEWS (Changes in GCC 3.0): Fix typo. + +2001-07-13 Joseph S. Myers + + * decl2.c (cplus_decl_attributes): Take a pointer to the node to + which attributes are to be attached, and a flags argument. Update + call to decl_attributes. + (grokfield): Update call to decl_attributes. + * class.c (finish_struct): Update call to cplus_decl_attributes. + * cp-tree.h (cplus_decl_attributes): Update prototype. + * decl.c (start_decl, grokdeclarator, start_function): Update + calls to decl_attributes and cplus_decl_attributes. + * friend.c (do_friend): Update call to cplus_decl_attributes. + * parse.y (parse_bitfield): Update call to cplus_decl_attributes. + +2001-07-12 Mark Mitchell + + * decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER + for `register' variables with an asm-specification. + +2001-07-11 Mark Mitchell + + * semantics.c (finish_asm_stmt): Mark the output operands + to an asm addressable, if necessary. + +2001-07-11 Ben Elliston + + * Revert this change -- there is a subtle bug. + + PR c++/80 + * decl.c (finish_enum): New "attributes" argument; pass it to + cplus_decl_attributes. Use a narrower type if the enum is packed. + * cp-tree.h (finish_enum): Adjust prototype. + * parse.y (enum_head): New non-terminal. + (structsp): Use it. Enums now may be preceded or followed by + optional attributes -- pass their chained tree to finish_enum(). + * pt.c (tsubst_enum): Pass NULL_TREE for the new argument. + +2001-07-10 Mark Mitchell + + * pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope + variables. + +2001-07-10 Jason Merrill + + * semantics.c (cp_expand_stmt): Fix for null + current_function_return_value. + +2001-07-10 Jan van Male + + * call.c (build_op_delete_call): Initialize fn. + (convert_like_real): Delete conditional. + (joust): Initialize *w and *l. + * class.c: Add prototype for binfo_ctor_vtable. + (get_primary_binfo): Initialize result. + * init.c (build_java_class_ref): Initialize name. + +2001-07-09 Erik Rozendaal + + * typeck.c (unary_complex_lvalue): Do not duplicate the + argument to modify, pre-, or post-increment when used as an + lvalue and when the argument has side-effects. + +2001-07-08 Joseph S. Myers + + * decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES. + (start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. Call + cplus_decl_attributes even if attrs is NULL. + * friend.c (do_friend): Don't call SET_DEFAULT_DECL_ATTRIBUTES. + +2001-07-08 Joseph S. Myers + + * decl.c (grokdeclarator), decl2.c (cplus_decl_attributes): Update + calls to decl_attributes. + +2001-07-06 Ira Ruben + + * cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should + be DECL_TEMPLATE_RESULT. + +2001-07-05 Kriang Lerdsuwanakij + + * cp-tree.h (copy_template_template_parm): Rename to ... + (bind_template_template_parm): ... here. + * tree.c (copy_template_template_parm): Rename to ... + (bind_template_template_parm): ... here. Remove the case when + NEWARGS is NULL_TREE. + (copy_tree_r): Don't copy TEMPLATE_TEMPLATE_PARM and + BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (lookup_template_class): Adjust. + +2001-07-05 Jason Merrill + + * cvt.c (convert_lvalue): New fn. + * cp-tree.h: Declare it. + * method.c (do_build_assign_ref): Use it. + (do_build_copy_constructor): Convert parm to base types + before calling base constructors. + + * typeck.c (check_return_expr): Check DECL_ALIGN instead of + DECL_USER_ALIGN. Check flag_elide_constructors instead of + optimize. + * semantics.c (cp_expand_stmt): Don't destroy the named return value. + +2001-07-02 Nathan Sidwell + + * optimize.c (optimize_inline_calls): New function, broken out + of ... + (optimize_function): ... here. Call it. Don't inline if it is + a thunk. + (dump_function): Print name of dump flag causing this dump. + * semantics.c (expand_body): Move thunk inline check to + optimize_function. + +2001-06-29 Joseph S. Myers + + * typeck.c (COMP_TYPE_ATTRIBUTES): Don't define. + (comptypes): Use target.comp_type_attributes. + +2001-06-29 Nathan Sidwell + + * cp-tree.h (flag_dump_class_layout): Remove unneeded declaration. + +2001-06-28 Gabriel Dos Reis + + * error.c (lang_print_error_function): Add a `diagnostic_context *' + parameter. Tweak. + +2001-06-27 Neil Booth + + * decl2.c (import_export_class): Update. + +2001-06-26 Gabriel Dos Reis + + * error.c (init_error): Adjust settings. + +2001-06-26 Gabriel Dos Reis + + * error.c (init_error): Adjust settings. + +2001-06-19 Richard Sandiford + + * except.c (initialize_handler_parm): Expect __cxa_begin_catch to + return pointers to data members by reference rather than by value. + +2001-06-18 Jason Merrill + + Implement the Named Return Value optimization. + * cp-tree.h (struct cp_language_function): Add x_return_value. + (current_function_return_value): Now a macro. + * decl.c: Don't define it. + (define_label, finish_case_label): Don't clear it. + (init_decl_processing): Don't register it with GC. + * semantics.c (genrtl_finish_function): Don't check it for + no_return_label. Copy the RTL from the return value to + current_function_return_value and walk, calling... + (nullify_returns_r): ...this new fn. + * typeck.c (check_return_expr): Set current_function_return_value. + +2001-06-15 Jason Merrill + + * class.c (dfs_accumulate_vtbl_inits): Just point to the base we're + sharing a ctor vtable with. Merge code for cases 1 and 2. + (binfo_ctor_vtable): New fn. + (build_vtt_inits, dfs_build_secondary_vptr_vtt_inits): Use it. + +2001-06-14 Jason Merrill + + * class.c (dfs_find_final_overrider): Fix logic. + + * class.c (update_vtable_entry_for_fn): Uncomment optimization to use + virtual thunk instead of non-virtual. + (get_matching_virtual): Uncomment. + + * pt.c (unify): Don't recurse between the POINTER_TYPE and the + OFFSET_TYPE. If we're adding cv-quals, the extra ones would be on + PARM, not ARG. + +2001-06-14 Nathan Sidwell + + * class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure + we've not emerged from the hierarchy of RTTI_BINFO on reaching + a non-virtual base. + +2001-06-13 Mark Mitchell + + * NEWS: Update release number. + +2001-06-12 Nathan Sidwell + + PR c++/3130, c++/3131, c++/3132 + * cp-tree.h (BINFO_UNSHARED_MARKED): New #define. + * class.c (force_canonical_binfo_r): Move + BINFO_UNSHARED_MARKED, BINFO_LOST_PRIMARY_P. Don't move + virtual bases unless they're primary and what they're primary + too has been moved. + (dfs_unshared_virtual_bases): Use BINFO_UNSHARED_MARKED. Cope + with morally virtual bases. Duplicate BINFO_LOST_PRIMARY_P and + BINFO_PRIMARY_BASE_OF. Clear BINFO_VTABLE for all but the most + derived binfo. + (mark_primary_bases): Use BINFO_UNSHARED_MARKED. + (layout_nonempty_base_or_field): Add most derived type + parameter. Adjust. + (layout_empty_base): Likewise. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (propagate_binfo_offsets): Add most derived type + parameter. Skip non canonical virtual bases too. + (dfs_set_offset_for_unshared_vbases): Don't skip primary + bases. Do skip canonical bases. + (layout_virtual_bases): Adjust. + (layout_class_type): Adjust. + (dfs_get_primary_binfo): Build list of virtual primary base + candidates. + (get_primary_binfo): Check that the shared virtual primary + base candidate was found first. + (accumulate_vtbl_inits): Don't do anything for non-vptr + containing binfos. For case 1 primary virtual bases, keep + checking that we've not emerged from the hierarchy of RTTI_BINFO. + +2001-06-12 Nathan Sidwell + + PR c++/3089 + * class.c (dfs_accumulate_vtbl_inits): Always walk down the + hierarchy looking for primary bases for a ctor + vtable. Recursively call oneself, if we meet our primary via + this route and haven't met it yet via inheritance graph order. + +2001-06-11 Mark Mitchell + + * lang-options.h: Emit documentation for -fno-honor-std, not + -fhonor-std. + +2001-06-10 Alexandre Oliva + + * typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]: + Don't clobber delta. + (expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn. + +2001-06-10 Mark Mitchell + Gabriel Dos Reis + + * Make-lang.in (cp/call.o): Depend on diagnostic.h + (cp/typeck.o): Depend on diagnostic.h + (cp/typeck2.o): Depend on diagnostic.h + (cp/repo.o): Depend on dignostic.h + * typeck.c: #include diagnostic.h + (convert_for_initialization): Remove extern declaration for + warningcount and errorcount. + + * call.c: #include diagnostic.h + (convert_like_real): Remove extern declaration for warnincount and + errorcount. + + * repo.c: #include diagnostic.h + * typeck2.c: #include diagnostic.h + +2001-06-08 Nathan Sidwell + + * decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko + in previous change. + +2001-06-08 Nathan Sidwell + + PR c++/2929 + * friend.c (do_friend): Use push_decl_namespace for classes at + namespace scope. + +2001-06-08 Nathan Sidwell + Jason Merrill + + PR c++/3061 + * class.c (build_secondary_vtable): Use assert, rather than an error + message. + (dfs_fixup_binfo_vtbls): BINFO_VTABLE might be NULL. + (dfs_accumulate_vtbl_inits): A lost primary virtual base may + be between ORIG_BINFO and RTTI_BINFO, but neither of them. + Don't set BINFO_VTABLE for a primary virtual base. + +2001-06-07 Mark Mitchell + + * decl.c (duplicate_decls): Update source position information + when a template function is defined. + +2001-06-07 Phil Edwards + + * lang-specs.h: Move -D_GNU_SOURCE to config/linux.h. + +2001-06-07 Nathan Sidwell + + PR c++/2914 + * decl.c (pushtag): Don't push into a complete type's scope. + +2001-06-06 Jason Merrill + + * cp-tree.h (THUNK_GENERATE_WITH_VTABLE_P): Lose. + (struct lang_decl_flags): Lose generate_with_vtable_p. + (BV_GENERATE_THUNK_WITH_VTABLE_P): Lose. + * class.c (copy_virtuals): Adjust. + * decl2.c (mark_vtable_entries): Adjust. + * method.c (make_thunk, build_vtable_entry): Adjust. + * class.c (update_vtable_entry_for_fn): Only look as far as the + first defining class. + (build_vtbl_initializer): Put nothing in the slot for a function only + defined in a lost primary virtual base. + (add_vcall_offset_vtbl_entries_1): Use the same code for + the lost primary case and the normal case. + (dfs_unshared_virtual_bases): Don't lose a non-virtual primary base. + (get_vfield_offset, get_derived_offset): Lose. + (dfs_find_final_overrider): Use look_for_overrides_here. + (get_matching_virtual): New fn. + * semantics.c (emit_associated_thunks): Check BV_USE_VCALL_INDEX_P, + not BV_VCALL_INDEX. + * search.c (look_for_overrides_here): Split out from... + (look_for_overrides_r): Here. + + * class.c (find_final_overrider): Return error_mark_node on error. + + * decl2.c (key_method): #if 0 accidental change. + +2001-06-06 John David Anglin + + * call.c (convert_default_arg): Use INTEGRAL_TYPE_P. + (build_over_call): Likewise. + * decl.c (grokparms): Likewise. + * pt.c (tsubst_decl): Likewise. + * typeck.c (convert_arguments): Likewise. + +2001-06-05 Mark Mitchell + + * semantics.c (begin_class_definition): Robustify. + + * pt.c (instantiate_decl): Tell the repository code about the + clones, not the cloned functions. + * repo.c (repo_template_used): Explicitly instantiate the cloned + function, not the clones. + +2001-06-05 Nathan Sidwell + + * call.c (build_user_type_conversion_1): Set ICS_USER_FLAG and + ICS_BAD_FLAG on created conversion. + (compare_ics): Break out rank. + +2001-06-05 Nathan Sidwell + + * decl.c (xref_tag): Remove extraneous %s on dependent name + lookup warning. + +2001-06-05 Nathan Sidwell + + * class.c (layout_vtable_decl): Fix off by one error on + build_index_type. + (build_vtt): Likewise. + (build_ctor_vtbl_group): Likewise. + +2001-06-05 Nathan Sidwell + + * class.c (maybe_indent_hierarchy): New function. + (dump_class_hierarchy_r): Add flags. Dump extra binfo + information, if enabled. Use maybe_indent_hierarchy. Adjust + output format. + (dump_class_hierarchy): Adjust prototype. Adjust output format. + (dump_array, dump_vtable, dump_vtt): New functions. + (finish_struct_1): Adjust hierarchy dumping. + (initialize_vtable): Call dump_vtable. + (build_vtt): Call dump_vtt. + (build_ctor_vtbl_group): Call dump_vtable. + * decl2.c (flag_dump_class_layout): Remove. + (cxx_decode_option): Remove dump translation unit + and dump class hierarchy check. Call dump_switch_p. + (finish_file): Adjust dumping. + (dump.c): Only dump base classes if not TDF_SLIM. + Only dump namespace members if not TDF_SLIM. + * optimize.c (dump_function): New function. + (optimize_function): Call dump_function. + * semantics.c (expand_body): Use dump_enabled_p. + +2001-06-01 Nathan Sidwell + + PR g++/2936 + Part missed from first commit + * decl2.c (finish_anon_union): Copy context. + +2001-05-30 Nathan Sidwell + + PR g++/2936 + * optimize.c (remap_decl): Remap anonymous aggregate members too. + +2001-05-26 Nathan Sidwell + + PR g++/2823 + * semantics.c (expand_body): Don't optimize thunks. + +2001-05-25 Sam TH + + * cp-tree.h lex.h: Fix header include guards. + +2001-05-25 Mark Mitchell + + * decl.c (init_decl_processing): Tweak. + +2001-05-24 Mark Mitchell + + * decl.c (duplicate_decls): Tidy. + (init_decl_processing): Always set flag_no_builtin. + +2001-05-24 Nathan Sidwell + + PR c++/2184 + * decl2.c (do_local_using_decl): Push the decls, even in a + template. + +2001-05-22 Mark Mitchell + + * optimize.c (initialize_inlined_parameters): Don't set + TREE_READONLY for a VAR_DECL taking the place of an inlined + PARM_DECL. + +2001-05-22 Jason Merrill + + * class.c, cp-tree.h, rtti.c: Remove com_interface attribute support. + * tree.c (cp_valid_lang_attribute): Warn about use of com_interface + attribute. + +2001-05-22 Joseph S. Myers + + * parse.y: Refer to compound literals as such, not as + constructor-expressions. + +2001-05-21 Mark Mitchell + + * call.c (build_op_delete_call): Ignore exception-specifications + when looking for matching delete operators. + * init.c (build_new_1): Compute whether or not the allocation + function used is a placement allocation function or not, and + communicate this information to build_op_delete_call. + +2001-05-21 Jason Merrill + + * class.c (build_vtable_entry_ref): Lose vtbl parm. Fix for new abi. + (build_vtbl_ref): Adjust. + (dfs_accumulate_vtbl_inits): Set TREE_CONSTANT on the vtable address. + * decl2.c (lang_f_options): Remove huge-objects, vtable-thunks. + Re-add vtable-gc. + (unsupported_options): Correspondingly. + + * decl2.c (maybe_make_one_only): Check flag_weak, not + supports_one_only(). + + * cp-tree.def (START_CATCH_STMT): Lose. + * dump.c (cp_dump_tree): Don't dump it. Do dump HANDLER_PARMS. + * tree.c (cp_statement_code_p): Don't case it. + * semantics.c (cp_expand_stmt): Likewise. + * cp-tree.h (START_CATCH_TYPE): Lose. + (HANDLER_TYPE): New. + * except.c (expand_start_catch_block): Don't start any blocks. + Return the type. + (expand_end_catch_block): Don't end any blocks. + * parse.y (handler): Don't pass anything from finish_handler_parms + to finish_handler. + * pt.c (tsubst_expr): Likewise. + * semantics.c (begin_handler): Call note_level_for_catch here. + (finish_handler_parms): Don't return anything. + (genrtl_catch_block, begin_catch_block): Lose. + (genrtl_handler): Call expand_start_catch here. + +2001-05-18 Jason Merrill + + * class.c (build_vtable): Set DECL_ASSEMBLER_NAME for vtables here. + (get_vtable_decl, build_vtt): Not here. + +2001-05-20 Nathan Sidwell + + PR c++/2781 + * optimize.c (update_cloned_parm): Copy addressability and other + flags. + +2001-05-20 Kriang Lerdsuwanakij + + * pt.c (determine_specialization): Ignore artificial functions. + +2001-05-20 Neil Booth + + * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. + (C_RID_CODE): Remove. + * lex.c (cxx_init_options): Call set_identifier_size. Update. + (init_parse): Don't do it here. + +2001-05-18 Diego Novillo + + * decl2.c (finish_objects): Use the original SYMBOL_REF from the + function declaration to avoid stripping the symbol's attributes. + +2001-05-18 Nathan Sidwell + + * decl.c (pushdecl): Adjust error string. + (xref_tag): Adjust friend class injection warning. Remove the + inherited name from the class shadowed scope. + +2001-05-17 Mark Mitchell + + * except.c (cp_protect_cleanup_actions): New function. + (init_exception_processing): Don't set protect_cleanup_actions + here. Do set lang_protect_cleanup_actions. + +2001-05-16 Nathan Sidwell + + * spew.c (read_token): Call yyerror on all unexpected tokens. + +2001-05-16 Nathan Sidwell + + * init.c (member_init_ok_or_else): Take a tree rather than + string for name. + (expand_member_init): Adjust. + +2001-05-14 Nick Clifton + + * decl.c (duplicate_decls): Suppress warning about duplicate + decls if the first decl is a friend. + +2001-05-12 Zack Weinberg + + * except.c (choose_personality_routine): Export. Add + explanatory comment. Take an enum languages, not a boolean. + (initialize_handler_parm): Adjust to match. + * cp-tree.h: Prototype choose_personality_routine. + * lex.c (handle_pragma_java_exceptions): New function. + (init_cp_pragma): Register #pragma GCC java_exceptions. + +2001-05-12 Neil Booth + + * method.c (build_mangled_C99_name): Remove unused prototype. + +2001-05-12 Alexandre Oliva + + * cp-tree.h (ptrmemfunc_vbit_where_t): Declare type. + * typeck.c (get_member_function_from_ptrfunc, + build_ptrmemfunc, expand_ptrmemfunc_cst): Take + TARGET_PTRMEMFUNC_VBIT_LOCATION into account. + + Reverted Geoff Keating's 2001-05-03's patch. + +2001-05-11 Ira Ruben + + * cp/cp-tree.h (C_EXP_ORIGINAL_CODE): Delete; declared in c-common.h. + +2001-05-11 Neil Booth + + * cp-tree.h (finish_label_expr, lookup_label): Delete. + * parse.y: Update for '&&'; don't issue warning here. + * semantics.c (finish_label_expr): Delete. + +2001-05-07 Mark Mitchell + + * splay-tree.h (splay_tree_max): New function. + (splay_tree_min): Likewise. + +2001-05-03 Geoffrey Keating + + * cp-tree.h (enum cp_tree_index): Add CPTI_PFN_VFLAG_IDENTIFIER. + (pfn_vflag_identifier): Define. + Update comment about layout of pointer functions. + (build_ptrmemfunc1): Update prototype. + (expand_ptrmemfunc_cst): Update prototype. + * decl.c (initialize_predefined_identifiers): Initialize + pfn_vflag_identifier. + (build_ptrmemfunc_type): When FUNCTION_BOUNDARY < 16, add + an extra field to the type. + * expr.c (cplus_expand_constant): Pass 'flag' between + expand_ptrmemfunc_cst and build_ptrmemfunc1. + * typeck.c (get_member_function_from_ptrfunc): When + FUNCTION_BOUNDARY < 16, look at additional field to determine + if a pointer-to-member is a real pointer or a vtable offset. + (build_ptrmemfunc1): Add new parameter to contain extra field. + (build_ptrmemfunc): Pass the extra field around. + (expand_ptrmemfunc_cst): Add new parameter to return extra field. + (pfn_from_ptrmemfunc): Ignore the extra field. + +2001-05-03 Mark Mitchell + + * cp-tree.h (flag_inline_trees): Update documentation. + * decl.c (init_decl_processing): Adjust handling of + flag_inline_functions and flag_inline_trees to support -O3. + (grokfndecl): Set DECL_INLINE on all functions if that's what + the user requested. + (save_function_data): Clear DECL_INLINE in + current_function_cannot_inline is non-NULL. + * decl2.c (flag_inline_trees): Update documentation. + +2001-05-03 Nathan Sidwell + + * dump.c (cp_dump_tree, USING_STMT case): New case. + * tree.c (cp_statement_code_p): Add USING_STMT. + * decl2.c (do_using_directive): Add the using directive statement. + + * tree.c (walk_tree): Reformat an if block. + +2001-05-02 Mark Mitchell + + * decl.c (compute_array_index_type): Don't try to do anything with + the indices when processing a template. + +2001-05-02 Kaveh R. Ghazi + + * call.c: NULL_PTR -> NULL. + * class.c: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * init.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2001-05-02 Mark Mitchell + + * decl2.c (do_using_directive): Revert previous patch. + +2001-05-01 Nathan Sidwell + + * cp-tree.def (USING_STMT): New statement node. + * cp-tree.h (USING_STMT_NAMESPACE): New macro. + * decl2.c (do_using_directive): Add USING_STMT to statement + tree. Don't emit errors when processing template decl. + * pt.c (tsubst_expr, USING_STMT case): New case. + * semantics.c (cp_expand_stmt, USING_STMT case): New case. + +2001-05-01 Nathan Sidwell + + * call.c (build_new_op): Convert args from reference here. + (build_conditional_expr): Don't convert here. + +2001-05-01 Nathan Sidwell + + * spew.c (last_token_id): New static variable. + (read_token): Set it here. + (yyerror): Use it here. + +2001-04-30 Richard Henderson + + * cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations. + * decl.c: Likewise. + +2001-04-30 Mark Mitchell + + * gxxint.texi: Remove. + * Make-lang.in: Remove all traces of gxxint.texi. + +2001-04-30 Mark P Mitchell + + * decl2.c (start_static_initialization_or_destruction): Correct + logic to handle the -fno-use-cxa-atexit case. + +2001-04-30 Mark Mitchell + + * optimize.c (update_cloned_parm): New function. + (maybe_clone_body): Use it. Update the `this' parameter too. + +2001-04-29 Joseph S. Myers + + * decl2.c (unsupported_options): Add new-abi. + * lang-options.h: Remove no longer supported options. + +2001-04-27 Nathan Sidwell + + * except.c (can_convert_eh): Don't check template parms, + typename types etc. + +2001-04-27 Nathan Sidwell + + * optimize.c (maybe_clone_body): Copy parameter names and locations. + +2001-04-27 Nathan Sidwell + + * cp-tree.h (adjust_clone_args): Prototype new function. + * class.c (adjust_clone_args): New function. + * decl.c (start_function): Call it for in charge ctors. + +2001-04-26 Mark Mitchell + + * method.c (use_thunk): Make sure that thunks really are emitted + when requested. + +2001-04-26 Nathan Sidwell + + * mangle.c (write_chars): New macro. + (hwint_to_ascii): New function + (write_number): Use it. + (write_integer_cst): Deal with really big numbers. + +2001-04-25 Mark Mitchell + + * optimize.c (maybe_clone_body): Copy TREE_PUBLIC before emitting + the clone. + +2001-04-25 Nathan Sidwell + + * decl.c (grokdeclarator): Set context of namespace scope + TYPE_DECLS. + +2001-04-24 Zack Weinberg + + * cp/optimize.c: Include hashtab.h. + (struct inline_data): Add tree_pruner. + (expand_call_inline, expand_calls_inline): Use it when calling + walk_tree. + (optimize_function): Initialize and free tree_pruner. + +2001-04-24 Nathan Sidwell + + Lazy __FUNCTION__ generation. + * cp-tree.def (FUNCTION_NAME): Remove. + * cp-tree.h (function_name_declared_p): Remove. + (cp_fname_init): Prototype. + * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, + don't call declare_function_name. Call start_fname_decls. + (cp_make_fname_decl): Adjust parameters. Generate the name. Don't + clobber the line number. + (cp_fname_init): New function. + (start_function): Call start_fname_decls. + (finish_function): Call finish_fname_decls. + * lex.c (reswords): Add slots for __FUNCTION__ et al. + (rid_to_yy): Add mappings for __FUNCTION__ et al. + * optimize.c (maybe_clone_body): Remove function_name_declared_p. + * parse.y (VAR_FUNC_NAME): New token. + (primary): Add VAR_FUNC_NAME. + * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's + generation. + (tsubst, FUNCTION_NAME case): Remove. + (tsubst_copy, FUNCTION_NAME case): Remove. + (tsubst_expr, DECL_STMT case): Be careful with a + DECL_PRETTY_FUNCTION_P. + (instantiate_decl): Remove function_name_declared_p. + * semantics.c (begin_compound_statement): Don't call + declare_function_name here. + (setup_vtbl_ptr). Don't save & restore function_name_declared_p. + (finish_translation_unit): Call finish_fname_decls. + (expand_body): Remove function_name_declared_p. + * typeck2.c (digest_init): Allow any ERROR_MARK. + +2001-04-24 Nathan Sidwell + + * pt.c (tsubst_decl): Use VOID_TYPE_P. + * semantics.c: Fix some typos. + +2001-04-23 Phil Edwards + + * cp/decl2.c (flag_honor_std): Always initialize to 1. + +2001-04-22 Kaveh R. Ghazi + + * xref.c (GNU_xref_file): Use concat in lieu of xmalloc/sprintf. + +2001-04-23 Jason Merrill + + * except.c (build_throw): Wrap the initialization of the exception + object in a MUST_NOT_THROW_EXPR. + (do_free_exception): #if 0. + +2001-04-20 Mark Mitchell + + * cp-tree.h (finish_enum): Change prototype. + * decl.c (finish_enum): Reorganize. + * parse.y (structsp): Adjust calls to finish_enum. + +2001-04-20 Nathan Sidwell + + * tree.c (cp_tree_equal): Adjust final switch formatting. Add + 't' case. + +2001-04-20 Nathan Sidwell + + * class.c (dfs_unshared_virtual_bases): Add ATTRIBUTE_UNUSED. + (layout_empty_base): Return at end flag. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (layout_virtual_bases): Don't add 1 to eoc value. + (end_of_class): Use full size for empty bases. + (layout_class_type): Clear CLASSNEARLY_EMPTY_P if we appended + empty bases. Don't add 1 to eoc value. Only add trailing padding + if we're an empty class with no empty bases. + (dump_class_hierarchy): Dump size and alignment. + +2001-04-20 Jakub Jelinek + + * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and + ICS_BAD_FLAG. + +2001-04-20 Jakub Jelinek + + * search.c (lookup_field_r): If looking for type and non-TYPE_DECL + is found, look first if name does not match the structure name. + +2001-04-19 Mark Mitchell + + * cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is + set. + (SET_DECL_LANGUAGE): New macro. + * decl.c (duplicate_decls): Use SET_DECL_LANGUAGE. + (pushdecl): Likewise. + (build_library_fn_1): Likewise. + (build_cp_library_fn): Likewise. + (grokfndecl): Likewise. + (grokvardecl): Mark `extern "C"' variables as having C linkage. + * decl2.c (grokclassfn): Use SET_DECL_LANGUAGE. + * lex.c (retrofit_lang_decl): Likewise. + * mangle.c (mangle_decl_string): Don't mangle the names of + variables declared with C language linkage. + * semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE. + +2001-04-18 John David Anglin + + * semantics.c (simplify_aggr_init_exprs_r): Don't restore + flag_access_control from uninitialized storage. + +2001-04-15 Mark Mitchell + + * cp-tree.h (TYPE_PTRMEM_CLASS_TYPE): Improve documentation. + * mangle.c (write_pointer_to_member_type): Fix mangling of + pointers to cv-qualified member function types. + + * init.c (build_delete): Create a SAVE_EXPR for the address if + we're going to use it more than once. + +2001-04-13 Mark Mitchell + + * cp-tree.h (DELTA2_FROM_PTRMEMFUNC): Remove. + (expand_ptremfunc_cst): Change prototype. + (delta2_from_ptrmemfunc): Remove. + * expr.c (cplus_expand_constant): Adjust call to + expand_ptrmemfunc_cst. + * typeck.c (build_ptrmemfunc1): Simplify. + (build_ptrmemfunc): Make sure that casting a PTRMEM_CST still + results in a constant. + (expand_ptrmemfunc_cst): Remove idx and delta2 parameters. + (delta2_from_ptrmemfunc): Remove. + (pfn_from_ptrmemfunc): Adjust call to expand_ptrmemfunc_cst. + +2001-04-12 Jason Merrill + + * cp-tree.h (decl_namespace_list): New macro. + (struct saved_scope): Add decl_ns_list. + * decl.c (mark_saved_scope): Mark it. + * decl2.c: Lose static decl_namespace_list. + (init_decl2): Don't save it. + +2001-04-12 Kaveh R. Ghazi + + * cp-tree.h (warn_return_type, yylex): Delete redundant + declarations. + + * decl.c (current_class_depth, global_namespace): Likewise. + + * decl2.c (current_class_depth, flag_gnu_xref): Likewise + + * repo.c (flag_use_repository): Likewise. + +2001-04-12 Kaveh R. Ghazi + + * cp-tree.h (pedantic, convert, global_bindings_p, insert_block, + set_block, pushdecl, getdecls, gettags, init_decl_processing, + maybe_build_cleanup, copy_lang_decl, prep_stmt, lvalue_p, + lvalue_or_else, print_lang_statistics, comp_target_types, + unsigned_type, signed_type, signed_or_unsigned_type, + build_function_call, mark_addressable, incomplete_type_error): + Delete redundant declarations. + +2001-04-11 Jason Merrill + + * cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro. + (TYPE_ANONYMOUS_P): New macro. + (TAGGED_TYPE_P): New macro. + * decl.c (check_tag_decl): Use TYPE_ANONYMOUS_P. + (grokfndecl, grokvardecl, grokdeclarator): Likewise. + * tree.c (no_linkage_helper): Likewise. + * semantics.c (begin_class_definition): Likewise. + * pt.c (convert_template_argument): Likewise. + * lex.c (check_for_missing_semicolon): Likewise. + +2001-04-12 Nathan Sidwell + + * class.c (dfs_unshared_virtual_bases): New function. + (mark_primary_bases): Call it. + (check_bases): Ignore virtual bases when determining + nearly-emptiness. + +2001-04-12 Nathan Sidwell + + * method.c (make_thunk): Clear DECL_CLONED_FUNCTION. + +2001-04-11 Mark Mitchell + + * optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the + cloned function to the clone. + +2001-04-11 Kaveh R. Ghazi + + * Make-lang.in (cp/semantics.o): Depend on $(EXPR_H). + + * semantics.c: Include expr.h. + +2001-04-11 Nathan Sidwell + + * method.c (implicitly_declare_fn): Commonize code for copy ctor + and assignment op. Set TREE_USED for parameter. + +2001-04-10 Mark Mitchell + + * class.c (find_final_overrider_data): Add `candidates'. + (dfs_find_final_overrider): Don't issue error messages + prematurely. + (find_final_overrider): Issue error messages here. + (build_base_field): Don't warn about amgibuous direct bases here. + (warn_about_ambiguous_direct_bases): New function. + (layout_class_type): Use it. + +2001-04-10 Richard Henderson + + * typeck.c (build_array_ref): Push the array reference inside + COMPOUND_EXPR and COND_EXPR. + +2001-04-05 Mark Mitchell + + * cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P. + * decl.c (duplicate_decls): Adjust accordingly. + (maybe_commonize_var): Likewise. + (grokfndecl): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl2.c (key_method): Likewise. + (import_export_decl): Likewise. + * method.c (implicitly_declare_fn): Likewise. + * optimize.c (maybe_clone_body): Likewise. + +2001-04-05 Benjamin Kosnik + + * lang-specs.h: Add __DEPRECATED. + +2001-04-05 J"orn Rennecke + + * search.c (get_dynamic_cast_base_type): When building a new + constant, set its type to ssizetype. + +2001-04-04 Jakub Jelinek + + * optimize.c (expand_call_inline): Only add newly inlined statements + into inlined_stmts. + +2001-04-03 Mark Mitchell + + * cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove. + (OPERATOR_FORMAT): Likewise. + (OPERATOR_TYPENAME_FORMAT): Likewise. + * operators.def: Remove old name-mangling information. + * decl.c (grok_op_properties): Adjust accordingly. + * lex.c (init_operators): Likewise. + * rtti.c (get_tinfo_decl): Issue error messages about types that + have variable size. + +2001-04-03 Mark Mitchell + + * decl2.c (import_export_decl): Don't call import_export_class + when processing an inline member function. + * semantics.c (expand_body): Call import_export_decl before + emitting inline functions. + +2001-03-28 Richard Henderson + + IA-64 ABI Exception Handling: + * cp-tree.def (EH_SPEC_BLOCK): New. + (MUST_NOT_THROW_EXPR): New. + * cp-tree.h: Update changed function declarations. + (CPTI_PUSH_EXCEPTION_IDENTIFIER): Remove. + (CPTI_CALL_UNEXPECTED): New. + (struct cp_language_function): Rename x_eh_spec_try_block + to x_eh_spec_block. + (EH_SPEC_STMTS, EH_SPEC_RAISES): New. + * decl.c (current_binding_level): If no current function + bindings, revert to scope_chain. + (initialize_predefined_identifiers): Remove __cp_push_exception. + (store_parm_decls): Use begin_eh_spec_block. + (finish_function): Use finish_eh_spec_block. + (mark_lang_function): Update for name changes. + * decl2.c (finish_file): No mark_all_runtime_matches. + * dump.c (cp_dump_tree): Handle new tree codes. + * error.c (dump_expr) [BIND_EXPR]: Fix typo. + * except.c (catch_language_init, catch_language): Remove. + (init_exception_processing): Don't set language code. + Initialize call_unexpected_node, protect_cleanup_actions, + eh_personality_libfunc, lang_eh_runtime_type. + (call_eh_info, push_eh_info, get_eh_info, get_eh_value): Remove. + (get_eh_type, get_eh_caught, get_eh_handlers): Remove. + (prepare_eh_type): Split out type canonicalizations ... + (build_eh_type_type): ... from here. + (build_eh_type_type_ref): Remove. + (mark_all_runtime_matches): Remove. + (build_exc_ptr): New. + (do_begin_catch, do_end_catch): New. + (do_pop_exception): Remove. + (build_terminate_handler): Remove. + (choose_personality_routine): Split out language choice from ... + (initialize_handler_parm): ... here. + Use MUST_NOT_THROW_EXPR. + (expand_start_catch_block): Use do_begin_catch. Simplify Java + exception object handling. + (expand_start_eh_spec, expand_end_eh_spec): Remove. + (expand_exception_blocks, alloc_eh_object): Remove. + (begin_eh_spec_block, finish_eh_spec_block): New. + (do_allocate_exception, do_free_exception): New. + (expand_throw): Merge into ... + (build_throw): ... here. Update for abi. + * expr.c (cplus_expand_expr): No expand_internal_throw. + Handle MUST_NOT_THROW_EXPR. + * pt.c (tsubst_expr): Handle EH_SPEC_BLOCK. + * semantics.c (*) Update for except.h name changes. + (genrtl_try_block): No protect_with_terminate. + (genrtl_eh_spec_block): New. + (genrtl_handler): Don't emit the goto here. + (cp_expand_stmt): Handle EH_SPEC_BLOCK. + (genrtl_finish_function): Don't expand_exception_blocks. + * tree.c (cp_statement_code_p): Handle EH_SPEC_BLOCK. + +2001-03-28 Richard Henderson + + * decl.c (struct named_label_list): Rename eh_region to + in_try_scope, add in_catch_scope. + (struct binding_level): Rename eh_region to is_try_scope, + add is_catch_scope. + (note_level_for_try): Rename from note_level_for_eh. + (note_level_for_catch): New. + (poplevel): Copy both is_try_scope and is_catch_scope to + the named_label_list struct. + (check_previous_goto_1): Don't check for catch block via + DECL_ARTIFICIAL; use in_try_scope instead. + (check_goto): Likewise. + * cp-tree.h (note_level_for_try, note_level_for_catch): Declare. + * except.c (expand_start_catch_block): Call note_level_for_catch. + * semantics.c (begin_compound_stmt): Update for note_level_for_try. + +2001-03-27 Richard Henderson + + * except.c: Use USING_SJLJ_EXCEPTIONS instead of + exceptions_via_longjmp. + +2001-03-27 Phil Edwards + + * pt.c (check_default_tmpl_args): Make error messages clearer. + +2001-03-26 Phil Edwards + + * error.c: Also undefine 'A' macro used for cp_printers definition. + +2001-03-27 Kaveh R. Ghazi + + * Make-lang.in: Depend on $(SYSTEM_H), not system.h. + +2001-03-26 Mike Yang + Mark Mitchell + + * dump.c (dump_access): New function. + (cp_dump_tree): Use it. Dump basetype information for class + types. + +2001-03-26 Mark Mitchell + + * Makefile.in (optimize.o): Depend on params.h. + (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE. + (init_decl_processing): Set flag_no_inline when doing + inlining-on-trees. + * optimize.c: Include params.h. + (struct inline_data): Improve documentation of FNS. Add + FIRST_INLINED_FN, INLINED_STMTS, and CLONING_P. + (INSNS_PER_STMT): New macro. + (remap_block): Use CLONING_P. + (inlinable_function_p): Don't inline big functions. + (expand_call_inline): Keep track of how much inlining we've done. + (optimize_function): Set FIRST_INLINED_FN. + (maybe_clone_body): Set CLONING_P. + * semantics.c (simplify_aggr_init_exprs_r): Fix typing problems in + tree nodes. + (genrtl_finish_function): Clear DECL_DEFER_OUTPUT before calling + rest_of_compilation. Clear DECL_RTL for local variables + afterwards. + (clear_decl_rtl): New function. + +2001-03-26 Nathan Sidwell + + Implement DR 209 + * cp-tree.h (skip_type_access_control, + reset_type_access_control): Prototype. + * decl.c (grokdeclarator): Access of friends is not checked. + * parse.y (component_decl_list): Reset type access control. + * semantics.c (decl_type_access_control): Clear + current_type_lookups. + (save_type_access_control): Don't save if not deferring. + (skip_type_access_control, reset_type_access_control): New + functions. + (begin_class_definition): Do type access control for basetypes. + Start deferred access control. + (finish_class_definition): Resume immediate access control if + this is a local class. + +2001-03-25 Kaveh R. Ghazi + + * class.c (add_method): Use memcpy/memmove, not bcopy. + + * decl.c (duplicate_decls): Likewise. + +2001-03-23 Jakub Jelinek + + * mangle.c (write_discriminator): Use `_0' for discriminator 1, + not `_'. + +2001-03-23 Jakub Jelinek + + * decl.c (local_names): Define. + (push_local_name): New. + (grok_reference_init): Return init if initializing static reference + variable with non-constant instead of emitting it. + Move expand_static_init call to cp_finish_decl. + (layout_var_decl): Call push_local_name. + (maybe_commonize_var): Allow inlining functions even if they have + static local variables, use comdat_linkage for them if flag_weak. + (check_initializer): Call obscure_complex_init if + grok_reference_init returned nonzero. + (save_function_data): Clear x_local_names. + (pop_cp_function_context): Free x_local_names. + (mark_inlined_fns): Remove. + (mark_lang_function): Mark x_local_names. + (lang_mark_tree): Don't mark DECL_ACCESS for DECL_DISCRIMINATOR_P. + Mark inlined_fns as tree, remove call to mark_inlined_fns. + * class.c (alter_access): Ensure DECL_ACCESS is never set if + DECL_DISCRIMINATOR_P. + * cp-tree.h (cp_language_function): Add x_local_names. + (lang_decl_flags): Add discriminator into u2. + (lang_decl_inlined_fns): Remove. + (lang_decl): inlined_fns is now a TREE_VEC. + (DECL_DISCRIMINATOR_P, DECL_DISCRIMINATOR): Define. + * optimize.c (inlinable_function_p): DECL_INLINED_FNS is now a + TREE_VEC, not a custom structure. + (optimize_function): Likewise. + * mangle.c (discriminator_for_local_entity): Discriminate among + VAR_DECL local entities. + * search.c (dfs_access_in_type): If DECL_DISCRIMINATOR_P, DECL_ACCESS + is not valid. + +2001-03-22 Bryce McKinlay + + Add support for Java interface method calls. + * cp-tree.h (struct lang_type): Add java_interface flag. + (TYPE_JAVA_INTERFACE): New macro. + * tree.c (cp_valid_lang_attribute): Handle "java_interface" attribute + by setting TYPE_JAVA_INTERFACE. + * call.c (java_iface_lookup_fn): New static. + (build_over_call): If calling a method declared in a + TYPE_JAVA_INTERFACE, call build_java_interface_fn_ref to generate the + expression which resolves the function address. + (build_java_interface_fn_ref): New function. + +2001-03-22 Richard Henderson + + * Make-lang.in (cp/except.o): Don't depend on insn-flags.h. + * except.c: Don't include it. + +2001-03-22 Gerald Pfeifer + based on an idea from Joe Buck + + * parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore): + New nonterminals. + (data_def, component_decl): Add reductions to bad_decl. + +2001-03-22 Jakub Jelinek + + * method.c (do_build_assign_ref): Don't use build_modify_expr for + anonymous aggregates, since they don't have assignment operator + method. + * decl.c (fixup_anonymous_aggr): Disallow ctors, dtors and copy + assignment operators for anonymous structure fields. + +2001-03-21 Jason Merrill + + * pt.c (instantiate_decl): Abort if we see a member constant + instantiation that doesn't already have its initializer. + Downgrade explicit instantiation without definition to pedwarn. + + * cp-tree.h (DECL_TINFO_FN_P, SET_DECL_TINFO_FN_P): Remove. + * class.c (build_vtable_entry): Don't check DECL_TINFO_FN_P. + (import_export_decl): Check tinfo_decl_p, not DECL_TINFO_FN_P. + + * cp-tree.h (CLASSTYPE_VTABLE_NEEDS_WRITING): Remove. + (pending_vtables): Remove. + * decl2.c (pending_vtables): Remove. + (import_export_vtable): Use CLASSTYPE_INTERFACE_ONLY, not + CLASSTYPE_VTABLE_NEEDS_WRITING. + (import_export_class): Likewise. + (init_decl2): Don't mark pending_vtables. + * lex.c (handle_pragma_vtable): Just sorry. + * pt.c (instantiate_class_template): Don't mess with + CLASSTYPE_VTABLE_NEEDS_WRITING. + (mark_class_instantiated): Likewise. + * ptree.c (print_lang_type): Don't print it. + * semantics.c (begin_class_definition): Don't set it. + + * pt.c (template_tail): Replace with last_pending_template. + (maybe_templates, maybe_template_tail): Remove. + (add_pending_template): Adjust. + (instantiate_pending_templates): Adjust. + + * cp-tree.h (struct saved_scope): Remove lang_stack field. + (current_lang_stack): Remove. + * decl.c (maybe_push_to_top_level): Don't initialize it. + (duplicate_decls): Use current_lang_depth. + (xref_basetypes): Likewise. + * class.c (current_lang_depth): New fn. + (push_lang_context): Use more varray functionality. + (pop_lang_context): Likewise. + + * error.c (GLOBAL_THING): Always use '__'. + +2001-03-21 Mark Mitchell + + * class.c (build_clone): Clear DECL_ASSEMBLER_NAME. + + * mangle.c (mangle_decl_string): Mangle the names of overloaded + operators, even when they have `extern "C"' linkage. + +2001-03-19 Mark Mitchell + + * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (add_method): Remove optimization involving comparison of + DECL_ASSEMBLER_NAME. + (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (check_methods): Likewise. + (build_clone): Likewise. + (built_vtt): Likewise. + * cp-tree.h (DECL_NEEDED_P): Likewise. + * decl.c (pushtag): Likewise. + (duplicate_decls): Likewise. + (pushdecl): Likewise. + (builtin_function): Likewise. + (build_library_fn_1): Set DECL_LANGUAGE for library functions. + (build_cp_library_fn): Likewise. + (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Likewise. + (grokfndecl): Likewise. + (grokvardecl): Likewise. + (grokdeclarator): Likewise. + (start_function): Likewise. + (cp_missing_return_ok_p): Likewise. + * decl2.c (grokclassfn): Likewise. + (check_classfn): Likewise. + (finish_static_data_member_decl): Likewise. + (grokfield): Likewise. + * error.c (GLOBAL_IORD_P): Remove. + (dump_global_iord): Improve output. + (dump_decl): Avoid using DECL_ASSEMBLER_NAME. + * except.c (nothrow_libfn_p): Summarily reject any function not in + namespace-scope. + * init.c (build_java_class_ref): Don't explicitly set + DECL_ASSEMBLER_NAME after calling mangle_decl. + * mangle.c (mangle_decl_string): Handle extern "C" functions. + (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. + * method.c (set_mangled_name_for_decl): Don't explicitly set + DECL_ASSEMBLER_NAME after calling mangle_decl. + (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and + IDENTIFIER_GLOBAL_VALUE for the thunk. + * pt.c (set_mangled_name_for_template_decl): Remove. + (check_explicit_specialization): Don't use it. + (looup_template_class): Don't set DECL_ASSEMBLER_NAME. + (tsubst_friend_function): Likewise. + (tsubst_decl): Likewise. + (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. + * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (tinfo_base_init): Likewise. + (create_real_tinfo_var): Likewise. + * search.c (looup_field_1): Likewise. + * semantics.c (finish_named_return_value): Likewise. + * tree.c (init_tree): Set lang_set_decl_assembler_name. + +2001-03-15 Gabriel Dos Reis + + Correct semantics restrictions checking in throw-expression. + * except.c (is_admissible_throw_operand): New function. + (build_throw): Use it. + +2001-03-14 Mark Mitchell + + * decl.c (cp_make_fnname_decl): Set DECL_IGNORED_P on __FUNCTION__ + and its ilk. + +2001-03-14 Mark Mitchell + + * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. + * cp-tree.h (DECL_IN_MEMORY_P): Likewise. + * decl.c (duplicate_decls): Likewise. + (builtin_function): Likewise. + (build_library_fn): Likewise. + (build_cp_library_fn): Likewise. + (check_initializer): Likewise. + (cp_finish_decl): Likewise. + * decl2.c (grokfield): Likewise. + (grok_function_init): Remove #if 0'd code. + (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. + * friend.c (do_friend): Likewise. + * init.c (get_temp_regvar): Likewise. + * method.c (make_thunk): Likewise. + * pt.c (tsubst_friend_function): Likewise. + (tsubst_decl): Likewise. + (regenerate_decl_from_template): Likewise. + * semantics.c (genrtl_named_return_value): Likewise. + (expand_body): Likewise. + (genrtl_finish_function): Likewise. + * tree.c (cp_tree_equal): Likewise. + +2001-03-12 Nathan Sidwell + + * call.c (convert_like_real): Add extra semantics to INNER + parameter. Don't convert to temporary if a user conversion + gives us an lvalue that we're about to bind to a reference. + Set INNER to indicate pending reference binding on recursive + calls. + +2001-03-10 Neil Booth + + * cp/lex.c: Delete duplicate pending_lang_change. + +2001-03-10 Neil Booth + + * cp/lex.c (handle_pragma_interface, handle_pragma_implementation): + Similarly. + * cp/repo.c (get_base_filename, open_repo_file): Similarly. + * cp/cp-tree.h: Remove file_name_nondirectory prototype. + +2001-03-09 Zack Weinberg + + * Make-lang.in: Add dependencies on $(TM_P_H) as appropriate. + +2001-03-08 Stan Shebs + + * cp-tree.h (set_identifier_local_value): Remove unused decl. + +2001-03-06 Zack Weinberg + + * spew.c: Remove references to CPP_OSTRING. + +2001-03-06 Andrew Haley + + * typeck.c (convert_arguments): Check that we have an fndecl. + +2001-03-05 Andrew Haley + + * typeck.c (convert_arguments): Don't do ellipsis conversion for + __built_in_constant_p. + +2001-03-02 Nathan Sidwell + + * typeck.c (build_static_cast): Allow enum to enum conversions + as per DR 128. + +2001-03-02 Nathan Sidwell + + * class.c (check_field_decls): Pointers to member do not a + non-pod struct make, as per DR 148. + +2001-03-02 Nathan Sidwell + + * call.c (joust): cp_pedwarn when using gnu extension concerning + worst conversion sequences. + +2001-03-01 Zack Weinberg + + * decl.c: Replace all uses of 'boolean' with 'bool'. + +2001-03-01 Zack Weinberg + + * lang-specs.h: Add zero initializer for cpp_spec field to + all array elements that need one. Don't put an #ifdef inside + the initializer list; set a default for CPLUSPLUS_CPP_SPEC and + use it. + +2001-03-01 Nathan Sidwell + + Implement using decls inside template functions. + * decl2.c (validate_nonmember_using_decl): Don't special case + fake_std_node in the global namespace. Don't reject early when + processing a template. + (do_local_using_decl): Add to statement tree. Don't do further + processing when building a template. + * pt.c (tsubst_expr, DECL_STMT case): Deal with USING_DECLs. + +2001-03-01 Nathan Sidwell + + * decl2.c (do_nonmember_using_decl): Don't complain if we find + same function. Do complain about ambiguating extern "C" + declarations. + +2001-02-28 Nathan Sidwell + + Remove floating point and complex type template constant parms. + * pt.c (convert_nontype_argument): Remove REAL_TYPE and + COMPLEX_TYPE extensions. + (invalid_nontype_parm_type_p): Likewise. + +2001-02-27 Jeffrey Oldham + + * except.c (call_eh_info): Revert "match_function"'s type. + +2001-02-27 Nathan Sidwell + + Fix ctor vtable vcall offsets. + * class.c (struct vtbl_init_data_s): Add rtti_binfo member. + (build_rtt_vtbl_entries): Lose RTTI_BINFO parameter. + (get_matching_base): Remove. + (get_original_base): New function. + (build_vtbl_initializer): Initialize vid.rtti_binfo. + Use a virtual thunk for a ctor vtable with an index + (add_vcall_offset_vtbl_entries_1): Check if binfo has lost a + primary base within a constructor vtable. Only set + BV_VCALL_INDEX when not a constructor vtable. Adjust vcall offset + when primary base has been lost. + * cp-tree.h (BINFO_VIRTUALS): Remove ambiguity from comment. + +2001-02-26 Jeffrey Oldham + + * call.c (joust): Ensure more_specialized()'s argument length + parameter has correct value for constructors. + +2001-02-26 Nathan Sidwell + + * except.c (call_eh_info): Cleanup generation of cp_eh_info struct. + + * decl.c (mark_inlined_fns): Prototype. + +2001-02-22 Mark Mitchell + + * spew.c (yylex): Correct handling of friends. + +2001-02-22 Mark Mitchell + + * mangle.c (write_encoding): Pass write_function_type the + FUNCTION_DECL for the function being encoded. + (write_function_type): Pass it along to write_bare_function_type. + (write_bare_function_type): Pass it along to write_method_parms. + (write_method_parms): Don't mangle the compiler-generated + parameters to a constructor or destructor. + +2001-02-22 Andreas Jaeger + + * optimize.c: Include toplev.h for + note_deferral_of_defined_inline_function prototype. + +2001-02-22 Jakub Jelinek + + * cp-tree.h (struct lang_decl_inlined_fns): New. + (struct lang_decls): Add inlined_fns. + (DECL_INLINED_FNS): New macro. + * optimize.c (struct inline_data): Add inlined_fns. + (declare_return_variable): Use VARRAY_ACTIVE_SIZE macro. + (inlinable_function_p): Likewise, fix typo in comment, + function is not inlinable if it already inlined function currently + being optimized. + (expand_call_inline): Add fn to inlined_fns if necessary. + (optimize_function): Initialize inlined_fns. + Save inlined_fns into DECL_INLINED_FNS after expanding inlines. + * decl.c (mark_inlined_fns): New function. + (lang_mark_tree): Call it. + +2001-02-21 Jason Merrill + + * cp-tree.h (struct lang_decl_flags): Remove uninlinable flag. + (DECL_UNINLINABLE): Move to middle-end. + + * class.c (clone_function_decl): Set DECL_ABSTRACT on original fn. + * decl.c (duplicate_decls): Preserve DECL_ABSTRACT. + * class.c (build_clone): Set DECL_ABSTRACT_ORIGIN for the clone. + * optimize.c (maybe_clone_body): Set DECL_ABSTRACT_ORIGIN for the + parms and outer BLOCK. note_deferral_of_defined_inline_function. + + * method.c (implicitly_declare_fn): Don't set DECL_ARTIFICIAL on + second parm of op=. + +2001-02-19 Mark Mitchell + + * decl2.c (set_decl_namespace): Allow explicit instantiations in + any namespace. + +2001-02-18 Kriang Lerdsuwanakij + + * optimize.c (expand_call_inline): Don't walk subtrees of type + nodes. + +2001-02-18 Mark Mitchell + + * class.c (add_vcall_offset_vtbl_entries_1): Only add one entry + for a destructor. + +2001-02-18 Jason Merrill + + Do put the VTT parameter in DECL_ARGUMENTS. + * cp-tree.h (struct cp_language_function): Add x_vtt_parm. + (current_vtt_parm): New macro. + (struct lang_decl_flags): Add has_vtt_parm_p, remove vtt_parm. + (DECL_HAS_VTT_PARM_P): New macro. + (DECL_VTT_PARM): Remove. + (FUNCTION_FIRST_USER_PARMTYPE, FUNCTION_FIRST_USER_PARM): New macros. + * decl.c (duplicate_decls): Only copy the operator code if + appropriate. + (start_function): Set current_vtt_parm. + (lang_mark_tree): Don't mark vtt_parm. + * decl2.c (maybe_retrofit_in_chrg): Do add the VTT parm to + DECL_ARGUMENTS. Set DECL_HAS_VTT_PARM_P. + * class.c (build_clone): Maybe remove the VTT parm. + * optimize.c (maybe_clone_body): Set up the VTT parm. + * pt.c (copy_default_args_to_explicit_spec): Preserve the VTT parm. + * call.c (build_over_call): Just allow the VTT arg. + * method.c (make_thunk): Don't set DECL_VTT_PARM. + (do_build_copy_constructor): Use FUNCTION_FIRST_USER_PARM. + (synthesize_method): Use FUNCTION_FIRST_USER_PARMTYPE. + * decl.c (grokdeclarator, copy_args_p, grok_ctor_properties): Likewise. + * error.c (dump_function_decl): Likewise. + * call.c (build_user_type_conversion_1, convert_like_real): Abort + if we try to call a constructor with in-charge or VTT parms. + * method.c (skip_artificial_parms_for): New fn. + * call.c (add_function_candidate, build_over_call): Call it. + * call.c (build_new_method_call): Use current_vtt_parm. + * init.c (expand_virtual_init): Likewise. + * class.c (same_signature_p): No longer static. + * cp-tree.h: Declare it. + * search.c (look_for_overrides_r): Use it. + +2001-02-17 Mark Mitchell + + * cp-tree.h (new_abi_rtti_p): Remove. + (name_mangling_version): Likewise. + (flag_do_squangling): Likewise. + * class.c (build_rtti_vtbl_entries): Remove old ABI support. + * decl.c (grokfndecl): Likewise. + * decl2.c (name_mangling_version): Remove. + (flag_do_squangling): Likewise. + (lang_f_options): Remove `squangle'. + (unsupported_options): Add `squangle'. + (cxx_decode_option): Issue a warning about uses of + -fname-mangling-version. + (finish_file): Remove old ABI support. + * pt.c (check_explicit_specialization): Likewise. + (tsubst_decl): Likewise. + * rtti.c (init_rtti_processing): Likewise. + (build_headof): Likewise. + (get_tinfo_decl_dynamic): Likewise. + (tinfo_from_decl): Likewise. + (build_dynamic_cast_1): Likewise. + (synthesize_tinfo_var): Likewise. + * init.c (build_new): Allow enumeration types for the array-bounds + in a direct-new-declarator. + + * semantics.c (finish_typeof): Resolve OFFSET_REFs. + + * pt.c (check_explicit_specialization): Copy TREE_PRIVATE and + TREE_PROTECTED from the template being specialized. + +2001-02-17 Jason Merrill + + * decl2.c (build_artificial_parm): Set TREE_READONLY. + + * decl.c (bad_specifiers): Allow throw specs on things with + pointer-to-function or -member-function type. + * init.c (build_default_init): Don't use a CONSTRUCTOR to initialize + a pmf. + +2001-02-17 Mark Mitchell + + * call.c (check_dtor_name): Handle template names correctly. + +2001-02-16 Jason Merrill + + * cp-tree.h (DECL_USE_VTT_PARM): Remove. + * decl2.c (maybe_retrofit_in_chrg): Don't create it. + * optimize.c (maybe_clone_body): Don't substitute it. + * call.c (build_new_method_call): Check in_chrg instead. + * init.c (expand_virtual_init): Likewise. + +2001-02-16 Gabriel Dos Reis + + * decl.c (check_tag_decl): Make sure a typedef for an anonymous + class-type introduces at least a type-name. + +2001-02-16 Jakub Jelinek + + * call.c (convert_like_real): Create a temporary for non-lvalue. + +2001-02-16 Jeffrey Oldham + + * cp-tree.h: Fix typos in comments. + +2001-02-16 Jason Merrill + + * optimize.c (remap_block): If we're compiling a clone, pass the + new block to insert_block. + +2001-02-16 Mark Mitchell + + * semantics.c (finish_asm_stmt): Robustify. + +2001-02-15 Mark Mitchell + + * pt.c (push_template_decl_real): Don't remangle the name of a + class template. + +2001-02-15 Jim Meyering + + * Make-lang.in (c++.install-common): Depend on installdirs. + (c++.install-info): Likewise. + (c++.install-man): Likewise. + +2001-02-15 Mark Mitchell + + * typeck2.c (build_m_component_ref): Robustify. + +2001-02-15 Alexandre Oliva + + * friend.c (do_friend): Don't take the nested [template] class + into account when deciding whether to warn about the friend + function not referring to a template function. + +2001-02-14 Jakub Jelinek + + * typeck.c (build_unary_op): Clarify error message. + +2001-02-08 Aldy Hernandez + + * parse.y (component_constructor_declarator): allow optional + parentheses around constructor class name. + +2001-02-14 Nathan Sidwell + + * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c + section. + * init.c (emit_base_init): Remove incorrect comment about + virtual bases. + * method.c (make_thunk): Fix comment alignment. + +2001-02-14 Nathan Sidwell + + Kill remnants of this is variable. + * cp-tree.h (flag_this_is_variable): Remove. + * decl2.c (flag_this_is_variable): Remove. + * class.c (fixed_type_or_null): Add cdtor parm. Adjust. + (build_vbase_path): The path is non-static, even in a cdtor. + (resolves_to_fixed_type_p): Add additional return value. + * search.c (init_vbase_pointers): Adjust. + * tree.c (lvalue_p_1): Adjust. + * typeck.c (mark_addressable): Adjust. + +2001-02-14 Nathan Sidwell + + * pt.c (unify): Don't check cv quals of array types. + +2001-02-14 Nathan Sidwell + + * tree.c (cp_build_qualified_type_real): Use CP_TYPE_QUALS to + check whether we already have the type. + +2001-02-13 Mark Mitchell + + * cp-tree.h (CLASSTYPE_DESTRUCTORS): Fix typo in comment. + * call.c (build_op_delete_call): Simplify to remove duplicate + code. + * class.c (clone_function_decl): Don't build the deleting variant + of a non-virtual destructor. + * decl.c (finish_destructor_body): Don't call delete if this is a + non-virtual destructor. + * init.c (build_delete): Explicitly call `operator delete' when + deleting an object with a non-virtual destructor. + +2001-02-13 Jason Merrill + + * lang-specs.h: Add more __EXCEPTIONS. + +2001-02-12 Nathan Sidwell + + * typeck2.c (process_init_constructor): Check + TREE_HAS_CONSTRUCTOR before issuing missing init warning. + +2001-02-12 Nathan Sidwell + + * pt.c (maybe_adjust_types_for_deduction, DEDUCE_ORDER case): + Remove spurious information in comment. Allow further + adjustments of REFERENCE_TYPE args. + +2001-02-12 Nathan Sidwell + + * errfn.c (cp_deprecated): Tweak diagnostic text. + * parse.y (new_initializer): Deprecate initializer lists + extension. + +2001-02-12 Mark Mitchell + + Remove old ABI support. + +2001-02-11 Mark Mitchell + + * decl2.c (flag_vtable_thunks): Always set it to 1. + (flag_new_abi): Likewise. + * lang-specs.h: Remove conditional on ENABLE_NEW_GXX_ABI. + + * Makefile.in (g++spec.o): Fix typo. + +2001-02-09 Jason Merrill + + * lang-specs.h: Restore definition of __EXCEPTIONS. + +2001-02-08 Jason Merrill + + * search.c (shared_member_p): New function. + (lookup_field_r): Use it. + * cp-tree.h (SHARED_MEMBER_P): Remove. + + * method.c (process_overload_item): Handle template-dependent array + bounds. + * pt.c (type_unification_real): If we end up with undeduced nontype + parms, try again. + + * decl.c (lookup_name_real): Tweak warning to refer to decls, not + types. + + * typeck2.c (friendly_abort): Don't say anything if we have + earlier errors or sorries. + + * decl.c (check_tag_decl): Notice attempts to redefine bool and + wchar_t. Ignore if in_system_header. + + * decl.c (maybe_push_cleanup_level): New fn... + (start_decl_1): ...split out from here. + * cvt.c (build_up_reference): Use it. + * cp-tree.h: Declare it. + +2001-02-07 Mark Mitchell + + * lang-specs.h: Use CPLUSPLUS_CPP_SPEC for the preprocessor + spec. + +2001-02-06 Nathan Sidwell + + * pt.c (lookup_template_class): Make sure it's a primary + template or template_template_parm when called from the parser. + (instantiate_template_class): Add assertion. + +2001-02-05 Alexandre Oliva + + * method.c (build_mangled_name) [old abi]: Protect flush_repeats() + from error_mark_node. + +2001-02-05 Nathan Sidwell + + Fix specification and implementation bugs in V3 ABI + construction vtables. + * cp-tree.h (flag_dump_class_layout): New flag. + (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P): Remove. + (BINFO_LOST_PRIMARY_P): New flag. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust asserts. + (BINFO_PRIMARY_MARKED_P): Rename to ... + (BINFO_PRIMARY_P): ... here. + (binfo_via_virtual): New prototype. + * decl2.c (flag_dump_class_layout): New flag. + (cxx_decode_option): Set it. Adjust -fdump-translation-unit to + use `=' as a file name separator. + * init.c (dfs_initialize_vtbl_ptrs): Walk into virtual primary + bases. + (build_vtbl_address): If this is a virtual primary base, then + get the vtbl of what it is ultimately primary for. + * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Adjust + for BINFO_PRIMARY_P. + (dfs_skip_nonprimary_vbases_markedp): Likewise. + (get_shared_vbase_if_not_primary): Likewise. + (dfs_get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + (fixup_virtual_upcast_offsets): Likewise. + (dfs_find_vbase_instance): Likewise. + (find_vbase_instance): Likewise. + (binfo_from_vbase): Adjust comment to reflect reality. + (binfo_via_virtual): New function. + * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): New macros + for binfo walking during VTT construction. + (dfs_mark_primary_bases): Remove. + (force_canonical_binfo_r): New function. + (force_canonical_binfo): New function. + (mark_primary_virtual_base): New function. + (mark_primary_bases): Walk in inheritance graph order, use + mark_primary_virtual_base. + (determine_primary_base): Use some more intermediate variables. + (dfs_find_final_overrider): Don't check for overriding along a + virtual path. + (dfs_modify_vtables): Walk into primary virtual bases too. + (walk_subobject_offsets): Adjust for BINFO_PRIMARY_P. + (build_base_fields): Likewise. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Likewise. + (end_of_class): Likewise. + (finish_struct_1): Call dump_class_hierarchy, if requested. + (dfs_get_primary_binfo): Use BINFO_TYPE for binfos. + (dump_class_hierarchy_r): Add stream parameter. Emit more information. + (dump_class_hierarchy): Add file parameter. Append to file, if + required. + (finish_vtbls): Adjust accumulate_vtbl_inits call. + Use canonical base for virtual bases. + (build_vtt): Add more comments. Adjust build_vtt_inits call. + (build_vtt_inits): Remove VIRTUAL_VTTS_P parm. + Only set BINFO_VPTR_INDEX on top level. Use VTT_TOP_LEVEL_P, + VTT_MARKED_BINFO_P for binfo walking. Use canonical vbase for + virtual VTTs. + (dfs_build_secondary_vptr_vtt_inits): Extract VTT_TOP_LEVEL_P + from DATA. We want virtual primary bases and all bases via virtual. + Only set BINFO_VPTR_INDEX for top level. Look up from a primary + virtual base when not a construction vtable. + (dfs_ctor_vtable_bases_queue_p): New DFS predicate. + (build_ctor_vtbl_group): Adjust accumulate_vtbl_inits call. + Use canonical bases when processing virtual bases. + (accumulate_vtbl_inits): We're interested in any base via a + virtual path. + (dfs_accumulate_vtbl_inits): If this is a primary virtual base + within a construction vtable, determine what is being overridden. + (build_vtbl_initializer): Add more comments + (add_vcall_offset_vtbl_entries_1): Adjust comment. + (build_rtti_vtbl_entries): Check if the base has lost its + primary. + +2001-02-05 Mark Mitchell + + * Makefile.in (g++spec.o): Adjust use of DRIVER_DEFINES. + +2001-02-04 Richard Kenner + + * decl.c (pushdecl): Call abort instead of fatal. + * except.c (decl_is_java_type): Call fatal_error instead of fatal. + * init.c (build_new_1): Likewise. + (build_java_class_ref): Call internal_error and fatal_error, not fatal. + * decl.c (build_typename_type): hash_table_init now returns void. + decl.c (init_decl_processing): Make an error non-fatal. + +2001-02-04 Mark Mitchell + + * cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting. + Document. + (CLASSTYPE_INTERFACE_KNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. + * decl.c (maybe_commonize_var): Use the new name-mangling where + appropriate. + * decl2.c (comdat_linkage): Enhance comments. Make all + compiler-generated things static, if COMDAT is not available. + (get_tinfo_decl): Do not make typeinfo objects that belong in the + library COMDAT. + (tinfo_base_init): Use the correct mangled name for typeinfo + strings, and push them into the global scope. + (typeinfo_in_lib_p): New function. + (synthesize_tinfo_var): Use it. + (create_real_tinfo_var): Likewise. + +2001-02-03 Jakub Jelinek + + * decl.c (push_class_binding): Use context_for_name_lookup instead + of CP_DECL_CONTEXT. + * search.c (context_for_name_lookup): Remove static. Check for NULL + context in the loop. + * cp-tree.h (context_for_name_lookup): Add prototype. + +2001-02-02 Jakub Jelinek + + * cp-tree.h (build_expr_ptr_wrapper, can_free): Remove. + * tree.c (build_expr_ptr_wrapper, can_free, permanent_obstack): + Remove. + * call.c (convert_class_to_reference, build_user_type_conversion_1, + add_warning): Change build_expr_ptr_wrapper to build_ptr_wrapper. + +2001-02-02 Mark Mitchell + + * Make-lang.in (g++spec.o): Add DRIVER_DEFINES to the list + of macros used when compiling g++spec.c. + * g++spec.c (lang_specific_driver): Link with the shared + libgcc by default. + +2001-01-29 Joseph S. Myers + + * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, + make_reference_declarator, make_call_declarator), method.c + (implicitly_declare_fn), parse.y (namespace_using_decl, + notype_unqualified_id, expr_or_declarator, new_type_id, + after_type_declarator, direct_after_type_declarator, + notype_declarator, complex_notype_declarator, + complex_direct_notype_declarator, qualified_id, + notype_qualified_id, overqualified_id, direct_new_declarator, + absdcl, direct_abstract_declarator, conversion_declarator), pt.c + (tsubst), semantics.c (begin_constructor_declarator): Use build_nt + instead of build_parse_node. + +2001-01-28 Kaveh R. Ghazi + + * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. + (minus_one_node): Moved to top level gcc directory. Renamed + to integer_minus_one_node. + + * init.c (init_init_processing): Don't set minus_one_node. + (build_vec_init): Use integer_minus_one_node. + + * rtti.c (get_tinfo_decl_dynamic): Likewise. + +2001-01-28 Jakub Jelinek + + * optimize.c (copy_body_r): If MODIFY_EXPR has both arguments + identical and they would be replaced with constant, remove + MODIFY_EXPR from the tree. + +2001-01-27 Kaveh R. Ghazi + + * Make-lang.in: Remove all dependencies on defaults.h. + * call.c: Don't include defaults.h. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2001-01-25 Jakub Jelinek + + * mangle.c (write_mangled_name, write_encoding): Mangle overloaded + operators even in "C" linkage. + * method.c (set_mangled_name_for_decl): Likewise. + * decl.c (grokfndecl): Call set_mangled_name_for_decl even for + overloaded operators in "C" linkage. + +2001-01-24 Nathan Sidwell + + * pt.c (tsubst_decl): Remove IN_DECL parameter. + (tsubst_arg_types): Check parameter is not void. + (tsubst): Adjust tsubst_decl call. + +2001-01-24 Nathan Sidwell + + * call.c (add_builtin_candidate): Quote std properly, from + previous change. + +2001-01-23 Kriang Lerdsuwanakij + + * pt.c (check_explicit_specialization): Clone constructors and + destructors. + +2001-01-23 Nathan Sidwell + + * decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC + indicates anything special about template depth. Make sure we + only count the user visible template classes. + +2001-01-23 Nathan Sidwell + + * call.c (build_conv): Typo in comment. + (add_builtin_candidate): Add more explanation. + Remove extra test for ENUMERAL_TYPE in {PRE,POST}INCREMENT_EXPR. + Allow ENUMERAL_TYPEs for relops and eqops. Add both candidates + when we have enumeral types. + (add_builtin_candidates): Add more explanation. Add ENUMERAL_TYPE + candidates for relops and eqops. + (joust): Simplify control flow. Allow a non-template user + function to hide a builtin. + +2001-01-22 Nathan Sidwell + + * cp-tree.h (unification_kind_t): Add DEDUCE_ORDER. + (more_specialized): Add deduction parameter. + * call.c (joust): Adjust more_specialized call. + * pt.c (UNIFY_ALLOW_OUTER_MORE_CV_QUAL, + UNIFY_ALLOW_OUTER_LESS_CV_QUAL): New unify flags. + (get_bindings_order): Remove. + (get_bindings_real): Add DEDUCE parameter. + (maybe_adjust_types_for_deduction): Return extra unify flags. Do + REFERENCE_TYPE jig for DEDUCE_ORDER. + (type_unification_real): Deal with DEDUCE_ORDER. Use result of + maybe_adjust_types_for_deduction. + (more_specialized): Add DEDUCE parameter. Call get_bindings_real + directly. + (try_one_overload): Use result of maybe_adjust_types_for_deduction. + (check_cv_quals_for_unify): Use new unify qualifier flags. + (unify): Clear new unify qualifier flags. + (get_bindings_real): Add DEDUCE parameter. + (get_bindings): Adjust call to get_bindings_real. + (get_bindings_overload): Likewise. + (most_specialized_instantiation): Adjust call to + more_specialized. + +2001-01-19 Jason Merrill + + * decl2.c (flag_vtable_thunks): Also depend on ENABLE_NEW_GXX_ABI. + + * decl.c (init_decl_processing): Just force -fvtable-thunks on if + -fnew-abi. + +2001-01-19 Ute Pelkmann + + * decl2.c (arg_assoc_class): Fix double iteration logic. + +2001-01-19 Jason Merrill + + * init.c (build_delete): Always call convert_force to strip cv-quals. + + * decl2.c (flag_new_abi): Depend on ENABLE_NEW_GXX_ABI. + * lang-specs.h: Default ABI depends on ENABLE_NEW_GXX_ABI. + * g++spec.c: Don't look at ENABLE_NEW_GXX_ABI. + +2001-01-19 Nathan Sidwell + + * search.c (get_vbase_1): Count only virtual bases. + +2001-01-19 Nathan Sidwell + + * class.c (duplicate_tag_error): Robustify flag clearing. + +2001-01-19 Nathan Sidwell + + * cp-tree.h (lookup_template_class): Add complain parm. + * decl.c (lookup_namespace_name): Adjust call to + lookup_template_class. + (make_typename_type): Likewise. + * semantics.c (finish_template_type): Likewise. + * pt.c (lookup_template_class): Add complain parm. Adjust. + (tsubst_aggr_type): Pass COMPLAIN down to lookup_template_class. + (tsubst): Likewise. + +2001-01-19 Nathan Sidwell + + * pt.c (copy_default_args_to_explicit_spec): Preserve + object's CV quals. Reorganize. + +2001-01-18 Nathan Sidwell + + * typeck.c (build_modify_expr): Say `initialization' for + INIT_EXPRs. + * init.c (build_default_init): Convert to enumeral type, if + needed. + +2001-01-18 Jakub Jelinek + + * parse.y (nomods_initdcl0): Properly set things up for + initdcl0_innards. + +2001-01-18 Nathan Sidwell + + * pt.c (UNIFY_ALLOW_OUTER_LEVEL): New unify flag. + (type_unification_real): Set it. + (unify): Use it. + +2001-01-18 Nathan Sidwell + + * decl.c (finish_destructor_body): Convert to vbase pointer here. + +2001-01-18 Nathan Sidwell + + * semantics.c (begin_class_definition): Check we're not inside a + template parm list. + +2001-01-18 Nathan Sidwell + + * tree.c (walk_tree, TREE_LIST): Don't walk the TREE_PURPOSE of + BASELINK_P. + +2001-01-16 Kriang Lerdsuwanakij + + * typeck.c (build_function_call_real): Call fold on the CALL_EXPR. + * call.c (build_over_call): Add comment. + +2001-01-16 Daniel Berlin + + * cvt.c (ocp_convert): Handle vector type conversion + * typeck2.c (digest_init): Handle vector type initializations + +2001-01-16 Phil Edwards + + * g++spec.c: Don't add libraries needlessly if -fsyntax-only + was given. + +2001-01-15 Nathan Sidwell + + * pt.c (check_nontype_parm): Rename to ... + (invalid_nontype_parm_type_p): ... here. + (process_template_parm): Adjust. + (convert_template_argument): Adjust. + +2001-01-15 Nathan Sidwell + + * pt.c (check_nontype_parm): New function. + (process_template_parm): Use it. + (convert_template_argument): Use it. + (convert_nontype_argument, RECORD_TYPE): Assert it's a ptr to + member. + +2001-01-14 Jeffrey Oldham + + * tree.c: Add defaults.h + (cp_valid_lang_attribute): Incorporate SUPPORTS_INIT_PRIORITY. + * Make-lang.in (cp/tree.o): Add defaults.h. + +2001-01-13 Joseph S. Myers + + * Make-lang.in (CXX_C_OBJS): Add c-format.o. + +2001-01-13 Joseph S. Myers + + * g++.1: Change to be ".so man1/gcc.1". + +2001-01-13 Joseph S. Myers + + * Make-lang.in (c++.info, c++.install-info): Build and install g++ + internals info. + (c++.uninstall, c++.maintainer-clean): Remove g++ internals info. + ($(srcdir)/cp/g++int.info): New target. + * gxxint.texi: Add info directory entry. Use @@ in email address. + * .cvsignore: Update. + +2001-01-12 Nathan Sidwell + + * typeck.c (build_c_cast): Do template processing earlier. + Always pedwarn on array casts. + +2001-01-12 Nathan Sidwell + + * friend.c (make_friend_class): Make sure a templated class is + actually a template. + +2001-01-11 Nathan Sidwell + + * decl2.c (get_guard): Set linkage from guarded decl. + +2001-01-11 Nathan Sidwell + + * call.c (convert_default_arg): Check for unprocessed + DEFAULT_ARG. + * cp-tree.h (replace_defarg): Move to spew.c. + (maybe_snarf_defarg, add_defarg_fn, do_pending_defargs): Move to + spew.c, which is where they really are. + (done_pending_defargs): Declare. + (unprocessed_defarg_fn): Declare. + * decl.c (replace_defarg): Move to spew.c + * parse.y (structsp): Call done_pending_defargs. + * spew.c (defarg_fns): Rearrange list structure. + (defarg_fnsdone): New static variable. + (defarg_depfns): New static variable. + (init_spew): Adjust. + (add_defarg_fn): Store the type in TREE_TYPE. + (do_pending_defargs): Detect and deal with ordering constraints + and circularity. + (done_pending_defargs): New function. + (unprocessed_defarg_fn): New function. + (replace_defarg): Moved from decl.c. Robustify. Don't save + if circularity detected. + +2001-01-11 Nathan Sidwell + + * pt.c (unify): Check array has a domain, before checking + whether it is variable sized. + +2001-01-11 Nathan Sidwell + + * decl.c (grokparms): Unobfuscate and get correct diagnostic for + parameters with pointers to arrays of unknown bound. + +2001-01-11 Nathan Sidwell + + * parse.y (template_parm_header, template_spec_header): New + reductions. Split out from ... + (template_header): ... here. Use them. + (template_template_parm): Use template_parm_header. + * semantics.c (finish_template_template_parm): Add assert. + +2001-01-10 Mark Mitchell + + * mangle.c (write_builtin_type): Fix thinko. + + * pt.c (copy_default_args_to_explicit_spec_1): New function. + (copy_default_args_to_explicit_spec): Likewise. + (check_explicit_specialization): Use it. + + * class.c (finish_struct_1): Remove last argument in call to + make_decl_rtl; use make_function_rtl instead of make_decl_rtl. + * decl.c (builtin_function): Likewise. + (build_cp_library_fn): Likewise. + (check_initializer): Likewise. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Likewise. + (start_function): Likewise. + * decl2.c (finish_anon_union): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_java_class_ref): Likewise. + * method.c (make_thunk): Likewise. + * pt.c (tsubst_friend_function): Likewise. + * semantics.c (expand_body): Likewise. + +2001-01-10 Mark Mitchell + + * cp-tree.h (DECL_CLONED_FUNCTION_P): Avoid wild reads by not + looking at DECL_CLONED_FUNCTION for non-functions. + +2001-01-10 Nathan Sidwell + + * error.c (dump_template_parameter): Use parm to determine how + to print default value. + +2001-01-10 Nathan Sidwell + + * class.c (duplicate_tag_error): Clear more flags. + +2001-01-10 Nathan Sidwell + + * call.c (build_new_method_call): Use binfo_for_vbase. + +2001-01-10 Joseph S. Myers + + * cp-tree.h (flag_cond_mismatch): Don't declare. + * decl2.c (flag_cond_mismatch): Don't define. + (lang_f_options): Remove cond-mismatch. + (unsupported_options): Add cond-mismatch. + +2001-01-09 Nathan Sidwell + + * class.c (handle_using_decl): Reject using of constructor name + of sourcing class. Allow injecting of a method with same name as + nested class. Fixup error messages. + +2001-01-09 Joseph S. Myers + + * decl2.c (lang_decode_option): Handle -Wformat=2. + +2001-01-08 Nathan Sidwell + + * cp-tree.h (lang_decl_flags): Rename defined_in_class to + initialized_in_class. + (DECL_DEFINED_IN_CLASS_P): Rename to ... + (DECL_INITIALIZED_IN_CLASS_P): ... here, to reflect true meaning. + * decl.c (duplicate_decls): Preseve DECL_INITIALIZED_IN_CLASS_P. + (cp_finish_decl): Adjust for DECL_INITIALIZED_IN_CLASS_P. + * pt.c (check_default_tmpl_args): Adjust for + DECL_INITIALIZED_IN_CLASS_P. + (instantiate_class_template): Likewise. + (instantiate_decl): Check DECL_INITIALIZED_IN_CLASS_P. + + * class.c (finish_struct): Constify saved_filename. + +2001-01-08 Nathan Sidwell + + * class.c (duplicate_tag_error): Adjust diagnostic. + (finish_struct): Locally set location to start of struct. + * decl.c (fixup_anonymous_aggr): Use cp_error_at. + +2001-01-08 Nathan Sidwell + + * decl.c (struct binding_level): Adjust class_shadowed comments + to reflect reality. + (push_class_level_binding): Adjust comments to reflect reality. + Set IDENTIFIER_CLASS_VALUE when replacing an existing binding. + Don't set TREE_VALUE on the class_shadowed list. + +2001-01-07 Alexandre Petit-Bianco + + * decl2.c (acceptable_java_type): Allow references too. + * init.c (build_java_class_ref): When using the new ABI, search + `class$' and have it mangled with `mangle_decl.' + * mangle.c (write_java_integer_type_codes): New function. + (write_builtin_type): Detect and mangle Java integer and real + types. + +2001-01-07 Mark Mitchell + + * decl2.c (grokfield): Don't accept `asm' specifiers for + non-static data members. + +2001-01-07 Kaveh R. Ghazi + + * expr.c (cplus_expand_expr): Don't reset `target'. + +2001-01-07 Neil Booth + + * cp/decl2.c (cxx_post_options): Call cpp_post_options. + +2001-01-05 Nathan Sidwell + + * parse.y (template_datadef): Check for error_mark_node. + +2001-01-05 Nathan Sidwell + + * cp-tree.def (DEFAULT_ARG): Make `x' class. + +2001-01-04 Joseph S. Myers + + * decl.c (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Don't define. + (record_builtin_type): Make non-static. + (flag_short_double): Don't declare. + (init_decl_processing): Remove the creation of many tree nodes now + in c_common_nodes_and_builtins. + (build_void_list_node): New function. + * decl2.c (flag_short_double, flag_short_wchar): Don't define. + * cp-tree.h (flag_short_wchar): Don't declare. + +2001-01-04 Mark Mitchell + + * call.c (build_conv): Don't use build1 for USER_CONV. + * pt.c (tsubst_copy): Or for PREINCREMENT_EXPR and similar nodes. + +2001-01-03 Joseph S. Myers + + * lex.c (lang_init): Call c_common_lang_init. + +2001-01-03 Nathan Sidwell + + * search.c (lookup_fnfields_here): Remove. + (look_for_overrides_r): Use lookup_fnfields_1. + Ignore functions from using declarations. + +2001-01-03 Nathan Sidwell + + Implement exceptions specifiers for implicit member functions. + * cp-tree.h (merge_exceptions_specifiers): Declare new function. + * method.c (synthesize_exception_spec): New function. + (locate_dtor, locate_ctor, locate_copy): New functions. + (implicitly_declare_fn): Generate the exception spec too. + * search.c (check_final_overrider): Check artificial functions + too. + * typeck2.c (merge_exception_specifiers): New function. + +2001-01-03 Jason Merrill + + * init.c (build_default_init): New fn. + (perform_member_init): Split out from here. + (build_new_1): Use it. Simplify initialization logic. + (build_vec_init): Take an array, rather than a pointer and maxindex. + Speed up simple initializations. Don't clean up if we're assigning. + * cp-tree.h: Adjust. + * decl2.c (do_static_initialization): Remove TREE_VEC case. + * parse.y (new_initializer): Return void_zero_node for (). + * typeck.c (build_modify_expr): Handle getting a CONSTRUCTOR. + * typeck2.c (digest_init): Only complain about user-written + CONSTRUCTORs. + +2000-12-22 Mike Stump + + * decl2.c: (max_tinst_depth): Increase to 50. + +2001-01-02 Mark Mitchell + + * class.c (invalidate_class_lookup_cache): Zero the + previous_class_values. + * cp-tree.h (TMPL_PARMS_DEPTH): Use TREE_INT_CST_LOW, not + TREE_INT_CST_HIGH. + (CLASSTYPE_TEMPLATE_LEVEL): Likewise. + * decl.c (free_bindings): New variable. + (push_binding): Don't create a new binding if we have one on the + free list. + (pop_binding): Put old bindings on the free list. + (init_decl_processing): Use size_int, not build_int_2. + Register free_bindings as a GC root. + (cp_make_fname_decl): Use size_int, not build_int_2. + (push_inline_template_parms_recursive): Likewise. + (end_template_parm_list): Likewise. + (for_each_template_parm): Do not use walk_tree_without_duplicates. + (tsubst_template_parms): Use size_int, not build_int_2. + (tsubst): Likewise. + * rtti.c (get_vmi_pseudo_type_info): Likewise. + +2001-01-02 Richard Henderson + + * parse.y (asm): Set ASM_INPUT_P. + +2001-01-02 Jason Merrill + + * tree.c (cp_valid_lang_attribute): Don't set CLASSTYPE_COM_INTERFACE + for v3 ABI. + + * typeck.c (cp_truthvalue_conversion): New fn. + * cvt.c (ocp_convert): Use it. + + * cp-tree.h: Lose c-common.c decls. + + * typeck.c (build_unary_op): Restore old &a.f diagnostic code. + * cvt.c (convert_to_void): Use type_unknown_p. + + * typeck.c (strip_all_pointer_quals): Also strip quals from + pointer-to-member types. + + * Make-lang.in (cp/TAGS): Use --no-globals. Ignore parse.c, and treat + parse.y as C. + + * call.c (build_new_method_call): Do evaluate the object parameter + when accessing a static member. + * typeck.c (build_component_ref): Likewise. + +2001-01-02 Andreas Jaeger + + * decl.c (cp_missing_noreturn_ok_p): New. + (init_decl_processing): Set lang_missing_noreturn_ok_p. + diff --git a/contrib/gcc/cp/ChangeLog-2002 b/contrib/gcc/cp/ChangeLog-2002 new file mode 100644 index 00000000000..573715384a0 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-2002 @@ -0,0 +1,4574 @@ +2002-12-31 Neil Booth + + * .cvsignore: Remove. + +2002-12-31 Steven Bosscher + + * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c, + except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h, + lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c, + pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c, + typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the + copyright header. + * lex.h: parse.y is dead, so don't mention it. Also replace the + copyright header with the default GNU copyright header. + +2002-12-31 Mark Mitchell + + * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove. + (lookup_name_namespace_only): Likewise. + (begin_only_namespace_names): Likewise. + (end_only_namespace_names): Likewise. + * decl.c (only_namespace_names): Remove. + (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED. + (lookup_name_real): Do not check only_namespace_names. + (lookup_name_namespace_only): Remove. + (begin_only_namespace_names): Likewise. + (end_only_namespace_names): Likewise. + * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous + nested-name-specifiers more gracefully. + (cp_parser_class_or_namespace_name): Avoid looking up namespace + names when they cannot possibly appear. + (cp_parser_template_name): Adjust call to cp_parser_lookup_name. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_namespace_name): Only look for namespace names. + (cp_parser_lookup_name): Add is_namespace parameter. + (cp_parser_lookup_name_simple): Adjust call to + cp_parser_lookup_name. + + * parser.c (cp_parser_dependent_type_p): Fix thinko. + +2002-12-31 Neil Booth + + * .cvsignore: Update. + +2002-12-31 Nathan Sidwell + + * class.c (modify_vtable_entry): Remove unused variable. + (get_vcall_index): Always expect a non-thunk. + (update_vtable_entry_for_fn): Combine covariant adjustments, when + overriding a thunk. Pass get_vcall_index a non-thunk. + + * decl2.c (finish_file): Mark undefined inlines as extern. + +2002-12-31 Mark Mitchell + + * cp-tree.def (RETURN_INIT): Remove. + * cp-tree.h (DECL_IN_MEMORY_P): Remove. + (scope_kind): Add sk_block, sk_try, sk_catch, sk_for. + (note_level_for_for): Remove. + (note_level_for_try): Likewise. + (note_level_for_catch): Likewise. + (finish_named_return_value): Likewise. + (do_pushlevel): Change prototype. + (pending_lang_change): Remove. + * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch, + sk_for. + (note_level_for_for): Remove. + (note_level_for_try): Likewise. + (note_level_for_catch): Likewise. + (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P. + * parser.c (cp_parser_context_free_list): Make it "deletable". + (cp_parser_template_argument): Remove misleading comment. + * pt.c (tsubst_expr): Remove RETURN_INIT code. + * semantics.c (genrtl_named_return_value): Remove. + (do_pushlevel): Take a scope kind as an argument. + (begin_if_stmt): Adjust. + (begin_while_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_init_stmt): Likewise. + (begin_switch_stmt): Likewise. + (begin_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_named_return_value): Remove. + (cp_expand_stmt): Remove RETURN_INIT case. + * tree.c (cp_statement_code_p): Remove RETURN_INIT case. + +2002-12-31 Mark Mitchell + + PR c++/9112 + * parser.c (cp_parser_direct_declarator): Handle erroneous + parenthesized declarators correctly. + +2002-12-31 Gabriel Dos Reis + + * cp-tree.h (pending_lang_change): Declare. + +2002-12-30 Mark Mitchell + + * parser.c (cp_parser_context_free_list): New variable. + (cp_parser_context_new): Use it. + (cp_parser_error): Check return code from + cp_parser_simulate_error. + (cp_parser_simulate_error): Return a value. + (cp_parser_id_expression): Optimize common case. + (cp_parser_class_name): Likewise. + (cp_parser_class_specifier): Adjust call to + cp_parser_late_parsing_default_args. + (cp_parser_lookup_name): Optimize common case. + (cp_parser_late_parsing_for_member): Adjust call to + cp_parser_late_parsing_default_args. + (cp_parser_late_parsing_default_args): Add scope parameter. + (cp_parser_require): Avoid creating the error message unless it's + needed. + (cp_parser_parse_definitely): Place free'd contexts on the free + list. + + * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change. + +2002-12-30 David Edelsohn + + * parser.c (cp_parser_parameter_declaration_clause): Treat system + header as extern "C" if NO_IMPLICIT_EXTERN_C undefined. + +2002-12-30 Nathanael Nerode + + * config-lang.in, Make-lang.in, operators.def, cp-tree.def: + GCC, not GNU CC. + +2002-12-30 Mark Mitchell + + * parse.y: Remove. + * spew.c: Likewise. + * Make-lang.in (gt-cp-spew.h): Remove. + * cp-tree.h (do_pending_lang_change): Remove. + (do_identifier): Change prototype. + (finish_id_expr): Remove. + * decl.c (lookup_name_real): Remove yylex variable. + * decl2.c (build_expr_from_tree): Adjust call to do_identifier. + * lex.c (init_cpp_parse): Remove. + (reduce_cmp): Likewise. + (token_cmp): Likewise. + (yychar): Likewise. + (lastiddecl): Likewise. + (token_count): Likewise. + (reduce_count): Likewise. + (yyhook): Likewise. + (print_parse_statistics): Likewise. + (do_pending_lang_change): Likewise. + (do_identifier): Remove parsing parameter. + * lex.h (lastiddecl): Remove. + (looking_for_typename): Remove. + (looking_for_template): Likewise. + (pending_lang_change): Likewise. + (yylex): Likewise. + * semantics.c (finish_id_expr): Remove. + + * decl.c (grokdeclarator): Diagnost "extern thread" and "static + thread" correctly. + +2002-12-30 Nathanael Nerode + + * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front + end, not the C front end. + +2002-12-30 Nathan Sidwell + + * cp-tree.h (THUNK_TARGET): New macro. + (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo. + (finish_thunk): Remove offset parms. + * class.c (find_final_overrider): Look through thunks. + (get_vcall_index): Use THUNK_TARGET. + (update_vtable_entry_for_fn): Look through thunks. Set covariant + fixed offset here. Adjust finish_thunk call. + (build_vtbl_initializer): Adjust finish_thunk calls. + * mangle.c (mangle_call_offset): Remove superfluous if. + (mangle_thunk): Adjust. + * method.c (make_thunk): Adjust. + (finish_thunk): Adjust. + (thunk_adjust): Remove assert. + (use_thunk): Use THUNK_TARGET + * dump1.c (cp_dump_tree): Adjust thunk dumping. + + PR c++/9054 + * class.c (layout_class_type): Set TYPE_CONTEXT of type for base. + * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types. + +2002-12-28 Gabriel Dos Reis + + Remove traditional C constructs 4/n. + * decl2.c (grok_method_quals, warn_if_unknown_interface, + grok_x_components, cp_build_parm_decl, build_artificial_parm, + maybe_retrofit_in_chrg, grokclassfn, grok_array_decl, + delete_sanity, check_member_template, check_java_method, + check_classfn, finish_static_data_member_decl, grokfield, + grokbitfield, grokoptypename, grok_function_init, + cplus_decl_attributes, constructor_name, defer_fn, + build_anon_union_vars, finish_anon_union, coerce_new_type, + coerce_delete_type, comdat_linkage, maybe_make_one_only, + key_method, import_export_vtable, import_export_class, + output_vtable_inherit, import_export_decl, import_export_tinfo, + build_cleanup, get_guard, get_guard_bits, get_guard_cond, + set_guard, start_objects, finish_objects, + start_static_storage_duration_function, + finish_static_storage_duration_function, get_priority_info, + start_static_initialization_or_destruction, + finish_static_initialization_or_destruction, + do_static_initialization, do_static_destruction, + prune_vars_needing_no_initialization, write_out_vars, + reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor, + add_using_namespace, merge_functions, ambiguous_decl, + lookup_using_namespace, lookup_using_namespace, + qualified_lookup_using_namespace, set_decl_namespace, + decl_namespace, current_decl_namespace, push_decl_namespace, + pop_decl_namespace, push_scope, pop_scope, add_function, + arg_assoc_namespace, arg_assoc_template_arg, arg_assoc, + lookup_arg_dependent, do_namespace_alias, + validate_nonmember_using_decl, do_nonmember_using_decl, + do_toplevel_using_decl, do_local_using_decl, + do_class_using_decl, do_using_directive, check_default_args, + mark_used, handle_class_head): Use C90 prototypings. Use booleans. + * parser.c (cp_parser_class_head): Use booleanss. + * decl.c (walk_globals, walk_vtables): Likewise. + * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables, + walk_globals): Change return type from 'int' to 'bool'. + * rtti.c (init_rtti_processing, build_headof, throw_bad_cast + throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p, + build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr, + get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast, + qualifier_flags, tinfo_base_init, generic_initializer, + ptr_initializer, dfs_class_hint_mark, ptm_initializer, + dfs_class_hint_unmark, class_hint_flags, class_initializer, + typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info, + get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos, + unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise. + * repo.c (repo_compile_flags, repo_template_declared, + repo_template_defined, repo_class_defined, repo_get_id, + repo_template_used, repo_vtable_used, repo_inline_used, + repo_tinfo_used, repo_template_instantiated, extract_string, + open_repo_file, afgets, init_repo, reopen_repo_file_for_write, + finish_repo): Likewise. + * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier, + cxx_print_xnode): Likewise.. + * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set, + cxx_warn_unused_global_decl, cp_expr_size): Likewise. + * cxxfilt.c (demangle_it, print_demangler_list, usage, + standard_symbol_characters, hp_symbol_characters, main, fatal): + Likewise. + (strip_underscore): Change type from 'int' to 'bool'. + (main): Use boolean constants. + +2002-12-28 Gabriel Dos Reis + + Remove traditional C constructs 3/n. + * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, + build_up_reference, warn_ref_binding, convert_to_reference, + convert_from_reference, convert_lvalue, cp_convert, ocp_convert, + convert_to_void, convert, convert_force, build_type_conversion, + build_expr_type_conversion, type_promotes_to, + perform_qualification_conversions): Use C90 prototyping style. + * decl2.c (grok_array_decl): Use boolean constant. + (delete_sanity): Likewise. + * typeck.c (build_unary_op): Likewise. + * semantics.c (finish_switch_cond): Likewise. + * parser.c (cp_parser_direct_new_declarator): Likewise. + * init.c (build_new): Likewise. + +2002-12-27 Mark Mitchell + + * Make-lang.in (po-generated): Remove parse.c. + (CXX_OBJS): Remove parse.o and spew.o. Add parser.o. + ($(srcdir)/cp/parse.h): Remove target. + ($(srcdir)/cp/parse.c): Likewise. + (gt-cp-parse.h): Likewise. + (gt-cp-parser.h): New target. + (c++.distclean): Do not remove parse.output. + (c++.maintainer-clean): Do not remove parse.c or parse.h. + (cp/spew.o): Remove target. + (cp/lex.o): Adjust dependencies. + (cp/pt.o): Likewise. + (cp/parse.o): Likewise. + (cp/TAGS): Do not mention parse.c. + (cp/parser.o): New target. + * NEWS: Mention the new parser. + * call.c (build_scoped_method_call): Simplify. + (build_method_call): Likewise. + (build_new_function_call): Adjust calls to add_function_candidate + and add_template_candidate. + (build_new_op): Improve handling of erroroneous operands. + (convert_default_arg): Remove circular argument processing. + (name_as_c_string): New function. + (build_new_method_call): Use it. + (perform_implicit_conversion): Use error_operand_p. + * class.c (finish_struct_anon): Use constructor_name_p. + (check_field_decls): Likewise. + (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN. + (resolve_address_of_overloaded_function): Likewise. + (instantiate_type): Tweak pointer-to-member handling. + (get_primary_binfo): Remove incorrect assertion. + * config-lang.in (gtfiles): Add parser.c, remove parse.c. + * cp-tree.h (DEFARG_TOKENS): New macro. + (default_arg): New structure. + (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG. + (lang_tree_node): Add default_arg. + (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE. + (type_info_ref_type): New macro. + (saved_scope): Make processing_explicit_instantiation a boolean. + (check_access): New field. + (unparsed_text): Remove. + (language_function): Remove unparsed_inlines. + (error_operand_p): New macro. + (lang_decl): Adjust pending_inline_info. + (DEFARG_POINTER): Remove. + (tag_types): Add typenames. + (lookup_ualified_name): Declare. + (lookup_name_real): Likewise. + (shadow_tag): Adjust prototype. + (get_scope_of_declarator): Declare it. + (process_next_inline): Remove it. + (check_for_missing_semicolon): Likewise. + (maybe_get_template_decl_from_type_decl): Declare it. + (finish_label_stmt): Adjust prototype. + (finish_non_static_data_meber): Declare it. + (finish_pseudo_destructor_call_expr): Rename to ... + (finish_pseudo_destructor_expr): ... this. + (finish_compound_literal): Declare it. + (begin_inline_definitions): Remove it. + (init_spew): Remove. + (peekyylex): Likewise. + (arbitrate_lookup): Likewise. + (frob_opname): Likewise. + (maybe_snarf_defarg): Likewise. + (add_defarg_fn): Likewise. + (do_pending_defargs): Likewise. + (done_pending_defargs): Likewise. + (unprocessed_defarg_fn): Likewise. + (replace_defarg): Likewise. + (end_input): Likewise. + (get_overloaded_fn): Likewise. + * cvt.c (convert_to_reference): Improve error handling. + * decl.c (lookup_name_real): Do not declare it static. + (maybe_push_to_top_level): Set check_access. + (identifier_type_value): Adjust call to lookup_name_real. + (lookup_qualified_name): New method. + (lookup_name_real): Remove special-case parsing code. + (lookup_name-nonclass): Adjust call to lookup_name_real. + (lookup_name_namespace_only): Likewise. + (lookup_name): Likewise. + (check_tag_decl): Return the type declared. + (shadow_tag): Likewise. + (register_dtor_fn): Tweak check_access. + (grokfndecl): Use constructor_name_p. + (get_scope_of_declarator): New function. + (grokdeclarator): Obscure tweaks for slightly different declarator + representations. + (start_method): Return error_mark_node to indicate failure. + (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs. + * decl2.c (constructor_name_full): Simplify. + (constructor_name): Use it. + (build_expr_from_tree): Adjust for changes to do new parser. + (push_scope): Improve robustness. + (validate_nonmember_using_decl): Process declarations, not names. + (do_class_using_decl): Likewise. + (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS + here. + * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs. + * expr.c (cxx_expand_expr): Handle BASELINKs. + * init.c (member_init_ok_or_else): Issue more errors. + (build_offset_ref): Tweak handling of FUNCTION_DECLs. + * lex.c: Do not include parse.h. + (yypring): Do not declare. + (yylval): Likewise. + (make_reference_declarator): Remove error-generating code. + (rid_to_yy): Remove. + (cxx_init): Do not call init_spew. + (yypring): Remove. + (check_for_missing_semicolon): Remove. + * lex.h (got_scope): Remove. + (got_object): Remove. + * method.c (hack_identifier): Use finish_non_static_data_member. + (implicitly_declare_fn): Adjust use of constructor_name. + * parser.c: New file. + * pt.c (parse.h): Do not include it. + (maybe_get_template_decl_from_template): Do not declare it. + (finish_member_template_decl): Tweak. + (begin_explicit_instantiation): Adjust for + processing_explicit_instantiation being boolean. + (end_explicit_instantiation): Likewise. + (maybe_process_partial_specialization): Tighten specialization + test. + (retrieve_local_specialization): Adjust ue of hash table. + (eq_local_specializations): New function. + (register_local_specialization): Likewise. + (push_template_decl_real): Remove unnecessary test. + (maybe_get_template_decl_from_type_decl): Don't make it static. + (for_each_template_parm_r): Handle TYPEOF_TYPE. + (tsubst_copy): Use retrieive_local_specialization to handle + PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs. + Handle COMPONENT_REFs with pseudo-destructor-expressions. + Simplify handling of CALL_EXPR and METHOD_CALL_EXPR. + (tsubst_expr): Pass decls, not names, to do_local_using_decl. + (unify): Tweak handling of CONST_DECLs. + (regenerate_decl_from_template): Use push_nested_class. + (template_for_substitution): New funciton. + (instantiate_decl): Use it. Register parameters as local + specializations. + * rtti.c (init_rtti_processing): Set type_info_ref_type. + (build_typeid): Use it. + (get_typeid): Likeise. + * search.c (accessible_p): Use check_access, not + flag_access_control. + (adjust_result_of_qualified_name_lookup): Pay attention to the + context_class. + * semantics.c (finish_asm_stmt): Adjust error handling. + (finish_label_stmt): Return the statement. + (finish_non_static_data_member): New function. + (finish_class_expr): Handle BASELINKs. + (finish_call_expr): Handle PSEUDO_DTOR_EXPR. + (finish_object_call_expr): Simplify handling during templates. + (finish_pseudo_destructor_call_expr): Rename to ... + (finish_pseudo_dtor_expr): ... this. + (finish_compound_literal): New function. + (begin_inline_definitions): Remove. + (finish_sizeof): Remove special template handling. + * spew.c: Do not include parse.h. + * tree.c (get_overloaded_fn): Remove. + * typeck.c (build_class_member_access_expr): Handle + PSEUDO_DTOR_EXPR. Adjust handling of static member functions. + (lookup_destructor): New function. + (finish_class_member_access_expr): Use it. + (convert_arguments): Simplify. + (build_unary_op): Handle BASELINKs. + +2002-12-26 Nathan Sidwell + + PR c++/4803 + * decl2.c (mark_used): Defer inline functions. + (finish_file): Merge deferred_fns loops. Check all used + inline functions have a definition. + * method.c (make_thunk): Thunks are not inline. + + PR c++/5116, c++/764 + * call.c (build_new_op): Make sure template class operands are + instantiated. + +2002-12-24 Nathan Sidwell + + PR C++/7964 + * cp-tree.h (resolve_scoped_fn_name): Prototype. + * call.c (resolve_scoped_fn_name): New function. Deal with + more template expansion. Broken out of ... + * parse.y (parse_finish_call_expr): ... here. Call it. + * decl2.c (build_expr_from_tree, CALL_EXPR): Use + resolve_scoped_fn_name and build_call_from_tree. + + PR c++/9053 + * decl.c (duplicate_decls): Templates may be disambiguated by + return type. + + PR c++/8702 + * decl2.c (check_classfn): Use lookup_fnfield_1. List all + conversion operators on failure. + +2002-12-23 Gabriel Dos Reis + + Remove traditional C constructs 2/n. + * call.c (tourney, build_field_call, equal_functions, joust, + compare_ics, build_over_call, build_java_interface_fn_ref, + convert_like_real, op_error, build_object_call, resolve_args, + build_vfield_ref, check_dtor_name, build_scoped_method_call, + build_addr_func, build_call, build_method_call, null_ptr_cst_p, + sufficient_parms_p, build_conv, non_reference, strip_top_quals, + standard_conversion, reference_related_p, + reference_compatible_p, convert_class_to_reference, + direct_reference_binding, reference_binding, + ,implicit_conversion, is_complete, promoted_arithmetic_type_p, + add_template_conv_candidate, any_viable, any_strictly_viable, + build_this, splice_viable, print_z_candidates, + build_user_type_conversion, build_new_function_call, + conditional_conversion, build_conditional_expr, build_new_op, + build_op_delete_call, enforce_access, call_builtin_trap, + convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to, + convert_default_arg, type_passed_as, convert_for_arg_passing, + in_charge_arg_for_name, is_properly_derived_from, + maybe_handle_implicit_object, maybe_handle_ref_bind, + source_type, add_warning, can_convert, can_convert_arg, + perform_implicit_conversion, can_convert_arg_bad, + initialize_reference, add_conv_candidate, + add_template_candidate_real, add_template_candidate): Ansify. + +2002-12-22 Nathan Sidwell + + PR c++/8572 + * cp-tree.h (grokoptypename): Add SCOPE parameter. + * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type + if in a template scope. + * parse.y (unoperator): Return the scope. + (operator_name): Adjust grokoptypename call. + +2002-12-22 Kriang Lerdsuwanakij + + * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t. + * decl.c (make_unbound_class_template): Adjust. Check for tf_error. + * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error. + +2002-12-20 Kazu Hirata + + * ChangeLog: Fix a typo. + * class.c: Fix comment typos. + * cp-tree.h: Likewise. + +2002-12-18 Jason Merrill + + Handle anonymous unions at the tree level. + C++ ABI change: Mangle anonymous unions using the name of their + first named field (by depth-first search). Should not cause + binary compatibility problems, though, as the compiler previously + didn't emit anything for affected unions. + * cp-tree.def (ALIAS_DECL): New tree code. + * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the + first field, not the largest. + (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME, + push the decl, and write it out at namespace scope. + * decl.c (lookup_name_real): See through an ALIAS_DECL. + (pushdecl): Add namespace bindings for ALIAS_DECLs. + * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name + of a decl which doesn't have one. + * typeck.c (build_class_member_access_expr): Don't recurse if + we already have the type we want. + +2002-12-18 Kriang Lerdsuwanakij + + PR c++/8099 + * friend.c (make_friend_class): Allow partial specialization + when declaration is not a template friend. + +2002-12-18 Kriang Lerdsuwanakij + + PR c++/3663 + * pt.c (lookup_template_class): Copy TREE_PRIVATE and + TREE_PROTECTED to created decl nodes. + +2002-12-18 Mark Mitchell + + * class.c (build_base_field): Do not set DECL_PACKED on the + FIELD_DECL. + +2002-12-18 Gabriel Dos Reis + + * cp-tree.h (struct tree_srcloc): Use location_t. + (SOURCE_LOCUS): New. + (SRCLOC_FILE, SRCLOC_LINE): Adjust. + +2002-12-17 Jason Merrill + + * decl.c (finish_function): Also complain about no return in + templates. + * semantics.c (finish_return_stmt): Also call check_return_expr in + templates. + * typeck.c (check_return_expr): In a template, just remember that we + saw a return. + +2002-12-16 Jason Merrill + + * semantics.c (simplify_aggr_init_exprs_r): Don't change the type + of the CALL_EXPR. + + * semantics.c (do_pushlevel): Call pushlevel after adding the + SCOPE_STMT. + (do_poplevel): Call poplevel before adding the SCOPE_STMT. + * parse.y (function_body): Go back to using compstmt. + * decl.c (pushdecl): Skip another level to get to the parms level. + + * call.c (build_new_method_call): Use is_dummy_object to determine + whether or not to evaluate the object parameter to a static member + function. + +2002-12-14 Jason Merrill + + * semantics.c (simplify_aggr_init_exprs_r): Also prepend the + return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR. + * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE, + don't bother with an AGGR_INIT_EXPR. + (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE, + just generate a new decl normally. Take return slot parm. + * cp-tree.h: Adjust prototype. + +2002-12-13 Gabriel Dos Reis + + PR C++/8031 + * cvt.c (convert_to_pointer_force): Don't try comparing against + erronous type. + +2002-12-13 Geoffrey Keating + + * cp-tree.h: Have the multiple-include guards around + the entire file. + +2002-12-10 David Edelsohn + + * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos + for SPEW_DEBUG. + (snarf_method): Same. + (snarf_defarg): Same. + +2002-12-10 Mark Mitchell + + PR c++/8372 + * pt.c (tsubst_copy): Handle destructor names more correctly. + +2002-12-10 Matt Austern + + * cp-tree.h: get rid of needs_virtual_reinit bit. + +2002-12-09 Mark Mitchell + + * NEWS: Document removal of in-class initialization extension for + static data members of non-arithmetic, non-enumeration type. + * decl.c (check_static_variable_definition): Do not allow that + extension. + * decl2.c (grokfield): Do not call digest_init when processing + templates. + +2002-12-05 Kaveh R. Ghazi + + * error.c (dump_expr): Fix format specifier warning. + +2002-12-04 Geoffrey Keating + + * class.c (finish_struct_1): Correct comment. + * cp-tree.c (DECL_SORTED_FIELDS): Likewise. + +2002-12-04 Gabriel Dos Reis + + PR C++/8799 + * error.c (dump_expr): Don't ever try to dump a non-existent + expression. + +2002-12-03 Nathan Sidwell + + Implement covariant returns. + * cp-tree.h (IS_AGGR_TYPE_2): Remove. + (struct lang_decl_flags): Add this_thunk_p flag. + Rename vcall_offset to virtual_offset. + (struct lang_decl): Rename delta to fixed_offset. + (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines. + (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg. + (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ... + (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here. + (make_thunk): Add this_adjusting arg. + (finish_thunk): Declare. + (mangle_thunk): Add this_adjusting arg. + * class.c (get_vcall_index): Use base function for lookup. + (update_vtable_entry_for_fn): Generate covariant thunk. + (finish_struct_1): Set DECL_VINDEX to NULL for thunks. + (build_vtbl_initializer): Use base function for lookup. + Finish covariant thunk here. Adjust thunk generation. + * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling. + Adjust thunk dumping. + * mangle.c (mangle_call_offset): New function. + (mangle_thunk): Adjust for covariant thunks. + * method.c (make_thunk): Adjust. Do not set name here. + (finish_thunk): New function. Set name here. + (use_thunk): Generate covariant thunks too. + (thunk_adjust): New function. + * search.c (covariant_return_p): Remove. Fold into ... + (check_final_overrider): ... here. Simplify. + * semantics.c (emit_associated_thunks): Walk covariant thunk lists. + +2002-12-03 Jason Merrill + + PR c++/8674 + * call.c (build_over_call): Check specifically for TARGET_EXPR + when eliding. + + PR c++/8461, c++/8625 + * call.c (convert_for_arg_passing): Don't mess with error_mark_node. + (cp_convert_parm_for_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): + Remove. + * cp-tree.h (ADDR_IS_INVISIREF): Remove. + * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code. + + * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on + an ambiguous conversion. + +2002-12-03 Mark Mitchell + + PR c++/8688 + * decl.c (reshape_init): Handle erroneous initializers. + +2002-12-02 Mark Mitchell + + PR c++/8720 + * spew.c (remove_last_token): Make sure that last_chunk is set + correctly. + + PR c++/8615 + * error.c (dump_expr): Handle character constants with + TREE_OVERFLOW set. + +2002-12-02 Kriang Lerdsuwanakij + + DR 180 + * decl.c (grokdeclarator): Require class-key for all friend class. + Output the correct type and context in the error message. + +2002-12-01 Mark Mitchell + + PR c++/5919 + * pt.c (unify): Use variably_modified_type_p to test validity of + template argument types. + + PR c++/8727 + * cp-tree.h (lang_type_class): Add typeinfo_var. + (CLASSTYPE_TYPEINFO_VAR): New macro. + * rtti.c (get_tinfo_decl): Use it. + + PR c++/8663 + * init.c (expand_member_init): Always get the main variant of a + base class. + +2002-12-01 Mark Mitchell + + PR c++/8332 + PR c++/8493 + * decl.c (cxx_init_decl_processing): Use size_type_node, not + c_size_type_node. + * decl2.c (coerce_new_type): Likewise. + * except.c (do_allocate_exception): Likewise. + +2002-11-30 Zack Weinberg + + * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c, + dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c, + lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c, + repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, + typeck2.c: Include coretypes.h and tm.h. + * Make-lang.in: Update dependencies. + +2002-11-30 Mark Mitchell + + PR c++/8227 + * decl.c (layout_var_decl): Deal gracefully with erroneous types. + (check_initializer): Validate the type of the initialized + variable, even if the initializer is absent. + * typeck.c (cp_type_quals): Deal gracefully with erroneous types. + + PR c++/8214 + * typeck.c (convert_for_assignment): Do not use + decl_constant_value on the operand. + + PR c++/8511 + * pt.c (instantiate_decl): Handle template friends defined outside + of the class correctly. + +2002-11-29 Joe Buck + + * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for + anonymous structs. + +2002-11-29 Mark Mitchell + + * class.c (walk_subobject_offsets): Recur on binfos as well as on + types. + (layout_nonempty_base_or_field): Pass it a binfo when processing a + base class. + (layout_empty_base): Likewise. + (build_base_field): Likewise. + +2002-11-27 Mark Mitchell + + * class.c (build_base_field): Make sure we get the canonical base + when descending through primary bases. + +2002-11-26 Geoffrey Keating + + * decl.c (check_initializer): Don't error on initialisation of + a scalar with a brace-enclosed expression. + +2002-11-26 Nathan Sidwell + + * cp-tree.h (DECL_LANG_FLAG_4): Document more uses. + (template_parms_equal): Remove prototype. + * typeck.c (buuld_indirect_ref): Reformat. + +2002-11-25 Jason Merrill + + * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT + and a DO_STMT. + +2002-11-25 Mark Mitchell + + * tree.c (cp_build_qualified_type_real): Correct handling of + array types. + * class.c (walk_subobject_offsets): Fix thinko. + (build_base_field): Record offsets of empty bases in primary + virtual bases. + (layout_class_type): Record offsets of empty bases in fields. + + * search.c (is_subobject_of_p_1): Fix thinko. + (lookup_field_queue_p): Likewise. + +2002-11-24 Mark Mitchell + + * class.c (layout_class_type): Reuse tail padding when laying out + virtual bases. + +2002-11-22 Mark Mitchell + + * rtti.c (qualifier_flags): Fix thinko. + +2002-11-21 Gabriel Dos Reis + + Remove traditional C constructs 1/n. + * cp-tree.h (init_method, set_mangled_name_for_decl, + build_opfncall, hack_identifier, make_thunk, use_thunk, + synthesize_method, implicitly_declare_fn, + skip_artificial_parms_for, optimize_function, calls_setjmp_p, + maybe_clone_body): Remove use of PARAMS. + + * method.c (do_build_assign_ref, do_build_copy_constructor, + synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy): + Likewise. + (synthesize_method): Use 'bool' type and constants instead of + 'int'. + (locate_copy): Likewise. + (implicitly_declare_fn): Likewise. + + * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function): + Remove old-style declaration. + (maybe_clone_body): Use 'bool' type and constants. + +2002-11-21 Glen Nakamura + + PR c++/8342 + * typeck.c (get_member_function_from_ptrfunc): Make sure that a + SAVE_EXPR for instance_ptr doesn't get evaluated first inside one + of the branches of a COND_EXPR. + +2002-11-19 Mark Mitchell + + * pt.c (for_each_template_parm): Free allocated memory. + * search.c (is_subobject_of_p_1): New function. + (is_subobject_of_p): Avoid walking virtual bases multiple times. + +2002-11-19 Jason Thorpe + + * g++spec.c (lang_specific_spec_functions): New. + +2002-11-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * class.c: Likewise. + * decl2.c: Likewise. + +2002-11-14 Zack Weinberg + + * search.c (dfs_push_decls): Do not try to reorder elements + 3..n of method_vec if method_vec has only two elements. + Reverse order of two tests to avoid accessing unallocated + memory. + +2002-11-14 Mark Mitchell + + * class.c (dfs_find_final_overrider): Adjust so that the most + derived object is a binfo, rather than a class type. + (find_final_overrider): Likewise. + (add_vcall_offset_vtbl_entries_1): Simplify accordingly. + (add_vcall_offset): Likewise. + +2002-11-09 Kriang Lerdsuwanakij + + PR c++/8389 + * pt.c (instantiate_template): Push class scope for member + functions. + (get_mostly_instantiated_function_type): Likewise. Don't call + tsubst on context. Remove CONTEXTP and TPARMSP parameters. + * cp-tree.h (get_mostly_instantiated_function_type): Adjust. + * mangle.c (write_encoding, write_unqualified_name): Adjust. + +2002-11-07 Mark Mitchell + + * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of + vcall offfsets. Split out ... + (add_vcall_offset): ... new function. + + PR c++/8338 + * pt.c (for_each_template_parm): Add htab parameter. + (process_partial_specialization): Adjust call. + (push_template_decl_real): Likewise. + (pair_fn_data): Add visited. + (for_each_template_parm_r): Avoid walking duplicates more than + once. + (uses_template_parms): Adjust call to for_each_template_parm. + +2002-11-07 Mark Mitchell + + * class.c (add_implicitly_declared_members): Put implicitly + declared functions at the end of TYPE_METHODs when -fabi-version + is at least 2. + +2002-11-05 Geoffrey Keating + + * decl2.c (finish_file): Correct spelling. + +2002-11-03 Mark Mitchell + + * call.c (build_special_member_call): Do not try to lookup VTTs by + name. + * class.c (vtbl_init_data): Add generate_vcall_entries. + (get_vtable_decl): Do not look up virtual tables by name. + (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P. + (set_primary_base): Do not set CLASSTYPE_RTTI. + (determine_primary_base): Likewise. + (get_matching_virtual): Remove. + (get_vcall_index): New function. + (update_vtable_entry_for_fn): Do not try to use virtual thunks + when they are not required. Assign vcall indices at this point. + (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT. + Do update dynamic_classes. + (build_vtt): Do not add VTTs to the symbol table. + (build_ctor_vtbl_group): Likewise. + (build_vtbl_initializer): Simplify handling of vcall indices. + (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets + for the most derived class. + (add_vcall_offset_vtbl_entries_1): But do not actually add them to + the vtable. + * cp-tree.h (dynamic_classes): New macro. + (lang_type_class): Remove rtti. Add vtables. Add vcall_indices. + (CLASSTYPE_RTTI): Remove. + (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove. + (CLASSTYPE_VCALL_INDICES): New macro. + (CLASSTYPE_VTABLES): Likewise. + (BV_USE_VCALL_INDEX_P): Remove. + (build_vtable_path): Remove. + * decl2.c (finish_vtable_vardecl): Remove. + (key_method): Remove #if 0'd code. + (finish_vtable_vardecl): Rename to ... + (maybe_emit_vtables): ... this. + (finish_file): Use it. + * search.c (look_for_overrides_here): Update comment. + +2002-11-01 Zack Weinberg + + PR c/7353 redux + * decl2.c (grokfield): Reject TYPE_DECLs with initializers. + +2002-10-30 Jason Merrill + + PR c++/8186 + * cp-tree.h (ADDR_IS_INVISIREF): New macro. + * call.c (convert_for_arg_passing): Set it. + * except.c (stabilize_throw_expr): Recurse for such an arg. + +2002-10-31 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove init_priority. + (lang_decl): Add delta. + (GLOBAL_INIT_PRIORITY): Remove. + (THUNK_DELTA): Revise definition. + * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY. + * dump.c (cp_dump_tree): Don't dump it. + +2002-10-30 Mark Mitchell + + PR c++/8160 + * typeck2.c (process_init_constructor): Call complete_array_type. + + PR c++/8149 + * decl.c (make_typename_type): Issue errors about invalid results. + +2002-10-30 Kriang Lerdsuwanakij + + Core issue 287, PR c++/7639 + * cp-tree.h (lang_type_class): Add decl_list field. + (CLASSTYPE_DECL_LIST): New macro. + (maybe_add_class_template_decl_list): Add declaration. + * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST. + (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST. + (maybe_add_class_template_decl_list): New function. + (add_implicitly_declared_members): Use it. + * decl.c (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + * friend.c (add_friend): Likewise. + (make_friend_class): Likewise. + * semantics.c (finish_member_declaration): Likewise. + (begin_class_definition): Initialize CLASSTYPE_DECL_LIST. + * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST + to process members and friends in the order of declaration. + +2002-10-29 Mark Mitchell + + PR c++/8287 + * decl.c (finish_destructor_body): Create the label to jump to + when returning from a destructor here. + (finish_function_body): Rather than here. + +2002-10-25 Zack Weinberg + + PR c++/7266 + * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a + SCOPE_REF is not null before dereferencing it. + +2002-10-25 Mark Mitchell + + * call.c (build_over_call): Use DECL_CONTEXT, not + DECL_VIRTUAL_CONTEXT. + * class.c (modify_vtable_entry): Don't mess with + DECL_VIRTUAL_CONTEXT. + (set_vindex): Remove. + (set_primary_base): Remove vfuns_p parameter. + (determine_primary_base): Likewise. + (modify_all_vtables): Likewise. + (layout_class_type): Likewise. Adjust calls to other functions + accordingly. + (finish_struct_1): Adjust calls to modified functions. Set + DECL_VINDEX here. + * cp-tree.h (lang_type_class): Remove vsize. + (CLASSTYPE_VSIZE): Remove. + (lang_decl): Remove thunks. + (DECL_THUNKS): Adjust. + (DECL_VIRTUAL_CONTEXT): Remove. + (duplicate_decls): Don't copy it. + * pt.c (build_template_decl): Don't set it. + (tsubst_decl): Likewise. + * typeck.c (expand_ptrmemfunc_cst): Don't use it. + + * class.c (build_vtbl_initializer): Don't use build_vtable_entry. + (build_vtable_entry): Remove. + * cp-tree.h (BINFO_VIRTUALS): Expand documentation. + (lang_decl): Add thunks. + (DECL_THUNKS): New macro. + * decl.c (duplicate_decls): Copy it. + * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS. + * semantics.c (emit_associated_thunks): Simplify. + +2002-10-24 David Edelsohn + + PR c++/7228 + * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that + lang_type structure exists before accessing field. + (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro. + (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar. + (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro. + * class.c (check_field_decls): Use new macros. + * typeck2.c (process_init_constructor): Remove redundant check for + existence of lang_type structure. + +2002-10-24 Mark Mitchell + + * class.c (end_of_base): New method. + (end_of_class): Use it. Check indirect virtual bases. + + * class.c (check_field_decls): Fix typo. + +2002-10-23 Mark Mitchell + + PR c++/8067 + * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and + related variables. + + PR c++/7679 + * spew.c (next_token): Do not return an endless stream of + END_OF_SAVED_INPUT tokens. + (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of + the cached token stream. + (snarf_defarg): Likewise. + +2002-10-23 Zack Weinberg + + * cp-lang.c (cp_var_mod_type_p): New: C++ hook for + variably_modified_type_p. + * cp-tree.h: Remove prototype of variably_modified_type_p. + * tree.c (variably_modified_type_p): Remove; now implemented + in language-independent code. + +2002-10-22 Mark Mitchell + + PR c++/6579 + * spew.c (snarf_parenthesized_expression): New function. + (snarf_block): Use it. + +2002-10-22 Richard Henderson + + * method.c (use_thunk): Always compute vcall_value; assert that + it is not zero. Use can_output_mi_thunk; use output_mi_thunk + for vcall thunks as well. + +2002-10-21 Mark Mitchell + + * class.c (empty_base_at_nonzero_offset_p): New function. + (layout_nonempty_base_or_field): Do not check for conflicts when + laying out a virtual base using the GCC 3.2 ABI. + (build_base_field): Correct checking for presence of empty classes + at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P. + + * class.c (include_empty_classes): Use normalize_rli. + (layout_class_type): Likewise. + + * decl.c (reshape_init): Tweak handling of character arrays. + + PR c++/8218 + * cp-tree.h (lang_type_class): Add contains_empty_class_p. + (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro. + * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P. + (check_field_decls): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Initialize it. + (walk_subobject_offsets): Use it to prune searches. + +2002-10-20 Mark Mitchell + + * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT. + * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with + TARGET_ASM_OUTPUT_MI_THUNK in comments. + +2002-10-18 Zack Weinberg + + * decl.c (start_decl): Point users of the old initialized- + typedef extension at __typeof__. + +2002-10-18 Mark Mitchell + + * Make-lang.in (method.o): Depend on TARGET_H. + * method.c (target.h): Include it. + (use_thunk): Use target hooks. Use vcall thunks, if available. + +2002-10-18 Mark Mitchell + + * class.c (base_derived_from): Make sure return value is a bool. + +2002-10-18 Mark Mitchell + + * class.c (find_final_overrider_data_s): Remove overriding_fn and + overriding_base. + (dfs_base_derived_from): New function. + (base_derived_from): Likewise. + (dfs_find_final_overrider): Use base_derived_from. + (find_final_overrider): Adjust. + +2002-10-18 Jason Merrill + + PR c++/8080 + * semantics.c (finish_for_cond, finish_while_cond): Don't mess + with condition decls in a template. + +2002-10-17 Nathan Sidwell + + * class.c (add_method): Compare template parms too. + +2002-10-17 Mark Mitchell + + PR c++/7584 + * class.c (handle_using_decl): Allow the declaration used to be + from an ambiguous base. + + * pt.c (convert_template_argument): Revert this change: + 2002-10-16 Mark Mitchell + * pt.c (convert_template_argument): Do not fold non-type + template rguments when inside a template. + + * init.c (expand_default_init): Handle brace-enclosed initializers + correctly. + +2002-10-16 Mark Mitchell + + * mangle.c (write_expression): Correct handling of enumeration + constants. + (write_template_arg): Likewise. + * pt.c (convert_template_argument): Do not fold non-type template + arguments when inside a template. + + PR c++/7478 + * cvt.c (convert_to_reference): Allow references as the incoming + type. + +2002-10-16 Mark Mitchell + + PR c++/7524 + * method.c (do_build_assign_ref): Use cp_build_qualified_type, not + build_qualified_type. + +2002-10-15 Richard Henderson + + * error.c (dump_expr): Use real_to_decimal directly, and with + the new arguments. + +2002-10-15 Mark Mitchell + + * decl.c (reshape_init): Fix typo. + + * cp-tree.h (operator_name_info_t): Add arity. + * lex.c (init_operators): Initialize it. + * mangle.c (write_conversion_operator_name): New function. + (write_unqualified_name): Use it. + (write_template_args): Accept template arguments as a TREE_LIST. + (write_expression): Adjust handling of qualified names to match + specification. + +2002-10-15 Jason Merrill + + * call.c (call_builtin_trap): New fn. + (convert_arg_to_ellipsis): Use it. Downgrade error to warning. + (build_call): Don't set current_function_returns_abnormally outside + a function. + +2002-10-14 Mark Mitchell + + * class.c (check_field_decls): Remove empty_p parameter. Instead, + clear CLASSTYPE_EMPTY_P. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (check_bases_and_members): Likewise. + (create_vtbl_ptr): Likewise. + (layout_class_type): Likewise. Ensure that empty classes have + size zero when used as base classes in the 3.2 ABI. + (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and + CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p + parameter. + (is_empty_class): Correct definition when using post-3.2 ABI. + * cp-tree.h (lang_type_class): Add empty_p. + (CLASSTYPE_EMPTY_P): New macro. + +2002-10-12 Nathan Sidwell + + * init.c (build_delete): Do not apply save_expr for arrays. + (build_vec_delete): Likewise. + +2002-10-14 Mark Mitchell + + * decl.c (layout_var_decl): Call layout_decl even for variables + whose type is an array with unspecified bounds. + + PR c++/7176 + * lex.c (do_identifier): Add another option for the parsing + parameter. + * parse.y (do_id): Use it. + +2002-10-11 Gabriel Dos Reis + + PRs C++/6803, C++/7721 and C++/7803 + * decl.c (grokdeclarator): Gracefully handle template-name as + decl-specifier. + +2002-10-11 Jason Molenda + + * init.c (build_field_list): Provide uses_unions_p with a default + value. + +2002-10-11 Mark Mitchell + + PR c++/5661 + * cp-tree.h (variably_modified_type_p): New function. + (grokdeclarator) Tighten check for variably modified types as + fields. + * pt.c (convert_template_argument): Do not allow variably modified + types as template arguments. + * tree.c (variably_modified_type_p): New function. + + * NEWS: Document removal of "new X = ..." extension. + * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on + brace-enclosed initializers. + * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro. + (initialize_local_var): Remove declaration. + (expand_static_init): Likewise. + * decl.c (next_initializable_field): New function. + (reshape_init): Likewise. + (check_initializer): Use them. Build dynamic initializer for + aggregates here too. + (initialize_local_var): Simplify, and incorporate cleanup + insertion code as well. + (destroy_local_var): Remove. + (cp_finish_decl): Tidy. + (expand_static_init): Fold checks for whether or not a variable + needs initialization into this function. Simplify. + * decl2.c (do_static_initialization): Simplify. + * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will + be done for us automatically. + (expand_default_init): Handle brace-enclosed initializers + correctly. + (expand_aggr_init_1): Remove RTL-generation code. + (build_vec_init): Remove "new X = ..." support. + * parse.y (new_initializer): Likewise. + * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on + brace-enclosed initializer. + (create_pseudo_type_info): Likewise. + * typeck2.c (store_init_value): Don't try to handle digest_init + being called more than once. + (digest_init): Tidy handling of brace-enclosed initializers. + +2002-10-10 Kaveh R. Ghazi + + * decl.c (typename_hash): Use htab_hash_pointer. + +2002-10-10 Jim Wilson + + * decl.c (duplicate_decls): Don't call decl_attributes. + +2002-10-09 Zack Weinberg + + PR c/7353 + * decl.c (start_decl): Unconditionally issue error for + 'typedef foo = bar'. + (cp_finish_decl): Remove special case for TYPE_DECL with initializer. + (grokdeclarator): Remove redundant error for 'typedef foo = bar'. + +2002-10-09 Kaveh R. Ghazi + + * decl2.c (prune_vtable_vardecl): Delete unused function. + +2002-10-03 Mark Mitchell + + PR c++/7754 + * decl2.c (finish_anon_union): Do not expand anonymous unions when + procesing template functions. + * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable + type. Call layout_decl. + (tsubst_expr, case DECL_STMT): Handle anonymous unions. + +2002-10-07 Richard Henderson + + * decl2.c, pt.c: Revert c++/7754 fix. + +2002-10-05 Kriang Lerdsuwanakij + + PR c++/7804 + * error.c (dump_expr) [REAL_CST]: Output in decimal format. + +2002-10-03 Mark Mitchell + + PR c++/7931 + * pt.c (for_each_template_parm_r): Handle BASELINKs. + + PR c++/7754 + * decl2.c (finish_anon_union): Do not expand anonymous unions when + procesing template functions. + * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable + type. Call layout_decl. + (tsubst_expr, case DECL_STMT): Handle anonymous unions. + +2002-10-03 Mark Mitchell + + PR c++/8006 + * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template + template parameters. + (globals): Add entity and need_abi_warning. + (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not + CLASSTYPE_TEMPLATE_INFO. + (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not + TYPE_TI_TEMPLATE. + (write_prefix): Handle typename types correctly. + (write_template_prefix): Handle template template parameters + correctly. + (start_mangling): Add entity parameter. + (finish_mangling): Warn about names whose mangling will change. + (mangle_decl_string): Adjust. + (mangle_type_string): Likewise. + (mangle_special_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_guard_variable): Likewise. + (mangle_ref_init_variable): Likewise. + +2002-10-02 Mark Mitchell + + PR c++/7188. + * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two. + * cp-tree.h (emit_base_init): Rename to .... + (emit_mem_initializers): ... this. + (expand_member_init): Change prototype. + * init.c (perform_member_init): Compute explicit, rather than + requiring it as a parameter. + (sort_member_init): Rename to ... + (sort_mem_initializers): ... this. Process bases and data members + together. + (sort_base_init): Remove. + (emit_base_init): Rename to ... + (emit_mem_initializers): ... this. + (expand_aggr_vbase_init_1): Remove. + (construct_virtual_bases): Rename to ... + (construct_virtual_base): ... this. + (expand_member_init): Rework handling of base initializers. + * method.c (do_build_copy_constructor): Use + finish_mem_initializers. + * parse.y (member_init): Adjust calls to expand_member_init. + * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case. + (tsubst_initializer_list): Use expand_member_init. + * semantics.c (finish_mem_intiailizers): Simplify. + +2002-10-02 Matt Austern + * decl.c (walk_vtables_r): Fixed typo that caused result to + never get a nonzero value. + +2002-10-02 Roger Sayle + + PR optimization/6627 + * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition + from here, and move it to tree.h. + * decl.c (cxx_init_decl_processing): If storing the vbit + in function pointers, ensure that force_align_functions_log + is atleast one. + +2002-10-02 Matt Austern + + * class.c (check_field_decls): Changed warning about const member + variables so that it doesn't get issued for a class aggregate. + +2002-10-01 Mark Mitchell + + * decl.c (cp_finish_decl): Make sure array types are laid out, + even if the array bounds are unknown. + +2002-10-01 Steve Ellcey + + * class.c (build_vtbl_initializer): Change build_c_cast + to build1. + +2002-10-01 Mark Mitchell + + * decl.c (cp_finish_decl): Make sure array types are laid out, + even if the array bounds are unknown. + + * decl.c (cp_finish_decl): Correct check for dynamic + initialization of thread-local storage. + +2002-09-30 Nathan Sidwell + + * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also + overloaded. + +2002-09-30 Steve Ellcey + + * class.c (build_vtbl_initializer): Add cast. + (add_vcall_offset_vtbl_entries_1): + Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset. + +2002-09-30 Mark Mitchell + + * class.c (walk_subobject_offsets): Correct the calculation of + offsets for virtual bases. Correct the counting of array + elements. + (layout_nonempty_base_or_field): Simplify. Correct the + calculation of offsets to be propagated through the binfo + hierarchy. + (build_base_field): Avoid creating a FIELD_DECL for empty bases. + Add the FIELD_DECL to TYPE_FIELDS. + (build_base_fields): Adjust accordingly. + (layout_virtual_bases): Use build_base_field. + (end_of_class): Return a tree, not an integer. + (warn_about_ambiguous_direct_bases): Rename to ... + (warn_about_ambiguous_bases): ... this. + (include_empty_classes): New function. + (layout_class_type): Create an alternative version of the type to + be used when as a base class type. Do not call + finish_record_layout until we are done laying out the class. + * cp-tree.h (lang_type_class): Remove size, size_unit. Add + as_base. + (CLASSTYPE_SIZE): Reimplement. + (CLASSTYPE_SIZE_UNIT): Likewise. + (CLASSTYPE_ALIGN): Likweise. + (CLASSTYPE_USER_ALIGN): Likewise. + (CLASSTYPE_AS_BASE): New macro. + (DECL_INITIALIZED_P): Likewise. + (extract_init): Remove prototype. + (build_forced_zero_init): Rename to ... + (build_zero_init): ... this. + (force_store_init_value): Remove. + * decl.c (obscure_complex_init): Remove. + (duplicate_decls): Copy DECL_INITIALIZED_P. + (check_initializer): Do not leave junk in DECL_INITIAL. + (cp_finish_decl): Handle zero-initialization of entities with + static storage duration. + * expr.c (extract_init): Remove. + * init.c (build_forced_zero_init): Remove. + (build_zero_init): New function. + (build_default_init): Use it. + (build_field_list): Skip FIELD_DECLs for base subobjects. + (push_base_cleanups): Likewise. + * method.c (do_build_assign_ref): Likewise. + (synthesize_exception_spec): Likewise. + * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P. + (regenerate_decl_from_template): To not set DECL_INITIAL for a + static data member whose initialization took place in its class. + (instantiate_decl): Do not pass an initializer to cp_finish_decl + in that situation. + * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects. + (dfs_unuse_fields): Likewise. + * tree.c (pod_type_p): Handle error_mark_node. + (zero_init_p): Likewise. + * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base + subobjects. + * typeck2.c (store_init_value): Remove #if 0'd code. + (force_store_init_value): Remove. + (process_init_constructor): Use build_zero_init. + +2002-09-29 Nathan Sidwell + + PR c++/7788 + * rtti.c (unemitted_tinfo_decl_p): Check it has a field. + +2002-09-29 Kazu Hirata + + * cp-tree.h: Fix comment typos. + * decl.c: Likewise. + * pt.c: Likewise. + +2002-09-25 Mark Mitchell + + * cp/class.c (contains_empty_class_p): New method. + (walk_subobject_offsets): Correct computation of field offset. + (layout_empty_base): Correct placement of emtpy base classes. + (layout_class_type): Warn about ABI changes. + +2002-09-23 Mark Mitchell + + * cp/class.c (layout_virtual_bases): Do not round the size of the + type to a multiple of the alignment before laying out virtual bases. + (layout_class_type): Correct handling of bit-fields that are wider + than their type inside unions. Round the size of the type to a + even number of bytes when computing the size without virtual + bases. + * cp/cp-tree.h (abi_version_at_least): New macro. + +2002-09-21 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.2: Likewise. + * call.c: Likewise. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * friend.c: Likewise. + * g++spec.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * mangle.c: Likewise. + * method.c: Likewise. + * operators.def: Likewise. + * optimize.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2002-09-18 Devang Patel + + * cp/cp-tree.h: New prototype for walk_vtabls(). + * cp/decl.c (walk_vtables_r): New function. + (struct cp_binding_level): Add new members, namespaces, + names_size and vtables. + (add_decl_to_level): Add decl in namespaces or vtables + chain, if conditions match. + (walk_vtables): New function. + (walk_namespaces_r): Travers separate namespace chain + for namespace decls. + (wrapup_globals_for_namespace): Use names_size instead + of list_length(). + * cp/decl2.c (finish_file): Use walk_vtables() instead of + walk_globals() to walk vtable decls. + +2002-09-18 Nathan Sidwell + + * decl.c (grokdeclarator): Use assert, not internal_error. Don't + ICE with invalid pointers & references. + +2002-09-17 Zack Weinberg + + * Make-lang.in: Remove all references to the demangler. + * cxxfilt.c: Moved to binutils. + +2002-09-16 Nathan Sidwell + + PR c++/7718 + * pt.c (tsubst_decl): Remove assert. + + Remove DR 295 implementation. + * pt.c (check_cv_quals_for_unify): Disable function & method cases. + * tree.c (cp_build_qualified_type_real): Likewise. Don't warn + about ignoring volatile qualifiers. + + * search.c (lookup_member): Correct documentation. + +2002-09-16 Geoffrey Keating + + * cp-tree.h (union lang_tree_node): Add chain_next option. + +2002-09-16 Nathan Sidwell + + * parse.y (parse_finish_call_expr): Check lookup_member result. + + PR c++/7015 + * semantic.c (finish_asm_stmt): Fix operand/output_operands + thinko. + * typeck.c (c_expand_asm_operands): Protect from error_mark_node. + +2002-09-15 Nathan Sidwell + + PR c++/7919 + * call.c (build_over_call): Convert this pointer for fns found by + using decls. + +2002-09-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.1: Likewise. + +2002-09-14 Nathan Sidwell + + PR c++/7768 + * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P. + +2002-09-14 Kazu Hirata + + * error.c: Fix comment formatting. + * except.c: Likewise. + * expr.c: Likewise. + * friend.c: Likewise. + * g++spec.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * mangle.c: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2002-09-13 Matt Austern + + PR C++/7828 + * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p. + * cp/call.c: Change call-by-const-reference mechanism to use + non_cast_lvalue_p when deciding whether the create a temporary. + We need a temporary when passing, e.g. (long) x by const ref. + +2002-09-13 Nathan Sidwell + + * pt.c (unify, ARRAY_TYPE): Element type can be more qualified. + +2002-09-13 Kazu Hirata + + * decl.c: Fix comment formatting. + * decl2.c: Likewise. + +2002-09-12 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-lang.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + +2002-09-11 Zack Weinberg + + * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c, + and c++filt from cxxfilt.o + version.o + $(LIBDEPS). + * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with + minor adjustments (use version_string, eliminate yet another + duplicate of xmalloc) + +2002-09-08 Kaveh R. Ghazi + + * cp-tree.h (require_complete_eh_spec_types): Add prototype. + +2002-09-05 Jason Merrill + + * typeck2.c (add_exception_specifier): Only pedwarn for an + incomplete type. + (require_complete_eh_spec_types): New fn. + (cxx_incomplete_type_diagnostic): Also support pedwarning. + * typeck.c (complete_type_or_diagnostic): Likewise. + * call.c (build_call): Call require_complete_eh_spec_types. + * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting + on an incomplete type. + +2002-09-04 Jakub Jelinek + + * decl.c (start_cleanup_fn): Clear interface_only before + start_function, restore it afterwards. + +2002-09-02 Nathan Sidwell + + * cp-tree.h (finish_builtin_type): Remove. + * decl2.c (finish_builtin_type): Move to common code. + * decl.c (build_ptrmemfunc_type): Adjust. + * rtti.c (create_pseudo_type_info): Adjust. + (create_tinfo_types): Adjust. + +2002-08-31 Jason Merrill + + * cp-lang.c (cp_expr_size): Allow initialization from a + CONSTRUCTOR. + +2002-08-30 Richard Henderson + + PR opt/7515 + * tree.c: Include target.h. + (cp_cannot_inline_tree_fn): Don't auto-inline functions that + don't bind locally. + * Makefile.in (tree.o): Update. + +2002-08-27 Mark Mitchell + + * class.c (layout_virtual_bases): Warn about bugs in G++ that + result in incorrect object layouts. + (layout_class_type): Likewise. + +2002-08-24 Matt Austern + + * tree.c (lvalue_p_1): Add argument for whether casts of lvalues + are allowable. + (real_lvalue_p): Update caller. + (lvalue_p): Ditto. + (non_cast_lvalue_or_else): New. + * tree.h: Declare it. + * typeck.c (build_unary_op): Use non_cast_lvalue_or_else. + +2002-08-22 Mark Mitchell + + * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR + and COND_EXPR specially; fix error message output. + +2002-08-22 Jason Merrill + + * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR. + * semantics.c (nullify_returns_r): Likewise. + +2002-08-17 Gabriel Dos Reis + + Fix PR/7621 + * typeck.c (finish_class_member_access_expr): Diagnose cases where + name lookup finds nothing. + +2002-08-15 Jason Merrill + + * semantics.c (finish_then_clause): Remove redundant assignment. + (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the + extra binding level outside the if/switch statement. + (finish_while_cond, finish_for_cond): Rewrite complex condition + into the loop body. + +2002-08-15 Alexandre Oliva + + * parse.y (sizeof, alignof, typeof): New non-terminals to + increment skip_evaluation. Replace terminals with them and + decrement skip_evaluation at the end of rules using them. + * decl2.c (mark_used): Don't assemble_external if + skipping evaluation. + +2002-08-15 Gabriel Dos Reis + + Fix PR/7504 + * parse.y (parse_finish_call_expr): Handle incomplete + type used to name a scope. + +2002-08-15 Nathan Sidwell + + PR c++/7598 + * typeck.c (build_unary_op): Fold offsetof idiom. Fixes + regression caused by my 2002-08-08 patch. + +2002-08-13 Mark Mitchell + + * decl.c (pushdecl_class_level): Honor requests to bind names to + OVERLOADs. + +2002-08-11 Kaveh R. Ghazi + + * decl2.c (build_call_from_tree): Fix uninitialized variable. + * parse.y (parse_finish_call_expr): Likewise. + * repo.c (old_args, old_dir, old_main): Const-ify. + +2002-08-11 Gabriel Dos Reis + + * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE + DECL_SOURCE_LINE with DECL_SOURCE_LOCATION. + * optimize.c (maybe_clone_body): Likewise. + * pt.c (tsubst_enum): Likewise. + (lookup_template_class): Likewise. + * tree.c (cp_copy_res_decl_for_inlining): Likewise. + +2002-08-10 Neil Booth + + * lang-specs.h: Remove -ansi. + +2002-08-10 Nathan Sidwell + + * tree.c (maybe_dummy_object): Replace // with /* */ + +2002-08-09 Mark Mitchell + + * call.c (standard_conversion): Use build_ptrmem_type. + * cp-tree.h (build_ptrmem_type): New function. + (adjust_result_of_qualified_name_lookup): Likewise. + * decl.c (grokvardecl): Do not look for OFFSET_TYPEs to indicate + static data members. + (build_ptrmem_type): New function. + (grokdeclarator): Do not use build_offset_type when encountering a + qualified name. + * parse.y (parse_finish_call_expr): Use + adjust_result_of_qualified_name_lookup. + * search.c (adjust_result_of_qualified_name_lookup): New function. + * typeck.c (qualify_type_recursive): Use TYPE_PTRMEM_* rather than + accessing OFFSET_TYPEs directly. + +2002-08-08 Mike Stump + + * call.c (add_builtin_candidate): legal -> valid, illegal -> invalid. + (type_decays_to): Likewise. + * class.c (find_final_overrider): Likewise. + (maybe_note_name_used_in_class): Likewise. + * decl.c (current_tmpl_spec_kind): Likewise. + (add_binding): Likewise. + (push_class_binding): Likewise. + (duplicate_decls): Likewise. + (layout_var_decl): Likewise. + (grokfndecl): Likewise. + (grokdeclarator): Likewise. + (check_default_argument): Likewise. + * decl2.c (handle_class_head): Likewise. + * error.c (dump_template_decl): Likewise. + * init.c (build_offset_ref): Likewise. + * pt.c (check_specialization_scope): Likewise. + (determine_specialization): Likewise. + (check_explicit_specialization): Likewise. + (maybe_check_template_type): Likewise. + (process_partial_specialization): Likewise. + (check_default_tmpl_args): Likewise. + (push_template_decl_real): Likewise. + (convert_template_argument): Likewise. + (try_class_unification): Likewise. + (get_bindings_real): Likewise. + (do_decl_instantiation): Likewise. + * semantics.c (begin_function_definition): Likewise. + (finish_member_declaration): Likewise. + (check_multiple_declarators): Likewise. + * typeck.c (comp_array_types): Likewise. + (comptypes): Likewise. + (expr_sizeof): Likewise. + (build_binary_op): Likewise. + (dubious_conversion_warnings): Likewise. + (check_return_expr): Likewise. + +2002-08-08 Mark Mitchell + + * typeck.c (build_class_member_access_expr): Do not return + error_mark_node when no error has occurred. + +2002-08-08 Nathan Sidwell + + * typeck.c (build_component_addr): Remove. + (build_unary_op): Just check it's not a bitfield, and then build + an ADDR_EXPR. + +2002-08-08 Nathan Sidwell + + * class.c (convert_to_base): Correct check for error_mark_node. + (create_vtable_ptr): Remove unused VFUNS_P parm. + +2002-08-08 Nathan Sidwell + + * cp/Make-lang.in (c++.mostlyclean): Remove coverage files. + +2002-08-07 Mark Mitchell + + Rework build_component_ref. + * call.c (build_vfield_ref): Do not go through build_component_ref. + (build_field_call): Use build_class_member_access_expr. + (build_user_type_conversion_1): Use BASELINK_FUNCTIONS. + (build_object_call): Likewise. + * class.c (convert_to_base): New function. + (type_requires_array_cookie): Use BASELINK_FUNCTIONS. + (instantiate_type): Handle BASELINKs. + * cp-tree.def (BASELINK): New tree code. + * cp-tree.h (BASELINK_P): Reimplement. + (SET_BASELINK_P): Remove. + (BASELINK_BINFO): Reimplement. + (BASELINK_FUNCTIONS): Likewise. + (BASELINK_ACCESS_BINFO): Likewise. + (BASELINK_OPTYPE): Likewise. + (convert_to_base): New function. + (name_p): Likewise. + (build_object_ref): Remove. + (build_component_ref_1): Likewise. + (build_component_ref): Likewise. + (build_x_component_ref): Likewise. + (build_class_member_access_expr): New function. + (finish_class_member_access_expr): Likewise. + (build_ptrmemfunc_access_expr): Likewise. + * decl.c (grokdeclarator): Handle BASELINKs. + * decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using + finish_class_member_access_expr. + (arg_assoc): Handle BASELINKs. + (do_class_using_decl): Likewise. + * error.c (dump_decl): Likewise. + (dump_expr): Use build_ptrmemfunc_access_expr. + * except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find + destructors. + (build_throw): Use BASELINK_FUNCTIONS. + * init.c (perform_member_init): Use + build_class_member_access_expr. + (build_offset_ref): Handle BASELINKs. Use + build_class_member_access_expr. + * method.c (hack_identifier): Likewise. + * parse.y (do_id): Use BASELINK, not TREE_LIST. + (primary): Remove uses of build_object_ref. + * pt.c (lookup_template_function): Handle BASELINKs. + (resolve_overloaded_unification): Likewise. + * search.c (build_baselink): Build a BASELINK, not a TREE_LIST. + (lookup_field): Use BASELINK, not TREE_LIST. + (lookup_fnfiels): Likewise. + (setup_class_bindings): Likewise. + * semantics.c (finish_object_call_expr): Do not use + build_method_call when we already know what function is being + called. + * spew.c (identifier_type): Use BASELINK, not TREE_LIST. + * tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not + TREE_CHAIN. + (name_p): New function. + * typeck.c (build_object_ref): Remove. + (build_component_ref_1): Likewise. + (build_x_component_ref): Likewise. + (build_class_member_access_expr): New function. + (finish_class_member_access_expr): Likewise. + (build_ptrmemfunc_access_expr): Likewise. + (get_member_function_from_ptrfunc): Use + build_ptrmemfunc_access_expr. + (build_binary_op): Likewise. + (build_unary_op): Likewise. + (build_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + * typeck2.c (build_m_component_ref): Adjust comment. + +2002-08-07 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + * cp-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. + * cp-tree.h (cxx_decode_option): Remove. + * decl2.c (compare_options, lang_f_options, unsupported_options, + cxx_decode_option): Remove. + +2002-08-06 Gabriel Dos Reis + + * typeck.c (build_x_unary_op): Handle pointer-to-member. + +2002-08-05 Geoffrey Keating + + * class.c: Don't include obstack.h. + (popclass): + * decl2.c: Delete bogus comment. + * error.c: Don't include obstack.h. + * except.c: Likewise. + (dump_type): Correct comment. + * method.c: Don't include obstack.h. + * tree.c: Likewise. + +2002-08-04 Gabriel Dos Reis + + Fix PR/2213 + * cvt.c (cp_convert_to_pointer): Reject conversions from integral + expressions to pointer-to-data-member of pointer-to-member-functions. + +2002-08-04 Geoffrey Keating + + * cvt.c (ocp_convert): Delete obsolete code. + * parse.y (permanent_obstack): Delete declaration. + * pt.c (permanent_obstack): Delete declaration. + * repo.c (permanent_obstack): Delete declaration. + (open_repo_file): Use xmalloc instead of permanent_obstack. + (init_repo): Use xstrdup instead of permanent_obstack. + +2002-08-04 Nathan Sidwell + + * cp-tree.h (VF_DERIVED_VALUE): Remove. + * class.c (finish_struct_1): Use VF_BINFO_VALUE not VF_DERIVED_VALUE. + +2002-08-03 Nathan Sidwell + + PR 7470. + C++ ABI change - vfunc ordering. + * class.c (add_virtual_function): Remove. + (dfs_modify_all_vtables): Take list of all declared + virtuals. Assign all that are not in primary base. + (check_for_override): Adjust comments. + (create_vtable_ptr): Take single list of virtuals. Build chain + of declared virtuals here. + (layout_class_type): Take single list of virtuals. Adjust. + (finish_struct_1): Keep virtuals on single list. Adjust. + +2002-08-02 Mark Mitchell + + * init.c (build_member_call): Use build_new_method_call, not + build_method_call. + +2002-08-02 Krister Walfridsson + + * Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies. + +2002-08-02 Mark Mitchell + + * call.c (build_method_call): Issue a more helpful error message + about ambiguous method names. + +2002-08-02 Nathan Sidwell + + * tree.c (build_shared_int_cst): Make cache file scope, and + GTY it. + +2002-08-02 Jason Merrill + + * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define. + (cp_expr_size): New fn. + * call.c (build_over_call): Lose empty class hackery. + (convert_arg_to_ellipsis): Promote non-POD warning to error. + * typeck.c (build_modify_expr): Don't use save_expr on an lvalue. + + * semantics.c (expand_body): Do tree optimization in the function + context, too. + +2002-08-01 Neil Booth + + * cp-tree.h: Move all warning and flag declarations to c-common.h. + * decl.c: Move all warning and flag variables to c-common.c. + * decl2.c: Move all warning and flag variables to c-common.c. + * lex.c (flag_digraphs): Remove. + (warn_traditional): Now in c-common.c. + +2002-07-31 Mark Mitchell + + * call.c (build_field_call): Do not look up the field by name. + (build_method_call): Simplify. + (struct z_candidate): Add access_path and conversion_path. Remove + basetype_path. + (convert_class_to_reference): Adjust use of + add_function_candidate. + (add_candidate): Add conversion_path argument. + (add_function_candidate): Use it. + (add_conv_dndidate): Likewise. + (build_builtin_candidate): Likewise. + (add_template_candidate_real): Add conversion_path argument. + (add_template_conv_candidate): Likewise. + (add_template_candidate): Likewise. + (build_user_type_conversion_1): Use it. + (build_new_function_call): Remove name lookup code. Adjust use of + add_template_candidate and add_function_candidate. + (build_new_op): Likewise. + (convert_like_real): Use build_special_member_call. + (build_over_call): Use cand->conversion_path. + (build_special_member_call): New method. + (build_new_method_call): Remove name lookup code. + * cp-tree.def (OFFSET_REF): Update documentation. + (TEMPLATE_ID_EXPR): Likewise. + * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. + (BASELINK_OPTYPE): Likewise. + (build_new_method_call): Adjust prototype. + (build_special_member_call): New method. + (build_baselink): New method. + (build_offset_ref_call_from_tree): Likewise. + (build_call_from_tree): Likewise. + (finish_qualified_call_expr): Remove. + (finish_call_expr): Adjust prototype. + (build_x_function_call): Remove. + * cvt.c (ocp_convert): Use build_special_member_call. + * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. + (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and + CALL_EXPR. + (build_offset_ref_call_from_tree): New function. + (build_call_from_tree): Likewise. + * init.c (expand_cleanup): Use build_special_member_call. + (expand_default_init): Likewise. + (build_member_call): Use finish_call_expr. + (build_new_1): Use build_special_member_call. + (push_base_cleanups): Likewise. + * method.c (do_build_assign_ref): Likewise. + * parse.y (template_id): Do not pass a COMPONENT_REF to + lookup_template_function. + (primary): Use parse_finish_call_epxr, not finish_call_expr. + (parse_finish_call_expr): New function. + * pt.c (lookup_template_function): Add assertions. + * search.c (lookup_base): Allow T to be a binfo. + (build_baselink): New function. + (lookup_member): Use it. + * semantics.c (finish_call_expr): Do not do name lookup. + (finish_object_call_expr): Remove #if 0'd code. + (finish_qualified_call_expr): Remove. + * typeck.c (build_x_function_call): Remove. + (build_static_case): Use build_special_member_call. + * typeck2.c (build_functional_cast): Likewise. + +2002-07-30 Franz Sirl + + * lang-specs.h: Remove __GXX_ABI_VERSION, moved to gcc.c. + +2002-07-30 Gabriel Dos Reis + + * cp-tree.h (VF_DERIVED_VALUE): Restore from previous deletion. + +2002-07-30 Nathan Sidwell + + * cp-tree.h (CLASSTYPE_VFIELDS, VF_*, BV_*): Add more + documentation. + +2002-07-29 Alan Modra + + * cp-tree.h: Comment typo fix. + +2002-07-29 Richard Earnshaw + + * spew.c (space_for_token): Allocate zeroed memory for a new token + chunk. + +2002-07-27 Roger Sayle + + * decl.c (builtin_function_1): No need to explicitly mark + BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn. + +2002-07-27 Roger Sayle + + * decl2.c (cxx_decode_option): Support -fno-builtin-foo. + +2002-07-26 Jason Merrill + + * call.c (build_over_call): Likewise. + (cp_convert_parm_for_inlining): New fn. + (convert_for_arg_passing): New fn. + (convert_default_arg, build_over_call): Use it. + (type_passed_as): New fn. + * pt.c (tsubst_decl): Use it. + * decl2.c (cp_build_parm_decl): New fn. + (build_artificial_parm): Use it. + (start_static_storage_duration_function): Likewise. + * decl.c (start_cleanup_fn, grokdeclarater): Likewise. + (grokparms): Don't mess with DECL_ARG_TYPE. + * typeck.c (convert_arguments): Use convert_for_arg_passing. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): + Define. + * cp-tree.h: Declare new fns. + +2002-07-26 Neil Booth + + * cp-tree.h (flag_operator_names): Remove. + * decl2.c (flag_operator_names): Remove. + (lang_f_options): Remove operator-names. + * lex.c (D_OPNAME): Remove. + (reswords): Remove operator names. + (rid_to_yy): Remove operator names. + (init_reswords): No need to handle D_OPNAME. + * spew.c (read_process_identifier): There are no operator + names. + +2002-07-26 Jason Merrill + + * dump.c (cp_dump_tree): Call c_dump_tree. + * Make-lang.in (CXX_C_OBJS): Add c-dump.o. + +2002-07-25 Neil Booth + + * error.c (print_whitespace): Remove. + * g++spec.c (LIBUNWIND): Move. + * mangle.c (mangled_position, write_signed_number): Remove. + +2002-07-25 Neil Booth + + * decl2.c (cxx_decode_option): Similarly. + +2002-07-25 Gabriel Dos Reis + + * cp-tree.h (cxx_sizeof_nowarn): Now a macro. + (cxx_sizeof_or_alignof_type): Take a third argument. + (cxx_sizeof): Adjust definition. + (cxx_alignof): Likewise. + * init.c (build_delete): Use cxx_sizeof_nowarn to reflect reality. + * typeck.c (cxx_sizeof_or_alignof_type): Take a third argument for + complaining. + (c_sizeof_nowarn): Remove definition. + (build_unary_op): Use cxx_sizeof_nowarn. + +2002-07-24 Geoffrey Keating + + * tree.c (cp_build_qualified_type_real): When copying + pointer-to-method types, unshare the record that holds + the cached pointer-to-member-function type. + +2002-07-23 Neil Booth + + * cp-tree.h (FILE_FUNCTION_PREFIX_LEN): Remove. + +2002-07-23 Gabriel Dos Reis + + Fix PR/7363: + * typeck.c (cxx_sizeof_or_alignof_type): New function. + (c_sizeof): Remove definition. + (expr_sizeof): Use cxx_sizeof. + * decl2.c (build_expr_from_tree): Use cxx_sizeof_or_alignof_type. + * decl.c (finish_destructor_body): Use cxx_sizeof. + * semantics.c (finish_alignof): Likewise. + (finish_alignof): Use cxx_alignof. + * cp-tree.h (cxx_sizeof, cxx_alignof): New macros. + (cxx_sizeof_or_alignof_type): Declare. + (my_friendly_assert): Move to ../c-common.h. + +2002-07-23 Neil Booth + + * class.c, method.c, pt.c, search.c: Don't define obstack macros. + +2002-07-22 Kriang Lerdsuwanakij + + PR c++/7347, c++/7348 + * cp-tree.h (tsubst_flags_t): Add tf_parsing. + * decl.c (make_typename_type): Use it. + (make_unbound_class_template): Likewise. + (lookup_name_real): Don't call type_access_control if scope is + template parameter dependent. + * parse.y (template_arg): Call make_unbound_class_template with + tf_parsing set. + (nest_name_specifier): Call make_typename_type with tf_parsing set. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + (instantiate_decl): Push class scope. + * pt.c (regenerate_decl_from_template): Call pushclass and popclass + for both static variable and member function template. + (instantiate_decl) Call pushclass and popclass when tsubst'ing type + and arguments. + * search.c (type_access_control): Do type access for TEMPLATE_DECL + too. + +2002-07-20 Roger Sayle + + * decl2.c (cxx_decode_option): Simplify -fhandle-exceptions + test by using positive_option. Make whitespace consistent. + +2002-07-20 Gabriel Dos Reis + + * spew.c (struct unparsed_test): Replace 'filename' and 'lineno' + members with 'locus'. Adjust use throughout. + (struct feed): Likewise. + (alloc_unparsed_test): Change prototype, take a 'const location_t *'. + Adjust use. + (snarf_defarg): Use error(), not error_with_file_and_line(). + +2002-07-19 Chris Demetriou + + * lang-specs.h (@c++): Include "%2" (cc1plus_spec) wherever + cpp_options is included. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/2862, c++/2863 + * pt.c (determine_specialization): Compare the length of + TYPE_ARG_TYPES. Tidy. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/3797 + * decl.c (duplicate_decls): Don't propagate inlining parameters from + olddecl to newdecl when newdecl is a specialization of the + instantiation olddecl. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/4802, c++/5387 + * decl.c (make_typename_type): Use enforce_access. + +2002-07-17 Scott Snyder + + PR c++/7320 + * rtti.c (get_tinfo_decl): Set DECL_COMDAT. + +2002-07-12 Mark Mitchell + + * class.c (add_method): Correct handling of conversion operators. + +2002-07-11 Mark Mitchell + + PR c++/7224 + * class.c (add_method): Simplify. + +2002-07-11 Jason Merrill + + PR c++/7279 + * tree.c (cp_copy_res_decl_for_inlining): Also copy + TREE_ADDRESSABLE. + +2002-07-10 Graham Stott + + * pt.c (template_parm_this_level_p, push_template_decl_real): + Pass depth as int pointer. + +2002-07-11 Tim Josling + + Remove front end hard coding from gengtype.c. + + * config-lang.in (gtfiles): Add files needed for this front end. + +2002-07-10 Mark Mitchell + + * cp-tree.h (unqualified_name_lookup_error): Declare it. + (begin_function_definition): Adjust prototype. + * lex.c (unqualified_name_lookup_error): New function, split out + from ... + (do_identifier): ... here. + * parse.y (parse_begin_function_definition): New function. + (fn.def1): Use it. + * semantics.c (begin_function_definition): Accept decl-specifiers + and attributes as separate parameters. + +2002-07-10 Jason Merrill + + PR c++/6255 + * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather than + modifying the old one. + +2002-07-09 Mark Mitchell + + * cp-tree.h (constructor_name_p): Declare it. + (check_template_template_default_arg): Likewise. + * class.c (handle_using_decl): Use constructor_name_p. + * decl.c (grokdeclarator): Likewise. + * decl2.c (constructor_name_p): Define it. + * init.c (build_member_call): Use constructor_name_p. + * parse.y (template_parm): Use check_template_template_default_arg. + * pt.c (check_explicit_specialization): Use constructor_name_p. + * semantics.c (check_template_template_default_arg): New function. + +2002-07-08 Kriang Lerdsuwanakij + + * pt.c (can_complete_type_without_circularity): Add static to + function definition. + +2002-07-08 Mark Mitchell + + * cp-tree.h (have_extern_spec): Declare it + * decl.c (have_extern_spec): Define it. + (start_decl): Eliminate use of used_extern_spec. + (start_function): Likewise. + * parse.y (have_extern_spec): Remove declaration. + (used_extern_spec): Likewise. + (frob_specs): Eliminate use of used_extern_spec. + (.hush_warning): Likewise. + +2002-07-07 Mark Mitchell + + * Make-lang.in (cp/parse.o): Depend on decl.h. + * cp-tree.h (do_decl_instantiation): Change prototype. + * parse.y: Include decl.h. + (parse_decl_instantiation): New function. + (explicit_instantiation): Use it. + * pt.c (do_decl_instantiation): Accept a DECL, not a DECLARATOR + and DECLSPECS. + +2002-07-07 Roger Sayle + + * error.c (dump_function_name): Use DECL_TEMPLATE_RESULT for + constructor and destructor tests when passed a TEMPLATE_DECL. + +2002-07-05 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Call force_fit_type for null + pointers. + + PR optimization/7145 + * tree.c (cp_copy_res_decl_for_inlining): Also copy DECL_INITIAL. + +2002-07-05 Nathan Sidwell + + Repair damage on weak-impared targets caused by my previous patch. + * cp-tree.h (import_export_tinfo): Add parameter. + * decl2.c (import_export_tinfo): Add parameter, post adjust + DECL_COMDAT. + * rtti.c (emit_tinfo_decl): DECL_COMDAT is (nearly) always setup by + import_export_tinfo. + +2002-07-03 Kriang Lerdsuwanakij + + PR c++/6944 + * init.c (build_aggr_init): Remove qualifiers of init before calling + build_vec_init. + (build_vec_init): Flatten multi-dimensional array during cleanup. + (build_vec_delete_1): Abort if the type of each element is array. + +2002-07-03 Graham Stott + + * pt.c (instantiate_class_template): Fix typo. + +2002-07-02 Kriang Lerdsuwanakij + + * typeck2.c (cxx_incomplete_type_diagnostic): Fix typo caused + by CVS conflict in my last patch. + +2002-07-02 Kriang Lerdsuwanakij + + PR c++/6716 + * pt.c (can_complete_type_without_circularity): New function. + (instantiate_class_template): Use it. + * typeck2.c (cxx_incomplete_type_diagnostic): Improve error + message due to incomplete fields. + +2002-07-01 Mark Mitchell + + PR c++/7112 + * mangle.c (write_expression): Add mangling for sizeof when + applied to a type. + * operators.def: Remove stale comment. + +2002-06-30 Nathan Sidwell + + * cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ... + (CPTI_TYPE_INFO_PTR_TYPE): ... this. + (tinfo_decl_type): Replace with ... + (type_info_ptr_type): ... this. + (import_export_tinfo): Declare. + (tinfo_decl_p): Rename to ... + (unemitted_tinfo_decl_p): ... this. + * decl2.c (import_export_decl): Break out tinfo handling into ... + (import_export_tinfo): ... here. New function. + (finish_file): Adjust. + * rtti.c (TINFO_REAL_NAME): New macro. + (init_rtti_processing): Create the tinfo types. + (get_tinfo_decl_dynamic): Use type_info_ptr_type, get_tinfo_ptr. + (get_tinfo_decl): Adjust. + (get_tinfo_ptr): New function. + (get_type_id): Use it. + (tinfo_base_init): Create vtable decl here, if it doesn't exist. + (ptr_initializer): Use get_tinfo_ptr. + (ptm_initializer): Likewise. + (synthesize_tinfo_var): Break into ... + (get_pseudo_ti_init): ... this. Just create the initializer. + (get_pseudo_ti_desc): .. and this. + (create_real_tinfo_var): Remove. + (create_pseudo_type_info): Don't create the vtable decl here. + (get_vmi_pseudo_type_info): Remove. + (create_tinfo_types): Adjust. + (tinfo_decl_p): Rename to ... + (unemitted_tinfo_decl_p): ... here. Adjust. + (emit_tinfo_decl): Adjust. Create the initializer. + +2002-06-27 Mark Mitchell + + PR c++/6695 + * pt.c (tsubst_friend_class): Substitute into the context of the + friend before using it. + +2002-06-26 Mark Mitchell + + * cp-tree.h (xref_tag): Change prototype. + (handle_class_head): Likewise. + (build_x_component_ref): Likewise. + * decl.c (cxx_init_decl_processing): Adjust call to xref_tag. + (xref_tag): Take attributes as a separate parameter. + (xref_tag_from_type): Adjust call to xref_tag. + * decl2.c (build_expr_from_tree): Adjust call to + build_x_component_ref. + (handle_class_head): Take attributes as a separate parameter. + * parse.y (parse_xref_tag): New function. + (parse_handle_class_head): Likewise. + (primary): Use parse_xref_tag. + (class_head_decl): Use parse_handle_class_head. + (class_head_defn): Likewise. + * rtti.c (init_rtti_processing): Adjust call to xref_tag. + (build_dynamic_cast_1): Likewise. + (create_pseudo_type_info): Likewise. + (emit_support_tinfos): Likewise. + * typeck.c (build_object_ref): Adjust call to + build_x_component_ref. + (build_x_component_ref): Remove protect parameter. + +2002-06-25 Mark Mitchell + + * call.c (build_op_delete_call): Use BASELINK_FUNCTIONS. + * class.c (handle_using_decl): Likewise. + (instantiate_type): Likewise. + * cp-tree.h (BASELINK_FUNCTIONS): New macro. + (xref_basetypes): Change prototype. + (begin_mem_initializers): New function. + (get_overloaded_fn): Likewise. + * decl.c (xref_basetypes): Simplify. + * error.c (dump_expr): Use BASELINK_FUNCTIONS. + * init.c (build_offset_ref): Likewise. + * parse.y (base_init): Use begin_mem_initializers(). + (structsp): Adjust call to xref_basetypes. + * pt.c (determine_specialization): Use BASELINK_FUNCTIONS. + (instantiate_class_template): Adjust call to xref_basetypes. + * semantics.c (begin_mem_initializers): New function. + * tree.c (is_overloaded_fn): Use BASELINK_FUNCTIONS. + (really_overloaded_fn): Likewise. + (get_overloaded_fn): New function.' + (get_first_fn): USe BASELINK_FUNCTIONS. + +2002-06-24 Mark Mitchell + + * cp-tree.h (SCALAR_TYPE_P): New macro. + (check_for_out_of_scope_variable): New function. + (at_class_scope_p): Likewise. + (finish_fname): Likewise. + * class.c (finish_struct): Use at_function_scope_p. + * decl.c (check_for_out_of_scope_variable): New function, split + out from do_identifier. + (finish_enum): Use at_function_scope_p. + * lex.c (do_identifier): Use check_for_out_of_scope_variable. + * parse.y (VAR_FUNC_NAME): Give it . Use finish_fname. + (primary): Use at_function_scope_p. + * search.c (at_class_scope_p): New function. + * semantics.c (finish_fname): Likewise. + (check_multiple_declarators): Use at_function_scope_p. + +2002-06-23 Mark Mitchell + + * parse.y (parse_scoped_id): New function. + (primary): Use it. + * cp-tree.h (do_scoped_id): Adjust declaration. + * lex.c (do_scoped_id): Remove call to yylex. + * decl2.c (build_expr_from_tree): Adjust use of do_scoped_id. + * typeck2.c (add_exception_specifier): Use tree_cons, rather than + expanding it inline. + +2002-06-23 Matt Thomas + + * decl.c (finish_function): Change "#ifdef VMS_TARGET" to + "#if VMS_TARGET". + +2002-06-21 Kaveh R. Ghazi + + * mangle.c (integer_type_codes): Const-ify. + +2002-06-20 Richard Henderson + + PR c++/6747 + * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early. + Call put_var_into_stack. + +2002-06-20 Kaveh R. Ghazi + + * spew.c (remove_last_token): Use ARRAY_SIZE in lieu of explicit + array size calculation. + +2002-06-20 Kriang Lerdsuwanakij + + PR c++/6892 + * pt.c (tsubst_expr): Handle FILE_STMT. + +2002-06-20 Kriang Lerdsuwanakij + + PR c++/6723 + * pt.c (lookup_template_class): Don't build complete argument of + BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template + argument. + +2002-06-19 Akim Demaille + + * parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with + decl.h's TYPENAME. + * spew.c, lex.c: Adjust. + * parse.y (explicit_instantiation): Add empty action to override + the default $$ = $1 where it introduces a type clash. + +2002-06-14 Jason Merrill + + * semantics.c (begin_for_stmt): Push the 'for' scope before + adding the FOR_STMT. + + C++ ABI changes. + * class.c (build_base_field): Set DECL_PACKED. + (layout_class_type): Don't use tail padding of PODs. + * mangle.c (write_unqualified_name): Fix template conversion op + mangling. + +2002-06-16 Richard Henderson + + PR opt/6793 + * tree.c (cp_cannot_inline_tree_fn): Don't short-circuit test + after template instantiation. + +2002-06-16 Richard Henderson + + * cp-tree.h, decl2.c (flag_ms_extensions): Move to c-common. + +2002-06-15 Gabriel Dos Reis + + * cp-tree.h (compiler_error): Remove declaration. + * lex.c (compiler_error): Remove definition. + +2002-06-14 Steve Ellcey + + * g++spec.c (LIBUNWIND): New. + (lang_specific_driver): Add it if USE_UNWIND_EXCEPTIONS is set. + +2002-06-13 Jessica Han + + * class.c (build_vtable): Use TARGET_VTABLE_ENTRY_ALIGN. + (build_vtbl_initializer): Honor TARGET_VTABLE_DATA_ENTRY_DISTANCE. + (build_vbase_offset_vtbl_entries): Likewise. + * rtti.c (build_headof): Likewise. + (get_tinfo_decl_dynamic): Likewise. + (create_pseudo_type_info): Likewise. + +2002-06-12 Stan Shebs + + * mpw-config.in: Remove file, no longer used. + * mpw-make.sed: Ditto. + +2002-06-07 Zack Weinberg + + * decl2.c: Update call to cpp_handle_option. + +2002-06-07 H.J. Lu (hjl@gnu.org) + + * decl2.c (flag_use_cxa_atexit): Set to DEFAULT_USE_CXA_ATEXIT. + +2002-06-06 Gabriel Dos Reis + + * error.c (cp_error_at): Fix typo. + +2002-06-04 Gabriel Dos Reis + + * error.c (cp_diagnostic_starter): Adjust call. + (maybe_print_instantiation_context): Change prototype to take a + 'diagnostic_info *'. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (cp_printer): Take a secondary parameter as a 'text_info *'. + Remove output_state savings. Adjust calls. + +2002-06-03 Geoffrey Keating + + * pt.c (inline_parm_levels): Mark for GC. + + * mangle.c (start_mangling): Allocate G.substitutions here... + (init_mangle): ... rather than here. + (finish_mangling): Clear the varray pointer when done with it. + * spew.c (yylexstring): Don't use VARRAY_FREE. + * search.c (bfs_walk): Don't use VARRAY_FREE. + * decl2.c (pending_statics): Use gengtype to mark. + (deferred_fns): Likewise. + (ssdf_decls): Likewise. + (init_decl2): Delete. + * decl.c (pop_from_top_level): Don't use VARRAY_FREE. + (cxx_init_decl_processing): Don't call init_decl2. + (cxx_pop_function_context): Don't use VARRAY_FREE. + * cp-tree.h (struct saved_scope): No need for special marking + of varrays. + (struct language_function): Likewise. + (local_classes): Use gengtype to mark. + (init_decl2): Delete prototype. + * class.c (init_class_processing): Don't use + ggc_add_tree_varray_root. + (build_vtbl_initializer): Don't use VARRAY_FREE. + + * decl.c (typename_compare): Don't use same_type_p. + + * decl.c: Include hashtab.h instead of hash.h. + (typename_hash): Update to use htab_h. + (typename_compare): Likewise. + (typename_htab): Use gengtype to mark. + (build_typename_type): Update to use htab_h. + * Make-lang.in (cp/decl.o): Use HASHTAB_H instead of hash.h. + + * Make-lang.in (gt-cp-tree.h): New rule. + (cp/tree.o): Depend on gt-cp-tree.h. + * config-lang.in (gtfiles): Add cp/tree.c. + * tree.c: Include gt-cp-tree.h. + (list_hash_table): Use gengtype to mark. + (init_tree): Use gengtype to mark trees. + + * Make-lang.in (cp/decl.o): Add debug.h dependency. + * call.c (struct z_candidate): Use gengtype. + (USER_CONV_CAND): Use WRAPPER_ZC. + (convert_class_to_reference): Use build_zc_wrapper. + (build_type_conversion_1): Likewise. + (build_over_call): Use WRAPPER_ZC. + (add_warning): Use build_zc_wrapper. + * cp-lang.c (LANG_HOOKS_MARK_TREE): Delete. + * cp-tree.h (struct lang_identifier): Use gengtype. + (struct template_parm_index_s): Likewise. + (struct ptrmem_cst): Likewise. + (struct tree_binding): Likewise. + (struct tree_overload): Likewise. + (struct tree_srcloc): Likewise. + (struct tree_wrapper): Likewise. Also modify to have a pointer + to struct z_candidate rather than void. + (enum cp_tree_node_structure_enum): New. + (union lang_tree_node): New. + (cxx_mark_tree): Delete prototype. + (cp_tree_node_structure): New prototype. + (build_ptr_wrapper): Delete prototype. + (build_int_wrapper): Delete prototype. + (build_zc_wrapper): New prototype. + * decl.c: Include debug.h + (cxx_mark_tree): Delete. + (cp_tree_node_structure): New. + * tree.c (build_ptr_wrapper): Delete. + (build_int_wrapper): Delete. + (build_zc_wrapper): New. + + * cp-tree.h [! ENABLE_TREE_CHECKING] (LANG_TYPE_PTRMEM_CHECK): + Correct typo. Patch from k_fukui@highway.ne.jp. + + * semantics.c (current_stmt_tree): Update for change to + struct language_function. + (finish_mem_initializers): Likewise. + * decl.c (cxx_init_decl_processing): Don't set mark_lang_status. + * cp-tree.h (struct language_function): Rename from + cp_language_function. Change all uses. + (cp_function_chain): Don't need to cast. + + * class.c (duplicate_tag_error): Reset discriminator. + (check_bases_and_members): Update for data structure changes. + * cp-tree.h (struct lang_id2): Use gengtype. + (flagged_type_tree): Likewise. + (SET_LANG_ID): Use GGC on struct lang_id2. + (struct cp_language_function): Use gengtype. Remove field + 'x_vcalls_possible_p'. + (current_vcalls_possible_p): Delete. + (struct lang_type_header): New. + (struct lang_type_class): Rename from struct lang_type. Include + struct lang_type_header. + (struct lang_type_ptrmem): New. + (struct lang_type): New. + (LANG_TYPE_CLASS_CHECK): New. Use it in all the appropriate macros. + (LANG_TYPE_PTRMEM_CHECK): New. Use it in all the appropriate macros. + (TYPE_SET_PTRMEMFUNC_TYPE): Set discriminator, update for changes. + (struct lang_decl_flags): Use gengtype. Add discriminators. + (struct lang_decl): Use gengtype. Add and use discriminators. + Update the macros that reference moved fields. + (LANG_DECL_U2_CHECK): New function. Use it when appropriate. + (SET_DECL_THUNK_P): Set discriminator too. + (clear_inline_text_obstack): Delete prototype. + (finish_inline_definitions): Delete prototype. + (mark_pending_inlines): Delete prototype. + (lang_check_failed): New prototype. + * decl.c (struct named_label_use_list): Use gengtype. + (struct named_label_list): Likewise. + (mark_binding_level): Delete. + (mark_named_label_lists): Delete. + (push_local_name): Set discriminator on DECL_LANG_SPECIFIC. + (cxx_init_decl_processing): Use generated marker routine. + (begin_destructor_body): Delete dead set to + current_vcalls_possible_p. + (mark_lang_function): Delete. + (mark_cp_function_context): Delete. + (lang_mark_tree): Use generated marker routines. + * decl2.c (start_objects): Set discriminator when setting + GLOBAL_INIT_PRIORITY. + * lex.c (retrofit_lang_decl): Set discriminators. + (copy_lang_type): Update for changes to lang_type structure. + (cp_make_lang_type): Set discriminator. + * parse.y: Use gengtype on YYLVAL. Don't use dots in identifiers. + * search.c: Include ggc.h. + * semantics.c (anon_aggr_type_p): Use the macro, don't hand-code it. + (finish_inline_definitions): Delete. + * spew.c (struct token): Use gengtype. + (struct token_chunk): New. + (struct unparsed_text): Use gengtype. Store tokens in chunks. + (struct feed): Use gengtype. + (feed_obstack): Delete. + (feed): Mark as GC root. + (pending_inlines): Mark as GC root. + (pending_inlines_tail): Likewise. + (processing_these_inlines): Likewise. + (token_obstack): Make static. + (first_token): Likewise. + (init_spew): Don't initialize deleted things; use gengtype for roots. + (clear_inline_text_obstack): Delete. + (feed_input): Use GC for struct feed. Update for changes to + struct unparsed_text. + (mark_pending_inlines): Delete. + (next_token): Rename from add_token. Change all callers. Update + for changes to struct unparsed_text. + (space_for_token): New. + (remove_last_token): New. + (alloc_unparsed_text): New. + (snarf_block): Take an unparsed_text. Update for changes to struct + unparsed_text. + (snarf_method): Update for changes to struct unparsed_text. + (snarf_defarg): Update for changes to struct unparsed_text. + * tree.c (lang_check_failed): New. + + * Make-lang.in (gt-cp-call.h gt-cp-decl2.h gt-cp-parse.h + gt-cp-pt.h gt-cp-repo.h gt-cp-spew.h): New rules. + (cp/spew.o): Add dependency on gt-.h. + (cp/decl2.o): Add dependency on gt-.h. + (cp/call.o): Add dependency on gt-.h. + (cp/pt.o): Add dependency on gt-.h. + (cp/repo.o): Add dependency on gt-.h. + (cp/parse.o): Add dependency on gt-.h. + * call.c: Use gengtype for roots. + * config-lang.in (gtfiles): Add cp-tree.h decl.h lex.h call.c + decl2.c parse.y pt.c repo.c spew.c. + * cp-tree.h: Use gengtype for roots. + (struct saved_scope): Use GGC, gengtype. + (cp_parse_init): Delete prototype. + (init_pt): Delete prototype. + * decl.c: Use gengtype for roots. + (mark_saved_scope): Delete. + (cxx_init_decl_processing): Don't call deleted initilisation + routines. + (signed_size_zero_node): Delete, unused. + * decl.h: Use gengtype for roots. + * decl2.c: Use gengtype for roots. + * lex.h: Use gengtype for roots. + * parse.y: Use gengtype for roots. + (cp_parse_init): Delete. + * pt.c: Use gengtype for roots. + (init_pt): Delete. + * repo.c: Use gengtype for roots. + * spew.c: Use gengtype for roots. + + * Make-lang.in: Allow for filename changes. Add gtype-cp.h. + (cp/decl.o): Add dependency on gtype-cp.h. + * decl.c: Remove use of add_deletable_root, use GTY marker instead. + Include gtype-cp.h. Allow for filename changes. + + * Make-lang.in (cp/gt-decl.h): Generate using gengtype. + (cp/decl.o): Add cp/gt-decl.h dependency. + * config-lang.in (gtfiles): New. + * tree.h: Rename struct binding_level to struct cp_binding_level. + * decl.c: Rename struct binding_level to struct cp_binding_level. + Include cp/gt-decl.h. + (struct cp_binding_level): Use gengtype. + (make_binding_level): Use GGC on struct cp_binding_level. + (mark_binding_level): Use gt_ggc_m_cp_binding_level. + (cxx_init_decl_processing): Mark free_binding_level as + deletable. + + * decl.c (mark_cp_function_context): Update calling sequence. + + * decl.c (start_function): Don't free 'struct + cp_language_function'. + (pop_cp_function_context): Likewise. + (save_function_data): Allocate it using GC. + * semantics.c (genrtl_start_function): Don't free 'struct + cp_language_function'. + +2002-05-31 Matthew Woodcraft + + * lang-specs.h: Use cpp_debug_options. + +2002-05-28 Zack Weinberg + + * mangle.c, tree.c: Include real.h. + * Make-lang.in: Update dependency lists. + +2002-05-25 Neil Booth + + * lex.c: Don't include c-lex.h. + * parse.y, spew.c: Don't include c-lex.h; include c-pragma.h. + +2002-05-23 Neil Booth + + * spew.c (yyungetc, snarf_block): Remove indent_level handling. + +2002-05-22 Richard Henderson + + * decl.c (obscure_complex_init): Check for VAR_DECL + before using DECL_THREAD_LOCAL. + +2002-05-22 Richard Henderson + + * decl.c (check_tag_decl): Handle RID_THREAD. + (obscure_complex_init): Reject run-time init of tls. + (grokvardecl, grokdeclarator): Handle RID_THREAD. + * lex.c (reswords): Add __thread. + (rid_to_yy): Map RID_THREAD to SCSPEC. + +2002-05-22 Neil Booth + + * cp-lang.c (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options. + * cp-tree.h (cxx_post_options): Kill. + * cp-lex.c (cxx_post_options): Kill. + +2002-05-21 Richard Henderson + + * lex.c (rid_to_yy): Add RID_THREAD. + +2002-05-21 Alexandre Oliva + + * init.c (build_vec_init): Test for trivial copy-assignment when + copy-assigning arrays. + +2002-05-20 Andreas Jaeger + + * init.c (build_default_init): Remove unused variable. + +2002-05-20 Alexandre Oliva + + * call.c (any_strictly_viable): New. + (build_new_op): Use it for COMPOUND_EXPR and ADDR_EXPRs. + +2002-05-19 Kriang Lerdsuwanakij + + * error.c (dump_type) [TYPEOF_TYPE]: Fix parenthesis printing. + +2002-05-19 Kriang Lerdsuwanakij + + PR c++/186, DR 259 + * pt.c (do_decl_instantiation): Don't complain explicit + instantiation after explicit specialization. + (do_type_instantiation): Likewise. + +2002-05-19 Alexandre Oliva + + * cp-tree.h (complete_type_or_diagnostic): Changed prototype, + renamed from... + (complete_type_or_else): ... this. Redefined as macro. + (cxx_incomplete_type_diagnostic): Declare. + (cxx_incomplete_type_error): Define as macro. + * init.c (build_delete): Warn about incomplete types other than + void, and use the built-in operator delete for them. + * typeck.c (complete_type_or_diagnostic): Renamed from + complete_type_or_else. Added warn_only argument, passed to... + * typeck2.c (cxx_incomplete_type_diagnostic): ... this. Print + warnings or errors depending on new warn_only argument. Renamed + from... + (cxx_incomplete_type_error): ... this. New implementation in + terms of cxx_incomplete_type_diagnostic. + +2002-05-18 Jason Merrill + + PR c++/6611 + * decl2.c (import_export_decl): If we clear + DECL_NOT_REALLY_EXTERN, make sure DECL_EXTERNAL is set. + +2002-05-15 Kriang Lerdsuwanakij + + PR c++/6620 + * pt.c (verify_class_unification): Don't check if PARM is template + parameter dependent. Simplify. + (unify) [TEMPLATE_PARM_INDEX]: Handle when ARG is a template + parameter dependent expression. + +2002-05-14 Jason Merrill + + * rtti.c (get_tinfo_decl): Don't call comdat_linkage. + Do set DECL_COMDAT. + (synthesize_tinfo_var): Take the public decl. + (create_real_tinfo_var): Likewise. Check DECL_COMDAT. + (emit_tinfo_decl): Adjust. Call import_export_decl. + * decl2.c (import_export_decl): Simplify tinfo decl handling. + +2002-05-14 Alexandre Oliva + + * cp-tree.h (struct lang_type): Added non_zero_init. + (CLASSTYPE_NON_ZERO_INIT_P): New macro. + (zero_init_p, force_store_init_value, build_forced_zero_init): Declare. + * class.c (check_field_decls): Test non_zero_init. + * cvt.c (convert_to_pointer_force): Use cp_convert_to_pointer for + zero-to-NULL conversions. + * decl.c (obscure_complex_init): Don't reset DECL_INITIAL of a + type that needs zero-initialization without zeros. + (check_initializer_decl): Compute zero-initializer for types + that require a non-trivial one. + * init.c (build_forced_zero_init): New function. + (build_default_init): Use it. + * tree.c (zero_init_p): New function. + * typeck2.c (force_store_init_value): New function. + (process_init_constructor): Create non-trivial zero-initializers + for array members and class fields. + +2002-05-14 Neil Booth + + * lang-specs.h: Remove redundant -lang-c++. + +2002-05-13 Jason Merrill + + * class.c (build_vtbl_ref_1): Use fixed_type_or_null. + (fixed_type_or_null): See through reference vars. + (build_base_path): Vtable contents are constant. + * typeck.c (get_member_function_from_ptrfunc): Likewise. + +2002-05-12 Jason Merrill + + * cp-lang.c (ok_to_generate_alias_set_for_type): Backend-created + structs are safe. + +2002-05-09 Neil Booth + + * cp-tree.h (flag_ansi): Remove. + * decl2.c (flag_ansi): Remove. + (cxx_decode_option): Set flag_iso and flag_undef. + +2002-05-09 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Reorganize. + Use subtraction rather than a bitmask to get the index. + * cvt.c (cp_convert_to_pointer): Bail on an error_mark_node. + + * pt.c (tsubst_expr) [ASM_STMT]: Copy ASM_INPUT_P. + +2002-05-07 Neil Booth + + * Make-lang.in (decl2.o): Update. + * cp-tree.h (warn_multichar): Remove. + * decl2.c: Include c-common.h. + (warn_multichar): Remove. + +2002-05-03 Jason Merrill + + * tree.c (build_cplus_array_type): Only const and volatile get + special handling. + + * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h. + +2002-04-30 Mark Mitchell + + ABI change, returning simple classes from functions. + * class.c (finish_struct_bits): Only mark TREE_ADDRESSABLE if + TYPE_HAS_TRIVIAL_INIT_REF is false or + TYPE_HAS_NONTRIVIAL_DESTRUCTOR is true. + +2002-04-30 Jason Merrill + + PR debug/6436 + * decl.c (grokdeclarator): Don't override TYPE_NAME of an + anonymous class with a typedef if there are attributes. + +2002-04-29 Paul Eggert + + * parse.y (nomods_initdcl0): Replace $3 with $$. + +2002-04-29 Jakub Jelinek + + PR c++/6477 + * decl.c (follow_tag_typedef): Check if TYPE_NAME (original) is + non-NULL first. + +2002-04-29 Mark Mitchell + + PR c++/6492 + * pt.c (tsubst_friend_class): If the friend has an explicit scope, + enter that scope before name lookup. + + PR c++/6486 + * method.c (do_build_copy_constructor): Avoid building + cv-qualified reference types. + +2002-04-29 Nathan Sidwell + + PR c++/5719 + * decl.c (grok_op_properties): Assignment ops don't have to return + by value. operator% should. + +2002-04-28 Franz Sirl + + PR c/6343 + * decl.c (duplicate_decls): Call merge_weak. + +2002-04-26 Richard Henderson + + * parse.y (malloced_yyss, malloced_yyvs): New. + (yyoverflow): Re-add. Set them. + (free_parser_stacks): New. + +2002-04-26 Mark Mitchell + + PR c++/6497 + * method.c (do_build_assign_ref): Pass a derivation to + build_method_call when calling base class assignment operators. + +2002-04-26 Richard Henderson + + * parse.y (yyoverflow): Revert. + +2002-04-26 Richard Henderson + + PR c/3581 + * parse.y (string): Remove. Update all uses to use STRING + instead, and not call combine_strings. + * rtti.c (tinfo_name): Use fix_string_type. + * semantics.c (finish_asm_stmt): Don't call combine_strings. + * spew.c (yylexstring): New. + (read_token): Use it. + +2002-04-25 Richard Henderson + + PR c/2161 + * parse.y (yyoverflow): New. + +2002-04-25 Jason Merrill + + PR c++/5607 + * search.c (check_final_overrider): No longer static. + * class.c (update_vtable_entry_for_fn): Call it. + * cp-tree.h: Adjust. + +2002-04-25 Neil Booth + + * cp-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. + * cp-tree.h (cxx_set_yydebug): Die. + * lex.c (YYDEBUG): Get from c-lex.h. + (cxx_set_yydebug): Remove. + * parse.y: Include c-lex.h. + (YYDEBUG): Get from c-lex.h. + +2002-04-24 Mark Mitchell + + PR c++/6438. + * cvt.c (convert_to_void): Don't unconditionally make COND_EXPRs + void. + +2002-04-24 Neil Booth + + * cp-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, + LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): + Redefine. + * cp-tree.h (cp_attribute_table): Rename. + * decl.c (lang_attribute_table): Remove declaration. + (cxx_init_decl_processing): Don't set it. + * tree.c (cp_attribute_table): Rename. + +2002-04-24 Jason Merrill + + PR c++/6331 + * method.c (do_build_copy_constructor): Use cp_build_qualified_type. + * typeck.c (build_modify_expr): Allow arrays to differ in cv-quals. + The pedwarn for array assignment is now unconditional. + * tree.c (build_cplus_array_type_1): Still process simple array types + normally in templates. + + PR c++/6395 + * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i + stuff for comdats. + +2002-04-23 Jakub Jelinek + + * parse.y (check_class_key): Allow KEY to be union/enum/struct/class + node with attributes. + +2002-2-23 David O'Brien + + * g++spec.c (MATH_LIBRARY_PROFILE, LIBSTDCXX_PROFILE): Add. + Use MATH_LIBRARY_PROFILE and LIBSTDCXX_PROFILE if profile flag given. + +2002-04-23 Mark Mitchell + + PR c++/6256: + * pt.c (tsubst_friend_class): Handle templates with explicit + nested names. + + PR c++/6331: + * typeck.c (merge_types): Remember the cv-qualification of pointer + types when merging them. + +2002-04-20 Neil Booth + + * cp-lang.c (LANG_HOOKS_FUNCTION_INIT, + LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine. + * cp-tree.h (cxx_push_function_context, cxx_pop_function_context, + cxx_mark_function_context): New. + * decl.c (push_cp_function_context, pop_cp_function_context, + mark_cp_function_context): Rename for consistency. + (cxx_init_decl_processing): Don't set old hooks. + +2002-04-19 Neil Booth + + * call.c (convert_type_from_ellipsis): Rename, update. + * cp-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. + * cp-tree.h (convert_type_from_ellipsis): Rename. + * decl.c (cxx_init_decl_processing): Don't set hook. + +2002-04-18 Neil Booth + + * call.c (build_new_method_call): Update. + * cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine. + * cp-tree.h (cxx_incomplete_type_error): New. + * decl.c (grokdeclarator, grokparms): Update. + * decl2.c (check_classfn): Update. + * pt.c (tsubst): Update. + * typeck.c (complete_type_or_else, expr_sizeof, + decay_conversion): Update. + * typeck2.c (incomplete_type_error): Rename. + (add_exception_specifier): Update. + +2002-04-18 Jason Merrill + + PR c++/5658 + * search.c (setup_class_bindings): A class template qualifies as a + type binding. + +2002-04-17 Jakub Jelinek + + PR c++/6316 + * decl2.c (finish_file): Clear DECL_EXTERNAL in a separate loop + before expanding. + +2002-04-16 Mark Mitchell + + * init.c (begin_init_stmts): Remove commented out code. + (finish_init_stmts): Set STMT_EXPR_NO_SCOPE. + * semantics.c (begin_gobal_stmt_expr): Adjust call to + expand_start_stmt_expr. + +2002-04-15 Mark Mitchell + + * decl.c (register_dtor_fn): Pass the address of dso_handle, not + dso_handle itself, to __cxa_atexit. + +2002-04-15 Gabriel Dos Reis + + * error.c (cxx_print_error_function): Adjust call to macros. + +2002-04-14 Jakub Jelinek + + * class.c (layout_virtual_bases): Do all dsize computation on trees. + +2002-04-14 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Don't do + gratuitious division and multiplication on + ptrmemfunc_vbit_in_delta targets. + +2002-04-12 Mark Mitchell + + PR c++/5373. + * semantics.c (finish_expr_stmt): Remember the type of the + expression before any conversions are performed. + +2002-04-12 Mark Mitchell + + PR c++/5189. + * call.c (add_template_candidate_real): Do not treat member + templates as copy constructors. + +2002-04-12 Mark Mitchell + + * decl.c (duplicate_decls): Do not copy the RTL for a variable + declaration if the old variable had an incomplete type and the new + variable does not. + (complete_vars): Do not call layout_decl for completed variables. + +2002-04-12 Richard Sandiford + + * decl.c (duplicate_decls): Don't try to unify an implicit typedef + with an explicit one. + (follow_tag_typedef): New. + (lookup_tag): Use it to extract the tag of an explicit typedef. + (xref_tag): Likewise. + +2002-04-11 Andrew Haley + + * typeck.c (type_after_usual_arithmetic_conversions): + If two types have the same variant, return immediately. + When two floating-point operands are the same precision: + convert to float if one of the operands is float; + if neither operand is one of the standard types, return the type + of the first operand. + +2002-04-10 Nathan Sidwell + + PR c++/5507 + * decl.c (make_typename_type): Remove implicit typenameness. + +2002-04-09 Jason Merrill + + PR optimization/6189 + * semantics.c (genrtl_start_function): Don't free + DECL_SAVED_FUNCTION_DATA for inline functions. + + * init.c (build_member_call): For now, don't convert to + intermediate base if it would cause an error. + +2002-04-08 Paolo Carlini + + * parse.y (namespace_qualifier, maybe_identifier, + begin_explicit_instantiation, end_explicit_instantiation, + apparent_template_type, .finish_template_type, + do_id, maybe_init, defarg_again, component_decl_1): + Add ending ';', in accordance with POSIX. + +2002-04-06 Mark Mitchell + + PR c++/5571 + * class.c (layout_class_type): Remember incomplete static + variables. + (finish_struct_1): Call complete_vars, not + hack_incomplete_structures. + * cp-tree.h (hack_incomplete_structures): Rename to ... + (complete_vars): ... this. + (struct saved_scope): Remove incomplete. + (namespace_scope_incomplete): Remove. + * decl.c (struct binding_level): Remove incomplete. + (incomplete_vars): New variable. + (mark_binding_level): Don't mark incomplete. + (print_binding_level): Don't print it. + (mark_saved_scope): Don't mark incomplete. + (pushdecl): Use maybe_register_incopmlete_var. + (cxx_init_decl_processing): Register incomplete_vars for GC. + (start_decl_1): Clarify error message. + (hack_incomplete_vars): Remove. + (maybe_register_incomplete_var): New function. + (complete_vars): Likewise. + +2002-04-06 Jason Merrill + + PR c++/4934 + * error.c (dump_expr) [CONVERT_EXPR]: Make sure TREE_TYPE (t) is + set before checking it. + + PR c++/525 + * init.c (build_member_call): Use build_scoped_ref. + (resolve_offset_ref): Likewise. + * call.c (build_scoped_method_call): Likewise. + * tree.c (maybe_dummy_object): Kludge around current_class_type being + wrong. + * typeck2.c (build_scoped_ref): Return the binfo via binfo_p parm. + * cp-tree.h: Adjust. + + * init.c (push_base_cleanups): Just use build_scoped_method_call. + + PR c++/6179 + * method.c (implicitly_declare_fn): Pass unqualified type to + synthesize_exception_spec. + +2002-04-04 Neil Booth + + * cp-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. + * cvt.c: Update comment. + * init.c (expand_cleanup_for_base): Update. + * semantics.c (finish_parenthesized_expr): Update. + * typeck.c (cp_truthvalue_conversion): Update. + +2002-04-04 Jason Merrill + + * semantics.c (finish_eh_cleanup): New fn. + * cp-tree.h: Add prototype. + * init.c (perform_member_init, expand_cleanup_for_base): Use + finish_eh_cleanup. + * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove. + * cp-tree.h: Remove references. + * decl.c (begin_constructor_body, end_constructor_body): Likewise. + * dump.c (cp_dump_tree): Likewise. + * pt.c (tsubst_expr): Likewise. + * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove. + (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT. + * tree.c (cp_statement_code_p): Likewise. + + * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup. + + PR c++/5636 + * semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on + cleanup for nrv. + + PR c++/5104 + * typeck.c (comptypes) [FUNCTION_TYPE]: Don't compare exception + specifiers. + [METHOD_TYPE]: Use same code as FUNCTION_TYPE. + +2002-04-03 Richard Henderson + + * cp-lang.c (cxx_warn_unused_global_decl): New. + (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. + +2002-04-03 Neil Booth + + * cp-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Redefine. + * tree.c (init_tree): Don't set hook. + +2002-04-03 Roger Sayle + + PR c++/5998: + * decl.c (duplicate_decls): Don't mess with assembler names when + redeclaring builtin functions as static. + +2002-04-01 Neil Booth + + * call.c (build_addr_func): Update. + * class.c (resolve_address_of_overloaded_function): Update. + * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. + * cp-tree.h (cxx_mark_addressable): New. + * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. + * decl2.c (build_cleanup): Update. + * except.c (build_throw): Update. + * init.c (resolve_offset_ref): Update. + * pt.c (convert_nontype_argument): Update. + * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. + * typeck.c (decay_conversion, build_array_ref, build_unary_op, + unary_complex_lvalue): Update. + (mark_addressable): Rename. + +2002-04-01 Roger Sayle + + PR c++/5998: + * decl.c (duplicate_decls): Overwrite the RTL when (and only + when) overwriting a built-in function. Don't use COPY_DECL_RTL, + but follow the SET_DECL_RTL idiom used elsewhere in the function. + +2002-04-01 Neil Booth + + * cp-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. + * decl.c (grokdeclarator): Update. + * mangle.c (write_integer_cst): Update. + * typeck.c (build_binary_op): Update. + +2002-03-31 Neil Booth + + * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine. + * lex.c (cxx_init): Don't set hook. + +2002-03-31 Neil Booth + + * Make-lang.in (error.o): Update. + * cp-lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine. + * cp-tree.h (struct diagnostic_context): Predeclare. + (cxx_print_error_function): New. + * error.c: Include langhooks-def.h. + (lang_print_error_function): Rename. Update. + (init_error): Don't set hook. + +2002-03-29 Neil Booth + + * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): + Redefine. + * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks. + * decl.c (finish_enum): Similarly. + * error.c (dump_type): Similarly. + * lex.c (cxx_init): Similarly. + * mangle.c (write_builtin_type): Similarly. + * typeck.c (comptypes): Similarly. + +2002-03-28 Roger Sayle + + PR c++/5998: + * decl.c (cxx_init_decl_processing): Re-enable built-in functions + in the g++ front-end. + (duplicate_decl): Allow redefinition of anticipated built-ins. + Fix inlining problem by over-writing the old DECL_RTL. + (lookup_namespace_name): Fail to find an identifier in the + specified namespace if its still anticipated. + (builtin_function_1): New function split out from builtin_function + to create a builtin in the current namespace with given context. + (builtin_function): Call builtin_function_1 to define the + appropriate builtins in both the std and global namespaces. + (select_decl): Don't test for anticipated decls here. + (unqualified_namespace_lookup): Instead ignore them whilst + searching through scopes and namespaces. + * decl2.c (do_nonmember_using_decl): If a using declaration + specifies an anticipated built-in function, mark it as no longer + anticipated in that scope. + (ambiguous_decl): Avoid resolving to an anticipated decl. + * lex.c (do_scoped_id): Fail to find an identifier in the global + namespace if its still anticipated. + +2002-03-29 Neil Booth + + * cp-lang.c (LANG_HOOKS_MAKE_TYPE): Redefine. + * cp-tree.h (cp_make_lang_type): Rename. + * lex.c (cp_make_lang_type): Rename. + (make_aggr_type): Update. + * tree.c (init_tree): Don't set make_lang_type_fn. + +2002-03-29 Jakub Jelinek + + PR c++/6073 + * class.c (finish_struct_1): Update static field's DECL_MODE even + if its type is a variant of t. + +2002-03-27 Neil Booth + + * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine. + * cp-tree.h (cxx_insert_default_attributes): New. + * decl.c (insert_default_attributes): Rename. + +2002-03-27 Mark Mitchell + + PR c++/4884 + * call.c (build_op_delete_call): Allow for the fact the placement + may be a COMPOUND_EXPR. + +2002-03-27 Neil Booth + + * cp-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. + * cp-tree.h (init_cplus_expand): Remove. + (cxx_expand_expr): New. + * expr.c (cplus_expand_expr): Rename cxx_expand_expr, + fix prototype. + (init_cplus_expand): Remove. + * lex.c (cxx_init): Don't call init_cplus_expand. + +2002-03-26 Mark Mitchell + + PR c++/4884. + * init.c (build_new_1): Allow for the fact the result of + build_function_call may be a COMPOUND_EXPR. + +2002-03-26 Nathan Sidwell + + PR c++/5682 + * cp-tree.h (BINFO_PRIMARY_P): Explain meaning better. + (dfs_skip_nonprimary_vbases_unmarkedp): Remove. + (dfs_skip_nonprimary_vbases_markedp): Remove. + * search.c (get_shared_vbase_if_not_primary): Remove. + (dfs_skip_nonprimary_vbases_unmarkedp): Remove. + (dfs_skip_nonprimary_vbases_markedp): Remove. + (dfs_unmarked_real_bases_queue_p): Just get the canonical binfo. + (dfs_marked_real_bases_queue_p): Likewise. + +2002-03-26 Neil Booth + + * cp-lang.c (LANG_HOOKS_MARK_TREE): Redefine. + * cp-tree.h (cxx_mark_tree): New. + * decl.c (lang_mark_tree): Rename cxx_mark_tree. + +2002-03-25 Neil Booth + + * cp-tree.h (cxx_maybe_build_cleanup): New. + * decl.c (destroy_local_var, hack_incomplete_structures): Update. + (maybe_build_cleanup): Rename cxx_maybe_build_cleanup. + * tree.c (build_target_expr): Update. + * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP): Redefine. + +2002-03-24 Neil Booth + + * decl2.c (cxx_decode_option): Handle -E. + * lang-specs.h (default_compilers): Preprocess with cc1plus. + * lex.c (cxx_init): Exit quickly if c_common_init returns NULL. + +2002-03-23 Jakub Jelinek + + PR c++/6037 + * decl.c (start_enum): Don't set TREE_ADDRESSABLE on TREE_LIST node. + +2002-03-23 Gabriel Dos Reis + + * error.c (dump_type): Be careful about implicit typenames. + +2002-03-21 Gabriel Dos Reis + + PR C++/3656 + * semantics.c (finish_base_specifier): Handle erronous base + classes. + +2002-03-22 Zack Weinberg + + * error.c: Always use REAL_VALUE_TO_DECIMAL; don't test + REAL_IS_NOT_DOUBLE. + +2002-03-22 Jeff Knaggs + + * typeck.c (get_member_function_from_ptrfunc): Scale idx down to + an index into the vtable_entry array regardless of + TARGET_PTRMEMFUNC_VBIT_LOCATION. + +2002-03-21 Aldy Hernandez + + * tree.c (cp_cannot_inline_tree_fn): Same. + +2002-03-21 Neil Booth + + * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, + insert_block, getdecls, global_bindings_p): New. + +2002-03-20 Nathan Sidwell + + PR c++/4361 + * mangle.c (struct globals) Add internal_mangling_p member. + (write_template_param): Do internal mangling, if needed. + (mangle_conv_op_name_for_type): Request internal mangling. + +2002-03-20 Jason Merrill + + PR c++/2136 + * init.c (build_delete): Check access for a member op delete here. + * decl2.c (delete_sanity): Not here. + +2002-03-19 Jason Merrill + + PR c++/5118 + * class.c (get_vfield_name): Use the constructor_name. + +2002-03-20 Neil Booth + + * cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine. + * cp-tree.h (lang_printable_name): Rename. + * error.c (lang_decl_name): Use new hook. + * lex.c (cxx_init): Remove old hook. + * pt.c (tsubst_decl): Use new hook. + * tree.c (lang_printable_name): Rename. + +2002-03-18 Eric Botcazou + + PR c++/3882 + * pt.c (tsubst_decl): Move __PRETTY_FUNCTION__ handling... + (tsubst_expr) [DECL_STMT]: ...here. And substitute the initializer + only after recording the declaration. + +2002-03-18 Jason Merrill + + PR c++/2039 + * init.c (resolve_offset_ref): Hand off to build_component_ref. + + PR c++/4222, c++/5995 + * call.c (build_over_call): Fix empty class logic. + + PR c++/3870 + * cp-tree.h (struct saved_scope): Add last_parms field. + * decl.c (maybe_push_to_top_level): Save last_function_parms. + (pop_from_top_level): Restore it. + + PR c++/4377 + * mangle.c (write_expression): Strip NOP_EXPRs sooner. Also strip + NON_LVALUE_EXPRs. + + PR c++/4003 + * pt.c (tsubst_friend_function): Use decl_namespace_context. + + PR c++/3948 -- C++ ABI change, followup to 2001-12-18 patch. + * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE for a + type with a nontrivial destructor. + +2002-03-17 Jason Merrill + + PR c++/4460 + * class.c (build_base_path): Virtual base layout is fixed in + in-charge [cd]tors. + +2002-03-17 Neil Booth + + * cp-lang.c (LANG_HOOKS_PARSE_FILE): Redefine. + * parse.y (yyparse): Remove macro. + +2002-03-17 Jason Merrill + + PR c++/5757 + * init.c (build_new_1): Pass the right pointer to op delete. + +2002-03-16 Nathan Sidwell + + PR c++/4361 + * cp-tree.h (CLASSTYPE_METHOD_VEC): Document where templated + conversion operators go. + (struct lang_decl_flags): Add template_conv_p and unused + bitfields. + (DECL_TEMPLATE_CONV_FN_P): New macro. + * call.c (build_user_type_conversion_1): Don't check second type + conversion of overload set first. + * class.c (add_method): Make sure templated conversion operators + all end up on slot 2. + * lex.c (do_identifier): A conversion operator token might be + satisfied by a templated conversion operator. + * pt.c (check_explicit_specialization): Use + CLASSTYPE_FIRST_CONVERSION_SLOT. + (template_parm_this_level_p): New function. + (push_template_decl_real): Determine DECL_TEMPLATE_CONV_FN_P. + * search.c (lookup_fnfields_1): Template conversions will be on + the first slot. + * typeck.c (build_component_ref): Preserve the type of an + conversion operator name on the overload type. + (build_x_function_call): Retrieve the conversion operator name. + +2002-03-15 Richard Henderson + + * init.c (build_new_1): Use size_binop instead of cp_build_binary_op. + +2002-03-15 Mark Mitchell + + * cp-tree.h (CLEANUP_DECL): Remove. + (CLEANUP_EXPR): Likewise. + * decl.c (destroy_local_var): Simplify. + (maybe_build_cleanup): Tidy. + * dump.c (cp_dump_tree): Remove handling of CLEANUP_STMT. + * semantics.c (cp_expand_stmt): Likewise. + * cp/tree.c (cp_statement_code_p): Likewise. + +2002-03-15 Jason Merrill + + PR c++/5857 + * decl.c (duplicate_decls): Use merge_types instead of common_type. + * typeck.c (common_type): Just hand off to + type_after_usual_arithmetic_conversions and + composite_pointer_type. + (merge_types): New fn. + (commonparms): Use it instead of common_type. + (type_after_usual_arithmetic_conversions): Also handle COMPLEX_TYPE. + (composite_pointer_type): Also handle attributes. + * cp-tree.h: Declare merge_types. + + * decl.c (make_rtl_for_nonlocal_decl): Also defer COMDAT + variables. + * decl2.c (maybe_make_one_only): Also mark the decl as needed. + +2002-03-14 Richard Henderson + + * decl.c: Include c-pragma.h. + (start_decl, start_function): Invoke maybe_apply_pragma_weak. + * Make-lang.in: Update dependencies. + +2002-03-14 Jakub Jelinek + + PR c++/5908 + * call.c (build_over_call): Set TREE_NO_UNUSED_WARNING too. + * cvt.c (convert_to_void): Preserve TREE_NO_UNUSED_WARNING. + +2002-03-12 Richard Sandiford + + * mangle.c (write_builtin_type): Handle 128-bit integers even if + they are not a standard integer type. + +2002-03-12 Richard Sandiford + + * cp-tree.h (init_init_processing): Remove declaration. + * init.c (BI_header_type, init_init_processing): Remove old ABI stuff. + * decl.c (cxx_init_decl_processing): Don't call init_init_processing. + +2002-03-12 Kaveh R. Ghazi + + * cp-lang.c (tree_code_type, tree_code_length, tree_code_name): + Define. + * decl.c (duplicate_decls): Use TREE_CODE_LENGTH, not + tree_code_length. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, + cplus_tree_code_name): Delete. + (cxx_init): Don't call add_c_tree_codes, instead set + lang_unsafe_for_reeval. Don't try to copy into the various + tree_code arrays. + +2002-03-12 Nathan Sidwell + + PR c++/5659 + * decl.c (xref_tag): Don't set CLASSTYPE_DECLARED_CLASS here. + * decl2.c (handle_class_head): Set CLASSTYPE_DECLARED_CLASS for + definitions. + +2002-03-11 Nathan Sidwell + + Revert 2001-03-26 Nathan Sidwell , + DR209 is now not a defect. + * cp-tree.h (skip_type_access_control): Remove. + * decl.c (grokdeclarator): Do type access control for friend + declarations. + * semantics.c (decl_type_access_control): Don't reset + current_type_lookups. + (save_type_access_control): Always save the lookups. + (skip_type_access_control): Remove. + (finish_class_definition): Don't change type_lookups. + +2002-03-11 Nathan Sidwell + + Revert 2000-12-01 Nathan Sidwell , + It is incorrect. + * typeck.c (build_static_cast): Compare non-qualified types + with pointer to member conversions. + +2002-03-11 Dan Nicolaescu + Daniel Berlin + + * cp-lang.c (ok_to_generate_alias_set_for_type): New function. + (cxx_get_alias_set): Use it. + +2002-03-10 Kaveh R. Ghazi + + * cp-tree.h (stabilize_expr): Prototype. + +2002-03-08 Craig Rodrigues + + * cp-tree.h (CLEAR_BINFO_MARKED): Make both parts of + conditional return void. + +2002-03-08 Neil Booth + + * cp-lang.c (LANG_HOOKS_UNSAVE): Redefine. + * cp-tree.h (cxx_unsave): New. + * tree.c (cp_unsave): Rename cxx_unsave, update prototype. + (init_tree): Update. + +2002-03-03 Kaveh R. Ghazi + + * decl.c (cxx_init_decl_processing): Use ARRAY_SIZE in lieu of + explicit sizeof/sizeof. + * decl2.c (cxx_decode_option): Likewise. + * lex.c (init_reswords, REDUCE_LENGTH, TOKEN_LENGTH): Likewise. + +2002-03-02 Nathan Sidwell + + PR c++/775 + * decl.c (lookup_tag): Only reject enum/class mismatch, not + class/union mismatch. + * parse.y (check_class_key): New function. + (structsp): Call it. + +2002-03-01 Michael Matz + + * typeck.c (cp_pointer_int_sum): Complete inner type which is + used later by size_in_bytes(). + +2002-03-01 Phil Edwards + + * cp-tree.h: Require __GNUC__ to be #defined. + (build_init): Add missing prototype. + +2002-03-01 Jason Merrill + + * except.c: Don't include decl.h or obstack.h. Do include + tree-inline.h. + (build_throw): Destroy temporaries from the thrown + expression before calling __cxa_throw. Construct a thrown + temporary directly into the exception object. + (stabilize_throw_expr): New function. + (wrap_cleanups_r): New function. + * tree.c (stabilize_expr): New function. + * init.c (build_init): New function. + * Make-lang.in (cp/except.o): Adjust .h deps. + +2002-02-28 Jason Merrill + + * search.c (lookup_base_r): Don't clear is_non_public just because + we found a friendly scope. + + * decl.c (finish_function): Only warn about missing return + statement with -Wreturn-type. + +2002-02-28 Neil Booth + + * class.c (build_clone): Update. + * cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. + * cp-tree.h (cxx_dup_lang_specific_decl): New. + * lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl. + (copy_decl): Update. + * method.c (make_thunk): Update. + +2002-02-27 Zack Weinberg + + * decl2.c: Delete traditional-mode-related code copied from + the C front end but not used, or used only to permit the + compiler to link. + +2002-02-24 Craig Rodrigues + + PR c++/4093 + * cp-tree.h (SET_BINFO_MARKED): Cast false part of condition + to void. + +2002-02-22 Jakub Jelinek + + PR other/5746 + * semantics.c (finish_switch_cond): Don't call get_unwidened + if error_mark_node. + +2002-02-22 Nathan Sidwell + + PR c++/2645, DR 295 + * cp-tree.h (tsubst_flags_t): Add tf_ignore_bad_quals, + tf_keep_type_decl. + (make_typename_type): Use tsubst_flags_t. + * decl.c (make_typename_type): Adjust. Return non-artificial + TYPE_DECLs, if required. + (grokdeclarator): Simplify CVR qualification handling. Allow bad + qualifiers on typedef types. + * decl2.c (handle_class_head): Adjust make_typename_type call. + * parse.y (nested_name_specifier): Likewise. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + * pt.c (convert_template_argument): Adjust make_typename_type + return value. + (tsubst): Adjust cp_build_qualified_type_real calls. + (check_cv_quals_for_unify): Cope with allowing bad qualifications + on template type parms. + (instantiate_decl): Recheck substitutions to give warnings on bad + qualifications. + * tree.c (cp_build_qualified_type_real): Use tf_allow_bad_quals. + +2002-02-21 Aldy Hernandez + + * cp/decl.c (duplicate_decls): Merge always_inline attribute. + + * cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0 + unless DECL_ALWAYS_INLINE. + +2002-02-20 Jakub Jelinek + + * typeck.c (cp_pointer_int_sum): Renamed from + pointer_int_sum, call pointer_int_sum. + +2002-02-20 Jakub Jelinek + + * decl.c (duplicate_decls): Return 0 if issued error about + redeclaration. + +2002-02-19 Jason Merrill + + ABI change: Mangle `void (A::*)() const' as + M1AKFvvE, not MK1AFvvE. + * mangle.c (write_function_type): Write cv-quals for member + function type here. + (write_pointer_to_member_type): Not here. + +2002-02-18 Jason Merrill + + * pt.c (do_type_instantiation): Don't pedwarn if in_system_header. + (do_decl_instantiation): Likewise. + +2002-02-17 Craig Rodrigues + + PR c++/5685 + * decl.c (duplicate_decls): Make warning unconditional + if duplicate default argument declarations are present. + +2002-02-17 Jakub Jelinek + + * typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit + shortening. + +2002-02-15 Nathan Sidwell + + * decl.c (grokdeclarator): Set typedef_decl for all TYPE_DECLs, + remove incorrect comment. Move #if 0'd code to common path. Use + IMPLICIT_TYPENAME_P. Simplify & reformat ARRAY_TYPE duplication. + +2002-02-13 Jason Merrill + + * decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. + (finish_function): Don't warn if current_function_returns_null. + + * typeck2.c (digest_init): Do handle values of vector type. + + * typeck2.c (digest_init, process_init_constructor): Treat vectors + like arrays. + +2002-02-11 Jason Merrill + + * parse.y (reserved_declspecs): Don't handle attributes. + (reserved_typespecquals): Handle them here. + * Make-lang.in (parse.c): Adjust expected conflicts. + +2002-02-08 Jakub Jelinek + + * parse.y (primary, primary_no_id): Use compstmt_or_stmtexpr + instead of compstmt. + (compstmt_or_stmtexpr): Renamed from compstmt. + (compstmt): In addition to compstmt_or_stmtexpr clear last_expr_type. + +2002-02-07 Nathan Sidwell + + Rename instantiate_type_flags to tsubst_flags_t & expand use. + * cp-tree.h (instantiate_type_flags): Rename to ... + (tsubst_flags_t): ... here. Rename itf_complain to tf_error, + add tf_warning flag. + (instantiate_type): Adjust prototype. + (tsubst, tsubst_expr, tsubst_copy, lookup_template_class, + do_type_instantiation, cp_build_qualified_type_real): Likewise. + cp_build_qualified_type: Adjust. + * class.c (instantiate_type): Adjust parameter. Rename itf_* to + tf_*. + * call.c (standard_conversion): Rename itf_* to tf_*. + (reference_binding): Likewise. + (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_reference): Likewise. + * decl.c (lookup_namespace_name): Use tf_* flags. + (make_typename_type): Likewise. + (grokdeclarator): Likewise. + * pt.c (convert_nontype_argument): Adjust COMPLAIN usage. + (coerce_template_template_parms, convert_template_argument, + coerce_template_parms, maybe_get_template_decl_from_type_decl, + lookup_template_class, tsubst_friend_function, tsubst_friend_class, + instantiate_class_template, tsubst_template_arg_vector, + tsubst_template_parms, tsubst_aggr_type, tsubst_default_argument, + tsubst_decl, tsubst_arg_types, tsubst_function_type, + tsubst_call_declarator_parms, tsubst, tsubst_copy, tsubst_expr, + instantiate_template, fn_type_unification, + resolve_overloaded_unification, verify_class_unification, + unify, get_bindings_real, do_type_instantiation, + regenerate_decl_from_template, instantiate_decl, + tsubst_initializer_list, tsubst_enum, + get_mostly_instantiated_function_type, + invalid_nontype_parm_type_p): Likewise. + * tree.c (cp_build_qualified_type_real): Likewise. + * typeck.c (build_binary_op): Rename itf_* to tf_*. + (build_ptrmemfunc): Likewise. + (convert_for_assignment): Likewise. + +2002-02-07 Nathan Sidwell + + PR c++/109 + * decl.c (grokdeclarator): Allow friend declarations from + dependent types. + * decl2.c (handle_class_head): Don't push into template parm contexts. + * pt.c (push_template_decl_real): Template parm contexts are never + being defined. + +2002-02-05 Alexandre Oliva + + * class.c: Include target.h. + (check_bitfield_decl): Disregard EMPTY_FIELD_BOUNDARY, + BITFIELDS_NBYTES_LIMITED and PCC_BITFIELD_TYPE_MATTERS for MS + bit-field layout. + * Make-lang.in: Adjust deps. + +2002-02-05 Jason Merrill + + * error.c (dump_type): Be more helpful about VECTOR_TYPE. + +2002-02-04 Jakub Jelinek + + * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE. + (finish_switch_cond): Set SWITCH_TYPE. + +2002-02-04 Richard Henderson + + * method.c (use_thunk): Always initialize the block tree. Reindent. + * semantics.c (expand_body): Emit thunks after function, not before. + +2002-02-04 Jason Merrill + + * decl.c (start_function): Call cplus_decl_attributes immediately + after grokdeclarator. + + * decl.c (start_function): Combine DECL_RESULT handling code. + +2002-02-03 Jason Merrill + + * xref.c: Remove. + * Make-lang.in (CXX_OBJS): Remove cp/xref.o + (cp/xref.o): Remove dependencies. + * class.c (finish_struct_1, check_methods): Don't call xref fns. + (finish_struct_1): Likewise. + * friend.c (make_friend_class): Likewise. + * lex.c (cxx_init, cxx_finish, extract_interface_info): Likewise. + * spew.c (read_process_identifier): Likewise. + +2002-02-01 Jason Merrill + + PR c++/4872 + * decl.c (finish_function): Warn about a non-void function with + no return statement and no abnormal exit. + * cp-tree.h (struct cp_language_function): Add returns_abnormally. + (current_function_returns_abnormally): New macro. + * call.c (build_call): Set it. + + * typeck.c (build_component_ref): Always complain about offsetof + constructs on non-PODs. Only make it an error for members of + virtual bases. + + * error.c (dump_scope): Don't add TFF_DECL_SPECIFIERS. + (dump_function_decl): Always dump parms. + + * decl2.c (finish_static_data_member_decl): Complain about a local + class with a static data member. + + PR c++/4286 + * search.c (lookup_field_1): Don't xref a static data member + just because we looked it up. + +2002-01-31 Jason Merrill + + * Make-lang.in (parse.c): Handle .output file. + + PR c++/3395 + * decl.c (xref_tag): Remember early attributes in TYPE_ATTRIBUTES, + not TREE_TYPE. + * semantics.c (finish_class_definition): Adjust. + + Allow attributes in parms and casts. + * parse.y (named_parm): Don't strip attrs. + (declmods): Remove 'attributes' production. + (nonempty_cv_qualifiers): Accept attributes. + (ATTRIBUTE): Give precedence. + * decl.c (groktypename): Handle attributes. + (grokparms): Likewise. + +2002-01-29 Jakub Jelinek + + * decl2.c (cxx_decode_option): Pass 0 as last argument to + cpp_handle_option. + * lang-specs.h: Use cpp_unique_options instead of cpp_options + when used together with cc1_options. + +2002-01-29 Nathan Sidwell + + PR c++/5132 + * typeck2.c (digest_init): Make sure non-array core type is + instantiated. + * decl2.c (reparse_absdcl_as_casts): Just store the type in the + constructor, rather than build a new one. + (build_expr_from_tree, CONSTRUCTOR case): Be careful with the + PURPOSE of constructor elts. + +2002-01-23 Zack Weinberg + + * Make-lang.in (parse.c): Adjust expected number of + shift-reduce conflicts. + (decl.o): Depend on diagnostic.h. + * decl.c: Include diagnostic.h. + (grokdeclarator): Check for null pointer. + (finish_function): Don't abort when + current_binding_level->parm_flag != 1, if errors have + occurred; throw away the statement tree and extra binding + levels, and continue. + * lex.c (note_list_got_semicolon): Check for null pointer. + * method.c (hack_identifier): Just return error_mark_node if + value is error_mark_node. + * parse.y (primary: TYPEID(type_id)): No need to use + TYPE_MAIN_VARIANT here. + (handler_seq): Accept an empty list of catch clauses and + generate a fake handler block to avoid later crashes. + (ansi_raise_identifier): Accept the error token too. + * semantics.c (begin_class_definition, + finish_class_definition): Check for error_mark_node. + +2002-01-23 Zack Weinberg + + * typeck2.c (friendly_abort): Delete definition. + * cp-tree.h (friendly_abort): Don't prototype. + (my_friendly_assert): Use fancy_abort. + +2002-01-23 Craig Rodrigues + + * cp-tree.h (my_friendly_abort): Remove. + +2002-01-23 Jakub Jelinek + + * spew.c (pending_inlines, pending_inlines_tail, + processing_these_inlines): Make static. + (mark_pending_inlines): Remove static. + (begin_parsing_inclass_inline): If in function, save pi + for GC to cp_function_chain->unparsed_inlines instead. + (process_next_inline): Likewise. + * cp-tree.h (struct cp_language_function): Add unparsed_inlines. + (mark_pending_inlines): Add prototype. + * decl.c (spew_debug): Remove unused extern. + (mark_lang_function): Call mark_pending_inlines. + +2002-01-23 Craig Rodrigues + + * call.c, class.c, decl.c, decl2.c, error.c, expr.c, friend.c, + init.c, lex.c, mangle.c, method.c, pt.c, repo.c, rtti.c, search.c, + semantics.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: + Change my_fancy_abort() to abort(). + +2002-01-23 Jason Merrill + + PR c++/5453 + * class.c (fixed_type_or_null): Fix thinko. + + PR c++/3331 + * init.c (resolve_offset_ref): Use build_indirect_ref. + + * decl2.c (grokclassfn): Don't set DECL_REGISTER on 'this'. + +2002-01-22 Jason Merrill + + * parse.y (function_body): Suppress the block for the outermost + curly braces. + * decl.c (pushdecl): Don't try to skip it. + (begin_function_body): Keep the block we create, not the next one. + * init.c (emit_base_init): Don't mess with keep_next_level. + + * class.c (build_base_path): Tweak formatting. + +2002-01-19 Nathan Sidwell + + Fix regression introduced with patch for c++/775 + * parse.y (class_head_defn): Check for template specializations + with a different class-key. + +2002-01-17 Jason Merrill + + * decl.c (begin_constructor_body, begin_destructor_body): New fns. + (begin_function_body): Call them and keep_next_level. + * init.c (emit_base_init): Call keep_next_level. + * semantics.c (setup_vtbl_ptr): Lose. + * cp-tree.h (struct cp_language_function): Remove vtbls_set_up_p. + (vtbls_set_up_p): Lose. + * pt.c (tsubst_expr, CTOR_INITIALIZER): Call emit_base_init. + * method.c (do_build_copy_constructor): Likewise. + (synthesize_method): Call finish_mem_initializers. + * parse.y (nodecls): Likewise. + + * error.c (dump_type_suffix): Print the exception specs before + recursing. + (dump_function_decl): Here, too. + + * cp-tree.h (TMPL_PARMS_DEPTH): Cast to signed HOST_WIDE_INT. + +2002-01-10 Ira Ruben + + PR c++/907 + * decl.c (start_method): Handle attrlist. + +2002-01-10 Jakub Jelinek + + * decl2.c (max_tinst_depth): Increase default limit to 500. + +2002-01-10 Graham Stott + + * spew.c (YYCHAR): Uppercase macro parameter and add + parenthesis. + (YYCODE): Likewise. + (NAME): Uppercase macro parameter. + +2002-01-09 Graham Stott + + * decl.h (grokdeclarator): Wrap long line. + + * semantics.c (FINISH_COND): Uppercase macro paramaters and + add parenthesis. + +2002-01-08 Graham Stott + + * xref.c (FILE_NAME_ABSOLUTE_P): Add parenthesis. + (PALLOC): Uppercase macro parameter and whitespace. + (SALLOC): Uppercase macro parameter. + (SFREE): Uppercase macros parameter, add parenthese and + whitespace. + (STREQL): Uppercase macro parameter and whitespace. + (STRNEQ): Likewise. + (STRLSS): Likewise. + (STRLEQ): Likewise. + (STRGTR): Likewise. + (STRGEQ): Likewise. + + * call.c (convert_like): Add parenthesis and wrap. + (convert_like_with_context): Likewise. + (ICS_RANK): Whitespace. + (NEED_TEMPORARY_P): Remove parenthesis. + + * class.c (VTT_TOP_LEVEL_P): Uppercase macro parameter and + whitespace. + (VTT_MARKED_BINFO_P): Likewise. + + * decl.c (BINDING_LEVEL): Add parenthesis. + (DEF_OPERATOR): Likewise. + + * mangle.c (MANGLE_TRACE): Add parenthesis. + (MANGLE_TRACE_TREE): Likewise. + (write_signed_number): Likewise. + (write_unsigned_number): Likewise. + + * pt.c (ccat): Uppercase macro parameter. + (cat): Likewise + + * search.c (SET_BINFO_ACCESS): Add parenthesis. + +2002-01-07 Jason Merrill + + * decl2.c (coerce_new_type): Downgrade error for size_t mismatch + to pedwarn. + + PR c++/3536 + * method.c (make_thunk): If !flag_weak, give the thunk the + function's linkage. + (use_thunk): Here, too. + +2002-01-07 Graham Stott + + * error.c: Update copyright date. + (print_scope_operator): Add parenthesis. + (print_left_paren): Likewise. + (print_right_paren): Likewise. + (print_left_bracket): Likewise. + (print_right_bracket): Likewise. + (print_template_argument_list_start): Likewise. + (print_template_argument_list_end): Likewise. + (print_non_consecutive_character): Likewise. + (print_tree_identifier): Likewise. + (print_identifier): Likewise. + (NEXT_CODE): Uppercase macro parameter. + (ident_fndecl): Delete unused. + (GLOBAL_THING): Likewise. + +2002-01-06 Graham Stott + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): Add parenthesis. + (VAR_FUNCTION_OR_PARM_DECL_CHECK): Likewise. + (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK) Likewise. + (RECORD_OR_UNION_TYPE_CHECK): Likewise. + (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Likewise. + (C_IS_RESERVED_WORD): Uppercase macro parameter. + (C_RID_YYCODE) Likewise. + (ptrmem_cst): Use rtx. + (LOCAL_BINDING_P): Add whitespace. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Wrap long line. + (BINDING_HAS_LEVEL_P): Remove parenthesis. + (BINDING_VALUE): Wrap long line. + (BINDING_TYPE): Whitespace. + (IDENTIFIER_GLOBAL_VALUE): Add parenthesis. + (SET_IDENTIFIER_GLOBAL_VALUE): Likewise. + (IDENTIFIER_NAMESPACE_VALUE): Likewise. + (SET_IDENTIFIER_NAMESPACE_VALUE: Likewise. + (same_type_p): Uppercase macro parameters. + (same_type_ignoring_top_level_qualifiers_p): Likewise. + (OVL_FUNCTION): Wrap long line. + (OVL_CHAIN): Whitespace. + (OVL_CURRENT): Add parenthesis and whitespace. + (OVL_NEXT): Whitespace. + (OVL_USED): Likewise. + (IDENTIFIER_TYPE_VALUE): Likewise. + (REAL_IDENTIFIER_TYPE_VALUE): Remove parenthesis. + (SET_IDENTIFIER_TYPE_VALUE): Add parenthesis and whitespace. + (LANG_ID_FIELD): Whitespace. + (SET_LANG_ID(NODE,VALUE,NAME): Likewise. + (IDENTIFIER_LABEL_VALUE): Whitespace and wrap. + (SET_IDENTIFIER_LABEL_VALUE): Whitespace. + (IDENTIFIER_IMPLICIT_DECL): Whitespace and wrap. + (SET_IDENTIFIER_IMPLICIT_DECL); Whitespace. + (IDENTIFIER_ERROR_LOCUS): Whitespace and wrap. + (SET_IDENTIFIER_ERROR_LOCUS); Whitespace. + (IDENTIFIER_VIRTUAL_P): Likewise. + (IDENTIFIER_OPNAME_P): Likewise. + (IDENTIFIER_TYPENAME_P): Remove parenthesis. + (C_TYPE_FIELDS_READONLY): Uppercase macro parameters. + (C_SET_EXP_ORIGINAL_CODE): Likewise. + (TYPE_ASSEMBLER_NAME_STRING): Wrap long line. + (TYPE_ASSEMBLER_NAME_LENGTH): Likewise. + (IS_AGGR_TYPE): Uppercase macro parameter. + (CLASS_TYPE_P): Likewise. + (IS_AGGR_TYPE_CODE): Uppercase macro parameter and parenthesis. + (IS_AGGR_TYPE_2): Whitespace. + (TAGGED_TYPE_P): Uppercase macro parameter. + (TYPE_BUILT_IN): Whitespace. + (TYPE_FOR_JAVA): Likewise. + (FUNCTION_ARG_CHAIN): Remove parenthesis. + (FUNCTION_FIRST_USER_PARMTYPE): Add parenthesis. + (FUNCTION_FIRST_USER_PARAM): Likewise. + (PROMOTES_TO_AGGR_TYPE): Whitespace. + (DERIVED_FROM_P): Add parenthesis and wrap. + (UNIQUELY_DERIVED_FROM_P): Likewise. + (ACCESSIBLY_UNIQUELY_DERIVED_P): Likewise. + (PUBLICLY_UNIQUELY_DERIVED_P): Likewise. + (CLASSTYPE_USE_TEMPLATE): Whitespace. + (CLASSTYPE_INLINE_FRIENDS): Remove parenthesis. + (TYPE_GETS_DELETE): Add parenthesis. + (TYPE_HAS_CONVERSION): Add parenthesis and wrap. + (TYPE_HAS_ASSIGN_REF): Likewise, + (TYPE_HAS_CONST_ASSIGN_REF): Likewise. + (TYPE_HAS_INIT_REF): Likewise. + (TYPE_HAS_CONST_INIT_REF): Likewise. + (TYPE_BEING_DEFINED): Likewise. + (TYPE_LANG_SPECIFIC): Likewise. + (CLASSTYPE_RTTI): Likewise. + (TYPE_OVERLOADS_CALL_EXPR): Likewise. + (TYPE_OVERLOADS_ARRAY_REF): Likewise. + (TYPE_OVERLOADS_ARROW): Likewise. + (TYPE_USES_MULTIPLE_INHERITANCE): Likewise. + (TYPE_USES_VIRTUAL_BASECLASSES): Add parenthesis. + (CLASSTYPE_METHOD_VEC): Likewise. + (CLASSTYPE_MARKED_N): Likewise. + (CLASSTYPE_MARKED): Likewise. + (CLASSTYPE_MARKED2): Likewise. + (CLASSTYPE_MARKED3): Likewise. + (CLASSTYPE_MARKED4): Likewise. + (CLASSTYPE_MARKED5): Likewise. + (CLASSTYPE_MARKED6): Likewise. + (SET_CLASSTYPE_MARKED): Whitespace. + (CLEAR_CLASSTYPE_MARKED): Likewise. + (SET_CLASSTYPE_MARKED2): Likewise. + (CLEAR_CLASSTYPE_MARKED2): Likewise. + (SET_CLASSTYPE_MARKED3): Likewise. + (CLEAR_CLASSTYPE_MARKED3): Likewise. + (SET_CLASSTYPE_MARKED4): Likewise. + (CLEAR_CLASSTYPE_MARKED4): Likewise. + (SET_CLASSTYPE_MARKED5): Likewise. + (CLEAR_CLASSTYPE_MARKED5): Likewise. + (SET_CLASSTYPE_MARKED6): Likewise. + (CLEAR_CLASSTYPE_MARKED6): Likewise. + (CLASSTYPE_TAGS): Likewise. + (CLASSTYPE_VSIZE): Likewise. + (CLASSTYPE_VBASECLASSES): Likewise. + (CANONICAL_BINFO): Add parenthesis. + (CLASSTYPE_SIZE(NODE): Likewise. + (CLASSTYPE_SIZE_UNIT): Likewise. + (CLASSTYPE_ALIGN(NODE): Likewise. + (CLASSTYPE_USER_ALIGN): Likewise. + (TYPE_JAVA_INTERFACE): Likewise. + (CLASSTYPE_PURE_VIRTUALS): Likewise. + (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Whitespace and wrap. + (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise. + (CLASSTYPE_HAS_MUTABLE): Likewise. + (CLASSTYPE_FRIEND_CLASSES): Likewise. Likewise. + (CLASSTYPE_DECLARED_CLASS): Whitespace and wrap. + (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Likewise. + (CLASSTYPE_REF_FIELDS_NEED_INIT): Likewise. + (CLASSTYPE_INTERFACE_ONLY): Likewise. + (CLASSTYPE_INTERFACE_KNOWN): Likewise. + (CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. + (CLASSTYPE_DEBUG_REQUESTED): Whitespace and wrap. + (BINFO_UNSHARED_MARKED): Whitespace. + (BINFO_MARKED): Whitespace and wrap. + (SET_BINFO_MARKED): Likewise. + (CLEAR_BINFO_MARKED): Likewise. + (BINFO_VTABLE_PATH_MARKED): Likewise. + (SET_BINFO_VTABLE_PATH_MARKED): Likewise. + (CLEAR_BINFO_VTABLE_PATH_MARKED): Likewise. + (BINFO_SUBVTT_INDEX): Remove parenthesis. + (BINFO_VPTR_INDEX): Likewise. + (BINFO_PRIMARY_BASE_OF): Likewise, + (CLASSTYPE_VFIELDS): Whitespace. + (VF_DERIVED_VALUE): Wrap long line. + (NAMESPACE_LEVEL): Whitespace. + (CAN_HAVE_FULL_LANG_DECL_P): Remove parenthesis. + (DEFARG_POINTER): Whitespace. + (DECL_NEEDED_P): Remove parenthesis. + (DECL_LANGUAGE): Whitespace. + (SET_DECL_LANGUAGE): Add parenthesis. + (DECL_CONSTRUCTOR_P): Whitespace and wrap. + (DECL_OVERLOADED_OPERATOR_P): Remove parenthesis. + (DECL_IN_AGGR_P): Whitespace. + (DECL_FRIEND_P): Likewise. + (DECL_BEFRIENDING_CLASSES): Likewise. + (DECL_STATIC_FUNCTION_P): Whitespace and wrap. + (DECL_NONCONVERTING_P): Whitespace. + (DECL_PURE_VIRTUAL_P): Likewise. + (DECL_NEEDS_FINAL_OVERRIDER_P): Likewise. + (DECL_PENDING_INLINE_INFO): Whitespace. + (DECL_SORTED_FIELDS): Likewise. + (DECL_DEFERRED_FN): Likewise. + (DECL_TEMPLATE_INFO): Likewise. + (CLASSTYPE_TEMPLATE_INFO): Whitespace and wrap. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO); Likewise. + (SET_TYPE_TEMPLATE_INFO): Add parenthesis. + (TMPL_ARGS_LEVEL): Likewise. + (SET_TMPL_ARGS_LEVEL): Likewise. + (INNERMOST_TEMPLATE_PARMS): Whitespace. + (C_TYPEDEF_EXPLICITLY_SIGNED): Uppercase macro parameter. + (INTEGRAL_CODE_P(CODE): Add parenthesis. + (CP_INTEGRAL_TYPE_P): Remove parenthesis. + (TYPE_HAS_CONSTRUCTOR): Whitespace. + (TREE_HAS_CONSTRUCTOR): Likewise. + (TYPE_HAS_DESTRUCTOR): Likewise. + (TYPE_HAS_REAL_ASSIGN_REF): Likewise. + (TYPE_HAS_COMPLEX_ASSIGN_REF): Likewise. + (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. + (TYPE_HAS_COMPLEX_INIT_REF): Likewise. + (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise. + (TYPE_PTRMEMFUNC_P): Likewise. + (TYPE_PTRMEMFUNC_FLAG): Likewise. + (TYPE_GET_PTRMEMFUNC_TYPE): Likewise. + (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. + (TYPE_PTRMEM_CLASS_TYPE): Remove parenthesis. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (DECL_ACCESS): Whitespace. + (DECL_GLOBAL_CTOR_P): Remove parenthesis. + (DECL_GLOBAL_DTOR_P): Likewise. + (GLOBAL_INIT_PRIORITY): Likewise. + (DECL_TEMPLATE_PARMS): Likewise. + (DECL_TEMPLATE_RESULT): Likewise. + (DECL_TEMPLATE_INSTANTIATIONS): Likewise. + (DECL_TEMPLATE_SPECIALIZATIONS): Likewise. + (DECL_IMPLICIT_TYPEDEF_P): Remove parenthesis. + (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. + (PRIMARY_TEMPLATE_P): Add parenthesis. + (DECL_USE_TEMPLATE): Whitespace. + (CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. + (SET_CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. + (CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. + (SET_CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. + (CALL_DECLARATOR_PARMS): Remove parenthesis. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. + (TEMP_NAME_P): Wrap. + (VFIELD_NAME_P): Likewise. + (B_SET): Uppercase macro parameters and add parenthesis. + (B_CLR): Likewise. + (B_TST): Likewise. + (LOOKUP_NAMESPACES_ONLY): Uppercase macro parameters. + (LOOKUP_TYPES_ONLY): Uppercase macro parameters. + (LOOKUP_QUALIFIERS_ONLY): Uppercase macro parameters. + (same_or_base_type_p): Likewise. + (cp_deprecated): Likewise. + +2002-01-05 Richard Henderson + + * semantics.c (expand_body): Revert last change. + +2002-01-04 Jason Merrill + + PR c++/4122 + * class.c (update_vtable_entry_for_fn): Set delta to zero for a + lost primary. + + * class.c (build_vtbl_initializer): Check for a lost primary + before calculating the vtable entry to throw away. + +2002-01-02 Jason Merrill + + * semantics.c (expand_body): Call outlining_inline_function when + emitting an inline function out of line. + +2002-01-02 Nathan Sidwell + + PR c++/5116, c++/764 reversion + * call.c (build_new_op): Revert the instantiations. They are + incorrect. + +2002-01-02 Nathan Sidwell + + PR c++/5089 + * decl2.c (reparse_absdcl_as_casts): Don't warn about casts to void. + +2002-01-02 Nathan Sidwell + + PR c++/3716 + * pt.c (tsubst_aggr_type): Move pmf handling into tsubst. + (tsubst, case POINTER_TYPE): Handle pmfs here. + (tsubst, case OFFSET_TYPE): Check it is not an offset to + reference. If it is offset to FUNCTION_TYPE, create a METHOD_TYPE. + +2002-01-02 Nathan Sidwell + + PR c++/35 + * cp-tree.h (DECL_LANG_FLAG_0): Used for PARM_DECL too. + (DECL_TEMPLATE_PARM_P): A PARM_DECL might be one too. + * pt.c (process_template_parm): SET_DECL_TEMPLATE_PARM_P on the + PARM_DECL. + (tsubst_template_parms): Break up loop statements. + (tsubst_decl, case PARM_DECL): Copy DECL_TEMPLATE_PARM_P. Template + parm PARM_DECLs don't get promoted. + +2002-01-02 Nathan Sidwell + + PR c++/5123 + * typeck.c (build_component_ref): Cope with a TEMPLATE_ID_EXPR. + (build_x_function_call): Cope with a COMPONENT_REF containing a + TEMPLATE_ID_EXPR. + +2002-01-02 Nathan Sidwell + + PR c++/5213 + * pt.c (convert_template_argument): Be more careful determining + when RECORD_TYPE templates are or are not templates. + +2002-01-02 Nathan Sidwell + + PR c++/775 + * cp-tree.h (handle_class_head): Adjust prototype. + * decl2.c (handle_class_head): Add DEFN_P and NEW_TYPE_P + parameters. Use for all class heads. + * parse.y (named_class_head_sans_basetype, named_class_head, + named_complex_class_head_sans_basetype, + named_class_head_sans_basetype_defn, + unnamed_class_head): Remove. + (class_head, class_head_apparent_template): Recognize class heads + (class_head_decl, class_head_defn): New reductions. Process class + heads. + (structsp): Adjust class definition and class declaration + reductions. + (maybe_base_class_list): Give diagnostic on empty list. + +2002-01-02 Nathan Sidwell + + PR c++/4379 + * typeck.c (build_x_unary_op): Don't destroy the OFFSET_REF on a + single non-static member. + (unary_complex_lvalue): If it cannot be a pointer to member, don't + make it so. Check it is not pointer to reference. + +2002-01-02 Nathan Sidwell + + PR c++/5132 + * decl2.c (reparse_absdcl_as_casts): Don't digest_init if we + are processing a template decl. + +2002-01-02 Nathan Sidwell + + PR c++/5116, c++/764 + * call.c (build_new_op): Make sure template class operands are + instantiated. Simplify arglist construction. + diff --git a/contrib/gcc/cp/ChangeLog-2003 b/contrib/gcc/cp/ChangeLog-2003 new file mode 100644 index 00000000000..1cd19fa8e20 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-2003 @@ -0,0 +1,6905 @@ +2003-12-30 Nathan Sidwell + + PR c++/13507 + * decl.c (duplicate_decls): Use build_type_attribute_variant to + merge attributes. + + PR c++/13494 + * tree.c (build_cplus_array_type_1): Only build a minimal array + type for dependent types or domains. + +2003-12-29 Nathan Sidwell + + PR c++/12774 + * typeck.c (comp_array_types): Fold non-dependent domains for + ABI-1. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/13289 + * semantics.c (finish_id_expression): Only check if the type of + a template argument is integral or enumeration when it is not + dependent. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/12403 + * parser.c (cp_parser_template_declaration_after_export): Set up + template specialization scope in case of explicit specialization. + +2003-12-28 Mark Mitchell + + PR c++/13081 + * decl.c (duplicate_decls): Preserve inline-ness when redeclaring + a function template. + + PR c++/12613 + * decl.c (reshape_init): Reject GNU colon-style designated + initializers in arrays. + + PR c++/13009 + * call.c (build_special_member_call): Do not assume that we have a + pointer to the complete object in an assignment operator. + +2003-12-28 Roger Sayle + + PR c++/13070 + * decl.c (duplicate_decls): When setting the type of an anticipated + declaration, merge the existing type attributes. + +2003-12-25 Andrew Pinski + + PR c++/13268, c++/13339 + * class.c (add_method): Return early when method is error_mark_node. + * pt.c (tsubst_friend_function): Return early when new_friend is + error_mark_node. + +2003-12-23 Mark Mitchell + + * cp-lang.c (cp_expr_size): Return zero for empty classes. + + * cp-tree.h (warn_if_uknown_interface): Remove unused function. + * decl2.c (warn_if_unknown_interface): Likewise. + +2003-12-23 Nathan Sidwell + + PR c++/13387 + * cp-lang.c (cxx_get_alias_set): Correct logic for a base type. + +2003-12-22 Mark Mitchell + + * decl.c (start_function): Do not check + flag_alt_external_templates or flag_external_templates. + * decl2.c (warn_if_unknown_interface): Likewise. + * lex.c (extract_interface_info): Likewise. + * pt.c (lookup_template_class): Likewise. + + PR c++/12862 + * name-lookup.c (pushdecl): Look up all namespace-scope entities + in their corresponding namespace. + + PR c++/12397 + * typeck.c (finish_class_member_access_expr): Don't tree + IDENTIFIER_NODEs as non-dependent expressions. + +2003-12-22 Andrew Pinski + + PR c++/5050 + * tree.c (cp_start_inlining): Remove. + (cp_end_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. + * cp-tree.h (cp_start_inlining): Do not declare. + (cp_end_inlining): Do not declare. + +2003-12-22 Mark Mitchell + + PR c++/12479 + * parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;" + pedwarn when not in a system header. + +2003-12-21 Mark Mitchell + + * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE, + CPTI_UNION_TYPE, CPTI_ENUM_TYPE. + (record_type_node): Remove. + (union_type_node): Likewise. + (enum_type_node): Likewise. + * decl.c: Remove mention of above tree nodes in comment. + * lex.c (cxx_init): Do not assign to record_type_node, + union_type_node, or enum_type_node. Simplify handling of + class_type_node. + + PR c++/11554 + * init.c (sort_mem_initializers): Add warning. + +2003-12-21 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * error.c: Likewise. + * except.c: Likewise. + * init.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * semantics.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Kazu Hirata + + * cvt.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * decl.c: Likewise. + * decl2.c: Likewise. + * expr.c: Likewise. + * friend.c: Likewise. + * lex.c: Likewise. + * name-lookup.c: Likewise. + * repo.c: Likewise. + * search.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Mark Mitchell + + PR c++/12795 + * name-lookup.c (pushdecl): Do not treated any functions as being + "nested" in C++. + +2003-12-19 Jason Merrill + + 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 + + * cp-tree.h (struct lang_type_header): Remove __extension__. + +2003-12-18 Jason Merrill + + PR c++/12253 + * init.c (build_vec_init): Initialization of an element from + an initializer list is also a full-expression. + + * parser.c, pt.c, semantics.c: Rename constant_expression_p + to integral_constant_expression_p. + +2003-12-18 Kriang Lerdsuwanakij + + PR c++/13262 + * pt.c (instantiate_decl): Wrap push_nested_class and + pop_nested_class around cp_finish_decl call for static member + variable. + +2003-12-18 Giovanni Bajo + + PR c++/9154 + * parser.c (cp_parser_template_argument): A type-id followed by '>>' + is just an user typo, and should be accepted as last resort if any + other parsing fails. + (cp_parser_enclosed_template_argument_list): If the argument list is + parsed correctly, but the next token is '>>', emit a diagnostic. + (cp_parser_next_token_ends_template_argument): Accept '>>' as + delimiter of template argument, it will be later detected as a typo. + +2003-12-17 Kelley Cook + + * Make-lang.in: Replace cp/g++.1 with $(docobjdir)/g++.1. + +2003-12-17 Mark Mitchell + + PR c++/10603 + PR c++/12827 + * parser.c (cp_parser_error): Help c_parse_error print good + messages if the next token is a keyword. + (cp_parser_parameter_declaration_list): When resynchronizing after + a bad parameter declaration, stop if a comma is found. + (cp_parser_parameter_declaration): Avoid backtracking. + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + +2003-12-16 Nathan Sidwell + + PR c++/9043 + C++ ABI change: Mangling array indices in templates. + * decl.c (compute_array_index_type): Reorganize for earlier + template errors. Use value_dependent_expression_p for abi-2. + * mangle.c (write_array_type): Check broken mangling for + expression indices on abi-1 + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + + PR c++/13275 + * lex.c (reswords): Add "__offsetof" and "__offsetof__". + * parser.c (cp_parser): Add in_offsetof_p. + (cp_parser_new): Initialize it. + (cp_parser_primary_expression): Handle __offsetof__ (...). + (cp_parser_postfix_expression): Allow casts to pointer type and + uses of "->" in a constant expression if implementing offsetof. + (cp_parser_unary_expression): Allow the use of "&" in a constant + expression if implementing offsetof. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-16 Giovanni Bajo + + * semantics.c (finish_id_expression): Refactor the code to handle + template parameters, and emit a more informative error message + when they are used within an integral constant expression. + +2003-12-16 Nathan Sidwell + + PR c++/13387 + * class.c (finish_struct_1): Compute mode and alias set for + CLASSTYPE_AS_BASE. + * call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial + assignment of a class, as necessary. + * cp-lang.c (cxx_get_alias_set): The alias set as a base is the + same as for the complete type. + + PR c++/13242 + C++ ABI change. Mangling template parameters of reference type + * mangle.c (write_template_args): Remove unreachable code. + (write_template_arg): Look through an argument of reference type. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-15 Mark Mitchell + + PR c++/10926 + * decl2.c (grokfield): Robustify. + + PR c++/11116 + * parser.c (cp_parser_throw_expression): Determine whether or not + an assignment-expression is present by doing one-token lookahead. + + PR c++/13269 + * parser.c (cp_parser_function_definition_after_declarator): Stop + scanning tokens when reaching EOF. + + PR c++/12989 + * typeck.c (cxx_sizeof_or_alignof_expr): Robustify. + + PR c++/13310 + * pt.c (dependent_template_p): Handle OVERLOADs. + +2003-12-15 Mark Mitchell + + PR c++/13243 + PR c++/12573 + * parser.c (cp_parser_postfix_expression): Tighten handling of + integral constant expressions. + (cp_parser_unary_expression): Likewise. + * pt.c (value_dependent_expression_p): Remove handling for + COMPONENT_REFs. + +2003-12-15 Nathan Sidwell + + * class.c (add_method): Disallow destructor for java classes. + * decl.c (xref_basetypes): Check java class inheritance. + * decl2.c (check_java_method): Skip artificial params. + + PR c++/13241 + C++ ABI change. Mangling of symbols in expressions. + * mangle.c (write_mangled_name): Add top_level flag. Rework for + nested and unnested mangling. Deal with abi version 1 and version + 2 differences. + (write_expression): Adjust write_mangled_name call. + (mangle_decl_string): Use write_mangled_name for all non-type decls. + +2003-12-14 Mark Mitchell + + PR c++/10779 + PR c++/12160 + * parser.c (struct cp_parser): Add in_template_argument_list_p. + (cp_parser_error): Use c_parse_error. + (cp_parser_name_lookup_error): New function. + (cp_parser_new): Initialize it. + (cp_parser_declarator): Add parenthesized_p parameter. + (cp_parser_nested_name_specifier_opt): Use + cp_parser_name_lookup_error. + (cp_parser_parenthesized_expression_list): Improve comments. + (cp_parser_condition): Adjust call to cp_parser_declarator. + (cp_parser_template_parameter): Adjust call to + cp_parser_parameter_declaration. + (cp_parser_template_argument_list): Set + in_template_argument_list_p. + (cp_parser_explicit_instantiation): Adjust call to + cp_parser_declarator. + (cp_parser_simple_type_specifier): Remove unncessary code. + (cp_parser_using_declaration): Use cp_parser_name_lookup_error. + (cp_parser_init_declarator): Handle member function definitions. + (cp_parser_direct_declarator): Adjust call to + cp_parser_declarator. + (cp_parser_type_id): Adjust call to cp_parser_declarator. + (cp_parser_parameter_declaration_list): Avoid backtracking where + possible. + (cp_parser_parameter_declaration): Add parenthesized_p parameter. + (cp_parser_function_definition): Remove. + (cp_parser_member_declaration): Do not backtrack to look for + function definitions. + (cp_parser_exception_declaration): Adjust call to + cp_parser_declarator. + (cp_parser_single_declaration): Handle function definitions via + cp_parser_init_declarator. + (cp_parser_save_member_function_body): New function. + +2003-12-14 Kriang Lerdsuwanakij + + PR c++/13106 + * decl.c (finish_function): Check if return type is dependent before + issuing no return statement warning. + +2003-12-12 Nathan Sidwell + + PR c++/13118 + * cp-tree.h (lang_decl_u): Add thunk_alias member. + (THUNK_VIRTUAL_OFFSET): Must be a FUNCTION_DECL. + (THUNK_ALIAS_P): Remove. + (THUNK_ALIAS): Adjust. + * class.c (update_vtable_entry_for_fn): Get the vbase within the + overriding function's return type. + (dump_thunk): Adjust THUNK_ALIAS printing. + (build_vtbl_initializer): Adjust THUNK_ALIAS use. + * method.c (make_thunk): Revert 12881 test change. Clear + THUNK_ALIAS. + (finish_thunk): Adjust THUNK_ALIAS setting. + (use_thunk): Adjust THUNK_ALIAS use. + * semantics.c (emit_associated_thunks): Likewise. + + PR c++/13114, c++/13115 + * class.c (layout_empty_base): Propagate the move of an empty base + to offset zero. + + PR c++/12881 + * method.c (make_thunk): Deal with thunk aliases when searching + for a thunk. Robustify assertion. + +2003-12-11 Nathan Sidwell + + * mangle.c (conv_type_names): Holds IDENTIFIER_NODEs only. + (hash_type): Use TYPE_UID of the identifier's type. + (compare_type): Adjust. + (mangle_conv_op_name_for_type): Store identifier nodes only, use + TYPE_UID has hash value. + +2003-12-10 Mark Mitchell + + * cp-tree.h (DECL_CONV_FN_P): Check that DECL_NAME is non-NULL. + +2003-12-08 Matt Austern + + PR c/13134 + * decl.c (duplicate_decls): Copy visibility flag when appropriate. + +2003-12-09 Giovanni Bajo + + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-08 Jason Merrill + + PR c++/11971 + * tree.c (build_local_temp): Split out from build_cplus_new. + (force_target_expr): New fn. + * call.c (call_builtin_trap): Call it. Take a type parm. + (convert_arg_to_ellipsis): Pass it. + (build_x_va_arg): Use call_builtin_trap. + + PR c++/11929 + * call.c (magic_varargs_p): New fn. + (build_over_call): Do no ellipsis conversions for arguments to + functions with magic varargs. + + * name-lookup.c, init.c, except.c: Revert Giovanni's patch from + yesterday. + + Give the anonymous namespace a null DECL_NAME. + * cp-tree.h: Don't declare anonymous_namespace_name. + * decl.c: Don't define it. + * dump.c (cp_dump_tree): Don't check for it. + * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise. + * error.c (dump_decl): Likewise. + * name-lookup.c: Define it here. + (push_namespace): Put it in DECL_ASSEMBLER_NAME instead. + * mangle.c (write_unqualified_name): Adjust. + +2003-12-07 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an + OVERLOAD unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-06 Mark Mitchell + + PR c++/13323 + * class.c (same_signature_p): Handle conversion operators + correctly. + (check_for_override): Likewise. + +2003-12-06 Kelley Cook + + * Make-lang.in (GXX_CROSS_NAME, CXX_CROSS_NAME): Delete. + (c++.install_common, cp/g++.1, c++.install-man): Adjust for above. + (c++.uninstall): Likewise. + +2003-12-05 Danny Smith + Mark Mitchell + + PR c++/13305 + * parser.c (cp_parser_elaborated_type_specifier): Accept + attributes. + +2003-12-05 Mark Mitchell + + PR c++/13314 + * parser.c (cp_parser_class_specifier): Match push_scope/pop_scope + calls. + (cp_parser_class_head): Likewise. + +2003-12-05 Kriang Lerdsuwanakij + + PR c++/13166 + * parser.c (cp_parser_late_parsing_default_args): Make sure the + context is a class before calling push_nested_class and + pop_nested_class. + +2003-12-03 James E Wilson + + * g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS + support. + +2003-12-03 Mark Mitchell + + PR c++/9127 + * cp-tree.h (at_namespace_scope_p): New function. + * parser.c (cp_parser_class_head): Handle invalid explicit + specializations. + * search.c (at_namespace_scope_p): New function. + + PR c++/13179 + * semantics.c (finish_handler_parms): Do not call eh_type_info for + types used in templates. + + PR c++/10771 + * parser.c (cp_parser_check_for_invalid_template_id): New + function. + (cp_parser_simple_type_specifier): Use it. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_class_head): Likewise. + +2003-12-02 Giovanni Bajo + + PR c++/10126 + * pt.c (convert_nontype_argument): Handle default conversions + while converting a pointer to member function. + +2003-12-02 Giovanni Bajo + + PR c++/12573 + * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by + looking into them recursively. + +2003-12-02 Richard Henderson + + * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. + * parser.c (struct cp_token): Likewise. + (struct cp_parser_token_tree_map_node): Likewise. + * lex.c (struct resword): Move const after ENUM_BITFIELD. + +2003-11-30 Mark Mitchell + + PR c++/9849 + * parser.c (cp_lexer_prev_token): New function. + (cp_parser_skip_to_closing_parenthesis): Add consume_paren + parameter. + (cp_parser_nested_name_specifier_opt): Add is_declaration + parameter. + (cp_parser_nested_name_specifier): Likewise. + (cp_parser_class_or_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_id_expression): Adjust calls to + cp_parser_nested_name_specifier_op, cp_parser_template_id, + cp_parser_class_name. + (cp_parser_unqualified_id): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_pseudo_destructor_name): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_mem_initializer_id): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_type_name): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_qualified_namespace_specifier): Likewise. + (cp_parser_using_declaration): Likewise. + (cp_parser_using_directive): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_declarator_id): Likewise. + (cp_parser_class_head): Likewise. + (cp_parser_base_specifier): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + (cp_parser_direct_declarator): Fix typo in comment. + (cp_parser_parenthesized_expression_list): Adjust call to + cp_parser_skip_to_closing_parenthesis. + (cp_parser_selection_statement): Likewise. + +2003-11-23 Kriang Lerdsuwanakij + + PR c++/12924 + * typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR + with OVERLOAD and DECL nodes as the first operand. + +2003-11-22 Kriang Lerdsuwanakij + + * pt.c (tsubst) : Remove erroneous argument to build_nt. + +2003-11-22 Kriang Lerdsuwanakij + + PR c++/5369 + * friend.c (is_friend): Handle member function of a class + template as template friend. + (do_friend): Likewise. + * decl2.c (check_classfn): Add template_header_p parameter. + * decl.c (start_decl): Adjust check_classfn call. + (grokfndecl): Likewise. + * pt.c (is_specialization_of_friend): New function. + (uses_template_parms_level): Likewise. + (push_template_decl_real): Use uses_template_parms_level. + (tsubst_friend_function): Adjust check_classfn call. + * cp-tree.h (check_classfn): Adjust declaration. + (uses_template_parms_level): Add declaration. + (is_specialization_of_friend): Likewise. + +2003-11-21 Mark Mitchell + + PR c++/12515 + * pt.c (build_non_dependent_expr): Handle GNU extension to ?: + operator. + +2003-11-21 Jan Hubicka + + * parser.c (cp_parser_postfix_expression): Initialize 's' to + NULL_TREE. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (c++.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (check-g++, lang_checks): Add. + +2003-11-18 Kriang Lerdsuwanakij + + PR c++/12932 + * class.c (currently_open_derived_class): Check if + current_class_type is NULL_TREE. + * semantics.c (finish_call_expr): Check if + currently_open_derived_class returns NULL_TREE. + * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT + parameter. + +2003-11-17 Jason Merrill + + * init.c (build_new_1): Preevaluate placement args. + * call.c (build_op_delete_call): Don't expose placement args to + overload resolution. + +2003-11-16 Jason Merrill + + * Make-lang.in (c++.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-15 Bernardo Innocenti + + PR c++/2294 + * name-lookup.c: Revert previous patch for PR c++/2294 to prevent + build failure on libjava. + +2003-11-14 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD + unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + +2003-11-14 Mark Mitchell + + PR c++/12762 + * parser.c (cp_parser_enclosed_template_argument_list): New + function. + (cp_parser_template_id): Use it. + (cp_parser_simple_type_specifier): Recognize invalid template + syntax. + +2003-11-14 Giovanni Bajo + + PR c++/2094 + * pt.c (unify): Add support for PTRMEM_CST and + FIELD_DECL unification. + +2003-11-13 Richard Earnshaw + + * decl.c (grokfndecl): Change OK to type tree. + +2003-11-12 Mark Mitchell + + * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like + CONSTRUCTOR. + + * decl.c (cp_make_fname_decl): When creating a top-level + __FUNCTION__-like symbol, do register it with pushdecl. + + * decl.c (finish_case_label): Do not check that we are within a + switch statement here. + * parser.c (struct cp_parser): Add in_iteration_statement_p and + in_switch_statement_p. + (cp_parser_new): Initialize them. + (cp_parser_labeled_statement): Check validity of case labels + here. + (cp_parser_selection_statement): Set in_switch_statement_p. + (cp_parser_iteration_statement): Set in_iteration_statement_p. + (cp_parser_jump_statement): Check validity of break/continue + statements here. + + PR c++/12735 + * cp-tree.h (duplicate_decls): Return a tree. + * decl.c (duplicate_decls): Clarify documentation. Return + error_mark_node to indicate a failed redeclaration. + * friend.c (do_friend): Handle that case. + * name-lookup.c (pushdecl): Likewise. + +2003-11-11 Jason Merrill + + * cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro. + * name-lookup.c (parse_using_directive): New fn. + (is_associated_namespace): New fn. + (arg_assoc_namespace): Also check associated namespaces. + * name-lookup.h: Declare new fns. + * pt.c (maybe_process_partial_specialization): Allow + specialization in associated namespace. + * parser.c (cp_parser_using_directive): Accept attributes. Use + parse_using_directive. + +2003-11-10 Richard Henderson + + * cvt.c (convert_to_void): Use void_zero_node after overload failure. + +2003-11-10 Gabriel Dos Reis + + PR c++/12832 + * name-lookup.c (supplement_binding): Gracefully handle names + used at non-class scope prior declaration. + +2003-11-06 Matt Austern + + * decl.c (duplicate_decls): copy DECL_VISIBILITY field. + * method.c (use_thunk): give thunk same visibility as function. + * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/11616 + * pt.c (instantiate_pending_templates): Save and restore + input_location. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/2019 + * friend.c (add_friend): Don't display previous declaration in + case of duplicate friend warning. + +2003-11-02 Kriang Lerdsuwanakij + + PR c++/9810 + * call.c (build_over_call): Check access using primary template + if FN is a member function template. + +2003-11-01 Kriang Lerdsuwanakij + + PR c++/12796 + * class.c (handle_using_decl): Set input_location before calling + error_not_base_type. + +2003-10-26 Kriang Lerdsuwanakij + + PR c++/10371 + * semantics.c (finish_non_static_data_member): Handle when + both processing_template_decl and qualifying_scope are true. + +2003-10-24 Kriang Lerdsuwanakij + + PR c++/11076 + * class.c (handle_using_decl): Swap arguments of error_not_base_type. + * parser.c (cp_parser_direct_declarator): Only resolve typename for + namespace scope declarations. + +2003-10-24 Nathan Sidwell + + PR c++/12698, c++/12699, c++/12700, c++/12566 + * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. + (debug_class, debug_thunks): New. + * class.c (dump_class_hierarchy_1): New break out from ... + (dump_class_hierarchy): ... here. + (dump_thunk, debug_thunks, debug_class): New. + (update_vtable_entry_for_fn): Add ssizetype casts. Correct + continued search for primary binfo via virtual. + (build_vtbl_initializer): Follow covariant thunk alias. + * method.c (make_thunk): Clear DECL_THUNKS of the thunk. + (finish_thunk): Look for an alias of the covariant thunk and point + to it. + (use_thunk): We should never use an alias. + * semantics.c (emit_associated_thunks): Do not emit aliases. + + PR c++/12566 + * cp-tree.h (cp_fname_init): Add TYPE pointer param. + * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't + create an ad-hoc ERROR_MARK. + (cp_make_fname_decl): Adjust. + * pt.c (tsubst_expr): Adjust. + +2003-10-23 Jason Merrill + + PR c++/12726 + * tree.c (build_target_expr_with_type): Don't call force_rvalue + for CONSTRUCTORs. + +2003-10-22 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cxx-pretty-print.c: Likewise. + * init.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-10-21 Mark Mitchell + + PR c++/11962 + * typeck.c (build_x_conditional_expr): Handle missing middle + operands in templates. + * mangle.c (write_expression): Issue errors about attempts to + mangle a non-existant middle operator to the ?: operator. + +2003-10-21 Robert Bowdidge + + * decl.c (cp_finish_decl): Remove clause intended for asm directives + in struct or class fields: this code is never executed. + +2003-10-22 Kriang Lerdsuwanakij + + * decl.c (start_decl): Exit if push_template_decl returns + error_mark_node. + +2003-10-20 Kazu Hirata + + * ChangeLog: Fix typos. + * call.c: Fix comment typos. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * init.c: Likewise. + * mangle.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2003-10-20 Jan Hubicka + + * decl.c (start_cleanup_fn): Set DECL_DECLARED_INLINE_P to deffer + the expansion. + +2003-10-20 Mark Mitchell + + * Make-lang.in (c++.install-info): Remove. + +2003-10-20 Jason Merrill + + * class.c (layout_class_type): Set DECL_ARTIFICIAL on padding + field. + +2003-10-20 Kriang Lerdsuwanakij + + PR c++/9781, c++/10583, c++/11862 + * decl.c (cp_finish_decl): Exit immediately if decl is an + error_mark_node. + * pt.c (push_template_decl_real): Return error_mark_node for + invalid template declaration of variable. + +2003-10-18 Kriang Lerdsuwanakij + + PR c++/12495 + * pt.c (lookup_template_class): Handle when current_class_type + is a local class. + +2003-10-17 Kriang Lerdsuwanakij + + PR c++/2513 + * decl.c (make_typename_type): Use dependent_type_p. + (make_unbound_class_template): Likewise. + * pt.c (instantiate_class_template): Increment + processing_template_decl during substitution of template friend + function. Preincrement processing_template_decl rather than + postincrement. + (get_mostly_instantiated_function_type): Increment + processing_template_decl during partial substitution of function + type. + +2003-10-15 Jan Hubicka + + PR c++/12574 + * decl2.c (cxx_callgraph_analyze_expr): Deal with baselink. + +2003-10-14 Jason Merrill + + PR c++/11878 + * tree.c (build_target_expr_with_type): Call force_rvalue for + classes with non-trivial copy ctors. + + PR c++/11063 + * typeck.c (build_modify_expr): Call convert rather than abort. + +2003-10-14 Gabriel Dos Reis + + Breack out decl.c (3/n) + * name-lookup.c: Include flags.h + (lookup_name_current_level): Make static. + (add_decl_to_level): Likewise. + (push_local_binding): Likewise. + (push_overloaded_decl): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (lookup_type_current_level): Likewise. + (unqualified_namespace_lookup): Likewise. + (namespace_ancestor): Likewise. + (push_using_directive): Likewise. + * decl.c (pushdecl): Move to name-lookup.c. + (pushdecl_top_level_1): Likewise. + (pushdecl_top_level): Likewise. + (pushdecl_top_level_and_finish): Likewise. + (maybe_push_decl): Likewise. + (push_using_decl): Likewise. + (push_overloaded_decl): Likewise. + (make_anon_name): Likewise. + (anon_cnt): Likewise. + (clear_anon_tags): Likewise. + (maybe_inject_for_scope_var): Likewise. + (check_for_out_of_scope_variable): Likewise. + * Make-lang.in (cp/name-lookup.o): Depend on flags.h. + * decl.c (warn_extern_redeclared_static): Export. + * cp-tree.h (warn_extern_redeclared_static): Declare. + +2003-10-14 Nathanael Nerode + + * Make-lang.in: Replace uses of $(target_alias) with + $(target_noncanonical). + +2003-10-13 Volker Reichelt + + * ChangeLog: Add PR number to patch for PR c++/12370. + +2003-10-13 Gabriel Dos Reis + + * name-lookup.h (cxx_scope_find_binding_for_name): Don't export. + (binding_for_name): Likewise. + (cxx_binding_clear): Move to name-lookup.c. + * name-lookup.c (cxx_scope_find_binding_for_name): Now static. + (binding_for_name): Likewise. + * decl2.c (is_ancestor): Move to name-lookup.c + (namespace_ancestor): Likewise. + (add_using_namespace): Likewise. + (ambiguous_decl): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (set_decl_namespace): Likewise. + (decl_namespace): Likewise. + (current_decl_namespace): Likewise. + (push_decl_namespace): Likewise. + (pop_decl_namespace): Likewise. + (push_scope): Likewise. + (pop_scope): Likewise. + (struct arg_lookup): Likewise. + (arg_assoc): Likewise. + (arg_assoc_args): Likewise. + (arg_assoc_type): Likewise. + (add_function): Likewise. + (arg_assoc_namespace): Likewise. + (arg_assoc_class): Likewise. + (arg_assoc_template_arg): Likewise. + (do_namespace_alias): Likewise. + (validate_nonmember_using_decl): Likewise. + (do_nonmember_using_decl): Likewise. + (do_toplevel_using_decl): Likewise. + (do_local_using_decl): Likewise. + (do_class_using_decl): Likewise. + (do_using_directive): Likewise. + (constructor_name_full): Likewise. + (constructor_name): Likewise. + (constructor_name_p): Likewise. + +2003-10-13 Gabriel Dos Reis + + Break out decl.c (2/n) + * name-lookup.c: Include diagnostic.h + (cxx_binding_free): Make static. + (cxx_binding_make): Likewise. + (binding_table_new): Likewise + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (supplement_binding): Likewise. + * name-lookup.h (global_scope_name): Declare extern. + (global_type_node): Likewise. + (cxx_binding_free): Don't export. + (cxx_binding_make): Likewise. + (binding_table_new): Likewise. + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) + * decl.c (lookup_namespace_name): Move to name-lookup.c + (select_decl): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Likewise. + (lookup_name_real): Likewise. + (lookup_name_nonclass): Likewise. + (lookup_function_nonclass): Likewise. + (lookup_name): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (lookup_flags): Likewise. + (qualify_lookup): Likewise. + (lookup_tag): Likewise. + (lookup_tag_reverse): Likewise. + (getdecls): Likewise. + (storedecls): Remove. + (cxx_remember_type_decls): Move to name-lookup.c. + (global_bindings_p): Likewise. + (innermost_nonclass_level): Likewise. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (kept_level_p): Likewise. + (innermost_scope_kind): Likewise. + (template_parm_scope_p): Likewise. + (push_binding): Likewise. + (push_local_binding): Likewise. + (add_decl_to_level): Likewise. Make extern. + (push_class_binding): Move to name-lookup.c. + (resume_level): Likewise. Rename to resume_scope. + (begin_scope): Move to name-lookup.c. + (indent): Likewise. + (binding_depth): Likewise. + (is_class_level): Likewise. + (cxx_scope_descriptor): Likewise. + (cxx_scope_debug): Likewise. + (namespace_scope_ht_size): Likewise. + (leave_scope): Likewise. + (pushlevel_class): Likewise. + (poplevel_class): Likewise. + (clear_identifier_class_values): Likewise. + (pushdecl_with_scope): Likewise. + (pushdecl_namespace_level): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_using_directive): Likewise. + (identifier_global_value): Likewise. + (keep_next_level_flag): Likewise. + (keep_next_level): Likewise. + (free_binding_level): Likewise. + (set_class_shadows): Likewise. + (maybe_push_cleanup_level): Likewise. + (cp_namespace_decls): Likewise. + (bt_print_entry): Likewise. + (print_binding_level): Likewise. + (print_other_binding_stack): Likewise. + (print_binding_stack): Likewise. + (push_namespace): Likewise. + (pop_namespace): Likewise. + (push_nested_namespace): Likewise. + (pop_nested_namespace): Likewise. + (cxx_saved_binding_make): Likewise. + (struct cxx_saved_binding_make): Likewise. + (store_bindings): Likewise. + (maybe_push_to_top_level): Likewise. + (push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (identifier_type_value): Likewise. + (set_identifier_type_value): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (pop_everything): Likewise. + (pushtag): Likewise. + (follow_tag_typedef): Likewise. + (maybe_process_template_type_declaration): Likewise. + (pop_binding): Likewise. + * cp-tree.h: Move corresponding declarations to name-lookup.h + +2003-10-12 Steven Bosscher + + * cvt.c (ocp_convert): Move warning to C common code. + +2003-10-09 Jason Merrill + + PR c++/6392 + * tree.c (build_cplus_array_type): Handle all quals the same. + (cp_build_qualified_type_real): Look through arrays first. + + * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL. + (build_target_expr_with_type): Likewise. + + * pt.c (instantiate_class_template): Sanity check that our + enclosing class has been instantiated. + +2003-10-08 Giovanni Bajo + + * cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS. + * error.c (dump_function_decl): Use it to skip the dump of the + arguments. + (dump_expr): When dumping a declaration found within an + expression, always set TFF_NO_FUNCTION_ARGUMENTS + in the flags. + +2003-10-08 Giovanni Bajo + + PR c++/11097 + * pt.c (tsubst_decl): Substitute also the DECL_NAME node of + USING_DECL. + +2003-10-06 Mark Mitchell + + PR c++/10147 + * call.c (initialize_reference): Tweak error message. + * cxx-pretty-print.h (cxx_pretty_printer_flags): Remove + pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope. + * cxx-pretty-print.c (pp_cxx_id_expression): Always display + qualified entities using qualified names. + + PR c++/12337 + * init.c (build_new_1): Make sure that the expression returned is + not an lvalue. + + PR c++/12344, c++/12236, c++/8656 + * decl.c (start_function): Do not ignore attributes embedded in a + function declarator. + +2003-10-06 Mark Mitchell + + * Make-lang.in (c++.info): Remove. + (c++.dvi): Remove. + (c++.generated-manpages): Replace with ... + (generated-manpages): ... this. + +2003-10-03 Gabriel Dos Reis + + * decl.c (struct cp_binding_level): Move to name-lookup.h + (current_binding_level): Likewise. + (class_binding_level): Likewise. + * cp-tree.h (enum scope_kind): Likewise. + +2003-10-03 Gabriel Dos Reis + + * name-lookup.c (binding_entry_free): Nullify name and type + fields. + +2003-10-02 Mark Mitchell + + PR c++/12486 + * typeck.c (finish_class_member_access_expr): Issue diagnostic + on erroneous use of qualified name. + +2003-09-30 Richard Henderson + + PR c++/12370 + * decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too. + +2003-09-30 Kelley Cook + + * g++spec.c: Convert to ISO C90 prototypes. + * parser.c: Likewise. + +2003-09-30 Gabriel Dos Reis + + * decl.c (pop_binding): Don't mess with nullifying binding->scope + here. + * name-lookup.c: Re-format. + (cxx_binding_free): Nullify binding->scope. + +2003-09-29 Jan Hubicka + + PR C++/12047 + * except.c (build_eh_type_type): Call mark_used on the type. + +2003-09-28 Richard Henderson + + * typeck.c (c_expand_asm_operands): Take location_t, instead of + individual file and line. + +2003-09-28 Andreas Jaeger + + * decl.c (cxx_builtin_type_decls): Convert to ISO C90 function + definition. + * init.c (push_base_cleanups): Likewise. + * decl2.c (finish_file): Likewise. + * mangle.c (init_mangle): Likewise. + (dump_substitution_candidates): Likewise. + * search.c: Likewise. + +2003-09-27 Gabriel Dos Reis + + * name-lookup.h (get_global_value_if_present): New function. + (is_typename_at_global_scope): Likewise. + * except.c (do_begin_catch): Use get_global_value_if_present. + (do_end_catch): Likewise. + (do_allocate_exception): Likewise. + (do_free_exception): Likewise. + (build_throw): Likewise. + * parser.c (cp_parser_member_declaration): Likewise. + * rtti.c (throw_bad_cast): Likewise. + (throw_bad_typeid): Likewise. + * decl.c (check_tag_decl): Use is_typename_at_global_scope. + (grokdeclarator): Likewise. + * cp-tree.h (global_namespace): Move to name-lookup.h + * call.c (call_builtin_trap): Tidy. + +2003-09-27 Kriang Lerdsuwanakij + + PR c++/11415 + * parser.c (cp_parser_nested_name_specifier_opt): Issue correct + error message when parser->scope is global_namespace. + +2003-09-27 Gabriel Dos Reis + + * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to + macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. + +2003-09-26 Gabriel Dos Reis + + * decl.c (pop_binding_level, suspend_binding_level, + find_class_binding_level): Merge into leave_scope. Remove. + (leave_scope): New function. + (poplevel): Update. + (poplevel_class): Likewise. + (pop_namespace): Likewise. + +2003-09-25 Kriang Lerdsuwanakij + + PR c++/5655 + * parser.c (cp_parser_check_access_in_redeclaration): New function. + (cp_parser_member_declaration): Use it. + (cp_parser_template_declaration_after_export): Likewise. + +2003-09-22 Gabriel Dos Reis + + * cp-tree.h (scope_kind): Add new enumerator. + (keep_next_level): Change parameter type to bool. + (begin_scope): Change prototype. + (pushlevel): Remove declaration. + * decl.c (push_binding_level): Fold in begin_scope. Remove. + (struct cp_binding_level): Remove tag_tranparent field. Make keep + of bitsize one. + (keep_next_level_flag): Make a bool. + (cxx_scope_descriptor): Update scope names table + (make_cxx_scope): Fold in begin_scope. Remove.. + (namespace_scope_ht_size): New function. + (begin_scope): Change prototype. Return a scope. Tidy. + (kept_level_p): Update. + (pushlevel): Remove. + (maybe_push_cleanup_level): Simplify. + (poplevel): Update for sk_cleanup and keep change. + (print_binding_level): Likewise. + (initial_push_namespace_scope): Fold in begin_scope. Remove. + (push_namespace): Update. + (pushtag): Likewise. + (lookup_tag): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (cxx_init_decl_processing): Likewise. + (start_function): Likewise. + (begin_function_body): Likewise. + (start_method): Likewise. + * pt.c (push_inline_template_parms_recursive): Likewise. + (begin_template_parm_list): Likewise. + (begin_specialization): Likewise. + * semantics.c (do_pushlevel): Likewise. + (begin_compound_stmt): Likewise. + (begin_stmt_expr): Likewise. + +2003-09-21 Richard Henderson + + * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, + method.c, optimize.c, pt.c, semantics.c, tree.c: Revert. + +2003-09-21 Richard Henderson + + * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, + method.c, optimize.c, pt.c, semantics.c, tree.c: Update for + DECL_SOURCE_LOCATION rename and change to const. + +2003-09-20 Richard Henderson + + * decl.c, decl2.c, pt.c: Use %J in diagnostics. + +2003-09-20 Kriang Lerdsuwanakij + + PR c++/157 + * parser.c (cp_parser_direct_declarator): Clear + parser->num_template_parameter_lists when parsing function + parameters. + (cp_parser_constructor_declarator_p): Likewise. + +2003-09-19 Kriang Lerdsuwanakij + + PR c++/495 + * pt.c (tsubst_friend_class): Only use innermost template + arguments for the injected friend class template. + +2003-09-19 Nathan Sidwell + + PR c++/12332 + * pt.c (instantiate_class_template): Increment + processing_template_decl around the tsubst of a template member + function. + +2003-09-19 Gabriel Dos Reis + + * decl.c (cxx_scope_descriptor): Fix thinko. + (struct cp_binding_level): Adjust type of binding_depth field. + +2003-09-18 Danny Smith + + PR c++/12320 + * call.c (type_passed_as): Check for incomplete type. + (convert_for_arg_passing): Likewise. + +2003-09-18 Nathan Sidwell + + PR c++/9848 + * optimize.c (maybe_clone_body): Don't set MARK_USED on parameters + here. + * semantics.c (expand_body): Set it here on the remaining clones. + +2003-09-18 Roger Sayle + + * lex.c (init_operators): Remove operator_name_info for FFS_EXPR. + * class.c (instantiate_type): Remove FFS_EXPR case. + +2003-09-18 Volker Reichelt + + * ChangeLog: Fix recent commit. + +2003-09-18 Volker Reichelt + + * ChangeLog: Add PR number to patch for PR c++/12316. + +2003-09-18 Gabriel Dos Reis + + * error.c (dump_type): Simplify. Use pp_type_specifier_seq for + "C" types. + * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko. + +2003-09-17 Richard Henderson + + * semantics.c (expand_body): Don't save/restore input_location. + +2003-09-17 Mark Mitchell + + PR c++/12266 + * cp-tree.h (tsubst_flags_t): Add tf_conv. + * class.c (standard_conversion): Pass tf_conv to + instantiate_type. + (resolve_address_of_overloaded_function): Do not call mark_used + when just checking conversions. + + PR debug/12066 + * cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define. + * cp-tree.h (cxx_builtin_type_decls): Declare. + * decl.c (builtin_type_decls): New variables. + (cxx_builtin_type_decls): New function. + (record_builtin_type): Add to builtin_type_decls. + +2003-09-17 Richard Henderson + + PR c++/12316 + * semantics.c (expand_or_defer_fn): Inc/dec function_depth. + +2003-09-16 Kriang Lerdsuwanakij + + PR c++/7939 + * typeck.c (comptypes): Don't ICE when its first argument is + error_mark_node. + (compparms): Reverse the arguments of same_type_p. + +2003-09-15 Nathan Sidwell + + PR c++/12184 + * typeck.c (convert_arguments): Return error_mark_node for an + incomplete parameter. Make error message more informative. + +2003-09-12 Mark Mitchell + + PR c++/3907 + * class.c (maybe_note_name_used_in_class): Refine test for whether + or not we are in a class scope. + + * cp-tree.h (language_function): Remove x_expanding_p. + (expanding_p): Remove. + (doing_semantic_analysis_p): Remove. + (scope_kind): Add sk_function_parms, sk_class, + sk_namespace. + (innermost_scope_kind): New method. + * call.c (cxx_type_promotes_to): Use type_decays_to. + * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine. + (LANG_HOOKS_POPLEVEL): Likewise. + * decl.c (cp_binding_level): Remove parm_flag, template_parms_p, + template_spec_p, namespace_p, is_for_scope, is_try_scope, and + is_catch_scope. Add kind and explicit_spec_p. + (cxx_scope_descriptor): Use a lookup table. + (find_class_binding_level): Use "kind" field in binding_level, not + the various flags. + (pop_binding_level): Likewise. + (innermost_nonclass_level): Likewise. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (template_parm_scope_p): Likewise. + (innermost_scope_kind): New method. + (current_tmpl_spec_kind): Use "kind" field in binding_level, not + the various flags. + (pushlevel): Remove check for doing_semantic_analysis_p. + (begin_scope): Simplify. + (add_decl_to_level): Use "kind" field in binding_level, not + the various flags. + (push_local_binding): Likewise. + (pop_label): Remove check for doing_semantic_analysis_p. + (poplevel): Use "kind" field in binding_level, not + the various flags. + (set_block): Remove check for doing_semantic_analysis_p. + (pushlevel_class): Use "kind" field in binding_level, not + the various flags. + (poplevel_class): Likewise. + (initial_push_namespace_scope): Likewise. + (maybe_push_to_top_level): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (pop_everything): Likewise. + (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + (pushdecl): Likewise. + (pushdecl_with_scope): Likewise. + (check_previous_goto_1): Likewise. + (define_label): Likewise. + (finish_case_label): Likewise. + (lookup_tag): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (record_builtin_type): Likewise. + (cp_make_fname_decl): Likewise. + (maybe_inject_for_scope_var): Likewise. + (cp_finish_decl): Remove check for doing_semantic_analysis_p. + (start_function): Use begin_scope, not pushlevel. + (finish_function): Use "kind" field in binding_level, not + the various flags. + (start_method): Use begin_scope, not pushlevel. + (make_label_decl): Do not check expanding_p. + (save_function-data): Do not set expanding_p. + (cxx_push_function_context): Do not clear expanding_p. + * semantics.c (cxx_expand_function_start): Do not set expanding_p. + +2003-09-14 Mark Mitchell + + * class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for + an bit-field whose width exceeds that of its type. + +2003-09-14 Geoffrey Keating + + * rtti.c (get_tinfo_decl): Set TREE_PUBLIC for typeinfo decls. + +2003-09-14 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * parser.c: Likewise. + +2003-09-13 Richard Henderson + + * decl2.c (finish_file): Check cgraph_assemble_pending_functions + during relaxation loop. + +2003-09-11 David Edelsohn + + * decl2.c (var_finalized_p): Swap arms of conditional. + +2003-09-10 Nathan Sidwell + + PR c++/11788 + * typeck.c (build_address): If it is a function, mark it used. + (build_unary_op): Do not lose object's side-effects when taking + address of static member function. + * class.c (resolve_address_of_overloaded_function): Use + tsubst_flags_t parameter. Only expect overload sets. Adjust. + (instantiate_type): Adjust flags passing. Do not lose object's + side-effects when taking address of static member function. + +2003-09-11 Richard Henderson + + * semantics.c (expand_or_defer_fn): Update for new + cgraph_finalize_function argument. + +2003-09-10 Richard Henderson + + * decl2.c (cxx_callgraph_analyze_expr): Mark argument unused. + +2003-09-10 Jan Hubicka + + * decl2.c (var_finalized_p): New. + (maybe_emit_vtables, write_out_vars, finish_file): Use it. + +2003-09-10 Richard Henderson + + * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of + mark_member_pointers. + (lower_function): Remove. + * cp-tree.h: Update to match. + * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New. + (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove. + +2003-09-09 Richard Henderson + + * semantics.c (expand_or_defer_fn): Update call to + cgraph_finalize_function. + + * semantics.c (expand_or_defer_fn): Use cgraph_finalize_function + always. + + * decl2.c (finish_file): Avoid out-of-bounds array reference + during memmove. + +2003-09-09 Richard Henderson + + * decl2.c (mark_member_pointers): Rename from + mark_member_pointers_and_eh_handlers and don't check eh handlers. + +2003-09-09 Christian Ehrhardt + + PR bootstrap/12168 + * method.c (use_thunk): Clear DECL_RTL of copied nodes. + +2003-09-08 Mark Mitchell + + * cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to + c_register_builtin_type. + + PR c++/11786 + * decl2.c (add_function): Do not complain about seeing the same + non-function twice. + * semantics.c (perform_koenig_lookup): Improve documentation. + + PR c++/5296 + * pt.c (try_one_overload): Add addr_p parameter. + (resolve_overloaded_unification): Pass it. + +2003-09-08 Richard Henderson + + * optimize.c (maybe_clone_body): Inc/dec function_depth. + +2003-09-08 Richard Henderson + + * decl.c (finish_function): Clear current_function_decl. + * decl2.c (mark_used): Don't push/pop gc context. + * optimize.c (optimize_function): Likewise. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + * pt.c (instantiate_decl): Inc/dec function_depth instead. + * semantics.c (expand_body): Update for tree_rest_of_compilation + nested argument. + +2003-09-07 Gabriel Dos Reis + + PR c++/11762 + * error.c (dump_decl): Handle namespace-alias-definition. + * decl.c (warn_extern_redeclared_static): There is no point in + checking changes in storage class specifier for a namespace + declaration. + (duplicate_decls): Tidy diagnostic message. + * cxx-pretty-print.c (pp_cxx_left_brace): New macro. + (pp_cxx_right_brace): Likewise. + (pp_cxx_original_namespace_definition): New function. + (pp_cxx_namespace_alias_definition): Likewise. + (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. + +2003-09-07 Jan Hubicka + + * decl2.c (maybe_emit_vtables, write_out_vars, finish_file): + Avoid re-emitting variables in unit-at-a-time mode. + +2003-09-06 Mark Mitchell + + PR c++/11867 + * call.c (standard_conversion): Improve comments. + (perform_direct_initialization): Make sure we return an expression + of the correct type. + * typeck.c (build_static_cast): Check for ambiguity and + accessibility when performing conversions. + +2003-09-06 Gabriel Dos Reis + + * cp-tree.h (add_binding): Remove declaration. + * name-lookup.h (supplement_binding): Declare. + * decl.c (add_binding): Move to name-lookup.c. + (push_local_binding): Adjust. + (push_class_binding): Likewise. + (set_identifier_type_value_with_scope): Likewise. + * name-lookup.c (supplement_binding): Rename from add_binding. + Return a bool. Improve documentation. + (set_namespace_binding): Adjust. + * Make-lang.in (cp/name-lookup.o): Depend on toplev.h + +2003-09-06 Nathan Sidwell + + PR c++/11794 + * class.c (pushclass): Push dependent using decls for nested + classes of templates too. + +2003-09-06 Roger Sayle + + PR c++/11409 + * class.c (resolve_address_of_overloaded_function): When building + list of matching non-template function decls, ignore anticipated + declarations of undeclared or shadowed GCC builtins. + +2003-09-06 Steven Bosscher + + PR c++/11595 + * decl.c (define_label): Remove unreachable timevar pop. + Always return the decl, even if the definition is invalid. + +2003-09-06 Nathan Sidwell + + PR c++/12167 + * parser.c (cp_parser_late_parsing_default_args): Push & pop the + unparsed functions queue. + +2003-09-05 Mark Mitchell + + PR c++/12163 + * call.c (perform_direct_initialization): Correct logic for + direct-initialization of a class type. + + PR c++/12146 + * pt.c (lookup_template_function): Robustify. + +2003-09-05 Nathan Sidwell + + PR c++/11922 + * pt.c (tsubst_qualified_id): Make sure we get a non-type. + (tsubst_expr, tsubst_copy_and_build): Pass false, not zero, as + is_type_p to lookup_qualified_name. + + * semantics.c (finish_call_expr): Refactor some code. + + PR c++/12037 + * cp-tree.h (COMPOUND_EXPR_OVERLOADED): New. + (build_min_non_dep): Declare. + * tree.c (build_min): Propagate TREE_SIDE_EFFECTS. + (build_min_non_dep): New. + * cvt.c (convert_to_void): Don't explicitly copy + TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING. + * call.c (build_new_method_call): Use build_min_non_dep. + * decl2.c (grok_array_decl): Likewise. + (build_offset_ref_call_from_tree): Likewise. + * typeck.c (finish_class_member_access_expr, + build_x_indirect_ref, build_x_binary_op, build_x_unary_op, + build_x_conditional_expr, build_x_compound_expr): Likewise. + (build_static_cast, build_reinterpret_cast, + build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template. + * typeck2.c (build_x_arrow): Use build_min_non_dep. + (build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a + template. + * rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE. + (build_dynamic_cast): Set TREE_SIDE_EFFECTS. + * pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED. + +2003-09-04 Richard Henderson + + * decl2.c (mark_member_pointers_and_eh_handlers): Update for + change in cgraph_mark_needed_node arguments. + +2003-09-02 Geoffrey Keating + + PR 12161 + * decl2.c (mark_used): Use ggc_push_context/ggc_pop_context. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + +2003-09-04 Nathan Sidwell + + * cp-tree.h (finish_sizeof, finish_alignof): Remove. + (expr_sizeof): Replace with ... + (cxx_sizeof_or_alignof_expr): ... here. + (cxx_sizeof_or_alignof_type): Make complain parameter a bool. + * parser.c (cp_parser_unary_expression): Commonize alignof and + sizeof handling. + * pt.c (tsubst_copy_and_build): Adjust alignof and sizeof + substitution. + * semantics.c (finish_sizeof, finish_alignof): Remove. + * typeck.c (cxx_sizeof_or_alignof_type): Complain parameter + becomes bool. Set TREE_READONLY. + (expr_sizeof): Replace with ... + (cxx_sizeof_or_alignof_expr): ... here. Clear TREE_SIDE_EFFECTS. + +2003-09-04 Mark Mitchell + + Remove cast-as-lvalue extension. + * call.c (build_conditional_expr): Correct formatting. + (convert_like_real): Use lvalue_p, not non_cast_lvalue_p. + (initialize_real): Use real_lvalue_p, not real_non_cast_lvalue_p. + * cp-tree.h (non_cast_lvalue_p): Remove. + (real_non_cast_lvalue_p): Remove. + (non_cast_lvalue_or_else): Remove. + * tree.c (lvalue_p_1): Remove allow_cast_as_lvalue parameter. + (real_lvalue_p): Adjust call to lvalue_p_1. + (non_cast_lvalue_p): Remove. + (non_cast_lvalue_or_else): Remove. + (lvalue_p): Adjust call to lvalue_p_1. + (lvalue_or_else): Simplify. + * typeck.c (build_unary_op): Use lvalue_or_else, not + non_cast_lvalue_or_else. + (build_static_cast): Use real_lvalue_p, not real_non_cast_lvalue_p. + +2003-09-03 DJ Delorie + + * decl.c (finish_function): Pass fndecl to aggregate_value_p. + +2003-09-03 Mark Mitchell + + PR c++/12053 + * class.c (include_empty_classes): Correct logic for ABI version 1. + +2003-09-03 Richard Henderson + + * optimize.c (optimize_function): Push/pop ggc context around + the call to optimize_inline_calls. + +2003-09-02 Scott Brumbaugh + + PR c++/11553 + * parser.c (cp_parser_decl_specifier_seq): Add check for a + duplicate friend decl-specifier. + +2003-09-02 Mark Mitchell + + PR c++/11847 + * pt.c (convert_nontype_argument): Correct representation of + REFERENCE_TYPE expressions. + + PR c++/11808 + * cp-tree.h (KOENIG_LOOKUP_P): New macro. + (finish_call_expr): Change prototype. + * parser.c (cp_parser_postfix_expression): Adjust call to + finish_call_expr. + * pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P. + * semantics.c (finish_call_expr): Add koenig_p parameter. + +2003-09-01 Mark Mitchell + + PR c++/12114 + * cp-tree.h (initialize_reference): Change prototype. + * call.c (initialize_reference): Add cleanup parameter. + * decl.c (grok_reference_init): Likewise. + (check_initializer): Likewise. + (cp_finish_decl): Insert a CLEANUP_STMT if necessary. + (duplicate_decls): When replacing an anticipated builtin, do not + honor TREE_NOTHROW. + * typeck.c (convert_for_initialization): Correct call to + initialize_reference. + + PR c++/11972 + * pt.c (dependent_type_p_r): Pass only the innermost template + arguments to any_dependent_template_arguments_p. + +2003-09-01 Josef Zlomek + + * error.c (dump_expr): Kill BIT_ANDTC_EXPR. + * lex.c (init_operators): Kill BIT_ANDTC_EXPR. + * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR. + * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. + (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR. + +2003-08-29 Mark Mitchell + + PR c++/12093 + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for a STRING_CST. + + PR c++/11928 + * search.c (add_conversions): Avoid adding two conversion + operators for the same type. + +2003-08-29 Mark Mitchell + + PR c++/6196 + * pt.c (tsubst_copy_and_build): Correct handling of + address-of-label extension. + * semantics.c (finish_goto_stmt): The address of a label must go + through the lvalue-to-rvalue conversion. + +2003-08-29 Richard Henderson + Jason Merrill + + * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New. + (LANG_HOOKS_RTL_EXPAND_STMT): New. + * cp-tree.h (cxx_expand_function_start): Declare. + * decl.c (start_function): Use allocate_struct_function. + Move stmts_are_full_exprs_p assertion from expand_body. + Do not free_after_parsing or free_after_compilation. + (cxx_push_function_context): Move code to set struct function + data from genrtl_start_function. + * optimize.c (optimize_function): Don't inc/dec function_depth. + * semantics.c (expand_body): Use tree_rest_of_compilation. + (cxx_expand_function_start): Rename from genrtl_start_function, + omit bits done by tree_rest_of_compilation. + (genrtl_finish_function): Remove. + (clear_decl_rtl): Move to ../tree-optimize.c. + +2003-08-29 Gabriel Dos Reis + + PR c++/11811 + * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New + function. + * cxx-pretty-print.h: Declare. + * error.c (dump_template_parameter): Use it. + (dump_type): Likewise. + +2003-08-28 Mark Mitchell + + * init.c (decl_constant_value): Deal with COND_EXPR specially. + * call.c (build_conditional_expr): Revert previous patch. + + PR optimization/5079 + * call.c (build_conditional_expr): Use decl_constant_value to + simplify the arguments. + +2003-08-26 Dan Nicolaescu + + * parser.c (struct cp_token): Use enum bitfields. + (CP_TOKEN_BLOCK_NUM_TOKENS): Make sure cp_token_block fits in a + 512B allocation unit. + (cp_parser_token_tree_map_node): Use enum bitfields. + +2003-08-26 Nathan Sidwell + + PR c++/11871 + * decl.c (push_class_level_binding): Correct old_decl value from + my 2003-07-29 reorganization. + + * call.c (build_call): Don't set TREE_SIDE_EFFECTS here. + (build_new_method_call): Add goto finish. + * semantics.c (simplify_aggr_init_exprs_r): Don't set + TREE_SIDE_EFFECTS on a call. + +2003-08-25 Richard Henderson + + * cxx-pretty-print.c (pp_cxx_class_name): Remove unused function. + +2003-08-25 Gabriel Dos Reis + + * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. + (cxx_pretty_printer): Adjust base type. + (pp_cxx_function_specifier): Declare. + * cxx-pretty-print.c (pp_cxx_whitespace): New macro. + (pp_cxx_left_paren): Likewise. + (pp_cxx_right_paren): Likewise. + (pp_cxx_dot): Likewise. + (pp_cxx_arrow): Likewise. + (pp_cxx_semicolon): Likewise. + (pp_cxx_identifier): Likewise. + (pp_cxx_cv_qualifier_seq): Likewise. + (pp_cxx_storage_class_specifier): Likewise. + (pp_cxx_expression_list): Likewise. + (pp_cxx_space_for_pointer_operator): Likewise. + (pp_cxx_init_declarator): Likewise. + (pp_cxx_call_argument_list): Likewise. + (pp_cxx_nonconsecutive_character): Tidy. + (pp_cxx_conversion_function_id): New function. + (pp_cxx_template_id): Likewise. + (pp_cxx_template_keyword_if_needed): Likewise. + (pp_cxx_nested_name_specifier): Likewise. + (pp_cxx_unqualified_id): Tidy + (pp_cxx_qualified_id): Handle more nodes. + (pp_cxx_primary_expression): Tidy. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_new_expression): Tidy. + (pp_cxx_delete_expression): Likewise. + (pp_cxx_cast_expression): New function. + (pp_cxx_pm_expression): Tidy. + (pp_cxx_conditional_expression): Likewise. + (pp_cxx_assignment_operator): New function. + (pp_cxx_assignment_expression): Tidy. + (pp_cxx_expression): New function. + (pp_cxx_function_specifier): Likewise. + (pp_cxx_decl_specifier_seq): Likewise. + (pp_cxx_simple_type_specifier): Tidy. + (pp_cxx_type_specifier_seq): Likewise. + (pp_cxx_ptr_operator): New function. + (pp_cxx_implicit_parameter_type): Likewise. + (pp_cxx_parameter_declaration): Tidy. + (pp_cxx_parameter_declaration_clause): New function. + (pp_cxx_exception_specification): Likewise. + (pp_cxx_direct_declarator): Tidy. + (pp_cxx_declarator): Likewise. + (pp_cxx_ctor_initializer): New function. + (pp_cxx_function_definition): Likewise. + (pp_cxx_abstract_declarator): Tidy. + (pp_cxx_direct_abstract_declarator): Likewise. + (pp_cxx_type_id): Likewise. + (pp_cxx_exception_declaration): New function. + (pp_cxx_statement): Likewise. + (pp_cxx_simple_declaration): Likewise. + (pp_cxx_template_parameter_list): Likewise. + (pp_cxx_template_parameter): Likewise. + (pp_cxx_template_declaration): Likewise. + (pp_cxx_explicit_specialization): Likewise. + (pp_cxx_explicit_instantiation): Likewise. + (pp_cxx_declaration): Tidy. + (pp_cxx_pretty_printer_init): Initialize more fields. + +2003-08-25 Mark Mitchell + + PR c++/8795 + * cp-tree.h (build_cplus_method_type): Remove. + * call.c (standard_conversion): Use build_method_type_directly + instead of build_cplus_method_type. + * class.c (build_clone): Likewise. + (adjust_clone_args): Likewise. + * decl.c (build_ptrmem_type): Likewise. + (grokdeclarator): Likewise. + (check_function_type): Likewise. + * decl2.c (grok_method_quals): Likewise. + (maybe_retrofit_in_chrg): Likewise. + * pt.c (copy_default_args_to_explicit_spec): Likewise. + (tsubst_function_type): Likewise. + (tsubst): Likewise. + * tree.c (build_cplus_method_type): Remove. + * typeck.c (merge_types): Use build_method_type_directly. + +2003-08-23 Kriang Lerdsuwanakij + + PR c++/3765 + * search.c (dfs_access_in_type): Fix typo in comment. + (dfs_accessible_queue_p): Likewise. + (dfs_accessible_p): Only terminate when a friend is found. + (accessible_p): Return immediately if access_in_type allows + access. + +2003-08-23 Kriang Lerdsuwanakij + + PR c++/641, c++/11876 + * friend.c (add_friend): Add complain parameter. + (make_friend_class): Likewise. + (do_friend): Adjust add_friend call. + * decl.c (grokdeclarator): Adjust make_friend_class call. + * parser.c (cp_parser_member_declaration): Likewise. + (cp_parser_template_declaration_after_export): Likewise. + * pt.c (instantiate_class_template): Adjust make_friend_class + and add_friend call. + * cp-tree.h (make_friend_class): Adjust declaration. + (add_friend): Likewise. + +2003-08-21 Jason Merrill + + PR c++/11283 + * call.c (build_conditional_expr): Ignore cv-qual differences for + non-class types. + +2003-08-21 Mark Mitchell + + PR c++/11551 + * parser.c (cp_parser_id_expression): Add declarator_p parameter. + (cp_parser_primary_expression): Adjust call to + cp_parser_id_expression. + (cp_parser_unqualified_id): Complain about the use of + typedef-names in a destructor declarator. + (cp_parser_postfix_expression): Adjust call to + cp_parser_id_expression. + (cp_parser_type_parameter): Likewise. + (cp_parser_template_argument): Likewise. + (cp_parser_declarator_id): Likewise. + + PR c++/11919 + * call.c (standard_conversion): Use same_type_p, not pointer + equality, to compare types. + + PR c++/10762 + * parser.c (cp_parser_using_declaration): Check for invalid uses + of template-ids here... + * decl2.c (do_class_using_decl): ... rather than here. + +2003-08-20 Mark Mitchell + + PR c++/11834 + * pt.c (more_specialized): Bump processing_template_decl. + +2003-08-21 Jason Merrill + + PR c++/11614 + * decl.c (grokdeclarator): Recognize a flexible array based on the + type, not the form of the declarator. + +2003-08-20 Jason Merrill + + * semantics.c (simplify_aggr_init_expr): Split out from + simplify_aggr_init_exprs_r. Convert slot address to match + the return type. + * cp-tree.h: Declare it. + * tree.c (cp_copy_res_decl_for_inlining): Don't clobber the + DECL_NAME of a user variable. + +2003-08-20 Nathan Sidwell + + PR c++/11945 + * pt.c (build_non_dependent_expr): Look inside COND_EXPR and + COMPOUND_EXPR. + * semantics.c (finish_expr_stmt): Always convert to void. + * typeck.c (build_x_compound_exp): Always convert to void. + +2003-08-19 Mark Mitchell + + PR c++/11684 + * cp-tree.h (grok_op_properties): Change prototype. + * decl.c (grok_op_properties): Add complain parameter. + (grokfndecl): Pass it. + * pt.c (tsubst_decl): Adjust accordingly. + + PR c++/10926 + * decl.c (start_method): Return immediately if push_template_decl + does not like the declaration. + * pt.c (push_template_decl_real): Disallow member template + destructors. + + PR c++/11036 + * cp-tree.h (add_binding): Add prototype. + * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate. + (maybe_warn_about_overly_private_class): Use + CLASSTYPE_DESTRUCTORS. + (pushclass): Adjust call to set_identifier_type_value. + * decl.c (add_binding): Give it external linkage. + (push_local_binding): Adjust call to add_binding. + (push_class_binding): Likewise. + (set_identifier_type_value_with_scope): Change prototype. Use + add_binding for global bindings. + (set_identifier_type_value): Adjust accordingly. + (pushtag): Likewise. + (pushdecl): Use set_identifier_type_value, not + set_identifier_type_value_with_scope. + (pushdecl_namespace_level): Adjust calls to + SET_IDENTIFIER_TYPE_VALUE to pass a DECL. + (pushdecl_class_level): Likewise. + (lookup_tag): Use select_decl. + (select_decl): Improve comment. + (record_builtin_type): Do not call pushdecl. + (cxx_init_decl_processing): Do not call xref_tag for bad_alloc. + (cp_finish_decl): Adjust call to set_identifier_type_value. + (check_elaborated_type_specifier): Improve checks for invalid uses + of typedefs. + (xref_tag): Adjust call to check_elaborated_type_specifier. + * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR. + * name-lookup.c (set_namespace_binding): Use add_binding. + * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL, + rather than an IDENTIFIER_NODE, to represent built-in types, if + requested by the caller. + (cp_parser_postfix_expression): Adjust call. + (cp_parser_type_specifier): Likewise. + (cp_parser_elaborated_type_specifier): Adjust call to + check_elaborated_type_specifier. + * typeck2.c (build_functional_cast): Do not perform name lookups. + + PR c++/10717 + * decl.c (expand_static_init): Remove unnecessary code. + +2003-08-19 Andrew Pinski + + PR c++/10538, PR c/5582 + * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define. + +2003-08-19 Kriang Lerdsuwanakij + + PR c++/11174 + * init.c (build_offset_ref): Perform access checking for + pointer to member correctly. + +2003-08-19 Gabriel Dos Reis + + * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling. + +2003-08-18 Nathan Sidwell + + PR c++/11957 + * cp-tree.h (finish_stmt_expr): Add bool parameter. + * init.c (finish_init_stmts): Pass true to finish_stmt_expr. Don't + adjust the stmt_expr here. + (build_vec_init): Use finish_stmt_expr_expr, convert result to + array type. + * parser.c (cp_parser_primar_expression): Adjust finish_stmt_expr + call. + * pt.c (tsubst_copy): Likewise. + * semantics.c (finish_stmt_expr): Add parameter. + + * pt.c (instantiate_class_template): Push to class's scope before + tsubsting base. + +2003-08-17 Jan Hubicka + + PR C++/11702 + * semantics.c (finish_id_expression): Mark all functions as used. + +2003-08-16 Nathan Sidwell + + PR c++/11512 + * cvt.c (convert_to_void): Indicate which side of conditional has + no effects, and rhs of comma operator. Test for no sideeffect + expressions here and always build a convert expr. + * init.c (expand_default_init): Convert the init to void. + * typeck.c (build_x_compound_expr): Do not check for side effects + here. + (build_compound_expr): Do not convert lhs when building a + template. + +2003-08-15 Nathan Sidwell + + * cp-tree.def (NON_DEPENDENT_EXPR): Add operand. + * decl2.c (build_offset_ref_call_from_tree): Use + build_non_dependent_expr. + * error.c (dump_expr) : Dump the operand. + * pt.c (build_non_dependent_expr): Set operand. + +2003-08-14 Jan Hubicka + + * decl2.c (mark_member_pointers): Rename to... + (mark_member_pointers_and_eh_tinfos): ... this one; deal with eh tinfos + (lower_function): Update call. + * except.c (eh_type_info): Break out from ... + (build_eh_type): ... here; tinfo is already used. + (finish_eh_spec_block): Mark tinfos as used. + * semantics.c (finish_handler_params): Mark tinfo as used. + * cp-tree.h (eh_type_info): Declare. + +2003-08-15 Nathan Sidwell + + * pt.c (instantiate_class_template): Set location before + substuting bases. + + * decl.c (make_typename_type): Use my_friendly_assert. + * pt.c (tsubst_aggr_type): Rearrange context substitution. + +2003-08-14 Jan Hubicka + + * method.c (use_thunk): Expand body directly. + +2003-08-12 Mark Mitchell + + PR c++/11703 + * call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to + determine whether or not to promote types. + (convert_for_arg_passing): Likewise. + * decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in + templates. + * pt.c (tsubst_decl): Do not expect it to be set. + + PR c++/9512 + PR c++/10923 + * cp-tree.h (check_elaborated_type_specifier): Declare. + (handle_class_head): Remove. + (note_got_semicolon): Likewise. + (note_list_got_semicolon): Likewise. + (finish_class_definition): Likewise. + * decl.c (check_elaborated_type_specifier): Make it public. + Robustify. + (handle_class_head): Remove. + * parser.c (cp_parser_elaborated_type_specifier): Use + check_elaborated_type_specifier. + (cp_parser_class_specifier): Do not call finish_class_definition. + (cp_parser_class_head): Or handle_class_head. Check for + over-qualified names. + * semantics.c (finish_class_definition): Remove. + + * parser.c (cp_parser_check_for_definition_in_return_type): New + function. + (cp_parser_simple_declaration): Adjust call to + cp_parser_init_declarator. + (cp_parser_decl_specifier_seq): Change type of + declares_class_or_enum parameter. + (cp_parser_explicit_instantiation): Adjust accordingly. + (cp_parser_type_specifier): Change type of + declares_class_or_enum parameter. + (cp_parser_init_declarator): Add declares_class_or_enum + parameter. + (cp_parser_parameter_declaration): Adjust call to + cp_parser_decl_specifier_seq. + (cp_parser_function_definition): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_single_declaration): Likewise. + + * cp-tree.h (lang_type_class): Remove has_call_overloaded, + has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon. + (TYPE_OVERLOADS_CALL_EXPR): Remove. + (TYPE_OVERLOADS_ARRAY_REF): Likewise. + (TYPE_OVERLOADS_ARROW): Likewise. + (CLASSTYPE_GOT_SEMICOLON): Likewise. + * class.c (check_bases): Do not set them. + (finish_struct_1): Likewise. + * decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON. + (build_ptrmemfunc_type): Likewise. + (grok_op_properties): Do not set TYPE_OVERLOADS_*. + (start_function): Do not check CLASSTYPE_GOT_SEMICOLON. + * decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON. + * lex.c (note_got_semicolon): Remove. + (note_list_got_semicolon): Likewise. + * parser.c (cp_parser_simple_declaration): Do not call + note_list_got_semicolon. + * pt.c (list_eq): Remove. + (lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON. + (instantiate_class_template): Do not set TYPE_OVERLOADS*. + (instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON. + * ptree.c (cxx_print_type): Do not print them. + * semantics.c (finish_member_class_template): Do not call + note_list_got_semicolon. + +2003-08-11 Aldy Hernandez + + * call.c (standard_conversion): Opaque pointers interconvert. + + * testsuite/g++.dg/other/opaque-3.C: New. + +2003-08-11 Mark Mitchell + + * typeck.c (merge_types): Handle cv-qualified pointer-to-member + types correctly. + +2003-08-10 Mark Mitchell + + PR c++/11789 + * cp-tree.h (get_vbase): Remove. + (get_vbase_types): Remove. + * init.c (expand_member_init): Correct logic for looking up base + classes. + +2003-08-10 Gabriel Dos Reis + + * error.c (dump_expr): Tidy. + * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. + (pp_cxx_begin_template_argument_list): Likewise. + (pp_cxx_end_template_argument_list): Likewise. + (is_destructor_name): Likewise. + (pp_cxx_unqualified_id): Likewise. + (pp_cxx_qualified_id): Likewise. + (pp_cxx_id_expression): Likewise. + (pp_cxx_new_expression): Likewise. + (pp_cxx_delete_expression): Likewise. + (pp_cxx_pm_expression): Likewise. + (pp_cxx_type_specifier): Rework. + (pp_cxx_type_id): Likewise. + (pp_cxx_primary_expression): Likewise. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_unary_expression): Likewise. + (pp_cxx_multiplicative_expression): Likewise. + (pp_cxx_conditional_expression): Likewise. + (pp_cxx_assignment_expression): Likewise. + (pp_cxx_pretty_printer_init): Tidy. + +2003-08-10 Nathan Sidwell + + * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL + NODE is always a TREE_VEC of nonzero size. + (NUM_TMPL_ARGS): NODE is always a TREE_VEC. + * decl2.c (arg_assoc): Template args will be a vec. + * error.c (dump_decl) : Call + dump_template_argument_list. + (dump_template_parms): Args will be a vec. + * parser.c (cp_parser_template_argument_list): Produce a + vector, not a list. + * pt.c (coerce_template_parms): Args are always vectors. + (mangle_class_name_for_template): Likewise. + (lookup_template_function): Likewise. + (lookup_template_class): Likewise. + (tsubst_template_args): Likewise. + (tsubst_baselink): Use tsubst_template_args. + (tsubst_qualified_id): Likewise. + (tsubst_copy) : Likewise. + (tsubst_copy_and_build) : Likewise. + (any_dependent_template_args_p): Args are always vectors. + * tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case. + + PR c++/11670 + * call.c (convert_like_real): Add rvalue binding error message. + * error.c (dump_expr) : Detect when the no expr is + really a cast. + + PR c++/10530 + * pt.c (dependent_type_p_r): A dependent template-id is a class + type with dependent template arguments, or a bound template + template parameter. + (type_dependent_expression_p): A template function decl cannot + have a dependent context. + +2003-08-07 Kriang Lerdsuwanakij + + PR c++/5767 + * parser.c (cp_parser_class_name): Return immediately when scope + is error_mark_node. + +2003-08-07 Aldy Hernandez + + * cp/Make-lang.in (cp/call.o): Add dependency for target.h. + + * cp/call.c (standard_conversion): Support opaque types. + Include target.h. + (strip_top_quals): Use cp_build_qualified_type instead of + TYPE_MAIN_VARIANT. + + * cp/typeck.c (convert_for_assignment): Support opaque types. + + * testsuite/g++.dg/other/opaque-1.C: New. + + * testsuite/g++.dg/other/opaque-2.C: New. + +2003-08-06 Aldy Hernandez + + * decl.c (grokparms): Use cp_build_qualified_type instead + TYPE_MAIN_VARIANT. + +2003-08-05 Gabriel Dos Reis + + * cxx-pretty-print.h: New file. + * cxx-pretty-print.c: Likewise. + * error.c (scratch_pretty_printer): Change type. + (init_error): Tidy. + (dump_aggr_type): Likewise. + (dump_global_iord): Likewise. + (dump_expr): Likewise. + (dump_char): Remove. + * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. + (cxx_initialize_diagnostics): New function. + * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o + (CXX_PRETTY_PRINT_H): New variable. + (cp/cxx-pretty-print.o): New rule. + (cp/cp-lang.o): Update dependence. + (cp/error.o): Likewise. + +2003-08-05 Steven Bosscher + + * cp-tree.h (struct lang_decl): Don't include c_lang_decl. + (DECL_DECLARED_INLINE_P): Remove. + * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P + if decl is a FUNCTION_DECL. This never made sense, but now it is + required to avoid a tree check failure. + * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. + * optimize.c (maybe_clone_body): Likewise. + +2003-08-04 Roger Sayle + + * decl.c (cxx_insert_default_attributes): Delete. + * cp-tree.h (cxx_insert_default_attributes): Don't prototype. + * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. + +2003-08-03 Nathan Sidwell + + PR c++/11704 + * pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with + unknown type. + + PR c++/11766 + * typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to + member functions. + +2003-08-02 Nathan Sidwell + + PR c++/9447 + * cp-tree.def (USING_DECL): Document its type. + * class.c (pushclass): If we're entering a template, push any + dependent using decls it has. + * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is + a dependent scope. + * pt.c (tsubst_decl) : Set type. + (tsubst): Remove USING_DECL checks. + (type_dependent_expression_p): Remove USING_DECL case. + * semantics.c (finish_member_declaration): A USING_DECL's type + indicates whether it is dependent. + +2003-08-02 Nathan Sidwell + + * cp-tree.h (pushclass): Remove unneeded parameter. + * class.c (pushclass): Remove unneeded MODIFY parm. Adjust. + (push_nested_class): Adjust pushclass call. + * pt.c (instantiate_class_template): Likewise. + * semantics.c (begin_class_definition): Likewise. + +2003-08-01 Nathanael Nerode + + * typeck2.c (add_exception_specifier): Use 'bool' where appropriate. + +2003-08-01 Mark Mitchell + + PR c++/11697 + * decl.c (decls_match): Don't ignore the types of template + classes. + + PR c++/11744 + * pt.c (tsubst_copy_and_build): Refine Koenig lookup logic. + +2003-08-01 Kriang Lerdsuwanakij + + PR c++/8442, c++/8806 + * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are + preferred. + (check_elaborated_type_specifier): Add allow_template_p + parameter. Check tag mismatch and class template. + (xref_tag): Add template_header_p parameter. Add assertion + that name is an IDENTIFIER_NODE. Remove implicit typename + warning. Simplify lookup process if globalize is true. + (cxx_init_decl_processing): Adjust call to xref_tag. + (xref_tag_from_type): Likewise. + * decl2.c (handle_class_head): Likewise. + * parser.c (cp_parser_elaborated_type_specifier, + cp_parser_class_head): Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast1, + tinfo_base_init, emit_support_tinfos): Likewise. + * class.c (is_base_of_enclosing_class): Remove. + * pt.c (convert_template_argument): Don't accept RECORD_TYPE as + template template argument. + * cp-tree.h (xref_tag): Adjust declaration. + (is_base_of_enclosing_class): Remove. + * NEWS: Document template template argument change. + +2003-08-01 Nathan Sidwell + + * parser.c (cp_parser_init_declarator, + cp_paser_member_declaration): Reformat. + * pt.c (lookup_template_class, type_unification_real, unify, + type_dependent_expression_p): Reformat. + + PR c++/11295 + * cp-tree.h (tubst_flags_t): Add tf_stmt_expr_cmpd, + tf_stmt_expr_body. + (finish_stmt_expr_expr): Declare. + * parser.c (cp_parser_primary_expression): Tell + cp_parser_compount_statement that it is a statement expression. + (cp_parser_statement, cp_parser_labeled_statement, + cp_parser_compound_statement, cp_parser_statement_seq_opt): Add + in_statement_expr_p parameter. + (cp_parser_expression_statement): Likewise. Call + finish_stmt_expr_expr for final expression of a statement + expression. + (cp_parser_for_init_statement, + cp_parser_implicitly_scoped_statement, + cp_parser_already_scoped_statement, cp_parser_function_definition, + cp_parser_try_block, cp_parser_handled): Adjust. + * pt.c (tsubst_copy) : Pass tf_stmt_expr. + (tsubst_expr): Process tf_stmt_expr and tf_stmt_exprs flags. + (tsubst_expr) : Check tf_stmt_exprs flag. + * semantics.c (finish_expr_stmt): Do not deal with statement + expressions. + (begin_stmt_expr): Clear last_expr_type. + (finish_stmt_expr_expr): New. + (finish_stmt_expr): Process the value expression. + + * typeck.c (build_compound_expr): If RHS is a TARGET_EXPR, put the + compound expr inside the target's initializer. + + PR c++/11525 + * parser.c (cp_parser_primary_expression): Do not set + non-constant-p merely because it is a dependent scope. + + PR c++/9447 + * decl2.c (do_class_using_decl): Set type to NULL_TREE. + * semantics.c (finish_expr_stmt): Do not convert to void in a + template. + +2003-07-31 Nathan Sidwell + + * pt.c (coerce_template_parms): Refactor. + (fn_type_unification): Increment processing_template_decl when + tsubsting an incomplete set of explicit args. + + PR c++/11347 + * pt.c (instantiate_class_template): Increment + processing_template_decl around the tsubst of a template member + class. + (tsubst_qualified_id): Assert we do not have a dependent scope. + + * pt.c (coerce_template_template_parms, lookup_template_class, + can_complete_type_without_circularity, instantiate_class_template, + tsubst_decl, unify): Reformat. + +2003-07-31 Jan Hubicka + + * decl2.c (maybe_make_one_only): Use mark_referenced. + * method.c (use_thunk): Likewsie. + +2003-07-30 Jan Hubicka + + * class.c (build_vtable_entry_ref): Kill. + (build_vtbl_ref_1): Do not call build_vtable_entry_ref. + (build_vfn_ref): Do not call build_vtable_entry_ref. + * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill. + * cp-tree.h (prepare_assemble_variable): Kill. + * cp-decl.c (prepare_assemble_variable): Kill. + +2003-07-29 Geoffrey Keating + + * parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead + of setting valid_pch by hand. + +2003-07-29 Rainer Orth + + * decl.c (finish_enum): Initialize underlying_type. + +2003-07-29 Nathan Sidwell + + PR c++/9447 + * decl.c (add_binding): Add bval local variable. + (push_class_level_binding): Likewise. Allow a USING_DECL to be + pushed. + * decl2.c (do_class_using_decl): The type of a using decl is + unknown. + * parser.c (cp_parser_postfix_expression): Refactor unqualified-id + function call lookup code. + * pt.c (tsubst): A USING_DECL will have unknown type. + (tsubst_copy_and_build): Allow a using decl. + (type_dependent_expression_p): A USING_DECL will make it + dependent. + * semantics.c (finish_member_declaration): Push a dependent using + declaration. + +2003-07-28 Mark Mitchell + + PR c++/11530 + * parser.c (cp_parser_postfix_expression): Do not call mark_used. + * semantics.c (finish_id_expression): Call mark_used for all + declarations. + +2003-07-28 Mark Mitchell + + PR c++/11667 + * call.c (standard_conversion): Allow all integral->enumeral + conversions, after marking them as bad. + * decl.c (finish_enum): Make sure that all enumerators are + properly converted to the underlying type. + (build_enumerator): Set DECL_CONTEXT for namespace-scope + enumeration types. + * pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly. + (tsubst_enum): Tidy. + + * Make-lang.in (typeck.o): Depend on convert.h. + (class.o): Likewise. + (rtti.o): Likewise. + * call.c: Include convert.h. + (convert_arg_to_ellipsis): Use convert_to_real. + * class.c: Include convert.h. + (build_base_path): Use convert_to_integer. + * rtti.c: Include convert.h. + (build_headof): Use convert_to_integer. + * typeck.c: Include convert.h. + (decay_conversion): Use convert_to_integer. + (build_unary_op): Use build_nop. + (get_delta_difference): Use convert_to_integer. + (build_ptrmemfunc): Avoid unnecessary conversions. + +2003-07-28 Jan Hubicka + + * decl2.c (mark_member_pointers): Verify that member pointer points to + the function. + +2003-07-28 Nathan Sidwell + + * cp-tree.h (begin_compound_stmt): No scope arg is a bool. + (finish_compound_stmt): Remove no scope arg. + * decl.c (register_dtor_fn): Adjust begin_compound_stmt and + end_compound_stmt calls. + (expand_static_init, begin_destructor_body, begin_function_body, + finish_function_body): Likewise. + * decl2.c (start_objects, finish_objects, + start_static_storage_duration_function, + finish_static_storage_duration_function): Likewise. + * init.c (begin_init_stmts, finish_init_stmts, + construct_virtual_base, build_vec_init): Likewise. + * method.c (do_build_assign_ref, synthesize_method): Likewise. + * parser.c (cp_parser_compound_statement, + cp_parser_implicitly_scoped_statement, + cp_parser_already_scoped_statement): Likewise. + * pt.c (tsubst_expr): Likewise. + * semantics.c (begin_compound_stmt): No scope arg is a bool. + (finish_compound_stmt): Remove no scope arg. + + * error.c (dump_expr) : A compound expr is + always dyadic. + +2003-07-27 Mark Mitchell + + * call.c (standard_conversion): Tweak handling of + pointer-to-member types. + * pt.c (tsubst): Correctly qualify pointers-to-data member types. + * typeck.c (comp_ptr_ttypes_real): Check qualifiers on + pointer-to-data member types. + +2003-07-27 Nathan Sidwell + + * parser.c (cp_parser_type_parameter): Reformat. + (cp_parser_parameter_declaration): Deprecate default args where + not allowed. + +2003-07-26 Nathan Sidwell + + * cfns.h: Rebuilt. + + * cp-tree.h (begin_init_stmts, finish_init_stmts): Remove. + (begin_global_stmt_expr, finish_global_stmt_expr): Remove. + * init.c (begin_init_stmts): Make static. Return is_global + value. Always call begin_stmt_expr. + (finish_init_stmts): Make static. Add is_global parm. Always + building a stmt tree. + (build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls. + (build_vec_init): Likewise. Always building a stmt tree. + (expand_default_init): Always building a stmt tree. + (get_temp_regvar): Likewise. + * semantics.c (begin_global_stmt_expr, + finish_global_stmt_expr): Remove. + +2003-07-25 Nathan Sidwell + + * cp-tree.h (build_compound_expr): Take LHS & RHS args. + (build_x_compound_expr_from_list): Declare. + * typeck.c (build_x_compound_expr_from_list): New. + (build_x_compound_expr): Adjust. + (build_compound_expr): Remove unreachable code. Take two + parameters, adjust. + * decl.c (grok_reference_init): Use + build_x_compound_expr_from_list. + (expand_static_init): Adjust build_compound_expr call. + (cxx_maybe_build_cleanup): Likewise. + * init.c (perform_member_init): Use + build_x_compound_expr_from_list. + (build_new_1): Likewise. + (build_vec_delete): Adjust build_compound_expr calls. + (build_vbase_delete): Likewise. + * typeck2.c (store_init_value): Use + build_x_compound_expr_from_list. + (build_functional_cast): Likewise. + +2003-07-25 Nathan Sidwell + + * cp-tree.h (enum tsubst_flags_t): Add tf_user. + * decl.c (make_typename_type): Pass it. + * pt.c (lookup_template_class): Use it. + (resolve_typename_type): Pass it. + * semantics.c (finish_template_type): Pass it. + +2003-07-25 Nathan Sidwell + + PR c++/11617 + * cp-tree.h (qualified_name_lookup_error): Declare. + * pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for + errors. + (tsubst_expr) : Likewise. + (tsubst_copy_and_build) : Likewise. + * semantics.c (qualified_name_lookup_error): New, broken out of ... + (finish_id_expression): ... here. Use it. + +2003-07-25 Falk Hueffner + + * cfns.gperf: Add '%%' delimiter to placate gperf 3.0. + +2003-07-25 Nathan Sidwell + + PR c++/11596 + * pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove. + (tsubst_template_arg): New. + (tsubst_template_arg_vector): Rename to ... + (tsubst_template_args): ... this. Accept a TREE_LIST form. Use + tsubst_template_arg. + (coerce_template_parms): Use tsubst_template_arg for default + value. + (tsubst_template_parms): Likewise. + (tsubst_aggr_type): Adjust. + (tsubst_decl): Likewise. + (tsubst): Use tsubst_template_arg for a DOMAIN. Adjust. + (tsubst_copy) : Use tsubst_template_args. + +2003-07-25 Gabriel Dos Reis + + * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. + * error.c: Use the new pretty-printer framework. + +2003-07-24 Per Bothner + + * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc + which causes errors messages to incorrectly mention included files. + +2003-07-24 Mark Mitchell + + * cp-tree.h (convert_to_base_statically): Declare. + * call.c (build_special_member_call): Convert INSTANCE to the base + type. + * class.c (convert_to_base_statically): New method. + * init.c (construct_virtual_base): Use it. + * method.c (do_build_assign_ref): Fix typo in comment. + +2003-07-24 Jason Merrill + + * decl.c: Just set truthvalue_* to boolean_*. + +2003-07-24 Nathan Sidwell + + * decl.c (reshape_init): Remove unreachable code. + +2003-07-24 Kriang Lerdsuwanakij + + PR c++/11513 + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. + +2003-07-23 Mark Mitchell + + PR c++/11645 + * cp-tree.h (accessible_base_p): Declare. + * call.c (build_over_call): Use it. + * search.c (accessible_base_p): New function, split out from ... + (lookup_base): ... here. + + PR c++/11517 + * call.c (build_conditional_expr): Use perform_implicit_conversion + and error_operand_p. Robustify. + * typeck.c (build_unary_op): Use perform_implicit_conversion. + +2003-07-23 Nathan Sidwell + + PR c++/10953 + * parser.c (cp_parser_nested_name_specifier): Reset scope on + failure. + (cp_parser_elaborated_type_specifier): Likewise. + +2003-07-22 Mark Mitchell + + Eliminate use of POINTER_TYPE for pointers-to-members. + * call.c (standard_conversion): Rework pointer-to-member handling. + Add comments. + (add_builtin_candidate): Likewise. + (resolve_scoped_fn_name): Remove. + (build_conditional_expr): Rework pointer-to-member handling. + (compare_ics): Likewise. + * class.c (check_field_decls): Use TYPE_PTR_P. + * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member + handling. + * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P. + (TYPE_PTRMEM_P): Add comment. + (TYPE_PTR_P): Simplify. + (TYPE_PTROB_P): Correct definition. + (TYPE_PTR_TO_MEMBER_P): New macro. + (TYPE_PTRMEM_CLASS_TYPE): Adjust. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (resolved_scoped_fn_name): Remove declaration. + (build_offset_ref): Change prototype. + (resolve_offset_ref): Remove. + (comp_target_types): Remove. + * cvt.c (cp_convert_to_pointer): Rework pointer-to-member + handling. + (convert_to_reference): Use can_convert. + (ocp_convert): Improve error handling. Rework pointer-to-member + handling. + (perform_qualification_conversions): Rework pointer-to-member + handling. + * decl.c (build_ptrmem_type): Handle functions too. + (create_array_type_for_decl): Remove OFFSET_TYPE error message. + (grokdeclarator): Use OFFSET_TYPE for pointers to data members. + (grokparms): Remove OFFSET_TYPE error message. + * dump.c (cp_dump_tree): Rework pointer-to-member handling. + * error.c (dump_type_prefix): Likewise. + * expr.c (cplus_expand_constant): Use build_nop. + * init.c (build_offset_ref): Add address_p parameter. Fold in + necessary bits from resolve_offset_ref. + (resolve_offset_ref): Remove. + * parser.c (cp_parser_postfix_expression): Remove special case + code for OFFSET_TYPE. + * pt.c (convert_nontype_argument): Rework pointer-to-member + handling. + (convert_template_argument): Likewise. + (unify): Likewise. + (invalid_nontype_parm_type_p): Likewise. + (dependent_type_p_r): Likewise. + * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case. + (target_incomplete_p_): Rework pointer-to-member + handling. + (get_pseudo_ti_init): Likewise. + (get_pseudo_ti_desc): Likewise. + * semantics.c (finish_qualified_id_expr): Adjust call to + build_offset_ref. Remove use of resolve_offset_ref. + * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P. + * typeck.c (target_type): Use TYPE_PTRMEM_P. + (type_unknown_p): Remove obsolete code about the time before + non-dependent expressions were handled correctly. + (qualify_type_recursive): Remove. + (composite_pointer_type_r): New function. + (composite_pointer_type): Use it. + (merge_types): Remove dead comments. + (comp_cv_target_types): Remove. + (comp_target_types): Likewise. + (comp_target_parms): Likewise. + (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error. + (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P. + (build_binary_op): Do not use of comp_target_types. + (pointer_diff): Remove OFFSET_TYPE case. + (build_unary_op): Adjust pointer-to-member handling. + (unary_complex_lvalue): Likewise. + (check_for_casting_away_constness): Add description parameter. + (build_static_cast): Pass it. + (build_reinterpret_cast): Use check_for_casting_away_constness. + (build_const_cast): Adjust pointer-to-member handling. + (build_c_cast): Likewise. + (convert_for_assignment): Remove OFFSET_TYPE error message. + (comp_ptr_ttypes_real): Adjust pointer-to-member handling. + (comp_ptr_ttypes_reinterpret): Remove. + (casts_away_constness_r): Adjust pointer-to-member handling. + (casts_away_constness): Liekwise. + (strip_all_pointer_quals): Remove. + * typeck2.c (digest_init): Adjust pointer-to-member handling. + (build_m_component_ref): Likewise. + +2003-07-22 Wolfgang Bangerth + + * lex.c (unqualified_fn_lookup_error): Mention that the error + message needs to be kept in synch with the manual. + +2003-07-22 Nathan Sidwell + + PR c++/11614 + * decl.c (grokdeclarator): An array member is only a flexible + array member if the field itself is the array. + +2003-07-22 Kriang Lerdsuwanakij + + PR c++/10793 + * decl.c (xref_basetypes): Handle error_mark_node. + +2003-07-22 Nathan Sidwell + + * cp-tree.h (enum cp_lvalue_kind): Add clk_packed. + * tree.c (lvalue_p_1): Set it. + * class.c (check_field): Don't allow non-packed non-POD fields to + be packed. + * call.c (reference_binding): Need a temporary for all bitfield + and packed fields. + (convert_like_real): Check it is ok to make a temporary here. + +2003-07-21 Nathan Sidwell + + * cp-tree.h (hack_identifier): Remove. + * method.c (hack_identifier): Remove. + * semantics.c (finish_id_expression): Expand hack_identifier + here. Simplify. + +2003-07-19 Kaveh R. Ghazi + + * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c + semantics.c typeck.c: Remove unnecessary casts. + +2003-07-18 Nathan Sidwell + + * cp-tree.h (hack_identifier): Remove. + * method.c (hack_identifier): Remove. + * semantics.c (finish_id_expression): Expand hack_identifier + here. Simplify. + +2003-07-18 Nathan Sidwell + + * cp-tree.h (finish_non_static_data_member): Add object param. + * method.c (hack_identifier): Adjust. + * pt.c (tsubst_copy_and_build) : Don't search + again for a FIELD_DECL. + * semantics.c (finish_non_static_data_member): Add object + parameter. Always save the DECL in the COMPONENT_REF. + * call.c (resolve_scoped_fn_name): Adjust. + +2003-07-17 Zack Weinberg + + * pt.c (get_bindings): Make definition consistent with + forward declaration. + +2003-07-17 Kriang Lerdsuwanakij + + PR c++/7809 + * friend.c (add_friend): Check access for member functions + and templates. + +2003-07-17 Gabriel Dos Reis + + PR c++/10668 + * typeck.c (build_class_member_access_expr): Improve diagnostic. + +2003-07-16 Mark Mitchell + + PR c++/11547 + * cp-tree.h (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P): New + macro. + (DECL_PRETTY_FUNCTION_P): Use VAR_DECL_CHECK. + * decl.c (duplicate_decls): Merge + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + * parser.c (cp_parser_postfix_expression): Adjust call to + cp_parser_initializer_list and + cp_parser_parenthesized_expression_list. + (cp_parser_parenthesized_expression_list): Add non_constant_p. + (cp_parser_new_placement): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_conditional_expression): Remove. + (cp_parser_constant_expression): Parse an assignment-expression, + not a conditional-expression. + (cp_parser_simple_declaration): Resolve expression/declaration + ambiguity more quickly. + (cp_parser_mem_initializer): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_init_declarator): Keep track of whether or not the + initializer is a constant-expression. + (cp_parser_initializer): Add non_constant_p parameter. + (cp_parser_initializer_clause): Likewise. + (cp_parser_initializer_list): Likewise. + (cp_parser_attribute_list): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_functional_cast): Likewise. + * pt.c (tsubst_decl): Copy + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + (tsubst_expr): Tweak use of DECL_PRETTY_FUNCTION_P. + * semantics.c (finish_id_expression): Use + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + +2003-07-16 Neil Booth + + * lang-options.h: Remove. + +2003-07-16 Andrew Pinski + + PR c/10962 + * class.c (field_decl_cmp): Remove. + (resort_field_decl_cmp): Remove. + (resort_sorted_fields): Remove. + (add_fields_to_vec): Rename to ... + (add_fields_to_record_type): this. + (finish_struct_1): Change to be using + sorted_fields_type's fields. + * cp-tree.h (lang_decl): In lang_decl_u3 + change sorted_fields to be a pointer to + sorted_fields_type. + (resort_sorted_fields): Remove prototype. + * search.c (lookup_field_1): Change to be using + sorted_fields_type's fields. + +2003-07-16 Kriang Lerdsuwanakij + + PR c++/5421 + * decl.c (grokdeclarator): Handle TEMPLATE_ID_EXPR if friend + is a member of other class. + * friend.c (do_friend): Don't build TEMPLATE_DECL if friend + is a specialization of function template. + +2003-07-16 Gabriel Dos Reis + + PR c++/10903 + * pt.c (convert_nontype_argument): Fix thinko in diagnostic. + Improve. + +2003-07-15 Mark Mitchell + + * cp-tree.def (LOOKUP_EXPR): Remove. + * cp-tree.h (cp_id_kind): Add CP_ID_KIND_UNQUALIFIED_DEPENDENT. + (LOOKUP_EXPR_GLOBAL): Remove. + (get_bindings): Remove. + (is_aggr_type_2): Remove. + * call.c (resolved_scoped_fn_name): Remove support for + LOOKUP_EXPR. + * decl.c (grokfndecl): Likewise. + (grokdeclarator): Likewise. + * error.c (dump_decl): Likewise. + (dump_expr): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_offset_ref): Likewise. + * lex.c (unqualified_fn_lookup_error): Use pedwarn. Do not create + LOOKUP_EXPRs + * mangle.c (write_expression): Remove support for LOOKUP_EXPR. + * parser.c (cp_parser_postfix_expression): Modify Koenig lookup + test. + * pt.c (get_bindings): Give it internal linkage. + (check_explicit_specialization): Remove support for LOOKUP_EXPR. + (lookup_template_function): Likewise. + (for_each_tempalte_parm_r): Likewise. + (tsubst_decl): Likewise. + (tsubst_qualified_id): Handle template template parameters. + (tsubst_copy): Remove support for LOOKUP_EXPR. + (tsubst_copy_and_build): Likewise. + (most_general_template): Likewise. + (value_dependent_expression_p): Likewise. + (type_dependent_expression_p): Note that IDENTIFIER_NODEs are + always dependent. + * semantics.c (perform_koenig_lookup): Do not create + IDENTIFIER_NODEs. + (finish_fname): Likewise. + (finish_id_expression): Likewise. + * tree.c (is_aggr_type_2): Remove. + +2003-07-16 Gabriel Dos Reis + + PR c++/11531 + * typeck.c (check_return_expr): Fix thinko in diagnostic. + +2003-07-15 Kriang Lerdsuwanakij + + PR c++/10108 + * pt.c (tsubst_decl) : Add a check for + error_mark_node. + +2003-07-14 Mark Mitchell + + PR c++/11509 + * pt.c (dependent_scope_ref_p): New function. + (value_dependent_expression_p): Use it. + (type_dependent_expression_p): Likewise. + + * pt.c (tsubst_friend_function): Use reregister_specialization. + + PR c++/7019 + * cp-tree.h (lookup_qualified_name): Adjust prototype. + * decl.c (lookup_qualified_name): Add complain parameter. Adjust + call to is_aggr_type. + * parser.c (cp_parser_lookup_name): Adjust call to + lookup_qualified_name. + * pt.c (tsubst_qualified_id): Likewise. + (tsubst_copy_and_build): Likewise. + * semantics.c (finish_qualified_id_expr): Deal with erroneous + expressions. + +2003-07-14 Gabriel Dos Reis + + PR c++/11510 + * call.c (op_error): Properly format REALPART_EXPR and + IMAGPART_EXPR. + * error.c (dump_expr): Likewise. + +2003-07-14 Gabriel Dos Reis + + * error.c (dump_expr): Handle EMPTY_CLASS_EXPR. + +2003-07-14 Gabriel Dos Reis + + PR c++/5293 + * call.c (initialize_reference): Improve diagnostic. + +2003-07-14 Kriang Lerdsuwanakij + + PR c++/11154 + * pt.c (more_specialized_class): Add full_args parameter. + (most_specialized_class): Adjust calls to more_specialized_class. + * cp-tree.h (more_specialized_class): Adjust declaration. + +2003-07-14 Dan Nicolaescu + + * lex.c (enum tree_node_kind): Delete. + +2003-07-13 Mark Mitchell + + PR c++/11503 + * cp-tree.h (DECL_SELF_REFERENCE_P): New macro. + (SET_DECL_SELF_REFERENCE_P): Likewise. + * class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P. + * pt.c (tsubst_decl): Copy it. + * search.c (lookup_base): Use DECL_SELF_REFERENCE_P. + + * pt.c (reregister_specialization): Fix thinko in previous change. + + * cp-tree.h (cp_id_kind): New type. + (unqualified_name_lookup_error): Change prototype. + (unqualified_fn_lookup_error): New function. + (do_identifier): Remove. + (do_scoped_id): Likewise. + (tsubst_copy_and_build): Change prototype. + (reregister_specialization): New function. + (perform_koenig_lookup): Likewise. + (finish_id_expression): Likewise. + * call.c (build_method_call): Adjust call to + unqualified_name_lookup_error. + * decl.c (duplicate_decls): Use reregister_specialization. + * lex.c (is_global): Remove. + (unqualified_name_lookup_error): Return a value. + (do_identifier): Remove. + (do_scoped_id): Likewise. + (identifier_typedecl_value): Remove. + (unqualified_fn_lookup_error): New function. + * parser.c (cp_parser_id_kind): Remove. + (cp_parser_non_constant_id_expression): Remove. + (cp_parser_primary_expression): Use finish_id_expression. + (cp_parser_class_or_namespace_name): Use cp_id_kind, not + cp_parser_id_kind. + (cp_parser_postfix_expression): Use perform_koenig_lookup. + (cp_parser_template_argument): Use cp_id_kind. + (cp_parser_fold_non_dependent_expr): Adjust call to + tsubst_copy_and_build. + * pt.c (unregister_specialization): Rename to ... + (reregister_specialization): This. + (tsubst_friend_function): Use it. + (maybe_fold_nontype_arg): Adjust call to tsubst_copy_and_build. + (tsubst_qualified_id): Likewise. + (tsubst_expr): Likewise. + (tsubst_copy_and_build): Add function_p parameter. Use + finish_id_expression. Introduce RECUR macro. + (tsubst_non_call_postfix_expression): New function. + (regenerate_decl_from_template): Use reregister_specialization. + * semantics.c (perform_koenig_lookup): New function. + (finish_id_expression): Likewise. + +2003-07-13 Kriang Lerdsuwanakij + + * pt.c (push_access_scope_real): Remove. + (push_access_scope): Move code from push_access_scope_real. + (pop_access_scope): Don't check for TEMPLATE_DECL. + (instantiate_template): Defer access checking during template + substitution. + (regenerate_decl_from_template): Tidy. + +2003-07-11 Nathanael Nerode + + PR c++/11437 + * operators.def: Add definitions for __imag__, __real__. + +2003-07-11 Nathan Sidwell + + PR c++/11050 + * parser.c (cp_parser_expression_list): Rename to ... + (cp_parser_parenthesized_expression_list): ... here. Add attribute + parameter, parse the surounding parentheses. + (cp_parser_skip_to_closing_parenthesis): Add recover and or_comma + parameters. Return int. + (cp_parser_skip_to_closing_parenthesis or comma): Remove. + (cp_parser_postfix_expression): Adjust function call parsing. + (cp_parser_new_placement): Adjust. + (cp_parser_new_initializer): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_selection_statement): Likewise. + (cp_parser_mem_initializer): Likewise. + (cp_parser_asm_definition): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_declarator): Make + cdtor_or_conv_p an int ptr. + (cp_parser_direct_declarator): Likewise. Check for a parameter + list on cdtors & conv functions. + (cp_parser_initializer): Adjust. + (cp_parser_member_declaration): Adjust. + (cp_parser_attribute_list): Move code into + cp_parser_parens_expression_list. + (cp_parser_functional_cast): Adjust. + * pt.c (type_dependent_expression_p): Erroneous expressions are + non-dependent. + +2003-07-11 Geoffrey Keating + + * decl.c (cp_finish_decl): Handle 'used' attribute. + + * cp-lang.c (c_reset_state): New dummy routine. + * cp-tree.h (finish_file): Move prototype to c-common.h. + * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. + +2003-07-11 Mark Mitchell + + PR c++/8327 + * pt.c (tsubst_qualified_id): Implement suggested resolution for + Core Issue 2. + (type_dependent_expression_p): Likewise. + +2003-07-10 Mark Mitchell + + * typeck.c (build_binary_op): Do not warn about signed + vs. unsigned comparisons in the bodies of templates. + + PR c++/9411 + * parser.c (cp_parser_postfix_expression): Check dependency of + functions. + +2003-07-09 Mark Mitchell + + PR c++/10032 + * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are + still errors. + + PR c++/10527 + * error.c (decl_to_string): Do not print default argument + expressions. + + * cp-tree.h (break_out_calls): Remove declaration. + * tree.c (break_out_calls): Remove. + * typeck.c (build_modify_expr): Avoid invalid sharing of trees. + +2003-07-09 Nathan Sidwell + + PR c++ 9483 + * class.c (check_field_decls): Pass DECL_NAME to constructor_name_p. + * decl2.c (constructor_name_p): Avoid repeated constructor_name + calls. + * decl.c (grokdeclarator): Refactor ctor/dtor detection. + +2003-07-09 Mark Mitchell + + * typeck.c (build_x_unary_op): Take note of the fact that + PREINCREMENT_EXPR and POSTINCREMENT_EXPR are binary operations on + trees. + + * parser.c (cp_parser_primary_expression): Preserve the form of + qualified expressions in templates, even if they are not + dependent. + * pt.c (convert_nontype_argument): Handle non-dependent SCOPE_REFs. + (tsubst_qualified_id): Likewise. + * search.c (accessible_p): Treat everything in the body of a + template as accessible. + +2003-07-08 Mark Mitchell + + * cp-tree.def (NON_DEPENDENT_EXPR): New node. + * cp-tree.h (build_call_from_tree): Remove. + (build_member_call): Likewise. + (dependent_template_arg_p): Remove. + (any_dependent_template_arguments_p): New function. + (dependent_template_id_p): Likewise. + (any_type_dependent_arguments_p): Likewise. + (build_non_dependent_expr): Likewise. + (build_non_dependent_args): Likewise. + (build_x_compound_expr): Adjust prototype. + * call.c (build_new_method_call): Handle non-dependent expressions + correctly. + * decl2.c (grok_array_decl): Likewise. + (build_offset_ref_call_from_tree): Likewise. + (build_call_from_tree): Remove. + * error.c (dump_decl): Handle NON_DEPENDENT_EXPR. + (dump_expr): Likewise. + * init.c (build_member_call): Remove. + * mangle.c (write_expression): Update handling for template-ids. + * parser.c (cp_parser_primary_expression): Use + any_dependent_template_arguments_p. Update constant-expression + handling. + (cp_parser_postfix_expression): Use + any_type_dependent_arguments_p. Simplify call processing. + (cp_parser_unary_expression): Simplify. + (cp_parser_expression): Adjust for changes to + build_x_compound_expr. + (cp_parser_template_argument): Implement standard-conforming + parsing of non-type template arguments. + (cp_parser_direct_declarator): Use + cp_parser_fold_non_dependent_expr. + (cp_parser_fold_non_dependent_expr): New function. + (cp_parser_next_token_ends_template_argument_p): Likewise. + * pt.c (convert_template_argument): Do not call + maybe_fold_nontype_arg. + (tsubst_baselink): Likewise. + (tsubst_copy_and_build): Share common code. Make sizeof/alignof + processing work correctly for non-dependent expressions. Adjust + handling of COMPOUND_EXPR. Simplify call processing. + (value_dependent_expression_p): Deal with functional casts and + sizeof/alignof correctly. + (type_dependent_expression_p): Handle overloaded functions. + (any_type_dependent_arguments_p): New function. + (any_dependent_template_arguments_p): Likewise. + (dependent_template_p): Treat SCOPE_REFs as dependent. + (dependent_template_id_p): Simplify. + (build_non_dependent_expr): New function. + (build_non_dependent_args): Likewise. + * semantics.c (finish_stmt_expr): Don't make dependent + statement-expresions have void type. + (finish_call_expr): Handle non-dependent expressions + correctly. + * tree.c (lvalue_p_1): Treat NON_DEPENDENT_EXPRs as lvalues. + * typeck.c (cxx_sizeof_or_alignof_type): Give the expression + type size_t, even in templates. + (expr_sizeof): Likewise. + (finish_class_member_access_expr): Handle non-dependent expressions + correctly. + (build_x_indirect_ref): Likewise. + (build_x_binary_op): Likewise. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + (build_x_compound_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-07-09 Jan Hubicka + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New. + * decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS. + (start_function): Use DECL_ESTIMATED_INSNS. + * optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS. + + * decl2.c (maybe_emit_vtables): Fix marking vtables as needed in + unit-at-a-time + +2003-07-08 Kriang Lerdsuwanakij + + PR c++/11030 + * pt.c (instantiate_class_template): Don't call xref_tag to + inject name when the friend class is a specialization. + +2003-07-07 Mark Mitchell + + * cp-tree.h (build_scoped_method_call): Remove. + (lookup_qualified_name): Remove parameter. + (tsubst_copy_and_build): Declare. + (finish_qualified_object_call_expr): Remove. + (check_accessibility_of_qualified_id): New function. + (finish_qualified_id_expr): Likewise. + (non_reference): Likewise. + (build_expr_from-tree): Remove. + * call.c (non_reference): Remove. + (build_scoped_method_call): Likewise. + (build_method_call): Use error_operand_p. Assert that we are not + processing a template. + (standard_conversion): Use non_reference. + * class.c (build_vtbl_entry_ref): Likewise. + (build_vtbl_ref_1): Likewise. + * cvt.c (build_expr_type_conversion): Use non_reference. + * decl.c (lookup_qualified_name): Remove flags parameter. + (grok_op_properties): Use non_reference. + * decl2.c (grok_array_decl): Likewise. + (build_expr_from_tree): Remove. + (build_offset_ref_call_from_tree): Update comment. + * error.c (parm_to_string): Call reinit_global_formatting_buffer. + * except.c (prepare_eh_types): Use non_reference. + (can_convert_eh): Likewise. + * init.c (build_dtor_call): Avoid using build_method_call. + * mangle.c (write_template_param): Remove misleading comment. + * method.c (locate_copy): Use non_reference. + * parser.c (cp_parser_scope_through_which_access_occurs): Remove. + (cp_parser_primary_expression): Do not create SCOPE_REFs is + non-dependent contexts. + (cp_parser_postfix_expression): Use finish_qualified_id_expr. + (cp_parser_direct_declarator): Use tsubst_copy_and_build, not + build_expr_from_tree. + (cp_parser_lookup_name): Adjust call to lookup_qualified_name. + Use check_accessibility_of_qualified_id. + * pt.c (maybe_fold_nontype_arg): Use tsubst_copy_and_build, not + build_expr_from_tree. + (tsubst_baselink): New function. + (tsubst_qualified_id): Likewise. + (tsubst_copy): Use them. Remove support for METHOD_CALL_EXPR. + (tsubst_expr): Adjust call to lookup_qualified_name. + (tsubst_copy_and_build): Handle SCOPE_REFs specially. Adjust + handling of CALL_EXPRs. + (value_dependent_expression_p): Use INTEGRAL_OR_ENUMERATION_TYPE_P. + * rtti.c (get_tinfo_decl_dynamic): Use non_reference. + * search.c (check_final_overrider): Likewise. + * semantics.c (check_accessibility_of_qualified_id): New function. + (finish_qualified_object_call_expr): Remove. + * typeck.c (target_type): Use non_reference. + (cxx_sizeof_or_alignof_type): Likewise. + (dubious_conversion_warnings): Likewise. + (convert_for_initialization): Likewise. + (non_reference): New function. + +2003-07-07 Kaveh R. Ghazi + + * decl.c (print_binding_level, print_other_binding_stack, + print_binding_stack): Merge uses of HOST_PTR_PRINTF with adjacent + stdio calls. + * ptree.c (cxx_print_decl, cxx_print_binding): Likewise. + +2003-07-07 Andreas Jaeger + + * friend.c: Convert to ISO C90 prototypes. + + * Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output + language. + * cfns.h: Regenerate. + + * typeck.c: Convert remaining prototypes to ISO C90. + * search.c: Likewise. + + * decl2.c (build_expr_from_tree): Convert prototype to ISO C90. + * semantics.c (expand_or_defer_fn): Likewise + * mangle.c (discriminator_for_string_literal): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + + * search.c (lookup_base_r): Remove unused variable. + +2003-07-07 Nathan Sidwell + + * semantics.c: (genrtl_try_block) Adjust emit_line_note + calls. + +2003-07-07 Andreas Jaeger + + * search.c (lookup_base_r): Remove unused variable. + +2003-07-06 Michael Chastain + + PR debug/10055 + * lex.c (cxx_init): Call push_srcloc and pop_srcloc rather than + assigning to input_filename directly. + +2003-07-06 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-tree.h: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * error.c: Likewise. + * method.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + +2003-07-06 Mark Mitchell + + PR c++/11345 + * search.c (lookup_base_r): Remove is_non_public and + within_current_scope parameters. Remove other dead code. + (lookup_base): Adjust call to lookup_base_r. + (adjust_result_of_qualified_name_lookup): Improve comment. + * semantics.c (finish_call_expr): Use maybe_dummy_object. + +2003-07-06 Neil Booth + + * cp-lang.c (LANG_HOOKS_HANDLE_FILENAME, + LANG_HOOKS_MISSING_ARGUMENT): Override. + +2003-07-05 Mark Mitchell + + PR c++/11431 + * typeck.c (build_static_cast): Check for reference conversions + earlier. + +2003-07-04 Mark Mitchell + + * cp-tree.h (perform_integral_promotions): Declare. + * call.c (build_addr_func): Use decay_conversion. + (convert_arg_to_ellipsis): Likewise. Remove misleading comment. + (convert_for_arg_passing): Use perform_integral_promotions. + * cvt.c (build_expr_type_conversion): Use decay_conversion. + (type_promotes_to): Do not return a cv-qualified type. + * decl.c (grok_reference_init): Fix formatting. + (get_atexit_node): Use decay_conversion. + (build_enumerator): Use perform_integral_promotions. + * init.c (build_vec_init): Use decay_conversion. + * semantics.c (finish_expr_stmt): Likewise. + (finish_switch_cond): Use perform_integral_promotions. + * typeck.c (default_conversion): Likewise. + (perform_integral_promotions): New function. + (build_indirect_ref): Use decay_conversion. + (build_array_ref): Use perform_integral_promotions. + (convert_arguments): Use decay_conversion. + (build_unary_op): Use perform_integral_promotions. + (build_c_cast): Use decay_conversion. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-07-04 Kazu Hirata + + * call.c: Fix comment typos. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl2.c: Likewise. + * decl.c: Likewise. + * init.c: Likewise. + * mangle.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2003-07-04 Zack Weinberg + + * parser.c (cp_lexer_read_token): No need to handle string + constant concatenation. + +2003-07-03 Kaveh R. Ghazi + + * cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with + ATTRIBUTE_GCC_CXXDIAG. + +2003-07-03 Mark Mitchell + + * call.c (build_addr_func): Handle bound pointers-to-members. + (build_method_call): Do not call resolve_offset_ref. + (implicit_conversion): Likewise. + (resolve_scoped_fn_name): Use finish_non_static_data_member, not + resolve_offset_ref. + (resolve_args): Do not call resolve_offset_ref. + (build_conditional_expr): Likewise. + (build_new_method_call): Likewise. + * cp-tree.def (OFFSET_REF): Update documentation. + * cvt.c (cp_convert_to_pointer): Update handling of conversions from + pointers to members to pointers. + (ocp_convert): Do not call resolve_offset_ref. + (convert_to_void): Likewise. + (build_expr_type_conversion): Likewise. + * decl2.c (delete_sanity): Likewise. + * init.c (resolve_offset_ref): Simplify greatly. + (build_vec_delete): Do not call resolve_offset_ref. + * parser.c (cp_parser_postfix_expression): Call resolve_offset_ref + if appropriate. + (cp_parser_unary_expression): Use + cp_parser_simple_cast_expression. + (cp_parser_delete_expression): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_pm_expression): Use cp_parser_binary_op. + (cp_parser_simple_cast_expression): New function. + * rtti.c (build_dynamic_cast_1): Do not call resolve_offset_ref. + * semantics.c (finish_increment_expr): Likewise. + (finish_typeof): Likewise. + * tree.c (lvalue_p_1): Do not handle OFFSET_REF. + * typeck.c (require_complete_type): Do not handle OFFSET_REFs. + (decay_conversion): Do not call resolve_offset_ref. + (finish_class_member_access_expr): Likewise. + (convert_arguments): Likewise. + (build_x_binary_op): Handle DOTSTAR_EXPR. + (condition_conversion): Do not call resolve_offset_ref. + (unary_complex_lvalue): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_assignment): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + (build_m_component_ref): Simplify. + + * call.c (build_scoped_method_call): Use convert_to_void. + (build_method_call): Likewise. + * class.c (check_field_decls): Remove dead code. + * cvt.c (convert_from_reference): Remove OFFSET_TYPE handling. + * decl2.c (grok_array_decl): Remove dead code. + (arg_assoc_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE + as pointer-to-member representation. + * init.c (build_offset_ref): Tidy. + (build_vec_delete_1): Use convert_to_void. + * mangle.c (write_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE + as pointer-to-member representation. + +2003-07-03 Nathan Sidwell + + PR c++/9162 + * decl.c (grokdeclarator): Return friend decls, not + void_type_node. + * decl2.c (grokfield): Alter friend decl check. + * parser.c (struct cp_parser): Document default_arg chain on + unparsed_functions_queue. + (cp_parser_save_default_args): New. + (cp_parser_init_declarator, cp_parser_function_definition, + cp_parser_member_declaration): Call it. + (cp_parser_class_specifier): Remove unused variable. Alter + processing of unparsed_functions_queue. + +2003-07-03 Kaveh R. Ghazi + + * class.c (add_method, check_field_decl): Fix format specifier. + * decl.c (duplicate_decls, pushdecl, check_goto, + fixup_anonymous_aggr, maybe_commonize_var, grokdeclarator, + start_enum): Likewise. + * decl2.c (ambiguous_decl): Likewise. + * pt.c (redeclare_class_template): Likewise. + +2003-07-02 Nathan Sidwell + + PR c++/10219 + * pt.c (type_unification_real): Don't unify exprs of error type. + * tree.c (error_type): Don't die on error_type. + + PR c++/9779 + * decl2.c (arg_assoc_class): Don't die on NULL type. + * typeck.c (type_unknown_p): Don't die on untyped expressions. + +2003-07-01 Mark Mitchell + + PR c++/6949 + * decl2.c (grokfield): Create TEMPLATE_DECLs for methods in local + classes. + +2003-07-01 Kaveh R. Ghazi + + * error.c (locate_error): %P takes an `int', not a `tree'. + +2003-07-02 Jan Hubicka + + * decl2.c (defer_fn): Set DECL_DEFER_OUTPUT. + (finish-file): Do not process function with DECL_DEFER_OUTPUT clear; + clear DECL_DEFER_OUTPUT once function is processed; avoid flags + massaging. + + * cp-tree.h (DECL_NEEDED_P): Support unit-at-a-time + (expand_or_defer_fn): Declare. + (lower_function): Declare. + * decl.c (start_cleanup_fn): Use expand_or_defer_fn. + * decl2.c: Include cgraph.h and varpool.h + (maybe_emit_vtables): Make explicit instantations as needed. + (mark_member_pointers, lower_function): New functions. + (finish_file): Do unit-at-a-time. + * method.c (synthesize_method): Use expand_or_defer_fn. + * optimize.c (maybe_clone_body): Use expand_or_defer_fn. + * parser.c (cp_parser_function_definition_after_decl): Use + expand_or_defer_fn. + * pt.c (instantiate_decl): Likewise. + * semantics.c: Include cgraph.h + (expand_or_defer_fn): Break out from ... + (expand_body): ... here; deal with unit-at-a-time. + * cp-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, + LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Define. + +2003-07-01 Mark Mitchell + + * call.c (resolve_scoped_fn_name): Return error_mark_node for + erroneous cases. + +2003-07-01 Mark Mitchell + + PR c++/11149 + * call.c (resolve_scoped_fn_name): Check that the qualifying scope + is a class type. + +2003-07-01 Giovanni Bajo + + PR c++/8046 + * error.c (dump_decl): Handle BIT_NOT_EXPR as + pseudo destructor calls. + +2003-07-01 Nathan Sidwell + + * cp-tree.h (define_label): Replace filename and lineno + arguments with a location_t. + * decl.c (pop_label): Adjust define_label call. + (define_label): Replace filename and lineno arguments with a + location_t. + * semantics.c (finish_label): Adjust define_label call. + +2003-07-01 Mark Mitchell + + PR c++/9559 + * decl2.c (grokfield): Do not build NOP_EXPRs around the + error_mark_node. + +2003-06-30 Neil Booth + + * Make-lang.in: Update. + * cp-lang.c (c_language): Define. + (LANG_HOOKS_INIT_OPTIONS): Use common hook. + * cp-tree.h (cxx_init_options): Remove. + * lex.c: Don't include diagnostic.h. + (cxx_init_options): Remove. + +2003-06-30 Giovanni Bajo + + PR c++/4933 + * error.c (dump_expr): Support correctly the COMPOUND_EXPR + tree generated within a template. Use dump_expr to dump an + expression sizeof. + +2003-06-30 Giovanni Bajo + + * mangle.c (write_expression): Exit gracefully when trying to + mangle a CALL_EXPR. + +2003-06-30 Giovanni Bajo + + PR c++/10750 + * parser.c (cp_parser_primary_expression): A VAR_DECL with a + (value- or type-) dependent expression as DECL_INITIAL is a + valid constant-expression (at parser time). + +2003-06-30 Giovanni Bajo + + PR c++/11106 + * error.c (dump_decl): Call dump_decl to dump the DECL_NAME for a + USING_DECL, instead of print_tree_identifier. + +2003-06-29 Gabriel Dos Reis + + * cp-tree.h (language_to_string): Adjust declaration. + * dump.c (cp_dump_tree): Adjust usage. + * error.c (dump_char): Use output_formatted_scalar. Tidy. + (parm_to_string): Lose unused parameter. Tidy. + (expr_to_string): Likewise. + (code_to_string): Likewise. + (language_to_string): Likewise. + (op_to_string): Likewise. + (assop_to_string): Likewise. + (digit_buffer): Remove. + (dump_type): Format builtin vector type as __vector__. + +2003-06-29 Gabriel Dos Reis + + * error.c (print_integer): Remove. + (dump_type_suffix): Adjust. + (dump_expr): Likewise. + +2003-06-28 Nathan Sidwell + + * error.c (print_instantiation_partial_context): Take a + location_t. + (print_instantiation_full_context): Adjust. + (print_instantiation_context): Adjust. + + * cp-tree.h (cp_line_of, cp_file_of): Remove. + * error.c (cp_line_of, cp_file_of): Merge into ... + (location_of): ... here. Make static, return a location_t. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust. + +2003-06-28 Nathan Sidwell + + PR c++/10784 + * call.c (joust): Move warn_conversion check outwards. + +2003-06-27 Zack Weinberg + + * decl.c (build_typename_type) + * mangle.c (write_template_template_arg) + * parser.c (cp_parser_scope_through_which_access_occurs) + * pt.c (push_access_scope_real, push_access_scope, pop_access_scope) + * repo.c (get_base_filename) + * semantics.c (maybe_convert_cond): + Mark the definition static, matching the forward declaration. + +2003-06-27 Mark Mitchell + + PR c++/10468 + * pt.c (tsubst): Handle qualified TYPEOF_TYPEs correctly. + +2003-06-27 Mark Mitchell + + PR c++/10796 + * decl.c (finish_enum): Implement DR377. + + * decl.c (cp_finish_decl): Don't make variables with reference + type readonly while they are being initialized. + +2003-06-26 Mark Mitchell + + PR c++/11332 + * typeck.c (build_static_cast): Avoid returning expressions with + reference type. + +2003-06-26 Nathan Sidwell + + * call.c (build_op_delete_call): Use strip_array_call. Correct + error message to say 'delete' or 'delete[]'. + +2003-06-26 Giovanni Bajo + + PR c++/8266 + * pt.c (check_explicit_specialization): When looking up a + template function from an identifier outside class-scope, bind + it to CP_DECL_CONTEXT. + +2003-06-25 Mark Mitchell + + PR c++/10990 + * search.c (lookup_base_r): Rely on accessible_p, rather than + trying to emulate that logic here. + + PR c++/10931 + * call.c (convert_like): Pass issue_conversion_warnings. + (convert_like_with_context): Likewise. + (convert_like_real): Add issue_conversion_warnings parameter. + (perform_direct_initialization_if_possible): New function. + * cp-tree.h (perform_direct_initialization_if_possible): Declare it. + * typeck.c (check_for_casting_away_constness): New function. + (build_static_cast): Rewrite. + +2003-06-24 Nathan Sidwell + + * call.c (enforce_access): Assert we get a binfo. + (build_op_delete_call): Pass a binfo to + perform_or_defer_access_check. + * class.c (alter_access): Likewise. + * decl.c (make_typename_type): Likewise. + (make_unbound_class_template): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * parser.c (cp_parser_lookup_name): Likewise. + * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE + test. + * semantics.c (finish_non_static_data_member): Likewise. + (perform_or_defer_access_check): Expect a binfo. + * typeck.c (comptypes): Expect types. + + * mangle.c (find_substitution): Don't pass a non-type to same_type_p + * friend.c (make_friend_class): Likewise. + * pt.c (check_default_tmpl_args): Likewise. + (lookup_template_class): Likewise. + +2003-06-24 Jan Hubicka + + * method.c (thunk_labelno): Move outside ifdef block to make garbage + collector happy. + +2003-06-24 Jan Hubicka + + * class.c (build_vtable): Make vtables. + * cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro. + * decl2.c (output_vtable_inherit): Rename to ... + (prepare_assemble_variable): ... this one; change interface. + (maybe_emit_vtables): Do not call output_vtable_inherit. + * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define. + * cp-tree.h (prepare_assemble_variable): New. + +2003-06-23 Andrew Pinski + + * method.c: add prototype for make_alias_for_thunk. + (thunk_labelno, make_alias_for_thunk): only define + if ASM_OUTPUT_DEF is defined. + +2003-06-23 Jakub Jelinek + + * method.c (thunk_labelno): New variable. + (make_alias_for_thunk): New function. + (use_thunk): Use it if defined ASM_OUTPUT_DEF. Put the thunk + into the same section as the function it is calling. + Include gt-cp-method.h. + * Make-lang.in (gt-cp-method.h): Depend on s-gtype. + (cp/method.o): Depend on gt-cp-method.h. + * config-lang.in (gtfiles): Add $(srcdir)/cp/method.c. + +2003-06-23 Jan Hubicka + + * decl.c (register_dtor_fn): Mark cleanup as used. + * decl2.c (mark_vtable_entries): Skip nops. + * rtti.c (get_tinfo_ptr): Mark tinfo as used. + (build_dynamic_cast_1): Likewise. + (tinfo_base_init): Likewise. + (emit_tinfo_decl): Likewise. + +2003-06-23 Jakub Jelinek + + * mangle.c (hash_type): Val is the TREE_LIST itself, not a pointer + to it. + +2003-06-21 Gabriel Dos Reis + + PR c++/10784 + * call.c (joust): Warn about choosing conversion sequence only if + -Wconversion. + +2003-06-21 Gabriel Dos Reis + + PR c++/10864 + * call.c (op_error): Tidy. + * error.c (dump_expr): Properly format 'T()' when T is an + aggregate type. + +2003-06-21 Gabriel Dos Reis + + PR c++/10915 + * decl.c (grok_op_properties): Warn possible confusing conversion + only if -Wconversion. + +2003-06-20 Mark Mitchell + + PR c++/10749 + * parser.c (cp_parser_class_head): See through dependent names + when parsing a class-head. + + PR c++/10845 + * pt.c (try_class_unification): Correct handling of member class + templates. + +2003-06-20 Nathan Sidwell + + * semantics.c (genrtl_finish_function): Adjust + expand_function_end call. + +2003-06-19 Mark Mitchell + + PR c++/10939 + * pt.c (tsubst_decl): Do not try to substitute into non-dependent + functions. + (value_dependent_expression_p): Correct logic for FUNCTION_DECLs. + + PR c++/9649 + * cp-tree.h (pushdecl_class_level): Change prototype. + (push_class_level_binding): Likewise. + * decl.c (add_binding): Reject duplicate static data members. + (pushdecl_class_level): Return a value indicating whether or not + the binding was valid. + (push_class_level_binding): Likewise. + * semantics.c (finish_member_declaration): Don't keep invalid + declarations. + + PR c++/11041 + * call.c (initialize_reference): Do not use cp_finish_decl to emit + temporary variables. + * cp-tree.h (static_aggregates): Declare. + (pushdecl_top_level_and_finish): Likewise. + * decl.c (pushdecl_top_level_1): New function. + (pushdecl_top_level): Use it. + (pushdecl_top_level_and_finish): New function. + (initialize_local_var): Remove redundant code. + (cp_finish_decl): Remove support for RESULT_DECLs. Don't check + building_stmt_tree. + * decl.h (static_aggregates): Remove. + * decl2.c (get_guard): Use pushdecl_top_level_and_finish. + * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish. + (tinfo_base_init): Likewise. + +2003-06-19 Matt Austern + + PR c++/11228 + * init.c (build_zero_init): Assert that number of array elements + is an integer constant. + (build_default_init) Don't use build_zero_init for arrays with + variable number of elements. + +2003-06-19 Andreas Jaeger + + * cp-tree.h: Remove duplicated declarations. + +2003-06-18 Nathanael Nerode + + * pt.c: Convert to ISO C. + * semantics.c: Convert to ISO C. + +2003-06-18 Nathan Sidwell + + * cp-tree.h (comp_except_specs, compparms, cp_has_mutable_p, + at_least_as_qualified_p, more_qualified_p): Return bool. + * typeck.c: ANSIFY function definitions. + (comp_array_types): Take redeclaration bool parameter. + (comptypes): Rearrange STRICT handling. + (at_least_as_qualified_p, more_qualified_p, + comp_cv_qualification): Cache cv quals. + (compparms): Rearrange loop. + +2003-06-18 Nathan Sidwell + + * cp-tree.h (COMPARE_RELAXED): Rename to ... + (COMPARE_DERIVED): ... here. Adjust comment. + (resolve_typename_type_in_current_instantiation): Remove. + (cp_tree_equal, comptypes): Return a bool. + * cvt.c (convert_to_reference): Adjust comptypes call. + * pt.c (template_args_equal, unify,): Adjust cp_tree_equal call. + (resolve_typename_type_in_current_instantiation): Remove. + * tree.c (cp_tree_equal): Return bool. Cope with TEMPLATE_DECLs and + IDENTIFIER_NODEs. Abort if undeciderable. Adjust recursive + calls. Refactor code. + * typeck.c (comp_array_types): Return bool. Lose callback. + parameter. Adjust cp_tree_equal calls. + (comptypes): Return bool. Adjust strict handling. Remove relaxed + enumeration and java type handling. Deal with typename types here. + Adjust recursive and cp_tree_equals calls. Adjust base and derived + checking. + (comp_target_types): Remove unreachable code. Adjust + same_or_base_type_p calls. + (ptr_reasonably_similar): Adjust base and derived check. + + * typeck.c (maybe_warn_about_returning_address_of_local): Remove + unused calculation. + (check_return_expr): Adjust error messages. + * cp-tree.def (SCOPE_REF): Correct comment. + +2003-06-17 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format + string again. + +2003-06-17 Robert Abeles + + * optimize.c (dump_function): Form complete flag name by + prefixing 'fdump-' to string returned by dump_flag_name(). + +2003-06-17 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format + string. + +2003-06-17 Jason Merrill + + PR c++/10929 + * decl.c (grokfndecl): Don't mark a function inline for + -finline-functions if it isn't defined. + +2003-06-17 Mark Mitchell + + PR c++/10712 + * class.c (handle_using_decl): Robustify. + + PR c++/11105 + * cp-tree.h (DECL_CONV_FN_TYPE): New method. + * mangle.c (struct globals): Remove internal_mangling_p. + (write_unqualified_name): Use DECL_CONV_FN_TYPE. + (write_template_parm): Don't write out the level number. + (conv_type_names): New variable. + (hash_type): New function. + (compare_type): Likewise. + (mangle_conv_op_name_for_type): Don't try to mangle conversion + operator names. + * search.c (lookup_conversion_operator): New function. + (lookup_fnfields_1): Use it. + +2003-06-17 Andreas Jaeger + + * except.c: Remove duplicate declaration of push_eh_cleanup. + + * call.c: Remove extra declaration of inhibit_warnings. + +2003-06-16 Nathanael Nerode + + 2003-06-16 Jens-Michael Hoffmann + * mangle.c: Convert to ISO C. + +2003-06-16 Kaveh R. Ghazi + + * cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR + macro. + +2003-06-16 Nathanael Nerode + + * tree.c: Convert to ISO C. + +2003-06-16 Kazu Hirata + + * cp-tree.h: Follow spelling conventions. + * mangle.c: Likewise. + * method.c: Likewise. + * parser.c: Likewise. + +2003-06-14 Nathan Sidwell + + * decl.c (start_function): Adjust init_function_start call. + * method.c (use_thunk): Likewise. + * semantics.c (genrtl_start_function): Likewise. + +2003-06-14 Neil Booth + + * Make-lang.in: Remove c-options.o. + +2003-06-13 Nathanael Nerode + + * lex.c: Convert to ISO C. + + 2003-05-19 Jens-Michael Hoffmann + * init.c: removes use of PARAMS macro. Use ISO style function + declarations. (Not copyright-significant change.) + + * rtti.c: Remove PARAMS. + + * typeck2.c: Convert to ISO C. + +2003-06-12 Mark Mitchell + + PR c++/10635 + * typeck.c (build_c_cast): Check that the destination type is + complete. + +2003-06-11 Mark Mitchell + + PR c++/10432 + * cp-tree.h (finish_declarator): Remove. + * decl.c (cp_finish_decl): Make sure to pop_nested_class even for + erroneous declarations. + * semantics.c (finish_declarator): Remove. + +2003-06-11 Roger Sayle + + * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a + global static constructor/destructor if it will be empty, i.e. + either doesn't call any ctors/dtors or only calls pure or const + ctors/dtors. + +2003-06-11 Mark Mitchell + + * mangle.c (tm_p.h): Include it. + * Make-lang.in (cp/mangle.o): Depend on $(TM_P_H). + + PR c++/11131 + * tree.c (cp_cannot_inline_fn): Check for "inline" before + instantiation. + +2003-06-10 Jason Merrill + + PR c++/10968 + * pt.c (mark_decl_instantiated): Clear DECL_COMDAT. + +2003-06-10 Andrew Pinski + + * decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY. + (start_cleanup_cnt): New. + +2003-06-10 Mark Mitchell + + PR c++/11131 + * cp-tree.h (template_for_substitution): Declare. + * decl2.c (mark_used): Use it when figuring out whether or not a + function is inline. + * pt.c (template_for_substitution): Give it external linkage. + * tree.c (cp_cannot_inline_tree_fn): Instantiate as early as + possible. + +2003-06-09 Zack Weinberg + + PR 8861 + * mangle.c (write_real_cst): New function. Implement + ABI-compliant mangling of floating-point literals when + -fabi-version>=2; provide backward compatibility with 3.3 when + -fabi-version=1 (with warning). Clarify commentary. + (write_template_arg_literal): Use write_real_cst. + +2003-06-07 Andreas Jaeger + + * cp/decl.c (xref_tag): Remove undefined macro NONNESTED_CLASSES. + +2003-06-07 Neil Booth + + * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. + (LANG_HOOKS_HANDLE_OPTION): Override. + * cp-tree.h (cxx_init_options): Update. + * lex.c (cxx_init_options): Update. + +2003-06-05 Jan Hubicka + + * Make-lang.in: Add support for stageprofile and stagefeedback + +2003-06-04 J"orn Rennecke + + * decl.c (grokdeclarator): Error_mark_node in, error_mark_node out. + +2003-06-04 Andreas Jaeger + + * g++spec.c (lang_specific_driver): Remove ALT_LIBM usage. + +2003-06-03 Jason Merrill + + * cp/cp-tree.h (CP_AGGREGATE_TYPE_P): Accept vectors. + + * cp/decl.c (reshape_init): Handle vectors. + + * testsuite/g++.dg/init/array10.C: New. + +2003-06-03 Kriang Lerdsuwanakij + + PR c++/10940 + * pt.c (check_explicit_specialization): Check for 'static' + earlier. + +2003-05-31 Diego Novillo + + * class.c (dump_array): Call CONSTRUCTOR_ELTS to access + the operand of a CONSTRUCTOR node. + +2003-05-31 Gabriel Dos Reis + + * decl.c (cp_binding_level::this_entity): Rename from this_class. + (cxx_scope_descriptor): New function. + (cxx_scope_debug): Likewise. + (push_binding_level): Use it. + (pop_binding_level): Likewise. + (suspend_binding_level): Likewise. + (resume_binding_level): Likewise. + (pushlevel_class): Adjust use of this_class. + (pushtag): Likewise. + (lookup_name_real): Likewise. + (global_scope_name): New variable. + (initialize_predefined_identifiers): Initialize it. + (push_namespace): Use it. + (make_cxx_scope): New function. + (pushlevel): Use it. + (pushlevel_class): Likewise. + (push_binding_level): Simplify. Loose the last two arguments. + (make_binding_level): Remove. + (initial_push__namespace_scope): New function. + (push_namespace): Use it. Simplify. + (cxx_init_decl_processing): Likewise. + (declare_namespace_level): Remove. + +2003-05-31 Kriang Lerdsuwanakij + + PR c++/10956 + * pt.c (instantiate_decl): Don't use full template arguments if + we are dealing with specializations. + +2003-05-29 Gabriel Dos Reis + + * decl.c (ENABLE_SCOPE_CHECKING): Rename from DEBUG_BINDING_LEVELS. + (binding_depth): Unconditionally define. + (is_class_level): Likewise. + (indent): Likewise. Take an indenting parameter. + (push_binding_level): Remove conditional definittion. + (pop_binding_level): Likewise. + (suspend_binding_level): Likewise. + (resume_binding_level): Likewise. + (pushlevel): Likewise. + (pushlevel_class): Likewise. + (poplevel_class): Likewise. + (pop_everything): Likewise. + +2003-05-27 Gabriel Dos Reis + + * name-lookup.h (global_scope_p): New macro. + * decl.c (pop_binding_level): Use it. Don't refer directly to + global_binding_level. + (suspend_binding_level): Likewise. + (global_bindings_p): Likewise. + (print_other_binding_stack): Likewise. + (print_binding_stack): Likewise. + (maybe_push_to_top_level): Likewise. + (pushdecl_namespace_level): Likewise. + (cxx_init_decl_processing): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (start_function): Likewise. + (global_binding_level): Remove. + +2003-05-25 Kriang Lerdsuwanakij + + * parser.c (cp_parser_explicit_instantiation): Restore old + access before template instantiation. + +2003-05-23 Geoffrey Keating + + * lang-specs.h: Use -o to specify preprocessor's output file. + Make -no-integrated-cpp work when building PCH files. + +2003-05-23 Kriang Lerdsuwanakij + + PR c++/10682 + * pt.c (instantiate_class_template): Use DECL_ARTIFICIAL to + check for implicitly created typedef to an enum. + +2003-05-21 Jason Merrill + + * init.c (build_vec_delete): Copy the address into a temporary + variable before calling build_vec_delete_1. + * decl2.c (delete_sanity): Don't call stabilize_reference. + +2003-05-21 Nathan Sidwell + + * pt.c (register_specialization): Update the decl's location, + if necessary. + (check_explicit_specialization): Likewise. + +2003-05-20 Kaveh R. Ghazi + + * error.c (dump_expr): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX. + +2003-05-21 Danny Smith + + PR c++/9738 + * decl.c (duplicate_decls): Re-invoke make_decl_rtl + if the old decl had instantiated DECL_RTL. + (Base on Richard Henderson 2003-05-13 patch to c-decl.c). + +2003-05-19 Matt Austern + + * lang-options.h: Document -Wno-invalid-offsetof + * typeck.c (build_class_member_access_expr): Don't complain about + (Foo *)p->x for non-POD Foo if warn_invalid_offset is zero. + +2003-05-18 Andrew Pinski + + * name-lookup.c (free_binding_entry): fix where the GTY markers are. + (binding_entry_make): Make entry->chain NULL after getting an entry. + fix the spelling of chain in a comment. + (binding_table_free): speed up by having temporary variable. + (binding_table_new): set table->chain to be NULL after allocating + a table. + (cxx_binding_make): use gcc_alloc instead of ggc_alloc_cleared and set + binding->previous to NULL after getting an binding for speed. + +2003-05-18 Gabriel Dos Reis + + * cp-tree.h (struct lang_type_class): Replace data member tags + with hash-table nested_udts. + (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. + * class.c (unreverse_member_declarations): Don't touch + CLASSTYPE_TAGS. + (pushclass): Use cxx_remember_type_decls. + * decl.c (struct cp_binding_level): Replace data member tags with + hash-table type_decls. + (pop_binding_level): Handle level->type_decls. + (kept_level_p): Adjust. + (poplevel): Remove unused local variable. + (bt_print_entry): New function. + (print_binding_level): Use it. + (push_namespace): Build current_binding_level->type_decls. + (maybe_process_template_type_declaration): Adjust. + (pushtag): Likewise. + (clear_anon_tags): Use binding_table_remove_anonymous_types. + (gettags): Remove. + (cxx_remember_type_decls): Rename from storetags. Adjust. + (lookup_tag): Use binding_table_find_anon_type. Tidy. + (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. + (cxx_init_decl_processing): Build global_binding_level->type_decls. + (store_parm_decls): Remove pointless code. + * name-lookup.c (free_binding_entry): New variable. + (ENTRY_INDEX): New macro. + (struct binding_table_s): New datatype. + (binding_entry_make): New function. + (binding_entry_free): Likewise. + (binding_table_construct): Likewise. + (binding_table_free): Likewise. + (binding_table_new): Likewise. + (binding_table_expand): Likewise. + (binding_table_insert): Likewise. + (binding_table_find): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (binding_table_remove_anonymous_types): Likewise. + (binding_table_foreach): Likewise. + * name-lookup.h (binding_table): New type. + (binding_entry): Likewise. + (bt_foreach_proc): Likewise. + (struct binding_entry_s): New datatype. + (SCOPE_DEFAULT_HT_SIZE): New macro. + (CLASS_SCOPE_HT_SIZE): Likewise. + (NAMESPACE_ORDINARY_HT_SIZE): Likewise. + (NAMESPACE_STD_HT_SIZE): Likewise. + (GLOBAL_SCOPE_HT_SIZE): Likewise. + (binding_table_new): Declare. + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (binding_table_remove_anonymous_types): Likewise. + (binding_table_foreach): Likewise. + (binding_table_find): Likewise. + (cxx_remember_type_decls): Likewise. + * pt.c (bt_instantiate_type_proc): New function. + (do_type_instantiation): Use it. + * search.c (lookup_field_r): Use binding_table_find. + +2003-05-18 Kriang Lerdsuwanakij + + * semantics.c (perform_deferred_access_checks): Don't discard + checked access. + +2003-05-17 Kaveh R. Ghazi + + * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate + libiberty VA_ macros, always use stdarg. + * rtti.c (create_pseudo_type_info): Likewise. + * tree.c (build_min_nt, build_min): Likewise. + +2003-05-16 Kaveh R. Ghazi + + * ptree.c (cxx_print_type, cxx_print_xnode): Use string + concatentation on HOST_WIDE_INT_PRINT_* format specifier to + collapse multiple function calls into one. + * tree.c (debug_binfo): Likewise. + +2003-05-15 Jason Merrill + + PR c++/5388 + * call.c (conditional_conversion): Don't consider implicit + conversions if T2 is a base of T1. + * cp-tree.h (DERIVED_FROM_P, UNIQUELY_DERIVED_FROM_P): Make boolean. + (ACCESSIBLY_UNIQUELY_DERIVED_P, PUBLICLY_UNIQUELY_DERIVED_P): Likewise. + + * parser.c (cp_parser_primary_expression): Convert a static data + member from reference. + +2003-05-15 Mark Mitchell + + * call.c (build_op_delete_call): Avoid creating unnecessary types. + * class.c (instantiate_type): Remove tests for tf_no_attributes. + * cp-tree.h (tsubst_flags_t): Remove tf_no_attributes. + (COMPARE_NO_ATTRIBUTES): Remove. + * typeck.c (comptypes): Do not check COMPARE_NO_ATTRIBUTES. + + PR c++/8385 + * semantics.c (finish_typeof): Refine type-dependency check. + +2003-05-13 Jason Merrill + + * typeck.c (build_modify_expr): Don't always stabilize the lhs and + rhs. Do stabilize the lhs of a MODIFY_EXPR used on the lhs. + +2003-05-11 Kriang Lerdsuwanakij + + * method.c (synthesize_method): Call push/pop_deferring_access_checks. + +2003-05-11 Kriang Lerdsuwanakij + + PR c++/10230, c++/10481 + * semantics.c (finish_non_static_data_member): Handle when the + non-static member is not from a base of the current class type. + +2003-05-11 Kriang Lerdsuwanakij + + PR c++/10552 + * pt.c (tsubst_copy): Handle TEMPLATE_DECL that is a member class + template and has dependent context. + +2003-05-10 Kriang Lerdsuwanakij + + * pt.c (instantiate_decl): Call push/pop_deferring_access_checks. + +2003-05-10 Kriang Lerdsuwanakij + + PR c++/9252 + * cp-tree.h (saved_scope): Remove check_access field. + (tsubst_flags_t): Remove tf_parsing. + * decl.c (maybe_push_to_top_level): Don't initialize + scope_chain->check_access. + (make_typename_type, make_unbound_class_template): Don't use + tf_parsing. + (register_dtor_fn): Use push/pop_deferring_access_checks + instead of scope_chain->check_access. + * method.c (use_thunk): Likewise. + * parser.c (cp_parser_explicit_instantiation + (cp_parser_constructor_declarator_p): Don't call + push/pop_deferring_access_checks here. + (cp_parser_template_argument, cp_parser_class_name): Don't use + tf_parsing. + (yyparse): Check flag_access_control. + * pt.c (instantiate_class_template): Call + push/pop_deferring_access_checks. + * semantics.c (push_deferring_access_checks): Propagate + dk_no_check. + (perform_or_defer_access_check): Make sure basetype_path is + a type before comparison. + * call.c (build_op_delete_call, build_over_call): Use + perform_or_defer_access_check. + * class.c (alter_access): Likewise. + * init.c (build_offset_ref): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * search.c (lookup_member): Likewise. + * semantics.c (finish_non_static_data_member): Likewise. + (simplify_aggr_init_exprs_r): Use push/pop_deferring_access_checks + instead of flag_access_control. + +2003-05-10 Kriang Lerdsuwanakij + + PR c++/9554 + * parser.c (cp_parser_class_name): Remove check_access parameter. + All caller adjusted. Update declaration. + (cp_parser_lookup_name): Likewise. + * semantics.c (push_deferring_access_checks): Change parameter type + to enum deferring_kind. All caller adjusted. + (resume_deferring_access_checks): Adjust to use new enum. + (stop_deferring_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + * cp-tree.h (deferring_kind): New enum. + (deferred_access): Adjust field type. + (push_deferring_access_checks): Update declaration. + +2003-05-09 Kriang Lerdsuwanakij + + PR c++/10555, c++/10576 + * pt.c (lookup_template_class): Handle class template with + multiple levels of parameters when one of the levels contain + errors. + +2003-05-08 Jason Merrill + + * init.c (build_new_1): Don't reuse a TARGET_EXPR in an + expression. Undo some of the recent reorg. + +2003-05-07 Richard Henderson + + PR c++/10570 + * cfns.gperf: Comment out POSIX thread cancellation points, + plus abort and raise. + * cfns.h: Regenerate. + +2003-05-07 Jason Merrill + + * call.c (build_conditional_expr): Don't assume that the folded + expression has result_type. + +2003-05-06 Kriang Lerdsuwanakij + + * typeck.c (build_unary_op): Deal with const qualifier in + invalid pointer-to-member earlier. + +2003-05-05 Jason Merrill + + PR c++/9537 + * call.c (conditional_conversion): Build an RVALUE_CONV if + we're just changing the cv-quals. + (build_conditional_expr): Don't call convert to change + cv-quals. + +2003-05-05 Kriang Lerdsuwanakij + + PR c++/10496 + * typeck.c (build_unary_op): Don't output const qualifier when + output invalid pointer-to-member diagnostics. + +2003-05-05 Kriang Lerdsuwanakij + + * decl.c: Fix typos. + +2003-05-05 Kriang Lerdsuwanakij + + PR c++/4494 + * decl.c (start_function): Use same_type_p to check return type + of main. + +2003-05-03 Zack Weinberg + + PR c/10604 + * cp/typeck.c (build_x_compound_expr): No need to check + extra_warnings as well as warn_unused_value. + +2003-05-03 Kriang Lerdsuwanakij + + PR c++/9364, c++/10553, c++/10586 + * decl.c (make_typename_type): Don't crash on illegal code. + +2003-05-03 Nathan Sidwell + + * class.c (finish_struct): Use location_t and input_location + directly. + * decl.c (make_label_decl): Likewise. + (use_label): Likewise. + * decl2.c (warn_if_unknown_interface): Likewise. + (start_static_initialization_or_destruction): Likewise. + (generate_ctor_or_dtor_function): Likewise. + (finish_file): Likewise. + * error.c (print_instantiation_full_context): Likewise. + * init.c (create_temporary_var): Likewise. + * method.c (synthesize_method): Likewise. + * parser.c (cp_token): Likewise. + (cp_lexer_set_source_position_from_token): Likewise. + (cp_lexer_get_preprocessor_token): Likewise. + (cp_parser_statement): Likewise. + * pt.c (tsubst_friend_function): Likewise. + (instantiate_class_template): Likewise. + (tsubst_decl): Likewise. + (tsubst): Likewise. + (instantiate_decl): Likewise. + * semantics.c (begin_class_definition): Likewise. + (expand_body): Likewise. + +2003-05-01 Nathan Sidwell + + * class.c (finish_struct): Rename lineno to input_line. + * decl.c (push_binding_level, pop_binding_level, + suspend_binding_level, resume_binding_level, make_label_decl, + use_label, start_function): Likewise. + * decl2.c (warn_if_unknown_interface, + start_static_initialization_or_destruction, + generate_ctor_or_dtor_function, finish_file): Likewise. + * error.c (cp_line_of, print_instantiation_full_context, + print_instantiation_context): Likewise. + * except.c (check_handlers_1, check_handlers): Likewise. + * init.c (create_temporary_var): Likewise. + * method.c (use_thunk, synthesize_method): Likewise. + * parser.c (cp_lexer_set_source_position_from_token, + cp_lexer_get_preprocessor_token): Likewise. + * pt.c (push_tinst_level, pop_tinst_level, + tsubst_friend_function, instantiate_class_template, tsubst_decl, + tsubst, tsubst_expr, instantiate_decl): Likewise. + * semantics.c (genrtl_try_block, finish_label_stmt, + begin_class_definition, expand_body, + genrtl_finish_function): Likewise. + * tree.c (build_min_nt, build_min): Likewise. + +2003-05-01 Mark Mitchell + + * decl2.c (comdat_linkage): Don't externalize explicit + instantiations. + +2003-05-01 Kriang Lerdsuwanakij + + PR c++/10554 + * decl2.c (do_class_using_decl): Check if operand 0 of SCOPE_REF + is not NULL. + +2003-05-01 Steven Bosscher + + * cp-tree.h (struct lang_id2): Remove. Move fields from here... + (struct lang_identifier): ... to here. + (LANG_ID_FIELD): Remove. + (SET_LANG_ID): Remove. + (IDENTIFIER_LABEL_VALUE): Adjust for new lang_identifier. + (SET_IDENTIFIER_LABEL_VALUE): Likewise. + (IDENTIFIER_IMPLICIT_DECL): Likewise. + (SET_IDENTIFIERL_IMPLICIT_DECL): Likewise. + (IDENTIFIER_ERROR_LOCUS): Likewise. + (SET_IDENTIFIER_ERROR_LOCUS): Likewise. + +2003-05-01 Kriang Lerdsuwanakij + + PR c++/8772 + * pt.c (convert_template_argument): Correct diagnostic. + +2003-04-30 Kriang Lerdsuwanakij + + PR c++/9432, c++/9528 + * decl2.c (validate_nonmember_using_decl): Handle SCOPE_REF. + +2003-04-30 Garbiel Dos Reis + + * decl.c (check_previous_goto_1): Adjust prototype. + (check_previous_goto): Adjust use. + (check_switch_goto): Likewise. + (use_label): Adjust. + (check_previous_goto_1): Don't use pedwarn_with_file_and_line. + (struct named_label_use_list): Use location_t datatype. + +2003-04-29 Mark Mitchell + + PR c++/10551 + * pt.c (mark_decl_instantiated): Defer all explicit instantiations + that have not yet been written out. + +2003-04-29 Mark Mitchell + + PR c++/10549 + * class.c (layout_class_type): Mark overlong bitfields as having + the maximum size permitted by their type, after layout. + + PR c++/10527 + * error.c (dump_expr): Correctly handling of NEW_EXPR.4 + +2003-04-29 Kriang Lerdsuwanakij + + * call.c (build_operator_new_call): Fix typo. + * lang-options.h: Likewise. + +2003-04-29 Mark Mitchell + + PR c++/10515 + * cp-tree.h (lookup_field_1): Declare it. + * search.c (lookup_field_1): Make it public. + * decl.c (reshape_init): Handle designated initializers. + + * decl.c (maybe_commonize_var): Further tweak support for systems + without weak symbols. + +2003-04-27 Mark Mitchell + + * decl.c (maybe_commonize_var): Fix thinko in last patch. + +2003-04-27 Mark Mitchell + + PR c++/10506 + * method.c (use_thunk): Decrement immediate_size_expand. + + PR c++/10503 + * cp-tree.h (DECL_VAR_MARKED_P): New macro. + (DECL_MAYBE_TEMPLATE): Remove. + * class.c (fixed_type_or_null): Avoid infinite recursion. + + * decl.c (maybe_commonize_var): Make the code match the comments. + * pt.c (instantiate_decl): Move call to import_export_decl. + +2003-04-26 Mark Mitchell + + * decl2.c (finish_file): Fix merge botch. + +2003-04-25 Mark Mitchell + + * decl2.c (finish_file): Don't call import_export_decl for + functions that are not defined. + (handle_class_head): Robustify. + * pt.c (instantiate_decl): Do not call cp_finish_decl for + variables that are not defined. + +2003-04-24 Sylvain Pion + + * call.c (print_z_candidates): Fix off by one error. + +2003-04-24 Nathan Sidwell + + PR c++/10337 + * call.c (joust): Don't warn about conversion ops that are exact + or cv-conversions. Rearrange to avoid multiple type comparisons. + +2003-04-23 Mark Mitchell + + PR c++/10471 + * call.c (build_cxx_call): Robustify. + +2003-04-23 Neil Booth + + * Make-lang.in (lex.o): Remove mbchar.h. + * lex.c (MULTIBYTE_CHARS): Lose. + * parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled + in c-lex.c. + +2003-04-23 Mark Mitchell + + PR c++/9847 + * cp-tree.h (duplicate_tag_error): Remove. + * class.c (duplicate_tag_error): Remove. + * semantics.c (begin_class_definition): Return immediately for a + duplicate class definition. + + PR c++/10451 + * decl.c (grokdeclarator): Correct logic for "mutable" errors. + +2003-04-22 Mark Mitchell + + PR c++/10446 + * search.c (lookup_fnfields_1): Handle empty slots in the method + vector. + + PR c++/10428 + * decl.c (check_elaborated_type_specifier): New function, split + out from ... + (xref_tag): ... here. Use the new function in more places. + + * rtti.c (throw_bad_typeid): Use build_cxx_call. + +2003-04-21 Mark Mitchell + + * call.c (build_over_call): Use build_cxx_call. + (build_cxx_call): New method, split out of build_over_call. + * cp-tree.h (language_function): Add can_throw. + (build_cxx_call): Declare it. + * decl.c (finish_function): If a function does not contain any + calls to functions that can throw an exception, indicate that + fact. + * decl2.c (mark_used): Do not defer the instantiation of + functions, if the current function does not throw. + * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones. + * pt.c (instantiate_decl): Make sure import_export_decl is called + before emitting things. + * rtti.c (throw_bad_cast): Use build_cxx_call. + (build_dynamic_cast_1): Likewise. + * typeck.c (build_function_call): Likewise. + +2003-04-21 Nathan Sidwell + + PR c++/9881 + * typeck.c (build_unary_op): Fold all COMPONENT_REF addr + expressions. Reverts my 2002-08-08 patch. + + * typeck.c (comp_ptr_ttypes_real): Swap final && operands for + cheaper early exit. + +2003-04-20 Nathan Sidwell + + * cp/decl2.c (start_static_storage_duration_function): Take count + arg, don't check if it wraps round. + (generate_ctor_or_dtor_function): Add locus arg, use it. + (generate_ctor_and_dtor_functions_for_priority): Data arg is a + locus. + (finish_file): Set line numbers to past EOF for synthesized + functions. + +2003-04-20 Nathan Sidwell + + PR c++/10405 + * search.c (lookup_field_1): Final scan goes backwards for + types, forwards for non-types. + +2003-04-17 Roger Sayle + + PR c/10375 + * decl.c (duplicate_decls): Preserve "const", "noreturn" and + "nothrow" function attributes. + +2003-04-17 Kriang Lerdsuwanakij + + PR c++/10347 + * pt.c (type_dependent_expression_p): Handle array new. + +2003-04-15 Mark Mitchell + + PR c++/10381 + * parser.c (cp_parser_primary_expression): Reorganize logic for + dealing with name lookup failures. + +2003-04-15 Jason Merrill + + * decl2.c (mark_used): Don't instantiate anything if + skip_evaluation. + +2003-04-14 Ziemowit Laski + + * tree.c (build_cplus_array_type_1): Do not call + uses_template_parms() on a NULL index_type. + +2003-04-13 Roger Sayle + + * decl.c (duplicate_decls): Preserve pure and malloc attributes. + +2003-04-12 Mark Mitchell + + PR c++/10300 + * init.c (build_new_1): Reorganize. + +2003-04-12 Zack Weinberg + + * class.c (initialize_array) + * decl.c (reshape_init) + * decl2.c (build_expr_from_tree) + * init.c (build_zero_init) + * pt.c (tsubst_copy, tsubst_copy_and_build) + * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer) + (ptm_initializer, class_initializer, get_pseudo_ti_init) + * semantics.c (finish_compound_literal) + * typeck.c (build_ptrmemfunc1) + * typeck2.c (store_init_value, process_init_constructor) + (build_functional_cast): Use build_constructor. + +2003-04-12 Zack Weinberg + + * call.c (print_z_candidates): Use gcc_gettext_width, not + strlen, to determine how much padding to use. + +2003-04-10 Zack Weinberg + + * decl.c: Update all calls to shadow_warning. + +2003-04-10 Mark Mitchell + + * class.c (layout_class_type): Correct handling for overlong + bit-fields whose width is the same as an integer type. + +2003-04-06 Zack Weinberg + + * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero. + * cp-lang.c (cp_tree_size): New function. + (LANG_HOOKS_TREE_SIZE): Override. + + * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct + tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill. + (union lang_tree_node): Remove common and srcloc members. + (build_srcloc_here): Don't prototype. + * decl.c (cp_tree_node_structure): Kill SRCLOC case. + * pt.c (pending_templates): Correct comment. + * tree.c (build_srcloc, build_srcloc_here): Kill. + +2003-04-06 Zack Weinberg + + * call.c: Include intl.h. + (print_z_candidate): Always use inform; get rid of errfn + argument. Reorganize so that all the strings get picked up + by xgettext. Note obligation of caller to pass first argument + through gettext. + (print_z_candidates): Update to match. Indent second and + successive candidates by strlen() of translated message. + (joust): Restructure ambiguous-conversion pedwarn so that + translators see a complete sentence. Update calls to + print_z_candidate. + + * Make-lang.in (cp/call.o): Update dependencies. + +2003-04-05 Kaveh R. Ghazi + + * decl.c (set_current_binding_level): Delete, revert last change. + (current_binding_level): Modify to allow it as as lvalue. + +2003-04-04 Kaveh R. Ghazi + + * name-lookup.c (find_binding): Pass appropriate pointer type to + POP_TIMEVAR_AND_RETURN. + +2003-04-03 Kaveh R. Ghazi + + * Make-lang.in (cp-warn): Add $(STRICT_WARN). + * cp-tree.h: Don't insist on having GNUC. + +2003-04-03 Jason Merrill + + * cvt.c (ocp_convert): Only abort if we try to convert an object + of TREE_ADDRESSABLE type. + + * class.c (build_vtable): Set DECL_ALIGN here. + (get_vtable_decl): Not here. + (layout_vtable_decl): Or here. + (create_vtable_ptr): Or here. + (layout_class_type): Or here. + (check_bitfield_decl): Don't mess with field alignment. + +2003-04-03 Kaveh R. Ghazi + + * operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR, + DEF_ASSN_OPERATOR): Delete spurious semi-colon. + * rtti.c (dfs_class_hint_mark): Likewise. + + * decl.c (push_local_name, push_class_level_binding, + maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in + functions returning void. + * decl2.c (add_using_namespace): Likewise. + + * decl.c (print_binding_level, print_other_binding_stack, + print_binding_stack): Cast argument of %p specifier to void*. + * ptree.c (cxx_print_decl): Likewise. + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK, + VAR_FUNCTION_OR_PARM_DECL_CHECK, + VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK, + BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK, + LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__. + + * decl.c (set_current_binding_level): New macro. Use throughout + when setting the current binding level. + + * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma + in enum. + * method.c (mangling_flags): Likewise. + + * cp-tree.h (lang_type_header): Add __extension__ and use + CHAR_BITFIELD for members. + +2003-04-02 Geoffrey Keating + + PR other/9274 + * mangle.c: Include gt-cp-mangle.h. + (subst_identifiers): Mark with GTY. + * config-lang.in (gtfiles): Add cp/mangle.c. + * Make-lang.in: (gt-cp-mangle.h): New rule. + (cp/mangle.o): Depends on gt-cp-mangle.h. + +2003-04-01 Andrew Pinski + + * config-lang.in (gtfiles): Add \$(srcdir)/cp/name-lookup.c + after \$(srcdir)/cp/name-lookup.h. + * name-lookup.c: (cxx_binding_make): Use ggc_alloc_clearedinstead + of ggc_alloc. Include gt-cp-name-lookup.h at the end of the file. + * Make-lang.in: (gt-cp-name-lookup.h): Is generated by gengtype. + (cp/name-lookup.o): Depends on gt-cp-name-lookup.h. + +2003-03-31 Jason Merrill + + PR java/10145 + * class.c (check_field_decl): Don't set DECL_ALIGN. + +2003-03-30 Mark Mitchell + + PR c++/7647 + * decl.c (grokdeclarator): Tidy, slightly. + * search.c (lookup_field_1): Add want_type parameter. + (lookup_field_r): Adjust call to lookup_field_1. + +2003-03-30 Gabriel Dos Reis + + * Make-lang.in (cp/name-lookup.o): Add more dependencies. + +2003-03-30 Gabriel Dos Reis + + * cp-tree.h (binding_for_name: Move to name-lookup.h Adjust + prototype. + (cxx_scope_find_binding_for_name): Likewise. + * decl.c (find_binding: Move to name-lookup.c. + (binding_for_name): Likewise. + (cxx_scope_find_binding_for_name): Likewise. + (BINDING_LEVEL): Remove. + (push_binding): Tidy. + (push_class_binding): Likewise. + (pop_binding): Likewise. + (poplevel): Likewise. + (poplevel_class): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (push_overloaded_decl): Likewise. + (lookup_tag): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_current_level): Likewise. + (maybe_inject_for_scope_var): Likewise. + (namespace_binding): Move to name-lookup.c. + (set_namespace_binding): Likewise. + * decl2.c (lookup_using_namespace): Tidy. + (qualified_lookup_using_namespace): Likewise. + (do_toplevel_using_decl): Likewise. + * name-lookup.c: Include "timevar.h" + * name-lookup.h (cxx_scope): Declare. + (struct cxx_binding): Lose member "has_level". Adjust "scope" + member declaration. + (BINDING_SCOPE): Adjust definition. + (BINDING_HAS_LEVEL_P): Remove. + +2003-03-30 Gabriel Dos Reis + + * name-lookup.c: New file. + * name-lookup.h: Likewise.. + * decl.c (push_binding): Adjust use cxx_binding_make. + (free_bindings): Move to name-lookup.c + (pop_binding): Use cxx_binding_free. + (binding_for_name): Tidy. + * cp-tree.h: Include "name-lookup.h" + (cxx_binding_make): Move to name-lookup.h + (cxx_binding_clear): Likewise. + (struct cxx_binding): Likewise. + (LOCAL_BINDING_P): Likewise. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Likewise. + (BINDING_HAS_LEVEL_P): Likewise. + (BINDING_VALUE): Likewise. + (BINDING_TYPE): Likewise. + * config-lang.in (gtfiles): Add cp/name-lookup.h + * Make-lang.in (cp/name-lookup.o): New rule. + (CXX_OBJS): Add cp/name-lookup.o + (CXX_TREE_H): Add cp/name-lookup.h + +2003-03-28 Jason Merrill + + PR c++/10245 + * cvt.c (force_rvalue): New fn. + * call.c (build_conditional_expr): Use it. + * cp-tree.h: Declare it. + +2003-03-28 Mike Stump + + * error.c (dump_expr): Add 0x to printed hex numbers to make + output match source code better. + +2003-03-28 Mark Mitchell + + PR c++/10218 + * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class + definitions. + + * decl2.c (generate_ctor_or_dtor_function): Tolerate a + non-existant ssdf_decls array. + (finish_file): Call generator_ctor_or_dtor_function when there are + static constructors or destructors and no other static + initializations. + +2003-03-28 Nathan Sidwell + + PR c++/10047 + * decl2.c (finish_file): Don't warn about explicitly instantiated + inline decls. + +2003-03-27 Nathan Sidwell + + PR c++/10224 + * pt.c (lookup_template_class): Only check instantiated args if + they do not contain template parameters. + +2003-03-27 Nathan Sidwell + + PR c++/10158 + * parser.c (cp_parser_function_definition): Set + DECL_INITIALIZED_IN_CLASS for members. + * pt.c (instantiate_decl): Only reduce the template args for + friends that are not defined in class. + +2003-03-25 Jason Merrill + + * call.c (print_z_candidate): Change name of first arg to msgid. + (joust): Add comment for translators. + +2003-03-24 Nathan Sidwell + + PR c++/9898, PR c++/383, DR 322 + * pt.c (maybe_adjust_types_for_deduction) : Look + through reference types on both PARM and ARG. + +2003-03-24 Nathan Sidwell + + PR c++/10119 + * error.c (dump_expr) : Use dump_expr. + * pt.c (maybe_fold_nontype_args): New function. + (tsubst_copy) : Subst any template_id args. + : Break out folding code, call it. + (tsubst_copy_and_build) : Call + maybe_fold_nontype_args. + +2003-03-24 Nathan Sidwell + + PR c++/10026 + * decl2.c (arg_assoc_type) : Don't die. + +2003-03-23 Mark Mitchell + + PR c++/7086 + * typeck.c (cxx_mark_addressable): Adjust call to + gen_mem_addressof or put_var_into_stack. + +2003-03-22 Nathan Sidwell + + PR c++/9978, c++/9708 + * cp-tree.h (instantiate_template): Add tsubst_flags parameter. + * call.c (add_template_candidate_real): Adjust + instantiate_template call. + * class.c (resolve_address_of_overloaded_function): Likewise. + * decl.c (build_enumerator): Set TREE_CONSTANT. + * pt.c (check_instantiated_args): New. + (push_inline_template_parms_recursive): Set TREE_CONSTANT, + TREE_READONLY. + (build_template_parm_index): Copy TREE_CONSTANT, TREE_READONLY. + (reduce_template_parm_level): Likewise. + (process_template_parm): Likewise. + (check_explicit_specialization): Adjust instantiate_template call. + (convert_template_argument): Don't check non-type argument here. + (lookup_template_class): Check them here. + (tsubst_friend_function): Adjust instantiate_template call. + (instantiate_template): Add tsubst_flags parameter, use it. Check + instantiated args. + +2003-03-21 Zack Weinberg + + * decl.c: Update calls to shadow_warning. + +2003-03-21 Nathan Sidwell + + PR c++/9898 + * error.c (dump_decl) [CONST_DECL]: Print ''. + (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. + +2003-03-20 Mark Mitchell + + * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope + friends. + * cp/pt.c (instantiate_class_template): Fix formatting. + +2003-03-14 Matt Austern + + * cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray. + (unemitted_tinfo_decl_p): Remove. + (emit_tinfo_decl): Change declaration to remove unused parameter. + * decl2.c (finish_file): Change tinfo emission to loop through + unemitted_tinfo_decls array instead of looping through all decls. + * rtti.c (unemitted_tinfo_decl_p): Declare as static, remove + unused second parameter. + (init_rtti_processing): initialize unemitted_tinfo_decls varray. + (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls. + (emit_tinfo_decl): remove unused second parameter, add assertion + that decl hasn't already been emitted. + +2003-03-19 Nathanael Nerode + + * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return + type from 'int' to 'bool'. Replace 0 and 1 with true and false in + return statements. + +2003-03-19 Jason Merrill + + PR c++/8316, c++/9315, c++/10136 + * call.c (print_z_candidate): Split out from... + (print_z_candidiates): ...here. + (joust): Use it. + +2003-03-17 Roger Sayle + + PR c++/10031 + * decl.c (duplicate_decls): Use the new type when prototyping + anticipated decls, even when the types match. This defines the + exception list for the built-in function. + +2003-03-17 Jason Merrill + + PR c++/10091 + * typeck.c (build_class_member_access_expr): Compare + TYPE_MAIN_VARIANTs. + +2003-03-17 Mark Mitchell + + PR c++/9639 + * parser.c (cp_parser_declarator_id): Clear parser->scope. + +2003-03-16 Jason Merrill + + PR c++/9993 + * decl.c (finish_function): Only allow the NRVO to use variables + declared at function scope. + +2003-03-17 Andreas Jaeger + + * Make-lang.in (cp/TAGS): Remove. + +2003-03-16 Nathan Sidwell + + PR c++/9629 + * cp-tree.h (struct language_function): Add in_base_initializer. + (in_base_initializer): define it. + (expand_member_init): Remove INIT param. + * init.c (expand_member_init): Remove INIT param, return the member. + (emit_mem_initializers): Set in_base_initializer. + * class.c (build_base_path): Check in_base_initializer. + * parser.c (cp_parser_mem_initializer): Set in_base_initializer. + * pt.c (tsubst_initializer_list): Likewise. + +2003-03-16 Gabriel Dos Reis + + * decl.c (binding_for_name): Fix initialization thinko. + +2003-03-15 Gabriel Dos Reis + + Compile-time improvement: 2/n. + * cp-tree.h (struct cxx_binding): New datatype; + (struct lang_identifier): Use it. + (LOCAL_BINDING_P): Adjust definition. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Likewise. + (BINDING_HAS_LEVEL_P): Likewise. + (BINDING_VALUE): Likewise. + (BINDING_TYPE): Likewise. + (IDENTIFIER_VALUE): Likewise. + (struct tree_binding): Remove. + (TS_CP_BINDING): Likewise. + ((union lang_tree_node): Remove field "binding". + (cxx_binding_clear): New macro. + (binding_for_name): Adjust return type. + (qualified_lookup_using_namespace): Adjust prototype. + (lookup_using_namespace): Adjust prototype. + (cxx_scope_find_binding_for_name): Declare. + * cp-tree.def: Remove CPLUS_BINDING definition. + * decl.c (push_binding): Adjust local variable type. + (add_binding): Likewise. + (push_class_binding): Likewise. + (pop_binding): Likewise. + (poplevel): Likewise. + (poplevel_class): Likewise. + (free_bindings): Adjust type. + (find_binding): Adjust return type, add a third parameter. Remove + non-useful assertion now that we use static typing. + (cxx_scope_find_binding_for_name): New function. + (binding_for_name): Use it. Adjust local variable type. Simplify. + (namespace_binding): Simplify. + (set_namespace_binding): Likewise. + (set_identifier_type_value_with_scope): Adjust local variable type. + (lookup_tag): Don't type-abuse of local variable 'old'. + (lookup_namespace_name): Likewise. Allocate binding on stack. + (select_decl): Adjust prototype. + (unqualified_namespace_lookup): Allocate binding on stack. + Don't type-abuse of local variable 'val'. + (lookup_name_real): Likewise. + (maybe_inject_for_scope_var): Adjust local variable type. + (cp_tree_node_structure): Remove CPLUS_BINDING case label. + (namespace_binding): Adjust logic, simplify. + (BINDING_LEVEL): Adjust definition. + (push_class_level_binding): Adjust local variable type. + (struct cxx_saved_binding): Adjust field 'binding' type. + * decl2.c (ambiguous_decl): Adjust prototype. + (lookup_using_namespace): Adjust local variable type. + (qualified_lookup_using_namespace): Catch type error and correct + ensueing logic error. + (do_nonmember_using_decl): Adjust local variable type. Allocate + temporary cxx_binding on stack. + (do_toplevel_using_decl): Adjust local variable type. + * ptree.c (cxx_print_cxx_binding): New function. + (cxx_print_identifier): Use it. + (cxx_print_xnode): Delete CPLUS_BINDING case label. + +2003-03-15 Roger Sayle + + * tree.c (count_functions): Fix whitespace. + +2003-03-15 Neil Booth + + * Make-lang.in: Update. + +2003-03-15 Kriang Lerdsuwanakij + + PR c++/6440 + * pt.c (maybe_process_partial_specialization): Handle + member class template when enclosing class template is + explicit specialized. + (most_general_template): Stop looking when DECL is already + specialized. + +2003-03-13 Jason Merrill + + PR c++/9420 + * search.c (lookup_conversions): Call complete_type here. + * call.c (implicit_conversion): Not here. + +2003-03-13 Mark Mitchell + + * decl2.c (do_nonmember_using_decl): Correct handling of + simultaneous type/non-type bindings. + + * call.c (initialize_reference): Remove bogus assertion. + * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09. + +2003-03-12 Andrew Lewycky + + PR c++/7050 + * expr.c (cxx_expand_expr): Return const0_rtx for throw + expressions. + +2003-03-11 Mark Mitchell + + PR c++/9474 + * decl2.c (do_nonmember_using_decl): Do not call duplicate decls + to merge old and new declarations. + +2003-03-12 Alexandre Oliva + + * g++.1: Remove. + * Make-lang.in (c++.generated-manpages): Build cp/g++.1. + (cp/g++.1): Build it from scratch in the build tree. + (c++.install-man): Depend on it. Install it from the build tree. + (c++.mostlyclean): Clean it. + +2003-03-11 Mark Mitchell + + PR c++/9474 + * decl2.c (do_nonmember_using_decl): Do not call duplicate decls + to merge old and new declarations. + + PR c++/9924 + * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins. + +2003-03-11 Jason Merrill + + PR c++/9820 + * search.c (lookup_member): Fix handling of functions in a class + being defined. + +2003-03-11 Mark Mitchell + + PR c++/8700 + * call.c (convert_class_to_reference): Adjust usage of + splice_viable. + (any_viable): Remove. + (splice_viable): Combine with any_viable. + (print_z_candidates): Avoid printing duplicates. + (build_user_type_conversion_1): Adjust usage of splice_viable. + (build_new_function_call): Likewise. + (build_operator_new_call): Likewise. + (build_object_call): Likewise. + (build_conditional_expr): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + (joust): Remove spurious comment. + * cp-tree.h (DECL_FRIENDLIST): Correct documentation. + * decl2.c (arg_assoc_class): Simplify. + * friend.c (add_friend): Likewise. + +2003-03-11 Jason Merrill + + PR c++/8660 + * decl2.c (check_classfn): A member template only matches a + member template. + +2003-03-11 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + * lang-specs.h: Don't define __GNUG__ here. + +2003-03-10 Mark Mitchell + + * call.c (perform_overload_resolution): New function. + (build_new_function_call): Use it. + (build_operator_new_call): Likewise. + (add_candidates): Add explicit_targs and template_only parameters. + (build_new_op): Adjust accordingly. + * cp-tree.h (build_operator_new_call): New function. + (build_function_call_real): Remove. + (build_function_call_maybe): Likewise. + * init.c (build_new_1): Use build_operator_new_call. + * typeck.c (build_function_call_real): Rename to ... + (build_function_call): ... this. + +2003-03-10 Devang Patel + + PR c++/9394 + * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG. + +2003-03-10 Jason Merrill + + PR c++/9798 + * decl.c (push_using_directive): Push before recursing. + + PR c++/9868, c++/9524 + * call.c (resolve_scoped_fn_name): Handle the case of a function + pointer member. + + * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this' + argument in the pointer-to-member case. + +2003-03-09 Mark Mitchell + + PR c++/9373 + * cp-lang.c (cxx_get_alias_set): Use alias set zero for + pointers to member functions. + + PR c++/8534 + * decl.c (build_ptrmemfunc_type): Do not allow default arguments + in pointer-to-member-function types. + +2003-03-10 Gabriel Dos Reis + + * expr.c (cplus_expand_constant): Use C90 prototype style. + (cxx_expand_expr): Likewise. + +2003-03-09 Kriang Lerdsuwanakij + + PR c++/9970 + * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual + functions. + +2003-03-08 Geoffrey Keating + + * lang-specs.h (c++-header): Change .pch to .gch. + +2003-03-08 Neil Booth + + * cp-tree.h (cxx_init): Update prototype. + * lex.c (cxx_init): Similarly. + +2003-03-08 Mark Mitchell + + PR c++/9823 + * cp-tree.h (begin_mem_initializers): Remove. + * parser.c (cp_parser_mem_initializer_list): Inline it here. + Do not call finish_mem_initializers if not in a constructor. + (cp_parser_class_head): Fix typo in error message. + * semantics.c (begin_mem_initializers): Remove. + * testsuite/g++.dg/parser/constructor1.C: New test. + + PR c++/9809 + * call.c (add_function_candidate): Skip builtin fuctions that have + not yet been declared. + + PR c++/9982 + * init.c (build_new_1): Correct logic for determining whether or + not to use an array cookie. + + PR c++/9524 + * parser.c (cp_parser_postfix_expression): Call + finish_non_static_data_member, even when processing_template_decl. + + PR c++/9912 + * cp-tree.h (is_ancestor): New function. + (handle_class_head): Change prototype. + * decl2.c (is_namespace_ancestor): Rename to ... + (namespace_anecestor): ... this. + (set_decl_namespace): Adjust accordingly. + (handle_class_head): Remove unnecessary parameters. + * parser.c (cp_parser_class_head): Check that + nested-name-specifiers are used appropriately. + +2003-03-07 Mark Mitchell + + * call.c (reference_binding): Remove REF_IS_VAR parameter. + (implicit_conversion): Adjust call to reference_binding. + (make_temporary_var_for_ref_to_type): Add TYPE parameter. + (initialize_reference): Adjust handling for references bound to + rvalues. + * cp-tree.h (make_temporary_var_for_ref_to_temp): Change + prototype. + (real_non_cast_lvalue_p): New method. + * cvt.c (build_up_reference): Adjust use of + make_temporary_var_for_ref_to_temp. + * tree.c (real_non_cast_lvalue_p): New method. + +2003-03-07 Gabriel Dos Reis + + * except.c (init_exception_processing): Use C90 prototype style. + (cp_protect_cleanup_actions): Likewise. + (prepare_eh_type): Likewise. + (build_eh_type_type): Likewise. + (build_exc_ptr): Likewise. + (do_begin_catch): Likewise. + (dtor_nothrow): Likewise. + (do_end_catch): Likewise. + (push_eh_cleanup): Likewise. + (decl_is_java_type): Likewise. + (choose_personality_routine): Likewise. + (initialize_handler_parm): Likewise. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Likewise. + (begin_eh_spec_block): Likewise. + (finish_eh_spec_block): Likewise. + (do_allocate_exception): Likewise. + (do_free_exception): Likewise. + (wrap_cleanups_r): Likewise. + (stabilize_throw_expr): Likewise. + (build_throw): Likewise. + (complete_ptr_ref_or_void_ptr_p): Likewise. + (is_admissible_throw_operand): Likewise. + (nothrow_libfn_p): Likewise. + (can_convert_eh): Likewise. + (check_handlers_1): Likewise. + (check_handlers): Likewise. + +2003-03-06 Mark Mitchell + + * call.c (merge_conversion_sequences): New function. + (build_conv): Set ICS_USER_FLAG for USER_CONVs. + (convert_class_to_reference): Correct handling of second + standard conversion sequence in a user-defined conversion + sequence. + (build_user_type_conversion_1): Use merge_conversion_sequences. + * cp-tree.def: Add comments for CONV nodes. + * rtti.c (get_tinfo_decl): Use build_address/build_nop. + +2003-03-07 Gabriel Dos Reis + + * error.c (init_error): Use C90 prototype style. + (dump_scope): Likewise. + (dump_qualifiers): Likewise. + (dump_template_argument): Likewise. + (dump_template_argument_list): Likewise. + (dump_template_parameter): Likewise. + (dump_template_bindings): Likewise. + (dump_type): Likewise. + (dump_typename): Likewise. + (class_key_or_enum): Likewise. + (dump_aggr_type): Likewise. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_global_iord): Likewise. + (dump_simple_decl): Likewise. + (dump_decl): Likewise. + (dump_template_decl): Likewise. + (dump_function_decl): Likewise. + (dump_parameters): Likewise. + (dump_exception_spec): Likewise. + (dump_function_name): Likewise. + (dump_template_parms): Likewise. + (dump_char): Likewise. + (dump_expr_list): Likewise. + (dump_expr): Likewise. + (dump_binary_op): Likewise. + (dump_unary_op): Likewise. + (type_as_string): Likewise. + (expr_as_string): Likewise. + (decl_as_string): Likewise. + (context_as_string): Likewise. + (lang_decl_name): Likewise. + (cp_file_of): Likewise. + (cp_line_of): Likewise. + (decl_to_string): Likewise. + (expr_to_string): Likewise. + (fndecl_to_string): Likewise. + (code_to_string): Likewise. + (language_to_string): Likewise. + (parm_to_string): Likewise. + (op_to_string): Likewise. + (type_to_string): Likewise. + (assop_to_string): Likewise. + (args_to_string): Likewise. + (cv_to_string): Likewise. + (cxx_print_error_function): Likewise. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (function_category): Likewise. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (maybe_print_instantiation_context): Likewise. + (print_instantiation_context): Likewise. + (cp_printer): Likewise. + (print_integer): Likewise. + (print_non_consecutive_character): Likewise. + (locate_error): Likewise. + +2003-03-06 Mark Mitchell + + PR c++/9965 + * call.c (reference_binding): Add ref_is_var parameter. + (implicit_conversion): Adjust call to reference_binding. + (initialize_reference): Likewise. + + PR c++/9400 + * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL + PARM_DECLs. + + PR c++/9791 + * class.c (get_basefndecls): Use lookup_fnfields_1. + +2003-03-06 Kriang Lerdsuwanakij + + PR c++/9188 + * parser.c (cp_parser_type_parameter): Remove redundant `expect' + in error message. + (cp_parser_single_declaration): Likewise. + +2003-03-05 Jason Merrill + + PR c++/9440 + * call.c (build_conditional_expr): Use convert rather than an + explicit NOP_EXPR. + +2003-03-02 Matt Austern + + * decl.c (cp_binding_level): Add static_decls varray member. + (add_decl_to_level): Add static/inline namespace scope + declarations to static_decls array. + (wrapup_global_for_namespace): Pass static_decls only, instead of + all decls, to wrapup_global_declarations/check_global_declarations. + (push_namespace): Initialize static_decls for ordinary namespaces. + (cxx_init_decl_processing): Initialize static_decls for global + namespace. + +2003-03-05 Mark Mitchell + + * class.c (end_of_class): Correct thinko. + +2003-03-04 Nathanael Nerode + + * config-lang.in: Replace ${libstdcxx_version} by its value. + +2003-03-04 Gabriel Dos Reis + + * cp-tree.h (cxx_saved_binding): Declare. + (struct saved_scope): Adjust type of field 'old_binding'. + * decl.c (cxx_saved_binding_make): New macro. + (struct cxx_saved_binding): Define. + (store_bindings): Adjust prototype. Use cxx_saved_binding to save + C++ bindings. + (maybe_push_to_top_level): Adjust local variable type. + (pop_from_top_level): Likewise. + +2003-03-04 Tom Tromey + + * Make-lang.in (c++.tags): New target. + +2003-03-04 Neil Booth + + * Make-lang.in: Update. + +2003-03-03 Jason Merrill + + * decl.c (finish_enum): Do set the type in a template. Simplify. + * pt.c (tsubst_enum, tsubst_copy): Revert last patch. + +2003-03-03 Mark Mitchell + + PR c++/9878 + * call.c (convert_class_to_reference): Correct conversion + sequences. + (reference_binding): Add ref_bound_directly_to_rvalue_p parameter. + (implicit_conversion): Adjust call to reference_binding. + (add_candidate): Change type of candidates parameter. + (add_function_candidate): Likewise. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (add_builtin_candidate): Likewise. + (add_builtin_candidates): Likewise. + (add_template_candidate_real): Likewise. + (add_template_candidate): Likewise. + (add_template_conv_candidate): Likewise. + (build_user_type_conversion_1): Adjust accordingly. + (build_object_call): Likewise. + (build_conditional_expr): Likewise. + (add_candidates): Likewise. + (build_new_op): Likewise. + (convert_like_real): Use USER_CONV_CAND. Use build_nop. + (build_new_method_call): Adjust calls to add_function_candidate. + (make_temporary_var_for_ref_to_temp): New function. + (initialize_reference): Add decl parameter. + * class.c (build_rtti_vtbl_entries): Use build_address and + build_nop. + * cp-tree.h (initialize_reference): Change prototype. + (make_temporary_var_for_ref_to_temp): New function. + (build_type_conversion): Change prototype. + (build_address): New function. + (build_nop): Likewise. + * cvt.c (cp_convert_to_pointer): Adjust call to + build_type_conversion. Avoid indicating redundant NOP_EXPRs. + Use build_nop. + (convert_to_pointer_force): Use build_nop. + (build_up_reference): Use make_temporary_var_for_ref_to_temp. + (convert_to_reference): Adjust call to build_type_conversion. + (ocp_convert): Likewise. + (build_type_conversion): Remove for_sure parameter. + * decl.c (grok_reference_init): Use initialize_reference. + * typeck.c (build_address): New function. + (build_nop): Likewise. + (build_unary_op): Use them. + (build_ptrmemfunc): Tidy slightly. + (convert_for_initialization): Adjust call to + initialize_reference. + * typeck2.c (store_init_value): Remove #if 0'd code. + +2003-03-03 Jason Merrill + + * decl.c (start_function): Clear DECL_NUM_STMTS. + + * class.c (get_vtable_decl): Use vtbl_type_node. + (build_primary_vtable): Check for it. + +2003-03-02 Aldy Hernandez + + * decl.c (check_initializer): Check for vector_opaque_p. + +2003-03-02 Ashif Harji + + * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to + invoke an external cpp during compilation. + +2003-03-01 Gabriel Dos Reis + + * decl.c (duplicate_decls): Convert use of warning_with_decl() to + that of warning(). + (start_decl): Likewise. + (start_function): Likewise. + +2003-03-01 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + +2003-02-28 Mark Mitchell + + PR c++/9892 + * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when + instantiating it. + +2003-02-28 Aldy Hernandez + + * parser.c (cp_parser_init_declarator): Revert opaque + vector_opaque_p change. + Do not include target.h. + +2003-02-28 Mark Mitchell + + PR c++/9879 + * cp-tree.h (build_zero_init): Add parameter. + * decl.c (cp_finish_decl): Adjust call. + * init.c (build_zero_init): Add nelts parameter. Adjust recursive + calls. + (build_default_init): Add nelts parameter. Adjust calls to + build_zero_init. + (build_new_1): Adjust call to build_default_init. + * typeck2.c (process_init_constructor): Adjust call to build_zero_init. + +2003-02-26 Devang Patel + + * decl.c (finish_enum): Merge two 'for' loops. Copy value node if + required. Postpone enum setting for template decls. + (build_enumerator): Delay copying value node until finish_enum + (). Remove #if 0'ed code. + * pt.c (tsubst_enum): Set TREE_TYPE and copy value node. + (tsubst_copy): Add check for enum type. + +2003-02-25 Mark Mitchell + + PR c++/9683 + * decl2.c (prune_vars_needing_no_initialization): Do not throw + away initializations for DECL_EXTERNAL VAR_DECLs. + (finish_file): Adjust accordingly. + * pt.c (instantiate_decl): Do not defer VAR_DECLs. + +2003-02-24 Gabriel Dos Reis + + * decl.c (add_binding): Time TV_NAME_LOOKUP. + (push_class_binding): Likewise. + (set_namespace_binding): Likewise. + +2003-02-24 Mark Mitchell + + PR c++/9836 + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from + specializations back to the main template. + * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use. + * pt.c (resolve_typename_type): Likewise. + +2003-02-24 Jeffrey D. Oldham + + PR c++/9778 + * pt.c (tsubst_copy_and_build): For a templated function inside a + scope, process template arguments. + +2003-02-24 Kriang Lerdsuwanakij + + PR c++/9602 + * typeck2.c (abstract_virtuals_error): Don't check when + TYPE is still template parameter dependent. + +2003-02-23 Mark Mitchell + + PR c++/5333 + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro. + * parser.c (cp_parser_diagnose_invalid_type_name): Use it. + * pt.c (instantiate_class_template): Don't try to instantiate + dependent types. + (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE. + +2003-02-21 Mark Mitchell + + PR c++/9749 + * decl.c (grokdeclarator): Do not allow parameters with variably + modified types. + +2003-02-21 Nathan Sidwell + + * search.c (grow_bfs_bases): Remove. Fold into ... + (bfs_walk): ... here, fix fencepost error. Fix merge lossage + in previous patch. + +2003-02-20 Mark Mitchell + + PR c++/9729 + * mangle.c (mangle_conv_op_name_for_type): Issue an error message + when the G++ 3.2 ABI prevents correct compilation. + +2003-02-20 Nathan Sidwell + + Change base class access representation. Share virtual base + binfos. + * cp/call.c (build_special_member_call): Remove binfo_for_vbase + call. + * cp/class.c (build_base_path): Likewise. + (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use. + (build_secondary_vtable): Remove FOR_TYPE arg. Adjust. + (make_new_vtable): Adjust. + (force_canonical_binfo_r): Delete. + (force_canonical_binfo): Delete. + (mark_primary_virtual_base): Delete. + (dfs_unshared_virtual_bases): Delete. + (mark_primary_bases): Adjust. + (maybe_warn_about_overly_private_class): Adjust. + (dfs_base_derived_from): Delete. + (base_derived_from): Follow the inheritance chain. + (struct find_final_overrider_data): Add vpath member. + (dfs_find_final_overrider): Adjust. + (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New. + (find_final_overrider): Adjust. + (update_vtable_entry_for_fn): Adjust. + (modify_all_vtables): Adjust. + (walk_subobject_offsets): Adjust. + (layout_nonempty_base_or_field): Adjust. + (layout_empty_base): Remove last parameter. Adjust. + (build_base_field): Adjust. + (build_base_fields): Adjust. + (propagate_binfo_offsets): Remove last parameter. Adjust. + (dfs_set_offset_for_unshared_vbases): Delete. + (layout_virtual_bases): Adjust. + (finish_struct_1): Adjust. + (init_class_processing): Don't init access nodes. + (dfs_get_primary_binfo): Delete. + (get_primary_binfo): Adjust. + (dump_class_hierarchy_r): Remove most derived arg, add IGO + parameter. Adjust. + (dump_class_hierarchy): Adjust. + (finish_vtbls): Adjust. + (get_original_base): Delete. + (build_vtt_inits): Adjust. + (dfs_build_secondary_vptr_vtt_inits): Adjust. + (dfs_ctor_vtable_bases_queue_p): Adjust. + (build_ctor_vtbl_group): Adjust. + (dfs_accumulate_vtbl_inits): Adjust. + (build_vtbl_initializer): Adjust. + (build_vbase_offset_vtbl_entries): Adjust. + (add_vcall_offset_vtbl_entries_1): Adjust. + * cp/cp-tree.h (CPTI_ACCESS_*): Remove. + (access_*_node): Remove. + (CANONICAL_BINFO): Delete. + (BINFO_UNSHARED_MARKED): Remove. + (BINFO_MARKED): Set LANG_FLAG_0 directly. + (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete. + (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly. + (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED): + Delete. + (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust. + (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED): + Delete. + (BINFO_DEPENDENT_BASE_P): New. + (dfs_walk, dfs_walk_real): Queue function takes derived binfo and + index. + (markedp, unmarkedp): Adjust. + (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p, + dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp, + find_vbase_instance, binfo_for_vbase): Delete. + (copied_binfo, original_binfo): Declare. + (finish_base_specifier): Add virtual_p arg. + (unshare_base_binfos): Delete. + (copy_base_binfos): Declare. + (reverse_path): Delete. + * cp/decl.c (xref_basetypes): Access and virtuality passed + differently. Don't copy direct base binfos here. Call + copy_base_binfos. + * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust. + (initialize_vtbl_ptrs): Adjust. + (expand_member_init): Adjust. + * cp/parser.c (cp_parser_base_specifier): Adjust. + * cp/pt.c (instantiate_class_template): Adjust. + (get_template_base_recursive): Adjust. + * cp/rtti.c (get_pseudo_ti_init): Adjust. + (get_pseudo_ti_desc): Adjust. + * cp/tree.c (unshare_base_binfos): Rename to ... + (copy_base_binfos): ... here, reimplement. + (make_binfo): Set BINFO_DEPENDENT_BASE_P. + (reverse_path): Remove. + * cp/typeck.c (get_delta_difference): Adjust error messages. + * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust. + * cp/search.c (lookup_base_r): Adjust. + (dynamic_cast_base_recurse): Adjust. + (canonical_binfo): Remove. + (dfs_canonical_queue): Remove. + (dfs_assert_unmarked_p): Remove. + (assert_canonical_unmarked): Remove. + (shared_marked_p, shared_unmarked_p): Remove. + (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE. + (dfs_access_in_type): Adjust. + (access_in_type): Adjust. + (dfs_accessible_queue_p): Adjust. + (dfs_accessible_p): Adjust. + (is_subobject_of_p_1, is_subobject_of_p): Remove. + (struct lookup_field_info): Remove from_dep_base_p field. + (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P. + (lookup_field_r): Remove dependent base code. + (lookup_member): Likewise. + (dfs_walk, dfs_walk_real): Add access arg to queue fn. + (dfs_unmarked_real_bases_queue_p): Remove. + (dfs_marked_real_bases_queue_p): Remove. + (dfs_skip_vbases): Remove. + (dfs_get_pure_virtuals): Adjust. + (markedp, unmarkedp): Adjust. + (marked_vtable_pathp, unmarked_vtable_pathp): Remove. + (marked_pushdecls_p, unmarked_pushdecls_p): Adjust. + (dfs_unmark): Adjust. + (dfs_get_vbase_types):Remove. + (dfs_build_inheritance_graph_order): Remove. + (get_vbase_types): Remove + (dfs_find_vbase_instance): Remove. + (find_vbase_instance): Remove. + (dfs_debug_unmarkedp): Adjust. + (dependent_base_p): Remove. + (dfs_push_type_decls): Adjust. + (dfs_push_decls): Adjust. + (dfs_no_overlap_yet): Adjust. + (copied_binfo): New function. + (original_binfo): New function. + (binfo_for_vbase): Remove. + +2003-02-18 Zack Weinberg + + * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk. + (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES + vectors, for speed. + +2003-02-18 Mark Mitchell + + PR c++/9704 + * class.c (layout_class_type): In the 3.2 ABI, take into account + trailing bit fields when computing CLASSTYPE_SIZE_UNIT. + +2003-02-18 Matt Austern + + * cp/cp-lang.c: Change lang hooks so that final_write_globals does + nothing for C++. + * cp/decl.c (wrapup_globals_for_namespace): Remove special + handling of global namespace. + +2003-02-18 Geoffrey Keating + + * cp-tree.h (rid_to_yy): Delete. + (C_RID_YYCODE): Delete. + (finish_file): Delete redundant declaration. + +2003-02-18 Jason Merrill + + PR c++/9623 + * decl.c (reshape_init): Don't mess with initializer labels. + + PR c++/9485 + * parser.c (cp_parser_postfix_expression): Set idk properly for + object->scope::member. + +2003-02-18 Ben Elliston + + PR other/7350 + * decl.c (duplicate_decls): Fix typo in comment. + +2003-02-17 Michael Elizabeth Chastain + + PR debug/9717 + * class.c (build_base_field): Mark fields for base classes with + DECL_IGNORED_P. + +2003-02-17 Kriang Lerdsuwanakij + + PR c++/9457 + * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute + CONSTRUCTOR_ELTS only once. + +2003-02-16 Kriang Lerdsuwanakij + + PR c++/9459 + * error.c (dump_type_prefix): Handle TYPEOF_TYPE. + (dump_type_suffix): Likewise. + +2003-02-14 Nathan Sidwell + + * search.c: ANSIfy function declarations and definitions. + * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool. + * call.c (build_method_call, resolve_scoped_fn_name, + build_java_interface_fn_ref): Adjust lookup_field, lookup_member + calls. + * class.c (handle_using_decl): Likewise. + * decl.c (make_typename_type, make_unmound_class_template, + start_decl, compute_array_index_type): Likewise. + * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise. + * init.c (expand_member_init, build_member_call): Likewise. + * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation, + resolve_typename_type): Likewise. + * typeck.c (lookup_destructor, finish_class_member_access_exprm + build_prememfunc_access_expr): Likewise. + +2003-02-13 Gabriel Dos Reis + + * decl2.c: Include "timevar.h". + (namespace_ancestor): Time name lookup. + (add_using_namespace): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (decl_namespace): Likewise. + (lookup_arg_dependent): Likewise. + * lex.c (do_identifier): Likewise. + (do_scoped_id): Likewise. + * pt.c (lookup_template_class): Likewise. + +2003-02-14 Andrew Pinski + + * decl.c: (define_label): Fix warning for return 0 instead of NULL. + +2003-02-13 Gabriel Dos Reis + + * decl.c: Include "timevar.h". + (poplevel): Time name lookup. + (find_binding): Likewise. + (push_namespace): Likewise. + (pop_nested_namespace): Likewise. + (store_bindings): Likewise. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (push_local_name): Likewise. + (pushtag): Likewise. + (pushdecl): Likewise. + (pushdecl_with_scope): Likewise. + (pushdecl_namespace_level): Likewise. + (pushdecl_top_level): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_using_decl): Likewise. + (push_using_directive): Likewise. + (push_overloaded_decl): Likewise. + (lookup_label): Likewise. + (define_label): Likewise. + (lookup_tag): Likewise. + (lookup_tag_reverse): Likewise. + (lookup_namespace_name): Likewise. + (select_decl): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (maybe_inject_for_scope_var): Likewise. + (xref_tag): Likewise. + + * Make-lang.in (cp/decl.o): Add dependency on timevar.h + +2003-02-12 Phil Edwards + + * decl.c (build_enumerator): Remove unneeded test. + +2003-02-09 Dan Nicolaescu + + * cp-tree.h (struct lang_type_header): Make all fields unsigned + char. + +2003-02-03 Mark Mitchell + + PR c++/7129 + * call.c (z_candidate): Add args. + (convert_class_to_reference): Set it. + (implicit_conversion): Tidy. + (add_candidate): Add args parameter. + (add_function_candidate): Adjust call to add_candidate. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (build_user_type_conversion_1): Eliminate wasteful tree_cons + usage. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (add_candidates): New function. + (build_new_op): Use it. + (covert_like_real): Adjust call to build_over_call. + (build_over_call): Remove args parameter. + * operators.def: Add ?=. + +2003-02-01 Richard Sandiford + + * typeck.c (build_indirect_ref): Don't check flag_volatile. + +2003-01-31 Kriang Lerdsuwanakij + + PR c++/8849 + * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL. + +2003-01-31 Nathan Sidwell + + * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, + BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. + (BINFO_LANG_ELTS): New #define. + * tree.c (make_binfo): Use BINFO_LANG_ELTS. + +2003-01-30 Geoffrey Keating + + * cp/Make-lang.in: Remove -Wno-error from cp/decl.o. + +2003-01-30 Mark Mitchell + + * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY + for class types. + * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit + rather than TYPE_LANG_FLAG_0. + (TYPE_BUILT_IN): Remove. + (TYPE_DEPENDENT_P): New macro. + (TYPE_DEPENDENT_P_VALID): Likewise. + (lang_type_class): Add fields_readonly. + * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN. + * pt.c (dependent_type_p_r): New function, split out from ... + (dependent_type_p): ... here. Memoize results. + * search.c (dependent_base_p): Use dependent_type_p, not + uses_template_parms. + * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY + for class types. + +2003-01-29 Mark Mitchell + + * call.c (build_field_call): Use build_new_op, not build_opfncall. + (prep_operand): New function. + (build_new_op): Use it. Remove dead code. + * class.c (pushclass): Change "modify" parameter type from int to + bool. + (currently_open_class): Use same_type_p, not pointer equality. + (push_nested_class): Adjust calls to pushclass, remove modify + parameter. + * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro. + (pushclass): Change prototype. + (push_nested_class): Likewise. + (grokoptypename): Remove. + (build_opfncall): Remove. + (value_dependent_expression_p): Declare. + (resolve_typename_type): Likewise. + (resolve_typename_type_in_current_instantiation): Likewise. + (enter_scope_of): Remove. + (tsubst): Remove. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (tsubst_copy_and_build): Likewise. + * decl.c (warn_about_implicit_typename_lookup): Remove. + (finish_case_label): Return error_mark_node for erroneous labels. + (start_decl): Adjust calls to push_nested_class. + (grokfndecl): Call push_scope/pop_scope around call to + duplicate_decls. + (grokdeclarator): Do not call tsubst. + (start_function): Adjust calls to push_nested_class. + * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall. + (check_classfn): Use push_scope/pop_scope around type comparisions. + (grokoptypename): Remove. + (push_sscope): Adjust call to push_nested_class. + * error.c (dump_type): Show cv-qualification of typename types. + * init.c (build_member_call): Use build_new_op, not + build_opfncall. + * method.c (build_opfncall): Remove. + * parser.c (cp_parser): Add allow_non_constant_expression_p and + non_constant_expression_p. + (cp_parser_constant_expression): Adjust prototype. + (cp_parser_resolve_typename_type): Remove. + (cp_parser_non_constant_expression): New function. + (cp_parser_non_constant_id_expression): Likewise. + (cp_parser_new): Set allow_non_constant_expression_p and + non_constant_expression_p. + (cp_parser_primary_expression): Reject `this' and `va_arg' in + constant-expressions. Note that dependent names aren't really + constant. + (cp_parser_postfix_expression): Reject conversions to non-integral + types in constant-expressions. Neither are increments or + decrements. + (cp_parser_unary_expression): Reject increments and decrements in + constant-expressions. + (cp_parser_direct_new_declarator): Adjust call to + cp_parser_constant_expression. + (cp_parser_cast_expression): Reject conversions to non-integral + types in constant-expressions. + (cp_parser_assignment_expression): Rejects assignments in + constant-expressions. + (cp_parser_expression): Reject commas in constant-expressions. + (cp_parser_labeled_statement): Adjust call to + cp_parser_constant_expression. + (cp_parser_direct_declarator): Simplify array bounds, even in + templates, when they are non-dependent. Use + resolve_typename_type, not cp_parser_resolve_typename_type. + (cp_parser_class_head): Use resolve_typename_type, not + cp_parser_resolve_typename_type. + (cp_parser_member_declaration): Adjust call to + cp_parser_constant_expression. + (cp_parser_constant_initializer): Likewise. + (cp_parser_constructor_declarator): Use resolve_typename_type, not + cp_parser_resolve_typename_type. + (cp_parser_late_parsing_default_args): Adjust call to + push_nested_class. + * pt.c (tsubst): Give it internal linkage. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (tsubst_copy_and_build): Likewise. + (push_access_scope_real): Likewise. + (tsubst_friend_class): Likewise. + (instantiate_class_template): Adjust call to pushclass. + (value_dependent_expression_p): Give it external linkage. + Robustify. + (resolve_typename_type): New function. + * semantics.c (finish_call_expr): Use build_new_op, not + build_opfncall. + (begin_constructor_declarator): Remove. + (begin_class_definition): Adjust call to pushclass. + (enter_scope_of): Remove. + * typeck.c (comptypes): Resolve typename types as appropriate. + (build_x_indirect_ref): Use build_new_op, not build_opfncall. + (build_x_compound_expr): Likewise. + (build_modify_expr): Likewise. + (build_x_modify_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-01-29 Fariborz Jahanian + + * pt.c (last_pending_template) Declare GTY(). + +2003-01-29 Kriang Lerdsuwanakij + + PR c++/8591 + * parser.c (cp_parser_elaborated_type_specifier): Convert + TEMPLATE_DECL to TYPE_DECL only when processing template friends. + (cp_parser_maybe_treat_template_as_class): Remove redundant tests. + +2003-01-28 Nathan Sidwell + + PR c++/9437 + * pt.c (unify): Don't unify '*T' with 'U C::*'. + + PR c++/3902 + * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor + inside a declarator. + +2003-01-27 Nathan Sidwell + + * class.c (update_vtable_entry_for_fn): Add index parameter. + Generate vcall thunk for covariant overriding from a virtual + primary base. + (dfs_modify_vtables): Adjust. + +2003-01-25 Nathan Sidwell + + PR c++/9403 + * parser.c (cp_parser_class_or_namespace_name): Reject duplicate + template keyword. + (cp_parser_base_specifier): Look for and consume a + TEMPLATE keyword. Replace switch with array index. + + PR c++/795 + * semantics.c (finish_non_static_data_member): Remember the + field's type even in a template. + + PR c++/9415 + * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are + already scoped. + + PR c++/8545 + * parser.c (cp_parser_cast_expression): Be more tentative. + +2003-01-25 Kriang Lerdsuwanakij + + * cp-tree.h (flagged_type_tree_s): Remove. + (check_for_new_type): Likewise. + * typeck2.c (check_for_new_type): Likewise. + +2003-01-23 Nathanael Nerode + + * dump.c: ANSIfy function declarations and definitions. + + * cp-tree.h, decl.h: Get rid of PARAMS. Again. + +2003-01-22 Mark Mitchell + + PR c++/9354 + * init.c (build_new): Set the type of the new-expression, even + when processing_templte_decl. + + PR c++/9216 + * parser.c (cp_parser_primary_expression): Improve error message + for templates used in an expression context. + + PR c++/8696 + * parser.c (cp_parser_decl_specifier_seq): Commit to tentative + parse when encountering "typedef". + +2003-01-22 Nathanael Nerode + + * class.c, parser.c: ANSIfy function definitions and declarations. + +2003-01-22 Mark Mitchell + + PR c++/9328 + * error.c (dump_decl): For an OVERLOAD, just print the name of the + function; it doesn't make sense to try to print its type. + * semantics.c (finish_typeof): Issue errors about invalid uses. + + PR c++/9298 + * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New + function. + (cp_parser_expression_statement): Use it. + (cp_parser_explicit_instantiation): Likewise. + * pt.c (do_decl_instantiation): Improve error handling logic. + +2003-01-22 Mark Mitchell + + PR c++/9384 + * parser.c (cp_parser_using_declaration): Issue error messages + about name resolution failures here. + + PR c++/9388 + * class.c (currently_open_derived_class): Use dependent_type_p. + * cp-tree.h (dependent_type_p): New function. + (dependent_template_arg_p): Likewise. + (dependent_template_p): Likewise. + (type_dependent_expression_p): Likewise. + * parser.c (cp_parser_dependent_type_p): Remove. + (cp_parser_value_dependent_type_p): Likewise. + (cp_parser_type_dependent_expression_p): Likewise. + (cp_parser_dependent_template_arg_p): Likewise. + (cp_parser_dependent_template_id_p): Likewise. + (cp_parser_dependent_template_p): Likewise. + (cp_parser_diagnose_invalid_type_name): Replace + cp_parser_dependent_type_p with dependent_type_p, etc. + (cp_parser_primary_expresion): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_unary_expression): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name): Likewise. + * pt.c (dependent_type_p): New function. + (value_dependent_expression_p): Likewise. + (type_dependent_expression_p): Likewise. + (dependent_template_arg_p): Likewise. + (dependent_template_id_p): Likewise. + (dependent_template_p): Likewise. + + PR c++/9285 + PR c++/9294 + * parser.c (cp_parser_simple_declaration): Return quickly when + encountering errors. + +2003-01-21 Kaveh R. Ghazi + + Make-lang.in (cp/decl.o-warn): Add -Wno-error. + +2003-01-17 Jason Merrill + + PR c++/9167, c++/9358 + * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE. + +2003-01-17 Jason Merrill + + PR c++/9342 + * call.c (build_conditional_expr): Always do lvalue-rvalue + conversion. + +2003-01-17 Mark Mitchell + + PR c++/9294 + * cp-tree.def (BASELINK): Make it class 'x', not class 'e'. + * cp-tree.h (BASELINK_BINFO): Adjust. + (BASELINK_FUNCTIONS): Likewise. + (BASELINK_ACCESS_BINFO): Likewise. + (tree_baselink): New structure. + (cp_tree_node_structure_enum): Add TS_CP_BASELINK. + (lang_tree_node): Add baselink. + * decl.c (cp_tree_node_structure): Add BASELINK case. + * search.c (build_baselink): Adjust. + * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P + test from TREE_LIST case. + + PR c++/9272 + * parser.c (cp_parser_constructor_declarator_p): Do not assume + that a constructor cannot be declared outside of its own class. + + * parser.c (cp_parser_resolve_typename_type): If the scope cannot + be resolved, neither can the qualified name. + + * rtti.c (get_pseudo_ti_desc): Fix thinko. + +2003-01-16 Jason Merrill + + PR c++/8564 + * init.c (build_vec_init): Re-add maxindex parm. + (perform_member_init, build_aggr_init): Pass it. + (build_new_1): Pass it. Use an incomplete array type for full_type. + * typeck.c (build_modify_expr): Pass it. + * cp-tree.h: Adjust. + +2003-01-16 Jeffrey D. Oldham + + * cp-tree.h (tsubst_copy_and_build): New declaration. + * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment. + (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment. + (tsubst_copy_and_build): New function. + +2003-01-16 Mark Mitchell + + * cp-tree.h (lang_type_class): Remove is_partial_instantiation. + (PARTIAL_INSTANTIATION_P): Remove. + (IMPLICIT_TYPENAME_P): Likewise. + (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. + (build_typename_type): Remove declaration. + (parmlist_is_exprlist): Likewise. + * decl.c (build_typename_type): Make it static, remove third + parameter. + (push_class_binding): Don't do implicit typename stuff. + (make_typename_type): Likewise. + (lookup_name_real): Likewise. + (grokdeclarator): Don't try to convert declarations into + initializations. Don't do implicit typename stuff. + (parmlist_is_exprlist): Remove. + (xref_basetypes): Simplify. + * decl2.c (grokfield): Don't try to convert declarations into + initializations. + (build_anon_union_vars): Do this while processing templates, too. + (finish_anon_union): Likewise. + * error.c (dump_type): Remove implicit typename handling. + * parser.c (cp_parser_diagnose_invalid_type_name): New method. + (cp_parser_primary_expression): Correct handling of names not + found by unqualified name lookup in templates. + (cp_parser_nested_name_specifier_opt): Avoid checking dependency + of types when possible. + (cp_parser_simple_declaration): Complain intelligently about some + invalid declarations. + (cp_parser_member_declaration): Likewise. + (cp_parser_constructor_declarator_p): Don't check when we're in a + function scope. + * pt.c (instantiate_class_template): Remove + PARTIAL_INSTANTIATION_P gunk. + * search.c (lookup_field_r): Don't build implicit typenames. + (marked_pushdecls_p): Don't enter dependent base types. + (unmarked_pushdecls_p): Likewise. + * semantics.c (begin_class_definition): Remove implicit typename + stuff. + +2003-01-16 Nathan Sidwell + + PR c++/9212 + * parser.c (cp_parser_direct_declarator): If accepting either + abstract or named, the name must be an unqualified-id. + +2003-01-16 Kaveh R. Ghazi + + * class.c (layout_virtual_bases): Avoid signed/unsigned warning. + +2003-01-14 Kaveh R. Ghazi + + * decl2.c (check_classfn): Fix uninitialized warning. + (build_anon_union_vars): Likewise. + * pt.c (tsubst_copy): Likewise. + +2003-01-14 Jeffrey D. Oldham + + Further conform g++'s __vmi_class_type_info to the C++ ABI + specification. + * rtti.c (dfs_class_hint_mark): Do not set hints not specified by + the specification. + (class_hint_flags): Likewise. + +2003-01-14 Kriang Lerdsuwanakij + + * config-lang.in: Add semantics.c to gtfiles. + * cp-tree.h (flagged_type_tree_s): Remove lookups field. + (saved_scope): Likewise. + (type_lookups): Remove. + (deferred_access): New structure. + (type_access_control): Remove. + (save_type_access_control): Likewise. + (reset_type_access_control): Likewise. + (decl_type_access_control): Likewise. + (push_deferring_access_checks): Declare. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + * decl.c (make_typename_type): Use perform_or_defer_access_check. + (make_unbound_class_template): Likewise. + (grokdeclarator): Don't call decl_type_access_control. + * parser.c (cp_parser_context): Remove deferred_access_checks + and deferring_access_checks_p fields. + (cp_parser_context_new): Adjust. + (cp_parser): Remove access_checks_lists. + (cp_parser_defer_access_check): Remove. + (cp_parser_start_deferring_access_checks): Remove. + (cp_parser_stop_deferring_access_checks): Remove. + (cp_parser_perform_deferred_access_checks): Remove. + (cp_parser_nested_name_specifier_opt): Use new deferred access + functions. + (cp_parser_simple_declaration): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_function_definition): Likewise. + (cp_parser_class_specifier): Likewise. + (cp_parser_lookup_name): Likewise. + (cp_parser_single_declaration): Likewise. + (cp_parser_pre_parsed_nested_name_specifier): Likewise. + (cp_parser_parse_tentatively): Likewise. + (cp_parser_parse_definitely): Likewise. + (yyparse): Likewise. + (cp_parser_init_declarator): Remove access_checks parameter. + Use new deferred access functions. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_class_head): Remove deferring_access_checks_p and + saved_access_checks parameters. Use new deferred access functions. + (cp_parser_member_specification_opt): Don't call + reset_type_access_control. + * search.c (type_access_control): Remove. + * semantics.c: Include "gt-cp-semantics.h". + (deferred_type_access_control): Remove. + (deferred_access_stack): New variable. + (deferred_access_free_list): Likewise. + (push_deferring_access_checks): New function. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): New function, adapted from + cp_parser_perform_deferred_access_checks. + (perform_or_defer_access_check): New function, adapted from + cp_parser_defer_access_check. + (current_type_lookups): Remove. + (deferred_type_access_control): Likewise. + (decl_type_access_control): Likewise. + (save_type_access_control): Likewise. + (reset_type_access_control): Likewise. + (begin_function_definition): Adjust. + (begin_class_definiton): Likewise. + +2003-01-13 Jason Merrill + + PR c++/8748 + * class.c (build_base_path): Take the address before calling save_expr. + + * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if + all the ambiguous conversions are bad. + + * class.c (maybe_warn_about_overly_private_class): Don't stop + searching when we find a nonprivate method. + + * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue. + +2003-01-12 Mark Mitchell + + * cp-tree.h (get_arglist_len_in_bytes): Remove. + + PR c++/9264 + * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous + typeame types more robustly. + +2003-01-11 Phil Edwards + + * parser.c: Fix comment typos. + +2003-01-10 Mark Mitchell + + PR c++/9099 + * parser.c (cp_parser_scope_through_which_access_occurs): Handle + an object_type which is not a class type. + +2003-01-10 Geoffrey Keating + + * parser.c (cp_parser_late_parsing_for_member): Don't cast to void. + (cp_parser_late_parsing_default_args): Likewise. + +2003-01-10 Nathanael Nerode + + * cfns.gperf: ANSIfy function declarations. + * cfns.h: Regenerate. + * cp-tree.h: ANSIfy function declarations. + +2003-01-10 Mark Mitchell + + * cp-tree.h (reparse_absdcl_as_expr): Remove. + (reparse_absdcl_as_casts): Likewise. + (reparse_decl_as_expr): Likewise. + (finish_decl_parsing): Likewise. + * decl2.c (reparse_absdcl_as_expr): Remove. + (reparse_absdcl_as_casts): Likewise. + (repase_decl_as_expr): Likewise. + (finish_decl_parsing): Likewise. + + PR c++/9128 + PR c++/9153 + PR c++/9171 + * parser.c (cp_parser_pre_parsed_nested_name_specifier): New + function. + (cp_parser_nested_name_specifier_opt): Correct the + check_dependency_p false. + (cp_parser_postfix_expression): Fix formatting. + (cp_parser_decl_specifier_seq): Avoid looking for constructor + declarators when possible. + (cp_parser_template_id): Avoid performing name-lookup when + possible. + (cp_parser_class_head): Do not count specializations when counting + levels of templates. + (cp_parser_constructor_declarator_p): Return immediately if + there's no chance that the tokens form a constructor declarator. + * rtti.c (throw_bad_typeid): Add comment. Do not return an + expression with reference type. + (get_tinfo_decl_dynamic): Do not return an expression with + reference type. + (build_typeid): Add comment. Do not return an expression with + reference type. + * typeck.c (build_class_member_access_expr): Improve handling of + conditionals and comma-expressions as objects. + +2003-01-09 Nathanael Nerode + + * cfns.gperf: ANSIfy function declarations. + * cfns.h: Regenerate. + * cp-tree.h: ANSIfy function declarations. + * parser.c: ANSIfy function declarations & definitions. + + * decl.c (bad_specifiers): Fix parameter order error I introduced. + +2003-01-09 Geoffrey Keating + + Merge from pch-branch: + + 2003-01-09 Geoffrey Keating + + Merge to tag pch-merge-20030102: + + * semantics.c (finish_translation_unit): Don't call finish_file. + * parser.c: Don't include ggc.h. + (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer, + read first token here. Don't allow PCH files after the first + token is read. + (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new. + (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL. + (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory. + (cp_parser_late_parsing_for_member): Don't duplicate call to + cp_lexer_set_source_position_from_token. + (cp_parser_late_parsing_default_args): Likewise. + (yyparse): Call finish_file after clearing the_parser. + + 2002-12-11 Geoffrey Keating + + * Make-lang.in: Remove $(GGC_H) from all dependencies. + (CXX_TREE_H): Add $(GGC_H). + * class.c: Don't include ggc.h. + (field_decl_cmp): Make parameters be 'const void *' to match qsort. + (method_name_cmp): Likewise. + (resort_data): New variable. + (resort_field_decl_cmp): New. + (resort_method_name_cmp): New. + (resort_sorted_fields): New. + (resort_type_method_vec): New. + (finish_struct_methods): Delete cast. + (finish_struct_1): Delete cast. + * cp-tree.h: Include ggc.h. + (struct lang_type_class): Add reorder attribute to field `methods'. + (union lang_decl_u3): Add reorder attribute to field `sorted_fields'. + (resort_sorted_fields): New prototype. + (resort_type_method_vec): New prototype. + * call.c: Don't include ggc.h. + * decl.c: Likewise. + * decl2.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + + * lang-specs.h: Remove comment. + + 2002-12-03 Geoffrey Keating + + * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery. + (operator_name_info): Mark to be saved for PCH, specify size. + (assignment_operator_name_info): Likewise. + + 2002-11-19 Geoffrey Keating + + * decl.c (anon_cnt): Mark to be saved for PCH. + + 2002-10-25 Geoffrey Keating + + * lex.c (init_reswords): Delete now-untrue comment. + Allocate ridpointers using GGC. + + 2002-10-04 Geoffrey Keating + + * cp-tree.h (union lang_decl_u2): Add tags to all fields. + + * g++spec.c (lang_specific_driver): Don't include standard + libraries in `added'. + + 2002-08-27 Geoffrey Keating + + * decl2.c (finish_file): Call c_common_write_pch. + * Make-lang.in (CXX_C_OBJS): Add c-pch.o. + + 2002-08-17 Geoffrey Keating + + * g++spec.c (lang_specific_driver): Treat .h files as C++ header + files when using g++. + * lang-specs.h: Handle compiling C++ header files. + +2003-01-09 Jakub Jelinek + + * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs. + +2003-01-09 Kriang Lerdsuwanakij + + * pt.c (push_access_scope_real): Call push_to_top_level for + function in namespace scope. + (pop_access_scope): Call pop_from_top_level for function in + namespace scope. + +2003-01-09 Jakub Jelinek + + * decl.c (start_decl): Don't set DECL_COMMON for __thread variables. + +2003-01-09 Christian Cornelssen + + * Make-lang.in (c++.install-common, c++.install-man, + c++.uninstall): Prepend $(DESTDIR) to destination paths in + all (un)installation commands. + (c++.install-common): Rewrite $(LN) commands to support + DESTDIR with "ln" as well as with "ln -s". + +2003-01-08 Jason Merrill + + * parser.c (cp_parser_primary_expression): See through explicitly + scoped ALIAS_DECLs, too. + +2003-01-08 Nathanael Nerode + + * decl.c: Remove some #if 0 code. + + * decl.c: ANSIfy function declarations. + +2003-01-07 Mark Mitchell + + * parser.c (cp_parser_asm_definition): Correct handling of omitted + operands. + +2003-01-08 Kriang Lerdsuwanakij + + PR c++/9030 + * decl.c (make_typename_type): Check access only when tf_error. + (make_unbound_class_template): Likewise. + * pt.c (saved_access_scope): New variable. + (push_access_scope_real): New function. + (push_access_scope): Likewise. + (pop_access_scope): Likewise. + (tsubst_default_argument): Use them. + (instantiate_template): Likewise. + (regenerate_decl_from_template): Likewise. + (instantiate_decl): Likewise. + (get_mostly_instantiated_function_type): Likewise. + +2003-01-07 Nathanael Nerode + + * tree.c: Delete bogus #if 0 code. + +2003-01-07 Andreas Schwab + + * class.c (layout_class_type): Don't use + PCC_BITFIELD_TYPE_MATTERS if not defined. + +2003-01-06 Mark Mitchell + + PR c++/9165 + * decl2.c (build_cleanup): Mark the object as used. + + * pt.c (retrieve_local_specialization): Revert 2003-01-05 change. + (hash_local_specialization): New function. + (register_local_specialization): Revert 2003-01-05 change. + (instantiate_decl): Use hash_local_specialization when creating + the local_specializations table. + + * decl2.c (mark_used): Do not synthesize thunks. + + * class.c (layout_class_type): Correct handling of unnamed + bitfields wider than their types. + + PR c++/9189 + * parser.c (cp_parser): Remove default_arg_types. Update + documentation for unparsed_functions_queues. + (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the + parameter. + (cp_parser_new): Don't set parser->default_arg_types. + (cp_parser_function_definition): Adjust usage of + unparsed_funtions_queues. + (cp_parser_class_specifier): Don't mess with + parser->default_arg_types. Handle default argument processing in + a separate phase from function body processing. + (cp_parser_template_declaration_after_export): Adjust usage of + unparsed_functions_queues. + (cp_parser_late_parsing_for_member): Do not handle default + arguments. + +2003-01-06 Nathan Sidwell + + PR c++/9109 + * parser.c (cp_parser_declarator_kind): New enum. + (cp_parser_declarator): Adjust. + (cp_parser_direct_declarator): Adjust. Allow for either named or + abstract declarator. Prefer abstract, if possible. Allow + parenthesized function name. + (cp_parser_condition): Adjust cp_parser_declarator call. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_function_definition): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_parameter_declaration): Use cp_parser_declarator to do + the tentative parsing. + (cp_parser_exception_declaration): Likewise. + +2003-01-05 Mark Mitchell + + * parser.c (cp_parser_template_parameter): Adjust call to + cp_parser_parameter_declaration. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Replace + greater_than_is_operator_p with template_parm_p parameter. Do not + cache tokens for template default arguments. + + * pt.c (retrieve_local_specialization): Use htab_find, not + htab_find_with_hash. + (register_local_specialization): Use htab_find_slot, not + htab_find_slot_with_hash. + (instantiate_decl): Pass a hash function to htab_create. + +2003-01-04 Kaveh R. Ghazi + + * parser.c (cp_parser_binary_expression, + cp_parser_multiplicative_expression, + cp_parser_additive_expression, cp_parser_shift_expression, + cp_parser_relational_expression, cp_parser_equality_expression, + cp_parser_and_expression, cp_parser_exclusive_or_expression, + cp_parser_inclusive_or_expression, + cp_parser_logical_and_expression, cp_parser_logical_or_expression, + cp_parser_binary_expression): Const-ify. + +2003-01-04 Mark Mitchell + + * method.c (use_thunk): Disable access control while building the + body of the thunk. + +2003-01-03 Nathanael Nerode + + * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C + front end. + +2003-01-03 Matt Austern + + * cp-tree.h (struct lang_type_class): add field for key method + (cp_global_trees): rename dynamic_classes to keyed_classes + (key_method): add definition + * class.c (finish_struct_1): compute class's key method, and add + the class to keyed_classes list if there is no key method. + * decl.c (finish_function): add class to keyed_classes list if we + see a definition of the class's key method. + * pt.c (instantiate_class_template): add template specialization + of a dynamic class to keyed_classes list. + * decl2.c (key_method): remove + (finish_file): iterate only through keyed_classes list when + deciding whether to emit vtables, remove class from its list after + we do the emission. + +2003-01-02 Jason Merrill + + * call.c (build_conditional_expr): Stabilize lvalues properly. + * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type. + * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues. + Don't allow CALL_EXPR or VA_ARG_EXPR, either. + + * call.c (convert_like_real): Call decl_constant_value for an + IDENTITY_CONV even if there are no more conversions. + + * cvt.c (build_up_reference): Don't push unnamed temps. + + * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL. + + * dump.c (cp_dump_tree): Don't try to dump class-specific fields + for a backend struct. + + * except.c (wrap_cleanups_r, build_throw): Make + MUST_NOT_THROW_EXPRs void. + * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR. + + * init.c (build_vec_delete_1): Pre-evaluate the base address. + + * init.c (get_temp_regvar): Simplify logic. + + * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if + our replacement is a decl. + + * decl.c (cp_make_fname_decl): Push the decls inside the + outermost scope. + +2003-01-03 Nathan Sidwell + + PR c++/45, c++/3784 + * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be + the same too. + +2003-01-03 Graham Stott + + * parser.c (struct cp_parser): Add access_checks_lists field + (cp_parser_simple_declaration): Use. + (cp_parser_init_declarator): Likewise. + +2003-01-02 Mark Mitchell + + * parser.c (cp_parser_declaration): Accept the __extension__ + keyword before the declaration. + + PR c++/2843 + * parser.c (cp_parser_parameter_declaration): Allow attributes to + appear after the declarator. + + * call.c (build_new_method_call): Fix typo in message format + string. + +2003-01-02 Mark Mitchell + + * parser.c (cp_lexer_next_token_is): Declare it inline. + (cp_lexer_set_source_position_from_token): Likewise. + (cp_lexer_debugging_p): Likewise. + (cp_parser_parsing_tentatively): Likewise. + (cp_parser_nested_name_specifier_opt): Reduce the number of calls + to the cp_lexer_peek_token. + + * parser.c (cp_parser_sizeof_operand): Do not evaluate the + expression. + +2003-01-02 Steven Bosscher + + * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c, + cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c, + cp/repo.c: Fix copyright years. + +2003-01-01 Neil Booth + + * lex.c: Remove superfluous include of cpplib.h. + (CONSTRAINT): Define without conditions. + (init_cp_pragma): Use c_register_pragma. + diff --git a/contrib/gcc/cp/ChangeLog-2004 b/contrib/gcc/cp/ChangeLog-2004 new file mode 100644 index 00000000000..dc4636bf3be --- /dev/null +++ b/contrib/gcc/cp/ChangeLog-2004 @@ -0,0 +1,6877 @@ +2004-12-31 Richard Henderson + + PR middle-end/17799 + * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P. + * class.c (build_vtable): Don't conditionallize setting it + based on DWARF2_DEBUG. + (layout_class_type): Set DECL_IGNORED_P. + * decl2.c (get_guard): Likewise. + * rtti.c (get_tinfo_decl, build_lang_decl): Likewise. + * tree.c (build_local_temp): Likewise. + +2004-12-30 Mark Mitchell + + * cp-tree.h (cp_declarator): Split "name" field into + qualifying_scope and unqualified_name. + * decl.c (get_scope_of_declarator): Adjust accordingly. + (grokdeclarator): Likewise. + * decl2.c (grokfield): Likewise, and adjust call to + do_class_using_decl. + * name-lookup.c (do_class_using_decl): Split "decl" into + "scope" and "name". Remove unnecessary code. + * name-lookup.h (do_class_using_decl): Adjust declaration. + * parser.c (make_id_declarator): Split "id" into qualifying_scope + and unqualified_name. + (cp_parser_using_declaration): Adjust call to do_class_using_decl. + (cp_parser_direct_declarator): Adjust to handle the fact that + cp_parser_declarator_id no longer returns a SCOPE_REF. + (cp_parser_direct_declarator): Likewise. + (cp_parser_declarator_id): Do not create a SCOPE_REF for qualified + names. + (cp_parser_member_declaration): Adjust call to make_id_declarator. + (cp_parser_check_declarator_template_parameters): Do not expect a + SCOPE_REF. + + * decl.c (duplicate_decls): Call ggc_free on declarations we will + not be needing any longer. + + PR c++/19190 + * cvt.c (convert_to_void): Do not use STRIP_NOPs. + +2004-12-28 Richard Henderson + + PR inline-asm/15740 + * semantics.c (finish_asm_stmt): Resolve asm names. Validate input + constraints. Mark memory inputs addressable. + +2004-12-27 Jason Merrill + + * decl.c (expand_static_init): Don't use shortcut if + targetm.relaxed_ordering. + +2004-12-27 Mark Mitchell + + PR c++/19149 + * decl.c (check_tag_decl): Robustify. + +2004-12-23 Mark Mitchell + + PR c++/17595 + * parser.c (cp_parser_error): Issue better messages about + #pragma in locations where it is not permitted. + + PR c++/17413 + * pt.c (check_instantiated_args): Remove bogus SFINAE code. + + * cvt.c (convert_to_void): Fix typo in comment. + +2004-12-23 Alexandre Oliva + + PR c++/18962 + * pt.c (check_explicit_specialization): Use the argument list from + the definition in a template function specialization definition. + +2004-12-23 Giovanni Bajo + + PR c++/18733 + * pt.c (check_explicit_specialization): Use special logic to validate + befriended specializations. + +2004-12-22 Mark Mitchell + + * rtti.c (emit_support_tinfos): Avoid using C99 semantics. + + PR c++/18464 + * call.c (build_this): In templates, do not bother with + build_unary_op. + * typeck.c (unary_complex_lvalue): In a template, always refuse + simplifications. + + PR c++/18492 + * cp-gimplify.c (cp_genericize): Relax assertion. + + PR c++/11224 + * cvt.c (convert_to_void): Warn about unused values. + + PR c++/18257 + * rtti.c (emit_support_tinfos): On systems without weak symbols, + emit the runtime library type-info objects as non-COMDAT. + +2004-12-21 Mark Mitchell + + PR c++/18378 + * call.c (convert_like_real): Do not permit the use of a copy + constructor to copy a packed field. + + PR c++/19063 + * decl.c (grokdeclarator): Return error_mark_node, not + void_type_node, to indicate errors. + * parser.c (cp_parser_template_parameter_list): Robustify. + (cp_parser_template_parameter): Likewise. + + PR c++/19034 + * tree.c (cp_tree_equal): Handle OVERLOAD. + +2004-12-22 Volker Reichelt + + * decl.c (define_label): Use POP_TIMEVAR_AND_RETURN. + * name-lookup.c (pushdecl_class_level): Likewise. + +2004-12-21 Volker Reichelt + + * name-lookup.c (pushtag): Add missing POP_TIMEVAR_AND_RETURN. + +2004-12-21 Andrew Pinski + + PR c++/18984 + * cp-gimplify.c (cp_genericize_r): Don't insert first but instead + check to see if contains the pointer. Insert the statement before + returning. + +2004-12-21 Nathan Sidwell + + PR c++/14075 + * decl.c (check_initializer): Check string initializer of array is + not parenthesized. + * cp-tree.h (PAREN_STRING_LITERAL_P): New. + * semantics.c (finish_parenthesized_expr): Mark a STRING_CST. + * error.c (dump_expr): Add parens, if needed. + + * cp-tree.def (TEMPLATE_TYPE_PARM, + BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder + for better code efficiency. + * cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check. + (CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization. + (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P, + INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P, + CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P, + TYPE_PTROBV_P): Likewise. + + PR c++/18975 + * method.c (do_build_copy_constructor): Refactor. Don't const + qualify a mutable field. + (do_build_assign_ref): Likewise. + +2004-12-20 Matt Austern + + PR c++/19044 + * decl.c (make_rtl_for_nonlocal_decl): Use + set_builtin_user_assembler_name. + +2004-12-19 Mark Mitchell + + * cp-tree.h (note_decl_for_pch): New function. + * class.c (build_clone): Call note_decl_for_pch. + * semantics.c (finish_member_declaration): Likewise. + (note_decl_for_pch): New function. + +2004-12-17 Steven Bosscher + + * init.c (build_zero_init): max_index is the number of + elements, minus 1. + +2004-12-17 Nathan Sidwell + + PR c++/18721 + * class.c (add_method): Do not push conversion operators into a + binding level. + + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat. + * error.c (dump_decl): Remove extraneous braces. + +2004-12-16 Nathan Sidwell + + PR c++/18905 + * cp-tree.h (integral_constant_value): Declare. + * call.c (null_ptr_cst_p): Use integral_constant_value, not + decl_constant_value. + (convert_like_real): Likewise. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (ocp_convert): Likewise. + (convert): Remove unnecessary decl_constant_value call. + * decl.c (compute_array_index_type): Use integral_constant_value, + not decl_constant_value. + (build_enumerator): Likewise. + * decl2.c (grokfield): Likewise. + * init.c (decl_constant_value): Simplify. + (integral_constant_value): New. + * pt.c (fold_decl_constant_value): Use integral_constant_value, + remove subsequent check. + (tsubst): Use integral_constant_value, not decl_constant_value. + (tsubst_copy, unify): Likewise. + * typeck.c (decay_conversion): Likewise. + (build_compound_expr): Remove unnecessary decl_constant_value + calls. + (build_static_cast_1, build_reinterpret_cast_1): + (convert_for_assignment): Remove comment about not calling + decl_constant_value. + +2004-12-15 Kriang Lerdsuwanakij + + PR c++/18825 + * pt.c (instantiate_class_template): Set input_location for + friend function. + (tsubst_friend_function): Don't set input_location here. + Make sure the context is complete if necessary. + +2004-12-15 Nathan Sidwell + + PR c++/18981 + * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE + flag setting. + +2004-12-14 Mark Mitchell + + PR c++/18738 + * decl.c (make_typename_type): Do not handle namespace-scoped + names here. + (tag_name): Handle typename_type. + (check_elaborated_type_specifier): Handle typenames. + * parser.c (cp_parser_diagnose_invalid_type_name): Improve + comment. + (cp_parser_elaborated_type_specifier): Use + cp_parser_diagnose_invalid_type_name. + +2004-12-14 Andrew Pinski + + PR c++/18965 + * init.c (build_zero_init): If the max_index is 0, there is no + need to create a RANGE_EXPR. + +2004-12-14 Mark Mitchell + + PR c++/18793 + * cp-objcp-common.c (cp_expr_size): Loosen assertion. + +2004-12-14 Nathan Sidwell + + PR c++/18949 + * pt.c (tsubst_copy_and_build): Check that a + REFERENCE_REF_P is dereferencing a reference type. + * typeck.c (build_static_cast): Convert from reference even in a + template. + (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise. + +2004-12-14 Volker Reichelt + + * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function. + (cp_parser_name_lookup_error): Use it. + (cp_parser_check_for_invalid_template_id): Likewise. + (cp_parser_skip_to_closing_parenthesis): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_simple_declaration, cp_parser_template_id): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_template_name): Let cp_parser_simulate_error perform + the checking. + (cp_parser_committed_to_tentative_parse): Remove. + +2004-12-13 Andrew Pinski + + PR c++/18968 + * class.c (build_base_path): Convert the zero constant to the correct + type when comparing. + +2004-12-13 Mark Mitchell + + PR c++/18925 + * class.c (layout_class_type): Determine the visibility of static + data members. + +2004-12-12 Roger Sayle + + PR middle-end/12454 + * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the + condition is a constant and the unexecuted clause is empty. + +2004-12-10 Volker Reichelt + + PR c++/18731 + * parser.c (cp_parser_class_head): Reject typedef-name in class head. + +2004-12-09 Matt Austern + + PR c++/18514 + * name-lookup.c (do_nonmember_using_decl): A real function + declaration takes precedence over an anticipated declaration. + +2004-12-09 Volker Reichelt + + * parser.c (cp_parser_member_declaration): Fix comment typo. + +2004-12-09 Alexandre Oliva + + PR c++/18757 + * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID + if parsing failed. + +2004-12-09 Volker Reichelt + + PR c++/18073 + * typeck.c (build_reinterpret_cast_1): Allow cast from vector type. + +2004-12-09 Nathan Sidwell + + PR c++/16681 + * init.c (build_zero_init): Build a RANGE_EXPR for an array + initializer. + +2004-12-08 Kelley Cook + + * typeck.c: Remove DOS line endings. + +2004-12-08 Kriang Lerdsuwanakij + + PR c++/18100 + * decl.c (lookup_and_check_tag): Diagnose nested class with + the same name as enclosing class. + +2004-12-08 Nathan Sidwell + + PR c++/18803 + * cp-tree.h (REFERENCE_REF_P): New. + (CPTI_TYPE_INFO_TYPE): Rename to ... + (CPTI_CONST_TYPE_INFO_TYPE): ... here. + (CPTI_TYPE_INFO_REF_TYPE): Remove. + (type_info_type_node): Rename to ... + (const_type_info_type_node): ... here. + (type_info_ref_type): Remove. + * call.c (build_user_type_conversion): Reformat. + (resolve_args): Do not convert_from_reference. + (build_object_call): Call convert_from_reference. + (prep_operand): Do not convert_from_reference. + (build_new_method_call): Likewise. + * class.c (build_vfield_ref): Likewise. + * cvt.c (convert_to_reference): Likewise. + (convert_from_reference): Build INDIRECT_REF here, not with + build_indirect_ref. + (convert_force): Do not convert_from_reference. + (build_expr_type_conversion): Likewise. + * decl.c (grok_reference_init): Likewise. + * decl2.c (delete_sanity): Likewise. + * except.c (initialize_handler_parm): Use POINTER_TYPE_P. + * init.c (build_dtor_call): Do not convert_from_reference. + * parser.c (cp_parser_template_argument): Unwrap indirected + reference. Allow TEMPLATE_PARM_INDEX as an object parm. + * pt.c (tsubst_copy_and_build) : Use + convert_from_reference, if indicated. + : Do not convert_from_reference. + : Convert_from_reference if needed. + (tsubst_initializer_list): Do not convert_from_reference. + * rtti.c (init_rtti_processing): Adjust node creation. + (throw_bad_typeid): Use const_type_info_type_node. + Do not convert_from_reference. + (typeid_ok_p): Use const_type_info_type_node. + (build_typeid, get_typeid): Always return type_info typed node. + (build_dynamic_cast_1): Dont convert_from_reference. Refactor. + * semantics.c (finish_stmt_expr_expr): Do not + convert_from_reference. + (finish_id_expression): Convert_from_reference as appropriate. + * typeck.c (decay_conversion): Do not convert_from_reference. + (finish_class_member_access_expr): Likewise. + (build_indirect_ref): Use POINTER_TYPE_P. + (convert_arguments): Do not convert_from_reference. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2004-12-07 Ziemowit Laski + + * cp-tree.h (struct lang_type_class): Rename 'objc_protocols' + field to 'objc_info'. + +2004-12-07 Kazu Hirata + + * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH. + +2004-12-07 Roger Sayle + + * name-lookup.c (leave_scope): We only need to update + class_binding_level when leaving a class scope. + +2004-12-06 Ziemowit Laski + + * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field. + +2004-12-04 Kriang Lerdsuwanakij + + PR c++/17011, c++/17971 + * pt.c (tsubst_copy) : Check and diagnose + invalid field. + (tsubst_copy_and_build) : Check + error_mark_node after member substitution. + * semantics.c (finish_id_expression): Call + finish_non_static_data_member for non-dependent FIELD_DECL. + +2004-12-03 Nathan Sidwell + + PR c++/18782 + * decl.c (grokdeclarator): Make sure class in pointer to member is + not a namespace. + +2004-12-02 Nathan Sidwell + + PR c++/18318 + * parser.c (cp_parser_new_type_id): Move array size expression + checks from here ... + * init.c (build_new): ... to here. + +2004-12-02 Nathan Sidwell + + PR c++/18758 + * parser.c (cp_parser_class_head): Return NULL_TREE when + push_template_decl fails. Update comment. + +2004-12-02 Kriang Lerdsuwanakij + + PR c++/15664, c++/18276 + * pt.c (tsubst_decl) : Reorganize. Correctly + tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM. + +2004-12-02 Kriang Lerdsuwanakij + + PR c++/18123 + * parser.c (cp_parser_type_specifier): Catch template declaration + of enum. + +2004-12-01 Matt Austern + + * name-lookup.c (namespace_binding): Omit alias check for global + namespace. + +2004-12-01 Nathan Sidwell + + PR c++/18729 + * parser.c (cp_parser_class_name): Check decl's type is not + error_mark_node. + + PR c++/17431 + * call.c (standard_conversion): Add FLAGS parameter. Do not allow + derived to base conversion when checking constructor + accessibility. + (implicit_conversion): Pass FLAGS to standard_conversion. + (check_constructir_callable): Disallow conversion functions. + +2004-11-30 Kazu Hirata + + * parser.c: Fix comment typos. + +2004-11-27 Mark Mitchell + + PR c++/18368 + * parser.c (cp_parser_check_for_definition_in_return_type): Take + the defined type as a parameter, and inform the user about the + possibility of a missing semicolon. + (cp_parser_explicit_instantiation): Adjust call to + cp_parser_check_for_definition_in_return_type. + (cp_parser_init_declarator): Likewise. + (cp_parser_member_declaration): Likewise. + + PR c++/18674 + * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit + typename from comments. + * cp-tree.h (TYPENAME_IS_ENUM_P): New macro. + (TYPENAME_IS_CLASS_P): Likewise. + (make_typename_type): Change prototype. + * decl.c (struct_typename_info): New type. + (typename_compare): Expect the second argument to be a + typename_info, not a tree. + (build_typename_type): Add tag_type parameter. Do not create a + new type until necessary. + (make_typename_type): Add tag_type parameter. + * error.c (TYPENAME_TYPE): Print tags other than "typename" if + appropriate. + * friend.c (make_friend_class): Adjust call to make_typename_type. + * parser.c (cp_parser_make_typename_type): Likewise. + (cp_parser_primary_expression): Adjust call to + cp_parser_lookup_name. + (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name. + (cp_parser_class_or_namespace_name): Likewise. + (cp_parser_postfix_expression): Adjust calls to + make_typename_type. + (cp_parser_mem_initializer_id): Adjust calls to + cp_parser_class_name. + (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name. + (cp_parser_template_name): Likewise. + (cp_parser_template_argument): Likewise. + (cp_parser_type_name): Adjust call to cp_parser_class_name. + (cp_parser_elaborated_type_specifier): Adjust calls to + make_typename_type and cp_parser_lookup_name. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Replace type_p parameter with tag_type. + Adjust calls to make_typename_type and cp_parser_lookup_name. + (cp_parser_class_head): Adjust calls to cp_parser_class_name. + (cp_parser_base_specifier): Likewise. + (cp_parser_lookup_name): Replace is_type parameter with tag_type. + Adjust calls to make_typename_type and lookup_qualified_name. + (cp_parser_lookup_name_simple): Adjust call to + cp_parser_lookup_name. + (cp_parser_constructor_declarator_p): Adjust call to + cp_parser_class_name. + * pt.c (convert_template_argument): Adjust all to + make_typename_type. + (tsubst_decl): Do not pre-substitute the type of the declaration. + (tsubst): Hand off declarations more quickly. Adjust call to + make_typename_type. + + PR c++/18512 + * parser.c (cp_parser_postfix_dot_deref_expression): Robustify. + +2004-11-29 Daniel Jacobowitz + + PR c/7544 + * Make-lang.in (cp/decl2.o): Update dependencies. + * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks. + +2004-11-29 Kriang Lerdsuwanakij + + PR c++/18652 + * name-lookup.c (pushtag): Change return type to tree. + * cp-tree.h (pushtag): Adjust declaration. + * decl.c (xref_tag, start_enum): Use return value of pushtag. + * pt.c (push_template_decl_real): Return immediately if + pushdecl_namespace_level returns error_mark_node. + +2004-11-27 Kazu Hirata + + * pt.c: Fix a comment typo. + +2004-11-27 Kriang Lerdsuwanakij + + Friend class name lookup 4/n + * class.c (pushclass): Don't call cxx_remember_type_decls. + * cp-tree.h (clear_anon_tags): Remove declaration. + * decl.c (grokdeclarator): Don't call lookup_tag_reverse. + * name-lookup.c (binding_entry_free, binding_table_free): Comment + out functions. + (binding_table_find_anon_type, binding_table_reverse_maybe_remap, + binding_table_remove_anonymous_types, cxx_remember_type_decls, + bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag, + lookup_tag_reverse): Remove + (begin_scope, leave_scope, kept_level_p, print_binding_level): + Don't use type_decls field in cp_binding_level. + (maybe_process_template_type_declaration, pushtag): Set + CLASSTYPE_NESTED_UTDS directly. + * name-lookup.h (binding_table_remove_anonymous_types, + cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove + declaration. + (cp_binding_level): Remove type_decls field. + +2004-11-26 Kazu Hirata + + * typeck.c: Fix a comment typo. + +2004-11-25 Mark Mitchell + + PR c++/18445 + * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with + unknown_type as non matching. Tidy up. + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for a VAR_DECL. + + PR c++/18001 + * cp-tree.h (lvalue_or_else): Remove declaration. + * tree.c (lvalue_or_else): Remove. + * typeck.c (build_unary_op): Adjust call to lvalue_or_else. + (build_modify_expr): Likewise. + + PR c++/18625 + * decl.c (duplicate_decls): Return error_mark_node on error, as + specified. + + PR c++/18466 + * decl.c (grokvardecl): Keep track of whether or not a there was + explicit qualification. + * name-lookup.c (set_decl_namespace): Complain about explicit + qualification of a name within its own namespace. + + PR c++/18545 + * typeck.c (check_return_expr): Robustify. + +2004-11-25 Kriang Lerdsuwanakij + + Friend class name lookup 3/n, PR c++/3332 + * name-lookup.c (push_inner_scope, pop_inner_scope): New functions. + (lookup_type_scope): Don't deal with name from user declaration + specially. + * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations. + * parser.c (cp_parser_class_specifier): Use push_inner_scope and + pop_inner_scope. + +2004-11-25 Kriang Lerdsuwanakij + + Friend class name lookup 2/n, PR c++/14513, c++/15410 + * name-lookup.c (lookup_name_real): Simplify. + (lookup_type_scope): Add SCOPE parameter. Handle friend class + lookup. + * name-lookup.h (tag_scope): New enum type. + (lookup_type_scope): Adjust declaration. + * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type): + Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE. + (start_enum): Likewise. Add assertion test that NAME is + IDENTIFIER_NODE. Use anonymous name for dummy ENUMERAL_TYPE in + case of error. + * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations. + * parser.c (cp_parser_elaborated_type_specifier, + cp_parser_class_head): Adjust call to xref_tag. + * pt.c (lookup_template_class, instantiate_class_template): + Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast_1, + tinfo_base_init, emit_support_tinfos): Likewise. + +2004-11-25 Joseph S. Myers + + * g++spec.c, lex.c: Avoid ` as left quote in diagnostics. + +2004-11-24 Mark Mitchell + + PR c++/17473 + * name-lookup.c (supplement_binding): Do not allow typedefs to be + redefined in class scope. + + PR c++/18285 + * parser.c (cp_parser_set_decl_type_spec): Do not try to allow + redefinitions of builtin types other that "bool" or "wchar_t". + +2004-11-24 Steven Bosscher + + * decl.c (cxx_init_decl_processing): Don't clear + flag_inline_functions. + +2004-11-24 Mark Mitchell + + * pt.c (tsubst_function_type): Do not permit function types which + return arrays or functions. + + PR c++/18586 + * parser.c (cp_parser_init_declarator): Do not pop scope twice. + + PR c++/18530 + * cp-tree.h (CTOR_NAME): Remove. + (DTOR_NAME): Remove. + * decl.c (initialize_predefined_identifiers): Add spaces to the + end of constructor and destructor names. + +2004-11-24 Giovanni Bajo + + PR c++/8929 + * decl.c (start_decl): Check for invalid specialization headers. + +2004-11-24 Paolo Bonzini + + PR c++/16882 + + * call.c (standard_conversion): Move check for conversions between + vector pointers... + * typeck.c (ptr_reasonably_similar): ... here. + +2004-11-23 Ben Elliston + + * cp-tree.h (context_as_string): Remove extern. + * error.c (context_as_string): Remove. + + * cp-tree.h (cp_type_qual_from_rid): Remove extern. + * lex.c (cp_type_qual_from_rid): Remove. + + * cp-tree.h (do_poplevel): Remove extern. + (check_multiple_declarators): Likewise. + * semantics.c (do_poplevel): Make static. + (check_multiple_declarators): Remove. + + * cp-tree.h (check_final_overrider): Remove extern. + * search.c (check_final_overrider): Make static. + + * cp-tree.h (build_artificial_parm): Remove extern. + * decl2.c (build_artificial_parm): Make static. + +2004-11-22 Giovanni Bajo + + PR c++/18354 + * typeck.c (build_unary_op) : Unify code. + Make sure the result is always a rvalue. + +2004-11-16 Giovanni Bajo + + * decl.c (start_preparsed_function): Call check_function_type even + in templates. + (require_complete_types_for_parms): Skip dependent types. + (check_function_type): Likewise. + +2004-11-16 Steven Bosscher + + * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h. + * search.c: Don't include it. + +2004-11-15 Andrew Pinski + + * cp-gimplify.c: Include pointer-set.h + (cp_genericize_r): Use pointer_sets instead of a hashtable. + Also instert the new statement for CLEANUP_STMT. + (cp_genericize): Use pointer_sets instead of a hashtable. + * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h. + +2004-11-15 Kriang Lerdsuwanakij + + Friend class name lookup 1/n, PR c++/18471 + * decl.c (lookup_and_check_tag): New function. + (xref_tag, start_enum): Use it. + (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check + before !DECL_IMPLICIT_TYPEDEF_P. Also display previously declared + location. + * name-lookup.c (lookup_name_current_level): Rename to ... + (lookup_name_innermost_nonclass_level): ... this. + (lookup_type_scope): New function. + * name-lookup.h (lookup_name_current_level): Rename to ... + (lookup_name_innermost_nonclass_level): ... this. + (lookup_type_scope): Add declaration. + +2004-11-14 Kriang Lerdsuwanakij + + PR c++/17344 + * pt.c (coerce_template_parms): Only emit error message about + invalid template argument when TF_ERROR. + +2004-11-12 Mark Mitchell + + PR c++/18389 + * decl.c (start_decl): Make sure to set *pop_scope_p. Return + error_mark_node to indicate errors. + + PR c++/18429 + * parser.c (cp_parser_direct_declarator): Disallow non-constant + array bounds when not inside a function. + + PR c++/18436 + * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an + unqualified name resolves to a member function. + + PR c++/18407 + * pt.c (tsubst_copy_and_build): Handle qualified names used from a + derived class correctly. + + * decl2.c (import_export_decl): Fix typo in comment. + * tree.c (pod_type_p): Likewise. + +2004-11-10 Andrew Pinski + + * typeck.c (cxx_mark_addressable): Add braces around the first if. + +2004-11-10 Adam Nemet + + PR middle-end/18160 + * typeck.c (cxx_mark_addressable): Issue an error if address of an + explicit register variable is requested. + +2004-11-10 Nathan Sidwell + + PR c++/18143 + * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New. + (struct lang_decl_flags): Add thunk_p flag. + (struct lang_decl): Remove separate fixed_offset. Place + cloned_function and fixed_offset into union. + (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust. + (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust. + (THUNK_FIXED_OFFSET): Adjust. + * method.c (make_thunk): Adjust. + +2004-11-09 Mark Mitchell + + PR c++/18369 + * init.c (build_new_1): Handle parenthesized type-ids that name an + array type. Tidy. + +2004-11-09 Joseph S. Myers + + * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, + pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for + quoting in diagnostics. + * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for + quoting in printf format. + * decl.c (duplicate_decls, start_decl): Use %qD instead of + unquoted %D. + +2004-11-08 Kazu Hirata + + * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c, + search.c, typeck2.c: Fix comment formatting. + +2004-11-04 Ulrich Weigand + + PR tree-optimization/18184 + * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers + of different modes or alias-all flags as equivalent. + * typeck.c (comptypes): Likewise. + +2004-11-04 Giovanni Bajo + + DR 49, 100 + * cp-tree.h (TYPE_REF_OBJ_P): New macro. + (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P, + TYPE_REFFN_P): Document. + (fold_decl_constant_value): New prototype. + * pt.c (convert_nontype_argument_function): Rewrite and extract + parts into... + (fold_decl_constant_value, convert_nontype_argument_function): New. + (lookup_template_class): Add comment about useless double call. + * mangle.c (write_expression): Strip conversions before lowering + pointer to members. + * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow + enum to enum conversion. + +2004-11-02 Mark Mitchell + + PR c++/18124 + * parser.c (cp_parser_type_parameter): Robustify. + + PR c++/18155 + * parser.c (cp_parser_single_declaration): Disallow template + typedefs. + + PR c++/18177 + * typeck.c (build_const_cast): Use error_operand_p. + +2004-11-02 Ziemowit Laski + + * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition. + (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h. + * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here + from cp-lang.c. + * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here + from cp-lang.c. + (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c. + +2004-11-01 Nathan Sidwell + + PR c++/18064 + * search.c (check_final_overrider): Deprecate gnu covariant extension. + +2004-10-31 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 9/n + * typeck.c (build_x_unary_op, convert_member_func_to_ptr, + get_delta_difference): Use new quotation style. + * repo.c (reopen_repo_file_for_write): Likewise. + * pt.c (do_type_instantiation): Likewise. + * parser.c (cp_parser_diagnose_invalid_type_name): + * name-lookup.c (push_overloaded_decl, set_decl_namespace): + * error.c (cp_print_error_function, + print_instantiation_full_context): Likewise. + * decl.c (define_label, grok_reference_init, + maybe_deduce_size_from_array_init, revert_static_member_fn): + * decl2.c (check_classfn): Likewise. + * class.c (add_method, check_field_decls, layout_class_type, + resolve_address_of_overloaded_function): Likewise. + * call.c (build_x_va_arg, build_over_call): Likewise. + +2004-10-31 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 8/n + * cvt.c (cp_convert_to_pointer, warn_ref_binding, + convert_to_reference, ocp_convert, convert_to_void + cp_convert_to_pointer): Use new quotation style. + +2004-10-31 Mark Mitchell + + PR c++/15172 + * typeck2.c (store_init_value): Use split_nonconstant_init even + for types that require construction. + +1004-10-28 Matt Austern + + PR c++/17542 + * cp-tree.h (class_key_or_enum_as_string): Declare. + * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string + and remove static qualifier. + * decl.c (shadow_tag): Warn about ignored attributes in class/struct/ + union/enum declaration. + +2004-10-29 Kazu Hirata + + * pt.c: Fix a comment typo. + +2004-10-28 Nathan Sidwell + + * typeck.c (composite_pointer_type): Remove comment about DR 195. + (build_reinterpret_cast_1): Revert DR195 patch. Only emit a + warning when being pedantic. + (build_reinterpet_cast, build_c_cast): Adjust. + +2004-10-29 Mark Mitchell + + PR c++/17695 + * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they + appear in a constructor/destructor that will be cloned. + +1004-10-28 Matt Austern + + PR c++/14124 + * decl.c (finish_enum): Handle packed attribute. + * parser.c (cp_parser_enum_specifier): Process trailing attributes. + +2004-10-28 Mark Mitchell + + PR c++/17132 + * pt.c (instantiate_class_template): Increment + processing_template_decl when substituting into a member class + template. + +2004-10-27 Mark Mitchell + + PR c++/17435 + * call.c (convert_like_real): Fix formatting. + (initialize_reference): When binding a temporary to a base class, + ensure that the nominal copy made is to the derived class, not the + base class. + + PR c++/18140 + * parser.c (cp_parser_next_token_ends_template_argument_p): Do not + include ">>". + +2004-10-27 Andrew Pinski + + * decl.c (bad_specifiers): Move the q after the %. + +2004-10-27 Andrew Pinski + + * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after + the %. + +2004-10-26 Mark Mitchell + + * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT. + * search.c (current_scope): Fix prototype. + + PR c++/18093 + * search.c (current_scope): Return the innermost non-block scope, + not the innermost non-block, non-namespace scope. + (at_namespace_scope_p): Adjust accordingly. + (dfs_accessible_post): Do not pass namespaces to is_friend. + (dfs_walk_once_accessible_r): Likewise. + * decl.c (grokvardecl): Adjust call to current_scope. + (build_enumerator): Likewise. + * parser.c (cp_parser_using_declaration): Likewise. + (cp_parser_direct_declarator): Use at_namespace_scope_p instead of + current_scope. + (cp_parser_class_head): Adjust call to current_scope. + * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the + alias. + + PR c++/18020 + * pt.c (tusbst_copy_and_build): Resolve enumeration constants to + their underlying values. + + PR c++/18161 + * typeck.c (build_binary_op): Honor build_type, even when in a + template. + +2004-10-26 Nathan Sidwell + + * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded + padding token checking. + +2004-10-25 Andrew Pinski + + PR c++/18121 + * decl.c (grokdeclarator) : Remove the call + layout_type as it is already done by create_array_type_for_decl. + +2004-10-22 Nathan Sidwell + + PR c++/18095 + * parser.c (eof_token): Make const, correctly initialize rid and + location fields. + (struct cp_lexer): Replace buffer_end pointer with buffer_length + count. Adjust. + (cp_lexer_new_main): Directly grow lexer's buffer here. Don't + zero it out. + (cp_lexer_new_from_tokens): Adjust. + (cp_lexer_grow_buffer): Remove. + (cp_lexer_peek_nth_token, cp_lexer_consume_token, + cp_lexer_purge_token): Add const casts. + +2004-10-21 Mark Mitchell + + PR c++/18073 + PR c++/10841 + * cp-tree.h (convert_to_base): Change prototype. + (build_ptrmemfunc): Likewise. + (convert_ptrmem): New function. + * call.c (struct conversion): Adjust documentation for base_p. + (standard_conversion): Set base_p for ck_pmem conversions as + appropriate. + (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr + conversions. + * class.c (convert_to_base): Handle both pointers and objects. + Add nonnull parameter. + (build_vfield_ref): Adjust call to convert_to_base. + * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc. + (convert_force): Likewise. + * typeck.c (build_unary_op): Likewise. + (convert_ptrmem): New function. + (build_static_cast_1): Use it. + (build_reinterpret_cast): Allow conversions to vector types. + (get_delta_difference): Add c_cast_p parameter. + (build_ptrmemfunc): Likewise. Adjust calls to + get_delta_difference. + +2004-10-21 Andrew Pinski + + PR c++/13560 + * error.c (cp_error_at): Output the context as it might be + different file as the other location. + +2004-10-21 Kazu Hirata + + * typeck.c: Fix a comment typo. + +2004-10-20 Kriang Lerdsuwanakij + + PR c++/13495 + * decl.c (make_unbound_class_template): Add PARM_LIST parameter. + * cp-tree.h (make_unbound_class_template): Adjust prototype. + * parser.c (cp_parser_lookup_name): Adjust call to + make_unbound_class_template. + (cp_parser_single_declaration): Handle member class of class + template as template friend parsing correctly. + * friend.c (is_friend): Call is_specialization_of_friend for + template friend class. + (make_friend_class): Handle member class of class template as + template friend. + * pt.c (is_specialization_of_friend): Likewise. + (instantiate_class_template): Likewise. + (tsubst): Adjust call to make_unbound_class_template. + +2004-10-20 Nathan Sidwell + + * typeck.c (composite_pointer_type): Add comment about DR 195 + (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter. + Allow function pointer conversions that DR195 suggests. + (build_reinterpret_cast, build_c_cast): Update + build_reinterpret_cast_1 calls. + +2004-10-20 Kazu Hirata + + * call.c, typeck.c: Fix comment typos. + +2004-10-20 Nathan Sidwell + + * parser.c (cp_token_position): New typedef. Define VEC thereof. + (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make + next_token and last_token cp_token_position. Make saved_tokens a + VEC(cp_token_position). + (eof_token): New static variable. + (CP_SAVED_TOKENS_SIZE): Rename to ... + (CP_SAVED_TOKEN_STACK): ... here. + (cp_lexer_new_main): Adjust main lexer creation and buffer + filling. + (cp_lexer_new_from_tokens): Do not copy the tokens, merely point + to the parent buffer. Do not append eof token. + (cp_lexer_destroy): Only free buffer if non-NULL. Free token + stack. + (cp_lexer_next_token, cp_lexer_prev_token): Remove. + (cp_lexer_token_position, cp_lexer_token_at): New. + (cp_lexer_saving_tokens): Adjust. Make inline. + (cp_lexer_advance_token, cp_lexer_token_difference): Remove. + (cp_lexer_peek_token_emit_debug_info): Fold into ... + (cp_lexer_peek_token): ... here. + (cp_lexer_peek_nth_token): Don't peek past EOF. + (cp_lexer_consume_token): Set next_token to eof_token, if reaching + EOF. + (cp_lexer_purge_token): Adjust eof setting. + (cp_lexer_purge_tokens_after): Likewise. + (cp_lexer_save_tokens): Push next_token directly. + (cp_lexer_commit_tokens): Adjust. + (cp_lexer_rollback_tokens): Pop next_token directly. + (cp_parser_check_for_invalid_template_id): Adjust token purging. + (cp_parser_translation_unit): Do not consume the EOF. + (cp_parser_nested_name_specifier_opt): Adjust token purging. + (cp_parser_template_id, cp_parser_template_name): Likewise. + +2004-10-19 Mark Mitchell + + PR c++/14035 + * call.c (struct conversion): Add base_p. + (convert_like): Add c_cast_p argument. + (convert_like_with_conversion): Likewise. + (build_conv): Clear base_p. + (standard_conversion): Set it, for derived-to-base conversions. + (convert_like_real): Add c_cast_p parameter. Handle pointer + conversions directly rather than relying on ocp_convert. + (perform_direct_initialization_if_possible): Add c_cast_p + parameter. + * cp-tree.h (perform_direct_initialization_if_possible): Change + prototype. + (convert_member_func_to_ptr): New function. + * typeck.c (check_for_casting_away_constness): Add diag_fn + parameter. + (build_static_cast_1): New function, split out from ... + (build_static_cast): ... here. Use build_static_cast_1. + (build_reinterpret_cast_1): New function, split out from ... + (build_reinterpret_cast): ... here. Use build_reinterpret_cast_1. + (build_const_cast_1): New function, split out from ... + (build_const_cast): ... here. Use build_const_cast_1. + (build_c_cast): Rewrite to use build_const_cast_1, + build_static_cast_1, and build_reinterpret_cast_1. + (convert_member_func_to_ptr): New function. + +2004-10-19 Paolo Bonzini + + PR c++/18047 + * parser.c (enum cp_parser_prec): Give relational expressions + a higher precedence than equality expressions. + +2004-10-15 Nathan Sidwell + + * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call. + (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove. + (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call. + (enum base_access): Reorganize. + (accessible_base_p, accessible_p): Add consider_local_p parameter. + * call.c (standard_conversion): Update comment about + DERIVED_FROM_P. + (enforce_access): Adjust accessible_p call. + (build_over_call): Adjust accessible_base_p call. + * class.c (convert_to_base): Adjust lookup_base call. + (build_vtbl_ref_1): Likewise. + (warn_about_ambiguous_bases): Likewise. Add early exit. + * cvt.c (convert_to_pointer_force) Adjust lookup_base call. + * search.c (accessible_base_p): Add consider_local_p parameter. + (lookup_base): Pass consider_local_p to accessible_base_p call. + (friend_accessible_p): Check whether scope is a class member. + Remove unnecessary class template check. + (accessible_p): Add consider_local_p parameter. Use it. + (adjust_result_of_qualified_name_lookup): Adjust lookup_base call. + * tree.c (maybe_dummy_object): Likewise. + * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P. + (build_class_member_access_expr): Adjust lookup_base call. + * typeck2.c (binfo_or_else): Likewise. + * rtti.c (build_dynamic_cast_1): Access can consider friendship + and current scope. + +2004-10-17 Giovanni Bajo + + PR c++/17743 + * decl2.c (grokfield): Apply attributes also to TYPE_DECLs. + +2004-10-16 Giovanni Bajo + + PR c++/10479 + * parser.c (cp_parser_parenthesized_expression_list): Fold + non-dependent expressions in attribute lists. + +2004-10-15 Mark Mitchell + + PR c++/17042 + * decl.c (declare_global_var): Use the return value from pushdecl. + + PR c++/14667 + * parser.c (cp_parser_simple_declaration): Do not diagnose invalid + type names if we have already found a valid type. + (cp_parser_member_declaration): Likewise. + + PR c++/17916 + * parser.c (cp_parser_member_specification_opt): Handle + CPP_PRAGMA. + +2004-10-15 Kazu Hirata + + * dump.c, g++spec.c, repo.c: Update copyright. + +2004-10-15 Kazu Hirata + + * decl.c: Fix a comment typo. + +2004-10-13 Andrew Pinski + + PR c++/16301 + * name-lookup.c (parse_using_directive): If we have a + error_mark_node, do not set the decl namespace associations + on it. + +2004-10-14 Mark Mitchell + + PR c++/17976 + * decl.c (cp_finish_decl): Do not call expand_static_init more + than once for a single variable. + +2004-10-14 Matt Austern + + * Make-lang.in (pt.o): depends on pointer-set.h + * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now. + * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t + (for_each_template_parm): Convert from htab_t to pointer_set_t. + * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now. + +2004-10-13 Andrew Pinski + + PR c++/17661 + * semantics.c (finish_for_expr): Convert expression to void + so that we don't create temporaries for a?b:c. + +2004-10-13 Kazu Hirata + + * search.c: Fix a comment typo. + +2004-10-12 Nathan Sidwell + + * class.c (dfs_modify_vtables): Simplify condition. Return + dfs_skip_bases as appropriate. + (modify_all_vtables): Walk in pre-order. + * search.c (dfs_walk_all, dfs_walk_once_r, + dfs_walk_once_accessible_r): Assert post order function never + returns dfs_skip_bases. + + * search.c (struct lookup_base_data_s): New. + (lookup_base_r): Replace with ... + (dfs_lookup_base): ... this. + (lookup_base): Use dfs_walk_all. + +2004-10-12 Kazu Hirata + + * search.c: Fix comment typos. + +2004-10-11 Mark Mitchell + + PR c++/15786 + * parser.c (cp_parser_declarator): Add member_p parameter. + (cp_parser_condition): Adjust calls to cp_parser_declarator. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_direct_declarator): Add member_p parameter. Do not + parse tentatively when parsing the parameters to a member. + (cp_parser_type_id): Adjust calls to cp_parser_declarator. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + + PR c++/17936 + * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment. + * pt.c (optimize_specialization_lookup_p): Do not optimize lookups + for members of partial or explicit specializations. + + PR c++/17929 + * decl2.c (finish_anon_union): Robustify. + +2004-10-11 Nathan Sidwell + + * cp-tree.h (get_dynamic_cast_base_type): Rename to ... + (dcast_base_hint): ... here. + * rtti.c (build_dynamic_cast_1): Use dcast_base_hint. + * search.c (struct dcast_data_s): New. + (dynamic_cast_base_recurse): Remove. Replace with ... + (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New. + (get_dynamic_cast_base_type): Rename to ... + (dcast_base_hint): ... here. Use dfs_walk_once_accessible. + (accessible_r): Remove. + (dfs_accessible_post): New, broken out of accessible_r. + (accessible_p): Use dfs_walk_once_accessible. + (dfs_walk_once_accessible_r): New. From accessible_r. + (dfs_walk_once_accessible): New. From acessible_p. + + * cp-tree.h (SAME_BINFO_TYPE_P): New. + * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare + binfo types. + (convert_to_base_statically, determine_primary_bases, + update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits, + dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, + accumulate_vtbl_inits, dfs_accumulate_vtbl_inits, + build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise. + * init.c (expand_member_init): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + binfo_via_virtual, copied_binfo, binfo_for_vbase, + original_binfo): Likewise. + * tree.c (copy_binfo): Likewise. + +2004-10-11 Kazu Hirata + + * semantics.c: Fix comment typos. + +2004-10-10 Andrew Pinski + + PR c++/17554 + part of c++/17657 + middle-end/17703 + * semantics.c (maybe_cleanup_point_expr): Call + fold_build_cleanup_point_expr. + (maybe_cleanup_point_expr_void): New function. + (add_decl_expr): Call maybe_cleanup_point_expr_void. + (finish_expr_stmt): Likewise. + (finish_return_stmt): Likewise. + (finish_for_expr): Likewise. + (finish_asm_stmt): Likewise. + * typeck.c (condition_conversion): Call + fold_build_cleanup_point_expr. + +2004-10-10 Andrew Pinski + + PR c++/17907 + * semantics.c (add_decl_expr): If the decl has a size which + has side effects then the decl expression needs a cleanup point. + +2004-10-10 Mark Mitchell + + PR c++/17393 + * decl.c (grokdeclarator): Robustify error-recovery on invalid + declarations. + +2004-10-10 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 7/n + * typeck.c (composite_pointer_type_r, composite_pointer_type, + cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr, + string_conv_p, build_class_member_access_expr, + build_class_member_access_expr, lookup_destructor, + finish_class_member_access_expr, build_indirect_ref, + get_member_function_from_ptrfunc, build_function_call, + convert_arguments, build_binary_op, pointer_diff, build_unary_op, + check_for_casting_away_constness, build_static_cast, + build_reinterpret_cast, build_const_cast, build_c_cast, + build_modify_expr, get_delta_difference, build_ptrmemfunc, + dubious_conversion_warnings, convert_for_assignment, + convert_for_initialization, + maybe_warn_about_returning_address_of_local, check_return_expr): + Use quoting marks. + + * typeck2.c (error_not_base_type, readonly_error, + abstract_virtuals_error, cxx_incomplete_type_diagnostic, + store_init_value, digest_init, build_x_arrow, + build_m_component_ref, require_complete_eh_spec_types): Likewise. + + * tree.c (cp_build_qualified_type_real, + handle_java_interface_attribute, handle_init_priority_attribute): + Likewise. + + * semantics.c (finish_asm_stmt, finish_non_static_data_member, + finish_pseudo_destructor_expr, + check_template_template_default_arg, begin_class_definition, + finish_base_specifier, qualified_name_lookup_error, + finish_id_expression, finish_typeof): Likewise. + + * search.c (lookup_base, check_final_overrider, + look_for_overrides_r): Likewise. + + * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise. + +2004-10-09 Mark Mitchell + + PR c++/17867 + * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a + constructor. + + PR c++/17670 + * init.c (build_new): Correct comments. + * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in + the non-array case. + + PR c++/17821 + * parser.c (cp_parser_postfix_dot_deref_expression): If the + pseduo-destructor-name production does not work, fall back to the + ordinary production. + + PR c++/17826 + * tree.c (cp_tree_equal): Handle a BASELINK. + + PR c++/17524 + * cp-tree.h (check_var_type): New function. + * decl.c (check_var_type): New function, split out from ... + (grokdeclarator): ... here. + * pt.c (tsubst_decl): Use check_var_type. + + PR c++/17685 + * decl.c (grokdeclarator): Disallow declarations of operators as + non-functions. + +2004-10-08 Volker Reichelt + + PR c++/17868 + * error.c (dump_expr): Add missing case for RDIV_EXPR. + +2004-10-08 Kazu Hirata + + * pt.c, search.c: Fix comment typos. + +2004-10-08 Nathan Sidwell + + * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp, + unmarkedp): Remove. + (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New. + * class.c (struct find_final_overrider_data): Remove most_derived, + vpath_list and vpath fields. Add path field. + (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust. + (dfs_find_final_overrider): Rename to ... + (dfs_find_final_overrider_pre): ... here. Adjust. + (dfs_find_final_overrider_post): Adjust. + (dfs_find_final_overrider_q): Fold into + dfs_find_final_overrider_pre. + (find_final_overrider): Adjust dfs searching. + (dfs_modify_vtables): Don't mark binfo here. + (modify_all_vtables): Use dfs_walk_once. + (build_vtt_inits): Likwise. Use dfs_walk_all. + (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here. + Return dfs_skip_bases as appropriate. + (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate. + * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as + appropriate. Don't mark binfo here. + (initialize_vtbl_ptrs): Use dfs_walk_once. + * search.c (struct vbase_info): Remove unused struct. + (access_in_type): Use dfs_walk_once. + (dfs_access_in_type): Don't mark binfo here. + (dfs_accessible_queue_p, dfs_accessible_p) Remove. + Fold into ... + (accessible_r): ... here. New. Specialize dfs_walk_once. + (accessible_p): Use accessible_r. + (lookup_field_queue_p): Remove. Fold into ... + (lookup_field_r): ... here. Adjust. + (lookup_member): Use dfs_walk_all. + (dfs_walk_real, dfs_walk): Replace with ... + (dfs_walk_all, dfs_walk_once): ... these. + (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once. + (dfs_unmark, unmarkedp, markedp): Remove. + (dfs_get_pure_virtuals): Don't mark binfo here. + (get_pure_virtuals): Use dfs_walk_once. + (dfs_debug_unmarked_p): Remove. Fold into ... + (dfs_debug_mark): ... here. + (note_debug_info_needed): Use dfs_walk_all. + +2004-10-07 Andrew Pinski + + * pt.c (tsubst_expr) : Look passed the + CLEANUP_POINT_EXPR to get the asm expression. + +2004-10-07 Mark Mitchell + + * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag. + (DECL_MEMBER_TEMPLATE_P): New macro. + (is_member_template): Remove. + (class_method_index_for_fn): New function. + * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P. + * class.c (finish_struct_methods): Remove out-of-date comment. + * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P. + * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and + class_method_index_for_fn. + * pt.c (is_member_template): Remove. + (is_member_template_class): Likewise. + (optimize_specialization_lookup_p): New function. + (retrieve_specialization): Optimize lookups for members that are + not member templates. + (register_specialization): Adjust accordingly. + (build_template_decl): Add member_template_p parameter. Set + DECL_MEMBER_TEMPLATE_P. + (process_partial_specialization): Adjust call to + retrieve_specialization. + (push_template_decl_real): Determine whether the template is a + member template. + (lookup_template_class): Use retrieve_specialization. + (tsubst_decl): Adjust call to retrieve_specialization. + (tsubst_exception_specification): New function. + (tsubst): Use it. + (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P. + (instantiate_template): Adjust call to retrieve_specialization. + (regenerate_decl_from_template): Do not actually generate a new + DECL. + (instantiate_decl): Adjust call to retrieve_specialization. + (class_method_index_for_fn): New method. + +2004-10-07 Andrew Pinski + + * parser.c (cp_parser_asm_definition): Look passed the + CLEANUP_POINT_EXPR to get the asm expression. + +2004-10-06 Andrew Pinski + + PR c++/17368 + * semantics.c (finish_asm_stmt): Asm expressions need cleanup + also. + +2004-10-05 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 6/n + * pt.c (finish_member_template_decl, check_specialization_scope, + maybe_process_partial_specialization, determine_specialization, + check_explicit_specialization, maybe_check_template_type, + process_partial_specialization, check_default_tmpl_args, + push_template_decl_real, redeclare_class_template, + convert_nontype_argument, coerce_template_parms, + lookup_template_class, push_tinst_level, + instantiate_class_template, tsubst_arg_types, + tsubst_function_type, tsubst, tsubst_qualified_id, + tsubst_copy_and_build, check_instantiated_args, + do_decl_instantiation, do_type_instantiation, + invalid_nontype_parm_type_p, check_specialization_namespace, + convert_template_argument, determine_specialization, + check_template_shadow, tsubst_decl + instantiate_pending_templates): Use quoting marks. + +2004-10-05 Nathan Sidwell + + PR c++/17829 + * parser.c (cp_parser_postfix_expression): Inhibit Koenig when + unqualified lookup finds a member function. + +2004-10-04 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 5/n + * parser.c (cp_parser_name_lookup_error, + cp_parser_diagnose_invalid_type_name, + cp_parser_primary_expression, cp_parser_unqualified_id, + cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement, + cp_parser_jump_statement, cp_parser_simple_declaration, + cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id, + cp_parser_type_parameter, cp_parser_template_id, + cp_parser_template_name, cp_parser_direct_declarator, + cp_parser_parameter_declaration_list, cp_parser_class_head, + cp_parser_base_specifier, cp_parser_lookup_name, + cp_parser_late_parsing_default_args, + cp_parser_optional_template_keyword + cp_parser_elaborated_type_specifier, cp_parser_check_class_key, + cp_parser_check_access_in_redeclaration): Use quoting marks. + + * name-lookup.c (supplement_binding, pushdecl, + check_for_out_of_scope_variable, validate_nonmember_using_decl, + do_nonmember_using_decl, lookup_tag, set_decl_namespace, + push_namespace, do_namespace_alias, do_using_directive, + ambiguous_decl, lookup_namespace_name, add_function): Likewise. + + * method.c (use_thunk): Likewise. + + * lex.c (unqualified_name_lookup_error, + unqualified_fn_lookup_error): Likewise. + +2004-10-04 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 4/n + * except.c (decl_is_java_type, build_throw, + is_admissible_throw_operand, check_handlers_1, check_handlers): + Use quoting formats. + * friend.c (add_friend, make_friend_class, do_friend): Likewise. + * init.c (sort_mem_initializers, emit_mem_initializers, + member_init_ok_or_else, expand_member_init, is_aggr_type, + build_offset_ref, build_java_class_ref): Likewise. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 3/n + * decl.c (pop_label, duplicate_decls, redeclaration_error_message, + redeclaration_error_message, lookup_label, check_goto, + make_typename_type, make_unbound_class_template, + fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1, + grok_reference_init, layout_var_decl, maybe_commonize_var, + check_for_uninitialized_const_var, reshape_init_array, + reshape_init, check_initializer, cp_finish_decl, + member_function_or_else, bad_specifiers, grokfndecl, grokvardecl, + check_static_variable_definition, compute_array_index_type, + create_array_type_for_decl, check_special_function_return_type, + grokdeclarator, check_default_argument, grokparms, + grok_ctor_properties, grok_op_properties, + check_elaborated_type_specifier, xref_tag, finish_enum, + build_enumerator, check_function_type, start_preparsed_function, + store_parm_decls): Use quoting formats. + * decl2.c (grok_array_decl, delete_sanity, check_member_template, + check_java_method, check_classfn, finish_static_data_member_decl, + grokfield, grokbitfield, grok_function_init, + build_anon_union_vars, coerce_new_type, coerce_delete_type, + check_default_args): Likewise. + * parser.c (cp_parser_decl_specifier_seq): Likewise. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 2/n + * class.c (build_base_path, add_method, alter_access, + handle_using_decl, check_bases, + maybe_warn_about_overly_private_class, find_final_overrider, + warn_hidden, finish_struct_anon, add_implicitly_declared_members, + check_bitfield_decl, check_field_decls, layout_empty_base, + build_base_field, check_methods, layout_virtual_bases, + warn_about_ambiguous_bases, layout_class_type, finish_struct_1, + resolve_address_of_overloaded_function, instantiate_type, + note_name_declared_in_class): Use format flag "q" for quoting. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 1/n + * error.c (locate_error): Ignore quoting flag q. + * call.c (build_user_type_conversion_1, build_operator_new_call, + build_object_call, op_error, build_conditional_expr, + build_new_op, build_op_delete_call, enforce_access, + convert_like_real, convert_arg_to_ellipsis, build_x_va_arg, + convert_default_arg, build_over_call, build_new_method_call, + joust, perform_implicit_conversion, initialize_reference): Use the + quoting flag q. + +2004-10-03 Andrew Pinski + + PR c++/17797 + * typeck.c (build_reinterpret_cast): Return if the inner type + is error_mark_node. + +2004-10-01 Jan Hubicka + + * semantics.c (expand_body): Update call of tree_rest_of_compilation. + +2004-09-30 Nathan Sidwell + + * cp-tree.h (struct lang_decl): Shrink by reordering fields and + turning operator_code and fixed_offset into bitfields. + +2004-09-29 Joseph S. Myers + + * decl.c (duplicate_decls): Merge TREE_DEPRECATED. + +2004-09-29 Jason Merrill + + PR tree-optimization/17697 + * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl. + +2004-09-28 Jason Merrill + + PR middle-end/17525 + * class.c (build_base_field): Set TYPE_MODE. + +2004-09-28 Roger Sayle + + PR driver/17537 + * g++spec.c (lang_specific_driver): Unrecognized libraries, other + than -lc and -lm, may require linking against libstc++. + +2004-09-28 Kazu Hirata + + * tree.c: Fix a comment typo. + +2004-09-28 Nathan Sidwell + + * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove. + (struct secondary_vptr_vtt_init_data_s): New. + (build_vtt_inits): Adjust dfs_walkers. + (dfs_build_secondary_vptr_vtt_inits): Caller data is a + secondary_vptr_vtt_init_data_s structure. Adjust. + (dfs_ctor_vtable_bases_queue_p): Remove. + (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify. + + * pt.c (struct get_template_base_data_s): Remove. + (get_template_base_r): Fold into get_template_base. + (get_template_base): Walk base binfos directly in inheritance + graph order. + +2004-09-27 Mark Mitchell + + PR c++/17642 + * cp-tree.h (fold_if_not_in_template): New function. + * call.c (build_conditional_expr): Use fold_if_not_in_template. + (build_cxx_call): Likewise. + * cvt.c (convert_to_complex): Likewise. + (ocp_convert): Likewise. + (convert): Likewise. + (convert_force): Likewise. + * decl.c (compute_array_index_type): Clear + processing_template_decl while folding array bounds. + * pt.c (convert_nontype_argument): Clear + processing_template_decl while processing non-type argument + initialization. + * tree.c (fold_if_not_in_template): New function. + * typeck.c (build_class_member_access_expr): Use + fold_if_not_in_template. + (build_array_ref): Likewise. + (build_binary_op): Likewise. Do not try to optimize computations + when processing templates. + (cp_pointer_int_sum): Use fold_if_not_in_template. + (pointer_diff): Likewise. + (build_unary_op): Likewise. + (build_reinterpret_cast): Likewise. + (get_delta_difference): Likewise. + (expand_ptrmemfunc_cst): Likewise. + (dubious_conversion_warnings): Likewise. + +2004-09-27 Matt Austern + + * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c + (cp_lexer_get_preprocessor_token): Set implicit_extern_c for + tokens that come from headers that are implicitly extern "C". + (struct cp_parser): new one-bit field, implicit_extern_c. + (cp_parser_new): Set parser's implicit_extern_c to false. + (cp_parser_translation_unit): Pop lang context if we were in a + header that was implicitly extern "C". + (cp_parser_declaration_seq_opt): Push/pop lang context as + required by the token's and parser's implicit_extern_c. + +2004-09-27 Mark Mitchell + + PR c++/17585 + * cp-tree.h (shared_member_p): Declare. + * search.c (shared_member_p): Give it external linkage. + * semantics.c (finish_qualified_id_expr): Use it. + (finish_id_expression): Likewise. + + PR c++/17585 + * semantics.c (finish_id_expression): Do not add "this->" to + static member functions. + +2004-09-27 Nathan Sidwell + + PR c++/17681 + * error.c (dump_type): Change TREE_VEC case into TREE_BINFO. + + * class.c (struct count_depth_data): Remove. + (dfs_depth_post, dfs_depth_q): Remove. + (find_final_overrider): Use number of vbase classes as depth + bound. + + * cp-tree.h (types_overlap_p): Remove. + * search.c (struct overlap_info): Remove. + (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove. + + * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove. + (get_template_base_recursive): Remove. Replace with ... + (get_template_base_r): ... this. + (struct get_template_base_data_s): New. + (get_template_base): Use get_template_base_r via dfs_walk. Always + return NULL on failure. + (unify): Remove error_mark_node check from get_template_base result. + +2004-09-24 Paolo Bonzini + + * parser.c (cp_parser_expression_stack): Clarify why it is + an array of NUM_PREC_VALUES elements. + (cp_parser_binary_expression): Clarify why we do not need to + handle stack overflow. + +2004-09-24 Nathan Sidwell + + PR c++/16889 + * search.c (lookup_field_queue_p): Correct check for hidden base. + + * search.c (bfs_walk): Remove. + (lookup_member): Use dfs_walk_real. + (dfs_walk_real): Move and adjust documentation from bfs_walk. + +2004-09-23 Zack Weinberg + + * decl.c (grokfndecl): If ::main is found not to return int, + correct it after issuing a diagnostic. + (grokdeclarator): If the incoming type was error_mark_node, do + not complain about declaring something with no type. + (start_function): Change check for ::main not returning int to + an assertion, as grokfndecl now catches this when the user did it. + * init.c (perform_member_init, sort_mem_initializers) + (emit_mem_initializers): Make most diagnostics be issued on + the line of current_function_decl, not whatever the current + input line is. + * parser.c (cp_lexer_peek_token_emit_debug_info): Surround + definition and declaration with #ifdef ENABLE_CHECKING. + Avoid unnecessary use of fprintf. + (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub + definitions to avoid warnings. + (cp_lexer_new_main): Add assertion that first token is not a + padding token. + (cp_lexer_new_from_token_array): Fold into ... + (cp_lexer_new_from_tokens): ... here. Add assertion that + first token is not a padding token. + (cp_lexer_set_source_position_from_token): Move nearer to callers. + Remove unused lexer argument. + (cp_lexer_peek_token): Just print debugging report (if enabled) + and return lexer->next_token. + (cp_lexer_skip_purged_tokens): Delete. + (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make + inline, simplify bodies. + (cp_lexer_peek_nth_token): Add debugging report a la + cp_lexer_peek_token. + (cp_lexer_consume_token): Correct commentary. Advance over + purged tokens here. Set current source position here, from + token to be returned. Avoid unnecessary use of fprintf. + (cp_lexer_purge_token): Advance next_token pointer over this and + subsequent purged tokens. + (cp_parser_error): Adjust source position to that of the + peeked token. + (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions. + (cp_parser_string_literal): Remove some excessive cleverness. + (cp_parser_enum_specifier): Call start_enum before consuming + the opening brace. + (cp_parser_member_declaration): Make the "extra semicolon" + diagnostic consistently-worded with the other place this is + diagnosed. Explicitly set the diagnostic location to the + location of the offending semicolon. + (cp_parser_enclosed_template_argument_list): Use % quoting + in diagnostics. Do not use cp_parser_require. Set location + of diagnostics about improper use of '>>' to location of + offending token. + (cp_parser_late_parsing_for_member): + Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer. + (cp_parser_late_parsing_default_args): Likewise. Manually + move some logic outside the loop. + +2004-09-23 Andrew Pinski + + PR c++/17618 + * cvt.c (cp_convert_to_pointer): Return early when the type is + an error_mark_node. + +2004-09-21 Fariborz Jahanian + + PR c++/13989 + PR c++/9844 + * decl.c (grokfndecl): Add new argument "attrlist", use it + to call cplus_decl_attributes. + (start_function): Remove call to cplus_decl_attributes. + * cvt.c (ocp_convert): Add support to use type conversion + function to vector type. + * parser.c (cp_parser_conversion_type_id): Add attributes, if any, + to the parsed type. + +2004-09-23 Paolo Bonzini + + PR c++/17596 + + * parser.c (cp_parser_token_tree_map_node, + cp_parser_pm_expression, cp_parser_additive_expression, + cp_parser_multiplicative_expression, cp_parser_shift_expression, + cp_parser_relational_expression, cp_parser_equality_expression, + cp_parser_and_expression, cp_parser_exclusive_or_expression, + cp_parser_inclusive_or_expression, + cp_parser_logical_and_expression, + cp_parser_logical_or_expression): Removed. + (enum cp_parser_prec, struct cp_parser_token_tree_map_node, + binops, binops_by_token): New. + (cp_parser_assignment_expression): Use cp_parser_binary_expression. + (cp_parser_new): Initialize binops_by_token. + (cp_parser_binary_expression): Rewritten. + (N_CP_TTYPES): New. + +2004-09-23 Kazu Hirata + + * parser.c: Fix a comment typo. + +2004-09-23 Nathan Sidwell + + PR c++/17620 + * decl.c (xref_basetypes): Look through typedefs before checking + for duplicate base. + +2004-09-22 Nathan Sidwell + + * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree). + * decl2.c (cp_finish_file): Adjust tinfo decl emission loop. + * rtti.c (unemitted_tinfo_decls): Make a VEC(tree). + (init_rtti_processing): Initialize it to something realistic. + (get_tinfo_decl): Adjust pushing the new decl. + + * cp-tree.h (struct lang_type_class): Remove marked flags, add + diamond_shaped and repeated_base flags. Reorder to keep 8-bit blocks. + (TYPE_MARKED_P): New. + (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New. + (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N, + CLEAR_CLASSTYPE_MARKED_N): Remove. + (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*, + CLEAR_CLASSTYPE_MARKED_*): Remove. + * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond + shaped and repeated base properties. + * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET. + * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark, + class_hint_flags): Remove. + (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and + CLASSTYPE_DIAMOND_SHAPED_P. + +2004-09-21 Ziemowit Laski + + * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from + cp-objcp-common.h. + (objcp_tsubst_copy_and_build): Reformat function signature. + * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise. + (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c. + +2004-09-21 Zack Weinberg + + * parser.c (cp_lexer_peek_token, cp_lexer_consume_token): + Don't handle CPP_PRAGMA tokens specially. + (cp_lexer_handle_pragma): Use cp_lexer_consume_token. Don't + purge the token; do clear token->value after processing. Add + assertion at beginning that token->value is nonzero. + (cp_parser_statement, cp_parser_declaration_seq_opt): Handle + CPP_PRAGMA as a full statement or declaration in its own right. + +2004-09-21 Matt Austern + + PR c++/15049 + * decl.c (grokvardecl): Accept declarations of global variables + using anonymous types. + +2004-09-21 Roger Sayle + + PR c++/7503 + * tree.c (lvalue_p_1): Disallow MIN_EXPR and MAX_EXPR as lvalues + if either operand has side-effects. + * typeck.c (rationalize_conditional_expr): Assert that neither + operand of MIN_EXPR or MAX_EXPR has side-effects. + (build_modify_expr): Add support for MIN_EXPR and MAX_EXPR. + Check that the "lhs" is a valid lvalue, i.e. that neither operand + of a MIN_EXPR or MAX_EXPR has a side-effect. + +2004-09-21 Nathan Sidwell + + * cp-tree.h (struct lang_type_header): Remove + uses_multiple_inheritance field. + (TYPE_USES_MULTIPLE_INHERITANCE): Remove. + (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove. + (TYPE_USES_VIRTUAL_BASECLASSES): Remove. + (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES. + (TYPE_CONTAINS_VPTR_P): Likewise. + * call.c (add_template_candidate_real): Use + CLASSTYPE_VBASECLASSES. + (build_special_member_call): Likewise. + * class.c (finish_struct_bits): Remove + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. + (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P + bookkeeping. + (build_vtt_inits): Use CLASSTYPE_VBASECLASSES. + (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries): + Likewise. + * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE, + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES. + * decl2.c (maybe_retrofit_in_chrg): Likewise. + * init.c (expand_member, push_base_cleanups): Likewise. + * pt.c (instantiate_class_template): Remove + TYPE_USES_MULTIPLE_INHERITANCE, + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE + check. + * typeck2.c (process_init_constructor): Replace some sorrys with + asserts. + +2004-09-21 Andreas Tobler + + * decl.c (reshape_init_array): Initialize max_index_cst to fix + bootstrap failure. + +2004-09-20 Mark Mitchell + + PR c++/17530 + * pt.c (tsubst): Fix parentheses to accomodate emacs. + (tsubst_baselink): If we get a single function, mark it as used. + +2004-09-20 Matt Austern + Zack Weinberg + + * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function): + Apply lbasename to input_filename before passing to get_fileinfo. + * semantics.c (begin_class_definition): Likewise. + * lex.c (handle_pragma_interface): Apply get_fileinfo to the + correct filename. Rename variables to be less confusing. + (handle_pragma_implementation): Likewise. Disable "appears + after file is included" diagnostic. + + * parser.c (struct cp_token): Add in_system_header fiag. + (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block) + (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token) + (CPP_NONE, cp_lexer_read_token): Delete. + (struct cp_lexer): Remove first_token, string_tokens, + main_lexer_p fields. Clarify comments. + (struct cp_token_cache): Now just a pair of pointers. + (CP_LEXER_BUFFER_SIZE): New #define. + (CPP_PURGED): New fake token type. + (cp_lexer_new_from_token_array, cp_lexer_destroy) + (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens) + (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal): + New functions. + (cp_lexer_new_from_tokens): Now a simple wrapper around + cp_lexer_new_from_token_array. + (cp_lexer_set_source_position_from_token): Also update + in_system_header. + (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token): + Don't wrap round. + (cp_lexer_token_difference): Dont handle wrapping round. + (cp_lexer_new_main): Enable pragma deferral and raw strings, + read the entire translation unit through c_lex_with_flags into + this lexer's buffer, then turn raw strings back off again. + (cp_lexer_grow_buffer): Adjust for buffer no longer being circular. + (cp_lexer_get_preprocessor_token): No need to handle not being + the main lexer. Set token->in_system_header too. + (cp_lexer_peek_token): Skip purged tokens. Feed pragma tokens + to cp_lexer_handle_pragma. No need to call cp_lexer_read_token. + (cp_lexer_peek_nth_token): Likewise. + (cp_lexer_purge_token): Mark the token PURGED, don't shift all + the other tokens down. + (cp_lexer_purge_tokens_after): Likewise. + (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry + about there being no tokens. + (cp_lexer_print_token): Revise to give useful information on + all tokens. + (struct cp_parser): Add field translate_strings_p. + (cp_parser_new): Initialize it. + (cp_parser_translation_unit): Destroy the lexer when done. + (cp_parser_parameter_declaration): Restructure saving of + default arguments. + (cp_parser_save_member_function_body): Likewise. + (cp_parser_check_for_invalid_template_id) + (cp_parser_nested_name_specifier_opt, cp_parser_template_id): + Adjust calls to cp_lexer_advance_token. + (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration): + No need to fiddle c_lex_string_translate. + (cp_parser_primary_expression, cp_parser_linkage_specification) + (cp_parser_asm_definition, cp_parser_asm_specification_opt) + (cp_parser_asm_operand_list, cp_parser_asm_clobber_list) + Use cp_parser_string_literal. + (cp_parser_attribute_list): Save and restore + parser->translate_strings_p, not c_lex_string_translate. + (cp_parser_cache_group): Delete. + (cp_parser_cache_group_1): Rename cp_parser_cache_group. Do + not take a cache argument. + +2004-09-20 Giovanni Bajo + + PR c++/14179 + * decl.c (reshape_init): Extract array handling into... + (reshape_init_array): New function. Use integers instead of trees + for indices. Handle out-of-range designated initializers. + +2004-09-20 Steven Bosscher + + * lex.c (cxx_init): Don't set the ridpointer for RID_NULL + to null_node. + +2004-09-19 Mark Mitchell + + * decl2.c (determine_visibility): Allow class visibility + directives to override targetm.cxx.export_class_data. + +2004-09-18 Kazu Hirata + + * call.c, semantics.c: Follow spelling conventions. + * class.c: Fix a comment typo. + +2004-09-16 Geoffrey Keating + + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-09-17 Jeffrey D. Oldham + Zack Weinberg + + * cp-tree.def: Use tree_code_class enumeration constants + instead of code letters. + * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c + * mangle.c, pt.c, semantics.c, tree.c, typeck.c: + Update for new tree-class enumeration constants. + +2004-09-16 Mark Mitchell + + PR c++/16002 + * parser.c (cp_parser_simple_declaration): Commit to tentative + parses after seeing a decl-specifier. + (cp_parser_simple_declaration): Eliminate spurious message. + (cp_parser_init_declarator): Adjust error message. + + PR c++/16029 + * lex.c (unqualified_name_lookup_error): Mark the dummy + declaration as used. + + PR c++/17501 + * parser.c (cp_parser_nested_name_specifier): Do not resolve + typename types if the user explicitly said "typename". + +2004-09-16 Andrew MacLeod + + * error.c (dump_decl): Make sure there is lang_specific info before + checking for DTOR and CTOR decls. + +2004-09-16 Nathan Sidwell + + * class.c (copy_virtuals): Remove. + (build_primary_vtable): Use copy_list directly. + (build_secondary_vtable): Likewise. + (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here. + (create_vtable_ptr): Likewise. + +2004-09-16 Kazu Hirata + + * search.c: Follow spelling conventions. + +2004-09-16 Nathan Sidwell + + * cp-tree.h (struct lang_type_class): Make pure_virtuals a + VEC(tree). + (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update + comments. + * call.c (build_new_method_call): Don't confirm a pure virtual is + in CLASSTYPE_PURE_VIRTUALS. Reorder checks. Make it a warning. + * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree). + (fixup_inline_methods, finish_struct): Likewise. + * decl.c (finish_method): Likewise. + * search.c (dfs_get_pure_virtuals, get_pure_virtuals): + CLASSTYPE_PURE_VIRTUALS is a VEC(tree). + * typeck2.c (abstract_virtuals_error): Likewise. Truncate the + vector to avoid repeating the list in error messages. + +2004-09-15 Mark Mitchell + + * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define. + * cp-tree.h (cxx_comdat_group): Declare. + * decl.c (cxx_comdat_group): New function. + +2004-09-15 Nathan Sidwell + + * search.c (get_pure_virtuals): Remove unused variables. + + * cp-tree.h (struct lang_decl_flags): Remove + needs_final_overrider. + (DECL_NEEDS_FINAL_OVERRIDER_P): Remove. + * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P. + * class.c (finish_struct_bits): Correct comment about + CLASSTYPE_PURE_VIRTUALS. + * search.c (get_pure_virtuals): Remove useless loop. + +2004-09-14 Mark Mitchell + + PR c++/17324 + * mangle.c (partially_mangled_name): New variable. + (partially_mangled_name_len): Likewise. + (save_partially_mangled_name): New function. + (restore_partially_mangled_name): Likewise. + (write_encoding): Save and restore partially mangled names around + calls to get_mostly_instantiated_function_type. + (write_unqualified_name): Likewise. + +2004-09-14 Nathan Sidwell + + * pt.c (unify): Replace gcc_unreachable with gcc_assert. + +2004-09-13 Mark Mitchell + + PR c++/16162 + * parser.c (cp_parser_id_expression): Correct value for + is_declarator. + (cp_parser_nested_name_specifier_opt): Look through typenames as + necessary. + (cp_parser_template_name): Honor check_dependency_p. + + PR c++/16716 + * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): + Robustify. + + PR c++/17327 + * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with + gcc_unreacable. + +2004-09-12 Richard Henderson + + PR c++/16254 + * semantics.c (maybe_cleanup_point_expr): Don't call fold. + * typeck.c (condition_conversion): Likewise. + +2004-09-11 Richard Henderson + + PR c++/17404 + * pt.c (cur_stmt_expr): Move from tsubst_expr. + (tsubst_expr) : Move ... + (tsubst_copy_and_build): ... here. + +2004-09-10 Zack Weinberg + + * cp-tree.h (interface_only, interface_unknown): Delete declarations; + comment explaining them moved to c-common.h. + * lex.c (interface_only, interface_unknown, extract_interface_info): + Delete definitions. + (cxx_finish): Don't reset interface_unknown. + (handle_pragma_interface): Don't set interface_only and + interface_unknown; just the like-named fields in finfo. + (handle_pragma_implementation): Adjust comment. + * decl2.c (cp_finish_file): Don't reset interface_only and + interface_unknown. + * method.c (synthesize_method): Don't reset interface_unknown or + call extract_interface_info. + * pt.c (pop_tinst_level): Don't call extract_interface_info. + * decl.c (start_cleanup_fn): Don't save or restore interface_only + and interface_unknown. + (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename + and use the result instead of the interface_only/interface_unknown + globals. + (start_preparsed_function): Likewise. + * lex.c (cxx_make_type): Likewise. + * semantics.c (begin_class_definition): Likewise. + (expand_body): Don't call extract_interface_info. + +2004-09-10 Ziemowit Laski + + * decl.c (objc_mark_locals_volatile): Make description of + routine more descriptive; only mark VAR_DECLs at each + binding level. + +2004-09-10 Richard Henderson + + PR c++/17386 + * call.c (build_vfield_ref): Move... + * class.c (build_vfield_ref): ... here. Convert datum to the + primary base containing the vptr. + (make_new_vtable): Simplify build_primary_vtable arguments. + (finish_struct_1): Do not duplicate TYPE_VFIELD. + * typeck.c (build_class_member_access_expr): Don't warn for + null object access to base fields. + +2004-09-10 Ziemowit Laski + + * decl.c (objc_get_current_scope, objc_mark_locals_volatile): + New functions, to be called from ObjC++. + +2004-09-10 Kazu Hirata + + * class.c, cp-tree.h, decl.c, decl2.c, mangle.c, + name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix + comment typos. + +2004-09-09 Ziemowit Laski + + * typeck.c (build_c_cast): Preserve the cast if casting + to and from an Objective-C type. + +2004-09-09 Ziemowit Laski + + * Make-lang.in (cp/typeck.o): Depend on c-common.h. + * typeck.c: Include c-common.h. + (comptypes): For RECORD_TYPEs, call objc_comptypes() and + return the result if nonnegative. + +2004-09-09 Zack Weinberg + + * decl2.c (import_export_class) + * lex.c (handle_pragma_interface): + Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef. + +2004-09-08 Ziemowit Laski + + * Make-lang.in (cp/semantics.o): Depend on c-common.h. + * semantics.c: Include c-common.h. + (finish_compound_stmt): Call objc_clear_super_receiver(). + +2004-09-08 Ziemowit Laski + + * cp-tree.h (do_poplevel): New prototype. + * semantics.c (do_poplevel): Make externally visible. + +2004-09-08 Nathan Sidwell + + * cp-tree.h (tree_pair_s): Define a GC'd vector. + * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise. + * semantics.c (deferred_access): Likewise. + +2004-09-06 Daniel Jacobowitz + + * semantics.c (expand_body): Assert that we are not nested. + +2004-09-06 Zack Weinberg + + * decl.c (build_enumerator): Use add_double and int_fits_type_p + instead of cp_build_binary_op, to avoid creating short-lived trees. + * parser.c (cp_parse_type_specifier ): Use two-token + lookahead instead of backtracking. Move some code to avoid a + conditional branch. + (cp_parser_enum_specifier): Avoid duplication of effort with caller. + Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate. + (cp_parser_enumerator_list, cp_parser_enumerator_definition): + Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate. + +2004-09-04 Kriang Lerdsuwanakij + + * decl.c (grok_declarator): Remove a redundant semicolon. + + * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier): + Correct comments describing function parameters. + +2004-09-03 Matt Austern + Compile speed improvement. + * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set. + Otherwise define a stub macro that expands to nothing. + (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set. Otherwise + define a stub macro that expands to 0. + (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set. + (cp_lexer_stop_debugging): Likewise. + (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set. Otherwise + define a stub macro that expands to NULL. + (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set. + (cp_lexer_new_from_tokens): Likewise. + +2004-09-03 Jan Hubicka + + * decl.c (finish_function): Clean out pointers we no longer need. + +2004-09-03 Jan Beulich + + * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather + than "-lm". + +2004-09-02 Paul Brook + + * decl2.c (determine_visibility): Only check data visibility + for VAR_DECLS. + +2004-08-31 Mark Mitchell + + * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro. + * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P. + * decl2.c (determine_visibility): Honor + TARGET_CXX_EXPORT_CLASS_DATA. + + * class.c (key_method): Rename to ... + (determine_key_method): ... this. + (finish_struct_1): Adjust accordingly. + * cp-tree.h (key_method): Declare. + * decl2.c (maybe_emit_vtables): Determine the key method here if + it has not already been done. + +2004-08-31 Ziemowit Laski + + * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o. + (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h. + (cp/cp-decl.c): Do not depend on gtype-cp.h. + (cp/cp-objcp-common.o): New target. + * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h. + (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size, + cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move + prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c, + respectively. + (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH, + LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS, + LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION, + LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT, + LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET, + LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR, + LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE, + LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION, + LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE, + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION, + LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS, + LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL, + LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, + LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, + LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, + LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, + LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, + LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, + LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, + LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, + LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, + LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE, + LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, + LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE, + LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE, + LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR, + LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE, + LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move + hooks to cp-objcp-common.h. + (finish_file): New function. + * cp-objcp-common.c: New file. + * cp-objcp-common.h: New file. + * cp-tree.h (cp_finish_file): New prototype. + * decl.c: Do not include gtype-cp.h. + * decl2.c (finish_file): Rename to cp_finish_file. + +2004-08-31 Richard Henderson + + PR c++/17221 + * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ... + (tsubst_copy_and_build): ... here. + +2004-08-30 Mark Mitchell + + * cp-tree.h (initialize_artificial_var): Declare. + * decl.c (initialize_artifical_var): New function. + * class.c (initialize_array): Remove. + (initialize_vtable): Use initialize_artificial_var. + (build_vtt): Likewise. + (build_ctor_vtbl_group): Likewise. + +2004-08-30 Richard Henderson + + * class.c (build_base_path): Use build_address directly. + * typeck.c (build_unary_op): Don't lower &a.b to pointer + arithmetic directly. + * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT + means !initializer_constant_valid_p. + +2004-08-30 Richard Henderson + + * class.c (fixed_type_or_null): Use get_base_address before + assuming an ADDR_EXPR is non-null. + +2004-08-30 Nathan Sidwell + + * name-lookup.c (pop_binding, pushdecl, + set_identifier_type_value_with_scope, push_overloaded_decl, + arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable. + * parser.c (cp_parser_diagnose_invalid_type_name, + cp_parser_postfix_expression, cp_parser_unary_expression, + cp_parser_check_declarator_template_para): Likewise. + * pt.c (push_inline_template_parms_recursive, + check_explicit_specialization, convert_nontype_argument, + coerce_template_template_parms, uses_template_parms, + instantiate_class_template, tsubst_decl, tsubst, tsubst_copy, + tsubst_expr, instantiate_template, + maybe_adjust_types_for_deduction, type_unification_real, + resolve_overloaded_unification, template_decl_level, + type_dependent_expression_p): Likewise. + * search.c (lookup_base_r): Likewise. + * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise. + * tree.c (lvalue_p_1, count_functions, cxx_printable_name, + verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise. + * typeck.c (common_type, get_member_function_from_ptrfunc, + build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise. + * typeck2.c (cxx_incomplete_type_diagnostic, + split_nonconstant_init_1, store_init_value, + process_init_constructor): Likewise. + +2004-08-30 Nathan Sidwell + + * call.c (check_dtor_name): Replace abort with gcc_assert or + gcc_unreachable. + (build_call, add_builtin_candidate, build_new_op, + convert_like_real, build_over_call, in_charge_arg_for_name, + source_type, joust): Likewise. + * class.c (build_simple_base_path, get_vcall_index, + finish_struct_1, instantiate_type, get_enclosing_class, + add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise. + * cp-gimplify.c (cp_genericize): Likewise. + * cp-lang.c (cp_expr_size, cp_tree_size): Likewise. + * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise. + * decl.c (poplevel, make_unbound_class_template, reshape_init, + check_special_function_return_type, grokdeclarator, + grok_op_properties, tag_name, xref_tag, start_preparsed_function, + finish_function): Likewise. + * decl2.c (grokfield, maybe_emit_vtables):Likewise. + * error.c (dump_global_iord, dump_decl, dump_template_decl, + language_to_string): Likewise. + * except.c (choose_personality_routine): Likewise. + * friend.c (do_friend): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + * init.c (build_zero_init, expand_default_init, build_new_1, + build_vec_delete_1, build_vec_init, build_dtor_call): Likewise. + * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise. + * mangle.c (add_substitution, write_unscoped_name, + write_template_prefix, write_identifier, + write_special_name_destructor, write_type, write_builtin_type, + write_expression, write_template_param, + write_java_integer_type_codes): Likewise. + * method.c (implicitly_declare_fn): Likewise. + +2004-08-30 Nathan Sidwell + + * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag. + (BINFO_INDIRECT_PRIMARY_P): Remove. + * class.c (determine_primary_base): Rename to ... + (determine_primary_bases): ... here. Set all primary bases. + (set_primary_base): Remove. + (mark_primary_bases): Remove. + (build_simple_base_path, walk_subobject_offsets, + propagate_binfo_offsets, end_of_class): Adjust. + (layout_class_type): Rename determine_primary_base call. + (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo + to type_as_string. + (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits, + build_rtti_vtbl_entries): Adjust. + * init.c (build_vtbl_address): Adjust. + + * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert. + +2004-08-28 Ziemowit Laski + + * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and + CXX_AND_OBJCXX_OBJS. + (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing + separately on the link line. + +2004-08-28 Jason Merrill + + * decl.c (expand_static_init): Avoid bogus warnings. + +2004-08-27 Jason Merrill + + PR c++/16851 + * tree.c (stabilize_init): See through a COMPOUND_EXPR. + + PR c++/13684 + * decl.c (expand_static_init): Use thread-safety API. + (register_dtor_fn): Return the call, don't expand it. + * tree.c (add_stmt_to_compound): New fn. + (stabilize_call): Use it. + +2004-08-27 Richard Henderson + + * cp-tree.def (OFFSETOF_EXPR): New. + * parser.c (cp_parser_builtin_offsetof): Either built an + OFFSETOF_EXPR, or call fold_offsetof immediately. + * pt.c (tsubst_expr): Handle OFFSETOF_EXPR. + +2004-08-27 Nathan Sidwell + + * call.c (validate_conversion_obstack): Replace + my_friendly_assert with gcc_assert or gcc_unreachable. + (direct_reference_binding, merge_conversion_sequences, + build_user_type_conversion_1, perform_overload_resolution, + build_op_delete_call, enforce_access, call_builtin_trap, + build_over_call, build_special_member_call, build_new_method_call, + initialize_reference): Likewise. + * class.c (build_base_path, build_primary_vtable, alter_access, + check_bases, update_vtable_entry_for_fn, layout_empty_base, + clone_function_decl, adjust_clone_args, + type_requires_array_cookie, include_empty_classes, + finish_struct_1, resolve_address_of_overloaded_function, + instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits, + dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, + accumulate_vtbl_inits, build_vtbl_initializer, + build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise. + * cvt.c (build_up_reference, convert_to_reference): Likewise. + * decl.c (poplevel, duplicate_decls, make_typename_type, + cxx_init_decl_processing, reshape_init, check_initializer, + make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl, + expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type, + grokdeclarator, copy_fn_p, grok_op_properties, xref_tag, + xref_basetypes, start_preparsed_function, save_function_data, + finish_function, finish_method, maybe_register_incomplete_var, + complete_vars): Likewise. + * decl2.c (grok_array_decl, check_member_template, + check_classfn, finish_static_data_member_decl, coerce_new_type, + coerce_delete_type, import_export_class, decl_needed_p, + determine_visibility, import_export_decl, build_cleanup, + start_static_initialization_or_destructi, do_static_destruction, + prune_vars_needing_no_initialization, + build_offset_ref_call_from_tree): Likewise. + * error.c (dump_decl, dump_expr): Likewise. + * init.c (finish_init_stmts, build_zero_init, + expand_virtual_init, expand_default_init, expand_aggr_init_1, + build_offset_ref, build_new_1, build_delete, build_vbase_delete): + Likewise. + * mangle.c (write_method_parms, write_template_args, + write_expression, write_template_arg): Likewise. + * method.c (make_thunk, finish_thunk, use_thunk): Likewise. + * name-lookup.c (pop_binding, begin_scope, leave_scope, + resume_scope, push_using_decl, validate_nonmember_using_decl, + is_ancestor, poplevel_class, set_inherited_value_binding_p, + push_class_level_binding, do_class_using_decl, push_namespace, + pop_namespace, add_using_namespace, ambiguous_decl, + lookup_namespace_name, lookup_type_current_level, + maybe_process_template_type_declaration): Likewise. + * parser.c (cp_lexer_peek_nth_token, + cp_parser_parse_and_diagnose_invalid_typ, + cp_parser_translation_unit, cp_parser_template_id, + cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise. + * pt.c (push_access_scope, finish_member_template_decl, + push_inline_template_parms_recursive, add_outermost_template_args, + get_innermost_template_args, begin_explicit_instantiation, + end_explicit_instantiation, retrieve_specialization, + is_specialization_of, is_specialization_of_friend, + register_specialization, check_explicit_specialization, + comp_template_parms, process_template_parm, + process_partial_specialization, convert_nontype_argument, + coerce_template_template_parms, coerce_template_parms, + mangle_class_name_for_template, lookup_template_function, + lookup_template_class, instantiate_class_template, tsubst_decl, + tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy, + instantiate_template, fn_type_unification, type_unification_real, + get_template_base, regenerate_decl_from_template, + template_for_substitution, instantiate_decl, + get_mostly_instantiated_function_type, dependent_scope_ref_p, + value_dependent_expression_p, resolve_typename_type): Likewise. + * repo.c (repo_emit_p): Likewise. + * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init, + create_tinfo_types, emit_tinfo_decl): Likewise. + * search.c (lookup_base_r, lookup_base, lookup_field_1, + dfs_access_in_type, build_baselink, lookup_member, + adjust_result_of_qualified_name_lookup, copied_binfo): Likewise. + * semantics.c (perform_or_defer_access_check, + finish_non_static_data_member, finish_stmt_expr_expr, + finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr, + finish_template_template_parm, finish_member_declaration, + emit_associated_thunks): Likewise. + * tree.c (build_target_expr_with_type, force_target_expr, + copy_binfo, get_first_fn, cp_tree_equal): Likewise. + * typeck.c (type_after_usual_arithmetic_conversions, comptypes, + cxx_sizeof_or_alignof_type, perform_integral_promotions, + build_class_member_access_expr, finish_class_member_access_expr, + build_ptrmemfunc_access_expr, build_unary_op, + unary_complex_lvalue, cxx_mark_addressable, build_modify_expr, + build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr + * typeck2.c (complete_type_check_abstract, + abstract_virtuals_error, process_init_constructor, + add_exception_specifier): Likewise. + +2004-08-27 Nathan Sidwell + + * class.c (build_vtbl_initializer): Use ssize_int. + * decl.c (complete_array_type): Likewise. + * method.c (finish_thunk): Likewise. + * search.c (get_dynamic_base_type): Likewise. + +2004-08-26 Richard Henderson + + * cp-tree.h (DECL_FIELD_IS_BASE): New. + * class.c (build_base_field): Set it. + (build_simple_base_path): Use it. + (fixed_type_or_null): Don't consider base fields definitive. + +2004-08-25 Roger Sayle + + PR middle-end/16693 + PR tree-optimization/16372 + * decl.c (finish_enum): Make the precision of the enumerated type + the same width as the underlying integer type. + +2004-08-25 Mark Mitchell + + PR c++/17155 + * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++ + functions. + + * mangle.c (get_identifier_nocopy): Add cast. + + * cp-tree.h (mangle_type): Remove. + * mangle.c (globals): GTY it. + (mangle_obstack): New variable. + (name_obstack): Likewise. + (name_base): Likewise. + (write_char): Adjust accordingly. + (write_chars): Likewise. + (write_string): Likewise. + (start_mangling): Initialize G.substitutions only one. Add + ident_p parameter. + (finish_mangling): Use VARRAY_CLEAR to reclaim + storage in G.substitutions. Use obstack_finish. + (init_mangle): Adjust for changes to variable names above. + Initialize G.substitutions. + (mangle_decl_string): Adjust call to start_mangling. + (get_identifier_nocopy): New function. + (mangle_decl): Use it. + (mangle_type_string): Adjust call to start_mangling. + (mangle_special_for_type): Likewise. + (mangle_vtt_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_guard_variable): Likewise. + (mangle_ref_init_variable): Likewise. + +2004-08-25 Kriang Lerdsuwanakij + + PR c++/14428 + * pt.c (redeclare_class_template): Check the type of non-type and + template template parameter. + +2004-08-25 Nathan Sidwell + + * call.c (convert_class_to_reference): Adjust build_int_cst calls. + (build_user_type_conversion_1, convert_like_real, + build_java_interface_fn_ref, build_special_member_call): Likewise. + * class.c (finish_struct_1, build_vtbl_initializer): Likewise. + * cp-gimplify.c (cp_gimplify_expr): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. + * decl2.c (start_static_initialization_or_destruction, + generate_ctor_or_dtor_function): Likewise. + * except.c (build_throw): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (finish_thunk): Likewise. + * rtti.c (build_headof, get_tinfo_decl_dynamic, + build_dynamic_cast_1, ptr_initializer, ptm_initializer, + get_pseudo_ti_init): Likewise. + * search.c (get_dynamic_cast_base_type): Likewise. + +2004-08-25 Zack Weinberg + + * class.c, search.c: Remove references to DWARF_DEBUG. + +2004-08-25 Adam Nemet + + * repo.c (extract_string): Reset backquote after one character. + (get_base_filename): Fix indentation. + +2004-08-24 Nathan Sidwell + + * decl.c (cxx_init_decl_processing): Adjust + build_common_tree_nodes call. + +2004-08-24 Nathan Sidwell + + PR c++/16889 + * (is_subobject_of_p): Resurrect & optimize. + (lookup_field_r): Use it. + +2004-08-24 Kriang Lerdsuwanakij + + PR c++/16706 + * search.c (friend_accessible_p): Increment processing_template_decl + when deal with TEMPLATE_DECL of SCOPE. + +2004-08-24 Nathan Sidwell + + PR c++/17149 + * semantics.c (check_accessibility_of_qualified_id): Defer check + if qualifying_type is a template parameter. + +2004-08-23 Mark Mitchell + + PR c++/17163 + * pt.c (instantiate_decl): Do not try to apply + DECL_DECLARED_INLINED_P to a VAR_DECL. + + * search.c (build_baselink): Fix typo in comment. + +2004-08-22 Andrew Pinski + + Revert: + 2004-08-22 Andrew Pinski + PR c++/14029 + * typeck.c (build_unary_op): Use &a.b if the folded lowered + expression is not constant. + +2004-08-23 Nathan Sidwell + + * name-lookup.c (pushdecl): Rename build_type_copy call. + * tree.c (cp_build_qualified_type_real, + build_exception_variant, handle_java_interface_attribute): Likewise. + +2004-08-22 Andrew Pinski + + PR c++/14029 + * typeck.c (build_unary_op): Use &a.b if the folded lowered + expression is not constant. + +2004-08-20 Mark Mitchell + + PR c++/17121 + * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P. + +2004-08-21 Joseph S. Myers + + PR c++/17120 + * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for + MODOP_EXPR. + +2004-08-20 Kriang Lerdsuwanakij + + * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION + before calling comp_template_args. + +2004-08-20 Nathan Sidwell + + * class.c (build_vtbl_initializer): Use build_int_cst for + negative size types. + * decl.c (complete_array_type): Likewise. + * method.c (finish_thunk): Likewise. + +2004-08-20 Andreas Tobler + + * tree.c: Remove unused mark_local_for_remap_r. + +2004-08-19 Eric Christopher + + * cp-tree.h (cxx_unsave_expr_now): Delete prototype. + * tree.c (cxx_unsave_expr_now): Delete. + (cp_unsave_r): Ditto. + +2004-08-19 Mark Mitchell + + PR c++/15890 + * pt.c (push_template_decl_real): Disallow template allocation + functions with fewer than two parameters. + +2004-08-19 Nathan Sidwell + + * cp-tree.h (build_shared_int_cst): Remove. + * tree.c (shared_int_cache): Remove. + (build_shared_int_cst): Remove. + * class.c (finish_struct_1): Use build_int_cst. + +2004-08-19 Nathan Sidwell + + * decl.c (finish_enum): Do not copy value node early, copy + later. + * lex.c (cxx_init): Force null_node to be unique. + +2004-08-19 Joseph S. Myers + + PR c++/17041 + * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING + from input for MODOP_EXPR. + +2004-08-18 Mark Mitchell + + * pt.c (dependent_template_p): Fix typo in commment. + + PR c++/17068 + * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as + dependent. + +2004-08-17 Mark Mitchell + + PR c++/16246 + * pt.c (unify): Tidy ARRAY_TYPE handling. Make sure that non-type + arguments have the same type as the corresponding parameter. + + PR c++/16215 + * parser.c (cp_parser_name_lookup_error): If parser->object_scope + is set use it for diagnostic purposes. + (cp_parser_pseudo_destructor_name): Remove special-case error + message. + + PR c++/15871 + * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions. + + PR c++/16965 + * cp-tree.h (qualified_name_lookup_error): Add parameter. + * name-lookup.c (do_class_using_decl): Restrict set of entities + passed to cp_emit_debug_info_for_using more carefully. + (lookup_qualified_name): Allow lookup_member to return sets of + ambiguous entries. + * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter. + (cp_parser_primary_expression): Handle ambiguous lookups. + (cp_parser_template_name): Adjust use of cp_parser_lookup_name. + (cp_parser_template_argument): Likewise. + (cp_parser_elaborate_type_specifier): Likewise. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name_simple): Likewise. + * pt.c (tsubst_qualified_id): Handle ambiguous results. + (tsubst_expr): Likewise. + * semantics.c (qualified_name_lookup_error): Add decl paramter. + For ambiguous lookups, print candidates. + +2004-08-16 Kriang Lerdsuwanakij + + PR c++/6749 + * pt.c (instantiate_pending_templates): Add int parameter. Don't + return anything. + * cp-tree.h (instantiate_pending_templates): Adjust prototype. + * decl2.c (finish_file): Adjust call to + instantiate_pending_templates. + +2004-08-15 Roger Sayle + + * call.c (build_vfield_ref, build_call, build_conditional_expr, + convert_arg_to_ellipsis, build_x_va_arg, build_over_call, + build_java_interface_fn_ref, build_special_member_call, + build_new_method_call, initialize_reference): Replace calls to + build with calls to buildN. + * class.c (build_base_path, convert_to_base_statically, + build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits, + build_vtbl_initializer): Likewise. + * cp-gimplify.c (genericize_try_block, genericize_catch_block, + gimplify_if_stmt, cp_genericize_r): Likewise. + * cvt.c (convert_to_void): Likewise. + * decl.c (check_initializer, finish_constructor_body, + finish_destructor_body): Likewise. + * error.c (dump_expr): Likewise. + * except.c (build_exc_ptr, expand_start_catch_block, build_throw): + Likewise. + * init.c (perform_member_init, expand_virtual_init, + expand_cleanup_for_base, build_init, expand_default_init, + build_offset_ref, decl_constant_value, build_new, build_new_1, + build_vec_delete_1, build_vec_init, build_delete, + push_base_cleanups, build_vec_delete): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (thunk_adjust, do_build_copy_constructor, + do_build_assign_ref): Likewise. + * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build, + unify, build_non_dependent_expr): Likewise. + * rtti.c (build_headof, build_typeid, ifnonnull, + build_dyanmic_cast_1, tinfo_base_init): Likewise. + * semantics.c (begin_compound_stmt, finish_call_expr, + finish_pseudo_destructor_expr, finish_id_expression, + simplify_aggr_init_expr, finalize_nrv_r): Likewise. + * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top, + array_type_nelts_total, stabilize_call): Likewise. + * typeck.c (decay_conversion, build_class_member_access_expr, + lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref, + get_member_function_from_ptrfunc, build_binary_op, pointer_diff, + build_x_unary_op, build_unary_op, unary_complex_lvalue, + build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst, + check_return_expr): Likewise. + * typeck2.c (split_nonconstant_1, split_nonconstant_init_1, + split_nonconstant_init, store_init_value, build_m_component_ref): + Likewise. + +2004-08-15 Nathan Sidwell + + * call.c (convert_class_to_reference, + build_user_type_conversion_1, convert_like_real, + build_java_interface_fn_ref, build_special_member_call): Use + build_int_cst. + * class.c (build_vtbl_initializer): Likewise. + * cp-gimplify.c (cp_gimplify_expr): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. + * decl2.c (start_static_initialization_or_destruction, + generate_ctor_or_dtor_function): Likewise. + * except.c (build_throw): Likewise. + * lex.c (cxx_init): Likewise. + * mangle.c (write_integer_cst): Likewise. + * rtti.c (build_headof, get_tinfo_decl_dynamic, + build_dynamic_cast_1, ptr_initializer, ptm_initializer, + get_pseudo_ti_init): Likewise. + * search.c (get_dynamic_cast_base_type): Likewise. + * tree.c (build_shared_int_cst): Likewise. + +2004-08-12 Mark Mitchell + + PR c++/16273 + * class.c (count_depth_data): New type. + (dfs_depth_post): New function. + (dfs_depth_q): Likewise. + (find_final_overrider_data_s): Change type of vpath. + Add vpath_list. + (dfs_find_final_overrider_1): New function. + (dfs_find_final_overrider): Use it. + (dfs_find_final_overrider_q): Adjust use of vpath. + (dfs_find_final_overrider_post): Likewise. + (find_final_overrider): Use dfs_depth. Allocate and deallocate + vpath_list. + +2004-08-12 Jan Beulich + + * parser.c (cp_parser_asm_definition): Properly consume scope operator + tokens preceding the clobbers. Don't check for scope operator + following inputs. Simplify inputs handling to match that now used for + clobbers. + +2004-08-11 Mark Mitchell + + PR c++/16698 + * except.c (build_throw): Allocate cleanup_type and the function + for __cxa_throw separately. + + PR c++/16853 + * call.c (standard_conversion): Do not accept conversions between + pointers to members if the class types are unrelated. + + PR c++/16618 + * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile + char &" instead of just "char &". + + PR c++/16870 + * pt.c (tsubst): Just return the unknown_type_node. + +2004-08-11 Mark Mitchell + + PR c++/16964 + * parser.c (cp_parser_class_specifier): Robustify. + + PR c++/16904 + * pt.c (tsubst_copy_and_build): Complain about invalid + qualification. + + PR c++/16929 + * pt.c (tsubst_default_argument): Clear out current_class_ptr and + current_class_ref while tsubsting. + +2004-08-10 Mark Mitchell + + PR c++/16971 + * parser.c (cp_parser_init_declarator): Robustify. + +2004-08-06 Richard Sandiford + + * typeck2.c (process_init_constructor): Guard the missing field warning + with warn_missing_field_initializers rather than extra_warnings. + +2004-08-06 Paolo Bonzini + + * class.c (instantiate_type) : Do not handle. + +2004-08-05 Mark Mitchell + + * decl.c (start_preparsed_function): Move determine_visibility + call. + * decl2.c (determine_visibility): Incorporate dllexport testing. + +2004-08-05 Geoffrey Keating + + * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option + means that libstdc++ is needed. + +2004-08-05 Nathan Sidwell + + * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call. + +2004-08-04 Geoffrey Keating + + * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather + than passing it as a parameter to rest_of_decl_compilation. + * decl2.c (grokfield): Use set_user_assembler_name. + +2004-08-04 Nathan Sidwell + + * decl.c (complete_array_type): Don't gratuitously copy + maxindex. Its type is always set. + +2004-08-04 Paul Brook + + * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H. + * cp-tree.h (struct language_function): Rename x_dtor_label to + x_cdtor_label. + (dtor_label): Rename ... + (cdtor_label): ... to this. + * decl.c (begin_constructor_body): Remove. + (check_special_function_return_type): Maybe change the return type. + (grokdeclarator): Pass the class type. + (start_preparsed_function): Constructors may need a return label. + (finish_constructor_body, finish_destructor_body): Set the return + value. + (begin_function_body): Don't call begin_constructor_body. + (finish_function): Don't warn for constructors or destructors. + (implicitly_declare_fn): Maybe change the return type. + * optimize.c: Include target.h. + (maybe_clone_body): Remap the function result. + * semantics.c: Include target.h. + (finish_return_stmt): Maybe jump to return label for constructors. + +2004-08-03 Mark Mitchell + + * class.c (build_vtable): Do not set DECL_VISIBILITY here. + (check_field_decls): Or here. + (check_methods): Or here. + (initialize_array): Don't mess with DECL_CONTEXT. + * cp-tree.h (start_decl): Adjust prototype. + (determine_visibility): New function. + * decl.c (duplicate_decls): Remove checks for hidden "operator + new". + (build_library_fn_1): Give all library functions default + visibility. + (start_decl): Add pop_scope_p parameter. Tidy. + (cp_finish_decl): Do not pop scopes here. Call + determine_visibility for variable definitions. + (start_preparsed_function): Call determine_visibility. + * decl2.c (determine_visibility): New function. + * method.c (use_thunk): Fix formatting. + * parser.c (cp_parser_condition): Adjust calls to start_decl. + (cp_parser_init_declarator): Likewise. + * pt.c (instantiate_decl): Always call pop_nested_class. + * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY. + (tinfo_base_init): Likewise. + +2004-08-02 Mark Mitchell + + PR c++/16707 + * name-lookup.c (validate_nonmember_using_decl): Robustify. + +2004-08-01 Mark Mitchell + + PR c++/16224 + * name-lookup.c (decl_namespace): Remove. + (current_decl_namespace): Use decl_namespace_context instead of + decl_namespace. + (push_decl_namespace): Likewise. + (arg_assoc_class): Likewise. + (arg_assoc_type): Likewise. + * pt.c (check_specialization_namespace): New function. + (maybe_process_partial_specialization): Use it. + (register_specialization): Likewise. + + PR c++/16489 + * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro. + * call.c (null_ptr_cst_p): Handle variables with constant + initializers. + * pt.c (convert_nontype_argument): Use + DECL_INTEGRAL_CONSTANT_VAR_P. + * semantics.c (finish_id_expression): Likewise. + + PR c++/16529 + * decl.c (duplicate_decls): Reject duplicate namespace + declarations. + + PR c++/16810 + * typeck.c (build_ptrmemfunc): Loosen assertion. + +2004-08-01 Gabriel Dos Reis + + * call.c (z_candidate::template_decl): Rename from template. + (add_template_candidate_real): Adjust member reference. + (joust): Likewise. + +2004-07-29 Mark Mitchell + + * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define. + (lang_decl_flags): Narrow the width of "languages". Add + repo_available_p. + (DECL_NEEDED_P): Remove. + (FOR_EACH_CLONE): New macro. + (DECL_REPO_AVAILABLE_P): Likewise. + (DECL_TINFO_P): Likewise. + (set_linkage_according_to_type): Declare. + (import_export_vtable): Remove. + (import_export_tinfo): Likewise. + (mark_needed): New function. + (decl_needed_p): Likewise. + (note_vauge_linkage_fn): Likewise. + (init_repo): Change prototype. + (repo_template_used): Remove. + (repo_template_instantiated): Likewise. + (repo_emit_p): New function. + (repo_export_class_p): Likewise. + (no_linkage_check): Change prototype. + * class.c (set_linkage_according_to_type): New function. + (build_vtable): Use it. Do not call import_export_vtable. Set + DECL_IGNORED_P if appropriate. + * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P. + (make_rtL_for_nonlocal_decls): Check for template instantiations + explicitly. + (grokfndecl): Adjust call to no_linkage_check. + (set_linkage_for_static_data_member): New function. + (grokvardecl): Use it. Adjust call to no_linkage_check. + (grokdeclarator): Use set_linkage_for_static_data_member. + * decl2.c (note_vague_linkage_fn): New function. + (note_vague_linkage_var): Likewise. + (finish_static_data_member_decl): Use it. + (import_export_vtable): Remove. + (import_export_class): Use repo_export_class_p. + (var_finalized_p): Simplify. + (maybe_emit_vtables): Simplify. + (mark_needed): New function. + (decl_needed_p): Likewise. + (import_export_decl): Add documentation and consistency checks. + Use repo_emit_p. Handle virtual tables and RTTI information + here. + (import_export_tinfo): Remove. + (write_out_vars): Call import_export_decl. + (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted + whenever one is. + (finish_file): Use decl_needed_p. Do not call import_export_decl + for undefined static data members. Do not warn about undefined + inlines when using a repository. + (mark_used): Use note_vague_linkage_fn. Always defer template + instantiations. + * lex.c (cxx_init): Adjust call to init_repo. Always set + flag_unit_at_a-time. + * method.c (synthesize_method): Remove unncessary + import_export_decl call. + (implicitly_declare_fn): Use set_linkage_according_to_type. + * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE. + * pt.c (instantiate_class_template): Don't redundantly add classes + to keyed_classes. Don't call repo_template_used. + (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of + templates with internal linkage. + (check_instantiated_args): Adjust call to no_linkage_check. + (instantiate_template): Use FOR_EACH_CLONE. + (mark_definable): New function. + (mark_decl_instantiated): Use it. + (do_decl_instantiation): Adjust tests for explicit instantiation + after "extern template". + (instantiate_class_member): Do not use repo_template_instantiated. + (do_type_instantiation): Simplify. + (instantiate_decl): Use mark_definable. Check repo_emit_p. + Simplify. + * repo.c (repo_get_id): Remove. + (original_repo): Remove. + (IDENTIFIER_REPO_USED): Remove. + (IDENTIFIER_REPO_CHOSEN): Remove. + Remove all #if 0'd code. + (repo_template_used): Remove. + (repo_template_instantiated): Remove. + (temporary_obstack_initialized_p): New variable. + (init_repo): Register with lang_post_pch_load. Avoid creating + identifiers unnecessarily. Don't use original_repo. Close the + file here. + (reopen_repo_file_for_write): Not here. + (finish_repo): Always write out a new repository file. + (repo_emit_p): New function. + (repo_export_class_p): Likewise. + * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type. + (involves_incomplete_p): New function. + (tinfo_base_init): Use it. + (ptr_initializer): Remove non_public_ptr parameter. + (ptm_initializer): Likewise. + (get_pseudo_ti_init): Likewise. + (unemitted_tinfo_decl_p): Remove. + (emit_tinfo_decl): Use import_export_decl. + * semantics.c (expand_body): Move updates of static_ctors and + static_dtors to ... + (expand_or_defer_fn): ... here. + * tree.c (no_linkage_check): Add relaxed_p parameter. + +2004-07-28 Eric Christopher + + * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete. + +2004-07-28 Nathan Sidwell + + * cp-tree.h (struct tree_pair_s): New. + (typedef tree_pair_p): New. + (DEF_VEC_O(tree_pair_s)): New. + (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s). + (CLASSTYPE_VCALL_INDICES): Update documentation. + * class.c (get_vcall_index): Adjust. + (add_vcall_offset): Adjust. + +2004-07-27 Kelley Cook + + * pt.c, typeck.c: Remove spurious carriage returns. + +2004-07-27 Kriang Lerdsuwanakij + + PR c++/14429 + * pt.c (coerce_template_template_parms) : Only check + when the type of ARG is not dependent. + +2004-07-26 Geoffrey Keating + + * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. + (lang_specific_driver): If the C++ or math library options don't + start with '-l', don't count them as added libraries. + +2004-07-26 Nathan Sidwell + + * decl.c (xref_basetypes): Adjust base access vector creation. + * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base + access accesses. + * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise. + +2004-07-26 Niall Douglas + Brian Ryner + + PR c++/15000 + PR c++/9283 + * class.c (check_field_decls): Apply hidden visibility if + -fvisibility-inlines-hidden and inlined unless otherwise specified + (build_vtable): Set vtable visibility to class visibility. + (check_field_decls): Default static member visibility to class + visibility. + (check_methods): Default method visibility to class visibility. + * cp-tree.h: Added CLASSTYPE_VISIBILITY and + CLASSTYPE_VISIBILITY_SPECIFIED macro. + * decl.c (duplicate_decls): New logic for merging definition decls + with declaration decls. Added ignore & warning when non default + applied to global operator new or delete. + * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED + wherever VISIBILITY was changed + * rtti.c (get_tinfo_decl): Set typeinfo visibility to class + visibility. + (tinfo_base_init): Set typeinfo name visibility to class visibility. + +2004-07-25 Bernardo Innocenti + + * decl.c: Rename all identifiers named `class' to `cl'. + * cp-tree.h: Likewise. + +2004-07-25 Gabriel Dos Reis + + * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW. + * typeck2.c (abstract_virtuals_error): Use GGC_NEW. + * name-lookup.c (binding_entry_make): Use GGC_NEW. + (binding_table_construct): Use GGC_CNEWVEC. + (binding_table_new): Use GGC_NEW. + (cxx_binding_make): Likewise. + (begin_scope): Likewise. + (push_to_top_level): Use GCC_CNEW. + * parser.c (cp_token_cache_new): Likewise. + (cp_token_cache_push_token): Likewise. + (cp_lexer_new_main): Likewise. + (cp_lexer_new_from_tokens): Likewise. + (cp_parser_context_new): Likewise. + (cp_parser_new): Likewise. + (cp_lexer_new_from_tokens): Use GGC_NEWVEC. + * lex.c (cxx_make_type): Use GGC_CNEW. + (retrofit_lang_decl): Use GGC_NEWVAR. + (cxx_dup_lang_specific_decl): Likewise. + (copy_lang_type): Likewise. + * decl.c (use_label): Use GGC_NEW instead of ggc_alloc. + (save_function_data): Likewise. + (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared. + (cxx_push_function_context): Likewise. + +2004-07-25 Richard Henderson + + * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and + DECL_IGNORED_P on RESULT_DECL. + * semantics.c (finalize_nrv): Copy them too. + +2004-07-23 Nathan Sidwell + + * search.c (lookup_conversion_operator): Avoid two loops. + (add_conversions): Remove. + (check_hidden_convs, split_conversions, + lookup_conversions_r): New. + (lookup_conversions): Use lookup_conversions_r. + +2004-07-22 Nathan Sidwell + + * pt.c (get_template_base): Check type is completable. + +2004-07-21 Eric Christopher + + * decl.c (poplevel): Inline unused variable checking. + Change formatting. + +2004-07-21 Paolo Bonzini + + * typeck.c (build_binary_op): Do not use RDIV_EXPR for + integer vectors. + +2004-07-21 Giovanni Bajo + + PR c++/14497 + * pt.c (check_explicit_specialization): Remove extension to accept + specializations without template headers. Fall-through to normal + processing. + +2004-07-21 Giovanni Bajo + + PR c++/509 + * pt.c (determine_specialization): New parameter template_count. + Disambiguate between member templates and member functions counting + the template headers. + (check_explicit_specialization): Update caller. + (tsubst_friend_function): Likewise. + +2004-07-20 Steven Bosscher + + * cp-tree.def (TINST_LEVEL): Make it an 'x' node. + * cp-tree.h (tinst_level_t): New tree type. + (union lang_tree_node): Handle it. + (TINST_LOCATION): New accessor macro. + (make_tinst_level): New prototype. + * cp-lang.c (cp_tree_size): Handle TINST_LEVEL. + * decl.c (cp_tree_node_structure): Likewise. + * error.c (print_instantiation_full_context): Use TINST_LOCATION. + (print_instantiation_partial_context): Likewise. + * pt.c (pop_tinst_level): Likewise. + (push_tinst_level): Use make_tinst_level. + * tree.c (make_tinst_level): New function. + (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node. + +2004-07-20 Mark Mitchell + + * parser.c (cp_parser_simple_type_specifier): Fix typo. + + PR c++/16637 + * parser.c (cp_parser_simple_type_specifier): Do not record usage + of globally-qualified names. + +2004-07-20 Kriang Lerdsuwanakij + + PR c++/16175 + * error.c (dump_type) : Output + cv qualifier. + +2004-07-19 Mark Mitchell + + PR c++/16623 + * cp-tree.h (lang_type_class): Add lazy_assignment_op. + (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro. + * class.c (add_implicitly_declared_members): Use + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * method.c (lazily_declare_fn): Clear + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * search.c (lookup_fnfields_1): Check it. + +2004-07-20 Nathan Sidwell + + * cp-tree.h (vec_binfo_member): Remove. + * tree.c (vec_binfo_member): Remove. + + * cp-tree.h (struct lang_type_class): Remove vfields field. + (CLASSTYPE_VFIELDS): Remove. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust. + * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS + handling. + (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P. + (finish_struct_1): Remove CLASSTYPE_VFIELDS handling. + * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P. + +2004-07-20 Nathan Sidwell + + * cp-tree.h (DEF_VEC_P(tree)): Remove here. + (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): + Moved to common. + (BINFO_LANG_SLOTS): Remove. + * tree.c (copy_binfo): Adjust BINFO creation and accessors. + * decl.c (xref_basetypes): Adjust BINFO creation and accessors. + * class.c (check_bases): Adjust BINFO accessors. + (determine_primary_base, finish_struct_bits, + maybe_warn_about_overly_private_class, warn_hidden, + walk_subobject_offsets, propagate_binfo_offsets, end_of_class, + warn_about_ambiguous_bases, get_vfield_name, + dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits, + add_vcall_offset_vtbl_entries_r): Likewise. + * dump.c (cp_dump_tree): Likewise. + * init.c (sort_mem_initializers, expand_member_init, build_delete, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor, do_build_assign_ref, + synthesize_exception_spec): Likewise. + name-lookup.c (arg_assoc_class): Likewise. + * pt.c (instantiate_class_template, + get_template_base_recursive): Likewise. + * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise. + * typeck2.c (process_init_constructor): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + dfs_access_in_type, dfs_walk_real, look_for_overrides, + types_overlap_p, copied_binfo, original_binfo): Likewise. + (binfo_for_vtable): Remove + +2004-07-20 Steven Bosscher + + * cp-tree.h (struct lang_decl_flags): Unify the template_info and + thunk_alias, and the access and virtual_offset fields. + (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust. + * decl.c (finish_case_label): Update c_add_case_node call. + +2004-07-19 Mark Mitchell + + Revert patch for PR c++/16623. + +2004-07-19 Kelley Cook + + * except.c: Remove two spurious carriage returns. + +2004-07-19 Mark Mitchell + + PR c++/16623 + * cp-tree.h (lang_type_class): Add lazy_assignment_op. + (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro. + * class.c (add_implicitly_declared_members): Use + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * method.c (lazily_declare_fn): Clear + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * search.c (lookup_fnfields_1): Check it. + +2004-07-19 Nathan Sidwell + + * class.c (add_method): Delay adding the slot until the end. + (determine_primary_base): Adjust VEC_iterate invokation. + (resort_type_method_vec, finish_struct_methods, warn_hidden, + walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases, + build_vtbl_initializer): Likewise. + * init.c (sort_mem_initializers, build_delete, push_base_cleanups, + build_vbase_delete): Likewise. + * method.c (do_build_copy_constructor): Likewise. + * name-lookup.c (new_class_binding, print_binding_level, + poplevel_class, store_class_bindings, push_to_top_level, + pop_from_top_level): Likewise. + * pt.c (check_explicit_specialization): Likewise. + * search.c (lookup_conversion_operator, lookup_fnfields_1, + get_pure_virtuals, add_conversions, dfs_check_overlap, + binfo_for_vbase): Likewise. + +2004-07-19 Kriang Lerdsuwanakij + + PR c++/12170 + * pt.c (unify) : Use only + innermost set of template arguments during deduction. Simplify. + +2004-07-19 Joseph S. Myers + + * typeck.c (build_modify_expr, build_x_modify_expr): Set + TREE_NO_WARNING on assignments with an operator other than '='. + +2004-07-10 Steven Bosscher + Joseph S. Myers + + * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove. + * decl2.c (grokfield): Don't check current_class_depth via + unused TREE_COMPLEXITY. + * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING + to avoid the missing parentheses warning. + Don't set C_SET_EXP_ORIGINAL_CODE. + +2004-07-18 Mark Mitchell + + * tree.c (no_linkage_helper): Remove. + (no_linkage_check): Don't use walk_tree_without_duplicates. + + * mangle.c (write_expression): Issue a sorry for zero-operand + functional casts. + +2004-07-18 Kriang Lerdsuwanakij + + PR c++/13092 + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-07-17 Jason Merrill + + PR c++/16115 + * call.c (type_passed_as): Make the invisible reference type + __restrict. + * cp-gimplify.c (gimplify_cleanup_stmt): Rename to + cp_genericize_r. Handle invisible reference lowering. + (is_invisiref_parm): New fn. + (cp_genericize): Adjust the types of invisible reference parms. + Don't repeat the walk for clones. + * decl.c (store_parm_decls): Don't generate any code for clones. + +2004-07-17 Joseph S. Myers + + * cp-tree.h (builtin_function): Declare. + +2004-07-16 Mark Mitchell + + * class.c (finish_struct_methods): Remove unncessary code. + (add_implicitly_declared_members): Create declarations for default + constructors and copy constructors lazily. + * cp-tree.h (lang_type_class): Remove lazy_default_ctor and + lazy_copy_ctor. + (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro. + (CLASSTYPE_LAZY_COPY_CTOR): Likewise. + * decl2.c (check_classfn): Robustify. + (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC. + (locate_ctor): Handle lazy default constructors. + (locate_copy): Handle lazy copy constructors. + (implicitly_declare_fn): Make sure we're looking at the + TYPE_MAIN_VARIANT for a class before creating functions. Don't + set TYPE_HAS_CONSTRUCTOR. + (lazily_declare_fn): New function. + * name-lookup.c (constructor_name_full): Simplify. + * search.c (lookup_fnfields_1): Lazily create methods, as + necessary. + (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC. + +2004-07-16 Steven Bosscher + + * cp-tree.h (struct lang_type): Don't have three GTY options on a + single bit GTY desc. + +2004-07-16 Richard Henderson + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die. + * cp-tree.h (cp_copy_res_decl_for_inlining): Remove. + * tree.c (cp_copy_res_decl_for_inlining): Remove. + +2004-07-16 Nathan Sidwell + + * class.c (finish_struct_bits): Use for loop. + (propagate_binfo_offsets): Do primary binfo outside of loop. + + PR c++/16583 + * dump.c (cp_dump_tree): Don't dump the bases if there's no + binfo. + + * pt.c (tsubst) : We should never get here. + +2004-07-15 Mark Mitchell + + * cp-tree.h (lang_type_class): Remove has_real_assign_ref and + has_abstract_assign_ref. Make methods a VEC(tree) *. + (TYPE_HAS_CONST_ASSIGN_REF): Add documentation. + (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC. + (CLASSTYPE_DESTRUCTORS): Likewise. + (TYPE_HAS_REAL_ASSIGN_REF): Remove. + (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. + (add_method): Change prototoype. + * class.c (add_method): Remove error_p parameter. Adjust for + changes to CLASSTYPE_METHOD_VEC. + (handle_using_decl): Adjust call to add_method. + (maybe_warn_about_overly_private_class): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (resort_type_method_vec): Likewise. + (finish_struct_methods): Likewise. + (check_for_override): Likewise. + (warn_hidden): Likewise. + (add_implicitly_declared_members): Defer creation of assignment + operators. Adjust call to add_method. + (clone_function_decl): Adjust call to add_method. + (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF. + (finish_struct_1): Use CLASSTYPE_DESTRUCTORS. + * decl.c (grok_special_member_properties): Don't set + TYPE_HAS_ABSTRACT_ASSIGN_REF. + * decl2.c (check_classfn): Adjust for + changes to CLASSTYPE_METHOD_VEC. + * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS. + (locate_ctor): Use CLASSTYPE_CONSTRUCTORS. + (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC. + (implicitly_declare_fn): Set DECL_SOURCE_LOCATION. Do not call + cp_finish_decl. + * pt.c (check_explicit_specialization): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (instantiate_class_template): Do not set + TYPE_HAS_ABSTRACT_ASSIGN_REF. + * ptree.c (cxx_print_type): Don't try to print + CLASSTYPE_METHOD_VEC. + * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS. + * search.c (lookup_field_r): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (lookup_fnfields): Likewise. + (lookup_conversion_operator): Likewise. + (lookup_fnfields_1): Likewise. Create assignment operators + lazily. + (look_for_overrides_here): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (add_conversions): Likewise. + * semantics.c (finish_member_declaration): Adjust call to add_method. + +2004-07-15 Jason Merrill + + * cp-lang.c (cxx_types_compatible_p): To the middle-end, + references and pointers are compatible. + +2004-07-15 Nathan Sidwell + + * decl.c (xref_basetypes): Refactor. + * tree.c (copy_base_binfos): Replace with ... + (copy_binfo): ... this. Deep copy the given binfo, (not the just + bases of the given base). + * cp-tree.h (copy_base_binfo): Remove. + (copy_binfo): Declare. + +2004-07-15 Mark Mitchell + + * name-lookup.c (set_inherited_value_binding_p): Add class_type + parameter. + (get_class_binding): Adjust. + (push_class_level_binding): Don't use set_inherited_value_binding_p. + +2004-07-15 Nathan Sidwell + + * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here. + * decl.c (xref_basetypes): Set it here. + + * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here. + Don't check for incomplete base. + (get_vfield_name): Simplify while loop. + * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here. + +2004-07-14 Mark Mitchell + + * lex.c (cxx_make_type): Remove call to get_pointer_type. + + * cp-tree.h (IDENTIFIER_VALUE): Remove. + (BINFO_PUSHDECLS_MARKED): Likewise. + (maybe_inject_for_scope_var): Likewise. + (push_class_decls): Likewise. + * name-lookup.h (push_class_binding): Remove. + (innermost_non_namespace_value): New function. + (outer_binding): Likewise. + * class.c (add_method): Push bindings before adding to + TYPE_METHODS. + (restore_class_cache): Do not restore class_shadowed. + (pushclass): Do not add USING_DECLs. Do not call + push_class_decls. + * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c. + * decl.c (pushdecl): Use outer_binding. + (poplevel): Set the scope for an out-of-scope for-loop declaration + appropriately. + (cp_finish_decl): Don't call maybe_inject_for_scope_var. + * name-lookup.c (new_class_binding): New function. + (push_binding): Use it. + (pushdecl): Use innermost_non_namespace_value. + (maybe_inject_for_scope_var): Remove. + (push_class_binding): Remove. + (set_inherited_value_binding_p): New function. + (get_class_binding): New function. + (push_class_level_binding): Assert that the current_class_type is + being defined. + (outer_binding): New function. + (innermost_non_namespace_value): Likewise. + (lookup_name_real): Use outer_binding. + (lookup_name_current_level): Ignore out-of-scope variables. + * pt.c (check_template_shadow): Use innermost_non_namespace_value. + (lookup_template_class): Likewise. + * search.c (dfs_push_type_decls): Remove. + (dfs_push_decls): Likewise. + (setup_class_bindings): Likewise. + (lookup_field_1): Handle USING_DECLs from dependent scopes. + (marked_pushdecls_p): Remove. + (unmarked_pushdecls_p): Remove. + (marked_identifiers): Remove. + (setup_class_bindings): Remove. + (dfs_push_type_decls): Remove. + (dfs_push_decls): Remove. + (push_class_decls): Remove. + +2004-07-13 Mark Mitchell + + PR c++/16518 + PR c++/16337 + * decl.c (grokvardecl): Make declspecs parameter const. + (grokdeclarator): Likewise. Adjust accordingly. + * decl.h (grokdeclarator): Adjust declaration. + * parser.c (cp_parser_init_declarator): Do not clear + decl_specifiers->attributes. + + * cp-tree.h (lang_identifier): Remove class_value. + (IDENTIFIER_CLASS_VALUE): Remove. + (pop_class_decls): Likewise. + (init_search_processing): Likewise. + * class.c (handle_using_decl): Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + (restore_class_cache): New function, split out from ... + (pushclass): ... here. Do not call clear_identifier_class_values. + (invalidate_class_lookup_cache): Do not clear + IDENTIFIER_CLASS_VALUE. + (popclass): Do not call pop_class_decls. + (maybe_note_name_used_in_class): Do not save names looked up after + the class is complete. Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c. + * decl.c (cxx_init_decl_processing): Do not call + init_search_processing. + * method.c (do_build_copy_constructor): Remove unnecessary code. + (do_build_assign_ref): Likewise. + * name-lookup.c (pushdecl): Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + (set_identifier_type_value_with_scope): Set TREE_TYPE on the + type_shadowed list. + (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE. + (push_class_binding): Do not set it. + (clear_identifier_class_values): Remove. + (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE. + (store_binding): Do not save it. + (pop_from_top_level): Do not restore it. + * name-lookup.h (cxx_saved_binding): Remove class_value. + (clear_identifier_class_values): Remove. + * ptree.c (cxx_print_identifier): Do not print + IDENTIFIER_CLASS_VALUE. + * search.c (search_obstack): Remove. + (push_stack_level): Remove. + (pop_stack_level): Remove. + (search_level): Remove. + (search_stack): Remove. + (lookup_member): Don't check IDENTIFIER_CLASS_VALUE. + (setup_class_bindings): Use IDENTIFIER_MARKED, not + IDENTIFIER_CLASS_VALUE. + (marked_identifiers): New variable. + (push_class_decls): Clear IDENTIFIER_MARKED. + (pop_class_decls): Don't call pop_search_level. + (init_search_processing): Remove. + +2004-07-12 Mark Mitchell + + * cp-tree.h (get_aggr_typedef): Remove. + * init.c (get_aggr_typedef): Likewise. + + * name-lookup.c (push_class_level_binding): Simplify. + +2004-07-12 Andrew Pinski + + PR c++/16475 + Revert: + 2004-07-07 H.J. Lu + PR c++/16276 + * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo + is not public. + +2004-07-12 Eric Christopher + + * parser.c (cp_parser_class_head): Remove unused variable. + +2004-07-12 Giovanni Bajo + + * decl.c (grok_op_properties): Reject [de-]allocation functions + declared in a namespace, or declared as static. + +2004-07-12 Nathan Sidwell + + * cp-tree.h (make_binfo): Remove. + * decl.c (xref_basetypes): Use make_tree_binfo directly. + * tree.h (copy_base_binfos): Likewise. + (make_binfo): Remove. + + * call.c (build_user_type_conversion_1, build_new_op, + check_constructor_callable, build_temp, + perform_direct_initialization_of_possible): Pass type directly to + lookup_fnfields & build_special_member_call. + (build_special_member_call): Accept a type, and complete it. + * class.c (finish_stuct_bits): Copy the BINFOs here. + * cvt.c (ocp_convert): Pass type directly to + build_special_member_call. + * decl.c (build_ptrmemfunc_type): Call xref_bastypes here. + (xref_basetypes): Allocate the binfo here. Adjust. + * init.c (build_init, build_new_1): Pass type directly to + build_special_member_call. + * lex.c (cxx_make_type): Do not allocate binfo here. + * name-lookup.c (arg_assoc_class): Incomplete types have no binfo. + * parser.c (cp_parser_class_head): Always call xref_basetypes. + * pt.c (instantiate_class_template): Likewise. Inhibit access + checking for template friends. + * ptree.c (cxx_print_type): Adjust record printing. + * search.c (lookup_base): When taking a type, complete it before + looking for a binfo. + (lookup_member): Delay completing a type. + (push_class_decls): Don't walk an incomplete type. + (lookup_conversions): Likewise. + * semantics.c (finish_stmt_expr_expr): Pass type directly to + build_special_member_call. + * tree.c (copy_base_binfos): Adjust. + (make_binfo): Likewise. + * typeck.c (build_modify_expr): Pass type directly to + build_special_member_call. + * typeck2.c (process_init_constructor): Check a binfo exists. + (build_m_component_ref): Allow accessing an incomplete type. + (build_functional_cast): Pass type directly to + build_special_member_call. + +2004-07-12 Giovanni Bajo + + PR c++/2204 + * config-lang.in (gtfiles): Add typeck2.c. + * Make-lang.in: Tweak typeck2.c dependencies, and add rule for + gt-cp-typeck2.h. + * cp-tree.h: Declare complete_type_check_abstract. + * typeck2.c (pat_calc_hash, pat_compare, + complete_type_check_abstract): New functions. + (abstract_virtuals_error): If the type is abstract, register the + declaration within abstract_pending_vars for further checks. + Inspect also dependent types. Handle IDENTIFIER_NODEs as decl. + * decl.c (cp_finish_decl): Do not strip array types. + (create_array_type_for_decl): Check for abstractness of the element + type. + (complete_vars): Call complete_type_check_abstract. + * class.c (finish_struct): Prepare a list of virtual functions for + template types, and call complete_vars on it to check for abstractness. + +2004-07-12 Paolo Bonzini + + PR tree-optimization/14107 + * decl.c (finish_function): Remove temporary band-aid. + +2004-07-11 Mark Mitchell + + * call.c (build_operator_new_call): Avoid using push_to_top_level. + (build_new_op): Adjust call to lookup_function_nonclass. + * name-lookup.c (identifier_type_value): Adjust call to + lookup_name_real. + (lookup_name_real): Add block_p parameter. + (lookup_name_nonclass): Adjust call to lookup_name_real. + (lookup_function_nonclass): Likewise. + (lookup_name): Likewise. + * name-lookup.h (lookup_name_real): Change prototype. + (lookup_name_nonclass): Likewise. + * parser.c (cp_parser_lookup_name): Likewise. + + * cp-tree.h (saved_scope): Make old_bindings a vector. + (unuse_fields): Remove. + * name-lookup.h (cxx_saved_binding): Define it. + * class.c (pushclass): Don't use unuse_fields. + * name-lookup.c (cxx_saved_binding_make): Remove. + (store_binding): Add new bindings to a vector, using an + accumulator style, rather than adding them to a list. + (store_bindings): Adjust accordingly. + (store_class_bindings): Likewise. + (push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + * optimize.c (maybe_clone_body): Must push_to_top_level and + pop_from_top_level calls outside of loop. + * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope + calls here from cp_parser_late_parsing_default_args. + (cp_parser_save_default_args): Record the class type in which the + function is declared. + (cp_parser_late_parsing_default_args): Do not call + push_nested_class/pop_nested_class. + * search.c (dfs_unuse_fields): Remove. + (unuse_fields): Remove. + +2004-07-11 Joseph S. Myers + + * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL, + LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove. + * cp-tree.h (poplevel): Declare. + (set_block): Remove. + * decl.c (set_block): Remove. + +2004-07-10 Mike Stump + + * decl2.c (import_export_class): Never export/import vtables + with inline key functions. + +2004-07-09 Steven Bosscher + + * typeck.c (c_expand_asm_operands): Remove. + +2004-07-09 Mike Stump + + * typeck.c (build_class_member_access_expr): Skip null deref + warning when we don't dereference it. + +2004-07-09 Giovanni Bajo + + PR c++/8211 + PR c++/16165 + * class.c (check_field_decls): Improve -Weffc++ warning: do not + warn for pointers to functions/members, or for classes without + destructors. + +2004-07-08 Mark Mitchell + + * name-lookup.h (struct cp_binding_level): Update documentation + for class_shadowed. + +2004-07-08 Giovanni Bajo + + PR c++/16169 + * typeck.c (check_return_expr): Improve -Weffc++ warning: handle + returning CALL_EXPR, and non-reference return type. + +2004-07-08 Nathan Sidwell + + * name-lookup.c (push_binding): Use VEC_reserve. + +2004-07-08 Richard Henderson + + * cp-tree.h (expand_eh_spec_block): Remove. + +2004-07-07 Mark Mitchell + + * cp-tree.h (saved_scope): Remove x_previous_class_type and + x_previous_class_values; add x_previous_class_level. + (previous_class_type): Remove. + (previous_class_values): Remove. + (previous_class_level): New macro. + * class.c (pushclass): Restore the identifier cache more + expeditiously. + (invalidate_class_lookup_cache): Use vector for class_shadowed and + previous_class_values. + * decl.c (poplevel): Likewise. + * name-lookup.c (cxx_binding_init): New function. + (cxx_binding_make): Use it. + (push_binding): For a binding in a class level, use a vector of + cp_class_binding nodes. + (push_binding_level): New function. + (begin_scope): Use it. + (leave_scope): Do not put class binding levels on the free list. + (print_binding_level): Adjust for the fact that class_shadowed is + a vector. + (poplevel_class): Likewise. + (clear_identifier_class_values): Likewise. + (push_class_level_binding): Likewise. + (set_class_shadows): Remove. + (store_binding): New function. + (store_class_bindings): New function. + (push_to_top_level): Use store_class_bindings as appropriate. + (pop_from_top_level): Use previous_class_level, not + previous_class_type. + * name-lookup.h (cp_class_binding): New type. + (cp_binding_level): Use a vector object for class_shadowed. + (push_binding_level): Declare. + (set_class_shadows): Remove. + +2004-07-07 Andrew Pinski + + * class.c (instantiate_type): BUFFER_REF is dead. + * lex.c (init_operators): IN_EXPR is dead. + +2004-07-07 Jason Merrill + + PR c++/16334 + * call.c (build_new_op): Give overload warnings for built-in + candidates. + +2004-07-07 H.J. Lu + + PR c++/16276 + * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo + is not public. + +2004-07-07 Nathan Sidwell + + * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove. + * class.c (build_primary_vtable, check_bases, + determine_primary_base, finish_struct_bits, + maybe_warn_about_overly_private_class, dfs_find_final_overrider_q, + get_basefndecls, warn_hidden, walk_subobject_offsets, + build_base_fields, create_vtable_ptr, propagate_binfo_offsets, + layout_virtual_bases, end_of_class, warn_about_ambiguous_bases, + finish_struct_1, get_vfield_name, contains_empty_class_p, + dump_class_hierarchy_r, finish_vtbls, build_vtt_inits, + dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits, + add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust + BINFO macros. + * decl.c (xref_basetypes): Likewise. + * dump.c (cp_dump_tree): Likewise. + * error.c (dump_expr): Likewise. + * init.c (sort_mem_initializers, expand_member_init, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor, do_build_assign_reg, + synthesize_exception_spec): Likewise. + * name-lookup.c (arg_assoc_class): Likewise. + * pt.c (instantiate_class_template, tsubst, + get_template_base_recursive): Likewise. + * ptree.c (cxx_print_type): Likewise. + * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + dfs_access_in_type, access_in_type, lookup_field_queue_p, + bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp, + marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp, + dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet, + binfo_for_vtable, copied_binfo, original_binfo): Likewise + * tree.c (copy_base_binfos, make_binfo): Likewise. + * typeck.c (commmon_base_type): Likewise + * typeck2.c (process_init_constructor): Likewise + +2004-07-06 Joseph S. Myers + + * decl.c (check_tag_decl): Name redeclared type in diagnostic. + +2004-07-06 Giovanni Bajo + + PR c++/3671 + * pt.c (convert_nontype_argument): Disallow conversions between + different enumeration types. + +2004-07-06 Nathan Sidwell + + * cp-tree.h (BINFO_MARKED): Remove. + (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED, + BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P, + BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n. + (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P. + * class.c (build_base_path): Use BINFO_VIRTUAL_P. + (mark_primary_bases, determine_primary_base, base_derived_from, + dfs_find_final_overrider, dfs_find_final_overrider_q, + dfs_find_inal_overrider_post, update_vtable_entry_for_fn, + dfs_modify_vtables, walk_subobject_offsets, + layout_nonempty_base_or_field, build_base_field, + build_base_fields, propagate_binfo_offsets, layout_virtual_bases, + end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable, + finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits, + build_ctor_vtbl_group, accumulate_vtble_inits, + dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries, + build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r, + add_vcall_offset_vtbl_entries_1): Likewise. + * decl.c (xref_basetypes): Incomming virtual base indicated by + TREE_TYPE. Adjust. + * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P. + * init.c (finish_init_stmts, sort_mem_initializers, + emit_mem_initializers, build_vtble_address, expand_member_init, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor): Likewise. + * pt.c (instantiate_class_template, + get_template_base_recursive): Likewise. + * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init, + get_pseudo_ti_desc): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + binfo_from_vbase, binfo_via_virtual, copied_binfo, + original_binfo): Likewise. + * semantics.c (finish_base_specifier): Virtualness is indicated + by TREE_TYPE. + * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P. + +2004-07-06 Mark Mitchell + + Revert: + 2004-06-24 Jason Merrill + PR c++/16115 + * decl.c (grokparms): Give the PARM_DECL reference type if the + parameter is passed by invisible reference. + +2004-07-05 Richard Kenner + + * cp-lang.c (cp_var_mod_type_p): Add extra arg. + * decl.c (grokdeclarator): Extra arg to variably_modified_type_p. + * pt.c (check_instantiated_args, unify): Likewise. + +2004-07-05 Phil Edwards + + * Make-lang.in (check-c++, lang_checks): Add some comments. + +2004-07-05 Zack Weinberg + + * cp-mudflap.c: Delete file. + * Makefile.in: Remove all references to cp-mudflap.o. + +2004-07-05 Zack Weinberg + + * decl.c (cxx_init_decl_processing): Call + build_common_tree_nodes before creating the global NAMESPACE_DECL. + +2004-07-05 Giovanni Bajo + + PR c++/2518 + * call.c (build_operator_new_call): Look only at global scope. + +2004-07-05 Nathan Sidwell + + * call.c (enforce_access): Expect TREE_BINFO. + * class.c (binfo_ctor_vtable): Check TREE_BINFO. + * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove. + (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): + Adjust. + (BINFO_LANG_ELTS): Remove. + (BINFO_LANG_SLOTS): New. + (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1. + (CLASSTYPE_TEMPLATE_INFO): Adjust. + * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case. + * search.c (lookup_member): Check TREE_BINFO. + * semantics.c (perform_or_defer_access_check): Likewise. + (check_accessibility_of_qualified_id): Check + deferred_access_no_check. + * tree.c (make_binfo): Use make_tree_binfo. + +2004-07-04 Mark Mitchell + + * method.c (implicitly_declare_fn): Set linkage of generated + functions. + +2004-07-04 Richard Henderson + + * typeck.c (cxx_mark_addressable): Don't put_var_into_stack. + +2004-07-03 Scott Brumbaugh + + PR c++/3761 + * name-lookup.c (push_class_level_binding): Don't pass a + TREE_LIST of ambiguous names to check_template_shadow as it + only handles declarations. Instead, pull the declaration + out and pass that. + +2004-07-03 Giovanni Bajo + + PR c++/14971 + * pt.c (check_explicit_specialization): Clarify error message. + +2004-07-02 Richard Henderson + + * tree.c (cp_unsave_r): Update remap_save_expr call. + +2004-07-02 Mark Mitchell + + PR c++/16240 + * mangle.c (write_template_arg): Correct mangling. + + PR c++/16297 + * decl.c (grokdeclarator): Robustify. + +2004-07-01 Richard Henderson + + * class.c (fixed_type_or_null): Don't handle RTL_EXPR. + * method.c (synthesize_method): Don't clear_last_expr. + * name-lookup.c (maybe_push_cleanup_level): Likewise. + +2004-07-01 Nick Clifton + + * decl2.c (import_export_class): Invoke the + import_export_class field in the gcc_target structure if it is not + empty. + +2004-06-30 Richard Henderson (rth@redhat.com> + + * decl.c (start_preparsed_function): Don't set immediate_size_expand. + * method.c (use_thunk): Likewise. + +2004-06-30 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call): Call + check_function_arguments instead of check_function_format. + +2004-06-30 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call): Update + calls to check_function_format. + +2004-06-30 Richard Henderson + + * call.c (build_over_call): Use __builtin_memcpy for copying + CLASS_AS_BASE rather than funny casting. + +2004-06-30 Richard Henderson + + * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and + TYPE_SIZE_UNIT of full_type. + +2004-06-30 Per Bothner + + Conditionally compile support for --enable-mapped_location. + * decl.c (pop_label): Handle (imperfectly) USE_MAPPED_LOCATION case. + * decl2.c: If USE_MAPPED_LOCATION, don't do some line number + adjustments - which I don't understand. + * error.c (dump_decl): Rename "" to "". + * error.c: Use LOCATION_FILE and EXPR_LOCATION macros. + (print_instantiation_partial_context): Use expand_location. + * decl.c (duplicate_decl): Use new DECL_IS_BUILTIN macro. + * name-lookup.c: Likewise. + * lex.c (cxx_init): Likewise. Also use BUILTINS_LOCATION. + * name-lookup.c: Use input_line macro. + * parser.c (cp_lexer_get_preprocessor_token): Use UNKNOWN_LOCATION. + (cp_parser_statement): Rename locaal variable statement_locus to + statement_location and use SET_EXPR_LOCATION macro. + * pt.c: Handle USE_MAPPED_LOCATION case. Use new macros. + * tree.c (cp_walk_subtrees): Likewise. + +2004-06-29 Per Bothner + + * tree.c (build_min_nt, build_min, build_min_non_dep): + Don't set TREE_COMPLEXITY from input_line. + +2004-06-29 Paul Brook + + * init.c: Include target.h. + (get_cookie_size): Remove and replace with target hook. + Update callers. + (build_new_1): Store the element size in the cookie. + +2004-06-29 Nathan Sidwell + + PR c++/16260 + * parser.c (cp_parser_template_declaration_after_export): Disable + access checks here ... + (cp_parser_class_specifier): ... not here. + +2004-06-28 Nathan Sidwell + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK, + VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK, + BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate + TREE_CHECK macro. + +2004-06-28 Nathan Sidwell + + * cp-tree.h (struct deferred_access): Move to ... + * semantics.c (struct deferred_access): ... here. Adjust. + (deferred_access_stack): Make a VEC(deferred_access), + (deferred_access_free_list): Remove. + (deferred_access_no_check): New. + (push_deferring_access_checks, resume_deferring_access_checks, + stop_deferring_access_checks, pop_deferring_access_checks, + get_deferred_access_checks, pop_to_parent_deferring_access_checks, + perform_deferred_access_checks, perform_or_defer_access_check): Adjust. + +2004-06-28 Nathan Sidwell + + PR c++/16174 + * call.c (build_temp): Declare. + (check_constructor_callable): New. + (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for + CONSTRUCTOR_CALLABLE. + (convert_like_real, initialize_reference): Use + check_constructor_callable. + * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New. + (LOOKUP_*): Renumber. + +2004-06-28 Nathan Sidwell + + * friend.c (add_friend): Only perform access checks when context + is a class. + * lex.c (cxx_make_type): Only create a binfo for aggregate types. + * parser.c (cp_parser_class_specifier): Disable access checks here + when parsing the body of a templated class. + * semantics.c (perform_or_defer_access_checks): Reorder to allow + NULL binfos when not checking access. + +2004-06-28 Nathan Sidwell + + Use vector API for vbase list. + * cp-tree.h: Include vec.h + (DEF_VEC_P (tree)): New type. + (struct lang_type_class): Change vbase's member type. + (binfo_for_vbase): Declare. + * class.c (determine_primary_base, base_derived_from, + update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class, + warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits, + build_vtbl_initializer): Adjust. + * decl.c (xref_basetypes): Adjust, accumulate upper bound of + vbases. + * init.c (sort_mem_initializers, expand_member_init, + push_base_cleanups): Adjust. + * method.c (do_build_copy_constructor): Adjust. + * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust. + (binfo_for_vbase): New. + * tree.c (copy_base_binfos): Adjust. + +2004-06-28 Mark Mitchell + + * parser.c (cp_parser_set_decl_spec_type): Fix thinko. + +2004-06-27 Gabriel Dos Reis + + PR c++/14123 + * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put + paranthesis in case of pointers to array members. + * error.c (dump_type_prefix): Likewise. + (dump_type_suffix): Maybe issue a whitespace when printing + ARRAY_TYPE. + +2004-06-27 Mark Mitchell + + PR c++/16193 + * parser.c (cp_parser_set_decl_spec_type): Refine test for + redefinition of built-in types. + +2004-06-27 Gabriel Dos Reis + + * error.c (pp_template_argument_list_start): Remove. + (pp_template_argument_list_end): Likewise. + (pp_separate_with_comma): Use pp_cxx_separate_with. + (reinit_global_formatting_buffer): Remove. + (pp_non_consecutive_character): Likewise. + (dump_scope): Use pp_cxx_colon_colon. + (dump_template_parameter): Use pp_cxx_identifier, + pp_cxx_tree_identifier and pp_cxx_whitespace. + (dump_templat_bindings): Replace use of pp_string with sequence + of pp_cxx_whitespace and pp_equal. + (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier, + pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set + padding here. + (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier. + (dump_type_prefix): Don't set padding. Use pp_cxx_whitespace, + pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout. + (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket, + pp_cxx_right_bracket, pp_cxx_identifier throughout, + (dump_decl): Likewise. + (dump_template_decl): Likewise. + (dump_function_decl): Likewise. Set padding as appropriate. + (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and + pp_cxx_right_paren. + (dump_exception_spec): Likewise. + (dump_function_name): Use pp_cxx_tree_identifier and + pp_cxx_identifier. + (dump_template_parms): Use pp_cxx_begin_template_argument_list and + pp_cxx_end_template_argument_list. + (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren, + pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and + pp_cxx_whitespace throughout. + (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and + pp_cxx_right_paren. + (dump_unary_op): Likewise. + (reinit_cxx_pp): New function. + (type_as_string); Use it. + (expr_as_string): Likewise. + (decl_as_string); Likewise. + (context_as_string): Likewise. + (lang_decl_name): Likewise. + (decl_to_string): Likewise. + (expr_to_string): Likewise. + (parm_to_string): Likewise. + (type_to_string): Likewise. + (args_to_string): Likewise. + (cv_to_string): Likewise. + +2004-06-26 Mark Mitchell + + * cp-tree.h (cp_cv_quals): New type. + (cp_declarator): Use it instead of "tree" as appropriate. + (grok_method_quals): Adjust prototype. + (grokclassfn): Likewise. + (do_friend): Likewise. + * decl.c (grokfndecl): Use cp_cv_quals, not tree. + (grokdeclarator): Likewise. + * decl2.c (grok_method_quals): Likewise. + (grokclassfn): Likewise. + * friend.c (do_friend): Likewise. + * method.c (implicitly_declare_fn): Adjust call to grokclassfn. + * parser.c (make_call_declarator): Use cp_cv_quals, not tree. + (make_pointer_declarator): Likewise. + (make_reference_declarator): Likewise. + (make_ptrmem_declarator): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_cv_qualifier_seq_opt): Likewise. + (cp_parser_cv_qualifier_opt): Remove. + (cp_parser_new_declarator_opt): Adjust call to + cp_parser_ptr_operator. + (cp_parser_conversion_declaration_opt): Likewise. + (cp_parser_declarator): Use cp_cv_quals, not tree. + (cp_parser_direct_declarator): Likewise. + +2004-06-26 Richard Kenner + + * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c: + Rename DECL_STMT to DECL_EXPR. + * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise. + * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted. + * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees. + +2004-06-26 Jan Hubicka + + PR C++/14865 + * decl2.c (maybe_emit_vtables): Always import_export_vtable for the + reachability analysis. + +2004-06-25 Mark Mitchell + + * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from + 2004-06-23 change. + +2004-06-25 Paul Brook + + * decl2.c (get_guard): Call targetm.cxx.guard_type. + (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit. + +2004-06-24 Mark Mitchell + + * decl.c (grokdeclarator): Restore error messages about __thread. + * parser.c (cp_parser_decl_specifier_seq): Likewise. + +2004-06-24 Jason Merrill + + PR c++/16115 + * decl.c (grokparms): Give the PARM_DECL reference type if the + parameter is passed by invisible reference. + +2004-06-24 Andreas Schwab + + * cp-tree.h (enum cp_storage_class): Remove trailing comma. + +2004-06-23 Mark Mitchell + + * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h. + (cp/decl.o): Likewise. + (cp/decl2.o): Likewise. + (cp/pt.o): Likewise. + (cp/semantics.o): Likewise. + * config-lang.in (gtfiles): Do not reference cp/lex.h. + * class.c: Do not include lex.h. + (add_implicitly_declared_members): Do not use + adding_implicit_members. + (check_bases_and_members): Do not talk about grok_x_components. + * cp/cp-tree.h (adding_implicit_members): Remove. + (cp_storage_class): New type. + (cp_decl_spec): Likewise. + (cp_decl_specifier_seq): Likewise. + (cp_parameter_declarator): Use it for the decl_specifiers field. + (check_tag_decl): Adjust prototype. + (shadow_tag): Likewise. + (groktypename): Likewise. + (start_decl): Likewise. + (start_function): Likewise. + (start_method): Likewise. + (grok_x_components): Remove. + (grokfield): Adjust prototype. + (grokbitfield): Likewise. + (finish_member_class_template): Remove. + * decl.c: Do not include lex.h. + (adding_implicit_members): Do not define. + (check_tag_decl): Do not use trees to represent decl-specifiers. + (shadow_tag): Likewise. + (groktypename): Likewise. + (start_decl): Likewise. + (grokvardecl): Likewise. + (grokdeclarator): Likewise. + (grokparms): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl.h (grokdeclarator): Adjust prototype. + * decl2.c: Do not include lex.h. + (grok_x_components): Remove. + (grokfield): Do not use trees to represent decl-specifiers. + (grokbitfield): Likewise. + * lex.c: Do not include lex.h. + * lex.h: Remove. + * parser.c: Include target.h. + (clear_decl_specs): New function. + (cp_parser_translation_unit): Do not use trees to represent + decl-specifiers. + (cp_parser_postfix_expression): Likewise. + (cp_parser_new_type_id): Likewise. + (cp_parser_condition): Likewise. + (cp_parser_simple_declaration): Likewise. + (cp_parser_decl_specifier_seq): Likewise. + (cp_parser_function_specifier_opt): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_template_parameter): Likewise. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_type_specifier): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_type_specifier_seq): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_single_declaration): Likewise. + (cp_parser_save_member_function_body): Likewise. + (cp_parser_friend_p): Likewise. + (cp_parser_set_storage_class): New function. + (cp_parser_set_decl_spec_type): Likewise. + * pt.c: Do not include lex.h. + * semantics.c: Likewise. + (finish_member_class_template): Remove. + +2004-06-23 Roger Sayle + + * call.c (build_cxx_call): Don't call expand_tree_builtin. No + longer take both "args" and "convert_args" as arguments. + (build_op_delete_call): Update call to build_cxx_call. + (build_over_call): Likewise, update call to build_cxx_call. + * cp-tree.h (build_cxx_call): Update funtion prototype. + * typeck.c (build_function_call): Don't call expand_tree_builtin. + * rtti.c (throw_bad_cast): Update call to build_cxx_call. + (throw_bad_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + +2004-06-22 Richard Henderson + + * class.c (build_vfn_ref): Take a pointer not object. Build + an OBJ_TYPE_REF. + (cp_fold_obj_type_ref): New. + * call.c (build_over_call): Update build_vfn_ref call. + * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New. + * cp-tree.h (cp_fold_obj_type_ref): Declare. + +2004-06-21 Jason Merrill + + PR c++/16112 + * cp-gimplify.c (cp_gimplify_init_expr): Look through + CLEANUP_POINT_EXPR. + +2004-06-21 Mark Mitchell + + * cp-tree.def (NEW_EXPR): Add a fourth slot. + * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove. + (TREE_PARMLIST): Likewise. + (CALL_DECLARATOR_PARMS): Likewise. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. + (cp_declarator_kind): New type. + (cp_parameter_declarator): Likewise. + (cp_declarator): Likewise. + (cp_error_declarator): Likewise. + (no_parameters): Likewise. + (groktypename): Change prototype. + (start_decl): Likewise. + (start_handler_parms): Likewise. + (get_scope_of_declarator): Likewise. + (start_function): Likewise. + (start_preparsed_function): New function. + (start_function): Change prototype. + (start_method): Likewise. + (grokfield): Likewise. + (grokbitfield): Likewise. + (build_new): Likewise. + (make_pointer_declarator): Remove. + (make_reference_declarator): Likewise. + (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + (process_template_parm): Change prototype. + (begin_function_definition): Remove. + (finish_parmlist): Remove. + * decl.c (groktypename): Do not use trees to represent + declarators. + (start_decl): Likewise. + (start_handler_parms): Remove. + (get_scope_of_declarator): Reimplement. + (grokdeclarator): Do not use trees to represent declarators. + (grokparms): Likewise. + (start_function): Likewise. + (start_method): Likewise. + (build_void_list_mode): Do not use TREE_PARMLIST. + * decl.h (grokdeclarator): Change prototype. + * decl2.c (grok_method_quals): Robustify. + (grok_x_components): Do not use trees to represent declarators. + (grokfield): Likewise. + (grokbitfield): Likewise. + (start_objects): Build FUNCTION_DECLs, not declarators. + (start_static_storage_duration_function): Likewise. + * init.c (build_new): Simplify. + * lex.c (make_pointer_declarator): Remove. + (make_reference_declarator): Likewise. + (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + * method.c (use_thunk): Use start_preparsed_function. + (synthesize_method): Likewise. + (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators. + * optimize.c (maybe_clone_body): Use start_preparsed_function. + * parser.c (cp_error_declarator): New variable. + (declarator_obstack): Likewise. + (alloc_declarator): New function. + (make_declarator): Likewise. + (make_id_declarator): Likewise. + (make_pointer_declarator): Likewise. + (make_reference_declarator): Likewise. + (make_ptrmem_declarator): Likewise. + (make_call_declarator): Likewise. + (make_array_declarator): Likewise. + (no_parameters): New variable. + (make_parameter_declarator): Likewise. + (cp_parser_check_for_definition_in_return_type): Do not use trees + to represent declarators. + (cp_parser_translation_unit): Likewise. + (cp_parser_new_expression): Likewise. + (cp_parser_new_type_id): Likewise. + (cp_parser_new_declarator_opt): Likewise. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_condition): Likewise. + (cp_parser_declaration_statement): Likewise. + (cp_parser_declaration): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_conversion_declarator_opt): Likewise. + (cp_parser_template_parameter_list): Likewise. + (cp_parser_template_parameter): Likewise. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_declarator): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_parameter_declaration_clause): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + (cp_parser_check_declarator_template_parameters): Likewise. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_save_member_function_body): Likewise. + * pt.c (process_template_parm): Add is_non_type parameter. + (convert_template_argument): Adjust call to groktypename. + (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST. + (tsubst): Do not expect declarators. + (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional + argument. + (instantiate_decl): Use start_preparsed_function. + * semantics.c (begin_function_definition): Remove. + (finish_parmlist): Remove. + * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not + declarators. + +2004-06-21 Richard Kenner + + * call.c (build_vfield_ref): Add new operand for COMPONENT_REF. + (build_new_method_call): Likewise. + * decl.c (local_variable_p_walkfn): Don't walk into types. + * decl2.c (grok_array_decl): Add new operands for ARRAY_REF. + (build_anon_union_vars): Add new operand for COMPONENT_REF. + * init.c (buld_new): Add new operand for ARRAY_REF. + * method.c (do_build_copy_constructor): New op for COMPONENT_REF. + (do_build_assign_ref): Likewise. + * parser.c (cp_parser_direct_new_declarator): Add new operands + for ARRAY_REF. + (cp_parser_direct_declarator): Likewise. + * pt.c (tsubst): Likewise. + (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand + for COMPONENT_REF. + * semantics.c (finish_non_static_data_member): Add new operand + for COMPONENT_REF. + * typeck.c (build_class_member_access_expr): Likewise. + (build_class_member_access_expr, finish_class_member_access_expr): + Likewise. + (build_ptrmemfunc_access_expr): Likewise. + (build_array_ref): Add new operands for ARRAY_REF. + * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too. + * tree.c (count_trees_r, no_linkage_helper): Don't walk in types. + +2004-06-21 Richard Henderson + + * dump.c (cp_dump_tree): Don't use dump_next_stmt. + * parser.c (cp_parser_jump_statement): Update commentary. + * pt.c (tsubst_expr): Use RETURN_EXPR. + * semantics.c (finish_return_stmt): Likewise. + (finalize_nrv_r): Likewise. + * typeck.c, typeck2.c: Update file start commentary. + +2004-06-21 Richard Henderson + + * semantics.c (finish_expr_stmt): Call verify_sequence_points. + +2004-06-20 Richard Henderson + + * cp-tree.h (add_decl_stmt): Declare. + * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR. + * semantics.c (maybe_cleanup_point_expr): New. + (add_decl_stmt, finish_expr_stmt, finish_return_stmt, + finish_for_expr, finish_switch_cond): Use it. + (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN. + +2004-06-20 Richard Henderson + + * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def. + * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c. + (cp_gimplify_expr): Call it. + (gimplify_cleanup_stmt): Move from c-gimplify.c. + (cp_genericize): New. + * decl.c (finish_function): Call it. + * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT. + (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h. + (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise. + (cp_genericize): Declare. + * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT. + * dump.c (cp_dump_tree): Likewise. + * semantics.c (push_cleanup): Move from c-semantics.c. + +2004-06-20 Zack Weinberg + + * cp-lang.c (has_c_linkage): Implement. + + * cp-tree.h (set_mangled_name_for_decl): Don't prototype. + * decl.c (duplicate_decls): Use COPY_DECL_RTL. + (builtin_function_1): Don't call make_decl_rtl. + (build_cp_library_fn): Don't call set_mangled_name_for_decl. + (grokvardecl): Don't call mangle_decl. + * except.c (nothrow_libfn_p): Look at DECL_NAME, not + DECL_ASSEMBLER_NAME. + * method.c (set_mangled_name_for_decl): Delete. + * name-lookup.c (pushdecl): When a local extern shadows a + file-scope declaration of the same object, give both DECLs the + same DECL_UID. + * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE + on DECL_ASSEMBLER_NAME. + +2004-06-19 Richard Henderson + + * cp-gimplify.c: Remove unnecessary prototypes. + (cp_gimplify_stmt): Merge into ... + (cp_gimplify_expr): ... here. Move to end of file. Handle + stmts_are_full_exprs_p frobbing. + * cp-tree.h (cp_gimplify_stmt): Remove. + * pt.c (tsubst_expr): Merge prep_stmt and unify. + * tree.c (init_tree): Don't set lang_gimplify_stmt. + +2004-06-18 Richard Henderson + + PR c++/16034 + * semantics.c (begin_cond): New. + (finish_cond): Rewrite to handle template DECL_STMTs specially. + Assume that non-template decls go land before the conditional. + (simplify_loop_decl_cond): Likewise. + (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt, + finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond, + begin_switch_stmt, finish_switch_cond): Update to match. + +2004-06-17 Jason Merrill + + PR c++/16015 + * semantics.c (simplify_aggr_init_expr): Don't return the slot. + (finish_stmt_expr_expr): Update type after conversions. + (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR. + Handle void initializer. + * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void. + +2004-06-17 Geoffrey Keating + + * class.c (build_clone): Don't call defer_fn, let mark_used do it. + * cp-tree.h (defer_fn): Delete. + * decl2.c (defer_fn): Delete. + (finish_file): Simplify deferred_fns loops; check that + only used inline functions get into deferred_fns. + (mark_used): Inline previous contents of defer_fn. + +2004-06-16 Richard Henderson + + * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill. + (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New. + * cxx-pretty-print.c (pp_cxx_function_definition): Move handling + of CTOR_INITIALIZER ... + (pp_cxx_statement): ... here. + * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK. + (finish_function): Use alloc_stmt_list to zap entire function. + * parser.c (cp_parser_compound_statement): Update commentary. + * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT. + * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise. + (finish_stmt_expr): Don't look through COMPOUND_STMT. + +2004-06-16 Geoffrey Keating + + * pt.c (mark_decl_instantiated): Don't call defer_fn. + +2004-06-16 Richard Henderson + + * parser.c (cp_parser_labeled_statement): Update commentary. + * pt.c (tsubst_expr): Use CASE_LABEL_EXPR. + * tree.c (mark_local_for_remap_r): Likewise. + +2004-06-16 Richard Henderson + + * parser.c (cp_parser_asm_definition): Update commentary. + * pt.c (tsubst_expr): Use ASM_EXPR. + * semantics.c (finish_asm_stmt): Likewise. + +2004-06-16 Richard Henderson + + * decl.c (finish_destructor_body): Use LABEL_EXPR. + * parser.c (cp_parser_statement): Update commentary. + * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR. + * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise. + * tree.c (mark_local_for_remap_r): Likewise. + +2004-06-16 Richard Henderson + + PR c++/16012 + * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init + statement in FOR_INIT_STMT for templates. + +2004-06-15 Richard Henderson + + * call.c (initialize_reference): Don't build CLEANUP_STMT here. + * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument. + (genericize_try_block): Use gimplify_stmt. + (genericize_catch_block, genericize_eh_spec_block): Likewise. + (cp_gimplify_init_expr): Remove STMT_EXPR special case. + (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. + (cp_tree_chain_matters_p): Remove. + * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New. + (COMPOUND_STMT_BODY_BLOCK): New. + (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New. + (EXPR_STMT_STMT_EXPR_RESULT): New. + (building_stmt_tree): Check cur_stmt_list. + (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove. + (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New. + * decl.c (poplevel): Use pop_stmt_list for minding cleanups. + (cp_finish_decl): Use push_cleanup. + (start_function, finish_function): Use statement lists. + (finish_stmt): Do nothing. + * except.c (begin_eh_spec_block): Use statement lists. + (check_handlers_1, check_handlers): Likewise. + * init.c (construct_virtual_base): Don't add extra compound stmts. + (build_vec_init): Likewise. + * name-lookup.c (maybe_push_cleanup_level): Use statement lists. + * name-lookup.h (struct cp_binding_level): Add statement_list. + * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool. + (cp_parser_labeled_statement, cp_parser_expression_statement, + cp_parser_statement_seq_opt): Likewise. + (cp_parser_compound_statement): Likewise. Take bool for try block. + (cp_parser_selection_statement): Tidy if processing. + (cp_parser_already_scoped_statement): Rewrite to do what it says. + * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr. + (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST. + Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT. + * semantics.c (do_poplevel, do_pushlevel): Use statement lists. + (finish_cond): New, rewritten from FINISH_COND. + (simplify_loop_decl_cond): New. + (finish_expr_stmt): Avoid nested EXPR_STMTs. + (begin_if_stmt, finish_if_stmt_cond, finish_then_clause, + begin_else_clause, finish_else_clause, finish_if_stmt, + begin_while_stmt, finish_while_stmt_cond, finish_while_stmt, + begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt, + finish_for_cond, finish_for_stmt, begin_switch_stmt, + finish_switch_cond, finish_switch_stmt, begin_try_block, + finish_try_block, finish_cleanup_try_block, finish_function_try_block, + finish_handler_sequence, finish_function_handler_sequence, + begin_handler, finish_handler_parms, finish_handler, + begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite + using statement lists. + (begin_compound_stmt): Replace has_no_scope argument with flags. + Update all callers. Use statement lists. + (finish_compound_stmt): Likewise. + (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup. + (current_scope_stmt_stack): Remove. + (simplify_aggr_init_expr): Don't muck with TREE_CHAIN. + * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): + Rewrite with statement lists. + +2004-06-15 Alexandre Oliva + + * parser.c: Change all assignments of c_lex_string_translate + to true and false to 1 and 0. + (cp_lexer_read_token): Convert type of the translated string. + (cp_parser_skip_to_closing_parentheses): Preserve original + value of c_lex_string_translate, and set it to -1 while + running. + (cp_parser_cache_group): Likewise. + (cp_parser_cache_group_1): Renamed. + (cp_parser_asm_operand_list): Remove redundant setting of + c_lex_string_translate. + (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]: + Handle chained strings. + +2004-06-12 Andrew Pinski + + PR c++/14639 + Revert: + 2004-06-02 Andrew Pinski + + * cp-tree.h: Fix typo. + + * cp-tree.h: Include cgraph.h + (DECL_NEEDED_P): Use cgraph_*node on the decl instead of + TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl. + +2004-06-12 Jason Merrill + + PR tree-optimization/14107 + * decl.c (finish_function): Warn about no return in all functions. + +2004-06-15 Paolo Bonzini + + * cp-tree.h (struct language_function): Remove cannot_inline. + * decl.c (save_function_data): cannot_inline is no more. + (cxx_push_function_context): Likewise. + * decl2.c (start_objects, start_static_storage_duration_function): + Reset DECL_INLINE, set DECL_UNINLINABLE. + +2004-06-14 Giovanni Bajo + + PR c++/15967 + * search.c (lookup_field): Propagate the ambiguity list. + (lookup_fnfields): Likewise. + +2004-06-14 Giovanni Bajo + + PR c++/15947 + * parser.c (cp_parser_template_name): Ctors/dtors never need a + template keyword to disambiguate. + +2004-06-14 Mark Mitchell + + PR c++/15096 + * decl.c (grokdeclarator): Ignore pointer-to-members when + computing template depth. + + PR c++/14930 + * name-lookup.c (pushtag): Do not try to put class declarations in + explicit specialization scopes. + +2004-06-11 Andrew Pinski + + * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior. + +2004-06-11 Mark Mitchell + + PR c++/15862 + * name-lookup.c (unqualified_namespace_lookup): Do not ignore type + bindings for undeclared built-ins. + +2004-06-11 Giovanni Bajo + + * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them + appear at the correct location. + +2004-06-10 Jason Merrill + + PR c++/15875 + Revert: + 2004-06-01 Kriang Lerdsuwanakij + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-06-10 Mark Mitchell + + PR c++/15227 + * parser.c (cp_parser_direct_declarator): Robustify. + + PR c++/15877 + * pt.c (tsubst_copy): Use decl_constant_value on enumeration + constants in non-dependent contexts. + + PR c++/14211 + PR c++/15076 + * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when + necessary. + +2004-06-10 Jakub Jelinek + + PR c++/14791 + * decl.c (duplicate_decls): Handle fileptr_type_node arguments + specially. + +2004-06-09 Mark Mitchell + + Revert: + PR c++/15815 + 2004-06-07 Mark Mitchell + * lex.c (handle_pragma_interface): Deprecate. + (handle_pragma_implementation): Likewise. + +2004-06-09 Andrew Pinski + + * g++spec.c (lang_specific_driver): Remove check for -lm + and -lmath when check it see if it was the math library. + +2004-06-08 Giovanni Bajo + + PR c++/7841 + * parser.c (cp_parser_direct_declarator): Reject constructor named + as qualified template-id. + +2004-06-07 Mark Mitchell + + PR c++/15815 + * lex.c (handle_pragma_interface): Deprecate. + (handle_pragma_implementation): Likewise. + +2004-06-07 Mark Mitchell + + PR c++/15766 + * parser.c (cp_parser_iteration_statement): Fix typo in error + message. + + PR c++/14777 + * pt.c (tsubst_default_argument): Do not defer access checks + while substituting into the default argument. + + PR c++/15554 + * pt.c (tsubst_copy): Do not try to substitute for an enumeration + constant in a non-dependent context. + + PR c++/15057 + * except.c (build_throw): Ensure that temp_expr has been + initialized. + +2004-06-06 Roger Sayle + + * cp/cp-tree.h (lvalue_or_else): Add function prototype. + +2004-06-06 Giovanni Bajo + + PR c++/15503 + * parser.c (cp_parser_mem_initializer_id): Gracefully reject + 'typename', and accept 'template'. + +2004-06-03 Andrew Pinski + Jan Hubicka + + PR c++/14639 + * method.c (use_think): Do not mark thunk as referenced. + +2004-06-03 Matt Austern + + PR c++/15428 + * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC + is nonzero, and if we see a noninline definition of a key method, + make the vtables nonweak. + +2004-06-02 Matt Austern + + * cp-tree.h (instantiate_decl): new boolean parameter, + undefined_ok. Current behavior is equivalent to its being 0. + * decl2.c (mark_used): Add new argument when calling instantiate_decl + * pt.c (mark_decl_instantiated): Unconditionally make + instantiations explicit unconditionally + (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION, + since mark_decl_instantiated now does it. + (instantiate_class_member): New. Instantiate a member of an + explicitly instantiated class template. + (do_type_instantiation): Explicitly instantiate members of an + explicitly instantiated class template. + (instantiate_decl): if undefined_ok is nonzero, and if we're + trying to explicitly instantiated a template with no definition, + change it to an implicit instantiation. + (instantiate_pending_templates): Add new argument to instantiate_decl. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + +2004-06-02 Andrew Pinski + + * cp-tree.h: Fix typo. + + * cp-tree.h: Include cgraph.h + (DECL_NEEDED_P): Use cgraph_*node on the decl instead of + TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl. + +2004-06-01 Jason Merrill + + PR c++/15142 + * call.c (call_builtin_trap): Remove type parm. + (convert_arg_to_ellipsis): Change a non-POD argument to integer type. + (build_x_va_arg): Dereference a null pointer for a non-POD argument. + +2004-06-01 Kriang Lerdsuwanakij + + PR c++/13092 + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-06-01 Richard Henderson + Andrew Pinski + + * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof". + * parser.c (struct cp_parser): Remove in_offsetof. + (cp_parser_new): Don't set it. + (cp_parser_unary_expression): Don't check it. + (cp_parser_postfix_open_square_expression): Split out from ... + (cp_parser_postfix_expression): ... here. + (cp_parser_postfix_dot_deref_expression): Likewise. + (cp_parser_builtin_offsetof): New. + (cp_parser_primary_expression): Use it. + +2004-06-01 Giovanni Bajo + + PR c++/14932 + * parser.c (cp_parser_postfix_expression): Allow subscript + operator in offsetof. + +2004-05-31 Mark Mitchell + + PR c++/15701 + * friend.c (add_friend): Do not try to perform access checks for + functions from dependent classes. + +2004-05-31 Gabriel Dos Reis + + * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. + (pp_cxx_begin_template_argument_list): Turn into a function. + (pp_cxx_end_template_argument_list): Likewise. + (pp_cxx_separate_with): Define. + (pp_cxx_unqualified_id): Tidy. + (pp_cxx_primary_expression): Likewise. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_expression): Likewise. + (pp_cxx_simple_type_specifier): Likewise. + (pp_cxx_type_specifier_seq): Likewise. + (pp_cxx_parameter_declaration_clause): Likewise. + (pp_cxx_exception_specification): Likewise. + (pp_cxx_direct_declarator): Likewise. + (pp_cxx_type_id): Likewise. + * cxx-pretty-print.h (pp_cxx_whitespace): Export from + cxx-pretty-print.c. + (pp_cxx_left_paren): Likewise. + (pp_cxx_right_paren): Likewise. + (pp_cxx_left_brace): Likewise. + (pp_cxx_right_brace): Likewise. + (pp_cxx_left_bracket): Likewise. + (pp_cxx_right_bracket): Likewise. + (pp_cxx_dot): Likewise. + (pp_cxx_identifier): Likewise. + (pp_cxx_tree_identifier): Likewise. + (pp_cxx_ampersand): New macro. + (pp_cxx_star): Likewise. + (pp_cxx_arrow): Likewise. + (pp_cxx_semicolon): Likewise. + (pp_cxx_complement): Likewise. + (pp_cxx_begin_template_argument_list): Declaree. + (pp_cxx_end_template_argument_list): Likewise. + (pp_cxx_colon_colon): likewise. + +2004-05-31 Eric Botcazou + + * parser.c (cp_parser_simple_type_specifier): Explicitly test + against NULL_TREE. + +2004-05-31 Kazu Hirata + + * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c, + typeck.c: Fix comment formatting. + +2004-05-30 Andrew Pinski + + * cp-lang.c (cp_expand_decl): Remove. + (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl. + +2004-05-30 Andreas Jaeger + + * lang-specs.h: Add missing initializers for .ii. + +2004-05-28 Aldy Hernandez + + * decl.c (cp_make_fname_decl): Free return value from + fname_as_string. + +2004-05-28 Mark Mitchell + + PR c++/15083 + * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR, + even in a templat.e + * init.c (build_new): Likewise. + + PR c++/15640 + * name-lookup.c (arg_assoc): Robustify. + + PR c++/15471 + * typeck.c (unary_complex_lvalue): Use context_for_name_lookup + when determining the scope to use for a pointer to member. + (lookup_anon_field): Give it external linkage. + * cp-tree.h (lookup_anon_field): Declare it. + * expr.c (cplus_expand_constant): Use it. + +2004-05-28 Mark Mitchell + + PR c++/14668 + * parser.c (cp_parser_simple_type_specifier): Call + maybe_note_name_used_in_class. + +2004-05-28 Tom Marshall + + PR c++/15214 + * class.c (finish_struct_1): Warn only if the dtor is non-private or + the class has friends. + +2004-05-27 Adam Nemet + + PR c++/12883 + * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and + TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type. + +2004-05-24 Geoffrey Keating + + * method.c (implicitly_declare_fn): Don't call defer_fn; abort + if it might be needed. + * pt.c (mark_decl_instantiated): Only call defer_fn if + the function actually needs processing in finish_file. + * decl2.c (finish_file): Add check that elements in + deferred_fns_used are really needed there. Remove unnecessary + test of DECL_SAVED_TREE. + +2004-05-23 Paolo Bonzini + + * Make-lang.in: No need to specify $(LIBCPP). + +2004-05-23 Mark Mitchell + + PR c++/15044 + * parser.c (cp_parser_class_head): Robustify. + + PR c++/15317 + * parser.c (cp_parser_decl_specifier_seq): Correct error in + comment. + (cp_parser_constructor_declarator_p): Treat attributes + as decl-specifiers. + + PR c++/15329 + * typeck.c (build_unary_op): Do not attempt to resolve casts to + base classes in templates. + +2004-05-23 Mark Mitchell + + PR c++/15165 + * pt.c (instantiate_template): Robustify. + +2004-05-23 Mark Mitchell + + PR c++/15025 + * decl.c (xref_tag): Issue errors about redeclaring template + classes as non-template classes. + +2004-05-23 Mark Mitchell + + PR c++/14821 + * name-lookup.c (supplement_binding): Allow redefinitions of + namespace aliases. + + PR c++/14883 + * parser.c (cp_parser_template_argument): Robustify. + +2004-05-23 Gabriel Dos Reis + + * class.c (alter_access): Use %E format specifier to print an + identifier node. Avoid looking at the IDENTIFIER_POINTER. + (push_lang_context): Likewise. + * decl.c (lookup_label): Likewise. + (grokdeclarator): Likewise. + * parser.c (cp_parser_check_for_invalid_template_id): Likewise. + * pt.c (do_type_instantiation): Likewise. + * tree.c (handle_java_interface_attribute): Likewise. + (handle_com_interface_attribute): Likewise. + (handle_init_priority_attribute): Likewise. + +2004-05-22 Mark Mitchell + + PR c++/15285 + PR c++/15299 + * pt.c (build_non_dependent_expr): Expand the set of tree nodes + recognized as overloaded functions. + +2004-05-22 Mark Mitchell + + PR c++/15507 + * class.c (layout_nonempty_base_or_field): Do not try to avoid + layout conflicts for unions. + + PR c++/15542 + * typeck.c (build_x_unary_op): Instantiate template class + specializations before looking for "operator &". + + PR c++/15427 + * typeck.c (complete_type): Layout non-dependent array types, even + in templates. + + PR c++/15287 + * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a + template. + +2004-05-22 Roger Sayle + + * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by + returning when TREE_TYPE is error_mark_node. + * typeck.c (require_complete_type): Return error_mark_node if + value's type is an error_mark_node. + +2004-05-20 Andrew Pinski + + * optimize.c (calls_setjmp_r): Remove. + (calls_setjmp_p): Remove. + * cp-tree.c (calls_setjmp_p): Remove. + * decl.c (finish_function): Do not call calls_setjmp_p. + +2004-05-18 Zack Weinberg + + * decl.c (cp_finish_decl): Use mark_decl_referenced. + * decl2.c (maybe_make_one_only): Likewise. + * method.c (use_thunk): Likewise. + +2004-05-18 Jason Merrill + + * class.c (build_base_path): Tidy a bit. + +2004-05-14 Geoffrey Keating + + * name-lookup.c (struct scope_binding): New. + (EMPTY_SCOPE_BINDING): New. + (lookup_using_namespace): Take a scope_binding instead of a + cxx_binding. + (qualified_lookup_using_namespace): Likewise. + (cxx_binding_clear): Delete. + (do_nonmember_using_decl): Use a scope_binding instead of a + cxx_binding. + (lookup_tag): Don't call select_decl. + (ambiguous_decl): Don't return anything (and change callers to match). + Take a scope_binding as the second parameter. + (lookup_namespace_name): Use a scope_binding instead of a + cxx_binding. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Likewise. + (select_decl): Take a scope_binding instead of a cxx_binding. + Use macros rather than hand-coding tests for type-ness. + +2004-05-13 Diego Novillo + + * cp-gimplify.c: Rename from cp-simplify.c. + * Make-lang.in, optimize.c: Update. + +2004-05-13 Diego Novillo + + Merge from tree-ssa-20020619-branch. See + ChangeLog.tree-ssa for details. + + * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def, + cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c, + expr.c, init.c, name-lookup.h, optimize.c, parser.c, + pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: + Merged. + * cp-mudflap.c: New file. + * cp-simplify.c:: New file. + +2004-05-03 Giovanni Bajo + + PR c++/14389 + * decl2.c (check_classfn): For member templates, compare also the + template parameters to match the declaration. + * cp-tree.h: Adjust declaration of check_classfn. + * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn. + * friend.c (do_friend): Likewise. + * pt.c (tsubst_friend_function): Likewise. + +2004-05-01 Zack Weinberg + + * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE. + Instead, dig into the representation type to find the array bound. + +2004-04-30 Jason Merrill + + Refer to base members using COMPONENT_REFs where possible. + * class.c (build_simple_base_path): New fn. + (build_base_path): Use it for non-virtual base references. + (layout_class_type): Change base fields to their real type + after layout is done. + * cp-tree.h (IS_FAKE_BASE_TYPE): New macro. + * cp-lang.c (cxx_get_alias_set): Use it. + +2004-04-30 Kazu Hirata + + * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix + comment typos. + +2004-04-23 Giovanni Bajo + + PR c++/15064 + * parser.c (cp_parser_postfix_expression): typeid operator cannot be + used in integral constant expressions. + +2004-04-22 Mark Mitchell + + * init.c (build_aggr_init): Fix accidental use of C99 construct in + previous change. + + * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on + braced initializer. + * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro. + * decl.c (reshape_init): Use it. + * init.c (perform_member_init): Remove redundant condition. + (build_aggr_init): Adjust to handle brace-enclosed initializers + correctly. + (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P. + + * parser.c (cp_parser_initializer_clause): Do not set + TREE_HAS_CONSTRUCTOR on the initializer. + * rtti.c (tinfo_base_init): Likewise. + (generic_initializer): Likewise. + (ptr_initializer): Likewise. + (ptm_initializer): Likewise. + (class_initializer): Likewise. + (get_pseudo_ti_init): Likewise. + * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P. + +2004-04-22 Alan Modra + + * name-lookup.c (anonymous_namespace_name): Make static. + +2004-04-19 Roger Sayle + + PR middle-end/14531 + * class.c (build_base_path): Call fold whilst building the NULL + pointer check expression trees. + +2004-04-15 Bryce McKinlay + + * init.c (build_new_1): Don't use type size argument for Java + _Jv_AllocObject call. + +2004-04-09 Danny Smith + + * method.c (make_alias_for_thunk): Remove preprocessor guard on + declaration and definition. + +2004-04-08 Danny Smith + + PR c++/14808 + * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather + than ASM_OUTPUT_DEF. + +2004-04-08 Jakub Jelinek + + * decl2.c (mark_used): Don't segfault if cfun != NULL but + current_function_decl == NULL. + +2004-04-05 Nathan Sidwell + + PR c++/3518 + * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer + level. + +2004-04-05 Richard Kenner + + * init.c (decl_constant_value): Don't look at DECL_INITIAL + of PARM_DECL. + * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT + or TREE_SIDE_EFFECTS of a type. + +2004-04-02 Nathan Sidwell + + PR c++/14007 + * pt.c (check_cv_quals_for_unify): Correct logic for disallowed + cv-qualifier unification. + * tree.c (cp_build_qualified_type_real): Renable DR295 logic. + +2004-04-02 Jan Hubicka + + * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. + * cp-tree.h (cp_update_decl_after_saving): Declare. + * tree.c (cp_update_decl_after_saving): Define. + +2004-04-01 Mark Mitchell + + PR c++/14803 + * typeck.c (get_delta_difference): Call fold before returning the + value. + +2004-04-01 Richard Henderson + + PR c++/14804 + * decl.c (cp_finish_decl): Preserve TREE_READONLY more often. + * typeck2.c (split_nonconstant_init): Clear TREE_READONLY. + +2004-04-01 Mark Mitchell + + PR c++/14810 + * name-lookup.c (maybe_push_cleanup_level): Robustify. + +2004-04-01 Richard Kenner + + * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly. + +2004-03-31 Richard Kenner + + * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (type_promotes_to): Likewise. + * decl.c (finish_enum): Likewise. + * mangle.c (write_builtin_type): Likewise. + * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise. + * typeck.c (type_after_usual_arithmetic_conversions): Likewise. + (build_binary_op): Likewise. + +2004-03-31 Jan Hubicka + + * tree.h (optimize_function): Kill prototype. + * optimize.c (dump_function, optimize_function, dump_finction): Kill. + * semantics.c (expand_body): Kill. + +2004-03-30 Mark Mitchell + + PR c++/14724 + * decl.c (start_decl_1): Do not decide whether or not to create a + new cleanup level until after the type has been completed. + + PR c++/14763 + * pt.c (tsubst_default_argument): Clear current_function_decl. + +2004-03-30 Zack Weinberg + + * name-lookup.c, parser.c: Use new shorter form of GTY markers. + +2004-03-29 Zack Weinberg + + * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC + is null, just print the literal name and return. + +2004-03-25 Kazu Hirata + + * cxx-pretty-print.c: Fix comment typos. + +2004-03-24 Kazu Hirata + + * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c: + Update copyright. + +2004-03-23 Ziemowit Laski + + * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H). + * mangle.c (write_type): Add call to 'mangle_fundamental_type' + target hook. + +2004-03-23 Zack Weinberg + + PR 12267, 12391, 12560, 13129, 14114, 14133 + * cp-lang.c (c_reset_state): Delete. + (push_file_scope, pop_file_scope): New stubs. + * parser.c (c_parse_file): Call sorry() here if called more than once. + +2004-03-23 Richard Kenner + + * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW + for INTEGER_CST. + +2004-03-22 Gabriel Dos Reis + + * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare. + +2004-03-21 Gabriel Dos Reis + + * error.c (enum pad): Remove. + (dump_qualifiers): Likewise. + (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq. + (dump_aggr_type): Likewise. + (dump_type_suffix): Likewise. + (dump_simple_decl): Likewise. + (dump_function_decl): Likewise. + (cv_to_string): Likewise. + (dump_type_prefix): Likewise. Adjust return void. + * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to + cxx_pretty_print.h. + (pp_cxx_template_keyword_if_needed): Document. + (pp_cxx_qualified_id): Document case FUNCTION_DECL. Tidy. + (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and + MUST_NOT_THROW_EXPR. + +2004-03-21 Mark Mitchell + + PR c++/14616 + * decl.c (cp_finish_decl): Compute the size of arrays declared in + templates, if their type is non-dependent. + +2004-03-19 Mark Mitchell + + * call.c (build_op_delete_call): Do not forget the placement + arguments when iterating through mutiple delete operators. + + * cp-tree.h (svaed_scope): Remove last_parms. + (NEW_DELETE_OPNAME_P): New macro. + (last_function_parms): Remove. + (do_friend): Adjust prototype. + * decl.c (grokparms): Return the PARM_DECLs directly, rather than + using last_function_parms. + (grokfndecl): Take the PARM_DECLs as an argument, rather than + using last_function_parms. + (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs + for class-specific operator new and operator delete. + (grok_op_properties): Do not look for allocation functions with + METHOD_TYPEs. + (start_function): Use DECL_ARGUMENTS instead of + last_function_parms. + * decl.h (last_function_parms): Do not declare. + * decl2.c (grokclassfn): Do not use last_function_parms. + * friend.c (do_friend): Remove parmdecls parameter. + * name-lookup.c (push_to_top_level): Do not save last_function_parms. + (pop_from_top_level): Do not restore it. + * pt.c (check_explicit_specialization): Do not adjust + last_function_parms. + + * name-lookup.c (do_local_using_decl): Create a local binding for + types brought in via using declarations. + + * name-lookup.c (lookup_arg_dependent): Handle block-scope + function declarations correctly. + + * semantics.c (finish_id_expression): Correct handling of + conversion operators to dependent types. + + * typeck.c (lookup_destructor): Allow the use of destructors from + base classes. + +2004-03-19 Richard Kenner + + * cxx-pretty-print.c (pp_cxx_unqualified_id): Use + TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS. + * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean + the field is named TEMPLATE_TYPE_PARM_INDEX. + +2004-03-19 Giovanni Bajo + + PR c++/14545 + * parser.c (cp_parser_functional_cast): A cast to anything + but integral or enumaration type is not an integral constant + expression. + * pt.c (value_dependent_expression_p): Handle cast expressions + without operands (such as "int()"). + +2004-03-18 Mark Mitchell + + * semantics.c (finish_pseudo_destructor_expr): Allow differing + cv-qualification between the type named by the + pseudo-destructor-name and the object-type. + + * search.c (accessible_base_p): Handle non-proper bases. + + * name-lookup.c (do_nonmember_using_decl): If a using declaration + refers to a single overloaded function, set the type of the + function. + * tree.c (lvalue_type): Simplify. + * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an + unknown type. + (build_unary_op): Handle OVERLOADs with known types. + + * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for + function templates. + + * parser.c (cp_parser_postfix_expression): Handle the use of + "typename" in non-dependent contexts. Convert appropriately when + when using a qualified name after "->" or ".". + + * call.c (conditional_conversion): Honor the requirement that some + conversions refer to the original object. + +2004-03-18 Mark Mitchell + + * call.c (build_conditional_expr): Do not call force_rvalue for + operands of void_type when the conditional expression itself has + void type. + * name-lookup.c (pushdecl): Don't consider a declaration of a + function named "main" to be an overload of a type named "main". + * parser.c (cp_parser_template_name): Perform name lookup when the + template name is proceeded by "template" if the qualifying scope + is non-dependent. + * typeck.c (composite_pointer_type_r): Correctly handle + pointer-to-member types. + (build_const_cast): Likewise. + +2004-03-18 Richard Kenner + + * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments. + * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check. + (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise. + (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise. + (TYPENAME_TYPE_FULLNAME): Add check and use type.values. + (TYPEOF_TYPE_EXPR): New macro. + * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS. + * error.c (dump_type): Use TYPEOF_TYPE_EXPR. + * pt.c (tsubst): Likewise. + * semantics.c (finish_typeof): Likewise. + * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE, + and TEMPLATE_TYPE_PARM. + * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN. + (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES. + +2004-03-16 Mark Mitchell + + PR c++/14586 + * cp-tree.h (build_new_op): Change prototype. + (build_x_binary_op): Likewise. + * call.c (build_new_op): Add overloaded_p parameter. + * decl2.c (grok_array_decl): Adjust call to build_new_op. + * parser.c (cp_parser_binary_expression): Note that uses of + overloaded operators prevents an expression from being considered + an integral constant. + * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or + build_x_binary_op. + * semantics.c (finish_call_expr): Likewise. + * typeck.c (rationalize_conditional_expr): Likewise. + (build_x_indirect_ref): Likewise. + (build_x_binary_op): Likewise. + (build_x_unary_op): Likewise. + (build_x_compound_expr): Likewise. + (build_modify_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2004-03-15 Kazu Hirata + + * cp-lang.c, ptree.c: Update copyright. + +2004-03-13 Mark Mitchell + + PR c++/14550 + * parser.c (cp_parser_non_integral_constant_expression): Encode + more of the idiom that surrounded calls to this function within + the function itself + (cp_parser_primary_expression): Adjust accordingly. + (cp_parser_postfix_expression): Likewise. + (cp_parser_unary_expression): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_assignment_expression): Likewise. + (cp_parser_expression): Likewise. + (cp_parser_new_expression): Note that new-expressions are not + allowed in integral constant expressions. + (cp_parser_delete_expression): Likewise. + +2004-03-12 Matt Austern + + * decl2.c (maybe_make_one_only): Look at + TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether + to make an explicit instantiation weak. + * method.c (use_thunk): Make sure we call comdat_linkage + when appropriate. + * pt.c (do_type_instantiation): On systems where weak symbols + don't go in a static archive's TOC, explicit instantiation of a + class must imply *explicit* instantiation of its memeber. + +2004-03-11 Kazu Hirata + + * call.c, cp-tree.h, pt.c: Fix comment typos. + +2004-03-10 Mark Mitchell + + PR c++/14510 + * decl.c (xref_tag): Disregard non-type declarations when + looking up a tagged type. + +2004-03-09 Nathan Sidwell + + PR c++/14397 + * call.c (convert_like_real): Build a const qualified temporary, + when testing ctor access. + +2004-03-09 Mark Mitchell + + * call.c (initialize_reference): Fix typo. + +2004-03-09 Giovanni Bajo + + PR c++/14409 + * pt.c (determine_specialization): For member templates, match also + constness. + + PR c++/14448 + * parser.c (cp_parser_initializer_clause): Fold initializer if it is + non-dependent. + * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs. + +2004-03-09 Mark Mitchell + + PR c++/14230 + * call.c (initialize_reference): Handle initializers that are + class-member access expressions applies to rvalues. + +2004-03-09 Mark Mitchell + + PR c++/14432 + * name-lookup.c (supplement_binding): Ignore functions that are + marked DECL_ANTICIPATED. + +2004-03-08 Mark Mitchell + + PR c++/14401 + * class.c (check_field_decls): Complain about non-static data + members of reference type in unions. Propagate + CLASSTYPE_REF_FIELDS_NEED_INIT and + CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static + data members. + * init.c (perform_member_init): Complain about mbmers with const + type that are not explicitly initialized. + +2004-03-08 Mark Mitchell + + * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS. + * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro. + (lang_identifier): Remove implicit_decl and error_locus. + (IDENTIFIER_IMPLICIT_DECL): Remove. + (SET_IDENTIFIER_IMPLICTI_DECL): Likewise. + (IDENTIFIER_ERROR_LOCUS): Likewise. + (SET_IDENTIFIER_ERROR_LOCUS): Likewise. + (TYPE_ASSEMBLER_NAME_STRING): Likewise. + (TYPE_ASSEMBLER_NAME_LENGTH): Likewise. + (implicitly_declare): Remove. + * decl.c (warn_extern_redeclared_static): Remove check of + IDENTIFIER_IMPLICIT_DECL. + (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS. + (implicitly_declare): Remove. + (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS. + (start_function): Don't check IDENTIFIER_IMPLICIT_DECL. + (start_method): Don't check IDENTIFIER_ERROR_LOCUS. + * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL + in the innermost scope, rather than at namespace scope. + * name-lookup.c (push_local_binding): Give it external linkage. + (pushdecl): Remove dead code. + * name-lookup.h (push_local_binding): Declare it. + * ptree.c (cxx_print_identifier): Don't print + IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS. + * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P, + not IDENTIFIER_ERROR_LOCUS. + * typeck.c (build_function_call): Remove dead code. + +2004-03-08 Jason Merrill + + PR c++/13170 + * decl.c (xref_tag): Remove attribute handling. + * cp-tree.h: Adjust prototype. + * decl.c, parser.c, rtti.c: Adjust callers. + * parser.c (cp_parser_class_head): Pass back attributes in the + class head. + (cp_parser_class_specifier): Adjust. + +2004-03-08 Matt Austern + + PR debug/14079 + * name-lookup.c (add_decl_to_level): Add extern variables, as well + as static, to static_decls array. + +2004-03-05 Jason Merrill + + * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/. + +2004-03-04 Geoffrey Keating + + * decl.c (grokfndecl): Update old incorrect comment. + (grokvardecl): Diagnose C++ variables of type with no linkage. + +2004-03-01 Mark Mitchell + + PR c++/14369 + * pt.c (build_non_dependent_expr): Do not create a + NON_DEPENDENT_EXPR for a THROW_EXPR. + +2004-03-01 Gabriel Dos Reis + + PR c++/14369 + * error.c (dump_expr): Handle THROW_EXPR. + +2004-03-01 Mark Mitchell + + PR c++/14360 + * parser.c (cp_parser_postfix_expression): Do not perform Koenig + lookup if ordinary name-lookup finds a non-function. + * pt.c (tsubst_copy_and_build): Likewise. + + PR c++/14361 + * parser.c (cp_parser_late_parsing_default_args): Check that there + are no extra tokens after the end of the default-argument + expression. + +2004-03-01 Mark Mitchell + + PR c++/14324 + * lex.c (retrofit_lang_decl): Treat entities with no linkage as + having C++ linkage for name-mangling purposes. + + PR c++/14260 + * parser.c (cp_parser_direct_declarator): Recognize constructor + declarators that use a template-id to name the class being + constructed. + + PR c++/14337 + * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes. + (tsubst_expr): Do not call tsubst_copy, even when + processing_template_decl. + +2004-03-01 Jeff Law + + * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to + the proper type. + +2004-02-29 Mark Mitchell + + PR c++/14138 + * name-lookup.h (push_scope): Change prototype. + * name-lookup.c (push_scope): Do not reenter the current class + scope. + * decl.c (grokfndecl): Check return code from push_scope before + calling pop_scope. + * decl2.c (check_classfn): Likewise. + * parser.c (cp_parser_conversion_function_id): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_class_specifier): Likewise. + (cp_parser_class_head): Likewise. + (cp_parser_lookup_name): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + * pt.c (instantiate_class_template): Likewise. + (resolve_typename_type): Likewise. + +2004-02-29 Mark Mitchell + + PR c++/14267 + * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue + extension. + + PR debug/12103 + * class.c (update_vtable_entry_for_fn): Do not go through + covariance machinery if the type returned by an overrider is the + same as the original. + +2004-02-29 Kazu Hirata + + * call.c: Fix a comment typo. + +2004-02-27 Ziemowit Laski + + * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs. + +2004-02-26 Mark Mitchell + + PR c++/14278 + * parser.c (cp_parser_parameter_declaration_list): Commit + to fewer tentative parses. + +2004-02-26 Giovanni Bajo + + PR c++/14284 + * pt.c (dependent_type_p_r): A template template parameter is a + dependent type. + +2004-02-26 Giovanni Bajo + + PR c++/14246 + * mangle.c (write_template_arg_literal): Don't rely on identity for + boolean constants. + +2004-02-24 Jason Merrill + + * tree.c (build_exception_variant): Use check_qualified_type. + +2004-02-23 Zack Weinberg + Kazu Hirata + + * decl.c (cxx_init_decl_processing): Don't check + flag_writable_strings. + +2004-02-23 Andrew Pinski + + PR c++/14156 + * typeck.c (maybe_warn_about_returning_address_of_location): + Change check for VAR_DECL to use DECL_P instead. + +2004-02-23 Giovanni Bajo + + PR c++/14250 + * cvt.c (build_expr_type_conversion): Type must be complete before + looking up for conversions. + +2004-02-23 Giovanni Bajo + + PR c++/14143 + * name-lookup.c (arg_assoc_class): Don't look into template + arguments if it is not a primary template. + +2004-02-20 John David Anglin + + PR c++/12007 + * method.c (use_thunk): Always clone function argument tree. + +2004-02-20 Mark Mitchell + + PR c++/14199 + * pt.c (tsubst_copy): Call mark_used for a PARM_DECL. + + PR c++/14173 + * semantics.c (begin_class_definition): Set TYPE_PACKED correctly + for all type variants. + +2004-02-19 Mark Mitchell + + PR c++/13927 + * decl.c (duplicate_decls): Return error_mark_node for invalid + redeclarations. + * name-lookup.c (push_namespace): Ignore the return value from + pushdecl. + * pt.c (push_template_decl_real): Robustify. + + PR c++/14186 + * name-lookup.c (push_class_level_binding): Do not complain about + adding a binding for a member whose name is the same as the + enclosing class if the member is located in a base class of the + current class. + +2004-02-19 Giovanni Bajo + + PR c++/14181 + * parser.c (cp_parser_new_expression): Parse an ill-formed + direct-new-declarator after a parenthesized type-id to emit good + diagnostic. + +2004-02-18 Kazu Hirata + + * cp-tree.def, cvt.c: Update copyright. + +2004-02-17 Mark Mitchell + + PR c++/11326 + * cp-tree.h (abi_version_at_least): Remove. + * mangle.c: Include flags.h. + +2004-02-15 Mark Mitchell + + PR c++/13971 + * call.c (build_conditional_expr): Handle conversions between + class types which result in differently cv-qualified type + variants. + + PR c++/14086 + * class.c (delete_duplicate_fields_1): Remove. + (delete_duplicate_fields): Likewise. + (finish_struct_anon): Remove check for members with the same name + as their enclosing class. + (check_field_decls): Do not call duplicate_fields. + * decl.c (grokdeclarator): Remove check for static data members + with the same name as their enclosing class. + * name-lookup.c (push_class_level_binding): Check for members with + the same name as their enclosing class. + +2004-02-15 Gabriel Dos Reis + + PR c++/14085 + * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM. + +2004-02-14 Kriang Lerdsuwanakij + + PR c++/13635 + * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL + has full set of arguments. + +2004-02-13 Giovanni Bajo + + PR c++/13927 + * error.c (dump_decl) : Dump as simple declarations. + +2004-02-13 Mark Mitchell + + PR c++/14122 + * cp-tree.h (delete_sanity): Change prototype. + * decl2.c (delete_sanity): Make doing_vec a bool, not an int. + Remove dead code. Adjust code to warn about deleting an array. + * typekc.c (decay_conversion): Use build_address and build_nop. + + PR c++/14108 + * search.c (accessible_p): Do not check access in thunks. + + PR c++/14083 + * call.c (build_conditional_expr): Call force_rvalue on the + non-void operand in the case that one result is a throw-expression + and the other is not. + +2004-02-13 Ian Lance Taylor + + PR c++/9851 + * parser.c (cp_parser_pseudo_destructor_name): Check for errors on + the type name and look ahead for ::~, and bail out early with a + better error message if the parse is going to fail. + +2004-02-12 Mark Mitchell + + * call.c (conversion_kind): New type. + (conversion_rank): Likewise. + (conversion): Likewise. + (CONVERSION_RANK): New macro. + (conversion_obstack): New variable. + (obstack_initialized): Likewise. + (z_candidate): Change type of convs and second_conv. + (candidate_warning): New type. + (IDENTITY_RANK): Remove. + (EXACT_RANK): Likewise. + (PROMO_RANK): Likewise. + (STD_RANK): Likewise. + (PBOOL_RANK): Likewise. + (USER_RANK): Likewise. + (ELLIPSIS_RANK): Likewise. + (BAD_RANK): Likewise. + (ICS_RANK): Likewise. + (ICS_STD_RANK): Likewise. + (ICS_USER_FLAG): Likewise. + (ICS_ELLIPSIS_FLAG): Likewise. + (ICS_THIS_FLAG): Likewise. + (ICS_BAD_FLAG): Likewise. + (NEED_TEMPORARY_P): Likewise. + (CHECK_COPY_CONSTRUCTOR_P): Likewise. + (USER_CONV_CAND): Likewise. + (USER_CONV_FN): Likewise. + (conversion_obstack_alloc): New function. + (alloc_conversion): Likewise. + (validate_conversion_obstack): Likewise. + (alloc_conversions): Likewise. + (build_conv): Adjust to deal with new conversion data structures. + (build_identity_conv): New function. + (build_ambiguous_conv): Likewise. + (standard_conversion): Adjust to deal with new conversion data + structures. + (convert_class_to_reference): Likewise. + (direct_reference_binding): Likewise. + (reference_binding): Likewise. + (implicit_conversion): Likewise. + (add_candidate): Likewise. + (add_function_candidate): Likewise. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (print_z_candidate): Likewise. + (merge_conversion_sequences): Likewise. + (build_user_type_conversion_1): Likewise. + (build_user_type_conversion): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (conditional_conversion): Likewise. + (build_conditional_expr): Likewise. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (convert_like_real): Likewise. + (build_over_call): Likewise. + (build_new_method_call): Likewise. + (is_subseq): Likewise. + (maybe_handle_implicit_object): Likewise. + (maybe_handle_ref_bind): Likewise. + (compare_ics): Likewise. + (source_type): Likewise. + (add_warning): Likewise. + (joust): Likewise. + (can_convert_arg): Likewise. + (can_convert_arg_bad): Likewise. + (perform_implicit_conversion): Likewise. + (perform_direct_initialization_if_possible): Likewise. + (initialize_reference): Likewise. + * cp-lang.c (cp_tree_size): Do not handle WRAPPER. + * cp-tree.def (WRAPPER): Likewise. + (IDENTITY_CONV): Remove. + (LVALUE_CONV): Likewise. + (QUAL_CONV): Likewise. + (STD_CONV): Likewise. + (PTR_CONV): Likewise. + (PMEM_CONV): Likewise. + (BASE_CONV): Likewise. + (REF_BIND): Likewise. + (USER_CONV): Likewise. + (AMBIG_CONV): Likewise. + (RVALUE_CONV): Likewise. + * cp-tree.h (tree_wrapper): Remove. + (WRAPPER_ZC): Remove. + (lang_tree_node): Remove wrapper. + (LOOKUP_SPECULATIVELY): Remove. + (build_op_delete_call): Adjust prototype. + (validate_conversion_obstack): Declare. + (build_zc_wrapper): Remove. + * cvt.c (convert_to_reference): Remove dead code. + (ocp_convert): Likewise. + * decl.c (redeclaration_error_message): Correct handling of + templates. + (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY. + (cp_tree_node_structure): Remove WRAPPER case. + * decl2.c (finish_file): Call validate_conversion_obstack. + * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY. + (build_op_delete_call): Likewise. + (build_x_delete): Likewise. + (build_delete): Adjust call to build_op_delete_call. + * pt.c (tsubst_friend_declaration): Adjust code to determine + whether or not a friend template is a definition. + (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs. + * tree.c (build_zc_wrapper): Remove. + +2004-02-12 Zack Weinberg + + * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS. + * cp-tree.h: Don't declare cxx_builtin_type_decls. + * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete. + (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL. + +2004-02-10 Mark Mitchell + + * typeck.c (lookup_destructor): Fix typo in error message. + +2004-02-09 Kazu Hirata + + * call.c, parser.c, tree.c: Fix comment typos. + +2004-02-07 Zack Weinberg + + Bug 13856 + * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS. + * decl.c (duplicate_decls, start_function): Likewise. + +2004-02-07 Zack Weinberg + + * name-lookup.c (pushdecl): Issue shadow warnings directly. + * parser.c (free_parser_stacks): Delete. + +2004-02-07 Kazu Hirata + + * rtti.c: Update copyright. + +2004-02-06 Giovanni Bajo + + PR c++/14033 + * decl.c (require_complete_types_for_parms): Do not insert + error_mark_node in the parameter list. + +2004-02-06 Giovanni Bajo + + PR c++/14028 + * parser.c (cp_parser_enclosed_template_argument_list): Emit straight + error when terminator can not be found. + +2004-02-05 Kelley Cook + + Make-lang.in (po-generated): Delete. + +2004-02-05 Kazu Hirata + + * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with + targetm.calls.promote_prototypes. + +2004-02-05 Rainer Orth + + PR middle-end/13750 + Revert: + 2004-01-15 Geoffrey Keating + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-02-05 Mark Mitchell + + PR c++/13714 + * typeck.c (lookup_destructor): Tweak error message. + +2004-02-05 Jan Hubicka + + * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat + functions. + +2004-02-05 Giovanni Bajo + + PR c++/14008 + * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing + code, only emits the diagnostic now. Added lookup of the identifier + and support for qualified ids. + (cp_parser_parse_and_diagnose_invalid_type_name): New function. + Parse an (invalid) type name as id-expression within a declarator. + (cp_parser_simple_declaration): Use it. + (cp_parser_member_declaration): Likewise. + (cp_parser_make_typename_type): New function. Handle errors through + cp_parser_diagnose_invalid_typename. + (cp_parser_elaborated_type_specifier): Use it. + +2004-02-04 Mark Mitchell + + PR c++/13932 + * call.c (convert_like_real): Use "converting" rather than + "argument" as the descriptive keyword to + dubious_conversion_warnings. + * typeck.c (convert_for_assignment): Do not call + dubious_conversion_warnings. + +2004-02-04 Giovanni Bajo + + PR c++/13086 + * init.c (build_delete): Emit a more informative error message in + case of an incomplete type, and on the correct source line. + +2004-02-04 Kazu Hirata + + * error.c, search.c: Update copyright. + +2004-02-04 Mark Mitchell + + PR c++/9941 + * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the + linkage for the typeinfo name string. + +2004-02-04 Mark Mitchell + + PR c++/13969 + * cp-tree.h (fold_non_dependent_expr): New function. + * parser.c (cp_parser_fold_non_dependent_expr): Remove. + (cp_parser_template_argument): Use fold_non_dependent_expr. + (cp_parser_direct_declarator): Likewise. + * pt.c (fold_non_dependent_expr): New function. + (convert_nontype_argument): Use it. + (tsubst_qualified_id): Simplify. + (tsubst_copy_and_build): Likewise. + +2004-02-04 Mark Mitchell + + * decl.c (cxx_push_function_context): Do not set + current_function_is_thunk. + * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the + actual function. + +2004-02-04 Giovanni Bajo + + PR c++/13997 + * pt.c (more_specialized_class): Increase processing_template_decl + while partial ordering. + +2004-02-03 Mark Mitchell + + PR c++/13925 + * decl.c (start_function): Do not call pushdecl for any + instantiation or specialization of a primary template. + +2004-02-03 Mark Mitchell + + PR c++/13950 + * parser.c (cp_parser_class_name): Robustify. + + PR c++/13970 + * parser.c (cp_parser_cache_group): Do not consume the EOF token. + + PR c++/14002 + * semantics.c (finish_id_expression): Do not return an + IDENTIFIER_NODE when lookup finds a PARM_DECL. + +2004-02-03 Mark Mitchell + + PR c++/13978 + * pt.c (build_non_dependent_expr): Do not build + NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs. + + PR c++/13968 + * semantics.c (finish_id_expression): Do not return an + IDENTIFIER_NODE when lookup finds a VAR_DECL. + + PR c++/13975 + * parser.c (cp_parser_simple_declaration): When skipping to the + end of the statement swallow the terminating semicolon. + +2004-02-02 Mark Mitchell + + PR c++/13113 + * init.c (build_offset_ref): Improve error recovery for invalid + uses of non-static member functions. + + PR c++/13854 + * cp-tree.h (cp_build_type_attribute_variant): New function. + * class.c (build_clone): Use cp_build_type_attribute_variant. + * decl.c (duplicate_decls): Likewise. + * pt.c (copy_default_args_to_explicit_spec): Likewise. + (tsubst_function_type): Likewise. + * tree.c (build_exception_variant): Check attributes before + concluding that two types are the same. + (cp_build_type-attribute_variant): New method. + * typeck.c (merge_types): Use cp_build_type_attribute_variant. + + PR c++/13907 + * call.c (convert_class_to_reference): Keep better track of + pedantically invalid user-defined conversions. + +2004-02-01 Giovanni Bajo + + PR c++/13957 + * pt.c (tsubst_qualified_id): Improved error message when a type + is expected but not found. + +2004-01-31 Kazu Hirata + + * class.c: Fix comment typos. + * decl.c: Likewise. + * error.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + +2004-01-30 Richard Henderson + + PR c++/13693 + * method.c (use_thunk): Don't force_target_expr for void thunks. + * tree.c (build_target_expr_with_type): Assert non-void type. + (force_target_expr): Likewise. + +2004-01-30 Michael Matz + + * parser.c (cp_parser_labeled_statement): Accept case ranges. + +2004-01-30 Giovanni Bajo + + DR206 + PR c++/13813 + * decl.c (grokdeclarator): Check immediatly type completeness for + non-dependent types. + +2004-01-30 Giovanni Bajo + + PR c++/13683 + * call.c (convert_arg_to_ellipsis): Don't emit a warning if within + a sizeof expression.block + +2004-01-29 Mark Mitchell + + PR c++/13883 + * mangle.c (write_encoding): Correct encoding of member template + constructors. + +2004-01-28 Giovanni Bajo + + * parser.c (cp_parser_template_id): Parse tentatively `[:' after a + template name as it was `<::' (digraph typo). + (cp_parser_nth_token_starts_template_argument_list_p): New function. + (cp_parser_id_expression): Use it. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_lexer_get_preprocessor_token): Use c_lex_with_flags. + +2004-01-28 Mark Mitchell + + PR c++/13791 + * typeck.c (merge_types): Do not merge attributes into + TYPENAME_TYPEs. + + PR c++/13736 + * parser.c (cp_parser_direct_declarator): Do not prevent + backtracking inside a parenthesized declarator. + (cp_parser_parameter_declaration): Fix typo in comment. + +2004-01-28 Jan Hubicka + + * semantics.c (expand_body) Do emit_associated_thunks before + expansion. + +2004-01-27 Devang Patel + + * name-lookup.c: Include "debug.h" + (do_namespace_alias): Invoke debug_hooks to emit debug info + for namespace alias. + (do_local_using_decl): Invoke debug_hooks to emit debug info + for using decl. + (do_class_using_decl): Same. + (do_toplevel_using_decl): Same. + (do_using_directive): Same. + (cp_emit_debug_info_for_using): New function. + * Make-lang.in (cp/parser.o): Depend on debug.h + (cp/name-lookup.o): Same. + +2004-01-26 Kaveh R. Ghazi + + * cp-tree.h (language_function, lang_type_header): Use + BOOL_BITFIELD. + * name-lookup.h (cp_binding_level): Likewise. + +2004-01-26 Mark Mitchell + + PR c++/13663 + * semantics.c (finish_for_expr): Check for unresolved overloaded + functions. + + * class.c (add_method): Just check processing_template_decl to + determine whether or not we are within a template. + * decl2.c (maybe_retrofit_in_chrg): Likewise. + * init.c (decl_constant_value): Check the type of the declaration, + not TREE_READONLY. + * name-lookup.c (maybe_push_to_top_level): Rename to ... + (push_to_top_level): ... this. + * name-lookup.h (maybe_push_to_top_level): Do not declare it. + * pt.c (push_template_decl_real): Reorder condition for speed. + (convert_template_argument): Use dependency-checking functions in + place of uses_template_parms. + (lookup_template_class): Avoid calling uses_template_parms more + than once. + (uses_template_parms): Reimplement, using dependency-checking + functions. + (instantiate_class_template): Use push_to_top_level, not + maybe_push_to_top_level. + (type_unification_real): Simplify. + (type_dependent_expression_p): Handle OFFSET_REFs and + TEMPLATE_DECLs. + (any_dependent_template_arguments_p): Handle multiple levels of + template argument. + * semantics.c (expand_or_defer_fn): Do not check + uses_template_parms for template instantiations. + * typeck.c (comptypes): Avoid calling cp_type_quals. + +2004-01-25 Mark Mitchell + + PR c++/13833 + * call.c (build_over_call): Do not convert arguments when + processing a template. + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for arithmetic constants. + +2004-01-25 Giovanni Bajo + + PR c++/13810 + * parser.c (cp_parser_type_parameter): When cp_parser_id_expression + returns a TYPE_DECL. no further lookup is required. + * semantics.c (check_template_template_default_arg): A TYPE_DECL + is invalid. Rework to give better diagnostics. + +2004-01-25 Kriang Lerdsuwanakij + + PR c++/13797 + * pt.c (instantiate_class_template): Add an error_mark_node + check. + (tsubst_decl) : Likewise. + +2004-01-23 Andrew Pinski + + PR c++/13701 + * decl.c (finish_function): Move the call to + finish_fname_decls below the call to + finish_eh_spec_block. + +2004-01-21 Kazu Hirata + + * optimize.c, typeck2.c: Update copyright. + +2004-01-21 Kazu Hirata + + * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c, + init.c, mangle.c, typeck.c: Update copyright. + +2004-01-21 Zdenek Dvorak + + * parser.c (cp_parser_class_specifier): Prevent garbage collection. + +2004-01-20 Kelley Cook + + * Make-lang.in: Replace $(docdir) with doc. + (c++.info, c++.srcinfo): Dummy entry. + (c++.man, c++.srcman): New rules. + (c++.install-man): Revamp rule. + +2004-01-20 Kelley Cook + + * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME, + CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a + immediate $(shell) instead of deferred backquote. + +2004-01-19 Mark Mitchell + + PR c++/13651 + * parser.c (cp_parser_postfix_expression): When encountering + incomplete type on left-hand side of "->" or ".", treat the entire + expression as erroneous. + + PR c++/13592 + * call.c (build_field_call): Remove. + (n_build_method_call): Likewise. + (build_method_call): Likewise. + (build_new_method_call): Do not call build_field_call. + * class.c (n_build_method_call): Remove. + (print_class_statistics): Do not print it. + * cp-tree.h (build_method_call): Remove declaration. + (finish_object_call_expr): Likewise. + (build_new_1): Do not use build_method_call. + * parser.c (cp_parser_postfix_expression): Use finish_call_expr + when the function appearing on the right-hand-side of "." or "->" + is not actually a function. + * pt.c (tsubst_copy_and_build): Likewise. + * semantics.c (finish_object_call_expr): Remove. + +2004-01-18 Mark Mitchell + + PR c++/13710 + * pt.c (tsubst): Use finish_typeof. + +2004-01-18 Jason Merrill + + PR c++/11725 + * except.c (build_throw): In a template, set + current_function_returns_abnormally. + +2004-01-17 Fred Fish + + PR c++/11895 + * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, + except don't call array_type_nelts() with a VECTOR_TYPE. + +2004-01-16 Jan Hubicka + + * mangle.c (write_mangled_name): Remove inline modifier. + +2004-01-16 Mark Mitchell + + PR c++/13574 + * decl.c (compute_array_index_type): Fix grammar in comment. + * init.c (build_zero_init): Handle zero-sized arrays correctly. + + PR c++/13178 + * call.c (name_as_c_string): Print conversion operator names + correctly. + + PR c++/13478 + * call.c (initialize_reference): Pass -1 for inner parameter to + convert_like_real. + +2004-01-15 Giovanni Bajo + + PR c++/13407 + * parser.c (cp_parser_base_specifier): Check for an invalid + keyword `typename' and emit an user-friendly error message. + +2004-01-15 Geoffrey Keating + + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-01-15 Giovanni Bajo + + PR c++/9259 + * typeck.c (build_class_member_access_expr): Allow to access members + of the currently open class. + (finish_class_member_access_expr): Likewise. + +2004-01-15 Alexandre Oliva + + PR c++/13659 + * name-lookup.c (validate_nonmember_using_decl): Take scope and + name by value, instead of computing them. + (do_local_using_decl, do_toplevel_using_decl): Add scope and name + arguments. Pass them to validate_nonmember_using_decl. + * name-lookup.h (do_local_using_decl): Adjust. + (do_toplevel_using_decl): Likewise. + * parser.c (cp_parser_using_declaration): Likewise. + * pt.c (tsubst_expr): Likewise. + +2004-01-15 Alexandre Oliva + + PR c++/13594 + PR c++/13658 + * name-lookup.c (qualified_lookup_using_namespace): Search + strongly-associated namespaces first, and only then try other + namespaces. + +2004-01-15 Kelley Cook + + * Make-lang.in (c++.srcextra): Dummy entry. + +2004-01-15 Giovanni Bajo + + PR c++/8856 + * parser.c (cp_parser_template_name): Don't try to parse a + conversion-function-id, as it cannot be a template-name. + (cp_parser_simple_type_specifier): Check for invalid template-ids + even after a built-in type. + +2004-01-14 Jan Hubicka + + PR c++/12850 + * pt.c (instantiate_decl): Do not increase function_depth. + +2004-01-14 Danny Smith + + PR c++/9021 + PR c++/11005 + * parser.c (cp_parser_elaborated_type_specifier): Warn about + attributes and discard. + * decl.c (xref_tag): Don't overwite existing attributes with + NULL_TREE. + +2004-01-14 Giovanni Bajo + + PR c++/12335 + * parser.c (cp_parser_lookup_name): Return error_mark_node if there + is no destructor while looking up a BIT_NOT_EXPR. + +2004-01-13 Ian Lance Taylor + + * cxxfilt.c: Remove unused file. + +2004-01-14 Jan Hubicka + + Partial fix to PR c++/12850 + * decl2.c (mark_used): Do not proactively instantiate templates + when compiling in unit-at-a-time or not optimizing. + * optimize.c (maybe_clone_body): Do not increase function depth. + +2004-01-13 Giovanni Bajo + + PR c++/13474 + * pt.c (tsubst) : Remove obsolete array index tweaking. + +2004-01-12 Steven Bosscher + + PR c++/13558 + * parser.c (cp_parser_member_declaration): Any non-type is also + not a class or a function. + +2004-01-12 Jason Merrill + + PR c++/12815 + * class.c (build_base_path): Do not mark vtable references as + TREE_CONSTANT. + (build_vtbl_ref_1): Likewise. + +2004-01-12 Richard Henderson + + PR opt/10776 + * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New. + (store_init_value): Use it. + * decl.c (check_initializer): Expect full initialization code + from store_init_value. + * init.c (expand_aggr_init_1): Likewise. + * decl2.c (maybe_emit_vtables): Abort if runtime init needed. + +2004-01-12 Mark Mitchell + + * class.c (layout_class_type): For non-POD class types, also copy + the DECL_SIZE and DECL_MODE of fields to the base class type. + +2004-01-12 Kriang Lerdsuwanakij + + PR c++/13289 + * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before + calling regenerate_decl_from_template. + +2004-01-12 Scott Brumbaugh + + PR c++/4100 + * parser.c (cp_parser_decl_specifier_seq): Add check for a friend + decl-specifier occurring along with a class definition. + +2004-01-12 Ian Lance Taylor + + * parser.c (cp_parser_decl_specifier_seq): Add parenthetical + clauses to comments describing declares_class_or_enum. + (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not + false. + +2004-01-12 Jan Hubicka + + * pt.c (for_each_template_parm): Do not check for duplicates. + (for_each_template_parm): Use walk_tree duplicate checking code. + +2004-01-11 Ian Lance Taylor + + PR c++/3478 + * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec + is error_mark_node, don't add any more decl_specs. + (cp_parser_init_declarator): After committing to a declaration, if + the decl_specifiers start with error_mark_node, issue an error and + change the type to "int". + +2004-01-09 Nathanael Nerode + + PR bootstrap/7817 + * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so. + +2004-01-10 Giovanni Bajo + + DR 337 + PR c++/9256 + * pt.c (tsubst): Substitution must fail if we are attempting to + create an array with element type that is an abstract class type. + * decl.c (cp_finish_decl): Strip pointers and array types recursively + before calling abstract_virtuals_error. + +2004-01-09 Alexandre Oliva + + * name-lookup.c (qualified_lookup_using_namespace): Consider + strong using directives even if we've already found a binding. + +2004-01-09 Mark Mitchell + + * cp-tree.h (cxx_expand_expr): Change prototype. + * expr.c (cxx_expand_expr): Add alt_rtl parameter. + +2004-01-08 Giovanni Bajo + + PR c++/12573 + * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by + looking into them recursively. They can be there because of the + new __offsetof__ extension. + +2004-01-07 Zack Weinberg + + * parser.c (cp_parser_save_member_function_body): Mark the + definition static. + +2004-01-05 Mark Mitchell + + PR c++/13057 + * class.c (build_clone): Copy type attributes from the original + function to the clone. + + PR c++/12815 + * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable + references as constant. + + PR c++/12132 + * parser.c (cp_parser_explicit_instantiation): Improve error + recovery. + (cp_parser_require): Improve indication of the error location. + + PR c++/13451 + * parser.c (cp_parser_class_head): Reorder logic to check for + invalid qualification. + +2004-01-04 Mark Mitchell + + PR c++/13157 + * name-lookup.c (lookup_using_namespace): Remove spacesp + parameter. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Adjust accordingly. + (lookup_name_real): Likewise. + (lookup_arg_dependent): Do not eliminate the namespace of the + functions found by unqualified name lookup unless that is the + current namespace. + +2004-01-04 Andrew Pinski + + * semantics.c (push_deferring_access_checks): Fix format. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + +2004-01-04 Richard Henderson + + * call.c (build_over_call): Don't create a save_expr of an + aggregate, but rather its address. + +2004-01-04 Mark Mitchell + + PR c++/13529 + * parser.c (cp_parser_postfix_expression): Allow "." to appear in + an offsetof expression. + + * parser.c (cp_parser_parameter_declaration): Fix comment. + + PR c++/12226 + * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro. + (reference_binding): Set it when appropriate. + (build_temp): New function, split out from ... + (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P. + (initialize_reference): Likewise. + + PR c++/13536 + * parser.c (cp_parser): Add in_type_id_in_expr_p. + (cp_parser_new): Initialize it. + (cp_parser_postfix_expression): Set it. + (cp_parser_sizeof_operand): Likewise. + (cp_parser_parameteR_declaration): Do not commit early to tenative + parsers when in_type_id_in_expr_p is set. + +2004-01-03 Kriang Lerdsuwanakij + + PR c++/13094 + * parser.c (cp_parser_template_argument): Don't call + make_unbound_class_template directly. + (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from + UNBOUND_CLASS_TEMPLATE tree node. + +2004-01-02 Richard Sandiford + + PR target/12729 + * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr. + +2004-01-02 Kriang Lerdsuwanakij + + PR c++/13520 + * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro. + (DECL_FUNCTION_TEMPLATE_P): Use it. + (DECL_CLASS_TEMPLATE_P): Likewise. + * parser.c (cp_parser_lookup_name): Add is_template parameter. + (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name. + (cp_parser_template_name): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name_simple): Likewise. diff --git a/contrib/gcc/cp/ChangeLog.tree-ssa b/contrib/gcc/cp/ChangeLog.tree-ssa new file mode 100644 index 00000000000..e02c76515e4 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog.tree-ssa @@ -0,0 +1,566 @@ +2004-04-19 Richard Henderson + + * except.c (check_handlers_1): Use locus stored in master for warning. + * tree.c (cp_walk_subtrees): Save and restore input_location. + +2004-04-12 Diego Novillo + + * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): Remove. + (LANG_HOOKS_RTL_EXPAND_STMT): Remove. + * semantics.c (cxx_expand_function_start): Remove. + +2004-04-12 Richard Henderson + + * except.c (check_handlers_1): Use EXPR_LOCUS instead of STMT_LINENO. + * semantics.c (finalize_nrv_r): Likewise. + * tree.c (cp_walk_subtrees): Likewise. + * parser.c (cp_parser_statement): Save and restore entire locus; + set EXPR_LOCUS. + * pt.c (tsubst_expr): Don't special-case LABEL_STMT. + +2004-04-01 Diego Novillo + + * name-lookup.c (innermost_nonclass_level): Check for + error_mark_node. + +2004-03-25 Diego Novillo + + * parser.c (cp_parser_class_specifier): Initialize + variable 'attributes'. + +2004-03-17 Richard Henderson + + * cp-lang.c (cxx_types_compatible_p): Use + same_type_ignoring_top_level_qualifiers_p. + +2004-03-16 Dale Johannesen + + * cp-lang.c (cxx_types_compatible_p): New. + LANG_HOOKS_TYPES_COMPATIBLE_P: New. + +2004-03-10 Jason Merrill + + PR c++/14452 + * tree.c (stabilize_init): Return whether or not it worked. + * init.c (build_new_1): If not, use a sentry. + * cp-tree.h: Adjust prototype. + +2004-03-01 Jeff Law + + * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to + the proper type. + +2004-02-24 Jason Merrill + + PR c++/13944 + * except.c (do_free_exception): Remove #if 0 wrapper. + (build_throw): Use it if we elide a copy into the exception object. + + * tree.c (stabilize_call): Fix thinko. + +2004-02-19 Steven Bosscher + + * decl.c (poplevel): Don't output nested inline functions. + +2004-02-16 Richard Henderson + + * call.c (build_call, build_over_call, build_new_method_call): Add + static chain operand to call_expr. + * decl.c (build_offset_ref_call_from_tree): Likewise. + * parser.c (cp_parser_postfix_expression): Likewise. + * semantics.c (finish_call_expr): Likewise. + * cp-lang.c (cp_expand_decl): Don't declare_nonlocal_label. + +2004-02-09 Richard Henderson + + * cp-lang.c (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New. + * cp-tree.h (cp_missing_noreturn_ok_p): Declare. + * decl.c (cp_missing_noreturn_ok_p): Export. + (cxx_init_decl_processing): Don't set lang_missing_noreturn_ok_p. + +2004-02-06 Andrew Pinski + + PR c/13863 + * cp-lang.c (LANG_HOOKS_DECL_UNINIT): Remove. + +2004-02-03 Richard Henderson + + PR middle-end/13325 + * call.c, cvt.c, init.c, typeck.c: Use TREE_NO_WARNING instead + of TREE_NO_UNUSED_WARNING. + * cvt.c (convert_to_void): Also use it for "has no effect" warning. + +2004-01-30 Frank Ch. Eigler + + * cp-mudflap.c (mflang_flush_calls): Mark static ctor as TREE_USED. + +2004-01-12 Jason Merrill + + * cp-lang.c (ok_to_generate_alias_set_for_type): Remove. + (cxx_get_alias_set): Allow all types. + +2004-01-08 Frank Ch. Eigler + + * cp-mudflap.c (mflang_flush_calls): mf_mark synthetic function. + +2004-01-04 Richard Henderson + + * call.c (build_over_call): Don't create a save_expr of an + aggregate, but rather its address. + +2004-01-01 Richard Henderson + + * expr.c (cxx_expand_expr): Don't handle THROW_EXPR, or + MUST_NOT_THROW_EXPR. + * semantics.c (genrtl_try_block, genrtl_eh_spec_block, + genrtl_handler, cp_expand_stmt): Remove. + (init_cp_semantics): Don't set lang_expand_stmt. + +2003-12-31 Richard Henderson + + * cp-mudflap.c (mflang_register_call): Remove. + +2003-12-18 Jason Merrill + + PR c++/12453 + * cp-simplify.c (cp_gimplify_init_expr): Look inside STMT_EXPRs + and COMPOUND_EXPRs to find an AGGR_INIT_EXPR. + +2003-12-16 Jason Merrill + + PR middle-end/12920 + * decl.c (grokdeclarator): Immediately layout an + ARRAY_TYPE used in a pointer-to-array declarator. + +2003-12-16 Jan Hubicka + + Revert until initializers are made language independent: + * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. + * cp-tree.h (cxx_callgraph_analyze_expr): Kill. + * decl2.c (cxx_callgraph_analyze_expr): Kill. + +2003-12-14 Jan Hubicka + + * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill. + * cp-tree.h (cxx_callgraph_analyze_expr): Kill. + * decl2.c (cxx_callgraph_analyze_expr): Kill. + +2003-11-24 Richard Henderson + + * Make-lang.in (tree.o, typeck.o): Remove -Wno-error. + +2003-11-20 Richard Henderson + + * call.c (build_java_interface_fn_ref): Use build_address+convert. + * except.c (build_eh_type_type): Likewise. + * class.c (build_base_path): Use convert+build_indirect_ref. + * init.c (expand_virtual_init): Likewise. + * rtti.c (get_tinfo_decl_dynamic): Use convert. + +2003-11-20 Frank Ch. Eigler + + * cp-mudflap.c (mflang_flush_calls): Adapt to direct expansion of + synthetic function, bypassing callgraph code. + * cp-decl2.c (finish_file): Call mudflap after callgraph-based + expansion. + +2003-11-17 Jason Merrill + + * init.c (build_new_1): Preevaluate initializer. Simplify EH code. + (build_init): Call a constructor rather than call build_aggr_init + for classes. + * except.c (stabilize_throw_expr): Remove. + (build_throw): Use stabilize_init instead of stabilize_throw_expr. + * tree.c (stabilize_call, stabilize_init): New fns. + * call.c (build_over_call): A constructor no longer returns the + address of the object. + +2003-11-16 Richard Henderson + + * typeck.c (pointer_diff): Remove unused variable. + +2003-11-16 Jason Merrill + + PR optimization/11269 + * semantics.c (finalize_nrv_r): Rename from nullify_returns_r. + Also replace uses of the nrv with our RESULT_DECL. + (cxx_expand_function_start): Don't mess with the nrv. + (finalize_nrv): New fn. + * cp-tree.h: Declare it. + * decl.c (finish_function): Call it. + * tree.c (cp_copy_res_decl_for_inlining): Don't mess with the nrv. + +2003-11-10 Richard Henderson + + * cp-simplify.c (gimplify_must_not_throw_expr): Replace add_tree + with append_to_statement_list. + +2003-10-30 Richard Henderson + + * decl.c (pop_switch): Call c_do_switch_warnings. + +2003-10-23 Richard Henderson + + * cp-simplify.c (cp_gimplify_expr): Return gimplify_status. + +2003-10-16 Richard Henderson + + * decl.c (finish_function): Don't check flag_disable_gimple. + +2003-10-14 Richard Henderson + + * decl.c (finish_function): Always gimplify; call c_warn_unused_result. + +2003-10-13 Richard Henderson + + * pt.c (push_tinst_level): Use annotate_with_locus. + +2003-10-12 Richard Henderson + + * call.c (call_builtin_trap): Use implicit_built_in_decls. + * class.c (build_base_path): Set TREE_INVARIANT. + (build_vtbl_ref_1, build_vtbl_initializer): Likewise. + * decl.c (build_enumerator): Likewise. + * init.c (build_zero_init): Likewise. + * pt.c (push_inline_template_parms_recursive): Likewise. + (build_template_parm_index, reduce_template_parm_level): Likewise. + (process_template_parm): Likewise. + * rtti.c (tinfo_base_init, generic_initializer): Likewise. + (ptr_initializer, ptm_initializer, class_initializer): Likewise. + * typeck.c (build_ptrmemfunc1): Likewise. + * typeck2.c (process_init_constructor): Likewise. + + * calls.c (dfs_accumulate_vtbl_inits): Rely on build to set + TREE_CONSTANT. + (build_vtbl_initializer): Likewise. + * init.c (build_vtbl_address): Likewise. + * rtti.c (tinfo_base_init): Likewise. + * tree.c (make_ptrmem_cst): Likewise. + * typeck.c (decay_conversion): Likewise. + (get_member_function_from_ptrfunc, build_binary_op): Likewise. + (pointer_diff, build_address, build_nop, build_unary_op): Likewise. + +2003-09-30 Richard Henderson + + * decl.c (finish_function): Set cfun->function_end_locus. + +2003-09-24 Jason Merrill + + * class.c, decl.c, decl2.c, error.c, init.c, lex.c, method.c, + pt.c, semantics.c, tree.c: Revert from TREE_LOCUS to + DECL_SOURCE_LOCATION. + +2003-09-17 Richard Henderson + + * decl.c (cxx_init_decl_processing): Don't using_eh_for_cleanups + if exceptions are disabled. + +2003-09-03 Richard Henderson + + * cp-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Use expand_stmt_toplev. + +2003-09-03 Richard Henderson + + * decl.c (finish_function): Fix misapplied patch. Don't + free_after_parsing or free_after_compilation. For real this time. + +2003-08-22 Jason Merrill + + * cp-simplify.c (cp_gimplify_init_expr): Update use of predicates. + +2003-08-21 Jason Merrill + + * cp-simplify.c (cp_gimplify_expr): Use simplify_aggr_init_expr. + (cp_gimplify_init_expr): Don't call it here. + (gimplify_aggr_init_expr): Remove. + +2003-08-19 Jason Merrill + + * typeck.c (build_array_ref): Also build ARRAY_REFs from + INDIRECT_REFs of ARRAY_TYPE. + + * semantics.c (finish_id_expression): Unshare aliases. + +2003-08-12 Diego Novillo + + * optimize.c (optimize_function): Do not call dump_function. + +2003-08-08 Jason Merrill + + * optimize.c (optimize_function): Restore support for + !keep_function_tree_in_gimple_form. + +2003-07-27 Andreas Jaeger + + * cp-lang.c: Convert K&R prototypes to ISO C90. + * cp-simplify.c: Likewise. + * cp-mudflap.c: Likewise. + +2003-06-13 Frank Ch. Eigler + + * semantics.c (expand_body): Call mudflap_c_function just before + rtl expansion of function body; don't interfere with inlining. + * optimize.c (optimize_function): Remove mudflap call. + +2003-06-13 Diego Novillo + + * cp-lang.c, cp-simplify.c, cp-tree.h, decl.c, optimize.c, + semantics.c, tree.c: Rename SIMPLE to GIMPLE everywhere. + +2003-06-05 Frank Ch. Eigler + + * cp-mudflap.c (mflang_register_call): Give the synthetic decl + undefined (not zero) size. + +2003-06-05 Frank Ch. Eigler + + * cp-mudflap.c (mx_flag): Remove. Update callers to use mf_mark. + +2003-05-24 Diego Novillo + + * Make-lang.in (optimize.o): Add dependency on tree-simple.h + * decl.c (grokdeclarator): Don't abort when the declarator is + ERROR_MARK_NODE. + * optimize.c (optimize_function): Unshare all trees after + optimizing inline calls. + +2003-05-12 Diego Novillo + + * class.c (dump_array): Call CONSTRUCTOR_ELTS to access + the operand of a CONSTRUCTOR node. + +2003-05-07 Diego Novillo + + * decl.c (grokdeclarator): Fix thinko in handling + ERROR_MARK declarators. + +2003-05-07 Diego Novillo + + * decl.c (grokdeclarator): Handle ERROR_MARK declarators. + +2003-05-07 Jason Merrill + + * semantics.c (expand_body): Call expand_stmt when + -fdisable-simple is given. + +2003-04-21 Jeff Law + + * optimize.c (optimize_function_tree): Do run the tree-ssa + optimizers. + +2003-04-16 Jeff Law + + * optimize.c (optimize_function): No longer check + flag_disable_simple. + +2003-04-15 Jeff Law + + * pt.c (instantiate_decl): If CFUN is null, then we will + need to push to the toplevel. + + * Makefile.in (decl.o): Depends on tree-flow.h. + * decl.c (finish_function): Call set_has_hidden_use when + nullifying returns for named value return optimization. + +2003-04-02 Jason Merrill + + * cp-simplify.c (cp_simplify_expr) : + Change type of constant to RECORD_TYPE. + +2003-03-10 Jeff Law + + * optimize.c (optimize_function): Avoid unnecessary + simplification of the function tree. + +2003-03-02 Diego Novillo + + * decl.c: Replace DECL_SOURCE_LOCATION with TREE_LOCUS + everywhere. + +2003-02-28 Frank Ch. Eigler + + * decl2.c (finish_file): Adjust timing of mudflap_finish_file call + to account for unit-at-a-time compilation. + +2003-02-07 Jason Merrill + + * cp-simplify.c (cp_simplify_expr): Handle BASELINK. + + * parser.c (cp_parser_primary_expression): Unshare a COMPONENT_REF + from an ALIAS_DECL. + +2003-02-05 Jason Merrill + + * cp-simplify.c (genericize_try_block): Do genericize catch blocks. + +2003-02-03 Diego Novillo + + * parser.c (cp_parser_asm_definition): Call finish_asm_stmt with + 'volatile_p' directly. + * typeck.c (build_binary_op): Initialize variable 'type'. + * Make-lang.in (cp/tree.o-warn): Add -Wno-error. + +2003-01-29 Frank Ch. Eigler + + * cp-mudflap.c (mflang_register_call): Adapt to mf-runtime.h API + change. + +2003-01-15 Jeff Law + + * class.c: Use TREE_FILENAME and TREE_LINENO to extract + file/line information from tree nodes. Remove EXPR_WITH_FILE_LOCATION + nodes. Use annotate_with_file_line to attach file/line information + to tree nodes. Use TREE_LOCUS to copy file/line information + from one node to another. + * decl2.c, error.c, init.c, lex.c, method.c: Likewise. + * optimize.c: Likewise. + * cp-tree.def (TINST_LEVEL): New tree node. + * cp-tree.h (TINST_DECL): Update now that we no longer use + EXPR_WITH_FILE_LOCATION to represent the TINST_DECL information. + (TINST_FILE, TINST_LINE): Kill. + * decl.c: Use TREE_FILENAME and TREE_LINENO to extract + file/line information from tree nodes. Use annotate_witH_file_line + to add file/line information to tree nodes. Use TREE_LOCUS + to copy file/line information from one node to another. + (duplicate_decls): Make sure to copy TREE_LOCUS information + from the old decl to the new decl. + (finish_function): Save and restore file/line information + around genericizing the function tree. + * pt.c (lookup_template_class): Use TREE_LOCUS to copy file/line + information from one node to another. + (push_tinst_level): Generate a TINST_LEVEL node rather than + using EXPR_WITH_FILE_LOCATION nodes. Use annotate_with_file_line + to annotate the new node with file/line information. + (pop_tinst_level): Use TREE_LINENO and TREE_FILENAME to extract + file/line information from nodes. + (tsubst_friend_function, instantiate_class_template): Likewise. + (tsubst_decl, instantiate_decl, tsubst_enum): Likewise. + * semantics.c: Use annotate_with_file_line to annotate tree + nodes with file/line information. Use TREE_FILENAME and TREE_LINENO + to extract file/line information from tree nodes. + (expand_body): Restore file/line information slightly earlier. + tree.c (cp_walk_subtrees): Set lineno appropriately. + (cp_copy_res_decl_for_inlining): Use TREE_LOCUS to copy file/line + information from one node to another. + +2003-01-13 Frank Ch. Eigler + + Prototype C++ mudflap support. + * Make-lang.in (CXX_OBJS): Add cp/cp-mudflap.o and dependencies. + * cp-mudflap.c: New file with C++ front-end mflang_* routines. + * decl2.c (finish_file): Divert to mudflap if appropriate. + * optimize.c (optimize_function): Ditto. + +2003-01-02 Jason Merrill + + * Make-lang.in (CXX_C_OBJS): Replace old-tree-inline.o with + tree-inline.o. + + * optimize.c (dump_function): Move to ../tree-dump.c. + + * cp-simplify.c (cp_simplify_expr): Handle PTRMEM_CST, INIT_EXPR, + MODIFY_EXPR and EMPTY_CLASS_EXPR. + (cp_simplify_stmt): Handle USING_STMT. + (cp_simplify_init_expr): New fn. + * cvt.c (build_up_reference): Don't push the decl. + * class.c (build_vtable_entry_ref, build_vtbl_ref_1): Unshare the + vtable address. + * init.c (build_vtbl_address): Likewise. + * cp-lang.c (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove. + * decl.c (lookup_name_real): Unshare the expansion of an ALIAS_DECL. + (finish_function): Don't genericize templates. + * parse.y (parse_asm_stmt): Fix prototype. + * semantics.c (expand_body): Don't expand if we saw errors. + Drop support for expanding non-GENERIC code. + + * cp-simplify.c (cp_simplify_stmt): Handle HANDLER and EH_SPEC_BLOCK. + (genericize_try_block): Always build a TRY_CATCH_EXPR. + (genericize_catch_block): New fn. + (genericize_eh_spec_block): New fn. + (cp_simplify_expr): Handle THROW_EXPR and MUST_NOT_THROW_EXPR. + (simplify_must_not_throw_expr): New fn. + * except.c (wrap_cleanups_r): Make the MUST_NOT_THROW_EXPR void. + (build_throw): Likewise. + +2002-12-14 Jason Merrill + + * optimize.c (dump_function): Use pretty dumpers. + (optimize_function): Don't do .original dump here. + +2002-12-03 Diego Novillo + + * cp-simplify.c: Include coretypes.h and tm.h. + +2002-11-24 Jason Merrill + + Gimplify C++ cleanups. + * decl.c (finish_function): Call c_genericize. + * cp-simplify.c (cp_simplify_stmt): New fn. + (genericize_try_block): New fn. + (cp_simplify_expr): Move INIT_EXPR/TARGET_EXPR code + to ../gimplify.c. Handle AGGR_INIT_EXPR. + (simplify_target_expr): Move to ../gimplify.c. + (maybe_fixup_loop_cond): Remove. + (simplify_aggr_init_expr): Split out from... + * semantics.c (simplify_aggr_init_exprs_r): ...here. + (expand_body): Don't simplify AGGR_INIT_EXPRs here + if we're gimplifying. Handle expanding generic trees. + * tree.c (init_tree): Set lang_simplify_stmt. + * cp-tree.h: Declare the new fns. + + * optimize.c (optimize_function): Do pretty dumps. + +2002-10-04 Jason Merrill + + * Make-lang.in (CXX_C_OBJS): Add gimplify.o. + +2002-09-24 Jason Merrill + + * parse.y (parse_asm_stmt): New fn. + (simple_stmt): Use it. + * semantics.c (finish_asm_stmt): Change cv_qualifier parm to + volatile_p. + * cp-tree.h: Adjust prototype. + * pt.c (tsubst_expr): Adjust call. + +2002-08-23 Diego Novillo + + * Make-lang.in (CXX_C_OBJS): Add tree-dchain.o + +2002-08-11 Jason Merrill + + * cp-simplify.c (maybe_fixup_loop_cond): Move here. + (cp_simplify_expr): Call it. + (simplify_target_expr): Remove pre_p parm. + +2002-08-09 Jason Merrill + + * cp-simplify.c (cp_simplify_expr): New fn. + (simplify_target_expr): New fn. + (cp_simplify_function_tree): Remove. + * cp-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Don't define. + (LANG_HOOKS_SIMPLIFY_EXPR): Define. + * optimize.c (optimize_function): De-hook simplify_function_tree. + * cp-tree.h: Declare cp_simplify_expr. + +2002-07-17 Daniel Berlin + + * Make-lang.in (CXX_C_OBJS): Add tree-alias-ecr.c, + tree-alias-type.o, tree-alias-steen.o, disjoint-set.o. + +2002-06-21 Andreas Jaeger + + * Make-lang.in (cp-simplify.o): New. + +2002-06-18 Jason Merrill + + * cp-simplify.c: New file. + * Make-lang.in: Add it. + * cp-tree.h: Declare cp_simplify_function_tree. + * cp-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define. + * optimize.c (optimize_function): Call tree optimizers (but not yet). + +Local Variables: +mode: change-log +change-log-default-name: "ChangeLog.tree-ssa" +End: diff --git a/contrib/gcc/cp/Make-lang.in b/contrib/gcc/cp/Make-lang.in index 58881101ba7..ea033578ea8 100644 --- a/contrib/gcc/cp/Make-lang.in +++ b/contrib/gcc/cp/Make-lang.in @@ -1,5 +1,6 @@ # Top level -*- makefile -*- fragment for GNU C++. -# Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 # Free Software Foundation, Inc. #This file is part of GCC. @@ -16,14 +17,14 @@ #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. +#the Free Software Foundation, 51 Franklin Street, Fifth Floor, +#Boston, MA 02110-1301, USA. # This file provides the language dependent support in the main Makefile. # Each language makefile fragment must provide the following targets: # -# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, -# foo.install-normal, foo.install-common, foo.install-man, +# foo.all.cross, foo.start.encap, foo.rest.encap, +# foo.install-common, foo.install-man, foo.install-info, foo.dvi, foo.pdf # foo.uninstall, # foo.mostlyclean, foo.clean, foo.distclean, # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 @@ -47,10 +48,10 @@ GXX_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo g++|sed '$(progra # Note that it would be nice to move the dependency on g++ # into the C++ rule, but that needs a little bit of work # to do the right thing within all.cross. -C++ c++: cc1plus$(exeext) +c++: cc1plus$(exeext) # Tell GNU make to ignore these if they exist. -.PHONY: C++ c++ +.PHONY: c++ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CONFIG_H) (SHLIB_LINK='$(SHLIB_LINK)' \ @@ -59,7 +60,7 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CON $(INCLUDES) $(srcdir)/cp/g++spec.c) # Create the compiler driver for g++. -GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o +GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -73,40 +74,52 @@ g++-cross$(exeext): g++$(exeext) # Shared with C front end: CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o c-pch.o \ - c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o + c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \ + c-gimplify.o c-omp.o tree-inline.o -# Language-specific object files. -CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ +# Language-specific object files for C++ and Objective C++. +CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o \ cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \ cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \ - cp/mangle.o cp/cp-lang.o cp/name-lookup.o cp/cxx-pretty-print.o + cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o \ + cp/cp-gimplify.o tree-mudflap.o $(CXX_C_OBJS) + +# Language-specific object files for C++. +CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) # Use strict warnings for this front end. -cp-warn = $(STRICT_WARN) $(WERROR) +cp-warn = $(STRICT_WARN) $(CXX_COMPAT_WARN) -cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \ - libcpp.a $(LIBDEPS) +cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ - $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) libcpp.a $(LIBS) + $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) + +cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext) + build/genchecksum$(build_exeext) cc1plus-dummy$(exeext) > $@ + +cc1plus-checksum.o : cc1plus-checksum.c + +cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ + $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) # Special build rules. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ $(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h -gtype-cp.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h : s-gtype; @true -gt-cp-pt.h gt-cp-repo.h gt-cp-parser.h gt-cp-method.h : s-gtype; @true -gt-cp-tree.h gt-cp-mangle.h gt-cp-name-lookup.h: s-gtype; @true - # # Build hooks: -c++.all.build: g++$(exeext) c++.all.cross: g++-cross$(exeext) c++.start.encap: g++$(exeext) c++.rest.encap: c++.info: +c++.install-info: +c++.dvi: +c++.pdf: +c++.html: c++.srcinfo: c++.srcextra: @@ -120,16 +133,17 @@ c++.man: doc/g++.1 c++.srcman: doc/g++.1 -cp -p $^ $(srcdir)/doc +# 'make check' in gcc/ looks for check-c++, as do all toplevel C++-related +# check targets. However, our DejaGNU framework requires 'check-g++' as its +# entry point. We feed the former to the latter here. check-c++ : check-g++ +# List of targets that can use the generic check- rule and its // variant. lang_checks += check-g++ # # Install hooks: # cc1plus is installed elsewhere as part of $(COMPILERS). -# Nothing to do here. -c++.install-normal: - # Install the driver program as $(target)-g++ # and also as either g++ (if native) or $(tooldir)/bin/g++. c++.install-common: installdirs @@ -146,7 +160,7 @@ c++.install-common: installdirs $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \ rm -f $(DESTDIR)$(gcc_tooldir)/bin/c++$(exeext); \ ( cd $(DESTDIR)$(gcc_tooldir)/bin && \ - $(LN) g++$(exeext) c++$(exeext) ); \ + $(LN) g++$(exeext) c++$(exeext) ); \ else true; fi; \ else \ rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \ @@ -161,11 +175,11 @@ c++.install-common: installdirs # We can't use links because not everyone supports them, and we can't use # .so because Irix 6.5 doesn't support them. So just copy the manpage. doc/g++.1: doc/gcc.1 - cp doc/gcc.1 doc/g++.1 + cp $< doc/g++.1 -c++.install-man: installdirs $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) +c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) -$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 +$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ @@ -206,66 +220,80 @@ c++.stagefeedback: stagefeedback-start # # .o: .h dependencies. -CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h c-common.h \ - cp/cp-tree.def c-common.def \ - function.h varray.h $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) \ - $(GGC_H) \ +CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ + cp/cp-tree.def c-common.def $(FUNCTION_H) $(VARRAY_H) \ + $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \ $(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H) -cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h \ - c-pragma.h toplev.h output.h input.h cp/operators.def $(TM_P_H) -cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h langhooks.h \ - $(LANGHOOKS_DEF_H) c-common.h $(CXX_PRETTY_PRINT_H) $(DIAGNOSTIC_H) -cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h stack.h \ +cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ + $(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H) +cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h \ + $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h \ + $(DIAGNOSTIC_H) cp/cp-objcp-common.h +cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \ output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(RTL_H) \ - cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \ - debug.h gt-cp-decl.h gtype-cp.h timevar.h -cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \ - output.h except.h toplev.h $(RTL_H) c-common.h gt-cp-decl2.h cgraph.h -cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \ - diagnostic.h -cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \ - diagnostic.h convert.h -cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) convert.h -cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \ - diagnostic.h intl.h gt-cp-call.h convert.h target.h -cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_H) -cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \ - except.h + cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \ + debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H) +cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h $(EXPR_H) \ + output.h except.h toplev.h $(RTL_H) $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ + $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) +cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \ + langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \ + $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h +cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \ + $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h +cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ + toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) +cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ + $(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H) +cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ + $(EXPR_H) $(DIAGNOSTIC_H) intl.h gt-cp-call.h convert.h $(TARGET_H) +cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) toplev.h \ + $(EXPR_H) +cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ + toplev.h except.h $(TARGET_H) cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_H) \ - $(TM_P_H) $(TARGET_H) gt-cp-method.h -cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h flags.h toplev.h convert.h -cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) stack.h flags.h toplev.h $(RTL_H) -cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) \ - insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H) + $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h +cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) toplev.h \ + convert.h $(TARGET_H) +cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) +cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ + insn-config.h $(INTEGRATE_H) $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \ + $(TARGET_H) debug.h cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) -cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h convert.h -cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h toplev.h \ - cp/cfns.h $(EXPR_H) libfuncs.h tree-inline.h -cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \ - except.h $(TM_P_H) -cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/lex.h \ - toplev.h $(RTL_H) except.h tree-inline.h gt-cp-pt.h +cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ + gt-cp-rtti.h +cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ + toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) +cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ + toplev.h except.h $(TM_P_H) +cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \ + toplev.h $(RTL_H) except.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h \ + vecprim.h cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ - flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) -cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \ + $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) +cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ gt-cp-repo.h -cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) cp/lex.h except.h toplev.h \ - flags.h debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ - tree-inline.h cgraph.h -cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) tree-dump.h -cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h integrate.h insn-config.h \ - input.h $(PARAMS_H) debug.h tree-inline.h -cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h real.h gt-cp-mangle.h \ - $(TARGET_H) $(TM_P_H) - -cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) diagnostic.h gt-cp-parser.h output.h +cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \ + $(FLAGS_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \ + $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) +cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H) +cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \ + insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(TREE_GIMPLE_H) \ + $(TARGET_H) +cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \ + gt-cp-mangle.h $(TARGET_H) $(TM_P_H) +cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \ + output.h $(TARGET_H) +cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \ + $(TM_H) coretypes.h pointer-set.h cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h toplev.h \ - $(DIAGNOSTIC_H) flags.h + $(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \ + $(DIAGNOSTIC_H) $(FLAGS_H) debug.h cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \ $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) diff --git a/contrib/gcc/cp/NEWS b/contrib/gcc/cp/NEWS index 75a5823fc96..6825b9e3cfe 100644 --- a/contrib/gcc/cp/NEWS +++ b/contrib/gcc/cp/NEWS @@ -9,15 +9,15 @@ * G++ no longer allows in-class initializations of static data members that do not have arithmetic or enumeration type. For example: - struct S { + struct S { static const char* const p = "abc"; }; - is no longer accepted. + is no longer accepted. Use the standards-conformant form: - struct S { + struct S { static const char* const p; }; @@ -39,12 +39,12 @@ pointer to cv-qualified member function types. * The C++ ABI has been changed to correctly handle this code: - + struct A { void operator delete[] (void *, size_t); }; - struct B : public A { + struct B : public A { }; new B[10]; @@ -52,17 +52,17 @@ The amount of storage allocated for the array will be greater than it was in 3.0, in order to store the number of elements in the array, so that the correct size can be passed to `operator delete[]' - when the array is deleted. Previously, the value passed to + when the array is deleted. Previously, the value passed to `operator delete[]' was unpredictable. This change will only affect code that declares a two-argument `operator delete[]' with a second parameter of type `size_t' - in a base class, and does not override that definition in a + in a base class, and does not override that definition in a derived class. * The C++ ABI has been changed so that: - struct A { + struct A { void operator delete[] (void *, size_t); void operator delete[] (void *); }; @@ -109,7 +109,7 @@ are those whose types involve non-type template arguments whose mangled representations require more than one digit. -* Support for assignment to `this' has been removed. This idiom +* Support for assignment to `this' has been removed. This idiom was used in the very early days of C++, before users were allowed to overload `operator new'; it is no longer allowed by the C++ standard. @@ -124,15 +124,15 @@ * G++ previously allowed `sizeof (X::Y)' where Y was a non-static member of X, even if the `sizeof' expression occurred outside - of a non-static member function of X (or one of its derived classes, + of a non-static member function of X (or one of its derived classes, or a member-initializer for X or one of its derived classes.) This extension has been removed. -* G++ no longer allows you to overload the conditional operator (i.e., +* G++ no longer allows you to overload the conditional operator (i.e., the `?:' operator.) * The "named return value" extension: - + int f () return r { r = 3; } has been deprecated, and will be removed in a future version of G++. @@ -175,7 +175,7 @@ *** Changes in EGCS 1.1: -* Namespaces are fully supported. The library has not yet been converted +* Namespaces are fully supported. The library has not yet been converted to use namespace std, however, and the old std-faking code is still on by default. To turn it off, you can use -fhonor-std. @@ -250,9 +250,9 @@ but not all, the compiler will tell you where you need to add 'typename'. For more information, see - http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res + http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res - + Guiding declarations are no longer supported. Function declarations, + + Guiding declarations are no longer supported. Function declarations, including friend declarations, do not refer to template instantiations. You can restore the old behavior with -fguiding-decls until you fix your code. @@ -269,7 +269,7 @@ + Explicit instantiation of template constructors and destructors is now supported. For instance: - template A::A(const A&); + template A::A(const A&); Still not supported: @@ -315,7 +315,7 @@ converting from a bound member function pointer to function pointer). - + A flag -Weffc++ has been added for violations of some of the style + + A flag -Weffc++ has been added for violations of some of the style guidelines in Scott Meyers' _Effective C++_ books. + -Woverloaded-virtual now warns if a virtual function in a base @@ -324,9 +324,9 @@ signatures are overridden) as it did before. + -Wall no longer implies -W. The new warning flag, -Wsign-compare, - included in -Wall, warns about dangerous comparisons of signed and - unsigned values. Only the flag is new; it was previously part of - -W. + included in -Wall, warns about dangerous comparisons of signed and + unsigned values. Only the flag is new; it was previously part of + -W. + The new flag, -fno-weak, disables the use of weak symbols. @@ -336,13 +336,13 @@ * __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the parser; previously they were treated as string constants. So code like - `printf (__FUNCTION__ ": foo")' must be rewritten to + `printf (__FUNCTION__ ": foo")' must be rewritten to `printf ("%s: foo", __FUNCTION__)'. This is necessary for templates. * local static variables in extern inline functions will be shared between translation units. -* -fvtable-thunks is supported for all targets, and is the default for +* -fvtable-thunks is supported for all targets, and is the default for Linux with glibc 2.x (also called libc 6.x). * bool is now always the same size as another built-in type. Previously, @@ -377,12 +377,12 @@ supported. For instance: struct A { - struct B; - B* bp; + struct B; + B* bp; }; struct A::B { - int member; + int member; }; * On the HPPA, some classes that do not define a copy constructor @@ -395,7 +395,7 @@ * Joe Buck , the maintainer of the g++ FAQ. * Brendan Kehoe , who coordinates testing of g++. * Jason Merrill , the g++ maintainer. -* Mark Mitchell , who implemented member function +* Mark Mitchell , who implemented member function templates and explicit qualification of function templates. * Mike Stump , the previous g++ maintainer, who did most of the exception handling work. diff --git a/contrib/gcc/cp/call.c b/contrib/gcc/cp/call.c index 01c8926b076..6d6740a44fe 100644 --- a/contrib/gcc/cp/call.c +++ b/contrib/gcc/cp/call.c @@ -1,6 +1,6 @@ /* Functions related to invoking methods and overloaded functions. - Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). @@ -18,8 +18,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* High-level class interface. */ @@ -40,21 +40,105 @@ Boston, MA 02111-1307, USA. */ #include "target.h" #include "convert.h" +/* The various kinds of conversion. */ + +typedef enum conversion_kind { + ck_identity, + ck_lvalue, + ck_qual, + ck_std, + ck_ptr, + ck_pmem, + ck_base, + ck_ref_bind, + ck_user, + ck_ambig, + ck_rvalue +} conversion_kind; + +/* The rank of the conversion. Order of the enumerals matters; better + conversions should come earlier in the list. */ + +typedef enum conversion_rank { + cr_identity, + cr_exact, + cr_promotion, + cr_std, + cr_pbool, + cr_user, + cr_ellipsis, + cr_bad +} conversion_rank; + +/* An implicit conversion sequence, in the sense of [over.best.ics]. + The first conversion to be performed is at the end of the chain. + That conversion is always a cr_identity conversion. */ + +typedef struct conversion conversion; +struct conversion { + /* The kind of conversion represented by this step. */ + conversion_kind kind; + /* The rank of this conversion. */ + conversion_rank rank; + BOOL_BITFIELD user_conv_p : 1; + BOOL_BITFIELD ellipsis_p : 1; + BOOL_BITFIELD this_p : 1; + BOOL_BITFIELD bad_p : 1; + /* If KIND is ck_ref_bind ck_base_conv, true to indicate that a + temporary should be created to hold the result of the + conversion. */ + BOOL_BITFIELD need_temporary_p : 1; + /* If KIND is ck_identity or ck_base_conv, true to indicate that the + copy constructor must be accessible, even though it is not being + used. */ + BOOL_BITFIELD check_copy_constructor_p : 1; + /* If KIND is ck_ptr or ck_pmem, true to indicate that a conversion + from a pointer-to-derived to pointer-to-base is being performed. */ + BOOL_BITFIELD base_p : 1; + /* The type of the expression resulting from the conversion. */ + tree type; + union { + /* The next conversion in the chain. Since the conversions are + arranged from outermost to innermost, the NEXT conversion will + actually be performed before this conversion. This variant is + used only when KIND is neither ck_identity nor ck_ambig. */ + conversion *next; + /* The expression at the beginning of the conversion chain. This + variant is used only if KIND is ck_identity or ck_ambig. */ + tree expr; + } u; + /* The function candidate corresponding to this conversion + sequence. This field is only used if KIND is ck_user. */ + struct z_candidate *cand; +}; + +#define CONVERSION_RANK(NODE) \ + ((NODE)->bad_p ? cr_bad \ + : (NODE)->ellipsis_p ? cr_ellipsis \ + : (NODE)->user_conv_p ? cr_user \ + : (NODE)->rank) + +static struct obstack conversion_obstack; +static bool conversion_obstack_initialized; + static struct z_candidate * tourney (struct z_candidate *); static int equal_functions (tree, tree); static int joust (struct z_candidate *, struct z_candidate *, bool); -static int compare_ics (tree, tree); +static int compare_ics (conversion *, conversion *); static tree build_over_call (struct z_candidate *, int); static tree build_java_interface_fn_ref (tree, tree); #define convert_like(CONV, EXPR) \ - convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ - /*issue_conversion_warnings=*/true) + convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ + /*issue_conversion_warnings=*/true, \ + /*c_cast_p=*/false) #define convert_like_with_context(CONV, EXPR, FN, ARGNO) \ - convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ - /*issue_conversion_warnings=*/true) -static tree convert_like_real (tree, tree, tree, int, int, bool); + convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \ + /*issue_conversion_warnings=*/true, \ + /*c_cast_p=*/false) +static tree convert_like_real (conversion *, tree, tree, int, int, bool, + bool); static void op_error (enum tree_code, enum tree_code, tree, tree, - tree, const char *); + tree, const char *); static tree build_object_call (tree, tree); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); @@ -64,80 +148,62 @@ static tree build_this (tree); static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *); static bool any_strictly_viable (struct z_candidate *); static struct z_candidate *add_template_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, - tree, tree, int, unification_kind_t); + (struct z_candidate **, tree, tree, tree, tree, tree, + tree, tree, int, unification_kind_t); static struct z_candidate *add_template_candidate_real - (struct z_candidate **, tree, tree, tree, tree, tree, - tree, tree, int, tree, unification_kind_t); -static struct z_candidate *add_template_conv_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, tree); + (struct z_candidate **, tree, tree, tree, tree, tree, + tree, tree, int, tree, unification_kind_t); +static struct z_candidate *add_template_conv_candidate + (struct z_candidate **, tree, tree, tree, tree, tree, tree); static void add_builtin_candidates (struct z_candidate **, enum tree_code, enum tree_code, - tree, tree *, int); + tree, tree *, int); static void add_builtin_candidate (struct z_candidate **, enum tree_code, enum tree_code, - tree, tree, tree, tree *, tree *, int); + tree, tree, tree, tree *, tree *, int); static bool is_complete (tree); -static void build_builtin_candidate +static void build_builtin_candidate (struct z_candidate **, tree, tree, tree, tree *, tree *, - int); -static struct z_candidate *add_conv_candidate + int); +static struct z_candidate *add_conv_candidate (struct z_candidate **, tree, tree, tree, tree, tree); -static struct z_candidate *add_function_candidate +static struct z_candidate *add_function_candidate (struct z_candidate **, tree, tree, tree, tree, tree, int); -static tree implicit_conversion (tree, tree, tree, int); -static tree standard_conversion (tree, tree, tree, int); -static tree reference_binding (tree, tree, tree, int); -static tree build_conv (enum tree_code, tree, tree); -static bool is_subseq (tree, tree); -static tree maybe_handle_ref_bind (tree *); -static void maybe_handle_implicit_object (tree *); -static struct z_candidate *add_candidate - (struct z_candidate **, tree, tree, tree, tree, tree, int); -static tree source_type (tree); +static conversion *implicit_conversion (tree, tree, tree, bool, int); +static conversion *standard_conversion (tree, tree, tree, bool, int); +static conversion *reference_binding (tree, tree, tree, bool, int); +static conversion *build_conv (conversion_kind, tree, conversion *); +static bool is_subseq (conversion *, conversion *); +static tree maybe_handle_ref_bind (conversion **); +static void maybe_handle_implicit_object (conversion **); +static struct z_candidate *add_candidate + (struct z_candidate **, tree, tree, size_t, + conversion **, tree, tree, int); +static tree source_type (conversion *); static void add_warning (struct z_candidate *, struct z_candidate *); static bool reference_related_p (tree, tree); static bool reference_compatible_p (tree, tree); -static tree convert_class_to_reference (tree, tree, tree); -static tree direct_reference_binding (tree, tree); +static conversion *convert_class_to_reference (tree, tree, tree); +static conversion *direct_reference_binding (tree, conversion *); static bool promoted_arithmetic_type_p (tree); -static tree conditional_conversion (tree, tree); +static conversion *conditional_conversion (tree, tree); static char *name_as_c_string (tree, tree, bool *); static tree call_builtin_trap (void); static tree prep_operand (tree); static void add_candidates (tree, tree, tree, bool, tree, tree, int, struct z_candidate **); -static tree merge_conversion_sequences (tree, tree); +static conversion *merge_conversion_sequences (conversion *, conversion *); static bool magic_varargs_p (tree); -static tree build_temp (tree, tree, int, void (**)(const char *, ...)); +typedef void (*diagnostic_fn_t) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); +static tree build_temp (tree, tree, int, diagnostic_fn_t *); static void check_constructor_callable (tree, tree); -tree -build_vfield_ref (tree datum, tree type) -{ - if (datum == error_mark_node) - return error_mark_node; - - if (TREE_CODE (TREE_TYPE (datum)) == REFERENCE_TYPE) - datum = convert_from_reference (datum); - - if (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (type) - && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (datum), type)) - datum = convert_to_base (datum, type, /*check_access=*/false); - - return build (COMPONENT_REF, TREE_TYPE (TYPE_VFIELD (type)), - datum, TYPE_VFIELD (type)); -} - -/* Returns nonzero iff the destructor name specified in NAME - (a BIT_NOT_EXPR) matches BASETYPE. The operand of NAME can take many - forms... */ +/* Returns nonzero iff the destructor name specified in NAME matches BASETYPE. + NAME can take many forms... */ bool check_dtor_name (tree basetype, tree name) { - name = TREE_OPERAND (name, 0); - /* Just accept something we've already complained about. */ if (name == error_mark_node) return true; @@ -151,25 +217,26 @@ check_dtor_name (tree basetype, tree name) if ((IS_AGGR_TYPE (basetype) && name == constructor_name (basetype)) || (TREE_CODE (basetype) == ENUMERAL_TYPE && name == TYPE_IDENTIFIER (basetype))) - name = basetype; + return true; else name = get_type_value (name); } - /* In the case of: - - template struct S { ~S(); }; - int i; - i.~S(); - - NAME will be a class template. */ - else if (DECL_CLASS_TEMPLATE_P (name)) - return false; else - abort (); + { + /* In the case of: - if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name)) - return true; - return false; + template struct S { ~S(); }; + int i; + i.~S(); + + NAME will be a class template. */ + gcc_assert (DECL_CLASS_TEMPLATE_P (name)); + return false; + } + + if (!name) + return false; + return same_type_p (TYPE_MAIN_VARIANT (basetype), TYPE_MAIN_VARIANT (name)); } /* We want the address of a function or method. We avoid creating a @@ -214,18 +281,28 @@ build_call (tree function, tree parms) function = build_addr_func (function); - if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function))) - { - sorry ("unable to call pointer to member function here"); - return error_mark_node; - } - + gcc_assert (TYPE_PTR_P (TREE_TYPE (function))); fntype = TREE_TYPE (TREE_TYPE (function)); + gcc_assert (TREE_CODE (fntype) == FUNCTION_TYPE + || TREE_CODE (fntype) == METHOD_TYPE); result_type = TREE_TYPE (fntype); if (TREE_CODE (function) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL) - decl = TREE_OPERAND (function, 0); + { + decl = TREE_OPERAND (function, 0); + if (!TREE_USED (decl)) + { + /* We invoke build_call directly for several library + functions. These may have been declared normally if + we're building libgcc, so we can't just check + DECL_ARTIFICIAL. */ + gcc_assert (DECL_ARTIFICIAL (decl) + || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), + "__", 2)); + mark_used (decl); + } + } else decl = NULL_TREE; @@ -244,18 +321,6 @@ build_call (tree function, tree parms) if (decl && DECL_CONSTRUCTOR_P (decl)) is_constructor = 1; - if (decl && ! TREE_USED (decl)) - { - /* We invoke build_call directly for several library functions. - These may have been declared normally if we're building libgcc, - so we can't just check DECL_ARTIFICIAL. */ - if (DECL_ARTIFICIAL (decl) - || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2)) - mark_used (decl); - else - abort (); - } - /* Don't pass empty class objects by value. This is useful for tags in STL, which are used to control overload resolution. We don't need to handle other cases of copying empty classes. */ @@ -264,15 +329,15 @@ build_call (tree function, tree parms) if (is_empty_class (TREE_TYPE (TREE_VALUE (tmp))) && ! TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (tmp)))) { - tree t = build (EMPTY_CLASS_EXPR, TREE_TYPE (TREE_VALUE (tmp))); - TREE_VALUE (tmp) = build (COMPOUND_EXPR, TREE_TYPE (t), - TREE_VALUE (tmp), t); + tree t = build0 (EMPTY_CLASS_EXPR, TREE_TYPE (TREE_VALUE (tmp))); + TREE_VALUE (tmp) = build2 (COMPOUND_EXPR, TREE_TYPE (t), + TREE_VALUE (tmp), t); } - function = build (CALL_EXPR, result_type, function, parms); + function = build3 (CALL_EXPR, result_type, function, parms, NULL_TREE); TREE_HAS_CONSTRUCTOR (function) = is_constructor; TREE_NOTHROW (function) = nothrow; - + return function; } @@ -309,7 +374,15 @@ build_call (tree function, tree parms) /* New overloading code. */ -struct z_candidate GTY(()) { +typedef struct z_candidate z_candidate; + +typedef struct candidate_warning candidate_warning; +struct candidate_warning { + z_candidate *loser; + candidate_warning *next; +}; + +struct z_candidate { /* The FUNCTION_DECL that will be called if this candidate is selected by overload resolution. */ tree fn; @@ -317,11 +390,13 @@ struct z_candidate GTY(()) { tree args; /* The implicit conversion sequences for each of the arguments to FN. */ - tree convs; + conversion **convs; + /* The number of implicit conversion sequences. */ + size_t num_convs; /* If FN is a user-defined conversion, the standard conversion sequence from the type returned by FN to the desired destination type. */ - tree second_conv; + conversion *second_conv; int viable; /* If FN is a member function, the binfo indicating the path used to qualify the name of FN at the call site. This path is used to @@ -335,44 +410,11 @@ struct z_candidate GTY(()) { the `this' pointer must correspond to the most derived class indicated by the CONVERSION_PATH. */ tree conversion_path; - tree template; - tree warnings; - struct z_candidate *next; + tree template_decl; + candidate_warning *warnings; + z_candidate *next; }; -#define IDENTITY_RANK 0 -#define EXACT_RANK 1 -#define PROMO_RANK 2 -#define STD_RANK 3 -#define PBOOL_RANK 4 -#define USER_RANK 5 -#define ELLIPSIS_RANK 6 -#define BAD_RANK 7 - -#define ICS_RANK(NODE) \ - (ICS_BAD_FLAG (NODE) ? BAD_RANK \ - : ICS_ELLIPSIS_FLAG (NODE) ? ELLIPSIS_RANK \ - : ICS_USER_FLAG (NODE) ? USER_RANK \ - : ICS_STD_RANK (NODE)) - -#define ICS_STD_RANK(NODE) TREE_COMPLEXITY (NODE) - -#define ICS_USER_FLAG(NODE) TREE_LANG_FLAG_0 (NODE) -#define ICS_ELLIPSIS_FLAG(NODE) TREE_LANG_FLAG_1 (NODE) -#define ICS_THIS_FLAG(NODE) TREE_LANG_FLAG_2 (NODE) -#define ICS_BAD_FLAG(NODE) TREE_LANG_FLAG_3 (NODE) - -/* In a REF_BIND or a BASE_CONV, this indicates that a temporary - should be created to hold the result of the conversion. */ -#define NEED_TEMPORARY_P(NODE) TREE_LANG_FLAG_4 (NODE) - -/* TRUE in an IDENTITY_CONV or BASE_CONV if the copy constructor must - be accessible, even though it is not being used. */ -#define CHECK_COPY_CONSTRUCTOR_P(NODE) TREE_LANG_FLAG_5 (NODE) - -#define USER_CONV_CAND(NODE) WRAPPER_ZC (TREE_OPERAND (NODE, 1)) -#define USER_CONV_FN(NODE) (USER_CONV_CAND (NODE)->fn) - /* Returns true iff T is a null pointer constant in the sense of [conv.ptr]. */ @@ -383,15 +425,18 @@ null_ptr_cst_p (tree t) A null pointer constant is an integral constant expression (_expr.const_) rvalue of integer type that evaluates to zero. */ - if (DECL_INTEGRAL_CONSTANT_VAR_P (t)) - t = decl_constant_value (t); - if (t == null_node - || (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t))) + t = integral_constant_value (t); + if (t == null_node) return true; + if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t)) + { + STRIP_NOPS (t); + if (!TREE_CONSTANT_OVERFLOW (t)) + return true; + } return false; } - /* Returns nonzero if PARMLIST consists of only default parms and/or ellipsis. */ @@ -405,42 +450,126 @@ sufficient_parms_p (tree parmlist) return true; } -static tree -build_conv (enum tree_code code, tree type, tree from) +/* Allocate N bytes of memory from the conversion obstack. The memory + is zeroed before being returned. */ + +static void * +conversion_obstack_alloc (size_t n) { - tree t; - int rank = ICS_STD_RANK (from); + void *p; + if (!conversion_obstack_initialized) + { + gcc_obstack_init (&conversion_obstack); + conversion_obstack_initialized = true; + } + p = obstack_alloc (&conversion_obstack, n); + memset (p, 0, n); + return p; +} + +/* Dynamically allocate a conversion. */ + +static conversion * +alloc_conversion (conversion_kind kind) +{ + conversion *c; + c = (conversion *) conversion_obstack_alloc (sizeof (conversion)); + c->kind = kind; + return c; +} + +#ifdef ENABLE_CHECKING + +/* Make sure that all memory on the conversion obstack has been + freed. */ + +void +validate_conversion_obstack (void) +{ + if (conversion_obstack_initialized) + gcc_assert ((obstack_next_free (&conversion_obstack) + == obstack_base (&conversion_obstack))); +} + +#endif /* ENABLE_CHECKING */ + +/* Dynamically allocate an array of N conversions. */ + +static conversion ** +alloc_conversions (size_t n) +{ + return (conversion **) conversion_obstack_alloc (n * sizeof (conversion *)); +} + +static conversion * +build_conv (conversion_kind code, tree type, conversion *from) +{ + conversion *t; + conversion_rank rank = CONVERSION_RANK (from); /* We can't use buildl1 here because CODE could be USER_CONV, which takes two arguments. In that case, the caller is responsible for filling in the second argument. */ - t = make_node (code); - TREE_TYPE (t) = type; - TREE_OPERAND (t, 0) = from; + t = alloc_conversion (code); + t->type = type; + t->u.next = from; switch (code) { - case PTR_CONV: - case PMEM_CONV: - case BASE_CONV: - case STD_CONV: - if (rank < STD_RANK) - rank = STD_RANK; + case ck_ptr: + case ck_pmem: + case ck_base: + case ck_std: + if (rank < cr_std) + rank = cr_std; break; - case QUAL_CONV: - if (rank < EXACT_RANK) - rank = EXACT_RANK; + case ck_qual: + if (rank < cr_exact) + rank = cr_exact; + break; default: break; } - ICS_STD_RANK (t) = rank; - ICS_USER_FLAG (t) = (code == USER_CONV || ICS_USER_FLAG (from)); - ICS_BAD_FLAG (t) = ICS_BAD_FLAG (from); + t->rank = rank; + t->user_conv_p = (code == ck_user || from->user_conv_p); + t->bad_p = from->bad_p; + t->base_p = false; return t; } +/* Build a representation of the identity conversion from EXPR to + itself. The TYPE should match the type of EXPR, if EXPR is non-NULL. */ + +static conversion * +build_identity_conv (tree type, tree expr) +{ + conversion *c; + + c = alloc_conversion (ck_identity); + c->type = type; + c->u.expr = expr; + + return c; +} + +/* Converting from EXPR to TYPE was ambiguous in the sense that there + were multiple user-defined conversions to accomplish the job. + Build a conversion that indicates that ambiguity. */ + +static conversion * +build_ambiguous_conv (tree type, tree expr) +{ + conversion *c; + + c = alloc_conversion (ck_ambig); + c->type = type; + c->u.expr = expr; + + return c; +} + tree strip_top_quals (tree t) { @@ -451,13 +580,15 @@ strip_top_quals (tree t) /* Returns the standard conversion path (see [conv]) from type FROM to type TO, if any. For proper handling of null pointer constants, you must - also pass the expression EXPR to convert from. */ + also pass the expression EXPR to convert from. If C_CAST_P is true, + this conversion is coming from a C-style cast. */ -static tree -standard_conversion (tree to, tree from, tree expr, int flags) +static conversion * +standard_conversion (tree to, tree from, tree expr, bool c_cast_p, + int flags) { enum tree_code fcode, tcode; - tree conv; + conversion *conv; bool fromref = false; to = non_reference (to); @@ -474,46 +605,51 @@ standard_conversion (tree to, tree from, tree expr, int flags) { expr = instantiate_type (to, expr, tf_conv); if (expr == error_mark_node) - return NULL_TREE; + return NULL; from = TREE_TYPE (expr); } fcode = TREE_CODE (from); tcode = TREE_CODE (to); - conv = build1 (IDENTITY_CONV, from, expr); - - if (fcode == FUNCTION_TYPE) + conv = build_identity_conv (from, expr); + if (fcode == FUNCTION_TYPE || fcode == ARRAY_TYPE) { - from = build_pointer_type (from); + from = type_decays_to (from); fcode = TREE_CODE (from); - conv = build_conv (LVALUE_CONV, from, conv); - } - else if (fcode == ARRAY_TYPE) - { - from = build_pointer_type (TREE_TYPE (from)); - fcode = TREE_CODE (from); - conv = build_conv (LVALUE_CONV, from, conv); + conv = build_conv (ck_lvalue, from, conv); } else if (fromref || (expr && lvalue_p (expr))) - conv = build_conv (RVALUE_CONV, from, conv); + { + if (expr) + { + tree bitfield_type; + bitfield_type = is_bitfield_expr_with_lowered_type (expr); + if (bitfield_type) + { + from = strip_top_quals (bitfield_type); + fcode = TREE_CODE (from); + } + } + conv = build_conv (ck_rvalue, from, conv); + } /* Allow conversion between `__complex__' data types. */ if (tcode == COMPLEX_TYPE && fcode == COMPLEX_TYPE) { /* The standard conversion sequence to convert FROM to TO is - the standard conversion sequence to perform componentwise - conversion. */ - tree part_conv = standard_conversion - (TREE_TYPE (to), TREE_TYPE (from), NULL_TREE, flags); - + the standard conversion sequence to perform componentwise + conversion. */ + conversion *part_conv = standard_conversion + (TREE_TYPE (to), TREE_TYPE (from), NULL_TREE, c_cast_p, flags); + if (part_conv) - { - conv = build_conv (TREE_CODE (part_conv), to, conv); - ICS_STD_RANK (conv) = ICS_STD_RANK (part_conv); - } + { + conv = build_conv (part_conv->kind, to, conv); + conv->rank = part_conv->rank; + } else - conv = NULL_TREE; + conv = NULL; return conv; } @@ -523,27 +659,21 @@ standard_conversion (tree to, tree from, tree expr, int flags) if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to)) && expr && null_ptr_cst_p (expr)) - conv = build_conv (STD_CONV, to, conv); - else if (tcode == POINTER_TYPE && fcode == POINTER_TYPE - && TREE_CODE (TREE_TYPE (to)) == VECTOR_TYPE - && TREE_CODE (TREE_TYPE (from)) == VECTOR_TYPE - && ((*targetm.vector_opaque_p) (TREE_TYPE (to)) - || (*targetm.vector_opaque_p) (TREE_TYPE (from)))) - conv = build_conv (STD_CONV, to, conv); + conv = build_conv (ck_std, to, conv); else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE) || (tcode == POINTER_TYPE && fcode == INTEGER_TYPE)) { /* For backwards brain damage compatibility, allow interconversion of pointers and integers with a pedwarn. */ - conv = build_conv (STD_CONV, to, conv); - ICS_BAD_FLAG (conv) = 1; + conv = build_conv (ck_std, to, conv); + conv->bad_p = true; } else if (tcode == ENUMERAL_TYPE && fcode == INTEGER_TYPE) { /* For backwards brain damage compatibility, allow interconversion of enums and integers with a pedwarn. */ - conv = build_conv (STD_CONV, to, conv); - ICS_BAD_FLAG (conv) = 1; + conv = build_conv (ck_std, to, conv); + conv->bad_p = true; } else if ((tcode == POINTER_TYPE && fcode == POINTER_TYPE) || (TYPE_PTRMEM_P (to) && TYPE_PTRMEM_P (from))) @@ -560,9 +690,9 @@ standard_conversion (tree to, tree from, tree expr, int flags) && TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE) { from = build_pointer_type - (cp_build_qualified_type (void_type_node, + (cp_build_qualified_type (void_type_node, cp_type_quals (TREE_TYPE (from)))); - conv = build_conv (PTR_CONV, from, conv); + conv = build_conv (ck_ptr, from, conv); } else if (TYPE_PTRMEM_P (from)) { @@ -574,9 +704,9 @@ standard_conversion (tree to, tree from, tree expr, int flags) (TYPE_PTRMEM_POINTED_TO_TYPE (from), TYPE_PTRMEM_POINTED_TO_TYPE (to)))) { - from = build_ptrmem_type (tbase, + from = build_ptrmem_type (tbase, TYPE_PTRMEM_POINTED_TO_TYPE (from)); - conv = build_conv (PMEM_CONV, from, conv); + conv = build_conv (ck_pmem, from, conv); } else if (!same_type_p (fbase, tbase)) return NULL; @@ -584,23 +714,36 @@ standard_conversion (tree to, tree from, tree expr, int flags) else if (IS_AGGR_TYPE (TREE_TYPE (from)) && IS_AGGR_TYPE (TREE_TYPE (to)) /* [conv.ptr] - - An rvalue of type "pointer to cv D," where D is a + + An rvalue of type "pointer to cv D," where D is a class type, can be converted to an rvalue of type "pointer to cv B," where B is a base class (clause _class.derived_) of D. If B is an inaccessible (clause _class.access_) or ambiguous (_class.member.lookup_) base class of D, a program - that necessitates this conversion is ill-formed. */ - /* Therefore, we use DERIVED_FROM_P, and not - ACESSIBLY_UNIQUELY_DERIVED_FROM_P, in this test. */ - && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))) + that necessitates this conversion is ill-formed. + Therefore, we use DERIVED_FROM_P, and do not check + access or uniqueness. */ + && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from)) + /* If FROM is not yet complete, then we must be parsing + the body of a class. We know what's derived from + what, but we can't actually perform a + derived-to-base conversion. For example, in: + + struct D : public B { + static const int i = sizeof((B*)(D*)0); + }; + + the D*-to-B* conversion is a reinterpret_cast, not a + static_cast. */ + && COMPLETE_TYPE_P (TREE_TYPE (from))) { - from = + from = cp_build_qualified_type (TREE_TYPE (to), cp_type_quals (TREE_TYPE (from))); from = build_pointer_type (from); - conv = build_conv (PTR_CONV, from, conv); + conv = build_conv (ck_ptr, from, conv); + conv->base_p = true; } if (tcode == POINTER_TYPE) @@ -616,18 +759,23 @@ standard_conversion (tree to, tree from, tree expr, int flags) if (same_type_p (from, to)) /* OK */; - else if (comp_ptr_ttypes (to_pointee, from_pointee)) - conv = build_conv (QUAL_CONV, to, conv); + else if (c_cast_p && comp_ptr_ttypes_const (to, from)) + /* In a C-style cast, we ignore CV-qualification because we + are allowed to perform a static_cast followed by a + const_cast. */ + conv = build_conv (ck_qual, to, conv); + else if (!c_cast_p && comp_ptr_ttypes (to_pointee, from_pointee)) + conv = build_conv (ck_qual, to, conv); else if (expr && string_conv_p (to, expr, 0)) /* converting from string constant to char *. */ - conv = build_conv (QUAL_CONV, to, conv); + conv = build_conv (ck_qual, to, conv); else if (ptr_reasonably_similar (to_pointee, from_pointee)) { - conv = build_conv (PTR_CONV, to, conv); - ICS_BAD_FLAG (conv) = 1; + conv = build_conv (ck_ptr, to, conv); + conv->bad_p = true; } else - return 0; + return NULL; from = to; } @@ -643,36 +791,37 @@ standard_conversion (tree to, tree from, tree expr, int flags) || !compparms (TREE_CHAIN (TYPE_ARG_TYPES (fromfn)), TREE_CHAIN (TYPE_ARG_TYPES (tofn))) || cp_type_quals (fbase) != cp_type_quals (tbase)) - return 0; + return NULL; from = cp_build_qualified_type (tbase, cp_type_quals (fbase)); - from = build_method_type_directly (from, + from = build_method_type_directly (from, TREE_TYPE (fromfn), TREE_CHAIN (TYPE_ARG_TYPES (fromfn))); from = build_ptrmemfunc_type (build_pointer_type (from)); - conv = build_conv (PMEM_CONV, from, conv); + conv = build_conv (ck_pmem, from, conv); + conv->base_p = true; } else if (tcode == BOOLEAN_TYPE) { /* [conv.bool] - An rvalue of arithmetic, enumeration, pointer, or pointer to + An rvalue of arithmetic, enumeration, pointer, or pointer to member type can be converted to an rvalue of type bool. */ if (ARITHMETIC_TYPE_P (from) || fcode == ENUMERAL_TYPE || fcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (from)) { - conv = build_conv (STD_CONV, to, conv); + conv = build_conv (ck_std, to, conv); if (fcode == POINTER_TYPE || TYPE_PTRMEM_P (from) - || (TYPE_PTRMEMFUNC_P (from) - && ICS_STD_RANK (conv) < PBOOL_RANK)) - ICS_STD_RANK (conv) = PBOOL_RANK; + || (TYPE_PTRMEMFUNC_P (from) + && conv->rank < cr_pbool)) + conv->rank = cr_pbool; return conv; } - - return NULL_TREE; + + return NULL; } /* We don't check for ENUMERAL_TYPE here because there are no standard conversions to enum type. */ @@ -680,33 +829,32 @@ standard_conversion (tree to, tree from, tree expr, int flags) || tcode == REAL_TYPE) { if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE)) - return 0; - conv = build_conv (STD_CONV, to, conv); + return NULL; + conv = build_conv (ck_std, to, conv); /* Give this a better rank if it's a promotion. */ if (same_type_p (to, type_promotes_to (from)) - && ICS_STD_RANK (TREE_OPERAND (conv, 0)) <= PROMO_RANK) - ICS_STD_RANK (conv) = PROMO_RANK; + && conv->u.next->rank <= cr_promotion) + conv->rank = cr_promotion; } else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE - && ((*targetm.vector_opaque_p) (from) - || (*targetm.vector_opaque_p) (to))) - return build_conv (STD_CONV, to, conv); + && vector_types_convertible_p (from, to)) + return build_conv (ck_std, to, conv); else if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE) && IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from) && is_properly_derived_from (from, to)) { - if (TREE_CODE (conv) == RVALUE_CONV) - conv = TREE_OPERAND (conv, 0); - conv = build_conv (BASE_CONV, to, conv); + if (conv->kind == ck_rvalue) + conv = conv->u.next; + conv = build_conv (ck_base, to, conv); /* The derived-to-base conversion indicates the initialization of a parameter with base type from an object of a derived type. A temporary object is created to hold the result of the conversion. */ - NEED_TEMPORARY_P (conv) = 1; + conv->need_temporary_p = true; } else - return 0; + return NULL; return conv; } @@ -746,12 +894,12 @@ reference_compatible_p (tree t1, tree t2) /* Determine whether or not the EXPR (of class type S) can be converted to T as in [over.match.ref]. */ -static tree +static conversion * convert_class_to_reference (tree t, tree s, tree expr) { tree conversions; tree arglist; - tree conv; + conversion *conv; tree reference_type; struct z_candidate *candidates; struct z_candidate *cand; @@ -759,7 +907,7 @@ convert_class_to_reference (tree t, tree s, tree expr) conversions = lookup_conversions (s); if (!conversions) - return NULL_TREE; + return NULL; /* [over.match.ref] @@ -783,8 +931,7 @@ convert_class_to_reference (tree t, tree s, tree expr) error messages, which we should not issue now because we are just trying to find a conversion operator. Therefore, we use NULL, cast to the appropriate type. */ - arglist = build_int_2 (0, 0); - TREE_TYPE (arglist) = build_pointer_type (s); + arglist = build_int_cst (build_pointer_type (s), 0); arglist = build_tree_list (NULL_TREE, arglist); reference_type = build_reference_type (t); @@ -797,11 +944,11 @@ convert_class_to_reference (tree t, tree s, tree expr) { tree f = OVL_CURRENT (fns); tree t2 = TREE_TYPE (TREE_TYPE (f)); - + cand = NULL; /* If this is a template function, try to get an exact - match. */ + match. */ if (TREE_CODE (f) == TEMPLATE_DECL) { cand = add_template_candidate (&candidates, @@ -813,7 +960,7 @@ convert_class_to_reference (tree t, tree s, tree expr) TREE_PURPOSE (conversions), LOOKUP_NORMAL, DEDUCE_CONV); - + if (cand) { /* Now, see if the conversion function really returns @@ -832,24 +979,25 @@ convert_class_to_reference (tree t, tree s, tree expr) } else if (TREE_CODE (t2) == REFERENCE_TYPE && reference_compatible_p (t, TREE_TYPE (t2))) - cand = add_function_candidate (&candidates, f, s, arglist, - TYPE_BINFO (s), + cand = add_function_candidate (&candidates, f, s, arglist, + TYPE_BINFO (s), TREE_PURPOSE (conversions), LOOKUP_NORMAL); - + if (cand) { + conversion *identity_conv; /* Build a standard conversion sequence indicating the binding from the reference type returned by the function to the desired REFERENCE_TYPE. */ + identity_conv + = build_identity_conv (TREE_TYPE (TREE_TYPE + (TREE_TYPE (cand->fn))), + NULL_TREE); cand->second_conv - = (direct_reference_binding - (reference_type, - build1 (IDENTITY_CONV, - TREE_TYPE (TREE_TYPE (TREE_TYPE (cand->fn))), - NULL_TREE))); - ICS_BAD_FLAG (cand->second_conv) - |= ICS_BAD_FLAG (TREE_VEC_ELT (cand->convs, 0)); + = (direct_reference_binding + (reference_type, identity_conv)); + cand->second_conv->bad_p |= cand->convs[0]->bad_p; } } conversions = TREE_CHAIN (conversions); @@ -859,11 +1007,11 @@ convert_class_to_reference (tree t, tree s, tree expr) /* If none of the conversion functions worked out, let our caller know. */ if (!any_viable_p) - return NULL_TREE; + return NULL; cand = tourney (candidates); if (!cand) - return NULL_TREE; + return NULL; /* Now that we know that this is the function we're going to use fix the dummy first argument. */ @@ -873,18 +1021,18 @@ convert_class_to_reference (tree t, tree s, tree expr) /* Build a user-defined conversion sequence representing the conversion. */ - conv = build_conv (USER_CONV, + conv = build_conv (ck_user, TREE_TYPE (TREE_TYPE (cand->fn)), - build1 (IDENTITY_CONV, TREE_TYPE (expr), expr)); - TREE_OPERAND (conv, 1) = build_zc_wrapper (cand); + build_identity_conv (TREE_TYPE (expr), expr)); + conv->cand = cand; /* Merge it with the standard conversion sequence from the conversion function's return type to the desired type. */ cand->second_conv = merge_conversion_sequences (conv, cand->second_conv); if (cand->viable == -1) - ICS_BAD_FLAG (conv) = 1; - + conv->bad_p = true; + return cand->second_conv; } @@ -892,26 +1040,25 @@ convert_class_to_reference (tree t, tree s, tree expr) expression represented by the implicit conversion sequence CONV. Return a conversion sequence for this binding. */ -static tree -direct_reference_binding (tree type, tree conv) +static conversion * +direct_reference_binding (tree type, conversion *conv) { tree t; - my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 20030306); - my_friendly_assert (TREE_CODE (TREE_TYPE (conv)) != REFERENCE_TYPE, - 20030306); + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); + gcc_assert (TREE_CODE (conv->type) != REFERENCE_TYPE); t = TREE_TYPE (type); - /* [over.ics.rank] - + /* [over.ics.rank] + When a parameter of reference type binds directly (_dcl.init.ref_) to an argument expression, the implicit conversion sequence is the identity conversion, unless the argument expression has a type that is a derived class of the parameter type, in which case the implicit conversion sequence is a derived-to-base Conversion. - + If the parameter binds directly to the result of applying a conversion function to the argument expression, the implicit conversion sequence is a user-defined conversion sequence @@ -919,28 +1066,29 @@ direct_reference_binding (tree type, tree conv) either an identity conversion or, if the conversion function returns an entity of a type that is a derived class of the parameter type, a derived-to-base conversion. */ - if (!same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (conv))) + if (!same_type_ignoring_top_level_qualifiers_p (t, conv->type)) { /* Represent the derived-to-base conversion. */ - conv = build_conv (BASE_CONV, t, conv); + conv = build_conv (ck_base, t, conv); /* We will actually be binding to the base-class subobject in the derived class, so we mark this conversion appropriately. That way, convert_like knows not to generate a temporary. */ - NEED_TEMPORARY_P (conv) = 0; + conv->need_temporary_p = false; } - return build_conv (REF_BIND, type, conv); + return build_conv (ck_ref_bind, type, conv); } /* Returns the conversion path from type FROM to reference type TO for purposes of reference binding. For lvalue binding, either pass a reference type to FROM or an lvalue expression to EXPR. If the reference will be bound to a temporary, NEED_TEMPORARY_P is set for - the conversion returned. */ + the conversion returned. If C_CAST_P is true, this + conversion is coming from a C-style cast. */ -static tree -reference_binding (tree rto, tree rfrom, tree expr, int flags) +static conversion * +reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags) { - tree conv = NULL_TREE; + conversion *conv = NULL; tree to = TREE_TYPE (rto); tree from = rfrom; bool related_p; @@ -951,7 +1099,7 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) { expr = instantiate_type (to, expr, tf_none); if (expr == error_mark_node) - return NULL_TREE; + return NULL; from = TREE_TYPE (expr); } @@ -968,20 +1116,25 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) reference compatible. We have do do this after stripping references from FROM. */ related_p = reference_related_p (to, from); + /* If this is a C cast, first convert to an appropriately qualified + type, so that we can later do a const_cast to the desired type. */ + if (related_p && c_cast_p + && !at_least_as_qualified_p (to, from)) + to = build_qualified_type (to, cp_type_quals (from)); compatible_p = reference_compatible_p (to, from); if (lvalue_p && compatible_p) { /* [dcl.init.ref] - If the initializer expression - + If the initializer expression + -- is an lvalue (but not an lvalue for a bit-field), and "cv1 T1" is reference-compatible with "cv2 T2," - + the reference is bound directly to the initializer expression lvalue. */ - conv = build1 (IDENTITY_CONV, from, expr); + conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); if ((lvalue_p & clk_bitfield) != 0 || ((lvalue_p & clk_packed) != 0 && !TYPE_PACKED (to))) @@ -996,8 +1149,8 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) reference is volatile, or isn't const, then we cannot make a temporary, so we just issue an error when the conversion actually occurs. */ - NEED_TEMPORARY_P (conv) = 1; - + conv->need_temporary_p = true; + return conv; } else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION)) @@ -1011,9 +1164,9 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) "cv1 T1" is reference-compatible with "cv3 T3". (this conversion is selected by enumerating the applicable conversion functions (_over.match.ref_) and choosing the - best one through overload resolution. (_over.match_). + best one through overload resolution. (_over.match_). - the reference is bound to the lvalue result of the conversion + the reference is bound to the lvalue result of the conversion in the second case. */ conv = convert_class_to_reference (to, from, expr); if (conv) @@ -1023,10 +1176,10 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) /* From this point on, we conceptually need temporaries, even if we elide them. Only the cases above are "direct bindings". */ if (flags & LOOKUP_NO_TEMP_BIND) - return NULL_TREE; + return NULL; /* [over.ics.rank] - + When a parameter of reference type is not bound directly to an argument expression, the conversion sequence is the one required to convert the argument expression to the underlying type of the @@ -1040,19 +1193,19 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) Otherwise, the reference shall be to a non-volatile const type. */ if (!CP_TYPE_CONST_NON_VOLATILE_P (to)) - return NULL_TREE; + return NULL; /* [dcl.init.ref] - + If the initializer expression is an rvalue, with T2 a class type, and "cv1 T1" is reference-compatible with "cv2 T2", the reference is bound in one of the following ways: - + -- The reference is bound to the object represented by the rvalue - or to a sub-object within that object. + or to a sub-object within that object. -- ... - + We use the first alternative. The implicit conversion sequence is supposed to be same as we would obtain by generating a temporary. Fortunately, if the types are reference compatible, @@ -1060,10 +1213,10 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) conversion, just as for direct binding. */ if (CLASS_TYPE_P (from) && compatible_p) { - conv = build1 (IDENTITY_CONV, from, expr); + conv = build_identity_conv (from, expr); conv = direct_reference_binding (rto, conv); if (!(flags & LOOKUP_CONSTRUCTOR_CALLABLE)) - CHECK_COPY_CONSTRUCTOR_P (TREE_OPERAND (conv, 0)) = 1; + conv->u.next->check_copy_constructor_p = true; return conv; } @@ -1075,38 +1228,41 @@ reference_binding (tree rto, tree rfrom, tree expr, int flags) T2, cv1 must be the same cv-qualification as, or greater cv-qualification than, cv2; otherwise, the program is ill-formed. */ if (related_p && !at_least_as_qualified_p (to, from)) - return NULL_TREE; + return NULL; - conv = implicit_conversion (to, from, expr, flags); + conv = implicit_conversion (to, from, expr, c_cast_p, + flags); if (!conv) - return NULL_TREE; + return NULL; - conv = build_conv (REF_BIND, rto, conv); + conv = build_conv (ck_ref_bind, rto, conv); /* This reference binding, unlike those above, requires the creation of a temporary. */ - NEED_TEMPORARY_P (conv) = 1; + conv->need_temporary_p = true; return conv; } -/* Returns the implicit conversion sequence (see [over.ics]) from type FROM - to type TO. The optional expression EXPR may affect the conversion. - FLAGS are the usual overloading flags. Only LOOKUP_NO_CONVERSION is - significant. */ +/* Returns the implicit conversion sequence (see [over.ics]) from type + FROM to type TO. The optional expression EXPR may affect the + conversion. FLAGS are the usual overloading flags. Only + LOOKUP_NO_CONVERSION is significant. If C_CAST_P is true, this + conversion is coming from a C-style cast. */ -static tree -implicit_conversion (tree to, tree from, tree expr, int flags) +static conversion * +implicit_conversion (tree to, tree from, tree expr, bool c_cast_p, + int flags) { - tree conv; + conversion *conv; if (from == error_mark_node || to == error_mark_node || expr == error_mark_node) - return NULL_TREE; + return NULL; if (TREE_CODE (to) == REFERENCE_TYPE) - conv = reference_binding (to, from, expr, flags); + conv = reference_binding (to, from, expr, c_cast_p, flags); else - conv = standard_conversion (to, from, expr, flags); + conv = standard_conversion (to, from, expr, c_cast_p, flags); if (conv) return conv; @@ -1129,22 +1285,26 @@ implicit_conversion (tree to, tree from, tree expr, int flags) return conv; } - return NULL_TREE; + return NULL; } /* Add a new entry to the list of candidates. Used by the add_*_candidate functions. */ static struct z_candidate * -add_candidate (struct z_candidate **candidates, - tree fn, tree args, tree convs, tree access_path, - tree conversion_path, int viable) +add_candidate (struct z_candidate **candidates, + tree fn, tree args, + size_t num_convs, conversion **convs, + tree access_path, tree conversion_path, + int viable) { - struct z_candidate *cand = ggc_alloc_cleared (sizeof (struct z_candidate)); + struct z_candidate *cand = (struct z_candidate *) + conversion_obstack_alloc (sizeof (struct z_candidate)); cand->fn = fn; cand->args = args; cand->convs = convs; + cand->num_convs = num_convs; cand->access_path = access_path; cand->conversion_path = conversion_path; cand->viable = viable; @@ -1162,22 +1322,22 @@ add_candidate (struct z_candidate **candidates, comes from for purposes of overload resolution. */ static struct z_candidate * -add_function_candidate (struct z_candidate **candidates, - tree fn, tree ctype, tree arglist, +add_function_candidate (struct z_candidate **candidates, + tree fn, tree ctype, tree arglist, tree access_path, tree conversion_path, int flags) { tree parmlist = TYPE_ARG_TYPES (TREE_TYPE (fn)); int i, len; - tree convs; + conversion **convs; tree parmnode, argnode; tree orig_arglist; int viable = 1; - /* Built-in functions that haven't been declared don't really - exist. */ - if (DECL_ANTICIPATED (fn)) - return NULL; + /* At this point we should not see any functions which haven't been + explicitly declared, except for friend functions which will have + been found using argument dependent lookup. */ + gcc_assert (!DECL_ANTICIPATED (fn) || DECL_HIDDEN_FRIEND_P (fn)); /* The `this', `in_chrg' and VTT arguments to constructors are not considered in overload resolution. */ @@ -1187,11 +1347,11 @@ add_function_candidate (struct z_candidate **candidates, orig_arglist = arglist; arglist = skip_artificial_parms_for (fn, arglist); } - else + else orig_arglist = arglist; len = list_length (arglist); - convs = make_tree_vec (len); + convs = alloc_conversions (len); /* 13.3.2 - Viable functions [over.match.viable] First, to be a viable function, a candidate function shall have enough @@ -1229,7 +1389,7 @@ add_function_candidate (struct z_candidate **candidates, { tree arg = TREE_VALUE (argnode); tree argtype = lvalue_type (arg); - tree t; + conversion *t; int is_this; if (parmnode == void_list_node) @@ -1259,25 +1419,26 @@ add_function_candidate (struct z_candidate **candidates, parmtype = build_pointer_type (parmtype); } - t = implicit_conversion (parmtype, argtype, arg, flags); + t = implicit_conversion (parmtype, argtype, arg, + /*c_cast_p=*/false, flags); } else { - t = build1 (IDENTITY_CONV, argtype, arg); - ICS_ELLIPSIS_FLAG (t) = 1; + t = build_identity_conv (argtype, arg); + t->ellipsis_p = true; } if (t && is_this) - ICS_THIS_FLAG (t) = 1; + t->this_p = true; - TREE_VEC_ELT (convs, i) = t; + convs[i] = t; if (! t) { viable = 0; break; } - if (ICS_BAD_FLAG (t)) + if (t->bad_p) viable = -1; if (parmnode) @@ -1286,8 +1447,8 @@ add_function_candidate (struct z_candidate **candidates, } out: - return add_candidate (candidates, fn, orig_arglist, convs, access_path, - conversion_path, viable); + return add_candidate (candidates, fn, orig_arglist, len, convs, + access_path, conversion_path, viable); } /* Create an overload candidate for the conversion function FN which will @@ -1303,18 +1464,19 @@ add_function_candidate (struct z_candidate **candidates, static struct z_candidate * add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, - tree arglist, tree access_path, tree conversion_path) + tree arglist, tree access_path, tree conversion_path) { tree totype = TREE_TYPE (TREE_TYPE (fn)); int i, len, viable, flags; - tree parmlist, convs, parmnode, argnode; + tree parmlist, parmnode, argnode; + conversion **convs; for (parmlist = totype; TREE_CODE (parmlist) != FUNCTION_TYPE; ) parmlist = TREE_TYPE (parmlist); parmlist = TYPE_ARG_TYPES (parmlist); len = list_length (arglist) + 1; - convs = make_tree_vec (len); + convs = alloc_conversions (len); parmnode = parmlist; argnode = arglist; viable = 1; @@ -1328,25 +1490,27 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, { tree arg = i == 0 ? obj : TREE_VALUE (argnode); tree argtype = lvalue_type (arg); - tree t; + conversion *t; if (i == 0) - t = implicit_conversion (totype, argtype, arg, flags); + t = implicit_conversion (totype, argtype, arg, /*c_cast_p=*/false, + flags); else if (parmnode == void_list_node) break; else if (parmnode) - t = implicit_conversion (TREE_VALUE (parmnode), argtype, arg, flags); + t = implicit_conversion (TREE_VALUE (parmnode), argtype, arg, + /*c_cast_p=*/false, flags); else { - t = build1 (IDENTITY_CONV, argtype, arg); - ICS_ELLIPSIS_FLAG (t) = 1; + t = build_identity_conv (argtype, arg); + t->ellipsis_p = true; } - TREE_VEC_ELT (convs, i) = t; + convs[i] = t; if (! t) break; - if (ICS_BAD_FLAG (t)) + if (t->bad_p) viable = -1; if (i == 0) @@ -1363,54 +1527,60 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, if (!sufficient_parms_p (parmnode)) viable = 0; - return add_candidate (candidates, totype, arglist, convs, access_path, - conversion_path, viable); + return add_candidate (candidates, totype, arglist, len, convs, + access_path, conversion_path, viable); } static void build_builtin_candidate (struct z_candidate **candidates, tree fnname, - tree type1, tree type2, tree *args, tree *argtypes, - int flags) + tree type1, tree type2, tree *args, tree *argtypes, + int flags) { - tree t, convs; + conversion *t; + conversion **convs; + size_t num_convs; int viable = 1, i; tree types[2]; types[0] = type1; types[1] = type2; - convs = make_tree_vec (args[2] ? 3 : (args[1] ? 2 : 1)); + num_convs = args[2] ? 3 : (args[1] ? 2 : 1); + convs = alloc_conversions (num_convs); for (i = 0; i < 2; ++i) { if (! args[i]) break; - t = implicit_conversion (types[i], argtypes[i], args[i], flags); + t = implicit_conversion (types[i], argtypes[i], args[i], + /*c_cast_p=*/false, flags); if (! t) { viable = 0; /* We need something for printing the candidate. */ - t = build1 (IDENTITY_CONV, types[i], NULL_TREE); + t = build_identity_conv (types[i], NULL_TREE); } - else if (ICS_BAD_FLAG (t)) + else if (t->bad_p) viable = 0; - TREE_VEC_ELT (convs, i) = t; + convs[i] = t; } /* For COND_EXPR we rearranged the arguments; undo that now. */ if (args[2]) { - TREE_VEC_ELT (convs, 2) = TREE_VEC_ELT (convs, 1); - TREE_VEC_ELT (convs, 1) = TREE_VEC_ELT (convs, 0); - t = implicit_conversion (boolean_type_node, argtypes[2], args[2], flags); + convs[2] = convs[1]; + convs[1] = convs[0]; + t = implicit_conversion (boolean_type_node, argtypes[2], args[2], + /*c_cast_p=*/false, flags); if (t) - TREE_VEC_ELT (convs, 0) = t; + convs[0] = t; else viable = 0; - } + } - add_candidate (candidates, fnname, /*args=*/NULL_TREE, convs, + add_candidate (candidates, fnname, /*args=*/NULL_TREE, + num_convs, convs, /*access_path=*/NULL_TREE, /*conversion_path=*/NULL_TREE, viable); @@ -1442,17 +1612,17 @@ promoted_arithmetic_type_p (tree type) /* Create any builtin operator overload candidates for the operator in question given the converted operand types TYPE1 and TYPE2. The other args are passed through from add_builtin_candidates to - build_builtin_candidate. - - TYPE1 and TYPE2 may not be permissible, and we must filter them. + build_builtin_candidate. + + TYPE1 and TYPE2 may not be permissible, and we must filter them. If CODE is requires candidates operands of the same type of the kind of which TYPE1 and TYPE2 are, we add both candidates CODE (TYPE1, TYPE1) and CODE (TYPE2, TYPE2). */ static void add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, - enum tree_code code2, tree fnname, tree type1, - tree type2, tree *args, tree *argtypes, int flags) + enum tree_code code2, tree fnname, tree type1, + tree type2, tree *args, tree *argtypes, int flags) { switch (code) { @@ -1513,7 +1683,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, && (TYPE_PTROB_P (type1) || TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)) break; - return; + return; /* 9 For every type T, there exist candidate operator functions of the form T* operator+(T*); @@ -1523,7 +1693,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, T operator+(T); T operator-(T); */ - case CONVERT_EXPR: /* unary + */ + case UNARY_PLUS_EXPR: /* unary + */ if (TREE_CODE (type1) == POINTER_TYPE) break; case NEGATE_EXPR: @@ -1640,17 +1810,22 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, case MAX_EXPR: case MIN_EXPR: if (ARITHMETIC_TYPE_P (type1) && ARITHMETIC_TYPE_P (type2)) - break; + break; if (TYPE_PTR_P (type1) && TYPE_PTR_P (type2)) break; - if (TREE_CODE (type1) == ENUMERAL_TYPE && TREE_CODE (type2) == ENUMERAL_TYPE) - break; - if (TYPE_PTR_P (type1) && null_ptr_cst_p (args[1])) + if (TREE_CODE (type1) == ENUMERAL_TYPE + && TREE_CODE (type2) == ENUMERAL_TYPE) + break; + if (TYPE_PTR_P (type1) + && null_ptr_cst_p (args[1]) + && !uses_template_parms (type1)) { type2 = type1; break; } - if (null_ptr_cst_p (args[0]) && TYPE_PTR_P (type2)) + if (null_ptr_cst_p (args[0]) + && TYPE_PTR_P (type2) + && !uses_template_parms (type2)) { type1 = type2; break; @@ -1772,7 +1947,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, return; default: - abort (); + gcc_unreachable (); } type1 = build_reference_type (type1); break; @@ -1781,9 +1956,9 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, /* [over.built] For every pair of promoted arithmetic types L and R, there - exist candidate operator functions of the form + exist candidate operator functions of the form - LR operator?(bool, L, R); + LR operator?(bool, L, R); where LR is the result of the usual arithmetic conversions between types L and R. @@ -1801,7 +1976,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, if (!(TYPE_PTR_P (type1) || TYPE_PTR_TO_MEMBER_P (type1)) || !(TYPE_PTR_P (type2) || TYPE_PTR_TO_MEMBER_P (type2))) return; - + /* We don't check that the two types are the same; the logic below will actually create two candidates; one in which both parameter types are TYPE1, and one in which both parameter @@ -1809,7 +1984,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, break; default: - abort (); + gcc_unreachable (); } /* If we're dealing with two pointer types or two enumeral types, @@ -1851,7 +2026,7 @@ type_decays_to (tree type) one of the input types converts to. 3) arithmetic candidates. According to the standard, we should generate all of these, but I'm trying not to... - + Here we generate a superset of the possible candidates for this particular case. That is a subset of the full set the standard defines, plus some other cases which the standard disallows. add_builtin_candidate will @@ -1859,8 +2034,8 @@ type_decays_to (tree type) static void add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, - enum tree_code code2, tree fnname, tree *args, - int flags) + enum tree_code code2, tree fnname, tree *args, + int flags) { int ref1, i; int enum_p = 0; @@ -1926,7 +2101,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, case GE_EXPR: enum_p = 1; /* Fall through. */ - + default: ref1 = 0; } @@ -1975,8 +2150,8 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, if (i != 0 || ! ref1) { type = TYPE_MAIN_VARIANT (type_decays_to (type)); - if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) - types[i] = tree_cons (NULL_TREE, type, types[i]); + if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) + types[i] = tree_cons (NULL_TREE, type, types[i]); if (INTEGRAL_TYPE_P (type)) type = type_promotes_to (type); } @@ -1995,7 +2170,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, { type = TYPE_MAIN_VARIANT (type_decays_to (type)); if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE) - types[i] = tree_cons (NULL_TREE, type, types[i]); + types[i] = tree_cons (NULL_TREE, type, types[i]); if (INTEGRAL_TYPE_P (type)) type = type_promotes_to (type); } @@ -2017,8 +2192,6 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, (candidates, code, code2, fnname, TREE_VALUE (types[0]), NULL_TREE, args, argtypes, flags); } - - return; } @@ -2034,10 +2207,10 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code, static struct z_candidate* add_template_candidate_real (struct z_candidate **candidates, tree tmpl, - tree ctype, tree explicit_targs, tree arglist, - tree return_type, tree access_path, + tree ctype, tree explicit_targs, tree arglist, + tree return_type, tree access_path, tree conversion_path, int flags, tree obj, - unification_kind_t strict) + unification_kind_t strict) { int ntparms = DECL_NTPARMS (tmpl); tree targs = make_tree_vec (ntparms); @@ -2053,12 +2226,12 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, if ((DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (tmpl) || DECL_BASE_CONSTRUCTOR_P (tmpl)) - && TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (tmpl))) + && CLASSTYPE_VBASECLASSES (DECL_CONTEXT (tmpl))) args_without_in_chrg = TREE_CHAIN (args_without_in_chrg); i = fn_type_unification (tmpl, explicit_targs, targs, args_without_in_chrg, - return_type, strict, -1); + return_type, strict, flags); if (i != 0) return NULL; @@ -2070,26 +2243,26 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, /* In [class.copy]: A member function template is never instantiated to perform the - copy of a class object to an object of its class type. + copy of a class object to an object of its class type. It's a little unclear what this means; the standard explicitly does allow a template to be used to copy a class. For example, in: struct A { - A(A&); + A(A&); template A(const T&); }; const A f (); void g () { A a (f ()); } - + the member template will be used to make the copy. The section quoted above appears in the paragraph that forbids constructors whose only parameter is (a possibly cv-qualified variant of) the class type, and a logical interpretation is that the intent was to forbid the instantiation of member templates which would then have that form. */ - if (DECL_CONSTRUCTOR_P (fn) && list_length (arglist) == 2) + if (DECL_CONSTRUCTOR_P (fn) && list_length (arglist) == 2) { tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (fn); if (arg_types && same_type_p (TYPE_MAIN_VARIANT (TREE_VALUE (arg_types)), @@ -2103,7 +2276,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, conversion_path, arglist); else cand = add_function_candidate (candidates, fn, ctype, - arglist, access_path, + arglist, access_path, conversion_path, flags); if (DECL_TI_TEMPLATE (fn) != tmpl) /* This situation can occur if a member template of a template @@ -2123,9 +2296,9 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, for this will point at template template <> S::f(int), so that we can find the definition. For the purposes of overload resolution, however, we want the original TMPL. */ - cand->template = tree_cons (tmpl, targs, NULL_TREE); + cand->template_decl = tree_cons (tmpl, targs, NULL_TREE); else - cand->template = DECL_TEMPLATE_INFO (fn); + cand->template_decl = DECL_TEMPLATE_INFO (fn); return cand; } @@ -2133,13 +2306,13 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, static struct z_candidate * add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, - tree explicit_targs, tree arglist, tree return_type, - tree access_path, tree conversion_path, int flags, - unification_kind_t strict) + tree explicit_targs, tree arglist, tree return_type, + tree access_path, tree conversion_path, int flags, + unification_kind_t strict) { - return + return add_template_candidate_real (candidates, tmpl, ctype, - explicit_targs, arglist, return_type, + explicit_targs, arglist, return_type, access_path, conversion_path, flags, NULL_TREE, strict); } @@ -2147,10 +2320,10 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, static struct z_candidate * add_template_conv_candidate (struct z_candidate **candidates, tree tmpl, - tree obj, tree arglist, tree return_type, + tree obj, tree arglist, tree return_type, tree access_path, tree conversion_path) { - return + return add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE, arglist, return_type, access_path, conversion_path, 0, obj, DEDUCE_CONV); @@ -2175,8 +2348,8 @@ splice_viable (struct z_candidate *cands, last_viable = &viable; *any_viable_p = false; - cand = &cands; - while (*cand) + cand = &cands; + while (*cand) { struct z_candidate *c = *cand; if (strict_p ? c->viable == 1 : c->viable) @@ -2243,25 +2416,25 @@ print_z_candidate (const char *msgstr, struct z_candidate *candidate) { if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE) { - if (TREE_VEC_LENGTH (candidate->convs) == 3) + if (candidate->num_convs == 3) inform ("%s %D(%T, %T, %T) ", msgstr, candidate->fn, - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)), - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1)), - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 2))); - else if (TREE_VEC_LENGTH (candidate->convs) == 2) + candidate->convs[0]->type, + candidate->convs[1]->type, + candidate->convs[2]->type); + else if (candidate->num_convs == 2) inform ("%s %D(%T, %T) ", msgstr, candidate->fn, - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)), - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1))); + candidate->convs[0]->type, + candidate->convs[1]->type); else inform ("%s %D(%T) ", msgstr, candidate->fn, - TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0))); + candidate->convs[0]->type); } else if (TYPE_P (candidate->fn)) inform ("%s %T ", msgstr, candidate->fn); else if (candidate->viable == -1) - inform ("%J%s %+#D ", candidate->fn, msgstr, candidate->fn); + inform ("%s %+#D ", msgstr, candidate->fn); else - inform ("%J%s %+#D", candidate->fn, msgstr, candidate->fn); + inform ("%s %+#D", msgstr, candidate->fn); } static void @@ -2303,7 +2476,7 @@ print_z_candidates (struct z_candidate *candidates) /* Indent successive candidates by the width of the translation of the above string. */ size_t len = gcc_gettext_width (str) + 1; - char *spaces = alloca (len); + char *spaces = (char *) alloca (len); memset (spaces, ' ', len-1); spaces[len - 1] = '\0'; @@ -2320,28 +2493,27 @@ print_z_candidates (struct z_candidate *candidates) /* USER_SEQ is a user-defined conversion sequence, beginning with a USER_CONV. STD_SEQ is the standard conversion sequence applied to the result of the conversion function to convert it to the final - desired type. Merge the the two sequences into a single sequence, + desired type. Merge the two sequences into a single sequence, and return the merged sequence. */ -static tree -merge_conversion_sequences (tree user_seq, tree std_seq) +static conversion * +merge_conversion_sequences (conversion *user_seq, conversion *std_seq) { - tree *t; + conversion **t; - my_friendly_assert (TREE_CODE (user_seq) == USER_CONV, - 20030306); + gcc_assert (user_seq->kind == ck_user); /* Find the end of the second conversion sequence. */ - t = &(std_seq); - while (TREE_CODE (*t) != IDENTITY_CONV) - t = &TREE_OPERAND (*t, 0); + t = &(std_seq); + while ((*t)->kind != ck_identity) + t = &((*t)->u.next); /* Replace the identity conversion with the user conversion sequence. */ *t = user_seq; /* The entire sequence is a user-conversion sequence. */ - ICS_USER_FLAG (std_seq) = 1; + std_seq->user_conv_p = true; return std_seq; } @@ -2357,23 +2529,23 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) { struct z_candidate *candidates, *cand; tree fromtype = TREE_TYPE (expr); - tree ctors = NULL_TREE, convs = NULL_TREE; + tree ctors = NULL_TREE; + tree conv_fns = NULL_TREE; + conversion *conv = NULL; tree args = NULL_TREE; bool any_viable_p; /* We represent conversion within a hierarchy using RVALUE_CONV and BASE_CONV, as specified by [over.best.ics]; these become plain constructor calls, as specified in [dcl.init]. */ - my_friendly_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype) - || !DERIVED_FROM_P (totype, fromtype), 20011226); + gcc_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype) + || !DERIVED_FROM_P (totype, fromtype)); if (IS_AGGR_TYPE (totype)) - ctors = lookup_fnfields (TYPE_BINFO (totype), - complete_ctor_identifier, - 0); + ctors = lookup_fnfields (totype, complete_ctor_identifier, 0); if (IS_AGGR_TYPE (fromtype)) - convs = lookup_conversions (fromtype); + conv_fns = lookup_conversions (fromtype); candidates = 0; flags |= LOOKUP_NO_CONVERSION; @@ -2384,14 +2556,12 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) ctors = BASELINK_FUNCTIONS (ctors); - t = build_int_2 (0, 0); - TREE_TYPE (t) = build_pointer_type (totype); + t = build_int_cst (build_pointer_type (totype), 0); args = build_tree_list (NULL_TREE, expr); /* We should never try to call the abstract or base constructor from here. */ - my_friendly_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)) - && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)), - 20011226); + gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)) + && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors))); args = tree_cons (NULL_TREE, t, args); } for (; ctors; ctors = OVL_NEXT (ctors)) @@ -2400,30 +2570,30 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) if (DECL_NONCONVERTING_P (ctor)) continue; - if (TREE_CODE (ctor) == TEMPLATE_DECL) + if (TREE_CODE (ctor) == TEMPLATE_DECL) cand = add_template_candidate (&candidates, ctor, totype, - NULL_TREE, args, NULL_TREE, + NULL_TREE, args, NULL_TREE, TYPE_BINFO (totype), TYPE_BINFO (totype), flags, DEDUCE_CALL); - else + else cand = add_function_candidate (&candidates, ctor, totype, - args, TYPE_BINFO (totype), + args, TYPE_BINFO (totype), TYPE_BINFO (totype), - flags); + flags); if (cand) - cand->second_conv = build1 (IDENTITY_CONV, totype, NULL_TREE); + cand->second_conv = build_identity_conv (totype, NULL_TREE); } - if (convs) + if (conv_fns) args = build_tree_list (NULL_TREE, build_this (expr)); - for (; convs; convs = TREE_CHAIN (convs)) + for (; conv_fns; conv_fns = TREE_CHAIN (conv_fns)) { tree fns; - tree conversion_path = TREE_PURPOSE (convs); + tree conversion_path = TREE_PURPOSE (conv_fns); int convflags = LOOKUP_NO_CONVERSION; /* If we are called to convert to a reference type, we are trying to @@ -2432,11 +2602,11 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) look for a temporary binding. */ if (TREE_CODE (totype) == REFERENCE_TYPE) convflags |= LOOKUP_NO_TEMP_BIND; - - for (fns = TREE_VALUE (convs); fns; fns = OVL_NEXT (fns)) + + for (fns = TREE_VALUE (conv_fns); fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); - + /* [over.match.funcs] For conversion functions, the function is considered to be a member of the class of the implicit object argument for the purpose of defining the type of @@ -2445,31 +2615,33 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) So we pass fromtype as CTYPE to add_*_candidate. */ if (TREE_CODE (fn) == TEMPLATE_DECL) - cand = add_template_candidate (&candidates, fn, fromtype, + cand = add_template_candidate (&candidates, fn, fromtype, NULL_TREE, - args, totype, - TYPE_BINFO (fromtype), + args, totype, + TYPE_BINFO (fromtype), conversion_path, flags, DEDUCE_CONV); - else + else cand = add_function_candidate (&candidates, fn, fromtype, args, TYPE_BINFO (fromtype), conversion_path, - flags); + flags); if (cand) { - tree ics = implicit_conversion (totype, - TREE_TYPE (TREE_TYPE (cand->fn)), - 0, convflags); + conversion *ics + = implicit_conversion (totype, + TREE_TYPE (TREE_TYPE (cand->fn)), + 0, + /*c_cast_p=*/false, convflags); cand->second_conv = ics; - - if (ics == NULL_TREE) + + if (!ics) cand->viable = 0; - else if (candidates->viable == 1 && ICS_BAD_FLAG (ics)) + else if (candidates->viable == 1 && ics->bad_p) cand->viable = -1; } } @@ -2477,23 +2649,23 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) - return 0; + return NULL; cand = tourney (candidates); if (cand == 0) { if (flags & LOOKUP_COMPLAIN) { - error ("conversion from `%T' to `%T' is ambiguous", + error ("conversion from %qT to %qT is ambiguous", fromtype, totype); print_z_candidates (candidates); } cand = candidates; /* any one will do */ - cand->second_conv = build1 (AMBIG_CONV, totype, expr); - ICS_USER_FLAG (cand->second_conv) = 1; + cand->second_conv = build_ambiguous_conv (totype, expr); + cand->second_conv->user_conv_p = true; if (!any_strictly_viable (candidates)) - ICS_BAD_FLAG (cand->second_conv) = 1; + cand->second_conv->bad_p = true; /* If there are viable candidates, don't set ICS_BAD_FLAG; an ambiguous conversion is no worse than another user-defined conversion. */ @@ -2502,19 +2674,19 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) } /* Build the user conversion sequence. */ - convs = build_conv - (USER_CONV, + conv = build_conv + (ck_user, (DECL_CONSTRUCTOR_P (cand->fn) ? totype : non_reference (TREE_TYPE (TREE_TYPE (cand->fn)))), - build1 (IDENTITY_CONV, TREE_TYPE (expr), expr)); - TREE_OPERAND (convs, 1) = build_zc_wrapper (cand); + build_identity_conv (TREE_TYPE (expr), expr)); + conv->cand = cand; /* Combine it with the second conversion sequence. */ - cand->second_conv = merge_conversion_sequences (convs, + cand->second_conv = merge_conversion_sequences (conv, cand->second_conv); if (cand->viable == -1) - ICS_BAD_FLAG (cand->second_conv) = 1; + cand->second_conv->bad_p = true; return cand; } @@ -2527,9 +2699,10 @@ build_user_type_conversion (tree totype, tree expr, int flags) if (cand) { - if (TREE_CODE (cand->second_conv) == AMBIG_CONV) + if (cand->second_conv->kind == ck_ambig) return error_mark_node; - return convert_from_reference (convert_like (cand->second_conv, expr)); + expr = convert_like (cand->second_conv, expr); + return convert_from_reference (expr); } return NULL_TREE; } @@ -2543,7 +2716,7 @@ resolve_args (tree args) for (t = args; t; t = TREE_CHAIN (t)) { tree arg = TREE_VALUE (t); - + if (error_operand_p (arg)) return error_mark_node; else if (VOID_TYPE_P (TREE_TYPE (arg))) @@ -2551,8 +2724,8 @@ resolve_args (tree args) error ("invalid use of void expression"); return error_mark_node; } - arg = convert_from_reference (arg); - TREE_VALUE (t) = arg; + else if (invalid_nonstatic_memfn_p (arg)) + return error_mark_node; } return args; } @@ -2564,14 +2737,14 @@ resolve_args (tree args) that overload resolution fails, *CANDIDATES will be the set of candidates considered, and ANY_VIABLE_P will be set to true or false to indicate whether or not any of the candidates were - viable. + viable. The ARGS should already have gone through RESOLVE_ARGS before this function is called. */ static struct z_candidate * -perform_overload_resolution (tree fn, - tree args, +perform_overload_resolution (tree fn, + tree args, struct z_candidate **candidates, bool *any_viable_p) { @@ -2583,13 +2756,11 @@ perform_overload_resolution (tree fn, *any_viable_p = true; /* Check FN and ARGS. */ - my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL - || TREE_CODE (fn) == TEMPLATE_DECL - || TREE_CODE (fn) == OVERLOAD - || TREE_CODE (fn) == TEMPLATE_ID_EXPR, - 20020712); - my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST, - 20020712); + gcc_assert (TREE_CODE (fn) == FUNCTION_DECL + || TREE_CODE (fn) == TEMPLATE_DECL + || TREE_CODE (fn) == OVERLOAD + || TREE_CODE (fn) == TEMPLATE_ID_EXPR); + gcc_assert (!args || TREE_CODE (args) == TREE_LIST); if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) { @@ -2615,17 +2786,38 @@ perform_overload_resolution (tree fn, /* Return an expression for a call to FN (a namespace-scope function, or a static member function) with the ARGS. */ - + tree -build_new_function_call (tree fn, tree args) +build_new_function_call (tree fn, tree args, bool koenig_p) { struct z_candidate *candidates, *cand; bool any_viable_p; + void *p; + tree result; args = resolve_args (args); if (args == error_mark_node) return error_mark_node; + /* If this function was found without using argument dependent + lookup, then we want to ignore any undeclared friend + functions. */ + if (!koenig_p) + { + tree orig_fn = fn; + + fn = remove_hidden_names (fn); + if (!fn) + { + error ("no matching function for call to %<%D(%A)%>", + DECL_NAME (OVL_CURRENT (orig_fn)), args); + return error_mark_node; + } + } + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + cand = perform_overload_resolution (fn, args, &candidates, &any_viable_p); if (!cand) @@ -2635,17 +2827,22 @@ build_new_function_call (tree fn, tree args) if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) fn = TREE_OPERAND (fn, 0); if (!any_viable_p) - error ("no matching function for call to `%D(%A)'", + error ("no matching function for call to %<%D(%A)%>", DECL_NAME (OVL_CURRENT (fn)), args); else - error ("call of overloaded `%D(%A)' is ambiguous", + error ("call of overloaded %<%D(%A)%> is ambiguous", DECL_NAME (OVL_CURRENT (fn)), args); if (candidates) print_z_candidates (candidates); - return error_mark_node; + result = error_mark_node; } + else + result = build_over_call (cand, LOOKUP_NORMAL); - return build_over_call (cand, LOOKUP_NORMAL); + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return result; } /* Build a call to a global operator new. FNNAME is the name of the @@ -2654,35 +2851,49 @@ build_new_function_call (tree fn, tree args) required by the allocation, and is updated if that is changed here. *COOKIE_SIZE is non-NULL if a cookie should be used. If this function determines that no cookie should be used, after all, - *COOKIE_SIZE is set to NULL_TREE. */ + *COOKIE_SIZE is set to NULL_TREE. If FN is non-NULL, it will be + set, upon return, to the allocation function called. */ tree -build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size) +build_operator_new_call (tree fnname, tree args, + tree *size, tree *cookie_size, + tree *fn) { tree fns; struct z_candidate *candidates; struct z_candidate *cand; bool any_viable_p; + if (fn) + *fn = NULL_TREE; args = tree_cons (NULL_TREE, *size, args); args = resolve_args (args); if (args == error_mark_node) return args; - fns = lookup_function_nonclass (fnname, args); + /* Based on: + + [expr.new] + + If this lookup fails to find the name, or if the allocated type + is not a class type, the allocation function's name is looked + up in the global scope. + + we disregard block-scope declarations of "operator new". */ + fns = lookup_function_nonclass (fnname, args, /*block_p=*/false); /* Figure out what function is being called. */ cand = perform_overload_resolution (fns, args, &candidates, &any_viable_p); - + /* If no suitable function could be found, issue an error message and give up. */ if (!cand) { if (!any_viable_p) - error ("no matching function for call to `%D(%A)'", + error ("no matching function for call to %<%D(%A)%>", DECL_NAME (OVL_CURRENT (fns)), args); else - error ("call of overloaded `%D(%A)' is ambiguous", + error ("call of overloaded %<%D(%A)%> is ambiguous", DECL_NAME (OVL_CURRENT (fns)), args); if (candidates) print_z_candidates (candidates); @@ -2714,7 +2925,7 @@ build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size) /* Skip the size_t parameter. */ arg_types = TREE_CHAIN (arg_types); /* Check the remaining parameters (if any). */ - if (arg_types + if (arg_types && TREE_CHAIN (arg_types) == void_list_node && same_type_p (TREE_VALUE (arg_types), ptr_type_node)) @@ -2732,6 +2943,10 @@ build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size) *cookie_size = NULL_TREE; } + /* Tell our caller which function we decided to call. */ + if (fn) + *fn = cand->fn; + /* Build the CALL_EXPR. */ return build_over_call (cand, LOOKUP_NORMAL); } @@ -2743,6 +2958,8 @@ build_object_call (tree obj, tree args) tree fns, convs, mem_args = NULL_TREE; tree type = TREE_TYPE (obj); bool any_viable_p; + tree result = NULL_TREE; + void *p; if (TYPE_PTRMEMFUNC_P (type)) { @@ -2752,15 +2969,23 @@ build_object_call (tree obj, tree args) return error_mark_node; } - fns = lookup_fnfields (TYPE_BINFO (type), ansi_opname (CALL_EXPR), 1); - if (fns == error_mark_node) - return error_mark_node; + if (TYPE_BINFO (type)) + { + fns = lookup_fnfields (TYPE_BINFO (type), ansi_opname (CALL_EXPR), 1); + if (fns == error_mark_node) + return error_mark_node; + } + else + fns = NULL_TREE; args = resolve_args (args); if (args == error_mark_node) return error_mark_node; + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + if (fns) { tree base = BINFO_TYPE (BASELINK_BINFO (fns)); @@ -2771,7 +2996,7 @@ build_object_call (tree obj, tree args) tree fn = OVL_CURRENT (fns); if (TREE_CODE (fn) == TEMPLATE_DECL) add_template_candidate (&candidates, fn, base, NULL_TREE, - mem_args, NULL_TREE, + mem_args, NULL_TREE, TYPE_BINFO (type), TYPE_BINFO (type), LOOKUP_NORMAL, DEDUCE_CALL); @@ -2799,8 +3024,8 @@ build_object_call (tree obj, tree args) for (; fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); - if (TREE_CODE (fn) == TEMPLATE_DECL) - add_template_conv_candidate + if (TREE_CODE (fn) == TEMPLATE_DECL) + add_template_conv_candidate (&candidates, fn, obj, args, totype, /*access_path=*/NULL_TREE, /*conversion_path=*/NULL_TREE); @@ -2814,36 +3039,42 @@ build_object_call (tree obj, tree args) candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { - error ("no match for call to `(%T) (%A)'", TREE_TYPE (obj), args); + error ("no match for call to %<(%T) (%A)%>", TREE_TYPE (obj), args); print_z_candidates (candidates); - return error_mark_node; + result = error_mark_node; } - - cand = tourney (candidates); - if (cand == 0) + else { - error ("call of `(%T) (%A)' is ambiguous", TREE_TYPE (obj), args); - print_z_candidates (candidates); - return error_mark_node; + cand = tourney (candidates); + if (cand == 0) + { + error ("call of %<(%T) (%A)%> is ambiguous", TREE_TYPE (obj), args); + print_z_candidates (candidates); + result = error_mark_node; + } + /* Since cand->fn will be a type, not a function, for a conversion + function, we must be careful not to unconditionally look at + DECL_NAME here. */ + else if (TREE_CODE (cand->fn) == FUNCTION_DECL + && DECL_OVERLOADED_OPERATOR_P (cand->fn) == CALL_EXPR) + result = build_over_call (cand, LOOKUP_NORMAL); + else + { + obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1); + obj = convert_from_reference (obj); + result = build_function_call (obj, args); + } } - /* Since cand->fn will be a type, not a function, for a conversion - function, we must be careful not to unconditionally look at - DECL_NAME here. */ - if (TREE_CODE (cand->fn) == FUNCTION_DECL - && DECL_OVERLOADED_OPERATOR_P (cand->fn) == CALL_EXPR) - return build_over_call (cand, LOOKUP_NORMAL); + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); - obj = convert_like_with_context - (TREE_VEC_ELT (cand->convs, 0), obj, cand->fn, -1); - - /* FIXME */ - return build_function_call (obj, args); + return result; } static void op_error (enum tree_code code, enum tree_code code2, - tree arg1, tree arg2, tree arg3, const char *problem) + tree arg1, tree arg2, tree arg3, const char *problem) { const char *opname; @@ -2855,31 +3086,31 @@ op_error (enum tree_code code, enum tree_code code2, switch (code) { case COND_EXPR: - error ("%s for ternary 'operator?:' in '%E ? %E : %E'", - problem, arg1, arg2, arg3); + error ("%s for ternary % in %<%E ? %E : %E%>", + problem, arg1, arg2, arg3); break; - + case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: - error ("%s for 'operator%s' in '%E%s'", problem, opname, arg1, opname); + error ("%s for % in %<%E%s%>", problem, opname, arg1, opname); break; - + case ARRAY_REF: - error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2); + error ("%s for % in %<%E[%E]%>", problem, arg1, arg2); break; case REALPART_EXPR: case IMAGPART_EXPR: - error ("%s for '%s' in '%s %E'", problem, opname, opname, arg1); + error ("%s for %qs in %<%s %E%>", problem, opname, opname, arg1); break; - + default: if (arg2) - error ("%s for 'operator%s' in '%E %s %E'", - problem, opname, arg1, opname, arg2); + error ("%s for % in %<%E %s %E%>", + problem, opname, arg1, opname, arg2); else - error ("%s for 'operator%s' in '%s%E'", - problem, opname, opname, arg1); + error ("%s for % in %<%s%E%>", + problem, opname, opname, arg1); break; } } @@ -2887,12 +3118,12 @@ op_error (enum tree_code code, enum tree_code code2, /* Return the implicit conversion sequence that could be used to convert E1 to E2 in [expr.cond]. */ -static tree +static conversion * conditional_conversion (tree e1, tree e2) { tree t1 = non_reference (TREE_TYPE (e1)); tree t2 = non_reference (TREE_TYPE (e2)); - tree conv; + conversion *conv; bool good_base; /* [expr.cond] @@ -2903,9 +3134,10 @@ conditional_conversion (tree e1, tree e2) reference must bind directly (_dcl.init.ref_) to E1. */ if (real_lvalue_p (e2)) { - conv = implicit_conversion (build_reference_type (t2), + conv = implicit_conversion (build_reference_type (t2), t1, e1, + /*c_cast_p=*/false, LOOKUP_NO_TEMP_BIND); if (conv) return conv; @@ -2926,16 +3158,16 @@ conditional_conversion (tree e1, tree e2) { if (good_base && at_least_as_qualified_p (t2, t1)) { - conv = build1 (IDENTITY_CONV, t1, e1); - if (!same_type_p (TYPE_MAIN_VARIANT (t1), + conv = build_identity_conv (t1, e1); + if (!same_type_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2))) - conv = build_conv (BASE_CONV, t2, conv); + conv = build_conv (ck_base, t2, conv); else - conv = build_conv (RVALUE_CONV, t2, conv); + conv = build_conv (ck_rvalue, t2, conv); return conv; } else - return NULL_TREE; + return NULL; } else /* [expr.cond] @@ -2943,7 +3175,8 @@ conditional_conversion (tree e1, tree e2) Otherwise: E1 can be converted to match E2 if E1 can be implicitly converted to the type that expression E2 would have if E2 were converted to an rvalue (or the type it has, if E2 is an rvalue). */ - return implicit_conversion (t2, t1, e1, LOOKUP_NORMAL); + return implicit_conversion (t2, t1, e1, /*c_cast_p=*/false, + LOOKUP_NORMAL); } /* Implement [expr.cond]. ARG1, ARG2, and ARG3 are the three @@ -2954,11 +3187,12 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) { tree arg2_type; tree arg3_type; - tree result; + tree result = NULL_TREE; tree result_type = NULL_TREE; bool lvalue_p = true; struct z_candidate *candidates = 0; struct z_candidate *cand; + void *p; /* As a G++ extension, the second argument to the conditional can be omitted. (So that `a ? : c' is roughly equivalent to `a ? a : @@ -2977,7 +3211,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) } /* [expr.cond] - + The first expr ession is implicitly converted to bool (clause _conv_). */ arg1 = perform_implicit_conversion (boolean_type_node, arg1); @@ -2996,8 +3230,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) array-to-pointer (_conv.array_), and function-to-pointer (_conv.func_) standard conversions are performed on the second and third operands. */ - arg2_type = TREE_TYPE (arg2); - arg3_type = TREE_TYPE (arg3); + arg2_type = unlowered_expr_type (arg2); + arg3_type = unlowered_expr_type (arg3); if (VOID_TYPE_P (arg2_type) || VOID_TYPE_P (arg3_type)) { /* Do the conversions. We don't these for `void' type arguments @@ -3019,12 +3253,12 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) type of the other and is an rvalue. --Both the second and the third operands have type void; the - result is of type void and is an rvalue. + result is of type void and is an rvalue. - We must avoid calling force_rvalue for expressions of type + We must avoid calling force_rvalue for expressions of type "void" because it will complain that their value is being - used. */ - if (TREE_CODE (arg2) == THROW_EXPR + used. */ + if (TREE_CODE (arg2) == THROW_EXPR && TREE_CODE (arg3) != THROW_EXPR) { if (!VOID_TYPE_P (arg3_type)) @@ -3032,7 +3266,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) arg3_type = TREE_TYPE (arg3); result_type = arg3_type; } - else if (TREE_CODE (arg2) != THROW_EXPR + else if (TREE_CODE (arg2) != THROW_EXPR && TREE_CODE (arg3) == THROW_EXPR) { if (!VOID_TYPE_P (arg2_type)) @@ -3044,7 +3278,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) result_type = void_type_node; else { - error ("`%E' has type `void' and is not a throw-expression", + error ("%qE has type % and is not a throw-expression", VOID_TYPE_P (arg2_type) ? arg2 : arg3); return error_mark_node; } @@ -3060,9 +3294,15 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) else if (!same_type_p (arg2_type, arg3_type) && (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type))) { - tree conv2 = conditional_conversion (arg2, arg3); - tree conv3 = conditional_conversion (arg3, arg2); - + conversion *conv2; + conversion *conv3; + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + + conv2 = conditional_conversion (arg2, arg3); + conv3 = conditional_conversion (arg3, arg2); + /* [expr.cond] If both can be converted, or one can be converted but the @@ -3072,30 +3312,46 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) one conversion is possible, that conversion is applied to the chosen operand and the converted operand is used in place of the original operand for the remainder of this section. */ - if ((conv2 && !ICS_BAD_FLAG (conv2) - && conv3 && !ICS_BAD_FLAG (conv3)) - || (conv2 && TREE_CODE (conv2) == AMBIG_CONV) - || (conv3 && TREE_CODE (conv3) == AMBIG_CONV)) + if ((conv2 && !conv2->bad_p + && conv3 && !conv3->bad_p) + || (conv2 && conv2->kind == ck_ambig) + || (conv3 && conv3->kind == ck_ambig)) { - error ("operands to ?: have different types"); - return error_mark_node; + error ("operands to ?: have different types %qT and %qT", + arg2_type, arg3_type); + result = error_mark_node; } - else if (conv2 && !ICS_BAD_FLAG (conv2)) + else if (conv2 && (!conv2->bad_p || !conv3)) { arg2 = convert_like (conv2, arg2); arg2 = convert_from_reference (arg2); arg2_type = TREE_TYPE (arg2); + /* Even if CONV2 is a valid conversion, the result of the + conversion may be invalid. For example, if ARG3 has type + "volatile X", and X does not have a copy constructor + accepting a "volatile X&", then even if ARG2 can be + converted to X, the conversion will fail. */ + if (error_operand_p (arg2)) + result = error_mark_node; } - else if (conv3 && !ICS_BAD_FLAG (conv3)) + else if (conv3 && (!conv3->bad_p || !conv2)) { arg3 = convert_like (conv3, arg3); arg3 = convert_from_reference (arg3); arg3_type = TREE_TYPE (arg3); + if (error_operand_p (arg3)) + result = error_mark_node; } + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + if (result) + return result; + /* If, after the conversion, both operands have class type, treat the cv-qualification of both operands as if it were the - union of the cv-qualification of the operands. + union of the cv-qualification of the operands. The standard is not clear about what to do in this circumstance. For example, if the first operand has type @@ -3103,7 +3359,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) conversion to "volatile X", what is the type of the second operand after this step? Making it be "const X" (matching the first operand) seems wrong, as that discards the - qualification without actuall performing a copy. Leaving it + qualification without actually performing a copy. Leaving it as "volatile X" seems wrong as that will result in the conditional expression failing altogether, even though, according to this step, the one operand could be converted to @@ -3111,7 +3367,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if ((conv2 || conv3) && CLASS_TYPE_P (arg2_type) && TYPE_QUALS (arg2_type) != TYPE_QUALS (arg3_type)) - arg2_type = arg3_type = + arg2_type = arg3_type = cp_build_qualified_type (arg2_type, TYPE_QUALS (arg2_type) | TYPE_QUALS (arg3_type)); @@ -3121,8 +3377,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) If the second and third operands are lvalues and have the same type, the result is of that type and is an lvalue. */ - if (real_lvalue_p (arg2) - && real_lvalue_p (arg3) + if (real_lvalue_p (arg2) + && real_lvalue_p (arg3) && same_type_p (arg2_type, arg3_type)) { result_type = arg2_type; @@ -3141,7 +3397,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) && (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type))) { tree args[3]; - tree conv; + conversion *conv; bool any_viable_p; /* Rearrange the arguments so that add_builtin_candidate only has @@ -3150,8 +3406,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) args[0] = arg2; args[1] = arg3; args[2] = arg1; - add_builtin_candidates (&candidates, - COND_EXPR, + add_builtin_candidates (&candidates, + COND_EXPR, NOP_EXPR, ansi_opname (COND_EXPR), args, @@ -3181,11 +3437,11 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) Otherwise, the conversions thus determined are applied, and the converted operands are used in place of the original operands for the remainder of this section. */ - conv = TREE_VEC_ELT (cand->convs, 0); + conv = cand->convs[0]; arg1 = convert_like (conv, arg1); - conv = TREE_VEC_ELT (cand->convs, 1); + conv = cand->convs[1]; arg2 = convert_like (conv, arg2); - conv = TREE_VEC_ELT (cand->convs, 2); + conv = cand->convs[2]; arg3 = convert_like (conv, arg3); } @@ -3210,9 +3466,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (arg2 == error_mark_node || arg3 == error_mark_node) return error_mark_node; - + /* [expr.cond] - + After those conversions, one of the following shall hold: --The second and third operands have the same type; the result is of @@ -3224,26 +3480,26 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) --The second and third operands have arithmetic or enumeration type; the usual arithmetic conversions are performed to bring them to a common type, and the result is of that type. */ - else if ((ARITHMETIC_TYPE_P (arg2_type) + else if ((ARITHMETIC_TYPE_P (arg2_type) || TREE_CODE (arg2_type) == ENUMERAL_TYPE) && (ARITHMETIC_TYPE_P (arg3_type) || TREE_CODE (arg3_type) == ENUMERAL_TYPE)) { /* In this case, there is always a common type. */ - result_type = type_after_usual_arithmetic_conversions (arg2_type, + result_type = type_after_usual_arithmetic_conversions (arg2_type, arg3_type); - + if (TREE_CODE (arg2_type) == ENUMERAL_TYPE - && TREE_CODE (arg3_type) == ENUMERAL_TYPE) - warning ("enumeral mismatch in conditional expression: `%T' vs `%T'", - arg2_type, arg3_type); + && TREE_CODE (arg3_type) == ENUMERAL_TYPE) + warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", + arg2_type, arg3_type); else if (extra_warnings - && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE - && !same_type_p (arg3_type, type_promotes_to (arg2_type))) - || (TREE_CODE (arg3_type) == ENUMERAL_TYPE - && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) - warning ("enumeral and non-enumeral type in conditional expression"); - + && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE + && !same_type_p (arg3_type, type_promotes_to (arg2_type))) + || (TREE_CODE (arg3_type) == ENUMERAL_TYPE + && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) + warning (0, "enumeral and non-enumeral type in conditional expression"); + arg2 = perform_implicit_conversion (result_type, arg2); arg3 = perform_implicit_conversion (result_type, arg3); } @@ -3263,9 +3519,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) them to a common type, whose cv-qualification shall match the cv-qualification of either the second or the third operand. The result is of the common type. */ - else if ((null_ptr_cst_p (arg2) + else if ((null_ptr_cst_p (arg2) && (TYPE_PTR_P (arg3_type) || TYPE_PTR_TO_MEMBER_P (arg3_type))) - || (null_ptr_cst_p (arg3) + || (null_ptr_cst_p (arg3) && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type))) || (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type)) || (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type)) @@ -3281,26 +3537,29 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (!result_type) { - error ("operands to ?: have different types"); + error ("operands to ?: have different types %qT and %qT", + arg2_type, arg3_type); return error_mark_node; } valid_operands: - result = fold_if_not_in_template (build (COND_EXPR, result_type, - arg1, arg2, arg3)); + result = fold_if_not_in_template (build3 (COND_EXPR, result_type, arg1, + arg2, arg3)); /* We can't use result_type below, as fold might have returned a throw_expr. */ - /* Expand both sides into the same slot, hopefully the target of the - ?: expression. We used to check for TARGET_EXPRs here, but now we - sometimes wrap them in NOP_EXPRs so the test would fail. */ - if (!lvalue_p && CLASS_TYPE_P (TREE_TYPE (result))) - result = get_target_expr (result); - - /* If this expression is an rvalue, but might be mistaken for an - lvalue, we must add a NON_LVALUE_EXPR. */ - if (!lvalue_p && real_lvalue_p (result)) - result = build1 (NON_LVALUE_EXPR, TREE_TYPE (result), result); + if (!lvalue_p) + { + /* Expand both sides into the same slot, hopefully the target of + the ?: expression. We used to check for TARGET_EXPRs here, + but now we sometimes wrap them in NOP_EXPRs so the test would + fail. */ + if (CLASS_TYPE_P (TREE_TYPE (result))) + result = get_target_expr (result); + /* If this expression is an rvalue, but might be mistaken for an + lvalue, we must add a NON_LVALUE_EXPR. */ + result = rvalue (result); + } return result; } @@ -3314,7 +3573,6 @@ prep_operand (tree operand) { if (operand) { - operand = convert_from_reference (operand); if (CLASS_TYPE_P (TREE_TYPE (operand)) && CLASSTYPE_TEMPLATE_INSTANTIATION (TREE_TYPE (operand))) /* Make sure the template type is instantiated now. */ @@ -3333,7 +3591,7 @@ prep_operand (tree operand) ACCESS_PATH, and FLAGS are as for add_function_candidate. */ static void -add_candidates (tree fns, tree args, +add_candidates (tree fns, tree args, tree explicit_targs, bool template_only, tree conversion_path, tree access_path, int flags, @@ -3346,7 +3604,7 @@ add_candidates (tree fns, tree args, /* Delay creating the implicit this parameter until it is needed. */ non_static_args = NULL_TREE; - while (fns) + while (fns) { tree fn; tree fn_args; @@ -3368,8 +3626,8 @@ add_candidates (tree fns, tree args, fn_args = args; if (TREE_CODE (fn) == TEMPLATE_DECL) - add_template_candidate (candidates, - fn, + add_template_candidate (candidates, + fn, ctype, explicit_targs, fn_args, @@ -3397,13 +3655,16 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, struct z_candidate *candidates = 0, *cand; tree arglist, fnname; tree args[3]; + tree result = NULL_TREE; + bool result_valid_p = false; enum tree_code code2 = NOP_EXPR; - tree conv; + conversion *conv; + void *p; bool strict_p; bool any_viable_p; - if (error_operand_p (arg1) - || error_operand_p (arg2) + if (error_operand_p (arg1) + || error_operand_p (arg2) || error_operand_p (arg3)) return error_mark_node; @@ -3417,7 +3678,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, fnname = ansi_opname (code); arg1 = prep_operand (arg1); - + switch (code) { case NEW_EXPR: @@ -3425,7 +3686,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, case VEC_DELETE_EXPR: case DELETE_EXPR: /* Use build_op_new_call and build_op_delete_call instead. */ - abort (); + gcc_unreachable (); case CALL_EXPR: return build_object_call (arg1, arg2); @@ -3436,7 +3697,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, arg2 = prep_operand (arg2); arg3 = prep_operand (arg3); - + if (code == COND_EXPR) { if (arg2 == NULL_TREE @@ -3460,9 +3721,12 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, arglist = tree_cons (NULL_TREE, arg2, arglist); arglist = tree_cons (NULL_TREE, arg1, arglist); + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + /* Add namespace-scope operators to the list of functions to consider. */ - add_candidates (lookup_function_nonclass (fnname, arglist), + add_candidates (lookup_function_nonclass (fnname, arglist, /*block_p=*/true), arglist, NULL_TREE, false, NULL_TREE, NULL_TREE, flags, &candidates); /* Add class-member operators to the candidate set. */ @@ -3470,11 +3734,14 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, { tree fns; - fns = lookup_fnfields (TYPE_BINFO (TREE_TYPE (arg1)), fnname, 1); + fns = lookup_fnfields (TREE_TYPE (arg1), fnname, 1); if (fns == error_mark_node) - return fns; + { + result = error_mark_node; + goto user_defined_result_ready; + } if (fns) - add_candidates (BASELINK_FUNCTIONS (fns), arglist, + add_candidates (BASELINK_FUNCTIONS (fns), arglist, NULL_TREE, false, BASELINK_BINFO (fns), TYPE_BINFO (TREE_TYPE (arg1)), @@ -3516,7 +3783,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, default: strict_p = pedantic; break; - } + } candidates = splice_viable (candidates, strict_p, &any_viable_p); if (!any_viable_p) @@ -3528,97 +3795,121 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, /* Look for an `operator++ (int)'. If they didn't have one, then we fall back to the old way of doing things. */ if (flags & LOOKUP_COMPLAIN) - pedwarn ("no `%D(int)' declared for postfix `%s', trying prefix operator instead", - fnname, - operator_name_info[code].name); + pedwarn ("no %<%D(int)%> declared for postfix %qs, " + "trying prefix operator instead", + fnname, + operator_name_info[code].name); if (code == POSTINCREMENT_EXPR) code = PREINCREMENT_EXPR; else - code = PREDECREMENT_EXPR; - return build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, - overloaded_p); - + code = PREDECREMENT_EXPR; + result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE, + overloaded_p); + break; + /* The caller will deal with these. */ case ADDR_EXPR: case COMPOUND_EXPR: case COMPONENT_REF: - return NULL_TREE; + result = NULL_TREE; + result_valid_p = true; + break; default: + if (flags & LOOKUP_COMPLAIN) + { + op_error (code, code2, arg1, arg2, arg3, "no match"); + print_z_candidates (candidates); + } + result = error_mark_node; break; } - if (flags & LOOKUP_COMPLAIN) + } + else + { + cand = tourney (candidates); + if (cand == 0) { - op_error (code, code2, arg1, arg2, arg3, "no match"); - print_z_candidates (candidates); + if (flags & LOOKUP_COMPLAIN) + { + op_error (code, code2, arg1, arg2, arg3, "ambiguous overload"); + print_z_candidates (candidates); + } + result = error_mark_node; } - return error_mark_node; - } - - cand = tourney (candidates); - if (cand == 0) - { - if (flags & LOOKUP_COMPLAIN) + else if (TREE_CODE (cand->fn) == FUNCTION_DECL) { - op_error (code, code2, arg1, arg2, arg3, "ambiguous overload"); - print_z_candidates (candidates); + if (overloaded_p) + *overloaded_p = true; + + result = build_over_call (cand, LOOKUP_NORMAL); } - return error_mark_node; - } - - if (TREE_CODE (cand->fn) == FUNCTION_DECL) - { - if (overloaded_p) - *overloaded_p = true; - - return build_over_call (cand, LOOKUP_NORMAL); - } - - /* Check for comparison of different enum types. */ - switch (code) - { - case GT_EXPR: - case LT_EXPR: - case GE_EXPR: - case LE_EXPR: - case EQ_EXPR: - case NE_EXPR: - if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE - && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE - && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) - != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) + else { - warning ("comparison between `%#T' and `%#T'", - TREE_TYPE (arg1), TREE_TYPE (arg2)); + /* Give any warnings we noticed during overload resolution. */ + if (cand->warnings) + { + struct candidate_warning *w; + for (w = cand->warnings; w; w = w->next) + joust (cand, w->loser, 1); + } + + /* Check for comparison of different enum types. */ + switch (code) + { + case GT_EXPR: + case LT_EXPR: + case GE_EXPR: + case LE_EXPR: + case EQ_EXPR: + case NE_EXPR: + if (TREE_CODE (TREE_TYPE (arg1)) == ENUMERAL_TYPE + && TREE_CODE (TREE_TYPE (arg2)) == ENUMERAL_TYPE + && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) + != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) + { + warning (0, "comparison between %q#T and %q#T", + TREE_TYPE (arg1), TREE_TYPE (arg2)); + } + break; + default: + break; + } + + /* We need to strip any leading REF_BIND so that bitfields + don't cause errors. This should not remove any important + conversions, because builtins don't apply to class + objects directly. */ + conv = cand->convs[0]; + if (conv->kind == ck_ref_bind) + conv = conv->u.next; + arg1 = convert_like (conv, arg1); + if (arg2) + { + conv = cand->convs[1]; + if (conv->kind == ck_ref_bind) + conv = conv->u.next; + arg2 = convert_like (conv, arg2); + } + if (arg3) + { + conv = cand->convs[2]; + if (conv->kind == ck_ref_bind) + conv = conv->u.next; + arg3 = convert_like (conv, arg3); + } } - break; - default: - break; } - /* We need to strip any leading REF_BIND so that bitfields don't cause - errors. This should not remove any important conversions, because - builtins don't apply to class objects directly. */ - conv = TREE_VEC_ELT (cand->convs, 0); - if (TREE_CODE (conv) == REF_BIND) - conv = TREE_OPERAND (conv, 0); - arg1 = convert_like (conv, arg1); - if (arg2) - { - conv = TREE_VEC_ELT (cand->convs, 1); - if (TREE_CODE (conv) == REF_BIND) - conv = TREE_OPERAND (conv, 0); - arg2 = convert_like (conv, arg2); - } - if (arg3) - { - conv = TREE_VEC_ELT (cand->convs, 2); - if (TREE_CODE (conv) == REF_BIND) - conv = TREE_OPERAND (conv, 0); - arg3 = convert_like (conv, arg3); - } + user_defined_result_ready: -builtin: + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + if (result || result_valid_p) + return result; + + builtin: switch (code) { case MODIFY_EXPR: @@ -3649,7 +3940,7 @@ builtin: case TRUTH_ORIF_EXPR: return cp_build_binary_op (code, arg1, arg2); - case CONVERT_EXPR: + case UNARY_PLUS_EXPR: case NEGATE_EXPR: case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: @@ -3668,8 +3959,7 @@ builtin: return build_conditional_expr (arg1, arg2, arg3); case MEMBER_REF: - return build_m_component_ref - (build_indirect_ref (arg1, NULL), arg2); + return build_m_component_ref (build_indirect_ref (arg1, NULL), arg2); /* The caller will deal with these. */ case ADDR_EXPR: @@ -3678,9 +3968,9 @@ builtin: return NULL_TREE; default: - abort (); - return NULL_TREE; + gcc_unreachable (); } + return NULL_TREE; } /* Build a call to operator delete. This has to be handled very specially, @@ -3692,12 +3982,16 @@ builtin: CODE is either DELETE_EXPR or VEC_DELETE_EXPR. ADDR is the pointer to be deleted. SIZE is the size of the memory block to be deleted. - FLAGS are the usual overloading flags. - PLACEMENT is the corresponding placement new call, or NULL_TREE. */ + GLOBAL_P is true if the delete-expression should not consider + class-specific delete operators. + PLACEMENT is the corresponding placement new call, or NULL_TREE. + If PLACEMENT is non-NULL, then ALLOC_FN is the allocation function + called to perform the placement new. */ tree build_op_delete_call (enum tree_code code, tree addr, tree size, - int flags, tree placement) + bool global_p, tree placement, + tree alloc_fn) { tree fn = NULL_TREE; tree fns, fnname, argtypes, args, type; @@ -3710,13 +4004,15 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, fnname = ansi_opname (code); - if (IS_AGGR_TYPE (type) && ! (flags & LOOKUP_GLOBAL)) + if (CLASS_TYPE_P (type) + && COMPLETE_TYPE_P (complete_type (type)) + && !global_p) /* In [class.free] If the result of the lookup is ambiguous or inaccessible, or if the lookup selects a placement deallocation function, the program is ill-formed. - + Therefore, we ask lookup_fnfields to complain about ambiguity. */ { fns = lookup_fnfields (TYPE_BINFO (type), fnname, 1); @@ -3731,18 +4027,12 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, if (placement) { - tree alloc_fn; - tree call_expr; - - /* Find the allocation function that is being called. */ - call_expr = placement; - /* Extract the function. */ - alloc_fn = get_callee_fndecl (call_expr); - my_friendly_assert (alloc_fn != NULL_TREE, 20020327); - /* Then the second parm type. */ + /* Get the parameter types for the allocation function that is + being called. */ + gcc_assert (alloc_fn != NULL_TREE); argtypes = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (alloc_fn))); /* Also the second argument. */ - args = TREE_CHAIN (TREE_OPERAND (call_expr, 1)); + args = TREE_CHAIN (TREE_OPERAND (placement, 1)); } else { @@ -3758,12 +4048,12 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, the first pass, we look for a one-operator (or placement) operator delete. If we're not doing placement delete, then on the second pass we look for a two-argument delete. */ - for (pass = 0; pass < (placement ? 1 : 2); ++pass) + for (pass = 0; pass < (placement ? 1 : 2); ++pass) { /* Go through the `operator delete' functions looking for one with a matching type. */ - for (fn = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns; - fn; + for (fn = BASELINK_P (fns) ? BASELINK_FUNCTIONS (fns) : fns; + fn; fn = OVL_NEXT (fn)) { tree t; @@ -3810,12 +4100,12 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, /* If the FN is a member function, make sure that it is accessible. */ if (DECL_CLASS_SCOPE_P (fn)) - perform_or_defer_access_check (TYPE_BINFO (type), fn); + perform_or_defer_access_check (TYPE_BINFO (type), fn, fn); if (pass == 0) args = tree_cons (NULL_TREE, addr, args); else - args = tree_cons (NULL_TREE, addr, + args = tree_cons (NULL_TREE, addr, build_tree_list (NULL_TREE, size)); if (placement) @@ -3823,7 +4113,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, /* The placement args might not be suitable for overload resolution at this point, so build the call directly. */ mark_used (fn); - return build_cxx_call (fn, args, args); + return build_cxx_call (fn, args); } else return build_function_call (fn, args); @@ -3834,28 +4124,29 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, if (placement) return NULL_TREE; - error ("no suitable `operator %s' for `%T'", + error ("no suitable % for %qT", operator_name_info[(int)code].name, type); return error_mark_node; } /* If the current scope isn't allowed to access DECL along BASETYPE_PATH, give an error. The most derived class in - BASETYPE_PATH is the one used to qualify DECL. */ + BASETYPE_PATH is the one used to qualify DECL. DIAG_DECL is + the declaration to use in the error diagnostic. */ bool -enforce_access (tree basetype_path, tree decl) +enforce_access (tree basetype_path, tree decl, tree diag_decl) { - my_friendly_assert (TREE_CODE (basetype_path) == TREE_VEC, 20030624); - - if (!accessible_p (basetype_path, decl)) + gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO); + + if (!accessible_p (basetype_path, decl, true)) { if (TREE_PRIVATE (decl)) - cp_error_at ("`%+#D' is private", decl); + error ("%q+#D is private", diag_decl); else if (TREE_PROTECTED (decl)) - cp_error_at ("`%+#D' is protected", decl); + error ("%q+#D is protected", diag_decl); else - cp_error_at ("`%+#D' is inaccessible", decl); + error ("%q+#D is inaccessible", diag_decl); error ("within this context"); return false; } @@ -3871,8 +4162,8 @@ check_constructor_callable (tree type, tree expr) { build_special_member_call (NULL_TREE, complete_ctor_identifier, - build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), + build_tree_list (NULL_TREE, expr), + type, LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING | LOOKUP_NO_CONVERSION | LOOKUP_CONSTRUCTOR_CALLABLE); @@ -3885,26 +4176,25 @@ check_constructor_callable (tree type, tree expr) to NULL. */ static tree -build_temp (tree expr, tree type, int flags, - void (**diagnostic_fn)(const char *, ...)) +build_temp (tree expr, tree type, int flags, + diagnostic_fn_t *diagnostic_fn) { int savew, savee; - + savew = warningcount, savee = errorcount; expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, - build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), - flags); + build_tree_list (NULL_TREE, expr), + type, flags); if (warningcount > savew) - *diagnostic_fn = warning; + *diagnostic_fn = warning0; else if (errorcount > savee) *diagnostic_fn = error; else *diagnostic_fn = NULL; return expr; } - + /* Perform the conversions in CONVS on the expression EXPR. FN and ARGNUM are used for diagnostics. ARGNUM is zero based, -1 @@ -3912,63 +4202,90 @@ build_temp (tree expr, tree type, int flags, being called to continue a conversion chain. It is negative when a reference binding will be applied, positive otherwise. If ISSUE_CONVERSION_WARNINGS is true, warnings about suspicious - conversions will be emitted if appropriate. */ + conversions will be emitted if appropriate. If C_CAST_P is true, + this conversion is coming from a C-style cast; in that case, + conversions to inaccessible bases are permitted. */ static tree -convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, - bool issue_conversion_warnings) +convert_like_real (conversion *convs, tree expr, tree fn, int argnum, + int inner, bool issue_conversion_warnings, + bool c_cast_p) { - tree totype = TREE_TYPE (convs); - void (*diagnostic_fn)(const char *, ...); + tree totype = convs->type; + diagnostic_fn_t diagnostic_fn; - if (ICS_BAD_FLAG (convs) - && TREE_CODE (convs) != USER_CONV - && TREE_CODE (convs) != AMBIG_CONV - && TREE_CODE (convs) != REF_BIND) + if (convs->bad_p + && convs->kind != ck_user + && convs->kind != ck_ambig + && convs->kind != ck_ref_bind) { - tree t = convs; - for (; t; t = TREE_OPERAND (t, 0)) + conversion *t = convs; + for (; t; t = convs->u.next) { - if (TREE_CODE (t) == USER_CONV || !ICS_BAD_FLAG (t)) + if (t->kind == ck_user || !t->bad_p) { expr = convert_like_real (t, expr, fn, argnum, 1, - /*issue_conversion_warnings=*/false); + /*issue_conversion_warnings=*/false, + /*c_cast_p=*/false); break; } - else if (TREE_CODE (t) == AMBIG_CONV) + else if (t->kind == ck_ambig) return convert_like_real (t, expr, fn, argnum, 1, - /*issue_conversion_warnings=*/false); - else if (TREE_CODE (t) == IDENTITY_CONV) + /*issue_conversion_warnings=*/false, + /*c_cast_p=*/false); + else if (t->kind == ck_identity) break; } - pedwarn ("invalid conversion from `%T' to `%T'", TREE_TYPE (expr), totype); + pedwarn ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype); if (fn) - pedwarn (" initializing argument %P of `%D'", argnum, fn); + pedwarn (" initializing argument %P of %qD", argnum, fn); return cp_convert (totype, expr); } - + if (issue_conversion_warnings) - expr = dubious_conversion_warnings - (totype, expr, "converting", fn, argnum); - switch (TREE_CODE (convs)) { - case USER_CONV: + tree t = non_reference (totype); + + /* Issue warnings about peculiar, but valid, uses of NULL. */ + if (ARITHMETIC_TYPE_P (t) && expr == null_node) + { + if (fn) + warning (OPT_Wconversion, "passing NULL to non-pointer argument %P of %qD", + argnum, fn); + else + warning (OPT_Wconversion, "converting to non-pointer type %qT from NULL", t); + } + + /* Warn about assigning a floating-point type to an integer type. */ + if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE + && TREE_CODE (t) == INTEGER_TYPE) + { + if (fn) + warning (OPT_Wconversion, "passing %qT for argument %P to %qD", + TREE_TYPE (expr), argnum, fn); + else + warning (OPT_Wconversion, "converting to %qT from %qT", t, TREE_TYPE (expr)); + } + } + + switch (convs->kind) + { + case ck_user: { - struct z_candidate *cand = USER_CONV_CAND (convs); + struct z_candidate *cand = convs->cand; tree convfn = cand->fn; tree args; if (DECL_CONSTRUCTOR_P (convfn)) { - tree t = build_int_2 (0, 0); - TREE_TYPE (t) = build_pointer_type (DECL_CONTEXT (convfn)); + tree t = build_int_cst (build_pointer_type (DECL_CONTEXT (convfn)), + 0); args = build_tree_list (NULL_TREE, expr); - if (DECL_HAS_IN_CHARGE_PARM_P (convfn) - || DECL_HAS_VTT_PARM_P (convfn)) - /* We should never try to call the abstract or base constructor - from here. */ - abort (); + /* We should never try to call the abstract or base constructor + from here. */ + gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (convfn) + && !DECL_HAS_VTT_PARM_P (convfn)); args = tree_cons (NULL_TREE, t, args); } else @@ -3991,74 +4308,74 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, if (IS_AGGR_TYPE (totype) && (inner >= 0 || !lvalue_p (expr))) { - expr = (build_temp - (expr, totype, + expr = (build_temp + (expr, totype, /* Core issue 84, now a DR, says that we don't allow UDCs for these args (which deliberately breaks copy-init of an auto_ptr from an auto_ptr). */ LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING|LOOKUP_NO_CONVERSION, &diagnostic_fn)); - + if (diagnostic_fn) { if (fn) - diagnostic_fn - (" initializing argument %P of `%D' from result of `%D'", + diagnostic_fn + (" initializing argument %P of %qD from result of %qD", argnum, fn, convfn); else - diagnostic_fn - (" initializing temporary from result of `%D'", convfn); + diagnostic_fn + (" initializing temporary from result of %qD", convfn); } expr = build_cplus_new (totype, expr); } return expr; } - case IDENTITY_CONV: + case ck_identity: if (type_unknown_p (expr)) - expr = instantiate_type (totype, expr, tf_error | tf_warning); - /* Convert a non-array constant variable to its underlying - value, unless we are about to bind it to a reference, in - which case we need to leave it as an lvalue. */ - if (inner >= 0 - && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) + expr = instantiate_type (totype, expr, tf_warning_or_error); + /* Convert a constant to its underlying value, unless we are + about to bind it to a reference, in which case we need to + leave it as an lvalue. */ + if (inner >= 0) expr = decl_constant_value (expr); - if (CHECK_COPY_CONSTRUCTOR_P (convs)) + if (convs->check_copy_constructor_p) check_constructor_callable (totype, expr); - return expr; - case AMBIG_CONV: + case ck_ambig: /* Call build_user_type_conversion again for the error. */ return build_user_type_conversion - (totype, TREE_OPERAND (convs, 0), LOOKUP_NORMAL); + (totype, convs->u.expr, LOOKUP_NORMAL); default: break; }; - expr = convert_like_real (TREE_OPERAND (convs, 0), expr, fn, argnum, - TREE_CODE (convs) == REF_BIND ? -1 : 1, - /*issue_conversion_warnings=*/false); + expr = convert_like_real (convs->u.next, expr, fn, argnum, + convs->kind == ck_ref_bind ? -1 : 1, + /*issue_conversion_warnings=*/false, + c_cast_p); if (expr == error_mark_node) return error_mark_node; - switch (TREE_CODE (convs)) + switch (convs->kind) { - case RVALUE_CONV: + case ck_rvalue: + expr = convert_bitfield_to_declared_type (expr); if (! IS_AGGR_TYPE (totype)) return expr; /* Else fall through. */ - case BASE_CONV: - if (TREE_CODE (convs) == BASE_CONV && !NEED_TEMPORARY_P (convs)) + case ck_base: + if (convs->kind == ck_base && !convs->need_temporary_p) { /* We are going to bind a reference directly to a base-class subobject of EXPR. */ - if (CHECK_COPY_CONSTRUCTOR_P (convs)) + if (convs->check_copy_constructor_p) check_constructor_callable (TREE_TYPE (expr), expr); /* Build an expression for `*((base*) &expr)'. */ expr = build_unary_op (ADDR_EXPR, expr, 0); - expr = perform_implicit_conversion (build_pointer_type (totype), - expr); + expr = convert_to_base (expr, build_pointer_type (totype), + !c_cast_p, /*nonnull=*/true); expr = build_indirect_ref (expr, "implicit conversion"); return expr; } @@ -4069,17 +4386,17 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, expr = build_temp (expr, totype, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, &diagnostic_fn); if (diagnostic_fn && fn) - diagnostic_fn (" initializing argument %P of `%D'", argnum, fn); + diagnostic_fn (" initializing argument %P of %qD", argnum, fn); return build_cplus_new (totype, expr); - case REF_BIND: + case ck_ref_bind: { tree ref_type = totype; /* If necessary, create a temporary. */ - if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr)) + if (convs->need_temporary_p || !lvalue_p (expr)) { - tree type = TREE_TYPE (TREE_OPERAND (convs, 0)); + tree type = convs->u.next->type; cp_lvalue_kind lvalue = real_lvalue_p (expr); if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type))) @@ -4087,13 +4404,13 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, /* If the reference is volatile or non-const, we cannot create a temporary. */ if (lvalue & clk_bitfield) - error ("cannot bind bitfield `%E' to `%T'", + error ("cannot bind bitfield %qE to %qT", expr, ref_type); else if (lvalue & clk_packed) - error ("cannot bind packed field `%E' to `%T'", + error ("cannot bind packed field %qE to %qT", expr, ref_type); else - error ("cannot bind rvalue `%E' to `%T'", expr, ref_type); + error ("cannot bind rvalue %qE to %qT", expr, ref_type); return error_mark_node; } /* If the source is a packed field, and we must use a copy @@ -4102,11 +4419,11 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, copy constructor, and we'll end up with an infinite loop. If we can use a bitwise copy, then we'll be OK. */ - if ((lvalue & clk_packed) - && CLASS_TYPE_P (type) + if ((lvalue & clk_packed) + && CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)) { - error ("cannot bind packed field `%E' to `%T'", + error ("cannot bind packed field %qE to %qT", expr, ref_type); return error_mark_node; } @@ -4122,25 +4439,40 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, /* Convert it to a pointer to the type referred to by the reference. This will adjust the pointer if a derived to base conversion is being performed. */ - expr = cp_convert (build_pointer_type (TREE_TYPE (ref_type)), + expr = cp_convert (build_pointer_type (TREE_TYPE (ref_type)), expr); /* Convert the pointer to the desired reference type. */ return build_nop (ref_type, expr); } - case LVALUE_CONV: + case ck_lvalue: return decay_conversion (expr); - case QUAL_CONV: + case ck_qual: /* Warn about deprecated conversion if appropriate. */ string_conv_p (totype, expr, 1); break; - + + case ck_ptr: + if (convs->base_p) + expr = convert_to_base (expr, totype, !c_cast_p, + /*nonnull=*/false); + return build_nop (totype, expr); + + case ck_pmem: + return convert_ptrmem (totype, expr, /*allow_inverse_p=*/false, + c_cast_p); + default: break; } - return ocp_convert (totype, expr, CONV_IMPLICIT, - LOOKUP_NORMAL|LOOKUP_NO_CONVERSION); + + if (issue_conversion_warnings) + expr = convert_and_check (totype, expr); + else + expr = convert (totype, expr); + + return expr; } /* Build a call to __builtin_trap. */ @@ -4148,9 +4480,9 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner, static tree call_builtin_trap (void) { - tree fn = IDENTIFIER_GLOBAL_VALUE (get_identifier ("__builtin_trap")); + tree fn = implicit_built_in_decls[BUILT_IN_TRAP]; - my_friendly_assert (fn != NULL, 20030927); + gcc_assert (fn != NULL); fn = build_call (fn, NULL_TREE); return fn; } @@ -4181,22 +4513,22 @@ convert_arg_to_ellipsis (tree arg) arg = perform_integral_promotions (arg); arg = require_complete_type (arg); - + if (arg != error_mark_node && !pod_type_p (TREE_TYPE (arg))) { /* Undefined behavior [expr.call] 5.2.2/7. We used to just warn here and do a bitwise copy, but now cp_expr_size will abort if we - try to do that. - If the call appears in the context of a sizeof expression, - there is no need to emit a warning, since the expression won't be + try to do that. + If the call appears in the context of a sizeof expression, + there is no need to emit a warning, since the expression won't be evaluated. We keep the builtin_trap just as a safety check. */ if (!skip_evaluation) - warning ("cannot pass objects of non-POD type `%#T' through `...'; " - "call will abort at runtime", TREE_TYPE (arg)); + warning (0, "cannot pass objects of non-POD type %q#T through %<...%>; " + "call will abort at runtime", TREE_TYPE (arg)); arg = call_builtin_trap (); - arg = build (COMPOUND_EXPR, integer_type_node, arg, - integer_zero_node); + arg = build2 (COMPOUND_EXPR, integer_type_node, arg, + integer_zero_node); } return arg; @@ -4209,25 +4541,26 @@ build_x_va_arg (tree expr, tree type) { if (processing_template_decl) return build_min (VA_ARG_EXPR, type, expr); - + type = complete_type_or_else (type, NULL_TREE); if (expr == error_mark_node || !type) return error_mark_node; - + if (! pod_type_p (type)) { + /* Remove reference types so we don't ICE later on. */ + tree type1 = non_reference (type); /* Undefined behavior [expr.call] 5.2.2/7. */ - warning ("cannot receive objects of non-POD type `%#T' through `...'; \ -call will abort at runtime", - type); - expr = convert (build_pointer_type (type), null_node); - expr = build (COMPOUND_EXPR, TREE_TYPE (expr), - call_builtin_trap (), expr); + warning (0, "cannot receive objects of non-POD type %q#T through %<...%>; " + "call will abort at runtime", type); + expr = convert (build_pointer_type (type1), null_node); + expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), + call_builtin_trap (), expr); expr = build_indirect_ref (expr, NULL); return expr; } - + return build_va_arg (expr, type); } @@ -4247,7 +4580,7 @@ cxx_type_promotes_to (tree type) promote = type_promotes_to (type); if (same_type_p (type, promote)) promote = type; - + return promote; } @@ -4262,7 +4595,7 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum) conversion cannot be performed. */ if (TREE_CODE (arg) == DEFAULT_ARG) { - error ("the default argument for parameter %d of `%D' has " + error ("the default argument for parameter %d of %qD has " "not yet been parsed", parmnum, fn); return error_mark_node; @@ -4275,16 +4608,20 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum) if (TREE_CODE (arg) == CONSTRUCTOR) { - arg = digest_init (type, arg, 0); + arg = digest_init (type, arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, "default argument", fn, parmnum); } else { - /* This could get clobbered by the following call. */ - if (TREE_HAS_CONSTRUCTOR (arg)) - arg = copy_node (arg); - + /* We must make a copy of ARG, in case subsequent processing + alters any part of it. For example, during gimplification a + cast of the form (T) &X::f (where "f" is a member function) + will lead to replacing the PTRMEM_CST for &X::f with a + VAR_DECL. We can avoid the copy for constants, since they + are never modified in place. */ + if (!CONSTANT_CLASS_P (arg)) + arg = unshare_expr (arg); arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL, "default argument", fn, parmnum); arg = convert_for_arg_passing (type, arg); @@ -4301,8 +4638,12 @@ type_passed_as (tree type) { /* Pass classes with copy ctors by invisible reference. */ if (TREE_ADDRESSABLE (type)) - type = build_reference_type (type); - else if (PROMOTE_PROTOTYPES + { + type = build_reference_type (type); + /* There are no other pointers to this temporary. */ + type = build_qualified_type (type, TYPE_QUAL_RESTRICT); + } + else if (targetm.calls.promote_prototypes (type) && INTEGRAL_TYPE_P (type) && COMPLETE_TYPE_P (type) && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), @@ -4317,17 +4658,29 @@ type_passed_as (tree type) tree convert_for_arg_passing (tree type, tree val) { + val = convert_bitfield_to_declared_type (val); if (val == error_mark_node) ; /* Pass classes with copy ctors by invisible reference. */ else if (TREE_ADDRESSABLE (type)) val = build1 (ADDR_EXPR, build_reference_type (type), val); - else if (PROMOTE_PROTOTYPES + else if (targetm.calls.promote_prototypes (type) && INTEGRAL_TYPE_P (type) && COMPLETE_TYPE_P (type) && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (integer_type_node))) val = perform_integral_promotions (val); + if (warn_missing_format_attribute) + { + tree rhstype = TREE_TYPE (val); + const enum tree_code coder = TREE_CODE (rhstype); + const enum tree_code codel = TREE_CODE (type); + if ((codel == POINTER_TYPE || codel == REFERENCE_TYPE) + && coder == codel + && check_missing_format_attribute (type, rhstype)) + warning (OPT_Wmissing_format_attribute, + "argument of function call might be a candidate for a format attribute"); + } return val; } @@ -4364,10 +4717,11 @@ build_over_call (struct z_candidate *cand, int flags) { tree fn = cand->fn; tree args = cand->args; - tree convs = cand->convs; + conversion **convs = cand->convs; + conversion *conv; tree converted_args = NULL_TREE; tree parm = TYPE_ARG_TYPES (TREE_TYPE (fn)); - tree conv, arg, val; + tree arg, val; int i = 0; int is_method = 0; @@ -4380,7 +4734,7 @@ build_over_call (struct z_candidate *cand, int flags) tree expr; tree return_type; return_type = TREE_TYPE (TREE_TYPE (fn)); - expr = build (CALL_EXPR, return_type, fn, args); + expr = build3 (CALL_EXPR, return_type, fn, args, NULL_TREE); if (TREE_THIS_VOLATILE (fn) && cfun) current_function_returns_abnormally = 1; if (!VOID_TYPE_P (return_type)) @@ -4390,8 +4744,11 @@ build_over_call (struct z_candidate *cand, int flags) /* Give any warnings we noticed during overload resolution. */ if (cand->warnings) - for (val = cand->warnings; val; val = TREE_CHAIN (val)) - joust (cand, WRAPPER_ZC (TREE_VALUE (val)), 1); + { + struct candidate_warning *w; + for (w = cand->warnings; w; w = w->next) + joust (cand, w->loser, 1); + } if (DECL_FUNCTION_MEMBER_P (fn)) { @@ -4421,11 +4778,11 @@ build_over_call (struct z_candidate *cand, int flags) primary template because `B::g' and `B::g' may have different access. */ if (DECL_TEMPLATE_INFO (fn) - && is_member_template (DECL_TI_TEMPLATE (fn))) + && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (fn))) perform_or_defer_access_check (cand->access_path, - DECL_TI_TEMPLATE (fn)); + DECL_TI_TEMPLATE (fn), fn); else - perform_or_defer_access_check (cand->access_path, fn); + perform_or_defer_access_check (cand->access_path, fn, fn); } if (args && TREE_CODE (args) != TREE_LIST) @@ -4439,9 +4796,9 @@ build_over_call (struct z_candidate *cand, int flags) converted_args = tree_cons (NULL_TREE, TREE_VALUE (arg), converted_args); arg = TREE_CHAIN (arg); parm = TREE_CHAIN (parm); - if (DECL_HAS_IN_CHARGE_PARM_P (fn)) - /* We should never try to call the abstract constructor. */ - abort (); + /* We should never try to call the abstract constructor. */ + gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (fn)); + if (DECL_HAS_VTT_PARM_P (fn)) { converted_args = tree_cons @@ -4449,7 +4806,7 @@ build_over_call (struct z_candidate *cand, int flags) arg = TREE_CHAIN (arg); parm = TREE_CHAIN (parm); } - } + } /* Bypass access control for 'this' parameter. */ else if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE) { @@ -4457,38 +4814,38 @@ build_over_call (struct z_candidate *cand, int flags) tree argtype = TREE_TYPE (TREE_VALUE (arg)); tree converted_arg; tree base_binfo; - - if (ICS_BAD_FLAG (TREE_VEC_ELT (convs, i))) - pedwarn ("passing `%T' as `this' argument of `%#D' discards qualifiers", - TREE_TYPE (argtype), fn); + + if (convs[i]->bad_p) + pedwarn ("passing %qT as % argument of %q#D discards qualifiers", + TREE_TYPE (argtype), fn); /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type derived from X, the behavior is undefined. - So we can assume that anything passed as 'this' is non-null, and + So we can assume that anything passed as 'this' is non-null, and optimize accordingly. */ - my_friendly_assert (TREE_CODE (parmtype) == POINTER_TYPE, 19990811); + gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE); /* Convert to the base in which the function was declared. */ - my_friendly_assert (cand->conversion_path != NULL_TREE, 20020730); + gcc_assert (cand->conversion_path != NULL_TREE); converted_arg = build_base_path (PLUS_EXPR, TREE_VALUE (arg), cand->conversion_path, 1); /* Check that the base class is accessible. */ - if (!accessible_base_p (TREE_TYPE (argtype), - BINFO_TYPE (cand->conversion_path))) - error ("`%T' is not an accessible base of `%T'", + if (!accessible_base_p (TREE_TYPE (argtype), + BINFO_TYPE (cand->conversion_path), true)) + error ("%qT is not an accessible base of %qT", BINFO_TYPE (cand->conversion_path), TREE_TYPE (argtype)); /* If fn was found by a using declaration, the conversion path - will be to the derived class, not the base declaring fn. We - must convert from derived to base. */ + will be to the derived class, not the base declaring fn. We + must convert from derived to base. */ base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)), - TREE_TYPE (parmtype), ba_ignore, NULL); + TREE_TYPE (parmtype), ba_unique, NULL); converted_arg = build_base_path (PLUS_EXPR, converted_arg, base_binfo, 1); - + converted_args = tree_cons (NULL_TREE, converted_arg, converted_args); parm = TREE_CHAIN (parm); arg = TREE_CHAIN (arg); @@ -4501,7 +4858,13 @@ build_over_call (struct z_candidate *cand, int flags) { tree type = TREE_VALUE (parm); - conv = TREE_VEC_ELT (convs, i); + conv = convs[i]; + + /* Don't make a copy here if build_call is going to. */ + if (conv->kind == ck_rvalue + && !TREE_ADDRESSABLE (complete_type (type))) + conv = conv->u.next; + val = convert_like_with_context (conv, TREE_VALUE (arg), fn, i - is_method); @@ -4511,9 +4874,9 @@ build_over_call (struct z_candidate *cand, int flags) /* Default arguments */ for (; parm && parm != void_list_node; parm = TREE_CHAIN (parm), i++) - converted_args - = tree_cons (NULL_TREE, - convert_default_arg (TREE_VALUE (parm), + converted_args + = tree_cons (NULL_TREE, + convert_default_arg (TREE_VALUE (parm), TREE_PURPOSE (parm), fn, i - is_method), converted_args); @@ -4531,17 +4894,15 @@ build_over_call (struct z_candidate *cand, int flags) converted_args = nreverse (converted_args); - if (warn_format) - check_function_format (NULL, TYPE_ATTRIBUTES (TREE_TYPE (fn)), - converted_args); + check_function_arguments (TYPE_ATTRIBUTES (TREE_TYPE (fn)), + converted_args, TYPE_ARG_TYPES (TREE_TYPE (fn))); /* Avoid actually calling copy constructors and copy assignment operators, if possible. */ if (! flag_elide_constructors) /* Do things the hard way. */; - else if (TREE_VEC_LENGTH (convs) == 1 - && DECL_COPY_CONSTRUCTOR_P (fn)) + else if (cand->num_convs == 1 && DECL_COPY_CONSTRUCTOR_P (fn)) { tree targ; arg = skip_artificial_parms_for (fn, converted_args); @@ -4556,7 +4917,7 @@ build_over_call (struct z_candidate *cand, int flags) if (TREE_CODE (targ) == ADDR_EXPR) { targ = TREE_OPERAND (targ, 0); - if (!same_type_ignoring_top_level_qualifiers_p + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (TREE_TYPE (arg)), TREE_TYPE (targ))) targ = NULL_TREE; } @@ -4574,10 +4935,10 @@ build_over_call (struct z_candidate *cand, int flags) mark_used (fn); /* If we're creating a temp and we already have one, don't create a - new one. If we're not creating a temp but we get one, use - INIT_EXPR to collapse the temp into our target. Otherwise, if the - ctor is trivial, do a bitwise copy with a simple TARGET_EXPR for a - temp or an INIT_EXPR otherwise. */ + new one. If we're not creating a temp but we get one, use + INIT_EXPR to collapse the temp into our target. Otherwise, if the + ctor is trivial, do a bitwise copy with a simple TARGET_EXPR for a + temp or an INIT_EXPR otherwise. */ if (integer_zerop (TREE_VALUE (args))) { if (TREE_CODE (arg) == TARGET_EXPR) @@ -4591,7 +4952,7 @@ build_over_call (struct z_candidate *cand, int flags) tree to = stabilize_reference (build_indirect_ref (TREE_VALUE (args), 0)); - val = build (INIT_EXPR, DECL_CONTEXT (fn), to, arg); + val = build2 (INIT_EXPR, DECL_CONTEXT (fn), to, arg); return val; } } @@ -4604,33 +4965,30 @@ build_over_call (struct z_candidate *cand, int flags) tree type = TREE_TYPE (to); tree as_base = CLASSTYPE_AS_BASE (type); - arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0); + arg = TREE_VALUE (TREE_CHAIN (converted_args)); if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base))) - val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg); + { + arg = build_indirect_ref (arg, 0); + val = build2 (MODIFY_EXPR, TREE_TYPE (to), to, arg); + } else { - /* We must only copy the non-tail padding parts. Use - CLASSTYPE_AS_BASE for the bitwise copy. */ - tree to_ptr, arg_ptr, to_as_base, arg_as_base, base_ptr_type; - tree save_to; + /* We must only copy the non-tail padding parts. + Use __builtin_memcpy for the bitwise copy. */ - to_ptr = save_expr (build_unary_op (ADDR_EXPR, to, 0)); - arg_ptr = build_unary_op (ADDR_EXPR, arg, 0); + tree args, t; - base_ptr_type = build_pointer_type (as_base); - to_as_base = build_nop (base_ptr_type, to_ptr); - to_as_base = build_indirect_ref (to_as_base, 0); - arg_as_base = build_nop (base_ptr_type, arg_ptr); - arg_as_base = build_indirect_ref (arg_as_base, 0); + args = tree_cons (NULL, TYPE_SIZE_UNIT (as_base), NULL); + args = tree_cons (NULL, arg, args); + t = build_unary_op (ADDR_EXPR, to, 0); + args = tree_cons (NULL, t, args); + t = implicit_built_in_decls[BUILT_IN_MEMCPY]; + t = build_call (t, args); - save_to = build_indirect_ref (to_ptr, 0); - - val = build (MODIFY_EXPR, as_base, to_as_base, arg_as_base); - val = convert_to_void (val, NULL); - val = build (COMPOUND_EXPR, type, val, save_to); - TREE_NO_UNUSED_WARNING (val) = 1; + t = convert (TREE_TYPE (TREE_VALUE (args)), t); + val = build_indirect_ref (t, 0); } - + return val; } @@ -4642,8 +5000,8 @@ build_over_call (struct z_candidate *cand, int flags) tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (*p)), DECL_CONTEXT (fn), ba_any, NULL); - my_friendly_assert (binfo && binfo != error_mark_node, 20010730); - + gcc_assert (binfo && binfo != error_mark_node); + *p = build_base_path (PLUS_EXPR, *p, binfo, 1); if (TREE_SIDE_EFFECTS (*p)) *p = save_expr (*p); @@ -4651,7 +5009,7 @@ build_over_call (struct z_candidate *cand, int flags) if (DECL_CONTEXT (fn) && TYPE_JAVA_INTERFACE (DECL_CONTEXT (fn))) fn = build_java_interface_fn_ref (fn, *p); else - fn = build_vfn_ref (build_indirect_ref (*p, 0), DECL_VINDEX (fn)); + fn = build_vfn_ref (*p, DECL_VINDEX (fn)); TREE_TYPE (fn) = t; } else if (DECL_INLINE (fn)) @@ -4659,44 +5017,30 @@ build_over_call (struct z_candidate *cand, int flags) else fn = build_addr_func (fn); - return build_cxx_call (fn, args, converted_args); + return build_cxx_call (fn, converted_args); } -/* Build and return a call to FN, using the the CONVERTED_ARGS. ARGS - gives the original form of the arguments. This function performs +/* Build and return a call to FN, using ARGS. This function performs no overload resolution, conversion, or other high-level operations. */ tree -build_cxx_call(tree fn, tree args, tree converted_args) +build_cxx_call (tree fn, tree args) { tree fndecl; - /* Recognize certain built-in functions so we can make tree-codes - other than CALL_EXPR. We do this when it enables fold-const.c - to do something useful. */ - if (TREE_CODE (fn) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL - && DECL_BUILT_IN (TREE_OPERAND (fn, 0))) - { - tree exp; - exp = expand_tree_builtin (TREE_OPERAND (fn, 0), args, converted_args); - if (exp) - return exp; - } - - fn = build_call (fn, converted_args); + fn = build_call (fn, args); /* If this call might throw an exception, note that fact. */ fndecl = get_callee_fndecl (fn); - if ((!fndecl || !TREE_NOTHROW (fndecl)) + if ((!fndecl || !TREE_NOTHROW (fndecl)) && at_function_scope_p () && cfun) cp_function_chain->can_throw = 1; /* Some built-in function calls will be evaluated at compile-time in fold (). */ - fn = fold (fn); + fn = fold_if_not_in_template (fn); if (VOID_TYPE_P (TREE_TYPE (fn))) return fn; @@ -4722,7 +5066,7 @@ build_java_interface_fn_ref (tree fn, tree instance) tree lookup_args, lookup_fn, method, idx; tree klass_ref, iface, iface_ref; int i; - + if (!java_iface_lookup_fn) { tree endlink = build_void_list_node (); @@ -4730,15 +5074,15 @@ build_java_interface_fn_ref (tree fn, tree instance) tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, java_int_type_node, endlink))); - java_iface_lookup_fn + java_iface_lookup_fn = builtin_function ("_Jv_LookupInterfaceMethodIdx", build_function_type (ptr_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); } - /* Look up the pointer to the runtime java.lang.Class object for `instance'. + /* Look up the pointer to the runtime java.lang.Class object for `instance'. This is the first entry in the vtable. */ - klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), + klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0), integer_zero_node); /* Get the java.lang.Class pointer for the interface being called. */ @@ -4747,40 +5091,43 @@ build_java_interface_fn_ref (tree fn, tree instance) if (!iface_ref || TREE_CODE (iface_ref) != VAR_DECL || DECL_CONTEXT (iface_ref) != iface) { - error ("could not find class$ field in java interface type `%T'", + error ("could not find class$ field in java interface type %qT", iface); return error_mark_node; } - iface_ref = build1 (ADDR_EXPR, build_pointer_type (iface), iface_ref); - + iface_ref = build_address (iface_ref); + iface_ref = convert (build_pointer_type (iface), iface_ref); + /* Determine the itable index of FN. */ i = 1; for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method)) { if (!DECL_VIRTUAL_P (method)) - continue; + continue; if (fn == method) - break; + break; i++; } - idx = build_int_2 (i, 0); + idx = build_int_cst (NULL_TREE, i); - lookup_args = tree_cons (NULL_TREE, klass_ref, + lookup_args = tree_cons (NULL_TREE, klass_ref, tree_cons (NULL_TREE, iface_ref, build_tree_list (NULL_TREE, idx))); - lookup_fn = build1 (ADDR_EXPR, + lookup_fn = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (java_iface_lookup_fn)), java_iface_lookup_fn); - return build (CALL_EXPR, ptr_type_node, lookup_fn, lookup_args, NULL_TREE); + return build3 (CALL_EXPR, ptr_type_node, lookup_fn, lookup_args, NULL_TREE); } /* Returns the value to use for the in-charge parameter when making a - call to a function with the indicated NAME. */ + call to a function with the indicated NAME. + + FIXME:Can't we find a neater way to do this mapping? */ tree in_charge_arg_for_name (tree name) { - if (name == base_ctor_identifier + if (name == base_ctor_identifier || name == base_dtor_identifier) return integer_zero_node; else if (name == complete_ctor_identifier) @@ -4792,7 +5139,7 @@ in_charge_arg_for_name (tree name) /* This function should only be called with one of the names listed above. */ - abort (); + gcc_unreachable (); return NULL_TREE; } @@ -4809,40 +5156,47 @@ in_charge_arg_for_name (tree name) store the newly constructed object into a VAR_DECL. */ tree -build_special_member_call (tree instance, tree name, tree args, +build_special_member_call (tree instance, tree name, tree args, tree binfo, int flags) { tree fns; /* The type of the subobject to be constructed or destroyed. */ tree class_type; - my_friendly_assert (name == complete_ctor_identifier - || name == base_ctor_identifier - || name == complete_dtor_identifier - || name == base_dtor_identifier - || name == deleting_dtor_identifier - || name == ansi_assopname (NOP_EXPR), - 20020712); - my_friendly_assert (binfo != NULL_TREE, 20020712); + gcc_assert (name == complete_ctor_identifier + || name == base_ctor_identifier + || name == complete_dtor_identifier + || name == base_dtor_identifier + || name == deleting_dtor_identifier + || name == ansi_assopname (NOP_EXPR)); + if (TYPE_P (binfo)) + { + /* Resolve the name. */ + if (!complete_type_or_else (binfo, NULL_TREE)) + return error_mark_node; + + binfo = TYPE_BINFO (binfo); + } + + gcc_assert (binfo != NULL_TREE); class_type = BINFO_TYPE (binfo); /* Handle the special case where INSTANCE is NULL_TREE. */ if (name == complete_ctor_identifier && !instance) { - instance = build_int_2 (0, 0); - TREE_TYPE (instance) = build_pointer_type (class_type); + instance = build_int_cst (build_pointer_type (class_type), 0); instance = build1 (INDIRECT_REF, class_type, instance); } else { - if (name == complete_dtor_identifier + if (name == complete_dtor_identifier || name == base_dtor_identifier || name == deleting_dtor_identifier) - my_friendly_assert (args == NULL_TREE, 20020712); + gcc_assert (args == NULL_TREE); /* Convert to the base class, if necessary. */ - if (!same_type_ignoring_top_level_qualifiers_p + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (instance), BINFO_TYPE (binfo))) { if (name != ansi_assopname (NOP_EXPR)) @@ -4859,21 +5213,17 @@ build_special_member_call (tree instance, tree name, tree args, binfo, /*nonnull=*/1); } } - - my_friendly_assert (instance != NULL_TREE, 20020712); - /* Resolve the name. */ - if (!complete_type_or_else (BINFO_TYPE (binfo), NULL_TREE)) - return error_mark_node; + gcc_assert (instance != NULL_TREE); fns = lookup_fnfields (binfo, name, 1); - + /* When making a call to a constructor or destructor for a subobject that uses virtual base classes, pass down a pointer to a VTT for the subobject. */ if ((name == base_ctor_identifier || name == base_dtor_identifier) - && TYPE_USES_VIRTUAL_BASECLASSES (class_type)) + && CLASSTYPE_VBASECLASSES (class_type)) { tree vtt; tree sub_vtt; @@ -4883,26 +5233,26 @@ build_special_member_call (tree instance, tree name, tree args, Otherwise, we look it up using the VTT we were given. */ vtt = TREE_CHAIN (CLASSTYPE_VTABLES (current_class_type)); vtt = decay_conversion (vtt); - vtt = build (COND_EXPR, TREE_TYPE (vtt), - build (EQ_EXPR, boolean_type_node, - current_in_charge_parm, integer_zero_node), - current_vtt_parm, - vtt); - my_friendly_assert (BINFO_SUBVTT_INDEX (binfo), 20010110); - sub_vtt = build (PLUS_EXPR, TREE_TYPE (vtt), vtt, - BINFO_SUBVTT_INDEX (binfo)); + vtt = build3 (COND_EXPR, TREE_TYPE (vtt), + build2 (EQ_EXPR, boolean_type_node, + current_in_charge_parm, integer_zero_node), + current_vtt_parm, + vtt); + gcc_assert (BINFO_SUBVTT_INDEX (binfo)); + sub_vtt = build2 (PLUS_EXPR, TREE_TYPE (vtt), vtt, + BINFO_SUBVTT_INDEX (binfo)); args = tree_cons (NULL_TREE, sub_vtt, args); } - return build_new_method_call (instance, fns, args, - TYPE_BINFO (BINFO_TYPE (binfo)), - flags); + return build_new_method_call (instance, fns, args, + TYPE_BINFO (BINFO_TYPE (binfo)), + flags, /*fn=*/NULL); } /* Return the NAME, as a C string. The NAME indicates a function that is a member of TYPE. *FREE_P is set to true if the caller must - free the memory returned. + free the memory returned. Rather than go through all of this, we should simply set the names of constructors and destructors appropriately, and dispense with @@ -4918,7 +5268,7 @@ name_as_c_string (tree name, tree type, bool *free_p) /* Constructors and destructors are special. */ if (IDENTIFIER_CTOR_OR_DTOR_P (name)) { - pretty_name + pretty_name = (char *) IDENTIFIER_POINTER (constructor_name (type)); /* For a destructor, add the '~'. */ if (name == complete_dtor_identifier @@ -4945,11 +5295,13 @@ name_as_c_string (tree name, tree type, bool *free_p) return pretty_name; } -/* Build a call to "INSTANCE.FN (ARGS)". */ +/* Build a call to "INSTANCE.FN (ARGS)". If FN_P is non-NULL, it will + be set, upon return, to the function called. */ tree -build_new_method_call (tree instance, tree fns, tree args, - tree conversion_path, int flags) +build_new_method_call (tree instance, tree fns, tree args, + tree conversion_path, int flags, + tree *fn_p) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; @@ -4967,85 +5319,82 @@ build_new_method_call (tree instance, tree fns, tree args, tree orig_instance; tree orig_fns; tree orig_args; + void *p; - my_friendly_assert (instance != NULL_TREE, 20020729); + gcc_assert (instance != NULL_TREE); - if (error_operand_p (instance) + /* We don't know what function we're going to call, yet. */ + if (fn_p) + *fn_p = NULL_TREE; + + if (error_operand_p (instance) || error_operand_p (fns) || args == error_mark_node) return error_mark_node; + if (!BASELINK_P (fns)) + { + error ("call to non-function %qD", fns); + return error_mark_node; + } + orig_instance = instance; orig_fns = fns; orig_args = args; - if (processing_template_decl) - { - instance = build_non_dependent_expr (instance); - if (!BASELINK_P (fns) - && TREE_CODE (fns) != PSEUDO_DTOR_EXPR - && TREE_TYPE (fns) != unknown_type_node) - fns = build_non_dependent_expr (fns); - args = build_non_dependent_args (orig_args); - } - - /* Process the argument list. */ - user_args = args; - args = resolve_args (args); - if (args == error_mark_node) - return error_mark_node; - - if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE) - instance = convert_from_reference (instance); - basetype = TYPE_MAIN_VARIANT (TREE_TYPE (instance)); - instance_ptr = build_this (instance); - - if (!BASELINK_P (fns)) - { - error ("call to non-function `%D'", fns); - return error_mark_node; - } - + /* Dismantle the baselink to collect all the information we need. */ if (!conversion_path) conversion_path = BASELINK_BINFO (fns); access_binfo = BASELINK_ACCESS_BINFO (fns); optype = BASELINK_OPTYPE (fns); fns = BASELINK_FUNCTIONS (fns); - if (TREE_CODE (fns) == TEMPLATE_ID_EXPR) { explicit_targs = TREE_OPERAND (fns, 1); fns = TREE_OPERAND (fns, 0); template_only = 1; } - - my_friendly_assert (TREE_CODE (fns) == FUNCTION_DECL - || TREE_CODE (fns) == TEMPLATE_DECL - || TREE_CODE (fns) == OVERLOAD, - 20020712); - - /* XXX this should be handled before we get here. */ - if (! IS_AGGR_TYPE (basetype)) - { - if ((flags & LOOKUP_COMPLAIN) && basetype != error_mark_node) - error ("request for member `%D' in `%E', which is of non-aggregate type `%T'", - fns, instance, basetype); - - return error_mark_node; - } - + gcc_assert (TREE_CODE (fns) == FUNCTION_DECL + || TREE_CODE (fns) == TEMPLATE_DECL + || TREE_CODE (fns) == OVERLOAD); fn = get_first_fn (fns); name = DECL_NAME (fn); + basetype = TYPE_MAIN_VARIANT (TREE_TYPE (instance)); + gcc_assert (CLASS_TYPE_P (basetype)); + + if (processing_template_decl) + { + instance = build_non_dependent_expr (instance); + args = build_non_dependent_args (orig_args); + } + + /* The USER_ARGS are the arguments we will display to users if an + error occurs. The USER_ARGS should not include any + compiler-generated arguments. The "this" pointer hasn't been + added yet. However, we must remove the VTT pointer if this is a + call to a base-class constructor or destructor. */ + user_args = args; if (IDENTIFIER_CTOR_OR_DTOR_P (name)) { /* Callers should explicitly indicate whether they want to construct the complete object or just the part without virtual bases. */ - my_friendly_assert (name != ctor_identifier, 20000408); + gcc_assert (name != ctor_identifier); /* Similarly for destructors. */ - my_friendly_assert (name != dtor_identifier, 20000408); + gcc_assert (name != dtor_identifier); + /* Remove the VTT pointer, if present. */ + if ((name == base_ctor_identifier || name == base_dtor_identifier) + && CLASSTYPE_VBASECLASSES (basetype)) + user_args = TREE_CHAIN (user_args); } + /* Process the argument list. */ + args = resolve_args (args); + if (args == error_mark_node) + return error_mark_node; + + instance_ptr = build_this (instance); + /* It's OK to call destructors on cv-qualified objects. Therefore, convert the INSTANCE_PTR to the unqualified type, if necessary. */ if (DECL_DESTRUCTOR_P (fn)) @@ -5053,11 +5402,15 @@ build_new_method_call (tree instance, tree fns, tree args, tree type = build_pointer_type (basetype); if (!same_type_p (type, TREE_TYPE (instance_ptr))) instance_ptr = build_nop (type, instance_ptr); + name = complete_dtor_identifier; } class_type = (conversion_path ? BINFO_TYPE (conversion_path) : NULL_TREE); mem_args = tree_cons (NULL_TREE, instance_ptr, args); + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + for (fn = fns; fn; fn = OVL_NEXT (fn)) { tree t = OVL_CURRENT (fn); @@ -5075,16 +5428,16 @@ build_new_method_call (tree instance, tree fns, tree args, if (TREE_CODE (t) == TEMPLATE_DECL) /* A member template. */ - add_template_candidate (&candidates, t, + add_template_candidate (&candidates, t, class_type, explicit_targs, this_arglist, optype, - access_binfo, + access_binfo, conversion_path, flags, DEDUCE_CALL); else if (! template_only) - add_function_candidate (&candidates, t, + add_function_candidate (&candidates, t, class_type, this_arglist, access_binfo, @@ -5095,9 +5448,6 @@ build_new_method_call (tree instance, tree fns, tree args, candidates = splice_viable (candidates, pedantic, &any_viable_p); if (!any_viable_p) { - /* XXX will LOOKUP_SPECULATIVELY be needed when this is done? */ - if (flags & LOOKUP_SPECULATIVELY) - return NULL_TREE; if (!COMPLETE_TYPE_P (basetype)) cxx_incomplete_type_error (instance_ptr, basetype); else @@ -5106,68 +5456,99 @@ build_new_method_call (tree instance, tree fns, tree args, bool free_p; pretty_name = name_as_c_string (name, basetype, &free_p); - error ("no matching function for call to `%T::%s(%A)%#V'", + error ("no matching function for call to %<%T::%s(%A)%#V%>", basetype, pretty_name, user_args, TREE_TYPE (TREE_TYPE (instance_ptr))); if (free_p) free (pretty_name); } print_z_candidates (candidates); - return error_mark_node; + call = error_mark_node; } - - cand = tourney (candidates); - if (cand == 0) - { - char *pretty_name; - bool free_p; - - pretty_name = name_as_c_string (name, basetype, &free_p); - error ("call of overloaded `%s(%A)' is ambiguous", pretty_name, - user_args); - print_z_candidates (candidates); - if (free_p) - free (pretty_name); - return error_mark_node; - } - - if (DECL_PURE_VIRTUAL_P (cand->fn) - && instance == current_class_ref - && (DECL_CONSTRUCTOR_P (current_function_decl) - || DECL_DESTRUCTOR_P (current_function_decl)) - && ! (flags & LOOKUP_NONVIRTUAL) - && value_member (cand->fn, CLASSTYPE_PURE_VIRTUALS (basetype))) - error ((DECL_CONSTRUCTOR_P (current_function_decl) ? - "abstract virtual `%#D' called from constructor" - : "abstract virtual `%#D' called from destructor"), - cand->fn); - if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE - && is_dummy_object (instance_ptr)) - { - error ("cannot call member function `%D' without object", cand->fn); - return error_mark_node; - } - - if (DECL_VINDEX (cand->fn) && ! (flags & LOOKUP_NONVIRTUAL) - && resolves_to_fixed_type_p (instance, 0)) - flags |= LOOKUP_NONVIRTUAL; - - if (TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE) - call = build_over_call (cand, flags); else { - call = build_over_call (cand, flags); - /* In an expression of the form `a->f()' where `f' turns out to - be a static member function, `a' is none-the-less evaluated. */ - if (!is_dummy_object (instance_ptr) && TREE_SIDE_EFFECTS (instance)) - call = build (COMPOUND_EXPR, TREE_TYPE (call), instance, call); + cand = tourney (candidates); + if (cand == 0) + { + char *pretty_name; + bool free_p; + + pretty_name = name_as_c_string (name, basetype, &free_p); + error ("call of overloaded %<%s(%A)%> is ambiguous", pretty_name, + user_args); + print_z_candidates (candidates); + if (free_p) + free (pretty_name); + call = error_mark_node; + } + else + { + fn = cand->fn; + + if (!(flags & LOOKUP_NONVIRTUAL) + && DECL_PURE_VIRTUAL_P (fn) + && instance == current_class_ref + && (DECL_CONSTRUCTOR_P (current_function_decl) + || DECL_DESTRUCTOR_P (current_function_decl))) + /* This is not an error, it is runtime undefined + behavior. */ + warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? + "abstract virtual %q#D called from constructor" + : "abstract virtual %q#D called from destructor"), + fn); + + if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE + && is_dummy_object (instance_ptr)) + { + error ("cannot call member function %qD without object", + fn); + call = error_mark_node; + } + else + { + if (DECL_VINDEX (fn) && ! (flags & LOOKUP_NONVIRTUAL) + && resolves_to_fixed_type_p (instance, 0)) + flags |= LOOKUP_NONVIRTUAL; + /* Now we know what function is being called. */ + if (fn_p) + *fn_p = fn; + /* Build the actual CALL_EXPR. */ + call = build_over_call (cand, flags); + /* In an expression of the form `a->f()' where `f' turns + out to be a static member function, `a' is + none-the-less evaluated. */ + if (TREE_CODE (TREE_TYPE (fn)) != METHOD_TYPE + && !is_dummy_object (instance_ptr) + && TREE_SIDE_EFFECTS (instance_ptr)) + call = build2 (COMPOUND_EXPR, TREE_TYPE (call), + instance_ptr, call); + else if (call != error_mark_node + && DECL_DESTRUCTOR_P (cand->fn) + && !VOID_TYPE_P (TREE_TYPE (call))) + /* An explicit call of the form "x->~X()" has type + "void". However, on platforms where destructors + return "this" (i.e., those where + targetm.cxx.cdtor_returns_this is true), such calls + will appear to have a return value of pointer type + to the low-level call machinery. We do not want to + change the low-level machinery, since we want to be + able to optimize "delete f()" on such platforms as + "operator delete(~X(f()))" (rather than generating + "t = f(), ~X(t), operator delete (t)"). */ + call = build_nop (void_type_node, call); + } + } } - + if (processing_template_decl && call != error_mark_node) - return build_min_non_dep - (CALL_EXPR, call, - build_min_nt (COMPONENT_REF, orig_instance, orig_fns), - orig_args); + call = (build_min_non_dep + (CALL_EXPR, call, + build_min_nt (COMPONENT_REF, orig_instance, orig_fns, NULL_TREE), + orig_args, NULL_TREE)); + + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + return call; } @@ -5175,37 +5556,37 @@ build_new_method_call (tree instance, tree fns, tree args, subsequence of ICS2. */ static bool -is_subseq (tree ics1, tree ics2) +is_subseq (conversion *ics1, conversion *ics2) { /* We can assume that a conversion of the same code between the same types indicates a subsequence since we only get here if the types we are converting from are the same. */ - while (TREE_CODE (ics1) == RVALUE_CONV - || TREE_CODE (ics1) == LVALUE_CONV) - ics1 = TREE_OPERAND (ics1, 0); + while (ics1->kind == ck_rvalue + || ics1->kind == ck_lvalue) + ics1 = ics1->u.next; while (1) { - while (TREE_CODE (ics2) == RVALUE_CONV - || TREE_CODE (ics2) == LVALUE_CONV) - ics2 = TREE_OPERAND (ics2, 0); + while (ics2->kind == ck_rvalue + || ics2->kind == ck_lvalue) + ics2 = ics2->u.next; - if (TREE_CODE (ics2) == USER_CONV - || TREE_CODE (ics2) == AMBIG_CONV - || TREE_CODE (ics2) == IDENTITY_CONV) + if (ics2->kind == ck_user + || ics2->kind == ck_ambig + || ics2->kind == ck_identity) /* At this point, ICS1 cannot be a proper subsequence of ICS2. We can get a USER_CONV when we are comparing the second standard conversion sequence of two user conversion sequences. */ return false; - ics2 = TREE_OPERAND (ics2, 0); + ics2 = ics2->u.next; - if (TREE_CODE (ics2) == TREE_CODE (ics1) - && same_type_p (TREE_TYPE (ics2), TREE_TYPE (ics1)) - && same_type_p (TREE_TYPE (TREE_OPERAND (ics2, 0)), - TREE_TYPE (TREE_OPERAND (ics1, 0)))) + if (ics2->kind == ics1->kind + && same_type_p (ics2->type, ics1->type) + && same_type_p (ics2->u.next->type, + ics1->u.next->type)) return true; } } @@ -5233,32 +5614,32 @@ is_properly_derived_from (tree derived, tree base) modify it accordingly. */ static void -maybe_handle_implicit_object (tree *ics) +maybe_handle_implicit_object (conversion **ics) { - if (ICS_THIS_FLAG (*ics)) + if ((*ics)->this_p) { /* [over.match.funcs] - + For non-static member functions, the type of the implicit object parameter is "reference to cv X" where X is the class of which the function is a member and cv is the cv-qualification on the member function declaration. */ - tree t = *ics; + conversion *t = *ics; tree reference_type; /* The `this' parameter is a pointer to a class type. Make the implicit conversion talk about a reference to that same class type. */ - reference_type = TREE_TYPE (TREE_TYPE (*ics)); + reference_type = TREE_TYPE (t->type); reference_type = build_reference_type (reference_type); - if (TREE_CODE (t) == QUAL_CONV) - t = TREE_OPERAND (t, 0); - if (TREE_CODE (t) == PTR_CONV) - t = TREE_OPERAND (t, 0); - t = build1 (IDENTITY_CONV, TREE_TYPE (TREE_TYPE (t)), NULL_TREE); - t = direct_reference_binding (reference_type, t); + if (t->kind == ck_qual) + t = t->u.next; + if (t->kind == ck_ptr) + t = t->u.next; + t = build_identity_conv (TREE_TYPE (t->type), NULL_TREE); + t = direct_reference_binding (reference_type, t); *ics = t; } } @@ -5268,15 +5649,15 @@ maybe_handle_implicit_object (tree *ics) leave *ICS unchanged and return NULL_TREE. */ static tree -maybe_handle_ref_bind (tree *ics) +maybe_handle_ref_bind (conversion **ics) { - if (TREE_CODE (*ics) == REF_BIND) + if ((*ics)->kind == ck_ref_bind) { - tree old_ics = *ics; - tree type = TREE_TYPE (TREE_TYPE (old_ics)); - *ics = TREE_OPERAND (old_ics, 0); - ICS_USER_FLAG (*ics) = ICS_USER_FLAG (old_ics); - ICS_BAD_FLAG (*ics) = ICS_BAD_FLAG (old_ics); + conversion *old_ics = *ics; + tree type = TREE_TYPE (old_ics->type); + *ics = old_ics->u.next; + (*ics)->user_conv_p = old_ics->user_conv_p; + (*ics)->bad_p = old_ics->bad_p; return type; } @@ -5291,7 +5672,7 @@ maybe_handle_ref_bind (tree *ics) 0: ics1 and ics2 are indistinguishable */ static int -compare_ics (tree ics1, tree ics2) +compare_ics (conversion *ics1, conversion *ics2) { tree from_type1; tree from_type2; @@ -5301,7 +5682,7 @@ compare_ics (tree ics1, tree ics2) tree deref_from_type2 = NULL_TREE; tree deref_to_type1 = NULL_TREE; tree deref_to_type2 = NULL_TREE; - int rank1, rank2; + conversion_rank rank1, rank2; /* REF_BINDING is nonzero if the result of the conversion sequence is a reference type. In that case TARGET_TYPE is the @@ -5325,34 +5706,34 @@ compare_ics (tree ics1, tree ics2) --a standard conversion sequence (_over.ics.scs_) is a better conversion sequence than a user-defined conversion sequence or an ellipsis conversion sequence, and - + --a user-defined conversion sequence (_over.ics.user_) is a better conversion sequence than an ellipsis conversion sequence (_over.ics.ellipsis_). */ - rank1 = ICS_RANK (ics1); - rank2 = ICS_RANK (ics2); - + rank1 = CONVERSION_RANK (ics1); + rank2 = CONVERSION_RANK (ics2); + if (rank1 > rank2) return -1; else if (rank1 < rank2) return 1; - if (rank1 == BAD_RANK) + if (rank1 == cr_bad) { /* XXX Isn't this an extension? */ /* Both ICS are bad. We try to make a decision based on what would have happened if they'd been good. */ - if (ICS_USER_FLAG (ics1) > ICS_USER_FLAG (ics2) - || ICS_STD_RANK (ics1) > ICS_STD_RANK (ics2)) + if (ics1->user_conv_p > ics2->user_conv_p + || ics1->rank > ics2->rank) return -1; - else if (ICS_USER_FLAG (ics1) < ICS_USER_FLAG (ics2) - || ICS_STD_RANK (ics1) < ICS_STD_RANK (ics2)) + else if (ics1->user_conv_p < ics2->user_conv_p + || ics1->rank < ics2->rank) return 1; /* We couldn't make up our minds; try to figure it out below. */ } - if (ICS_ELLIPSIS_FLAG (ics1)) + if (ics1->ellipsis_p) /* Both conversions are ellipsis conversions. */ return 0; @@ -5362,49 +5743,53 @@ compare_ics (tree ics1, tree ics2) ond standard conversion sequence of U1 is better than the second standard conversion sequence of U2. */ - if (ICS_USER_FLAG (ics1)) + if (ics1->user_conv_p) { - tree t1, t2; + conversion *t1; + conversion *t2; - for (t1 = ics1; TREE_CODE (t1) != USER_CONV; t1 = TREE_OPERAND (t1, 0)) - if (TREE_CODE (t1) == AMBIG_CONV) + for (t1 = ics1; t1->kind != ck_user; t1 = t1->u.next) + if (t1->kind == ck_ambig) return 0; - for (t2 = ics2; TREE_CODE (t2) != USER_CONV; t2 = TREE_OPERAND (t2, 0)) - if (TREE_CODE (t2) == AMBIG_CONV) + for (t2 = ics2; t2->kind != ck_user; t2 = t2->u.next) + if (t2->kind == ck_ambig) return 0; - if (USER_CONV_FN (t1) != USER_CONV_FN (t2)) + if (t1->cand->fn != t2->cand->fn) return 0; /* We can just fall through here, after setting up FROM_TYPE1 and FROM_TYPE2. */ - from_type1 = TREE_TYPE (t1); - from_type2 = TREE_TYPE (t2); + from_type1 = t1->type; + from_type2 = t2->type; } else { - /* We're dealing with two standard conversion sequences. + conversion *t1; + conversion *t2; + + /* We're dealing with two standard conversion sequences. [over.ics.rank] - + Standard conversion sequence S1 is a better conversion sequence than standard conversion sequence S2 if - + --S1 is a proper subsequence of S2 (comparing the conversion sequences in the canonical form defined by _over.ics.scs_, excluding any Lvalue Transformation; the identity conversion sequence is considered to be a subsequence of any non-identity conversion sequence */ - - from_type1 = ics1; - while (TREE_CODE (from_type1) != IDENTITY_CONV) - from_type1 = TREE_OPERAND (from_type1, 0); - from_type1 = TREE_TYPE (from_type1); - - from_type2 = ics2; - while (TREE_CODE (from_type2) != IDENTITY_CONV) - from_type2 = TREE_OPERAND (from_type2, 0); - from_type2 = TREE_TYPE (from_type2); + + t1 = ics1; + while (t1->kind != ck_identity) + t1 = t1->u.next; + from_type1 = t1->type; + + t2 = ics2; + while (t2->kind != ck_identity) + t2 = t2->u.next; + from_type2 = t2->type; } if (same_type_p (from_type1, from_type2)) @@ -5435,17 +5820,17 @@ compare_ics (tree ics1, tree ics2) --A conversion that is not a conversion of a pointer, or pointer to member, to bool is better than another conversion that is such - a conversion. + a conversion. The ICS_STD_RANK automatically handles the pointer-to-bool rule, so that we do not have to check it explicitly. */ - if (ICS_STD_RANK (ics1) < ICS_STD_RANK (ics2)) + if (ics1->rank < ics2->rank) return 1; - else if (ICS_STD_RANK (ics2) < ICS_STD_RANK (ics1)) + else if (ics2->rank < ics1->rank) return -1; - to_type1 = TREE_TYPE (ics1); - to_type2 = TREE_TYPE (ics2); + to_type1 = ics1->type; + to_type2 = ics2->type; if (TYPE_PTR_P (from_type1) && TYPE_PTR_P (from_type2) @@ -5478,10 +5863,10 @@ compare_ics (tree ics1, tree ics2) && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type1)) && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type2))) { - /* This was one of the pointer or pointer-like conversions. + /* This was one of the pointer or pointer-like conversions. [over.ics.rank] - + --If class B is derived directly or indirectly from class A, conversion of B* to A* is better than conversion of B* to void*, and conversion of A* to void* is better than @@ -5520,10 +5905,10 @@ compare_ics (tree ics1, tree ics2) --If class B is derived directly or indirectly from class A and class C is derived directly or indirectly from B, - + --conversion of C* to B* is better than conversion of C* to - A*, - + A*, + --conversion of B* to A* is better than conversion of C* to A* */ if (same_type_p (deref_from_type1, deref_from_type2)) @@ -5552,7 +5937,7 @@ compare_ics (tree ics1, tree ics2) tree from = non_reference (from_type1); /* [over.ics.rank] - + --binding of an expression of type C to a reference of type B& is better than binding an expression of type C to a reference of type A& @@ -5576,9 +5961,9 @@ compare_ics (tree ics1, tree ics2) --binding of an expression of type B to a reference of type A& is better than binding an expression of type C to a - reference of type A&, + reference of type A&, - --onversion of B to A is better than conversion of C to A */ + --conversion of B to A is better than conversion of C to A */ if (is_properly_derived_from (from_type1, to) && is_properly_derived_from (from_type2, to)) { @@ -5595,19 +5980,19 @@ compare_ics (tree ics1, tree ics2) similar types T1 and T2 (_conv.qual_), respectively, and the cv- qualification signature of type T1 is a proper subset of the cv- qualification signature of type T2 */ - if (TREE_CODE (ics1) == QUAL_CONV - && TREE_CODE (ics2) == QUAL_CONV + if (ics1->kind == ck_qual + && ics2->kind == ck_qual && same_type_p (from_type1, from_type2)) return comp_cv_qual_signature (to_type1, to_type2); /* [over.ics.rank] - + --S1 and S2 are reference bindings (_dcl.init.ref_), and the types to which the references refer are the same type except for top-level cv-qualifiers, and the type to which the reference initialized by S2 refers is more cv-qualified than the type to which the reference initialized by S1 refers */ - + if (target_type1 && target_type2 && same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2)) return comp_cv_qualification (target_type2, target_type1); @@ -5619,16 +6004,16 @@ compare_ics (tree ics1, tree ics2) /* The source type for this standard conversion sequence. */ static tree -source_type (tree t) +source_type (conversion *t) { - for (;; t = TREE_OPERAND (t, 0)) + for (;; t = t->u.next) { - if (TREE_CODE (t) == USER_CONV - || TREE_CODE (t) == AMBIG_CONV - || TREE_CODE (t) == IDENTITY_CONV) - return TREE_TYPE (t); + if (t->kind == ck_user + || t->kind == ck_ambig + || t->kind == ck_identity) + return t->type; } - abort (); + gcc_unreachable (); } /* Note a warning about preferring WINNER to LOSER. We do this by storing @@ -5638,9 +6023,11 @@ source_type (tree t) static void add_warning (struct z_candidate *winner, struct z_candidate *loser) { - winner->warnings = tree_cons (NULL_TREE, - build_zc_wrapper (loser), - winner->warnings); + candidate_warning *cw = (candidate_warning *) + conversion_obstack_alloc (sizeof (candidate_warning)); + cw->loser = loser; + cw->next = winner->warnings; + winner->warnings = cw; } /* Compare two candidates for overloading as described in @@ -5654,7 +6041,9 @@ static int joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { int winner = 0; - int i, off1 = 0, off2 = 0, len; + int off1 = 0, off2 = 0; + size_t i; + size_t len; /* Candidates that involve bad conversions are always worse than those that don't. */ @@ -5666,7 +6055,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) /* If we have two pseudo-candidates for conversions to the same type, or two candidates for the same function, arbitrarily pick one. */ if (cand1->fn == cand2->fn - && (TYPE_P (cand1->fn) || DECL_P (cand1->fn))) + && (IS_TYPE_OR_DECL_P (cand1->fn))) return 1; /* a viable function F1 @@ -5681,57 +6070,59 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) the implicit object parameter of the non-static function. The standard says to pretend that the static function has an object parm, but that won't work with operator overloading. */ - len = TREE_VEC_LENGTH (cand1->convs); - if (len != TREE_VEC_LENGTH (cand2->convs)) + len = cand1->num_convs; + if (len != cand2->num_convs) { - if (DECL_STATIC_FUNCTION_P (cand1->fn) - && ! DECL_STATIC_FUNCTION_P (cand2->fn)) + int static_1 = DECL_STATIC_FUNCTION_P (cand1->fn); + int static_2 = DECL_STATIC_FUNCTION_P (cand2->fn); + + gcc_assert (static_1 != static_2); + + if (static_1) off2 = 1; - else if (! DECL_STATIC_FUNCTION_P (cand1->fn) - && DECL_STATIC_FUNCTION_P (cand2->fn)) + else { off1 = 1; --len; } - else - abort (); } for (i = 0; i < len; ++i) { - tree t1 = TREE_VEC_ELT (cand1->convs, i+off1); - tree t2 = TREE_VEC_ELT (cand2->convs, i+off2); + conversion *t1 = cand1->convs[i + off1]; + conversion *t2 = cand2->convs[i + off2]; int comp = compare_ics (t1, t2); if (comp != 0) { if (warn_sign_promo - && ICS_RANK (t1) + ICS_RANK (t2) == STD_RANK + PROMO_RANK - && TREE_CODE (t1) == STD_CONV - && TREE_CODE (t2) == STD_CONV - && TREE_CODE (TREE_TYPE (t1)) == INTEGER_TYPE - && TREE_CODE (TREE_TYPE (t2)) == INTEGER_TYPE - && (TYPE_PRECISION (TREE_TYPE (t1)) - == TYPE_PRECISION (TREE_TYPE (t2))) - && (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t1, 0))) - || (TREE_CODE (TREE_TYPE (TREE_OPERAND (t1, 0))) + && (CONVERSION_RANK (t1) + CONVERSION_RANK (t2) + == cr_std + cr_promotion) + && t1->kind == ck_std + && t2->kind == ck_std + && TREE_CODE (t1->type) == INTEGER_TYPE + && TREE_CODE (t2->type) == INTEGER_TYPE + && (TYPE_PRECISION (t1->type) + == TYPE_PRECISION (t2->type)) + && (TYPE_UNSIGNED (t1->u.next->type) + || (TREE_CODE (t1->u.next->type) == ENUMERAL_TYPE))) { - tree type = TREE_TYPE (TREE_OPERAND (t1, 0)); + tree type = t1->u.next->type; tree type1, type2; struct z_candidate *w, *l; if (comp > 0) - type1 = TREE_TYPE (t1), type2 = TREE_TYPE (t2), + type1 = t1->type, type2 = t2->type, w = cand1, l = cand2; else - type1 = TREE_TYPE (t2), type2 = TREE_TYPE (t1), + type1 = t2->type, type2 = t1->type, w = cand2, l = cand1; if (warn) { - warning ("passing `%T' chooses `%T' over `%T'", - type, type1, type2); - warning (" in call to `%D'", w->fn); + warning (OPT_Wsign_promo, "passing %qT chooses %qT over %qT", + type, type1, type2); + warning (OPT_Wsign_promo, " in call to %qD", w->fn); } else add_warning (w, l); @@ -5755,12 +6146,12 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { struct z_candidate *w, *l; bool give_warning = false; - + if (winner == 1) w = cand1, l = cand2; else w = cand2, l = cand1; - + /* We don't want to complain about `X::operator T1 ()' beating `X::operator T2 () const', when T2 is a no less cv-qualified version of T1. */ @@ -5769,7 +6160,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { tree t = TREE_TYPE (TREE_TYPE (l->fn)); tree f = TREE_TYPE (TREE_TYPE (w->fn)); - + if (TREE_CODE (t) == TREE_CODE (f) && POINTER_TYPE_P (t)) { t = TREE_TYPE (t); @@ -5780,18 +6171,18 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) } else give_warning = true; - + if (!give_warning) /*NOP*/; else if (warn) { - tree source = source_type (TREE_VEC_ELT (w->convs, 0)); + tree source = source_type (w->convs[0]); if (! DECL_CONSTRUCTOR_P (w->fn)) source = TREE_TYPE (source); - warning ("choosing `%D' over `%D'", w->fn, l->fn); - warning (" for conversion from `%T' to `%T'", - source, TREE_TYPE (w->second_conv)); - warning (" because conversion sequence for the argument is better"); + warning (OPT_Wconversion, "choosing %qD over %qD", w->fn, l->fn); + warning (OPT_Wconversion, " for conversion from %qT to %qT", + source, w->second_conv->type); + inform (" because conversion sequence for the argument is better"); } else add_warning (w, l); @@ -5803,35 +6194,29 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) /* or, if not that, F1 is a non-template function and F2 is a template function specialization. */ - - if (! cand1->template && cand2->template) + + if (!cand1->template_decl && cand2->template_decl) return 1; - else if (cand1->template && ! cand2->template) + else if (cand1->template_decl && !cand2->template_decl) return -1; - + /* or, if not that, F1 and F2 are template functions and the function template for F1 is more specialized than the template for F2 according to the partial ordering rules. */ - - if (cand1->template && cand2->template) - { - winner = more_specialized - (TI_TEMPLATE (cand1->template), TI_TEMPLATE (cand2->template), - DEDUCE_ORDER, - /* Tell the deduction code how many real function arguments - we saw, not counting the implicit 'this' argument. But, - add_function_candidate() suppresses the "this" argument - for constructors. - [temp.func.order]: The presence of unused ellipsis and default + if (cand1->template_decl && cand2->template_decl) + { + winner = more_specialized_fn + (TI_TEMPLATE (cand1->template_decl), + TI_TEMPLATE (cand2->template_decl), + /* [temp.func.order]: The presence of unused ellipsis and default arguments has no effect on the partial ordering of function - templates. */ - TREE_VEC_LENGTH (cand1->convs) - - (DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn) - - DECL_CONSTRUCTOR_P (cand1->fn))); + templates. add_function_candidate() will not have + counted the "this" argument for constructors. */ + cand1->num_convs + DECL_CONSTRUCTOR_P (cand1->fn)); if (winner) - return winner; + return winner; } /* or, if not that, @@ -5846,28 +6231,28 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) { winner = compare_ics (cand1->second_conv, cand2->second_conv); if (winner) - return winner; + return winner; } - + /* Check whether we can discard a builtin candidate, either because we have two identical ones or matching builtin and non-builtin candidates. (Pedantically in the latter case the builtin which matched the user function should not be added to the overload set, but we spot it here. - + [over.match.oper] ... the builtin candidates include ... - do not have the same parameter type list as any non-template non-member candidate. */ - + if (TREE_CODE (cand1->fn) == IDENTIFIER_NODE || TREE_CODE (cand2->fn) == IDENTIFIER_NODE) { for (i = 0; i < len; ++i) - if (!same_type_p (TREE_TYPE (TREE_VEC_ELT (cand1->convs, i)), - TREE_TYPE (TREE_VEC_ELT (cand2->convs, i)))) + if (!same_type_p (cand1->convs[i]->type, + cand2->convs[i]->type)) break; - if (i == TREE_VEC_LENGTH (cand1->convs)) + if (i == cand1->num_convs) { if (cand1->fn == cand2->fn) /* Two built-in candidates; arbitrarily pick one. */ @@ -5886,29 +6271,29 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (DECL_P (cand1->fn) && DECL_P (cand2->fn) && equal_functions (cand1->fn, cand2->fn)) return 1; - + tweak: /* Extension: If the worst conversion for one candidate is worse than the worst conversion for the other, take the first. */ if (!pedantic) { - int rank1 = IDENTITY_RANK, rank2 = IDENTITY_RANK; + conversion_rank rank1 = cr_identity, rank2 = cr_identity; struct z_candidate *w = 0, *l = 0; for (i = 0; i < len; ++i) { - if (ICS_RANK (TREE_VEC_ELT (cand1->convs, i+off1)) > rank1) - rank1 = ICS_RANK (TREE_VEC_ELT (cand1->convs, i+off1)); - if (ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2)) > rank2) - rank2 = ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2)); + if (CONVERSION_RANK (cand1->convs[i+off1]) > rank1) + rank1 = CONVERSION_RANK (cand1->convs[i+off1]); + if (CONVERSION_RANK (cand2->convs[i + off2]) > rank2) + rank2 = CONVERSION_RANK (cand2->convs[i + off2]); } if (rank1 < rank2) winner = 1, w = cand1, l = cand2; if (rank1 > rank2) winner = -1, w = cand2, l = cand1; if (winner) - { + { if (warn) { pedwarn ("\ @@ -5920,11 +6305,11 @@ the worst conversion for the second:"); } else add_warning (w, l); - return winner; - } + return winner; + } } - my_friendly_assert (!winner, 20010121); + gcc_assert (!winner); return 0; } @@ -5954,7 +6339,7 @@ tourney (struct z_candidate *candidates) { champ = challenger->next; if (champ == 0) - return 0; + return NULL; champ_compared_to_predecessor = 0; } else @@ -5970,14 +6355,14 @@ tourney (struct z_candidate *candidates) /* Make sure the champ is better than all the candidates it hasn't yet been compared to. */ - for (challenger = candidates; - challenger != champ + for (challenger = candidates; + challenger != champ && !(champ_compared_to_predecessor && challenger->next == champ); challenger = challenger->next) { fate = joust (champ, challenger, 0); if (fate != 1) - return 0; + return NULL; } return champ; @@ -5988,16 +6373,29 @@ tourney (struct z_candidate *candidates) bool can_convert (tree to, tree from) { - return can_convert_arg (to, from, NULL_TREE); + return can_convert_arg (to, from, NULL_TREE, LOOKUP_NORMAL); } /* Returns nonzero if ARG (of type FROM) can be converted to TO. */ bool -can_convert_arg (tree to, tree from, tree arg) +can_convert_arg (tree to, tree from, tree arg, int flags) { - tree t = implicit_conversion (to, from, arg, LOOKUP_NORMAL); - return (t && ! ICS_BAD_FLAG (t)); + conversion *t; + void *p; + bool ok_p; + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + + t = implicit_conversion (to, from, arg, /*c_cast_p=*/false, + flags); + ok_p = (t && !t->bad_p); + + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return ok_p; } /* Like can_convert_arg, but allows dubious conversions as well. */ @@ -6005,7 +6403,18 @@ can_convert_arg (tree to, tree from, tree arg) bool can_convert_arg_bad (tree to, tree from, tree arg) { - return implicit_conversion (to, from, arg, LOOKUP_NORMAL) != 0; + conversion *t; + void *p; + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + /* Try to perform the conversion. */ + t = implicit_conversion (to, from, arg, /*c_cast_p=*/false, + LOOKUP_NORMAL); + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return t != NULL; } /* Convert EXPR to TYPE. Return the converted expression. @@ -6017,31 +6426,56 @@ can_convert_arg_bad (tree to, tree from, tree arg) tree perform_implicit_conversion (tree type, tree expr) { - tree conv; - + conversion *conv; + void *p; + if (error_operand_p (expr)) return error_mark_node; + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + conv = implicit_conversion (type, TREE_TYPE (expr), expr, + /*c_cast_p=*/false, LOOKUP_NORMAL); if (!conv) { - error ("could not convert `%E' to `%T'", expr, type); - return error_mark_node; + error ("could not convert %qE to %qT", expr, type); + expr = error_mark_node; } + else if (processing_template_decl) + { + /* In a template, we are only concerned about determining the + type of non-dependent expressions, so we do not have to + perform the actual conversion. */ + if (TREE_TYPE (expr) != type) + expr = build_nop (type, expr); + } + else + expr = convert_like (conv, expr); - return convert_like (conv, expr); + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return expr; } /* Convert EXPR to TYPE (as a direct-initialization) if that is permitted. If the conversion is valid, the converted expression is returned. Otherwise, NULL_TREE is returned, except in the case - that TYPE is a class type; in that case, an error is issued. */ + that TYPE is a class type; in that case, an error is issued. If + C_CAST_P is true, then this direction initialization is taking + place as part of a static_cast being attempted as part of a C-style + cast. */ tree -perform_direct_initialization_if_possible (tree type, tree expr) +perform_direct_initialization_if_possible (tree type, + tree expr, + bool c_cast_p) { - tree conv; - + conversion *conv; + void *p; + if (type == error_mark_node || error_operand_p (expr)) return error_mark_node; /* [dcl.init] @@ -6056,16 +6490,27 @@ perform_direct_initialization_if_possible (tree type, tree expr) { expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), - LOOKUP_NORMAL); + type, LOOKUP_NORMAL); return build_cplus_new (type, expr); } + + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + conv = implicit_conversion (type, TREE_TYPE (expr), expr, + c_cast_p, LOOKUP_NORMAL); - if (!conv || ICS_BAD_FLAG (conv)) - return NULL_TREE; - return convert_like_real (conv, expr, NULL_TREE, 0, 0, - /*issue_conversion_warnings=*/false); + if (!conv || conv->bad_p) + expr = NULL_TREE; + else + expr = convert_like_real (conv, expr, NULL_TREE, 0, 0, + /*issue_conversion_warnings=*/false, + c_cast_p); + + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return expr; } /* DECL is a VAR_DECL whose type is a REFERENCE_TYPE. The reference @@ -6073,15 +6518,13 @@ perform_direct_initialization_if_possible (tree type, tree expr) with the indicated TYPE; this variable will store the value to which the reference is bound. */ -tree +tree make_temporary_var_for_ref_to_temp (tree decl, tree type) { tree var; /* Create the variable. */ - var = build_decl (VAR_DECL, NULL_TREE, type); - DECL_ARTIFICIAL (var) = 1; - TREE_USED (var) = 1; + var = create_temporary_var (type); /* Register the variable. */ if (TREE_STATIC (decl)) @@ -6096,12 +6539,8 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type) var = pushdecl_top_level (var); } else - { - /* Create a new cleanup level if necessary. */ - maybe_push_cleanup_level (type); - /* Don't push unnamed temps. Do set DECL_CONTEXT, though. */ - DECL_CONTEXT (var) = current_function_decl; - } + /* Create a new cleanup level if necessary. */ + maybe_push_cleanup_level (type); return var; } @@ -6111,31 +6550,36 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type) the VAR_DECL being initialized with the EXPR. (In that case, the type of DECL will be TYPE.) If DECL is non-NULL, then CLEANUP must also be non-NULL, and with *CLEANUP initialized to NULL. Upon - return, if *CLEANUP is no longer NULL, it will be a CLEANUP_STMT - that should be inserted after the returned expression is used to - initialize DECL. + return, if *CLEANUP is no longer NULL, it will be an expression + that should be pushed as a cleanup after the returned expression + is used to initialize DECL. Return the converted expression. */ tree initialize_reference (tree type, tree expr, tree decl, tree *cleanup) { - tree conv; + conversion *conv; + void *p; if (type == error_mark_node || error_operand_p (expr)) return error_mark_node; - conv = reference_binding (type, TREE_TYPE (expr), expr, LOOKUP_NORMAL); - if (!conv || ICS_BAD_FLAG (conv)) + /* Get the high-water mark for the CONVERSION_OBSTACK. */ + p = conversion_obstack_alloc (0); + + conv = reference_binding (type, TREE_TYPE (expr), expr, /*c_cast_p=*/false, + LOOKUP_NORMAL); + if (!conv || conv->bad_p) { if (!(TYPE_QUALS (TREE_TYPE (type)) & TYPE_QUAL_CONST) - && !real_lvalue_p (expr)) - error ("invalid initialization of non-const reference of " - "type '%T' from a temporary of type '%T'", - type, TREE_TYPE (expr)); + && !real_lvalue_p (expr)) + error ("invalid initialization of non-const reference of " + "type %qT from a temporary of type %qT", + type, TREE_TYPE (expr)); else - error ("invalid initialization of reference of type " - "'%T' from expression of type '%T'", type, + error ("invalid initialization of reference of type " + "%qT from expression of type %qT", type, TREE_TYPE (expr)); return error_mark_node; } @@ -6154,12 +6598,12 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) full-expression in which they are created. In that case, we store the converted expression into a new - VAR_DECL in a new scope. + VAR_DECL in a new scope. However, we want to be careful not to create temporaries when they are not required. For example, given: - struct B {}; + struct B {}; struct D : public B {}; D f(); const B& b = f(); @@ -6174,22 +6618,22 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) we can extend the lifetime of the return value of the conversion operator. */ - my_friendly_assert (TREE_CODE (conv) == REF_BIND, 20030302); + gcc_assert (conv->kind == ck_ref_bind); if (decl) { tree var; tree base_conv_type; /* Skip over the REF_BIND. */ - conv = TREE_OPERAND (conv, 0); + conv = conv->u.next; /* If the next conversion is a BASE_CONV, skip that too -- but remember that the conversion was required. */ - if (TREE_CODE (conv) == BASE_CONV && !NEED_TEMPORARY_P (conv)) + if (conv->kind == ck_base) { - if (CHECK_COPY_CONSTRUCTOR_P (conv)) + if (conv->check_copy_constructor_p) check_constructor_callable (TREE_TYPE (expr), expr); - base_conv_type = TREE_TYPE (conv); - conv = TREE_OPERAND (conv, 0); + base_conv_type = conv->type; + conv = conv->u.next; } else base_conv_type = NULL_TREE; @@ -6197,79 +6641,92 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup) expr = convert_like_real (conv, expr, /*fn=*/NULL_TREE, /*argnum=*/0, /*inner=*/-1, - /*issue_conversion_warnings=*/true); + /*issue_conversion_warnings=*/true, + /*c_cast_p=*/false); if (error_operand_p (expr)) - return error_mark_node; - if (!real_lvalue_p (expr)) + expr = error_mark_node; + else { - tree init; - tree type; - - /* Create the temporary variable. */ - type = TREE_TYPE (expr); - var = make_temporary_var_for_ref_to_temp (decl, type); - layout_decl (var, 0); - /* If the rvalue is the result of a function call it will be - a TARGET_EXPR. If it is some other construct (such as a - member access expression where the underlying object is - itself the result of a function call), turn it into a - TARGET_EXPR here. It is important that EXPR be a - TARGET_EXPR below since otherwise the INIT_EXPR will - attempt to make a bitwise copy of EXPR to intialize - VAR. */ - if (TREE_CODE (expr) != TARGET_EXPR) - expr = get_target_expr (expr); - /* Create the INIT_EXPR that will initialize the temporary - variable. */ - init = build (INIT_EXPR, type, var, expr); - if (at_function_scope_p ()) + if (!real_lvalue_p (expr)) { - add_decl_stmt (var); - *cleanup = cxx_maybe_build_cleanup (var); - if (*cleanup) - /* We must be careful to destroy the temporary only - after its initialization has taken place. If the - initialization throws an exception, then the - destructor should not be run. We cannot simply - transform INIT into something like: - - (INIT, ({ CLEANUP_STMT; })) + tree init; + tree type; - because emit_local_var always treats the - initializer as a full-expression. Thus, the - destructor would run too early; it would run at the - end of initializing the reference variable, rather - than at the end of the block enclosing the - reference variable. + /* Create the temporary variable. */ + type = TREE_TYPE (expr); + var = make_temporary_var_for_ref_to_temp (decl, type); + layout_decl (var, 0); + /* If the rvalue is the result of a function call it will be + a TARGET_EXPR. If it is some other construct (such as a + member access expression where the underlying object is + itself the result of a function call), turn it into a + TARGET_EXPR here. It is important that EXPR be a + TARGET_EXPR below since otherwise the INIT_EXPR will + attempt to make a bitwise copy of EXPR to initialize + VAR. */ + if (TREE_CODE (expr) != TARGET_EXPR) + expr = get_target_expr (expr); + /* Create the INIT_EXPR that will initialize the temporary + variable. */ + init = build2 (INIT_EXPR, type, var, expr); + if (at_function_scope_p ()) + { + add_decl_expr (var); + *cleanup = cxx_maybe_build_cleanup (var); - The solution is to pass back a CLEANUP_STMT which - the caller is responsible for attaching to the - statement tree. */ - *cleanup = build_stmt (CLEANUP_STMT, var, *cleanup); + /* We must be careful to destroy the temporary only + after its initialization has taken place. If the + initialization throws an exception, then the + destructor should not be run. We cannot simply + transform INIT into something like: + + (INIT, ({ CLEANUP_STMT; })) + + because emit_local_var always treats the + initializer as a full-expression. Thus, the + destructor would run too early; it would run at the + end of initializing the reference variable, rather + than at the end of the block enclosing the + reference variable. + + The solution is to pass back a cleanup expression + which the caller is responsible for attaching to + the statement tree. */ + } + else + { + rest_of_decl_compilation (var, /*toplev=*/1, at_eof); + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) + static_aggregates = tree_cons (NULL_TREE, var, + static_aggregates); + } + /* Use its address to initialize the reference variable. */ + expr = build_address (var); + if (base_conv_type) + expr = convert_to_base (expr, + build_pointer_type (base_conv_type), + /*check_access=*/true, + /*nonnull=*/true); + expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), init, expr); } else - { - rest_of_decl_compilation (var, NULL, /*toplev=*/1, at_eof); - if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) - static_aggregates = tree_cons (NULL_TREE, var, - static_aggregates); - } - /* Use its address to initialize the reference variable. */ - expr = build_address (var); - expr = build (COMPOUND_EXPR, TREE_TYPE (expr), init, expr); + /* Take the address of EXPR. */ + expr = build_unary_op (ADDR_EXPR, expr, 0); + /* If a BASE_CONV was required, perform it now. */ + if (base_conv_type) + expr = (perform_implicit_conversion + (build_pointer_type (base_conv_type), expr)); + expr = build_nop (type, expr); } - else - /* Take the address of EXPR. */ - expr = build_unary_op (ADDR_EXPR, expr, 0); - /* If a BASE_CONV was required, perform it now. */ - if (base_conv_type) - expr = (perform_implicit_conversion - (build_pointer_type (base_conv_type), expr)); - return build_nop (type, expr); } + else + /* Perform the conversion. */ + expr = convert_like (conv, expr); - /* Perform the conversion. */ - return convert_like (conv, expr); + /* Free all the conversions we allocated. */ + obstack_free (&conversion_obstack, p); + + return expr; } #include "gt-cp-call.h" diff --git a/contrib/gcc/cp/class.c b/contrib/gcc/cp/class.c index c14313c8bf8..ff1d84bbdef 100644 --- a/contrib/gcc/cp/class.c +++ b/contrib/gcc/cp/class.c @@ -1,7 +1,6 @@ /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -18,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* High-level class interface. */ @@ -34,9 +33,10 @@ Boston, MA 02111-1307, USA. */ #include "rtl.h" #include "output.h" #include "toplev.h" -#include "lex.h" #include "target.h" #include "convert.h" +#include "cgraph.h" +#include "tree-dump.h" /* The number of nested classes being processed. If we are not in the scope of any class, this is zero. */ @@ -60,6 +60,10 @@ typedef struct class_stack_node { /* If were defining TYPE, the names used in this class. */ splay_tree names_used; + + /* Nonzero if this class is no longer open, because of a call to + push_to_top_level. */ + size_t hidden; }* class_stack_node_t; typedef struct vtbl_init_data_s @@ -81,7 +85,7 @@ typedef struct vtbl_init_data_s tree vbase; /* The functions in vbase for which we have already provided vcall offsets. */ - varray_type fns; + VEC(tree,gc) *fns; /* The vtable index of the next vcall or vbase offset. */ tree index; /* Nonzero if we are building the initializer for the primary @@ -103,9 +107,12 @@ typedef int (*subobject_offset_fn) (tree, tree, splay_tree); static int current_class_stack_size; static class_stack_node_t current_class_stack; +/* The size of the largest empty class seen in this translation unit. */ +static GTY (()) tree sizeof_biggest_empty_class; + /* An array of all local classes present in this translation unit, in declaration order. */ -varray_type local_classes; +VEC(tree,gc) *local_classes; static tree get_vfield_name (tree); static void finish_struct_anon (tree); @@ -118,37 +125,34 @@ static void modify_vtable_entry (tree, tree, tree, tree, tree *); static void finish_struct_bits (tree); static int alter_access (tree, tree, tree); static void handle_using_decl (tree, tree); -static void check_for_override (tree, tree); static tree dfs_modify_vtables (tree, void *); static tree modify_all_vtables (tree, tree); -static void determine_primary_base (tree); +static void determine_primary_bases (tree); static void finish_struct_methods (tree); static void maybe_warn_about_overly_private_class (tree); static int method_name_cmp (const void *, const void *); static int resort_method_name_cmp (const void *, const void *); -static void add_implicitly_declared_members (tree, int, int, int); +static void add_implicitly_declared_members (tree, int, int); static tree fixed_type_or_null (tree, int *, int *); -static tree resolve_address_of_overloaded_function (tree, tree, tsubst_flags_t, - bool, tree); +static tree build_simple_base_path (tree expr, tree binfo); static tree build_vtbl_ref_1 (tree, tree); static tree build_vtbl_initializer (tree, tree, tree, tree, int *); static int count_fields (tree); static int add_fields_to_record_type (tree, struct sorted_fields_type*, int); static void check_bitfield_decl (tree); -static void check_field_decl (tree, tree, int *, int *, int *, int *); -static void check_field_decls (tree, tree *, int *, int *, int *); +static void check_field_decl (tree, tree, int *, int *, int *); +static void check_field_decls (tree, tree *, int *, int *); static tree *build_base_field (record_layout_info, tree, splay_tree, tree *); static void build_base_fields (record_layout_info, splay_tree, tree *); static void check_methods (tree); static void remove_zero_width_bit_fields (tree); -static void check_bases (tree, int *, int *, int *); +static void check_bases (tree, int *, int *); static void check_bases_and_members (tree); static tree create_vtable_ptr (tree, tree *); static void include_empty_classes (record_layout_info); static void layout_class_type (tree, tree *); static void fixup_pending_inline (tree); static void fixup_inline_methods (tree); -static void set_primary_base (tree, tree); static void propagate_binfo_offsets (tree, tree); static void layout_virtual_bases (record_layout_info, splay_tree); static void build_vbase_offset_vtbl_entries (tree, vtbl_init_data *); @@ -157,11 +161,11 @@ static void add_vcall_offset_vtbl_entries_1 (tree, vtbl_init_data *); static void build_vcall_offset_vtbl_entries (tree, vtbl_init_data *); static void add_vcall_offset (tree, tree, vtbl_init_data *); static void layout_vtable_decl (tree, int); -static tree dfs_find_final_overrider (tree, void *); +static tree dfs_find_final_overrider_pre (tree, void *); static tree dfs_find_final_overrider_post (tree, void *); -static tree dfs_find_final_overrider_q (tree, int, void *); static tree find_final_overrider (tree, tree, tree); static int make_new_vtable (tree, tree); +static tree get_primary_binfo (tree); static int maybe_indent_hierarchy (FILE *, int, int); static tree dump_class_hierarchy_r (FILE *, int, tree, tree, int); static void dump_class_hierarchy (tree); @@ -172,37 +176,32 @@ static void dump_vtt (tree, tree); static void dump_thunk (FILE *, int, tree); static tree build_vtable (tree, tree, tree); static void initialize_vtable (tree, tree); -static void initialize_array (tree, tree); static void layout_nonempty_base_or_field (record_layout_info, - tree, tree, splay_tree); + tree, tree, splay_tree); static tree end_of_class (tree, int); static bool layout_empty_base (tree, tree, splay_tree); static void accumulate_vtbl_inits (tree, tree, tree, tree, tree); static tree dfs_accumulate_vtbl_inits (tree, tree, tree, tree, tree); static void build_rtti_vtbl_entries (tree, vtbl_init_data *); -static void build_vcall_and_vbase_vtbl_entries (tree, - vtbl_init_data *); -static void mark_primary_bases (tree); +static void build_vcall_and_vbase_vtbl_entries (tree, vtbl_init_data *); static void clone_constructors_and_destructors (tree); static tree build_clone (tree, tree); static void update_vtable_entry_for_fn (tree, tree, tree, tree *, unsigned); -static tree copy_virtuals (tree); static void build_ctor_vtbl_group (tree, tree); static void build_vtt (tree); static tree binfo_ctor_vtable (tree); static tree *build_vtt_inits (tree, tree, tree *, tree *); static tree dfs_build_secondary_vptr_vtt_inits (tree, void *); -static tree dfs_ctor_vtable_bases_queue_p (tree, int, void *data); static tree dfs_fixup_binfo_vtbls (tree, void *); static int record_subobject_offset (tree, tree, splay_tree); static int check_subobject_offset (tree, tree, splay_tree); static int walk_subobject_offsets (tree, subobject_offset_fn, - tree, splay_tree, tree, int); -static void record_subobject_offsets (tree, tree, splay_tree, int); + tree, splay_tree, tree, int); +static void record_subobject_offsets (tree, tree, splay_tree, bool); static int layout_conflict_p (tree, tree, splay_tree, int); static int splay_tree_compare_integer_csts (splay_tree_key k1, - splay_tree_key k2); + splay_tree_key k2); static void warn_about_ambiguous_bases (tree); static bool type_requires_array_cookie (tree); static bool contains_empty_class_p (tree); @@ -211,12 +210,6 @@ static int empty_base_at_nonzero_offset_p (tree, tree, splay_tree); static tree end_of_base (tree); static tree get_vcall_index (tree, tree); -/* Macros for dfs walking during vtt construction. See - dfs_ctor_vtable_bases_queue_p, dfs_build_secondary_vptr_vtt_inits - and dfs_fixup_binfo_vtbls. */ -#define VTT_TOP_LEVEL_P(NODE) TREE_UNSIGNED (NODE) -#define VTT_MARKED_BINFO_P(NODE) TREE_USED (NODE) - /* Variables shared between class.c and call.c. */ #ifdef GATHER_STATISTICS @@ -241,9 +234,9 @@ int n_inner_fields_searched = 0; tree build_base_path (enum tree_code code, - tree expr, - tree binfo, - int nonnull) + tree expr, + tree binfo, + int nonnull) { tree v_binfo = NULL_TREE; tree d_binfo = NULL_TREE; @@ -254,6 +247,8 @@ build_base_path (enum tree_code code, tree ptr_target_type; int fixed_type_p; int want_pointer = TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE; + bool has_empty = false; + bool virtual_access; if (expr == error_mark_node || binfo == error_mark_node || !binfo) return error_mark_node; @@ -261,23 +256,28 @@ build_base_path (enum tree_code code, for (probe = binfo; probe; probe = BINFO_INHERITANCE_CHAIN (probe)) { d_binfo = probe; - if (!v_binfo && TREE_VIA_VIRTUAL (probe)) + if (is_empty_class (BINFO_TYPE (probe))) + has_empty = true; + if (!v_binfo && BINFO_VIRTUAL_P (probe)) v_binfo = probe; } probe = TYPE_MAIN_VARIANT (TREE_TYPE (expr)); if (want_pointer) probe = TYPE_MAIN_VARIANT (TREE_TYPE (probe)); - - my_friendly_assert (code == MINUS_EXPR - ? same_type_p (BINFO_TYPE (binfo), probe) - : code == PLUS_EXPR - ? same_type_p (BINFO_TYPE (d_binfo), probe) - : false, 20010723); - + + gcc_assert ((code == MINUS_EXPR + && SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), probe)) + || (code == PLUS_EXPR + && SAME_BINFO_TYPE_P (BINFO_TYPE (d_binfo), probe))); + + if (binfo == d_binfo) + /* Nothing to do. */ + return expr; + if (code == MINUS_EXPR && v_binfo) { - error ("cannot convert from base `%T' to derived type `%T' via virtual base `%T'", + error ("cannot convert from base %qT to derived type %qT via virtual base %qT", BINFO_TYPE (binfo), BINFO_TYPE (d_binfo), BINFO_TYPE (v_binfo)); return error_mark_node; } @@ -286,113 +286,236 @@ build_base_path (enum tree_code code, /* This must happen before the call to save_expr. */ expr = build_unary_op (ADDR_EXPR, expr, 0); + offset = BINFO_OFFSET (binfo); fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); - if (fixed_type_p <= 0 && TREE_SIDE_EFFECTS (expr)) + target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo) : BINFO_TYPE (d_binfo); + + /* Do we need to look in the vtable for the real offset? */ + virtual_access = (v_binfo && fixed_type_p <= 0); + + /* Do we need to check for a null pointer? */ + if (want_pointer && !nonnull) + { + /* If we know the conversion will not actually change the value + of EXPR, then we can avoid testing the expression for NULL. + We have to avoid generating a COMPONENT_REF for a base class + field, because other parts of the compiler know that such + expressions are always non-NULL. */ + if (!virtual_access && integer_zerop (offset)) + { + tree class_type; + /* TARGET_TYPE has been extracted from BINFO, and, is + therefore always cv-unqualified. Extract the + cv-qualifiers from EXPR so that the expression returned + matches the input. */ + class_type = TREE_TYPE (TREE_TYPE (expr)); + target_type + = cp_build_qualified_type (target_type, + cp_type_quals (class_type)); + return build_nop (build_pointer_type (target_type), expr); + } + null_test = error_mark_node; + } + + /* Protect against multiple evaluation if necessary. */ + if (TREE_SIDE_EFFECTS (expr) && (null_test || virtual_access)) expr = save_expr (expr); - if (want_pointer && !nonnull) - null_test = build (EQ_EXPR, boolean_type_node, expr, integer_zero_node); - - offset = BINFO_OFFSET (binfo); - - if (v_binfo && fixed_type_p <= 0) + /* Now that we've saved expr, build the real null test. */ + if (null_test) + { + tree zero = cp_convert (TREE_TYPE (expr), integer_zero_node); + null_test = fold_build2 (NE_EXPR, boolean_type_node, + expr, zero); + } + + /* If this is a simple base reference, express it as a COMPONENT_REF. */ + if (code == PLUS_EXPR && !virtual_access + /* We don't build base fields for empty bases, and they aren't very + interesting to the optimizers anyway. */ + && !has_empty) + { + expr = build_indirect_ref (expr, NULL); + expr = build_simple_base_path (expr, binfo); + if (want_pointer) + expr = build_address (expr); + target_type = TREE_TYPE (expr); + goto out; + } + + if (virtual_access) { /* Going via virtual base V_BINFO. We need the static offset - from V_BINFO to BINFO, and the dynamic offset from D_BINFO to - V_BINFO. That offset is an entry in D_BINFO's vtable. */ + from V_BINFO to BINFO, and the dynamic offset from D_BINFO to + V_BINFO. That offset is an entry in D_BINFO's vtable. */ tree v_offset; if (fixed_type_p < 0 && in_base_initializer) { - /* In a base member initializer, we cannot rely on - the vtable being set up. We have to use the vtt_parm. */ - tree derived = BINFO_INHERITANCE_CHAIN (v_binfo); - - v_offset = build (PLUS_EXPR, TREE_TYPE (current_vtt_parm), - current_vtt_parm, BINFO_VPTR_INDEX (derived)); - - v_offset = build1 (INDIRECT_REF, - TREE_TYPE (TYPE_VFIELD (BINFO_TYPE (derived))), - v_offset); - + /* In a base member initializer, we cannot rely on the + vtable being set up. We have to indirect via the + vtt_parm. */ + tree t; + + t = TREE_TYPE (TYPE_VFIELD (current_class_type)); + t = build_pointer_type (t); + v_offset = convert (t, current_vtt_parm); + v_offset = build_indirect_ref (v_offset, NULL); } else v_offset = build_vfield_ref (build_indirect_ref (expr, NULL), TREE_TYPE (TREE_TYPE (expr))); - - v_offset = build (PLUS_EXPR, TREE_TYPE (v_offset), - v_offset, BINFO_VPTR_FIELD (v_binfo)); - v_offset = build1 (NOP_EXPR, + + v_offset = build2 (PLUS_EXPR, TREE_TYPE (v_offset), + v_offset, BINFO_VPTR_FIELD (v_binfo)); + v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); v_offset = build_indirect_ref (v_offset, NULL); + TREE_CONSTANT (v_offset) = 1; + TREE_INVARIANT (v_offset) = 1; offset = convert_to_integer (ptrdiff_type_node, - size_diffop (offset, + size_diffop (offset, BINFO_OFFSET (v_binfo))); if (!integer_zerop (offset)) - v_offset = build (code, ptrdiff_type_node, v_offset, offset); + v_offset = build2 (code, ptrdiff_type_node, v_offset, offset); if (fixed_type_p < 0) /* Negative fixed_type_p means this is a constructor or destructor; virtual base layout is fixed in in-charge [cd]tors, but not in base [cd]tors. */ - offset = build (COND_EXPR, ptrdiff_type_node, - build (EQ_EXPR, boolean_type_node, - current_in_charge_parm, integer_zero_node), - v_offset, - BINFO_OFFSET (binfo)); + offset = build3 (COND_EXPR, ptrdiff_type_node, + build2 (EQ_EXPR, boolean_type_node, + current_in_charge_parm, integer_zero_node), + v_offset, + convert_to_integer (ptrdiff_type_node, + BINFO_OFFSET (binfo))); else offset = v_offset; } - target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo) : BINFO_TYPE (d_binfo); - target_type = cp_build_qualified_type (target_type, cp_type_quals (TREE_TYPE (TREE_TYPE (expr)))); ptr_target_type = build_pointer_type (target_type); if (want_pointer) target_type = ptr_target_type; - + expr = build1 (NOP_EXPR, ptr_target_type, expr); if (!integer_zerop (offset)) - expr = build (code, ptr_target_type, expr, offset); + expr = build2 (code, ptr_target_type, expr, offset); else null_test = NULL; - + if (!want_pointer) expr = build_indirect_ref (expr, NULL); + out: if (null_test) - expr = build (COND_EXPR, target_type, null_test, - build1 (NOP_EXPR, target_type, integer_zero_node), - expr); + expr = fold_build3 (COND_EXPR, target_type, null_test, expr, + fold_build1 (NOP_EXPR, target_type, + integer_zero_node)); return expr; } -/* Convert OBJECT to the base TYPE. If CHECK_ACCESS is true, an error - message is emitted if TYPE is inaccessible. OBJECT is assumed to - be non-NULL. */ +/* Subroutine of build_base_path; EXPR and BINFO are as in that function. + Perform a derived-to-base conversion by recursively building up a + sequence of COMPONENT_REFs to the appropriate base fields. */ + +static tree +build_simple_base_path (tree expr, tree binfo) +{ + tree type = BINFO_TYPE (binfo); + tree d_binfo = BINFO_INHERITANCE_CHAIN (binfo); + tree field; + + if (d_binfo == NULL_TREE) + { + tree temp; + + gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type); + + /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' + into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only + an lvalue in the frontend; only _DECLs and _REFs are lvalues + in the backend. */ + temp = unary_complex_lvalue (ADDR_EXPR, expr); + if (temp) + expr = build_indirect_ref (temp, NULL); + + return expr; + } + + /* Recurse. */ + expr = build_simple_base_path (expr, d_binfo); + + for (field = TYPE_FIELDS (BINFO_TYPE (d_binfo)); + field; field = TREE_CHAIN (field)) + /* Is this the base field created by build_base_field? */ + if (TREE_CODE (field) == FIELD_DECL + && DECL_FIELD_IS_BASE (field) + && TREE_TYPE (field) == type) + { + /* We don't use build_class_member_access_expr here, as that + has unnecessary checks, and more importantly results in + recursive calls to dfs_walk_once. */ + int type_quals = cp_type_quals (TREE_TYPE (expr)); + + expr = build3 (COMPONENT_REF, + cp_build_qualified_type (type, type_quals), + expr, field, NULL_TREE); + expr = fold_if_not_in_template (expr); + + /* Mark the expression const or volatile, as appropriate. + Even though we've dealt with the type above, we still have + to mark the expression itself. */ + if (type_quals & TYPE_QUAL_CONST) + TREE_READONLY (expr) = 1; + if (type_quals & TYPE_QUAL_VOLATILE) + TREE_THIS_VOLATILE (expr) = 1; + + return expr; + } + + /* Didn't find the base field?!? */ + gcc_unreachable (); +} + +/* Convert OBJECT to the base TYPE. OBJECT is an expression whose + type is a class type or a pointer to a class type. In the former + case, TYPE is also a class type; in the latter it is another + pointer type. If CHECK_ACCESS is true, an error message is emitted + if TYPE is inaccessible. If OBJECT has pointer type, the value is + assumed to be non-NULL. */ tree -convert_to_base (tree object, tree type, bool check_access) +convert_to_base (tree object, tree type, bool check_access, bool nonnull) { tree binfo; + tree object_type; - binfo = lookup_base (TREE_TYPE (object), type, - check_access ? ba_check : ba_ignore, + if (TYPE_PTR_P (TREE_TYPE (object))) + { + object_type = TREE_TYPE (TREE_TYPE (object)); + type = TREE_TYPE (type); + } + else + object_type = TREE_TYPE (object); + + binfo = lookup_base (object_type, type, + check_access ? ba_check : ba_unique, NULL); if (!binfo || binfo == error_mark_node) return error_mark_node; - return build_base_path (PLUS_EXPR, object, binfo, /*nonnull=*/1); + return build_base_path (PLUS_EXPR, object, binfo, nonnull); } -/* EXPR is an expression with class type. BASE is a base class (a - BINFO) of that class type. Returns EXPR, converted to the BASE +/* EXPR is an expression with unqualified class type. BASE is a base + binfo of that class type. Returns EXPR, converted to the BASE type. This function assumes that EXPR is the most derived class; therefore virtual bases can be found at their static offsets. */ @@ -402,15 +525,15 @@ convert_to_base_statically (tree expr, tree base) tree expr_type; expr_type = TREE_TYPE (expr); - if (!same_type_p (expr_type, BINFO_TYPE (base))) + if (!SAME_BINFO_TYPE_P (BINFO_TYPE (base), expr_type)) { tree pointer_type; pointer_type = build_pointer_type (expr_type); expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1); if (!integer_zerop (BINFO_OFFSET (base))) - expr = build (PLUS_EXPR, pointer_type, expr, - build_nop (pointer_type, BINFO_OFFSET (base))); + expr = build2 (PLUS_EXPR, pointer_type, expr, + build_nop (pointer_type, BINFO_OFFSET (base))); expr = build_nop (build_pointer_type (BINFO_TYPE (base)), expr); expr = build1 (INDIRECT_REF, BINFO_TYPE (base), expr); } @@ -419,6 +542,36 @@ convert_to_base_statically (tree expr, tree base) } +tree +build_vfield_ref (tree datum, tree type) +{ + tree vfield, vcontext; + + if (datum == error_mark_node) + return error_mark_node; + + /* First, convert to the requested type. */ + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (datum), type)) + datum = convert_to_base (datum, type, /*check_access=*/false, + /*nonnull=*/true); + + /* Second, the requested type may not be the owner of its own vptr. + If not, convert to the base class that owns it. We cannot use + convert_to_base here, because VCONTEXT may appear more than once + in the inheritance hierarchy of TYPE, and thus direct conversion + between the types may be ambiguous. Following the path back up + one step at a time via primary bases avoids the problem. */ + vfield = TYPE_VFIELD (type); + vcontext = DECL_CONTEXT (vfield); + while (!same_type_ignoring_top_level_qualifiers_p (vcontext, type)) + { + datum = build_simple_base_path (datum, CLASSTYPE_PRIMARY_BINFO (type)); + type = TREE_TYPE (datum); + } + + return build3 (COMPONENT_REF, TREE_TYPE (vfield), datum, vfield, NULL_TREE); +} + /* Given an object INSTANCE, return an expression which yields the vtable element corresponding to INDEX. There are many special cases for INSTANCE which we take care of here, mainly to avoid @@ -441,17 +594,19 @@ build_vtbl_ref_1 (tree instance, tree idx) if (fixed_type && !cdtorp) { tree binfo = lookup_base (fixed_type, basetype, - ba_ignore|ba_quiet, NULL); + ba_unique | ba_quiet, NULL); if (binfo) - vtbl = BINFO_VTABLE (binfo); + vtbl = unshare_expr (BINFO_VTABLE (binfo)); } if (!vtbl) vtbl = build_vfield_ref (instance, basetype); - + assemble_external (vtbl); aref = build_array_ref (vtbl, idx); + TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx); + TREE_INVARIANT (aref) = TREE_CONSTANT (aref); return aref; } @@ -464,13 +619,15 @@ build_vtbl_ref (tree instance, tree idx) return aref; } -/* Given an object INSTANCE, return an expression which yields a - function pointer corresponding to vtable element INDEX. */ +/* Given a stable object pointer INSTANCE_PTR, return an expression which + yields a function pointer corresponding to vtable element INDEX. */ tree -build_vfn_ref (tree instance, tree idx) +build_vfn_ref (tree instance_ptr, tree idx) { - tree aref = build_vtbl_ref_1 (instance, idx); + tree aref; + + aref = build_vtbl_ref_1 (build_indirect_ref (instance_ptr, 0), idx); /* When using function descriptors, the address of the vtable entry is treated as a function pointer. */ @@ -478,6 +635,9 @@ build_vfn_ref (tree instance, tree idx) aref = build1 (NOP_EXPR, TREE_TYPE (aref), build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1)); + /* Remember this as a method reference, for later devirtualization. */ + aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); + return aref; } @@ -490,13 +650,30 @@ get_vtable_name (tree type) return mangle_vtbl_for_type (type); } -/* Return an IDENTIFIER_NODE for the name of the virtual table table - for TYPE. */ +/* DECL is an entity associated with TYPE, like a virtual table or an + implicitly generated constructor. Determine whether or not DECL + should have external or internal linkage at the object file + level. This routine does not deal with COMDAT linkage and other + similar complexities; it simply sets TREE_PUBLIC if it possible for + entities in other translation units to contain copies of DECL, in + the abstract. */ -tree -get_vtt_name (tree type) +void +set_linkage_according_to_type (tree type, tree decl) { - return mangle_vtt_for_type (type); + /* If TYPE involves a local class in a function with internal + linkage, then DECL should have internal linkage too. Other local + classes have no linkage -- but if their containing functions + have external linkage, it makes sense for DECL to have external + linkage too. That will allow template definitions to be merged, + for example. */ + if (no_linkage_check (type, /*relaxed_p=*/true)) + { + TREE_PUBLIC (decl) = 0; + DECL_INTERFACE_KNOWN (decl) = 1; + } + else + TREE_PUBLIC (decl) = 1; } /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE. @@ -519,13 +696,36 @@ build_vtable (tree class_type, tree name, tree vtable_type) DECL_VIRTUAL_P (decl) = 1; DECL_ALIGN (decl) = TARGET_VTABLE_ENTRY_ALIGN; DECL_VTABLE_OR_VTT_P (decl) = 1; - /* At one time the vtable info was grabbed 2 words at a time. This fails on sparc unless you have 8-byte alignment. (tiemann) */ DECL_ALIGN (decl) = MAX (TYPE_ALIGN (double_type_node), DECL_ALIGN (decl)); + set_linkage_according_to_type (class_type, decl); + /* The vtable has not been defined -- yet. */ + DECL_EXTERNAL (decl) = 1; + DECL_NOT_REALLY_EXTERN (decl) = 1; - import_export_vtable (decl, class_type, 0); + /* Mark the VAR_DECL node representing the vtable itself as a + "gratuitous" one, thereby forcing dwarfout.c to ignore it. It + is rather important that such things be ignored because any + effort to actually generate DWARF for them will run into + trouble when/if we encounter code like: + + #pragma interface + struct S { virtual void member (); }; + + because the artificial declaration of the vtable itself (as + manufactured by the g++ front end) will say that the vtable is + a static member of `S' but only *after* the debug output for + the definition of `S' has already been output. This causes + grief because the DWARF entry for the definition of the vtable + will try to refer back to an earlier *declaration* of the + vtable as a static member of `S' and there won't be one. We + might be able to arrange to have the "vtable static member" + attached to the member list for `S' before the debug info for + `S' get written (which would solve the problem) but that would + require more intrusive changes to the g++ front end. */ + DECL_IGNORED_P (decl) = 1; return decl; } @@ -536,42 +736,26 @@ build_vtable (tree class_type, tree name, tree vtable_type) impossible to actually build the vtable, but is useful to get at those which are known to exist in the runtime. */ -tree +tree get_vtable_decl (tree type, int complete) { tree decl; if (CLASSTYPE_VTABLES (type)) return CLASSTYPE_VTABLES (type); - + decl = build_vtable (type, get_vtable_name (type), vtbl_type_node); CLASSTYPE_VTABLES (type) = decl; if (complete) { DECL_EXTERNAL (decl) = 1; - cp_finish_decl (decl, NULL_TREE, NULL_TREE, 0); + finish_decl (decl, NULL_TREE, NULL_TREE); } return decl; } -/* Returns a copy of the BINFO_VIRTUALS list in BINFO. The - BV_VCALL_INDEX for each entry is cleared. */ - -static tree -copy_virtuals (tree binfo) -{ - tree copies; - tree t; - - copies = copy_list (BINFO_VIRTUALS (binfo)); - for (t = copies; t; t = TREE_CHAIN (t)) - BV_VCALL_INDEX (t) = NULL_TREE; - - return copies; -} - /* Build the primary virtual function table for TYPE. If BINFO is non-NULL, build the vtable starting with the initial approximation that it is the same as the one which is the head of the association @@ -585,22 +769,22 @@ build_primary_vtable (tree binfo, tree type) tree virtuals; decl = get_vtable_decl (type, /*complete=*/0); - + if (binfo) { if (BINFO_NEW_VTABLE_MARKED (binfo)) /* We have already created a vtable for this base, so there's no need to do it again. */ return 0; - - virtuals = copy_virtuals (binfo); + + virtuals = copy_list (BINFO_VIRTUALS (binfo)); TREE_TYPE (decl) = TREE_TYPE (get_vtbl_decl_for_binfo (binfo)); DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl)); DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (TREE_TYPE (decl)); } else { - my_friendly_assert (TREE_TYPE (decl) == vtbl_type_node, 20000118); + gcc_assert (TREE_TYPE (decl) == vtbl_type_node); virtuals = NULL_TREE; } @@ -611,8 +795,8 @@ build_primary_vtable (tree binfo, tree type) /* Initialize the association list for this type, based on our first approximation. */ - TYPE_BINFO_VTABLE (type) = decl; - TYPE_BINFO_VIRTUALS (type) = virtuals; + BINFO_VTABLE (TYPE_BINFO (type)) = decl; + BINFO_VIRTUALS (TYPE_BINFO (type)) = virtuals; SET_BINFO_NEW_VTABLE_MARKED (TYPE_BINFO (type)); return 1; } @@ -642,9 +826,9 @@ build_secondary_vtable (tree binfo) /* Remember that we've created a vtable for this BINFO, so that we don't try to do so again. */ SET_BINFO_NEW_VTABLE_MARKED (binfo); - + /* Make fresh virtual list, so we can smash it later. */ - BINFO_VIRTUALS (binfo) = copy_virtuals (binfo); + BINFO_VIRTUALS (binfo) = copy_list (BINFO_VIRTUALS (binfo)); /* Secondary vtables are laid out as part of the same structure as the primary vtable. */ @@ -662,10 +846,7 @@ make_new_vtable (tree t, tree binfo) /* In this case, it is *type*'s vtable we are modifying. We start with the approximation that its vtable is that of the immediate base class. */ - /* ??? This actually passes TYPE_BINFO (t), not the primary base binfo, - since we've updated DECL_CONTEXT (TYPE_VFIELD (t)) by now. */ - return build_primary_vtable (TYPE_BINFO (DECL_CONTEXT (TYPE_VFIELD (t))), - t); + return build_primary_vtable (binfo, t); else /* This is our very own copy of `basetype' to play with. Later, we will fill in all the virtual functions that override the @@ -682,10 +863,10 @@ make_new_vtable (tree t, tree binfo) static void modify_vtable_entry (tree t, - tree binfo, - tree fndecl, - tree delta, - tree *virtuals) + tree binfo, + tree fndecl, + tree delta, + tree *virtuals) { tree v; @@ -713,42 +894,47 @@ modify_vtable_entry (tree t, } -/* Add method METHOD to class TYPE. If ERROR_P is true, we are adding - the method after the class has already been defined because a - declaration for it was seen. (Even though that is erroneous, we - add the method for improved error recovery.) */ +/* Add method METHOD to class TYPE. If USING_DECL is non-null, it is + the USING_DECL naming METHOD. Returns true if the method could be + added to the method vec. */ -void -add_method (tree type, tree method, int error_p) +bool +add_method (tree type, tree method, tree using_decl) { - int using; - int len; - int slot; - tree method_vec; - int template_conv_p; + unsigned slot; + tree overload; + bool template_conv_p = false; + bool conv_p; + VEC(tree,gc) *method_vec; + bool complete_p; + bool insert_p = false; + tree current_fns; if (method == error_mark_node) - return; - - using = (DECL_CONTEXT (method) != type); - template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL - && DECL_TEMPLATE_CONV_FN_P (method)); + return false; - if (!CLASSTYPE_METHOD_VEC (type)) - /* Make a new method vector. We start with 8 entries. We must - allocate at least two (for constructors and destructors), and - we're going to end up with an assignment operator at some point - as well. - - We could use a TREE_LIST for now, and convert it to a TREE_VEC - in finish_struct, but we would probably waste more memory - making the links in the list than we would by over-allocating - the size of the vector here. Furthermore, we would complicate - all the code that expects this to be a vector. */ - CLASSTYPE_METHOD_VEC (type) = make_tree_vec (8); + complete_p = COMPLETE_TYPE_P (type); + conv_p = DECL_CONV_FN_P (method); + if (conv_p) + template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL + && DECL_TEMPLATE_CONV_FN_P (method)); method_vec = CLASSTYPE_METHOD_VEC (type); - len = TREE_VEC_LENGTH (method_vec); + if (!method_vec) + { + /* Make a new method vector. We start with 8 entries. We must + allocate at least two (for constructors and destructors), and + we're going to end up with an assignment operator at some + point as well. */ + method_vec = VEC_alloc (tree, gc, 8); + /* Create slots for constructors and destructors. */ + VEC_quick_push (tree, method_vec, NULL_TREE); + VEC_quick_push (tree, method_vec, NULL_TREE); + CLASSTYPE_METHOD_VEC (type) = method_vec; + } + + /* Maintain TYPE_HAS_CONSTRUCTOR, etc. */ + grok_special_member_properties (method); /* Constructors and destructors go in special slots. */ if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (method)) @@ -756,115 +942,50 @@ add_method (tree type, tree method, int error_p) else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method)) { slot = CLASSTYPE_DESTRUCTOR_SLOT; - TYPE_HAS_DESTRUCTOR (type) = 1; - + if (TYPE_FOR_JAVA (type)) - error (DECL_ARTIFICIAL (method) - ? "Java class '%T' cannot have an implicit non-trivial destructor" - : "Java class '%T' cannot have a destructor", - DECL_CONTEXT (method)); + { + if (!DECL_ARTIFICIAL (method)) + error ("Java class %qT cannot have a destructor", type); + else if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) + error ("Java class %qT cannot have an implicit non-trivial " + "destructor", + type); + } } else { - int have_template_convs_p = 0; - - /* See if we already have an entry with this name. */ - for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; slot < len; ++slot) - { - tree m = TREE_VEC_ELT (method_vec, slot); + tree m; - if (!m) - break; + insert_p = true; + /* See if we already have an entry with this name. */ + for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; + VEC_iterate (tree, method_vec, slot, m); + ++slot) + { m = OVL_CURRENT (m); - if (template_conv_p) { - have_template_convs_p = (TREE_CODE (m) == TEMPLATE_DECL - && DECL_TEMPLATE_CONV_FN_P (m)); - - /* If we need to move things up, see if there's - space. */ - if (!have_template_convs_p) - { - slot = len - 1; - if (TREE_VEC_ELT (method_vec, slot)) - slot++; - } + if (TREE_CODE (m) == TEMPLATE_DECL + && DECL_TEMPLATE_CONV_FN_P (m)) + insert_p = false; break; } + if (conv_p && !DECL_CONV_FN_P (m)) + break; if (DECL_NAME (m) == DECL_NAME (method)) + { + insert_p = false; + break; + } + if (complete_p + && !DECL_CONV_FN_P (m) + && DECL_NAME (m) > DECL_NAME (method)) break; } - - if (slot == len) - { - /* We need a bigger method vector. */ - int new_len; - tree new_vec; - - /* In the non-error case, we are processing a class - definition. Double the size of the vector to give room - for new methods. */ - if (!error_p) - new_len = 2 * len; - /* In the error case, the vector is already complete. We - don't expect many errors, and the rest of the front-end - will get confused if there are empty slots in the vector. */ - else - new_len = len + 1; - - new_vec = make_tree_vec (new_len); - memcpy (&TREE_VEC_ELT (new_vec, 0), &TREE_VEC_ELT (method_vec, 0), - len * sizeof (tree)); - len = new_len; - method_vec = CLASSTYPE_METHOD_VEC (type) = new_vec; - } - - if (DECL_CONV_FN_P (method) && !TREE_VEC_ELT (method_vec, slot)) - { - /* Type conversion operators have to come before ordinary - methods; add_conversions depends on this to speed up - looking for conversion operators. So, if necessary, we - slide some of the vector elements up. In theory, this - makes this algorithm O(N^2) but we don't expect many - conversion operators. */ - if (template_conv_p) - slot = CLASSTYPE_FIRST_CONVERSION_SLOT; - else - for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; slot < len; ++slot) - { - tree fn = TREE_VEC_ELT (method_vec, slot); - - if (!fn) - /* There are no more entries in the vector, so we - can insert the new conversion operator here. */ - break; - - if (!DECL_CONV_FN_P (OVL_CURRENT (fn))) - /* We can insert the new function right at the - SLOTth position. */ - break; - } - - if (template_conv_p && have_template_convs_p) - /*OK*/; - else if (!TREE_VEC_ELT (method_vec, slot)) - /* There is nothing in the Ith slot, so we can avoid - moving anything. */ - ; - else - { - /* We know the last slot in the vector is empty - because we know that at this point there's room - for a new function. */ - memmove (&TREE_VEC_ELT (method_vec, slot + 1), - &TREE_VEC_ELT (method_vec, slot), - (len - slot - 1) * sizeof (tree)); - TREE_VEC_ELT (method_vec, slot) = NULL_TREE; - } - } } - + current_fns = insert_p ? NULL_TREE : VEC_index (tree, method_vec, slot); + if (processing_template_decl) /* TYPE is a template class. Don't issue any errors now; wait until instantiation time to complain. */ @@ -874,9 +995,7 @@ add_method (tree type, tree method, int error_p) tree fns; /* Check to see if we've already got this method. */ - for (fns = TREE_VEC_ELT (method_vec, slot); - fns; - fns = OVL_NEXT (fns)) + for (fns = current_fns; fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); tree fn_type; @@ -910,53 +1029,85 @@ add_method (tree type, tree method, int error_p) && (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1))) != TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2))))) continue; - - /* For templates, the template parms must be identical. */ + + /* For templates, the return type and template parameters + must be identical. */ if (TREE_CODE (fn) == TEMPLATE_DECL && (!same_type_p (TREE_TYPE (fn_type), TREE_TYPE (method_type)) || !comp_template_parms (DECL_TEMPLATE_PARMS (fn), DECL_TEMPLATE_PARMS (method)))) continue; - + if (! DECL_STATIC_FUNCTION_P (fn)) parms1 = TREE_CHAIN (parms1); if (! DECL_STATIC_FUNCTION_P (method)) parms2 = TREE_CHAIN (parms2); - if (compparms (parms1, parms2) - && (!DECL_CONV_FN_P (fn) + if (compparms (parms1, parms2) + && (!DECL_CONV_FN_P (fn) || same_type_p (TREE_TYPE (fn_type), TREE_TYPE (method_type)))) { - if (using && DECL_CONTEXT (fn) == type) - /* Defer to the local function. */ - return; + if (using_decl) + { + if (DECL_CONTEXT (fn) == type) + /* Defer to the local function. */ + return false; + if (DECL_CONTEXT (fn) == DECL_CONTEXT (method)) + error ("repeated using declaration %q+D", using_decl); + else + error ("using declaration %q+D conflicts with a previous using declaration", + using_decl); + } else { - cp_error_at ("`%#D' and `%#D' cannot be overloaded", - method, fn); - - /* We don't call duplicate_decls here to merge - the declarations because that will confuse - things if the methods have inline - definitions. In particular, we will crash - while processing the definitions. */ - return; + error ("%q+#D cannot be overloaded", method); + error ("with %q+#D", fn); } + + /* We don't call duplicate_decls here to merge the + declarations because that will confuse things if the + methods have inline definitions. In particular, we + will crash while processing the definitions. */ + return false; } } } - /* Actually insert the new method. */ - TREE_VEC_ELT (method_vec, slot) - = build_overload (method, TREE_VEC_ELT (method_vec, slot)); + /* A class should never have more than one destructor. */ + if (current_fns && DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method)) + return false; - /* Add the new binding. */ - if (!DECL_CONSTRUCTOR_P (method) - && !DECL_DESTRUCTOR_P (method)) - push_class_level_binding (DECL_NAME (method), - TREE_VEC_ELT (method_vec, slot)); + /* Add the new binding. */ + overload = build_overload (method, current_fns); + + if (conv_p) + TYPE_HAS_CONVERSION (type) = 1; + else if (slot >= CLASSTYPE_FIRST_CONVERSION_SLOT && !complete_p) + push_class_level_binding (DECL_NAME (method), overload); + + if (insert_p) + { + bool reallocated; + + /* We only expect to add few methods in the COMPLETE_P case, so + just make room for one more method in that case. */ + if (complete_p) + reallocated = VEC_reserve_exact (tree, gc, method_vec, 1); + else + reallocated = VEC_reserve (tree, gc, method_vec, 1); + if (reallocated) + CLASSTYPE_METHOD_VEC (type) = method_vec; + if (slot == VEC_length (tree, method_vec)) + VEC_quick_push (tree, method_vec, overload); + else + VEC_quick_insert (tree, method_vec, slot, overload); + } + else + /* Replace the current slot. */ + VEC_replace (tree, method_vec, slot, overload); + return true; } /* Subroutines of finish_struct. */ @@ -972,7 +1123,7 @@ alter_access (tree t, tree fdecl, tree access) if (!DECL_LANG_SPECIFIC (fdecl)) retrofit_lang_decl (fdecl); - my_friendly_assert (!DECL_DISCRIMINATOR_P (fdecl), 20030624); + gcc_assert (!DECL_DISCRIMINATOR_P (fdecl)); elem = purpose_member (t, DECL_ACCESS (fdecl)); if (elem) @@ -980,10 +1131,11 @@ alter_access (tree t, tree fdecl, tree access) if (TREE_VALUE (elem) != access) { if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL) - cp_error_at ("conflicting access specifications for method `%D', ignored", TREE_TYPE (fdecl)); + error ("conflicting access specifications for method" + " %q+D, ignored", TREE_TYPE (fdecl)); else - error ("conflicting access specifications for field `%s', ignored", - IDENTIFIER_POINTER (DECL_NAME (fdecl))); + error ("conflicting access specifications for field %qE, ignored", + DECL_NAME (fdecl)); } else { @@ -994,7 +1146,7 @@ alter_access (tree t, tree fdecl, tree access) } else { - perform_or_defer_access_check (TYPE_BINFO (t), fdecl); + perform_or_defer_access_check (TYPE_BINFO (t), fdecl, fdecl); DECL_ACCESS (fdecl) = tree_cons (t, access, DECL_ACCESS (fdecl)); return 1; } @@ -1006,54 +1158,18 @@ alter_access (tree t, tree fdecl, tree access) static void handle_using_decl (tree using_decl, tree t) { - tree ctype = DECL_INITIAL (using_decl); + tree decl = USING_DECL_DECLS (using_decl); tree name = DECL_NAME (using_decl); tree access = TREE_PRIVATE (using_decl) ? access_private_node : TREE_PROTECTED (using_decl) ? access_protected_node : access_public_node; - tree fdecl, binfo; tree flist = NULL_TREE; tree old_value; - if (ctype == error_mark_node) - return; + gcc_assert (!processing_template_decl && decl); - binfo = lookup_base (t, ctype, ba_any, NULL); - if (! binfo) - { - location_t saved_loc = input_location; - - input_location = DECL_SOURCE_LOCATION (using_decl); - error_not_base_type (ctype, t); - input_location = saved_loc; - return; - } - - if (constructor_name_p (name, ctype)) - { - cp_error_at ("`%D' names constructor", using_decl); - return; - } - if (constructor_name_p (name, t)) - { - cp_error_at ("`%D' invalid in `%T'", using_decl, t); - return; - } - - fdecl = lookup_member (binfo, name, 0, false); - - if (!fdecl) - { - cp_error_at ("no members matching `%D' in `%#T'", using_decl, ctype); - return; - } - - if (BASELINK_P (fdecl)) - /* Ignore base type this came from. */ - fdecl = BASELINK_FUNCTIONS (fdecl); - - old_value = IDENTIFIER_CLASS_VALUE (name); + old_value = lookup_member (t, name, /*protect=*/0, /*want_type=*/false); if (old_value) { if (is_overloaded_fn (old_value)) @@ -1065,8 +1181,10 @@ handle_using_decl (tree using_decl, tree t) old_value = NULL_TREE; } - if (is_overloaded_fn (fdecl)) - flist = fdecl; + cp_emit_debug_info_for_using (decl, USING_DECL_SCOPE (using_decl)); + + if (is_overloaded_fn (decl)) + flist = decl; if (! old_value) ; @@ -1077,87 +1195,59 @@ handle_using_decl (tree using_decl, tree t) the same name already present in the current class. */; else { - cp_error_at ("`%D' invalid in `%#T'", using_decl, t); - cp_error_at (" because of local method `%#D' with same name", - OVL_CURRENT (old_value)); + error ("%q+D invalid in %q#T", using_decl, t); + error (" because of local method %q+#D with same name", + OVL_CURRENT (old_value)); return; } } else if (!DECL_ARTIFICIAL (old_value)) { - cp_error_at ("`%D' invalid in `%#T'", using_decl, t); - cp_error_at (" because of local member `%#D' with same name", old_value); + error ("%q+D invalid in %q#T", using_decl, t); + error (" because of local member %q+#D with same name", old_value); return; } - + /* Make type T see field decl FDECL with access ACCESS. */ if (flist) for (; flist; flist = OVL_NEXT (flist)) { - add_method (t, OVL_CURRENT (flist), /*error_p=*/0); + add_method (t, OVL_CURRENT (flist), using_decl); alter_access (t, OVL_CURRENT (flist), access); } else - alter_access (t, fdecl, access); + alter_access (t, decl, access); } -/* Run through the base clases of T, updating - CANT_HAVE_DEFAULT_CTOR_P, CANT_HAVE_CONST_CTOR_P, and - NO_CONST_ASN_REF_P. Also set flag bits in T based on properties of - the bases. */ +/* Run through the base classes of T, updating CANT_HAVE_CONST_CTOR_P, + and NO_CONST_ASN_REF_P. Also set flag bits in T based on + properties of the bases. */ static void check_bases (tree t, - int* cant_have_default_ctor_p, - int* cant_have_const_ctor_p, - int* no_const_asn_ref_p) + int* cant_have_const_ctor_p, + int* no_const_asn_ref_p) { - int n_baseclasses; int i; int seen_non_virtual_nearly_empty_base_p; - tree binfos; + tree base_binfo; + tree binfo; - binfos = TYPE_BINFO_BASETYPES (t); - n_baseclasses = CLASSTYPE_N_BASECLASSES (t); seen_non_virtual_nearly_empty_base_p = 0; - /* An aggregate cannot have baseclasses. */ - CLASSTYPE_NON_AGGREGATE (t) |= (n_baseclasses != 0); - - for (i = 0; i < n_baseclasses; ++i) + for (binfo = TYPE_BINFO (t), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) { - tree base_binfo; - tree basetype; + tree basetype = TREE_TYPE (base_binfo); - /* Figure out what base we're looking at. */ - base_binfo = TREE_VEC_ELT (binfos, i); - basetype = TREE_TYPE (base_binfo); - - /* If the type of basetype is incomplete, then we already - complained about that fact (and we should have fixed it up as - well). */ - if (!COMPLETE_TYPE_P (basetype)) - { - int j; - /* The base type is of incomplete type. It is - probably best to pretend that it does not - exist. */ - if (i == n_baseclasses-1) - TREE_VEC_ELT (binfos, i) = NULL_TREE; - TREE_VEC_LENGTH (binfos) -= 1; - n_baseclasses -= 1; - for (j = i; j+1 < n_baseclasses; j++) - TREE_VEC_ELT (binfos, j) = TREE_VEC_ELT (binfos, j+1); - continue; - } + gcc_assert (COMPLETE_TYPE_P (basetype)); /* Effective C++ rule 14. We only need to check TYPE_POLYMORPHIC_P here because the case of virtual functions but non-virtual dtor is handled in finish_struct_1. */ - if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype) - && TYPE_HAS_DESTRUCTOR (basetype)) - warning ("base class `%#T' has a non-virtual destructor", - basetype); + if (!TYPE_POLYMORPHIC_P (basetype)) + warning (OPT_Weffc__, + "base class %q#T has a non-virtual destructor", basetype); /* If the base class doesn't have copy constructors or assignment operators that take const references, then the @@ -1168,19 +1258,8 @@ check_bases (tree t, if (TYPE_HAS_ASSIGN_REF (basetype) && !TYPE_HAS_CONST_ASSIGN_REF (basetype)) *no_const_asn_ref_p = 1; - /* Similarly, if the base class doesn't have a default - constructor, then the derived class won't have an - automatically generated default constructor. */ - if (TYPE_HAS_CONSTRUCTOR (basetype) - && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype)) - { - *cant_have_default_ctor_p = 1; - if (! TYPE_HAS_CONSTRUCTOR (t)) - pedwarn ("base `%T' with only non-default constructor in class without a constructor", - basetype); - } - if (TREE_VIA_VIRTUAL (base_binfo)) + if (BINFO_VIRTUAL_P (base_binfo)) /* A virtual base does not effect nearly emptiness. */ ; else if (CLASSTYPE_NEARLY_EMPTY_P (basetype)) @@ -1201,206 +1280,144 @@ check_bases (tree t, /* A lot of properties from the bases also apply to the derived class. */ TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (basetype); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype); - TYPE_HAS_COMPLEX_ASSIGN_REF (t) + TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype); TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (basetype); TYPE_POLYMORPHIC_P (t) |= TYPE_POLYMORPHIC_P (basetype); - CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) + CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) |= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype); } } -/* Set BINFO_PRIMARY_BASE_OF for all binfos in the hierarchy - dominated by TYPE that are primary bases. */ +/* Determine all the primary bases within T. Sets BINFO_PRIMARY_BASE_P for + those that are primaries. Sets BINFO_LOST_PRIMARY_P for those + that have had a nearly-empty virtual primary base stolen by some + other base in the hierarchy. Determines CLASSTYPE_PRIMARY_BASE for + T. */ static void -mark_primary_bases (tree type) +determine_primary_bases (tree t) { - tree binfo; - - /* Walk the bases in inheritance graph order. */ - for (binfo = TYPE_BINFO (type); binfo; binfo = TREE_CHAIN (binfo)) - { - tree base_binfo = get_primary_binfo (binfo); + unsigned i; + tree primary = NULL_TREE; + tree type_binfo = TYPE_BINFO (t); + tree base_binfo; - if (!base_binfo) - /* Not a dynamic base. */; - else if (BINFO_PRIMARY_P (base_binfo)) - BINFO_LOST_PRIMARY_P (binfo) = 1; - else + /* Determine the primary bases of our bases. */ + for (base_binfo = TREE_CHAIN (type_binfo); base_binfo; + base_binfo = TREE_CHAIN (base_binfo)) + { + tree primary = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (base_binfo)); + + /* See if we're the non-virtual primary of our inheritance + chain. */ + if (!BINFO_VIRTUAL_P (base_binfo)) { - BINFO_PRIMARY_BASE_OF (base_binfo) = binfo; - /* A virtual binfo might have been copied from within - another hierarchy. As we're about to use it as a primary - base, make sure the offsets match. */ - if (TREE_VIA_VIRTUAL (base_binfo)) - { - tree delta = size_diffop (convert (ssizetype, - BINFO_OFFSET (binfo)), - convert (ssizetype, - BINFO_OFFSET (base_binfo))); - - propagate_binfo_offsets (base_binfo, delta); - } + tree parent = BINFO_INHERITANCE_CHAIN (base_binfo); + tree parent_primary = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (parent)); + + if (parent_primary + && SAME_BINFO_TYPE_P (BINFO_TYPE (base_binfo), + BINFO_TYPE (parent_primary))) + /* We are the primary binfo. */ + BINFO_PRIMARY_P (base_binfo) = 1; } - } -} - -/* Make the BINFO the primary base of T. */ - -static void -set_primary_base (tree t, tree binfo) -{ - tree basetype; - - CLASSTYPE_PRIMARY_BINFO (t) = binfo; - basetype = BINFO_TYPE (binfo); - TYPE_BINFO_VTABLE (t) = TYPE_BINFO_VTABLE (basetype); - TYPE_BINFO_VIRTUALS (t) = TYPE_BINFO_VIRTUALS (basetype); - TYPE_VFIELD (t) = TYPE_VFIELD (basetype); -} - -/* Determine the primary class for T. */ - -static void -determine_primary_base (tree t) -{ - int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t); - tree vbases; - tree type_binfo; - - /* If there are no baseclasses, there is certainly no primary base. */ - if (n_baseclasses == 0) - return; - - type_binfo = TYPE_BINFO (t); - - for (i = 0; i < n_baseclasses; i++) - { - tree base_binfo = BINFO_BASETYPE (type_binfo, i); - tree basetype = BINFO_TYPE (base_binfo); - - if (TYPE_CONTAINS_VPTR_P (basetype)) + /* Determine if we have a virtual primary base, and mark it so. + */ + if (primary && BINFO_VIRTUAL_P (primary)) { - /* We prefer a non-virtual base, although a virtual one will - do. */ - if (TREE_VIA_VIRTUAL (base_binfo)) - continue; + tree this_primary = copied_binfo (primary, base_binfo); - if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t)) - { - set_primary_base (t, base_binfo); - CLASSTYPE_VFIELDS (t) = copy_list (CLASSTYPE_VFIELDS (basetype)); - } + if (BINFO_PRIMARY_P (this_primary)) + /* Someone already claimed this base. */ + BINFO_LOST_PRIMARY_P (base_binfo) = 1; else { - tree vfields; + tree delta; - /* Only add unique vfields, and flatten them out as we go. */ - for (vfields = CLASSTYPE_VFIELDS (basetype); - vfields; - vfields = TREE_CHAIN (vfields)) - if (VF_BINFO_VALUE (vfields) == NULL_TREE - || ! TREE_VIA_VIRTUAL (VF_BINFO_VALUE (vfields))) - CLASSTYPE_VFIELDS (t) - = tree_cons (base_binfo, - VF_BASETYPE_VALUE (vfields), - CLASSTYPE_VFIELDS (t)); + BINFO_PRIMARY_P (this_primary) = 1; + BINFO_INHERITANCE_CHAIN (this_primary) = base_binfo; + + /* A virtual binfo might have been copied from within + another hierarchy. As we're about to use it as a + primary base, make sure the offsets match. */ + delta = size_diffop (convert (ssizetype, + BINFO_OFFSET (base_binfo)), + convert (ssizetype, + BINFO_OFFSET (this_primary))); + + propagate_binfo_offsets (this_primary, delta); } } } - if (!TYPE_VFIELD (t)) - CLASSTYPE_PRIMARY_BINFO (t) = NULL_TREE; - - /* Find the indirect primary bases - those virtual bases which are primary - bases of something else in this hierarchy. */ - for (vbases = CLASSTYPE_VBASECLASSES (t); - vbases; - vbases = TREE_CHAIN (vbases)) + /* First look for a dynamic direct non-virtual base. */ + for (i = 0; BINFO_BASE_ITERATE (type_binfo, i, base_binfo); i++) { - tree vbase_binfo = TREE_VALUE (vbases); + tree basetype = BINFO_TYPE (base_binfo); - /* See if this virtual base is an indirect primary base. To be so, - it must be a primary base within the hierarchy of one of our - direct bases. */ - for (i = 0; i < n_baseclasses; ++i) + if (TYPE_CONTAINS_VPTR_P (basetype) && !BINFO_VIRTUAL_P (base_binfo)) { - tree basetype = TYPE_BINFO_BASETYPE (t, i); - tree v; - - for (v = CLASSTYPE_VBASECLASSES (basetype); - v; - v = TREE_CHAIN (v)) - { - tree base_vbase = TREE_VALUE (v); - - if (BINFO_PRIMARY_P (base_vbase) - && same_type_p (BINFO_TYPE (base_vbase), - BINFO_TYPE (vbase_binfo))) - { - BINFO_INDIRECT_PRIMARY_P (vbase_binfo) = 1; - break; - } - } - - /* If we've discovered that this virtual base is an indirect - primary base, then we can move on to the next virtual - base. */ - if (BINFO_INDIRECT_PRIMARY_P (vbase_binfo)) - break; + primary = base_binfo; + goto found; } } /* A "nearly-empty" virtual base class can be the primary base - class, if no non-virtual polymorphic base can be found. */ - if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t)) + class, if no non-virtual polymorphic base can be found. Look for + a nearly-empty virtual dynamic base that is not already a primary + base of something in the hierarchy. If there is no such base, + just pick the first nearly-empty virtual base. */ + + for (base_binfo = TREE_CHAIN (type_binfo); base_binfo; + base_binfo = TREE_CHAIN (base_binfo)) + if (BINFO_VIRTUAL_P (base_binfo) + && CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (base_binfo))) + { + if (!BINFO_PRIMARY_P (base_binfo)) + { + /* Found one that is not primary. */ + primary = base_binfo; + goto found; + } + else if (!primary) + /* Remember the first candidate. */ + primary = base_binfo; + } + + found: + /* If we've got a primary base, use it. */ + if (primary) { - /* If not NULL, this is the best primary base candidate we have - found so far. */ - tree candidate = NULL_TREE; - tree base_binfo; + tree basetype = BINFO_TYPE (primary); - /* Loop over the baseclasses. */ - for (base_binfo = TYPE_BINFO (t); - base_binfo; - base_binfo = TREE_CHAIN (base_binfo)) + CLASSTYPE_PRIMARY_BINFO (t) = primary; + if (BINFO_PRIMARY_P (primary)) + /* We are stealing a primary base. */ + BINFO_LOST_PRIMARY_P (BINFO_INHERITANCE_CHAIN (primary)) = 1; + BINFO_PRIMARY_P (primary) = 1; + if (BINFO_VIRTUAL_P (primary)) { - tree basetype = BINFO_TYPE (base_binfo); + tree delta; - if (TREE_VIA_VIRTUAL (base_binfo) - && CLASSTYPE_NEARLY_EMPTY_P (basetype)) - { - /* If this is not an indirect primary base, then it's - definitely our primary base. */ - if (!BINFO_INDIRECT_PRIMARY_P (base_binfo)) - { - candidate = base_binfo; - break; - } + BINFO_INHERITANCE_CHAIN (primary) = type_binfo; + /* A virtual binfo might have been copied from within + another hierarchy. As we're about to use it as a primary + base, make sure the offsets match. */ + delta = size_diffop (ssize_int (0), + convert (ssizetype, BINFO_OFFSET (primary))); - /* If this is an indirect primary base, it still could be - our primary base -- unless we later find there's another - nearly-empty virtual base that isn't an indirect - primary base. */ - if (!candidate) - candidate = base_binfo; - } + propagate_binfo_offsets (primary, delta); } - /* If we've got a primary base, use it. */ - if (candidate) - { - set_primary_base (t, candidate); - CLASSTYPE_VFIELDS (t) - = copy_list (CLASSTYPE_VFIELDS (BINFO_TYPE (candidate))); - } - } + primary = TYPE_BINFO (basetype); - /* Mark the primary base classes at this point. */ - mark_primary_bases (t); + TYPE_VFIELD (t) = TYPE_VFIELD (basetype); + BINFO_VTABLE (type_binfo) = BINFO_VTABLE (primary); + BINFO_VIRTUALS (type_binfo) = BINFO_VIRTUALS (primary); + } } /* Set memoizing fields and bits of T (and its variants) for later @@ -1409,63 +1426,45 @@ determine_primary_base (tree t) static void finish_struct_bits (tree t) { - int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t); + tree variants; /* Fix up variants (if any). */ - tree variants = TYPE_NEXT_VARIANT (t); - while (variants) + for (variants = TYPE_NEXT_VARIANT (t); + variants; + variants = TYPE_NEXT_VARIANT (variants)) { /* These fields are in the _TYPE part of the node, not in the TYPE_LANG_SPECIFIC component, so they are not shared. */ TYPE_HAS_CONSTRUCTOR (variants) = TYPE_HAS_CONSTRUCTOR (t); - TYPE_HAS_DESTRUCTOR (variants) = TYPE_HAS_DESTRUCTOR (t); TYPE_NEEDS_CONSTRUCTING (variants) = TYPE_NEEDS_CONSTRUCTING (t); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants) = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t); - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (variants) - = TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (t); TYPE_POLYMORPHIC_P (variants) = TYPE_POLYMORPHIC_P (t); - TYPE_USES_VIRTUAL_BASECLASSES (variants) = TYPE_USES_VIRTUAL_BASECLASSES (t); + + TYPE_BINFO (variants) = TYPE_BINFO (t); + /* Copy whatever these are holding today. */ - TYPE_MIN_VALUE (variants) = TYPE_MIN_VALUE (t); - TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t); + TYPE_VFIELD (variants) = TYPE_VFIELD (t); + TYPE_METHODS (variants) = TYPE_METHODS (t); TYPE_FIELDS (variants) = TYPE_FIELDS (t); - TYPE_SIZE (variants) = TYPE_SIZE (t); - TYPE_SIZE_UNIT (variants) = TYPE_SIZE_UNIT (t); - variants = TYPE_NEXT_VARIANT (variants); } - if (n_baseclasses && TYPE_POLYMORPHIC_P (t)) - /* For a class w/o baseclasses, `finish_struct' has set - CLASS_TYPE_ABSTRACT_VIRTUALS correctly (by - definition). Similarly for a class whose base classes do not - have vtables. When neither of these is true, we might have - removed abstract virtuals (by providing a definition), added - some (by declaring new ones), or redeclared ones from a base - class. We need to recalculate what's really an abstract virtual - at this point (by looking in the vtables). */ - get_pure_virtuals (t); + if (BINFO_N_BASE_BINFOS (TYPE_BINFO (t)) && TYPE_POLYMORPHIC_P (t)) + /* For a class w/o baseclasses, 'finish_struct' has set + CLASSTYPE_PURE_VIRTUALS correctly (by definition). + Similarly for a class whose base classes do not have vtables. + When neither of these is true, we might have removed abstract + virtuals (by providing a definition), added some (by declaring + new ones), or redeclared ones from a base class. We need to + recalculate what's really an abstract virtual at this point (by + looking in the vtables). */ + get_pure_virtuals (t); - if (n_baseclasses) - { - /* Notice whether this class has type conversion functions defined. */ - tree binfo = TYPE_BINFO (t); - tree binfos = BINFO_BASETYPES (binfo); - tree basetype; - - for (i = n_baseclasses-1; i >= 0; i--) - { - basetype = BINFO_TYPE (TREE_VEC_ELT (binfos, i)); - - TYPE_HAS_CONVERSION (t) |= TYPE_HAS_CONVERSION (basetype); - } - } - - /* If this type has a copy constructor or a destructor, force its mode to - be BLKmode, and force its TREE_ADDRESSABLE bit to be nonzero. This - will cause it to be passed by invisible reference and prevent it from - being returned in a register. */ + /* If this type has a copy constructor or a destructor, force its + mode to be BLKmode, and force its TREE_ADDRESSABLE bit to be + nonzero. This will cause it to be passed by invisible reference + and prevent it from being returned in a register. */ if (! TYPE_HAS_TRIVIAL_INIT_REF (t) || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)) { tree variants; @@ -1479,7 +1478,7 @@ finish_struct_bits (tree t) } /* Issue warnings about T having private constructors, but no friends, - and so forth. + and so forth. HAS_NONPRIVATE_METHOD is nonzero if T has any non-private methods or static members. HAS_NONPRIVATE_STATIC_FN is nonzero if T has any @@ -1500,10 +1499,10 @@ maybe_warn_about_overly_private_class (tree t) /* We will have warned when the template was declared; there's no need to warn on every instantiation. */ || CLASSTYPE_TEMPLATE_INSTANTIATION (t)) - /* There's no reason to even consider warning about this + /* There's no reason to even consider warning about this class. */ return; - + /* We only issue one warning, if more than one applies, because otherwise, on code like: @@ -1523,25 +1522,25 @@ maybe_warn_about_overly_private_class (tree t) for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn)) /* We're not interested in compiler-generated methods; they don't provide any way to call private members. */ - if (!DECL_ARTIFICIAL (fn)) + if (!DECL_ARTIFICIAL (fn)) { if (!TREE_PRIVATE (fn)) { - if (DECL_STATIC_FUNCTION_P (fn)) + if (DECL_STATIC_FUNCTION_P (fn)) /* A non-private static member function is just like a friend; it can create and invoke private member functions, and be accessed without a class instance. */ return; - + has_nonprivate_method = 1; /* Keep searching for a static member function. */ } else if (!DECL_CONSTRUCTOR_P (fn) && !DECL_DESTRUCTOR_P (fn)) has_member_fn = 1; - } + } - if (!has_nonprivate_method && has_member_fn) + if (!has_nonprivate_method && has_member_fn) { /* There are no non-private methods, and there's at least one private member function that isn't a constructor or @@ -1549,18 +1548,19 @@ maybe_warn_about_overly_private_class (tree t) constructors/destructors we want to use the code below that issues error messages specifically referring to constructors/destructors.) */ - int i; + unsigned i; tree binfo = TYPE_BINFO (t); - - for (i = 0; i < BINFO_N_BASETYPES (binfo); i++) - if (BINFO_BASEACCESS (binfo, i) != access_private_node) + + for (i = 0; i != BINFO_N_BASE_BINFOS (binfo); i++) + if (BINFO_BASE_ACCESS (binfo, i) != access_private_node) { has_nonprivate_method = 1; break; } - if (!has_nonprivate_method) + if (!has_nonprivate_method) { - warning ("all member functions in class `%T' are private", t); + warning (OPT_Wctor_dtor_privacy, + "all member functions in class %qT are private", t); return; } } @@ -1568,34 +1568,36 @@ maybe_warn_about_overly_private_class (tree t) /* Even if some of the member functions are non-private, the class won't be useful for much if all the constructors or destructors are private: such an object can never be created or destroyed. */ - if (TYPE_HAS_DESTRUCTOR (t) - && TREE_PRIVATE (CLASSTYPE_DESTRUCTORS (t))) + fn = CLASSTYPE_DESTRUCTORS (t); + if (fn && TREE_PRIVATE (fn)) { - warning ("`%#T' only defines a private destructor and has no friends", + warning (OPT_Wctor_dtor_privacy, + "%q#T only defines a private destructor and has no friends", t); return; } - if (TYPE_HAS_CONSTRUCTOR (t)) + if (TYPE_HAS_CONSTRUCTOR (t) + /* Implicitly generated constructors are always public. */ + && (!CLASSTYPE_LAZY_DEFAULT_CTOR (t) + || !CLASSTYPE_LAZY_COPY_CTOR (t))) { int nonprivate_ctor = 0; - + /* If a non-template class does not define a copy constructor, one is defined for it, enabling it to avoid this warning. For a template class, this does not happen, and so we would normally get a warning on: - template class C { private: C(); }; - + template class C { private: C(); }; + To avoid this asymmetry, we check TYPE_HAS_INIT_REF. All complete non-template or fully instantiated classes have this flag set. */ if (!TYPE_HAS_INIT_REF (t)) nonprivate_ctor = 1; - else - for (fn = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 0); - fn; - fn = OVL_NEXT (fn)) + else + for (fn = CLASSTYPE_CONSTRUCTORS (t); fn; fn = OVL_NEXT (fn)) { tree ctor = OVL_CURRENT (fn); /* Ideally, we wouldn't count copy constructors (or, in @@ -1613,8 +1615,9 @@ maybe_warn_about_overly_private_class (tree t) if (nonprivate_ctor == 0) { - warning ("`%#T' only defines private constructors and has no friends", - t); + warning (OPT_Wctor_dtor_privacy, + "%q#T only defines private constructors and has no friends", + t); return; } } @@ -1630,9 +1633,9 @@ static struct { static int method_name_cmp (const void* m1_p, const void* m2_p) { - const tree *const m1 = m1_p; - const tree *const m2 = m2_p; - + const tree *const m1 = (const tree *) m1_p; + const tree *const m2 = (const tree *) m2_p; + if (*m1 == NULL_TREE && *m2 == NULL_TREE) return 0; if (*m1 == NULL_TREE) @@ -1650,8 +1653,8 @@ method_name_cmp (const void* m1_p, const void* m2_p) static int resort_method_name_cmp (const void* m1_p, const void* m2_p) { - const tree *const m1 = m1_p; - const tree *const m2 = m2_p; + const tree *const m1 = (const tree *) m1_p; + const tree *const m2 = (const tree *) m2_p; if (*m1 == NULL_TREE && *m2 == NULL_TREE) return 0; if (*m1 == NULL_TREE) @@ -1671,45 +1674,35 @@ resort_method_name_cmp (const void* m1_p, const void* m2_p) /* Resort TYPE_METHOD_VEC because pointers have been reordered. */ -void +void resort_type_method_vec (void* obj, - void* orig_obj ATTRIBUTE_UNUSED , - gt_pointer_operator new_value, - void* cookie) + void* orig_obj ATTRIBUTE_UNUSED , + gt_pointer_operator new_value, + void* cookie) { - tree method_vec = obj; - int len = TREE_VEC_LENGTH (method_vec); - int slot; + VEC(tree,gc) *method_vec = (VEC(tree,gc) *) obj; + int len = VEC_length (tree, method_vec); + size_t slot; + tree fn; /* The type conversion ops have to live at the front of the vec, so we can't sort them. */ - for (slot = 2; slot < len; ++slot) - { - tree fn = TREE_VEC_ELT (method_vec, slot); - - if (!DECL_CONV_FN_P (OVL_CURRENT (fn))) - break; - } + for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; + VEC_iterate (tree, method_vec, slot, fn); + ++slot) + if (!DECL_CONV_FN_P (OVL_CURRENT (fn))) + break; + if (len - slot > 1) { resort_data.new_value = new_value; resort_data.cookie = cookie; - qsort (&TREE_VEC_ELT (method_vec, slot), len - slot, sizeof (tree), + qsort (VEC_address (tree, method_vec) + slot, len - slot, sizeof (tree), resort_method_name_cmp); } } -/* Warn about duplicate methods in fn_fields. Also compact method - lists so that lookup can be made faster. - - Data Structure: List of method lists. The outer list is a - TREE_LIST, whose TREE_PURPOSE field is the field name and the - TREE_VALUE is the DECL_CHAIN of the FUNCTION_DECLs. TREE_CHAIN - links the entire list of methods for TYPE_METHODS. Friends are - chained in the same way as member functions (? TREE_CHAIN or - DECL_CHAIN), but they live in the TREE_TYPE field of the outer - list. That allows them to be quickly deleted, and requires no - extra storage. +/* Warn about duplicate methods in fn_fields. Sort methods that are not special (i.e., constructors, destructors, and type conversion operators) so that we can find them faster in @@ -1719,56 +1712,34 @@ static void finish_struct_methods (tree t) { tree fn_fields; - tree method_vec; + VEC(tree,gc) *method_vec; int slot, len; - if (!TYPE_METHODS (t)) - { - /* Clear these for safety; perhaps some parsing error could set - these incorrectly. */ - TYPE_HAS_CONSTRUCTOR (t) = 0; - TYPE_HAS_DESTRUCTOR (t) = 0; - CLASSTYPE_METHOD_VEC (t) = NULL_TREE; - return; - } - method_vec = CLASSTYPE_METHOD_VEC (t); - my_friendly_assert (method_vec != NULL_TREE, 19991215); - len = TREE_VEC_LENGTH (method_vec); + if (!method_vec) + return; - /* First fill in entry 0 with the constructors, entry 1 with destructors, - and the next few with type conversion operators (if any). */ - for (fn_fields = TYPE_METHODS (t); fn_fields; + len = VEC_length (tree, method_vec); + + /* Clear DECL_IN_AGGR_P for all functions. */ + for (fn_fields = TYPE_METHODS (t); fn_fields; fn_fields = TREE_CHAIN (fn_fields)) - /* Clear out this flag. */ DECL_IN_AGGR_P (fn_fields) = 0; - if (TYPE_HAS_DESTRUCTOR (t) && !CLASSTYPE_DESTRUCTORS (t)) - /* We thought there was a destructor, but there wasn't. Some - parse errors cause this anomalous situation. */ - TYPE_HAS_DESTRUCTOR (t) = 0; - /* Issue warnings about private constructors and such. If there are no methods, then some public defaults are generated. */ maybe_warn_about_overly_private_class (t); - /* Now sort the methods. */ - while (len > 2 && TREE_VEC_ELT (method_vec, len-1) == NULL_TREE) - len--; - TREE_VEC_LENGTH (method_vec) = len; - /* The type conversion ops have to live at the front of the vec, so we can't sort them. */ - for (slot = 2; slot < len; ++slot) - { - tree fn = TREE_VEC_ELT (method_vec, slot); - - if (!DECL_CONV_FN_P (OVL_CURRENT (fn))) - break; - } + for (slot = CLASSTYPE_FIRST_CONVERSION_SLOT; + VEC_iterate (tree, method_vec, slot, fn_fields); + ++slot) + if (!DECL_CONV_FN_P (OVL_CURRENT (fn_fields))) + break; if (len - slot > 1) - qsort (&TREE_VEC_ELT (method_vec, slot), len-slot, sizeof (tree), - method_name_cmp); + qsort (VEC_address (tree, method_vec) + slot, + len-slot, sizeof (tree), method_name_cmp); } /* Make BINFO's vtable have N entries, including RTTI entries, @@ -1781,7 +1752,7 @@ layout_vtable_decl (tree binfo, int n) tree atype; tree vtable; - atype = build_cplus_array_type (vtable_entry_type, + atype = build_cplus_array_type (vtable_entry_type, build_index_type (size_int (n - 1))); layout_type (atype); @@ -1832,7 +1803,7 @@ same_signature_p (tree fndecl, tree base_fndecl) /* Returns TRUE if DERIVED is a binfo containing the binfo BASE as a subobject. */ - + static bool base_derived_from (tree derived, tree base) { @@ -1842,84 +1813,44 @@ base_derived_from (tree derived, tree base) { if (probe == derived) return true; - else if (TREE_VIA_VIRTUAL (probe)) + else if (BINFO_VIRTUAL_P (probe)) /* If we meet a virtual base, we can't follow the inheritance any more. See if the complete type of DERIVED contains such a virtual base. */ - return purpose_member (BINFO_TYPE (probe), - CLASSTYPE_VBASECLASSES (BINFO_TYPE (derived))) - != NULL_TREE; + return (binfo_for_vbase (BINFO_TYPE (probe), BINFO_TYPE (derived)) + != NULL_TREE); } return false; } -typedef struct count_depth_data { - /* The depth of the current subobject, with "1" as the depth of the - most derived object in the hierarchy. */ - size_t depth; - /* The maximum depth found so far. */ - size_t max_depth; -} count_depth_data; - -/* Called from find_final_overrider via dfs_walk. */ - -static tree -dfs_depth_post (tree binfo ATTRIBUTE_UNUSED, void *data) -{ - count_depth_data *cd = (count_depth_data *) data; - if (cd->depth > cd->max_depth) - cd->max_depth = cd->depth; - cd->depth--; - return NULL_TREE; -} - -/* Called from find_final_overrider via dfs_walk. */ - -static tree -dfs_depth_q (tree derived, int i, void *data) -{ - count_depth_data *cd = (count_depth_data *) data; - cd->depth++; - return BINFO_BASETYPE (derived, i); -} - typedef struct find_final_overrider_data_s { /* The function for which we are trying to find a final overrider. */ tree fn; /* The base class in which the function was declared. */ tree declaring_base; - /* The most derived class in the hierarchy. */ - tree most_derived_type; /* The candidate overriders. */ tree candidates; - /* Each entry in this array is the next-most-derived class for a - virtual base class along the current path. */ - tree *vpath_list; - /* A pointer one past the top of the VPATH_LIST. */ - tree *vpath; + /* Path to most derived. */ + VEC(tree,heap) *path; } find_final_overrider_data; /* Add the overrider along the current path to FFOD->CANDIDATES. Returns true if an overrider was found; false otherwise. */ static bool -dfs_find_final_overrider_1 (tree binfo, - tree *vpath, - find_final_overrider_data *ffod) +dfs_find_final_overrider_1 (tree binfo, + find_final_overrider_data *ffod, + unsigned depth) { tree method; - + /* If BINFO is not the most derived type, try a more derived class. A definition there will overrider a definition here. */ - if (!same_type_p (BINFO_TYPE (binfo), ffod->most_derived_type)) + if (depth) { - tree derived; - - if (TREE_VIA_VIRTUAL (binfo)) - derived = *--vpath; - else - derived = BINFO_INHERITANCE_CHAIN (binfo); - if (dfs_find_final_overrider_1 (derived, vpath, ffod)) + depth--; + if (dfs_find_final_overrider_1 + (VEC_index (tree, ffod->path, depth), ffod, depth)) return true; } @@ -1927,7 +1858,7 @@ dfs_find_final_overrider_1 (tree binfo, if (method) { tree *candidate = &ffod->candidates; - + /* Remove any candidates overridden by this new function. */ while (*candidate) { @@ -1941,7 +1872,7 @@ dfs_find_final_overrider_1 (tree binfo, else candidate = &TREE_CHAIN (*candidate); } - + /* Add the new function. */ ffod->candidates = tree_cons (method, binfo, ffod->candidates); return true; @@ -1953,36 +1884,23 @@ dfs_find_final_overrider_1 (tree binfo, /* Called from find_final_overrider via dfs_walk. */ static tree -dfs_find_final_overrider (tree binfo, void* data) +dfs_find_final_overrider_pre (tree binfo, void *data) { find_final_overrider_data *ffod = (find_final_overrider_data *) data; if (binfo == ffod->declaring_base) - dfs_find_final_overrider_1 (binfo, ffod->vpath, ffod); + dfs_find_final_overrider_1 (binfo, ffod, VEC_length (tree, ffod->path)); + VEC_safe_push (tree, heap, ffod->path, binfo); return NULL_TREE; } static tree -dfs_find_final_overrider_q (tree derived, int ix, void *data) -{ - tree binfo = BINFO_BASETYPE (derived, ix); - find_final_overrider_data *ffod = (find_final_overrider_data *) data; - - if (TREE_VIA_VIRTUAL (binfo)) - *ffod->vpath++ = derived; - - return binfo; -} - -static tree -dfs_find_final_overrider_post (tree binfo, void *data) +dfs_find_final_overrider_post (tree binfo ATTRIBUTE_UNUSED, void *data) { find_final_overrider_data *ffod = (find_final_overrider_data *) data; + VEC_pop (tree, ffod->path); - if (TREE_VIA_VIRTUAL (binfo)) - ffod->vpath--; - return NULL_TREE; } @@ -1995,7 +1913,6 @@ static tree find_final_overrider (tree derived, tree binfo, tree fn) { find_final_overrider_data ffod; - count_depth_data cd; /* Getting this right is a little tricky. This is valid: @@ -2003,7 +1920,7 @@ find_final_overrider (tree derived, tree binfo, tree fn) struct T { virtual void f (); }; struct U : public S, public T { }; - even though calling `f' in `U' is ambiguous. But, + even though calling `f' in `U' is ambiguous. But, struct R { virtual void f(); }; struct S : virtual public R { virtual void f (); }; @@ -2011,32 +1928,23 @@ find_final_overrider (tree derived, tree binfo, tree fn) struct U : public S, public T { }; is not -- there's no way to decide whether to put `S::f' or - `T::f' in the vtable for `R'. - + `T::f' in the vtable for `R'. + The solution is to look at all paths to BINFO. If we find different overriders along any two, then there is a problem. */ if (DECL_THUNK_P (fn)) fn = THUNK_TARGET (fn); /* Determine the depth of the hierarchy. */ - cd.depth = 0; - cd.max_depth = 0; - dfs_walk (derived, dfs_depth_post, dfs_depth_q, &cd); - ffod.fn = fn; ffod.declaring_base = binfo; - ffod.most_derived_type = BINFO_TYPE (derived); ffod.candidates = NULL_TREE; - ffod.vpath_list = (tree *) xcalloc (cd.max_depth, sizeof (tree)); - ffod.vpath = ffod.vpath_list; + ffod.path = VEC_alloc (tree, heap, 30); - dfs_walk_real (derived, - dfs_find_final_overrider, - dfs_find_final_overrider_post, - dfs_find_final_overrider_q, - &ffod); + dfs_walk_all (derived, dfs_find_final_overrider_pre, + dfs_find_final_overrider_post, &ffod); - free (ffod.vpath_list); + VEC_free (tree, heap, ffod.path); /* If there was no winner, issue an error message. */ if (!ffod.candidates || TREE_CHAIN (ffod.candidates)) @@ -2051,17 +1959,17 @@ find_final_overrider (tree derived, tree binfo, tree fn) static tree get_vcall_index (tree fn, tree type) { - tree v; + VEC(tree_pair_s,gc) *indices = CLASSTYPE_VCALL_INDICES (type); + tree_pair_p p; + unsigned ix; - for (v = CLASSTYPE_VCALL_INDICES (type); v; v = TREE_CHAIN (v)) - if ((DECL_DESTRUCTOR_P (fn) && DECL_DESTRUCTOR_P (TREE_PURPOSE (v))) - || same_signature_p (fn, TREE_PURPOSE (v))) - break; + for (ix = 0; VEC_iterate (tree_pair_s, indices, ix, p); ix++) + if ((DECL_DESTRUCTOR_P (fn) && DECL_DESTRUCTOR_P (p->purpose)) + || same_signature_p (fn, p->purpose)) + return p->value; /* There should always be an appropriate index. */ - my_friendly_assert (v, 20021103); - - return TREE_VALUE (v); + gcc_unreachable (); } /* Update an entry in the vtable for BINFO, which is in the hierarchy @@ -2087,7 +1995,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, calling FN through BINFO. */ for (b = binfo; ; b = get_primary_binfo (b)) { - my_friendly_assert (b, 20021227); + gcc_assert (b); if (look_for_overrides_here (BINFO_TYPE (b), target_fn)) break; @@ -2101,32 +2009,34 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, overrider = find_final_overrider (TYPE_BINFO (t), b, target_fn); if (overrider == error_mark_node) { - error ("no unique final overrider for `%D' in `%T'", target_fn, t); + error ("no unique final overrider for %qD in %qT", target_fn, t); return; } overrider_target = overrider_fn = TREE_PURPOSE (overrider); - + /* Check for adjusting covariant return types. */ over_return = TREE_TYPE (TREE_TYPE (overrider_target)); base_return = TREE_TYPE (TREE_TYPE (target_fn)); - + if (POINTER_TYPE_P (over_return) && TREE_CODE (over_return) == TREE_CODE (base_return) && CLASS_TYPE_P (TREE_TYPE (over_return)) - && CLASS_TYPE_P (TREE_TYPE (base_return))) + && CLASS_TYPE_P (TREE_TYPE (base_return)) + /* If the overrider is invalid, don't even try. */ + && !DECL_INVALID_OVERRIDER_P (overrider_target)) { /* If FN is a covariant thunk, we must figure out the adjustment - to the final base FN was converting to. As OVERRIDER_TARGET might - also be converting to the return type of FN, we have to - combine the two conversions here. */ + to the final base FN was converting to. As OVERRIDER_TARGET might + also be converting to the return type of FN, we have to + combine the two conversions here. */ tree fixed_offset, virtual_offset; over_return = TREE_TYPE (over_return); base_return = TREE_TYPE (base_return); - + if (DECL_THUNK_P (fn)) { - my_friendly_assert (DECL_RESULT_THUNK_P (fn), 20031211); + gcc_assert (DECL_RESULT_THUNK_P (fn)); fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn)); virtual_offset = THUNK_VIRTUAL_OFFSET (fn); } @@ -2137,14 +2047,12 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, /* Find the equivalent binfo within the return type of the overriding function. We will want the vbase offset from there. */ - virtual_offset = - TREE_VALUE (purpose_member - (BINFO_TYPE (virtual_offset), - CLASSTYPE_VBASECLASSES (over_return))); + virtual_offset = binfo_for_vbase (BINFO_TYPE (virtual_offset), + over_return); else if (!same_type_ignoring_top_level_qualifiers_p (over_return, base_return)) { - /* There was no existing virtual thunk (which takes + /* There was no existing virtual thunk (which takes precedence). So find the binfo of the base function's return type within the overriding function's return type. We cannot call lookup base here, because we're inside a @@ -2165,17 +2073,17 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, thunk_binfo = TYPE_BINFO (over_return); thunk_binfo; thunk_binfo = TREE_CHAIN (thunk_binfo)) - if (same_type_p (BINFO_TYPE (thunk_binfo), - BINFO_TYPE (base_binfo))) + if (SAME_BINFO_TYPE_P (BINFO_TYPE (thunk_binfo), + BINFO_TYPE (base_binfo))) break; - + /* See if virtual inheritance is involved. */ for (virtual_offset = thunk_binfo; virtual_offset; virtual_offset = BINFO_INHERITANCE_CHAIN (virtual_offset)) - if (TREE_VIA_VIRTUAL (virtual_offset)) + if (BINFO_VIRTUAL_P (virtual_offset)) break; - + if (virtual_offset || (thunk_binfo && !BINFO_OFFSET_ZEROP (thunk_binfo))) { @@ -2198,7 +2106,7 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, fixed_offset = offset; } } - + if (fixed_offset || virtual_offset) /* Replace the overriding function with a covariant thunk. We will emit the overriding function in its own slot as @@ -2207,8 +2115,8 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, fixed_offset, virtual_offset); } else - my_friendly_assert (!DECL_THUNK_P (fn), 20021231); - + gcc_assert (!DECL_THUNK_P (fn)); + /* Assume that we will produce a thunk that convert all the way to the final overrider, and not to an intermediate virtual base. */ virtual_base = NULL_TREE; @@ -2219,14 +2127,14 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, { /* If we find the final overrider, then we can stop walking. */ - if (same_type_p (BINFO_TYPE (b), - BINFO_TYPE (TREE_VALUE (overrider)))) + if (SAME_BINFO_TYPE_P (BINFO_TYPE (b), + BINFO_TYPE (TREE_VALUE (overrider)))) break; /* If we find a virtual base, and we haven't yet found the overrider, then there is a virtual base between the declaring base (first_defn) and the final overrider. */ - if (TREE_VIA_VIRTUAL (b)) + if (BINFO_VIRTUAL_P (b)) { virtual_base = b; break; @@ -2236,33 +2144,33 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, if (overrider_fn != overrider_target && !virtual_base) { /* The ABI specifies that a covariant thunk includes a mangling - for a this pointer adjustment. This-adjusting thunks that - override a function from a virtual base have a vcall - adjustment. When the virtual base in question is a primary - virtual base, we know the adjustments are zero, (and in the - non-covariant case, we would not use the thunk). - Unfortunately we didn't notice this could happen, when - designing the ABI and so never mandated that such a covariant - thunk should be emitted. Because we must use the ABI mandated - name, we must continue searching from the binfo where we - found the most recent definition of the function, towards the - primary binfo which first introduced the function into the - vtable. If that enters a virtual base, we must use a vcall - this-adjusting thunk. Bleah! */ + for a this pointer adjustment. This-adjusting thunks that + override a function from a virtual base have a vcall + adjustment. When the virtual base in question is a primary + virtual base, we know the adjustments are zero, (and in the + non-covariant case, we would not use the thunk). + Unfortunately we didn't notice this could happen, when + designing the ABI and so never mandated that such a covariant + thunk should be emitted. Because we must use the ABI mandated + name, we must continue searching from the binfo where we + found the most recent definition of the function, towards the + primary binfo which first introduced the function into the + vtable. If that enters a virtual base, we must use a vcall + this-adjusting thunk. Bleah! */ tree probe = first_defn; while ((probe = get_primary_binfo (probe)) && (unsigned) list_length (BINFO_VIRTUALS (probe)) > ix) - if (TREE_VIA_VIRTUAL (probe)) + if (BINFO_VIRTUAL_P (probe)) virtual_base = probe; - + if (virtual_base) /* Even if we find a virtual base, the correct delta is between the overrider and the binfo we're building a vtable for. */ goto virtual_covariant; } - + /* Compute the constant adjustment to the `this' pointer. The `this' pointer, when this function is called, will point at BINFO (or one of its primary bases, which are at the same offset). */ @@ -2289,8 +2197,10 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, modify_vtable_entry (t, binfo, overrider_fn, delta, virtuals); if (virtual_base) - BV_VCALL_INDEX (*virtuals) + BV_VCALL_INDEX (*virtuals) = get_vcall_index (overrider_target, BINFO_TYPE (virtual_base)); + else + BV_VCALL_INDEX (*virtuals) = NULL_TREE; } /* Called from modify_all_vtables via dfs_walk. */ @@ -2298,36 +2208,42 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, static tree dfs_modify_vtables (tree binfo, void* data) { - if (/* There's no need to modify the vtable for a non-virtual - primary base; we're not going to use that vtable anyhow. - We do still need to do this for virtual primary bases, as they - could become non-primary in a construction vtable. */ - (!BINFO_PRIMARY_P (binfo) || TREE_VIA_VIRTUAL (binfo)) - /* Similarly, a base without a vtable needs no modification. */ - && CLASSTYPE_VFIELDS (BINFO_TYPE (binfo))) - { - tree t = (tree) data; - tree virtuals; - tree old_virtuals; - unsigned ix; - - make_new_vtable (t, binfo); - - /* Now, go through each of the virtual functions in the virtual - function table for BINFO. Find the final overrider, and - update the BINFO_VIRTUALS list appropriately. */ - for (ix = 0, virtuals = BINFO_VIRTUALS (binfo), - old_virtuals = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (binfo))); - virtuals; - ix++, virtuals = TREE_CHAIN (virtuals), - old_virtuals = TREE_CHAIN (old_virtuals)) - update_vtable_entry_for_fn (t, - binfo, - BV_FN (old_virtuals), - &virtuals, ix); - } + tree t = (tree) data; + tree virtuals; + tree old_virtuals; + unsigned ix; - BINFO_MARKED (binfo) = 1; + if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) + /* A base without a vtable needs no modification, and its bases + are uninteresting. */ + return dfs_skip_bases; + + if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t) + && !CLASSTYPE_HAS_PRIMARY_BASE_P (t)) + /* Don't do the primary vtable, if it's new. */ + return NULL_TREE; + + if (BINFO_PRIMARY_P (binfo) && !BINFO_VIRTUAL_P (binfo)) + /* There's no need to modify the vtable for a non-virtual primary + base; we're not going to use that vtable anyhow. We do still + need to do this for virtual primary bases, as they could become + non-primary in a construction vtable. */ + return NULL_TREE; + + make_new_vtable (t, binfo); + + /* Now, go through each of the virtual functions in the virtual + function table for BINFO. Find the final overrider, and update + the BINFO_VIRTUALS list appropriately. */ + for (ix = 0, virtuals = BINFO_VIRTUALS (binfo), + old_virtuals = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (binfo))); + virtuals; + ix++, virtuals = TREE_CHAIN (virtuals), + old_virtuals = TREE_CHAIN (old_virtuals)) + update_vtable_entry_for_fn (t, + binfo, + BV_FN (old_virtuals), + &virtuals, ix); return NULL_TREE; } @@ -2348,8 +2264,7 @@ modify_all_vtables (tree t, tree virtuals) tree *fnsp; /* Update all of the vtables. */ - dfs_walk (binfo, dfs_modify_vtables, unmarkedp, t); - dfs_walk (binfo, dfs_unmark, markedp, t); + dfs_walk_once (binfo, dfs_modify_vtables, NULL, t); /* Add virtual functions not already in our primary vtable. These will be both those introduced by this class, and those overridden @@ -2386,13 +2301,13 @@ get_basefndecls (tree name, tree t) { tree methods; tree base_fndecls = NULL_TREE; - int n_baseclasses = CLASSTYPE_N_BASECLASSES (t); + int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); int i; /* Find virtual functions in T with the indicated NAME. */ i = lookup_fnfields_1 (t, name); if (i != -1) - for (methods = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), i); + for (methods = VEC_index (tree, CLASSTYPE_METHOD_VEC (t), i); methods; methods = OVL_NEXT (methods)) { @@ -2408,7 +2323,7 @@ get_basefndecls (tree name, tree t) for (i = 0; i < n_baseclasses; i++) { - tree basetype = TYPE_BINFO_BASETYPE (t, i); + tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), i)); base_fndecls = chainon (get_basefndecls (name, basetype), base_fndecls); } @@ -2420,14 +2335,14 @@ get_basefndecls (tree name, tree t) a method declared virtual in the base class, then mark this field as being virtual as well. */ -static void +void check_for_override (tree decl, tree ctype) { if (TREE_CODE (decl) == TEMPLATE_DECL) /* In [temp.mem] we have: - A specialization of a member function template does not - override a virtual function from a base class. */ + A specialization of a member function template does not + override a virtual function from a base class. */ return; if ((DECL_DESTRUCTOR_P (decl) || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)) @@ -2444,38 +2359,53 @@ check_for_override (tree decl, tree ctype) if (!DECL_VINDEX (decl)) DECL_VINDEX (decl) = error_mark_node; IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)) = 1; + if (DECL_DLLIMPORT_P (decl)) + { + /* When we handled the dllimport attribute we may not have known + that this function is virtual We can't use dllimport + semantics for a virtual method because we need to initialize + the vtable entry with a constant address. */ + DECL_DLLIMPORT_P (decl) = 0; + DECL_ATTRIBUTES (decl) + = remove_attribute ("dllimport", DECL_ATTRIBUTES (decl)); + } } } /* Warn about hidden virtual functions that are not overridden in t. We know that constructors and destructors don't apply. */ -void +static void warn_hidden (tree t) { - tree method_vec = CLASSTYPE_METHOD_VEC (t); - int n_methods = method_vec ? TREE_VEC_LENGTH (method_vec) : 0; - int i; + VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (t); + tree fns; + size_t i; /* We go through each separately named virtual function. */ - for (i = 2; i < n_methods && TREE_VEC_ELT (method_vec, i); ++i) + for (i = CLASSTYPE_FIRST_CONVERSION_SLOT; + VEC_iterate (tree, method_vec, i, fns); + ++i) { - tree fns; + tree fn; tree name; tree fndecl; tree base_fndecls; + tree base_binfo; + tree binfo; int j; /* All functions in this slot in the CLASSTYPE_METHOD_VEC will have the same name. Figure out what name that is. */ - name = DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i))); + name = DECL_NAME (OVL_CURRENT (fns)); /* There are no possibly hidden functions yet. */ base_fndecls = NULL_TREE; /* Iterate through all of the base classes looking for possibly hidden functions. */ - for (j = 0; j < CLASSTYPE_N_BASECLASSES (t); j++) + for (binfo = TYPE_BINFO (t), j = 0; + BINFO_BASE_ITERATE (binfo, j, base_binfo); j++) { - tree basetype = TYPE_BINFO_BASETYPE (t, j); + tree basetype = BINFO_TYPE (base_binfo); base_fndecls = chainon (get_basefndecls (name, basetype), base_fndecls); } @@ -2485,14 +2415,14 @@ warn_hidden (tree t) continue; /* Remove any overridden functions. */ - for (fns = TREE_VEC_ELT (method_vec, i); fns; fns = OVL_NEXT (fns)) + for (fn = fns; fn; fn = OVL_NEXT (fn)) { - fndecl = OVL_CURRENT (fns); + fndecl = OVL_CURRENT (fn); if (DECL_VINDEX (fndecl)) { tree *prev = &base_fndecls; - - while (*prev) + + while (*prev) /* If the method from the base class has the same signature as the method from the derived class, it has been overridden. */ @@ -2505,12 +2435,11 @@ warn_hidden (tree t) /* Now give a warning for all base functions without overriders, as they are hidden. */ - while (base_fndecls) + while (base_fndecls) { /* Here we know it is a hider, and no overrider exists. */ - cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls)); - cp_warning_at (" by `%D'", - OVL_CURRENT (TREE_VEC_ELT (method_vec, i))); + warning (0, "%q+D was hidden", TREE_VALUE (base_fndecls)); + warning (0, " by %q+D", fns); base_fndecls = TREE_CHAIN (base_fndecls); } } @@ -2544,24 +2473,22 @@ finish_struct_anon (tree t) though, so we explicitly tolerate that. We use TYPE_ANONYMOUS_P rather than ANON_AGGR_TYPE_P so that we also allow unnamed types used for defining fields. */ - if (DECL_ARTIFICIAL (elt) + if (DECL_ARTIFICIAL (elt) && (!DECL_IMPLICIT_TYPEDEF_P (elt) || TYPE_ANONYMOUS_P (TREE_TYPE (elt)))) continue; if (TREE_CODE (elt) != FIELD_DECL) { - cp_pedwarn_at ("`%#D' invalid; an anonymous union can only have non-static data members", - elt); + pedwarn ("%q+#D invalid; an anonymous union can " + "only have non-static data members", elt); continue; } if (TREE_PRIVATE (elt)) - cp_pedwarn_at ("private member `%#D' in anonymous union", - elt); + pedwarn ("private member %q+#D in anonymous union", elt); else if (TREE_PROTECTED (elt)) - cp_pedwarn_at ("protected member `%#D' in anonymous union", - elt); + pedwarn ("protected member %q+#D in anonymous union", elt); TREE_PRIVATE (elt) = TREE_PRIVATE (field); TREE_PROTECTED (elt) = TREE_PROTECTED (field); @@ -2574,7 +2501,7 @@ finish_struct_anon (tree t) will be used later during class template instantiation. When FRIEND_P is zero, T can be a static member data (VAR_DECL), a non-static member data (FIELD_DECL), a member function - (FUNCTION_DECL), a nested type (RECORD_TYPE, ENUM_TYPE), + (FUNCTION_DECL), a nested type (RECORD_TYPE, ENUM_TYPE), a typedef (TYPE_DECL) or a member class template (TEMPLATE_DECL) When FRIEND_P is nonzero, T is either a friend class (RECORD_TYPE, TEMPLATE_DECL) or a friend function @@ -2591,103 +2518,91 @@ maybe_add_class_template_decl_list (tree type, tree t, int friend_p) } /* Create default constructors, assignment operators, and so forth for - the type indicated by T, if they are needed. - CANT_HAVE_DEFAULT_CTOR, CANT_HAVE_CONST_CTOR, and - CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason, the - class cannot have a default constructor, copy constructor taking a - const reference argument, or an assignment operator taking a const - reference, respectively. If a virtual destructor is created, its - DECL is returned; otherwise the return value is NULL_TREE. */ + the type indicated by T, if they are needed. CANT_HAVE_CONST_CTOR, + and CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason, + the class cannot have a default constructor, copy constructor + taking a const reference argument, or an assignment operator taking + a const reference, respectively. */ static void -add_implicitly_declared_members (tree t, - int cant_have_default_ctor, +add_implicitly_declared_members (tree t, int cant_have_const_cctor, int cant_have_const_assignment) { - tree default_fn; - tree implicit_fns = NULL_TREE; - tree virtual_dtor = NULL_TREE; - tree *f; - - ++adding_implicit_members; - /* Destructor. */ - if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t)) + if (!CLASSTYPE_DESTRUCTORS (t)) { - default_fn = implicitly_declare_fn (sfk_destructor, t, /*const_p=*/0); - check_for_override (default_fn, t); - - /* If we couldn't make it work, then pretend we didn't need it. */ - if (default_fn == void_type_node) - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 0; - else + /* In general, we create destructors lazily. */ + CLASSTYPE_LAZY_DESTRUCTOR (t) = 1; + /* However, if the implicit destructor is non-trivial + destructor, we sometimes have to create it at this point. */ + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)) { - TREE_CHAIN (default_fn) = implicit_fns; - implicit_fns = default_fn; + bool lazy_p = true; - if (DECL_VINDEX (default_fn)) - virtual_dtor = default_fn; + if (TYPE_FOR_JAVA (t)) + /* If this a Java class, any non-trivial destructor is + invalid, even if compiler-generated. Therefore, if the + destructor is non-trivial we create it now. */ + lazy_p = false; + else + { + tree binfo; + tree base_binfo; + int ix; + + /* If the implicit destructor will be virtual, then we must + generate it now because (unfortunately) we do not + generate virtual tables lazily. */ + binfo = TYPE_BINFO (t); + for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++) + { + tree base_type; + tree dtor; + + base_type = BINFO_TYPE (base_binfo); + dtor = CLASSTYPE_DESTRUCTORS (base_type); + if (dtor && DECL_VIRTUAL_P (dtor)) + { + lazy_p = false; + break; + } + } + } + + /* If we can't get away with being lazy, generate the destructor + now. */ + if (!lazy_p) + lazily_declare_fn (sfk_destructor, t); } } - else - /* Any non-implicit destructor is non-trivial. */ - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t); /* Default constructor. */ - if (! TYPE_HAS_CONSTRUCTOR (t) && ! cant_have_default_ctor) + if (! TYPE_HAS_CONSTRUCTOR (t)) { - default_fn = implicitly_declare_fn (sfk_constructor, t, /*const_p=*/0); - TREE_CHAIN (default_fn) = implicit_fns; - implicit_fns = default_fn; + TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 1; + CLASSTYPE_LAZY_DEFAULT_CTOR (t) = 1; } /* Copy constructor. */ if (! TYPE_HAS_INIT_REF (t) && ! TYPE_FOR_JAVA (t)) { - /* ARM 12.18: You get either X(X&) or X(const X&), but - not both. --Chip */ - default_fn - = implicitly_declare_fn (sfk_copy_constructor, t, - /*const_p=*/!cant_have_const_cctor); - TREE_CHAIN (default_fn) = implicit_fns; - implicit_fns = default_fn; + TYPE_HAS_INIT_REF (t) = 1; + TYPE_HAS_CONST_INIT_REF (t) = !cant_have_const_cctor; + CLASSTYPE_LAZY_COPY_CTOR (t) = 1; + TYPE_HAS_CONSTRUCTOR (t) = 1; } - /* Assignment operator. */ - if (! TYPE_HAS_ASSIGN_REF (t) && ! TYPE_FOR_JAVA (t)) + /* If there is no assignment operator, one will be created if and + when it is needed. For now, just record whether or not the type + of the parameter to the assignment operator will be a const or + non-const reference. */ + if (!TYPE_HAS_ASSIGN_REF (t) && !TYPE_FOR_JAVA (t)) { - default_fn - = implicitly_declare_fn (sfk_assignment_operator, t, - /*const_p=*/!cant_have_const_assignment); - TREE_CHAIN (default_fn) = implicit_fns; - implicit_fns = default_fn; + TYPE_HAS_ASSIGN_REF (t) = 1; + TYPE_HAS_CONST_ASSIGN_REF (t) = !cant_have_const_assignment; + CLASSTYPE_LAZY_ASSIGNMENT_OP (t) = 1; } - - /* Now, hook all of the new functions on to TYPE_METHODS, - and add them to the CLASSTYPE_METHOD_VEC. */ - for (f = &implicit_fns; *f; f = &TREE_CHAIN (*f)) - { - add_method (t, *f, /*error_p=*/0); - maybe_add_class_template_decl_list (current_class_type, *f, /*friend_p=*/0); - } - if (abi_version_at_least (2)) - /* G++ 3.2 put the implicit destructor at the *beginning* of the - list, which cause the destructor to be emitted in an incorrect - location in the vtable. */ - TYPE_METHODS (t) = chainon (TYPE_METHODS (t), implicit_fns); - else - { - if (warn_abi && virtual_dtor) - warning ("vtable layout for class `%T' may not be ABI-compliant " - "and may change in a future version of GCC due to implicit " - "virtual destructor", - t); - *f = TYPE_METHODS (t); - TYPE_METHODS (t) = implicit_fns; - } - - --adding_implicit_members; } /* Subroutine of finish_struct_1. Recursively count the number of fields @@ -2733,65 +2648,60 @@ static void check_bitfield_decl (tree field) { tree type = TREE_TYPE (field); - tree w = NULL_TREE; + tree w; + + /* Extract the declared width of the bitfield, which has been + temporarily stashed in DECL_INITIAL. */ + w = DECL_INITIAL (field); + gcc_assert (w != NULL_TREE); + /* Remove the bit-field width indicator so that the rest of the + compiler does not treat that value as an initializer. */ + DECL_INITIAL (field) = NULL_TREE; /* Detect invalid bit-field type. */ - if (DECL_INITIAL (field) - && ! INTEGRAL_TYPE_P (TREE_TYPE (field))) + if (!INTEGRAL_TYPE_P (type)) { - cp_error_at ("bit-field `%#D' with non-integral type", field); + error ("bit-field %q+#D with non-integral type", field); + TREE_TYPE (field) = error_mark_node; w = error_mark_node; } - - /* Detect and ignore out of range field width. */ - if (DECL_INITIAL (field)) + else { - w = DECL_INITIAL (field); - /* Avoid the non_lvalue wrapper added by fold for PLUS_EXPRs. */ STRIP_NOPS (w); /* detect invalid field size. */ - if (TREE_CODE (w) == CONST_DECL) - w = DECL_INITIAL (w); - else - w = decl_constant_value (w); + w = integral_constant_value (w); if (TREE_CODE (w) != INTEGER_CST) { - cp_error_at ("bit-field `%D' width not an integer constant", - field); + error ("bit-field %q+D width not an integer constant", field); w = error_mark_node; } else if (tree_int_cst_sgn (w) < 0) { - cp_error_at ("negative width in bit-field `%D'", field); + error ("negative width in bit-field %q+D", field); w = error_mark_node; } else if (integer_zerop (w) && DECL_NAME (field) != 0) { - cp_error_at ("zero width for bit-field `%D'", field); + error ("zero width for bit-field %q+D", field); w = error_mark_node; } else if (compare_tree_int (w, TYPE_PRECISION (type)) > 0 && TREE_CODE (type) != ENUMERAL_TYPE && TREE_CODE (type) != BOOLEAN_TYPE) - cp_warning_at ("width of `%D' exceeds its type", field); + warning (0, "width of %q+D exceeds its type", field); else if (TREE_CODE (type) == ENUMERAL_TYPE && (0 > compare_tree_int (w, min_precision (TYPE_MIN_VALUE (type), - TREE_UNSIGNED (type))) + TYPE_UNSIGNED (type))) || 0 > compare_tree_int (w, min_precision (TYPE_MAX_VALUE (type), - TREE_UNSIGNED (type))))) - cp_warning_at ("`%D' is too small to hold all values of `%#T'", - field, type); + TYPE_UNSIGNED (type))))) + warning (0, "%q+D is too small to hold all values of %q#T", field, type); } - - /* Remove the bit-field width indicator so that the rest of the - compiler does not treat that value as an initializer. */ - DECL_INITIAL (field) = NULL_TREE; if (w != error_mark_node) { @@ -2812,10 +2722,9 @@ check_bitfield_decl (tree field) static void check_field_decl (tree field, - tree t, - int* cant_have_const_ctor, - int* cant_have_default_ctor, - int* no_const_asn_ref, + tree t, + int* cant_have_const_ctor, + int* no_const_asn_ref, int* any_default_members) { tree type = strip_array_types (TREE_TYPE (field)); @@ -2833,8 +2742,7 @@ check_field_decl (tree field, for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields)) if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field)) check_field_decl (fields, t, cant_have_const_ctor, - cant_have_default_ctor, no_const_asn_ref, - any_default_members); + no_const_asn_ref, any_default_members); } /* Check members with class type for constructors, destructors, etc. */ @@ -2843,23 +2751,22 @@ check_field_decl (tree field, /* Never let anything with uninheritable virtuals make it through without complaint. */ abstract_virtuals_error (field, type); - + if (TREE_CODE (t) == UNION_TYPE) { if (TYPE_NEEDS_CONSTRUCTING (type)) - cp_error_at ("member `%#D' with constructor not allowed in union", - field); + error ("member %q+#D with constructor not allowed in union", + field); if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) - cp_error_at ("member `%#D' with destructor not allowed in union", - field); + error ("member %q+#D with destructor not allowed in union", field); if (TYPE_HAS_COMPLEX_ASSIGN_REF (type)) - cp_error_at ("member `%#D' with copy assignment operator not allowed in union", - field); + error ("member %q+#D with copy assignment operator not allowed in union", + field); } else { TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (type); - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type); TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (type); TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (type); @@ -2870,17 +2777,13 @@ check_field_decl (tree field, if (!TYPE_HAS_CONST_ASSIGN_REF (type)) *no_const_asn_ref = 1; - - if (TYPE_HAS_CONSTRUCTOR (type) - && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) - *cant_have_default_ctor = 1; } if (DECL_INITIAL (field) != NULL_TREE) { /* `build_class_init_list' does not recognize non-FIELD_DECLs. */ if (TREE_CODE (t) == UNION_TYPE && any_default_members != 0) - error ("multiple fields in union `%T' initialized", t); + error ("multiple fields in union %qT initialized", t); *any_default_members = 1; } } @@ -2896,10 +2799,6 @@ check_field_decl (tree field, EMPTY_P The class is empty, i.e., contains no non-static data members. - CANT_HAVE_DEFAULT_CTOR_P - This class cannot have an implicitly generated default - constructor. - CANT_HAVE_CONST_CTOR_P This class cannot have an implicitly generated copy constructor taking a const reference. @@ -2916,19 +2815,19 @@ check_field_decl (tree field, static void check_field_decls (tree t, tree *access_decls, - int *cant_have_default_ctor_p, int *cant_have_const_ctor_p, int *no_const_asn_ref_p) { tree *field; tree *next; - int has_pointers; + bool has_pointers; int any_default_members; + int cant_pack = 0; /* Assume there are no access declarations. */ *access_decls = NULL_TREE; /* Assume this class has no pointer members. */ - has_pointers = 0; + has_pointers = false; /* Assume none of the members of this class have default initializations. */ any_default_members = 0; @@ -2940,39 +2839,6 @@ check_field_decls (tree t, tree *access_decls, next = &TREE_CHAIN (x); - if (TREE_CODE (x) == FIELD_DECL) - { - if (TYPE_PACKED (t)) - { - if (!pod_type_p (TREE_TYPE (x)) && !TYPE_PACKED (TREE_TYPE (x))) - cp_warning_at - ("ignoring packed attribute on unpacked non-POD field `%#D'", - x); - else - DECL_PACKED (x) = 1; - } - - if (DECL_C_BIT_FIELD (x) && integer_zerop (DECL_INITIAL (x))) - /* We don't treat zero-width bitfields as making a class - non-empty. */ - ; - else - { - tree element_type; - - /* The class is non-empty. */ - CLASSTYPE_EMPTY_P (t) = 0; - /* The class is not even nearly empty. */ - CLASSTYPE_NEARLY_EMPTY_P (t) = 0; - /* If one of the data members contains an empty class, - so does T. */ - element_type = strip_array_types (type); - if (CLASS_TYPE_P (element_type) - && CLASSTYPE_CONTAINS_EMPTY_CLASS_P (element_type)) - CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 1; - } - } - if (TREE_CODE (x) == USING_DECL) { /* Prune the access declaration from the list of fields. */ @@ -3003,43 +2869,39 @@ check_field_decls (tree t, tree *access_decls, /* [class.union] If a union contains a static data member, or a member of - reference type, the program is ill-formed. */ + reference type, the program is ill-formed. */ if (TREE_CODE (x) == VAR_DECL) { - cp_error_at ("`%D' may not be static because it is a member of a union", x); + error ("%q+D may not be static because it is a member of a union", x); continue; } if (TREE_CODE (type) == REFERENCE_TYPE) { - cp_error_at ("`%D' may not have reference type `%T' because it is a member of a union", - x, type); + error ("%q+D may not have reference type %qT because" + " it is a member of a union", + x, type); continue; } } - /* ``A local class cannot have static data members.'' ARM 9.4 */ - if (current_function_decl && TREE_STATIC (x)) - cp_error_at ("field `%D' in local class cannot be static", x); - /* Perform error checking that did not get done in grokdeclarator. */ if (TREE_CODE (type) == FUNCTION_TYPE) { - cp_error_at ("field `%D' invalidly declared function type", - x); + error ("field %q+D invalidly declared function type", x); type = build_pointer_type (type); TREE_TYPE (x) = type; } else if (TREE_CODE (type) == METHOD_TYPE) { - cp_error_at ("field `%D' invalidly declared method type", x); + error ("field %q+D invalidly declared method type", x); type = build_pointer_type (type); TREE_TYPE (x) = type; } if (type == error_mark_node) continue; - + if (TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == VAR_DECL) continue; @@ -3051,7 +2913,7 @@ check_field_decls (tree t, tree *access_decls, /* If this is of reference type, check if it needs an init. Also do a little ANSI jig if necessary. */ if (TREE_CODE (type) == REFERENCE_TYPE) - { + { CLASSTYPE_NON_POD_P (t) = 1; if (DECL_INITIAL (x) == NULL_TREE) SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1); @@ -3060,18 +2922,53 @@ check_field_decls (tree t, tree *access_decls, aggregate, initialization by a brace-enclosed list) is the only way to initialize nonstatic const and reference members. */ - *cant_have_default_ctor_p = 1; TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) && extra_warnings) - cp_warning_at ("non-static reference `%#D' in class without a constructor", x); + warning (OPT_Wextra, "non-static reference %q+#D in class without a constructor", x); } type = strip_array_types (type); - - if (TYPE_PTR_P (type)) - has_pointers = 1; + + if (TYPE_PACKED (t)) + { + if (!pod_type_p (type) && !TYPE_PACKED (type)) + { + warning + (0, + "ignoring packed attribute because of unpacked non-POD field %q+#D", + x); + cant_pack = 1; + } + else if (TYPE_ALIGN (TREE_TYPE (x)) > BITS_PER_UNIT) + DECL_PACKED (x) = 1; + } + + if (DECL_C_BIT_FIELD (x) && integer_zerop (DECL_INITIAL (x))) + /* We don't treat zero-width bitfields as making a class + non-empty. */ + ; + else + { + /* The class is non-empty. */ + CLASSTYPE_EMPTY_P (t) = 0; + /* The class is not even nearly empty. */ + CLASSTYPE_NEARLY_EMPTY_P (t) = 0; + /* If one of the data members contains an empty class, + so does T. */ + if (CLASS_TYPE_P (type) + && CLASSTYPE_CONTAINS_EMPTY_CLASS_P (type)) + CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t) = 1; + } + + /* This is used by -Weffc++ (see below). Warn only for pointers + to members which might hold dynamic memory. So do not warn + for pointers to functions or pointers to members. */ + if (TYPE_PTR_P (type) + && !TYPE_PTRFN_P (type) + && !TYPE_PTR_TO_MEMBER_P (type)) + has_pointers = true; if (CLASS_TYPE_P (type)) { @@ -3085,8 +2982,8 @@ check_field_decls (tree t, tree *access_decls, CLASSTYPE_HAS_MUTABLE (t) = 1; if (! pod_type_p (type)) - /* DR 148 now allows pointers to members (which are POD themselves), - to be allowed in POD structs. */ + /* DR 148 now allows pointers to members (which are POD themselves), + to be allowed in POD structs. */ CLASSTYPE_NON_POD_P (t) = 1; if (! zero_init_p (type)) @@ -3103,12 +3000,11 @@ check_field_decls (tree t, tree *access_decls, aggregate, initialization by a brace-enclosed list) is the only way to initialize nonstatic const and reference members. */ - *cant_have_default_ctor_p = 1; TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) && extra_warnings) - cp_warning_at ("non-static const member `%#D' in class without a constructor", x); + warning (OPT_Wextra, "non-static const member %q+#D in class without a constructor", x); } /* A field that is pseudo-const makes the structure likewise. */ else if (CLASS_TYPE_P (type)) @@ -3123,7 +3019,7 @@ check_field_decls (tree t, tree *access_decls, different name from the class iff the class has a user-defined constructor. */ if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_CONSTRUCTOR (t)) - cp_pedwarn_at ("field `%#D' with same name as class", x); + pedwarn ("field %q+#D with same name as class", x); /* We set DECL_C_BIT_FIELD in grokbitfield. If the type and width are valid, we'll also set DECL_BIT_FIELD. */ @@ -3132,27 +3028,47 @@ check_field_decls (tree t, tree *access_decls, else check_field_decl (x, t, cant_have_const_ctor_p, - cant_have_default_ctor_p, no_const_asn_ref_p, &any_default_members); } - /* Effective C++ rule 11. */ - if (has_pointers && warn_ecpp && TYPE_HAS_CONSTRUCTOR (t) - && ! (TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t))) + /* Effective C++ rule 11: if a class has dynamic memory held by pointers, + it should also define a copy constructor and an assignment operator to + implement the correct copy semantic (deep vs shallow, etc.). As it is + not feasible to check whether the constructors do allocate dynamic memory + and store it within members, we approximate the warning like this: + + -- Warn only if there are members which are pointers + -- Warn only if there is a non-trivial constructor (otherwise, + there cannot be memory allocated). + -- Warn only if there is a non-trivial destructor. We assume that the + user at least implemented the cleanup correctly, and a destructor + is needed to free dynamic memory. + + This seems enough for practical purposes. */ + if (warn_ecpp + && has_pointers + && TYPE_HAS_CONSTRUCTOR (t) + && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) + && !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t))) { - warning ("`%#T' has pointer data members", t); - + warning (OPT_Weffc__, "%q#T has pointer data members", t); + if (! TYPE_HAS_INIT_REF (t)) { - warning (" but does not override `%T(const %T&)'", t, t); - if (! TYPE_HAS_ASSIGN_REF (t)) - warning (" or `operator=(const %T&)'", t); + warning (OPT_Weffc__, + " but does not override %<%T(const %T&)%>", t, t); + if (!TYPE_HAS_ASSIGN_REF (t)) + warning (OPT_Weffc__, " or %", t); } else if (! TYPE_HAS_ASSIGN_REF (t)) - warning (" but does not override `operator=(const %T&)'", t); + warning (OPT_Weffc__, + " but does not override %", t); } + /* If any of the fields couldn't be packed, unset TYPE_PACKED. */ + if (cant_pack) + TYPE_PACKED (t) = 0; /* Check anonymous struct/anonymous union fields. */ finish_struct_anon (t); @@ -3176,10 +3092,10 @@ record_subobject_offset (tree type, tree offset, splay_tree offsets) /* Record the location of this empty object in OFFSETS. */ n = splay_tree_lookup (offsets, (splay_tree_key) offset); if (!n) - n = splay_tree_insert (offsets, + n = splay_tree_insert (offsets, (splay_tree_key) offset, (splay_tree_value) NULL_TREE); - n->value = ((splay_tree_value) + n->value = ((splay_tree_value) tree_cons (NULL_TREE, type, (tree) n->value)); @@ -3223,12 +3139,12 @@ check_subobject_offset (tree type, tree offset, splay_tree offsets) is returned. Otherwise, returns zero. */ static int -walk_subobject_offsets (tree type, - subobject_offset_fn f, - tree offset, - splay_tree offsets, - tree max_offset, - int vbases_p) +walk_subobject_offsets (tree type, + subobject_offset_fn f, + tree offset, + splay_tree offsets, + tree max_offset, + int vbases_p) { int r = 0; tree type_binfo = NULL_TREE; @@ -3238,7 +3154,10 @@ walk_subobject_offsets (tree type, if (max_offset && INT_CST_LT (max_offset, offset)) return 0; - if (!TYPE_P (type)) + if (type == error_mark_node) + return 0; + + if (!TYPE_P (type)) { if (abi_version_at_least (2)) type_binfo = type; @@ -3263,18 +3182,16 @@ walk_subobject_offsets (tree type, /* Iterate through the direct base classes of TYPE. */ if (!type_binfo) type_binfo = TYPE_BINFO (type); - for (i = 0; i < BINFO_N_BASETYPES (type_binfo); ++i) + for (i = 0; BINFO_BASE_ITERATE (type_binfo, i, binfo); i++) { tree binfo_offset; - binfo = BINFO_BASETYPE (type_binfo, i); - - if (abi_version_at_least (2) - && TREE_VIA_VIRTUAL (binfo)) + if (abi_version_at_least (2) + && BINFO_VIRTUAL_P (binfo)) continue; - if (!vbases_p - && TREE_VIA_VIRTUAL (binfo) + if (!vbases_p + && BINFO_VIRTUAL_P (binfo) && !BINFO_PRIMARY_P (binfo)) continue; @@ -3288,8 +3205,8 @@ walk_subobject_offsets (tree type, /* We cannot rely on BINFO_OFFSET being set for the base class yet, but the offsets for direct non-virtual bases can be calculated by going back to the TYPE. */ - orig_binfo = BINFO_BASETYPE (TYPE_BINFO (type), i); - binfo_offset = size_binop (PLUS_EXPR, + orig_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), i); + binfo_offset = size_binop (PLUS_EXPR, offset, BINFO_OFFSET (orig_binfo)); } @@ -3299,15 +3216,16 @@ walk_subobject_offsets (tree type, binfo_offset, offsets, max_offset, - (abi_version_at_least (2) + (abi_version_at_least (2) ? /*vbases_p=*/0 : vbases_p)); if (r) return r; } - if (abi_version_at_least (2)) + if (abi_version_at_least (2) && CLASSTYPE_VBASECLASSES (type)) { - tree vbase; + unsigned ix; + VEC(tree,gc) *vbases; /* Iterate through the virtual base classes of TYPE. In G++ 3.2, we included virtual bases in the direct base class @@ -3315,11 +3233,9 @@ walk_subobject_offsets (tree type, correct offsets for virtual bases are only known when working with the most derived type. */ if (vbases_p) - for (vbase = CLASSTYPE_VBASECLASSES (type); - vbase; - vbase = TREE_CHAIN (vbase)) + for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0; + VEC_iterate (tree, vbases, ix, binfo); ix++) { - binfo = TREE_VALUE (vbase); r = walk_subobject_offsets (binfo, f, size_binop (PLUS_EXPR, @@ -3336,11 +3252,13 @@ walk_subobject_offsets (tree type, /* We still have to walk the primary base, if it is virtual. (If it is non-virtual, then it was walked above.) */ - vbase = get_primary_binfo (type_binfo); - if (vbase && TREE_VIA_VIRTUAL (vbase) - && BINFO_PRIMARY_BASE_OF (vbase) == type_binfo) + tree vbase = get_primary_binfo (type_binfo); + + if (vbase && BINFO_VIRTUAL_P (vbase) + && BINFO_PRIMARY_P (vbase) + && BINFO_INHERITANCE_CHAIN (vbase) == type_binfo) { - r = (walk_subobject_offsets + r = (walk_subobject_offsets (vbase, f, offset, offsets, max_offset, /*vbases_p=*/0)); if (r) @@ -3387,7 +3305,7 @@ walk_subobject_offsets (tree type, /* Step through each of the elements in the array. */ for (index = size_zero_node; /* G++ 3.2 had an off-by-one error here. */ - (abi_version_at_least (2) + (abi_version_at_least (2) ? !INT_CST_LT (TYPE_MAX_VALUE (domain), index) : INT_CST_LT (index, TYPE_MAX_VALUE (domain))); index = size_binop (PLUS_EXPR, index, size_one_node)) @@ -3400,7 +3318,7 @@ walk_subobject_offsets (tree type, /*vbases_p=*/1); if (r) return r; - offset = size_binop (PLUS_EXPR, offset, + offset = size_binop (PLUS_EXPR, offset, TYPE_SIZE_UNIT (TREE_TYPE (type))); /* If this new OFFSET is bigger than the MAX_OFFSET, then there's no point in iterating through the remaining @@ -3413,18 +3331,38 @@ walk_subobject_offsets (tree type, return 0; } -/* Record all of the empty subobjects of TYPE (located at OFFSET) in - OFFSETS. If VBASES_P is nonzero, virtual bases of TYPE are - examined. */ +/* Record all of the empty subobjects of TYPE (either a type or a + binfo). If IS_DATA_MEMBER is true, then a non-static data member + is being placed at OFFSET; otherwise, it is a base class that is + being placed at OFFSET. */ static void -record_subobject_offsets (tree type, - tree offset, - splay_tree offsets, - int vbases_p) +record_subobject_offsets (tree type, + tree offset, + splay_tree offsets, + bool is_data_member) { + tree max_offset; + /* If recording subobjects for a non-static data member or a + non-empty base class , we do not need to record offsets beyond + the size of the biggest empty class. Additional data members + will go at the end of the class. Additional base classes will go + either at offset zero (if empty, in which case they cannot + overlap with offsets past the size of the biggest empty class) or + at the end of the class. + + However, if we are placing an empty base class, then we must record + all offsets, as either the empty class is at offset zero (where + other empty classes might later be placed) or at the end of the + class (where other objects might then be placed, so other empty + subobjects might later overlap). */ + if (is_data_member + || !is_empty_class (BINFO_TYPE (type))) + max_offset = sizeof_biggest_empty_class; + else + max_offset = NULL_TREE; walk_subobject_offsets (type, record_subobject_offset, offset, - offsets, /*max_offset=*/NULL_TREE, vbases_p); + offsets, max_offset, is_data_member); } /* Returns nonzero if any of the empty subobjects of TYPE (located at @@ -3433,9 +3371,9 @@ record_subobject_offsets (tree type, static int layout_conflict_p (tree type, - tree offset, - splay_tree offsets, - int vbases_p) + tree offset, + splay_tree offsets, + int vbases_p) { splay_tree_node max_node; @@ -3459,15 +3397,15 @@ layout_conflict_p (tree type, the position of the DECL. */ static void -layout_nonempty_base_or_field (record_layout_info rli, - tree decl, - tree binfo, +layout_nonempty_base_or_field (record_layout_info rli, + tree decl, + tree binfo, splay_tree offsets) { tree offset = NULL_TREE; bool field_p; tree type; - + if (binfo) { /* For the purposes of determining layout conflicts, we want to @@ -3497,11 +3435,11 @@ layout_nonempty_base_or_field (record_layout_info rli, /* We have to check to see whether or not there is already something of the same type at the offset we're about to use. For example, consider: - + struct S {}; struct T : public S { int i; }; struct U : public S, public T {}; - + Here, we put S at offset zero in U. Then, we can't put T at offset zero -- its S component would be at the same address as the S we already allocated. So, we have to skip ahead. @@ -3515,9 +3453,9 @@ layout_nonempty_base_or_field (record_layout_info rli, break; /* G++ 3.2 did not check for overlaps when placing a non-empty virtual base. */ - if (!abi_version_at_least (2) && binfo && TREE_VIA_VIRTUAL (binfo)) + if (!abi_version_at_least (2) && binfo && BINFO_VIRTUAL_P (binfo)) break; - if (layout_conflict_p (field_p ? type : binfo, offset, + if (layout_conflict_p (field_p ? type : binfo, offset, offsets, field_p)) { /* Strip off the size allocated to this field. That puts us @@ -3527,8 +3465,8 @@ layout_nonempty_base_or_field (record_layout_info rli, /* Bump up by the alignment required for the type. */ rli->bitpos - = size_binop (PLUS_EXPR, rli->bitpos, - bitsize_int (binfo + = size_binop (PLUS_EXPR, rli->bitpos, + bitsize_int (binfo ? CLASSTYPE_ALIGN (type) : TYPE_ALIGN (type))); normalize_rli (rli); @@ -3545,9 +3483,9 @@ layout_nonempty_base_or_field (record_layout_info rli, this point because their BINFO_OFFSET is copied from another hierarchy. Therefore, we may not need to add the entire OFFSET. */ - propagate_binfo_offsets (binfo, + propagate_binfo_offsets (binfo, size_diffop (convert (ssizetype, offset), - convert (ssizetype, + convert (ssizetype, BINFO_OFFSET (binfo)))); } @@ -3575,7 +3513,7 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) bool atend = false; /* This routine should only be used for empty classes. */ - my_friendly_assert (is_empty_class (basetype), 20000321); + gcc_assert (is_empty_class (basetype)); alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype)); if (!integer_zerop (BINFO_OFFSET (binfo))) @@ -3583,27 +3521,28 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) if (abi_version_at_least (2)) propagate_binfo_offsets (binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo))); - else if (warn_abi) - warning ("offset of empty base `%T' may not be ABI-compliant and may" + else + warning (OPT_Wabi, + "offset of empty base %qT may not be ABI-compliant and may" "change in a future version of GCC", BINFO_TYPE (binfo)); } - + /* This is an empty base class. We first try to put it at offset zero. */ if (layout_conflict_p (binfo, BINFO_OFFSET (binfo), - offsets, + offsets, /*vbases_p=*/0)) { /* That didn't work. Now, we move forward from the next available spot in the class. */ atend = true; propagate_binfo_offsets (binfo, convert (ssizetype, eoc)); - while (1) + while (1) { if (!layout_conflict_p (binfo, - BINFO_OFFSET (binfo), + BINFO_OFFSET (binfo), offsets, /*vbases_p=*/0)) /* We finally found a spot where there's no overlap. */ @@ -3616,12 +3555,12 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) return atend; } -/* Layout the the base given by BINFO in the class indicated by RLI. +/* Layout the base given by BINFO in the class indicated by RLI. *BASE_ALIGN is a running maximum of the alignments of any base class. OFFSETS gives the location of empty base subobjects. T is the most derived type. Return nonzero if the new object cannot be nearly-empty. A new FIELD_DECL is inserted at - *NEXT_FIELD, unless BINFO is for an empty base class. + *NEXT_FIELD, unless BINFO is for an empty base class. Returns the location at which the next field should be inserted. */ @@ -3636,7 +3575,7 @@ build_base_field (record_layout_info rli, tree binfo, /* This error is now reported in xref_tag, thus giving better location information. */ return next_field; - + /* Place the base class. */ if (!is_empty_class (basetype)) { @@ -3645,16 +3584,18 @@ build_base_field (record_layout_info rli, tree binfo, /* The containing class is non-empty because it has a non-empty base class. */ CLASSTYPE_EMPTY_P (t) = 0; - + /* Create the FIELD_DECL. */ decl = build_decl (FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype)); DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; DECL_FIELD_CONTEXT (decl) = t; DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype); DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype); DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype); DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype); - DECL_IGNORED_P (decl) = 1; + DECL_MODE (decl) = TYPE_MODE (basetype); + DECL_FIELD_IS_BASE (decl) = 1; /* Try to place the field. It may take more than one try if we have a hard time placing the field without putting two @@ -3677,14 +3618,14 @@ build_base_field (record_layout_info rli, tree binfo, atend = layout_empty_base (binfo, eoc, offsets); /* A nearly-empty class "has no proper base class that is empty, not morally virtual, and at an offset other than zero." */ - if (!TREE_VIA_VIRTUAL (binfo) && CLASSTYPE_NEARLY_EMPTY_P (t)) + if (!BINFO_VIRTUAL_P (binfo) && CLASSTYPE_NEARLY_EMPTY_P (t)) { if (atend) CLASSTYPE_NEARLY_EMPTY_P (t) = 0; - /* The check above (used in G++ 3.2) is insufficient because + /* The check above (used in G++ 3.2) is insufficient because an empty class placed at offset zero might itself have an empty base at a nonzero offset. */ - else if (walk_subobject_offsets (basetype, + else if (walk_subobject_offsets (basetype, empty_base_at_nonzero_offset_p, size_zero_node, /*offsets=*/NULL, @@ -3693,12 +3634,13 @@ build_base_field (record_layout_info rli, tree binfo, { if (abi_version_at_least (2)) CLASSTYPE_NEARLY_EMPTY_P (t) = 0; - else if (warn_abi) - warning ("class `%T' will be considered nearly empty in a " + else + warning (OPT_Wabi, + "class %qT will be considered nearly empty in a " "future version of GCC", t); } } - + /* We do not create a FIELD_DECL for empty base classes because it might overlap some other field. We want to be able to create CONSTRUCTORs for the class by iterating over the @@ -3714,8 +3656,8 @@ build_base_field (record_layout_info rli, tree binfo, /* Record the offsets of BINFO and its base subobjects. */ record_subobject_offsets (binfo, BINFO_OFFSET (binfo), - offsets, - /*vbases_p=*/0); + offsets, + /*is_data_member=*/false); return next_field; } @@ -3733,7 +3675,7 @@ build_base_fields (record_layout_info rli, /* Chain to hold all the new FIELD_DECLs which stand in for base class subobjects. */ tree t = rli->t; - int n_baseclasses = CLASSTYPE_N_BASECLASSES (t); + int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); int i; /* The primary base class is always allocated first. */ @@ -3746,7 +3688,7 @@ build_base_fields (record_layout_info rli, { tree base_binfo; - base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i); + base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (t), i); /* The primary base was already allocated above, so we don't need to allocate it again here. */ @@ -3755,7 +3697,7 @@ build_base_fields (record_layout_info rli, /* Virtual bases are added at the end (a primary virtual base will have already been added). */ - if (TREE_VIA_VIRTUAL (base_binfo)) + if (BINFO_VIRTUAL_P (base_binfo)) continue; next_field = build_base_field (rli, base_binfo, @@ -3774,24 +3716,20 @@ check_methods (tree t) for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x)) { - /* If this was an evil function, don't keep it in class. */ - if (DECL_ASSEMBLER_NAME_SET_P (x) - && IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x))) - continue; - check_for_override (x, t); if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x)) - cp_error_at ("initializer specified for non-virtual method `%D'", x); - + error ("initializer specified for non-virtual method %q+D", x); /* The name of the field is the original field name Save this in auxiliary field for later overloading. */ if (DECL_VINDEX (x)) { TYPE_POLYMORPHIC_P (t) = 1; if (DECL_PURE_VIRTUAL_P (x)) - CLASSTYPE_PURE_VIRTUALS (t) - = tree_cons (NULL_TREE, x, CLASSTYPE_PURE_VIRTUALS (t)); + VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); } + /* All user-declared destructors are non-trivial. */ + if (DECL_DESTRUCTOR_P (x)) + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1; } } @@ -3848,14 +3786,14 @@ build_clone (tree fn, tree name) parmtypes = TREE_CHAIN (parmtypes); /* If this is subobject constructor or destructor, add the vtt parameter. */ - TREE_TYPE (clone) + TREE_TYPE (clone) = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (clone)), parmtypes); if (exceptions) TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone), exceptions); - TREE_TYPE (clone) + TREE_TYPE (clone) = cp_build_type_attribute_variant (TREE_TYPE (clone), TYPE_ATTRIBUTES (TREE_TYPE (fn))); } @@ -3894,8 +3832,8 @@ build_clone (tree fn, tree name) /* Create the RTL for this function. */ SET_DECL_RTL (clone, NULL_RTX); - rest_of_decl_compilation (clone, NULL, /*top_level=*/1, at_eof); - + rest_of_decl_compilation (clone, /*top_level=*/1, at_eof); + /* Make it easy to find the CLONE given the FN. */ TREE_CHAIN (clone) = TREE_CHAIN (fn); TREE_CHAIN (fn) = clone; @@ -3905,14 +3843,14 @@ build_clone (tree fn, tree name) { tree result; - DECL_TEMPLATE_RESULT (clone) + DECL_TEMPLATE_RESULT (clone) = build_clone (DECL_TEMPLATE_RESULT (clone), name); result = DECL_TEMPLATE_RESULT (clone); DECL_TEMPLATE_INFO (result) = copy_node (DECL_TEMPLATE_INFO (result)); DECL_TI_TEMPLATE (result) = clone; } - else if (DECL_DEFERRED_FN (fn)) - defer_fn (clone); + else if (pch_file) + note_decl_for_pch (clone); return clone; } @@ -3937,36 +3875,36 @@ clone_function_decl (tree fn, int update_method_vec_p) and a not-in-charge version. */ clone = build_clone (fn, complete_ctor_identifier); if (update_method_vec_p) - add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0); + add_method (DECL_CONTEXT (clone), clone, NULL_TREE); clone = build_clone (fn, base_ctor_identifier); if (update_method_vec_p) - add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0); + add_method (DECL_CONTEXT (clone), clone, NULL_TREE); } else { - my_friendly_assert (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn), 20000411); + gcc_assert (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn)); /* For each destructor, we need three variants: an in-charge version, a not-in-charge version, and an in-charge deleting version. We clone the deleting version first because that means it will go second on the TYPE_METHODS list -- and that corresponds to the correct layout order in the virtual - function table. + function table. - For a non-virtual destructor, we do not build a deleting + For a non-virtual destructor, we do not build a deleting destructor. */ if (DECL_VIRTUAL_P (fn)) { clone = build_clone (fn, deleting_dtor_identifier); if (update_method_vec_p) - add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0); + add_method (DECL_CONTEXT (clone), clone, NULL_TREE); } clone = build_clone (fn, complete_dtor_identifier); if (update_method_vec_p) - add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0); + add_method (DECL_CONTEXT (clone), clone, NULL_TREE); clone = build_clone (fn, base_dtor_identifier); if (update_method_vec_p) - add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0); + add_method (DECL_CONTEXT (clone), clone, NULL_TREE); } /* Note that this is an abstract function that is never emitted. */ @@ -3984,7 +3922,7 @@ void adjust_clone_args (tree decl) { tree clone; - + for (clone = TREE_CHAIN (decl); clone && DECL_CLONED_FUNCTION (clone); clone = TREE_CHAIN (clone)) { @@ -3993,7 +3931,7 @@ adjust_clone_args (tree decl) tree decl_parms, clone_parms; clone_parms = orig_clone_parms; - + /* Skip the 'this' parameter. */ orig_clone_parms = TREE_CHAIN (orig_clone_parms); orig_decl_parms = TREE_CHAIN (orig_decl_parms); @@ -4002,18 +3940,18 @@ adjust_clone_args (tree decl) orig_decl_parms = TREE_CHAIN (orig_decl_parms); if (DECL_HAS_VTT_PARM_P (decl)) orig_decl_parms = TREE_CHAIN (orig_decl_parms); - + clone_parms = orig_clone_parms; if (DECL_HAS_VTT_PARM_P (clone)) clone_parms = TREE_CHAIN (clone_parms); - + for (decl_parms = orig_decl_parms; decl_parms; decl_parms = TREE_CHAIN (decl_parms), clone_parms = TREE_CHAIN (clone_parms)) { - my_friendly_assert (same_type_p (TREE_TYPE (decl_parms), - TREE_TYPE (clone_parms)), 20010424); - + gcc_assert (same_type_p (TREE_TYPE (decl_parms), + TREE_TYPE (clone_parms))); + if (TREE_PURPOSE (decl_parms) && !TREE_PURPOSE (clone_parms)) { /* A default parameter has been added. Adjust the @@ -4037,12 +3975,12 @@ adjust_clone_args (tree decl) if (exceptions) type = build_exception_variant (type, exceptions); TREE_TYPE (clone) = type; - + clone_parms = NULL_TREE; break; } } - my_friendly_assert (!clone_parms, 20010424); + gcc_assert (!clone_parms); } } @@ -4072,11 +4010,11 @@ remove_zero_width_bit_fields (tree t) { tree *fieldsp; - fieldsp = &TYPE_FIELDS (t); + fieldsp = &TYPE_FIELDS (t); while (*fieldsp) { if (TREE_CODE (*fieldsp) == FIELD_DECL - && DECL_C_BIT_FIELD (*fieldsp) + && DECL_C_BIT_FIELD (*fieldsp) && DECL_INITIAL (*fieldsp)) *fieldsp = TREE_CHAIN (*fieldsp); else @@ -4093,7 +4031,7 @@ type_requires_array_cookie (tree type) tree fns; bool has_two_argument_delete_p = false; - my_friendly_assert (CLASS_TYPE_P (type), 20010712); + gcc_assert (CLASS_TYPE_P (type)); /* If there's a non-trivial destructor, we need a cookie. In order to iterate through the array calling the destructor for each @@ -4105,7 +4043,7 @@ type_requires_array_cookie (tree type) argument is of type `size_t', then we have to pass the size of the array to the deallocation function, so we will need to store a cookie. */ - fns = lookup_fnfields (TYPE_BINFO (type), + fns = lookup_fnfields (TYPE_BINFO (type), ansi_opname (VEC_DELETE_EXPR), /*protect=*/0); /* If there are no `operator []' members, or the lookup is @@ -4145,36 +4083,34 @@ type_requires_array_cookie (tree type) static void check_bases_and_members (tree t) { - /* Nonzero if we are not allowed to generate a default constructor - for this case. */ - int cant_have_default_ctor; /* Nonzero if the implicitly generated copy constructor should take a non-const reference argument. */ int cant_have_const_ctor; - /* Nonzero if the the implicitly generated assignment operator + /* Nonzero if the implicitly generated assignment operator should take a non-const reference argument. */ int no_const_asn_ref; tree access_decls; /* By default, we use const reference arguments and generate default constructors. */ - cant_have_default_ctor = 0; cant_have_const_ctor = 0; no_const_asn_ref = 0; /* Check all the base-classes. */ - check_bases (t, &cant_have_default_ctor, &cant_have_const_ctor, + check_bases (t, &cant_have_const_ctor, &no_const_asn_ref); - /* Check all the data member declarations. */ - check_field_decls (t, &access_decls, - &cant_have_default_ctor, - &cant_have_const_ctor, - &no_const_asn_ref); - /* Check all the method declarations. */ check_methods (t); + /* Check all the data member declarations. We cannot call + check_field_decls until we have called check_bases check_methods, + as check_field_decls depends on TYPE_HAS_NONTRIVIAL_DESTRUCTOR + being set appropriately. */ + check_field_decls (t, &access_decls, + &cant_have_const_ctor, + &no_const_asn_ref); + /* A nearly-empty class has to be vptr-containing; a nearly empty class contains just a vptr. */ if (!TYPE_CONTAINS_VPTR_P (t)) @@ -4183,25 +4119,20 @@ check_bases_and_members (tree t) /* Do some bookkeeping that will guide the generation of implicitly declared member functions. */ TYPE_HAS_COMPLEX_INIT_REF (t) - |= (TYPE_HAS_INIT_REF (t) - || TYPE_USES_VIRTUAL_BASECLASSES (t) - || TYPE_POLYMORPHIC_P (t)); + |= (TYPE_HAS_INIT_REF (t) || TYPE_CONTAINS_VPTR_P (t)); TYPE_NEEDS_CONSTRUCTING (t) - |= (TYPE_HAS_CONSTRUCTOR (t) - || TYPE_USES_VIRTUAL_BASECLASSES (t) - || TYPE_POLYMORPHIC_P (t)); - CLASSTYPE_NON_AGGREGATE (t) |= (TYPE_HAS_CONSTRUCTOR (t) - || TYPE_POLYMORPHIC_P (t)); + |= (TYPE_HAS_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t)); + CLASSTYPE_NON_AGGREGATE (t) + |= (TYPE_HAS_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t)); CLASSTYPE_NON_POD_P (t) - |= (CLASSTYPE_NON_AGGREGATE (t) || TYPE_HAS_DESTRUCTOR (t) + |= (CLASSTYPE_NON_AGGREGATE (t) + || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) || TYPE_HAS_ASSIGN_REF (t)); - TYPE_HAS_REAL_ASSIGN_REF (t) |= TYPE_HAS_ASSIGN_REF (t); TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t); - /* Synthesize any needed methods. Note that methods will be synthesized - for anonymous unions; grok_x_components undoes that. */ - add_implicitly_declared_members (t, cant_have_default_ctor, + /* Synthesize any needed methods. */ + add_implicitly_declared_members (t, cant_have_const_ctor, no_const_asn_ref); @@ -4240,14 +4171,15 @@ create_vtable_ptr (tree t, tree* virtuals_p) && TREE_CODE (DECL_VINDEX (fn)) != INTEGER_CST) { tree new_virtual = make_node (TREE_LIST); - + BV_FN (new_virtual) = fn; BV_DELTA (new_virtual) = integer_zero_node; + BV_VCALL_INDEX (new_virtual) = NULL_TREE; TREE_CHAIN (new_virtual) = *virtuals_p; *virtuals_p = new_virtual; } - + /* If we couldn't find an appropriate base class, create a new field here. Even if there weren't any new virtual functions, we might need a new virtual function table if we're supposed to include vptrs in @@ -4256,7 +4188,7 @@ create_vtable_ptr (tree t, tree* virtuals_p) { /* We build this decl with vtbl_ptr_type_node, which is a `vtable_entry_type*'. It might seem more precise to use - `vtable_entry_type (*)[N]' where N is the number of firtual + `vtable_entry_type (*)[N]' where N is the number of virtual functions. However, that would require the vtable pointer in base classes to have a different type than the vtable pointer in derived classes. We could make that happen, but that @@ -4266,9 +4198,9 @@ create_vtable_ptr (tree t, tree* virtuals_p) the derived class vtable pointer, since they have different types. Thus, in a derived class destructor, where the base class constructor was inlined, we could generate bad code for - setting up the vtable pointer. + setting up the vtable pointer. - Therefore, we use one type for all vtable pointers. We still + Therefore, we use one type for all vtable pointers. We still use a type-correct type; it's just doesn't indicate the array bounds. That's better than using `void*' or some such; it's cleaner, and it let's the alias analysis code know that these @@ -4276,24 +4208,16 @@ create_vtable_ptr (tree t, tree* virtuals_p) tree field; field = build_decl (FIELD_DECL, get_vfield_name (t), vtbl_ptr_type_node); - SET_DECL_ASSEMBLER_NAME (field, get_identifier (VFIELD_BASE)); DECL_VIRTUAL_P (field) = 1; DECL_ARTIFICIAL (field) = 1; DECL_FIELD_CONTEXT (field) = t; DECL_FCONTEXT (field) = t; - + TYPE_VFIELD (t) = field; - + /* This class is non-empty. */ CLASSTYPE_EMPTY_P (t) = 0; - if (CLASSTYPE_N_BASECLASSES (t)) - /* If there were any baseclasses, they can't possibly be at - offset zero any more, because that's where the vtable - pointer is. So, converting to a base class is going to - take work. */ - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (t) = 1; - return field; } @@ -4324,6 +4248,8 @@ static void fixup_inline_methods (tree type) { tree method = TYPE_METHODS (type); + VEC(tree,gc) *friends; + unsigned ix; if (method && TREE_CODE (method) == TREE_VEC) { @@ -4340,11 +4266,10 @@ fixup_inline_methods (tree type) fixup_pending_inline (method); /* Do friends. */ - for (method = CLASSTYPE_INLINE_FRIENDS (type); - method; - method = TREE_CHAIN (method)) - fixup_pending_inline (TREE_VALUE (method)); - CLASSTYPE_INLINE_FRIENDS (type) = NULL_TREE; + for (friends = CLASSTYPE_INLINE_FRIENDS (type), ix = 0; + VEC_iterate (tree, friends, ix, method); ix++) + fixup_pending_inline (method); + CLASSTYPE_INLINE_FRIENDS (type) = NULL; } /* Add OFFSET to all base types of BINFO which is a base in the @@ -4357,10 +4282,11 @@ propagate_binfo_offsets (tree binfo, tree offset) { int i; tree primary_binfo; + tree base_binfo; /* Update BINFO's offset. */ BINFO_OFFSET (binfo) - = convert (sizetype, + = convert (sizetype, size_binop (PLUS_EXPR, convert (ssizetype, BINFO_OFFSET (binfo)), offset)); @@ -4368,33 +4294,18 @@ propagate_binfo_offsets (tree binfo, tree offset) /* Find the primary base class. */ primary_binfo = get_primary_binfo (binfo); + if (primary_binfo && BINFO_INHERITANCE_CHAIN (primary_binfo) == binfo) + propagate_binfo_offsets (primary_binfo, offset); + /* Scan all of the bases, pushing the BINFO_OFFSET adjust downwards. */ - for (i = -1; i < BINFO_N_BASETYPES (binfo); ++i) + for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { - tree base_binfo; + /* Don't do the primary base twice. */ + if (base_binfo == primary_binfo) + continue; - /* On the first time through the loop, do the primary base. - Because the primary base need not be an immediate base, we - must handle the primary base specially. */ - if (i == -1) - { - if (!primary_binfo) - continue; - - base_binfo = primary_binfo; - } - else - { - base_binfo = BINFO_BASETYPE (binfo, i); - /* Don't do the primary base twice. */ - if (base_binfo == primary_binfo) - continue; - } - - /* Skip virtual bases that aren't our canonical primary base. */ - if (TREE_VIA_VIRTUAL (base_binfo) - && BINFO_PRIMARY_BASE_OF (base_binfo) != binfo) + if (BINFO_VIRTUAL_P (base_binfo)) continue; propagate_binfo_offsets (base_binfo, offset); @@ -4413,7 +4324,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) bool first_vbase = true; tree *next_field; - if (CLASSTYPE_N_BASECLASSES (t) == 0) + if (BINFO_N_BASE_BINFOS (TYPE_BINFO (t)) == 0) return; if (!abi_version_at_least(2)) @@ -4442,7 +4353,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) allocated in inheritance graph order. */ for (vbase = TYPE_BINFO (t); vbase; vbase = TREE_CHAIN (vbase)) { - if (!TREE_VIA_VIRTUAL (vbase)) + if (!BINFO_VIRTUAL_P (vbase)) continue; if (!BINFO_PRIMARY_P (vbase)) @@ -4463,13 +4374,15 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) the results which is not particularly tractable. */ if (warn_abi && first_vbase - && (tree_int_cst_lt + && (tree_int_cst_lt (size_binop (CEIL_DIV_EXPR, round_up (CLASSTYPE_SIZE (t), CLASSTYPE_ALIGN (basetype)), bitsize_unit_node), BINFO_OFFSET (vbase)))) - warning ("offset of virtual base `%T' is not ABI-compliant and may change in a future version of GCC", + warning (OPT_Wabi, + "offset of virtual base %qT is not ABI-compliant and " + "may change in a future version of GCC", basetype); first_vbase = false; @@ -4504,31 +4417,32 @@ static tree end_of_class (tree t, int include_virtuals_p) { tree result = size_zero_node; + VEC(tree,gc) *vbases; tree binfo; + tree base_binfo; tree offset; int i; - for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i) + for (binfo = TYPE_BINFO (t), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { - binfo = BINFO_BASETYPE (TYPE_BINFO (t), i); - if (!include_virtuals_p - && TREE_VIA_VIRTUAL (binfo) - && BINFO_PRIMARY_BASE_OF (binfo) != TYPE_BINFO (t)) + && BINFO_VIRTUAL_P (base_binfo) + && (!BINFO_PRIMARY_P (base_binfo) + || BINFO_INHERITANCE_CHAIN (base_binfo) != TYPE_BINFO (t))) continue; - offset = end_of_base (binfo); + offset = end_of_base (base_binfo); if (INT_CST_LT_UNSIGNED (result, offset)) result = offset; } /* G++ 3.2 did not check indirect virtual bases. */ if (abi_version_at_least (2) && include_virtuals_p) - for (binfo = CLASSTYPE_VBASECLASSES (t); - binfo; - binfo = TREE_CHAIN (binfo)) + for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0; + VEC_iterate (tree, vbases, i, base_binfo); i++) { - offset = end_of_base (TREE_VALUE (binfo)); + offset = end_of_base (base_binfo); if (INT_CST_LT_UNSIGNED (result, offset)) result = offset; } @@ -4550,29 +4464,35 @@ static void warn_about_ambiguous_bases (tree t) { int i; - tree vbases; + VEC(tree,gc) *vbases; tree basetype; + tree binfo; + tree base_binfo; + + /* If there are no repeated bases, nothing can be ambiguous. */ + if (!CLASSTYPE_REPEATED_BASE_P (t)) + return; /* Check direct bases. */ - for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i) + for (binfo = TYPE_BINFO (t), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { - basetype = TYPE_BINFO_BASETYPE (t, i); + basetype = BINFO_TYPE (base_binfo); - if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) - warning ("direct base `%T' inaccessible in `%T' due to ambiguity", + if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) + warning (0, "direct base %qT inaccessible in %qT due to ambiguity", basetype, t); } /* Check for ambiguous virtual bases. */ if (extra_warnings) - for (vbases = CLASSTYPE_VBASECLASSES (t); - vbases; - vbases = TREE_CHAIN (vbases)) + for (vbases = CLASSTYPE_VBASECLASSES (t), i = 0; + VEC_iterate (tree, vbases, i, binfo); i++) { - basetype = BINFO_TYPE (TREE_VALUE (vbases)); - - if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) - warning ("virtual base `%T' inaccessible in `%T' due to ambiguity", + basetype = BINFO_TYPE (binfo); + + if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) + warning (OPT_Wextra, "virtual base %qT inaccessible in %qT due to ambiguity", basetype, t); } } @@ -4599,7 +4519,7 @@ include_empty_classes (record_layout_info rli) because we are willing to overlay multiple bases at the same offset. However, now we need to make sure that RLI is big enough to reflect the entire class. */ - eoc = end_of_class (rli->t, + eoc = end_of_class (rli->t, CLASSTYPE_AS_BASE (rli->t) != NULL_TREE); rli_size = rli_size_unit_so_far (rli); if (TREE_CODE (rli_size) == INTEGER_CST @@ -4614,12 +4534,10 @@ include_empty_classes (record_layout_info rli) rli->bitpos = round_down (rli->bitpos, BITS_PER_UNIT); else /* The size should have been rounded to a whole byte. */ - my_friendly_assert (tree_int_cst_equal (rli->bitpos, - round_down (rli->bitpos, - BITS_PER_UNIT)), - 20030903); - rli->bitpos - = size_binop (PLUS_EXPR, + gcc_assert (tree_int_cst_equal + (rli->bitpos, round_down (rli->bitpos, BITS_PER_UNIT))); + rli->bitpos + = size_binop (PLUS_EXPR, rli->bitpos, size_binop (MULT_EXPR, convert (bitsizetype, @@ -4657,9 +4575,8 @@ layout_class_type (tree t, tree *virtuals_p) /* Start laying out the record. */ rli = start_record_layout (t); - /* If possible, we reuse the virtual function table pointer from one - of our base classes. */ - determine_primary_base (t); + /* Mark all the primary bases in the hierarchy. */ + determine_primary_bases (t); /* Create a pointer to our virtual function table. */ vptr = create_vtable_ptr (t, virtuals_p); @@ -4676,10 +4593,10 @@ layout_class_type (tree t, tree *virtuals_p) next_field = &TYPE_FIELDS (t); /* Build FIELD_DECLs for all of the non-virtual base-types. */ - empty_base_offsets = splay_tree_new (splay_tree_compare_integer_csts, + empty_base_offsets = splay_tree_new (splay_tree_compare_integer_csts, NULL, NULL); build_base_fields (rli, empty_base_offsets, next_field); - + /* Layout the non-static data members. */ for (field = non_static_data_members; field; field = TREE_CHAIN (field)) { @@ -4692,22 +4609,30 @@ layout_class_type (tree t, tree *virtuals_p) { place_field (rli, field); /* If the static data member has incomplete type, keep track - of it so that it can be completed later. (The handling + of it so that it can be completed later. (The handling of pending statics in finish_record_layout is insufficient; consider: struct S1; struct S2 { static S1 s1; }; - - At this point, finish_record_layout will be called, but + + At this point, finish_record_layout will be called, but S1 is still incomplete.) */ if (TREE_CODE (field) == VAR_DECL) - maybe_register_incomplete_var (field); + { + maybe_register_incomplete_var (field); + /* The visibility of static data members is determined + at their point of declaration, not their point of + definition. */ + determine_visibility (field); + } continue; } type = TREE_TYPE (field); - + if (type == error_mark_node) + continue; + padding = NULL_TREE; /* If this field is a bit-field whose width is greater than its @@ -4724,7 +4649,7 @@ layout_class_type (tree t, tree *virtuals_p) of the field. Then, we are supposed to use the left over bits as additional padding. */ for (itk = itk_char; itk != itk_none; ++itk) - if (INT_CST_LT (DECL_SIZE (field), + if (INT_CST_LT (DECL_SIZE (field), TYPE_SIZE (integer_types[itk]))) break; @@ -4745,10 +4670,10 @@ layout_class_type (tree t, tree *virtuals_p) padding = DECL_SIZE (field); else { - if (warn_abi && TREE_CODE (t) == UNION_TYPE) - warning ("size assigned to `%T' may not be " + if (TREE_CODE (t) == UNION_TYPE) + warning (OPT_Wabi, "size assigned to %qT may not be " "ABI-compliant and may change in a future " - "version of GCC", + "version of GCC", t); padding = size_binop (MINUS_EXPR, DECL_SIZE (field), TYPE_SIZE (integer_type)); @@ -4785,7 +4710,8 @@ layout_class_type (tree t, tree *virtuals_p) && DECL_MODE (field) != TYPE_MODE (type)) /* Versions of G++ before G++ 3.4 did not reset the DECL_MODE. */ - warning ("the offset of `%D' may not be ABI-compliant and may " + warning (OPT_Wabi, + "the offset of %qD may not be ABI-compliant and may " "change in a future version of GCC", field); } else @@ -4794,33 +4720,60 @@ layout_class_type (tree t, tree *virtuals_p) /* Remember the location of any empty classes in FIELD. */ if (abi_version_at_least (2)) - record_subobject_offsets (TREE_TYPE (field), + record_subobject_offsets (TREE_TYPE (field), byte_position(field), empty_base_offsets, - /*vbases_p=*/1); + /*is_data_member=*/true); /* If a bit-field does not immediately follow another bit-field, and yet it starts in the middle of a byte, we have failed to comply with the ABI. */ if (warn_abi - && DECL_C_BIT_FIELD (field) + && DECL_C_BIT_FIELD (field) + /* The TREE_NO_WARNING flag gets set by Objective-C when + laying out an Objective-C class. The ObjC ABI differs + from the C++ ABI, and so we do not want a warning + here. */ + && !TREE_NO_WARNING (field) && !last_field_was_bitfield && !integer_zerop (size_binop (TRUNC_MOD_EXPR, DECL_FIELD_BIT_OFFSET (field), bitsize_unit_node))) - cp_warning_at ("offset of `%D' is not ABI-compliant and may change in a future version of GCC", - field); + warning (OPT_Wabi, "offset of %q+D is not ABI-compliant and may " + "change in a future version of GCC", field); /* G++ used to use DECL_FIELD_OFFSET as if it were the byte offset of the field. */ - if (warn_abi + if (warn_abi && !tree_int_cst_equal (DECL_FIELD_OFFSET (field), byte_position (field)) && contains_empty_class_p (TREE_TYPE (field))) - cp_warning_at ("`%D' contains empty classes which may cause base " - "classes to be placed at different locations in a " - "future version of GCC", - field); + warning (OPT_Wabi, "%q+D contains empty classes which may cause base " + "classes to be placed at different locations in a " + "future version of GCC", field); + + /* The middle end uses the type of expressions to determine the + possible range of expression values. In order to optimize + "x.i > 7" to "false" for a 2-bit bitfield "i", the middle end + must be made aware of the width of "i", via its type. + + Because C++ does not have integer types of arbitrary width, + we must (for the purposes of the front end) convert from the + type assigned here to the declared type of the bitfield + whenever a bitfield expression is used as an rvalue. + Similarly, when assigning a value to a bitfield, the value + must be converted to the type given the bitfield here. */ + if (DECL_C_BIT_FIELD (field)) + { + tree ftype; + unsigned HOST_WIDE_INT width; + ftype = TREE_TYPE (field); + width = tree_low_cst (DECL_SIZE (field), /*unsignedp=*/1); + if (width != TYPE_PRECISION (ftype)) + TREE_TYPE (field) + = c_build_bitfield_integer_type (width, + TYPE_UNSIGNED (ftype)); + } /* If we needed additional padding after this field, add it now. */ @@ -4828,15 +4781,16 @@ layout_class_type (tree t, tree *virtuals_p) { tree padding_field; - padding_field = build_decl (FIELD_DECL, + padding_field = build_decl (FIELD_DECL, NULL_TREE, - char_type_node); + char_type_node); DECL_BIT_FIELD (padding_field) = 1; DECL_SIZE (padding_field) = padding; DECL_CONTEXT (padding_field) = t; DECL_ARTIFICIAL (padding_field) = 1; + DECL_IGNORED_P (padding_field) = 1; layout_nonempty_base_or_field (rli, padding_field, - NULL_TREE, + NULL_TREE, empty_base_offsets); } @@ -4867,7 +4821,7 @@ layout_class_type (tree t, tree *virtuals_p) if (CLASSTYPE_NON_POD_P (t) || CLASSTYPE_EMPTY_P (t)) { base_t = make_node (TREE_CODE (t)); - + /* Set the size and alignment for the new type. In G++ 3.2, all empty classes were considered to have size zero when used as base classes. */ @@ -4876,7 +4830,8 @@ layout_class_type (tree t, tree *virtuals_p) TYPE_SIZE (base_t) = bitsize_zero_node; TYPE_SIZE_UNIT (base_t) = size_zero_node; if (warn_abi && !integer_zerop (rli_size_unit_so_far (rli))) - warning ("layout of classes derived from empty class `%T' " + warning (OPT_Wabi, + "layout of classes derived from empty class %qT " "may change in a future version of GCC", t); } @@ -4892,14 +4847,14 @@ layout_class_type (tree t, tree *virtuals_p) rli_size_so_far, rather than rli_size_unit_so_far, is used to compute TYPE_SIZE_UNIT. */ eoc = end_of_class (t, /*include_virtuals_p=*/0); - TYPE_SIZE_UNIT (base_t) + TYPE_SIZE_UNIT (base_t) = size_binop (MAX_EXPR, convert (sizetype, size_binop (CEIL_DIV_EXPR, rli_size_so_far (rli), bitsize_int (BITS_PER_UNIT))), eoc); - TYPE_SIZE (base_t) + TYPE_SIZE (base_t) = size_binop (MAX_EXPR, rli_size_so_far (rli), size_binop (MULT_EXPR, @@ -4915,7 +4870,7 @@ layout_class_type (tree t, tree *virtuals_p) if (TREE_CODE (field) == FIELD_DECL) { *next_field = build_decl (FIELD_DECL, - DECL_NAME (field), + DECL_NAME (field), TREE_TYPE (field)); DECL_CONTEXT (*next_field) = base_t; DECL_FIELD_OFFSET (*next_field) = DECL_FIELD_OFFSET (field); @@ -4948,13 +4903,13 @@ layout_class_type (tree t, tree *virtuals_p) base subobject fields. */ layout_virtual_bases (rli, empty_base_offsets); - /* Make sure that empty classes are reflected in RLI at this + /* Make sure that empty classes are reflected in RLI at this point. */ include_empty_classes(rli); /* Make sure not to create any structures with zero size. */ if (integer_zerop (rli_size_unit_so_far (rli)) && CLASSTYPE_EMPTY_P (t)) - place_field (rli, + place_field (rli, build_decl (FIELD_DECL, NULL_TREE, char_type_node)); /* Let the back-end lay out the type. */ @@ -4963,15 +4918,25 @@ layout_class_type (tree t, tree *virtuals_p) /* Warn about bases that can't be talked about due to ambiguity. */ warn_about_ambiguous_bases (t); + /* Now that we're done with layout, give the base fields the real types. */ + for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) + if (DECL_ARTIFICIAL (field) && IS_FAKE_BASE_TYPE (TREE_TYPE (field))) + TREE_TYPE (field) = TYPE_CONTEXT (TREE_TYPE (field)); + /* Clean up. */ splay_tree_delete (empty_base_offsets); + + if (CLASSTYPE_EMPTY_P (t) + && tree_int_cst_lt (sizeof_biggest_empty_class, + TYPE_SIZE_UNIT (t))) + sizeof_biggest_empty_class = TYPE_SIZE_UNIT (t); } -/* Returns the virtual function with which the vtable for TYPE is - emitted, or NULL_TREE if that heuristic is not applicable to TYPE. */ +/* Determine the "key method" for the class type indicated by TYPE, + and set CLASSTYPE_KEY_METHOD accordingly. */ -static tree -key_method (tree type) +void +determine_key_method (tree type) { tree method; @@ -4979,16 +4944,23 @@ key_method (tree type) || processing_template_decl || CLASSTYPE_TEMPLATE_INSTANTIATION (type) || CLASSTYPE_INTERFACE_KNOWN (type)) - return NULL_TREE; + return; + /* The key method is the first non-pure virtual function that is not + inline at the point of class definition. On some targets the + key function may not be inline; those targets should not call + this function until the end of the translation unit. */ for (method = TYPE_METHODS (type); method != NULL_TREE; method = TREE_CHAIN (method)) if (DECL_VINDEX (method) != NULL_TREE && ! DECL_DECLARED_INLINE_P (method) && ! DECL_PURE_VIRTUAL_P (method)) - return method; + { + CLASSTYPE_KEY_METHOD (type) = method; + break; + } - return NULL_TREE; + return; } /* Perform processing required when the definition of T (a class type) @@ -5001,14 +4973,11 @@ finish_struct_1 (tree t) /* A TREE_LIST. The TREE_VALUE of each node is a FUNCTION_DECL. */ tree virtuals = NULL_TREE; int n_fields = 0; - tree vfield; if (COMPLETE_TYPE_P (t)) { - if (IS_AGGR_TYPE (t)) - error ("redefinition of `%#T'", t); - else - abort (); + gcc_assert (IS_AGGR_TYPE (t)); + error ("redefinition of %q#T", t); popclass (); return; } @@ -5019,7 +4988,7 @@ finish_struct_1 (tree t) CLASSTYPE_PRIMARY_BINFO (t) = NULL_TREE; fixup_inline_methods (t); - + /* Make assumptions about the class; we'll reset the flags if necessary. */ CLASSTYPE_EMPTY_P (t) = 1; @@ -5033,7 +5002,16 @@ finish_struct_1 (tree t) /* Find the key method. */ if (TYPE_CONTAINS_VPTR_P (t)) { - CLASSTYPE_KEY_METHOD (t) = key_method (t); + /* The Itanium C++ ABI permits the key method to be chosen when + the class is defined -- even though the key method so + selected may later turn out to be an inline function. On + some systems (such as ARM Symbian OS) the key method cannot + be determined until the end of the translation unit. On such + systems, we leave CLASSTYPE_KEY_METHOD set to NULL, which + will cause the class to be added to KEYED_CLASSES. Then, in + finish_file we will determine the key method. */ + if (targetm.cxx.key_method_may_be_inline ()) + determine_key_method (t); /* If a polymorphic class has no key method, we may emit the vtable in every translation unit where the class definition appears. */ @@ -5048,36 +5026,8 @@ finish_struct_1 (tree t) needs a mode. */ compute_record_mode (CLASSTYPE_AS_BASE (t)); - /* Make sure that we get our own copy of the vfield FIELD_DECL. */ - vfield = TYPE_VFIELD (t); - if (vfield && CLASSTYPE_HAS_PRIMARY_BASE_P (t)) - { - tree primary = CLASSTYPE_PRIMARY_BINFO (t); - - my_friendly_assert (same_type_p (DECL_FIELD_CONTEXT (vfield), - BINFO_TYPE (primary)), - 20010726); - /* The vtable better be at the start. */ - my_friendly_assert (integer_zerop (DECL_FIELD_OFFSET (vfield)), - 20010726); - my_friendly_assert (integer_zerop (BINFO_OFFSET (primary)), - 20010726); - - vfield = copy_decl (vfield); - DECL_FIELD_CONTEXT (vfield) = t; - TYPE_VFIELD (t) = vfield; - } - else - my_friendly_assert (!vfield || DECL_FIELD_CONTEXT (vfield) == t, 20010726); - virtuals = modify_all_vtables (t, nreverse (virtuals)); - /* If we created a new vtbl pointer for this class, add it to the - list. */ - if (TYPE_VFIELD (t) && !CLASSTYPE_HAS_PRIMARY_BASE_P (t)) - CLASSTYPE_VFIELDS (t) - = chainon (CLASSTYPE_VFIELDS (t), build_tree_list (NULL_TREE, t)); - /* If necessary, create the primary vtable for this class. */ if (virtuals || TYPE_CONTAINS_VPTR_P (t)) { @@ -5095,20 +5045,19 @@ finish_struct_1 (tree t) int vindex; tree fn; - if (TYPE_BINFO_VTABLE (t)) - my_friendly_assert (DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)), - 20000116); + if (BINFO_VTABLE (TYPE_BINFO (t))) + gcc_assert (DECL_VIRTUAL_P (BINFO_VTABLE (TYPE_BINFO (t)))); if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t)) - my_friendly_assert (TYPE_BINFO_VIRTUALS (t) == NULL_TREE, - 20000116); + gcc_assert (BINFO_VIRTUALS (TYPE_BINFO (t)) == NULL_TREE); /* Add entries for virtual functions introduced by this class. */ - TYPE_BINFO_VIRTUALS (t) = chainon (TYPE_BINFO_VIRTUALS (t), virtuals); + BINFO_VIRTUALS (TYPE_BINFO (t)) + = chainon (BINFO_VIRTUALS (TYPE_BINFO (t)), virtuals); /* Set DECL_VINDEX for all functions declared in this class. */ - for (vindex = 0, fn = BINFO_VIRTUALS (TYPE_BINFO (t)); - fn; - fn = TREE_CHAIN (fn), + for (vindex = 0, fn = BINFO_VIRTUALS (TYPE_BINFO (t)); + fn; + fn = TREE_CHAIN (fn), vindex += (TARGET_VTABLE_USES_DESCRIPTORS ? TARGET_VTABLE_USES_DESCRIPTORS : 1)) { @@ -5120,7 +5069,7 @@ finish_struct_1 (tree t) thunk base function. */ DECL_VINDEX (fndecl) = NULL_TREE; else if (TREE_CODE (DECL_VINDEX (fndecl)) != INTEGER_CST) - DECL_VINDEX (fndecl) = build_shared_int_cst (vindex); + DECL_VINDEX (fndecl) = build_int_cst (NULL_TREE, vindex); } } @@ -5130,6 +5079,7 @@ finish_struct_1 (tree t) working on. */ for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x)) if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x) + && TREE_TYPE (x) != error_mark_node && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t)) DECL_MODE (x) = TYPE_MODE (t); @@ -5143,8 +5093,9 @@ finish_struct_1 (tree t) n_fields = count_fields (TYPE_FIELDS (t)); if (n_fields > 7) { - struct sorted_fields_type *field_vec = ggc_alloc (sizeof (struct sorted_fields_type) - + n_fields * sizeof (tree)); + struct sorted_fields_type *field_vec = GGC_NEWVAR + (struct sorted_fields_type, + sizeof (struct sorted_fields_type) + n_fields * sizeof (tree)); field_vec->len = n_fields; add_fields_to_record_type (TYPE_FIELDS (t), field_vec, 0); qsort (field_vec->elts, n_fields, sizeof (tree), @@ -5154,39 +5105,50 @@ finish_struct_1 (tree t) DECL_SORTED_FIELDS (TYPE_MAIN_DECL (t)) = field_vec; } - if (TYPE_HAS_CONSTRUCTOR (t)) - { - tree vfields = CLASSTYPE_VFIELDS (t); - - for (vfields = CLASSTYPE_VFIELDS (t); - vfields; vfields = TREE_CHAIN (vfields)) - /* Mark the fact that constructor for T could affect anybody - inheriting from T who wants to initialize vtables for - VFIELDS's type. */ - if (VF_BINFO_VALUE (vfields)) - TREE_ADDRESSABLE (vfields) = 1; - } + /* Complain if one of the field types requires lower visibility. */ + constrain_class_visibility (t); /* Make the rtl for any new vtables we have created, and unmark the base types we marked. */ finish_vtbls (t); - + /* Build the VTT for T. */ build_vtt (t); - if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t) - && DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE) - warning ("`%#T' has virtual functions but non-virtual destructor", t); + /* This warning does not make sense for Java classes, since they + cannot have destructors. */ + if (!TYPE_FOR_JAVA (t) && warn_nonvdtor && TYPE_POLYMORPHIC_P (t)) + { + tree dtor; + + dtor = CLASSTYPE_DESTRUCTORS (t); + /* Warn only if the dtor is non-private or the class has + friends. */ + if (/* An implicitly declared destructor is always public. And, + if it were virtual, we would have created it by now. */ + !dtor + || (!DECL_VINDEX (dtor) + && (!TREE_PRIVATE (dtor) + || CLASSTYPE_FRIEND_CLASSES (t) + || DECL_FRIENDLIST (TYPE_MAIN_DECL (t))))) + warning (0, "%q#T has virtual functions but non-virtual destructor", + t); + } complete_vars (t); if (warn_overloaded_virtual) warn_hidden (t); + /* Class layout, assignment of virtual table slots, etc., is now + complete. Give the back end a chance to tweak the visibility of + the class or perform any other required target modifications. */ + targetm.cxx.adjust_class_at_definition (t); + maybe_suppress_debug_info (t); dump_class_hierarchy (t); - + /* Finish debugging output for this type. */ rest_of_type_compilation (t, ! LOCAL_CLASS_P (t)); } @@ -5209,8 +5171,8 @@ unreverse_member_declarations (tree t) /* Actually, for the TYPE_FIELDS, only the non TYPE_DECLs are in reverse order, so we can't just use nreverse. */ prev = NULL_TREE; - for (x = TYPE_FIELDS (t); - x && TREE_CODE (x) != TYPE_DECL; + for (x = TYPE_FIELDS (t); + x && TREE_CODE (x) != TYPE_DECL; x = next) { next = TREE_CHAIN (x); @@ -5242,9 +5204,24 @@ finish_struct (tree t, tree attributes) if (processing_template_decl) { + tree x; + finish_struct_methods (t); TYPE_SIZE (t) = bitsize_zero_node; TYPE_SIZE_UNIT (t) = size_zero_node; + + /* We need to emit an error message if this type was used as a parameter + and it is an abstract type, even if it is a template. We construct + a simple CLASSTYPE_PURE_VIRTUALS list without taking bases into + account and we call complete_vars with this type, which will check + the PARM_DECLS. Note that while the type is being defined, + CLASSTYPE_PURE_VIRTUALS contains the list of the inline friends + (see CLASSTYPE_INLINE_FRIENDS) so we need to clear it. */ + CLASSTYPE_PURE_VIRTUALS (t) = NULL; + for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x)) + if (DECL_PURE_VIRTUAL_P (x)) + VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); + complete_vars (t); } else finish_struct_1 (t); @@ -5304,9 +5281,6 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) } return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); - case RTL_EXPR: - return NULL_TREE; - case PLUS_EXPR: case MINUS_EXPR: if (TREE_CODE (TREE_OPERAND (instance, 0)) == ADDR_EXPR) @@ -5321,11 +5295,23 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); case ADDR_EXPR: + instance = TREE_OPERAND (instance, 0); if (nonnull) - *nonnull = 1; - return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); + { + /* Just because we see an ADDR_EXPR doesn't mean we're dealing + with a real object -- given &p->f, p can still be null. */ + tree t = get_base_address (instance); + /* ??? Probably should check DECL_WEAK here. */ + if (t && DECL_P (t)) + *nonnull = 1; + } + return fixed_type_or_null (instance, nonnull, cdtorp); case COMPONENT_REF: + /* If this component is really a base class reference, then the field + itself isn't definitive. */ + if (DECL_FIELD_IS_BASE (TREE_OPERAND (instance, 1))) + return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp); return fixed_type_or_null (TREE_OPERAND (instance, 1), nonnull, cdtorp); case VAR_DECL: @@ -5348,30 +5334,30 @@ fixed_type_or_null (tree instance, int* nonnull, int* cdtorp) return TREE_TYPE (instance); } else if (instance == current_class_ptr) - { - if (nonnull) - *nonnull = 1; - - /* if we're in a ctor or dtor, we know our type. */ - if (DECL_LANG_SPECIFIC (current_function_decl) - && (DECL_CONSTRUCTOR_P (current_function_decl) - || DECL_DESTRUCTOR_P (current_function_decl))) - { - if (cdtorp) - *cdtorp = 1; - return TREE_TYPE (TREE_TYPE (instance)); - } - } - else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE) - { - /* Reference variables should be references to objects. */ - if (nonnull) + { + if (nonnull) *nonnull = 1; - + + /* if we're in a ctor or dtor, we know our type. */ + if (DECL_LANG_SPECIFIC (current_function_decl) + && (DECL_CONSTRUCTOR_P (current_function_decl) + || DECL_DESTRUCTOR_P (current_function_decl))) + { + if (cdtorp) + *cdtorp = 1; + return TREE_TYPE (TREE_TYPE (instance)); + } + } + else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE) + { + /* Reference variables should be references to objects. */ + if (nonnull) + *nonnull = 1; + /* DECL_VAR_MARKED_P is used to prevent recursion; a variable's initializer may refer to the variable itself. */ - if (TREE_CODE (instance) == VAR_DECL + if (TREE_CODE (instance) == VAR_DECL && DECL_INITIAL (instance) && !DECL_VAR_MARKED_P (instance)) { @@ -5409,7 +5395,7 @@ resolves_to_fixed_type_p (tree instance, int* nonnull) { tree t = TREE_TYPE (instance); int cdtorp = 0; - + tree fixed = fixed_type_or_null (instance, nonnull, &cdtorp); if (fixed == NULL_TREE) return 0; @@ -5426,15 +5412,36 @@ init_class_processing (void) { current_class_depth = 0; current_class_stack_size = 10; - current_class_stack - = xmalloc (current_class_stack_size * sizeof (struct class_stack_node)); - VARRAY_TREE_INIT (local_classes, 8, "local_classes"); + current_class_stack + = XNEWVEC (struct class_stack_node, current_class_stack_size); + local_classes = VEC_alloc (tree, gc, 8); + sizeof_biggest_empty_class = size_zero_node; ridpointers[(int) RID_PUBLIC] = access_public_node; ridpointers[(int) RID_PRIVATE] = access_private_node; ridpointers[(int) RID_PROTECTED] = access_protected_node; } +/* Restore the cached PREVIOUS_CLASS_LEVEL. */ + +static void +restore_class_cache (void) +{ + tree type; + + /* We are re-entering the same class we just left, so we don't + have to search the whole inheritance matrix to find all the + decls to bind again. Instead, we install the cached + class_shadowed list and walk through it binding names. */ + push_binding_level (previous_class_level); + class_binding_level = previous_class_level; + /* Restore IDENTIFIER_TYPE_VALUE. */ + for (type = class_binding_level->type_shadowed; + type; + type = TREE_CHAIN (type)) + SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (type), TREE_TYPE (type)); +} + /* Set global variables CURRENT_CLASS_NAME and CURRENT_CLASS_TYPE as appropriate for TYPE. @@ -5442,33 +5449,31 @@ init_class_processing (void) nodes of local TYPE_DECLs in the TREE_TYPE field of the name. For multiple inheritance, we perform a two-pass depth-first search - of the type lattice. The first pass performs a pre-order search, - marking types after the type has had its fields installed in - the appropriate IDENTIFIER_CLASS_VALUE slot. The second pass merely - unmarks the marked types. If a field or member function name - appears in an ambiguous way, the IDENTIFIER_CLASS_VALUE of - that name becomes `error_mark_node'. */ + of the type lattice. */ void pushclass (tree type) { + class_stack_node_t csn; + type = TYPE_MAIN_VARIANT (type); /* Make sure there is enough room for the new entry on the stack. */ - if (current_class_depth + 1 >= current_class_stack_size) + if (current_class_depth + 1 >= current_class_stack_size) { current_class_stack_size *= 2; current_class_stack - = xrealloc (current_class_stack, - current_class_stack_size - * sizeof (struct class_stack_node)); + = XRESIZEVEC (struct class_stack_node, current_class_stack, + current_class_stack_size); } /* Insert a new entry on the class stack. */ - current_class_stack[current_class_depth].name = current_class_name; - current_class_stack[current_class_depth].type = current_class_type; - current_class_stack[current_class_depth].access = current_access_specifier; - current_class_stack[current_class_depth].names_used = 0; + csn = current_class_stack + current_class_depth; + csn->name = current_class_name; + csn->type = current_class_type; + csn->access = current_access_specifier; + csn->names_used = 0; + csn->hidden = 0; current_class_depth++; /* Now set up the new type. */ @@ -5479,85 +5484,36 @@ pushclass (tree type) /* By default, things in classes are private, while things in structures or unions are public. */ - current_access_specifier = (CLASSTYPE_DECLARED_CLASS (type) - ? access_private_node + current_access_specifier = (CLASSTYPE_DECLARED_CLASS (type) + ? access_private_node : access_public_node); - if (previous_class_type != NULL_TREE - && (type != previous_class_type - || !COMPLETE_TYPE_P (previous_class_type)) + if (previous_class_level + && type != previous_class_level->this_entity && current_class_depth == 1) { /* Forcibly remove any old class remnants. */ invalidate_class_lookup_cache (); } - /* If we're about to enter a nested class, clear - IDENTIFIER_CLASS_VALUE for the enclosing classes. */ - if (current_class_depth > 1) - clear_identifier_class_values (); - - pushlevel_class (); - - if (type != previous_class_type || current_class_depth > 1) - { - push_class_decls (type); - if (CLASSTYPE_TEMPLATE_INFO (type) && !CLASSTYPE_USE_TEMPLATE (type)) - { - /* If we are entering the scope of a template declaration (not a - specialization), we need to push all the using decls with - dependent scope too. */ - tree fields; - - for (fields = TYPE_FIELDS (type); - fields; fields = TREE_CHAIN (fields)) - if (TREE_CODE (fields) == USING_DECL && !TREE_TYPE (fields)) - pushdecl_class_level (fields); - } - } + if (!previous_class_level + || type != previous_class_level->this_entity + || current_class_depth > 1) + pushlevel_class (); else - { - tree item; - - /* We are re-entering the same class we just left, so we don't - have to search the whole inheritance matrix to find all the - decls to bind again. Instead, we install the cached - class_shadowed list, and walk through it binding names and - setting up IDENTIFIER_TYPE_VALUEs. */ - set_class_shadows (previous_class_values); - for (item = previous_class_values; item; item = TREE_CHAIN (item)) - { - tree id = TREE_PURPOSE (item); - tree decl = TREE_TYPE (item); - - push_class_binding (id, decl); - if (TREE_CODE (decl) == TYPE_DECL) - set_identifier_type_value (id, decl); - } - unuse_fields (type); - } - - cxx_remember_type_decls (CLASSTYPE_NESTED_UTDS (type)); + restore_class_cache (); } -/* When we exit a toplevel class scope, we save the - IDENTIFIER_CLASS_VALUEs so that we can restore them quickly if we - reenter the class. Here, we've entered some other class, so we - must invalidate our cache. */ +/* When we exit a toplevel class scope, we save its binding level so + that we can restore it quickly. Here, we've entered some other + class, so we must invalidate our cache. */ void invalidate_class_lookup_cache (void) { - tree t; - - /* The IDENTIFIER_CLASS_VALUEs are no longer valid. */ - for (t = previous_class_values; t; t = TREE_CHAIN (t)) - IDENTIFIER_CLASS_VALUE (TREE_PURPOSE (t)) = NULL_TREE; - - previous_class_values = NULL_TREE; - previous_class_type = NULL_TREE; + previous_class_level = NULL; } - + /* Get out of the current class scope. If we were in a class scope previously, that is the one popped to. */ @@ -5565,7 +5521,6 @@ void popclass (void) { poplevel_class (); - pop_class_decls (); current_class_depth--; current_class_name = current_class_stack[current_class_depth].name; @@ -5575,21 +5530,51 @@ popclass (void) splay_tree_delete (current_class_stack[current_class_depth].names_used); } -/* Returns 1 if current_class_type is either T or a nested type of T. - We start looking from 1 because entry 0 is from global scope, and has - no type. */ +/* Mark the top of the class stack as hidden. */ -int +void +push_class_stack (void) +{ + if (current_class_depth) + ++current_class_stack[current_class_depth - 1].hidden; +} + +/* Mark the top of the class stack as un-hidden. */ + +void +pop_class_stack (void) +{ + if (current_class_depth) + --current_class_stack[current_class_depth - 1].hidden; +} + +/* Returns 1 if the class type currently being defined is either T or + a nested type of T. */ + +bool currently_open_class (tree t) { int i; - if (current_class_type && same_type_p (t, current_class_type)) - return 1; - for (i = 1; i < current_class_depth; ++i) - if (current_class_stack[i].type - && same_type_p (current_class_stack [i].type, t)) - return 1; - return 0; + + /* We start looking from 1 because entry 0 is from global scope, + and has no type. */ + for (i = current_class_depth; i > 0; --i) + { + tree c; + if (i == current_class_depth) + c = current_class_type; + else + { + if (current_class_stack[i].hidden) + break; + c = current_class_stack[i].type; + } + if (!c) + continue; + if (same_type_p (c, t)) + return true; + } + return false; } /* If either current_class_type or one of its enclosing classes are derived @@ -5612,8 +5597,12 @@ currently_open_derived_class (tree t) return current_class_type; for (i = current_class_depth - 1; i > 0; --i) - if (DERIVED_FROM_P (t, current_class_stack[i].type)) - return current_class_stack[i].type; + { + if (current_class_stack[i].hidden) + break; + if (DERIVED_FROM_P (t, current_class_stack[i].type)) + return current_class_stack[i].type; + } return NULL_TREE; } @@ -5630,14 +5619,14 @@ push_nested_class (tree type) tree context; /* A namespace might be passed in error cases, like A::B:C. */ - if (type == NULL_TREE - || type == error_mark_node + if (type == NULL_TREE + || type == error_mark_node || TREE_CODE (type) == NAMESPACE_DECL || ! IS_AGGR_TYPE (type) || TREE_CODE (type) == TEMPLATE_TYPE_PARM || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) return; - + context = DECL_CONTEXT (TYPE_MAIN_DECL (type)); if (context && CLASS_TYPE_P (context)) @@ -5662,7 +5651,7 @@ pop_nested_class (void) int current_lang_depth (void) { - return VARRAY_ACTIVE_SIZE (current_lang_base); + return VEC_length (tree, current_lang_base); } /* Set global variables CURRENT_LANG_NAME to appropriate value @@ -5671,7 +5660,7 @@ current_lang_depth (void) void push_lang_context (tree name) { - VARRAY_PUSH_TREE (current_lang_base, current_lang_name); + VEC_safe_push (tree, gc, current_lang_base, current_lang_name); if (name == lang_name_cplusplus) { @@ -5698,37 +5687,39 @@ push_lang_context (tree name) current_lang_name = name; } else - error ("language string `\"%s\"' not recognized", IDENTIFIER_POINTER (name)); + error ("language string %<\"%E\"%> not recognized", name); } - + /* Get out of the current language scope. */ void pop_lang_context (void) { - current_lang_name = VARRAY_TOP_TREE (current_lang_base); - VARRAY_POP (current_lang_base); + current_lang_name = VEC_pop (tree, current_lang_base); } /* Type instantiation routines. */ /* Given an OVERLOAD and a TARGET_TYPE, return the function that matches the TARGET_TYPE. If there is no satisfactory match, return - error_mark_node, and issue a error & warning messages under control - of FLAGS. Permit pointers to member function if FLAGS permits. If - TEMPLATE_ONLY, the name of the overloaded function was a - template-id, and EXPLICIT_TARGS are the explicitly provided - template arguments. */ + error_mark_node, and issue an error & warning messages under + control of FLAGS. Permit pointers to member function if FLAGS + permits. If TEMPLATE_ONLY, the name of the overloaded function was + a template-id, and EXPLICIT_TARGS are the explicitly provided + template arguments. If OVERLOAD is for one or more member + functions, then ACCESS_PATH is the base path used to reference + those member functions. */ static tree -resolve_address_of_overloaded_function (tree target_type, +resolve_address_of_overloaded_function (tree target_type, tree overload, tsubst_flags_t flags, bool template_only, - tree explicit_targs) + tree explicit_targs, + tree access_path) { /* Here's what the standard says: - + [over.over] If the name is a function template, template argument deduction @@ -5764,12 +5755,11 @@ resolve_address_of_overloaded_function (tree target_type, /* By the time we get here, we should be seeing only real pointer-to-member types, not the internal POINTER_TYPE to METHOD_TYPE representation. */ - my_friendly_assert (!(TREE_CODE (target_type) == POINTER_TYPE - && (TREE_CODE (TREE_TYPE (target_type)) - == METHOD_TYPE)), 0); + gcc_assert (TREE_CODE (target_type) != POINTER_TYPE + || TREE_CODE (TREE_TYPE (target_type)) != METHOD_TYPE); + + gcc_assert (is_overloaded_fn (overload)); - my_friendly_assert (is_overloaded_fn (overload), 20030910); - /* Check that the TARGET_TYPE is reasonable. */ if (TYPE_PTRFN_P (target_type)) /* This is OK. */; @@ -5783,15 +5773,15 @@ resolve_address_of_overloaded_function (tree target_type, target_type = build_reference_type (target_type); is_reference = 1; } - else + else { if (flags & tf_error) - error ("\ -cannot resolve overloaded function `%D' based on conversion to type `%T'", - DECL_NAME (OVL_FUNCTION (overload)), target_type); + error ("cannot resolve overloaded function %qD based on" + " conversion to type %qT", + DECL_NAME (OVL_FUNCTION (overload)), target_type); return error_mark_node; } - + /* If we can find a non-template function that matches, we can just use it. There's no point in generating template instantiations if we're just going to throw them out anyhow. But, of course, we @@ -5815,7 +5805,8 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", one, or vice versa. */ continue; - /* Ignore anticipated decls of undeclared builtins. */ + /* Ignore functions which haven't been explicitly + declared. */ if (DECL_ANTICIPATED (fn)) continue; @@ -5826,7 +5817,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", else if (!is_reference) fntype = build_pointer_type (fntype); - if (can_convert_arg (target_type, fntype, fn)) + if (can_convert_arg (target_type, fntype, fn, LOOKUP_NORMAL)) matches = tree_cons (fn, NULL_TREE, matches); } } @@ -5834,7 +5825,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", /* Now, if we've already got a match (or matches), there's no need to proceed to the template functions. But, if we don't have a match we need to look at them, too. */ - if (!matches) + if (!matches) { tree target_fn_type; tree target_arg_types; @@ -5852,7 +5843,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", /* Never do unification on the 'this' parameter. */ if (TREE_CODE (target_fn_type) == METHOD_TYPE) target_arg_types = TREE_CHAIN (target_arg_types); - + for (fns = overload; fns; fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); @@ -5874,7 +5865,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", targs = make_tree_vec (DECL_NTPARMS (fn)); if (fn_type_unification (fn, explicit_targs, targs, target_arg_types, target_ret_type, - DEDUCE_EXACT, -1) != 0) + DEDUCE_EXACT, LOOKUP_NORMAL)) /* Argument deduction failed. */ continue; @@ -5887,11 +5878,12 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", /* See if there's a match. */ instantiation_type = TREE_TYPE (instantiation); if (is_ptrmem) - instantiation_type = + instantiation_type = build_ptrmemfunc_type (build_pointer_type (instantiation_type)); else if (!is_reference) instantiation_type = build_pointer_type (instantiation_type); - if (can_convert_arg (target_type, instantiation_type, instantiation)) + if (can_convert_arg (target_type, instantiation_type, instantiation, + LOOKUP_NORMAL)) matches = tree_cons (instantiation, fn, matches); } @@ -5901,7 +5893,9 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", tree match = most_specialized_instantiation (matches); if (match != error_mark_node) - matches = tree_cons (match, NULL_TREE, NULL_TREE); + matches = tree_cons (TREE_PURPOSE (match), + NULL_TREE, + NULL_TREE); } } @@ -5911,17 +5905,17 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", /* There were *no* matches. */ if (flags & tf_error) { - error ("no matches converting function `%D' to type `%#T'", - DECL_NAME (OVL_FUNCTION (overload)), - target_type); + error ("no matches converting function %qD to type %q#T", + DECL_NAME (OVL_FUNCTION (overload)), + target_type); /* print_candidates expects a chain with the functions in - TREE_VALUE slots, so we cons one up here (we're losing anyway, - so why be clever?). */ - for (; overload; overload = OVL_NEXT (overload)) - matches = tree_cons (NULL_TREE, OVL_CURRENT (overload), + TREE_VALUE slots, so we cons one up here (we're losing anyway, + so why be clever?). */ + for (; overload; overload = OVL_NEXT (overload)) + matches = tree_cons (NULL_TREE, OVL_CURRENT (overload), matches); - + print_candidates (matches); } return error_mark_node; @@ -5934,7 +5928,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", { tree match; - error ("converting overloaded function `%D' to type `%#T' is ambiguous", + error ("converting overloaded function %qD to type %q#T is ambiguous", DECL_NAME (OVL_FUNCTION (overload)), target_type); @@ -5945,7 +5939,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", print_candidates (matches); } - + return error_mark_node; } @@ -5956,16 +5950,16 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", && !(flags & tf_ptrmem_ok) && !flag_ms_extensions) { static int explained; - - if (!(flags & tf_error)) - return error_mark_node; - pedwarn ("assuming pointer to member `%D'", fn); + if (!(flags & tf_error)) + return error_mark_node; + + pedwarn ("assuming pointer to member %qD", fn); if (!explained) - { - pedwarn ("(a pointer to member can only be formed with `&%E')", fn); - explained = 1; - } + { + pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn); + explained = 1; + } } /* If we're doing overload resolution purely for the purpose of @@ -5973,7 +5967,17 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", function used. If this conversion sequence is selected, the function will be marked as used at this point. */ if (!(flags & tf_conv)) - mark_used (fn); + { + mark_used (fn); + /* We could not check access when this expression was originally + created since we did not know at that time to which function + the expression referred. */ + if (DECL_FUNCTION_MEMBER_P (fn)) + { + gcc_assert (access_path); + perform_or_defer_access_check (access_path, fn, fn); + } + } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) return build_unary_op (ADDR_EXPR, fn, 0); @@ -5994,7 +5998,7 @@ cannot resolve overloaded function `%D' based on conversion to type `%T'", we complain on errors. If we are not complaining, never modify rhs, as overload resolution wants to try many possible instantiations, in the hope that at least one will work. - + For non-recursive calls, LHSTYPE should be a function, pointer to function, or a pointer to member function. */ @@ -6002,9 +6006,10 @@ tree instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { tsubst_flags_t flags_in = flags; - + tree access_path = NULL_TREE; + flags &= ~tf_ptrmem_ok; - + if (TREE_CODE (lhstype) == UNKNOWN_TYPE) { if (flags & tf_error) @@ -6016,7 +6021,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { if (same_type_p (lhstype, TREE_TYPE (rhs))) return rhs; - if (flag_ms_extensions + if (flag_ms_extensions && TYPE_PTRMEMFUNC_P (lhstype) && !TYPE_PTRMEMFUNC_P (TREE_TYPE (rhs))) /* Microsoft allows `A::f' to be resolved to a @@ -6025,14 +6030,33 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) else { if (flags & tf_error) - error ("argument of type `%T' does not match `%T'", + error ("argument of type %qT does not match %qT", TREE_TYPE (rhs), lhstype); return error_mark_node; } } if (TREE_CODE (rhs) == BASELINK) - rhs = BASELINK_FUNCTIONS (rhs); + { + access_path = BASELINK_ACCESS_BINFO (rhs); + rhs = BASELINK_FUNCTIONS (rhs); + } + + /* If we are in a template, and have a NON_DEPENDENT_EXPR, we cannot + deduce any type information. */ + if (TREE_CODE (rhs) == NON_DEPENDENT_EXPR) + { + if (flags & tf_error) + error ("not enough type information"); + return error_mark_node; + } + + /* There only a few kinds of expressions that may have a type + dependent on overload resolution. */ + gcc_assert (TREE_CODE (rhs) == ADDR_EXPR + || TREE_CODE (rhs) == COMPONENT_REF + || TREE_CODE (rhs) == COMPOUND_EXPR + || really_overloaded_fn (rhs)); /* We don't overwrite rhs if it is an overloaded function. Copying it would destroy the tree link. */ @@ -6046,54 +6070,27 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) switch (TREE_CODE (rhs)) { - case TYPE_EXPR: - case CONVERT_EXPR: - case SAVE_EXPR: - case CONSTRUCTOR: - case BUFFER_REF: - abort (); - return error_mark_node; - - case INDIRECT_REF: - case ARRAY_REF: - { - tree new_rhs; - - new_rhs = instantiate_type (build_pointer_type (lhstype), - TREE_OPERAND (rhs, 0), flags); - if (new_rhs == error_mark_node) - return error_mark_node; - - TREE_TYPE (rhs) = lhstype; - TREE_OPERAND (rhs, 0) = new_rhs; - return rhs; - } - - case NOP_EXPR: - rhs = copy_node (TREE_OPERAND (rhs, 0)); - TREE_TYPE (rhs) = unknown_type_node; - return instantiate_type (lhstype, rhs, flags); - case COMPONENT_REF: { - tree addr = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags); + tree member = TREE_OPERAND (rhs, 1); - if (addr != error_mark_node + member = instantiate_type (lhstype, member, flags); + if (member != error_mark_node && TREE_SIDE_EFFECTS (TREE_OPERAND (rhs, 0))) /* Do not lose object's side effects. */ - addr = build (COMPOUND_EXPR, TREE_TYPE (addr), - TREE_OPERAND (rhs, 0), addr); - return addr; + return build2 (COMPOUND_EXPR, TREE_TYPE (member), + TREE_OPERAND (rhs, 0), member); + return member; } case OFFSET_REF: rhs = TREE_OPERAND (rhs, 1); if (BASELINK_P (rhs)) - return instantiate_type (lhstype, BASELINK_FUNCTIONS (rhs), flags_in); + return instantiate_type (lhstype, rhs, flags_in); /* This can happen if we are forming a pointer-to-member for a member template. */ - my_friendly_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR, 0); + gcc_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR); /* Fall through. */ @@ -6105,29 +6102,17 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) return resolve_address_of_overloaded_function (lhstype, fns, flags_in, /*template_only=*/true, - args); + args, access_path); } case OVERLOAD: case FUNCTION_DECL: - return + return resolve_address_of_overloaded_function (lhstype, rhs, flags_in, /*template_only=*/false, - /*explicit_targs=*/NULL_TREE); + /*explicit_targs=*/NULL_TREE, + access_path); - case TREE_LIST: - /* Now we should have a baselink. */ - my_friendly_assert (BASELINK_P (rhs), 990412); - - return instantiate_type (lhstype, BASELINK_FUNCTIONS (rhs), flags); - - case CALL_EXPR: - /* This is too hard for now. */ - abort (); - return error_mark_node; - - case PLUS_EXPR: - case MINUS_EXPR: case COMPOUND_EXPR: TREE_OPERAND (rhs, 0) = instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags); @@ -6141,104 +6126,21 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) TREE_TYPE (rhs) = lhstype; return rhs; - case MULT_EXPR: - case TRUNC_DIV_EXPR: - case FLOOR_DIV_EXPR: - case CEIL_DIV_EXPR: - case ROUND_DIV_EXPR: - case RDIV_EXPR: - case TRUNC_MOD_EXPR: - case FLOOR_MOD_EXPR: - case CEIL_MOD_EXPR: - case ROUND_MOD_EXPR: - case FIX_ROUND_EXPR: - case FIX_FLOOR_EXPR: - case FIX_CEIL_EXPR: - case FIX_TRUNC_EXPR: - case FLOAT_EXPR: - case NEGATE_EXPR: - case ABS_EXPR: - case MAX_EXPR: - case MIN_EXPR: - - case BIT_AND_EXPR: - case BIT_IOR_EXPR: - case BIT_XOR_EXPR: - case LSHIFT_EXPR: - case RSHIFT_EXPR: - case LROTATE_EXPR: - case RROTATE_EXPR: - - case PREINCREMENT_EXPR: - case PREDECREMENT_EXPR: - case POSTINCREMENT_EXPR: - case POSTDECREMENT_EXPR: - if (flags & tf_error) - error ("invalid operation on uninstantiated type"); - return error_mark_node; - - case TRUTH_AND_EXPR: - case TRUTH_OR_EXPR: - case TRUTH_XOR_EXPR: - case LT_EXPR: - case LE_EXPR: - case GT_EXPR: - case GE_EXPR: - case EQ_EXPR: - case NE_EXPR: - case TRUTH_ANDIF_EXPR: - case TRUTH_ORIF_EXPR: - case TRUTH_NOT_EXPR: - if (flags & tf_error) - error ("not enough type information"); - return error_mark_node; - - case COND_EXPR: - if (type_unknown_p (TREE_OPERAND (rhs, 0))) - { - if (flags & tf_error) - error ("not enough type information"); - return error_mark_node; - } - TREE_OPERAND (rhs, 1) - = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags); - if (TREE_OPERAND (rhs, 1) == error_mark_node) - return error_mark_node; - TREE_OPERAND (rhs, 2) - = instantiate_type (lhstype, TREE_OPERAND (rhs, 2), flags); - if (TREE_OPERAND (rhs, 2) == error_mark_node) - return error_mark_node; - - TREE_TYPE (rhs) = lhstype; - return rhs; - - case MODIFY_EXPR: - TREE_OPERAND (rhs, 1) - = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags); - if (TREE_OPERAND (rhs, 1) == error_mark_node) - return error_mark_node; - - TREE_TYPE (rhs) = lhstype; - return rhs; - case ADDR_EXPR: { if (PTRMEM_OK_P (rhs)) - flags |= tf_ptrmem_ok; - + flags |= tf_ptrmem_ok; + return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags); } - case ENTRY_VALUE_EXPR: - abort (); - return error_mark_node; case ERROR_MARK: return error_mark_node; default: - abort (); - return error_mark_node; + gcc_unreachable (); } + return error_mark_node; } /* Return the name of the virtual function pointer field @@ -6250,16 +6152,23 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) static tree get_vfield_name (tree type) { - tree binfo = TYPE_BINFO (type); + tree binfo, base_binfo; char *buf; - while (BINFO_BASETYPES (binfo) - && TYPE_CONTAINS_VPTR_P (BINFO_TYPE (BINFO_BASETYPE (binfo, 0))) - && ! TREE_VIA_VIRTUAL (BINFO_BASETYPE (binfo, 0))) - binfo = BINFO_BASETYPE (binfo, 0); + for (binfo = TYPE_BINFO (type); + BINFO_N_BASE_BINFOS (binfo); + binfo = base_binfo) + { + base_binfo = BINFO_BASE_BINFO (binfo, 0); + + if (BINFO_VIRTUAL_P (base_binfo) + || !TYPE_CONTAINS_VPTR_P (BINFO_TYPE (base_binfo))) + break; + } type = BINFO_TYPE (binfo); - buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2); + buf = (char *) alloca (sizeof (VFIELD_NAME_FORMAT) + + TYPE_NAME_LENGTH (type) + 2); sprintf (buf, VFIELD_NAME_FORMAT, IDENTIFIER_POINTER (constructor_name (type))); return get_identifier (buf); @@ -6283,7 +6192,7 @@ print_class_statistics (void) /* Build a dummy reference to ourselves so Derived::Base (and A::A) works, according to [class]: - The class-name is also inserted + The class-name is also inserted into the scope of the class itself. For purposes of access checking, the inserted class name is treated as if it were a public member name. */ @@ -6337,10 +6246,13 @@ contains_empty_class_p (tree type) if (CLASS_TYPE_P (type)) { tree field; + tree binfo; + tree base_binfo; int i; - for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); ++i) - if (contains_empty_class_p (TYPE_BINFO_BASETYPE (type, i))) + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) + if (contains_empty_class_p (BINFO_TYPE (base_binfo))) return true; for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL @@ -6353,35 +6265,6 @@ contains_empty_class_p (tree type) return false; } -/* Find the enclosing class of the given NODE. NODE can be a *_DECL or - a *_TYPE node. NODE can also be a local class. */ - -tree -get_enclosing_class (tree type) -{ - tree node = type; - - while (node && TREE_CODE (node) != NAMESPACE_DECL) - { - switch (TREE_CODE_CLASS (TREE_CODE (node))) - { - case 'd': - node = DECL_CONTEXT (node); - break; - - case 't': - if (node != type) - return node; - node = TYPE_CONTEXT (node); - break; - - default: - abort (); - } - } - return NULL_TREE; -} - /* Note that NAME was looked up while the current class was being defined and that the result of that lookup was DECL. */ @@ -6391,12 +6274,14 @@ maybe_note_name_used_in_class (tree name, tree decl) splay_tree names_used; /* If we're not defining a class, there's nothing to do. */ - if (innermost_scope_kind() != sk_class) + if (!(innermost_scope_kind() == sk_class + && TYPE_BEING_DEFINED (current_class_type))) return; - + /* If there's already a binding for this NAME, then we don't have anything to worry about. */ - if (IDENTIFIER_CLASS_VALUE (name)) + if (lookup_member (current_class_type, name, + /*protect=*/0, /*want_type=*/false)) return; if (!current_class_stack[current_class_depth - 1].names_used) @@ -6405,7 +6290,7 @@ maybe_note_name_used_in_class (tree name, tree decl) names_used = current_class_stack[current_class_depth - 1].names_used; splay_tree_insert (names_used, - (splay_tree_key) name, + (splay_tree_key) name, (splay_tree_value) decl); } @@ -6419,7 +6304,7 @@ note_name_declared_in_class (tree name, tree decl) splay_tree_node n; /* Look to see if we ever used this name. */ - names_used + names_used = current_class_stack[current_class_depth - 1].names_used; if (!names_used) return; @@ -6428,14 +6313,13 @@ note_name_declared_in_class (tree name, tree decl) if (n) { /* [basic.scope.class] - + A name N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. */ - error ("declaration of `%#D'", decl); - cp_error_at ("changes meaning of `%D' from `%+#D'", - DECL_NAME (OVL_CURRENT (decl)), - (tree) n->value); + error ("declaration of %q#D", decl); + error ("changes meaning of %qD from %q+#D", + DECL_NAME (OVL_CURRENT (decl)), (tree) n->value); } } @@ -6451,12 +6335,11 @@ get_vtbl_decl_for_binfo (tree binfo) decl = BINFO_VTABLE (binfo); if (decl && TREE_CODE (decl) == PLUS_EXPR) { - my_friendly_assert (TREE_CODE (TREE_OPERAND (decl, 0)) == ADDR_EXPR, - 2000403); + gcc_assert (TREE_CODE (TREE_OPERAND (decl, 0)) == ADDR_EXPR); decl = TREE_OPERAND (TREE_OPERAND (decl, 0), 0); } if (decl) - my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 20000403); + gcc_assert (TREE_CODE (decl) == VAR_DECL); return decl; } @@ -6467,18 +6350,16 @@ get_vtbl_decl_for_binfo (tree binfo) BINFO in the complete object. Check BINFO_PRIMARY_P or BINFO_LOST_PRIMARY_P to be sure. */ -tree +static tree get_primary_binfo (tree binfo) { tree primary_base; - tree result; - + primary_base = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (binfo)); if (!primary_base) return NULL_TREE; - result = copied_binfo (primary_base, binfo); - return result; + return copied_binfo (primary_base, binfo); } /* If INDENTED_P is zero, indent to INDENT. Return nonzero. */ @@ -6498,17 +6379,18 @@ maybe_indent_hierarchy (FILE * stream, int indent, int indented_p) static tree dump_class_hierarchy_r (FILE *stream, - int flags, - tree binfo, - tree igo, - int indent) + int flags, + tree binfo, + tree igo, + int indent) { int indented = 0; - tree base_binfos; - + tree base_binfo; + int i; + indented = maybe_indent_hierarchy (stream, indent, 0); fprintf (stream, "%s (0x%lx) ", - type_as_string (binfo, TFF_PLAIN_IDENTIFIER), + type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER), (unsigned long) binfo); if (binfo != igo) { @@ -6516,25 +6398,25 @@ dump_class_hierarchy_r (FILE *stream, return igo; } igo = TREE_CHAIN (binfo); - + fprintf (stream, HOST_WIDE_INT_PRINT_DEC, tree_low_cst (BINFO_OFFSET (binfo), 0)); if (is_empty_class (BINFO_TYPE (binfo))) fprintf (stream, " empty"); else if (CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (binfo))) fprintf (stream, " nearly-empty"); - if (TREE_VIA_VIRTUAL (binfo)) + if (BINFO_VIRTUAL_P (binfo)) fprintf (stream, " virtual"); fprintf (stream, "\n"); indented = 0; - if (BINFO_PRIMARY_BASE_OF (binfo)) + if (BINFO_PRIMARY_P (binfo)) { indented = maybe_indent_hierarchy (stream, indent + 3, indented); fprintf (stream, " primary-for %s (0x%lx)", - type_as_string (BINFO_PRIMARY_BASE_OF (binfo), + type_as_string (BINFO_TYPE (BINFO_INHERITANCE_CHAIN (binfo)), TFF_PLAIN_IDENTIFIER), - (unsigned long)BINFO_PRIMARY_BASE_OF (binfo)); + (unsigned long)BINFO_INHERITANCE_CHAIN (binfo)); } if (BINFO_LOST_PRIMARY_P (binfo)) { @@ -6547,7 +6429,7 @@ dump_class_hierarchy_r (FILE *stream, if (!(flags & TDF_SLIM)) { int indented = 0; - + if (BINFO_SUBVTT_INDEX (binfo)) { indented = maybe_indent_hierarchy (stream, indent + 3, indented); @@ -6576,26 +6458,14 @@ dump_class_hierarchy_r (FILE *stream, expr_as_string (BINFO_VTABLE (binfo), TFF_PLAIN_IDENTIFIER)); } - + if (indented) fprintf (stream, "\n"); } - - base_binfos = BINFO_BASETYPES (binfo); - if (base_binfos) - { - int ix, n; - n = TREE_VEC_LENGTH (base_binfos); - for (ix = 0; ix != n; ix++) - { - tree base_binfo = TREE_VEC_ELT (base_binfos, ix); + for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + igo = dump_class_hierarchy_r (stream, flags, base_binfo, igo, indent + 2); - igo = dump_class_hierarchy_r (stream, flags, base_binfo, - igo, indent + 2); - } - } - return igo; } @@ -6619,7 +6489,7 @@ dump_class_hierarchy_1 (FILE *stream, int flags, tree t) /* Debug interface to hierarchy dumping. */ -extern void +void debug_class (tree t) { dump_class_hierarchy_1 (stderr, TDF_SLIM, t); @@ -6641,8 +6511,8 @@ dump_class_hierarchy (tree t) static void dump_array (FILE * stream, tree decl) { - tree inits; - int ix; + tree value; + unsigned HOST_WIDE_INT ix; HOST_WIDE_INT elt; tree size = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (decl))); @@ -6654,10 +6524,10 @@ dump_array (FILE * stream, tree decl) TFF_PLAIN_IDENTIFIER)); fprintf (stream, "\n"); - for (ix = 0, inits = CONSTRUCTOR_ELTS (DECL_INITIAL (decl)); - inits; ix++, inits = TREE_CHAIN (inits)) + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)), + ix, value) fprintf (stream, "%-4ld %s\n", (long)(ix * elt), - expr_as_string (TREE_VALUE (inits), TFF_PLAIN_IDENTIFIER)); + expr_as_string (value, TFF_PLAIN_IDENTIFIER)); } static void @@ -6672,13 +6542,13 @@ dump_vtable (tree t, tree binfo, tree vtable) if (!(flags & TDF_SLIM)) { int ctor_vtbl_p = TYPE_BINFO (t) != binfo; - + fprintf (stream, "%s for %s", ctor_vtbl_p ? "Construction vtable" : "Vtable", - type_as_string (binfo, TFF_PLAIN_IDENTIFIER)); + type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER)); if (ctor_vtbl_p) { - if (!TREE_VIA_VIRTUAL (binfo)) + if (!BINFO_VIRTUAL_P (binfo)) fprintf (stream, " (0x%lx instance)", (unsigned long)binfo); fprintf (stream, " in %s", type_as_string (t, TFF_PLAIN_IDENTIFIER)); } @@ -6686,7 +6556,7 @@ dump_vtable (tree t, tree binfo, tree vtable) dump_array (stream, vtable); fprintf (stream, "\n"); } - + dump_end (TDI_class, stream); } @@ -6706,7 +6576,7 @@ dump_vtt (tree t, tree vtt) dump_array (stream, vtt); fprintf (stream, "\n"); } - + dump_end (TDI_class, stream); } @@ -6718,7 +6588,7 @@ dump_thunk (FILE *stream, int indent, tree thunk) static const char spaces[] = " "; tree name = DECL_NAME (thunk); tree thunks; - + fprintf (stream, "%.*s%p %s %s", indent, spaces, (void *)thunk, !DECL_THUNK_P (thunk) ? "function" @@ -6749,7 +6619,7 @@ dump_thunk (FILE *stream, int indent, tree thunk) /* Dump the thunks for FN. */ -extern void +void debug_thunks (tree fn) { dump_thunk (stderr, 0, fn); @@ -6768,19 +6638,19 @@ finish_vtbls (tree t) /* We lay out the primary and secondary vtables in one contiguous vtable. The primary vtable is first, followed by the non-virtual secondary vtables in inheritance graph order. */ - list = build_tree_list (TYPE_BINFO_VTABLE (t), NULL_TREE); + list = build_tree_list (BINFO_VTABLE (TYPE_BINFO (t)), NULL_TREE); accumulate_vtbl_inits (TYPE_BINFO (t), TYPE_BINFO (t), TYPE_BINFO (t), t, list); - + /* Then come the virtual bases, also in inheritance graph order. */ for (vbase = TYPE_BINFO (t); vbase; vbase = TREE_CHAIN (vbase)) { - if (!TREE_VIA_VIRTUAL (vbase)) + if (!BINFO_VIRTUAL_P (vbase)) continue; accumulate_vtbl_inits (vbase, vbase, TYPE_BINFO (t), t, list); } - if (TYPE_BINFO_VTABLE (t)) + if (BINFO_VTABLE (TYPE_BINFO (t))) initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list)); } @@ -6793,29 +6663,13 @@ initialize_vtable (tree binfo, tree inits) layout_vtable_decl (binfo, list_length (inits)); decl = get_vtbl_decl_for_binfo (binfo); - initialize_array (decl, inits); + initialize_artificial_var (decl, inits); dump_vtable (BINFO_TYPE (binfo), binfo, decl); } -/* Initialize DECL (a declaration for a namespace-scope array) with - the INITS. */ - -static void -initialize_array (tree decl, tree inits) -{ - tree context; - - context = DECL_CONTEXT (decl); - DECL_CONTEXT (decl) = NULL_TREE; - DECL_INITIAL (decl) = build_constructor (NULL_TREE, inits); - TREE_HAS_CONSTRUCTOR (DECL_INITIAL (decl)) = 1; - cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0); - DECL_CONTEXT (decl) = context; -} - /* Build the VTT (virtual table table) for T. A class requires a VTT if it has virtual bases. - + This holds 1 - primary virtual pointer for complete object T 2 - secondary VTTs for each direct non-virtual base of T which requires a @@ -6823,7 +6677,7 @@ initialize_array (tree decl, tree inits) 3 - secondary virtual pointers for each direct or indirect base of T which has virtual bases or is reachable via a virtual path from T. 4 - secondary VTTs for each direct or indirect virtual base of T. - + Secondary VTTs look like complete object VTTs without part 4. */ static void @@ -6846,10 +6700,10 @@ build_vtt (tree t) /* Figure out the type of the VTT. */ type = build_index_type (size_int (list_length (inits) - 1)); type = build_cplus_array_type (const_ptr_type_node, type); - + /* Now, build the VTT object itself. */ - vtt = build_vtable (t, get_vtt_name (t), type); - initialize_array (vtt, inits); + vtt = build_vtable (t, mangle_vtt_for_type (t), type); + initialize_artificial_var (vtt, inits); /* Add the VTT to the vtables list. */ TREE_CHAIN (vtt) = TREE_CHAIN (CLASSTYPE_VTABLES (t)); TREE_CHAIN (CLASSTYPE_VTABLES (t)) = vtt; @@ -6872,7 +6726,7 @@ binfo_ctor_vtable (tree binfo) vt = BINFO_VTABLE (binfo); if (TREE_CODE (vt) == TREE_LIST) vt = TREE_VALUE (vt); - if (TREE_CODE (vt) == TREE_VEC) + if (TREE_CODE (vt) == TREE_BINFO) binfo = vt; else break; @@ -6881,6 +6735,22 @@ binfo_ctor_vtable (tree binfo) return vt; } +/* Data for secondary VTT initialization. */ +typedef struct secondary_vptr_vtt_init_data_s +{ + /* Is this the primary VTT? */ + bool top_level_p; + + /* Current index into the VTT. */ + tree index; + + /* TREE_LIST of initializers built up. */ + tree inits; + + /* The type being constructed by this secondary VTT. */ + tree type_being_constructed; +} secondary_vptr_vtt_init_data; + /* Recursively build the VTT-initializer for BINFO (which is in the hierarchy dominated by T). INITS points to the end of the initializer list to date. INDEX is the VTT index where the next element will be @@ -6890,16 +6760,17 @@ binfo_ctor_vtable (tree binfo) vtables for the BINFO-in-T variant. */ static tree * -build_vtt_inits (tree binfo, tree t, tree* inits, tree* index) +build_vtt_inits (tree binfo, tree t, tree *inits, tree *index) { int i; tree b; tree init; tree secondary_vptrs; - int top_level_p = same_type_p (TREE_TYPE (binfo), t); + secondary_vptr_vtt_init_data data; + int top_level_p = SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t); /* We only need VTTs for subobjects with virtual bases. */ - if (!TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (binfo))) + if (!CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo))) return inits; /* We need to use a construction vtable if this is not the primary @@ -6918,176 +6789,134 @@ build_vtt_inits (tree binfo, tree t, tree* inits, tree* index) inits = &TREE_CHAIN (*inits); if (top_level_p) { - my_friendly_assert (!BINFO_VPTR_INDEX (binfo), 20010129); + gcc_assert (!BINFO_VPTR_INDEX (binfo)); BINFO_VPTR_INDEX (binfo) = *index; } *index = size_binop (PLUS_EXPR, *index, TYPE_SIZE_UNIT (ptr_type_node)); - + /* Recursively add the secondary VTTs for non-virtual bases. */ - for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i) - { - b = BINFO_BASETYPE (binfo, i); - if (!TREE_VIA_VIRTUAL (b)) - inits = build_vtt_inits (BINFO_BASETYPE (binfo, i), t, - inits, index); - } - + for (i = 0; BINFO_BASE_ITERATE (binfo, i, b); ++i) + if (!BINFO_VIRTUAL_P (b)) + inits = build_vtt_inits (b, t, inits, index); + /* Add secondary virtual pointers for all subobjects of BINFO with either virtual bases or reachable along a virtual path, except subobjects that are non-virtual primary bases. */ - secondary_vptrs = tree_cons (t, NULL_TREE, BINFO_TYPE (binfo)); - TREE_TYPE (secondary_vptrs) = *index; - VTT_TOP_LEVEL_P (secondary_vptrs) = top_level_p; - VTT_MARKED_BINFO_P (secondary_vptrs) = 0; - - dfs_walk_real (binfo, - dfs_build_secondary_vptr_vtt_inits, - NULL, - dfs_ctor_vtable_bases_queue_p, - secondary_vptrs); - VTT_MARKED_BINFO_P (secondary_vptrs) = 1; - dfs_walk (binfo, dfs_unmark, dfs_ctor_vtable_bases_queue_p, - secondary_vptrs); + data.top_level_p = top_level_p; + data.index = *index; + data.inits = NULL; + data.type_being_constructed = BINFO_TYPE (binfo); - *index = TREE_TYPE (secondary_vptrs); + dfs_walk_once (binfo, dfs_build_secondary_vptr_vtt_inits, NULL, &data); + + *index = data.index; /* The secondary vptrs come back in reverse order. After we reverse them, and add the INITS, the last init will be the first element of the chain. */ - secondary_vptrs = TREE_VALUE (secondary_vptrs); + secondary_vptrs = data.inits; if (secondary_vptrs) { *inits = nreverse (secondary_vptrs); inits = &TREE_CHAIN (secondary_vptrs); - my_friendly_assert (*inits == NULL_TREE, 20000517); + gcc_assert (*inits == NULL_TREE); } - /* Add the secondary VTTs for virtual bases. */ if (top_level_p) + /* Add the secondary VTTs for virtual bases in inheritance graph + order. */ for (b = TYPE_BINFO (BINFO_TYPE (binfo)); b; b = TREE_CHAIN (b)) { - if (!TREE_VIA_VIRTUAL (b)) + if (!BINFO_VIRTUAL_P (b)) continue; - + inits = build_vtt_inits (b, t, inits, index); } - - if (!top_level_p) - { - tree data = tree_cons (t, binfo, NULL_TREE); - VTT_TOP_LEVEL_P (data) = 0; - VTT_MARKED_BINFO_P (data) = 0; - - dfs_walk (binfo, dfs_fixup_binfo_vtbls, - dfs_ctor_vtable_bases_queue_p, - data); - } + else + /* Remove the ctor vtables we created. */ + dfs_walk_all (binfo, dfs_fixup_binfo_vtbls, NULL, binfo); return inits; } -/* Called from build_vtt_inits via dfs_walk. BINFO is the binfo - for the base in most derived. DATA is a TREE_LIST who's - TREE_CHAIN is the type of the base being - constructed whilst this secondary vptr is live. The TREE_UNSIGNED - flag of DATA indicates that this is a constructor vtable. The - TREE_TOP_LEVEL flag indicates that this is the primary VTT. */ +/* Called from build_vtt_inits via dfs_walk. BINFO is the binfo for the base + in most derived. DATA is a SECONDARY_VPTR_VTT_INIT_DATA structure. */ static tree -dfs_build_secondary_vptr_vtt_inits (tree binfo, void* data) +dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data_) { - tree l; - tree t; - tree init; - tree index; - int top_level_p; - - l = (tree) data; - t = TREE_CHAIN (l); - top_level_p = VTT_TOP_LEVEL_P (l); - - BINFO_MARKED (binfo) = 1; + secondary_vptr_vtt_init_data *data = (secondary_vptr_vtt_init_data *)data_; /* We don't care about bases that don't have vtables. */ if (!TYPE_VFIELD (BINFO_TYPE (binfo))) + return dfs_skip_bases; + + /* We're only interested in proper subobjects of the type being + constructed. */ + if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), data->type_being_constructed)) return NULL_TREE; - /* We're only interested in proper subobjects of T. */ - if (same_type_p (BINFO_TYPE (binfo), t)) - return NULL_TREE; + /* We're only interested in bases with virtual bases or reachable + via a virtual path from the type being constructed. */ + if (!(CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)) + || binfo_via_virtual (binfo, data->type_being_constructed))) + return dfs_skip_bases; /* We're not interested in non-virtual primary bases. */ - if (!TREE_VIA_VIRTUAL (binfo) && BINFO_PRIMARY_P (binfo)) - return NULL_TREE; - - /* If BINFO has virtual bases or is reachable via a virtual path - from T, it'll have a secondary vptr. */ - if (!TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (binfo)) - && !binfo_via_virtual (binfo, t)) + if (!BINFO_VIRTUAL_P (binfo) && BINFO_PRIMARY_P (binfo)) return NULL_TREE; /* Record the index where this secondary vptr can be found. */ - index = TREE_TYPE (l); - if (top_level_p) + if (data->top_level_p) { - my_friendly_assert (!BINFO_VPTR_INDEX (binfo), 20010129); - BINFO_VPTR_INDEX (binfo) = index; + gcc_assert (!BINFO_VPTR_INDEX (binfo)); + BINFO_VPTR_INDEX (binfo) = data->index; + + if (BINFO_VIRTUAL_P (binfo)) + { + /* It's a primary virtual base, and this is not a + construction vtable. Find the base this is primary of in + the inheritance graph, and use that base's vtable + now. */ + while (BINFO_PRIMARY_P (binfo)) + binfo = BINFO_INHERITANCE_CHAIN (binfo); + } } - TREE_TYPE (l) = size_binop (PLUS_EXPR, index, - TYPE_SIZE_UNIT (ptr_type_node)); /* Add the initializer for the secondary vptr itself. */ - if (top_level_p && TREE_VIA_VIRTUAL (binfo)) - { - /* It's a primary virtual base, and this is not the construction - vtable. Find the base this is primary of in the inheritance graph, - and use that base's vtable now. */ - while (BINFO_PRIMARY_BASE_OF (binfo)) - binfo = BINFO_PRIMARY_BASE_OF (binfo); - } - init = binfo_ctor_vtable (binfo); - TREE_VALUE (l) = tree_cons (NULL_TREE, init, TREE_VALUE (l)); + data->inits = tree_cons (NULL_TREE, binfo_ctor_vtable (binfo), data->inits); + + /* Advance the vtt index. */ + data->index = size_binop (PLUS_EXPR, data->index, + TYPE_SIZE_UNIT (ptr_type_node)); return NULL_TREE; } -/* dfs_walk_real predicate for building vtables. DATA is a TREE_LIST, - VTT_MARKED_BINFO_P indicates whether marked or unmarked bases - should be walked. TREE_PURPOSE is the TREE_TYPE that dominates the - hierarchy. */ - -static tree -dfs_ctor_vtable_bases_queue_p (tree derived, int ix, - void* data) -{ - tree binfo = BINFO_BASETYPE (derived, ix); - - if (!BINFO_MARKED (binfo) == VTT_MARKED_BINFO_P ((tree) data)) - return NULL_TREE; - return binfo; -} - -/* Called from build_vtt_inits via dfs_walk. After building constructor - vtables and generating the sub-vtt from them, we need to restore the - BINFO_VTABLES that were scribbled on. DATA is a TREE_LIST whose - TREE_VALUE is the TREE_TYPE of the base whose sub vtt was generated. */ +/* Called from build_vtt_inits via dfs_walk. After building + constructor vtables and generating the sub-vtt from them, we need + to restore the BINFO_VTABLES that were scribbled on. DATA is the + binfo of the base whose sub vtt was generated. */ static tree dfs_fixup_binfo_vtbls (tree binfo, void* data) { - BINFO_MARKED (binfo) = 0; + tree vtable = BINFO_VTABLE (binfo); - /* We don't care about bases that don't have vtables. */ - if (!TYPE_VFIELD (BINFO_TYPE (binfo))) + if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) + /* If this class has no vtable, none of its bases do. */ + return dfs_skip_bases; + + if (!vtable) + /* This might be a primary base, so have no vtable in this + hierarchy. */ return NULL_TREE; /* If we scribbled the construction vtable vptr into BINFO, clear it out now. */ - if (BINFO_VTABLE (binfo) - && TREE_CODE (BINFO_VTABLE (binfo)) == TREE_LIST - && (TREE_PURPOSE (BINFO_VTABLE (binfo)) - == TREE_VALUE ((tree) data))) - BINFO_VTABLE (binfo) = TREE_CHAIN (BINFO_VTABLE (binfo)); + if (TREE_CODE (vtable) == TREE_LIST + && (TREE_PURPOSE (vtable) == (tree) data)) + BINFO_VTABLE (binfo) = TREE_CHAIN (vtable); return NULL_TREE; } @@ -7110,27 +6939,28 @@ build_ctor_vtbl_group (tree binfo, tree t) if (IDENTIFIER_GLOBAL_VALUE (id)) return; - my_friendly_assert (!same_type_p (BINFO_TYPE (binfo), t), 20010124); + gcc_assert (!SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t)); /* Build a version of VTBL (with the wrong type) for use in constructing the addresses of secondary vtables in the construction vtable group. */ vtbl = build_vtable (t, id, ptr_type_node); + DECL_CONSTRUCTION_VTABLE_P (vtbl) = 1; list = build_tree_list (vtbl, NULL_TREE); accumulate_vtbl_inits (binfo, TYPE_BINFO (TREE_TYPE (binfo)), binfo, t, list); /* Add the vtables for each of our virtual bases using the vbase in T binfo. */ - for (vbase = TYPE_BINFO (BINFO_TYPE (binfo)); - vbase; + for (vbase = TYPE_BINFO (BINFO_TYPE (binfo)); + vbase; vbase = TREE_CHAIN (vbase)) { tree b; - if (!TREE_VIA_VIRTUAL (vbase)) + if (!BINFO_VIRTUAL_P (vbase)) continue; b = copied_binfo (vbase, binfo); - + accumulate_vtbl_inits (b, vbase, binfo, t, list); } inits = TREE_VALUE (list); @@ -7142,7 +6972,7 @@ build_ctor_vtbl_group (tree binfo, tree t) /* Initialize the construction vtable. */ CLASSTYPE_VTABLES (t) = chainon (CLASSTYPE_VTABLES (t), vtbl); - initialize_array (vtbl, inits); + initialize_artificial_var (vtbl, inits); dump_vtable (t, binfo, vtbl); } @@ -7158,49 +6988,46 @@ build_ctor_vtbl_group (tree binfo, tree t) static void accumulate_vtbl_inits (tree binfo, - tree orig_binfo, - tree rtti_binfo, - tree t, - tree inits) + tree orig_binfo, + tree rtti_binfo, + tree t, + tree inits) { int i; - int ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t); + tree base_binfo; + int ctor_vtbl_p = !SAME_BINFO_TYPE_P (BINFO_TYPE (rtti_binfo), t); - my_friendly_assert (same_type_p (BINFO_TYPE (binfo), - BINFO_TYPE (orig_binfo)), - 20000517); + gcc_assert (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), BINFO_TYPE (orig_binfo))); /* If it doesn't have a vptr, we don't do anything. */ if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))) return; - + /* If we're building a construction vtable, we're not interested in subobjects that don't require construction vtables. */ - if (ctor_vtbl_p - && !TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (binfo)) + if (ctor_vtbl_p + && !CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo)) && !binfo_via_virtual (orig_binfo, BINFO_TYPE (rtti_binfo))) return; /* Build the initializers for the BINFO-in-T vtable. */ - TREE_VALUE (inits) + TREE_VALUE (inits) = chainon (TREE_VALUE (inits), dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, inits)); - + /* Walk the BINFO and its bases. We walk in preorder so that as we initialize each vtable we can figure out at what offset the secondary vtable lies from the primary vtable. We can't use dfs_walk here because we need to iterate through bases of BINFO and RTTI_BINFO simultaneously. */ - for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i) + for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { - tree base_binfo = BINFO_BASETYPE (binfo, i); - /* Skip virtual bases. */ - if (TREE_VIA_VIRTUAL (base_binfo)) + if (BINFO_VIRTUAL_P (base_binfo)) continue; accumulate_vtbl_inits (base_binfo, - BINFO_BASETYPE (orig_binfo, i), + BINFO_BASE_BINFO (orig_binfo, i), rtti_binfo, t, inits); } @@ -7211,17 +7038,17 @@ accumulate_vtbl_inits (tree binfo, static tree dfs_accumulate_vtbl_inits (tree binfo, - tree orig_binfo, - tree rtti_binfo, - tree t, - tree l) + tree orig_binfo, + tree rtti_binfo, + tree t, + tree l) { tree inits = NULL_TREE; tree vtbl = NULL_TREE; - int ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t); + int ctor_vtbl_p = !SAME_BINFO_TYPE_P (BINFO_TYPE (rtti_binfo), t); if (ctor_vtbl_p - && TREE_VIA_VIRTUAL (orig_binfo) && BINFO_PRIMARY_P (orig_binfo)) + && BINFO_VIRTUAL_P (orig_binfo) && BINFO_PRIMARY_P (orig_binfo)) { /* In the hierarchy of BINFO_TYPE (RTTI_BINFO), this is a primary virtual base. If it is not the same primary in @@ -7230,39 +7057,40 @@ dfs_accumulate_vtbl_inits (tree binfo, primary, we still need a VTT entry for the vtable, but it should point to the ctor vtable for the base it is a primary for within the sub-hierarchy of RTTI_BINFO. - + There are three possible cases: - + 1) We are in the same place. 2) We are a primary base within a lost primary virtual base of RTTI_BINFO. 3) We are primary to something not a base of RTTI_BINFO. */ - - tree b = BINFO_PRIMARY_BASE_OF (binfo); + + tree b; tree last = NULL_TREE; /* First, look through the bases we are primary to for RTTI_BINFO or a virtual base. */ - for (; b; b = BINFO_PRIMARY_BASE_OF (b)) + b = binfo; + while (BINFO_PRIMARY_P (b)) { + b = BINFO_INHERITANCE_CHAIN (b); last = b; - if (TREE_VIA_VIRTUAL (b) || b == rtti_binfo) - break; + if (BINFO_VIRTUAL_P (b) || b == rtti_binfo) + goto found; } /* If we run out of primary links, keep looking down our inheritance chain; we might be an indirect primary. */ - if (b == NULL_TREE) - for (b = last; b; b = BINFO_INHERITANCE_CHAIN (b)) - if (TREE_VIA_VIRTUAL (b) || b == rtti_binfo) - break; + for (b = last; b; b = BINFO_INHERITANCE_CHAIN (b)) + if (BINFO_VIRTUAL_P (b) || b == rtti_binfo) + break; + found: /* If we found RTTI_BINFO, this is case 1. If we found a virtual base B and it is a base of RTTI_BINFO, this is case 2. In either case, we share our vtable with LAST, i.e. the derived-most base within B of which we are a primary. */ if (b == rtti_binfo - || (b && purpose_member (BINFO_TYPE (b), - CLASSTYPE_VBASECLASSES (BINFO_TYPE (rtti_binfo))))) + || (b && binfo_for_vbase (BINFO_TYPE (b), BINFO_TYPE (rtti_binfo)))) /* Just set our BINFO_VTABLE to point to LAST, as we may not have set LAST's BINFO_VTABLE yet. We'll extract the actual vptr in binfo_ctor_vtable after everything's been set up. */ @@ -7284,18 +7112,20 @@ dfs_accumulate_vtbl_inits (tree binfo, /* Figure out the position to which the VPTR should point. */ vtbl = TREE_PURPOSE (l); - vtbl = build1 (ADDR_EXPR, - vtbl_ptr_type_node, - vtbl); - TREE_CONSTANT (vtbl) = 1; + vtbl = build_address (vtbl); + /* ??? We should call fold_convert to convert the address to + vtbl_ptr_type_node, which is the type of elements in the + vtable. However, the resulting NOP_EXPRs confuse other parts + of the C++ front end. */ + gcc_assert (TREE_CODE (vtbl) == ADDR_EXPR); + TREE_TYPE (vtbl) = vtbl_ptr_type_node; index = size_binop (PLUS_EXPR, size_int (non_fn_entries), size_int (list_length (TREE_VALUE (l)))); index = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (vtable_entry_type), index); - vtbl = build (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index); - TREE_CONSTANT (vtbl) = 1; + vtbl = build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index); } if (ctor_vtbl_p) @@ -7303,7 +7133,7 @@ dfs_accumulate_vtbl_inits (tree binfo, So, we make a TREE_LIST. Later, dfs_fixup_binfo_vtbls will straighten this out. */ BINFO_VTABLE (binfo) = tree_cons (rtti_binfo, vtbl, BINFO_VTABLE (binfo)); - else if (BINFO_PRIMARY_P (binfo) && TREE_VIA_VIRTUAL (binfo)) + else if (BINFO_PRIMARY_P (binfo) && BINFO_VIRTUAL_P (binfo)) inits = NULL_TREE; else /* For an ordinary vtable, set BINFO_VTABLE. */ @@ -7312,6 +7142,8 @@ dfs_accumulate_vtbl_inits (tree binfo, return inits; } +static GTY(()) tree abort_fndecl_addr; + /* Construct the initializer for BINFO's virtual function table. BINFO is part of the hierarchy dominated by T. If we're building a construction vtable, the ORIG_BINFO is the binfo we should use to @@ -7326,7 +7158,7 @@ dfs_accumulate_vtbl_inits (tree binfo, The value returned is a TREE_LIST suitable for wrapping in a CONSTRUCTOR to use as the DECL_INITIAL for a vtable. If NON_FN_ENTRIES_P is not NULL, *NON_FN_ENTRIES_P is set to the - number of non-function entries in the vtable. + number of non-function entries in the vtable. It might seem that this function should never be called with a BINFO for which BINFO_PRIMARY_P holds, the vtable for such a @@ -7337,15 +7169,17 @@ dfs_accumulate_vtbl_inits (tree binfo, static tree build_vtbl_initializer (tree binfo, - tree orig_binfo, - tree t, - tree rtti_binfo, - int* non_fn_entries_p) + tree orig_binfo, + tree t, + tree rtti_binfo, + int* non_fn_entries_p) { tree v, b; tree vfun_inits; - tree vbase; vtbl_init_data vid; + unsigned ix; + tree vbinfo; + VEC(tree,gc) *vbases; /* Initialize VID. */ memset (&vid, 0, sizeof (vid)); @@ -7353,11 +7187,11 @@ build_vtbl_initializer (tree binfo, vid.derived = t; vid.rtti_binfo = rtti_binfo; vid.last_init = &vid.inits; - vid.primary_vtbl_p = (binfo == TYPE_BINFO (t)); - vid.ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t); + vid.primary_vtbl_p = SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t); + vid.ctor_vtbl_p = !SAME_BINFO_TYPE_P (BINFO_TYPE (rtti_binfo), t); vid.generate_vcall_entries = true; /* The first vbase or vcall offset is at index -3 in the vtable. */ - vid.index = ssize_int (-3 * TARGET_VTABLE_DATA_ENTRY_DISTANCE); + vid.index = ssize_int(-3 * TARGET_VTABLE_DATA_ENTRY_DISTANCE); /* Add entries to the vtable for RTTI. */ build_rtti_vtbl_entries (binfo, &vid); @@ -7365,15 +7199,15 @@ build_vtbl_initializer (tree binfo, /* Create an array for keeping track of the functions we've processed. When we see multiple functions with the same signature, we share the vcall offsets. */ - VARRAY_TREE_INIT (vid.fns, 32, "fns"); + vid.fns = VEC_alloc (tree, gc, 32); /* Add the vcall and vbase offset entries. */ build_vcall_and_vbase_vtbl_entries (binfo, &vid); + /* Clear BINFO_VTABLE_PATH_MARKED; it's set by build_vbase_offset_vtbl_entries. */ - for (vbase = CLASSTYPE_VBASECLASSES (t); - vbase; - vbase = TREE_CHAIN (vbase)) - BINFO_VTABLE_PATH_MARKED (TREE_VALUE (vbase)) = 0; + for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0; + VEC_iterate (tree, vbases, ix, vbinfo); ix++) + BINFO_VTABLE_PATH_MARKED (vbinfo) = 0; /* If the target requires padding between data entries, add that now. */ if (TARGET_VTABLE_DATA_ENTRY_DISTANCE > 1) @@ -7406,7 +7240,7 @@ build_vtbl_initializer (tree binfo, tree vcall_index; tree fn, fn_original; tree init = NULL_TREE; - + fn = BV_FN (v); fn_original = fn; if (DECL_THUNK_P (fn)) @@ -7420,7 +7254,7 @@ build_vtbl_initializer (tree binfo, } fn_original = THUNK_TARGET (fn); } - + /* If the only definition of this function signature along our primary base chain is from a lost primary, this vtable slot will never be used, so just zero it out. This is important to avoid @@ -7453,24 +7287,30 @@ build_vtbl_initializer (tree binfo, delta = BV_DELTA (v); vcall_index = BV_VCALL_INDEX (v); - my_friendly_assert (TREE_CODE (delta) == INTEGER_CST, 19990727); - my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 19990727); + gcc_assert (TREE_CODE (delta) == INTEGER_CST); + gcc_assert (TREE_CODE (fn) == FUNCTION_DECL); /* You can't call an abstract virtual function; it's abstract. So, we replace these functions with __pure_virtual. */ if (DECL_PURE_VIRTUAL_P (fn_original)) - fn = abort_fndecl; - else if (!integer_zerop (delta) || vcall_index) { - fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index); - if (!DECL_NAME (fn)) - finish_thunk (fn); + fn = abort_fndecl; + if (abort_fndecl_addr == NULL) + abort_fndecl_addr = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); + init = abort_fndecl_addr; + } + else + { + if (!integer_zerop (delta) || vcall_index) + { + fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index); + if (!DECL_NAME (fn)) + finish_thunk (fn); + } + /* Take the address of the function, considering it to be of an + appropriate generic type. */ + init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); } - /* Take the address of the function, considering it to be of an - appropriate generic type. */ - init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn); - /* The address of a function can't change. */ - TREE_CONSTANT (init) = 1; } /* And add it to the chain of initializers. */ @@ -7483,22 +7323,23 @@ build_vtbl_initializer (tree binfo, else for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i) { - tree fdesc = build (FDESC_EXPR, vfunc_ptr_type_node, - TREE_OPERAND (init, 0), - build_int_2 (i, 0)); + tree fdesc = build2 (FDESC_EXPR, vfunc_ptr_type_node, + TREE_OPERAND (init, 0), + build_int_cst (NULL_TREE, i)); TREE_CONSTANT (fdesc) = 1; + TREE_INVARIANT (fdesc) = 1; vfun_inits = tree_cons (NULL_TREE, fdesc, vfun_inits); } } else - vfun_inits = tree_cons (NULL_TREE, init, vfun_inits); + vfun_inits = tree_cons (NULL_TREE, init, vfun_inits); } /* The initializers for virtual functions were built up in reverse order; straighten them out now. */ vfun_inits = nreverse (vfun_inits); - + /* The negative offset initializers are also in reverse order. */ vid.inits = nreverse (vid.inits); @@ -7540,11 +7381,11 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) /* If there are no virtual baseclasses, then there is nothing to do. */ - if (!TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (binfo))) + if (!CLASSTYPE_VBASECLASSES (BINFO_TYPE (binfo))) return; t = vid->derived; - + /* We might be a primary base class. Go up the inheritance hierarchy until we find the most derived class of which we are a primary base: it is the offset of that which we need to use. */ @@ -7557,7 +7398,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) base (possibly multi-level) of vid->binfo, or we wouldn't have called build_vcall_and_vbase_vtbl_entries for it. But it might be a lost primary, so just skip down to vid->binfo. */ - if (TREE_VIA_VIRTUAL (non_primary_binfo)) + if (BINFO_VIRTUAL_P (non_primary_binfo)) { non_primary_binfo = vid->binfo; break; @@ -7576,8 +7417,8 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) { tree b; tree delta; - - if (!TREE_VIA_VIRTUAL (vbase)) + + if (!BINFO_VIRTUAL_P (vbase)) continue; /* Find the instance of this virtual base in the complete @@ -7591,7 +7432,7 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) BINFO_VTABLE_PATH_MARKED (b) = 1; /* Figure out where we can find this vbase offset. */ - delta = size_binop (MULT_EXPR, + delta = size_binop (MULT_EXPR, vid->index, convert (ssizetype, TYPE_SIZE_UNIT (vtable_entry_type))); @@ -7599,12 +7440,8 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) BINFO_VPTR_FIELD (b) = delta; if (binfo != TYPE_BINFO (t)) - { - /* The vbase offset had better be the same. */ - my_friendly_assert (tree_int_cst_equal (delta, - BINFO_VPTR_FIELD (vbase)), - 20030202); - } + /* The vbase offset had better be the same. */ + gcc_assert (tree_int_cst_equal (delta, BINFO_VPTR_FIELD (vbase))); /* The next vbase will come at a more negative offset. */ vid->index = size_binop (MINUS_EXPR, vid->index, @@ -7615,12 +7452,12 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) we are walking in inheritance graph order so these end up in the right order. */ delta = size_diffop (BINFO_OFFSET (b), BINFO_OFFSET (non_primary_binfo)); - - *vid->last_init + + *vid->last_init = build_tree_list (NULL_TREE, - fold (build1 (NOP_EXPR, - vtable_entry_type, - delta))); + fold_build1 (NOP_EXPR, + vtable_entry_type, + delta)); vid->last_init = &TREE_CHAIN (*vid->last_init); } } @@ -7635,7 +7472,7 @@ build_vcall_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) /* We only need these entries if this base is a virtual base. We compute the indices -- but do not add to the vtable -- when building the main vtable for a class. */ - if (TREE_VIA_VIRTUAL (binfo) || binfo == TYPE_BINFO (vid->derived)) + if (BINFO_VIRTUAL_P (binfo) || binfo == TYPE_BINFO (vid->derived)) { /* We need a vcall offset for each of the virtual functions in this vtable. For example: @@ -7658,7 +7495,7 @@ build_vcall_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) vid->vbase = binfo; /* If we are just computing the vcall indices -- but do not need the actual entries -- not that. */ - if (!TREE_VIA_VIRTUAL (binfo)) + if (!BINFO_VIRTUAL_P (binfo)) vid->generate_vcall_entries = false; /* Now, walk through the non-virtual bases, adding vcall offsets. */ add_vcall_offset_vtbl_entries_r (binfo, vid); @@ -7672,14 +7509,15 @@ add_vcall_offset_vtbl_entries_r (tree binfo, vtbl_init_data* vid) { int i; tree primary_binfo; + tree base_binfo; /* Don't walk into virtual bases -- except, of course, for the virtual base for which we are building vcall offsets. Any primary virtual base will have already had its offsets generated through the recursion in build_vcall_and_vbase_vtbl_entries. */ - if (TREE_VIA_VIRTUAL (binfo) && vid->vbase != binfo) + if (BINFO_VIRTUAL_P (binfo) && vid->vbase != binfo) return; - + /* If BINFO has a primary base, process it first. */ primary_binfo = get_primary_binfo (binfo); if (primary_binfo) @@ -7689,14 +7527,9 @@ add_vcall_offset_vtbl_entries_r (tree binfo, vtbl_init_data* vid) add_vcall_offset_vtbl_entries_1 (binfo, vid); /* Scan the non-primary bases of BINFO. */ - for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i) - { - tree base_binfo; - - base_binfo = BINFO_BASETYPE (binfo, i); - if (base_binfo != primary_binfo) - add_vcall_offset_vtbl_entries_r (base_binfo, vid); - } + for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) + if (base_binfo != primary_binfo) + add_vcall_offset_vtbl_entries_r (base_binfo, vid); } /* Called from build_vcall_offset_vtbl_entries_r. */ @@ -7740,10 +7573,9 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) base (possibly multi-level) of vid->binfo, or we wouldn't have called build_vcall_and_vbase_vtbl_entries for it. But it might be a lost primary, so just skip down to vid->binfo. */ - if (TREE_VIA_VIRTUAL (non_primary_binfo)) + if (BINFO_VIRTUAL_P (non_primary_binfo)) { - if (non_primary_binfo != vid->vbase) - abort (); + gcc_assert (non_primary_binfo == vid->vbase); non_primary_binfo = vid->binfo; break; } @@ -7759,7 +7591,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) where rtti_binfo is the most derived type. */ non_primary_binfo = original_binfo (non_primary_binfo, vid->rtti_binfo); - + for (base_virtuals = BINFO_VIRTUALS (binfo), derived_virtuals = BINFO_VIRTUALS (non_primary_binfo), orig_virtuals = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (binfo))); @@ -7777,7 +7609,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) /* When processing BINFO, we only want to generate vcall slots for function slots introduced in BINFO. So don't try to generate one if the function isn't even defined in BINFO. */ - if (!same_type_p (DECL_CONTEXT (orig_fn), BINFO_TYPE (binfo))) + if (!SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), DECL_CONTEXT (orig_fn))) continue; add_vcall_offset (orig_fn, binfo, vid); @@ -7792,16 +7624,14 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) { size_t i; tree vcall_offset; + tree derived_entry; /* If there is already an entry for a function with the same signature as FN, then we do not need a second vcall offset. Check the list of functions already present in the derived class vtable. */ - for (i = 0; i < VARRAY_ACTIVE_SIZE (vid->fns); ++i) + for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i) { - tree derived_entry; - - derived_entry = VARRAY_TREE (vid->fns, i); if (same_signature_p (derived_entry, orig_fn) /* We only use one vcall offset for virtual destructors, even though there are two virtual table entries. */ @@ -7814,9 +7644,13 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) the vtable for the most derived class, remember the vcall offset. */ if (vid->binfo == TYPE_BINFO (vid->derived)) - CLASSTYPE_VCALL_INDICES (vid->derived) - = tree_cons (orig_fn, vid->index, - CLASSTYPE_VCALL_INDICES (vid->derived)); + { + tree_pair_p elt = VEC_safe_push (tree_pair_s, gc, + CLASSTYPE_VCALL_INDICES (vid->derived), + NULL); + elt->purpose = orig_fn; + elt->value = vid->index; + } /* The next vcall offset will be found at a more negative offset. */ @@ -7824,7 +7658,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE)); /* Keep track of this function. */ - VARRAY_PUSH_TREE (vid->fns, orig_fn); + VEC_safe_push (tree, gc, vid->fns, orig_fn); if (vid->generate_vcall_entries) { @@ -7846,8 +7680,8 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) BINFO_OFFSET from vid->binfo. */ vcall_offset = size_diffop (BINFO_OFFSET (base), BINFO_OFFSET (vid->binfo)); - vcall_offset = fold (build1 (NOP_EXPR, vtable_entry_type, - vcall_offset)); + vcall_offset = fold_build1 (NOP_EXPR, vtable_entry_type, + vcall_offset); } /* Add the initializer to the vtable. */ *vid->last_init = build_tree_list (NULL_TREE, vcall_offset); @@ -7876,12 +7710,13 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid) primary base, and then add the offset in the vtbl to that value. */ b = binfo; while (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (b)) - && !BINFO_LOST_PRIMARY_P (b)) + && !BINFO_LOST_PRIMARY_P (b)) { tree primary_base; primary_base = get_primary_binfo (b); - my_friendly_assert (BINFO_PRIMARY_BASE_OF (primary_base) == b, 20010127); + gcc_assert (BINFO_PRIMARY_P (primary_base) + && BINFO_INHERITANCE_CHAIN (primary_base) == b); b = primary_base; } offset = size_diffop (BINFO_OFFSET (vid->rtti_binfo), BINFO_OFFSET (b)); @@ -7891,17 +7726,49 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid) decl = build_address (get_tinfo_decl (t)); else decl = integer_zero_node; - + /* Convert the declaration to a type that can be stored in the vtable. */ init = build_nop (vfunc_ptr_type_node, decl); *vid->last_init = build_tree_list (NULL_TREE, init); vid->last_init = &TREE_CHAIN (*vid->last_init); - /* Add the offset-to-top entry. It comes earlier in the vtable that - the the typeinfo entry. Convert the offset to look like a + /* Add the offset-to-top entry. It comes earlier in the vtable than + the typeinfo entry. Convert the offset to look like a function pointer, so that we can put it in the vtable. */ init = build_nop (vfunc_ptr_type_node, offset); *vid->last_init = build_tree_list (NULL_TREE, init); vid->last_init = &TREE_CHAIN (*vid->last_init); } + +/* Fold a OBJ_TYPE_REF expression to the address of a function. + KNOWN_TYPE carries the true type of OBJ_TYPE_REF_OBJECT(REF). */ + +tree +cp_fold_obj_type_ref (tree ref, tree known_type) +{ + HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); + HOST_WIDE_INT i = 0; + tree v = BINFO_VIRTUALS (TYPE_BINFO (known_type)); + tree fndecl; + + while (i != index) + { + i += (TARGET_VTABLE_USES_DESCRIPTORS + ? TARGET_VTABLE_USES_DESCRIPTORS : 1); + v = TREE_CHAIN (v); + } + + fndecl = BV_FN (v); + +#ifdef ENABLE_CHECKING + gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref), + DECL_VINDEX (fndecl))); +#endif + + cgraph_node (fndecl)->local.vtable_method = true; + + return build_address (fndecl); +} + +#include "gt-cp-class.h" diff --git a/contrib/gcc/cp/config-lang.in b/contrib/gcc/cp/config-lang.in index 8ba5506e8fb..127b23709ee 100644 --- a/contrib/gcc/cp/config-lang.in +++ b/contrib/gcc/cp/config-lang.in @@ -16,8 +16,8 @@ #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. +#the Free Software Foundation, 51 Franklin Street, Fifth Floor, +#Boston, MA 02110-1301, USA. # Configure looks for the existence of this file to auto-config each language. # We define several parameters used by configure: @@ -32,6 +32,6 @@ compilers="cc1plus\$(exeext)" stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)" -target_libs="target-libstdc++-v3 target-gperf" +target_libs="target-libstdc++-v3" -gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c" +gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c" diff --git a/contrib/gcc/cp/cp-gimplify.c b/contrib/gcc/cp/cp-gimplify.c new file mode 100644 index 00000000000..2be5857c1aa --- /dev/null +++ b/contrib/gcc/cp/cp-gimplify.c @@ -0,0 +1,934 @@ +/* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. + + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Contributed by Jason Merrill + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "cp-tree.h" +#include "c-common.h" +#include "toplev.h" +#include "tree-gimple.h" +#include "hashtab.h" +#include "pointer-set.h" +#include "flags.h" + +/* Local declarations. */ + +enum bc_t { bc_break = 0, bc_continue = 1 }; + +/* Stack of labels which are targets for "break" or "continue", + linked through TREE_CHAIN. */ +static tree bc_label[2]; + +/* Begin a scope which can be exited by a break or continue statement. BC + indicates which. + + Just creates a label and pushes it into the current context. */ + +static tree +begin_bc_block (enum bc_t bc) +{ + tree label = create_artificial_label (); + TREE_CHAIN (label) = bc_label[bc]; + bc_label[bc] = label; + return label; +} + +/* Finish a scope which can be exited by a break or continue statement. + LABEL was returned from the most recent call to begin_bc_block. BODY is + an expression for the contents of the scope. + + If we saw a break (or continue) in the scope, append a LABEL_EXPR to + body. Otherwise, just forget the label. */ + +static tree +finish_bc_block (enum bc_t bc, tree label, tree body) +{ + gcc_assert (label == bc_label[bc]); + + if (TREE_USED (label)) + { + tree t, sl = NULL; + + t = build1 (LABEL_EXPR, void_type_node, label); + + append_to_statement_list (body, &sl); + append_to_statement_list (t, &sl); + body = sl; + } + + bc_label[bc] = TREE_CHAIN (label); + TREE_CHAIN (label) = NULL_TREE; + return body; +} + +/* Build a GOTO_EXPR to represent a break or continue statement. BC + indicates which. */ + +static tree +build_bc_goto (enum bc_t bc) +{ + tree label = bc_label[bc]; + + if (label == NULL_TREE) + { + if (bc == bc_break) + error ("break statement not within loop or switch"); + else + error ("continue statement not within loop or switch"); + + return NULL_TREE; + } + + /* Mark the label used for finish_bc_block. */ + TREE_USED (label) = 1; + return build1 (GOTO_EXPR, void_type_node, label); +} + +/* Genericize a TRY_BLOCK. */ + +static void +genericize_try_block (tree *stmt_p) +{ + tree body = TRY_STMTS (*stmt_p); + tree cleanup = TRY_HANDLERS (*stmt_p); + + gimplify_stmt (&body); + + if (CLEANUP_P (*stmt_p)) + /* A cleanup is an expression, so it doesn't need to be genericized. */; + else + gimplify_stmt (&cleanup); + + *stmt_p = build2 (TRY_CATCH_EXPR, void_type_node, body, cleanup); +} + +/* Genericize a HANDLER by converting to a CATCH_EXPR. */ + +static void +genericize_catch_block (tree *stmt_p) +{ + tree type = HANDLER_TYPE (*stmt_p); + tree body = HANDLER_BODY (*stmt_p); + + gimplify_stmt (&body); + + /* FIXME should the caught type go in TREE_TYPE? */ + *stmt_p = build2 (CATCH_EXPR, void_type_node, type, body); +} + +/* Genericize an EH_SPEC_BLOCK by converting it to a + TRY_CATCH_EXPR/EH_FILTER_EXPR pair. */ + +static void +genericize_eh_spec_block (tree *stmt_p) +{ + tree body = EH_SPEC_STMTS (*stmt_p); + tree allowed = EH_SPEC_RAISES (*stmt_p); + tree failure = build_call (call_unexpected_node, + tree_cons (NULL_TREE, build_exc_ptr (), + NULL_TREE)); + gimplify_stmt (&body); + + *stmt_p = gimple_build_eh_filter (body, allowed, failure); +} + +/* Genericize an IF_STMT by turning it into a COND_EXPR. */ + +static void +gimplify_if_stmt (tree *stmt_p) +{ + tree stmt, cond, then_, else_; + + stmt = *stmt_p; + cond = IF_COND (stmt); + then_ = THEN_CLAUSE (stmt); + else_ = ELSE_CLAUSE (stmt); + + if (!then_) + then_ = build_empty_stmt (); + if (!else_) + else_ = build_empty_stmt (); + + if (integer_nonzerop (cond) && !TREE_SIDE_EFFECTS (else_)) + stmt = then_; + else if (integer_zerop (cond) && !TREE_SIDE_EFFECTS (then_)) + stmt = else_; + else + stmt = build3 (COND_EXPR, void_type_node, cond, then_, else_); + *stmt_p = stmt; +} + +/* Build a generic representation of one of the C loop forms. COND is the + loop condition or NULL_TREE. BODY is the (possibly compound) statement + controlled by the loop. INCR is the increment expression of a for-loop, + or NULL_TREE. COND_IS_FIRST indicates whether the condition is + evaluated before the loop body as in while and for loops, or after the + loop body as in do-while loops. */ + +static tree +gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) +{ + tree top, entry, exit, cont_block, break_block, stmt_list, t; + location_t stmt_locus; + + stmt_locus = input_location; + stmt_list = NULL_TREE; + entry = NULL_TREE; + + break_block = begin_bc_block (bc_break); + cont_block = begin_bc_block (bc_continue); + + /* If condition is zero don't generate a loop construct. */ + if (cond && integer_zerop (cond)) + { + top = NULL_TREE; + exit = NULL_TREE; + if (cond_is_first) + { + t = build_bc_goto (bc_break); + append_to_statement_list (t, &stmt_list); + } + } + else + { + /* If we use a LOOP_EXPR here, we have to feed the whole thing + back through the main gimplifier to lower it. Given that we + have to gimplify the loop body NOW so that we can resolve + break/continue stmts, seems easier to just expand to gotos. */ + top = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + + /* If we have an exit condition, then we build an IF with gotos either + out of the loop, or to the top of it. If there's no exit condition, + then we just build a jump back to the top. */ + exit = build_and_jump (&LABEL_EXPR_LABEL (top)); + if (cond && !integer_nonzerop (cond)) + { + t = build_bc_goto (bc_break); + exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t); + gimplify_stmt (&exit); + + if (cond_is_first) + { + if (incr) + { + entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + t = build_and_jump (&LABEL_EXPR_LABEL (entry)); + } + else + t = build_bc_goto (bc_continue); + append_to_statement_list (t, &stmt_list); + } + } + } + + gimplify_stmt (&body); + gimplify_stmt (&incr); + + body = finish_bc_block (bc_continue, cont_block, body); + + append_to_statement_list (top, &stmt_list); + append_to_statement_list (body, &stmt_list); + append_to_statement_list (incr, &stmt_list); + append_to_statement_list (entry, &stmt_list); + append_to_statement_list (exit, &stmt_list); + + annotate_all_with_locus (&stmt_list, stmt_locus); + + return finish_bc_block (bc_break, break_block, stmt_list); +} + +/* Gimplify a FOR_STMT node. Move the stuff in the for-init-stmt into the + prequeue and hand off to gimplify_cp_loop. */ + +static void +gimplify_for_stmt (tree *stmt_p, tree *pre_p) +{ + tree stmt = *stmt_p; + + if (FOR_INIT_STMT (stmt)) + gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); + + *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), + FOR_EXPR (stmt), 1); +} + +/* Gimplify a WHILE_STMT node. */ + +static void +gimplify_while_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), + NULL_TREE, 1); +} + +/* Gimplify a DO_STMT node. */ + +static void +gimplify_do_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), + NULL_TREE, 0); +} + +/* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ + +static void +gimplify_switch_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + tree break_block, body; + location_t stmt_locus = input_location; + + break_block = begin_bc_block (bc_break); + + body = SWITCH_STMT_BODY (stmt); + if (!body) + body = build_empty_stmt (); + + *stmt_p = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), + SWITCH_STMT_COND (stmt), body, NULL_TREE); + SET_EXPR_LOCATION (*stmt_p, stmt_locus); + gimplify_stmt (stmt_p); + + *stmt_p = finish_bc_block (bc_break, break_block, *stmt_p); +} + +/* Hook into the middle of gimplifying an OMP_FOR node. This is required + in order to properly gimplify CONTINUE statements. Here we merely + manage the continue stack; the rest of the job is performed by the + regular gimplifier. */ + +static enum gimplify_status +cp_gimplify_omp_for (tree *expr_p) +{ + tree for_stmt = *expr_p; + tree cont_block; + + /* Protect ourselves from recursion. */ + if (OMP_FOR_GIMPLIFYING_P (for_stmt)) + return GS_UNHANDLED; + OMP_FOR_GIMPLIFYING_P (for_stmt) = 1; + + /* Note that while technically the continue label is enabled too soon + here, we should have already diagnosed invalid continues nested within + statement expressions within the INIT, COND, or INCR expressions. */ + cont_block = begin_bc_block (bc_continue); + + gimplify_stmt (expr_p); + + OMP_FOR_BODY (for_stmt) + = finish_bc_block (bc_continue, cont_block, OMP_FOR_BODY (for_stmt)); + OMP_FOR_GIMPLIFYING_P (for_stmt) = 0; + + return GS_ALL_DONE; +} + +/* Gimplify an EXPR_STMT node. */ + +static void +gimplify_expr_stmt (tree *stmt_p) +{ + tree stmt = EXPR_STMT_EXPR (*stmt_p); + + if (stmt == error_mark_node) + stmt = NULL; + + /* Gimplification of a statement expression will nullify the + statement if all its side effects are moved to *PRE_P and *POST_P. + + In this case we will not want to emit the gimplified statement. + However, we may still want to emit a warning, so we do that before + gimplification. */ + if (stmt && (extra_warnings || warn_unused_value)) + { + if (!TREE_SIDE_EFFECTS (stmt)) + { + if (!IS_EMPTY_STMT (stmt) + && !VOID_TYPE_P (TREE_TYPE (stmt)) + && !TREE_NO_WARNING (stmt)) + warning (OPT_Wextra, "statement with no effect"); + } + else if (warn_unused_value) + warn_if_unused_value (stmt, input_location); + } + + if (stmt == NULL_TREE) + stmt = alloc_stmt_list (); + + *stmt_p = stmt; +} + +/* Gimplify initialization from an AGGR_INIT_EXPR. */ + +static void +cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p) +{ + tree from = TREE_OPERAND (*expr_p, 1); + tree to = TREE_OPERAND (*expr_p, 0); + tree sub; + + /* What about code that pulls out the temp and uses it elsewhere? I + think that such code never uses the TARGET_EXPR as an initializer. If + I'm wrong, we'll abort because the temp won't have any RTL. In that + case, I guess we'll need to replace references somehow. */ + if (TREE_CODE (from) == TARGET_EXPR) + from = TARGET_EXPR_INITIAL (from); + + /* Look through any COMPOUND_EXPRs, since build_compound_expr pushes them + inside the TARGET_EXPR. */ + sub = expr_last (from); + + /* If we are initializing from an AGGR_INIT_EXPR, drop the INIT_EXPR and + replace the slot operand with our target. + + Should we add a target parm to gimplify_expr instead? No, as in this + case we want to replace the INIT_EXPR. */ + if (TREE_CODE (sub) == AGGR_INIT_EXPR) + { + gimplify_expr (&to, pre_p, post_p, is_gimple_lvalue, fb_lvalue); + TREE_OPERAND (sub, 2) = to; + *expr_p = from; + + /* The initialization is now a side-effect, so the container can + become void. */ + if (from != sub) + TREE_TYPE (from) = void_type_node; + } +} + +/* Gimplify a MUST_NOT_THROW_EXPR. */ + +static void +gimplify_must_not_throw_expr (tree *expr_p, tree *pre_p) +{ + tree stmt = *expr_p; + tree temp = voidify_wrapper_expr (stmt, NULL); + tree body = TREE_OPERAND (stmt, 0); + + gimplify_stmt (&body); + + stmt = gimple_build_eh_filter (body, NULL_TREE, + build_call (terminate_node, NULL_TREE)); + + if (temp) + { + append_to_statement_list (stmt, pre_p); + *expr_p = temp; + } + else + *expr_p = stmt; +} + +/* Do C++-specific gimplification. Args are as for gimplify_expr. */ + +int +cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p) +{ + int saved_stmts_are_full_exprs_p = 0; + enum tree_code code = TREE_CODE (*expr_p); + enum gimplify_status ret; + + if (STATEMENT_CODE_P (code)) + { + saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); + current_stmt_tree ()->stmts_are_full_exprs_p + = STMT_IS_FULL_EXPR_P (*expr_p); + } + + switch (code) + { + case PTRMEM_CST: + *expr_p = cplus_expand_constant (*expr_p); + ret = GS_OK; + break; + + case AGGR_INIT_EXPR: + simplify_aggr_init_expr (expr_p); + ret = GS_OK; + break; + + case THROW_EXPR: + /* FIXME communicate throw type to backend, probably by moving + THROW_EXPR into ../tree.def. */ + *expr_p = TREE_OPERAND (*expr_p, 0); + ret = GS_OK; + break; + + case MUST_NOT_THROW_EXPR: + gimplify_must_not_throw_expr (expr_p, pre_p); + ret = GS_OK; + break; + + /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the + LHS of an assignment might also be involved in the RHS, as in bug + 25979. */ + case INIT_EXPR: + cp_gimplify_init_expr (expr_p, pre_p, post_p); + ret = GS_OK; + break; + + case EMPTY_CLASS_EXPR: + /* We create an empty CONSTRUCTOR with RECORD_TYPE. */ + *expr_p = build_constructor (TREE_TYPE (*expr_p), NULL); + ret = GS_OK; + break; + + case BASELINK: + *expr_p = BASELINK_FUNCTIONS (*expr_p); + ret = GS_OK; + break; + + case TRY_BLOCK: + genericize_try_block (expr_p); + ret = GS_OK; + break; + + case HANDLER: + genericize_catch_block (expr_p); + ret = GS_OK; + break; + + case EH_SPEC_BLOCK: + genericize_eh_spec_block (expr_p); + ret = GS_OK; + break; + + case USING_STMT: + /* Just ignore for now. Eventually we will want to pass this on to + the debugger. */ + *expr_p = build_empty_stmt (); + ret = GS_ALL_DONE; + break; + + case IF_STMT: + gimplify_if_stmt (expr_p); + ret = GS_OK; + break; + + case FOR_STMT: + gimplify_for_stmt (expr_p, pre_p); + ret = GS_ALL_DONE; + break; + + case WHILE_STMT: + gimplify_while_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case DO_STMT: + gimplify_do_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case SWITCH_STMT: + gimplify_switch_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case OMP_FOR: + ret = cp_gimplify_omp_for (expr_p); + break; + + case CONTINUE_STMT: + *expr_p = build_bc_goto (bc_continue); + ret = GS_ALL_DONE; + break; + + case BREAK_STMT: + *expr_p = build_bc_goto (bc_break); + ret = GS_ALL_DONE; + break; + + case EXPR_STMT: + gimplify_expr_stmt (expr_p); + ret = GS_OK; + break; + + case UNARY_PLUS_EXPR: + { + tree arg = TREE_OPERAND (*expr_p, 0); + tree type = TREE_TYPE (*expr_p); + *expr_p = (TREE_TYPE (arg) != type) ? fold_convert (type, arg) + : arg; + ret = GS_OK; + } + break; + + default: + ret = c_gimplify_expr (expr_p, pre_p, post_p); + break; + } + + /* Restore saved state. */ + if (STATEMENT_CODE_P (code)) + current_stmt_tree ()->stmts_are_full_exprs_p + = saved_stmts_are_full_exprs_p; + + return ret; +} + +static inline bool +is_invisiref_parm (tree t) +{ + return ((TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL) + && DECL_BY_REFERENCE (t)); +} + +/* Return true if the uid in both int tree maps are equal. */ + +int +cxx_int_tree_map_eq (const void *va, const void *vb) +{ + const struct cxx_int_tree_map *a = (const struct cxx_int_tree_map *) va; + const struct cxx_int_tree_map *b = (const struct cxx_int_tree_map *) vb; + return (a->uid == b->uid); +} + +/* Hash a UID in a cxx_int_tree_map. */ + +unsigned int +cxx_int_tree_map_hash (const void *item) +{ + return ((const struct cxx_int_tree_map *)item)->uid; +} + +/* Perform any pre-gimplification lowering of C++ front end trees to + GENERIC. */ + +static tree +cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) +{ + tree stmt = *stmt_p; + struct pointer_set_t *p_set = (struct pointer_set_t*) data; + + if (is_invisiref_parm (stmt) + /* Don't dereference parms in a thunk, pass the references through. */ + && !(DECL_THUNK_P (current_function_decl) + && TREE_CODE (stmt) == PARM_DECL)) + { + *stmt_p = convert_from_reference (stmt); + *walk_subtrees = 0; + return NULL; + } + + /* Map block scope extern declarations to visible declarations with the + same name and type in outer scopes if any. */ + if (cp_function_chain->extern_decl_map + && (TREE_CODE (stmt) == FUNCTION_DECL || TREE_CODE (stmt) == VAR_DECL) + && DECL_EXTERNAL (stmt)) + { + struct cxx_int_tree_map *h, in; + in.uid = DECL_UID (stmt); + h = (struct cxx_int_tree_map *) + htab_find_with_hash (cp_function_chain->extern_decl_map, + &in, in.uid); + if (h) + { + *stmt_p = h->to; + *walk_subtrees = 0; + return NULL; + } + } + + /* Other than invisiref parms, don't walk the same tree twice. */ + if (pointer_set_contains (p_set, stmt)) + { + *walk_subtrees = 0; + return NULL_TREE; + } + + if (TREE_CODE (stmt) == ADDR_EXPR + && is_invisiref_parm (TREE_OPERAND (stmt, 0))) + { + *stmt_p = convert (TREE_TYPE (stmt), TREE_OPERAND (stmt, 0)); + *walk_subtrees = 0; + } + else if (TREE_CODE (stmt) == RETURN_EXPR + && TREE_OPERAND (stmt, 0) + && is_invisiref_parm (TREE_OPERAND (stmt, 0))) + /* Don't dereference an invisiref RESULT_DECL inside a RETURN_EXPR. */ + *walk_subtrees = 0; + else if (TREE_CODE (stmt) == OMP_CLAUSE) + switch (OMP_CLAUSE_CODE (stmt)) + { + case OMP_CLAUSE_PRIVATE: + case OMP_CLAUSE_SHARED: + case OMP_CLAUSE_FIRSTPRIVATE: + case OMP_CLAUSE_LASTPRIVATE: + case OMP_CLAUSE_COPYIN: + case OMP_CLAUSE_COPYPRIVATE: + /* Don't dereference an invisiref in OpenMP clauses. */ + if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt))) + *walk_subtrees = 0; + break; + case OMP_CLAUSE_REDUCTION: + gcc_assert (!is_invisiref_parm (OMP_CLAUSE_DECL (stmt))); + break; + default: + break; + } + else if (IS_TYPE_OR_DECL_P (stmt)) + *walk_subtrees = 0; + + /* Due to the way voidify_wrapper_expr is written, we don't get a chance + to lower this construct before scanning it, so we need to lower these + before doing anything else. */ + else if (TREE_CODE (stmt) == CLEANUP_STMT) + *stmt_p = build2 (CLEANUP_EH_ONLY (stmt) ? TRY_CATCH_EXPR + : TRY_FINALLY_EXPR, + void_type_node, + CLEANUP_BODY (stmt), + CLEANUP_EXPR (stmt)); + + pointer_set_insert (p_set, *stmt_p); + + return NULL; +} + +void +cp_genericize (tree fndecl) +{ + tree t; + struct pointer_set_t *p_set; + + /* Fix up the types of parms passed by invisible reference. */ + for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t)) + if (TREE_ADDRESSABLE (TREE_TYPE (t))) + { + /* If a function's arguments are copied to create a thunk, + then DECL_BY_REFERENCE will be set -- but the type of the + argument will be a pointer type, so we will never get + here. */ + gcc_assert (!DECL_BY_REFERENCE (t)); + gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t)); + TREE_TYPE (t) = DECL_ARG_TYPE (t); + DECL_BY_REFERENCE (t) = 1; + TREE_ADDRESSABLE (t) = 0; + relayout_decl (t); + } + + /* Do the same for the return value. */ + if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (fndecl)))) + { + t = DECL_RESULT (fndecl); + TREE_TYPE (t) = build_reference_type (TREE_TYPE (t)); + DECL_BY_REFERENCE (t) = 1; + TREE_ADDRESSABLE (t) = 0; + relayout_decl (t); + } + + /* If we're a clone, the body is already GIMPLE. */ + if (DECL_CLONED_FUNCTION_P (fndecl)) + return; + + /* We do want to see every occurrence of the parms, so we can't just use + walk_tree's hash functionality. */ + p_set = pointer_set_create (); + walk_tree (&DECL_SAVED_TREE (fndecl), cp_genericize_r, p_set, NULL); + pointer_set_destroy (p_set); + + /* Do everything else. */ + c_genericize (fndecl); + + gcc_assert (bc_label[bc_break] == NULL); + gcc_assert (bc_label[bc_continue] == NULL); +} + +/* Build code to apply FN to each member of ARG1 and ARG2. FN may be + NULL if there is in fact nothing to do. ARG2 may be null if FN + actually only takes one argument. */ + +static tree +cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2) +{ + tree defparm, parm; + int i; + + if (fn == NULL) + return NULL; + + defparm = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (fn))); + if (arg2) + defparm = TREE_CHAIN (defparm); + + if (TREE_CODE (TREE_TYPE (arg1)) == ARRAY_TYPE) + { + tree inner_type = TREE_TYPE (arg1); + tree start1, end1, p1; + tree start2 = NULL, p2 = NULL; + tree ret = NULL, lab, t; + + start1 = arg1; + start2 = arg2; + do + { + inner_type = TREE_TYPE (inner_type); + start1 = build4 (ARRAY_REF, inner_type, start1, + size_zero_node, NULL, NULL); + if (arg2) + start2 = build4 (ARRAY_REF, inner_type, start2, + size_zero_node, NULL, NULL); + } + while (TREE_CODE (inner_type) == ARRAY_TYPE); + start1 = build_fold_addr_expr (start1); + if (arg2) + start2 = build_fold_addr_expr (start2); + + end1 = TYPE_SIZE_UNIT (TREE_TYPE (arg1)); + end1 = fold_convert (TREE_TYPE (start1), end1); + end1 = build2 (PLUS_EXPR, TREE_TYPE (start1), start1, end1); + + p1 = create_tmp_var (TREE_TYPE (start1), NULL); + t = build2 (MODIFY_EXPR, void_type_node, p1, start1); + append_to_statement_list (t, &ret); + + if (arg2) + { + p2 = create_tmp_var (TREE_TYPE (start2), NULL); + t = build2 (MODIFY_EXPR, void_type_node, p2, start2); + append_to_statement_list (t, &ret); + } + + lab = create_artificial_label (); + t = build1 (LABEL_EXPR, void_type_node, lab); + append_to_statement_list (t, &ret); + + t = tree_cons (NULL, p1, NULL); + if (arg2) + t = tree_cons (NULL, p2, t); + /* Handle default arguments. */ + i = 1 + (arg2 != NULL); + for (parm = defparm; parm != void_list_node; parm = TREE_CHAIN (parm)) + t = tree_cons (NULL, convert_default_arg (TREE_VALUE (parm), + TREE_PURPOSE (parm), + fn, i++), t); + t = build_call (fn, nreverse (t)); + append_to_statement_list (t, &ret); + + t = fold_convert (TREE_TYPE (p1), TYPE_SIZE_UNIT (inner_type)); + t = build2 (PLUS_EXPR, TREE_TYPE (p1), p1, t); + t = build2 (MODIFY_EXPR, void_type_node, p1, t); + append_to_statement_list (t, &ret); + + if (arg2) + { + t = fold_convert (TREE_TYPE (p2), TYPE_SIZE_UNIT (inner_type)); + t = build2 (PLUS_EXPR, TREE_TYPE (p2), p2, t); + t = build2 (MODIFY_EXPR, void_type_node, p2, t); + append_to_statement_list (t, &ret); + } + + t = build2 (NE_EXPR, boolean_type_node, p1, end1); + t = build3 (COND_EXPR, void_type_node, t, build_and_jump (&lab), NULL); + append_to_statement_list (t, &ret); + + return ret; + } + else + { + tree t = tree_cons (NULL, build_fold_addr_expr (arg1), NULL); + if (arg2) + t = tree_cons (NULL, build_fold_addr_expr (arg2), t); + /* Handle default arguments. */ + i = 1 + (arg2 != NULL); + for (parm = defparm; parm != void_list_node; parm = TREE_CHAIN (parm)) + t = tree_cons (NULL, convert_default_arg (TREE_VALUE (parm), + TREE_PURPOSE (parm), + fn, i++), t); + return build_call (fn, nreverse (t)); + } +} + +/* Return code to initialize DECL with its default constructor, or + NULL if there's nothing to do. */ + +tree +cxx_omp_clause_default_ctor (tree clause, tree decl) +{ + tree info = CP_OMP_CLAUSE_INFO (clause); + tree ret = NULL; + + if (info) + ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), decl, NULL); + + return ret; +} + +/* Return code to initialize DST with a copy constructor from SRC. */ + +tree +cxx_omp_clause_copy_ctor (tree clause, tree dst, tree src) +{ + tree info = CP_OMP_CLAUSE_INFO (clause); + tree ret = NULL; + + if (info) + ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src); + if (ret == NULL) + ret = build2 (MODIFY_EXPR, void_type_node, dst, src); + + return ret; +} + +/* Similarly, except use an assignment operator instead. */ + +tree +cxx_omp_clause_assign_op (tree clause, tree dst, tree src) +{ + tree info = CP_OMP_CLAUSE_INFO (clause); + tree ret = NULL; + + if (info) + ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src); + if (ret == NULL) + ret = build2 (MODIFY_EXPR, void_type_node, dst, src); + + return ret; +} + +/* Return code to destroy DECL. */ + +tree +cxx_omp_clause_dtor (tree clause, tree decl) +{ + tree info = CP_OMP_CLAUSE_INFO (clause); + tree ret = NULL; + + if (info) + ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 1), decl, NULL); + + return ret; +} + +/* True if OpenMP should privatize what this DECL points to rather + than the DECL itself. */ + +bool +cxx_omp_privatize_by_reference (tree decl) +{ + return is_invisiref_parm (decl); +} diff --git a/contrib/gcc/cp/cp-lang.c b/contrib/gcc/cp/cp-lang.c index f1f5eedcc54..60503278930 100644 --- a/contrib/gcc/cp/cp-lang.c +++ b/contrib/gcc/cp/cp-lang.c @@ -1,5 +1,5 @@ /* Language-dependent hooks for C++. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -30,177 +30,39 @@ Boston, MA 02111-1307, USA. */ #include "langhooks.h" #include "langhooks-def.h" #include "diagnostic.h" -#include "cxx-pretty-print.h" +#include "debug.h" +#include "cp-objcp-common.h" +#include "hashtab.h" enum c_language_kind c_language = clk_cxx; +static void cp_init_ts (void); -static HOST_WIDE_INT cxx_get_alias_set (tree); -static bool ok_to_generate_alias_set_for_type (tree); -static bool cxx_warn_unused_global_decl (tree); -static tree cp_expr_size (tree); -static size_t cp_tree_size (enum tree_code); -static bool cp_var_mod_type_p (tree); -static void cxx_initialize_diagnostics (diagnostic_context *); +/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h; + consequently, there should be very few hooks below. */ #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU C++" -#undef LANG_HOOKS_TREE_SIZE -#define LANG_HOOKS_TREE_SIZE cp_tree_size #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT cxx_init -#undef LANG_HOOKS_FINISH -#define LANG_HOOKS_FINISH cxx_finish -#undef LANG_HOOKS_CLEAR_BINDING_STACK -#define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything -#undef LANG_HOOKS_INIT_OPTIONS -#define LANG_HOOKS_INIT_OPTIONS c_common_init_options -#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS -#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS cxx_initialize_diagnostics -#undef LANG_HOOKS_HANDLE_OPTION -#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option -#undef LANG_HOOKS_HANDLE_FILENAME -#define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename -#undef LANG_HOOKS_MISSING_ARGUMENT -#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument -#undef LANG_HOOKS_POST_OPTIONS -#define LANG_HOOKS_POST_OPTIONS c_common_post_options -#undef LANG_HOOKS_GET_ALIAS_SET -#define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set -#undef LANG_HOOKS_EXPAND_CONSTANT -#define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant -#undef LANG_HOOKS_EXPAND_EXPR -#define LANG_HOOKS_EXPAND_EXPR cxx_expand_expr -#undef LANG_HOOKS_SAFE_FROM_P -#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p -#undef LANG_HOOKS_PARSE_FILE -#define LANG_HOOKS_PARSE_FILE c_common_parse_file -#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL -#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl -#undef LANG_HOOKS_UNSAVE_EXPR_NOW -#define LANG_HOOKS_UNSAVE_EXPR_NOW cxx_unsave_expr_now -#undef LANG_HOOKS_MAYBE_BUILD_CLEANUP -#define LANG_HOOKS_MAYBE_BUILD_CLEANUP cxx_maybe_build_cleanup -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion -#undef LANG_HOOKS_UNSAFE_FOR_REEVAL -#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval -#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME -#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl -#undef LANG_HOOKS_MARK_ADDRESSABLE -#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable -#undef LANG_HOOKS_PRINT_STATISTICS -#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics -#undef LANG_HOOKS_PRINT_XNODE -#define LANG_HOOKS_PRINT_XNODE cxx_print_xnode -#undef LANG_HOOKS_PRINT_DECL -#define LANG_HOOKS_PRINT_DECL cxx_print_decl -#undef LANG_HOOKS_PRINT_TYPE -#define LANG_HOOKS_PRINT_TYPE cxx_print_type -#undef LANG_HOOKS_PRINT_IDENTIFIER -#define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier #undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name -#undef LANG_HOOKS_PRINT_ERROR_FUNCTION -#define LANG_HOOKS_PRINT_ERROR_FUNCTION cxx_print_error_function -#undef LANG_HOOKS_BUILTIN_TYPE_DECLS -#define LANG_HOOKS_BUILTIN_TYPE_DECLS cxx_builtin_type_decls -#undef LANG_HOOKS_PUSHLEVEL -#define LANG_HOOKS_PUSHLEVEL lhd_do_nothing_i -#undef LANG_HOOKS_POPLEVEL -#define LANG_HOOKS_POPLEVEL lhd_do_nothing_iii_return_null_tree -#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL -#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl -#undef LANG_HOOKS_WRITE_GLOBALS -#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing -#undef LANG_HOOKS_DECL_UNINIT -#define LANG_HOOKS_DECL_UNINIT c_decl_uninit +#undef LANG_HOOKS_FOLD_OBJ_TYPE_REF +#define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref +#undef LANG_HOOKS_INIT_TS +#define LANG_HOOKS_INIT_TS cp_init_ts - -#undef LANG_HOOKS_FUNCTION_INIT -#define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context -#undef LANG_HOOKS_FUNCTION_FINAL -#define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context - -#undef LANG_HOOKS_RTL_EXPAND_START -#define LANG_HOOKS_RTL_EXPAND_START cxx_expand_function_start -#undef LANG_HOOKS_RTL_EXPAND_STMT -#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt - -/* Attribute hooks. */ -#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE -#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table -#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE -#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table -#undef LANG_HOOKS_ATTRIBUTE_TABLE -#define LANG_HOOKS_ATTRIBUTE_TABLE cxx_attribute_table - -#undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES -#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \ - cp_walk_subtrees -#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN -#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ - cp_cannot_inline_tree_fn -#undef LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS -#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \ - cp_add_pending_fn_decls -#undef LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P -#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \ - cp_is_overload_p -#undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P -#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \ - cp_auto_var_in_fn_p -#undef LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING -#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \ - cp_copy_res_decl_for_inlining -#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P -#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p -#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P -#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p -#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS -#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns -#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN -#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree -#undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN -#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals -#undef LANG_HOOKS_EXPR_SIZE -#define LANG_HOOKS_EXPR_SIZE cp_expr_size - -#undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR -#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body - -#undef LANG_HOOKS_MAKE_TYPE -#define LANG_HOOKS_MAKE_TYPE cxx_make_type -#undef LANG_HOOKS_TYPE_FOR_MODE -#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode -#undef LANG_HOOKS_TYPE_FOR_SIZE -#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size -#undef LANG_HOOKS_SIGNED_TYPE -#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type -#undef LANG_HOOKS_UNSIGNED_TYPE -#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type -#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE -#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type -#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR -#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error -#undef LANG_HOOKS_TYPE_PROMOTES_TO -#define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to -#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE -#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type - -/* Each front end provides its own hooks, for toplev.c. */ +/* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; /* Tree code classes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, -const char tree_code_type[] = { +const enum tree_code_class tree_code_type[] = { #include "tree.def" - 'x', + tcc_exceptional, #include "c-common.def" - 'x', + tcc_exceptional, #include "cp-tree.def" }; #undef DEFTREECODE @@ -233,182 +95,53 @@ const char *const tree_code_name[] = { }; #undef DEFTREECODE -/* Check if a C++ type is safe for aliasing. - Return TRUE if T safe for aliasing FALSE otherwise. */ +/* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c; + there should be very few routines below. */ -static bool -ok_to_generate_alias_set_for_type (tree t) +/* The following function does something real, but only in Objective-C++. */ + +tree +objcp_tsubst_copy_and_build (tree t ATTRIBUTE_UNUSED, + tree args ATTRIBUTE_UNUSED, + tsubst_flags_t complain ATTRIBUTE_UNUSED, + tree in_decl ATTRIBUTE_UNUSED, + bool function_p ATTRIBUTE_UNUSED) { - if (TYPE_PTRMEMFUNC_P (t)) - return true; - if (AGGREGATE_TYPE_P (t)) - { - if ((TREE_CODE (t) == RECORD_TYPE) || (TREE_CODE (t) == UNION_TYPE)) - { - tree fields; - /* Backend-created structs are safe. */ - if (! CLASS_TYPE_P (t)) - return true; - /* PODs are safe. */ - if (! CLASSTYPE_NON_POD_P(t)) - return true; - /* Classes with virtual baseclasses are not. */ - if (TYPE_USES_VIRTUAL_BASECLASSES (t)) - return false; - /* Recursively check the base classes. */ - if (TYPE_BINFO (t) != NULL && TYPE_BINFO_BASETYPES (t) != NULL) - { - int i; - for (i = 0; i < TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (t)); i++) - { - tree binfo = TREE_VEC_ELT (TYPE_BINFO_BASETYPES (t), i); - if (!ok_to_generate_alias_set_for_type (BINFO_TYPE (binfo))) - return false; - } - } - /* Check all the fields. */ - for (fields = TYPE_FIELDS (t); fields; fields = TREE_CHAIN (fields)) - { - if (TREE_CODE (fields) != FIELD_DECL) - continue; - if (! ok_to_generate_alias_set_for_type (TREE_TYPE (fields))) - return false; - } - return true; - } - else if (TREE_CODE (t) == ARRAY_TYPE) - return ok_to_generate_alias_set_for_type (TREE_TYPE (t)); - else - /* This should never happen, we dealt with all the aggregate - types that can appear in C++ above. */ - abort (); - } - else - return true; + return NULL_TREE; } -/* Special routine to get the alias set for C++. */ -static HOST_WIDE_INT -cxx_get_alias_set (tree t) -{ - if (TREE_CODE (t) == RECORD_TYPE - && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t)) - && CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t) - /* The base variant of a type must be in the same alias set as the - complete type. */ - return get_alias_set (TYPE_CONTEXT (t)); - - if (/* It's not yet safe to use alias sets for some classes in C++. */ - !ok_to_generate_alias_set_for_type (t) - /* Nor is it safe to use alias sets for pointers-to-member - functions, due to the fact that there may be more than one - RECORD_TYPE type corresponding to the same pointer-to-member - type. */ - || TYPE_PTRMEMFUNC_P (t)) - return 0; - - return c_common_get_alias_set (t); -} - -/* Called from check_global_declarations. */ - -static bool -cxx_warn_unused_global_decl (tree decl) -{ - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) - return false; - if (DECL_IN_SYSTEM_HEADER (decl)) - return false; - - /* Const variables take the place of #defines in C++. */ - if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl)) - return false; - - return true; -} - -/* Langhook for expr_size: Tell the backend that the value of an expression - of non-POD class type does not include any tail padding; a derived class - might have allocated something there. */ - -static tree -cp_expr_size (tree exp) -{ - if (CLASS_TYPE_P (TREE_TYPE (exp))) - { - /* The backend should not be interested in the size of an expression - of a type with both of these set; all copies of such types must go - through a constructor or assignment op. */ - if (TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (exp)) - && TYPE_HAS_COMPLEX_ASSIGN_REF (TREE_TYPE (exp)) - /* But storing a CONSTRUCTOR isn't a copy. */ - && TREE_CODE (exp) != CONSTRUCTOR) - abort (); - /* This would be wrong for a type with virtual bases, but they are - caught by the abort above. */ - return (is_empty_class (TREE_TYPE (exp)) - ? size_zero_node - : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp))); - } - else - /* Use the default code. */ - return lhd_expr_size (exp); -} - -/* Langhook for tree_size: determine size of our 'x' and 'c' nodes. */ -static size_t -cp_tree_size (enum tree_code code) -{ - switch (code) - { - case PTRMEM_CST: return sizeof (struct ptrmem_cst); - case BASELINK: return sizeof (struct tree_baselink); - case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index); - case DEFAULT_ARG: return sizeof (struct tree_default_arg); - case OVERLOAD: return sizeof (struct tree_overload); - case WRAPPER: return sizeof (struct tree_wrapper); - default: - abort (); - } - /* NOTREACHED */ -} - -/* Returns true if T is a variably modified type, in the sense of C99. - This routine needs only check cases that cannot be handled by the - language-independent logic in tree-inline.c. */ - -static bool -cp_var_mod_type_p (tree type) -{ - /* If TYPE is a pointer-to-member, it is variably modified if either - the class or the member are variably modified. */ - if (TYPE_PTR_TO_MEMBER_P (type)) - return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type)) - || variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type))); - - /* All other types are not variably modified. */ - return false; -} - -/* Stub routine to tell people that this doesn't work yet. */ -void -c_reset_state (void) -{ - sorry ("inter-module optimisations not implemented yet"); -} - -/* Construct a C++-aware pretty-printer for CONTEXT. It is assumed - that CONTEXT->printer is an already constructed basic pretty_printer. */ static void -cxx_initialize_diagnostics (diagnostic_context *context) +cp_init_ts (void) { - pretty_printer *base = context->printer; - cxx_pretty_printer *pp = xmalloc (sizeof (cxx_pretty_printer)); - memcpy (pp_base (pp), base, sizeof (pretty_printer)); - pp_cxx_pretty_printer_init (pp); - context->printer = (pretty_printer *) pp; + tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1; + tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1; + tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1; + + tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1; + tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1; + tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1; + + tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1; + tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1; + tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1; + + tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1; + tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1; + tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1; + + tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1; + tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1; + tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1; + + init_shadowed_var_for_decl (); - /* It is safe to free this object because it was previously malloc()'d. */ - free (base); } + +void +finish_file (void) +{ + cp_finish_file (); +} + +#include "gtype-cp.h" diff --git a/contrib/gcc/cp/cp-objcp-common.c b/contrib/gcc/cp/cp-objcp-common.c new file mode 100644 index 00000000000..f40be969695 --- /dev/null +++ b/contrib/gcc/cp/cp-objcp-common.c @@ -0,0 +1,263 @@ +/* Some code common to C++ and ObjC++ front ends. + Copyright (C) 2004 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "cp-tree.h" +#include "c-common.h" +#include "toplev.h" +#include "langhooks.h" +#include "langhooks-def.h" +#include "diagnostic.h" +#include "debug.h" +#include "cxx-pretty-print.h" +#include "cp-objcp-common.h" + +/* Special routine to get the alias set for C++. */ + +HOST_WIDE_INT +cxx_get_alias_set (tree t) +{ + if (IS_FAKE_BASE_TYPE (t)) + /* The base variant of a type must be in the same alias set as the + complete type. */ + return get_alias_set (TYPE_CONTEXT (t)); + + /* Punt on PMFs until we canonicalize functions properly. */ + if (TYPE_PTRMEMFUNC_P (t)) + return 0; + + return c_common_get_alias_set (t); +} + +/* Called from check_global_declarations. */ + +bool +cxx_warn_unused_global_decl (tree decl) +{ + if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) + return false; + if (DECL_IN_SYSTEM_HEADER (decl)) + return false; + + /* Const variables take the place of #defines in C++. */ + if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl)) + return false; + + return true; +} + +/* Langhook for expr_size: Tell the backend that the value of an expression + of non-POD class type does not include any tail padding; a derived class + might have allocated something there. */ + +tree +cp_expr_size (tree exp) +{ + tree type = TREE_TYPE (exp); + + if (CLASS_TYPE_P (type)) + { + /* The backend should not be interested in the size of an expression + of a type with both of these set; all copies of such types must go + through a constructor or assignment op. */ + gcc_assert (!TYPE_HAS_COMPLEX_INIT_REF (type) + || !TYPE_HAS_COMPLEX_ASSIGN_REF (type) + /* But storing a CONSTRUCTOR isn't a copy. */ + || TREE_CODE (exp) == CONSTRUCTOR + /* And, the gimplifier will sometimes make a copy of + an aggregate. In particular, for a case like: + + struct S { S(); }; + struct X { int a; S s; }; + X x = { 0 }; + + the gimplifier will create a temporary with + static storage duration, perform static + initialization of the temporary, and then copy + the result. Since the "s" subobject is never + constructed, this is a valid transformation. */ + || CP_AGGREGATE_TYPE_P (type)); + + /* This would be wrong for a type with virtual bases, but they are + caught by the assert above. */ + return (is_empty_class (type) + ? size_zero_node + : CLASSTYPE_SIZE_UNIT (type)); + } + else + /* Use the default code. */ + return lhd_expr_size (exp); +} + +/* Langhook for tree_size: determine size of our 'x' and 'c' nodes. */ +size_t +cp_tree_size (enum tree_code code) +{ + switch (code) + { + case TINST_LEVEL: return sizeof (struct tinst_level_s); + case PTRMEM_CST: return sizeof (struct ptrmem_cst); + case BASELINK: return sizeof (struct tree_baselink); + case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index); + case DEFAULT_ARG: return sizeof (struct tree_default_arg); + case OVERLOAD: return sizeof (struct tree_overload); + default: + gcc_unreachable (); + } + /* NOTREACHED */ +} + +/* Returns true if T is a variably modified type, in the sense of C99. + FN is as passed to variably_modified_p. + This routine needs only check cases that cannot be handled by the + language-independent logic in tree.c. */ + +bool +cp_var_mod_type_p (tree type, tree fn) +{ + /* If TYPE is a pointer-to-member, it is variably modified if either + the class or the member are variably modified. */ + if (TYPE_PTR_TO_MEMBER_P (type)) + return (variably_modified_type_p (TYPE_PTRMEM_CLASS_TYPE (type), fn) + || variably_modified_type_p (TYPE_PTRMEM_POINTED_TO_TYPE (type), + fn)); + + /* All other types are not variably modified. */ + return false; +} + +/* Construct a C++-aware pretty-printer for CONTEXT. It is assumed + that CONTEXT->printer is an already constructed basic pretty_printer. */ +void +cxx_initialize_diagnostics (diagnostic_context *context) +{ + pretty_printer *base = context->printer; + cxx_pretty_printer *pp = XNEW (cxx_pretty_printer); + memcpy (pp_base (pp), base, sizeof (pretty_printer)); + pp_cxx_pretty_printer_init (pp); + context->printer = (pretty_printer *) pp; + + /* It is safe to free this object because it was previously malloc()'d. */ + free (base); +} + +/* This compares two types for equivalence ("compatible" in C-based languages). + This routine should only return 1 if it is sure. It should not be used + in contexts where erroneously returning 0 causes problems. */ + +int +cxx_types_compatible_p (tree x, tree y) +{ + if (same_type_ignoring_top_level_qualifiers_p (x, y)) + return 1; + + /* Once we get to the middle-end, references and pointers are + interchangeable. FIXME should we try to replace all references with + pointers? */ + if (POINTER_TYPE_P (x) && POINTER_TYPE_P (y) + && TYPE_MODE (x) == TYPE_MODE (y) + && TYPE_REF_CAN_ALIAS_ALL (x) == TYPE_REF_CAN_ALIAS_ALL (y) + && same_type_p (TREE_TYPE (x), TREE_TYPE (y))) + return 1; + + return 0; +} + +tree +cxx_staticp (tree arg) +{ + switch (TREE_CODE (arg)) + { + case BASELINK: + return staticp (BASELINK_FUNCTIONS (arg)); + + default: + break; + } + + return NULL_TREE; +} + +/* Stubs to keep c-opts.c happy. */ +void +push_file_scope (void) +{ +} + +void +pop_file_scope (void) +{ +} + +/* c-pragma.c needs to query whether a decl has extern "C" linkage. */ +bool +has_c_linkage (tree decl) +{ + return DECL_EXTERN_C_P (decl); +} + +static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) + htab_t shadowed_var_for_decl; + +/* Lookup a shadowed var for FROM, and return it if we find one. */ + +tree +decl_shadowed_for_var_lookup (tree from) +{ + struct tree_map *h, in; + in.from = from; + + h = (struct tree_map *) htab_find_with_hash (shadowed_var_for_decl, &in, + htab_hash_pointer (from)); + if (h) + return h->to; + return NULL_TREE; +} + +/* Insert a mapping FROM->TO in the shadowed var hashtable. */ + +void +decl_shadowed_for_var_insert (tree from, tree to) +{ + struct tree_map *h; + void **loc; + + h = GGC_NEW (struct tree_map); + h->hash = htab_hash_pointer (from); + h->from = from; + h->to = to; + loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, h->hash, INSERT); + *(struct tree_map **) loc = h; +} + +void +init_shadowed_var_for_decl (void) +{ + shadowed_var_for_decl = htab_create_ggc (512, tree_map_hash, + tree_map_eq, 0); +} + + +#include "gt-cp-cp-objcp-common.h" diff --git a/contrib/gcc/cp/cp-objcp-common.h b/contrib/gcc/cp/cp-objcp-common.h new file mode 100644 index 00000000000..f420d93b191 --- /dev/null +++ b/contrib/gcc/cp/cp-objcp-common.h @@ -0,0 +1,169 @@ +/* Language hooks common to C++ and ObjC++ front ends. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +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, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ + +#ifndef GCC_CP_OBJCP_COMMON +#define GCC_CP_OBJCP_COMMON + +/* In cp/cp-lang.c and objcp/objcp-lang.c. */ + +extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, + tree, bool); + +/* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks + specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c, + respectively. */ + +#undef LANG_HOOKS_TREE_SIZE +#define LANG_HOOKS_TREE_SIZE cp_tree_size +#undef LANG_HOOKS_FINISH +#define LANG_HOOKS_FINISH cxx_finish +#undef LANG_HOOKS_CLEAR_BINDING_STACK +#define LANG_HOOKS_CLEAR_BINDING_STACK pop_everything +#undef LANG_HOOKS_INIT_OPTIONS +#define LANG_HOOKS_INIT_OPTIONS c_common_init_options +#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS +#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS cxx_initialize_diagnostics +#undef LANG_HOOKS_HANDLE_OPTION +#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option +#undef LANG_HOOKS_HANDLE_FILENAME +#define LANG_HOOKS_HANDLE_FILENAME c_common_handle_filename +#undef LANG_HOOKS_MISSING_ARGUMENT +#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument +#undef LANG_HOOKS_POST_OPTIONS +#define LANG_HOOKS_POST_OPTIONS c_common_post_options +#undef LANG_HOOKS_GET_ALIAS_SET +#define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set +#undef LANG_HOOKS_EXPAND_CONSTANT +#define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant +#undef LANG_HOOKS_EXPAND_EXPR +#define LANG_HOOKS_EXPAND_EXPR cxx_expand_expr +#undef LANG_HOOKS_EXPAND_DECL +#define LANG_HOOKS_EXPAND_DECL c_expand_decl +#undef LANG_HOOKS_PARSE_FILE +#define LANG_HOOKS_PARSE_FILE c_common_parse_file +#undef LANG_HOOKS_STATICP +#define LANG_HOOKS_STATICP cxx_staticp +#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL +#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl +#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME +#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl +#undef LANG_HOOKS_MARK_ADDRESSABLE +#define LANG_HOOKS_MARK_ADDRESSABLE cxx_mark_addressable +#undef LANG_HOOKS_PRINT_STATISTICS +#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics +#undef LANG_HOOKS_PRINT_XNODE +#define LANG_HOOKS_PRINT_XNODE cxx_print_xnode +#undef LANG_HOOKS_PRINT_DECL +#define LANG_HOOKS_PRINT_DECL cxx_print_decl +#undef LANG_HOOKS_PRINT_TYPE +#define LANG_HOOKS_PRINT_TYPE cxx_print_type +#undef LANG_HOOKS_PRINT_IDENTIFIER +#define LANG_HOOKS_PRINT_IDENTIFIER cxx_print_identifier +#undef LANG_HOOKS_TYPES_COMPATIBLE_P +#define LANG_HOOKS_TYPES_COMPATIBLE_P cxx_types_compatible_p +#undef LANG_HOOKS_PRINT_ERROR_FUNCTION +#define LANG_HOOKS_PRINT_ERROR_FUNCTION cxx_print_error_function +#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL +#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL cxx_warn_unused_global_decl +#undef LANG_HOOKS_WRITE_GLOBALS +#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing +#undef LANG_HOOKS_COMDAT_GROUP +#define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group + +#undef LANG_HOOKS_FUNCTION_INIT +#define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context +#undef LANG_HOOKS_FUNCTION_FINAL +#define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context +#undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P +#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p + +/* Attribute hooks. */ +#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE +#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table +#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE +#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table +#undef LANG_HOOKS_ATTRIBUTE_TABLE +#define LANG_HOOKS_ATTRIBUTE_TABLE cxx_attribute_table + +#undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES +#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \ + cp_walk_subtrees +#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN +#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ + cp_cannot_inline_tree_fn +#undef LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS +#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \ + cp_add_pending_fn_decls +#undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P +#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \ + cp_auto_var_in_fn_p +#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P +#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p +#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P +#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p +#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN +#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN cp_dump_tree +#undef LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN +#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN cp_type_quals +#undef LANG_HOOKS_EXPR_SIZE +#define LANG_HOOKS_EXPR_SIZE cp_expr_size + +#undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR +#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr +#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION +#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body + +#undef LANG_HOOKS_MAKE_TYPE +#define LANG_HOOKS_MAKE_TYPE cxx_make_type +#undef LANG_HOOKS_TYPE_FOR_MODE +#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode +#undef LANG_HOOKS_TYPE_FOR_SIZE +#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size +#undef LANG_HOOKS_SIGNED_TYPE +#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type +#undef LANG_HOOKS_UNSIGNED_TYPE +#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type +#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE +#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type +#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR +#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error +#undef LANG_HOOKS_TYPE_PROMOTES_TO +#define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to +#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE +#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type +#undef LANG_HOOKS_TO_TARGET_CHARSET +#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset +#undef LANG_HOOKS_GIMPLIFY_EXPR +#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr +#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING +#define LANG_HOOKS_OMP_PREDETERMINED_SHARING cxx_omp_predetermined_sharing +#undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR +#define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR cxx_omp_clause_default_ctor +#undef LANG_HOOKS_OMP_CLAUSE_COPY_CTOR +#define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR cxx_omp_clause_copy_ctor +#undef LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP +#define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP cxx_omp_clause_assign_op +#undef LANG_HOOKS_OMP_CLAUSE_DTOR +#define LANG_HOOKS_OMP_CLAUSE_DTOR cxx_omp_clause_dtor +#undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE +#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference + +#endif /* GCC_CP_OBJCP_COMMON */ diff --git a/contrib/gcc/cp/cp-tree.def b/contrib/gcc/cp/cp-tree.def index f6a2bee8d57..55ef21ef790 100644 --- a/contrib/gcc/cp/cp-tree.def +++ b/contrib/gcc/cp/cp-tree.def @@ -1,8 +1,8 @@ /* This file contains the definitions and documentation for the additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). - Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -19,10 +19,10 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + - /* An OFFSET_REF is used in two situations: 1. An expression of the form `A::m' where `A' is a class and `m' is @@ -31,66 +31,61 @@ Boston, MA 02111-1307, USA. */ BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m'). The expression is a pointer-to-member if its address is taken, - but simply denotes a member of the object if its address isnot - taken. In the latter case, resolve_offset_ref is used to - convert it to a representation of the member referred to by the - OFFSET_REF. - + but simply denotes a member of the object if its address is not + taken. + This form is only used during the parsing phase; once semantic analysis has taken place they are eliminated. 2. An expression of the form `x.*p'. In this case, operand 0 will be an expression corresponding to `x' and operand 1 will be an expression with pointer-to-member type. */ -DEFTREECODE (OFFSET_REF, "offset_ref", 'r', 2) +DEFTREECODE (OFFSET_REF, "offset_ref", tcc_reference, 2) /* A pointer-to-member constant. For a pointer-to-member constant `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the PTRMEM_CST_MEMBER is the _DECL for `Y'. */ -DEFTREECODE (PTRMEM_CST, "ptrmem_cst", 'c', 0) +DEFTREECODE (PTRMEM_CST, "ptrmem_cst", tcc_constant, 0) /* For NEW_EXPR, operand 0 is the placement list. Operand 1 is the new-declarator. - Operand 2 is the initializer. */ -DEFTREECODE (NEW_EXPR, "nw_expr", 'e', 3) -DEFTREECODE (VEC_NEW_EXPR, "vec_nw_expr", 'e', 3) + Operand 2 is the number of elements in the array. + Operand 3 is the initializer. */ +DEFTREECODE (NEW_EXPR, "nw_expr", tcc_expression, 4) +DEFTREECODE (VEC_NEW_EXPR, "vec_nw_expr", tcc_expression, 3) /* For DELETE_EXPR, operand 0 is the store to be destroyed. Operand 1 is the value to pass to the destroying function saying whether the store should be deallocated as well. */ -DEFTREECODE (DELETE_EXPR, "dl_expr", 'e', 2) -DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", 'e', 2) +DEFTREECODE (DELETE_EXPR, "dl_expr", tcc_expression, 2) +DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", tcc_expression, 2) /* Value is reference to particular overloaded class method. Operand 0 is the class, operand 1 is the field The COMPLEXITY field holds the class level (usually 0). */ -DEFTREECODE (SCOPE_REF, "scope_ref", 'r', 2) +DEFTREECODE (SCOPE_REF, "scope_ref", tcc_reference, 2) /* When composing an object with a member, this is the result. Operand 0 is the object. Operand 1 is the member (usually a dereferenced pointer to member). */ -DEFTREECODE (MEMBER_REF, "member_ref", 'r', 2) +DEFTREECODE (MEMBER_REF, "member_ref", tcc_reference, 2) /* Type conversion operator in C++. TREE_TYPE is type that this operator converts to. Operand is expression to be converted. */ -DEFTREECODE (TYPE_EXPR, "type_expr", 'e', 1) +DEFTREECODE (TYPE_EXPR, "type_expr", tcc_expression, 1) /* For AGGR_INIT_EXPR, operand 0 is function which performs initialization, operand 1 is argument list to initialization function, and operand 2 is the slot which was allocated for this expression. */ -DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", 'e', 3) +DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", tcc_expression, 3) /* A throw expression. operand 0 is the expression, if there was one, else it is NULL_TREE. */ -DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1) +DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1) /* An empty class object. The TREE_TYPE gives the class type. We use these to avoid actually creating instances of the empty classes. */ -DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0) - -/* A DECL which is really just a placeholder for an expression. Used to - implement non-class scope anonymous unions. */ -DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0) +DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0) /* A reference to a member function or member functions from a base class. BASELINK_FUNCTIONS gives the FUNCTION_DECL, @@ -98,44 +93,44 @@ DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0) functions. BASELINK_BINFO gives the base from which the functions come, i.e., the base to which the `this' pointer must be converted before the functions are called. BASELINK_ACCESS_BINFO gives the - base used to name the functions. + base used to name the functions. A BASELINK is an expression; the TREE_TYPE of the BASELINK gives the type of the expression. This type is either a FUNCTION_TYPE, METHOD_TYPE, or `unknown_type_node' indicating that the function is - overloaded. */ -DEFTREECODE (BASELINK, "baselink", 'x', 0) + overloaded. */ +DEFTREECODE (BASELINK, "baselink", tcc_exceptional, 0) /* Template definition. The following fields have the specified uses, although there are other macros in cp-tree.h that should be used for accessing this data. - DECL_ARGUMENTS template parm vector - DECL_TEMPLATE_INFO template text &c + DECL_ARGUMENTS template parm vector + DECL_TEMPLATE_INFO template text &c DECL_VINDEX list of instantiations already produced; only done for functions so far For class template: - DECL_INITIAL associated templates (methods &c) - DECL_TEMPLATE_RESULT null + DECL_INITIAL associated templates (methods &c) + DECL_TEMPLATE_RESULT null For non-class templates: TREE_TYPE type of object to be constructed - DECL_TEMPLATE_RESULT decl for object to be created - (e.g., FUNCTION_DECL with tmpl parms used) + DECL_TEMPLATE_RESULT decl for object to be created + (e.g., FUNCTION_DECL with tmpl parms used) */ -DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0) +DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) /* Index into a template parameter list. The TEMPLATE_PARM_IDX gives the index (from 0) of the parameter, while the TEMPLATE_PARM_LEVEL gives the level (from 1) of the parameter. Here's an example: - + template // Index 0, Level 1. struct S { template // Index 1, Level 2. + class V> // Index 1, Level 2. void f(); - }; + }; The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended from this one. The first descendant will have the same IDX, but @@ -149,91 +144,102 @@ DEFTREECODE (TEMPLATE_DECL, "template_decl", 'd', 0) struct S { template // Index 1, Level 1, Orig Level 2 + class V> // Index 1, Level 1, Orig Level 2 void f(); }; - + The LEVEL is the level of the parameter when we are worrying about the types of things; the ORIG_LEVEL is the level when we are worrying about instantiating things. */ -DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", 'x', 0) - -/* Index into a template parameter list. This parameter must be a type. - The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. */ -DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", 't', 0) +DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", tcc_exceptional, 0) /* Index into a template parameter list for template template parameters. - This parameter must be a type. The TYPE_FIELDS value will be a + This parameter must be a type. The TYPE_FIELDS value will be a TEMPLATE_PARM_INDEX. - It is used without template arguments like TT in C, + It is used without template arguments like TT in C, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO is NULL_TREE and TYPE_NAME is a TEMPLATE_DECL. */ -DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", 't', 0) +DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0) -/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments - like TT. - In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the - template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */ -DEFTREECODE (BOUND_TEMPLATE_TEMPLATE_PARM, "bound_template_template_parm", 't', 0) +/* The ordering of the following codes is optimized for the checking + macros in tree.h. Changing the order will degrade the speed of the + compiler. TEMPLATE_TYPE_PARM, TYPENAME_TYPE, TYPEOF_TYPE, + BOUND_TEMPLATE_TEMPLATE_PARM. */ + +/* Index into a template parameter list. This parameter must be a type. + The type.values field will be a TEMPLATE_PARM_INDEX. */ +DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", tcc_type, 0) /* A type designated by `typename T::t'. TYPE_CONTEXT is `T', TYPE_NAME is an IDENTIFIER_NODE for `t'. If the type was named via template-id, TYPENAME_TYPE_FULLNAME will hold the TEMPLATE_ID_EXPR. - If TREE_TYPE is present, this type was generated by the implicit - typename extension, and the TREE_TYPE is a _TYPE from a baseclass - of `T'. */ -DEFTREECODE (TYPENAME_TYPE, "typename_type", 't', 0) + TREE_TYPE is always NULL. */ +DEFTREECODE (TYPENAME_TYPE, "typename_type", tcc_type, 0) + +/* A type designated by `__typeof (expr)'. TYPEOF_TYPE_EXPR is the + expression in question. */ +DEFTREECODE (TYPEOF_TYPE, "typeof_type", tcc_type, 0) + +/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments + like TT. + In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the + template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */ +DEFTREECODE (BOUND_TEMPLATE_TEMPLATE_PARM, "bound_template_template_parm", + tcc_type, 0) /* For template template argument of the form `T::template C'. TYPE_CONTEXT is `T', the template parameter dependent object. TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */ -DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", 't', 0) +DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0) -/* A type designated by `__typeof (expr)'. TYPE_FIELDS is the - expression in question. */ -DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0) +/* A using declaration. USING_DECL_SCOPE contains the specified + scope. In a member using decl, unless DECL_DEPENDENT_P is true, + USING_DECL_DECLS contains the _DECL or OVERLOAD so named. This is + not an alias, but is later expanded into multiple aliases. */ +DEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0) -/* A using declaration. DECL_INITIAL contains the specified scope. - This is not an alias, but is later expanded into multiple aliases. - The decl will have a NULL_TYPE iff the scope is a dependent scope, - otherwise it will have a void type. */ -DEFTREECODE (USING_DECL, "using_decl", 'd', 0) +/* A using directive. The operand is USING_STMT_NAMESPACE. */ +DEFTREECODE (USING_STMT, "using_directive", tcc_statement, 1) -/* A using directive. The operand is USING_STMT_NAMESPACE. */ -DEFTREECODE (USING_STMT, "using_directive", 'e', 1) - -/* An un-parsed default argument. - TREE_CHAIN is used to hold instantiations of functions that had to - be instantiated before the argument was parsed. */ -DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 0) +/* An un-parsed default argument. Holds a vector of input tokens and + a vector of places where the argument was instantiated before + parsing had occurred. */ +DEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0) /* A template-id, like foo. The first operand is the template. The second is NULL if there are no explicit arguments, or a TREE_VEC of arguments. The template will be a FUNCTION_DECL, TEMPLATE_DECL, or an OVERLOAD. If the template-id refers to a member template, the template may be an IDENTIFIER_NODE. */ -DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2) +DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2) -/* A list-like node for chaining overloading candidates. TREE_TYPE is +/* A list-like node for chaining overloading candidates. TREE_TYPE is the original name, and the parameter is the FUNCTION_DECL. */ -DEFTREECODE (OVERLOAD, "overload", 'x', 0) +DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0) -/* A generic wrapper for something not tree that we want to include in - tree structure. */ -DEFTREECODE (WRAPPER, "wrapper", 'x', 0) +/* A pseudo-destructor, of the form "OBJECT.~DESTRUCTOR" or + "OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The + second operand (if non-NULL) is the SCOPE. The third operand is + the TYPE node corresponding to the DESTRUCTOR. The type of the + first operand will always be a scalar type. + + The type of a PSEUDO_DTOR_EXPR is always "void", even though it can + be used as if it were a zero-argument function. We handle the + function-call case specially, and giving it "void" type prevents it + being used in expressions in ways that are not permitted. */ +DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3) /* A whole bunch of tree codes for the initial, superficial parsing of templates. */ -DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3) -DEFTREECODE (CAST_EXPR, "cast_expr", '1', 1) -DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", '1', 1) -DEFTREECODE (CONST_CAST_EXPR, "const_cast_expr", '1', 1) -DEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", '1', 1) -DEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", '1', 1) -DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", 'e', 2) -DEFTREECODE (TYPEID_EXPR, "typeid_expr", 'e', 1) -DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3) +DEFTREECODE (MODOP_EXPR, "modop_expr", tcc_expression, 3) +DEFTREECODE (CAST_EXPR, "cast_expr", tcc_unary, 1) +DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", tcc_unary, 1) +DEFTREECODE (CONST_CAST_EXPR, "const_cast_expr", tcc_unary, 1) +DEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", tcc_unary, 1) +DEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", tcc_unary, 1) +DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", tcc_expression, 2) +DEFTREECODE (TYPEID_EXPR, "typeid_expr", tcc_expression, 1) /* A placeholder for an expression that is not type-dependent, but does occur in a template. When an expression that is not @@ -243,45 +249,98 @@ DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", 'e', 3) that expression if it appeared in a template argument list. In that situation, we create a NON_DEPENDENT_EXPR to take the place of the original expression. The expression is the only operand -- it - is only needed for diagnostics. */ -DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", 'e', 1) + is only needed for diagnostics. */ +DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", tcc_expression, 1) /* CTOR_INITIALIZER is a placeholder in template code for a call to setup_vtbl_pointer (and appears in all functions, not just ctors). */ -DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", 'e', 1) -DEFTREECODE (TRY_BLOCK, "try_block", 'e', 2) -DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", 'e', 2) +DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", tcc_expression, 1) + +DEFTREECODE (TRY_BLOCK, "try_block", tcc_statement, 2) + +DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", tcc_statement, 2) + /* A HANDLER wraps a catch handler for the HANDLER_TYPE. If this is CATCH_ALL_TYPE, then the handler catches all types. The declaration of the catch variable is in HANDLER_PARMS, and the body block in HANDLER_BODY. */ -DEFTREECODE (HANDLER, "handler", 'e', 2) +DEFTREECODE (HANDLER, "handler", tcc_statement, 2) /* A MUST_NOT_THROW_EXPR wraps an expression that may not throw, and must call terminate if it does. */ -DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", 'e', 1) +DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", tcc_expression, 1) -DEFTREECODE (TAG_DEFN, "tag_defn", 'e', 0) +/* A CLEANUP_STMT marks the point at which a declaration is fully + constructed. The CLEANUP_EXPR is run on behalf of CLEANUP_DECL + when CLEANUP_BODY completes. */ +DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3) -/* The following codes are used to represent implicit conversion - sequences, in the sense of [over.best.ics]. The conversion - sequences are connected through their first operands, with the - first conversion to be performed at the end of the chain. +/* Represents an 'if' statement. The operands are IF_COND, + THEN_CLAUSE, and ELSE_CLAUSE, respectively. */ +/* ??? It is currently still necessary to distinguish between IF_STMT + and COND_EXPR for the benefit of templates. */ +DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) - The innermost conversion (i.e, the one at the end of the chain) is - always an IDENTITY_CONV, corresponding to the identity conversion. */ +/* Used to represent a `for' statement. The operands are + FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ +DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 4) -DEFTREECODE (IDENTITY_CONV, "identity_conv", 'e', 1) -DEFTREECODE (LVALUE_CONV, "lvalue_conv", 'e', 1) -DEFTREECODE (QUAL_CONV, "qual_conv", 'e', 1) -DEFTREECODE (STD_CONV, "std_conv", 'e', 1) -DEFTREECODE (PTR_CONV, "ptr_conv", 'e', 1) -DEFTREECODE (PMEM_CONV, "pmem_conv", 'e', 1) -DEFTREECODE (BASE_CONV, "base_conv", 'e', 1) -DEFTREECODE (REF_BIND, "ref_bind", 'e', 1) -DEFTREECODE (USER_CONV, "user_conv", 'e', 2) -DEFTREECODE (AMBIG_CONV, "ambig_conv", 'e', 1) -DEFTREECODE (RVALUE_CONV, "rvalue_conv", 'e', 1) +/* Used to represent a 'while' statement. The operands are WHILE_COND + and WHILE_BODY, respectively. */ +DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) + +/* Used to represent a 'do' statement. The operands are DO_BODY and + DO_COND, respectively. */ +DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2) + +/* Used to represent a 'break' statement. */ +DEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0) + +/* Used to represent a 'continue' statement. */ +DEFTREECODE (CONTINUE_STMT, "continue_stmt", tcc_statement, 0) + +/* Used to represent a 'switch' statement. The operands are + SWITCH_STMT_COND, SWITCH_STMT_BODY and SWITCH_STMT_TYPE, respectively. */ +DEFTREECODE (SWITCH_STMT, "switch_stmt", tcc_statement, 3) + +/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to + obtain the expression. */ +DEFTREECODE (EXPR_STMT, "expr_stmt", tcc_expression, 1) + +DEFTREECODE (TAG_DEFN, "tag_defn", tcc_expression, 0) + +/* Template instantiation level node. + + TINST_DECL contains the original DECL node. + TINST_LOCATION contains the location where the template is instantiated. + TINST_IN_SYSTEM_HEADER_P is true if the location is in a system header. + + A stack of template instantiation nodes is kept through the TREE_CHAIN + fields of these nodes. */ + +DEFTREECODE (TINST_LEVEL, "TINST_LEVEL", tcc_exceptional, 0) + +/* Represents an 'offsetof' expression during template expansion. */ +DEFTREECODE (OFFSETOF_EXPR, "offsetof_expr", tcc_expression, 1) + +/* Represents a 'sizeof' expression during template expansion. */ +DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_expression, 1) + +/* Represents the -> operator during template expansion. */ +DEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1) + +/* Represents an '__alignof__' expression during template + expansion. */ +DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_expression, 1) + +/* A STMT_EXPR represents a statement-expression during template + expansion. This is the GCC extension { ( ... ) }. The + STMT_EXPR_STMT is the statement given by the expression. */ +DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1) + +/* Unary plus. Operand 0 is the expression to which the unary plus + is applied. */ +DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1) /* Local variables: diff --git a/contrib/gcc/cp/cp-tree.h b/contrib/gcc/cp/cp-tree.h index cc1f937e19d..7cdf362bf8a 100644 --- a/contrib/gcc/cp/cp-tree.h +++ b/contrib/gcc/cp/cp-tree.h @@ -1,6 +1,6 @@ /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H @@ -27,62 +27,68 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "hashtab.h" #include "splay-tree.h" +#include "vec.h" #include "varray.h" - #include "c-common.h" #include "name-lookup.h" - struct diagnostic_context; /* Usage of TREE_LANG_FLAG_?: - 0: BINFO_MARKED (BINFO nodes). - IDENTIFIER_MARKED (IDENTIFIER_NODEs) + 0: IDENTIFIER_MARKED (IDENTIFIER_NODEs) NEW_EXPR_USE_GLOBAL (in NEW_EXPR). DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR). COMPOUND_EXPR_OVERLOADED (in COMPOUND_EXPR). TREE_INDIRECT_USING (in NAMESPACE_DECL). - ICS_USER_FLAG (in _CONV) CLEANUP_P (in TRY_BLOCK) AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR) PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF) - PARMLIST_ELLIPSIS_P (in PARMLIST) + PAREN_STRING_LITERAL (in STRING_CST) DECL_PRETTY_FUNCTION_P (in VAR_DECL) KOENIG_LOOKUP_P (in CALL_EXPR) - 1: IDENTIFIER_VIRTUAL_P. + STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST). + EXPR_STMT_STMT_EXPR_RESULT (in EXPR_STMT) + STMT_EXPR_NO_SCOPE (in STMT_EXPR) + BIND_EXPR_TRY_BLOCK (in BIND_EXPR) + TYPENAME_IS_ENUM_P (in TYPENAME_TYPE) + REFERENCE_REF_P (in INDIRECT_EXPR) + QUALIFIED_NAME_IS_TEMPLATE (in SCOPE_REF) + OMP_ATOMIC_DEPENDENT_P (in OMP_ATOMIC) + OMP_FOR_GIMPLIFYING_P (in OMP_FOR) + BASELINK_QUALIFIED_P (in BASELINK) + TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR) + 1: IDENTIFIER_VIRTUAL_P (in IDENTIFIER_NODE) TI_PENDING_TEMPLATE_FLAG. TEMPLATE_PARMS_FOR_INLINE. DELETE_EXPR_USE_VEC (in DELETE_EXPR). (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out). - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (in _TYPE). ICS_ELLIPSIS_FLAG (in _CONV) - BINFO_DEPENDENT_BASE_P (in BINFO) DECL_INITIALIZED_P (in VAR_DECL) - 2: IDENTIFIER_OPNAME_P. - TYPE_POLYMORPHIC_P (in _TYPE) + TYPENAME_IS_CLASS_P (in TYPENAME_TYPE) + STMT_IS_FULL_EXPR_P (in _STMT) + 2: IDENTIFIER_OPNAME_P (in IDENTIFIER_NODE) ICS_THIS_FLAG (in _CONV) - BINFO_LOST_PRIMARY_P (in BINFO) - TREE_PARMLIST (in TREE_LIST) DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL) - 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE). - BINFO_VTABLE_PATH_MARKED. - BINFO_PUSHDECLS_MARKED. - (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out). + STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST) + 3: (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out). ICS_BAD_FLAG (in _CONV) FN_TRY_BLOCK_P (in TRY_BLOCK) IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE) - 4: BINFO_NEW_VTABLE_MARKED. - TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, - or FIELD_DECL). - NEED_TEMPORARY_P (in REF_BIND, BASE_CONV) + BIND_EXPR_BODY_BLOCK (in BIND_EXPR) + DECL_NON_TRIVIALLY_INITIALIZED_P (in VAR_DECL) + 4: TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, + or FIELD_DECL). IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE) + DECL_TINFO_P (in VAR_DECL) 5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE) DECL_VTABLE_OR_VTT_P (in VAR_DECL) - 6: For future expansion + 6: IDENTIFIER_REPO_CHOSEN (in IDENTIFIER_NODE) + DECL_CONSTRUCTION_VTABLE_P (in VAR_DECL) + TYPE_MARKED_P (in _TYPE) Usage of TYPE_LANG_FLAG_?: 0: TYPE_DEPENDENT_P 1: TYPE_HAS_CONSTRUCTOR. - 2: TYPE_HAS_DESTRUCTOR. + 2: Unused 3: TYPE_FOR_JAVA. 4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR 5: IS_AGGR_TYPE. @@ -93,30 +99,31 @@ struct diagnostic_context; DECL_TEMPLATE_PARM_P (in PARM_DECL, CONST_DECL, TYPE_DECL, or TEMPLATE_DECL) DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL) DECL_MUTABLE_P (in FIELD_DECL) + DECL_DEPENDENT_P (in USING_DECL) 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL). DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL) + DECL_MEMBER_TEMPLATE_P (in TEMPLATE_DECL) 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL). DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL) 3: DECL_IN_AGGR_P. 4: DECL_C_BIT_FIELD (in a FIELD_DECL) DECL_VAR_MARKED_P (in a VAR_DECL) DECL_SELF_REFERENCE_P (in a TYPE_DECL) + DECL_INVALID_OVERRIDER_P (in a FUNCTION_DECL) 5: DECL_INTERFACE_KNOWN. 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL). + DECL_FIELD_IS_BASE (in FIELD_DECL) 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL). DECL_THUNK_P (in a member FUNCTION_DECL) Usage of language-independent fields in a language-dependent manner: - TREE_USED - This field is BINFO_INDIRECT_PRIMARY_P in a BINFO. - TYPE_ALIAS_SET This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so forth as a substitute for the mark bits provided in `lang_type'. At present, only the six low-order bits are used. - TYPE_BINFO + TYPE_LANG_SLOT_1 For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO. For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS @@ -132,7 +139,7 @@ struct diagnostic_context; of the base class. The BV_VCALL_INDEX of each node, if non-NULL, gives the vtable - index of the vcall offset for this entry. + index of the vcall offset for this entry. The BV_FN is the declaration for the virtual function itself. @@ -157,63 +164,36 @@ struct diagnostic_context; /* Language-specific tree checkers. */ +#define VAR_OR_FUNCTION_DECL_CHECK(NODE) \ + TREE_CHECK2(NODE,VAR_DECL,FUNCTION_DECL) + +#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) \ + TREE_CHECK3(NODE,VAR_DECL,FUNCTION_DECL,PARM_DECL) + +#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) \ + TREE_CHECK4(NODE,VAR_DECL,FUNCTION_DECL,TYPE_DECL,TEMPLATE_DECL) + +#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) \ + TREE_CHECK(NODE,BOUND_TEMPLATE_TEMPLATE_PARM) + #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) - -#define VAR_OR_FUNCTION_DECL_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ - enum tree_code const __c = TREE_CODE(__t); \ - if (__c != VAR_DECL && __c != FUNCTION_DECL) \ - tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \ - __FUNCTION__); \ +#define NON_THUNK_FUNCTION_CHECK(NODE) __extension__ \ +({ const tree __t = (NODE); \ + if (TREE_CODE (__t) != FUNCTION_DECL && \ + TREE_CODE (__t) != TEMPLATE_DECL && __t->decl_common.lang_specific \ + && __t->decl_common.lang_specific->decl_flags.thunk_p) \ + tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ __t; }) - -#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ - enum tree_code const __c = TREE_CODE(__t); \ - if (__c != VAR_DECL \ - && __c != FUNCTION_DECL \ - && __c != PARM_DECL) \ - tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \ - __FUNCTION__); \ - __t; }) - -#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ - enum tree_code const __c = TREE_CODE(__t); \ - if (__c != VAR_DECL \ - && __c != FUNCTION_DECL \ - && __c != TYPE_DECL \ - && __c != TEMPLATE_DECL) \ - tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \ - __FUNCTION__); \ - __t; }) - -#define RECORD_OR_UNION_TYPE_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ - enum tree_code const __c = TREE_CODE(__t); \ - if (__c != RECORD_TYPE && __c != UNION_TYPE) \ - tree_check_failed (__t, RECORD_TYPE, __FILE__, __LINE__, \ - __FUNCTION__); \ - __t; }) - -#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ - enum tree_code const __c = TREE_CODE(__t); \ - if (__c != BOUND_TEMPLATE_TEMPLATE_PARM) \ - tree_check_failed (__t, BOUND_TEMPLATE_TEMPLATE_PARM, \ - __FILE__, __LINE__, __FUNCTION__); \ - __t; }) - -#else /* not ENABLE_TREE_CHECKING, or not gcc */ - -#define VAR_OR_FUNCTION_DECL_CHECK(NODE) (NODE) -#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) (NODE) -#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) (NODE) -#define RECORD_OR_UNION_TYPE_CHECK(NODE) (NODE) -#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE) (NODE) - +#define THUNK_FUNCTION_CHECK(NODE) __extension__ \ +({ const tree __t = (NODE); \ + if (TREE_CODE (__t) != FUNCTION_DECL || !__t->decl_common.lang_specific \ + || !__t->decl_common.lang_specific->decl_flags.thunk_p) \ + tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ + __t; }) +#else +#define NON_THUNK_FUNCTION_CHECK(NODE) (NODE) +#define THUNK_FUNCTION_CHECK(NODE) (NODE) #endif - /* Language-dependent contents of an identifier. */ @@ -222,11 +202,8 @@ struct lang_identifier GTY(()) struct c_common_identifier c_common; cxx_binding *namespace_bindings; cxx_binding *bindings; - tree class_value; tree class_template_info; tree label_value; - tree implicit_decl; - tree error_locus; }; /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a @@ -238,14 +215,24 @@ struct lang_identifier GTY(()) #define LANG_IDENTIFIER_CAST(NODE) \ ((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE)) -typedef struct template_parm_index_s GTY(()) +struct template_parm_index_s GTY(()) { struct tree_common common; HOST_WIDE_INT index; HOST_WIDE_INT level; HOST_WIDE_INT orig_level; tree decl; -} template_parm_index; +}; +typedef struct template_parm_index_s template_parm_index; + +struct tinst_level_s GTY(()) +{ + struct tree_common common; + tree decl; + location_t locus; + int in_system_header_p; +}; +typedef struct tinst_level_s * tinst_level_t; struct ptrmem_cst GTY(()) { @@ -266,7 +253,34 @@ typedef struct ptrmem_cst * ptrmem_cst_t; #define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \ set_namespace_binding ((NODE), current_namespace, (VAL)) -#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) +#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE)) + +#define BIND_EXPR_TRY_BLOCK(NODE) \ + TREE_LANG_FLAG_0 (BIND_EXPR_CHECK (NODE)) + +/* Used to mark the block around the member initializers and cleanups. */ +#define BIND_EXPR_BODY_BLOCK(NODE) \ + TREE_LANG_FLAG_3 (BIND_EXPR_CHECK (NODE)) +#define FUNCTION_NEEDS_BODY_BLOCK(NODE) \ + (DECL_CONSTRUCTOR_P (NODE) || DECL_DESTRUCTOR_P (NODE)) + +#define STATEMENT_LIST_NO_SCOPE(NODE) \ + TREE_LANG_FLAG_0 (STATEMENT_LIST_CHECK (NODE)) +#define STATEMENT_LIST_TRY_BLOCK(NODE) \ + TREE_LANG_FLAG_2 (STATEMENT_LIST_CHECK (NODE)) + +/* Nonzero if this statement should be considered a full-expression, + i.e., if temporaries created during this statement should have + their destructors run at the end of this statement. */ +#define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE)) + +/* Marks the result of a statement expression. */ +#define EXPR_STMT_STMT_EXPR_RESULT(NODE) \ + TREE_LANG_FLAG_0 (EXPR_STMT_CHECK (NODE)) + +/* Nonzero if this statement-expression does not have an associated scope. */ +#define STMT_EXPR_NO_SCOPE(NODE) \ + TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual sense of `same'. */ @@ -280,12 +294,12 @@ typedef struct ptrmem_cst * ptrmem_cst_t; /* Nonzero if we are presently building a statement tree, rather than expanding each statement as we encounter it. */ -#define building_stmt_tree() (last_tree != NULL_TREE) +#define building_stmt_tree() (cur_stmt_list != NULL_TREE) /* Returns nonzero iff NODE is a declaration for the global function `main'. */ #define DECL_MAIN_P(NODE) \ - (DECL_EXTERN_C_FUNCTION_P (NODE) \ + (DECL_EXTERN_C_FUNCTION_P (NODE) \ && DECL_NAME (NODE) != NULL_TREE \ && MAIN_NAME_P (DECL_NAME (NODE))) @@ -294,14 +308,14 @@ typedef struct ptrmem_cst * ptrmem_cst_t; (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function) #define OVL_CHAIN(NODE) TREE_CHAIN (NODE) /* Polymorphic access to FUNCTION and CHAIN. */ -#define OVL_CURRENT(NODE) \ +#define OVL_CURRENT(NODE) \ ((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE)) -#define OVL_NEXT(NODE) \ +#define OVL_NEXT(NODE) \ ((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE) /* If set, this was imported in a using declaration. This is not to confuse with being used somewhere, which is not important for this node. */ -#define OVL_USED(NODE) TREE_USED (NODE) +#define OVL_USED(NODE) TREE_USED (NODE) struct tree_overload GTY(()) { @@ -319,8 +333,8 @@ struct tree_overload GTY(()) a TEMPLATE_DECL, an OVERLOAD, or a TEMPLATE_ID_EXPR. */ #define BASELINK_FUNCTIONS(NODE) \ (((struct tree_baselink*) BASELINK_CHECK (NODE))->functions) -/* The BINFO in which the search for the functions indicated by this baselink - began. This base is used to determine the accessibility of functions +/* The BINFO in which the search for the functions indicated by this baselink + began. This base is used to determine the accessibility of functions selected by overload resolution. */ #define BASELINK_ACCESS_BINFO(NODE) \ (((struct tree_baselink*) BASELINK_CHECK (NODE))->access_binfo) @@ -331,6 +345,9 @@ struct tree_overload GTY(()) requested. */ #define BASELINK_OPTYPE(NODE) \ (TREE_CHAIN (BASELINK_CHECK (NODE))) +/* Non-zero if this baselink was from a qualified lookup. */ +#define BASELINK_QUALIFIED_P(NODE) \ + TREE_LANG_FLAG_0 (BASELINK_CHECK (NODE)) struct tree_baselink GTY(()) { @@ -340,15 +357,7 @@ struct tree_baselink GTY(()) tree access_binfo; }; -#define WRAPPER_ZC(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->z_c) - -struct tree_wrapper GTY(()) -{ - struct tree_common common; - struct z_candidate *z_c; -}; - -/* The different kinds of ids that we ecounter. */ +/* The different kinds of ids that we encounter. */ typedef enum cp_id_kind { @@ -381,19 +390,6 @@ typedef enum cp_id_kind #define IDENTIFIER_BINDING(NODE) \ (LANG_IDENTIFIER_CAST (NODE)->bindings) -/* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or - NULL_TREE if there is no binding. */ -#define IDENTIFIER_VALUE(NODE) \ - (IDENTIFIER_BINDING (NODE) ? IDENTIFIER_BINDING (NODE)->value : NULL) - -/* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current - class, and IDENTIFIER_CLASS_VALUE is the value binding. This is - just a pointer to the VALUE field of one of the bindings in the - IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is - IDENTIFIER_BINDING. */ -#define IDENTIFIER_CLASS_VALUE(NODE) \ - (LANG_IDENTIFIER_CAST (NODE)->class_value) - /* TREE_TYPE only indicates on local and class scope the current type. For namespace scope, the presence of a type in any namespace is indicated with global_type_node, and the real type behind must @@ -408,16 +404,6 @@ typedef enum cp_id_kind #define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE) \ IDENTIFIER_LABEL_VALUE (NODE) = (VALUE) -#define IDENTIFIER_IMPLICIT_DECL(NODE) \ - (LANG_IDENTIFIER_CAST (NODE)->implicit_decl) -#define SET_IDENTIFIER_IMPLICIT_DECL(NODE, VALUE) \ - IDENTIFIER_IMPLICIT_DECL (NODE) = (VALUE) - -#define IDENTIFIER_ERROR_LOCUS(NODE) \ - (LANG_IDENTIFIER_CAST (NODE)->error_locus) -#define SET_IDENTIFIER_ERROR_LOCUS(NODE, VALUE) \ - IDENTIFIER_ERROR_LOCUS (NODE) = (VALUE) - /* Nonzero if this identifier is used as a virtual function name somewhere (optimizes searches). */ #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1 (NODE) @@ -436,29 +422,35 @@ typedef enum cp_id_kind #define IDENTIFIER_CTOR_OR_DTOR_P(NODE) \ TREE_LANG_FLAG_3 (NODE) +/* True iff NAME is the DECL_ASSEMBLER_NAME for an entity with vague + linkage which the prelinker has assigned to this translation + unit. */ +#define IDENTIFIER_REPO_CHOSEN(NAME) \ + (TREE_LANG_FLAG_6 (NAME)) + /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ #define C_TYPE_FIELDS_READONLY(TYPE) \ (LANG_TYPE_CLASS_CHECK (TYPE)->fields_readonly) -/* Store a value in that field. */ -#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \ - (TREE_COMPLEXITY (EXP) = (int)(CODE)) - /* The tokens stored in the default argument. */ #define DEFARG_TOKENS(NODE) \ (((struct tree_default_arg *)DEFAULT_ARG_CHECK (NODE))->tokens) +#define DEFARG_INSTANTIATIONS(NODE) \ + (((struct tree_default_arg *)DEFAULT_ARG_CHECK (NODE))->instantiations) struct tree_default_arg GTY (()) { struct tree_common common; struct cp_token_cache *tokens; + VEC(tree,gc) *instantiations; }; enum cp_tree_node_structure_enum { TS_CP_GENERIC, TS_CP_IDENTIFIER, TS_CP_TPI, + TS_CP_TINST_LEVEL, TS_CP_PTRMEM, TS_CP_BINDING, TS_CP_OVERLOAD, @@ -475,10 +467,10 @@ union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"), union tree_node GTY ((tag ("TS_CP_GENERIC"), desc ("tree_node_structure (&%h)"))) generic; struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi; + struct tinst_level_s GTY ((tag ("TS_CP_TINST_LEVEL"))) tinst_level; struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem; struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload; struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink; - struct tree_wrapper GTY ((tag ("TS_CP_WRAPPER"))) wrapper; struct tree_default_arg GTY ((tag ("TS_CP_DEFAULT_ARG"))) default_arg; struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier; }; @@ -502,27 +494,14 @@ enum cp_tree_index CPTI_CLEANUP_TYPE, CPTI_VTT_PARM_TYPE, - CPTI_TI_DESC_TYPE, - CPTI_BLTN_DESC_TYPE, - CPTI_PTR_DESC_TYPE, - CPTI_ARY_DESC_TYPE, - CPTI_FUNC_DESC_TYPE, - CPTI_ENUM_DESC_TYPE, - CPTI_CLASS_DESC_TYPE, - CPTI_SI_CLASS_DESC_TYPE, - CPTI_VMI_CLASS_DESC_TYPE, - CPTI_PTM_DESC_TYPE, - CPTI_BASE_DESC_TYPE, - CPTI_CLASS_TYPE, CPTI_UNKNOWN_TYPE, CPTI_VTBL_TYPE, CPTI_VTBL_PTR_TYPE, CPTI_STD, CPTI_ABI, - CPTI_TYPE_INFO_TYPE, + CPTI_CONST_TYPE_INFO_TYPE, CPTI_TYPE_INFO_PTR_TYPE, - CPTI_TYPE_INFO_REF_TYPE, CPTI_ABORT_FNDECL, CPTI_GLOBAL_DELETE_FNDECL, CPTI_AGGR_TAG, @@ -548,7 +527,6 @@ enum cp_tree_index CPTI_LANG_NAME_JAVA, CPTI_EMPTY_EXCEPT_SPEC, - CPTI_NULL, CPTI_JCLASS, CPTI_TERMINATE, CPTI_CALL_UNEXPECTED, @@ -578,29 +556,16 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; pointer in pointer-to-member types. */ #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE] /* The type used to represent an index into the vtable. */ -#define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE] - -#define ti_desc_type_node cp_global_trees[CPTI_TI_DESC_TYPE] -#define bltn_desc_type_node cp_global_trees[CPTI_BLTN_DESC_TYPE] -#define ptr_desc_type_node cp_global_trees[CPTI_PTR_DESC_TYPE] -#define ary_desc_type_node cp_global_trees[CPTI_ARY_DESC_TYPE] -#define func_desc_type_node cp_global_trees[CPTI_FUNC_DESC_TYPE] -#define enum_desc_type_node cp_global_trees[CPTI_ENUM_DESC_TYPE] -#define class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE] -#define si_class_desc_type_node cp_global_trees[CPTI_SI_CLASS_DESC_TYPE] -#define vmi_class_desc_type_node cp_global_trees[CPTI_VMI_CLASS_DESC_TYPE] -#define ptm_desc_type_node cp_global_trees[CPTI_PTM_DESC_TYPE] -#define base_desc_type_node cp_global_trees[CPTI_BASE_DESC_TYPE] +#define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE] #define class_type_node cp_global_trees[CPTI_CLASS_TYPE] #define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE] #define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE] #define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE] #define std_node cp_global_trees[CPTI_STD] -#define abi_node cp_global_trees[CPTI_ABI] -#define type_info_type_node cp_global_trees[CPTI_TYPE_INFO_TYPE] +#define abi_node cp_global_trees[CPTI_ABI] +#define const_type_info_type_node cp_global_trees[CPTI_CONST_TYPE_INFO_TYPE] #define type_info_ptr_type cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE] -#define type_info_ref_type cp_global_trees[CPTI_TYPE_INFO_REF_TYPE] #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL] #define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL] #define current_aggr cp_global_trees[CPTI_AGGR_TAG] @@ -610,73 +575,70 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; /* The name of a constructor that takes an in-charge parameter to decide whether or not to construct virtual base classes. */ -#define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER] +#define ctor_identifier cp_global_trees[CPTI_CTOR_IDENTIFIER] /* The name of a constructor that constructs virtual base classes. */ -#define complete_ctor_identifier cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER] +#define complete_ctor_identifier cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER] /* The name of a constructor that does not construct virtual base classes. */ -#define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER] +#define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER] /* The name of a destructor that takes an in-charge parameter to decide whether or not to destroy virtual base classes and whether or not to delete the object. */ -#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER] +#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER] /* The name of a destructor that destroys virtual base classes. */ -#define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER] +#define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER] /* The name of a destructor that does not destroy virtual base classes. */ -#define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] +#define base_dtor_identifier cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER] /* The name of a destructor that destroys virtual base classes, and then deletes the entire object. */ -#define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] -#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] -#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] +#define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER] +#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER] +#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER] /* The name of the parameter that contains a pointer to the VTT to use for this subobject constructor or destructor. */ -#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER] -#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER] -#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER] -#define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER] -#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER] +#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER] +#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER] +#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER] +#define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER] +#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER] /* The name of the std namespace. */ -#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] -#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] -#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] -#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA] +#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER] +#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C] +#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS] +#define lang_name_java cp_global_trees[CPTI_LANG_NAME_JAVA] /* Exception specifier used for throw(). */ -#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] - -/* The node for `__null'. */ -#define null_node cp_global_trees[CPTI_NULL] +#define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */ -#define jclass_node cp_global_trees[CPTI_JCLASS] +#define jclass_node cp_global_trees[CPTI_JCLASS] /* The declaration for `std::terminate'. */ -#define terminate_node cp_global_trees[CPTI_TERMINATE] +#define terminate_node cp_global_trees[CPTI_TERMINATE] /* The declaration for "__cxa_call_unexpected". */ -#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED] +#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED] /* A pointer to `std::atexit'. */ -#define atexit_node cp_global_trees[CPTI_ATEXIT] +#define atexit_node cp_global_trees[CPTI_ATEXIT] /* A pointer to `__dso_handle'. */ -#define dso_handle_node cp_global_trees[CPTI_DSO_HANDLE] +#define dso_handle_node cp_global_trees[CPTI_DSO_HANDLE] /* The declaration of the dynamic_cast runtime. */ -#define dynamic_cast_node cp_global_trees[CPTI_DCAST] +#define dynamic_cast_node cp_global_trees[CPTI_DCAST] /* The type of a destructor. */ -#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE] +#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE] /* The type of the vtt parameter passed to subobject constructors and destructors. */ -#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE] +#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE] /* A TREE_LIST of the dynamic classes whose vtables may have to be emitted in this translation unit. */ -#define keyed_classes cp_global_trees[CPTI_KEYED_CLASSES] +#define keyed_classes cp_global_trees[CPTI_KEYED_CLASSES] /* Node to indicate default access. This must be distinct from the access nodes in tree.h. */ @@ -687,24 +649,24 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; struct saved_scope GTY(()) { - cxx_saved_binding *old_bindings; + VEC(cxx_saved_binding,gc) *old_bindings; tree old_namespace; tree decl_ns_list; tree class_name; tree class_type; tree access_specifier; tree function_decl; - varray_type lang_base; + VEC(tree,gc) *lang_base; tree lang_name; tree template_parms; - tree x_previous_class_type; - tree x_previous_class_values; + struct cp_binding_level *x_previous_class_level; tree x_saved_tree; HOST_WIDE_INT x_processing_template_decl; int x_processing_specialization; bool x_processing_explicit_instantiation; int need_pop_function_context; + bool skip_evaluation; struct stmt_tree_s x_stmt_tree; @@ -751,28 +713,31 @@ struct saved_scope GTY(()) #define processing_specialization scope_chain->x_processing_specialization #define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation -/* _TYPE: the previous type that was a class */ +/* The cached class binding level, from the most recently exited + class, or NULL if none. */ -#define previous_class_type scope_chain->x_previous_class_type - -/* This is a copy of the class_shadowed list of the previous class - binding contour when at global scope. It's used to reset - IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a - cache miss). */ - -#define previous_class_values scope_chain->x_previous_class_values +#define previous_class_level scope_chain->x_previous_class_level /* A list of private types mentioned, for deferred access checking. */ extern GTY(()) struct saved_scope *scope_chain; +struct cxx_int_tree_map GTY(()) +{ + unsigned int uid; + tree to; +}; + +extern unsigned int cxx_int_tree_map_hash (const void *); +extern int cxx_int_tree_map_eq (const void *, const void *); + /* Global state pertinent to the current function. */ struct language_function GTY(()) { struct c_language_function base; - tree x_dtor_label; + tree x_cdtor_label; tree x_current_class_ptr; tree x_current_class_ref; tree x_eh_spec_block; @@ -789,22 +754,22 @@ struct language_function GTY(()) /* True if this function can throw an exception. */ BOOL_BITFIELD can_throw : 1; - struct named_label_use_list *x_named_label_uses; - struct named_label_list *x_named_labels; + htab_t GTY((param_is(struct named_label_entry))) x_named_labels; struct cp_binding_level *bindings; - varray_type x_local_names; - - const char *cannot_inline; + VEC(tree,gc) *x_local_names; + htab_t GTY((param_is (struct cxx_int_tree_map))) extern_decl_map; }; /* The current C++-specific per-function global variables. */ #define cp_function_chain (cfun->language) -/* In a destructor, the point at which all derived class destroying - has been done, just before any base class destroying will be done. */ +/* In a constructor destructor, the point at which all derived class + destroying/construction has been has been done. Ie. just before a + constructor returns, or before any base class destroying will be done + in a destructor. */ -#define dtor_label cp_function_chain->x_dtor_label +#define cdtor_label cp_function_chain->x_cdtor_label /* When we're processing a member function, current_class_ptr is the PARM_DECL for the `this' pointer. The current_class_ref is an @@ -860,9 +825,9 @@ struct language_function GTY(()) /* True if NAME is the IDENTIFIER_NODE for an overloaded "operator new" or "operator delete". */ #define NEW_DELETE_OPNAME_P(NAME) \ - ((NAME) == ansi_opname (NEW_EXPR) \ - || (NAME) == ansi_opname (VEC_NEW_EXPR) \ - || (NAME) == ansi_opname (DELETE_EXPR) \ + ((NAME) == ansi_opname (NEW_EXPR) \ + || (NAME) == ansi_opname (VEC_NEW_EXPR) \ + || (NAME) == ansi_opname (DELETE_EXPR) \ || (NAME) == ansi_opname (VEC_DELETE_EXPR)) #define ansi_opname(CODE) \ @@ -873,15 +838,8 @@ struct language_function GTY(()) /* True if NODE is an erroneous expression. */ #define error_operand_p(NODE) \ - ((NODE) == error_mark_node \ + ((NODE) == error_mark_node \ || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) - -/* INTERFACE_ONLY nonzero means that we are in an "interface" - section of the compiler. INTERFACE_UNKNOWN nonzero means - we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN - is zero and INTERFACE_ONLY is zero, it means that we are responsible - for exporting definitions that others might need. */ -extern int interface_only, interface_unknown; /* C++ language-specific tree codes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, @@ -892,9 +850,10 @@ enum cplus_tree_code { }; #undef DEFTREECODE -#define cp_stmt_codes \ - CTOR_INITIALIZER, TRY_BLOCK, HANDLER, \ - EH_SPEC_BLOCK, USING_STMT, TAG_DEFN +/* TRUE if a tree code represents a statement. */ +extern bool statement_code_p[MAX_TREE_CODES]; + +#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] enum languages { lang_c, lang_cplusplus, lang_java }; @@ -905,11 +864,6 @@ enum languages { lang_c, lang_cplusplus, lang_java }; #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE))) #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE))) -#define TYPE_ASSEMBLER_NAME_STRING(NODE) \ - (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) -#define TYPE_ASSEMBLER_NAME_LENGTH(NODE) \ - (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) - /* Nonzero if NODE has no name for linkage purposes. */ #define TYPE_ANONYMOUS_P(NODE) \ (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE))) @@ -921,7 +875,8 @@ enum languages { lang_c, lang_cplusplus, lang_java }; for template type parameters, typename types, and instantiated template template parameters. Despite its name, this macro has nothing to do with the definition of aggregate given - in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */ + in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. Keep + these checks in ascending code order. */ #define IS_AGGR_TYPE(T) \ (TREE_CODE (T) == TEMPLATE_TYPE_PARM \ || TREE_CODE (T) == TYPENAME_TYPE \ @@ -937,9 +892,11 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* Nonzero if T is a class type. Zero for template type parameters, typename types, and so forth. */ #define CLASS_TYPE_P(T) \ - (IS_AGGR_TYPE_CODE (TREE_CODE (T)) && IS_AGGR_TYPE (T)) + (IS_AGGR_TYPE_CODE (TREE_CODE (T)) && TYPE_LANG_FLAG_5 (T)) -#define IS_AGGR_TYPE_CODE(T) ((T) == RECORD_TYPE || (T) == UNION_TYPE) +/* Keep these checks in ascending code order. */ +#define IS_AGGR_TYPE_CODE(T) \ + ((T) == RECORD_TYPE || (T) == UNION_TYPE) #define TAGGED_TYPE_P(T) \ (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE) #define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T) @@ -999,16 +956,27 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* Nonzero iff TYPE is uniquely derived from PARENT. Ignores accessibility. */ #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) \ - (lookup_base ((TYPE), (PARENT), ba_ignore | ba_quiet, NULL) != NULL_TREE) -/* Nonzero iff TYPE is accessible in the current scope and uniquely - derived from PARENT. */ -#define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \ - (lookup_base ((TYPE), (PARENT), ba_check | ba_quiet, NULL) != NULL_TREE) + (lookup_base ((TYPE), (PARENT), ba_unique | ba_quiet, NULL) != NULL_TREE) /* Nonzero iff TYPE is publicly & uniquely derived from PARENT. */ #define PUBLICLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \ - (lookup_base ((TYPE), (PARENT), ba_not_special | ba_quiet, NULL) \ - != NULL_TREE) - + (lookup_base ((TYPE), (PARENT), ba_ignore_scope | ba_check | ba_quiet, \ + NULL) != NULL_TREE) + +/* Gives the visibility specification for a class type. */ +#define CLASSTYPE_VISIBILITY(TYPE) \ + DECL_VISIBILITY (TYPE_NAME (TYPE)) +#define CLASSTYPE_VISIBILITY_SPECIFIED(TYPE) \ + DECL_VISIBILITY_SPECIFIED (TYPE_NAME (TYPE)) + +typedef struct tree_pair_s GTY (()) +{ + tree purpose; + tree value; +} tree_pair_s; +typedef tree_pair_s *tree_pair_p; +DEF_VEC_O (tree_pair_s); +DEF_VEC_ALLOC_O (tree_pair_s,gc); + /* This is a few header flags for 'struct lang_type'. Actually, all but the first are used only for lang_type_class; they are put in this structure to save space. */ @@ -1019,10 +987,11 @@ struct lang_type_header GTY(()) BOOL_BITFIELD has_type_conversion : 1; BOOL_BITFIELD has_init_ref : 1; BOOL_BITFIELD has_default_ctor : 1; - BOOL_BITFIELD uses_multiple_inheritance : 1; BOOL_BITFIELD const_needs_init : 1; BOOL_BITFIELD ref_needs_init : 1; BOOL_BITFIELD has_const_assign_ref : 1; + + BOOL_BITFIELD spare : 1; }; /* This structure provides additional information above and beyond @@ -1041,7 +1010,7 @@ struct lang_type_header GTY(()) struct lang_type_class GTY(()) { struct lang_type_header h; - + unsigned char align; unsigned has_mutable : 1; @@ -1061,25 +1030,27 @@ struct lang_type_class GTY(()) unsigned non_zero_init : 1; unsigned empty_p : 1; - unsigned marks: 6; unsigned vec_new_uses_cookie : 1; unsigned declared_class : 1; - + unsigned diamond_shaped : 1; + unsigned repeated_base : 1; unsigned being_defined : 1; - unsigned redefined : 1; + unsigned java_interface : 1; unsigned debug_requested : 1; - unsigned use_template : 2; unsigned fields_readonly : 1; + + unsigned use_template : 2; unsigned ptrmemfunc_flag : 1; unsigned was_anonymous : 1; + unsigned lazy_default_ctor : 1; + unsigned lazy_copy_ctor : 1; + unsigned lazy_assignment_op : 1; + unsigned lazy_destructor : 1; - unsigned has_real_assign_ref : 1; unsigned has_const_init_ref : 1; unsigned has_complex_init_ref : 1; unsigned has_complex_assign_ref : 1; - unsigned has_abstract_assign_ref : 1; unsigned non_aggregate : 1; - unsigned java_interface : 1; /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If @@ -1088,23 +1059,26 @@ struct lang_type_class GTY(()) /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ - unsigned dummy : 9; + unsigned dummy : 12; tree primary_base; - tree vfields; - tree vcall_indices; + VEC(tree_pair_s,gc) *vcall_indices; tree vtables; tree typeinfo_var; - tree vbases; + VEC(tree,gc) *vbases; binding_table nested_udts; tree as_base; - tree pure_virtuals; + VEC(tree,gc) *pure_virtuals; tree friend_classes; - tree GTY ((reorder ("resort_type_method_vec"))) methods; + VEC(tree,gc) * GTY((reorder ("resort_type_method_vec"))) methods; tree key_method; tree decl_list; tree template_info; tree befriending_classes; + /* In a RECORD_TYPE, information specific to Objective-C++, such + as a list of adopted protocols or a pointer to a corresponding + @interface. See objc/objc-act.h for details. */ + tree objc_info; }; struct lang_type_ptrmem GTY(()) @@ -1115,9 +1089,9 @@ struct lang_type_ptrmem GTY(()) struct lang_type GTY(()) { - union lang_type_u + union lang_type_u { - struct lang_type_header GTY((tag ("2"))) h; + struct lang_type_header GTY((skip (""))) h; struct lang_type_class GTY((tag ("1"))) c; struct lang_type_ptrmem GTY((tag ("0"))) ptrmem; } GTY((desc ("%h.h.is_lang_type_class"))) u; @@ -1144,18 +1118,11 @@ struct lang_type GTY(()) #endif /* ENABLE_TREE_CHECKING */ -/* Indicates whether or not (and how) a template was expanded for this class. - 0=no information yet/non-template class - 1=implicit template instantiation - 2=explicit template specialization - 3=explicit template instantiation */ -#define CLASSTYPE_USE_TEMPLATE(NODE) \ - (LANG_TYPE_CLASS_CHECK (NODE)->use_template) - /* Fields used for storing information before the class is defined. After the class is defined, these fields hold other information. */ -/* List of friends which were defined inline in this class definition. */ +/* VEC(tree) of friends which were defined inline in this class + definition. */ #define CLASSTYPE_INLINE_FRIENDS(NODE) CLASSTYPE_PURE_VIRTUALS (NODE) /* Nonzero for _CLASSTYPE means that operator delete is defined. */ @@ -1173,8 +1140,31 @@ struct lang_type GTY(()) #define TYPE_HAS_CONVERSION(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->h.has_type_conversion) +/* Nonzero means that NODE (a class type) has a default constructor -- + but that it has not yet been declared. */ +#define CLASSTYPE_LAZY_DEFAULT_CTOR(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->lazy_default_ctor) + +/* Nonzero means that NODE (a class type) has a copy constructor -- + but that it has not yet been declared. */ +#define CLASSTYPE_LAZY_COPY_CTOR(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->lazy_copy_ctor) + +/* Nonzero means that NODE (a class type) has an assignment operator + -- but that it has not yet been declared. */ +#define CLASSTYPE_LAZY_ASSIGNMENT_OP(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->lazy_assignment_op) + +/* Nonzero means that NODE (a class type) has a destructor -- but that + it has not yet been declared. */ +#define CLASSTYPE_LAZY_DESTRUCTOR(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->lazy_destructor) + /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */ #define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref) + +/* True iff the class type NODE has an "operator =" whose parameter + has a parameter of type "const X&". */ #define TYPE_HAS_CONST_ASSIGN_REF(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->h.has_const_assign_ref) @@ -1195,20 +1185,19 @@ struct lang_type GTY(()) /* Nonzero means that this type is being defined. I.e., the left brace starting the definition of this type has been seen. */ #define TYPE_BEING_DEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->being_defined) -/* Nonzero means that this type has been redefined. In this case, if - convenient, don't reprocess any methods that appear in its redefinition. */ -#define TYPE_REDEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->redefined) -/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses - multiple inheritance. If this is 0 for the root of a type - hierarchy, then we can use more efficient search techniques. */ -#define TYPE_USES_MULTIPLE_INHERITANCE(NODE) \ - (LANG_TYPE_CLASS_CHECK (NODE)->h.uses_multiple_inheritance) +/* Mark bits for repeated base checks. */ +#define TYPE_MARKED_P(NODE) TREE_LANG_FLAG_6 (TYPE_CHECK (NODE)) -/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses - virtual base classes. If this is 0 for the root of a type - hierarchy, then we can use more efficient search techniques. */ -#define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3 (NODE)) +/* Nonzero if the class NODE has multiple paths to the same (virtual) + base object. */ +#define CLASSTYPE_DIAMOND_SHAPED_P(NODE) \ + (LANG_TYPE_CLASS_CHECK(NODE)->diamond_shaped) + +/* Nonzero if the class NODE has multiple instances of the same base + type. */ +#define CLASSTYPE_REPEATED_BASE_P(NODE) \ + (LANG_TYPE_CLASS_CHECK(NODE)->repeated_base) /* The member function with which the vtable will be emitted: the first noninline non-pure-virtual member function. NULL_TREE @@ -1248,53 +1237,16 @@ struct lang_type GTY(()) /* A FUNCTION_DECL or OVERLOAD for the constructors for NODE. These are the constructors that take an in-charge parameter. */ #define CLASSTYPE_CONSTRUCTORS(NODE) \ - (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT)) + (VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT)) /* A FUNCTION_DECL for the destructor for NODE. These are the - destructors that take an in-charge parameter. */ + destructors that take an in-charge parameter. If + CLASSTYPE_LAZY_DESTRUCTOR is true, then this entry will be NULL + until the destructor is created with lazily_declare_fn. */ #define CLASSTYPE_DESTRUCTORS(NODE) \ - (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT)) - -/* Mark bits for depth-first and breath-first searches. */ - -/* Get the value of the Nth mark bit. */ -#define CLASSTYPE_MARKED_N(NODE, N) \ - (((CLASS_TYPE_P (NODE) ? LANG_TYPE_CLASS_CHECK (NODE)->marks \ - : ((unsigned) TYPE_ALIAS_SET (NODE))) & (1 << (N))) != 0) - -/* Set the Nth mark bit. */ -#define SET_CLASSTYPE_MARKED_N(NODE, N) \ - (CLASS_TYPE_P (NODE) \ - ? (void) (LANG_TYPE_CLASS_CHECK (NODE)->marks |= (1 << (N))) \ - : (void) (TYPE_ALIAS_SET (NODE) |= (1 << (N)))) - -/* Clear the Nth mark bit. */ -#define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \ - (CLASS_TYPE_P (NODE) \ - ? (void) (LANG_TYPE_CLASS_CHECK (NODE)->marks &= ~(1 << (N))) \ - : (void) (TYPE_ALIAS_SET (NODE) &= ~(1 << (N)))) - -/* Get the value of the mark bits. */ -#define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N (NODE, 0) -#define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N (NODE, 1) -#define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N (NODE, 2) -#define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N (NODE, 3) -#define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N (NODE, 4) -#define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N (NODE, 5) - -/* Macros to modify the above flags */ -#define SET_CLASSTYPE_MARKED(NODE) SET_CLASSTYPE_MARKED_N (NODE, 0) -#define CLEAR_CLASSTYPE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 0) -#define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N (NODE, 1) -#define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 1) -#define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N (NODE, 2) -#define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 2) -#define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N (NODE, 3) -#define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 3) -#define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N (NODE, 4) -#define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 4) -#define SET_CLASSTYPE_MARKED6(NODE) SET_CLASSTYPE_MARKED_N (NODE, 5) -#define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 5) + (CLASSTYPE_METHOD_VEC (NODE) \ + ? VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT) \ + : NULL_TREE) /* A dictionary of the nested user-defined-types (class-types, or enums) found within this class. This table includes nested member class @@ -1313,21 +1265,24 @@ struct lang_type GTY(()) #define CLASSTYPE_PRIMARY_BINFO(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->primary_base) -/* A chain of BINFOs for the direct and indirect virtual base classes +/* A vector of BINFOs for the direct and indirect virtual base classes that this type uses in a post-order depth-first left-to-right order. (In other words, these bases appear in the order that they should be initialized.) */ #define CLASSTYPE_VBASECLASSES(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vbases) -/* Number of direct baseclasses of NODE. */ -#define CLASSTYPE_N_BASECLASSES(NODE) \ - (BINFO_N_BASETYPES (TYPE_BINFO (NODE))) - /* The type corresponding to NODE when NODE is used as a base class, i.e., NODE without virtual base classes. */ #define CLASSTYPE_AS_BASE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->as_base) +/* True iff NODE is the CLASSTYPE_AS_BASE version of some type. */ + +#define IS_FAKE_BASE_TYPE(NODE) \ + (TREE_CODE (NODE) == RECORD_TYPE \ + && TYPE_CONTEXT (NODE) && CLASS_TYPE_P (TYPE_CONTEXT (NODE)) \ + && CLASSTYPE_AS_BASE (TYPE_CONTEXT (NODE)) == (NODE)) + /* These are the size and alignment of the type without its virtual base classes, for when we use this type as a base itself. */ #define CLASSTYPE_SIZE(NODE) TYPE_SIZE (CLASSTYPE_AS_BASE (NODE)) @@ -1339,14 +1294,16 @@ struct lang_type GTY(()) #define CLASSTYPE_ALIGN_UNIT(NODE) \ (CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT) -/* True if this a Java interface type, declared with +/* True if this a Java interface type, declared with '__attribute__ ((java_interface))'. */ -#define TYPE_JAVA_INTERFACE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->java_interface) +#define TYPE_JAVA_INTERFACE(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->java_interface) -/* A cons list of virtual functions which cannot be inherited by +/* A VEC(tree) of virtual functions which cannot be inherited by derived classes. When deriving from this type, the derived class must provide its own definition for each of these functions. */ -#define CLASSTYPE_PURE_VIRTUALS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->pure_virtuals) +#define CLASSTYPE_PURE_VIRTUALS(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->pure_virtuals) /* Nonzero means that this type has an X() constructor. */ #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \ @@ -1420,7 +1377,7 @@ struct lang_type GTY(()) way or the other. */ #define CLASSTYPE_INTERFACE_KNOWN(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown == 0) -/* The opposite of CLASSTYPE_INTERFANCE_KNOWN. */ +/* The opposite of CLASSTYPE_INTERFACE_KNOWN. */ #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->interface_unknown) @@ -1437,84 +1394,49 @@ struct lang_type GTY(()) /* Additional macros for inheritance information. */ -/* The BINFO_INHERITANCE_CHAIN is used opposite to the description in - gcc/tree.h. In particular if D is non-virtually derived from B - then the BINFO for B (in D) will have a BINFO_INHERITANCE_CHAIN - pointing to D. If D is virtually derived, its - BINFO_INHERITANCE_CHAIN will point to the most derived binfo. In - tree.h, this pointer is described as pointing in other - direction. The binfos of virtual bases are shared. */ - -/* Nonzero means marked by DFS or BFS search. */ -#define BINFO_MARKED(NODE) TREE_LANG_FLAG_0 (NODE) - /* Nonzero means that this class is on a path leading to a new vtable. */ -#define BINFO_VTABLE_PATH_MARKED(NODE) TREE_LANG_FLAG_3 (NODE) +#define BINFO_VTABLE_PATH_MARKED(NODE) BINFO_FLAG_1 (NODE) /* Nonzero means B (a BINFO) has its own vtable. Any copies will not have this flag set. */ -#define BINFO_NEW_VTABLE_MARKED(B) (TREE_LANG_FLAG_4 (B)) +#define BINFO_NEW_VTABLE_MARKED(B) (BINFO_FLAG_2 (B)) + +/* Compare a BINFO_TYPE with another type for equality. For a binfo, + this is functionally equivalent to using same_type_p, but + measurably faster. At least one of the arguments must be a + BINFO_TYPE. The other can be a BINFO_TYPE or a regular type. If + BINFO_TYPE(T) ever stops being the main variant of the class the + binfo is for, this macro must change. */ +#define SAME_BINFO_TYPE_P(A, B) ((A) == (B)) /* Any subobject that needs a new vtable must have a vptr and must not be a non-virtual primary base (since it would then use the vtable from a derived class and never become non-primary.) */ #define SET_BINFO_NEW_VTABLE_MARKED(B) \ (BINFO_NEW_VTABLE_MARKED (B) = 1, \ - my_friendly_assert (!BINFO_PRIMARY_P (B) \ - || TREE_VIA_VIRTUAL (B), 20000517), \ - my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE, \ - 20000517)) - -/* Nonzero means this class has done dfs_pushdecls. */ -#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE) - -/* Nonzero if this BINFO is a primary base class. Note, this can be - set for non-canonical virtual bases. For a virtual primary base - you might also need to check whether it is canonical. */ - -#define BINFO_PRIMARY_P(NODE) \ - (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE) - -/* The index in the VTT where this subobject's sub-VTT can be found. - NULL_TREE if there is no sub-VTT. */ -#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 0) - -/* The index in the VTT where the vptr for this subobject can be - found. NULL_TREE if there is no secondary vptr in the VTT. */ -#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 1) - -/* The binfo of which NODE is a primary base. (This is different from - BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is - sometimes a primary base for a class for which it is not an - immediate base.) */ -#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, BINFO_ELTS + 2) - -/* C++ binfos have 3 additional entries. */ - -#define BINFO_LANG_ELTS (BINFO_ELTS + 3) + gcc_assert (!BINFO_PRIMARY_P (B) || BINFO_VIRTUAL_P (B)), \ + gcc_assert (TYPE_VFIELD (BINFO_TYPE (B)))) /* Nonzero if this binfo is for a dependent base - one that should not be searched. */ -#define BINFO_DEPENDENT_BASE_P(NODE) TREE_LANG_FLAG_1(NODE) +#define BINFO_DEPENDENT_BASE_P(NODE) BINFO_FLAG_3 (NODE) /* Nonzero if this binfo has lost its primary base binfo (because that is a nearly-empty virtual base that has been taken by some other base in the complete hierarchy. */ -#define BINFO_LOST_PRIMARY_P(NODE) TREE_LANG_FLAG_2 (NODE) +#define BINFO_LOST_PRIMARY_P(NODE) BINFO_FLAG_4 (NODE) -/* Nonzero if this binfo is an indirect primary base, i.e. a virtual - base that is a primary base of some of other class in the - hierarchy. */ -#define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE) +/* Nonzero if this BINFO is a primary base class. */ +#define BINFO_PRIMARY_P(NODE) BINFO_FLAG_5(NODE) /* Used by various search routines. */ #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE) -/* A TREE_LIST of the vcall indices associated with the class NODE. - The TREE_PURPOSE of each node is a FUNCTION_DECL for a virtual - function. The TREE_VALUE is the index into the virtual table where - the vcall offset for that function is stored, when NODE is a - virtual base. */ +/* A VEC(tree_pair_s) of the vcall indices associated with the class + NODE. The PURPOSE of each element is a FUNCTION_DECL for a virtual + function. The VALUE is the index into the virtual table where the + vcall offset for that function is stored, when NODE is a virtual + base. */ #define CLASSTYPE_VCALL_INDICES(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->vcall_indices) @@ -1529,26 +1451,6 @@ struct lang_type GTY(()) #define CLASSTYPE_TYPEINFO_VAR(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->typeinfo_var) -/* Accessor macros for the vfield slots in structures. */ - -/* List of virtual table fields that this type contains (both the primary - and secondaries). The TREE_VALUE is the class type where the vtable - field was introduced. For a vtable field inherited from the primary - base, or introduced by this class, the TREE_PURPOSE is NULL. For - other vtable fields (those from non-primary bases), the - TREE_PURPOSE is the BINFO of the base through which the vtable was - inherited. */ -#define CLASSTYPE_VFIELDS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vfields) - -/* Get the BINFO that introduced this vtable into the hierarchy (will - be NULL for those created at this level, or from a primary - hierarchy). */ -#define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE) - -/* Get the TYPE that introduced this vtable into the hierarchy (always - non-NULL). */ -#define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE) - /* Accessor macros for the BINFO_VIRTUALS list. */ /* The number of bytes by which to adjust the `this' pointer when @@ -1565,18 +1467,11 @@ struct lang_type GTY(()) #define BV_FN(NODE) (TREE_VALUE (NODE)) -/* Nonzero for TREE_LIST node means that this list of things - is a list of parameters, as opposed to a list of expressions. */ -#define TREE_PARMLIST(NODE) (TREE_LANG_FLAG_2 (NODE)) - -/* Nonzero for a parmlist means that this parmlist ended in ... */ -#define PARMLIST_ELLIPSIS_P(NODE) TREE_LANG_FLAG_0 (NODE) - /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE will be NULL_TREE to indicate a throw specification of `()', or no exceptions allowed. */ -#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_BINFO (NODE) +#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_LANG_SLOT_1 (NODE) /* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */ #define TYPE_NOTHROW_P(NODE) \ @@ -1591,16 +1486,21 @@ struct lang_type GTY(()) /* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or a lang_decl (which has lang_decl_flags as its initial prefix). This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is - the full lang_decl, and not just lang_decl_flags. */ -#define CAN_HAVE_FULL_LANG_DECL_P(NODE) \ - (!(TREE_CODE (NODE) == VAR_DECL \ - || TREE_CODE (NODE) == CONST_DECL \ - || TREE_CODE (NODE) == FIELD_DECL \ + the full lang_decl, and not just lang_decl_flags. Keep these + checks in ascending code order. */ +#define CAN_HAVE_FULL_LANG_DECL_P(NODE) \ + (!(TREE_CODE (NODE) == FIELD_DECL \ + || TREE_CODE (NODE) == VAR_DECL \ + || TREE_CODE (NODE) == CONST_DECL \ || TREE_CODE (NODE) == USING_DECL)) struct lang_decl_flags GTY(()) { - ENUM_BITFIELD(languages) language : 8; + ENUM_BITFIELD(languages) language : 4; + unsigned global_ctor_p : 1; + unsigned global_dtor_p : 1; + unsigned anticipated_p : 1; + unsigned template_conv_p : 1; unsigned operator_attr : 1; unsigned constructor_attr : 1; @@ -1615,43 +1515,39 @@ struct lang_decl_flags GTY(()) unsigned use_template : 2; unsigned nonconverting : 1; unsigned not_really_extern : 1; - unsigned needs_final_overrider : 1; unsigned initialized_in_class : 1; unsigned assignment_operator_p : 1; - - unsigned global_ctor_p : 1; - unsigned global_dtor_p : 1; - unsigned anticipated_p : 1; - unsigned template_conv_p : 1; unsigned u1sel : 1; + unsigned u2sel : 1; unsigned can_be_full : 1; + unsigned thunk_p : 1; unsigned this_thunk_p : 1; + unsigned repo_available_p : 1; + unsigned hidden_friend_p : 1; + unsigned threadprivate_p : 1; + /* One unused bit. */ union lang_decl_u { - /* In a FUNCTION_DECL for which DECL_THUNK_P does not hold, + /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is + THUNK_ALIAS. + In a FUNCTION_DECL for which DECL_THUNK_P does not hold, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this is DECL_TEMPLATE_INFO. */ tree GTY ((tag ("0"))) template_info; /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */ struct cp_binding_level * GTY ((tag ("1"))) level; - - /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is - THUNK_ALIAS. */ - tree GTY ((tag ("2"))) thunk_alias; } GTY ((desc ("%1.u1sel"))) u; union lang_decl_u2 { - /* This is DECL_ACCESS. */ + /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is + THUNK_VIRTUAL_OFFSET. + Otherwise this is DECL_ACCESS. */ tree GTY ((tag ("0"))) access; /* For VAR_DECL in function, this is DECL_DISCRIMINATOR. */ int GTY ((tag ("1"))) discriminator; - - /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is - THUNK_VIRTUAL_OFFSET. */ - tree GTY((tag ("2"))) virtual_offset; } GTY ((desc ("%1.u2sel"))) u2; }; @@ -1664,13 +1560,21 @@ struct lang_decl GTY(()) union lang_decl_u4 { - struct full_lang_decl + struct full_lang_decl { + /* In an overloaded operator, this is the value of + DECL_OVERLOADED_OPERATOR_P. */ + ENUM_BITFIELD (tree_code) operator_code : 8; + + unsigned u3sel : 1; + unsigned pending_inline_p : 1; + unsigned spare : 22; + /* For a non-thunk function decl, this is a tree list of - friendly classes. For a thunk function decl, it is the - thunked to function decl. */ + friendly classes. For a thunk function decl, it is the + thunked to function decl. */ tree befriending_classes; - + /* For a non-virtual FUNCTION_DECL, this is DECL_FRIEND_CONTEXT. For a virtual FUNCTION_DECL for which DECL_THIS_THUNK_P does not hold, this is DECL_THUNKS. Both @@ -1679,26 +1583,23 @@ struct lang_decl GTY(()) will be chained on the return pointer thunk. */ tree context; - /* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */ - tree cloned_function; - - /* In a FUNCTION_DECL for which THUNK_P holds, this is - THUNK_FIXED_OFFSET. */ - HOST_WIDE_INT fixed_offset; + union lang_decl_u5 + { + /* In a non-thunk FUNCTION_DECL or TEMPLATE_DECL, this is + DECL_CLONED_FUNCTION. */ + tree GTY ((tag ("0"))) cloned_function; - /* In an overloaded operator, this is the value of - DECL_OVERLOADED_OPERATOR_P. */ - enum tree_code operator_code; + /* In a FUNCTION_DECL for which THUNK_P holds this is the + THUNK_FIXED_OFFSET. */ + HOST_WIDE_INT GTY ((tag ("1"))) fixed_offset; + } GTY ((desc ("%0.decl_flags.thunk_p"))) u5; - unsigned u3sel : 1; - unsigned pending_inline_p : 1; - union lang_decl_u3 { - struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields"))) + struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields"))) sorted_fields; - struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info; - struct language_function * GTY ((tag ("1"))) + struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info; + struct language_function * GTY ((tag ("1"))) saved_language_function; } GTY ((desc ("%1.u3sel + %1.pending_inline_p"))) u; } GTY ((tag ("1"))) f; @@ -1720,30 +1621,17 @@ struct lang_decl GTY(()) #endif /* ENABLE_TREE_CHECKING */ -/* DECL_NEEDED_P holds of a declaration when we need to emit its - definition. This is true when the back-end tells us that - the symbol has been referenced in the generated code. If, however, - we are not generating code, then it is also true when a symbol has - just been used somewhere, even if it's not really needed. We need - anything that isn't comdat, but we don't know for sure whether or - not something is comdat until end-of-file. */ -#define DECL_NEEDED_P(DECL) \ - ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \ - || (DECL_ASSEMBLER_NAME_SET_P (DECL) \ - && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL))) \ - || (((flag_syntax_only || flag_unit_at_a_time) && TREE_USED (DECL)))) - /* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the declaration. Some entities (like a member function in a local class, or a local variable) do not have linkage at all, and this macro should not be used in those cases. - + Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was created by language-independent code, and has C linkage. Most VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage. */ -#define DECL_LANGUAGE(NODE) \ - (DECL_LANG_SPECIFIC (NODE) \ +#define DECL_LANGUAGE(NODE) \ + (DECL_LANG_SPECIFIC (NODE) \ ? DECL_LANG_SPECIFIC (NODE)->decl_flags.language \ : (TREE_CODE (NODE) == FUNCTION_DECL \ ? lang_c : lang_cplusplus)) @@ -1784,7 +1672,7 @@ struct lang_decl GTY(()) /* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the specialized in-charge constructor, in-charge deleting constructor, - or the the base destructor. */ + or the base destructor. */ #define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \ (DECL_DESTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE)) @@ -1808,16 +1696,32 @@ struct lang_decl GTY(()) /* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or destructor. */ -#define DECL_CLONED_FUNCTION_P(NODE) \ - ((TREE_CODE (NODE) == FUNCTION_DECL \ - || TREE_CODE (NODE) == TEMPLATE_DECL) \ - && DECL_LANG_SPECIFIC (NODE) \ +#define DECL_CLONED_FUNCTION_P(NODE) \ + ((TREE_CODE (NODE) == FUNCTION_DECL \ + || TREE_CODE (NODE) == TEMPLATE_DECL) \ + && DECL_LANG_SPECIFIC (NODE) \ + && !DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p \ && DECL_CLONED_FUNCTION (NODE) != NULL_TREE) /* If DECL_CLONED_FUNCTION_P holds, this is the function that was cloned. */ #define DECL_CLONED_FUNCTION(NODE) \ - (DECL_LANG_SPECIFIC (NODE)->u.f.cloned_function) + (DECL_LANG_SPECIFIC (NON_THUNK_FUNCTION_CHECK(NODE))->u.f.u5.cloned_function) + +/* Perform an action for each clone of FN, if FN is a function with + clones. This macro should be used like: + + FOR_EACH_CLONE (clone, fn) + { ... } + + */ +#define FOR_EACH_CLONE(CLONE, FN) \ + if (TREE_CODE (FN) == FUNCTION_DECL \ + && (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (FN) \ + || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (FN))) \ + for (CLONE = TREE_CHAIN (FN); \ + CLONE && DECL_CLONED_FUNCTION_P (CLONE); \ + CLONE = TREE_CHAIN (CLONE)) /* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */ #define DECL_DISCRIMINATOR_P(NODE) \ @@ -1834,7 +1738,7 @@ struct lang_decl GTY(()) /* Nonzero if NODE is a FUNCTION_DECL for which a VTT parameter is required. */ #define DECL_NEEDS_VTT_PARM_P(NODE) \ - (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (NODE)) \ + (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (NODE)) \ && (DECL_BASE_CONSTRUCTOR_P (NODE) \ || DECL_BASE_DESTRUCTOR_P (NODE))) @@ -1878,9 +1782,11 @@ struct lang_decl GTY(()) #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_in_charge_parm_p) -/* Nonzero if NODE is an overloaded `operator delete[]' function. */ -#define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \ - (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR) +/* Nonzero if DECL is a declaration of __builtin_constant_p. */ +#define DECL_IS_BUILTIN_CONSTANT_P(NODE) \ + (TREE_CODE (NODE) == FUNCTION_DECL \ + && DECL_BUILT_IN_CLASS (NODE) == BUILT_IN_NORMAL \ + && DECL_FUNCTION_CODE (NODE) == BUILT_IN_CONSTANT_P) /* Nonzero for _DECL means that this decl appears in (or will appear in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for @@ -1889,25 +1795,31 @@ struct lang_decl GTY(()) should be allocated. */ #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3 (NODE)) -/* Nonzero for a VAR_DECL means that the variable's initialization has - been processed. */ +/* Nonzero for a VAR_DECL means that the variable's initialization (if + any) has been processed. (In general, DECL_INITIALIZED_P is + !DECL_EXTERN, but static data members may be initialized even if + not defined.) */ #define DECL_INITIALIZED_P(NODE) \ (TREE_LANG_FLAG_1 (VAR_DECL_CHECK (NODE))) +/* Nonzero for a VAR_DECL iff an explicit initializer was provided. */ +#define DECL_NONTRIVIALLY_INITIALIZED_P(NODE) \ + (TREE_LANG_FLAG_3 (VAR_DECL_CHECK (NODE))) + /* Nonzero for a VAR_DECL that was initialized with a constant-expression. */ #define DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P(NODE) \ (TREE_LANG_FLAG_2 (VAR_DECL_CHECK (NODE))) /* Nonzero for a VAR_DECL that can be used in an integral constant - expression. + expression. [expr.const] An integral constant-expression can only involve ... const variables of static or enumeration types initialized with constant expressions ... - + The standard does not require that the expression be non-volatile. G++ implements the proposed correction in DR 457. */ #define DECL_INTEGRAL_CONSTANT_VAR_P(NODE) \ @@ -1922,9 +1834,8 @@ struct lang_decl GTY(()) #define DECL_INITIALIZED_IN_CLASS_P(DECL) \ (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class) -/* Nonzero for FUNCTION_DECL means that this decl is just a - friend declaration, and should not be added to the list of - member functions for this class. */ +/* Nonzero for DECL means that this decl is just a friend declaration, + and should not be added to the list of members for this class. */ #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.friend_attr) /* A TREE_LIST of the types which have befriended this FUNCTION_DECL. */ @@ -1980,10 +1891,12 @@ struct lang_decl GTY(()) #define DECL_PURE_VIRTUAL_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.pure_virtual) -/* Nonzero for FUNCTION_DECL means that this member function - must be overridden by derived classes. */ -#define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) \ - (DECL_LANG_SPECIFIC (NODE)->decl_flags.needs_final_overrider) +/* True (in a FUNCTION_DECL) if NODE is a virtual function that is an + invalid overrider for a function from a base class. Once we have + complained about an invalid overrider we avoid complaining about it + again. */ +#define DECL_INVALID_OVERRIDER_P(NODE) \ + (DECL_LANG_FLAG_4 (NODE)) /* The thunks associated with NODE, a FUNCTION_DECL. */ #define DECL_THUNKS(NODE) \ @@ -1992,7 +1905,14 @@ struct lang_decl GTY(()) /* Nonzero if NODE is a thunk, rather than an ordinary function. */ #define DECL_THUNK_P(NODE) \ (TREE_CODE (NODE) == FUNCTION_DECL \ - && DECL_LANG_FLAG_7 (NODE)) + && DECL_LANG_SPECIFIC (NODE) \ + && DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p) + +/* Set DECL_THUNK_P for node. */ +#define SET_DECL_THUNK_P(NODE, THIS_ADJUSTING) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.thunk_p = 1, \ + DECL_LANG_SPECIFIC (NODE)->u.f.u3sel = 1, \ + DECL_LANG_SPECIFIC (NODE)->decl_flags.this_thunk_p = (THIS_ADJUSTING)) /* Nonzero if NODE is a this pointer adjusting thunk. */ #define DECL_THIS_THUNK_P(NODE) \ @@ -2014,11 +1934,10 @@ struct lang_decl GTY(()) #define DECL_EXTERN_C_FUNCTION_P(NODE) \ (DECL_NON_THUNK_FUNCTION_P (NODE) && DECL_EXTERN_C_P (NODE)) -/* Set DECL_THUNK_P for node. */ -#define SET_DECL_THUNK_P(NODE, THIS_ADJUSTING) \ - (DECL_LANG_FLAG_7 (NODE) = 1, \ - DECL_LANG_SPECIFIC (NODE)->u.f.u3sel = 1, \ - DECL_LANG_SPECIFIC (NODE)->decl_flags.this_thunk_p = (THIS_ADJUSTING)) +/* True iff DECL is an entity with vague linkage whose definition is + available in this translation unit. */ +#define DECL_REPO_AVAILABLE_P(NODE) \ + (DECL_LANG_SPECIFIC (NODE)->decl_flags.repo_available_p) /* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a template function. */ @@ -2048,6 +1967,8 @@ struct lang_decl GTY(()) /* NULL_TREE in DECL_CONTEXT represents the global namespace. */ #define CP_DECL_CONTEXT(NODE) \ (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace) +#define CP_TYPE_CONTEXT(NODE) \ + (TYPE_CONTEXT (NODE) ? TYPE_CONTEXT (NODE) : global_namespace) #define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE)) /* 1 iff NODE has namespace scope, including the global namespace. */ @@ -2055,18 +1976,38 @@ struct lang_decl GTY(()) (!DECL_TEMPLATE_PARM_P (NODE) \ && TREE_CODE (CP_DECL_CONTEXT (NODE)) == NAMESPACE_DECL) +#define TYPE_NAMESPACE_SCOPE_P(NODE) \ + (TREE_CODE (CP_TYPE_CONTEXT (NODE)) == NAMESPACE_DECL) + /* 1 iff NODE is a class member. */ #define DECL_CLASS_SCOPE_P(NODE) \ (DECL_CONTEXT (NODE) && TYPE_P (DECL_CONTEXT (NODE))) +#define TYPE_CLASS_SCOPE_P(NODE) \ + (TYPE_CONTEXT (NODE) && TYPE_P (TYPE_CONTEXT (NODE))) + /* 1 iff NODE is function-local. */ #define DECL_FUNCTION_SCOPE_P(NODE) \ (DECL_CONTEXT (NODE) \ && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL) +#define TYPE_FUNCTION_SCOPE_P(NODE) \ + (TYPE_CONTEXT (NODE) \ + && TREE_CODE (TYPE_CONTEXT (NODE)) == FUNCTION_DECL) + +/* 1 iff VAR_DECL node NODE is a type-info decl. This flag is set for + both the primary typeinfo object and the associated NTBS name. */ +#define DECL_TINFO_P(NODE) TREE_LANG_FLAG_4 (VAR_DECL_CHECK (NODE)) + /* 1 iff VAR_DECL node NODE is virtual table or VTT. */ #define DECL_VTABLE_OR_VTT_P(NODE) TREE_LANG_FLAG_5 (VAR_DECL_CHECK (NODE)) +/* Returns 1 iff VAR_DECL is a construction virtual table. + DECL_VTABLE_OR_VTT_P will be true in this case and must be checked + before using this macro. */ +#define DECL_CONSTRUCTION_VTABLE_P(NODE) \ + TREE_LANG_FLAG_6 (VAR_DECL_CHECK (NODE)) + /* 1 iff NODE is function-local, but for types. */ #define LOCAL_CLASS_P(NODE) \ (decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE) @@ -2083,7 +2024,7 @@ struct lang_decl GTY(()) /* In a NAMESPACE_DECL, the list of namespaces which have associated themselves with this one. */ #define DECL_NAMESPACE_ASSOCIATIONS(NODE) \ - (NAMESPACE_DECL_CHECK (NODE)->decl.saved_tree) + (NAMESPACE_DECL_CHECK (NODE)->decl_non_common.saved_tree) /* In a NAMESPACE_DECL, points to the original namespace if this is a namespace alias. */ @@ -2098,18 +2039,34 @@ struct lang_decl GTY(()) && CP_DECL_CONTEXT (NODE) == global_namespace \ && DECL_NAME (NODE) == std_identifier) -/* In a non-local VAR_DECL with static storage duration, this is the - initialization priority. If this value is zero, the NODE will be - initialized at the DEFAULT_INIT_PRIORITY. */ -#define DECL_INIT_PRIORITY(NODE) (VAR_DECL_CHECK (NODE)->decl.u2.i) - /* In a TREE_LIST concatenating using directives, indicate indirect directives */ #define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0) +extern tree decl_shadowed_for_var_lookup (tree); +extern void decl_shadowed_for_var_insert (tree, tree); + +/* Non zero if this is a using decl for a dependent scope. */ +#define DECL_DEPENDENT_P(NODE) DECL_LANG_FLAG_0 (USING_DECL_CHECK (NODE)) + +/* The scope named in a using decl. */ +#define USING_DECL_SCOPE(NODE) TREE_TYPE (USING_DECL_CHECK (NODE)) + +/* The decls named by a using decl. */ +#define USING_DECL_DECLS(NODE) DECL_INITIAL (USING_DECL_CHECK (NODE)) + +/* In a VAR_DECL, true if we have a shadowed local variable + in the shadowed var table for this VAR_DECL. */ +#define DECL_HAS_SHADOWED_FOR_VAR_P(NODE) \ + (VAR_DECL_CHECK (NODE)->decl_with_vis.shadowed_for_var_p) + /* In a VAR_DECL for a variable declared in a for statement, this is the shadowed (local) variable. */ -#define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT_FLD(VAR_DECL_CHECK (NODE)) +#define DECL_SHADOWED_FOR_VAR(NODE) \ + (DECL_HAS_SHADOWED_FOR_VAR_P(NODE) ? decl_shadowed_for_var_lookup (NODE) : NULL) + +#define SET_DECL_SHADOWED_FOR_VAR(NODE, VAL) \ + (decl_shadowed_for_var_insert (NODE, VAL)) /* In a FUNCTION_DECL, this is nonzero if this function was defined in the class definition. We have saved away the text of the function, @@ -2131,8 +2088,25 @@ struct lang_decl GTY(()) #define DECL_DEFERRED_FN(DECL) \ (DECL_LANG_SPECIFIC (DECL)->decl_flags.deferred) -/* For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL: - template-specific information. */ +/* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or + TEMPLATE_DECL, the entity is either a template specialization (if + DECL_USE_TEMPLATE is non-zero) or the abstract instance of the + template itself. + + In either case, DECL_TEMPLATE_INFO is a TREE_LIST, whose + TREE_PURPOSE is the TEMPLATE_DECL of which this entity is a + specialization or abstract instance. The TREE_VALUE is the + template arguments used to specialize the template. + + Consider: + + template struct S { friend void f(T) {} }; + + In this case, S::f is, from the point of view of the compiler, + an instantiation of a template -- but, from the point of view of + the language, each instantiation of S results in a wholly unrelated + global function f. In this case, DECL_TEMPLATE_INFO for S::f + will be non-NULL, but DECL_USE_TEMPLATE will be zero. */ #define DECL_TEMPLATE_INFO(NODE) \ (DECL_LANG_SPECIFIC (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE)) \ ->decl_flags.u.template_info) @@ -2145,13 +2119,14 @@ struct lang_decl GTY(()) /* Template information for a RECORD_TYPE or UNION_TYPE. */ #define CLASSTYPE_TEMPLATE_INFO(NODE) \ - (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info) + (LANG_TYPE_CLASS_CHECK (RECORD_OR_UNION_CHECK (NODE))->template_info) /* Template information for an ENUMERAL_TYPE. Although an enumeration may not be a primary template, it may be declared within the scope of a primary template and the enumeration constants may depend on non-type template parameters. */ -#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE))) +#define ENUM_TEMPLATE_INFO(NODE) \ + (TYPE_LANG_SLOT_1 (ENUMERAL_TYPE_CHECK (NODE))) /* Template information for a template template parameter. */ #define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) \ @@ -2193,7 +2168,7 @@ struct lang_decl GTY(()) /* Nonzero if the template arguments is actually a vector of vectors, rather than just a vector. */ -#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ +#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ (NODE && TREE_VEC_ELT (NODE, 0) \ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC) @@ -2220,11 +2195,6 @@ struct lang_decl GTY(()) #define TMPL_ARG(ARGS, LEVEL, IDX) \ (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX)) -/* Set the IDXth element in the LEVELth level of ARGS to VAL. This - macro does not work with single-level argument vectors. */ -#define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL) \ - (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL)) - /* Given a single level of template arguments in NODE, return the number of arguments. */ #define NUM_TMPL_ARGS(NODE) \ @@ -2263,23 +2233,30 @@ struct lang_decl GTY(()) DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These are always the full set of arguments required to instantiate this declaration from the most general template specialized here. */ -#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) +#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) + +/* The TEMPLATE_DECL associated with NODE, a class type. Even if NODE + will be generated from a partial specialization, the TEMPLATE_DECL + referred to here will be the original template. For example, + given: + + template struct S {}; + template struct S {}; + + the CLASSTPYE_TI_TEMPLATE for S will be S, not the S. */ #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE)) #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE)) -#define ENUM_TI_TEMPLATE(NODE) \ - TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE)) -#define ENUM_TI_ARGS(NODE) \ - TI_ARGS (ENUM_TEMPLATE_INFO (NODE)) /* For a template instantiation TYPE, returns the TYPE corresponding to the primary template. Otherwise returns TYPE itself. */ -#define CLASSTYPE_PRIMARY_TEMPLATE_TYPE(TYPE) \ - ((CLASSTYPE_USE_TEMPLATE ((TYPE)) && !CLASSTYPE_TEMPLATE_SPECIALIZATION ((TYPE))) \ - ? TREE_TYPE (DECL_TEMPLATE_RESULT (DECL_PRIMARY_TEMPLATE \ - (CLASSTYPE_TI_TEMPLATE ((TYPE))))) \ +#define CLASSTYPE_PRIMARY_TEMPLATE_TYPE(TYPE) \ + ((CLASSTYPE_USE_TEMPLATE ((TYPE)) \ + && !CLASSTYPE_TEMPLATE_SPECIALIZATION ((TYPE))) \ + ? TREE_TYPE (DECL_TEMPLATE_RESULT (DECL_PRIMARY_TEMPLATE \ + (CLASSTYPE_TI_TEMPLATE ((TYPE))))) \ : (TYPE)) -/* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */ +/* Like CLASS_TI_TEMPLATE, but also works for ENUMERAL_TYPEs. */ #define TYPE_TI_TEMPLATE(NODE) \ (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE))) @@ -2289,6 +2266,11 @@ struct lang_decl GTY(()) #define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE (NODE) +/* Nonzero if NODE (a TEMPLATE_DECL) is a member template, in the + sense of [temp.mem]. */ +#define DECL_MEMBER_TEMPLATE_P(NODE) \ + (DECL_LANG_FLAG_1 (TEMPLATE_DECL_CHECK (NODE))) + /* Nonzero if the NODE corresponds to the template parameters for a member template, whose inline definition is being processed after the class definition is complete. */ @@ -2299,17 +2281,31 @@ struct lang_decl GTY(()) (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE)) \ ->u.f.u.saved_language_function) -#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) -#define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) -#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE) +/* Indicates an indirect_expr is for converting a reference. */ +#define REFERENCE_REF_P(NODE) \ + TREE_LANG_FLAG_0 (INDIRECT_REF_CHECK (NODE)) + +#define NEW_EXPR_USE_GLOBAL(NODE) \ + TREE_LANG_FLAG_0 (NEW_EXPR_CHECK (NODE)) +#define DELETE_EXPR_USE_GLOBAL(NODE) \ + TREE_LANG_FLAG_0 (DELETE_EXPR_CHECK (NODE)) +#define DELETE_EXPR_USE_VEC(NODE) \ + TREE_LANG_FLAG_1 (DELETE_EXPR_CHECK (NODE)) /* Indicates that this is a non-dependent COMPOUND_EXPR which will resolve to a function call. */ -#define COMPOUND_EXPR_OVERLOADED(NODE) TREE_LANG_FLAG_0 (NODE) +#define COMPOUND_EXPR_OVERLOADED(NODE) \ + TREE_LANG_FLAG_0 (COMPOUND_EXPR_CHECK (NODE)) /* In a CALL_EXPR appearing in a template, true if Koenig lookup should be performed at instantiation time. */ -#define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0(NODE) +#define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0 (CALL_EXPR_CHECK (NODE)) + +/* Indicates whether a string literal has been parenthesized. Such + usages are disallowed in certain circumstances. */ + +#define PAREN_STRING_LITERAL_P(NODE) \ + TREE_LANG_FLAG_0 (STRING_CST_CHECK (NODE)) /* Nonzero if this AGGR_INIT_EXPR provides for initialization via a constructor call, rather than an ordinary function call. */ @@ -2329,17 +2325,21 @@ struct lang_decl GTY(()) this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the corresponding TYPE_DECL. However, this may also be a TEMPLATE_ID_EXPR if we had something like `typename X::Y'. */ -#define TYPENAME_TYPE_FULLNAME(NODE) (TYPE_FIELDS (NODE)) +#define TYPENAME_TYPE_FULLNAME(NODE) (TYPENAME_TYPE_CHECK (NODE))->type.values + +/* True if a TYPENAME_TYPE was declared as an "enum". */ +#define TYPENAME_IS_ENUM_P(NODE) \ + (TREE_LANG_FLAG_0 (TYPENAME_TYPE_CHECK (NODE))) + +/* True if a TYPENAME_TYPE was declared as a "class", "struct", or + "union". */ +#define TYPENAME_IS_CLASS_P(NODE) \ + (TREE_LANG_FLAG_1 (TYPENAME_TYPE_CHECK (NODE))) /* Nonzero in INTEGER_CST means that this int is negative by dint of using a twos-complement negated operand. */ #define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE)) -/* Nonzero in any kind of _TYPE where conversions to base-classes may - involve pointer arithmetic. If this is zero, then converting to - a base-class never requires changing the value of the pointer. */ -#define TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P(NODE) (TREE_LANG_FLAG_1 (NODE)) - /* [class.virtual] A class that declares or inherits a virtual function is called a @@ -2348,8 +2348,7 @@ struct lang_decl GTY(()) /* Nonzero if this class has a virtual function table pointer. */ #define TYPE_CONTAINS_VPTR_P(NODE) \ - (TYPE_POLYMORPHIC_P (NODE) \ - || TYPE_USES_VIRTUAL_BASECLASSES (NODE)) + (TYPE_POLYMORPHIC_P (NODE) || CLASSTYPE_VBASECLASSES (NODE)) /* This flag is true of a local VAR_DECL if it was declared in a for statement, but we are no longer in the scope of the for. */ @@ -2364,10 +2363,23 @@ struct lang_decl GTY(()) #define DECL_LOCAL_FUNCTION_P(NODE) \ DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE)) -/* Nonzero if NODE is a FUNCTION_DECL for a built-in function, and we have - not yet seen a prototype for that function. */ +/* Nonzero if NODE is a DECL which we know about but which has not + been explicitly declared, such as a built-in function or a friend + declared inside a class. In the latter case DECL_HIDDEN_FRIEND_P + will be set. */ #define DECL_ANTICIPATED(NODE) \ - (DECL_LANG_SPECIFIC (DECL_CHECK (NODE))->decl_flags.anticipated_p) + (DECL_LANG_SPECIFIC (DECL_COMMON_CHECK (NODE))->decl_flags.anticipated_p) + +/* Nonzero if NODE is a FUNCTION_DECL which was declared as a friend + within a class but has not been declared in the surrounding scope. + The function is invisible except via argument dependent lookup. */ +#define DECL_HIDDEN_FRIEND_P(NODE) \ + (DECL_LANG_SPECIFIC (DECL_COMMON_CHECK (NODE))->decl_flags.hidden_friend_p) + +/* Nonzero if DECL has been declared threadprivate by + #pragma omp threadprivate. */ +#define CP_DECL_THREADPRIVATE_P(DECL) \ + (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->decl_flags.threadprivate_p) /* Record whether a typedef for type `int' was actually `signed int'. */ #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP) @@ -2379,8 +2391,12 @@ struct lang_decl GTY(()) #define DECL_EXTERNAL_LINKAGE_P(DECL) \ (decl_linkage (DECL) == lk_external) -#define INTEGRAL_CODE_P(CODE) \ - ((CODE) == INTEGER_TYPE || (CODE) == ENUMERAL_TYPE || (CODE) == BOOLEAN_TYPE) +/* Keep these codes in ascending code order. */ + +#define INTEGRAL_CODE_P(CODE) \ + ((CODE) == ENUMERAL_TYPE \ + || (CODE) == BOOLEAN_TYPE \ + || (CODE) == INTEGER_TYPE) /* [basic.fundamental] @@ -2388,31 +2404,35 @@ struct lang_decl GTY(()) are collectively called integral types. Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration - types as well, which is incorrect in C++. */ + types as well, which is incorrect in C++. Keep these checks in + ascending code order. */ #define CP_INTEGRAL_TYPE_P(TYPE) \ (TREE_CODE (TYPE) == BOOLEAN_TYPE \ || TREE_CODE (TYPE) == INTEGER_TYPE) -/* Returns true if TYPE is an integral or enumeration name. */ +/* Returns true if TYPE is an integral or enumeration name. Keep + these checks in ascending code order. */ #define INTEGRAL_OR_ENUMERATION_TYPE_P(TYPE) \ - (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == ENUMERAL_TYPE) + (TREE_CODE (TYPE) == ENUMERAL_TYPE || CP_INTEGRAL_TYPE_P (TYPE)) /* [basic.fundamental] Integral and floating types are collectively called arithmetic - types. */ + types. Keep these checks in ascending code order. */ #define ARITHMETIC_TYPE_P(TYPE) \ (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE) /* [basic.types] Arithmetic types, enumeration types, pointer types, and - pointer-to-member types, are collectively called scalar types. */ + pointer-to-member types, are collectively called scalar types. + Keep these checks in ascending code order. */ #define SCALAR_TYPE_P(TYPE) \ - (ARITHMETIC_TYPE_P (TYPE) \ + (TYPE_PTRMEM_P (TYPE) \ || TREE_CODE (TYPE) == ENUMERAL_TYPE \ + || ARITHMETIC_TYPE_P (TYPE) \ || TYPE_PTR_P (TYPE) \ - || TYPE_PTR_TO_MEMBER_P (TYPE)) + || TYPE_PTRMEMFUNC_P (TYPE)) /* [dcl.init.aggr] @@ -2420,12 +2440,12 @@ struct lang_decl GTY(()) constructors, no private or protected non-static data members, no base classes, and no virtual functions. - As an extension, we also treat vectors as aggregates. */ -#define CP_AGGREGATE_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == ARRAY_TYPE \ - || TREE_CODE (TYPE) == VECTOR_TYPE \ - || (CLASS_TYPE_P (TYPE) \ - && !CLASSTYPE_NON_AGGREGATE (TYPE))) + As an extension, we also treat vectors as aggregates. Keep these + checks in ascending code order. */ +#define CP_AGGREGATE_TYPE_P(TYPE) \ + (TREE_CODE (TYPE) == VECTOR_TYPE \ + ||TREE_CODE (TYPE) == ARRAY_TYPE \ + || (CLASS_TYPE_P (TYPE) && !CLASSTYPE_NON_AGGREGATE (TYPE))) /* Nonzero for a class type means that the class type has a user-declared constructor. */ @@ -2440,19 +2460,26 @@ struct lang_decl GTY(()) When appearing in a SAVE_EXPR, it means that underneath is a call to a constructor. - When appearing in a CONSTRUCTOR, it means that it was - a GNU C constructor expression. + When appearing in a CONSTRUCTOR, the expression is a + compound literal. When appearing in a FIELD_DECL, it means that this field has been duly initialized in its constructor. */ #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4 (NODE)) -#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \ - && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \ - && ! TREE_HAS_CONSTRUCTOR (NODE)) +/* True if NODE is a brace-enclosed initializer. */ +#define BRACE_ENCLOSED_INITIALIZER_P(NODE) \ + (TREE_CODE (NODE) == CONSTRUCTOR && !TREE_TYPE (NODE)) -/* Nonzero for _TYPE means that the _TYPE defines a destructor. */ -#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2 (NODE)) +/* True if NODE is a compound-literal, i.e., a brace-enclosed + initializer cast to a particular type. */ +#define COMPOUND_LITERAL_P(NODE) \ + (TREE_CODE (NODE) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (NODE)) + +#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \ + && VEC_empty (constructor_elt, \ + CONSTRUCTOR_ELTS (NODE)) \ + && !TREE_HAS_CONSTRUCTOR (NODE)) /* Nonzero means that an object of this type can not be initialized using an initializer list. */ @@ -2462,9 +2489,7 @@ struct lang_decl GTY(()) (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) /* Nonzero if there is a user-defined X::op=(x&) for this class. */ -#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_real_assign_ref) #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref) -#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_abstract_assign_ref) #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_init_ref) /* Nonzero if TYPE has a trivial destructor. From [class.dtor]: @@ -2473,10 +2498,10 @@ struct lang_decl GTY(()) destructor and if: - all of the direct base classes of its class have trivial - destructors, + destructors, - for all of the non-static data members of its class that are - of class type (or array thereof), each such class has a + of class type (or array thereof), each such class has a trivial destructor. */ #define TYPE_HAS_TRIVIAL_DESTRUCTOR(NODE) \ (!TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE)) @@ -2501,18 +2526,47 @@ struct lang_decl GTY(()) /* Returns true if NODE is a pointer-to-data-member. */ #define TYPE_PTRMEM_P(NODE) \ (TREE_CODE (NODE) == OFFSET_TYPE) +/* Returns true if NODE is a pointer. */ #define TYPE_PTR_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE) -#define TYPE_PTROB_P(NODE) \ - (TYPE_PTR_P (NODE) \ - && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \ - && TREE_CODE (TREE_TYPE (NODE)) != METHOD_TYPE \ - && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE) -#define TYPE_PTROBV_P(NODE) \ - (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE) + +/* Returns true if NODE is an object type: + + [basic.types] + + An object type is a (possibly cv-qualified) type that is not a + function type, not a reference type, and not a void type. + + Keep these checks in ascending order, for speed. */ +#define TYPE_OBJ_P(NODE) \ + (TREE_CODE (NODE) != REFERENCE_TYPE \ + && TREE_CODE (NODE) != VOID_TYPE \ + && TREE_CODE (NODE) != FUNCTION_TYPE \ + && TREE_CODE (NODE) != METHOD_TYPE) + +/* Returns true if NODE is a pointer to an object. Keep these checks + in ascending tree code order. */ +#define TYPE_PTROB_P(NODE) \ + (TYPE_PTR_P (NODE) && TYPE_OBJ_P (TREE_TYPE (NODE))) + +/* Returns true if NODE is a reference to an object. Keep these checks + in ascending tree code order. */ +#define TYPE_REF_OBJ_P(NODE) \ + (TREE_CODE (NODE) == REFERENCE_TYPE && TYPE_OBJ_P (TREE_TYPE (NODE))) + +/* Returns true if NODE is a pointer to an object, or a pointer to + void. Keep these checks in ascending tree code order. */ +#define TYPE_PTROBV_P(NODE) \ + (TYPE_PTR_P (NODE) \ + && !(TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE \ + || TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)) + +/* Returns true if NODE is a pointer to function. */ #define TYPE_PTRFN_P(NODE) \ (TREE_CODE (NODE) == POINTER_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) + +/* Returns true if NODE is a reference to function. */ #define TYPE_REFFN_P(NODE) \ (TREE_CODE (NODE) == REFERENCE_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) @@ -2533,7 +2587,8 @@ struct lang_decl GTY(()) /* Indicates when overload resolution may resolve to a pointer to member function. [expr.unary.op]/3 */ -#define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE) +#define PTRMEM_OK_P(NODE) \ + TREE_LANG_FLAG_0 (TREE_CHECK2 ((NODE), ADDR_EXPR, OFFSET_REF)) /* Get the POINTER_TYPE to the METHOD_TYPE associated with this pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true, @@ -2553,14 +2608,12 @@ struct lang_decl GTY(()) do { \ if (TYPE_LANG_SPECIFIC (NODE) == NULL) \ { \ - TYPE_LANG_SPECIFIC (NODE) = \ - ggc_alloc_cleared (sizeof (struct lang_type_ptrmem)); \ + TYPE_LANG_SPECIFIC (NODE) = GGC_CNEWVAR \ + (struct lang_type, sizeof (struct lang_type_ptrmem)); \ TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.h.is_lang_type_class = 0; \ } \ TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.record = (VALUE); \ } while (0) -/* Returns the pfn field from a TYPE_PTRMEMFUNC_P. */ -#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE)) /* For a pointer-to-member type of the form `T X::*', this is `X'. For a type like `void (X::*)() const', this type is `X', not `const @@ -2587,6 +2640,9 @@ struct lang_decl GTY(()) `Y'. */ #define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member) +/* The expression in question for a TYPEOF_TYPE. */ +#define TYPEOF_TYPE_EXPR(NODE) (TYPEOF_TYPE_CHECK (NODE))->type.values + /* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was specified in its declaration. This can also be set for an erroneously declared PARM_DECL. */ @@ -2599,6 +2655,11 @@ struct lang_decl GTY(()) #define DECL_THIS_STATIC(NODE) \ DECL_LANG_FLAG_6 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE)) +/* Nonzero for FIELD_DECL node means that this field is a base class + of the parent object, as opposed to a member field. */ +#define DECL_FIELD_IS_BASE(NODE) \ + DECL_LANG_FLAG_6 (FIELD_DECL_CHECK (NODE)) + /* Nonzero if TYPE is an anonymous union or struct type. We have to use a flag for this because "A union for which objects or pointers are declared is not an anonymous union" [class.union]. */ @@ -2657,7 +2718,7 @@ struct lang_decl GTY(()) TEMPLATE_PARM_INDEX for the parameter is available as the DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a TYPE_DECL). */ -#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS (NODE) +#define DECL_TEMPLATE_PARMS(NODE) DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \ INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE)) #define DECL_NTPARMS(NODE) \ @@ -2679,7 +2740,7 @@ struct lang_decl GTY(()) arguments are always complete. For example, given: template struct S1 { - template struct S2 {}; + template struct S2 {}; template struct S2 {}; }; @@ -2698,7 +2759,7 @@ struct lang_decl GTY(()) partial instantiation. For example, given: template struct S { - template void f(U); + template void f(U); template <> void f(T); }; @@ -2712,17 +2773,19 @@ struct lang_decl GTY(()) For a class template, this list contains the partial specializations of this template. (Full specializations are not - recorded on this list.) The TREE_PURPOSE holds the innermost - arguments used in the partial specialization (e.g., for `template - struct S' this will be `T*'.) The TREE_VALUE - holds the innermost template parameters for the specialization - (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node - for the partial specialization. + recorded on this list.) The TREE_PURPOSE holds the arguments used + in the partial specialization (e.g., for `template struct + S' this will be `T*'.) The arguments will also include + any outer template arguments. The TREE_VALUE holds the innermost + template parameters for the specialization (e.g., `T' in the + example above.) The TREE_TYPE is the _TYPE node for the partial + specialization. This list is not used for static variable templates. */ #define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE (NODE) -/* Nonzero for a DECL which is actually a template parameter. */ +/* Nonzero for a DECL which is actually a template parameter. Keep + these checks in ascending tree code order. */ #define DECL_TEMPLATE_PARM_P(NODE) \ (DECL_LANG_FLAG_0 (NODE) \ && (TREE_CODE (NODE) == CONST_DECL \ @@ -2786,23 +2849,53 @@ struct lang_decl GTY(()) /* Returns nonzero if NODE is a primary template. */ #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == (NODE)) -#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \ - (TREE_INT_CST_LOW (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE)))) +/* Non-zero iff NODE is a specialization of a template. The value + indicates the type of specializations: -/* Indicates whether or not (and how) a template was expanded for this - FUNCTION_DECL or VAR_DECL. - 0=normal declaration, e.g. int min (int, int); - 1=implicit template instantiation - 2=explicit template specialization, e.g. int min (int, int); - 3=explicit template instantiation, e.g. template int min (int, int); */ + 1=implicit instantiation + + 2=partial or explicit specialization, e.g.: + + template <> int min (int, int), + + 3=explicit instantiation, e.g.: + + template int min (int, int); + + Note that NODE will be marked as a specialization even if the + template it is instantiating is not a primary template. For + example, given: + + template struct O { + void f(); + struct I {}; + }; + + both O::f and O::I will be marked as instantiations. + + If DECL_USE_TEMPLATE is non-zero, then DECL_TEMPLATE_INFO will also + be non-NULL. */ #define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.use_template) +/* Like DECL_USE_TEMPLATE, but for class types. */ +#define CLASSTYPE_USE_TEMPLATE(NODE) \ + (LANG_TYPE_CLASS_CHECK (NODE)->use_template) + +/* True if NODE is a specialization of a primary template. */ +#define CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P(NODE) \ + (CLASS_TYPE_P (NODE) \ + && CLASSTYPE_USE_TEMPLATE (NODE) \ + && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (arg))) + #define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1) #define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) & 1) #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2) #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2) + +/* Returns true for an explicit or partial specialization of a class + template. */ #define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) == 2) #define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ @@ -2840,7 +2933,7 @@ struct lang_decl GTY(()) /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been instantiated, i.e. its definition has been generated from the - pattern given in the the template. */ + pattern given in the template. */ #define DECL_TEMPLATE_INSTANTIATED(NODE) \ DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE)) @@ -2868,7 +2961,7 @@ struct lang_decl GTY(()) function, (or be implemented via passing some invisible parameter to the thunked function, which is modified to perform the adjustment just before returning). - + A thunk may perform either, or both, of the following operations: o Adjust the this or result pointer by a constant offset. @@ -2898,7 +2991,7 @@ struct lang_decl GTY(()) /* An integer indicating how many bytes should be subtracted from the this or result pointer when this function is called. */ #define THUNK_FIXED_OFFSET(DECL) \ - (DECL_LANG_SPECIFIC (VAR_OR_FUNCTION_DECL_CHECK (DECL))->u.f.fixed_offset) + (DECL_LANG_SPECIFIC (THUNK_FUNCTION_CHECK (DECL))->u.f.u5.fixed_offset) /* A tree indicating how to perform the virtual adjustment. For a this adjusting thunk it is the number of bytes to be added to the vtable @@ -2911,47 +3004,107 @@ struct lang_decl GTY(()) binfos.) */ #define THUNK_VIRTUAL_OFFSET(DECL) \ - (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset) + (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->access) /* A thunk which is equivalent to another thunk. */ #define THUNK_ALIAS(DECL) \ - (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.thunk_alias) + (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.template_info) /* For thunk NODE, this is the FUNCTION_DECL thunked to. It is possible for the target to be a thunk too. */ #define THUNK_TARGET(NODE) \ (DECL_LANG_SPECIFIC (NODE)->u.f.befriending_classes) +/* True for a SCOPE_REF iff the "template" keyword was used to + indicate that the qualified name denotes a template. */ +#define QUALIFIED_NAME_IS_TEMPLATE(NODE) \ + (TREE_LANG_FLAG_0 (SCOPE_REF_CHECK (NODE))) + +/* True for an OMP_ATOMIC that has dependent parameters. These are stored + as bare LHS/RHS, and not as ADDR/RHS, as in the generic statement. */ +#define OMP_ATOMIC_DEPENDENT_P(NODE) \ + (TREE_LANG_FLAG_0 (OMP_ATOMIC_CHECK (NODE))) + +/* Used to store the operation code when OMP_ATOMIC_DEPENDENT_P is set. */ +#define OMP_ATOMIC_CODE(NODE) \ + (OMP_ATOMIC_CHECK (NODE)->exp.complexity) + +/* Used while gimplifying continue statements bound to OMP_FOR nodes. */ +#define OMP_FOR_GIMPLIFYING_P(NODE) \ + (TREE_LANG_FLAG_0 (OMP_FOR_CHECK (NODE))) + +/* A language-specific token attached to the OpenMP data clauses to + hold code (or code fragments) related to ctors, dtors, and op=. + See semantics.c for details. */ +#define CP_OMP_CLAUSE_INFO(NODE) \ + TREE_TYPE (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_PRIVATE, \ + OMP_CLAUSE_COPYPRIVATE)) + /* These macros provide convenient access to the various _STMT nodes created when parsing template declarations. */ -#define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0) -#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1) +#define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0) +#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1) -#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0) -#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1) +#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0) +#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1) #define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0) /* Nonzero if this try block is a function try block. */ -#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE)) -#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) -#define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) +#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE)) +#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) +#define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) #define HANDLER_TYPE(NODE) TREE_TYPE (HANDLER_CHECK (NODE)) -/* The parameters for a call-declarator. */ -#define CALL_DECLARATOR_PARMS(NODE) \ - (TREE_PURPOSE (TREE_OPERAND (NODE, 1))) +/* CLEANUP_STMT accessors. The statement(s) covered, the cleanup to run + and the VAR_DECL for which this cleanup exists. */ +#define CLEANUP_BODY(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0) +#define CLEANUP_EXPR(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1) +#define CLEANUP_DECL(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 2) -/* The cv-qualifiers for a call-declarator. */ -#define CALL_DECLARATOR_QUALS(NODE) \ - (TREE_VALUE (TREE_OPERAND (NODE, 1))) +/* IF_STMT accessors. These give access to the condition of the if + statement, the then block of the if statement, and the else block + of the if statement if it exists. */ +#define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0) +#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) +#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) -/* The exception-specification for a call-declarator. */ -#define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \ - (TREE_TYPE (NODE)) +/* WHILE_STMT accessors. These give access to the condition of the + while statement and the body of the while statement, respectively. */ +#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) +#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) + +/* DO_STMT accessors. These give access to the condition of the do + statement and the body of the do statement, respectively. */ +#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) +#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) + +/* FOR_STMT accessors. These give access to the init statement, + condition, update expression, and body of the for statement, + respectively. */ +#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) +#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) +#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) +#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) + +#define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) +#define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) +#define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) + +/* STMT_EXPR accessor. */ +#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) + +/* EXPR_STMT accessor. This gives the expression associated with an + expression statement. */ +#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) + +/* True if this TARGET_EXPR was created by build_cplus_new, and so we can + discard it if it isn't useful. */ +#define TARGET_EXPR_IMPLICIT_P(NODE) \ + TREE_LANG_FLAG_0 (TARGET_EXPR_CHECK (NODE)) /* An enumeration of the kind of tags that C++ accepts. */ -enum tag_types { +enum tag_types { none_type = 0, /* Not a tag type. */ record_type, /* "struct" types. */ class_type, /* "class" types. */ @@ -2971,20 +3124,20 @@ typedef enum cp_lvalue_kind { /* Various kinds of template specialization, instantiation, etc. */ typedef enum tmpl_spec_kind { - tsk_none, /* Not a template at all. */ + tsk_none, /* Not a template at all. */ tsk_invalid_member_spec, /* An explicit member template specialization, but the enclosing classes have not all been explicitly specialized. */ tsk_invalid_expl_inst, /* An explicit instantiation containing template parameter lists. */ - tsk_excessive_parms, /* A template declaration with too many + tsk_excessive_parms, /* A template declaration with too many template parameter lists. */ tsk_insufficient_parms, /* A template declaration with too few parameter lists. */ - tsk_template, /* A template declaration. */ - tsk_expl_spec, /* An explicit specialization. */ - tsk_expl_inst /* An explicit instantiation. */ + tsk_template, /* A template declaration. */ + tsk_expl_spec, /* An explicit specialization. */ + tsk_expl_inst /* An explicit instantiation. */ } tmpl_spec_kind; /* The various kinds of access. BINFO_ACCESS depends on these being @@ -2992,85 +3145,82 @@ typedef enum tmpl_spec_kind { used to initialize RTTI data structures, so changing them changes the ABI. */ typedef enum access_kind { - ak_none = 0, /* Inaccessible. */ - ak_public = 1, /* Accessible, as a `public' thing. */ - ak_protected = 2, /* Accessible, as a `protected' thing. */ - ak_private = 3 /* Accessible, as a `private' thing. */ + ak_none = 0, /* Inaccessible. */ + ak_public = 1, /* Accessible, as a `public' thing. */ + ak_protected = 2, /* Accessible, as a `protected' thing. */ + ak_private = 3 /* Accessible, as a `private' thing. */ } access_kind; /* The various kinds of special functions. If you add to this list, you should update special_function_p as well. */ typedef enum special_function_kind { - sfk_none = 0, /* Not a special function. This enumeral + sfk_none = 0, /* Not a special function. This enumeral must have value zero; see special_function_p. */ - sfk_constructor, /* A constructor. */ + sfk_constructor, /* A constructor. */ sfk_copy_constructor, /* A copy constructor. */ sfk_assignment_operator, /* An assignment operator. */ - sfk_destructor, /* A destructor. */ + sfk_destructor, /* A destructor. */ sfk_complete_destructor, /* A destructor for complete objects. */ sfk_base_destructor, /* A destructor for base subobjects. */ sfk_deleting_destructor, /* A destructor for complete objects that deletes the object after it has been destroyed. */ - sfk_conversion /* A conversion operator. */ + sfk_conversion /* A conversion operator. */ } special_function_kind; -/* The various kinds of linkage. From [basic.link], - +/* The various kinds of linkage. From [basic.link], + A name is said to have linkage when it might denote the same object, reference, function, type, template, namespace or value as a name introduced in another scope: -- When a name has external linkage, the entity it denotes can - be referred to from scopes of other translation units or from + be referred to from scopes of other translation units or from other scopes of the same translation unit. -- When a name has internal linkage, the entity it denotes can - be referred to by names from other scopes in the same + be referred to by names from other scopes in the same translation unit. -- When a name has no linkage, the entity it denotes cannot be - referred to by names from other scopes. */ + referred to by names from other scopes. */ typedef enum linkage_kind { - lk_none, /* No linkage. */ - lk_internal, /* Internal linkage. */ - lk_external /* External linkage. */ + lk_none, /* No linkage. */ + lk_internal, /* Internal linkage. */ + lk_external /* External linkage. */ } linkage_kind; /* Bitmask flags to control type substitution. */ typedef enum tsubst_flags_t { - tf_none = 0, /* nothing special */ - tf_error = 1 << 0, /* give error messages */ - tf_warning = 1 << 1, /* give warnings too */ - tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ + tf_none = 0, /* nothing special */ + tf_error = 1 << 0, /* give error messages */ + tf_warning = 1 << 1, /* give warnings too */ + tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */ tf_keep_type_decl = 1 << 3, /* retain typedef type decls (make_typename_type use) */ - tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal + tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal instantiate_type use) */ tf_user = 1 << 5, /* found template must be a user template (lookup_template_class use) */ - tf_stmt_expr_cmpd = 1 << 6, /* tsubsting the compound statement of - a statement expr. */ - tf_stmt_expr_body = 1 << 7, /* tsubsting the statements in the - body of the compound statement of a - statement expr. */ - tf_conv = 1 << 8 /* We are determining what kind of + tf_conv = 1 << 6, /* We are determining what kind of conversion might be permissible, not actually performing the conversion. */ + /* Convenient substitution flags combinations. */ + tf_warning_or_error = tf_warning | tf_error } tsubst_flags_t; /* The kind of checking we can do looking in a class hierarchy. */ typedef enum base_access { - ba_any = 0, /* Do not check access, allow an ambiguous base, + ba_any = 0, /* Do not check access, allow an ambiguous base, prefer a non-virtual base */ - ba_ignore = 1, /* Do not check access */ - ba_check = 2, /* Check access */ - ba_not_special = 3, /* Do not consider special privilege - current_class_type might give. */ - ba_quiet = 4 /* Do not issue error messages (bit mask). */ + ba_unique = 1 << 0, /* Must be a unique base. */ + ba_check_bit = 1 << 1, /* Check access. */ + ba_check = ba_unique | ba_check_bit, + ba_ignore_scope = 1 << 2, /* Ignore access allowed by local scope. */ + ba_quiet = 1 << 3 /* Do not issue error messages. */ } base_access; /* The various kinds of access check during parsing. */ @@ -3084,24 +3234,15 @@ typedef enum deferring_kind { Values <0 indicate we failed. */ typedef enum base_kind { bk_inaccessible = -3, /* The base is inaccessible */ - bk_ambig = -2, /* The base is ambiguous */ - bk_not_base = -1, /* It is not a base */ - bk_same_type = 0, /* It is the same type */ - bk_proper_base = 1, /* It is a proper base */ - bk_via_virtual = 2 /* It is a proper base, but via a virtual + bk_ambig = -2, /* The base is ambiguous */ + bk_not_base = -1, /* It is not a base */ + bk_same_type = 0, /* It is the same type */ + bk_proper_base = 1, /* It is a proper base */ + bk_via_virtual = 2 /* It is a proper base, but via a virtual path. This might not be the canonical binfo. */ } base_kind; -/* Set by add_implicitly_declared_members() to keep those members from - being flagged as deprecated or reported as using deprecated - types. */ -extern int adding_implicit_members; - -/* in decl{2}.c */ -/* A node that is a list (length 1) of error_mark_nodes. */ -extern GTY(()) tree error_mark_list; - /* Node for "pointer to (virtual) function". This may be distinct from ptr_type_node so gdb can distinguish them. */ #define vfunc_ptr_type_node vtable_entry_type @@ -3116,32 +3257,6 @@ extern GTY(()) tree integer_three_node; function, two inside the body of a function in a local class, etc.) */ extern int function_depth; -typedef struct deferred_access GTY(()) -{ - /* A TREE_LIST representing name-lookups for which we have deferred - checking access controls. We cannot check the accessibility of - names used in a decl-specifier-seq until we know what is being - declared because code like: - - class A { - class B {}; - B* f(); - } - - A::B* A::f() { return 0; } - - is valid, even though `A::B' is not generally accessible. - - The TREE_PURPOSE of each node is the scope used to qualify the - name being looked up; the TREE_VALUE is the DECL to which the - name was resolved. */ - tree deferred_access_checks; - /* The current mode of access checks. */ - enum deferring_kind deferring_access_checks_kind; - /* The next deferred access data in stack or linked-list. */ - struct deferred_access *next; -} deferred_access; - /* in pt.c */ /* These values are used for the `STRICT' parameter to type_unification and @@ -3151,16 +3266,17 @@ typedef struct deferred_access GTY(()) typedef enum unification_kind_t { DEDUCE_CALL, DEDUCE_CONV, - DEDUCE_EXACT, - DEDUCE_ORDER + DEDUCE_EXACT } unification_kind_t; -/* Macros for operating on a template instantiation level node, represented - by an EXPR_WITH_FILE_LOCATION. */ +/* Macros for operating on a template instantiation level node. */ -#define TINST_DECL(NODE) EXPR_WFL_NODE (NODE) -#define TINST_LINE(NODE) EXPR_WFL_LINENO (NODE) -#define TINST_FILE(NODE) EXPR_WFL_FILENAME (NODE) +#define TINST_DECL(NODE) \ + (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->decl) +#define TINST_LOCATION(NODE) \ + (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->locus) +#define TINST_IN_SYSTEM_HEADER_P(NODE) \ + (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->in_system_header_p) /* in class.c */ @@ -3168,7 +3284,7 @@ extern int current_class_depth; /* An array of all local classes present in this translation unit, in declaration order. */ -extern GTY(()) varray_type local_classes; +extern GTY(()) VEC(tree,gc) *local_classes; /* Here's where we control how name mangling takes place. */ @@ -3186,17 +3302,10 @@ extern GTY(()) varray_type local_classes; #define JOINER '$' -#define VPTR_NAME "$v" -#define THROW_NAME "$eh_throw" -#define AUTO_VTABLE_NAME "__vtbl$me__" #define AUTO_TEMP_NAME "_$tmp_" -#define AUTO_TEMP_FORMAT "_$tmp_%d" -#define VTABLE_BASE "$vb" -#define VTABLE_NAME_PREFIX "__vt_" #define VFIELD_BASE "$vf" #define VFIELD_NAME "_vptr$" #define VFIELD_NAME_FORMAT "_vptr$%s" -#define STATIC_NAME_FORMAT "_%s$%s" #define ANON_AGGRNAME_FORMAT "$_%d" #else /* NO_DOLLAR_IN_LABEL */ @@ -3205,36 +3314,21 @@ extern GTY(()) varray_type local_classes; #define JOINER '.' -#define VPTR_NAME ".v" -#define THROW_NAME ".eh_throw" -#define AUTO_VTABLE_NAME "__vtbl.me__" #define AUTO_TEMP_NAME "_.tmp_" -#define AUTO_TEMP_FORMAT "_.tmp_%d" -#define VTABLE_BASE ".vb" -#define VTABLE_NAME_PREFIX "__vt_" #define VFIELD_BASE ".vf" #define VFIELD_NAME "_vptr." #define VFIELD_NAME_FORMAT "_vptr.%s" -#define STATIC_NAME_FORMAT "_%s.%s" #define ANON_AGGRNAME_FORMAT "._%d" #else /* NO_DOT_IN_LABEL */ -#define VPTR_NAME "__vptr" -#define VPTR_NAME_P(ID_NODE) \ - (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1)) -#define THROW_NAME "__eh_throw" #define IN_CHARGE_NAME "__in_chrg" -#define AUTO_VTABLE_NAME "__vtbl_me__" #define AUTO_TEMP_NAME "__tmp_" #define TEMP_NAME_P(ID_NODE) \ (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \ sizeof (AUTO_TEMP_NAME) - 1)) -#define AUTO_TEMP_FORMAT "__tmp_%d" -#define VTABLE_BASE "__vtb" #define VTABLE_NAME "__vt_" -#define VTABLE_NAME_PREFIX "__vt_" #define VTABLE_NAME_P(ID_NODE) \ (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ sizeof (VTABLE_NAME) - 1)) @@ -3244,7 +3338,6 @@ extern GTY(()) varray_type local_classes; (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \ sizeof (VFIELD_NAME) - 1)) #define VFIELD_NAME_FORMAT "__vptr_%s" -#define STATIC_NAME_FORMAT "__static_%s_%s" #define ANON_AGGRNAME_PREFIX "__anon_" #define ANON_AGGRNAME_P(ID_NODE) \ @@ -3256,8 +3349,6 @@ extern GTY(()) varray_type local_classes; #endif /* NO_DOLLAR_IN_LABEL */ #define THIS_NAME "this" -#define CTOR_NAME "__ct" -#define DTOR_NAME "__dt" #define IN_CHARGE_NAME "__in_chrg" @@ -3265,13 +3356,8 @@ extern GTY(()) varray_type local_classes; #define VTABLE_DELTA_NAME "__delta" #define VTABLE_PFN_NAME "__pfn" -#define EXCEPTION_CLEANUP_NAME "exception cleanup" - #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) -#define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ - && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') - #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) @@ -3288,13 +3374,6 @@ extern GTY(()) varray_type local_classes; && IDENTIFIER_POINTER (ID_NODE)[1] == '_') #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */ -/* Returns nonzero iff NODE is a declaration for the global function - `main'. */ -#define DECL_MAIN_P(NODE) \ - (DECL_EXTERN_C_FUNCTION_P (NODE) \ - && DECL_NAME (NODE) != NULL_TREE \ - && MAIN_NAME_P (DECL_NAME (NODE))) - /* Nonzero if we're done parsing and into end-of-file activities. */ @@ -3313,58 +3392,51 @@ extern GTY(()) tree static_dtors; enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; -/* Some macros for char-based bitfields. */ -#define B_SET(A,X) ((A)[(X)>>3] |= (1 << ((X)&7))) -#define B_CLR(A,X) ((A)[(X)>>3] &= ~(1 << ((X)&7))) -#define B_TST(A,X) ((A)[(X)>>3] & (1 << ((X)&7))) - -/* These are uses as bits in flags passed to build_new_method_call - to control its error reporting behavior. - - LOOKUP_PROTECT means flag access violations. - LOOKUP_COMPLAIN mean complain if no suitable member function - matching the arguments is found. - LOOKUP_NORMAL is just a combination of these two. - LOOKUP_NONVIRTUAL means make a direct call to the member function found - LOOKUP_GLOBAL means search through the space of overloaded functions, - as well as the space of member functions. - LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried. - DIRECT_BIND means that if a temporary is created, it should be created so - that it lives as long as the current variable bindings; otherwise it - only lives until the end of the complete-expression. It also forces - direct-initialization in cases where other parts of the compiler have - already generated a temporary, such as reference initialization and the - catch parameter. - LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are - after. Note, LOOKUP_COMPLAIN is checked and error messages printed - before LOOKUP_SPECULATIVELY is checked. - LOOKUP_NO_CONVERSION means that user-defined conversions are not - permitted. Built-in conversions are permitted. - LOOKUP_DESTRUCTOR means explicit call to destructor. - LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references. - - These are used in global lookup to support elaborated types and - qualifiers. - - LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces. - LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types. - LOOKUP_PREFER_BOTH means class-or-namespace-name. */ - +/* These are uses as bits in flags passed to various functions to + control their behavior. Despite the LOOKUP_ prefix, many of these + do not control name lookup. ??? Functions using these flags should + probably be modified to accept explicit boolean flags for the + behaviors relevant to them. */ +/* Check for access violations. */ #define LOOKUP_PROTECT (1 << 0) +/* Complain if no suitable member function matching the arguments is + found. */ #define LOOKUP_COMPLAIN (1 << 1) #define LOOKUP_NORMAL (LOOKUP_PROTECT | LOOKUP_COMPLAIN) +/* Even if the function found by lookup is a virtual function, it + should be called directly. */ #define LOOKUP_NONVIRTUAL (1 << 2) -#define LOOKUP_GLOBAL (1 << 3) -#define LOOKUP_SPECULATIVELY (1 << 4) -#define LOOKUP_ONLYCONVERTING (1 << 5) -#define DIRECT_BIND (1 << 6) -#define LOOKUP_NO_CONVERSION (1 << 7) -#define LOOKUP_DESTRUCTOR (1 << 8) -#define LOOKUP_NO_TEMP_BIND (1 << 9) -#define LOOKUP_PREFER_TYPES (1 << 10) -#define LOOKUP_PREFER_NAMESPACES (1 << 11) +/* Non-converting (i.e., "explicit") constructors are not tried. */ +#define LOOKUP_ONLYCONVERTING (1 << 3) +/* If a temporary is created, it should be created so that it lives + as long as the current variable bindings; otherwise it only lives + until the end of the complete-expression. It also forces + direct-initialization in cases where other parts of the compiler + have already generated a temporary, such as reference + initialization and the catch parameter. */ +#define DIRECT_BIND (1 << 4) +/* User-defined conversions are not permitted. (Built-in conversions + are permitted.) */ +#define LOOKUP_NO_CONVERSION (1 << 5) +/* The user has explicitly called a destructor. (Therefore, we do + not need to check that the object is non-NULL before calling the + destructor.) */ +#define LOOKUP_DESTRUCTOR (1 << 6) +/* Do not permit references to bind to temporaries. */ +#define LOOKUP_NO_TEMP_BIND (1 << 7) +/* Do not accept objects, and possibly namespaces. */ +#define LOOKUP_PREFER_TYPES (1 << 8) +/* Do not accept objects, and possibly types. */ +#define LOOKUP_PREFER_NAMESPACES (1 << 9) +/* Accept types or namespaces. */ #define LOOKUP_PREFER_BOTH (LOOKUP_PREFER_TYPES | LOOKUP_PREFER_NAMESPACES) -#define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 12) +/* We are checking that a constructor can be called -- but we do not + actually plan to call it. */ +#define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 10) +/* Return friend declarations and un-declared builtin functions. + (Normally, these entities are registered in the symbol table, but + not found by lookup.) */ +#define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3389,7 +3461,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; #define CONV_PRIVATE 16 /* #define CONV_NONCONVERTING 32 */ #define CONV_FORCE_TEMP 64 -#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP) #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ | CONV_REINTERPRET) #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ @@ -3403,32 +3474,33 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; #define WANT_ENUM 4 /* enumerated types */ #define WANT_POINTER 8 /* pointer types */ #define WANT_NULL 16 /* null pointer constant */ -#define WANT_ARITH (WANT_INT | WANT_FLOAT) +#define WANT_VECTOR 32 /* vector types */ +#define WANT_ARITH (WANT_INT | WANT_FLOAT | WANT_VECTOR) /* Used with comptypes, and related functions, to guide type comparison. */ -#define COMPARE_STRICT 0 /* Just check if the types are the +#define COMPARE_STRICT 0 /* Just check if the types are the same. */ -#define COMPARE_BASE 1 /* Check to see if the second type is +#define COMPARE_BASE 1 /* Check to see if the second type is derived from the first. */ -#define COMPARE_DERIVED 2 /* Like COMPARE_BASE, but in +#define COMPARE_DERIVED 2 /* Like COMPARE_BASE, but in reverse. */ #define COMPARE_REDECLARATION 4 /* The comparison is being done when another declaration of an existing entity is seen. */ /* Used with push_overloaded_decl. */ -#define PUSH_GLOBAL 0 /* Push the DECL into namespace scope, +#define PUSH_GLOBAL 0 /* Push the DECL into namespace scope, regardless of the current scope. */ -#define PUSH_LOCAL 1 /* Push the DECL into the current +#define PUSH_LOCAL 1 /* Push the DECL into the current scope. */ -#define PUSH_USING 2 /* We are pushing this DECL as the +#define PUSH_USING 2 /* We are pushing this DECL as the result of a using declaration. */ /* Used with start function. */ -#define SF_DEFAULT 0 /* No flags. */ -#define SF_PRE_PARSED 1 /* The function declaration has +#define SF_DEFAULT 0 /* No flags. */ +#define SF_PRE_PARSED 1 /* The function declaration has already been parsed. */ #define SF_INCLASS_INLINE 2 /* The function is an inline, defined in the class body. */ @@ -3450,7 +3522,9 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; /* These macros are for accessing the fields of TEMPLATE_TYPE_PARM, TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes. */ -#define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE)) +#define TEMPLATE_TYPE_PARM_INDEX(NODE) \ + (TREE_CHECK3 ((NODE), TEMPLATE_TYPE_PARM, TEMPLATE_TEMPLATE_PARM, \ + BOUND_TEMPLATE_TEMPLATE_PARM))->type.values #define TEMPLATE_TYPE_IDX(NODE) \ (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE))) #define TEMPLATE_TYPE_LEVEL(NODE) \ @@ -3477,18 +3551,18 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; TFF_EXPR_IN_PARENS: parenthesize expressions. TFF_NO_FUNCTION_ARGUMENTS: don't show function arguments. */ -#define TFF_PLAIN_IDENTIFIER (0) -#define TFF_SCOPE (1) -#define TFF_CHASE_TYPEDEF (1 << 1) -#define TFF_DECL_SPECIFIERS (1 << 2) -#define TFF_CLASS_KEY_OR_ENUM (1 << 3) -#define TFF_RETURN_TYPE (1 << 4) -#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5) -#define TFF_EXCEPTION_SPECIFICATION (1 << 6) -#define TFF_TEMPLATE_HEADER (1 << 7) -#define TFF_TEMPLATE_NAME (1 << 8) -#define TFF_EXPR_IN_PARENS (1 << 9) -#define TFF_NO_FUNCTION_ARGUMENTS (1 << 10) +#define TFF_PLAIN_IDENTIFIER (0) +#define TFF_SCOPE (1) +#define TFF_CHASE_TYPEDEF (1 << 1) +#define TFF_DECL_SPECIFIERS (1 << 2) +#define TFF_CLASS_KEY_OR_ENUM (1 << 3) +#define TFF_RETURN_TYPE (1 << 4) +#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5) +#define TFF_EXCEPTION_SPECIFICATION (1 << 6) +#define TFF_TEMPLATE_HEADER (1 << 7) +#define TFF_TEMPLATE_NAME (1 << 8) +#define TFF_EXPR_IN_PARENS (1 << 9) +#define TFF_NO_FUNCTION_ARGUMENTS (1 << 10) /* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM node. */ @@ -3525,54 +3599,217 @@ extern GTY(()) operator_name_info_t operator_name_info extern GTY(()) operator_name_info_t assignment_operator_name_info [(int) LAST_CPLUS_TREE_CODE]; +/* A type-qualifier, or bitmask therefore, using the TYPE_QUAL + constants. */ + +typedef int cp_cv_quals; + +/* A storage class. */ + +typedef enum cp_storage_class { + /* sc_none must be zero so that zeroing a cp_decl_specifier_seq + sets the storage_class field to sc_none. */ + sc_none = 0, + sc_auto, + sc_register, + sc_static, + sc_extern, + sc_mutable +} cp_storage_class; + +/* An individual decl-specifier. */ + +typedef enum cp_decl_spec { + ds_first, + ds_signed = ds_first, + ds_unsigned, + ds_short, + ds_long, + ds_const, + ds_volatile, + ds_restrict, + ds_inline, + ds_virtual, + ds_explicit, + ds_friend, + ds_typedef, + ds_complex, + ds_thread, + ds_last +} cp_decl_spec; + +/* A decl-specifier-seq. */ + +typedef struct cp_decl_specifier_seq { + /* The number of times each of the keywords has been seen. */ + unsigned specs[(int) ds_last]; + /* The primary type, if any, given by the decl-specifier-seq. + Modifiers, like "short", "const", and "unsigned" are not + reflected here. This field will be a TYPE, unless a typedef-name + was used, in which case it will be a TYPE_DECL. */ + tree type; + /* The attributes, if any, provided with the specifier sequence. */ + tree attributes; + /* If non-NULL, a built-in type that the user attempted to redefine + to some other type. */ + tree redefined_builtin_type; + /* The storage class specified -- or sc_none if no storage class was + explicitly specified. */ + cp_storage_class storage_class; + /* True iff TYPE_SPEC indicates a user-defined type. */ + BOOL_BITFIELD user_defined_type_p : 1; + /* True iff multiple types were (erroneously) specified for this + decl-specifier-seq. */ + BOOL_BITFIELD multiple_types_p : 1; + /* True iff multiple storage classes were (erroneously) specified + for this decl-specifier-seq or a combination of a storage class + with a typedef specifier. */ + BOOL_BITFIELD conflicting_specifiers_p : 1; + /* True iff at least one decl-specifier was found. */ + BOOL_BITFIELD any_specifiers_p : 1; + /* True iff "int" was explicitly provided. */ + BOOL_BITFIELD explicit_int_p : 1; + /* True iff "char" was explicitly provided. */ + BOOL_BITFIELD explicit_char_p : 1; +} cp_decl_specifier_seq; + +/* The various kinds of declarators. */ + +typedef enum cp_declarator_kind { + cdk_id, + cdk_function, + cdk_array, + cdk_pointer, + cdk_reference, + cdk_ptrmem, + cdk_error +} cp_declarator_kind; + +/* A declarator. */ + +typedef struct cp_declarator cp_declarator; + +typedef struct cp_parameter_declarator cp_parameter_declarator; + +/* A parameter, before it has been semantically analyzed. */ +struct cp_parameter_declarator { + /* The next parameter, or NULL_TREE if none. */ + cp_parameter_declarator *next; + /* The decl-specifiers-seq for the parameter. */ + cp_decl_specifier_seq decl_specifiers; + /* The declarator for the parameter. */ + cp_declarator *declarator; + /* The default-argument expression, or NULL_TREE, if none. */ + tree default_argument; + /* True iff this is the first parameter in the list and the + parameter sequence ends with an ellipsis. */ + bool ellipsis_p; +}; + +/* A declarator. */ +struct cp_declarator { + /* The kind of declarator. */ + cp_declarator_kind kind; + /* Attributes that apply to this declarator. */ + tree attributes; + /* For all but cdk_id and cdk_error, the contained declarator. For + cdk_id and cdk_error, guaranteed to be NULL. */ + cp_declarator *declarator; + location_t id_loc; /* Currently only set for cdk_id. */ + union { + /* For identifiers. */ + struct { + /* If non-NULL, the qualifying scope (a NAMESPACE_DECL or + *_TYPE) for this identifier. */ + tree qualifying_scope; + /* The unqualified name of the entity -- an IDENTIFIER_NODE, + BIT_NOT_EXPR, or TEMPLATE_ID_EXPR. */ + tree unqualified_name; + /* If this is the name of a function, what kind of special + function (if any). */ + special_function_kind sfk; + } id; + /* For functions. */ + struct { + /* The parameters to the function. */ + cp_parameter_declarator *parameters; + /* The cv-qualifiers for the function. */ + cp_cv_quals qualifiers; + /* The exception-specification for the function. */ + tree exception_specification; + } function; + /* For arrays. */ + struct { + /* The bounds to the array. */ + tree bounds; + } array; + /* For cdk_pointer, cdk_reference, and cdk_ptrmem. */ + struct { + /* The cv-qualifiers for the pointer. */ + cp_cv_quals qualifiers; + /* For cdk_ptrmem, the class type containing the member. */ + tree class_type; + } pointer; + } u; +}; + +/* A parameter list indicating for a function with no parameters, + e.g "int f(void)". */ +extern cp_parameter_declarator *no_parameters; + /* in call.c */ -extern bool check_dtor_name (tree, tree); +extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); extern tree build_conditional_expr (tree, tree, tree); -extern tree build_addr_func (tree); -extern tree build_call (tree, tree); -extern bool null_ptr_cst_p (tree); -extern bool sufficient_parms_p (tree); -extern tree type_decays_to (tree); -extern tree build_user_type_conversion (tree, tree, int); -extern tree build_new_function_call (tree, tree); -extern tree build_operator_new_call (tree, tree, tree *, tree *); -extern tree build_new_method_call (tree, tree, tree, tree, int); -extern tree build_special_member_call (tree, tree, tree, tree, int); -extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); -extern tree build_op_delete_call (enum tree_code, tree, tree, int, tree); -extern bool can_convert (tree, tree); -extern bool can_convert_arg (tree, tree, tree); -extern bool can_convert_arg_bad (tree, tree, tree); -extern bool enforce_access (tree, tree); -extern tree convert_default_arg (tree, tree, tree, int); -extern tree convert_arg_to_ellipsis (tree); -extern tree build_x_va_arg (tree, tree); -extern tree cxx_type_promotes_to (tree); -extern tree type_passed_as (tree); -extern tree convert_for_arg_passing (tree, tree); -extern tree cp_convert_parm_for_inlining (tree, tree, tree); -extern bool is_properly_derived_from (tree, tree); -extern tree initialize_reference (tree, tree, tree, tree *); -extern tree make_temporary_var_for_ref_to_temp (tree, tree); -extern tree strip_top_quals (tree); -extern tree perform_implicit_conversion (tree, tree); -extern tree perform_direct_initialization_if_possible (tree, tree); -extern tree in_charge_arg_for_name (tree); -extern tree build_cxx_call (tree, tree, tree); +extern tree build_addr_func (tree); +extern tree build_call (tree, tree); +extern bool null_ptr_cst_p (tree); +extern bool sufficient_parms_p (tree); +extern tree type_decays_to (tree); +extern tree build_user_type_conversion (tree, tree, int); +extern tree build_new_function_call (tree, tree, bool); +extern tree build_operator_new_call (tree, tree, tree *, tree *, + tree *); +extern tree build_new_method_call (tree, tree, tree, tree, int, + tree *); +extern tree build_special_member_call (tree, tree, tree, tree, int); +extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *); +extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree); +extern bool can_convert (tree, tree); +extern bool can_convert_arg (tree, tree, tree, int); +extern bool can_convert_arg_bad (tree, tree, tree); +extern bool enforce_access (tree, tree, tree); +extern tree convert_default_arg (tree, tree, tree, int); +extern tree convert_arg_to_ellipsis (tree); +extern tree build_x_va_arg (tree, tree); +extern tree cxx_type_promotes_to (tree); +extern tree type_passed_as (tree); +extern tree convert_for_arg_passing (tree, tree); +extern bool is_properly_derived_from (tree, tree); +extern tree initialize_reference (tree, tree, tree, tree *); +extern tree make_temporary_var_for_ref_to_temp (tree, tree); +extern tree strip_top_quals (tree); +extern tree perform_implicit_conversion (tree, tree); +extern tree perform_direct_initialization_if_possible (tree, tree, bool); +extern tree in_charge_arg_for_name (tree); +extern tree build_cxx_call (tree, tree); +#ifdef ENABLE_CHECKING +extern void validate_conversion_obstack (void); +#endif /* ENABLE_CHECKING */ /* in class.c */ -extern tree build_base_path (enum tree_code, tree, tree, int); -extern tree convert_to_base (tree, tree, bool); -extern tree convert_to_base_statically (tree, tree); +extern tree build_base_path (enum tree_code, tree, + tree, int); +extern tree convert_to_base (tree, tree, bool, bool); +extern tree convert_to_base_statically (tree, tree); extern tree build_vtbl_ref (tree, tree); extern tree build_vfn_ref (tree, tree); -extern tree get_vtable_decl (tree, int); -extern void resort_type_method_vec - (void *, void *, gt_pointer_operator, void *); -extern void add_method (tree, tree, int); -extern int currently_open_class (tree); +extern tree get_vtable_decl (tree, int); +extern void resort_type_method_vec (void *, void *, + gt_pointer_operator, void *); +extern bool add_method (tree, tree, tree); +extern bool currently_open_class (tree); extern tree currently_open_derived_class (tree); extern tree finish_struct (tree, tree); extern void finish_struct_1 (tree); @@ -3587,216 +3824,200 @@ extern int current_lang_depth (void); extern void push_lang_context (tree); extern void pop_lang_context (void); extern tree instantiate_type (tree, tree, tsubst_flags_t); -extern void print_class_statistics (void); +extern void print_class_statistics (void); extern void cxx_print_statistics (void); -extern void cxx_print_xnode (FILE *, tree, int); -extern void cxx_print_decl (FILE *, tree, int); -extern void cxx_print_type (FILE *, tree, int); -extern void cxx_print_identifier (FILE *, tree, int); +extern void cxx_print_xnode (FILE *, tree, int); +extern void cxx_print_decl (FILE *, tree, int); +extern void cxx_print_type (FILE *, tree, int); +extern void cxx_print_identifier (FILE *, tree, int); extern void cxx_print_error_function (struct diagnostic_context *, const char *); extern void build_self_reference (void); extern int same_signature_p (tree, tree); -extern void warn_hidden (tree); extern void maybe_add_class_template_decl_list (tree, tree, int); -extern tree get_enclosing_class (tree); -extern void unreverse_member_declarations (tree); -extern void invalidate_class_lookup_cache (void); -extern void maybe_note_name_used_in_class (tree, tree); -extern void note_name_declared_in_class (tree, tree); -extern tree get_vtbl_decl_for_binfo (tree); -extern tree get_vtt_name (tree); -extern tree get_primary_binfo (tree); +extern void unreverse_member_declarations (tree); +extern void invalidate_class_lookup_cache (void); +extern void maybe_note_name_used_in_class (tree, tree); +extern void note_name_declared_in_class (tree, tree); +extern tree get_vtbl_decl_for_binfo (tree); extern void debug_class (tree); -extern void debug_thunks (tree); +extern void debug_thunks (tree); +extern tree cp_fold_obj_type_ref (tree, tree); +extern void set_linkage_according_to_type (tree, tree); +extern void determine_key_method (tree); +extern void check_for_override (tree, tree); +extern void push_class_stack (void); +extern void pop_class_stack (void); /* in cvt.c */ -extern tree convert_to_reference (tree, tree, int, int, tree); -extern tree convert_from_reference (tree); -extern tree convert_lvalue (tree, tree); -extern tree force_rvalue (tree); -extern tree ocp_convert (tree, tree, int, int); -extern tree cp_convert (tree, tree); -extern tree convert_to_void (tree, const char */*implicit context*/); -extern tree convert_force (tree, tree, int); -extern tree build_type_conversion (tree, tree); -extern tree build_expr_type_conversion (int, tree, bool); -extern tree type_promotes_to (tree); -extern tree perform_qualification_conversions (tree, tree); -extern void clone_function_decl (tree, int); +extern tree convert_to_reference (tree, tree, int, int, tree); +extern tree convert_from_reference (tree); +extern tree force_rvalue (tree); +extern tree ocp_convert (tree, tree, int, int); +extern tree cp_convert (tree, tree); +extern tree convert_to_void (tree, const char */*implicit context*/); +extern tree convert_force (tree, tree, int); +extern tree build_expr_type_conversion (int, tree, bool); +extern tree type_promotes_to (tree); +extern tree perform_qualification_conversions (tree, tree); +extern void clone_function_decl (tree, int); extern void adjust_clone_args (tree); /* decl.c */ +extern tree poplevel (int, int, int); extern void insert_block (tree); -extern void set_block (tree); extern tree pushdecl (tree); +extern tree pushdecl_maybe_friend (tree, bool); extern void cxx_init_decl_processing (void); -enum cp_tree_node_structure_enum cp_tree_node_structure - (union lang_tree_node *); +enum cp_tree_node_structure_enum cp_tree_node_structure + (union lang_tree_node *); extern bool cxx_mark_addressable (tree); extern void cxx_push_function_context (struct function *); extern void cxx_pop_function_context (struct function *); -extern void cxx_mark_function_context (struct function *); -extern void maybe_push_cleanup_level (tree); -extern void finish_scope (void); -extern void delete_block (tree); -extern void add_block_current_level (tree); +extern void maybe_push_cleanup_level (tree); +extern void finish_scope (void); extern void push_switch (tree); extern void pop_switch (void); -extern void pushtag (tree, tree, int); +extern tree pushtag (tree, tree, tag_scope); extern tree make_anon_name (void); -extern void clear_anon_tags (void); extern int decls_match (tree, tree); -extern tree duplicate_decls (tree, tree); -extern tree pushdecl_top_level (tree); -extern tree pushdecl_top_level_and_finish (tree, tree); -extern tree push_using_decl (tree, tree); -extern tree implicitly_declare (tree); -extern tree declare_local_label (tree); +extern tree duplicate_decls (tree, tree, bool); +extern tree pushdecl_top_level_maybe_friend (tree, bool); +extern tree pushdecl_top_level_and_finish (tree, tree); +extern tree declare_local_label (tree); extern tree define_label (location_t, tree); extern void check_goto (tree); -extern void define_case_label (void); -extern tree make_typename_type (tree, tree, tsubst_flags_t); -extern tree make_unbound_class_template (tree, tree, tsubst_flags_t); -extern tree check_for_out_of_scope_variable (tree); +extern bool check_omp_return (void); +extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t); +extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t); +extern tree check_for_out_of_scope_variable (tree); extern tree build_library_fn (tree, tree); extern tree build_library_fn_ptr (const char *, tree); extern tree build_cp_library_fn_ptr (const char *, tree); extern tree push_library_fn (tree, tree); extern tree push_void_library_fn (tree, tree); extern tree push_throw_library_fn (tree, tree); -extern int init_type_desc (void); -extern tree check_tag_decl (tree); -extern tree shadow_tag (tree); -extern tree groktypename (tree); -extern tree start_decl (tree, tree, int, tree, tree); -extern void start_decl_1 (tree); -extern void cp_finish_decl (tree, tree, tree, int); +extern tree check_tag_decl (cp_decl_specifier_seq *); +extern tree shadow_tag (cp_decl_specifier_seq *); +extern tree groktypename (cp_decl_specifier_seq *, const cp_declarator *); +extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree, tree *); +extern void start_decl_1 (tree, bool); +extern void cp_finish_decl (tree, tree, bool, tree, int); extern void finish_decl (tree, tree, tree); -extern void maybe_inject_for_scope_var (tree); -extern tree start_handler_parms (tree, tree); -extern int complete_array_type (tree, tree, int); +extern int cp_complete_array_type (tree *, tree, bool); extern tree build_ptrmemfunc_type (tree); -extern tree build_ptrmem_type (tree, tree); +extern tree build_ptrmem_type (tree, tree); /* the grokdeclarator prototype is in decl.h */ +extern tree build_this_parm (tree, cp_cv_quals); extern int copy_fn_p (tree); -extern tree get_scope_of_declarator (tree); +extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); extern int grok_ctor_properties (tree, tree); extern bool grok_op_properties (tree, bool); -extern tree xref_tag (enum tag_types, tree, bool, bool); -extern tree xref_tag_from_type (tree, tree, int); -extern void xref_basetypes (tree, tree); +extern tree xref_tag (enum tag_types, tree, tag_scope, bool); +extern tree xref_tag_from_type (tree, tree, tag_scope); +extern bool xref_basetypes (tree, tree); extern tree start_enum (tree); extern void finish_enum (tree); extern void build_enumerator (tree, tree, tree); -extern int start_function (tree, tree, tree, int); +extern void start_preparsed_function (tree, tree, int); +extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree begin_function_body (void); extern void finish_function_body (tree); extern tree finish_function (int); -extern tree start_method (tree, tree, tree); +extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree); extern tree finish_method (tree); -extern void maybe_register_incomplete_var (tree); +extern void maybe_register_incomplete_var (tree); extern void complete_vars (tree); extern void finish_stmt (void); extern void print_other_binding_stack (struct cp_binding_level *); -extern void revert_static_member_fn (tree); -extern void fixup_anonymous_aggr (tree); -extern int check_static_variable_definition (tree, tree); +extern void revert_static_member_fn (tree); +extern void fixup_anonymous_aggr (tree); +extern int check_static_variable_definition (tree, tree); extern tree compute_array_index_type (tree, tree); -extern tree check_default_argument (tree, tree); -extern int vtable_decl_p (tree, void *); -extern int vtype_decl_p (tree, void *); -extern int sigtable_decl_p (tree, void *); -typedef bool (*walk_globals_pred) (tree, void *); -typedef bool (*walk_globals_fn) (tree *, void *); -extern bool walk_globals (walk_globals_pred, walk_globals_fn, void *); -extern bool walk_vtables (walk_globals_pred, walk_globals_fn, void *); -typedef int (*walk_namespaces_fn) (tree, void *); -extern int walk_namespaces (walk_namespaces_fn, - void *); -extern int wrapup_globals_for_namespace (tree, void *); -extern tree create_implicit_typedef (tree, tree); -extern tree maybe_push_decl (tree); +extern tree check_default_argument (tree, tree); +typedef int (*walk_namespaces_fn) (tree, void *); +extern int walk_namespaces (walk_namespaces_fn, + void *); +extern int wrapup_globals_for_namespace (tree, void *); +extern tree create_implicit_typedef (tree, tree); +extern tree maybe_push_decl (tree); extern tree force_target_expr (tree, tree); -extern tree build_target_expr_with_type (tree, tree); -extern int local_variable_p (tree); -extern int nonstatic_local_decl_p (tree); -extern tree declare_global_var (tree, tree); -extern void register_dtor_fn (tree); -extern tmpl_spec_kind current_tmpl_spec_kind (int); +extern tree build_target_expr_with_type (tree, tree); +extern int local_variable_p (tree); +extern int nonstatic_local_decl_p (tree); +extern tree register_dtor_fn (tree); +extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); -extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); -extern tree cxx_builtin_type_decls (void); -extern void warn_extern_redeclared_static (tree, tree); -extern tree check_var_type (tree, tree); - -extern bool have_extern_spec; +extern tree builtin_function (const char *name, tree type, + int code, + enum built_in_class cl, + const char *libname, + tree attrs); +extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); +extern void warn_extern_redeclared_static (tree, tree); +extern const char *cxx_comdat_group (tree); +extern bool cp_missing_noreturn_ok_p (tree); +extern void initialize_artificial_var (tree, tree); +extern tree check_var_type (tree, tree); +extern tree reshape_init (tree, tree); /* in decl2.c */ -extern bool check_java_method (tree); -extern int grok_method_quals (tree, tree, tree); -extern void grok_x_components (tree); -extern void maybe_retrofit_in_chrg (tree); -extern void maybe_make_one_only (tree); -extern void grokclassfn (tree, tree, enum overload_flags, tree); -extern tree grok_array_decl (tree, tree); -extern tree delete_sanity (tree, tree, bool, int); -extern tree check_classfn (tree, tree, bool); -extern void check_member_template (tree); -extern tree grokfield (tree, tree, tree, tree, tree); -extern tree grokbitfield (tree, tree, tree); -extern tree groktypefield (tree, tree); -extern void cplus_decl_attributes (tree *, tree, int); -extern void defer_fn (tree); -extern void finish_anon_union (tree); -extern tree finish_table (tree, tree, tree, int); -extern tree coerce_new_type (tree); -extern tree coerce_delete_type (tree); -extern void comdat_linkage (tree); -extern void import_export_vtable (tree, tree, int); -extern void import_export_decl (tree); -extern void import_export_tinfo (tree, tree, bool); +extern bool check_java_method (tree); +extern tree build_memfn_type (tree, tree, cp_cv_quals); +extern void maybe_retrofit_in_chrg (tree); +extern void maybe_make_one_only (tree); +extern void grokclassfn (tree, tree, + enum overload_flags); +extern tree grok_array_decl (tree, tree); +extern tree delete_sanity (tree, tree, bool, int); +extern tree check_classfn (tree, tree, tree); +extern void check_member_template (tree); +extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *, + tree, bool, tree, tree); +extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *, + tree); +extern void cplus_decl_attributes (tree *, tree, int); +extern void finish_anon_union (tree); +extern void cp_finish_file (void); +extern tree coerce_new_type (tree); +extern tree coerce_delete_type (tree); +extern void comdat_linkage (tree); +extern void determine_visibility (tree); +extern void constrain_class_visibility (tree); +extern void update_member_visibility (tree); +extern void import_export_decl (tree); extern tree build_cleanup (tree); -extern tree build_offset_ref_call_from_tree (tree, tree); -extern void check_default_args (tree); -extern void mark_used (tree); -extern void finish_static_data_member_decl (tree, tree, tree, int); -extern tree cp_build_parm_decl (tree, tree); -extern tree build_artificial_parm (tree, tree); -extern tree get_guard (tree); -extern tree get_guard_cond (tree); -extern tree set_guard (tree); -extern tree cxx_callgraph_analyze_expr (tree *, int *, tree); - -/* XXX Not i18n clean. */ -#define cp_deprecated(STR) \ - do { \ - if (warn_deprecated) \ - warning ("%s is deprecated, please see the documentation for details", \ - (STR)); \ - } while (0) +extern tree build_offset_ref_call_from_tree (tree, tree); +extern void check_default_args (tree); +extern void mark_used (tree); +extern void finish_static_data_member_decl (tree, tree, bool, tree, int); +extern tree cp_build_parm_decl (tree, tree); +extern tree get_guard (tree); +extern tree get_guard_cond (tree); +extern tree set_guard (tree); +extern tree cxx_callgraph_analyze_expr (tree *, int *, tree); +extern void mark_needed (tree); +extern bool decl_needed_p (tree); +extern void note_vague_linkage_fn (tree); +extern tree build_artificial_parm (tree, tree); /* in error.c */ extern void init_error (void); extern const char *type_as_string (tree, int); extern const char *decl_as_string (tree, int); extern const char *expr_as_string (tree, int); -extern const char *context_as_string (tree, int); extern const char *lang_decl_name (tree, int); -extern const char *language_to_string (enum languages); -extern void print_instantiation_context (void); +extern const char *language_to_string (enum languages); +extern const char *class_key_or_enum_as_string (tree); +extern void print_instantiation_context (void); /* in except.c */ extern void init_exception_processing (void); extern tree expand_start_catch_block (tree); extern void expand_end_catch_block (void); -extern void expand_builtin_throw (void); -extern void expand_eh_spec_block (tree); -extern void expand_exception_blocks (void); extern tree build_exc_ptr (void); extern tree build_throw (tree); -extern void mark_all_runtime_matches (void); extern int nothrow_libfn_p (tree); extern void check_handlers (tree); extern void choose_personality_routine (enum languages); @@ -3806,355 +4027,362 @@ extern tree eh_type_info (tree); extern rtx cxx_expand_expr (tree, rtx, enum machine_mode, int, rtx *); -extern tree cplus_expand_constant (tree); +extern tree cplus_expand_constant (tree); /* friend.c */ extern int is_friend (tree, tree); extern void make_friend_class (tree, tree, bool); -extern void add_friend (tree, tree, bool); -extern tree do_friend (tree, tree, tree, tree, enum overload_flags, tree, int); +extern void add_friend (tree, tree, bool); +extern tree do_friend (tree, tree, tree, tree, enum overload_flags, bool); /* in init.c */ extern tree expand_member_init (tree); extern void emit_mem_initializers (tree); extern tree build_aggr_init (tree, tree, int); -extern tree build_init (tree, tree, int); extern int is_aggr_type (tree, int); -extern tree get_aggr_from_typedef (tree, int); extern tree get_type_value (tree); -extern tree build_zero_init (tree, tree, bool); +extern tree build_zero_init (tree, tree, bool); extern tree build_offset_ref (tree, tree, bool); -extern tree build_new (tree, tree, tree, int); -extern tree build_vec_init (tree, tree, tree, int); -extern tree build_x_delete (tree, int, tree); -extern tree build_delete (tree, tree, special_function_kind, int, int); +extern tree build_new (tree, tree, tree, tree, int); +extern tree build_vec_init (tree, tree, tree, bool, int); +extern tree build_delete (tree, tree, + special_function_kind, + int, int); extern void push_base_cleanups (void); -extern tree build_vbase_delete (tree, tree); -extern tree build_vec_delete (tree, tree, special_function_kind, int); -extern tree create_temporary_var (tree); -extern void initialize_vtbl_ptrs (tree); -extern tree build_java_class_ref (tree); - -/* in input.c */ +extern tree build_vec_delete (tree, tree, + special_function_kind, int); +extern tree create_temporary_var (tree); +extern void initialize_vtbl_ptrs (tree); +extern tree build_java_class_ref (tree); +extern tree integral_constant_value (tree); /* in lex.c */ extern void cxx_dup_lang_specific_decl (tree); -extern tree make_pointer_declarator (tree, tree); -extern tree make_reference_declarator (tree, tree); -extern tree make_call_declarator (tree, tree, tree, tree); -extern void set_quals_and_spec (tree, tree, tree); -extern void print_parse_statistics (void); -extern void do_pending_inlines (void); extern void yyungetc (int, int); -extern void snarf_method (tree); -extern void see_typename (void); -extern tree unqualified_name_lookup_error (tree); -extern tree unqualified_fn_lookup_error (tree); +extern tree unqualified_name_lookup_error (tree); +extern tree unqualified_fn_lookup_error (tree); extern tree build_lang_decl (enum tree_code, tree, tree); extern void retrofit_lang_decl (tree); -extern tree copy_decl (tree); -extern tree copy_type (tree); +extern tree copy_decl (tree); +extern tree copy_type (tree); extern tree cxx_make_type (enum tree_code); extern tree make_aggr_type (enum tree_code); extern void yyerror (const char *); extern void yyhook (int); -extern int cp_type_qual_from_rid (tree); extern bool cxx_init (void); -extern void cxx_finish (void); +extern void cxx_finish (void); /* in method.c */ -extern void init_method (void); -extern void set_mangled_name_for_decl (tree); -extern tree make_thunk (tree, bool, tree, tree); -extern void finish_thunk (tree); -extern void use_thunk (tree, bool); -extern void synthesize_method (tree); -extern tree implicitly_declare_fn (special_function_kind, tree, bool); -extern tree skip_artificial_parms_for (tree, tree); +extern void init_method (void); +extern tree make_thunk (tree, bool, tree, tree); +extern void finish_thunk (tree); +extern void use_thunk (tree, bool); +extern void synthesize_method (tree); +extern tree lazily_declare_fn (special_function_kind, + tree); +extern tree skip_artificial_parms_for (tree, tree); +extern tree make_alias_for (tree, tree); /* In optimize.c */ -extern void optimize_function (tree); -extern bool calls_setjmp_p (tree); -extern bool maybe_clone_body (tree); +extern bool maybe_clone_body (tree); /* in pt.c */ extern void check_template_shadow (tree); -extern tree get_innermost_template_args (tree, int); +extern tree get_innermost_template_args (tree, int); extern void maybe_begin_member_template_processing (tree); extern void maybe_end_member_template_processing (void); -extern tree finish_member_template_decl (tree); +extern tree finish_member_template_decl (tree); extern void begin_template_parm_list (void); -extern void begin_specialization (void); -extern void reset_specialization (void); -extern void end_specialization (void); -extern void begin_explicit_instantiation (void); -extern void end_explicit_instantiation (void); -extern tree check_explicit_specialization (tree, tree, int, int); -extern tree process_template_parm (tree, tree); +extern bool begin_specialization (void); +extern void reset_specialization (void); +extern void end_specialization (void); +extern void begin_explicit_instantiation (void); +extern void end_explicit_instantiation (void); +extern tree check_explicit_specialization (tree, tree, int, int); +extern tree process_template_parm (tree, tree, bool); extern tree end_template_parm_list (tree); extern void end_template_decl (void); -extern tree current_template_args (void); extern tree push_template_decl (tree); -extern tree push_template_decl_real (tree, int); -extern void redeclare_class_template (tree, tree); -extern tree lookup_template_class (tree, tree, tree, tree, int, tsubst_flags_t); -extern tree lookup_template_function (tree, tree); +extern tree push_template_decl_real (tree, bool); +extern bool redeclare_class_template (tree, tree); +extern tree lookup_template_class (tree, tree, tree, tree, + int, tsubst_flags_t); +extern tree lookup_template_function (tree, tree); extern int uses_template_parms (tree); extern int uses_template_parms_level (tree, int); extern tree instantiate_class_template (tree); extern tree instantiate_template (tree, tree, tsubst_flags_t); -extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t, int); -extern tree tinst_for_decl (void); +extern int fn_type_unification (tree, tree, tree, tree, + tree, unification_kind_t, int); extern void mark_decl_instantiated (tree, int); -extern int more_specialized (tree, tree, int, int); -extern void mark_class_instantiated (tree, int); +extern int more_specialized_fn (tree, tree, int); extern void do_decl_instantiation (tree, tree); extern void do_type_instantiation (tree, tree, tsubst_flags_t); -extern tree instantiate_decl (tree, int); -extern int push_tinst_level (tree); -extern void pop_tinst_level (void); -extern int more_specialized_class (tree, tree, tree); -extern int is_member_template (tree); -extern int comp_template_parms (tree, tree); -extern int template_class_depth (tree); -extern int is_specialization_of (tree, tree); -extern bool is_specialization_of_friend (tree, tree); -extern int comp_template_args (tree, tree); -extern void maybe_process_partial_specialization (tree); -extern tree most_specialized_instantiation (tree); -extern void print_candidates (tree); -extern int instantiate_pending_templates (void); -extern tree tsubst_default_argument (tree, tree, tree); -extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree, bool); +extern tree instantiate_decl (tree, int, bool); +extern int comp_template_parms (tree, tree); +extern int template_class_depth (tree); +extern int is_specialization_of (tree, tree); +extern bool is_specialization_of_friend (tree, tree); +extern int comp_template_args (tree, tree); +extern tree maybe_process_partial_specialization (tree); +extern tree most_specialized_instantiation (tree); +extern void print_candidates (tree); +extern void instantiate_pending_templates (int); +extern tree tsubst_default_argument (tree, tree, tree); +extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, + tree, bool, bool); extern tree most_general_template (tree); extern tree get_mostly_instantiated_function_type (tree); -extern int problematic_instantiation_changed (void); +extern int problematic_instantiation_changed (void); extern void record_last_problematic_instantiation (void); -extern tree current_instantiation (void); +extern tree current_instantiation (void); extern tree maybe_get_template_decl_from_type_decl (tree); extern int processing_template_parmlist; -extern bool dependent_type_p (tree); +extern bool dependent_type_p (tree); extern bool any_dependent_template_arguments_p (tree); -extern bool dependent_template_p (tree); -extern bool dependent_template_id_p (tree, tree); -extern bool type_dependent_expression_p (tree); +extern bool dependent_template_p (tree); +extern bool dependent_template_id_p (tree, tree); +extern bool type_dependent_expression_p (tree); extern bool any_type_dependent_arguments_p (tree); -extern bool value_dependent_expression_p (tree); -extern tree resolve_typename_type (tree, bool); -extern tree template_for_substitution (tree); -extern tree build_non_dependent_expr (tree); -extern tree build_non_dependent_args (tree); -extern bool reregister_specialization (tree, tree, tree); -extern tree fold_non_dependent_expr (tree); +extern bool value_dependent_expression_p (tree); +extern tree resolve_typename_type (tree, bool); +extern tree template_for_substitution (tree); +extern tree build_non_dependent_expr (tree); +extern tree build_non_dependent_args (tree); +extern bool reregister_specialization (tree, tree, tree); +extern tree fold_non_dependent_expr (tree); +extern bool explicit_class_specialization_p (tree); /* in repo.c */ -extern void repo_template_used (tree); -extern void repo_template_instantiated (tree, bool); -extern void init_repo (const char *); -extern void finish_repo (void); +extern void init_repo (void); +extern int repo_emit_p (tree); +extern bool repo_export_class_p (tree); +extern void finish_repo (void); /* in rtti.c */ -/* A varray of all tinfo decls that haven't been emitted yet. */ -extern GTY(()) varray_type unemitted_tinfo_decls; +/* A vector of all tinfo decls that haven't been emitted yet. */ +extern GTY(()) VEC(tree,gc) *unemitted_tinfo_decls; -extern void init_rtti_processing (void); -extern tree build_typeid (tree); -extern tree get_tinfo_decl (tree); -extern tree get_typeid (tree); -extern tree build_dynamic_cast (tree, tree); -extern void emit_support_tinfos (void); -extern bool emit_tinfo_decl (tree); +extern void init_rtti_processing (void); +extern tree build_typeid (tree); +extern tree get_tinfo_decl (tree); +extern tree get_typeid (tree); +extern tree build_dynamic_cast (tree, tree); +extern void emit_support_tinfos (void); +extern bool emit_tinfo_decl (tree); /* in search.c */ -extern bool accessible_base_p (tree, tree); -extern tree lookup_base (tree, tree, base_access, base_kind *); -extern int types_overlap_p (tree, tree); -extern tree get_dynamic_cast_base_type (tree, tree); -extern int accessible_p (tree, tree); -extern tree lookup_field_1 (tree, tree, bool); +extern bool accessible_base_p (tree, tree, bool); +extern tree lookup_base (tree, tree, base_access, + base_kind *); +extern tree dcast_base_hint (tree, tree); +extern int accessible_p (tree, tree, bool); +extern tree lookup_field_1 (tree, tree, bool); extern tree lookup_field (tree, tree, int, bool); -extern int lookup_fnfields_1 (tree, tree); +extern int lookup_fnfields_1 (tree, tree); +extern int class_method_index_for_fn (tree, tree); extern tree lookup_fnfields (tree, tree, int); extern tree lookup_member (tree, tree, int, bool); extern int look_for_overrides (tree, tree); -extern void get_pure_virtuals (tree); +extern void get_pure_virtuals (tree); extern void maybe_suppress_debug_info (tree); extern void note_debug_info_needed (tree); -extern void push_class_decls (tree); -extern void pop_class_decls (void); -extern void unuse_fields (tree); extern void print_search_statistics (void); -extern void init_search_processing (void); extern void reinit_search_statistics (void); extern tree current_scope (void); -extern int at_function_scope_p (void); -extern bool at_class_scope_p (void); -extern bool at_namespace_scope_p (void); +extern int at_function_scope_p (void); +extern bool at_class_scope_p (void); +extern bool at_namespace_scope_p (void); extern tree context_for_name_lookup (tree); extern tree lookup_conversions (tree); -extern tree binfo_for_vtable (tree); extern tree binfo_from_vbase (tree); +extern tree binfo_for_vbase (tree, tree); extern tree look_for_overrides_here (tree, tree); -extern int check_final_overrider (tree, tree); -extern tree dfs_walk (tree, - tree (*) (tree, void *), - tree (*) (tree, int, void *), - void *); -extern tree dfs_walk_real (tree, - tree (*) (tree, void *), - tree (*) (tree, void *), - tree (*) (tree, int, void *), - void *); -extern tree dfs_unmark (tree, void *); -extern tree markedp (tree, int, void *); -extern tree unmarkedp (tree, int, void *); -extern tree binfo_via_virtual (tree, tree); -extern tree build_baselink (tree, tree, tree, tree); +#define dfs_skip_bases ((tree)1) +extern tree dfs_walk_all (tree, tree (*) (tree, void *), + tree (*) (tree, void *), void *); +extern tree dfs_walk_once (tree, tree (*) (tree, void *), + tree (*) (tree, void *), void *); +extern tree binfo_via_virtual (tree, tree); +extern tree build_baselink (tree, tree, tree, tree); extern tree adjust_result_of_qualified_name_lookup - (tree, tree, tree); + (tree, tree, tree); extern tree copied_binfo (tree, tree); extern tree original_binfo (tree, tree); -extern int shared_member_p (tree); +extern int shared_member_p (tree); + + +/* The representation of a deferred access check. */ + +typedef struct deferred_access_check GTY(()) +{ + /* The base class in which the declaration is referenced. */ + tree binfo; + /* The declaration whose access must be checked. */ + tree decl; + /* The declaration that should be used in the error message. */ + tree diag_decl; +} deferred_access_check; +DEF_VEC_O(deferred_access_check); +DEF_VEC_ALLOC_O(deferred_access_check,gc); /* in semantics.c */ extern void push_deferring_access_checks (deferring_kind); extern void resume_deferring_access_checks (void); extern void stop_deferring_access_checks (void); extern void pop_deferring_access_checks (void); -extern tree get_deferred_access_checks (void); -extern void pop_to_parent_deferring_access_checks (void); +extern VEC (deferred_access_check,gc)* get_deferred_access_checks (void); +extern void pop_to_parent_deferring_access_checks (void); +extern void perform_access_checks (VEC (deferred_access_check,gc)*); extern void perform_deferred_access_checks (void); -extern void perform_or_defer_access_check (tree, tree); -extern void init_cp_semantics (void); -extern tree finish_expr_stmt (tree); -extern tree begin_if_stmt (void); -extern void finish_if_stmt_cond (tree, tree); -extern tree finish_then_clause (tree); -extern void begin_else_clause (void); -extern void finish_else_clause (tree); -extern void finish_if_stmt (void); -extern tree begin_while_stmt (void); -extern void finish_while_stmt_cond (tree, tree); -extern void finish_while_stmt (tree); -extern tree begin_do_stmt (void); -extern void finish_do_body (tree); -extern void finish_do_stmt (tree, tree); -extern tree finish_return_stmt (tree); -extern tree begin_for_stmt (void); -extern void finish_for_init_stmt (tree); -extern void finish_for_cond (tree, tree); -extern void finish_for_expr (tree, tree); -extern void finish_for_stmt (tree); -extern tree finish_break_stmt (void); -extern tree finish_continue_stmt (void); -extern tree begin_switch_stmt (void); -extern void finish_switch_cond (tree, tree); -extern void finish_switch_stmt (tree); -extern tree finish_case_label (tree, tree); -extern tree finish_goto_stmt (tree); -extern tree begin_try_block (void); -extern void finish_try_block (tree); +extern void perform_or_defer_access_check (tree, tree, tree); +extern int stmts_are_full_exprs_p (void); +extern void init_cp_semantics (void); +extern tree do_poplevel (tree); +extern void add_decl_expr (tree); +extern tree finish_expr_stmt (tree); +extern tree begin_if_stmt (void); +extern void finish_if_stmt_cond (tree, tree); +extern tree finish_then_clause (tree); +extern void begin_else_clause (tree); +extern void finish_else_clause (tree); +extern void finish_if_stmt (tree); +extern tree begin_while_stmt (void); +extern void finish_while_stmt_cond (tree, tree); +extern void finish_while_stmt (tree); +extern tree begin_do_stmt (void); +extern void finish_do_body (tree); +extern void finish_do_stmt (tree, tree); +extern tree finish_return_stmt (tree); +extern tree begin_for_stmt (void); +extern void finish_for_init_stmt (tree); +extern void finish_for_cond (tree, tree); +extern void finish_for_expr (tree, tree); +extern void finish_for_stmt (tree); +extern tree finish_break_stmt (void); +extern tree finish_continue_stmt (void); +extern tree begin_switch_stmt (void); +extern void finish_switch_cond (tree, tree); +extern void finish_switch_stmt (tree); +extern tree finish_case_label (tree, tree); +extern tree finish_goto_stmt (tree); +extern tree begin_try_block (void); +extern void finish_try_block (tree); extern tree begin_eh_spec_block (void); extern void finish_eh_spec_block (tree, tree); -extern void finish_handler_sequence (tree); -extern tree begin_function_try_block (void); -extern void finish_function_try_block (tree); -extern void finish_function_handler_sequence (tree); -extern void finish_cleanup_try_block (tree); -extern tree begin_handler (void); -extern void finish_handler_parms (tree, tree); -extern void begin_catch_block (tree); -extern void finish_handler (tree); -extern void finish_cleanup (tree, tree); -extern tree begin_compound_stmt (bool); -extern tree finish_compound_stmt (tree); -extern tree finish_asm_stmt (tree, tree, tree, tree, tree); -extern tree finish_label_stmt (tree); -extern void finish_label_decl (tree); -extern void finish_subobject (tree); -extern tree finish_parenthesized_expr (tree); +extern void finish_handler_sequence (tree); +extern tree begin_function_try_block (tree *); +extern void finish_function_try_block (tree); +extern void finish_function_handler_sequence (tree, tree); +extern void finish_cleanup_try_block (tree); +extern tree begin_handler (void); +extern void finish_handler_parms (tree, tree); +extern void finish_handler (tree); +extern void finish_cleanup (tree, tree); + +enum { + BCS_NO_SCOPE = 1, + BCS_TRY_BLOCK = 2, + BCS_FN_BODY = 4 +}; +extern tree begin_compound_stmt (unsigned int); + +extern void finish_compound_stmt (tree); +extern tree finish_asm_stmt (int, tree, tree, tree, tree); +extern tree finish_label_stmt (tree); +extern void finish_label_decl (tree); +extern tree finish_parenthesized_expr (tree); extern tree finish_non_static_data_member (tree, tree, tree); -extern tree begin_stmt_expr (void); -extern tree finish_stmt_expr_expr (tree); -extern tree finish_stmt_expr (tree, bool); -extern tree perform_koenig_lookup (tree, tree); -extern tree finish_call_expr (tree, tree, bool, bool); -extern tree finish_increment_expr (tree, enum tree_code); -extern tree finish_this_expr (void); +extern tree begin_stmt_expr (void); +extern tree finish_stmt_expr_expr (tree, tree); +extern tree finish_stmt_expr (tree, bool); +extern tree perform_koenig_lookup (tree, tree); +extern tree finish_call_expr (tree, tree, bool, bool); +extern tree finish_increment_expr (tree, enum tree_code); +extern tree finish_this_expr (void); extern tree finish_pseudo_destructor_expr (tree, tree, tree); -extern tree finish_unary_op_expr (enum tree_code, tree); -extern tree finish_compound_literal (tree, tree); -extern tree finish_fname (tree); -extern int begin_function_definition (tree, tree, tree); -extern void finish_translation_unit (void); -extern tree finish_template_type_parm (tree, tree); +extern tree finish_unary_op_expr (enum tree_code, tree); +extern tree finish_compound_literal (tree, VEC(constructor_elt,gc) *); +extern tree finish_fname (tree); +extern void finish_translation_unit (void); +extern tree finish_template_type_parm (tree, tree); extern tree finish_template_template_parm (tree, tree); -extern tree finish_parmlist (tree, int); -extern tree begin_class_definition (tree); -extern void finish_default_args (void); -extern tree finish_member_class_template (tree); -extern void finish_template_decl (tree); -extern tree finish_template_type (tree, tree, int); -extern tree finish_base_specifier (tree, tree, bool); -extern void finish_member_declaration (tree); -extern void check_multiple_declarators (void); -extern void qualified_name_lookup_error (tree, tree); -extern tree finish_id_expression (tree, tree, tree, - cp_id_kind *, tree *, - bool, bool, bool *, +extern tree begin_class_definition (tree, tree); +extern void finish_template_decl (tree); +extern tree finish_template_type (tree, tree, int); +extern tree finish_base_specifier (tree, tree, bool); +extern void finish_member_declaration (tree); +extern void qualified_name_lookup_error (tree, tree, tree); +extern void check_template_keyword (tree); +extern tree finish_id_expression (tree, tree, tree, + cp_id_kind *, + bool, bool, bool *, + bool, bool, bool, bool, const char **); extern tree finish_typeof (tree); -extern void finish_decl_cleanup (tree, tree); -extern void finish_eh_cleanup (tree); -extern void expand_body (tree); -extern void cxx_expand_function_start (void); -extern tree nullify_returns_r (tree *, int *, void *); -extern void do_pushlevel (scope_kind); -extern tree do_poplevel (void); -extern void finish_mem_initializers (tree); -extern void setup_vtbl_ptr (tree, tree); -extern void clear_out_block (void); +extern tree finish_offsetof (tree); +extern void finish_decl_cleanup (tree, tree); +extern void finish_eh_cleanup (tree); +extern void expand_body (tree); +extern void finish_mem_initializers (tree); extern tree check_template_template_default_arg (tree); extern void expand_or_defer_fn (tree); extern void check_accessibility_of_qualified_id (tree, tree, tree); -extern tree finish_qualified_id_expr (tree, tree, bool, bool); +extern tree finish_qualified_id_expr (tree, tree, bool, bool, + bool, bool); extern void simplify_aggr_init_expr (tree *); +extern void finalize_nrv (tree *, tree, tree); +extern void note_decl_for_pch (tree); +extern tree finish_omp_clauses (tree); +extern void finish_omp_threadprivate (tree); +extern tree begin_omp_structured_block (void); +extern tree finish_omp_structured_block (tree); +extern tree begin_omp_parallel (void); +extern tree finish_omp_parallel (tree, tree); +extern tree finish_omp_for (location_t, tree, tree, + tree, tree, tree, tree); +extern void finish_omp_atomic (enum tree_code, tree, tree); +extern void finish_omp_barrier (void); +extern void finish_omp_flush (void); +extern enum omp_clause_default_kind cxx_omp_predetermined_sharing (tree); +extern tree cxx_omp_clause_default_ctor (tree, tree); +extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); +extern tree cxx_omp_clause_assign_op (tree, tree, tree); +extern tree cxx_omp_clause_dtor (tree, tree); +extern bool cxx_omp_privatize_by_reference (tree); +extern tree baselink_for_fns (tree); /* in tree.c */ extern void lang_check_failed (const char *, int, - const char *); + const char *) ATTRIBUTE_NORETURN; extern tree stabilize_expr (tree, tree *); extern void stabilize_call (tree, tree *); extern bool stabilize_init (tree, tree *); -extern tree cxx_unsave_expr_now (tree); +extern tree add_stmt_to_compound (tree, tree); extern tree cxx_maybe_build_cleanup (tree); -extern void init_tree (void); +extern void init_tree (void); extern int pod_type_p (tree); extern int zero_init_p (tree); -extern tree canonical_type_variant (tree); -extern tree copy_base_binfos (tree, tree, tree); +extern tree canonical_type_variant (tree); +extern tree copy_binfo (tree, tree, tree, + tree *, int); extern int member_p (tree); -extern cp_lvalue_kind real_lvalue_p (tree); +extern cp_lvalue_kind real_lvalue_p (tree); +extern bool builtin_valid_in_constant_expr_p (tree); extern tree build_min (enum tree_code, tree, ...); extern tree build_min_nt (enum tree_code, ...); extern tree build_min_non_dep (enum tree_code, tree, ...); extern tree build_cplus_new (tree, tree); extern tree get_target_expr (tree); -extern tree build_cplus_staticfn_type (tree, tree, tree); extern tree build_cplus_array_type (tree, tree); extern tree hash_tree_cons (tree, tree, tree); extern tree hash_tree_chain (tree, tree); -extern tree hash_chainon (tree, tree); -extern tree make_binfo (tree, tree, tree, tree); -extern int count_functions (tree); +extern tree build_qualified_name (tree, tree, tree, bool); extern int is_overloaded_fn (tree); extern tree get_first_fn (tree); -extern int bound_pmf_p (tree); -extern tree ovl_cons (tree, tree); -extern tree build_overload (tree, tree); -extern tree function_arg_chain (tree); -extern int promotes_to_aggr_type (tree, enum tree_code); +extern tree ovl_cons (tree, tree); +extern tree build_overload (tree, tree); extern const char *cxx_printable_name (tree, int); extern tree build_exception_variant (tree, tree); extern tree bind_template_template_parm (tree, tree); @@ -4162,79 +4390,72 @@ extern tree array_type_nelts_total (tree); extern tree array_type_nelts_top (tree); extern tree break_out_target_exprs (tree); extern tree get_type_decl (tree); -extern tree vec_binfo_member (tree, tree); extern tree decl_namespace_context (tree); +extern bool decl_anon_ns_mem_p (tree); extern tree lvalue_type (tree); extern tree error_type (tree); -extern tree build_zc_wrapper (struct z_candidate *); extern int varargs_function_p (tree); -extern int really_overloaded_fn (tree); +extern bool really_overloaded_fn (tree); extern bool cp_tree_equal (tree, tree); -extern tree no_linkage_check (tree); +extern tree no_linkage_check (tree, bool); extern void debug_binfo (tree); extern tree build_dummy_object (tree); extern tree maybe_dummy_object (tree, tree *); extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; -extern tree make_ptrmem_cst (tree, tree); +extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); -extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); +extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ - cp_build_qualified_type_real ((TYPE), (QUALS), tf_error | tf_warning) -extern tree build_shared_int_cst (int); + cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) extern special_function_kind special_function_p (tree); -extern bool name_p (tree); -extern int count_trees (tree); -extern int char_type_p (tree); -extern void verify_stmt_tree (tree); -extern tree find_tree (tree, tree); -extern linkage_kind decl_linkage (tree); +extern int count_trees (tree); +extern int char_type_p (tree); +extern void verify_stmt_tree (tree); +extern linkage_kind decl_linkage (tree); extern tree cp_walk_subtrees (tree*, int*, walk_tree_fn, - void*, void*); -extern int cp_cannot_inline_tree_fn (tree*); -extern tree cp_add_pending_fn_decls (void*,tree); -extern int cp_is_overload_p (tree); -extern int cp_auto_var_in_fn_p (tree,tree); -extern tree fold_if_not_in_template (tree); -extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*, - int*, tree); + void*, struct pointer_set_t*); +extern int cp_cannot_inline_tree_fn (tree*); +extern tree cp_add_pending_fn_decls (void*,tree); +extern int cp_auto_var_in_fn_p (tree,tree); +extern tree fold_if_not_in_template (tree); +extern tree rvalue (tree); +extern tree convert_bitfield_to_declared_type (tree); +extern tree cp_save_expr (tree); +extern bool cast_valid_in_integral_constant_expression_p (tree); /* in typeck.c */ extern int string_conv_p (tree, tree, int); extern tree cp_truthvalue_conversion (tree); extern tree condition_conversion (tree); -extern tree target_type (tree); extern tree require_complete_type (tree); extern tree complete_type (tree); -extern tree complete_type_or_diagnostic (tree, tree, int); -#define complete_type_or_else(T,V) (complete_type_or_diagnostic ((T), (V), 0)) +extern tree complete_type_or_else (tree, tree); extern int type_unknown_p (tree); -extern tree commonparms (tree, tree); -extern tree original_type (tree); extern bool comp_except_specs (tree, tree, bool); extern bool comptypes (tree, tree, int); extern bool compparms (tree, tree); -extern int comp_cv_qualification (tree, tree); -extern int comp_cv_qual_signature (tree, tree); -extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); -extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); +extern int comp_cv_qualification (tree, tree); +extern int comp_cv_qual_signature (tree, tree); +extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); +extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) extern tree inline_conversion (tree); +extern tree is_bitfield_expr_with_lowered_type (tree); +extern tree unlowered_expr_type (tree); extern tree decay_conversion (tree); -extern tree perform_integral_promotions (tree); extern tree build_class_member_access_expr (tree, tree, tree, bool); -extern tree finish_class_member_access_expr (tree, tree); +extern tree finish_class_member_access_expr (tree, tree, bool); extern tree build_x_indirect_ref (tree, const char *); extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); -extern tree convert_arguments (tree, tree, tree, int); -extern tree build_x_binary_op (enum tree_code, tree, tree, +extern tree build_x_binary_op (enum tree_code, tree, tree, bool *); extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (tree, tree, tree); -extern tree build_x_compound_expr_from_list (tree, const char *); +extern tree build_x_compound_expr_from_list (tree, const char *); extern tree build_x_compound_expr (tree, tree); extern tree build_compound_expr (tree, tree); extern tree build_static_cast (tree, tree); @@ -4243,33 +4464,37 @@ extern tree build_const_cast (tree, tree); extern tree build_c_cast (tree, tree); extern tree build_x_modify_expr (tree, enum tree_code, tree); extern tree build_modify_expr (tree, enum tree_code, tree); -extern tree dubious_conversion_warnings (tree, tree, const char *, tree, int); -extern tree convert_for_initialization (tree, tree, tree, int, const char *, tree, int); +extern tree convert_for_initialization (tree, tree, tree, int, + const char *, tree, int); extern int comp_ptr_ttypes (tree, tree); +extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (tree, tree); -extern tree build_ptrmemfunc (tree, tree, int); -extern int cp_type_quals (tree); -extern bool cp_has_mutable_p (tree); -extern bool at_least_as_qualified_p (tree, tree); -extern bool more_qualified_p (tree, tree); -extern tree build_ptrmemfunc1 (tree, tree, tree); -extern void expand_ptrmemfunc_cst (tree, tree *, tree *); -extern tree pfn_from_ptrmemfunc (tree); +extern tree build_ptrmemfunc (tree, tree, int, bool); +extern int cp_type_quals (tree); +extern bool cp_type_readonly (tree); +extern bool cp_has_mutable_p (tree); +extern bool at_least_as_qualified_p (tree, tree); +extern void cp_apply_type_quals_to_decl (int, tree); +extern tree build_ptrmemfunc1 (tree, tree, tree); +extern void expand_ptrmemfunc_cst (tree, tree *, tree *); extern tree type_after_usual_arithmetic_conversions (tree, tree); -extern tree composite_pointer_type (tree, tree, tree, tree, - const char*); +extern tree composite_pointer_type (tree, tree, tree, tree, + const char*); extern tree merge_types (tree, tree); -extern tree check_return_expr (tree); +extern tree check_return_expr (tree, bool *); #define cp_build_binary_op(code, arg1, arg2) \ build_binary_op(code, arg1, arg2, 1) #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) -#define cxx_alignof(T) cxx_sizeof_or_alignof_type (T, ALIGNOF_EXPR, true) -extern tree build_ptrmemfunc_access_expr (tree, tree); -extern tree build_address (tree); -extern tree build_nop (tree, tree); -extern tree non_reference (tree); -extern tree lookup_anon_field (tree, tree); -extern bool invalid_nonstatic_memfn_p (tree); +extern tree build_ptrmemfunc_access_expr (tree, tree); +extern tree build_address (tree); +extern tree build_nop (tree, tree); +extern tree non_reference (tree); +extern tree lookup_anon_field (tree, tree); +extern bool invalid_nonstatic_memfn_p (tree); +extern tree convert_member_func_to_ptr (tree, tree); +extern tree convert_ptrmem (tree, tree, bool, bool); +extern int lvalue_or_else (tree, enum lvalue_use); +extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); @@ -4281,49 +4506,66 @@ extern void cxx_incomplete_type_error (tree, tree); extern tree error_not_base_type (tree, tree); extern tree binfo_or_else (tree, tree); extern void readonly_error (tree, const char *, int); +extern void complete_type_check_abstract (tree); extern int abstract_virtuals_error (tree, tree); extern tree store_init_value (tree, tree); -extern tree digest_init (tree, tree, tree *); +extern tree digest_init (tree, tree); extern tree build_scoped_ref (tree, tree, tree *); extern tree build_x_arrow (tree); extern tree build_m_component_ref (tree, tree); extern tree build_functional_cast (tree, tree); -extern tree add_exception_specifier (tree, tree, int); -extern tree merge_exception_specifiers (tree, tree); +extern tree add_exception_specifier (tree, tree, int); +extern tree merge_exception_specifiers (tree, tree); /* in mangle.c */ -extern void init_mangle (void); -extern void mangle_decl (tree); -extern const char *mangle_type_string (tree); -extern tree mangle_type (tree); -extern tree mangle_typeinfo_for_type (tree); -extern tree mangle_typeinfo_string_for_type (tree); -extern tree mangle_vtbl_for_type (tree); -extern tree mangle_vtt_for_type (tree); -extern tree mangle_ctor_vtbl_for_type (tree, tree); -extern tree mangle_thunk (tree, int, tree, tree); -extern tree mangle_conv_op_name_for_type (tree); -extern tree mangle_guard_variable (tree); -extern tree mangle_ref_init_variable (tree); +extern void init_mangle (void); +extern void mangle_decl (tree); +extern const char *mangle_type_string (tree); +extern tree mangle_typeinfo_for_type (tree); +extern tree mangle_typeinfo_string_for_type (tree); +extern tree mangle_vtbl_for_type (tree); +extern tree mangle_vtt_for_type (tree); +extern tree mangle_ctor_vtbl_for_type (tree, tree); +extern tree mangle_thunk (tree, int, tree, tree); +extern tree mangle_conv_op_name_for_type (tree); +extern tree mangle_guard_variable (tree); +extern tree mangle_ref_init_variable (tree); /* in dump.c */ -extern bool cp_dump_tree (void *, tree); +extern bool cp_dump_tree (void *, tree); + +/* In cp/cp-objcp-common.c. */ + +extern HOST_WIDE_INT cxx_get_alias_set (tree); +extern bool cxx_warn_unused_global_decl (tree); +extern tree cp_expr_size (tree); +extern size_t cp_tree_size (enum tree_code); +extern bool cp_var_mod_type_p (tree, tree); +extern void cxx_initialize_diagnostics (struct diagnostic_context *); +extern int cxx_types_compatible_p (tree, tree); +extern void init_shadowed_var_for_decl (void); +extern tree cxx_staticp (tree); + +/* in cp-gimplify.c */ +extern int cp_gimplify_expr (tree *, tree *, tree *); +extern void cp_genericize (tree); /* -- end of C++ */ /* In order for the format checking to accept the C++ frontend diagnostic framework extensions, you must include this file before - toplev.h, not after. */ + toplev.h, not after. We override the definition of GCC_DIAG_STYLE + in c-common.h. */ +#undef GCC_DIAG_STYLE #define GCC_DIAG_STYLE __gcc_cxxdiag__ -#if GCC_VERSION >= 3004 +#if GCC_VERSION >= 4001 #define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m) #else #define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m) #endif - -extern void cp_error_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2); -extern void cp_warning_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2); -extern void cp_pedwarn_at (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1, 2); +extern void cp_cpp_error (cpp_reader *, int, + const char *, va_list *) + ATTRIBUTE_GCC_CXXDIAG(3,0); #endif /* ! GCC_CP_TREE_H */ diff --git a/contrib/gcc/cp/cvt.c b/contrib/gcc/cp/cvt.c index 2071c260299..75c930dcb59 100644 --- a/contrib/gcc/cp/cvt.c +++ b/contrib/gcc/cp/cvt.c @@ -1,6 +1,6 @@ /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* This file contains the functions for converting C++ expressions @@ -36,9 +36,11 @@ Boston, MA 02111-1307, USA. */ #include "convert.h" #include "toplev.h" #include "decl.h" +#include "target.h" static tree cp_convert_to_pointer (tree, tree, bool); static tree convert_to_pointer_force (tree, tree); +static tree build_type_conversion (tree, tree); static tree build_up_reference (tree, tree, int, tree); static void warn_ref_binding (tree, tree, tree); @@ -54,7 +56,7 @@ static void warn_ref_binding (tree, tree, tree); narrowing is always done with a NOP_EXPR: In convert.c, convert_to_integer. In c-typeck.c, build_binary_op_nodefault (boolean ops), - and c_common_truthvalue_conversion. + and c_common_truthvalue_conversion. In expr.c: expand_expr, for operands of a MULT_EXPR. In fold-const.c: fold. In tree.c: get_narrower and get_unwidened. @@ -87,8 +89,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) intype = complete_type (intype); if (!COMPLETE_TYPE_P (intype)) { - error ("can't convert from incomplete type `%T' to `%T'", - intype, type); + error ("can't convert from incomplete type %qT to %qT", + intype, type); return error_mark_node; } @@ -96,8 +98,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (rval) { if (rval == error_mark_node) - error ("conversion of `%E' from `%T' to `%T' is ambiguous", - expr, intype, type); + error ("conversion of %qE from %qT to %qT is ambiguous", + expr, intype, type); return rval; } } @@ -107,28 +109,9 @@ cp_convert_to_pointer (tree type, tree expr, bool force) && (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE || VOID_TYPE_P (TREE_TYPE (type)))) { - /* Allow an implicit this pointer for pointer to member - functions. */ - if (TYPE_PTRMEMFUNC_P (intype)) - { - if (pedantic || warn_pmf2ptr) - pedwarn ("converting from `%T' to `%T'", intype, type); - if (TREE_CODE (expr) == PTRMEM_CST) - expr = build_address (PTRMEM_CST_MEMBER (expr)); - else - { - tree decl = maybe_dummy_object (TYPE_PTRMEM_CLASS_TYPE (intype), - 0); - decl = build_address (decl); - expr = get_member_function_from_ptrfunc (&decl, expr); - } - } - else if (TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE) - { - if (pedantic || warn_pmf2ptr) - pedwarn ("converting from `%T' to `%T'", intype, type); - expr = build_addr_func (expr); - } + if (TYPE_PTRMEMFUNC_P (intype) + || TREE_CODE (intype) == METHOD_TYPE) + return convert_member_func_to_ptr (type, expr); if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE) return build_nop (type, expr); intype = TREE_TYPE (expr); @@ -159,7 +142,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) intype_class = TREE_TYPE (intype); type_class = TREE_TYPE (type); - same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class), + same_p = same_type_p (TYPE_MAIN_VARIANT (intype_class), TYPE_MAIN_VARIANT (type_class)); binfo = NULL_TREE; /* Try derived to base conversion. */ @@ -184,8 +167,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (TYPE_PTRMEMFUNC_P (type)) { - error ("cannot convert `%E' from type `%T' to type `%T'", - expr, intype, type); + error ("cannot convert %qE from type %qT to type %qT", + expr, intype, type); return error_mark_node; } @@ -193,7 +176,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) } else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype)) { - tree b1; + tree b1; tree b2; tree binfo; enum tree_code code = PLUS_EXPR; @@ -213,12 +196,12 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (bk == bk_via_virtual) { if (force) - warning ("pointer to member cast from `%T' to `%T' is via virtual base", - intype, type); + warning (0, "pointer to member cast from %qT to %qT is via" + " virtual base", intype, type); else { - error ("pointer to member cast from `%T' to `%T' is via virtual base", - intype, type); + error ("pointer to member cast from %qT to %qT is" + " via virtual base", intype, type); return error_mark_node; } /* This is a reinterpret cast, whose result is unspecified. @@ -230,13 +213,14 @@ cp_convert_to_pointer (tree type, tree expr, bool force) expr = cplus_expand_constant (expr); if (binfo && !integer_zerop (BINFO_OFFSET (binfo))) - expr = size_binop (code, + expr = size_binop (code, build_nop (sizetype, expr), BINFO_OFFSET (binfo)); return build_nop (type, expr); } else if (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)) - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0); + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, + /*c_cast_p=*/false); else if (TYPE_PTRMEMFUNC_P (intype)) { if (!warn_pmf2ptr) @@ -252,30 +236,33 @@ cp_convert_to_pointer (tree type, tree expr, bool force) TREE_OPERAND (expr, 1)); } } - error ("cannot convert `%E' from type `%T' to type `%T'", - expr, intype, type); + error ("cannot convert %qE from type %qT to type %qT", + expr, intype, type); return error_mark_node; } if (integer_zerop (expr)) { if (TYPE_PTRMEMFUNC_P (type)) - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0); + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, + /*c_cast_p=*/false); if (TYPE_PTRMEM_P (type)) - /* A NULL pointer-to-member is represented by -1, not by - zero. */ - expr = build_int_2 (-1, -1); + { + /* A NULL pointer-to-member is represented by -1, not by + zero. */ + expr = build_int_cst (type, -1); + /* Fix up the representation of -1 if appropriate. */ + expr = force_fit_type (expr, 0, false, false); + } else - expr = build_int_2 (0, 0); - TREE_TYPE (expr) = type; - /* Fix up the representation of -1 if appropriate. */ - force_fit_type (expr, 0); + expr = build_int_cst (type, 0); + return expr; } else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form)) { - error ("invalid conversion from '%T' to '%T'", intype, type); + error ("invalid conversion from %qT to %qT", intype, type); return error_mark_node; } @@ -284,20 +271,20 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (TYPE_PRECISION (intype) == POINTER_SIZE) return build1 (CONVERT_EXPR, type, expr); expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr); - /* Modes may be different but sizes should be the same. */ - if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) - != GET_MODE_SIZE (TYPE_MODE (type))) - /* There is supposed to be some integral type - that is the same width as a pointer. */ - abort (); + /* Modes may be different but sizes should be the same. There + is supposed to be some integral type that is the same width + as a pointer. */ + gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) + == GET_MODE_SIZE (TYPE_MODE (type))); + return convert_to_pointer (type, expr); } if (type_unknown_p (expr)) - return instantiate_type (type, expr, tf_error | tf_warning); + return instantiate_type (type, expr, tf_warning_or_error); - error ("cannot convert `%E' from type `%T' to type `%T'", - expr, intype, type); + error ("cannot convert %qE from type %qT to type %qT", + expr, intype, type); return error_mark_node; } @@ -310,7 +297,7 @@ convert_to_pointer_force (tree type, tree expr) { tree intype = TREE_TYPE (expr); enum tree_code form = TREE_CODE (intype); - + if (form == POINTER_TYPE) { intype = TYPE_MAIN_VARIANT (intype); @@ -325,11 +312,11 @@ convert_to_pointer_force (tree type, tree expr) tree binfo; binfo = lookup_base (TREE_TYPE (intype), TREE_TYPE (type), - ba_ignore, NULL); + ba_unique, NULL); if (!binfo) { binfo = lookup_base (TREE_TYPE (type), TREE_TYPE (intype), - ba_ignore, NULL); + ba_unique, NULL); code = MINUS_EXPR; } if (binfo == error_mark_node) @@ -337,8 +324,8 @@ convert_to_pointer_force (tree type, tree expr) if (binfo) { expr = build_base_path (code, expr, binfo, 0); - if (expr == error_mark_node) - return error_mark_node; + if (expr == error_mark_node) + return error_mark_node; /* Add any qualifier conversions. */ if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)), TREE_TYPE (type))) @@ -366,7 +353,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) tree argtype = TREE_TYPE (arg); tree target_type = TREE_TYPE (type); - my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 187); + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg)) { @@ -378,7 +365,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) /* Process the initializer for the declaration. */ DECL_INITIAL (arg) = targ; - cp_finish_decl (arg, targ, NULL_TREE, + cp_finish_decl (arg, targ, /*init_const_expr_p=*/false, NULL_TREE, LOOKUP_ONLYCONVERTING|DIRECT_BIND); } else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg)) @@ -413,7 +400,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl) /* Subroutine of convert_to_reference. REFTYPE is the target reference type. INTYPE is the original rvalue type and DECL is an optional _DECL node for diagnostics. - + [dcl.init.ref] says that if an rvalue is used to initialize a reference, then the reference must be to a non-volatile const type. */ @@ -422,19 +409,23 @@ static void warn_ref_binding (tree reftype, tree intype, tree decl) { tree ttl = TREE_TYPE (reftype); - + if (!CP_TYPE_CONST_NON_VOLATILE_P (ttl)) { const char *msg; if (CP_TYPE_VOLATILE_P (ttl) && decl) - msg = "initialization of volatile reference type `%#T' from rvalue of type `%T'"; + msg = "initialization of volatile reference type %q#T from" + " rvalue of type %qT"; else if (CP_TYPE_VOLATILE_P (ttl)) - msg = "conversion to volatile reference type `%#T' from rvalue of type `%T'"; + msg = "conversion to volatile reference type %q#T " + " from rvalue of type %qT"; else if (decl) - msg = "initialization of non-const reference type `%#T' from rvalue of type `%T'"; + msg = "initialization of non-const reference type %q#T from" + " rvalue of type %qT"; else - msg = "conversion to non-const reference type `%#T' from rvalue of type `%T'"; + msg = "conversion to non-const reference type %q#T from" + " rvalue of type %qT"; pedwarn (msg, reftype, intype); } @@ -449,7 +440,7 @@ warn_ref_binding (tree reftype, tree intype, tree decl) tree convert_to_reference (tree reftype, tree expr, int convtype, - int flags, tree decl) + int flags, tree decl) { tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype)); tree intype; @@ -457,20 +448,19 @@ convert_to_reference (tree reftype, tree expr, int convtype, tree rval_as_conversion = NULL_TREE; bool can_convert_intype_to_type; - if (TREE_CODE (type) == FUNCTION_TYPE + if (TREE_CODE (type) == FUNCTION_TYPE && TREE_TYPE (expr) == unknown_type_node) - expr = instantiate_type (type, expr, + expr = instantiate_type (type, expr, (flags & LOOKUP_COMPLAIN) - ? tf_error | tf_warning : tf_none); - else - expr = convert_from_reference (expr); + ? tf_warning_or_error : tf_none); if (expr == error_mark_node) return error_mark_node; intype = TREE_TYPE (expr); - my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364); + gcc_assert (TREE_CODE (intype) != REFERENCE_TYPE); + gcc_assert (TREE_CODE (reftype) == REFERENCE_TYPE); intype = TYPE_MAIN_VARIANT (intype); @@ -504,11 +494,11 @@ convert_to_reference (tree reftype, tree expr, int convtype, if (! real_lvalue_p (expr)) warn_ref_binding (reftype, intype, decl); - + if (! (convtype & CONV_CONST) && !at_least_as_qualified_p (ttl, ttr)) - pedwarn ("conversion from `%T' to `%T' discards qualifiers", - ttr, reftype); + pedwarn ("conversion from %qT to %qT discards qualifiers", + ttr, reftype); } return build_up_reference (reftype, expr, flags, decl); @@ -521,13 +511,13 @@ convert_to_reference (tree reftype, tree expr, int convtype, should be done directly (jason). (int &)ri ---> *(int*)&ri */ /* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they - meant. */ + meant. */ if (TREE_CODE (intype) == POINTER_TYPE && (comptypes (TREE_TYPE (intype), type, COMPARE_BASE | COMPARE_DERIVED))) - warning ("casting `%T' to `%T' does not dereference pointer", + warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); - + rval = build_unary_op (ADDR_EXPR, expr, 0); if (rval != error_mark_node) rval = convert_force (build_pointer_type (TREE_TYPE (reftype)), @@ -552,10 +542,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, } if (flags & LOOKUP_COMPLAIN) - error ("cannot convert type `%T' to type `%T'", intype, reftype); - - if (flags & LOOKUP_SPECULATIVELY) - return NULL_TREE; + error ("cannot convert type %qT to type %qT", intype, reftype); return error_mark_node; } @@ -567,23 +554,24 @@ tree convert_from_reference (tree val) { if (TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE) - return build_indirect_ref (val, NULL); + { + tree t = canonical_type_variant (TREE_TYPE (TREE_TYPE (val))); + tree ref = build1 (INDIRECT_REF, t, val); + + /* We *must* set TREE_READONLY when dereferencing a pointer to const, + so that we get the proper error message if the result is used + to assign to. Also, &* is supposed to be a no-op. */ + TREE_READONLY (ref) = CP_TYPE_CONST_P (t); + TREE_THIS_VOLATILE (ref) = CP_TYPE_VOLATILE_P (t); + TREE_SIDE_EFFECTS (ref) + = (TREE_THIS_VOLATILE (ref) || TREE_SIDE_EFFECTS (val)); + REFERENCE_REF_P (ref) = 1; + val = ref; + } + return val; } -/* Implicitly convert the lvalue EXPR to another lvalue of type TOTYPE, - preserving cv-qualification. */ - -tree -convert_lvalue (tree totype, tree expr) -{ - totype = cp_build_qualified_type (totype, TYPE_QUALS (TREE_TYPE (expr))); - totype = build_reference_type (totype); - expr = convert_to_reference (totype, expr, CONV_IMPLICIT, LOOKUP_NORMAL, - NULL_TREE); - return convert_from_reference (expr); -} - /* Really perform an lvalue-to-rvalue conversion, including copying an argument of class type into a temporary. */ @@ -616,6 +604,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags) { tree e = expr; enum tree_code code = TREE_CODE (type); + const char *invalid_conv_diag; if (error_operand_p (e) || type == error_mark_node) return error_mark_node; @@ -623,7 +612,14 @@ ocp_convert (tree type, tree expr, int convtype, int flags) complete_type (type); complete_type (TREE_TYPE (expr)); - e = decl_constant_value (e); + if ((invalid_conv_diag + = targetm.invalid_conversion (TREE_TYPE (expr), type))) + { + error (invalid_conv_diag); + return error_mark_node; + } + + e = integral_constant_value (e); if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP) /* Some internal structures (vtable_entry_type, sigtbl_ptr_type) @@ -642,25 +638,26 @@ ocp_convert (tree type, tree expr, int convtype, int flags) convert, which will call ocp_convert, etc. */ return e; /* For complex data types, we need to perform componentwise - conversion. */ + conversion. */ else if (TREE_CODE (type) == COMPLEX_TYPE) - return fold (convert_to_complex (type, e)); + return fold_if_not_in_template (convert_to_complex (type, e)); else if (TREE_CODE (e) == TARGET_EXPR) { /* Don't build a NOP_EXPR of class type. Instead, change the type of the temporary. Only allow this for cv-qual changes, though. */ - if (!same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)), - TYPE_MAIN_VARIANT (type))) - abort (); + gcc_assert (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)), + TYPE_MAIN_VARIANT (type))); TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type; return e; } - else if (TREE_ADDRESSABLE (type)) - /* We shouldn't be treating objects of ADDRESSABLE type as rvalues. */ - abort (); else - return fold (build1 (NOP_EXPR, type, e)); + { + /* We shouldn't be treating objects of ADDRESSABLE type as + rvalues. */ + gcc_assert (!TREE_ADDRESSABLE (type)); + return fold_if_not_in_template (build_nop (type, e)); + } } if (code == VOID_TYPE && (convtype & CONV_STATIC)) @@ -673,12 +670,15 @@ ocp_convert (tree type, tree expr, int convtype, int flags) { tree intype = TREE_TYPE (e); /* enum = enum, enum = int, enum = float, (enum)pointer are all - errors. */ + errors. */ if (TREE_CODE (type) == ENUMERAL_TYPE - && ((ARITHMETIC_TYPE_P (intype) && ! (convtype & CONV_STATIC)) - || (TREE_CODE (intype) == POINTER_TYPE))) + && (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype) + || TREE_CODE (intype) == REAL_TYPE) + && ! (convtype & CONV_STATIC)) + || TREE_CODE (intype) == POINTER_TYPE)) { - pedwarn ("conversion from `%#T' to `%#T'", intype, type); + if (flags & LOOKUP_COMPLAIN) + pedwarn ("conversion from %q#T to %q#T", intype, type); if (flag_pedantic_errors) return error_mark_node; @@ -690,20 +690,31 @@ ocp_convert (tree type, tree expr, int convtype, int flags) if (rval) return rval; if (flags & LOOKUP_COMPLAIN) - error ("`%#T' used where a `%T' was expected", intype, type); - if (flags & LOOKUP_SPECULATIVELY) - return NULL_TREE; + error ("%q#T used where a %qT was expected", intype, type); return error_mark_node; } if (code == BOOLEAN_TYPE) return cp_truthvalue_conversion (e); - return fold (convert_to_integer (type, e)); + return fold_if_not_in_template (convert_to_integer (type, e)); } if (POINTER_TYPE_P (type) || TYPE_PTR_TO_MEMBER_P (type)) - return fold (cp_convert_to_pointer (type, e, false)); + return fold_if_not_in_template (cp_convert_to_pointer (type, e, false)); if (code == VECTOR_TYPE) - return fold (convert_to_vector (type, e)); + { + tree in_vtype = TREE_TYPE (e); + if (IS_AGGR_TYPE (in_vtype)) + { + tree ret_val; + ret_val = build_type_conversion (type, e); + if (ret_val) + return ret_val; + if (flags & LOOKUP_COMPLAIN) + error ("%q#T used where a %qT was expected", in_vtype, type); + return error_mark_node; + } + return fold_if_not_in_template (convert_to_vector (type, e)); + } if (code == REAL_TYPE || code == COMPLEX_TYPE) { if (IS_AGGR_TYPE (TREE_TYPE (e))) @@ -714,13 +725,13 @@ ocp_convert (tree type, tree expr, int convtype, int flags) return rval; else if (flags & LOOKUP_COMPLAIN) - error ("`%#T' used where a floating point value was expected", + error ("%q#T used where a floating point value was expected", TREE_TYPE (e)); } if (code == REAL_TYPE) - return fold (convert_to_real (type, e)); + return fold_if_not_in_template (convert_to_real (type, e)); else if (code == COMPLEX_TYPE) - return fold (convert_to_complex (type, e)); + return fold_if_not_in_template (convert_to_complex (type, e)); } /* New C++ semantics: since assignment is now based on @@ -752,19 +763,17 @@ ocp_convert (tree type, tree expr, int convtype, int flags) the target with the temp (see [dcl.init]). */ ctor = build_user_type_conversion (type, ctor, flags); else - ctor = build_special_member_call (NULL_TREE, + ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, ctor), - TYPE_BINFO (type), flags); + type, flags); if (ctor) return build_cplus_new (type, ctor); } if (flags & LOOKUP_COMPLAIN) - error ("conversion from `%T' to non-scalar type `%T' requested", - TREE_TYPE (expr), type); - if (flags & LOOKUP_SPECULATIVELY) - return NULL_TREE; + error ("conversion from %qT to non-scalar type %qT requested", + TREE_TYPE (expr), type); return error_mark_node; } @@ -782,13 +791,13 @@ ocp_convert (tree type, tree expr, int convtype, int flags) volatile references we do not do this interpretation, because that would make it impossible to ignore the reference return value from functions. We issue warnings in the confusing cases. - + IMPLICIT is tells us the context of an implicit void conversion. */ tree convert_to_void (tree expr, const char *implicit) { - if (expr == error_mark_node + if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; if (!TREE_TYPE (expr)) @@ -806,85 +815,107 @@ convert_to_void (tree expr, const char *implicit) { case COND_EXPR: { - /* The two parts of a cond expr might be separate lvalues. */ - tree op1 = TREE_OPERAND (expr,1); - tree op2 = TREE_OPERAND (expr,2); - tree new_op1 = convert_to_void + /* The two parts of a cond expr might be separate lvalues. */ + tree op1 = TREE_OPERAND (expr,1); + tree op2 = TREE_OPERAND (expr,2); + tree new_op1 = convert_to_void (op1, (implicit && !TREE_SIDE_EFFECTS (op2) ? "second operand of conditional" : NULL)); - tree new_op2 = convert_to_void + tree new_op2 = convert_to_void (op2, (implicit && !TREE_SIDE_EFFECTS (op1) ? "third operand of conditional" : NULL)); - - expr = build (COND_EXPR, TREE_TYPE (new_op1), - TREE_OPERAND (expr, 0), new_op1, new_op2); - break; + + expr = build3 (COND_EXPR, TREE_TYPE (new_op1), + TREE_OPERAND (expr, 0), new_op1, new_op2); + break; } - + case COMPOUND_EXPR: { - /* The second part of a compound expr contains the value. */ - tree op1 = TREE_OPERAND (expr,1); - tree new_op1 = convert_to_void - (op1, (implicit && !TREE_NO_UNUSED_WARNING (expr) + /* The second part of a compound expr contains the value. */ + tree op1 = TREE_OPERAND (expr,1); + tree new_op1 = convert_to_void + (op1, (implicit && !TREE_NO_WARNING (expr) ? "right-hand operand of comma" : NULL)); - - if (new_op1 != op1) + + if (new_op1 != op1) { - tree t = build (COMPOUND_EXPR, TREE_TYPE (new_op1), - TREE_OPERAND (expr, 0), new_op1); + tree t = build2 (COMPOUND_EXPR, TREE_TYPE (new_op1), + TREE_OPERAND (expr, 0), new_op1); expr = t; } - break; + break; } - + case NON_LVALUE_EXPR: case NOP_EXPR: /* These have already decayed to rvalue. */ break; - + case CALL_EXPR: /* We have a special meaning for volatile void fn(). */ break; - + case INDIRECT_REF: { - tree type = TREE_TYPE (expr); - int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) - == REFERENCE_TYPE; - int is_volatile = TYPE_VOLATILE (type); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); - - if (is_volatile && !is_complete) - warning ("object of incomplete type `%T' will not be accessed in %s", - type, implicit ? implicit : "void context"); - else if (is_reference && is_volatile) - warning ("object of type `%T' will not be accessed in %s", - TREE_TYPE (TREE_OPERAND (expr, 0)), - implicit ? implicit : "void context"); - if (is_reference || !is_volatile || !is_complete) - expr = TREE_OPERAND (expr, 0); - - break; + tree type = TREE_TYPE (expr); + int is_reference = TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) + == REFERENCE_TYPE; + int is_volatile = TYPE_VOLATILE (type); + int is_complete = COMPLETE_TYPE_P (complete_type (type)); + + /* Can't load the value if we don't know the type. */ + if (is_volatile && !is_complete) + warning (0, "object of incomplete type %qT will not be accessed in %s", + type, implicit ? implicit : "void context"); + /* Don't load the value if this is an implicit dereference, or if + the type needs to be handled by ctors/dtors. */ + else if (is_volatile && (is_reference || TREE_ADDRESSABLE (type))) + warning (0, "object of type %qT will not be accessed in %s", + TREE_TYPE (TREE_OPERAND (expr, 0)), + implicit ? implicit : "void context"); + if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type)) + expr = TREE_OPERAND (expr, 0); + + break; } - + case VAR_DECL: { - /* External variables might be incomplete. */ - tree type = TREE_TYPE (expr); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); - - if (TYPE_VOLATILE (type) && !is_complete) - warning ("object `%E' of incomplete type `%T' will not be accessed in %s", - expr, type, implicit ? implicit : "void context"); - break; + /* External variables might be incomplete. */ + tree type = TREE_TYPE (expr); + int is_complete = COMPLETE_TYPE_P (complete_type (type)); + + if (TYPE_VOLATILE (type) && !is_complete) + warning (0, "object %qE of incomplete type %qT will not be accessed in %s", + expr, type, implicit ? implicit : "void context"); + break; } + case TARGET_EXPR: + /* Don't bother with the temporary object returned from a function if + we don't use it and don't need to destroy it. We'll still + allocate space for it in expand_call or declare_return_variable, + but we don't need to track it through all the tree phases. */ + if (TARGET_EXPR_IMPLICIT_P (expr) + && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (expr))) + { + tree init = TARGET_EXPR_INITIAL (expr); + if (TREE_CODE (init) == AGGR_INIT_EXPR + && !AGGR_INIT_VIA_CTOR_P (init)) + { + tree fn = TREE_OPERAND (init, 0); + expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))), + fn, TREE_OPERAND (init, 1), NULL_TREE); + } + } + break; + default:; } { tree probe = expr; - + if (TREE_CODE (probe) == ADDR_EXPR) probe = TREE_OPERAND (expr, 0); if (type_unknown_p (probe)) @@ -896,17 +927,64 @@ convert_to_void (tree expr, const char *implicit) expr = void_zero_node; } else if (implicit && probe == expr && is_overloaded_fn (probe)) - /* Only warn when there is no &. */ - warning ("%s is a reference, not call, to function `%E'", - implicit, expr); + { + /* Only warn when there is no &. */ + warning (OPT_Waddress, "%s is a reference, not call, to function %qE", + implicit, expr); + if (TREE_CODE (expr) == COMPONENT_REF) + expr = TREE_OPERAND (expr, 0); + } } - + if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr))) { - if (implicit && !TREE_SIDE_EFFECTS (expr) && warn_unused_value) - warning ("%s has no effect", implicit); + if (implicit + && warn_unused_value + && !TREE_NO_WARNING (expr) + && !processing_template_decl) + { + /* The middle end does not warn about expressions that have + been explicitly cast to void, so we must do so here. */ + if (!TREE_SIDE_EFFECTS (expr)) + warning (OPT_Wunused_value, "%s has no effect", implicit); + else + { + tree e; + enum tree_code code; + enum tree_code_class class; + + e = expr; + /* We might like to warn about (say) "(int) f()", as the + cast has no effect, but the compiler itself will + generate implicit conversions under some + circumstances. (For example a block copy will be + turned into a call to "__builtin_memcpy", with a + conversion of the return value to an appropriate + type.) So, to avoid false positives, we strip + conversions. Do not use STRIP_NOPs because it will + not strip conversions to "void", as that is not a + mode-preserving conversion. */ + while (TREE_CODE (e) == NOP_EXPR) + e = TREE_OPERAND (e, 0); + + code = TREE_CODE (e); + class = TREE_CODE_CLASS (code); + if (class == tcc_comparison + || class == tcc_unary + || (class == tcc_binary + && !(code == MODIFY_EXPR + || code == INIT_EXPR + || code == PREDECREMENT_EXPR + || code == PREINCREMENT_EXPR + || code == POSTDECREMENT_EXPR + || code == POSTINCREMENT_EXPR))) + warning (OPT_Wunused_value, "value computed is not used"); + } + } expr = build1 (CONVERT_EXPR, void_type_node, expr); } + if (! TREE_SIDE_EFFECTS (expr)) + expr = void_zero_node; return expr; } @@ -938,10 +1016,7 @@ convert (tree type, tree expr) intype = TREE_TYPE (expr); if (POINTER_TYPE_P (type) && POINTER_TYPE_P (intype)) - { - expr = decl_constant_value (expr); - return fold (build1 (NOP_EXPR, type, expr)); - } + return fold_if_not_in_template (build_nop (type, expr)); return ocp_convert (type, expr, CONV_OLD_CONVERT, LOOKUP_NORMAL|LOOKUP_NO_CONVERSION); @@ -958,13 +1033,12 @@ convert_force (tree type, tree expr, int convtype) enum tree_code code = TREE_CODE (type); if (code == REFERENCE_TYPE) - return fold (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN, - NULL_TREE)); - else if (TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE) - e = convert_from_reference (e); + return (fold_if_not_in_template + (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN, + NULL_TREE))); if (code == POINTER_TYPE) - return fold (convert_to_pointer_force (type, e)); + return fold_if_not_in_template (convert_to_pointer_force (type, e)); /* From typeck.c convert_for_assignment */ if (((TREE_CODE (TREE_TYPE (e)) == POINTER_TYPE && TREE_CODE (e) == ADDR_EXPR @@ -973,10 +1047,9 @@ convert_force (tree type, tree expr, int convtype) || integer_zerop (e) || TYPE_PTRMEMFUNC_P (TREE_TYPE (e))) && TYPE_PTRMEMFUNC_P (type)) - { - /* compatible pointer to member functions. */ - return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1); - } + /* compatible pointer to member functions. */ + return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), e, 1, + /*c_cast_p=*/1); return ocp_convert (type, e, CONV_C_CAST|convtype, LOOKUP_NORMAL); } @@ -992,7 +1065,7 @@ convert_force (tree type, tree expr, int convtype) that doesn't do it. This will probably wait for an overloading rewrite. (jason 8/9/95) */ -tree +static tree build_type_conversion (tree xtype, tree expr) { /* C++: check to see if we can convert this aggregate type @@ -1012,12 +1085,11 @@ build_expr_type_conversion (int desires, tree expr, bool complain) tree conv = NULL_TREE; tree winner = NULL_TREE; - if (expr == null_node - && (desires & WANT_INT) + if (expr == null_node + && (desires & WANT_INT) && !(desires & WANT_NULL)) - warning ("converting NULL to non-pointer type"); - - expr = convert_from_reference (expr); + warning (OPT_Wconversion, "converting NULL to non-pointer type"); + basetype = TREE_TYPE (expr); if (basetype == error_mark_node) @@ -1031,7 +1103,6 @@ build_expr_type_conversion (int desires, tree expr, bool complain) return expr; /* else fall through... */ - case VECTOR_TYPE: case BOOLEAN_TYPE: return (desires & WANT_INT) ? expr : NULL_TREE; case ENUMERAL_TYPE: @@ -1040,11 +1111,28 @@ build_expr_type_conversion (int desires, tree expr, bool complain) return (desires & WANT_FLOAT) ? expr : NULL_TREE; case POINTER_TYPE: return (desires & WANT_POINTER) ? expr : NULL_TREE; - + case FUNCTION_TYPE: case ARRAY_TYPE: return (desires & WANT_POINTER) ? decay_conversion (expr) - : NULL_TREE; + : NULL_TREE; + + case VECTOR_TYPE: + if ((desires & WANT_VECTOR) == 0) + return NULL_TREE; + switch (TREE_CODE (TREE_TYPE (basetype))) + { + case INTEGER_TYPE: + case BOOLEAN_TYPE: + return (desires & WANT_INT) ? expr : NULL_TREE; + case ENUMERAL_TYPE: + return (desires & WANT_ENUM) ? expr : NULL_TREE; + case REAL_TYPE: + return (desires & WANT_FLOAT) ? expr : NULL_TREE; + default: + return NULL_TREE; + } + default: return NULL_TREE; } @@ -1079,6 +1167,23 @@ build_expr_type_conversion (int desires, tree expr, bool complain) case POINTER_TYPE: win = (desires & WANT_POINTER); break; + case VECTOR_TYPE: + if ((desires & WANT_VECTOR) == 0) + break; + switch (TREE_CODE (TREE_TYPE (candidate))) + { + case BOOLEAN_TYPE: + case INTEGER_TYPE: + win = (desires & WANT_INT); break; + case ENUMERAL_TYPE: + win = (desires & WANT_ENUM); break; + case REAL_TYPE: + win = (desires & WANT_FLOAT); break; + default: + break; + } + break; + default: break; } @@ -1089,10 +1194,10 @@ build_expr_type_conversion (int desires, tree expr, bool complain) { if (complain) { - error ("ambiguous default type conversion from `%T'", - basetype); - error (" candidate conversions include `%D' and `%D'", - winner, cand); + error ("ambiguous default type conversion from %qT", + basetype); + error (" candidate conversions include %qD and %qD", + winner, cand); } return error_mark_node; } @@ -1133,7 +1238,7 @@ type_promotes_to (tree type) int precision = MAX (TYPE_PRECISION (type), TYPE_PRECISION (integer_type_node)); tree totype = c_common_type_for_size (precision, 0); - if (TREE_UNSIGNED (type) + if (TYPE_UNSIGNED (type) && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype)) type = c_common_type_for_size (precision, 1); else @@ -1142,7 +1247,7 @@ type_promotes_to (tree type) else if (c_promoting_integer_type_p (type)) { /* Retain unsignedness if really not getting bigger. */ - if (TREE_UNSIGNED (type) + if (TYPE_UNSIGNED (type) && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)) type = unsigned_type_node; else @@ -1150,7 +1255,7 @@ type_promotes_to (tree type) } else if (type == float_type_node) type = double_type_node; - + return type; } @@ -1163,15 +1268,17 @@ type_promotes_to (tree type) to TYPE. Return the resulting expression, or error_mark_node if the conversion was impossible. */ -tree +tree perform_qualification_conversions (tree type, tree expr) { tree expr_type; expr_type = TREE_TYPE (expr); - if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type) - && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type))) + if (same_type_p (type, expr_type)) + return expr; + else if (TYPE_PTR_P (type) && TYPE_PTR_P (expr_type) + && comp_ptr_ttypes (TREE_TYPE (type), TREE_TYPE (expr_type))) return build_nop (type, expr); else if (TYPE_PTR_TO_MEMBER_P (type) && TYPE_PTR_TO_MEMBER_P (expr_type) diff --git a/contrib/gcc/cp/cxx-pretty-print.c b/contrib/gcc/cp/cxx-pretty-print.c index e4d304ab681..5ceca61a4cb 100644 --- a/contrib/gcc/cp/cxx-pretty-print.c +++ b/contrib/gcc/cp/cxx-pretty-print.c @@ -1,5 +1,5 @@ /* Implementation of subroutines for the GNU C++ pretty-printer. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #include "config.h" #include "system.h" @@ -39,17 +39,12 @@ static void pp_cxx_ptr_operator (cxx_pretty_printer *, tree); static void pp_cxx_type_id (cxx_pretty_printer *, tree); static void pp_cxx_direct_abstract_declarator (cxx_pretty_printer *, tree); static void pp_cxx_declarator (cxx_pretty_printer *, tree); +static void pp_cxx_parameter_declaration_clause (cxx_pretty_printer *, tree); static void pp_cxx_abstract_declarator (cxx_pretty_printer *, tree); +static void pp_cxx_statement (cxx_pretty_printer *, tree); static void pp_cxx_template_parameter (cxx_pretty_printer *, tree); +static void pp_cxx_cast_expression (cxx_pretty_printer *, tree); -#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP)) -#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP)) -#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP)) -#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP)) -#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP)) -#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP)) -#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP)) -#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP)) static inline void pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c) @@ -62,16 +57,6 @@ pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c) pp_base (pp)->padding = pp_none; } -#define pp_cxx_begin_template_argument_list(PP) \ - pp_cxx_nonconsecutive_character (PP, '<') -#define pp_cxx_end_template_argument_list(PP) \ - pp_cxx_nonconsecutive_character (PP, '>') - -#define pp_cxx_identifier(PP, ID) pp_c_identifier (pp_c_base (PP), ID) -#define pp_cxx_tree_identifier(PP, T) pp_c_tree_identifier (pp_c_base (PP), T) - -#define pp_cxx_cv_qualifier_seq(PP, T) \ - pp_c_type_qualifier_list (pp_c_base (PP), T) #define pp_cxx_storage_class_specifier(PP, T) \ pp_c_storage_class_specifier (pp_c_base (PP), T) #define pp_cxx_expression_list(PP, T) \ @@ -83,13 +68,31 @@ pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c) #define pp_cxx_call_argument_list(PP, T) \ pp_c_call_argument_list (pp_c_base (PP), T) -static void +void pp_cxx_colon_colon (cxx_pretty_printer *pp) { pp_colon_colon (pp); pp_base (pp)->padding = pp_none; } +void +pp_cxx_begin_template_argument_list (cxx_pretty_printer *pp) +{ + pp_cxx_nonconsecutive_character (pp, '<'); +} + +void +pp_cxx_end_template_argument_list (cxx_pretty_printer *pp) +{ + pp_cxx_nonconsecutive_character (pp, '>'); +} + +void +pp_cxx_separate_with (cxx_pretty_printer *pp, int c) +{ + pp_separate_with (pp, c); + pp_base (pp)->padding = pp_none; +} /* Expressions. */ @@ -109,6 +112,7 @@ is_destructor_name (tree name) conversion-declarator: ptr-operator conversion-declarator(opt) */ + static inline void pp_cxx_conversion_function_id (cxx_pretty_printer *pp, tree t) { @@ -131,6 +135,7 @@ pp_cxx_template_id (cxx_pretty_printer *pp, tree t) conversion-function-id ~ class-name template-id */ + static void pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) { @@ -142,7 +147,7 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) break; case OVERLOAD: - t = OVL_CURRENT (t); + t = OVL_CURRENT (t); case VAR_DECL: case PARM_DECL: case CONST_DECL: @@ -154,23 +159,23 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) case USING_DECL: case TEMPLATE_DECL: t = DECL_NAME (t); - + case IDENTIFIER_NODE: if (t == NULL) - pp_cxx_identifier (pp, ""); + pp_cxx_identifier (pp, ""); else if (IDENTIFIER_TYPENAME_P (t)) - pp_cxx_conversion_function_id (pp, t); + pp_cxx_conversion_function_id (pp, t); else - { - if (is_destructor_name (t)) - { - pp_complement (pp); - /* FIXME: Why is this necessary? */ - if (TREE_TYPE (t)) - t = constructor_name (TREE_TYPE (t)); - } - pp_cxx_tree_identifier (pp, t); - } + { + if (is_destructor_name (t)) + { + pp_complement (pp); + /* FIXME: Why is this necessary? */ + if (TREE_TYPE (t)) + t = constructor_name (TREE_TYPE (t)); + } + pp_cxx_tree_identifier (pp, t); + } break; case TEMPLATE_ID_EXPR: @@ -188,7 +193,13 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) break; case TEMPLATE_TYPE_PARM: - t = TYPE_FIELDS (t); + case TEMPLATE_TEMPLATE_PARM: + if (TYPE_IDENTIFIER (t)) + pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t)); + else + pp_cxx_canonical_template_parameter (pp, t); + break; + case TEMPLATE_PARM_INDEX: pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t)); break; @@ -199,6 +210,11 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) } } +/* Pretty-print out the token sequence ":: template" in template codes + where it is needed to "inline declare" the (following) member as + a template. This situation arises when SCOPE of T is dependent + on template parameters. */ + static inline void pp_cxx_template_keyword_if_needed (cxx_pretty_printer *pp, tree scope, tree t) { @@ -210,6 +226,7 @@ pp_cxx_template_keyword_if_needed (cxx_pretty_printer *pp, tree scope, tree t) /* nested-name-specifier: class-or-namespace-name :: nested-name-specifier(opt) class-or-namespace-name :: template nested-name-specifier */ + static void pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t) { @@ -225,23 +242,34 @@ pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t) /* qualified-id: nested-name-specifier template(opt) unqualified-id */ + static void pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t) { switch (TREE_CODE (t)) { + /* A pointer-to-member is always qualified. */ case PTRMEM_CST: pp_cxx_nested_name_specifier (pp, PTRMEM_CST_CLASS (t)); pp_cxx_unqualified_id (pp, PTRMEM_CST_MEMBER (t)); break; + /* In Standard C++, functions cannot possibly be used as + nested-name-specifiers. However, there are situations where + is "makes sense" to output the surrounding function name for the + purpose of emphasizing on the scope kind. Just printing the + function name might not be sufficient as it may be overloaded; so, + we decorate the function with its signature too. + FIXME: This is probably the wrong pretty-printing for conversion + functions and some function templates. */ case OVERLOAD: t = OVL_CURRENT (t); case FUNCTION_DECL: if (DECL_FUNCTION_MEMBER_P (t)) - pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); + pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); pp_cxx_unqualified_id - (pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t); + (pp, DECL_CONSTRUCTOR_P (t) ? DECL_CONTEXT (t) : t); + pp_cxx_parameter_declaration_clause (pp, TREE_TYPE (t)); break; case OFFSET_REF: @@ -252,21 +280,45 @@ pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t) default: { - tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t); - if (scope != pp->enclosing_scope) - { - pp_cxx_nested_name_specifier (pp, scope); - pp_cxx_template_keyword_if_needed (pp, scope, t); - } - pp_cxx_unqualified_id (pp, t); + tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t); + if (scope != pp->enclosing_scope) + { + pp_cxx_nested_name_specifier (pp, scope); + pp_cxx_template_keyword_if_needed (pp, scope, t); + } + pp_cxx_unqualified_id (pp, t); } break; } } + +static void +pp_cxx_constant (cxx_pretty_printer *pp, tree t) +{ + switch (TREE_CODE (t)) + { + case STRING_CST: + { + const bool in_parens = PAREN_STRING_LITERAL_P (t); + if (in_parens) + pp_cxx_left_paren (pp); + pp_c_constant (pp_c_base (pp), t); + if (in_parens) + pp_cxx_right_paren (pp); + } + break; + + default: + pp_c_constant (pp_c_base (pp), t); + break; + } +} + /* id-expression: unqualified-id qualified-id */ + static inline void pp_cxx_id_expression (cxx_pretty_printer *pp, tree t) { @@ -286,15 +338,16 @@ pp_cxx_id_expression (cxx_pretty_printer *pp, tree t) :: qualifier-id ( expression ) id-expression */ + static void pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) { switch (TREE_CODE (t)) { - case STRING_CST: case INTEGER_CST: case REAL_CST: - pp_c_constant (pp_c_base (pp), t); + case STRING_CST: + pp_cxx_constant (pp, t); break; case BASELINK: @@ -311,10 +364,17 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) case RESULT_DECL: case TEMPLATE_TYPE_PARM: + case TEMPLATE_TEMPLATE_PARM: case TEMPLATE_PARM_INDEX: pp_cxx_unqualified_id (pp, t); break; + case STMT_EXPR: + pp_cxx_left_paren (pp); + pp_cxx_statement (pp, STMT_EXPR_STMT (t)); + pp_cxx_right_paren (pp); + break; + default: pp_c_primary_expression (pp_c_base (pp), t); break; @@ -328,7 +388,7 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) simple-type-specifier ( expression-list(opt) ) typename ::(opt) nested-name-specifier identifier ( expression-list(opt) ) typename ::(opt) nested-name-specifier template(opt) - template-id ( expression-list(opt) ) + template-id ( expression-list(opt) ) postfix-expression . template(opt) ::(opt) id-expression postfix-expression -> template(opt) ::(opt) id-expression postfix-expression . pseudo-destructor-name @@ -346,60 +406,60 @@ static void pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) { enum tree_code code = TREE_CODE (t); - + switch (code) { case AGGR_INIT_EXPR: case CALL_EXPR: { - tree fun = TREE_OPERAND (t, 0); - tree args = TREE_OPERAND (t, 1); - tree saved_scope = pp->enclosing_scope; + tree fun = TREE_OPERAND (t, 0); + tree args = TREE_OPERAND (t, 1); + tree saved_scope = pp->enclosing_scope; - if (TREE_CODE (fun) == ADDR_EXPR) - fun = TREE_OPERAND (fun, 0); + if (TREE_CODE (fun) == ADDR_EXPR) + fun = TREE_OPERAND (fun, 0); - /* In templates, where there is no way to tell whether a given - call uses an actual member function. So the parser builds - FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until - instantiation time. */ - if (TREE_CODE (fun) != FUNCTION_DECL) - ; - else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)) - { - tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t) - ? TREE_OPERAND (t, 2) - : TREE_VALUE (args); - - while (TREE_CODE (object) == NOP_EXPR) - object = TREE_OPERAND (object, 0); + /* In templates, where there is no way to tell whether a given + call uses an actual member function. So the parser builds + FUN as a COMPONENT_REF or a plain IDENTIFIER_NODE until + instantiation time. */ + if (TREE_CODE (fun) != FUNCTION_DECL) + ; + else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)) + { + tree object = code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t) + ? TREE_OPERAND (t, 2) + : TREE_VALUE (args); - if (TREE_CODE (object) == ADDR_EXPR) - object = TREE_OPERAND (object, 0); - - if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE) - { - pp_cxx_postfix_expression (pp, object); - pp_cxx_dot (pp); - } - else - { - pp_cxx_postfix_expression (pp, object); - pp_cxx_arrow (pp); - } - args = TREE_CHAIN (args); - pp->enclosing_scope = strip_pointer_operator (TREE_TYPE (object)); - } + while (TREE_CODE (object) == NOP_EXPR) + object = TREE_OPERAND (object, 0); - pp_cxx_postfix_expression (pp, fun); - pp->enclosing_scope = saved_scope; - pp_cxx_call_argument_list (pp, args); + if (TREE_CODE (object) == ADDR_EXPR) + object = TREE_OPERAND (object, 0); + + if (TREE_CODE (TREE_TYPE (object)) != POINTER_TYPE) + { + pp_cxx_postfix_expression (pp, object); + pp_cxx_dot (pp); + } + else + { + pp_cxx_postfix_expression (pp, object); + pp_cxx_arrow (pp); + } + args = TREE_CHAIN (args); + pp->enclosing_scope = strip_pointer_operator (TREE_TYPE (object)); + } + + pp_cxx_postfix_expression (pp, fun); + pp->enclosing_scope = saved_scope; + pp_cxx_call_argument_list (pp, args); } if (code == AGGR_INIT_EXPR && AGGR_INIT_VIA_CTOR_P (t)) - { - pp_separate_with (pp, ','); - pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 2)); - } + { + pp_cxx_separate_with (pp, ','); + pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 2)); + } break; case BASELINK: @@ -419,13 +479,13 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) case REINTERPRET_CAST_EXPR: case CONST_CAST_EXPR: if (code == DYNAMIC_CAST_EXPR) - pp_identifier (pp, "dynamic_cast"); + pp_cxx_identifier (pp, "dynamic_cast"); else if (code == STATIC_CAST_EXPR) - pp_identifier (pp, "static_cast"); + pp_cxx_identifier (pp, "static_cast"); else if (code == REINTERPRET_CAST_EXPR) - pp_identifier (pp, "reinterpret_cast"); + pp_cxx_identifier (pp, "reinterpret_cast"); else - pp_identifier (pp, "const_cast"); + pp_cxx_identifier (pp, "const_cast"); pp_cxx_begin_template_argument_list (pp); pp_cxx_type_id (pp, TREE_TYPE (t)); pp_cxx_end_template_argument_list (pp); @@ -445,9 +505,9 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) pp_cxx_identifier (pp, "typeid"); pp_left_paren (pp); if (TYPE_P (t)) - pp_cxx_type_id (pp, t); + pp_cxx_type_id (pp, t); else - pp_cxx_expression (pp, t); + pp_cxx_expression (pp, t); pp_right_paren (pp); break; @@ -460,6 +520,11 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 2)); break; + case ARROW_EXPR: + pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 0)); + pp_cxx_arrow (pp); + break; + default: pp_c_postfix_expression (pp_c_base (pp), t); break; @@ -486,6 +551,7 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) new-initializer: ( expression-list(opt) ) */ + static void pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) { @@ -495,27 +561,27 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) case NEW_EXPR: case VEC_NEW_EXPR: if (NEW_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (pp); + pp_cxx_colon_colon (pp); pp_cxx_identifier (pp, "new"); if (TREE_OPERAND (t, 0)) - { - pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); - pp_space (pp); - } + { + pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); + pp_space (pp); + } /* FIXME: array-types are built with one more element. */ pp_cxx_type_id (pp, TREE_OPERAND (t, 1)); if (TREE_OPERAND (t, 2)) - { - pp_left_paren (pp); - t = TREE_OPERAND (t, 2); - if (TREE_CODE (t) == TREE_LIST) - pp_c_expression_list (pp_c_base (pp), t); - else if (t == void_zero_node) - ; /* OK, empty initializer list. */ - else - pp_cxx_expression (pp, t); - pp_right_paren (pp); - } + { + pp_left_paren (pp); + t = TREE_OPERAND (t, 2); + if (TREE_CODE (t) == TREE_LIST) + pp_c_expression_list (pp_c_base (pp), t); + else if (t == void_zero_node) + ; /* OK, empty initializer list. */ + else + pp_cxx_expression (pp, t); + pp_right_paren (pp); + } break; default: @@ -526,6 +592,7 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) /* delete-expression: ::(opt) delete cast-expression ::(opt) delete [ ] cast-expression */ + static void pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) { @@ -535,16 +602,16 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) case DELETE_EXPR: case VEC_DELETE_EXPR: if (DELETE_EXPR_USE_GLOBAL (t)) - pp_cxx_colon_colon (pp); + pp_cxx_colon_colon (pp); pp_cxx_identifier (pp, "delete"); if (code == VEC_DELETE_EXPR) - { - pp_left_bracket (pp); - pp_right_bracket (pp); - } + { + pp_left_bracket (pp); + pp_right_bracket (pp); + } pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0)); - break; - + break; + default: pp_unsupported_tree (pp, t); } @@ -566,6 +633,7 @@ pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t) GNU extensions: __alignof__ unary-expression __alignof__ ( type-id ) */ + static void pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t) { @@ -581,7 +649,26 @@ pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t) case VEC_DELETE_EXPR: pp_cxx_delete_expression (pp, t); break; - + + case SIZEOF_EXPR: + case ALIGNOF_EXPR: + pp_cxx_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__"); + pp_cxx_whitespace (pp); + if (TYPE_P (TREE_OPERAND (t, 0))) + { + pp_cxx_left_paren (pp); + pp_cxx_type_id (pp, TREE_OPERAND (t, 0)); + pp_cxx_right_paren (pp); + } + else + pp_unary_expression (pp, TREE_OPERAND (t, 0)); + break; + + case UNARY_PLUS_EXPR: + pp_plus (pp); + pp_cxx_cast_expression (pp, TREE_OPERAND (t, 0)); + break; + default: pp_c_unary_expression (pp_c_base (pp), t); break; @@ -591,6 +678,7 @@ pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t) /* cast-expression: unary-expression ( type-id ) cast-expression */ + static void pp_cxx_cast_expression (cxx_pretty_printer *pp, tree t) { @@ -611,6 +699,7 @@ pp_cxx_cast_expression (cxx_pretty_printer *pp, tree t) cast-expression pm-expression .* cast-expression pm-expression ->* cast-expression */ + static void pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) { @@ -619,10 +708,10 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) /* Handle unfortunate OFFESET_REF overloading here. */ case OFFSET_REF: if (TYPE_P (TREE_OPERAND (t, 0))) - { - pp_cxx_qualified_id (pp, t); - break; - } + { + pp_cxx_qualified_id (pp, t); + break; + } /* Else fall through. */ case MEMBER_REF: case DOTSTAR_EXPR: @@ -644,6 +733,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t) multiplicative-expression * pm-expression multiplicative-expression / pm-expression multiplicative-expression % pm-expression */ + static void pp_cxx_multiplicative_expression (cxx_pretty_printer *pp, tree e) { @@ -674,6 +764,7 @@ pp_cxx_multiplicative_expression (cxx_pretty_printer *pp, tree e) /* conditional-expression: logical-or-expression logical-or-expression ? expression : assignment-expression */ + static void pp_cxx_conditional_expression (cxx_pretty_printer *pp, tree e) { @@ -691,6 +782,8 @@ pp_cxx_conditional_expression (cxx_pretty_printer *pp, tree e) pp_c_logical_or_expression (pp_c_base (pp), e); } +/* Pretty-print a compound assignment operator token as indicated by T. */ + static void pp_cxx_assignment_operator (cxx_pretty_printer *pp, tree t) { @@ -737,6 +830,7 @@ pp_cxx_assignment_operator (cxx_pretty_printer *pp, tree t) assignment-operator: one of = *= /= %= += -= >>= <<= &= ^= |= */ + static void pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e) { @@ -754,7 +848,7 @@ pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e) case THROW_EXPR: pp_cxx_identifier (pp, "throw"); if (TREE_OPERAND (e, 0)) - pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 0)); + pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 0)); break; case MODOP_EXPR: @@ -777,16 +871,16 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case STRING_CST: case INTEGER_CST: case REAL_CST: - pp_c_constant (pp_c_base (pp), t); + pp_cxx_constant (pp, t); break; case RESULT_DECL: pp_cxx_unqualified_id (pp, t); break; -#if 0 +#if 0 case OFFSET_REF: -#endif +#endif case SCOPE_REF: case PTRMEM_CST: pp_cxx_qualified_id (pp, t); @@ -803,6 +897,8 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case TEMPLATE_DECL: case TEMPLATE_TYPE_PARM: case TEMPLATE_PARM_INDEX: + case TEMPLATE_TEMPLATE_PARM: + case STMT_EXPR: pp_cxx_primary_expression (pp, t); break; @@ -811,13 +907,14 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case STATIC_CAST_EXPR: case REINTERPRET_CAST_EXPR: case CONST_CAST_EXPR: -#if 0 +#if 0 case MEMBER_REF: -#endif +#endif case EMPTY_CLASS_EXPR: case TYPEID_EXPR: case PSEUDO_DTOR_EXPR: case AGGR_INIT_EXPR: + case ARROW_EXPR: pp_cxx_postfix_expression (pp, t); break; @@ -831,6 +928,11 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) pp_cxx_delete_expression (pp, t); break; + case SIZEOF_EXPR: + case ALIGNOF_EXPR: + pp_cxx_unary_expression (pp, t); + break; + case CAST_EXPR: pp_cxx_cast_expression (pp, t); break; @@ -858,9 +960,14 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) pp_cxx_assignment_expression (pp, t); break; + case NON_DEPENDENT_EXPR: + case MUST_NOT_THROW_EXPR: + pp_cxx_expression (pp, t); + break; + default: pp_c_expression (pp_c_base (pp), t); - break; + break; } } @@ -871,6 +978,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) inline virtual explicit */ + static void pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t) { @@ -878,11 +986,11 @@ pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t) { case FUNCTION_DECL: if (DECL_VIRTUAL_P (t)) - pp_cxx_identifier (pp, "virtual"); + pp_cxx_identifier (pp, "virtual"); else if (DECL_CONSTRUCTOR_P (t) && DECL_NONCONVERTING_P (t)) - pp_cxx_identifier (pp, "explicit"); + pp_cxx_identifier (pp, "explicit"); else - pp_c_function_specifier (pp_c_base (pp), t); + pp_c_function_specifier (pp_c_base (pp), t); default: break; @@ -898,6 +1006,7 @@ pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t) function-specifier friend typedef */ + static void pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) { @@ -910,7 +1019,7 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) pp_cxx_storage_class_specifier (pp, t); pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t)); break; - + case TYPE_DECL: pp_cxx_identifier (pp, "typedef"); pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t)); @@ -918,23 +1027,23 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - { - tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t); - pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm))); - pp_cxx_whitespace (pp); - pp_cxx_ptr_operator (pp, t); - } + { + tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t); + pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm))); + pp_cxx_whitespace (pp); + pp_cxx_ptr_operator (pp, t); + } break; case FUNCTION_DECL: /* Constructors don't have return types. And conversion functions - do not have a type-specifier in their return types. */ + do not have a type-specifier in their return types. */ if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t)) - pp_cxx_function_specifier (pp, t); + pp_cxx_function_specifier (pp, t); else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) - pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))); + pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))); else - default: + default: pp_c_declaration_specifiers (pp_c_base (pp), t); break; } @@ -954,6 +1063,7 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t) float double void */ + static void pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t) { @@ -966,6 +1076,7 @@ pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t) break; case TEMPLATE_TYPE_PARM: + case TEMPLATE_TEMPLATE_PARM: case TEMPLATE_PARM_INDEX: pp_cxx_unqualified_id (pp, t); break; @@ -999,9 +1110,10 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t) { case TEMPLATE_DECL: case TEMPLATE_TYPE_PARM: + case TEMPLATE_TEMPLATE_PARM: case TYPE_DECL: case BOUND_TEMPLATE_TEMPLATE_PARM: - pp_c_type_qualifier_list (pp_c_base (pp), t); + pp_cxx_cv_qualifier_seq (pp, t); pp_cxx_simple_type_specifier (pp, t); break; @@ -1013,7 +1125,7 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t) default: if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t))) - pp_c_specifier_qualifier_list (pp_c_base (pp), t); + pp_c_specifier_qualifier_list (pp_c_base (pp), t); } } @@ -1032,33 +1144,35 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t) case REFERENCE_TYPE: case POINTER_TYPE: if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE - || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t))) - pp_cxx_ptr_operator (pp, TREE_TYPE (t)); + || TYPE_PTR_TO_MEMBER_P (TREE_TYPE (t))) + pp_cxx_ptr_operator (pp, TREE_TYPE (t)); if (TREE_CODE (t) == POINTER_TYPE) - { - pp_star (pp); - pp_cxx_cv_qualifier_seq (pp, t); - } + { + pp_star (pp); + pp_cxx_cv_qualifier_seq (pp, t); + } else - pp_ampersand (pp); + pp_ampersand (pp); break; case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - { - pp_cxx_left_paren (pp); - pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t)); - pp_star (pp); - break; - } + { + pp_cxx_left_paren (pp); + pp_cxx_nested_name_specifier (pp, TYPE_PTRMEMFUNC_OBJECT_TYPE (t)); + pp_star (pp); + break; + } case OFFSET_TYPE: if (TYPE_PTR_TO_MEMBER_P (t)) - { - pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t)); - pp_star (pp); - pp_cxx_cv_qualifier_seq (pp, t); - break; - } + { + if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) + pp_cxx_left_paren (pp); + pp_cxx_nested_name_specifier (pp, TYPE_PTRMEM_CLASS_TYPE (t)); + pp_star (pp); + pp_cxx_cv_qualifier_seq (pp, t); + break; + } /* else fall through. */ default: @@ -1079,6 +1193,7 @@ pp_cxx_implicit_parameter_type (tree mf) decl-specifier-seq declarator = assignment-expression decl-specifier-seq abstract-declarator(opt) decl-specifier-seq abstract-declarator(opt) assignment-expression */ + static inline void pp_cxx_parameter_declaration (cxx_pretty_printer *pp, tree t) { @@ -1096,11 +1211,13 @@ pp_cxx_parameter_declaration (cxx_pretty_printer *pp, tree t) parameter-declaration-list: parameter-declaration parameter-declaration-list , parameter-declaration */ + static void pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t) { tree args = TYPE_P (t) ? NULL : FUNCTION_FIRST_USER_PARM (t); - tree types = TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t); + tree types = + TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t); const bool abstract = args == NULL || pp_c_base (pp)->flags & pp_c_flag_abstract; bool first = true; @@ -1113,16 +1230,16 @@ pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t) for (; args; args = TREE_CHAIN (args), types = TREE_CHAIN (types)) { if (!first) - pp_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); first = false; pp_cxx_parameter_declaration (pp, abstract ? TREE_VALUE (types) : args); if (!abstract && pp_c_base (pp)->flags & pp_cxx_flag_default_argument) - { - pp_cxx_whitespace (pp); - pp_equal (pp); - pp_cxx_whitespace (pp); - pp_cxx_assignment_expression (pp, TREE_PURPOSE (types)); - } + { + pp_cxx_whitespace (pp); + pp_equal (pp); + pp_cxx_whitespace (pp); + pp_cxx_assignment_expression (pp, TREE_PURPOSE (types)); + } } pp_cxx_right_paren (pp); } @@ -1133,6 +1250,7 @@ pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t) type-id-list type-id type-id-list , type-id */ + static void pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t) { @@ -1146,7 +1264,7 @@ pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t) { pp_cxx_type_id (pp, TREE_VALUE (ex_spec)); if (TREE_CHAIN (ex_spec)) - pp_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); } pp_cxx_right_paren (pp); } @@ -1154,9 +1272,10 @@ pp_cxx_exception_specification (cxx_pretty_printer *pp, tree t) /* direct-declarator: declarator-id direct-declarator ( parameter-declaration-clause ) cv-qualifier-seq(opt) - exception-specification(opt) + exception-specification(opt) direct-declaration [ constant-expression(opt) ] ( declarator ) */ + static void pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) { @@ -1167,23 +1286,23 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) case CONST_DECL: case FIELD_DECL: if (DECL_NAME (t)) - { - pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t)); - pp_cxx_id_expression (pp, DECL_NAME (t)); - } + { + pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (t)); + pp_cxx_id_expression (pp, DECL_NAME (t)); + } pp_cxx_abstract_declarator (pp, TREE_TYPE (t)); break; - + case FUNCTION_DECL: pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t))); pp_cxx_id_expression (pp, t); pp_cxx_parameter_declaration_clause (pp, t); - + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) - { - pp_base (pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq (pp, pp_cxx_implicit_parameter_type (t)); - } + { + pp_base (pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq (pp, pp_cxx_implicit_parameter_type (t)); + } pp_cxx_exception_specification (pp, TREE_TYPE (t)); break; @@ -1192,6 +1311,7 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) case TEMPLATE_DECL: case TEMPLATE_TYPE_PARM: case TEMPLATE_PARM_INDEX: + case TEMPLATE_TEMPLATE_PARM: break; default: @@ -1203,6 +1323,7 @@ pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t) /* declarator: direct-declarator ptr-operator declarator */ + static void pp_cxx_declarator (cxx_pretty_printer *pp, tree t) { @@ -1222,6 +1343,7 @@ pp_cxx_declarator (cxx_pretty_printer *pp, tree t) mem-initializer-id: ::(opt) nested-name-specifier(opt) class-name identifier */ + static void pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t) { @@ -1234,7 +1356,7 @@ pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t) pp_cxx_primary_expression (pp, TREE_PURPOSE (t)); pp_cxx_call_argument_list (pp, TREE_VALUE (t)); if (TREE_CHAIN (t)) - pp_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); } } @@ -1242,7 +1364,7 @@ pp_cxx_ctor_initializer (cxx_pretty_printer *pp, tree t) decl-specifier-seq(opt) declarator ctor-initializer(opt) function-body decl-specifier-seq(opt) declarator function-try-block */ -void +static void pp_cxx_function_definition (cxx_pretty_printer *pp, tree t) { tree saved_scope = pp->enclosing_scope; @@ -1251,17 +1373,7 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t) pp_needs_newline (pp) = true; pp->enclosing_scope = DECL_CONTEXT (t); if (DECL_SAVED_TREE (t)) - { - tree body = DECL_SAVED_TREE (t); - if (TREE_CODE (body) == COMPOUND_STMT - && TREE_CODE (COMPOUND_BODY (body)) == CTOR_INITIALIZER) - { - body = COMPOUND_BODY (body); - pp_cxx_ctor_initializer (pp, body); - body = TREE_CHAIN (body); - } - pp_cxx_statement (pp, body); - } + pp_cxx_statement (pp, DECL_SAVED_TREE (t)); else { pp_cxx_semicolon (pp); @@ -1274,6 +1386,7 @@ pp_cxx_function_definition (cxx_pretty_printer *pp, tree t) /* abstract-declarator: ptr-operator abstract-declarator(opt) direct-abstract-declarator */ + static void pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) { @@ -1282,8 +1395,8 @@ pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) else if (POINTER_TYPE_P (t)) { if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE - || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) - pp_cxx_right_paren (pp); + || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) + pp_cxx_right_paren (pp); t = TREE_TYPE (t); } pp_cxx_direct_abstract_declarator (pp, t); @@ -1291,9 +1404,10 @@ pp_cxx_abstract_declarator (cxx_pretty_printer *pp, tree t) /* direct-abstract-declarator: direct-abstract-declarator(opt) ( parameter-declaration-clause ) - cv-qualifier-seq(opt) exception-specification(opt) + cv-qualifier-seq(opt) exception-specification(opt) direct-abstract-declarator(opt) [ constant-expression(opt) ] ( abstract-declarator ) */ + static void pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) { @@ -1305,7 +1419,7 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) - pp_cxx_direct_abstract_declarator (pp, TYPE_PTRMEMFUNC_FN_TYPE (t)); + pp_cxx_direct_abstract_declarator (pp, TYPE_PTRMEMFUNC_FN_TYPE (t)); break; case METHOD_TYPE: @@ -1313,11 +1427,11 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) pp_cxx_parameter_declaration_clause (pp, t); pp_cxx_direct_abstract_declarator (pp, TREE_TYPE (t)); if (TREE_CODE (t) == METHOD_TYPE) - { - pp_base (pp)->padding = pp_before; - pp_cxx_cv_qualifier_seq - (pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); - } + { + pp_base (pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq + (pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); + } pp_cxx_exception_specification (pp, t); break; @@ -1330,12 +1444,13 @@ pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t) default: pp_c_direct_abstract_declarator (pp_c_base (pp), t); - break; + break; } } /* type-id: type-specifier-seq abstract-declarator(opt) */ + static void pp_cxx_type_id (cxx_pretty_printer *pp, tree t) { @@ -1357,9 +1472,7 @@ pp_cxx_type_id (cxx_pretty_printer *pp, tree t) case TEMPLATE_DECL: case TYPEOF_TYPE: case TEMPLATE_ID_EXPR: - /* FIXME: Should be pp_cxx_type_specifier_seq. */ pp_cxx_type_specifier_seq (pp, t); - pp_cxx_declarator (pp, t); break; default: @@ -1378,6 +1491,7 @@ pp_cxx_type_id (cxx_pretty_printer *pp, tree t) assignment-expression type-id template-name */ + static void pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t) { @@ -1388,12 +1502,12 @@ pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t) { tree arg = TREE_VEC_ELT (t, i); if (i != 0) - pp_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); if (TYPE_P (arg) || (TREE_CODE (arg) == TEMPLATE_DECL - && TYPE_P (DECL_TEMPLATE_RESULT (arg)))) - pp_cxx_type_id (pp, arg); + && TYPE_P (DECL_TEMPLATE_RESULT (arg)))) + pp_cxx_type_id (pp, arg); else - pp_cxx_expression (pp, arg); + pp_cxx_expression (pp, arg); } } @@ -1401,7 +1515,7 @@ pp_cxx_template_argument_list (cxx_pretty_printer *pp, tree t) static void pp_cxx_exception_declaration (cxx_pretty_printer *pp, tree t) { - t = DECL_STMT_DECL (t); + t = DECL_EXPR_DECL (t); pp_cxx_type_specifier_seq (pp, t); if (TYPE_P (t)) pp_cxx_abstract_declarator (pp, t); @@ -1411,20 +1525,26 @@ pp_cxx_exception_declaration (cxx_pretty_printer *pp, tree t) /* Statements. */ -void +static void pp_cxx_statement (cxx_pretty_printer *pp, tree t) { switch (TREE_CODE (t)) { + case CTOR_INITIALIZER: + pp_cxx_ctor_initializer (pp, t); + break; + case USING_STMT: pp_cxx_identifier (pp, "using"); pp_cxx_identifier (pp, "namespace"); + if (DECL_CONTEXT (t)) + pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); pp_cxx_qualified_id (pp, USING_STMT_NAMESPACE (t)); break; case USING_DECL: pp_cxx_identifier (pp, "using"); - pp_cxx_nested_name_specifier (pp, DECL_INITIAL (t)); + pp_cxx_nested_name_specifier (pp, USING_DECL_SCOPE (t)); pp_cxx_unqualified_id (pp, DECL_NAME (t)); break; @@ -1432,7 +1552,7 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) break; /* try-block: - try compound-statement handler-seq */ + try compound-statement handler-seq */ case TRY_BLOCK: pp_maybe_newline_and_indent (pp, 0); pp_cxx_identifier (pp, "try"); @@ -1440,22 +1560,22 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) pp_cxx_statement (pp, TRY_STMTS (t)); pp_newline_and_indent (pp, -3); if (CLEANUP_P (t)) - ; + ; else - pp_cxx_statement (pp, TRY_HANDLERS (t)); + pp_cxx_statement (pp, TRY_HANDLERS (t)); break; /* - handler-seq: - handler handler-seq(opt) + handler-seq: + handler handler-seq(opt) - handler: - catch ( exception-declaration ) compound-statement + handler: + catch ( exception-declaration ) compound-statement - exception-declaration: - type-specifier-seq declarator - type-specifier-seq abstract-declarator - ... */ + exception-declaration: + type-specifier-seq declarator + type-specifier-seq abstract-declarator + ... */ case HANDLER: pp_cxx_identifier (pp, "catch"); pp_cxx_left_paren (pp); @@ -1468,6 +1588,129 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) pp_needs_newline (pp) = true; break; + /* selection-statement: + if ( expression ) statement + if ( expression ) statement else statement */ + case IF_STMT: + pp_cxx_identifier (pp, "if"); + pp_cxx_whitespace (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, IF_COND (t)); + pp_cxx_right_paren (pp); + pp_newline_and_indent (pp, 2); + pp_cxx_statement (pp, THEN_CLAUSE (t)); + pp_newline_and_indent (pp, -2); + if (ELSE_CLAUSE (t)) + { + tree else_clause = ELSE_CLAUSE (t); + pp_cxx_identifier (pp, "else"); + if (TREE_CODE (else_clause) == IF_STMT) + pp_cxx_whitespace (pp); + else + pp_newline_and_indent (pp, 2); + pp_cxx_statement (pp, else_clause); + if (TREE_CODE (else_clause) != IF_STMT) + pp_newline_and_indent (pp, -2); + } + break; + + case SWITCH_STMT: + pp_cxx_identifier (pp, "switch"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, SWITCH_STMT_COND (t)); + pp_cxx_right_paren (pp); + pp_indentation (pp) += 3; + pp_needs_newline (pp) = true; + pp_cxx_statement (pp, SWITCH_STMT_BODY (t)); + pp_newline_and_indent (pp, -3); + break; + + /* iteration-statement: + while ( expression ) statement + do statement while ( expression ) ; + for ( expression(opt) ; expression(opt) ; expression(opt) ) statement + for ( declaration expression(opt) ; expression(opt) ) statement */ + case WHILE_STMT: + pp_cxx_identifier (pp, "while"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, WHILE_COND (t)); + pp_cxx_right_paren (pp); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, WHILE_BODY (t)); + pp_indentation (pp) -= 3; + pp_needs_newline (pp) = true; + break; + + case DO_STMT: + pp_cxx_identifier (pp, "do"); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, DO_BODY (t)); + pp_newline_and_indent (pp, -3); + pp_cxx_identifier (pp, "while"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, DO_COND (t)); + pp_cxx_right_paren (pp); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + + case FOR_STMT: + pp_cxx_identifier (pp, "for"); + pp_space (pp); + pp_cxx_left_paren (pp); + if (FOR_INIT_STMT (t)) + pp_cxx_statement (pp, FOR_INIT_STMT (t)); + else + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = false; + pp_cxx_whitespace (pp); + if (FOR_COND (t)) + pp_cxx_expression (pp, FOR_COND (t)); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = false; + pp_cxx_whitespace (pp); + if (FOR_EXPR (t)) + pp_cxx_expression (pp, FOR_EXPR (t)); + pp_cxx_right_paren (pp); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, FOR_BODY (t)); + pp_indentation (pp) -= 3; + pp_needs_newline (pp) = true; + break; + + /* jump-statement: + goto identifier; + continue ; + return expression(opt) ; */ + case BREAK_STMT: + case CONTINUE_STMT: + pp_identifier (pp, TREE_CODE (t) == BREAK_STMT ? "break" : "continue"); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + + /* expression-statement: + expression(opt) ; */ + case EXPR_STMT: + pp_cxx_expression (pp, EXPR_STMT_EXPR (t)); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + + case CLEANUP_STMT: + pp_cxx_identifier (pp, "try"); + pp_newline_and_indent (pp, 2); + pp_cxx_statement (pp, CLEANUP_BODY (t)); + pp_newline_and_indent (pp, -2); + pp_cxx_identifier (pp, CLEANUP_EH_ONLY (t) ? "catch" : "finally"); + pp_newline_and_indent (pp, 2); + pp_cxx_statement (pp, CLEANUP_EXPR (t)); + pp_newline_and_indent (pp, -2); + break; + default: pp_c_statement (pp_c_base (pp), t); break; @@ -1483,6 +1726,8 @@ static void pp_cxx_original_namespace_definition (cxx_pretty_printer *pp, tree t) { pp_cxx_identifier (pp, "namespace"); + if (DECL_CONTEXT (t)) + pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); if (DECL_NAME (t)) pp_cxx_unqualified_id (pp, t); pp_cxx_whitespace (pp); @@ -1505,16 +1750,22 @@ static void pp_cxx_namespace_alias_definition (cxx_pretty_printer *pp, tree t) { pp_cxx_identifier (pp, "namespace"); + if (DECL_CONTEXT (t)) + pp_cxx_nested_name_specifier (pp, DECL_CONTEXT (t)); pp_cxx_unqualified_id (pp, t); pp_cxx_whitespace (pp); pp_equal (pp); pp_cxx_whitespace (pp); + if (DECL_CONTEXT (DECL_NAMESPACE_ALIAS (t))) + pp_cxx_nested_name_specifier (pp, + DECL_CONTEXT (DECL_NAMESPACE_ALIAS (t))); pp_cxx_qualified_id (pp, DECL_NAMESPACE_ALIAS (t)); pp_cxx_semicolon (pp); } /* simple-declaration: decl-specifier-seq(opt) init-declarator-list(opt) */ + static void pp_cxx_simple_declaration (cxx_pretty_printer *pp, tree t) { @@ -1537,7 +1788,7 @@ pp_cxx_template_parameter_list (cxx_pretty_printer *pp, tree t) for (i = 0; i < n; ++i) { if (i) - pp_separate_with (pp, ','); + pp_cxx_separate_with (pp, ','); pp_cxx_template_parameter (pp, TREE_VEC_ELT (t, i)); } } @@ -1552,8 +1803,8 @@ pp_cxx_template_parameter_list (cxx_pretty_printer *pp, tree t) typename identifier(opt) typename identifier(opt) = type-id template < template-parameter-list > class identifier(opt) - template < template-parameter-list > class identifier(opt) = template-name -*/ + template < template-parameter-list > class identifier(opt) = template-name */ + static void pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t) { @@ -1563,7 +1814,7 @@ pp_cxx_template_parameter (cxx_pretty_printer *pp, tree t) case TYPE_DECL: pp_cxx_identifier (pp, "class"); if (DECL_NAME (parameter)) - pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); + pp_cxx_tree_identifier (pp, DECL_NAME (parameter)); /* FIXME: Chech if we should print also default argument. */ break; @@ -1592,7 +1843,7 @@ pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm) if (code == TEMPLATE_TYPE_PARM || code == TEMPLATE_TEMPLATE_PARM || code == BOUND_TEMPLATE_TEMPLATE_PARM) parm = TEMPLATE_TYPE_PARM_INDEX (parm); - + pp_cxx_begin_template_argument_list (pp); pp_cxx_identifier (pp, "template-parameter-"); pp_wide_integer (pp, TEMPLATE_PARM_LEVEL (parm)); @@ -1604,6 +1855,7 @@ pp_cxx_canonical_template_parameter (cxx_pretty_printer *pp, tree parm) /* template-declaration: export(opt) template < template-parameter-list > declaration */ + static void pp_cxx_template_declaration (cxx_pretty_printer *pp, tree t) { @@ -1664,19 +1916,19 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) switch (DECL_USE_TEMPLATE (t)) { case 1: - pp_cxx_template_declaration (pp, t); - break; - + pp_cxx_template_declaration (pp, t); + break; + case 2: - pp_cxx_explicit_specialization (pp, t); - break; + pp_cxx_explicit_specialization (pp, t); + break; case 3: - pp_cxx_explicit_instantiation (pp, t); - break; + pp_cxx_explicit_instantiation (pp, t); + break; default: - break; + break; } else switch (TREE_CODE (t)) { @@ -1684,19 +1936,19 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) case TYPE_DECL: pp_cxx_simple_declaration (pp, t); break; - + case FUNCTION_DECL: if (DECL_SAVED_TREE (t)) - pp_cxx_function_definition (pp, t); + pp_cxx_function_definition (pp, t); else - pp_cxx_simple_declaration (pp, t); + pp_cxx_simple_declaration (pp, t); break; case NAMESPACE_DECL: if (DECL_NAMESPACE_ALIAS (t)) - pp_cxx_namespace_alias_definition (pp, t); + pp_cxx_namespace_alias_definition (pp, t); else - pp_cxx_original_namespace_definition (pp, t); + pp_cxx_original_namespace_definition (pp, t); break; default: @@ -1708,6 +1960,8 @@ pp_cxx_declaration (cxx_pretty_printer *pp, tree t) typedef c_pretty_print_fn pp_fun; +/* Initialization of a C++ pretty-printer object. */ + void pp_cxx_pretty_printer_init (cxx_pretty_printer *pp) { @@ -1729,6 +1983,7 @@ pp_cxx_pretty_printer_init (cxx_pretty_printer *pp) /* pp->c_base.statement = (pp_fun) pp_cxx_statement; */ + pp->c_base.constant = (pp_fun) pp_cxx_constant; pp->c_base.id_expression = (pp_fun) pp_cxx_id_expression; pp->c_base.primary_expression = (pp_fun) pp_cxx_primary_expression; pp->c_base.postfix_expression = (pp_fun) pp_cxx_postfix_expression; diff --git a/contrib/gcc/cp/cxx-pretty-print.h b/contrib/gcc/cp/cxx-pretty-print.h index b47eff0ef19..55e9b9c7d03 100644 --- a/contrib/gcc/cp/cxx-pretty-print.h +++ b/contrib/gcc/cp/cxx-pretty-print.h @@ -1,5 +1,5 @@ /* Interface for the GNU C++ pretty-printer. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. @@ -16,8 +16,8 @@ for more details. 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. */ #ifndef GCC_CXX_PRETTY_PRINT_H #define GCC_CXX_PRETTY_PRINT_H @@ -29,9 +29,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA typedef enum { - /* Ask for an qualified-id. */ + /* Ask for a qualified-id. */ pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit - + } cxx_pretty_printer_flags; typedef struct @@ -41,12 +41,35 @@ typedef struct tree enclosing_scope; } cxx_pretty_printer; +#define pp_cxx_cv_qualifier_seq(PP, T) \ + pp_c_type_qualifier_list (pp_c_base (PP), T) + +#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP)) +#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP)) +#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP)) +#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP)) +#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP)) +#define pp_cxx_left_bracket(PP) pp_c_left_bracket (pp_c_base (PP)) +#define pp_cxx_right_bracket(PP) pp_c_right_bracket (pp_c_base (PP)) +#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP)) +#define pp_cxx_ampersand(PP) pp_c_ampersand (pp_c_base (PP)) +#define pp_cxx_star(PP) pp_c_star (pp_c_base (PP)) +#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP)) +#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP)) +#define pp_cxx_complement(PP) pp_c_complement (pp_c_base (PP)) + +#define pp_cxx_identifier(PP, I) pp_c_identifier (pp_c_base (PP), I) +#define pp_cxx_tree_identifier(PP, T) \ + pp_c_tree_identifier (pp_c_base (PP), T) + void pp_cxx_pretty_printer_init (cxx_pretty_printer *); +void pp_cxx_begin_template_argument_list (cxx_pretty_printer *); +void pp_cxx_end_template_argument_list (cxx_pretty_printer *); +void pp_cxx_colon_colon (cxx_pretty_printer *); +void pp_cxx_separate_with (cxx_pretty_printer *, int); void pp_cxx_declaration (cxx_pretty_printer *, tree); -void pp_cxx_function_definition (cxx_pretty_printer *, tree); void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree); -void pp_cxx_statement (cxx_pretty_printer *, tree); #endif /* GCC_CXX_PRETTY_PRINT_H */ diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c index 451993eb492..c3d71bcdd4e 100644 --- a/contrib/gcc/cp/decl.c +++ b/contrib/gcc/cp/decl.c @@ -1,6 +1,6 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Process declarations and symbol lookup for C++ front end. @@ -39,7 +39,6 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" #include "tree-inline.h" #include "decl.h" -#include "lex.h" #include "output.h" #include "except.h" #include "toplev.h" @@ -51,8 +50,9 @@ Boston, MA 02111-1307, USA. */ #include "diagnostic.h" #include "debug.h" #include "timevar.h" +#include "tree-flow.h" -static tree grokparms (tree, tree *); +static tree grokparms (cp_parameter_declarator *, tree *); static const char *redeclaration_error_message (tree, tree); static int decl_jump_unsafe (tree); @@ -61,13 +61,12 @@ static int ambi_op_p (enum tree_code); static int unary_op_p (enum tree_code); static void push_local_name (tree); static tree grok_reference_init (tree, tree, tree, tree *); -static tree grokfndecl (tree, tree, tree, tree, tree, int, - enum overload_flags, tree, - tree, int, int, int, int, int, int, tree); -static tree grokvardecl (tree, tree, RID_BIT_TYPE *, int, int, tree); +static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *, + int, int, tree); static void record_unknown_type (tree, const char *); -static tree builtin_function_1 (const char *, tree, tree, int, - enum built_in_class, const char *, +static tree builtin_function_1 (const char *, tree, tree, + enum built_in_function code, + enum built_in_class cl, const char *, tree); static tree build_library_fn_1 (tree, enum tree_code, tree); static int member_function_or_else (tree, tree, enum overload_flags); @@ -78,19 +77,9 @@ static hashval_t typename_hash (const void *); static int typename_compare (const void *, const void *); static tree local_variable_p_walkfn (tree *, int *, void *); static tree record_builtin_java_type (const char *, int); -static const char *tag_name (enum tag_types code); +static const char *tag_name (enum tag_types); +static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool); static int walk_namespaces_r (tree, walk_namespaces_fn, void *); -static int walk_globals_r (tree, void*); -static int walk_vtables_r (tree, void*); -static tree make_label_decl (tree, int); -static void use_label (tree); -static void check_previous_goto_1 (tree, struct cp_binding_level *, tree, - const location_t *); -static void check_previous_goto (struct named_label_use_list *); -static void check_switch_goto (struct cp_binding_level *); -static void check_previous_gotos (tree); -static void pop_label (tree, tree); -static void pop_labels (tree); static void maybe_deduce_size_from_array_init (tree, tree); static void layout_var_decl (tree); static void maybe_commonize_var (tree); @@ -98,7 +87,6 @@ static tree check_initializer (tree, tree, int, tree *); static void make_rtl_for_nonlocal_decl (tree, tree, const char *); static void save_function_data (tree); static void check_function_type (tree, tree); -static void begin_constructor_body (void); static void finish_constructor_body (void); static void begin_destructor_body (void); static void finish_destructor_body (void); @@ -109,21 +97,14 @@ static tree start_cleanup_fn (void); static void end_cleanup_fn (void); static tree cp_make_fname_decl (tree, int); static void initialize_predefined_identifiers (void); -static tree check_special_function_return_type +static tree check_special_function_return_type (special_function_kind, tree, tree); static tree push_cp_library_fn (enum tree_code, tree); static tree build_cp_library_fn (tree, enum tree_code, tree); static void store_parm_decls (tree); -static int cp_missing_noreturn_ok_p (tree); static void initialize_local_var (tree, tree); static void expand_static_init (tree, tree); static tree next_initializable_field (tree); -static tree reshape_init (tree, tree *); -static bool reshape_init_array (tree, tree, tree *, tree); -static tree build_typename_type (tree, tree, tree); - -/* Erroneous argument lists can use this *IFF* they do not modify it. */ -tree error_mark_list; /* The following symbols are subsumed in the cp_global_trees array, and listed here individually for documentation purposes. @@ -134,12 +115,6 @@ tree error_mark_list; tree vtable_entry_type; tree delta_type_node; tree __t_desc_type_node; - tree ti_desc_type_node; - tree bltn_desc_type_node, ptr_desc_type_node; - tree ary_desc_type_node, func_desc_type_node, enum_desc_type_node; - tree class_desc_type_node, si_class_desc_type_node, vmi_class_desc_type_node; - tree ptm_desc_type_node; - tree base_desc_type_node; tree class_type_node; tree unknown_type_node; @@ -166,9 +141,7 @@ tree error_mark_list; Used by RTTI tree type_info_type_node, tinfo_decl_id, tinfo_decl_type; - tree tinfo_var_id; - -*/ + tree tinfo_var_id; */ tree cp_global_trees[CPTI_MAX]; @@ -180,20 +153,6 @@ tree global_type_node; /* The node that holds the "name" of the global scope. */ tree global_scope_name; -/* Used only for jumps to as-yet undefined labels, since jumps to - defined labels can have their validity checked immediately. */ - -struct named_label_use_list GTY(()) -{ - struct cp_binding_level *binding_level; - tree names_in_scope; - tree label_decl; - location_t o_goto_locus; - struct named_label_use_list *next; -}; - -#define named_label_uses cp_function_chain->x_named_label_uses - #define local_names cp_function_chain->x_local_names /* A list of objects which have constructors or destructors @@ -208,20 +167,58 @@ tree static_aggregates; tree integer_two_node, integer_three_node; +/* Used only for jumps to as-yet undefined labels, since jumps to + defined labels can have their validity checked immediately. */ + +struct named_label_use_entry GTY(()) +{ + struct named_label_use_entry *next; + /* The binding level to which this entry is *currently* attached. + This is initially the binding level in which the goto appeared, + but is modified as scopes are closed. */ + struct cp_binding_level *binding_level; + /* The head of the names list that was current when the goto appeared, + or the inner scope popped. These are the decls that will *not* be + skipped when jumping to the label. */ + tree names_in_scope; + /* The location of the goto, for error reporting. */ + location_t o_goto_locus; + /* True if an OpenMP structured block scope has been closed since + the goto appeared. This means that the branch from the label will + illegally exit an OpenMP scope. */ + bool in_omp_scope; +}; + /* A list of all LABEL_DECLs in the function that have names. Here so we can clear out their names' definitions at the end of the function, and so we can check the validity of jumps to these labels. */ -struct named_label_list GTY(()) +struct named_label_entry GTY(()) { - struct cp_binding_level *binding_level; - tree names_in_scope; - tree old_value; + /* The decl itself. */ tree label_decl; + + /* The binding level to which the label is *currently* attached. + This is initially set to the binding level in which the label + is defined, but is modified as scopes are closed. */ + struct cp_binding_level *binding_level; + /* The head of the names list that was current when the label was + defined, or the inner scope popped. These are the decls that will + be skipped when jumping to the label. */ + tree names_in_scope; + /* A tree list of all decls from all binding levels that would be + crossed by a backward branch to the label. */ tree bad_decls; - struct named_label_list *next; - unsigned int in_try_scope : 1; - unsigned int in_catch_scope : 1; + + /* A list of uses of the label, before the label is defined. */ + struct named_label_use_entry *uses; + + /* The following bits are set after the label is defined, and are + updated as scopes are popped. They indicate that a backward jump + to the label will illegally enter a scope of the given flavor. */ + bool in_try_scope; + bool in_catch_scope; + bool in_omp_scope; }; #define named_labels cp_function_chain->x_named_labels @@ -235,7 +232,7 @@ int function_depth; with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ - + enum deprecated_states { DEPRECATED_NORMAL, DEPRECATED_SUPPRESS @@ -243,15 +240,6 @@ enum deprecated_states { static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; -/* Set by add_implicitly_declared_members() to keep those members from - being flagged as deprecated or reported as using deprecated - types. */ -int adding_implicit_members = 0; - -/* True if a declaration with an `extern' linkage specifier is being - processed. */ -bool have_extern_spec; - /* A TREE_LIST of VAR_DECLs. The TREE_PURPOSE is a RECORD_TYPE or UNION_TYPE; the TREE_VALUE is a VAR_DECL with that type. At the @@ -272,8 +260,8 @@ current_tmpl_spec_kind (int n_class_scopes) struct cp_binding_level *b; /* Scan through the template parameter scopes. */ - for (b = current_binding_level; - b->kind == sk_template_parms; + for (b = current_binding_level; + b->kind == sk_template_parms; b = b->level_chain) { /* If we see a specialization scope inside a parameter scope, @@ -317,7 +305,7 @@ current_tmpl_spec_kind (int n_class_scopes) /* We've not seen enough template headers to match all the specialized classes present. For example: - template void R::S::f(int); + template void R::S::f(int); This is invalid; there needs to be one set of template parameters for each class. */ @@ -326,7 +314,7 @@ current_tmpl_spec_kind (int n_class_scopes) /* We're processing a non-template declaration (even though it may be a member of a template class.) For example: - template void S::f(int); + template void S::f(int); The `class T' maches the `S', leaving no template headers corresponding to the `f'. */ @@ -334,14 +322,14 @@ current_tmpl_spec_kind (int n_class_scopes) else if (n_template_parm_scopes > n_class_scopes + 1) /* We've got too many template headers. For example: - template <> template void f (T); + template <> template void f (T); There need to be more enclosing classes. */ return tsk_excessive_parms; else /* This must be a template. It's of the form: - template template void S::f(U); + template template void S::f(U); This is a specialization if the innermost level was a specialization; otherwise it's just a definition of the @@ -369,14 +357,18 @@ pop_label (tree label, tree old_value) { location_t location; - cp_error_at ("label `%D' used but not defined", label); - location.file = input_filename; + error ("label %q+D used but not defined", label); +#ifdef USE_MAPPED_LOCATION + location = input_location; /* FIXME want (input_filename, (line)0) */ +#else + location.file = input_filename; location.line = 0; +#endif /* Avoid crashing later. */ define_label (location, DECL_NAME (label)); } - else if (warn_unused_label && !TREE_USED (label)) - cp_warning_at ("label `%D' defined but not used", label); + else if (!TREE_USED (label)) + warning (OPT_Wunused_label, "label %q+D defined but not used", label); } SET_IDENTIFIER_LABEL_VALUE (DECL_NAME (label), old_value); @@ -386,23 +378,133 @@ pop_label (tree label, tree old_value) go out of scope. BLOCK is the top-level block for the function. */ +static int +pop_labels_1 (void **slot, void *data) +{ + struct named_label_entry *ent = (struct named_label_entry *) *slot; + tree block = (tree) data; + + pop_label (ent->label_decl, NULL_TREE); + + /* Put the labels into the "variables" of the top-level block, + so debugger can see them. */ + TREE_CHAIN (ent->label_decl) = BLOCK_VARS (block); + BLOCK_VARS (block) = ent->label_decl; + + htab_clear_slot (named_labels, slot); + + return 1; +} + static void pop_labels (tree block) { - struct named_label_list *link; - - /* Clear out the definitions of all label names, since their scopes - end here. */ - for (link = named_labels; link; link = link->next) + if (named_labels) { - pop_label (link->label_decl, link->old_value); - /* Put the labels into the "variables" of the top-level block, - so debugger can see them. */ - TREE_CHAIN (link->label_decl) = BLOCK_VARS (block); - BLOCK_VARS (block) = link->label_decl; + htab_traverse (named_labels, pop_labels_1, block); + named_labels = NULL; + } +} + +/* At the end of a block with local labels, restore the outer definition. */ + +static void +pop_local_label (tree label, tree old_value) +{ + struct named_label_entry dummy; + void **slot; + + pop_label (label, old_value); + + dummy.label_decl = label; + slot = htab_find_slot (named_labels, &dummy, NO_INSERT); + htab_clear_slot (named_labels, slot); +} + +/* The following two routines are used to interface to Objective-C++. + The binding level is purposely treated as an opaque type. */ + +void * +objc_get_current_scope (void) +{ + return current_binding_level; +} + +/* The following routine is used by the NeXT-style SJLJ exceptions; + variables get marked 'volatile' so as to not be clobbered by + _setjmp()/_longjmp() calls. All variables in the current scope, + as well as parent scopes up to (but not including) ENCLOSING_BLK + shall be thusly marked. */ + +void +objc_mark_locals_volatile (void *enclosing_blk) +{ + struct cp_binding_level *scope; + + for (scope = current_binding_level; + scope && scope != enclosing_blk; + scope = scope->level_chain) + { + tree decl; + + for (decl = scope->names; decl; decl = TREE_CHAIN (decl)) + objc_volatilize_decl (decl); + + /* Do not climb up past the current function. */ + if (scope->kind == sk_function_parms) + break; + } +} + +/* Update data for defined and undefined labels when leaving a scope. */ + +static int +poplevel_named_label_1 (void **slot, void *data) +{ + struct named_label_entry *ent = (struct named_label_entry *) *slot; + struct cp_binding_level *bl = (struct cp_binding_level *) data; + struct cp_binding_level *obl = bl->level_chain; + + if (ent->binding_level == bl) + { + tree decl; + + for (decl = ent->names_in_scope; decl; decl = TREE_CHAIN (decl)) + if (decl_jump_unsafe (decl)) + ent->bad_decls = tree_cons (NULL, decl, ent->bad_decls); + + ent->binding_level = obl; + ent->names_in_scope = obl->names; + switch (bl->kind) + { + case sk_try: + ent->in_try_scope = true; + break; + case sk_catch: + ent->in_catch_scope = true; + break; + case sk_omp: + ent->in_omp_scope = true; + break; + default: + break; + } + } + else if (ent->uses) + { + struct named_label_use_entry *use; + + for (use = ent->uses; use ; use = use->next) + if (use->binding_level == bl) + { + use->binding_level = obl; + use->names_in_scope = obl->names; + if (bl->kind == sk_omp) + use->in_omp_scope = true; + } } - named_labels = NULL; + return 1; } /* Exit a binding level. @@ -430,65 +532,38 @@ poplevel (int keep, int reverse, int functionbody) int tmp = functionbody; int real_functionbody; tree subblocks; - tree block = NULL_TREE; + tree block; tree decl; int leaving_for_scope; scope_kind kind; timevar_push (TV_NAME_LOOKUP); + restart: - my_friendly_assert (current_binding_level->kind != sk_class, 19990916); + block = NULL_TREE; + + gcc_assert (current_binding_level->kind != sk_class); real_functionbody = (current_binding_level->kind == sk_cleanup ? ((functionbody = 0), tmp) : functionbody); subblocks = functionbody >= 0 ? current_binding_level->blocks : 0; - my_friendly_assert (!current_binding_level->class_shadowed, - 19990414); + gcc_assert (!VEC_length(cp_class_binding, + current_binding_level->class_shadowed)); /* We used to use KEEP == 2 to indicate that the new block should go at the beginning of the list of blocks at this binding level, rather than the end. This hack is no longer used. */ - my_friendly_assert (keep == 0 || keep == 1, 0); + gcc_assert (keep == 0 || keep == 1); if (current_binding_level->keep) keep = 1; /* Any uses of undefined labels, and any defined labels, now operate under constraints of next binding contour. */ - if (cfun && !functionbody) - { - struct cp_binding_level *level_chain; - level_chain = current_binding_level->level_chain; - if (level_chain) - { - struct named_label_use_list *uses; - struct named_label_list *labels; - for (labels = named_labels; labels; labels = labels->next) - if (labels->binding_level == current_binding_level) - { - tree decl; - if (current_binding_level->kind == sk_try) - labels->in_try_scope = 1; - if (current_binding_level->kind == sk_catch) - labels->in_catch_scope = 1; - for (decl = labels->names_in_scope; decl; - decl = TREE_CHAIN (decl)) - if (decl_jump_unsafe (decl)) - labels->bad_decls = tree_cons (NULL_TREE, decl, - labels->bad_decls); - labels->binding_level = level_chain; - labels->names_in_scope = level_chain->names; - } - - for (uses = named_label_uses; uses; uses = uses->next) - if (uses->binding_level == current_binding_level) - { - uses->binding_level = level_chain; - uses->names_in_scope = level_chain->names; - } - } - } + if (cfun && !functionbody && named_labels) + htab_traverse (named_labels, poplevel_named_label_1, + current_binding_level); /* Get the decls in the order they were written. Usually current_binding_level->names is in reverse order. @@ -500,36 +575,6 @@ poplevel (int keep, int reverse, int functionbody) else decls = current_binding_level->names; - /* Output any nested inline functions within this block - if they weren't already output. */ - for (decl = decls; decl; decl = TREE_CHAIN (decl)) - if (TREE_CODE (decl) == FUNCTION_DECL - && ! TREE_ASM_WRITTEN (decl) - && DECL_INITIAL (decl) != NULL_TREE - && TREE_ADDRESSABLE (decl) - && decl_function_context (decl) == current_function_decl) - { - /* If this decl was copied from a file-scope decl - on account of a block-scope extern decl, - propagate TREE_ADDRESSABLE to the file-scope decl. */ - if (DECL_ABSTRACT_ORIGIN (decl) != NULL_TREE) - TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1; - else - { - push_function_context (); - output_inline_function (decl); - pop_function_context (); - } - } - - /* When not in function-at-a-time mode, expand_end_bindings will - warn about unused variables. But, in function-at-a-time mode - expand_end_bindings is not passed the list of variables in the - current scope, and therefore no warning is emitted. So, we - explicitly warn here. */ - if (!processing_template_decl) - warn_about_unused_variables (getdecls ()); - /* If there were any declarations or structure tags in that level, or if this level is a function body, create a BLOCK to record them for the life of this function. */ @@ -554,33 +599,44 @@ poplevel (int keep, int reverse, int functionbody) leaving_for_scope = current_binding_level->kind == sk_for && flag_new_for_scope == 1; + /* Before we remove the declarations first check for unused variables. */ + if (warn_unused_variable + && !processing_template_decl) + for (decl = getdecls (); decl; decl = TREE_CHAIN (decl)) + if (TREE_CODE (decl) == VAR_DECL + && ! TREE_USED (decl) + && ! DECL_IN_SYSTEM_HEADER (decl) + && DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl)) + warning (OPT_Wunused_variable, "unused variable %q+D", decl); + /* Remove declarations for all the DECLs in this level. */ for (link = decls; link; link = TREE_CHAIN (link)) { if (leaving_for_scope && TREE_CODE (link) == VAR_DECL - && DECL_NAME (link)) + && DECL_NAME (link)) { - cxx_binding *outer_binding - = IDENTIFIER_BINDING (DECL_NAME (link))->previous; + tree name = DECL_NAME (link); + cxx_binding *ob; tree ns_binding; - if (!outer_binding) - ns_binding = IDENTIFIER_NAMESPACE_VALUE (DECL_NAME (link)); + ob = outer_binding (name, + IDENTIFIER_BINDING (name), + /*class_p=*/true); + if (!ob) + ns_binding = IDENTIFIER_NAMESPACE_VALUE (name); else ns_binding = NULL_TREE; - if (outer_binding - && outer_binding->scope == current_binding_level->level_chain) + if (ob && ob->scope == current_binding_level->level_chain) /* We have something like: - int i; - for (int i; ;); + int i; + for (int i; ;); and we are leaving the `for' scope. There's no reason to keep the binding of the inner `i' in this case. */ - pop_binding (DECL_NAME (link), link); - else if ((outer_binding - && (TREE_CODE (outer_binding->value) == TYPE_DECL)) + pop_binding (name, link); + else if ((ob && (TREE_CODE (ob->value) == TYPE_DECL)) || (ns_binding && TREE_CODE (ns_binding) == TYPE_DECL)) /* Here, we have something like: @@ -592,7 +648,7 @@ poplevel (int keep, int reverse, int functionbody) We must pop the for-scope binding so we know what's a type and what isn't. */ - pop_binding (DECL_NAME (link), link); + pop_binding (name, link); else { /* Mark this VAR_DECL as dead so that we can tell we left it @@ -601,8 +657,11 @@ poplevel (int keep, int reverse, int functionbody) /* Keep track of what should have happened when we popped the binding. */ - if (outer_binding && outer_binding->value) - DECL_SHADOWED_FOR_VAR (link) = outer_binding->value; + if (ob && ob->value) + { + SET_DECL_SHADOWED_FOR_VAR (link, ob->value); + DECL_HAS_SHADOWED_FOR_VAR_P (link) = 1; + } /* Add it to the list of dead variables in the next outermost binding to that we can remove these when we @@ -614,21 +673,26 @@ poplevel (int keep, int reverse, int functionbody) /* Although we don't pop the cxx_binding, we do clear its SCOPE since the scope is going away now. */ - IDENTIFIER_BINDING (DECL_NAME (link))->scope = NULL; + IDENTIFIER_BINDING (name)->scope + = current_binding_level->level_chain; } } else { + tree name; + /* Remove the binding. */ decl = link; + if (TREE_CODE (decl) == TREE_LIST) decl = TREE_VALUE (decl); - if (DECL_P (decl)) - pop_binding (DECL_NAME (decl), decl); - else if (TREE_CODE (decl) == OVERLOAD) - pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl); - else - abort (); + name = decl; + + if (TREE_CODE (name) == OVERLOAD) + name = OVL_FUNCTION (name); + + gcc_assert (DECL_P (name)); + pop_binding (DECL_NAME (name), decl); } } @@ -647,7 +711,7 @@ poplevel (int keep, int reverse, int functionbody) for (link = current_binding_level->shadowed_labels; link; link = TREE_CHAIN (link)) - pop_label (TREE_VALUE (link), TREE_PURPOSE (link)); + pop_local_label (TREE_VALUE (link), TREE_PURPOSE (link)); /* There may be OVERLOADs (wrapped in TREE_LISTs) on the BLOCK_VARs list if a `using' declaration put them there. The debugging @@ -680,6 +744,17 @@ poplevel (int keep, int reverse, int functionbody) } kind = current_binding_level->kind; + if (kind == sk_cleanup) + { + tree stmt; + + /* If this is a temporary binding created for a cleanup, then we'll + have pushed a statement list level. Pop that, create a new + BIND_EXPR for the block, and insert it into the stream. */ + stmt = pop_stmt_list (current_binding_level->statement_list); + stmt = c_build_bind_expr (block, stmt); + add_stmt (stmt); + } leave_scope (); if (functionbody) @@ -703,48 +778,13 @@ poplevel (int keep, int reverse, int functionbody) if (block) TREE_USED (block) = 1; - /* Take care of compiler's internal binding structures. */ + /* All temporary bindings created for cleanups are popped silently. */ if (kind == sk_cleanup) - { - tree scope_stmts; - - scope_stmts - = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/1); - if (block) - { - SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmts)) = block; - SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmts)) = block; - } - - block = poplevel (keep, reverse, functionbody); - } + goto restart; POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, block); } -/* Delete the node BLOCK from the current binding level. - This is used for the block inside a stmt expr ({...}) - so that the block can be reinserted where appropriate. */ - -void -delete_block (tree block) -{ - tree t; - if (current_binding_level->blocks == block) - current_binding_level->blocks = TREE_CHAIN (block); - for (t = current_binding_level->blocks; t;) - { - if (TREE_CHAIN (t) == block) - TREE_CHAIN (t) = TREE_CHAIN (block); - else - t = TREE_CHAIN (t); - } - TREE_CHAIN (block) = NULL_TREE; - /* Clear TREE_USED which is always set by poplevel. - The flag is set again if insert_block is called. */ - TREE_USED (block) = 0; -} - /* Insert BLOCK at the end of the list of subblocks of the current binding level. This is used when a BIND_EXPR is expanded, to handle the BLOCK node inside the BIND_EXPR. */ @@ -757,74 +797,6 @@ insert_block (tree block) = chainon (current_binding_level->blocks, block); } -/* Set the BLOCK node for the innermost scope - (the one we are currently in). */ - -void -set_block (tree block ATTRIBUTE_UNUSED ) -{ - /* The RTL expansion machinery requires us to provide this callback, - but it is not applicable in function-at-a-time mode. */ -} - -/* Returns nonzero if T is a virtual function table. */ - -int -vtable_decl_p (tree t, void* data ATTRIBUTE_UNUSED ) -{ - return (TREE_CODE (t) == VAR_DECL && DECL_VIRTUAL_P (t)); -} - -/* Returns nonzero if T is a TYPE_DECL for a type with virtual - functions. */ - -int -vtype_decl_p (tree t, void *data ATTRIBUTE_UNUSED ) -{ - return (TREE_CODE (t) == TYPE_DECL - && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE - && TYPE_POLYMORPHIC_P (TREE_TYPE (t))); -} - -struct walk_globals_data { - walk_globals_pred p; - walk_globals_fn f; - void *data; -}; - -/* Walk the vtable declarations in NAMESPACE. Whenever one is found - for which P returns nonzero, call F with its address. If any call - to F returns a nonzero value, return a nonzero value. */ - -static int -walk_vtables_r (tree namespace, void* data) -{ - struct walk_globals_data* wgd = (struct walk_globals_data *) data; - walk_globals_fn f = wgd->f; - void *d = wgd->data; - tree decl = NAMESPACE_LEVEL (namespace)->vtables; - int result = 0; - - for (; decl ; decl = TREE_CHAIN (decl)) - result |= (*f) (&decl, d); - - return result; -} - -/* Walk the vtable declarations. Whenever one is found for which P - returns nonzero, call F with its address. If any call to F - returns a nonzero value, return a nonzero value. */ -bool -walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data) -{ - struct walk_globals_data wgd; - wgd.p = p; - wgd.f = f; - wgd.data = data; - - return walk_namespaces (walk_vtables_r, &wgd); -} - /* Walk all the namespaces contained NAMESPACE, including NAMESPACE itself, calling F for each. The DATA is passed to F as well. */ @@ -832,7 +804,7 @@ static int walk_namespaces_r (tree namespace, walk_namespaces_fn f, void* data) { int result = 0; - tree current = NAMESPACE_LEVEL (namespace)->namespaces; + tree current = NAMESPACE_LEVEL (namespace)->namespaces; result |= (*f) (namespace, data); @@ -851,53 +823,6 @@ walk_namespaces (walk_namespaces_fn f, void* data) return walk_namespaces_r (global_namespace, f, data); } -/* Walk the global declarations in NAMESPACE. Whenever one is found - for which P returns nonzero, call F with its address. If any call - to F returns a nonzero value, return a nonzero value. */ - -static int -walk_globals_r (tree namespace, void* data) -{ - struct walk_globals_data* wgd = (struct walk_globals_data *) data; - walk_globals_pred p = wgd->p; - walk_globals_fn f = wgd->f; - void *d = wgd->data; - tree *t; - int result = 0; - - t = &NAMESPACE_LEVEL (namespace)->names; - - while (*t) - { - tree glbl = *t; - - if ((*p) (glbl, d)) - result |= (*f) (t, d); - - /* If F changed *T, then *T still points at the next item to - examine. */ - if (*t == glbl) - t = &TREE_CHAIN (*t); - } - - return result; -} - -/* Walk the global declarations. Whenever one is found for which P - returns true, call F with its address. If any call to F - returns true, return true. */ - -bool -walk_globals (walk_globals_pred p, walk_globals_fn f, void *data) -{ - struct walk_globals_data wgd; - wgd.p = p; - wgd.f = f; - wgd.data = data; - - return walk_namespaces (walk_globals_r, &wgd); -} - /* Call wrapup_globals_declarations for the globals in NAMESPACE. If DATA is non-NULL, this is the last time we will call wrapup_global_declarations for this NAMESPACE. */ @@ -906,14 +831,15 @@ int wrapup_globals_for_namespace (tree namespace, void* data) { struct cp_binding_level *level = NAMESPACE_LEVEL (namespace); - varray_type statics = level->static_decls; - tree *vec = &VARRAY_TREE (statics, 0); - int len = VARRAY_ACTIVE_SIZE (statics); + VEC(tree,gc) *statics = level->static_decls; + tree *vec = VEC_address (tree, statics); + int len = VEC_length (tree, statics); int last_time = (data != 0); if (last_time) { check_global_declarations (vec, len); + emit_debug_global_declarations (vec, len); return 0; } @@ -952,15 +878,13 @@ push_local_name (tree decl) tree t, name; timevar_push (TV_NAME_LOOKUP); - if (!local_names) - VARRAY_TREE_INIT (local_names, 8, "local_names"); name = DECL_NAME (decl); - nelts = VARRAY_ACTIVE_SIZE (local_names); + nelts = VEC_length (tree, local_names); for (i = 0; i < nelts; i++) { - t = VARRAY_TREE (local_names, i); + t = VEC_index (tree, local_names, i); if (DECL_NAME (t) == name) { if (!DECL_LANG_SPECIFIC (decl)) @@ -971,13 +895,13 @@ push_local_name (tree decl) else DECL_DISCRIMINATOR (decl) = 1; - VARRAY_TREE (local_names, i) = decl; + VEC_replace (tree, local_names, i, decl); timevar_pop (TV_NAME_LOOKUP); return; } } - VARRAY_PUSH_TREE (local_names, decl); + VEC_safe_push (tree, gc, local_names, decl); timevar_pop (TV_NAME_LOOKUP); } @@ -1014,15 +938,15 @@ decls_match (tree newdecl, tree olddecl) return 0; if (TREE_CODE (f1) != TREE_CODE (f2)) - return 0; + return 0; if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2))) { if (p2 == NULL_TREE && DECL_EXTERN_C_P (olddecl) && (DECL_BUILT_IN (olddecl) #ifndef NO_IMPLICIT_EXTERN_C - || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) - || (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) + || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) + || (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) #endif )) { @@ -1033,11 +957,11 @@ decls_match (tree newdecl, tree olddecl) #ifndef NO_IMPLICIT_EXTERN_C else if (p1 == NULL_TREE && (DECL_EXTERN_C_P (olddecl) - && DECL_IN_SYSTEM_HEADER (olddecl) - && !DECL_CLASS_SCOPE_P (olddecl)) + && DECL_IN_SYSTEM_HEADER (olddecl) + && !DECL_CLASS_SCOPE_P (olddecl)) && (DECL_EXTERN_C_P (newdecl) - && DECL_IN_SYSTEM_HEADER (newdecl) - && !DECL_CLASS_SCOPE_P (newdecl))) + && DECL_IN_SYSTEM_HEADER (newdecl) + && !DECL_CLASS_SCOPE_P (newdecl))) { types_match = self_promoting_args_p (p2); TREE_TYPE (newdecl) = TREE_TYPE (olddecl); @@ -1071,7 +995,13 @@ decls_match (tree newdecl, tree olddecl) /* Need to check scope for variable declaration (VAR_DECL). For typedef (TYPE_DECL), scope is ignored. */ if (TREE_CODE (newdecl) == VAR_DECL - && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl)) + && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl) + /* [dcl.link] + Two declarations for an object with C language linkage + with the same name (ignoring the namespace that qualify + it) that appear in different namespace scopes refer to + the same object. */ + && !(DECL_EXTERN_C_P (olddecl) && DECL_EXTERN_C_P (newdecl))) return 0; if (TREE_TYPE (newdecl) == error_mark_node) @@ -1101,11 +1031,6 @@ decls_match (tree newdecl, tree olddecl) void warn_extern_redeclared_static (tree newdecl, tree olddecl) { - static const char *const explicit_extern_static_warning - = "`%D' was declared `extern' and later `static'"; - static const char *const implicit_extern_static_warning - = "`%D' was declared implicitly `extern' and later `static'"; - tree name; if (TREE_CODE (newdecl) == TYPE_DECL @@ -1131,10 +1056,43 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl) return; name = DECL_ASSEMBLER_NAME (newdecl); - pedwarn (IDENTIFIER_IMPLICIT_DECL (name) - ? implicit_extern_static_warning - : explicit_extern_static_warning, newdecl); - cp_pedwarn_at ("previous declaration of `%D'", olddecl); + pedwarn ("%qD was declared % and later %", newdecl); + pedwarn ("previous declaration of %q+D", olddecl); +} + +/* NEW_DECL is a redeclaration of OLD_DECL; both are functions or + function templates. If their exception specifications do not + match, issue an a diagnostic. */ + +static void +check_redeclaration_exception_specification (tree new_decl, + tree old_decl) +{ + tree new_type; + tree old_type; + tree new_exceptions; + tree old_exceptions; + + new_type = TREE_TYPE (new_decl); + new_exceptions = TYPE_RAISES_EXCEPTIONS (new_type); + old_type = TREE_TYPE (old_decl); + old_exceptions = TYPE_RAISES_EXCEPTIONS (old_type); + + /* [except.spec] + + If any declaration of a function has an exception-specification, + all declarations, including the definition and an explicit + specialization, of that function shall have an + exception-specification with the same set of type-ids. */ + if ((pedantic || ! DECL_IN_SYSTEM_HEADER (old_decl)) + && ! DECL_IS_BUILTIN (old_decl) + && flag_exceptions + && !comp_except_specs (new_exceptions, old_exceptions, + /*exact=*/true)) + { + error ("declaration of %qF throws different exceptions", new_decl); + error ("from previous declaration %q+F", old_decl); + } } /* If NEWDECL is a redeclaration of OLDDECL, merge the declarations. @@ -1142,14 +1100,17 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl) error_mark_node is returned. Otherwise, OLDDECL is returned. If NEWDECL is not a redeclaration of OLDDECL, NULL_TREE is - returned. */ + returned. + + NEWDECL_IS_FRIEND is true if NEWDECL was declared as a friend. */ tree -duplicate_decls (tree newdecl, tree olddecl) +duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) { unsigned olddecl_uid = DECL_UID (olddecl); - int olddecl_friend = 0, types_match = 0; + int olddecl_friend = 0, types_match = 0, hidden_friend = 0; int new_defines_function = 0; + tree new_template; if (newdecl == olddecl) return olddecl; @@ -1163,7 +1124,7 @@ duplicate_decls (tree newdecl, tree olddecl) about the same declaration, so just pretend the types match here. */ if (TREE_TYPE (newdecl) == error_mark_node || TREE_TYPE (olddecl) == error_mark_node) - types_match = 1; + return error_mark_node; if (DECL_P (olddecl) && TREE_CODE (newdecl) == FUNCTION_DECL @@ -1182,18 +1143,19 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_UNINLINABLE (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning ("%Jfunction '%D' redeclared as inline", newdecl, newdecl); - warning ("%Jprevious declaration of '%D' with attribute noinline", - olddecl, olddecl); + warning (OPT_Wattributes, "function %q+D redeclared as inline", + newdecl); + warning (OPT_Wattributes, "previous declaration of %q+D " + "with attribute noinline", olddecl); } else if (DECL_DECLARED_INLINE_P (olddecl) && DECL_UNINLINABLE (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning ("%Jfunction '%D' redeclared with attribute noinline", - newdecl, newdecl); - warning ("%Jprevious declaration of '%D' was inline", - olddecl, olddecl); + warning (OPT_Wattributes, "function %q+D redeclared with " + "attribute noinline", newdecl); + warning (OPT_Wattributes, "previous declaration of %q+D was inline", + olddecl); } } @@ -1201,42 +1163,78 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_ARTIFICIAL (olddecl)) { + gcc_assert (!DECL_HIDDEN_FRIEND_P (olddecl)); if (TREE_CODE (newdecl) != FUNCTION_DECL) { - /* Avoid warnings redeclaring anticipated built-ins. */ - if (DECL_ANTICIPATED (olddecl)) - return NULL_TREE; + /* Avoid warnings redeclaring built-ins which have not been + explicitly declared. */ + if (DECL_ANTICIPATED (olddecl)) + return NULL_TREE; /* If you declare a built-in or predefined function name as static, the old definition is overridden, but optionally warn this was a bad choice of name. */ if (! TREE_PUBLIC (newdecl)) { - if (warn_shadow) - warning ("shadowing %s function `%#D'", - DECL_BUILT_IN (olddecl) ? "built-in" : "library", - olddecl); + warning (OPT_Wshadow, "shadowing %s function %q#D", + DECL_BUILT_IN (olddecl) ? "built-in" : "library", + olddecl); /* Discard the old built-in function. */ return NULL_TREE; } /* If the built-in is not ansi, then programs can override it even globally without an error. */ else if (! DECL_BUILT_IN (olddecl)) - warning ("library function `%#D' redeclared as non-function `%#D'", - olddecl, newdecl); + warning (0, "library function %q#D redeclared as non-function %q#D", + olddecl, newdecl); else { - error ("declaration of `%#D'", newdecl); - error ("conflicts with built-in declaration `%#D'", - olddecl); + error ("declaration of %q#D", newdecl); + error ("conflicts with built-in declaration %q#D", + olddecl); } return NULL_TREE; } else if (!types_match) { - /* Avoid warnings redeclaring anticipated built-ins. */ - if (DECL_ANTICIPATED (olddecl)) - ; /* Do nothing yet. */ + /* Avoid warnings redeclaring built-ins which have not been + explicitly declared. */ + if (DECL_ANTICIPATED (olddecl)) + { + /* Deal with fileptr_type_node. FILE type is not known + at the time we create the builtins. */ + tree t1, t2; + + for (t1 = TYPE_ARG_TYPES (TREE_TYPE (newdecl)), + t2 = TYPE_ARG_TYPES (TREE_TYPE (olddecl)); + t1 || t2; + t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2)) + if (!t1 || !t2) + break; + else if (TREE_VALUE (t2) == fileptr_type_node) + { + tree t = TREE_VALUE (t1); + + if (TREE_CODE (t) == POINTER_TYPE + && TYPE_NAME (TREE_TYPE (t)) + && DECL_NAME (TYPE_NAME (TREE_TYPE (t))) + == get_identifier ("FILE") + && compparms (TREE_CHAIN (t1), TREE_CHAIN (t2))) + { + tree oldargs = TYPE_ARG_TYPES (TREE_TYPE (olddecl)); + + TYPE_ARG_TYPES (TREE_TYPE (olddecl)) + = TYPE_ARG_TYPES (TREE_TYPE (newdecl)); + types_match = decls_match (newdecl, olddecl); + if (types_match) + return duplicate_decls (newdecl, olddecl, + newdecl_is_friend); + TYPE_ARG_TYPES (TREE_TYPE (olddecl)) = oldargs; + } + } + else if (! same_type_p (TREE_VALUE (t1), TREE_VALUE (t2))) + break; + } else if ((DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl)) || compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)), @@ -1246,24 +1244,25 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_PUBLIC (newdecl)) { - warning ("new declaration `%#D'", newdecl); - warning ("ambiguates built-in declaration `%#D'", - olddecl); + warning (0, "new declaration %q#D", newdecl); + warning (0, "ambiguates built-in declaration %q#D", + olddecl); } - else if (warn_shadow) - warning ("shadowing %s function `%#D'", - DECL_BUILT_IN (olddecl) ? "built-in" : "library", - olddecl); + else + warning (OPT_Wshadow, "shadowing %s function %q#D", + DECL_BUILT_IN (olddecl) ? "built-in" : "library", + olddecl); } else /* Discard the old built-in function. */ return NULL_TREE; /* Replace the old RTL to avoid problems with inlining. */ - SET_DECL_RTL (olddecl, DECL_RTL (newdecl)); + COPY_DECL_RTL (newdecl, olddecl); } - /* Even if the types match, prefer the new declarations type - for anticipated built-ins, for exception lists, etc... */ + /* Even if the types match, prefer the new declarations type for + built-ins which have not been explicitly declared, for + exception lists, etc... */ else if (DECL_ANTICIPATED (olddecl)) { tree type = TREE_TYPE (newdecl); @@ -1289,7 +1288,7 @@ duplicate_decls (tree newdecl, tree olddecl) that all remnants of the builtin-ness of this function will be banished. */ SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl)); - SET_DECL_RTL (olddecl, DECL_RTL (newdecl)); + COPY_DECL_RTL (newdecl, olddecl); } } else if (TREE_CODE (olddecl) != TREE_CODE (newdecl)) @@ -1318,15 +1317,12 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_FUNCTION_TEMPLATE_P (newdecl))) return NULL_TREE; - error ("`%#D' redeclared as different kind of symbol", newdecl); + error ("%q#D redeclared as different kind of symbol", newdecl); if (TREE_CODE (olddecl) == TREE_LIST) olddecl = TREE_VALUE (olddecl); - cp_error_at ("previous declaration of `%#D'", olddecl); + error ("previous declaration of %q+#D", olddecl); - /* New decl is completely inconsistent with the old one => - tell caller to replace the old one. */ - - return NULL_TREE; + return error_mark_node; } else if (!types_match) { @@ -1343,9 +1339,8 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == TYPE_DECL || TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL) { - error ("declaration of template `%#D'", newdecl); - cp_error_at ("conflicts with previous declaration `%#D'", - olddecl); + error ("declaration of template %q#D", newdecl); + error ("conflicts with previous declaration %q+#D", olddecl); } else if (TREE_CODE (DECL_TEMPLATE_RESULT (olddecl)) == FUNCTION_DECL && TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == FUNCTION_DECL @@ -1358,8 +1353,8 @@ duplicate_decls (tree newdecl, tree olddecl) && same_type_p (TREE_TYPE (TREE_TYPE (newdecl)), TREE_TYPE (TREE_TYPE (olddecl)))) { - error ("new declaration `%#D'", newdecl); - cp_error_at ("ambiguates old declaration `%#D'", olddecl); + error ("new declaration %q#D", newdecl); + error ("ambiguates old declaration %q+#D", olddecl); } return NULL_TREE; } @@ -1367,25 +1362,25 @@ duplicate_decls (tree newdecl, tree olddecl) { if (DECL_EXTERN_C_P (newdecl) && DECL_EXTERN_C_P (olddecl)) { - error ("declaration of C function `%#D' conflicts with", - newdecl); - cp_error_at ("previous declaration `%#D' here", olddecl); + error ("declaration of C function %q#D conflicts with", + newdecl); + error ("previous declaration %q+#D here", olddecl); } else if (compparms (TYPE_ARG_TYPES (TREE_TYPE (newdecl)), TYPE_ARG_TYPES (TREE_TYPE (olddecl)))) { - error ("new declaration `%#D'", newdecl); - cp_error_at ("ambiguates old declaration `%#D'", olddecl); + error ("new declaration %q#D", newdecl); + error ("ambiguates old declaration %q+#D", olddecl); + return error_mark_node; } else return NULL_TREE; } else { - error ("conflicting declaration '%#D'", newdecl); - cp_error_at ("'%D' has a previous declaration as `%#D'", - olddecl, olddecl); - return NULL_TREE; + error ("conflicting declaration %q#D", newdecl); + error ("%q+D has a previous declaration as %q#D", olddecl, olddecl); + return error_mark_node; } } else if (TREE_CODE (newdecl) == FUNCTION_DECL @@ -1417,27 +1412,27 @@ duplicate_decls (tree newdecl, tree olddecl) else if (TREE_CODE (newdecl) == NAMESPACE_DECL) { /* In [namespace.alias] we have: - - In a declarative region, a namespace-alias-definition can be + + In a declarative region, a namespace-alias-definition can be used to redefine a namespace-alias declared in that declarative region to refer only to the namespace to which it already refers. - + Therefore, if we encounter a second alias directive for the same alias, we can just ignore the second directive. */ if (DECL_NAMESPACE_ALIAS (newdecl) - && (DECL_NAMESPACE_ALIAS (newdecl) + && (DECL_NAMESPACE_ALIAS (newdecl) == DECL_NAMESPACE_ALIAS (olddecl))) return olddecl; /* [namespace.alias] - A namespace-name or namespace-alias shall not be declared as + A namespace-name or namespace-alias shall not be declared as the name of any other entity in the same declarative region. A namespace-name defined at global scope shall not be - declared as the name of any other entity in any glogal scope + declared as the name of any other entity in any global scope of the program. */ - error ("declaration of `namespace %D' conflicts with", newdecl); - cp_error_at ("previous declaration of `namespace %D' here", olddecl); + error ("declaration of namespace %qD conflicts with", newdecl); + error ("previous declaration of namespace %q+D here", olddecl); return error_mark_node; } else @@ -1447,10 +1442,9 @@ duplicate_decls (tree newdecl, tree olddecl) { error (errmsg, newdecl); if (DECL_NAME (olddecl) != NULL_TREE) - cp_error_at ((DECL_INITIAL (olddecl) - && namespace_bindings_p ()) - ? "`%#D' previously defined here" - : "`%#D' previously declared here", olddecl); + error ((DECL_INITIAL (olddecl) && namespace_bindings_p ()) + ? "%q+#D previously defined here" + : "%q+#D previously declared here", olddecl); return error_mark_node; } else if (TREE_CODE (olddecl) == FUNCTION_DECL @@ -1459,23 +1453,51 @@ duplicate_decls (tree newdecl, tree olddecl) && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != NULL_TREE) { /* Prototype decl follows defn w/o prototype. */ - cp_warning_at ("prototype for `%#D'", newdecl); - warning ("%Jfollows non-prototype definition here", olddecl); + warning (0, "prototype for %q+#D", newdecl); + warning (0, "%Jfollows non-prototype definition here", olddecl); } - else if (TREE_CODE (olddecl) == FUNCTION_DECL + else if ((TREE_CODE (olddecl) == FUNCTION_DECL + || TREE_CODE (olddecl) == VAR_DECL) && DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl)) { - /* extern "C" int foo (); - int foo () { bar (); } - is OK. */ + /* [dcl.link] + If two declarations of the same function or object + specify different linkage-specifications ..., the program + is ill-formed.... Except for functions with C++ linkage, + a function declaration without a linkage specification + shall not precede the first linkage specification for + that function. A function can be declared without a + linkage specification after an explicit linkage + specification has been seen; the linkage explicitly + specified in the earlier declaration is not affected by + such a function declaration. + + DR 563 raises the question why the restrictions on + functions should not also apply to objects. Older + versions of G++ silently ignore the linkage-specification + for this example: + + namespace N { + extern int i; + extern "C" int i; + } + + which is clearly wrong. Therefore, we now treat objects + like functions. */ if (current_lang_depth () == 0) - SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); + { + /* There is no explicit linkage-specification, so we use + the linkage from the previous declaration. */ + if (!DECL_LANG_SPECIFIC (newdecl)) + retrofit_lang_decl (newdecl); + SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); + } else { - cp_error_at ("previous declaration of `%#D' with %L linkage", - olddecl, DECL_LANGUAGE (olddecl)); - error ("conflicts with new declaration with %L linkage", - DECL_LANGUAGE (newdecl)); + error ("previous declaration of %q+#D with %qL linkage", + olddecl, DECL_LANGUAGE (olddecl)); + error ("conflicts with new declaration with %qL linkage", + DECL_LANGUAGE (newdecl)); } } @@ -1497,26 +1519,25 @@ duplicate_decls (tree newdecl, tree olddecl) if (1 == simple_cst_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2))) { - pedwarn ("default argument given for parameter %d of `%#D'", + pedwarn ("default argument given for parameter %d of %q#D", i, newdecl); - cp_pedwarn_at ("after previous specification in `%#D'", - olddecl); + pedwarn ("after previous specification in %q+#D", olddecl); } else { - error ("default argument given for parameter %d of `%#D'", - i, newdecl); - cp_error_at ("after previous specification in `%#D'", + error ("default argument given for parameter %d of %q#D", + i, newdecl); + error ("after previous specification in %q+#D", olddecl); } } - if (DECL_DECLARED_INLINE_P (newdecl) + if (DECL_DECLARED_INLINE_P (newdecl) && ! DECL_DECLARED_INLINE_P (olddecl) && TREE_ADDRESSABLE (olddecl) && warn_inline) { - warning ("`%#D' was used before it was declared inline", newdecl); - warning ("%Jprevious non-inline declaration here", olddecl); + warning (0, "%q#D was used before it was declared inline", newdecl); + warning (0, "%Jprevious non-inline declaration here", olddecl); } } } @@ -1552,7 +1573,6 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl); DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl); DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl); - DECL_NEEDS_FINAL_OVERRIDER_P (newdecl) |= DECL_NEEDS_FINAL_OVERRIDER_P (olddecl); DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl); if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK) SET_OVERLOADED_OPERATOR_CODE @@ -1560,17 +1580,17 @@ duplicate_decls (tree newdecl, tree olddecl) new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE; /* Optionally warn about more than one declaration for the same - name, but don't warn about a function declaration followed by a - definition. */ + name, but don't warn about a function declaration followed by a + definition. */ if (warn_redundant_decls && ! DECL_ARTIFICIAL (olddecl) && !(new_defines_function && DECL_INITIAL (olddecl) == NULL_TREE) /* Don't warn about extern decl followed by definition. */ && !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl)) /* Don't warn about friends, let add_friend take care of it. */ - && ! (DECL_FRIEND_P (newdecl) || DECL_FRIEND_P (olddecl))) + && ! (newdecl_is_friend || DECL_FRIEND_P (olddecl))) { - warning ("redundant redeclaration of `%D' in same scope", newdecl); - cp_warning_at ("previous declaration of `%D'", olddecl); + warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl); + warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl); } } @@ -1595,30 +1615,35 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_CODE (newdecl) == TEMPLATE_DECL) { - TREE_TYPE (olddecl) = TREE_TYPE (DECL_TEMPLATE_RESULT (olddecl)); + tree old_result; + tree new_result; + old_result = DECL_TEMPLATE_RESULT (olddecl); + new_result = DECL_TEMPLATE_RESULT (newdecl); + TREE_TYPE (olddecl) = TREE_TYPE (old_result); DECL_TEMPLATE_SPECIALIZATIONS (olddecl) = chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl), DECL_TEMPLATE_SPECIALIZATIONS (newdecl)); - /* If the new declaration is a definition, update the file and - line information on the declaration. */ - if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE - && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE) - { - DECL_SOURCE_LOCATION (olddecl) - = DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (olddecl)) - = DECL_SOURCE_LOCATION (newdecl); - if (DECL_FUNCTION_TEMPLATE_P (newdecl)) - DECL_ARGUMENTS (DECL_TEMPLATE_RESULT (olddecl)) - = DECL_ARGUMENTS (DECL_TEMPLATE_RESULT (newdecl)); - } - if (DECL_FUNCTION_TEMPLATE_P (newdecl)) { - DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl)) - |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl)); - DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl)) - |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl)); + DECL_INLINE (old_result) + |= DECL_INLINE (new_result); + DECL_DECLARED_INLINE_P (old_result) + |= DECL_DECLARED_INLINE_P (new_result); + check_redeclaration_exception_specification (newdecl, olddecl); + } + + /* If the new declaration is a definition, update the file and + line information on the declaration. */ + if (DECL_INITIAL (old_result) == NULL_TREE + && DECL_INITIAL (new_result) != NULL_TREE) + { + DECL_SOURCE_LOCATION (olddecl) + = DECL_SOURCE_LOCATION (old_result) + = DECL_SOURCE_LOCATION (newdecl); + if (DECL_FUNCTION_TEMPLATE_P (newdecl)) + DECL_ARGUMENTS (old_result) + = DECL_ARGUMENTS (new_result); } return olddecl; @@ -1642,34 +1667,33 @@ duplicate_decls (tree newdecl, tree olddecl) { DECL_THIS_EXTERN (newdecl) |= DECL_THIS_EXTERN (olddecl); DECL_INITIALIZED_P (newdecl) |= DECL_INITIALIZED_P (olddecl); + DECL_NONTRIVIALLY_INITIALIZED_P (newdecl) + |= DECL_NONTRIVIALLY_INITIALIZED_P (olddecl); DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (newdecl) |= DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (olddecl); + + /* Merge the threadprivate attribute from OLDDECL into NEWDECL. */ + if (DECL_LANG_SPECIFIC (olddecl) + && CP_DECL_THREADPRIVATE_P (olddecl)) + { + /* Allocate a LANG_SPECIFIC structure for NEWDECL, if needed. */ + if (!DECL_LANG_SPECIFIC (newdecl)) + retrofit_lang_decl (newdecl); + + DECL_TLS_MODEL (newdecl) = DECL_TLS_MODEL (olddecl); + CP_DECL_THREADPRIVATE_P (newdecl) = 1; + } } /* Do this after calling `merge_types' so that default parameters don't confuse us. */ - else if (TREE_CODE (newdecl) == FUNCTION_DECL - && (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)) - != TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)))) - { - TREE_TYPE (newdecl) = build_exception_variant (newtype, - TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl))); - TREE_TYPE (olddecl) = build_exception_variant (newtype, - TYPE_RAISES_EXCEPTIONS (oldtype)); - - if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl)) - && DECL_SOURCE_LINE (olddecl) != 0 - && flag_exceptions - && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (newdecl)), - TYPE_RAISES_EXCEPTIONS (TREE_TYPE (olddecl)), 1)) - { - error ("declaration of `%F' throws different exceptions", - newdecl); - cp_error_at ("than previous declaration `%F'", olddecl); - } - } + else if (TREE_CODE (newdecl) == FUNCTION_DECL) + check_redeclaration_exception_specification (newdecl, olddecl); TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = newtype; + if (TREE_CODE (newdecl) == FUNCTION_DECL) + check_default_args (newdecl); + /* Lay the type out, unless already done. */ if (! same_type_p (newtype, oldtype) && TREE_TYPE (newdecl) != error_mark_node @@ -1689,6 +1713,12 @@ duplicate_decls (tree newdecl, tree olddecl) TREE_READONLY (olddecl) = 1; if (TREE_THIS_VOLATILE (newdecl)) TREE_THIS_VOLATILE (olddecl) = 1; + if (TREE_NOTHROW (newdecl)) + TREE_NOTHROW (olddecl) = 1; + + /* Merge deprecatedness. */ + if (TREE_DEPRECATED (newdecl)) + TREE_DEPRECATED (olddecl) = 1; /* Merge the initialization information. */ if (DECL_INITIAL (newdecl) == NULL_TREE @@ -1701,12 +1731,12 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_LANG_SPECIFIC (olddecl)) { DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl); - DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl); + DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl); } } /* Merge the section attribute. - We want to issue an error if the sections conflict but that must be + We want to issue an error if the sections conflict but that must be done later in decl_attributes since we are called before attributes are assigned. */ if (DECL_SECTION_NAME (newdecl) == NULL_TREE) @@ -1725,7 +1755,7 @@ duplicate_decls (tree newdecl, tree olddecl) /* Keep the old RTL. */ COPY_DECL_RTL (olddecl, newdecl); } - else if (TREE_CODE (newdecl) == VAR_DECL + else if (TREE_CODE (newdecl) == VAR_DECL && (DECL_SIZE (olddecl) || !DECL_SIZE (newdecl))) { /* Keep the old RTL. We cannot keep the old RTL if the old @@ -1760,6 +1790,7 @@ duplicate_decls (tree newdecl, tree olddecl) if (! DECL_EXTERNAL (olddecl)) DECL_EXTERNAL (newdecl) = 0; + new_template = NULL_TREE; if (DECL_LANG_SPECIFIC (newdecl) && DECL_LANG_SPECIFIC (olddecl)) { DECL_INTERFACE_KNOWN (newdecl) |= DECL_INTERFACE_KNOWN (olddecl); @@ -1767,16 +1798,30 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_COMDAT (newdecl) |= DECL_COMDAT (olddecl); DECL_TEMPLATE_INSTANTIATED (newdecl) |= DECL_TEMPLATE_INSTANTIATED (olddecl); + + /* If the OLDDECL is an instantiation and/or specialization, + then the NEWDECL must be too. But, it may not yet be marked + as such if the caller has created NEWDECL, but has not yet + figured out that it is a redeclaration. */ + if (!DECL_USE_TEMPLATE (newdecl)) + DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl); + /* Don't really know how much of the language-specific values we should copy from old to new. */ DECL_IN_AGGR_P (newdecl) = DECL_IN_AGGR_P (olddecl); - DECL_LANG_SPECIFIC (newdecl)->decl_flags.u2 = + DECL_LANG_SPECIFIC (newdecl)->decl_flags.u2 = DECL_LANG_SPECIFIC (olddecl)->decl_flags.u2; DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl); + DECL_REPO_AVAILABLE_P (newdecl) = DECL_REPO_AVAILABLE_P (olddecl); + if (DECL_TEMPLATE_INFO (newdecl)) + new_template = DECL_TI_TEMPLATE (newdecl); DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl); DECL_INITIALIZED_IN_CLASS_P (newdecl) - |= DECL_INITIALIZED_IN_CLASS_P (olddecl); + |= DECL_INITIALIZED_IN_CLASS_P (olddecl); olddecl_friend = DECL_FRIEND_P (olddecl); + hidden_friend = (DECL_ANTICIPATED (olddecl) + && DECL_HIDDEN_FRIEND_P (olddecl) + && newdecl_is_friend); /* Only functions have DECL_BEFRIENDING_CLASSES. */ if (TREE_CODE (newdecl) == FUNCTION_DECL @@ -1800,8 +1845,7 @@ duplicate_decls (tree newdecl, tree olddecl) /* If newdecl is not a specialization, then it is not a template-related function at all. And that means that we should have exited above, returning 0. */ - my_friendly_assert (DECL_TEMPLATE_SPECIALIZATION (newdecl), - 0); + gcc_assert (DECL_TEMPLATE_SPECIALIZATION (newdecl)); if (TREE_USED (olddecl)) /* From [temp.expl.spec]: @@ -1812,11 +1856,16 @@ duplicate_decls (tree newdecl, tree olddecl) that specialization that would cause an implicit instantiation to take place, in every translation unit in which such a use occurs. */ - error ("explicit specialization of %D after first use", + error ("explicit specialization of %qD after first use", olddecl); SET_DECL_TEMPLATE_SPECIALIZATION (olddecl); + /* Don't propagate visibility from the template to the + specialization here. We'll do that in determine_visibility if + appropriate. */ + DECL_VISIBILITY_SPECIFIED (olddecl) = 0; + /* [temp.expl.spec/14] We don't inline explicit specialization just because the primary template says so. */ } @@ -1827,7 +1876,7 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl); - /* If either decl says `inline', this fn is inline, unless + /* If either decl says `inline', this fn is inline, unless its definition was passed already. */ if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE) DECL_INLINE (olddecl) = 1; @@ -1844,7 +1893,7 @@ duplicate_decls (tree newdecl, tree olddecl) { SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl)); COPY_DECL_ASSEMBLER_NAME (newdecl, olddecl); - SET_DECL_RTL (olddecl, DECL_RTL (newdecl)); + COPY_DECL_RTL (newdecl, olddecl); } if (! types_match || new_defines_function) { @@ -1868,7 +1917,7 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); /* If we're keeping the built-in definition, keep the rtl, regardless of declaration matches. */ - SET_DECL_RTL (newdecl, DECL_RTL (olddecl)); + COPY_DECL_RTL (olddecl, newdecl); } DECL_RESULT (newdecl) = DECL_RESULT (olddecl); @@ -1886,30 +1935,53 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_COMMON (newdecl) = DECL_COMMON (olddecl); COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl); - /* If either declaration has a nondefault visibility, use it. */ - if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT) + /* Warn about conflicting visibility specifications. */ + if (DECL_VISIBILITY_SPECIFIED (olddecl) + && DECL_VISIBILITY_SPECIFIED (newdecl) + && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) + { + warning (OPT_Wattributes, "%q+D: visibility attribute ignored " + "because it", newdecl); + warning (OPT_Wattributes, "%Jconflicts with previous " + "declaration here", olddecl); + } + /* Choose the declaration which specified visibility. */ + if (DECL_VISIBILITY_SPECIFIED (olddecl)) { - if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT - && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) - { - warning ("%J'%D': visibility attribute ignored because it", - newdecl, newdecl); - warning ("%Jconflicts with previous declaration here", olddecl); - } DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl); + DECL_VISIBILITY_SPECIFIED (newdecl) = 1; + } + /* Init priority used to be merged from newdecl to olddecl by the memcpy, + so keep this behavior. */ + if (TREE_CODE (newdecl) == VAR_DECL && DECL_HAS_INIT_PRIORITY_P (newdecl)) + { + SET_DECL_INIT_PRIORITY (olddecl, DECL_INIT_PRIORITY (newdecl)); + DECL_HAS_INIT_PRIORITY_P (olddecl) = 1; + } + + /* The DECL_LANG_SPECIFIC information in OLDDECL will be replaced + with that from NEWDECL below. */ + if (DECL_LANG_SPECIFIC (olddecl)) + { + gcc_assert (DECL_LANG_SPECIFIC (olddecl) + != DECL_LANG_SPECIFIC (newdecl)); + ggc_free (DECL_LANG_SPECIFIC (olddecl)); } if (TREE_CODE (newdecl) == FUNCTION_DECL) { int function_size; - function_size = sizeof (struct tree_decl); + function_size = sizeof (struct tree_decl_common); memcpy ((char *) olddecl + sizeof (struct tree_common), (char *) newdecl + sizeof (struct tree_common), function_size - sizeof (struct tree_common)); - if (DECL_TEMPLATE_INSTANTIATION (newdecl)) + memcpy ((char *) olddecl + sizeof (struct tree_decl_common), + (char *) newdecl + sizeof (struct tree_decl_common), + sizeof (struct tree_function_decl) - sizeof (struct tree_decl_common)); + if (new_template) /* If newdecl is a template instantiation, it is possible that the following sequence of events has occurred: @@ -1931,21 +2003,48 @@ duplicate_decls (tree newdecl, tree olddecl) olddecl, and not newdecl, is on the list of instantiations so that if we try to do the instantiation again we won't get the clobbered declaration. */ - reregister_specialization (newdecl, - DECL_TI_TEMPLATE (newdecl), + reregister_specialization (newdecl, + new_template, olddecl); } else { + size_t size = tree_code_size (TREE_CODE (olddecl)); memcpy ((char *) olddecl + sizeof (struct tree_common), (char *) newdecl + sizeof (struct tree_common), - sizeof (struct tree_decl) - sizeof (struct tree_common) - + TREE_CODE_LENGTH (TREE_CODE (newdecl)) * sizeof (char *)); + sizeof (struct tree_decl_common) - sizeof (struct tree_common)); + switch (TREE_CODE (olddecl)) + { + case LABEL_DECL: + case VAR_DECL: + case RESULT_DECL: + case PARM_DECL: + case FIELD_DECL: + case TYPE_DECL: + case CONST_DECL: + { + memcpy ((char *) olddecl + sizeof (struct tree_decl_common), + (char *) newdecl + sizeof (struct tree_decl_common), + size - sizeof (struct tree_decl_common) + + TREE_CODE_LENGTH (TREE_CODE (newdecl)) * sizeof (char *)); + } + break; + default: + memcpy ((char *) olddecl + sizeof (struct tree_decl_common), + (char *) newdecl + sizeof (struct tree_decl_common), + sizeof (struct tree_decl_non_common) - sizeof (struct tree_decl_common) + + TREE_CODE_LENGTH (TREE_CODE (newdecl)) * sizeof (char *)); + break; + } } - DECL_UID (olddecl) = olddecl_uid; if (olddecl_friend) DECL_FRIEND_P (olddecl) = 1; + if (hidden_friend) + { + DECL_ANTICIPATED (olddecl) = 1; + DECL_HIDDEN_FRIEND_P (olddecl) = 1; + } /* NEWDECL contains the merged attribute lists. Update OLDDECL to be the same. */ @@ -1954,48 +2053,20 @@ duplicate_decls (tree newdecl, tree olddecl) /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl so that encode_section_info has a chance to look at the new decl flags and attributes. */ - if (DECL_RTL_SET_P (olddecl) + if (DECL_RTL_SET_P (olddecl) && (TREE_CODE (olddecl) == FUNCTION_DECL || (TREE_CODE (olddecl) == VAR_DECL && TREE_STATIC (olddecl)))) - make_decl_rtl (olddecl, NULL); + make_decl_rtl (olddecl); + + /* The NEWDECL will no longer be needed. Because every out-of-class + declaration of a member results in a call to duplicate_decls, + freeing these nodes represents in a significant savings. */ + ggc_free (newdecl); return olddecl; } -/* Generate an implicit declaration for identifier FUNCTIONID - as a function of type int (). Print a warning if appropriate. */ - -tree -implicitly_declare (tree functionid) -{ - tree decl; - - /* We used to reuse an old implicit decl here, - but this loses with inline functions because it can clobber - the saved decl chains. */ - decl = build_lang_decl (FUNCTION_DECL, functionid, default_function_type); - - DECL_EXTERNAL (decl) = 1; - TREE_PUBLIC (decl) = 1; - - /* ISO standard says implicit declarations are in the innermost block. - So we record the decl in the standard fashion. */ - pushdecl (decl); - rest_of_decl_compilation (decl, NULL, 0, 0); - - if (warn_implicit - /* Only one warning per identifier. */ - && IDENTIFIER_IMPLICIT_DECL (functionid) == NULL_TREE) - { - pedwarn ("implicit declaration of function `%#D'", decl); - } - - SET_IDENTIFIER_IMPLICIT_DECL (functionid, decl); - - return decl; -} - /* Return zero if the declaration NEWDECL is valid when the declaration OLDDECL (assumed to be for the same name) has already been seen. @@ -2011,38 +2082,39 @@ redeclaration_error_message (tree newdecl, tree olddecl) constructs like "typedef struct foo { ... } foo" would look like an erroneous redeclaration. */ if (same_type_p (TREE_TYPE (newdecl), TREE_TYPE (olddecl))) - return 0; + return NULL; else - return "redefinition of `%#D'"; + return "redefinition of %q#D"; } else if (TREE_CODE (newdecl) == FUNCTION_DECL) { /* If this is a pure function, its olddecl will actually be the original initialization to `0' (which we force to call abort()). Don't complain about redefinition in this case. */ - if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl)) - return 0; + if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl) + && DECL_INITIAL (olddecl) == NULL_TREE) + return NULL; /* If both functions come from different namespaces, this is not a redeclaration - this is a conflict with a used function. */ if (DECL_NAMESPACE_SCOPE_P (olddecl) && DECL_CONTEXT (olddecl) != DECL_CONTEXT (newdecl) && ! decls_match (olddecl, newdecl)) - return "`%D' conflicts with used function"; + return "%qD conflicts with used function"; /* We'll complain about linkage mismatches in - warn_extern_redeclared_static. */ + warn_extern_redeclared_static. */ /* Defining the same name twice is no good. */ if (DECL_INITIAL (olddecl) != NULL_TREE && DECL_INITIAL (newdecl) != NULL_TREE) { if (DECL_NAME (olddecl) == NULL_TREE) - return "`%#D' not declared in class"; + return "%q#D not declared in class"; else - return "redefinition of `%#D'"; + return "redefinition of %q#D"; } - return 0; + return NULL; } else if (TREE_CODE (newdecl) == TEMPLATE_DECL) { @@ -2052,12 +2124,12 @@ redeclaration_error_message (tree newdecl, tree olddecl) { if (COMPLETE_TYPE_P (TREE_TYPE (newdecl)) && COMPLETE_TYPE_P (TREE_TYPE (olddecl))) - return "redefinition of `%#D'"; + return "redefinition of %q#D"; return NULL; } if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) != FUNCTION_DECL - || (DECL_TEMPLATE_RESULT (newdecl) + || (DECL_TEMPLATE_RESULT (newdecl) == DECL_TEMPLATE_RESULT (olddecl))) return NULL; @@ -2068,18 +2140,33 @@ redeclaration_error_message (tree newdecl, tree olddecl) if (DECL_TEMPLATE_INFO (ot)) ot = DECL_TEMPLATE_RESULT (template_for_substitution (ot)); if (DECL_INITIAL (nt) && DECL_INITIAL (ot)) - return "redefinition of `%#D'"; + return "redefinition of %q#D"; return NULL; } + else if (TREE_CODE (newdecl) == VAR_DECL + && DECL_THREAD_LOCAL_P (newdecl) != DECL_THREAD_LOCAL_P (olddecl) + && (! DECL_LANG_SPECIFIC (olddecl) + || ! CP_DECL_THREADPRIVATE_P (olddecl) + || DECL_THREAD_LOCAL_P (newdecl))) + { + /* Only variables can be thread-local, and all declarations must + agree on this property. */ + if (DECL_THREAD_LOCAL_P (newdecl)) + return "thread-local declaration of %q#D follows " + "non-thread-local declaration"; + else + return "non-thread-local declaration of %q#D follows " + "thread-local declaration"; + } else if (toplevel_bindings_p () || DECL_NAMESPACE_SCOPE_P (newdecl)) { /* Objects declared at top level: */ /* If at least one is a reference, it's ok. */ if (DECL_EXTERNAL (newdecl) || DECL_EXTERNAL (olddecl)) - return 0; + return NULL; /* Reject two definitions. */ - return "redefinition of `%#D'"; + return "redefinition of %q#D"; } else { @@ -2087,16 +2174,35 @@ redeclaration_error_message (tree newdecl, tree olddecl) /* Reject two definitions, and reject a definition together with an external reference. */ if (!(DECL_EXTERNAL (newdecl) && DECL_EXTERNAL (olddecl))) - return "redeclaration of `%#D'"; - return 0; + return "redeclaration of %q#D"; + return NULL; } } +/* Hash and equality functions for the named_label table. */ + +static hashval_t +named_label_entry_hash (const void *data) +{ + const struct named_label_entry *ent = (const struct named_label_entry *) data; + return DECL_UID (ent->label_decl); +} + +static int +named_label_entry_eq (const void *a, const void *b) +{ + const struct named_label_entry *ent_a = (const struct named_label_entry *) a; + const struct named_label_entry *ent_b = (const struct named_label_entry *) b; + return ent_a->label_decl == ent_b->label_decl; +} + /* Create a new label, named ID. */ static tree make_label_decl (tree id, int local_p) { + struct named_label_entry *ent; + void **slot; tree decl; decl = build_decl (LABEL_DECL, id, void_type_node); @@ -2112,32 +2218,24 @@ make_label_decl (tree id, int local_p) /* Record the fact that this identifier is bound to this label. */ SET_IDENTIFIER_LABEL_VALUE (id, decl); + /* Create the label htab for the function on demand. */ + if (!named_labels) + named_labels = htab_create_ggc (13, named_label_entry_hash, + named_label_entry_eq, NULL); + + /* Record this label on the list of labels used in this function. + We do this before calling make_label_decl so that we get the + IDENTIFIER_LABEL_VALUE before the new label is declared. */ + ent = GGC_CNEW (struct named_label_entry); + ent->label_decl = decl; + + slot = htab_find_slot (named_labels, ent, INSERT); + gcc_assert (*slot == NULL); + *slot = ent; + return decl; } -/* Record this label on the list of used labels so that we can check - at the end of the function to see whether or not the label was - actually defined, and so we can check when the label is defined whether - this use is valid. */ - -static void -use_label (tree decl) -{ - if (named_label_uses == NULL - || named_label_uses->names_in_scope != current_binding_level->names - || named_label_uses->label_decl != decl) - { - struct named_label_use_list *new_ent; - new_ent = ggc_alloc (sizeof (struct named_label_use_list)); - new_ent->label_decl = decl; - new_ent->names_in_scope = current_binding_level->names; - new_ent->binding_level = current_binding_level; - new_ent->o_goto_locus = input_location; - new_ent->next = named_label_uses; - named_label_uses = new_ent; - } -} - /* Look for a label named ID in the current function. If one cannot be found, create one. (We keep track of used, but undefined, labels, and complain about them at the end of a function.) */ @@ -2146,14 +2244,12 @@ tree lookup_label (tree id) { tree decl; - struct named_label_list *ent; timevar_push (TV_NAME_LOOKUP); /* You can't use labels at global scope. */ if (current_function_decl == NULL_TREE) { - error ("label `%s' referenced outside of any function", - IDENTIFIER_POINTER (id)); + error ("label %qE referenced outside of any function", id); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); } @@ -2162,20 +2258,7 @@ lookup_label (tree id) if (decl != NULL_TREE && DECL_CONTEXT (decl) == current_function_decl) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl); - /* Record this label on the list of labels used in this function. - We do this before calling make_label_decl so that we get the - IDENTIFIER_LABEL_VALUE before the new label is declared. */ - ent = ggc_alloc_cleared (sizeof (struct named_label_list)); - ent->old_value = IDENTIFIER_LABEL_VALUE (id); - ent->next = named_labels; - named_labels = ent; - - /* We need a new label. */ decl = make_label_decl (id, /*local_p=*/0); - - /* Now fill in the information we didn't have before. */ - ent->label_decl = decl; - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl); } @@ -2184,18 +2267,16 @@ lookup_label (tree id) tree declare_local_label (tree id) { - tree decl; + tree decl, shadow; /* Add a new entry to the SHADOWED_LABELS list so that when we leave - this scope we can restore the old value of - IDENTIFIER_TYPE_VALUE. */ - current_binding_level->shadowed_labels - = tree_cons (IDENTIFIER_LABEL_VALUE (id), NULL_TREE, - current_binding_level->shadowed_labels); - /* Look for the label. */ + this scope we can restore the old value of IDENTIFIER_TYPE_VALUE. */ + shadow = tree_cons (IDENTIFIER_LABEL_VALUE (id), NULL_TREE, + current_binding_level->shadowed_labels); + current_binding_level->shadowed_labels = shadow; + decl = make_label_decl (id, /*local_p=*/1); - /* Now fill in the information we didn't have before. */ - TREE_VALUE (current_binding_level->shadowed_labels) = decl; + TREE_VALUE (shadow) = decl; return decl; } @@ -2206,125 +2287,119 @@ declare_local_label (tree id) static int decl_jump_unsafe (tree decl) { - if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)) + if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl) + || TREE_TYPE (decl) == error_mark_node) return 0; - if (DECL_INITIAL (decl) == NULL_TREE - && pod_type_p (TREE_TYPE (decl))) - return 0; - - /* This is really only important if we're crossing an initialization. - The POD stuff is just pedantry; why should it matter if the class - contains a field of pointer to member type? */ - if (DECL_INITIAL (decl) - || (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))) + if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) + || DECL_NONTRIVIALLY_INITIALIZED_P (decl)) return 2; + + if (pod_type_p (TREE_TYPE (decl))) + return 0; + + /* The POD stuff is just pedantry; why should it matter if the class + contains a field of pointer to member type? */ return 1; } +/* A subroutine of check_previous_goto_1 to identify a branch to the user. */ + +static void +identify_goto (tree decl, const location_t *locus) +{ + if (decl) + pedwarn ("jump to label %qD", decl); + else + pedwarn ("jump to case label"); + if (locus) + pedwarn ("%H from here", locus); +} + /* Check that a single previously seen jump to a newly defined label is OK. DECL is the LABEL_DECL or 0; LEVEL is the binding_level for the jump context; NAMES are the names in scope in LEVEL at the jump - context; FILE and LINE are the source position of the jump or 0. */ + context; LOCUS is the source position of the jump or 0. Returns + true if all is well. */ -static void -check_previous_goto_1 (tree decl, - struct cp_binding_level* level, - tree names, const location_t *locus) +static bool +check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names, + bool exited_omp, const location_t *locus) { - int identified = 0; - int saw_eh = 0; - struct cp_binding_level *b = current_binding_level; - for (; b; b = b->level_chain) + struct cp_binding_level *b; + bool identified = false, saw_eh = false, saw_omp = false; + + if (exited_omp) { - tree new_decls = b->names; - tree old_decls = (b == level ? names : NULL_TREE); - for (; new_decls != old_decls; + identify_goto (decl, locus); + error (" exits OpenMP structured block"); + identified = saw_omp = true; + } + + for (b = current_binding_level; b ; b = b->level_chain) + { + tree new_decls, old_decls = (b == level ? names : NULL_TREE); + + for (new_decls = b->names; new_decls != old_decls; new_decls = TREE_CHAIN (new_decls)) { int problem = decl_jump_unsafe (new_decls); if (! problem) continue; - if (! identified) + if (!identified) { - if (decl) - pedwarn ("jump to label `%D'", decl); - else - pedwarn ("jump to case label"); - - if (locus) - pedwarn ("%H from here", locus); - identified = 1; + identify_goto (decl, locus); + identified = true; } - if (problem > 1) - cp_error_at (" crosses initialization of `%#D'", - new_decls); + error (" crosses initialization of %q+#D", new_decls); else - cp_pedwarn_at (" enters scope of non-POD `%#D'", - new_decls); + pedwarn (" enters scope of non-POD %q+#D", new_decls); } if (b == level) break; - if ((b->kind == sk_try || b->kind == sk_catch) && ! saw_eh) + if ((b->kind == sk_try || b->kind == sk_catch) && !saw_eh) { - if (! identified) + if (!identified) { - if (decl) - pedwarn ("jump to label `%D'", decl); - else - pedwarn ("jump to case label"); - - if (locus) - pedwarn ("%H from here", locus); - identified = 1; + identify_goto (decl, locus); + identified = true; } if (b->kind == sk_try) error (" enters try block"); else error (" enters catch block"); - saw_eh = 1; + saw_eh = true; + } + if (b->kind == sk_omp && !saw_omp) + { + if (!identified) + { + identify_goto (decl, locus); + identified = true; + } + error (" enters OpenMP structured block"); + saw_omp = true; } } + + return !identified; } static void -check_previous_goto (struct named_label_use_list* use) +check_previous_goto (tree decl, struct named_label_use_entry *use) { - check_previous_goto_1 (use->label_decl, use->binding_level, - use->names_in_scope, &use->o_goto_locus); + check_previous_goto_1 (decl, use->binding_level, + use->names_in_scope, use->in_omp_scope, + &use->o_goto_locus); } -static void +static bool check_switch_goto (struct cp_binding_level* level) { - check_previous_goto_1 (NULL_TREE, level, level->names, NULL); -} - -/* Check that any previously seen jumps to a newly defined label DECL - are OK. Called by define_label. */ - -static void -check_previous_gotos (tree decl) -{ - struct named_label_use_list **usep; - - if (! TREE_USED (decl)) - return; - - for (usep = &named_label_uses; *usep; ) - { - struct named_label_use_list *use = *usep; - if (use->label_decl == decl) - { - check_previous_goto (use); - *usep = use->next; - } - else - usep = &(use->next); - } + return check_previous_goto_1 (NULL_TREE, level, level->names, false, NULL); } /* Check that a new jump to a label DECL is OK. Called by @@ -2333,57 +2408,114 @@ check_previous_gotos (tree decl) void check_goto (tree decl) { - int identified = 0; + struct named_label_entry *ent, dummy; + bool saw_catch = false, identified = false; tree bad; - struct named_label_list *lab; - /* We can't know where a computed goto is jumping. So we assume - that it's OK. */ - if (! DECL_P (decl)) + /* We can't know where a computed goto is jumping. + So we assume that it's OK. */ + if (TREE_CODE (decl) != LABEL_DECL) return; + /* We didn't record any information about this label when we created it, + and there's not much point since it's trivial to analyze as a return. */ + if (decl == cdtor_label) + return; + + dummy.label_decl = decl; + ent = (struct named_label_entry *) htab_find (named_labels, &dummy); + gcc_assert (ent != NULL); + /* If the label hasn't been defined yet, defer checking. */ if (! DECL_INITIAL (decl)) { - use_label (decl); + struct named_label_use_entry *new_use; + + /* Don't bother creating another use if the last goto had the + same data, and will therefore create the same set of errors. */ + if (ent->uses + && ent->uses->names_in_scope == current_binding_level->names) + return; + + new_use = GGC_NEW (struct named_label_use_entry); + new_use->binding_level = current_binding_level; + new_use->names_in_scope = current_binding_level->names; + new_use->o_goto_locus = input_location; + new_use->in_omp_scope = false; + + new_use->next = ent->uses; + ent->uses = new_use; return; } - for (lab = named_labels; lab; lab = lab->next) - if (decl == lab->label_decl) - break; - - /* If the label is not on named_labels it's a gcc local label, so - it must be in an outer scope, so jumping to it is always OK. */ - if (lab == 0) - return; - - if ((lab->in_try_scope || lab->in_catch_scope || lab->bad_decls) - && !identified) + if (ent->in_try_scope || ent->in_catch_scope + || ent->in_omp_scope || ent->bad_decls) { - cp_pedwarn_at ("jump to label `%D'", decl); + pedwarn ("jump to label %q+D", decl); pedwarn (" from here"); - identified = 1; + identified = true; } - for (bad = lab->bad_decls; bad; bad = TREE_CHAIN (bad)) + for (bad = ent->bad_decls; bad; bad = TREE_CHAIN (bad)) { tree b = TREE_VALUE (bad); int u = decl_jump_unsafe (b); if (u > 1 && DECL_ARTIFICIAL (b)) - /* Can't skip init of __exception_info. */ - error ("%J enters catch block", b); + { + /* Can't skip init of __exception_info. */ + error ("%J enters catch block", b); + saw_catch = true; + } else if (u > 1) - cp_error_at (" skips initialization of `%#D'", b); + error (" skips initialization of %q+#D", b); else - cp_pedwarn_at (" enters scope of non-POD `%#D'", b); + pedwarn (" enters scope of non-POD %q+#D", b); } - if (lab->in_try_scope) + if (ent->in_try_scope) error (" enters try block"); - else if (lab->in_catch_scope) + else if (ent->in_catch_scope && !saw_catch) error (" enters catch block"); + + if (ent->in_omp_scope) + error (" enters OpenMP structured block"); + else if (flag_openmp) + { + struct cp_binding_level *b; + for (b = current_binding_level; b ; b = b->level_chain) + { + if (b == ent->binding_level) + break; + if (b->kind == sk_omp) + { + if (!identified) + { + pedwarn ("jump to label %q+D", decl); + pedwarn (" from here"); + identified = true; + } + error (" exits OpenMP structured block"); + break; + } + } + } +} + +/* Check that a return is ok wrt OpenMP structured blocks. + Called by finish_return_stmt. Returns true if all is well. */ + +bool +check_omp_return (void) +{ + struct cp_binding_level *b; + for (b = current_binding_level; b ; b = b->level_chain) + if (b->kind == sk_omp) + { + error ("invalid exit from OpenMP structured block"); + return false; + } + return true; } /* Define a label, specifying the location in the source file. @@ -2392,19 +2524,22 @@ check_goto (tree decl) tree define_label (location_t location, tree name) { - tree decl = lookup_label (name); - struct named_label_list *ent; + struct named_label_entry *ent, dummy; struct cp_binding_level *p; + tree decl; timevar_push (TV_NAME_LOOKUP); - for (ent = named_labels; ent; ent = ent->next) - if (ent->label_decl == decl) - break; + + decl = lookup_label (name); + + dummy.label_decl = decl; + ent = (struct named_label_entry *) htab_find (named_labels, &dummy); + gcc_assert (ent != NULL); /* After labels, make any new cleanups in the function go into their own new (temporary) binding contour. */ - for (p = current_binding_level; - p->kind != sk_function_parms; + for (p = current_binding_level; + p->kind != sk_function_parms; p = p->level_chain) p->more_cleanups_ok = 0; @@ -2412,23 +2547,28 @@ define_label (location_t location, tree name) pedwarn ("label named wchar_t"); if (DECL_INITIAL (decl) != NULL_TREE) - error ("duplicate label `%D'", decl); + { + error ("duplicate label %qD", decl); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + } else { + struct named_label_use_entry *use; + /* Mark label as having been defined. */ DECL_INITIAL (decl) = error_mark_node; /* Say where in the source. */ DECL_SOURCE_LOCATION (decl) = location; - if (ent) - { - ent->names_in_scope = current_binding_level->names; - ent->binding_level = current_binding_level; - } - check_previous_gotos (decl); + + ent->binding_level = current_binding_level; + ent->names_in_scope = current_binding_level->names; + + for (use = ent->uses; use ; use = use->next) + check_previous_goto (decl, use); + ent->uses = NULL; } - timevar_pop (TV_NAME_LOOKUP); - return decl; + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl); } struct cp_switch @@ -2459,7 +2599,7 @@ static struct cp_switch *switch_stack; void push_switch (tree switch_stmt) { - struct cp_switch *p = xmalloc (sizeof (struct cp_switch)); + struct cp_switch *p = XNEW (struct cp_switch); p->level = current_binding_level; p->next = switch_stack; p->switch_stmt = switch_stmt; @@ -2470,9 +2610,19 @@ push_switch (tree switch_stmt) void pop_switch (void) { - struct cp_switch *cs; + struct cp_switch *cs = switch_stack; + location_t switch_location; + + /* Emit warnings as needed. */ + if (EXPR_HAS_LOCATION (cs->switch_stmt)) + switch_location = EXPR_LOCATION (cs->switch_stmt); + else + switch_location = input_location; + if (!processing_template_decl) + c_do_switch_warnings (cs->cases, switch_location, + SWITCH_STMT_TYPE (cs->switch_stmt), + SWITCH_STMT_COND (cs->switch_stmt)); - cs = switch_stack; splay_tree_delete (cs->cases); switch_stack = switch_stack->next; free (cs); @@ -2498,18 +2648,20 @@ finish_case_label (tree low_value, tree high_value) } /* Find the condition on which this switch statement depends. */ - cond = SWITCH_COND (switch_stack->switch_stmt); + cond = SWITCH_STMT_COND (switch_stack->switch_stmt); if (cond && TREE_CODE (cond) == TREE_LIST) cond = TREE_VALUE (cond); - r = c_add_case_label (switch_stack->cases, cond, low_value, high_value); + if (!check_switch_goto (switch_stack->level)) + return error_mark_node; - check_switch_goto (switch_stack->level); + r = c_add_case_label (switch_stack->cases, cond, TREE_TYPE (cond), + low_value, high_value); /* After labels, make any new cleanups in the function go into their own new (temporary) binding contour. */ - for (p = current_binding_level; - p->kind != sk_function_parms; + for (p = current_binding_level; + p->kind != sk_function_parms; p = p->level_chain) p->more_cleanups_ok = 0; @@ -2530,85 +2682,105 @@ typename_hash (const void* k) return hash; } +typedef struct typename_info { + tree scope; + tree name; + tree template_id; + bool enum_p; + bool class_p; +} typename_info; + /* Compare two TYPENAME_TYPEs. K1 and K2 are really of type `tree'. */ static int typename_compare (const void * k1, const void * k2) { tree t1; - tree t2; - tree d1; - tree d2; + const typename_info *t2; t1 = (tree) k1; - t2 = (tree) k2; - d1 = TYPE_NAME (t1); - d2 = TYPE_NAME (t2); + t2 = (const typename_info *) k2; - return (DECL_NAME (d1) == DECL_NAME (d2) - && TYPE_CONTEXT (t1) == TYPE_CONTEXT (t2) - && ((TREE_TYPE (t1) != NULL_TREE) - == (TREE_TYPE (t2) != NULL_TREE)) - && same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)) - && TYPENAME_TYPE_FULLNAME (t1) == TYPENAME_TYPE_FULLNAME (t2)); + return (DECL_NAME (TYPE_NAME (t1)) == t2->name + && TYPE_CONTEXT (t1) == t2->scope + && TYPENAME_TYPE_FULLNAME (t1) == t2->template_id + && TYPENAME_IS_ENUM_P (t1) == t2->enum_p + && TYPENAME_IS_CLASS_P (t1) == t2->class_p); } /* Build a TYPENAME_TYPE. If the type is `typename T::t', CONTEXT is - the type of `T', NAME is the IDENTIFIER_NODE for `t'. If BASE_TYPE - is non-NULL, this type is being created by the implicit typename - extension, and BASE_TYPE is a type named `t' in some base class of - `T' which depends on template parameters. + the type of `T', NAME is the IDENTIFIER_NODE for `t'. Returns the new TYPENAME_TYPE. */ static GTY ((param_is (union tree_node))) htab_t typename_htab; static tree -build_typename_type (tree context, tree name, tree fullname) +build_typename_type (tree context, tree name, tree fullname, + enum tag_types tag_type) { tree t; tree d; + typename_info ti; void **e; + hashval_t hash; if (typename_htab == NULL) - { - typename_htab = htab_create_ggc (61, &typename_hash, - &typename_compare, NULL); - } + typename_htab = htab_create_ggc (61, &typename_hash, + &typename_compare, NULL); - /* Build the TYPENAME_TYPE. */ - t = make_aggr_type (TYPENAME_TYPE); - TYPE_CONTEXT (t) = FROB_CONTEXT (context); - TYPENAME_TYPE_FULLNAME (t) = fullname; - - /* Build the corresponding TYPE_DECL. */ - d = build_decl (TYPE_DECL, name, t); - TYPE_NAME (TREE_TYPE (d)) = d; - TYPE_STUB_DECL (TREE_TYPE (d)) = d; - DECL_CONTEXT (d) = FROB_CONTEXT (context); - DECL_ARTIFICIAL (d) = 1; + ti.scope = FROB_CONTEXT (context); + ti.name = name; + ti.template_id = fullname; + ti.enum_p = tag_type == enum_type; + ti.class_p = (tag_type == class_type + || tag_type == record_type + || tag_type == union_type); + hash = (htab_hash_pointer (ti.scope) + ^ htab_hash_pointer (ti.name)); /* See if we already have this type. */ - e = htab_find_slot (typename_htab, t, INSERT); + e = htab_find_slot_with_hash (typename_htab, &ti, hash, INSERT); if (*e) t = (tree) *e; else - *e = t; + { + /* Build the TYPENAME_TYPE. */ + t = make_aggr_type (TYPENAME_TYPE); + TYPE_CONTEXT (t) = ti.scope; + TYPENAME_TYPE_FULLNAME (t) = ti.template_id; + TYPENAME_IS_ENUM_P (t) = ti.enum_p; + TYPENAME_IS_CLASS_P (t) = ti.class_p; + + /* Build the corresponding TYPE_DECL. */ + d = build_decl (TYPE_DECL, name, t); + TYPE_NAME (TREE_TYPE (d)) = d; + TYPE_STUB_DECL (TREE_TYPE (d)) = d; + DECL_CONTEXT (d) = FROB_CONTEXT (context); + DECL_ARTIFICIAL (d) = 1; + + /* Store it in the hash table. */ + *e = t; + } return t; } -/* Resolve `typename CONTEXT::NAME'. Returns an appropriate type, - unless an error occurs, in which case error_mark_node is returned. - If we locate a non-artificial TYPE_DECL and TF_KEEP_TYPE_DECL is - set, we return that, rather than the _TYPE it corresponds to, in - other cases we look through the type decl. If TF_ERROR is set, - complain about errors, otherwise be quiet. */ +/* Resolve `typename CONTEXT::NAME'. TAG_TYPE indicates the tag + provided to name the type. Returns an appropriate type, unless an + error occurs, in which case error_mark_node is returned. If we + locate a non-artificial TYPE_DECL and TF_KEEP_TYPE_DECL is set, we + return that, rather than the _TYPE it corresponds to, in other + cases we look through the type decl. If TF_ERROR is set, complain + about errors, otherwise be quiet. */ tree -make_typename_type (tree context, tree name, tsubst_flags_t complain) +make_typename_type (tree context, tree name, enum tag_types tag_type, + tsubst_flags_t complain) { tree fullname; + tree t; + bool want_template; if (name == error_mark_node || context == NULL_TREE @@ -2637,92 +2809,88 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain) name = TREE_OPERAND (name, 0); if (TREE_CODE (name) == TEMPLATE_DECL) name = TREE_OPERAND (fullname, 0) = DECL_NAME (name); + else if (TREE_CODE (name) == OVERLOAD) + { + error ("%qD is not a type", name); + return error_mark_node; + } } if (TREE_CODE (name) == TEMPLATE_DECL) { - error ("`%D' used without template parameters", name); + error ("%qD used without template parameters", name); return error_mark_node; } - my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802); - my_friendly_assert (TYPE_P (context), 20050905); + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); + gcc_assert (TYPE_P (context)); - if (!dependent_type_p (context) - || currently_open_class (context)) - { - if (TREE_CODE (fullname) == TEMPLATE_ID_EXPR) - { - tree tmpl = NULL_TREE; - if (IS_AGGR_TYPE (context)) - tmpl = lookup_field (context, name, 0, false); - if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl)) - { - if (complain & tf_error) - error ("no class template named `%#T' in `%#T'", - name, context); - return error_mark_node; - } + /* When the CONTEXT is a dependent type, NAME could refer to a + dependent base class of CONTEXT. So we cannot peek inside it, + even if CONTEXT is a currently open scope. */ + if (dependent_type_p (context)) + return build_typename_type (context, name, fullname, tag_type); - if (complain & tf_error) - perform_or_defer_access_check (TYPE_BINFO (context), tmpl); - - return lookup_template_class (tmpl, - TREE_OPERAND (fullname, 1), - NULL_TREE, context, - /*entering_scope=*/0, - tf_error | tf_warning | tf_user); - } - else - { - tree t; - - if (!IS_AGGR_TYPE (context)) - { - if (complain & tf_error) - error ("no type named `%#T' in `%#T'", name, context); - return error_mark_node; - } - - t = lookup_field (context, name, 0, true); - if (t) - { - if (TREE_CODE (t) != TYPE_DECL) - { - if (complain & tf_error) - error ("no type named `%#T' in `%#T'", name, context); - return error_mark_node; - } - - if (complain & tf_error) - perform_or_defer_access_check (TYPE_BINFO (context), t); - - if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl)) - t = TREE_TYPE (t); - - return t; - } - } - } - - /* If the CONTEXT is not a template type, then either the field is - there now or its never going to be. */ - if (!dependent_type_p (context)) + if (!IS_AGGR_TYPE (context)) { if (complain & tf_error) - error ("no type named `%#T' in `%#T'", name, context); + error ("%q#T is not a class", context); return error_mark_node; } + + want_template = TREE_CODE (fullname) == TEMPLATE_ID_EXPR; + + /* We should only set WANT_TYPE when we're a nested typename type. + Then we can give better diagnostics if we find a non-type. */ + t = lookup_field (context, name, 0, /*want_type=*/true); + if (!t) + { + if (complain & tf_error) + error (want_template ? "no class template named %q#T in %q#T" + : "no type named %q#T in %q#T", name, context); + return error_mark_node; + } + + if (want_template && !DECL_CLASS_TEMPLATE_P (t)) + { + if (complain & tf_error) + error ("% names %q#T, which is not a class template", + context, name, t); + return error_mark_node; + } + if (!want_template && TREE_CODE (t) != TYPE_DECL) + { + if (complain & tf_error) + error ("% names %q#T, which is not a type", + context, name, t); + return error_mark_node; + } + + if (complain & tf_error) + perform_or_defer_access_check (TYPE_BINFO (context), t, t); - return build_typename_type (context, name, fullname); + if (want_template) + return lookup_template_class (t, TREE_OPERAND (fullname, 1), + NULL_TREE, context, + /*entering_scope=*/0, + tf_warning_or_error | tf_user); + + if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl)) + t = TREE_TYPE (t); + + return t; } -/* Resolve `CONTEXT::template NAME'. Returns an appropriate type, - unless an error occurs, in which case error_mark_node is returned. - If we locate a TYPE_DECL, we return that, rather than the _TYPE it - corresponds to. If COMPLAIN zero, don't complain about any errors - that occur. */ +/* Resolve `CONTEXT::template NAME'. Returns a TEMPLATE_DECL if the name + can be resolved or an UNBOUND_CLASS_TEMPLATE, unless an error occurs, + in which case error_mark_node is returned. + + If PARM_LIST is non-NULL, also make sure that the template parameter + list of TEMPLATE_DECL matches. + + If COMPLAIN zero, don't complain about any errors that occur. */ tree -make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) +make_unbound_class_template (tree context, tree name, tree parm_list, + tsubst_flags_t complain) { tree t; tree d; @@ -2731,8 +2899,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) name = TYPE_IDENTIFIER (name); else if (DECL_P (name)) name = DECL_NAME (name); - if (TREE_CODE (name) != IDENTIFIER_NODE) - abort (); + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); if (!dependent_type_p (context) || currently_open_class (context)) @@ -2745,12 +2912,23 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl)) { if (complain & tf_error) - error ("no class template named `%#T' in `%#T'", name, context); + error ("no class template named %q#T in %q#T", name, context); return error_mark_node; } - + + if (parm_list + && !comp_template_parms (DECL_TEMPLATE_PARMS (tmpl), parm_list)) + { + if (complain & tf_error) + { + error ("template parameters do not match template"); + error ("%q+D declared here", tmpl); + } + return error_mark_node; + } + if (complain & tf_error) - perform_or_defer_access_check (TYPE_BINFO (context), tmpl); + perform_or_defer_access_check (TYPE_BINFO (context), tmpl, tmpl); return tmpl; } @@ -2766,33 +2944,22 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) TYPE_STUB_DECL (TREE_TYPE (d)) = d; DECL_CONTEXT (d) = FROB_CONTEXT (context); DECL_ARTIFICIAL (d) = 1; + DECL_TEMPLATE_PARMS (d) = parm_list; return t; } -/* A chain of TYPE_DECLs for the builtin types. */ - -static GTY(()) tree builtin_type_decls; - -/* Return a chain of TYPE_DECLs for the builtin types. */ - -tree -cxx_builtin_type_decls (void) -{ - return builtin_type_decls; -} - /* Push the declarations of builtin types into the namespace. RID_INDEX is the index of the builtin type in the array RID_POINTERS. NAME is the name used when looking up the builtin type. TYPE is the _TYPE node for the builtin type. */ void -record_builtin_type (enum rid rid_index, - const char* name, - tree type) +record_builtin_type (enum rid rid_index, + const char* name, + tree type) { tree rname = NULL_TREE, tname = NULL_TREE; tree tdecl = NULL_TREE; @@ -2827,10 +2994,7 @@ record_builtin_type (enum rid rid_index, TYPE_NAME (type) = tdecl; if (tdecl) - { - TREE_CHAIN (tdecl) = builtin_type_decls; - builtin_type_decls = tdecl; - } + debug_hooks->type_decl (tdecl, 0); } /* Record one of the standard Java types. @@ -2882,7 +3046,7 @@ record_unknown_type (tree type, const char* name) TYPE_MODE (type) = TYPE_MODE (void_type_node); } -/* An string for which we should create an IDENTIFIER_NODE at +/* A string for which we should create an IDENTIFIER_NODE at startup. */ typedef struct predefined_identifier @@ -2907,13 +3071,15 @@ initialize_predefined_identifiers (void) { "C++", &lang_name_cplusplus, 0 }, { "C", &lang_name_c, 0 }, { "Java", &lang_name_java, 0 }, - { CTOR_NAME, &ctor_identifier, 1 }, - { "__base_ctor", &base_ctor_identifier, 1 }, - { "__comp_ctor", &complete_ctor_identifier, 1 }, - { DTOR_NAME, &dtor_identifier, 1 }, - { "__comp_dtor", &complete_dtor_identifier, 1 }, - { "__base_dtor", &base_dtor_identifier, 1 }, - { "__deleting_dtor", &deleting_dtor_identifier, 1 }, + /* Some of these names have a trailing space so that it is + impossible for them to conflict with names written by users. */ + { "__ct ", &ctor_identifier, 1 }, + { "__base_ctor ", &base_ctor_identifier, 1 }, + { "__comp_ctor ", &complete_ctor_identifier, 1 }, + { "__dt ", &dtor_identifier, 1 }, + { "__comp_dtor ", &complete_dtor_identifier, 1 }, + { "__base_dtor ", &base_dtor_identifier, 1 }, + { "__deleting_dtor ", &deleting_dtor_identifier, 1 }, { IN_CHARGE_NAME, &in_charge_identifier, 0 }, { "nelts", &nelts_identifier, 0 }, { THIS_NAME, &this_identifier, 0 }, @@ -2945,21 +3111,21 @@ cxx_init_decl_processing (void) tree void_ftype; tree void_ftype_ptr; + build_common_tree_nodes (flag_signed_char, false); + /* Create all the identifiers we need. */ initialize_predefined_identifiers (); - /* Fill in back-end hooks. */ - lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p; - /* Create the global variables. */ push_to_top_level (); current_function_decl = NULL_TREE; current_binding_level = NULL; /* Enter the global namespace. */ - my_friendly_assert (global_namespace == NULL_TREE, 375); + gcc_assert (global_namespace == NULL_TREE); global_namespace = build_lang_decl (NAMESPACE_DECL, global_scope_name, - void_type_node); + void_type_node); + TREE_PUBLIC (global_namespace) = 1; begin_scope (sk_namespace, global_namespace); current_lang_name = NULL_TREE; @@ -2973,10 +3139,7 @@ cxx_init_decl_processing (void) flag_no_inline = 1; } if (flag_inline_functions) - { - flag_inline_trees = 2; - flag_inline_functions = 0; - } + flag_inline_trees = 2; /* Force minimum function alignment if using the least significant bit of function pointers to store the virtual bit. */ @@ -2987,11 +3150,6 @@ cxx_init_decl_processing (void) /* Initially, C. */ current_lang_name = lang_name_c; - build_common_tree_nodes (flag_signed_char); - - error_mark_list = build_tree_list (error_mark_node, error_mark_node); - TREE_TYPE (error_mark_list) = error_mark_node; - /* Create the `std' namespace. */ push_namespace (std_identifier); std_node = current_namespace; @@ -3008,10 +3166,8 @@ cxx_init_decl_processing (void) java_char_type_node = record_builtin_java_type ("__java_char", -16); java_boolean_type_node = record_builtin_java_type ("__java_boolean", -1); - integer_two_node = build_int_2 (2, 0); - TREE_TYPE (integer_two_node) = integer_type_node; - integer_three_node = build_int_2 (3, 0); - TREE_TYPE (integer_three_node) = integer_type_node; + integer_two_node = build_int_cst (NULL_TREE, 2); + integer_three_node = build_int_cst (NULL_TREE, 3); record_builtin_type (RID_BOOL, "bool", boolean_type_node); truthvalue_type_node = boolean_type_node; @@ -3031,7 +3187,7 @@ cxx_init_decl_processing (void) void_ftype = build_function_type (void_type_node, void_list_node); void_ftype_ptr = build_function_type (void_type_node, tree_cons (NULL_TREE, - ptr_type_node, + ptr_type_node, void_list_node)); void_ftype_ptr = build_exception_variant (void_ftype_ptr, empty_except_spec); @@ -3091,13 +3247,13 @@ cxx_init_decl_processing (void) bad_alloc_id = get_identifier ("bad_alloc"); bad_alloc_type_node = make_aggr_type (RECORD_TYPE); TYPE_CONTEXT (bad_alloc_type_node) = current_namespace; - bad_alloc_decl + bad_alloc_decl = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node); DECL_CONTEXT (bad_alloc_decl) = current_namespace; TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl; pop_namespace (); - - ptr_ftype_sizetype + + ptr_ftype_sizetype = build_function_type (ptr_type_node, tree_cons (NULL_TREE, size_type_node, @@ -3117,7 +3273,6 @@ cxx_init_decl_processing (void) /* Perform other language dependent initializations. */ init_class_processing (); - init_search_processing (); init_rtti_processing (); if (flag_exceptions) @@ -3130,12 +3285,8 @@ cxx_init_decl_processing (void) start_fname_decls (); /* Show we use EH for cleanups. */ - using_eh_for_cleanups (); - - /* Maintain consistency. Perhaps we should just complain if they - say -fwritable-strings? */ - if (flag_writable_strings) - flag_const_strings = 0; + if (flag_exceptions) + using_eh_for_cleanups (); } /* Generate an initializer for a function naming variable from @@ -3156,17 +3307,17 @@ cp_fname_init (const char* name, tree *type_p) domain = build_index_type (size_int (length)); init = build_string (length + 1, name); } - + type = build_qualified_type (char_type_node, TYPE_QUAL_CONST); type = build_cplus_array_type (type, domain); *type_p = type; - + if (init) TREE_TYPE (init) = type; else init = error_mark_node; - + return init; } @@ -3174,7 +3325,7 @@ cp_fname_init (const char* name, tree *type_p) decl, NAME is the initialization string and TYPE_DEP indicates whether NAME depended on the type of the function. We make use of that to detect __PRETTY_FUNCTION__ inside a template fn. This is being done - lazily at the point of first use, so we musn't push the decl now. */ + lazily at the point of first use, so we mustn't push the decl now. */ static tree cp_make_fname_decl (tree id, int type_dep) @@ -3185,15 +3336,17 @@ cp_make_fname_decl (tree id, int type_dep) tree init = cp_fname_init (name, &type); tree decl = build_decl (VAR_DECL, id, type); + if (name) + free ((char *) name); + /* As we're using pushdecl_with_scope, we must set the context. */ DECL_CONTEXT (decl) = current_function_decl; DECL_PRETTY_FUNCTION_P (decl) = type_dep; - + TREE_STATIC (decl) = 1; TREE_READONLY (decl) = 1; DECL_ARTIFICIAL (decl) = 1; - DECL_INITIAL (decl) = init; - + TREE_USED (decl) = 1; if (current_function_decl) @@ -3201,12 +3354,13 @@ cp_make_fname_decl (tree id, int type_dep) struct cp_binding_level *b = current_binding_level; while (b->level_chain->kind != sk_function_parms) b = b->level_chain; - pushdecl_with_scope (decl, b); - cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING); + pushdecl_with_scope (decl, b, /*is_friend=*/false); + cp_finish_decl (decl, init, /*init_const_expr_p=*/false, NULL_TREE, + LOOKUP_ONLYCONVERTING); } else pushdecl_top_level_and_finish (decl, init); - + return decl; } @@ -3224,12 +3378,12 @@ cp_make_fname_decl (tree id, int type_dep) static tree builtin_function_1 (const char* name, - tree type, - tree context, - int code, - enum built_in_class class, - const char* libname, - tree attrs) + tree type, + tree context, + enum built_in_function code, + enum built_in_class class, + const char* libname, + tree attrs) { tree decl = build_library_fn_1 (get_identifier (name), ERROR_MARK, type); DECL_BUILT_IN_CLASS (decl) = class; @@ -3243,10 +3397,10 @@ builtin_function_1 (const char* name, function in the namespace. */ if (libname) SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname)); - make_decl_rtl (decl, NULL); - /* Warn if a function in the namespace for users - is used without an occasion to consider it declared. */ + /* A function in the user's namespace should have an explicit + declaration before it is used. Mark the built-in function as + anticipated but not actually declared. */ if (name[0] != '_' || name[1] != '_') DECL_ANTICIPATED (decl) = 1; @@ -3277,23 +3431,23 @@ builtin_function_1 (const char* name, tree builtin_function (const char* name, - tree type, - int code, - enum built_in_class class, - const char* libname, - tree attrs) + tree type, + int code, + enum built_in_class cl, + const char* libname, + tree attrs) { /* All builtins that don't begin with an '_' should additionally go in the 'std' namespace. */ if (name[0] != '_') { push_namespace (std_identifier); - builtin_function_1 (name, type, std_node, code, class, libname, attrs); + builtin_function_1 (name, type, std_node, code, cl, libname, attrs); pop_namespace (); } return builtin_function_1 (name, type, NULL_TREE, code, - class, libname, attrs); + cl, libname, attrs); } /* Generate a FUNCTION_DECL with the typical flags for a runtime library @@ -3306,9 +3460,12 @@ build_library_fn_1 (tree name, enum tree_code operator_code, tree type) DECL_EXTERNAL (fn) = 1; TREE_PUBLIC (fn) = 1; DECL_ARTIFICIAL (fn) = 1; - TREE_NOTHROW (fn) = 1; SET_OVERLOADED_OPERATOR_CODE (fn, operator_code); SET_DECL_LANGUAGE (fn, lang_c); + /* Runtime library routines are, by definition, available in an + external shared object. */ + DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (fn) = 1; return fn; } @@ -3319,7 +3476,9 @@ build_library_fn_1 (tree name, enum tree_code operator_code, tree type) tree build_library_fn (tree name, tree type) { - return build_library_fn_1 (name, ERROR_MARK, type); + tree fn = build_library_fn_1 (name, ERROR_MARK, type); + TREE_NOTHROW (fn) = 1; + return fn; } /* Returns the _DECL for a library function with C++ linkage. */ @@ -3331,7 +3490,6 @@ build_cp_library_fn (tree name, enum tree_code operator_code, tree type) TREE_NOTHROW (fn) = TYPE_NOTHROW_P (type); DECL_CONTEXT (fn) = FROB_CONTEXT (current_namespace); SET_DECL_LANGUAGE (fn, lang_cplusplus); - set_mangled_name_for_decl (fn); return fn; } @@ -3452,15 +3610,15 @@ fixup_anonymous_aggr (tree t) type = TREE_TYPE (field); if (CLASS_TYPE_P (type)) { - if (TYPE_NEEDS_CONSTRUCTING (type)) - cp_error_at ("member %#D' with constructor not allowed in anonymous aggregate", - field); + if (TYPE_NEEDS_CONSTRUCTING (type)) + error ("member %q+#D with constructor not allowed " + "in anonymous aggregate", field); if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)) - cp_error_at ("member %#D' with destructor not allowed in anonymous aggregate", - field); + error ("member %q+#D with destructor not allowed " + "in anonymous aggregate", field); if (TYPE_HAS_COMPLEX_ASSIGN_REF (type)) - cp_error_at ("member %#D' with copy assignment operator not allowed in anonymous aggregate", - field); + error ("member %q+#D with copy assignment operator " + "not allowed in anonymous aggregate", field); } } } @@ -3472,13 +3630,10 @@ fixup_anonymous_aggr (tree t) Returns the type declared; or NULL_TREE if none. */ tree -check_tag_decl (tree declspecs) +check_tag_decl (cp_decl_specifier_seq *declspecs) { - int found_type = 0; - int saw_friend = 0; - int saw_typedef = 0; - tree ob_modifier = NULL_TREE; - tree link; + int saw_friend = declspecs->specs[(int)ds_friend] != 0; + int saw_typedef = declspecs->specs[(int)ds_typedef] != 0; /* If a class, struct, or enum type is declared by the DECLSPECS (i.e, if a class-specifier, enum-specifier, or non-typename elaborated-type-specifier appears in the DECLSPECS), @@ -3486,59 +3641,24 @@ check_tag_decl (tree declspecs) tree declared_type = NULL_TREE; bool error_p = false; - for (link = declspecs; link; link = TREE_CHAIN (link)) + if (declspecs->multiple_types_p) + error ("multiple types in one declaration"); + else if (declspecs->redefined_builtin_type) { - tree value = TREE_VALUE (link); - - if (TYPE_P (value) || TREE_CODE (value) == TYPE_DECL - || (TREE_CODE (value) == IDENTIFIER_NODE - && is_typename_at_global_scope (value))) - { - ++found_type; - - if (found_type == 2 && TREE_CODE (value) == IDENTIFIER_NODE) - { - if (! in_system_header) - pedwarn ("redeclaration of C++ built-in type `%T'", value); - return NULL_TREE; - } - - if (TYPE_P (value) - && ((TREE_CODE (value) != TYPENAME_TYPE && IS_AGGR_TYPE (value)) - || TREE_CODE (value) == ENUMERAL_TYPE)) - { - my_friendly_assert (TYPE_MAIN_DECL (value) != NULL_TREE, 261); - declared_type = value; - } - } - else if (value == ridpointers[(int) RID_TYPEDEF]) - saw_typedef = 1; - else if (value == ridpointers[(int) RID_FRIEND]) - { - if (current_class_type == NULL_TREE - || current_scope () != current_class_type) - ob_modifier = value; - else - saw_friend = 1; - } - else if (value == ridpointers[(int) RID_STATIC] - || value == ridpointers[(int) RID_EXTERN] - || value == ridpointers[(int) RID_AUTO] - || value == ridpointers[(int) RID_REGISTER] - || value == ridpointers[(int) RID_INLINE] - || value == ridpointers[(int) RID_VIRTUAL] - || value == ridpointers[(int) RID_CONST] - || value == ridpointers[(int) RID_VOLATILE] - || value == ridpointers[(int) RID_EXPLICIT] - || value == ridpointers[(int) RID_THREAD]) - ob_modifier = value; - else if (value == error_mark_node) - error_p = true; + if (!in_system_header) + pedwarn ("redeclaration of C++ built-in type %qT", + declspecs->redefined_builtin_type); + return NULL_TREE; } - if (found_type > 1) - error ("multiple types in one declaration"); - + if (declspecs->type + && TYPE_P (declspecs->type) + && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE + && IS_AGGR_TYPE (declspecs->type)) + || TREE_CODE (declspecs->type) == ENUMERAL_TYPE)) + declared_type = declspecs->type; + else if (declspecs->type == error_mark_node) + error_p = true; if (declared_type == NULL_TREE && ! saw_friend && !error_p) pedwarn ("declaration does not declare anything"); /* Check for an anonymous union. */ @@ -3546,47 +3666,56 @@ check_tag_decl (tree declspecs) && TYPE_ANONYMOUS_P (declared_type)) { /* 7/3 In a simple-declaration, the optional init-declarator-list - can be omitted only when declaring a class (clause 9) or - enumeration (7.2), that is, when the decl-specifier-seq contains - either a class-specifier, an elaborated-type-specifier with - a class-key (9.1), or an enum-specifier. In these cases and - whenever a class-specifier or enum-specifier is present in the - decl-specifier-seq, the identifiers in these specifiers are among - the names being declared by the declaration (as class-name, - enum-names, or enumerators, depending on the syntax). In such - cases, and except for the declaration of an unnamed bit-field (9.6), - the decl-specifier-seq shall introduce one or more names into the - program, or shall redeclare a name introduced by a previous - declaration. [Example: - enum { }; // ill-formed - typedef class { }; // ill-formed - --end example] */ + can be omitted only when declaring a class (clause 9) or + enumeration (7.2), that is, when the decl-specifier-seq contains + either a class-specifier, an elaborated-type-specifier with + a class-key (9.1), or an enum-specifier. In these cases and + whenever a class-specifier or enum-specifier is present in the + decl-specifier-seq, the identifiers in these specifiers are among + the names being declared by the declaration (as class-name, + enum-names, or enumerators, depending on the syntax). In such + cases, and except for the declaration of an unnamed bit-field (9.6), + the decl-specifier-seq shall introduce one or more names into the + program, or shall redeclare a name introduced by a previous + declaration. [Example: + enum { }; // ill-formed + typedef class { }; // ill-formed + --end example] */ if (saw_typedef) - { - error ("missing type-name in typedef-declaration"); - return NULL_TREE; - } + { + error ("missing type-name in typedef-declaration"); + return NULL_TREE; + } /* Anonymous unions are objects, so they can have specifiers. */; SET_ANON_AGGR_TYPE_P (declared_type); - if (TREE_CODE (declared_type) != UNION_TYPE && pedantic + if (TREE_CODE (declared_type) != UNION_TYPE && pedantic && !in_system_header) pedwarn ("ISO C++ prohibits anonymous structs"); } - else if (ob_modifier) + else { - if (ob_modifier == ridpointers[(int) RID_INLINE] - || ob_modifier == ridpointers[(int) RID_VIRTUAL]) - error ("`%D' can only be specified for functions", ob_modifier); - else if (ob_modifier == ridpointers[(int) RID_FRIEND]) - error ("`%D' can only be specified inside a class", ob_modifier); - else if (ob_modifier == ridpointers[(int) RID_EXPLICIT]) - error ("`%D' can only be specified for constructors", - ob_modifier); - else - error ("`%D' can only be specified for objects and functions", - ob_modifier); + if (declspecs->specs[(int)ds_inline] + || declspecs->specs[(int)ds_virtual]) + error ("%qs can only be specified for functions", + declspecs->specs[(int)ds_inline] + ? "inline" : "virtual"); + else if (saw_friend + && (!current_class_type + || current_scope () != current_class_type)) + error ("% can only be specified inside a class"); + else if (declspecs->specs[(int)ds_explicit]) + error ("% can only be specified for constructors"); + else if (declspecs->storage_class) + error ("a storage class can only be specified for objects " + "and functions"); + else if (declspecs->specs[(int)ds_const] + || declspecs->specs[(int)ds_volatile] + || declspecs->specs[(int)ds_restrict] + || declspecs->specs[(int)ds_thread]) + error ("qualifiers can only be specified for objects " + "and functions"); } return declared_type; @@ -3601,19 +3730,28 @@ check_tag_decl (tree declspecs) Otherwise, it is an error. C++: may have to grok the declspecs to learn about static, - complain for anonymous unions. + complain for anonymous unions. Returns the TYPE declared -- or NULL_TREE if none. */ tree -shadow_tag (tree declspecs) +shadow_tag (cp_decl_specifier_seq *declspecs) { tree t = check_tag_decl (declspecs); if (!t) return NULL_TREE; - maybe_process_partial_specialization (t); + if (declspecs->attributes) + { + warning (0, "attribute ignored in declaration of %q+#T", t); + warning (0, "attribute for %q+#T must follow the %qs keyword", + t, class_key_or_enum_as_string (t)); + + } + + if (maybe_process_partial_specialization (t) == error_mark_node) + return NULL_TREE; /* This is where the variables in an anonymous union are declared. An anonymous union declaration looks like: @@ -3626,8 +3764,8 @@ shadow_tag (tree declspecs) if (TYPE_FIELDS (t)) { - tree decl = grokdeclarator (NULL_TREE, declspecs, NORMAL, 0, - NULL); + tree decl = grokdeclarator (/*declarator=*/NULL, + declspecs, NORMAL, 0, NULL); finish_anon_union (decl); } } @@ -3638,15 +3776,14 @@ shadow_tag (tree declspecs) /* Decode a "typename", such as "int **", returning a ..._TYPE node. */ tree -groktypename (tree typename) +groktypename (cp_decl_specifier_seq *type_specifiers, + const cp_declarator *declarator) { - tree specs, attrs; + tree attrs; tree type; - if (TREE_CODE (typename) != TREE_LIST) - return typename; - split_specs_attrs (TREE_PURPOSE (typename), &specs, &attrs); - type = grokdeclarator (TREE_VALUE (typename), specs, - TYPENAME, 0, &attrs); + attrs = type_specifiers->attributes; + type_specifiers->attributes = NULL_TREE; + type = grokdeclarator (declarator, type_specifiers, TYPENAME, 0, &attrs); if (attrs) cplus_decl_attributes (&type, attrs, 0); return type; @@ -3668,23 +3805,19 @@ groktypename (tree typename) grokfield and not through here. */ tree -start_decl (tree declarator, - tree declspecs, - int initialized, - tree attributes, - tree prefix_attributes) +start_decl (const cp_declarator *declarator, + cp_decl_specifier_seq *declspecs, + int initialized, + tree attributes, + tree prefix_attributes, + tree *pushed_scope_p) { tree decl; tree type, tem; tree context; + bool was_public; - /* This should only be done once on the top most decl. */ - if (have_extern_spec) - { - declspecs = tree_cons (NULL_TREE, get_identifier ("extern"), - declspecs); - have_extern_spec = false; - } + *pushed_scope_p = NULL_TREE; /* An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ @@ -3698,27 +3831,22 @@ start_decl (tree declarator, deprecated_state = DEPRECATED_NORMAL; - if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE) + if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE + || decl == error_mark_node) return error_mark_node; type = TREE_TYPE (decl); - if (type == error_mark_node) - return error_mark_node; - context = DECL_CONTEXT (decl); - if (initialized && context && TREE_CODE (context) == NAMESPACE_DECL - && context != current_namespace && TREE_CODE (decl) == VAR_DECL) + if (context) { - /* When parsing the initializer, lookup should use the object's - namespace. */ - push_decl_namespace (context); - } + *pushed_scope_p = push_scope (context); - /* We are only interested in class contexts, later. */ - if (context && TREE_CODE (context) == NAMESPACE_DECL) - context = NULL_TREE; + /* We are only interested in class contexts, later. */ + if (TREE_CODE (context) == NAMESPACE_DECL) + context = NULL_TREE; + } if (initialized) /* Is it valid for this decl to have an initializer at all? @@ -3727,14 +3855,12 @@ start_decl (tree declarator, switch (TREE_CODE (decl)) { case TYPE_DECL: - error ("typedef `%D' is initialized (use __typeof__ instead)", decl); - initialized = 0; - break; + error ("typedef %qD is initialized (use __typeof__ instead)", decl); + return error_mark_node; case FUNCTION_DECL: - error ("function `%#D' is initialized like a variable", decl); - initialized = 0; - break; + error ("function %q#D is initialized like a variable", decl); + return error_mark_node; default: break; @@ -3744,91 +3870,108 @@ start_decl (tree declarator, { if (! toplevel_bindings_p () && DECL_EXTERNAL (decl)) - warning ("declaration of `%#D' has `extern' and is initialized", - decl); + warning (0, "declaration of %q#D has % and is initialized", + decl); DECL_EXTERNAL (decl) = 0; if (toplevel_bindings_p ()) TREE_STATIC (decl) = 1; - - /* Tell `pushdecl' this is an initialized decl - even though we don't yet have the initializer expression. - Also tell `cp_finish_decl' it may store the real initializer. */ - DECL_INITIAL (decl) = error_mark_node; } /* Set attributes here so if duplicate decl, will have proper attributes. */ cplus_decl_attributes (&decl, attributes, 0); + /* Dllimported symbols cannot be defined. Static data members (which + can be initialized in-class and dllimported) go through grokfield, + not here, so we don't need to exclude those decls when checking for + a definition. */ + if (initialized && DECL_DLLIMPORT_P (decl)) + { + error ("definition of %q#D is marked %", decl); + DECL_DLLIMPORT_P (decl) = 0; + } + /* If #pragma weak was used, mark the decl weak now. */ - if (global_scope_p (current_binding_level)) - maybe_apply_pragma_weak (decl); + maybe_apply_pragma_weak (decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl) && DECL_UNINLINABLE (decl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl))) - warning ("%Jinline function '%D' given attribute noinline", decl, decl); + warning (0, "inline function %q+D given attribute noinline", decl); if (context && COMPLETE_TYPE_P (complete_type (context))) { - push_nested_class (context); - if (TREE_CODE (decl) == VAR_DECL) { tree field = lookup_field (context, DECL_NAME (decl), 0, false); if (field == NULL_TREE || TREE_CODE (field) != VAR_DECL) - error ("`%#D' is not a static member of `%#T'", decl, context); + error ("%q#D is not a static member of %q#T", decl, context); else { if (DECL_CONTEXT (field) != context) { if (!same_type_p (DECL_CONTEXT (field), context)) - pedwarn ("ISO C++ does not permit `%T::%D' to be defined as `%T::%D'", + pedwarn ("ISO C++ does not permit %<%T::%D%> " + "to be defined as %<%T::%D%>", DECL_CONTEXT (field), DECL_NAME (decl), context, DECL_NAME (decl)); DECL_CONTEXT (decl) = DECL_CONTEXT (field); } + if (processing_specialization + && template_class_depth (context) == 0 + && CLASSTYPE_TEMPLATE_SPECIALIZATION (context)) + error ("template header not allowed in member definition " + "of explicitly specialized class"); /* Static data member are tricky; an in-class initialization still doesn't provide a definition, so the in-class declaration will have DECL_EXTERNAL set, but will have an initialization. Thus, duplicate_decls won't warn about this situation, and so we check here. */ - if (DECL_INITIAL (decl) && DECL_INITIAL (field)) - error ("duplicate initialization of %D", decl); - if (duplicate_decls (decl, field)) + if (initialized && DECL_INITIALIZED_IN_CLASS_P (field)) + error ("duplicate initialization of %qD", decl); + if (duplicate_decls (decl, field, /*newdecl_is_friend=*/false)) decl = field; } } else { tree field = check_classfn (context, decl, - processing_template_decl - > template_class_depth (context)); - if (field && duplicate_decls (decl, field)) + (processing_template_decl + > template_class_depth (context)) + ? current_template_parms + : NULL_TREE); + if (field && duplicate_decls (decl, field, + /*newdecl_is_friend=*/false)) decl = field; } /* cp_finish_decl sets DECL_EXTERNAL if DECL_IN_AGGR_P is set. */ DECL_IN_AGGR_P (decl) = 0; - if ((DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl)) - || CLASSTYPE_TEMPLATE_INSTANTIATION (context)) + /* Do not mark DECL as an explicit specialization if it was not + already marked as an instantiation; a declaration should + never be marked as a specialization unless we know what + template is being specialized. */ + if (DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl)) { SET_DECL_TEMPLATE_SPECIALIZATION (decl); + /* [temp.expl.spec] An explicit specialization of a static data member of a template is a definition if the declaration includes an initializer; otherwise, it is a declaration. We check for processing_specialization so this only applies to the new specialization syntax. */ - if (DECL_INITIAL (decl) == NULL_TREE && processing_specialization) + if (!initialized && processing_specialization) DECL_EXTERNAL (decl) = 1; } if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl)) - pedwarn ("declaration of `%#D' outside of class is not definition", - decl); + pedwarn ("declaration of %q#D outside of class is not definition", + decl); } + was_public = TREE_PUBLIC (decl); + /* Enter this declaration into the symbol table. */ tem = maybe_push_decl (decl); @@ -3837,32 +3980,48 @@ start_decl (tree declarator, if (tem == error_mark_node) return error_mark_node; -#if ! defined (ASM_OUTPUT_BSS) && ! defined (ASM_OUTPUT_ALIGNED_BSS) /* Tell the back-end to use or not use .common as appropriate. If we say -fconserve-space, we want this to save .data space, at the expense of wrong semantics. If we say -fno-conserve-space, we want this to produce errors about redefs; to do this we force variables into the data segment. */ - DECL_COMMON (tem) = ((TREE_CODE (tem) != VAR_DECL - || !DECL_THREAD_LOCAL (tem)) - && (flag_conserve_space || ! TREE_PUBLIC (tem))); -#endif + if (flag_conserve_space + && TREE_CODE (tem) == VAR_DECL + && TREE_PUBLIC (tem) + && !DECL_THREAD_LOCAL_P (tem) + && !have_global_bss_p ()) + DECL_COMMON (tem) = 1; - if (! processing_template_decl) - start_decl_1 (tem); + if (TREE_CODE (tem) == VAR_DECL + && DECL_NAMESPACE_SCOPE_P (tem) && !TREE_PUBLIC (tem) && !was_public + && !DECL_THIS_STATIC (tem) && !DECL_ARTIFICIAL (tem)) + { + /* This is a const variable with implicit 'static'. Set + DECL_THIS_STATIC so we can tell it from variables that are + !TREE_PUBLIC because of the anonymous namespace. */ + gcc_assert (cp_type_readonly (TREE_TYPE (tem))); + DECL_THIS_STATIC (tem) = 1; + } + + if (!processing_template_decl && TREE_CODE (tem) == VAR_DECL) + start_decl_1 (tem, initialized); return tem; } void -start_decl_1 (tree decl) +start_decl_1 (tree decl, bool initialized) { - tree type = TREE_TYPE (decl); - int initialized = (DECL_INITIAL (decl) != NULL_TREE); + tree type; - if (type == error_mark_node) + gcc_assert (!processing_template_decl); + + if (error_operand_p (decl)) return; + gcc_assert (TREE_CODE (decl) == VAR_DECL); + type = TREE_TYPE (decl); + if (initialized) /* Is it valid for this decl to have an initializer at all? If not, set INITIALIZED to zero, which will indirectly @@ -3874,31 +4033,24 @@ start_decl_1 (tree decl) ; /* A complete type is ok. */ else if (TREE_CODE (type) != ARRAY_TYPE) { - error ("variable `%#D' has initializer but incomplete type", - decl); + error ("variable %q#D has initializer but incomplete type", decl); initialized = 0; type = TREE_TYPE (decl) = error_mark_node; } else if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (type)))) { if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)) - error ("elements of array `%#D' have incomplete type", decl); + error ("elements of array %q#D have incomplete type", decl); /* else we already gave an error in start_decl. */ initialized = 0; } } - - if (!initialized - && TREE_CODE (decl) != TYPE_DECL - && TREE_CODE (decl) != TEMPLATE_DECL - && type != error_mark_node - && IS_AGGR_TYPE (type) - && ! DECL_EXTERNAL (decl)) + else if (IS_AGGR_TYPE (type) + && ! DECL_EXTERNAL (decl)) { - if ((! processing_template_decl || ! uses_template_parms (type)) - && !COMPLETE_TYPE_P (complete_type (type))) + if (!COMPLETE_TYPE_P (complete_type (type))) { - error ("aggregate `%#D' has incomplete type and cannot be defined", + error ("aggregate %q#D has incomplete type and cannot be defined", decl); /* Change the type so that assemble_variable will give DECL an rtl we can live with: (mem (const_int 0)). */ @@ -3916,9 +4068,6 @@ start_decl_1 (tree decl) } } - if (! initialized) - DECL_INITIAL (decl) = NULL_TREE; - /* Create a new scope to hold this declaration if necessary. Whether or not a new scope is necessary cannot be determined until after the type has been completed; if the type is a @@ -3948,22 +4097,20 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) if ((DECL_LANG_SPECIFIC (decl) == 0 || DECL_IN_AGGR_P (decl) == 0) && ! DECL_THIS_EXTERN (decl)) - error ("`%D' declared as reference but not initialized", decl); + error ("%qD declared as reference but not initialized", decl); return NULL_TREE; } if (TREE_CODE (init) == CONSTRUCTOR) { - error ("ISO C++ forbids use of initializer list to initialize reference `%D'", decl); + error ("ISO C++ forbids use of initializer list to " + "initialize reference %qD", decl); return NULL_TREE; } if (TREE_CODE (init) == TREE_LIST) init = build_x_compound_expr_from_list (init, "initializer"); - if (TREE_CODE (TREE_TYPE (init)) == REFERENCE_TYPE) - init = convert_from_reference (init); - if (TREE_CODE (TREE_TYPE (type)) != ARRAY_TYPE && TREE_CODE (TREE_TYPE (init)) == ARRAY_TYPE) /* Note: default conversion is only called in very special cases. */ @@ -3971,8 +4118,8 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) /* Convert INIT to the reference type TYPE. This may involve the creation of a temporary, whose lifetime must be the same as that - of the reference. If so, a DECL_STMT for the temporary will be - added just after the DECL_STMT for DECL. That's why we don't set + of the reference. If so, a DECL_EXPR for the temporary will be + added just after the DECL_EXPR for DECL. That's why we don't set DECL_INITIAL for local references (instead assigning to them explicitly); we need to allow the temporary to be initialized first. */ @@ -3982,7 +4129,7 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) return NULL_TREE; else if (tmp == NULL_TREE) { - error ("cannot initialize `%T' from `%T'", type, TREE_TYPE (init)); + error ("cannot initialize %qT from %qT", type, TREE_TYPE (init)); return NULL_TREE; } @@ -3994,6 +4141,30 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) return NULL_TREE; } +/* Designated initializers in arrays are not supported in GNU C++. + The parser cannot detect this error since it does not know whether + a given brace-enclosed initializer is for a class type or for an + array. This function checks that CE does not use a designated + initializer. If it does, an error is issued. Returns true if CE + is valid, i.e., does not have a designated initializer. */ + +static bool +check_array_designated_initializer (const constructor_elt *ce) +{ + /* Designated initializers for array elements arenot supported. */ + if (ce->index) + { + /* The parser only allows identifiers as designated + intializers. */ + gcc_assert (TREE_CODE (ce->index) == IDENTIFIER_NODE); + error ("name %qD used in a GNU-style designated " + "initializer for an array", ce->index); + return false; + } + + return true; +} + /* When parsing `int a[] = {1, 2};' we don't know the size of the array until we finish parsing the initializer. If that's the situation we're in, update DECL accordingly. */ @@ -4011,27 +4182,55 @@ maybe_deduce_size_from_array_init (tree decl, tree init) But let's leave it here to ease the eventual merge. */ int do_default = !DECL_EXTERNAL (decl); tree initializer = init ? init : DECL_INITIAL (decl); - int failure = complete_array_type (type, initializer, do_default); + int failure = 0; - if (failure == 1) - error ("initializer fails to determine size of `%D'", decl); - - if (failure == 2) + /* Check that there are no designated initializers in INIT, as + those are not supported in GNU C++, and as the middle-end + will crash if presented with a non-numeric designated + initializer. */ + if (initializer && TREE_CODE (initializer) == CONSTRUCTOR) { - if (do_default) - error ("array size missing in `%D'", decl); - /* If a `static' var's size isn't known, make it extern as - well as static, so it does not get allocated. If it's not - `static', then don't mark it extern; finish_incomplete_decl - will give it a default size and it will get allocated. */ - else if (!pedantic && TREE_STATIC (decl) && !TREE_PUBLIC (decl)) - DECL_EXTERNAL (decl) = 1; + VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initializer); + constructor_elt *ce; + HOST_WIDE_INT i; + for (i = 0; + VEC_iterate (constructor_elt, v, i, ce); + ++i) + if (!check_array_designated_initializer (ce)) + failure = 1; } - if (pedantic && TYPE_DOMAIN (type) != NULL_TREE - && tree_int_cst_lt (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), - integer_zero_node)) - error ("zero-size array `%D'", decl); + if (!failure) + { + failure = cp_complete_array_type (&TREE_TYPE (decl), initializer, + do_default); + if (failure == 1) + { + error ("initializer fails to determine size of %qD", decl); + TREE_TYPE (decl) = error_mark_node; + } + else if (failure == 2) + { + if (do_default) + { + error ("array size missing in %qD", decl); + TREE_TYPE (decl) = error_mark_node; + } + /* If a `static' var's size isn't known, make it extern as + well as static, so it does not get allocated. If it's not + `static', then don't mark it extern; finish_incomplete_decl + will give it a default size and it will get allocated. */ + else if (!pedantic && TREE_STATIC (decl) && !TREE_PUBLIC (decl)) + DECL_EXTERNAL (decl) = 1; + } + else if (failure == 3) + { + error ("zero-size array %qD", decl); + TREE_TYPE (decl) = error_mark_node; + } + } + + cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl); layout_decl (decl, 0); } @@ -4043,10 +4242,11 @@ maybe_deduce_size_from_array_init (tree decl, tree init) static void layout_var_decl (tree decl) { - tree type = TREE_TYPE (decl); -#if 0 - tree ttype = target_type (type); -#endif + tree type; + + type = TREE_TYPE (decl); + if (type == error_mark_node) + return; /* If we haven't already layed out this declaration, do so now. Note that we must not call complete type for an external object @@ -4055,10 +4255,10 @@ layout_var_decl (tree decl) `extern X x' for some incomplete type `X'.) */ if (!DECL_EXTERNAL (decl)) complete_type (type); - if (!DECL_SIZE (decl) + if (!DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node && (COMPLETE_TYPE_P (type) - || (TREE_CODE (type) == ARRAY_TYPE + || (TREE_CODE (type) == ARRAY_TYPE && !TYPE_DOMAIN (type) && COMPLETE_TYPE_P (TREE_TYPE (type))))) layout_decl (decl, 0); @@ -4068,7 +4268,7 @@ layout_var_decl (tree decl) /* An automatic variable with an incomplete type: that is an error. Don't talk about array types here, since we took care of that message in grokdeclarator. */ - error ("storage size of `%D' isn't known", decl); + error ("storage size of %qD isn't known", decl); TREE_TYPE (decl) = error_mark_node; } #if 0 @@ -4090,14 +4290,8 @@ layout_var_decl (tree decl) if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) constant_expression_warning (DECL_SIZE (decl)); else - error ("storage size of `%D' isn't constant", decl); + error ("storage size of %qD isn't constant", decl); } - - if (TREE_STATIC (decl) - && !DECL_ARTIFICIAL (decl) - && current_function_decl - && DECL_CONTEXT (decl) == current_function_decl) - push_local_name (decl); } /* If a local static variable is declared in an inline function, or if @@ -4115,7 +4309,7 @@ maybe_commonize_var (tree decl) && DECL_FUNCTION_SCOPE_P (decl) /* Unfortunately, import_export_decl has not always been called before the function is processed, so we cannot simply check - DECL_COMDAT. */ + DECL_COMDAT. */ && (DECL_COMDAT (DECL_CONTEXT (decl)) || ((DECL_DECLARED_INLINE_P (DECL_CONTEXT (decl)) || DECL_TEMPLATE_INSTANTIATION (DECL_CONTEXT (decl))) @@ -4145,8 +4339,11 @@ maybe_commonize_var (tree decl) be merged. */ TREE_PUBLIC (decl) = 0; DECL_COMMON (decl) = 0; - cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl); - warning ("%J you can work around this by removing the initializer", + warning (0, "sorry: semantics of inline function static " + "data %q+#D are wrong (you'll wind up " + "with multiple copies)", decl); + warning (0, "%J you can work around this by removing " + "the initializer", decl); } } @@ -4172,9 +4369,21 @@ check_for_uninitialized_const_var (tree decl) && CP_TYPE_CONST_P (type) && !TYPE_NEEDS_CONSTRUCTING (type) && !DECL_INITIAL (decl)) - error ("uninitialized const `%D'", decl); + error ("uninitialized const %qD", decl); } + +/* Structure holding the current initializer being processed by reshape_init. + CUR is a pointer to the current element being processed, END is a pointer + after the last element present in the initializer. */ +typedef struct reshape_iterator_t +{ + constructor_elt *cur; + constructor_elt *end; +} reshape_iter; + +static tree reshape_init_r (tree, reshape_iter *, bool); + /* FIELD is a FIELD_DECL or NULL. In the former case, the value returned is the next FIELD_DECL (possibly FIELD itself) that can be initialized. If there are no more such fields, the return value @@ -4192,132 +4401,204 @@ next_initializable_field (tree field) return field; } -/* Subroutine of reshape_init. Reshape the constructor for an array. INITP - is the pointer to the old constructor list (to the CONSTRUCTOR_ELTS of - the CONSTRUCTOR we are processing), while NEW_INIT is the CONSTRUCTOR we - are building. - ELT_TYPE is the element type of the array. MAX_INDEX is an INTEGER_CST - representing the size of the array minus one (the maximum index), or - NULL_TREE if the array was declared without specifying the size. */ +/* Subroutine of reshape_init_array and reshape_init_vector, which does + the actual work. ELT_TYPE is the element type of the array. MAX_INDEX is an + INTEGER_CST representing the size of the array minus one (the maximum index), + or NULL_TREE if the array was declared without specifying the size. D is + the iterator within the constructor. */ -static bool -reshape_init_array (tree elt_type, tree max_index, - tree *initp, tree new_init) +static tree +reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d) { + tree new_init; bool sized_array_p = (max_index != NULL_TREE); unsigned HOST_WIDE_INT max_index_cst = 0; unsigned HOST_WIDE_INT index; + /* The initializer for an array is always a CONSTRUCTOR. */ + new_init = build_constructor (NULL_TREE, NULL); + if (sized_array_p) { + /* Minus 1 is used for zero sized arrays. */ + if (integer_all_onesp (max_index)) + return new_init; + if (host_integerp (max_index, 1)) max_index_cst = tree_low_cst (max_index, 1); /* sizetype is sign extended, not zero extended. */ else - max_index_cst = tree_low_cst (convert (size_type_node, max_index), 1); + max_index_cst = tree_low_cst (fold_convert (size_type_node, max_index), + 1); } /* Loop until there are no more initializers. */ for (index = 0; - *initp && (!sized_array_p || index <= max_index_cst); + d->cur != d->end && (!sized_array_p || index <= max_index_cst); ++index) { - tree element_init; - tree designated_index; + tree elt_init; - element_init = reshape_init (elt_type, initp); - if (element_init == error_mark_node) - return false; - TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init); - CONSTRUCTOR_ELTS (new_init) = element_init; - designated_index = TREE_PURPOSE (element_init); - if (designated_index) - { - /* Handle array designated initializers (GNU extension). */ - if (TREE_CODE (designated_index) == IDENTIFIER_NODE) - { - error ("name `%D' used in a GNU-style designated " - "initializer for an array", designated_index); - TREE_PURPOSE (element_init) = NULL_TREE; - } - else - abort (); - } + check_array_designated_initializer (d->cur); + elt_init = reshape_init_r (elt_type, d, /*first_initializer_p=*/false); + if (elt_init == error_mark_node) + return error_mark_node; + CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init), NULL_TREE, elt_init); } - return true; + return new_init; } -/* Undo the brace-elision allowed by [dcl.init.aggr] in a - brace-enclosed aggregate initializer. - - *INITP is one of a list of initializers describing a brace-enclosed - initializer for an entity of the indicated aggregate TYPE. It may - not presently match the shape of the TYPE; for example: - - struct S { int a; int b; }; - struct S a[] = { 1, 2, 3, 4 }; - - Here *INITP will point to TREE_LIST of four elements, rather than a - list of two elements, each itself a list of two elements. This - routine transforms INIT from the former form into the latter. The - revised initializer is returned. */ +/* Subroutine of reshape_init_r, processes the initializers for arrays. + Parameters are the same of reshape_init_r. */ static tree -reshape_init (tree type, tree *initp) +reshape_init_array (tree type, reshape_iter *d) { - tree inits; - tree old_init; - tree old_init_value; + tree max_index = NULL_TREE; + + gcc_assert (TREE_CODE (type) == ARRAY_TYPE); + + if (TYPE_DOMAIN (type)) + max_index = array_type_nelts (type); + + return reshape_init_array_1 (TREE_TYPE (type), max_index, d); +} + +/* Subroutine of reshape_init_r, processes the initializers for vectors. + Parameters are the same of reshape_init_r. */ + +static tree +reshape_init_vector (tree type, reshape_iter *d) +{ + tree max_index = NULL_TREE; + tree rtype; + + gcc_assert (TREE_CODE (type) == VECTOR_TYPE); + + if (COMPOUND_LITERAL_P (d->cur->value)) + { + tree value = d->cur->value; + if (!same_type_p (TREE_TYPE (value), type)) + { + error ("invalid type %qT as initializer for a vector of type %qT", + TREE_TYPE (d->cur->value), type); + value = error_mark_node; + } + ++d->cur; + return value; + } + + /* For a vector, the representation type is a struct + containing a single member which is an array of the + appropriate size. */ + rtype = TYPE_DEBUG_REPRESENTATION_TYPE (type); + if (rtype && TYPE_DOMAIN (TREE_TYPE (TYPE_FIELDS (rtype)))) + max_index = array_type_nelts (TREE_TYPE (TYPE_FIELDS (rtype))); + + return reshape_init_array_1 (TREE_TYPE (type), max_index, d); +} + +/* Subroutine of reshape_init_r, processes the initializers for classes + or union. Parameters are the same of reshape_init_r. */ + +static tree +reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p) +{ + tree field; tree new_init; - bool brace_enclosed_p; - bool string_init_p; - old_init = *initp; - old_init_value = (TREE_CODE (*initp) == TREE_LIST - ? TREE_VALUE (*initp) : old_init); + gcc_assert (CLASS_TYPE_P (type)); - my_friendly_assert (old_init_value, 20030723); + /* The initializer for a class is always a CONSTRUCTOR. */ + new_init = build_constructor (NULL_TREE, NULL); + field = next_initializable_field (TYPE_FIELDS (type)); - /* If the initializer is brace-enclosed, pull initializers from the - enclosed elements. Advance past the brace-enclosed initializer - now. */ - if (TREE_CODE (old_init_value) == CONSTRUCTOR - && TREE_TYPE (old_init_value) == NULL_TREE - && TREE_HAS_CONSTRUCTOR (old_init_value)) + if (!field) { - *initp = TREE_CHAIN (old_init); - TREE_CHAIN (old_init) = NULL_TREE; - inits = CONSTRUCTOR_ELTS (old_init_value); - initp = &inits; - brace_enclosed_p = true; + /* [dcl.init.aggr] + + An initializer for an aggregate member that is an + empty class shall have the form of an empty + initializer-list {}. */ + if (!first_initializer_p) + { + error ("initializer for %qT must be brace-enclosed", type); + return error_mark_node; + } + return new_init; } - else + + /* Loop through the initializable fields, gathering initializers. */ + while (d->cur != d->end) { - inits = NULL_TREE; - brace_enclosed_p = false; + tree field_init; + + /* Handle designated initializers, as an extension. */ + if (d->cur->index) + { + field = lookup_field_1 (type, d->cur->index, /*want_type=*/false); + + if (!field || TREE_CODE (field) != FIELD_DECL) + { + error ("%qT has no non-static data member named %qD", type, + d->cur->index); + return error_mark_node; + } + } + + /* If we processed all the member of the class, we are done. */ + if (!field) + break; + + field_init = reshape_init_r (TREE_TYPE (field), d, + /*first_initializer_p=*/false); + CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init), field, field_init); + + /* [dcl.init.aggr] + + When a union is initialized with a brace-enclosed + initializer, the braces shall only contain an + initializer for the first member of the union. */ + if (TREE_CODE (type) == UNION_TYPE) + break; + + field = next_initializable_field (TREE_CHAIN (field)); } + return new_init; +} + +/* Subroutine of reshape_init, which processes a single initializer (part of + a CONSTRUCTOR). TYPE is the type of the variable being initialized, D is the + iterator within the CONSTRUCTOR which points to the initializer to process. + FIRST_INITIALIZER_P is true if this is the first initializer of the + CONSTRUCTOR node. */ + +static tree +reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p) +{ + tree init = d->cur->value; + /* A non-aggregate type is always initialized with a single initializer. */ if (!CP_AGGREGATE_TYPE_P (type)) - { - *initp = TREE_CHAIN (old_init); - TREE_CHAIN (old_init) = NULL_TREE; - /* It is invalid to initialize a non-aggregate type with a - brace-enclosed initializer. */ - if (brace_enclosed_p) - { - error ("brace-enclosed initializer used to initialize `%T'", - type); - if (TREE_CODE (old_init) == TREE_LIST) - TREE_VALUE (old_init) = error_mark_node; - else - old_init = error_mark_node; - } - - return old_init; - } + { + /* It is invalid to initialize a non-aggregate type with a + brace-enclosed initializer. + We need to check for BRACE_ENCLOSED_INITIALIZER_P here because + of g++.old-deja/g++.mike/p7626.C: a pointer-to-member constant is + a CONSTRUCTOR (with a record type). */ + if (TREE_CODE (init) == CONSTRUCTOR + && BRACE_ENCLOSED_INITIALIZER_P (init)) /* p7626.C */ + { + error ("braces around scalar initializer for type %qT", type); + init = error_mark_node; + } + + d->cur++; + return init; + } /* [dcl.init.aggr] @@ -4328,127 +4609,130 @@ reshape_init (tree type, tree *initp) non-empty subaggregate, brace elision is assumed and the initializer is considered for the initialization of the first member of the subaggregate. */ - if (!brace_enclosed_p - && can_convert_arg (type, TREE_TYPE (old_init_value), old_init_value)) + if (TREE_CODE (init) != CONSTRUCTOR + && can_convert_arg (type, TREE_TYPE (init), init, LOOKUP_NORMAL)) { - *initp = TREE_CHAIN (old_init); - TREE_CHAIN (old_init) = NULL_TREE; - return old_init; + d->cur++; + return init; } - string_init_p = false; - if (TREE_CODE (old_init_value) == STRING_CST - && TREE_CODE (type) == ARRAY_TYPE + /* [dcl.init.string] + + A char array (whether plain char, signed char, or unsigned char) + can be initialized by a string-literal (optionally enclosed in + braces); a wchar_t array can be initialized by a wide + string-literal (optionally enclosed in braces). */ + if (TREE_CODE (type) == ARRAY_TYPE && char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type)))) { - /* [dcl.init.string] + tree str_init = init; - A char array (whether plain char, signed char, or unsigned char) - can be initialized by a string-literal (optionally enclosed in - braces); a wchar_t array can be initialized by a wide - string-literal (optionally enclosed in braces). */ - new_init = old_init; - /* Move past the initializer. */ - *initp = TREE_CHAIN (old_init); - TREE_CHAIN (old_init) = NULL_TREE; - string_init_p = true; - } - else - { - /* Build a CONSTRUCTOR to hold the contents of the aggregate. */ - new_init = build_constructor (type, NULL_TREE); - TREE_HAS_CONSTRUCTOR (new_init) = 1; - - if (CLASS_TYPE_P (type)) + /* Strip one level of braces if and only if they enclose a single + element (as allowed by [dcl.init.string]). */ + if (!first_initializer_p + && TREE_CODE (str_init) == CONSTRUCTOR + && VEC_length (constructor_elt, CONSTRUCTOR_ELTS (str_init)) == 1) { - tree field; + str_init = VEC_index (constructor_elt, + CONSTRUCTOR_ELTS (str_init), 0)->value; + } - field = next_initializable_field (TYPE_FIELDS (type)); + /* If it's a string literal, then it's the initializer for the array + as a whole. Otherwise, continue with normal initialization for + array types (one value per array element). */ + if (TREE_CODE (str_init) == STRING_CST) + { + d->cur++; + return str_init; + } + } - if (!field) - { - /* [dcl.init.aggr] - - An initializer for an aggregate member that is an - empty class shall have the form of an empty - initializer-list {}. */ - if (!brace_enclosed_p) - { - error ("initializer for `%T' must be brace-enclosed", - type); - return error_mark_node; - } - } + /* The following cases are about aggregates. If we are not within a full + initializer already, and there is not a CONSTRUCTOR, it means that there + is a missing set of braces (that is, we are processing the case for + which reshape_init exists). */ + if (!first_initializer_p) + { + if (TREE_CODE (init) == CONSTRUCTOR) + { + if (TREE_TYPE (init) && TYPE_PTRMEMFUNC_P (TREE_TYPE (init))) + /* There is no need to reshape pointer-to-member function + initializers, as they are always constructed correctly + by the front end. */ + ; + else if (COMPOUND_LITERAL_P (init)) + /* For a nested compound literal, there is no need to reshape since + brace elision is not allowed. Even if we decided to allow it, + we should add a call to reshape_init in finish_compound_literal, + before calling digest_init, so changing this code would still + not be necessary. */ + gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (init)); else { - /* Loop through the initializable fields, gathering - initializers. */ - while (*initp) - { - tree field_init; - - /* Handle designated initializers, as an extension. */ - if (TREE_PURPOSE (*initp)) - { - if (pedantic) - pedwarn ("ISO C++ does not allow designated initializers"); - field = lookup_field_1 (type, TREE_PURPOSE (*initp), - /*want_type=*/false); - if (!field || TREE_CODE (field) != FIELD_DECL) - error ("`%T' has no non-static data member named `%D'", - type, TREE_PURPOSE (*initp)); - } - if (!field) - break; - - field_init = reshape_init (TREE_TYPE (field), initp); - if (field_init == error_mark_node) - return error_mark_node; - TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init); - CONSTRUCTOR_ELTS (new_init) = field_init; - /* [dcl.init.aggr] - - When a union is initialized with a brace-enclosed - initializer, the braces shall only contain an - initializer for the first member of the union. */ - if (TREE_CODE (type) == UNION_TYPE) - break; - field = next_initializable_field (TREE_CHAIN (field)); - } + ++d->cur; + gcc_assert (BRACE_ENCLOSED_INITIALIZER_P (init)); + return reshape_init (type, init); } } - else if ((TREE_CODE (type) == ARRAY_TYPE)|| (TREE_CODE (type) == VECTOR_TYPE)) - { - tree max_index; - /* If the bound of the array is known, take no more initializers - than are allowed. */ - max_index = ((TYPE_DOMAIN (type) && (TREE_CODE (type) == ARRAY_TYPE)) - ? array_type_nelts (type) : NULL_TREE); - if (!reshape_init_array (TREE_TYPE (type), max_index, - initp, new_init)) - return error_mark_node; - } - else - abort (); - - /* The initializers were placed in reverse order in the - CONSTRUCTOR. */ - CONSTRUCTOR_ELTS (new_init) = nreverse (CONSTRUCTOR_ELTS (new_init)); - - if (TREE_CODE (old_init) == TREE_LIST) - new_init = build_tree_list (TREE_PURPOSE (old_init), new_init); + warning (OPT_Wmissing_braces, "missing braces around initializer for %qT", + type); } - /* If there are more initializers than necessary, issue a - diagnostic. */ - if (*initp) - { - if (brace_enclosed_p) - error ("too many initializers for `%T'", type); - else if (warn_missing_braces && !string_init_p) - warning ("missing braces around initializer"); - } + /* Dispatch to specialized routines. */ + if (CLASS_TYPE_P (type)) + return reshape_init_class (type, d, first_initializer_p); + else if (TREE_CODE (type) == ARRAY_TYPE) + return reshape_init_array (type, d); + else if (TREE_CODE (type) == VECTOR_TYPE) + return reshape_init_vector (type, d); + else + gcc_unreachable(); +} + +/* Undo the brace-elision allowed by [dcl.init.aggr] in a + brace-enclosed aggregate initializer. + + INIT is the CONSTRUCTOR containing the list of initializers describing + a brace-enclosed initializer for an entity of the indicated aggregate TYPE. + It may not presently match the shape of the TYPE; for example: + + struct S { int a; int b; }; + struct S a[] = { 1, 2, 3, 4 }; + + Here INIT will hold a VEC of four elements, rather than a + VEC of two elements, each itself a VEC of two elements. This + routine transforms INIT from the former form into the latter. The + revised CONSTRUCTOR node is returned. */ + +tree +reshape_init (tree type, tree init) +{ + VEC(constructor_elt, gc) *v; + reshape_iter d; + tree new_init; + + gcc_assert (BRACE_ENCLOSED_INITIALIZER_P (init)); + + v = CONSTRUCTOR_ELTS (init); + + /* An empty constructor does not need reshaping, and it is always a valid + initializer. */ + if (VEC_empty (constructor_elt, v)) + return init; + + /* Recurse on this CONSTRUCTOR. */ + d.cur = VEC_index (constructor_elt, v, 0); + d.end = d.cur + VEC_length (constructor_elt, v); + + new_init = reshape_init_r (type, &d, true); + if (new_init == error_mark_node) + return error_mark_node; + + /* Make sure all the element of the constructor were used. Otherwise, + issue an error about exceeding initializers. */ + if (d.cur != d.end) + error ("too many initializers for %qT", type); return new_init; } @@ -4466,68 +4750,74 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) tree type = TREE_TYPE (decl); tree init_code = NULL; - /* If `start_decl' didn't like having an initialization, ignore it now. */ - if (init != NULL_TREE && DECL_INITIAL (decl) == NULL_TREE) - init = NULL_TREE; - - /* If an initializer is present, DECL_INITIAL has been - error_mark_node, to indicate that an as-of-yet unevaluated - initialization will occur. From now on, DECL_INITIAL reflects - the static initialization -- if any -- of DECL. */ - DECL_INITIAL (decl) = NULL_TREE; - /* Things that are going to be initialized need to have complete type. */ TREE_TYPE (decl) = type = complete_type (TREE_TYPE (decl)); if (type == error_mark_node) /* We will have already complained. */ - init = NULL_TREE; - else if (init && COMPLETE_TYPE_P (type) - && !TREE_CONSTANT (TYPE_SIZE (type))) + return NULL_TREE; + + if (TREE_CODE (type) == ARRAY_TYPE) { - error ("variable-sized object `%D' may not be initialized", decl); - init = NULL_TREE; + tree element_type = TREE_TYPE (type); + + /* The array type itself need not be complete, because the + initializer may tell us how many elements are in the array. + But, the elements of the array must be complete. */ + if (!COMPLETE_TYPE_P (complete_type (element_type))) + { + error ("elements of array %q#D have incomplete type", decl); + return NULL_TREE; + } + /* It is not valid to initialize an a VLA. */ + if (init + && ((COMPLETE_TYPE_P (type) && !TREE_CONSTANT (TYPE_SIZE (type))) + || !TREE_CONSTANT (TYPE_SIZE (element_type)))) + { + error ("variable-sized object %qD may not be initialized", decl); + return NULL_TREE; + } } - else if (TREE_CODE (type) == ARRAY_TYPE - && !COMPLETE_TYPE_P (complete_type (TREE_TYPE (type)))) + else if (!COMPLETE_TYPE_P (type)) { - error ("elements of array `%#D' have incomplete type", decl); - init = NULL_TREE; - } - else if (TREE_CODE (type) != ARRAY_TYPE && !COMPLETE_TYPE_P (type)) - { - error ("`%D' has incomplete type", decl); + error ("%qD has incomplete type", decl); TREE_TYPE (decl) = error_mark_node; - init = NULL_TREE; + return NULL_TREE; + } + else + /* There is no way to make a variable-sized class type in GNU C++. */ + gcc_assert (TREE_CONSTANT (TYPE_SIZE (type))); + + if (!CP_AGGREGATE_TYPE_P (type) + && init && BRACE_ENCLOSED_INITIALIZER_P (init) + && VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)) != 1) + { + error ("scalar object %qD requires one element in initializer", decl); + TREE_TYPE (decl) = error_mark_node; + return NULL_TREE; } if (TREE_CODE (decl) == CONST_DECL) { - my_friendly_assert (TREE_CODE (decl) != REFERENCE_TYPE, 148); + gcc_assert (TREE_CODE (type) != REFERENCE_TYPE); DECL_INITIAL (decl) = init; - my_friendly_assert (init != NULL_TREE, 149); + gcc_assert (init != NULL_TREE); init = NULL_TREE; } else if (!DECL_EXTERNAL (decl) && TREE_CODE (type) == REFERENCE_TYPE) init = grok_reference_init (decl, type, init, cleanup); else if (init) { - if (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init)) + /* Do not reshape constructors of vectors (they don't need to be + reshaped. */ + if (TREE_CODE (init) == CONSTRUCTOR + && !COMPOUND_LITERAL_P (init) + && !TREE_TYPE (init)) /* ptrmemfunc */ { - /* [dcl.init] paragraph 13, - If T is a scalar type, then a declaration of the form - T x = { a }; - is equivalent to - T x = a; - - reshape_init will complain about the extra braces, - and doesn't do anything useful in the case where TYPE is - scalar, so just don't call it. */ - if (CP_AGGREGATE_TYPE_P (type)) - init = reshape_init (type, &init); + init = reshape_init (type, init); if ((*targetm.vector_opaque_p) (type)) { @@ -4540,19 +4830,19 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) array size from the initializer. */ maybe_deduce_size_from_array_init (decl, init); type = TREE_TYPE (decl); - if (TREE_CODE (init) == CONSTRUCTOR && TREE_HAS_CONSTRUCTOR (init)) - TREE_TYPE (init) = type; + if (type == error_mark_node) + return NULL_TREE; if (TYPE_HAS_CONSTRUCTOR (type) || TYPE_NEEDS_CONSTRUCTING (type)) { if (TREE_CODE (type) == ARRAY_TYPE) goto initialize_aggr; - else if (TREE_CODE (init) == CONSTRUCTOR - && TREE_HAS_CONSTRUCTOR (init)) + else if (TREE_CODE (init) == CONSTRUCTOR) { if (TYPE_NON_AGGREGATE_CLASS (type)) { - error ("`%D' must be initialized by constructor, not by `{...}'", + error ("%qD must be initialized by constructor, " + "not by %<{...}%>", decl); init = error_mark_node; } @@ -4583,6 +4873,12 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) if (TREE_CODE (init) != TREE_VEC) { init_code = store_init_value (decl, init); + if (pedantic && TREE_CODE (type) == ARRAY_TYPE + && DECL_INITIAL (decl) + && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST + && PAREN_STRING_LITERAL_P (DECL_INITIAL (decl))) + warning (0, "array %qD initialized by parenthesized string literal %qE", + decl, DECL_INITIAL (decl)); init = NULL; } } @@ -4596,10 +4892,9 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) tree core_type = strip_array_types (type); if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)) - error ("structure `%D' with uninitialized const members", decl); + error ("structure %qD with uninitialized const members", decl); if (CLASSTYPE_REF_FIELDS_NEED_INIT (core_type)) - error ("structure `%D' with uninitialized reference members", - decl); + error ("structure %qD with uninitialized reference members", decl); check_for_uninitialized_const_var (decl); } @@ -4607,7 +4902,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) check_for_uninitialized_const_var (decl); if (init && init != error_mark_node) - init_code = build (INIT_EXPR, type, decl, init); + init_code = build2 (INIT_EXPR, type, decl, init); return init_code; } @@ -4619,11 +4914,32 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) { int toplev = toplevel_bindings_p (); int defer_p; + const char *filename; + + /* Set the DECL_ASSEMBLER_NAME for the object. */ + if (asmspec) + { + /* The `register' keyword, when used together with an + asm-specification, indicates that the variable should be + placed in a particular register. */ + if (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)) + { + set_user_assembler_name (decl, asmspec); + DECL_HARD_REGISTER (decl) = 1; + } + else + { + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) + set_builtin_user_assembler_name (decl, asmspec); + set_user_assembler_name (decl, asmspec); + } + } /* Handle non-variables up front. */ if (TREE_CODE (decl) != VAR_DECL) { - rest_of_decl_compilation (decl, asmspec, toplev, at_eof); + rest_of_decl_compilation (decl, toplev, at_eof); return; } @@ -4631,22 +4947,11 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) member. */ if (DECL_LANG_SPECIFIC (decl) && DECL_IN_AGGR_P (decl)) { - my_friendly_assert (TREE_STATIC (decl), 19990828); + gcc_assert (TREE_STATIC (decl)); /* An in-class declaration of a static data member should be external; it is only a declaration, and not a definition. */ if (init == NULL_TREE) - my_friendly_assert (DECL_EXTERNAL (decl), 20000723); - } - - /* Set the DECL_ASSEMBLER_NAME for the variable. */ - if (asmspec) - { - change_decl_assembler_name (decl, get_identifier (asmspec)); - /* The `register' keyword, when used together with an - asm-specification, indicates that the variable should be - placed in a particular register. */ - if (DECL_REGISTER (decl)) - DECL_C_HARD_REGISTER (decl) = 1; + gcc_assert (DECL_EXTERNAL (decl)); } /* We don't create any RTL for local variables. */ @@ -4654,43 +4959,40 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) return; /* We defer emission of local statics until the corresponding - DECL_STMT is expanded. */ + DECL_EXPR is expanded. */ defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl); /* We try to defer namespace-scope static constants so that they are not emitted into the object file unnecessarily. */ + filename = input_filename; if (!DECL_VIRTUAL_P (decl) && TREE_READONLY (decl) && DECL_INITIAL (decl) != NULL_TREE && DECL_INITIAL (decl) != error_mark_node + && filename != NULL && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) && toplev && !TREE_PUBLIC (decl)) { /* Fool with the linkage of static consts according to #pragma interface. */ - if (!interface_unknown && !TREE_PUBLIC (decl)) + struct c_fileinfo *finfo = get_fileinfo (filename); + if (!finfo->interface_unknown && !TREE_PUBLIC (decl)) { TREE_PUBLIC (decl) = 1; - DECL_EXTERNAL (decl) = interface_only; + DECL_EXTERNAL (decl) = finfo->interface_only; } defer_p = 1; } /* Likewise for template instantiations. */ - else if (DECL_COMDAT (decl)) + else if (DECL_LANG_SPECIFIC (decl) + && DECL_IMPLICIT_INSTANTIATION (decl)) defer_p = 1; - /* If we're deferring the variable, we only need to make RTL if - there's an ASMSPEC. Otherwise, we'll lazily create it later when - we need it. (There's no way to lazily create RTL for things that - have assembly specs because the information about the specifier - isn't stored in the tree, yet) */ - if (defer_p && asmspec) - make_decl_rtl (decl, asmspec); /* If we're not deferring, go ahead and assemble the variable. */ - else if (!defer_p) - rest_of_decl_compilation (decl, asmspec, toplev, at_eof); + if (!defer_p) + rest_of_decl_compilation (decl, toplev, at_eof); } /* Generate code to initialize DECL (a local variable). */ @@ -4701,10 +5003,9 @@ initialize_local_var (tree decl, tree init) tree type = TREE_TYPE (decl); tree cleanup; - my_friendly_assert (TREE_CODE (decl) == VAR_DECL - || TREE_CODE (decl) == RESULT_DECL, - 20021010); - my_friendly_assert (!TREE_STATIC (decl), 20021010); + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == RESULT_DECL); + gcc_assert (!TREE_STATIC (decl)); if (DECL_SIZE (decl) == NULL_TREE) { @@ -4725,7 +5026,7 @@ initialize_local_var (tree decl, tree init) { int saved_stmts_are_full_exprs_p; - my_friendly_assert (building_stmt_tree (), 20000906); + gcc_assert (building_stmt_tree ()); saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); current_stmt_tree ()->stmts_are_full_exprs_p = 1; finish_expr_stmt (init); @@ -4754,26 +5055,48 @@ initialize_local_var (tree decl, tree init) finish_decl_cleanup (decl, cleanup); } +/* DECL is a VAR_DECL for a compiler-generated variable with static + storage duration (like a virtual table) whose initializer is a + compile-time constant. INIT must be either a TREE_LIST of values, + or a CONSTRUCTOR. Initialize the variable and provide it to the + back end. */ + +void +initialize_artificial_var (tree decl, tree init) +{ + gcc_assert (DECL_ARTIFICIAL (decl)); + if (TREE_CODE (init) == TREE_LIST) + init = build_constructor_from_list (NULL_TREE, init); + gcc_assert (TREE_CODE (init) == CONSTRUCTOR); + DECL_INITIAL (decl) = init; + DECL_INITIALIZED_P (decl) = 1; + determine_visibility (decl); + layout_var_decl (decl); + maybe_commonize_var (decl); + make_rtl_for_nonlocal_decl (decl, init, /*asmspec=*/NULL); +} + /* Finish processing of a declaration; install its line number and initial value. If the length of an array type is not known before, it must be determined now, from the initial value, or it is an error. - INIT holds the value of an initializer that should be allowed to escape - the normal rules. + INIT is the initializer (if any) for DECL. If INIT_CONST_EXPR_P is + true, then INIT is an integral constant expression. FLAGS is LOOKUP_ONLYCONVERTING if the = init syntax was used, else 0 if the (init) syntax was used. */ void -cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) +cp_finish_decl (tree decl, tree init, bool init_const_expr_p, + tree asmspec_tree, int flags) { tree type; - tree ttype = NULL_TREE; tree cleanup; const char *asmspec = NULL; int was_readonly = 0; bool var_definition_p = false; + int saved_processing_template_decl; if (decl == error_mark_node) return; @@ -4784,66 +5107,73 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) return; } - my_friendly_assert (TREE_CODE (decl) != RESULT_DECL, 20030619); + gcc_assert (TREE_CODE (decl) != RESULT_DECL); + /* Parameters are handled by store_parm_decls, not cp_finish_decl. */ + gcc_assert (TREE_CODE (decl) != PARM_DECL); + + type = TREE_TYPE (decl); + if (type == error_mark_node) + return; /* Assume no cleanup is required. */ cleanup = NULL_TREE; + saved_processing_template_decl = processing_template_decl; /* If a name was specified, get the string. */ if (global_scope_p (current_binding_level)) asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree); - if (asmspec_tree) + if (asmspec_tree && asmspec_tree != error_mark_node) asmspec = TREE_STRING_POINTER (asmspec_tree); - if (init && TREE_CODE (init) == NAMESPACE_DECL) - { - error ("cannot initialize `%D' to namespace `%D'", - decl, init); - init = NULL_TREE; - } - if (current_class_type && CP_DECL_CONTEXT (decl) == current_class_type && TYPE_BEING_DEFINED (current_class_type) && (DECL_INITIAL (decl) || init)) DECL_INITIALIZED_IN_CLASS_P (decl) = 1; - if (TREE_CODE (decl) == VAR_DECL - && DECL_CONTEXT (decl) - && TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL - && DECL_CONTEXT (decl) != current_namespace - && init) - { - /* Leave the namespace of the object. */ - pop_decl_namespace (); - } - - type = TREE_TYPE (decl); - - if (type == error_mark_node) - goto finish_end0; - - if (TYPE_HAS_MUTABLE_P (type)) - TREE_READONLY (decl) = 0; - if (processing_template_decl) { + bool type_dependent_p; + /* Add this declaration to the statement-tree. */ if (at_function_scope_p ()) - add_decl_stmt (decl); + add_decl_expr (decl); - if (init && DECL_INITIAL (decl)) - DECL_INITIAL (decl) = init; - if (TREE_CODE (decl) == VAR_DECL - && !DECL_PRETTY_FUNCTION_P (decl) - && !dependent_type_p (TREE_TYPE (decl))) - maybe_deduce_size_from_array_init (decl, init); - goto finish_end0; + type_dependent_p = dependent_type_p (type); + + if (init && init_const_expr_p) + { + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1; + if (DECL_INTEGRAL_CONSTANT_VAR_P (decl)) + TREE_CONSTANT (decl) = 1; + } + + if (!init + || !DECL_CLASS_SCOPE_P (decl) + || !DECL_INTEGRAL_CONSTANT_VAR_P (decl) + || type_dependent_p + || value_dependent_expression_p (init) + /* Check also if initializer is a value dependent + { integral_constant_expression }. */ + || (TREE_CODE (init) == CONSTRUCTOR + && VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)) == 1 + && value_dependent_expression_p + (VEC_index (constructor_elt, + CONSTRUCTOR_ELTS (init), 0)->value))) + { + if (init) + DECL_INITIAL (decl) = init; + if (TREE_CODE (decl) == VAR_DECL + && !DECL_PRETTY_FUNCTION_P (decl) + && !type_dependent_p) + maybe_deduce_size_from_array_init (decl, init); + goto finish_end; + } + + init = fold_non_dependent_expr (init); + processing_template_decl = 0; } - /* Parameters are handled by store_parm_decls, not cp_finish_decl. */ - my_friendly_assert (TREE_CODE (decl) != PARM_DECL, 19990828); - /* Take care of TYPE_DECLs up front. */ if (TREE_CODE (decl) == TYPE_DECL) { @@ -4851,7 +5181,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) && IS_AGGR_TYPE (type) && DECL_NAME (decl)) { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) - warning ("shadowing previous type declaration of `%#D'", decl); + warning (0, "shadowing previous type declaration of %q#D", decl); set_identifier_type_value (DECL_NAME (decl), decl); } @@ -4862,34 +5192,38 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) && !COMPLETE_TYPE_P (TREE_TYPE (decl))) TYPE_DECL_SUPPRESS_DEBUG (decl) = 1; - rest_of_decl_compilation (decl, NULL, - DECL_CONTEXT (decl) == NULL_TREE, at_eof); + rest_of_decl_compilation (decl, DECL_CONTEXT (decl) == NULL_TREE, + at_eof); goto finish_end; } - if (TREE_CODE (decl) != FUNCTION_DECL) - ttype = target_type (type); - - - /* Currently, GNU C++ puts constants in text space, making them - impossible to initialize. In the future, one would hope for - an operating system which understood the difference between - initialization and the running of a program. */ - if (! DECL_EXTERNAL (decl) && TREE_READONLY (decl)) + /* A reference will be modified here, as it is initialized. */ + if (! DECL_EXTERNAL (decl) + && TREE_READONLY (decl) + && TREE_CODE (type) == REFERENCE_TYPE) { was_readonly = 1; - if (TYPE_NEEDS_CONSTRUCTING (type) - || TREE_CODE (type) == REFERENCE_TYPE) - TREE_READONLY (decl) = 0; + TREE_READONLY (decl) = 0; } if (TREE_CODE (decl) == VAR_DECL) { /* Only PODs can have thread-local storage. Other types may require various kinds of non-trivial initialization. */ - if (DECL_THREAD_LOCAL (decl) && !pod_type_p (TREE_TYPE (decl))) - error ("`%D' cannot be thread-local because it has non-POD type `%T'", + if (DECL_THREAD_LOCAL_P (decl) && !pod_type_p (TREE_TYPE (decl))) + error ("%qD cannot be thread-local because it has non-POD type %qT", decl, TREE_TYPE (decl)); + /* If this is a local variable that will need a mangled name, + register it now. We must do this before processing the + initializer for the variable, since the initialization might + require a guard variable, and since the mangled name of the + guard variable will depend on the mangled name of this + variable. */ + if (!processing_template_decl + && DECL_FUNCTION_SCOPE_P (decl) + && TREE_STATIC (decl) + && !DECL_ARTIFICIAL (decl)) + push_local_name (decl); /* Convert the initializer to the type of DECL, if we have not already initialized DECL. */ if (!DECL_INITIALIZED_P (decl) @@ -4899,32 +5233,52 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) is *not* defined. */ && (!DECL_EXTERNAL (decl) || init)) { + if (init) + { + DECL_NONTRIVIALLY_INITIALIZED_P (decl) = 1; + if (init_const_expr_p) + { + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1; + if (DECL_INTEGRAL_CONSTANT_VAR_P (decl)) + TREE_CONSTANT (decl) = 1; + } + } init = check_initializer (decl, init, flags, &cleanup); /* Thread-local storage cannot be dynamically initialized. */ - if (DECL_THREAD_LOCAL (decl) && init) + if (DECL_THREAD_LOCAL_P (decl) && init) { - error ("`%D' is thread-local and so cannot be dynamically " + error ("%qD is thread-local and so cannot be dynamically " "initialized", decl); init = NULL_TREE; } + + /* Check that the initializer for a static data member was a + constant. Although we check in the parser that the + initializer is an integral constant expression, we do not + simplify division-by-zero at the point at which it + occurs. Therefore, in: + + struct S { static const int i = 7 / 0; }; + + we issue an error at this point. It would + probably be better to forbid division by zero in + integral constant expressions. */ if (DECL_EXTERNAL (decl) && init) { - /* The static data member cannot be initialized by a - non-constant when being declared. */ - error ("`%D' cannot be initialized by a non-constant expression" + error ("%qD cannot be initialized by a non-constant expression" " when being declared", decl); DECL_INITIALIZED_IN_CLASS_P (decl) = 0; init = NULL_TREE; } - + /* Handle: - + [dcl.init] - + The memory occupied by any object of static storage duration is zero-initialized at program startup before any other initialization takes place. - + We cannot create an appropriate initializer until after the type of DECL is finalized. If DECL_INITIAL is set, then the DECL is statically initialized, and any @@ -4951,43 +5305,38 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) } /* Add this declaration to the statement-tree. This needs to happen - after the call to check_initializer so that the DECL_STMT for a - reference temp is added before the DECL_STMT for the reference itself. */ + after the call to check_initializer so that the DECL_EXPR for a + reference temp is added before the DECL_EXPR for the reference itself. */ if (at_function_scope_p ()) - add_decl_stmt (decl); + add_decl_expr (decl); - if (TREE_CODE (decl) == VAR_DECL) - layout_var_decl (decl); - - /* Output the assembler code and/or RTL code for variables and functions, - unless the type is an undefined structure or union. - If not, it will get done when the type is completed. */ - if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL) + /* Let the middle end know about variables and functions -- but not + static data members in uninstantiated class templates. */ + if (!saved_processing_template_decl + && (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL)) { if (TREE_CODE (decl) == VAR_DECL) - maybe_commonize_var (decl); + { + layout_var_decl (decl); + maybe_commonize_var (decl); + } make_rtl_for_nonlocal_decl (decl, init, asmspec); + /* Check for abstractness of the type. Notice that there is no + need to strip array types here since the check for those types + is already done within create_array_type_for_decl. */ if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE) - abstract_virtuals_error (decl, - strip_array_types (TREE_TYPE (type))); - else if (POINTER_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE) - { - /* If it's either a pointer or an array type, strip through all - of them but the last one. If the last is an array type, issue - an error if the element type is abstract. */ - while (POINTER_TYPE_P (TREE_TYPE (type)) - || TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE) - type = TREE_TYPE (type); - if (TREE_CODE (type) == ARRAY_TYPE) - abstract_virtuals_error (decl, TREE_TYPE (type)); - } + abstract_virtuals_error (decl, TREE_TYPE (type)); else abstract_virtuals_error (decl, type); - if (TREE_CODE (decl) == FUNCTION_DECL + /* This needs to happen after the linkage is set. */ + determine_visibility (decl); + + if (TREE_CODE (decl) == FUNCTION_DECL || TREE_TYPE (decl) == error_mark_node) /* No initialization required. */ ; @@ -5003,20 +5352,15 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) /* A variable definition. */ if (DECL_FUNCTION_SCOPE_P (decl)) { - /* This is a local declaration. */ - maybe_inject_for_scope_var (decl); /* Initialize the local variable. */ if (processing_template_decl) - { - if (init || DECL_INITIAL (decl) == error_mark_node) - DECL_INITIAL (decl) = init; - } + DECL_INITIAL (decl) = init; else if (!TREE_STATIC (decl)) initialize_local_var (decl, init); } /* If a variable is defined, and then a subsequent - definintion with external linkage is encountered, we will + definition with external linkage is encountered, we will get here twice for the same variable. We want to avoid calling expand_static_init more than once. For variables that are not static data members, we can call @@ -5024,43 +5368,24 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) initializer. It is not legal to redeclare a static data member, so this issue does not arise in that case. */ if (var_definition_p && TREE_STATIC (decl)) - expand_static_init (decl, init); + expand_static_init (decl, init); } - finish_end0: - - /* Undo call to `pushclass' that was done in `start_decl' - due to initialization of qualified member variable. - I.e., Foo::x = 10; */ - { - tree context = CP_DECL_CONTEXT (decl); - if (context - && TYPE_P (context) - && (TREE_CODE (decl) == VAR_DECL - /* We also have a pushclass done that we need to undo here - if we're at top level and declare a method. */ - || TREE_CODE (decl) == FUNCTION_DECL) - /* If size hasn't been set, we're still defining it, - and therefore inside the class body; don't pop - the binding level.. */ - && COMPLETE_TYPE_P (context) - && context == current_class_type) - pop_nested_class (); - } } /* If a CLEANUP_STMT was created to destroy a temporary bound to a reference, insert it in the statement-tree now. */ if (cleanup) - add_stmt (cleanup); + push_cleanup (decl, cleanup, false); finish_end: + processing_template_decl = saved_processing_template_decl; if (was_readonly) TREE_READONLY (decl) = 1; /* If this was marked 'used', be sure it will be output. */ if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) - mark_referenced (DECL_ASSEMBLER_NAME (decl)); + mark_decl_referenced (decl); } /* This is here for a midend callback from c-common.c. */ @@ -5068,7 +5393,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) void finish_decl (tree decl, tree init, tree asmspec_tree) { - cp_finish_decl (decl, init, asmspec_tree, 0); + cp_finish_decl (decl, init, /*init_const_expr_p=*/false, asmspec_tree, 0); } /* Returns a declaration for a VAR_DECL as if: @@ -5078,7 +5403,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) had been seen. Used to create compiler-generated global variables. */ -tree +static tree declare_global_var (tree name, tree type) { tree decl; @@ -5088,8 +5413,12 @@ declare_global_var (tree name, tree type) TREE_PUBLIC (decl) = 1; DECL_EXTERNAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1; - pushdecl (decl); - cp_finish_decl (decl, NULL_TREE, NULL_TREE, 0); + /* If the user has explicitly declared this variable (perhaps + because the code we are compiling is part of a low-level runtime + library), then it is possible that our declaration will be merged + with theirs by pushdecl. */ + decl = pushdecl (decl); + finish_decl (decl, NULL_TREE, NULL_TREE); pop_from_top_level (); return decl; @@ -5107,6 +5436,7 @@ get_atexit_node (void) tree fn_type; tree fn_ptr_type; const char *name; + bool use_aeabi_atexit; if (atexit_node) return atexit_node; @@ -5120,6 +5450,7 @@ get_atexit_node (void) We build up the argument types and then then function type itself. */ + use_aeabi_atexit = targetm.cxx.use_aeabi_atexit (); /* First, build the pointer-to-function type for the first argument. */ arg_types = tree_cons (NULL_TREE, ptr_type_node, void_list_node); @@ -5127,18 +5458,29 @@ get_atexit_node (void) fn_ptr_type = build_pointer_type (fn_type); /* Then, build the rest of the argument types. */ arg_types = tree_cons (NULL_TREE, ptr_type_node, void_list_node); - arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); - arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + if (use_aeabi_atexit) + { + arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); + } + else + { + arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); + arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + } /* And the final __cxa_atexit type. */ fn_type = build_function_type (integer_type_node, arg_types); fn_ptr_type = build_pointer_type (fn_type); - name = "__cxa_atexit"; + if (use_aeabi_atexit) + name = "__aeabi_atexit"; + else + name = "__cxa_atexit"; } else { /* The declaration for `atexit' is: - int atexit (void (*)()); + int atexit (void (*)()); We build up the argument types and then then function type itself. */ @@ -5183,8 +5525,6 @@ static GTY(()) int start_cleanup_cnt; static tree start_cleanup_fn (void) { - int old_interface_only = interface_only; - int old_interface_unknown = interface_unknown; char name[32]; tree parmtypes; tree fntype; @@ -5195,9 +5535,6 @@ start_cleanup_fn (void) /* No need to mangle this. */ push_lang_context (lang_name_c); - interface_only = 0; - interface_unknown = 1; - /* Build the parameter-types. */ parmtypes = void_list_node; /* Functions passed to __cxa_atexit take an additional parameter. @@ -5235,10 +5572,7 @@ start_cleanup_fn (void) } pushdecl (fndecl); - start_function (/*specs=*/NULL_TREE, fndecl, NULL_TREE, SF_PRE_PARSED); - - interface_unknown = old_interface_unknown; - interface_only = old_interface_only; + start_preparsed_function (fndecl, NULL_TREE, SF_PRE_PARSED); pop_lang_context (); @@ -5258,7 +5592,7 @@ end_cleanup_fn (void) /* Generate code to handle the destruction of DECL, an object with static storage duration. */ -void +tree register_dtor_fn (tree decl) { tree cleanup; @@ -5267,7 +5601,7 @@ register_dtor_fn (tree decl) tree fcall; if (TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) - return; + return void_zero_node; /* Call build_cleanup before we enter the anonymous function so that any access checks will be done relative to the current scope, @@ -5281,13 +5615,13 @@ register_dtor_fn (tree decl) to the original function, rather than the anonymous one. That will make the back-end think that nested functions are in use, which causes confusion. */ - + push_deferring_access_checks (dk_no_check); fcall = build_cleanup (decl); pop_deferring_access_checks (); /* Create the body of the anonymous function. */ - compound_stmt = begin_compound_stmt (/*has_no_scope=*/false); + compound_stmt = begin_compound_stmt (BCS_FN_BODY); finish_expr_stmt (fcall); finish_compound_stmt (compound_stmt); end_cleanup_fn (); @@ -5298,15 +5632,23 @@ register_dtor_fn (tree decl) cleanup = build_unary_op (ADDR_EXPR, cleanup, 0); if (flag_use_cxa_atexit) { - args = tree_cons (NULL_TREE, + args = tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0), NULL_TREE); - args = tree_cons (NULL_TREE, null_pointer_node, args); - args = tree_cons (NULL_TREE, cleanup, args); + if (targetm.cxx.use_aeabi_atexit ()) + { + args = tree_cons (NULL_TREE, cleanup, args); + args = tree_cons (NULL_TREE, null_pointer_node, args); + } + else + { + args = tree_cons (NULL_TREE, null_pointer_node, args); + args = tree_cons (NULL_TREE, cleanup, args); + } } else args = tree_cons (NULL_TREE, cleanup, NULL_TREE); - finish_expr_stmt (build_function_call (get_atexit_node (), args)); + return build_function_call (get_atexit_node (), args); } /* DECL is a VAR_DECL with static storage duration. INIT, if present, @@ -5316,35 +5658,41 @@ register_dtor_fn (tree decl) static void expand_static_init (tree decl, tree init) { - my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 20021010); - my_friendly_assert (TREE_STATIC (decl), 20021010); + gcc_assert (TREE_CODE (decl) == VAR_DECL); + gcc_assert (TREE_STATIC (decl)); /* Some variables require no initialization. */ - if (!init + if (!init && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) return; - if (! toplevel_bindings_p ()) + if (DECL_FUNCTION_SCOPE_P (decl)) { /* Emit code to perform this initialization but once. */ - tree if_stmt; - tree then_clause; - tree assignment; - tree guard; - tree guard_init; + tree if_stmt = NULL_TREE, inner_if_stmt = NULL_TREE; + tree then_clause = NULL_TREE, inner_then_clause = NULL_TREE; + tree guard, guard_addr, guard_addr_list; + tree acquire_fn, release_fn, abort_fn; + tree flag, begin; /* Emit code to perform this initialization but once. This code looks like: - static int guard = 0; - if (!guard) { - // Do initialization. - guard = 1; - // Register variable for destruction at end of program. + static guard; + if (!guard.first_byte) { + if (__cxa_guard_acquire (&guard)) { + bool flag = false; + try { + // Do initialization. + flag = true; __cxa_guard_release (&guard); + // Register variable for destruction at end of program. + } catch { + if (!flag) __cxa_guard_abort (&guard); + } } - Note that the `temp' variable is only set to 1 *after* the + Note that the `flag' variable is only set to 1 *after* the initialization is complete. This ensures that an exception, thrown during the construction, will cause the variable to reinitialized when we pass through this code again, as per: @@ -5355,161 +5703,145 @@ expand_static_init (tree decl, tree init) initialization is not complete, so it will be tried again the next time control enters the declaration. - In theory, this process should be thread-safe, too; multiple - threads should not be able to initialize the variable more - than once. We don't yet attempt to ensure thread-safety. */ + This process should be thread-safe, too; multiple threads + should not be able to initialize the variable more than + once. */ /* Create the guard variable. */ guard = get_guard (decl); - /* Begin the conditional initialization. */ - if_stmt = begin_if_stmt (); - finish_if_stmt_cond (get_guard_cond (guard), if_stmt); - then_clause = begin_compound_stmt (/*has_no_scope=*/false); + /* This optimization isn't safe on targets with relaxed memory + consistency. On such targets we force synchronization in + __cxa_guard_acquire. */ + if (!targetm.relaxed_ordering || !flag_threadsafe_statics) + { + /* Begin the conditional initialization. */ + if_stmt = begin_if_stmt (); + finish_if_stmt_cond (get_guard_cond (guard), if_stmt); + then_clause = begin_compound_stmt (BCS_NO_SCOPE); + } - /* Do the initialization itself. */ - assignment = init ? init : NULL_TREE; + if (flag_threadsafe_statics) + { + guard_addr = build_address (guard); + guard_addr_list = build_tree_list (NULL_TREE, guard_addr); - /* Once the assignment is complete, set TEMP to 1. Since the - construction of the static object is complete at this point, - we want to make sure TEMP is set to 1 even if a temporary - constructed during the initialization throws an exception - when it is destroyed. So, we combine the initialization and - the assignment to TEMP into a single expression, ensuring - that when we call finish_expr_stmt the cleanups will not be - run until after TEMP is set to 1. */ - guard_init = set_guard (guard); - if (assignment) - assignment = build_compound_expr (assignment, guard_init); + acquire_fn = get_identifier ("__cxa_guard_acquire"); + release_fn = get_identifier ("__cxa_guard_release"); + abort_fn = get_identifier ("__cxa_guard_abort"); + if (!get_global_value_if_present (acquire_fn, &acquire_fn)) + { + tree argtypes = tree_cons (NULL_TREE, TREE_TYPE (guard_addr), + void_list_node); + tree vfntype = build_function_type (void_type_node, argtypes); + acquire_fn = push_library_fn + (acquire_fn, build_function_type (integer_type_node, argtypes)); + release_fn = push_library_fn (release_fn, vfntype); + abort_fn = push_library_fn (abort_fn, vfntype); + } + else + { + release_fn = identifier_global_value (release_fn); + abort_fn = identifier_global_value (abort_fn); + } + + inner_if_stmt = begin_if_stmt (); + finish_if_stmt_cond (build_call (acquire_fn, guard_addr_list), + inner_if_stmt); + + inner_then_clause = begin_compound_stmt (BCS_NO_SCOPE); + begin = get_target_expr (boolean_false_node); + flag = TARGET_EXPR_SLOT (begin); + + TARGET_EXPR_CLEANUP (begin) + = build3 (COND_EXPR, void_type_node, flag, + void_zero_node, + build_call (abort_fn, guard_addr_list)); + CLEANUP_EH_ONLY (begin) = 1; + + /* Do the initialization itself. */ + init = add_stmt_to_compound (begin, init); + init = add_stmt_to_compound + (init, build2 (MODIFY_EXPR, void_type_node, flag, boolean_true_node)); + init = add_stmt_to_compound + (init, build_call (release_fn, guard_addr_list)); + } else - assignment = guard_init; - finish_expr_stmt (assignment); + init = add_stmt_to_compound (init, set_guard (guard)); /* Use atexit to register a function for destroying this static variable. */ - register_dtor_fn (decl); + init = add_stmt_to_compound (init, register_dtor_fn (decl)); - finish_compound_stmt (then_clause); - finish_then_clause (if_stmt); - finish_if_stmt (); + finish_expr_stmt (init); + + if (flag_threadsafe_statics) + { + finish_compound_stmt (inner_then_clause); + finish_then_clause (inner_if_stmt); + finish_if_stmt (inner_if_stmt); + } + + if (!targetm.relaxed_ordering || !flag_threadsafe_statics) + { + finish_compound_stmt (then_clause); + finish_then_clause (if_stmt); + finish_if_stmt (if_stmt); + } } else static_aggregates = tree_cons (init, decl, static_aggregates); } -/* Finish the declaration of a catch-parameter. */ - -tree -start_handler_parms (tree declspecs, tree declarator) -{ - tree decl; - if (declspecs) - { - decl = grokdeclarator (declarator, declspecs, CATCHPARM, - 1, NULL); - if (decl == NULL_TREE) - error ("invalid catch parameter"); - } - else - decl = NULL_TREE; - - return decl; -} - /* Make TYPE a complete type based on INITIAL_VALUE. Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, - 2 if there was no information (in which case assume 0 if DO_DEFAULT). */ + 2 if there was no information (in which case assume 0 if DO_DEFAULT), + 3 if the initializer list is empty (in pedantic mode). */ int -complete_array_type (tree type, tree initial_value, int do_default) +cp_complete_array_type (tree *ptype, tree initial_value, bool do_default) { - tree maxindex = NULL_TREE; - int value = 0; + int failure; + tree type, elt_type; if (initial_value) { /* An array of character type can be initialized from a - brace-enclosed string constant. */ - if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type))) + brace-enclosed string constant. + + FIXME: this code is duplicated from reshape_init. Probably + we should just call reshape_init here? */ + if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (*ptype))) && TREE_CODE (initial_value) == CONSTRUCTOR - && CONSTRUCTOR_ELTS (initial_value) - && (TREE_CODE (TREE_VALUE (CONSTRUCTOR_ELTS (initial_value))) - == STRING_CST) - && TREE_CHAIN (CONSTRUCTOR_ELTS (initial_value)) == NULL_TREE) - initial_value = TREE_VALUE (CONSTRUCTOR_ELTS (initial_value)); - - /* Note MAXINDEX is really the maximum index, one less than the - size. */ - if (TREE_CODE (initial_value) == STRING_CST) + && !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (initial_value))) { - int eltsize - = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); - maxindex = build_int_2 ((TREE_STRING_LENGTH (initial_value) - / eltsize) - 1, 0); - } - else if (TREE_CODE (initial_value) == CONSTRUCTOR) - { - tree elts = CONSTRUCTOR_ELTS (initial_value); + VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value); + tree value = VEC_index (constructor_elt, v, 0)->value; - maxindex = ssize_int (-1); - for (; elts; elts = TREE_CHAIN (elts)) - { - if (TREE_PURPOSE (elts)) - maxindex = TREE_PURPOSE (elts); - else - maxindex = size_binop (PLUS_EXPR, maxindex, ssize_int (1)); - } - maxindex = copy_node (maxindex); - } - else - { - /* Make an error message unless that happened already. */ - if (initial_value != error_mark_node) - value = 1; - else - initial_value = NULL_TREE; - - /* Prevent further error messages. */ - maxindex = build_int_2 (0, 0); + if (TREE_CODE (value) == STRING_CST + && VEC_length (constructor_elt, v) == 1) + initial_value = value; } } - if (!maxindex) + failure = complete_array_type (ptype, initial_value, do_default); + + /* We can create the array before the element type is complete, which + means that we didn't have these two bits set in the original type + either. In completing the type, we are expected to propagate these + bits. See also complete_type which does the same thing for arrays + of fixed size. */ + type = *ptype; + if (TYPE_DOMAIN (type)) { - if (do_default) - maxindex = build_int_2 (0, 0); - value = 2; + elt_type = TREE_TYPE (type); + TYPE_NEEDS_CONSTRUCTING (type) = TYPE_NEEDS_CONSTRUCTING (elt_type); + TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type) + = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (elt_type); } - if (maxindex) - { - tree itype; - tree domain; - - domain = build_index_type (maxindex); - TYPE_DOMAIN (type) = domain; - - if (! TREE_TYPE (maxindex)) - TREE_TYPE (maxindex) = domain; - if (initial_value) - itype = TREE_TYPE (initial_value); - else - itype = NULL; - if (itype && !TYPE_DOMAIN (itype)) - TYPE_DOMAIN (itype) = domain; - /* The type of the main variant should never be used for arrays - of different sizes. It should only ever be completed with the - size of the array. */ - if (! TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))) - TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = domain; - } - - /* Lay out the type now that we can get the real answer. */ - - layout_type (type); - - return value; + return failure; } /* Return zero if something is declared to be a member of type @@ -5522,11 +5854,9 @@ member_function_or_else (tree ctype, tree cur_type, enum overload_flags flags) if (ctype && ctype != cur_type) { if (flags == DTOR_FLAG) - error ("destructor for alien class `%T' cannot be a member", - ctype); + error ("destructor for alien class %qT cannot be a member", ctype); else - error ("constructor for alien class `%T' cannot be a member", - ctype); + error ("constructor for alien class %qT cannot be a member", ctype); return 0; } return 1; @@ -5539,28 +5869,86 @@ member_function_or_else (tree ctype, tree cur_type, enum overload_flags flags) static void bad_specifiers (tree object, - const char* type, - int virtualp, - int quals, - int inlinep, - int friendp, - int raises) + const char* type, + int virtualp, + int quals, + int inlinep, + int friendp, + int raises) { if (virtualp) - error ("`%D' declared as a `virtual' %s", object, type); + error ("%qD declared as a % %s", object, type); if (inlinep) - error ("`%D' declared as an `inline' %s", object, type); + error ("%qD declared as an % %s", object, type); if (quals) - error ("`const' and `volatile' function specifiers on `%D' invalid in %s declaration", - object, type); + error ("% and % function specifiers on " + "%qD invalid in %s declaration", + object, type); if (friendp) - cp_error_at ("`%D' declared as a friend", object); + error ("%q+D declared as a friend", object); if (raises && (TREE_CODE (object) == TYPE_DECL || (!TYPE_PTRFN_P (TREE_TYPE (object)) && !TYPE_REFFN_P (TREE_TYPE (object)) && !TYPE_PTRMEMFUNC_P (TREE_TYPE (object))))) - cp_error_at ("`%D' declared with an exception specification", object); + error ("%q+D declared with an exception specification", object); +} + +/* DECL is a member function or static data member and is presently + being defined. Check that the definition is taking place in a + valid namespace. */ + +static void +check_class_member_definition_namespace (tree decl) +{ + /* These checks only apply to member functions and static data + members. */ + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL + || TREE_CODE (decl) == VAR_DECL); + /* We check for problems with specializations in pt.c in + check_specialization_namespace, where we can issue better + diagnostics. */ + if (processing_specialization) + return; + /* There are no restrictions on the placement of + explicit instantiations. */ + if (processing_explicit_instantiation) + return; + /* [class.mfct] + + A member function definition that appears outside of the + class definition shall appear in a namespace scope enclosing + the class definition. + + [class.static.data] + + The definition for a static data member shall appear in a + namespace scope enclosing the member's class definition. */ + if (!is_ancestor (current_namespace, DECL_CONTEXT (decl))) + pedwarn ("definition of %qD is not in namespace enclosing %qT", + decl, DECL_CONTEXT (decl)); +} + +/* Build a PARM_DECL for the "this" parameter. TYPE is the + METHOD_TYPE for a non-static member function; QUALS are the + cv-qualifiers that apply to the function. */ + +tree +build_this_parm (tree type, cp_cv_quals quals) +{ + tree this_type; + tree qual_type; + tree parm; + cp_cv_quals this_quals; + + this_type = TREE_VALUE (TYPE_ARG_TYPES (type)); + /* The `this' parameter is implicitly `const'; it cannot be + assigned to. */ + this_quals = (quals & TYPE_QUAL_RESTRICT) | TYPE_QUAL_CONST; + qual_type = cp_build_qualified_type (this_type, this_quals); + parm = build_artificial_parm (this_identifier, qual_type); + cp_apply_type_quals_to_decl (this_quals, parm); + return parm; } /* CTYPE is class type, or null if non-class. @@ -5576,41 +5964,112 @@ bad_specifiers (tree object, CHECK is 1 if we must find this method in CTYPE, 0 if we should not look, and -1 if we should not call `grokclassfn' at all. + SFK is the kind of special function (if any) for the new function. + Returns `NULL_TREE' if something goes wrong, after issuing applicable error messages. */ static tree -grokfndecl (tree ctype, - tree type, - tree declarator, +grokfndecl (tree ctype, + tree type, + tree declarator, tree parms, - tree orig_declarator, - int virtualp, - enum overload_flags flags, - tree quals, - tree raises, - int check, - int friendp, - int publicp, - int inlinep, - int funcdef_flag, - int template_count, - tree in_namespace) + tree orig_declarator, + int virtualp, + enum overload_flags flags, + cp_cv_quals quals, + tree raises, + int check, + int friendp, + int publicp, + int inlinep, + special_function_kind sfk, + bool funcdef_flag, + int template_count, + tree in_namespace, + tree* attrlist) { tree decl; int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE; - int has_default_arg = 0; tree t; if (raises) type = build_exception_variant (type, raises); decl = build_lang_decl (FUNCTION_DECL, declarator, type); + if (TREE_CODE (type) == METHOD_TYPE) + { + tree parm; + parm = build_this_parm (type, quals); + TREE_CHAIN (parm) = parms; + parms = parm; + } DECL_ARGUMENTS (decl) = parms; /* Propagate volatile out from type to decl. */ if (TYPE_VOLATILE (type)) TREE_THIS_VOLATILE (decl) = 1; + if (friendp + && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR) + { + if (funcdef_flag) + error + ("defining explicit specialization %qD in friend declaration", + orig_declarator); + else + { + tree fns = TREE_OPERAND (orig_declarator, 0); + tree args = TREE_OPERAND (orig_declarator, 1); + + if (PROCESSING_REAL_TEMPLATE_DECL_P ()) + { + /* Something like `template friend void f()'. */ + error ("invalid use of template-id %qD in declaration " + "of primary template", + orig_declarator); + return NULL_TREE; + } + + + /* A friend declaration of the form friend void f<>(). Record + the information in the TEMPLATE_ID_EXPR. */ + SET_DECL_IMPLICIT_INSTANTIATION (decl); + + if (TREE_CODE (fns) == COMPONENT_REF) + { + /* Due to bison parser ickiness, we will have already looked + up an operator_name or PFUNCNAME within the current class + (see template_id in parse.y). If the current class contains + such a name, we'll get a COMPONENT_REF here. Undo that. */ + + gcc_assert (TREE_TYPE (TREE_OPERAND (fns, 0)) + == current_class_type); + fns = TREE_OPERAND (fns, 1); + } + gcc_assert (TREE_CODE (fns) == IDENTIFIER_NODE + || TREE_CODE (fns) == OVERLOAD); + DECL_TEMPLATE_INFO (decl) = tree_cons (fns, args, NULL_TREE); + + for (t = TYPE_ARG_TYPES (TREE_TYPE (decl)); t; t = TREE_CHAIN (t)) + if (TREE_PURPOSE (t) + && TREE_CODE (TREE_PURPOSE (t)) == DEFAULT_ARG) + { + error ("default arguments are not allowed in declaration " + "of friend template specialization %qD", + decl); + return NULL_TREE; + } + + if (inlinep) + { + error ("% is not allowed in declaration of friend " + "template specialization %qD", + decl); + return NULL_TREE; + } + } + } + /* If this decl has namespace scope, set that up. */ if (in_namespace) set_decl_namespace (decl, in_namespace, friendp); @@ -5637,26 +6096,26 @@ grokfndecl (tree ctype, } if (ctype) - DECL_CONTEXT (decl) = ctype; + { + DECL_CONTEXT (decl) = ctype; + if (funcdef_flag) + check_class_member_definition_namespace (decl); + } if (ctype == NULL_TREE && DECL_MAIN_P (decl)) { if (processing_template_decl) - error ("cannot declare `::main' to be a template"); + error ("cannot declare %<::main%> to be a template"); if (inlinep) - error ("cannot declare `::main' to be inline"); + error ("cannot declare %<::main%> to be inline"); if (!publicp) - error ("cannot declare `::main' to be static"); - if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)), - integer_type_node)) - error ("`main' must return `int'"); + error ("cannot declare %<::main%> to be static"); inlinep = 0; publicp = 1; } /* Members of anonymous types and local classes have no linkage; make - them internal. */ - /* FIXME what if it gets a name from typedef? */ + them internal. If a typedef is made later, this will be changed. */ if (ctype && (TYPE_ANONYMOUS_P (ctype) || decl_function_context (TYPE_MAIN_DECL (ctype)))) publicp = 0; @@ -5668,7 +6127,8 @@ grokfndecl (tree ctype, declare an entity with linkage. Only check this for public decls for now. See core 319, 389. */ - t = no_linkage_check (TREE_TYPE (decl)); + t = no_linkage_check (TREE_TYPE (decl), + /*relaxed_p=*/false); if (t) { if (TYPE_ANONYMOUS_P (t)) @@ -5677,17 +6137,16 @@ grokfndecl (tree ctype, /* Allow this; it's pretty common in C. */; else { - pedwarn ("non-local function `%#D' uses anonymous type", + pedwarn ("non-local function %q#D uses anonymous type", decl); if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) - cp_pedwarn_at ("\ -`%#D' does not refer to the unqualified type, so it is not used for linkage", - TYPE_NAME (t)); + pedwarn ("%q+#D does not refer to the unqualified " + "type, so it is not used for linkage", + TYPE_NAME (t)); } } else - pedwarn ("non-local function `%#D' uses local type `%T'", - decl, t); + pedwarn ("non-local function %q#D uses local type %qT", decl, t); } } @@ -5708,83 +6167,20 @@ grokfndecl (tree ctype, DECL_INLINE (decl) = 1; DECL_EXTERNAL (decl) = 1; - if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE) + if (quals && TREE_CODE (type) == FUNCTION_TYPE) { - error ("%smember function `%D' cannot have `%T' method qualifier", - (ctype ? "static " : "non-"), decl, TREE_VALUE (quals)); - quals = NULL_TREE; + error ("%smember function %qD cannot have cv-qualifier", + (ctype ? "static " : "non-"), decl); + quals = TYPE_UNQUALIFIED; } - if (IDENTIFIER_OPNAME_P (DECL_NAME (decl))) - grok_op_properties (decl, /*complain=*/true); + if (IDENTIFIER_OPNAME_P (DECL_NAME (decl)) + && !grok_op_properties (decl, /*complain=*/true)) + return NULL_TREE; if (ctype && decl_function_context (decl)) DECL_NO_STATIC_CHAIN (decl) = 1; - for (t = TYPE_ARG_TYPES (TREE_TYPE (decl)); t; t = TREE_CHAIN (t)) - if (TREE_PURPOSE (t) - && TREE_CODE (TREE_PURPOSE (t)) == DEFAULT_ARG) - { - has_default_arg = 1; - break; - } - - if (friendp - && TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR) - { - if (funcdef_flag) - error - ("defining explicit specialization `%D' in friend declaration", - orig_declarator); - else - { - tree fns = TREE_OPERAND (orig_declarator, 0); - tree args = TREE_OPERAND (orig_declarator, 1); - - if (PROCESSING_REAL_TEMPLATE_DECL_P ()) - { - /* Something like `template friend void f()'. */ - error ("invalid use of template-id `%D' in declaration of primary template", - orig_declarator); - return NULL_TREE; - } - - - /* A friend declaration of the form friend void f<>(). Record - the information in the TEMPLATE_ID_EXPR. */ - SET_DECL_IMPLICIT_INSTANTIATION (decl); - - if (TREE_CODE (fns) == COMPONENT_REF) - { - /* Due to bison parser ickiness, we will have already looked - up an operator_name or PFUNCNAME within the current class - (see template_id in parse.y). If the current class contains - such a name, we'll get a COMPONENT_REF here. Undo that. */ - - my_friendly_assert (TREE_TYPE (TREE_OPERAND (fns, 0)) - == current_class_type, 20001120); - fns = TREE_OPERAND (fns, 1); - } - my_friendly_assert (TREE_CODE (fns) == IDENTIFIER_NODE - || TREE_CODE (fns) == OVERLOAD, 20001120); - DECL_TEMPLATE_INFO (decl) = tree_cons (fns, args, NULL_TREE); - - if (has_default_arg) - { - error ("default arguments are not allowed in declaration of friend template specialization `%D'", - decl); - return NULL_TREE; - } - - if (inlinep) - { - error ("`inline' is not allowed in declaration of friend template specialization `%D'", - decl); - return NULL_TREE; - } - } - } - if (funcdef_flag) /* Make the init_value nonzero so pushdecl knows this is not tentative. error_mark_node is replaced later with the BLOCK. */ @@ -5797,22 +6193,39 @@ grokfndecl (tree ctype, if (check < 0) return decl; - if (flags == NO_SPECIAL && ctype && constructor_name_p (declarator, ctype)) - DECL_CONSTRUCTOR_P (decl) = 1; - - /* Function gets the ugly name, field gets the nice one. This call - may change the type of the function (because of default - parameters)! */ if (ctype != NULL_TREE) - grokclassfn (ctype, decl, flags, quals); + { + if (sfk == sfk_constructor) + DECL_CONSTRUCTOR_P (decl) = 1; + + grokclassfn (ctype, decl, flags); + } decl = check_explicit_specialization (orig_declarator, decl, template_count, - 2 * (funcdef_flag != 0) + + 2 * funcdef_flag + 4 * (friendp != 0)); if (decl == error_mark_node) return NULL_TREE; + if (attrlist) + { + cplus_decl_attributes (&decl, *attrlist, 0); + *attrlist = NULL_TREE; + } + + /* Check main's type after attributes have been applied. */ + if (ctype == NULL_TREE && DECL_MAIN_P (decl) + && !same_type_p (TREE_TYPE (TREE_TYPE (decl)), + integer_type_node)) + { + tree oldtypeargs = TYPE_ARG_TYPES (TREE_TYPE (decl)); + tree newtype; + error ("%<::main%> must return %"); + newtype = build_function_type (integer_type_node, oldtypeargs); + TREE_TYPE (decl) = newtype; + } + if (ctype != NULL_TREE && (! TYPE_FOR_JAVA (ctype) || check_java_method (decl)) && check) @@ -5820,28 +6233,29 @@ grokfndecl (tree ctype, tree old_decl; old_decl = check_classfn (ctype, decl, - processing_template_decl - > template_class_depth (ctype)); - - if (old_decl && TREE_CODE (old_decl) == TEMPLATE_DECL) - /* Because grokfndecl is always supposed to return a - FUNCTION_DECL, we pull out the DECL_TEMPLATE_RESULT - here. We depend on our callers to figure out that its - really a template that's being returned. */ - old_decl = DECL_TEMPLATE_RESULT (old_decl); - - if (old_decl && DECL_STATIC_FUNCTION_P (old_decl) - && TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) - /* Remove the `this' parm added by grokclassfn. - XXX Isn't this done in start_function, too? */ - revert_static_member_fn (decl); - if (old_decl && DECL_ARTIFICIAL (old_decl)) - error ("definition of implicitly-declared `%D'", old_decl); - + (processing_template_decl + > template_class_depth (ctype)) + ? current_template_parms + : NULL_TREE); if (old_decl) { tree ok; - bool pop_p; + tree pushed_scope; + + if (TREE_CODE (old_decl) == TEMPLATE_DECL) + /* Because grokfndecl is always supposed to return a + FUNCTION_DECL, we pull out the DECL_TEMPLATE_RESULT + here. We depend on our callers to figure out that its + really a template that's being returned. */ + old_decl = DECL_TEMPLATE_RESULT (old_decl); + + if (DECL_STATIC_FUNCTION_P (old_decl) + && TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) + /* Remove the `this' parm added by grokclassfn. + XXX Isn't this done in start_function, too? */ + revert_static_member_fn (decl); + if (DECL_ARTIFICIAL (old_decl)) + error ("definition of implicitly-declared %qD", old_decl); /* Since we've smashed OLD_DECL to its DECL_TEMPLATE_RESULT, we must do the same to DECL. */ @@ -5850,13 +6264,13 @@ grokfndecl (tree ctype, /* Attempt to merge the declarations. This can fail, in the case of some invalid specialization declarations. */ - pop_p = push_scope (ctype); - ok = duplicate_decls (decl, old_decl); - if (pop_p) - pop_scope (ctype); + pushed_scope = push_scope (ctype); + ok = duplicate_decls (decl, old_decl, friendp); + if (pushed_scope) + pop_scope (pushed_scope); if (!ok) { - error ("no `%#D' member function declared in class `%T'", + error ("no %q#D member function declared in class %qT", decl, ctype); return NULL_TREE; } @@ -5876,7 +6290,26 @@ grokfndecl (tree ctype, return decl; } -/* Create a VAR_DECL named NAME with the indicated TYPE. +/* DECL is a VAR_DECL for a static data member. Set flags to reflect + the linkage that DECL will receive in the object file. */ + +static void +set_linkage_for_static_data_member (tree decl) +{ + /* A static data member always has static storage duration and + external linkage. Note that static data members are forbidden in + local classes -- the only situation in which a class has + non-external linkage. */ + TREE_PUBLIC (decl) = 1; + TREE_STATIC (decl) = 1; + /* For non-template classes, static data members are always put + out in exactly those files where they are defined, just as + with ordinary namespace-scope variables. */ + if (!processing_template_decl) + DECL_INTERFACE_KNOWN (decl) = 1; +} + +/* Create a VAR_DECL named NAME with the indicated TYPE. If SCOPE is non-NULL, it is the class type or namespace containing the variable. If SCOPE is NULL, the variable should is created in @@ -5884,36 +6317,28 @@ grokfndecl (tree ctype, static tree grokvardecl (tree type, - tree name, - RID_BIT_TYPE * specbits_in, - int initialized, - int constp, - tree scope) + tree name, + const cp_decl_specifier_seq *declspecs, + int initialized, + int constp, + tree scope) { tree decl; tree explicit_scope; - RID_BIT_TYPE specbits; - my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE, - 20020808); - - specbits = *specbits_in; + gcc_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE); /* Compute the scope in which to place the variable, but remember - whether or not that scope was explicitly specified by the user. */ + whether or not that scope was explicitly specified by the user. */ explicit_scope = scope; if (!scope) { /* An explicit "extern" specifier indicates a namespace-scope variable. */ - if (RIDBIT_SETP (RID_EXTERN, specbits)) + if (declspecs->storage_class == sc_extern) scope = current_namespace; else if (!at_function_scope_p ()) - { - scope = current_scope (); - if (!scope) - scope = current_namespace; - } + scope = current_scope (); } if (scope @@ -5922,7 +6347,7 @@ grokvardecl (tree type, (TREE_CODE (scope) == NAMESPACE_DECL && processing_template_decl) /* Similarly for namespace-scope variables with language linkage other than C++. */ - || (TREE_CODE (scope) == NAMESPACE_DECL + || (TREE_CODE (scope) == NAMESPACE_DECL && current_lang_name != lang_name_cplusplus) /* Similarly for static data members. */ || TYPE_P (scope))) @@ -5933,47 +6358,40 @@ grokvardecl (tree type, if (explicit_scope && TREE_CODE (explicit_scope) == NAMESPACE_DECL) set_decl_namespace (decl, explicit_scope, 0); else - DECL_CONTEXT (decl) = scope; + DECL_CONTEXT (decl) = FROB_CONTEXT (scope); - if (name && scope && current_lang_name != lang_name_c) - /* We can't mangle lazily here because we don't have any - way to recover whether or not a variable was `extern - "C"' later. */ - mangle_decl (decl); - - if (RIDBIT_SETP (RID_EXTERN, specbits)) + if (declspecs->storage_class == sc_extern) { DECL_THIS_EXTERN (decl) = 1; DECL_EXTERNAL (decl) = !initialized; } - /* In class context, static means one per class, - public access, and static storage. */ if (DECL_CLASS_SCOPE_P (decl)) { - TREE_PUBLIC (decl) = 1; - TREE_STATIC (decl) = 1; + set_linkage_for_static_data_member (decl); + /* This function is only called with out-of-class definitions. */ DECL_EXTERNAL (decl) = 0; + check_class_member_definition_namespace (decl); } /* At top level, either `static' or no s.c. makes a definition (perhaps tentative), and absence of `static' makes it public. */ else if (toplevel_bindings_p ()) { - TREE_PUBLIC (decl) = (RIDBIT_NOTSETP (RID_STATIC, specbits) + TREE_PUBLIC (decl) = (declspecs->storage_class != sc_static && (DECL_THIS_EXTERN (decl) || ! constp)); TREE_STATIC (decl) = ! DECL_EXTERNAL (decl); } /* Not at top level, only `static' makes a static definition. */ else { - TREE_STATIC (decl) = !! RIDBIT_SETP (RID_STATIC, specbits); + TREE_STATIC (decl) = declspecs->storage_class == sc_static; TREE_PUBLIC (decl) = DECL_EXTERNAL (decl); } - if (RIDBIT_SETP (RID_THREAD, specbits)) + if (declspecs->specs[(int)ds_thread]) { if (targetm.have_tls) - DECL_THREAD_LOCAL (decl) = 1; + DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); else /* A mere warning is sure to result in improper semantics at runtime. Don't bother to allow this to compile. */ @@ -5987,16 +6405,34 @@ grokvardecl (tree type, declare an entity with linkage. Only check this for public decls for now. */ - tree t = no_linkage_check (TREE_TYPE (decl)); + tree t = no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false); if (t) { if (TYPE_ANONYMOUS_P (t)) - /* Ignore for now; `enum { foo } e' is pretty common. */; + { + if (DECL_EXTERN_C_P (decl)) + /* Allow this; it's pretty common in C. */ + ; + else + { + /* DRs 132, 319 and 389 seem to indicate types with + no linkage can only be used to declare extern "C" + entities. Since it's not always an error in the + ISO C++ 90 Standard, we only issue a warning. */ + warning (0, "non-local variable %q#D uses anonymous type", + decl); + if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) + warning (0, "%q+#D does not refer to the unqualified " + "type, so it is not used for linkage", + TYPE_NAME (t)); + } + } else - pedwarn ("non-local variable `%#D' uses local type `%T'", - decl, t); + warning (0, "non-local variable %q#D uses local type %qT", decl, t); } } + else + DECL_INTERFACE_KNOWN (decl) = 1; return decl; } @@ -6028,6 +6464,8 @@ build_ptrmemfunc_type (tree type) = build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type)); t = make_aggr_type (RECORD_TYPE); + xref_basetypes (t, NULL_TREE); + /* Let the front-end know this is a pointer to member function... */ TYPE_PTRMEMFUNC_FLAG (t) = 1; /* ... and not really an aggregate. */ @@ -6035,11 +6473,11 @@ build_ptrmemfunc_type (tree type) field = build_decl (FIELD_DECL, pfn_identifier, type); fields = field; - + field = build_decl (FIELD_DECL, delta_identifier, delta_type_node); TREE_CHAIN (field) = fields; fields = field; - + finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node); /* Zap out the name so that the back-end will give us the debugging @@ -6075,19 +6513,18 @@ build_ptrmem_type (tree class_type, tree member_type) tree arg_types; arg_types = TYPE_ARG_TYPES (member_type); - class_type = (cp_build_qualified_type + class_type = (cp_build_qualified_type (class_type, cp_type_quals (TREE_TYPE (TREE_VALUE (arg_types))))); - member_type - = build_method_type_directly (class_type, + member_type + = build_method_type_directly (class_type, TREE_TYPE (member_type), TREE_CHAIN (arg_types)); return build_ptrmemfunc_type (build_pointer_type (member_type)); } else { - my_friendly_assert (TREE_CODE (member_type) != FUNCTION_TYPE, - 20030716); + gcc_assert (TREE_CODE (member_type) != FUNCTION_TYPE); return build_offset_type (class_type, member_type); } } @@ -6108,19 +6545,22 @@ check_static_variable_definition (tree decl, tree type) required. */ if (!ARITHMETIC_TYPE_P (type) && TREE_CODE (type) != ENUMERAL_TYPE) { - error ("invalid in-class initialization of static data member of non-integral type `%T'", + error ("invalid in-class initialization of static data member " + "of non-integral type %qT", type); /* If we just return the declaration, crashes will sometimes - occur. We therefore return void_type_node, as if this was a + occur. We therefore return void_type_node, as if this were a friend declaration, to cause callers to completely ignore this declaration. */ return 1; } else if (!CP_TYPE_CONST_P (type)) - error ("ISO C++ forbids in-class initialization of non-const static member `%D'", - decl); + error ("ISO C++ forbids in-class initialization of non-const " + "static member %qD", + decl); else if (pedantic && !INTEGRAL_TYPE_P (type)) - pedwarn ("ISO C++ forbids initialization of member constant `%D' of non-integral type `%T'", decl, type); + pedwarn ("ISO C++ forbids initialization of member constant " + "%qD of non-integral type %qT", decl, type); return 0; } @@ -6132,16 +6572,20 @@ check_static_variable_definition (tree decl, tree type) tree compute_array_index_type (tree name, tree size) { - tree type = TREE_TYPE (size); + tree type; tree itype; + if (error_operand_p (size)) + return error_mark_node; + + type = TREE_TYPE (size); /* The array bound must be an integer type. */ if (!dependent_type_p (type) && !INTEGRAL_TYPE_P (type)) { if (name) - error ("size of array `%D' has non-integral type `%T'", name, type); + error ("size of array %qD has non-integral type %qT", name, type); else - error ("size of array has non-integral type `%T'", type); + error ("size of array has non-integral type %qT", type); size = integer_one_node; type = TREE_TYPE (size); } @@ -6159,7 +6603,7 @@ compute_array_index_type (tree name, tree size) STRIP_TYPE_NOPS (size); /* It might be a const variable or enumeration constant. */ - size = decl_constant_value (size); + size = integral_constant_value (size); /* Normally, the array-bound will be a constant. */ if (TREE_CODE (size) == INTEGER_CST) @@ -6177,7 +6621,7 @@ compute_array_index_type (tree name, tree size) if (INT_CST_LT (size, integer_zero_node)) { if (name) - error ("size of array `%D' is negative", name); + error ("size of array %qD is negative", name); else error ("size of array is negative"); size = integer_one_node; @@ -6187,7 +6631,7 @@ compute_array_index_type (tree name, tree size) else if (integer_zerop (size) && pedantic && !in_system_header) { if (name) - pedwarn ("ISO C++ forbids zero-size array `%D'", name); + pedwarn ("ISO C++ forbids zero-size array %qD", name); else pedwarn ("ISO C++ forbids zero-size array"); } @@ -6196,15 +6640,16 @@ compute_array_index_type (tree name, tree size) { /* `(int) &fn' is not a valid array bound. */ if (name) - error ("size of array `%D' is not an integral constant-expression", - name); + error ("size of array %qD is not an integral constant-expression", + name); else error ("size of array is not an integral constant-expression"); + size = integer_one_node; } else if (pedantic) { if (name) - pedwarn ("ISO C++ forbids variable-size array `%D'", name); + pedwarn ("ISO C++ forbids variable-size array %qD", name); else pedwarn ("ISO C++ forbids variable-size array"); } @@ -6214,19 +6659,28 @@ compute_array_index_type (tree name, tree size) itype = build_min (MINUS_EXPR, sizetype, size, integer_one_node); else { + HOST_WIDE_INT saved_processing_template_decl; + /* Compute the index of the largest element in the array. It is - one less than the number of elements in the array. */ - itype - = fold (cp_build_binary_op (MINUS_EXPR, - cp_convert (ssizetype, size), - cp_convert (ssizetype, integer_one_node))); + one less than the number of elements in the array. We save + and restore PROCESSING_TEMPLATE_DECL so that computations in + cp_build_binary_op will be appropriately folded. */ + saved_processing_template_decl = processing_template_decl; + processing_template_decl = 0; + itype = cp_build_binary_op (MINUS_EXPR, + cp_convert (ssizetype, size), + cp_convert (ssizetype, integer_one_node)); + itype = fold (itype); + processing_template_decl = saved_processing_template_decl; + if (!TREE_CONSTANT (itype)) /* A variable sized array. */ itype = variable_size (itype); /* Make sure that there was no overflow when creating to a signed - index type. (For example, on a 32-bit machine, an array with - size 2^32 - 1 is too big.) */ - else if (TREE_OVERFLOW (itype)) + index type. (For example, on a 32-bit machine, an array with + size 2^32 - 1 is too big.) */ + else if (TREE_CODE (itype) == INTEGER_CST + && TREE_OVERFLOW (itype)) { error ("overflow in array dimension"); TREE_OVERFLOW (itype) = 0; @@ -6242,40 +6696,20 @@ compute_array_index_type (tree name, tree size) unqualified name, NULL_TREE is returned. */ tree -get_scope_of_declarator (tree declarator) +get_scope_of_declarator (const cp_declarator *declarator) { - if (!declarator) - return NULL_TREE; - - switch (TREE_CODE (declarator)) - { - case CALL_EXPR: - case ARRAY_REF: - case INDIRECT_REF: - case ADDR_EXPR: - /* For any of these, the main declarator is the first operand. */ - return get_scope_of_declarator (TREE_OPERAND - (declarator, 0)); + while (declarator && declarator->kind != cdk_id) + declarator = declarator->declarator; - case SCOPE_REF: - /* For a pointer-to-member, continue descending. */ - if (TREE_CODE (TREE_OPERAND (declarator, 1)) - == INDIRECT_REF) - return get_scope_of_declarator (TREE_OPERAND - (declarator, 1)); - /* Otherwise, if the declarator-id is a SCOPE_REF, the scope in - which the declaration occurs is the first operand. */ - return TREE_OPERAND (declarator, 0); + /* If the declarator-id is a SCOPE_REF, the scope in which the + declaration occurs is the first operand. */ + if (declarator + && declarator->u.id.qualifying_scope) + return declarator->u.id.qualifying_scope; - case TREE_LIST: - /* Attributes to be applied. The declarator is TREE_VALUE. */ - return get_scope_of_declarator (TREE_VALUE (declarator)); - - default: - /* Otherwise, we have a declarator-id which is not a qualified - name; the entity will be declared in the current scope. */ - return NULL_TREE; - } + /* Otherwise, the declarator is not a qualified name; the entity will + be declared in the current scope. */ + return NULL_TREE; } /* Returns an ARRAY_TYPE for an array with SIZE elements of the @@ -6322,7 +6756,7 @@ create_array_type_for_decl (tree name, tree type, tree size) if (error_msg) { if (name) - error ("declaration of `%D' as %s", name, error_msg); + error ("declaration of %qD as %s", name, error_msg); else error ("creating %s", error_msg); @@ -6336,10 +6770,12 @@ create_array_type_for_decl (tree name, tree type, tree size) if (TREE_CODE (type) == ARRAY_TYPE && !TYPE_DOMAIN (type)) { if (name) - error ("declaration of `%D' as multidimensional array must have bounds for all dimensions except the first", - name); + error ("declaration of %qD as multidimensional array must " + "have bounds for all dimensions except the first", + name); else - error ("multidimensional array must have bounds for all dimensions except the first"); + error ("multidimensional array must have bounds for all " + "dimensions except the first"); return error_mark_node; } @@ -6348,20 +6784,26 @@ create_array_type_for_decl (tree name, tree type, tree size) if (size) itype = compute_array_index_type (name, size); + /* [dcl.array] + T is called the array element type; this type shall not be [...] an + abstract class type. */ + abstract_virtuals_error (name, type); + return build_cplus_array_type (type, itype); } /* Check that it's OK to declare a function with the indicated TYPE. SFK indicates the kind of special function (if any) that this function is. OPTYPE is the type given in a conversion operator - declaration. Returns the actual return type of the function; that + declaration, or the class type for a constructor/destructor. + Returns the actual return type of the function; that may be different than TYPE if an error occurs, or for certain special functions. */ static tree check_special_function_return_type (special_function_kind sfk, - tree type, - tree optype) + tree type, + tree optype) { switch (sfk) { @@ -6369,26 +6811,35 @@ check_special_function_return_type (special_function_kind sfk, if (type) error ("return type specification for constructor invalid"); - type = void_type_node; + if (targetm.cxx.cdtor_returns_this () && !TYPE_FOR_JAVA (optype)) + type = build_pointer_type (optype); + else + type = void_type_node; break; case sfk_destructor: if (type) error ("return type specification for destructor invalid"); - type = void_type_node; + /* We can't use the proper return type here because we run into + problems with ambiguous bases and covariant returns. + Java classes are left unchanged because (void *) isn't a valid + Java type, and we don't want to change the Java ABI. */ + if (targetm.cxx.cdtor_returns_this () && !TYPE_FOR_JAVA (optype)) + type = build_pointer_type (void_type_node); + else + type = void_type_node; break; case sfk_conversion: if (type && !same_type_p (type, optype)) - error ("operator `%T' declared to return `%T'", optype, type); + error ("operator %qT declared to return %qT", optype, type); else if (type) - pedwarn ("return type specified for `operator %T'", optype); + pedwarn ("return type specified for %", optype); type = optype; break; default: - abort (); - break; + gcc_unreachable (); } return type; @@ -6397,7 +6848,7 @@ check_special_function_return_type (special_function_kind sfk, /* A variable or data member (whose unqualified name is IDENTIFIER) has been declared with the indicated TYPE. If the TYPE is not acceptable, issue an error message and return a type to use for - error-recovery purposes. */ + error-recovery purposes. */ tree check_var_type (tree identifier, tree type) @@ -6408,15 +6859,14 @@ check_var_type (tree identifier, tree type) error ("unnamed variable or field declared void"); else if (TREE_CODE (identifier) == IDENTIFIER_NODE) { - if (IDENTIFIER_OPNAME_P (identifier)) - abort (); - error ("variable or field `%E' declared void", identifier); + gcc_assert (!IDENTIFIER_OPNAME_P (identifier)); + error ("variable or field %qE declared void", identifier); } else error ("variable or field declared void"); - type = integer_type_node; + type = error_mark_node; } - + return type; } @@ -6457,33 +6907,33 @@ check_var_type (tree identifier, tree type) void S::f() { ... } when grokdeclarator is called for `S::f', the CURRENT_CLASS_TYPE - should not be `S'. */ + should not be `S'. + + Returns a DECL (if a declarator is present), a TYPE (if there is no + declarator, in cases like "struct S;"), or the ERROR_MARK_NODE if an + error occurs. */ tree -grokdeclarator (tree declarator, - tree declspecs, - enum decl_context decl_context, - int initialized, - tree* attrlist) +grokdeclarator (const cp_declarator *declarator, + const cp_decl_specifier_seq *declspecs, + enum decl_context decl_context, + int initialized, + tree* attrlist) { - RID_BIT_TYPE specbits; - int nclasses = 0; - tree spec; tree type = NULL_TREE; int longlong = 0; - int type_quals; int virtualp, explicitp, friendp, inlinep, staticp; int explicit_int = 0; int explicit_char = 0; int defaulted_int = 0; - int extern_langp = 0; - tree dependant_name = NULL_TREE; - + tree dependent_name = NULL_TREE; + tree typedef_decl = NULL_TREE; - const char *name; + const char *name = NULL; tree typedef_type = NULL_TREE; - int funcdef_flag = 0; - enum tree_code innermost_code = ERROR_MARK; + /* True if this declarator is a function definition. */ + bool funcdef_flag = false; + cp_declarator_kind innermost_code = cdk_error; int bitfield = 0; #if 0 /* See the code below that used this. */ @@ -6496,307 +6946,214 @@ grokdeclarator (tree declarator, special_function_kind sfk = sfk_none; tree dname = NULL_TREE; - tree ctype = current_class_type; tree ctor_return_type = NULL_TREE; enum overload_flags flags = NO_SPECIAL; - tree quals = NULL_TREE; + /* cv-qualifiers that apply to the declarator, for a declaration of + a member function. */ + cp_cv_quals memfn_quals = TYPE_UNQUALIFIED; + /* cv-qualifiers that apply to the type specified by the DECLSPECS. */ + int type_quals; tree raises = NULL_TREE; int template_count = 0; - tree in_namespace = NULL_TREE; tree returned_attrs = NULL_TREE; - tree scope = NULL_TREE; tree parms = NULL_TREE; + const cp_declarator *id_declarator; + /* The unqualified name of the declarator; either an + IDENTIFIER_NODE, BIT_NOT_EXPR, or TEMPLATE_ID_EXPR. */ + tree unqualified_id; + /* The class type, if any, in which this entity is located, + or NULL_TREE if none. Note that this value may be different from + the current class type; for example if an attempt is made to declare + "A::f" inside "B", this value will be "A". */ + tree ctype = current_class_type; + /* The NAMESPACE_DECL for the namespace in which this entity is + located. If an unqualified name is used to declare the entity, + this value will be NULL_TREE, even if the entity is located at + namespace scope. */ + tree in_namespace = NULL_TREE; + cp_storage_class storage_class; + bool unsigned_p, signed_p, short_p, long_p, thread_p; + bool type_was_error_mark_node = false; + + signed_p = declspecs->specs[(int)ds_signed]; + unsigned_p = declspecs->specs[(int)ds_unsigned]; + short_p = declspecs->specs[(int)ds_short]; + long_p = declspecs->specs[(int)ds_long]; + longlong = declspecs->specs[(int)ds_long] >= 2; + thread_p = declspecs->specs[(int)ds_thread]; - RIDBIT_RESET_ALL (specbits); if (decl_context == FUNCDEF) - funcdef_flag = 1, decl_context = NORMAL; + funcdef_flag = true, decl_context = NORMAL; else if (decl_context == MEMFUNCDEF) - funcdef_flag = -1, decl_context = FIELD; + funcdef_flag = true, decl_context = FIELD; else if (decl_context == BITFIELD) bitfield = 1, decl_context = FIELD; /* Look inside a declarator for the name being declared and get it as a string, for an error message. */ - { - tree *next = &declarator; - tree decl; - name = NULL; + for (id_declarator = declarator; + id_declarator; + id_declarator = id_declarator->declarator) + { + if (id_declarator->kind != cdk_id) + innermost_code = id_declarator->kind; - while (next && *next) - { - decl = *next; - switch (TREE_CODE (decl)) - { - case TREE_LIST: - /* For attributes. */ - next = &TREE_VALUE (decl); - break; - - case COND_EXPR: - ctype = NULL_TREE; - next = &TREE_OPERAND (decl, 0); - break; - - case BIT_NOT_EXPR: /* For C++ destructors! */ + switch (id_declarator->kind) + { + case cdk_function: + if (id_declarator->declarator + && id_declarator->declarator->kind == cdk_id) { - tree name = TREE_OPERAND (decl, 0); - tree rename = NULL_TREE; - - my_friendly_assert (flags == NO_SPECIAL, 152); - flags = DTOR_FLAG; - sfk = sfk_destructor; - if (TYPE_P (name)) - TREE_OPERAND (decl, 0) = name = constructor_name (name); - my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 153); - if (ctype == NULL_TREE) - { - if (current_class_type == NULL_TREE) - { - error ("destructors must be member functions"); - flags = NO_SPECIAL; - } - else - { - tree t = constructor_name (current_class_type); - if (t != name) - rename = t; - } - } - else - { - tree t = constructor_name (ctype); - if (t != name) - rename = t; - } - - if (rename) - { - error ("destructor `%T' must match class name `%T'", - name, rename); - TREE_OPERAND (decl, 0) = rename; - } - next = &name; + sfk = id_declarator->declarator->u.id.sfk; + if (sfk == sfk_destructor) + flags = DTOR_FLAG; } - break; + break; - case ADDR_EXPR: /* C++ reference declaration */ - /* Fall through. */ - case ARRAY_REF: - case INDIRECT_REF: - ctype = NULL_TREE; - innermost_code = TREE_CODE (decl); - next = &TREE_OPERAND (decl, 0); - break; - - case CALL_EXPR: - innermost_code = TREE_CODE (decl); - if (decl_context == FIELD && ctype == NULL_TREE) - ctype = current_class_type; - if (ctype - && TREE_OPERAND (decl, 0) - && (TREE_CODE (TREE_OPERAND (decl, 0)) == TYPE_DECL - && constructor_name_p (DECL_NAME (TREE_OPERAND (decl, 0)), - ctype))) - TREE_OPERAND (decl, 0) = constructor_name (ctype); - next = &TREE_OPERAND (decl, 0); - decl = *next; - if (ctype != NULL_TREE - && decl != NULL_TREE && flags != DTOR_FLAG - && constructor_name_p (decl, ctype)) + case cdk_id: + { + tree qualifying_scope = id_declarator->u.id.qualifying_scope; + tree decl = id_declarator->u.id.unqualified_name; + if (!decl) + break; + if (qualifying_scope) { - sfk = sfk_constructor; - ctor_return_type = ctype; - } - ctype = NULL_TREE; - break; - - case TEMPLATE_ID_EXPR: - { - tree fns = TREE_OPERAND (decl, 0); - - dname = fns; - if (TREE_CODE (dname) == COMPONENT_REF) - dname = TREE_OPERAND (dname, 1); - if (TREE_CODE (dname) != IDENTIFIER_NODE) + if (at_function_scope_p ()) { - my_friendly_assert (is_overloaded_fn (dname), - 19990331); - dname = DECL_NAME (get_first_fn (dname)); + /* [dcl.meaning] + + A declarator-id shall not be qualified except + for ... + + None of the cases are permitted in block + scope. */ + if (qualifying_scope == global_namespace) + error ("invalid use of qualified-name %<::%D%>", + decl); + else if (TYPE_P (qualifying_scope)) + error ("invalid use of qualified-name %<%T::%D%>", + qualifying_scope, decl); + else + error ("invalid use of qualified-name %<%D::%D%>", + qualifying_scope, decl); + return error_mark_node; } + else if (TYPE_P (qualifying_scope)) + { + ctype = qualifying_scope; + if (innermost_code != cdk_function + && current_class_type + && !UNIQUELY_DERIVED_FROM_P (ctype, + current_class_type)) + { + error ("type %qT is not derived from type %qT", + ctype, current_class_type); + return error_mark_node; + } + } + else if (TREE_CODE (qualifying_scope) == NAMESPACE_DECL) + in_namespace = qualifying_scope; } - /* Fall through. */ - - case IDENTIFIER_NODE: - if (TREE_CODE (decl) == IDENTIFIER_NODE) - dname = decl; - - next = 0; - - if (C_IS_RESERVED_WORD (dname)) + switch (TREE_CODE (decl)) { - error ("declarator-id missing; using reserved word `%D'", - dname); - name = IDENTIFIER_POINTER (dname); - } - else if (!IDENTIFIER_TYPENAME_P (dname)) - name = IDENTIFIER_POINTER (dname); - else - { - my_friendly_assert (flags == NO_SPECIAL, 154); - flags = TYPENAME_FLAG; - ctor_return_type = TREE_TYPE (dname); - sfk = sfk_conversion; - if (is_typename_at_global_scope (dname)) + case BIT_NOT_EXPR: + { + tree type; + + if (innermost_code != cdk_function) + { + error ("declaration of %qD as non-function", decl); + return error_mark_node; + } + else if (!qualifying_scope + && !(current_class_type && at_class_scope_p ())) + { + error ("declaration of %qD as non-member", decl); + return error_mark_node; + } + + type = TREE_OPERAND (decl, 0); + name = IDENTIFIER_POINTER (constructor_name (type)); + dname = decl; + } + break; + + case TEMPLATE_ID_EXPR: + { + tree fns = TREE_OPERAND (decl, 0); + + dname = fns; + if (TREE_CODE (dname) != IDENTIFIER_NODE) + { + gcc_assert (is_overloaded_fn (dname)); + dname = DECL_NAME (get_first_fn (dname)); + } + } + /* Fall through. */ + + case IDENTIFIER_NODE: + if (TREE_CODE (decl) == IDENTIFIER_NODE) + dname = decl; + + if (C_IS_RESERVED_WORD (dname)) + { + error ("declarator-id missing; using reserved word %qD", + dname); + name = IDENTIFIER_POINTER (dname); + } + else if (!IDENTIFIER_TYPENAME_P (dname)) name = IDENTIFIER_POINTER (dname); else - name = ""; + { + gcc_assert (flags == NO_SPECIAL); + flags = TYPENAME_FLAG; + ctor_return_type = TREE_TYPE (dname); + sfk = sfk_conversion; + if (is_typename_at_global_scope (dname)) + name = IDENTIFIER_POINTER (dname); + else + name = ""; + } + break; + + default: + gcc_unreachable (); } break; - /* C++ extension */ - case SCOPE_REF: - { - /* Perform error checking, and decide on a ctype. */ - tree cname = TREE_OPERAND (decl, 0); - if (cname == NULL_TREE) - ctype = NULL_TREE; - else if (TREE_CODE (cname) == NAMESPACE_DECL) - { - ctype = NULL_TREE; - in_namespace = TREE_OPERAND (decl, 0); - } - else if (! is_aggr_type (cname, 1)) - ctype = NULL_TREE; - /* Must test TREE_OPERAND (decl, 1), in case user gives - us `typedef (class::memfunc)(int); memfunc *memfuncptr;' */ - else if (TREE_OPERAND (decl, 1) - && TREE_CODE (TREE_OPERAND (decl, 1)) == INDIRECT_REF) - ctype = cname; - else if (TREE_CODE (cname) == TEMPLATE_TYPE_PARM - || TREE_CODE (cname) == BOUND_TEMPLATE_TEMPLATE_PARM) - { - /* This might be declaring a member of a template - parm to be a friend. */ - ctype = cname; - dependant_name = TREE_OPERAND (decl, 1); - } - else if (ctype == NULL_TREE) - ctype = cname; - else if (TREE_COMPLEXITY (decl) == current_class_depth) - ; - else - { - if (! UNIQUELY_DERIVED_FROM_P (cname, ctype)) - { - error ("type `%T' is not derived from type `%T'", - cname, ctype); - ctype = NULL_TREE; - } - else - ctype = cname; - } - - /* It is valid to write: - - class C { void f(); }; - typedef C D; - void D::f(); - - The standard is not clear about whether `typedef const C D' is - legal; as of 2002-09-15 the committee is considering - that question. EDG 3.0 allows that syntax. - Therefore, we do as well. */ - if (ctype) - ctype = TYPE_MAIN_VARIANT (ctype); - /* Update the declarator so that when we process it - again the correct type is present. */ - TREE_OPERAND (decl, 0) = ctype; - - if (ctype && TREE_CODE (TREE_OPERAND (decl, 1)) == TYPE_DECL - && constructor_name_p (DECL_NAME (TREE_OPERAND (decl, 1)), - ctype)) - TREE_OPERAND (decl, 1) = constructor_name (ctype); - next = &TREE_OPERAND (decl, 1); - decl = *next; - if (ctype) - { - tree name = decl; - - if (TREE_CODE (name) == BIT_NOT_EXPR) - name = TREE_OPERAND (name, 0); - - if (!constructor_name_p (decl, ctype)) - ; - else if (decl == name) - { - sfk = sfk_constructor; - ctor_return_type = ctype; - } - else - { - sfk = sfk_destructor; - ctor_return_type = ctype; - flags = DTOR_FLAG; - TREE_OPERAND (decl, 0) = constructor_name (ctype); - next = &TREE_OPERAND (decl, 0); - } - } - } + case cdk_array: + case cdk_pointer: + case cdk_reference: + case cdk_ptrmem: break; - case ERROR_MARK: - next = 0; - break; - - case TYPE_DECL: - /* Parse error puts this typespec where - a declarator should go. */ - error ("`%T' specified as declarator-id", DECL_NAME (decl)); - if (TREE_TYPE (decl) == current_class_type) - error (" perhaps you want `%T' for a constructor", - current_class_name); - dname = DECL_NAME (decl); - name = IDENTIFIER_POINTER (dname); - - /* Avoid giving two errors for this. */ - IDENTIFIER_CLASS_VALUE (dname) = NULL_TREE; - - declspecs = tree_cons (NULL_TREE, integer_type_node, declspecs); - *next = dname; - next = 0; - break; - - case BASELINK: - next = &BASELINK_FUNCTIONS (decl); - break; - - case TEMPLATE_DECL: - /* Sometimes, we see a template-name used as part of a - decl-specifier like in - std::allocator alloc; - Handle that gracefully. */ - error ("invalid use of template-name '%E' in a declarator", decl); + case cdk_error: return error_mark_node; - break; - + default: - my_friendly_assert (0, 20020917); + gcc_unreachable (); } - } - } + } + if (id_declarator->kind == cdk_id) + break; + } - /* A function definition's declarator must have the form of - a function declarator. */ + /* [dcl.fct.edf] - if (funcdef_flag && innermost_code != CALL_EXPR) - return 0; + The declarator in a function-definition shall have the form + D1 ( parameter-declaration-clause) ... */ + if (funcdef_flag && innermost_code != cdk_function) + { + error ("function definition does not declare parameters"); + return error_mark_node; + } if (((dname && IDENTIFIER_OPNAME_P (dname)) || flags == TYPENAME_FLAG) - && innermost_code != CALL_EXPR - && ! (ctype && declspecs == NULL_TREE)) + && innermost_code != cdk_function + && ! (ctype && !declspecs->any_specifiers_p)) { - error ("declaration of `%D' as non-function", dname); - return void_type_node; + error ("declaration of %qD as non-function", dname); + return error_mark_node; } /* Anything declared one level down from the top level @@ -6825,146 +7182,43 @@ grokdeclarator (tree declarator, if (name == NULL) name = decl_context == PARM ? "parameter" : "type name"; - /* Look through the decl specs and record which ones appear. - Some typespecs are defined as built-in typenames. - Others, the ones that are modifiers of other types, - are represented by bits in SPECBITS: set the bits for - the modifiers that appear. Storage class keywords are also in SPECBITS. - - If there is a typedef name or a type, store the type in TYPE. - This includes builtin typedefs such as `int'. - - Set EXPLICIT_INT if the type is `int' or `char' and did not - come from a user typedef. - - Set LONGLONG if `long' is mentioned twice. - - For C++, constructors and destructors have their own fast treatment. */ - - for (spec = declspecs; spec; spec = TREE_CHAIN (spec)) + /* If there were multiple types specified in the decl-specifier-seq, + issue an error message. */ + if (declspecs->multiple_types_p) { - int i; - tree id; - - /* Certain parse errors slip through. For example, - `int class;' is not caught by the parser. Try - weakly to recover here. */ - if (TREE_CODE (spec) != TREE_LIST) - return 0; - - id = TREE_VALUE (spec); - - /* If the entire declaration is itself tagged as deprecated then - suppress reports of deprecated items. */ - if (!adding_implicit_members && id && TREE_DEPRECATED (id)) - { - if (deprecated_state != DEPRECATED_SUPPRESS) - warn_deprecated_use (id); - } - - if (TREE_CODE (id) == IDENTIFIER_NODE) - { - if (id == ridpointers[(int) RID_INT] - || id == ridpointers[(int) RID_CHAR] - || id == ridpointers[(int) RID_BOOL] - || id == ridpointers[(int) RID_WCHAR]) - { - if (type) - { - if (id == ridpointers[(int) RID_BOOL]) - error ("`bool' is now a keyword"); - else - error ("extraneous `%T' ignored", id); - } - else - { - if (id == ridpointers[(int) RID_INT]) - explicit_int = 1; - else if (id == ridpointers[(int) RID_CHAR]) - explicit_char = 1; - type = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (id)); - } - goto found; - } - /* C++ aggregate types. */ - if (IDENTIFIER_HAS_TYPE_VALUE (id)) - { - if (type) - error ("multiple declarations `%T' and `%T'", type, id); - else - type = IDENTIFIER_TYPE_VALUE (id); - goto found; - } - - for (i = (int) RID_FIRST_MODIFIER; i <= (int) RID_LAST_MODIFIER; i++) - { - if (ridpointers[i] == id) - { - if (i == (int) RID_LONG && RIDBIT_SETP (i, specbits)) - { - if (pedantic && ! in_system_header && warn_long_long) - pedwarn ("ISO C++ does not support `long long'"); - if (longlong) - error ("`long long long' is too long for GCC"); - else - longlong = 1; - } - else if (RIDBIT_SETP (i, specbits)) - pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id)); - - /* Diagnose "__thread extern" or "__thread static". */ - if (RIDBIT_SETP (RID_THREAD, specbits)) - { - if (i == (int)RID_EXTERN) - error ("`__thread' before `extern'"); - else if (i == (int)RID_STATIC) - error ("`__thread' before `static'"); - } - - if (i == (int)RID_EXTERN - && TREE_PURPOSE (spec) == error_mark_node) - /* This extern was part of a language linkage. */ - extern_langp = 1; - - RIDBIT_SET (i, specbits); - goto found; - } - } - } - else if (TREE_CODE (id) == TYPE_DECL) - { - if (type) - error ("multiple declarations `%T' and `%T'", type, - TREE_TYPE (id)); - else - { - type = TREE_TYPE (id); - TREE_VALUE (spec) = type; - typedef_decl = id; - } - goto found; - } - if (type) - error ("two or more data types in declaration of `%s'", name); - else if (TREE_CODE (id) == IDENTIFIER_NODE) - { - tree t = lookup_name (id, 1); - if (!t || TREE_CODE (t) != TYPE_DECL) - error ("`%s' fails to be a typedef or built in type", - IDENTIFIER_POINTER (id)); - else - { - type = TREE_TYPE (t); - typedef_decl = t; - } - } - else if (id != error_mark_node) - /* Can't change CLASS nodes into RECORD nodes here! */ - type = id; - - found: ; + error ("two or more data types in declaration of %qs", name); + return error_mark_node; } + /* Extract the basic type from the decl-specifier-seq. */ + type = declspecs->type; + if (type == error_mark_node) + { + type = NULL_TREE; + type_was_error_mark_node = true; + } + /* If the entire declaration is itself tagged as deprecated then + suppress reports of deprecated items. */ + if (type && TREE_DEPRECATED (type) + && deprecated_state != DEPRECATED_SUPPRESS) + warn_deprecated_use (type); + if (type && TREE_CODE (type) == TYPE_DECL) + { + typedef_decl = type; + type = TREE_TYPE (typedef_decl); + } + /* No type at all: default to `int', and set DEFAULTED_INT + because it was not a user-defined typedef. */ + if (type == NULL_TREE && (signed_p || unsigned_p || long_p || short_p)) + { + /* These imply 'int'. */ + type = integer_type_node; + defaulted_int = 1; + } + /* Gather flags. */ + explicit_int = declspecs->explicit_int_p; + explicit_char = declspecs->explicit_char_p; + #if 0 /* See the code below that used this. */ if (typedef_decl) @@ -6972,19 +7226,9 @@ grokdeclarator (tree declarator, #endif typedef_type = type; - /* No type at all: default to `int', and set DEFAULTED_INT - because it was not a user-defined typedef. */ - if (type == NULL_TREE - && (RIDBIT_SETP (RID_SIGNED, specbits) - || RIDBIT_SETP (RID_UNSIGNED, specbits) - || RIDBIT_SETP (RID_LONG, specbits) - || RIDBIT_SETP (RID_SHORT, specbits))) - { - /* These imply 'int'. */ - type = integer_type_node; - defaulted_int = 1; - } + if (sfk != sfk_conversion) + ctor_return_type = ctype; if (sfk != sfk_none) type = check_special_function_return_type (sfk, type, @@ -7004,66 +7248,59 @@ grokdeclarator (tree declarator, && in_namespace == NULL_TREE && current_namespace == global_namespace); - if (in_system_header || flag_ms_extensions) + if (type_was_error_mark_node) + /* We've already issued an error, don't complain more. */; + else if (in_system_header || flag_ms_extensions) /* Allow it, sigh. */; else if (pedantic || ! is_main) - pedwarn ("ISO C++ forbids declaration of `%s' with no type", - name); + pedwarn ("ISO C++ forbids declaration of %qs with no type", name); else if (warn_return_type) - warning ("ISO C++ forbids declaration of `%s' with no type", - name); + warning (0, "ISO C++ forbids declaration of %qs with no type", name); type = integer_type_node; } - + ctype = NULL_TREE; /* Now process the modifiers that were specified and check for invalid combinations. */ /* Long double is a special combination. */ - - if (RIDBIT_SETP (RID_LONG, specbits) - && TYPE_MAIN_VARIANT (type) == double_type_node) + if (long_p && !longlong && TYPE_MAIN_VARIANT (type) == double_type_node) { - RIDBIT_RESET (RID_LONG, specbits); + long_p = false; type = build_qualified_type (long_double_type_node, cp_type_quals (type)); } /* Check all other uses of type modifiers. */ - if (RIDBIT_SETP (RID_UNSIGNED, specbits) - || RIDBIT_SETP (RID_SIGNED, specbits) - || RIDBIT_SETP (RID_LONG, specbits) - || RIDBIT_SETP (RID_SHORT, specbits)) + if (unsigned_p || signed_p || long_p || short_p) { int ok = 0; - if (TREE_CODE (type) == REAL_TYPE) - error ("short, signed or unsigned invalid for `%s'", name); - else if (TREE_CODE (type) != INTEGER_TYPE) - error ("long, short, signed or unsigned invalid for `%s'", name); - else if (RIDBIT_SETP (RID_LONG, specbits) - && RIDBIT_SETP (RID_SHORT, specbits)) - error ("long and short specified together for `%s'", name); - else if ((RIDBIT_SETP (RID_LONG, specbits) - || RIDBIT_SETP (RID_SHORT, specbits)) - && explicit_char) - error ("long or short specified with char for `%s'", name); - else if ((RIDBIT_SETP (RID_LONG, specbits) - || RIDBIT_SETP (RID_SHORT, specbits)) - && TREE_CODE (type) == REAL_TYPE) - error ("long or short specified with floating type for `%s'", name); - else if (RIDBIT_SETP (RID_SIGNED, specbits) - && RIDBIT_SETP (RID_UNSIGNED, specbits)) - error ("signed and unsigned given together for `%s'", name); + if ((signed_p || unsigned_p) && TREE_CODE (type) != INTEGER_TYPE) + error ("% or % invalid for %qs", name); + else if (signed_p && unsigned_p) + error ("% and % specified together for %qs", name); + else if (longlong && TREE_CODE (type) != INTEGER_TYPE) + error ("% invalid for %qs", name); + else if (long_p && TREE_CODE (type) == REAL_TYPE) + error ("% invalid for %qs", name); + else if (short_p && TREE_CODE (type) == REAL_TYPE) + error ("% invalid for %qs", name); + else if ((long_p || short_p) && TREE_CODE (type) != INTEGER_TYPE) + error ("% or % invalid for %qs", name); + else if ((long_p || short_p) && explicit_char) + error ("% or % specified with char for %qs", name); + else if (long_p && short_p) + error ("% and % specified together for %qs", name); else { ok = 1; if (!explicit_int && !defaulted_int && !explicit_char && pedantic) { - pedwarn ("long, short, signed or unsigned used invalidly for `%s'", + pedwarn ("long, short, signed or unsigned used invalidly for %qs", name); if (flag_pedantic_errors) ok = 0; @@ -7073,24 +7310,17 @@ grokdeclarator (tree declarator, /* Discard the type modifiers if they are invalid. */ if (! ok) { - RIDBIT_RESET (RID_UNSIGNED, specbits); - RIDBIT_RESET (RID_SIGNED, specbits); - RIDBIT_RESET (RID_LONG, specbits); - RIDBIT_RESET (RID_SHORT, specbits); + unsigned_p = false; + signed_p = false; + long_p = false; + short_p = false; longlong = 0; } } - if (RIDBIT_SETP (RID_COMPLEX, specbits) - && TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE) - { - error ("complex invalid for `%s'", name); - RIDBIT_RESET (RID_COMPLEX, specbits); - } - /* Decide whether an integer type is signed or not. Optionally treat bitfields as signed by default. */ - if (RIDBIT_SETP (RID_UNSIGNED, specbits) + if (unsigned_p /* [class.bit] It is implementation-defined whether a plain (neither @@ -7100,21 +7330,20 @@ grokdeclarator (tree declarator, Naturally, we extend this to long long as well. Note that this does not include wchar_t. */ || (bitfield && !flag_signed_bitfields - && RIDBIT_NOTSETP (RID_SIGNED, specbits) + && !signed_p /* A typedef for plain `int' without `signed' can be controlled just like plain `int', but a typedef for `signed int' cannot be so controlled. */ && !(typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl)) - && (TREE_CODE (type) == INTEGER_TYPE - || TREE_CODE (type) == CHAR_TYPE) + && TREE_CODE (type) == INTEGER_TYPE && !same_type_p (TYPE_MAIN_VARIANT (type), wchar_type_node))) { if (longlong) type = long_long_unsigned_type_node; - else if (RIDBIT_SETP (RID_LONG, specbits)) + else if (long_p) type = long_unsigned_type_node; - else if (RIDBIT_SETP (RID_SHORT, specbits)) + else if (short_p) type = short_unsigned_type_node; else if (type == char_type_node) type = unsigned_char_type_node; @@ -7123,28 +7352,26 @@ grokdeclarator (tree declarator, else type = unsigned_type_node; } - else if (RIDBIT_SETP (RID_SIGNED, specbits) - && type == char_type_node) + else if (signed_p && type == char_type_node) type = signed_char_type_node; else if (longlong) type = long_long_integer_type_node; - else if (RIDBIT_SETP (RID_LONG, specbits)) + else if (long_p) type = long_integer_type_node; - else if (RIDBIT_SETP (RID_SHORT, specbits)) + else if (short_p) type = short_integer_type_node; - if (RIDBIT_SETP (RID_COMPLEX, specbits)) + if (declspecs->specs[(int)ds_complex]) { + if (TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE) + error ("complex invalid for %qs", name); /* If we just have "complex", it is equivalent to "complex double", but if any modifiers at all are specified it is the complex form of TYPE. E.g, "complex short" is "complex short int". */ - if (defaulted_int && ! longlong - && ! (RIDBIT_SETP (RID_LONG, specbits) - || RIDBIT_SETP (RID_SHORT, specbits) - || RIDBIT_SETP (RID_SIGNED, specbits) - || RIDBIT_SETP (RID_UNSIGNED, specbits))) + else if (defaulted_int && ! longlong + && ! (long_p || short_p || signed_p || unsigned_p)) type = complex_double_type_node; else if (type == integer_type_node) type = complex_integer_type_node; @@ -7159,67 +7386,72 @@ grokdeclarator (tree declarator, } type_quals = TYPE_UNQUALIFIED; - if (RIDBIT_SETP (RID_CONST, specbits)) + if (declspecs->specs[(int)ds_const]) type_quals |= TYPE_QUAL_CONST; - if (RIDBIT_SETP (RID_VOLATILE, specbits)) + if (declspecs->specs[(int)ds_volatile]) type_quals |= TYPE_QUAL_VOLATILE; - if (RIDBIT_SETP (RID_RESTRICT, specbits)) + if (declspecs->specs[(int)ds_restrict]) type_quals |= TYPE_QUAL_RESTRICT; if (sfk == sfk_conversion && type_quals != TYPE_UNQUALIFIED) - error ("qualifiers are not allowed on declaration of `operator %T'", - ctor_return_type); + error ("qualifiers are not allowed on declaration of %", + ctor_return_type); + if (TREE_CODE (type) == FUNCTION_TYPE + && type_quals != TYPE_UNQUALIFIED) + { + /* This was an error in C++98 (cv-qualifiers cannot be added to + a function type), but DR 295 makes the code well-formed by + dropping the extra qualifiers. */ + if (pedantic) + { + tree bad_type = build_qualified_type (type, type_quals); + pedwarn ("ignoring %qV qualifiers added to function type %qT", + bad_type, type); + } + type_quals = TYPE_UNQUALIFIED; + } type_quals |= cp_type_quals (type); type = cp_build_qualified_type_real (type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl) - ? tf_ignore_bad_quals : 0) | tf_error | tf_warning)); + ? tf_ignore_bad_quals : 0) | tf_warning_or_error)); /* We might have ignored or rejected some of the qualifiers. */ type_quals = cp_type_quals (type); - - staticp = 0; - inlinep = !! RIDBIT_SETP (RID_INLINE, specbits); - virtualp = RIDBIT_SETP (RID_VIRTUAL, specbits); - RIDBIT_RESET (RID_VIRTUAL, specbits); - explicitp = RIDBIT_SETP (RID_EXPLICIT, specbits) != 0; - RIDBIT_RESET (RID_EXPLICIT, specbits); - if (RIDBIT_SETP (RID_STATIC, specbits)) + staticp = 0; + inlinep = !! declspecs->specs[(int)ds_inline]; + virtualp = !! declspecs->specs[(int)ds_virtual]; + explicitp = !! declspecs->specs[(int)ds_explicit]; + + storage_class = declspecs->storage_class; + if (storage_class == sc_static) staticp = 1 + (decl_context == FIELD); if (virtualp && staticp == 2) { - error ("member `%D' cannot be declared both virtual and static", dname); - RIDBIT_RESET (RID_STATIC, specbits); + error ("member %qD cannot be declared both virtual and static", dname); + storage_class = sc_none; staticp = 0; } - friendp = RIDBIT_SETP (RID_FRIEND, specbits); - RIDBIT_RESET (RID_FRIEND, specbits); + friendp = !! declspecs->specs[(int)ds_friend]; - if (dependant_name && !friendp) + if (dependent_name && !friendp) { - error ("`%T::%D' is not a valid declarator", ctype, dependant_name); - return void_type_node; + error ("%<%T::%D%> is not a valid declarator", ctype, dependent_name); + return error_mark_node; } - - /* Warn if two storage classes are given. Default to `auto'. */ - if (RIDBIT_ANY_SET (specbits)) + /* Issue errors about use of storage classes for parameters. */ + if (decl_context == PARM) { - if (RIDBIT_SETP (RID_STATIC, specbits)) nclasses++; - if (RIDBIT_SETP (RID_EXTERN, specbits) && !extern_langp) nclasses++; - if (RIDBIT_SETP (RID_THREAD, specbits)) nclasses++; - if (decl_context == PARM && nclasses > 0) - error ("storage class specifiers invalid in parameter declarations"); - if (RIDBIT_SETP (RID_TYPEDEF, specbits)) + if (declspecs->specs[(int)ds_typedef]) { - if (decl_context == PARM) - error ("typedef declaration invalid in parameter declaration"); - nclasses++; + error ("typedef declaration invalid in parameter declaration"); + return error_mark_node; } - if (RIDBIT_SETP (RID_AUTO, specbits)) nclasses++; - if (RIDBIT_SETP (RID_REGISTER, specbits)) nclasses++; - if (!nclasses && !friendp && extern_langp) - nclasses++; + else if (storage_class == sc_static + || storage_class == sc_extern + || thread_p) + error ("storage class specifiers invalid in parameter declarations"); } /* Give error if `virtual' is used outside of class declaration. */ @@ -7232,249 +7464,188 @@ grokdeclarator (tree declarator, /* Static anonymous unions are dealt with here. */ if (staticp && decl_context == TYPENAME - && TREE_CODE (declspecs) == TREE_LIST - && ANON_AGGR_TYPE_P (TREE_VALUE (declspecs))) + && declspecs->type + && ANON_AGGR_TYPE_P (declspecs->type)) decl_context = FIELD; /* Warn about storage classes that are invalid for certain kinds of declarations (parameters, typenames, etc.). */ - - /* "static __thread" and "extern __thread" are allowed. */ - if (nclasses == 2 - && RIDBIT_SETP (RID_THREAD, specbits) - && (RIDBIT_SETP (RID_EXTERN, specbits) - || RIDBIT_SETP (RID_STATIC, specbits))) - nclasses = 1; - - if (nclasses > 1) - error ("multiple storage classes in declaration of `%s'", name); - else if (decl_context != NORMAL && nclasses > 0) + if (thread_p + && ((storage_class + && storage_class != sc_extern + && storage_class != sc_static) + || declspecs->specs[(int)ds_typedef])) + { + error ("multiple storage classes in declaration of %qs", name); + thread_p = false; + } + if (declspecs->conflicting_specifiers_p) + { + error ("conflicting specifiers in declaration of %qs", name); + storage_class = sc_none; + } + else if (decl_context != NORMAL + && ((storage_class != sc_none + && storage_class != sc_mutable) + || thread_p)) { if ((decl_context == PARM || decl_context == CATCHPARM) - && (RIDBIT_SETP (RID_REGISTER, specbits) - || RIDBIT_SETP (RID_AUTO, specbits))) + && (storage_class == sc_register + || storage_class == sc_auto)) ; - else if (RIDBIT_SETP (RID_TYPEDEF, specbits)) + else if (declspecs->specs[(int)ds_typedef]) ; else if (decl_context == FIELD /* C++ allows static class elements. */ - && RIDBIT_SETP (RID_STATIC, specbits)) + && storage_class == sc_static) /* C++ also allows inlines and signed and unsigned elements, but in those cases we don't come in here. */ ; else { if (decl_context == FIELD) - { - tree tmp = NULL_TREE; - int op = 0; - - if (declarator) - { - /* Avoid trying to get an operand off an identifier node. */ - if (TREE_CODE (declarator) == IDENTIFIER_NODE) - tmp = declarator; - else - tmp = TREE_OPERAND (declarator, 0); - op = IDENTIFIER_OPNAME_P (tmp); - if (IDENTIFIER_TYPENAME_P (tmp)) - { - if (is_typename_at_global_scope (tmp)) - name = IDENTIFIER_POINTER (tmp); - else - name = ""; - } - } - error ("storage class specified for %s `%s'", - op ? "member operator" : "field", - name); - } + error ("storage class specified for %qs", name); else { if (decl_context == PARM || decl_context == CATCHPARM) - error ("storage class specified for parameter `%s'", name); + error ("storage class specified for parameter %qs", name); else error ("storage class specified for typename"); } - RIDBIT_RESET (RID_REGISTER, specbits); - RIDBIT_RESET (RID_AUTO, specbits); - RIDBIT_RESET (RID_EXTERN, specbits); - RIDBIT_RESET (RID_THREAD, specbits); + if (storage_class == sc_register + || storage_class == sc_auto + || storage_class == sc_extern + || thread_p) + storage_class = sc_none; } } - else if (RIDBIT_SETP (RID_EXTERN, specbits) && initialized && !funcdef_flag) + else if (storage_class == sc_extern && initialized + && !funcdef_flag) { if (toplevel_bindings_p ()) { /* It's common practice (and completely valid) to have a const be initialized and declared extern. */ if (!(type_quals & TYPE_QUAL_CONST)) - warning ("`%s' initialized and declared `extern'", name); + warning (0, "%qs initialized and declared %", name); } else - error ("`%s' has both `extern' and initializer", name); + error ("%qs has both % and initializer", name); } - else if (RIDBIT_SETP (RID_EXTERN, specbits) && funcdef_flag + else if (storage_class == sc_extern && funcdef_flag && ! toplevel_bindings_p ()) - error ("nested function `%s' declared `extern'", name); + error ("nested function %qs declared %", name); else if (toplevel_bindings_p ()) { - if (RIDBIT_SETP (RID_AUTO, specbits)) - error ("top-level declaration of `%s' specifies `auto'", name); + if (storage_class == sc_auto) + error ("top-level declaration of %qs specifies %", name); } - else if (RIDBIT_SETP (RID_THREAD, specbits) - && !RIDBIT_SETP (RID_EXTERN, specbits) - && !RIDBIT_SETP (RID_STATIC, specbits)) + else if (thread_p + && storage_class != sc_extern + && storage_class != sc_static) { - error ("function-scope `%s' implicitly auto and declared `__thread'", + error ("function-scope %qs implicitly auto and declared %<__thread%>", name); - RIDBIT_RESET (RID_THREAD, specbits); + thread_p = false; } - if (nclasses > 0 && friendp) + if (storage_class && friendp) error ("storage class specifiers invalid in friend function declarations"); - scope = get_scope_of_declarator (declarator); - - /* Now figure out the structure of the declarator proper. - Descend through it, creating more complex types, until we reach - the declared identifier (or NULL_TREE, in an abstract declarator). */ - - while (declarator && TREE_CODE (declarator) != IDENTIFIER_NODE - && TREE_CODE (declarator) != TEMPLATE_ID_EXPR) + if (!id_declarator) + unqualified_id = NULL_TREE; + else { - /* Each level of DECLARATOR is either an ARRAY_REF (for ...[..]), - an INDIRECT_REF (for *...), - a CALL_EXPR (for ...(...)), - an identifier (for the name being declared) - or a null pointer (for the place in an absolute declarator - where the name was omitted). - For the last two cases, we have just exited the loop. + unqualified_id = id_declarator->u.id.unqualified_name; + switch (TREE_CODE (unqualified_id)) + { + case BIT_NOT_EXPR: + unqualified_id + = constructor_name (TREE_OPERAND (unqualified_id, 0)); + break; - For C++ it could also be - a SCOPE_REF (for class :: ...). In this case, we have converted - sensible names to types, and those are the values we use to - qualify the member name. - an ADDR_EXPR (for &...), - a BIT_NOT_EXPR (for destructors) + case IDENTIFIER_NODE: + case TEMPLATE_ID_EXPR: + break; - At this point, TYPE is the type of elements of an array, - or for a function to return, or for a pointer to point to. - After this sequence of ifs, TYPE is the type of the - array or function or pointer, and DECLARATOR has had its - outermost layer removed. */ + default: + gcc_unreachable (); + } + } + + /* Determine the type of the entity declared by recurring on the + declarator. */ + for (; declarator; declarator = declarator->declarator) + { + const cp_declarator *inner_declarator; + tree attrs; if (type == error_mark_node) + return error_mark_node; + + attrs = declarator->attributes; + if (attrs) { - if (declarator == error_mark_node) - return error_mark_node; - else if (TREE_CODE (declarator) == SCOPE_REF) - declarator = TREE_OPERAND (declarator, 1); - else - declarator = TREE_OPERAND (declarator, 0); - continue; - } - if (quals != NULL_TREE - && (declarator == NULL_TREE - || TREE_CODE (declarator) != SCOPE_REF)) - { - if (ctype == NULL_TREE && TREE_CODE (type) == METHOD_TYPE) - ctype = TYPE_METHOD_BASETYPE (type); - if (ctype != NULL_TREE) - { - tree dummy = build_decl (TYPE_DECL, NULL_TREE, type); - grok_method_quals (ctype, dummy, quals); - type = TREE_TYPE (dummy); - quals = NULL_TREE; - } + int attr_flags; + + attr_flags = 0; + if (declarator == NULL || declarator->kind == cdk_id) + attr_flags |= (int) ATTR_FLAG_DECL_NEXT; + if (declarator->kind == cdk_function) + attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT; + if (declarator->kind == cdk_array) + attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT; + returned_attrs = decl_attributes (&type, + chainon (returned_attrs, attrs), + attr_flags); } - switch (TREE_CODE (declarator)) + if (declarator->kind == cdk_id) + break; + + inner_declarator = declarator->declarator; + + switch (declarator->kind) { - case TREE_LIST: - { - /* We encode a declarator with embedded attributes using - a TREE_LIST. */ - tree attrs = TREE_PURPOSE (declarator); - tree inner_decl; - int attr_flags; - - declarator = TREE_VALUE (declarator); - inner_decl = declarator; - while (inner_decl != NULL_TREE - && TREE_CODE (inner_decl) == TREE_LIST) - inner_decl = TREE_VALUE (inner_decl); - attr_flags = 0; - if (inner_decl == NULL_TREE - || TREE_CODE (inner_decl) == IDENTIFIER_NODE) - attr_flags |= (int) ATTR_FLAG_DECL_NEXT; - if (TREE_CODE (inner_decl) == CALL_EXPR) - attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT; - if (TREE_CODE (inner_decl) == ARRAY_REF) - attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT; - returned_attrs = decl_attributes (&type, - chainon (returned_attrs, attrs), - attr_flags); - } + case cdk_array: + type = create_array_type_for_decl (dname, type, + declarator->u.array.bounds); break; - case ARRAY_REF: - { - tree size = TREE_OPERAND (declarator, 1); - declarator = TREE_OPERAND (declarator, 0); - - type = create_array_type_for_decl (dname, type, size); - - ctype = NULL_TREE; - } - break; - - case CALL_EXPR: + case cdk_function: { tree arg_types; int funcdecl_p; - tree inner_parms = CALL_DECLARATOR_PARMS (declarator); - tree inner_decl = TREE_OPERAND (declarator, 0); /* Declaring a function type. Make sure we have a valid type for the function to return. */ /* We now know that the TYPE_QUALS don't apply to the - decl, but to its return type. */ + decl, but to its return type. */ type_quals = TYPE_UNQUALIFIED; /* Warn about some types functions can't return. */ if (TREE_CODE (type) == FUNCTION_TYPE) { - error ("`%s' declared as function returning a function", name); + error ("%qs declared as function returning a function", name); type = integer_type_node; } if (TREE_CODE (type) == ARRAY_TYPE) { - error ("`%s' declared as function returning an array", name); + error ("%qs declared as function returning an array", name); type = integer_type_node; } - if (inner_decl && TREE_CODE (inner_decl) == SCOPE_REF) - inner_decl = TREE_OPERAND (inner_decl, 1); - - if (inner_decl && TREE_CODE (inner_decl) == TEMPLATE_ID_EXPR) - inner_decl = dname; - /* Pick up type qualifiers which should be applied to `this'. */ - quals = CALL_DECLARATOR_QUALS (declarator); + memfn_quals = declarator->u.function.qualifiers; /* Pick up the exception specifications. */ - raises = CALL_DECLARATOR_EXCEPTION_SPEC (declarator); + raises = declarator->u.function.exception_specification; /* Say it's a definition only for the CALL_EXPR closest to the identifier. */ - funcdecl_p - = inner_decl - && (TREE_CODE (inner_decl) == IDENTIFIER_NODE - || TREE_CODE (inner_decl) == TEMPLATE_ID_EXPR - || TREE_CODE (inner_decl) == BIT_NOT_EXPR); + funcdecl_p = inner_declarator && inner_declarator->kind == cdk_id; if (ctype == NULL_TREE && decl_context == FIELD @@ -7482,75 +7653,52 @@ grokdeclarator (tree declarator, && (friendp == 0 || dname == current_class_name)) ctype = current_class_type; - if (ctype && sfk == sfk_conversion) - TYPE_HAS_CONVERSION (ctype) = 1; - if (ctype && constructor_name_p (dname, ctype)) + if (ctype && (sfk == sfk_constructor + || sfk == sfk_destructor)) { /* We are within a class's scope. If our declarator name is the same as the class name, and we are defining a function, then it is a constructor/destructor, and therefore returns a void type. */ - if (flags == DTOR_FLAG) + /* ISO C++ 12.4/2. A destructor may not be declared + const or volatile. A destructor may not be + static. + + ISO C++ 12.1. A constructor may not be declared + const or volatile. A constructor may not be + virtual. A constructor may not be static. */ + if (staticp == 2) + error ((flags == DTOR_FLAG) + ? "destructor cannot be static member function" + : "constructor cannot be static member function"); + if (memfn_quals) { - /* ISO C++ 12.4/2. A destructor may not be - declared const or volatile. A destructor may - not be static. */ - if (staticp == 2) - error ("destructor cannot be static member function"); - if (quals) - { - error ("destructors may not be `%s'", - IDENTIFIER_POINTER (TREE_VALUE (quals))); - quals = NULL_TREE; - } - if (decl_context == FIELD) - { - if (! member_function_or_else (ctype, - current_class_type, - flags)) - return void_type_node; - } + error ((flags == DTOR_FLAG) + ? "destructors may not be cv-qualified" + : "constructors may not be cv-qualified"); + memfn_quals = TYPE_UNQUALIFIED; } - else /* It's a constructor. */ + + if (decl_context == FIELD + && !member_function_or_else (ctype, + current_class_type, + flags)) + return error_mark_node; + + if (flags != DTOR_FLAG) { + /* It's a constructor. */ if (explicitp == 1) explicitp = 2; - /* ISO C++ 12.1. A constructor may not be - declared const or volatile. A constructor may - not be virtual. A constructor may not be - static. */ - if (staticp == 2) - error ("constructor cannot be static member function"); if (virtualp) { pedwarn ("constructors cannot be declared virtual"); virtualp = 0; } - if (quals) - { - error ("constructors may not be `%s'", - IDENTIFIER_POINTER (TREE_VALUE (quals))); - quals = NULL_TREE; - } - { - RID_BIT_TYPE tmp_bits; - memcpy (&tmp_bits, &specbits, sizeof (RID_BIT_TYPE)); - RIDBIT_RESET (RID_INLINE, tmp_bits); - RIDBIT_RESET (RID_STATIC, tmp_bits); - if (RIDBIT_ANY_SET (tmp_bits)) - error ("return value type specifier for constructor ignored"); - } - if (decl_context == FIELD) - { - if (! member_function_or_else (ctype, - current_class_type, - flags)) - return void_type_node; - TYPE_HAS_CONSTRUCTOR (ctype) = 1; - if (sfk != sfk_constructor) - return NULL_TREE; - } + if (decl_context == FIELD + && sfk != sfk_constructor) + return error_mark_node; } if (decl_context == FIELD) staticp = 0; @@ -7558,287 +7706,228 @@ grokdeclarator (tree declarator, else if (friendp) { if (initialized) - error ("can't initialize friend function `%s'", name); + error ("can't initialize friend function %qs", name); if (virtualp) { /* Cannot be both friend and virtual. */ error ("virtual functions cannot be friends"); - RIDBIT_RESET (RID_FRIEND, specbits); friendp = 0; } if (decl_context == NORMAL) error ("friend declaration not in class definition"); if (current_function_decl && funcdef_flag) - error ("can't define friend function `%s' in a local class definition", - name); + error ("can't define friend function %qs in a local " + "class definition", + name); } - /* Construct the function type and go to the next - inner layer of declarator. */ + arg_types = grokparms (declarator->u.function.parameters, + &parms); - declarator = TREE_OPERAND (declarator, 0); - - arg_types = grokparms (inner_parms, &parms); - - if (declarator && flags == DTOR_FLAG) + if (inner_declarator + && inner_declarator->kind == cdk_id + && inner_declarator->u.id.sfk == sfk_destructor + && arg_types != void_list_node) { - /* A destructor declared in the body of a class will - be represented as a BIT_NOT_EXPR. But, we just - want the underlying IDENTIFIER. */ - if (TREE_CODE (declarator) == BIT_NOT_EXPR) - declarator = TREE_OPERAND (declarator, 0); - - if (arg_types != void_list_node) - { - error ("destructors may not have parameters"); - arg_types = void_list_node; - parms = NULL_TREE; - } + error ("destructors may not have parameters"); + arg_types = void_list_node; + parms = NULL_TREE; } - /* ANSI says that `const int foo ();' - does not make the function foo const. */ type = build_function_type (type, arg_types); } break; - case ADDR_EXPR: - case INDIRECT_REF: + case cdk_pointer: + case cdk_reference: + case cdk_ptrmem: /* Filter out pointers-to-references and references-to-references. We can get these if a TYPE_DECL is used. */ if (TREE_CODE (type) == REFERENCE_TYPE) { - error (TREE_CODE (declarator) == ADDR_EXPR - ? "cannot declare reference to `%#T'" - : "cannot declare pointer to `%#T'", type); + error (declarator->kind == cdk_reference + ? "cannot declare reference to %q#T" + : "cannot declare pointer to %q#T", type); type = TREE_TYPE (type); } - else if (VOID_TYPE_P (type) - && (ctype || TREE_CODE (declarator) == ADDR_EXPR)) - error (ctype ? "cannot declare pointer to `%#T' member" - : "cannot declare reference to `%#T'", type); - - /* Merge any constancy or volatility into the target type - for the pointer. */ + else if (VOID_TYPE_P (type)) + { + if (declarator->kind == cdk_reference) + error ("cannot declare reference to %q#T", type); + else if (declarator->kind == cdk_ptrmem) + error ("cannot declare pointer to %q#T member", type); + } /* We now know that the TYPE_QUALS don't apply to the decl, but to the target of the pointer. */ type_quals = TYPE_UNQUALIFIED; - if (TREE_CODE (declarator) == ADDR_EXPR) + if (declarator->kind == cdk_ptrmem + && (TREE_CODE (type) == FUNCTION_TYPE || memfn_quals)) + { + memfn_quals |= cp_type_quals (type); + type = build_memfn_type (type, + declarator->u.pointer.class_type, + memfn_quals); + memfn_quals = TYPE_UNQUALIFIED; + } + + if (declarator->kind == cdk_reference) { if (!VOID_TYPE_P (type)) type = build_reference_type (type); } else if (TREE_CODE (type) == METHOD_TYPE) type = build_ptrmemfunc_type (build_pointer_type (type)); - else if (ctype) - type = build_ptrmem_type (ctype, type); + else if (declarator->kind == cdk_ptrmem) + { + gcc_assert (TREE_CODE (declarator->u.pointer.class_type) + != NAMESPACE_DECL); + if (declarator->u.pointer.class_type == error_mark_node) + /* We will already have complained. */ + type = error_mark_node; + else + type = build_ptrmem_type (declarator->u.pointer.class_type, + type); + } else type = build_pointer_type (type); /* Process a list of type modifier keywords (such as const or volatile) that were given inside the `*' or `&'. */ - if (TREE_TYPE (declarator)) + if (declarator->u.pointer.qualifiers) { - tree typemodlist; - int erred = 0; - int constp = 0; - int volatilep = 0; - int restrictp = 0; - - for (typemodlist = TREE_TYPE (declarator); typemodlist; - typemodlist = TREE_CHAIN (typemodlist)) - { - tree qualifier = TREE_VALUE (typemodlist); - - if (qualifier == ridpointers[(int) RID_CONST]) - { - constp++; - type_quals |= TYPE_QUAL_CONST; - } - else if (qualifier == ridpointers[(int) RID_VOLATILE]) - { - volatilep++; - type_quals |= TYPE_QUAL_VOLATILE; - } - else if (qualifier == ridpointers[(int) RID_RESTRICT]) - { - restrictp++; - type_quals |= TYPE_QUAL_RESTRICT; - } - else if (!erred) - { - erred = 1; - error ("invalid type modifier within pointer declarator"); - } - } - if (constp > 1) - pedwarn ("duplicate `const'"); - if (volatilep > 1) - pedwarn ("duplicate `volatile'"); - if (restrictp > 1) - pedwarn ("duplicate `restrict'"); - type = cp_build_qualified_type (type, type_quals); + type + = cp_build_qualified_type (type, + declarator->u.pointer.qualifiers); type_quals = cp_type_quals (type); } - declarator = TREE_OPERAND (declarator, 0); ctype = NULL_TREE; break; - case SCOPE_REF: - { - /* We have converted type names to NULL_TREE if the - name was bogus, or to a _TYPE node, if not. - - The variable CTYPE holds the type we will ultimately - resolve to. The code here just needs to build - up appropriate member types. */ - tree sname = TREE_OPERAND (declarator, 1); - tree t; - - /* Destructors can have their visibilities changed as well. */ - if (TREE_CODE (sname) == BIT_NOT_EXPR) - sname = TREE_OPERAND (sname, 0); - - if (TREE_OPERAND (declarator, 0) == NULL_TREE) - { - /* We had a reference to a global decl, or - perhaps we were given a non-aggregate typedef, - in which case we cleared this out, and should just - keep going as though it wasn't there. */ - declarator = sname; - continue; - } - ctype = TREE_OPERAND (declarator, 0); - - t = ctype; - if (TREE_CODE (TREE_OPERAND (declarator, 1)) != INDIRECT_REF) - while (t != NULL_TREE && CLASS_TYPE_P (t)) - { - /* You're supposed to have one `template <...>' - for every template class, but you don't need one - for a full specialization. For example: - - template struct S{}; - template <> struct S { void f(); }; - void S::f () {} - - is correct; there shouldn't be a `template <>' for - the definition of `S::f'. */ - if (CLASSTYPE_TEMPLATE_INFO (t) - && (CLASSTYPE_TEMPLATE_INSTANTIATION (t) - || uses_template_parms (CLASSTYPE_TI_ARGS (t))) - && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))) - template_count += 1; - - t = TYPE_MAIN_DECL (t); - t = DECL_CONTEXT (t); - } - - if (sname == NULL_TREE) - goto done_scoping; - - if (TREE_CODE (sname) == IDENTIFIER_NODE) - { - /* This is the `standard' use of the scoping operator: - basetype :: member . */ - - if (ctype == current_class_type) - { - /* class A { - void A::f (); - }; - - Is this ill-formed? */ - - if (pedantic) - pedwarn ("extra qualification `%T::' on member `%s' ignored", - ctype, name); - } - else if (TREE_CODE (type) == FUNCTION_TYPE) - { - if (NEW_DELETE_OPNAME_P (sname)) - /* Overloaded operator new and operator delete - are always static functions. */ - ; - else if (current_class_type == NULL_TREE || friendp) - type - = build_method_type_directly (ctype, - TREE_TYPE (type), - TYPE_ARG_TYPES (type)); - else - { - error ("cannot declare member function `%T::%s' within `%T'", - ctype, name, current_class_type); - return error_mark_node; - } - } - else if (RIDBIT_SETP (RID_TYPEDEF, specbits) - || COMPLETE_TYPE_P (complete_type (ctype))) - { - /* Have to move this code elsewhere in this function. - this code is used for i.e., typedef int A::M; M *pm; - - It is? How? jason 10/2/94 */ - - if (current_class_type) - { - error ("cannot declare member `%T::%s' within `%T'", - ctype, name, current_class_type); - return void_type_node; - } - } - else - { - cxx_incomplete_type_error (NULL_TREE, ctype); - return error_mark_node; - } - - declarator = sname; - } - else if (TREE_CODE (sname) == SCOPE_REF) - abort (); - else - { - done_scoping: - declarator = TREE_OPERAND (declarator, 1); - if (declarator && TREE_CODE (declarator) == CALL_EXPR) - /* In this case, we will deal with it later. */ - ; - else if (TREE_CODE (type) == FUNCTION_TYPE) - type = build_method_type_directly (ctype, - TREE_TYPE (type), - TYPE_ARG_TYPES (type)); - } - } - break; - - case BIT_NOT_EXPR: - declarator = TREE_OPERAND (declarator, 0); - break; - - case BASELINK: - declarator = BASELINK_FUNCTIONS (declarator); - break; - - case RECORD_TYPE: - case UNION_TYPE: - case ENUMERAL_TYPE: - declarator = NULL_TREE; - break; - - case ERROR_MARK: - declarator = NULL_TREE; + case cdk_error: break; default: - abort (); + gcc_unreachable (); } } + if (unqualified_id && TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR + && TREE_CODE (type) != FUNCTION_TYPE + && TREE_CODE (type) != METHOD_TYPE) + { + error ("template-id %qD used as a declarator", + unqualified_id); + unqualified_id = dname; + } + + /* If TYPE is a FUNCTION_TYPE, but the function name was explicitly + qualified with a class-name, turn it into a METHOD_TYPE, unless + we know that the function is static. We take advantage of this + opportunity to do other processing that pertains to entities + explicitly declared to be class members. Note that if DECLARATOR + is non-NULL, we know it is a cdk_id declarator; otherwise, we + would not have exited the loop above. */ + if (declarator + && declarator->u.id.qualifying_scope + && TYPE_P (declarator->u.id.qualifying_scope)) + { + tree t; + + ctype = declarator->u.id.qualifying_scope; + ctype = TYPE_MAIN_VARIANT (ctype); + t = ctype; + while (t != NULL_TREE && CLASS_TYPE_P (t)) + { + /* You're supposed to have one `template <...>' for every + template class, but you don't need one for a full + specialization. For example: + + template struct S{}; + template <> struct S { void f(); }; + void S::f () {} + + is correct; there shouldn't be a `template <>' for the + definition of `S::f'. */ + if (CLASSTYPE_TEMPLATE_SPECIALIZATION (t) + && !any_dependent_template_arguments_p (CLASSTYPE_TI_ARGS (t))) + /* T is an explicit (not partial) specialization. All + containing classes must therefore also be explicitly + specialized. */ + break; + if ((CLASSTYPE_USE_TEMPLATE (t) || CLASSTYPE_IS_TEMPLATE (t)) + && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))) + template_count += 1; + + t = TYPE_MAIN_DECL (t); + t = DECL_CONTEXT (t); + } + + if (ctype == current_class_type) + { + if (friendp) + pedwarn ("member functions are implicitly friends of their class"); + else + pedwarn ("extra qualification %<%T::%> on member %qs", + ctype, name); + } + else if (/* If the qualifying type is already complete, then we + can skip the following checks. */ + !COMPLETE_TYPE_P (ctype) + && (/* If the function is being defined, then + qualifying type must certainly be complete. */ + funcdef_flag + /* A friend declaration of "T::f" is OK, even if + "T" is a template parameter. But, if this + function is not a friend, the qualifying type + must be a class. */ + || (!friendp && !CLASS_TYPE_P (ctype)) + /* For a declaration, the type need not be + complete, if either it is dependent (since there + is no meaningful definition of complete in that + case) or the qualifying class is currently being + defined. */ + || !(dependent_type_p (ctype) + || currently_open_class (ctype))) + /* Check that the qualifying type is complete. */ + && !complete_type_or_else (ctype, NULL_TREE)) + return error_mark_node; + else if (TREE_CODE (type) == FUNCTION_TYPE) + { + tree sname = declarator->u.id.unqualified_name; + + if (current_class_type + && (!friendp || funcdef_flag)) + { + error (funcdef_flag + ? "cannot define member function %<%T::%s%> within %<%T%>" + : "cannot declare member function %<%T::%s%> within %<%T%>", + ctype, name, current_class_type); + return error_mark_node; + } + + if (TREE_CODE (sname) == IDENTIFIER_NODE + && NEW_DELETE_OPNAME_P (sname)) + /* Overloaded operator new and operator delete + are always static functions. */ + ; + else + type = build_memfn_type (type, ctype, memfn_quals); + } + else if (declspecs->specs[(int)ds_typedef] + && current_class_type) + { + error ("cannot declare member %<%T::%s%> within %qT", + ctype, name, current_class_type); + return error_mark_node; + } + } + + /* Now TYPE has the actual type. */ + if (returned_attrs) { if (attrlist) @@ -7847,87 +7936,70 @@ grokdeclarator (tree declarator, attrlist = &returned_attrs; } - /* Now TYPE has the actual type. */ - /* Did array size calculations overflow? */ if (TREE_CODE (type) == ARRAY_TYPE && COMPLETE_TYPE_P (type) - && TREE_OVERFLOW (TYPE_SIZE (type))) + && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST + && TREE_OVERFLOW (TYPE_SIZE_UNIT (type))) { - error ("size of array `%s' is too large", name); + error ("size of array %qs is too large", name); /* If we proceed with the array type as it is, we'll eventually crash in tree_low_cst(). */ type = error_mark_node; } if ((decl_context == FIELD || decl_context == PARM) - && !processing_template_decl - && variably_modified_type_p (type)) + && !processing_template_decl + && variably_modified_type_p (type, NULL_TREE)) { if (decl_context == FIELD) - error ("data member may not have variably modified type `%T'", type); + error ("data member may not have variably modified type %qT", type); else - error ("parameter may not have variably modified type `%T'", type); + error ("parameter may not have variably modified type %qT", type); type = error_mark_node; } if (explicitp == 1 || (explicitp && friendp)) { /* [dcl.fct.spec] The explicit specifier shall only be used in - declarations of constructors within a class definition. */ - error ("only declarations of constructors can be `explicit'"); + declarations of constructors within a class definition. */ + error ("only declarations of constructors can be %"); explicitp = 0; } - if (RIDBIT_SETP (RID_MUTABLE, specbits)) + if (storage_class == sc_mutable) { if (decl_context != FIELD || friendp) - { - error ("non-member `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); - } - else if (decl_context == TYPENAME || RIDBIT_SETP (RID_TYPEDEF, specbits)) { - error ("non-object member `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); + error ("non-member %qs cannot be declared %", name); + storage_class = sc_none; + } + else if (decl_context == TYPENAME || declspecs->specs[(int)ds_typedef]) + { + error ("non-object member %qs cannot be declared %", name); + storage_class = sc_none; } else if (TREE_CODE (type) == FUNCTION_TYPE - || TREE_CODE (type) == METHOD_TYPE) - { - error ("function `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); - } + || TREE_CODE (type) == METHOD_TYPE) + { + error ("function %qs cannot be declared %", name); + storage_class = sc_none; + } else if (staticp) { - error ("static `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); + error ("static %qs cannot be declared %", name); + storage_class = sc_none; } else if (type_quals & TYPE_QUAL_CONST) { - error ("const `%s' cannot be declared `mutable'", name); - RIDBIT_RESET (RID_MUTABLE, specbits); + error ("const %qs cannot be declared %", name); + storage_class = sc_none; } } - if (declarator == NULL_TREE - || TREE_CODE (declarator) == IDENTIFIER_NODE - || (TREE_CODE (declarator) == TEMPLATE_ID_EXPR - && (TREE_CODE (type) == FUNCTION_TYPE - || TREE_CODE (type) == METHOD_TYPE))) - /* OK */; - else if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) - { - error ("template-id `%D' used as a declarator", declarator); - declarator = dname; - } - else - /* Unexpected declarator format. */ - abort (); - /* If this is declaring a typedef name, return a TYPE_DECL. */ - - if (RIDBIT_SETP (RID_TYPEDEF, specbits) && decl_context != TYPENAME) + if (declspecs->specs[(int)ds_typedef] && decl_context != TYPENAME) { tree decl; @@ -7936,28 +8008,49 @@ grokdeclarator (tree declarator, if (current_lang_name == lang_name_java) TYPE_FOR_JAVA (type) = 1; + /* This declaration: + + typedef void f(int) const; + + declares a function type which is not a member of any + particular class, but which is cv-qualified; for + example "f S::*" declares a pointer to a const-qualified + member function of S. We record the cv-qualification in the + function type. */ + if (memfn_quals && TREE_CODE (type) == FUNCTION_TYPE) + type = cp_build_qualified_type (type, memfn_quals); + if (decl_context == FIELD) - { - if (constructor_name_p (declarator, current_class_type)) - pedwarn ("ISO C++ forbids nested type `%D' with same name as enclosing class", - declarator); - decl = build_lang_decl (TYPE_DECL, declarator, type); - } + decl = build_lang_decl (TYPE_DECL, unqualified_id, type); else + decl = build_decl (TYPE_DECL, unqualified_id, type); + if (id_declarator && declarator->u.id.qualifying_scope) + error ("%Jtypedef name may not be a nested-name-specifier", decl); + + if (decl_context != FIELD) { - decl = build_decl (TYPE_DECL, declarator, type); - if (in_namespace || ctype) - error ("%Jtypedef name may not be a nested-name-specifier", decl); if (!current_function_decl) DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace); + else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (current_function_decl) + || (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P + (current_function_decl))) + /* The TYPE_DECL is "abstract" because there will be + clones of this constructor/destructor, and there will + be copies of this TYPE_DECL generated in those + clones. */ + DECL_ABSTRACT (decl) = 1; } - + else if (constructor_name_p (unqualified_id, current_class_type)) + pedwarn ("ISO C++ forbids nested type %qD with same name " + "as enclosing class", + unqualified_id); + /* If the user declares "typedef struct {...} foo" then the struct will have an anonymous name. Fill that name in now. Nothing can refer to it, so nothing needs know about the name change. */ if (type != error_mark_node - && declarator + && unqualified_id && TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TYPE_ANONYMOUS_P (type) @@ -7969,7 +8062,6 @@ grokdeclarator (tree declarator, tree t; /* Replace the anonymous name with the real name everywhere. */ - lookup_tag_reverse (type, declarator); for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) if (TYPE_NAME (t) == oldname) TYPE_NAME (t) = decl; @@ -7988,25 +8080,17 @@ grokdeclarator (tree declarator, type with external linkage have external linkage. */ } - if (quals) - { - if (ctype == NULL_TREE) - { - if (TREE_CODE (type) != METHOD_TYPE) - error ("%Jinvalid type qualifier for non-member function type", - decl); - else - ctype = TYPE_METHOD_BASETYPE (type); - } - if (ctype != NULL_TREE) - grok_method_quals (ctype, decl, quals); - } + /* Any qualifiers on a function type typedef have already been + dealt with. */ + if (memfn_quals && !ctype && TREE_CODE (type) == FUNCTION_TYPE) + memfn_quals = TYPE_UNQUALIFIED; - if (RIDBIT_SETP (RID_SIGNED, specbits) + if (signed_p || (typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl))) C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1; - bad_specifiers (decl, "type", virtualp, quals != NULL_TREE, + bad_specifiers (decl, "type", virtualp, + memfn_quals != TYPE_UNQUALIFIED, inlinep, friendp, raises != NULL_TREE); return decl; @@ -8024,7 +8108,7 @@ grokdeclarator (tree declarator, /* Detect where we're using a typedef of function type to declare a function. PARMS will not be set, so we must create it now. */ - + if (type == typedef_type && TREE_CODE (type) == FUNCTION_TYPE) { tree decls = NULL_TREE; @@ -8037,8 +8121,25 @@ grokdeclarator (tree declarator, TREE_CHAIN (decl) = decls; decls = decl; } - + parms = nreverse (decls); + + if (decl_context != TYPENAME) + { + /* A cv-qualifier-seq shall only be part of the function type + for a non-static member function. [8.3.5/4 dcl.fct] */ + if (cp_type_quals (type) != TYPE_UNQUALIFIED + && (current_class_type == NULL_TREE || staticp) ) + { + error ("qualified function types cannot be used to declare %s functions", + (staticp? "static member" : "free")); + type = TYPE_MAIN_VARIANT (type); + } + + /* The qualifiers on the function type become the qualifiers on + the non-static member function. */ + memfn_quals |= cp_type_quals (type); + } } /* If this is a type name (such as, in a cast or sizeof), @@ -8061,7 +8162,7 @@ grokdeclarator (tree declarator, } if (inlinep) { - error ("`inline' specified for friend class declaration"); + error ("% specified for friend class declaration"); inlinep = 0; } @@ -8071,12 +8172,12 @@ grokdeclarator (tree declarator, if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) pedwarn ("template parameters cannot be friends"); else if (TREE_CODE (type) == TYPENAME_TYPE) - pedwarn ("friend declaration requires class-key, " - "i.e. `friend class %T::%D'", + pedwarn ("friend declaration requires class-key, " + "i.e. %", TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type)); else - pedwarn ("friend declaration requires class-key, " - "i.e. `friend %#T'", + pedwarn ("friend declaration requires class-key, " + "i.e. %", type); } @@ -8088,55 +8189,54 @@ grokdeclarator (tree declarator, make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type), /*complain=*/true); else - error ("trying to make class `%T' a friend of global scope", - type); + error ("trying to make class %qT a friend of global scope", + type); type = void_type_node; } } - else if (quals) + else if (memfn_quals) { if (ctype == NULL_TREE) { if (TREE_CODE (type) != METHOD_TYPE) - error ("invalid qualifiers on non-member function type"); + error ("invalid qualifiers on non-member function type"); else - ctype = TYPE_METHOD_BASETYPE (type); + ctype = TYPE_METHOD_BASETYPE (type); } if (ctype) - { - tree dummy = build_decl (TYPE_DECL, declarator, type); - grok_method_quals (ctype, dummy, quals); - type = TREE_TYPE (dummy); - } + type = build_memfn_type (type, ctype, memfn_quals); } return type; } - else if (declarator == NULL_TREE && decl_context != PARM + else if (unqualified_id == NULL_TREE && decl_context != PARM && decl_context != CATCHPARM && TREE_CODE (type) != UNION_TYPE && ! bitfield) { - error ("abstract declarator `%T' used as declaration", type); + error ("abstract declarator %qT used as declaration", type); return error_mark_node; } /* Only functions may be declared using an operator-function-id. */ - if (declarator - && TREE_CODE (declarator) == IDENTIFIER_NODE - && IDENTIFIER_OPNAME_P (declarator) + if (unqualified_id + && IDENTIFIER_OPNAME_P (unqualified_id) && TREE_CODE (type) != FUNCTION_TYPE && TREE_CODE (type) != METHOD_TYPE) { - error ("declaration of `%D' as non-function", declarator); + error ("declaration of %qD as non-function", unqualified_id); return error_mark_node; } /* We don't check parameter types here because we can emit a better error message later. */ if (decl_context != PARM) - type = check_var_type (declarator, type); + { + type = check_var_type (unqualified_id, type); + if (type == error_mark_node) + return error_mark_node; + } /* Now create the decl, which may be a VAR_DECL, a PARM_DECL or a FUNCTION_DECL, depending on DECL_CONTEXT and TYPE. */ @@ -8144,7 +8244,7 @@ grokdeclarator (tree declarator, if (decl_context == PARM || decl_context == CATCHPARM) { if (ctype || in_namespace) - error ("cannot use `::' in parameter declaration"); + error ("cannot use %<::%> in parameter declaration"); /* A parameter declared as an array of T is really a pointer to T. One declared as a function is really a pointer to a function. @@ -8165,9 +8265,10 @@ grokdeclarator (tree declarator, if (decl_context == PARM) { - decl = cp_build_parm_decl (declarator, type); + decl = cp_build_parm_decl (unqualified_id, type); - bad_specifiers (decl, "parameter", virtualp, quals != NULL_TREE, + bad_specifiers (decl, "parameter", virtualp, + memfn_quals != TYPE_UNQUALIFIED, inlinep, friendp, raises != NULL_TREE); } else if (decl_context == FIELD) @@ -8189,23 +8290,14 @@ grokdeclarator (tree declarator, else if (in_namespace && !friendp) { /* Something like struct S { int N::j; }; */ - error ("invalid use of `::'"); - decl = NULL_TREE; + error ("invalid use of %<::%>"); + return error_mark_node; } else if (TREE_CODE (type) == FUNCTION_TYPE) { int publicp = 0; tree function_context; - /* We catch the others as conflicts with the builtin - typedefs. */ - if (friendp && declarator == ridpointers[(int) RID_SIGNED]) - { - error ("function `%D' cannot be declared friend", - declarator); - friendp = 0; - } - if (friendp == 0) { if (ctype == NULL_TREE) @@ -8213,33 +8305,54 @@ grokdeclarator (tree declarator, if (ctype == NULL_TREE) { - error ("can't make `%D' into a method -- not in a class", - declarator); - return void_type_node; + error ("can't make %qD into a method -- not in a class", + unqualified_id); + return error_mark_node; } /* ``A union may [ ... ] not [ have ] virtual functions.'' ARM 9.5 */ if (virtualp && TREE_CODE (ctype) == UNION_TYPE) { - error ("function `%D' declared virtual inside a union", - declarator); - return void_type_node; + error ("function %qD declared virtual inside a union", + unqualified_id); + return error_mark_node; } - if (NEW_DELETE_OPNAME_P (declarator)) + if (NEW_DELETE_OPNAME_P (unqualified_id)) { if (virtualp) { - error ("`%D' cannot be declared virtual, since it is always static", - declarator); + error ("%qD cannot be declared virtual, since it " + "is always static", + unqualified_id); virtualp = 0; } } else if (staticp < 2) - type = build_method_type_directly (ctype, - TREE_TYPE (type), - TYPE_ARG_TYPES (type)); + type = build_memfn_type (type, ctype, memfn_quals); + } + + /* Check that the name used for a destructor makes sense. */ + if (sfk == sfk_destructor) + { + if (!ctype) + { + gcc_assert (friendp); + error ("expected qualified name in friend declaration " + "for destructor %qD", + id_declarator->u.id.unqualified_name); + return error_mark_node; + } + + if (!same_type_p (TREE_OPERAND + (id_declarator->u.id.unqualified_name, 0), + ctype)) + { + error ("declaration of %qD as member of %qT", + id_declarator->u.id.unqualified_name, ctype); + return error_mark_node; + } } /* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */ @@ -8248,15 +8361,16 @@ grokdeclarator (tree declarator, publicp = (! friendp || ! staticp) && function_context == NULL_TREE; decl = grokfndecl (ctype, type, - TREE_CODE (declarator) != TEMPLATE_ID_EXPR - ? declarator : dname, + TREE_CODE (unqualified_id) != TEMPLATE_ID_EXPR + ? unqualified_id : dname, parms, - declarator, - virtualp, flags, quals, raises, + unqualified_id, + virtualp, flags, memfn_quals, raises, friendp ? -1 : 0, friendp, publicp, inlinep, - funcdef_flag, template_count, in_namespace); + sfk, + funcdef_flag, template_count, in_namespace, attrlist); if (decl == NULL_TREE) - return decl; + return error_mark_node; #if 0 /* This clobbers the attrs stored in `decl' from `attrlist'. */ /* The decl and setting of decl_attr is also turned off. */ @@ -8295,44 +8409,44 @@ grokdeclarator (tree declarator, /* All method decls are public, so tell grokfndecl to set TREE_PUBLIC, also. */ decl = grokfndecl (ctype, type, - TREE_CODE (declarator) != TEMPLATE_ID_EXPR - ? declarator : dname, + TREE_CODE (unqualified_id) != TEMPLATE_ID_EXPR + ? unqualified_id : dname, parms, - declarator, - virtualp, flags, quals, raises, - friendp ? -1 : 0, friendp, 1, 0, funcdef_flag, - template_count, in_namespace); + unqualified_id, + virtualp, flags, memfn_quals, raises, + friendp ? -1 : 0, friendp, 1, 0, sfk, + funcdef_flag, template_count, in_namespace, + attrlist); if (decl == NULL_TREE) - return NULL_TREE; + return error_mark_node; } else if (!staticp && !dependent_type_p (type) && !COMPLETE_TYPE_P (complete_type (type)) && (TREE_CODE (type) != ARRAY_TYPE || initialized == 0)) { - if (declarator) - error ("field `%D' has incomplete type", declarator); + if (unqualified_id) + error ("field %qD has incomplete type", unqualified_id); else - error ("name `%T' has incomplete type", type); + error ("name %qT has incomplete type", type); /* If we're instantiating a template, tell them which instantiation made the field's type be incomplete. */ if (current_class_type && TYPE_NAME (current_class_type) && IDENTIFIER_TEMPLATE (TYPE_IDENTIFIER (current_class_type)) - && declspecs && TREE_VALUE (declspecs) - && TREE_TYPE (TREE_VALUE (declspecs)) == type) - error (" in instantiation of template `%T'", - current_class_type); + && declspecs->type + && declspecs->type == type) + error (" in instantiation of template %qT", + current_class_type); - type = error_mark_node; - decl = NULL_TREE; + return error_mark_node; } else { if (friendp) { - error ("`%s' is neither function nor member function; cannot be declared friend", - IDENTIFIER_POINTER (declarator)); + error ("%qE is neither function nor member function; " + "cannot be declared friend", unqualified_id); friendp = 0; } decl = NULL_TREE; @@ -8342,24 +8456,25 @@ grokdeclarator (tree declarator, { /* Friends are treated specially. */ if (ctype == current_class_type) - warning ("member functions are implicitly friends of their class"); - else if (decl && DECL_NAME (decl)) + ; /* We already issued a pedwarn. */ + else if (decl && DECL_NAME (decl)) { if (template_class_depth (current_class_type) == 0) { decl = check_explicit_specialization - (declarator, decl, template_count, - 2 * (funcdef_flag != 0) + 4); + (unqualified_id, decl, template_count, + 2 * funcdef_flag + 4); if (decl == error_mark_node) return error_mark_node; } - - decl = do_friend (ctype, declarator, decl, - *attrlist, flags, quals, funcdef_flag); + + decl = do_friend (ctype, unqualified_id, decl, + *attrlist, flags, + funcdef_flag); return decl; } else - return void_type_node; + return error_mark_node; } /* Structure field. It may not be a function, except for C++. */ @@ -8382,46 +8497,60 @@ grokdeclarator (tree declarator, the rest of the compiler does not correctly handle the initialization unless the member is static so we make it static below. */ - pedwarn ("ISO C++ forbids initialization of member `%D'", - declarator); - pedwarn ("making `%D' static", declarator); + pedwarn ("ISO C++ forbids initialization of member %qD", + unqualified_id); + pedwarn ("making %qD static", unqualified_id); staticp = 1; } if (uses_template_parms (type)) /* We'll check at instantiation time. */ ; - else if (check_static_variable_definition (declarator, + else if (check_static_variable_definition (unqualified_id, type)) /* If we just return the declaration, crashes will sometimes occur. We therefore return void_type_node, as if this was a friend declaration, to cause callers to completely ignore this declaration. */ - return void_type_node; + return error_mark_node; } if (staticp) { /* C++ allows static class members. All other work for this is done by grokfield. */ - decl = build_lang_decl (VAR_DECL, declarator, type); - TREE_STATIC (decl) = 1; - /* In class context, 'static' means public access. */ - TREE_PUBLIC (decl) = DECL_EXTERNAL (decl) = 1; + decl = build_lang_decl (VAR_DECL, unqualified_id, type); + set_linkage_for_static_data_member (decl); + /* Even if there is an in-class initialization, DECL + is considered undefined until an out-of-class + definition is provided. */ + DECL_EXTERNAL (decl) = 1; + + if (thread_p) + { + if (targetm.have_tls) + DECL_TLS_MODEL (decl) = decl_default_tls_model (decl); + else + /* A mere warning is sure to result in improper + semantics at runtime. Don't bother to allow this to + compile. */ + error ("thread-local storage not supported for this target"); + } } else { - decl = build_decl (FIELD_DECL, declarator, type); + decl = build_decl (FIELD_DECL, unqualified_id, type); DECL_NONADDRESSABLE_P (decl) = bitfield; - if (RIDBIT_SETP (RID_MUTABLE, specbits)) + if (storage_class == sc_mutable) { DECL_MUTABLE_P (decl) = 1; - RIDBIT_RESET (RID_MUTABLE, specbits); + storage_class = sc_none; } } - bad_specifiers (decl, "field", virtualp, quals != NULL_TREE, + bad_specifiers (decl, "field", virtualp, + memfn_quals != TYPE_UNQUALIFIED, inlinep, friendp, raises != NULL_TREE); } } @@ -8431,61 +8560,63 @@ grokdeclarator (tree declarator, tree original_name; int publicp = 0; - if (! declarator) - return NULL_TREE; + if (!unqualified_id) + return error_mark_node; - if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) + if (TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR) original_name = dname; else - original_name = declarator; + original_name = unqualified_id; - if (RIDBIT_SETP (RID_AUTO, specbits)) - error ("storage class `auto' invalid for function `%s'", name); - else if (RIDBIT_SETP (RID_REGISTER, specbits)) - error ("storage class `register' invalid for function `%s'", name); - else if (RIDBIT_SETP (RID_THREAD, specbits)) - error ("storage class `__thread' invalid for function `%s'", name); + if (storage_class == sc_auto) + error ("storage class % invalid for function %qs", name); + else if (storage_class == sc_register) + error ("storage class % invalid for function %qs", name); + else if (thread_p) + error ("storage class %<__thread%> invalid for function %qs", name); /* Function declaration not at top level. Storage classes other than `extern' are not allowed and `extern' makes no difference. */ if (! toplevel_bindings_p () - && (RIDBIT_SETP (RID_STATIC, specbits) - || RIDBIT_SETP (RID_INLINE, specbits)) + && (storage_class == sc_static + || declspecs->specs[(int)ds_inline]) && pedantic) { - if (RIDBIT_SETP (RID_STATIC, specbits)) - pedwarn ("storage class `static' invalid for function `%s' declared out of global scope", name); + if (storage_class == sc_static) + pedwarn ("% specified invalid for function %qs " + "declared out of global scope", name); else - pedwarn ("storage class `inline' invalid for function `%s' declared out of global scope", name); + pedwarn ("% specifier invalid for function %qs " + "declared out of global scope", name); } if (ctype == NULL_TREE) { if (virtualp) { - error ("virtual non-class function `%s'", name); + error ("virtual non-class function %qs", name); virtualp = 0; } } else if (TREE_CODE (type) == FUNCTION_TYPE && staticp < 2 && !NEW_DELETE_OPNAME_P (original_name)) - type = build_method_type_directly (ctype, + type = build_method_type_directly (ctype, TREE_TYPE (type), TYPE_ARG_TYPES (type)); /* Record presence of `static'. */ publicp = (ctype != NULL_TREE - || RIDBIT_SETP (RID_EXTERN, specbits) - || !RIDBIT_SETP (RID_STATIC, specbits)); + || storage_class == sc_extern + || storage_class != sc_static); - decl = grokfndecl (ctype, type, original_name, parms, declarator, - virtualp, flags, quals, raises, + decl = grokfndecl (ctype, type, original_name, parms, unqualified_id, + virtualp, flags, memfn_quals, raises, 1, friendp, - publicp, inlinep, funcdef_flag, - template_count, in_namespace); + publicp, inlinep, sfk, funcdef_flag, + template_count, in_namespace, attrlist); if (decl == NULL_TREE) - return NULL_TREE; + return error_mark_node; if (staticp == 1) { @@ -8495,7 +8626,8 @@ grokdeclarator (tree declarator, declaring main to be static. */ if (TREE_CODE (type) == METHOD_TYPE) { - pedwarn ("cannot declare member function `%D' to have static linkage", decl); + pedwarn ("cannot declare member function %qD to have " + "static linkage", decl); invalid_static = 1; } else if (current_function_decl) @@ -8508,7 +8640,7 @@ grokdeclarator (tree declarator, if (invalid_static) { staticp = 0; - RIDBIT_RESET (RID_STATIC, specbits); + storage_class = sc_none; } } } @@ -8517,11 +8649,13 @@ grokdeclarator (tree declarator, /* It's a variable. */ /* An uninitialized decl with `extern' is a reference. */ - decl = grokvardecl (type, declarator, &specbits, + decl = grokvardecl (type, unqualified_id, + declspecs, initialized, (type_quals & TYPE_QUAL_CONST) != 0, ctype ? ctype : in_namespace); - bad_specifiers (decl, "variable", virtualp, quals != NULL_TREE, + bad_specifiers (decl, "variable", virtualp, + memfn_quals != TYPE_UNQUALIFIED, inlinep, friendp, raises != NULL_TREE); if (ctype) @@ -8529,43 +8663,41 @@ grokdeclarator (tree declarator, DECL_CONTEXT (decl) = ctype; if (staticp == 1) { - pedwarn ("`static' may not be used when defining (as opposed to declaring) a static data member"); - staticp = 0; - RIDBIT_RESET (RID_STATIC, specbits); + pedwarn ("% may not be used when defining " + "(as opposed to declaring) a static data member"); + staticp = 0; + storage_class = sc_none; } - if (RIDBIT_SETP (RID_REGISTER, specbits) && TREE_STATIC (decl)) + if (storage_class == sc_register && TREE_STATIC (decl)) { - error ("static member `%D' declared `register'", decl); - RIDBIT_RESET (RID_REGISTER, specbits); + error ("static member %qD declared %", decl); + storage_class = sc_none; } - if (RIDBIT_SETP (RID_EXTERN, specbits) && pedantic) + if (storage_class == sc_extern && pedantic) { - pedwarn ("cannot explicitly declare member `%#D' to have extern linkage", - decl); - RIDBIT_RESET (RID_EXTERN, specbits); + pedwarn ("cannot explicitly declare member %q#D to have " + "extern linkage", + decl); + storage_class = sc_none; } } } - my_friendly_assert (!RIDBIT_SETP (RID_MUTABLE, specbits), 19990927); - /* Record `register' declaration for warnings on & and in case doing stupid register allocation. */ - if (RIDBIT_SETP (RID_REGISTER, specbits)) + if (storage_class == sc_register) DECL_REGISTER (decl) = 1; - - if (RIDBIT_SETP (RID_EXTERN, specbits)) + else if (storage_class == sc_extern) DECL_THIS_EXTERN (decl) = 1; - - if (RIDBIT_SETP (RID_STATIC, specbits)) + else if (storage_class == sc_static) DECL_THIS_STATIC (decl) = 1; /* Record constancy and volatility. There's no need to do this when processing a template; we'll do this for the instantiated declaration based on the type of DECL. */ if (!processing_template_decl) - c_apply_type_quals_to_decl (type_quals, decl); + cp_apply_type_quals_to_decl (type_quals, decl); return decl; } @@ -8580,14 +8712,18 @@ require_complete_types_for_parms (tree parms) { for (; parms; parms = TREE_CHAIN (parms)) { - if (VOID_TYPE_P (TREE_TYPE (parms))) - /* grokparms will have already issued an error. */ - TREE_TYPE (parms) = error_mark_node; - else if (complete_type_or_else (TREE_TYPE (parms), parms)) + if (dependent_type_p (TREE_TYPE (parms))) + continue; + if (!VOID_TYPE_P (TREE_TYPE (parms)) + && complete_type_or_else (TREE_TYPE (parms), parms)) { - layout_decl (parms, 0); + relayout_decl (parms); DECL_ARG_TYPE (parms) = type_passed_as (TREE_TYPE (parms)); } + else + /* grokparms or complete_type_or_else will have already issued + an error. */ + TREE_TYPE (parms) = error_mark_node; } } @@ -8624,14 +8760,18 @@ nonstatic_local_decl_p (tree t) function. */ static tree -local_variable_p_walkfn (tree* tp, - int* walk_subtrees ATTRIBUTE_UNUSED , - void* data ATTRIBUTE_UNUSED ) +local_variable_p_walkfn (tree *tp, int *walk_subtrees, + void *data ATTRIBUTE_UNUSED) { - return ((local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp)) - ? *tp : NULL_TREE); + if (local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp)) + return *tp; + else if (TYPE_P (*tp)) + *walk_subtrees = 0; + + return NULL_TREE; } + /* Check that ARG, which is a default-argument expression for a parameter DECL, is valid. Returns ARG, or ERROR_MARK_NODE, if something goes wrong. DECL may also be a _TYPE node, rather than a @@ -8649,13 +8789,6 @@ check_default_argument (tree decl, tree arg) deal with it after the class is complete. */ return arg; - if (processing_template_decl || uses_template_parms (arg)) - /* We don't do anything checking until instantiation-time. Note - that there may be uninstantiated arguments even for an - instantiated function, since default arguments are not - instantiated until they are needed. */ - return arg; - if (TYPE_P (decl)) { decl_type = decl; @@ -8677,14 +8810,14 @@ check_default_argument (tree decl, tree arg) A default argument expression is implicitly converted to the parameter type. */ if (!TREE_TYPE (arg) - || !can_convert_arg (decl_type, TREE_TYPE (arg), arg)) + || !can_convert_arg (decl_type, TREE_TYPE (arg), arg, LOOKUP_NORMAL)) { if (decl) - error ("default argument for `%#D' has type `%T'", - decl, TREE_TYPE (arg)); + error ("default argument for %q#D has type %qT", + decl, TREE_TYPE (arg)); else - error ("default argument for parameter of type `%T' has type `%T'", - decl_type, TREE_TYPE (arg)); + error ("default argument for parameter of type %qT has type %qT", + decl_type, TREE_TYPE (arg)); return error_mark_node; } @@ -8700,8 +8833,7 @@ check_default_argument (tree decl, tree arg) NULL); if (var) { - error ("default argument `%E' uses local variable `%D'", - arg, var); + error ("default argument %qE uses local variable %qD", arg, var); return error_mark_node; } @@ -8713,69 +8845,55 @@ check_default_argument (tree decl, tree arg) Given the list of things declared inside the parens, return a list of types. - We determine whether ellipsis parms are used by PARMLIST_ELLIPSIS_P - flag. If unset, we append void_list_node. A parmlist declared - as `(void)' is accepted as the empty parmlist. + If this parameter does not end with an ellipsis, we append + void_list_node. *PARMS is set to the chain of PARM_DECLs created. */ static tree -grokparms (tree first_parm, tree *parms) +grokparms (cp_parameter_declarator *first_parm, tree *parms) { tree result = NULL_TREE; tree decls = NULL_TREE; - int ellipsis = !first_parm || PARMLIST_ELLIPSIS_P (first_parm); - tree parm, chain; + int ellipsis = !first_parm || first_parm->ellipsis_p; + cp_parameter_declarator *parm; int any_error = 0; - my_friendly_assert (!first_parm || TREE_PARMLIST (first_parm), 20001115); - - for (parm = first_parm; parm != NULL_TREE; parm = chain) + for (parm = first_parm; parm != NULL; parm = parm->next) { tree type = NULL_TREE; - tree decl = TREE_VALUE (parm); - tree init = TREE_PURPOSE (parm); - tree specs, attrs; + tree init = parm->default_argument; + tree attrs; + tree decl; - chain = TREE_CHAIN (parm); - /* @@ weak defense against parse errors. */ - if (TREE_CODE (decl) != VOID_TYPE - && TREE_CODE (decl) != TREE_LIST) - { - /* Give various messages as the need arises. */ - if (TREE_CODE (decl) == STRING_CST) - error ("invalid string constant `%E'", decl); - else if (TREE_CODE (decl) == INTEGER_CST) - error ("invalid integer constant in parameter list, did you forget to give parameter name?"); - continue; - } + if (parm == no_parameters) + break; - if (parm == void_list_node) - break; - - split_specs_attrs (TREE_PURPOSE (decl), &specs, &attrs); - decl = grokdeclarator (TREE_VALUE (decl), specs, + attrs = parm->decl_specifiers.attributes; + parm->decl_specifiers.attributes = NULL_TREE; + decl = grokdeclarator (parm->declarator, &parm->decl_specifiers, PARM, init != NULL_TREE, &attrs); if (! decl || TREE_TYPE (decl) == error_mark_node) - continue; + continue; if (attrs) cplus_decl_attributes (&decl, attrs, 0); type = TREE_TYPE (decl); if (VOID_TYPE_P (type)) - { - if (same_type_p (type, void_type_node) - && !DECL_NAME (decl) && !result && !chain && !ellipsis) - /* this is a parmlist of `(void)', which is ok. */ - break; - cxx_incomplete_type_error (decl, type); + { + if (same_type_p (type, void_type_node) + && DECL_SELF_REFERENCE_P (type) + && !DECL_NAME (decl) && !result && !parm->next && !ellipsis) + /* this is a parmlist of `(void)', which is ok. */ + break; + cxx_incomplete_type_error (decl, type); /* It's not a good idea to actually create parameters of type `void'; other parts of the compiler assume that a void type terminates the parameter list. */ type = error_mark_node; TREE_TYPE (decl) = error_mark_node; - } + } if (type != error_mark_node) { @@ -8784,7 +8902,7 @@ grokparms (tree first_parm, tree *parms) type = cp_build_qualified_type (type, 0); if (TREE_CODE (type) == METHOD_TYPE) { - error ("parameter `%D' invalidly declared method type", decl); + error ("parameter %qD invalidly declared method type", decl); type = build_pointer_type (type); TREE_TYPE (decl) = type; } @@ -8797,25 +8915,26 @@ grokparms (tree first_parm, tree *parms) tree t = TREE_TYPE (type); int ptr = TYPE_PTR_P (type); - while (1) - { - if (TYPE_PTR_P (t)) - ptr = 1; - else if (TREE_CODE (t) != ARRAY_TYPE) - break; - else if (!TYPE_DOMAIN (t)) - break; - t = TREE_TYPE (t); - } + while (1) + { + if (TYPE_PTR_P (t)) + ptr = 1; + else if (TREE_CODE (t) != ARRAY_TYPE) + break; + else if (!TYPE_DOMAIN (t)) + break; + t = TREE_TYPE (t); + } if (TREE_CODE (t) == ARRAY_TYPE) - error ("parameter `%D' includes %s to array of unknown bound `%T'", - decl, ptr ? "pointer" : "reference", t); + error ("parameter %qD includes %s to array of unknown " + "bound %qT", + decl, ptr ? "pointer" : "reference", t); } - if (!any_error && init) - init = check_default_argument (decl, init); - else + if (any_error) init = NULL_TREE; + else if (init && !processing_template_decl) + init = check_default_argument (decl, init); } TREE_CHAIN (decl) = decls; @@ -8856,21 +8975,25 @@ copy_fn_p (tree d) tree args; tree arg_type; int result = 1; - - my_friendly_assert (DECL_FUNCTION_MEMBER_P (d), 20011208); - if (DECL_TEMPLATE_INFO (d) && is_member_template (DECL_TI_TEMPLATE (d))) + gcc_assert (DECL_FUNCTION_MEMBER_P (d)); + + if (TREE_CODE (d) == TEMPLATE_DECL + || (DECL_TEMPLATE_INFO (d) + && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (d)))) /* Instantiations of template member functions are never copy functions. Note that member functions of templated classes are represented as template functions internally, and we must accept those as copy functions. */ return 0; - + args = FUNCTION_FIRST_USER_PARMTYPE (d); if (!args) return 0; arg_type = TREE_VALUE (args); + if (arg_type == error_mark_node) + return 0; if (TYPE_MAIN_VARIANT (arg_type) == DECL_CONTEXT (d)) { @@ -8885,7 +9008,7 @@ copy_fn_p (tree d) } else return 0; - + args = TREE_CHAIN (args); if (args && args != void_list_node && !TREE_PURPOSE (args)) @@ -8899,45 +9022,49 @@ copy_fn_p (tree d) void grok_special_member_properties (tree decl) { - if (!DECL_NONSTATIC_MEMBER_FUNCTION_P(decl)) - ; /* Not special. */ - else if (DECL_CONSTRUCTOR_P (decl)) + tree class_type; + + if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) + return; + + class_type = DECL_CONTEXT (decl); + if (DECL_CONSTRUCTOR_P (decl)) { int ctor = copy_fn_p (decl); - + + TYPE_HAS_CONSTRUCTOR (class_type) = 1; + if (ctor > 0) { /* [class.copy] - - A non-template constructor for class X is a copy - constructor if its first parameter is of type X&, const - X&, volatile X& or const volatile X&, and either there - are no other parameters or else all other parameters have - default arguments. */ - TYPE_HAS_INIT_REF (DECL_CONTEXT (decl)) = 1; + + A non-template constructor for class X is a copy + constructor if its first parameter is of type X&, const + X&, volatile X& or const volatile X&, and either there + are no other parameters or else all other parameters have + default arguments. */ + TYPE_HAS_INIT_REF (class_type) = 1; if (ctor > 1) - TYPE_HAS_CONST_INIT_REF (DECL_CONTEXT (decl)) = 1; + TYPE_HAS_CONST_INIT_REF (class_type) = 1; } else if (sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (decl))) - TYPE_HAS_DEFAULT_CONSTRUCTOR (DECL_CONTEXT (decl)) = 1; + TYPE_HAS_DEFAULT_CONSTRUCTOR (class_type) = 1; } else if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR) { /* [class.copy] - - A non-template assignment operator for class X is a copy - assignment operator if its parameter is of type X, X&, const - X&, volatile X& or const volatile X&. */ - + + A non-template assignment operator for class X is a copy + assignment operator if its parameter is of type X, X&, const + X&, volatile X& or const volatile X&. */ + int assop = copy_fn_p (decl); - + if (assop) { - TYPE_HAS_ASSIGN_REF (DECL_CONTEXT (decl)) = 1; + TYPE_HAS_ASSIGN_REF (class_type) = 1; if (assop != 1) - TYPE_HAS_CONST_ASSIGN_REF (DECL_CONTEXT (decl)) = 1; - if (DECL_PURE_VIRTUAL_P (decl)) - TYPE_HAS_ABSTRACT_ASSIGN_REF (DECL_CONTEXT (decl)) = 1; + TYPE_HAS_CONST_ASSIGN_REF (class_type) = 1; } } } @@ -8953,26 +9080,25 @@ grok_ctor_properties (tree ctype, tree decl) if (ctor_parm < 0) { /* [class.copy] - - A declaration of a constructor for a class X is ill-formed if - its first parameter is of type (optionally cv-qualified) X - and either there are no other parameters or else all other - parameters have default arguments. - - We *don't* complain about member template instantiations that - have this form, though; they can occur as we try to decide - what constructor to use during overload resolution. Since - overload resolution will never prefer such a constructor to - the non-template copy constructor (which is either explicitly - or implicitly defined), there's no need to worry about their - existence. Theoretically, they should never even be - instantiated, but that's hard to forestall. */ - error ("invalid constructor; you probably meant `%T (const %T&)'", + + A declaration of a constructor for a class X is ill-formed if + its first parameter is of type (optionally cv-qualified) X + and either there are no other parameters or else all other + parameters have default arguments. + + We *don't* complain about member template instantiations that + have this form, though; they can occur as we try to decide + what constructor to use during overload resolution. Since + overload resolution will never prefer such a constructor to + the non-template copy constructor (which is either explicitly + or implicitly defined), there's no need to worry about their + existence. Theoretically, they should never even be + instantiated, but that's hard to forestall. */ + error ("invalid constructor; you probably meant %<%T (const %T&)%>", ctype, ctype); - SET_IDENTIFIER_ERROR_LOCUS (DECL_NAME (decl), ctype); return 0; } - + return 1; } @@ -8983,7 +9109,7 @@ ambi_op_p (enum tree_code code) { return (code == INDIRECT_REF || code == ADDR_EXPR - || code == CONVERT_EXPR + || code == UNARY_PLUS_EXPR || code == NEGATE_EXPR || code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR); @@ -9000,8 +9126,7 @@ unary_op_p (enum tree_code code) || code == TYPE_EXPR); } -/* DECL is a declaration for an overloaded operator. Returns true if - the declaration is valid; false otherwise. If COMPLAIN is true, +/* DECL is a declaration for an overloaded operator. If COMPLAIN is true, errors are issued for invalid declarations. */ bool @@ -9014,13 +9139,9 @@ grok_op_properties (tree decl, bool complain) enum tree_code operator_code; int arity; bool ellipsis_p; - bool ok; tree class_type; - /* Assume that the declaration is valid. */ - ok = true; - - /* Count the number of arguments. and check for ellipsis */ + /* Count the number of arguments and check for ellipsis. */ for (argtype = argtypes, arity = 0; argtype && argtype != void_list_node; argtype = TREE_CHAIN (argtype)) @@ -9030,7 +9151,7 @@ grok_op_properties (tree decl, bool complain) class_type = DECL_CONTEXT (decl); if (class_type && !CLASS_TYPE_P (class_type)) class_type = NULL_TREE; - + if (DECL_CONV_FN_P (decl)) operator_code = TYPE_EXPR; else @@ -9052,10 +9173,10 @@ grok_op_properties (tree decl, bool complain) #include "operators.def" #undef DEF_OPERATOR - abort (); + gcc_unreachable (); } while (0); - my_friendly_assert (operator_code != LAST_CPLUS_TREE_CODE, 20000526); + gcc_assert (operator_code != LAST_CPLUS_TREE_CODE); SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); if (class_type) @@ -9081,6 +9202,31 @@ grok_op_properties (tree decl, bool complain) break; } + /* [basic.std.dynamic.allocation]/1: + + A program is ill-formed if an allocation function is declared + in a namespace scope other than global scope or declared static + in global scope. + + The same also holds true for deallocation functions. */ + if (operator_code == NEW_EXPR || operator_code == VEC_NEW_EXPR + || operator_code == DELETE_EXPR || operator_code == VEC_DELETE_EXPR) + { + if (DECL_NAMESPACE_SCOPE_P (decl)) + { + if (CP_DECL_CONTEXT (decl) != global_namespace) + { + error ("%qD may not be declared within a namespace", decl); + return false; + } + else if (!TREE_PUBLIC (decl)) + { + error ("%qD may not be declared as static", decl); + return false; + } + } + } + if (operator_code == NEW_EXPR || operator_code == VEC_NEW_EXPR) TREE_TYPE (decl) = coerce_new_type (TREE_TYPE (decl)); else if (operator_code == DELETE_EXPR || operator_code == VEC_DELETE_EXPR) @@ -9097,17 +9243,27 @@ grok_op_properties (tree decl, bool complain) || operator_code == COMPONENT_REF || operator_code == ARRAY_REF || operator_code == NOP_EXPR) - error ("`%D' must be a nonstatic member function", decl); + { + error ("%qD must be a nonstatic member function", decl); + return false; + } else { tree p; if (DECL_STATIC_FUNCTION_P (decl)) - error ("`%D' must be either a non-static member function or a non-member function", decl); + { + error ("%qD must be either a non-static member " + "function or a non-member function", decl); + return false; + } for (p = argtypes; p && p != void_list_node; p = TREE_CHAIN (p)) { tree arg = non_reference (TREE_VALUE (p)); + if (arg == error_mark_node) + return false; + /* IS_AGGR_TYPE, rather than CLASS_TYPE_P, is used because these checks are performed even on template functions. */ @@ -9117,13 +9273,10 @@ grok_op_properties (tree decl, bool complain) if (!p || p == void_list_node) { - if (!complain) - return false; - - error ("`%D' must have an argument of class or " - "enumerated type", - decl); - ok = false; + if (complain) + error ("%qD must have an argument of class or " + "enumerated type", decl); + return false; } } } @@ -9131,10 +9284,10 @@ grok_op_properties (tree decl, bool complain) /* There are no restrictions on the arguments to an overloaded "operator ()". */ if (operator_code == CALL_EXPR) - return ok; + return true; /* Warn about conversion operators that will never be used. */ - if (IDENTIFIER_TYPENAME_P (name) + if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl) && warn_conversion /* Warn only declaring the function; there is no need to @@ -9144,10 +9297,10 @@ grok_op_properties (tree decl, bool complain) tree t = TREE_TYPE (name); int ref = (TREE_CODE (t) == REFERENCE_TYPE); const char *what = 0; - + if (ref) t = TYPE_MAIN_VARIANT (TREE_TYPE (t)); - + if (TREE_CODE (t) == VOID_TYPE) what = "void"; else if (class_type) @@ -9162,7 +9315,8 @@ grok_op_properties (tree decl, bool complain) } if (what) - warning ("conversion to %s%s will never use a type conversion operator", + warning (OPT_Wconversion, "conversion to %s%s will never use a type " + "conversion operator", ref ? "a reference to " : "", what); } @@ -9170,9 +9324,13 @@ grok_op_properties (tree decl, bool complain) { /* 13.4.0.3 */ error ("ISO C++ prohibits overloading operator ?:"); + return false; } else if (ellipsis_p) - error ("`%D' must not have variable number of arguments", decl); + { + error ("%qD must not have variable number of arguments", decl); + return false; + } else if (ambi_op_p (operator_code)) { if (arity == 1) @@ -9193,7 +9351,7 @@ grok_op_properties (tree decl, bool complain) operator_code = BIT_AND_EXPR; break; - case CONVERT_EXPR: + case UNARY_PLUS_EXPR: operator_code = PLUS_EXPR; break; @@ -9210,7 +9368,7 @@ grok_op_properties (tree decl, bool complain) break; default: - abort (); + gcc_unreachable (); } SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); @@ -9221,20 +9379,21 @@ grok_op_properties (tree decl, bool complain) && ! same_type_p (TREE_VALUE (TREE_CHAIN (argtypes)), integer_type_node)) { if (methodp) - error ("postfix `%D' must take `int' as its argument", - decl); + error ("postfix %qD must take % as its argument", + decl); else - error - ("postfix `%D' must take `int' as its second argument", - decl); + error ("postfix %qD must take % as its second " + "argument", decl); + return false; } } else { if (methodp) - error ("`%D' must take either zero or one argument", decl); + error ("%qD must take either zero or one argument", decl); else - error ("`%D' must take either one or two arguments", decl); + error ("%qD must take either one or two arguments", decl); + return false; } /* More Effective C++ rule 6. */ @@ -9255,13 +9414,13 @@ grok_op_properties (tree decl, bool complain) if (TREE_CODE (ret) != REFERENCE_TYPE || !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)), arg)) - warning ("prefix `%D' should return `%T'", decl, - build_reference_type (arg)); + warning (OPT_Weffc__, "prefix %qD should return %qT", decl, + build_reference_type (arg)); } else { if (!same_type_p (TYPE_MAIN_VARIANT (ret), arg)) - warning ("postfix `%D' should return `%T'", decl, arg); + warning (OPT_Weffc__, "postfix %qD should return %qT", decl, arg); } } } @@ -9270,9 +9429,10 @@ grok_op_properties (tree decl, bool complain) if (arity != 1) { if (methodp) - error ("`%D' must take `void'", decl); + error ("%qD must take %", decl); else - error ("`%D' must take exactly one argument", decl); + error ("%qD must take exactly one argument", decl); + return false; } } else /* if (binary_op_p (operator_code)) */ @@ -9280,9 +9440,10 @@ grok_op_properties (tree decl, bool complain) if (arity != 2) { if (methodp) - error ("`%D' must take exactly one argument", decl); + error ("%qD must take exactly one argument", decl); else - error ("`%D' must take exactly two arguments", decl); + error ("%qD must take exactly two arguments", decl); + return false; } /* More Effective C++ rule 7. */ @@ -9290,8 +9451,8 @@ grok_op_properties (tree decl, bool complain) && (operator_code == TRUTH_ANDIF_EXPR || operator_code == TRUTH_ORIF_EXPR || operator_code == COMPOUND_EXPR)) - warning ("user-defined `%D' always evaluates both arguments", - decl); + warning (OPT_Weffc__, "user-defined %qD always evaluates both arguments", + decl); } /* Effective C++ rule 23. */ @@ -9304,29 +9465,32 @@ grok_op_properties (tree decl, bool complain) || operator_code == MULT_EXPR || operator_code == TRUNC_MOD_EXPR) && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE) - warning ("`%D' should return by value", decl); + warning (OPT_Weffc__, "%qD should return by value", decl); /* [over.oper]/8 */ for (; argtypes && argtypes != void_list_node; - argtypes = TREE_CHAIN (argtypes)) - if (TREE_PURPOSE (argtypes)) - { - TREE_PURPOSE (argtypes) = NULL_TREE; - if (operator_code == POSTINCREMENT_EXPR + argtypes = TREE_CHAIN (argtypes)) + if (TREE_PURPOSE (argtypes)) + { + TREE_PURPOSE (argtypes) = NULL_TREE; + if (operator_code == POSTINCREMENT_EXPR || operator_code == POSTDECREMENT_EXPR) - { - if (pedantic) - pedwarn ("`%D' cannot have default arguments", decl); - } - else - error ("`%D' cannot have default arguments", decl); - } - + { + if (pedantic) + pedwarn ("%qD cannot have default arguments", decl); + } + else + { + error ("%qD cannot have default arguments", decl); + return false; + } + } } - - return ok; + return true; } +/* Return a string giving the keyword associate with CODE. */ + static const char * tag_name (enum tag_types code) { @@ -9343,7 +9507,7 @@ tag_name (enum tag_types code) case typename_type: return "typename"; default: - abort (); + gcc_unreachable (); } } @@ -9371,7 +9535,15 @@ check_elaborated_type_specifier (enum tag_types tag_code, type = TREE_TYPE (decl); - /* [dcl.type.elab] + /* Check TEMPLATE_TYPE_PARM first because DECL_IMPLICIT_TYPEDEF_P + is false for this case as well. */ + if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) + { + error ("using template type parameter %qT after %qs", + type, tag_name (tag_code)); + return error_mark_node; + } + /* [dcl.type.elab] If the identifier resolves to a typedef-name or a template type-parameter, the elaborated-type-specifier is ill-formed. @@ -9379,17 +9551,11 @@ check_elaborated_type_specifier (enum tag_types tag_code, In other words, the only legitimate declaration to use in the elaborated type specifier is the implicit typedef created when the type is declared. */ - if (!DECL_IMPLICIT_TYPEDEF_P (decl) - && tag_code != typename_type) + else if (!DECL_IMPLICIT_TYPEDEF_P (decl) + && tag_code != typename_type) { - error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code)); - return IS_AGGR_TYPE (type) ? type : error_mark_node; - } - - if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) - { - error ("using template type parameter `%T' after `%s'", - type, tag_name (tag_code)); + error ("using typedef-name %qD after %qs", decl, tag_name (tag_code)); + error ("%q+D has a previous declaration here", decl); return error_mark_node; } else if (TREE_CODE (type) != RECORD_TYPE @@ -9397,13 +9563,15 @@ check_elaborated_type_specifier (enum tag_types tag_code, && tag_code != enum_type && tag_code != typename_type) { - error ("`%T' referred to as `%s'", type, tag_name (tag_code)); + error ("%qT referred to as %qs", type, tag_name (tag_code)); + error ("%q+T has a previous declaration here", type); return error_mark_node; } else if (TREE_CODE (type) != ENUMERAL_TYPE && tag_code == enum_type) { - error ("`%T' referred to as enum", type); + error ("%qT referred to as enum", type); + error ("%q+T has a previous declaration here", type); return error_mark_node; } else if (!allow_template_p @@ -9417,8 +9585,7 @@ check_elaborated_type_specifier (enum tag_types tag_code, void f(class C); // No template header here then the required template argument is missing. */ - - error ("template argument required for `%s %T'", + error ("template argument required for %<%s %T%>", tag_name (tag_code), DECL_NAME (CLASSTYPE_TI_TEMPLATE (type))); return error_mark_node; @@ -9427,31 +9594,103 @@ check_elaborated_type_specifier (enum tag_types tag_code, return type; } +/* Lookup NAME in elaborate type specifier in scope according to + SCOPE and issue diagnostics if necessary. + Return *_TYPE node upon success, NULL_TREE when the NAME is not + found, and ERROR_MARK_NODE for type error. */ + +static tree +lookup_and_check_tag (enum tag_types tag_code, tree name, + tag_scope scope, bool template_header_p) +{ + tree t; + tree decl; + if (scope == ts_global) + { + /* First try ordinary name lookup, ignoring hidden class name + injected via friend declaration. */ + decl = lookup_name_prefer_type (name, 2); + /* If that fails, the name will be placed in the smallest + non-class, non-function-prototype scope according to 3.3.1/5. + We may already have a hidden name declared as friend in this + scope. So lookup again but not ignoring hidden names. + If we find one, that name will be made visible rather than + creating a new tag. */ + if (!decl) + decl = lookup_type_scope (name, ts_within_enclosing_non_class); + } + else + decl = lookup_type_scope (name, scope); + + if (decl && DECL_CLASS_TEMPLATE_P (decl)) + decl = DECL_TEMPLATE_RESULT (decl); + + if (decl && TREE_CODE (decl) == TYPE_DECL) + { + /* Look for invalid nested type: + class C { + class C {}; + }; */ + if (scope == ts_current && DECL_SELF_REFERENCE_P (decl)) + { + error ("%qD has the same name as the class in which it is " + "declared", + decl); + return error_mark_node; + } + + /* Two cases we need to consider when deciding if a class + template is allowed as an elaborated type specifier: + 1. It is a self reference to its own class. + 2. It comes with a template header. + + For example: + + template class C { + class C *c1; // DECL_SELF_REFERENCE_P is true + class D; + }; + template class C; // template_header_p is true + template class C::D { + class C *c2; // DECL_SELF_REFERENCE_P is true + }; */ + + t = check_elaborated_type_specifier (tag_code, + decl, + template_header_p + | DECL_SELF_REFERENCE_P (decl)); + return t; + } + else + return NULL_TREE; +} + /* Get the struct, enum or union (TAG_CODE says which) with tag NAME. Define the tag as a forward-reference if it is not defined. If a declaration is given, process it here, and report an error if multiple declarations are not identical. - GLOBALIZE is false when this is also a definition. Only look in + SCOPE is TS_CURRENT when this is also a definition. Only look in the current frame for the name (since C++ allows new names in any - scope.) + scope.) It is TS_WITHIN_ENCLOSING_NON_CLASS if this is a friend + declaration. Only look beginning from the current scope outward up + till the nearest non-class scope. Otherwise it is TS_GLOBAL. TEMPLATE_HEADER_P is true when this declaration is preceded by a set of template parameters. */ tree xref_tag (enum tag_types tag_code, tree name, - bool globalize, bool template_header_p) + tag_scope scope, bool template_header_p) { enum tree_code code; tree t; - struct cp_binding_level *b = current_binding_level; tree context = NULL_TREE; timevar_push (TV_NAME_LOOKUP); - my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0); + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); switch (tag_code) { @@ -9466,93 +9705,62 @@ xref_tag (enum tag_types tag_code, tree name, code = ENUMERAL_TYPE; break; default: - abort (); + gcc_unreachable (); } - if (! globalize) - { - /* If we know we are defining this tag, only look it up in - this scope and don't try to find it as a type. */ - t = lookup_tag (code, name, b, 1); - } + /* In case of anonymous name, xref_tag is only called to + make type node and push name. Name lookup is not required. */ + if (ANON_AGGRNAME_P (name)) + t = NULL_TREE; else + t = lookup_and_check_tag (tag_code, name, + scope, template_header_p); + + if (t == error_mark_node) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + + if (scope != ts_current && t && current_class_type + && template_class_depth (current_class_type) + && template_header_p) { - tree decl = lookup_name (name, 2); + /* Since SCOPE is not TS_CURRENT, we are not looking at a + definition of this tag. Since, in addition, we are currently + processing a (member) template declaration of a template + class, we must be very careful; consider: - if (decl && DECL_CLASS_TEMPLATE_P (decl)) - decl = DECL_TEMPLATE_RESULT (decl); + template + struct S1 - if (decl && TREE_CODE (decl) == TYPE_DECL) - { - /* Two cases we need to consider when deciding if a class - template is allowed as an elaborated type specifier: - 1. It is a self reference to its own class. - 2. It comes with a template header. + template + struct S2 + { template + friend struct S1; }; - For example: + Here, the S2::S1 declaration should not be confused with the + outer declaration. In particular, the inner version should + have a template parameter of level 2, not level 1. This + would be particularly important if the member declaration + were instead: - template class C { - class C *c1; // DECL_SELF_REFERENCE_P is true - class D; - }; - template class C; // template_header_p is true - template class C::D { - class C *c2; // DECL_SELF_REFERENCE_P is true - }; */ + template friend struct S1; - t = check_elaborated_type_specifier (tag_code, - decl, - template_header_p - | DECL_SELF_REFERENCE_P (decl)); - if (t == error_mark_node) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); - } - else - t = NULL_TREE; + say, when we should tsubst into `U' when instantiating + S2. On the other hand, when presented with: - if (t && current_class_type - && template_class_depth (current_class_type) - && template_header_p) - { - /* Since GLOBALIZE is nonzero, we are not looking at a - definition of this tag. Since, in addition, we are currently - processing a (member) template declaration of a template - class, we must be very careful; consider: + template + struct S1 { + template + struct S2 {}; + template + friend struct S2; + }; - template - struct S1 - - template - struct S2 - { template - friend struct S1; }; - - Here, the S2::S1 declaration should not be confused with the - outer declaration. In particular, the inner version should - have a template parameter of level 2, not level 1. This - would be particularly important if the member declaration - were instead: - - template friend struct S1; - - say, when we should tsubst into `U' when instantiating - S2. On the other hand, when presented with: - - template - struct S1 { - template - struct S2 {}; - template - friend struct S2; - }; - - we must find the inner binding eventually. We - accomplish this by making sure that the new type we - create to represent this declaration has the right - TYPE_CONTEXT. */ - context = TYPE_CONTEXT (t); - t = NULL_TREE; - } + we must find the inner binding eventually. We + accomplish this by making sure that the new type we + create to represent this declaration has the right + TYPE_CONTEXT. */ + context = TYPE_CONTEXT (t); + t = NULL_TREE; } if (! t) @@ -9563,26 +9771,44 @@ xref_tag (enum tag_types tag_code, tree name, the forward-reference will be altered into a real type. */ if (code == ENUMERAL_TYPE) { - error ("use of enum `%#D' without previous declaration", name); + error ("use of enum %q#D without previous declaration", name); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); } else { t = make_aggr_type (code); TYPE_CONTEXT (t) = context; - pushtag (name, t, globalize); + t = pushtag (name, t, scope); } } else { - if (!globalize && processing_template_decl && IS_AGGR_TYPE (t)) - redeclare_class_template (t, current_template_parms); - else if (!processing_template_decl + if (template_header_p && IS_AGGR_TYPE (t)) + { + if (!redeclare_class_template (t, current_template_parms)) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + } + else if (!processing_template_decl && CLASS_TYPE_P (t) && CLASSTYPE_IS_TEMPLATE (t)) { - error ("redeclaration of `%T' as a non-template", t); - t = error_mark_node; + error ("redeclaration of %qT as a non-template", t); + error ("previous declaration %q+D", t); + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + } + + /* Make injected friend class visible. */ + if (scope != ts_within_enclosing_non_class + && hidden_name_p (TYPE_NAME (t))) + { + DECL_ANTICIPATED (TYPE_NAME (t)) = 0; + DECL_FRIEND_P (TYPE_NAME (t)) = 0; + + if (TYPE_TEMPLATE_INFO (t)) + { + DECL_ANTICIPATED (TYPE_TI_TEMPLATE (t)) = 0; + DECL_FRIEND_P (TYPE_TI_TEMPLATE (t)) = 0; + } } } @@ -9590,7 +9816,7 @@ xref_tag (enum tag_types tag_code, tree name, } tree -xref_tag_from_type (tree old, tree id, int globalize) +xref_tag_from_type (tree old, tree id, tag_scope scope) { enum tag_types tag_kind; @@ -9602,195 +9828,209 @@ xref_tag_from_type (tree old, tree id, int globalize) if (id == NULL_TREE) id = TYPE_IDENTIFIER (old); - return xref_tag (tag_kind, id, globalize, false); + return xref_tag (tag_kind, id, scope, false); } -/* REF is a type (named NAME), for which we have just seen some - baseclasses. BASE_LIST is a list of those baseclasses; the - TREE_PURPOSE is an access_* node, and the TREE_VALUE is the type of - the base-class. TREE_VIA_VIRTUAL indicates virtual - inheritance. CODE_TYPE_NODE indicates whether REF is a class, - struct, or union. */ +/* Create the binfo hierarchy for REF with (possibly NULL) base list + BASE_LIST. For each element on BASE_LIST the TREE_PURPOSE is an + access_* node, and the TREE_VALUE is the type of the base-class. + Non-NULL TREE_TYPE indicates virtual inheritance. + + Returns true if the binfo heirarchy was successfully created, + false if an error was detected. */ -void +bool xref_basetypes (tree ref, tree base_list) { - /* In the declaration `A : X, Y, ... Z' we mark all the types - (A, X, Y, ..., Z) so we can check for duplicates. */ tree *basep; - + tree binfo, base_binfo; + unsigned max_vbases = 0; /* Maximum direct & indirect virtual bases. */ + unsigned max_bases = 0; /* Maximum direct bases. */ int i; - enum tag_types tag_code; + tree default_access; + tree igo_prev; /* Track Inheritance Graph Order. */ if (ref == error_mark_node) - return; + return false; - if (TREE_CODE (ref) == UNION_TYPE) - { - error ("derived union `%T' invalid", ref); - return; - } - - tag_code = (CLASSTYPE_DECLARED_CLASS (ref) ? class_type : record_type); + /* The base of a derived class is private by default, all others are + public. */ + default_access = (TREE_CODE (ref) == RECORD_TYPE + && CLASSTYPE_DECLARED_CLASS (ref) + ? access_private_node : access_public_node); /* First, make sure that any templates in base-classes are instantiated. This ensures that if we call ourselves recursively we do not get confused about which classes are marked and which are not. */ - basep = &base_list; - while (*basep) + basep = &base_list; + while (*basep) { tree basetype = TREE_VALUE (*basep); + if (!(processing_template_decl && uses_template_parms (basetype)) && !complete_type_or_else (basetype, NULL)) /* An incomplete type. Remove it from the list. */ *basep = TREE_CHAIN (*basep); else - basep = &TREE_CHAIN (*basep); + { + max_bases++; + if (TREE_TYPE (*basep)) + max_vbases++; + if (CLASS_TYPE_P (basetype)) + max_vbases += VEC_length (tree, CLASSTYPE_VBASECLASSES (basetype)); + basep = &TREE_CHAIN (*basep); + } } - SET_CLASSTYPE_MARKED (ref); - i = list_length (base_list); - if (i) + TYPE_MARKED_P (ref) = 1; + + /* The binfo slot should be empty, unless this is an (ill-formed) + redefinition. */ + gcc_assert (!TYPE_BINFO (ref) || TYPE_SIZE (ref)); + gcc_assert (TYPE_MAIN_VARIANT (ref) == ref); + + binfo = make_tree_binfo (max_bases); + + TYPE_BINFO (ref) = binfo; + BINFO_OFFSET (binfo) = size_zero_node; + BINFO_TYPE (binfo) = ref; + + if (max_bases) { - tree binfo = TYPE_BINFO (ref); - tree binfos = make_tree_vec (i); - tree accesses = make_tree_vec (i); - - BINFO_BASETYPES (binfo) = binfos; - BINFO_BASEACCESSES (binfo) = accesses; - - for (i = 0; base_list; base_list = TREE_CHAIN (base_list)) + BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, gc, max_bases); + /* An aggregate cannot have baseclasses. */ + CLASSTYPE_NON_AGGREGATE (ref) = 1; + + if (TREE_CODE (ref) == UNION_TYPE) + { + error ("derived union %qT invalid", ref); + return false; + } + } + + if (max_bases > 1) + { + if (TYPE_FOR_JAVA (ref)) + { + error ("Java class %qT cannot have multiple bases", ref); + return false; + } + } + + if (max_vbases) + { + CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, gc, max_vbases); + + if (TYPE_FOR_JAVA (ref)) + { + error ("Java class %qT cannot have virtual bases", ref); + return false; + } + } + + for (igo_prev = binfo; base_list; base_list = TREE_CHAIN (base_list)) + { + tree access = TREE_PURPOSE (base_list); + int via_virtual = TREE_TYPE (base_list) != NULL_TREE; + tree basetype = TREE_VALUE (base_list); + + if (access == access_default_node) + access = default_access; + + if (TREE_CODE (basetype) == TYPE_DECL) + basetype = TREE_TYPE (basetype); + if (TREE_CODE (basetype) != RECORD_TYPE + && TREE_CODE (basetype) != TYPENAME_TYPE + && TREE_CODE (basetype) != TEMPLATE_TYPE_PARM + && TREE_CODE (basetype) != BOUND_TEMPLATE_TEMPLATE_PARM) { - tree access = TREE_PURPOSE (base_list); - int via_virtual = TREE_VIA_VIRTUAL (base_list); - tree basetype = TREE_VALUE (base_list); - tree base_binfo; - - if (access == access_default_node) - /* The base of a derived struct is public by default. */ - access = (tag_code == class_type - ? access_private_node : access_public_node); - - if (basetype && TREE_CODE (basetype) == TYPE_DECL) - basetype = TREE_TYPE (basetype); - if (!basetype - || (TREE_CODE (basetype) != RECORD_TYPE - && TREE_CODE (basetype) != TYPENAME_TYPE - && TREE_CODE (basetype) != TEMPLATE_TYPE_PARM - && TREE_CODE (basetype) != BOUND_TEMPLATE_TEMPLATE_PARM)) - { - error ("base type `%T' fails to be a struct or class type", - basetype); - continue; - } - - if (CLASSTYPE_MARKED (basetype)) - { - if (basetype == ref) - error ("recursive type `%T' undefined", basetype); - else - error ("duplicate base type `%T' invalid", basetype); - continue; - } - - if (TYPE_FOR_JAVA (basetype) - && (current_lang_depth () == 0)) - TYPE_FOR_JAVA (ref) = 1; - - if (CLASS_TYPE_P (basetype)) - { - base_binfo = TYPE_BINFO (basetype); - /* This flag will be in the binfo of the base type, we must - clear it after copying the base binfos. */ - BINFO_DEPENDENT_BASE_P (base_binfo) - = dependent_type_p (basetype); - } + error ("base type %qT fails to be a struct or class type", + basetype); + return false; + } + + if (TYPE_FOR_JAVA (basetype) && (current_lang_depth () == 0)) + TYPE_FOR_JAVA (ref) = 1; + + base_binfo = NULL_TREE; + if (CLASS_TYPE_P (basetype) && !dependent_type_p (basetype)) + { + base_binfo = TYPE_BINFO (basetype); + /* The original basetype could have been a typedef'd type. */ + basetype = BINFO_TYPE (base_binfo); + + /* Inherit flags from the base. */ + TYPE_HAS_NEW_OPERATOR (ref) + |= TYPE_HAS_NEW_OPERATOR (basetype); + TYPE_HAS_ARRAY_NEW_OPERATOR (ref) + |= TYPE_HAS_ARRAY_NEW_OPERATOR (basetype); + TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype); + TYPE_HAS_CONVERSION (ref) |= TYPE_HAS_CONVERSION (basetype); + CLASSTYPE_DIAMOND_SHAPED_P (ref) + |= CLASSTYPE_DIAMOND_SHAPED_P (basetype); + CLASSTYPE_REPEATED_BASE_P (ref) + |= CLASSTYPE_REPEATED_BASE_P (basetype); + } + + /* We must do this test after we've seen through a typedef + type. */ + if (TYPE_MARKED_P (basetype)) + { + if (basetype == ref) + error ("recursive type %qT undefined", basetype); else - base_binfo = make_binfo (size_zero_node, basetype, - NULL_TREE, NULL_TREE); - - TREE_VEC_ELT (binfos, i) = base_binfo; - TREE_VEC_ELT (accesses, i) = access; - /* This flag will be in the binfo of the base type, we must - clear it after copying the base binfos. */ - TREE_VIA_VIRTUAL (base_binfo) = via_virtual; - - SET_CLASSTYPE_MARKED (basetype); - - /* We are free to modify these bits because they are meaningless - at top level, and BASETYPE is a top-level type. */ - if (via_virtual || TYPE_USES_VIRTUAL_BASECLASSES (basetype)) - { - TYPE_USES_VIRTUAL_BASECLASSES (ref) = 1; - /* Converting to a virtual base class requires looking - up the offset of the virtual base. */ - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1; - } - - if (CLASS_TYPE_P (basetype)) - { - TYPE_HAS_NEW_OPERATOR (ref) - |= TYPE_HAS_NEW_OPERATOR (basetype); - TYPE_HAS_ARRAY_NEW_OPERATOR (ref) - |= TYPE_HAS_ARRAY_NEW_OPERATOR (basetype); - TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype); - /* If the base-class uses multiple inheritance, so do we. */ - TYPE_USES_MULTIPLE_INHERITANCE (ref) - |= TYPE_USES_MULTIPLE_INHERITANCE (basetype); - /* Likewise, if converting to a base of the base may require - code, then we may need to generate code to convert to a - base as well. */ - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) - |= TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (basetype); - } - i++; + error ("duplicate base type %qT invalid", basetype); + return false; } - if (i) - TREE_VEC_LENGTH (accesses) = TREE_VEC_LENGTH (binfos) = i; - else - BINFO_BASEACCESSES (binfo) = BINFO_BASETYPES (binfo) = NULL_TREE; - - if (i > 1) - { - TYPE_USES_MULTIPLE_INHERITANCE (ref) = 1; - /* If there is more than one non-empty they cannot be at the same - address. */ - TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (ref) = 1; - } - } - - /* Copy the base binfos, collect the virtual bases and set the - inheritance order chain. */ - copy_base_binfos (TYPE_BINFO (ref), ref, NULL_TREE); - CLASSTYPE_VBASECLASSES (ref) = nreverse (CLASSTYPE_VBASECLASSES (ref)); + TYPE_MARKED_P (basetype) = 1; - if (TYPE_FOR_JAVA (ref)) - { - if (TYPE_USES_MULTIPLE_INHERITANCE (ref)) - error ("Java class '%T' cannot have multiple bases", ref); - if (CLASSTYPE_VBASECLASSES (ref)) - error ("Java class '%T' cannot have virtual bases", ref); + base_binfo = copy_binfo (base_binfo, basetype, ref, + &igo_prev, via_virtual); + if (!BINFO_INHERITANCE_CHAIN (base_binfo)) + BINFO_INHERITANCE_CHAIN (base_binfo) = binfo; + + BINFO_BASE_APPEND (binfo, base_binfo); + BINFO_BASE_ACCESS_APPEND (binfo, access); } + if (VEC_space (tree, CLASSTYPE_VBASECLASSES (ref), 1)) + /* If we have space in the vbase vector, we must have shared at + least one of them, and are therefore diamond shaped. */ + CLASSTYPE_DIAMOND_SHAPED_P (ref) = 1; + /* Unmark all the types. */ - while (i--) + for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + TYPE_MARKED_P (BINFO_TYPE (base_binfo)) = 0; + TYPE_MARKED_P (ref) = 0; + + /* Now see if we have a repeated base type. */ + if (!CLASSTYPE_REPEATED_BASE_P (ref)) { - tree basetype = BINFO_TYPE (BINFO_BASETYPE (TYPE_BINFO (ref), i)); - - CLEAR_CLASSTYPE_MARKED (basetype); - if (CLASS_TYPE_P (basetype)) + for (base_binfo = binfo; base_binfo; + base_binfo = TREE_CHAIN (base_binfo)) { - TREE_VIA_VIRTUAL (TYPE_BINFO (basetype)) = 0; - BINFO_DEPENDENT_BASE_P (TYPE_BINFO (basetype)) = 0; + if (TYPE_MARKED_P (BINFO_TYPE (base_binfo))) + { + CLASSTYPE_REPEATED_BASE_P (ref) = 1; + break; + } + TYPE_MARKED_P (BINFO_TYPE (base_binfo)) = 1; } + for (base_binfo = binfo; base_binfo; + base_binfo = TREE_CHAIN (base_binfo)) + if (TYPE_MARKED_P (BINFO_TYPE (base_binfo))) + TYPE_MARKED_P (BINFO_TYPE (base_binfo)) = 0; + else + break; } - CLEAR_CLASSTYPE_MARKED (ref); + + return true; } /* Begin compiling the definition of an enumeration type. - NAME is its name (or null if anonymous). + NAME is its name. Returns the type object, as yet incomplete. Also records info about it so that build_enumerator may be used to declare the individual values as they are read. */ @@ -9798,27 +10038,34 @@ xref_basetypes (tree ref, tree base_list) tree start_enum (tree name) { - tree enumtype = NULL_TREE; - struct cp_binding_level *b = current_binding_level; + tree enumtype; + + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); /* If this is the real definition for a previous forward reference, fill in the contents in the same object that used to be the forward reference. */ - if (name != NULL_TREE) - enumtype = lookup_tag (ENUMERAL_TYPE, name, b, 1); + enumtype = lookup_and_check_tag (enum_type, name, + /*tag_scope=*/ts_current, + /*template_header_p=*/false); if (enumtype != NULL_TREE && TREE_CODE (enumtype) == ENUMERAL_TYPE) { - error ("multiple definition of `%#T'", enumtype); + error ("multiple definition of %q#T", enumtype); error ("%Jprevious definition here", TYPE_MAIN_DECL (enumtype)); /* Clear out TYPE_VALUES, and start again. */ TYPE_VALUES (enumtype) = NULL_TREE; } else { + /* In case of error, make a dummy enum to allow parsing to + continue. */ + if (enumtype == error_mark_node) + name = make_anon_name (); + enumtype = make_node (ENUMERAL_TYPE); - pushtag (name, enumtype, 0); + enumtype = pushtag (name, enumtype, /*tag_scope=*/ts_current); } return enumtype; @@ -9838,8 +10085,9 @@ finish_enum (tree enumtype) tree maxnode; tree t; bool unsignedp; + bool use_short_enum; int lowprec; - int highprec; + int highprec; int precision; integer_type_kind itk; tree underlying_type = NULL_TREE; @@ -9853,8 +10101,8 @@ finish_enum (tree enumtype) works. */ if (processing_template_decl) { - for (values = TYPE_VALUES (enumtype); - values; + for (values = TYPE_VALUES (enumtype); + values; values = TREE_CHAIN (values)) TREE_TYPE (TREE_VALUE (values)) = enumtype; if (at_function_scope_p ()) @@ -9867,8 +10115,8 @@ finish_enum (tree enumtype) { minnode = maxnode = NULL_TREE; - for (values = TYPE_VALUES (enumtype); - values; + for (values = TYPE_VALUES (enumtype); + values; values = TREE_CHAIN (values)) { decl = TREE_VALUE (values); @@ -9881,6 +10129,8 @@ finish_enum (tree enumtype) /* Update the minimum and maximum values, if appropriate. */ value = DECL_INITIAL (decl); + if (value == error_mark_node) + value = integer_zero_node; /* Figure out what the minimum and maximum values of the enumerators are. */ if (!minnode) @@ -9889,16 +10139,6 @@ finish_enum (tree enumtype) maxnode = value; else if (tree_int_cst_lt (value, minnode)) minnode = value; - - /* Set the TREE_TYPE for the values as well. That's so that when - we call decl_constant_value we get an entity of the right type - (but with the constant value). But first make a copy so we - don't clobber shared INTEGER_CSTs. */ - if (TREE_TYPE (value) != enumtype) - { - value = DECL_INITIAL (decl) = copy_node (value); - TREE_TYPE (value) = enumtype; - } } } else @@ -9926,18 +10166,24 @@ finish_enum (tree enumtype) enumeration. It is implementation-defined which integral type is used as the underlying type for an enumeration except that the underlying type shall not be larger than int unless the value of - an enumerator cannot fit in an int or unsigned int. + an enumerator cannot fit in an int or unsigned int. We use "int" or an "unsigned int" as the underlying type, even if a smaller integral type would work, unless the user has - explicitly requested that we use the smallest possible type. */ - for (itk = (flag_short_enums ? itk_char : itk_int); - itk != itk_none; + explicitly requested that we use the smallest possible type. The + user can request that for all enumerations with a command line + flag, or for just one enumeration with an attribute. */ + + use_short_enum = flag_short_enums + || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype)); + + for (itk = (use_short_enum ? itk_char : itk_int); + itk != itk_none; itk++) { underlying_type = integer_types[itk]; if (TYPE_PRECISION (underlying_type) >= precision - && TREE_UNSIGNED (underlying_type) == unsignedp) + && TYPE_UNSIGNED (underlying_type) == unsignedp) break; } if (itk == itk_none) @@ -9947,12 +10193,12 @@ finish_enum (tree enumtype) IF no integral type can represent all the enumerator values, the enumeration is ill-formed. */ error ("no integral type can represent all of the enumerator values " - "for `%T'", enumtype); + "for %qT", enumtype); precision = TYPE_PRECISION (long_long_integer_type_node); underlying_type = integer_types[itk_unsigned_long_long]; } - /* Compute the minium and maximum values for the type. + /* Compute the minium and maximum values for the type. [dcl.enum] @@ -9966,13 +10212,13 @@ finish_enum (tree enumtype) narrower than their underlying type are suitably zero or sign extended to fill their mode. g++ doesn't make these guarantees. Until the middle-end can represent such paradoxical types, we - set the TYPE_PRECISON to the width of the underlying type. */ + set the TYPE_PRECISION to the width of the underlying type. */ TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type); set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp); /* [dcl.enum] - + The value of sizeof() applied to an enumeration type, an object of an enumeration type, or an enumerator, is the value of sizeof() applied to the underlying type. */ @@ -9981,15 +10227,24 @@ finish_enum (tree enumtype) TYPE_MODE (enumtype) = TYPE_MODE (underlying_type); TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); - TREE_UNSIGNED (enumtype) = TREE_UNSIGNED (underlying_type); + TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); /* Convert each of the enumerators to the type of the underlying type of the enumeration. */ for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values)) { + location_t saved_location; + decl = TREE_VALUE (values); + saved_location = input_location; + input_location = DECL_SOURCE_LOCATION (decl); value = perform_implicit_conversion (underlying_type, DECL_INITIAL (decl)); + input_location = saved_location; + + /* Do not clobber shared ints. */ + value = copy_node (value); + TREE_TYPE (value) = enumtype; DECL_INITIAL (decl) = value; TREE_VALUE (values) = value; @@ -10007,7 +10262,7 @@ finish_enum (tree enumtype) TYPE_PRECISION (t) = TYPE_PRECISION (enumtype); TYPE_ALIGN (t) = TYPE_ALIGN (enumtype); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype); - TREE_UNSIGNED (t) = TREE_UNSIGNED (enumtype); + TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype); } /* Finish debugging output for this type. */ @@ -10025,6 +10280,11 @@ build_enumerator (tree name, tree value, tree enumtype) tree context; tree type; + /* If the VALUE was erroneous, pretend it wasn't there; that will + result in the enum being assigned the next value in sequence. */ + if (value == error_mark_node) + value = NULL_TREE; + /* Remove no-op casts from the value. */ if (value) STRIP_TYPE_NOPS (value); @@ -10034,7 +10294,7 @@ build_enumerator (tree name, tree value, tree enumtype) /* Validate and default VALUE. */ if (value != NULL_TREE) { - value = decl_constant_value (value); + value = integral_constant_value (value); if (TREE_CODE (value) == INTEGER_CST) { @@ -10043,7 +10303,7 @@ build_enumerator (tree name, tree value, tree enumtype) } else { - error ("enumerator value for `%D' not integer constant", name); + error ("enumerator value for %qD not integer constant", name); value = NULL_TREE; } } @@ -10051,19 +10311,29 @@ build_enumerator (tree name, tree value, tree enumtype) /* Default based on previous value. */ if (value == NULL_TREE) { - tree prev_value; - if (TYPE_VALUES (enumtype)) { - /* The next value is the previous value ... */ - prev_value = DECL_INITIAL (TREE_VALUE (TYPE_VALUES (enumtype))); - /* ... plus one. */ - value = cp_build_binary_op (PLUS_EXPR, - prev_value, - integer_one_node); + HOST_WIDE_INT hi; + unsigned HOST_WIDE_INT lo; + tree prev_value; + bool overflowed; - if (tree_int_cst_lt (value, prev_value)) - error ("overflow in enumeration values at `%D'", name); + /* The next value is the previous value plus one. We can + safely assume that the previous value is an INTEGER_CST. + add_double doesn't know the type of the target expression, + so we must check with int_fits_type_p as well. */ + prev_value = DECL_INITIAL (TREE_VALUE (TYPE_VALUES (enumtype))); + overflowed = add_double (TREE_INT_CST_LOW (prev_value), + TREE_INT_CST_HIGH (prev_value), + 1, 0, &lo, &hi); + value = build_int_cst_wide (TREE_TYPE (prev_value), lo, hi); + overflowed |= !int_fits_type_p (value, TREE_TYPE (prev_value)); + + if (overflowed) + { + error ("overflow in enumeration values at %qD", name); + value = error_mark_node; + } } else value = integer_zero_node; @@ -10075,8 +10345,6 @@ build_enumerator (tree name, tree value, tree enumtype) /* C++ associates enums with global, function, or class declarations. */ context = current_scope (); - if (!context) - context = current_namespace; /* Build the actual enumeration constant. Note that the enumeration constants have the type of their initializers until the @@ -10103,7 +10371,9 @@ build_enumerator (tree name, tree value, tree enumtype) decl = build_decl (CONST_DECL, name, type); DECL_CONTEXT (decl) = FROB_CONTEXT (context); - TREE_CONSTANT (decl) = TREE_READONLY (decl) = 1; + TREE_CONSTANT (decl) = 1; + TREE_INVARIANT (decl) = 1; + TREE_READONLY (decl) = 1; DECL_INITIAL (decl) = value; if (context && context == current_class_type) @@ -10130,27 +10400,24 @@ check_function_type (tree decl, tree current_function_parms) /* In a function definition, arg types must be complete. */ require_complete_types_for_parms (current_function_parms); + if (dependent_type_p (return_type)) + return; if (!COMPLETE_OR_VOID_TYPE_P (return_type)) { - error ("return type `%#T' is incomplete", TREE_TYPE (fntype)); + tree args = TYPE_ARG_TYPES (fntype); - /* Make it return void instead, but don't change the - type of the DECL_RESULT, in case we have a named return value. */ + error ("return type %q#T is incomplete", return_type); + + /* Make it return void instead. */ if (TREE_CODE (fntype) == METHOD_TYPE) - { - tree ctype = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))); - TREE_TYPE (decl) - = build_method_type_directly (ctype, - void_type_node, - FUNCTION_ARG_CHAIN (decl)); - } + fntype = build_method_type_directly (TREE_TYPE (TREE_VALUE (args)), + void_type_node, + TREE_CHAIN (args)); else - TREE_TYPE (decl) - = build_function_type (void_type_node, - TYPE_ARG_TYPES (TREE_TYPE (decl))); + fntype = build_function_type (void_type_node, args); TREE_TYPE (decl) = build_exception_variant (fntype, - TYPE_RAISES_EXCEPTIONS (fntype)); + TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))); } else abstract_virtuals_error (decl, TREE_TYPE (fntype)); @@ -10169,96 +10436,50 @@ check_function_type (tree decl, tree current_function_parms) This function creates a binding context for the function body as well as setting up the FUNCTION_DECL in current_function_decl. - Returns 1 on success. If the DECLARATOR is not suitable for a function - (it defines a datum instead), we return 0, which tells - yyparse to report a parse error. - For C++, we must first check whether that datum makes any sense. For example, "class A local_a(1,2);" means that variable local_a is an aggregate of type A, which should have a constructor applied to it with the argument list [1, 2]. */ -int -start_function (tree declspecs, tree declarator, tree attrs, int flags) +void +start_preparsed_function (tree decl1, tree attrs, int flags) { - tree decl1; tree ctype = NULL_TREE; tree fntype; tree restype; int doing_friend = 0; struct cp_binding_level *bl; tree current_function_parms; + struct c_fileinfo *finfo + = get_fileinfo (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1))); + bool honor_interface; /* Sanity check. */ - my_friendly_assert (TREE_CODE (TREE_VALUE (void_list_node)) == VOID_TYPE, 160); - my_friendly_assert (TREE_CHAIN (void_list_node) == NULL_TREE, 161); + gcc_assert (TREE_CODE (TREE_VALUE (void_list_node)) == VOID_TYPE); + gcc_assert (TREE_CHAIN (void_list_node) == NULL_TREE); - /* This should only be done once on the top most decl. */ - if (have_extern_spec) + fntype = TREE_TYPE (decl1); + if (TREE_CODE (fntype) == METHOD_TYPE) + ctype = TYPE_METHOD_BASETYPE (fntype); + + /* ISO C++ 11.4/5. A friend function defined in a class is in + the (lexical) scope of the class in which it is defined. */ + if (!ctype && DECL_FRIEND_P (decl1)) { - declspecs = tree_cons (NULL_TREE, get_identifier ("extern"), declspecs); - have_extern_spec = false; - } + ctype = DECL_FRIEND_CONTEXT (decl1); - if (flags & SF_PRE_PARSED) - { - decl1 = declarator; - - fntype = TREE_TYPE (decl1); - if (TREE_CODE (fntype) == METHOD_TYPE) - ctype = TYPE_METHOD_BASETYPE (fntype); - - /* ISO C++ 11.4/5. A friend function defined in a class is in - the (lexical) scope of the class in which it is defined. */ - if (!ctype && DECL_FRIEND_P (decl1)) - { - ctype = DECL_FRIEND_CONTEXT (decl1); - - /* CTYPE could be null here if we're dealing with a template; - for example, `inline friend float foo()' inside a template - will have no CTYPE set. */ - if (ctype && TREE_CODE (ctype) != RECORD_TYPE) - ctype = NULL_TREE; - else - doing_friend = 1; - } - } - else - { - decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs); - /* If the declarator is not suitable for a function definition, - cause a syntax error. */ - if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL) - return 0; - - cplus_decl_attributes (&decl1, attrs, 0); - - /* If #pragma weak was used, mark the decl weak now. */ - if (global_scope_p (current_binding_level)) - maybe_apply_pragma_weak (decl1); - - fntype = TREE_TYPE (decl1); - - restype = TREE_TYPE (fntype); - - if (TREE_CODE (fntype) == METHOD_TYPE) - ctype = TYPE_METHOD_BASETYPE (fntype); - else if (DECL_MAIN_P (decl1)) - { - /* If this doesn't return integer_type, or a typedef to - integer_type, complain. */ - if (!same_type_p (TREE_TYPE (TREE_TYPE (decl1)), integer_type_node)) - { - if (pedantic || warn_return_type) - pedwarn ("return type for `main' changed to `int'"); - TREE_TYPE (decl1) = fntype = default_function_type; - } - } + /* CTYPE could be null here if we're dealing with a template; + for example, `inline friend float foo()' inside a template + will have no CTYPE set. */ + if (ctype && TREE_CODE (ctype) != RECORD_TYPE) + ctype = NULL_TREE; + else + doing_friend = 1; } if (DECL_DECLARED_INLINE_P (decl1) && lookup_attribute ("noinline", attrs)) - warning ("%Jinline function '%D' given attribute noinline", decl1, decl1); + warning (0, "inline function %q+D given attribute noinline", decl1); if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1)) /* This is a constructor, we must ensure that any default args @@ -10275,12 +10496,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) ctype = NULL_TREE; } - /* Warn if function was previously implicitly declared - (but not if we warned then). */ - if (! warn_implicit - && IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)) != NULL_TREE) - cp_warning_at ("`%D' implicitly declared before its definition", IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1))); - /* Set up current_class_type, and enter the scope of the class, if appropriate. */ if (ctype) @@ -10301,7 +10516,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) if (warn_ecpp && DECL_OVERLOADED_OPERATOR_P (decl1) == NOP_EXPR && TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE) - warning ("`operator=' should return a reference to `*this'"); + warning (OPT_Weffc__, "% should return a reference to %<*this%>"); /* Make the init_value nonzero so pushdecl knows this is not tentative. error_mark_node is replaced below (in poplevel) with the BLOCK. */ @@ -10318,6 +10533,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) by push_nested_class.) */ if (processing_template_decl) { + /* FIXME: Handle error_mark_node more gracefully. */ tree newdecl1 = push_template_decl (decl1); if (newdecl1 != error_mark_node) decl1 = newdecl1; @@ -10333,10 +10549,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) /* Make sure the parameter and return types are reasonable. When you declare a function, these types can be incomplete, but they must be complete when you define the function. */ - if (! processing_template_decl) - check_function_type (decl1, current_function_parms); - /* Make sure no default arg is missing. */ - check_default_args (decl1); + check_function_type (decl1, current_function_parms); /* Build the return declaration for the function. */ restype = TREE_TYPE (fntype); @@ -10345,10 +10558,14 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) restype = type_promotes_to (restype); if (DECL_RESULT (decl1) == NULL_TREE) { - DECL_RESULT (decl1) - = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); - c_apply_type_quals_to_decl (cp_type_quals (restype), - DECL_RESULT (decl1)); + tree resdecl; + + resdecl = build_decl (RESULT_DECL, 0, TYPE_MAIN_VARIANT (restype)); + DECL_ARTIFICIAL (resdecl) = 1; + DECL_IGNORED_P (resdecl) = 1; + DECL_RESULT (decl1) = resdecl; + + cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl); } /* Initialize RTL machinery. We cannot do this until @@ -10364,11 +10581,10 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) call expand_expr to calculate the size of a variable-sized array. We haven't necessarily assigned RTL to all variables yet, so it's not safe to try to expand expressions involving them. */ - immediate_size_expand = 0; cfun->x_dont_save_pending_sizes_p = 1; /* Start the statement-tree, start the tree now. */ - begin_stmt_tree (&DECL_SAVED_TREE (decl1)); + DECL_SAVED_TREE (decl1) = push_stmt_list (); /* Let the user know we're compiling this function. */ announce_function (decl1); @@ -10380,7 +10596,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) { /* A specialization is not used to guide overload resolution. */ if (!DECL_FUNCTION_MEMBER_P (decl1) - && !(DECL_USE_TEMPLATE (decl1) && + && !(DECL_USE_TEMPLATE (decl1) && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl1)))) { tree olddecl = pushdecl (decl1); @@ -10402,6 +10618,17 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1)); } fntype = TREE_TYPE (decl1); + + /* If #pragma weak applies, mark the decl appropriately now. + The pragma only applies to global functions. Because + determining whether or not the #pragma applies involves + computing the mangled name for the declaration, we cannot + apply the pragma until after we have merged this declaration + with any previous declarations; if the original declaration + has a linkage specification, that specification applies to + the definition as well, and may affect the mangled name. */ + if (!DECL_CONTEXT (decl1)) + maybe_apply_pragma_weak (decl1); } /* Reset these in case the call to pushdecl changed them. */ @@ -10421,10 +10648,8 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) between `current_class_type' and `current_class_ptr'. */ tree t = DECL_ARGUMENTS (decl1); - my_friendly_assert (t != NULL_TREE && TREE_CODE (t) == PARM_DECL, - 162); - my_friendly_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE, - 19990811); + gcc_assert (t != NULL_TREE && TREE_CODE (t) == PARM_DECL); + gcc_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE); cp_function_chain->x_current_class_ref = build_indirect_ref (t, NULL); @@ -10440,12 +10665,20 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) } if (DECL_HAS_VTT_PARM_P (decl1)) { - if (DECL_NAME (t) != vtt_parm_identifier) - abort (); + gcc_assert (DECL_NAME (t) == vtt_parm_identifier); current_vtt_parm = t; } } + honor_interface = (!DECL_TEMPLATE_INSTANTIATION (decl1) + /* Implicitly-defined methods (like the + destructor for a class in which no destructor + is explicitly declared) must not be defined + until their definition is needed. So, we + ignore interface specifications for + compiler-generated functions. */ + && !DECL_ARTIFICIAL (decl1)); + if (DECL_INTERFACE_KNOWN (decl1)) { tree ctx = decl_function_context (decl1); @@ -10462,16 +10695,15 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) /* If this function belongs to an interface, it is public. If it belongs to someone else's interface, it is also external. This only affects inlines and template instantiations. */ - else if (interface_unknown == 0 - && ! DECL_TEMPLATE_INSTANTIATION (decl1)) + else if (!finfo->interface_unknown && honor_interface) { - if (DECL_DECLARED_INLINE_P (decl1) + if (DECL_DECLARED_INLINE_P (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1) || processing_template_decl) { DECL_EXTERNAL (decl1) - = (interface_only - || (DECL_DECLARED_INLINE_P (decl1) + = (finfo->interface_only + || (DECL_DECLARED_INLINE_P (decl1) && ! flag_implement_inlines && !DECL_VINDEX (decl1))); @@ -10480,17 +10712,22 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) } else DECL_EXTERNAL (decl1) = 0; - DECL_NOT_REALLY_EXTERN (decl1) = 0; DECL_INTERFACE_KNOWN (decl1) = 1; + /* If this function is in an interface implemented in this file, + make sure that the backend knows to emit this function + here. */ + if (!DECL_EXTERNAL (decl1)) + mark_needed (decl1); } - else if (interface_unknown && interface_only - && ! DECL_TEMPLATE_INSTANTIATION (decl1)) + else if (finfo->interface_unknown && finfo->interface_only + && honor_interface) { /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma - interface, we will have interface_only set but not - interface_known. In that case, we don't want to use the normal - heuristics because someone will supply a #pragma implementation - elsewhere, and deducing it here would produce a conflict. */ + interface, we will have both finfo->interface_unknown and + finfo->interface_only set. In that case, we don't want to + use the normal heuristics because someone will supply a + #pragma implementation elsewhere, and deducing it here would + produce a conflict. */ comdat_linkage (decl1); DECL_EXTERNAL (decl1) = 0; DECL_INTERFACE_KNOWN (decl1) = 1; @@ -10502,7 +10739,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) So clear DECL_EXTERNAL. */ DECL_EXTERNAL (decl1) = 0; - if ((DECL_DECLARED_INLINE_P (decl1) + if ((DECL_DECLARED_INLINE_P (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1)) && ! DECL_INTERFACE_KNOWN (decl1) /* Don't try to defer nested functions for now. */ @@ -10512,23 +10749,86 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) DECL_INTERFACE_KNOWN (decl1) = 1; } + /* Determine the ELF visibility attribute for the function. We must not + do this before calling "pushdecl", as we must allow "duplicate_decls" + to merge any attributes appropriately. We also need to wait until + linkage is set. */ + if (!DECL_CLONED_FUNCTION_P (decl1)) + determine_visibility (decl1); + begin_scope (sk_function_parms, decl1); ++function_depth; - if (DECL_DESTRUCTOR_P (decl1)) + if (DECL_DESTRUCTOR_P (decl1) + || (DECL_CONSTRUCTOR_P (decl1) + && targetm.cxx.cdtor_returns_this ())) { - dtor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); - DECL_CONTEXT (dtor_label) = current_function_decl; + cdtor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); + DECL_CONTEXT (cdtor_label) = current_function_decl; } start_fname_decls (); - + store_parm_decls (current_function_parms); +} + + +/* Like start_preparsed_function, except that instead of a + FUNCTION_DECL, this function takes DECLSPECS and DECLARATOR. + + Returns 1 on success. If the DECLARATOR is not suitable for a function + (it defines a datum instead), we return 0, which tells + yyparse to report a parse error. */ + +int +start_function (cp_decl_specifier_seq *declspecs, + const cp_declarator *declarator, + tree attrs) +{ + tree decl1; + + decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, &attrs); + /* If the declarator is not suitable for a function definition, + cause a syntax error. */ + if (decl1 == NULL_TREE || TREE_CODE (decl1) != FUNCTION_DECL) + return 0; + + if (DECL_MAIN_P (decl1)) + /* main must return int. grokfndecl should have corrected it + (and issued a diagnostic) if the user got it wrong. */ + gcc_assert (same_type_p (TREE_TYPE (TREE_TYPE (decl1)), + integer_type_node)); + + start_preparsed_function (decl1, attrs, /*flags=*/SF_DEFAULT); return 1; } +/* Returns true iff an EH_SPEC_BLOCK should be created in the body of + FN. */ + +static bool +use_eh_spec_block (tree fn) +{ + return (flag_exceptions && flag_enforce_eh_specs + && !processing_template_decl + && TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)) + /* We insert the EH_SPEC_BLOCK only in the original + function; then, it is copied automatically to the + clones. */ + && !DECL_CLONED_FUNCTION_P (fn) + /* Implicitly-generated constructors and destructors have + exception specifications. However, those specifications + are the union of the possible exceptions specified by the + constructors/destructors for bases and members, so no + unallowed exception will ever reach this function. By + not creating the EH_SPEC_BLOCK we save a little memory, + and we avoid spurious warnings about unreachable + code. */ + && !DECL_ARTIFICIAL (fn)); +} + /* Store the parameter declarations into the current function declaration. This is called after parsing the parameter declarations, before digesting the body of the function. @@ -10574,7 +10874,7 @@ store_parm_decls (tree current_function_parms) || TREE_CODE (parm) != VOID_TYPE) pushdecl (parm); else - error ("parameter `%D' declared void", parm); + error ("parameter %qD declared void", parm); } else { @@ -10599,10 +10899,7 @@ store_parm_decls (tree current_function_parms) DECL_ARGUMENTS is not modified. */ current_binding_level->names = chainon (nonparms, DECL_ARGUMENTS (fndecl)); - /* Do the starting of the exception specifications, if we have any. */ - if (flag_exceptions && !processing_template_decl - && flag_enforce_eh_specs - && TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))) + if (use_eh_spec_block (current_function_decl)) current_eh_spec_block = begin_eh_spec_block (); } @@ -10618,47 +10915,40 @@ save_function_data (tree decl) /* Save the language-specific per-function data so that we can get it back when we really expand this function. */ - my_friendly_assert (!DECL_PENDING_INLINE_P (decl), - 19990908); + gcc_assert (!DECL_PENDING_INLINE_P (decl)); /* Make a copy. */ - f = ggc_alloc (sizeof (struct language_function)); + f = GGC_NEW (struct language_function); memcpy (f, cp_function_chain, sizeof (struct language_function)); DECL_SAVED_FUNCTION_DATA (decl) = f; /* Clear out the bits we don't need. */ - f->base.x_stmt_tree.x_last_stmt = NULL_TREE; - f->base.x_stmt_tree.x_last_expr_type = NULL_TREE; - f->x_named_label_uses = NULL; + f->base.x_stmt_tree.x_cur_stmt_list = NULL_TREE; f->bindings = NULL; f->x_local_names = NULL; - - /* If we've already decided that we cannot inline this function, we - must remember that fact when we actually go to expand the - function. */ - if (current_function_cannot_inline) - { - f->cannot_inline = current_function_cannot_inline; - DECL_INLINE (decl) = 0; - } } -/* Add a note to mark the beginning of the main body of the constructor. - This is used to set up the data structures for the cleanup regions for - fully-constructed bases and members. */ -static void -begin_constructor_body (void) -{ -} - -/* Add a note to mark the end of the main body of the constructor. This is - used to end the cleanup regions for fully-constructed bases and - members. */ +/* Set the return value of the constructor (if present). */ static void finish_constructor_body (void) { + tree val; + tree exprstmt; + + if (targetm.cxx.cdtor_returns_this ()) + { + /* Any return from a constructor will end up here. */ + add_stmt (build_stmt (LABEL_EXPR, cdtor_label)); + + val = DECL_ARGUMENTS (current_function_decl); + val = build2 (MODIFY_EXPR, TREE_TYPE (val), + DECL_RESULT (current_function_decl), val); + /* Return the address of the object. */ + exprstmt = build_stmt (RETURN_EXPR, val); + add_stmt (exprstmt); + } } /* Do all the processing for the beginning of a destructor; set up the @@ -10667,45 +10957,25 @@ finish_constructor_body (void) static void begin_destructor_body (void) { - tree if_stmt; tree compound_stmt; - /* If the dtor is empty, and we know there is not any possible - way we could use any vtable entries, before they are possibly - set by a base class dtor, we don't have to setup the vtables, - as we know that any base class dtor will set up any vtables - it needs. We avoid MI, because one base class dtor can do a - virtual dispatch to an overridden function that would need to - have a non-related vtable set up, we cannot avoid setting up - vtables in that case. We could change this to see if there - is just one vtable. + /* If the CURRENT_CLASS_TYPE is incomplete, we will have already + issued an error message. We still want to try to process the + body of the function, but initialize_vtbl_ptrs will crash if + TYPE_BINFO is NULL. */ + if (COMPLETE_TYPE_P (current_class_type)) + { + compound_stmt = begin_compound_stmt (0); + /* Make all virtual function table pointers in non-virtual base + classes point to CURRENT_CLASS_TYPE's virtual function + tables. */ + initialize_vtbl_ptrs (current_class_ptr); + finish_compound_stmt (compound_stmt); - ??? In the destructor for a class, the vtables are set - appropriately for that class. There will be no non-related - vtables. jason 2001-12-11. */ - if_stmt = begin_if_stmt (); - - /* If it is not safe to avoid setting up the vtables, then - someone will change the condition to be boolean_true_node. - (Actually, for now, we do not have code to set the condition - appropriately, so we just assume that we always need to - initialize the vtables.) */ - finish_if_stmt_cond (boolean_true_node, if_stmt); - - compound_stmt = begin_compound_stmt (/*has_no_scope=*/false); - - /* Make all virtual function table pointers in non-virtual base - classes point to CURRENT_CLASS_TYPE's virtual function - tables. */ - initialize_vtbl_ptrs (current_class_ptr); - - finish_compound_stmt (compound_stmt); - finish_then_clause (if_stmt); - finish_if_stmt (); - - /* And insert cleanups for our bases and members so that they - will be properly destroyed if we throw. */ - push_base_cleanups (); + /* And insert cleanups for our bases and members so that they + will be properly destroyed if we throw. */ + push_base_cleanups (); + } } /* At the end of every destructor we generate code to delete the object if @@ -10718,7 +10988,7 @@ finish_destructor_body (void) /* Any return from a destructor will end up here; that way all base and member cleanups will be run when the function returns. */ - add_stmt (build_stmt (LABEL_STMT, dtor_label)); + add_stmt (build_stmt (LABEL_EXPR, cdtor_label)); /* In a virtual destructor, we must call delete. */ if (DECL_VIRTUAL_P (current_function_decl)) @@ -10732,32 +11002,48 @@ finish_destructor_body (void) an implicit definition), non-placement operator delete shall be looked up in the scope of the destructor's class and if found shall be accessible and unambiguous. */ - exprstmt = build_op_delete_call - (DELETE_EXPR, current_class_ptr, virtual_size, - LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE); + exprstmt = build_op_delete_call(DELETE_EXPR, current_class_ptr, + virtual_size, + /*global_p=*/false, + /*placement=*/NULL_TREE, + /*alloc_fn=*/NULL_TREE); if_stmt = begin_if_stmt (); - finish_if_stmt_cond (build (BIT_AND_EXPR, integer_type_node, - current_in_charge_parm, - integer_one_node), + finish_if_stmt_cond (build2 (BIT_AND_EXPR, integer_type_node, + current_in_charge_parm, + integer_one_node), if_stmt); finish_expr_stmt (exprstmt); finish_then_clause (if_stmt); - finish_if_stmt (); + finish_if_stmt (if_stmt); + } + + if (targetm.cxx.cdtor_returns_this ()) + { + tree val; + + val = DECL_ARGUMENTS (current_function_decl); + val = build2 (MODIFY_EXPR, TREE_TYPE (val), + DECL_RESULT (current_function_decl), val); + /* Return the address of the object. */ + exprstmt = build_stmt (RETURN_EXPR, val); + add_stmt (exprstmt); } } /* Do the necessary processing for the beginning of a function body, which in this case includes member-initializers, but not the catch clauses of a function-try-block. Currently, this means opening a binding level - for the member-initializers (in a ctor) and member cleanups (in a dtor). - In other functions, this isn't necessary, but it doesn't hurt. */ + for the member-initializers (in a ctor) and member cleanups (in a dtor). */ tree begin_function_body (void) { tree stmt; + if (! FUNCTION_NEEDS_BODY_BLOCK (current_function_decl)) + return NULL_TREE; + if (processing_template_decl) /* Do nothing now. */; else @@ -10766,13 +11052,10 @@ begin_function_body (void) operation of dwarfout.c. */ keep_next_level (true); - stmt = begin_compound_stmt (/*has_no_scope=*/false); - COMPOUND_STMT_BODY_BLOCK (stmt) = 1; + stmt = begin_compound_stmt (BCS_FN_BODY); if (processing_template_decl) /* Do nothing now. */; - else if (DECL_CONSTRUCTOR_P (current_function_decl)) - begin_constructor_body (); else if (DECL_DESTRUCTOR_P (current_function_decl)) begin_destructor_body (); @@ -10791,6 +11074,9 @@ begin_function_body (void) void finish_function_body (tree compstmt) { + if (compstmt == NULL_TREE) + return; + /* Close the block. */ finish_compound_stmt (compstmt); @@ -10800,7 +11086,21 @@ finish_function_body (tree compstmt) finish_constructor_body (); else if (DECL_DESTRUCTOR_P (current_function_decl)) finish_destructor_body (); -} +} + +/* Given a function, returns the BLOCK corresponding to the outermost level + of curly braces, skipping the artificial block created for constructor + initializers. */ + +static tree +outer_curly_brace_block (tree fndecl) +{ + tree block = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)); + if (FUNCTION_NEEDS_BODY_BLOCK (current_function_decl)) + /* Skip the artificial function body block. */ + block = BLOCK_SUBBLOCKS (block); + return block; +} /* Finish up a function declaration and compile that function all the way to assembler language output. The free the storage @@ -10841,58 +11141,66 @@ finish_function (int flags) This caused &foo to be of type ptr-to-const-function which then got a warning when stored in a ptr-to-function variable. */ - my_friendly_assert (building_stmt_tree (), 20000911); - + gcc_assert (building_stmt_tree ()); + /* For a cloned function, we've already got all the code we need; there's no need to add any extra bits. */ if (!DECL_CLONED_FUNCTION_P (fndecl)) { if (DECL_MAIN_P (current_function_decl)) { - /* Make it so that `main' always returns 0 by default. */ + tree stmt; + + /* Make it so that `main' always returns 0 by default (or + 1 for VMS). */ #if VMS_TARGET - finish_return_stmt (integer_one_node); + stmt = finish_return_stmt (integer_one_node); #else - finish_return_stmt (integer_zero_node); + stmt = finish_return_stmt (integer_zero_node); +#endif + /* Hack. We don't want the middle-end to warn that this + return is unreachable, so put the statement on the + special line 0. */ +#ifdef USE_MAPPED_LOCATION + SET_EXPR_LOCATION (stmt, UNKNOWN_LOCATION); +#else + annotate_with_file_line (stmt, input_filename, 0); #endif } - /* Finish dealing with exception specifiers. */ - if (flag_exceptions && !processing_template_decl - && flag_enforce_eh_specs - && TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))) + if (use_eh_spec_block (current_function_decl)) finish_eh_spec_block (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl)), current_eh_spec_block); } - finish_fname_decls (); - /* If we're saving up tree structure, tie off the function now. */ - finish_stmt_tree (&DECL_SAVED_TREE (fndecl)); + DECL_SAVED_TREE (fndecl) = pop_stmt_list (DECL_SAVED_TREE (fndecl)); + + finish_fname_decls (); /* If this function can't throw any exceptions, remember that. */ if (!processing_template_decl && !cp_function_chain->can_throw - && !flag_non_call_exceptions) + && !flag_non_call_exceptions + && !DECL_REPLACEABLE_P (fndecl)) TREE_NOTHROW (fndecl) = 1; /* This must come after expand_function_end because cleanups might have declarations (from inline functions) that need to go into this function's blocks. */ - + /* If the current binding level isn't the outermost binding level for this function, either there is a bug, or we have experienced syntax errors and the statement tree is malformed. */ if (current_binding_level->kind != sk_function_parms) { /* Make sure we have already experienced errors. */ - if (errorcount == 0) - abort (); + gcc_assert (errorcount); /* Throw away the broken statement tree and extra binding - levels. */ - DECL_SAVED_TREE (fndecl) = build_stmt (COMPOUND_STMT, NULL_TREE); + levels. */ + DECL_SAVED_TREE (fndecl) = alloc_stmt_list (); while (current_binding_level->kind != sk_function_parms) { @@ -10906,12 +11214,10 @@ finish_function (int flags) /* Statements should always be full-expressions at the outermost set of curly braces for a function. */ - my_friendly_assert (stmts_are_full_exprs_p (), 19990831); + gcc_assert (stmts_are_full_exprs_p ()); - /* Set up the named return value optimization, if we can. Here, we - eliminate the copy from the nrv into the RESULT_DECL and any cleanup - for the nrv. genrtl_start_function and declare_return_variable - handle making the nrv and RESULT_DECL share space. */ + /* Set up the named return value optimization, if we can. Candidate + variables are selected in check_return_value. */ if (current_function_return_value) { tree r = current_function_return_value; @@ -10925,19 +11231,11 @@ finish_function (int flags) the function so we know that their lifetime always ends with a return; see g++.dg/opt/nrv6.C. We could be more flexible if we were to do this optimization in tree-ssa. */ - /* Skip the artificial function body block. */ - && (outer = BLOCK_SUBBLOCKS (BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl))), - chain_member (r, BLOCK_VARS (outer)))) - { - - DECL_ALIGN (r) = DECL_ALIGN (DECL_RESULT (fndecl)); - walk_tree_without_duplicates (&DECL_SAVED_TREE (fndecl), - nullify_returns_r, r); - } - else - /* Clear it so genrtl_start_function and declare_return_variable - know we're not optimizing. */ - current_function_return_value = NULL_TREE; + && (outer = outer_curly_brace_block (fndecl)) + && chain_member (r, BLOCK_VARS (outer))) + finalize_nrv (&DECL_SAVED_TREE (fndecl), r, DECL_RESULT (fndecl)); + + current_function_return_value = NULL_TREE; } /* Remember that we were in class scope. */ @@ -10955,18 +11253,6 @@ finish_function (int flags) if (!processing_template_decl) save_function_data (fndecl); - /* If this function calls `setjmp' it cannot be inlined. When - `longjmp' is called it is not guaranteed to restore the value of - local variables that have been modified since the call to - `setjmp'. So, if were to inline this function into some caller - `c', then when we `longjmp', we might not restore all variables - in `c'. (It might seem, at first blush, that there's no way for - this function to modify local variables in `c', but their - addresses may have been stored somewhere accessible to this - function.) */ - if (!processing_template_decl && calls_setjmp_p (fndecl)) - DECL_UNINLINABLE (fndecl) = 1; - /* Complain if there's just no return statement. */ if (warn_return_type && TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE @@ -10977,11 +11263,39 @@ finish_function (int flags) && !DECL_NAME (DECL_RESULT (fndecl)) /* Normally, with -Wreturn-type, flow will complain. Unless we're an inline function, as we might never be compiled separately. */ - && (DECL_INLINE (fndecl) || processing_template_decl)) - warning ("no return statement in function returning non-void"); + && (DECL_INLINE (fndecl) || processing_template_decl) + /* Structor return values (if any) are set by the compiler. */ + && !DECL_CONSTRUCTOR_P (fndecl) + && !DECL_DESTRUCTOR_P (fndecl)) + warning (OPT_Wreturn_type, "no return statement in function returning non-void"); + + /* Store the end of the function, so that we get good line number + info for the epilogue. */ + cfun->function_end_locus = input_location; + + /* Genericize before inlining. */ + if (!processing_template_decl) + { + struct language_function *f = DECL_SAVED_FUNCTION_DATA (fndecl); + cp_genericize (fndecl); + /* Clear out the bits we don't need. */ + f->x_current_class_ptr = NULL; + f->x_current_class_ref = NULL; + f->x_eh_spec_block = NULL; + f->x_in_charge_parm = NULL; + f->x_vtt_parm = NULL; + f->x_return_value = NULL; + f->bindings = NULL; + f->extern_decl_map = NULL; + + /* Handle attribute((warn_unused_result)). Relies on gimple input. */ + c_warn_unused_result (&DECL_SAVED_TREE (fndecl)); + } + /* Clear out the bits we don't need. */ + local_names = NULL; /* We're leaving the context of this function, so zap cfun. It's still in - DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */ + DECL_STRUCT_FUNCTION, and we'll restore it in tree_rest_of_compilation. */ cfun = NULL; current_function_decl = NULL; @@ -11030,7 +11344,8 @@ finish_function (int flags) CHANGES TO CODE IN `grokfield'. */ tree -start_method (tree declspecs, tree declarator, tree attrlist) +start_method (cp_decl_specifier_seq *declspecs, + const cp_declarator *declarator, tree attrlist) { tree fndecl = grokdeclarator (declarator, declspecs, MEMFUNCDEF, 0, &attrlist); @@ -11053,14 +11368,11 @@ start_method (tree declspecs, tree declarator, tree attrlist) if (DECL_IN_AGGR_P (fndecl)) { - if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (fndecl)) != current_class_type) - { - if (DECL_CONTEXT (fndecl) - && TREE_CODE( DECL_CONTEXT (fndecl)) != NAMESPACE_DECL) - error ("`%D' is already defined in class `%T'", fndecl, - DECL_CONTEXT (fndecl)); - } - return void_type_node; + if (DECL_CONTEXT (fndecl) + && TREE_CODE (DECL_CONTEXT (fndecl)) != NAMESPACE_DECL) + error ("%qD is already defined in class %qT", fndecl, + DECL_CONTEXT (fndecl)); + return error_mark_node; } check_template_shadow (fndecl); @@ -11084,10 +11396,9 @@ start_method (tree declspecs, tree declarator, tree attrlist) fndecl = copy_node (fndecl); TREE_CHAIN (fndecl) = NULL_TREE; } - grok_special_member_properties (fndecl); } - cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0); + finish_decl (fndecl, NULL_TREE, NULL_TREE); /* Make a place for the parms. */ begin_scope (sk_function_parms, fndecl); @@ -11135,7 +11446,7 @@ finish_method (tree decl) { if (DECL_NAME (link) != NULL_TREE) pop_binding (DECL_NAME (link), link); - my_friendly_assert (TREE_CODE (link) != FUNCTION_DECL, 163); + gcc_assert (TREE_CODE (link) != FUNCTION_DECL); DECL_CONTEXT (link) = NULL_TREE; } @@ -11148,8 +11459,8 @@ finish_method (tree decl) for String.cc in libg++. */ if (DECL_FRIEND_P (fndecl)) { - CLASSTYPE_INLINE_FRIENDS (current_class_type) - = tree_cons (NULL_TREE, fndecl, CLASSTYPE_INLINE_FRIENDS (current_class_type)); + VEC_safe_push (tree, gc, CLASSTYPE_INLINE_FRIENDS (current_class_type), + fndecl); decl = void_type_node; } @@ -11163,18 +11474,18 @@ finish_method (tree decl) void maybe_register_incomplete_var (tree var) { - my_friendly_assert (TREE_CODE (var) == VAR_DECL, 20020406); + gcc_assert (TREE_CODE (var) == VAR_DECL); /* Keep track of variables with incomplete types. */ - if (!processing_template_decl && TREE_TYPE (var) != error_mark_node + if (!processing_template_decl && TREE_TYPE (var) != error_mark_node && DECL_EXTERNAL (var)) { tree inner_type = TREE_TYPE (var); - + while (TREE_CODE (inner_type) == ARRAY_TYPE) inner_type = TREE_TYPE (inner_type); inner_type = TYPE_MAIN_VARIANT (inner_type); - + if ((!COMPLETE_TYPE_P (inner_type) && CLASS_TYPE_P (inner_type)) /* RTTI TD entries are created while defining the type_info. */ || (TYPE_LANG_SPECIFIC (inner_type) @@ -11192,21 +11503,26 @@ complete_vars (tree type) { tree *list = &incomplete_vars; - my_friendly_assert (CLASS_TYPE_P (type), 20020406); - while (*list) + gcc_assert (CLASS_TYPE_P (type)); + while (*list) { if (same_type_p (type, TREE_PURPOSE (*list))) { tree var = TREE_VALUE (*list); + tree type = TREE_TYPE (var); /* Complete the type of the variable. The VAR_DECL itself will be laid out in expand_expr. */ - complete_type (TREE_TYPE (var)); + complete_type (type); + cp_apply_type_quals_to_decl (cp_type_quals (type), var); /* Remove this entry from the list. */ *list = TREE_CHAIN (*list); } else list = &TREE_CHAIN (*list); } + + /* Check for pending declarations which may have abstract type. */ + complete_type_check_abstract (type); } /* If DECL is of a type which needs a cleanup, build that cleanup @@ -11221,6 +11537,8 @@ cxx_maybe_build_cleanup (tree decl) { int flags = LOOKUP_NORMAL|LOOKUP_DESTRUCTOR; tree rval; + bool has_vbases = (TREE_CODE (type) == RECORD_TYPE + && CLASSTYPE_VBASECLASSES (type)); if (TREE_CODE (type) == ARRAY_TYPE) rval = decl; @@ -11231,17 +11549,12 @@ cxx_maybe_build_cleanup (tree decl) } /* Optimize for space over speed here. */ - if (! TYPE_USES_VIRTUAL_BASECLASSES (type) - || flag_expensive_optimizations) + if (!has_vbases || flag_expensive_optimizations) flags |= LOOKUP_NONVIRTUAL; rval = build_delete (TREE_TYPE (rval), rval, sfk_complete_destructor, flags, 0); - if (TYPE_USES_VIRTUAL_BASECLASSES (type) - && ! TYPE_HAS_DESTRUCTOR (type)) - rval = build_compound_expr (rval, build_vbase_delete (type, decl)); - return rval; } return NULL_TREE; @@ -11252,10 +11565,6 @@ cxx_maybe_build_cleanup (tree decl) void finish_stmt (void) { - /* Always assume this statement was not an expression statement. If - it actually was an expression statement, its our callers - responsibility to fix this up. */ - last_expr_type = NULL_TREE; } /* DECL was originally constructed as a non-static member function, @@ -11270,8 +11579,7 @@ revert_static_member_fn (tree decl) if (cp_type_quals (TREE_TYPE (TREE_VALUE (args))) != TYPE_UNQUALIFIED) - error ("static member function `%#D' declared with type qualifiers", - decl); + error ("static member function %q#D declared with type qualifiers", decl); args = TREE_CHAIN (args); tmp = build_function_type (TREE_TYPE (function), args); @@ -11290,8 +11598,7 @@ revert_static_member_fn (tree decl) void cxx_push_function_context (struct function * f) { - struct language_function *p - = ggc_alloc_cleared (sizeof (struct language_function)); + struct language_function *p = GGC_CNEW (struct language_function); f->language = p; /* Whenever we start a new function, we destroy temporaries in the @@ -11308,14 +11615,9 @@ cxx_push_function_context (struct function * f) now, restore saved state. */ *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn); - /* If we decided that we didn't want to inline this function, - make sure the back-end knows that. */ - if (!current_function_cannot_inline) - current_function_cannot_inline = cp_function_chain->cannot_inline; - /* We don't need the saved data anymore. Unless this is an inline function; we need the named return value info for - cp_copy_res_decl_for_inlining. */ + declare_return_variable. */ if (! DECL_INLINE (fn)) DECL_SAVED_FUNCTION_DATA (fn) = NULL; } @@ -11343,9 +11645,9 @@ cp_tree_node_structure (union lang_tree_node * t) case IDENTIFIER_NODE: return TS_CP_IDENTIFIER; case OVERLOAD: return TS_CP_OVERLOAD; case TEMPLATE_PARM_INDEX: return TS_CP_TPI; + case TINST_LEVEL: return TS_CP_TINST_LEVEL; case PTRMEM_CST: return TS_CP_PTRMEM; - case BASELINK: return TS_CP_BASELINK; - case WRAPPER: return TS_CP_WRAPPER; + case BASELINK: return TS_CP_BASELINK; default: return TS_CP_GENERIC; } } @@ -11355,16 +11657,49 @@ tree build_void_list_node (void) { tree t = build_tree_list (NULL_TREE, void_type_node); - TREE_PARMLIST (t) = 1; return t; } -static int +bool cp_missing_noreturn_ok_p (tree decl) { /* A missing noreturn is ok for the `main' function. */ return DECL_MAIN_P (decl); } +/* Return the COMDAT group into which DECL should be placed. */ + +const char * +cxx_comdat_group (tree decl) +{ + tree name; + + /* Virtual tables, construction virtual tables, and virtual table + tables all go in a single COMDAT group, named after the primary + virtual table. */ + if (TREE_CODE (decl) == VAR_DECL && DECL_VTABLE_OR_VTT_P (decl)) + name = DECL_ASSEMBLER_NAME (CLASSTYPE_VTABLES (DECL_CONTEXT (decl))); + /* For all other DECLs, the COMDAT group is the mangled name of the + declaration itself. */ + else + { + while (DECL_THUNK_P (decl)) + { + /* If TARGET_USE_LOCAL_THUNK_ALIAS_P, use_thunk puts the thunk + into the same section as the target function. In that case + we must return target's name. */ + tree target = THUNK_TARGET (decl); + if (TARGET_USE_LOCAL_THUNK_ALIAS_P (target) + && DECL_SECTION_NAME (target) != NULL + && DECL_ONE_ONLY (target)) + decl = target; + else + break; + } + name = DECL_ASSEMBLER_NAME (decl); + } + + return IDENTIFIER_POINTER (name); +} + #include "gt-cp-decl.h" -#include "gtype-cp.h" diff --git a/contrib/gcc/cp/decl.h b/contrib/gcc/cp/decl.h index 46a1ec80688..dd2357a47f3 100644 --- a/contrib/gcc/cp/decl.h +++ b/contrib/gcc/cp/decl.h @@ -1,5 +1,5 @@ /* Variables and structures for declaration processing. - Copyright (C) 1993, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -15,8 +15,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context @@ -31,9 +31,6 @@ enum decl_context }; /* We need this in here to get the decl_context definition. */ -extern tree grokdeclarator (tree, tree, enum decl_context, int, tree*); - -#ifdef DEBUG_CP_BINDING_LEVELS -/* Purely for debugging purposes. */ -extern int debug_bindings_indentation; -#endif +extern tree grokdeclarator (const cp_declarator *, + const cp_decl_specifier_seq *, + enum decl_context, int, tree*); diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c index abd86f7abec..8e1a7011156 100644 --- a/contrib/gcc/cp/decl2.c +++ b/contrib/gcc/cp/decl2.c @@ -1,6 +1,6 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -17,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Process declarations and symbol lookup for C++ front end. @@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */ #include "flags.h" #include "cp-tree.h" #include "decl.h" -#include "lex.h" #include "output.h" #include "except.h" #include "toplev.h" @@ -46,8 +45,13 @@ Boston, MA 02111-1307, USA. */ #include "cpplib.h" #include "target.h" #include "c-common.h" +#include "tree-mudflap.h" #include "cgraph.h" #include "tree-inline.h" +#include "c-pragma.h" +#include "tree-dump.h" +#include "intl.h" + extern cpp_reader *parse_in; /* This structure contains information about the initializations @@ -62,7 +66,6 @@ typedef struct priority_info_s { } *priority_info; static void mark_vtable_entries (tree); -static void grok_function_init (tree, tree); static bool maybe_emit_vtables (tree); static bool acceptable_java_type (tree); static tree start_objects (int, int); @@ -70,34 +73,25 @@ static void finish_objects (int, int, tree); static tree start_static_storage_duration_function (unsigned); static void finish_static_storage_duration_function (tree); static priority_info get_priority_info (int); -static void do_static_initialization (tree, tree); -static void do_static_destruction (tree); -static tree start_static_initialization_or_destruction (tree, int); -static void finish_static_initialization_or_destruction (tree); +static void do_static_initialization_or_destruction (tree, bool); +static void one_static_initialization_or_destruction (tree, tree, bool); static void generate_ctor_or_dtor_function (bool, int, location_t *); static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node, - void *); + void *); static tree prune_vars_needing_no_initialization (tree *); static void write_out_vars (tree); static void import_export_class (tree); static tree get_guard_bits (tree); +static void determine_visibility_from_class (tree, tree); /* A list of static class variables. This is needed, because a static class variable can be declared inside the class without an initializer, and then initialized, statically, outside the class. */ -static GTY(()) varray_type pending_statics; -#define pending_statics_used \ - (pending_statics ? pending_statics->elements_used : 0) +static GTY(()) VEC(tree,gc) *pending_statics; /* A list of functions which were declared inline, but which we may need to emit outline anyway. */ -static GTY(()) varray_type deferred_fns; -#define deferred_fns_used \ - (deferred_fns ? deferred_fns->elements_used : 0) - -/* Flag used when debugging spew.c */ - -extern int spew_debug; +static GTY(()) VEC(tree,gc) *deferred_fns; /* Nonzero if we're done parsing and into end-of-file activities. */ @@ -109,71 +103,31 @@ tree static_ctors; tree static_dtors; -/* Incorporate `const' and `volatile' qualifiers for member functions. - FUNCTION is a TYPE_DECL or a FUNCTION_DECL. - QUALS is a list of qualifiers. Returns any explicit - top-level qualifiers of the method's this pointer, anything other than - TYPE_UNQUALIFIED will be an extension. */ -int -grok_method_quals (tree ctype, tree function, tree quals) +/* Return a member function type (a METHOD_TYPE), given FNTYPE (a + FUNCTION_TYPE), CTYPE (class type), and QUALS (the cv-qualifiers + that apply to the function). */ + +tree +build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals) { - tree fntype = TREE_TYPE (function); - tree raises = TYPE_RAISES_EXCEPTIONS (fntype); - int type_quals = TYPE_UNQUALIFIED; - int dup_quals = TYPE_UNQUALIFIED; - int this_quals = TYPE_UNQUALIFIED; + tree raises; + int type_quals; - do - { - int tq = cp_type_qual_from_rid (TREE_VALUE (quals)); - - if ((type_quals | this_quals) & tq) - dup_quals |= tq; - else if (tq & TYPE_QUAL_RESTRICT) - this_quals |= tq; - else - type_quals |= tq; - quals = TREE_CHAIN (quals); - } - while (quals); - - if (dup_quals != TYPE_UNQUALIFIED) - error ("duplicate type qualifiers in %s declaration", - TREE_CODE (function) == FUNCTION_DECL - ? "member function" : "type"); + if (fntype == error_mark_node || ctype == error_mark_node) + return error_mark_node; + type_quals = quals & ~TYPE_QUAL_RESTRICT; ctype = cp_build_qualified_type (ctype, type_quals); fntype = build_method_type_directly (ctype, TREE_TYPE (fntype), (TREE_CODE (fntype) == METHOD_TYPE ? TREE_CHAIN (TYPE_ARG_TYPES (fntype)) : TYPE_ARG_TYPES (fntype))); + raises = TYPE_RAISES_EXCEPTIONS (fntype); if (raises) fntype = build_exception_variant (fntype, raises); - TREE_TYPE (function) = fntype; - return this_quals; -} - -/* A subroutine of the parser, to handle a component list. */ - -void -grok_x_components (tree specs) -{ - tree t; - - specs = strip_attrs (specs); - - check_tag_decl (specs); - t = groktypename (build_tree_list (specs, NULL_TREE)); - - /* The only case where we need to do anything additional here is an - anonymous union field, e.g.: `struct S { union { int i; }; };'. */ - if (t == NULL_TREE || !ANON_AGGR_TYPE_P (t)) - return; - - fixup_anonymous_aggr (t); - finish_member_declaration (build_decl (FIELD_DECL, NULL_TREE, t)); + return fntype; } /* Build a PARM_DECL with NAME and TYPE, and set DECL_ARG_TYPE @@ -234,7 +188,7 @@ maybe_retrofit_in_chrg (tree fn) /* We don't need an in-charge parameter for constructors that don't have virtual bases. */ if (DECL_CONSTRUCTOR_P (fn) - && !TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn))) + && !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))) return; arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn)); @@ -245,7 +199,7 @@ maybe_retrofit_in_chrg (tree fn) /* If this is a subobject constructor or destructor, our caller will pass us a pointer to our VTT. */ - if (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn))) + if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))) { parm = build_artificial_parm (vtt_parm_identifier, vtt_parm_type); @@ -301,10 +255,9 @@ maybe_retrofit_in_chrg (tree fn) QUALS are the qualifiers for the this pointer. */ void -grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals) +grokclassfn (tree ctype, tree function, enum overload_flags flags) { tree fn_name = DECL_NAME (function); - int this_quals = TYPE_UNQUALIFIED; /* Even within an `extern "C"' block, members get C++ linkage. See [dcl.link] for details. */ @@ -317,28 +270,6 @@ grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals) DECL_NAME (function) = fn_name; } - if (quals) - this_quals = grok_method_quals (ctype, function, quals); - - if (TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE) - { - /* Must add the class instance variable up front. */ - /* Right now we just make this a pointer. But later - we may wish to make it special. */ - tree type = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (function))); - tree qual_type; - tree parm; - - /* The `this' parameter is implicitly `const'; it cannot be - assigned to. */ - this_quals |= TYPE_QUAL_CONST; - qual_type = cp_build_qualified_type (type, this_quals); - parm = build_artificial_parm (this_identifier, qual_type); - c_apply_type_quals_to_decl (this_quals, parm); - TREE_CHAIN (parm) = DECL_ARGUMENTS (function); - DECL_ARGUMENTS (function) = parm; - } - DECL_CONTEXT (function) = ctype; if (flags == DTOR_FLAG) @@ -366,13 +297,14 @@ grok_array_decl (tree array_expr, tree index_exp) { if (type_dependent_expression_p (array_expr) || type_dependent_expression_p (index_exp)) - return build_min_nt (ARRAY_REF, array_expr, index_exp); + return build_min_nt (ARRAY_REF, array_expr, index_exp, + NULL_TREE, NULL_TREE); array_expr = build_non_dependent_expr (array_expr); index_exp = build_non_dependent_expr (index_exp); } type = TREE_TYPE (array_expr); - my_friendly_assert (type, 20030626); + gcc_assert (type); type = non_reference (type); /* If they have an `operator[]', use that. */ @@ -398,9 +330,9 @@ grok_array_decl (tree array_expr, tree index_exp) else p2 = build_expr_type_conversion (WANT_POINTER, index_exp, false); - i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr, + i1 = build_expr_type_conversion (WANT_INT | WANT_ENUM, array_expr, false); - i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp, + i2 = build_expr_type_conversion (WANT_INT | WANT_ENUM, index_exp, false); if ((p1 && i2) && (i1 && p2)) @@ -412,8 +344,8 @@ grok_array_decl (tree array_expr, tree index_exp) array_expr = p2, index_exp = i1; else { - error ("invalid types `%T[%T]' for array subscript", - type, TREE_TYPE (index_exp)); + error ("invalid types %<%T[%T]%> for array subscript", + type, TREE_TYPE (index_exp)); return error_mark_node; } @@ -423,8 +355,8 @@ grok_array_decl (tree array_expr, tree index_exp) expr = build_array_ref (array_expr, index_exp); } if (processing_template_decl && expr != error_mark_node) - return build_min_non_dep (ARRAY_REF, expr, - orig_array_expr, orig_index_exp); + return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp, + NULL_TREE, NULL_TREE); return expr; } @@ -452,19 +384,17 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) return t; } - exp = convert_from_reference (exp); - /* An array can't have been allocated by new, so complain. */ if (TREE_CODE (exp) == VAR_DECL && TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) - warning ("deleting array `%#D'", exp); + warning (0, "deleting array %q#D", exp); t = build_expr_type_conversion (WANT_POINTER, exp, true); if (t == NULL_TREE || t == error_mark_node) { - error ("type `%#T' argument given to `delete', expected pointer", - TREE_TYPE (exp)); + error ("type %q#T argument given to %, expected pointer", + TREE_TYPE (exp)); return error_mark_node; } @@ -475,14 +405,15 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) /* You can't delete functions. */ if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE) { - error ("cannot delete a function. Only pointer-to-objects are valid arguments to `delete'"); + error ("cannot delete a function. Only pointer-to-objects are " + "valid arguments to %"); return error_mark_node; } /* Deleting ptr to void is undefined behavior [expr.delete/3]. */ if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE) { - warning ("deleting `%T' is undefined", type); + warning (0, "deleting %qT is undefined", type); doing_vec = 0; } @@ -491,7 +422,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) return build1 (NOP_EXPR, void_type_node, t); if (doing_vec) - return build_vec_delete (t, /*maxindex=*/NULL_TREE, + return build_vec_delete (t, /*maxindex=*/NULL_TREE, sfk_deleting_destructor, use_global_delete); else @@ -507,37 +438,25 @@ check_member_template (tree tmpl) { tree decl; - my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0); + gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL); decl = DECL_TEMPLATE_RESULT (tmpl); if (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (decl)))) { - if (current_function_decl) - /* 14.5.2.2 [temp.mem] - - A local class shall not have member templates. */ - error ("invalid declaration of member template `%#D' in local class", - decl); - - if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl)) - { - /* 14.5.2.3 [temp.mem] - - A member function template shall not be virtual. */ - error - ("invalid use of `virtual' in template declaration of `%#D'", - decl); - DECL_VIRTUAL_P (decl) = 0; - } + /* The parser rejects template declarations in local classes. */ + gcc_assert (!current_function_decl); + /* The parser rejects any use of virtual in a function template. */ + gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL + && DECL_VIRTUAL_P (decl))); /* The debug-information generating code doesn't know what to do - with member templates. */ + with member templates. */ DECL_IGNORED_P (tmpl) = 1; - } + } else - error ("template declaration of `%#D'", decl); + error ("template declaration of %q#D", decl); } /* Return true iff TYPE is a valid Java parameter or return type. */ @@ -545,8 +464,11 @@ check_member_template (tree tmpl) static bool acceptable_java_type (tree type) { + if (type == error_mark_node) + return false; + if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type)) - return 1; + return true; if (TREE_CODE (type) == POINTER_TYPE || TREE_CODE (type) == REFERENCE_TYPE) { type = TREE_TYPE (type); @@ -586,8 +508,8 @@ check_java_method (tree method) if (!acceptable_java_type (ret_type)) { - error ("Java method '%D' has non-Java return type `%T'", - method, ret_type); + error ("Java method %qD has non-Java return type %qT", + method, ret_type); jerr = true; } @@ -596,14 +518,15 @@ check_java_method (tree method) arg_types = TREE_CHAIN (arg_types); if (DECL_HAS_VTT_PARM_P (method)) arg_types = TREE_CHAIN (arg_types); - + for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types)) { tree type = TREE_VALUE (arg_types); if (!acceptable_java_type (type)) { - error ("Java method '%D' has non-Java parameter type `%T'", - method, type); + if (type != error_mark_node) + error ("Java method %qD has non-Java parameter type %qT", + method, type); jerr = true; } } @@ -612,55 +535,67 @@ check_java_method (tree method) /* Sanity check: report error if this function FUNCTION is not really a member of the class (CTYPE) it is supposed to belong to. - CNAME is the same here as it is for grokclassfn above. - TEMPLATE_HEADER_P is true when this declaration comes with a - template header. */ + TEMPLATE_PARMS is used to specify the template parameters of a member + template passed as FUNCTION_DECL. If the member template is passed as a + TEMPLATE_DECL, it can be NULL since the parameters can be extracted + from the declaration. If the function is not a function template, it + must be NULL. + It returns the original declaration for the function, or NULL_TREE + if no declaration was found (and an error was emitted). */ tree -check_classfn (tree ctype, tree function, bool template_header_p) +check_classfn (tree ctype, tree function, tree template_parms) { int ix; - int is_template; + bool is_template; + tree pushed_scope; if (DECL_USE_TEMPLATE (function) && !(TREE_CODE (function) == TEMPLATE_DECL && DECL_TEMPLATE_SPECIALIZATION (function)) - && is_member_template (DECL_TI_TEMPLATE (function))) + && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (function))) /* Since this is a specialization of a member template, we're not going to find the declaration in the class. For example, in: - - struct S { template void f(T); }; - template <> void S::f(int); - + + struct S { template void f(T); }; + template <> void S::f(int); + we're not going to find `S::f(int)', but there's no reason we should, either. We let our callers know we didn't find the method, but we don't complain. */ return NULL_TREE; + /* Basic sanity check: for a template function, the template parameters + either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */ + if (TREE_CODE (function) == TEMPLATE_DECL) + { + gcc_assert (!template_parms + || comp_template_parms (template_parms, + DECL_TEMPLATE_PARMS (function))); + template_parms = DECL_TEMPLATE_PARMS (function); + } + /* OK, is this a definition of a member template? */ - is_template = (TREE_CODE (function) == TEMPLATE_DECL - || template_header_p); - - ix = lookup_fnfields_1 (complete_type (ctype), - DECL_CONSTRUCTOR_P (function) ? ctor_identifier : - DECL_DESTRUCTOR_P (function) ? dtor_identifier : - DECL_NAME (function)); + is_template = (template_parms != NULL_TREE); + /* We must enter the scope here, because conversion operators are + named by target type, and type equivalence relies on typenames + resolving within the scope of CTYPE. */ + pushed_scope = push_scope (ctype); + ix = class_method_index_for_fn (complete_type (ctype), function); if (ix >= 0) { - tree methods = CLASSTYPE_METHOD_VEC (ctype); + VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (ctype); tree fndecls, fndecl = 0; bool is_conv_op; - bool pop_p; const char *format = NULL; - - pop_p = push_scope (ctype); - for (fndecls = TREE_VEC_ELT (methods, ix); + + for (fndecls = VEC_index (tree, methods, ix); fndecls; fndecls = OVL_NEXT (fndecls)) { tree p1, p2; - + fndecl = OVL_CURRENT (fndecls); p1 = TYPE_ARG_TYPES (TREE_TYPE (function)); p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); @@ -668,8 +603,8 @@ check_classfn (tree ctype, tree function, bool template_header_p) /* We cannot simply call decls_match because this doesn't work for static member functions that are pretending to be methods, and because the name may have been changed by - asm("new_name"). */ - + asm("new_name"). */ + /* Get rid of the this parameter on functions that become static. */ if (DECL_STATIC_FUNCTION_P (fndecl) @@ -680,28 +615,34 @@ check_classfn (tree ctype, tree function, bool template_header_p) declaration. */ if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL)) continue; - + if (same_type_p (TREE_TYPE (TREE_TYPE (function)), TREE_TYPE (TREE_TYPE (fndecl))) && compparms (p1, p2) + && (!is_template + || comp_template_parms (template_parms, + DECL_TEMPLATE_PARMS (fndecl))) && (DECL_TEMPLATE_SPECIALIZATION (function) == DECL_TEMPLATE_SPECIALIZATION (fndecl)) && (!DECL_TEMPLATE_SPECIALIZATION (function) - || (DECL_TI_TEMPLATE (function) + || (DECL_TI_TEMPLATE (function) == DECL_TI_TEMPLATE (fndecl)))) break; } - if (pop_p) - pop_scope (ctype); if (fndecls) - return OVL_CURRENT (fndecls); - error ("prototype for `%#D' does not match any in class `%T'", + { + if (pushed_scope) + pop_scope (pushed_scope); + return OVL_CURRENT (fndecls); + } + + error ("prototype for %q#D does not match any in class %qT", function, ctype); is_conv_op = DECL_CONV_FN_P (fndecl); if (is_conv_op) ix = CLASSTYPE_FIRST_CONVERSION_SLOT; - fndecls = TREE_VEC_ELT (methods, ix); + fndecls = VEC_index (tree, methods, ix); while (fndecls) { fndecl = OVL_CURRENT (fndecls); @@ -709,10 +650,9 @@ check_classfn (tree ctype, tree function, bool template_header_p) if (!fndecls && is_conv_op) { - if (TREE_VEC_LENGTH (methods) > ix) + if (VEC_length (tree, methods) > (size_t) ++ix) { - ix++; - fndecls = TREE_VEC_ELT (methods, ix); + fndecls = VEC_index (tree, methods, ix); if (!DECL_CONV_FN_P (OVL_CURRENT (fndecls))) { fndecls = NULL_TREE; @@ -723,18 +663,18 @@ check_classfn (tree ctype, tree function, bool template_header_p) is_conv_op = false; } if (format) - format = " %#D"; + format = " %+#D"; else if (fndecls) - format = "candidates are: %#D"; + format = N_("candidates are: %+#D"); else - format = "candidate is: %#D"; - cp_error_at (format, fndecl); + format = N_("candidate is: %+#D"); + error (format, fndecl); } } else if (!COMPLETE_TYPE_P (ctype)) cxx_incomplete_type_error (function, ctype); else - error ("no `%#D' member function declared in class `%T'", + error ("no %q#D member function declared in class %qT", function, ctype); /* If we did not find the method in the class, add it to avoid @@ -742,49 +682,58 @@ check_classfn (tree ctype, tree function, bool template_header_p) case we'll only confuse ourselves when the function is declared properly within the class. */ if (COMPLETE_TYPE_P (ctype)) - add_method (ctype, function, /*error_p=*/1); + add_method (ctype, function, NULL_TREE); + + if (pushed_scope) + pop_scope (pushed_scope); return NULL_TREE; } -/* We have just processed the DECL, which is a static data member. - Its initializer, if present, is INIT. The ASMSPEC_TREE, if - present, is the assembly-language name for the data member. - FLAGS is as for cp_finish_decl. */ +/* DECL is a function with vague linkage. Remember it so that at the + end of the translation unit we can decide whether or not to emit + it. */ void -finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, - int flags) +note_vague_linkage_fn (tree decl) { - my_friendly_assert (TREE_PUBLIC (decl), 0); + if (!DECL_DEFERRED_FN (decl)) + { + DECL_DEFERRED_FN (decl) = 1; + DECL_DEFER_OUTPUT (decl) = 1; + VEC_safe_push (tree, gc, deferred_fns, decl); + } +} +/* We have just processed the DECL, which is a static data member. + The other parameters are as for cp_finish_decl. */ + +void +finish_static_data_member_decl (tree decl, + tree init, bool init_const_expr_p, + tree asmspec_tree, + int flags) +{ DECL_CONTEXT (decl) = current_class_type; /* We cannot call pushdecl here, because that would fill in the TREE_CHAIN of our decl. Instead, we modify cp_finish_decl to do the right thing, namely, to put this decl out straight away. */ - /* current_class_type can be NULL_TREE in case of error. */ - if (!asmspec_tree && current_class_type) - DECL_INITIAL (decl) = error_mark_node; if (! processing_template_decl) - { - if (!pending_statics) - VARRAY_TREE_INIT (pending_statics, 32, "pending_statics"); - VARRAY_PUSH_TREE (pending_statics, decl); - } + VEC_safe_push (tree, gc, pending_statics, decl); if (LOCAL_CLASS_P (current_class_type)) - pedwarn ("local class `%#T' shall not have static data member `%#D'", + pedwarn ("local class %q#T shall not have static data member %q#D", current_class_type, decl); /* Static consts need not be initialized in the class definition. */ if (init != NULL_TREE && TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) { static int explained = 0; - + error ("initializer invalid for static member with constructor"); if (!explained) - { + { error ("(an out of class initialization is required)"); explained = 1; } @@ -797,47 +746,24 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree, DECL_INITIAL (decl) = init; DECL_IN_AGGR_P (decl) = 1; - cp_finish_decl (decl, init, asmspec_tree, flags); + cp_finish_decl (decl, init, init_const_expr_p, asmspec_tree, flags); } -/* Process the specs, declarator (NULL if omitted) and width (NULL if omitted) - of a structure component, returning a _DECL node. - QUALS is a list of type qualifiers for this decl (such as for declaring - const member functions). - - This is done during the parsing of the struct declaration. - The _DECL nodes are chained together and the lot of them - are ultimately passed to `build_struct' to make the RECORD_TYPE node. - - If class A defines that certain functions in class B are friends, then - the way I have set things up, it is B who is interested in permission - granted by A. However, it is in A's context that these declarations - are parsed. By returning a void_type_node, class A does not attempt - to incorporate the declarations of the friends within its structure. - - DO NOT MAKE ANY CHANGES TO THIS CODE WITHOUT MAKING CORRESPONDING - CHANGES TO CODE IN `start_method'. */ +/* DECLARATOR and DECLSPECS correspond to a class member. The other + parameters are as for cp_finish_decl. Return the DECL for the + class member declared. */ tree -grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, - tree attrlist) +grokfield (const cp_declarator *declarator, + cp_decl_specifier_seq *declspecs, + tree init, bool init_const_expr_p, + tree asmspec_tree, + tree attrlist) { tree value; const char *asmspec = 0; int flags = LOOKUP_ONLYCONVERTING; - if (declspecs == NULL_TREE - && TREE_CODE (declarator) == SCOPE_REF - && TREE_CODE (TREE_OPERAND (declarator, 1)) == IDENTIFIER_NODE) - { - /* Access declaration */ - if (! IS_AGGR_TYPE_CODE (TREE_CODE (TREE_OPERAND (declarator, 0)))) - ; - else if (TREE_COMPLEXITY (declarator) == current_class_depth) - pop_nested_class (); - return do_class_using_decl (declarator); - } - if (init && TREE_CODE (init) == TREE_LIST && TREE_VALUE (init) == error_mark_node @@ -851,7 +777,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, if (TREE_CODE (value) == TYPE_DECL && init) { - error ("typedef `%D' is initialized (use __typeof__ instead)", value); + error ("typedef %qD is initialized (use __typeof__ instead)", value); init = NULL_TREE; } @@ -868,8 +794,8 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, if (DECL_NAME (value) != NULL_TREE && IDENTIFIER_POINTER (DECL_NAME (value))[0] == '_' && ! strcmp (IDENTIFIER_POINTER (DECL_NAME (value)), "_vptr")) - error ("member `%D' conflicts with virtual function table field name", - value); + error ("member %qD conflicts with virtual function table field name", + value); /* Stash away type declarations. */ if (TREE_CODE (value) == TYPE_DECL) @@ -880,61 +806,69 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, if (processing_template_decl) value = push_template_decl (value); + if (attrlist) + { + /* Avoid storing attributes in template parameters: + tsubst is not ready to handle them. */ + tree type = TREE_TYPE (value); + if (TREE_CODE (type) == TEMPLATE_TYPE_PARM + || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM) + sorry ("applying attributes to template parameters is not implemented"); + else + cplus_decl_attributes (&value, attrlist, 0); + } + return value; } if (DECL_IN_AGGR_P (value)) { - error ("`%D' is already defined in `%T'", value, - DECL_CONTEXT (value)); + error ("%qD is already defined in %qT", value, DECL_CONTEXT (value)); return void_type_node; } - if (asmspec_tree) + if (asmspec_tree && asmspec_tree != error_mark_node) asmspec = TREE_STRING_POINTER (asmspec_tree); if (init) { if (TREE_CODE (value) == FUNCTION_DECL) { - grok_function_init (value, init); - init = NULL_TREE; + /* Initializers for functions are rejected early in the parser. + If we get here, it must be a pure specifier for a method. */ + if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE) + { + gcc_assert (error_operand_p (init) || integer_zerop (init)); + DECL_PURE_VIRTUAL_P (value) = 1; + } + else + { + gcc_assert (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE); + error ("initializer specified for static member function %qD", + value); + } } else if (pedantic && TREE_CODE (value) != VAR_DECL) /* Already complained in grokdeclarator. */ init = NULL_TREE; - else + else if (!processing_template_decl) { - /* We allow initializers to become parameters to base - initializers. */ - if (TREE_CODE (init) == TREE_LIST) - { - if (TREE_CHAIN (init) == NULL_TREE) - init = TREE_VALUE (init); - else - init = digest_init (TREE_TYPE (value), init, (tree *)0); - } + if (TREE_CODE (init) == CONSTRUCTOR) + init = digest_init (TREE_TYPE (value), init); + else + init = integral_constant_value (init); - if (!processing_template_decl) + if (init != error_mark_node && !TREE_CONSTANT (init)) { - if (TREE_CODE (init) == CONST_DECL) - init = DECL_INITIAL (init); - else if (TREE_READONLY_DECL_P (init)) - init = decl_constant_value (init); - else if (TREE_CODE (init) == CONSTRUCTOR) - init = digest_init (TREE_TYPE (value), init, (tree *)0); - if (init != error_mark_node && ! TREE_CONSTANT (init)) + /* We can allow references to things that are effectively + static, since references are initialized with the + address. */ + if (TREE_CODE (TREE_TYPE (value)) != REFERENCE_TYPE + || (TREE_STATIC (init) == 0 + && (!DECL_P (init) || DECL_EXTERNAL (init) == 0))) { - /* We can allow references to things that are effectively - static, since references are initialized with the - address. */ - if (TREE_CODE (TREE_TYPE (value)) != REFERENCE_TYPE - || (TREE_STATIC (init) == 0 - && (!DECL_P (init) || DECL_EXTERNAL (init) == 0))) - { - error ("field initializer is not constant"); - init = error_mark_node; - } + error ("field initializer is not constant"); + init = error_mark_node; } } } @@ -951,36 +885,32 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, if (attrlist) cplus_decl_attributes (&value, attrlist, 0); - if (TREE_CODE (value) == VAR_DECL) + switch (TREE_CODE (value)) { - finish_static_data_member_decl (value, init, asmspec_tree, - flags); + case VAR_DECL: + finish_static_data_member_decl (value, init, init_const_expr_p, + asmspec_tree, flags); return value; - } - if (TREE_CODE (value) == FIELD_DECL) - { + + case FIELD_DECL: if (asmspec) - error ("`asm' specifiers are not permitted on non-static data members"); + error ("% specifiers are not permitted on non-static data members"); if (DECL_INITIAL (value) == error_mark_node) init = error_mark_node; - cp_finish_decl (value, init, NULL_TREE, flags); + cp_finish_decl (value, init, /*init_const_expr_p=*/false, + NULL_TREE, flags); DECL_INITIAL (value) = init; DECL_IN_AGGR_P (value) = 1; return value; - } - if (TREE_CODE (value) == FUNCTION_DECL) - { + + case FUNCTION_DECL: if (asmspec) - { - /* This must override the asm specifier which was placed - by grokclassfn. Lay this out fresh. */ - SET_DECL_RTL (value, NULL_RTX); - change_decl_assembler_name (value, get_identifier (asmspec)); - } - if (!DECL_FRIEND_P (value)) - grok_special_member_properties (value); - - cp_finish_decl (value, init, asmspec_tree, flags); + set_user_assembler_name (value, asmspec); + + cp_finish_decl (value, + /*init=*/NULL_TREE, + /*init_const_expr_p=*/false, + asmspec_tree, flags); /* Pass friends back this way. */ if (DECL_FRIEND_P (value)) @@ -988,9 +918,10 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, DECL_IN_AGGR_P (value) = 1; return value; + + default: + gcc_unreachable (); } - abort (); - /* NOTREACHED */ return NULL_TREE; } @@ -998,19 +929,29 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree, WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */ tree -grokbitfield (tree declarator, tree declspecs, tree width) +grokbitfield (const cp_declarator *declarator, + cp_decl_specifier_seq *declspecs, tree width) { tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL); - if (! value) return NULL_TREE; /* friends went bad. */ + if (value == error_mark_node) + return NULL_TREE; /* friends went bad. */ /* Pass friendly classes back. */ if (TREE_CODE (value) == VOID_TYPE) return void_type_node; + if (!INTEGRAL_TYPE_P (TREE_TYPE (value)) + && (POINTER_TYPE_P (value) + || !dependent_type_p (TREE_TYPE (value)))) + { + error ("bit-field %qD with non-integral type", value); + return error_mark_node; + } + if (TREE_CODE (value) == TYPE_DECL) { - error ("cannot declare `%D' to be a bit-field type", value); + error ("cannot declare %qD to be a bit-field type", value); return NULL_TREE; } @@ -1020,24 +961,24 @@ grokbitfield (tree declarator, tree declspecs, tree width) check here. */ if (TREE_CODE (value) == FUNCTION_DECL) { - error ("cannot declare bit-field `%D' with function type", + error ("cannot declare bit-field %qD with function type", DECL_NAME (value)); return NULL_TREE; } if (DECL_IN_AGGR_P (value)) { - error ("`%D' is already defined in the class %T", value, - DECL_CONTEXT (value)); + error ("%qD is already defined in the class %qT", value, + DECL_CONTEXT (value)); return void_type_node; } if (TREE_STATIC (value)) { - error ("static member `%D' cannot be a bit-field", value); + error ("static member %qD cannot be a bit-field", value); return NULL_TREE; } - cp_finish_decl (value, NULL_TREE, NULL_TREE, 0); + finish_decl (value, NULL_TREE, NULL_TREE); if (width != error_mark_node) { @@ -1050,60 +991,12 @@ grokbitfield (tree declarator, tree declspecs, tree width) return value; } -/* When a function is declared with an initializer, - do the right thing. Currently, there are two possibilities: - - class B - { - public: - // initialization possibility #1. - virtual void f () = 0; - int g (); - }; - - class D1 : B - { - public: - int d1; - // error, no f (); - }; - - class D2 : B - { - public: - int d2; - void f (); - }; - - class D3 : B - { - public: - int d3; - // initialization possibility #2 - void f () = B::f; - }; - -*/ - -static void -grok_function_init (tree decl, tree init) -{ - /* An initializer for a function tells how this function should - be inherited. */ - tree type = TREE_TYPE (decl); - - if (TREE_CODE (type) == FUNCTION_TYPE) - error ("initializer specified for non-member function `%D'", decl); - else if (integer_zerop (init)) - DECL_PURE_VIRTUAL_P (decl) = 1; - else - error ("invalid initializer for virtual method `%D'", decl); -} void cplus_decl_attributes (tree *decl, tree attributes, int flags) { - if (*decl == NULL_TREE || *decl == void_type_node) + if (*decl == NULL_TREE || *decl == void_type_node + || *decl == error_mark_node) return; if (TREE_CODE (*decl) == TEMPLATE_DECL) @@ -1115,23 +1008,8 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags) SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl)); } -/* Defer the compilation of the FN until the end of compilation. */ - -void -defer_fn (tree fn) -{ - if (DECL_DEFERRED_FN (fn)) - return; - DECL_DEFERRED_FN (fn) = 1; - DECL_DEFER_OUTPUT (fn) = 1; - if (!deferred_fns) - VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns"); - - VARRAY_PUSH_TREE (deferred_fns, fn); -} - /* Walks through the namespace- or function-scope anonymous union - OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs. + OBJECT, with the indicated TYPE, building appropriate VAR_DECLs. Returns one of the fields for use in the mangled name. */ static tree @@ -1145,8 +1023,8 @@ build_anon_union_vars (tree type, tree object) if (TREE_CODE (type) != UNION_TYPE) error ("anonymous struct not inside named type"); - for (field = TYPE_FIELDS (type); - field != NULL_TREE; + for (field = TYPE_FIELDS (type); + field != NULL_TREE; field = TREE_CHAIN (field)) { tree decl; @@ -1156,30 +1034,37 @@ build_anon_union_vars (tree type, tree object) continue; if (TREE_CODE (field) != FIELD_DECL) { - cp_pedwarn_at ("\ -`%#D' invalid; an anonymous union can only have non-static data members", - field); + pedwarn ("%q+#D invalid; an anonymous union can only " + "have non-static data members", field); continue; } if (TREE_PRIVATE (field)) - cp_pedwarn_at ("private member `%#D' in anonymous union", field); + pedwarn ("private member %q+#D in anonymous union", field); else if (TREE_PROTECTED (field)) - cp_pedwarn_at ("protected member `%#D' in anonymous union", field); + pedwarn ("protected member %q+#D in anonymous union", field); if (processing_template_decl) - ref = build_min_nt (COMPONENT_REF, object, DECL_NAME (field)); + ref = build_min_nt (COMPONENT_REF, object, + DECL_NAME (field), NULL_TREE); else ref = build_class_member_access_expr (object, field, NULL_TREE, false); if (DECL_NAME (field)) { - decl = build_decl (ALIAS_DECL, DECL_NAME (field), TREE_TYPE (field)); - DECL_INITIAL (decl) = ref; - TREE_PUBLIC (decl) = 0; - TREE_STATIC (decl) = 0; - DECL_EXTERNAL (decl) = 1; + tree base; + + decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field)); + + base = get_base_address (object); + TREE_PUBLIC (decl) = TREE_PUBLIC (base); + TREE_STATIC (decl) = TREE_STATIC (base); + DECL_EXTERNAL (decl) = DECL_EXTERNAL (base); + + SET_DECL_VALUE_EXPR (decl, ref); + DECL_HAS_VALUE_EXPR_P (decl) = 1; + decl = pushdecl (decl); } else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))) @@ -1213,7 +1098,7 @@ finish_anon_union (tree anon_union_decl) /* The VAR_DECL's context is the same as the TYPE's context. */ DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type)); - + if (TYPE_FIELDS (type) == NULL_TREE) return; @@ -1224,9 +1109,11 @@ finish_anon_union (tree anon_union_decl) } main_decl = build_anon_union_vars (type, anon_union_decl); + if (main_decl == error_mark_node) + return; if (main_decl == NULL_TREE) { - warning ("anonymous union with no members"); + warning (0, "anonymous union with no members"); return; } @@ -1241,9 +1128,9 @@ finish_anon_union (tree anon_union_decl) pushdecl (anon_union_decl); if (building_stmt_tree () && at_function_scope_p ()) - add_decl_stmt (anon_union_decl); + add_decl_expr (anon_union_decl); else if (!processing_template_decl) - rest_of_decl_compilation (anon_union_decl, NULL, + rest_of_decl_compilation (anon_union_decl, toplevel_bindings_p (), at_eof); } @@ -1257,18 +1144,22 @@ coerce_new_type (tree type) int e = 0; tree args = TYPE_ARG_TYPES (type); - my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107); - + gcc_assert (TREE_CODE (type) == FUNCTION_TYPE); + if (!same_type_p (TREE_TYPE (type), ptr_type_node)) - e = 1, error ("`operator new' must return type `%T'", ptr_type_node); + { + e = 1; + error ("% must return type %qT", ptr_type_node); + } if (!args || args == void_list_node || !same_type_p (TREE_VALUE (args), size_type_node)) { e = 2; if (args && args != void_list_node) - args = TREE_CHAIN (args); - pedwarn ("`operator new' takes type `size_t' (`%T') as first parameter", size_type_node); + args = TREE_CHAIN (args); + pedwarn ("% takes type % (%qT) " + "as first parameter", size_type_node); } switch (e) { @@ -1277,8 +1168,8 @@ coerce_new_type (tree type) /* Fall through. */ case 1: type = build_exception_variant - (build_function_type (ptr_type_node, args), - TYPE_RAISES_EXCEPTIONS (type)); + (build_function_type (ptr_type_node, args), + TYPE_RAISES_EXCEPTIONS (type)); /* Fall through. */ default:; } @@ -1290,19 +1181,23 @@ coerce_delete_type (tree type) { int e = 0; tree args = TYPE_ARG_TYPES (type); - - my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107); + + gcc_assert (TREE_CODE (type) == FUNCTION_TYPE); if (!same_type_p (TREE_TYPE (type), void_type_node)) - e = 1, error ("`operator delete' must return type `%T'", void_type_node); + { + e = 1; + error ("% must return type %qT", void_type_node); + } if (!args || args == void_list_node || !same_type_p (TREE_VALUE (args), ptr_type_node)) { e = 2; if (args && args != void_list_node) - args = TREE_CHAIN (args); - error ("`operator delete' takes type `%T' as first parameter", ptr_type_node); + args = TREE_CHAIN (args); + error ("% takes type %qT as first parameter", + ptr_type_node); } switch (e) { @@ -1311,8 +1206,8 @@ coerce_delete_type (tree type) /* Fall through. */ case 1: type = build_exception_variant - (build_function_type (void_type_node, args), - TYPE_RAISES_EXCEPTIONS (type)); + (build_function_type (void_type_node, args), + TYPE_RAISES_EXCEPTIONS (type)); /* Fall through. */ default:; } @@ -1323,11 +1218,12 @@ coerce_delete_type (tree type) static void mark_vtable_entries (tree decl) { - tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl)); + tree fnaddr; + unsigned HOST_WIDE_INT idx; - for (; entries; entries = TREE_CHAIN (entries)) + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)), + idx, fnaddr) { - tree fnaddr = TREE_VALUE (entries); tree fn; STRIP_NOPS (fnaddr); @@ -1344,7 +1240,7 @@ mark_vtable_entries (tree decl) we output the vtables that contain them. With vcall offsets, we know all the thunks we'll need when we emit a virtual function, so we emit the thunks there instead. */ - if (DECL_THUNK_P (fn)) + if (DECL_THUNK_P (fn)) use_thunk (fn, /*emit_p=*/0); mark_used (fn); } @@ -1358,17 +1254,17 @@ comdat_linkage (tree decl) { if (flag_weak) make_decl_one_only (decl); - else if (TREE_CODE (decl) == FUNCTION_DECL + else if (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl))) /* We can just emit function and compiler-generated variables statically; having multiple copies is (for the most part) only - a waste of space. + a waste of space. There are two correctness issues, however: the address of a template instantiation with external linkage should be the same, independent of what translation unit asks for the address, and this will not hold when we emit multiple copies of - the function. However, there's little else we can do. + the function. However, there's little else we can do. Also, by default, the typeinfo implementation assumes that there will be only one copy of the string used as the name for @@ -1404,7 +1300,9 @@ comdat_linkage (tree decl) /* For win32 we also want to put explicit instantiations in linkonce sections, so that they will be merged with implicit - instantiations; otherwise we get duplicate symbol errors. */ + instantiations; otherwise we get duplicate symbol errors. + For Darwin we do not want explicit instantiations to be + linkonce. */ void maybe_make_one_only (tree decl) @@ -1418,62 +1316,22 @@ maybe_make_one_only (tree decl) if (! flag_weak) return; - /* We can't set DECL_COMDAT on functions, or finish_file will think + /* We can't set DECL_COMDAT on functions, or cp_finish_file will think we can get away with not emitting them if they aren't used. We need to for variables so that cp_finish_decl will update their linkage, because their DECL_INITIAL may not have been set properly yet. */ - make_decl_one_only (decl); - - if (TREE_CODE (decl) == VAR_DECL) + if (!TARGET_WEAK_NOT_IN_ARCHIVE_TOC + || (! DECL_EXPLICIT_INSTANTIATION (decl) + && ! DECL_TEMPLATE_SPECIALIZATION (decl))) { - DECL_COMDAT (decl) = 1; - /* Mark it needed so we don't forget to emit it. */ - mark_referenced (DECL_ASSEMBLER_NAME (decl)); - } -} + make_decl_one_only (decl); -/* Set TREE_PUBLIC and/or DECL_EXTERN on the vtable DECL, - based on TYPE and other static flags. - - Note that anything public is tagged TREE_PUBLIC, whether - it's public in this file or in another one. */ - -void -import_export_vtable (tree decl, tree type, int final) -{ - if (DECL_INTERFACE_KNOWN (decl)) - return; - - if (TYPE_FOR_JAVA (type)) - { - TREE_PUBLIC (decl) = 1; - DECL_EXTERNAL (decl) = 1; - DECL_INTERFACE_KNOWN (decl) = 1; - } - else if (CLASSTYPE_INTERFACE_KNOWN (type)) - { - TREE_PUBLIC (decl) = 1; - DECL_EXTERNAL (decl) = CLASSTYPE_INTERFACE_ONLY (type); - DECL_INTERFACE_KNOWN (decl) = 1; - } - else - { - /* We can only wait to decide if we have real non-inline virtual - functions in our class, or if we come from a template. */ - - int found = (CLASSTYPE_TEMPLATE_INSTANTIATION (type) - || CLASSTYPE_KEY_METHOD (type) != NULL_TREE); - - if (final || ! found) + if (TREE_CODE (decl) == VAR_DECL) { - comdat_linkage (decl); - DECL_EXTERNAL (decl) = 0; - } - else - { - TREE_PUBLIC (decl) = 1; - DECL_EXTERNAL (decl) = 1; + DECL_COMDAT (decl) = 1; + /* Mark it needed so we don't forget to emit it. */ + mark_decl_referenced (decl); } } } @@ -1492,12 +1350,12 @@ import_export_class (tree ctype) non-abstract virtual member function has been defined in this translation unit. But, we can't possibly know that until we've seen the entire translation unit. */ - my_friendly_assert (at_eof, 20000226); + gcc_assert (at_eof); if (CLASSTYPE_INTERFACE_KNOWN (ctype)) return; - /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma interface, + /* If MULTIPLE_SYMBOL_SPACES is set and we saw a #pragma interface, we will have CLASSTYPE_INTERFACE_ONLY set but not CLASSTYPE_INTERFACE_KNOWN. In that case, we don't want to use this heuristic because someone will supply a #pragma implementation @@ -1509,28 +1367,36 @@ import_export_class (tree ctype) import_export = -1; else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype))) import_export = 1; - - /* If we got -fno-implicit-templates, we import template classes that - weren't explicitly instantiated. */ - if (import_export == 0 - && CLASSTYPE_IMPLICIT_INSTANTIATION (ctype) - && ! flag_implicit_templates) - import_export = -1; - - /* Base our import/export status on that of the first non-inline, - non-pure virtual function, if any. */ - if (import_export == 0 - && TYPE_POLYMORPHIC_P (ctype)) + else if (CLASSTYPE_IMPLICIT_INSTANTIATION (ctype) + && !flag_implicit_templates) + /* For a template class, without -fimplicit-templates, check the + repository. If the virtual table is assigned to this + translation unit, then export the class; otherwise, import + it. */ + import_export = repo_export_class_p (ctype) ? 1 : -1; + else if (TYPE_POLYMORPHIC_P (ctype)) { + /* The ABI specifies that the virtual table and associated + information are emitted with the key method, if any. */ tree method = CLASSTYPE_KEY_METHOD (ctype); - if (method) + /* If weak symbol support is not available, then we must be + careful not to emit the vtable when the key function is + inline. An inline function can be defined in multiple + translation units. If we were to emit the vtable in each + translation unit containing a definition, we would get + multiple definition errors at link-time. */ + if (method && (flag_weak || ! DECL_DECLARED_INLINE_P (method))) import_export = (DECL_REALLY_EXTERN (method) ? -1 : 1); } -#ifdef MULTIPLE_SYMBOL_SPACES - if (import_export == -1) + /* When MULTIPLE_SYMBOL_SPACES is set, we cannot count on seeing + a definition anywhere else. */ + if (MULTIPLE_SYMBOL_SPACES && import_export == -1) import_export = 0; -#endif + + /* Allow backends the chance to overrule the decision. */ + if (targetm.cxx.import_export_class) + import_export = targetm.cxx.import_export_class (ctype, import_export); if (import_export) { @@ -1544,10 +1410,51 @@ import_export_class (tree ctype) static bool var_finalized_p (tree var) { - if (flag_unit_at_a_time) - return cgraph_varpool_node (var)->finalized; - else - return TREE_ASM_WRITTEN (var); + return cgraph_varpool_node (var)->finalized; +} + +/* DECL is a VAR_DECL or FUNCTION_DECL which, for whatever reason, + must be emitted in this translation unit. Mark it as such. */ + +void +mark_needed (tree decl) +{ + /* It's possible that we no longer need to set + TREE_SYMBOL_REFERENCED here directly, but doing so is + harmless. */ + TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) = 1; + mark_decl_referenced (decl); +} + +/* DECL is either a FUNCTION_DECL or a VAR_DECL. This function + returns true if a definition of this entity should be provided in + this object file. Callers use this function to determine whether + or not to let the back end know that a definition of DECL is + available in this translation unit. */ + +bool +decl_needed_p (tree decl) +{ + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL); + /* This function should only be called at the end of the translation + unit. We cannot be sure of whether or not something will be + COMDAT until that point. */ + gcc_assert (at_eof); + + /* All entities with external linkage that are not COMDAT should be + emitted; they may be referred to from other object files. */ + if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl)) + return true; + /* If this entity was used, let the back-end see it; it will decide + whether or not to emit it into the object file. */ + if (TREE_USED (decl) + || (DECL_ASSEMBLER_NAME_SET_P (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) + return true; + /* Otherwise, DECL does not need to be emitted -- yet. A subsequent + reference to DECL might cause it to be emitted later. */ + return false; } /* If necessary, write out the vtables for the dynamic class CTYPE. @@ -1558,7 +1465,7 @@ maybe_emit_vtables (tree ctype) { tree vtbl; tree primary_vtbl; - bool needed = false; + int needed = 0; /* If the vtables for this class have already been emitted there is nothing more to do. */ @@ -1569,79 +1476,48 @@ maybe_emit_vtables (tree ctype) if (TREE_TYPE (primary_vtbl) == void_type_node) return false; - import_export_class (ctype); + /* On some targets, we cannot determine the key method until the end + of the translation unit -- which is when this function is + called. */ + if (!targetm.cxx.key_method_may_be_inline ()) + determine_key_method (ctype); /* See if any of the vtables are needed. */ for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl)) { - import_export_vtable (vtbl, ctype, 1); - if (!DECL_EXTERNAL (vtbl) && DECL_NEEDED_P (vtbl)) - break; + import_export_decl (vtbl); + if (DECL_NOT_REALLY_EXTERN (vtbl) && decl_needed_p (vtbl)) + needed = 1; } - if (!vtbl) + if (!needed) { /* If the references to this class' vtables are optimized away, still emit the appropriate debugging information. See dfs_debug_mark. */ - if (DECL_COMDAT (primary_vtbl) + if (DECL_COMDAT (primary_vtbl) && CLASSTYPE_DEBUG_REQUESTED (ctype)) note_debug_info_needed (ctype); return false; } - else if (TREE_PUBLIC (vtbl) && !DECL_COMDAT (vtbl)) - needed = true; - /* The ABI requires that we emit all of the vtables if we emit any of them. */ for (vtbl = CLASSTYPE_VTABLES (ctype); vtbl; vtbl = TREE_CHAIN (vtbl)) { - /* Write it out. */ - import_export_vtable (vtbl, ctype, 1); + /* Mark entities references from the virtual table as used. */ mark_vtable_entries (vtbl); - /* If we know that DECL is needed, mark it as such for the varpool. */ - if (needed) - cgraph_varpool_mark_needed_node (cgraph_varpool_node (vtbl)); - if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0) { + tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl)); + /* It had better be all done at compile-time. */ - if (store_init_value (vtbl, DECL_INITIAL (vtbl))) - abort (); + gcc_assert (!expr); } - if (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG) - { - /* Mark the VAR_DECL node representing the vtable itself as a - "gratuitous" one, thereby forcing dwarfout.c to ignore it. - It is rather important that such things be ignored because - any effort to actually generate DWARF for them will run - into trouble when/if we encounter code like: - - #pragma interface - struct S { virtual void member (); }; - - because the artificial declaration of the vtable itself (as - manufactured by the g++ front end) will say that the vtable - is a static member of `S' but only *after* the debug output - for the definition of `S' has already been output. This causes - grief because the DWARF entry for the definition of the vtable - will try to refer back to an earlier *declaration* of the - vtable as a static member of `S' and there won't be one. - We might be able to arrange to have the "vtable static member" - attached to the member list for `S' before the debug info for - `S' get written (which would solve the problem) but that would - require more intrusive changes to the g++ front end. */ - - DECL_IGNORED_P (vtbl) = 1; - } - - /* Always make vtables weak. */ - if (flag_weak) - comdat_linkage (vtbl); - - rest_of_decl_compilation (vtbl, NULL, 1, 1); + /* Write it out. */ + DECL_EXTERNAL (vtbl) = 0; + rest_of_decl_compilation (vtbl, 1, 1); /* Because we're only doing syntax-checking, we'll never end up actually marking the variable as written. */ @@ -1656,38 +1532,586 @@ maybe_emit_vtables (tree ctype) return true; } -/* Determines the proper settings of TREE_PUBLIC and DECL_EXTERNAL for an - inline function or template instantiation at end-of-file. */ +/* A special return value from type_visibility meaning internal + linkage. */ + +enum { VISIBILITY_ANON = VISIBILITY_INTERNAL+1 }; + +/* walk_tree helper function for type_visibility. */ + +static tree +min_vis_r (tree *tp, int *walk_subtrees, void *data) +{ + int *vis_p = (int *)data; + if (! TYPE_P (*tp)) + { + *walk_subtrees = 0; + } + else if (CLASS_TYPE_P (*tp)) + { + if (!TREE_PUBLIC (TYPE_MAIN_DECL (*tp))) + { + *vis_p = VISIBILITY_ANON; + return *tp; + } + else if (CLASSTYPE_VISIBILITY (*tp) > *vis_p) + *vis_p = CLASSTYPE_VISIBILITY (*tp); + } + return NULL; +} + +/* Returns the visibility of TYPE, which is the minimum visibility of its + component types. */ + +static int +type_visibility (tree type) +{ + int vis = VISIBILITY_DEFAULT; + walk_tree_without_duplicates (&type, min_vis_r, &vis); + return vis; +} + +/* Limit the visibility of DECL to VISIBILITY, if not explicitly + specified (or if VISIBILITY is static). */ + +static bool +constrain_visibility (tree decl, int visibility) +{ + if (visibility == VISIBILITY_ANON) + { + /* extern "C" declarations aren't affected by the anonymous + namespace. */ + if (!DECL_EXTERN_C_P (decl)) + { + TREE_PUBLIC (decl) = 0; + DECL_INTERFACE_KNOWN (decl) = 1; + if (DECL_LANG_SPECIFIC (decl)) + DECL_NOT_REALLY_EXTERN (decl) = 1; + } + } + else if (visibility > DECL_VISIBILITY (decl) + && !DECL_VISIBILITY_SPECIFIED (decl)) + { + DECL_VISIBILITY (decl) = visibility; + return true; + } + return false; +} + +/* Constrain the visibility of DECL based on the visibility of its template + arguments. */ + +static void +constrain_visibility_for_template (tree decl, tree targs) +{ + /* If this is a template instantiation, check the innermost + template args for visibility constraints. The outer template + args are covered by the class check. */ + tree args = INNERMOST_TEMPLATE_ARGS (targs); + int i; + for (i = TREE_VEC_LENGTH (args); i > 0; --i) + { + int vis = 0; + + tree arg = TREE_VEC_ELT (args, i-1); + if (TYPE_P (arg)) + vis = type_visibility (arg); + else if (TREE_TYPE (arg) && POINTER_TYPE_P (TREE_TYPE (arg))) + { + STRIP_NOPS (arg); + if (TREE_CODE (arg) == ADDR_EXPR) + arg = TREE_OPERAND (arg, 0); + if (TREE_CODE (arg) == VAR_DECL + || TREE_CODE (arg) == FUNCTION_DECL) + { + if (! TREE_PUBLIC (arg)) + vis = VISIBILITY_ANON; + else + vis = DECL_VISIBILITY (arg); + } + } + if (vis) + constrain_visibility (decl, vis); + } +} + +/* Like c_determine_visibility, but with additional C++-specific + behavior. + + Function-scope entities can rely on the function's visibility because + it is set in start_preparsed_function. + + Class-scope entities cannot rely on the class's visibility until the end + of the enclosing class definition. + + Note that because namespaces have multiple independent definitions, + namespace visibility is handled elsewhere using the #pragma visibility + machinery rather than by decorating the namespace declaration. + + The goal is for constraints from the type to give a diagnostic, and + other constraints to be applied silently. */ + +void +determine_visibility (tree decl) +{ + tree class_type = NULL_TREE; + bool use_template; + + /* Remember that all decls get VISIBILITY_DEFAULT when built. */ + + /* Only relevant for names with external linkage. */ + if (!TREE_PUBLIC (decl)) + return; + + /* Cloned constructors and destructors get the same visibility as + the underlying function. That should be set up in + maybe_clone_body. */ + gcc_assert (!DECL_CLONED_FUNCTION_P (decl)); + + if (TREE_CODE (decl) == TYPE_DECL) + { + if (CLASS_TYPE_P (TREE_TYPE (decl))) + use_template = CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl)); + else if (TYPE_TEMPLATE_INFO (TREE_TYPE (decl))) + use_template = 1; + else + use_template = 0; + } + else if (DECL_LANG_SPECIFIC (decl)) + use_template = DECL_USE_TEMPLATE (decl); + else + use_template = 0; + + /* Anything that is exported must have default visibility. */ + if (TARGET_DLLIMPORT_DECL_ATTRIBUTES + && lookup_attribute ("dllexport", + TREE_CODE (decl) == TYPE_DECL + ? TYPE_ATTRIBUTES (TREE_TYPE (decl)) + : DECL_ATTRIBUTES (decl))) + { + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + } + + /* If DECL is a member of a class, visibility specifiers on the + class can influence the visibility of the DECL. */ + if (DECL_CLASS_SCOPE_P (decl)) + class_type = DECL_CONTEXT (decl); + else if (TREE_CODE (decl) == VAR_DECL + && DECL_TINFO_P (decl) + && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))) + class_type = TREE_TYPE (DECL_NAME (decl)); + else + { + /* Not a class member. */ + + /* Virtual tables have DECL_CONTEXT set to their associated class, + so they are automatically handled above. */ + gcc_assert (TREE_CODE (decl) != VAR_DECL + || !DECL_VTABLE_OR_VTT_P (decl)); + + if (DECL_FUNCTION_SCOPE_P (decl) && ! DECL_VISIBILITY_SPECIFIED (decl)) + { + /* Local statics and classes get the visibility of their + containing function by default, except that + -fvisibility-inlines-hidden doesn't affect them. */ + tree fn = DECL_CONTEXT (decl); + if (DECL_VISIBILITY_SPECIFIED (fn) || ! DECL_CLASS_SCOPE_P (fn)) + { + DECL_VISIBILITY (decl) = DECL_VISIBILITY (fn); + DECL_VISIBILITY_SPECIFIED (decl) = + DECL_VISIBILITY_SPECIFIED (fn); + } + else + determine_visibility_from_class (decl, DECL_CONTEXT (fn)); + + /* Local classes in templates have CLASSTYPE_USE_TEMPLATE set, + but have no TEMPLATE_INFO, so don't try to check it. */ + use_template = 0; + } + else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)) + { + /* tinfo visibility is based on the type it's for. */ + constrain_visibility + (decl, type_visibility (TREE_TYPE (DECL_NAME (decl)))); + } + else if (use_template) + /* Template instantiations and specializations get visibility based + on their template unless they override it with an attribute. */; + else if (! DECL_VISIBILITY_SPECIFIED (decl)) + { + /* Set default visibility to whatever the user supplied with + #pragma GCC visibility or a namespace visibility attribute. */ + DECL_VISIBILITY (decl) = default_visibility; + DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma; + } + } + + if (use_template) + { + /* If the specialization doesn't specify visibility, use the + visibility from the template. */ + tree tinfo = (TREE_CODE (decl) == TYPE_DECL + ? TYPE_TEMPLATE_INFO (TREE_TYPE (decl)) + : DECL_TEMPLATE_INFO (decl)); + tree args = TI_ARGS (tinfo); + + if (args != error_mark_node) + { + int depth = TMPL_ARGS_DEPTH (args); + tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo)); + + if (!DECL_VISIBILITY_SPECIFIED (decl)) + { + DECL_VISIBILITY (decl) = DECL_VISIBILITY (pattern); + DECL_VISIBILITY_SPECIFIED (decl) + = DECL_VISIBILITY_SPECIFIED (pattern); + } + + /* FIXME should TMPL_ARGS_DEPTH really return 1 for null input? */ + if (args && depth > template_class_depth (class_type)) + /* Limit visibility based on its template arguments. */ + constrain_visibility_for_template (decl, args); + } + } + + if (class_type) + determine_visibility_from_class (decl, class_type); + + if (decl_anon_ns_mem_p (decl)) + /* Names in an anonymous namespace get internal linkage. + This might change once we implement export. */ + constrain_visibility (decl, VISIBILITY_ANON); + else if (TREE_CODE (decl) != TYPE_DECL) + { + /* Propagate anonymity from type to decl. */ + int tvis = type_visibility (TREE_TYPE (decl)); + if (tvis == VISIBILITY_ANON) + constrain_visibility (decl, tvis); + } +} + +/* By default, static data members and function members receive + the visibility of their containing class. */ + +static void +determine_visibility_from_class (tree decl, tree class_type) +{ + if (visibility_options.inlines_hidden + /* Don't do this for inline templates; specializations might not be + inline, and we don't want them to inherit the hidden + visibility. We'll set it here for all inline instantiations. */ + && !processing_template_decl + && ! DECL_VISIBILITY_SPECIFIED (decl) + && TREE_CODE (decl) == FUNCTION_DECL + && DECL_DECLARED_INLINE_P (decl) + && (! DECL_LANG_SPECIFIC (decl) + || ! DECL_EXPLICIT_INSTANTIATION (decl))) + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + else if (!DECL_VISIBILITY_SPECIFIED (decl)) + { + /* Default to the class visibility. */ + DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); + DECL_VISIBILITY_SPECIFIED (decl) + = CLASSTYPE_VISIBILITY_SPECIFIED (class_type); + } + + /* Give the target a chance to override the visibility associated + with DECL. */ + if (TREE_CODE (decl) == VAR_DECL + && (DECL_TINFO_P (decl) + || (DECL_VTABLE_OR_VTT_P (decl) + /* Construction virtual tables are not exported because + they cannot be referred to from other object files; + their name is not standardized by the ABI. */ + && !DECL_CONSTRUCTION_VTABLE_P (decl))) + && TREE_PUBLIC (decl) + && !DECL_REALLY_EXTERN (decl) + && !DECL_VISIBILITY_SPECIFIED (decl) + && !CLASSTYPE_VISIBILITY_SPECIFIED (class_type)) + targetm.cxx.determine_class_data_visibility (decl); +} + +/* Constrain the visibility of a class TYPE based on the visibility of its + field types. Warn if any fields require lesser visibility. */ + +void +constrain_class_visibility (tree type) +{ + tree binfo; + tree t; + int i; + + int vis = type_visibility (type); + + if (vis == VISIBILITY_ANON + || DECL_IN_SYSTEM_HEADER (TYPE_MAIN_DECL (type))) + return; + + /* Don't warn about visibility if the class has explicit visibility. */ + if (CLASSTYPE_VISIBILITY_SPECIFIED (type)) + vis = VISIBILITY_INTERNAL; + + for (t = TYPE_FIELDS (type); t; t = TREE_CHAIN (t)) + if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node) + { + tree ftype = strip_array_types (TREE_TYPE (t)); + int subvis = type_visibility (ftype); + + if (subvis == VISIBILITY_ANON) + warning (0, "\ +%qT has a field %qD whose type uses the anonymous namespace", + type, t); + else if (IS_AGGR_TYPE (ftype) + && vis < VISIBILITY_HIDDEN + && subvis >= VISIBILITY_HIDDEN) + warning (OPT_Wattributes, "\ +%qT declared with greater visibility than the type of its field %qD", + type, t); + } + + binfo = TYPE_BINFO (type); + for (i = 0; BINFO_BASE_ITERATE (binfo, i, t); ++i) + { + int subvis = type_visibility (TREE_TYPE (t)); + + if (subvis == VISIBILITY_ANON) + warning (0, "\ +%qT has a base %qT whose type uses the anonymous namespace", + type, TREE_TYPE (t)); + else if (vis < VISIBILITY_HIDDEN + && subvis >= VISIBILITY_HIDDEN) + warning (OPT_Wattributes, "\ +%qT declared with greater visibility than its base %qT", + type, TREE_TYPE (t)); + } +} + +/* DECL is a FUNCTION_DECL or VAR_DECL. If the object file linkage + for DECL has not already been determined, do so now by setting + DECL_EXTERNAL, DECL_COMDAT and other related flags. Until this + function is called entities with vague linkage whose definitions + are available must have TREE_PUBLIC set. + + If this function decides to place DECL in COMDAT, it will set + appropriate flags -- but will not clear DECL_EXTERNAL. It is up to + the caller to decide whether or not to clear DECL_EXTERNAL. Some + callers defer that decision until it is clear that DECL is actually + required. */ void import_export_decl (tree decl) { + int emit_p; + bool comdat_p; + bool import_p; + tree class_type = NULL_TREE; + if (DECL_INTERFACE_KNOWN (decl)) return; - if (DECL_TEMPLATE_INSTANTIATION (decl) - || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)) + /* We cannot determine what linkage to give to an entity with vague + linkage until the end of the file. For example, a virtual table + for a class will be defined if and only if the key method is + defined in this translation unit. As a further example, consider + that when compiling a translation unit that uses PCH file with + "-frepo" it would be incorrect to make decisions about what + entities to emit when building the PCH; those decisions must be + delayed until the repository information has been processed. */ + gcc_assert (at_eof); + /* Object file linkage for explicit instantiations is handled in + mark_decl_instantiated. For static variables in functions with + vague linkage, maybe_commonize_var is used. + + Therefore, the only declarations that should be provided to this + function are those with external linkage that are: + + * implicit instantiations of function templates + + * inline function + + * implicit instantiations of static data members of class + templates + + * virtual tables + + * typeinfo objects + + Furthermore, all entities that reach this point must have a + definition available in this translation unit. + + The following assertions check these conditions. */ + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL + || TREE_CODE (decl) == VAR_DECL); + /* Any code that creates entities with TREE_PUBLIC cleared should + also set DECL_INTERFACE_KNOWN. */ + gcc_assert (TREE_PUBLIC (decl)); + if (TREE_CODE (decl) == FUNCTION_DECL) + gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl) + || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl) + || DECL_DECLARED_INLINE_P (decl)); + else + gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl) + || DECL_VTABLE_OR_VTT_P (decl) + || DECL_TINFO_P (decl)); + /* Check that a definition of DECL is available in this translation + unit. */ + gcc_assert (!DECL_REALLY_EXTERN (decl)); + + /* Assume that DECL will not have COMDAT linkage. */ + comdat_p = false; + /* Assume that DECL will not be imported into this translation + unit. */ + import_p = false; + + /* See if the repository tells us whether or not to emit DECL in + this translation unit. */ + emit_p = repo_emit_p (decl); + if (emit_p == 0) + import_p = true; + else if (emit_p == 1) { - DECL_NOT_REALLY_EXTERN (decl) = 1; - if ((DECL_IMPLICIT_INSTANTIATION (decl) - || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)) - && (flag_implicit_templates - || (flag_implicit_inline_templates - && TREE_CODE (decl) == FUNCTION_DECL - && DECL_DECLARED_INLINE_P (decl)))) + /* The repository indicates that this entity should be defined + here. Make sure the back end honors that request. */ + if (TREE_CODE (decl) == VAR_DECL) + mark_needed (decl); + else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl) + || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)) { - if (!TREE_PUBLIC (decl)) - /* Templates are allowed to have internal linkage. See - [basic.link]. */ - ; - else - comdat_linkage (decl); + tree clone; + FOR_EACH_CLONE (clone, decl) + mark_needed (clone); } else + mark_needed (decl); + /* Output the definition as an ordinary strong definition. */ + DECL_EXTERNAL (decl) = 0; + DECL_INTERFACE_KNOWN (decl) = 1; + return; + } + + if (import_p) + /* We have already decided what to do with this DECL; there is no + need to check anything further. */ + ; + else if (TREE_CODE (decl) == VAR_DECL && DECL_VTABLE_OR_VTT_P (decl)) + { + class_type = DECL_CONTEXT (decl); + import_export_class (class_type); + if (TYPE_FOR_JAVA (class_type)) + import_p = true; + else if (CLASSTYPE_INTERFACE_KNOWN (class_type) + && CLASSTYPE_INTERFACE_ONLY (class_type)) + import_p = true; + else if ((!flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC) + && !CLASSTYPE_USE_TEMPLATE (class_type) + && CLASSTYPE_KEY_METHOD (class_type) + && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))) + /* The ABI requires that all virtual tables be emitted with + COMDAT linkage. However, on systems where COMDAT symbols + don't show up in the table of contents for a static + archive, or on systems without weak symbols (where we + approximate COMDAT linkage by using internal linkage), the + linker will report errors about undefined symbols because + it will not see the virtual table definition. Therefore, + in the case that we know that the virtual table will be + emitted in only one translation unit, we make the virtual + table an ordinary definition with external linkage. */ + DECL_EXTERNAL (decl) = 0; + else if (CLASSTYPE_INTERFACE_KNOWN (class_type)) { - DECL_EXTERNAL (decl) = 1; - DECL_NOT_REALLY_EXTERN (decl) = 0; + /* CLASS_TYPE is being exported from this translation unit, + so DECL should be defined here. */ + if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)) + /* If a class is declared in a header with the "extern + template" extension, then it will not be instantiated, + even in translation units that would normally require + it. Often such classes are explicitly instantiated in + one translation unit. Therefore, the explicit + instantiation must be made visible to other translation + units. */ + DECL_EXTERNAL (decl) = 0; + else + { + /* The generic C++ ABI says that class data is always + COMDAT, even if there is a key function. Some + variants (e.g., the ARM EABI) says that class data + only has COMDAT linkage if the class data might be + emitted in more than one translation unit. When the + key method can be inline and is inline, we still have + to arrange for comdat even though + class_data_always_comdat is false. */ + if (!CLASSTYPE_KEY_METHOD (class_type) + || DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type)) + || targetm.cxx.class_data_always_comdat ()) + { + /* The ABI requires COMDAT linkage. Normally, we + only emit COMDAT things when they are needed; + make sure that we realize that this entity is + indeed needed. */ + comdat_p = true; + mark_needed (decl); + } + } } + else if (!flag_implicit_templates + && CLASSTYPE_IMPLICIT_INSTANTIATION (class_type)) + import_p = true; + else + comdat_p = true; + } + else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)) + { + tree type = TREE_TYPE (DECL_NAME (decl)); + if (CLASS_TYPE_P (type)) + { + class_type = type; + import_export_class (type); + if (CLASSTYPE_INTERFACE_KNOWN (type) + && TYPE_POLYMORPHIC_P (type) + && CLASSTYPE_INTERFACE_ONLY (type) + /* If -fno-rtti was specified, then we cannot be sure + that RTTI information will be emitted with the + virtual table of the class, so we must emit it + wherever it is used. */ + && flag_rtti) + import_p = true; + else + { + if (CLASSTYPE_INTERFACE_KNOWN (type) + && !CLASSTYPE_INTERFACE_ONLY (type)) + { + comdat_p = (targetm.cxx.class_data_always_comdat () + || (CLASSTYPE_KEY_METHOD (type) + && DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type)))); + mark_needed (decl); + if (!flag_weak) + { + comdat_p = false; + DECL_EXTERNAL (decl) = 0; + } + } + else + comdat_p = true; + } + } + else + comdat_p = true; + } + else if (DECL_TEMPLATE_INSTANTIATION (decl) + || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)) + { + /* DECL is an implicit instantiation of a function or static + data member. */ + if (flag_implicit_templates + || (flag_implicit_inline_templates + && TREE_CODE (decl) == FUNCTION_DECL + && DECL_DECLARED_INLINE_P (decl))) + comdat_p = true; + else + /* If we are not implicitly generating templates, then mark + this entity as undefined in this translation unit. */ + import_p = true; } else if (DECL_FUNCTION_MEMBER_P (decl)) { @@ -1699,7 +2123,7 @@ import_export_decl (tree decl) { DECL_NOT_REALLY_EXTERN (decl) = ! (CLASSTYPE_INTERFACE_ONLY (ctype) - || (DECL_DECLARED_INLINE_P (decl) + || (DECL_DECLARED_INLINE_P (decl) && ! flag_implement_inlines && !DECL_VINDEX (decl))); @@ -1708,55 +2132,31 @@ import_export_decl (tree decl) /* Always make artificials weak. */ if (DECL_ARTIFICIAL (decl) && flag_weak) - comdat_linkage (decl); + comdat_p = true; else maybe_make_one_only (decl); } } else - comdat_linkage (decl); + comdat_p = true; } else - comdat_linkage (decl); + comdat_p = true; - DECL_INTERFACE_KNOWN (decl) = 1; -} - -/* Here, we only decide whether or not the tinfo node should be - emitted with the vtable. IS_IN_LIBRARY is nonzero iff the - typeinfo for TYPE should be in the runtime library. */ - -void -import_export_tinfo (tree decl, tree type, bool is_in_library) -{ - if (DECL_INTERFACE_KNOWN (decl)) - return; - - if (IS_AGGR_TYPE (type)) - import_export_class (type); - - if (IS_AGGR_TYPE (type) && CLASSTYPE_INTERFACE_KNOWN (type) - && TYPE_POLYMORPHIC_P (type) - /* If -fno-rtti, we're not necessarily emitting this stuff with - the class, so go ahead and emit it now. This can happen when - a class is used in exception handling. */ - && flag_rtti) + if (import_p) { - DECL_NOT_REALLY_EXTERN (decl) = !CLASSTYPE_INTERFACE_ONLY (type); - DECL_COMDAT (decl) = 0; + /* If we are importing DECL into this translation unit, mark is + an undefined here. */ + DECL_EXTERNAL (decl) = 1; + DECL_NOT_REALLY_EXTERN (decl) = 0; } - else + else if (comdat_p) { - DECL_NOT_REALLY_EXTERN (decl) = 1; - DECL_COMDAT (decl) = 1; + /* If we decided to put DECL in COMDAT, mark it accordingly at + this point. */ + comdat_linkage (decl); } - /* Now override some cases. */ - if (flag_weak) - DECL_COMDAT (decl) = 1; - else if (is_in_library) - DECL_COMDAT (decl) = 0; - DECL_INTERFACE_KNOWN (decl) = 1; } @@ -1772,7 +2172,7 @@ build_cleanup (tree decl) /* This function should only be called for declarations that really require cleanups. */ - my_friendly_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type), 20030106); + gcc_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type)); /* Treat all objects with destructors as used; the destructor may do something substantive. */ @@ -1808,18 +2208,19 @@ get_guard (tree decl) /* We use a type that is big enough to contain a mutex as well as an integer counter. */ - guard_type = long_long_integer_type_node; + guard_type = targetm.cxx.guard_type (); guard = build_decl (VAR_DECL, sname, guard_type); - + /* The guard should have the same linkage as what it guards. */ TREE_PUBLIC (guard) = TREE_PUBLIC (decl); TREE_STATIC (guard) = TREE_STATIC (decl); DECL_COMMON (guard) = DECL_COMMON (decl); DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl); if (TREE_PUBLIC (decl)) - DECL_WEAK (guard) = DECL_WEAK (decl); - + DECL_WEAK (guard) = DECL_WEAK (decl); + DECL_ARTIFICIAL (guard) = 1; + DECL_IGNORED_P (guard) = 1; TREE_USED (guard) = 1; pushdecl_top_level_and_finish (guard, NULL_TREE); } @@ -1832,15 +2233,18 @@ get_guard (tree decl) static tree get_guard_bits (tree guard) { - /* We only set the first byte of the guard, in order to leave room - for a mutex in the high-order bits. */ - guard = build1 (ADDR_EXPR, - build_pointer_type (TREE_TYPE (guard)), - guard); - guard = build1 (NOP_EXPR, - build_pointer_type (char_type_node), - guard); - guard = build1 (INDIRECT_REF, char_type_node, guard); + if (!targetm.cxx.guard_mask_bit ()) + { + /* We only set the first byte of the guard, in order to leave room + for a mutex in the high-order bits. */ + guard = build1 (ADDR_EXPR, + build_pointer_type (TREE_TYPE (guard)), + guard); + guard = build1 (NOP_EXPR, + build_pointer_type (char_type_node), + guard); + guard = build1 (INDIRECT_REF, char_type_node, guard); + } return guard; } @@ -1855,6 +2259,16 @@ get_guard_cond (tree guard) /* Check to see if the GUARD is zero. */ guard = get_guard_bits (guard); + + /* Mask off all but the low bit. */ + if (targetm.cxx.guard_mask_bit ()) + { + guard_value = integer_one_node; + if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) + guard_value = convert (TREE_TYPE (guard), guard_value); + guard = cp_build_binary_op (BIT_AND_EXPR, guard, guard_value); + } + guard_value = integer_zero_node; if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))) guard_value = convert (TREE_TYPE (guard), guard_value); @@ -1883,8 +2297,8 @@ set_guard (tree guard) static tree start_objects (int method_type, int initp) { - tree fnname; tree body; + tree fndecl; char type[10]; /* Make ctor or dtor function. METHOD_TYPE may be 'I' or 'D'. */ @@ -1904,12 +2318,11 @@ start_objects (int method_type, int initp) else sprintf (type, "%c", method_type); - fnname = get_file_function_name_long (type); - - start_function (void_list_node, - make_call_declarator (fnname, void_list_node, NULL_TREE, - NULL_TREE), - NULL_TREE, SF_DEFAULT); + fndecl = build_lang_decl (FUNCTION_DECL, + get_file_function_name_long (type), + build_function_type (void_type_node, + void_list_node)); + start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED); /* It can be a static function as long as collect2 does not have to scan the object file to find its ctor/dtor routine. */ @@ -1925,14 +2338,14 @@ start_objects (int method_type, int initp) DECL_GLOBAL_DTOR_P (current_function_decl) = 1; DECL_LANG_SPECIFIC (current_function_decl)->decl_flags.u2sel = 1; - body = begin_compound_stmt (/*has_no_scope=*/false); + body = begin_compound_stmt (BCS_FN_BODY); /* We cannot allow these functions to be elided, even if they do not have external linkage. And, there's no point in deferring - compilation of thes functions; they're all going to have to be + compilation of these functions; they're all going to have to be out anyhow. */ - current_function_cannot_inline - = "static constructors and destructors cannot be inlined"; + DECL_INLINE (current_function_decl) = 0; + DECL_UNINLINABLE (current_function_decl) = 1; return body; } @@ -1959,6 +2372,7 @@ finish_objects (int method_type, int initp, tree body) if (targetm.have_ctors_dtors) { rtx fnsym = XEXP (DECL_RTL (fn), 0); + cgraph_mark_needed_node (cgraph_node (fn)); if (method_type == 'I') (* targetm.asm_out.constructor) (fnsym, initp); else @@ -1987,7 +2401,7 @@ static GTY(()) tree ssdf_decl; /* All the static storage duration functions created in this translation unit. */ -static GTY(()) varray_type ssdf_decls; +static GTY(()) VEC(tree,gc) *ssdf_decls; /* A map from priority levels to information about that priority level. There may be many such levels, so efficient lookup is @@ -2001,7 +2415,7 @@ static splay_tree priority_info_map; nonzero, it performs initializations. Otherwise, it performs destructions. It only performs those initializations or destructions with the indicated __PRIORITY. The generated function - returns no value. + returns no value. It is assumed that this function will only be called once per translation unit. */ @@ -2025,7 +2439,7 @@ start_static_storage_duration_function (unsigned count) type = build_function_type (void_type_node, parm_types); /* Create the FUNCTION_DECL itself. */ - ssdf_decl = build_lang_decl (FUNCTION_DECL, + ssdf_decl = build_lang_decl (FUNCTION_DECL, get_identifier (id), type); TREE_PUBLIC (ssdf_decl) = 0; @@ -2035,7 +2449,7 @@ start_static_storage_duration_function (unsigned count) static constructors and destructors. */ if (!ssdf_decls) { - VARRAY_TREE_INIT (ssdf_decls, 32, "ssdf_decls"); + ssdf_decls = VEC_alloc (tree, gc, 32); /* Take this opportunity to initialize the map from priority numbers to information about that priority level. */ @@ -2051,7 +2465,7 @@ start_static_storage_duration_function (unsigned count) get_priority_info (DEFAULT_INIT_PRIORITY); } - VARRAY_PUSH_TREE (ssdf_decls, ssdf_decl); + VEC_safe_push (tree, gc, ssdf_decls, ssdf_decl); /* Create the argument list. */ initialize_p_decl = cp_build_parm_decl @@ -2073,21 +2487,20 @@ start_static_storage_duration_function (unsigned count) function as: static void __ssdf (int __initialize_p, init __priority_p); - + It is static because we only need to call this function from the various constructor and destructor functions for this module. */ - start_function (/*specs=*/NULL_TREE, - ssdf_decl, - /*attrs=*/NULL_TREE, - SF_PRE_PARSED); + start_preparsed_function (ssdf_decl, + /*attrs=*/NULL_TREE, + SF_PRE_PARSED); /* Set up the scope of the outermost block in the function. */ - body = begin_compound_stmt (/*has_no_scope=*/false); + body = begin_compound_stmt (BCS_FN_BODY); /* This function must not be deferred because we are depending on its compilation to tell us what is TREE_SYMBOL_REFERENCED. */ - current_function_cannot_inline - = "static storage duration functions cannot be inlined"; + DECL_INLINE (ssdf_decl) = 0; + DECL_UNINLINABLE (ssdf_decl) = 1; return body; } @@ -2114,13 +2527,13 @@ get_priority_info (int priority) priority_info pi; splay_tree_node n; - n = splay_tree_lookup (priority_info_map, + n = splay_tree_lookup (priority_info_map, (splay_tree_key) priority); if (!n) { /* Create a new priority information structure, and insert it into the map. */ - pi = xmalloc (sizeof (struct priority_info_s)); + pi = XNEW (struct priority_info_s); pi->initializations_p = 0; pi->destructions_p = 0; splay_tree_insert (priority_info_map, @@ -2133,32 +2546,34 @@ get_priority_info (int priority) return pi; } +/* The effective initialization priority of a DECL. */ + +#define DECL_EFFECTIVE_INIT_PRIORITY(decl) \ + ((!DECL_HAS_INIT_PRIORITY_P (decl) || DECL_INIT_PRIORITY (decl) == 0) \ + ? DEFAULT_INIT_PRIORITY : DECL_INIT_PRIORITY (decl)) + +/* Whether a DECL needs a guard to protect it against multiple + initialization. */ + +#define NEEDS_GUARD_P(decl) (TREE_PUBLIC (decl) && (DECL_COMMON (decl) \ + || DECL_ONE_ONLY (decl) \ + || DECL_WEAK (decl))) + /* Set up to handle the initialization or destruction of DECL. If INITP is nonzero, we are initializing the variable. Otherwise, we are destroying it. */ -static tree -start_static_initialization_or_destruction (tree decl, int initp) +static void +one_static_initialization_or_destruction (tree decl, tree init, bool initp) { tree guard_if_stmt = NULL_TREE; - int priority; - tree cond; tree guard; - tree init_cond; - priority_info pi; - /* Figure out the priority for this declaration. */ - priority = DECL_INIT_PRIORITY (decl); - if (!priority) - priority = DEFAULT_INIT_PRIORITY; - - /* Remember that we had an initialization or finalization at this - priority. */ - pi = get_priority_info (priority); - if (initp) - pi->initializations_p = 1; - else - pi->destructions_p = 1; + /* If we are supposed to destruct and there's a trivial destructor, + nothing has to be done. */ + if (!initp + && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) + return; /* Trick the compiler into thinking we are at the file and line where DECL was declared so that error-messages make sense, and so @@ -2174,7 +2589,7 @@ start_static_initialization_or_destruction (tree decl, int initp) the conversion functions, or the destructor called to create and destroy a static data member is performed as if these calls appeared in the scope of the member's - class. + class. we pretend we are in a static member function of the class of which the DECL is a member. */ @@ -2183,18 +2598,6 @@ start_static_initialization_or_destruction (tree decl, int initp) DECL_CONTEXT (current_function_decl) = DECL_CONTEXT (decl); DECL_STATIC_FUNCTION_P (current_function_decl) = 1; } - - /* Conditionalize this initialization on being in the right priority - and being initializing/finalizing appropriately. */ - guard_if_stmt = begin_if_stmt (); - cond = cp_build_binary_op (EQ_EXPR, - priority_decl, - build_int_2 (priority, 0)); - init_cond = initp ? integer_one_node : integer_zero_node; - init_cond = cp_build_binary_op (EQ_EXPR, - initialize_p_decl, - init_cond); - cond = cp_build_binary_op (TRUTH_ANDIF_EXPR, cond, init_cond); /* Assume we don't need a guard. */ guard = NULL_TREE; @@ -2202,9 +2605,7 @@ start_static_initialization_or_destruction (tree decl, int initp) might be initialized in more than one place. (For example, a static data member of a template, when the data member requires construction.) */ - if (TREE_PUBLIC (decl) && (DECL_COMMON (decl) - || DECL_ONE_ONLY (decl) - || DECL_WEAK (decl))) + if (NEEDS_GUARD_P (decl)) { tree guard_cond; @@ -2216,7 +2617,7 @@ start_static_initialization_or_destruction (tree decl, int initp) { /* When using __cxa_atexit, we never try to destroy anything from a static destructor. */ - my_friendly_assert (initp, 20000629); + gcc_assert (initp); guard_cond = get_guard_cond (guard); } /* If we don't have __cxa_atexit, then we will be running @@ -2227,42 +2628,50 @@ start_static_initialization_or_destruction (tree decl, int initp) destructions only if the GUARD is one, i.e., if we are the last to destroy the variable. */ else if (initp) - guard_cond + guard_cond = cp_build_binary_op (EQ_EXPR, build_unary_op (PREINCREMENT_EXPR, guard, /*noconvert=*/1), integer_one_node); else - guard_cond + guard_cond = cp_build_binary_op (EQ_EXPR, build_unary_op (PREDECREMENT_EXPR, guard, /*noconvert=*/1), integer_zero_node); - cond = cp_build_binary_op (TRUTH_ANDIF_EXPR, cond, guard_cond); + guard_if_stmt = begin_if_stmt (); + finish_if_stmt_cond (guard_cond, guard_if_stmt); } - finish_if_stmt_cond (cond, guard_if_stmt); /* If we're using __cxa_atexit, we have not already set the GUARD, so we must do so now. */ if (guard && initp && flag_use_cxa_atexit) finish_expr_stmt (set_guard (guard)); - return guard_if_stmt; -} + /* Perform the initialization or destruction. */ + if (initp) + { + if (init) + finish_expr_stmt (init); -/* We've just finished generating code to do an initialization or - finalization. GUARD_IF_STMT is the if-statement we used to guard - the initialization. */ + /* If we're using __cxa_atexit, register a function that calls the + destructor for the object. */ + if (flag_use_cxa_atexit) + finish_expr_stmt (register_dtor_fn (decl)); + } + else + finish_expr_stmt (build_cleanup (decl)); -static void -finish_static_initialization_or_destruction (tree guard_if_stmt) -{ - finish_then_clause (guard_if_stmt); - finish_if_stmt (); + /* Finish the guard if-stmt, if necessary. */ + if (guard) + { + finish_then_clause (guard_if_stmt); + finish_if_stmt (guard_if_stmt); + } /* Now that we're done with DECL we don't need to pretend to be a member of its class any longer. */ @@ -2270,55 +2679,72 @@ finish_static_initialization_or_destruction (tree guard_if_stmt) DECL_STATIC_FUNCTION_P (current_function_decl) = 0; } -/* Generate code to do the initialization of DECL, a VAR_DECL with - static storage duration. The initialization is INIT. */ +/* Generate code to do the initialization or destruction of the decls in VARS, + a TREE_LIST of VAR_DECL with static storage duration. + Whether initialization or destruction is performed is specified by INITP. */ static void -do_static_initialization (tree decl, tree init) +do_static_initialization_or_destruction (tree vars, bool initp) { - tree guard_if_stmt; + tree node, init_if_stmt, cond; - /* Set up for the initialization. */ - guard_if_stmt - = start_static_initialization_or_destruction (decl, - /*initp=*/1); + /* Build the outer if-stmt to check for initialization or destruction. */ + init_if_stmt = begin_if_stmt (); + cond = initp ? integer_one_node : integer_zero_node; + cond = cp_build_binary_op (EQ_EXPR, + initialize_p_decl, + cond); + finish_if_stmt_cond (cond, init_if_stmt); - /* Perform the initialization. */ - if (init) - finish_expr_stmt (init); + node = vars; + do { + tree decl = TREE_VALUE (node); + tree priority_if_stmt; + int priority; + priority_info pi; - /* If we're using __cxa_atexit, register a a function that calls the - destructor for the object. */ - if (flag_use_cxa_atexit) - register_dtor_fn (decl); + /* If we don't need a destructor, there's nothing to do. Avoid + creating a possibly empty if-stmt. */ + if (!initp && TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) + { + node = TREE_CHAIN (node); + continue; + } - /* Finsh up. */ - finish_static_initialization_or_destruction (guard_if_stmt); -} + /* Remember that we had an initialization or finalization at this + priority. */ + priority = DECL_EFFECTIVE_INIT_PRIORITY (decl); + pi = get_priority_info (priority); + if (initp) + pi->initializations_p = 1; + else + pi->destructions_p = 1; -/* Generate code to do the static destruction of DECL. If DECL may be - initialized more than once in different object files, GUARD is the - guard variable to check. PRIORITY is the priority for the - destruction. */ + /* Conditionalize this initialization on being in the right priority + and being initializing/finalizing appropriately. */ + priority_if_stmt = begin_if_stmt (); + cond = cp_build_binary_op (EQ_EXPR, + priority_decl, + build_int_cst (NULL_TREE, priority)); + finish_if_stmt_cond (cond, priority_if_stmt); -static void -do_static_destruction (tree decl) -{ - tree guard_if_stmt; + /* Process initializers with same priority. */ + for (; node + && DECL_EFFECTIVE_INIT_PRIORITY (TREE_VALUE (node)) == priority; + node = TREE_CHAIN (node)) + /* Do one initialization or destruction. */ + one_static_initialization_or_destruction (TREE_VALUE (node), + TREE_PURPOSE (node), initp); - /* If we're using __cxa_atexit, then destructors are registered - immediately after objects are initialized. */ - my_friendly_assert (!flag_use_cxa_atexit, 20000121); + /* Finish up the priority if-stmt body. */ + finish_then_clause (priority_if_stmt); + finish_if_stmt (priority_if_stmt); - /* If we don't need a destructor, there's nothing to do. */ - if (TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) - return; + } while (node); - /* Actually do the destruction. */ - guard_if_stmt = start_static_initialization_or_destruction (decl, - /*initp=*/0); - finish_expr_stmt (build_cleanup (decl)); - finish_static_initialization_or_destruction (guard_if_stmt); + /* Finish up the init/destruct if-stmt body. */ + finish_then_clause (init_if_stmt); + finish_if_stmt (init_if_stmt); } /* VARS is a list of variables with static storage duration which may @@ -2349,7 +2775,7 @@ prune_vars_needing_no_initialization (tree *vars) } /* The only things that can be initialized are variables. */ - my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 19990420); + gcc_assert (TREE_CODE (decl) == VAR_DECL); /* If this object is not defined, we don't need to do anything here. */ @@ -2361,7 +2787,7 @@ prune_vars_needing_no_initialization (tree *vars) /* Also, if the initializer already contains errors, we can bail out now. */ - if (init && TREE_CODE (init) == TREE_LIST + if (init && TREE_CODE (init) == TREE_LIST && value_member (error_mark_node, init)) { var = &TREE_CHAIN (t); @@ -2387,8 +2813,14 @@ write_out_vars (tree vars) tree v; for (v = vars; v; v = TREE_CHAIN (v)) - if (!var_finalized_p (TREE_VALUE (v))) - rest_of_decl_compilation (TREE_VALUE (v), 0, 1, 1); + { + tree var = TREE_VALUE (v); + if (!var_finalized_p (var)) + { + import_export_decl (var); + rest_of_decl_compilation (var, 1, 1); + } + } } /* Generate a static constructor (if CONSTRUCTOR_P) or destructor @@ -2406,8 +2838,12 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, size_t i; input_location = *locus; +#ifdef USE_MAPPED_LOCATION + /* ??? */ +#else locus->line++; - +#endif + /* We use `I' to indicate initialization and `D' to indicate destruction. */ function_key = constructor_p ? 'I' : 'D'; @@ -2416,26 +2852,34 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, global constructors and destructors. */ body = NULL_TREE; + /* For Objective-C++, we may need to initialize metadata found in this module. + This must be done _before_ any other static initializations. */ + if (c_dialect_objc () && (priority == DEFAULT_INIT_PRIORITY) + && constructor_p && objc_static_init_needed_p ()) + { + body = start_objects (function_key, priority); + static_ctors = objc_generate_static_init_call (static_ctors); + } + /* Call the static storage duration function with appropriate arguments. */ - if (ssdf_decls) - for (i = 0; i < ssdf_decls->elements_used; ++i) - { - fndecl = VARRAY_TREE (ssdf_decls, i); + for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i) + { + /* Calls to pure or const functions will expand to nothing. */ + if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE))) + { + if (! body) + body = start_objects (function_key, priority); - /* Calls to pure or const functions will expand to nothing. */ - if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE))) - { - if (! body) - body = start_objects (function_key, priority); - - arguments = tree_cons (NULL_TREE, build_int_2 (priority, 0), - NULL_TREE); - arguments = tree_cons (NULL_TREE, build_int_2 (constructor_p, 0), - arguments); - finish_expr_stmt (build_function_call (fndecl, arguments)); - } - } + arguments = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, priority), + NULL_TREE); + arguments = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, constructor_p), + arguments); + finish_expr_stmt (build_function_call (fndecl, arguments)); + } + } /* If we're generating code for the DEFAULT_INIT_PRIORITY, throw in calls to any functions marked with attributes indicating that @@ -2444,7 +2888,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, { tree fns; - for (fns = constructor_p ? static_ctors : static_dtors; + for (fns = constructor_p ? static_ctors : static_dtors; fns; fns = TREE_CHAIN (fns)) { @@ -2471,7 +2915,7 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node n, void * data) { - location_t *locus = data; + location_t *locus = (location_t *) data; int priority = (int) n->key; priority_info pi = (priority_info) n->value; @@ -2500,38 +2944,99 @@ cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, { tree t = *tp; - if (flag_unit_at_a_time) - switch (TREE_CODE (t)) - { - case PTRMEM_CST: - if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t))) - cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (t))); - break; - case BASELINK: - if (TREE_CODE (BASELINK_FUNCTIONS (t)) == FUNCTION_DECL) - cgraph_mark_needed_node (cgraph_node (BASELINK_FUNCTIONS (t))); - break; - - default: - break; - } + switch (TREE_CODE (t)) + { + case PTRMEM_CST: + if (TYPE_PTRMEMFUNC_P (TREE_TYPE (t))) + cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (t))); + break; + case BASELINK: + if (TREE_CODE (BASELINK_FUNCTIONS (t)) == FUNCTION_DECL) + cgraph_mark_needed_node (cgraph_node (BASELINK_FUNCTIONS (t))); + break; + case VAR_DECL: + if (DECL_VTABLE_OR_VTT_P (t)) + { + /* The ABI requires that all virtual tables be emitted + whenever one of them is. */ + tree vtbl; + for (vtbl = CLASSTYPE_VTABLES (DECL_CONTEXT (t)); + vtbl; + vtbl = TREE_CHAIN (vtbl)) + mark_decl_referenced (vtbl); + } + else if (DECL_CONTEXT (t) + && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL) + /* If we need a static variable in a function, then we + need the containing function. */ + mark_decl_referenced (DECL_CONTEXT (t)); + break; + default: + break; + } return NULL; } +/* Java requires that we be able to reference a local address for a + method, and not be confused by PLT entries. If hidden aliases are + supported, emit one for each java function that we've emitted. */ + +static void +build_java_method_aliases (void) +{ + struct cgraph_node *node; + +#ifndef HAVE_GAS_HIDDEN + return; +#endif + + for (node = cgraph_nodes; node ; node = node->next) + { + tree fndecl = node->decl; + + if (TREE_ASM_WRITTEN (fndecl) + && DECL_CONTEXT (fndecl) + && TYPE_P (DECL_CONTEXT (fndecl)) + && TYPE_FOR_JAVA (DECL_CONTEXT (fndecl)) + && TARGET_USE_LOCAL_THUNK_ALIAS_P (fndecl)) + { + /* Mangle the name in a predictable way; we need to reference + this from a java compiled object file. */ + tree oid, nid, alias; + const char *oname; + char *nname; + + oid = DECL_ASSEMBLER_NAME (fndecl); + oname = IDENTIFIER_POINTER (oid); + gcc_assert (oname[0] == '_' && oname[1] == 'Z'); + nname = ACONCAT (("_ZGA", oname+2, NULL)); + nid = get_identifier (nname); + + alias = make_alias_for (fndecl, nid); + TREE_PUBLIC (alias) = 1; + DECL_VISIBILITY (alias) = VISIBILITY_HIDDEN; + + assemble_alias (alias, oid); + } + } +} + /* This routine is called from the last rule in yyparse (). Its job is to create all the code needed to initialize and destroy the global aggregates. We do the destruction first, since that way we only need to reverse the decls once. */ void -finish_file (void) +cp_finish_file (void) { tree vars; bool reconsider; size_t i; location_t locus; unsigned ssdf_count = 0; + int retries = 0; + tree decl; locus = input_location; at_eof = 1; @@ -2543,23 +3048,24 @@ finish_file (void) if (pch_file) c_common_write_pch (); +#ifdef USE_MAPPED_LOCATION + /* FIXME - huh? */ +#else /* Otherwise, GDB can get confused, because in only knows about source for LINENO-1 lines. */ input_line -= 1; - - interface_unknown = 1; - interface_only = 0; +#endif /* We now have to write out all the stuff we put off writing out. These include: o Template specializations that we have not yet instantiated, - but which are needed. + but which are needed. o Initialization and destruction for non-local objects with - static storage duration. (Local objects with static storage + static storage duration. (Local objects with static storage duration are initialized when their scope is first entered, and are cleaned up via atexit.) - o Virtual function tables. + o Virtual function tables. All of these may cause others to be needed. For example, instantiating one function may cause another to be needed, and @@ -2569,79 +3075,63 @@ finish_file (void) timevar_push (TV_VARCONST); emit_support_tinfos (); - - do + + do { tree t; - size_t n_old, n_new; + tree decl; reconsider = false; /* If there are templates that we've put off instantiating, do them now. */ - instantiate_pending_templates (); + instantiate_pending_templates (retries); ggc_collect (); /* Write out virtual tables as required. Note that writing out - the virtual table for a template class may cause the - instantiation of members of that class. If we write out - vtables then we remove the class from our list so we don't - have to look at it again. */ - + the virtual table for a template class may cause the + instantiation of members of that class. If we write out + vtables then we remove the class from our list so we don't + have to look at it again. */ + while (keyed_classes != NULL_TREE - && maybe_emit_vtables (TREE_VALUE (keyed_classes))) - { - reconsider = true; - keyed_classes = TREE_CHAIN (keyed_classes); - } - + && maybe_emit_vtables (TREE_VALUE (keyed_classes))) + { + reconsider = true; + keyed_classes = TREE_CHAIN (keyed_classes); + } + t = keyed_classes; if (t != NULL_TREE) - { - tree next = TREE_CHAIN (t); - - while (next) - { - if (maybe_emit_vtables (TREE_VALUE (next))) - { - reconsider = true; - TREE_CHAIN (t) = TREE_CHAIN (next); - } - else - t = next; - - next = TREE_CHAIN (t); - } - } - + { + tree next = TREE_CHAIN (t); + + while (next) + { + if (maybe_emit_vtables (TREE_VALUE (next))) + { + reconsider = true; + TREE_CHAIN (t) = TREE_CHAIN (next); + } + else + t = next; + + next = TREE_CHAIN (t); + } + } + /* Write out needed type info variables. We have to be careful - looping through unemitted decls, because emit_tinfo_decl may - cause other variables to be needed. We stick new elements - (and old elements that we may need to reconsider) at the end - of the array, then shift them back to the beginning once we're - done. */ - - n_old = VARRAY_ACTIVE_SIZE (unemitted_tinfo_decls); - for (i = 0; i < n_old; ++i) - { - tree tinfo_decl = VARRAY_TREE (unemitted_tinfo_decls, i); - if (emit_tinfo_decl (tinfo_decl)) - reconsider = true; - else - VARRAY_PUSH_TREE (unemitted_tinfo_decls, tinfo_decl); - } - - /* The only elements we want to keep are the new ones. Copy - them to the beginning of the array, then get rid of the - leftovers. */ - n_new = VARRAY_ACTIVE_SIZE (unemitted_tinfo_decls) - n_old; - if (n_new) - memmove (&VARRAY_TREE (unemitted_tinfo_decls, 0), - &VARRAY_TREE (unemitted_tinfo_decls, n_old), - n_new * sizeof (tree)); - memset (&VARRAY_TREE (unemitted_tinfo_decls, n_new), - 0, n_old * sizeof (tree)); - VARRAY_ACTIVE_SIZE (unemitted_tinfo_decls) = n_new; + looping through unemitted decls, because emit_tinfo_decl may + cause other variables to be needed. New elements will be + appended, and we remove from the vector those that actually + get emitted. */ + for (i = VEC_length (tree, unemitted_tinfo_decls); + VEC_iterate (tree, unemitted_tinfo_decls, --i, t);) + if (emit_tinfo_decl (t)) + { + reconsider = true; + VEC_unordered_remove (tree, unemitted_tinfo_decls, i); + } /* The list of objects with static storage duration is built up in reverse order. We clear STATIC_AGGREGATES so that any new @@ -2652,8 +3142,6 @@ finish_file (void) if (vars) { - tree v; - /* We need to start a new initialization function each time through the loop. That's because we need to know which vtables have been referenced, and TREE_SYMBOL_REFERENCED @@ -2672,9 +3160,8 @@ finish_file (void) write_out_vars (vars); /* First generate code to do all the initializations. */ - for (v = vars; v; v = TREE_CHAIN (v)) - do_static_initialization (TREE_VALUE (v), - TREE_PURPOSE (v)); + if (vars) + do_static_initialization_or_destruction (vars, /*initp=*/true); /* Then, generate code to do all the destructions. Do these in reverse order so that the most recently constructed @@ -2682,11 +3169,10 @@ finish_file (void) __cxa_atexit, then we don't need to do this; functions were registered at initialization time to destroy the local statics. */ - if (!flag_use_cxa_atexit) + if (!flag_use_cxa_atexit && vars) { vars = nreverse (vars); - for (v = vars; v; v = TREE_CHAIN (v)) - do_static_destruction (TREE_VALUE (v)); + do_static_initialization_or_destruction (vars, /*initp=*/false); } else vars = NULL_TREE; @@ -2701,16 +3187,20 @@ finish_file (void) instantiations, etc. */ reconsider = true; ssdf_count++; +#ifdef USE_MAPPED_LOCATION + /* ??? */ +#else locus.line++; +#endif } - - for (i = 0; i < deferred_fns_used; ++i) - { - tree decl = VARRAY_TREE (deferred_fns, i); + /* Go through the set of inline functions whose bodies have not + been emitted yet. If out-of-line copies of these functions + are required, emit them. */ + for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) + { /* Does it need synthesizing? */ if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl) - && TREE_USED (decl) && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl))) { /* Even though we're already at the top-level, we push @@ -2719,35 +3209,37 @@ finish_file (void) finish_function doesn't clean things up, and we end up with CURRENT_FUNCTION_DECL set. */ push_to_top_level (); + /* The decl's location will mark where it was first + needed. Save that so synthesize method can indicate + where it was needed from, in case of error */ + input_location = DECL_SOURCE_LOCATION (decl); synthesize_method (decl); pop_from_top_level (); reconsider = true; } - /* If the function has no body, avoid calling - import_export_decl. On a system without weak symbols, - calling import_export_decl will make an inline template - instantiation "static", which will result in errors about - the use of undefined functions if there is no body for - the function. */ if (!DECL_SAVED_TREE (decl)) continue; - import_export_decl (decl); - /* We lie to the back-end, pretending that some functions are not defined when they really are. This keeps these functions from being put out unnecessarily. But, we must stop lying when the functions are referenced, or if they - are not comdat since they need to be put out now. This - is done in a separate for cycle, because if some deferred - function is contained in another deferred function later - in deferred_fns varray, rest_of_compilation would skip - this function and we really cannot expand the same - function twice. */ + are not comdat since they need to be put out now. If + DECL_INTERFACE_KNOWN, then we have already set + DECL_EXTERNAL appropriately, so there's no need to check + again, and we do not want to clear DECL_EXTERNAL if a + previous call to import_export_decl set it. + + This is done in a separate for cycle, because if some + deferred function is contained in another deferred + function later in deferred_fns varray, + rest_of_compilation would skip this function and we + really cannot expand the same function twice. */ + import_export_decl (decl); if (DECL_NOT_REALLY_EXTERN (decl) && DECL_INITIAL (decl) - && DECL_NEEDED_P (decl)) + && decl_needed_p (decl)) DECL_EXTERNAL (decl) = 0; /* If we're going to need to write this function out, and @@ -2755,11 +3247,9 @@ finish_file (void) (There might be no body if this is a method we haven't gotten around to synthesizing yet.) */ if (!DECL_EXTERNAL (decl) - && DECL_NEEDED_P (decl) - && DECL_SAVED_TREE (decl) + && decl_needed_p (decl) && !TREE_ASM_WRITTEN (decl) - && (!flag_unit_at_a_time - || !cgraph_node (decl)->local.finalized)) + && !cgraph_node (decl)->local.finalized) { /* We will output the function; no longer consider it in this loop. */ @@ -2780,59 +3270,61 @@ finish_file (void) reconsider = true; /* Static data members are just like namespace-scope globals. */ - for (i = 0; i < pending_statics_used; ++i) + for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i) { - tree decl = VARRAY_TREE (pending_statics, i); - if (var_finalized_p (decl)) + if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)) continue; import_export_decl (decl); - if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl)) + /* If this static data member is needed, provide it to the + back end. */ + if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl)) DECL_EXTERNAL (decl) = 0; } - if (pending_statics - && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0), - pending_statics_used)) + if (VEC_length (tree, pending_statics) != 0 + && wrapup_global_declarations (VEC_address (tree, pending_statics), + VEC_length (tree, pending_statics))) reconsider = true; - if (cgraph_assemble_pending_functions ()) - reconsider = true; - } + retries++; + } while (reconsider); /* All used inline functions must have a definition at this point. */ - for (i = 0; i < deferred_fns_used; ++i) + for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { - tree decl = VARRAY_TREE (deferred_fns, i); - - if (TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl) - && !(TREE_ASM_WRITTEN (decl) || DECL_SAVED_TREE (decl) - /* An explicit instantiation can be used to specify - that the body is in another unit. It will have - already verified there was a definition. */ - || DECL_EXPLICIT_INSTANTIATION (decl))) + if (/* Check online inline functions that were actually used. */ + TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl) + /* If the definition actually was available here, then the + fact that the function was not defined merely represents + that for some reason (use of a template repository, + #pragma interface, etc.) we decided not to emit the + definition here. */ + && !DECL_INITIAL (decl) + /* An explicit instantiation can be used to specify + that the body is in another unit. It will have + already verified there was a definition. */ + && !DECL_EXPLICIT_INSTANTIATION (decl)) { - cp_warning_at ("inline function `%D' used but never defined", decl); - /* This symbol is effectively an "extern" declaration now. - This is not strictly necessary, but removes a duplicate - warning. */ - TREE_PUBLIC (decl) = 1; + warning (0, "inline function %q+D used but never defined", decl); + /* Avoid a duplicate warning from check_global_declaration_1. */ + TREE_NO_WARNING (decl) = 1; } - } - + /* We give C linkage to static constructors and destructors. */ push_lang_context (lang_name_c); /* Generate initialization and destruction functions for all priorities for which they are required. */ if (priority_info_map) - splay_tree_foreach (priority_info_map, + splay_tree_foreach (priority_info_map, generate_ctor_and_dtor_functions_for_priority, /*data=*/&locus); else { - - if (static_ctors) + /* If we have a ctor or this is obj-c++ and we need a static init, + call generate_ctor_or_dtor_function. */ + if (static_ctors || (c_dialect_objc () && objc_static_init_needed_p ())) generate_ctor_or_dtor_function (/*constructor_p=*/true, DEFAULT_INIT_PRIORITY, &locus); if (static_dtors) @@ -2844,22 +3336,29 @@ finish_file (void) if (priority_info_map) splay_tree_delete (priority_info_map); + /* Generate any missing aliases. */ + maybe_apply_pending_pragma_weaks (); + /* We're done with static constructors, so we can go back to "C++" linkage now. */ pop_lang_context (); - if (flag_unit_at_a_time) - { - cgraph_finalize_compilation_unit (); - cgraph_optimize (); - } + cgraph_finalize_compilation_unit (); + cgraph_optimize (); /* Now, issue warnings about static, but not defined, functions, etc., and emit debugging information. */ walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider); - if (pending_statics) - check_global_declarations (&VARRAY_TREE (pending_statics, 0), - pending_statics_used); + if (VEC_length (tree, pending_statics) != 0) + { + check_global_declarations (VEC_address (tree, pending_statics), + VEC_length (tree, pending_statics)); + emit_debug_global_declarations (VEC_address (tree, pending_statics), + VEC_length (tree, pending_statics)); + } + + /* Generate hidden aliases for Java. */ + build_java_method_aliases (); finish_repo (); @@ -2867,15 +3366,15 @@ finish_file (void) to a file. */ { int flags; - FILE *stream = dump_begin (TDI_all, &flags); + FILE *stream = dump_begin (TDI_tu, &flags); if (stream) { dump_node (global_namespace, flags & ~TDF_SLIM, stream); - dump_end (TDI_all, stream); + dump_end (TDI_tu, stream); } } - + timevar_pop (TV_VARCONST); if (flag_detailed_statistics) @@ -2884,6 +3383,10 @@ finish_file (void) dump_time_statistics (); } input_location = locus; + +#ifdef ENABLE_CHECKING + validate_conversion_obstack (); +#endif /* ENABLE_CHECKING */ } /* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the @@ -2905,12 +3408,11 @@ build_offset_ref_call_from_tree (tree fn, tree args) if (processing_template_decl) { - my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR - || TREE_CODE (fn) == MEMBER_REF, - 20030708); + gcc_assert (TREE_CODE (fn) == DOTSTAR_EXPR + || TREE_CODE (fn) == MEMBER_REF); if (type_dependent_expression_p (fn) || any_type_dependent_arguments_p (args)) - return build_min_nt (CALL_EXPR, fn, args); + return build_min_nt (CALL_EXPR, fn, args, NULL_TREE); /* Transform the arguments and add the implicit "this" parameter. That must be done before the FN is transformed @@ -2940,10 +3442,10 @@ build_offset_ref_call_from_tree (tree fn, tree args) expr = build_function_call (fn, args); if (processing_template_decl && expr != error_mark_node) - return build_min_non_dep (CALL_EXPR, expr, orig_fn, orig_args); + return build_min_non_dep (CALL_EXPR, expr, orig_fn, orig_args, NULL_TREE); return expr; } - + void check_default_args (tree x) @@ -2957,16 +3459,21 @@ check_default_args (tree x) saw_def = true; else if (saw_def) { - cp_error_at ("default argument missing for parameter %P of `%+#D'", - i, x); + error ("default argument missing for parameter %P of %q+#D", i, x); TREE_PURPOSE (arg) = error_mark_node; } } } +/* Mark DECL (either a _DECL or a BASELINK) as "used" in the program. + If DECL is a specialization or implicitly declared class member, + generate the actual definition. */ + void mark_used (tree decl) { + HOST_WIDE_INT saved_processing_template_decl = 0; + /* If DECL is a BASELINK for a single function, then treat it just like the DECL for the function. Otherwise, if the BASELINK is for an overloaded function, we don't know which function was @@ -2980,75 +3487,95 @@ mark_used (tree decl) } TREE_USED (decl) = 1; - if (processing_template_decl || skip_evaluation) + if (DECL_CLONED_FUNCTION_P (decl)) + TREE_USED (DECL_CLONED_FUNCTION (decl)) = 1; + /* If we don't need a value, then we don't need to synthesize DECL. */ + if (skip_evaluation) + return; + /* Normally, we can wait until instantiation-time to synthesize + DECL. However, if DECL is a static data member initialized with + a constant, we need the value right now because a reference to + such a data member is not value-dependent. */ + if (TREE_CODE (decl) == VAR_DECL + && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) + && DECL_CLASS_SCOPE_P (decl)) + { + /* Don't try to instantiate members of dependent types. We + cannot just use dependent_type_p here because this function + may be called from fold_non_dependent_expr, and then we may + see dependent types, even though processing_template_decl + will not be set. */ + if (CLASSTYPE_TEMPLATE_INFO ((DECL_CONTEXT (decl))) + && uses_template_parms (CLASSTYPE_TI_ARGS (DECL_CONTEXT (decl)))) + return; + /* Pretend that we are not in a template, even if we are, so + that the static data member initializer will be processed. */ + saved_processing_template_decl = processing_template_decl; + processing_template_decl = 0; + } + + if (processing_template_decl) return; if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl) && !TREE_ASM_WRITTEN (decl)) /* Remember it, so we can check it was defined. */ - defer_fn (decl); + { + if (DECL_DEFERRED_FN (decl)) + return; + + /* Remember the current location for a function we will end up + synthesizing. Then we can inform the user where it was + required in the case of error. */ + if (DECL_ARTIFICIAL (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) + && !DECL_THUNK_P (decl)) + DECL_SOURCE_LOCATION (decl) = input_location; + + note_vague_linkage_fn (decl); + } assemble_external (decl); /* Is it a synthesized method that needs to be synthesized? */ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl) - && DECL_ARTIFICIAL (decl) + && DECL_ARTIFICIAL (decl) && !DECL_THUNK_P (decl) && ! DECL_INITIAL (decl) - /* Kludge: don't synthesize for default args. */ + /* Kludge: don't synthesize for default args. Unfortunately this + rules out initializers of namespace-scoped objects too, but + it's sort-of ok if the implicit ctor or dtor decl keeps + pointing to the class location. */ && current_function_decl) { synthesize_method (decl); /* If we've already synthesized the method we don't need to - instantiate it, so we can return right away. */ - return; + do the instantiation test below. */ } + else if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL) + && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) + && (!DECL_EXPLICIT_INSTANTIATION (decl) + || (TREE_CODE (decl) == FUNCTION_DECL + && DECL_INLINE (DECL_TEMPLATE_RESULT + (template_for_substitution (decl)))) + /* We need to instantiate static data members so that there + initializers are available in integral constant + expressions. */ + || (TREE_CODE (decl) == VAR_DECL + && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)))) + /* If this is a function or variable that is an instance of some + template, we now know that we will need to actually do the + instantiation. We check that DECL is not an explicit + instantiation because that is not checked in instantiate_decl. - /* If this is a function or variable that is an instance of some - template, we now know that we will need to actually do the - instantiation. We check that DECL is not an explicit - instantiation because that is not checked in instantiate_decl. */ - if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL) - && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl) - && (!DECL_EXPLICIT_INSTANTIATION (decl) - || (TREE_CODE (decl) == FUNCTION_DECL - && DECL_INLINE (DECL_TEMPLATE_RESULT - (template_for_substitution (decl)))))) - { - bool defer; + We put off instantiating functions in order to improve compile + times. Maintaining a stack of active functions is expensive, + and the inliner knows to instantiate any functions it might + need. Therefore, we always try to defer instantiation. */ + instantiate_decl (decl, /*defer_ok=*/true, + /*expl_inst_class_mem_p=*/false); - /* Normally, we put off instantiating functions in order to - improve compile times. Maintaining a stack of active - functions is expensive, and the inliner knows to - instantiate any functions it might need. - - However, if instantiating this function might help us mark - the current function TREE_NOTHROW, we go ahead and - instantiate it now. - - This is not needed for unit-at-a-time since we reorder the functions - in topological order anyway. - */ - defer = (!flag_exceptions - || flag_unit_at_a_time - || !optimize - || TREE_CODE (decl) != FUNCTION_DECL - /* If the called function can't throw, we don't need to - generate its body to find that out. */ - || TREE_NOTHROW (decl) - || !cfun - || !current_function_decl - /* If we already know the current function can't throw, - then we don't need to work hard to prove it. */ - || TREE_NOTHROW (current_function_decl) - /* If we already know that the current function *can* - throw, there's no point in gathering more - information. */ - || cp_function_chain->can_throw); - - instantiate_decl (decl, defer); - } + processing_template_decl = saved_processing_template_decl; } #include "gt-cp-decl2.h" diff --git a/contrib/gcc/cp/dump.c b/contrib/gcc/cp/dump.c index 17b30c94367..c63cfe2bd89 100644 --- a/contrib/gcc/cp/dump.c +++ b/contrib/gcc/cp/dump.c @@ -1,5 +1,6 @@ /* Tree-dumping functionality for intermediate representation. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Mark Mitchell This file is part of GCC. @@ -16,8 +17,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -38,11 +39,11 @@ static void dump_access (dump_info_p di, tree t) { if (TREE_PROTECTED(t)) - dump_string (di, "protected"); + dump_string_field (di, "accs", "prot"); else if (TREE_PRIVATE(t)) - dump_string (di, "private"); + dump_string_field (di, "accs", "priv"); else - dump_string (di, "public"); + dump_string_field (di, "accs", "pub"); } /* Dump a representation of the specific operator for an overloaded @@ -64,7 +65,7 @@ dump_op (dump_info_p di, tree t) case VEC_DELETE_EXPR: dump_string (di, "vecdelete"); break; - case CONVERT_EXPR: + case UNARY_PLUS_EXPR: dump_string (di, "pos"); break; case NEGATE_EXPR: @@ -90,63 +91,63 @@ dump_op (dump_info_p di, tree t) break; case PLUS_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "plusassign"); + dump_string (di, "plusassign"); else - dump_string(di, "plus"); + dump_string(di, "plus"); break; case MINUS_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "minusassign"); + dump_string (di, "minusassign"); else - dump_string(di, "minus"); + dump_string(di, "minus"); break; case MULT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "multassign"); + dump_string (di, "multassign"); else - dump_string (di, "mult"); + dump_string (di, "mult"); break; case TRUNC_DIV_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "divassign"); + dump_string (di, "divassign"); else - dump_string (di, "div"); + dump_string (di, "div"); break; case TRUNC_MOD_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "modassign"); + dump_string (di, "modassign"); else - dump_string (di, "mod"); + dump_string (di, "mod"); break; case BIT_AND_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "andassign"); + dump_string (di, "andassign"); else - dump_string (di, "and"); + dump_string (di, "and"); break; case BIT_IOR_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "orassign"); + dump_string (di, "orassign"); else - dump_string (di, "or"); + dump_string (di, "or"); break; case BIT_XOR_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "xorassign"); + dump_string (di, "xorassign"); else - dump_string (di, "xor"); + dump_string (di, "xor"); break; case LSHIFT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "lshiftassign"); + dump_string (di, "lshiftassign"); else - dump_string (di, "lshift"); + dump_string (di, "lshift"); break; case RSHIFT_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "rshiftassign"); + dump_string (di, "rshiftassign"); else - dump_string (di, "rshift"); + dump_string (di, "rshift"); break; case EQ_EXPR: dump_string (di, "eq"); @@ -185,7 +186,7 @@ dump_op (dump_info_p di, tree t) dump_string (di, "subs"); break; case POSTINCREMENT_EXPR: - dump_string (di, "postinc"); + dump_string (di, "postinc"); break; case POSTDECREMENT_EXPR: dump_string (di, "postdec"); @@ -195,7 +196,7 @@ dump_op (dump_info_p di, tree t) break; case NOP_EXPR: if (DECL_ASSIGNMENT_OPERATOR_P (t)) - dump_string (di, "assign"); + dump_string (di, "assign"); break; default: break; @@ -214,7 +215,7 @@ cp_dump_tree (void* dump_info, tree t) if (DECL_P (t)) { if (DECL_LANG_SPECIFIC (t) && DECL_LANGUAGE (t) != lang_cplusplus) - dump_string (di, language_to_string (DECL_LANGUAGE (t))); + dump_string_field (di, "lang", language_to_string (DECL_LANGUAGE (t))); } switch (code) @@ -222,7 +223,7 @@ cp_dump_tree (void* dump_info, tree t) case IDENTIFIER_NODE: if (IDENTIFIER_OPNAME_P (t)) { - dump_string (di, "operator"); + dump_string_field (di, "note", "operator"); return true; } else if (IDENTIFIER_TYPENAME_P (t)) @@ -233,7 +234,7 @@ cp_dump_tree (void* dump_info, tree t) break; case OFFSET_TYPE: - dump_string (di, "ptrmem"); + dump_string_field (di, "note", "ptrmem"); dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t)); dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t)); return true; @@ -241,7 +242,7 @@ cp_dump_tree (void* dump_info, tree t) case RECORD_TYPE: if (TYPE_PTRMEMFUNC_P (t)) { - dump_string (di, "ptrmem"); + dump_string_field (di, "note", "ptrmem"); dump_child ("ptd", TYPE_PTRMEM_POINTED_TO_TYPE (t)); dump_child ("cls", TYPE_PTRMEM_CLASS_TYPE (t)); return true; @@ -256,24 +257,26 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("bfld", TYPE_CONTEXT (t)); return true; } - + if (! IS_AGGR_TYPE (t)) break; dump_child ("vfld", TYPE_VFIELD (t)); if (CLASSTYPE_TEMPLATE_SPECIALIZATION(t)) - dump_string(di, "spec"); + dump_string(di, "spec"); - if (!dump_flag (di, TDF_SLIM, t)) + if (!dump_flag (di, TDF_SLIM, t) && TYPE_BINFO (t)) { int i; - - for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i) + tree binfo; + tree base_binfo; + + for (binfo = TYPE_BINFO (t), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { - tree base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i); dump_child ("base", BINFO_TYPE (base_binfo)); - if (TREE_VIA_VIRTUAL (base_binfo)) - dump_string (di, "virtual"); + if (BINFO_VIRTUAL_P (base_binfo)) + dump_string_field (di, "spec", "virt"); dump_access (di, base_binfo); } } @@ -282,55 +285,55 @@ cp_dump_tree (void* dump_info, tree t) case FIELD_DECL: dump_access (di, t); if (DECL_MUTABLE_P (t)) - dump_string(di, "mutable"); + dump_string_field (di, "spec", "mutable"); break; case VAR_DECL: if (TREE_CODE (CP_DECL_CONTEXT (t)) == RECORD_TYPE) - dump_access (di, t); + dump_access (di, t); if (TREE_STATIC (t) && !TREE_PUBLIC (t)) - dump_string (di, "static"); - break; + dump_string_field (di, "link", "static"); + break; case FUNCTION_DECL: if (!DECL_THUNK_P (t)) { - if (DECL_OVERLOADED_OPERATOR_P (t)) { - dump_string (di, "operator"); - dump_op (di, t); - } - if (DECL_FUNCTION_MEMBER_P (t)) + if (DECL_OVERLOADED_OPERATOR_P (t)) { + dump_string_field (di, "note", "operator"); + dump_op (di, t); + } + if (DECL_FUNCTION_MEMBER_P (t)) { - dump_string (di, "member"); + dump_string_field (di, "note", "member"); dump_access (di, t); } - if (DECL_PURE_VIRTUAL_P (t)) - dump_string (di, "pure"); - if (DECL_VIRTUAL_P (t)) - dump_string (di, "virtual"); + if (DECL_PURE_VIRTUAL_P (t)) + dump_string_field (di, "spec", "pure"); + if (DECL_VIRTUAL_P (t)) + dump_string_field (di, "spec", "virt"); if (DECL_CONSTRUCTOR_P (t)) - dump_string (di, "constructor"); + dump_string_field (di, "note", "constructor"); if (DECL_DESTRUCTOR_P (t)) - dump_string (di, "destructor"); + dump_string_field (di, "note", "destructor"); if (DECL_CONV_FN_P (t)) - dump_string (di, "conversion"); + dump_string_field (di, "note", "conversion"); if (DECL_GLOBAL_CTOR_P (t)) - dump_string (di, "global init"); + dump_string_field (di, "note", "global init"); if (DECL_GLOBAL_DTOR_P (t)) - dump_string (di, "global fini"); + dump_string_field (di, "note", "global fini"); if (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)) - dump_string (di, "pseudo tmpl"); + dump_string_field (di, "note", "pseudo tmpl"); } else { tree virt = THUNK_VIRTUAL_OFFSET (t); - - dump_string (di, "thunk"); + + dump_string_field (di, "note", "thunk"); if (DECL_THIS_THUNK_P (t)) - dump_string (di, "this adjusting"); + dump_string_field (di, "note", "this adjusting"); else { - dump_string (di, "result adjusting"); + dump_string_field (di, "note", "result adjusting"); if (virt) virt = BINFO_VPTR_FIELD (virt); } @@ -363,17 +366,15 @@ cp_dump_tree (void* dump_info, tree t) case TRY_BLOCK: dump_stmt (di, t); if (CLEANUP_P (t)) - dump_string (di, "cleanup"); + dump_string_field (di, "note", "cleanup"); dump_child ("body", TRY_STMTS (t)); dump_child ("hdlr", TRY_HANDLERS (t)); - dump_next_stmt (di, t); break; case EH_SPEC_BLOCK: dump_stmt (di, t); dump_child ("body", EH_SPEC_STMTS (t)); dump_child ("raises", EH_SPEC_RAISES (t)); - dump_next_stmt (di, t); break; case PTRMEM_CST: @@ -392,26 +393,77 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("args", TREE_OPERAND (t, 1)); dump_child ("decl", TREE_OPERAND (t, 2)); break; - + case HANDLER: dump_stmt (di, t); dump_child ("parm", HANDLER_PARMS (t)); dump_child ("body", HANDLER_BODY (t)); - dump_next_stmt (di, t); break; case MUST_NOT_THROW_EXPR: dump_stmt (di, t); dump_child ("body", TREE_OPERAND (t, 0)); - dump_next_stmt (di, t); break; case USING_STMT: dump_stmt (di, t); dump_child ("nmsp", USING_STMT_NAMESPACE (t)); - dump_next_stmt (di, t); break; - + + case CLEANUP_STMT: + dump_stmt (di, t); + dump_child ("decl", CLEANUP_DECL (t)); + dump_child ("expr", CLEANUP_EXPR (t)); + dump_child ("body", CLEANUP_BODY (t)); + break; + + case IF_STMT: + dump_stmt (di, t); + dump_child ("cond", IF_COND (t)); + dump_child ("then", THEN_CLAUSE (t)); + dump_child ("else", ELSE_CLAUSE (t)); + break; + + case BREAK_STMT: + case CONTINUE_STMT: + dump_stmt (di, t); + break; + + case DO_STMT: + dump_stmt (di, t); + dump_child ("body", DO_BODY (t)); + dump_child ("cond", DO_COND (t)); + break; + + case FOR_STMT: + dump_stmt (di, t); + dump_child ("init", FOR_INIT_STMT (t)); + dump_child ("cond", FOR_COND (t)); + dump_child ("expr", FOR_EXPR (t)); + dump_child ("body", FOR_BODY (t)); + break; + + case SWITCH_STMT: + dump_stmt (di, t); + dump_child ("cond", SWITCH_STMT_COND (t)); + dump_child ("body", SWITCH_STMT_BODY (t)); + break; + + case WHILE_STMT: + dump_stmt (di, t); + dump_child ("cond", WHILE_COND (t)); + dump_child ("body", WHILE_BODY (t)); + break; + + case STMT_EXPR: + dump_child ("stmt", STMT_EXPR_STMT (t)); + break; + + case EXPR_STMT: + dump_stmt (di, t); + dump_child ("expr", EXPR_STMT_EXPR (t)); + break; + default: break; } diff --git a/contrib/gcc/cp/error.c b/contrib/gcc/cp/error.c index 381b5bec666..2962fe655f6 100644 --- a/contrib/gcc/cp/error.c +++ b/contrib/gcc/cp/error.c @@ -1,7 +1,7 @@ /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, - 2003 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify @@ -16,8 +16,8 @@ GNU General Public License for more details. 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. */ +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" @@ -32,13 +32,7 @@ Boston, MA 02111-1307, USA. */ #include "langhooks-def.h" #include "cxx-pretty-print.h" -enum pad { none, before, after }; - -#define pp_template_argument_list_start(PP) \ - pp_non_consecutive_character (PP, '<') -#define pp_template_argument_list_end(PP) \ - pp_non_consecutive_character (PP, '>') -#define pp_separate_with_comma(PP) pp_string (PP, ", ") +#define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',') /* The global buffer where we dump everything. It is there only for transitional purpose. It is expected, in the near future, to be @@ -48,9 +42,6 @@ static cxx_pretty_printer scratch_pretty_printer; # define NEXT_CODE(T) (TREE_CODE (TREE_TYPE (T))) -#define reinit_global_formatting_buffer() \ - output_clear_message_text (scratch_buffer) - static const char *args_to_string (tree, int); static const char *assop_to_string (enum tree_code); static const char *code_to_string (enum tree_code); @@ -72,15 +63,13 @@ static void dump_expr (tree, int); static void dump_unary_op (const char *, tree, int); static void dump_binary_op (const char *, tree, int); static void dump_aggr_type (tree, int); -static enum pad dump_type_prefix (tree, int); +static void dump_type_prefix (tree, int); static void dump_type_suffix (tree, int); static void dump_function_name (tree, int); static void dump_expr_list (tree, int); static void dump_global_iord (tree); -static enum pad dump_qualifiers (tree, enum pad); static void dump_parameters (tree, int); static void dump_exception_spec (tree, int); -static const char *class_key_or_enum (tree); static void dump_template_argument (tree, int); static void dump_template_argument_list (tree, int); static void dump_template_parameter (tree, int); @@ -92,14 +81,13 @@ static const char *function_category (tree); static void maybe_print_instantiation_context (diagnostic_context *); static void print_instantiation_full_context (diagnostic_context *); static void print_instantiation_partial_context (diagnostic_context *, - tree, location_t); + tree, location_t); static void cp_diagnostic_starter (diagnostic_context *, diagnostic_info *); static void cp_diagnostic_finalizer (diagnostic_context *, diagnostic_info *); static void cp_print_error_function (diagnostic_context *, diagnostic_info *); -static bool cp_printer (pretty_printer *, text_info *); -static void pp_non_consecutive_character (cxx_pretty_printer *, int); -static tree locate_error (const char *, va_list); +static bool cp_printer (pretty_printer *, text_info *, const char *, + int, bool, bool, bool); static location_t location_of (tree); void @@ -126,55 +114,23 @@ dump_scope (tree scope, int flags) if (TREE_CODE (scope) == NAMESPACE_DECL) { if (scope != global_namespace) - { - dump_decl (scope, f); - pp_colon_colon (cxx_pp); - } + { + dump_decl (scope, f); + pp_cxx_colon_colon (cxx_pp); + } } else if (AGGREGATE_TYPE_P (scope)) { dump_type (scope, f); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } else if ((flags & TFF_SCOPE) && TREE_CODE (scope) == FUNCTION_DECL) { dump_function_decl (scope, f); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } } -/* Dump type qualifiers, providing padding as requested. Return an - indication of whether we dumped something. */ - -static enum pad -dump_qualifiers (tree t, enum pad p) -{ - static const int masks[] = - {TYPE_QUAL_CONST, TYPE_QUAL_VOLATILE, TYPE_QUAL_RESTRICT}; - static const char *const names[] = - {"const", "volatile", "__restrict"}; - int ix; - int quals = TYPE_QUALS (t); - int do_after = p == after; - - if (quals) - { - for (ix = 0; ix != 3; ix++) - if (masks[ix] & quals) - { - if (p == before) - pp_space (cxx_pp); - p = before; - pp_identifier (cxx_pp, names[ix]); - } - if (do_after) - pp_space (cxx_pp); - } - else - p = none; - return p; -} - /* Dump the template ARGument under control of FLAGS. */ static void @@ -199,7 +155,7 @@ dump_template_argument_list (tree args, int flags) for (i = 0; i< n; ++i) { if (need_comma) - pp_separate_with_comma (cxx_pp); + pp_separate_with_comma (cxx_pp); dump_template_argument (TREE_VEC_ELT (args, i), flags); need_comma = 1; } @@ -210,35 +166,40 @@ dump_template_argument_list (tree args, int flags) static void dump_template_parameter (tree parm, int flags) { - tree p = TREE_VALUE (parm); - tree a = TREE_PURPOSE (parm); + tree p; + tree a; + + if (parm == error_mark_node) + return; + + p = TREE_VALUE (parm); + a = TREE_PURPOSE (parm); if (TREE_CODE (p) == TYPE_DECL) { if (flags & TFF_DECL_SPECIFIERS) - { - pp_identifier (cxx_pp, "class"); - if (DECL_NAME (p)) - { - pp_space (cxx_pp); - pp_tree_identifier (cxx_pp, DECL_NAME (p)); - } - } + { + pp_cxx_identifier (cxx_pp, "class"); + if (DECL_NAME (p)) + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); + } else if (DECL_NAME (p)) - pp_tree_identifier (cxx_pp, DECL_NAME (p)); + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p)); else - pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p)); + pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p)); } else dump_decl (p, flags | TFF_DECL_SPECIFIERS); if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && a != NULL_TREE) { - pp_string (cxx_pp, " = "); + pp_cxx_whitespace (cxx_pp); + pp_equal (cxx_pp); + pp_cxx_whitespace (cxx_pp); if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL) - dump_type (a, flags & ~TFF_CHASE_TYPEDEF); + dump_type (a, flags & ~TFF_CHASE_TYPEDEF); else - dump_expr (a, flags | TFF_EXPR_IN_PARENS); + dump_expr (a, flags | TFF_EXPR_IN_PARENS); } } @@ -273,7 +234,9 @@ dump_template_bindings (tree parms, tree args) if (need_comma) pp_separate_with_comma (cxx_pp); dump_template_parameter (TREE_VEC_ELT (p, i), TFF_PLAIN_IDENTIFIER); - pp_string (cxx_pp, " = "); + pp_cxx_whitespace (cxx_pp); + pp_equal (cxx_pp); + pp_cxx_whitespace (cxx_pp); if (arg) dump_template_argument (arg, TFF_PLAIN_IDENTIFIER); else @@ -302,7 +265,7 @@ dump_type (tree t, int flags) switch (TREE_CODE (t)) { case UNKNOWN_TYPE: - pp_identifier (cxx_pp, ""); + pp_identifier (cxx_pp, ""); break; case TREE_LIST: @@ -311,10 +274,10 @@ dump_type (tree t, int flags) break; case IDENTIFIER_NODE: - pp_tree_identifier (cxx_pp, t); + pp_cxx_tree_identifier (cxx_pp, t); break; - case TREE_VEC: + case TREE_BINFO: dump_type (BINFO_TYPE (t), flags); break; @@ -326,11 +289,11 @@ dump_type (tree t, int flags) case TYPE_DECL: if (flags & TFF_CHASE_TYPEDEF) - { - dump_type (DECL_ORIGINAL_TYPE (t) - ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); - break; - } + { + dump_type (DECL_ORIGINAL_TYPE (t) + ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags); + break; + } /* Else fall through. */ case TEMPLATE_DECL: @@ -344,36 +307,35 @@ dump_type (tree t, int flags) case BOOLEAN_TYPE: case COMPLEX_TYPE: case VECTOR_TYPE: - pp_base (cxx_pp)->padding = pp_none; pp_type_specifier_seq (cxx_pp, t); break; case TEMPLATE_TEMPLATE_PARM: /* For parameters inside template signature. */ if (TYPE_IDENTIFIER (t)) - pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); + pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); else - pp_cxx_canonical_template_parameter (cxx_pp, t); + pp_cxx_canonical_template_parameter (cxx_pp, t); break; case BOUND_TEMPLATE_TEMPLATE_PARM: { tree args = TYPE_TI_ARGS (t); - dump_qualifiers (t, after); - pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); - pp_template_argument_list_start (cxx_pp); - dump_template_argument_list (args, flags); - pp_template_argument_list_end (cxx_pp); + pp_cxx_cv_qualifier_seq (cxx_pp, t); + pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); + pp_cxx_begin_template_argument_list (cxx_pp); + dump_template_argument_list (args, flags); + pp_cxx_end_template_argument_list (cxx_pp); } break; case TEMPLATE_TYPE_PARM: - dump_qualifiers (t, after); + pp_cxx_cv_qualifier_seq (cxx_pp, t); if (TYPE_IDENTIFIER (t)) - pp_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); + pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t)); else - pp_cxx_canonical_template_parameter - (cxx_pp, TEMPLATE_TYPE_PARM_INDEX (t)); + pp_cxx_canonical_template_parameter + (cxx_pp, TEMPLATE_TYPE_PARM_INDEX (t)); break; /* This is not always necessary for pointers and such, but doing this @@ -391,22 +353,27 @@ dump_type (tree t, int flags) break; } case TYPENAME_TYPE: - dump_qualifiers (t, after); - pp_string (cxx_pp, "typename "); + pp_cxx_cv_qualifier_seq (cxx_pp, t); + pp_cxx_identifier (cxx_pp, + TYPENAME_IS_ENUM_P (t) ? "enum" + : TYPENAME_IS_CLASS_P (t) ? "class" + : "typename"); dump_typename (t, flags); break; case UNBOUND_CLASS_TEMPLATE: dump_type (TYPE_CONTEXT (t), flags); - pp_colon_colon (cxx_pp); - pp_identifier (cxx_pp, "template "); + pp_cxx_colon_colon (cxx_pp); + pp_cxx_identifier (cxx_pp, "template"); dump_type (DECL_NAME (TYPE_NAME (t)), flags); break; case TYPEOF_TYPE: - pp_string (cxx_pp, "__typeof ("); - dump_expr (TYPE_FIELDS (t), flags & ~TFF_EXPR_IN_PARENS); - pp_right_paren (cxx_pp); + pp_cxx_identifier (cxx_pp, "__typeof__"); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_paren (cxx_pp); + dump_expr (TYPEOF_TYPE_EXPR (t), flags & ~TFF_EXPR_IN_PARENS); + pp_cxx_right_paren (cxx_pp); break; default: @@ -431,14 +398,14 @@ dump_typename (tree t, int flags) dump_typename (ctx, flags); else dump_type (ctx, flags & ~TFF_CLASS_KEY_OR_ENUM); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); dump_decl (TYPENAME_TYPE_FULLNAME (t), flags); } /* Return the name of the supplied aggregate, or enumeral type. */ -static const char * -class_key_or_enum (tree t) +const char * +class_key_or_enum_as_string (tree t) { if (TREE_CODE (t) == ENUMERAL_TYPE) return "enum"; @@ -457,17 +424,14 @@ static void dump_aggr_type (tree t, int flags) { tree name; - const char *variety = class_key_or_enum (t); + const char *variety = class_key_or_enum_as_string (t); int typdef = 0; int tmplate = 0; - dump_qualifiers (t, after); + pp_cxx_cv_qualifier_seq (cxx_pp, t); if (flags & TFF_CLASS_KEY_OR_ENUM) - { - pp_identifier (cxx_pp, variety); - pp_space (cxx_pp); - } + pp_cxx_identifier (cxx_pp, variety); if (flags & TFF_CHASE_TYPEDEF) t = TYPE_MAIN_VARIANT (t); @@ -478,38 +442,36 @@ dump_aggr_type (tree t, int flags) { typdef = !DECL_ARTIFICIAL (name); tmplate = !typdef && TREE_CODE (t) != ENUMERAL_TYPE - && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) - && (CLASSTYPE_TEMPLATE_SPECIALIZATION (t) - || TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL - || DECL_TEMPLATE_SPECIALIZATION (CLASSTYPE_TI_TEMPLATE (t)) - || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); + && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) + && (TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL + || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); dump_scope (CP_DECL_CONTEXT (name), flags | TFF_SCOPE); if (tmplate) - { - /* Because the template names are mangled, we have to locate - the most general template, and use that name. */ - tree tpl = CLASSTYPE_TI_TEMPLATE (t); + { + /* Because the template names are mangled, we have to locate + the most general template, and use that name. */ + tree tpl = CLASSTYPE_TI_TEMPLATE (t); - while (DECL_TEMPLATE_INFO (tpl)) - tpl = DECL_TI_TEMPLATE (tpl); - name = tpl; - } + while (DECL_TEMPLATE_INFO (tpl)) + tpl = DECL_TI_TEMPLATE (tpl); + name = tpl; + } name = DECL_NAME (name); } if (name == 0 || ANON_AGGRNAME_P (name)) { if (flags & TFF_CLASS_KEY_OR_ENUM) - pp_identifier (cxx_pp, ""); + pp_identifier (cxx_pp, ""); else - pp_printf (pp_base (cxx_pp), "", variety); + pp_printf (pp_base (cxx_pp), "", variety); } else - pp_tree_identifier (cxx_pp, name); + pp_cxx_tree_identifier (cxx_pp, name); if (tmplate) dump_template_parms (TYPE_TEMPLATE_INFO (t), - !CLASSTYPE_USE_TEMPLATE (t), - flags & ~TFF_TEMPLATE_HEADER); + !CLASSTYPE_USE_TEMPLATE (t), + flags & ~TFF_TEMPLATE_HEADER); } /* Dump into the obstack the initial part of the output for a given type. @@ -521,16 +483,11 @@ dump_aggr_type (tree t, int flags) deal with prefix and suffix. Arrays must also do this for DECL nodes, like int a[], and for things like - int *[]&. + int *[]&. */ - Return indicates how you should pad an object name after this. I.e. you - want to pad non-*, non-& cores, but not pad * or & types. */ - -static enum pad +static void dump_type_prefix (tree t, int flags) { - enum pad padding = before; - if (TYPE_PTRMEMFUNC_P (t)) { t = TYPE_PTRMEMFUNC_FN_TYPE (t); @@ -544,53 +501,52 @@ dump_type_prefix (tree t, int flags) { tree sub = TREE_TYPE (t); - padding = dump_type_prefix (sub, flags); + dump_type_prefix (sub, flags); if (TREE_CODE (sub) == ARRAY_TYPE) { - pp_space (cxx_pp); - pp_left_paren (cxx_pp); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_paren (cxx_pp); } pp_character (cxx_pp, "&*"[TREE_CODE (t) == POINTER_TYPE]); - padding = dump_qualifiers (t, before); + pp_base (cxx_pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq (cxx_pp, t); } break; case OFFSET_TYPE: offset_type: - padding = dump_type_prefix (TREE_TYPE (t), flags); + dump_type_prefix (TREE_TYPE (t), flags); if (TREE_CODE (t) == OFFSET_TYPE) /* pmfs deal with this in d_t_p */ { - if (padding != none) - pp_space (cxx_pp); + pp_maybe_space (cxx_pp); + if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) + pp_cxx_left_paren (cxx_pp); dump_type (TYPE_OFFSET_BASETYPE (t), flags); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } - pp_star (cxx_pp); - padding = dump_qualifiers (t, none); + pp_cxx_star (cxx_pp); + pp_cxx_cv_qualifier_seq (cxx_pp, t); + pp_base (cxx_pp)->padding = pp_before; break; /* Can only be reached through function pointer -- this would not be - correct if FUNCTION_DECLs used it. */ + correct if FUNCTION_DECLs used it. */ case FUNCTION_TYPE: - padding = dump_type_prefix (TREE_TYPE (t), flags); - if (padding != none) - pp_space (cxx_pp); - pp_left_paren (cxx_pp); - padding = none; + dump_type_prefix (TREE_TYPE (t), flags); + pp_maybe_space (cxx_pp); + pp_cxx_left_paren (cxx_pp); break; case METHOD_TYPE: - padding = dump_type_prefix (TREE_TYPE (t), flags); - if (padding != none) - pp_space (cxx_pp); - pp_left_paren (cxx_pp); - padding = none; + dump_type_prefix (TREE_TYPE (t), flags); + pp_maybe_space (cxx_pp); + pp_cxx_left_paren (cxx_pp); dump_aggr_type (TYPE_METHOD_BASETYPE (t), flags); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); break; case ARRAY_TYPE: - padding = dump_type_prefix (TREE_TYPE (t), flags); + dump_type_prefix (TREE_TYPE (t), flags); break; case ENUMERAL_TYPE: @@ -613,7 +569,7 @@ dump_type_prefix (tree t, int flags) case VECTOR_TYPE: case TYPEOF_TYPE: dump_type (t, flags); - padding = before; + pp_base (cxx_pp)->padding = pp_before; break; default: @@ -623,7 +579,6 @@ dump_type_prefix (tree t, int flags) pp_identifier (cxx_pp, ""); break; } - return padding; } /* Dump the suffix of type T, under control of FLAGS. This is the part @@ -641,7 +596,7 @@ dump_type_suffix (tree t, int flags) case REFERENCE_TYPE: case OFFSET_TYPE: if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE) - pp_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); dump_type_suffix (TREE_TYPE (t), flags); break; @@ -650,7 +605,7 @@ dump_type_suffix (tree t, int flags) case METHOD_TYPE: { tree arg; - pp_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); arg = TYPE_ARG_TYPES (t); if (TREE_CODE (t) == METHOD_TYPE) arg = TREE_CHAIN (arg); @@ -660,30 +615,33 @@ dump_type_suffix (tree t, int flags) dump_parameters (arg, flags & ~TFF_FUNCTION_DEFAULT_ARGUMENTS); if (TREE_CODE (t) == METHOD_TYPE) - dump_qualifiers - (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t))), before); + pp_cxx_cv_qualifier_seq + (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t)))); + else + pp_cxx_cv_qualifier_seq(cxx_pp, t); dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags); dump_type_suffix (TREE_TYPE (t), flags); break; } case ARRAY_TYPE: - pp_left_bracket (cxx_pp); + pp_maybe_space (cxx_pp); + pp_cxx_left_bracket (cxx_pp); if (TYPE_DOMAIN (t)) { if (host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0)) pp_wide_integer - (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1); + (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1); else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == MINUS_EXPR) dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0), - flags & ~TFF_EXPR_IN_PARENS); + flags & ~TFF_EXPR_IN_PARENS); else dump_expr (fold (cp_build_binary_op (PLUS_EXPR, TYPE_MAX_VALUE (TYPE_DOMAIN (t)), integer_one_node)), - flags & ~TFF_EXPR_IN_PARENS); + flags & ~TFF_EXPR_IN_PARENS); } - pp_right_bracket (cxx_pp); + pp_cxx_right_bracket (cxx_pp); dump_type_suffix (TREE_TYPE (t), flags); break; @@ -712,7 +670,7 @@ dump_type_suffix (tree t, int flags) pp_unsupported_tree (cxx_pp, t); case ERROR_MARK: /* Don't mark it here, we should have already done in - dump_type_prefix. */ + dump_type_prefix. */ break; } } @@ -727,7 +685,7 @@ dump_global_iord (tree t) else if (DECL_GLOBAL_DTOR_P (t)) p = "destructors"; else - abort (); + gcc_unreachable (); pp_printf (pp_base (cxx_pp), "(static %s for %s)", p, input_filename); } @@ -737,8 +695,8 @@ dump_simple_decl (tree t, tree type, int flags) { if (flags & TFF_DECL_SPECIFIERS) { - if (dump_type_prefix (type, flags) != none) - pp_space (cxx_pp); + dump_type_prefix (type, flags); + pp_maybe_space (cxx_pp); } if (!DECL_INITIAL (t) || TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX) dump_scope (CP_DECL_CONTEXT (t), flags); @@ -761,38 +719,35 @@ dump_decl (tree t, int flags) switch (TREE_CODE (t)) { case TYPE_DECL: - { - /* Don't say 'typedef class A' */ - if (DECL_ARTIFICIAL (t)) - { - if ((flags & TFF_DECL_SPECIFIERS) - && TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TYPE_PARM) - /* Say `class T' not just `T'. */ - pp_string (cxx_pp, "class "); + /* Don't say 'typedef class A' */ + if (DECL_ARTIFICIAL (t)) + { + if ((flags & TFF_DECL_SPECIFIERS) + && TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TYPE_PARM) + /* Say `class T' not just `T'. */ + pp_cxx_identifier (cxx_pp, "class"); - dump_type (TREE_TYPE (t), flags); - break; - } - } + dump_type (TREE_TYPE (t), flags); + break; + } if (flags & TFF_DECL_SPECIFIERS) - pp_string (cxx_pp, "typedef "); + pp_cxx_identifier (cxx_pp, "typedef"); dump_simple_decl (t, DECL_ORIGINAL_TYPE (t) ? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), - flags); + flags); break; case VAR_DECL: if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t))) { pp_string (cxx_pp, "vtable for "); - my_friendly_assert (TYPE_P (DECL_CONTEXT (t)), 20010720); + gcc_assert (TYPE_P (DECL_CONTEXT (t))); dump_type (DECL_CONTEXT (t), flags); break; } /* Else fall through. */ case FIELD_DECL: case PARM_DECL: - case ALIAS_DECL: dump_simple_decl (t, TREE_TYPE (t), flags); break; @@ -803,15 +758,15 @@ dump_decl (tree t, int flags) case NAMESPACE_DECL: if (flags & TFF_DECL_SPECIFIERS) - pp_cxx_declaration (cxx_pp, t); + pp_cxx_declaration (cxx_pp, t); else - { - dump_scope (CP_DECL_CONTEXT (t), flags); - if (DECL_NAME (t) == NULL_TREE) - pp_identifier (cxx_pp, ""); - else - pp_tree_identifier (cxx_pp, DECL_NAME (t)); - } + { + dump_scope (CP_DECL_CONTEXT (t), flags); + if (DECL_NAME (t) == NULL_TREE) + pp_identifier (cxx_pp, ""); + else + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t)); + } break; case SCOPE_REF: @@ -820,9 +775,9 @@ dump_decl (tree t, int flags) case ARRAY_REF: dump_decl (TREE_OPERAND (t, 0), flags); - pp_left_bracket (cxx_pp); + pp_cxx_left_bracket (cxx_pp); dump_decl (TREE_OPERAND (t, 1), flags); - pp_right_bracket (cxx_pp); + pp_cxx_right_bracket (cxx_pp); break; /* So that we can do dump_decl on an aggr type. */ @@ -834,13 +789,13 @@ dump_decl (tree t, int flags) case BIT_NOT_EXPR: /* This is a pseudo destructor call which has not been folded into - a PSEUDO_DTOR_EXPR yet. */ - pp_complement (cxx_pp); + a PSEUDO_DTOR_EXPR yet. */ + pp_cxx_complement (cxx_pp); dump_type (TREE_OPERAND (t, 0), flags); break; case TYPE_EXPR: - abort (); + gcc_unreachable (); break; /* These special cases are duplicated here so that other functions @@ -848,13 +803,13 @@ dump_decl (tree t, int flags) case IDENTIFIER_NODE: if (IDENTIFIER_TYPENAME_P (t)) { - pp_string (cxx_pp, "operator "); + pp_cxx_identifier (cxx_pp, "operator"); /* Not exactly IDENTIFIER_TYPE_VALUE. */ dump_type (TREE_TYPE (t), flags); break; } else - pp_tree_identifier (cxx_pp, t); + pp_cxx_tree_identifier (cxx_pp, t); break; case OVERLOAD: @@ -864,29 +819,29 @@ dump_decl (tree t, int flags) if (DECL_CLASS_SCOPE_P (t)) { dump_type (DECL_CONTEXT (t), flags); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } else if (DECL_CONTEXT (t)) { dump_decl (DECL_CONTEXT (t), flags); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } dump_decl (DECL_NAME (t), flags); break; } - + /* If there's only one function, just treat it like an ordinary FUNCTION_DECL. */ t = OVL_CURRENT (t); /* Fall through. */ case FUNCTION_DECL: - if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t)) + if (! DECL_LANG_SPECIFIC (t)) + pp_identifier (cxx_pp, ""); + else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t)) dump_global_iord (t); - else if (! DECL_LANG_SPECIFIC (t)) - pp_identifier (cxx_pp, ""); else - dump_function_decl (t, flags); + dump_function_decl (t, flags); break; case TEMPLATE_DECL: @@ -896,19 +851,19 @@ dump_decl (tree t, int flags) case TEMPLATE_ID_EXPR: { tree name = TREE_OPERAND (t, 0); - + if (is_overloaded_fn (name)) name = DECL_NAME (get_first_fn (name)); dump_decl (name, flags); - pp_template_argument_list_start (cxx_pp); + pp_cxx_begin_template_argument_list (cxx_pp); if (TREE_OPERAND (t, 1)) dump_template_argument_list (TREE_OPERAND (t, 1), flags); - pp_template_argument_list_end (cxx_pp); + pp_cxx_end_template_argument_list (cxx_pp); } break; case LABEL_DECL: - pp_tree_identifier (cxx_pp, DECL_NAME (t)); + pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t)); break; case CONST_DECL: @@ -925,9 +880,9 @@ dump_decl (tree t, int flags) break; case USING_DECL: - pp_string (cxx_pp, "using "); - dump_type (DECL_INITIAL (t), flags); - pp_colon_colon (cxx_pp); + pp_cxx_identifier (cxx_pp, "using"); + dump_type (USING_DECL_SCOPE (t), flags); + pp_cxx_colon_colon (cxx_pp); dump_decl (DECL_NAME (t), flags); break; @@ -941,14 +896,14 @@ dump_decl (tree t, int flags) case TEMPLATE_TYPE_PARM: if (flags & TFF_DECL_SPECIFIERS) - pp_cxx_declaration (cxx_pp, t); + pp_cxx_declaration (cxx_pp, t); else - pp_type_id (cxx_pp, t); + pp_type_id (cxx_pp, t); break; default: pp_unsupported_tree (cxx_pp, t); - /* Fallthrough to error. */ + /* Fall through to error. */ case ERROR_MARK: pp_identifier (cxx_pp, ""); @@ -969,54 +924,57 @@ dump_template_decl (tree t, int flags) if (flags & TFF_TEMPLATE_HEADER) { for (parms = orig_parms = nreverse (orig_parms); - parms; - parms = TREE_CHAIN (parms)) - { + parms; + parms = TREE_CHAIN (parms)) + { tree inner_parms = INNERMOST_TEMPLATE_PARMS (parms); - int len = TREE_VEC_LENGTH (inner_parms); + int len = TREE_VEC_LENGTH (inner_parms); - pp_string (cxx_pp, "template<"); + pp_cxx_identifier (cxx_pp, "template"); + pp_cxx_begin_template_argument_list (cxx_pp); /* If we've shown the template prefix, we'd better show the parameters' and decl's type too. */ flags |= TFF_DECL_SPECIFIERS; - for (i = 0; i < len; i++) - { - if (i) - pp_separate_with_comma (cxx_pp); - dump_template_parameter (TREE_VEC_ELT (inner_parms, i), flags); - } - pp_template_argument_list_end (cxx_pp); - pp_space (cxx_pp); - } + for (i = 0; i < len; i++) + { + if (i) + pp_separate_with_comma (cxx_pp); + dump_template_parameter (TREE_VEC_ELT (inner_parms, i), flags); + } + pp_cxx_end_template_argument_list (cxx_pp); + pp_cxx_whitespace (cxx_pp); + } nreverse(orig_parms); if (DECL_TEMPLATE_TEMPLATE_PARM_P (t)) /* Say `template class TT' not just `template TT'. */ - pp_string (cxx_pp, "class "); + pp_cxx_identifier (cxx_pp, "class"); } if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == TYPE_DECL) dump_type (TREE_TYPE (t), - ((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME - | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); + ((flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME + | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME); - else if (TREE_TYPE (t) == NULL_TREE) - abort (); else - switch (NEXT_CODE (t)) { - case METHOD_TYPE: - case FUNCTION_TYPE: - dump_function_decl (t, flags | TFF_TEMPLATE_NAME); - break; - default: - /* This case can occur with some invalid code. */ - dump_type (TREE_TYPE (t), - (flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME - | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0)); + gcc_assert (TREE_TYPE (t)); + switch (NEXT_CODE (t)) + { + case METHOD_TYPE: + case FUNCTION_TYPE: + dump_function_decl (t, flags | TFF_TEMPLATE_NAME); + break; + default: + /* This case can occur with some invalid code. */ + dump_type (TREE_TYPE (t), + (flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME + | (flags & TFF_DECL_SPECIFIERS + ? TFF_CLASS_KEY_OR_ENUM : 0)); + } } } @@ -1064,25 +1022,22 @@ dump_function_decl (tree t, int flags) if (!(flags & TFF_DECL_SPECIFIERS)) /* OK */; else if (DECL_STATIC_FUNCTION_P (t)) - pp_identifier (cxx_pp, "static "); + pp_cxx_identifier (cxx_pp, "static"); else if (DECL_VIRTUAL_P (t)) - pp_identifier (cxx_pp, "virtual "); + pp_cxx_identifier (cxx_pp, "virtual"); /* Print the return type? */ if (show_return) show_return = !DECL_CONV_FN_P (t) && !DECL_CONSTRUCTOR_P (t) - && !DECL_DESTRUCTOR_P (t); + && !DECL_DESTRUCTOR_P (t); if (show_return) - { - dump_type_prefix (TREE_TYPE (fntype), flags); - pp_space (cxx_pp); - } + dump_type_prefix (TREE_TYPE (fntype), flags); /* Print the function name. */ if (cname) { dump_type (cname, flags); - pp_colon_colon (cxx_pp); + pp_cxx_colon_colon (cxx_pp); } else dump_scope (CP_DECL_CONTEXT (t), flags); @@ -1094,11 +1049,17 @@ dump_function_decl (tree t, int flags) dump_parameters (parmtypes, flags); if (TREE_CODE (fntype) == METHOD_TYPE) - dump_qualifiers (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))), - before); + { + pp_base (cxx_pp)->padding = pp_before; + pp_cxx_cv_qualifier_seq + (cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype)))); + } if (flags & TFF_EXCEPTION_SPECIFICATION) - dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags); + { + pp_base (cxx_pp)->padding = pp_before; + dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags); + } if (show_return) dump_type_suffix (TREE_TYPE (fntype), flags); @@ -1107,9 +1068,12 @@ dump_function_decl (tree t, int flags) /* If T is a template instantiation, dump the parameter binding. */ if (template_parms != NULL_TREE && template_args != NULL_TREE) { - pp_string (cxx_pp, " [with "); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_bracket (cxx_pp); + pp_cxx_identifier (cxx_pp, "with"); + pp_cxx_whitespace (cxx_pp); dump_template_bindings (template_parms, template_args); - pp_right_bracket (cxx_pp); + pp_cxx_right_bracket (cxx_pp); } } @@ -1122,29 +1086,31 @@ dump_parameters (tree parmtypes, int flags) { int first; - pp_left_paren (cxx_pp); + pp_cxx_left_paren (cxx_pp); for (first = 1; parmtypes != void_list_node; parmtypes = TREE_CHAIN (parmtypes)) { if (!first) - pp_separate_with_comma (cxx_pp); + pp_separate_with_comma (cxx_pp); first = 0; if (!parmtypes) - { - pp_identifier (cxx_pp, "..."); - break; - } + { + pp_cxx_identifier (cxx_pp, "..."); + break; + } dump_type (TREE_VALUE (parmtypes), flags); if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && TREE_PURPOSE (parmtypes)) - { - pp_string (cxx_pp, " = "); - dump_expr (TREE_PURPOSE (parmtypes), flags | TFF_EXPR_IN_PARENS); - } + { + pp_cxx_whitespace (cxx_pp); + pp_equal (cxx_pp); + pp_cxx_whitespace (cxx_pp); + dump_expr (TREE_PURPOSE (parmtypes), flags | TFF_EXPR_IN_PARENS); + } } - pp_right_paren (cxx_pp); + pp_cxx_right_paren (cxx_pp); } /* Print an exception specification. T is the exception specification. */ @@ -1154,17 +1120,19 @@ dump_exception_spec (tree t, int flags) { if (t) { - pp_string (cxx_pp, " throw ("); + pp_cxx_identifier (cxx_pp, "throw"); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_paren (cxx_pp); if (TREE_VALUE (t) != NULL_TREE) - while (1) - { - dump_type (TREE_VALUE (t), flags); - t = TREE_CHAIN (t); - if (!t) - break; - pp_separate_with_comma (cxx_pp); - } - pp_right_paren (cxx_pp); + while (1) + { + dump_type (TREE_VALUE (t), flags); + t = TREE_CHAIN (t); + if (!t) + break; + pp_separate_with_comma (cxx_pp); + } + pp_cxx_right_paren (cxx_pp); } } @@ -1176,6 +1144,17 @@ dump_function_name (tree t, int flags) { tree name = DECL_NAME (t); + /* We can get here with a decl that was synthesized by language- + independent machinery (e.g. coverage.c) in which case it won't + have a lang_specific structure attached and DECL_CONSTRUCTOR_P + will crash. In this case it is safe just to print out the + literal name. */ + if (!DECL_LANG_SPECIFIC (t)) + { + pp_cxx_tree_identifier (cxx_pp, name); + return; + } + if (TREE_CODE (t) == TEMPLATE_DECL) t = DECL_TEMPLATE_RESULT (t); @@ -1186,7 +1165,7 @@ dump_function_name (tree t, int flags) if (DECL_DESTRUCTOR_P (t)) { - pp_complement (cxx_pp); + pp_cxx_complement (cxx_pp); dump_decl (name, TFF_PLAIN_IDENTIFIER); } else if (DECL_CONV_FN_P (t)) @@ -1197,19 +1176,17 @@ dump_function_name (tree t, int flags) declarations, both will have the same name, yet the types will be different, hence the TREE_TYPE field of the first name will be clobbered by the second. */ - pp_string (cxx_pp, "operator "); + pp_cxx_identifier (cxx_pp, "operator"); dump_type (TREE_TYPE (TREE_TYPE (t)), flags); } else if (IDENTIFIER_OPNAME_P (name)) - pp_tree_identifier (cxx_pp, name); + pp_cxx_tree_identifier (cxx_pp, name); else dump_decl (name, flags); - if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t) + if (DECL_TEMPLATE_INFO (t) && !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t) - && (DECL_TEMPLATE_SPECIALIZATION (t) - || TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL - || DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t)) + && (TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL || PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t)))) dump_template_parms (DECL_TEMPLATE_INFO (t), !DECL_USE_TEMPLATE (t), flags); } @@ -1228,7 +1205,7 @@ dump_template_parms (tree info, int primary, int flags) if (primary && flags & TFF_TEMPLATE_NAME) return; flags &= ~(TFF_CLASS_KEY_OR_ENUM | TFF_TEMPLATE_NAME); - pp_template_argument_list_start (cxx_pp); + pp_cxx_begin_template_argument_list (cxx_pp); /* Be careful only to print things when we have them, so as not to crash producing error messages. */ @@ -1238,21 +1215,21 @@ dump_template_parms (tree info, int primary, int flags) if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args)) args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1); - + len = TREE_VEC_LENGTH (args); for (ix = 0; ix != len; ix++) - { - tree arg = TREE_VEC_ELT (args, ix); + { + tree arg = TREE_VEC_ELT (args, ix); - if (ix) - pp_separate_with_comma (cxx_pp); - - if (!arg) - pp_identifier (cxx_pp, "